summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2011-05-07 14:35:36 +0200
committerNadeem Vawda <nadeem.vawda@gmail.com>2011-05-07 14:35:36 +0200
commit496564fe5be17057671a373f4a1126352823ece5 (patch)
treed7406a1080f024f81c85b95ef34919e07e508dcc
parent4117f99e46b886e37294835fc4683ea134d92bca (diff)
parent283036bb327333e0960d2e5009518ccdb44b6183 (diff)
downloadcpython-496564fe5be17057671a373f4a1126352823ece5.tar.gz
Merge: Fix potential resource leak in test_mmap.
-rw-r--r--.bzrignore22
-rw-r--r--.gitignore44
-rw-r--r--.hgignore55
-rw-r--r--Demo/README61
-rw-r--r--Demo/cgi/README10
-rwxr-xr-xDemo/cgi/cgi0.sh8
-rwxr-xr-xDemo/cgi/cgi1.py14
-rwxr-xr-xDemo/cgi/cgi2.py22
-rwxr-xr-xDemo/cgi/cgi3.py10
-rw-r--r--Demo/cgi/wiki.py123
-rwxr-xr-xDemo/classes/Complex.py314
-rwxr-xr-xDemo/classes/Dates.py227
-rwxr-xr-xDemo/classes/Dbm.py66
-rw-r--r--Demo/classes/README12
-rwxr-xr-xDemo/classes/Range.py93
-rwxr-xr-xDemo/classes/Rev.py95
-rwxr-xr-xDemo/classes/bitvec.py322
-rw-r--r--Demo/comparisons/README60
-rwxr-xr-xDemo/comparisons/patterns4
-rwxr-xr-xDemo/comparisons/regextest.py47
-rwxr-xr-xDemo/comparisons/sortingtest.py45
-rwxr-xr-xDemo/comparisons/systemtest.py74
-rw-r--r--Demo/curses/README25
-rw-r--r--Demo/curses/ncurses.py273
-rw-r--r--Demo/curses/rain.py94
-rwxr-xr-xDemo/curses/repeat.py80
-rw-r--r--Demo/curses/tclock.py147
-rw-r--r--Demo/curses/xmas.py906
-rw-r--r--Demo/embed/Makefile57
-rw-r--r--Demo/embed/README19
-rw-r--r--Demo/embed/demo.c89
-rw-r--r--Demo/embed/importexc.c23
-rw-r--r--Demo/embed/loop.c33
-rw-r--r--Demo/md5test/README10
-rwxr-xr-xDemo/md5test/foo1
-rwxr-xr-xDemo/md5test/md5driver.py122
-rw-r--r--Demo/newmetaclasses/Enum.py177
-rw-r--r--Demo/parser/FILES6
-rw-r--r--Demo/parser/README31
-rw-r--r--Demo/parser/docstring.py2
-rw-r--r--Demo/parser/example.py190
-rw-r--r--Demo/parser/simple.py1
-rw-r--r--Demo/parser/source.py27
-rwxr-xr-xDemo/parser/test_parser.py48
-rw-r--r--Demo/parser/texipre.dat100
-rwxr-xr-xDemo/pdist/FSProxy.py322
-rwxr-xr-xDemo/pdist/RCSProxy.py198
-rw-r--r--Demo/pdist/README121
-rwxr-xr-xDemo/pdist/client.py156
-rwxr-xr-xDemo/pdist/cmdfw.py142
-rwxr-xr-xDemo/pdist/cmptree.py213
-rwxr-xr-xDemo/pdist/cvslib.py359
-rwxr-xr-xDemo/pdist/cvslock.py279
-rwxr-xr-xDemo/pdist/mac.py24
-rwxr-xr-xDemo/pdist/makechangelog.py109
-rwxr-xr-xDemo/pdist/rcsbump33
-rwxr-xr-xDemo/pdist/rcsclient.py71
-rwxr-xr-xDemo/pdist/rcslib.py334
-rwxr-xr-xDemo/pdist/rcvs8
-rwxr-xr-xDemo/pdist/rcvs.py476
-rwxr-xr-xDemo/pdist/rrcs8
-rwxr-xr-xDemo/pdist/rrcs.py158
-rwxr-xr-xDemo/pdist/security.py33
-rwxr-xr-xDemo/pdist/server.py143
-rwxr-xr-xDemo/pdist/sumtree.py27
-rw-r--r--Demo/pysvr/Makefile57
-rw-r--r--Demo/pysvr/README9
-rw-r--r--Demo/pysvr/pysvr.c370
-rwxr-xr-xDemo/pysvr/pysvr.py124
-rw-r--r--Demo/rpc/MANIFEST10
-rw-r--r--Demo/rpc/README31
-rw-r--r--Demo/rpc/T.py22
-rw-r--r--Demo/rpc/mountclient.py202
-rw-r--r--Demo/rpc/nfsclient.py201
-rw-r--r--Demo/rpc/rnusersclient.py98
-rw-r--r--Demo/rpc/rpc.py890
-rwxr-xr-xDemo/rpc/test24
-rw-r--r--Demo/rpc/xdr.py200
-rw-r--r--Demo/scripts/README22
-rwxr-xr-xDemo/scripts/eqfix.py198
-rwxr-xr-xDemo/scripts/fact.py49
-rwxr-xr-xDemo/scripts/from.py35
-rwxr-xr-xDemo/scripts/lpwatch.py102
-rwxr-xr-xDemo/scripts/makedir.py21
-rwxr-xr-xDemo/scripts/mboxconvert.py124
-rwxr-xr-xDemo/scripts/morse.py128
-rwxr-xr-xDemo/scripts/newslist.doc59
-rwxr-xr-xDemo/scripts/newslist.py361
-rwxr-xr-xDemo/scripts/pi.py33
-rwxr-xr-xDemo/scripts/pp.py125
-rwxr-xr-xDemo/scripts/primes.py27
-rwxr-xr-xDemo/scripts/script.py42
-rw-r--r--Demo/scripts/toaiff.py107
-rwxr-xr-xDemo/scripts/unbirthday.py106
-rwxr-xr-xDemo/scripts/update.py92
-rwxr-xr-xDemo/scripts/wh.py2
-rw-r--r--Demo/sockets/README14
-rwxr-xr-xDemo/sockets/broadcast.py15
-rwxr-xr-xDemo/sockets/echosvr.py31
-rwxr-xr-xDemo/sockets/finger.py58
-rwxr-xr-xDemo/sockets/ftp.py152
-rwxr-xr-xDemo/sockets/gopher.py352
-rwxr-xr-xDemo/sockets/radio.py14
-rwxr-xr-xDemo/sockets/rpython.py35
-rwxr-xr-xDemo/sockets/telnet.py109
-rwxr-xr-xDemo/sockets/throughput.py93
-rwxr-xr-xDemo/sockets/udpecho.py64
-rw-r--r--Demo/sockets/unicast.py14
-rw-r--r--Demo/sockets/unixclient.py12
-rw-r--r--Demo/sockets/unixserver.py24
-rw-r--r--Demo/threads/Coroutine.py159
-rw-r--r--Demo/threads/Generator.py92
-rw-r--r--Demo/threads/README11
-rw-r--r--Demo/threads/fcmp.py64
-rw-r--r--Demo/threads/find.py154
-rw-r--r--Demo/threads/squasher.py105
-rw-r--r--Demo/threads/sync.py599
-rw-r--r--Demo/threads/telnet.py114
-rw-r--r--Demo/tix/INSTALL.txt89
-rw-r--r--Demo/tix/README.txt19
-rwxr-xr-xDemo/tix/bitmaps/about.xpm50
-rwxr-xr-xDemo/tix/bitmaps/bold.xbm6
-rwxr-xr-xDemo/tix/bitmaps/capital.xbm6
-rwxr-xr-xDemo/tix/bitmaps/centerj.xbm6
-rwxr-xr-xDemo/tix/bitmaps/combobox.xbm14
-rwxr-xr-xDemo/tix/bitmaps/combobox.xpm49
-rwxr-xr-xDemo/tix/bitmaps/combobox.xpm.147
-rwxr-xr-xDemo/tix/bitmaps/drivea.xbm14
-rwxr-xr-xDemo/tix/bitmaps/drivea.xpm43
-rwxr-xr-xDemo/tix/bitmaps/exit.xpm48
-rwxr-xr-xDemo/tix/bitmaps/filebox.xbm14
-rwxr-xr-xDemo/tix/bitmaps/filebox.xpm49
-rwxr-xr-xDemo/tix/bitmaps/italic.xbm6
-rwxr-xr-xDemo/tix/bitmaps/justify.xbm6
-rwxr-xr-xDemo/tix/bitmaps/leftj.xbm6
-rwxr-xr-xDemo/tix/bitmaps/netw.xbm14
-rwxr-xr-xDemo/tix/bitmaps/netw.xpm45
-rwxr-xr-xDemo/tix/bitmaps/optmenu.xpm48
-rwxr-xr-xDemo/tix/bitmaps/rightj.xbm6
-rwxr-xr-xDemo/tix/bitmaps/select.xpm52
-rwxr-xr-xDemo/tix/bitmaps/tix.gifbin11042 -> 0 bytes
-rwxr-xr-xDemo/tix/bitmaps/underline.xbm6
-rw-r--r--Demo/tix/grid.py28
-rwxr-xr-xDemo/tix/samples/Balloon.py68
-rwxr-xr-xDemo/tix/samples/BtnBox.py44
-rwxr-xr-xDemo/tix/samples/CmpImg.py196
-rwxr-xr-xDemo/tix/samples/ComboBox.py102
-rwxr-xr-xDemo/tix/samples/Control.py122
-rwxr-xr-xDemo/tix/samples/DirList.py131
-rwxr-xr-xDemo/tix/samples/DirTree.py117
-rwxr-xr-xDemo/tix/samples/NoteBook.py119
-rwxr-xr-xDemo/tix/samples/OptMenu.py68
-rwxr-xr-xDemo/tix/samples/PanedWin.py98
-rwxr-xr-xDemo/tix/samples/PopMenu.py57
-rwxr-xr-xDemo/tix/samples/SHList1.py131
-rwxr-xr-xDemo/tix/samples/SHList2.py168
-rwxr-xr-xDemo/tix/samples/Tree.py80
-rw-r--r--Demo/tix/tixwidgets.py1002
-rw-r--r--Demo/tkinter/README11
-rw-r--r--Demo/tkinter/guido/attr_dialog.py460
-rw-r--r--Demo/tkinter/guido/brownian.py50
-rw-r--r--Demo/tkinter/guido/brownian2.py55
-rw-r--r--Demo/tkinter/guido/canvasevents.py264
-rwxr-xr-xDemo/tkinter/guido/dialog.py108
-rwxr-xr-xDemo/tkinter/guido/electrons.py91
-rwxr-xr-xDemo/tkinter/guido/hello.py17
-rwxr-xr-xDemo/tkinter/guido/imagedraw.py23
-rwxr-xr-xDemo/tkinter/guido/imageview.py12
-rwxr-xr-xDemo/tkinter/guido/kill.py98
-rwxr-xr-xDemo/tkinter/guido/listtree.py34
-rw-r--r--Demo/tkinter/guido/manpage.py215
-rwxr-xr-xDemo/tkinter/guido/mbox.py286
-rwxr-xr-xDemo/tkinter/guido/mimeviewer.py159
-rw-r--r--Demo/tkinter/guido/newmenubardemo.py47
-rw-r--r--Demo/tkinter/guido/optionmenu.py27
-rw-r--r--Demo/tkinter/guido/paint.py60
-rwxr-xr-xDemo/tkinter/guido/rmt.py159
-rw-r--r--Demo/tkinter/guido/shell_window.py146
-rwxr-xr-xDemo/tkinter/guido/solitaire.py626
-rwxr-xr-xDemo/tkinter/guido/svkill.py124
-rw-r--r--Demo/tkinter/guido/switch.py55
-rwxr-xr-xDemo/tkinter/guido/tkman.py267
-rwxr-xr-xDemo/tkinter/guido/wish.py34
-rw-r--r--Demo/tkinter/matt/00-HELLO-WORLD.py27
-rw-r--r--Demo/tkinter/matt/README30
-rw-r--r--Demo/tkinter/matt/animation-simple.py35
-rw-r--r--Demo/tkinter/matt/animation-w-velocity-ctrl.py44
-rw-r--r--Demo/tkinter/matt/bind-w-mult-calls-p-type.py43
-rw-r--r--Demo/tkinter/matt/canvas-demo-simple.py28
-rw-r--r--Demo/tkinter/matt/canvas-gridding.py61
-rw-r--r--Demo/tkinter/matt/canvas-moving-or-creating.py62
-rw-r--r--Demo/tkinter/matt/canvas-moving-w-mouse.py55
-rw-r--r--Demo/tkinter/matt/canvas-mult-item-sel.py78
-rw-r--r--Demo/tkinter/matt/canvas-reading-tag-info.py49
-rw-r--r--Demo/tkinter/matt/canvas-w-widget-draw-el.py36
-rw-r--r--Demo/tkinter/matt/canvas-with-scrollbars.py60
-rw-r--r--Demo/tkinter/matt/dialog-box.py64
-rw-r--r--Demo/tkinter/matt/entry-simple.py24
-rw-r--r--Demo/tkinter/matt/entry-with-shared-variable.py45
-rw-r--r--Demo/tkinter/matt/killing-window-w-wm.py42
-rw-r--r--Demo/tkinter/matt/menu-all-types-of-entries.py244
-rw-r--r--Demo/tkinter/matt/menu-simple.py112
-rw-r--r--Demo/tkinter/matt/not-what-you-might-think-1.py28
-rw-r--r--Demo/tkinter/matt/not-what-you-might-think-2.py30
-rw-r--r--Demo/tkinter/matt/packer-and-placer-together.py41
-rw-r--r--Demo/tkinter/matt/packer-simple.py32
-rw-r--r--Demo/tkinter/matt/placer-simple.py39
-rw-r--r--Demo/tkinter/matt/pong-demo-1.py52
-rw-r--r--Demo/tkinter/matt/printing-coords-of-items.py61
-rw-r--r--Demo/tkinter/matt/radiobutton-simple.py62
-rw-r--r--Demo/tkinter/matt/rubber-band-box-demo-1.py58
-rw-r--r--Demo/tkinter/matt/rubber-line-demo-1.py51
-rw-r--r--Demo/tkinter/matt/slider-demo-1.py36
-rw-r--r--Demo/tkinter/matt/subclass-existing-widgets.py28
-rw-r--r--Demo/tkinter/matt/two-radio-groups.py110
-rw-r--r--Demo/tkinter/matt/window-creation-more.py35
-rw-r--r--Demo/tkinter/matt/window-creation-simple.py31
-rw-r--r--Demo/tkinter/matt/window-creation-w-location.py45
-rw-r--r--Demo/tkinter/ttk/combo_themes.py46
-rw-r--r--Demo/tkinter/ttk/dirbrowser.py93
-rw-r--r--Demo/tkinter/ttk/img/close.gifbin101 -> 0 bytes
-rw-r--r--Demo/tkinter/ttk/img/close_active.gifbin80 -> 0 bytes
-rw-r--r--Demo/tkinter/ttk/img/close_pressed.gifbin101 -> 0 bytes
-rw-r--r--Demo/tkinter/ttk/listbox_scrollcmd.py37
-rw-r--r--Demo/tkinter/ttk/mac_searchentry.py78
-rw-r--r--Demo/tkinter/ttk/notebook_closebtn.py78
-rw-r--r--Demo/tkinter/ttk/plastik_theme.py268
-rw-r--r--Demo/tkinter/ttk/roundframe.py111
-rw-r--r--Demo/tkinter/ttk/theme_selector.py61
-rw-r--r--Demo/tkinter/ttk/treeview_multicolumn.py107
-rw-r--r--Demo/tkinter/ttk/ttkcalendar.py231
-rw-r--r--Demo/tkinter/ttk/widget_state.py83
-rw-r--r--Demo/turtle/tdemo_I_dontlike_tiltdemo.py58
-rw-r--r--Demo/xml/elem_count.py42
-rw-r--r--Demo/xml/roundtrip.py46
-rw-r--r--Demo/xml/rss2html.py97
-rwxr-xr-xDemo/zlib/minigzip.py133
-rwxr-xr-xDemo/zlib/zlibdemo.py48
-rw-r--r--Doc/ACKS.txt2
-rw-r--r--Doc/Makefile22
-rw-r--r--Doc/README.txt7
-rw-r--r--Doc/c-api/abstract.rst2
-rw-r--r--Doc/c-api/allocation.rst26
-rw-r--r--Doc/c-api/arg.rst232
-rw-r--r--Doc/c-api/bool.rst14
-rw-r--r--Doc/c-api/buffer.rst116
-rw-r--r--Doc/c-api/bytearray.rst32
-rw-r--r--Doc/c-api/bytes.rst50
-rw-r--r--Doc/c-api/capsule.rst68
-rw-r--r--Doc/c-api/cell.rst16
-rw-r--r--Doc/c-api/cobject.rst59
-rw-r--r--Doc/c-api/code.rst50
-rw-r--r--Doc/c-api/codec.rst34
-rw-r--r--Doc/c-api/complex.rst66
-rw-r--r--Doc/c-api/concrete.rst4
-rw-r--r--Doc/c-api/conversion.rst69
-rw-r--r--Doc/c-api/datetime.rst96
-rw-r--r--Doc/c-api/descriptor.rst16
-rw-r--r--Doc/c-api/dict.rst74
-rw-r--r--Doc/c-api/exceptions.rst414
-rw-r--r--Doc/c-api/file.rst22
-rw-r--r--Doc/c-api/float.rst48
-rw-r--r--Doc/c-api/function.rst30
-rw-r--r--Doc/c-api/gcsupport.rst56
-rw-r--r--Doc/c-api/gen.rst12
-rw-r--r--Doc/c-api/import.rst101
-rw-r--r--Doc/c-api/init.rst336
-rw-r--r--Doc/c-api/intro.rst110
-rw-r--r--Doc/c-api/iter.rst4
-rw-r--r--Doc/c-api/iterator.rst20
-rw-r--r--Doc/c-api/list.rst52
-rw-r--r--Doc/c-api/long.rst142
-rw-r--r--Doc/c-api/mapping.rst22
-rw-r--r--Doc/c-api/marshal.rst34
-rw-r--r--Doc/c-api/memory.rst48
-rw-r--r--Doc/c-api/memoryview.rst12
-rw-r--r--Doc/c-api/method.rst44
-rw-r--r--Doc/c-api/module.rst95
-rw-r--r--Doc/c-api/none.rst10
-rw-r--r--Doc/c-api/number.rst92
-rw-r--r--Doc/c-api/objbuffer.rst14
-rw-r--r--Doc/c-api/object.rst119
-rw-r--r--Doc/c-api/refcounting.rst32
-rw-r--r--Doc/c-api/reflection.rst19
-rw-r--r--Doc/c-api/sequence.rst60
-rw-r--r--Doc/c-api/set.rst62
-rw-r--r--Doc/c-api/slice.rst20
-rw-r--r--Doc/c-api/structures.rst92
-rw-r--r--Doc/c-api/sys.rst93
-rw-r--r--Doc/c-api/tuple.rst38
-rw-r--r--Doc/c-api/type.rst32
-rw-r--r--Doc/c-api/typeobj.rst322
-rw-r--r--Doc/c-api/unicode.rst412
-rw-r--r--Doc/c-api/veryhigh.rst181
-rw-r--r--Doc/c-api/weakref.rst18
-rw-r--r--Doc/conf.py8
-rw-r--r--Doc/copyright.rst2
-rw-r--r--Doc/data/refcounts.dat26
-rw-r--r--Doc/distutils/apiref.rst172
-rw-r--r--Doc/distutils/builtdist.rst10
-rw-r--r--Doc/distutils/commandref.rst4
-rw-r--r--Doc/distutils/examples.rst6
-rw-r--r--Doc/distutils/extending.rst4
-rw-r--r--Doc/distutils/sourcedist.rst6
-rw-r--r--Doc/distutils/uploading.rst7
-rw-r--r--Doc/documenting/building.rst10
-rw-r--r--Doc/documenting/markup.rst73
-rw-r--r--Doc/documenting/style.rst73
-rw-r--r--Doc/extending/embedding.rst25
-rw-r--r--Doc/extending/extending.rst288
-rw-r--r--Doc/extending/newtypes.rst108
-rw-r--r--Doc/extending/windows.rst6
-rw-r--r--Doc/faq/design.rst15
-rw-r--r--Doc/faq/extending.rst76
-rw-r--r--Doc/faq/gui.rst63
-rw-r--r--Doc/faq/installed.rst10
-rw-r--r--Doc/faq/library.rst73
-rw-r--r--Doc/faq/programming.rst23
-rw-r--r--Doc/faq/windows.rst9
-rw-r--r--Doc/glossary.rst43
-rw-r--r--Doc/howto/cporting.rst16
-rw-r--r--Doc/howto/descriptor.rst6
-rw-r--r--Doc/howto/doanddont.rst290
-rw-r--r--Doc/howto/index.rst4
-rw-r--r--Doc/howto/logging-cookbook.rst1039
-rw-r--r--Doc/howto/logging.rst1026
-rw-r--r--Doc/howto/pyporting.rst703
-rw-r--r--Doc/howto/sorting.rst12
-rw-r--r--Doc/howto/unicode.rst102
-rw-r--r--Doc/howto/webservers.rst2
-rw-r--r--Doc/includes/dbpickle.py3
-rw-r--r--Doc/includes/email-alternative.py2
-rw-r--r--Doc/includes/email-dir.py2
-rw-r--r--Doc/includes/email-headers.py17
-rw-r--r--Doc/includes/email-mime.py2
-rw-r--r--Doc/includes/email-simple.py5
-rw-r--r--Doc/includes/email-unpack.py2
-rw-r--r--Doc/includes/minidom-example.py6
-rw-r--r--Doc/includes/mp_benchmarks.py13
-rw-r--r--Doc/includes/mp_pool.py8
-rw-r--r--Doc/includes/mp_synchronize.py10
-rw-r--r--Doc/includes/mp_webserver.py4
-rw-r--r--Doc/includes/sqlite3/adapter_datetime.py3
-rw-r--r--Doc/includes/sqlite3/load_extension.py26
-rw-r--r--Doc/includes/turtle-star.py10
-rw-r--r--Doc/includes/tzinfo-examples.py2
-rw-r--r--Doc/install/index.rst3
-rw-r--r--Doc/library/2to3.rst23
-rw-r--r--Doc/library/__future__.rst3
-rw-r--r--Doc/library/_dummy_thread.rst3
-rw-r--r--Doc/library/_thread.rst48
-rw-r--r--Doc/library/abc.rst36
-rw-r--r--Doc/library/aifc.rst4
-rw-r--r--Doc/library/allos.rst3
-rw-r--r--Doc/library/argparse.rst1816
-rw-r--r--Doc/library/array.rst36
-rw-r--r--Doc/library/ast.rst10
-rw-r--r--Doc/library/asynchat.rst5
-rw-r--r--Doc/library/asyncore.rst57
-rw-r--r--Doc/library/atexit.rst1
-rw-r--r--Doc/library/base64.rst12
-rw-r--r--Doc/library/bdb.rst25
-rw-r--r--Doc/library/binascii.rst15
-rw-r--r--Doc/library/bisect.rst4
-rw-r--r--Doc/library/builtins.rst2
-rw-r--r--Doc/library/calendar.rst6
-rw-r--r--Doc/library/cgi.rst26
-rw-r--r--Doc/library/cmath.rst15
-rw-r--r--Doc/library/cmd.rst162
-rw-r--r--Doc/library/codecs.rst69
-rw-r--r--Doc/library/collections.rst105
-rw-r--r--Doc/library/colorsys.rst3
-rw-r--r--Doc/library/compileall.rst69
-rw-r--r--Doc/library/concurrent.futures.rst371
-rw-r--r--Doc/library/configparser.rst1359
-rw-r--r--Doc/library/contextlib.rst136
-rw-r--r--Doc/library/csv.rst19
-rw-r--r--Doc/library/ctypes.rst207
-rw-r--r--Doc/library/curses.rst2
-rw-r--r--Doc/library/datetime.rst209
-rw-r--r--Doc/library/dbm.rst9
-rw-r--r--Doc/library/decimal.rst110
-rw-r--r--Doc/library/difflib.rst61
-rw-r--r--Doc/library/dis.rst61
-rw-r--r--Doc/library/doctest.rst54
-rw-r--r--Doc/library/dummy_threading.rst3
-rw-r--r--Doc/library/email-examples.rst6
-rw-r--r--Doc/library/email.generator.rst99
-rw-r--r--Doc/library/email.header.rst35
-rw-r--r--Doc/library/email.message.rst24
-rw-r--r--Doc/library/email.parser.rst69
-rw-r--r--Doc/library/email.rst40
-rw-r--r--Doc/library/email.util.rst10
-rw-r--r--Doc/library/exceptions.rst26
-rw-r--r--Doc/library/fcntl.rst10
-rw-r--r--Doc/library/filecmp.rst3
-rw-r--r--Doc/library/fileformats.rst2
-rw-r--r--Doc/library/fileinput.rst38
-rw-r--r--Doc/library/fnmatch.rst7
-rw-r--r--Doc/library/fractions.rst52
-rw-r--r--Doc/library/ftplib.rst92
-rw-r--r--Doc/library/functional.rst15
-rw-r--r--Doc/library/functions.rst175
-rw-r--r--Doc/library/functools.rst142
-rw-r--r--Doc/library/gc.rst20
-rw-r--r--Doc/library/getopt.rst36
-rw-r--r--Doc/library/gettext.rst3
-rw-r--r--Doc/library/glob.rst4
-rw-r--r--Doc/library/gzip.rst57
-rw-r--r--Doc/library/hashlib.rst34
-rw-r--r--Doc/library/heapq.rst4
-rw-r--r--Doc/library/hmac.rst3
-rw-r--r--Doc/library/html.entities.rst3
-rw-r--r--Doc/library/html.parser.rst19
-rw-r--r--Doc/library/html.rst21
-rw-r--r--Doc/library/http.client.rst95
-rw-r--r--Doc/library/http.cookiejar.rst3
-rw-r--r--Doc/library/http.cookies.rst3
-rw-r--r--Doc/library/http.server.rst39
-rw-r--r--Doc/library/imaplib.rst31
-rw-r--r--Doc/library/imghdr.rst3
-rw-r--r--Doc/library/imp.rst46
-rw-r--r--Doc/library/importlib.rst295
-rw-r--r--Doc/library/index.rst2
-rw-r--r--Doc/library/inspect.rst113
-rw-r--r--Doc/library/io.rst84
-rw-r--r--Doc/library/itertools.rst27
-rw-r--r--Doc/library/json.rst12
-rw-r--r--Doc/library/keyword.rst4
-rw-r--r--Doc/library/language.rst1
-rw-r--r--Doc/library/linecache.rst3
-rw-r--r--Doc/library/locale.rst4
-rw-r--r--Doc/library/logging.config.rst680
-rw-r--r--Doc/library/logging.handlers.rst850
-rw-r--r--Doc/library/logging.rst3158
-rw-r--r--Doc/library/mailbox.rst50
-rw-r--r--Doc/library/mailcap.rst3
-rw-r--r--Doc/library/markup.rst1
-rw-r--r--Doc/library/math.rst79
-rw-r--r--Doc/library/mimetypes.rst20
-rw-r--r--Doc/library/mmap.rst20
-rw-r--r--Doc/library/modulefinder.rst3
-rw-r--r--Doc/library/msilib.rst38
-rw-r--r--Doc/library/msvcrt.rst20
-rw-r--r--Doc/library/multiprocessing.rst62
-rw-r--r--Doc/library/netrc.rst3
-rw-r--r--Doc/library/nntplib.rst556
-rw-r--r--Doc/library/numeric.rst3
-rw-r--r--Doc/library/objects.rst27
-rw-r--r--Doc/library/operator.rst198
-rw-r--r--Doc/library/optparse.rst14
-rw-r--r--Doc/library/os.path.rst22
-rw-r--r--Doc/library/os.rst304
-rw-r--r--Doc/library/ossaudiodev.rst12
-rw-r--r--Doc/library/parser.rst17
-rw-r--r--Doc/library/pdb.rst391
-rw-r--r--Doc/library/persistence.rst1
-rw-r--r--Doc/library/pickle.rst12
-rw-r--r--Doc/library/pickletools.rst88
-rw-r--r--Doc/library/pipes.rst4
-rw-r--r--Doc/library/pkgutil.rst15
-rw-r--r--Doc/library/platform.rst9
-rw-r--r--Doc/library/plistlib.rst4
-rw-r--r--Doc/library/poplib.rst18
-rw-r--r--Doc/library/posix.rst25
-rw-r--r--Doc/library/pprint.rst18
-rw-r--r--Doc/library/profile.rst33
-rw-r--r--Doc/library/pty.rst48
-rw-r--r--Doc/library/pwd.rst1
-rw-r--r--Doc/library/py_compile.rst44
-rw-r--r--Doc/library/pyclbr.rst8
-rw-r--r--Doc/library/pydoc.rst24
-rw-r--r--Doc/library/pyexpat.rst94
-rw-r--r--Doc/library/python.rst3
-rw-r--r--Doc/library/queue.rst33
-rw-r--r--Doc/library/quopri.rst22
-rw-r--r--Doc/library/random.rst124
-rw-r--r--Doc/library/re.rst507
-rw-r--r--Doc/library/readline.rst3
-rw-r--r--Doc/library/reprlib.rst27
-rw-r--r--Doc/library/resource.rst16
-rw-r--r--Doc/library/rlcompleter.rst4
-rw-r--r--Doc/library/runpy.rst146
-rw-r--r--Doc/library/sched.rst5
-rw-r--r--Doc/library/select.rst50
-rw-r--r--Doc/library/shelve.rst23
-rw-r--r--Doc/library/shlex.rst17
-rw-r--r--Doc/library/shutil.rst218
-rw-r--r--Doc/library/signal.rst28
-rw-r--r--Doc/library/site.rst30
-rw-r--r--Doc/library/smtpd.rst101
-rw-r--r--Doc/library/smtplib.rst59
-rw-r--r--Doc/library/sndhdr.rst5
-rw-r--r--Doc/library/socket.rst146
-rw-r--r--Doc/library/socketserver.rst5
-rw-r--r--Doc/library/someos.rst1
-rw-r--r--Doc/library/sqlite3.rst41
-rw-r--r--Doc/library/ssl.rst606
-rw-r--r--Doc/library/stat.rst9
-rw-r--r--Doc/library/stdtypes.rst348
-rw-r--r--Doc/library/string.rst38
-rw-r--r--Doc/library/struct.rst109
-rw-r--r--Doc/library/subprocess.rst109
-rw-r--r--Doc/library/sunau.rst3
-rw-r--r--Doc/library/symbol.rst3
-rw-r--r--Doc/library/sys.rst210
-rw-r--r--Doc/library/sysconfig.rst259
-rw-r--r--Doc/library/syslog.rst82
-rw-r--r--Doc/library/tabnanny.rst4
-rw-r--r--Doc/library/tarfile.rst99
-rw-r--r--Doc/library/telnetlib.rst4
-rw-r--r--Doc/library/tempfile.rst57
-rw-r--r--Doc/library/test.rst184
-rw-r--r--Doc/library/textwrap.rst4
-rw-r--r--Doc/library/threading.rst209
-rw-r--r--Doc/library/time.rst81
-rw-r--r--Doc/library/timeit.rst4
-rw-r--r--Doc/library/tkinter.rst8
-rw-r--r--Doc/library/tkinter.tix.rst6
-rw-r--r--Doc/library/token.rst3
-rw-r--r--Doc/library/tokenize.rst23
-rw-r--r--Doc/library/trace.rst4
-rw-r--r--Doc/library/turtle-star.pdfbin0 -> 4418 bytes
-rw-r--r--Doc/library/turtle-star.pngbin0 -> 39585 bytes
-rw-r--r--Doc/library/turtle-star.ps447
-rw-r--r--Doc/library/turtle.rst41
-rw-r--r--Doc/library/types.rst3
-rw-r--r--Doc/library/unicodedata.rst17
-rw-r--r--Doc/library/unittest.rst791
-rw-r--r--Doc/library/urllib.parse.rst267
-rw-r--r--Doc/library/urllib.request.rst383
-rw-r--r--Doc/library/uu.rst4
-rw-r--r--Doc/library/warnings.rst80
-rw-r--r--Doc/library/wave.rst8
-rw-r--r--Doc/library/weakref.rst8
-rw-r--r--Doc/library/webbrowser.rst3
-rw-r--r--Doc/library/winreg.rst68
-rw-r--r--Doc/library/winsound.rst4
-rw-r--r--Doc/library/wsgiref.rst84
-rw-r--r--Doc/library/xdrlib.rst4
-rw-r--r--Doc/library/xml.dom.minidom.rst65
-rw-r--r--Doc/library/xml.dom.pulldom.rst3
-rw-r--r--Doc/library/xml.dom.rst38
-rw-r--r--Doc/library/xml.etree.elementtree.rst520
-rw-r--r--Doc/library/xml.etree.rst23
-rw-r--r--Doc/library/xml.sax.utils.rst8
-rw-r--r--Doc/library/xmlrpc.client.rst4
-rw-r--r--Doc/library/xmlrpc.server.rst3
-rw-r--r--Doc/library/zipfile.rst135
-rw-r--r--Doc/library/zipimport.rst6
-rw-r--r--Doc/library/zlib.rst10
-rw-r--r--Doc/license.rst9
-rw-r--r--Doc/make.bat2
-rw-r--r--Doc/reference/compound_stmts.rst8
-rw-r--r--Doc/reference/datamodel.rst5
-rw-r--r--Doc/reference/executionmodel.rst4
-rw-r--r--Doc/reference/expressions.rst16
-rw-r--r--Doc/reference/simple_stmts.rst26
-rwxr-xr-xDoc/tools/rstlint.py2
-rw-r--r--Doc/tools/sphinxext/download.html4
-rw-r--r--Doc/tools/sphinxext/indexcontent.html2
-rw-r--r--Doc/tools/sphinxext/indexsidebar.html2
-rw-r--r--Doc/tools/sphinxext/patchlevel.py2
-rw-r--r--Doc/tools/sphinxext/pyspecific.py108
-rw-r--r--Doc/tools/sphinxext/static/basic.css10
-rw-r--r--Doc/tools/sphinxext/susp-ignored.csv252
-rw-r--r--Doc/tools/sphinxext/suspicious.py52
-rw-r--r--Doc/tutorial/classes.rst9
-rw-r--r--Doc/tutorial/floatingpoint.rst11
-rw-r--r--Doc/tutorial/inputoutput.rst12
-rw-r--r--Doc/tutorial/interpreter.rst14
-rw-r--r--Doc/tutorial/introduction.rst6
-rw-r--r--Doc/tutorial/stdlib.rst2
-rw-r--r--Doc/using/cmdline.rst49
-rw-r--r--Doc/whatsnew/2.0.rst10
-rw-r--r--Doc/whatsnew/2.1.rst10
-rw-r--r--Doc/whatsnew/2.2.rst58
-rw-r--r--Doc/whatsnew/2.3.rst36
-rw-r--r--Doc/whatsnew/2.4.rst42
-rw-r--r--Doc/whatsnew/2.5.rst106
-rw-r--r--Doc/whatsnew/2.6.rst77
-rw-r--r--Doc/whatsnew/2.7.rst2481
-rw-r--r--Doc/whatsnew/3.0.rst45
-rw-r--r--Doc/whatsnew/3.1.rst34
-rw-r--r--Doc/whatsnew/3.2.rst2704
-rw-r--r--Doc/whatsnew/index.rst2
-rw-r--r--Grammar/Grammar39
-rw-r--r--Include/Python.h20
-rw-r--r--Include/abstract.h13
-rw-r--r--Include/ast.h7
-rw-r--r--Include/bytearrayobject.h4
-rw-r--r--Include/bytes_methods.h37
-rw-r--r--Include/bytesobject.h13
-rw-r--r--Include/cellobject.h3
-rw-r--r--Include/ceval.h21
-rw-r--r--Include/classobject.h2
-rw-r--r--Include/cobject.h61
-rw-r--r--Include/code.h30
-rw-r--r--Include/codecs.h2
-rw-r--r--Include/compile.h12
-rw-r--r--Include/complexobject.h14
-rw-r--r--Include/datetime.h9
-rw-r--r--Include/descrobject.h19
-rw-r--r--Include/dictobject.h20
-rw-r--r--Include/dtoa.h2
-rw-r--r--Include/dynamic_annotations.h499
-rw-r--r--Include/eval.h6
-rw-r--r--Include/fileobject.h5
-rw-r--r--Include/fileutils.h58
-rw-r--r--Include/floatobject.h12
-rw-r--r--Include/frameobject.h12
-rw-r--r--Include/funcobject.h3
-rw-r--r--Include/genobject.h2
-rw-r--r--Include/graminit.h126
-rw-r--r--Include/import.h73
-rw-r--r--Include/listobject.h6
-rw-r--r--Include/longintrepr.h6
-rw-r--r--Include/longobject.h50
-rw-r--r--Include/marshal.h2
-rw-r--r--Include/memoryobject.h8
-rw-r--r--Include/methodobject.h4
-rw-r--r--Include/modsupport.h16
-rw-r--r--Include/moduleobject.h14
-rw-r--r--Include/object.h67
-rw-r--r--Include/objimpl.h22
-rw-r--r--Include/opcode.h9
-rw-r--r--Include/parsetok.h34
-rw-r--r--Include/patchlevel.h6
-rw-r--r--Include/pyarena.h2
-rw-r--r--Include/pyatomic.h181
-rw-r--r--Include/pycapsule.h4
-rw-r--r--Include/pyctype.h2
-rw-r--r--Include/pydebug.h4
-rw-r--r--Include/pyerrors.h97
-rw-r--r--Include/pygetopt.h2
-rw-r--r--Include/pymacconfig.h6
-rw-r--r--Include/pymath.h26
-rw-r--r--Include/pymem.h10
-rw-r--r--Include/pyport.h68
-rw-r--r--Include/pystate.h31
-rw-r--r--Include/pystrtod.h5
-rw-r--r--Include/pythonrun.h116
-rw-r--r--Include/pythread.h59
-rw-r--r--Include/pytime.h48
-rw-r--r--Include/setobject.h22
-rw-r--r--Include/sliceobject.h9
-rw-r--r--Include/structseq.h20
-rw-r--r--Include/symtable.h23
-rw-r--r--Include/sysmodule.h13
-rw-r--r--Include/timefuncs.h2
-rw-r--r--Include/token.h3
-rw-r--r--Include/traceback.h5
-rw-r--r--Include/tupleobject.h8
-rw-r--r--Include/typeslots.h76
-rw-r--r--Include/ucnhash.h3
-rw-r--r--Include/unicodeobject.h319
-rw-r--r--Include/warnings.h23
-rw-r--r--Include/weakrefobject.h6
-rw-r--r--LICENSE8
-rw-r--r--Lib/_dummy_thread.py16
-rw-r--r--Lib/_markupbase.py8
-rw-r--r--Lib/_pyio.py217
-rw-r--r--Lib/_strptime.py50
-rw-r--r--Lib/_threading_local.py158
-rw-r--r--Lib/abc.py40
-rw-r--r--Lib/argparse.py2366
-rw-r--r--Lib/ast.py29
-rw-r--r--Lib/asyncore.py27
-rwxr-xr-xLib/base64.py17
-rw-r--r--Lib/bdb.py181
-rw-r--r--Lib/binhex.py42
-rwxr-xr-xLib/cProfile.py9
-rwxr-xr-xLib/cgi.py263
-rw-r--r--Lib/cmd.py20
-rw-r--r--Lib/code.py5
-rw-r--r--Lib/codecs.py23
-rw-r--r--Lib/collections.py437
-rw-r--r--Lib/compileall.py278
-rw-r--r--Lib/concurrent/__init__.py1
-rw-r--r--Lib/concurrent/futures/__init__.py18
-rw-r--r--Lib/concurrent/futures/_base.py567
-rw-r--r--Lib/concurrent/futures/process.py360
-rw-r--r--Lib/concurrent/futures/thread.py130
-rw-r--r--Lib/configparser.py1289
-rw-r--r--Lib/contextlib.py86
-rw-r--r--Lib/copy.py4
-rw-r--r--Lib/csv.py16
-rw-r--r--Lib/ctypes/__init__.py57
-rw-r--r--Lib/ctypes/test/test_arrays.py4
-rw-r--r--Lib/ctypes/test/test_bitfields.py4
-rw-r--r--Lib/ctypes/test/test_buffers.py14
-rw-r--r--Lib/ctypes/test/test_bytes.py19
-rw-r--r--Lib/ctypes/test/test_callbacks.py34
-rw-r--r--Lib/ctypes/test/test_cast.py8
-rw-r--r--Lib/ctypes/test/test_cfuncs.py2
-rw-r--r--Lib/ctypes/test/test_errno.py75
-rw-r--r--Lib/ctypes/test/test_internals.py18
-rw-r--r--Lib/ctypes/test/test_keeprefs.py8
-rw-r--r--Lib/ctypes/test/test_libc.py2
-rw-r--r--Lib/ctypes/test/test_loading.py2
-rw-r--r--Lib/ctypes/test/test_objects.py4
-rw-r--r--Lib/ctypes/test/test_parameters.py10
-rw-r--r--Lib/ctypes/test/test_prototypes.py2
-rw-r--r--Lib/ctypes/test/test_python_api.py4
-rw-r--r--Lib/ctypes/test/test_random_things.py4
-rw-r--r--Lib/ctypes/test/test_repr.py4
-rw-r--r--Lib/ctypes/test/test_returnfuncptrs.py8
-rw-r--r--Lib/ctypes/test/test_sizes.py9
-rw-r--r--Lib/ctypes/test/test_stringptr.py6
-rw-r--r--Lib/ctypes/test/test_strings.py17
-rw-r--r--Lib/ctypes/test/test_structures.py24
-rw-r--r--Lib/ctypes/test/test_unicode.py103
-rw-r--r--Lib/ctypes/util.py31
-rw-r--r--Lib/ctypes/wintypes.py169
-rw-r--r--Lib/datetime.py2112
-rw-r--r--Lib/dbm/__init__.py23
-rw-r--r--Lib/dbm/dumb.py4
-rw-r--r--Lib/decimal.py620
-rw-r--r--Lib/difflib.py96
-rw-r--r--Lib/dis.py108
-rw-r--r--Lib/distutils/__init__.py2
-rw-r--r--Lib/distutils/command/bdist_msi.py1
-rw-r--r--Lib/distutils/command/build_ext.py6
-rw-r--r--Lib/distutils/command/install.py27
-rw-r--r--Lib/distutils/file_util.py9
-rw-r--r--Lib/distutils/sysconfig.py103
-rw-r--r--Lib/distutils/tests/test_bdist_msi.py25
-rw-r--r--Lib/distutils/tests/test_build.py55
-rw-r--r--Lib/distutils/tests/test_build_ext.py19
-rw-r--r--Lib/distutils/tests/test_dep_util.py81
-rw-r--r--Lib/distutils/tests/test_dist.py1
-rw-r--r--Lib/distutils/tests/test_sysconfig.py11
-rw-r--r--Lib/distutils/text_file.py5
-rw-r--r--Lib/distutils/util.py9
-rw-r--r--Lib/doctest.py39
-rw-r--r--Lib/email/__init__.py19
-rw-r--r--Lib/email/_parseaddr.py20
-rw-r--r--Lib/email/base64mime.py8
-rw-r--r--Lib/email/charset.py33
-rw-r--r--Lib/email/encoders.py9
-rw-r--r--Lib/email/feedparser.py11
-rw-r--r--Lib/email/generator.py215
-rw-r--r--Lib/email/header.py324
-rw-r--r--Lib/email/message.py115
-rw-r--r--Lib/email/parser.py47
-rw-r--r--Lib/email/quoprimime.py6
-rw-r--r--Lib/email/test/data/msg_10.txt7
-rw-r--r--Lib/email/test/data/msg_26.txt3
-rw-r--r--Lib/email/test/test_email.py786
-rw-r--r--Lib/email/test/test_email_codecs.py46
-rw-r--r--Lib/email/test/test_email_torture.py6
-rw-r--r--Lib/email/utils.py11
-rw-r--r--Lib/encodings/__init__.py2
-rw-r--r--Lib/encodings/aliases.py8
-rw-r--r--Lib/encodings/base64_codec.py55
-rw-r--r--Lib/encodings/bz2_codec.py77
-rw-r--r--Lib/encodings/cp720.py309
-rw-r--r--Lib/encodings/cp858.py698
-rw-r--r--Lib/encodings/hex_codec.py55
-rw-r--r--Lib/encodings/punycode.py1
-rw-r--r--Lib/encodings/quopri_codec.py56
-rwxr-xr-xLib/encodings/rot_13.py113
-rw-r--r--Lib/encodings/uu_codec.py99
-rw-r--r--Lib/encodings/zlib_codec.py77
-rw-r--r--Lib/fileinput.py6
-rw-r--r--Lib/fnmatch.py47
-rw-r--r--Lib/fractions.py102
-rw-r--r--Lib/ftplib.py314
-rw-r--r--Lib/functools.py158
-rw-r--r--Lib/genericpath.py2
-rw-r--r--Lib/getopt.py1
-rw-r--r--Lib/gettext.py50
-rw-r--r--Lib/gzip.py245
-rw-r--r--Lib/hashlib.py81
-rw-r--r--Lib/heapq.py13
-rw-r--r--Lib/hmac.py15
-rw-r--r--Lib/html/__init__.py21
-rw-r--r--Lib/html/parser.py101
-rw-r--r--Lib/http/client.py217
-rw-r--r--Lib/http/cookiejar.py20
-rw-r--r--Lib/http/cookies.py244
-rw-r--r--Lib/http/server.py92
-rw-r--r--Lib/idlelib/Bindings.py8
-rw-r--r--Lib/idlelib/EditorWindow.py25
-rw-r--r--Lib/idlelib/NEWS.txt2
-rw-r--r--Lib/idlelib/PyShell.py33
-rw-r--r--Lib/idlelib/idlever.py2
-rw-r--r--Lib/idlelib/macosxSupport.py96
-rw-r--r--Lib/idlelib/run.py7
-rw-r--r--Lib/imaplib.py80
-rw-r--r--Lib/importlib/__init__.py2
-rw-r--r--Lib/importlib/_bootstrap.py594
-rw-r--r--Lib/importlib/abc.py246
-rw-r--r--Lib/importlib/test/__init__.py31
-rw-r--r--Lib/importlib/test/__main__.py29
-rw-r--r--Lib/importlib/test/benchmark.py184
-rw-r--r--Lib/importlib/test/builtin/test_loader.py9
-rw-r--r--Lib/importlib/test/extension/test_case_sensitivity.py3
-rw-r--r--Lib/importlib/test/extension/test_finder.py3
-rw-r--r--Lib/importlib/test/extension/test_loader.py5
-rw-r--r--Lib/importlib/test/extension/test_path_hook.py2
-rw-r--r--Lib/importlib/test/frozen/test_loader.py7
-rw-r--r--Lib/importlib/test/import_/test___package__.py29
-rw-r--r--Lib/importlib/test/import_/test_api.py22
-rw-r--r--Lib/importlib/test/import_/test_fromlist.py11
-rw-r--r--Lib/importlib/test/import_/test_packages.py10
-rw-r--r--Lib/importlib/test/import_/test_path.py35
-rw-r--r--Lib/importlib/test/import_/test_relative_imports.py13
-rw-r--r--Lib/importlib/test/import_/util.py15
-rw-r--r--Lib/importlib/test/regrtest.py35
-rw-r--r--Lib/importlib/test/source/test_abc_loader.py556
-rw-r--r--Lib/importlib/test/source/test_case_sensitivity.py12
-rw-r--r--Lib/importlib/test/source/test_file_loader.py300
-rw-r--r--Lib/importlib/test/source/test_finder.py39
-rw-r--r--Lib/importlib/test/source/test_path_hook.py7
-rw-r--r--Lib/importlib/test/source/test_source_encoding.py13
-rw-r--r--Lib/importlib/test/source/util.py19
-rw-r--r--Lib/importlib/test/test_abc.py13
-rw-r--r--Lib/importlib/test/test_api.py5
-rw-r--r--Lib/importlib/test/test_util.py4
-rw-r--r--Lib/importlib/test/util.py27
-rw-r--r--Lib/importlib/util.py1
-rw-r--r--Lib/inspect.py227
-rw-r--r--Lib/json/decoder.py8
-rw-r--r--Lib/json/encoder.py11
-rw-r--r--Lib/json/scanner.py9
-rwxr-xr-xLib/keyword.py24
-rwxr-xr-xLib/lib2to3/pgen2/token.py2
-rwxr-xr-xLib/lib2to3/tests/pytree_idempotency.py2
-rw-r--r--Lib/linecache.py4
-rw-r--r--Lib/locale.py105
-rw-r--r--Lib/logging/__init__.py613
-rw-r--r--Lib/logging/config.py704
-rw-r--r--Lib/logging/handlers.py293
-rw-r--r--Lib/macpath.py5
-rw-r--r--Lib/mailbox.py394
-rw-r--r--Lib/mimetypes.py54
-rw-r--r--Lib/modulefinder.py22
-rw-r--r--Lib/msilib/__init__.py1
-rw-r--r--Lib/multiprocessing/__init__.py4
-rw-r--r--Lib/multiprocessing/connection.py29
-rw-r--r--Lib/multiprocessing/forking.py10
-rw-r--r--Lib/multiprocessing/managers.py2
-rw-r--r--Lib/multiprocessing/pool.py153
-rw-r--r--Lib/multiprocessing/synchronize.py3
-rw-r--r--Lib/nntplib.py1149
-rw-r--r--Lib/ntpath.py68
-rw-r--r--Lib/numbers.py2
-rw-r--r--Lib/opcode.py11
-rw-r--r--Lib/os.py236
-rw-r--r--Lib/os2emxpath.py3
-rw-r--r--Lib/pdb.doc202
-rwxr-xr-xLib/pdb.py1319
-rw-r--r--Lib/pickle.py98
-rw-r--r--Lib/pickletools.py79
-rw-r--r--Lib/pkgutil.py3
-rw-r--r--Lib/plat-atheos/IN.py944
-rw-r--r--Lib/plat-atheos/TYPES.py142
-rw-r--r--Lib/plat-atheos/regen3
-rwxr-xr-xLib/platform.py77
-rw-r--r--Lib/plistlib.py2
-rw-r--r--Lib/poplib.py18
-rw-r--r--Lib/posixpath.py9
-rw-r--r--Lib/pprint.py9
-rwxr-xr-xLib/profile.py20
-rw-r--r--Lib/pstats.py111
-rw-r--r--Lib/py_compile.py150
-rwxr-xr-xLib/pydoc.py672
-rw-r--r--Lib/pydoc_data/_pydoc.css6
-rw-r--r--Lib/pydoc_data/topics.py42
-rw-r--r--Lib/queue.py10
-rwxr-xr-xLib/quopri.py20
-rw-r--r--Lib/random.py145
-rw-r--r--Lib/re.py40
-rw-r--r--Lib/reprlib.py32
-rw-r--r--Lib/runpy.py193
-rw-r--r--Lib/shelve.py3
-rw-r--r--Lib/shutil.py491
-rw-r--r--Lib/site.py176
-rwxr-xr-xLib/smtpd.py244
-rwxr-xr-xLib/smtplib.py250
-rw-r--r--Lib/socket.py100
-rw-r--r--Lib/socketserver.py48
-rw-r--r--Lib/sqlite3/__init__.py3
-rw-r--r--Lib/sqlite3/dbapi2.py3
-rw-r--r--Lib/sqlite3/test/dbapi.py75
-rw-r--r--Lib/sqlite3/test/regression.py113
-rw-r--r--Lib/sqlite3/test/transactions.py20
-rw-r--r--Lib/sqlite3/test/types.py8
-rw-r--r--Lib/sre_compile.py2
-rw-r--r--Lib/ssl.py193
-rw-r--r--Lib/string.py51
-rw-r--r--Lib/struct.py2
-rw-r--r--Lib/subprocess.py477
-rw-r--r--Lib/sunau.py11
-rwxr-xr-xLib/symbol.py128
-rw-r--r--Lib/symtable.py9
-rw-r--r--Lib/sysconfig.py778
-rwxr-xr-xLib/tabnanny.py9
-rw-r--r--Lib/tarfile.py680
-rw-r--r--Lib/tempfile.py103
-rw-r--r--Lib/test/__main__.py13
-rw-r--r--Lib/test/badsyntax_nocaret.py2
-rw-r--r--Lib/test/capath/4e1295a3.014
-rw-r--r--Lib/test/capath/5ed36f99.041
-rw-r--r--Lib/test/capath/6e88d7b8.014
-rw-r--r--Lib/test/capath/99d0fa06.041
-rw-r--r--Lib/test/cfgparser.2537
-rw-r--r--Lib/test/cfgparser.369
-rw-r--r--Lib/test/cmath_testcases.txt31
-rw-r--r--Lib/test/crashers/recursive_call.py2
-rw-r--r--Lib/test/crashers/underlying_dict.py20
-rw-r--r--Lib/test/curses_tests.py2
-rw-r--r--Lib/test/data/README2
-rw-r--r--Lib/test/datetimetester.py3685
-rw-r--r--Lib/test/decimaltestdata/and.decTest676
-rw-r--r--Lib/test/decimaltestdata/class.decTest262
-rw-r--r--Lib/test/decimaltestdata/comparetotal.decTest1596
-rw-r--r--Lib/test/decimaltestdata/comparetotmag.decTest1580
-rw-r--r--Lib/test/decimaltestdata/copy.decTest172
-rw-r--r--Lib/test/decimaltestdata/copyabs.decTest172
-rw-r--r--Lib/test/decimaltestdata/copynegate.decTest172
-rw-r--r--Lib/test/decimaltestdata/copysign.decTest354
-rw-r--r--Lib/test/decimaltestdata/ddAbs.decTest252
-rw-r--r--Lib/test/decimaltestdata/ddAdd.decTest2656
-rw-r--r--Lib/test/decimaltestdata/ddAnd.decTest694
-rw-r--r--Lib/test/decimaltestdata/ddBase.decTest2208
-rw-r--r--Lib/test/decimaltestdata/ddCanonical.decTest714
-rw-r--r--Lib/test/decimaltestdata/ddClass.decTest152
-rw-r--r--Lib/test/decimaltestdata/ddCompare.decTest1488
-rw-r--r--Lib/test/decimaltestdata/ddCompareSig.decTest1294
-rw-r--r--Lib/test/decimaltestdata/ddCompareTotal.decTest1412
-rw-r--r--Lib/test/decimaltestdata/ddCompareTotalMag.decTest1412
-rw-r--r--Lib/test/decimaltestdata/ddCopy.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddCopyAbs.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddCopyNegate.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddCopySign.decTest350
-rw-r--r--Lib/test/decimaltestdata/ddDivide.decTest1726
-rw-r--r--Lib/test/decimaltestdata/ddDivideInt.decTest898
-rw-r--r--Lib/test/decimaltestdata/ddEncode.decTest990
-rw-r--r--Lib/test/decimaltestdata/ddFMA.decTest3396
-rw-r--r--Lib/test/decimaltestdata/ddInvert.decTest404
-rw-r--r--Lib/test/decimaltestdata/ddLogB.decTest318
-rw-r--r--Lib/test/decimaltestdata/ddMax.decTest644
-rw-r--r--Lib/test/decimaltestdata/ddMaxMag.decTest608
-rw-r--r--Lib/test/decimaltestdata/ddMin.decTest618
-rw-r--r--Lib/test/decimaltestdata/ddMinMag.decTest586
-rw-r--r--Lib/test/decimaltestdata/ddMinus.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddMultiply.decTest1106
-rw-r--r--Lib/test/decimaltestdata/ddNextMinus.decTest252
-rw-r--r--Lib/test/decimaltestdata/ddNextPlus.decTest248
-rw-r--r--Lib/test/decimaltestdata/ddNextToward.decTest748
-rw-r--r--Lib/test/decimaltestdata/ddOr.decTest584
-rw-r--r--Lib/test/decimaltestdata/ddPlus.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddQuantize.decTest1666
-rw-r--r--Lib/test/decimaltestdata/ddReduce.decTest364
-rw-r--r--Lib/test/decimaltestdata/ddRemainder.decTest1200
-rw-r--r--Lib/test/decimaltestdata/ddRemainderNear.decTest1258
-rw-r--r--Lib/test/decimaltestdata/ddRotate.decTest524
-rw-r--r--Lib/test/decimaltestdata/ddSameQuantum.decTest778
-rw-r--r--Lib/test/decimaltestdata/ddScaleB.decTest486
-rw-r--r--Lib/test/decimaltestdata/ddShift.decTest524
-rw-r--r--Lib/test/decimaltestdata/ddSubtract.decTest1258
-rw-r--r--Lib/test/decimaltestdata/ddToIntegral.decTest514
-rw-r--r--Lib/test/decimaltestdata/ddXor.decTest674
-rw-r--r--Lib/test/decimaltestdata/dqAbs.decTest252
-rw-r--r--Lib/test/decimaltestdata/dqAdd.decTest2430
-rw-r--r--Lib/test/decimaltestdata/dqAnd.decTest840
-rw-r--r--Lib/test/decimaltestdata/dqBase.decTest2162
-rw-r--r--Lib/test/decimaltestdata/dqCanonical.decTest744
-rw-r--r--Lib/test/decimaltestdata/dqClass.decTest154
-rw-r--r--Lib/test/decimaltestdata/dqCompare.decTest1506
-rw-r--r--Lib/test/decimaltestdata/dqCompareSig.decTest1294
-rw-r--r--Lib/test/decimaltestdata/dqCompareTotal.decTest1412
-rw-r--r--Lib/test/decimaltestdata/dqCompareTotalMag.decTest1412
-rw-r--r--Lib/test/decimaltestdata/dqCopy.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqCopyAbs.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqCopyNegate.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqCopySign.decTest350
-rw-r--r--Lib/test/decimaltestdata/dqDivide.decTest1616
-rw-r--r--Lib/test/decimaltestdata/dqDivideInt.decTest906
-rw-r--r--Lib/test/decimaltestdata/dqEncode.decTest954
-rw-r--r--Lib/test/decimaltestdata/dqFMA.decTest3572
-rw-r--r--Lib/test/decimaltestdata/dqInvert.decTest490
-rw-r--r--Lib/test/decimaltestdata/dqLogB.decTest320
-rw-r--r--Lib/test/decimaltestdata/dqMax.decTest644
-rw-r--r--Lib/test/decimaltestdata/dqMaxMag.decTest608
-rw-r--r--Lib/test/decimaltestdata/dqMin.decTest618
-rw-r--r--Lib/test/decimaltestdata/dqMinMag.decTest586
-rw-r--r--Lib/test/decimaltestdata/dqMinus.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqMultiply.decTest1178
-rw-r--r--Lib/test/decimaltestdata/dqNextMinus.decTest252
-rw-r--r--Lib/test/decimaltestdata/dqNextPlus.decTest248
-rw-r--r--Lib/test/decimaltestdata/dqNextToward.decTest750
-rw-r--r--Lib/test/decimaltestdata/dqOr.decTest802
-rw-r--r--Lib/test/decimaltestdata/dqPlus.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqQuantize.decTest1672
-rw-r--r--Lib/test/decimaltestdata/dqReduce.decTest366
-rw-r--r--Lib/test/decimaltestdata/dqRemainder.decTest1194
-rw-r--r--Lib/test/decimaltestdata/dqRemainderNear.decTest1262
-rw-r--r--Lib/test/decimaltestdata/dqRotate.decTest596
-rw-r--r--Lib/test/decimaltestdata/dqSameQuantum.decTest778
-rw-r--r--Lib/test/decimaltestdata/dqScaleB.decTest520
-rw-r--r--Lib/test/decimaltestdata/dqShift.decTest596
-rw-r--r--Lib/test/decimaltestdata/dqSubtract.decTest1270
-rw-r--r--Lib/test/decimaltestdata/dqToIntegral.decTest514
-rw-r--r--Lib/test/decimaltestdata/dqXor.decTest820
-rw-r--r--Lib/test/decimaltestdata/dsBase.decTest2124
-rw-r--r--Lib/test/decimaltestdata/dsEncode.decTest744
-rw-r--r--Lib/test/decimaltestdata/exp.decTest1348
-rw-r--r--Lib/test/decimaltestdata/fma.decTest6852
-rw-r--r--Lib/test/decimaltestdata/invert.decTest352
-rw-r--r--Lib/test/decimaltestdata/ln.decTest1222
-rw-r--r--Lib/test/decimaltestdata/log10.decTest1102
-rw-r--r--Lib/test/decimaltestdata/logb.decTest376
-rw-r--r--Lib/test/decimaltestdata/maxmag.decTest808
-rw-r--r--Lib/test/decimaltestdata/minmag.decTest780
-rw-r--r--Lib/test/decimaltestdata/nextminus.decTest296
-rw-r--r--Lib/test/decimaltestdata/nextplus.decTest300
-rw-r--r--Lib/test/decimaltestdata/nexttoward.decTest852
-rw-r--r--Lib/test/decimaltestdata/or.decTest668
-rw-r--r--Lib/test/decimaltestdata/powersqrt.decTest5940
-rw-r--r--Lib/test/decimaltestdata/rotate.decTest494
-rw-r--r--Lib/test/decimaltestdata/scaleb.decTest418
-rw-r--r--Lib/test/decimaltestdata/shift.decTest500
-rw-r--r--Lib/test/decimaltestdata/tointegralx.decTest510
-rw-r--r--Lib/test/decimaltestdata/xor.decTest670
-rw-r--r--Lib/test/doctest_aliases.py2
-rw-r--r--Lib/test/encoded_modules/__init__.py23
-rw-r--r--Lib/test/encoded_modules/module_iso_8859_1.py5
-rw-r--r--Lib/test/encoded_modules/module_koi8_r.py3
-rw-r--r--Lib/test/exception_hierarchy.txt1
-rw-r--r--Lib/test/fork_wait.py6
-rw-r--r--Lib/test/formatfloat_testcases.txt69
-rw-r--r--Lib/test/gdb_sample.py12
-rw-r--r--Lib/test/ieee754.txt6
-rw-r--r--Lib/test/json_tests/__init__.py (renamed from Lib/json/tests/__init__.py)2
-rw-r--r--Lib/test/json_tests/test_decode.py (renamed from Lib/json/tests/test_decode.py)28
-rw-r--r--Lib/test/json_tests/test_default.py (renamed from Lib/json/tests/test_default.py)0
-rw-r--r--Lib/test/json_tests/test_dump.py (renamed from Lib/json/tests/test_dump.py)0
-rw-r--r--Lib/test/json_tests/test_encode_basestring_ascii.py (renamed from Lib/json/tests/test_encode_basestring_ascii.py)0
-rw-r--r--Lib/test/json_tests/test_fail.py (renamed from Lib/json/tests/test_fail.py)0
-rw-r--r--Lib/test/json_tests/test_float.py (renamed from Lib/json/tests/test_float.py)0
-rw-r--r--Lib/test/json_tests/test_indent.py (renamed from Lib/json/tests/test_indent.py)40
-rw-r--r--Lib/test/json_tests/test_pass1.py (renamed from Lib/json/tests/test_pass1.py)0
-rw-r--r--Lib/test/json_tests/test_pass2.py (renamed from Lib/json/tests/test_pass2.py)0
-rw-r--r--Lib/test/json_tests/test_pass3.py (renamed from Lib/json/tests/test_pass3.py)0
-rw-r--r--Lib/test/json_tests/test_recursion.py (renamed from Lib/json/tests/test_recursion.py)0
-rw-r--r--Lib/test/json_tests/test_scanstring.py (renamed from Lib/json/tests/test_scanstring.py)0
-rw-r--r--Lib/test/json_tests/test_separators.py (renamed from Lib/json/tests/test_separators.py)0
-rw-r--r--Lib/test/json_tests/test_speedups.py (renamed from Lib/json/tests/test_speedups.py)0
-rw-r--r--Lib/test/json_tests/test_unicode.py (renamed from Lib/json/tests/test_unicode.py)0
-rw-r--r--Lib/test/keycert.pem59
-rw-r--r--Lib/test/keycert2.pem31
-rw-r--r--Lib/test/lock_tests.py330
-rw-r--r--Lib/test/make_ssl_certs.py64
-rw-r--r--Lib/test/mapping_tests.py46
-rw-r--r--Lib/test/math_testcases.txt519
-rw-r--r--Lib/test/mock_socket.py154
-rw-r--r--Lib/test/pickletester.py69
-rw-r--r--Lib/test/pstats.pckbin0 -> 66607 bytes
-rwxr-xr-xLib/test/pystone.py4
-rwxr-xr-xLib/test/re_tests.py2
-rwxr-xr-xLib/test/regrtest.py925
-rw-r--r--Lib/test/script_helper.py24
-rw-r--r--Lib/test/ssl_cert.pem25
-rw-r--r--Lib/test/ssl_key.pem25
-rw-r--r--Lib/test/ssl_servers.py189
-rw-r--r--Lib/test/string_tests.py51
-rw-r--r--Lib/test/subprocessdata/fd_status.py24
-rw-r--r--Lib/test/subprocessdata/input_reader.py7
-rw-r--r--Lib/test/subprocessdata/qcat.py7
-rw-r--r--Lib/test/subprocessdata/qgrep.py10
-rw-r--r--Lib/test/support.py593
-rw-r--r--Lib/test/test_SimpleHTTPServer.py41
-rw-r--r--Lib/test/test___all__.py8
-rw-r--r--Lib/test/test___future__.py2
-rw-r--r--Lib/test/test__locale.py2
-rw-r--r--Lib/test/test_abc.py68
-rw-r--r--Lib/test/test_abstract_numbers.py1
-rw-r--r--Lib/test/test_argparse.py4681
-rwxr-xr-xLib/test/test_array.py267
-rw-r--r--Lib/test/test_ascii_formatd.py64
-rw-r--r--Lib/test/test_ast.py30
-rw-r--r--Lib/test/test_asynchat.py174
-rw-r--r--Lib/test/test_asyncore.py602
-rw-r--r--Lib/test/test_atexit.py11
-rw-r--r--Lib/test/test_augassign.py4
-rw-r--r--Lib/test/test_base64.py18
-rw-r--r--Lib/test/test_bigmem.py44
-rw-r--r--[-rwxr-xr-x]Lib/test/test_binascii.py160
-rwxr-xr-xLib/test/test_binhex.py13
-rw-r--r--Lib/test/test_binop.py89
-rw-r--r--Lib/test/test_bool.py28
-rw-r--r--Lib/test/test_builtin.py396
-rw-r--r--Lib/test/test_bytes.py243
-rw-r--r--Lib/test/test_bz2.py229
-rw-r--r--Lib/test/test_calendar.py12
-rw-r--r--Lib/test/test_capi.py71
-rw-r--r--Lib/test/test_cfgparser.py1468
-rw-r--r--Lib/test/test_cgi.py136
-rw-r--r--[-rwxr-xr-x]Lib/test/test_cmath.py194
-rw-r--r--Lib/test/test_cmd.py25
-rw-r--r--Lib/test/test_cmd_line.py277
-rw-r--r--Lib/test/test_cmd_line_script.py256
-rw-r--r--Lib/test/test_code.py45
-rw-r--r--Lib/test/test_codecencodings_cn.py2
-rw-r--r--Lib/test/test_codecencodings_hk.py2
-rw-r--r--Lib/test/test_codecencodings_jp.py2
-rw-r--r--Lib/test/test_codecencodings_kr.py2
-rw-r--r--Lib/test/test_codecencodings_tw.py2
-rw-r--r--Lib/test/test_codecmaps_cn.py2
-rw-r--r--Lib/test/test_codecmaps_hk.py2
-rw-r--r--Lib/test/test_codecmaps_jp.py2
-rw-r--r--Lib/test/test_codecmaps_kr.py2
-rw-r--r--Lib/test/test_codecmaps_tw.py2
-rw-r--r--Lib/test/test_codecs.py86
-rw-r--r--Lib/test/test_codeop.py4
-rw-r--r--Lib/test/test_coding.py31
-rw-r--r--Lib/test/test_collections.py288
-rw-r--r--Lib/test/test_compile.py51
-rw-r--r--Lib/test/test_compileall.py285
-rw-r--r--Lib/test/test_complex.py170
-rw-r--r--Lib/test/test_concurrent_futures.py613
-rw-r--r--Lib/test/test_contains.py32
-rw-r--r--Lib/test/test_contextlib.py354
-rw-r--r--Lib/test/test_copy.py13
-rw-r--r--Lib/test/test_copyreg.py4
-rw-r--r--Lib/test/test_cprofile.py19
-rw-r--r--Lib/test/test_csv.py20
-rw-r--r--Lib/test/test_datetime.py3415
-rw-r--r--Lib/test/test_dbm.py12
-rw-r--r--Lib/test/test_dbm_dumb.py12
-rwxr-xr-xLib/test/test_dbm_gnu.py8
-rwxr-xr-xLib/test/test_dbm_ndbm.py2
-rw-r--r--Lib/test/test_decimal.py690
-rw-r--r--Lib/test/test_defaultdict.py16
-rw-r--r--Lib/test/test_deque.py52
-rw-r--r--Lib/test/test_descr.py152
-rw-r--r--Lib/test/test_dict.py163
-rw-r--r--Lib/test/test_dictviews.py133
-rw-r--r--Lib/test/test_difflib.py62
-rw-r--r--Lib/test/test_dis.py221
-rw-r--r--Lib/test/test_distutils.py1
-rw-r--r--Lib/test/test_doctest.py182
-rw-r--r--Lib/test/test_doctest2.py5
-rw-r--r--Lib/test/test_docxmlrpc.py86
-rw-r--r--Lib/test/test_dummy_thread.py10
-rw-r--r--Lib/test/test_dynamic.py143
-rw-r--r--Lib/test/test_email.py2
-rw-r--r--Lib/test/test_enumerate.py14
-rw-r--r--Lib/test/test_eof.py2
-rw-r--r--Lib/test/test_epoll.py2
-rwxr-xr-xLib/test/test_errno.py9
-rw-r--r--Lib/test/test_exceptions.py66
-rw-r--r--Lib/test/test_extcall.py35
-rw-r--r--[-rwxr-xr-x]Lib/test/test_fcntl.py13
-rw-r--r--Lib/test/test_file.py13
-rw-r--r--Lib/test/test_filecmp.py2
-rw-r--r--Lib/test/test_fileinput.py24
-rw-r--r--Lib/test/test_fileio.py10
-rw-r--r--Lib/test/test_float.py443
-rw-r--r--Lib/test/test_fnmatch.py35
-rw-r--r--Lib/test/test_fork1.py49
-rw-r--r--Lib/test/test_format.py35
-rw-r--r--Lib/test/test_fractions.py55
-rw-r--r--Lib/test/test_frozen.py25
-rw-r--r--Lib/test/test_ftplib.py433
-rw-r--r--Lib/test/test_funcattrs.py6
-rw-r--r--Lib/test/test_functools.py331
-rw-r--r--Lib/test/test_future.py2
-rw-r--r--Lib/test/test_future5.py2
-rw-r--r--Lib/test/test_gc.py49
-rw-r--r--Lib/test/test_gdb.py681
-rw-r--r--Lib/test/test_generators.py52
-rw-r--r--Lib/test/test_genericpath.py320
-rw-r--r--Lib/test/test_getargs2.py213
-rw-r--r--Lib/test/test_getopt.py1
-rw-r--r--Lib/test/test_glob.py16
-rw-r--r--Lib/test/test_global.py18
-rw-r--r--Lib/test/test_grammar.py22
-rw-r--r--[-rwxr-xr-x]Lib/test/test_grp.py8
-rw-r--r--Lib/test/test_gzip.py312
-rw-r--r--Lib/test/test_hash.py4
-rw-r--r--Lib/test/test_hashlib.py110
-rw-r--r--Lib/test/test_heapq.py18
-rw-r--r--Lib/test/test_hmac.py10
-rw-r--r--Lib/test/test_html.py24
-rw-r--r--[-rwxr-xr-x]Lib/test/test_htmlparser.py66
-rw-r--r--Lib/test/test_http_cookiejar.py117
-rw-r--r--Lib/test/test_http_cookies.py110
-rw-r--r--Lib/test/test_httplib.py221
-rw-r--r--Lib/test/test_httpservers.py355
-rw-r--r--Lib/test/test_imaplib.py50
-rw-r--r--Lib/test/test_imp.py240
-rw-r--r--Lib/test/test_import.py247
-rw-r--r--Lib/test/test_importhooks.py10
-rw-r--r--Lib/test/test_importlib.py7
-rw-r--r--Lib/test/test_index.py92
-rw-r--r--Lib/test/test_inspect.py586
-rw-r--r--Lib/test/test_int.py29
-rw-r--r--Lib/test/test_io.py340
-rw-r--r--Lib/test/test_ioctl.py10
-rw-r--r--Lib/test/test_isinstance.py14
-rw-r--r--Lib/test/test_iter.py25
-rw-r--r--Lib/test/test_itertools.py38
-rw-r--r--Lib/test/test_json.py4
-rw-r--r--Lib/test/test_keywordonlyarg.py10
-rw-r--r--Lib/test/test_kqueue.py11
-rw-r--r--Lib/test/test_linecache.py14
-rw-r--r--Lib/test/test_logging.py1333
-rw-r--r--Lib/test/test_long.py765
-rw-r--r--Lib/test/test_macpath.py46
-rw-r--r--Lib/test/test_mailbox.py263
-rw-r--r--Lib/test/test_marshal.py12
-rw-r--r--Lib/test/test_math.py326
-rw-r--r--Lib/test/test_memoryio.py167
-rw-r--r--Lib/test/test_memoryview.py52
-rw-r--r--Lib/test/test_mimetypes.py27
-rw-r--r--Lib/test/test_minidom.py41
-rw-r--r--Lib/test/test_mmap.py258
-rw-r--r--Lib/test/test_multibytecodec.py5
-rw-r--r--Lib/test/test_multibytecodec_support.py5
-rw-r--r--Lib/test/test_multiprocessing.py139
-rw-r--r--Lib/test/test_nis.py1
-rw-r--r--Lib/test/test_nntplib.py1243
-rw-r--r--Lib/test/test_normalization.py19
-rw-r--r--Lib/test/test_ntpath.py26
-rw-r--r--Lib/test/test_numeric_tower.py206
-rw-r--r--Lib/test/test_opcodes.py2
-rw-r--r--Lib/test/test_operator.py9
-rw-r--r--Lib/test/test_optparse.py13
-rw-r--r--Lib/test/test_os.py558
-rw-r--r--Lib/test/test_ossaudiodev.py10
-rw-r--r--Lib/test/test_parser.py22
-rw-r--r--Lib/test/test_pdb.py383
-rw-r--r--Lib/test/test_peepholer.py126
-rw-r--r--Lib/test/test_pep263.py2
-rw-r--r--Lib/test/test_pep277.py178
-rw-r--r--Lib/test/test_pep292.py60
-rw-r--r--Lib/test/test_pep3120.py3
-rw-r--r--Lib/test/test_pep3131.py1
-rw-r--r--Lib/test/test_pep352.py6
-rw-r--r--Lib/test/test_pickle.py23
-rw-r--r--Lib/test/test_pickletools.py4
-rw-r--r--Lib/test/test_pipes.py15
-rw-r--r--Lib/test/test_pkg.py37
-rw-r--r--Lib/test/test_pkgimport.py34
-rw-r--r--Lib/test/test_platform.py61
-rw-r--r--Lib/test/test_plistlib.py2
-rw-r--r--Lib/test/test_popen.py5
-rw-r--r--Lib/test/test_poplib.py28
-rw-r--r--Lib/test/test_posix.py117
-rw-r--r--Lib/test/test_posixpath.py631
-rw-r--r--Lib/test/test_pprint.py38
-rw-r--r--Lib/test/test_print.py1
-rw-r--r--[-rwxr-xr-x]Lib/test/test_profile.py3
-rw-r--r--Lib/test/test_property.py41
-rw-r--r--Lib/test/test_pstats.py19
-rw-r--r--Lib/test/test_pwd.py31
-rw-r--r--Lib/test/test_pyclbr.py9
-rw-r--r--Lib/test/test_pydoc.py190
-rw-r--r--Lib/test/test_pyexpat.py218
-rw-r--r--Lib/test/test_queue.py38
-rw-r--r--Lib/test/test_quopri.py2
-rw-r--r--Lib/test/test_raise.py24
-rw-r--r--Lib/test/test_random.py38
-rw-r--r--Lib/test/test_range.py389
-rw-r--r--Lib/test/test_re.py25
-rw-r--r--Lib/test/test_readline.py47
-rw-r--r--Lib/test/test_reprlib.py34
-rw-r--r--Lib/test/test_resource.py4
-rw-r--r--Lib/test/test_richcmp.py15
-rw-r--r--Lib/test/test_runpy.py233
-rw-r--r--Lib/test/test_sax.py130
-rw-r--r--Lib/test/test_sched.py80
-rw-r--r--Lib/test/test_scope.py360
-rw-r--r--Lib/test/test_select.py2
-rw-r--r--Lib/test/test_set.py70
-rw-r--r--Lib/test/test_shelve.py13
-rw-r--r--Lib/test/test_shutil.py619
-rw-r--r--Lib/test/test_site.py183
-rw-r--r--Lib/test/test_smtpd.py289
-rw-r--r--Lib/test/test_smtplib.py211
-rw-r--r--Lib/test/test_smtpnet.py2
-rw-r--r--Lib/test/test_socket.py617
-rw-r--r--Lib/test/test_socketserver.py15
-rw-r--r--Lib/test/test_sort.py6
-rw-r--r--Lib/test/test_sqlite.py18
-rw-r--r--Lib/test/test_ssl.py930
-rw-r--r--[-rwxr-xr-x]Lib/test/test_strftime.py1
-rw-r--r--Lib/test/test_string.py24
-rw-r--r--Lib/test/test_strptime.py21
-rw-r--r--Lib/test/test_strtod.py20
-rw-r--r--Lib/test/test_struct.py491
-rw-r--r--Lib/test/test_structmembers.py23
-rw-r--r--Lib/test/test_structseq.py15
-rw-r--r--Lib/test/test_subprocess.py1454
-rw-r--r--Lib/test/test_sundry.py15
-rw-r--r--Lib/test/test_symtable.py2
-rw-r--r--Lib/test/test_syntax.py53
-rw-r--r--Lib/test/test_sys.py264
-rw-r--r--Lib/test/test_sysconfig.py298
-rw-r--r--Lib/test/test_syslog.py2
-rw-r--r--Lib/test/test_tarfile.py1146
-rw-r--r--Lib/test/test_tcl.py12
-rw-r--r--Lib/test/test_telnetlib.py13
-rw-r--r--Lib/test/test_tempfile.py189
-rw-r--r--Lib/test/test_thread.py74
-rw-r--r--Lib/test/test_threaded_import.py4
-rw-r--r--Lib/test/test_threadedtempfile.py5
-rw-r--r--Lib/test/test_threading.py209
-rw-r--r--Lib/test/test_threading_local.py22
-rw-r--r--Lib/test/test_threadsignals.py145
-rw-r--r--Lib/test/test_time.py240
-rw-r--r--Lib/test/test_timeit.py305
-rw-r--r--Lib/test/test_timeout.py142
-rw-r--r--Lib/test/test_tokenize.py41
-rw-r--r--Lib/test/test_trace.py43
-rw-r--r--Lib/test/test_traceback.py37
-rw-r--r--Lib/test/test_ttk_guionly.py1
-rw-r--r--Lib/test/test_ttk_textonly.py1
-rw-r--r--Lib/test/test_tuple.py4
-rw-r--r--Lib/test/test_types.py184
-rw-r--r--Lib/test/test_ucn.py6
-rw-r--r--Lib/test/test_unicode.py358
-rw-r--r--Lib/test/test_unicode_file.py61
-rw-r--r--Lib/test/test_unicodedata.py36
-rw-r--r--Lib/test/test_unittest.py3396
-rw-r--r--Lib/test/test_unpack.py6
-rw-r--r--Lib/test/test_urllib.py64
-rw-r--r--Lib/test/test_urllib2.py90
-rw-r--r--Lib/test/test_urllib2_localnet.py64
-rw-r--r--Lib/test/test_urllib2net.py45
-rw-r--r--Lib/test/test_urllibnet.py37
-rw-r--r--Lib/test/test_urlparse.py293
-rw-r--r--Lib/test/test_userdict.py12
-rwxr-xr-xLib/test/test_userstring.py2
-rw-r--r--Lib/test/test_warnings.py127
-rw-r--r--Lib/test/test_wave.py14
-rw-r--r--Lib/test/test_weakref.py53
-rw-r--r--Lib/test/test_weakset.py52
-rw-r--r--Lib/test/test_winreg.py227
-rw-r--r--Lib/test/test_winsound.py1
-rw-r--r--Lib/test/test_with.py50
-rw-r--r--[-rwxr-xr-x]Lib/test/test_wsgiref.py67
-rw-r--r--Lib/test/test_xml_etree.py1734
-rw-r--r--Lib/test/test_xml_etree_c.py235
-rw-r--r--Lib/test/test_xmlrpc.py373
-rw-r--r--Lib/test/test_xmlrpc_net.py4
-rw-r--r--Lib/test/test_zipfile.py1720
-rw-r--r--Lib/test/test_zipimport.py72
-rw-r--r--Lib/test/test_zipimport_support.py173
-rw-r--r--Lib/test/test_zlib.py30
-rw-r--r--Lib/test/testtar.tarbin272384 -> 427008 bytes
-rw-r--r--Lib/test/threaded_import_hangers.py2
-rw-r--r--Lib/test/win_console_handler.py49
-rw-r--r--Lib/test/xmltestdata/simple-ns.xml7
-rw-r--r--Lib/test/xmltestdata/simple.xml6
-rw-r--r--Lib/test/xmltestdata/test.xml (renamed from Lib/test/test.xml)0
-rw-r--r--Lib/test/xmltestdata/test.xml.out (renamed from Lib/test/test.xml.out)0
-rw-r--r--Lib/test/zip_cp437_header.zipbin0 -> 270 bytes
-rw-r--r--Lib/threading.py349
-rw-r--r--Lib/timeit.py12
-rw-r--r--Lib/tkinter/__init__.py139
-rw-r--r--Lib/tkinter/__main__.py7
-rw-r--r--Lib/tkinter/font.py2
-rw-r--r--Lib/tkinter/scrolledtext.py7
-rw-r--r--Lib/tkinter/test/test_tkinter/test_font.py33
-rw-r--r--Lib/tkinter/test/test_tkinter/test_loadtk.py3
-rw-r--r--Lib/tkinter/test/test_ttk/test_widgets.py4
-rw-r--r--Lib/tkinter/tix.py175
-rw-r--r--Lib/tkinter/ttk.py12
-rwxr-xr-xLib/token.py18
-rw-r--r--Lib/tokenize.py159
-rw-r--r--Lib/trace.py189
-rw-r--r--Lib/turtle.py52
-rw-r--r--Lib/turtledemo/__init__.py (renamed from Tools/modulator/Templates/copyright)0
-rwxr-xr-x[-rw-r--r--]Lib/turtledemo/__main__.py (renamed from Demo/turtle/turtleDemo.py)95
-rw-r--r--Lib/turtledemo/about_turtle.txt (renamed from Demo/turtle/about_turtle.txt)0
-rw-r--r--Lib/turtledemo/about_turtledemo.txt (renamed from Demo/turtle/about_turtledemo.txt)4
-rw-r--r--Lib/turtledemo/bytedesign.py (renamed from Demo/turtle/tdemo_bytedesign.py)2
-rw-r--r--Lib/turtledemo/chaos.py (renamed from Demo/turtle/tdemo_chaos.py)0
-rw-r--r--Lib/turtledemo/clock.py (renamed from Demo/turtle/tdemo_clock.py)2
-rw-r--r--Lib/turtledemo/colormixer.py (renamed from Demo/turtle/tdemo_colormixer.py)0
-rw-r--r--Lib/turtledemo/demohelp.txt (renamed from Demo/turtle/demohelp.txt)7
-rw-r--r--Lib/turtledemo/forest.py (renamed from Demo/turtle/tdemo_forest.py)2
-rw-r--r--Lib/turtledemo/fractalcurves.py (renamed from Demo/turtle/tdemo_fractalcurves.py)2
-rw-r--r--Lib/turtledemo/lindenmayer.py (renamed from Demo/turtle/tdemo_lindenmayer_indian.py)2
-rw-r--r--Lib/turtledemo/minimal_hanoi.py (renamed from Demo/turtle/tdemo_minimal_hanoi.py)2
-rw-r--r--Lib/turtledemo/nim.py (renamed from Demo/turtle/tdemo_nim.py)21
-rw-r--r--Lib/turtledemo/paint.py (renamed from Demo/turtle/tdemo_paint.py)2
-rw-r--r--Lib/turtledemo/peace.py (renamed from Demo/turtle/tdemo_peace.py)2
-rw-r--r--Lib/turtledemo/penrose.py (renamed from Demo/turtle/tdemo_penrose.py)2
-rw-r--r--Lib/turtledemo/planet_and_moon.py (renamed from Demo/turtle/tdemo_planet_and_moon.py)2
-rw-r--r--Lib/turtledemo/round_dance.py (renamed from Demo/turtle/tdemo_round_dance.py)6
-rw-r--r--Lib/turtledemo/tree.py (renamed from Demo/turtle/tdemo_tree.py)2
-rw-r--r--Lib/turtledemo/turtle.cfg (renamed from Demo/turtle/turtle.cfg)0
-rw-r--r--Lib/turtledemo/two_canvases.py (renamed from Demo/turtle/turtledemo_two_canvases.py)10
-rw-r--r--Lib/turtledemo/wikipedia.py (renamed from Demo/turtle/tdemo_wikipedia.py)2
-rw-r--r--Lib/turtledemo/yinyang.py (renamed from Demo/turtle/tdemo_yinyang.py)2
-rw-r--r--Lib/unittest.py1630
-rw-r--r--Lib/unittest/__init__.py69
-rw-r--r--Lib/unittest/__main__.py12
-rw-r--r--Lib/unittest/case.py1263
-rw-r--r--Lib/unittest/loader.py321
-rw-r--r--Lib/unittest/main.py274
-rw-r--r--Lib/unittest/result.py192
-rw-r--r--Lib/unittest/runner.py213
-rw-r--r--Lib/unittest/signals.py57
-rw-r--r--Lib/unittest/suite.py301
-rw-r--r--Lib/unittest/test/__init__.py21
-rw-r--r--Lib/unittest/test/_test_warnings.py74
-rw-r--r--Lib/unittest/test/dummy.py1
-rw-r--r--Lib/unittest/test/support.py118
-rw-r--r--Lib/unittest/test/test_assertions.py286
-rw-r--r--Lib/unittest/test/test_break.py252
-rw-r--r--Lib/unittest/test/test_case.py1270
-rw-r--r--Lib/unittest/test/test_discovery.py395
-rw-r--r--Lib/unittest/test/test_functiontestcase.py144
-rw-r--r--Lib/unittest/test/test_loader.py1292
-rw-r--r--Lib/unittest/test/test_program.py358
-rw-r--r--Lib/unittest/test/test_result.py568
-rw-r--r--Lib/unittest/test/test_runner.py318
-rw-r--r--Lib/unittest/test/test_setups.py507
-rw-r--r--Lib/unittest/test/test_skipping.py134
-rw-r--r--Lib/unittest/test/test_suite.py368
-rw-r--r--Lib/unittest/util.py140
-rw-r--r--Lib/urllib/parse.py290
-rw-r--r--Lib/urllib/request.py87
-rwxr-xr-xLib/uu.py2
-rw-r--r--Lib/warnings.py19
-rw-r--r--Lib/wave.py8
-rw-r--r--Lib/weakref.py6
-rw-r--r--Lib/webbrowser.py50
-rw-r--r--Lib/wsgiref/handlers.py203
-rw-r--r--Lib/wsgiref/headers.py62
-rw-r--r--Lib/wsgiref/simple_server.py59
-rw-r--r--Lib/wsgiref/util.py40
-rw-r--r--Lib/wsgiref/validate.py42
-rw-r--r--Lib/xml/dom/minidom.py12
-rw-r--r--Lib/xml/etree/ElementInclude.py8
-rw-r--r--Lib/xml/etree/ElementPath.py351
-rw-r--r--Lib/xml/etree/ElementTree.py1238
-rw-r--r--Lib/xml/etree/__init__.py6
-rw-r--r--Lib/xml/parsers/expat.py6
-rw-r--r--Lib/xml/sax/expatreader.py3
-rw-r--r--Lib/xml/sax/saxutils.py42
-rw-r--r--Lib/xmlrpc/client.py290
-rw-r--r--Lib/xmlrpc/server.py114
-rw-r--r--Lib/zipfile.py514
-rw-r--r--Mac/BuildScript/README.txt157
-rwxr-xr-xMac/BuildScript/build-installer.py126
-rw-r--r--Mac/BuildScript/resources/ReadMe.txt47
-rw-r--r--Mac/BuildScript/resources/Welcome.rtf28
-rwxr-xr-xMac/BuildScript/scripts/postflight.documentation31
-rw-r--r--Mac/Extras.ReadMe.txt5
-rw-r--r--Mac/Makefile.in108
-rw-r--r--Mac/PythonLauncher/Makefile.in2
-rw-r--r--Mac/README93
-rw-r--r--Mac/Tools/pythonw.c173
-rw-r--r--Makefile.pre.in234
-rw-r--r--Misc/ACKS79
-rw-r--r--Misc/NEWS4528
-rw-r--r--Misc/Porting2
-rw-r--r--Misc/README15
-rw-r--r--Misc/README.Emacs32
-rw-r--r--Misc/README.OpenBSD38
-rw-r--r--Misc/README.klocwork30
-rw-r--r--Misc/RFD114
-rw-r--r--Misc/RPM/README27
-rw-r--r--Misc/RPM/python-3.2.spec (renamed from Misc/RPM/python-3.1.spec)63
-rw-r--r--Misc/Vim/vimrc39
-rwxr-xr-xMisc/build.sh10
-rw-r--r--Misc/cheatsheet2181
-rw-r--r--Misc/developers.txt346
-rw-r--r--Misc/gdbinit15
-rw-r--r--Misc/maintainers.rst314
-rw-r--r--Misc/pymemcompat.h85
-rw-r--r--Misc/python-config.in71
-rw-r--r--Misc/python-wing3.wpr (renamed from Misc/python-wing.wpr)2
-rw-r--r--Misc/python-wing4.wpr18
-rw-r--r--Misc/python.man10
-rw-r--r--Misc/python.pc.in6
-rw-r--r--Misc/setuid-prog.c176
-rw-r--r--Modules/Setup.dist13
-rw-r--r--Modules/_bisectmodule.c6
-rw-r--r--Modules/_codecsmodule.c16
-rw-r--r--Modules/_collectionsmodule.c192
-rw-r--r--Modules/_csv.c2
-rw-r--r--Modules/_ctypes/_ctypes.c38
-rw-r--r--Modules/_ctypes/callbacks.c54
-rw-r--r--Modules/_ctypes/callproc.c75
-rw-r--r--Modules/_ctypes/cfield.c93
-rw-r--r--Modules/_ctypes/ctypes.h3
-rw-r--r--Modules/_ctypes/libffi.diff218
-rw-r--r--Modules/_ctypes/libffi/ChangeLog4145
-rw-r--r--Modules/_ctypes/libffi/ChangeLog.libffi613
-rw-r--r--Modules/_ctypes/libffi/ChangeLog.libgcj40
-rw-r--r--Modules/_ctypes/libffi/ChangeLog.v1764
-rw-r--r--Modules/_ctypes/libffi/LICENSE2
-rw-r--r--Modules/_ctypes/libffi/Makefile.am19
-rw-r--r--Modules/_ctypes/libffi/Makefile.in573
-rw-r--r--Modules/_ctypes/libffi/README179
-rw-r--r--Modules/_ctypes/libffi/aclocal.m46926
-rwxr-xr-xModules/_ctypes/libffi/compile142
-rwxr-xr-xModules/_ctypes/libffi/config.guess268
-rwxr-xr-xModules/_ctypes/libffi/config.sub130
-rwxr-xr-xModules/_ctypes/libffi/configure24291
-rw-r--r--Modules/_ctypes/libffi/configure.ac55
-rwxr-xr-xModules/_ctypes/libffi/depcomp584
-rw-r--r--Modules/_ctypes/libffi/doc/libffi.info591
-rw-r--r--Modules/_ctypes/libffi/doc/libffi.texi598
-rw-r--r--Modules/_ctypes/libffi/doc/stamp-vti4
-rw-r--r--Modules/_ctypes/libffi/doc/version.texi4
-rw-r--r--Modules/_ctypes/libffi/fficonfig.h.in30
-rw-r--r--Modules/_ctypes/libffi/fficonfig.py.in6
-rw-r--r--Modules/_ctypes/libffi/include/Makefile.am2
-rw-r--r--Modules/_ctypes/libffi/include/Makefile.in147
-rw-r--r--Modules/_ctypes/libffi/include/ffi.h.in13
-rw-r--r--Modules/_ctypes/libffi/include/ffi_common.h24
-rw-r--r--Modules/_ctypes/libffi/libffi.pc.in10
-rw-r--r--Modules/_ctypes/libffi/libtool-version29
-rwxr-xr-xModules/_ctypes/libffi/ltmain.sh8406
-rw-r--r--Modules/_ctypes/libffi/m4/libtool.m47360
-rw-r--r--Modules/_ctypes/libffi/m4/ltoptions.m4368
-rw-r--r--Modules/_ctypes/libffi/m4/ltsugar.m4123
-rw-r--r--Modules/_ctypes/libffi/m4/ltversion.m423
-rw-r--r--Modules/_ctypes/libffi/m4/lt~obsolete.m492
-rw-r--r--Modules/_ctypes/libffi/man/Makefile.am8
-rw-r--r--Modules/_ctypes/libffi/man/Makefile.in448
-rw-r--r--Modules/_ctypes/libffi/man/ffi.331
-rw-r--r--Modules/_ctypes/libffi/man/ffi_call.3103
-rw-r--r--Modules/_ctypes/libffi/man/ffi_prep_cif.366
-rwxr-xr-xModules/_ctypes/libffi/mdate-sh201
-rwxr-xr-xModules/_ctypes/libffi/missing23
-rw-r--r--Modules/_ctypes/libffi/msvcc.sh185
-rw-r--r--Modules/_ctypes/libffi/src/arm/sysv.S24
-rw-r--r--Modules/_ctypes/libffi/src/avr32/ffi.c421
-rw-r--r--Modules/_ctypes/libffi/src/avr32/ffitarget.h50
-rw-r--r--Modules/_ctypes/libffi/src/avr32/sysv.S208
-rw-r--r--Modules/_ctypes/libffi/src/closures.c610
-rw-r--r--Modules/_ctypes/libffi/src/darwin/ffitarget.h25
-rw-r--r--Modules/_ctypes/libffi/src/debug.c59
-rw-r--r--Modules/_ctypes/libffi/src/dlmalloc.c5099
-rw-r--r--Modules/_ctypes/libffi/src/frv/ffi.c2
-rw-r--r--Modules/_ctypes/libffi/src/java_raw_api.c356
-rw-r--r--Modules/_ctypes/libffi/src/mips/ffi.c167
-rw-r--r--Modules/_ctypes/libffi/src/mips/ffitarget.h41
-rw-r--r--Modules/_ctypes/libffi/src/mips/n32.S79
-rw-r--r--Modules/_ctypes/libffi/src/mips/o32.S16
-rw-r--r--Modules/_ctypes/libffi/src/moxie/eabi.S128
-rw-r--r--Modules/_ctypes/libffi/src/moxie/ffi.c276
-rw-r--r--Modules/_ctypes/libffi/src/moxie/ffitarget.h56
-rw-r--r--Modules/_ctypes/libffi/src/pa/ffi.c7
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/aix.S227
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/aix_closure.S420
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ffi.c27
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c288
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ffitarget.h14
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/sysv.S35
-rw-r--r--Modules/_ctypes/libffi/src/prep_cif.c9
-rw-r--r--Modules/_ctypes/libffi/src/raw_api.c254
-rw-r--r--Modules/_ctypes/libffi/src/s390/sysv.S2
-rw-r--r--Modules/_ctypes/libffi/src/sh/ffi.c4
-rw-r--r--Modules/_ctypes/libffi/src/sh/sysv.S22
-rw-r--r--Modules/_ctypes/libffi/src/sh64/ffi.c59
-rw-r--r--Modules/_ctypes/libffi/src/sh64/sysv.S39
-rw-r--r--Modules/_ctypes/libffi/src/sparc/ffi.c27
-rw-r--r--Modules/_ctypes/libffi/src/sparc/v8.S73
-rw-r--r--Modules/_ctypes/libffi/src/types.c77
-rw-r--r--Modules/_ctypes/libffi/src/x86/darwin.S19
-rw-r--r--Modules/_ctypes/libffi/src/x86/ffi.c444
-rw-r--r--Modules/_ctypes/libffi/src/x86/ffi64.c99
-rw-r--r--Modules/_ctypes/libffi/src/x86/ffitarget.h36
-rw-r--r--Modules/_ctypes/libffi/src/x86/sysv.S25
-rw-r--r--Modules/_ctypes/libffi/src/x86/unix64.S12
-rw-r--r--Modules/_ctypes/libffi/src/x86/win32.S1106
-rw-r--r--Modules/_ctypes/libffi/src/x86/win64.S460
-rw-r--r--Modules/_ctypes/libffi/testsuite/Makefile.am80
-rw-r--r--Modules/_ctypes/libffi/testsuite/Makefile.in482
-rw-r--r--Modules/_ctypes/libffi/testsuite/config/default.exp1
-rw-r--r--Modules/_ctypes/libffi/testsuite/lib/libffi-dg.exp300
-rw-r--r--Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp263
-rw-r--r--Modules/_ctypes/libffi/testsuite/lib/wrapper.exp45
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/call.exp36
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn0.c89
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn1.c81
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn2.c81
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn3.c82
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn4.c89
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn5.c92
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn6.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c95
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c64
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_12byte.c94
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_16byte.c95
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_18byte.c96
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_19byte.c102
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c89
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte1.c93
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_24byte.c113
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_2byte.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c95
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte1.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte2.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c98
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_4byte.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c109
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_5byte.c98
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_64byte.c124
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c113
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_6byte.c99
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c117
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_7byte.c97
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_8byte.c88
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte1.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte2.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_double.c93
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_float.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c92
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c134
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c117
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c95
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c92
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c93
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c66
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_double.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c57
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_float.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c105
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c57
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c86
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c86
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c140
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_schar.c44
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_sint.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_sshort.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c47
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_abi.c37
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c25
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h129
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float.c59
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float1.c58
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float2.c58
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float3.c72
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float4.c62
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c342
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/many.c69
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c63
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/negint.c53
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct.c152
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct1.c161
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct10.c133
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct2.c110
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct3.c111
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct4.c111
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct5.c112
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct6.c131
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct7.c111
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct8.c131
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct9.c131
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/problem1.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/promotion.c59
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c114
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl.c35
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl1.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl2.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_fl.c35
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_fl1.c36
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_fl2.c49
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_fl3.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c34
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_ll.c41
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_ll1.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_sc.c36
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_sl.c38
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_uc.c38
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_ul.c38
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/stret_large.c145
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/stret_large2.c148
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium.c124
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium2.c125
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c44
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c44
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c65
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c67
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c59
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c63
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c65
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c64
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c80
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c67
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/testclosure.c70
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.special/ffitestcxx.h96
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.special/special.exp37
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest.cc124
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc53
-rw-r--r--Modules/_ctypes/libffi/texinfo.tex7210
-rw-r--r--Modules/_ctypes/libffi_msvc/ffi.c12
-rw-r--r--Modules/_ctypes/libffi_msvc/ffi.h8
-rw-r--r--Modules/_ctypes/libffi_msvc/prep_cif.c2
-rw-r--r--Modules/_ctypes/libffi_osx/include/ffi.h5
-rw-r--r--Modules/_ctypes/malloc_closure.c7
-rw-r--r--Modules/_cursesmodule.c2807
-rw-r--r--Modules/_datetimemodule.c (renamed from Modules/datetimemodule.c)1682
-rw-r--r--Modules/_elementtree.c890
-rw-r--r--Modules/_functoolsmodule.c44
-rw-r--r--Modules/_gdbmmodule.c47
-rw-r--r--Modules/_hashopenssl.c84
-rw-r--r--Modules/_heapqmodule.c26
-rw-r--r--Modules/_io/_iomodule.c2
-rw-r--r--Modules/_io/_iomodule.h20
-rw-r--r--Modules/_io/bufferedio.c116
-rw-r--r--Modules/_io/bytesio.c263
-rw-r--r--Modules/_io/fileio.c97
-rw-r--r--Modules/_io/iobase.c15
-rw-r--r--Modules/_io/stringio.c140
-rw-r--r--Modules/_io/textio.c94
-rw-r--r--Modules/_json.c172
-rw-r--r--Modules/_localemodule.c51
-rw-r--r--Modules/_lsprof.c11
-rw-r--r--Modules/_math.c232
-rw-r--r--Modules/_math.h45
-rw-r--r--Modules/_multiprocessing/multiprocessing.h6
-rw-r--r--Modules/_pickle.c2410
-rw-r--r--Modules/_posixsubprocess.c501
-rw-r--r--Modules/_randommodule.c2
-rw-r--r--Modules/_sqlite/cache.c3
-rw-r--r--Modules/_sqlite/cache.h2
-rw-r--r--Modules/_sqlite/connection.c196
-rw-r--r--Modules/_sqlite/connection.h13
-rw-r--r--Modules/_sqlite/cursor.c132
-rw-r--r--Modules/_sqlite/cursor.h9
-rw-r--r--Modules/_sqlite/module.c2
-rw-r--r--Modules/_sqlite/module.h4
-rw-r--r--Modules/_sqlite/prepare_protocol.c3
-rw-r--r--Modules/_sqlite/prepare_protocol.h2
-rw-r--r--Modules/_sqlite/row.c24
-rw-r--r--Modules/_sqlite/row.h2
-rw-r--r--Modules/_sqlite/sqlitecompat.h31
-rw-r--r--Modules/_sqlite/statement.c7
-rw-r--r--Modules/_sqlite/statement.h2
-rw-r--r--Modules/_sqlite/util.c2
-rw-r--r--Modules/_sqlite/util.h2
-rw-r--r--Modules/_sre.c14
-rw-r--r--Modules/_ssl.c866
-rw-r--r--Modules/_struct.c110
-rw-r--r--Modules/_testcapimodule.c725
-rw-r--r--Modules/_testembed.c52
-rw-r--r--Modules/_threadmodule.c461
-rw-r--r--Modules/_time.c28
-rw-r--r--Modules/_time.h3
-rw-r--r--Modules/_tkinter.c4
-rw-r--r--Modules/arraymodule.c726
-rw-r--r--Modules/atexitmodule.c1
-rw-r--r--Modules/audioop.c136
-rw-r--r--Modules/binascii.c26
-rw-r--r--Modules/bz2module.c5
-rw-r--r--Modules/cmathmodule.c25
-rw-r--r--Modules/config.c.in4
-rw-r--r--Modules/errnomodule.c53
-rw-r--r--Modules/gcmodule.c57
-rw-r--r--Modules/getpath.c223
-rw-r--r--Modules/grpmodule.c13
-rw-r--r--Modules/itertoolsmodule.c134
-rw-r--r--Modules/ld_so_aix.in2
-rw-r--r--Modules/main.c300
-rwxr-xr-xModules/makesetup2
-rw-r--r--Modules/mathmodule.c986
-rw-r--r--Modules/md5module.c4
-rw-r--r--Modules/mmapmodule.c41
-rw-r--r--Modules/nismodule.c26
-rw-r--r--Modules/operator.c133
-rw-r--r--Modules/ossaudiodev.c25
-rw-r--r--Modules/parsermodule.c87
-rw-r--r--Modules/posixmodule.c2229
-rw-r--r--Modules/pwdmodule.c9
-rw-r--r--Modules/pyexpat.c288
-rw-r--r--Modules/python.c109
-rw-r--r--Modules/readline.c138
-rw-r--r--Modules/resource.c5
-rw-r--r--Modules/selectmodule.c100
-rw-r--r--Modules/sha1module.c60
-rw-r--r--Modules/sha256module.c4
-rw-r--r--Modules/sha512module.c4
-rw-r--r--Modules/signalmodule.c21
-rw-r--r--Modules/socketmodule.c299
-rw-r--r--Modules/socketmodule.h1
-rw-r--r--Modules/spwdmodule.c9
-rw-r--r--Modules/symtablemodule.c5
-rw-r--r--Modules/syslogmodule.c123
-rw-r--r--Modules/termios.c40
-rw-r--r--Modules/timemodule.c486
-rw-r--r--Modules/unicodedata.c35
-rw-r--r--Modules/unicodedata_db.h6595
-rw-r--r--Modules/unicodename_db.h33783
-rw-r--r--Modules/xxlimited.c287
-rw-r--r--Modules/xxmodule.c2
-rw-r--r--Modules/zipimport.c366
-rw-r--r--Modules/zlib/ChangeLog355
-rw-r--r--Modules/zlib/FAQ261
-rw-r--r--Modules/zlib/INDEX30
-rw-r--r--Modules/zlib/Makefile157
-rw-r--r--Modules/zlib/Makefile.in223
-rw-r--r--Modules/zlib/README86
-rw-r--r--Modules/zlib/adler32.c38
-rw-r--r--Modules/zlib/compress.c5
-rwxr-xr-xModules/zlib/configure345
-rw-r--r--Modules/zlib/crc32.c35
-rw-r--r--Modules/zlib/deflate.c268
-rw-r--r--Modules/zlib/deflate.h35
-rw-r--r--Modules/zlib/example.c6
-rw-r--r--Modules/zlib/gzclose.c25
-rw-r--r--Modules/zlib/gzguts.h132
-rw-r--r--Modules/zlib/gzlib.c537
-rw-r--r--Modules/zlib/gzread.c653
-rw-r--r--Modules/zlib/gzwrite.c531
-rw-r--r--Modules/zlib/infback.c93
-rw-r--r--Modules/zlib/inffast.c80
-rw-r--r--Modules/zlib/inffast.h4
-rw-r--r--Modules/zlib/inflate.c282
-rw-r--r--Modules/zlib/inflate.h31
-rw-r--r--Modules/zlib/inftrees.c63
-rw-r--r--Modules/zlib/inftrees.h27
-rw-r--r--Modules/zlib/make_vms.com479
-rw-r--r--Modules/zlib/minigzip.c139
-rw-r--r--Modules/zlib/trees.c93
-rw-r--r--Modules/zlib/trees.h4
-rw-r--r--Modules/zlib/uncompr.c4
-rw-r--r--Modules/zlib/zconf.h190
-rw-r--r--Modules/zlib/zconf.h.cmakein430
-rw-r--r--Modules/zlib/zconf.h.in428
-rw-r--r--Modules/zlib/zlib.366
-rw-r--r--Modules/zlib/zlib.h1162
-rw-r--r--Modules/zlib/zlib.map68
-rw-r--r--Modules/zlib/zlib.pc.in13
-rw-r--r--Modules/zlib/zutil.c32
-rw-r--r--Modules/zlib/zutil.h65
-rw-r--r--Modules/zlibmodule.c22
-rw-r--r--Objects/abstract.c129
-rw-r--r--Objects/bytearrayobject.c623
-rw-r--r--Objects/bytesobject.c760
-rw-r--r--Objects/capsule.c36
-rw-r--r--Objects/classobject.c4
-rw-r--r--Objects/cobject.c169
-rw-r--r--Objects/codeobject.c221
-rw-r--r--Objects/complexobject.c203
-rw-r--r--Objects/descrobject.c74
-rw-r--r--Objects/dictobject.c148
-rw-r--r--Objects/enumobject.c7
-rw-r--r--Objects/exceptions.c68
-rw-r--r--Objects/fileobject.c24
-rw-r--r--Objects/floatobject.c228
-rw-r--r--Objects/frameobject.c28
-rw-r--r--Objects/funcobject.c3
-rw-r--r--Objects/genobject.c2
-rw-r--r--Objects/iterobject.c4
-rw-r--r--Objects/listobject.c500
-rw-r--r--Objects/lnotab_notes.txt124
-rw-r--r--Objects/longobject.c2027
-rw-r--r--Objects/memoryobject.c138
-rw-r--r--Objects/methodobject.c4
-rw-r--r--Objects/moduleobject.c75
-rw-r--r--Objects/object.c202
-rw-r--r--Objects/obmalloc.c143
-rw-r--r--Objects/rangeobject.c626
-rw-r--r--Objects/setobject.c109
-rw-r--r--Objects/sliceobject.c27
-rw-r--r--Objects/stringlib/README.txt4
-rw-r--r--Objects/stringlib/count.h16
-rw-r--r--Objects/stringlib/ctype.h1
-rw-r--r--Objects/stringlib/fastsearch.h148
-rw-r--r--Objects/stringlib/find.h86
-rw-r--r--Objects/stringlib/formatter.h92
-rw-r--r--Objects/stringlib/partition.h47
-rw-r--r--Objects/stringlib/split.h394
-rw-r--r--Objects/stringlib/string_format.h26
-rw-r--r--Objects/stringlib/stringdefs.h4
-rw-r--r--Objects/stringlib/transmogrify.h113
-rw-r--r--Objects/stringlib/unicodedefs.h22
-rw-r--r--Objects/structseq.c238
-rw-r--r--Objects/tupleobject.c10
-rw-r--r--Objects/typeobject.c181
-rw-r--r--Objects/typeslots.inc75
-rw-r--r--Objects/typeslots.py30
-rw-r--r--Objects/unicodectype.c657
-rw-r--r--Objects/unicodeobject.c1585
-rw-r--r--Objects/unicodetype_db.h4305
-rw-r--r--Objects/weakrefobject.c4
-rw-r--r--PC/VC6/_ctypes.dsp8
-rw-r--r--PC/VC6/_msi.dsp8
-rw-r--r--PC/VC6/build_ssl.py11
-rw-r--r--PC/VC6/bz2.dsp2
-rw-r--r--PC/VC6/pythoncore.dsp30
-rw-r--r--PC/VC6/readme.txt7
-rw-r--r--PC/VC6/tcl852.patch11
-rw-r--r--PC/VS7.1/pythoncore.vcproj64
-rwxr-xr-xPC/VS7.1/rt.bat2
-rw-r--r--PC/VS8.0/_hashlib.vcproj8
-rw-r--r--PC/VS8.0/_sqlite3.vcproj16
-rw-r--r--PC/VS8.0/_ssl.vcproj8
-rw-r--r--PC/VS8.0/build_ssl.bat4
-rw-r--r--PC/VS8.0/build_ssl.py39
-rw-r--r--PC/VS8.0/bz2.vcproj16
-rw-r--r--PC/VS8.0/kill_python.c2
-rw-r--r--PC/VS8.0/make_buildinfo.c42
-rw-r--r--PC/VS8.0/make_buildinfo.vcproj61
-rw-r--r--PC/VS8.0/pcbuild.sln23
-rw-r--r--PC/VS8.0/pyproject.vsprops6
-rw-r--r--PC/VS8.0/pythoncore.vcproj154
-rw-r--r--PC/VS8.0/rt.bat2
-rw-r--r--PC/VS8.0/sqlite3.vcproj8
-rw-r--r--PC/VS8.0/sqlite3.vsprops2
-rw-r--r--PC/VS8.0/ssl.vcproj189
-rw-r--r--PC/_msi.c2
-rw-r--r--PC/_subprocess.c9
-rw-r--r--PC/config.c6
-rw-r--r--PC/getpathp.c59
-rwxr-xr-xPC/msvcrtmodule.c19
-rw-r--r--PC/os2emx/Makefile1
-rw-r--r--PC/os2emx/python27.def6
-rw-r--r--PC/os2vacpp/python.def1
-rw-r--r--PC/pyconfig.h19
-rw-r--r--PC/python3.def689
-rw-r--r--PC/python3.mak10
-rw-r--r--PC/python32gen.py25
-rw-r--r--PC/python32stub.def689
-rw-r--r--PC/python3dll.c9
-rw-r--r--PC/python_nt.rc2
-rw-r--r--PC/winreg.c169
-rw-r--r--PC/winsound.c28
-rw-r--r--PCbuild/_hashlib.vcproj8
-rw-r--r--PCbuild/_ssl.vcproj8
-rw-r--r--PCbuild/build_ssl.py55
-rw-r--r--PCbuild/build_tkinter.py14
-rw-r--r--PCbuild/bz2.vcproj16
-rw-r--r--PCbuild/kill_python.c2
-rw-r--r--PCbuild/make_buildinfo.c57
-rw-r--r--PCbuild/make_buildinfo.vcproj61
-rw-r--r--PCbuild/pcbuild.sln58
-rw-r--r--PCbuild/pyproject.vsprops6
-rw-r--r--PCbuild/python3dll.vcproj246
-rw-r--r--PCbuild/pythoncore.vcproj154
-rw-r--r--PCbuild/readme.txt6
-rw-r--r--PCbuild/rt.bat6
-rw-r--r--PCbuild/ssl.vcproj189
-rw-r--r--PCbuild/vs9to8.py2
-rw-r--r--PCbuild/xxlimited.vcproj417
-rw-r--r--Parser/Python.asdl4
-rwxr-xr-xParser/asdl_c.py8
-rw-r--r--Parser/grammar.mak45
-rw-r--r--Parser/myreadline.c2
-rw-r--r--Parser/parsetok.c19
-rw-r--r--Parser/pgenmain.c2
-rw-r--r--Parser/printgrammar.c2
-rw-r--r--Parser/tokenizer.c143
-rw-r--r--Parser/tokenizer.h7
-rw-r--r--Python/Python-ast.c24
-rw-r--r--Python/_warnings.c125
-rw-r--r--Python/ast.c205
-rw-r--r--Python/bltinmodule.c163
-rw-r--r--Python/ceval.c616
-rw-r--r--Python/ceval_gil.h433
-rw-r--r--Python/compile.c335
-rw-r--r--Python/dtoa.c5
-rw-r--r--Python/dynamic_annotations.c154
-rw-r--r--Python/dynload_atheos.c47
-rw-r--r--Python/dynload_shlib.c21
-rw-r--r--Python/dynload_win.c14
-rw-r--r--Python/errors.c89
-rw-r--r--Python/fileutils.c431
-rw-r--r--Python/formatter_unicode.c2
-rw-r--r--Python/future.c8
-rw-r--r--Python/getargs.c502
-rw-r--r--Python/getcopyright.c2
-rw-r--r--Python/getopt.c6
-rw-r--r--Python/graminit.c1768
-rw-r--r--Python/import.c816
-rw-r--r--Python/importdl.c34
-rw-r--r--Python/marshal.c24
-rw-r--r--Python/modsupport.c46
-rw-r--r--Python/opcode_targets.h8
-rw-r--r--Python/peephole.c44
-rw-r--r--Python/pyarena.c1
-rw-r--r--Python/pymath.c199
-rw-r--r--Python/pystate.c58
-rw-r--r--Python/pystrtod.c88
-rw-r--r--Python/pythonrun.c315
-rw-r--r--Python/pytime.c60
-rw-r--r--Python/symtable.c73
-rw-r--r--Python/sysmodule.c691
-rw-r--r--Python/thread.c14
-rw-r--r--Python/thread_atheos.h300
-rw-r--r--Python/thread_cthread.h50
-rw-r--r--Python/thread_foobar.h44
-rw-r--r--Python/thread_lwp.h40
-rw-r--r--Python/thread_nt.h124
-rw-r--r--Python/thread_os2.h46
-rw-r--r--Python/thread_pth.h39
-rw-r--r--Python/thread_pthread.h239
-rw-r--r--Python/thread_sgi.h122
-rw-r--r--Python/thread_solaris.h50
-rw-r--r--Python/thread_wince.h41
-rw-r--r--Python/traceback.c11
-rw-r--r--README170
-rw-r--r--Tools/README45
-rw-r--r--Tools/buildbot/clean-amd64.bat5
-rw-r--r--Tools/buildbot/clean.bat3
-rw-r--r--Tools/buildbot/external-amd64.bat10
-rw-r--r--Tools/buildbot/external-common.bat18
-rw-r--r--Tools/buildbot/external.bat10
-rw-r--r--Tools/buildbot/test.bat2
-rw-r--r--Tools/ccbench/ccbench.py612
-rw-r--r--Tools/demo/README16
-rwxr-xr-x[-rw-r--r--]Tools/demo/beer.py (renamed from Demo/scripts/beer.py)9
-rwxr-xr-x[-rw-r--r--]Tools/demo/eiffel.py (renamed from Demo/newmetaclasses/Eiffel.py)125
-rwxr-xr-xTools/demo/hanoi.py (renamed from Demo/tkinter/guido/hanoi.py)26
-rwxr-xr-xTools/demo/life.py (renamed from Demo/curses/life.py)119
-rwxr-xr-xTools/demo/markov.py (renamed from Demo/scripts/markov.py)6
-rwxr-xr-xTools/demo/mcast.py (renamed from Demo/sockets/mcast.py)22
-rwxr-xr-xTools/demo/queens.py (renamed from Demo/scripts/queens.py)6
-rw-r--r--Tools/demo/redemo.py (renamed from Tools/scripts/redemo.py)0
-rwxr-xr-xTools/demo/rpython.py38
-rwxr-xr-xTools/demo/rpythond.py (renamed from Demo/sockets/rpythond.py)34
-rwxr-xr-x[-rw-r--r--]Tools/demo/sortvisu.py (renamed from Demo/tkinter/guido/sortvisu.py)7
-rwxr-xr-x[-rw-r--r--]Tools/demo/ss1.py (renamed from Demo/tkinter/guido/ss1.py)8
-rwxr-xr-xTools/demo/vector.py (renamed from Demo/classes/Vec.py)10
-rw-r--r--Tools/faqwiz/README114
-rw-r--r--Tools/faqwiz/faqconf.py577
-rw-r--r--Tools/faqwiz/faqcust.py1
-rwxr-xr-xTools/faqwiz/faqw.py33
-rw-r--r--Tools/faqwiz/faqwiz.py840
-rwxr-xr-xTools/faqwiz/move-faqwiz.sh55
-rw-r--r--Tools/framer/README.txt8
-rw-r--r--Tools/framer/TODO.txt6
-rw-r--r--Tools/framer/example.py126
-rw-r--r--Tools/framer/framer/__init__.py6
-rw-r--r--Tools/framer/framer/bases.py215
-rw-r--r--Tools/framer/framer/function.py173
-rw-r--r--Tools/framer/framer/member.py73
-rw-r--r--Tools/framer/framer/slots.py64
-rw-r--r--Tools/framer/framer/struct.py52
-rw-r--r--Tools/framer/framer/structparse.py46
-rw-r--r--Tools/framer/framer/template.py102
-rw-r--r--Tools/framer/framer/util.py35
-rwxr-xr-xTools/freeze/freeze.py4
-rw-r--r--Tools/freeze/makeconfig.py13
-rw-r--r--Tools/gdb/libpython.py1633
-rw-r--r--Tools/i18n/makelocalealias.py4
-rwxr-xr-xTools/i18n/msgfmt.py58
-rwxr-xr-xTools/i18n/pygettext.py2
-rw-r--r--Tools/iobench/iobench.py545
-rw-r--r--Tools/modulator/EXAMPLE.py53
-rw-r--r--Tools/modulator/README25
-rw-r--r--Tools/modulator/ScrolledListbox.py37
-rw-r--r--Tools/modulator/Templates/module_head6
-rw-r--r--Tools/modulator/Templates/module_method14
-rw-r--r--Tools/modulator/Templates/module_tail37
-rw-r--r--Tools/modulator/Templates/object_head13
-rw-r--r--Tools/modulator/Templates/object_method14
-rw-r--r--Tools/modulator/Templates/object_mlist8
-rw-r--r--Tools/modulator/Templates/object_new13
-rw-r--r--Tools/modulator/Templates/object_structure37
-rw-r--r--Tools/modulator/Templates/object_tail33
-rw-r--r--Tools/modulator/Templates/object_tp_as_mapping29
-rw-r--r--Tools/modulator/Templates/object_tp_as_number162
-rw-r--r--Tools/modulator/Templates/object_tp_as_sequence58
-rw-r--r--Tools/modulator/Templates/object_tp_call7
-rw-r--r--Tools/modulator/Templates/object_tp_compare6
-rw-r--r--Tools/modulator/Templates/object_tp_dealloc7
-rw-r--r--Tools/modulator/Templates/object_tp_getattr7
-rw-r--r--Tools/modulator/Templates/object_tp_hash6
-rw-r--r--Tools/modulator/Templates/object_tp_print7
-rw-r--r--Tools/modulator/Templates/object_tp_repr9
-rw-r--r--Tools/modulator/Templates/object_tp_setattr9
-rw-r--r--Tools/modulator/Templates/object_tp_str10
-rwxr-xr-xTools/modulator/Tkextra.py234
-rwxr-xr-xTools/modulator/genmodule.py160
-rwxr-xr-xTools/modulator/modulator.py383
-rw-r--r--Tools/modulator/varsubst.py56
-rw-r--r--Tools/msi/merge.py84
-rw-r--r--Tools/msi/msi.py137
-rw-r--r--Tools/msi/msilib.py65
-rw-r--r--Tools/msi/uuids.py47
-rw-r--r--Tools/parser/test_unparse.py240
-rw-r--r--Tools/parser/unparse.py (renamed from Demo/parser/unparse.py)227
-rwxr-xr-xTools/pybench/pybench.py2
-rw-r--r--Tools/pynche/ChipViewer.py2
-rw-r--r--Tools/pynche/DetailsViewer.py2
-rw-r--r--Tools/pynche/ListViewer.py2
-rw-r--r--Tools/pynche/PyncheWidget.py22
-rw-r--r--Tools/pynche/StripViewer.py18
-rw-r--r--Tools/pynche/Switchboard.py10
-rw-r--r--Tools/pynche/TextViewer.py2
-rw-r--r--Tools/pynche/TypeinViewer.py2
-rw-r--r--Tools/scripts/README126
-rw-r--r--Tools/scripts/abitype.py199
-rwxr-xr-xTools/scripts/byext.py25
-rwxr-xr-xTools/scripts/byteyears.py2
-rwxr-xr-xTools/scripts/checkappend.py169
-rwxr-xr-xTools/scripts/checkpyc.py39
-rwxr-xr-xTools/scripts/classfix.py190
-rw-r--r--Tools/scripts/cleanfuture.py2
-rw-r--r--Tools/scripts/combinerefs.py2
-rwxr-xr-xTools/scripts/copytime.py2
-rwxr-xr-xTools/scripts/crlf.py2
-rwxr-xr-xTools/scripts/cvsfiles.py72
-rw-r--r--Tools/scripts/db2pickle.py2
-rwxr-xr-xTools/scripts/dutree.py2
-rwxr-xr-xTools/scripts/eptags.py2
-rwxr-xr-x[-rw-r--r--]Tools/scripts/find-uname.py (renamed from Demo/scripts/find-uname.py)2
-rw-r--r--Tools/scripts/find_recursionlimit.py2
-rwxr-xr-xTools/scripts/finddiv.py2
-rwxr-xr-xTools/scripts/findlinksto.py2
-rwxr-xr-xTools/scripts/findnocoding.py2
-rwxr-xr-xTools/scripts/fixcid.py2
-rwxr-xr-xTools/scripts/fixdiv.py2
-rwxr-xr-xTools/scripts/fixheader.py2
-rwxr-xr-xTools/scripts/fixnotice.py2
-rwxr-xr-xTools/scripts/fixps.py2
-rwxr-xr-xTools/scripts/ftpmirror.py2
-rw-r--r--Tools/scripts/get-remote-certificate.py (renamed from Tools/ssl/get-remote-certificate.py)9
-rwxr-xr-xTools/scripts/google.py2
-rwxr-xr-xTools/scripts/gprof2html.py2
-rwxr-xr-xTools/scripts/h2py.py10
-rwxr-xr-xTools/scripts/ifdef.py2
-rwxr-xr-xTools/scripts/lfcr.py2
-rwxr-xr-xTools/scripts/linktree.py2
-rwxr-xr-xTools/scripts/lll.py2
-rwxr-xr-xTools/scripts/logmerge.py185
-rw-r--r--Tools/scripts/md5sum.py2
-rwxr-xr-xTools/scripts/methfix.py171
-rwxr-xr-xTools/scripts/mkreal.py2
-rwxr-xr-xTools/scripts/ndiff.py2
-rwxr-xr-xTools/scripts/nm2def.py2
-rwxr-xr-xTools/scripts/objgraph.py2
-rwxr-xr-xTools/scripts/parseentities.py2
-rwxr-xr-xTools/scripts/pathfix.py21
-rwxr-xr-xTools/scripts/pdeps.py2
-rw-r--r--Tools/scripts/pickle2db.py2
-rwxr-xr-xTools/scripts/pindent.py6
-rwxr-xr-xTools/scripts/ptags.py2
-rw-r--r--Tools/scripts/pysource.py2
-rwxr-xr-xTools/scripts/reindent.py62
-rwxr-xr-xTools/scripts/rgrep.py14
-rwxr-xr-xTools/scripts/serve.py35
-rw-r--r--Tools/scripts/setup.py20
-rwxr-xr-xTools/scripts/suff.py21
-rw-r--r--Tools/scripts/svneol.py51
-rwxr-xr-xTools/scripts/texi2html.py2
-rwxr-xr-xTools/scripts/treesync.py2
-rwxr-xr-xTools/scripts/untabify.py16
-rwxr-xr-xTools/scripts/which.py2
-rwxr-xr-xTools/scripts/xxci.py121
-rw-r--r--Tools/test2to3/README (renamed from Demo/distutils/test2to3/README)0
-rw-r--r--Tools/test2to3/maintest.py (renamed from Demo/distutils/test2to3/maintest.py)2
-rw-r--r--Tools/test2to3/setup.py (renamed from Demo/distutils/test2to3/setup.py)0
-rw-r--r--Tools/test2to3/test/runtests.py (renamed from Demo/distutils/test2to3/test/runtests.py)0
-rw-r--r--Tools/test2to3/test/test_foo.py (renamed from Demo/distutils/test2to3/test/test_foo.py)0
-rw-r--r--Tools/test2to3/test2to3/__init__.py (renamed from Demo/distutils/test2to3/test2to3/__init__.py)0
-rw-r--r--Tools/test2to3/test2to3/hello.py (renamed from Demo/distutils/test2to3/test2to3/hello.py)0
-rw-r--r--Tools/unicode/comparecodecs.py2
-rw-r--r--Tools/unicode/gencodec.py24
-rw-r--r--Tools/unicode/genwincodec.py61
-rw-r--r--Tools/unicode/genwincodecs.bat7
-rw-r--r--Tools/unicode/makeunicodedata.py231
-rw-r--r--Tools/unittestgui/README.txt16
-rw-r--r--Tools/unittestgui/unittestgui.py479
-rw-r--r--Tools/webchecker/README23
-rw-r--r--Tools/webchecker/tktools.py366
-rwxr-xr-xTools/webchecker/wcgui.py462
-rw-r--r--Tools/webchecker/wcmac.py9
-rwxr-xr-xTools/webchecker/webchecker.py890
-rwxr-xr-xTools/webchecker/websucker.py125
-rwxr-xr-xTools/webchecker/wsgui.py240
-rw-r--r--Tools/world/README85
-rwxr-xr-xTools/world/world568
-rwxr-xr-xconfigure1570
-rw-r--r--configure.in1674
-rw-r--r--pyconfig.h.in87
-rwxr-xr-xruntests.sh93
-rw-r--r--setup.py446
2197 files changed, 291894 insertions, 188786 deletions
diff --git a/.bzrignore b/.bzrignore
index 463e983e86..376f00f590 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -11,27 +11,12 @@ python
build
Makefile.pre
platform
+pybuilddir.txt
pyconfig.h
libpython*.a
python.exe
-CP936.TXT
-SHIFT_JISX0213.TXT
-JOHAB.TXT
-EUC-JP.TXT
-NormalizationTest-3.2.0.txt
-NormalizationTest.txt
-BIG5.TXT
-BIG5HKSCS-2004.TXT
-CP949.TXT
-EUC-CN.TXT
-BIG5HKSCS.TXT
-SHIFTJIS.TXT
-EUC-KR.TXT
-EUC-JISX0213.TXT
-CP932.TXT
-CP950.TXT
+python-gdb.py
reflog.txt
-gb-18030-2000.xml
tags
TAGS
.gdb_history
@@ -47,5 +32,8 @@ Modules/Setup.local
Modules/config.c
Modules/ld_so_aix
Parser/pgen
+Parser/pgen.stamp
+Lib/test/data/*
Lib/lib2to3/Grammar*.pickle
Lib/lib2to3/PatternGrammar*.pickle
+__pycache__
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..ad3d0e790b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,44 @@
+*.cover
+*.o
+*.orig
+*.pyc
+*.pyd
+*.pyo
+*.rej
+*~
+Doc/build/
+Doc/tools/docutils/
+Doc/tools/jinja2/
+Doc/tools/pygments/
+Doc/tools/sphinx/
+Lib/lib2to3/*.pickle
+Makefile
+Makefile.pre
+Misc/python.pc
+Modules/Setup
+Modules/Setup.config
+Modules/Setup.local
+Modules/config.c
+Modules/ld_so_aix
+PCbuild/*.bsc
+PCbuild/*.dll
+PCbuild/*.exe
+PCbuild/*.exp
+PCbuild/*.lib
+PCbuild/*.ncb
+PCbuild/*.o
+PCbuild/*.pdb
+PCbuild/Win32-temp-*
+Parser/pgen
+Parser/pgen.stamp
+__pycache__
+autom4te.cache
+build/
+config.log
+config.status
+libpython*.a
+pybuilddir.txt
+pyconfig.h
+python
+python-gdb.py
+tags
diff --git a/.hgignore b/.hgignore
index 33e6caa649..e5e149fba5 100644
--- a/.hgignore
+++ b/.hgignore
@@ -1,40 +1,23 @@
.gdb_history
.purify
-.svn
-BIG5.TXT
-BIG5HKSCS-2004.TXT
-BIG5HKSCS.TXT
-CP932.TXT
-CP936.TXT
-CP949.TXT
-CP950.TXT
-EUC-CN.TXT
-EUC-JISX0213.TXT
-EUC-JP.TXT
-EUC-KR.TXT
-JOHAB.TXT
+.svn/
Makefile$
Makefile.pre$
-NormalizationTest-3.2.0.txt
-NormalizationTest.txt
-SHIFTJIS.TXT
-SHIFT_JISX0213.TXT
-TAGS
-autom4te.cache
-build
-buildno
+TAGS$
+autom4te.cache$
+build/
+buildno$
config.cache
config.log
config.status
config.status.lineno
db_home
-gb-18030-2000.xml
-platform
-pyconfig.h
-python
-python.exe
-reflog.txt
-tags
+platform$
+pyconfig.h$
+python$
+python.exe$
+reflog.txt$
+tags$
Lib/plat-mac/errors.rsrc.df.rsrc
Doc/tools/sphinx/
Doc/tools/docutils/
@@ -42,15 +25,21 @@ Doc/tools/jinja/
Doc/tools/jinja2/
Doc/tools/pygments/
Misc/python.pc
-Modules/Setup
+Modules/Setup$
Modules/Setup.config
Modules/Setup.local
Modules/config.c
-Parser/pgen
-core
Modules/ld_so_aix$
+Parser/pgen$
+Parser/pgen.stamp$
+^core
+^python-gdb.py
+^python.exe-gdb.py
+^pybuilddir.txt
+
syntax: glob
libpython*.a
+*.swp
*.o
*.pyc
*.pyo
@@ -60,6 +49,8 @@ libpython*.a
*.rej
*~
Lib/lib2to3/*.pickle
+Lib/test/data/*
+Misc/*.wpu
PC/python_nt*.h
PC/pythonnt_rc*.h
PC/*.obj
@@ -72,3 +63,5 @@ PCbuild/*.o
PCbuild/*.ncb
PCbuild/*.bsc
PCbuild/Win32-temp-*
+__pycache__
+Modules/_testembed
diff --git a/Demo/README b/Demo/README
deleted file mode 100644
index 9d150d6829..0000000000
--- a/Demo/README
+++ /dev/null
@@ -1,61 +0,0 @@
-This directory contains various demonstrations of what you can do with
-Python. They were all written by me except where explicitly stated
-otherwise -- in general, demos contributed by others ends up in the
-../Contrib directory, unless I think they're of utmost general
-importance (like Matt Conway's Tk demos).
-
-A fair number of utilities that are useful when while developing
-Python code can be found in the ../Tools directory -- some of these
-can also be considered good examples of how to write Python code.
-
-Finally, in order to save disk space and net bandwidth, not all
-subdirectories listed here are distributed. They are listed just
-in case I change my mind about them.
-
-
-cgi CGI examples (see also ../Tools/faqwiz/.)
-
-classes Some examples of how to use classes.
-
-comparisons A set of responses to a really old language-comparison
- challenge.
-
-curses A set of curses demos.
-
-embed An example of embedding Python in another application
- (see also pysvr).
-
-imputil Demonstration subclasses of imputil.Importer.
-
-md5test Test program for the optional md5 module.
-
-metaclasses The code from the 1.5 metaclasses paper on the web.
-
-parser Example using the parser module.
-
-pdist Old, unfinished code messing with CVS, RCS and remote
- files.
-
-pysvr An example of embedding Python in a threaded
- application.
-
-rpc A set of classes for building clients and servers for
- Sun RPC.
-
-scripts Some useful Python scripts that I put in my bin
- directory. No optional built-in modules needed.
-
-sockets Examples for the new built-in module 'socket'.
-
-threads Demos that use the 'thread' module. (Currently these
- only run on SGIs, but this may change in the future.)
-
-tix Demos using the Tix widget set addition to Tkinter.
-
-tkinter Demos using the Tk interface (including Matt Conway's
- excellent set of demos).
-
-xml Some XML demos.
-
-zlib Some demos for the zlib module (see also the standard
- library module gzip.py).
diff --git a/Demo/cgi/README b/Demo/cgi/README
deleted file mode 100644
index c0631b6c63..0000000000
--- a/Demo/cgi/README
+++ /dev/null
@@ -1,10 +0,0 @@
-CGI Examples
-------------
-
-Here are some example CGI programs.
-
-cgi0.sh -- A shell script to test your server is configured for CGI
-cgi1.py -- A Python script to test your server is configured for CGI
-cgi2.py -- A Python script showing how to parse a form
-cgi3.py -- A Python script for driving an arbitrary CGI application
-wiki.py -- Sample CGI application: a minimal Wiki implementation
diff --git a/Demo/cgi/cgi0.sh b/Demo/cgi/cgi0.sh
deleted file mode 100755
index 5cefcd37c4..0000000000
--- a/Demo/cgi/cgi0.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /bin/sh
-
-# If you can't get this to work, your web server isn't set up right
-
-echo Content-type: text/plain
-echo
-echo Hello world
-echo This is cgi0.sh
diff --git a/Demo/cgi/cgi1.py b/Demo/cgi/cgi1.py
deleted file mode 100755
index 842fef2541..0000000000
--- a/Demo/cgi/cgi1.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/local/bin/python
-
-"""CGI test 1 - check server setup."""
-
-# Until you get this to work, your web server isn't set up right or
-# your Python isn't set up right.
-
-# If cgi0.sh works but cgi1.py doesn't, check the #! line and the file
-# permissions. The docs for the cgi.py module have debugging tips.
-
-print("Content-type: text/html")
-print()
-print("<h1>Hello world</h1>")
-print("<p>This is cgi1.py")
diff --git a/Demo/cgi/cgi2.py b/Demo/cgi/cgi2.py
deleted file mode 100755
index 1d5822c463..0000000000
--- a/Demo/cgi/cgi2.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/local/bin/python
-
-"""CGI test 2 - basic use of cgi module."""
-
-import cgitb; cgitb.enable()
-
-import cgi
-
-def main():
- form = cgi.FieldStorage()
- print("Content-type: text/html")
- print()
- if not form:
- print("<h1>No Form Keys</h1>")
- else:
- print("<h1>Form Keys</h1>")
- for key in form.keys():
- value = form[key].value
- print("<p>", cgi.escape(key), ":", cgi.escape(value))
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/cgi/cgi3.py b/Demo/cgi/cgi3.py
deleted file mode 100755
index a3421b5b2d..0000000000
--- a/Demo/cgi/cgi3.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/local/bin/python
-
-"""CGI test 3 (persistent data)."""
-
-import cgitb; cgitb.enable()
-
-from wiki import main
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/cgi/wiki.py b/Demo/cgi/wiki.py
deleted file mode 100644
index 6b971132b9..0000000000
--- a/Demo/cgi/wiki.py
+++ /dev/null
@@ -1,123 +0,0 @@
-"""Wiki main program. Imported and run by cgi3.py."""
-
-import os, re, cgi, sys, tempfile
-escape = cgi.escape
-
-def main():
- form = cgi.FieldStorage()
- print("Content-type: text/html")
- print()
- cmd = form.getvalue("cmd", "view")
- page = form.getvalue("page", "FrontPage")
- wiki = WikiPage(page)
- method = getattr(wiki, 'cmd_' + cmd, None) or wiki.cmd_view
- method(form)
-
-class WikiPage:
-
- homedir = tempfile.gettempdir()
- scripturl = os.path.basename(sys.argv[0])
-
- def __init__(self, name):
- if not self.iswikiword(name):
- raise ValueError("page name is not a wiki word")
- self.name = name
- self.load()
-
- def cmd_view(self, form):
- print("<h1>", escape(self.splitwikiword(self.name)), "</h1>")
- print("<p>")
- for line in self.data.splitlines():
- line = line.rstrip()
- if not line:
- print("<p>")
- else:
- print(self.formatline(line))
- print("<hr>")
- print("<p>", self.mklink("edit", self.name, "Edit this page") + ";")
- print(self.mklink("view", "FrontPage", "go to front page") + ".")
-
- def formatline(self, line):
- words = []
- for word in re.split('(\W+)', line):
- if self.iswikiword(word):
- if os.path.isfile(self.mkfile(word)):
- word = self.mklink("view", word, word)
- else:
- word = self.mklink("new", word, word + "*")
- else:
- word = escape(word)
- words.append(word)
- return "".join(words)
-
- def cmd_edit(self, form, label="Change"):
- print("<h1>", label, self.name, "</h1>")
- print('<form method="POST" action="%s">' % self.scripturl)
- s = '<textarea cols="70" rows="20" name="text">%s</textarea>'
- print(s % self.data)
- print('<input type="hidden" name="cmd" value="create">')
- print('<input type="hidden" name="page" value="%s">' % self.name)
- print('<br>')
- print('<input type="submit" value="%s Page">' % label)
- print("</form>")
-
- def cmd_create(self, form):
- self.data = form.getvalue("text", "").strip()
- error = self.store()
- if error:
- print("<h1>I'm sorry. That didn't work</h1>")
- print("<p>An error occurred while attempting to write the file:")
- print("<p>", escape(error))
- else:
- # Use a redirect directive, to avoid "reload page" problems
- print("<head>")
- s = '<meta http-equiv="refresh" content="1; URL=%s">'
- print(s % (self.scripturl + "?cmd=view&page=" + self.name))
- print("<head>")
- print("<h1>OK</h1>")
- print("<p>If nothing happens, please click here:", end=' ')
- print(self.mklink("view", self.name, self.name))
-
- def cmd_new(self, form):
- self.cmd_edit(form, label="Create")
-
- def iswikiword(self, word):
- return re.match("[A-Z][a-z]+([A-Z][a-z]*)+", word)
-
- def splitwikiword(self, word):
- chars = []
- for c in word:
- if chars and c.isupper():
- chars.append(' ')
- chars.append(c)
- return "".join(chars)
-
- def mkfile(self, name=None):
- if name is None:
- name = self.name
- return os.path.join(self.homedir, name + ".txt")
-
- def mklink(self, cmd, page, text):
- link = self.scripturl + "?cmd=" + cmd + "&page=" + page
- return '<a href="%s">%s</a>' % (link, text)
-
- def load(self):
- try:
- f = open(self.mkfile())
- data = f.read().strip()
- f.close()
- except IOError:
- data = ""
- self.data = data
-
- def store(self):
- data = self.data
- try:
- f = open(self.mkfile(), "w")
- f.write(data)
- if data and not data.endswith('\n'):
- f.write('\n')
- f.close()
- return ""
- except IOError as err:
- return "IOError: %s" % str(err)
diff --git a/Demo/classes/Complex.py b/Demo/classes/Complex.py
deleted file mode 100755
index 64c56d4653..0000000000
--- a/Demo/classes/Complex.py
+++ /dev/null
@@ -1,314 +0,0 @@
-# Complex numbers
-# ---------------
-
-# [Now that Python has a complex data type built-in, this is not very
-# useful, but it's still a nice example class]
-
-# This module represents complex numbers as instances of the class Complex.
-# A Complex instance z has two data attribues, z.re (the real part) and z.im
-# (the imaginary part). In fact, z.re and z.im can have any value -- all
-# arithmetic operators work regardless of the type of z.re and z.im (as long
-# as they support numerical operations).
-#
-# The following functions exist (Complex is actually a class):
-# Complex([re [,im]) -> creates a complex number from a real and an imaginary part
-# IsComplex(z) -> true iff z is a complex number (== has .re and .im attributes)
-# ToComplex(z) -> a complex number equal to z; z itself if IsComplex(z) is true
-# if z is a tuple(re, im) it will also be converted
-# PolarToComplex([r [,phi [,fullcircle]]]) ->
-# the complex number z for which r == z.radius() and phi == z.angle(fullcircle)
-# (r and phi default to 0)
-# exp(z) -> returns the complex exponential of z. Equivalent to pow(math.e,z).
-#
-# Complex numbers have the following methods:
-# z.abs() -> absolute value of z
-# z.radius() == z.abs()
-# z.angle([fullcircle]) -> angle from positive X axis; fullcircle gives units
-# z.phi([fullcircle]) == z.angle(fullcircle)
-#
-# These standard functions and unary operators accept complex arguments:
-# abs(z)
-# -z
-# +z
-# not z
-# repr(z) == `z`
-# str(z)
-# hash(z) -> a combination of hash(z.re) and hash(z.im) such that if z.im is zero
-# the result equals hash(z.re)
-# Note that hex(z) and oct(z) are not defined.
-#
-# These conversions accept complex arguments only if their imaginary part is zero:
-# int(z)
-# float(z)
-#
-# The following operators accept two complex numbers, or one complex number
-# and one real number (int, long or float):
-# z1 + z2
-# z1 - z2
-# z1 * z2
-# z1 / z2
-# pow(z1, z2)
-# cmp(z1, z2)
-# Note that z1 % z2 and divmod(z1, z2) are not defined,
-# nor are shift and mask operations.
-#
-# The standard module math does not support complex numbers.
-# The cmath modules should be used instead.
-#
-# Idea:
-# add a class Polar(r, phi) and mixed-mode arithmetic which
-# chooses the most appropriate type for the result:
-# Complex for +,-,cmp
-# Polar for *,/,pow
-
-import math
-import sys
-
-twopi = math.pi*2.0
-halfpi = math.pi/2.0
-
-def IsComplex(obj):
- return hasattr(obj, 're') and hasattr(obj, 'im')
-
-def ToComplex(obj):
- if IsComplex(obj):
- return obj
- elif isinstance(obj, tuple):
- return Complex(*obj)
- else:
- return Complex(obj)
-
-def PolarToComplex(r = 0, phi = 0, fullcircle = twopi):
- phi = phi * (twopi / fullcircle)
- return Complex(math.cos(phi)*r, math.sin(phi)*r)
-
-def Re(obj):
- if IsComplex(obj):
- return obj.re
- return obj
-
-def Im(obj):
- if IsComplex(obj):
- return obj.im
- return 0
-
-class Complex:
-
- def __init__(self, re=0, im=0):
- _re = 0
- _im = 0
- if IsComplex(re):
- _re = re.re
- _im = re.im
- else:
- _re = re
- if IsComplex(im):
- _re = _re - im.im
- _im = _im + im.re
- else:
- _im = _im + im
- # this class is immutable, so setting self.re directly is
- # not possible.
- self.__dict__['re'] = _re
- self.__dict__['im'] = _im
-
- def __setattr__(self, name, value):
- raise TypeError('Complex numbers are immutable')
-
- def __hash__(self):
- if not self.im:
- return hash(self.re)
- return hash((self.re, self.im))
-
- def __repr__(self):
- if not self.im:
- return 'Complex(%r)' % (self.re,)
- else:
- return 'Complex(%r, %r)' % (self.re, self.im)
-
- def __str__(self):
- if not self.im:
- return repr(self.re)
- else:
- return 'Complex(%r, %r)' % (self.re, self.im)
-
- def __neg__(self):
- return Complex(-self.re, -self.im)
-
- def __pos__(self):
- return self
-
- def __abs__(self):
- return math.hypot(self.re, self.im)
-
- def __int__(self):
- if self.im:
- raise ValueError("can't convert Complex with nonzero im to int")
- return int(self.re)
-
- def __float__(self):
- if self.im:
- raise ValueError("can't convert Complex with nonzero im to float")
- return float(self.re)
-
- def __cmp__(self, other):
- other = ToComplex(other)
- return cmp((self.re, self.im), (other.re, other.im))
-
- def __rcmp__(self, other):
- other = ToComplex(other)
- return cmp(other, self)
-
- def __bool__(self):
- return not (self.re == self.im == 0)
-
- abs = radius = __abs__
-
- def angle(self, fullcircle = twopi):
- return (fullcircle/twopi) * ((halfpi - math.atan2(self.re, self.im)) % twopi)
-
- phi = angle
-
- def __add__(self, other):
- other = ToComplex(other)
- return Complex(self.re + other.re, self.im + other.im)
-
- __radd__ = __add__
-
- def __sub__(self, other):
- other = ToComplex(other)
- return Complex(self.re - other.re, self.im - other.im)
-
- def __rsub__(self, other):
- other = ToComplex(other)
- return other - self
-
- def __mul__(self, other):
- other = ToComplex(other)
- return Complex(self.re*other.re - self.im*other.im,
- self.re*other.im + self.im*other.re)
-
- __rmul__ = __mul__
-
- def __div__(self, other):
- other = ToComplex(other)
- d = float(other.re*other.re + other.im*other.im)
- if not d: raise ZeroDivisionError('Complex division')
- return Complex((self.re*other.re + self.im*other.im) / d,
- (self.im*other.re - self.re*other.im) / d)
-
- def __rdiv__(self, other):
- other = ToComplex(other)
- return other / self
-
- def __pow__(self, n, z=None):
- if z is not None:
- raise TypeError('Complex does not support ternary pow()')
- if IsComplex(n):
- if n.im:
- if self.im: raise TypeError('Complex to the Complex power')
- else: return exp(math.log(self.re)*n)
- n = n.re
- r = pow(self.abs(), n)
- phi = n*self.angle()
- return Complex(math.cos(phi)*r, math.sin(phi)*r)
-
- def __rpow__(self, base):
- base = ToComplex(base)
- return pow(base, self)
-
-def exp(z):
- r = math.exp(z.re)
- return Complex(math.cos(z.im)*r,math.sin(z.im)*r)
-
-
-def checkop(expr, a, b, value, fuzz = 1e-6):
- print(' ', a, 'and', b, end=' ')
- try:
- result = eval(expr)
- except:
- result = sys.exc_info()[0]
- print('->', result)
- if isinstance(result, str) or isinstance(value, str):
- ok = (result == value)
- else:
- ok = abs(result - value) <= fuzz
- if not ok:
- print('!!\t!!\t!! should be', value, 'diff', abs(result - value))
-
-def test():
- print('test constructors')
- constructor_test = (
- # "expect" is an array [re,im] "got" the Complex.
- ( (0,0), Complex() ),
- ( (0,0), Complex() ),
- ( (1,0), Complex(1) ),
- ( (0,1), Complex(0,1) ),
- ( (1,2), Complex(Complex(1,2)) ),
- ( (1,3), Complex(Complex(1,2),1) ),
- ( (0,0), Complex(0,Complex(0,0)) ),
- ( (3,4), Complex(3,Complex(4)) ),
- ( (-1,3), Complex(1,Complex(3,2)) ),
- ( (-7,6), Complex(Complex(1,2),Complex(4,8)) ) )
- cnt = [0,0]
- for t in constructor_test:
- cnt[0] += 1
- if ((t[0][0]!=t[1].re)or(t[0][1]!=t[1].im)):
- print(" expected", t[0], "got", t[1])
- cnt[1] += 1
- print(" ", cnt[1], "of", cnt[0], "tests failed")
- # test operators
- testsuite = {
- 'a+b': [
- (1, 10, 11),
- (1, Complex(0,10), Complex(1,10)),
- (Complex(0,10), 1, Complex(1,10)),
- (Complex(0,10), Complex(1), Complex(1,10)),
- (Complex(1), Complex(0,10), Complex(1,10)),
- ],
- 'a-b': [
- (1, 10, -9),
- (1, Complex(0,10), Complex(1,-10)),
- (Complex(0,10), 1, Complex(-1,10)),
- (Complex(0,10), Complex(1), Complex(-1,10)),
- (Complex(1), Complex(0,10), Complex(1,-10)),
- ],
- 'a*b': [
- (1, 10, 10),
- (1, Complex(0,10), Complex(0, 10)),
- (Complex(0,10), 1, Complex(0,10)),
- (Complex(0,10), Complex(1), Complex(0,10)),
- (Complex(1), Complex(0,10), Complex(0,10)),
- ],
- 'a/b': [
- (1., 10, 0.1),
- (1, Complex(0,10), Complex(0, -0.1)),
- (Complex(0, 10), 1, Complex(0, 10)),
- (Complex(0, 10), Complex(1), Complex(0, 10)),
- (Complex(1), Complex(0,10), Complex(0, -0.1)),
- ],
- 'pow(a,b)': [
- (1, 10, 1),
- (1, Complex(0,10), 1),
- (Complex(0,10), 1, Complex(0,10)),
- (Complex(0,10), Complex(1), Complex(0,10)),
- (Complex(1), Complex(0,10), 1),
- (2, Complex(4,0), 16),
- ],
- 'cmp(a,b)': [
- (1, 10, -1),
- (1, Complex(0,10), 1),
- (Complex(0,10), 1, -1),
- (Complex(0,10), Complex(1), -1),
- (Complex(1), Complex(0,10), 1),
- ],
- }
- for expr in sorted(testsuite):
- print(expr + ':')
- t = (expr,)
- for item in testsuite[expr]:
- checkop(*(t+item))
-
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/classes/Dates.py b/Demo/classes/Dates.py
deleted file mode 100755
index e1b054f7d6..0000000000
--- a/Demo/classes/Dates.py
+++ /dev/null
@@ -1,227 +0,0 @@
-# Class Date supplies date objects that support date arithmetic.
-#
-# Date(month,day,year) returns a Date object. An instance prints as,
-# e.g., 'Mon 16 Aug 1993'.
-#
-# Addition, subtraction, comparison operators, min, max, and sorting
-# all work as expected for date objects: int+date or date+int returns
-# the date `int' days from `date'; date+date raises an exception;
-# date-int returns the date `int' days before `date'; date2-date1 returns
-# an integer, the number of days from date1 to date2; int-date raises an
-# exception; date1 < date2 is true iff date1 occurs before date2 (&
-# similarly for other comparisons); min(date1,date2) is the earlier of
-# the two dates and max(date1,date2) the later; and date objects can be
-# used as dictionary keys.
-#
-# Date objects support one visible method, date.weekday(). This returns
-# the day of the week the date falls on, as a string.
-#
-# Date objects also have 4 read-only data attributes:
-# .month in 1..12
-# .day in 1..31
-# .year int or long int
-# .ord the ordinal of the date relative to an arbitrary staring point
-#
-# The Dates module also supplies function today(), which returns the
-# current date as a date object.
-#
-# Those entranced by calendar trivia will be disappointed, as no attempt
-# has been made to accommodate the Julian (etc) system. On the other
-# hand, at least this package knows that 2000 is a leap year but 2100
-# isn't, and works fine for years with a hundred decimal digits <wink>.
-
-# Tim Peters tim@ksr.com
-# not speaking for Kendall Square Research Corp
-
-# Adapted to Python 1.1 (where some hacks to overcome coercion are unnecessary)
-# by Guido van Rossum
-
-# Note that as of Python 2.3, a datetime module is included in the stardard
-# library.
-
-# vi:set tabsize=8:
-
-_MONTH_NAMES = [ 'January', 'February', 'March', 'April', 'May',
- 'June', 'July', 'August', 'September', 'October',
- 'November', 'December' ]
-
-_DAY_NAMES = [ 'Friday', 'Saturday', 'Sunday', 'Monday',
- 'Tuesday', 'Wednesday', 'Thursday' ]
-
-_DAYS_IN_MONTH = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]
-
-_DAYS_BEFORE_MONTH = []
-dbm = 0
-for dim in _DAYS_IN_MONTH:
- _DAYS_BEFORE_MONTH.append(dbm)
- dbm = dbm + dim
-del dbm, dim
-
-_INT_TYPES = type(1), type(1)
-
-def _is_leap(year): # 1 if leap year, else 0
- if year % 4 != 0: return 0
- if year % 400 == 0: return 1
- return year % 100 != 0
-
-def _days_in_year(year): # number of days in year
- return 365 + _is_leap(year)
-
-def _days_before_year(year): # number of days before year
- return year*365 + (year+3)//4 - (year+99)//100 + (year+399)//400
-
-def _days_in_month(month, year): # number of days in month of year
- if month == 2 and _is_leap(year): return 29
- return _DAYS_IN_MONTH[month-1]
-
-def _days_before_month(month, year): # number of days in year before month
- return _DAYS_BEFORE_MONTH[month-1] + (month > 2 and _is_leap(year))
-
-def _date2num(date): # compute ordinal of date.month,day,year
- return _days_before_year(date.year) + \
- _days_before_month(date.month, date.year) + \
- date.day
-
-_DI400Y = _days_before_year(400) # number of days in 400 years
-
-def _num2date(n): # return date with ordinal n
- if type(n) not in _INT_TYPES:
- raise TypeError('argument must be integer: %r' % type(n))
-
- ans = Date(1,1,1) # arguments irrelevant; just getting a Date obj
- del ans.ord, ans.month, ans.day, ans.year # un-initialize it
- ans.ord = n
-
- n400 = (n-1)//_DI400Y # # of 400-year blocks preceding
- year, n = 400 * n400, n - _DI400Y * n400
- more = n // 365
- dby = _days_before_year(more)
- if dby >= n:
- more = more - 1
- dby = dby - _days_in_year(more)
- year, n = year + more, int(n - dby)
-
- try: year = int(year) # chop to int, if it fits
- except (ValueError, OverflowError): pass
-
- month = min(n//29 + 1, 12)
- dbm = _days_before_month(month, year)
- if dbm >= n:
- month = month - 1
- dbm = dbm - _days_in_month(month, year)
-
- ans.month, ans.day, ans.year = month, n-dbm, year
- return ans
-
-def _num2day(n): # return weekday name of day with ordinal n
- return _DAY_NAMES[ int(n % 7) ]
-
-
-class Date:
- def __init__(self, month, day, year):
- if not 1 <= month <= 12:
- raise ValueError('month must be in 1..12: %r' % (month,))
- dim = _days_in_month(month, year)
- if not 1 <= day <= dim:
- raise ValueError('day must be in 1..%r: %r' % (dim, day))
- self.month, self.day, self.year = month, day, year
- self.ord = _date2num(self)
-
- # don't allow setting existing attributes
- def __setattr__(self, name, value):
- if name in self.__dict__:
- raise AttributeError('read-only attribute ' + name)
- self.__dict__[name] = value
-
- def __cmp__(self, other):
- return cmp(self.ord, other.ord)
-
- # define a hash function so dates can be used as dictionary keys
- def __hash__(self):
- return hash(self.ord)
-
- # print as, e.g., Mon 16 Aug 1993
- def __repr__(self):
- return '%.3s %2d %.3s %r' % (
- self.weekday(),
- self.day,
- _MONTH_NAMES[self.month-1],
- self.year)
-
- # Python 1.1 coerces neither int+date nor date+int
- def __add__(self, n):
- if type(n) not in _INT_TYPES:
- raise TypeError('can\'t add %r to date' % type(n))
- return _num2date(self.ord + n)
- __radd__ = __add__ # handle int+date
-
- # Python 1.1 coerces neither date-int nor date-date
- def __sub__(self, other):
- if type(other) in _INT_TYPES: # date-int
- return _num2date(self.ord - other)
- else:
- return self.ord - other.ord # date-date
-
- # complain about int-date
- def __rsub__(self, other):
- raise TypeError('Can\'t subtract date from integer')
-
- def weekday(self):
- return _num2day(self.ord)
-
-def today():
- import time
- local = time.localtime(time.time())
- return Date(local[1], local[2], local[0])
-
-class DateTestError(Exception):
- pass
-
-def test(firstyear, lastyear):
- a = Date(9,30,1913)
- b = Date(9,30,1914)
- if repr(a) != 'Tue 30 Sep 1913':
- raise DateTestError('__repr__ failure')
- if (not a < b) or a == b or a > b or b != b:
- raise DateTestError('__cmp__ failure')
- if a+365 != b or 365+a != b:
- raise DateTestError('__add__ failure')
- if b-a != 365 or b-365 != a:
- raise DateTestError('__sub__ failure')
- try:
- x = 1 - a
- raise DateTestError('int-date should have failed')
- except TypeError:
- pass
- try:
- x = a + b
- raise DateTestError('date+date should have failed')
- except TypeError:
- pass
- if a.weekday() != 'Tuesday':
- raise DateTestError('weekday() failure')
- if max(a,b) is not b or min(a,b) is not a:
- raise DateTestError('min/max failure')
- d = {a-1:b, b:a+1}
- if d[b-366] != b or d[a+(b-a)] != Date(10,1,1913):
- raise DateTestError('dictionary failure')
-
- # verify date<->number conversions for first and last days for
- # all years in firstyear .. lastyear
-
- lord = _days_before_year(firstyear)
- y = firstyear
- while y <= lastyear:
- ford = lord + 1
- lord = ford + _days_in_year(y) - 1
- fd, ld = Date(1,1,y), Date(12,31,y)
- if (fd.ord,ld.ord) != (ford,lord):
- raise DateTestError('date->num failed', y)
- fd, ld = _num2date(ford), _num2date(lord)
- if (1,1,y,12,31,y) != \
- (fd.month,fd.day,fd.year,ld.month,ld.day,ld.year):
- raise DateTestError('num->date failed', y)
- y = y + 1
-
-if __name__ == '__main__':
- test(1850, 2150)
diff --git a/Demo/classes/Dbm.py b/Demo/classes/Dbm.py
deleted file mode 100755
index f931e93e22..0000000000
--- a/Demo/classes/Dbm.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# A wrapper around the (optional) built-in class dbm, supporting keys
-# and values of almost any type instead of just string.
-# (Actually, this works only for keys and values that can be read back
-# correctly after being converted to a string.)
-
-
-class Dbm:
-
- def __init__(self, filename, mode, perm):
- import dbm.ndbm
- self.db = dbm.ndbm.open(filename, mode, perm)
-
- def __repr__(self):
- s = ''
- for key in self.keys():
- t = repr(key) + ': ' + repr(self[key])
- if s: t = ', ' + t
- s = s + t
- return '{' + s + '}'
-
- def __len__(self):
- return len(self.db)
-
- def __getitem__(self, key):
- return eval(self.db[repr(key)])
-
- def __setitem__(self, key, value):
- self.db[repr(key)] = repr(value)
-
- def __delitem__(self, key):
- del self.db[repr(key)]
-
- def keys(self):
- res = []
- for key in self.db.keys():
- res.append(eval(key))
- return res
-
- def has_key(self, key):
- return repr(key) in self.db
-
-
-def test():
- d = Dbm('@dbm', 'rw', 0o600)
- print(d)
- while 1:
- try:
- key = eval(input('key: '))
- if key in d:
- value = d[key]
- print('currently:', value)
- value = eval(input('value: '))
- if value is None:
- del d[key]
- else:
- d[key] = value
- except KeyboardInterrupt:
- print('')
- print(d)
- except EOFError:
- print('[eof]')
- break
- print(d)
-
-
-test()
diff --git a/Demo/classes/README b/Demo/classes/README
deleted file mode 100644
index e5bc2893ec..0000000000
--- a/Demo/classes/README
+++ /dev/null
@@ -1,12 +0,0 @@
-Examples of classes that implement special operators (see reference manual):
-
-Complex.py Complex numbers
-Dates.py Date manipulation package by Tim Peters
-Dbm.py Wrapper around built-in dbm, supporting arbitrary values
-Range.py Example of a generator: re-implement built-in range()
-Rev.py Yield the reverse of a sequence
-Vec.py A simple vector class
-bitvec.py A bit-vector class by Jan-Hein B\"uhrman
-
-(For straightforward examples of basic class features, such as use of
-methods and inheritance, see the library code.)
diff --git a/Demo/classes/Range.py b/Demo/classes/Range.py
deleted file mode 100755
index a0cef74208..0000000000
--- a/Demo/classes/Range.py
+++ /dev/null
@@ -1,93 +0,0 @@
-"""Example of a generator: re-implement the built-in range function
-without actually constructing the list of values.
-
-OldStyleRange is coded in the way required to work in a 'for' loop before
-iterators were introduced into the language; using __getitem__ and __len__ .
-
-"""
-def handleargs(arglist):
- """Take list of arguments and extract/create proper start, stop, and step
- values and return in a tuple"""
- try:
- if len(arglist) == 1:
- return 0, int(arglist[0]), 1
- elif len(arglist) == 2:
- return int(arglist[0]), int(arglist[1]), 1
- elif len(arglist) == 3:
- if arglist[2] == 0:
- raise ValueError("step argument must not be zero")
- return tuple(int(x) for x in arglist)
- else:
- raise TypeError("range() accepts 1-3 arguments, given", len(arglist))
- except TypeError:
- raise TypeError("range() arguments must be numbers or strings "
- "representing numbers")
-
-def genrange(*a):
- """Function to implement 'range' as a generator"""
- start, stop, step = handleargs(a)
- value = start
- while value < stop:
- yield value
- value += step
-
-class oldrange:
- """Class implementing a range object.
- To the user the instances feel like immutable sequences
- (and you can't concatenate or slice them)
-
- Done using the old way (pre-iterators; __len__ and __getitem__) to have an
- object be used by a 'for' loop.
-
- """
-
- def __init__(self, *a):
- """ Initialize start, stop, and step values along with calculating the
- nubmer of values (what __len__ will return) in the range"""
- self.start, self.stop, self.step = handleargs(a)
- self.len = max(0, (self.stop - self.start) // self.step)
-
- def __repr__(self):
- """implement repr(x) which is also used by print"""
- return 'range(%r, %r, %r)' % (self.start, self.stop, self.step)
-
- def __len__(self):
- """implement len(x)"""
- return self.len
-
- def __getitem__(self, i):
- """implement x[i]"""
- if 0 <= i <= self.len:
- return self.start + self.step * i
- else:
- raise IndexError('range[i] index out of range')
-
-
-def test():
- import time, builtins
- #Just a quick sanity check
- correct_result = builtins.range(5, 100, 3)
- oldrange_result = list(oldrange(5, 100, 3))
- genrange_result = list(genrange(5, 100, 3))
- if genrange_result != correct_result or oldrange_result != correct_result:
- raise Exception("error in implementation:\ncorrect = %s"
- "\nold-style = %s\ngenerator = %s" %
- (correct_result, oldrange_result, genrange_result))
- print("Timings for range(1000):")
- t1 = time.time()
- for i in oldrange(1000):
- pass
- t2 = time.time()
- for i in genrange(1000):
- pass
- t3 = time.time()
- for i in builtins.range(1000):
- pass
- t4 = time.time()
- print(t2-t1, 'sec (old-style class)')
- print(t3-t2, 'sec (generator)')
- print(t4-t3, 'sec (built-in)')
-
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/classes/Rev.py b/Demo/classes/Rev.py
deleted file mode 100755
index 7fd78e03ea..0000000000
--- a/Demo/classes/Rev.py
+++ /dev/null
@@ -1,95 +0,0 @@
-'''
-A class which presents the reverse of a sequence without duplicating it.
-From: "Steven D. Majewski" <sdm7g@elvis.med.virginia.edu>
-
-It works on mutable or inmutable sequences.
-
->>> chars = list(Rev('Hello World!'))
->>> print ''.join(chars)
-!dlroW olleH
-
-The .forw is so you can use anonymous sequences in __init__, and still
-keep a reference the forward sequence. )
-If you give it a non-anonymous mutable sequence, the reverse sequence
-will track the updated values. ( but not reassignment! - another
-good reason to use anonymous values in creating the sequence to avoid
-confusion. Maybe it should be change to copy input sequence to break
-the connection completely ? )
-
->>> nnn = range(3)
->>> rnn = Rev(nnn)
->>> for n in rnn: print n
-...
-2
-1
-0
->>> for n in range(4, 6): nnn.append(n) # update nnn
-...
->>> for n in rnn: print n # prints reversed updated values
-...
-5
-4
-2
-1
-0
->>> nnn = nnn[1:-1]
->>> nnn
-[1, 2, 4]
->>> for n in rnn: print n # prints reversed values of old nnn
-...
-5
-4
-2
-1
-0
-
-#
->>> WH = Rev('Hello World!')
->>> print WH.forw, WH.back
-Hello World! !dlroW olleH
->>> nnn = Rev(range(1, 10))
->>> print nnn.forw
-[1, 2, 3, 4, 5, 6, 7, 8, 9]
->>> print nnn.back
-[9, 8, 7, 6, 5, 4, 3, 2, 1]
-
->>> rrr = Rev(nnn)
->>> rrr
-<1, 2, 3, 4, 5, 6, 7, 8, 9>
-
-'''
-
-class Rev:
- def __init__(self, seq):
- self.forw = seq
- self.back = self
-
- def __len__(self):
- return len(self.forw)
-
- def __getitem__(self, j):
- return self.forw[-(j + 1)]
-
- def __repr__(self):
- seq = self.forw
- if isinstance(seq, list):
- wrap = '[]'
- sep = ', '
- elif isinstance(seq, tuple):
- wrap = '()'
- sep = ', '
- elif isinstance(seq, str):
- wrap = ''
- sep = ''
- else:
- wrap = '<>'
- sep = ', '
- outstrs = [str(item) for item in self.back]
- return wrap[:1] + sep.join(outstrs) + wrap[-1:]
-
-def _test():
- import doctest, Rev
- return doctest.testmod(Rev)
-
-if __name__ == "__main__":
- _test()
diff --git a/Demo/classes/bitvec.py b/Demo/classes/bitvec.py
deleted file mode 100755
index 62b26ccf3f..0000000000
--- a/Demo/classes/bitvec.py
+++ /dev/null
@@ -1,322 +0,0 @@
-#
-# this is a rather strict implementation of a bit vector class
-# it is accessed the same way as an array of python-ints, except
-# the value must be 0 or 1
-#
-
-import sys; rprt = sys.stderr.write #for debugging
-
-class error(Exception):
- pass
-
-
-def _check_value(value):
- if type(value) != type(0) or not 0 <= value < 2:
- raise error('bitvec() items must have int value 0 or 1')
-
-
-import math
-
-def _compute_len(param):
- mant, l = math.frexp(float(param))
- bitmask = 1 << l
- if bitmask <= param:
- raise ValueError('(param, l) = %r' % ((param, l),))
- while l:
- bitmask = bitmask >> 1
- if param & bitmask:
- break
- l = l - 1
- return l
-
-
-def _check_key(len, key):
- if type(key) != type(0):
- raise TypeError('sequence subscript not int')
- if key < 0:
- key = key + len
- if not 0 <= key < len:
- raise IndexError('list index out of range')
- return key
-
-def _check_slice(len, i, j):
- #the type is ok, Python already checked that
- i, j = max(i, 0), min(len, j)
- if i > j:
- i = j
- return i, j
-
-
-class BitVec:
-
- def __init__(self, *params):
- self._data = 0
- self._len = 0
- if not len(params):
- pass
- elif len(params) == 1:
- param, = params
- if type(param) == type([]):
- value = 0
- bit_mask = 1
- for item in param:
- # strict check
- #_check_value(item)
- if item:
- value = value | bit_mask
- bit_mask = bit_mask << 1
- self._data = value
- self._len = len(param)
- elif type(param) == type(0):
- if param < 0:
- raise error('bitvec() can\'t handle negative longs')
- self._data = param
- self._len = _compute_len(param)
- else:
- raise error('bitvec() requires array or long parameter')
- elif len(params) == 2:
- param, length = params
- if type(param) == type(0):
- if param < 0:
- raise error('can\'t handle negative longs')
- self._data = param
- if type(length) != type(0):
- raise error('bitvec()\'s 2nd parameter must be int')
- computed_length = _compute_len(param)
- if computed_length > length:
- print('warning: bitvec() value is longer than the length indicates, truncating value')
- self._data = self._data & \
- ((1 << length) - 1)
- self._len = length
- else:
- raise error('bitvec() requires array or long parameter')
- else:
- raise error('bitvec() requires 0 -- 2 parameter(s)')
-
-
- def append(self, item):
- #_check_value(item)
- #self[self._len:self._len] = [item]
- self[self._len:self._len] = \
- BitVec(int(not not item), 1)
-
-
- def count(self, value):
- #_check_value(value)
- if value:
- data = self._data
- else:
- data = (~self)._data
- count = 0
- while data:
- data, count = data >> 1, count + (data & 1 != 0)
- return count
-
-
- def index(self, value):
- #_check_value(value):
- if value:
- data = self._data
- else:
- data = (~self)._data
- index = 0
- if not data:
- raise ValueError('list.index(x): x not in list')
- while not (data & 1):
- data, index = data >> 1, index + 1
- return index
-
-
- def insert(self, index, item):
- #_check_value(item)
- #self[index:index] = [item]
- self[index:index] = BitVec(int(not not item), 1)
-
-
- def remove(self, value):
- del self[self.index(value)]
-
-
- def reverse(self):
- #ouch, this one is expensive!
- #for i in self._len>>1: self[i], self[l-i] = self[l-i], self[i]
- data, result = self._data, 0
- for i in range(self._len):
- if not data:
- result = result << (self._len - i)
- break
- result, data = (result << 1) | (data & 1), data >> 1
- self._data = result
-
-
- def sort(self):
- c = self.count(1)
- self._data = ((1 << c) - 1) << (self._len - c)
-
-
- def copy(self):
- return BitVec(self._data, self._len)
-
-
- def seq(self):
- result = []
- for i in self:
- result.append(i)
- return result
-
-
- def __repr__(self):
- ##rprt('<bitvec class instance object>.' + '__repr__()\n')
- return 'bitvec(%r, %r)' % (self._data, self._len)
-
- def __cmp__(self, other, *rest):
- #rprt('%r.__cmp__%r\n' % (self, (other,) + rest))
- if type(other) != type(self):
- other = bitvec(other, *rest)
- #expensive solution... recursive binary, with slicing
- length = self._len
- if length == 0 or other._len == 0:
- return cmp(length, other._len)
- if length != other._len:
- min_length = min(length, other._len)
- return cmp(self[:min_length], other[:min_length]) or \
- cmp(self[min_length:], other[min_length:])
- #the lengths are the same now...
- if self._data == other._data:
- return 0
- if length == 1:
- return cmp(self[0], other[0])
- else:
- length = length >> 1
- return cmp(self[:length], other[:length]) or \
- cmp(self[length:], other[length:])
-
-
- def __len__(self):
- #rprt('%r.__len__()\n' % (self,))
- return self._len
-
- def __getitem__(self, key):
- #rprt('%r.__getitem__(%r)\n' % (self, key))
- key = _check_key(self._len, key)
- return self._data & (1 << key) != 0
-
- def __setitem__(self, key, value):
- #rprt('%r.__setitem__(%r, %r)\n' % (self, key, value))
- key = _check_key(self._len, key)
- #_check_value(value)
- if value:
- self._data = self._data | (1 << key)
- else:
- self._data = self._data & ~(1 << key)
-
- def __delitem__(self, key):
- #rprt('%r.__delitem__(%r)\n' % (self, key))
- key = _check_key(self._len, key)
- #el cheapo solution...
- self._data = self[:key]._data | self[key+1:]._data >> key
- self._len = self._len - 1
-
- def __getslice__(self, i, j):
- #rprt('%r.__getslice__(%r, %r)\n' % (self, i, j))
- i, j = _check_slice(self._len, i, j)
- if i >= j:
- return BitVec(0, 0)
- if i:
- ndata = self._data >> i
- else:
- ndata = self._data
- nlength = j - i
- if j != self._len:
- #we'll have to invent faster variants here
- #e.g. mod_2exp
- ndata = ndata & ((1 << nlength) - 1)
- return BitVec(ndata, nlength)
-
- def __setslice__(self, i, j, sequence, *rest):
- #rprt('%s.__setslice__%r\n' % (self, (i, j, sequence) + rest))
- i, j = _check_slice(self._len, i, j)
- if type(sequence) != type(self):
- sequence = bitvec(sequence, *rest)
- #sequence is now of our own type
- ls_part = self[:i]
- ms_part = self[j:]
- self._data = ls_part._data | \
- ((sequence._data | \
- (ms_part._data << sequence._len)) << ls_part._len)
- self._len = self._len - j + i + sequence._len
-
- def __delslice__(self, i, j):
- #rprt('%r.__delslice__(%r, %r)\n' % (self, i, j))
- i, j = _check_slice(self._len, i, j)
- if i == 0 and j == self._len:
- self._data, self._len = 0, 0
- elif i < j:
- self._data = self[:i]._data | (self[j:]._data >> i)
- self._len = self._len - j + i
-
- def __add__(self, other):
- #rprt('%r.__add__(%r)\n' % (self, other))
- retval = self.copy()
- retval[self._len:self._len] = other
- return retval
-
- def __mul__(self, multiplier):
- #rprt('%r.__mul__(%r)\n' % (self, multiplier))
- if type(multiplier) != type(0):
- raise TypeError('sequence subscript not int')
- if multiplier <= 0:
- return BitVec(0, 0)
- elif multiplier == 1:
- return self.copy()
- #handle special cases all 0 or all 1...
- if self._data == 0:
- return BitVec(0, self._len * multiplier)
- elif (~self)._data == 0:
- return ~BitVec(0, self._len * multiplier)
- #otherwise el cheapo again...
- retval = BitVec(0, 0)
- while multiplier:
- retval, multiplier = retval + self, multiplier - 1
- return retval
-
- def __and__(self, otherseq, *rest):
- #rprt('%r.__and__%r\n' % (self, (otherseq,) + rest))
- if type(otherseq) != type(self):
- otherseq = bitvec(otherseq, *rest)
- #sequence is now of our own type
- return BitVec(self._data & otherseq._data, \
- min(self._len, otherseq._len))
-
-
- def __xor__(self, otherseq, *rest):
- #rprt('%r.__xor__%r\n' % (self, (otherseq,) + rest))
- if type(otherseq) != type(self):
- otherseq = bitvec(otherseq, *rest)
- #sequence is now of our own type
- return BitVec(self._data ^ otherseq._data, \
- max(self._len, otherseq._len))
-
-
- def __or__(self, otherseq, *rest):
- #rprt('%r.__or__%r\n' % (self, (otherseq,) + rest))
- if type(otherseq) != type(self):
- otherseq = bitvec(otherseq, *rest)
- #sequence is now of our own type
- return BitVec(self._data | otherseq._data, \
- max(self._len, otherseq._len))
-
-
- def __invert__(self):
- #rprt('%r.__invert__()\n' % (self,))
- return BitVec(~self._data & ((1 << self._len) - 1), \
- self._len)
-
- def __int__(self):
- return int(self._data)
-
- def __float__(self):
- return float(self._data)
-
-
-bitvec = BitVec
diff --git a/Demo/comparisons/README b/Demo/comparisons/README
deleted file mode 100644
index 111667c264..0000000000
--- a/Demo/comparisons/README
+++ /dev/null
@@ -1,60 +0,0 @@
-Subject: Re: What language would you use?
-From: Tom Christiansen <tchrist@mox.perl.com>
-Date: 6 Nov 1994 15:14:51 GMT
-Newsgroups: comp.lang.python,comp.lang.tcl,comp.lang.scheme,comp.lang.misc,comp.lang.perl
-Message-Id: <39irtb$3t4@csnews.cs.Colorado.EDU>
-References: <39b7ha$j9v@zeno.nscf.org> <39hhjp$lgn@csnews.cs.Colorado.EDU> <39hvsu$dus@mathserv.mps.ohio-state.edu>
-
-[...]
-If you're really into benchmarks, I'd love it if someone were to code up
-the following problems in tcl, python, and scheme (and whatever else you'd
-like). Separate versions (one optimized for speed, one for beauty :-) are
-ok. Post your code so we can time it on our own systems.
-
-0) Factorial Test (numerics and function calls)
-
- (we did this already)
-
-1) Regular Expressions Test
-
- Read a file of (extended per egrep) regular expressions (one per line),
- and apply those to all files whose names are listed on the command line.
- Basically, an 'egrep -f' simulator. Test it with 20 "vt100" patterns
- against a five /etc/termcap files. Tests using more elaborate patters
- would also be interesting. Your code should not break if given hundreds
- of regular expressions or binary files to scan.
-
-2) Sorting Test
-
- Sort an input file that consists of lines like this
-
- var1=23 other=14 ditto=23 fred=2
-
- such that each output line is sorted WRT to the number. Order
- of output lines does not change. Resolve collisions using the
- variable name. e.g.
-
- fred=2 other=14 ditto=23 var1=23
-
- Lines may be up to several kilobytes in length and contain
- zillions of variables.
-
-3) System Test
-
- Given a list of directories, report any bogus symbolic links contained
- anywhere in those subtrees. A bogus symbolic link is one that cannot
- be resolved because it points to a nonexistent or otherwise
- unresolvable file. Do *not* use an external find executable.
- Directories may be very very deep. Print a warning immediately if the
- system you're running on doesn't support symbolic links.
-
-
-I'll post perl solutions if people post the others.
-
-
---tom
---
-Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com
-
- "But Billy! A *small* allowance prepares you for a lifetime of small
- salaries and for your Social Security payments." --Family Circus
diff --git a/Demo/comparisons/patterns b/Demo/comparisons/patterns
deleted file mode 100755
index f4da846af6..0000000000
--- a/Demo/comparisons/patterns
+++ /dev/null
@@ -1,4 +0,0 @@
-^def
-^class
-^import
-^from
diff --git a/Demo/comparisons/regextest.py b/Demo/comparisons/regextest.py
deleted file mode 100755
index d2c534d5ba..0000000000
--- a/Demo/comparisons/regextest.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /usr/bin/env python
-
-# 1) Regular Expressions Test
-#
-# Read a file of (extended per egrep) regular expressions (one per line),
-# and apply those to all files whose names are listed on the command line.
-# Basically, an 'egrep -f' simulator. Test it with 20 "vt100" patterns
-# against a five /etc/termcap files. Tests using more elaborate patters
-# would also be interesting. Your code should not break if given hundreds
-# of regular expressions or binary files to scan.
-
-# This implementation:
-# - combines all patterns into a single one using ( ... | ... | ... )
-# - reads patterns from stdin, scans files given as command line arguments
-# - produces output in the format <file>:<lineno>:<line>
-# - is only about 2.5 times as slow as egrep (though I couldn't run
-# Tom's test -- this system, a vanilla SGI, only has /etc/terminfo)
-
-import string
-import sys
-import re
-
-def main():
- pats = list(map(chomp, sys.stdin.readlines()))
- bigpat = '(' + '|'.join(pats) + ')'
- prog = re.compile(bigpat)
-
- for file in sys.argv[1:]:
- try:
- fp = open(file, 'r')
- except IOError as msg:
- print("%s: %s" % (file, msg))
- continue
- lineno = 0
- while 1:
- line = fp.readline()
- if not line:
- break
- lineno = lineno + 1
- if prog.search(line):
- print("%s:%s:%s" % (file, lineno, line), end=' ')
-
-def chomp(s):
- return s.rstrip('\n')
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/comparisons/sortingtest.py b/Demo/comparisons/sortingtest.py
deleted file mode 100755
index f9ed854109..0000000000
--- a/Demo/comparisons/sortingtest.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /usr/bin/env python
-
-# 2) Sorting Test
-#
-# Sort an input file that consists of lines like this
-#
-# var1=23 other=14 ditto=23 fred=2
-#
-# such that each output line is sorted WRT to the number. Order
-# of output lines does not change. Resolve collisions using the
-# variable name. e.g.
-#
-# fred=2 other=14 ditto=23 var1=23
-#
-# Lines may be up to several kilobytes in length and contain
-# zillions of variables.
-
-# This implementation:
-# - Reads stdin, writes stdout
-# - Uses any amount of whitespace to separate fields
-# - Allows signed numbers
-# - Treats illegally formatted fields as field=0
-# - Outputs the sorted fields with exactly one space between them
-# - Handles blank input lines correctly
-
-import re
-import sys
-
-def main():
- prog = re.compile('^(.*)=([-+]?[0-9]+)')
- def makekey(item, prog=prog):
- match = prog.match(item)
- if match:
- var, num = match.groups()
- return int(num), var
- else:
- # Bad input -- pretend it's a var with value 0
- return 0, item
- for line in sys.stdin:
- items = sorted(makekey(item) for item in line.split())
- for num, var in items:
- print("%s=%s" % (var, num), end=' ')
- print()
-
-main()
diff --git a/Demo/comparisons/systemtest.py b/Demo/comparisons/systemtest.py
deleted file mode 100755
index e3d840eb12..0000000000
--- a/Demo/comparisons/systemtest.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#! /usr/bin/env python
-
-# 3) System Test
-#
-# Given a list of directories, report any bogus symbolic links contained
-# anywhere in those subtrees. A bogus symbolic link is one that cannot
-# be resolved because it points to a nonexistent or otherwise
-# unresolvable file. Do *not* use an external find executable.
-# Directories may be very very deep. Print a warning immediately if the
-# system you're running on doesn't support symbolic links.
-
-# This implementation:
-# - takes one optional argument, using the current directory as default
-# - uses chdir to increase performance
-# - sorts the names per directory
-# - prints output lines of the form "path1 -> path2" as it goes
-# - prints error messages about directories it can't list or chdir into
-
-import os
-import sys
-from stat import *
-
-def main():
- try:
- # Note: can't test for presence of lstat -- it's always there
- dummy = os.readlink
- except AttributeError:
- print("This system doesn't have symbolic links")
- sys.exit(0)
- if sys.argv[1:]:
- prefix = sys.argv[1]
- else:
- prefix = ''
- if prefix:
- os.chdir(prefix)
- if prefix[-1:] != '/': prefix = prefix + '/'
- reportboguslinks(prefix)
- else:
- reportboguslinks('')
-
-def reportboguslinks(prefix):
- try:
- names = os.listdir('.')
- except os.error as msg:
- print("%s%s: can't list: %s" % (prefix, '.', msg))
- return
- names.sort()
- for name in names:
- if name == os.curdir or name == os.pardir:
- continue
- try:
- mode = os.lstat(name)[ST_MODE]
- except os.error:
- print("%s%s: can't stat: %s" % (prefix, name, msg))
- continue
- if S_ISLNK(mode):
- try:
- os.stat(name)
- except os.error:
- print("%s%s -> %s" % \
- (prefix, name, os.readlink(name)))
- elif S_ISDIR(mode):
- try:
- os.chdir(name)
- except os.error as msg:
- print("%s%s: can't chdir: %s" % \
- (prefix, name, msg))
- continue
- try:
- reportboguslinks(prefix + name + '/')
- finally:
- os.chdir('..')
-
-main()
diff --git a/Demo/curses/README b/Demo/curses/README
deleted file mode 100644
index 2d1c4b1c2a..0000000000
--- a/Demo/curses/README
+++ /dev/null
@@ -1,25 +0,0 @@
-This is a collection of demos and tests for the curses module.
-
-ncurses demos
-=============
-
-These demos are converted from the C versions in the ncurses
-distribution, and were contributed by Thomas Gellekum <tg@FreeBSD.org>
-I didn't strive for a `pythonic' style, but bluntly copied the
-originals. I won't attempt to `beautify' the program anytime soon, but
-I wouldn't mind someone else making an effort in that direction, of
-course.
-
-ncurses.py -- currently only a panels demo
-rain.py -- raindrops keep falling on my desktop
-tclock.py -- ASCII clock, by Howard Jones
-xmas.py -- I'm dreaming of an ASCII christmas
-
-Please submit bugfixes and new contributions to the Python bug tracker.
-
-
-Other demos
-===========
-
-life.py -- Simple game of Life
-repeat.py -- Repeatedly execute a shell command (like watch(1))
diff --git a/Demo/curses/ncurses.py b/Demo/curses/ncurses.py
deleted file mode 100644
index 0bdc1a97e6..0000000000
--- a/Demo/curses/ncurses.py
+++ /dev/null
@@ -1,273 +0,0 @@
-#!/usr/bin/env python
-#
-# $Id$
-#
-# (n)curses exerciser in Python, an interactive test for the curses
-# module. Currently, only the panel demos are ported.
-
-import curses
-from curses import panel
-
-def wGetchar(win = None):
- if win is None: win = stdscr
- return win.getch()
-
-def Getchar():
- wGetchar()
-
-#
-# Panels tester
-#
-def wait_a_while():
- if nap_msec == 1:
- Getchar()
- else:
- curses.napms(nap_msec)
-
-def saywhat(text):
- stdscr.move(curses.LINES - 1, 0)
- stdscr.clrtoeol()
- stdscr.addstr(text)
-
-def mkpanel(color, rows, cols, tly, tlx):
- win = curses.newwin(rows, cols, tly, tlx)
- pan = panel.new_panel(win)
- if curses.has_colors():
- if color == curses.COLOR_BLUE:
- fg = curses.COLOR_WHITE
- else:
- fg = curses.COLOR_BLACK
- bg = color
- curses.init_pair(color, fg, bg)
- win.bkgdset(ord(' '), curses.color_pair(color))
- else:
- win.bkgdset(ord(' '), curses.A_BOLD)
-
- return pan
-
-def pflush():
- panel.update_panels()
- curses.doupdate()
-
-def fill_panel(pan):
- win = pan.window()
- num = pan.userptr()[1]
-
- win.move(1, 1)
- win.addstr("-pan%c-" % num)
- win.clrtoeol()
- win.box()
-
- maxy, maxx = win.getmaxyx()
- for y in range(2, maxy - 1):
- for x in range(1, maxx - 1):
- win.move(y, x)
- win.addch(num)
-
-def demo_panels(win):
- global stdscr, nap_msec, mod
- stdscr = win
- nap_msec = 1
- mod = ["test", "TEST", "(**)", "*()*", "<-->", "LAST"]
-
- stdscr.refresh()
-
- for y in range(0, curses.LINES - 1):
- for x in range(0, curses.COLS):
- stdscr.addstr("%d" % ((y + x) % 10))
- for y in range(0, 1):
- p1 = mkpanel(curses.COLOR_RED,
- curses.LINES // 2 - 2,
- curses.COLS // 8 + 1,
- 0,
- 0)
- p1.set_userptr("p1")
-
- p2 = mkpanel(curses.COLOR_GREEN,
- curses.LINES // 2 + 1,
- curses.COLS // 7,
- curses.LINES // 4,
- curses.COLS // 10)
- p2.set_userptr("p2")
-
- p3 = mkpanel(curses.COLOR_YELLOW,
- curses.LINES // 4,
- curses.COLS // 10,
- curses.LINES // 2,
- curses.COLS // 9)
- p3.set_userptr("p3")
-
- p4 = mkpanel(curses.COLOR_BLUE,
- curses.LINES // 2 - 2,
- curses.COLS // 8,
- curses.LINES // 2 - 2,
- curses.COLS // 3)
- p4.set_userptr("p4")
-
- p5 = mkpanel(curses.COLOR_MAGENTA,
- curses.LINES // 2 - 2,
- curses.COLS // 8,
- curses.LINES // 2,
- curses.COLS // 2 - 2)
- p5.set_userptr("p5")
-
- fill_panel(p1)
- fill_panel(p2)
- fill_panel(p3)
- fill_panel(p4)
- fill_panel(p5)
- p4.hide()
- p5.hide()
- pflush()
- saywhat("press any key to continue")
- wait_a_while()
-
- saywhat("h3 s1 s2 s4 s5;press any key to continue")
- p1.move(0, 0)
- p3.hide()
- p1.show()
- p2.show()
- p4.show()
- p5.show()
- pflush()
- wait_a_while()
-
- saywhat("s1; press any key to continue")
- p1.show()
- pflush()
- wait_a_while()
-
- saywhat("s2; press any key to continue")
- p2.show()
- pflush()
- wait_a_while()
-
- saywhat("m2; press any key to continue")
- p2.move(curses.LINES // 3 + 1, curses.COLS // 8)
- pflush()
- wait_a_while()
-
- saywhat("s3; press any key to continue")
- p3.show()
- pflush()
- wait_a_while()
-
- saywhat("m3; press any key to continue")
- p3.move(curses.LINES // 4 + 1, curses.COLS // 15)
- pflush()
- wait_a_while()
-
- saywhat("b3; press any key to continue")
- p3.bottom()
- pflush()
- wait_a_while()
-
- saywhat("s4; press any key to continue")
- p4.show()
- pflush()
- wait_a_while()
-
- saywhat("s5; press any key to continue")
- p5.show()
- pflush()
- wait_a_while()
-
- saywhat("t3; press any key to continue")
- p3.top()
- pflush()
- wait_a_while()
-
- saywhat("t1; press any key to continue")
- p1.show()
- pflush()
- wait_a_while()
-
- saywhat("t2; press any key to continue")
- p2.show()
- pflush()
- wait_a_while()
-
- saywhat("t3; press any key to continue")
- p3.show()
- pflush()
- wait_a_while()
-
- saywhat("t4; press any key to continue")
- p4.show()
- pflush()
- wait_a_while()
-
- for itmp in range(0, 6):
- w4 = p4.window()
- w5 = p5.window()
-
- saywhat("m4; press any key to continue")
- w4.move(curses.LINES // 8, 1)
- w4.addstr(mod[itmp])
- p4.move(curses.LINES // 6, itmp * curses.COLS // 8)
- w5.move(curses.LINES // 6, 1)
- w5.addstr(mod[itmp])
- pflush()
- wait_a_while()
-
- saywhat("m5; press any key to continue")
- w4.move(curses.LINES // 6, 1)
- w4.addstr(mod[itmp])
- p5.move(curses.LINES // 3 - 1, itmp * 10 + 6)
- w5.move(curses.LINES // 8, 1)
- w5.addstr(mod[itmp])
- pflush()
- wait_a_while()
-
- saywhat("m4; press any key to continue")
- p4.move(curses.LINES // 6, (itmp + 1) * curses.COLS // 8)
- pflush()
- wait_a_while()
-
- saywhat("t5; press any key to continue")
- p5.top()
- pflush()
- wait_a_while()
-
- saywhat("t2; press any key to continue")
- p2.top()
- pflush()
- wait_a_while()
-
- saywhat("t1; press any key to continue")
- p1.top()
- pflush()
- wait_a_while()
-
- saywhat("d2; press any key to continue")
- del p2
- pflush()
- wait_a_while()
-
- saywhat("h3; press any key to continue")
- p3.hide()
- pflush()
- wait_a_while()
-
- saywhat("d1; press any key to continue")
- del p1
- pflush()
- wait_a_while()
-
- saywhat("d4; press any key to continue")
- del p4
- pflush()
- wait_a_while()
-
- saywhat("d5; press any key to continue")
- del p5
- pflush()
- wait_a_while()
- if nap_msec == 1:
- break
- nap_msec = 100
-
-#
-# one fine day there'll be the menu at this place
-#
-curses.wrapper(demo_panels)
diff --git a/Demo/curses/rain.py b/Demo/curses/rain.py
deleted file mode 100644
index 9d46e6eb60..0000000000
--- a/Demo/curses/rain.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/env python
-#
-# $Id$
-#
-# somebody should probably check the randrange()s...
-
-import curses
-from random import randrange
-
-def next_j(j):
- if j == 0:
- j = 4
- else:
- j -= 1
-
- if curses.has_colors():
- z = randrange(0, 3)
- color = curses.color_pair(z)
- if z:
- color = color | curses.A_BOLD
- stdscr.attrset(color)
-
- return j
-
-def main(win):
- # we know that the first argument from curses.wrapper() is stdscr.
- # Initialize it globally for convenience.
- global stdscr
- stdscr = win
-
- if curses.has_colors():
- bg = curses.COLOR_BLACK
- curses.init_pair(1, curses.COLOR_BLUE, bg)
- curses.init_pair(2, curses.COLOR_CYAN, bg)
-
- curses.nl()
- curses.noecho()
- # XXX curs_set() always returns ERR
- # curses.curs_set(0)
- stdscr.timeout(0)
-
- c = curses.COLS - 4
- r = curses.LINES - 4
- xpos = [0] * c
- ypos = [0] * r
- for j in range(4, -1, -1):
- xpos[j] = randrange(0, c) + 2
- ypos[j] = randrange(0, r) + 2
-
- j = 0
- while True:
- x = randrange(0, c) + 2
- y = randrange(0, r) + 2
-
- stdscr.addch(y, x, ord('.'))
-
- stdscr.addch(ypos[j], xpos[j], ord('o'))
-
- j = next_j(j)
- stdscr.addch(ypos[j], xpos[j], ord('O'))
-
- j = next_j(j)
- stdscr.addch( ypos[j] - 1, xpos[j], ord('-'))
- stdscr.addstr(ypos[j], xpos[j] - 1, "|.|")
- stdscr.addch( ypos[j] + 1, xpos[j], ord('-'))
-
- j = next_j(j)
- stdscr.addch( ypos[j] - 2, xpos[j], ord('-'))
- stdscr.addstr(ypos[j] - 1, xpos[j] - 1, "/ \\")
- stdscr.addstr(ypos[j], xpos[j] - 2, "| O |")
- stdscr.addstr(ypos[j] + 1, xpos[j] - 1, "\\ /")
- stdscr.addch( ypos[j] + 2, xpos[j], ord('-'))
-
- j = next_j(j)
- stdscr.addch( ypos[j] - 2, xpos[j], ord(' '))
- stdscr.addstr(ypos[j] - 1, xpos[j] - 1, " ")
- stdscr.addstr(ypos[j], xpos[j] - 2, " ")
- stdscr.addstr(ypos[j] + 1, xpos[j] - 1, " ")
- stdscr.addch( ypos[j] + 2, xpos[j], ord(' '))
-
- xpos[j] = x
- ypos[j] = y
-
- ch = stdscr.getch()
- if ch == ord('q') or ch == ord('Q'):
- return
- elif ch == ord('s'):
- stdscr.nodelay(0)
- elif ch == ord(' '):
- stdscr.nodelay(1)
-
- curses.napms(50)
-
-curses.wrapper(main)
diff --git a/Demo/curses/repeat.py b/Demo/curses/repeat.py
deleted file mode 100755
index 93372c5d9a..0000000000
--- a/Demo/curses/repeat.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#! /usr/bin/env python
-
-"""repeat [-i SECONDS] <shell-command>
-
-This simple program repeatedly (at 1-second intervals) executes the
-shell command given on the command line and displays the output (or as
-much of it as fits on the screen). It uses curses to paint each new
-output on top of the old output, so that if nothing changes, the
-screen doesn't change. This is handy to watch for changes in e.g. a
-directory or process listing.
-
-The -i option lets you override the sleep time between executions.
-
-To end, hit Control-C.
-"""
-
-# Author: Guido van Rossum
-
-# Disclaimer: there's a Linux program named 'watch' that does the same
-# thing. Honestly, I didn't know of its existence when I wrote this!
-
-# To do: add features until it has the same functionality as watch(1);
-# then compare code size and development time.
-
-import os
-import sys
-import time
-import curses
-import getopt
-
-def main():
- interval = 1.0
- try:
- opts, args = getopt.getopt(sys.argv[1:], "hi:")
- except getopt.error as err:
- print(err, file=sys.stderr)
- sys.exit(2)
- if not args:
- print(__doc__)
- sys.exit(0)
- for opt, arg in opts:
- if opt == "-i":
- interval = float(arg)
- if opt == "-h":
- print(__doc__)
- sys.exit(0)
- cmd = " ".join(args)
- cmd_really = cmd + " 2>&1"
- p = os.popen(cmd_really, "r")
- text = p.read()
- sts = p.close()
- text = addsts(interval, cmd, text, sts)
- w = curses.initscr()
- try:
- while True:
- w.erase()
- try:
- w.addstr(text)
- except curses.error:
- pass
- w.refresh()
- time.sleep(interval)
- p = os.popen(cmd_really, "r")
- text = p.read()
- sts = p.close()
- text = addsts(interval, cmd, text, sts)
- finally:
- curses.endwin()
-
-def addsts(interval, cmd, text, sts):
- now = time.strftime("%H:%M:%S")
- text = "%s, every %g sec: %s\n%s" % (now, interval, cmd, text)
- if sts:
- msg = "Exit status: %d; signal: %d" % (sts>>8, sts&0xFF)
- if text and not text.endswith("\n"):
- msg = "\n" + msg
- text += msg
- return text
-
-main()
diff --git a/Demo/curses/tclock.py b/Demo/curses/tclock.py
deleted file mode 100644
index 8058d9a420..0000000000
--- a/Demo/curses/tclock.py
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/usr/bin/env python
-#
-# $Id$
-#
-# From tclock.c, Copyright Howard Jones <ha.jones@ic.ac.uk>, September 1994.
-
-from math import *
-import curses, time
-
-ASPECT = 2.2
-
-def sign(_x):
- if _x < 0: return -1
- return 1
-
-def A2XY(angle, radius):
- return (int(round(ASPECT * radius * sin(angle))),
- int(round(radius * cos(angle))))
-
-def plot(x, y, col):
- stdscr.addch(y, x, col)
-
-# draw a diagonal line using Bresenham's algorithm
-def dline(pair, from_x, from_y, x2, y2, ch):
- if curses.has_colors():
- stdscr.attrset(curses.color_pair(pair))
-
- dx = x2 - from_x
- dy = y2 - from_y
-
- ax = abs(dx * 2)
- ay = abs(dy * 2)
-
- sx = sign(dx)
- sy = sign(dy)
-
- x = from_x
- y = from_y
-
- if ax > ay:
- d = ay - ax // 2
-
- while True:
- plot(x, y, ch)
- if x == x2:
- return
-
- if d >= 0:
- y += sy
- d -= ax
- x += sx
- d += ay
- else:
- d = ax - ay // 2
-
- while True:
- plot(x, y, ch)
- if y == y2:
- return
-
- if d >= 0:
- x += sx
- d -= ay
- y += sy
- d += ax
-
-def main(win):
- global stdscr
- stdscr = win
-
- lastbeep = -1
- my_bg = curses.COLOR_BLACK
-
- stdscr.nodelay(1)
- stdscr.timeout(0)
-# curses.curs_set(0)
- if curses.has_colors():
- curses.init_pair(1, curses.COLOR_RED, my_bg)
- curses.init_pair(2, curses.COLOR_MAGENTA, my_bg)
- curses.init_pair(3, curses.COLOR_GREEN, my_bg)
-
- cx = (curses.COLS - 1) // 2
- cy = curses.LINES // 2
- ch = min( cy-1, int(cx // ASPECT) - 1)
- mradius = (3 * ch) // 4
- hradius = ch // 2
- sradius = 5 * ch // 6
-
- for i in range(0, 12):
- sangle = (i + 1) * 2.0 * pi / 12.0
- sdx, sdy = A2XY(sangle, sradius)
-
- stdscr.addstr(cy - sdy, cx + sdx, "%d" % (i + 1))
-
- stdscr.addstr(0, 0,
- "ASCII Clock by Howard Jones <ha.jones@ic.ac.uk>, 1994")
-
- sradius = max(sradius-4, 8)
-
- while True:
- curses.napms(1000)
-
- tim = time.time()
- t = time.localtime(tim)
-
- hours = t[3] + t[4] / 60.0
- if hours > 12.0:
- hours -= 12.0
-
- mangle = t[4] * 2 * pi / 60.0
- mdx, mdy = A2XY(mangle, mradius)
-
- hangle = hours * 2 * pi / 12.0
- hdx, hdy = A2XY(hangle, hradius)
-
- sangle = t[5] * 2 * pi / 60.0
- sdx, sdy = A2XY(sangle, sradius)
-
- dline(3, cx, cy, cx + mdx, cy - mdy, ord('#'))
-
- stdscr.attrset(curses.A_REVERSE)
- dline(2, cx, cy, cx + hdx, cy - hdy, ord('.'))
- stdscr.attroff(curses.A_REVERSE)
-
- if curses.has_colors():
- stdscr.attrset(curses.color_pair(1))
-
- plot(cx + sdx, cy - sdy, ord('O'))
-
- if curses.has_colors():
- stdscr.attrset(curses.color_pair(0))
-
- stdscr.addstr(curses.LINES - 2, 0, time.ctime(tim))
- stdscr.refresh()
- if (t[5] % 5) == 0 and t[5] != lastbeep:
- lastbeep = t[5]
- curses.beep()
-
- ch = stdscr.getch()
- if ch == ord('q'):
- return 0
-
- plot(cx + sdx, cy - sdy, ord(' '))
- dline(0, cx, cy, cx + hdx, cy - hdy, ord(' '))
- dline(0, cx, cy, cx + mdx, cy - mdy, ord(' '))
-
-curses.wrapper(main)
diff --git a/Demo/curses/xmas.py b/Demo/curses/xmas.py
deleted file mode 100644
index 349b3a8bda..0000000000
--- a/Demo/curses/xmas.py
+++ /dev/null
@@ -1,906 +0,0 @@
-# asciixmas
-# December 1989 Larry Bartz Indianapolis, IN
-#
-# $Id$
-#
-# I'm dreaming of an ascii character-based monochrome Christmas,
-# Just like the ones I used to know!
-# Via a full duplex communications channel,
-# At 9600 bits per second,
-# Even though it's kinda slow.
-#
-# I'm dreaming of an ascii character-based monochrome Christmas,
-# With ev'ry C program I write!
-# May your screen be merry and bright!
-# And may all your Christmases be amber or green,
-# (for reduced eyestrain and improved visibility)!
-#
-#
-# Notes on the Python version:
-# I used a couple of `try...except curses.error' to get around some functions
-# returning ERR. The errors come from using wrapping functions to fill
-# windows to the last character cell. The C version doesn't have this problem,
-# it simply ignores any return values.
-#
-
-import curses
-import sys
-
-FROMWHO = "Thomas Gellekum <tg@FreeBSD.org>"
-
-def set_color(win, color):
- if curses.has_colors():
- n = color + 1
- curses.init_pair(n, color, my_bg)
- win.attroff(curses.A_COLOR)
- win.attron(curses.color_pair(n))
-
-def unset_color(win):
- if curses.has_colors():
- win.attrset(curses.color_pair(0))
-
-def look_out(msecs):
- curses.napms(msecs)
- if stdscr.getch() != -1:
- curses.beep()
- sys.exit(0)
-
-def boxit():
- for y in range(0, 20):
- stdscr.addch(y, 7, ord('|'))
-
- for x in range(8, 80):
- stdscr.addch(19, x, ord('_'))
-
- for x in range(0, 80):
- stdscr.addch(22, x, ord('_'))
-
- return
-
-def seas():
- stdscr.addch(4, 1, ord('S'))
- stdscr.addch(6, 1, ord('E'))
- stdscr.addch(8, 1, ord('A'))
- stdscr.addch(10, 1, ord('S'))
- stdscr.addch(12, 1, ord('O'))
- stdscr.addch(14, 1, ord('N'))
- stdscr.addch(16, 1, ord("'"))
- stdscr.addch(18, 1, ord('S'))
-
- return
-
-def greet():
- stdscr.addch(3, 5, ord('G'))
- stdscr.addch(5, 5, ord('R'))
- stdscr.addch(7, 5, ord('E'))
- stdscr.addch(9, 5, ord('E'))
- stdscr.addch(11, 5, ord('T'))
- stdscr.addch(13, 5, ord('I'))
- stdscr.addch(15, 5, ord('N'))
- stdscr.addch(17, 5, ord('G'))
- stdscr.addch(19, 5, ord('S'))
-
- return
-
-def fromwho():
- stdscr.addstr(21, 13, FROMWHO)
- return
-
-def tree():
- set_color(treescrn, curses.COLOR_GREEN)
- treescrn.addch(1, 11, ord('/'))
- treescrn.addch(2, 11, ord('/'))
- treescrn.addch(3, 10, ord('/'))
- treescrn.addch(4, 9, ord('/'))
- treescrn.addch(5, 9, ord('/'))
- treescrn.addch(6, 8, ord('/'))
- treescrn.addch(7, 7, ord('/'))
- treescrn.addch(8, 6, ord('/'))
- treescrn.addch(9, 6, ord('/'))
- treescrn.addch(10, 5, ord('/'))
- treescrn.addch(11, 3, ord('/'))
- treescrn.addch(12, 2, ord('/'))
-
- treescrn.addch(1, 13, ord('\\'))
- treescrn.addch(2, 13, ord('\\'))
- treescrn.addch(3, 14, ord('\\'))
- treescrn.addch(4, 15, ord('\\'))
- treescrn.addch(5, 15, ord('\\'))
- treescrn.addch(6, 16, ord('\\'))
- treescrn.addch(7, 17, ord('\\'))
- treescrn.addch(8, 18, ord('\\'))
- treescrn.addch(9, 18, ord('\\'))
- treescrn.addch(10, 19, ord('\\'))
- treescrn.addch(11, 21, ord('\\'))
- treescrn.addch(12, 22, ord('\\'))
-
- treescrn.addch(4, 10, ord('_'))
- treescrn.addch(4, 14, ord('_'))
- treescrn.addch(8, 7, ord('_'))
- treescrn.addch(8, 17, ord('_'))
-
- treescrn.addstr(13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\")
-
- treescrn.addstr(14, 11, "| |")
- treescrn.addstr(15, 11, "|_|")
-
- unset_color(treescrn)
- treescrn.refresh()
- w_del_msg.refresh()
-
- return
-
-def balls():
- treescrn.overlay(treescrn2)
-
- set_color(treescrn2, curses.COLOR_BLUE)
- treescrn2.addch(3, 9, ord('@'))
- treescrn2.addch(3, 15, ord('@'))
- treescrn2.addch(4, 8, ord('@'))
- treescrn2.addch(4, 16, ord('@'))
- treescrn2.addch(5, 7, ord('@'))
- treescrn2.addch(5, 17, ord('@'))
- treescrn2.addch(7, 6, ord('@'))
- treescrn2.addch(7, 18, ord('@'))
- treescrn2.addch(8, 5, ord('@'))
- treescrn2.addch(8, 19, ord('@'))
- treescrn2.addch(10, 4, ord('@'))
- treescrn2.addch(10, 20, ord('@'))
- treescrn2.addch(11, 2, ord('@'))
- treescrn2.addch(11, 22, ord('@'))
- treescrn2.addch(12, 1, ord('@'))
- treescrn2.addch(12, 23, ord('@'))
-
- unset_color(treescrn2)
- treescrn2.refresh()
- w_del_msg.refresh()
- return
-
-def star():
- treescrn2.attrset(curses.A_BOLD | curses.A_BLINK)
- set_color(treescrn2, curses.COLOR_YELLOW)
-
- treescrn2.addch(0, 12, ord('*'))
- treescrn2.standend()
-
- unset_color(treescrn2)
- treescrn2.refresh()
- w_del_msg.refresh()
- return
-
-def strng1():
- treescrn2.attrset(curses.A_BOLD | curses.A_BLINK)
- set_color(treescrn2, curses.COLOR_WHITE)
-
- treescrn2.addch(3, 13, ord('\''))
- treescrn2.addch(3, 12, ord(':'))
- treescrn2.addch(3, 11, ord('.'))
-
- treescrn2.attroff(curses.A_BOLD | curses.A_BLINK)
- unset_color(treescrn2)
-
- treescrn2.refresh()
- w_del_msg.refresh()
- return
-
-def strng2():
- treescrn2.attrset(curses.A_BOLD | curses.A_BLINK)
- set_color(treescrn2, curses.COLOR_WHITE)
-
- treescrn2.addch(5, 14, ord('\''))
- treescrn2.addch(5, 13, ord(':'))
- treescrn2.addch(5, 12, ord('.'))
- treescrn2.addch(5, 11, ord(','))
- treescrn2.addch(6, 10, ord('\''))
- treescrn2.addch(6, 9, ord(':'))
-
- treescrn2.attroff(curses.A_BOLD | curses.A_BLINK)
- unset_color(treescrn2)
-
- treescrn2.refresh()
- w_del_msg.refresh()
- return
-
-def strng3():
- treescrn2.attrset(curses.A_BOLD | curses.A_BLINK)
- set_color(treescrn2, curses.COLOR_WHITE)
-
- treescrn2.addch(7, 16, ord('\''))
- treescrn2.addch(7, 15, ord(':'))
- treescrn2.addch(7, 14, ord('.'))
- treescrn2.addch(7, 13, ord(','))
- treescrn2.addch(8, 12, ord('\''))
- treescrn2.addch(8, 11, ord(':'))
- treescrn2.addch(8, 10, ord('.'))
- treescrn2.addch(8, 9, ord(','))
-
- treescrn2.attroff(curses.A_BOLD | curses.A_BLINK)
- unset_color(treescrn2)
-
- treescrn2.refresh()
- w_del_msg.refresh()
- return
-
-def strng4():
- treescrn2.attrset(curses.A_BOLD | curses.A_BLINK)
- set_color(treescrn2, curses.COLOR_WHITE)
-
- treescrn2.addch(9, 17, ord('\''))
- treescrn2.addch(9, 16, ord(':'))
- treescrn2.addch(9, 15, ord('.'))
- treescrn2.addch(9, 14, ord(','))
- treescrn2.addch(10, 13, ord('\''))
- treescrn2.addch(10, 12, ord(':'))
- treescrn2.addch(10, 11, ord('.'))
- treescrn2.addch(10, 10, ord(','))
- treescrn2.addch(11, 9, ord('\''))
- treescrn2.addch(11, 8, ord(':'))
- treescrn2.addch(11, 7, ord('.'))
- treescrn2.addch(11, 6, ord(','))
- treescrn2.addch(12, 5, ord('\''))
-
- treescrn2.attroff(curses.A_BOLD | curses.A_BLINK)
- unset_color(treescrn2)
-
- treescrn2.refresh()
- w_del_msg.refresh()
- return
-
-def strng5():
- treescrn2.attrset(curses.A_BOLD | curses.A_BLINK)
- set_color(treescrn2, curses.COLOR_WHITE)
-
- treescrn2.addch(11, 19, ord('\''))
- treescrn2.addch(11, 18, ord(':'))
- treescrn2.addch(11, 17, ord('.'))
- treescrn2.addch(11, 16, ord(','))
- treescrn2.addch(12, 15, ord('\''))
- treescrn2.addch(12, 14, ord(':'))
- treescrn2.addch(12, 13, ord('.'))
- treescrn2.addch(12, 12, ord(','))
-
- treescrn2.attroff(curses.A_BOLD | curses.A_BLINK)
- unset_color(treescrn2)
-
- # save a fully lit tree
- treescrn2.overlay(treescrn)
-
- treescrn2.refresh()
- w_del_msg.refresh()
- return
-
-def blinkit():
- treescrn8.touchwin()
-
- for cycle in range(5):
- if cycle == 0:
- treescrn3.overlay(treescrn8)
- treescrn8.refresh()
- w_del_msg.refresh()
- break
- elif cycle == 1:
- treescrn4.overlay(treescrn8)
- treescrn8.refresh()
- w_del_msg.refresh()
- break
- elif cycle == 2:
- treescrn5.overlay(treescrn8)
- treescrn8.refresh()
- w_del_msg.refresh()
- break
- elif cycle == 3:
- treescrn6.overlay(treescrn8)
- treescrn8.refresh()
- w_del_msg.refresh()
- break
- elif cycle == 4:
- treescrn7.overlay(treescrn8)
- treescrn8.refresh()
- w_del_msg.refresh()
- break
-
- treescrn8.touchwin()
-
- # ALL ON
- treescrn.overlay(treescrn8)
- treescrn8.refresh()
- w_del_msg.refresh()
-
- return
-
-def deer_step(win, y, x):
- win.mvwin(y, x)
- win.refresh()
- w_del_msg.refresh()
- look_out(5)
-
-def reindeer():
- y_pos = 0
-
- for x_pos in range(70, 62, -1):
- if x_pos < 66: y_pos = 1
- for looper in range(0, 4):
- dotdeer0.addch(y_pos, x_pos, ord('.'))
- dotdeer0.refresh()
- w_del_msg.refresh()
- dotdeer0.erase()
- dotdeer0.refresh()
- w_del_msg.refresh()
- look_out(50)
-
- y_pos = 2
-
- for x_pos in range(x_pos - 1, 50, -1):
- for looper in range(0, 4):
- if x_pos < 56:
- y_pos = 3
-
- try:
- stardeer0.addch(y_pos, x_pos, ord('*'))
- except curses.error:
- pass
- stardeer0.refresh()
- w_del_msg.refresh()
- stardeer0.erase()
- stardeer0.refresh()
- w_del_msg.refresh()
- else:
- dotdeer0.addch(y_pos, x_pos, ord('*'))
- dotdeer0.refresh()
- w_del_msg.refresh()
- dotdeer0.erase()
- dotdeer0.refresh()
- w_del_msg.refresh()
-
- x_pos = 58
-
- for y_pos in range(2, 5):
- lildeer0.touchwin()
- lildeer0.refresh()
- w_del_msg.refresh()
-
- for looper in range(0, 4):
- deer_step(lildeer3, y_pos, x_pos)
- deer_step(lildeer2, y_pos, x_pos)
- deer_step(lildeer1, y_pos, x_pos)
- deer_step(lildeer2, y_pos, x_pos)
- deer_step(lildeer3, y_pos, x_pos)
-
- lildeer0.touchwin()
- lildeer0.refresh()
- w_del_msg.refresh()
-
- x_pos -= 2
-
- x_pos = 35
-
- for y_pos in range(5, 10):
-
- middeer0.touchwin()
- middeer0.refresh()
- w_del_msg.refresh()
-
- for looper in range(2):
- deer_step(middeer3, y_pos, x_pos)
- deer_step(middeer2, y_pos, x_pos)
- deer_step(middeer1, y_pos, x_pos)
- deer_step(middeer2, y_pos, x_pos)
- deer_step(middeer3, y_pos, x_pos)
-
- middeer0.touchwin()
- middeer0.refresh()
- w_del_msg.refresh()
-
- x_pos -= 3
-
- look_out(300)
-
- y_pos = 1
-
- for x_pos in range(8, 16):
- deer_step(bigdeer4, y_pos, x_pos)
- deer_step(bigdeer3, y_pos, x_pos)
- deer_step(bigdeer2, y_pos, x_pos)
- deer_step(bigdeer1, y_pos, x_pos)
- deer_step(bigdeer2, y_pos, x_pos)
- deer_step(bigdeer3, y_pos, x_pos)
- deer_step(bigdeer4, y_pos, x_pos)
- deer_step(bigdeer0, y_pos, x_pos)
-
- x_pos -= 1
-
- for looper in range(0, 6):
- deer_step(lookdeer4, y_pos, x_pos)
- deer_step(lookdeer3, y_pos, x_pos)
- deer_step(lookdeer2, y_pos, x_pos)
- deer_step(lookdeer1, y_pos, x_pos)
- deer_step(lookdeer2, y_pos, x_pos)
- deer_step(lookdeer3, y_pos, x_pos)
- deer_step(lookdeer4, y_pos, x_pos)
-
- deer_step(lookdeer0, y_pos, x_pos)
-
- for y_pos in range(y_pos, 10):
- for looper in range(0, 2):
- deer_step(bigdeer4, y_pos, x_pos)
- deer_step(bigdeer3, y_pos, x_pos)
- deer_step(bigdeer2, y_pos, x_pos)
- deer_step(bigdeer1, y_pos, x_pos)
- deer_step(bigdeer2, y_pos, x_pos)
- deer_step(bigdeer3, y_pos, x_pos)
- deer_step(bigdeer4, y_pos, x_pos)
- deer_step(bigdeer0, y_pos, x_pos)
-
- y_pos -= 1
-
- deer_step(lookdeer3, y_pos, x_pos)
- return
-
-def main(win):
- global stdscr
- stdscr = win
-
- global my_bg, y_pos, x_pos
- global treescrn, treescrn2, treescrn3, treescrn4
- global treescrn5, treescrn6, treescrn7, treescrn8
- global dotdeer0, stardeer0
- global lildeer0, lildeer1, lildeer2, lildeer3
- global middeer0, middeer1, middeer2, middeer3
- global bigdeer0, bigdeer1, bigdeer2, bigdeer3, bigdeer4
- global lookdeer0, lookdeer1, lookdeer2, lookdeer3, lookdeer4
- global w_holiday, w_del_msg
-
- my_bg = curses.COLOR_BLACK
- # curses.curs_set(0)
-
- treescrn = curses.newwin(16, 27, 3, 53)
- treescrn2 = curses.newwin(16, 27, 3, 53)
- treescrn3 = curses.newwin(16, 27, 3, 53)
- treescrn4 = curses.newwin(16, 27, 3, 53)
- treescrn5 = curses.newwin(16, 27, 3, 53)
- treescrn6 = curses.newwin(16, 27, 3, 53)
- treescrn7 = curses.newwin(16, 27, 3, 53)
- treescrn8 = curses.newwin(16, 27, 3, 53)
-
- dotdeer0 = curses.newwin(3, 71, 0, 8)
-
- stardeer0 = curses.newwin(4, 56, 0, 8)
-
- lildeer0 = curses.newwin(7, 53, 0, 8)
- lildeer1 = curses.newwin(2, 4, 0, 0)
- lildeer2 = curses.newwin(2, 4, 0, 0)
- lildeer3 = curses.newwin(2, 4, 0, 0)
-
- middeer0 = curses.newwin(15, 42, 0, 8)
- middeer1 = curses.newwin(3, 7, 0, 0)
- middeer2 = curses.newwin(3, 7, 0, 0)
- middeer3 = curses.newwin(3, 7, 0, 0)
-
- bigdeer0 = curses.newwin(10, 23, 0, 0)
- bigdeer1 = curses.newwin(10, 23, 0, 0)
- bigdeer2 = curses.newwin(10, 23, 0, 0)
- bigdeer3 = curses.newwin(10, 23, 0, 0)
- bigdeer4 = curses.newwin(10, 23, 0, 0)
-
- lookdeer0 = curses.newwin(10, 25, 0, 0)
- lookdeer1 = curses.newwin(10, 25, 0, 0)
- lookdeer2 = curses.newwin(10, 25, 0, 0)
- lookdeer3 = curses.newwin(10, 25, 0, 0)
- lookdeer4 = curses.newwin(10, 25, 0, 0)
-
- w_holiday = curses.newwin(1, 27, 3, 27)
-
- w_del_msg = curses.newwin(1, 20, 23, 60)
-
- try:
- w_del_msg.addstr(0, 0, "Hit any key to quit")
- except curses.error:
- pass
-
- try:
- w_holiday.addstr(0, 0, "H A P P Y H O L I D A Y S")
- except curses.error:
- pass
-
- # set up the windows for our various reindeer
- lildeer1.addch(0, 0, ord('V'))
- lildeer1.addch(1, 0, ord('@'))
- lildeer1.addch(1, 1, ord('<'))
- lildeer1.addch(1, 2, ord('>'))
- try:
- lildeer1.addch(1, 3, ord('~'))
- except curses.error:
- pass
-
- lildeer2.addch(0, 0, ord('V'))
- lildeer2.addch(1, 0, ord('@'))
- lildeer2.addch(1, 1, ord('|'))
- lildeer2.addch(1, 2, ord('|'))
- try:
- lildeer2.addch(1, 3, ord('~'))
- except curses.error:
- pass
-
- lildeer3.addch(0, 0, ord('V'))
- lildeer3.addch(1, 0, ord('@'))
- lildeer3.addch(1, 1, ord('>'))
- lildeer3.addch(1, 2, ord('<'))
- try:
- lildeer2.addch(1, 3, ord('~')) # XXX
- except curses.error:
- pass
-
- middeer1.addch(0, 2, ord('y'))
- middeer1.addch(0, 3, ord('y'))
- middeer1.addch(1, 2, ord('0'))
- middeer1.addch(1, 3, ord('('))
- middeer1.addch(1, 4, ord('='))
- middeer1.addch(1, 5, ord(')'))
- middeer1.addch(1, 6, ord('~'))
- middeer1.addch(2, 3, ord('\\'))
- middeer1.addch(2, 5, ord('/'))
-
- middeer2.addch(0, 2, ord('y'))
- middeer2.addch(0, 3, ord('y'))
- middeer2.addch(1, 2, ord('0'))
- middeer2.addch(1, 3, ord('('))
- middeer2.addch(1, 4, ord('='))
- middeer2.addch(1, 5, ord(')'))
- middeer2.addch(1, 6, ord('~'))
- middeer2.addch(2, 3, ord('|'))
- middeer2.addch(2, 5, ord('|'))
-
- middeer3.addch(0, 2, ord('y'))
- middeer3.addch(0, 3, ord('y'))
- middeer3.addch(1, 2, ord('0'))
- middeer3.addch(1, 3, ord('('))
- middeer3.addch(1, 4, ord('='))
- middeer3.addch(1, 5, ord(')'))
- middeer3.addch(1, 6, ord('~'))
- middeer3.addch(2, 3, ord('/'))
- middeer3.addch(2, 5, ord('\\'))
-
- bigdeer1.addch(0, 17, ord('\\'))
- bigdeer1.addch(0, 18, ord('/'))
- bigdeer1.addch(0, 19, ord('\\'))
- bigdeer1.addch(0, 20, ord('/'))
- bigdeer1.addch(1, 18, ord('\\'))
- bigdeer1.addch(1, 20, ord('/'))
- bigdeer1.addch(2, 19, ord('|'))
- bigdeer1.addch(2, 20, ord('_'))
- bigdeer1.addch(3, 18, ord('/'))
- bigdeer1.addch(3, 19, ord('^'))
- bigdeer1.addch(3, 20, ord('0'))
- bigdeer1.addch(3, 21, ord('\\'))
- bigdeer1.addch(4, 17, ord('/'))
- bigdeer1.addch(4, 18, ord('/'))
- bigdeer1.addch(4, 19, ord('\\'))
- bigdeer1.addch(4, 22, ord('\\'))
- bigdeer1.addstr(5, 7, "^~~~~~~~~// ~~U")
- bigdeer1.addstr(6, 7, "( \\_____( /") # ))
- bigdeer1.addstr(7, 8, "( ) /")
- bigdeer1.addstr(8, 9, "\\\\ /")
- bigdeer1.addstr(9, 11, "\\>/>")
-
- bigdeer2.addch(0, 17, ord('\\'))
- bigdeer2.addch(0, 18, ord('/'))
- bigdeer2.addch(0, 19, ord('\\'))
- bigdeer2.addch(0, 20, ord('/'))
- bigdeer2.addch(1, 18, ord('\\'))
- bigdeer2.addch(1, 20, ord('/'))
- bigdeer2.addch(2, 19, ord('|'))
- bigdeer2.addch(2, 20, ord('_'))
- bigdeer2.addch(3, 18, ord('/'))
- bigdeer2.addch(3, 19, ord('^'))
- bigdeer2.addch(3, 20, ord('0'))
- bigdeer2.addch(3, 21, ord('\\'))
- bigdeer2.addch(4, 17, ord('/'))
- bigdeer2.addch(4, 18, ord('/'))
- bigdeer2.addch(4, 19, ord('\\'))
- bigdeer2.addch(4, 22, ord('\\'))
- bigdeer2.addstr(5, 7, "^~~~~~~~~// ~~U")
- bigdeer2.addstr(6, 7, "(( )____( /") # ))
- bigdeer2.addstr(7, 7, "( / |")
- bigdeer2.addstr(8, 8, "\\/ |")
- bigdeer2.addstr(9, 9, "|> |>")
-
- bigdeer3.addch(0, 17, ord('\\'))
- bigdeer3.addch(0, 18, ord('/'))
- bigdeer3.addch(0, 19, ord('\\'))
- bigdeer3.addch(0, 20, ord('/'))
- bigdeer3.addch(1, 18, ord('\\'))
- bigdeer3.addch(1, 20, ord('/'))
- bigdeer3.addch(2, 19, ord('|'))
- bigdeer3.addch(2, 20, ord('_'))
- bigdeer3.addch(3, 18, ord('/'))
- bigdeer3.addch(3, 19, ord('^'))
- bigdeer3.addch(3, 20, ord('0'))
- bigdeer3.addch(3, 21, ord('\\'))
- bigdeer3.addch(4, 17, ord('/'))
- bigdeer3.addch(4, 18, ord('/'))
- bigdeer3.addch(4, 19, ord('\\'))
- bigdeer3.addch(4, 22, ord('\\'))
- bigdeer3.addstr(5, 7, "^~~~~~~~~// ~~U")
- bigdeer3.addstr(6, 6, "( ()_____( /") # ))
- bigdeer3.addstr(7, 6, "/ / /")
- bigdeer3.addstr(8, 5, "|/ \\")
- bigdeer3.addstr(9, 5, "/> \\>")
-
- bigdeer4.addch(0, 17, ord('\\'))
- bigdeer4.addch(0, 18, ord('/'))
- bigdeer4.addch(0, 19, ord('\\'))
- bigdeer4.addch(0, 20, ord('/'))
- bigdeer4.addch(1, 18, ord('\\'))
- bigdeer4.addch(1, 20, ord('/'))
- bigdeer4.addch(2, 19, ord('|'))
- bigdeer4.addch(2, 20, ord('_'))
- bigdeer4.addch(3, 18, ord('/'))
- bigdeer4.addch(3, 19, ord('^'))
- bigdeer4.addch(3, 20, ord('0'))
- bigdeer4.addch(3, 21, ord('\\'))
- bigdeer4.addch(4, 17, ord('/'))
- bigdeer4.addch(4, 18, ord('/'))
- bigdeer4.addch(4, 19, ord('\\'))
- bigdeer4.addch(4, 22, ord('\\'))
- bigdeer4.addstr(5, 7, "^~~~~~~~~// ~~U")
- bigdeer4.addstr(6, 6, "( )______( /") # )
- bigdeer4.addstr(7, 5, "(/ \\") # )
- bigdeer4.addstr(8, 0, "v___= ----^")
-
- lookdeer1.addstr(0, 16, "\\/ \\/")
- lookdeer1.addstr(1, 17, "\\Y/ \\Y/")
- lookdeer1.addstr(2, 19, "\\=/")
- lookdeer1.addstr(3, 17, "^\\o o/^")
- lookdeer1.addstr(4, 17, "//( )")
- lookdeer1.addstr(5, 7, "^~~~~~~~~// \\O/")
- lookdeer1.addstr(6, 7, "( \\_____( /") # ))
- lookdeer1.addstr(7, 8, "( ) /")
- lookdeer1.addstr(8, 9, "\\\\ /")
- lookdeer1.addstr(9, 11, "\\>/>")
-
- lookdeer2.addstr(0, 16, "\\/ \\/")
- lookdeer2.addstr(1, 17, "\\Y/ \\Y/")
- lookdeer2.addstr(2, 19, "\\=/")
- lookdeer2.addstr(3, 17, "^\\o o/^")
- lookdeer2.addstr(4, 17, "//( )")
- lookdeer2.addstr(5, 7, "^~~~~~~~~// \\O/")
- lookdeer2.addstr(6, 7, "(( )____( /") # ))
- lookdeer2.addstr(7, 7, "( / |")
- lookdeer2.addstr(8, 8, "\\/ |")
- lookdeer2.addstr(9, 9, "|> |>")
-
- lookdeer3.addstr(0, 16, "\\/ \\/")
- lookdeer3.addstr(1, 17, "\\Y/ \\Y/")
- lookdeer3.addstr(2, 19, "\\=/")
- lookdeer3.addstr(3, 17, "^\\o o/^")
- lookdeer3.addstr(4, 17, "//( )")
- lookdeer3.addstr(5, 7, "^~~~~~~~~// \\O/")
- lookdeer3.addstr(6, 6, "( ()_____( /") # ))
- lookdeer3.addstr(7, 6, "/ / /")
- lookdeer3.addstr(8, 5, "|/ \\")
- lookdeer3.addstr(9, 5, "/> \\>")
-
- lookdeer4.addstr(0, 16, "\\/ \\/")
- lookdeer4.addstr(1, 17, "\\Y/ \\Y/")
- lookdeer4.addstr(2, 19, "\\=/")
- lookdeer4.addstr(3, 17, "^\\o o/^")
- lookdeer4.addstr(4, 17, "//( )")
- lookdeer4.addstr(5, 7, "^~~~~~~~~// \\O/")
- lookdeer4.addstr(6, 6, "( )______( /") # )
- lookdeer4.addstr(7, 5, "(/ \\") # )
- lookdeer4.addstr(8, 0, "v___= ----^")
-
- ###############################################
- curses.cbreak()
- stdscr.nodelay(1)
-
- while 1:
- stdscr.clear()
- treescrn.erase()
- w_del_msg.touchwin()
- treescrn.touchwin()
- treescrn2.erase()
- treescrn2.touchwin()
- treescrn8.erase()
- treescrn8.touchwin()
- stdscr.refresh()
- look_out(150)
- boxit()
- stdscr.refresh()
- look_out(150)
- seas()
- stdscr.refresh()
- greet()
- stdscr.refresh()
- look_out(150)
- fromwho()
- stdscr.refresh()
- look_out(150)
- tree()
- look_out(150)
- balls()
- look_out(150)
- star()
- look_out(150)
- strng1()
- strng2()
- strng3()
- strng4()
- strng5()
-
- # set up the windows for our blinking trees
- #
- # treescrn3
- treescrn.overlay(treescrn3)
-
- # balls
- treescrn3.addch(4, 18, ord(' '))
- treescrn3.addch(7, 6, ord(' '))
- treescrn3.addch(8, 19, ord(' '))
- treescrn3.addch(11, 22, ord(' '))
-
- # star
- treescrn3.addch(0, 12, ord('*'))
-
- # strng1
- treescrn3.addch(3, 11, ord(' '))
-
- # strng2
- treescrn3.addch(5, 13, ord(' '))
- treescrn3.addch(6, 10, ord(' '))
-
- # strng3
- treescrn3.addch(7, 16, ord(' '))
- treescrn3.addch(7, 14, ord(' '))
-
- # strng4
- treescrn3.addch(10, 13, ord(' '))
- treescrn3.addch(10, 10, ord(' '))
- treescrn3.addch(11, 8, ord(' '))
-
- # strng5
- treescrn3.addch(11, 18, ord(' '))
- treescrn3.addch(12, 13, ord(' '))
-
- # treescrn4
- treescrn.overlay(treescrn4)
-
- # balls
- treescrn4.addch(3, 9, ord(' '))
- treescrn4.addch(4, 16, ord(' '))
- treescrn4.addch(7, 6, ord(' '))
- treescrn4.addch(8, 19, ord(' '))
- treescrn4.addch(11, 2, ord(' '))
- treescrn4.addch(12, 23, ord(' '))
-
- # star
- treescrn4.standout()
- treescrn4.addch(0, 12, ord('*'))
- treescrn4.standend()
-
- # strng1
- treescrn4.addch(3, 13, ord(' '))
-
- # strng2
-
- # strng3
- treescrn4.addch(7, 15, ord(' '))
- treescrn4.addch(8, 11, ord(' '))
-
- # strng4
- treescrn4.addch(9, 16, ord(' '))
- treescrn4.addch(10, 12, ord(' '))
- treescrn4.addch(11, 8, ord(' '))
-
- # strng5
- treescrn4.addch(11, 18, ord(' '))
- treescrn4.addch(12, 14, ord(' '))
-
- # treescrn5
- treescrn.overlay(treescrn5)
-
- # balls
- treescrn5.addch(3, 15, ord(' '))
- treescrn5.addch(10, 20, ord(' '))
- treescrn5.addch(12, 1, ord(' '))
-
- # star
- treescrn5.addch(0, 12, ord(' '))
-
- # strng1
- treescrn5.addch(3, 11, ord(' '))
-
- # strng2
- treescrn5.addch(5, 12, ord(' '))
-
- # strng3
- treescrn5.addch(7, 14, ord(' '))
- treescrn5.addch(8, 10, ord(' '))
-
- # strng4
- treescrn5.addch(9, 15, ord(' '))
- treescrn5.addch(10, 11, ord(' '))
- treescrn5.addch(11, 7, ord(' '))
-
- # strng5
- treescrn5.addch(11, 17, ord(' '))
- treescrn5.addch(12, 13, ord(' '))
-
- # treescrn6
- treescrn.overlay(treescrn6)
-
- # balls
- treescrn6.addch(6, 7, ord(' '))
- treescrn6.addch(7, 18, ord(' '))
- treescrn6.addch(10, 4, ord(' '))
- treescrn6.addch(11, 23, ord(' '))
-
- # star
- treescrn6.standout()
- treescrn6.addch(0, 12, ord('*'))
- treescrn6.standend()
-
- # strng1
-
- # strng2
- treescrn6.addch(5, 11, ord(' '))
-
- # strng3
- treescrn6.addch(7, 13, ord(' '))
- treescrn6.addch(8, 9, ord(' '))
-
- # strng4
- treescrn6.addch(9, 14, ord(' '))
- treescrn6.addch(10, 10, ord(' '))
- treescrn6.addch(11, 6, ord(' '))
-
- # strng5
- treescrn6.addch(11, 16, ord(' '))
- treescrn6.addch(12, 12, ord(' '))
-
- # treescrn7
-
- treescrn.overlay(treescrn7)
-
- # balls
- treescrn7.addch(3, 15, ord(' '))
- treescrn7.addch(6, 7, ord(' '))
- treescrn7.addch(7, 18, ord(' '))
- treescrn7.addch(10, 4, ord(' '))
- treescrn7.addch(11, 22, ord(' '))
-
- # star
- treescrn7.addch(0, 12, ord('*'))
-
- # strng1
- treescrn7.addch(3, 12, ord(' '))
-
- # strng2
- treescrn7.addch(5, 13, ord(' '))
- treescrn7.addch(6, 9, ord(' '))
-
- # strng3
- treescrn7.addch(7, 15, ord(' '))
- treescrn7.addch(8, 11, ord(' '))
-
- # strng4
- treescrn7.addch(9, 16, ord(' '))
- treescrn7.addch(10, 12, ord(' '))
- treescrn7.addch(11, 8, ord(' '))
-
- # strng5
- treescrn7.addch(11, 18, ord(' '))
- treescrn7.addch(12, 14, ord(' '))
-
- look_out(150)
- reindeer()
-
- w_holiday.touchwin()
- w_holiday.refresh()
- w_del_msg.refresh()
-
- look_out(500)
- for i in range(0, 20):
- blinkit()
-
-curses.wrapper(main)
diff --git a/Demo/embed/Makefile b/Demo/embed/Makefile
deleted file mode 100644
index 711b95bbf7..0000000000
--- a/Demo/embed/Makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Makefile for embedded Python use demo.
-# (This version tailored for my Red Hat Linux 6.1 setup;
-# edit lines marked with XXX.)
-
-# XXX The compiler you are using
-CC= gcc
-
-# XXX Top of the build tree and source tree
-blddir= ../..
-srcdir= ../..
-
-# Python version
-VERSION= 3.0
-
-# Compiler flags
-OPT= -g
-INCLUDES= -I$(srcdir)/Include -I$(blddir)
-CFLAGS= $(OPT)
-CPPFLAGS= $(INCLUDES)
-
-# The Python library
-LIBPYTHON= $(blddir)/libpython$(VERSION).a
-
-# XXX edit LIBS (in particular) to match $(blddir)/Modules/Makefile
-LIBS= -lnsl -ldl -lreadline -lieee -lpthread -lutil
-LDFLAGS= -Xlinker -export-dynamic
-SYSLIBS= -lm
-MODLIBS=
-ALLLIBS= $(LIBPYTHON) $(MODLIBS) $(LIBS) $(SYSLIBS)
-
-# Build the demo applications
-all: demo loop importexc
-demo: demo.o
- $(CC) $(LDFLAGS) demo.o $(ALLLIBS) -o demo
-
-loop: loop.o
- $(CC) $(LDFLAGS) loop.o $(ALLLIBS) -o loop
-
-importexc: importexc.o
- $(CC) $(LDFLAGS) importexc.o $(ALLLIBS) -o importexc
-
-# Administrative targets
-
-test: demo
- ./demo
-
-COMMAND="print 'hello world'"
-looptest: loop
- ./loop $(COMMAND)
-
-clean:
- -rm -f *.o core
-
-clobber: clean
- -rm -f *~ @* '#'* demo loop importexc
-
-realclean: clobber
diff --git a/Demo/embed/README b/Demo/embed/README
deleted file mode 100644
index a0f7af8439..0000000000
--- a/Demo/embed/README
+++ /dev/null
@@ -1,19 +0,0 @@
-This directory show how to embed the Python interpreter in your own
-application. The file demo.c shows you all that is needed in your C
-code.
-
-To build it, you may have to edit the Makefile:
-
-1) set blddir to the directory where you built Python, if it isn't in
-the source directory (../..)
-
-2) change the variables that together define the list of libraries
-(MODLIBS, LIBS, SYSLIBS) to link with, to match their definitions in
-$(blddir)/Modules/Makefile
-
-An additional test program, loop.c, is used to experiment with memory
-leakage caused by repeated initialization and finalization of the
-interpreter. It can be build by saying "make loop" and tested with
-"make looptest". Command line usage is "./loop <python-command>",
-e.g. "./loop 'print 2+2'" should spit out an endless number of lines
-containing the number 4.
diff --git a/Demo/embed/demo.c b/Demo/embed/demo.c
deleted file mode 100644
index 99d39ca6e3..0000000000
--- a/Demo/embed/demo.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Example of embedding Python in another program */
-
-#include "Python.h"
-
-PyObject* PyInit_xyzzy(void); /* Forward */
-
-main(int argc, char **argv)
-{
- /* Ignore passed-in argc/argv. If desired, conversion
- should use mbstowcs to convert them. */
- wchar_t *args[] = {L"embed", L"hello", 0};
-
- /* Pass argv[0] to the Python interpreter */
- Py_SetProgramName(args[0]);
-
- /* Add a static module */
- PyImport_AppendInittab("xyzzy", PyInit_xyzzy);
-
- /* Initialize the Python interpreter. Required. */
- Py_Initialize();
-
- /* Define sys.argv. It is up to the application if you
- want this; you can also let it undefined (since the Python
- code is generally not a main program it has no business
- touching sys.argv...)
-
- If the third argument is true, sys.path is modified to include
- either the directory containing the script named by argv[0], or
- the current working directory. This can be risky; if you run
- an application embedding Python in a directory controlled by
- someone else, attackers could put a Trojan-horse module in the
- directory (say, a file named os.py) that your application would
- then import and run.
- */
- PySys_SetArgvEx(2, args, 0);
-
- /* Do some application specific code */
- printf("Hello, brave new world\n\n");
-
- /* Execute some Python statements (in module __main__) */
- PyRun_SimpleString("import sys\n");
- PyRun_SimpleString("print(sys.builtin_module_names)\n");
- PyRun_SimpleString("print(sys.modules.keys())\n");
- PyRun_SimpleString("print(sys.executable)\n");
- PyRun_SimpleString("print(sys.argv)\n");
-
- /* Note that you can call any public function of the Python
- interpreter here, e.g. call_object(). */
-
- /* Some more application specific code */
- printf("\nGoodbye, cruel world\n");
-
- /* Exit, cleaning up the interpreter */
- Py_Exit(0);
- /*NOTREACHED*/
-}
-
-/* A static module */
-
-/* 'self' is not used */
-static PyObject *
-xyzzy_foo(PyObject *self, PyObject* args)
-{
- return PyLong_FromLong(42L);
-}
-
-static PyMethodDef xyzzy_methods[] = {
- {"foo", xyzzy_foo, METH_NOARGS,
- "Return the meaning of everything."},
- {NULL, NULL} /* sentinel */
-};
-
-static struct PyModuleDef xyzzymodule = {
- {}, /* m_base */
- "xyzzy", /* m_name */
- 0, /* m_doc */
- 0, /* m_size */
- xyzzy_methods, /* m_methods */
- 0, /* m_reload */
- 0, /* m_traverse */
- 0, /* m_clear */
- 0, /* m_free */
-};
-
-PyObject*
-PyInit_xyzzy(void)
-{
- return PyModule_Create(&xyzzymodule);
-}
diff --git a/Demo/embed/importexc.c b/Demo/embed/importexc.c
deleted file mode 100644
index 59b1d01d87..0000000000
--- a/Demo/embed/importexc.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <Python.h>
-
-#if 0
-char* cmd = "import codecs, encodings.utf_8, types; print(types)";
-#else
-char* cmd = "import types; print(types)";
-#endif
-
-int main()
-{
- printf("Initialize interpreter\n");
- Py_Initialize();
- PyEval_InitThreads();
- PyRun_SimpleString(cmd);
- Py_EndInterpreter(PyThreadState_Get());
-
- printf("\nInitialize subinterpreter\n");
- Py_NewInterpreter();
- PyRun_SimpleString(cmd);
- Py_Finalize();
-
- return 0;
-}
diff --git a/Demo/embed/loop.c b/Demo/embed/loop.c
deleted file mode 100644
index 4a341fdf52..0000000000
--- a/Demo/embed/loop.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Simple program that repeatedly calls Py_Initialize(), does something, and
- then calls Py_Finalize(). This should help finding leaks related to
- initialization. */
-
-#include "Python.h"
-
-main(int argc, char **argv)
-{
- int count = -1;
- char *command;
-
- if (argc < 2 || argc > 3) {
- fprintf(stderr, "usage: loop <python-command> [count]\n");
- exit(2);
- }
- command = argv[1];
-
- if (argc == 3) {
- count = atoi(argv[2]);
- }
-
- Py_SetProgramName(L"loop");
-
- /* uncomment this if you don't want to load site.py */
- /* Py_NoSiteFlag = 1; */
-
- while (count == -1 || --count >= 0 ) {
- Py_Initialize();
- PyRun_SimpleString(command);
- Py_Finalize();
- }
- return 0;
-}
diff --git a/Demo/md5test/README b/Demo/md5test/README
deleted file mode 100644
index be7621e464..0000000000
--- a/Demo/md5test/README
+++ /dev/null
@@ -1,10 +0,0 @@
-This is the Python version of the MD5 test program from the MD5
-Internet Draft (Rivest and Dusse, The MD5 Message-Digest Algorithm, 10
-July 1991). The file "foo" contains the string "abc" with no trailing
-newline.
-
-When called without arguments, it acts as a filter. When called with
-"-x", it executes a self-test, and the output should literally match
-the output given in the RFC.
-
-Code by Jan-Hein B\"uhrman after the original in C.
diff --git a/Demo/md5test/foo b/Demo/md5test/foo
deleted file mode 100755
index f2ba8f84ab..0000000000
--- a/Demo/md5test/foo
+++ /dev/null
@@ -1 +0,0 @@
-abc \ No newline at end of file
diff --git a/Demo/md5test/md5driver.py b/Demo/md5test/md5driver.py
deleted file mode 100755
index 7f561aba40..0000000000
--- a/Demo/md5test/md5driver.py
+++ /dev/null
@@ -1,122 +0,0 @@
-from hashlib import md5
-import string
-from sys import argv
-
-def MDPrint(str):
- outstr = ''
- for o in str:
- outstr = (outstr
- + string.hexdigits[(o >> 4) & 0xF]
- + string.hexdigits[o & 0xF])
- print(outstr, end=' ')
-
-
-from time import time
-
-def makestr(start, end):
- result = ''
- for i in range(start, end + 1):
- result = result + chr(i)
-
- return result
-
-
-def MDTimeTrial():
- TEST_BLOCK_SIZE = 1000
- TEST_BLOCKS = 10000
-
- TEST_BYTES = TEST_BLOCK_SIZE * TEST_BLOCKS
-
- # initialize test data, need temporary string filler
-
- filsiz = 1 << 8
- filler = makestr(0, filsiz-1)
- data = filler * (TEST_BLOCK_SIZE // filsiz)
- data = data + filler[:(TEST_BLOCK_SIZE % filsiz)]
-
- del filsiz, filler
-
-
- # start timer
- print('MD5 time trial. Processing', TEST_BYTES, 'characters...')
- t1 = time()
-
- mdContext = md5()
-
- for i in range(TEST_BLOCKS):
- mdContext.update(data)
-
- str = mdContext.digest()
- t2 = time()
-
- MDPrint(str)
- print('is digest of test input.')
- print('Seconds to process test input:', t2 - t1)
- print('Characters processed per second:', TEST_BYTES / (t2 - t1))
-
-
-def MDString(str):
- MDPrint(md5(str.encode("utf-8")).digest())
- print('"' + str + '"')
-
-
-def MDFile(filename):
- f = open(filename, 'rb')
- mdContext = md5()
-
- while 1:
- data = f.read(1024)
- if not data:
- break
- mdContext.update(data)
-
- MDPrint(mdContext.digest())
- print(filename)
-
-
-import sys
-
-def MDFilter():
- mdContext = md5()
-
- while 1:
- data = sys.stdin.read(16).encode()
- if not data:
- break
- mdContext.update(data)
-
- MDPrint(mdContext.digest())
- print()
-
-
-def MDTestSuite():
- print('MD5 test suite results:')
- MDString('')
- MDString('a')
- MDString('abc')
- MDString('message digest')
- MDString(makestr(ord('a'), ord('z')))
- MDString(makestr(ord('A'), ord('Z'))
- + makestr(ord('a'), ord('z'))
- + makestr(ord('0'), ord('9')))
- MDString((makestr(ord('1'), ord('9')) + '0') * 8)
-
- # Contents of file foo are "abc"
- MDFile('foo')
-
-
-# I don't wanna use getopt(), since I want to use the same i/f...
-def main():
- if len(argv) == 1:
- MDFilter()
- for arg in argv[1:]:
- if arg[:2] == '-s':
- MDString(arg[2:])
- elif arg == '-t':
- MDTimeTrial()
- elif arg == '-x':
- MDTestSuite()
- else:
- MDFile(arg)
-
-main()
diff --git a/Demo/newmetaclasses/Enum.py b/Demo/newmetaclasses/Enum.py
deleted file mode 100644
index 3ff8ddd720..0000000000
--- a/Demo/newmetaclasses/Enum.py
+++ /dev/null
@@ -1,177 +0,0 @@
-"""Enumeration metaclass."""
-
-class EnumMetaclass(type):
- """Metaclass for enumeration.
-
- To define your own enumeration, do something like
-
- class Color(Enum):
- red = 1
- green = 2
- blue = 3
-
- Now, Color.red, Color.green and Color.blue behave totally
- different: they are enumerated values, not integers.
-
- Enumerations cannot be instantiated; however they can be
- subclassed.
- """
-
- def __init__(cls, name, bases, dict):
- super(EnumMetaclass, cls).__init__(name, bases, dict)
- cls._members = []
- for attr in dict.keys():
- if not (attr.startswith('__') and attr.endswith('__')):
- enumval = EnumInstance(name, attr, dict[attr])
- setattr(cls, attr, enumval)
- cls._members.append(attr)
-
- def __getattr__(cls, name):
- if name == "__members__":
- return cls._members
- raise AttributeError(name)
-
- def __repr__(cls):
- s1 = s2 = ""
- enumbases = [base.__name__ for base in cls.__bases__
- if isinstance(base, EnumMetaclass) and not base is Enum]
- if enumbases:
- s1 = "(%s)" % ", ".join(enumbases)
- enumvalues = ["%s: %d" % (val, getattr(cls, val))
- for val in cls._members]
- if enumvalues:
- s2 = ": {%s}" % ", ".join(enumvalues)
- return "%s%s%s" % (cls.__name__, s1, s2)
-
-class FullEnumMetaclass(EnumMetaclass):
- """Metaclass for full enumerations.
-
- A full enumeration displays all the values defined in base classes.
- """
-
- def __init__(cls, name, bases, dict):
- super(FullEnumMetaclass, cls).__init__(name, bases, dict)
- for obj in cls.__mro__:
- if isinstance(obj, EnumMetaclass):
- for attr in obj._members:
- # XXX inefficient
- if not attr in cls._members:
- cls._members.append(attr)
-
-class EnumInstance(int):
- """Class to represent an enumeration value.
-
- EnumInstance('Color', 'red', 12) prints as 'Color.red' and behaves
- like the integer 12 when compared, but doesn't support arithmetic.
-
- XXX Should it record the actual enumeration rather than just its
- name?
- """
-
- def __new__(cls, classname, enumname, value):
- return int.__new__(cls, value)
-
- def __init__(self, classname, enumname, value):
- self.__classname = classname
- self.__enumname = enumname
-
- def __repr__(self):
- return "EnumInstance(%s, %s, %d)" % (self.__classname, self.__enumname,
- self)
-
- def __str__(self):
- return "%s.%s" % (self.__classname, self.__enumname)
-
-class Enum(metaclass=EnumMetaclass):
- pass
-
-class FullEnum(metaclass=FullEnumMetaclass):
- pass
-
-def _test():
-
- class Color(Enum):
- red = 1
- green = 2
- blue = 3
-
- print(Color.red)
-
- print(repr(Color.red))
- print(Color.red == Color.red)
- print(Color.red == Color.blue)
- print(Color.red == 1)
- print(Color.red == 2)
-
- class ExtendedColor(Color):
- white = 0
- orange = 4
- yellow = 5
- purple = 6
- black = 7
-
- print(ExtendedColor.orange)
- print(ExtendedColor.red)
-
- print(Color.red == ExtendedColor.red)
-
- class OtherColor(Enum):
- white = 4
- blue = 5
-
- class MergedColor(Color, OtherColor):
- pass
-
- print(MergedColor.red)
- print(MergedColor.white)
-
- print(Color)
- print(ExtendedColor)
- print(OtherColor)
- print(MergedColor)
-
-def _test2():
-
- class Color(FullEnum):
- red = 1
- green = 2
- blue = 3
-
- print(Color.red)
-
- print(repr(Color.red))
- print(Color.red == Color.red)
- print(Color.red == Color.blue)
- print(Color.red == 1)
- print(Color.red == 2)
-
- class ExtendedColor(Color):
- white = 0
- orange = 4
- yellow = 5
- purple = 6
- black = 7
-
- print(ExtendedColor.orange)
- print(ExtendedColor.red)
-
- print(Color.red == ExtendedColor.red)
-
- class OtherColor(FullEnum):
- white = 4
- blue = 5
-
- class MergedColor(Color, OtherColor):
- pass
-
- print(MergedColor.red)
- print(MergedColor.white)
-
- print(Color)
- print(ExtendedColor)
- print(OtherColor)
- print(MergedColor)
-
-if __name__ == '__main__':
- _test()
- _test2()
diff --git a/Demo/parser/FILES b/Demo/parser/FILES
deleted file mode 100644
index 1ff59a31a2..0000000000
--- a/Demo/parser/FILES
+++ /dev/null
@@ -1,6 +0,0 @@
-Demo/parser
-Doc/libparser.tex
-Lib/AST.py
-Lib/symbol.py
-Lib/token.py
-Modules/parsermodule.c
diff --git a/Demo/parser/README b/Demo/parser/README
deleted file mode 100644
index a576d33b04..0000000000
--- a/Demo/parser/README
+++ /dev/null
@@ -1,31 +0,0 @@
-These files are from the large example of using the `parser' module. Refer
-to the Python Library Reference for more information.
-
-It also contains examples for the AST parser.
-
-Files:
-------
-
- FILES -- list of files associated with the parser module.
-
- README -- this file.
-
- example.py -- module that uses the `parser' module to extract
- information from the parse tree of Python source
- code.
-
- docstring.py -- sample source file containing only a module docstring.
-
- simple.py -- sample source containing a "short form" definition.
-
- source.py -- sample source code used to demonstrate ability to
- handle nested constructs easily using the functions
- and classes in example.py.
-
- test_parser.py program to put the parser module through its paces.
-
- unparse.py AST (2.5) based example to recreate source code
- from an AST. This is incomplete; contributions
- are welcome.
-
-Enjoy!
diff --git a/Demo/parser/docstring.py b/Demo/parser/docstring.py
deleted file mode 100644
index 45a261b61c..0000000000
--- a/Demo/parser/docstring.py
+++ /dev/null
@@ -1,2 +0,0 @@
-"""Some documentation.
-"""
diff --git a/Demo/parser/example.py b/Demo/parser/example.py
deleted file mode 100644
index c2f0883ba4..0000000000
--- a/Demo/parser/example.py
+++ /dev/null
@@ -1,190 +0,0 @@
-"""Simple code to extract class & function docstrings from a module.
-
-This code is used as an example in the library reference manual in the
-section on using the parser module. Refer to the manual for a thorough
-discussion of the operation of this code.
-"""
-
-import os
-import parser
-import symbol
-import token
-import types
-
-from types import ListType, TupleType
-
-
-def get_docs(fileName):
- """Retrieve information from the parse tree of a source file.
-
- fileName
- Name of the file to read Python source code from.
- """
- source = open(fileName).read()
- basename = os.path.basename(os.path.splitext(fileName)[0])
- ast = parser.suite(source)
- return ModuleInfo(ast.totuple(), basename)
-
-
-class SuiteInfoBase:
- _docstring = ''
- _name = ''
-
- def __init__(self, tree = None):
- self._class_info = {}
- self._function_info = {}
- if tree:
- self._extract_info(tree)
-
- def _extract_info(self, tree):
- # extract docstring
- if len(tree) == 2:
- found, vars = match(DOCSTRING_STMT_PATTERN[1], tree[1])
- else:
- found, vars = match(DOCSTRING_STMT_PATTERN, tree[3])
- if found:
- self._docstring = eval(vars['docstring'])
- # discover inner definitions
- for node in tree[1:]:
- found, vars = match(COMPOUND_STMT_PATTERN, node)
- if found:
- cstmt = vars['compound']
- if cstmt[0] == symbol.funcdef:
- name = cstmt[2][1]
- self._function_info[name] = FunctionInfo(cstmt)
- elif cstmt[0] == symbol.classdef:
- name = cstmt[2][1]
- self._class_info[name] = ClassInfo(cstmt)
-
- def get_docstring(self):
- return self._docstring
-
- def get_name(self):
- return self._name
-
- def get_class_names(self):
- return list(self._class_info.keys())
-
- def get_class_info(self, name):
- return self._class_info[name]
-
- def __getitem__(self, name):
- try:
- return self._class_info[name]
- except KeyError:
- return self._function_info[name]
-
-
-class SuiteFuncInfo:
- # Mixin class providing access to function names and info.
-
- def get_function_names(self):
- return list(self._function_info.keys())
-
- def get_function_info(self, name):
- return self._function_info[name]
-
-
-class FunctionInfo(SuiteInfoBase, SuiteFuncInfo):
- def __init__(self, tree = None):
- self._name = tree[2][1]
- SuiteInfoBase.__init__(self, tree and tree[-1] or None)
-
-
-class ClassInfo(SuiteInfoBase):
- def __init__(self, tree = None):
- self._name = tree[2][1]
- SuiteInfoBase.__init__(self, tree and tree[-1] or None)
-
- def get_method_names(self):
- return list(self._function_info.keys())
-
- def get_method_info(self, name):
- return self._function_info[name]
-
-
-class ModuleInfo(SuiteInfoBase, SuiteFuncInfo):
- def __init__(self, tree = None, name = "<string>"):
- self._name = name
- SuiteInfoBase.__init__(self, tree)
- if tree:
- found, vars = match(DOCSTRING_STMT_PATTERN, tree[1])
- if found:
- self._docstring = vars["docstring"]
-
-
-def match(pattern, data, vars=None):
- """Match `data' to `pattern', with variable extraction.
-
- pattern
- Pattern to match against, possibly containing variables.
-
- data
- Data to be checked and against which variables are extracted.
-
- vars
- Dictionary of variables which have already been found. If not
- provided, an empty dictionary is created.
-
- The `pattern' value may contain variables of the form ['varname'] which
- are allowed to match anything. The value that is matched is returned as
- part of a dictionary which maps 'varname' to the matched value. 'varname'
- is not required to be a string object, but using strings makes patterns
- and the code which uses them more readable.
-
- This function returns two values: a boolean indicating whether a match
- was found and a dictionary mapping variable names to their associated
- values.
- """
- if vars is None:
- vars = {}
- if type(pattern) is ListType: # 'variables' are ['varname']
- vars[pattern[0]] = data
- return 1, vars
- if type(pattern) is not TupleType:
- return (pattern == data), vars
- if len(data) != len(pattern):
- return 0, vars
- for pattern, data in map(None, pattern, data):
- same, vars = match(pattern, data, vars)
- if not same:
- break
- return same, vars
-
-
-# This pattern identifies compound statements, allowing them to be readily
-# differentiated from simple statements.
-#
-COMPOUND_STMT_PATTERN = (
- symbol.stmt,
- (symbol.compound_stmt, ['compound'])
- )
-
-
-# This pattern will match a 'stmt' node which *might* represent a docstring;
-# docstrings require that the statement which provides the docstring be the
-# first statement in the class or function, which this pattern does not check.
-#
-DOCSTRING_STMT_PATTERN = (
- symbol.stmt,
- (symbol.simple_stmt,
- (symbol.small_stmt,
- (symbol.expr_stmt,
- (symbol.testlist,
- (symbol.test,
- (symbol.and_test,
- (symbol.not_test,
- (symbol.comparison,
- (symbol.expr,
- (symbol.xor_expr,
- (symbol.and_expr,
- (symbol.shift_expr,
- (symbol.arith_expr,
- (symbol.term,
- (symbol.factor,
- (symbol.power,
- (symbol.atom,
- (token.STRING, ['docstring'])
- )))))))))))))))),
- (token.NEWLINE, '')
- ))
diff --git a/Demo/parser/simple.py b/Demo/parser/simple.py
deleted file mode 100644
index 184e2fe5d0..0000000000
--- a/Demo/parser/simple.py
+++ /dev/null
@@ -1 +0,0 @@
-def f(): "maybe a docstring"
diff --git a/Demo/parser/source.py b/Demo/parser/source.py
deleted file mode 100644
index b90062851f..0000000000
--- a/Demo/parser/source.py
+++ /dev/null
@@ -1,27 +0,0 @@
-"""Exmaple file to be parsed for the parsermodule example.
-
-The classes and functions in this module exist only to exhibit the ability
-of the handling information extraction from nested definitions using parse
-trees. They shouldn't interest you otherwise!
-"""
-
-class Simple:
- "This class does very little."
-
- def method(self):
- "This method does almost nothing."
- return 1
-
- class Nested:
- "This is a nested class."
-
- def nested_method(self):
- "Method of Nested class."
- def nested_function():
- "Function in method of Nested class."
- pass
- return nested_function
-
-def function():
- "This function lives at the module level."
- return 0
diff --git a/Demo/parser/test_parser.py b/Demo/parser/test_parser.py
deleted file mode 100755
index e4d557103e..0000000000
--- a/Demo/parser/test_parser.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#! /usr/bin/env python
-# (Force the script to use the latest build.)
-#
-# test_parser.py
-
-import parser, traceback
-
-_numFailed = 0
-
-def testChunk(t, fileName):
- global _numFailed
- print('----', fileName, end=' ')
- try:
- ast = parser.suite(t)
- tup = parser.ast2tuple(ast)
- # this discards the first AST; a huge memory savings when running
- # against a large source file like Tkinter.py.
- ast = None
- new = parser.tuple2ast(tup)
- except parser.ParserError as err:
- print()
- print('parser module raised exception on input file', fileName + ':')
- traceback.print_exc()
- _numFailed = _numFailed + 1
- else:
- if tup != parser.ast2tuple(new):
- print()
- print('parser module failed on input file', fileName)
- _numFailed = _numFailed + 1
- else:
- print('o.k.')
-
-def testFile(fileName):
- t = open(fileName).read()
- testChunk(t, fileName)
-
-def test():
- import sys
- args = sys.argv[1:]
- if not args:
- import glob
- args = glob.glob("*.py")
- args.sort()
- list(map(testFile, args))
- sys.exit(_numFailed != 0)
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/parser/texipre.dat b/Demo/parser/texipre.dat
deleted file mode 100644
index 8ad03a6175..0000000000
--- a/Demo/parser/texipre.dat
+++ /dev/null
@@ -1,100 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename parser.info
-@settitle Python Parser Module Reference
-@setchapternewpage odd
-@footnotestyle end
-@c %**end of header
-
-@ifinfo
-This file describes the interfaces
-published by the optional @code{parser} module and gives examples of
-how they may be used. It contains the same text as the chapter on the
-@code{parser} module in the @cite{Python Library Reference}, but is
-presented as a separate document.
-
-Copyright 1995-1996 by Fred L. Drake, Jr., Reston, Virginia, USA, and
-Virginia Polytechnic Institute and State University, Blacksburg,
-Virginia, USA. Portions of the software copyright 1991-1995 by
-Stichting Mathematisch Centrum, Amsterdam, The Netherlands. Copying is
-permitted under the terms associated with the main Python distribution,
-with the additional restriction that this additional notice be included
-and maintained on all distributed copies.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Fred L. Drake, Jr. and
-Virginia Polytechnic Institute and State University not be used in
-advertising or publicity pertaining to distribution of the software
-without specific, written prior permission.
-
-FRED L. DRAKE, JR. AND VIRGINIA POLYTECHNIC INSTITUTE AND STATE
-UNIVERSITY DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-EVENT SHALL FRED L. DRAKE, JR. OR VIRGINIA POLYTECHNIC INSTITUTE AND
-STATE UNIVERSITY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-@end ifinfo
-
-@titlepage
-@title Python Parser Module Reference
-@author Fred L. Drake, Jr.
-
-@c The following two commands start the copyright page.
-@page
-@vskip 0pt plus 1filll
-Copyright 1995-1996 by Fred L. Drake, Jr., Reston, Virginia, USA, and
-Virginia Polytechnic Institute and State University, Blacksburg,
-Virginia, USA. Portions of the software copyright 1991-1995 by
-Stichting Mathematisch Centrum, Amsterdam, The Netherlands. Copying is
-permitted under the terms associated with the main Python distribution,
-with the additional restriction that this additional notice be included
-and maintained on all distributed copies.
-
-@center All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Fred L. Drake, Jr. and
-Virginia Polytechnic Institute and State University not be used in
-advertising or publicity pertaining to distribution of the software
-without specific, written prior permission.
-
-FRED L. DRAKE, JR. AND VIRGINIA POLYTECHNIC INSTITUTE AND STATE
-UNIVERSITY DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-EVENT SHALL FRED L. DRAKE, JR. OR VIRGINIA POLYTECHNIC INSTITUTE AND
-STATE UNIVERSITY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-@end titlepage
-
-
-@node Top, Overview, (dir), (dir)
-@top The Python Parser Module
-
-@ifinfo
-This file describes the interfaces
-published by the optional @code{parser} module and gives examples of
-how they may be used. It contains the same text as the chapter on the
-@code{parser} module in the @cite{Python Library Reference}, but is
-presented as a separate document.
-
-This version corresponds to Python version 1.4 (1 Sept. 1996).
-
-@end ifinfo
-
-@c placeholder for the master menu -- patched by texinfo-all-menus-update
-@menu
-@end menu
diff --git a/Demo/pdist/FSProxy.py b/Demo/pdist/FSProxy.py
deleted file mode 100755
index 510ac76838..0000000000
--- a/Demo/pdist/FSProxy.py
+++ /dev/null
@@ -1,322 +0,0 @@
-"""File System Proxy.
-
-Provide an OS-neutral view on a file system, locally or remotely.
-The functionality is geared towards implementing some sort of
-rdist-like utility between a Mac and a UNIX system.
-
-The module defines three classes:
-
-FSProxyLocal -- used for local access
-FSProxyServer -- used on the server side of remote access
-FSProxyClient -- used on the client side of remote access
-
-The remote classes are instantiated with an IP address and an optional
-verbosity flag.
-"""
-
-import server
-import client
-import md5
-import os
-import fnmatch
-from stat import *
-import time
-import fnmatch
-
-if os.name == 'mac':
- import macfs
- maxnamelen = 31
-else:
- macfs = None
- maxnamelen = 255
-
-skipnames = (os.curdir, os.pardir)
-
-
-class FSProxyLocal:
-
- def __init__(self):
- self._dirstack = []
- self._ignore = ['*.pyc'] + self._readignore()
-
- def _close(self):
- while self._dirstack:
- self.back()
-
- def _readignore(self):
- file = self._hide('ignore')
- try:
- f = open(file)
- except IOError:
- file = self._hide('synctree.ignorefiles')
- try:
- f = open(file)
- except IOError:
- return []
- ignore = []
- while 1:
- line = f.readline()
- if not line: break
- if line[-1] == '\n': line = line[:-1]
- ignore.append(line)
- f.close()
- return ignore
-
- def _hidden(self, name):
- if os.name == 'mac':
- return name[0] == '(' and name[-1] == ')'
- else:
- return name[0] == '.'
-
- def _hide(self, name):
- if os.name == 'mac':
- return '(%s)' % name
- else:
- return '.%s' % name
-
- def visible(self, name):
- if len(name) > maxnamelen: return 0
- if name[-1] == '~': return 0
- if name in skipnames: return 0
- if self._hidden(name): return 0
- head, tail = os.path.split(name)
- if head or not tail: return 0
- if macfs:
- if os.path.exists(name) and not os.path.isdir(name):
- try:
- fs = macfs.FSSpec(name)
- c, t = fs.GetCreatorType()
- if t != 'TEXT': return 0
- except macfs.error as msg:
- print("***", name, msg)
- return 0
- else:
- if os.path.islink(name): return 0
- if '\0' in open(name, 'rb').read(512): return 0
- for ign in self._ignore:
- if fnmatch.fnmatch(name, ign): return 0
- return 1
-
- def check(self, name):
- if not self.visible(name):
- raise os.error("protected name %s" % repr(name))
-
- def checkfile(self, name):
- self.check(name)
- if not os.path.isfile(name):
- raise os.error("not a plain file %s" % repr(name))
-
- def pwd(self):
- return os.getcwd()
-
- def cd(self, name):
- self.check(name)
- save = os.getcwd(), self._ignore
- os.chdir(name)
- self._dirstack.append(save)
- self._ignore = self._ignore + self._readignore()
-
- def back(self):
- if not self._dirstack:
- raise os.error("empty directory stack")
- dir, ignore = self._dirstack[-1]
- os.chdir(dir)
- del self._dirstack[-1]
- self._ignore = ignore
-
- def _filter(self, files, pat = None):
- if pat:
- def keep(name, pat = pat):
- return fnmatch.fnmatch(name, pat)
- files = list(filter(keep, files))
- files = list(filter(self.visible, files))
- files.sort()
- return files
-
- def list(self, pat = None):
- files = os.listdir(os.curdir)
- return self._filter(files, pat)
-
- def listfiles(self, pat = None):
- files = os.listdir(os.curdir)
- files = list(filter(os.path.isfile, files))
- return self._filter(files, pat)
-
- def listsubdirs(self, pat = None):
- files = os.listdir(os.curdir)
- files = list(filter(os.path.isdir, files))
- return self._filter(files, pat)
-
- def exists(self, name):
- return self.visible(name) and os.path.exists(name)
-
- def isdir(self, name):
- return self.visible(name) and os.path.isdir(name)
-
- def islink(self, name):
- return self.visible(name) and os.path.islink(name)
-
- def isfile(self, name):
- return self.visible(name) and os.path.isfile(name)
-
- def sum(self, name):
- self.checkfile(name)
- BUFFERSIZE = 1024*8
- f = open(name)
- sum = md5.new()
- while 1:
- buffer = f.read(BUFFERSIZE)
- if not buffer:
- break
- sum.update(buffer)
- return sum.digest()
-
- def size(self, name):
- self.checkfile(name)
- return os.stat(name)[ST_SIZE]
-
- def mtime(self, name):
- self.checkfile(name)
- return time.localtime(os.stat(name)[ST_MTIME])
-
- def stat(self, name):
- self.checkfile(name)
- size = os.stat(name)[ST_SIZE]
- mtime = time.localtime(os.stat(name)[ST_MTIME])
- return size, mtime
-
- def info(self, name):
- sum = self.sum(name)
- size = os.stat(name)[ST_SIZE]
- mtime = time.localtime(os.stat(name)[ST_MTIME])
- return sum, size, mtime
-
- def _list(self, function, list):
- if list is None:
- list = self.listfiles()
- res = []
- for name in list:
- try:
- res.append((name, function(name)))
- except (os.error, IOError):
- res.append((name, None))
- return res
-
- def sumlist(self, list = None):
- return self._list(self.sum, list)
-
- def statlist(self, list = None):
- return self._list(self.stat, list)
-
- def mtimelist(self, list = None):
- return self._list(self.mtime, list)
-
- def sizelist(self, list = None):
- return self._list(self.size, list)
-
- def infolist(self, list = None):
- return self._list(self.info, list)
-
- def _dict(self, function, list):
- if list is None:
- list = self.listfiles()
- dict = {}
- for name in list:
- try:
- dict[name] = function(name)
- except (os.error, IOError):
- pass
- return dict
-
- def sumdict(self, list = None):
- return self.dict(self.sum, list)
-
- def sizedict(self, list = None):
- return self.dict(self.size, list)
-
- def mtimedict(self, list = None):
- return self.dict(self.mtime, list)
-
- def statdict(self, list = None):
- return self.dict(self.stat, list)
-
- def infodict(self, list = None):
- return self._dict(self.info, list)
-
- def read(self, name, offset = 0, length = -1):
- self.checkfile(name)
- f = open(name)
- f.seek(offset)
- if length == 0:
- data = ''
- elif length < 0:
- data = f.read()
- else:
- data = f.read(length)
- f.close()
- return data
-
- def create(self, name):
- self.check(name)
- if os.path.exists(name):
- self.checkfile(name)
- bname = name + '~'
- try:
- os.unlink(bname)
- except os.error:
- pass
- os.rename(name, bname)
- f = open(name, 'w')
- f.close()
-
- def write(self, name, data, offset = 0):
- self.checkfile(name)
- f = open(name, 'r+')
- f.seek(offset)
- f.write(data)
- f.close()
-
- def mkdir(self, name):
- self.check(name)
- os.mkdir(name, 0o777)
-
- def rmdir(self, name):
- self.check(name)
- os.rmdir(name)
-
-
-class FSProxyServer(FSProxyLocal, server.Server):
-
- def __init__(self, address, verbose = server.VERBOSE):
- FSProxyLocal.__init__(self)
- server.Server.__init__(self, address, verbose)
-
- def _close(self):
- server.Server._close(self)
- FSProxyLocal._close(self)
-
- def _serve(self):
- server.Server._serve(self)
- # Retreat into start directory
- while self._dirstack: self.back()
-
-
-class FSProxyClient(client.Client):
-
- def __init__(self, address, verbose = client.VERBOSE):
- client.Client.__init__(self, address, verbose)
-
-
-def test():
- import string
- import sys
- if sys.argv[1:]:
- port = string.atoi(sys.argv[1])
- else:
- port = 4127
- proxy = FSProxyServer(('', port))
- proxy._serverloop()
-
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/pdist/RCSProxy.py b/Demo/pdist/RCSProxy.py
deleted file mode 100755
index 7c3b24f8ad..0000000000
--- a/Demo/pdist/RCSProxy.py
+++ /dev/null
@@ -1,198 +0,0 @@
-#! /usr/bin/env python
-
-"""RCS Proxy.
-
-Provide a simplified interface on RCS files, locally or remotely.
-The functionality is geared towards implementing some sort of
-remote CVS like utility. It is modeled after the similar module
-FSProxy.
-
-The module defines two classes:
-
-RCSProxyLocal -- used for local access
-RCSProxyServer -- used on the server side of remote access
-
-The corresponding client class, RCSProxyClient, is defined in module
-rcsclient.
-
-The remote classes are instantiated with an IP address and an optional
-verbosity flag.
-"""
-
-import server
-import md5
-import os
-import fnmatch
-import string
-import tempfile
-import rcslib
-
-
-class DirSupport:
-
- def __init__(self):
- self._dirstack = []
-
- def __del__(self):
- self._close()
-
- def _close(self):
- while self._dirstack:
- self.back()
-
- def pwd(self):
- return os.getcwd()
-
- def cd(self, name):
- save = os.getcwd()
- os.chdir(name)
- self._dirstack.append(save)
-
- def back(self):
- if not self._dirstack:
- raise os.error("empty directory stack")
- dir = self._dirstack[-1]
- os.chdir(dir)
- del self._dirstack[-1]
-
- def listsubdirs(self, pat = None):
- files = os.listdir(os.curdir)
- files = list(filter(os.path.isdir, files))
- return self._filter(files, pat)
-
- def isdir(self, name):
- return os.path.isdir(name)
-
- def mkdir(self, name):
- os.mkdir(name, 0o777)
-
- def rmdir(self, name):
- os.rmdir(name)
-
-
-class RCSProxyLocal(rcslib.RCS, DirSupport):
-
- def __init__(self):
- rcslib.RCS.__init__(self)
- DirSupport.__init__(self)
-
- def __del__(self):
- DirSupport.__del__(self)
- rcslib.RCS.__del__(self)
-
- def sumlist(self, list = None):
- return self._list(self.sum, list)
-
- def sumdict(self, list = None):
- return self._dict(self.sum, list)
-
- def sum(self, name_rev):
- f = self._open(name_rev)
- BUFFERSIZE = 1024*8
- sum = md5.new()
- while 1:
- buffer = f.read(BUFFERSIZE)
- if not buffer:
- break
- sum.update(buffer)
- self._closepipe(f)
- return sum.digest()
-
- def get(self, name_rev):
- f = self._open(name_rev)
- data = f.read()
- self._closepipe(f)
- return data
-
- def put(self, name_rev, data, message=None):
- name, rev = self._unmangle(name_rev)
- f = open(name, 'w')
- f.write(data)
- f.close()
- self.checkin(name_rev, message)
- self._remove(name)
-
- def _list(self, function, list = None):
- """INTERNAL: apply FUNCTION to all files in LIST.
-
- Return a list of the results.
-
- The list defaults to all files in the directory if None.
-
- """
- if list is None:
- list = self.listfiles()
- res = []
- for name in list:
- try:
- res.append((name, function(name)))
- except (os.error, IOError):
- res.append((name, None))
- return res
-
- def _dict(self, function, list = None):
- """INTERNAL: apply FUNCTION to all files in LIST.
-
- Return a dictionary mapping files to results.
-
- The list defaults to all files in the directory if None.
-
- """
- if list is None:
- list = self.listfiles()
- dict = {}
- for name in list:
- try:
- dict[name] = function(name)
- except (os.error, IOError):
- pass
- return dict
-
-
-class RCSProxyServer(RCSProxyLocal, server.SecureServer):
-
- def __init__(self, address, verbose = server.VERBOSE):
- RCSProxyLocal.__init__(self)
- server.SecureServer.__init__(self, address, verbose)
-
- def _close(self):
- server.SecureServer._close(self)
- RCSProxyLocal._close(self)
-
- def _serve(self):
- server.SecureServer._serve(self)
- # Retreat into start directory
- while self._dirstack: self.back()
-
-
-def test_server():
- import string
- import sys
- if sys.argv[1:]:
- port = string.atoi(sys.argv[1])
- else:
- port = 4127
- proxy = RCSProxyServer(('', port))
- proxy._serverloop()
-
-
-def test():
- import sys
- if not sys.argv[1:] or sys.argv[1] and sys.argv[1][0] in '0123456789':
- test_server()
- sys.exit(0)
- proxy = RCSProxyLocal()
- what = sys.argv[1]
- if hasattr(proxy, what):
- attr = getattr(proxy, what)
- if hasattr(attr, '__call__'):
- print(attr(*sys.argv[2:]))
- else:
- print(repr(attr))
- else:
- print("%s: no such attribute" % what)
- sys.exit(2)
-
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/pdist/README b/Demo/pdist/README
deleted file mode 100644
index b3fac24127..0000000000
--- a/Demo/pdist/README
+++ /dev/null
@@ -1,121 +0,0 @@
-Filesystem, RCS and CVS client and server classes
-=================================================
-
-*** See the security warning at the end of this file! ***
-
-This directory contains various modules and classes that support
-remote file system operations.
-
-CVS stuff
----------
-
-rcvs Script to put in your bin directory
-rcvs.py Remote CVS client command line interface
-
-cvslib.py CVS admin files classes (used by rrcs)
-cvslock.py CVS locking algorithms
-
-RCS stuff
----------
-
-rrcs Script to put in your bin directory
-rrcs.py Remote RCS client command line interface
-
-rcsclient.py Return an RCSProxyClient instance
- (has reasonable default server/port/directory)
-
-RCSProxy.py RCS proxy and server classes (on top of rcslib.py)
-
-rcslib.py Local-only RCS base class (affects stdout &
- local work files)
-
-FSProxy stuff
--------------
-
-sumtree.py Old demo for FSProxy
-cmptree.py First FSProxy client (used to sync from the Mac)
-FSProxy.py Filesystem interface classes
-
-Generic client/server stuff
----------------------------
-
-client.py Client class
-server.py Server class
-
-security.py Security mix-in class (not very secure I think)
-
-Other generic stuff
--------------------
-
-cmdfw.py CommandFrameWork class
- (used by rcvs, should be used by rrcs as well)
-
-
-Client/Server operation
------------------------
-
-The Client and Server classes implement a simple-minded RPC protocol,
-using Python's pickle module to transfer arguments, return values and
-exceptions with the most generality. The Server class is instantiated
-with a port number on which it should listen for requests; the Client
-class is instantiated with a host name and a port number where it
-should connect to. Once a client is connected, a TCP connection is
-maintained between client and server.
-
-The Server class currently handles only one connection at a time;
-however it could be rewritten to allow various modes of operations,
-using multiple threads or processes or the select() system call as
-desired to serve multiple clients simultaneously (when using select(),
-still handling one request at a time). This would not require
-rewriting of the Client class. It may also be possible to adapt the
-code to use UDP instead of TCP, but then both classes will have to be
-rewritten (and unless extensive acknowlegements and request serial
-numbers are used, the server should handle duplicate requests, so its
-semantics should be idempotent -- shrudder).
-
-Even though the FSProxy and RCSProxy modules define client classes,
-the client class is fully generic -- what methods it supports is
-determined entirely by the server. The server class, however, must be
-derived from. This is generally done as follows:
-
- from server import Server
- from client import Client
-
- # Define a class that performs the operations locally
- class MyClassLocal:
- def __init__(self): ...
- def _close(self): ...
-
- # Derive a server class using multiple inheritance
- class MyClassServer(MyClassLocal, Server):
- def __init__(self, address):
- # Must initialize MyClassLocal as well as Server
- MyClassLocal.__init__(self)
- Server.__init__(self, address)
- def _close(self):
- Server._close()
- MyClassLocal._close()
-
- # A dummy client class
- class MyClassClient(Client): pass
-
-Note that because MyClassLocal isn't used in the definition of
-MyClassClient, it would actually be better to place it in a separate
-module so the definition of MyClassLocal isn't executed when we only
-instantiate a client.
-
-The modules client and server should probably be renamed to Client and
-Server in order to match the class names.
-
-
-*** Security warning: this version requires that you have a file
-$HOME/.python_keyfile at the server and client side containing two
-comma- separated numbers. The security system at the moment makes no
-guarantees of actuallng being secure -- however it requires that the
-key file exists and contains the same numbers at both ends for this to
-work. (You can specify an alternative keyfile in $PYTHON_KEYFILE).
-Have a look at the Security class in security.py for details;
-basically, if the key file contains (x, y), then the security server
-class chooses a random number z (the challenge) in the range
-10..100000 and the client must be able to produce pow(z, x, y)
-(i.e. z**x mod y).
diff --git a/Demo/pdist/client.py b/Demo/pdist/client.py
deleted file mode 100755
index c9fe369e25..0000000000
--- a/Demo/pdist/client.py
+++ /dev/null
@@ -1,156 +0,0 @@
-"""RPC Client module."""
-
-import sys
-import socket
-import pickle
-import builtins
-import os
-
-
-# Default verbosity (0 = silent, 1 = print connections, 2 = print requests too)
-VERBOSE = 1
-
-
-class Client:
-
- """RPC Client class. No need to derive a class -- it's fully generic."""
-
- def __init__(self, address, verbose = VERBOSE):
- self._pre_init(address, verbose)
- self._post_init()
-
- def _pre_init(self, address, verbose = VERBOSE):
- if type(address) == type(0):
- address = ('', address)
- self._address = address
- self._verbose = verbose
- if self._verbose: print("Connecting to %s ..." % repr(address))
- self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self._socket.connect(address)
- if self._verbose: print("Connected.")
- self._lastid = 0 # Last id for which a reply has been received
- self._nextid = 1 # Id of next request
- self._replies = {} # Unprocessed replies
- self._rf = self._socket.makefile('r')
- self._wf = self._socket.makefile('w')
-
- def _post_init(self):
- self._methods = self._call('.methods')
-
- def __del__(self):
- self._close()
-
- def _close(self):
- if self._rf: self._rf.close()
- self._rf = None
- if self._wf: self._wf.close()
- self._wf = None
- if self._socket: self._socket.close()
- self._socket = None
-
- def __getattr__(self, name):
- if name in self._methods:
- method = _stub(self, name)
- setattr(self, name, method) # XXX circular reference
- return method
- raise AttributeError(name)
-
- def _setverbose(self, verbose):
- self._verbose = verbose
-
- def _call(self, name, *args):
- return self._vcall(name, args)
-
- def _vcall(self, name, args):
- return self._recv(self._vsend(name, args))
-
- def _send(self, name, *args):
- return self._vsend(name, args)
-
- def _send_noreply(self, name, *args):
- return self._vsend(name, args, 0)
-
- def _vsend_noreply(self, name, args):
- return self._vsend(name, args, 0)
-
- def _vsend(self, name, args, wantreply = 1):
- id = self._nextid
- self._nextid = id+1
- if not wantreply: id = -id
- request = (name, args, id)
- if self._verbose > 1: print("sending request: %s" % repr(request))
- wp = pickle.Pickler(self._wf)
- wp.dump(request)
- return id
-
- def _recv(self, id):
- exception, value, rid = self._vrecv(id)
- if rid != id:
- raise RuntimeError("request/reply id mismatch: %d/%d" % (id, rid))
- if exception is None:
- return value
- x = exception
- if hasattr(builtins, exception):
- x = getattr(builtins, exception)
- elif exception in ('posix.error', 'mac.error'):
- x = os.error
- if x == exception:
- exception = x
- raise exception(value)
-
- def _vrecv(self, id):
- self._flush()
- if id in self._replies:
- if self._verbose > 1: print("retrieving previous reply, id = %d" % id)
- reply = self._replies[id]
- del self._replies[id]
- return reply
- aid = abs(id)
- while 1:
- if self._verbose > 1: print("waiting for reply, id = %d" % id)
- rp = pickle.Unpickler(self._rf)
- reply = rp.load()
- del rp
- if self._verbose > 1: print("got reply: %s" % repr(reply))
- rid = reply[2]
- arid = abs(rid)
- if arid == aid:
- if self._verbose > 1: print("got it")
- return reply
- self._replies[rid] = reply
- if arid > aid:
- if self._verbose > 1: print("got higher id, assume all ok")
- return (None, None, id)
-
- def _flush(self):
- self._wf.flush()
-
-
-from security import Security
-
-
-class SecureClient(Client, Security):
-
- def __init__(self, *args):
- self._pre_init(*args)
- Security.__init__(self)
- self._wf.flush()
- line = self._rf.readline()
- challenge = int(line.strip())
- response = self._encode_challenge(challenge)
- line = repr(int(response))
- if line[-1] in 'Ll': line = line[:-1]
- self._wf.write(line + '\n')
- self._wf.flush()
- self._post_init()
-
-class _stub:
-
- """Helper class for Client -- each instance serves as a method of the client."""
-
- def __init__(self, client, name):
- self._client = client
- self._name = name
-
- def __call__(self, *args):
- return self._client._vcall(self._name, args)
diff --git a/Demo/pdist/cmdfw.py b/Demo/pdist/cmdfw.py
deleted file mode 100755
index ec854b1bc7..0000000000
--- a/Demo/pdist/cmdfw.py
+++ /dev/null
@@ -1,142 +0,0 @@
-"Framework for command line interfaces like CVS. See class CmdFrameWork."
-
-
-class CommandFrameWork:
-
- """Framework class for command line interfaces like CVS.
-
- The general command line structure is
-
- command [flags] subcommand [subflags] [argument] ...
-
- There's a class variable GlobalFlags which specifies the
- global flags options. Subcommands are defined by defining
- methods named do_<subcommand>. Flags for the subcommand are
- defined by defining class or instance variables named
- flags_<subcommand>. If there's no command, method default()
- is called. The __doc__ strings for the do_ methods are used
- for the usage message, printed after the general usage message
- which is the class variable UsageMessage. The class variable
- PostUsageMessage is printed after all the do_ methods' __doc__
- strings. The method's return value can be a suggested exit
- status. [XXX Need to rewrite this to clarify it.]
-
- Common usage is to derive a class, instantiate it, and then call its
- run() method; by default this takes its arguments from sys.argv[1:].
- """
-
- UsageMessage = \
- "usage: (name)s [flags] subcommand [subflags] [argument] ..."
-
- PostUsageMessage = None
-
- GlobalFlags = ''
-
- def __init__(self):
- """Constructor, present for completeness."""
- pass
-
- def run(self, args = None):
- """Process flags, subcommand and options, then run it."""
- import getopt, sys
- if args is None: args = sys.argv[1:]
- try:
- opts, args = getopt.getopt(args, self.GlobalFlags)
- except getopt.error as msg:
- return self.usage(msg)
- self.options(opts)
- if not args:
- self.ready()
- return self.default()
- else:
- cmd = args[0]
- mname = 'do_' + cmd
- fname = 'flags_' + cmd
- try:
- method = getattr(self, mname)
- except AttributeError:
- return self.usage("command %r unknown" % (cmd,))
- try:
- flags = getattr(self, fname)
- except AttributeError:
- flags = ''
- try:
- opts, args = getopt.getopt(args[1:], flags)
- except getopt.error as msg:
- return self.usage(
- "subcommand %s: " % cmd + str(msg))
- self.ready()
- return method(opts, args)
-
- def options(self, opts):
- """Process the options retrieved by getopt.
- Override this if you have any options."""
- if opts:
- print("-"*40)
- print("Options:")
- for o, a in opts:
- print('option', o, 'value', repr(a))
- print("-"*40)
-
- def ready(self):
- """Called just before calling the subcommand."""
- pass
-
- def usage(self, msg = None):
- """Print usage message. Return suitable exit code (2)."""
- if msg: print(msg)
- print(self.UsageMessage % {'name': self.__class__.__name__})
- docstrings = {}
- c = self.__class__
- while 1:
- for name in dir(c):
- if name[:3] == 'do_':
- if name in docstrings:
- continue
- try:
- doc = getattr(c, name).__doc__
- except:
- doc = None
- if doc:
- docstrings[name] = doc
- if not c.__bases__:
- break
- c = c.__bases__[0]
- if docstrings:
- print("where subcommand can be:")
- for name in sorted(docstrings.keys()):
- print(docstrings[name])
- if self.PostUsageMessage:
- print(self.PostUsageMessage)
- return 2
-
- def default(self):
- """Default method, called when no subcommand is given.
- You should always override this."""
- print("Nobody expects the Spanish Inquisition!")
-
-
-def test():
- """Test script -- called when this module is run as a script."""
- import sys
- class Hello(CommandFrameWork):
- def do_hello(self, opts, args):
- "hello -- print 'hello world', needs no arguments"
- print("Hello, world")
- x = Hello()
- tests = [
- [],
- ['hello'],
- ['spam'],
- ['-x'],
- ['hello', '-x'],
- None,
- ]
- for t in tests:
- print('-'*10, t, '-'*10)
- sts = x.run(t)
- print("Exit status:", repr(sts))
-
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/pdist/cmptree.py b/Demo/pdist/cmptree.py
deleted file mode 100755
index c1bbf1a84d..0000000000
--- a/Demo/pdist/cmptree.py
+++ /dev/null
@@ -1,213 +0,0 @@
-"""Compare local and remote dictionaries and transfer differing files -- like rdist."""
-
-import sys
-from reprlib import repr
-import FSProxy
-import time
-import os
-
-def raw_input(prompt):
- sys.stdout.write(prompt)
- sys.stdout.flush()
- return sys.stdin.readline()
-
-def main():
- pwd = os.getcwd()
- s = input("chdir [%s] " % pwd)
- if s:
- os.chdir(s)
- pwd = os.getcwd()
- host = ask("host", 'voorn.cwi.nl')
- port = 4127
- verbose = 1
- mode = ''
- print("""\
-Mode should be a string of characters, indicating what to do with differences.
-r - read different files to local file system
-w - write different files to remote file system
-c - create new files, either remote or local
-d - delete disappearing files, either remote or local
-""")
- s = input("mode [%s] " % mode)
- if s: mode = s
- address = (host, port)
- t1 = time.time()
- local = FSProxy.FSProxyLocal()
- remote = FSProxy.FSProxyClient(address, verbose)
- compare(local, remote, mode)
- remote._close()
- local._close()
- t2 = time.time()
- dt = t2-t1
- mins, secs = divmod(dt, 60)
- print(mins, "minutes and", round(secs), "seconds")
- input("[Return to exit] ")
-
-def ask(prompt, default):
- s = input("%s [%s] " % (prompt, default))
- return s or default
-
-def askint(prompt, default):
- s = input("%s [%s] " % (prompt, str(default)))
- if s: return string.atoi(s)
- return default
-
-def compare(local, remote, mode):
- print()
- print("PWD =", repr(os.getcwd()))
- sums_id = remote._send('sumlist')
- subdirs_id = remote._send('listsubdirs')
- remote._flush()
- print("calculating local sums ...")
- lsumdict = {}
- for name, info in local.sumlist():
- lsumdict[name] = info
- print("getting remote sums ...")
- sums = remote._recv(sums_id)
- print("got", len(sums))
- rsumdict = {}
- for name, rsum in sums:
- rsumdict[name] = rsum
- if name not in lsumdict:
- print(repr(name), "only remote")
- if 'r' in mode and 'c' in mode:
- recvfile(local, remote, name)
- else:
- lsum = lsumdict[name]
- if lsum != rsum:
- print(repr(name), end=' ')
- rmtime = remote.mtime(name)
- lmtime = local.mtime(name)
- if rmtime > lmtime:
- print("remote newer", end=' ')
- if 'r' in mode:
- recvfile(local, remote, name)
- elif lmtime > rmtime:
- print("local newer", end=' ')
- if 'w' in mode:
- sendfile(local, remote, name)
- else:
- print("same mtime but different sum?!?!", end=' ')
- print()
- for name in lsumdict.keys():
- if not list(rsumdict.keys()):
- print(repr(name), "only locally", end=' ')
- fl()
- if 'w' in mode and 'c' in mode:
- sendfile(local, remote, name)
- elif 'r' in mode and 'd' in mode:
- os.unlink(name)
- print("removed.")
- print()
- print("gettin subdirs ...")
- subdirs = remote._recv(subdirs_id)
- common = []
- for name in subdirs:
- if local.isdir(name):
- print("Common subdirectory", repr(name))
- common.append(name)
- else:
- print("Remote subdirectory", repr(name), "not found locally")
- if 'r' in mode and 'c' in mode:
- pr = "Create local subdirectory %s? [y] " % \
- repr(name)
- if 'y' in mode:
- ok = 'y'
- else:
- ok = ask(pr, "y")
- if ok[:1] in ('y', 'Y'):
- local.mkdir(name)
- print("Subdirectory %s made" % \
- repr(name))
- common.append(name)
- lsubdirs = local.listsubdirs()
- for name in lsubdirs:
- if name not in subdirs:
- print("Local subdirectory", repr(name), "not found remotely")
- for name in common:
- print("Entering subdirectory", repr(name))
- local.cd(name)
- remote.cd(name)
- compare(local, remote, mode)
- remote.back()
- local.back()
-
-def sendfile(local, remote, name):
- try:
- remote.create(name)
- except (IOError, os.error) as msg:
- print("cannot create:", msg)
- return
-
- print("sending ...", end=' ')
- fl()
-
- data = open(name).read()
-
- t1 = time.time()
-
- remote._send_noreply('write', name, data)
- remote._flush()
-
- t2 = time.time()
-
- dt = t2-t1
- print(len(data), "bytes in", round(dt), "seconds", end=' ')
- if dt:
- print("i.e.", round(len(data)/dt), "bytes/sec", end=' ')
- print()
-
-def recvfile(local, remote, name):
- ok = 0
- try:
- rv = recvfile_real(local, remote, name)
- ok = 1
- return rv
- finally:
- if not ok:
- print("*** recvfile of %r failed, deleting" % (name,))
- local.delete(name)
-
-def recvfile_real(local, remote, name):
- try:
- local.create(name)
- except (IOError, os.error) as msg:
- print("cannot create:", msg)
- return
-
- print("receiving ...", end=' ')
- fl()
-
- f = open(name, 'w')
- t1 = time.time()
-
- length = 4*1024
- offset = 0
- id = remote._send('read', name, offset, length)
- remote._flush()
- while 1:
- newoffset = offset + length
- newid = remote._send('read', name, newoffset, length)
- data = remote._recv(id)
- id = newid
- if not data: break
- f.seek(offset)
- f.write(data)
- offset = newoffset
- size = f.tell()
-
- t2 = time.time()
- f.close()
-
- dt = t2-t1
- print(size, "bytes in", round(dt), "seconds", end=' ')
- if dt:
- print("i.e.", int(size//dt), "bytes/sec", end=' ')
- print()
- remote._recv(id) # ignored
-
-def fl():
- sys.stdout.flush()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/pdist/cvslib.py b/Demo/pdist/cvslib.py
deleted file mode 100755
index 78e4fbb4c9..0000000000
--- a/Demo/pdist/cvslib.py
+++ /dev/null
@@ -1,359 +0,0 @@
-"""Utilities for CVS administration."""
-
-import string
-import os
-import time
-import md5
-import fnmatch
-
-if not hasattr(time, 'timezone'):
- time.timezone = 0
-
-class File:
-
- """Represent a file's status.
-
- Instance variables:
-
- file -- the filename (no slashes), None if uninitialized
- lseen -- true if the data for the local file is up to date
- eseen -- true if the data from the CVS/Entries entry is up to date
- (this implies that the entry must be written back)
- rseen -- true if the data for the remote file is up to date
- proxy -- RCSProxy instance used to contact the server, or None
-
- Note that lseen and rseen don't necessary mean that a local
- or remote file *exists* -- they indicate that we've checked it.
- However, eseen means that this instance corresponds to an
- entry in the CVS/Entries file.
-
- If lseen is true:
-
- lsum -- checksum of the local file, None if no local file
- lctime -- ctime of the local file, None if no local file
- lmtime -- mtime of the local file, None if no local file
-
- If eseen is true:
-
- erev -- revision, None if this is a no revision (not '0')
- enew -- true if this is an uncommitted added file
- edeleted -- true if this is an uncommitted removed file
- ectime -- ctime of last local file corresponding to erev
- emtime -- mtime of last local file corresponding to erev
- extra -- 5th string from CVS/Entries file
-
- If rseen is true:
-
- rrev -- revision of head, None if non-existent
- rsum -- checksum of that revision, Non if non-existent
-
- If eseen and rseen are both true:
-
- esum -- checksum of revision erev, None if no revision
-
- Note
- """
-
- def __init__(self, file = None):
- if file and '/' in file:
- raise ValueError("no slash allowed in file")
- self.file = file
- self.lseen = self.eseen = self.rseen = 0
- self.proxy = None
-
- def __cmp__(self, other):
- return cmp(self.file, other.file)
-
- def getlocal(self):
- try:
- self.lmtime, self.lctime = os.stat(self.file)[-2:]
- except os.error:
- self.lmtime = self.lctime = self.lsum = None
- else:
- self.lsum = md5.new(open(self.file).read()).digest()
- self.lseen = 1
-
- def getentry(self, line):
- words = string.splitfields(line, '/')
- if self.file and words[1] != self.file:
- raise ValueError("file name mismatch")
- self.file = words[1]
- self.erev = words[2]
- self.edeleted = 0
- self.enew = 0
- self.ectime = self.emtime = None
- if self.erev[:1] == '-':
- self.edeleted = 1
- self.erev = self.erev[1:]
- if self.erev == '0':
- self.erev = None
- self.enew = 1
- else:
- dates = words[3]
- self.ectime = unctime(dates[:24])
- self.emtime = unctime(dates[25:])
- self.extra = words[4]
- if self.rseen:
- self.getesum()
- self.eseen = 1
-
- def getremote(self, proxy = None):
- if proxy:
- self.proxy = proxy
- try:
- self.rrev = self.proxy.head(self.file)
- except (os.error, IOError):
- self.rrev = None
- if self.rrev:
- self.rsum = self.proxy.sum(self.file)
- else:
- self.rsum = None
- if self.eseen:
- self.getesum()
- self.rseen = 1
-
- def getesum(self):
- if self.erev == self.rrev:
- self.esum = self.rsum
- elif self.erev:
- name = (self.file, self.erev)
- self.esum = self.proxy.sum(name)
- else:
- self.esum = None
-
- def putentry(self):
- """Return a line suitable for inclusion in CVS/Entries.
-
- The returned line is terminated by a newline.
- If no entry should be written for this file,
- return "".
- """
- if not self.eseen:
- return ""
-
- rev = self.erev or '0'
- if self.edeleted:
- rev = '-' + rev
- if self.enew:
- dates = 'Initial ' + self.file
- else:
- dates = gmctime(self.ectime) + ' ' + \
- gmctime(self.emtime)
- return "/%s/%s/%s/%s/\n" % (
- self.file,
- rev,
- dates,
- self.extra)
-
- def report(self):
- print('-'*50)
- def r(key, repr=repr, self=self):
- try:
- value = repr(getattr(self, key))
- except AttributeError:
- value = "?"
- print("%-15s:" % key, value)
- r("file")
- if self.lseen:
- r("lsum", hexify)
- r("lctime", gmctime)
- r("lmtime", gmctime)
- if self.eseen:
- r("erev")
- r("enew")
- r("edeleted")
- r("ectime", gmctime)
- r("emtime", gmctime)
- if self.rseen:
- r("rrev")
- r("rsum", hexify)
- if self.eseen:
- r("esum", hexify)
-
-
-class CVS:
-
- """Represent the contents of a CVS admin file (and more).
-
- Class variables:
-
- FileClass -- the class to be instantiated for entries
- (this should be derived from class File above)
- IgnoreList -- shell patterns for local files to be ignored
-
- Instance variables:
-
- entries -- a dictionary containing File instances keyed by
- their file name
- proxy -- an RCSProxy instance, or None
- """
-
- FileClass = File
-
- IgnoreList = ['.*', '@*', ',*', '*~', '*.o', '*.a', '*.so', '*.pyc']
-
- def __init__(self):
- self.entries = {}
- self.proxy = None
-
- def setproxy(self, proxy):
- if proxy is self.proxy:
- return
- self.proxy = proxy
- for e in list(self.entries.values()):
- e.rseen = 0
-
- def getentries(self):
- """Read the contents of CVS/Entries"""
- self.entries = {}
- f = self.cvsopen("Entries")
- while 1:
- line = f.readline()
- if not line: break
- e = self.FileClass()
- e.getentry(line)
- self.entries[e.file] = e
- f.close()
-
- def putentries(self):
- """Write CVS/Entries back"""
- f = self.cvsopen("Entries", 'w')
- for e in list(self.values()):
- f.write(e.putentry())
- f.close()
-
- def getlocalfiles(self):
- entries_keys = set(self.entries.keys())
- addlist = os.listdir(os.curdir)
- for name in addlist:
- if not self.ignored(name):
- entries_keys.add(name)
- for file in sorted(entries_keys):
- try:
- e = self.entries[file]
- except KeyError:
- e = self.entries[file] = self.FileClass(file)
- e.getlocal()
-
- def getremotefiles(self, proxy = None):
- if proxy:
- self.proxy = proxy
- if not self.proxy:
- raise RuntimeError("no RCS proxy")
- addlist = self.proxy.listfiles()
- for file in addlist:
- try:
- e = self.entries[file]
- except KeyError:
- e = self.entries[file] = self.FileClass(file)
- e.getremote(self.proxy)
-
- def report(self):
- for e in list(self.values()):
- e.report()
- print('-'*50)
-
- def keys(self):
- return sorted(self.entries.keys())
-
- def values(self):
- def value(key, self=self):
- return self.entries[key]
- return [value(k) for k in self.keys()]
-
- def items(self):
- def item(key, self=self):
- return (key, self.entries[key])
- return [item(k) for k in self.keys()]
-
- def cvsexists(self, file):
- file = os.path.join("CVS", file)
- return os.path.exists(file)
-
- def cvsopen(self, file, mode = 'r'):
- file = os.path.join("CVS", file)
- if 'r' not in mode:
- self.backup(file)
- return open(file, mode)
-
- def backup(self, file):
- if os.path.isfile(file):
- bfile = file + '~'
- try: os.unlink(bfile)
- except os.error: pass
- os.rename(file, bfile)
-
- def ignored(self, file):
- if os.path.isdir(file): return True
- for pat in self.IgnoreList:
- if fnmatch.fnmatch(file, pat): return True
- return False
-
-
-# hexify and unhexify are useful to print MD5 checksums in hex format
-
-hexify_format = '%02x' * 16
-def hexify(sum):
- "Return a hex representation of a 16-byte string (e.g. an MD5 digest)"
- if sum is None:
- return "None"
- return hexify_format % tuple(map(ord, sum))
-
-def unhexify(hexsum):
- "Return the original from a hexified string"
- if hexsum == "None":
- return None
- sum = ''
- for i in range(0, len(hexsum), 2):
- sum = sum + chr(string.atoi(hexsum[i:i+2], 16))
- return sum
-
-
-unctime_monthmap = {}
-def unctime(date):
- if date == "None": return None
- if not unctime_monthmap:
- months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
- i = 0
- for m in months:
- i = i+1
- unctime_monthmap[m] = i
- words = string.split(date) # Day Mon DD HH:MM:SS YEAR
- year = string.atoi(words[4])
- month = unctime_monthmap[words[1]]
- day = string.atoi(words[2])
- [hh, mm, ss] = list(map(string.atoi, string.splitfields(words[3], ':')))
- ss = ss - time.timezone
- return time.mktime((year, month, day, hh, mm, ss, 0, 0, 0))
-
-def gmctime(t):
- if t is None: return "None"
- return time.asctime(time.gmtime(t))
-
-def test_unctime():
- now = int(time.time())
- t = time.gmtime(now)
- at = time.asctime(t)
- print('GMT', now, at)
- print('timezone', time.timezone)
- print('local', time.ctime(now))
- u = unctime(at)
- print('unctime()', u)
- gu = time.gmtime(u)
- print('->', gu)
- print(time.asctime(gu))
-
-def test():
- x = CVS()
- x.getentries()
- x.getlocalfiles()
-## x.report()
- import rcsclient
- proxy = rcsclient.openrcsclient()
- x.getremotefiles(proxy)
- x.report()
-
-
-if __name__ == "__main__":
- test()
diff --git a/Demo/pdist/cvslock.py b/Demo/pdist/cvslock.py
deleted file mode 100755
index ffaa15e1d3..0000000000
--- a/Demo/pdist/cvslock.py
+++ /dev/null
@@ -1,279 +0,0 @@
-"""CVS locking algorithm.
-
-CVS locking strategy
-====================
-
-As reverse engineered from the CVS 1.3 sources (file lock.c):
-
-- Locking is done on a per repository basis (but a process can hold
-write locks for multiple directories); all lock files are placed in
-the repository and have names beginning with "#cvs.".
-
-- Before even attempting to lock, a file "#cvs.tfl.<pid>" is created
-(and removed again), to test that we can write the repository. [The
-algorithm can still be fooled (1) if the repository's mode is changed
-while attempting to lock; (2) if this file exists and is writable but
-the directory is not.]
-
-- While creating the actual read/write lock files (which may exist for
-a long time), a "meta-lock" is held. The meta-lock is a directory
-named "#cvs.lock" in the repository. The meta-lock is also held while
-a write lock is held.
-
-- To set a read lock:
-
- - acquire the meta-lock
- - create the file "#cvs.rfl.<pid>"
- - release the meta-lock
-
-- To set a write lock:
-
- - acquire the meta-lock
- - check that there are no files called "#cvs.rfl.*"
- - if there are, release the meta-lock, sleep, try again
- - create the file "#cvs.wfl.<pid>"
-
-- To release a write lock:
-
- - remove the file "#cvs.wfl.<pid>"
- - rmdir the meta-lock
-
-- To release a read lock:
-
- - remove the file "#cvs.rfl.<pid>"
-
-
-Additional notes
-----------------
-
-- A process should read-lock at most one repository at a time.
-
-- A process may write-lock as many repositories as it wishes (to avoid
-deadlocks, I presume it should always lock them top-down in the
-directory hierarchy).
-
-- A process should make sure it removes all its lock files and
-directories when it crashes.
-
-- Limitation: one user id should not be committing files into the same
-repository at the same time.
-
-
-Turn this into Python code
---------------------------
-
-rl = ReadLock(repository, waittime)
-
-wl = WriteLock(repository, waittime)
-
-list = MultipleWriteLock([repository1, repository2, ...], waittime)
-
-"""
-
-
-import os
-import time
-import stat
-import pwd
-
-
-# Default wait time
-DELAY = 10
-
-
-# XXX This should be the same on all Unix versions
-EEXIST = 17
-
-
-# Files used for locking (must match cvs.h in the CVS sources)
-CVSLCK = "#cvs.lck"
-CVSRFL = "#cvs.rfl."
-CVSWFL = "#cvs.wfl."
-
-
-class Error:
-
- def __init__(self, msg):
- self.msg = msg
-
- def __repr__(self):
- return repr(self.msg)
-
- def __str__(self):
- return str(self.msg)
-
-
-class Locked(Error):
- pass
-
-
-class Lock:
-
- def __init__(self, repository = ".", delay = DELAY):
- self.repository = repository
- self.delay = delay
- self.lockdir = None
- self.lockfile = None
- pid = repr(os.getpid())
- self.cvslck = self.join(CVSLCK)
- self.cvsrfl = self.join(CVSRFL + pid)
- self.cvswfl = self.join(CVSWFL + pid)
-
- def __del__(self):
- print("__del__")
- self.unlock()
-
- def setlockdir(self):
- while 1:
- try:
- self.lockdir = self.cvslck
- os.mkdir(self.cvslck, 0o777)
- return
- except os.error as msg:
- self.lockdir = None
- if msg.args[0] == EEXIST:
- try:
- st = os.stat(self.cvslck)
- except os.error:
- continue
- self.sleep(st)
- continue
- raise Error("failed to lock %s: %s" % (
- self.repository, msg))
-
- def unlock(self):
- self.unlockfile()
- self.unlockdir()
-
- def unlockfile(self):
- if self.lockfile:
- print("unlink", self.lockfile)
- try:
- os.unlink(self.lockfile)
- except os.error:
- pass
- self.lockfile = None
-
- def unlockdir(self):
- if self.lockdir:
- print("rmdir", self.lockdir)
- try:
- os.rmdir(self.lockdir)
- except os.error:
- pass
- self.lockdir = None
-
- def sleep(self, st):
- sleep(st, self.repository, self.delay)
-
- def join(self, name):
- return os.path.join(self.repository, name)
-
-
-def sleep(st, repository, delay):
- if delay <= 0:
- raise Locked(st)
- uid = st[stat.ST_UID]
- try:
- pwent = pwd.getpwuid(uid)
- user = pwent[0]
- except KeyError:
- user = "uid %d" % uid
- print("[%s]" % time.ctime(time.time())[11:19], end=' ')
- print("Waiting for %s's lock in" % user, repository)
- time.sleep(delay)
-
-
-class ReadLock(Lock):
-
- def __init__(self, repository, delay = DELAY):
- Lock.__init__(self, repository, delay)
- ok = 0
- try:
- self.setlockdir()
- self.lockfile = self.cvsrfl
- fp = open(self.lockfile, 'w')
- fp.close()
- ok = 1
- finally:
- if not ok:
- self.unlockfile()
- self.unlockdir()
-
-
-class WriteLock(Lock):
-
- def __init__(self, repository, delay = DELAY):
- Lock.__init__(self, repository, delay)
- self.setlockdir()
- while 1:
- uid = self.readers_exist()
- if not uid:
- break
- self.unlockdir()
- self.sleep(uid)
- self.lockfile = self.cvswfl
- fp = open(self.lockfile, 'w')
- fp.close()
-
- def readers_exist(self):
- n = len(CVSRFL)
- for name in os.listdir(self.repository):
- if name[:n] == CVSRFL:
- try:
- st = os.stat(self.join(name))
- except os.error:
- continue
- return st
- return None
-
-
-def MultipleWriteLock(repositories, delay = DELAY):
- while 1:
- locks = []
- for r in repositories:
- try:
- locks.append(WriteLock(r, 0))
- except Locked as instance:
- del locks
- break
- else:
- break
- sleep(instance.msg, r, delay)
- return list
-
-
-def test():
- import sys
- if sys.argv[1:]:
- repository = sys.argv[1]
- else:
- repository = "."
- rl = None
- wl = None
- try:
- print("attempting write lock ...")
- wl = WriteLock(repository)
- print("got it.")
- wl.unlock()
- print("attempting read lock ...")
- rl = ReadLock(repository)
- print("got it.")
- rl.unlock()
- finally:
- print([1])
- print([2])
- if rl:
- rl.unlock()
- print([3])
- if wl:
- wl.unlock()
- print([4])
- rl = None
- print([5])
- wl = None
- print([6])
-
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/pdist/mac.py b/Demo/pdist/mac.py
deleted file mode 100755
index beb77ec6f9..0000000000
--- a/Demo/pdist/mac.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import sys
-import rcvs
-
-def raw_input(prompt):
- sys.stdout.write(prompt)
- sys.stdout.flush()
- return sys.stdin.readline()
-
-def main():
- while 1:
- try:
- line = input('$ ')
- except EOFError:
- break
- words = line.split()
- if not words:
- continue
- if words[0] != 'rcvs':
- words.insert(0, 'rcvs')
- sys.argv = words
- rcvs.main()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/pdist/makechangelog.py b/Demo/pdist/makechangelog.py
deleted file mode 100755
index db66e8f6a9..0000000000
--- a/Demo/pdist/makechangelog.py
+++ /dev/null
@@ -1,109 +0,0 @@
-#! /usr/bin/env python
-
-"""Turn a pile of RCS log output into ChangeLog file entries.
-
-"""
-
-import sys
-import string
-import re
-import getopt
-import time
-
-def main():
- args = sys.argv[1:]
- opts, args = getopt.getopt(args, 'p:')
- prefix = ''
- for o, a in opts:
- if p == '-p': prefix = a
-
- f = sys.stdin
- allrevs = []
- while 1:
- file = getnextfile(f)
- if not file: break
- revs = []
- while 1:
- rev = getnextrev(f, file)
- if not rev:
- break
- revs.append(rev)
- if revs:
- allrevs[len(allrevs):] = revs
- allrevs.sort()
- allrevs.reverse()
- for rev in allrevs:
- formatrev(rev, prefix)
-
-parsedateprog = re.compile(
- '^date: ([0-9]+)/([0-9]+)/([0-9]+) ' +
- '([0-9]+):([0-9]+):([0-9]+); author: ([^ ;]+)')
-
-authormap = {
- 'guido': 'Guido van Rossum <guido@cnri.reston.va.us>',
- 'jack': 'Jack Jansen <jack@cwi.nl>',
- 'sjoerd': 'Sjoerd Mullender <sjoerd@cwi.nl>',
- }
-
-def formatrev(rev, prefix):
- dateline, file, revline, log = rev
- if parsedateprog.match(dateline) >= 0:
- fields = parsedateprog.group(1, 2, 3, 4, 5, 6)
- author = parsedateprog.group(7)
- if author in authormap: author = authormap[author]
- tfields = list(map(string.atoi, fields)) + [0, 0, 0]
- tfields[5] = tfields[5] - time.timezone
- t = time.mktime(tuple(tfields))
- print(time.ctime(t), '', author)
- words = string.split(log)
- words[:0] = ['*', prefix + file + ':']
- maxcol = 72-8
- col = maxcol
- for word in words:
- if col > 0 and col + len(word) >= maxcol:
- print()
- print('\t' + word, end=' ')
- col = -1
- else:
- print(word, end=' ')
- col = col + 1 + len(word)
- print()
- print()
-
-startprog = re.compile("^Working file: (.*)$")
-
-def getnextfile(f):
- while 1:
- line = f.readline()
- if not line: return None
- if startprog.match(line) >= 0:
- file = startprog.group(1)
- # Skip until first revision
- while 1:
- line = f.readline()
- if not line: return None
- if line[:10] == '='*10: return None
- if line[:10] == '-'*10: break
-## print "Skipped", line,
- return file
-## else:
-## print "Ignored", line,
-
-def getnextrev(f, file):
- # This is called when we are positioned just after a '---' separator
- revline = f.readline()
- dateline = f.readline()
- log = ''
- while 1:
- line = f.readline()
- if not line: break
- if line[:10] == '='*10:
- # Ignore the *last* log entry for each file since it
- # is the revision since which we are logging.
- return None
- if line[:10] == '-'*10: break
- log = log + line
- return dateline, file, revline, log
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/pdist/rcsbump b/Demo/pdist/rcsbump
deleted file mode 100755
index 4fa078e740..0000000000
--- a/Demo/pdist/rcsbump
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-# -*- python -*-
-#
-# guido's version, from rcsbump,v 1.2 1995/06/22 21:27:27 bwarsaw Exp
-#
-# Python script for bumping up an RCS major revision number.
-
-import sys
-import re
-import rcslib
-import string
-
-WITHLOCK = 1
-majorrev_re = re.compile('^[0-9]+')
-
-dir = rcslib.RCS()
-
-if sys.argv[1:]:
- files = sys.argv[1:]
-else:
- files = dir.listfiles()
-
-for file in files:
- # get the major revnumber of the file
- headbranch = dir.info(file)['head']
- majorrev_re.match(headbranch)
- majorrev = string.atoi(majorrev_re.group(0)) + 1
-
- if not dir.islocked(file):
- dir.checkout(file, WITHLOCK)
-
- msg = "Bumping major revision number (to %d)" % majorrev
- dir.checkin((file, "%s.0" % majorrev), msg, "-f")
diff --git a/Demo/pdist/rcsclient.py b/Demo/pdist/rcsclient.py
deleted file mode 100755
index d8cb004b2f..0000000000
--- a/Demo/pdist/rcsclient.py
+++ /dev/null
@@ -1,71 +0,0 @@
-"""Customize this file to change the default client etc.
-
-(In general, it is probably be better to make local operation the
-default and to require something like an RCSSERVER environment
-variable to enable remote operation.)
-
-"""
-
-import string
-import os
-
-# These defaults don't belong here -- they should be taken from the
-# environment or from a hidden file in the current directory
-
-HOST = 'voorn.cwi.nl'
-PORT = 4127
-VERBOSE = 1
-LOCAL = 0
-
-import client
-
-
-class RCSProxyClient(client.SecureClient):
-
- def __init__(self, address, verbose = client.VERBOSE):
- client.SecureClient.__init__(self, address, verbose)
-
-
-def openrcsclient(opts = []):
- "open an RCSProxy client based on a list of options returned by getopt"
- import RCSProxy
- host = HOST
- port = PORT
- verbose = VERBOSE
- local = LOCAL
- directory = None
- for o, a in opts:
- if o == '-h':
- host = a
- if ':' in host:
- i = string.find(host, ':')
- host, p = host[:i], host[i+1:]
- if p:
- port = string.atoi(p)
- if o == '-p':
- port = string.atoi(a)
- if o == '-d':
- directory = a
- if o == '-v':
- verbose = verbose + 1
- if o == '-q':
- verbose = 0
- if o == '-L':
- local = 1
- if local:
- import RCSProxy
- x = RCSProxy.RCSProxyLocal()
- else:
- address = (host, port)
- x = RCSProxyClient(address, verbose)
- if not directory:
- try:
- directory = open(os.path.join("CVS", "Repository")).readline()
- except IOError:
- pass
- else:
- if directory[-1] == '\n':
- directory = directory[:-1]
- if directory:
- x.cd(directory)
- return x
diff --git a/Demo/pdist/rcslib.py b/Demo/pdist/rcslib.py
deleted file mode 100755
index 9690f3bb7c..0000000000
--- a/Demo/pdist/rcslib.py
+++ /dev/null
@@ -1,334 +0,0 @@
-"""RCS interface module.
-
-Defines the class RCS, which represents a directory with rcs version
-files and (possibly) corresponding work files.
-
-"""
-
-
-import fnmatch
-import os
-import re
-import string
-import tempfile
-
-
-class RCS:
-
- """RCS interface class (local filesystem version).
-
- An instance of this class represents a directory with rcs version
- files and (possible) corresponding work files.
-
- Methods provide access to most rcs operations such as
- checkin/checkout, access to the rcs metadata (revisions, logs,
- branches etc.) as well as some filesystem operations such as
- listing all rcs version files.
-
- XXX BUGS / PROBLEMS
-
- - The instance always represents the current directory so it's not
- very useful to have more than one instance around simultaneously
-
- """
-
- # Characters allowed in work file names
- okchars = string.ascii_letters + string.digits + '-_=+'
-
- def __init__(self):
- """Constructor."""
- pass
-
- def __del__(self):
- """Destructor."""
- pass
-
- # --- Informational methods about a single file/revision ---
-
- def log(self, name_rev, otherflags = ''):
- """Return the full log text for NAME_REV as a string.
-
- Optional OTHERFLAGS are passed to rlog.
-
- """
- f = self._open(name_rev, 'rlog ' + otherflags)
- data = f.read()
- status = self._closepipe(f)
- if status:
- data = data + "%s: %s" % status
- elif data[-1] == '\n':
- data = data[:-1]
- return data
-
- def head(self, name_rev):
- """Return the head revision for NAME_REV"""
- dict = self.info(name_rev)
- return dict['head']
-
- def info(self, name_rev):
- """Return a dictionary of info (from rlog -h) for NAME_REV
-
- The dictionary's keys are the keywords that rlog prints
- (e.g. 'head' and its values are the corresponding data
- (e.g. '1.3').
-
- XXX symbolic names and locks are not returned
-
- """
- f = self._open(name_rev, 'rlog -h')
- dict = {}
- while 1:
- line = f.readline()
- if not line: break
- if line[0] == '\t':
- # XXX could be a lock or symbolic name
- # Anything else?
- continue
- i = string.find(line, ':')
- if i > 0:
- key, value = line[:i], string.strip(line[i+1:])
- dict[key] = value
- status = self._closepipe(f)
- if status:
- raise IOError(status)
- return dict
-
- # --- Methods that change files ---
-
- def lock(self, name_rev):
- """Set an rcs lock on NAME_REV."""
- name, rev = self.checkfile(name_rev)
- cmd = "rcs -l%s %s" % (rev, name)
- return self._system(cmd)
-
- def unlock(self, name_rev):
- """Clear an rcs lock on NAME_REV."""
- name, rev = self.checkfile(name_rev)
- cmd = "rcs -u%s %s" % (rev, name)
- return self._system(cmd)
-
- def checkout(self, name_rev, withlock=0, otherflags=""):
- """Check out NAME_REV to its work file.
-
- If optional WITHLOCK is set, check out locked, else unlocked.
-
- The optional OTHERFLAGS is passed to co without
- interpretation.
-
- Any output from co goes to directly to stdout.
-
- """
- name, rev = self.checkfile(name_rev)
- if withlock: lockflag = "-l"
- else: lockflag = "-u"
- cmd = 'co %s%s %s %s' % (lockflag, rev, otherflags, name)
- return self._system(cmd)
-
- def checkin(self, name_rev, message=None, otherflags=""):
- """Check in NAME_REV from its work file.
-
- The optional MESSAGE argument becomes the checkin message
- (default "<none>" if None); or the file description if this is
- a new file.
-
- The optional OTHERFLAGS argument is passed to ci without
- interpretation.
-
- Any output from ci goes to directly to stdout.
-
- """
- name, rev = self._unmangle(name_rev)
- new = not self.isvalid(name)
- if not message: message = "<none>"
- if message and message[-1] != '\n':
- message = message + '\n'
- lockflag = "-u"
- if new:
- f = tempfile.NamedTemporaryFile()
- f.write(message)
- f.flush()
- cmd = 'ci %s%s -t%s %s %s' % \
- (lockflag, rev, f.name, otherflags, name)
- else:
- message = re.sub(r'([\"$`])', r'\\\1', message)
- cmd = 'ci %s%s -m"%s" %s %s' % \
- (lockflag, rev, message, otherflags, name)
- return self._system(cmd)
-
- # --- Exported support methods ---
-
- def listfiles(self, pat = None):
- """Return a list of all version files matching optional PATTERN."""
- files = os.listdir(os.curdir)
- files = list(filter(self._isrcs, files))
- if os.path.isdir('RCS'):
- files2 = os.listdir('RCS')
- files2 = list(filter(self._isrcs, files2))
- files = files + files2
- files = list(map(self.realname, files))
- return self._filter(files, pat)
-
- def isvalid(self, name):
- """Test whether NAME has a version file associated."""
- namev = self.rcsname(name)
- return (os.path.isfile(namev) or
- os.path.isfile(os.path.join('RCS', namev)))
-
- def rcsname(self, name):
- """Return the pathname of the version file for NAME.
-
- The argument can be a work file name or a version file name.
- If the version file does not exist, the name of the version
- file that would be created by "ci" is returned.
-
- """
- if self._isrcs(name): namev = name
- else: namev = name + ',v'
- if os.path.isfile(namev): return namev
- namev = os.path.join('RCS', os.path.basename(namev))
- if os.path.isfile(namev): return namev
- if os.path.isdir('RCS'):
- return os.path.join('RCS', namev)
- else:
- return namev
-
- def realname(self, namev):
- """Return the pathname of the work file for NAME.
-
- The argument can be a work file name or a version file name.
- If the work file does not exist, the name of the work file
- that would be created by "co" is returned.
-
- """
- if self._isrcs(namev): name = namev[:-2]
- else: name = namev
- if os.path.isfile(name): return name
- name = os.path.basename(name)
- return name
-
- def islocked(self, name_rev):
- """Test whether FILE (which must have a version file) is locked.
-
- XXX This does not tell you which revision number is locked and
- ignores any revision you may pass in (by virtue of using rlog
- -L -R).
-
- """
- f = self._open(name_rev, 'rlog -L -R')
- line = f.readline()
- status = self._closepipe(f)
- if status:
- raise IOError(status)
- if not line: return None
- if line[-1] == '\n':
- line = line[:-1]
- return self.realname(name_rev) == self.realname(line)
-
- def checkfile(self, name_rev):
- """Normalize NAME_REV into a (NAME, REV) tuple.
-
- Raise an exception if there is no corresponding version file.
-
- """
- name, rev = self._unmangle(name_rev)
- if not self.isvalid(name):
- raise os.error('not an rcs file %r' % (name,))
- return name, rev
-
- # --- Internal methods ---
-
- def _open(self, name_rev, cmd = 'co -p', rflag = '-r'):
- """INTERNAL: open a read pipe to NAME_REV using optional COMMAND.
-
- Optional FLAG is used to indicate the revision (default -r).
-
- Default COMMAND is "co -p".
-
- Return a file object connected by a pipe to the command's
- output.
-
- """
- name, rev = self.checkfile(name_rev)
- namev = self.rcsname(name)
- if rev:
- cmd = cmd + ' ' + rflag + rev
- return os.popen("%s %r" % (cmd, namev))
-
- def _unmangle(self, name_rev):
- """INTERNAL: Normalize NAME_REV argument to (NAME, REV) tuple.
-
- Raise an exception if NAME contains invalid characters.
-
- A NAME_REV argument is either NAME string (implying REV='') or
- a tuple of the form (NAME, REV).
-
- """
- if type(name_rev) == type(''):
- name_rev = name, rev = name_rev, ''
- else:
- name, rev = name_rev
- for c in rev:
- if c not in self.okchars:
- raise ValueError("bad char in rev")
- return name_rev
-
- def _closepipe(self, f):
- """INTERNAL: Close PIPE and print its exit status if nonzero."""
- sts = f.close()
- if not sts: return None
- detail, reason = divmod(sts, 256)
- if reason == 0: return 'exit', detail # Exit status
- signal = reason&0x7F
- if signal == 0x7F:
- code = 'stopped'
- signal = detail
- else:
- code = 'killed'
- if reason&0x80:
- code = code + '(coredump)'
- return code, signal
-
- def _system(self, cmd):
- """INTERNAL: run COMMAND in a subshell.
-
- Standard input for the command is taken from /dev/null.
-
- Raise IOError when the exit status is not zero.
-
- Return whatever the calling method should return; normally
- None.
-
- A derived class may override this method and redefine it to
- capture stdout/stderr of the command and return it.
-
- """
- cmd = cmd + " </dev/null"
- sts = os.system(cmd)
- if sts: raise IOError("command exit status %d" % sts)
-
- def _filter(self, files, pat = None):
- """INTERNAL: Return a sorted copy of the given list of FILES.
-
- If a second PATTERN argument is given, only files matching it
- are kept. No check for valid filenames is made.
-
- """
- if pat:
- def keep(name, pat = pat):
- return fnmatch.fnmatch(name, pat)
- files = list(filter(keep, files))
- else:
- files = files[:]
- files.sort()
- return files
-
- def _remove(self, fn):
- """INTERNAL: remove FILE without complaints."""
- try:
- os.unlink(fn)
- except os.error:
- pass
-
- def _isrcs(self, name):
- """INTERNAL: Test whether NAME ends in ',v'."""
- return name[-2:] == ',v'
diff --git a/Demo/pdist/rcvs b/Demo/pdist/rcvs
deleted file mode 100755
index f82a27a204..0000000000
--- a/Demo/pdist/rcvs
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env python
-
-import addpack
-addpack.addpack('/home/guido/src/python/Demo/pdist')
-
-import rcvs
-
-rcvs.main()
diff --git a/Demo/pdist/rcvs.py b/Demo/pdist/rcvs.py
deleted file mode 100755
index 4e2532aa54..0000000000
--- a/Demo/pdist/rcvs.py
+++ /dev/null
@@ -1,476 +0,0 @@
-#! /usr/bin/env python
-
-"""Remote CVS -- command line interface"""
-
-# XXX To do:
-#
-# Bugs:
-# - if the remote file is deleted, "rcvs update" will fail
-#
-# Functionality:
-# - cvs rm
-# - descend into directories (alraedy done for update)
-# - conflict resolution
-# - other relevant commands?
-# - branches
-#
-# - Finesses:
-# - retain file mode's x bits
-# - complain when "nothing known about filename"
-# - edit log message the way CVS lets you edit it
-# - cvs diff -rREVA -rREVB
-# - send mail the way CVS sends it
-#
-# Performance:
-# - cache remote checksums (for every revision ever seen!)
-# - translate symbolic revisions to numeric revisions
-#
-# Reliability:
-# - remote locking
-#
-# Security:
-# - Authenticated RPC?
-
-
-from cvslib import CVS, File
-import md5
-import os
-import sys
-from cmdfw import CommandFrameWork
-
-
-DEF_LOCAL = 1 # Default -l
-
-
-class MyFile(File):
-
- def action(self):
- """Return a code indicating the update status of this file.
-
- The possible return values are:
-
- '=' -- everything's fine
- '0' -- file doesn't exist anywhere
- '?' -- exists locally only
- 'A' -- new locally
- 'R' -- deleted locally
- 'U' -- changed remotely, no changes locally
- (includes new remotely or deleted remotely)
- 'M' -- changed locally, no changes remotely
- 'C' -- conflict: changed locally as well as remotely
- (includes cases where the file has been added
- or removed locally and remotely)
- 'D' -- deleted remotely
- 'N' -- new remotely
- 'r' -- get rid of entry
- 'c' -- create entry
- 'u' -- update entry
-
- (and probably others :-)
- """
- if not self.lseen:
- self.getlocal()
- if not self.rseen:
- self.getremote()
- if not self.eseen:
- if not self.lsum:
- if not self.rsum: return '0' # Never heard of
- else:
- return 'N' # New remotely
- else: # self.lsum
- if not self.rsum: return '?' # Local only
- # Local and remote, but no entry
- if self.lsum == self.rsum:
- return 'c' # Restore entry only
- else: return 'C' # Real conflict
- else: # self.eseen
- if not self.lsum:
- if self.edeleted:
- if self.rsum: return 'R' # Removed
- else: return 'r' # Get rid of entry
- else: # not self.edeleted
- if self.rsum:
- print("warning:", end=' ')
- print(self.file, end=' ')
- print("was lost")
- return 'U'
- else: return 'r' # Get rid of entry
- else: # self.lsum
- if not self.rsum:
- if self.enew: return 'A' # New locally
- else: return 'D' # Deleted remotely
- else: # self.rsum
- if self.enew:
- if self.lsum == self.rsum:
- return 'u'
- else:
- return 'C'
- if self.lsum == self.esum:
- if self.esum == self.rsum:
- return '='
- else:
- return 'U'
- elif self.esum == self.rsum:
- return 'M'
- elif self.lsum == self.rsum:
- return 'u'
- else:
- return 'C'
-
- def update(self):
- code = self.action()
- if code == '=': return
- print(code, self.file)
- if code in ('U', 'N'):
- self.get()
- elif code == 'C':
- print("%s: conflict resolution not yet implemented" % \
- self.file)
- elif code == 'D':
- remove(self.file)
- self.eseen = 0
- elif code == 'r':
- self.eseen = 0
- elif code in ('c', 'u'):
- self.eseen = 1
- self.erev = self.rrev
- self.enew = 0
- self.edeleted = 0
- self.esum = self.rsum
- self.emtime, self.ectime = os.stat(self.file)[-2:]
- self.extra = ''
-
- def commit(self, message = ""):
- code = self.action()
- if code in ('A', 'M'):
- self.put(message)
- return 1
- elif code == 'R':
- print("%s: committing removes not yet implemented" % \
- self.file)
- elif code == 'C':
- print("%s: conflict resolution not yet implemented" % \
- self.file)
-
- def diff(self, opts = []):
- self.action() # To update lseen, rseen
- flags = ''
- rev = self.rrev
- # XXX should support two rev options too!
- for o, a in opts:
- if o == '-r':
- rev = a
- else:
- flags = flags + ' ' + o + a
- if rev == self.rrev and self.lsum == self.rsum:
- return
- flags = flags[1:]
- fn = self.file
- data = self.proxy.get((fn, rev))
- sum = md5.new(data).digest()
- if self.lsum == sum:
- return
- import tempfile
- tf = tempfile.NamedTemporaryFile()
- tf.write(data)
- tf.flush()
- print('diff %s -r%s %s' % (flags, rev, fn))
- sts = os.system('diff %s %s %s' % (flags, tf.name, fn))
- if sts:
- print('='*70)
-
- def commitcheck(self):
- return self.action() != 'C'
-
- def put(self, message = ""):
- print("Checking in", self.file, "...")
- data = open(self.file).read()
- if not self.enew:
- self.proxy.lock(self.file)
- messages = self.proxy.put(self.file, data, message)
- if messages:
- print(messages)
- self.setentry(self.proxy.head(self.file), self.lsum)
-
- def get(self):
- data = self.proxy.get(self.file)
- f = open(self.file, 'w')
- f.write(data)
- f.close()
- self.setentry(self.rrev, self.rsum)
-
- def log(self, otherflags):
- print(self.proxy.log(self.file, otherflags))
-
- def add(self):
- self.eseen = 0 # While we're hacking...
- self.esum = self.lsum
- self.emtime, self.ectime = 0, 0
- self.erev = ''
- self.enew = 1
- self.edeleted = 0
- self.eseen = 1 # Done
- self.extra = ''
-
- def setentry(self, erev, esum):
- self.eseen = 0 # While we're hacking...
- self.esum = esum
- self.emtime, self.ectime = os.stat(self.file)[-2:]
- self.erev = erev
- self.enew = 0
- self.edeleted = 0
- self.eseen = 1 # Done
- self.extra = ''
-
-
-SENDMAIL = "/usr/lib/sendmail -t"
-MAILFORM = """To: %s
-Subject: CVS changes: %s
-
-...Message from rcvs...
-
-Committed files:
- %s
-
-Log message:
- %s
-"""
-
-
-class RCVS(CVS):
-
- FileClass = MyFile
-
- def __init__(self):
- CVS.__init__(self)
-
- def update(self, files):
- for e in self.whichentries(files, 1):
- e.update()
-
- def commit(self, files, message = ""):
- list = self.whichentries(files)
- if not list: return
- ok = 1
- for e in list:
- if not e.commitcheck():
- ok = 0
- if not ok:
- print("correct above errors first")
- return
- if not message:
- message = input("One-liner: ")
- committed = []
- for e in list:
- if e.commit(message):
- committed.append(e.file)
- self.mailinfo(committed, message)
-
- def mailinfo(self, files, message = ""):
- towhom = "sjoerd@cwi.nl, jack@cwi.nl" # XXX
- mailtext = MAILFORM % (towhom, ' '.join(files),
- ' '.join(files), message)
- print('-'*70)
- print(mailtext)
- print('-'*70)
- ok = input("OK to mail to %s? " % towhom)
- if ok.lower().strip() in ('y', 'ye', 'yes'):
- p = os.popen(SENDMAIL, "w")
- p.write(mailtext)
- sts = p.close()
- if sts:
- print("Sendmail exit status %s" % str(sts))
- else:
- print("Mail sent.")
- else:
- print("No mail sent.")
-
- def report(self, files):
- for e in self.whichentries(files):
- e.report()
-
- def diff(self, files, opts):
- for e in self.whichentries(files):
- e.diff(opts)
-
- def add(self, files):
- if not files:
- raise RuntimeError("'cvs add' needs at least one file")
- list = []
- for e in self.whichentries(files, 1):
- e.add()
-
- def rm(self, files):
- if not files:
- raise RuntimeError("'cvs rm' needs at least one file")
- raise RuntimeError("'cvs rm' not yet imlemented")
-
- def log(self, files, opts):
- flags = ''
- for o, a in opts:
- flags = flags + ' ' + o + a
- for e in self.whichentries(files):
- e.log(flags)
-
- def whichentries(self, files, localfilestoo = 0):
- if files:
- list = []
- for file in files:
- if file in self.entries:
- e = self.entries[file]
- else:
- e = self.FileClass(file)
- self.entries[file] = e
- list.append(e)
- else:
- list = list(self.entries.values())
- for file in self.proxy.listfiles():
- if file in self.entries:
- continue
- e = self.FileClass(file)
- self.entries[file] = e
- list.append(e)
- if localfilestoo:
- for file in os.listdir(os.curdir):
- if file not in self.entries \
- and not self.ignored(file):
- e = self.FileClass(file)
- self.entries[file] = e
- list.append(e)
- list.sort()
- if self.proxy:
- for e in list:
- if e.proxy is None:
- e.proxy = self.proxy
- return list
-
-
-class rcvs(CommandFrameWork):
-
- GlobalFlags = 'd:h:p:qvL'
- UsageMessage = \
-"usage: rcvs [-d directory] [-h host] [-p port] [-q] [-v] [subcommand arg ...]"
- PostUsageMessage = \
- "If no subcommand is given, the status of all files is listed"
-
- def __init__(self):
- """Constructor."""
- CommandFrameWork.__init__(self)
- self.proxy = None
- self.cvs = RCVS()
-
- def close(self):
- if self.proxy:
- self.proxy._close()
- self.proxy = None
-
- def recurse(self):
- self.close()
- names = os.listdir(os.curdir)
- for name in names:
- if name == os.curdir or name == os.pardir:
- continue
- if name == "CVS":
- continue
- if not os.path.isdir(name):
- continue
- if os.path.islink(name):
- continue
- print("--- entering subdirectory", name, "---")
- os.chdir(name)
- try:
- if os.path.isdir("CVS"):
- self.__class__().run()
- else:
- self.recurse()
- finally:
- os.chdir(os.pardir)
- print("--- left subdirectory", name, "---")
-
- def options(self, opts):
- self.opts = opts
-
- def ready(self):
- import rcsclient
- self.proxy = rcsclient.openrcsclient(self.opts)
- self.cvs.setproxy(self.proxy)
- self.cvs.getentries()
-
- def default(self):
- self.cvs.report([])
-
- def do_report(self, opts, files):
- self.cvs.report(files)
-
- def do_update(self, opts, files):
- """update [-l] [-R] [file] ..."""
- local = DEF_LOCAL
- for o, a in opts:
- if o == '-l': local = 1
- if o == '-R': local = 0
- self.cvs.update(files)
- self.cvs.putentries()
- if not local and not files:
- self.recurse()
- flags_update = '-lR'
- do_up = do_update
- flags_up = flags_update
-
- def do_commit(self, opts, files):
- """commit [-m message] [file] ..."""
- message = ""
- for o, a in opts:
- if o == '-m': message = a
- self.cvs.commit(files, message)
- self.cvs.putentries()
- flags_commit = 'm:'
- do_com = do_commit
- flags_com = flags_commit
-
- def do_diff(self, opts, files):
- """diff [difflags] [file] ..."""
- self.cvs.diff(files, opts)
- flags_diff = 'cbitwcefhnlr:sD:S:'
- do_dif = do_diff
- flags_dif = flags_diff
-
- def do_add(self, opts, files):
- """add file ..."""
- if not files:
- print("'rcvs add' requires at least one file")
- return
- self.cvs.add(files)
- self.cvs.putentries()
-
- def do_remove(self, opts, files):
- """remove file ..."""
- if not files:
- print("'rcvs remove' requires at least one file")
- return
- self.cvs.remove(files)
- self.cvs.putentries()
- do_rm = do_remove
-
- def do_log(self, opts, files):
- """log [rlog-options] [file] ..."""
- self.cvs.log(files, opts)
- flags_log = 'bhLNRtd:s:V:r:'
-
-
-def remove(fn):
- try:
- os.unlink(fn)
- except os.error:
- pass
-
-
-def main():
- r = rcvs()
- try:
- r.run()
- finally:
- r.close()
-
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/pdist/rrcs b/Demo/pdist/rrcs
deleted file mode 100755
index 31fc2c510e..0000000000
--- a/Demo/pdist/rrcs
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env python
-
-import addpack
-addpack.addpack('/home/guido/src/python/Demo/pdist')
-
-import rrcs
-
-rrcs.main()
diff --git a/Demo/pdist/rrcs.py b/Demo/pdist/rrcs.py
deleted file mode 100755
index 647ecc5c05..0000000000
--- a/Demo/pdist/rrcs.py
+++ /dev/null
@@ -1,158 +0,0 @@
-#! /usr/bin/env python
-
-"Remote RCS -- command line interface"
-
-import sys
-import os
-import getopt
-import string
-import md5
-import tempfile
-from rcsclient import openrcsclient
-
-def main():
- sys.stdout = sys.stderr
- try:
- opts, rest = getopt.getopt(sys.argv[1:], 'h:p:d:qvL')
- if not rest:
- cmd = 'head'
- else:
- cmd, rest = rest[0], rest[1:]
- if cmd not in commands:
- raise getopt.error("unknown command")
- coptset, func = commands[cmd]
- copts, files = getopt.getopt(rest, coptset)
- except getopt.error as msg:
- print(msg)
- print("usage: rrcs [options] command [options] [file] ...")
- print("where command can be:")
- print(" ci|put # checkin the given files")
- print(" co|get # checkout")
- print(" info # print header info")
- print(" head # print revision of head branch")
- print(" list # list filename if valid")
- print(" log # print full log")
- print(" diff # diff rcs file and work file")
- print("if no files are given, all remote rcs files are assumed")
- sys.exit(2)
- x = openrcsclient(opts)
- if not files:
- files = x.listfiles()
- for fn in files:
- try:
- func(x, copts, fn)
- except (IOError, os.error) as msg:
- print("%s: %s" % (fn, msg))
-
-def checkin(x, copts, fn):
- f = open(fn)
- data = f.read()
- f.close()
- new = not x.isvalid(fn)
- if not new and same(x, copts, fn, data):
- print("%s: unchanged since last checkin" % fn)
- return
- print("Checking in", fn, "...")
- message = asklogmessage(new)
- messages = x.put(fn, data, message)
- if messages:
- print(messages)
-
-def checkout(x, copts, fn):
- data = x.get(fn)
- f = open(fn, 'w')
- f.write(data)
- f.close()
-
-def lock(x, copts, fn):
- x.lock(fn)
-
-def unlock(x, copts, fn):
- x.unlock(fn)
-
-def info(x, copts, fn):
- info_dict = x.info(fn)
- for key in sorted(info_dict.keys()):
- print(key + ':', info_dict[key])
- print('='*70)
-
-def head(x, copts, fn):
- head = x.head(fn)
- print(fn, head)
-
-def list(x, copts, fn):
- if x.isvalid(fn):
- print(fn)
-
-def log(x, copts, fn):
- flags = ''
- for o, a in copts:
- flags = flags + ' ' + o + a
- flags = flags[1:]
- messages = x.log(fn, flags)
- print(messages)
-
-def diff(x, copts, fn):
- if same(x, copts, fn):
- return
- flags = ''
- for o, a in copts:
- flags = flags + ' ' + o + a
- flags = flags[1:]
- data = x.get(fn)
- tf = tempfile.NamedTemporaryFile()
- tf.write(data)
- tf.flush()
- print('diff %s -r%s %s' % (flags, x.head(fn), fn))
- sts = os.system('diff %s %s %s' % (flags, tf.name, fn))
- if sts:
- print('='*70)
-
-def same(x, copts, fn, data = None):
- if data is None:
- f = open(fn)
- data = f.read()
- f.close()
- lsum = md5.new(data).digest()
- rsum = x.sum(fn)
- return lsum == rsum
-
-def asklogmessage(new):
- if new:
- print("enter description,", end=' ')
- else:
- print("enter log message,", end=' ')
- print("terminate with single '.' or end of file:")
- if new:
- print("NOTE: This is NOT the log message!")
- message = ""
- while 1:
- sys.stderr.write(">> ")
- sys.stderr.flush()
- line = sys.stdin.readline()
- if not line or line == '.\n': break
- message = message + line
- return message
-
-def remove(fn):
- try:
- os.unlink(fn)
- except os.error:
- pass
-
-commands = {
- 'ci': ('', checkin),
- 'put': ('', checkin),
- 'co': ('', checkout),
- 'get': ('', checkout),
- 'info': ('', info),
- 'head': ('', head),
- 'list': ('', list),
- 'lock': ('', lock),
- 'unlock': ('', unlock),
- 'log': ('bhLRtd:l:r:s:w:V:', log),
- 'diff': ('c', diff),
- }
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/pdist/security.py b/Demo/pdist/security.py
deleted file mode 100755
index ffdbe2d6d4..0000000000
--- a/Demo/pdist/security.py
+++ /dev/null
@@ -1,33 +0,0 @@
-class Security:
-
- def __init__(self):
- import os
- env = os.environ
- if 'PYTHON_KEYFILE' in env:
- keyfile = env['PYTHON_KEYFILE']
- else:
- keyfile = '.python_keyfile'
- if 'HOME' in env:
- keyfile = os.path.join(env['HOME'], keyfile)
- if not os.path.exists(keyfile):
- import sys
- for dir in sys.path:
- kf = os.path.join(dir, keyfile)
- if os.path.exists(kf):
- keyfile = kf
- break
- try:
- self._key = eval(open(keyfile).readline())
- except IOError:
- raise IOError("python keyfile %s: cannot open" % keyfile)
-
- def _generate_challenge(self):
- import random
- return random.randint(100, 100000)
-
- def _compare_challenge_response(self, challenge, response):
- return self._encode_challenge(challenge) == response
-
- def _encode_challenge(self, challenge):
- p, m = self._key
- return pow(int(challenge), p, m)
diff --git a/Demo/pdist/server.py b/Demo/pdist/server.py
deleted file mode 100755
index b3943ff393..0000000000
--- a/Demo/pdist/server.py
+++ /dev/null
@@ -1,143 +0,0 @@
-"""RPC Server module."""
-
-import sys
-import socket
-import pickle
-from fnmatch import fnmatch
-from reprlib import repr
-
-
-# Default verbosity (0 = silent, 1 = print connections, 2 = print requests too)
-VERBOSE = 1
-
-
-class Server:
-
- """RPC Server class. Derive a class to implement a particular service."""
-
- def __init__(self, address, verbose = VERBOSE):
- if type(address) == type(0):
- address = ('', address)
- self._address = address
- self._verbose = verbose
- self._socket = None
- self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self._socket.bind(address)
- self._socket.listen(1)
- self._listening = 1
-
- def _setverbose(self, verbose):
- self._verbose = verbose
-
- def __del__(self):
- self._close()
-
- def _close(self):
- self._listening = 0
- if self._socket:
- self._socket.close()
- self._socket = None
-
- def _serverloop(self):
- while self._listening:
- self._serve()
-
- def _serve(self):
- if self._verbose: print("Wait for connection ...")
- conn, address = self._socket.accept()
- if self._verbose: print("Accepted connection from %s" % repr(address))
- if not self._verify(conn, address):
- print("*** Connection from %s refused" % repr(address))
- conn.close()
- return
- rf = conn.makefile('r')
- wf = conn.makefile('w')
- ok = 1
- while ok:
- wf.flush()
- if self._verbose > 1: print("Wait for next request ...")
- ok = self._dorequest(rf, wf)
-
- _valid = ['192.16.201.*', '192.16.197.*', '132.151.1.*', '129.6.64.*']
-
- def _verify(self, conn, address):
- host, port = address
- for pat in self._valid:
- if fnmatch(host, pat): return 1
- return 0
-
- def _dorequest(self, rf, wf):
- rp = pickle.Unpickler(rf)
- try:
- request = rp.load()
- except EOFError:
- return 0
- if self._verbose > 1: print("Got request: %s" % repr(request))
- try:
- methodname, args, id = request
- if '.' in methodname:
- reply = (None, self._special(methodname, args), id)
- elif methodname[0] == '_':
- raise NameError("illegal method name %s" % repr(methodname))
- else:
- method = getattr(self, methodname)
- reply = (None, method(*args), id)
- except:
- reply = (sys.exc_info()[:2], id)
- if id < 0 and reply[:2] == (None, None):
- if self._verbose > 1: print("Suppress reply")
- return 1
- if self._verbose > 1: print("Send reply: %s" % repr(reply))
- wp = pickle.Pickler(wf)
- wp.dump(reply)
- return 1
-
- def _special(self, methodname, args):
- if methodname == '.methods':
- if not hasattr(self, '_methods'):
- self._methods = tuple(self._listmethods())
- return self._methods
- raise NameError("unrecognized special method name %s" % repr(methodname))
-
- def _listmethods(self, cl=None):
- if not cl: cl = self.__class__
- names = sorted([x for x in cl.__dict__.keys() if x[0] != '_'])
- for base in cl.__bases__:
- basenames = self._listmethods(base)
- basenames = list(filter(lambda x, names=names: x not in names, basenames))
- names[len(names):] = basenames
- return names
-
-
-from security import Security
-
-
-class SecureServer(Server, Security):
-
- def __init__(self, *args):
- Server.__init__(self, *args)
- Security.__init__(self)
-
- def _verify(self, conn, address):
- import string
- challenge = self._generate_challenge()
- conn.send("%d\n" % challenge)
- response = ""
- while "\n" not in response and len(response) < 100:
- data = conn.recv(100)
- if not data:
- break
- response = response + data
- try:
- response = string.atol(string.strip(response))
- except string.atol_error:
- if self._verbose > 0:
- print("Invalid response syntax", repr(response))
- return 0
- if not self._compare_challenge_response(challenge, response):
- if self._verbose > 0:
- print("Invalid response value", repr(response))
- return 0
- if self._verbose > 1:
- print("Response matches challenge. Go ahead!")
- return 1
diff --git a/Demo/pdist/sumtree.py b/Demo/pdist/sumtree.py
deleted file mode 100755
index 92e7771cbf..0000000000
--- a/Demo/pdist/sumtree.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import time
-import sys
-import FSProxy
-
-def main():
- t1 = time.time()
- #proxy = FSProxy.FSProxyClient(('voorn.cwi.nl', 4127))
- proxy = FSProxy.FSProxyLocal()
- sumtree(proxy)
- proxy._close()
- t2 = time.time()
- print(t2-t1, "seconds")
- sys.stdout.write("[Return to exit] ")
- sys.stdout.flush()
- sys.stdin.readline()
-
-def sumtree(proxy):
- print("PWD =", proxy.pwd())
- files = proxy.listfiles()
- proxy.infolist(files)
- subdirs = proxy.listsubdirs()
- for name in subdirs:
- proxy.cd(name)
- sumtree(proxy)
- proxy.back()
-
-main()
diff --git a/Demo/pysvr/Makefile b/Demo/pysvr/Makefile
deleted file mode 100644
index b4b9f3e115..0000000000
--- a/Demo/pysvr/Makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Makefile for 'pysvr' application embedding Python.
-# Tailored for Python 1.5a3 or later.
-# Some details are specific for Solaris or CNRI.
-# Also see ## comments for tailoring.
-
-# Which C compiler
-CC=gcc
-##PURIFY=/usr/local/pure/purify
-LINKCC=$(PURIFY) $(CC)
-
-# Optimization preferences
-OPT=-g
-
-# Which Python version we're using
-VER=2.2
-
-# Expressions using the above definitions
-PYVER=python$(VER)
-
-# Use these defs when compiling against installed Python
-##INST=/usr/local
-##PYC=$(INST)/lib/$(PYVER)/config
-##PYINCL=-I$(INST)/include/$(PYVER) -I$(PYC)
-##PYLIBS=$(PYC)/lib$(PYVER).a
-
-# Use these defs when compiling against built Python
-PLAT=linux
-PYINCL=-I../../Include -I../../$(PLAT)
-PYLIBS=../../$(PLAT)/lib$(PYVER).a
-
-# Libraries to link with -- very installation dependent
-# (See LIBS= in Modules/Makefile in build tree)
-RLLIBS=-lreadline -ltermcap
-OTHERLIBS=-lnsl -lpthread -ldl -lm -ldb -lutil
-
-# Compilation and link flags -- no need to change normally
-CFLAGS=$(OPT)
-CPPFLAGS=$(PYINCL)
-LIBS=$(PYLIBS) $(RLLIBS) $(OTHERLIBS)
-
-# Default port for the pysvr application
-PORT=4000
-
-# Default target
-all: pysvr
-
-# Target to build pysvr
-pysvr: pysvr.o $(PYOBJS) $(PYLIBS)
- $(LINKCC) pysvr.o $(LIBS) -o pysvr
-
-# Target to build and run pysvr
-run: pysvr
- pysvr $(PORT)
-
-# Target to clean up the directory
-clean:
- -rm -f pysvr *.o *~ core
diff --git a/Demo/pysvr/README b/Demo/pysvr/README
deleted file mode 100644
index 5e64e38bb4..0000000000
--- a/Demo/pysvr/README
+++ /dev/null
@@ -1,9 +0,0 @@
-This is an example of a multi-threaded C application embedding a
-Python interpreter.
-
-The particular application is a multi-threaded telnet-like server that
-provides you with a Python prompt (instead of a shell prompt).
-
-The file pysvr.py is a prototype in Python.
-
-THIS APPLICATION IS NOT SECURE -- ONLY USE IT FOR TESTING!
diff --git a/Demo/pysvr/pysvr.c b/Demo/pysvr/pysvr.c
deleted file mode 100644
index 706cd2ae60..0000000000
--- a/Demo/pysvr/pysvr.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/* A multi-threaded telnet-like server that gives a Python prompt.
-
-Usage: pysvr [port]
-
-For security reasons, it only accepts requests from the current host.
-This can still be insecure, but restricts violations from people who
-can log in on your machine. Use with caution!
-
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <pthread.h>
-#include <getopt.h>
-
-/* XXX Umpfh.
- Python.h defines a typedef destructor, which conflicts with pthread.h.
- So Python.h must be included after pthread.h. */
-
-#include "Python.h"
-
-extern int Py_VerboseFlag;
-
-#ifndef PORT
-#define PORT 4000
-#endif
-
-struct workorder {
- int conn;
- struct sockaddr_in addr;
-};
-
-/* Forward */
-static void init_python(void);
-static void usage(void);
-static void oprogname(void);
-static void main_thread(int);
-static void create_thread(int, struct sockaddr_in *);
-static void *service_thread(struct workorder *);
-static void run_interpreter(FILE *, FILE *);
-static int run_command(char *, PyObject *);
-static void ps(void);
-
-static char *progname = "pysvr";
-
-static PyThreadState *gtstate;
-
-main(int argc, char **argv)
-{
- int port = PORT;
- int c;
-
- if (argc > 0 && argv[0] != NULL && argv[0][0] != '\0')
- progname = argv[0];
-
- while ((c = getopt(argc, argv, "v")) != EOF) {
- switch (c) {
- case 'v':
- Py_VerboseFlag++;
- break;
- default:
- usage();
- }
- }
-
- if (optind < argc) {
- if (optind+1 < argc) {
- oprogname();
- fprintf(stderr, "too many arguments\n");
- usage();
- }
- port = atoi(argv[optind]);
- if (port <= 0) {
- fprintf(stderr, "bad port (%s)\n", argv[optind]);
- usage();
- }
- }
-
- main_thread(port);
-
- fprintf(stderr, "Bye.\n");
-
- exit(0);
-}
-
-static char usage_line[] = "usage: %s [port]\n";
-
-static void
-usage(void)
-{
- fprintf(stderr, usage_line, progname);
- exit(2);
-}
-
-static void
-main_thread(int port)
-{
- int sock, conn, size, i;
- struct sockaddr_in addr, clientaddr;
-
- sock = socket(PF_INET, SOCK_STREAM, 0);
- if (sock < 0) {
- oprogname();
- perror("can't create socket");
- exit(1);
- }
-
-#ifdef SO_REUSEADDR
- i = 1;
- setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &i, sizeof i);
-#endif
-
- memset((char *)&addr, '\0', sizeof addr);
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
- addr.sin_addr.s_addr = 0L;
- if (bind(sock, (struct sockaddr *)&addr, sizeof addr) < 0) {
- oprogname();
- perror("can't bind socket to address");
- exit(1);
- }
-
- if (listen(sock, 5) < 0) {
- oprogname();
- perror("can't listen on socket");
- exit(1);
- }
-
- fprintf(stderr, "Listening on port %d...\n", port);
-
- for (i = 0; ; i++) {
- size = sizeof clientaddr;
- memset((char *) &clientaddr, '\0', size);
- conn = accept(sock, (struct sockaddr *) &clientaddr, &size);
- if (conn < 0) {
- oprogname();
- perror("can't accept connection from socket");
- exit(1);
- }
-
- size = sizeof addr;
- memset((char *) &addr, '\0', size);
- if (getsockname(conn, (struct sockaddr *)&addr, &size) < 0) {
- oprogname();
- perror("can't get socket name of connection");
- exit(1);
- }
- if (clientaddr.sin_addr.s_addr != addr.sin_addr.s_addr) {
- oprogname();
- perror("connection from non-local host refused");
- fprintf(stderr, "(addr=%lx, clientaddr=%lx)\n",
- ntohl(addr.sin_addr.s_addr),
- ntohl(clientaddr.sin_addr.s_addr));
- close(conn);
- continue;
- }
- if (i == 4) {
- close(conn);
- break;
- }
- create_thread(conn, &clientaddr);
- }
-
- close(sock);
-
- if (gtstate) {
- PyEval_AcquireThread(gtstate);
- gtstate = NULL;
- Py_Finalize();
- /* And a second time, just because we can. */
- Py_Finalize(); /* This should be harmless. */
- }
- exit(0);
-}
-
-static void
-create_thread(int conn, struct sockaddr_in *addr)
-{
- struct workorder *work;
- pthread_t tdata;
-
- work = malloc(sizeof(struct workorder));
- if (work == NULL) {
- oprogname();
- fprintf(stderr, "out of memory for thread.\n");
- close(conn);
- return;
- }
- work->conn = conn;
- work->addr = *addr;
-
- init_python();
-
- if (pthread_create(&tdata, NULL, (void *)service_thread, work) < 0) {
- oprogname();
- perror("can't create new thread");
- close(conn);
- return;
- }
-
- if (pthread_detach(tdata) < 0) {
- oprogname();
- perror("can't detach from thread");
- }
-}
-
-static PyThreadState *the_tstate;
-static PyInterpreterState *the_interp;
-static PyObject *the_builtins;
-
-static void
-init_python(void)
-{
- if (gtstate)
- return;
- Py_Initialize(); /* Initialize the interpreter */
- PyEval_InitThreads(); /* Create (and acquire) the interpreter lock */
- gtstate = PyEval_SaveThread(); /* Release the thread state */
-}
-
-static void *
-service_thread(struct workorder *work)
-{
- FILE *input, *output;
-
- fprintf(stderr, "Start thread for connection %d.\n", work->conn);
-
- ps();
-
- input = fdopen(work->conn, "r");
- if (input == NULL) {
- oprogname();
- perror("can't create input stream");
- goto done;
- }
-
- output = fdopen(work->conn, "w");
- if (output == NULL) {
- oprogname();
- perror("can't create output stream");
- fclose(input);
- goto done;
- }
-
- setvbuf(input, NULL, _IONBF, 0);
- setvbuf(output, NULL, _IONBF, 0);
-
- run_interpreter(input, output);
-
- fclose(input);
- fclose(output);
-
- done:
- fprintf(stderr, "End thread for connection %d.\n", work->conn);
- close(work->conn);
- free(work);
-}
-
-static void
-oprogname(void)
-{
- int save = errno;
- fprintf(stderr, "%s: ", progname);
- errno = save;
-}
-
-static void
-run_interpreter(FILE *input, FILE *output)
-{
- PyThreadState *tstate;
- PyObject *new_stdin, *new_stdout;
- PyObject *mainmod, *globals;
- char buffer[1000];
- char *p, *q;
- int n, end;
-
- PyEval_AcquireLock();
- tstate = Py_NewInterpreter();
- if (tstate == NULL) {
- fprintf(output, "Sorry -- can't create an interpreter\n");
- return;
- }
-
- mainmod = PyImport_AddModule("__main__");
- globals = PyModule_GetDict(mainmod);
- Py_INCREF(globals);
-
- new_stdin = PyFile_FromFile(input, "<socket-in>", "r", NULL);
- new_stdout = PyFile_FromFile(output, "<socket-out>", "w", NULL);
-
- PySys_SetObject("stdin", new_stdin);
- PySys_SetObject("stdout", new_stdout);
- PySys_SetObject("stderr", new_stdout);
-
- for (n = 1; !PyErr_Occurred(); n++) {
- Py_BEGIN_ALLOW_THREADS
- fprintf(output, "%d> ", n);
- p = fgets(buffer, sizeof buffer, input);
- Py_END_ALLOW_THREADS
-
- if (p == NULL)
- break;
- if (p[0] == '\377' && p[1] == '\354')
- break;
-
- q = strrchr(p, '\r');
- if (q && q[1] == '\n' && q[2] == '\0') {
- *q++ = '\n';
- *q++ = '\0';
- }
-
- while (*p && isspace(*p))
- p++;
- if (p[0] == '#' || p[0] == '\0')
- continue;
-
- end = run_command(buffer, globals);
- if (end < 0)
- PyErr_Print();
-
- if (end)
- break;
- }
-
- Py_XDECREF(globals);
- Py_XDECREF(new_stdin);
- Py_XDECREF(new_stdout);
-
- Py_EndInterpreter(tstate);
- PyEval_ReleaseLock();
-
- fprintf(output, "Goodbye!\n");
-}
-
-static int
-run_command(char *buffer, PyObject *globals)
-{
- PyObject *m, *d, *v;
- fprintf(stderr, "run_command: %s", buffer);
- if (strchr(buffer, '\n') == NULL)
- fprintf(stderr, "\n");
- v = PyRun_String(buffer, Py_single_input, globals, globals);
- if (v == NULL) {
- if (PyErr_Occurred() == PyExc_SystemExit) {
- PyErr_Clear();
- return 1;
- }
- PyErr_Print();
- return 0;
- }
- Py_DECREF(v);
- return 0;
-}
-
-static void
-ps(void)
-{
- char buffer[100];
- PyOS_snprintf(buffer, sizeof(buffer),
- "ps -l -p %d </dev/null | sed 1d\n", getpid());
- system(buffer);
-}
diff --git a/Demo/pysvr/pysvr.py b/Demo/pysvr/pysvr.py
deleted file mode 100755
index 3e94dbe05c..0000000000
--- a/Demo/pysvr/pysvr.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#! /usr/bin/env python
-
-"""A multi-threaded telnet-like server that gives a Python prompt.
-
-This is really a prototype for the same thing in C.
-
-Usage: pysvr.py [port]
-
-For security reasons, it only accepts requests from the current host.
-This can still be insecure, but restricts violations from people who
-can log in on your machine. Use with caution!
-
-"""
-
-import sys, os, string, getopt, _thread, socket, traceback
-
-PORT = 4000 # Default port
-
-def main():
- try:
- opts, args = getopt.getopt(sys.argv[1:], "")
- if len(args) > 1:
- raise getopt.error("Too many arguments.")
- except getopt.error as msg:
- usage(msg)
- for o, a in opts:
- pass
- if args:
- try:
- port = string.atoi(args[0])
- except ValueError as msg:
- usage(msg)
- else:
- port = PORT
- main_thread(port)
-
-def usage(msg=None):
- sys.stdout = sys.stderr
- if msg:
- print(msg)
- print("\n", __doc__, end=' ')
- sys.exit(2)
-
-def main_thread(port):
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.bind(("", port))
- sock.listen(5)
- print("Listening on port", port, "...")
- while 1:
- (conn, addr) = sock.accept()
- if addr[0] != conn.getsockname()[0]:
- conn.close()
- print("Refusing connection from non-local host", addr[0], ".")
- continue
- _thread.start_new_thread(service_thread, (conn, addr))
- del conn, addr
-
-def service_thread(conn, addr):
- (caddr, cport) = addr
- print("Thread %s has connection from %s.\n" % (str(_thread.get_ident()),
- caddr), end=' ')
- stdin = conn.makefile("r")
- stdout = conn.makefile("w", 0)
- run_interpreter(stdin, stdout)
- print("Thread %s is done.\n" % str(_thread.get_ident()), end=' ')
-
-def run_interpreter(stdin, stdout):
- globals = {}
- try:
- str(sys.ps1)
- except:
- sys.ps1 = ">>> "
- source = ""
- while 1:
- stdout.write(sys.ps1)
- line = stdin.readline()
- if line[:2] == '\377\354':
- line = ""
- if not line and not source:
- break
- if line[-2:] == '\r\n':
- line = line[:-2] + '\n'
- source = source + line
- try:
- code = compile_command(source)
- except SyntaxError as err:
- source = ""
- traceback.print_exception(SyntaxError, err, None, file=stdout)
- continue
- if not code:
- continue
- source = ""
- try:
- run_command(code, stdin, stdout, globals)
- except SystemExit as how:
- if how:
- try:
- how = str(how)
- except:
- how = ""
- stdout.write("Exit %s\n" % how)
- break
- stdout.write("\nGoodbye.\n")
-
-def run_command(code, stdin, stdout, globals):
- save = sys.stdin, sys.stdout, sys.stderr
- try:
- sys.stdout = sys.stderr = stdout
- sys.stdin = stdin
- try:
- exec(code, globals)
- except SystemExit as how:
- raise SystemExit(how).with_traceback(sys.exc_info()[2])
- except:
- type, value, tb = sys.exc_info()
- if tb: tb = tb.tb_next
- traceback.print_exception(type, value, tb)
- del tb
- finally:
- sys.stdin, sys.stdout, sys.stderr = save
-
-from code import compile_command
-
-main()
diff --git a/Demo/rpc/MANIFEST b/Demo/rpc/MANIFEST
deleted file mode 100644
index e65f3ebee8..0000000000
--- a/Demo/rpc/MANIFEST
+++ /dev/null
@@ -1,10 +0,0 @@
- File Name Archive # Description
------------------------------------------------------------
- MANIFEST 1 This shipping list
- README 1
- T.py 1
- mountclient.py 1
- nfsclient.py 1
- rpc.py 1
- test 1
- xdr.py 1
diff --git a/Demo/rpc/README b/Demo/rpc/README
deleted file mode 100644
index 97948a3384..0000000000
--- a/Demo/rpc/README
+++ /dev/null
@@ -1,31 +0,0 @@
-This is a Python interface to Sun RPC, designed and implemented mostly
-by reading the Internet RFCs about the subject.
-
-*** NOTE: xdr.py has evolved into the standard module xdrlib.py ***
-
-There are two library modules, xdr.py and rpc.py, and several example
-clients: mountclient.py, nfsclient.py, and rnusersclient.py,
-implementing the NFS Mount protocol, (part of) the NFS protocol, and
-the "rnusers" protocol (used by rusers(1)), respectively. The latter
-demonstrates the use of broadcast via the Port mapper's CALLIT
-procedure.
-
-There is also a way to create servers in Python.
-
-To test the nfs client, run it from the shell with something like this:
-
- python -c 'import nfsclient; nfsclient.test()' [hostname [filesystemname]]
-
-When called without a filesystemname, it lists the filesystems at the
-host; default host is the local machine.
-
-Other clients are tested similarly.
-
-For hostname, use e.g. wuarchive.wustl.edu or gatekeeper.dec.com (two
-hosts that are known to export NFS filesystems with little restrictions).
-
-There are now two different RPC compilers:
-
-1) Wim Lewis rpcgen.py found on http://www.omnigroup.com/~wiml/soft/stale-index.html#python.
-
-2) Peter Åstrands rpcgen.py, which is part of "pynfs" (http://www.cendio.se/~peter/pynfs/).
diff --git a/Demo/rpc/T.py b/Demo/rpc/T.py
deleted file mode 100644
index 33255073e5..0000000000
--- a/Demo/rpc/T.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Simple interface to report execution times of program fragments.
-# Call TSTART() to reset the timer, TSTOP(...) to report times.
-
-import sys, os, time
-
-def TSTART():
- global t0, t1
- u, s, cu, cs = os.times()
- t0 = u+cu, s+cs, time.time()
-
-def TSTOP(*label):
- global t0, t1
- u, s, cu, cs = os.times()
- t1 = u+cu, s+cs, time.time()
- tt = []
- for i in range(3):
- tt.append(t1[i] - t0[i])
- [u, s, r] = tt
- msg = ''
- for x in label: msg = msg + (x + ' ')
- msg = msg + '%r user, %r sys, %r real\n' % (u, s, r)
- sys.stderr.write(msg)
diff --git a/Demo/rpc/mountclient.py b/Demo/rpc/mountclient.py
deleted file mode 100644
index 81797df8ba..0000000000
--- a/Demo/rpc/mountclient.py
+++ /dev/null
@@ -1,202 +0,0 @@
-# Mount RPC client -- RFC 1094 (NFS), Appendix A
-
-# This module demonstrates how to write your own RPC client in Python.
-# When this example was written, there was no RPC compiler for
-# Python. Without such a compiler, you must first create classes
-# derived from Packer and Unpacker to handle the data types for the
-# server you want to interface to. You then write the client class.
-# If you want to support both the TCP and the UDP version of a
-# protocol, use multiple inheritance as shown below.
-
-
-import rpc
-from rpc import Packer, Unpacker, TCPClient, UDPClient
-
-
-# Program number and version for the mount protocol
-MOUNTPROG = 100005
-MOUNTVERS = 1
-
-# Size of the 'fhandle' opaque structure
-FHSIZE = 32
-
-
-# Packer derived class for Mount protocol clients.
-# The only thing we need to pack beyond basic types is an 'fhandle'
-
-class MountPacker(Packer):
-
- def pack_fhandle(self, fhandle):
- self.pack_fopaque(FHSIZE, fhandle)
-
-
-# Unpacker derived class for Mount protocol clients.
-# The important types we need to unpack are fhandle, fhstatus,
-# mountlist and exportlist; mountstruct, exportstruct and groups are
-# used to unpack components of mountlist and exportlist and the
-# corresponding functions are passed as function argument to the
-# generic unpack_list function.
-
-class MountUnpacker(Unpacker):
-
- def unpack_fhandle(self):
- return self.unpack_fopaque(FHSIZE)
-
- def unpack_fhstatus(self):
- status = self.unpack_uint()
- if status == 0:
- fh = self.unpack_fhandle()
- else:
- fh = None
- return status, fh
-
- def unpack_mountlist(self):
- return self.unpack_list(self.unpack_mountstruct)
-
- def unpack_mountstruct(self):
- hostname = self.unpack_string()
- directory = self.unpack_string()
- return (hostname, directory)
-
- def unpack_exportlist(self):
- return self.unpack_list(self.unpack_exportstruct)
-
- def unpack_exportstruct(self):
- filesys = self.unpack_string()
- groups = self.unpack_groups()
- return (filesys, groups)
-
- def unpack_groups(self):
- return self.unpack_list(self.unpack_string)
-
-
-# These are the procedures specific to the Mount client class.
-# Think of this as a derived class of either TCPClient or UDPClient.
-
-class PartialMountClient:
-
- # This method is called by Client.__init__ to initialize
- # self.packer and self.unpacker
- def addpackers(self):
- self.packer = MountPacker()
- self.unpacker = MountUnpacker('')
-
- # This method is called by Client.__init__ to bind the socket
- # to a particular network interface and port. We use the
- # default network interface, but if we're running as root,
- # we want to bind to a reserved port
- def bindsocket(self):
- import os
- try:
- uid = os.getuid()
- except AttributeError:
- uid = 1
- if uid == 0:
- port = rpc.bindresvport(self.sock, '')
- # 'port' is not used
- else:
- self.sock.bind(('', 0))
-
- # This function is called to cough up a suitable
- # authentication object for a call to procedure 'proc'.
- def mkcred(self):
- if self.cred is None:
- self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default()
- return self.cred
-
- # The methods Mnt, Dump etc. each implement one Remote
- # Procedure Call. This is done by calling self.make_call()
- # with as arguments:
- #
- # - the procedure number
- # - the arguments (or None)
- # - the "packer" function for the arguments (or None)
- # - the "unpacker" function for the return value (or None)
- #
- # The packer and unpacker function, if not None, *must* be
- # methods of self.packer and self.unpacker, respectively.
- # A value of None means that there are no arguments or is no
- # return value, respectively.
- #
- # The return value from make_call() is the return value from
- # the remote procedure call, as unpacked by the "unpacker"
- # function, or None if the unpacker function is None.
- #
- # (Even if you expect a result of None, you should still
- # return the return value from make_call(), since this may be
- # needed by a broadcasting version of the class.)
- #
- # If the call fails, make_call() raises an exception
- # (this includes time-outs and invalid results).
- #
- # Note that (at least with the UDP protocol) there is no
- # guarantee that a call is executed at most once. When you do
- # get a reply, you know it has been executed at least once;
- # when you don't get a reply, you know nothing.
-
- def Mnt(self, directory):
- return self.make_call(1, directory, \
- self.packer.pack_string, \
- self.unpacker.unpack_fhstatus)
-
- def Dump(self):
- return self.make_call(2, None, \
- None, self.unpacker.unpack_mountlist)
-
- def Umnt(self, directory):
- return self.make_call(3, directory, \
- self.packer.pack_string, None)
-
- def Umntall(self):
- return self.make_call(4, None, None, None)
-
- def Export(self):
- return self.make_call(5, None, \
- None, self.unpacker.unpack_exportlist)
-
-
-# We turn the partial Mount client into a full one for either protocol
-# by use of multiple inheritance. (In general, when class C has base
-# classes B1...Bn, if x is an instance of class C, methods of x are
-# searched first in C, then in B1, then in B2, ..., finally in Bn.)
-
-class TCPMountClient(PartialMountClient, TCPClient):
-
- def __init__(self, host):
- TCPClient.__init__(self, host, MOUNTPROG, MOUNTVERS)
-
-
-class UDPMountClient(PartialMountClient, UDPClient):
-
- def __init__(self, host):
- UDPClient.__init__(self, host, MOUNTPROG, MOUNTVERS)
-
-
-# A little test program for the Mount client. This takes a host as
-# command line argument (default the local machine), prints its export
-# list, and attempts to mount and unmount each exported files system.
-# An optional first argument of -t or -u specifies the protocol to use
-# (TCP or UDP), default is UDP.
-
-def test():
- import sys
- if sys.argv[1:] and sys.argv[1] == '-t':
- C = TCPMountClient
- del sys.argv[1]
- elif sys.argv[1:] and sys.argv[1] == '-u':
- C = UDPMountClient
- del sys.argv[1]
- else:
- C = UDPMountClient
- if sys.argv[1:]: host = sys.argv[1]
- else: host = ''
- mcl = C(host)
- list = mcl.Export()
- for item in list:
- print(item)
- try:
- mcl.Mnt(item[0])
- except:
- print('Sorry')
- continue
- mcl.Umnt(item[0])
diff --git a/Demo/rpc/nfsclient.py b/Demo/rpc/nfsclient.py
deleted file mode 100644
index a291ce0fc5..0000000000
--- a/Demo/rpc/nfsclient.py
+++ /dev/null
@@ -1,201 +0,0 @@
-# NFS RPC client -- RFC 1094
-
-# XXX This is not yet complete.
-# XXX Only GETATTR, SETTTR, LOOKUP and READDIR are supported.
-
-# (See mountclient.py for some hints on how to write RPC clients in
-# Python in general)
-
-import rpc
-from rpc import UDPClient, TCPClient
-from mountclient import FHSIZE, MountPacker, MountUnpacker
-
-NFS_PROGRAM = 100003
-NFS_VERSION = 2
-
-# enum stat
-NFS_OK = 0
-# (...many error values...)
-
-# enum ftype
-NFNON = 0
-NFREG = 1
-NFDIR = 2
-NFBLK = 3
-NFCHR = 4
-NFLNK = 5
-
-
-class NFSPacker(MountPacker):
-
- def pack_sattrargs(self, sa):
- file, attributes = sa
- self.pack_fhandle(file)
- self.pack_sattr(attributes)
-
- def pack_sattr(self, sa):
- mode, uid, gid, size, atime, mtime = sa
- self.pack_uint(mode)
- self.pack_uint(uid)
- self.pack_uint(gid)
- self.pack_uint(size)
- self.pack_timeval(atime)
- self.pack_timeval(mtime)
-
- def pack_diropargs(self, da):
- dir, name = da
- self.pack_fhandle(dir)
- self.pack_string(name)
-
- def pack_readdirargs(self, ra):
- dir, cookie, count = ra
- self.pack_fhandle(dir)
- self.pack_uint(cookie)
- self.pack_uint(count)
-
- def pack_timeval(self, tv):
- secs, usecs = tv
- self.pack_uint(secs)
- self.pack_uint(usecs)
-
-
-class NFSUnpacker(MountUnpacker):
-
- def unpack_readdirres(self):
- status = self.unpack_enum()
- if status == NFS_OK:
- entries = self.unpack_list(self.unpack_entry)
- eof = self.unpack_bool()
- rest = (entries, eof)
- else:
- rest = None
- return (status, rest)
-
- def unpack_entry(self):
- fileid = self.unpack_uint()
- name = self.unpack_string()
- cookie = self.unpack_uint()
- return (fileid, name, cookie)
-
- def unpack_diropres(self):
- status = self.unpack_enum()
- if status == NFS_OK:
- fh = self.unpack_fhandle()
- fa = self.unpack_fattr()
- rest = (fh, fa)
- else:
- rest = None
- return (status, rest)
-
- def unpack_attrstat(self):
- status = self.unpack_enum()
- if status == NFS_OK:
- attributes = self.unpack_fattr()
- else:
- attributes = None
- return status, attributes
-
- def unpack_fattr(self):
- type = self.unpack_enum()
- mode = self.unpack_uint()
- nlink = self.unpack_uint()
- uid = self.unpack_uint()
- gid = self.unpack_uint()
- size = self.unpack_uint()
- blocksize = self.unpack_uint()
- rdev = self.unpack_uint()
- blocks = self.unpack_uint()
- fsid = self.unpack_uint()
- fileid = self.unpack_uint()
- atime = self.unpack_timeval()
- mtime = self.unpack_timeval()
- ctime = self.unpack_timeval()
- return (type, mode, nlink, uid, gid, size, blocksize, \
- rdev, blocks, fsid, fileid, atime, mtime, ctime)
-
- def unpack_timeval(self):
- secs = self.unpack_uint()
- usecs = self.unpack_uint()
- return (secs, usecs)
-
-
-class NFSClient(UDPClient):
-
- def __init__(self, host):
- UDPClient.__init__(self, host, NFS_PROGRAM, NFS_VERSION)
-
- def addpackers(self):
- self.packer = NFSPacker()
- self.unpacker = NFSUnpacker('')
-
- def mkcred(self):
- if self.cred is None:
- self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default()
- return self.cred
-
- def Getattr(self, fh):
- return self.make_call(1, fh, \
- self.packer.pack_fhandle, \
- self.unpacker.unpack_attrstat)
-
- def Setattr(self, sa):
- return self.make_call(2, sa, \
- self.packer.pack_sattrargs, \
- self.unpacker.unpack_attrstat)
-
- # Root() is obsolete
-
- def Lookup(self, da):
- return self.make_call(4, da, \
- self.packer.pack_diropargs, \
- self.unpacker.unpack_diropres)
-
- # ...
-
- def Readdir(self, ra):
- return self.make_call(16, ra, \
- self.packer.pack_readdirargs, \
- self.unpacker.unpack_readdirres)
-
- # Shorthand to get the entire contents of a directory
- def Listdir(self, dir):
- list = []
- ra = (dir, 0, 2000)
- while 1:
- (status, rest) = self.Readdir(ra)
- if status != NFS_OK:
- break
- entries, eof = rest
- last_cookie = None
- for fileid, name, cookie in entries:
- list.append((fileid, name))
- last_cookie = cookie
- if eof or last_cookie is None:
- break
- ra = (ra[0], last_cookie, ra[2])
- return list
-
-
-def test():
- import sys
- if sys.argv[1:]: host = sys.argv[1]
- else: host = ''
- if sys.argv[2:]: filesys = sys.argv[2]
- else: filesys = None
- from mountclient import UDPMountClient, TCPMountClient
- mcl = TCPMountClient(host)
- if filesys is None:
- list = mcl.Export()
- for item in list:
- print(item)
- return
- sf = mcl.Mnt(filesys)
- print(sf)
- fh = sf[1]
- if fh:
- ncl = NFSClient(host)
- attrstat = ncl.Getattr(fh)
- print(attrstat)
- list = ncl.Listdir(fh)
- for item in list: print(item)
- mcl.Umnt(filesys)
diff --git a/Demo/rpc/rnusersclient.py b/Demo/rpc/rnusersclient.py
deleted file mode 100644
index eaabefe365..0000000000
--- a/Demo/rpc/rnusersclient.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# Remote nusers client interface
-
-import rpc
-from rpc import Packer, Unpacker, UDPClient, BroadcastUDPClient
-
-
-class RnusersPacker(Packer):
- def pack_utmp(self, ui):
- ut_line, ut_name, ut_host, ut_time = utmp
- self.pack_string(ut_line)
- self.pack_string(ut_name)
- self.pack_string(ut_host)
- self.pack_int(ut_time)
- def pack_utmpidle(self, ui):
- ui_itmp, ui_idle = ui
- self.pack_utmp(ui_utmp)
- self.pack_uint(ui_idle)
- def pack_utmpidlearr(self, list):
- self.pack_array(list, self.pack_itmpidle)
-
-
-class RnusersUnpacker(Unpacker):
- def unpack_utmp(self):
- ut_line = self.unpack_string()
- ut_name = self.unpack_string()
- ut_host = self.unpack_string()
- ut_time = self.unpack_int()
- return ut_line, ut_name, ut_host, ut_time
- def unpack_utmpidle(self):
- ui_utmp = self.unpack_utmp()
- ui_idle = self.unpack_uint()
- return ui_utmp, ui_idle
- def unpack_utmpidlearr(self):
- return self.unpack_array(self.unpack_utmpidle)
-
-
-class PartialRnusersClient:
-
- def addpackers(self):
- self.packer = RnusersPacker()
- self.unpacker = RnusersUnpacker('')
-
- def Num(self):
- return self.make_call(1, None, None, self.unpacker.unpack_int)
-
- def Names(self):
- return self.make_call(2, None, \
- None, self.unpacker.unpack_utmpidlearr)
-
- def Allnames(self):
- return self.make_call(3, None, \
- None, self.unpacker.unpack_utmpidlearr)
-
-
-class RnusersClient(PartialRnusersClient, UDPClient):
-
- def __init__(self, host):
- UDPClient.__init__(self, host, 100002, 2)
-
-
-class BroadcastRnusersClient(PartialRnusersClient, BroadcastUDPClient):
-
- def __init__(self, bcastaddr):
- BroadcastUDPClient.__init__(self, bcastaddr, 100002, 2)
-
-
-def test():
- import sys
- if not sys.argv[1:]:
- testbcast()
- return
- else:
- host = sys.argv[1]
- c = RnusersClient(host)
- list = c.Names()
- for (line, name, host, time), idle in list:
- line = strip0(line)
- name = strip0(name)
- host = strip0(host)
- print("%r %r %r %s %s" % (name, host, line, time, idle))
-
-def testbcast():
- c = BroadcastRnusersClient('<broadcast>')
- def listit(list, fromaddr):
- host, port = fromaddr
- print(host + '\t:', end=' ')
- for (line, name, host, time), idle in list:
- print(strip0(name), end=' ')
- print()
- c.set_reply_handler(listit)
- all = c.Names()
- print('Total Count:', len(all))
-
-def strip0(s):
- while s and s[-1] == '\0': s = s[:-1]
- return s
-
-test()
diff --git a/Demo/rpc/rpc.py b/Demo/rpc/rpc.py
deleted file mode 100644
index 30b30177e0..0000000000
--- a/Demo/rpc/rpc.py
+++ /dev/null
@@ -1,890 +0,0 @@
-# Sun RPC version 2 -- RFC1057.
-
-# XXX There should be separate exceptions for the various reasons why
-# XXX an RPC can fail, rather than using RuntimeError for everything
-
-# XXX Need to use class based exceptions rather than string exceptions
-
-# XXX The UDP version of the protocol resends requests when it does
-# XXX not receive a timely reply -- use only for idempotent calls!
-
-# XXX There is no provision for call timeout on TCP connections
-
-import xdr
-import socket
-import os
-
-RPCVERSION = 2
-
-CALL = 0
-REPLY = 1
-
-AUTH_NULL = 0
-AUTH_UNIX = 1
-AUTH_SHORT = 2
-AUTH_DES = 3
-
-MSG_ACCEPTED = 0
-MSG_DENIED = 1
-
-SUCCESS = 0 # RPC executed successfully
-PROG_UNAVAIL = 1 # remote hasn't exported program
-PROG_MISMATCH = 2 # remote can't support version #
-PROC_UNAVAIL = 3 # program can't support procedure
-GARBAGE_ARGS = 4 # procedure can't decode params
-
-RPC_MISMATCH = 0 # RPC version number != 2
-AUTH_ERROR = 1 # remote can't authenticate caller
-
-AUTH_BADCRED = 1 # bad credentials (seal broken)
-AUTH_REJECTEDCRED = 2 # client must begin new session
-AUTH_BADVERF = 3 # bad verifier (seal broken)
-AUTH_REJECTEDVERF = 4 # verifier expired or replayed
-AUTH_TOOWEAK = 5 # rejected for security reasons
-
-
-class Packer(xdr.Packer):
-
- def pack_auth(self, auth):
- flavor, stuff = auth
- self.pack_enum(flavor)
- self.pack_opaque(stuff)
-
- def pack_auth_unix(self, stamp, machinename, uid, gid, gids):
- self.pack_uint(stamp)
- self.pack_string(machinename)
- self.pack_uint(uid)
- self.pack_uint(gid)
- self.pack_uint(len(gids))
- for i in gids:
- self.pack_uint(i)
-
- def pack_callheader(self, xid, prog, vers, proc, cred, verf):
- self.pack_uint(xid)
- self.pack_enum(CALL)
- self.pack_uint(RPCVERSION)
- self.pack_uint(prog)
- self.pack_uint(vers)
- self.pack_uint(proc)
- self.pack_auth(cred)
- self.pack_auth(verf)
- # Caller must add procedure-specific part of call
-
- def pack_replyheader(self, xid, verf):
- self.pack_uint(xid)
- self.pack_enum(REPLY)
- self.pack_uint(MSG_ACCEPTED)
- self.pack_auth(verf)
- self.pack_enum(SUCCESS)
- # Caller must add procedure-specific part of reply
-
-
-# Exceptions
-class BadRPCFormat(Exception): pass
-class BadRPCVersion(Exception): pass
-class GarbageArgs(Exception): pass
-
-class Unpacker(xdr.Unpacker):
-
- def unpack_auth(self):
- flavor = self.unpack_enum()
- stuff = self.unpack_opaque()
- return (flavor, stuff)
-
- def unpack_callheader(self):
- xid = self.unpack_uint()
- temp = self.unpack_enum()
- if temp != CALL:
- raise BadRPCFormat('no CALL but %r' % (temp,))
- temp = self.unpack_uint()
- if temp != RPCVERSION:
- raise BadRPCVersion('bad RPC version %r' % (temp,))
- prog = self.unpack_uint()
- vers = self.unpack_uint()
- proc = self.unpack_uint()
- cred = self.unpack_auth()
- verf = self.unpack_auth()
- return xid, prog, vers, proc, cred, verf
- # Caller must add procedure-specific part of call
-
- def unpack_replyheader(self):
- xid = self.unpack_uint()
- mtype = self.unpack_enum()
- if mtype != REPLY:
- raise RuntimeError('no REPLY but %r' % (mtype,))
- stat = self.unpack_enum()
- if stat == MSG_DENIED:
- stat = self.unpack_enum()
- if stat == RPC_MISMATCH:
- low = self.unpack_uint()
- high = self.unpack_uint()
- raise RuntimeError('MSG_DENIED: RPC_MISMATCH: %r' % ((low, high),))
- if stat == AUTH_ERROR:
- stat = self.unpack_uint()
- raise RuntimeError('MSG_DENIED: AUTH_ERROR: %r' % (stat,))
- raise RuntimeError('MSG_DENIED: %r' % (stat,))
- if stat != MSG_ACCEPTED:
- raise RuntimeError('Neither MSG_DENIED nor MSG_ACCEPTED: %r' % (stat,))
- verf = self.unpack_auth()
- stat = self.unpack_enum()
- if stat == PROG_UNAVAIL:
- raise RuntimeError('call failed: PROG_UNAVAIL')
- if stat == PROG_MISMATCH:
- low = self.unpack_uint()
- high = self.unpack_uint()
- raise RuntimeError('call failed: PROG_MISMATCH: %r' % ((low, high),))
- if stat == PROC_UNAVAIL:
- raise RuntimeError('call failed: PROC_UNAVAIL')
- if stat == GARBAGE_ARGS:
- raise RuntimeError('call failed: GARBAGE_ARGS')
- if stat != SUCCESS:
- raise RuntimeError('call failed: %r' % (stat,))
- return xid, verf
- # Caller must get procedure-specific part of reply
-
-
-# Subroutines to create opaque authentication objects
-
-def make_auth_null():
- return ''
-
-def make_auth_unix(seed, host, uid, gid, groups):
- p = Packer()
- p.pack_auth_unix(seed, host, uid, gid, groups)
- return p.get_buf()
-
-def make_auth_unix_default():
- try:
- from os import getuid, getgid
- uid = getuid()
- gid = getgid()
- except ImportError:
- uid = gid = 0
- import time
- return make_auth_unix(int(time.time()-unix_epoch()), \
- socket.gethostname(), uid, gid, [])
-
-_unix_epoch = -1
-def unix_epoch():
- """Very painful calculation of when the Unix Epoch is.
-
- This is defined as the return value of time.time() on Jan 1st,
- 1970, 00:00:00 GMT.
-
- On a Unix system, this should always return 0.0. On a Mac, the
- calculations are needed -- and hard because of integer overflow
- and other limitations.
-
- """
- global _unix_epoch
- if _unix_epoch >= 0: return _unix_epoch
- import time
- now = time.time()
- localt = time.localtime(now) # (y, m, d, hh, mm, ss, ..., ..., ...)
- gmt = time.gmtime(now)
- offset = time.mktime(localt) - time.mktime(gmt)
- y, m, d, hh, mm, ss = 1970, 1, 1, 0, 0, 0
- offset, ss = divmod(ss + offset, 60)
- offset, mm = divmod(mm + offset, 60)
- offset, hh = divmod(hh + offset, 24)
- d = d + offset
- _unix_epoch = time.mktime((y, m, d, hh, mm, ss, 0, 0, 0))
- print("Unix epoch:", time.ctime(_unix_epoch))
- return _unix_epoch
-
-
-# Common base class for clients
-
-class Client:
-
- def __init__(self, host, prog, vers, port):
- self.host = host
- self.prog = prog
- self.vers = vers
- self.port = port
- self.makesocket() # Assigns to self.sock
- self.bindsocket()
- self.connsocket()
- self.lastxid = 0 # XXX should be more random?
- self.addpackers()
- self.cred = None
- self.verf = None
-
- def close(self):
- self.sock.close()
-
- def makesocket(self):
- # This MUST be overridden
- raise RuntimeError('makesocket not defined')
-
- def connsocket(self):
- # Override this if you don't want/need a connection
- self.sock.connect((self.host, self.port))
-
- def bindsocket(self):
- # Override this to bind to a different port (e.g. reserved)
- self.sock.bind(('', 0))
-
- def addpackers(self):
- # Override this to use derived classes from Packer/Unpacker
- self.packer = Packer()
- self.unpacker = Unpacker('')
-
- def make_call(self, proc, args, pack_func, unpack_func):
- # Don't normally override this (but see Broadcast)
- if pack_func is None and args is not None:
- raise TypeError('non-null args with null pack_func')
- self.start_call(proc)
- if pack_func:
- pack_func(args)
- self.do_call()
- if unpack_func:
- result = unpack_func()
- else:
- result = None
- self.unpacker.done()
- return result
-
- def start_call(self, proc):
- # Don't override this
- self.lastxid = xid = self.lastxid + 1
- cred = self.mkcred()
- verf = self.mkverf()
- p = self.packer
- p.reset()
- p.pack_callheader(xid, self.prog, self.vers, proc, cred, verf)
-
- def do_call(self):
- # This MUST be overridden
- raise RuntimeError('do_call not defined')
-
- def mkcred(self):
- # Override this to use more powerful credentials
- if self.cred is None:
- self.cred = (AUTH_NULL, make_auth_null())
- return self.cred
-
- def mkverf(self):
- # Override this to use a more powerful verifier
- if self.verf is None:
- self.verf = (AUTH_NULL, make_auth_null())
- return self.verf
-
- def call_0(self): # Procedure 0 is always like this
- return self.make_call(0, None, None, None)
-
-
-# Record-Marking standard support
-
-def sendfrag(sock, last, frag):
- x = len(frag)
- if last: x = x | 0x80000000
- header = (chr(int(x>>24 & 0xff)) + chr(int(x>>16 & 0xff)) + \
- chr(int(x>>8 & 0xff)) + chr(int(x & 0xff)))
- sock.send(header + frag)
-
-def sendrecord(sock, record):
- sendfrag(sock, 1, record)
-
-def recvfrag(sock):
- header = sock.recv(4)
- if len(header) < 4:
- raise EOFError
- x = int(ord(header[0]))<<24 | ord(header[1])<<16 | \
- ord(header[2])<<8 | ord(header[3])
- last = ((x & 0x80000000) != 0)
- n = int(x & 0x7fffffff)
- frag = ''
- while n > 0:
- buf = sock.recv(n)
- if not buf: raise EOFError
- n = n - len(buf)
- frag = frag + buf
- return last, frag
-
-def recvrecord(sock):
- record = ''
- last = 0
- while not last:
- last, frag = recvfrag(sock)
- record = record + frag
- return record
-
-
-# Try to bind to a reserved port (must be root)
-
-last_resv_port_tried = None
-def bindresvport(sock, host):
- global last_resv_port_tried
- FIRST, LAST = 600, 1024 # Range of ports to try
- if last_resv_port_tried is None:
- import os
- last_resv_port_tried = FIRST + os.getpid() % (LAST-FIRST)
- for i in range(last_resv_port_tried, LAST) + \
- range(FIRST, last_resv_port_tried):
- last_resv_port_tried = i
- try:
- sock.bind((host, i))
- return last_resv_port_tried
- except socket.error as e:
- (errno, msg) = e
- if errno != 114:
- raise socket.error(errno, msg)
- raise RuntimeError('can\'t assign reserved port')
-
-
-# Client using TCP to a specific port
-
-class RawTCPClient(Client):
-
- def makesocket(self):
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-
- def do_call(self):
- call = self.packer.get_buf()
- sendrecord(self.sock, call)
- reply = recvrecord(self.sock)
- u = self.unpacker
- u.reset(reply)
- xid, verf = u.unpack_replyheader()
- if xid != self.lastxid:
- # Can't really happen since this is TCP...
- raise RuntimeError('wrong xid in reply %r instead of %r' % (
- xid, self.lastxid))
-
-
-# Client using UDP to a specific port
-
-class RawUDPClient(Client):
-
- def makesocket(self):
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-
- def do_call(self):
- call = self.packer.get_buf()
- self.sock.send(call)
- try:
- from select import select
- except ImportError:
- print('WARNING: select not found, RPC may hang')
- select = None
- BUFSIZE = 8192 # Max UDP buffer size
- timeout = 1
- count = 5
- while 1:
- r, w, x = [self.sock], [], []
- if select:
- r, w, x = select(r, w, x, timeout)
- if self.sock not in r:
- count = count - 1
- if count < 0: raise RuntimeError('timeout')
- if timeout < 25: timeout = timeout *2
-## print 'RESEND', timeout, count
- self.sock.send(call)
- continue
- reply = self.sock.recv(BUFSIZE)
- u = self.unpacker
- u.reset(reply)
- xid, verf = u.unpack_replyheader()
- if xid != self.lastxid:
-## print 'BAD xid'
- continue
- break
-
-
-# Client using UDP broadcast to a specific port
-
-class RawBroadcastUDPClient(RawUDPClient):
-
- def __init__(self, bcastaddr, prog, vers, port):
- RawUDPClient.__init__(self, bcastaddr, prog, vers, port)
- self.reply_handler = None
- self.timeout = 30
-
- def connsocket(self):
- # Don't connect -- use sendto
- self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
-
- def set_reply_handler(self, reply_handler):
- self.reply_handler = reply_handler
-
- def set_timeout(self, timeout):
- self.timeout = timeout # Use None for infinite timeout
-
- def make_call(self, proc, args, pack_func, unpack_func):
- if pack_func is None and args is not None:
- raise TypeError('non-null args with null pack_func')
- self.start_call(proc)
- if pack_func:
- pack_func(args)
- call = self.packer.get_buf()
- self.sock.sendto(call, (self.host, self.port))
- try:
- from select import select
- except ImportError:
- print('WARNING: select not found, broadcast will hang')
- select = None
- BUFSIZE = 8192 # Max UDP buffer size (for reply)
- replies = []
- if unpack_func is None:
- def dummy(): pass
- unpack_func = dummy
- while 1:
- r, w, x = [self.sock], [], []
- if select:
- if self.timeout is None:
- r, w, x = select(r, w, x)
- else:
- r, w, x = select(r, w, x, self.timeout)
- if self.sock not in r:
- break
- reply, fromaddr = self.sock.recvfrom(BUFSIZE)
- u = self.unpacker
- u.reset(reply)
- xid, verf = u.unpack_replyheader()
- if xid != self.lastxid:
-## print 'BAD xid'
- continue
- reply = unpack_func()
- self.unpacker.done()
- replies.append((reply, fromaddr))
- if self.reply_handler:
- self.reply_handler(reply, fromaddr)
- return replies
-
-
-# Port mapper interface
-
-# Program number, version and (fixed!) port number
-PMAP_PROG = 100000
-PMAP_VERS = 2
-PMAP_PORT = 111
-
-# Procedure numbers
-PMAPPROC_NULL = 0 # (void) -> void
-PMAPPROC_SET = 1 # (mapping) -> bool
-PMAPPROC_UNSET = 2 # (mapping) -> bool
-PMAPPROC_GETPORT = 3 # (mapping) -> unsigned int
-PMAPPROC_DUMP = 4 # (void) -> pmaplist
-PMAPPROC_CALLIT = 5 # (call_args) -> call_result
-
-# A mapping is (prog, vers, prot, port) and prot is one of:
-
-IPPROTO_TCP = 6
-IPPROTO_UDP = 17
-
-# A pmaplist is a variable-length list of mappings, as follows:
-# either (1, mapping, pmaplist) or (0).
-
-# A call_args is (prog, vers, proc, args) where args is opaque;
-# a call_result is (port, res) where res is opaque.
-
-
-class PortMapperPacker(Packer):
-
- def pack_mapping(self, mapping):
- prog, vers, prot, port = mapping
- self.pack_uint(prog)
- self.pack_uint(vers)
- self.pack_uint(prot)
- self.pack_uint(port)
-
- def pack_pmaplist(self, list):
- self.pack_list(list, self.pack_mapping)
-
- def pack_call_args(self, ca):
- prog, vers, proc, args = ca
- self.pack_uint(prog)
- self.pack_uint(vers)
- self.pack_uint(proc)
- self.pack_opaque(args)
-
-
-class PortMapperUnpacker(Unpacker):
-
- def unpack_mapping(self):
- prog = self.unpack_uint()
- vers = self.unpack_uint()
- prot = self.unpack_uint()
- port = self.unpack_uint()
- return prog, vers, prot, port
-
- def unpack_pmaplist(self):
- return self.unpack_list(self.unpack_mapping)
-
- def unpack_call_result(self):
- port = self.unpack_uint()
- res = self.unpack_opaque()
- return port, res
-
-
-class PartialPortMapperClient:
-
- def addpackers(self):
- self.packer = PortMapperPacker()
- self.unpacker = PortMapperUnpacker('')
-
- def Set(self, mapping):
- return self.make_call(PMAPPROC_SET, mapping, \
- self.packer.pack_mapping, \
- self.unpacker.unpack_uint)
-
- def Unset(self, mapping):
- return self.make_call(PMAPPROC_UNSET, mapping, \
- self.packer.pack_mapping, \
- self.unpacker.unpack_uint)
-
- def Getport(self, mapping):
- return self.make_call(PMAPPROC_GETPORT, mapping, \
- self.packer.pack_mapping, \
- self.unpacker.unpack_uint)
-
- def Dump(self):
- return self.make_call(PMAPPROC_DUMP, None, \
- None, \
- self.unpacker.unpack_pmaplist)
-
- def Callit(self, ca):
- return self.make_call(PMAPPROC_CALLIT, ca, \
- self.packer.pack_call_args, \
- self.unpacker.unpack_call_result)
-
-
-class TCPPortMapperClient(PartialPortMapperClient, RawTCPClient):
-
- def __init__(self, host):
- RawTCPClient.__init__(self, \
- host, PMAP_PROG, PMAP_VERS, PMAP_PORT)
-
-
-class UDPPortMapperClient(PartialPortMapperClient, RawUDPClient):
-
- def __init__(self, host):
- RawUDPClient.__init__(self, \
- host, PMAP_PROG, PMAP_VERS, PMAP_PORT)
-
-
-class BroadcastUDPPortMapperClient(PartialPortMapperClient, \
- RawBroadcastUDPClient):
-
- def __init__(self, bcastaddr):
- RawBroadcastUDPClient.__init__(self, \
- bcastaddr, PMAP_PROG, PMAP_VERS, PMAP_PORT)
-
-
-# Generic clients that find their server through the Port mapper
-
-class TCPClient(RawTCPClient):
-
- def __init__(self, host, prog, vers):
- pmap = TCPPortMapperClient(host)
- port = pmap.Getport((prog, vers, IPPROTO_TCP, 0))
- pmap.close()
- if port == 0:
- raise RuntimeError('program not registered')
- RawTCPClient.__init__(self, host, prog, vers, port)
-
-
-class UDPClient(RawUDPClient):
-
- def __init__(self, host, prog, vers):
- pmap = UDPPortMapperClient(host)
- port = pmap.Getport((prog, vers, IPPROTO_UDP, 0))
- pmap.close()
- if port == 0:
- raise RuntimeError('program not registered')
- RawUDPClient.__init__(self, host, prog, vers, port)
-
-
-class BroadcastUDPClient(Client):
-
- def __init__(self, bcastaddr, prog, vers):
- self.pmap = BroadcastUDPPortMapperClient(bcastaddr)
- self.pmap.set_reply_handler(self.my_reply_handler)
- self.prog = prog
- self.vers = vers
- self.user_reply_handler = None
- self.addpackers()
-
- def close(self):
- self.pmap.close()
-
- def set_reply_handler(self, reply_handler):
- self.user_reply_handler = reply_handler
-
- def set_timeout(self, timeout):
- self.pmap.set_timeout(timeout)
-
- def my_reply_handler(self, reply, fromaddr):
- port, res = reply
- self.unpacker.reset(res)
- result = self.unpack_func()
- self.unpacker.done()
- self.replies.append((result, fromaddr))
- if self.user_reply_handler is not None:
- self.user_reply_handler(result, fromaddr)
-
- def make_call(self, proc, args, pack_func, unpack_func):
- self.packer.reset()
- if pack_func:
- pack_func(args)
- if unpack_func is None:
- def dummy(): pass
- self.unpack_func = dummy
- else:
- self.unpack_func = unpack_func
- self.replies = []
- packed_args = self.packer.get_buf()
- dummy_replies = self.pmap.Callit( \
- (self.prog, self.vers, proc, packed_args))
- return self.replies
-
-
-# Server classes
-
-# These are not symmetric to the Client classes
-# XXX No attempt is made to provide authorization hooks yet
-
-class Server:
-
- def __init__(self, host, prog, vers, port):
- self.host = host # Should normally be '' for default interface
- self.prog = prog
- self.vers = vers
- self.port = port # Should normally be 0 for random port
- self.makesocket() # Assigns to self.sock and self.prot
- self.bindsocket()
- self.host, self.port = self.sock.getsockname()
- self.addpackers()
-
- def register(self):
- mapping = self.prog, self.vers, self.prot, self.port
- p = TCPPortMapperClient(self.host)
- if not p.Set(mapping):
- raise RuntimeError('register failed')
-
- def unregister(self):
- mapping = self.prog, self.vers, self.prot, self.port
- p = TCPPortMapperClient(self.host)
- if not p.Unset(mapping):
- raise RuntimeError('unregister failed')
-
- def handle(self, call):
- # Don't use unpack_header but parse the header piecewise
- # XXX I have no idea if I am using the right error responses!
- self.unpacker.reset(call)
- self.packer.reset()
- xid = self.unpacker.unpack_uint()
- self.packer.pack_uint(xid)
- temp = self.unpacker.unpack_enum()
- if temp != CALL:
- return None # Not worthy of a reply
- self.packer.pack_uint(REPLY)
- temp = self.unpacker.unpack_uint()
- if temp != RPCVERSION:
- self.packer.pack_uint(MSG_DENIED)
- self.packer.pack_uint(RPC_MISMATCH)
- self.packer.pack_uint(RPCVERSION)
- self.packer.pack_uint(RPCVERSION)
- return self.packer.get_buf()
- self.packer.pack_uint(MSG_ACCEPTED)
- self.packer.pack_auth((AUTH_NULL, make_auth_null()))
- prog = self.unpacker.unpack_uint()
- if prog != self.prog:
- self.packer.pack_uint(PROG_UNAVAIL)
- return self.packer.get_buf()
- vers = self.unpacker.unpack_uint()
- if vers != self.vers:
- self.packer.pack_uint(PROG_MISMATCH)
- self.packer.pack_uint(self.vers)
- self.packer.pack_uint(self.vers)
- return self.packer.get_buf()
- proc = self.unpacker.unpack_uint()
- methname = 'handle_' + repr(proc)
- try:
- meth = getattr(self, methname)
- except AttributeError:
- self.packer.pack_uint(PROC_UNAVAIL)
- return self.packer.get_buf()
- cred = self.unpacker.unpack_auth()
- verf = self.unpacker.unpack_auth()
- try:
- meth() # Unpack args, call turn_around(), pack reply
- except (EOFError, GarbageArgs):
- # Too few or too many arguments
- self.packer.reset()
- self.packer.pack_uint(xid)
- self.packer.pack_uint(REPLY)
- self.packer.pack_uint(MSG_ACCEPTED)
- self.packer.pack_auth((AUTH_NULL, make_auth_null()))
- self.packer.pack_uint(GARBAGE_ARGS)
- return self.packer.get_buf()
-
- def turn_around(self):
- try:
- self.unpacker.done()
- except RuntimeError:
- raise GarbageArgs
- self.packer.pack_uint(SUCCESS)
-
- def handle_0(self): # Handle NULL message
- self.turn_around()
-
- def makesocket(self):
- # This MUST be overridden
- raise RuntimeError('makesocket not defined')
-
- def bindsocket(self):
- # Override this to bind to a different port (e.g. reserved)
- self.sock.bind((self.host, self.port))
-
- def addpackers(self):
- # Override this to use derived classes from Packer/Unpacker
- self.packer = Packer()
- self.unpacker = Unpacker('')
-
-
-class TCPServer(Server):
-
- def makesocket(self):
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.prot = IPPROTO_TCP
-
- def loop(self):
- self.sock.listen(0)
- while 1:
- self.session(self.sock.accept())
-
- def session(self, connection):
- sock, (host, port) = connection
- while 1:
- try:
- call = recvrecord(sock)
- except EOFError:
- break
- except socket.error as msg:
- print('socket error:', msg)
- break
- reply = self.handle(call)
- if reply is not None:
- sendrecord(sock, reply)
-
- def forkingloop(self):
- # Like loop but uses forksession()
- self.sock.listen(0)
- while 1:
- self.forksession(self.sock.accept())
-
- def forksession(self, connection):
- # Like session but forks off a subprocess
- import os
- # Wait for deceased children
- try:
- while 1:
- pid, sts = os.waitpid(0, 1)
- except os.error:
- pass
- pid = None
- try:
- pid = os.fork()
- if pid: # Parent
- connection[0].close()
- return
- # Child
- self.session(connection)
- finally:
- # Make sure we don't fall through in the parent
- if pid == 0:
- os._exit(0)
-
-
-class UDPServer(Server):
-
- def makesocket(self):
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- self.prot = IPPROTO_UDP
-
- def loop(self):
- while 1:
- self.session()
-
- def session(self):
- call, host_port = self.sock.recvfrom(8192)
- reply = self.handle(call)
- if reply is not None:
- self.sock.sendto(reply, host_port)
-
-
-# Simple test program -- dump local portmapper status
-
-def test():
- pmap = UDPPortMapperClient('')
- list = pmap.Dump()
- list.sort()
- for prog, vers, prot, port in list:
- print(prog, vers, end=' ')
- if prot == IPPROTO_TCP: print('tcp', end=' ')
- elif prot == IPPROTO_UDP: print('udp', end=' ')
- else: print(prot, end=' ')
- print(port)
-
-
-# Test program for broadcast operation -- dump everybody's portmapper status
-
-def testbcast():
- import sys
- if sys.argv[1:]:
- bcastaddr = sys.argv[1]
- else:
- bcastaddr = '<broadcast>'
- def rh(reply, fromaddr):
- host, port = fromaddr
- print(host + '\t' + repr(reply))
- pmap = BroadcastUDPPortMapperClient(bcastaddr)
- pmap.set_reply_handler(rh)
- pmap.set_timeout(5)
- replies = pmap.Getport((100002, 1, IPPROTO_UDP, 0))
-
-
-# Test program for server, with corresponding client
-# On machine A: python -c 'import rpc; rpc.testsvr()'
-# On machine B: python -c 'import rpc; rpc.testclt()' A
-# (A may be == B)
-
-def testsvr():
- # Simple test class -- proc 1 doubles its string argument as reply
- class S(UDPServer):
- def handle_1(self):
- arg = self.unpacker.unpack_string()
- self.turn_around()
- print('RPC function 1 called, arg', repr(arg))
- self.packer.pack_string(arg + arg)
- #
- s = S('', 0x20000000, 1, 0)
- try:
- s.unregister()
- except RuntimeError as msg:
- print('RuntimeError:', msg, '(ignored)')
- s.register()
- print('Service started...')
- try:
- s.loop()
- finally:
- s.unregister()
- print('Service interrupted.')
-
-
-def testclt():
- import sys
- if sys.argv[1:]: host = sys.argv[1]
- else: host = ''
- # Client for above server
- class C(UDPClient):
- def call_1(self, arg):
- return self.make_call(1, arg, \
- self.packer.pack_string, \
- self.unpacker.unpack_string)
- c = C(host, 0x20000000, 1)
- print('making call...')
- reply = c.call_1('hello, world, ')
- print('call returned', repr(reply))
diff --git a/Demo/rpc/test b/Demo/rpc/test
deleted file mode 100755
index ba220f24a2..0000000000
--- a/Demo/rpc/test
+++ /dev/null
@@ -1,24 +0,0 @@
-: ${PYTHON=python}
-: ${SERVER=charon.cwi.nl}
-
-set -xe
-
-$PYTHON -c 'from rpc import test; test()'
-$PYTHON -c 'from rpc import test; test()' ${SERVER}
-
-$PYTHON -c 'from rpc import testsvr; testsvr()' &
-PID=$!
-sleep 2
-$PYTHON -c 'from rpc import testclt; testclt()'
-kill -2 $PID
-
-$PYTHON -c 'from mountclient import test; test()'
-$PYTHON -c 'from mountclient import test; test()' gatekeeper.dec.com
-
-$PYTHON -c 'from nfsclient import test; test()'
-$PYTHON -c 'from nfsclient import test; test()' gatekeeper.dec.com
-$PYTHON -c 'from nfsclient import test; test()' gatekeeper.dec.com /archive
-
-$PYTHON -c 'from rnusersclient import test; test()' ''
-
-$PYTHON -c 'from rpc import testbcast; testbcast()'
diff --git a/Demo/rpc/xdr.py b/Demo/rpc/xdr.py
deleted file mode 100644
index 2d5f9c3f7c..0000000000
--- a/Demo/rpc/xdr.py
+++ /dev/null
@@ -1,200 +0,0 @@
-# Implement (a subset of) Sun XDR -- RFC1014.
-
-
-try:
- import struct
-except ImportError:
- struct = None
-
-
-Long = type(0)
-
-
-class Packer:
-
- def __init__(self):
- self.reset()
-
- def reset(self):
- self.buf = ''
-
- def get_buf(self):
- return self.buf
-
- def pack_uint(self, x):
- self.buf = self.buf + \
- (chr(int(x>>24 & 0xff)) + chr(int(x>>16 & 0xff)) + \
- chr(int(x>>8 & 0xff)) + chr(int(x & 0xff)))
- if struct and struct.pack('l', 1) == '\0\0\0\1':
- def pack_uint(self, x):
- if type(x) == Long:
- x = int((x + 0x80000000) % 0x100000000 \
- - 0x80000000)
- self.buf = self.buf + struct.pack('l', x)
-
- pack_int = pack_uint
-
- pack_enum = pack_int
-
- def pack_bool(self, x):
- if x: self.buf = self.buf + '\0\0\0\1'
- else: self.buf = self.buf + '\0\0\0\0'
-
- def pack_uhyper(self, x):
- self.pack_uint(int(x>>32 & 0xffffffff))
- self.pack_uint(int(x & 0xffffffff))
-
- pack_hyper = pack_uhyper
-
- def pack_float(self, x):
- # XXX
- self.buf = self.buf + struct.pack('f', x)
-
- def pack_double(self, x):
- # XXX
- self.buf = self.buf + struct.pack('d', x)
-
- def pack_fstring(self, n, s):
- if n < 0:
- raise ValueError('fstring size must be nonnegative')
- n = ((n + 3)//4)*4
- data = s[:n]
- data = data + (n - len(data)) * '\0'
- self.buf = self.buf + data
-
- pack_fopaque = pack_fstring
-
- def pack_string(self, s):
- n = len(s)
- self.pack_uint(n)
- self.pack_fstring(n, s)
-
- pack_opaque = pack_string
-
- def pack_list(self, list, pack_item):
- for item in list:
- self.pack_uint(1)
- pack_item(item)
- self.pack_uint(0)
-
- def pack_farray(self, n, list, pack_item):
- if len(list) != n:
- raise ValueError('wrong array size')
- for item in list:
- pack_item(item)
-
- def pack_array(self, list, pack_item):
- n = len(list)
- self.pack_uint(n)
- self.pack_farray(n, list, pack_item)
-
-
-class Unpacker:
-
- def __init__(self, data):
- self.reset(data)
-
- def reset(self, data):
- self.buf = data
- self.pos = 0
-
- def done(self):
- if self.pos < len(self.buf):
- raise RuntimeError('unextracted data remains')
-
- def unpack_uint(self):
- i = self.pos
- self.pos = j = i+4
- data = self.buf[i:j]
- if len(data) < 4:
- raise EOFError
- x = int(ord(data[0]))<<24 | ord(data[1])<<16 | \
- ord(data[2])<<8 | ord(data[3])
- # Return a Python long only if the value is not representable
- # as a nonnegative Python int
- if x < 0x80000000: x = int(x)
- return x
- if struct and struct.unpack('l', '\0\0\0\1') == 1:
- def unpack_uint(self):
- i = self.pos
- self.pos = j = i+4
- data = self.buf[i:j]
- if len(data) < 4:
- raise EOFError
- return struct.unpack('l', data)
-
- def unpack_int(self):
- x = self.unpack_uint()
- if x >= 0x80000000: x = x - 0x100000000
- return int(x)
-
- unpack_enum = unpack_int
-
- unpack_bool = unpack_int
-
- def unpack_uhyper(self):
- hi = self.unpack_uint()
- lo = self.unpack_uint()
- return int(hi)<<32 | lo
-
- def unpack_hyper(self):
- x = self.unpack_uhyper()
- if x >= 0x8000000000000000: x = x - 0x10000000000000000
- return x
-
- def unpack_float(self):
- # XXX
- i = self.pos
- self.pos = j = i+4
- data = self.buf[i:j]
- if len(data) < 4:
- raise EOFError
- return struct.unpack('f', data)[0]
-
- def unpack_double(self):
- # XXX
- i = self.pos
- self.pos = j = i+8
- data = self.buf[i:j]
- if len(data) < 8:
- raise EOFError
- return struct.unpack('d', data)[0]
-
- def unpack_fstring(self, n):
- if n < 0:
- raise ValueError('fstring size must be nonnegative')
- i = self.pos
- j = i + (n+3)//4*4
- if j > len(self.buf):
- raise EOFError
- self.pos = j
- return self.buf[i:i+n]
-
- unpack_fopaque = unpack_fstring
-
- def unpack_string(self):
- n = self.unpack_uint()
- return self.unpack_fstring(n)
-
- unpack_opaque = unpack_string
-
- def unpack_list(self, unpack_item):
- list = []
- while 1:
- x = self.unpack_uint()
- if x == 0: break
- if x != 1:
- raise RuntimeError('0 or 1 expected, got %r' % (x, ))
- item = unpack_item()
- list.append(item)
- return list
-
- def unpack_farray(self, n, unpack_item):
- list = []
- for i in range(n):
- list.append(unpack_item())
- return list
-
- def unpack_array(self, unpack_item):
- n = self.unpack_uint()
- return self.unpack_farray(n, unpack_item)
diff --git a/Demo/scripts/README b/Demo/scripts/README
deleted file mode 100644
index 097b9b7b63..0000000000
--- a/Demo/scripts/README
+++ /dev/null
@@ -1,22 +0,0 @@
-This directory contains a collection of executable Python scripts.
-
-See also the Tools/scripts directory!
-
-beer.py Print the classic 'bottles of beer' list.
-eqfix.py Fix .py files to use the correct equality test operator
-fact.py Factorize numbers
-find-uname.py Search for Unicode characters using regexps
-from.py Summarize mailbox
-lpwatch.py Watch BSD line printer queues
-makedir.py Like mkdir -p
-markov.py Markov chain simulation of words or characters
-mboxconvert.py Convert MH or MMDF mailboxes to unix mailbox format
-morse.py Produce morse code (as an AIFF file)
-newslist.py List all newsgroups on a NNTP server as HTML pages
-pi.py Print all digits of pi -- given enough time and memory
-pp.py Emulate some Perl command line options
-primes.py Print prime numbers
-queens.py Dijkstra's solution to Wirth's "N Queens problem"
-script.py Equivalent to BSD script(1) -- by Steen Lumholt
-unbirthday.py Print unbirthday count
-update.py Update a bunch of files according to a script.
diff --git a/Demo/scripts/eqfix.py b/Demo/scripts/eqfix.py
deleted file mode 100755
index 47c00d3b6d..0000000000
--- a/Demo/scripts/eqfix.py
+++ /dev/null
@@ -1,198 +0,0 @@
-#! /usr/bin/env python
-
-# Fix Python source files to use the new equality test operator, i.e.,
-# if x = y: ...
-# is changed to
-# if x == y: ...
-# The script correctly tokenizes the Python program to reliably
-# distinguish between assignments and equality tests.
-#
-# Command line arguments are files or directories to be processed.
-# Directories are searched recursively for files whose name looks
-# like a python module.
-# Symbolic links are always ignored (except as explicit directory
-# arguments). Of course, the original file is kept as a back-up
-# (with a "~" attached to its name).
-# It complains about binaries (files containing null bytes)
-# and about files that are ostensibly not Python files: if the first
-# line starts with '#!' and does not contain the string 'python'.
-#
-# Changes made are reported to stdout in a diff-like format.
-#
-# Undoubtedly you can do this using find and sed or perl, but this is
-# a nice example of Python code that recurses down a directory tree
-# and uses regular expressions. Also note several subtleties like
-# preserving the file's mode and avoiding to even write a temp file
-# when no changes are needed for a file.
-#
-# NB: by changing only the function fixline() you can turn this
-# into a program for a different change to Python programs...
-
-import sys
-import re
-import os
-from stat import *
-import string
-
-err = sys.stderr.write
-dbg = err
-rep = sys.stdout.write
-
-def main():
- bad = 0
- if not sys.argv[1:]: # No arguments
- err('usage: ' + sys.argv[0] + ' file-or-directory ...\n')
- sys.exit(2)
- for arg in sys.argv[1:]:
- if os.path.isdir(arg):
- if recursedown(arg): bad = 1
- elif os.path.islink(arg):
- err(arg + ': will not process symbolic links\n')
- bad = 1
- else:
- if fix(arg): bad = 1
- sys.exit(bad)
-
-ispythonprog = re.compile('^[a-zA-Z0-9_]+\.py$')
-def ispython(name):
- return ispythonprog.match(name) >= 0
-
-def recursedown(dirname):
- dbg('recursedown(%r)\n' % (dirname,))
- bad = 0
- try:
- names = os.listdir(dirname)
- except os.error as msg:
- err('%s: cannot list directory: %r\n' % (dirname, msg))
- return 1
- names.sort()
- subdirs = []
- for name in names:
- if name in (os.curdir, os.pardir): continue
- fullname = os.path.join(dirname, name)
- if os.path.islink(fullname): pass
- elif os.path.isdir(fullname):
- subdirs.append(fullname)
- elif ispython(name):
- if fix(fullname): bad = 1
- for fullname in subdirs:
- if recursedown(fullname): bad = 1
- return bad
-
-def fix(filename):
-## dbg('fix(%r)\n' % (dirname,))
- try:
- f = open(filename, 'r')
- except IOError as msg:
- err('%s: cannot open: %r\n' % (filename, msg))
- return 1
- head, tail = os.path.split(filename)
- tempname = os.path.join(head, '@' + tail)
- g = None
- # If we find a match, we rewind the file and start over but
- # now copy everything to a temp file.
- lineno = 0
- while 1:
- line = f.readline()
- if not line: break
- lineno = lineno + 1
- if g is None and '\0' in line:
- # Check for binary files
- err(filename + ': contains null bytes; not fixed\n')
- f.close()
- return 1
- if lineno == 1 and g is None and line[:2] == '#!':
- # Check for non-Python scripts
- words = string.split(line[2:])
- if words and re.search('[pP]ython', words[0]) < 0:
- msg = filename + ': ' + words[0]
- msg = msg + ' script; not fixed\n'
- err(msg)
- f.close()
- return 1
- while line[-2:] == '\\\n':
- nextline = f.readline()
- if not nextline: break
- line = line + nextline
- lineno = lineno + 1
- newline = fixline(line)
- if newline != line:
- if g is None:
- try:
- g = open(tempname, 'w')
- except IOError as msg:
- f.close()
- err('%s: cannot create: %r\n' % (tempname, msg))
- return 1
- f.seek(0)
- lineno = 0
- rep(filename + ':\n')
- continue # restart from the beginning
- rep(repr(lineno) + '\n')
- rep('< ' + line)
- rep('> ' + newline)
- if g is not None:
- g.write(newline)
-
- # End of file
- f.close()
- if not g: return 0 # No changes
-
- # Finishing touch -- move files
-
- # First copy the file's mode to the temp file
- try:
- statbuf = os.stat(filename)
- os.chmod(tempname, statbuf[ST_MODE] & 0o7777)
- except os.error as msg:
- err('%s: warning: chmod failed (%r)\n' % (tempname, msg))
- # Then make a backup of the original file as filename~
- try:
- os.rename(filename, filename + '~')
- except os.error as msg:
- err('%s: warning: backup failed (%r)\n' % (filename, msg))
- # Now move the temp file to the original file
- try:
- os.rename(tempname, filename)
- except os.error as msg:
- err('%s: rename failed (%r)\n' % (filename, msg))
- return 1
- # Return succes
- return 0
-
-
-from tokenize import tokenprog
-
-match = {'if':':', 'elif':':', 'while':':', 'return':'\n', \
- '(':')', '[':']', '{':'}', '`':'`'}
-
-def fixline(line):
- # Quick check for easy case
- if '=' not in line: return line
-
- i, n = 0, len(line)
- stack = []
- while i < n:
- j = tokenprog.match(line, i)
- if j < 0:
- # A bad token; forget about the rest of this line
- print('(Syntax error:)')
- print(line, end=' ')
- return line
- a, b = tokenprog.regs[3] # Location of the token proper
- token = line[a:b]
- i = i+j
- if stack and token == stack[-1]:
- del stack[-1]
- elif token in match:
- stack.append(match[token])
- elif token == '=' and stack:
- line = line[:a] + '==' + line[b:]
- i, n = a + len('=='), len(line)
- elif token == '==' and not stack:
- print('(Warning: \'==\' at top level:)')
- print(line, end=' ')
- return line
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/scripts/fact.py b/Demo/scripts/fact.py
deleted file mode 100755
index 71fcda2ed0..0000000000
--- a/Demo/scripts/fact.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#! /usr/bin/env python
-
-# Factorize numbers.
-# The algorithm is not efficient, but easy to understand.
-# If there are large factors, it will take forever to find them,
-# because we try all odd numbers between 3 and sqrt(n)...
-
-import sys
-from math import sqrt
-
-def fact(n):
- if n < 1:
- raise ValueError('fact() argument should be >= 1')
- if n == 1:
- return [] # special case
- res = []
- # Treat even factors special, so we can use i += 2 later
- while n % 2 == 0:
- res.append(2)
- n //= 2
- # Try odd numbers up to sqrt(n)
- limit = sqrt(n+1)
- i = 3
- while i <= limit:
- if n % i == 0:
- res.append(i)
- n //= i
- limit = sqrt(n+1)
- else:
- i += 2
- if n != 1:
- res.append(n)
- return res
-
-def main():
- if len(sys.argv) > 1:
- source = sys.argv[1:]
- else:
- source = iter(input, '')
- for arg in source:
- try:
- n = int(arg)
- except ValueError:
- print(arg, 'is not an integer')
- else:
- print(n, fact(n))
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/scripts/from.py b/Demo/scripts/from.py
deleted file mode 100755
index 323e68474f..0000000000
--- a/Demo/scripts/from.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /usr/bin/env python
-
-# Print From and Subject of messages in $MAIL.
-# Extension to multiple mailboxes and other bells & whistles are left
-# as exercises for the reader.
-
-import sys, os
-
-# Open mailbox file. Exits with exception when this fails.
-
-try:
- mailbox = os.environ['MAIL']
-except (AttributeError, KeyError):
- sys.stderr.write('No environment variable $MAIL\n')
- sys.exit(2)
-
-try:
- mail = open(mailbox)
-except IOError:
- sys.exit('Cannot open mailbox file: ' + mailbox)
-
-while 1:
- line = mail.readline()
- if not line:
- break # EOF
- if line.startswith('From '):
- # Start of message found
- print(line[:-1], end=' ')
- while 1:
- line = mail.readline()
- if not line or line == '\n':
- break
- if line.startswith('Subject: '):
- print(repr(line[9:-1]), end=' ')
- print()
diff --git a/Demo/scripts/lpwatch.py b/Demo/scripts/lpwatch.py
deleted file mode 100755
index 90b3ecf0ed..0000000000
--- a/Demo/scripts/lpwatch.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#! /usr/bin/env python
-
-# Watch line printer queue(s).
-# Intended for BSD 4.3 lpq.
-
-import os
-import sys
-import time
-
-DEF_PRINTER = 'psc'
-DEF_DELAY = 10
-
-def main():
- delay = DEF_DELAY # XXX Use getopt() later
- try:
- thisuser = os.environ['LOGNAME']
- except:
- thisuser = os.environ['USER']
- printers = sys.argv[1:]
- if printers:
- # Strip '-P' from printer names just in case
- # the user specified it...
- for i, name in enumerate(printers):
- if name[:2] == '-P':
- printers[i] = name[2:]
- else:
- if 'PRINTER' in os.environ:
- printers = [os.environ['PRINTER']]
- else:
- printers = [DEF_PRINTER]
-
- clearhome = os.popen('clear', 'r').read()
-
- while True:
- text = clearhome
- for name in printers:
- text += makestatus(name, thisuser) + '\n'
- print(text)
- time.sleep(delay)
-
-def makestatus(name, thisuser):
- pipe = os.popen('lpq -P' + name + ' 2>&1', 'r')
- lines = []
- users = {}
- aheadbytes = 0
- aheadjobs = 0
- userseen = False
- totalbytes = 0
- totaljobs = 0
- for line in pipe:
- fields = line.split()
- n = len(fields)
- if len(fields) >= 6 and fields[n-1] == 'bytes':
- rank, user, job = fields[0:3]
- files = fields[3:-2]
- bytes = int(fields[n-2])
- if user == thisuser:
- userseen = True
- elif not userseen:
- aheadbytes += bytes
- aheadjobs += 1
- totalbytes += bytes
- totaljobs += 1
- ujobs, ubytes = users.get(user, (0, 0))
- ujobs += 1
- ubytes += bytes
- users[user] = ujobs, ubytes
- else:
- if fields and fields[0] != 'Rank':
- line = line.strip()
- if line == 'no entries':
- line = name + ': idle'
- elif line[-22:] == ' is ready and printing':
- line = name
- lines.append(line)
-
- if totaljobs:
- line = '%d K' % ((totalbytes+1023) // 1024)
- if totaljobs != len(users):
- line += ' (%d jobs)' % totaljobs
- if len(users) == 1:
- line += ' for %s' % next(iter(users))
- else:
- line += ' for %d users' % len(users)
- if userseen:
- if aheadjobs == 0:
- line += ' (%s first)' % thisuser
- else:
- line += ' (%d K before %s)' % (
- (aheadbytes+1023) // 1024, thisuser)
- lines.append(line)
-
- sts = pipe.close()
- if sts:
- lines.append('lpq exit status %r' % (sts,))
- return ': '.join(lines)
-
-if __name__ == "__main__":
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/Demo/scripts/makedir.py b/Demo/scripts/makedir.py
deleted file mode 100755
index 7095868afc..0000000000
--- a/Demo/scripts/makedir.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /usr/bin/env python
-
-# Like mkdir, but also make intermediate directories if necessary.
-# It is not an error if the given directory already exists (as long
-# as it is a directory).
-# Errors are not treated specially -- you just get a Python exception.
-
-import sys, os
-
-def main():
- for p in sys.argv[1:]:
- makedirs(p)
-
-def makedirs(p):
- if p and not os.path.isdir(p):
- head, tail = os.path.split(p)
- makedirs(head)
- os.mkdir(p, 0o777)
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/scripts/mboxconvert.py b/Demo/scripts/mboxconvert.py
deleted file mode 100755
index 2e44f06866..0000000000
--- a/Demo/scripts/mboxconvert.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#! /usr/bin/env python
-
-# Convert MH directories (1 message per file) or MMDF mailboxes (4x^A
-# delimited) to unix mailbox (From ... delimited) on stdout.
-# If -f is given, files contain one message per file (e.g. MH messages)
-
-import rfc822
-import sys
-import time
-import os
-import stat
-import getopt
-import re
-
-def main():
- dofile = mmdf
- try:
- opts, args = getopt.getopt(sys.argv[1:], 'f')
- except getopt.error as msg:
- sys.stderr.write('%s\n' % msg)
- sys.exit(2)
- for o, a in opts:
- if o == '-f':
- dofile = message
- if not args:
- args = ['-']
- sts = 0
- for arg in args:
- if arg == '-' or arg == '':
- sts = dofile(sys.stdin) or sts
- elif os.path.isdir(arg):
- sts = mh(arg) or sts
- elif os.path.isfile(arg):
- try:
- f = open(arg)
- except IOError as msg:
- sys.stderr.write('%s: %s\n' % (arg, msg))
- sts = 1
- continue
- sts = dofile(f) or sts
- f.close()
- else:
- sys.stderr.write('%s: not found\n' % arg)
- sts = 1
- if sts:
- sys.exit(sts)
-
-numeric = re.compile('[1-9][0-9]*')
-
-def mh(dir):
- sts = 0
- msgs = os.listdir(dir)
- for msg in msgs:
- if numeric.match(msg) != len(msg):
- continue
- fn = os.path.join(dir, msg)
- try:
- f = open(fn)
- except IOError as msg:
- sys.stderr.write('%s: %s\n' % (fn, msg))
- sts = 1
- continue
- sts = message(f) or sts
- return sts
-
-def mmdf(f):
- sts = 0
- while 1:
- line = f.readline()
- if not line:
- break
- if line == '\1\1\1\1\n':
- sts = message(f, line) or sts
- else:
- sys.stderr.write(
- 'Bad line in MMFD mailbox: %r\n' % (line,))
- return sts
-
-counter = 0 # for generating unique Message-ID headers
-
-def message(f, delimiter = ''):
- sts = 0
- # Parse RFC822 header
- m = rfc822.Message(f)
- # Write unix header line
- fullname, email = m.getaddr('From')
- tt = m.getdate('Date')
- if tt:
- t = time.mktime(tt)
- else:
- sys.stderr.write(
- 'Unparseable date: %r\n' % (m.get('Date'),))
- t = os.fstat(f.fileno())[stat.ST_MTIME]
- print('From', email, time.ctime(t))
- # Copy RFC822 header
- for line in m.headers:
- print(line, end=' ')
- # Invent Message-ID header if none is present
- if 'message-id' not in m:
- global counter
- counter = counter + 1
- msgid = "<%s.%d>" % (hex(t), counter)
- sys.stderr.write("Adding Message-ID %s (From %s)\n" %
- (msgid, email))
- print("Message-ID:", msgid)
- print()
- # Copy body
- while 1:
- line = f.readline()
- if line == delimiter:
- break
- if not line:
- sys.stderr.write('Unexpected EOF in message\n')
- sts = 1
- break
- if line[:5] == 'From ':
- line = '>' + line
- print(line, end=' ')
- # Print trailing newline
- print()
- return sts
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/scripts/morse.py b/Demo/scripts/morse.py
deleted file mode 100755
index 5aacaa1e78..0000000000
--- a/Demo/scripts/morse.py
+++ /dev/null
@@ -1,128 +0,0 @@
-#! /usr/bin/env python
-
-# DAH should be three DOTs.
-# Space between DOTs and DAHs should be one DOT.
-# Space between two letters should be one DAH.
-# Space between two words should be DOT DAH DAH.
-
-import sys, math, aifc
-from contextlib import closing
-
-DOT = 30
-DAH = 3 * DOT
-OCTAVE = 2 # 1 == 441 Hz, 2 == 882 Hz, ...
-
-morsetab = {
- 'A': '.-', 'a': '.-',
- 'B': '-...', 'b': '-...',
- 'C': '-.-.', 'c': '-.-.',
- 'D': '-..', 'd': '-..',
- 'E': '.', 'e': '.',
- 'F': '..-.', 'f': '..-.',
- 'G': '--.', 'g': '--.',
- 'H': '....', 'h': '....',
- 'I': '..', 'i': '..',
- 'J': '.---', 'j': '.---',
- 'K': '-.-', 'k': '-.-',
- 'L': '.-..', 'l': '.-..',
- 'M': '--', 'm': '--',
- 'N': '-.', 'n': '-.',
- 'O': '---', 'o': '---',
- 'P': '.--.', 'p': '.--.',
- 'Q': '--.-', 'q': '--.-',
- 'R': '.-.', 'r': '.-.',
- 'S': '...', 's': '...',
- 'T': '-', 't': '-',
- 'U': '..-', 'u': '..-',
- 'V': '...-', 'v': '...-',
- 'W': '.--', 'w': '.--',
- 'X': '-..-', 'x': '-..-',
- 'Y': '-.--', 'y': '-.--',
- 'Z': '--..', 'z': '--..',
- '0': '-----', ',': '--..--',
- '1': '.----', '.': '.-.-.-',
- '2': '..---', '?': '..--..',
- '3': '...--', ';': '-.-.-.',
- '4': '....-', ':': '---...',
- '5': '.....', "'": '.----.',
- '6': '-....', '-': '-....-',
- '7': '--...', '/': '-..-.',
- '8': '---..', '(': '-.--.-',
- '9': '----.', ')': '-.--.-',
- ' ': ' ', '_': '..--.-',
-}
-
-nowave = b'\0' * 200
-
-# If we play at 44.1 kHz (which we do), then if we produce one sine
-# wave in 100 samples, we get a tone of 441 Hz. If we produce two
-# sine waves in these 100 samples, we get a tone of 882 Hz. 882 Hz
-# appears to be a nice one for playing morse code.
-def mkwave(octave):
- sinewave = bytearray()
- for i in range(100):
- val = int(math.sin(math.pi * i * octave / 50.0) * 30000)
- sinewave.extend([(val >> 8) & 255, val & 255])
- return bytes(sinewave)
-
-defaultwave = mkwave(OCTAVE)
-
-def main():
- import getopt
- try:
- opts, args = getopt.getopt(sys.argv[1:], 'o:p:')
- except getopt.error:
- sys.stderr.write('Usage ' + sys.argv[0] +
- ' [ -o outfile ] [ -p octave ] [ words ] ...\n')
- sys.exit(1)
- wave = defaultwave
- outfile = 'morse.aifc'
- for o, a in opts:
- if o == '-o':
- outfile = a
- if o == '-p':
- wave = mkwave(int(a))
- with closing(aifc.open(outfile, 'w')) as fp:
- fp.setframerate(44100)
- fp.setsampwidth(2)
- fp.setnchannels(1)
- if args:
- source = [' '.join(args)]
- else:
- source = iter(sys.stdin.readline, '')
- for line in source:
- mline = morse(line)
- play(mline, fp, wave)
-
-# Convert a string to morse code with \001 between the characters in
-# the string.
-def morse(line):
- res = ''
- for c in line:
- try:
- res += morsetab[c] + '\001'
- except KeyError:
- pass
- return res
-
-# Play a line of morse code.
-def play(line, fp, wave):
- for c in line:
- if c == '.':
- sine(fp, DOT, wave)
- elif c == '-':
- sine(fp, DAH, wave)
- else: # space
- pause(fp, DAH + DOT)
- pause(fp, DOT)
-
-def sine(fp, length, wave):
- for i in range(length):
- fp.writeframesraw(wave)
-
-def pause(fp, length):
- for i in range(length):
- fp.writeframesraw(nowave)
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/scripts/newslist.doc b/Demo/scripts/newslist.doc
deleted file mode 100755
index 87fd9ba27a..0000000000
--- a/Demo/scripts/newslist.doc
+++ /dev/null
@@ -1,59 +0,0 @@
- NEWSLIST
- ========
- A program to assist HTTP browsing of newsgroups
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-WWW browsers such as NCSA Mosaic allow the user to read newsgroup
-articles by specifying the group name in a URL eg 'news:comp.answers'.
-
-To browse through many groups, though, (and there are several thousand
-of them) you really need a page or pages containing links to all the
-groups. There are some good ones out there, for example,
-
- http://info.cern.ch/hypertext/DataSources/News/Groups/Overview.html
-
-is the standard one at CERN, but it only shows the groups available there,
-which may be rather different from those available on your machine.
-
-Newslist is a program which creates a hierarchy of pages for you based
-on the groups available from YOUR server. It is written in python - a
-splendid interpreted object-oriented language which I suggest you get
-right now from the directory /pub/python at ftp.cwi.nl, if you haven't
-already got it.
-
-You should be able to see some sample output by looking at:
- http://pelican.cl.cam.ac.uk/newspage/root.html
-
-Descriptions of newsgroups can be added from a file with one group
-per line. eg:
-
- alt.foo Articles about foo
- comp.bar Programming in 'bar' and related languages
-
-A suitable list detailing most groups can be found at ftp.uu.net in
-/uunet-info/newsgroups.gz.
-
-Make sure you read the information at the beginning of the program source and
-configure the variables before running.
-
-In addition to python, you need:
-
- An NNTP-based news feed.
- A directory in which to put the pages.
-
-The programming is not very beautiful, but it works! It comes with no
-warranty, express or implied, but with the hope that some others may
-find it useful.
-
-Comments, improvements & suggestions welcomed.
-Quentin Stafford-Fraser
-
- ----------------------------------------------------------------------
- Quentin Stafford-Fraser
- http://pelican.cl.cam.ac.uk/people/qs101/me.html
-
- Cambridge University Computer Lab Rank Xerox Cambridge EuroPARC
- qs101@cl.cam.ac.uk fraser@europarc.xerox.com
- Tel: +44 223 334411 Tel: +44 223 341521
- Fax: +44 223 334679 Fax: +44 223 341510
- ----------------------------------------------------------------------
diff --git a/Demo/scripts/newslist.py b/Demo/scripts/newslist.py
deleted file mode 100755
index 9cea1b4d20..0000000000
--- a/Demo/scripts/newslist.py
+++ /dev/null
@@ -1,361 +0,0 @@
-#! /usr/bin/env python
-#######################################################################
-# Newslist $Revision$
-#
-# Syntax:
-# newslist [ -a ]
-#
-# This is a program to create a directory full of HTML pages
-# which between them contain links to all the newsgroups available
-# on your server.
-#
-# The -a option causes a complete list of all groups to be read from
-# the server rather than just the ones which have appeared since last
-# execution. This recreates the local list from scratch. Use this on
-# the first invocation of the program, and from time to time thereafter.
-# When new groups are first created they may appear on your server as
-# empty groups. By default, empty groups are ignored by the -a option.
-# However, these new groups will not be created again, and so will not
-# appear in the server's list of 'new groups' at a later date. Hence it
-# won't appear until you do a '-a' after some articles have appeared.
-#
-# I should really keep a list of ignored empty groups and re-check them
-# for articles on every run, but I haven't got around to it yet.
-#
-# This assumes an NNTP news feed.
-#
-# Feel free to copy, distribute and modify this code for
-# non-commercial use. If you make any useful modifications, let me
-# know!
-#
-# (c) Quentin Stafford-Fraser 1994
-# fraser@europarc.xerox.com qs101@cl.cam.ac.uk
-# #
-#######################################################################
-import sys, nntplib, marshal, time, os
-
-#######################################################################
-# Check these variables before running! #
-
-# Top directory.
-# Filenames which don't start with / are taken as being relative to this.
-topdir = os.path.expanduser('~/newspage')
-
-# The name of your NNTP host
-# eg.
-# newshost = 'nntp-serv.cl.cam.ac.uk'
-# or use following to get the name from the NNTPSERVER environment
-# variable:
-# newshost = os.environ['NNTPSERVER']
-newshost = 'news.example.com'
-
-# The filename for a local cache of the newsgroup list
-treefile = 'grouptree'
-
-# The filename for descriptions of newsgroups
-# I found a suitable one at ftp.uu.net in /uunet-info/newgroups.gz
-# You can set this to '' if you don't wish to use one.
-descfile = 'newsgroups'
-
-# The directory in which HTML pages should be created
-# eg.
-# pagedir = '/usr/local/lib/html/newspage'
-# pagedir = 'pages'
-pagedir = topdir
-
-# The html prefix which will refer to this directory
-# eg.
-# httppref = '/newspage/',
-# or leave blank for relative links between pages: (Recommended)
-# httppref = ''
-httppref = ''
-
-# The name of the 'root' news page in this directory.
-# A .html suffix will be added.
-rootpage = 'root'
-
-# Set skipempty to 0 if you wish to see links to empty groups as well.
-# Only affects the -a option.
-skipempty = 1
-
-# pagelinkicon can contain html to put an icon after links to
-# further pages. This helps to make important links stand out.
-# Set to '' if not wanted, or '...' is quite a good one.
-pagelinkicon = '... <img src="http://pelican.cl.cam.ac.uk/icons/page.xbm"> '
-
-# ---------------------------------------------------------------------
-# Less important personal preferences:
-
-# Sublistsize controls the maximum number of items the will appear as
-# an indented sub-list before the whole thing is moved onto a different
-# page. The smaller this is, the more pages you will have, but the
-# shorter each will be.
-sublistsize = 4
-
-# That should be all. #
-#######################################################################
-
-for dir in os.curdir, os.environ['HOME']:
- rcfile = os.path.join(dir, '.newslistrc.py')
- if os.path.exists(rcfile):
- print(rcfile)
- exec(open(rcfile).read())
- break
-
-from nntplib import NNTP
-from stat import *
-
-rcsrev = '$Revision$'
-rcsrev = ' '.join([s for s in rcsrev.split() if '$' not in s])
-desc = {}
-
-# Make (possibly) relative filenames into absolute ones
-treefile = os.path.join(topdir,treefile)
-descfile = os.path.join(topdir,descfile)
-page = os.path.join(topdir,pagedir)
-
-# First the bits for creating trees ---------------------------
-
-# Addtotree creates/augments a tree from a list of group names
-def addtotree(tree, groups):
- print('Updating tree...')
- for i in groups:
- parts = i.split('.')
- makeleaf(tree, parts)
-
-# Makeleaf makes a leaf and the branch leading to it if necessary
-def makeleaf(tree,path):
- j = path[0]
- l = len(path)
-
- if j not in tree:
- tree[j] = {}
- if l == 1:
- tree[j]['.'] = '.'
- if l > 1:
- makeleaf(tree[j],path[1:])
-
-# Then the bits for outputting trees as pages ----------------
-
-# Createpage creates an HTML file named <root>.html containing links
-# to those groups beginning with <root>.
-
-def createpage(root, tree, p):
- filename = os.path.join(pagedir, root+'.html')
- if root == rootpage:
- detail = ''
- else:
- detail = ' under ' + root
- with open(filename, 'w') as f:
- # f.write('Content-Type: text/html\n')
- f.write('<html>\n<head>\n')
- f.write('<title>Newsgroups available%s</title>\n' % detail)
- f.write('</head>\n<body>\n')
- f.write('<h1>Newsgroups available%s</h1>\n' % detail)
- f.write('<a href="%s%s.html">Back to top level</a><p>\n' %
- (httppref, rootpage))
- printtree(f, tree, 0, p)
- f.write('\n<p>')
- f.write("<i>This page automatically created by 'newslist' v. %s." %
- rcsrev)
- f.write(time.ctime(time.time()) + '</i>\n')
- f.write('</body>\n</html>\n')
-
-# Printtree prints the groups as a bulleted list. Groups with
-# more than <sublistsize> subgroups will be put on a separate page.
-# Other sets of subgroups are just indented.
-
-def printtree(f, tree, indent, p):
- l = len(tree)
-
- if l > sublistsize and indent > 0:
- # Create a new page and a link to it
- f.write('<li><b><a href="%s%s.html">' % (httppref, p[1:]))
- f.write(p[1:] + '.*')
- f.write('</a></b>%s\n' % pagelinkicon)
- createpage(p[1:], tree, p)
- return
-
- kl = sorted(tree.keys())
-
- if l > 1:
- if indent > 0:
- # Create a sub-list
- f.write('<li>%s\n<ul>' % p[1:])
- else:
- # Create a main list
- f.write('<ul>')
- indent = indent + 1
-
- for i in kl:
- if i == '.':
- # Output a newsgroup
- f.write('<li><a href="news:%s">%s</a> ' % (p[1:], p[1:]))
- if p[1:] in desc:
- f.write(' <i>%s</i>\n' % desc[p[1:]])
- else:
- f.write('\n')
- else:
- # Output a hierarchy
- printtree(f, tree[i], indent, p+'.'+i)
-
- if l > 1:
- f.write('\n</ul>')
-
-# Reading descriptions file ---------------------------------------
-
-# This returns a dict mapping group name to its description
-
-def readdesc(descfile):
- global desc
- desc = {}
-
- if descfile == '':
- return
-
- try:
- with open(descfile, 'r') as d:
- print('Reading descriptions...')
- for l in d:
- bits = l.split()
- try:
- grp = bits[0]
- dsc = ' '.join(bits[1:])
- if len(dsc) > 1:
- desc[grp] = dsc
- except IndexError:
- pass
- except IOError:
- print('Failed to open description file ' + descfile)
- return
-
-# Check that ouput directory exists, ------------------------------
-# and offer to create it if not
-
-def checkopdir(pagedir):
- if not os.path.isdir(pagedir):
- print('Directory %s does not exist.' % pagedir)
- print('Shall I create it for you? (y/n)')
- if sys.stdin.readline()[0] == 'y':
- try:
- os.mkdir(pagedir, 0o777)
- except:
- print('Sorry - failed!')
- sys.exit(1)
- else:
- print('OK. Exiting.')
- sys.exit(1)
-
-# Read and write current local tree ----------------------------------
-
-def readlocallist(treefile):
- print('Reading current local group list...')
- tree = {}
- try:
- treetime = time.localtime(os.stat(treefile)[ST_MTIME])
- except:
- print('\n*** Failed to open local group cache '+treefile)
- print('If this is the first time you have run newslist, then')
- print('use the -a option to create it.')
- sys.exit(1)
- treedate = '%02d%02d%02d' % (treetime[0] % 100, treetime[1], treetime[2])
- try:
- with open(treefile, 'rb') as dump:
- tree = marshal.load(dump)
- except IOError:
- print('Cannot open local group list ' + treefile)
- return (tree, treedate)
-
-def writelocallist(treefile, tree):
- try:
- with open(treefile, 'wb') as dump:
- groups = marshal.dump(tree, dump)
- print('Saved list to %s\n' % treefile)
- except:
- print('Sorry - failed to write to local group cache', treefile)
- print('Does it (or its directory) have the correct permissions?')
- sys.exit(1)
-
-# Return list of all groups on server -----------------------------
-
-def getallgroups(server):
- print('Getting list of all groups...')
- treedate = '010101'
- info = server.list()[1]
- groups = []
- print('Processing...')
- if skipempty:
- print('\nIgnoring following empty groups:')
- for i in info:
- grpname = i[0].split()[0]
- if skipempty and int(i[1]) < int(i[2]):
- print(grpname.decode() + ' ', end=' ')
- else:
- groups.append(grpname.decode())
- print('\n')
- if skipempty:
- print('(End of empty groups)')
- return groups
-
-# Return list of new groups on server -----------------------------
-
-def getnewgroups(server, treedate):
- print('Getting list of new groups since start of %s...' % treedate, end=' ')
- info = server.newgroups(treedate, '000001')[1]
- print('got %d.' % len(info))
- print('Processing...', end=' ')
- groups = []
- for i in info:
- grpname = i.split()[0]
- groups.append(grpname.decode())
- print('Done')
- return groups
-
-# Now the main program --------------------------------------------
-
-def main():
- tree = {}
-
- # Check that the output directory exists
- checkopdir(pagedir)
-
- try:
- print('Connecting to %s...' % newshost)
- if sys.version[0] == '0':
- s = NNTP.init(newshost)
- else:
- s = NNTP(newshost)
- connected = True
- except (nntplib.error_temp, nntplib.error_perm) as x:
- print('Error connecting to host:', x)
- print('I\'ll try to use just the local list.')
- connected = False
-
- # If -a is specified, read the full list of groups from server
- if connected and len(sys.argv) > 1 and sys.argv[1] == '-a':
- groups = getallgroups(s)
-
- # Otherwise just read the local file and then add
- # groups created since local file last modified.
- else:
-
- (tree, treedate) = readlocallist(treefile)
- if connected:
- groups = getnewgroups(s, treedate)
-
- if connected:
- addtotree(tree, groups)
- writelocallist(treefile,tree)
-
- # Read group descriptions
- readdesc(descfile)
-
- print('Creating pages...')
- createpage(rootpage, tree, '')
- print('Done')
-
-if __name__ == "__main__":
- main()
-
-# That's all folks
-######################################################################
diff --git a/Demo/scripts/pi.py b/Demo/scripts/pi.py
deleted file mode 100755
index 0740cd02a4..0000000000
--- a/Demo/scripts/pi.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /usr/bin/env python
-
-# Print digits of pi forever.
-#
-# The algorithm, using Python's 'long' integers ("bignums"), works
-# with continued fractions, and was conceived by Lambert Meertens.
-#
-# See also the ABC Programmer's Handbook, by Geurts, Meertens & Pemberton,
-# published by Prentice-Hall (UK) Ltd., 1990.
-
-import sys
-
-def main():
- k, a, b, a1, b1 = 2, 4, 1, 12, 4
- while True:
- # Next approximation
- p, q, k = k*k, 2*k+1, k+1
- a, b, a1, b1 = a1, b1, p*a+q*a1, p*b+q*b1
- # Print common digits
- d, d1 = a//b, a1//b1
- while d == d1:
- output(d)
- a, a1 = 10*(a%b), 10*(a1%b1)
- d, d1 = a//b, a1//b1
-
-def output(d):
- # Use write() to avoid spaces between the digits
- sys.stdout.write(str(d))
- # Flush so the output is seen immediately
- sys.stdout.flush()
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/scripts/pp.py b/Demo/scripts/pp.py
deleted file mode 100755
index 2c948f75db..0000000000
--- a/Demo/scripts/pp.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#! /usr/bin/env python
-
-# Emulate some Perl command line options.
-# Usage: pp [-a] [-c] [-d] [-e scriptline] [-F fieldsep] [-n] [-p] [file] ...
-# Where the options mean the following:
-# -a : together with -n or -p, splits each line into list F
-# -c : check syntax only, do not execute any code
-# -d : run the script under the debugger, pdb
-# -e scriptline : gives one line of the Python script; may be repeated
-# -F fieldsep : sets the field separator for the -a option [not in Perl]
-# -n : runs the script for each line of input
-# -p : prints the line after the script has run
-# When no script lines have been passed, the first file argument
-# contains the script. With -n or -p, the remaining arguments are
-# read as input to the script, line by line. If a file is '-'
-# or missing, standard input is read.
-
-# XXX To do:
-# - add -i extension option (change files in place)
-# - make a single loop over the files and lines (changes effect of 'break')?
-# - add an option to specify the record separator
-# - except for -n/-p, run directly from the file if at all possible
-
-import sys
-import getopt
-
-FS = ''
-SCRIPT = []
-AFLAG = 0
-CFLAG = 0
-DFLAG = 0
-NFLAG = 0
-PFLAG = 0
-
-try:
- optlist, ARGS = getopt.getopt(sys.argv[1:], 'acde:F:np')
-except getopt.error as msg:
- sys.stderr.write('%s: %s\n' % (sys.argv[0], msg))
- sys.exit(2)
-
-for option, optarg in optlist:
- if option == '-a':
- AFLAG = 1
- elif option == '-c':
- CFLAG = 1
- elif option == '-d':
- DFLAG = 1
- elif option == '-e':
- for line in optarg.split('\n'):
- SCRIPT.append(line)
- elif option == '-F':
- FS = optarg
- elif option == '-n':
- NFLAG = 1
- PFLAG = 0
- elif option == '-p':
- NFLAG = 1
- PFLAG = 1
- else:
- print(option, 'not recognized???')
-
-if not ARGS: ARGS.append('-')
-
-if not SCRIPT:
- if ARGS[0] == '-':
- fp = sys.stdin
- else:
- fp = open(ARGS[0], 'r')
- while 1:
- line = fp.readline()
- if not line: break
- SCRIPT.append(line[:-1])
- del fp
- del ARGS[0]
- if not ARGS: ARGS.append('-')
-
-if CFLAG:
- prologue = ['if 0:']
- epilogue = []
-elif NFLAG:
- # Note that it is on purpose that AFLAG and PFLAG are
- # tested dynamically each time through the loop
- prologue = [
- 'LINECOUNT = 0',
- 'for FILE in ARGS:',
- ' \tif FILE == \'-\':',
- ' \t \tFP = sys.stdin',
- ' \telse:',
- ' \t \tFP = open(FILE, \'r\')',
- ' \tLINENO = 0',
- ' \twhile 1:',
- ' \t \tLINE = FP.readline()',
- ' \t \tif not LINE: break',
- ' \t \tLINENO = LINENO + 1',
- ' \t \tLINECOUNT = LINECOUNT + 1',
- ' \t \tL = LINE[:-1]',
- ' \t \taflag = AFLAG',
- ' \t \tif aflag:',
- ' \t \t \tif FS: F = L.split(FS)',
- ' \t \t \telse: F = L.split()'
- ]
- epilogue = [
- ' \t \tif not PFLAG: continue',
- ' \t \tif aflag:',
- ' \t \t \tif FS: print(FS.join(F))',
- ' \t \t \telse: print(\' \'.join(F))',
- ' \t \telse: print(L)',
- ]
-else:
- prologue = ['if 1:']
- epilogue = []
-
-# Note that we indent using tabs only, so that any indentation style
-# used in 'command' will come out right after re-indentation.
-
-program = '\n'.join(prologue) + '\n'
-for line in SCRIPT:
- program += ' \t \t' + line + '\n'
-program += '\n'.join(epilogue) + '\n'
-
-if DFLAG:
- import pdb
- pdb.run(program)
-else:
- exec(program)
diff --git a/Demo/scripts/primes.py b/Demo/scripts/primes.py
deleted file mode 100755
index 0924aab8e7..0000000000
--- a/Demo/scripts/primes.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /usr/bin/env python
-
-# Print prime numbers in a given range
-
-def main():
- import sys
- min, max = 2, 0x7fffffff
- if sys.argv[1:]:
- min = int(eval(sys.argv[1]))
- if sys.argv[2:]:
- max = int(eval(sys.argv[2]))
- primes(min, max)
-
-def primes(min, max):
- if 2 >= min: print(2)
- primes = [2]
- i = 3
- while i <= max:
- for p in primes:
- if i%p == 0 or p*p > i: break
- if i%p != 0:
- primes.append(i)
- if i >= min: print(i)
- i = i+2
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/scripts/script.py b/Demo/scripts/script.py
deleted file mode 100755
index b490b17924..0000000000
--- a/Demo/scripts/script.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /usr/bin/env python
-
-# script.py -- Make typescript of terminal session.
-# Usage:
-# -a Append to typescript.
-# -p Use Python as shell.
-# Author: Steen Lumholt.
-
-
-import os, time, sys, getopt
-import pty
-
-def read(fd):
- data = os.read(fd, 1024)
- script.write(data)
- return data
-
-shell = 'sh'
-filename = 'typescript'
-mode = 'wb'
-if 'SHELL' in os.environ:
- shell = os.environ['SHELL']
-
-try:
- opts, args = getopt.getopt(sys.argv[1:], 'ap')
-except getopt.error as msg:
- print('%s: %s' % (sys.argv[0], msg))
- sys.exit(2)
-
-for o, a in opts:
- if o == '-a':
- mode = 'ab'
- elif o == '-p':
- shell = 'python'
-
-script = open(filename, mode)
-
-sys.stdout.write('Script started, file is %s\n' % filename)
-script.write(('Script started on %s\n' % time.ctime(time.time())).encode())
-pty.spawn(shell, read)
-script.write(('Script done on %s\n' % time.ctime(time.time())).encode())
-sys.stdout.write('Script done, file is %s\n' % filename)
diff --git a/Demo/scripts/toaiff.py b/Demo/scripts/toaiff.py
deleted file mode 100644
index 0e9be23c0e..0000000000
--- a/Demo/scripts/toaiff.py
+++ /dev/null
@@ -1,107 +0,0 @@
-"""Convert "arbitrary" sound files to AIFF (Apple and SGI's audio format).
-
-Input may be compressed.
-Uncompressed file type may be AIFF, WAV, VOC, 8SVX, NeXT/Sun, and others.
-An exception is raised if the file is not of a recognized type.
-Returned filename is either the input filename or a temporary filename;
-in the latter case the caller must ensure that it is removed.
-Other temporary files used are removed by the function.
-"""
-
-import os
-import tempfile
-import pipes
-import sndhdr
-
-__all__ = ["error", "toaiff"]
-
-table = {}
-
-t = pipes.Template()
-t.append('sox -t au - -t aiff -r 8000 -', '--')
-table['au'] = t
-
-# XXX The following is actually sub-optimal.
-# XXX The HCOM sampling rate can be 22k, 22k/2, 22k/3 or 22k/4.
-# XXX We must force the output sampling rate else the SGI won't play
-# XXX files sampled at 5.5k or 7.333k; however this means that files
-# XXX sampled at 11k are unnecessarily expanded.
-# XXX Similar comments apply to some other file types.
-t = pipes.Template()
-t.append('sox -t hcom - -t aiff -r 22050 -', '--')
-table['hcom'] = t
-
-t = pipes.Template()
-t.append('sox -t voc - -t aiff -r 11025 -', '--')
-table['voc'] = t
-
-t = pipes.Template()
-t.append('sox -t wav - -t aiff -', '--')
-table['wav'] = t
-
-t = pipes.Template()
-t.append('sox -t 8svx - -t aiff -r 16000 -', '--')
-table['8svx'] = t
-
-t = pipes.Template()
-t.append('sox -t sndt - -t aiff -r 16000 -', '--')
-table['sndt'] = t
-
-t = pipes.Template()
-t.append('sox -t sndr - -t aiff -r 16000 -', '--')
-table['sndr'] = t
-
-uncompress = pipes.Template()
-uncompress.append('uncompress', '--')
-
-
-class error(Exception):
- pass
-
-def toaiff(filename):
- temps = []
- ret = None
- try:
- ret = _toaiff(filename, temps)
- finally:
- for temp in temps[:]:
- if temp != ret:
- try:
- os.unlink(temp)
- except os.error:
- pass
- temps.remove(temp)
- return ret
-
-def _toaiff(filename, temps):
- if filename[-2:] == '.Z':
- (fd, fname) = tempfile.mkstemp()
- os.close(fd)
- temps.append(fname)
- sts = uncompress.copy(filename, fname)
- if sts:
- raise error(filename + ': uncompress failed')
- else:
- fname = filename
- try:
- ftype = sndhdr.whathdr(fname)
- if ftype:
- ftype = ftype[0] # All we're interested in
- except IOError as msg:
- if type(msg) == type(()) and len(msg) == 2 and \
- type(msg.args[0]) == type(0) and type(msg.args[1]) == type(''):
- msg = msg.args[1]
- if type(msg) != type(''):
- msg = repr(msg)
- raise error(filename + ': ' + msg)
- if ftype == 'aiff':
- return fname
- if ftype is None or not ftype in table:
- raise error('%s: unsupported audio file type %r' % (filename, ftype))
- (fd, temp) = tempfile.mkstemp()
- os.close(fd)
- temps.append(temp)
- sts = table[ftype].copy(fname, temp)
- if sts:
- raise error(filename + ': conversion to aiff failed')
- return temp
diff --git a/Demo/scripts/unbirthday.py b/Demo/scripts/unbirthday.py
deleted file mode 100755
index af58f8f286..0000000000
--- a/Demo/scripts/unbirthday.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#! /usr/bin/env python
-
-# Calculate your unbirthday count (see Alice in Wonderland).
-# This is defined as the number of days from your birth until today
-# that weren't your birthday. (The day you were born is not counted).
-# Leap years make it interesting.
-
-import sys
-import time
-import calendar
-
-def main():
- if sys.argv[1:]:
- year = int(sys.argv[1])
- else:
- year = int(input('In which year were you born? '))
- if 0 <= year < 100:
- print("I'll assume that by", year, end=' ')
- year = year + 1900
- print('you mean', year, 'and not the early Christian era')
- elif not (1850 <= year <= time.localtime()[0]):
- print("It's hard to believe you were born in", year)
- return
-
- if sys.argv[2:]:
- month = int(sys.argv[2])
- else:
- month = int(input('And in which month? (1-12) '))
- if not (1 <= month <= 12):
- print('There is no month numbered', month)
- return
-
- if sys.argv[3:]:
- day = int(sys.argv[3])
- else:
- day = int(input('And on what day of that month? (1-31) '))
- if month == 2 and calendar.isleap(year):
- maxday = 29
- else:
- maxday = calendar.mdays[month]
- if not (1 <= day <= maxday):
- print('There are no', day, 'days in that month!')
- return
-
- bdaytuple = (year, month, day)
- bdaydate = mkdate(bdaytuple)
- print('You were born on', format(bdaytuple))
-
- todaytuple = time.localtime()[:3]
- todaydate = mkdate(todaytuple)
- print('Today is', format(todaytuple))
-
- if bdaytuple > todaytuple:
- print('You are a time traveler. Go back to the future!')
- return
-
- if bdaytuple == todaytuple:
- print('You were born today. Have a nice life!')
- return
-
- days = todaydate - bdaydate
- print('You have lived', days, 'days')
-
- age = 0
- for y in range(year, todaytuple[0] + 1):
- if bdaytuple < (y, month, day) <= todaytuple:
- age = age + 1
-
- print('You are', age, 'years old')
-
- if todaytuple[1:] == bdaytuple[1:]:
- print('Congratulations! Today is your', nth(age), 'birthday')
- print('Yesterday was your', end=' ')
- else:
- print('Today is your', end=' ')
- print(nth(days - age), 'unbirthday')
-
-def format(date):
- (year, month, day) = date
- return '%d %s %d' % (day, calendar.month_name[month], year)
-
-def nth(n):
- if n == 1: return '1st'
- if n == 2: return '2nd'
- if n == 3: return '3rd'
- return '%dth' % n
-
-def mkdate(date):
- # January 1st, in 0 A.D. is arbitrarily defined to be day 1,
- # even though that day never actually existed and the calendar
- # was different then...
- (year, month, day) = date
- days = year*365 # years, roughly
- days = days + (year+3)//4 # plus leap years, roughly
- days = days - (year+99)//100 # minus non-leap years every century
- days = days + (year+399)//400 # plus leap years every 4 centirues
- for i in range(1, month):
- if i == 2 and calendar.isleap(year):
- days = days + 29
- else:
- days = days + calendar.mdays[i]
- days = days + day
- return days
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/scripts/update.py b/Demo/scripts/update.py
deleted file mode 100755
index d49e4b39c6..0000000000
--- a/Demo/scripts/update.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#! /usr/bin/env python
-
-# Update a bunch of files according to a script.
-# The input file contains lines of the form <filename>:<lineno>:<text>,
-# meaning that the given line of the given file is to be replaced
-# by the given text. This is useful for performing global substitutions
-# on grep output:
-
-import os
-import sys
-import re
-
-pat = '^([^: \t\n]+):([1-9][0-9]*):'
-prog = re.compile(pat)
-
-class FileObj:
- def __init__(self, filename):
- self.filename = filename
- self.changed = 0
- try:
- self.lines = open(filename, 'r').readlines()
- except IOError as msg:
- print('*** Can\'t open "%s":' % filename, msg)
- self.lines = None
- return
- print('diffing', self.filename)
-
- def finish(self):
- if not self.changed:
- print('no changes to', self.filename)
- return
- try:
- os.rename(self.filename, self.filename + '~')
- fp = open(self.filename, 'w')
- except (os.error, IOError) as msg:
- print('*** Can\'t rewrite "%s":' % self.filename, msg)
- return
- print('writing', self.filename)
- for line in self.lines:
- fp.write(line)
- fp.close()
- self.changed = 0
-
- def process(self, lineno, rest):
- if self.lines is None:
- print('(not processed): %s:%s:%s' % (
- self.filename, lineno, rest), end=' ')
- return
- i = eval(lineno) - 1
- if not 0 <= i < len(self.lines):
- print('*** Line number out of range: %s:%s:%s' % (
- self.filename, lineno, rest), end=' ')
- return
- if self.lines[i] == rest:
- print('(no change): %s:%s:%s' % (
- self.filename, lineno, rest), end=' ')
- return
- if not self.changed:
- self.changed = 1
- print('%sc%s' % (lineno, lineno))
- print('<', self.lines[i], end=' ')
- print('---')
- self.lines[i] = rest
- print('>', self.lines[i], end=' ')
-
-def main():
- if sys.argv[1:]:
- try:
- fp = open(sys.argv[1], 'r')
- except IOError as msg:
- print('Can\'t open "%s":' % sys.argv[1], msg)
- sys.exit(1)
- else:
- fp = sys.stdin
- curfile = None
- while 1:
- line = fp.readline()
- if not line:
- if curfile: curfile.finish()
- break
- n = prog.match(line)
- if n < 0:
- print('Funny line:', line, end=' ')
- continue
- filename, lineno = prog.group(1, 2)
- if not curfile or filename != curfile.filename:
- if curfile: curfile.finish()
- curfile = FileObj(filename)
- curfile.process(lineno, line[n:])
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/scripts/wh.py b/Demo/scripts/wh.py
deleted file mode 100755
index b9b09efa6a..0000000000
--- a/Demo/scripts/wh.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# This is here so I can use 'wh' instead of 'which' in '~/bin/generic_python'
-import which
diff --git a/Demo/sockets/README b/Demo/sockets/README
deleted file mode 100644
index eba7c231f0..0000000000
--- a/Demo/sockets/README
+++ /dev/null
@@ -1,14 +0,0 @@
-This directory contains some demonstrations of the socket module:
-
-broadcast.py Broadcast the time to radio.py.
-echosvr.py About the simplest TCP server possible.
-finger.py Client for the 'finger' protocol.
-ftp.py A very simple ftp client.
-gopher.py A simple gopher client.
-mcast.py IPv4/v6 multicast example
-radio.py Receive time broadcasts from broadcast.py.
-telnet.py Client for the 'telnet' protocol.
-throughput.py Client and server to measure TCP throughput.
-unixclient.py Unix socket example, client side
-unixserver.py Unix socket example, server side
-udpecho.py Client and server for the UDP echo protocol.
diff --git a/Demo/sockets/broadcast.py b/Demo/sockets/broadcast.py
deleted file mode 100755
index 6d2b1e813f..0000000000
--- a/Demo/sockets/broadcast.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# Send UDP broadcast packets
-
-MYPORT = 50000
-
-import sys, time
-from socket import *
-
-s = socket(AF_INET, SOCK_DGRAM)
-s.bind(('', 0))
-s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
-
-while 1:
- data = repr(time.time()) + '\n'
- s.sendto(data, ('<broadcast>', MYPORT))
- time.sleep(2)
diff --git a/Demo/sockets/echosvr.py b/Demo/sockets/echosvr.py
deleted file mode 100755
index 7de63915bf..0000000000
--- a/Demo/sockets/echosvr.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /usr/bin/env python
-
-# Python implementation of an 'echo' tcp server: echo all data it receives.
-#
-# This is the simplest possible server, servicing a single request only.
-
-import sys
-from socket import *
-
-# The standard echo port isn't very useful, it requires root permissions!
-# ECHO_PORT = 7
-ECHO_PORT = 50000 + 7
-BUFSIZE = 1024
-
-def main():
- if len(sys.argv) > 1:
- port = int(eval(sys.argv[1]))
- else:
- port = ECHO_PORT
- s = socket(AF_INET, SOCK_STREAM)
- s.bind(('', port))
- s.listen(1)
- conn, (remotehost, remoteport) = s.accept()
- print('connected by', remotehost, remoteport)
- while 1:
- data = conn.recv(BUFSIZE)
- if not data:
- break
- conn.send(data)
-
-main()
diff --git a/Demo/sockets/finger.py b/Demo/sockets/finger.py
deleted file mode 100755
index e8b9ed2b08..0000000000
--- a/Demo/sockets/finger.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#! /usr/bin/env python
-
-# Python interface to the Internet finger daemon.
-#
-# Usage: finger [options] [user][@host] ...
-#
-# If no host is given, the finger daemon on the local host is contacted.
-# Options are passed uninterpreted to the finger daemon!
-
-
-import sys, string
-from socket import *
-
-
-# Hardcode the number of the finger port here.
-# It's not likely to change soon...
-#
-FINGER_PORT = 79
-
-
-# Function to do one remote finger invocation.
-# Output goes directly to stdout (although this can be changed).
-#
-def finger(host, args):
- s = socket(AF_INET, SOCK_STREAM)
- s.connect((host, FINGER_PORT))
- s.send(args + '\n')
- while 1:
- buf = s.recv(1024)
- if not buf: break
- sys.stdout.write(buf)
- sys.stdout.flush()
-
-
-# Main function: argument parsing.
-#
-def main():
- options = ''
- i = 1
- while i < len(sys.argv) and sys.argv[i][:1] == '-':
- options = options + sys.argv[i] + ' '
- i = i+1
- args = sys.argv[i:]
- if not args:
- args = ['']
- for arg in args:
- if '@' in arg:
- at = string.index(arg, '@')
- host = arg[at+1:]
- arg = arg[:at]
- else:
- host = ''
- finger(host, options + arg)
-
-
-# Call the main function.
-#
-main()
diff --git a/Demo/sockets/ftp.py b/Demo/sockets/ftp.py
deleted file mode 100755
index 5ea99c79e3..0000000000
--- a/Demo/sockets/ftp.py
+++ /dev/null
@@ -1,152 +0,0 @@
-# A simple FTP client.
-#
-# The information to write this program was gathered from RFC 959,
-# but this is not a complete implementation! Yet it shows how a simple
-# FTP client can be built, and you are welcome to extend it to suit
-# it to your needs...
-#
-# How it works (assuming you've read the RFC):
-#
-# User commands are passed uninterpreted to the server. However, the
-# user never needs to send a PORT command. Rather, the client opens a
-# port right away and sends the appropriate PORT command to the server.
-# When a response code 150 is received, this port is used to receive
-# the data (which is written to stdout in this version), and when the
-# data is exhausted, a new port is opened and a corresponding PORT
-# command sent. In order to avoid errors when reusing ports quickly
-# (and because there is no s.getsockname() method in Python yet) we
-# cycle through a number of ports in the 50000 range.
-
-
-import sys, posix, string
-from socket import *
-
-
-BUFSIZE = 1024
-
-# Default port numbers used by the FTP protocol.
-#
-FTP_PORT = 21
-FTP_DATA_PORT = FTP_PORT - 1
-
-# Change the data port to something not needing root permissions.
-#
-FTP_DATA_PORT = FTP_DATA_PORT + 50000
-
-
-# Main program (called at the end of this file).
-#
-def main():
- hostname = sys.argv[1]
- control(hostname)
-
-
-# Control process (user interface and user protocol interpreter).
-#
-def control(hostname):
- #
- # Create control connection
- #
- s = socket(AF_INET, SOCK_STREAM)
- s.connect((hostname, FTP_PORT))
- f = s.makefile('r') # Reading the replies is easier from a file...
- #
- # Control loop
- #
- r = None
- while 1:
- code = getreply(f)
- if code in ('221', 'EOF'): break
- if code == '150':
- getdata(r)
- code = getreply(f)
- r = None
- if not r:
- r = newdataport(s, f)
- cmd = getcommand()
- if not cmd: break
- s.send(cmd + '\r\n')
-
-
-# Create a new data port and send a PORT command to the server for it.
-# (Cycle through a number of ports to avoid problems with reusing
-# a port within a short time.)
-#
-nextport = 0
-#
-def newdataport(s, f):
- global nextport
- port = nextport + FTP_DATA_PORT
- nextport = (nextport+1) % 16
- r = socket(AF_INET, SOCK_STREAM)
- r.bind((gethostbyname(gethostname()), port))
- r.listen(1)
- sendportcmd(s, f, port)
- return r
-
-
-# Send an appropriate port command.
-#
-def sendportcmd(s, f, port):
- hostname = gethostname()
- hostaddr = gethostbyname(hostname)
- hbytes = string.splitfields(hostaddr, '.')
- pbytes = [repr(port//256), repr(port%256)]
- bytes = hbytes + pbytes
- cmd = 'PORT ' + string.joinfields(bytes, ',')
- s.send(cmd + '\r\n')
- code = getreply(f)
-
-
-# Process an ftp reply and return the 3-digit reply code (as a string).
-# The reply should be a line of text starting with a 3-digit number.
-# If the 4th char is '-', it is a multi-line reply and is
-# terminate by a line starting with the same 3-digit number.
-# Any text while receiving the reply is echoed to the file.
-#
-def getreply(f):
- line = f.readline()
- if not line: return 'EOF'
- print(line, end=' ')
- code = line[:3]
- if line[3:4] == '-':
- while 1:
- line = f.readline()
- if not line: break # Really an error
- print(line, end=' ')
- if line[:3] == code and line[3:4] != '-': break
- return code
-
-
-# Get the data from the data connection.
-#
-def getdata(r):
- print('(accepting data connection)')
- conn, host = r.accept()
- print('(data connection accepted)')
- while 1:
- data = conn.recv(BUFSIZE)
- if not data: break
- sys.stdout.write(data)
- print('(end of data connection)')
-
-def raw_input(prompt):
- sys.stdout.write(prompt)
- sys.stdout.flush()
- return sys.stdin.readline()
-
-# Get a command from the user.
-#
-def getcommand():
- try:
- while 1:
- line = input('ftp.py> ')
- if line: return line
- except EOFError:
- return ''
-
-
-# Call the main program.
-#
-if __name__ == '__main__':
- main()
diff --git a/Demo/sockets/gopher.py b/Demo/sockets/gopher.py
deleted file mode 100755
index c287319c2e..0000000000
--- a/Demo/sockets/gopher.py
+++ /dev/null
@@ -1,352 +0,0 @@
-#! /usr/bin/env python
-
-# A simple gopher client.
-#
-# Usage: gopher [ [selector] host [port] ]
-
-import sys
-import os
-import socket
-
-# Default selector, host and port
-DEF_SELECTOR = ''
-DEF_HOST = 'gopher.micro.umn.edu'
-DEF_PORT = 70
-
-# Recognized file types
-T_TEXTFILE = '0'
-T_MENU = '1'
-T_CSO = '2'
-T_ERROR = '3'
-T_BINHEX = '4'
-T_DOS = '5'
-T_UUENCODE = '6'
-T_SEARCH = '7'
-T_TELNET = '8'
-T_BINARY = '9'
-T_REDUNDANT = '+'
-T_SOUND = 's'
-
-# Dictionary mapping types to strings
-typename = {'0': '<TEXT>', '1': '<DIR>', '2': '<CSO>', '3': '<ERROR>', \
- '4': '<BINHEX>', '5': '<DOS>', '6': '<UUENCODE>', '7': '<SEARCH>', \
- '8': '<TELNET>', '9': '<BINARY>', '+': '<REDUNDANT>', 's': '<SOUND>'}
-
-# Oft-used characters and strings
-CRLF = '\r\n'
-TAB = '\t'
-
-# Open a TCP connection to a given host and port
-def open_socket(host, port):
- if not port:
- port = DEF_PORT
- elif type(port) == type(''):
- port = int(port)
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.connect((host, port))
- return s
-
-# Send a selector to a given host and port, return a file with the reply
-def send_request(selector, host, port):
- s = open_socket(host, port)
- s.send(selector + CRLF)
- s.shutdown(1)
- return s.makefile('r')
-
-# Get a menu in the form of a list of entries
-def get_menu(selector, host, port):
- f = send_request(selector, host, port)
- list = []
- while 1:
- line = f.readline()
- if not line:
- print('(Unexpected EOF from server)')
- break
- if line[-2:] == CRLF:
- line = line[:-2]
- elif line[-1:] in CRLF:
- line = line[:-1]
- if line == '.':
- break
- if not line:
- print('(Empty line from server)')
- continue
- typechar = line[0]
- parts = line[1:].split(TAB)
- if len(parts) < 4:
- print('(Bad line from server: %r)' % (line,))
- continue
- if len(parts) > 4:
- print('(Extra info from server: %r)' % (parts[4:],))
- parts.insert(0, typechar)
- list.append(parts)
- f.close()
- return list
-
-# Get a text file as a list of lines, with trailing CRLF stripped
-def get_textfile(selector, host, port):
- list = []
- get_alt_textfile(selector, host, port, list.append)
- return list
-
-# Get a text file and pass each line to a function, with trailing CRLF stripped
-def get_alt_textfile(selector, host, port, func):
- f = send_request(selector, host, port)
- while 1:
- line = f.readline()
- if not line:
- print('(Unexpected EOF from server)')
- break
- if line[-2:] == CRLF:
- line = line[:-2]
- elif line[-1:] in CRLF:
- line = line[:-1]
- if line == '.':
- break
- if line[:2] == '..':
- line = line[1:]
- func(line)
- f.close()
-
-# Get a binary file as one solid data block
-def get_binary(selector, host, port):
- f = send_request(selector, host, port)
- data = f.read()
- f.close()
- return data
-
-# Get a binary file and pass each block to a function
-def get_alt_binary(selector, host, port, func, blocksize):
- f = send_request(selector, host, port)
- while 1:
- data = f.read(blocksize)
- if not data:
- break
- func(data)
-
-# A *very* simple interactive browser
-
-# Browser main command, has default arguments
-def browser(*args):
- selector = DEF_SELECTOR
- host = DEF_HOST
- port = DEF_PORT
- n = len(args)
- if n > 0 and args[0]:
- selector = args[0]
- if n > 1 and args[1]:
- host = args[1]
- if n > 2 and args[2]:
- port = args[2]
- if n > 3:
- raise RuntimeError('too many args')
- try:
- browse_menu(selector, host, port)
- except socket.error as msg:
- print('Socket error:', msg)
- sys.exit(1)
- except KeyboardInterrupt:
- print('\n[Goodbye]')
-
-# Browse a menu
-def browse_menu(selector, host, port):
- list = get_menu(selector, host, port)
- while 1:
- print('----- MENU -----')
- print('Selector:', repr(selector))
- print('Host:', host, ' Port:', port)
- print()
- for i in range(len(list)):
- item = list[i]
- typechar, description = item[0], item[1]
- print(repr(i+1).rjust(3) + ':', description, end=' ')
- if typechar in typename:
- print(typename[typechar])
- else:
- print('<TYPE=' + repr(typechar) + '>')
- print()
- while 1:
- try:
- str = input('Choice [CR == up a level]: ')
- except EOFError:
- print()
- return
- if not str:
- return
- try:
- choice = int(str)
- except ValueError:
- print('Choice must be a number; try again:')
- continue
- if not 0 < choice <= len(list):
- print('Choice out of range; try again:')
- continue
- break
- item = list[choice-1]
- typechar = item[0]
- [i_selector, i_host, i_port] = item[2:5]
- if typechar in typebrowser:
- browserfunc = typebrowser[typechar]
- try:
- browserfunc(i_selector, i_host, i_port)
- except (IOError, socket.error):
- t, v, tb = sys.exc_info()
- print('***', t, ':', v)
- else:
- print('Unsupported object type')
-
-# Browse a text file
-def browse_textfile(selector, host, port):
- x = None
- try:
- p = os.popen('${PAGER-more}', 'w')
- x = SaveLines(p)
- get_alt_textfile(selector, host, port, x.writeln)
- except IOError as msg:
- print('IOError:', msg)
- if x:
- x.close()
- f = open_savefile()
- if not f:
- return
- x = SaveLines(f)
- try:
- get_alt_textfile(selector, host, port, x.writeln)
- print('Done.')
- except IOError as msg:
- print('IOError:', msg)
- x.close()
-
-def raw_input(prompt):
- sys.stdout.write(prompt)
- sys.stdout.flush()
- return sys.stdin.readline()
-
-# Browse a search index
-def browse_search(selector, host, port):
- while 1:
- print('----- SEARCH -----')
- print('Selector:', repr(selector))
- print('Host:', host, ' Port:', port)
- print()
- try:
- query = input('Query [CR == up a level]: ')
- except EOFError:
- print()
- break
- query = query.strip()
- if not query:
- break
- if '\t' in query:
- print('Sorry, queries cannot contain tabs')
- continue
- browse_menu(selector + TAB + query, host, port)
-
-# "Browse" telnet-based information, i.e. open a telnet session
-def browse_telnet(selector, host, port):
- if selector:
- print('Log in as', repr(selector))
- if type(port) != type(''):
- port = repr(port)
- sts = os.system('set -x; exec telnet ' + host + ' ' + port)
- if sts:
- print('Exit status:', sts)
-
-# "Browse" a binary file, i.e. save it to a file
-def browse_binary(selector, host, port):
- f = open_savefile()
- if not f:
- return
- x = SaveWithProgress(f)
- get_alt_binary(selector, host, port, x.write, 8*1024)
- x.close()
-
-# "Browse" a sound file, i.e. play it or save it
-def browse_sound(selector, host, port):
- browse_binary(selector, host, port)
-
-# Dictionary mapping types to browser functions
-typebrowser = {'0': browse_textfile, '1': browse_menu, \
- '4': browse_binary, '5': browse_binary, '6': browse_textfile, \
- '7': browse_search, \
- '8': browse_telnet, '9': browse_binary, 's': browse_sound}
-
-# Class used to save lines, appending a newline to each line
-class SaveLines:
- def __init__(self, f):
- self.f = f
- def writeln(self, line):
- self.f.write(line + '\n')
- def close(self):
- sts = self.f.close()
- if sts:
- print('Exit status:', sts)
-
-# Class used to save data while showing progress
-class SaveWithProgress:
- def __init__(self, f):
- self.f = f
- def write(self, data):
- sys.stdout.write('#')
- sys.stdout.flush()
- self.f.write(data)
- def close(self):
- print()
- sts = self.f.close()
- if sts:
- print('Exit status:', sts)
-
-# Ask for and open a save file, or return None if not to save
-def open_savefile():
- try:
- savefile = input( \
- 'Save as file [CR == don\'t save; |pipeline or ~user/... OK]: ')
- except EOFError:
- print()
- return None
- savefile = savefile.strip()
- if not savefile:
- return None
- if savefile[0] == '|':
- cmd = savefile[1:].strip()
- try:
- p = os.popen(cmd, 'w')
- except IOError as msg:
- print(repr(cmd), ':', msg)
- return None
- print('Piping through', repr(cmd), '...')
- return p
- if savefile[0] == '~':
- savefile = os.path.expanduser(savefile)
- try:
- f = open(savefile, 'w')
- except IOError as msg:
- print(repr(savefile), ':', msg)
- return None
- print('Saving to', repr(savefile), '...')
- return f
-
-# Test program
-def test():
- if sys.argv[4:]:
- print('usage: gopher [ [selector] host [port] ]')
- sys.exit(2)
- elif sys.argv[3:]:
- browser(sys.argv[1], sys.argv[2], sys.argv[3])
- elif sys.argv[2:]:
- try:
- port = int(sys.argv[2])
- selector = ''
- host = sys.argv[1]
- except ValueError:
- selector = sys.argv[1]
- host = sys.argv[2]
- port = ''
- browser(selector, host, port)
- elif sys.argv[1:]:
- browser('', sys.argv[1])
- else:
- browser()
-
-# Call the test program as a main program
-test()
diff --git a/Demo/sockets/radio.py b/Demo/sockets/radio.py
deleted file mode 100755
index fa4ce75eb1..0000000000
--- a/Demo/sockets/radio.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Receive UDP packets transmitted by a broadcasting service
-
-MYPORT = 50000
-
-import sys
-from socket import *
-
-s = socket(AF_INET, SOCK_DGRAM)
-s.bind(('', MYPORT))
-
-while 1:
- data, wherefrom = s.recvfrom(1500, 0)
- sys.stderr.write(repr(wherefrom) + '\n')
- sys.stdout.write(data)
diff --git a/Demo/sockets/rpython.py b/Demo/sockets/rpython.py
deleted file mode 100755
index b654dc270e..0000000000
--- a/Demo/sockets/rpython.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /usr/bin/env python
-
-# Remote python client.
-# Execute Python commands remotely and send output back.
-
-import sys
-import string
-from socket import *
-
-PORT = 4127
-BUFSIZE = 1024
-
-def main():
- if len(sys.argv) < 3:
- print("usage: rpython host command")
- sys.exit(2)
- host = sys.argv[1]
- port = PORT
- i = string.find(host, ':')
- if i >= 0:
- port = string.atoi(port[i+1:])
- host = host[:i]
- command = string.join(sys.argv[2:])
- s = socket(AF_INET, SOCK_STREAM)
- s.connect((host, port))
- s.send(command)
- s.shutdown(1)
- reply = ''
- while 1:
- data = s.recv(BUFSIZE)
- if not data: break
- reply = reply + data
- print(reply, end=' ')
-
-main()
diff --git a/Demo/sockets/telnet.py b/Demo/sockets/telnet.py
deleted file mode 100755
index 038036ffc6..0000000000
--- a/Demo/sockets/telnet.py
+++ /dev/null
@@ -1,109 +0,0 @@
-#! /usr/bin/env python
-
-# Minimal interface to the Internet telnet protocol.
-#
-# It refuses all telnet options and does not recognize any of the other
-# telnet commands, but can still be used to connect in line-by-line mode.
-# It's also useful to play with a number of other services,
-# like time, finger, smtp and even ftp.
-#
-# Usage: telnet host [port]
-#
-# The port may be a service name or a decimal port number;
-# it defaults to 'telnet'.
-
-
-import sys, posix, time
-from socket import *
-
-BUFSIZE = 1024
-
-# Telnet protocol characters
-
-IAC = chr(255) # Interpret as command
-DONT = chr(254)
-DO = chr(253)
-WONT = chr(252)
-WILL = chr(251)
-
-def main():
- host = sys.argv[1]
- try:
- hostaddr = gethostbyname(host)
- except error:
- sys.stderr.write(sys.argv[1] + ': bad host name\n')
- sys.exit(2)
- #
- if len(sys.argv) > 2:
- servname = sys.argv[2]
- else:
- servname = 'telnet'
- #
- if '0' <= servname[:1] <= '9':
- port = eval(servname)
- else:
- try:
- port = getservbyname(servname, 'tcp')
- except error:
- sys.stderr.write(servname + ': bad tcp service name\n')
- sys.exit(2)
- #
- s = socket(AF_INET, SOCK_STREAM)
- #
- try:
- s.connect((host, port))
- except error as msg:
- sys.stderr.write('connect failed: ' + repr(msg) + '\n')
- sys.exit(1)
- #
- pid = posix.fork()
- #
- if pid == 0:
- # child -- read stdin, write socket
- while 1:
- line = sys.stdin.readline()
- s.send(line)
- else:
- # parent -- read socket, write stdout
- iac = 0 # Interpret next char as command
- opt = '' # Interpret next char as option
- while 1:
- data = s.recv(BUFSIZE)
- if not data:
- # EOF; kill child and exit
- sys.stderr.write( '(Closed by remote host)\n')
- posix.kill(pid, 9)
- sys.exit(1)
- cleandata = ''
- for c in data:
- if opt:
- print(ord(c))
- s.send(opt + c)
- opt = ''
- elif iac:
- iac = 0
- if c == IAC:
- cleandata = cleandata + c
- elif c in (DO, DONT):
- if c == DO: print('(DO)', end=' ')
- else: print('(DONT)', end=' ')
- opt = IAC + WONT
- elif c in (WILL, WONT):
- if c == WILL: print('(WILL)', end=' ')
- else: print('(WONT)', end=' ')
- opt = IAC + DONT
- else:
- print('(command)', ord(c))
- elif c == IAC:
- iac = 1
- print('(IAC)', end=' ')
- else:
- cleandata = cleandata + c
- sys.stdout.write(cleandata)
- sys.stdout.flush()
-
-
-try:
- main()
-except KeyboardInterrupt:
- pass
diff --git a/Demo/sockets/throughput.py b/Demo/sockets/throughput.py
deleted file mode 100755
index 64244aaaf5..0000000000
--- a/Demo/sockets/throughput.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#! /usr/bin/env python
-
-# Test network throughput.
-#
-# Usage:
-# 1) on host_A: throughput -s [port] # start a server
-# 2) on host_B: throughput -c count host_A [port] # start a client
-#
-# The server will service multiple clients until it is killed.
-#
-# The client performs one transfer of count*BUFSIZE bytes and
-# measures the time it takes (roundtrip!).
-
-
-import sys, time
-from socket import *
-
-MY_PORT = 50000 + 42
-
-BUFSIZE = 1024
-
-
-def main():
- if len(sys.argv) < 2:
- usage()
- if sys.argv[1] == '-s':
- server()
- elif sys.argv[1] == '-c':
- client()
- else:
- usage()
-
-
-def usage():
- sys.stdout = sys.stderr
- print('Usage: (on host_A) throughput -s [port]')
- print('and then: (on host_B) throughput -c count host_A [port]')
- sys.exit(2)
-
-
-def server():
- if len(sys.argv) > 2:
- port = eval(sys.argv[2])
- else:
- port = MY_PORT
- s = socket(AF_INET, SOCK_STREAM)
- s.bind(('', port))
- s.listen(1)
- print('Server ready...')
- while 1:
- conn, (host, remoteport) = s.accept()
- while 1:
- data = conn.recv(BUFSIZE)
- if not data:
- break
- del data
- conn.send('OK\n')
- conn.close()
- print('Done with', host, 'port', remoteport)
-
-
-def client():
- if len(sys.argv) < 4:
- usage()
- count = int(eval(sys.argv[2]))
- host = sys.argv[3]
- if len(sys.argv) > 4:
- port = eval(sys.argv[4])
- else:
- port = MY_PORT
- testdata = 'x' * (BUFSIZE-1) + '\n'
- t1 = time.time()
- s = socket(AF_INET, SOCK_STREAM)
- t2 = time.time()
- s.connect((host, port))
- t3 = time.time()
- i = 0
- while i < count:
- i = i+1
- s.send(testdata)
- s.shutdown(1) # Send EOF
- t4 = time.time()
- data = s.recv(BUFSIZE)
- t5 = time.time()
- print(data)
- print('Raw timers:', t1, t2, t3, t4, t5)
- print('Intervals:', t2-t1, t3-t2, t4-t3, t5-t4)
- print('Total:', t5-t1)
- print('Throughput:', round((BUFSIZE*count*0.001) / (t5-t1), 3), end=' ')
- print('K/sec.')
-
-
-main()
diff --git a/Demo/sockets/udpecho.py b/Demo/sockets/udpecho.py
deleted file mode 100755
index 9966fd86a4..0000000000
--- a/Demo/sockets/udpecho.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#! /usr/bin/env python
-
-# Client and server for udp (datagram) echo.
-#
-# Usage: udpecho -s [port] (to start a server)
-# or: udpecho -c host [port] <file (client)
-
-import sys
-from socket import *
-
-ECHO_PORT = 50000 + 7
-BUFSIZE = 1024
-
-def main():
- if len(sys.argv) < 2:
- usage()
- if sys.argv[1] == '-s':
- server()
- elif sys.argv[1] == '-c':
- client()
- else:
- usage()
-
-def usage():
- sys.stdout = sys.stderr
- print('Usage: udpecho -s [port] (server)')
- print('or: udpecho -c host [port] <file (client)')
- sys.exit(2)
-
-def server():
- if len(sys.argv) > 2:
- port = eval(sys.argv[2])
- else:
- port = ECHO_PORT
- s = socket(AF_INET, SOCK_DGRAM)
- s.bind(('', port))
- print('udp echo server ready')
- while 1:
- data, addr = s.recvfrom(BUFSIZE)
- print('server received %r from %r' % (data, addr))
- s.sendto(data, addr)
-
-def client():
- if len(sys.argv) < 3:
- usage()
- host = sys.argv[2]
- if len(sys.argv) > 3:
- port = eval(sys.argv[3])
- else:
- port = ECHO_PORT
- addr = host, port
- s = socket(AF_INET, SOCK_DGRAM)
- s.bind(('', 0))
- print('udp echo client ready, reading stdin')
- while 1:
- line = sys.stdin.readline()
- if not line:
- break
- print('addr = ', addr)
- s.sendto(bytes(line, 'ascii'), addr)
- data, fromaddr = s.recvfrom(BUFSIZE)
- print('client received %r from %r' % (data, fromaddr))
-
-main()
diff --git a/Demo/sockets/unicast.py b/Demo/sockets/unicast.py
deleted file mode 100644
index dd15e3c7b9..0000000000
--- a/Demo/sockets/unicast.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Send UDP broadcast packets
-
-MYPORT = 50000
-
-import sys, time
-from socket import *
-
-s = socket(AF_INET, SOCK_DGRAM)
-s.bind(('', 0))
-
-while 1:
- data = repr(time.time()) + '\n'
- s.sendto(data, ('', MYPORT))
- time.sleep(2)
diff --git a/Demo/sockets/unixclient.py b/Demo/sockets/unixclient.py
deleted file mode 100644
index 5e87eed0de..0000000000
--- a/Demo/sockets/unixclient.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Echo client demo using Unix sockets
-# Piet van Oostrum
-
-from socket import *
-
-FILE = 'unix-socket'
-s = socket(AF_UNIX, SOCK_STREAM)
-s.connect(FILE)
-s.send(b'Hello, world')
-data = s.recv(1024)
-s.close()
-print('Received', repr(data))
diff --git a/Demo/sockets/unixserver.py b/Demo/sockets/unixserver.py
deleted file mode 100644
index c3c9c4f828..0000000000
--- a/Demo/sockets/unixserver.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Echo server demo using Unix sockets (handles one connection only)
-# Piet van Oostrum
-
-import os
-from socket import *
-
-FILE = 'unix-socket'
-s = socket(AF_UNIX, SOCK_STREAM)
-s.bind(FILE)
-
-print('Sock name is: ['+s.getsockname()+']')
-
-# Wait for a connection
-s.listen(1)
-conn, addr = s.accept()
-
-while True:
- data = conn.recv(1024)
- if not data:
- break
- conn.send(data)
-
-conn.close()
-os.unlink(FILE)
diff --git a/Demo/threads/Coroutine.py b/Demo/threads/Coroutine.py
deleted file mode 100644
index 690fadcc0a..0000000000
--- a/Demo/threads/Coroutine.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# Coroutine implementation using Python threads.
-#
-# Combines ideas from Guido's Generator module, and from the coroutine
-# features of Icon and Simula 67.
-#
-# To run a collection of functions as coroutines, you need to create
-# a Coroutine object to control them:
-# co = Coroutine()
-# and then 'create' a subsidiary object for each function in the
-# collection:
-# cof1 = co.create(f1 [, arg1, arg2, ...]) # [] means optional,
-# cof2 = co.create(f2 [, arg1, arg2, ...]) #... not list
-# cof3 = co.create(f3 [, arg1, arg2, ...])
-# etc. The functions need not be distinct; 'create'ing the same
-# function multiple times gives you independent instances of the
-# function.
-#
-# To start the coroutines running, use co.tran on one of the create'd
-# functions; e.g., co.tran(cof2). The routine that first executes
-# co.tran is called the "main coroutine". It's special in several
-# respects: it existed before you created the Coroutine object; if any of
-# the create'd coroutines exits (does a return, or suffers an unhandled
-# exception), EarlyExit error is raised in the main coroutine; and the
-# co.detach() method transfers control directly to the main coroutine
-# (you can't use co.tran() for this because the main coroutine doesn't
-# have a name ...).
-#
-# Coroutine objects support these methods:
-#
-# handle = .create(func [, arg1, arg2, ...])
-# Creates a coroutine for an invocation of func(arg1, arg2, ...),
-# and returns a handle ("name") for the coroutine so created. The
-# handle can be used as the target in a subsequent .tran().
-#
-# .tran(target, data=None)
-# Transfer control to the create'd coroutine "target", optionally
-# passing it an arbitrary piece of data. To the coroutine A that does
-# the .tran, .tran acts like an ordinary function call: another
-# coroutine B can .tran back to it later, and if it does A's .tran
-# returns the 'data' argument passed to B's tran. E.g.,
-#
-# in coroutine coA in coroutine coC in coroutine coB
-# x = co.tran(coC) co.tran(coB) co.tran(coA,12)
-# print x # 12
-#
-# The data-passing feature is taken from Icon, and greatly cuts
-# the need to use global variables for inter-coroutine communication.
-#
-# .back( data=None )
-# The same as .tran(invoker, data=None), where 'invoker' is the
-# coroutine that most recently .tran'ed control to the coroutine
-# doing the .back. This is akin to Icon's "&source".
-#
-# .detach( data=None )
-# The same as .tran(main, data=None), where 'main' is the
-# (unnameable!) coroutine that started it all. 'main' has all the
-# rights of any other coroutine: upon receiving control, it can
-# .tran to an arbitrary coroutine of its choosing, go .back to
-# the .detach'er, or .kill the whole thing.
-#
-# .kill()
-# Destroy all the coroutines, and return control to the main
-# coroutine. None of the create'ed coroutines can be resumed after a
-# .kill(). An EarlyExit exception does a .kill() automatically. It's
-# a good idea to .kill() coroutines you're done with, since the
-# current implementation consumes a thread for each coroutine that
-# may be resumed.
-
-import _thread as thread
-import sync
-
-class _CoEvent:
- def __init__(self, func):
- self.f = func
- self.e = sync.event()
-
- def __repr__(self):
- if self.f is None:
- return 'main coroutine'
- else:
- return 'coroutine for func ' + self.f.__name__
-
- def __hash__(self):
- return id(self)
-
- def __cmp__(x,y):
- return cmp(id(x), id(y))
-
- def resume(self):
- self.e.post()
-
- def wait(self):
- self.e.wait()
- self.e.clear()
-
-class Killed(Exception): pass
-class EarlyExit(Exception): pass
-
-class Coroutine:
- def __init__(self):
- self.active = self.main = _CoEvent(None)
- self.invokedby = {self.main: None}
- self.killed = 0
- self.value = None
- self.terminated_by = None
-
- def create(self, func, *args):
- me = _CoEvent(func)
- self.invokedby[me] = None
- thread.start_new_thread(self._start, (me,) + args)
- return me
-
- def _start(self, me, *args):
- me.wait()
- if not self.killed:
- try:
- try:
- me.f(*args)
- except Killed:
- pass
- finally:
- if not self.killed:
- self.terminated_by = me
- self.kill()
-
- def kill(self):
- if self.killed:
- raise TypeError('kill() called on dead coroutines')
- self.killed = 1
- for coroutine in self.invokedby.keys():
- coroutine.resume()
-
- def back(self, data=None):
- return self.tran( self.invokedby[self.active], data )
-
- def detach(self, data=None):
- return self.tran( self.main, data )
-
- def tran(self, target, data=None):
- if target not in self.invokedby:
- raise TypeError('.tran target %r is not an active coroutine' % (target,))
- if self.killed:
- raise TypeError('.tran target %r is killed' % (target,))
- self.value = data
- me = self.active
- self.invokedby[target] = me
- self.active = target
- target.resume()
-
- me.wait()
- if self.killed:
- if self.main is not me:
- raise Killed
- if self.terminated_by is not None:
- raise EarlyExit('%r terminated early' % (self.terminated_by,))
-
- return self.value
-
-# end of module
diff --git a/Demo/threads/Generator.py b/Demo/threads/Generator.py
deleted file mode 100644
index 3a2963f8b6..0000000000
--- a/Demo/threads/Generator.py
+++ /dev/null
@@ -1,92 +0,0 @@
-# Generator implementation using threads
-
-import _thread as thread
-import sys
-
-class Killed(Exception):
- pass
-
-class Generator:
- # Constructor
- def __init__(self, func, args):
- self.getlock = thread.allocate_lock()
- self.putlock = thread.allocate_lock()
- self.getlock.acquire()
- self.putlock.acquire()
- self.func = func
- self.args = args
- self.done = 0
- self.killed = 0
- thread.start_new_thread(self._start, ())
-
- # Internal routine
- def _start(self):
- try:
- self.putlock.acquire()
- if not self.killed:
- try:
- self.func(self, *self.args)
- except Killed:
- pass
- finally:
- if not self.killed:
- self.done = 1
- self.getlock.release()
-
- # Called by producer for each value; raise Killed if no more needed
- def put(self, value):
- if self.killed:
- raise TypeError('put() called on killed generator')
- self.value = value
- self.getlock.release() # Resume consumer thread
- self.putlock.acquire() # Wait for next get() call
- if self.killed:
- raise Killed
-
- # Called by producer to get next value; raise EOFError if no more
- def get(self):
- if self.killed:
- raise TypeError('get() called on killed generator')
- self.putlock.release() # Resume producer thread
- self.getlock.acquire() # Wait for value to appear
- if self.done:
- raise EOFError # Say there are no more values
- return self.value
-
- # Called by consumer if no more values wanted
- def kill(self):
- if self.killed:
- raise TypeError('kill() called on killed generator')
- self.killed = 1
- self.putlock.release()
-
- # Clone constructor
- def clone(self):
- return Generator(self.func, self.args)
-
-def pi(g):
- k, a, b, a1, b1 = 2, 4, 1, 12, 4
- while 1:
- # Next approximation
- p, q, k = k*k, 2*k+1, k+1
- a, b, a1, b1 = a1, b1, p*a+q*a1, p*b+q*b1
- # Print common digits
- d, d1 = a//b, a1//b1
- while d == d1:
- g.put(int(d))
- a, a1 = 10*(a%b), 10*(a1%b1)
- d, d1 = a//b, a1//b1
-
-def test():
- g = Generator(pi, ())
- g.kill()
- g = Generator(pi, ())
- for i in range(10): print(g.get(), end=' ')
- print()
- h = g.clone()
- g.kill()
- while 1:
- print(h.get(), end=' ')
- sys.stdout.flush()
-
-test()
diff --git a/Demo/threads/README b/Demo/threads/README
deleted file mode 100644
index a379521e8d..0000000000
--- a/Demo/threads/README
+++ /dev/null
@@ -1,11 +0,0 @@
-This directory contains some demonstrations of the thread module.
-
-These are mostly "proof of concept" type applications:
-
-Generator.py Generator class implemented with threads.
-sync.py Condition variables primitives by Tim Peters.
-telnet.py Version of ../sockets/telnet.py using threads.
-
-Coroutine.py Coroutines using threads, by Tim Peters (22 May 94)
-fcmp.py Example of above, by Tim
-squasher.py Another example of above, also by Tim
diff --git a/Demo/threads/fcmp.py b/Demo/threads/fcmp.py
deleted file mode 100644
index bc2e3ed42a..0000000000
--- a/Demo/threads/fcmp.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Coroutine example: controlling multiple instances of a single function
-
-from Coroutine import *
-
-# fringe visits a nested list in inorder, and detaches for each non-list
-# element; raises EarlyExit after the list is exhausted
-def fringe(co, list):
- for x in list:
- if type(x) is type([]):
- fringe(co, x)
- else:
- co.back(x)
-
-def printinorder(list):
- co = Coroutine()
- f = co.create(fringe, co, list)
- try:
- while 1:
- print(co.tran(f), end=' ')
- except EarlyExit:
- pass
- print()
-
-printinorder([1,2,3]) # 1 2 3
-printinorder([[[[1,[2]]],3]]) # ditto
-x = [0, 1, [2, [3]], [4,5], [[[6]]] ]
-printinorder(x) # 0 1 2 3 4 5 6
-
-# fcmp lexicographically compares the fringes of two nested lists
-def fcmp(l1, l2):
- co1 = Coroutine(); f1 = co1.create(fringe, co1, l1)
- co2 = Coroutine(); f2 = co2.create(fringe, co2, l2)
- while 1:
- try:
- v1 = co1.tran(f1)
- except EarlyExit:
- try:
- v2 = co2.tran(f2)
- except EarlyExit:
- return 0
- co2.kill()
- return -1
- try:
- v2 = co2.tran(f2)
- except EarlyExit:
- co1.kill()
- return 1
- if v1 != v2:
- co1.kill(); co2.kill()
- return cmp(v1,v2)
-
-print(fcmp(range(7), x)) # 0; fringes are equal
-print(fcmp(range(6), x)) # -1; 1st list ends early
-print(fcmp(x, range(6))) # 1; 2nd list ends early
-print(fcmp(range(8), x)) # 1; 2nd list ends early
-print(fcmp(x, range(8))) # -1; 1st list ends early
-print(fcmp([1,[[2],8]],
- [[[1],2],8])) # 0
-print(fcmp([1,[[3],8]],
- [[[1],2],8])) # 1
-print(fcmp([1,[[2],8]],
- [[[1],2],9])) # -1
-
-# end of example
diff --git a/Demo/threads/find.py b/Demo/threads/find.py
deleted file mode 100644
index 2b4ef7dec0..0000000000
--- a/Demo/threads/find.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# A parallelized "find(1)" using the thread module.
-
-# This demonstrates the use of a work queue and worker threads.
-# It really does do more stats/sec when using multiple threads,
-# although the improvement is only about 20-30 percent.
-# (That was 8 years ago. In 2002, on Linux, I can't measure
-# a speedup. :-( )
-
-# I'm too lazy to write a command line parser for the full find(1)
-# command line syntax, so the predicate it searches for is wired-in,
-# see function selector() below. (It currently searches for files with
-# world write permission.)
-
-# Usage: parfind.py [-w nworkers] [directory] ...
-# Default nworkers is 4
-
-
-import sys
-import getopt
-import time
-import os
-from stat import *
-import _thread as thread
-
-
-# Work queue class. Usage:
-# wq = WorkQ()
-# wq.addwork(func, (arg1, arg2, ...)) # one or more calls
-# wq.run(nworkers)
-# The work is done when wq.run() completes.
-# The function calls executed by the workers may add more work.
-# Don't use keyboard interrupts!
-
-class WorkQ:
-
- # Invariants:
-
- # - busy and work are only modified when mutex is locked
- # - len(work) is the number of jobs ready to be taken
- # - busy is the number of jobs being done
- # - todo is locked iff there is no work and somebody is busy
-
- def __init__(self):
- self.mutex = thread.allocate()
- self.todo = thread.allocate()
- self.todo.acquire()
- self.work = []
- self.busy = 0
-
- def addwork(self, func, args):
- job = (func, args)
- self.mutex.acquire()
- self.work.append(job)
- self.mutex.release()
- if len(self.work) == 1:
- self.todo.release()
-
- def _getwork(self):
- self.todo.acquire()
- self.mutex.acquire()
- if self.busy == 0 and len(self.work) == 0:
- self.mutex.release()
- self.todo.release()
- return None
- job = self.work[0]
- del self.work[0]
- self.busy = self.busy + 1
- self.mutex.release()
- if len(self.work) > 0:
- self.todo.release()
- return job
-
- def _donework(self):
- self.mutex.acquire()
- self.busy = self.busy - 1
- if self.busy == 0 and len(self.work) == 0:
- self.todo.release()
- self.mutex.release()
-
- def _worker(self):
- time.sleep(0.00001) # Let other threads run
- while 1:
- job = self._getwork()
- if not job:
- break
- func, args = job
- func(*args)
- self._donework()
-
- def run(self, nworkers):
- if not self.work:
- return # Nothing to do
- for i in range(nworkers-1):
- thread.start_new(self._worker, ())
- self._worker()
- self.todo.acquire()
-
-
-# Main program
-
-def main():
- nworkers = 4
- opts, args = getopt.getopt(sys.argv[1:], '-w:')
- for opt, arg in opts:
- if opt == '-w':
- nworkers = int(arg)
- if not args:
- args = [os.curdir]
-
- wq = WorkQ()
- for dir in args:
- wq.addwork(find, (dir, selector, wq))
-
- t1 = time.time()
- wq.run(nworkers)
- t2 = time.time()
-
- sys.stderr.write('Total time %r sec.\n' % (t2-t1))
-
-
-# The predicate -- defines what files we look for.
-# Feel free to change this to suit your purpose
-
-def selector(dir, name, fullname, stat):
- # Look for world writable files that are not symlinks
- return (stat[ST_MODE] & 0o002) != 0 and not S_ISLNK(stat[ST_MODE])
-
-
-# The find procedure -- calls wq.addwork() for subdirectories
-
-def find(dir, pred, wq):
- try:
- names = os.listdir(dir)
- except os.error as msg:
- print(repr(dir), ':', msg)
- return
- for name in names:
- if name not in (os.curdir, os.pardir):
- fullname = os.path.join(dir, name)
- try:
- stat = os.lstat(fullname)
- except os.error as msg:
- print(repr(fullname), ':', msg)
- continue
- if pred(dir, name, fullname, stat):
- print(fullname)
- if S_ISDIR(stat[ST_MODE]):
- if not os.path.ismount(fullname):
- wq.addwork(find, (fullname, pred, wq))
-
-
-# Call the main program
-
-main()
diff --git a/Demo/threads/squasher.py b/Demo/threads/squasher.py
deleted file mode 100644
index 35b1b1d21e..0000000000
--- a/Demo/threads/squasher.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# Coroutine example: general coroutine transfers
-#
-# The program is a variation of a Simula 67 program due to Dahl & Hoare,
-# (Dahl/Dijkstra/Hoare, Structured Programming; Academic Press, 1972)
-# who in turn credit the original example to Conway.
-#
-# We have a number of input lines, terminated by a 0 byte. The problem
-# is to squash them together into output lines containing 72 characters
-# each. A semicolon must be added between input lines. Runs of blanks
-# and tabs in input lines must be squashed into single blanks.
-# Occurrences of "**" in input lines must be replaced by "^".
-#
-# Here's a test case:
-
-test = """\
- d = sqrt(b**2 - 4*a*c)
-twoa = 2*a
- L = -b/twoa
- R = d/twoa
- A1 = L + R
- A2 = L - R\0
-"""
-
-# The program should print:
-
-# d = sqrt(b^2 - 4*a*c);twoa = 2*a; L = -b/twoa; R = d/twoa; A1 = L + R;
-#A2 = L - R
-#done
-
-# getline: delivers the next input line to its invoker
-# disassembler: grabs input lines from getline, and delivers them one
-# character at a time to squasher, also inserting a semicolon into
-# the stream between lines
-# squasher: grabs characters from disassembler and passes them on to
-# assembler, first replacing "**" with "^" and squashing runs of
-# whitespace
-# assembler: grabs characters from squasher and packs them into lines
-# with 72 character each, delivering each such line to putline;
-# when it sees a null byte, passes the last line to putline and
-# then kills all the coroutines
-# putline: grabs lines from assembler, and just prints them
-
-from Coroutine import *
-
-def getline(text):
- for line in string.splitfields(text, '\n'):
- co.tran(codisassembler, line)
-
-def disassembler():
- while 1:
- card = co.tran(cogetline)
- for i in range(len(card)):
- co.tran(cosquasher, card[i])
- co.tran(cosquasher, ';')
-
-def squasher():
- while 1:
- ch = co.tran(codisassembler)
- if ch == '*':
- ch2 = co.tran(codisassembler)
- if ch2 == '*':
- ch = '^'
- else:
- co.tran(coassembler, ch)
- ch = ch2
- if ch in ' \t':
- while 1:
- ch2 = co.tran(codisassembler)
- if ch2 not in ' \t':
- break
- co.tran(coassembler, ' ')
- ch = ch2
- co.tran(coassembler, ch)
-
-def assembler():
- line = ''
- while 1:
- ch = co.tran(cosquasher)
- if ch == '\0':
- break
- if len(line) == 72:
- co.tran(coputline, line)
- line = ''
- line = line + ch
- line = line + ' ' * (72 - len(line))
- co.tran(coputline, line)
- co.kill()
-
-def putline():
- while 1:
- line = co.tran(coassembler)
- print(line)
-
-import string
-co = Coroutine()
-cogetline = co.create(getline, test)
-coputline = co.create(putline)
-coassembler = co.create(assembler)
-codisassembler = co.create(disassembler)
-cosquasher = co.create(squasher)
-
-co.tran(coputline)
-print('done')
-
-# end of example
diff --git a/Demo/threads/sync.py b/Demo/threads/sync.py
deleted file mode 100644
index 90fff2e49d..0000000000
--- a/Demo/threads/sync.py
+++ /dev/null
@@ -1,599 +0,0 @@
-# Defines classes that provide synchronization objects. Note that use of
-# this module requires that your Python support threads.
-#
-# condition(lock=None) # a POSIX-like condition-variable object
-# barrier(n) # an n-thread barrier
-# event() # an event object
-# semaphore(n=1) # a semaphore object, with initial count n
-# mrsw() # a multiple-reader single-writer lock
-#
-# CONDITIONS
-#
-# A condition object is created via
-# import this_module
-# your_condition_object = this_module.condition(lock=None)
-#
-# As explained below, a condition object has a lock associated with it,
-# used in the protocol to protect condition data. You can specify a
-# lock to use in the constructor, else the constructor will allocate
-# an anonymous lock for you. Specifying a lock explicitly can be useful
-# when more than one condition keys off the same set of shared data.
-#
-# Methods:
-# .acquire()
-# acquire the lock associated with the condition
-# .release()
-# release the lock associated with the condition
-# .wait()
-# block the thread until such time as some other thread does a
-# .signal or .broadcast on the same condition, and release the
-# lock associated with the condition. The lock associated with
-# the condition MUST be in the acquired state at the time
-# .wait is invoked.
-# .signal()
-# wake up exactly one thread (if any) that previously did a .wait
-# on the condition; that thread will awaken with the lock associated
-# with the condition in the acquired state. If no threads are
-# .wait'ing, this is a nop. If more than one thread is .wait'ing on
-# the condition, any of them may be awakened.
-# .broadcast()
-# wake up all threads (if any) that are .wait'ing on the condition;
-# the threads are woken up serially, each with the lock in the
-# acquired state, so should .release() as soon as possible. If no
-# threads are .wait'ing, this is a nop.
-#
-# Note that if a thread does a .wait *while* a signal/broadcast is
-# in progress, it's guaranteeed to block until a subsequent
-# signal/broadcast.
-#
-# Secret feature: `broadcast' actually takes an integer argument,
-# and will wake up exactly that many waiting threads (or the total
-# number waiting, if that's less). Use of this is dubious, though,
-# and probably won't be supported if this form of condition is
-# reimplemented in C.
-#
-# DIFFERENCES FROM POSIX
-#
-# + A separate mutex is not needed to guard condition data. Instead, a
-# condition object can (must) be .acquire'ed and .release'ed directly.
-# This eliminates a common error in using POSIX conditions.
-#
-# + Because of implementation difficulties, a POSIX `signal' wakes up
-# _at least_ one .wait'ing thread. Race conditions make it difficult
-# to stop that. This implementation guarantees to wake up only one,
-# but you probably shouldn't rely on that.
-#
-# PROTOCOL
-#
-# Condition objects are used to block threads until "some condition" is
-# true. E.g., a thread may wish to wait until a producer pumps out data
-# for it to consume, or a server may wish to wait until someone requests
-# its services, or perhaps a whole bunch of threads want to wait until a
-# preceding pass over the data is complete. Early models for conditions
-# relied on some other thread figuring out when a blocked thread's
-# condition was true, and made the other thread responsible both for
-# waking up the blocked thread and guaranteeing that it woke up with all
-# data in a correct state. This proved to be very delicate in practice,
-# and gave conditions a bad name in some circles.
-#
-# The POSIX model addresses these problems by making a thread responsible
-# for ensuring that its own state is correct when it wakes, and relies
-# on a rigid protocol to make this easy; so long as you stick to the
-# protocol, POSIX conditions are easy to "get right":
-#
-# A) The thread that's waiting for some arbitrarily-complex condition
-# (ACC) to become true does:
-#
-# condition.acquire()
-# while not (code to evaluate the ACC):
-# condition.wait()
-# # That blocks the thread, *and* releases the lock. When a
-# # condition.signal() happens, it will wake up some thread that
-# # did a .wait, *and* acquire the lock again before .wait
-# # returns.
-# #
-# # Because the lock is acquired at this point, the state used
-# # in evaluating the ACC is frozen, so it's safe to go back &
-# # reevaluate the ACC.
-#
-# # At this point, ACC is true, and the thread has the condition
-# # locked.
-# # So code here can safely muck with the shared state that
-# # went into evaluating the ACC -- if it wants to.
-# # When done mucking with the shared state, do
-# condition.release()
-#
-# B) Threads that are mucking with shared state that may affect the
-# ACC do:
-#
-# condition.acquire()
-# # muck with shared state
-# condition.release()
-# if it's possible that ACC is true now:
-# condition.signal() # or .broadcast()
-#
-# Note: You may prefer to put the "if" clause before the release().
-# That's fine, but do note that anyone waiting on the signal will
-# stay blocked until the release() is done (since acquiring the
-# condition is part of what .wait() does before it returns).
-#
-# TRICK OF THE TRADE
-#
-# With simpler forms of conditions, it can be impossible to know when
-# a thread that's supposed to do a .wait has actually done it. But
-# because this form of condition releases a lock as _part_ of doing a
-# wait, the state of that lock can be used to guarantee it.
-#
-# E.g., suppose thread A spawns thread B and later wants to wait for B to
-# complete:
-#
-# In A: In B:
-#
-# B_done = condition() ... do work ...
-# B_done.acquire() B_done.acquire(); B_done.release()
-# spawn B B_done.signal()
-# ... some time later ... ... and B exits ...
-# B_done.wait()
-#
-# Because B_done was in the acquire'd state at the time B was spawned,
-# B's attempt to acquire B_done can't succeed until A has done its
-# B_done.wait() (which releases B_done). So B's B_done.signal() is
-# guaranteed to be seen by the .wait(). Without the lock trick, B
-# may signal before A .waits, and then A would wait forever.
-#
-# BARRIERS
-#
-# A barrier object is created via
-# import this_module
-# your_barrier = this_module.barrier(num_threads)
-#
-# Methods:
-# .enter()
-# the thread blocks until num_threads threads in all have done
-# .enter(). Then the num_threads threads that .enter'ed resume,
-# and the barrier resets to capture the next num_threads threads
-# that .enter it.
-#
-# EVENTS
-#
-# An event object is created via
-# import this_module
-# your_event = this_module.event()
-#
-# An event has two states, `posted' and `cleared'. An event is
-# created in the cleared state.
-#
-# Methods:
-#
-# .post()
-# Put the event in the posted state, and resume all threads
-# .wait'ing on the event (if any).
-#
-# .clear()
-# Put the event in the cleared state.
-#
-# .is_posted()
-# Returns 0 if the event is in the cleared state, or 1 if the event
-# is in the posted state.
-#
-# .wait()
-# If the event is in the posted state, returns immediately.
-# If the event is in the cleared state, blocks the calling thread
-# until the event is .post'ed by another thread.
-#
-# Note that an event, once posted, remains posted until explicitly
-# cleared. Relative to conditions, this is both the strength & weakness
-# of events. It's a strength because the .post'ing thread doesn't have to
-# worry about whether the threads it's trying to communicate with have
-# already done a .wait (a condition .signal is seen only by threads that
-# do a .wait _prior_ to the .signal; a .signal does not persist). But
-# it's a weakness because .clear'ing an event is error-prone: it's easy
-# to mistakenly .clear an event before all the threads you intended to
-# see the event get around to .wait'ing on it. But so long as you don't
-# need to .clear an event, events are easy to use safely.
-#
-# SEMAPHORES
-#
-# A semaphore object is created via
-# import this_module
-# your_semaphore = this_module.semaphore(count=1)
-#
-# A semaphore has an integer count associated with it. The initial value
-# of the count is specified by the optional argument (which defaults to
-# 1) passed to the semaphore constructor.
-#
-# Methods:
-#
-# .p()
-# If the semaphore's count is greater than 0, decrements the count
-# by 1 and returns.
-# Else if the semaphore's count is 0, blocks the calling thread
-# until a subsequent .v() increases the count. When that happens,
-# the count will be decremented by 1 and the calling thread resumed.
-#
-# .v()
-# Increments the semaphore's count by 1, and wakes up a thread (if
-# any) blocked by a .p(). It's an (detected) error for a .v() to
-# increase the semaphore's count to a value larger than the initial
-# count.
-#
-# MULTIPLE-READER SINGLE-WRITER LOCKS
-#
-# A mrsw lock is created via
-# import this_module
-# your_mrsw_lock = this_module.mrsw()
-#
-# This kind of lock is often useful with complex shared data structures.
-# The object lets any number of "readers" proceed, so long as no thread
-# wishes to "write". When a (one or more) thread declares its intention
-# to "write" (e.g., to update a shared structure), all current readers
-# are allowed to finish, and then a writer gets exclusive access; all
-# other readers & writers are blocked until the current writer completes.
-# Finally, if some thread is waiting to write and another is waiting to
-# read, the writer takes precedence.
-#
-# Methods:
-#
-# .read_in()
-# If no thread is writing or waiting to write, returns immediately.
-# Else blocks until no thread is writing or waiting to write. So
-# long as some thread has completed a .read_in but not a .read_out,
-# writers are blocked.
-#
-# .read_out()
-# Use sometime after a .read_in to declare that the thread is done
-# reading. When all threads complete reading, a writer can proceed.
-#
-# .write_in()
-# If no thread is writing (has completed a .write_in, but hasn't yet
-# done a .write_out) or reading (similarly), returns immediately.
-# Else blocks the calling thread, and threads waiting to read, until
-# the current writer completes writing or all the current readers
-# complete reading; if then more than one thread is waiting to
-# write, one of them is allowed to proceed, but which one is not
-# specified.
-#
-# .write_out()
-# Use sometime after a .write_in to declare that the thread is done
-# writing. Then if some other thread is waiting to write, it's
-# allowed to proceed. Else all threads (if any) waiting to read are
-# allowed to proceed.
-#
-# .write_to_read()
-# Use instead of a .write_in to declare that the thread is done
-# writing but wants to continue reading without other writers
-# intervening. If there are other threads waiting to write, they
-# are allowed to proceed only if the current thread calls
-# .read_out; threads waiting to read are only allowed to proceed
-# if there are are no threads waiting to write. (This is a
-# weakness of the interface!)
-
-import _thread as thread
-
-class condition:
- def __init__(self, lock=None):
- # the lock actually used by .acquire() and .release()
- if lock is None:
- self.mutex = thread.allocate_lock()
- else:
- if hasattr(lock, 'acquire') and \
- hasattr(lock, 'release'):
- self.mutex = lock
- else:
- raise TypeError('condition constructor requires ' \
- 'a lock argument')
-
- # lock used to block threads until a signal
- self.checkout = thread.allocate_lock()
- self.checkout.acquire()
-
- # internal critical-section lock, & the data it protects
- self.idlock = thread.allocate_lock()
- self.id = 0
- self.waiting = 0 # num waiters subject to current release
- self.pending = 0 # num waiters awaiting next signal
- self.torelease = 0 # num waiters to release
- self.releasing = 0 # 1 iff release is in progress
-
- def acquire(self):
- self.mutex.acquire()
-
- def release(self):
- self.mutex.release()
-
- def wait(self):
- mutex, checkout, idlock = self.mutex, self.checkout, self.idlock
- if not mutex.locked():
- raise ValueError("condition must be .acquire'd when .wait() invoked")
-
- idlock.acquire()
- myid = self.id
- self.pending = self.pending + 1
- idlock.release()
-
- mutex.release()
-
- while 1:
- checkout.acquire(); idlock.acquire()
- if myid < self.id:
- break
- checkout.release(); idlock.release()
-
- self.waiting = self.waiting - 1
- self.torelease = self.torelease - 1
- if self.torelease:
- checkout.release()
- else:
- self.releasing = 0
- if self.waiting == self.pending == 0:
- self.id = 0
- idlock.release()
- mutex.acquire()
-
- def signal(self):
- self.broadcast(1)
-
- def broadcast(self, num = -1):
- if num < -1:
- raise ValueError('.broadcast called with num %r' % (num,))
- if num == 0:
- return
- self.idlock.acquire()
- if self.pending:
- self.waiting = self.waiting + self.pending
- self.pending = 0
- self.id = self.id + 1
- if num == -1:
- self.torelease = self.waiting
- else:
- self.torelease = min( self.waiting,
- self.torelease + num )
- if self.torelease and not self.releasing:
- self.releasing = 1
- self.checkout.release()
- self.idlock.release()
-
-class barrier:
- def __init__(self, n):
- self.n = n
- self.togo = n
- self.full = condition()
-
- def enter(self):
- full = self.full
- full.acquire()
- self.togo = self.togo - 1
- if self.togo:
- full.wait()
- else:
- self.togo = self.n
- full.broadcast()
- full.release()
-
-class event:
- def __init__(self):
- self.state = 0
- self.posted = condition()
-
- def post(self):
- self.posted.acquire()
- self.state = 1
- self.posted.broadcast()
- self.posted.release()
-
- def clear(self):
- self.posted.acquire()
- self.state = 0
- self.posted.release()
-
- def is_posted(self):
- self.posted.acquire()
- answer = self.state
- self.posted.release()
- return answer
-
- def wait(self):
- self.posted.acquire()
- if not self.state:
- self.posted.wait()
- self.posted.release()
-
-class semaphore:
- def __init__(self, count=1):
- if count <= 0:
- raise ValueError('semaphore count %d; must be >= 1' % count)
- self.count = count
- self.maxcount = count
- self.nonzero = condition()
-
- def p(self):
- self.nonzero.acquire()
- while self.count == 0:
- self.nonzero.wait()
- self.count = self.count - 1
- self.nonzero.release()
-
- def v(self):
- self.nonzero.acquire()
- if self.count == self.maxcount:
- raise ValueError('.v() tried to raise semaphore count above ' \
- 'initial value %r' % self.maxcount)
- self.count = self.count + 1
- self.nonzero.signal()
- self.nonzero.release()
-
-class mrsw:
- def __init__(self):
- # critical-section lock & the data it protects
- self.rwOK = thread.allocate_lock()
- self.nr = 0 # number readers actively reading (not just waiting)
- self.nw = 0 # number writers either waiting to write or writing
- self.writing = 0 # 1 iff some thread is writing
-
- # conditions
- self.readOK = condition(self.rwOK) # OK to unblock readers
- self.writeOK = condition(self.rwOK) # OK to unblock writers
-
- def read_in(self):
- self.rwOK.acquire()
- while self.nw:
- self.readOK.wait()
- self.nr = self.nr + 1
- self.rwOK.release()
-
- def read_out(self):
- self.rwOK.acquire()
- if self.nr <= 0:
- raise ValueError('.read_out() invoked without an active reader')
- self.nr = self.nr - 1
- if self.nr == 0:
- self.writeOK.signal()
- self.rwOK.release()
-
- def write_in(self):
- self.rwOK.acquire()
- self.nw = self.nw + 1
- while self.writing or self.nr:
- self.writeOK.wait()
- self.writing = 1
- self.rwOK.release()
-
- def write_out(self):
- self.rwOK.acquire()
- if not self.writing:
- raise ValueError('.write_out() invoked without an active writer')
- self.writing = 0
- self.nw = self.nw - 1
- if self.nw:
- self.writeOK.signal()
- else:
- self.readOK.broadcast()
- self.rwOK.release()
-
- def write_to_read(self):
- self.rwOK.acquire()
- if not self.writing:
- raise ValueError('.write_to_read() invoked without an active writer')
- self.writing = 0
- self.nw = self.nw - 1
- self.nr = self.nr + 1
- if not self.nw:
- self.readOK.broadcast()
- self.rwOK.release()
-
-# The rest of the file is a test case, that runs a number of parallelized
-# quicksorts in parallel. If it works, you'll get about 600 lines of
-# tracing output, with a line like
-# test passed! 209 threads created in all
-# as the last line. The content and order of preceding lines will
-# vary across runs.
-
-def _new_thread(func, *args):
- global TID
- tid.acquire(); id = TID = TID+1; tid.release()
- io.acquire(); alive.append(id); \
- print('starting thread', id, '--', len(alive), 'alive'); \
- io.release()
- thread.start_new_thread( func, (id,) + args )
-
-def _qsort(tid, a, l, r, finished):
- # sort a[l:r]; post finished when done
- io.acquire(); print('thread', tid, 'qsort', l, r); io.release()
- if r-l > 1:
- pivot = a[l]
- j = l+1 # make a[l:j] <= pivot, and a[j:r] > pivot
- for i in range(j, r):
- if a[i] <= pivot:
- a[j], a[i] = a[i], a[j]
- j = j + 1
- a[l], a[j-1] = a[j-1], pivot
-
- l_subarray_sorted = event()
- r_subarray_sorted = event()
- _new_thread(_qsort, a, l, j-1, l_subarray_sorted)
- _new_thread(_qsort, a, j, r, r_subarray_sorted)
- l_subarray_sorted.wait()
- r_subarray_sorted.wait()
-
- io.acquire(); print('thread', tid, 'qsort done'); \
- alive.remove(tid); io.release()
- finished.post()
-
-def _randarray(tid, a, finished):
- io.acquire(); print('thread', tid, 'randomizing array'); \
- io.release()
- for i in range(1, len(a)):
- wh.acquire(); j = randint(0,i); wh.release()
- a[i], a[j] = a[j], a[i]
- io.acquire(); print('thread', tid, 'randomizing done'); \
- alive.remove(tid); io.release()
- finished.post()
-
-def _check_sort(a):
- if a != range(len(a)):
- raise ValueError('a not sorted', a)
-
-def _run_one_sort(tid, a, bar, done):
- # randomize a, and quicksort it
- # for variety, all the threads running this enter a barrier
- # at the end, and post `done' after the barrier exits
- io.acquire(); print('thread', tid, 'randomizing', a); \
- io.release()
- finished = event()
- _new_thread(_randarray, a, finished)
- finished.wait()
-
- io.acquire(); print('thread', tid, 'sorting', a); io.release()
- finished.clear()
- _new_thread(_qsort, a, 0, len(a), finished)
- finished.wait()
- _check_sort(a)
-
- io.acquire(); print('thread', tid, 'entering barrier'); \
- io.release()
- bar.enter()
- io.acquire(); print('thread', tid, 'leaving barrier'); \
- io.release()
- io.acquire(); alive.remove(tid); io.release()
- bar.enter() # make sure they've all removed themselves from alive
- ## before 'done' is posted
- bar.enter() # just to be cruel
- done.post()
-
-def test():
- global TID, tid, io, wh, randint, alive
- import random
- randint = random.randint
-
- TID = 0 # thread ID (1, 2, ...)
- tid = thread.allocate_lock() # for changing TID
- io = thread.allocate_lock() # for printing, and 'alive'
- wh = thread.allocate_lock() # for calls to random
- alive = [] # IDs of active threads
-
- NSORTS = 5
- arrays = []
- for i in range(NSORTS):
- arrays.append( range( (i+1)*10 ) )
-
- bar = barrier(NSORTS)
- finished = event()
- for i in range(NSORTS):
- _new_thread(_run_one_sort, arrays[i], bar, finished)
- finished.wait()
-
- print('all threads done, and checking results ...')
- if alive:
- raise ValueError('threads still alive at end', alive)
- for i in range(NSORTS):
- a = arrays[i]
- if len(a) != (i+1)*10:
- raise ValueError('length of array', i, 'screwed up')
- _check_sort(a)
-
- print('test passed!', TID, 'threads created in all')
-
-if __name__ == '__main__':
- test()
-
-# end of module
diff --git a/Demo/threads/telnet.py b/Demo/threads/telnet.py
deleted file mode 100644
index dfe4905569..0000000000
--- a/Demo/threads/telnet.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# Minimal interface to the Internet telnet protocol.
-#
-# *** modified to use threads ***
-#
-# It refuses all telnet options and does not recognize any of the other
-# telnet commands, but can still be used to connect in line-by-line mode.
-# It's also useful to play with a number of other services,
-# like time, finger, smtp and even ftp.
-#
-# Usage: telnet host [port]
-#
-# The port may be a service name or a decimal port number;
-# it defaults to 'telnet'.
-
-
-import sys, os, time
-from socket import *
-import _thread as thread
-
-BUFSIZE = 8*1024
-
-# Telnet protocol characters
-
-IAC = chr(255) # Interpret as command
-DONT = chr(254)
-DO = chr(253)
-WONT = chr(252)
-WILL = chr(251)
-
-def main():
- if len(sys.argv) < 2:
- sys.stderr.write('usage: telnet hostname [port]\n')
- sys.exit(2)
- host = sys.argv[1]
- try:
- hostaddr = gethostbyname(host)
- except error:
- sys.stderr.write(sys.argv[1] + ': bad host name\n')
- sys.exit(2)
- #
- if len(sys.argv) > 2:
- servname = sys.argv[2]
- else:
- servname = 'telnet'
- #
- if '0' <= servname[:1] <= '9':
- port = eval(servname)
- else:
- try:
- port = getservbyname(servname, 'tcp')
- except error:
- sys.stderr.write(servname + ': bad tcp service name\n')
- sys.exit(2)
- #
- s = socket(AF_INET, SOCK_STREAM)
- #
- try:
- s.connect((host, port))
- except error as msg:
- sys.stderr.write('connect failed: %r\n' % (msg,))
- sys.exit(1)
- #
- thread.start_new(child, (s,))
- parent(s)
-
-def parent(s):
- # read socket, write stdout
- iac = 0 # Interpret next char as command
- opt = '' # Interpret next char as option
- while 1:
- data, dummy = s.recvfrom(BUFSIZE)
- if not data:
- # EOF -- exit
- sys.stderr.write( '(Closed by remote host)\n')
- sys.exit(1)
- cleandata = ''
- for c in data:
- if opt:
- print(ord(c))
-## print '(replying: %r)' % (opt+c,)
- s.send(opt + c)
- opt = ''
- elif iac:
- iac = 0
- if c == IAC:
- cleandata = cleandata + c
- elif c in (DO, DONT):
- if c == DO: print('(DO)', end=' ')
- else: print('(DONT)', end=' ')
- opt = IAC + WONT
- elif c in (WILL, WONT):
- if c == WILL: print('(WILL)', end=' ')
- else: print('(WONT)', end=' ')
- opt = IAC + DONT
- else:
- print('(command)', ord(c))
- elif c == IAC:
- iac = 1
- print('(IAC)', end=' ')
- else:
- cleandata = cleandata + c
- sys.stdout.write(cleandata)
- sys.stdout.flush()
-## print 'Out:', repr(cleandata)
-
-def child(s):
- # read stdin, write socket
- while 1:
- line = sys.stdin.readline()
-## print 'Got:', repr(line)
- if not line: break
- s.send(line)
-
-main()
diff --git a/Demo/tix/INSTALL.txt b/Demo/tix/INSTALL.txt
deleted file mode 100644
index ac70b68c80..0000000000
--- a/Demo/tix/INSTALL.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-$Id$
-
-Installing Tix.py
-----------------
-
-0) To use Tix.py, you need Tcl/Tk (V8.3.3), Tix (V8.1.1) and Python (V2.1.1).
- Tix.py has been written and tested on a Intel Pentium running RH Linux 5.2
- and Mandrake Linux 7.0 and Windows with the above mentioned packages.
-
- Older versions, e.g. Tix 4.1 and Tk 8.0, might also work.
-
- There is nothing OS-specific in Tix.py itself so it should work on
- any machine with Tix and Python installed. You can get Tcl and Tk
- from http://dev.scriptics.com and Tix from http://tix.sourceforge.net.
-
-1) Build and install Tcl/Tk 8.3. Build and install Tix 8.1.
- Ensure that Tix is properly installed by running tixwish and executing
- the demo programs. Under Unix, use the --enable-shared configure option
- for all three. We recommend tcl8.3.3 for this release of Tix.py.
-
-2a) If you have a distribution like ActiveState with a tcl subdirectory
- of $PYTHONHOME, which contains the directories tcl8.3 and tk8.3,
- make a directory tix8.1 as well. Recursively copy the files from
- <tix>/library to $PYTHONHOME/lib/tix8.1, and copy the dynamic library
- (tix8183.dll or libtix8.1.8.3.so) to the same place as the tcl dynamic
- libraries ($PYTHONHOME/Dlls or lib/python-2.1/lib-dynload). In this
- case you are all installed, and you can skip to the end.
-
-2b) Modify Modules/Setup.dist and setup.py to change the version of the
- tix library from tix4.1.8.0 to tix8.1.8.3
- These modified files can be used for Tkinter with or without Tix.
-
-3) The default is to build dynamically, and use the Tcl 'package require'.
- To build statically, modify the Modules/Setup file to link in the Tix
- library according to the comments in the file. On Linux this looks like:
-
-# *** Always uncomment this (leave the leading underscore in!):
-_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
-# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
- -L/usr/local/lib \
-# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
- -I/usr/local/include \
-# *** Uncomment and edit to reflect where your X11 header files are:
- -I/usr/X11R6/include \
-# *** Or uncomment this for Solaris:
-# -I/usr/openwin/include \
-# *** Uncomment and edit for BLT extension only:
-# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
-# *** Uncomment and edit for PIL (TkImaging) extension only:
-# (See http://www.pythonware.com/products/pil/ for more info)
-# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
-# *** Uncomment and edit for TOGL extension only:
-# -DWITH_TOGL togl.c \
-# *** Uncomment and edit for Tix extension only:
- -DWITH_TIX -ltix8.1.8.3 \
-# *** Uncomment and edit to reflect your Tcl/Tk versions:
- -ltk8.3 -ltcl8.3 \
-# *** Uncomment and edit to reflect where your X11 libraries are:
- -L/usr/X11R6/lib \
-# *** Or uncomment this for Solaris:
-# -L/usr/openwin/lib \
-# *** Uncomment these for TOGL extension only:
-# -lGL -lGLU -lXext -lXmu \
-# *** Uncomment for AIX:
-# -lld \
-# *** Always uncomment this; X11 libraries to link with:
- -lX11
-
-4) Rebuild Python and reinstall.
-
-You should now have a working Tix implementation in Python. To see if all
-is as it should be, run the 'tixwidgets.py' script in the Demo/tix directory.
-Under X windows, do
- /usr/local/bin/python Demo/tix/tixwidgets.py
-
-If this does not work, you may need to tell python where to find
-the Tcl, Tk and Tix library files. This is done by setting the
-TCL_LIBRARY, TK_LIBRARY and TIX_LIBRARY environment variables. Try this:
-
- env TCL_LIBRARY=/usr/local/lib/tcl8.3 \
- TK_LIBRARY=/usr/local/lib/tk8.3 \
- TIX_LIBRARY=/usr/local/lib/tix8.1 \
- /usr/local/bin/python Demo/tix/tixwidgets.py
-
-
-If you find any bugs or have suggestions for improvement, please report them
-via http://tix.sourceforge.net
-
-
diff --git a/Demo/tix/README.txt b/Demo/tix/README.txt
deleted file mode 100644
index e0196ac3c7..0000000000
--- a/Demo/tix/README.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-About Tix.py
------------
-
-Tix.py is based on an idea of Jean-Marc Lugrin (lugrin@ms.com) who wrote
-pytix (another Python-Tix marriage). Tix widgets are an attractive and
-useful extension to Tk. See http://tix.sourceforge.net
-for more details about Tix and how to get it.
-
-Features:
- 1) It is almost complete.
- 2) Tix widgets are represented by classes in Python. Sub-widgets
- are members of the mega-widget class. For example, if a
- particular TixWidget (e.g. ScrolledText) has an embedded widget
- (Text in this case), it is possible to call the methods of the
- child directly.
- 3) The members of the class are created automatically. In the case
- of widgets like ButtonBox, the members are added dynamically.
-
-
diff --git a/Demo/tix/bitmaps/about.xpm b/Demo/tix/bitmaps/about.xpm
deleted file mode 100755
index 33ffcc06ef..0000000000
--- a/Demo/tix/bitmaps/about.xpm
+++ /dev/null
@@ -1,50 +0,0 @@
-/* XPM */
-static char * about_xpm[] = {
-"50 40 7 1",
-" s None c None",
-". c black",
-"X c white",
-"o c gray70",
-"O c navy",
-"+ c red",
-"@ c yellow",
-" ",
-" ",
-" ",
-" ................................. ",
-" ..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo. ",
-" .XooooooooooooooooooooooooooooooXo. ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXooXo. ",
-" ..oooooooooooooooooooooooooooooooXo. ",
-" ...............................XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo.++++ ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo+++ ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Xo+++++ ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Xo++++++ ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Xo+++ + ",
-" .OOOOO@@@@@OOOOOOOOOOOOOOOOOOO.Xo++. ",
-" .OOOOOOO@OOOOO@OOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOO@OOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOO@OOOO@@OOO@OOO@OOOOOOO.XoXo. ",
-" .OOOOOOO@OOOOO@OOOO@O@OOOOOOOO.XoXo. ",
-" .OOOOOOO@OOOOO@OOOOO@OOOOOOOOO.XoXo. ",
-" .OOOOOOO@OOOOO@OOOOO@OOOOOOOOO.XoXo. ",
-" .OOOOOOO@OOOOO@OOOO@O@OOOOOOOO.XoXo. ",
-" .OOOOOOO@OOOO@@@OO@OOO@OOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XoXo. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Xo.. ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Xo ",
-" OOOOOOOOOOOOOOOOOOOOOOOOOOOOO.X. ",
-" ............................. ",
-" ",
-" ",
-" "};
diff --git a/Demo/tix/bitmaps/bold.xbm b/Demo/tix/bitmaps/bold.xbm
deleted file mode 100755
index ebff8d1178..0000000000
--- a/Demo/tix/bitmaps/bold.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define bold_width 16
-#define bold_height 16
-static unsigned char bold_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xfc, 0x0f, 0x18, 0x1c, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x1c, 0xf8, 0x0f, 0xf8, 0x0f, 0x18, 0x18, 0x18, 0x30,
- 0x18, 0x30, 0x18, 0x38, 0xfc, 0x3f, 0xfc, 0x1f};
diff --git a/Demo/tix/bitmaps/capital.xbm b/Demo/tix/bitmaps/capital.xbm
deleted file mode 100755
index fb4e0703b1..0000000000
--- a/Demo/tix/bitmaps/capital.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define capital_width 16
-#define capital_height 16
-static unsigned char capital_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x08, 0x30, 0x0c, 0x30, 0x06,
- 0x30, 0x03, 0xb0, 0x01, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x01, 0xb0, 0x03,
- 0x30, 0x07, 0x30, 0x0e, 0x30, 0x1c, 0x00, 0x00};
diff --git a/Demo/tix/bitmaps/centerj.xbm b/Demo/tix/bitmaps/centerj.xbm
deleted file mode 100755
index 9d2c064834..0000000000
--- a/Demo/tix/bitmaps/centerj.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define centerj_width 16
-#define centerj_height 16
-static unsigned char centerj_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3e, 0x00, 0x00, 0xc0, 0x0d,
- 0x00, 0x00, 0x58, 0x77, 0x00, 0x00, 0xb0, 0x3b, 0x00, 0x00, 0xdc, 0xf7,
- 0x00, 0x00, 0xf0, 0x3e, 0x00, 0x00, 0xd8, 0x7e};
diff --git a/Demo/tix/bitmaps/combobox.xbm b/Demo/tix/bitmaps/combobox.xbm
deleted file mode 100755
index f5947f57b4..0000000000
--- a/Demo/tix/bitmaps/combobox.xbm
+++ /dev/null
@@ -1,14 +0,0 @@
-#define combobox_width 32
-#define combobox_height 32
-static unsigned char combobox_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xfc, 0xff, 0xff, 0x3e, 0x04, 0x00, 0x80, 0x2a, 0x04, 0x00, 0x80, 0x2a,
- 0x04, 0x00, 0x80, 0x2a, 0x04, 0x00, 0x80, 0x2b, 0xfc, 0xff, 0xff, 0x3e,
- 0x08, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x3e, 0x08, 0x00, 0x00, 0x2a,
- 0x28, 0x49, 0x00, 0x2a, 0x08, 0x00, 0x00, 0x3e, 0x08, 0x00, 0x00, 0x22,
- 0x08, 0x00, 0x00, 0x22, 0x28, 0x49, 0x12, 0x22, 0x08, 0x00, 0x00, 0x22,
- 0x08, 0x00, 0x00, 0x22, 0x08, 0x00, 0x00, 0x22, 0x28, 0x49, 0x02, 0x22,
- 0x08, 0x00, 0x00, 0x3e, 0x08, 0x00, 0x00, 0x2a, 0x08, 0x00, 0x00, 0x2a,
- 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/Demo/tix/bitmaps/combobox.xpm b/Demo/tix/bitmaps/combobox.xpm
deleted file mode 100755
index d0234ab8e2..0000000000
--- a/Demo/tix/bitmaps/combobox.xpm
+++ /dev/null
@@ -1,49 +0,0 @@
-/* XPM */
-static char * combobox_xpm[] = {
-"50 40 6 1",
-" s None c None",
-". c black",
-"X c white",
-"o c #FFFF80808080",
-"O c gray70",
-"+ c #808000008080",
-" ",
-" ",
-" ",
-" .................................... XXXXXXX ",
-" .ooooooooooooooooooooooooooooooooooX X . . ",
-" .ooooooooooooooooooooooooooooooooooX X . . ",
-" .oooo.oooooooooooooooooooooooooooooX X . . ",
-" .oo.o..oo.o.oo.o.ooooooooooooooooooX X . . ",
-" .o..o.o.o.oo.oo.oo.ooooooooooooooooX X ... . ",
-" .oo.oo.oo.o.oo.ooo.ooooooooooooooooX X . . ",
-" .ooooooooooooooooooooooooooooooooooX X . ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X...... ",
-" ",
-" ",
-" ",
-" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ",
-" X............................................ ",
-" X.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX.OOOOX. ",
-" X.O+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX.OX OX. ",
-" X.O++OOO+OO+++OOOOOOOOOOOOOOOOOOOOOOOX.X ..X. ",
-" X.O+O+O+OOO+O+OOOOOOOOOOOOOOOOOOOOOOOX.OOOOX. ",
-" X.O++OOO+OO+++OOOOOOOOOOOOOOOOOOOOOOOX.OOOOX. ",
-" X.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX.XXXXX. ",
-" X.O.....X..........................OOX.X .X. ",
-" X.OX...XXX.X.XX.XX.................OOX.X .X. ",
-" X.OX.X..X..X.XX..XX.X..............OOX.X .X. ",
-" X.O.X...X..X.X...X..X..............OOX.X .X. ",
-" X.OOOOOOOOOOOOOOOOOOOOOOOO+OOOOOOOOOOX.X .X. ",
-" X.OOOOOOOOO+OOO+OOOOO+OOOO+OOOOOOOOOOX.X .X. ",
-" X.O+++OO+OO+O+OO++O++OO+OO+OOOOOOOOOOX.X...X. ",
-" X.OO+OO++OO+O+OO+OOO+OO+O++OOOOOOOOOOX.OOOOX. ",
-" X.OOOOOOOO+OOOOO++OO+OOOOOOOOOOOOOOOOX.OOOOX. ",
-" X.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX.X .X. ",
-" X.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX.O .OX. ",
-" X.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX.OOOOX. ",
-" X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXX. ",
-" X............................................ ",
-" ",
-" ",
-" "};
diff --git a/Demo/tix/bitmaps/combobox.xpm.1 b/Demo/tix/bitmaps/combobox.xpm.1
deleted file mode 100755
index 63792a4908..0000000000
--- a/Demo/tix/bitmaps/combobox.xpm.1
+++ /dev/null
@@ -1,47 +0,0 @@
-/* XPM */
-static char * combobox_xpm[] = {
-"50 40 4 1",
-" s None c None",
-". c black",
-"X c #FFFF80808080",
-"o c gray70",
-" ",
-" ",
-" ",
-" .................................... ....... ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. . . . ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. . . . ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. . . . ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. . . . ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. . ... . ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. . . . ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. . . ",
-" .................................... ....... ",
-" ",
-" ............................................. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .o...................................o.ooooo. ",
-" .o...................................o.ooooo. ",
-" .o...................................o.ooooo. ",
-" .o...................................o.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" .ooooooooooooooooooooooooooooooooooooo.ooooo. ",
-" ............................................. ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/Demo/tix/bitmaps/drivea.xbm b/Demo/tix/bitmaps/drivea.xbm
deleted file mode 100755
index 83c636c670..0000000000
--- a/Demo/tix/bitmaps/drivea.xbm
+++ /dev/null
@@ -1,14 +0,0 @@
-#define drivea_width 32
-#define drivea_height 32
-static unsigned char drivea_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xf8, 0xff, 0xff, 0x1f, 0x08, 0x00, 0x00, 0x18, 0xa8, 0xaa, 0xaa, 0x1a,
- 0x48, 0x55, 0xd5, 0x1d, 0xa8, 0xaa, 0xaa, 0x1b, 0x48, 0x55, 0x55, 0x1d,
- 0xa8, 0xfa, 0xaf, 0x1a, 0xc8, 0xff, 0xff, 0x1d, 0xa8, 0xfa, 0xaf, 0x1a,
- 0x48, 0x55, 0x55, 0x1d, 0xa8, 0xaa, 0xaa, 0x1a, 0x48, 0x55, 0x55, 0x1d,
- 0xa8, 0xaa, 0xaa, 0x1a, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/Demo/tix/bitmaps/drivea.xpm b/Demo/tix/bitmaps/drivea.xpm
deleted file mode 100755
index 4d274b995f..0000000000
--- a/Demo/tix/bitmaps/drivea.xpm
+++ /dev/null
@@ -1,43 +0,0 @@
-/* XPM */
-static char * drivea_xpm[] = {
-/* width height ncolors chars_per_pixel */
-"32 32 5 1",
-/* colors */
-" s None c None",
-". c #000000000000",
-"X c white",
-"o c #c000c000c000",
-"O c #800080008000",
-/* pixels */
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" .......................... ",
-" .XXXXXXXXXXXXXXXXXXXXXXXo. ",
-" .XooooooooooooooooooooooO. ",
-" .Xooooooooooooooooo..oooO. ",
-" .Xooooooooooooooooo..oooO. ",
-" .XooooooooooooooooooooooO. ",
-" .Xoooooooo.......oooooooO. ",
-" .Xoo...................oO. ",
-" .Xoooooooo.......oooooooO. ",
-" .XooooooooooooooooooooooO. ",
-" .XooooooooooooooooooooooO. ",
-" .XooooooooooooooooooooooO. ",
-" .XooooooooooooooooooooooO. ",
-" .oOOOOOOOOOOOOOOOOOOOOOOO. ",
-" .......................... ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/Demo/tix/bitmaps/exit.xpm b/Demo/tix/bitmaps/exit.xpm
deleted file mode 100755
index 505a07bdf6..0000000000
--- a/Demo/tix/bitmaps/exit.xpm
+++ /dev/null
@@ -1,48 +0,0 @@
-/* XPM */
-static char * exit_xpm[] = {
-"50 40 5 1",
-" s None c None",
-". c black",
-"X c white",
-"o c #000080800000",
-"O c yellow",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ....................................... ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
-" .XoooooooooooooooooooooooooooooooooooX. ",
-" .XoooooooooooooooooooooooooooooooooooX. ",
-" .XoooooooooooooooooooooooOoooooooooooX. ",
-" .XoooooooooooooooooooooooOOooooooooooX. ",
-" .XoooooooooooooooooooooooOOOoooooooooX. ",
-" .XoooooOOOOOOOOOOOOOOOOOOOOOOooooooooX. ",
-" .XoooooOOOOOOOOOOOOOOOOOOOOOOOoooooooX. ",
-" .XoooooOOOOOOOOOOOOOOOOOOOOOOOOooooooX. ",
-" .XoooooOOOOOOOOOOOOOOOOOOOOOOOOOoooooX. ",
-" .XoooooOOOOOOOOOOOOOOOOOOOOOOOOooooooX. ",
-" .XoooooOOOOOOOOOOOOOOOOOOOOOOOoooooooX. ",
-" .XoooooOOOOOOOOOOOOOOOOOOOOOOooooooooX. ",
-" .XoooooooooooooooooooooooOOOoooooooooX. ",
-" .XoooooooooooooooooooooooOOooooooooooX. ",
-" .XoooooooooooooooooooooooOoooooooooooX. ",
-" .XoooooooooooooooooooooooooooooooooooX. ",
-" .XoooooooooooooooooooooooooooooooooooX. ",
-" .XoooooooooooooooooooooooooooooooooooX. ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ",
-" ....................................... ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/Demo/tix/bitmaps/filebox.xbm b/Demo/tix/bitmaps/filebox.xbm
deleted file mode 100755
index c8f7ac255b..0000000000
--- a/Demo/tix/bitmaps/filebox.xbm
+++ /dev/null
@@ -1,14 +0,0 @@
-#define filebox_width 32
-#define filebox_height 32
-static unsigned char filebox_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x3f, 0x04, 0x00, 0x00, 0x20,
- 0xe4, 0xff, 0xff, 0x27, 0x24, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x24,
- 0xe4, 0xff, 0xff, 0x27, 0x04, 0x00, 0x00, 0x20, 0xe4, 0x7f, 0xfe, 0x27,
- 0x24, 0x50, 0x02, 0x25, 0x24, 0x40, 0x02, 0x24, 0x24, 0x50, 0x02, 0x25,
- 0x24, 0x40, 0x02, 0x24, 0x24, 0x50, 0x02, 0x25, 0x24, 0x40, 0x02, 0x24,
- 0x24, 0x50, 0x02, 0x25, 0xe4, 0x7f, 0xfe, 0x27, 0x04, 0x00, 0x00, 0x20,
- 0xe4, 0xff, 0xff, 0x27, 0x24, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x24,
- 0xe4, 0xff, 0xff, 0x27, 0x04, 0x00, 0x00, 0x20, 0xfc, 0xff, 0xff, 0x3f,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/Demo/tix/bitmaps/filebox.xpm b/Demo/tix/bitmaps/filebox.xpm
deleted file mode 100755
index 7377ee60e6..0000000000
--- a/Demo/tix/bitmaps/filebox.xpm
+++ /dev/null
@@ -1,49 +0,0 @@
-/* XPM */
-static char * filebox_xpm[] = {
-"50 40 6 1",
-" s None c None",
-". c white",
-"X c gray80",
-"o c black",
-"O c #FFFF80808080",
-"+ c gray70",
-" ",
-" ",
-" ",
-" ............................................ ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXooXooXoXooXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXooXooXoXooXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXooooooooooooooooooooooooooooooooooooo.XXo ",
-" .XXoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XXo ",
-" .XXoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XXo ",
-" .XX......................................XXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXoooooooooooooooo.XXXXoooooooooooooooo.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XXo+++++++++++++++.XXXXo+++++++++++++++.XXo ",
-" .XX.................XXXX.................XXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXooXooXoXooXoXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXooXooXoXooXoXooXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXoooooooooooooooooooooooooooooooooooooo.Xo ",
-" .XXoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Xo ",
-" .XXoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Xo ",
-" .XX.......................................Xo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .ooooooooooooooooooooooooooooooooooooooooooo ",
-" ",
-" ",
-" "};
diff --git a/Demo/tix/bitmaps/italic.xbm b/Demo/tix/bitmaps/italic.xbm
deleted file mode 100755
index 169c3cb75f..0000000000
--- a/Demo/tix/bitmaps/italic.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define italic_width 16
-#define italic_height 16
-static unsigned char italic_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x80, 0x3f, 0x00, 0x06, 0x00, 0x06,
- 0x00, 0x03, 0x00, 0x03, 0x80, 0x01, 0x80, 0x01, 0xc0, 0x00, 0xc0, 0x00,
- 0x60, 0x00, 0x60, 0x00, 0xfc, 0x01, 0xfc, 0x01};
diff --git a/Demo/tix/bitmaps/justify.xbm b/Demo/tix/bitmaps/justify.xbm
deleted file mode 100755
index bba660acec..0000000000
--- a/Demo/tix/bitmaps/justify.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define justify_width 16
-#define justify_height 16
-static unsigned char justify_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xdb, 0x00, 0x00, 0x7c, 0xdb,
- 0x00, 0x00, 0xbc, 0xf7, 0x00, 0x00, 0xdc, 0xde, 0x00, 0x00, 0x6c, 0xdf,
- 0x00, 0x00, 0x6c, 0xef, 0x00, 0x00, 0xdc, 0xdf};
diff --git a/Demo/tix/bitmaps/leftj.xbm b/Demo/tix/bitmaps/leftj.xbm
deleted file mode 100755
index 5f8e006f4e..0000000000
--- a/Demo/tix/bitmaps/leftj.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define leftj_width 16
-#define leftj_height 16
-static unsigned char leftj_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x6d, 0x00, 0x00, 0xdc, 0x01,
- 0x00, 0x00, 0xec, 0x0e, 0x00, 0x00, 0xfc, 0x7e, 0x00, 0x00, 0xdc, 0x03,
- 0x00, 0x00, 0x6c, 0x3b, 0x00, 0x00, 0x6c, 0x1f};
diff --git a/Demo/tix/bitmaps/netw.xbm b/Demo/tix/bitmaps/netw.xbm
deleted file mode 100755
index a684d65d4b..0000000000
--- a/Demo/tix/bitmaps/netw.xbm
+++ /dev/null
@@ -1,14 +0,0 @@
-#define netw_width 32
-#define netw_height 32
-static unsigned char netw_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x02, 0x40,
- 0x00, 0x00, 0xfa, 0x5f, 0x00, 0x00, 0x0a, 0x50, 0x00, 0x00, 0x0a, 0x52,
- 0x00, 0x00, 0x0a, 0x52, 0x00, 0x00, 0x8a, 0x51, 0x00, 0x00, 0x0a, 0x50,
- 0x00, 0x00, 0x4a, 0x50, 0x00, 0x00, 0x0a, 0x50, 0x00, 0x00, 0x0a, 0x50,
- 0x00, 0x00, 0xfa, 0x5f, 0x00, 0x00, 0x02, 0x40, 0xfe, 0x7f, 0x52, 0x55,
- 0x02, 0x40, 0xaa, 0x6a, 0xfa, 0x5f, 0xfe, 0x7f, 0x0a, 0x50, 0xfe, 0x7f,
- 0x0a, 0x52, 0x80, 0x00, 0x0a, 0x52, 0x80, 0x00, 0x8a, 0x51, 0x80, 0x00,
- 0x0a, 0x50, 0x80, 0x00, 0x4a, 0x50, 0x80, 0x00, 0x0a, 0x50, 0xe0, 0x03,
- 0x0a, 0x50, 0x20, 0x02, 0xfa, 0xdf, 0x3f, 0x03, 0x02, 0x40, 0xa0, 0x02,
- 0x52, 0x55, 0xe0, 0x03, 0xaa, 0x6a, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00,
- 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/Demo/tix/bitmaps/netw.xpm b/Demo/tix/bitmaps/netw.xpm
deleted file mode 100755
index fff6593bca..0000000000
--- a/Demo/tix/bitmaps/netw.xpm
+++ /dev/null
@@ -1,45 +0,0 @@
-/* XPM */
-static char * netw_xpm[] = {
-/* width height ncolors chars_per_pixel */
-"32 32 7 1",
-/* colors */
-" s None c None",
-". c #000000000000",
-"X c white",
-"o c #c000c000c000",
-"O c #404040",
-"+ c blue",
-"@ c red",
-/* pixels */
-" ",
-" .............. ",
-" .XXXXXXXXXXXX. ",
-" .XooooooooooO. ",
-" .Xo.......XoO. ",
-" .Xo.++++o+XoO. ",
-" .Xo.++++o+XoO. ",
-" .Xo.++oo++XoO. ",
-" .Xo.++++++XoO. ",
-" .Xo.+o++++XoO. ",
-" .Xo.++++++XoO. ",
-" .Xo.XXXXXXXoO. ",
-" .XooooooooooO. ",
-" .Xo@ooo....oO. ",
-" .............. .XooooooooooO. ",
-" .XXXXXXXXXXXX. .XooooooooooO. ",
-" .XooooooooooO. .OOOOOOOOOOOO. ",
-" .Xo.......XoO. .............. ",
-" .Xo.++++o+XoO. @ ",
-" .Xo.++++o+XoO. @ ",
-" .Xo.++oo++XoO. @ ",
-" .Xo.++++++XoO. @ ",
-" .Xo.+o++++XoO. @ ",
-" .Xo.++++++XoO. ..... ",
-" .Xo.XXXXXXXoO. .XXX. ",
-" .XooooooooooO.@@@@@@.X O. ",
-" .Xo@ooo....oO. .OOO. ",
-" .XooooooooooO. ..... ",
-" .XooooooooooO. ",
-" .OOOOOOOOOOOO. ",
-" .............. ",
-" "};
diff --git a/Demo/tix/bitmaps/optmenu.xpm b/Demo/tix/bitmaps/optmenu.xpm
deleted file mode 100755
index 63bab81299..0000000000
--- a/Demo/tix/bitmaps/optmenu.xpm
+++ /dev/null
@@ -1,48 +0,0 @@
-/* XPM */
-static char * optmenu_xpm[] = {
-"50 40 5 1",
-" s None c None",
-". c white",
-"X c gray80",
-"o c gray50",
-"O c black",
-" ",
-" ",
-" .............................. ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXOXOXXOXXOXXXXOOXXXXXXXXXXo ",
-" .XXXOXOXXOXOXXXOXXOXXXXXXXXXXo ",
-" .XXXXOXXOXXOXXXOXXXOXXXXXXXXXo ",
-" .XXXXOXXXOXXOOXXOXOXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo.............o ",
-" .............................o o ",
-" ..XXXOXXXXXOXXXXXXXXOXXXXXXXOo o ",
-" ..XXOXOXOXXOXOXXXOXXOXXXXXXXOo ...... o ",
-" ..XXXOXXXOXXOXXXOXXXOXXXXXXXOo . o o ",
-" ..XXOXXXOXXXOXOXXOXXOXXXXXXXOo . o o ",
-" ..XXXXXXXXXXXXXXXXXXXXXXXXXXOo .ooooo o ",
-" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOo o ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo o ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXooooooooooooooo ",
-" .XXXXOXXXXXOXXXXXXXXXXXXXXXXXo ",
-" .XXXOXXXXXXXXXOXXXXXXXXXXXXXXo ",
-" .XXXXOXXOXXOXOXOXXXXXXXXXXXXXo ",
-" .XXXXXOXXOXOXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXOXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXOXOXXXXXXXOXOXXXXXOXXXXXXo ",
-" .XXXXXOXOXOXXOXXXXXOXXOXXXXXXo ",
-" .XXXXOXXOXOXOXXXOXOXOXXOXXXXXo ",
-" .XXXOXXXXOXXOXXXOXXOXXXXOXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" oooooooooooooooooooooooooooooo ",
-" ",
-" ",
-" ",
-" "};
diff --git a/Demo/tix/bitmaps/rightj.xbm b/Demo/tix/bitmaps/rightj.xbm
deleted file mode 100755
index 1d438e0090..0000000000
--- a/Demo/tix/bitmaps/rightj.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define rightj_width 16
-#define rightj_height 16
-static unsigned char rightj_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xdb, 0x00, 0x00, 0x70, 0xdb,
- 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0xd8, 0xde, 0x00, 0x00, 0xc0, 0xdd,
- 0x00, 0x00, 0xa0, 0xef, 0x00, 0x00, 0xd8, 0xde};
diff --git a/Demo/tix/bitmaps/select.xpm b/Demo/tix/bitmaps/select.xpm
deleted file mode 100755
index 392e5a0834..0000000000
--- a/Demo/tix/bitmaps/select.xpm
+++ /dev/null
@@ -1,52 +0,0 @@
-/* XPM */
-static char * select_xpm[] = {
-"50 40 9 1",
-" s None c None",
-". c black",
-"X c gray95",
-"o c gray50",
-"O c gray70",
-"+ c navy",
-"@ c #000080800000",
-"# c #808000000000",
-"$ c white",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" .............................................. ",
-" .XXXXXXXXXXooooooooooooXXXXXXXXXXXoXXXXXXXXXX. ",
-" .X ooOOOOOOOOOOXX oX o. ",
-" .X ooOOOOOOOOOOXX oX o. ",
-" .X ++++ ooOOOOOOOOOOXX ... oX @ o. ",
-" .X +++++ ooOOOOOOOOOOXX . . oX @@@ o. ",
-" .X +++ + ooOOOOOOOOOOXX . . oX @ @ o. ",
-" .X + + ooOO#####OOOXX . . oX @ @ o. ",
-" .X + + ooOO#OOO##OOXX . oX @ @ o. ",
-" .X + + ooO##OOOO##OXX . oX @ @ o. ",
-" .X ++ ++ ooO###OOO#OOXX . oX @ @ o. ",
-" .X +++++++ ooO#######OOXX . oX @ @ o. ",
-" .X + + ooO##O#OO#OOXX . oX @ @ o. ",
-" .X + ++ ooO##OOOOO#OXX . . oX @ @ o. ",
-" .X + + ooOO#OOOOO#OXX . . oX @ @@ o. ",
-" .X + ++ ooOO#OOOOO#OXX .... oX @@@@@ o. ",
-" .X ooOO######OOXX oX o. ",
-" .X ooOOOOOOOOOOXX $oX o. ",
-" .XoooooooooooXXXXXXXXXXXoooooooooooXooooooooo. ",
-" .............................................. ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/Demo/tix/bitmaps/tix.gif b/Demo/tix/bitmaps/tix.gif
deleted file mode 100755
index e7d51a086c..0000000000
--- a/Demo/tix/bitmaps/tix.gif
+++ /dev/null
Binary files differ
diff --git a/Demo/tix/bitmaps/underline.xbm b/Demo/tix/bitmaps/underline.xbm
deleted file mode 100755
index f07bb46054..0000000000
--- a/Demo/tix/bitmaps/underline.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define underline_width 16
-#define underline_height 16
-static unsigned char underline_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x1c, 0x38, 0x1c,
- 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x70, 0x0e,
- 0xf0, 0x0f, 0xe0, 0x07, 0x00, 0x00, 0xf8, 0x1f};
diff --git a/Demo/tix/grid.py b/Demo/tix/grid.py
deleted file mode 100644
index 4268f07523..0000000000
--- a/Demo/tix/grid.py
+++ /dev/null
@@ -1,28 +0,0 @@
-###
-import tkinter.tix as tk
-from pprint import pprint
-
-r= tk.Tk()
-r.title("test")
-
-l=tk.Label(r, name="a_label")
-l.pack()
-
-class MyGrid(tk.Grid):
- def __init__(self, *args, **kwargs):
- kwargs['editnotify']= self.editnotify
- tk.Grid.__init__(self, *args, **kwargs)
- def editnotify(self, x, y):
- return True
-
-g = MyGrid(r, name="a_grid",
-selectunit="cell")
-g.pack(fill=tk.BOTH)
-for x in range(5):
- for y in range(5):
- g.set(x,y,text=str((x,y)))
-
-c = tk.Button(r, text="Close", command=r.destroy)
-c.pack()
-
-tk.mainloop()
diff --git a/Demo/tix/samples/Balloon.py b/Demo/tix/samples/Balloon.py
deleted file mode 100755
index bc25a2ef67..0000000000
--- a/Demo/tix/samples/Balloon.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program.
-
-# This file demonstrates the use of the tixBalloon widget, which provides
-# a interesting way to give help tips about elements in your user interface.
-# Your can display the help message in a "balloon" and a status bar widget.
-#
-
-import tkinter.tix
-
-TCL_ALL_EVENTS = 0
-
-def RunSample (root):
- balloon = DemoBalloon(root)
- balloon.mainloop()
- balloon.destroy()
-
-class DemoBalloon:
- def __init__(self, w):
- self.root = w
- self.exit = -1
-
- z = w.winfo_toplevel()
- z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
-
- status = tkinter.tix.Label(w, width=40, relief=tkinter.tix.SUNKEN, bd=1)
- status.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.Y, padx=2, pady=1)
-
- # Create two mysterious widgets that need balloon help
- button1 = tkinter.tix.Button(w, text='Something Unexpected',
- command=self.quitcmd)
- button2 = tkinter.tix.Button(w, text='Something Else Unexpected')
- button2['command'] = lambda w=button2: w.destroy()
- button1.pack(side=tkinter.tix.TOP, expand=1)
- button2.pack(side=tkinter.tix.TOP, expand=1)
-
- # Create the balloon widget and associate it with the widgets that we want
- # to provide tips for:
- b = tkinter.tix.Balloon(w, statusbar=status)
-
- b.bind_widget(button1, balloonmsg='Close Window',
- statusmsg='Press this button to close this window')
- b.bind_widget(button2, balloonmsg='Self-destruct button',
- statusmsg='Press this button and it will destroy itself')
-
- def quitcmd (self):
- self.exit = 0
-
- def mainloop(self):
- foundEvent = 1
- while self.exit < 0 and foundEvent > 0:
- foundEvent = self.root.tk.dooneevent(TCL_ALL_EVENTS)
-
- def destroy (self):
- self.root.destroy()
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
diff --git a/Demo/tix/samples/BtnBox.py b/Demo/tix/samples/BtnBox.py
deleted file mode 100755
index 3b9ee4bc33..0000000000
--- a/Demo/tix/samples/BtnBox.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program.
-
-# This file demonstrates the use of the tixButtonBox widget, which is a
-# group of TK buttons. You can use it to manage the buttons in a dialog box,
-# for example.
-#
-
-import tkinter.tix
-
-def RunSample(w):
- # Create the label on the top of the dialog box
- #
- top = tkinter.tix.Label(w, padx=20, pady=10, bd=1, relief=tkinter.tix.RAISED,
- anchor=tkinter.tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget')
-
- # Create the button box and add a few buttons in it. Set the
- # -width of all the buttons to the same value so that they
- # appear in the same size.
- #
- # Note that the -text, -underline, -command and -width options are all
- # standard options of the button widgets.
- #
- box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
- box.add('ok', text='OK', underline=0, width=5,
- command=lambda w=w: w.destroy())
- box.add('close', text='Cancel', underline=0, width=5,
- command=lambda w=w: w.destroy())
- box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
- top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
- root.mainloop()
diff --git a/Demo/tix/samples/CmpImg.py b/Demo/tix/samples/CmpImg.py
deleted file mode 100755
index ad491818c9..0000000000
--- a/Demo/tix/samples/CmpImg.py
+++ /dev/null
@@ -1,196 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program.
-
-# This file demonstrates the use of the compound images: it uses compound
-# images to display a text string together with a pixmap inside
-# buttons
-#
-
-import tkinter.tix
-
-network_pixmap = """/* XPM */
-static char * netw_xpm[] = {
-/* width height ncolors chars_per_pixel */
-"32 32 7 1",
-/* colors */
-" s None c None",
-". c #000000000000",
-"X c white",
-"o c #c000c000c000",
-"O c #404040",
-"+ c blue",
-"@ c red",
-/* pixels */
-" ",
-" .............. ",
-" .XXXXXXXXXXXX. ",
-" .XooooooooooO. ",
-" .Xo.......XoO. ",
-" .Xo.++++o+XoO. ",
-" .Xo.++++o+XoO. ",
-" .Xo.++oo++XoO. ",
-" .Xo.++++++XoO. ",
-" .Xo.+o++++XoO. ",
-" .Xo.++++++XoO. ",
-" .Xo.XXXXXXXoO. ",
-" .XooooooooooO. ",
-" .Xo@ooo....oO. ",
-" .............. .XooooooooooO. ",
-" .XXXXXXXXXXXX. .XooooooooooO. ",
-" .XooooooooooO. .OOOOOOOOOOOO. ",
-" .Xo.......XoO. .............. ",
-" .Xo.++++o+XoO. @ ",
-" .Xo.++++o+XoO. @ ",
-" .Xo.++oo++XoO. @ ",
-" .Xo.++++++XoO. @ ",
-" .Xo.+o++++XoO. @ ",
-" .Xo.++++++XoO. ..... ",
-" .Xo.XXXXXXXoO. .XXX. ",
-" .XooooooooooO.@@@@@@.X O. ",
-" .Xo@ooo....oO. .OOO. ",
-" .XooooooooooO. ..... ",
-" .XooooooooooO. ",
-" .OOOOOOOOOOOO. ",
-" .............. ",
-" "};
-"""
-
-hard_disk_pixmap = """/* XPM */
-static char * drivea_xpm[] = {
-/* width height ncolors chars_per_pixel */
-"32 32 5 1",
-/* colors */
-" s None c None",
-". c #000000000000",
-"X c white",
-"o c #c000c000c000",
-"O c #800080008000",
-/* pixels */
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" .......................... ",
-" .XXXXXXXXXXXXXXXXXXXXXXXo. ",
-" .XooooooooooooooooooooooO. ",
-" .Xooooooooooooooooo..oooO. ",
-" .Xooooooooooooooooo..oooO. ",
-" .XooooooooooooooooooooooO. ",
-" .Xoooooooo.......oooooooO. ",
-" .Xoo...................oO. ",
-" .Xoooooooo.......oooooooO. ",
-" .XooooooooooooooooooooooO. ",
-" .XooooooooooooooooooooooO. ",
-" .XooooooooooooooooooooooO. ",
-" .XooooooooooooooooooooooO. ",
-" .oOOOOOOOOOOOOOOOOOOOOOOO. ",
-" .......................... ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
-"""
-
-network_bitmap = """
-#define netw_width 32
-#define netw_height 32
-static unsigned char netw_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x02, 0x40,
- 0x00, 0x00, 0xfa, 0x5f, 0x00, 0x00, 0x0a, 0x50, 0x00, 0x00, 0x0a, 0x52,
- 0x00, 0x00, 0x0a, 0x52, 0x00, 0x00, 0x8a, 0x51, 0x00, 0x00, 0x0a, 0x50,
- 0x00, 0x00, 0x4a, 0x50, 0x00, 0x00, 0x0a, 0x50, 0x00, 0x00, 0x0a, 0x50,
- 0x00, 0x00, 0xfa, 0x5f, 0x00, 0x00, 0x02, 0x40, 0xfe, 0x7f, 0x52, 0x55,
- 0x02, 0x40, 0xaa, 0x6a, 0xfa, 0x5f, 0xfe, 0x7f, 0x0a, 0x50, 0xfe, 0x7f,
- 0x0a, 0x52, 0x80, 0x00, 0x0a, 0x52, 0x80, 0x00, 0x8a, 0x51, 0x80, 0x00,
- 0x0a, 0x50, 0x80, 0x00, 0x4a, 0x50, 0x80, 0x00, 0x0a, 0x50, 0xe0, 0x03,
- 0x0a, 0x50, 0x20, 0x02, 0xfa, 0xdf, 0x3f, 0x03, 0x02, 0x40, 0xa0, 0x02,
- 0x52, 0x55, 0xe0, 0x03, 0xaa, 0x6a, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00,
- 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-"""
-
-hard_disk_bitmap = """
-#define drivea_width 32
-#define drivea_height 32
-static unsigned char drivea_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xf8, 0xff, 0xff, 0x1f, 0x08, 0x00, 0x00, 0x18, 0xa8, 0xaa, 0xaa, 0x1a,
- 0x48, 0x55, 0xd5, 0x1d, 0xa8, 0xaa, 0xaa, 0x1b, 0x48, 0x55, 0x55, 0x1d,
- 0xa8, 0xfa, 0xaf, 0x1a, 0xc8, 0xff, 0xff, 0x1d, 0xa8, 0xfa, 0xaf, 0x1a,
- 0x48, 0x55, 0x55, 0x1d, 0xa8, 0xaa, 0xaa, 0x1a, 0x48, 0x55, 0x55, 0x1d,
- 0xa8, 0xaa, 0xaa, 0x1a, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-"""
-
-def RunSample(w):
- w.img0 = tkinter.tix.Image('pixmap', data=network_pixmap)
- if not w.img0:
- w.img0 = tkinter.tix.Image('bitmap', data=network_bitmap)
- w.img1 = tkinter.tix.Image('pixmap', data=hard_disk_pixmap)
- if not w.img0:
- w.img1 = tkinter.tix.Image('bitmap', data=hard_disk_bitmap)
-
- hdd = tkinter.tix.Button(w, padx=4, pady=1, width=120)
- net = tkinter.tix.Button(w, padx=4, pady=1, width=120)
-
- # Create the first image: we create a line, then put a string,
- # a space and a image into this line, from left to right.
- # The result: we have a one-line image that consists of three
- # individual items
- #
- # The tk.calls should be methods in Tix ...
- w.hdd_img = tkinter.tix.Image('compound', window=hdd)
- w.hdd_img.tk.call(str(w.hdd_img), 'add', 'line')
- w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk',
- '-underline', '0')
- w.hdd_img.tk.call(str(w.hdd_img), 'add', 'space', '-width', '7')
- w.hdd_img.tk.call(str(w.hdd_img), 'add', 'image', '-image', w.img1)
-
- # Put this image into the first button
- #
- hdd['image'] = w.hdd_img
-
- # Next button
- w.net_img = tkinter.tix.Image('compound', window=net)
- w.net_img.tk.call(str(w.net_img), 'add', 'line')
- w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network',
- '-underline', '0')
- w.net_img.tk.call(str(w.net_img), 'add', 'space', '-width', '7')
- w.net_img.tk.call(str(w.net_img), 'add', 'image', '-image', w.img0)
-
- # Put this image into the first button
- #
- net['image'] = w.net_img
-
- close = tkinter.tix.Button(w, pady=1, text='Close',
- command=lambda w=w: w.destroy())
-
- hdd.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1)
- net.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1)
- close.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1)
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
- root.mainloop()
diff --git a/Demo/tix/samples/ComboBox.py b/Demo/tix/samples/ComboBox.py
deleted file mode 100755
index 80d78f2603..0000000000
--- a/Demo/tix/samples/ComboBox.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program.
-
-# This file demonstrates the use of the tixComboBox widget, which is close
-# to the MS Window Combo Box control.
-#
-import tkinter.tix
-
-def RunSample(w):
- global demo_month, demo_year
-
- top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED)
-
- demo_month = tkinter.tix.StringVar()
- demo_year = tkinter.tix.StringVar()
-
- # $w.top.a is a drop-down combo box. It is not editable -- who wants
- # to invent new months?
- #
- # [Hint] The -options switch sets the options of the subwidgets.
- # [Hint] We set the label.width subwidget option of both comboboxes to
- # be 10 so that their labels appear to be aligned.
- #
- a = tkinter.tix.ComboBox(top, label="Month: ", dropdown=1,
- command=select_month, editable=0, variable=demo_month,
- options='listbox.height 6 label.width 10 label.anchor e')
-
- # $w.top.b is a non-drop-down combo box. It is not editable: we provide
- # four choices for the user, but he can enter an alternative year if he
- # wants to.
- #
- # [Hint] Use the padY and anchor options of the label subwidget to
- # align the label with the entry subwidget.
- # [Hint] Notice that you should use padY (the NAME of the option) and not
- # pady (the SWITCH of the option).
- #
- b = tkinter.tix.ComboBox(top, label="Year: ", dropdown=0,
- command=select_year, editable=1, variable=demo_year,
- options='listbox.height 4 label.padY 5 label.width 10 label.anchor ne')
-
- a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
- b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
-
- a.insert(tkinter.tix.END, 'January')
- a.insert(tkinter.tix.END, 'February')
- a.insert(tkinter.tix.END, 'March')
- a.insert(tkinter.tix.END, 'April')
- a.insert(tkinter.tix.END, 'May')
- a.insert(tkinter.tix.END, 'June')
- a.insert(tkinter.tix.END, 'July')
- a.insert(tkinter.tix.END, 'August')
- a.insert(tkinter.tix.END, 'September')
- a.insert(tkinter.tix.END, 'October')
- a.insert(tkinter.tix.END, 'November')
- a.insert(tkinter.tix.END, 'December')
-
- b.insert(tkinter.tix.END, '1992')
- b.insert(tkinter.tix.END, '1993')
- b.insert(tkinter.tix.END, '1994')
- b.insert(tkinter.tix.END, '1995')
- b.insert(tkinter.tix.END, '1996')
-
- # Use "tixSetSilent" to set the values of the combo box if you
- # don't want your -command procedures (cbx:select_month and
- # cbx:select_year) to be called.
- #
- a.set_silent('January')
- b.set_silent('1995')
-
- box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
- box.add('ok', text='Ok', underline=0, width=6,
- command=lambda w=w: ok_command(w))
- box.add('cancel', text='Cancel', underline=0, width=6,
- command=lambda w=w: w.destroy())
- box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
- top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
-
-def select_month(event=None):
- # tixDemo:Status "Month = %s" % demo_month.get()
- pass
-
-def select_year(event=None):
- # tixDemo:Status "Year = %s" % demo_year.get()
- pass
-
-def ok_command(w):
- # tixDemo:Status "Month = %s, Year= %s" % (demo_month.get(), demo_year.get())
- w.destroy()
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
- root.mainloop()
diff --git a/Demo/tix/samples/Control.py b/Demo/tix/samples/Control.py
deleted file mode 100755
index fbc5e646b8..0000000000
--- a/Demo/tix/samples/Control.py
+++ /dev/null
@@ -1,122 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program.
-
-# This file demonstrates the use of the tixControl widget -- it is an
-# entry widget with up/down arrow buttons. You can use the arrow buttons
-# to adjust the value inside the entry widget.
-#
-# This example program uses three Control widgets. One lets you select
-# integer values; one lets you select floating point values and the last
-# one lets you select a few names.
-
-import tkinter.tix
-
-TCL_ALL_EVENTS = 0
-
-def RunSample (root):
- control = DemoControl(root)
- control.mainloop()
- control.destroy()
-
-class DemoControl:
- def __init__(self, w):
- self.root = w
- self.exit = -1
-
- global demo_maker, demo_thrust, demo_num_engines
-
- demo_maker = tkinter.tix.StringVar()
- demo_thrust = tkinter.tix.DoubleVar()
- demo_num_engines = tkinter.tix.IntVar()
- demo_maker.set('P&W')
- demo_thrust.set(20000.0)
- demo_num_engines.set(2)
-
- top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED)
-
- # $w.top.a allows only integer values
- #
- # [Hint] The -options switch sets the options of the subwidgets.
- # [Hint] We set the label.width subwidget option of the Controls to
- # be 16 so that their labels appear to be aligned.
- #
- a = tkinter.tix.Control(top, label='Number of Engines: ', integer=1,
- variable=demo_num_engines, min=1, max=4,
- options='entry.width 10 label.width 20 label.anchor e')
-
- b = tkinter.tix.Control(top, label='Thrust: ', integer=0,
- min='10000.0', max='60000.0', step=500,
- variable=demo_thrust,
- options='entry.width 10 label.width 20 label.anchor e')
-
- c = tkinter.tix.Control(top, label='Engine Maker: ', value='P&W',
- variable=demo_maker,
- options='entry.width 10 label.width 20 label.anchor e')
-
- # We can't define these in the init because the widget 'c' doesn't
- # exist yet and we need to reference it
- c['incrcmd'] = lambda w=c: adjust_maker(w, 1)
- c['decrcmd'] = lambda w=c: adjust_maker(w, -1)
- c['validatecmd'] = lambda w=c: validate_maker(w)
-
- a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
- b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
- c.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
-
- box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
- box.add('ok', text='Ok', underline=0, width=6,
- command=self.okcmd)
- box.add('cancel', text='Cancel', underline=0, width=6,
- command=self.quitcmd)
- box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
- top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
-
- def okcmd (self):
- # tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get())
- self.quitcmd()
-
- def quitcmd (self):
- self.exit = 0
-
- def mainloop(self):
- while self.exit < 0:
- self.root.tk.dooneevent(TCL_ALL_EVENTS)
-
- def destroy (self):
- self.root.destroy()
-
-maker_list = ['P&W', 'GE', 'Rolls Royce']
-
-def adjust_maker(w, inc):
- i = maker_list.index(demo_maker.get())
- i = i + inc
- if i >= len(maker_list):
- i = 0
- elif i < 0:
- i = len(maker_list) - 1
-
- # In Tcl/Tix we should return the string maker_list[i]. We can't
- # do that in Tkinter so we set the global variable. (This works).
- demo_maker.set(maker_list[i])
-
-def validate_maker(w):
- try:
- i = maker_list.index(demo_maker.get())
- except ValueError:
- # Works here though. Why ? Beats me.
- return maker_list[0]
- # Works here though. Why ? Beats me.
- return maker_list[i]
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
diff --git a/Demo/tix/samples/DirList.py b/Demo/tix/samples/DirList.py
deleted file mode 100755
index 6d28ca3f88..0000000000
--- a/Demo/tix/samples/DirList.py
+++ /dev/null
@@ -1,131 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program using tixwish.
-
-# This file demonstrates the use of the tixDirList widget -- you can
-# use it for the user to select a directory. For example, an installation
-# program can use the tixDirList widget to ask the user to select the
-# installation directory for an application.
-#
-
-import tkinter.tix, os, copy
-from tkinter.constants import *
-
-TCL_ALL_EVENTS = 0
-
-def RunSample (root):
- dirlist = DemoDirList(root)
- dirlist.mainloop()
- dirlist.destroy()
-
-class DemoDirList:
- def __init__(self, w):
- self.root = w
- self.exit = -1
-
- z = w.winfo_toplevel()
- z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
-
- # Create the tixDirList and the tixLabelEntry widgets on the on the top
- # of the dialog box
-
- # bg = root.tk.eval('tix option get bg')
- # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0
-
- top = tkinter.tix.Frame( w, relief=RAISED, bd=1)
-
- # Create the DirList widget. By default it will show the current
- # directory
- #
- #
- top.dir = tkinter.tix.DirList(top)
- top.dir.hlist['width'] = 40
-
- # When the user presses the ".." button, the selected directory
- # is "transferred" into the entry widget
- #
- top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0)
-
- # We use a LabelEntry to hold the installation directory. The user
- # can choose from the DirList widget, or he can type in the directory
- # manually
- #
- top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:",
- labelside = 'top',
- options = '''
- entry.width 40
- label.anchor w
- ''')
-
- font = self.root.tk.eval('tix option get fixed_font')
- # font = self.root.master.tix_option_get('fixed_font')
- top.ent.entry['font'] = font
-
- self.dlist_dir = copy.copy(os.curdir)
- # This should work setting the entry's textvariable
- top.ent.entry['textvariable'] = self.dlist_dir
- top.btn['command'] = lambda dir=top.dir, ent=top.ent, self=self: \
- self.copy_name(dir,ent)
-
- # top.ent.entry.insert(0,'tix'+repr(self))
- top.ent.entry.bind('<Return>', lambda self=self: self.okcmd () )
-
- top.pack( expand='yes', fill='both', side=TOP)
- top.dir.pack( expand=1, fill=BOTH, padx=4, pady=4, side=LEFT)
- top.btn.pack( anchor='s', padx=4, pady=4, side=LEFT)
- top.ent.pack( expand=1, fill=X, anchor='s', padx=4, pady=4, side=LEFT)
-
- # Use a ButtonBox to hold the buttons.
- #
- box = tkinter.tix.ButtonBox (w, orientation='horizontal')
- box.add ('ok', text='Ok', underline=0, width=6,
- command = lambda self=self: self.okcmd () )
- box.add ('cancel', text='Cancel', underline=0, width=6,
- command = lambda self=self: self.quitcmd () )
-
- box.pack( anchor='s', fill='x', side=BOTTOM)
-
- def copy_name (self, dir, ent):
- # This should work as it is the entry's textvariable
- self.dlist_dir = dir.cget('value')
- # but it isn't so I'll do it manually
- ent.entry.delete(0,'end')
- ent.entry.insert(0, self.dlist_dir)
-
- def okcmd (self):
- # tixDemo:Status "You have selected the directory" + self.dlist_dir
- self.quitcmd()
-
- def quitcmd (self):
- self.exit = 0
-
- def mainloop(self):
- while self.exit < 0:
- self.root.tk.dooneevent(TCL_ALL_EVENTS)
-
- def destroy (self):
- self.root.destroy()
-
-# This "if" statement makes it possible to run this script file inside or
-# outside of the main demo program "tixwidgets.py".
-#
-if __name__== '__main__' :
- import tkinter.messagebox, traceback
-
- try:
- root=tkinter.tix.Tk()
- RunSample(root)
- except:
- t, v, tb = sys.exc_info()
- text = "Error running the demo script:\n"
- for line in traceback.format_exception(t,v,tb):
- text = text + line + '\n'
- d = tkinter.messagebox.showerror ( 'Tix Demo Error', text)
diff --git a/Demo/tix/samples/DirTree.py b/Demo/tix/samples/DirTree.py
deleted file mode 100755
index 5411ded212..0000000000
--- a/Demo/tix/samples/DirTree.py
+++ /dev/null
@@ -1,117 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program using tixwish.
-
-# This file demonstrates the use of the tixDirTree widget -- you can
-# use it for the user to select a directory. For example, an installation
-# program can use the tixDirTree widget to ask the user to select the
-# installation directory for an application.
-#
-
-import tkinter.tix, os, copy
-from tkinter.constants import *
-
-TCL_ALL_EVENTS = 0
-
-def RunSample (root):
- dirtree = DemoDirTree(root)
- dirtree.mainloop()
- dirtree.destroy()
-
-class DemoDirTree:
- def __init__(self, w):
- self.root = w
- self.exit = -1
-
- z = w.winfo_toplevel()
- z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
-
- # Create the tixDirTree and the tixLabelEntry widgets on the on the top
- # of the dialog box
-
- # bg = root.tk.eval('tix option get bg')
- # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0
-
- top = tkinter.tix.Frame( w, relief=RAISED, bd=1)
-
- # Create the DirTree widget. By default it will show the current
- # directory
- #
- #
- top.dir = tkinter.tix.DirTree(top)
- top.dir.hlist['width'] = 40
-
- # When the user presses the ".." button, the selected directory
- # is "transferred" into the entry widget
- #
- top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0)
-
- # We use a LabelEntry to hold the installation directory. The user
- # can choose from the DirTree widget, or he can type in the directory
- # manually
- #
- top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:",
- labelside = 'top',
- options = '''
- entry.width 40
- label.anchor w
- ''')
-
- self.dlist_dir = copy.copy(os.curdir)
- top.ent.entry['textvariable'] = self.dlist_dir
- top.btn['command'] = lambda dir=top.dir, ent=top.ent, self=self: \
- self.copy_name(dir,ent)
-
- top.ent.entry.bind('<Return>', lambda self=self: self.okcmd () )
-
- top.pack( expand='yes', fill='both', side=TOP)
- top.dir.pack( expand=1, fill=BOTH, padx=4, pady=4, side=LEFT)
- top.btn.pack( anchor='s', padx=4, pady=4, side=LEFT)
- top.ent.pack( expand=1, fill=X, anchor='s', padx=4, pady=4, side=LEFT)
-
- # Use a ButtonBox to hold the buttons.
- #
- box = tkinter.tix.ButtonBox (w, orientation='horizontal')
- box.add ('ok', text='Ok', underline=0, width=6,
- command = lambda self=self: self.okcmd () )
- box.add ('cancel', text='Cancel', underline=0, width=6,
- command = lambda self=self: self.quitcmd () )
-
- box.pack( anchor='s', fill='x', side=BOTTOM)
-
- def copy_name (self, dir, ent):
- # This should work as it is the entry's textvariable
- self.dlist_dir = dir.cget('value')
- # but it isn't so I'll do it manually
- ent.entry.delete(0,'end')
- ent.entry.insert(0, self.dlist_dir)
-
- def okcmd (self):
- # tixDemo:Status "You have selected the directory" + self.dlist_dir
- self.quitcmd()
-
- def quitcmd (self):
- # tixDemo:Status "You have selected the directory" + self.dlist_dir
- self.exit = 0
-
- def mainloop(self):
- while self.exit < 0:
- self.root.tk.dooneevent(TCL_ALL_EVENTS)
-
- def destroy (self):
- self.root.destroy()
-
-# This "if" statement makes it possible to run this script file inside or
-# outside of the main demo program "tixwidgets.py".
-#
-if __name__== '__main__' :
- root=tkinter.tix.Tk()
- RunSample(root)
diff --git a/Demo/tix/samples/NoteBook.py b/Demo/tix/samples/NoteBook.py
deleted file mode 100755
index d8b5fa85af..0000000000
--- a/Demo/tix/samples/NoteBook.py
+++ /dev/null
@@ -1,119 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program.
-
-# This file demonstrates the use of the tixNoteBook widget, which allows
-# you to lay out your interface using a "notebook" metaphore
-#
-import tkinter.tix
-
-def RunSample(w):
- global root
- root = w
-
- # We use these options to set the sizes of the subwidgets inside the
- # notebook, so that they are well-aligned on the screen.
- prefix = tkinter.tix.OptionName(w)
- if prefix:
- prefix = '*'+prefix
- else:
- prefix = ''
- w.option_add(prefix+'*TixControl*entry.width', 10)
- w.option_add(prefix+'*TixControl*label.width', 18)
- w.option_add(prefix+'*TixControl*label.anchor', tkinter.tix.E)
- w.option_add(prefix+'*TixNoteBook*tagPadX', 8)
-
- # Create the notebook widget and set its backpagecolor to gray.
- # Note that the -backpagecolor option belongs to the "nbframe"
- # subwidget.
- nb = tkinter.tix.NoteBook(w, name='nb', ipadx=6, ipady=6)
- nb['bg'] = 'gray'
- nb.nbframe['backpagecolor'] = 'gray'
-
- # Create the two tabs on the notebook. The -underline option
- # puts a underline on the first character of the labels of the tabs.
- # Keyboard accelerators will be defined automatically according
- # to the underlined character.
- nb.add('hard_disk', label="Hard Disk", underline=0)
- nb.add('network', label="Network", underline=0)
-
- nb.pack(expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5 ,side=tkinter.tix.TOP)
-
- #----------------------------------------
- # Create the first page
- #----------------------------------------
- # Create two frames: one for the common buttons, one for the
- # other widgets
- #
- tab=nb.hard_disk
- f = tkinter.tix.Frame(tab)
- common = tkinter.tix.Frame(tab)
-
- f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1)
- common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y)
-
- a = tkinter.tix.Control(f, value=12, label='Access time: ')
- w = tkinter.tix.Control(f, value=400, label='Write Throughput: ')
- r = tkinter.tix.Control(f, value=400, label='Read Throughput: ')
- c = tkinter.tix.Control(f, value=1021, label='Capacity: ')
-
- a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
-
- # Create the common buttons
- createCommonButtons(common)
-
- #----------------------------------------
- # Create the second page
- #----------------------------------------
-
- tab = nb.network
-
- f = tkinter.tix.Frame(tab)
- common = tkinter.tix.Frame(tab)
-
- f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1)
- common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y)
-
- a = tkinter.tix.Control(f, value=12, label='Access time: ')
- w = tkinter.tix.Control(f, value=400, label='Write Throughput: ')
- r = tkinter.tix.Control(f, value=400, label='Read Throughput: ')
- c = tkinter.tix.Control(f, value=1021, label='Capacity: ')
- u = tkinter.tix.Control(f, value=10, label='Users: ')
-
- a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- u.pack(side=tkinter.tix.TOP, padx=20, pady=2)
-
- createCommonButtons(common)
-
-def doDestroy():
- global root
- root.destroy()
-
-def createCommonButtons(master):
- ok = tkinter.tix.Button(master, name='ok', text='OK', width=6,
- command=doDestroy)
- cancel = tkinter.tix.Button(master, name='cancel',
- text='Cancel', width=6,
- command=doDestroy)
-
- ok.pack(side=tkinter.tix.TOP, padx=2, pady=2)
- cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2)
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
- root.mainloop()
diff --git a/Demo/tix/samples/OptMenu.py b/Demo/tix/samples/OptMenu.py
deleted file mode 100755
index d1dd46d43c..0000000000
--- a/Demo/tix/samples/OptMenu.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program.
-
-# This file demonstrates the use of the tixOptionMenu widget -- you can
-# use it for the user to choose from a fixed set of options
-#
-import tkinter.tix
-
-options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML',
- 'tex':'LaTeX', 'rtf':'Rich Text Format'}
-
-def RunSample(w):
- global demo_opt_from, demo_opt_to
-
- demo_opt_from = tkinter.tix.StringVar()
- demo_opt_to = tkinter.tix.StringVar()
-
- top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED)
-
- from_file = tkinter.tix.OptionMenu(top, label="From File Format : ",
- variable=demo_opt_from,
- options = 'label.width 19 label.anchor e menubutton.width 15')
-
- to_file = tkinter.tix.OptionMenu(top, label="To File Format : ",
- variable=demo_opt_to,
- options='label.width 19 label.anchor e menubutton.width 15')
-
- # Add the available options to the two OptionMenu widgets
- #
- # [Hint] You have to add the options first before you set the
- # global variables "demo_opt_from" and "demo_opt_to". Otherwise
- # the OptionMenu widget will complain about "unknown options"!
- #
- for opt in options.keys():
- from_file.add_command(opt, label=options[opt])
- to_file.add_command(opt, label=options[opt])
-
- demo_opt_from.set('html')
- demo_opt_to.set('post')
-
- from_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6)
- to_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6)
-
- box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
- box.add('ok', text='Ok', underline=0, width=6,
- command=lambda w=w: ok_command(w))
- box.add('cancel', text='Cancel', underline=0, width=6,
- command=lambda w=w: w.destroy())
- box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
- top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
-
-def ok_command(w):
- # tixDemo:Status "Convert file from %s to %s" % ( demo_opt_from.get(), demo_opt_to.get())
- w.destroy()
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
- root.mainloop()
diff --git a/Demo/tix/samples/PanedWin.py b/Demo/tix/samples/PanedWin.py
deleted file mode 100755
index 1ffc470797..0000000000
--- a/Demo/tix/samples/PanedWin.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program.
-
-# This file demonstrates the use of the tixPanedWindow widget. This program
-# is a dummy news reader: the user can adjust the sizes of the list
-# of artical names and the size of the text widget that shows the body
-# of the article.
-
-import tkinter.tix
-
-TCL_ALL_EVENTS = 0
-
-def RunSample (root):
- panedwin = DemoPanedwin(root)
- panedwin.mainloop()
- panedwin.destroy()
-
-class DemoPanedwin:
- def __init__(self, w):
- self.root = w
- self.exit = -1
-
- z = w.winfo_toplevel()
- z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
-
- group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25')
- group.entry.insert(0,'comp.lang.python')
- pane = tkinter.tix.PanedWindow(w, orientation='vertical')
-
- p1 = pane.add('list', min=70, size=100)
- p2 = pane.add('text', min=70)
- list = tkinter.tix.ScrolledListBox(p1)
- list.listbox['width'] = 80
- list.listbox['height'] = 5
- text = tkinter.tix.ScrolledText(p2)
- text.text['width'] = 80
- text.text['height'] = 20
-
- list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health")
- list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health")
- list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)")
- list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)")
- list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)")
- list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)")
- list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)")
-
- text.text['bg'] = list.listbox['bg']
- text.text['wrap'] = 'none'
- text.text.insert(tkinter.tix.END, """
- Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220
- Lines 353 A new way to put text and bitmaps together iNo responses
- ioi@blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania
-
- Hi,
-
- I have implemented a new image type called "compound". It allows you
- to glue together a bunch of bitmaps, images and text strings together
- to form a bigger image. Then you can use this image with widgets that
- support the -image option. For example, you can display a text string string
- together with a bitmap, at the same time, inside a TK button widget.
- """)
- text.text['state'] = 'disabled'
-
- list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
- text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
-
- group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
- pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1)
-
- box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
- box.add('ok', text='Ok', underline=0, width=6,
- command=self.quitcmd)
- box.add('cancel', text='Cancel', underline=0, width=6,
- command=self.quitcmd)
- box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
-
- def quitcmd (self):
- self.exit = 0
-
- def mainloop(self):
- while self.exit < 0:
- self.root.tk.dooneevent(TCL_ALL_EVENTS)
-
- def destroy (self):
- self.root.destroy()
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
diff --git a/Demo/tix/samples/PopMenu.py b/Demo/tix/samples/PopMenu.py
deleted file mode 100755
index cb75d85c76..0000000000
--- a/Demo/tix/samples/PopMenu.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program using tixwish.
-
-# This file demonstrates the use of the tixPopupMenu widget.
-#
-import tkinter.tix
-
-def RunSample(w):
- # We create the frame and the button, then we'll bind the PopupMenu
- # to both widgets. The result is, when you press the right mouse
- # button over $w.top or $w.top.but, the PopupMenu will come up.
- #
- top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1)
- but = tkinter.tix.Button(top, text='Press the right mouse button over this button or its surrounding area')
- but.pack(expand=1, fill=tkinter.tix.BOTH, padx=50, pady=50)
-
- p = tkinter.tix.PopupMenu(top, title='Popup Test')
- p.bind_widget(top)
- p.bind_widget(but)
-
- # Set the entries inside the PopupMenu widget.
- # [Hint] You have to manipulate the "menu" subwidget.
- # $w.top.p itself is NOT a menu widget.
- # [Hint] Watch carefully how the sub-menu is created
- #
- p.menu.add_command(label='Desktop', underline=0)
- p.menu.add_command(label='Select', underline=0)
- p.menu.add_command(label='Find', underline=0)
- p.menu.add_command(label='System', underline=1)
- p.menu.add_command(label='Help', underline=0)
- m1 = tkinter.tix.Menu(p.menu)
- m1.add_command(label='Hello')
- p.menu.add_cascade(label='More', menu=m1)
-
- but.pack(side=tkinter.tix.TOP, padx=40, pady=50)
-
- box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
- box.add('ok', text='Ok', underline=0, width=6,
- command=lambda w=w: w.destroy())
- box.add('cancel', text='Cancel', underline=0, width=6,
- command=lambda w=w: w.destroy())
- box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
- top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
- root.mainloop()
diff --git a/Demo/tix/samples/SHList1.py b/Demo/tix/samples/SHList1.py
deleted file mode 100755
index bf46020bc6..0000000000
--- a/Demo/tix/samples/SHList1.py
+++ /dev/null
@@ -1,131 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program using tixwish.
-
-# This file demonstrates the use of the tixScrolledHList widget.
-#
-
-import tkinter.tix
-
-TCL_ALL_EVENTS = 0
-
-def RunSample (root):
- shlist = DemoSHList(root)
- shlist.mainloop()
- shlist.destroy()
-
-class DemoSHList:
- def __init__(self, w):
- self.root = w
- self.exit = -1
-
- z = w.winfo_toplevel()
- z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
-
- # We create the frame and the ScrolledHList widget
- # at the top of the dialog box
- #
- top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1)
-
- # Put a simple hierachy into the HList (two levels). Use colors and
- # separator widgets (frames) to make the list look fancy
- #
- top.a = tkinter.tix.ScrolledHList(top)
- top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP)
-
- # This is our little relational database
- #
- bosses = [
- ('jeff', 'Jeff Waxman'),
- ('john', 'John Lee'),
- ('peter', 'Peter Kenson')
- ]
-
- employees = [
- ('alex', 'john', 'Alex Kellman'),
- ('alan', 'john', 'Alan Adams'),
- ('andy', 'peter', 'Andreas Crawford'),
- ('doug', 'jeff', 'Douglas Bloom'),
- ('jon', 'peter', 'Jon Baraki'),
- ('chris', 'jeff', 'Chris Geoffrey'),
- ('chuck', 'jeff', 'Chuck McLean')
- ]
-
- hlist=top.a.hlist
-
- # Let configure the appearance of the HList subwidget
- #
- hlist.config( separator='.', width=25, drawbranch=0, indent=10)
-
- count=0
- for boss,name in bosses :
- if count :
- f=tkinter.tix.Frame(hlist, name='sep%d' % count, height=2, width=150,
- bd=2, relief=tkinter.tix.SUNKEN )
-
- hlist.add_child( itemtype=tkinter.tix.WINDOW,
- window=f, state=tkinter.tix.DISABLED )
-
- hlist.add(boss, itemtype=tkinter.tix.TEXT, text=name)
- count = count+1
-
-
- for person,boss,name in employees :
- # '.' is the separator character we chose above
- #
- key= boss + '.' + person
- # ^^^^ ^^^^^^
- # parent entryPath / child's name
-
- hlist.add( key, text=name )
-
- # [Hint] Make sure the keys (e.g. 'boss.person') you choose
- # are unique names. If you cannot be sure of this (because of
- # the structure of your database, e.g.) you can use the
- # "add_child" command instead:
- #
- # hlist.addchild( boss, text=name)
- # ^^^^
- # parent entryPath
-
-
- # Use a ButtonBox to hold the buttons.
- #
- box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL )
- box.add( 'ok', text='Ok', underline=0, width=6,
- command = self.okcmd)
-
- box.add( 'cancel', text='Cancel', underline=0, width=6,
- command = self.quitcmd)
-
- box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
- top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 )
-
- def okcmd (self):
- self.quitcmd()
-
- def quitcmd (self):
- self.exit = 0
-
- def mainloop(self):
- while self.exit < 0:
- self.root.tk.dooneevent(TCL_ALL_EVENTS)
-
- def destroy (self):
- self.root.destroy()
-
-
-# This "if" statement makes it possible to run this script file inside or
-# outside of the main demo program "tixwidgets.py".
-#
-if __name__== '__main__' :
- root=tkinter.tix.Tk()
- RunSample(root)
diff --git a/Demo/tix/samples/SHList2.py b/Demo/tix/samples/SHList2.py
deleted file mode 100755
index 370c7655ff..0000000000
--- a/Demo/tix/samples/SHList2.py
+++ /dev/null
@@ -1,168 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidget": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program using tixwish.
-
-# This file demonstrates how to use multiple columns and multiple styles
-# in the tixHList widget
-#
-# In a tixHList widget, you can have one ore more columns.
-#
-
-import tkinter.tix
-
-TCL_ALL_EVENTS = 0
-
-def RunSample (root):
- shlist = DemoSHList(root)
- shlist.mainloop()
- shlist.destroy()
-
-class DemoSHList:
- def __init__(self, w):
- self.root = w
- self.exit = -1
-
- z = w.winfo_toplevel()
- z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
-
- # We create the frame and the ScrolledHList widget
- # at the top of the dialog box
- #
- top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1)
-
- # Put a simple hierachy into the HList (two levels). Use colors and
- # separator widgets (frames) to make the list look fancy
- #
- top.a = tkinter.tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' )
- top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP)
-
- hlist=top.a.hlist
-
- # Create the title for the HList widget
- # >> Notice that we have set the hlist.header subwidget option to true
- # so that the header is displayed
- #
-
- boldfont=hlist.tk.call('tix','option','get','bold_font')
-
- # First some styles for the headers
- style={}
- style['header'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist,
- anchor=tkinter.tix.CENTER, padx=8, pady=2, font = boldfont )
-
- hlist.header_create(0, itemtype=tkinter.tix.TEXT, text='Name',
- style=style['header'])
- hlist.header_create(1, itemtype=tkinter.tix.TEXT, text='Position',
- style=style['header'])
-
- # Notice that we use 3 columns in the hlist widget. This way when the user
- # expands the windows wide, the right side of the header doesn't look
- # chopped off. The following line ensures that the 3 column header is
- # not shown unless the hlist window is wider than its contents.
- #
- hlist.column_width(2,0)
-
- # This is our little relational database
- #
- boss = ('doe', 'John Doe', 'Director')
-
- managers = [
- ('jeff', 'Jeff Waxman', 'Manager'),
- ('john', 'John Lee', 'Manager'),
- ('peter', 'Peter Kenson', 'Manager')
- ]
-
- employees = [
- ('alex', 'john', 'Alex Kellman', 'Clerk'),
- ('alan', 'john', 'Alan Adams', 'Clerk'),
- ('andy', 'peter', 'Andreas Crawford', 'Salesman'),
- ('doug', 'jeff', 'Douglas Bloom', 'Clerk'),
- ('jon', 'peter', 'Jon Baraki', 'Salesman'),
- ('chris', 'jeff', 'Chris Geoffrey', 'Clerk'),
- ('chuck', 'jeff', 'Chuck McLean', 'Cleaner')
- ]
-
- style['mgr_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist)
-
- style['mgr_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist)
-
- style['empl_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist)
-
- style['empl_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist)
-
- # Let configure the appearance of the HList subwidget
- #
- hlist.config(separator='.', width=25, drawbranch=0, indent=10)
- hlist.column_width(0, chars=20)
-
- # Create the boss
- #
- hlist.add ('.', itemtype=tkinter.tix.TEXT, text=boss[1],
- style=style['mgr_name'])
- hlist.item_create('.', 1, itemtype=tkinter.tix.TEXT, text=boss[2],
- style=style['mgr_posn'])
-
- # Create the managers
- #
-
- for key,name,posn in managers :
- e= '.'+ key
- hlist.add(e, itemtype=tkinter.tix.TEXT, text=name,
- style=style['mgr_name'])
- hlist.item_create(e, 1, itemtype=tkinter.tix.TEXT, text=posn,
- style=style['mgr_posn'])
-
-
- for key,mgr,name,posn in employees :
- # "." is the separator character we chose above
-
- entrypath = '.' + mgr + '.' + key
-
- # ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
- # parent entryPath / child's name
-
- hlist.add(entrypath, text=name, style=style['empl_name'])
- hlist.item_create(entrypath, 1, itemtype=tkinter.tix.TEXT,
- text = posn, style = style['empl_posn'] )
-
-
- # Use a ButtonBox to hold the buttons.
- #
- box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL )
- box.add( 'ok', text='Ok', underline=0, width=6,
- command = self.okcmd )
-
- box.add( 'cancel', text='Cancel', underline=0, width=6,
- command = self.quitcmd )
-
- box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
- top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 )
-
- def okcmd (self):
- self.quitcmd()
-
- def quitcmd (self):
- self.exit = 0
-
- def mainloop(self):
- while self.exit < 0:
- self.root.tk.dooneevent(TCL_ALL_EVENTS)
-
- def destroy (self):
- self.root.destroy()
-
-
-# This "if" statement makes it possible to run this script file inside or
-# outside of the main demo program "tixwidgets.py".
-#
-if __name__== '__main__' :
- root=tkinter.tix.Tk()
- RunSample(root)
diff --git a/Demo/tix/samples/Tree.py b/Demo/tix/samples/Tree.py
deleted file mode 100755
index e46ff60b23..0000000000
--- a/Demo/tix/samples/Tree.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# Tix Demostration Program
-#
-# This sample program is structured in such a way so that it can be
-# executed from the Tix demo program "tixwidgets.py": it must have a
-# procedure called "RunSample". It should also have the "if" statment
-# at the end of this file so that it can be run as a standalone
-# program.
-
-# This file demonstrates how to use the TixTree widget to display
-# dynamic hierachical data (the files in the Unix file system)
-#
-
-import tkinter.tix, os
-
-def RunSample(w):
- top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1)
- tree = tkinter.tix.Tree(top, options='separator "/"')
- tree.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.LEFT)
- tree['opencmd'] = lambda dir=None, w=tree: opendir(w, dir)
-
- # The / directory is added in the "open" mode. The user can open it
- # and then browse its subdirectories ...
- adddir(tree, "/")
-
- box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
- box.add('ok', text='Ok', underline=0, command=w.destroy, width=6)
- box.add('cancel', text='Cancel', underline=0, command=w.destroy, width=6)
- box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
- top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
-
-def adddir(tree, dir):
- if dir == '/':
- text = '/'
- else:
- text = os.path.basename(dir)
- tree.hlist.add(dir, itemtype=tkinter.tix.IMAGETEXT, text=text,
- image=tree.tk.call('tix', 'getimage', 'folder'))
- try:
- os.listdir(dir)
- tree.setmode(dir, 'open')
- except os.error:
- # No read permission ?
- pass
-
-# This function is called whenever the user presses the (+) indicator or
-# double clicks on a directory whose mode is "open". It loads the files
-# inside that directory into the Tree widget.
-#
-# Note we didn't specify the closecmd option for the Tree widget, so it
-# performs the default action when the user presses the (-) indicator or
-# double clicks on a directory whose mode is "close": hide all of its child
-# entries
-def opendir(tree, dir):
- entries = tree.hlist.info_children(dir)
- if entries:
- # We have already loaded this directory. Let's just
- # show all the child entries
- #
- # Note: since we load the directory only once, it will not be
- # refreshed if the you add or remove files from this
- # directory.
- #
- for entry in entries:
- tree.hlist.show_entry(entry)
- files = os.listdir(dir)
- for file in files:
- if os.path.isdir(dir + '/' + file):
- adddir(tree, dir + '/' + file)
- else:
- tree.hlist.add(dir + '/' + file, itemtype=tkinter.tix.IMAGETEXT, text=file,
- image=tree.tk.call('tix', 'getimage', 'file'))
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunSample(root)
- root.mainloop()
diff --git a/Demo/tix/tixwidgets.py b/Demo/tix/tixwidgets.py
deleted file mode 100644
index 42bcedc2df..0000000000
--- a/Demo/tix/tixwidgets.py
+++ /dev/null
@@ -1,1002 +0,0 @@
-# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
-#
-# $Id$
-#
-# tixwidgets.py --
-#
-# For Tix, see http://tix.sourceforge.net
-#
-# This is a demo program of some of the Tix widgets available in Python.
-# If you have installed Python & Tix properly, you can execute this as
-#
-# % python tixwidgets.py
-#
-
-import os, os.path, sys, tkinter.tix
-from tkinter.constants import *
-import traceback, tkinter.messagebox
-
-TCL_DONT_WAIT = 1<<1
-TCL_WINDOW_EVENTS = 1<<2
-TCL_FILE_EVENTS = 1<<3
-TCL_TIMER_EVENTS = 1<<4
-TCL_IDLE_EVENTS = 1<<5
-TCL_ALL_EVENTS = 0
-
-class Demo:
- def __init__(self, top):
- self.root = top
- self.exit = -1
-
- self.dir = None # script directory
- self.balloon = None # balloon widget
- self.useBalloons = tkinter.tix.StringVar()
- self.useBalloons.set('0')
- self.statusbar = None # status bar widget
- self.welmsg = None # Msg widget
- self.welfont = '' # font name
- self.welsize = '' # font size
-
- progname = sys.argv[0]
- dirname = os.path.dirname(progname)
- if dirname and dirname != os.curdir:
- self.dir = dirname
- index = -1
- for i in range(len(sys.path)):
- p = sys.path[i]
- if p in ("", os.curdir):
- index = i
- if index >= 0:
- sys.path[index] = dirname
- else:
- sys.path.insert(0, dirname)
- else:
- self.dir = os.getcwd()
- sys.path.insert(0, self.dir+'/samples')
-
- def MkMainMenu(self):
- top = self.root
- w = tkinter.tix.Frame(top, bd=2, relief=RAISED)
- file = tkinter.tix.Menubutton(w, text='File', underline=0, takefocus=0)
- help = tkinter.tix.Menubutton(w, text='Help', underline=0, takefocus=0)
- file.pack(side=LEFT)
- help.pack(side=RIGHT)
- fm = tkinter.tix.Menu(file, tearoff=0)
- file['menu'] = fm
- hm = tkinter.tix.Menu(help, tearoff=0)
- help['menu'] = hm
-
- fm.add_command(label='Exit', underline=1,
- command = lambda self=self: self.quitcmd () )
- hm.add_checkbutton(label='BalloonHelp', underline=0, command=ToggleHelp,
- variable=self.useBalloons)
- # The trace variable option doesn't seem to work, instead I use 'command'
- #w.tk.call('trace', 'variable', self.useBalloons, 'w', ToggleHelp))
-
- return w
-
- def MkMainNotebook(self):
- top = self.root
- w = tkinter.tix.NoteBook(top, ipadx=5, ipady=5, options="""
- tagPadX 6
- tagPadY 4
- borderWidth 2
- """)
- # This may be required if there is no *Background option
- top['bg'] = w['bg']
-
- w.add('wel', label='Welcome', underline=0,
- createcmd=lambda w=w, name='wel': MkWelcome(w, name))
- w.add('cho', label='Choosers', underline=0,
- createcmd=lambda w=w, name='cho': MkChoosers(w, name))
- w.add('scr', label='Scrolled Widgets', underline=0,
- createcmd=lambda w=w, name='scr': MkScroll(w, name))
- w.add('mgr', label='Manager Widgets', underline=0,
- createcmd=lambda w=w, name='mgr': MkManager(w, name))
- w.add('dir', label='Directory List', underline=0,
- createcmd=lambda w=w, name='dir': MkDirList(w, name))
- w.add('exp', label='Run Sample Programs', underline=0,
- createcmd=lambda w=w, name='exp': MkSample(w, name))
- return w
-
- def MkMainStatus(self):
- global demo
- top = self.root
-
- w = tkinter.tix.Frame(top, relief=tkinter.tix.RAISED, bd=1)
- demo.statusbar = tkinter.tix.Label(w, relief=tkinter.tix.SUNKEN, bd=1)
- demo.statusbar.form(padx=3, pady=3, left=0, right='%70')
- return w
-
- def build(self):
- root = self.root
- z = root.winfo_toplevel()
- z.wm_title('Tix Widget Demonstration')
- if z.winfo_screenwidth() <= 800:
- z.geometry('790x590+10+10')
- else:
- z.geometry('890x640+10+10')
- demo.balloon = tkinter.tix.Balloon(root)
- frame1 = self.MkMainMenu()
- frame2 = self.MkMainNotebook()
- frame3 = self.MkMainStatus()
- frame1.pack(side=TOP, fill=X)
- frame3.pack(side=BOTTOM, fill=X)
- frame2.pack(side=TOP, expand=1, fill=BOTH, padx=4, pady=4)
- demo.balloon['statusbar'] = demo.statusbar
- z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
-
- # To show Tcl errors - uncomment this to see the listbox bug.
- # Tkinter defines a Tcl tkerror procedure that in effect
- # silences all background Tcl error reporting.
- # root.tk.eval('if {[info commands tkerror] != ""} {rename tkerror pytkerror}')
- def quitcmd (self):
- """Quit our mainloop. It is up to you to call root.destroy() after."""
- self.exit = 0
-
- def loop(self):
- """This is an explict replacement for _tkinter mainloop()
- It lets you catch keyboard interrupts easier, and avoids
- the 20 msec. dead sleep() which burns a constant CPU."""
- while self.exit < 0:
- # There are 2 whiles here. The outer one lets you continue
- # after a ^C interrupt.
- try:
- # This is the replacement for _tkinter mainloop()
- # It blocks waiting for the next Tcl event using select.
- while self.exit < 0:
- self.root.tk.dooneevent(TCL_ALL_EVENTS)
- except SystemExit:
- # Tkinter uses SystemExit to exit
- #print 'Exit'
- self.exit = 1
- return
- except KeyboardInterrupt:
- if tkinter.messagebox.askquestion ('Interrupt', 'Really Quit?') == 'yes':
- # self.tk.eval('exit')
- self.exit = 1
- return
- continue
- except:
- # Otherwise it's some other error - be nice and say why
- t, v, tb = sys.exc_info()
- text = ""
- for line in traceback.format_exception(t,v,tb):
- text += line + '\n'
- try: tkinter.messagebox.showerror ('Error', text)
- except: pass
- self.exit = 1
- raise SystemExit(1)
-
- def destroy (self):
- self.root.destroy()
-
-def RunMain(root):
- global demo
-
- demo = Demo(root)
-
- demo.build()
- demo.loop()
- demo.destroy()
-
-# Tabs
-def MkWelcome(nb, name):
- w = nb.page(name)
- bar = MkWelcomeBar(w)
- text = MkWelcomeText(w)
- bar.pack(side=TOP, fill=X, padx=2, pady=2)
- text.pack(side=TOP, fill=BOTH, expand=1)
-
-def MkWelcomeBar(top):
- global demo
-
- w = tkinter.tix.Frame(top, bd=2, relief=tkinter.tix.GROOVE)
- b1 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w))
- b2 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w))
- b1.entry['width'] = 15
- b1.slistbox.listbox['height'] = 3
- b2.entry['width'] = 4
- b2.slistbox.listbox['height'] = 3
-
- demo.welfont = b1
- demo.welsize = b2
-
- b1.insert(tkinter.tix.END, 'Courier')
- b1.insert(tkinter.tix.END, 'Helvetica')
- b1.insert(tkinter.tix.END, 'Lucida')
- b1.insert(tkinter.tix.END, 'Times Roman')
-
- b2.insert(tkinter.tix.END, '8')
- b2.insert(tkinter.tix.END, '10')
- b2.insert(tkinter.tix.END, '12')
- b2.insert(tkinter.tix.END, '14')
- b2.insert(tkinter.tix.END, '18')
-
- b1.pick(1)
- b2.pick(3)
-
- b1.pack(side=tkinter.tix.LEFT, padx=4, pady=4)
- b2.pack(side=tkinter.tix.LEFT, padx=4, pady=4)
-
- demo.balloon.bind_widget(b1, msg='Choose\na font',
- statusmsg='Choose a font for this page')
- demo.balloon.bind_widget(b2, msg='Point size',
- statusmsg='Choose the font size for this page')
- return w
-
-def MkWelcomeText(top):
- global demo
-
- w = tkinter.tix.ScrolledWindow(top, scrollbar='auto')
- win = w.window
- text = 'Welcome to TIX in Python'
- title = tkinter.tix.Label(win,
- bd=0, width=30, anchor=tkinter.tix.N, text=text)
- msg = tkinter.tix.Message(win,
- bd=0, width=400, anchor=tkinter.tix.N,
- text='Tix is a set of mega-widgets based on TK. This program \
-demonstrates the widgets in the Tix widget set. You can choose the pages \
-in this window to look at the corresponding widgets. \n\n\
-To quit this program, choose the "File | Exit" command.\n\n\
-For more information, see http://tix.sourceforge.net.')
- title.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10)
- msg.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10)
- demo.welmsg = msg
- return w
-
-def MainTextFont(w):
- global demo
-
- if not demo.welmsg:
- return
- font = demo.welfont['value']
- point = demo.welsize['value']
- if font == 'Times Roman':
- font = 'times'
- fontstr = '%s %s' % (font, point)
- demo.welmsg['font'] = fontstr
-
-def ToggleHelp():
- if demo.useBalloons.get() == '1':
- demo.balloon['state'] = 'both'
- else:
- demo.balloon['state'] = 'none'
-
-def MkChoosers(nb, name):
- w = nb.page(name)
- options = "label.padX 4"
-
- til = tkinter.tix.LabelFrame(w, label='Chooser Widgets', options=options)
- cbx = tkinter.tix.LabelFrame(w, label='tixComboBox', options=options)
- ctl = tkinter.tix.LabelFrame(w, label='tixControl', options=options)
- sel = tkinter.tix.LabelFrame(w, label='tixSelect', options=options)
- opt = tkinter.tix.LabelFrame(w, label='tixOptionMenu', options=options)
- fil = tkinter.tix.LabelFrame(w, label='tixFileEntry', options=options)
- fbx = tkinter.tix.LabelFrame(w, label='tixFileSelectBox', options=options)
- tbr = tkinter.tix.LabelFrame(w, label='Tool Bar', options=options)
-
- MkTitle(til.frame)
- MkCombo(cbx.frame)
- MkControl(ctl.frame)
- MkSelect(sel.frame)
- MkOptMenu(opt.frame)
- MkFileEnt(fil.frame)
- MkFileBox(fbx.frame)
- MkToolBar(tbr.frame)
-
- # First column: comBox and selector
- cbx.form(top=0, left=0, right='%33')
- sel.form(left=0, right='&'+str(cbx), top=cbx)
- opt.form(left=0, right='&'+str(cbx), top=sel, bottom=-1)
-
- # Second column: title .. etc
- til.form(left=cbx, top=0,right='%66')
- ctl.form(left=cbx, right='&'+str(til), top=til)
- fil.form(left=cbx, right='&'+str(til), top=ctl)
- tbr.form(left=cbx, right='&'+str(til), top=fil, bottom=-1)
-
- #
- # Third column: file selection
- fbx.form(right=-1, top=0, left='%66')
-
-def MkCombo(w):
- options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 14)
-
- static = tkinter.tix.ComboBox(w, label='Static', editable=0, options=options)
- editable = tkinter.tix.ComboBox(w, label='Editable', editable=1, options=options)
- history = tkinter.tix.ComboBox(w, label='History', editable=1, history=1,
- anchor=tkinter.tix.E, options=options)
- static.insert(tkinter.tix.END, 'January')
- static.insert(tkinter.tix.END, 'February')
- static.insert(tkinter.tix.END, 'March')
- static.insert(tkinter.tix.END, 'April')
- static.insert(tkinter.tix.END, 'May')
- static.insert(tkinter.tix.END, 'June')
- static.insert(tkinter.tix.END, 'July')
- static.insert(tkinter.tix.END, 'August')
- static.insert(tkinter.tix.END, 'September')
- static.insert(tkinter.tix.END, 'October')
- static.insert(tkinter.tix.END, 'November')
- static.insert(tkinter.tix.END, 'December')
-
- editable.insert(tkinter.tix.END, 'Angola')
- editable.insert(tkinter.tix.END, 'Bangladesh')
- editable.insert(tkinter.tix.END, 'China')
- editable.insert(tkinter.tix.END, 'Denmark')
- editable.insert(tkinter.tix.END, 'Ecuador')
-
- history.insert(tkinter.tix.END, '/usr/bin/ksh')
- history.insert(tkinter.tix.END, '/usr/local/lib/python')
- history.insert(tkinter.tix.END, '/var/adm')
-
- static.pack(side=tkinter.tix.TOP, padx=5, pady=3)
- editable.pack(side=tkinter.tix.TOP, padx=5, pady=3)
- history.pack(side=tkinter.tix.TOP, padx=5, pady=3)
-
-states = ['Bengal', 'Delhi', 'Karnataka', 'Tamil Nadu']
-
-def spin_cmd(w, inc):
- idx = states.index(demo_spintxt.get()) + inc
- if idx < 0:
- idx = len(states) - 1
- elif idx >= len(states):
- idx = 0
-# following doesn't work.
-# return states[idx]
- demo_spintxt.set(states[idx]) # this works
-
-def spin_validate(w):
- global states, demo_spintxt
-
- try:
- i = states.index(demo_spintxt.get())
- except ValueError:
- return states[0]
- return states[i]
- # why this procedure works as opposed to the previous one beats me.
-
-def MkControl(w):
- global demo_spintxt
-
- options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 13)
-
- demo_spintxt = tkinter.tix.StringVar()
- demo_spintxt.set(states[0])
- simple = tkinter.tix.Control(w, label='Numbers', options=options)
- spintxt = tkinter.tix.Control(w, label='States', variable=demo_spintxt,
- options=options)
- spintxt['incrcmd'] = lambda w=spintxt: spin_cmd(w, 1)
- spintxt['decrcmd'] = lambda w=spintxt: spin_cmd(w, -1)
- spintxt['validatecmd'] = lambda w=spintxt: spin_validate(w)
-
- simple.pack(side=tkinter.tix.TOP, padx=5, pady=3)
- spintxt.pack(side=tkinter.tix.TOP, padx=5, pady=3)
-
-def MkSelect(w):
- options = "label.anchor %s" % tkinter.tix.CENTER
-
- sel1 = tkinter.tix.Select(w, label='Mere Mortals', allowzero=1, radio=1,
- orientation=tkinter.tix.VERTICAL,
- labelside=tkinter.tix.TOP,
- options=options)
- sel2 = tkinter.tix.Select(w, label='Geeks', allowzero=1, radio=0,
- orientation=tkinter.tix.VERTICAL,
- labelside= tkinter.tix.TOP,
- options=options)
-
- sel1.add('eat', text='Eat')
- sel1.add('work', text='Work')
- sel1.add('play', text='Play')
- sel1.add('party', text='Party')
- sel1.add('sleep', text='Sleep')
-
- sel2.add('eat', text='Eat')
- sel2.add('prog1', text='Program')
- sel2.add('prog2', text='Program')
- sel2.add('prog3', text='Program')
- sel2.add('sleep', text='Sleep')
-
- sel1.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X)
- sel2.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X)
-
-def MkOptMenu(w):
- options='menubutton.width 15 label.anchor %s' % tkinter.tix.E
-
- m = tkinter.tix.OptionMenu(w, label='File Format : ', options=options)
- m.add_command('text', label='Plain Text')
- m.add_command('post', label='PostScript')
- m.add_command('format', label='Formatted Text')
- m.add_command('html', label='HTML')
- m.add_command('sep')
- m.add_command('tex', label='LaTeX')
- m.add_command('rtf', label='Rich Text Format')
-
- m.pack(fill=tkinter.tix.X, padx=5, pady=3)
-
-def MkFileEnt(w):
- msg = tkinter.tix.Message(w,
- relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
- text='Press the "open file" icon button and a TixFileSelectDialog will popup.')
- ent = tkinter.tix.FileEntry(w, label='Select a file : ')
- msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
- ent.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3)
-
-def MkFileBox(w):
- """The FileSelectBox is a Motif-style box with various enhancements.
- For example, you can adjust the size of the two listboxes
- and your past selections are recorded.
- """
- msg = tkinter.tix.Message(w,
- relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
- text='The Tix FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded.')
- box = tkinter.tix.FileSelectBox(w)
- msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
- box.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3)
-
-def MkToolBar(w):
- """The Select widget is also good for arranging buttons in a tool bar.
- """
- global demo
-
- options='frame.borderWidth 1'
-
- msg = tkinter.tix.Message(w,
- relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
- text='The Select widget is also good for arranging buttons in a tool bar.')
- bar = tkinter.tix.Frame(w, bd=2, relief=tkinter.tix.RAISED)
- font = tkinter.tix.Select(w, allowzero=1, radio=0, label='', options=options)
- para = tkinter.tix.Select(w, allowzero=0, radio=1, label='', options=options)
-
- font.add('bold', bitmap='@' + demo.dir + '/bitmaps/bold.xbm')
- font.add('italic', bitmap='@' + demo.dir + '/bitmaps/italic.xbm')
- font.add('underline', bitmap='@' + demo.dir + '/bitmaps/underline.xbm')
- font.add('capital', bitmap='@' + demo.dir + '/bitmaps/capital.xbm')
-
- para.add('left', bitmap='@' + demo.dir + '/bitmaps/leftj.xbm')
- para.add('right', bitmap='@' + demo.dir + '/bitmaps/rightj.xbm')
- para.add('center', bitmap='@' + demo.dir + '/bitmaps/centerj.xbm')
- para.add('justify', bitmap='@' + demo.dir + '/bitmaps/justify.xbm')
-
- msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
- bar.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3)
- font.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3)
- para.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3)
-
-def MkTitle(w):
- msg = tkinter.tix.Message(w,
- relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
- text='There are many types of "chooser" widgets that allow the user to input different types of information')
- msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
-
-def MkScroll(nb, name):
- w = nb.page(name)
- options='label.padX 4'
-
- sls = tkinter.tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options)
- swn = tkinter.tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options)
- stx = tkinter.tix.LabelFrame(w, label='Tix.ScrolledText', options=options)
-
- MkSList(sls.frame)
- MkSWindow(swn.frame)
- MkSText(stx.frame)
-
- sls.form(top=0, left=0, right='%33', bottom=-1)
- swn.form(top=0, left=sls, right='%66', bottom=-1)
- stx.form(top=0, left=swn, right=-1, bottom=-1)
-
-
-def MkSList(w):
- """This TixScrolledListBox is configured so that it uses scrollbars
- only when it is necessary. Use the handles to resize the listbox and
- watch the scrollbars automatically appear and disappear. """
- top = tkinter.tix.Frame(w, width=300, height=330)
- bot = tkinter.tix.Frame(w)
- msg = tkinter.tix.Message(top,
- relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N,
- text='This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear.')
-
- list = tkinter.tix.ScrolledListBox(top, scrollbar='auto')
- list.place(x=50, y=150, width=120, height=80)
- list.listbox.insert(tkinter.tix.END, 'Alabama')
- list.listbox.insert(tkinter.tix.END, 'California')
- list.listbox.insert(tkinter.tix.END, 'Montana')
- list.listbox.insert(tkinter.tix.END, 'New Jersey')
- list.listbox.insert(tkinter.tix.END, 'New York')
- list.listbox.insert(tkinter.tix.END, 'Pennsylvania')
- list.listbox.insert(tkinter.tix.END, 'Washington')
-
- rh = tkinter.tix.ResizeHandle(top, bg='black',
- relief=tkinter.tix.RAISED,
- handlesize=8, gridded=1, minwidth=50, minheight=30)
- btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x))
- top.propagate(0)
- msg.pack(fill=tkinter.tix.X)
- btn.pack(anchor=tkinter.tix.CENTER)
- top.pack(expand=1, fill=tkinter.tix.BOTH)
- bot.pack(fill=tkinter.tix.BOTH)
- list.bind('<Map>', func=lambda arg=0, rh=rh, list=list:
- list.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(list)))
-
-def SList_reset(rh, list):
- list.place(x=50, y=150, width=120, height=80)
- list.update()
- rh.attach_widget(list)
-
-def MkSWindow(w):
- """The ScrolledWindow widget allows you to scroll any kind of Tk
- widget. It is more versatile than a scrolled canvas widget.
- """
- global demo
-
- text = 'The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.'
-
- file = os.path.join(demo.dir, 'bitmaps', 'tix.gif')
- if not os.path.isfile(file):
- text += ' (Image missing)'
-
- top = tkinter.tix.Frame(w, width=330, height=330)
- bot = tkinter.tix.Frame(w)
- msg = tkinter.tix.Message(top,
- relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N,
- text=text)
-
- win = tkinter.tix.ScrolledWindow(top, scrollbar='auto')
-
- image1 = win.window.image_create('photo', file=file)
- lbl = tkinter.tix.Label(win.window, image=image1)
- lbl.pack(expand=1, fill=tkinter.tix.BOTH)
-
- win.place(x=30, y=150, width=190, height=120)
-
- rh = tkinter.tix.ResizeHandle(top, bg='black',
- relief=tkinter.tix.RAISED,
- handlesize=8, gridded=1, minwidth=50, minheight=30)
- btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x))
- top.propagate(0)
- msg.pack(fill=tkinter.tix.X)
- btn.pack(anchor=tkinter.tix.CENTER)
- top.pack(expand=1, fill=tkinter.tix.BOTH)
- bot.pack(fill=tkinter.tix.BOTH)
-
- win.bind('<Map>', func=lambda arg=0, rh=rh, win=win:
- win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win)))
-
-def SWindow_reset(rh, win):
- win.place(x=30, y=150, width=190, height=120)
- win.update()
- rh.attach_widget(win)
-
-def MkSText(w):
- """The TixScrolledWindow widget allows you to scroll any kind of Tk
- widget. It is more versatile than a scrolled canvas widget."""
- top = tkinter.tix.Frame(w, width=330, height=330)
- bot = tkinter.tix.Frame(w)
- msg = tkinter.tix.Message(top,
- relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N,
- text='The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.')
-
- win = tkinter.tix.ScrolledText(top, scrollbar='auto')
- win.text['wrap'] = 'none'
- win.text.insert(tkinter.tix.END, '''When -scrollbar is set to "auto", the
-scrollbars are shown only when needed.
-Additional modifiers can be used to force a
-scrollbar to be shown or hidden. For example,
-"auto -y" means the horizontal scrollbar
-should be shown when needed but the vertical
-scrollbar should always be hidden;
-"auto +x" means the vertical scrollbar
-should be shown when needed but the horizontal
-scrollbar should always be shown, and so on.'''
-)
- win.place(x=30, y=150, width=190, height=100)
-
- rh = tkinter.tix.ResizeHandle(top, bg='black',
- relief=tkinter.tix.RAISED,
- handlesize=8, gridded=1, minwidth=50, minheight=30)
- btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SText_reset(w,x))
- top.propagate(0)
- msg.pack(fill=tkinter.tix.X)
- btn.pack(anchor=tkinter.tix.CENTER)
- top.pack(expand=1, fill=tkinter.tix.BOTH)
- bot.pack(fill=tkinter.tix.BOTH)
- win.bind('<Map>', func=lambda arg=0, rh=rh, win=win:
- win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win)))
-
-def SText_reset(rh, win):
- win.place(x=30, y=150, width=190, height=120)
- win.update()
- rh.attach_widget(win)
-
-def MkManager(nb, name):
- w = nb.page(name)
- options='label.padX 4'
-
- pane = tkinter.tix.LabelFrame(w, label='Tix.PanedWindow', options=options)
- note = tkinter.tix.LabelFrame(w, label='Tix.NoteBook', options=options)
-
- MkPanedWindow(pane.frame)
- MkNoteBook(note.frame)
-
- pane.form(top=0, left=0, right=note, bottom=-1)
- note.form(top=0, right=-1, bottom=-1)
-
-def MkPanedWindow(w):
- """The PanedWindow widget allows the user to interactively manipulate
- the sizes of several panes. The panes can be arranged either vertically
- or horizontally.
- """
- msg = tkinter.tix.Message(w,
- relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
- text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.')
- group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25')
- group.entry.insert(0,'comp.lang.python')
- pane = tkinter.tix.PanedWindow(w, orientation='vertical')
-
- p1 = pane.add('list', min=70, size=100)
- p2 = pane.add('text', min=70)
- list = tkinter.tix.ScrolledListBox(p1)
- text = tkinter.tix.ScrolledText(p2)
-
- list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health")
- list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health")
- list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)")
- list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)")
- list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)")
- list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)")
- list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)")
-
- text.text['bg'] = list.listbox['bg']
- text.text['wrap'] = 'none'
- text.text.insert(tkinter.tix.END, """
-Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220
-Lines 353 A new way to put text and bitmaps together iNo responses
-ioi@blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania
-
-Hi,
-
-I have implemented a new image type called "compound". It allows you
-to glue together a bunch of bitmaps, images and text strings together
-to form a bigger image. Then you can use this image with widgets that
-support the -image option. For example, you can display a text string string
-together with a bitmap, at the same time, inside a TK button widget.
-""")
- list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
- text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
-
- msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
- group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
- pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1)
-
-def MkNoteBook(w):
- msg = tkinter.tix.Message(w,
- relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
- text='The NoteBook widget allows you to layout a complex interface into individual pages.')
- # prefix = Tix.OptionName(w)
- # if not prefix: prefix = ''
- # w.option_add('*' + prefix + '*TixNoteBook*tagPadX', 8)
- options = "entry.width %d label.width %d label.anchor %s" % (10, 18, tkinter.tix.E)
-
- nb = tkinter.tix.NoteBook(w, ipadx=6, ipady=6, options=options)
- nb.add('hard_disk', label="Hard Disk", underline=0)
- nb.add('network', label="Network", underline=0)
-
- # Frame for the buttons that are present on all pages
- common = tkinter.tix.Frame(nb.hard_disk)
- common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y)
- CreateCommonButtons(common)
-
- # Widgets belonging only to this page
- a = tkinter.tix.Control(nb.hard_disk, value=12, label='Access Time: ')
- w = tkinter.tix.Control(nb.hard_disk, value=400, label='Write Throughput: ')
- r = tkinter.tix.Control(nb.hard_disk, value=400, label='Read Throughput: ')
- c = tkinter.tix.Control(nb.hard_disk, value=1021, label='Capacity: ')
- a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
-
- common = tkinter.tix.Frame(nb.network)
- common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y)
- CreateCommonButtons(common)
-
- a = tkinter.tix.Control(nb.network, value=12, label='Access Time: ')
- w = tkinter.tix.Control(nb.network, value=400, label='Write Throughput: ')
- r = tkinter.tix.Control(nb.network, value=400, label='Read Throughput: ')
- c = tkinter.tix.Control(nb.network, value=1021, label='Capacity: ')
- u = tkinter.tix.Control(nb.network, value=10, label='Users: ')
- a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
- u.pack(side=tkinter.tix.TOP, padx=20, pady=2)
-
- msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
- nb.pack(side=tkinter.tix.TOP, padx=5, pady=5, fill=tkinter.tix.BOTH, expand=1)
-
-def CreateCommonButtons(f):
- ok = tkinter.tix.Button(f, text='OK', width = 6)
- cancel = tkinter.tix.Button(f, text='Cancel', width = 6)
- ok.pack(side=tkinter.tix.TOP, padx=2, pady=2)
- cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2)
-
-def MkDirList(nb, name):
- w = nb.page(name)
- options = "label.padX 4"
-
- dir = tkinter.tix.LabelFrame(w, label='Tix.DirList', options=options)
- fsbox = tkinter.tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options)
- MkDirListWidget(dir.frame)
- MkExFileWidget(fsbox.frame)
- dir.form(top=0, left=0, right='%40', bottom=-1)
- fsbox.form(top=0, left='%40', right=-1, bottom=-1)
-
-def MkDirListWidget(w):
- """The TixDirList widget gives a graphical representation of the file
- system directory and makes it easy for the user to choose and access
- directories.
- """
- msg = tkinter.tix.Message(w,
- relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
- text='The Tix DirList widget gives a graphical representation of the file system directory and makes it easy for the user to choose and access directories.')
- dirlist = tkinter.tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16')
- msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
- dirlist.pack(side=tkinter.tix.TOP, padx=3, pady=3)
-
-def MkExFileWidget(w):
- """The TixExFileSelectBox widget is more user friendly than the Motif
- style FileSelectBox. """
- msg = tkinter.tix.Message(w,
- relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
- text='The Tix ExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.')
- # There's a bug in the ComboBoxes - the scrolledlistbox is destroyed
- box = tkinter.tix.ExFileSelectBox(w, bd=2, relief=tkinter.tix.RAISED)
- msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
- box.pack(side=tkinter.tix.TOP, padx=3, pady=3)
-
-###
-### List of all the demos we want to show off
-comments = {'widget' : 'Widget Demos', 'image' : 'Image Demos'}
-samples = {'Balloon' : 'Balloon',
- 'Button Box' : 'BtnBox',
- 'Combo Box' : 'ComboBox',
- 'Compound Image' : 'CmpImg',
- 'Directory List' : 'DirList',
- 'Directory Tree' : 'DirTree',
- 'Control' : 'Control',
- 'Notebook' : 'NoteBook',
- 'Option Menu' : 'OptMenu',
- 'Paned Window' : 'PanedWin',
- 'Popup Menu' : 'PopMenu',
- 'ScrolledHList (1)' : 'SHList1',
- 'ScrolledHList (2)' : 'SHList2',
- 'Tree (dynamic)' : 'Tree'
-}
-
-# There are still a lot of demos to be translated:
-## set root {
-## {d "File Selectors" file }
-## {d "Hierachical ListBox" hlist }
-## {d "Tabular ListBox" tlist {c tixTList}}
-## {d "Grid Widget" grid {c tixGrid}}
-## {d "Manager Widgets" manager }
-## {d "Scrolled Widgets" scroll }
-## {d "Miscellaneous Widgets" misc }
-## {d "Image Types" image }
-## }
-##
-## set image {
-## {d "Compound Image" cmpimg }
-## {d "XPM Image" xpm {i pixmap}}
-## }
-##
-## set cmpimg {
-##done {f "In Buttons" CmpImg.tcl }
-## {f "In NoteBook" CmpImg2.tcl }
-## {f "Notebook Color Tabs" CmpImg4.tcl }
-## {f "Icons" CmpImg3.tcl }
-## }
-##
-## set xpm {
-## {f "In Button" Xpm.tcl {i pixmap}}
-## {f "In Menu" Xpm1.tcl {i pixmap}}
-## }
-##
-## set file {
-##added {f DirList DirList.tcl }
-##added {f DirTree DirTree.tcl }
-## {f DirSelectDialog DirDlg.tcl }
-## {f ExFileSelectDialog EFileDlg.tcl }
-## {f FileSelectDialog FileDlg.tcl }
-## {f FileEntry FileEnt.tcl }
-## }
-##
-## set hlist {
-## {f HList HList1.tcl }
-## {f CheckList ChkList.tcl {c tixCheckList}}
-##done {f "ScrolledHList (1)" SHList.tcl }
-##done {f "ScrolledHList (2)" SHList2.tcl }
-##done {f Tree Tree.tcl }
-##done {f "Tree (Dynamic)" DynTree.tcl {v win}}
-## }
-##
-## set tlist {
-## {f "ScrolledTList (1)" STList1.tcl {c tixTList}}
-## {f "ScrolledTList (2)" STList2.tcl {c tixTList}}
-## }
-## global tcl_platform
-## # This demo hangs windows
-## if {$tcl_platform(platform) != "windows"} {
-##na lappend tlist {f "TList File Viewer" STList3.tcl {c tixTList}}
-## }
-##
-## set grid {
-##na {f "Simple Grid" SGrid0.tcl {c tixGrid}}
-##na {f "ScrolledGrid" SGrid1.tcl {c tixGrid}}
-##na {f "Editable Grid" EditGrid.tcl {c tixGrid}}
-## }
-##
-## set scroll {
-## {f ScrolledListBox SListBox.tcl }
-## {f ScrolledText SText.tcl }
-## {f ScrolledWindow SWindow.tcl }
-##na {f "Canvas Object View" CObjView.tcl {c tixCObjView}}
-## }
-##
-## set manager {
-## {f ListNoteBook ListNBK.tcl }
-##done {f NoteBook NoteBook.tcl }
-##done {f PanedWindow PanedWin.tcl }
-## }
-##
-## set misc {
-##done {f Balloon Balloon.tcl }
-##done {f ButtonBox BtnBox.tcl }
-##done {f ComboBox ComboBox.tcl }
-##done {f Control Control.tcl }
-## {f LabelEntry LabEntry.tcl }
-## {f LabelFrame LabFrame.tcl }
-## {f Meter Meter.tcl {c tixMeter}}
-##done {f OptionMenu OptMenu.tcl }
-##done {f PopupMenu PopMenu.tcl }
-## {f Select Select.tcl }
-## {f StdButtonBox StdBBox.tcl }
-## }
-##
-
-stypes = {}
-stypes['widget'] = ['Balloon', 'Button Box', 'Combo Box', 'Control',
- 'Directory List', 'Directory Tree',
- 'Notebook', 'Option Menu', 'Popup Menu', 'Paned Window',
- 'ScrolledHList (1)', 'ScrolledHList (2)', 'Tree (dynamic)']
-stypes['image'] = ['Compound Image']
-
-def MkSample(nb, name):
- w = nb.page(name)
- options = "label.padX 4"
-
- pane = tkinter.tix.PanedWindow(w, orientation='horizontal')
- pane.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH)
- f1 = pane.add('list', expand='1')
- f2 = pane.add('text', expand='5')
- f1['relief'] = 'flat'
- f2['relief'] = 'flat'
-
- lab = tkinter.tix.LabelFrame(f1, label='Select a sample program:')
- lab.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5)
- lab1 = tkinter.tix.LabelFrame(f2, label='Source:')
- lab1.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5)
-
- slb = tkinter.tix.Tree(lab.frame, options='hlist.width 20')
- slb.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5)
-
- stext = tkinter.tix.ScrolledText(lab1.frame, name='stext')
- font = root.tk.eval('tix option get fixed_font')
- stext.text.config(font=font)
-
- frame = tkinter.tix.Frame(lab1.frame, name='frame')
-
- run = tkinter.tix.Button(frame, text='Run ...', name='run')
- view = tkinter.tix.Button(frame, text='View Source ...', name='view')
- run.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE)
- view.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE)
-
- stext.text['bg'] = slb.hlist['bg']
- stext.text['state'] = 'disabled'
- stext.text['wrap'] = 'none'
- stext.text['width'] = 80
-
- frame.pack(side=tkinter.tix.BOTTOM, expand=0, fill=tkinter.tix.X, padx=7)
- stext.pack(side=tkinter.tix.TOP, expand=0, fill=tkinter.tix.BOTH, padx=7)
-
- slb.hlist['separator'] = '.'
- slb.hlist['width'] = 25
- slb.hlist['drawbranch'] = 0
- slb.hlist['indent'] = 10
- slb.hlist['wideselect'] = 1
- slb.hlist['command'] = lambda args=0, w=w,slb=slb,stext=stext,run=run,view=view: Sample_Action(w, slb, stext, run, view, 'run')
- slb.hlist['browsecmd'] = lambda args=0, w=w,slb=slb,stext=stext,run=run,view=view: Sample_Action(w, slb, stext, run, view, 'browse')
-
- run['command'] = lambda args=0, w=w,slb=slb,stext=stext,run=run,view=view: Sample_Action(w, slb, stext, run, view, 'run')
- view['command'] = lambda args=0, w=w,slb=slb,stext=stext,run=run,view=view: Sample_Action(w, slb, stext, run, view, 'view')
-
- for type in ['widget', 'image']:
- if type != 'widget':
- x = tkinter.tix.Frame(slb.hlist, bd=2, height=2, width=150,
- relief=tkinter.tix.SUNKEN, bg=slb.hlist['bg'])
- slb.hlist.add_child(itemtype=tkinter.tix.WINDOW, window=x, state='disabled')
- x = slb.hlist.add_child(itemtype=tkinter.tix.TEXT, state='disabled',
- text=comments[type])
- for key in stypes[type]:
- slb.hlist.add_child(x, itemtype=tkinter.tix.TEXT, data=key,
- text=key)
- slb.hlist.selection_clear()
-
- run['state'] = 'disabled'
- view['state'] = 'disabled'
-
-def Sample_Action(w, slb, stext, run, view, action):
- global demo
-
- hlist = slb.hlist
- anchor = hlist.info_anchor()
- if not anchor:
- run['state'] = 'disabled'
- view['state'] = 'disabled'
- elif not hlist.info_parent(anchor):
- # a comment
- return
-
- run['state'] = 'normal'
- view['state'] = 'normal'
- key = hlist.info_data(anchor)
- title = key
- prog = samples[key]
-
- if action == 'run':
- exec('import ' + prog)
- w = tkinter.tix.Toplevel()
- w.title(title)
- rtn = eval(prog + '.RunSample')
- rtn(w)
- elif action == 'view':
- w = tkinter.tix.Toplevel()
- w.title('Source view: ' + title)
- LoadFile(w, demo.dir + '/samples/' + prog + '.py')
- elif action == 'browse':
- ReadFile(stext.text, demo.dir + '/samples/' + prog + '.py')
-
-def LoadFile(w, fname):
- global root
- b = tkinter.tix.Button(w, text='Close', command=w.destroy)
- t = tkinter.tix.ScrolledText(w)
- # b.form(left=0, bottom=0, padx=4, pady=4)
- # t.form(left=0, bottom=b, right='-0', top=0)
- t.pack()
- b.pack()
-
- font = root.tk.eval('tix option get fixed_font')
- t.text.config(font=font)
- t.text['bd'] = 2
- t.text['wrap'] = 'none'
-
- ReadFile(t.text, fname)
-
-def ReadFile(w, fname):
- old_state = w['state']
- w['state'] = 'normal'
- w.delete('0.0', tkinter.tix.END)
-
- try:
- f = open(fname)
- lines = f.readlines()
- for s in lines:
- w.insert(tkinter.tix.END, s)
- f.close()
- finally:
-# w.see('1.0')
- w['state'] = old_state
-
-if __name__ == '__main__':
- root = tkinter.tix.Tk()
- RunMain(root)
diff --git a/Demo/tkinter/README b/Demo/tkinter/README
deleted file mode 100644
index c9f18df39b..0000000000
--- a/Demo/tkinter/README
+++ /dev/null
@@ -1,11 +0,0 @@
-Several collections of example code for Tkinter.
-
-See the toplevel README for an explanation of the difference between
-Tkinter and _tkinter, how to enable the Python Tk interface, and where
-to get Matt Conway's lifesaver document.
-
-Subdirectories:
-
-guido my original example set (fairly random collection)
-matt Matt Conway's examples, to go with his lifesaver document
-ttk Examples using the ttk module
diff --git a/Demo/tkinter/guido/attr_dialog.py b/Demo/tkinter/guido/attr_dialog.py
deleted file mode 100644
index 229a558571..0000000000
--- a/Demo/tkinter/guido/attr_dialog.py
+++ /dev/null
@@ -1,460 +0,0 @@
-
-# The options of a widget are described by the following attributes
-# of the Pack and Widget dialogs:
-#
-# Dialog.current: {name: value}
-# -- changes during Widget's lifetime
-#
-# Dialog.options: {name: (default, klass)}
-# -- depends on widget class only
-#
-# Dialog.classes: {klass: (v0, v1, v2, ...) | 'boolean' | 'other'}
-# -- totally static, though different between PackDialog and WidgetDialog
-# (but even that could be unified)
-
-from tkinter import *
-
-
-class Option:
-
- varclass = StringVar # May be overridden
-
- def __init__(self, dialog, option):
- self.dialog = dialog
- self.option = option
- self.master = dialog.top
- self.default, self.klass = dialog.options[option]
- self.var = self.varclass(self.master)
- self.frame = Frame(self.master)
- self.frame.pack(fill=X)
- self.label = Label(self.frame, text=(option + ":"))
- self.label.pack(side=LEFT)
- self.update()
- self.addoption()
-
- def refresh(self):
- self.dialog.refresh()
- self.update()
-
- def update(self):
- try:
- self.current = self.dialog.current[self.option]
- except KeyError:
- self.current = self.default
- self.var.set(self.current)
-
- def set(self, e=None): # Should be overridden
- pass
-
-
-class BooleanOption(Option):
-
- varclass = BooleanVar
-
- def addoption(self):
- self.button = Checkbutton(self.frame,
- text='on/off',
- onvalue=1,
- offvalue=0,
- variable=self.var,
- relief=RAISED,
- borderwidth=2,
- command=self.set)
- self.button.pack(side=RIGHT)
-
-
-class EnumOption(Option):
-
- def addoption(self):
- self.button = Menubutton(self.frame,
- textvariable=self.var,
- relief=RAISED, borderwidth=2)
- self.button.pack(side=RIGHT)
- self.menu = Menu(self.button)
- self.button['menu'] = self.menu
- for v in self.dialog.classes[self.klass]:
- self.menu.add_radiobutton(
- label=v,
- variable=self.var,
- value=v,
- command=self.set)
-
-
-class StringOption(Option):
-
- def addoption(self):
- self.entry = Entry(self.frame,
- textvariable=self.var,
- width=10,
- relief=SUNKEN,
- borderwidth=2)
- self.entry.pack(side=RIGHT, fill=X, expand=1)
- self.entry.bind('<Return>', self.set)
-
-
-class ReadonlyOption(Option):
-
- def addoption(self):
- self.label = Label(self.frame, textvariable=self.var,
- anchor=E)
- self.label.pack(side=RIGHT)
-
-
-class Dialog:
-
- def __init__(self, master):
- self.master = master
- self.fixclasses()
- self.refresh()
- self.top = Toplevel(self.master)
- self.top.title(self.__class__.__name__)
- self.top.minsize(1, 1)
- self.addchoices()
-
- def refresh(self): pass # Must override
-
- def fixclasses(self): pass # May override
-
- def addchoices(self):
- self.choices = {}
- list = []
- for k, dc in self.options.items():
- list.append((k, dc))
- list.sort()
- for k, (d, c) in list:
- try:
- cl = self.classes[c]
- except KeyError:
- cl = 'unknown'
- if type(cl) is tuple:
- cl = self.enumoption
- elif cl == 'boolean':
- cl = self.booleanoption
- elif cl == 'readonly':
- cl = self.readonlyoption
- else:
- cl = self.stringoption
- self.choices[k] = cl(self, k)
-
- # Must override:
- options = {}
- classes = {}
-
- # May override:
- booleanoption = BooleanOption
- stringoption = StringOption
- enumoption = EnumOption
- readonlyoption = ReadonlyOption
-
-
-class PackDialog(Dialog):
-
- def __init__(self, widget):
- self.widget = widget
- Dialog.__init__(self, widget)
-
- def refresh(self):
- self.current = self.widget.info()
- self.current['.class'] = self.widget.winfo_class()
- self.current['.name'] = self.widget._w
-
- class packoption: # Mix-in class
- def set(self, e=None):
- self.current = self.var.get()
- try:
- self.dialog.widget.pack(**{self.option: self.current})
- except TclError as msg:
- print(msg)
- self.refresh()
-
- class booleanoption(packoption, BooleanOption): pass
- class enumoption(packoption, EnumOption): pass
- class stringoption(packoption, StringOption): pass
- class readonlyoption(packoption, ReadonlyOption): pass
-
- options = {
- '.class': (None, 'Class'),
- '.name': (None, 'Name'),
- 'after': (None, 'Widget'),
- 'anchor': ('center', 'Anchor'),
- 'before': (None, 'Widget'),
- 'expand': ('no', 'Boolean'),
- 'fill': ('none', 'Fill'),
- 'in': (None, 'Widget'),
- 'ipadx': (0, 'Pad'),
- 'ipady': (0, 'Pad'),
- 'padx': (0, 'Pad'),
- 'pady': (0, 'Pad'),
- 'side': ('top', 'Side'),
- }
-
- classes = {
- 'Anchor': (N, NE, E, SE, S, SW, W, NW, CENTER),
- 'Boolean': 'boolean',
- 'Class': 'readonly',
- 'Expand': 'boolean',
- 'Fill': (NONE, X, Y, BOTH),
- 'Name': 'readonly',
- 'Pad': 'pixel',
- 'Side': (TOP, RIGHT, BOTTOM, LEFT),
- 'Widget': 'readonly',
- }
-
-class RemotePackDialog(PackDialog):
-
- def __init__(self, master, app, widget):
- self.master = master
- self.app = app
- self.widget = widget
- self.refresh()
- self.top = Toplevel(self.master)
- self.top.title(self.app + ' PackDialog')
- self.top.minsize(1, 1)
- self.addchoices()
-
- def refresh(self):
- try:
- words = self.master.tk.splitlist(
- self.master.send(self.app,
- 'pack',
- 'info',
- self.widget))
- except TclError as msg:
- print(msg)
- return
- dict = {}
- for i in range(0, len(words), 2):
- key = words[i][1:]
- value = words[i+1]
- dict[key] = value
- dict['.class'] = self.master.send(self.app,
- 'winfo',
- 'class',
- self.widget)
- dict['.name'] = self.widget
- self.current = dict
-
- class remotepackoption: # Mix-in class
- def set(self, e=None):
- self.current = self.var.get()
- try:
- self.dialog.master.send(
- self.dialog.app,
- 'pack',
- 'config',
- self.dialog.widget,
- '-'+self.option,
- self.dialog.master.tk.merge(
- self.current))
- except TclError as msg:
- print(msg)
- self.refresh()
-
- class booleanoption(remotepackoption, BooleanOption): pass
- class enumoption(remotepackoption, EnumOption): pass
- class stringoption(remotepackoption, StringOption): pass
- class readonlyoption(remotepackoption, ReadonlyOption): pass
-
-
-class WidgetDialog(Dialog):
-
- def __init__(self, widget):
- self.widget = widget
- self.klass = widget.winfo_class()
- Dialog.__init__(self, widget)
-
- def fixclasses(self):
- if self.klass in self.addclasses:
- classes = {}
- for c in (self.classes,
- self.addclasses[self.klass]):
- for k in c.keys():
- classes[k] = c[k]
- self.classes = classes
-
- def refresh(self):
- self.configuration = self.widget.config()
- self.update()
- self.current['.class'] = self.widget.winfo_class()
- self.current['.name'] = self.widget._w
-
- def update(self):
- self.current = {}
- self.options = {}
- for k, v in self.configuration.items():
- if len(v) > 4:
- self.current[k] = v[4]
- self.options[k] = v[3], v[2] # default, klass
- self.options['.class'] = (None, 'Class')
- self.options['.name'] = (None, 'Name')
-
- class widgetoption: # Mix-in class
- def set(self, e=None):
- self.current = self.var.get()
- try:
- self.dialog.widget[self.option] = self.current
- except TclError as msg:
- print(msg)
- self.refresh()
-
- class booleanoption(widgetoption, BooleanOption): pass
- class enumoption(widgetoption, EnumOption): pass
- class stringoption(widgetoption, StringOption): pass
- class readonlyoption(widgetoption, ReadonlyOption): pass
-
- # Universal classes
- classes = {
- 'Anchor': (N, NE, E, SE, S, SW, W, NW, CENTER),
- 'Aspect': 'integer',
- 'Background': 'color',
- 'Bitmap': 'bitmap',
- 'BorderWidth': 'pixel',
- 'Class': 'readonly',
- 'CloseEnough': 'double',
- 'Command': 'command',
- 'Confine': 'boolean',
- 'Cursor': 'cursor',
- 'CursorWidth': 'pixel',
- 'DisabledForeground': 'color',
- 'ExportSelection': 'boolean',
- 'Font': 'font',
- 'Foreground': 'color',
- 'From': 'integer',
- 'Geometry': 'geometry',
- 'Height': 'pixel',
- 'InsertWidth': 'time',
- 'Justify': (LEFT, CENTER, RIGHT),
- 'Label': 'string',
- 'Length': 'pixel',
- 'MenuName': 'widget',
- 'Name': 'readonly',
- 'OffTime': 'time',
- 'OnTime': 'time',
- 'Orient': (HORIZONTAL, VERTICAL),
- 'Pad': 'pixel',
- 'Relief': (RAISED, SUNKEN, FLAT, RIDGE, GROOVE),
- 'RepeatDelay': 'time',
- 'RepeatInterval': 'time',
- 'ScrollCommand': 'command',
- 'ScrollIncrement': 'pixel',
- 'ScrollRegion': 'rectangle',
- 'ShowValue': 'boolean',
- 'SetGrid': 'boolean',
- 'Sliderforeground': 'color',
- 'SliderLength': 'pixel',
- 'Text': 'string',
- 'TickInterval': 'integer',
- 'To': 'integer',
- 'Underline': 'index',
- 'Variable': 'variable',
- 'Value': 'string',
- 'Width': 'pixel',
- 'Wrap': (NONE, CHAR, WORD),
- }
-
- # Classes that (may) differ per widget type
- _tristate = {'State': (NORMAL, ACTIVE, DISABLED)}
- _bistate = {'State': (NORMAL, DISABLED)}
- addclasses = {
- 'Button': _tristate,
- 'Radiobutton': _tristate,
- 'Checkbutton': _tristate,
- 'Entry': _bistate,
- 'Text': _bistate,
- 'Menubutton': _tristate,
- 'Slider': _bistate,
- }
-
-
-class RemoteWidgetDialog(WidgetDialog):
-
- def __init__(self, master, app, widget):
- self.app = app
- self.widget = widget
- self.klass = master.send(self.app,
- 'winfo',
- 'class',
- self.widget)
- Dialog.__init__(self, master)
-
- def refresh(self):
- try:
- items = self.master.tk.splitlist(
- self.master.send(self.app,
- self.widget,
- 'config'))
- except TclError as msg:
- print(msg)
- return
- dict = {}
- for item in items:
- words = self.master.tk.splitlist(item)
- key = words[0][1:]
- value = (key,) + words[1:]
- dict[key] = value
- self.configuration = dict
- self.update()
- self.current['.class'] = self.klass
- self.current['.name'] = self.widget
-
- class remotewidgetoption: # Mix-in class
- def set(self, e=None):
- self.current = self.var.get()
- try:
- self.dialog.master.send(
- self.dialog.app,
- self.dialog.widget,
- 'config',
- '-'+self.option,
- self.current)
- except TclError as msg:
- print(msg)
- self.refresh()
-
- class booleanoption(remotewidgetoption, BooleanOption): pass
- class enumoption(remotewidgetoption, EnumOption): pass
- class stringoption(remotewidgetoption, StringOption): pass
- class readonlyoption(remotewidgetoption, ReadonlyOption): pass
-
-
-def test():
- import sys
- root = Tk()
- root.minsize(1, 1)
- if sys.argv[1:]:
- remotetest(root, sys.argv[1])
- else:
- frame = Frame(root, name='frame')
- frame.pack(expand=1, fill=BOTH)
- button = Button(frame, name='button', text='button')
- button.pack(expand=1)
- canvas = Canvas(frame, name='canvas')
- canvas.pack()
- fpd = PackDialog(frame)
- fwd = WidgetDialog(frame)
- bpd = PackDialog(button)
- bwd = WidgetDialog(button)
- cpd = PackDialog(canvas)
- cwd = WidgetDialog(canvas)
- root.mainloop()
-
-def remotetest(root, app):
- from listtree import listtree
- list = listtree(root, app)
- list.bind('<Any-Double-1>', opendialogs)
- list.app = app # Pass it on to handler
-
-def opendialogs(e):
- list = e.widget
- sel = list.curselection()
- for i in sel:
- item = list.get(i)
- widget = item.split()[0]
- RemoteWidgetDialog(list, list.app, widget)
- if widget == '.': continue
- try:
- RemotePackDialog(list, list.app, widget)
- except TclError as msg:
- print(msg)
-
-test()
diff --git a/Demo/tkinter/guido/brownian.py b/Demo/tkinter/guido/brownian.py
deleted file mode 100644
index 7ab3e6787f..0000000000
--- a/Demo/tkinter/guido/brownian.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Brownian motion -- an example of a multi-threaded Tkinter program.
-
-from tkinter import *
-import random
-import threading
-import time
-import sys
-
-WIDTH = 400
-HEIGHT = 300
-SIGMA = 10
-BUZZ = 2
-RADIUS = 2
-LAMBDA = 10
-FILL = 'red'
-
-stop = 0 # Set when main loop exits
-
-def particle(canvas):
- r = RADIUS
- x = random.gauss(WIDTH/2.0, SIGMA)
- y = random.gauss(HEIGHT/2.0, SIGMA)
- p = canvas.create_oval(x-r, y-r, x+r, y+r, fill=FILL)
- while not stop:
- dx = random.gauss(0, BUZZ)
- dy = random.gauss(0, BUZZ)
- dt = random.expovariate(LAMBDA)
- try:
- canvas.move(p, dx, dy)
- except TclError:
- break
- time.sleep(dt)
-
-def main():
- global stop
- root = Tk()
- canvas = Canvas(root, width=WIDTH, height=HEIGHT)
- canvas.pack(fill='both', expand=1)
- np = 30
- if sys.argv[1:]:
- np = int(sys.argv[1])
- for i in range(np):
- t = threading.Thread(target=particle, args=(canvas,))
- t.start()
- try:
- root.mainloop()
- finally:
- stop = 1
-
-main()
diff --git a/Demo/tkinter/guido/brownian2.py b/Demo/tkinter/guido/brownian2.py
deleted file mode 100644
index dc1d43ac86..0000000000
--- a/Demo/tkinter/guido/brownian2.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Brownian motion -- an example of a NON multi-threaded Tkinter program ;)
-# By Michele Simoniato, inspired by brownian.py
-
-from tkinter import *
-import random
-import sys
-
-WIDTH = 400
-HEIGHT = 300
-SIGMA = 10
-BUZZ = 2
-RADIUS = 2
-LAMBDA = 10
-FILL = 'red'
-
-stop = 0 # Set when main loop exits
-root = None # main window
-
-def particle(canvas): # particle = iterator over the moves
- r = RADIUS
- x = random.gauss(WIDTH/2.0, SIGMA)
- y = random.gauss(HEIGHT/2.0, SIGMA)
- p = canvas.create_oval(x-r, y-r, x+r, y+r, fill=FILL)
- while not stop:
- dx = random.gauss(0, BUZZ)
- dy = random.gauss(0, BUZZ)
- try:
- canvas.move(p, dx, dy)
- except TclError:
- break
- else:
- yield None
-
-def move(particle): # move the particle at random time
- particle.next()
- dt = random.expovariate(LAMBDA)
- root.after(int(dt*1000), move, particle)
-
-def main():
- global root, stop
- root = Tk()
- canvas = Canvas(root, width=WIDTH, height=HEIGHT)
- canvas.pack(fill='both', expand=1)
- np = 30
- if sys.argv[1:]:
- np = int(sys.argv[1])
- for i in range(np): # start the dance
- move(particle(canvas))
- try:
- root.mainloop()
- finally:
- stop = 1
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/tkinter/guido/canvasevents.py b/Demo/tkinter/guido/canvasevents.py
deleted file mode 100644
index ffeb0caaf8..0000000000
--- a/Demo/tkinter/guido/canvasevents.py
+++ /dev/null
@@ -1,264 +0,0 @@
-#! /usr/bin/env python
-
-from tkinter import *
-
-
-# Since Canvas.Group is no longer present, the following class reproduces
-# a subset of the old Group class that is used by this app.
-
-class Group:
- def __init__(self, canvas, tag=None):
- if tag is None:
- tag = 'Group%d' % id(self)
-
- self.tag = self.id = tag
- self.canvas = canvas
- self.canvas.dtag(self.tag)
-
- def __str__(self):
- return self.tag
-
- def _do(self, cmd, *args):
- return self.canvas.tk.call(self.canvas._w, cmd, self.tag, *args)
-
- def addtag_withtag(self, tagOrId):
- self._do('addtag', 'withtag', tagOrId)
-
- def bind(self, sequence=None, command=None, add=None):
- return self.canvas.tag_bind(self.id, sequence, command, add)
-
- def move(self, x_amount, y_amount):
- self._do('move', x_amount, y_amount)
-
- def dtag(self, tagToDelete=None):
- self._do('dtag', tagToDelete)
-
- def tkraise(self, aboveThis=None):
- self._do('raise', aboveThis)
-
-
-class Object:
-
- """Base class for composite graphical objects.
-
- Objects belong to a canvas, and can be moved around on the canvas.
- They also belong to at most one ``pile'' of objects, and can be
- transferred between piles (or removed from their pile).
-
- Objects have a canonical ``x, y'' position which is moved when the
- object is moved. Where the object is relative to this position
- depends on the object; for simple objects, it may be their center.
-
- Objects have mouse sensitivity. They can be clicked, dragged and
- double-clicked. The behavior may actually determined by the pile
- they are in.
-
- All instance attributes are public since the derived class may
- need them.
- """
-
- def __init__(self, canvas, x=0, y=0, fill='red', text='object'):
- self.canvas = canvas
- self.x = x
- self.y = y
- self.pile = None
- self.group = Group(self.canvas)
- self.createitems(fill, text)
-
- def __str__(self):
- return str(self.group)
-
- def createitems(self, fill, text):
- self.__oval = self.canvas.create_oval(self.x - 20, self.y - 10,
- self.x + 20, self.y + 20, fill=fill, width=3)
- self.group.addtag_withtag(self.__oval)
- self.__text = self.canvas.create_text(self.x, self.y, text=text)
- self.group.addtag_withtag(self.__text)
-
- def moveby(self, dx, dy):
- if dx == dy == 0:
- return
- self.group.move(dx, dy)
- self.x = self.x + dx
- self.y = self.y + dy
-
- def moveto(self, x, y):
- self.moveby(x - self.x, y - self.y)
-
- def transfer(self, pile):
- if self.pile:
- self.pile.delete(self)
- self.pile = None
- self.pile = pile
- if self.pile:
- self.pile.add(self)
-
- def tkraise(self):
- self.group.tkraise()
-
-
-class Bottom(Object):
- """An object to serve as the bottom of a pile."""
-
- def createitems(self, *args):
- self.__oval = self.canvas.create_oval(self.x - 20, self.y - 10,
- self.x + 20, self.y + 10, fill='gray', outline='')
- self.group.addtag_withtag(self.__oval)
-
-
-class Pile:
- """A group of graphical objects."""
-
- def __init__(self, canvas, x, y, tag=None):
- self.canvas = canvas
- self.x = x
- self.y = y
- self.objects = []
- self.bottom = Bottom(self.canvas, self.x, self.y)
- self.group = Group(self.canvas, tag=tag)
- self.group.addtag_withtag(self.bottom.group)
- self.bindhandlers()
-
- def bindhandlers(self):
- self.group.bind('<1>', self.clickhandler)
- self.group.bind('<Double-1>', self.doubleclickhandler)
-
- def add(self, object):
- self.objects.append(object)
- self.group.addtag_withtag(object.group)
- self.position(object)
-
- def delete(self, object):
- object.group.dtag(self.group)
- self.objects.remove(object)
-
- def position(self, object):
- object.tkraise()
- i = self.objects.index(object)
- object.moveto(self.x + i*4, self.y + i*8)
-
- def clickhandler(self, event):
- pass
-
- def doubleclickhandler(self, event):
- pass
-
-
-class MovingPile(Pile):
-
- def bindhandlers(self):
- Pile.bindhandlers(self)
- self.group.bind('<B1-Motion>', self.motionhandler)
- self.group.bind('<ButtonRelease-1>', self.releasehandler)
-
- movethis = None
-
- def clickhandler(self, event):
- tags = self.canvas.gettags('current')
- for i in range(len(self.objects)):
- o = self.objects[i]
- if o.group.tag in tags:
- break
- else:
- self.movethis = None
- return
- self.movethis = self.objects[i:]
- for o in self.movethis:
- o.tkraise()
- self.lastx = event.x
- self.lasty = event.y
-
- doubleclickhandler = clickhandler
-
- def motionhandler(self, event):
- if not self.movethis:
- return
- dx = event.x - self.lastx
- dy = event.y - self.lasty
- self.lastx = event.x
- self.lasty = event.y
- for o in self.movethis:
- o.moveby(dx, dy)
-
- def releasehandler(self, event):
- objects = self.movethis
- if not objects:
- return
- self.movethis = None
- self.finishmove(objects)
-
- def finishmove(self, objects):
- for o in objects:
- self.position(o)
-
-
-class Pile1(MovingPile):
-
- x = 50
- y = 50
- tag = 'p1'
-
- def __init__(self, demo):
- self.demo = demo
- MovingPile.__init__(self, self.demo.canvas, self.x, self.y, self.tag)
-
- def doubleclickhandler(self, event):
- try:
- o = self.objects[-1]
- except IndexError:
- return
- o.transfer(self.other())
- MovingPile.doubleclickhandler(self, event)
-
- def other(self):
- return self.demo.p2
-
- def finishmove(self, objects):
- o = objects[0]
- p = self.other()
- x, y = o.x, o.y
- if (x-p.x)**2 + (y-p.y)**2 < (x-self.x)**2 + (y-self.y)**2:
- for o in objects:
- o.transfer(p)
- else:
- MovingPile.finishmove(self, objects)
-
-class Pile2(Pile1):
-
- x = 150
- y = 50
- tag = 'p2'
-
- def other(self):
- return self.demo.p1
-
-
-class Demo:
-
- def __init__(self, master):
- self.master = master
- self.canvas = Canvas(master,
- width=200, height=200,
- background='yellow',
- relief=SUNKEN, borderwidth=2)
- self.canvas.pack(expand=1, fill=BOTH)
- self.p1 = Pile1(self)
- self.p2 = Pile2(self)
- o1 = Object(self.canvas, fill='red', text='o1')
- o2 = Object(self.canvas, fill='green', text='o2')
- o3 = Object(self.canvas, fill='light blue', text='o3')
- o1.transfer(self.p1)
- o2.transfer(self.p1)
- o3.transfer(self.p2)
-
-
-# Main function, run when invoked as a stand-alone Python program.
-
-def main():
- root = Tk()
- demo = Demo(root)
- root.protocol('WM_DELETE_WINDOW', root.quit)
- root.mainloop()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/tkinter/guido/dialog.py b/Demo/tkinter/guido/dialog.py
deleted file mode 100755
index 2a4a939111..0000000000
--- a/Demo/tkinter/guido/dialog.py
+++ /dev/null
@@ -1,108 +0,0 @@
-#! /usr/bin/env python
-
-# A Python function that generates dialog boxes with a text message,
-# optional bitmap, and any number of buttons.
-# Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.2-3, pp. 269-270.
-
-from tkinter import *
-import sys
-
-
-def dialog(master, title, text, bitmap, default, *args):
-
- # 1. Create the top-level window and divide it into top
- # and bottom parts.
-
- w = Toplevel(master, class_='Dialog')
- w.title(title)
- w.iconname('Dialog')
-
- top = Frame(w, relief=RAISED, borderwidth=1)
- top.pack(side=TOP, fill=BOTH)
- bot = Frame(w, relief=RAISED, borderwidth=1)
- bot.pack(side=BOTTOM, fill=BOTH)
-
- # 2. Fill the top part with the bitmap and message.
-
- msg = Message(top, width='3i', text=text)
- msg.pack(side=RIGHT, expand=1, fill=BOTH, padx='3m', pady='3m')
- if bitmap:
- bm = Label(top, bitmap=bitmap)
- bm.pack(side=LEFT, padx='3m', pady='3m')
-
- # 3. Create a row of buttons at the bottom of the dialog.
-
- var = IntVar()
- buttons = []
- i = 0
- for but in args:
- b = Button(bot, text=but, command=lambda v=var,i=i: v.set(i))
- buttons.append(b)
- if i == default:
- bd = Frame(bot, relief=SUNKEN, borderwidth=1)
- bd.pack(side=LEFT, expand=1, padx='3m', pady='2m')
- b.lift()
- b.pack (in_=bd, side=LEFT,
- padx='2m', pady='2m', ipadx='2m', ipady='1m')
- else:
- b.pack (side=LEFT, expand=1,
- padx='3m', pady='3m', ipadx='2m', ipady='1m')
- i = i+1
-
- # 4. Set up a binding for <Return>, if there's a default,
- # set a grab, and claim the focus too.
-
- if default >= 0:
- w.bind('<Return>',
- lambda e, b=buttons[default], v=var, i=default:
- (b.flash(),
- v.set(i)))
-
- oldFocus = w.focus_get()
- w.grab_set()
- w.focus_set()
-
- # 5. Wait for the user to respond, then restore the focus
- # and return the index of the selected button.
-
- w.waitvar(var)
- w.destroy()
- if oldFocus: oldFocus.focus_set()
- return var.get()
-
-# The rest is the test program.
-
-def go():
- i = dialog(mainWidget,
- 'Not Responding',
- "The file server isn't responding right now; "
- "I'll keep trying.",
- '',
- -1,
- 'OK')
- print('pressed button', i)
- i = dialog(mainWidget,
- 'File Modified',
- 'File "tcl.h" has been modified since '
- 'the last time it was saved. '
- 'Do you want to save it before exiting the application?',
- 'warning',
- 0,
- 'Save File',
- 'Discard Changes',
- 'Return To Editor')
- print('pressed button', i)
-
-def test():
- import sys
- global mainWidget
- mainWidget = Frame()
- Pack.config(mainWidget)
- start = Button(mainWidget, text='Press Here To Start', command=go)
- start.pack()
- endit = Button(mainWidget, text="Exit", command=sys.exit)
- endit.pack(fill=BOTH)
- mainWidget.mainloop()
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/tkinter/guido/electrons.py b/Demo/tkinter/guido/electrons.py
deleted file mode 100755
index b5c9ec09ff..0000000000
--- a/Demo/tkinter/guido/electrons.py
+++ /dev/null
@@ -1,91 +0,0 @@
-#! /usr/bin/env python
-
-# Simulate "electrons" migrating across the screen.
-# An optional bitmap file in can be in the background.
-#
-# Usage: electrons [n [bitmapfile]]
-#
-# n is the number of electrons to animate; default is 30.
-#
-# The bitmap file can be any X11 bitmap file (look in
-# /usr/include/X11/bitmaps for samples); it is displayed as the
-# background of the animation. Default is no bitmap.
-
-from tkinter import *
-import random
-
-
-# The graphical interface
-class Electrons:
-
- # Create our objects
- def __init__(self, n, bitmap = None):
- self.n = n
- self.tk = tk = Tk()
- self.canvas = c = Canvas(tk)
- c.pack()
- width, height = tk.getint(c['width']), tk.getint(c['height'])
-
- # Add background bitmap
- if bitmap:
- self.bitmap = c.create_bitmap(width/2, height/2,
- bitmap=bitmap,
- foreground='blue')
-
- self.pieces = []
- x1, y1, x2, y2 = 10,70,14,74
- for i in range(n):
- p = c.create_oval(x1, y1, x2, y2, fill='red')
- self.pieces.append(p)
- y1, y2 = y1 +2, y2 + 2
- self.tk.update()
-
- def random_move(self, n):
- c = self.canvas
- for p in self.pieces:
- x = random.choice(range(-2,4))
- y = random.choice(range(-3,4))
- c.move(p, x, y)
- self.tk.update()
-
- # Run -- allow 500 movemens
- def run(self):
- try:
- for i in range(500):
- self.random_move(self.n)
- except TclError:
- try:
- self.tk.destroy()
- except TclError:
- pass
-
-
-# Main program
-def main():
- import sys
-
- # First argument is number of electrons, default 30
- if sys.argv[1:]:
- n = int(sys.argv[1])
- else:
- n = 30
-
- # Second argument is bitmap file, default none
- if sys.argv[2:]:
- bitmap = sys.argv[2]
- # Reverse meaning of leading '@' compared to Tk
- if bitmap[0] == '@': bitmap = bitmap[1:]
- else: bitmap = '@' + bitmap
- else:
- bitmap = None
-
- # Create the graphical objects...
- h = Electrons(n, bitmap)
-
- # ...and run!
- h.run()
-
-
-# Call main when run as script
-if __name__ == '__main__':
- main()
diff --git a/Demo/tkinter/guido/hello.py b/Demo/tkinter/guido/hello.py
deleted file mode 100755
index f10fb7a3fb..0000000000
--- a/Demo/tkinter/guido/hello.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Display hello, world in a button; clicking it quits the program
-
-import sys
-from tkinter import *
-
-def main():
- root = Tk()
- button = Button(root)
- button['text'] = 'Hello, world'
- button['command'] = quit_callback # See below
- button.pack()
- root.mainloop()
-
-def quit_callback():
- sys.exit(0)
-
-main()
diff --git a/Demo/tkinter/guido/imagedraw.py b/Demo/tkinter/guido/imagedraw.py
deleted file mode 100755
index a168831abd..0000000000
--- a/Demo/tkinter/guido/imagedraw.py
+++ /dev/null
@@ -1,23 +0,0 @@
-"""Draw on top of an image"""
-
-from tkinter import *
-import sys
-
-def main():
- filename = sys.argv[1]
- root = Tk()
- img = PhotoImage(file=filename)
- w, h = img.width(), img.height()
- canv = Canvas(root, width=w, height=h)
- canv.create_image(0, 0, anchor=NW, image=img)
- canv.pack()
- canv.bind('<Button-1>', blob)
- root.mainloop()
-
-def blob(event):
- x, y = event.x, event.y
- canv = event.widget
- r = 5
- canv.create_oval(x-r, y-r, x+r, y+r, fill='red', outline="")
-
-main()
diff --git a/Demo/tkinter/guido/imageview.py b/Demo/tkinter/guido/imageview.py
deleted file mode 100755
index 276858a6d8..0000000000
--- a/Demo/tkinter/guido/imageview.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from tkinter import *
-import sys
-
-def main():
- filename = sys.argv[1]
- root = Tk()
- img = PhotoImage(file=filename)
- label = Label(root, image=img)
- label.pack()
- root.mainloop()
-
-main()
diff --git a/Demo/tkinter/guido/kill.py b/Demo/tkinter/guido/kill.py
deleted file mode 100755
index 36caba6be2..0000000000
--- a/Demo/tkinter/guido/kill.py
+++ /dev/null
@@ -1,98 +0,0 @@
-#! /usr/bin/env python
-# Tkinter interface to Linux `kill' command.
-
-from tkinter import *
-from string import splitfields
-from string import split
-import subprocess
-import os
-
-class BarButton(Menubutton):
- def __init__(self, master=None, **cnf):
- Menubutton.__init__(self, master, **cnf)
- self.pack(side=LEFT)
- self.menu = Menu(self, name='menu')
- self['menu'] = self.menu
-
-class Kill(Frame):
- # List of (name, option, pid_column)
- format_list = [('Default', '', 0),
- ('Long', '-l', 2),
- ('User', '-u', 1),
- ('Jobs', '-j', 1),
- ('Signal', '-s', 1),
- ('Memory', '-m', 0),
- ('VM', '-v', 0),
- ('Hex', '-X', 0)]
- def kill(self, selected):
- c = self.format_list[self.format.get()][2]
- pid = split(selected)[c]
- os.system('kill -9 ' + pid)
- self.do_update()
- def do_update(self):
- name, option, column = self.format_list[self.format.get()]
- s = subprocess.getoutput('ps -w ' + option)
- list = splitfields(s, '\n')
- self.header.set(list[0])
- del list[0]
- y = self.frame.vscroll.get()[0]
- self.frame.list.delete(0, AtEnd())
- for line in list:
- self.frame.list.insert(0, line)
- self.frame.list.yview(int(y))
- def do_motion(self, e):
- e.widget.select_clear(0, END)
- e.widget.select_set(e.widget.nearest(e.y))
- def do_leave(self, e):
- e.widget.select_clear(0, END)
- def do_1(self, e):
- self.kill(e.widget.get(e.widget.nearest(e.y)))
- def __init__(self, master=None, **cnf):
- Frame.__init__(self, master, cnf)
- self.pack(expand=1, fill=BOTH)
- self.bar = Frame(self, name='bar', relief=RAISED,
- borderwidth=2)
- self.bar.pack(fill=X)
- self.bar.file = BarButton(self.bar, text='File')
- self.bar.file.menu.add_command(
- label='Quit', command=self.quit)
- self.bar.view = BarButton(self.bar, text='View')
- self.format = IntVar(self)
- self.format.set(2)
- for num in range(len(self.format_list)):
- self.bar.view.menu.add_radiobutton(
- label=self.format_list[num][0],
- command=self.do_update,
- variable=self.format,
- value=num)
- #self.bar.view.menu.add_separator()
- #XXX ...
- self.bar.tk_menuBar(self.bar.file, self.bar.view)
- self.frame = Frame(self, relief=RAISED, borderwidth=2)
- self.frame.pack(expand=1, fill=BOTH)
- self.header = StringVar(self)
- self.frame.label = Label(self.frame, relief=FLAT, anchor=NW,
- borderwidth=0,
- textvariable=self.header)
- self.frame.label.pack(fill=X)
- self.frame.vscroll = Scrollbar(self.frame, orient=VERTICAL)
- self.frame.list = Listbox(self.frame, relief=SUNKEN,
- selectbackground='#eed5b7',
- selectborderwidth=0,
- yscroll=self.frame.vscroll.set)
- self.frame.vscroll['command'] = self.frame.list.yview
- self.frame.vscroll.pack(side=RIGHT, fill=Y)
- self.frame.list.pack(expand=1, fill=BOTH)
- self.update = Button(self, text="Update",
- command=self.do_update)
- self.update.pack(expand=1, fill=X)
- self.frame.list.bind('<Motion>', self.do_motion)
- self.frame.list.bind('<Leave>', self.do_leave)
- self.frame.list.bind('<1>', self.do_1)
- self.do_update()
-
-if __name__ == '__main__':
- kill = Kill(None, borderwidth=5)
- kill.winfo_toplevel().title('Tkinter Process Killer')
- kill.winfo_toplevel().minsize(1, 1)
- kill.mainloop()
diff --git a/Demo/tkinter/guido/listtree.py b/Demo/tkinter/guido/listtree.py
deleted file mode 100755
index 8db5b60ddb..0000000000
--- a/Demo/tkinter/guido/listtree.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# List a remote app's widget tree (names and classes only)
-
-import sys
-
-from tkinter import *
-
-def listtree(master, app):
- list = Listbox(master, name='list')
- list.pack(expand=1, fill=BOTH)
- listnodes(list, app, '.', 0)
- return list
-
-def listnodes(list, app, widget, level):
- klass = list.send(app, 'winfo', 'class', widget)
- list.insert(END, '%s (%s)' % (widget, klass))
- children = list.tk.splitlist(
- list.send(app, 'winfo', 'children', widget))
- for c in children:
- listnodes(list, app, c, level+1)
-
-def main():
- if not sys.argv[1:]:
- sys.stderr.write('Usage: listtree appname\n')
- sys.exit(2)
- app = sys.argv[1]
- tk = Tk()
- tk.minsize(1, 1)
- f = Frame(tk, name='f')
- f.pack(expand=1, fill=BOTH)
- list = listtree(f, app)
- tk.mainloop()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/tkinter/guido/manpage.py b/Demo/tkinter/guido/manpage.py
deleted file mode 100644
index 750c6758d6..0000000000
--- a/Demo/tkinter/guido/manpage.py
+++ /dev/null
@@ -1,215 +0,0 @@
-# Widget to display a man page
-
-import os
-import re
-import sys
-
-from tkinter import *
-from tkinter.font import Font
-from tkinter.scrolledtext import ScrolledText
-
-# XXX Recognizing footers is system dependent
-# (This one works for IRIX 5.2 and Solaris 2.2)
-footerprog = re.compile(
- '^ Page [1-9][0-9]*[ \t]+\|^.*Last change:.*[1-9][0-9]*\n')
-emptyprog = re.compile('^[ \t]*\n')
-ulprog = re.compile('^[ \t]*[Xv!_][Xv!_ \t]*\n')
-
-
-class EditableManPage(ScrolledText):
- """Basic Man Page class -- does not disable editing."""
-
- def __init__(self, master=None, **cnf):
- ScrolledText.__init__(self, master, **cnf)
-
- bold = Font(font=self['font']).copy()
- bold.config(weight='bold')
- italic = Font(font=self['font']).copy()
- italic.config(slant='italic')
-
- # Define tags for formatting styles
- self.tag_config('X', underline=1)
- self.tag_config('!', font=bold)
- self.tag_config('_', font=italic)
-
- # Set state to idle
- self.fp = None
- self.lineno = 0
-
- def busy(self):
- """Test whether we are busy parsing a file."""
- return self.fp != None
-
- def kill(self):
- """Ensure we're not busy."""
- if self.busy():
- self._endparser()
-
- def asyncparsefile(self, fp):
- """Parse a file, in the background."""
- self._startparser(fp)
- self.tk.createfilehandler(fp, READABLE,
- self._filehandler)
-
- parsefile = asyncparsefile # Alias
-
- def _filehandler(self, fp, mask):
- """I/O handler used by background parsing."""
- nextline = self.fp.readline()
- if not nextline:
- self._endparser()
- return
- self._parseline(nextline)
-
- def syncparsefile(self, fp):
- """Parse a file, now (cannot be aborted)."""
- self._startparser(fp)
- while True:
- nextline = fp.readline()
- if not nextline:
- break
- self._parseline(nextline)
- self._endparser()
-
- def _startparser(self, fp):
- """Initialize parsing from a particular file -- must not be busy."""
- if self.busy():
- raise RuntimeError('startparser: still busy')
- fp.fileno() # Test for file-ness
- self.fp = fp
- self.lineno = 0
- self.ok = 0
- self.empty = 0
- self.buffer = None
- savestate = self['state']
- self['state'] = NORMAL
- self.delete('1.0', END)
- self['state'] = savestate
-
- def _endparser(self):
- """End parsing -- must be busy, need not be at EOF."""
- if not self.busy():
- raise RuntimeError('endparser: not busy')
- if self.buffer:
- self._parseline('')
- try:
- self.tk.deletefilehandler(self.fp)
- except TclError:
- pass
- self.fp.close()
- self.fp = None
- del self.ok, self.empty, self.buffer
-
- def _parseline(self, nextline):
- """Parse a single line."""
- if not self.buffer:
- # Save this line -- we need one line read-ahead
- self.buffer = nextline
- return
- if emptyprog.match(self.buffer):
- # Buffered line was empty -- set a flag
- self.empty = 1
- self.buffer = nextline
- return
- textline = self.buffer
- if ulprog.match(nextline):
- # Next line is properties for buffered line
- propline = nextline
- self.buffer = None
- else:
- # Next line is read-ahead
- propline = None
- self.buffer = nextline
- if not self.ok:
- # First non blank line after footer must be header
- # -- skip that too
- self.ok = 1
- self.empty = 0
- return
- if footerprog.match(textline):
- # Footer -- start skipping until next non-blank line
- self.ok = 0
- self.empty = 0
- return
- savestate = self['state']
- self['state'] = NORMAL
- if TkVersion >= 4.0:
- self.mark_set('insert', 'end-1c')
- else:
- self.mark_set('insert', END)
- if self.empty:
- # One or more previous lines were empty
- # -- insert one blank line in the text
- self._insert_prop('\n')
- self.lineno = self.lineno + 1
- self.empty = 0
- if not propline:
- # No properties
- self._insert_prop(textline)
- else:
- # Search for properties
- p = ''
- j = 0
- for i in range(min(len(propline), len(textline))):
- if propline[i] != p:
- if j < i:
- self._insert_prop(textline[j:i], p)
- j = i
- p = propline[i]
- self._insert_prop(textline[j:])
- self.lineno = self.lineno + 1
- self['state'] = savestate
-
- def _insert_prop(self, str, prop = ' '):
- """Insert a string at the end, with at most one property (tag)."""
- here = self.index(AtInsert())
- self.insert(AtInsert(), str)
- if TkVersion <= 4.0:
- tags = self.tag_names(here)
- for tag in tags:
- self.tag_remove(tag, here, AtInsert())
- if prop != ' ':
- self.tag_add(prop, here, AtInsert())
-
-
-class ReadonlyManPage(EditableManPage):
- """Readonly Man Page class -- disables editing, otherwise the same."""
-
- def __init__(self, master=None, **cnf):
- cnf['state'] = DISABLED
- EditableManPage.__init__(self, master, **cnf)
-
-# Alias
-ManPage = ReadonlyManPage
-
-# usage: ManPage [manpage]; or ManPage [-f] file
-# -f means that the file is nroff -man output run through ul -i
-def main():
- # XXX This directory may be different on your system
- MANDIR = ''
- DEFAULTPAGE = 'Tcl'
- formatted = 0
- if sys.argv[1:] and sys.argv[1] == '-f':
- formatted = 1
- del sys.argv[1]
- if sys.argv[1:]:
- name = sys.argv[1]
- else:
- name = DEFAULTPAGE
- if not formatted:
- if name[-2:-1] != '.':
- name = name + '.n'
- name = os.path.join(MANDIR, name)
- root = Tk()
- root.minsize(1, 1)
- manpage = ManPage(root, relief=SUNKEN, borderwidth=2)
- manpage.pack(expand=1, fill=BOTH)
- if formatted:
- fp = open(name, 'r')
- else:
- fp = os.popen('nroff -man -c %s | ul -i' % name, 'r')
- manpage.parsefile(fp)
- root.mainloop()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/tkinter/guido/mbox.py b/Demo/tkinter/guido/mbox.py
deleted file mode 100755
index 754a312402..0000000000
--- a/Demo/tkinter/guido/mbox.py
+++ /dev/null
@@ -1,286 +0,0 @@
-#! /usr/bin/env python
-
-# Scan MH folder, display results in window
-
-import os
-import re
-import sys
-import getopt
-import mailbox
-from tkinter import *
-
-from dialog import dialog
-
-MBOXPATH = os.environ['HOME'] + '/Mail'
-
-def main():
- global root, tk, top, mid, bot
- global folderbox, foldermenu, scanbox, scanmenu, viewer
- global folder, seq
- global mh, mhf
-
- # Parse command line options
-
- folder = 'inbox'
- seq = 'all'
- try:
- opts, args = getopt.getopt(sys.argv[1:], '')
- except getopt.error as msg:
- print(msg)
- sys.exit(2)
- for arg in args:
- if arg[:1] == '+':
- folder = arg[1:]
- else:
- seq = arg
-
- # Initialize MH
-
- mh = mailbox.MH(MBOXPATH)
- mhf = mh.get_folder(folder)
-
- # Build widget hierarchy
-
- root = Tk()
- tk = root.tk
-
- top = Frame(root)
- top.pack({'expand': 1, 'fill': 'both'})
-
- # Build right part: folder list
-
- right = Frame(top)
- right.pack({'fill': 'y', 'side': 'right'})
-
- folderbar = Scrollbar(right, {'relief': 'sunken', 'bd': 2})
- folderbar.pack({'fill': 'y', 'side': 'right'})
-
- folderbox = Listbox(right, {'exportselection': 0})
- folderbox.pack({'expand': 1, 'fill': 'both', 'side': 'left'})
-
- foldermenu = Menu(root)
- foldermenu.add('command',
- {'label': 'Open Folder',
- 'command': open_folder})
- foldermenu.add('separator')
- foldermenu.add('command',
- {'label': 'Quit',
- 'command': 'exit'})
- foldermenu.bind('<ButtonRelease-3>', folder_unpost)
-
- folderbox['yscrollcommand'] = (folderbar, 'set')
- folderbar['command'] = (folderbox, 'yview')
- folderbox.bind('<Double-1>', open_folder, 1)
- folderbox.bind('<3>', folder_post)
-
- # Build left part: scan list
-
- left = Frame(top)
- left.pack({'expand': 1, 'fill': 'both', 'side': 'left'})
-
- scanbar = Scrollbar(left, {'relief': 'sunken', 'bd': 2})
- scanbar.pack({'fill': 'y', 'side': 'right'})
-
- scanbox = Listbox(left, {'font': 'fixed'})
- scanbox.pack({'expand': 1, 'fill': 'both', 'side': 'left'})
-
- scanmenu = Menu(root)
- scanmenu.add('command',
- {'label': 'Open Message',
- 'command': open_message})
- scanmenu.add('command',
- {'label': 'Remove Message',
- 'command': remove_message})
- scanmenu.add('command',
- {'label': 'Refile Message',
- 'command': refile_message})
- scanmenu.add('separator')
- scanmenu.add('command',
- {'label': 'Quit',
- 'command': 'exit'})
- scanmenu.bind('<ButtonRelease-3>', scan_unpost)
-
- scanbox['yscrollcommand'] = (scanbar, 'set')
- scanbar['command'] = (scanbox, 'yview')
- scanbox.bind('<Double-1>', open_message)
- scanbox.bind('<3>', scan_post)
-
- # Separator between middle and bottom part
-
- rule2 = Frame(root, {'bg': 'black'})
- rule2.pack({'fill': 'x'})
-
- # Build bottom part: current message
-
- bot = Frame(root)
- bot.pack({'expand': 1, 'fill': 'both'})
- #
- viewer = None
-
- # Window manager commands
-
- root.minsize(800, 1) # Make window resizable
-
- # Fill folderbox with text
-
- setfolders()
-
- # Fill scanbox with text
-
- rescan()
-
- # Enter mainloop
-
- root.mainloop()
-
-def folder_post(e):
- x, y = e.x_root, e.y_root
- foldermenu.post(x - 10, y - 10)
- foldermenu.grab_set()
-
-def folder_unpost(e):
- tk.call('update', 'idletasks')
- foldermenu.grab_release()
- foldermenu.unpost()
- foldermenu.invoke('active')
-
-def scan_post(e):
- x, y = e.x_root, e.y_root
- scanmenu.post(x - 10, y - 10)
- scanmenu.grab_set()
-
-def scan_unpost(e):
- tk.call('update', 'idletasks')
- scanmenu.grab_release()
- scanmenu.unpost()
- scanmenu.invoke('active')
-
-scanparser = re.compile('^ *([0-9]+)')
-
-def open_folder(e=None):
- global folder, mhf
- sel = folderbox.curselection()
- if len(sel) != 1:
- if len(sel) > 1:
- msg = "Please open one folder at a time"
- else:
- msg = "Please select a folder to open"
- dialog(root, "Can't Open Folder", msg, "", 0, "OK")
- return
- i = sel[0]
- folder = folderbox.get(i)
- mhf = mh.get_folder(folder)
- rescan()
-
-def open_message(e=None):
- global viewer
- sel = scanbox.curselection()
- if len(sel) != 1:
- if len(sel) > 1:
- msg = "Please open one message at a time"
- else:
- msg = "Please select a message to open"
- dialog(root, "Can't Open Message", msg, "", 0, "OK")
- return
- cursor = scanbox['cursor']
- scanbox['cursor'] = 'watch'
- tk.call('update', 'idletasks')
- i = sel[0]
- line = scanbox.get(i)
- m = scanparser.match(line)
- if m:
- num = int(m.group(1))
- m = mhf.get_message(num)
- if viewer: viewer.destroy()
- from mimeviewer import MimeViewer
- viewer = MimeViewer(bot, '+%s/%d' % (folder, num), m)
- viewer.pack()
- viewer.show()
- scanbox['cursor'] = cursor
-
-def interestingheader(header):
- return header != 'received'
-
-def remove_message(e=None):
- itop = scanbox.nearest(0)
- sel = scanbox.curselection()
- if not sel:
- dialog(root, "No Message To Remove",
- "Please select a message to remove", "", 0, "OK")
- return
- todo = []
- for i in sel:
- line = scanbox.get(i)
- m = scanparser.match(line)
- if m:
- toremove = int(m.group(1))
- todo.append(toremove)
- mhf.remove(toremove)
- rescan()
- fixfocus(min(todo), itop)
-
-lastrefile = ''
-tofolder = None
-def refile_message(e=None):
- global lastrefile, tofolder
- itop = scanbox.nearest(0)
- sel = scanbox.curselection()
- if not sel:
- dialog(root, "No Message To Refile",
- "Please select a message to refile", "", 0, "OK")
- return
- foldersel = folderbox.curselection()
- if len(foldersel) != 1:
- if not foldersel:
- msg = "Please select a folder to refile to"
- else:
- msg = "Please select exactly one folder to refile to"
- dialog(root, "No Folder To Refile", msg, "", 0, "OK")
- return
- refileto = folderbox.get(foldersel[0])
- todo = []
- for i in sel:
- line = scanbox.get(i)
- m = scanparser.match(line)
- if m:
- todo.append(int(m.group(1)))
- if lastrefile != refileto or not tofolder:
- lastrefile = refileto
- tofolder = None
- tofolder = mh.get_folder(lastrefile)
- mhf.refilemessages(todo, tofolder)
- rescan()
- fixfocus(min(todo), itop)
-
-def fixfocus(near, itop):
- n = scanbox.size()
- for i in range(n):
- line = scanbox.get(repr(i))
- m = scanparser.match(line)
- if m:
- num = int(m.group(1))
- if num >= near:
- break
- else:
- i = 'end'
- scanbox.yview(itop)
-
-def setfolders():
- folderbox.delete(0, 'end')
- for fn in mh.list_folders():
- folderbox.insert('end', fn)
-
-def rescan():
- global viewer
- if viewer:
- viewer.destroy()
- viewer = None
- scanbox.delete(0, 'end')
- for line in scanfolder(folder, seq):
- scanbox.insert('end', line)
-
-def scanfolder(folder = 'inbox', sequence = 'all'):
- return [line[:-1] for line in
- os.popen('scan +%s %s' % (folder, sequence), 'r').readlines()]
-
-main()
diff --git a/Demo/tkinter/guido/mimeviewer.py b/Demo/tkinter/guido/mimeviewer.py
deleted file mode 100755
index babed8f5d0..0000000000
--- a/Demo/tkinter/guido/mimeviewer.py
+++ /dev/null
@@ -1,159 +0,0 @@
-#! /usr/bin/env python3
-
-# View a single MIME multipart message.
-# Display each part as a box.
-
-import os
-import sys
-import getopt
-import mailbox
-from tkinter import *
-from tkinter.scrolledtext import ScrolledText
-
-MBOXPATH = os.environ['HOME'] + '/Mail'
-
-class Error(Exception):
- pass
-
-def getcurrent(self):
- """Return the current message. Raise Error when there is none."""
- seqs = self.get_sequences()
- try:
- return max(seqs['cur'])
- except (ValueError, KeyError):
- raise Error("no cur message")
-
-
-class MimeViewer:
- def __init__(self, parent, title, msg):
- self.title = title
- self.msg = msg
- self.frame = Frame(parent, {'relief': 'raised', 'bd': 2})
- self.frame.packing = {'expand': 0, 'fill': 'both'}
- self.button = Checkbutton(self.frame,
- {'text': title,
- 'command': self.toggle})
- self.button.pack({'anchor': 'w'})
- headertext = []
- for item in msg.items():
- headertext.append("%s: %s" % item)
- headertext = '\n'.join(headertext)
- height = countlines(headertext, 4)
- if height:
- self.htext = ScrolledText(self.frame,
- {'height': height,
- 'width': 80,
- 'wrap': 'none',
- 'relief': 'raised',
- 'bd': 2})
- self.htext.packing = {'expand': 1, 'fill': 'both',
- 'after': self.button}
- self.htext.insert('end', headertext)
- else:
- self.htext = Frame(self.frame,
- {'relief': 'raised', 'bd': 2})
- self.htext.packing = {'side': 'top',
- 'ipady': 2,
- 'fill': 'x',
- 'after': self.button}
- body = msg.get_payload()
- if type(body) == str:
- self.pad = None
- height = countlines(body, 10)
- if height:
- self.btext = ScrolledText(self.frame,
- {'height': height,
- 'width': 80,
- 'wrap': 'none',
- 'relief': 'raised',
- 'bd': 2})
- self.btext.packing = {'expand': 1,
- 'fill': 'both'}
- self.btext.insert('end', body)
- else:
- self.btext = None
- self.parts = None
- else:
- self.pad = Frame(self.frame,
- {'relief': 'flat', 'bd': 2})
- self.pad.packing = {'side': 'left', 'ipadx': 10,
- 'fill': 'y', 'after': self.htext}
- self.parts = []
- for i in range(len(body)):
- p = MimeViewer(self.frame,
- '%s.%d' % (title, i+1),
- body[i])
- self.parts.append(p)
- self.btext = None
- self.collapsed = 1
- def pack(self):
- self.frame.pack(self.frame.packing)
- def destroy(self):
- self.frame.destroy()
- def show(self):
- if self.collapsed:
- self.button.invoke()
- def toggle(self):
- if self.collapsed:
- self.explode()
- else:
- self.collapse()
- def collapse(self):
- self.collapsed = 1
- for comp in self.htext, self.btext, self.pad:
- if comp:
- comp.forget()
- if self.parts:
- for part in self.parts:
- part.frame.forget()
- self.frame.pack({'expand': 0})
- def explode(self):
- self.collapsed = 0
- for comp in self.htext, self.btext, self.pad:
- if comp: comp.pack(comp.packing)
- if self.parts:
- for part in self.parts:
- part.pack()
- self.frame.pack({'expand': 1})
-
-def countlines(str, limit):
- i = 0
- n = 0
- while n < limit:
- i = str.find('\n', i)
- if i < 0: break
- n = n+1
- i = i+1
- return n
-
-def main():
- opts, args = getopt.getopt(sys.argv[1:], '')
- for o, a in opts:
- pass
- message = None
- folder = 'inbox'
- for arg in args:
- if arg[:1] == '+':
- folder = arg[1:]
- else:
- message = int(arg)
-
- mh = mailbox.MH(MBOXPATH)
- f = mh.get_folder(folder)
- if message is None:
- message = getcurrent(f)
- m = mailbox.MHMessage(f.get(message))
-
- root = Tk()
- tk = root.tk
-
- top = MimeViewer(root, '+%s/%d' % (folder, message), m)
- top.pack()
- top.show()
-
- root.minsize(1, 1)
-
- tk.mainloop()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/tkinter/guido/newmenubardemo.py b/Demo/tkinter/guido/newmenubardemo.py
deleted file mode 100644
index 51c4e64771..0000000000
--- a/Demo/tkinter/guido/newmenubardemo.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /usr/bin/env python
-
-"""Play with the new Tk 8.0 toplevel menu option."""
-
-from tkinter import *
-
-class App:
-
- def __init__(self, master):
- self.master = master
-
- self.menubar = Menu(self.master)
-
- self.filemenu = Menu(self.menubar)
-
- self.filemenu.add_command(label="New")
- self.filemenu.add_command(label="Open...")
- self.filemenu.add_command(label="Close")
- self.filemenu.add_separator()
- self.filemenu.add_command(label="Quit", command=self.master.quit)
-
- self.editmenu = Menu(self.menubar)
-
- self.editmenu.add_command(label="Cut")
- self.editmenu.add_command(label="Copy")
- self.editmenu.add_command(label="Paste")
-
- self.helpmenu = Menu(self.menubar, name='help')
-
- self.helpmenu.add_command(label="About...")
-
- self.menubar.add_cascade(label="File", menu=self.filemenu)
- self.menubar.add_cascade(label="Edit", menu=self.editmenu)
- self.menubar.add_cascade(label="Help", menu=self.helpmenu)
-
- self.top = Toplevel(menu=self.menubar)
-
- # Rest of app goes here...
-
-def main():
- root = Tk()
- root.withdraw()
- app = App(root)
- root.mainloop()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/tkinter/guido/optionmenu.py b/Demo/tkinter/guido/optionmenu.py
deleted file mode 100644
index 1e72aa5895..0000000000
--- a/Demo/tkinter/guido/optionmenu.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# option menu sample (Fredrik Lundh, September 1997)
-
-from tkinter import *
-
-root = Tk()
-
-#
-# standard usage
-
-var1 = StringVar()
-var1.set("One") # default selection
-
-menu1 = OptionMenu(root, var1, "One", "Two", "Three")
-menu1.pack()
-
-#
-# initialize from a sequence
-
-CHOICES = "Aah", "Bee", "Cee", "Dee", "Eff"
-
-var2 = StringVar()
-var2.set(CHOICES[0])
-
-menu2 = OptionMenu(root, var2, *CHOICES)
-menu2.pack()
-
-root.mainloop()
diff --git a/Demo/tkinter/guido/paint.py b/Demo/tkinter/guido/paint.py
deleted file mode 100644
index 65f2353110..0000000000
--- a/Demo/tkinter/guido/paint.py
+++ /dev/null
@@ -1,60 +0,0 @@
-""""Paint program by Dave Michell.
-
-Subject: tkinter "paint" example
-From: Dave Mitchell <davem@magnet.com>
-To: python-list@cwi.nl
-Date: Fri, 23 Jan 1998 12:18:05 -0500 (EST)
-
- Not too long ago (last week maybe?) someone posted a request
-for an example of a paint program using Tkinter. Try as I might
-I can't seem to find it in the archive, so i'll just post mine
-here and hope that the person who requested it sees this!
-
- All this does is put up a canvas and draw a smooth black line
-whenever you have the mouse button down, but hopefully it will
-be enough to start with.. It would be easy enough to add some
-options like other shapes or colors...
-
- yours,
- dave mitchell
- davem@magnet.com
-"""
-
-from tkinter import *
-
-"""paint.py: not exactly a paint program.. just a smooth line drawing demo."""
-
-b1 = "up"
-xold, yold = None, None
-
-def main():
- root = Tk()
- drawing_area = Canvas(root)
- drawing_area.pack()
- drawing_area.bind("<Motion>", motion)
- drawing_area.bind("<ButtonPress-1>", b1down)
- drawing_area.bind("<ButtonRelease-1>", b1up)
- root.mainloop()
-
-def b1down(event):
- global b1
- b1 = "down" # you only want to draw when the button is down
- # because "Motion" events happen -all the time-
-
-def b1up(event):
- global b1, xold, yold
- b1 = "up"
- xold = None # reset the line when you let go of the button
- yold = None
-
-def motion(event):
- if b1 == "down":
- global xold, yold
- if xold is not None and yold is not None:
- event.widget.create_line(xold,yold,event.x,event.y,smooth=TRUE)
- # here's where you draw it. smooth. neat.
- xold = event.x
- yold = event.y
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/tkinter/guido/rmt.py b/Demo/tkinter/guido/rmt.py
deleted file mode 100755
index 350d60bb51..0000000000
--- a/Demo/tkinter/guido/rmt.py
+++ /dev/null
@@ -1,159 +0,0 @@
-#! /usr/bin/env python
-
-# A Python program implementing rmt, an application for remotely
-# controlling other Tk applications.
-# Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.5-8, pp. 273-276.
-
-# Note that because of forward references in the original, we
-# sometimes delay bindings until after the corresponding procedure is
-# defined. We also introduce names for some unnamed code blocks in
-# the original because of restrictions on lambda forms in Python.
-
-# XXX This should be written in a more Python-like style!!!
-
-from tkinter import *
-import sys
-
-# 1. Create basic application structure: menu bar on top of
-# text widget, scrollbar on right.
-
-root = Tk()
-tk = root.tk
-mBar = Frame(root, relief=RAISED, borderwidth=2)
-mBar.pack(fill=X)
-
-f = Frame(root)
-f.pack(expand=1, fill=BOTH)
-s = Scrollbar(f, relief=FLAT)
-s.pack(side=RIGHT, fill=Y)
-t = Text(f, relief=RAISED, borderwidth=2, yscrollcommand=s.set, setgrid=1)
-t.pack(side=LEFT, fill=BOTH, expand=1)
-t.tag_config('bold')
-s['command'] = t.yview
-
-root.title('Tk Remote Controller')
-root.iconname('Tk Remote')
-
-# 2. Create menu button and menus.
-
-file = Menubutton(mBar, text='File', underline=0)
-file.pack(side=LEFT)
-file_m = Menu(file)
-file['menu'] = file_m
-file_m_apps = Menu(file_m, tearoff=0)
-file_m.add_cascade(label='Select Application', underline=0,
- menu=file_m_apps)
-file_m.add_command(label='Quit', underline=0, command=sys.exit)
-
-# 3. Create bindings for text widget to allow commands to be
-# entered and information to be selected. New characters
-# can only be added at the end of the text (can't ever move
-# insertion point).
-
-def single1(e):
- x = e.x
- y = e.y
- t.setvar('tk_priv(selectMode)', 'char')
- t.mark_set('anchor', At(x, y))
- # Should focus W
-t.bind('<1>', single1)
-
-def double1(e):
- x = e.x
- y = e.y
- t.setvar('tk_priv(selectMode)', 'word')
- t.tk_textSelectTo(At(x, y))
-t.bind('<Double-1>', double1)
-
-def triple1(e):
- x = e.x
- y = e.y
- t.setvar('tk_priv(selectMode)', 'line')
- t.tk_textSelectTo(At(x, y))
-t.bind('<Triple-1>', triple1)
-
-def returnkey(e):
- t.insert(AtInsert(), '\n')
- invoke()
-t.bind('<Return>', returnkey)
-
-def controlv(e):
- t.insert(AtInsert(), t.selection_get())
- t.yview_pickplace(AtInsert())
- if t.index(AtInsert())[-2:] == '.0':
- invoke()
-t.bind('<Control-v>', controlv)
-
-# 4. Procedure to backspace over one character, as long as
-# the character isn't part of the prompt.
-
-def backspace(e):
- if t.index('promptEnd') != t.index('insert - 1 char'):
- t.delete('insert - 1 char', AtInsert())
- t.yview_pickplace(AtInsert())
-t.bind('<BackSpace>', backspace)
-t.bind('<Control-h>', backspace)
-t.bind('<Delete>', backspace)
-
-
-# 5. Procedure that's invoked when return is typed: if
-# there's not yet a complete command (e.g. braces are open)
-# then do nothing. Otherwise, execute command (locally or
-# remotely), output the result or error message, and issue
-# a new prompt.
-
-def invoke():
- cmd = t.get('promptEnd + 1 char', AtInsert())
- if t.getboolean(tk.call('info', 'complete', cmd)): # XXX
- if app == root.winfo_name():
- msg = tk.call('eval', cmd) # XXX
- else:
- msg = t.send(app, cmd)
- if msg:
- t.insert(AtInsert(), msg + '\n')
- prompt()
- t.yview_pickplace(AtInsert())
-
-def prompt():
- t.insert(AtInsert(), app + ': ')
- t.mark_set('promptEnd', 'insert - 1 char')
- t.tag_add('bold', 'insert linestart', 'promptEnd')
-
-# 6. Procedure to select a new application. Also changes
-# the prompt on the current command line to reflect the new
-# name.
-
-def newApp(appName):
- global app
- app = appName
- t.delete('promptEnd linestart', 'promptEnd')
- t.insert('promptEnd', appName + ':')
- t.tag_add('bold', 'promptEnd linestart', 'promptEnd')
-
-def fillAppsMenu():
- file_m_apps.add('command')
- file_m_apps.delete(0, 'last')
- names = root.winfo_interps()
- names = list(names) # convert tuple to list
- names.sort()
- for name in names:
- try:
- root.send(name, 'winfo name .')
- except TclError:
- # Inoperative window -- ignore it
- pass
- else:
- file_m_apps.add_command(
- label=name,
- command=lambda name=name: newApp(name))
-
-file_m_apps['postcommand'] = fillAppsMenu
-mBar.tk_menuBar(file)
-
-# 7. Miscellaneous initialization.
-
-app = root.winfo_name()
-prompt()
-t.focus()
-
-root.mainloop()
diff --git a/Demo/tkinter/guido/shell_window.py b/Demo/tkinter/guido/shell_window.py
deleted file mode 100644
index c5a0401900..0000000000
--- a/Demo/tkinter/guido/shell_window.py
+++ /dev/null
@@ -1,146 +0,0 @@
-import os
-import sys
-from tkinter import *
-from tkinter.scrolledtext import ScrolledText
-from tkinter.dialog import Dialog
-import signal
-
-BUFSIZE = 512
-
-class ShellWindow(ScrolledText):
-
- def __init__(self, master=None, shell=None, **cnf):
- if not shell:
- try:
- shell = os.environ['SHELL']
- except KeyError:
- shell = '/bin/sh'
- shell = shell + ' -i'
- args = shell.split()
- shell = args[0]
-
- ScrolledText.__init__(self, master, **cnf)
- self.pos = '1.0'
- self.bind('<Return>', self.inputhandler)
- self.bind('<Control-c>', self.sigint)
- self.bind('<Control-t>', self.sigterm)
- self.bind('<Control-k>', self.sigkill)
- self.bind('<Control-d>', self.sendeof)
-
- self.pid, self.fromchild, self.tochild = spawn(shell, args)
- self.tk.createfilehandler(self.fromchild, READABLE,
- self.outputhandler)
-
- def outputhandler(self, file, mask):
- data = os.read(file, BUFSIZE).decode()
- if not data:
- self.tk.deletefilehandler(file)
- pid, sts = os.waitpid(self.pid, 0)
- print('pid', pid, 'status', sts)
- self.pid = None
- detail = sts>>8
- cause = sts & 0xff
- if cause == 0:
- msg = "exit status %d" % detail
- else:
- msg = "killed by signal %d" % (cause & 0x7f)
- if cause & 0x80:
- msg = msg + " -- core dumped"
- Dialog(self.master,
- text=msg,
- title="Exit status",
- bitmap='warning',
- default=0,
- strings=('OK',))
- return
- self.insert(END, data)
- self.pos = self.index("end - 1 char")
- self.yview_pickplace(END)
-
- def inputhandler(self, *args):
- if not self.pid:
- self.no_process()
- return "break"
- self.insert(END, "\n")
- line = self.get(self.pos, "end - 1 char")
- self.pos = self.index(END)
- os.write(self.tochild, line.encode())
- return "break"
-
- def sendeof(self, *args):
- if not self.pid:
- self.no_process()
- return "break"
- os.close(self.tochild)
- return "break"
-
- def sendsig(self, sig):
- if not self.pid:
- self.no_process()
- return "break"
- os.kill(self.pid, sig)
- return "break"
-
- def sigint(self, *args):
- return self.sendsig(signal.SIGINT)
-
- def sigquit(self, *args):
- return self.sendsig(signal.SIGQUIT)
-
- def sigterm(self, *args):
- return self.sendsig(signal.SIGTERM)
-
- def sigkill(self, *args):
- return self.sendsig(signal.SIGKILL)
-
- def no_process(self):
- Dialog(self.master,
- text="No active process",
- title="No process",
- bitmap='error',
- default=0,
- strings=('OK',))
-
-MAXFD = 100 # Max number of file descriptors (os.getdtablesize()???)
-
-def spawn(prog, args):
- p2cread, p2cwrite = os.pipe()
- c2pread, c2pwrite = os.pipe()
- pid = os.fork()
- if pid == 0:
- # Child
- for i in 0, 1, 2:
- try:
- os.close(i)
- except os.error:
- pass
- if os.dup(p2cread) != 0:
- sys.stderr.write('popen2: bad read dup\n')
- if os.dup(c2pwrite) != 1:
- sys.stderr.write('popen2: bad write dup\n')
- if os.dup(c2pwrite) != 2:
- sys.stderr.write('popen2: bad write dup\n')
- os.closerange(3, MAXFD)
- try:
- os.execvp(prog, args)
- finally:
- sys.stderr.write('execvp failed\n')
- os._exit(1)
- os.close(p2cread)
- os.close(c2pwrite)
- return pid, c2pread, p2cwrite
-
-def test():
- shell = ' '.join(sys.argv[1: ])
- root = Tk()
- root.minsize(1, 1)
- if shell:
- w = ShellWindow(root, shell=shell)
- else:
- w = ShellWindow(root)
- w.pack(expand=1, fill=BOTH)
- w.focus_set()
- w.tk.mainloop()
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/tkinter/guido/solitaire.py b/Demo/tkinter/guido/solitaire.py
deleted file mode 100755
index 43106e1f25..0000000000
--- a/Demo/tkinter/guido/solitaire.py
+++ /dev/null
@@ -1,626 +0,0 @@
-#! /usr/bin/env python
-
-"""Solitaire game, much like the one that comes with MS Windows.
-
-Limitations:
-
-- No cute graphical images for the playing cards faces or backs.
-- No scoring or timer.
-- No undo.
-- No option to turn 3 cards at a time.
-- No keyboard shortcuts.
-- Less fancy animation when you win.
-- The determination of which stack you drag to is more relaxed.
-
-Apology:
-
-I'm not much of a card player, so my terminology in these comments may
-at times be a little unusual. If you have suggestions, please let me
-know!
-
-"""
-
-# Imports
-
-import random
-
-from tkinter import *
-from canvasevents import Group
-
-
-# Constants determining the size and lay-out of cards and stacks. We
-# work in a "grid" where each card/stack is surrounded by MARGIN
-# pixels of space on each side, so adjacent stacks are separated by
-# 2*MARGIN pixels. OFFSET is the offset used for displaying the
-# face down cards in the row stacks.
-
-CARDWIDTH = 100
-CARDHEIGHT = 150
-MARGIN = 10
-XSPACING = CARDWIDTH + 2*MARGIN
-YSPACING = CARDHEIGHT + 4*MARGIN
-OFFSET = 5
-
-# The background color, green to look like a playing table. The
-# standard green is way too bright, and dark green is way to dark, so
-# we use something in between. (There are a few more colors that
-# could be customized, but they are less controversial.)
-
-BACKGROUND = '#070'
-
-
-# Suits and colors. The values of the symbolic suit names are the
-# strings used to display them (you change these and VALNAMES to
-# internationalize the game). The COLOR dictionary maps suit names to
-# colors (red and black) which must be Tk color names. The keys() of
-# the COLOR dictionary conveniently provides us with a list of all
-# suits (in arbitrary order).
-
-HEARTS = 'Heart'
-DIAMONDS = 'Diamond'
-CLUBS = 'Club'
-SPADES = 'Spade'
-
-RED = 'red'
-BLACK = 'black'
-
-COLOR = {}
-for s in (HEARTS, DIAMONDS):
- COLOR[s] = RED
-for s in (CLUBS, SPADES):
- COLOR[s] = BLACK
-
-ALLSUITS = list(COLOR.keys())
-NSUITS = len(ALLSUITS)
-
-
-# Card values are 1-13. We also define symbolic names for the picture
-# cards. ALLVALUES is a list of all card values.
-
-ACE = 1
-JACK = 11
-QUEEN = 12
-KING = 13
-ALLVALUES = range(1, 14) # (one more than the highest value)
-NVALUES = len(ALLVALUES)
-
-
-# VALNAMES is a list that maps a card value to string. It contains a
-# dummy element at index 0 so it can be indexed directly with the card
-# value.
-
-VALNAMES = ["", "A"] + list(map(str, range(2, 11))) + ["J", "Q", "K"]
-
-
-# Solitaire constants. The only one I can think of is the number of
-# row stacks.
-
-NROWS = 7
-
-
-# The rest of the program consists of class definitions. These are
-# further described in their documentation strings.
-
-
-class Card:
-
- """A playing card.
-
- A card doesn't record to which stack it belongs; only the stack
- records this (it turns out that we always know this from the
- context, and this saves a ``double update'' with potential for
- inconsistencies).
-
- Public methods:
-
- moveto(x, y) -- move the card to an absolute position
- moveby(dx, dy) -- move the card by a relative offset
- tkraise() -- raise the card to the top of its stack
- showface(), showback() -- turn the card face up or down & raise it
-
- Public read-only instance variables:
-
- suit, value, color -- the card's suit, value and color
- face_shown -- true when the card is shown face up, else false
-
- Semi-public read-only instance variables (XXX should be made
- private):
-
- group -- the Canvas.Group representing the card
- x, y -- the position of the card's top left corner
-
- Private instance variables:
-
- __back, __rect, __text -- the canvas items making up the card
-
- (To show the card face up, the text item is placed in front of
- rect and the back is placed behind it. To show it face down, this
- is reversed. The card is created face down.)
-
- """
-
- def __init__(self, suit, value, canvas):
- """Card constructor.
-
- Arguments are the card's suit and value, and the canvas widget.
-
- The card is created at position (0, 0), with its face down
- (adding it to a stack will position it according to that
- stack's rules).
-
- """
- self.suit = suit
- self.value = value
- self.color = COLOR[suit]
- self.face_shown = 0
-
- self.x = self.y = 0
- self.canvas = canvas
- self.group = Group(canvas)
-
- text = "%s %s" % (VALNAMES[value], suit)
- self.__text = canvas.create_text(CARDWIDTH // 2, 0, anchor=N,
- fill=self.color, text=text)
- self.group.addtag_withtag(self.__text)
-
- self.__rect = canvas.create_rectangle(0, 0, CARDWIDTH, CARDHEIGHT,
- outline='black', fill='white')
- self.group.addtag_withtag(self.__rect)
-
- self.__back = canvas.create_rectangle(MARGIN, MARGIN,
- CARDWIDTH - MARGIN,
- CARDHEIGHT - MARGIN,
- outline='black', fill='blue')
- self.group.addtag_withtag(self.__back)
-
- def __repr__(self):
- """Return a string for debug print statements."""
- return "Card(%r, %r)" % (self.suit, self.value)
-
- def moveto(self, x, y):
- """Move the card to absolute position (x, y)."""
- self.moveby(x - self.x, y - self.y)
-
- def moveby(self, dx, dy):
- """Move the card by (dx, dy)."""
- self.x = self.x + dx
- self.y = self.y + dy
- self.group.move(dx, dy)
-
- def tkraise(self):
- """Raise the card above all other objects in its canvas."""
- self.group.tkraise()
-
- def showface(self):
- """Turn the card's face up."""
- self.tkraise()
- self.canvas.tag_raise(self.__rect)
- self.canvas.tag_raise(self.__text)
- self.face_shown = 1
-
- def showback(self):
- """Turn the card's face down."""
- self.tkraise()
- self.canvas.tag_raise(self.__rect)
- self.canvas.tag_raise(self.__back)
- self.face_shown = 0
-
-
-class Stack:
-
- """A generic stack of cards.
-
- This is used as a base class for all other stacks (e.g. the deck,
- the suit stacks, and the row stacks).
-
- Public methods:
-
- add(card) -- add a card to the stack
- delete(card) -- delete a card from the stack
- showtop() -- show the top card (if any) face up
- deal() -- delete and return the top card, or None if empty
-
- Method that subclasses may override:
-
- position(card) -- move the card to its proper (x, y) position
-
- The default position() method places all cards at the stack's
- own (x, y) position.
-
- userclickhandler(), userdoubleclickhandler() -- called to do
- subclass specific things on single and double clicks
-
- The default user (single) click handler shows the top card
- face up. The default user double click handler calls the user
- single click handler.
-
- usermovehandler(cards) -- called to complete a subpile move
-
- The default user move handler moves all moved cards back to
- their original position (by calling the position() method).
-
- Private methods:
-
- clickhandler(event), doubleclickhandler(event),
- motionhandler(event), releasehandler(event) -- event handlers
-
- The default event handlers turn the top card of the stack with
- its face up on a (single or double) click, and also support
- moving a subpile around.
-
- startmoving(event) -- begin a move operation
- finishmoving() -- finish a move operation
-
- """
-
- def __init__(self, x, y, game=None):
- """Stack constructor.
-
- Arguments are the stack's nominal x and y position (the top
- left corner of the first card placed in the stack), and the
- game object (which is used to get the canvas; subclasses use
- the game object to find other stacks).
-
- """
- self.x = x
- self.y = y
- self.game = game
- self.cards = []
- self.group = Group(self.game.canvas)
- self.group.bind('<1>', self.clickhandler)
- self.group.bind('<Double-1>', self.doubleclickhandler)
- self.group.bind('<B1-Motion>', self.motionhandler)
- self.group.bind('<ButtonRelease-1>', self.releasehandler)
- self.makebottom()
-
- def makebottom(self):
- pass
-
- def __repr__(self):
- """Return a string for debug print statements."""
- return "%s(%d, %d)" % (self.__class__.__name__, self.x, self.y)
-
- # Public methods
-
- def add(self, card):
- self.cards.append(card)
- card.tkraise()
- self.position(card)
- self.group.addtag_withtag(card.group)
-
- def delete(self, card):
- self.cards.remove(card)
- card.group.dtag(self.group)
-
- def showtop(self):
- if self.cards:
- self.cards[-1].showface()
-
- def deal(self):
- if not self.cards:
- return None
- card = self.cards[-1]
- self.delete(card)
- return card
-
- # Subclass overridable methods
-
- def position(self, card):
- card.moveto(self.x, self.y)
-
- def userclickhandler(self):
- self.showtop()
-
- def userdoubleclickhandler(self):
- self.userclickhandler()
-
- def usermovehandler(self, cards):
- for card in cards:
- self.position(card)
-
- # Event handlers
-
- def clickhandler(self, event):
- self.finishmoving() # In case we lost an event
- self.userclickhandler()
- self.startmoving(event)
-
- def motionhandler(self, event):
- self.keepmoving(event)
-
- def releasehandler(self, event):
- self.keepmoving(event)
- self.finishmoving()
-
- def doubleclickhandler(self, event):
- self.finishmoving() # In case we lost an event
- self.userdoubleclickhandler()
- self.startmoving(event)
-
- # Move internals
-
- moving = None
-
- def startmoving(self, event):
- self.moving = None
- tags = self.game.canvas.gettags('current')
- for i in range(len(self.cards)):
- card = self.cards[i]
- if card.group.tag in tags:
- break
- else:
- return
- if not card.face_shown:
- return
- self.moving = self.cards[i:]
- self.lastx = event.x
- self.lasty = event.y
- for card in self.moving:
- card.tkraise()
-
- def keepmoving(self, event):
- if not self.moving:
- return
- dx = event.x - self.lastx
- dy = event.y - self.lasty
- self.lastx = event.x
- self.lasty = event.y
- if dx or dy:
- for card in self.moving:
- card.moveby(dx, dy)
-
- def finishmoving(self):
- cards = self.moving
- self.moving = None
- if cards:
- self.usermovehandler(cards)
-
-
-class Deck(Stack):
-
- """The deck is a stack with support for shuffling.
-
- New methods:
-
- fill() -- create the playing cards
- shuffle() -- shuffle the playing cards
-
- A single click moves the top card to the game's open deck and
- moves it face up; if we're out of cards, it moves the open deck
- back to the deck.
-
- """
-
- def makebottom(self):
- bottom = self.game.canvas.create_rectangle(self.x, self.y,
- self.x + CARDWIDTH, self.y + CARDHEIGHT, outline='black',
- fill=BACKGROUND)
- self.group.addtag_withtag(bottom)
-
- def fill(self):
- for suit in ALLSUITS:
- for value in ALLVALUES:
- self.add(Card(suit, value, self.game.canvas))
-
- def shuffle(self):
- n = len(self.cards)
- newcards = []
- for i in randperm(n):
- newcards.append(self.cards[i])
- self.cards = newcards
-
- def userclickhandler(self):
- opendeck = self.game.opendeck
- card = self.deal()
- if not card:
- while 1:
- card = opendeck.deal()
- if not card:
- break
- self.add(card)
- card.showback()
- else:
- self.game.opendeck.add(card)
- card.showface()
-
-
-def randperm(n):
- """Function returning a random permutation of range(n)."""
- r = list(range(n))
- x = []
- while r:
- i = random.choice(r)
- x.append(i)
- r.remove(i)
- return x
-
-
-class OpenStack(Stack):
-
- def acceptable(self, cards):
- return 0
-
- def usermovehandler(self, cards):
- card = cards[0]
- stack = self.game.closeststack(card)
- if not stack or stack is self or not stack.acceptable(cards):
- Stack.usermovehandler(self, cards)
- else:
- for card in cards:
- self.delete(card)
- stack.add(card)
- self.game.wincheck()
-
- def userdoubleclickhandler(self):
- if not self.cards:
- return
- card = self.cards[-1]
- if not card.face_shown:
- self.userclickhandler()
- return
- for s in self.game.suits:
- if s.acceptable([card]):
- self.delete(card)
- s.add(card)
- self.game.wincheck()
- break
-
-
-class SuitStack(OpenStack):
-
- def makebottom(self):
- bottom = self.game.canvas.create_rectangle(self.x, self.y,
- self.x + CARDWIDTH, self.y + CARDHEIGHT, outline='black', fill='')
-
- def userclickhandler(self):
- pass
-
- def userdoubleclickhandler(self):
- pass
-
- def acceptable(self, cards):
- if len(cards) != 1:
- return 0
- card = cards[0]
- if not self.cards:
- return card.value == ACE
- topcard = self.cards[-1]
- return card.suit == topcard.suit and card.value == topcard.value + 1
-
-
-class RowStack(OpenStack):
-
- def acceptable(self, cards):
- card = cards[0]
- if not self.cards:
- return card.value == KING
- topcard = self.cards[-1]
- if not topcard.face_shown:
- return 0
- return card.color != topcard.color and card.value == topcard.value - 1
-
- def position(self, card):
- y = self.y
- for c in self.cards:
- if c == card:
- break
- if c.face_shown:
- y = y + 2*MARGIN
- else:
- y = y + OFFSET
- card.moveto(self.x, y)
-
-
-class Solitaire:
-
- def __init__(self, master):
- self.master = master
-
- self.canvas = Canvas(self.master,
- background=BACKGROUND,
- highlightthickness=0,
- width=NROWS*XSPACING,
- height=3*YSPACING + 20 + MARGIN)
- self.canvas.pack(fill=BOTH, expand=TRUE)
-
- self.dealbutton = Button(self.canvas,
- text="Deal",
- highlightthickness=0,
- background=BACKGROUND,
- activebackground="green",
- command=self.deal)
- self.canvas.create_window(MARGIN, 3 * YSPACING + 20,
- window=self.dealbutton, anchor=SW)
-
- x = MARGIN
- y = MARGIN
-
- self.deck = Deck(x, y, self)
-
- x = x + XSPACING
- self.opendeck = OpenStack(x, y, self)
-
- x = x + XSPACING
- self.suits = []
- for i in range(NSUITS):
- x = x + XSPACING
- self.suits.append(SuitStack(x, y, self))
-
- x = MARGIN
- y = y + YSPACING
-
- self.rows = []
- for i in range(NROWS):
- self.rows.append(RowStack(x, y, self))
- x = x + XSPACING
-
- self.openstacks = [self.opendeck] + self.suits + self.rows
-
- self.deck.fill()
- self.deal()
-
- def wincheck(self):
- for s in self.suits:
- if len(s.cards) != NVALUES:
- return
- self.win()
- self.deal()
-
- def win(self):
- """Stupid animation when you win."""
- cards = []
- for s in self.openstacks:
- cards = cards + s.cards
- while cards:
- card = random.choice(cards)
- cards.remove(card)
- self.animatedmoveto(card, self.deck)
-
- def animatedmoveto(self, card, dest):
- for i in range(10, 0, -1):
- dx, dy = (dest.x-card.x)//i, (dest.y-card.y)//i
- card.moveby(dx, dy)
- self.master.update_idletasks()
-
- def closeststack(self, card):
- closest = None
- cdist = 999999999
- # Since we only compare distances,
- # we don't bother to take the square root.
- for stack in self.openstacks:
- dist = (stack.x - card.x)**2 + (stack.y - card.y)**2
- if dist < cdist:
- closest = stack
- cdist = dist
- return closest
-
- def deal(self):
- self.reset()
- self.deck.shuffle()
- for i in range(NROWS):
- for r in self.rows[i:]:
- card = self.deck.deal()
- r.add(card)
- for r in self.rows:
- r.showtop()
-
- def reset(self):
- for stack in self.openstacks:
- while 1:
- card = stack.deal()
- if not card:
- break
- self.deck.add(card)
- card.showback()
-
-
-# Main function, run when invoked as a stand-alone Python program.
-
-def main():
- root = Tk()
- game = Solitaire(root)
- root.protocol('WM_DELETE_WINDOW', root.quit)
- root.mainloop()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/tkinter/guido/svkill.py b/Demo/tkinter/guido/svkill.py
deleted file mode 100755
index e63a32b554..0000000000
--- a/Demo/tkinter/guido/svkill.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#! /usr/bin/env python
-
-# Tkinter interface to SYSV `ps' and `kill' commands.
-
-from tkinter import *
-
-if TkVersion < 4.0:
- raise ImportError("This version of svkill requires Tk 4.0 or later")
-
-import subprocess
-import os
-
-user = os.environ['LOGNAME']
-
-class BarButton(Menubutton):
- def __init__(self, master=None, **cnf):
- Menubutton.__init__(self, master, **cnf)
- self.pack(side=LEFT)
- self.menu = Menu(self, name='menu')
- self['menu'] = self.menu
-
-class Kill(Frame):
- # List of (name, option, pid_column)
- view_list = [
- ('Default', ''),
- ('Every (-e)', '-e'),
- ('Non process group leaders (-d)', '-d'),
- ('Non leaders with tty (-a)', '-a'),
- ('For this user (-u %s)' % user, '-u %s' % user),
- ]
- format_list = [
- ('Default', '', 0),
- ('Long (-l)', '-l', 3),
- ('Full (-f)', '-f', 1),
- ('Full Long (-f -l)', '-l -f', 3),
- ('Session and group ID (-j)', '-j', 0),
- ('Scheduler properties (-c)', '-c', 0),
- ]
- def kill(self, selected):
- c = self.format_list[self.format.get()][2]
- pid = selected.split()[c]
- os.system('kill -9 ' + pid)
- self.do_update()
- def do_update(self):
- format = self.format_list[self.format.get()][1]
- view = self.view_list[self.view.get()][1]
- s = subprocess.getoutput('ps %s %s' % (view, format))
- list = s.split('\n')
- self.header.set(list[0] + ' ')
- del list[0]
- self.frame.list.delete(0, AtEnd())
- for line in list:
- self.frame.list.insert(0, line)
- def do_motion(self, e):
- e.widget.select_clear('0', 'end')
- e.widget.select_set(e.widget.nearest(e.y))
- def do_leave(self, e):
- e.widget.select_clear('0', 'end')
- def do_1(self, e):
- self.kill(e.widget.get(e.widget.nearest(e.y)))
- def __init__(self, master=None, **cnf):
- Frame.__init__(self, master, **cnf)
- self.pack(expand=1, fill=BOTH)
- self.bar = Frame(self, name='bar', relief=RAISED,
- borderwidth=2)
- self.bar.pack(fill=X)
- self.bar.file = BarButton(self.bar, text='File')
- self.bar.file.menu.add_command(
- label='Quit', command=self.quit)
- self.bar.view = BarButton(self.bar, text='View')
- self.bar.format = BarButton(self.bar, text='Format')
- self.view = IntVar(self)
- self.view.set(0)
- self.format = IntVar(self)
- self.format.set(0)
- for num in range(len(self.view_list)):
- label, option = self.view_list[num]
- self.bar.view.menu.add_radiobutton(
- label=label,
- command=self.do_update,
- variable=self.view,
- value=num)
- for num in range(len(self.format_list)):
- label, option, col = self.format_list[num]
- self.bar.format.menu.add_radiobutton(
- label=label,
- command=self.do_update,
- variable=self.format,
- value=num)
- self.bar.tk_menuBar(self.bar.file,
- self.bar.view,
- self.bar.format)
- self.frame = Frame(self, relief=RAISED, borderwidth=2)
- self.frame.pack(expand=1, fill=BOTH)
- self.header = StringVar(self)
- self.frame.label = Label(
- self.frame, relief=FLAT, anchor=NW, borderwidth=0,
- textvariable=self.header)
- self.frame.label.pack(fill=Y, anchor=W)
- self.frame.vscroll = Scrollbar(self.frame, orient=VERTICAL)
- self.frame.list = Listbox(
- self.frame,
- relief=SUNKEN,
- width=40, height=10,
- selectbackground='#eed5b7',
- selectborderwidth=0,
- selectmode=BROWSE,
- yscroll=self.frame.vscroll.set)
- self.frame.vscroll['command'] = self.frame.list.yview
- self.frame.vscroll.pack(side=RIGHT, fill=Y)
- self.frame.list.pack(expand=1, fill=BOTH)
- self.update = Button(self, text='Update',
- command=self.do_update)
- self.update.pack(fill=X)
- self.frame.list.bind('<Motion>', self.do_motion)
- self.frame.list.bind('<Leave>', self.do_leave)
- self.frame.list.bind('<1>', self.do_1)
- self.do_update()
-
-if __name__ == '__main__':
- kill = Kill(None, borderwidth=5)
- kill.winfo_toplevel().title('Tkinter Process Killer (SYSV)')
- kill.winfo_toplevel().minsize(1, 1)
- kill.mainloop()
diff --git a/Demo/tkinter/guido/switch.py b/Demo/tkinter/guido/switch.py
deleted file mode 100644
index 3f43925326..0000000000
--- a/Demo/tkinter/guido/switch.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Show how to do switchable panels.
-
-from tkinter import *
-
-class App:
-
- def __init__(self, top=None, master=None):
- if top is None:
- if master is None:
- top = Tk()
- else:
- top = Toplevel(master)
- self.top = top
- self.buttonframe = Frame(top)
- self.buttonframe.pack()
- self.panelframe = Frame(top, borderwidth=2, relief=GROOVE)
- self.panelframe.pack(expand=1, fill=BOTH)
- self.panels = {}
- self.curpanel = None
-
- def addpanel(self, name, klass):
- button = Button(self.buttonframe, text=name,
- command=lambda self=self, name=name: self.show(name))
- button.pack(side=LEFT)
- frame = Frame(self.panelframe)
- instance = klass(frame)
- self.panels[name] = (button, frame, instance)
- if self.curpanel is None:
- self.show(name)
-
- def show(self, name):
- (button, frame, instance) = self.panels[name]
- if self.curpanel:
- self.curpanel.pack_forget()
- self.curpanel = frame
- frame.pack(expand=1, fill="both")
-
-class LabelPanel:
- def __init__(self, frame):
- self.label = Label(frame, text="Hello world")
- self.label.pack()
-
-class ButtonPanel:
- def __init__(self, frame):
- self.button = Button(frame, text="Press me")
- self.button.pack()
-
-def main():
- app = App()
- app.addpanel("label", LabelPanel)
- app.addpanel("button", ButtonPanel)
- app.top.mainloop()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/tkinter/guido/tkman.py b/Demo/tkinter/guido/tkman.py
deleted file mode 100755
index 1baed88c48..0000000000
--- a/Demo/tkinter/guido/tkman.py
+++ /dev/null
@@ -1,267 +0,0 @@
-#! /usr/bin/env python
-
-# Tk man page browser -- currently only shows the Tcl/Tk man pages
-
-import os
-import re
-import sys
-from tkinter import *
-
-from manpage import ManPage
-
-MANNDIRLIST = ['/usr/local/man/mann', '/usr/share/man/mann']
-MAN3DIRLIST = ['/usr/local/man/man3', '/usr/share/man/man3']
-
-foundmanndir = 0
-for dir in MANNDIRLIST:
- if os.path.exists(dir):
- MANNDIR = dir
- foundmanndir = 1
-
-foundman3dir = 0
-for dir in MAN3DIRLIST:
- if os.path.exists(dir):
- MAN3DIR = dir
- foundman3dir = 1
-
-if not foundmanndir or not foundman3dir:
- sys.stderr.write('\n')
- if not foundmanndir:
- msg = """\
-Failed to find mann directory.
-Please add the correct entry to the MANNDIRLIST
-at the top of %s script.""" % \
-sys.argv[0]
- sys.stderr.write("%s\n\n" % msg)
- if not foundman3dir:
- msg = """\
-Failed to find man3 directory.
-Please add the correct entry to the MAN3DIRLIST
-at the top of %s script.""" % \
-sys.argv[0]
- sys.stderr.write("%s\n\n" % msg)
- sys.exit(1)
-
-del foundmanndir
-del foundman3dir
-
-def listmanpages(mandir):
- files = os.listdir(mandir)
- names = []
- for file in files:
- if file[-2:-1] == '.' and (file[-1] in 'ln123456789'):
- names.append(file[:-2])
- names.sort()
- return names
-
-class SelectionBox:
-
- def __init__(self, master=None):
- self.choices = []
-
- self.frame = Frame(master, name="frame")
- self.frame.pack(expand=1, fill=BOTH)
- self.master = self.frame.master
- self.subframe = Frame(self.frame, name="subframe")
- self.subframe.pack(expand=0, fill=BOTH)
- self.leftsubframe = Frame(self.subframe, name='leftsubframe')
- self.leftsubframe.pack(side=LEFT, expand=1, fill=BOTH)
- self.rightsubframe = Frame(self.subframe, name='rightsubframe')
- self.rightsubframe.pack(side=RIGHT, expand=1, fill=BOTH)
- self.chaptervar = StringVar(master)
- self.chapter = Menubutton(self.rightsubframe, name='chapter',
- text='Directory', relief=RAISED,
- borderwidth=2)
- self.chapter.pack(side=TOP)
- self.chaptermenu = Menu(self.chapter, name='chaptermenu')
- self.chaptermenu.add_radiobutton(label='C functions',
- value=MAN3DIR,
- variable=self.chaptervar,
- command=self.newchapter)
- self.chaptermenu.add_radiobutton(label='Tcl/Tk functions',
- value=MANNDIR,
- variable=self.chaptervar,
- command=self.newchapter)
- self.chapter['menu'] = self.chaptermenu
- self.listbox = Listbox(self.rightsubframe, name='listbox',
- relief=SUNKEN, borderwidth=2,
- width=20, height=5)
- self.listbox.pack(expand=1, fill=BOTH)
- self.l1 = Button(self.leftsubframe, name='l1',
- text='Display manual page named:',
- command=self.entry_cb)
- self.l1.pack(side=TOP)
- self.entry = Entry(self.leftsubframe, name='entry',
- relief=SUNKEN, borderwidth=2,
- width=20)
- self.entry.pack(expand=0, fill=X)
- self.l2frame = Frame(self.leftsubframe, name='l2frame')
- self.l2frame.pack(expand=0, fill=NONE)
- self.l2 = Button(self.l2frame, name='l2',
- text='Search regexp:',
- command=self.search_cb)
- self.l2.pack(side=LEFT)
- self.casevar = BooleanVar()
- self.casesense = Checkbutton(self.l2frame, name='casesense',
- text='Case sensitive',
- variable=self.casevar,
- relief=FLAT)
- self.casesense.pack(side=LEFT)
- self.search = Entry(self.leftsubframe, name='search',
- relief=SUNKEN, borderwidth=2,
- width=20)
- self.search.pack(expand=0, fill=X)
- self.title = Label(self.leftsubframe, name='title',
- text='(none)')
- self.title.pack(side=BOTTOM)
- self.text = ManPage(self.frame, name='text',
- relief=SUNKEN, borderwidth=2,
- wrap=NONE, width=72,
- selectbackground='pink')
- self.text.pack(expand=1, fill=BOTH)
-
- self.entry.bind('<Return>', self.entry_cb)
- self.search.bind('<Return>', self.search_cb)
- self.listbox.bind('<Double-1>', self.listbox_cb)
-
- self.entry.bind('<Tab>', self.entry_tab)
- self.search.bind('<Tab>', self.search_tab)
- self.text.bind('<Tab>', self.text_tab)
-
- self.entry.focus_set()
-
- self.chaptervar.set(MANNDIR)
- self.newchapter()
-
- def newchapter(self):
- mandir = self.chaptervar.get()
- self.choices = []
- self.addlist(listmanpages(mandir))
-
- def addchoice(self, choice):
- if choice not in self.choices:
- self.choices.append(choice)
- self.choices.sort()
- self.update()
-
- def addlist(self, list):
- self.choices[len(self.choices):] = list
- self.choices.sort()
- self.update()
-
- def entry_cb(self, *e):
- self.update()
-
- def listbox_cb(self, e):
- selection = self.listbox.curselection()
- if selection and len(selection) == 1:
- name = self.listbox.get(selection[0])
- self.show_page(name)
-
- def search_cb(self, *e):
- self.search_string(self.search.get())
-
- def entry_tab(self, e):
- self.search.focus_set()
-
- def search_tab(self, e):
- self.entry.focus_set()
-
- def text_tab(self, e):
- self.entry.focus_set()
-
- def updatelist(self):
- key = self.entry.get()
- ok = list(filter(lambda name, key=key, n=len(key): name[:n]==key,
- self.choices))
- if not ok:
- self.frame.bell()
- self.listbox.delete(0, AtEnd())
- exactmatch = 0
- for item in ok:
- if item == key: exactmatch = 1
- self.listbox.insert(AtEnd(), item)
- if exactmatch:
- return key
- n = self.listbox.size()
- if n == 1:
- return self.listbox.get(0)
- # Else return None, meaning not a unique selection
-
- def update(self):
- name = self.updatelist()
- if name:
- self.show_page(name)
- self.entry.delete(0, AtEnd())
- self.updatelist()
-
- def show_page(self, name):
- file = '%s/%s.?' % (self.chaptervar.get(), name)
- fp = os.popen('nroff -man -c %s | ul -i' % file, 'r')
- self.text.kill()
- self.title['text'] = name
- self.text.parsefile(fp)
-
- def search_string(self, search):
- if not search:
- self.frame.bell()
- print('Empty search string')
- return
- if not self.casevar.get():
- map = re.IGNORECASE
- else:
- map = None
- try:
- if map:
- prog = re.compile(search, map)
- else:
- prog = re.compile(search)
- except re.error as msg:
- self.frame.bell()
- print('Regex error:', msg)
- return
- here = self.text.index(AtInsert())
- lineno = int(here[:here.find('.')])
- end = self.text.index(AtEnd())
- endlineno = int(end[:end.find('.')])
- wraplineno = lineno
- found = 0
- while 1:
- lineno = lineno + 1
- if lineno > endlineno:
- if wraplineno <= 0:
- break
- endlineno = wraplineno
- lineno = 0
- wraplineno = 0
- line = self.text.get('%d.0 linestart' % lineno,
- '%d.0 lineend' % lineno)
- i = prog.search(line)
- if i:
- found = 1
- n = max(1, len(i.group(0)))
- try:
- self.text.tag_remove('sel',
- AtSelFirst(),
- AtSelLast())
- except TclError:
- pass
- self.text.tag_add('sel',
- '%d.%d' % (lineno, i.start()),
- '%d.%d' % (lineno, i.start()+n))
- self.text.mark_set(AtInsert(),
- '%d.%d' % (lineno, i.start()))
- self.text.yview_pickplace(AtInsert())
- break
- if not found:
- self.frame.bell()
-
-def main():
- root = Tk()
- sb = SelectionBox(root)
- if sys.argv[1:]:
- sb.show_page(sys.argv[1])
- root.minsize(1, 1)
- root.mainloop()
-
-main()
diff --git a/Demo/tkinter/guido/wish.py b/Demo/tkinter/guido/wish.py
deleted file mode 100755
index 332501d82c..0000000000
--- a/Demo/tkinter/guido/wish.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# This is about all it requires to write a wish shell in Python!
-
-import _tkinter
-import os
-import sys
-
-tk = _tkinter.create(os.environ['DISPLAY'], 'wish', 'Tk', 1, 1)
-tk.call('update')
-
-cmd = ''
-
-while True:
- if cmd:
- prompt = ''
- else:
- prompt = '% '
- try:
- sys.stdout.write(prompt)
- sys.stdout.flush()
- line = sys.stdin.readline()
- if not line:
- break
- except EOFError:
- break
- cmd += line
- if tk.getboolean(tk.call('info', 'complete', cmd)):
- tk.record(line)
- try:
- result = tk.call('eval', cmd)
- except _tkinter.TclError as msg:
- print('TclError:', msg)
- else:
- if result: print(result)
- cmd = ''
diff --git a/Demo/tkinter/matt/00-HELLO-WORLD.py b/Demo/tkinter/matt/00-HELLO-WORLD.py
deleted file mode 100644
index 3b4092a641..0000000000
--- a/Demo/tkinter/matt/00-HELLO-WORLD.py
+++ /dev/null
@@ -1,27 +0,0 @@
-from tkinter import *
-
-# note that there is no explicit call to start Tk.
-# Tkinter is smart enough to start the system if it's not already going.
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
-
- self.QUIT.pack(side=LEFT, fill=BOTH)
-
- # a hello button
- self.hi_there = Button(self, text='Hello',
- command=self.printit)
- self.hi_there.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/README b/Demo/tkinter/matt/README
deleted file mode 100644
index eb9d30246d..0000000000
--- a/Demo/tkinter/matt/README
+++ /dev/null
@@ -1,30 +0,0 @@
-This directory contains some ad-hoc examples of Tkinter widget
-creation. The files named
-
- *-simple.py
-
-are the ones to start with if you're looking for a bare-bones usage of
-a widget. The other files are meant to show common usage patters that
-are a tad more involved.
-
-If you have a suggestion for an example program, please send mail to
-
- conway@virginia.edu
-
-and I'll include it.
-
-
-matt
-
-TODO
--------
-The X selection
-Dialog Boxes
-More canvas examples
-Message widgets
-Text Editors
-Scrollbars
-Listboxes
-
-
-
diff --git a/Demo/tkinter/matt/animation-simple.py b/Demo/tkinter/matt/animation-simple.py
deleted file mode 100644
index 4120d66d48..0000000000
--- a/Demo/tkinter/matt/animation-simple.py
+++ /dev/null
@@ -1,35 +0,0 @@
-from tkinter import *
-
-# This program shows how to use the "after" function to make animation.
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=LEFT, fill=BOTH)
-
- self.draw = Canvas(self, width="5i", height="5i")
-
- # all of these work..
- self.draw.create_rectangle(0, 0, 10, 10, tags="thing", fill="blue")
- self.draw.pack(side=LEFT)
-
- def moveThing(self, *args):
- # move 1/10 of an inch every 1/10 sec (1" per second, smoothly)
- self.draw.move("thing", "0.01i", "0.01i")
- self.after(10, self.moveThing)
-
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
- self.after(10, self.moveThing)
-
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/animation-w-velocity-ctrl.py b/Demo/tkinter/matt/animation-w-velocity-ctrl.py
deleted file mode 100644
index 88309cae2c..0000000000
--- a/Demo/tkinter/matt/animation-w-velocity-ctrl.py
+++ /dev/null
@@ -1,44 +0,0 @@
-from tkinter import *
-
-# this is the same as simple-demo-1.py, but uses
-# subclassing.
-# note that there is no explicit call to start Tk.
-# Tkinter is smart enough to start the system if it's not already going.
-
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
-
- self.draw = Canvas(self, width="5i", height="5i")
-
- self.speed = Scale(self, orient=HORIZONTAL, from_=-100, to=100)
-
- self.speed.pack(side=BOTTOM, fill=X)
-
- # all of these work..
- self.draw.create_rectangle(0, 0, 10, 10, tags="thing", fill="blue")
- self.draw.pack(side=LEFT)
-
- def moveThing(self, *args):
- velocity = self.speed.get()
- str = float(velocity) / 1000.0
- str = "%ri" % (str,)
- self.draw.move("thing", str, str)
- self.after(10, self.moveThing)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
- self.after(10, self.moveThing)
-
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/bind-w-mult-calls-p-type.py b/Demo/tkinter/matt/bind-w-mult-calls-p-type.py
deleted file mode 100644
index 0da7c3786e..0000000000
--- a/Demo/tkinter/matt/bind-w-mult-calls-p-type.py
+++ /dev/null
@@ -1,43 +0,0 @@
-from tkinter import *
-
-# This program shows how to use a simple type-in box
-
-class App(Frame):
- def __init__(self, master=None):
- Frame.__init__(self, master)
- self.pack()
-
- self.entrythingy = Entry()
- self.entrythingy.pack()
-
- # and here we get a callback when the user hits return. we could
- # make the key that triggers the callback anything we wanted to.
- # other typical options might be <Key-Tab> or <Key> (for anything)
- self.entrythingy.bind('<Key-Return>', self.print_contents)
-
- # Note that here is where we bind a completely different callback to
- # the same event. We pass "+" here to indicate that we wish to ADD
- # this callback to the list associated with this event type.
- # Not specifying "+" would simply override whatever callback was
- # defined on this event.
- self.entrythingy.bind('<Key-Return>', self.print_something_else, "+")
-
- def print_contents(self, event):
- print("hi. contents of entry is now ---->", self.entrythingy.get())
-
-
- def print_something_else(self, event):
- print("hi. Now doing something completely different")
-
-
-root = App()
-root.master.title("Foo")
-root.mainloop()
-
-
-
-# secret tip for experts: if you pass *any* non-false value as
-# the third parameter to bind(), Tkinter.py will accumulate
-# callbacks instead of overwriting. I use "+" here because that's
-# the Tk notation for getting this sort of behavior. The perfect GUI
-# interface would use a less obscure notation.
diff --git a/Demo/tkinter/matt/canvas-demo-simple.py b/Demo/tkinter/matt/canvas-demo-simple.py
deleted file mode 100644
index 7f2c17bba3..0000000000
--- a/Demo/tkinter/matt/canvas-demo-simple.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from tkinter import *
-
-# this program creates a canvas and puts a single polygon on the canvas
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
-
- self.draw = Canvas(self, width="5i", height="5i")
-
- # see the other demos for other ways of specifying coords for a polygon
- self.draw.create_rectangle(0, 0, "3i", "3i", fill="black")
-
- self.draw.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/canvas-gridding.py b/Demo/tkinter/matt/canvas-gridding.py
deleted file mode 100644
index 2f9d23afce..0000000000
--- a/Demo/tkinter/matt/canvas-gridding.py
+++ /dev/null
@@ -1,61 +0,0 @@
-from tkinter import *
-
-# this is the same as simple-demo-1.py, but uses
-# subclassing.
-# note that there is no explicit call to start Tk.
-# Tkinter is smart enough to start the system if it's not already going.
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT',
- background='red',
- foreground='white',
- height=3,
- command=self.quit)
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
-
- self.canvasObject = Canvas(self, width="5i", height="5i")
- self.canvasObject.pack(side=LEFT)
-
- def mouseDown(self, event):
- # canvas x and y take the screen coords from the event and translate
- # them into the coordinate system of the canvas object
- self.startx = self.canvasObject.canvasx(event.x, self.griddingSize)
- self.starty = self.canvasObject.canvasy(event.y, self.griddingSize)
-
- def mouseMotion(self, event):
- # canvas x and y take the screen coords from the event and translate
- # them into the coordinate system of the canvas object
- x = self.canvasObject.canvasx(event.x, self.griddingSize)
- y = self.canvasObject.canvasy(event.y, self.griddingSize)
-
- if (self.startx != event.x) and (self.starty != event.y) :
- self.canvasObject.delete(self.rubberbandBox)
- self.rubberbandBox = self.canvasObject.create_rectangle(
- self.startx, self.starty, x, y)
- # this flushes the output, making sure that
- # the rectangle makes it to the screen
- # before the next event is handled
- self.update_idletasks()
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
- # this is a "tagOrId" for the rectangle we draw on the canvas
- self.rubberbandBox = None
-
- # this is the size of the gridding squares
- self.griddingSize = 50
-
- Widget.bind(self.canvasObject, "<Button-1>", self.mouseDown)
- Widget.bind(self.canvasObject, "<Button1-Motion>", self.mouseMotion)
-
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/canvas-moving-or-creating.py b/Demo/tkinter/matt/canvas-moving-or-creating.py
deleted file mode 100644
index edd64f7945..0000000000
--- a/Demo/tkinter/matt/canvas-moving-or-creating.py
+++ /dev/null
@@ -1,62 +0,0 @@
-from tkinter import *
-
-# this file demonstrates a more sophisticated movement --
-# move dots or create new ones if you click outside the dots
-
-class Test(Frame):
- ###################################################################
- ###### Event callbacks for THE CANVAS (not the stuff drawn on it)
- ###################################################################
- def mouseDown(self, event):
- # see if we're inside a dot. If we are, it
- # gets tagged as CURRENT for free by tk.
- if not event.widget.find_withtag(CURRENT):
- # there is no dot here, so we can make one,
- # and bind some interesting behavior to it.
- # ------
- # create a dot, and mark it as CURRENT
- fred = self.draw.create_oval(
- event.x - 10, event.y -10, event.x +10, event.y + 10,
- fill="green", tags=CURRENT)
-
- self.draw.tag_bind(fred, "<Any-Enter>", self.mouseEnter)
- self.draw.tag_bind(fred, "<Any-Leave>", self.mouseLeave)
-
- self.lastx = event.x
- self.lasty = event.y
-
- def mouseMove(self, event):
- self.draw.move(CURRENT, event.x - self.lastx, event.y - self.lasty)
- self.lastx = event.x
- self.lasty = event.y
-
- ###################################################################
- ###### Event callbacks for canvas ITEMS (stuff drawn on the canvas)
- ###################################################################
- def mouseEnter(self, event):
- # the CURRENT tag is applied to the object the cursor is over.
- # this happens automatically.
- self.draw.itemconfig(CURRENT, fill="red")
-
- def mouseLeave(self, event):
- # the CURRENT tag is applied to the object the cursor is over.
- # this happens automatically.
- self.draw.itemconfig(CURRENT, fill="blue")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=LEFT, fill=BOTH)
- self.draw = Canvas(self, width="5i", height="5i")
- self.draw.pack(side=LEFT)
-
- Widget.bind(self.draw, "<1>", self.mouseDown)
- Widget.bind(self.draw, "<B1-Motion>", self.mouseMove)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/canvas-moving-w-mouse.py b/Demo/tkinter/matt/canvas-moving-w-mouse.py
deleted file mode 100644
index 21d724f68a..0000000000
--- a/Demo/tkinter/matt/canvas-moving-w-mouse.py
+++ /dev/null
@@ -1,55 +0,0 @@
-from tkinter import *
-
-# this file demonstrates the movement of a single canvas item under mouse control
-
-class Test(Frame):
- ###################################################################
- ###### Event callbacks for THE CANVAS (not the stuff drawn on it)
- ###################################################################
- def mouseDown(self, event):
- # remember where the mouse went down
- self.lastx = event.x
- self.lasty = event.y
-
- def mouseMove(self, event):
- # whatever the mouse is over gets tagged as CURRENT for free by tk.
- self.draw.move(CURRENT, event.x - self.lastx, event.y - self.lasty)
- self.lastx = event.x
- self.lasty = event.y
-
- ###################################################################
- ###### Event callbacks for canvas ITEMS (stuff drawn on the canvas)
- ###################################################################
- def mouseEnter(self, event):
- # the CURRENT tag is applied to the object the cursor is over.
- # this happens automatically.
- self.draw.itemconfig(CURRENT, fill="red")
-
- def mouseLeave(self, event):
- # the CURRENT tag is applied to the object the cursor is over.
- # this happens automatically.
- self.draw.itemconfig(CURRENT, fill="blue")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=LEFT, fill=BOTH)
- self.draw = Canvas(self, width="5i", height="5i")
- self.draw.pack(side=LEFT)
-
- fred = self.draw.create_oval(0, 0, 20, 20,
- fill="green", tags="selected")
-
- self.draw.tag_bind(fred, "<Any-Enter>", self.mouseEnter)
- self.draw.tag_bind(fred, "<Any-Leave>", self.mouseLeave)
-
- Widget.bind(self.draw, "<1>", self.mouseDown)
- Widget.bind(self.draw, "<B1-Motion>", self.mouseMove)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/canvas-mult-item-sel.py b/Demo/tkinter/matt/canvas-mult-item-sel.py
deleted file mode 100644
index 4875b4491a..0000000000
--- a/Demo/tkinter/matt/canvas-mult-item-sel.py
+++ /dev/null
@@ -1,78 +0,0 @@
-from tkinter import *
-
-# allows moving dots with multiple selection.
-
-SELECTED_COLOR = "red"
-UNSELECTED_COLOR = "blue"
-
-class Test(Frame):
- ###################################################################
- ###### Event callbacks for THE CANVAS (not the stuff drawn on it)
- ###################################################################
- def mouseDown(self, event):
- # see if we're inside a dot. If we are, it
- # gets tagged as CURRENT for free by tk.
-
- if not event.widget.find_withtag(CURRENT):
- # we clicked outside of all dots on the canvas. unselect all.
-
- # re-color everything back to an unselected color
- self.draw.itemconfig("selected", fill=UNSELECTED_COLOR)
- # unselect everything
- self.draw.dtag("selected")
- else:
- # mark as "selected" the thing the cursor is under
- self.draw.addtag("selected", "withtag", CURRENT)
- # color it as selected
- self.draw.itemconfig("selected", fill=SELECTED_COLOR)
-
- self.lastx = event.x
- self.lasty = event.y
-
-
- def mouseMove(self, event):
- self.draw.move("selected", event.x - self.lastx, event.y - self.lasty)
- self.lastx = event.x
- self.lasty = event.y
-
- def makeNewDot(self):
- # create a dot, and mark it as current
- fred = self.draw.create_oval(0, 0, 20, 20,
- fill=SELECTED_COLOR, tags=CURRENT)
- # and make it selected
- self.draw.addtag("selected", "withtag", CURRENT)
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
-
- ################
- # make the canvas and bind some behavior to it
- ################
- self.draw = Canvas(self, width="5i", height="5i")
- Widget.bind(self.draw, "<1>", self.mouseDown)
- Widget.bind(self.draw, "<B1-Motion>", self.mouseMove)
-
- # and other things.....
- self.button = Button(self, text="make a new dot", foreground="blue",
- command=self.makeNewDot)
-
- message = ("%s dots are selected and can be dragged.\n"
- "%s are not selected.\n"
- "Click in a dot to select it.\n"
- "Click on empty space to deselect all dots."
- ) % (SELECTED_COLOR, UNSELECTED_COLOR)
- self.label = Message(self, width="5i", text=message)
-
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
- self.label.pack(side=BOTTOM, fill=X, expand=1)
- self.button.pack(side=BOTTOM, fill=X)
- self.draw.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/canvas-reading-tag-info.py b/Demo/tkinter/matt/canvas-reading-tag-info.py
deleted file mode 100644
index 265f0a181d..0000000000
--- a/Demo/tkinter/matt/canvas-reading-tag-info.py
+++ /dev/null
@@ -1,49 +0,0 @@
-from tkinter import *
-
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
-
- self.drawing = Canvas(self, width="5i", height="5i")
-
- # make a shape
- pgon = self.drawing.create_polygon(
- 10, 10, 110, 10, 110, 110, 10 , 110,
- fill="red", tags=("weee", "foo", "groo"))
-
- # this is how you query an object for its attributes
- # config options FOR CANVAS ITEMS always come back in tuples of length 5.
- # 0 attribute name
- # 1 BLANK
- # 2 BLANK
- # 3 default value
- # 4 current value
- # the blank spots are for consistency with the config command that
- # is used for widgets. (remember, this is for ITEMS drawn
- # on a canvas widget, not widgets)
- option_value = self.drawing.itemconfig(pgon, "stipple")
- print("pgon's current stipple value is -->", option_value[4], "<--")
- option_value = self.drawing.itemconfig(pgon, "fill")
- print("pgon's current fill value is -->", option_value[4], "<--")
- print(" when he is usually colored -->", option_value[3], "<--")
-
- ## here we print out all the tags associated with this object
- option_value = self.drawing.itemconfig(pgon, "tags")
- print("pgon's tags are", option_value[4])
-
- self.drawing.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/canvas-w-widget-draw-el.py b/Demo/tkinter/matt/canvas-w-widget-draw-el.py
deleted file mode 100644
index ca96583d64..0000000000
--- a/Demo/tkinter/matt/canvas-w-widget-draw-el.py
+++ /dev/null
@@ -1,36 +0,0 @@
-from tkinter import *
-
-# this file demonstrates the creation of widgets as part of a canvas object
-
-class Test(Frame):
- def printhi(self):
- print("hi")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
-
- self.draw = Canvas(self, width="5i", height="5i")
-
- self.button = Button(self, text="this is a button",
- command=self.printhi)
-
- # note here the coords are given in pixels (form the
- # upper right and corner of the window, as usual for X)
- # but might just have well been given in inches or points or
- # whatever...use the "anchor" option to control what point of the
- # widget (in this case the button) gets mapped to the given x, y.
- # you can specify corners, edges, center, etc...
- self.draw.create_window(300, 300, window=self.button)
-
- self.draw.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/canvas-with-scrollbars.py b/Demo/tkinter/matt/canvas-with-scrollbars.py
deleted file mode 100644
index 1c5681a644..0000000000
--- a/Demo/tkinter/matt/canvas-with-scrollbars.py
+++ /dev/null
@@ -1,60 +0,0 @@
-from tkinter import *
-
-# This example program creates a scroling canvas, and demonstrates
-# how to tie scrollbars and canvses together. The mechanism
-# is analogus for listboxes and other widgets with
-# "xscroll" and "yscroll" configuration options.
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
- self.question = Label(self, text="Can Find The BLUE Square??????")
- self.question.pack()
-
- self.QUIT = Button(self, text='QUIT', background='red',
- height=3, command=self.quit)
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
- spacer = Frame(self, height="0.25i")
- spacer.pack(side=BOTTOM)
-
- # notice that the scroll region (20" x 20") is larger than
- # displayed size of the widget (5" x 5")
- self.draw = Canvas(self, width="5i", height="5i",
- background="white",
- scrollregion=(0, 0, "20i", "20i"))
-
- self.draw.scrollX = Scrollbar(self, orient=HORIZONTAL)
- self.draw.scrollY = Scrollbar(self, orient=VERTICAL)
-
- # now tie the three together. This is standard boilerplate text
- self.draw['xscrollcommand'] = self.draw.scrollX.set
- self.draw['yscrollcommand'] = self.draw.scrollY.set
- self.draw.scrollX['command'] = self.draw.xview
- self.draw.scrollY['command'] = self.draw.yview
-
- # draw something. Note that the first square
- # is visible, but you need to scroll to see the second one.
- self.draw.create_rectangle(0, 0, "3.5i", "3.5i", fill="black")
- self.draw.create_rectangle("10i", "10i", "13.5i", "13.5i", fill="blue")
-
- # pack 'em up
- self.draw.scrollX.pack(side=BOTTOM, fill=X)
- self.draw.scrollY.pack(side=RIGHT, fill=Y)
- self.draw.pack(side=LEFT)
-
-
- def scrollCanvasX(self, *args):
- print("scrolling", args)
- print(self.draw.scrollX.get())
-
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/dialog-box.py b/Demo/tkinter/matt/dialog-box.py
deleted file mode 100644
index c0b8825fa8..0000000000
--- a/Demo/tkinter/matt/dialog-box.py
+++ /dev/null
@@ -1,64 +0,0 @@
-from tkinter import *
-from tkinter.dialog import Dialog
-
-# this shows how to create a new window with a button in it
-# that can create new windows
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def makeWindow(self):
- """Create a top-level dialog with some buttons.
-
- This uses the Dialog class, which is a wrapper around the Tcl/Tk
- tk_dialog script. The function returns 0 if the user clicks 'yes'
- or 1 if the user clicks 'no'.
- """
- # the parameters to this call are as follows:
- d = Dialog(
- self, ## name of a toplevel window
- title="fred the dialog box",## title on the window
- text="click on a choice", ## message to appear in window
- bitmap="info", ## bitmap (if any) to appear;
- ## if none, use ""
- # legal values here are:
- # string what it looks like
- # ----------------------------------------------
- # error a circle with a slash through it
- # grey25 grey square
- # grey50 darker grey square
- # hourglass use for "wait.."
- # info a large, lower case "i"
- # questhead a human head with a "?" in it
- # question a large "?"
- # warning a large "!"
- # @fname X bitmap where fname is the path to the file
- #
- default=0, # the index of the default button choice.
- # hitting return selects this
- strings=("yes", "no"))
- # values of the 'strings' key are the labels for the
- # buttons that appear left to right in the dialog box
- return d.num
-
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=LEFT, fill=BOTH)
-
- # a hello button
- self.hi_there = Button(self, text='Make a New Window',
- command=self.makeWindow)
- self.hi_there.pack(side=LEFT)
-
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.windownum = 0
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/entry-simple.py b/Demo/tkinter/matt/entry-simple.py
deleted file mode 100644
index 1f55df51db..0000000000
--- a/Demo/tkinter/matt/entry-simple.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from tkinter import *
-import string
-
-# This program shows how to use a simple type-in box
-
-class App(Frame):
- def __init__(self, master=None):
- Frame.__init__(self, master)
- self.pack()
-
- self.entrythingy = Entry()
- self.entrythingy.pack()
-
- # and here we get a callback when the user hits return. we could
- # make the key that triggers the callback anything we wanted to.
- # other typical options might be <Key-Tab> or <Key> (for anything)
- self.entrythingy.bind('<Key-Return>', self.print_contents)
-
- def print_contents(self, event):
- print("hi. contents of entry is now ---->", self.entrythingy.get())
-
-root = App()
-root.master.title("Foo")
-root.mainloop()
diff --git a/Demo/tkinter/matt/entry-with-shared-variable.py b/Demo/tkinter/matt/entry-with-shared-variable.py
deleted file mode 100644
index 7d93da764e..0000000000
--- a/Demo/tkinter/matt/entry-with-shared-variable.py
+++ /dev/null
@@ -1,45 +0,0 @@
-from tkinter import *
-
-# This program shows how to make a typein box shadow a program variable.
-
-class App(Frame):
- def __init__(self, master=None):
- Frame.__init__(self, master)
- self.pack()
-
- self.entrythingy = Entry(self)
- self.entrythingy.pack()
-
- self.button = Button(self, text="Uppercase The Entry",
- command=self.upper)
- self.button.pack()
-
- # here we have the text in the entry widget tied to a variable.
- # changes in the variable are echoed in the widget and vice versa.
- # Very handy.
- # there are other Variable types. See Tkinter.py for all
- # the other variable types that can be shadowed
- self.contents = StringVar()
- self.contents.set("this is a variable")
- self.entrythingy.config(textvariable=self.contents)
-
- # and here we get a callback when the user hits return. we could
- # make the key that triggers the callback anything we wanted to.
- # other typical options might be <Key-Tab> or <Key> (for anything)
- self.entrythingy.bind('<Key-Return>', self.print_contents)
-
- def upper(self):
- # notice here, we don't actually refer to the entry box.
- # we just operate on the string variable and we
- # because it's being looked at by the entry widget, changing
- # the variable changes the entry widget display automatically.
- # the strange get/set operators are clunky, true...
- str = self.contents.get().upper()
- self.contents.set(str)
-
- def print_contents(self, event):
- print("hi. contents of entry is now ---->", self.contents.get())
-
-root = App()
-root.master.title("Foo")
-root.mainloop()
diff --git a/Demo/tkinter/matt/killing-window-w-wm.py b/Demo/tkinter/matt/killing-window-w-wm.py
deleted file mode 100644
index b4034d1944..0000000000
--- a/Demo/tkinter/matt/killing-window-w-wm.py
+++ /dev/null
@@ -1,42 +0,0 @@
-from tkinter import *
-
-# This file shows how to trap the killing of a window
-# when the user uses window manager menus (typ. upper left hand corner
-# menu in the decoration border).
-
-
-### ******* this isn't really called -- read the comments
-def my_delete_callback():
- print("whoops -- tried to delete me!")
-
-class Test(Frame):
- def deathHandler(self, event):
- print(self, "is now getting nuked. performing some save here....")
-
- def createWidgets(self):
- # a hello button
- self.hi_there = Button(self, text='Hello')
- self.hi_there.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
- ###
- ### PREVENT WM kills from happening
- ###
-
- # the docs would have you do this:
-
-# self.master.protocol("WM_DELETE_WINDOW", my_delete_callback)
-
- # unfortunately, some window managers will not send this request to a window.
- # the "protocol" function seems incapable of trapping these "aggressive" window kills.
- # this line of code catches everything, tho. The window is deleted, but you have a chance
- # of cleaning up first.
- self.bind_all("<Destroy>", self.deathHandler)
-
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/menu-all-types-of-entries.py b/Demo/tkinter/matt/menu-all-types-of-entries.py
deleted file mode 100644
index 84f162eed8..0000000000
--- a/Demo/tkinter/matt/menu-all-types-of-entries.py
+++ /dev/null
@@ -1,244 +0,0 @@
-from tkinter import *
-
-# some vocabulary to keep from getting confused. This terminology
-# is something I cooked up for this file, but follows the man pages
-# pretty closely
-#
-#
-#
-# This is a MENUBUTTON
-# V
-# +-------------+
-# | |
-#
-# +------------++------------++------------+
-# | || || |
-# | File || Edit || Options | <-------- the MENUBAR
-# | || || |
-# +------------++------------++------------+
-# | New... |
-# | Open... |
-# | Print |
-# | | <-------- This is a MENU. The lines of text in the menu are
-# | | MENU ENTRIES
-# | +---------------+
-# | Open Files > | file1 |
-# | | file2 |
-# | | another file | <------ this cascading part is also a MENU
-# +----------------| |
-# | |
-# | |
-# | |
-# +---------------+
-
-
-
-# some miscellaneous callbacks
-def new_file():
- print("opening new file")
-
-def open_file():
- print("opening OLD file")
-
-def print_something():
- print("picked a menu item")
-
-
-
-anchovies = 0
-
-def print_anchovies():
- global anchovies
- anchovies = not anchovies
- print("anchovies?", anchovies)
-
-def makeCommandMenu():
- # make menu button
- Command_button = Menubutton(mBar, text='Simple Button Commands',
- underline=0)
- Command_button.pack(side=LEFT, padx="2m")
-
- # make the pulldown part of the File menu. The parameter passed is the master.
- # we attach it to the button as a python attribute called "menu" by convention.
- # hopefully this isn't too confusing...
- Command_button.menu = Menu(Command_button)
-
- # just to be cute, let's disable the undo option:
- Command_button.menu.add_command(label="Undo")
- # undo is the 0th entry...
- Command_button.menu.entryconfig(0, state=DISABLED)
-
- Command_button.menu.add_command(label='New...', underline=0,
- command=new_file)
- Command_button.menu.add_command(label='Open...', underline=0,
- command=open_file)
- Command_button.menu.add_command(label='Different Font', underline=0,
- font='-*-helvetica-*-r-*-*-*-180-*-*-*-*-*-*',
- command=print_something)
-
- # we can make bitmaps be menu entries too. File format is X11 bitmap.
- # if you use XV, save it under X11 bitmap format. duh-uh.,..
- Command_button.menu.add_command(
- bitmap="info")
- #bitmap='@/home/mjc4y/dilbert/project.status.is.doomed.last.panel.bm')
-
- # this is just a line
- Command_button.menu.add('separator')
-
- # change the color
- Command_button.menu.add_command(label='Quit', underline=0,
- background='red',
- activebackground='green',
- command=Command_button.quit)
-
- # set up a pointer from the file menubutton back to the file menu
- Command_button['menu'] = Command_button.menu
-
- return Command_button
-
-
-
-def makeCascadeMenu():
- # make menu button
- Cascade_button = Menubutton(mBar, text='Cascading Menus', underline=0)
- Cascade_button.pack(side=LEFT, padx="2m")
-
- # the primary pulldown
- Cascade_button.menu = Menu(Cascade_button)
-
- # this is the menu that cascades from the primary pulldown....
- Cascade_button.menu.choices = Menu(Cascade_button.menu)
-
- # ...and this is a menu that cascades from that.
- Cascade_button.menu.choices.weirdones = Menu(Cascade_button.menu.choices)
-
- # then you define the menus from the deepest level on up.
- Cascade_button.menu.choices.weirdones.add_command(label='avacado')
- Cascade_button.menu.choices.weirdones.add_command(label='belgian endive')
- Cascade_button.menu.choices.weirdones.add_command(label='beefaroni')
-
- # definition of the menu one level up...
- Cascade_button.menu.choices.add_command(label='Chocolate')
- Cascade_button.menu.choices.add_command(label='Vanilla')
- Cascade_button.menu.choices.add_command(label='TuttiFruiti')
- Cascade_button.menu.choices.add_command(label='WopBopaLoopBapABopBamBoom')
- Cascade_button.menu.choices.add_command(label='Rocky Road')
- Cascade_button.menu.choices.add_command(label='BubbleGum')
- Cascade_button.menu.choices.add_cascade(
- label='Weird Flavors',
- menu=Cascade_button.menu.choices.weirdones)
-
- # and finally, the definition for the top level
- Cascade_button.menu.add_cascade(label='more choices',
- menu=Cascade_button.menu.choices)
-
- Cascade_button['menu'] = Cascade_button.menu
-
- return Cascade_button
-
-def makeCheckbuttonMenu():
- global fred
- # make menu button
- Checkbutton_button = Menubutton(mBar, text='Checkbutton Menus',
- underline=0)
- Checkbutton_button.pack(side=LEFT, padx='2m')
-
- # the primary pulldown
- Checkbutton_button.menu = Menu(Checkbutton_button)
-
- # and all the check buttons. Note that the "variable" "onvalue" and "offvalue" options
- # are not supported correctly at present. You have to do all your application
- # work through the calback.
- Checkbutton_button.menu.add_checkbutton(label='Pepperoni')
- Checkbutton_button.menu.add_checkbutton(label='Sausage')
- Checkbutton_button.menu.add_checkbutton(label='Extra Cheese')
-
- # so here's a callback
- Checkbutton_button.menu.add_checkbutton(label='Anchovy',
- command=print_anchovies)
-
- # and start with anchovies selected to be on. Do this by
- # calling invoke on this menu option. To refer to the "anchovy" menu
- # entry we need to know it's index. To do this, we use the index method
- # which takes arguments of several forms:
- #
- # argument what it does
- # -----------------------------------
- # a number -- this is useless.
- # "last" -- last option in the menu
- # "none" -- used with the activate command. see the man page on menus
- # "active" -- the currently active menu option. A menu option is made active
- # with the 'activate' method
- # "@number" -- where 'number' is an integer and is treated like a y coordinate in pixels
- # string pattern -- this is the option used below, and attempts to match "labels" using the
- # rules of Tcl_StringMatch
- Checkbutton_button.menu.invoke(Checkbutton_button.menu.index('Anchovy'))
-
- # set up a pointer from the file menubutton back to the file menu
- Checkbutton_button['menu'] = Checkbutton_button.menu
-
- return Checkbutton_button
-
-
-def makeRadiobuttonMenu():
- # make menu button
- Radiobutton_button = Menubutton(mBar, text='Radiobutton Menus',
- underline=0)
- Radiobutton_button.pack(side=LEFT, padx='2m')
-
- # the primary pulldown
- Radiobutton_button.menu = Menu(Radiobutton_button)
-
- # and all the Radio buttons. Note that the "variable" "onvalue" and "offvalue" options
- # are not supported correctly at present. You have to do all your application
- # work through the calback.
- Radiobutton_button.menu.add_radiobutton(label='Republican')
- Radiobutton_button.menu.add_radiobutton(label='Democrat')
- Radiobutton_button.menu.add_radiobutton(label='Libertarian')
- Radiobutton_button.menu.add_radiobutton(label='Commie')
- Radiobutton_button.menu.add_radiobutton(label='Facist')
- Radiobutton_button.menu.add_radiobutton(label='Labor Party')
- Radiobutton_button.menu.add_radiobutton(label='Torie')
- Radiobutton_button.menu.add_radiobutton(label='Independent')
- Radiobutton_button.menu.add_radiobutton(label='Anarchist')
- Radiobutton_button.menu.add_radiobutton(label='No Opinion')
-
- # set up a pointer from the file menubutton back to the file menu
- Radiobutton_button['menu'] = Radiobutton_button.menu
-
- return Radiobutton_button
-
-
-def makeDisabledMenu():
- Dummy_button = Menubutton(mBar, text='Dead Menu', underline=0)
- Dummy_button.pack(side=LEFT, padx='2m')
-
- # this is the standard way of turning off a whole menu
- Dummy_button["state"] = DISABLED
- return Dummy_button
-
-
-#################################################
-#### Main starts here ...
-root = Tk()
-
-
-# make a menu bar
-mBar = Frame(root, relief=RAISED, borderwidth=2)
-mBar.pack(fill=X)
-
-Command_button = makeCommandMenu()
-Cascade_button = makeCascadeMenu()
-Checkbutton_button = makeCheckbuttonMenu()
-Radiobutton_button = makeRadiobuttonMenu()
-NoMenu = makeDisabledMenu()
-
-# finally, install the buttons in the menu bar.
-# This allows for scanning from one menubutton to the next.
-mBar.tk_menuBar(Command_button, Cascade_button, Checkbutton_button, Radiobutton_button, NoMenu)
-
-
-root.title('menu demo')
-root.iconname('menu demo')
-
-root.mainloop()
diff --git a/Demo/tkinter/matt/menu-simple.py b/Demo/tkinter/matt/menu-simple.py
deleted file mode 100644
index 5d3303fbc9..0000000000
--- a/Demo/tkinter/matt/menu-simple.py
+++ /dev/null
@@ -1,112 +0,0 @@
-from tkinter import *
-
-# some vocabulary to keep from getting confused. This terminology
-# is something I cooked up for this file, but follows the man pages
-# pretty closely
-#
-#
-#
-# This is a MENUBUTTON
-# V
-# +-------------+
-# | |
-#
-# +------------++------------++------------+
-# | || || |
-# | File || Edit || Options | <-------- the MENUBAR
-# | || || |
-# +------------++------------++------------+
-# | New... |
-# | Open... |
-# | Print |
-# | | <------ This is a MENU. The lines of text in the menu are
-# | | MENU ENTRIES
-# | +---------------+
-# | Open Files > | file1 |
-# | | file2 |
-# | | another file | <------ this cascading part is also a MENU
-# +----------------| |
-# | |
-# | |
-# | |
-# +---------------+
-
-
-
-def new_file():
- print("opening new file")
-
-
-def open_file():
- print("opening OLD file")
-
-
-def makeFileMenu():
- # make menu button : "File"
- File_button = Menubutton(mBar, text='File', underline=0)
- File_button.pack(side=LEFT, padx="1m")
- File_button.menu = Menu(File_button)
-
- # add an item. The first param is a menu entry type,
- # must be one of: "cascade", "checkbutton", "command", "radiobutton", "separator"
- # see menu-demo-2.py for examples of use
- File_button.menu.add_command(label='New...', underline=0,
- command=new_file)
-
-
- File_button.menu.add_command(label='Open...', underline=0,
- command=open_file)
-
- File_button.menu.add_command(label='Quit', underline=0,
- command='exit')
-
- # set up a pointer from the file menubutton back to the file menu
- File_button['menu'] = File_button.menu
-
- return File_button
-
-
-
-def makeEditMenu():
- Edit_button = Menubutton(mBar, text='Edit', underline=0)
- Edit_button.pack(side=LEFT, padx="1m")
- Edit_button.menu = Menu(Edit_button)
-
- # just to be cute, let's disable the undo option:
- Edit_button.menu.add('command', label="Undo")
- # Since the tear-off bar is the 0th entry,
- # undo is the 1st entry...
- Edit_button.menu.entryconfig(1, state=DISABLED)
-
- # and these are just for show. No "command" callbacks attached.
- Edit_button.menu.add_command(label="Cut")
- Edit_button.menu.add_command(label="Copy")
- Edit_button.menu.add_command(label="Paste")
-
- # set up a pointer from the file menubutton back to the file menu
- Edit_button['menu'] = Edit_button.menu
-
- return Edit_button
-
-
-#################################################
-
-#### Main starts here ...
-root = Tk()
-
-
-# make a menu bar
-mBar = Frame(root, relief=RAISED, borderwidth=2)
-mBar.pack(fill=X)
-
-File_button = makeFileMenu()
-Edit_button = makeEditMenu()
-
-# finally, install the buttons in the menu bar.
-# This allows for scanning from one menubutton to the next.
-mBar.tk_menuBar(File_button, Edit_button)
-
-root.title('menu demo')
-root.iconname('packer')
-
-root.mainloop()
diff --git a/Demo/tkinter/matt/not-what-you-might-think-1.py b/Demo/tkinter/matt/not-what-you-might-think-1.py
deleted file mode 100644
index 85c65c82c1..0000000000
--- a/Demo/tkinter/matt/not-what-you-might-think-1.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from tkinter import *
-
-
-class Test(Frame):
- def createWidgets(self):
-
- self.Gpanel = Frame(self, width='1i', height='1i',
- background='green')
- self.Gpanel.pack(side=LEFT)
-
- # a QUIT button
- self.Gpanel.QUIT = Button(self.Gpanel, text='QUIT',
- foreground='red',
- command=self.quit)
- self.Gpanel.QUIT.pack(side=LEFT)
-
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-
-test.master.title('packer demo')
-test.master.iconname('packer')
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/not-what-you-might-think-2.py b/Demo/tkinter/matt/not-what-you-might-think-2.py
deleted file mode 100644
index 4512063672..0000000000
--- a/Demo/tkinter/matt/not-what-you-might-think-2.py
+++ /dev/null
@@ -1,30 +0,0 @@
-from tkinter import *
-
-
-class Test(Frame):
- def createWidgets(self):
-
- self.Gpanel = Frame(self, width='1i', height='1i',
- background='green')
-
- # this line turns off the recalculation of geometry by masters.
- self.Gpanel.propagate(0)
-
- self.Gpanel.pack(side=LEFT)
-
- # a QUIT button
- self.Gpanel.QUIT = Button(self.Gpanel, text='QUIT', foreground='red',
- command=self.quit)
- self.Gpanel.QUIT.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-
-test.master.title('packer demo')
-test.master.iconname('packer')
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/packer-and-placer-together.py b/Demo/tkinter/matt/packer-and-placer-together.py
deleted file mode 100644
index 3cf6c45960..0000000000
--- a/Demo/tkinter/matt/packer-and-placer-together.py
+++ /dev/null
@@ -1,41 +0,0 @@
-from tkinter import *
-
-# This is a program that tests the placer geom manager in conjunction with
-# the packer. The background (green) is packed, while the widget inside is placed
-
-
-def do_motion(event):
- app.button.place(x=event.x, y=event.y)
-
-def dothis():
- print('calling me!')
-
-def createWidgets(top):
- # make a frame. Note that the widget is 200 x 200
- # and the window containing is 400x400. We do this
- # simply to show that this is possible. The rest of the
- # area is inaccesssible.
- f = Frame(top, width=200, height=200, background='green')
-
- # note that we use a different manager here.
- # This way, the top level frame widget resizes when the
- # application window does.
- f.pack(fill=BOTH, expand=1)
-
- # now make a button
- f.button = Button(f, foreground='red', text='amazing', command=dothis)
-
- # and place it so that the nw corner is
- # 1/2 way along the top X edge of its' parent
- f.button.place(relx=0.5, rely=0.0, anchor=NW)
-
- # allow the user to move the button SUIT-style.
- f.bind('<Control-Shift-Motion>', do_motion)
-
- return f
-
-root = Tk()
-app = createWidgets(root)
-root.geometry("400x400")
-root.maxsize(1000, 1000)
-root.mainloop()
diff --git a/Demo/tkinter/matt/packer-simple.py b/Demo/tkinter/matt/packer-simple.py
deleted file mode 100644
index 64f61d5fff..0000000000
--- a/Demo/tkinter/matt/packer-simple.py
+++ /dev/null
@@ -1,32 +0,0 @@
-from tkinter import *
-
-
-class Test(Frame):
- def printit(self):
- print(self.hi_there["command"])
-
- def createWidgets(self):
- # a hello button
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=LEFT, fill=BOTH)
-
- self.hi_there = Button(self, text='Hello',
- command=self.printit)
- self.hi_there.pack(side=LEFT)
-
- # note how Packer defaults to side=TOP
-
- self.guy2 = Button(self, text='button 2')
- self.guy2.pack()
-
- self.guy3 = Button(self, text='button 3')
- self.guy3.pack()
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/placer-simple.py b/Demo/tkinter/matt/placer-simple.py
deleted file mode 100644
index 6be0de9ffe..0000000000
--- a/Demo/tkinter/matt/placer-simple.py
+++ /dev/null
@@ -1,39 +0,0 @@
-from tkinter import *
-
-# This is a program that tests the placer geom manager
-
-def do_motion(event):
- app.button.place(x=event.x, y=event.y)
-
-def dothis():
- print('calling me!')
-
-def createWidgets(top):
- # make a frame. Note that the widget is 200 x 200
- # and the window containing is 400x400. We do this
- # simply to show that this is possible. The rest of the
- # area is inaccesssible.
- f = Frame(top, width=200, height=200, background='green')
-
- # place it so the upper left hand corner of
- # the frame is in the upper left corner of
- # the parent
- f.place(relx=0.0, rely=0.0)
-
- # now make a button
- f.button = Button(f, foreground='red', text='amazing', command=dothis)
-
- # and place it so that the nw corner is
- # 1/2 way along the top X edge of its' parent
- f.button.place(relx=0.5, rely=0.0, anchor=NW)
-
- # allow the user to move the button SUIT-style.
- f.bind('<Control-Shift-Motion>', do_motion)
-
- return f
-
-root = Tk()
-app = createWidgets(root)
-root.geometry("400x400")
-root.maxsize(1000, 1000)
-root.mainloop()
diff --git a/Demo/tkinter/matt/pong-demo-1.py b/Demo/tkinter/matt/pong-demo-1.py
deleted file mode 100644
index 82a5dc0740..0000000000
--- a/Demo/tkinter/matt/pong-demo-1.py
+++ /dev/null
@@ -1,52 +0,0 @@
-from tkinter import *
-
-
-class Pong(Frame):
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=LEFT, fill=BOTH)
-
- ## The playing field
- self.draw = Canvas(self, width="5i", height="5i")
-
- ## The speed control for the ball
- self.speed = Scale(self, orient=HORIZONTAL, label="ball speed",
- from_=-100, to=100)
-
- self.speed.pack(side=BOTTOM, fill=X)
-
- # The ball
- self.ball = self.draw.create_oval("0i", "0i", "0.10i", "0.10i",
- fill="red")
- self.x = 0.05
- self.y = 0.05
- self.velocity_x = 0.3
- self.velocity_y = 0.5
-
- self.draw.pack(side=LEFT)
-
- def moveBall(self, *args):
- if (self.x > 5.0) or (self.x < 0.0):
- self.velocity_x = -1.0 * self.velocity_x
- if (self.y > 5.0) or (self.y < 0.0):
- self.velocity_y = -1.0 * self.velocity_y
-
- deltax = (self.velocity_x * self.speed.get() / 100.0)
- deltay = (self.velocity_y * self.speed.get() / 100.0)
- self.x = self.x + deltax
- self.y = self.y + deltay
-
- self.draw.move(self.ball, "%ri" % deltax, "%ri" % deltay)
- self.after(10, self.moveBall)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
- self.after(10, self.moveBall)
-
-
-game = Pong()
-
-game.mainloop()
diff --git a/Demo/tkinter/matt/printing-coords-of-items.py b/Demo/tkinter/matt/printing-coords-of-items.py
deleted file mode 100644
index 771a60d0fd..0000000000
--- a/Demo/tkinter/matt/printing-coords-of-items.py
+++ /dev/null
@@ -1,61 +0,0 @@
-from tkinter import *
-
-# this file demonstrates the creation of widgets as part of a canvas object
-
-class Test(Frame):
- ###################################################################
- ###### Event callbacks for THE CANVAS (not the stuff drawn on it)
- ###################################################################
- def mouseDown(self, event):
- # see if we're inside a dot. If we are, it
- # gets tagged as CURRENT for free by tk.
-
- if not event.widget.find_withtag(CURRENT):
- # there is no dot here, so we can make one,
- # and bind some interesting behavior to it.
- # ------
- # create a dot, and mark it as current
- fred = self.draw.create_oval(
- event.x - 10, event.y -10, event.x +10, event.y + 10,
- fill="green")
- self.draw.tag_bind(fred, "<Enter>", self.mouseEnter)
- self.draw.tag_bind(fred, "<Leave>", self.mouseLeave)
- self.lastx = event.x
- self.lasty = event.y
-
- def mouseMove(self, event):
- self.draw.move(CURRENT, event.x - self.lastx, event.y - self.lasty)
- self.lastx = event.x
- self.lasty = event.y
-
- ###################################################################
- ###### Event callbacks for canvas ITEMS (stuff drawn on the canvas)
- ###################################################################
- def mouseEnter(self, event):
- # the "current" tag is applied to the object the cursor is over.
- # this happens automatically.
- self.draw.itemconfig(CURRENT, fill="red")
- print(list(self.draw.coords(CURRENT)))
-
- def mouseLeave(self, event):
- # the "current" tag is applied to the object the cursor is over.
- # this happens automatically.
- self.draw.itemconfig(CURRENT, fill="blue")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=LEFT, fill=BOTH)
- self.draw = Canvas(self, width="5i", height="5i")
- self.draw.pack(side=LEFT)
-
- Widget.bind(self.draw, "<1>", self.mouseDown)
- Widget.bind(self.draw, "<B1-Motion>", self.mouseMove)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/radiobutton-simple.py b/Demo/tkinter/matt/radiobutton-simple.py
deleted file mode 100644
index a2719b8d74..0000000000
--- a/Demo/tkinter/matt/radiobutton-simple.py
+++ /dev/null
@@ -1,62 +0,0 @@
-from tkinter import *
-
-# This is a demo program that shows how to
-# create radio buttons and how to get other widgets to
-# share the information in a radio button.
-#
-# There are other ways of doing this too, but
-# the "variable" option of radiobuttons seems to be the easiest.
-#
-# note how each button has a value it sets the variable to as it gets hit.
-
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
-
- self.flavor = StringVar()
- self.flavor.set("chocolate")
-
- self.radioframe = Frame(self)
- self.radioframe.pack()
-
- # 'text' is the label
- # 'variable' is the name of the variable that all these radio buttons share
- # 'value' is the value this variable takes on when the radio button is selected
- # 'anchor' makes the text appear left justified (default is centered. ick)
- self.radioframe.choc = Radiobutton(
- self.radioframe, text="Chocolate Flavor",
- variable=self.flavor, value="chocolate",
- anchor=W)
- self.radioframe.choc.pack(fill=X)
-
- self.radioframe.straw = Radiobutton(
- self.radioframe, text="Strawberry Flavor",
- variable=self.flavor, value="strawberry",
- anchor=W)
- self.radioframe.straw.pack(fill=X)
-
- self.radioframe.lemon = Radiobutton(
- self.radioframe, text="Lemon Flavor",
- variable=self.flavor, value="lemon",
- anchor=W)
- self.radioframe.lemon.pack(fill=X)
-
- # this is a text entry that lets you type in the name of a flavor too.
- self.entry = Entry(self, textvariable=self.flavor)
- self.entry.pack(fill=X)
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
-
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/rubber-band-box-demo-1.py b/Demo/tkinter/matt/rubber-band-box-demo-1.py
deleted file mode 100644
index 48526d87fe..0000000000
--- a/Demo/tkinter/matt/rubber-band-box-demo-1.py
+++ /dev/null
@@ -1,58 +0,0 @@
-from tkinter import *
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT',
- background='red',
- foreground='white',
- height=3,
- command=self.quit)
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
-
- self.canvasObject = Canvas(self, width="5i", height="5i")
- self.canvasObject.pack(side=LEFT)
-
- def mouseDown(self, event):
- # canvas x and y take the screen coords from the event and translate
- # them into the coordinate system of the canvas object
- self.startx = self.canvasObject.canvasx(event.x)
- self.starty = self.canvasObject.canvasy(event.y)
-
- def mouseMotion(self, event):
- # canvas x and y take the screen coords from the event and translate
- # them into the coordinate system of the canvas object
- x = self.canvasObject.canvasx(event.x)
- y = self.canvasObject.canvasy(event.y)
-
- if (self.startx != event.x) and (self.starty != event.y) :
- self.canvasObject.delete(self.rubberbandBox)
- self.rubberbandBox = self.canvasObject.create_rectangle(
- self.startx, self.starty, x, y)
- # this flushes the output, making sure that
- # the rectangle makes it to the screen
- # before the next event is handled
- self.update_idletasks()
-
- def mouseUp(self, event):
- self.canvasObject.delete(self.rubberbandBox)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
- # this is a "tagOrId" for the rectangle we draw on the canvas
- self.rubberbandBox = None
-
- # and the bindings that make it work..
- Widget.bind(self.canvasObject, "<Button-1>", self.mouseDown)
- Widget.bind(self.canvasObject, "<Button1-Motion>", self.mouseMotion)
- Widget.bind(self.canvasObject, "<Button1-ButtonRelease>", self.mouseUp)
-
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/rubber-line-demo-1.py b/Demo/tkinter/matt/rubber-line-demo-1.py
deleted file mode 100644
index cfc488227b..0000000000
--- a/Demo/tkinter/matt/rubber-line-demo-1.py
+++ /dev/null
@@ -1,51 +0,0 @@
-from tkinter import *
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT',
- background='red',
- foreground='white',
- height=3,
- command=self.quit)
- self.QUIT.pack(side=BOTTOM, fill=BOTH)
-
- self.canvasObject = Canvas(self, width="5i", height="5i")
- self.canvasObject.pack(side=LEFT)
-
- def mouseDown(self, event):
- # canvas x and y take the screen coords from the event and translate
- # them into the coordinate system of the canvas object
- self.startx = self.canvasObject.canvasx(event.x)
- self.starty = self.canvasObject.canvasy(event.y)
-
- def mouseMotion(self, event):
- # canvas x and y take the screen coords from the event and translate
- # them into the coordinate system of the canvas object
- x = self.canvasObject.canvasx(event.x)
- y = self.canvasObject.canvasy(event.y)
-
- if (self.startx != event.x) and (self.starty != event.y) :
- self.canvasObject.delete(self.rubberbandLine)
- self.rubberbandLine = self.canvasObject.create_line(
- self.startx, self.starty, x, y)
- # this flushes the output, making sure that
- # the rectangle makes it to the screen
- # before the next event is handled
- self.update_idletasks()
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
- # this is a "tagOrId" for the rectangle we draw on the canvas
- self.rubberbandLine = None
- Widget.bind(self.canvasObject, "<Button-1>", self.mouseDown)
- Widget.bind(self.canvasObject, "<Button1-Motion>", self.mouseMotion)
-
-
-test = Test()
-
-test.mainloop()
diff --git a/Demo/tkinter/matt/slider-demo-1.py b/Demo/tkinter/matt/slider-demo-1.py
deleted file mode 100644
index 687f8a3472..0000000000
--- a/Demo/tkinter/matt/slider-demo-1.py
+++ /dev/null
@@ -1,36 +0,0 @@
-from tkinter import *
-
-# shows how to make a slider, set and get its value under program control
-
-
-class Test(Frame):
- def print_value(self, val):
- print("slider now at", val)
-
- def reset(self):
- self.slider.set(0)
-
- def createWidgets(self):
- self.slider = Scale(self, from_=0, to=100,
- orient=HORIZONTAL,
- length="3i",
- label="happy slider",
- command=self.print_value)
-
- self.reset = Button(self, text='reset slider',
- command=self.reset)
-
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
-
- self.slider.pack(side=LEFT)
- self.reset.pack(side=LEFT)
- self.QUIT.pack(side=LEFT, fill=BOTH)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/subclass-existing-widgets.py b/Demo/tkinter/matt/subclass-existing-widgets.py
deleted file mode 100644
index ce97f35f2d..0000000000
--- a/Demo/tkinter/matt/subclass-existing-widgets.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from tkinter import *
-
-# This is a program that makes a simple two button application
-
-
-class New_Button(Button):
- def callback(self):
- print(self.counter)
- self.counter = self.counter + 1
-
-def createWidgets(top):
- f = Frame(top)
- f.pack()
- f.QUIT = Button(f, text='QUIT', foreground='red', command=top.quit)
-
- f.QUIT.pack(side=LEFT, fill=BOTH)
-
- # a hello button
- f.hi_there = New_Button(f, text='Hello')
- # we do this on a different line because we need to reference f.hi_there
- f.hi_there.config(command=f.hi_there.callback)
- f.hi_there.pack(side=LEFT)
- f.hi_there.counter = 43
-
-
-root = Tk()
-createWidgets(root)
-root.mainloop()
diff --git a/Demo/tkinter/matt/two-radio-groups.py b/Demo/tkinter/matt/two-radio-groups.py
deleted file mode 100644
index 38b61b117c..0000000000
--- a/Demo/tkinter/matt/two-radio-groups.py
+++ /dev/null
@@ -1,110 +0,0 @@
-from tkinter import *
-
-# The way to think about this is that each radio button menu
-# controls a different variable -- clicking on one of the
-# mutually exclusive choices in a radiobutton assigns some value
-# to an application variable you provide. When you define a
-# radiobutton menu choice, you have the option of specifying the
-# name of a varaible and value to assign to that variable when
-# that choice is selected. This clever mechanism relieves you,
-# the programmer, from having to write a dumb callback that
-# probably wouldn't have done anything more than an assignment
-# anyway. The Tkinter options for this follow their Tk
-# counterparts:
-# {"variable" : my_flavor_variable, "value" : "strawberry"}
-# where my_flavor_variable is an instance of one of the
-# subclasses of Variable, provided in Tkinter.py (there is
-# StringVar(), IntVar(), DoubleVar() and BooleanVar() to choose
-# from)
-
-
-
-def makePoliticalParties(var):
- # make menu button
- Radiobutton_button = Menubutton(mBar, text='Political Party',
- underline=0)
- Radiobutton_button.pack(side=LEFT, padx='2m')
-
- # the primary pulldown
- Radiobutton_button.menu = Menu(Radiobutton_button)
-
- Radiobutton_button.menu.add_radiobutton(label='Republican',
- variable=var, value=1)
-
- Radiobutton_button.menu.add('radiobutton', {'label': 'Democrat',
- 'variable' : var,
- 'value' : 2})
-
- Radiobutton_button.menu.add('radiobutton', {'label': 'Libertarian',
- 'variable' : var,
- 'value' : 3})
-
- var.set(2)
-
- # set up a pointer from the file menubutton back to the file menu
- Radiobutton_button['menu'] = Radiobutton_button.menu
-
- return Radiobutton_button
-
-
-def makeFlavors(var):
- # make menu button
- Radiobutton_button = Menubutton(mBar, text='Flavors',
- underline=0)
- Radiobutton_button.pack(side=LEFT, padx='2m')
-
- # the primary pulldown
- Radiobutton_button.menu = Menu(Radiobutton_button)
-
- Radiobutton_button.menu.add_radiobutton(label='Strawberry',
- variable=var, value='Strawberry')
-
- Radiobutton_button.menu.add_radiobutton(label='Chocolate',
- variable=var, value='Chocolate')
-
- Radiobutton_button.menu.add_radiobutton(label='Rocky Road',
- variable=var, value='Rocky Road')
-
- # choose a default
- var.set("Chocolate")
-
- # set up a pointer from the file menubutton back to the file menu
- Radiobutton_button['menu'] = Radiobutton_button.menu
-
- return Radiobutton_button
-
-
-def printStuff():
- print("party is", party.get())
- print("flavor is", flavor.get())
- print()
-
-#################################################
-#### Main starts here ...
-root = Tk()
-
-
-# make a menu bar
-mBar = Frame(root, relief=RAISED, borderwidth=2)
-mBar.pack(fill=X)
-
-# make two application variables,
-# one to control each radio button set
-party = IntVar()
-flavor = StringVar()
-
-Radiobutton_button = makePoliticalParties(party)
-Radiobutton_button2 = makeFlavors(flavor)
-
-# finally, install the buttons in the menu bar.
-# This allows for scanning from one menubutton to the next.
-mBar.tk_menuBar(Radiobutton_button, Radiobutton_button2)
-
-b = Button(root, text="print party and flavor", foreground="red",
- command=printStuff)
-b.pack(side=TOP)
-
-root.title('menu demo')
-root.iconname('menu demo')
-
-root.mainloop()
diff --git a/Demo/tkinter/matt/window-creation-more.py b/Demo/tkinter/matt/window-creation-more.py
deleted file mode 100644
index 32c8b7082a..0000000000
--- a/Demo/tkinter/matt/window-creation-more.py
+++ /dev/null
@@ -1,35 +0,0 @@
-from tkinter import *
-
-# this shows how to create a new window with a button in it
-# that can create new windows
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def makeWindow(self):
- fred = Toplevel()
- fred.label = Button(fred,
- text="This is window number %d." % self.windownum,
- command=self.makeWindow)
- fred.label.pack()
- self.windownum = self.windownum + 1
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
- self.QUIT.pack(side=LEFT, fill=BOTH)
-
- # a hello button
- self.hi_there = Button(self, text='Make a New Window',
- command=self.makeWindow)
- self.hi_there.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.windownum = 0
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/window-creation-simple.py b/Demo/tkinter/matt/window-creation-simple.py
deleted file mode 100644
index f5e6230d84..0000000000
--- a/Demo/tkinter/matt/window-creation-simple.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from tkinter import *
-
-# this shows how to spawn off new windows at a button press
-
-class Test(Frame):
- def printit(self):
- print("hi")
-
- def makeWindow(self):
- fred = Toplevel()
- fred.label = Label(fred, text="Here's a new window")
- fred.label.pack()
-
- def createWidgets(self):
- self.QUIT = Button(self, text='QUIT', foreground='red',
- command=self.quit)
-
- self.QUIT.pack(side=LEFT, fill=BOTH)
-
- # a hello button
- self.hi_there = Button(self, text='Make a New Window',
- command=self.makeWindow)
- self.hi_there.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/matt/window-creation-w-location.py b/Demo/tkinter/matt/window-creation-w-location.py
deleted file mode 100644
index 9f82367ffa..0000000000
--- a/Demo/tkinter/matt/window-creation-w-location.py
+++ /dev/null
@@ -1,45 +0,0 @@
-from tkinter import *
-
-import sys
-##sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
-##from TkinterUtils import *
-
-# this shows how to create a new window with a button in it that
-# can create new windows
-
-class QuitButton(Button):
- def __init__(self, master, *args, **kwargs):
- if "text" not in kwargs:
- kwargs["text"] = "QUIT"
- if "command" not in kwargs:
- kwargs["command"] = master.quit
- Button.__init__(self, master, *args, **kwargs)
-
-class Test(Frame):
- def makeWindow(self, *args):
- fred = Toplevel()
-
- fred.label = Canvas (fred, width="2i", height="2i")
-
- fred.label.create_line("0", "0", "2i", "2i")
- fred.label.create_line("0", "2i", "2i", "0")
- fred.label.pack()
-
- ##centerWindow(fred, self.master)
-
- def createWidgets(self):
- self.QUIT = QuitButton(self)
- self.QUIT.pack(side=LEFT, fill=BOTH)
-
- self.makeWindow = Button(self, text='Make a New Window',
- width=50, height=20,
- command=self.makeWindow)
- self.makeWindow.pack(side=LEFT)
-
- def __init__(self, master=None):
- Frame.__init__(self, master)
- Pack.config(self)
- self.createWidgets()
-
-test = Test()
-test.mainloop()
diff --git a/Demo/tkinter/ttk/combo_themes.py b/Demo/tkinter/ttk/combo_themes.py
deleted file mode 100644
index 45eee2d43f..0000000000
--- a/Demo/tkinter/ttk/combo_themes.py
+++ /dev/null
@@ -1,46 +0,0 @@
-"""Ttk Theme Selector.
-
-Although it is a theme selector, you won't notice many changes since
-there is only a combobox and a frame around.
-"""
-from tkinter import ttk
-
-class App(ttk.Frame):
- def __init__(self):
- ttk.Frame.__init__(self)
-
- self.style = ttk.Style()
- self._setup_widgets()
-
- def _change_theme(self, event):
- if event.widget.current(): # value #0 is not a theme
- newtheme = event.widget.get()
- # change to the new theme and refresh all the widgets
- self.style.theme_use(newtheme)
-
- def _setup_widgets(self):
- themes = list(self.style.theme_names())
- themes.insert(0, "Pick a theme")
- # Create a readonly Combobox which will display 4 values at max,
- # which will cause it to create a scrollbar if there are more
- # than 4 values in total.
- themes_combo = ttk.Combobox(self, values=themes, state="readonly",
- height=4)
- themes_combo.set(themes[0]) # sets the combobox value to "Pick a theme"
- # Combobox widget generates a <<ComboboxSelected>> virtual event
- # when the user selects an element. This event is generated after
- # the listbox is unposted (after you select an item, the combobox's
- # listbox disappears, then it is said that listbox is now unposted).
- themes_combo.bind("<<ComboboxSelected>>", self._change_theme)
- themes_combo.pack(fill='x')
-
- self.pack(fill='both', expand=1)
-
-
-def main():
- app = App()
- app.master.title("Ttk Combobox")
- app.mainloop()
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/tkinter/ttk/dirbrowser.py b/Demo/tkinter/ttk/dirbrowser.py
deleted file mode 100644
index bacddb58cb..0000000000
--- a/Demo/tkinter/ttk/dirbrowser.py
+++ /dev/null
@@ -1,93 +0,0 @@
-"""A directory browser using Ttk Treeview.
-
-Based on the demo found in Tk 8.5 library/demos/browse
-"""
-import os
-import glob
-import tkinter
-from tkinter import ttk
-
-def populate_tree(tree, node):
- if tree.set(node, "type") != 'directory':
- return
-
- path = tree.set(node, "fullpath")
- tree.delete(*tree.get_children(node))
-
- parent = tree.parent(node)
- special_dirs = [] if parent else glob.glob('.') + glob.glob('..')
-
- for p in special_dirs + os.listdir(path):
- ptype = None
- p = os.path.join(path, p).replace('\\', '/')
- if os.path.isdir(p): ptype = "directory"
- elif os.path.isfile(p): ptype = "file"
-
- fname = os.path.split(p)[1]
- id = tree.insert(node, "end", text=fname, values=[p, ptype])
-
- if ptype == 'directory':
- if fname not in ('.', '..'):
- tree.insert(id, 0, text="dummy")
- tree.item(id, text=fname)
- elif ptype == 'file':
- size = os.stat(p).st_size
- tree.set(id, "size", "%d bytes" % size)
-
-
-def populate_roots(tree):
- dir = os.path.abspath('.').replace('\\', '/')
- node = tree.insert('', 'end', text=dir, values=[dir, "directory"])
- populate_tree(tree, node)
-
-def update_tree(event):
- tree = event.widget
- populate_tree(tree, tree.focus())
-
-def change_dir(event):
- tree = event.widget
- node = tree.focus()
- if tree.parent(node):
- path = os.path.abspath(tree.set(node, "fullpath"))
- if os.path.isdir(path):
- os.chdir(path)
- tree.delete(tree.get_children(''))
- populate_roots(tree)
-
-def autoscroll(sbar, first, last):
- """Hide and show scrollbar as needed."""
- first, last = float(first), float(last)
- if first <= 0 and last >= 1:
- sbar.grid_remove()
- else:
- sbar.grid()
- sbar.set(first, last)
-
-root = tkinter.Tk()
-
-vsb = ttk.Scrollbar(orient="vertical")
-hsb = ttk.Scrollbar(orient="horizontal")
-
-tree = ttk.Treeview(columns=("fullpath", "type", "size"),
- displaycolumns="size", yscrollcommand=lambda f, l: autoscroll(vsb, f, l),
- xscrollcommand=lambda f, l:autoscroll(hsb, f, l))
-
-vsb['command'] = tree.yview
-hsb['command'] = tree.xview
-
-tree.heading("#0", text="Directory Structure", anchor='w')
-tree.heading("size", text="File Size", anchor='w')
-tree.column("size", stretch=0, width=100)
-
-populate_roots(tree)
-tree.bind('<<TreeviewOpen>>', update_tree)
-tree.bind('<Double-Button-1>', change_dir)
-
-# Arrange the tree and its scrollbars in the toplevel
-tree.grid(column=0, row=0, sticky='nswe')
-vsb.grid(column=1, row=0, sticky='ns')
-hsb.grid(column=0, row=1, sticky='ew')
-root.grid_columnconfigure(0, weight=1)
-root.grid_rowconfigure(0, weight=1)
-
-root.mainloop()
diff --git a/Demo/tkinter/ttk/img/close.gif b/Demo/tkinter/ttk/img/close.gif
deleted file mode 100644
index 18cf6c7603..0000000000
--- a/Demo/tkinter/ttk/img/close.gif
+++ /dev/null
Binary files differ
diff --git a/Demo/tkinter/ttk/img/close_active.gif b/Demo/tkinter/ttk/img/close_active.gif
deleted file mode 100644
index db7f39269f..0000000000
--- a/Demo/tkinter/ttk/img/close_active.gif
+++ /dev/null
Binary files differ
diff --git a/Demo/tkinter/ttk/img/close_pressed.gif b/Demo/tkinter/ttk/img/close_pressed.gif
deleted file mode 100644
index 561695495c..0000000000
--- a/Demo/tkinter/ttk/img/close_pressed.gif
+++ /dev/null
Binary files differ
diff --git a/Demo/tkinter/ttk/listbox_scrollcmd.py b/Demo/tkinter/ttk/listbox_scrollcmd.py
deleted file mode 100644
index 05faf63465..0000000000
--- a/Demo/tkinter/ttk/listbox_scrollcmd.py
+++ /dev/null
@@ -1,37 +0,0 @@
-"""Sample taken from: http://www.tkdocs.com/tutorial/morewidgets.html and
-converted to Python, mainly to demonstrate xscrollcommand option.
-
-grid [tk::listbox .l -yscrollcommand ".s set" -height 5] -column 0 -row 0 -sticky nwes
-grid [ttk::scrollbar .s -command ".l yview" -orient vertical] -column 1 -row 0 -sticky ns
-grid [ttk::label .stat -text "Status message here" -anchor w] -column 0 -row 1 -sticky we
-grid [ttk::sizegrip .sz] -column 1 -row 1 -sticky se
-grid columnconfigure . 0 -weight 1; grid rowconfigure . 0 -weight 1
-for {set i 0} {$i<100} {incr i} {
- .l insert end "Line $i of 100"
- }
-"""
-import tkinter
-from tkinter import ttk
-
-root = tkinter.Tk()
-
-l = tkinter.Listbox(height=5)
-l.grid(column=0, row=0, sticky='nwes')
-
-s = ttk.Scrollbar(command=l.yview, orient='vertical')
-l['yscrollcommand'] = s.set
-s.grid(column=1, row=0, sticky="ns")
-
-stat = ttk.Label(text="Status message here", anchor='w')
-stat.grid(column=0, row=1, sticky='we')
-
-sz = ttk.Sizegrip()
-sz.grid(column=1, row=1, sticky='se')
-
-root.grid_columnconfigure(0, weight=1)
-root.grid_rowconfigure(0, weight=1)
-
-for i in range(100):
- l.insert('end', "Line %d of 100" % i)
-
-root.mainloop()
diff --git a/Demo/tkinter/ttk/mac_searchentry.py b/Demo/tkinter/ttk/mac_searchentry.py
deleted file mode 100644
index 97b1eaf743..0000000000
--- a/Demo/tkinter/ttk/mac_searchentry.py
+++ /dev/null
@@ -1,78 +0,0 @@
-"""Mac style search widget
-
-Translated from Tcl code by Schelte Bron, http://wiki.tcl.tk/18188
-"""
-import tkinter
-from tkinter import ttk
-
-root = tkinter.Tk()
-
-data = """
-R0lGODlhKgAaAOfnAFdZVllbWFpcWVtdWlxeW11fXF9hXmBiX2ZnZWhpZ2lraGxua25wbXJ0
-cXR2c3V3dHZ4dXh6d3x+e31/fH6AfYSGg4eJhoiKh4qMiYuNio2PjHmUqnqVq3yXrZGTkJKU
-kX+asJSWk32cuJWXlIGcs5aYlX6euZeZloOetZial4SftpqbmIWgt4GhvYahuIKivpudmYei
-uYOjv5yem4ijuoSkwIWlwYmlu56gnYamwp+hnoenw4unvaCin4ioxJCnuZykrImpxZmlsoaq
-zI2pv6KkoZGouoqqxpqms4erzaOloo6qwYurx5Kqu5untIiszqSmo5CrwoysyJeqtpOrvJyo
-tZGsw42typSsvaaopZKtxJWtvp6qt4+uy6epppOuxZCvzKiqp5quuZSvxoyx06mrqJWwx42y
-1JKxzpmwwaqsqZaxyI6z1ZqxwqutqpOzz4+01qyuq56yvpizypS00Jm0y5W10Zq1zJa20rCy
-rpu3zqizwbGzr6C3yZy4z7K0saG4yp250LO1sqK5y5660Z+70qO7zKy4xaC806S8zba4taG9
-1KW9zq66x6+7yLi6t6S/1rC8yrm7uLO8xLG9y7q8ubS9xabB2anB07K+zLW+xrO/za7CzrTA
-zrjAyLXBz77BvbbC0K/G2LjD0bnE0rLK28TGw8bIxcLL07vP28HN28rMycvOyr/T38DU4cnR
-2s/RztHT0NLU0cTY5MrW5MvX5dHX2c3Z59bY1dPb5Nbb3dLe7Nvd2t3f3NXh797g3d3j5dnl
-9OPl4eTm4+Ln6tzo9uXn5Obo5eDp8efp5uHq8uXq7ejq5+nr6OPs9Ovu6unu8O3v6+vw8+7w
-7ezx9O/x7vDy7/Hz8O/19/P18vT38/L3+fb49Pf59vX6/fj69/b7/vn7+Pr8+ff9//v9+vz/
-+/7//P//////////////////////////////////////////////////////////////////
-/////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJZAD/ACwC
-AAIAKAAWAAAI/gD/CRz4bwUGCg8eQFjIsGHDBw4iTLAQgqBFgisuePCiyJOpUyBDihRpypMi
-Lx8qaLhIMIyGFZ5sAUsmjZrNmzhzWpO2DJgtTysqfGDpxoMbW8ekeQsXzty4p1CjRjUXrps3
-asJsuclQ4uKKSbamMR3n1JzZs2jRkh1HzuxVXX8y4CDYAwqua+DInVrRwMGJU2kDp31KThy1
-XGWGDlxhi1rTPAUICBBAoEAesoIzn6Vm68MKgVAUHftmzhOCBCtQwQKSoABgzZnJdSMmyIPA
-FbCotdUQAIhNa9B6DPCAGbZac+SowVIMRVe4pwkA4GpqDlwuAAmMZx4nTtfnf1mO5JEDNy46
-MHJkxQEDgKC49rPjwC0bqGaZuOoZAKjBPE4NgAzUvYcWOc0QZF91imAnCDHJ5JFAAJN0I2Ba
-4iRDUC/gOEVNDwIUcEABCAgAAATUTIgWOMBYRFp80ghiAQIIVAAEAwJIYI2JZnUji0XSYAYO
-NcsQA8wy0hCTwAASXGOiONFcxAtpTokTHznfiLMNMAkcAMuE43jDC0vLeGOWe2R5o4sn1LgH
-GzkWsvTPMgEOaA433Ag4TjjMuDkQMNi0tZ12sqWoJ0HATMPNffAZZ6U0wLAyqJ62RGoLLrhI
-aqmlpzwaEAAh+QQJZAD/ACwAAAAAKgAaAAAI/gD/CRw40JEhQoEC+fGjcOHCMRAjRkxDsKLF
-f5YcAcID582ZjyBDJhmZZIjJIUySEDHiBMhFghrtdNnRAgSHmzhz6sTZQcSLITx+CHn5bxSk
-Nz5MCMGy55CjTVCjbuJEtSrVQ3uwqDBRQwrFi476SHHxow8qXcemVbPGtm21t3CnTaP27Jgu
-VHtuiIjBsuImQkRiiEEFTNo2cOTMKV7MuLE5cN68QUOGSgwKG1EqJqJDY8+rZt8UjxtNunTj
-cY3DgZOWS46KIFgGjiI0ZIsqaqNNjWjgYMUpx8Adc3v2aosNMAI1DbqyI9WycOb4IAggQEAB
-A3lQBxet/TG4cMpI/tHwYeSfIzxM0uTKNs7UgAQrYL1akaDA7+3bueVqY4NJlUhIcQLNYx8E
-AIQ01mwjTQ8DeNAdfouNA8440GBCQxJY3MEGD6p4Y844CQCAizcSgpMLAAlAuJ03qOyQRBR3
-nEHEK+BMGKIui4kDDAAIPKiiYuSYSMQQRCDCxhiziPMYBgDkEaEaAGQA3Y+MjUPOLFoMoUUh
-cKxRC4ngeILiH8Qkk0cCAUzSDZWpzbLEE1EwggcYqWCj2DNADFDAAQUgIAAAEFDDJmPYqNJF
-F1s4cscTmCDjDTjdSPOHBQggUAEQDAgggTWDPoYMJkFoUdRmddyyjWLeULMMMcAsIw0x4wkM
-IME1g25zyxpHxFYUHmyIggw4H4ojITnfiLMNMAkcAAub4BQjihRdDGTJHmvc4Qo1wD6Imje6
-eILbj+BQ4wqu5Q3ECSJ0FOKKMtv4mBg33Pw4zjbKuBIIE1xYpIkhdQQiyi7OtAucj6dt48wu
-otQhBRa6VvSJIRwhIkotvgRTzMUYZ6xxMcj4QkspeKDxxRhEmUfIHWjAgQcijEDissuXvCyz
-zH7Q8YQURxDhUsn/bCInR3AELfTQZBRt9BBJkCGFFVhMwTNBlnBCSCGEIJQQIAklZMXWRBAR
-RRRWENHwRQEBADs="""
-
-
-s1 = tkinter.PhotoImage("search1", data=data, format="gif -index 0")
-s2 = tkinter.PhotoImage("search2", data=data, format="gif -index 1")
-
-style = ttk.Style()
-
-style.element_create("Search.field", "image", "search1",
- ("focus", "search2"), border=[22, 7, 14], sticky="ew")
-
-style.layout("Search.entry", [
- ("Search.field", {"sticky": "nswe", "border": 1, "children":
- [("Entry.padding", {"sticky": "nswe", "children":
- [("Entry.textarea", {"sticky": "nswe"})]
- })]
- })]
-)
-
-style.configure("Search.entry", background="#b2b2b2")
-
-root.configure(background="#b2b2b2")
-
-e1 = ttk.Entry(style="Search.entry", width=20)
-e2 = ttk.Entry(style="Search.entry", width=20)
-
-e1.grid(padx=10, pady=10)
-e2.grid(padx=10, pady=10)
-
-root.mainloop()
diff --git a/Demo/tkinter/ttk/notebook_closebtn.py b/Demo/tkinter/ttk/notebook_closebtn.py
deleted file mode 100644
index 6e65f09579..0000000000
--- a/Demo/tkinter/ttk/notebook_closebtn.py
+++ /dev/null
@@ -1,78 +0,0 @@
-"""A Ttk Notebook with close buttons.
-
-Based on an example by patthoyts, http://paste.tclers.tk/896
-"""
-import os
-import tkinter
-from tkinter import ttk
-
-root = tkinter.Tk()
-
-imgdir = os.path.join(os.path.dirname(__file__), 'img')
-i1 = tkinter.PhotoImage("img_close", file=os.path.join(imgdir, 'close.gif'))
-i2 = tkinter.PhotoImage("img_closeactive",
- file=os.path.join(imgdir, 'close_active.gif'))
-i3 = tkinter.PhotoImage("img_closepressed",
- file=os.path.join(imgdir, 'close_pressed.gif'))
-
-style = ttk.Style()
-
-style.element_create("close", "image", "img_close",
- ("active", "pressed", "!disabled", "img_closepressed"),
- ("active", "!disabled", "img_closeactive"), border=8, sticky='')
-
-style.layout("ButtonNotebook", [("ButtonNotebook.client", {"sticky": "nswe"})])
-style.layout("ButtonNotebook.Tab", [
- ("ButtonNotebook.tab", {"sticky": "nswe", "children":
- [("ButtonNotebook.padding", {"side": "top", "sticky": "nswe",
- "children":
- [("ButtonNotebook.focus", {"side": "top", "sticky": "nswe",
- "children":
- [("ButtonNotebook.label", {"side": "left", "sticky": ''}),
- ("ButtonNotebook.close", {"side": "left", "sticky": ''})]
- })]
- })]
- })]
-)
-
-def btn_press(event):
- x, y, widget = event.x, event.y, event.widget
- elem = widget.identify(x, y)
- index = widget.index("@%d,%d" % (x, y))
-
- if "close" in elem:
- widget.state(['pressed'])
- widget.pressed_index = index
-
-def btn_release(event):
- x, y, widget = event.x, event.y, event.widget
-
- if not widget.instate(['pressed']):
- return
-
- elem = widget.identify(x, y)
- index = widget.index("@%d,%d" % (x, y))
-
- if "close" in elem and widget.pressed_index == index:
- widget.forget(index)
- widget.event_generate("<<NotebookClosedTab>>")
-
- widget.state(["!pressed"])
- widget.pressed_index = None
-
-
-root.bind_class("TNotebook", "<ButtonPress-1>", btn_press, True)
-root.bind_class("TNotebook", "<ButtonRelease-1>", btn_release)
-
-# create a ttk notebook with our custom style, and add some tabs to it
-nb = ttk.Notebook(width=200, height=200, style="ButtonNotebook")
-nb.pressed_index = None
-f1 = tkinter.Frame(nb, background="red")
-f2 = tkinter.Frame(nb, background="green")
-f3 = tkinter.Frame(nb, background="blue")
-nb.add(f1, text='Red', padding=3)
-nb.add(f2, text='Green', padding=3)
-nb.add(f3, text='Blue', padding=3)
-nb.pack(expand=1, fill='both')
-
-root.mainloop()
diff --git a/Demo/tkinter/ttk/plastik_theme.py b/Demo/tkinter/ttk/plastik_theme.py
deleted file mode 100644
index 9c68bb5efe..0000000000
--- a/Demo/tkinter/ttk/plastik_theme.py
+++ /dev/null
@@ -1,268 +0,0 @@
-"""This demonstrates good part of the syntax accepted by theme_create.
-
-This is a translation of plastik.tcl to python.
-You will need the images used by the plastik theme to test this. The
-images (and other tile themes) can be retrived by doing:
-
-$ cvs -z3 -d:pserver:anonymous@tktable.cvs.sourceforge.net:/cvsroot/tktable \
- co tile-themes
-
-To test this module you should do, for example:
-
-import Tkinter
-import plastik_theme
-
-root = Tkinter.Tk()
-plastik_theme.install(plastik_image_dir)
-...
-
-Where plastik_image_dir contains the path to the images directory used by
-the plastik theme, something like: tile-themes/plastik/plastik
-"""
-import os
-import glob
-from tkinter import ttk, PhotoImage
-
-__all__ = ['install']
-
-colors = {
- "frame": "#efefef",
- "disabledfg": "#aaaaaa",
- "selectbg": "#657a9e",
- "selectfg": "#ffffff"
- }
-
-imgs = {}
-def _load_imgs(imgdir):
- imgdir = os.path.expanduser(imgdir)
- if not os.path.isdir(imgdir):
- raise Exception("%r is not a directory, can't load images" % imgdir)
- for f in glob.glob("%s/*.gif" % imgdir):
- img = os.path.split(f)[1]
- name = img[:-4]
- imgs[name] = PhotoImage(name, file=f, format="gif89")
-
-def install(imgdir):
- _load_imgs(imgdir)
- style = ttk.Style()
- style.theme_create("plastik", "default", settings={
- ".": {
- "configure":
- {"background": colors['frame'],
- "troughcolor": colors['frame'],
- "selectbackground": colors['selectbg'],
- "selectforeground": colors['selectfg'],
- "fieldbackground": colors['frame'],
- "font": "TkDefaultFont",
- "borderwidth": 1},
- "map": {"foreground": [("disabled", colors['disabledfg'])]}
- },
-
- "Vertical.TScrollbar": {"layout": [
- ("Vertical.Scrollbar.uparrow", {"side": "top", "sticky": ''}),
- ("Vertical.Scrollbar.downarrow", {"side": "bottom", "sticky": ''}),
- ("Vertical.Scrollbar.uparrow", {"side": "bottom", "sticky": ''}),
- ("Vertical.Scrollbar.trough", {"sticky": "ns", "children":
- [("Vertical.Scrollbar.thumb", {"expand": 1, "unit": 1,
- "children": [("Vertical.Scrollbar.grip", {"sticky": ''})]
- })]
- })]
- },
-
- "Horizontal.TScrollbar": {"layout": [
- ("Horizontal.Scrollbar.leftarrow", {"side": "left", "sticky": ''}),
- ("Horizontal.Scrollbar.rightarrow",
- {"side": "right", "sticky": ''}),
- ("Horizontal.Scrollbar.leftarrow",
- {"side": "right", "sticky": ''}),
- ("Horizontal.Scrollbar.trough", {"sticky": "ew", "children":
- [("Horizontal.Scrollbar.thumb", {"expand": 1, "unit": 1,
- "children": [("Horizontal.Scrollbar.grip", {"sticky": ''})]
- })]
- })]
- },
-
- "TButton": {
- "configure": {"width": 10, "anchor": "center"},
- "layout": [
- ("Button.button", {"children":
- [("Button.focus", {"children":
- [("Button.padding", {"children":
- [("Button.label", {"side": "left", "expand": 1})]
- })]
- })]
- })
- ]
- },
-
- "Toolbutton": {
- "configure": {"anchor": "center"},
- "layout": [
- ("Toolbutton.border", {"children":
- [("Toolbutton.button", {"children":
- [("Toolbutton.padding", {"children":
- [("Toolbutton.label", {"side":"left", "expand":1})]
- })]
- })]
- })
- ]
- },
-
- "TMenubutton": {"layout": [
- ("Menubutton.button", {"children":
- [("Menubutton.indicator", {"side": "right"}),
- ("Menubutton.focus", {"children":
- [("Menubutton.padding", {"children":
- [("Menubutton.label", {"side": "left", "expand": 1})]
- })]
- })]
- })]
- },
-
- "TNotebook": {"configure": {"tabmargins": [0, 2, 0, 0]}},
- "TNotebook.tab": {
- "configure": {"padding": [6, 2, 6, 2], "expand": [0, 0, 2]},
- "map": {"expand": [("selected", [1, 2, 4, 2])]}
- },
- "Treeview": {"configure": {"padding": 0}},
-
- # elements
- "Button.button": {"element create":
- ("image", 'button-n',
- ("pressed", 'button-p'), ("active", 'button-h'),
- {"border": [4, 10], "padding": 4, "sticky":"ewns"}
- )
- },
-
- "Toolbutton.button": {"element create":
- ("image", 'tbutton-n',
- ("selected", 'tbutton-p'), ("pressed", 'tbutton-p'),
- ("active", 'tbutton-h'),
- {"border": [4, 9], "padding": 3, "sticky": "news"}
- )
- },
-
- "Checkbutton.indicator": {"element create":
- ("image", 'check-nu',
- ('active', 'selected', 'check-hc'),
- ('pressed', 'selected', 'check-pc'),
- ('active', 'check-hu'),
- ("selected", 'check-nc'),
- {"sticky": ''}
- )
- },
-
- "Radiobutton.indicator": {"element create":
- ("image", 'radio-nu',
- ('active', 'selected', 'radio-hc'),
- ('pressed', 'selected', 'radio-pc'),
- ('active', 'radio-hu'), ('selected', 'radio-nc'),
- {"sticky": ''}
- )
- },
-
- "Horizontal.Scrollbar.thumb": {"element create":
- ("image", 'hsb-n', {"border": 3, "sticky": "ew"})
- },
-
- "Horizontal.Scrollbar.grip": {"element create": ("image", 'hsb-g')},
- "Horizontal.Scrollbar.trough": {"element create": ("image", 'hsb-t')},
- "Vertical.Scrollbar.thumb": {"element create":
- ("image", 'vsb-n', {"border": 3, "sticky": "ns"})
- },
- "Vertical.Scrollbar.grip": {"element create": ("image", 'vsb-g')},
- "Vertical.Scrollbar.trough": {"element create": ("image", 'vsb-t')},
- "Scrollbar.uparrow": {"element create":
- ("image", 'arrowup-n', ("pressed", 'arrowup-p'), {"sticky": ''})
- },
- "Scrollbar.downarrow": {"element create":
- ("image", 'arrowdown-n',
- ("pressed", 'arrowdown-p'), {'sticky': ''})
- },
- "Scrollbar.leftarrow": {"element create":
- ("image", 'arrowleft-n',
- ("pressed", 'arrowleft-p'), {'sticky': ''})
- },
- "Scrollbar.rightarrow": {"element create":
- ("image", 'arrowright-n', ("pressed", 'arrowright-p'),
- {'sticky': ''})
- },
-
- "Horizontal.Scale.slider": {"element create":
- ("image", 'hslider-n', {'sticky': ''})
- },
- "Horizontal.Scale.trough": {"element create":
- ("image", 'hslider-t', {'border': 1, 'padding': 0})
- },
- "Vertical.Scale.slider": {"element create":
- ("image", 'vslider-n', {'sticky': ''})
- },
- "Vertical.Scale.trough": {"element create":
- ("image", 'vslider-t', {'border': 1, 'padding': 0})
- },
-
- "Entry.field": {"element create":
- ("image", 'entry-n',
- ("focus", 'entry-f'),
- {'border': 2, 'padding': [3, 4], 'sticky': 'news'}
- )
- },
-
- "Labelframe.border": {"element create":
- ("image", 'border', {'border': 4, 'padding': 4, 'sticky': 'news'})
- },
-
- "Menubutton.button": {"element create":
- ("image", 'combo-r',
- ('active', 'combo-ra'),
- {'sticky': 'news', 'border': [4, 6, 24, 15],
- 'padding': [4, 4, 5]}
- )
- },
- "Menubutton.indicator": {"element create":
- ("image", 'arrow-d', {"sticky": "e", "border": [15, 0, 0, 0]})
- },
-
- "Combobox.field": {"element create":
- ("image", 'combo-n',
- ('readonly', 'active', 'combo-ra'),
- ('focus', 'active', 'combo-fa'),
- ('active', 'combo-a'), ('!readonly', 'focus', 'combo-f'),
- ('readonly', 'combo-r'),
- {'border': [4, 6, 24, 15], 'padding': [4, 4, 5],
- 'sticky': 'news'}
- )
- },
- "Combobox.downarrow": {"element create":
- ("image", 'arrow-d', {'sticky': 'e', 'border': [15, 0, 0, 0]})
- },
-
- "Notebook.client": {"element create":
- ("image", 'notebook-c', {'border': 4})
- },
- "Notebook.tab": {"element create":
- ("image", 'notebook-tn',
- ("selected", 'notebook-ts'), ("active", 'notebook-ta'),
- {'padding': [0, 2, 0, 0], 'border': [4, 10, 4, 10]}
- )
- },
-
- "Progressbar.trough": {"element create":
- ("image", 'hprogress-t', {'border': 2})
- },
- "Horizontal.Progressbar.pbar": {"element create":
- ("image", 'hprogress-b', {'border': [2, 9]})
- },
- "Vertical.Progressbar.pbar": {"element create":
- ("image", 'vprogress-b', {'border': [9, 2]})
- },
-
- "Treeheading.cell": {"element create":
- ("image", 'tree-n',
- ("pressed", 'tree-p'),
- {'border': [4, 10], 'padding': 4, 'sticky': 'news'}
- )
- }
-
- })
- style.theme_use("plastik")
diff --git a/Demo/tkinter/ttk/roundframe.py b/Demo/tkinter/ttk/roundframe.py
deleted file mode 100644
index ce3685aa07..0000000000
--- a/Demo/tkinter/ttk/roundframe.py
+++ /dev/null
@@ -1,111 +0,0 @@
-"""Ttk Frame with rounded corners.
-
-Based on an example by Bryan Oakley, found at: http://wiki.tcl.tk/20152"""
-import tkinter
-from tkinter import ttk
-
-root = tkinter.Tk()
-
-img1 = tkinter.PhotoImage("frameFocusBorder", data="""
-R0lGODlhQABAAPcAAHx+fMTCxKSipOTi5JSSlNTS1LSytPTy9IyKjMzKzKyq
-rOzq7JyanNza3Ly6vPz6/ISChMTGxKSmpOTm5JSWlNTW1LS2tPT29IyOjMzO
-zKyurOzu7JyenNze3Ly+vPz+/OkAKOUA5IEAEnwAAACuQACUAAFBAAB+AFYd
-QAC0AABBAAB+AIjMAuEEABINAAAAAHMgAQAAAAAAAAAAAKjSxOIEJBIIpQAA
-sRgBMO4AAJAAAHwCAHAAAAUAAJEAAHwAAP+eEP8CZ/8Aif8AAG0BDAUAAJEA
-AHwAAIXYAOfxAIESAHwAAABAMQAbMBZGMAAAIEggJQMAIAAAAAAAfqgaXESI
-5BdBEgB+AGgALGEAABYAAAAAAACsNwAEAAAMLwAAAH61MQBIAABCM8B+AAAU
-AAAAAAAApQAAsf8Brv8AlP8AQf8Afv8AzP8A1P8AQf8AfgAArAAABAAADAAA
-AACQDADjAAASAAAAAACAAADVABZBAAB+ALjMwOIEhxINUAAAANIgAOYAAIEA
-AHwAAGjSAGEEABYIAAAAAEoBB+MAAIEAAHwCACABAJsAAFAAAAAAAGjJAGGL
-AAFBFgB+AGmIAAAQAABHAAB+APQoAOE/ABIAAAAAAADQAADjAAASAAAAAPiF
-APcrABKDAAB8ABgAGO4AAJAAqXwAAHAAAAUAAJEAAHwAAP8AAP8AAP8AAP8A
-AG0pIwW3AJGSAHx8AEocI/QAAICpAHwAAAA0SABk6xaDEgB8AAD//wD//wD/
-/wD//2gAAGEAABYAAAAAAAC0/AHj5AASEgAAAAA01gBkWACDTAB8AFf43PT3
-5IASEnwAAOAYd+PuMBKQTwB8AGgAEGG35RaSEgB8AOj/NOL/ZBL/gwD/fMkc
-q4sA5UGpEn4AAIg02xBk/0eD/358fx/4iADk5QASEgAAAALnHABkAACDqQB8
-AMyINARkZA2DgwB8fBABHL0AAEUAqQAAAIAxKOMAPxIwAAAAAIScAOPxABIS
-AAAAAIIAnQwA/0IAR3cAACwAAAAAQABAAAAI/wA/CBxIsKDBgwgTKlzIsKFD
-gxceNnxAsaLFixgzUrzAsWPFCw8kDgy5EeQDkBxPolypsmXKlx1hXnS48UEH
-CwooMCDAgIJOCjx99gz6k+jQnkWR9lRgYYDJkAk/DlAgIMICZlizat3KtatX
-rAsiCNDgtCJClQkoFMgqsu3ArBkoZDgA8uDJAwk4bGDmtm9BZgcYzK078m4D
-Cgf4+l0skNkGCg3oUhR4d4GCDIoZM2ZWQMECyZQvLMggIbPmzQIyfCZ5YcME
-AwFMn/bLLIKBCRtMHljQQcDV2ZqZTRDQYfWFAwMqUJANvC8zBhUWbDi5YUAB
-Bsybt2VGoUKH3AcmdP+Im127xOcJih+oXsEDdvOLuQfIMGBD9QwBlsOnzcBD
-hfrsuVfefgzJR599A+CnH4Hb9fcfgu29x6BIBgKYYH4DTojQc/5ZGGGGGhpU
-IYIKghgiQRw+GKCEJxZIwXwWlthiQyl6KOCMLsJIIoY4LlQjhDf2mNCI9/Eo
-5IYO2sjikX+9eGCRCzL5V5JALillY07GaOSVb1G5ookzEnlhlFx+8OOXZb6V
-5Y5kcnlmckGmKaaMaZrpJZxWXjnnlmW++WGdZq5ZXQEetKmnlxPgl6eUYhJq
-KKOI0imnoNbF2ScFHQJJwW99TsBAAAVYWEAAHEQAZoi1cQDqAAeEV0EACpT/
-JqcACgRQAW6uNWCbYKcyyEwGDBgQwa2tTlBBAhYIQMFejC5AgQAWJNDABK3y
-loEDEjCgV6/aOcYBAwp4kIF6rVkXgAEc8IQZVifCBRQHGqya23HGIpsTBgSU
-OsFX/PbrVVjpYsCABA4kQCxHu11ogAQUIOAwATpBLDFQFE9sccUYS0wAxD5h
-4DACFEggbAHk3jVBA/gtTIHHEADg8sswxyzzzDQDAAEECGAQsgHiTisZResN
-gLIHBijwLQEYePzx0kw37fTSSjuMr7ZMzfcgYZUZi58DGsTKwbdgayt22GSP
-bXbYY3MggQIaONDzAJ8R9kFlQheQQAAOWGCAARrwdt23Bn8H7vfggBMueOEG
-WOBBAAkU0EB9oBGUdXIFZJBABAEEsPjmmnfO+eeeh/55BBEk0Ph/E8Q9meQq
-bbDABAN00EADFRRQ++2254777rr3jrvjFTTQwQCpz7u6QRut5/oEzA/g/PPQ
-Ry/99NIz//oGrZpUUEAAOw==""")
-
-img2 = tkinter.PhotoImage("frameBorder", data="""
-R0lGODlhQABAAPcAAHx+fMTCxKSipOTi5JSSlNTS1LSytPTy9IyKjMzKzKyq
-rOzq7JyanNza3Ly6vPz6/ISChMTGxKSmpOTm5JSWlNTW1LS2tPT29IyOjMzO
-zKyurOzu7JyenNze3Ly+vPz+/OkAKOUA5IEAEnwAAACuQACUAAFBAAB+AFYd
-QAC0AABBAAB+AIjMAuEEABINAAAAAHMgAQAAAAAAAAAAAKjSxOIEJBIIpQAA
-sRgBMO4AAJAAAHwCAHAAAAUAAJEAAHwAAP+eEP8CZ/8Aif8AAG0BDAUAAJEA
-AHwAAIXYAOfxAIESAHwAAABAMQAbMBZGMAAAIEggJQMAIAAAAAAAfqgaXESI
-5BdBEgB+AGgALGEAABYAAAAAAACsNwAEAAAMLwAAAH61MQBIAABCM8B+AAAU
-AAAAAAAApQAAsf8Brv8AlP8AQf8Afv8AzP8A1P8AQf8AfgAArAAABAAADAAA
-AACQDADjAAASAAAAAACAAADVABZBAAB+ALjMwOIEhxINUAAAANIgAOYAAIEA
-AHwAAGjSAGEEABYIAAAAAEoBB+MAAIEAAHwCACABAJsAAFAAAAAAAGjJAGGL
-AAFBFgB+AGmIAAAQAABHAAB+APQoAOE/ABIAAAAAAADQAADjAAASAAAAAPiF
-APcrABKDAAB8ABgAGO4AAJAAqXwAAHAAAAUAAJEAAHwAAP8AAP8AAP8AAP8A
-AG0pIwW3AJGSAHx8AEocI/QAAICpAHwAAAA0SABk6xaDEgB8AAD//wD//wD/
-/wD//2gAAGEAABYAAAAAAAC0/AHj5AASEgAAAAA01gBkWACDTAB8AFf43PT3
-5IASEnwAAOAYd+PuMBKQTwB8AGgAEGG35RaSEgB8AOj/NOL/ZBL/gwD/fMkc
-q4sA5UGpEn4AAIg02xBk/0eD/358fx/4iADk5QASEgAAAALnHABkAACDqQB8
-AMyINARkZA2DgwB8fBABHL0AAEUAqQAAAIAxKOMAPxIwAAAAAIScAOPxABIS
-AAAAAIIAnQwA/0IAR3cAACwAAAAAQABAAAAI/wA/CBxIsKDBgwgTKlzIsKFD
-gxceNnxAsaLFixgzUrzAsWPFCw8kDgy5EeQDkBxPolypsmXKlx1hXnS48UEH
-CwooMCDAgIJOCjx99gz6k+jQnkWR9lRgYYDJkAk/DlAgIMICkVgHLoggQIPT
-ighVJqBQIKvZghkoZDgA8uDJAwk4bDhLd+ABBmvbjnzbgMKBuoA/bKDQgC1F
-gW8XKMgQOHABBQsMI76wIIOExo0FZIhM8sKGCQYCYA4cwcCEDSYPLOgg4Oro
-uhMEdOB84cCAChReB2ZQYcGGkxsGFGCgGzCFCh1QH5jQIW3xugwSzD4QvIIH
-4s/PUgiQYcCG4BkC5P/ObpaBhwreq18nb3Z79+8Dwo9nL9I8evjWsdOX6D59
-fPH71Xeef/kFyB93/sln4EP2Ebjegg31B5+CEDLUIH4PVqiQhOABqKFCF6qn
-34cHcfjffCQaFOJtGaZYkIkUuljQigXK+CKCE3po40A0trgjjDru+EGPI/6I
-Y4co7kikkAMBmaSNSzL5gZNSDjkghkXaaGIBHjwpY4gThJeljFt2WSWYMQpZ
-5pguUnClehS4tuMEDARQgH8FBMBBBExGwIGdAxywXAUBKHCZkAIoEEAFp33W
-QGl47ZgBAwZEwKigE1SQgAUCUDCXiwtQIIAFCTQwgaCrZeCABAzIleIGHDD/
-oIAHGUznmXABGMABT4xpmBYBHGgAKGq1ZbppThgAG8EEAW61KwYMSOBAApdy
-pNp/BkhAAQLcEqCTt+ACJW645I5rLrgEeOsTBtwiQIEElRZg61sTNBBethSw
-CwEA/Pbr778ABywwABBAgAAG7xpAq6mGUUTdAPZ6YIACsRKAAbvtZqzxxhxn
-jDG3ybbKFHf36ZVYpuE5oIGhHMTqcqswvyxzzDS/HDMHEiiggQMLDxCZXh8k
-BnEBCQTggAUGGKCB0ktr0PTTTEfttNRQT22ABR4EkEABDXgnGUEn31ZABglE
-EEAAWaeN9tpqt832221HEEECW6M3wc+Hga3SBgtMODBABw00UEEBgxdO+OGG
-J4744oZzXUEDHQxwN7F5G7QRdXxPoPkAnHfu+eeghw665n1vIKhJBQUEADs=""")
-
-style = ttk.Style()
-
-style.element_create("RoundedFrame", "image", "frameBorder",
- ("focus", "frameFocusBorder"), border=16, sticky="nsew")
-
-style.layout("RoundedFrame", [("RoundedFrame", {"sticky": "nsew"})])
-style.configure("TEntry", borderwidth=0)
-
-frame = ttk.Frame(style="RoundedFrame", padding=10)
-frame.pack(fill='x')
-
-frame2 = ttk.Frame(style="RoundedFrame", padding=10)
-frame2.pack(fill='both', expand=1)
-
-entry = ttk.Entry(frame, text='Test')
-entry.pack(fill='x')
-entry.bind("<FocusIn>", lambda evt: frame.state(["focus"]))
-entry.bind("<FocusOut>", lambda evt: frame.state(["!focus"]))
-
-text = tkinter.Text(frame2, borderwidth=0, bg="white", highlightthickness=0)
-text.pack(fill='both', expand=1)
-text.bind("<FocusIn>", lambda evt: frame2.state(["focus"]))
-text.bind("<FocusOut>", lambda evt: frame2.state(["!focus"]))
-
-root.mainloop()
diff --git a/Demo/tkinter/ttk/theme_selector.py b/Demo/tkinter/ttk/theme_selector.py
deleted file mode 100644
index 09c5a7229f..0000000000
--- a/Demo/tkinter/ttk/theme_selector.py
+++ /dev/null
@@ -1,61 +0,0 @@
-"""Ttk Theme Selector v2.
-
-This is an improvement from the other theme selector (themes_combo.py)
-since now you can notice theme changes in Ttk Combobox, Ttk Frame,
-Ttk Label and Ttk Button.
-"""
-import tkinter
-from tkinter import ttk
-
-class App(ttk.Frame):
- def __init__(self):
- ttk.Frame.__init__(self, borderwidth=3)
-
- self.style = ttk.Style()
-
- # XXX Ideally I wouldn't want to create a Tkinter.IntVar to make
- # it works with Checkbutton variable option.
- self.theme_autochange = tkinter.IntVar(self, 0)
- self._setup_widgets()
-
- def _change_theme(self):
- self.style.theme_use(self.themes_combo.get())
-
- def _theme_sel_changed(self, widget):
- if self.theme_autochange.get():
- self._change_theme()
-
- def _setup_widgets(self):
- themes_lbl = ttk.Label(self, text="Themes")
-
- themes = self.style.theme_names()
- self.themes_combo = ttk.Combobox(self, values=themes, state="readonly")
- self.themes_combo.set(themes[0])
- self.themes_combo.bind("<<ComboboxSelected>>", self._theme_sel_changed)
-
- change_btn = ttk.Button(self, text='Change Theme',
- command=self._change_theme)
-
- theme_change_checkbtn = ttk.Checkbutton(self,
- text="Change themes when combobox item is activated",
- variable=self.theme_autochange)
-
- themes_lbl.grid(ipadx=6, sticky="w")
- self.themes_combo.grid(row=0, column=1, padx=6, sticky="ew")
- change_btn.grid(row=0, column=2, padx=6, sticky="e")
- theme_change_checkbtn.grid(row=1, columnspan=3, sticky="w", pady=6)
-
- top = self.winfo_toplevel()
- top.rowconfigure(0, weight=1)
- top.columnconfigure(0, weight=1)
- self.columnconfigure(1, weight=1)
- self.grid(row=0, column=0, sticky="nsew", columnspan=3, rowspan=2)
-
-
-def main():
- app = App()
- app.master.title("Theme Selector")
- app.mainloop()
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/tkinter/ttk/treeview_multicolumn.py b/Demo/tkinter/ttk/treeview_multicolumn.py
deleted file mode 100644
index be72237023..0000000000
--- a/Demo/tkinter/ttk/treeview_multicolumn.py
+++ /dev/null
@@ -1,107 +0,0 @@
-"""Demo based on the demo mclist included with tk source distribution."""
-import tkinter
-import tkinter.font
-from tkinter import ttk
-
-tree_columns = ("country", "capital", "currency")
-tree_data = [
- ("Argentina", "Buenos Aires", "ARS"),
- ("Australia", "Canberra", "AUD"),
- ("Brazil", "Brazilia", "BRL"),
- ("Canada", "Ottawa", "CAD"),
- ("China", "Beijing", "CNY"),
- ("France", "Paris", "EUR"),
- ("Germany", "Berlin", "EUR"),
- ("India", "New Delhi", "INR"),
- ("Italy", "Rome", "EUR"),
- ("Japan", "Tokyo", "JPY"),
- ("Mexico", "Mexico City", "MXN"),
- ("Russia", "Moscow", "RUB"),
- ("South Africa", "Pretoria", "ZAR"),
- ("United Kingdom", "London", "GBP"),
- ("United States", "Washington, D.C.", "USD")
- ]
-
-def sortby(tree, col, descending):
- """Sort tree contents when a column is clicked on."""
- # grab values to sort
- data = [(tree.set(child, col), child) for child in tree.get_children('')]
-
- # reorder data
- data.sort(reverse=descending)
- for indx, item in enumerate(data):
- tree.move(item[1], '', indx)
-
- # switch the heading so that it will sort in the opposite direction
- tree.heading(col,
- command=lambda col=col: sortby(tree, col, int(not descending)))
-
-class App(object):
- def __init__(self):
- self.tree = None
- self._setup_widgets()
- self._build_tree()
-
- def _setup_widgets(self):
- msg = ttk.Label(wraplength="4i", justify="left", anchor="n",
- padding=(10, 2, 10, 6),
- text=("Ttk is the new Tk themed widget set. One of the widgets it "
- "includes is a tree widget, which can be configured to "
- "display multiple columns of informational data without "
- "displaying the tree itself. This is a simple way to build "
- "a listbox that has multiple columns. Clicking on the "
- "heading for a column will sort the data by that column. "
- "You can also change the width of the columns by dragging "
- "the boundary between them."))
- msg.pack(fill='x')
-
- container = ttk.Frame()
- container.pack(fill='both', expand=True)
-
- # XXX Sounds like a good support class would be one for constructing
- # a treeview with scrollbars.
- self.tree = ttk.Treeview(columns=tree_columns, show="headings")
- vsb = ttk.Scrollbar(orient="vertical", command=self.tree.yview)
- hsb = ttk.Scrollbar(orient="horizontal", command=self.tree.xview)
- self.tree.configure(yscrollcommand=vsb.set, xscrollcommand=hsb.set)
- self.tree.grid(column=0, row=0, sticky='nsew', in_=container)
- vsb.grid(column=1, row=0, sticky='ns', in_=container)
- hsb.grid(column=0, row=1, sticky='ew', in_=container)
-
- container.grid_columnconfigure(0, weight=1)
- container.grid_rowconfigure(0, weight=1)
-
- def _build_tree(self):
- for col in tree_columns:
- self.tree.heading(col, text=col.title(),
- command=lambda c=col: sortby(self.tree, c, 0))
- # XXX tkFont.Font().measure expected args are incorrect according
- # to the Tk docs
- self.tree.column(col, width=tkinter.font.Font().measure(col.title()))
-
- for item in tree_data:
- self.tree.insert('', 'end', values=item)
-
- # adjust columns lenghts if necessary
- for indx, val in enumerate(item):
- ilen = tkinter.font.Font().measure(val)
- if self.tree.column(tree_columns[indx], width=None) < ilen:
- self.tree.column(tree_columns[indx], width=ilen)
-
-def main():
- root = tkinter.Tk()
- root.wm_title("Multi-Column List")
- root.wm_iconname("mclist")
-
- import plastik_theme
- try:
- plastik_theme.install('~/tile-themes/plastik/plastik')
- except Exception:
- import warnings
- warnings.warn("plastik theme being used without images")
-
- app = App()
- root.mainloop()
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/tkinter/ttk/ttkcalendar.py b/Demo/tkinter/ttk/ttkcalendar.py
deleted file mode 100644
index 8e35f1f9e6..0000000000
--- a/Demo/tkinter/ttk/ttkcalendar.py
+++ /dev/null
@@ -1,231 +0,0 @@
-"""
-Simple calendar using ttk Treeview together with calendar and datetime
-classes.
-"""
-import calendar
-import tkinter
-import tkinter.font
-from tkinter import ttk
-
-def get_calendar(locale, fwday):
- # instantiate proper calendar class
- if locale is None:
- return calendar.TextCalendar(fwday)
- else:
- return calendar.LocaleTextCalendar(fwday, locale)
-
-class Calendar(ttk.Frame):
- # XXX ToDo: cget and configure
-
- datetime = calendar.datetime.datetime
- timedelta = calendar.datetime.timedelta
-
- def __init__(self, master=None, **kw):
- """
- WIDGET-SPECIFIC OPTIONS
-
- locale, firstweekday, year, month, selectbackground,
- selectforeground
- """
- # remove custom options from kw before initializating ttk.Frame
- fwday = kw.pop('firstweekday', calendar.MONDAY)
- year = kw.pop('year', self.datetime.now().year)
- month = kw.pop('month', self.datetime.now().month)
- locale = kw.pop('locale', None)
- sel_bg = kw.pop('selectbackground', '#ecffc4')
- sel_fg = kw.pop('selectforeground', '#05640e')
-
- self._date = self.datetime(year, month, 1)
- self._selection = None # no date selected
-
- ttk.Frame.__init__(self, master, **kw)
-
- self._cal = get_calendar(locale, fwday)
-
- self.__setup_styles() # creates custom styles
- self.__place_widgets() # pack/grid used widgets
- self.__config_calendar() # adjust calendar columns and setup tags
- # configure a canvas, and proper bindings, for selecting dates
- self.__setup_selection(sel_bg, sel_fg)
-
- # store items ids, used for insertion later
- self._items = [self._calendar.insert('', 'end', values='')
- for _ in range(6)]
- # insert dates in the currently empty calendar
- self._build_calendar()
-
- # set the minimal size for the widget
- self._calendar.bind('<Map>', self.__minsize)
-
- def __setitem__(self, item, value):
- if item in ('year', 'month'):
- raise AttributeError("attribute '%s' is not writeable" % item)
- elif item == 'selectbackground':
- self._canvas['background'] = value
- elif item == 'selectforeground':
- self._canvas.itemconfigure(self._canvas.text, item=value)
- else:
- ttk.Frame.__setitem__(self, item, value)
-
- def __getitem__(self, item):
- if item in ('year', 'month'):
- return getattr(self._date, item)
- elif item == 'selectbackground':
- return self._canvas['background']
- elif item == 'selectforeground':
- return self._canvas.itemcget(self._canvas.text, 'fill')
- else:
- r = ttk.tclobjs_to_py({item: ttk.Frame.__getitem__(self, item)})
- return r[item]
-
- def __setup_styles(self):
- # custom ttk styles
- style = ttk.Style(self.master)
- arrow_layout = lambda dir: (
- [('Button.focus', {'children': [('Button.%sarrow' % dir, None)]})]
- )
- style.layout('L.TButton', arrow_layout('left'))
- style.layout('R.TButton', arrow_layout('right'))
-
- def __place_widgets(self):
- # header frame and its widgets
- hframe = ttk.Frame(self)
- lbtn = ttk.Button(hframe, style='L.TButton', command=self._prev_month)
- rbtn = ttk.Button(hframe, style='R.TButton', command=self._next_month)
- self._header = ttk.Label(hframe, width=15, anchor='center')
- # the calendar
- self._calendar = ttk.Treeview(show='', selectmode='none', height=7)
-
- # pack the widgets
- hframe.pack(in_=self, side='top', pady=4, anchor='center')
- lbtn.grid(in_=hframe)
- self._header.grid(in_=hframe, column=1, row=0, padx=12)
- rbtn.grid(in_=hframe, column=2, row=0)
- self._calendar.pack(in_=self, expand=1, fill='both', side='bottom')
-
- def __config_calendar(self):
- cols = self._cal.formatweekheader(3).split()
- self._calendar['columns'] = cols
- self._calendar.tag_configure('header', background='grey90')
- self._calendar.insert('', 'end', values=cols, tag='header')
- # adjust its columns width
- font = tkinter.font.Font()
- maxwidth = max(font.measure(col) for col in cols)
- for col in cols:
- self._calendar.column(col, width=maxwidth, minwidth=maxwidth,
- anchor='e')
-
- def __setup_selection(self, sel_bg, sel_fg):
- self._font = tkinter.font.Font()
- self._canvas = canvas = tkinter.Canvas(self._calendar,
- background=sel_bg, borderwidth=0, highlightthickness=0)
- canvas.text = canvas.create_text(0, 0, fill=sel_fg, anchor='w')
-
- canvas.bind('<ButtonPress-1>', lambda evt: canvas.place_forget())
- self._calendar.bind('<Configure>', lambda evt: canvas.place_forget())
- self._calendar.bind('<ButtonPress-1>', self._pressed)
-
- def __minsize(self, evt):
- width, height = self._calendar.master.geometry().split('x')
- height = height[:height.index('+')]
- self._calendar.master.minsize(width, height)
-
- def _build_calendar(self):
- year, month = self._date.year, self._date.month
-
- # update header text (Month, YEAR)
- header = self._cal.formatmonthname(year, month, 0)
- self._header['text'] = header.title()
-
- # update calendar shown dates
- cal = self._cal.monthdayscalendar(year, month)
- for indx, item in enumerate(self._items):
- week = cal[indx] if indx < len(cal) else []
- fmt_week = [('%02d' % day) if day else '' for day in week]
- self._calendar.item(item, values=fmt_week)
-
- def _show_selection(self, text, bbox):
- """Configure canvas for a new selection."""
- x, y, width, height = bbox
-
- textw = self._font.measure(text)
-
- canvas = self._canvas
- canvas.configure(width=width, height=height)
- canvas.coords(canvas.text, width - textw, height / 2 - 1)
- canvas.itemconfigure(canvas.text, text=text)
- canvas.place(in_=self._calendar, x=x, y=y)
-
- # Callbacks
-
- def _pressed(self, evt):
- """Clicked somewhere in the calendar."""
- x, y, widget = evt.x, evt.y, evt.widget
- item = widget.identify_row(y)
- column = widget.identify_column(x)
-
- if not column or not item in self._items:
- # clicked in the weekdays row or just outside the columns
- return
-
- item_values = widget.item(item)['values']
- if not len(item_values): # row is empty for this month
- return
-
- text = item_values[int(column[1]) - 1]
- if not text: # date is empty
- return
-
- bbox = widget.bbox(item, column)
- if not bbox: # calendar not visible yet
- return
-
- # update and then show selection
- text = '%02d' % text
- self._selection = (text, item, column)
- self._show_selection(text, bbox)
-
- def _prev_month(self):
- """Updated calendar to show the previous month."""
- self._canvas.place_forget()
-
- self._date = self._date - self.timedelta(days=1)
- self._date = self.datetime(self._date.year, self._date.month, 1)
- self._build_calendar() # reconstuct calendar
-
- def _next_month(self):
- """Update calendar to show the next month."""
- self._canvas.place_forget()
-
- year, month = self._date.year, self._date.month
- self._date = self._date + self.timedelta(
- days=calendar.monthrange(year, month)[1] + 1)
- self._date = self.datetime(self._date.year, self._date.month, 1)
- self._build_calendar() # reconstruct calendar
-
- # Properties
-
- @property
- def selection(self):
- """Return a datetime representing the current selected date."""
- if not self._selection:
- return None
-
- year, month = self._date.year, self._date.month
- return self.datetime(year, month, int(self._selection[0]))
-
-def test():
- import sys
- root = tkinter.Tk()
- root.title('Ttk Calendar')
- ttkcal = Calendar(firstweekday=calendar.SUNDAY)
- ttkcal.pack(expand=1, fill='both')
-
- if 'win' not in sys.platform:
- style = ttk.Style()
- style.theme_use('clam')
-
- root.mainloop()
-
-if __name__ == '__main__':
- test()
diff --git a/Demo/tkinter/ttk/widget_state.py b/Demo/tkinter/ttk/widget_state.py
deleted file mode 100644
index b68f13b89f..0000000000
--- a/Demo/tkinter/ttk/widget_state.py
+++ /dev/null
@@ -1,83 +0,0 @@
-"""Sample demo showing widget states and some font styling."""
-from tkinter import ttk
-
-states = ['active', 'disabled', 'focus', 'pressed', 'selected',
- 'background', 'readonly', 'alternate', 'invalid']
-
-for state in states[:]:
- states.append("!" + state)
-
-def reset_state(widget):
- nostate = states[len(states) // 2:]
- widget.state(nostate)
-
-class App(ttk.Frame):
- def __init__(self, title=None):
- ttk.Frame.__init__(self, borderwidth=6)
- self.master.title(title)
-
- self.style = ttk.Style()
-
- # get default font size and family
- btn_font = self.style.lookup("TButton", "font")
- fsize = str(self.tk.eval("font configure %s -size" % btn_font))
- self.font_family = self.tk.eval("font configure %s -family" % btn_font)
- if ' ' in self.font_family:
- self.font_family = '{%s}' % self.font_family
- self.fsize_prefix = fsize[0] if fsize[0] == '-' else ''
- self.base_fsize = int(fsize[1 if fsize[0] == '-' else 0:])
-
- # a list to hold all the widgets that will have their states changed
- self.update_widgets = []
-
- self._setup_widgets()
-
- def _set_font(self, extra=0):
- self.style.configure("TButton", font="%s %s%d" % (self.font_family,
- self.fsize_prefix, self.base_fsize + extra))
-
- def _new_state(self, widget, newtext):
- widget = self.nametowidget(widget)
-
- if not newtext:
- goodstates = ["disabled"]
- font_extra = 0
- else:
- # set widget state according to what has been entered in the entry
- newstates = set(newtext.split()) # eliminate duplicates
-
- # keep only the valid states
- goodstates = [state for state in newstates if state in states]
- # define a new font size based on amount of states
- font_extra = 2 * len(goodstates)
-
- # set new widget state
- for widget in self.update_widgets:
- reset_state(widget) # remove any previous state from the widget
- widget.state(goodstates)
-
- # update Ttk Button font size
- self._set_font(font_extra)
- return 1
-
- def _setup_widgets(self):
- btn = ttk.Button(self, text='Enter states and watch')
-
- entry = ttk.Entry(self, cursor='xterm', validate="key")
- entry['validatecommand'] = (self.register(self._new_state), '%W', '%P')
- entry.focus()
-
- self.update_widgets.append(btn)
- entry.validate()
-
- entry.pack(fill='x', padx=6)
- btn.pack(side='left', pady=6, padx=6, anchor='n')
- self.pack(fill='both', expand=1)
-
-
-def main():
- app = App("Widget State Tester")
- app.mainloop()
-
-if __name__ == "__main__":
- main()
diff --git a/Demo/turtle/tdemo_I_dontlike_tiltdemo.py b/Demo/turtle/tdemo_I_dontlike_tiltdemo.py
deleted file mode 100644
index 1d8652c888..0000000000
--- a/Demo/turtle/tdemo_I_dontlike_tiltdemo.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/python
-""" turtle-example-suite:
-
- tdemo-I_dont_like_tiltdemo.py
-
-Demostrates
- (a) use of a tilted ellipse as
- turtle shape
- (b) stamping that shape
-
-We can remove it, if you don't like it.
- Without using reset() ;-)
- ---------------------------------------
-"""
-from turtle import *
-import time
-
-def main():
- reset()
- shape("circle")
- resizemode("user")
-
- pu(); bk(24*18/6.283); rt(90); pd()
- tilt(45)
-
- pu()
-
- turtlesize(16,10,5)
- color("red", "violet")
- for i in range(18):
- fd(24)
- lt(20)
- stamp()
- color("red", "")
- for i in range(18):
- fd(24)
- lt(20)
- stamp()
-
- tilt(-15)
- turtlesize(3, 1, 4)
- color("blue", "yellow")
- for i in range(17):
- fd(24)
- lt(20)
- if i%2 == 0:
- stamp()
- time.sleep(1)
- while undobufferentries():
- undo()
- ht()
- write("OK, OVER!", align="center", font=("Courier", 18, "bold"))
- return "Done!"
-
-if __name__=="__main__":
- msg = main()
- print(msg)
-# mainloop()
diff --git a/Demo/xml/elem_count.py b/Demo/xml/elem_count.py
deleted file mode 100644
index 99d6ca9498..0000000000
--- a/Demo/xml/elem_count.py
+++ /dev/null
@@ -1,42 +0,0 @@
-"""
-A simple demo that reads in an XML document and displays the number of
-elements and attributes as well as a tally of elements and attributes by name.
-"""
-
-import sys
-from collections import defaultdict
-
-from xml.sax import make_parser, handler
-
-class FancyCounter(handler.ContentHandler):
-
- def __init__(self):
- self._elems = 0
- self._attrs = 0
- self._elem_types = defaultdict(int)
- self._attr_types = defaultdict(int)
-
- def startElement(self, name, attrs):
- self._elems += 1
- self._attrs += len(attrs)
- self._elem_types[name] += 1
-
- for name in attrs.keys():
- self._attr_types[name] += 1
-
- def endDocument(self):
- print("There were", self._elems, "elements.")
- print("There were", self._attrs, "attributes.")
-
- print("---ELEMENT TYPES")
- for pair in self._elem_types.items():
- print("%20s %d" % pair)
-
- print("---ATTRIBUTE TYPES")
- for pair in self._attr_types.items():
- print("%20s %d" % pair)
-
-if __name__ == '__main__':
- parser = make_parser()
- parser.setContentHandler(FancyCounter())
- parser.parse(sys.argv[1])
diff --git a/Demo/xml/roundtrip.py b/Demo/xml/roundtrip.py
deleted file mode 100644
index 801c0092fe..0000000000
--- a/Demo/xml/roundtrip.py
+++ /dev/null
@@ -1,46 +0,0 @@
-"""
-A simple demo that reads in an XML document and spits out an equivalent,
-but not necessarily identical, document.
-"""
-
-import sys
-
-from xml.sax import saxutils, handler, make_parser
-
-# --- The ContentHandler
-
-class ContentGenerator(handler.ContentHandler):
-
- def __init__(self, out=sys.stdout):
- handler.ContentHandler.__init__(self)
- self._out = out
-
- # ContentHandler methods
-
- def startDocument(self):
- self._out.write('<?xml version="1.0" encoding="iso-8859-1"?>\n')
-
- def startElement(self, name, attrs):
- self._out.write('<' + name)
- for (name, value) in attrs.items():
- self._out.write(' %s="%s"' % (name, saxutils.escape(value)))
- self._out.write('>')
-
- def endElement(self, name):
- self._out.write('</%s>' % name)
-
- def characters(self, content):
- self._out.write(saxutils.escape(content))
-
- def ignorableWhitespace(self, content):
- self._out.write(content)
-
- def processingInstruction(self, target, data):
- self._out.write('<?%s %s?>' % (target, data))
-
-# --- The main program
-
-if __name__ == '__main__':
- parser = make_parser()
- parser.setContentHandler(ContentGenerator())
- parser.parse(sys.argv[1])
diff --git a/Demo/xml/rss2html.py b/Demo/xml/rss2html.py
deleted file mode 100644
index 49cd154ecd..0000000000
--- a/Demo/xml/rss2html.py
+++ /dev/null
@@ -1,97 +0,0 @@
-"""
-A demo that reads in an RSS XML document and emits an HTML file containing
-a list of the individual items in the feed.
-"""
-
-import sys
-import codecs
-
-from xml.sax import make_parser, handler
-
-# --- Templates
-
-top = """\
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
-<head>
- <title>%s</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-</head>
-
-<body>
-<h1>%s</h1>
-"""
-
-bottom = """
-</ul>
-
-<hr>
-<address>
-Converted to HTML by rss2html.py.
-</address>
-
-</body>
-</html>
-"""
-
-# --- The ContentHandler
-
-class RSSHandler(handler.ContentHandler):
-
- def __init__(self, out=sys.stdout):
- handler.ContentHandler.__init__(self)
- self._out = out
-
- self._text = ""
- self._parent = None
- self._list_started = False
- self._title = None
- self._link = None
- self._descr = ""
-
- # ContentHandler methods
-
- def startElement(self, name, attrs):
- if name == "channel" or name == "image" or name == "item":
- self._parent = name
-
- self._text = ""
-
- def endElement(self, name):
- if self._parent == "channel":
- if name == "title":
- self._out.write(top % (self._text, self._text))
- elif name == "description":
- self._out.write("<p>%s</p>\n" % self._text)
-
- elif self._parent == "item":
- if name == "title":
- self._title = self._text
- elif name == "link":
- self._link = self._text
- elif name == "description":
- self._descr = self._text
- elif name == "item":
- if not self._list_started:
- self._out.write("<ul>\n")
- self._list_started = True
-
- self._out.write(' <li><a href="%s">%s</a> %s\n' %
- (self._link, self._title, self._descr))
-
- self._title = None
- self._link = None
- self._descr = ""
-
- if name == "rss":
- self._out.write(bottom)
-
- def characters(self, content):
- self._text = self._text + content
-
-# --- Main program
-
-if __name__ == '__main__':
- parser = make_parser()
- parser.setContentHandler(RSSHandler())
- parser.parse(sys.argv[1])
diff --git a/Demo/zlib/minigzip.py b/Demo/zlib/minigzip.py
deleted file mode 100755
index 28d8b2664d..0000000000
--- a/Demo/zlib/minigzip.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/usr/bin/env python
-# Demo program for zlib; it compresses or decompresses files, but *doesn't*
-# delete the original. This doesn't support all of gzip's options.
-#
-# The 'gzip' module in the standard library provides a more complete
-# implementation of gzip-format files.
-
-import zlib, sys, os
-
-FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16
-
-def write32(output, value):
- output.write(chr(value & 255)) ; value=value // 256
- output.write(chr(value & 255)) ; value=value // 256
- output.write(chr(value & 255)) ; value=value // 256
- output.write(chr(value & 255))
-
-def read32(input):
- v = ord(input.read(1))
- v += (ord(input.read(1)) << 8 )
- v += (ord(input.read(1)) << 16)
- v += (ord(input.read(1)) << 24)
- return v
-
-def compress (filename, input, output):
- output.write('\037\213\010') # Write the header, ...
- output.write(chr(FNAME)) # ... flag byte ...
-
- statval = os.stat(filename) # ... modification time ...
- mtime = statval[8]
- write32(output, mtime)
- output.write('\002') # ... slowest compression alg. ...
- output.write('\377') # ... OS (=unknown) ...
- output.write(filename+'\000') # ... original filename ...
-
- crcval = zlib.crc32("")
- compobj = zlib.compressobj(9, zlib.DEFLATED, -zlib.MAX_WBITS,
- zlib.DEF_MEM_LEVEL, 0)
- while True:
- data = input.read(1024)
- if data == "":
- break
- crcval = zlib.crc32(data, crcval)
- output.write(compobj.compress(data))
- output.write(compobj.flush())
- write32(output, crcval) # ... the CRC ...
- write32(output, statval[6]) # and the file size.
-
-def decompress (input, output):
- magic = input.read(2)
- if magic != '\037\213':
- print('Not a gzipped file')
- sys.exit(0)
- if ord(input.read(1)) != 8:
- print('Unknown compression method')
- sys.exit(0)
- flag = ord(input.read(1))
- input.read(4+1+1) # Discard modification time,
- # extra flags, and OS byte.
- if flag & FEXTRA:
- # Read & discard the extra field, if present
- xlen = ord(input.read(1))
- xlen += 256*ord(input.read(1))
- input.read(xlen)
- if flag & FNAME:
- # Read and discard a null-terminated string containing the filename
- while True:
- s = input.read(1)
- if s == '\0': break
- if flag & FCOMMENT:
- # Read and discard a null-terminated string containing a comment
- while True:
- s=input.read(1)
- if s=='\0': break
- if flag & FHCRC:
- input.read(2) # Read & discard the 16-bit header CRC
-
- decompobj = zlib.decompressobj(-zlib.MAX_WBITS)
- crcval = zlib.crc32("")
- length = 0
- while True:
- data=input.read(1024)
- if data == "":
- break
- decompdata = decompobj.decompress(data)
- output.write(decompdata)
- length += len(decompdata)
- crcval = zlib.crc32(decompdata, crcval)
-
- decompdata = decompobj.flush()
- output.write(decompdata)
- length += len(decompdata)
- crcval = zlib.crc32(decompdata, crcval)
-
- # We've read to the end of the file, so we have to rewind in order
- # to reread the 8 bytes containing the CRC and the file size. The
- # decompressor is smart and knows when to stop, so feeding it
- # extra data is harmless.
- input.seek(-8, 2)
- crc32 = read32(input)
- isize = read32(input)
- if crc32 != crcval:
- print('CRC check failed.')
- if isize != length:
- print('Incorrect length of data produced')
-
-def main():
- if len(sys.argv)!=2:
- print('Usage: minigzip.py <filename>')
- print(' The file will be compressed or decompressed.')
- sys.exit(0)
-
- filename = sys.argv[1]
- if filename.endswith('.gz'):
- compressing = False
- outputname = filename[:-3]
- else:
- compressing = True
- outputname = filename + '.gz'
-
- input = open(filename, 'rb')
- output = open(outputname, 'wb')
-
- if compressing:
- compress(filename, input, output)
- else:
- decompress(input, output)
-
- input.close()
- output.close()
-
-if __name__ == '__main__':
- main()
diff --git a/Demo/zlib/zlibdemo.py b/Demo/zlib/zlibdemo.py
deleted file mode 100755
index 53463dd6cd..0000000000
--- a/Demo/zlib/zlibdemo.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-
-# Takes an optional filename, defaulting to this file itself.
-# Reads the file and compresses the content using level 1 and level 9
-# compression, printing a summary of the results.
-
-import zlib, sys
-
-def main():
- if len(sys.argv) > 1:
- filename = sys.argv[1]
- else:
- filename = sys.argv[0]
- print('Reading', filename)
-
- f = open(filename, 'rb') # Get the data to compress
- s = f.read()
- f.close()
-
- # First, we'll compress the string in one step
- comptext = zlib.compress(s, 1)
- decomp = zlib.decompress(comptext)
-
- print('1-step compression: (level 1)')
- print(' Original:', len(s), 'Compressed:', len(comptext), end=' ')
- print('Uncompressed:', len(decomp))
-
- # Now, let's compress the string in stages; set chunk to work in smaller steps
-
- chunk = 256
- compressor = zlib.compressobj(9)
- decompressor = zlib.decompressobj()
- comptext = decomp = ''
- for i in range(0, len(s), chunk):
- comptext = comptext+compressor.compress(s[i:i+chunk])
- # Don't forget to call flush()!!
- comptext = comptext + compressor.flush()
-
- for i in range(0, len(comptext), chunk):
- decomp = decomp + decompressor.decompress(comptext[i:i+chunk])
- decomp=decomp+decompressor.flush()
-
- print('Progressive compression (level 9):')
- print(' Original:', len(s), 'Compressed:', len(comptext), end=' ')
- print('Uncompressed:', len(decomp))
-
-if __name__ == '__main__':
- main()
diff --git a/Doc/ACKS.txt b/Doc/ACKS.txt
index 73d4e13d55..7f67d36cbb 100644
--- a/Doc/ACKS.txt
+++ b/Doc/ACKS.txt
@@ -120,6 +120,7 @@ docs@python.org), and we'll be glad to correct the problem.
* Robert Lehmann
* Marc-André Lemburg
* Ross Light
+ * Gediminas Liktaras
* Ulf A. Lindgren
* Everett Lipman
* Mirko Liss
@@ -213,6 +214,7 @@ docs@python.org), and we'll be glad to correct the problem.
* Mats Wichmann
* Gerry Wiener
* Timothy Wild
+ * Paul Winkler
* Collin Winter
* Blake Winton
* Dan Wolfe
diff --git a/Doc/Makefile b/Doc/Makefile
index 8fcf538573..a1ffe63aa2 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -26,6 +26,7 @@ help:
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " text to make plain text files"
+ @echo " epub to make EPUB files"
@echo " changes to make an overview over all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " coverage to check documentation coverage for library and C API"
@@ -34,12 +35,13 @@ help:
@echo " dist to create a \"dist\" directory with archived docs for download"
@echo " suspicious to check for suspicious markup in output text"
@echo " check to run a check for frequent markup errors"
+ @echo " serve to serve the documentation on the localhost (8000)"
# Note: if you update versions here, do the same in make.bat and README.txt
checkout:
@if [ ! -d tools/sphinx ]; then \
echo "Checking out Sphinx..."; \
- svn checkout $(SVNROOT)/external/Sphinx-0.6.5/sphinx tools/sphinx; \
+ svn checkout $(SVNROOT)/external/Sphinx-1.0.7/sphinx tools/sphinx; \
fi
@if [ ! -d tools/docutils ]; then \
echo "Checking out Docutils..."; \
@@ -80,6 +82,10 @@ text: BUILDER = text
text: build
@echo "Build finished; the text files are in build/text."
+epub: BUILDER = epub
+epub: build
+ @echo "Build finished; the epub files are in build/epub."
+
changes: BUILDER = changes
changes: build
@echo "The overview file is in build/changes."
@@ -157,9 +163,23 @@ dist:
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
+ # archive the epub build
+ rm -rf build/epub
+ make epub
+ mkdir -p dist/python-$(DISTVERSION)-docs-epub
+ cp -pPR build/epub/*.epub dist/python-$(DISTVERSION)-docs-epub/
+ tar -C dist -cf dist/python-$(DISTVERSION)-docs-epub.tar python-$(DISTVERSION)-docs-epub
+ bzip2 -9 -k dist/python-$(DISTVERSION)-docs-epub.tar
+ (cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-epub.zip python-$(DISTVERSION)-docs-epub)
+ rm -r dist/python-$(DISTVERSION)-docs-epub
+ rm dist/python-$(DISTVERSION)-docs-epub.tar
+
check:
$(PYTHON) tools/rstlint.py -i tools
+serve:
+ ../Tools/scripts/serve.py build/html
+
# Targets for daily automated doc build
# for development releases: always build
diff --git a/Doc/README.txt b/Doc/README.txt
index 7a561c0d84..50c199edab 100644
--- a/Doc/README.txt
+++ b/Doc/README.txt
@@ -54,6 +54,9 @@ Available make targets are:
* "text", which builds a plain text file for each source file.
+ * "epub", which builds an EPUB document, suitable to be viewed on e-book
+ readers.
+
* "linkcheck", which checks all external references to see whether they are
broken, redirected or malformed, and outputs this information to stdout as
well as a plain-text (.txt) file.
@@ -78,7 +81,7 @@ Without make
You'll need to install the Sphinx package, either by checking it out via ::
- svn co http://svn.python.org/projects/external/Sphinx-0.6.5/sphinx tools/sphinx
+ svn co http://svn.python.org/projects/external/Sphinx-1.0.7/sphinx tools/sphinx
or by installing it from PyPI.
@@ -132,7 +135,7 @@ The Python source is copyrighted, but you can freely use and copy it
as long as you don't change or remove the copyright notice:
----------------------------------------------------------------------
-Copyright (c) 2000-2008 Python Software Foundation.
+Copyright (c) 2000-2011 Python Software Foundation.
All rights reserved.
Copyright (c) 2000 BeOpen.com.
diff --git a/Doc/c-api/abstract.rst b/Doc/c-api/abstract.rst
index aba804d5c3..ad53881112 100644
--- a/Doc/c-api/abstract.rst
+++ b/Doc/c-api/abstract.rst
@@ -12,7 +12,7 @@ sequence types). When used on object types for which they do not apply, they
will raise a Python exception.
It is not possible to use these functions on objects that are not properly
-initialized, such as a list object that has been created by :cfunc:`PyList_New`,
+initialized, such as a list object that has been created by :c:func:`PyList_New`,
but whose items have not been set to some non-\ ``NULL`` value yet.
.. toctree::
diff --git a/Doc/c-api/allocation.rst b/Doc/c-api/allocation.rst
index b64381bf39..e8f60bfcf4 100644
--- a/Doc/c-api/allocation.rst
+++ b/Doc/c-api/allocation.rst
@@ -6,13 +6,13 @@ Allocating Objects on the Heap
==============================
-.. cfunction:: PyObject* _PyObject_New(PyTypeObject *type)
+.. c:function:: PyObject* _PyObject_New(PyTypeObject *type)
-.. cfunction:: PyVarObject* _PyObject_NewVar(PyTypeObject *type, Py_ssize_t size)
+.. c:function:: PyVarObject* _PyObject_NewVar(PyTypeObject *type, Py_ssize_t size)
-.. cfunction:: PyObject* PyObject_Init(PyObject *op, PyTypeObject *type)
+.. c:function:: PyObject* PyObject_Init(PyObject *op, PyTypeObject *type)
Initialize a newly-allocated object *op* with its type and initial
reference. Returns the initialized object. If *type* indicates that the
@@ -21,13 +21,13 @@ Allocating Objects on the Heap
affected.
-.. cfunction:: PyVarObject* PyObject_InitVar(PyVarObject *op, PyTypeObject *type, Py_ssize_t size)
+.. c:function:: PyVarObject* PyObject_InitVar(PyVarObject *op, PyTypeObject *type, Py_ssize_t size)
- This does everything :cfunc:`PyObject_Init` does, and also initializes the
+ This does everything :c:func:`PyObject_Init` does, and also initializes the
length information for a variable-size object.
-.. cfunction:: TYPE* PyObject_New(TYPE, PyTypeObject *type)
+.. c:function:: TYPE* PyObject_New(TYPE, PyTypeObject *type)
Allocate a new Python object using the C structure type *TYPE* and the
Python type object *type*. Fields not defined by the Python object header
@@ -36,7 +36,7 @@ Allocating Objects on the Heap
the type object.
-.. cfunction:: TYPE* PyObject_NewVar(TYPE, PyTypeObject *type, Py_ssize_t size)
+.. c:function:: TYPE* PyObject_NewVar(TYPE, PyTypeObject *type, Py_ssize_t size)
Allocate a new Python object using the C structure type *TYPE* and the
Python type object *type*. Fields not defined by the Python object header
@@ -48,24 +48,24 @@ Allocating Objects on the Heap
improving the memory management efficiency.
-.. cfunction:: void PyObject_Del(PyObject *op)
+.. c:function:: void PyObject_Del(PyObject *op)
- Releases memory allocated to an object using :cfunc:`PyObject_New` or
- :cfunc:`PyObject_NewVar`. This is normally called from the
+ Releases memory allocated to an object using :c:func:`PyObject_New` or
+ :c:func:`PyObject_NewVar`. This is normally called from the
:attr:`tp_dealloc` handler specified in the object's type. The fields of
the object should not be accessed after this call as the memory is no
longer a valid Python object.
-.. cvar:: PyObject _Py_NoneStruct
+.. c:var:: PyObject _Py_NoneStruct
Object which is visible in Python as ``None``. This should only be accessed
- using the :cmacro:`Py_None` macro, which evaluates to a pointer to this
+ using the :c:macro:`Py_None` macro, which evaluates to a pointer to this
object.
.. seealso::
- :cfunc:`PyModule_Create`
+ :c:func:`PyModule_Create`
To allocate and create extension modules.
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index 21cebe9086..d4dda7c693 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -9,8 +9,8 @@ These functions are useful when creating your own extensions functions and
methods. Additional information and examples are available in
:ref:`extending-index`.
-The first three of these functions described, :cfunc:`PyArg_ParseTuple`,
-:cfunc:`PyArg_ParseTupleAndKeywords`, and :cfunc:`PyArg_Parse`, all use *format
+The first three of these functions described, :c:func:`PyArg_ParseTuple`,
+:c:func:`PyArg_ParseTupleAndKeywords`, and :c:func:`PyArg_Parse`, all use *format
strings* which are used to tell the function about the expected arguments. The
format strings use the same syntax for each of these functions.
@@ -35,23 +35,23 @@ You don't have to provide raw storage for the returned unicode or bytes
area. Also, you won't have to release any memory yourself, except with the
``es``, ``es#``, ``et`` and ``et#`` formats.
-However, when a :ctype:`Py_buffer` structure gets filled, the underlying
+However, when a :c:type:`Py_buffer` structure gets filled, the underlying
buffer is locked so that the caller can subsequently use the buffer even
-inside a :ctype:`Py_BEGIN_ALLOW_THREADS` block without the risk of mutable data
+inside a :c:type:`Py_BEGIN_ALLOW_THREADS` block without the risk of mutable data
being resized or destroyed. As a result, **you have to call**
-:cfunc:`PyBuffer_Release` after you have finished processing the data (or
+:c:func:`PyBuffer_Release` after you have finished processing the data (or
in any early abort case).
Unless otherwise stated, buffers are not NUL-terminated.
.. note::
For all ``#`` variants of formats (``s#``, ``y#``, etc.), the type of
- the length argument (int or :ctype:`Py_ssize_t`) is controlled by
- defining the macro :cmacro:`PY_SSIZE_T_CLEAN` before including
+ the length argument (int or :c:type:`Py_ssize_t`) is controlled by
+ defining the macro :c:macro:`PY_SSIZE_T_CLEAN` before including
:file:`Python.h`. If the macro was defined, length is a
- :ctype:`Py_ssize_t` rather than an :ctype:`int`. This behavior will change
- in a future Python version to only support :ctype:`Py_ssize_t` and
- drop :ctype:`int` support. It is best to always define :cmacro:`PY_SSIZE_T_CLEAN`.
+ :c:type:`Py_ssize_t` rather than an :c:type:`int`. This behavior will change
+ in a future Python version to only support :c:type:`Py_ssize_t` and
+ drop :c:type:`int` support. It is best to always define :c:macro:`PY_SSIZE_T_CLEAN`.
``s`` (:class:`str`) [const char \*]
@@ -66,17 +66,17 @@ Unless otherwise stated, buffers are not NUL-terminated.
.. note::
This format does not accept bytes-like objects. If you want to accept
filesystem paths and convert them to C character strings, it is
- preferable to use the ``O&`` format with :cfunc:`PyUnicode_FSConverter`
+ preferable to use the ``O&`` format with :c:func:`PyUnicode_FSConverter`
as *converter*.
``s*`` (:class:`str`, :class:`bytes`, :class:`bytearray` or buffer compatible object) [Py_buffer]
This format accepts Unicode objects as well as objects supporting the
buffer protocol.
- It fills a :ctype:`Py_buffer` structure provided by the caller.
+ It fills a :c:type:`Py_buffer` structure provided by the caller.
In this case the resulting C string may contain embedded NUL bytes.
Unicode objects are converted to C strings using ``'utf-8'`` encoding.
-``s#`` (:class:`str`, :class:`bytes` or read-only buffer compatible object) [const char \*, int or :ctype:`Py_ssize_t`]
+``s#`` (:class:`str`, :class:`bytes` or read-only buffer compatible object) [const char \*, int or :c:type:`Py_ssize_t`]
Like ``s*``, except that it doesn't accept mutable buffer-like objects
such as :class:`bytearray`. The result is stored into two C variables,
the first one a pointer to a C string, the second one its length.
@@ -89,7 +89,7 @@ Unless otherwise stated, buffers are not NUL-terminated.
``z*`` (:class:`str`, :class:`bytes`, :class:`bytearray`, buffer compatible object or ``None``) [Py_buffer]
Like ``s*``, but the Python object may also be ``None``, in which case the
- ``buf`` member of the :ctype:`Py_buffer` structure is set to *NULL*.
+ ``buf`` member of the :c:type:`Py_buffer` structure is set to *NULL*.
``z#`` (:class:`str`, :class:`bytes`, read-only buffer compatible object or ``None``) [const char \*, int]
Like ``s#``, but the Python object may also be ``None``, in which case the C
@@ -113,19 +113,21 @@ Unless otherwise stated, buffers are not NUL-terminated.
``S`` (:class:`bytes`) [PyBytesObject \*]
Requires that the Python object is a :class:`bytes` object, without
attempting any conversion. Raises :exc:`TypeError` if the object is not
- a bytes object. The C variable may also be declared as :ctype:`PyObject\*`.
+ a bytes object. The C variable may also be declared as :c:type:`PyObject\*`.
``Y`` (:class:`bytearray`) [PyByteArrayObject \*]
Requires that the Python object is a :class:`bytearray` object, without
attempting any conversion. Raises :exc:`TypeError` if the object is not
- a :class:`bytearray` object. The C variable may also be declared as :ctype:`PyObject\*`.
+ a :class:`bytearray` object. The C variable may also be declared as :c:type:`PyObject\*`.
``u`` (:class:`str`) [Py_UNICODE \*]
Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of
- Unicode characters. You must pass the address of a :ctype:`Py_UNICODE`
+ Unicode characters. You must pass the address of a :c:type:`Py_UNICODE`
pointer variable, which will be filled with the pointer to an existing
- Unicode buffer. Please note that the width of a :ctype:`Py_UNICODE`
+ Unicode buffer. Please note that the width of a :c:type:`Py_UNICODE`
character depends on compilation options (it is either 16 or 32 bits).
+ The Python string must not contain embedded NUL characters; if it does,
+ a :exc:`TypeError` exception is raised.
.. note::
Since ``u`` doesn't give you back the length of the string, and it
@@ -138,55 +140,38 @@ Unless otherwise stated, buffers are not NUL-terminated.
``Z`` (:class:`str` or ``None``) [Py_UNICODE \*]
Like ``u``, but the Python object may also be ``None``, in which case the
- :ctype:`Py_UNICODE` pointer is set to *NULL*.
+ :c:type:`Py_UNICODE` pointer is set to *NULL*.
``Z#`` (:class:`str` or ``None``) [Py_UNICODE \*, int]
Like ``u#``, but the Python object may also be ``None``, in which case the
- :ctype:`Py_UNICODE` pointer is set to *NULL*.
+ :c:type:`Py_UNICODE` pointer is set to *NULL*.
``U`` (:class:`str`) [PyUnicodeObject \*]
Requires that the Python object is a Unicode object, without attempting
any conversion. Raises :exc:`TypeError` if the object is not a Unicode
- object. The C variable may also be declared as :ctype:`PyObject\*`.
-
-``t#`` (:class:`bytes`, :class:`bytearray` or read-only character buffer) [char \*, int]
- Like ``s#``, but accepts any object which implements the read-only buffer
- interface. The :ctype:`char\*` variable is set to point to the first byte of
- the buffer, and the :ctype:`int` is set to the length of the buffer. Only
- single-segment buffer objects are accepted; :exc:`TypeError` is raised for all
- others.
-
-``w`` (:class:`bytearray` or read-write character buffer) [char \*]
- Similar to ``y``, but accepts any object which implements the read-write buffer
- interface. The caller must determine the length of the buffer by other means,
- or use ``w#`` instead. Only single-segment buffer objects are accepted;
- :exc:`TypeError` is raised for all others.
+ object. The C variable may also be declared as :c:type:`PyObject\*`.
``w*`` (:class:`bytearray` or read-write byte-oriented buffer) [Py_buffer]
- This is to ``w`` what ``y*`` is to ``y``.
-
-``w#`` (:class:`bytearray` or read-write character buffer) [char \*, int]
- Like ``y#``, but accepts any object which implements the read-write buffer
- interface. The :ctype:`char \*` variable is set to point to the first byte
- of the buffer, and the :ctype:`int` is set to the length of the buffer.
- Only single-segment buffer objects are accepted; :exc:`TypeError` is raised
- for all others.
+ This format accepts any object which implements the read-write buffer
+ interface. It fills a :c:type:`Py_buffer` structure provided by the caller.
+ The buffer may contain embedded null bytes. The caller have to call
+ :c:func:`PyBuffer_Release` when it is done with the buffer.
``es`` (:class:`str`) [const char \*encoding, char \*\*buffer]
This variant on ``s`` is used for encoding Unicode into a character buffer.
It only works for encoded data without embedded NUL bytes.
This format requires two arguments. The first is only used as input, and
- must be a :ctype:`const char\*` which points to the name of an encoding as a
+ must be a :c:type:`const char\*` which points to the name of an encoding as a
NUL-terminated string, or *NULL*, in which case ``'utf-8'`` encoding is used.
An exception is raised if the named encoding is not known to Python. The
- second argument must be a :ctype:`char\*\*`; the value of the pointer it
+ second argument must be a :c:type:`char\*\*`; the value of the pointer it
references will be set to a buffer with the contents of the argument text.
The text will be encoded in the encoding specified by the first argument.
- :cfunc:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy the
+ :c:func:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy the
encoded data into this buffer and adjust *\*buffer* to reference the newly
- allocated storage. The caller is responsible for calling :cfunc:`PyMem_Free` to
+ allocated storage. The caller is responsible for calling :c:func:`PyMem_Free` to
free the allocated buffer after use.
``et`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char \*encoding, char \*\*buffer]
@@ -200,10 +185,10 @@ Unless otherwise stated, buffers are not NUL-terminated.
characters.
It requires three arguments. The first is only used as input, and must be a
- :ctype:`const char\*` which points to the name of an encoding as a
+ :c:type:`const char\*` which points to the name of an encoding as a
NUL-terminated string, or *NULL*, in which case ``'utf-8'`` encoding is used.
An exception is raised if the named encoding is not known to Python. The
- second argument must be a :ctype:`char\*\*`; the value of the pointer it
+ second argument must be a :c:type:`char\*\*`; the value of the pointer it
references will be set to a buffer with the contents of the argument text.
The text will be encoded in the encoding specified by the first argument.
The third argument must be a pointer to an integer; the referenced integer
@@ -214,10 +199,10 @@ Unless otherwise stated, buffers are not NUL-terminated.
If *\*buffer* points a *NULL* pointer, the function will allocate a buffer of
the needed size, copy the encoded data into this buffer and set *\*buffer* to
reference the newly allocated storage. The caller is responsible for calling
- :cfunc:`PyMem_Free` to free the allocated buffer after usage.
+ :c:func:`PyMem_Free` to free the allocated buffer after usage.
If *\*buffer* points to a non-*NULL* pointer (an already allocated buffer),
- :cfunc:`PyArg_ParseTuple` will use this location as the buffer and interpret the
+ :c:func:`PyArg_ParseTuple` will use this location as the buffer and interpret the
initial value of *\*buffer_length* as the buffer size. It will then copy the
encoded data into the buffer and NUL-terminate it. If the buffer is not large
enough, a :exc:`ValueError` will be set.
@@ -235,62 +220,62 @@ Numbers
``b`` (:class:`int`) [unsigned char]
Convert a nonnegative Python integer to an unsigned tiny int, stored in a C
- :ctype:`unsigned char`.
+ :c:type:`unsigned char`.
``B`` (:class:`int`) [unsigned char]
Convert a Python integer to a tiny int without overflow checking, stored in a C
- :ctype:`unsigned char`.
+ :c:type:`unsigned char`.
``h`` (:class:`int`) [short int]
- Convert a Python integer to a C :ctype:`short int`.
+ Convert a Python integer to a C :c:type:`short int`.
``H`` (:class:`int`) [unsigned short int]
- Convert a Python integer to a C :ctype:`unsigned short int`, without overflow
+ Convert a Python integer to a C :c:type:`unsigned short int`, without overflow
checking.
``i`` (:class:`int`) [int]
- Convert a Python integer to a plain C :ctype:`int`.
+ Convert a Python integer to a plain C :c:type:`int`.
``I`` (:class:`int`) [unsigned int]
- Convert a Python integer to a C :ctype:`unsigned int`, without overflow
+ Convert a Python integer to a C :c:type:`unsigned int`, without overflow
checking.
``l`` (:class:`int`) [long int]
- Convert a Python integer to a C :ctype:`long int`.
+ Convert a Python integer to a C :c:type:`long int`.
``k`` (:class:`int`) [unsigned long]
- Convert a Python integer to a C :ctype:`unsigned long` without
+ Convert a Python integer to a C :c:type:`unsigned long` without
overflow checking.
``L`` (:class:`int`) [PY_LONG_LONG]
- Convert a Python integer to a C :ctype:`long long`. This format is only
- available on platforms that support :ctype:`long long` (or :ctype:`_int64` on
+ Convert a Python integer to a C :c:type:`long long`. This format is only
+ available on platforms that support :c:type:`long long` (or :c:type:`_int64` on
Windows).
``K`` (:class:`int`) [unsigned PY_LONG_LONG]
- Convert a Python integer to a C :ctype:`unsigned long long`
+ Convert a Python integer to a C :c:type:`unsigned long long`
without overflow checking. This format is only available on platforms that
- support :ctype:`unsigned long long` (or :ctype:`unsigned _int64` on Windows).
+ support :c:type:`unsigned long long` (or :c:type:`unsigned _int64` on Windows).
``n`` (:class:`int`) [Py_ssize_t]
- Convert a Python integer to a C :ctype:`Py_ssize_t`.
+ Convert a Python integer to a C :c:type:`Py_ssize_t`.
``c`` (:class:`bytes` of length 1) [char]
Convert a Python byte, represented as a :class:`bytes` object of length 1,
- to a C :ctype:`char`.
+ to a C :c:type:`char`.
``C`` (:class:`str` of length 1) [int]
Convert a Python character, represented as a :class:`str` object of
- length 1, to a C :ctype:`int`.
+ length 1, to a C :c:type:`int`.
``f`` (:class:`float`) [float]
- Convert a Python floating point number to a C :ctype:`float`.
+ Convert a Python floating point number to a C :c:type:`float`.
``d`` (:class:`float`) [double]
- Convert a Python floating point number to a C :ctype:`double`.
+ Convert a Python floating point number to a C :c:type:`double`.
``D`` (:class:`complex`) [Py_complex]
- Convert a Python complex number to a C :ctype:`Py_complex` structure.
+ Convert a Python complex number to a C :c:type:`Py_complex` structure.
Other objects
-------------
@@ -303,20 +288,20 @@ Other objects
``O!`` (object) [*typeobject*, PyObject \*]
Store a Python object in a C object pointer. This is similar to ``O``, but
takes two C arguments: the first is the address of a Python type object, the
- second is the address of the C variable (of type :ctype:`PyObject\*`) into which
+ second is the address of the C variable (of type :c:type:`PyObject\*`) into which
the object pointer is stored. If the Python object does not have the required
type, :exc:`TypeError` is raised.
``O&`` (object) [*converter*, *anything*]
Convert a Python object to a C variable through a *converter* function. This
takes two arguments: the first is a function, the second is the address of a C
- variable (of arbitrary type), converted to :ctype:`void \*`. The *converter*
+ variable (of arbitrary type), converted to :c:type:`void \*`. The *converter*
function in turn is called as follows::
status = converter(object, address);
where *object* is the Python object to be converted and *address* is the
- :ctype:`void\*` argument that was passed to the :cfunc:`PyArg_Parse\*` function.
+ :c:type:`void\*` argument that was passed to the :c:func:`PyArg_Parse\*` function.
The returned *status* should be ``1`` for a successful conversion and ``0`` if
the conversion has failed. When the conversion fails, the *converter* function
should raise an exception and leave the content of *address* unmodified.
@@ -348,13 +333,13 @@ inside nested parentheses. They are:
Indicates that the remaining arguments in the Python argument list are optional.
The C variables corresponding to optional arguments should be initialized to
their default value --- when an optional argument is not specified,
- :cfunc:`PyArg_ParseTuple` does not touch the contents of the corresponding C
+ :c:func:`PyArg_ParseTuple` does not touch the contents of the corresponding C
variable(s).
``:``
The list of format units ends here; the string after the colon is used as the
function name in error messages (the "associated value" of the exception that
- :cfunc:`PyArg_ParseTuple` raises).
+ :c:func:`PyArg_ParseTuple` raises).
``;``
The list of format units ends here; the string after the semicolon is used as
@@ -372,43 +357,52 @@ what is specified for the corresponding format unit in that case.
For the conversion to succeed, the *arg* object must match the format
and the format must be exhausted. On success, the
-:cfunc:`PyArg_Parse\*` functions return true, otherwise they return
+:c:func:`PyArg_Parse\*` functions return true, otherwise they return
false and raise an appropriate exception. When the
-:cfunc:`PyArg_Parse\*` functions fail due to conversion failure in one
+:c:func:`PyArg_Parse\*` functions fail due to conversion failure in one
of the format units, the variables at the addresses corresponding to that
and the following format units are left untouched.
API Functions
-------------
-.. cfunction:: int PyArg_ParseTuple(PyObject *args, const char *format, ...)
+.. c:function:: int PyArg_ParseTuple(PyObject *args, const char *format, ...)
Parse the parameters of a function that takes only positional parameters into
local variables. Returns true on success; on failure, it returns false and
raises the appropriate exception.
-.. cfunction:: int PyArg_VaParse(PyObject *args, const char *format, va_list vargs)
+.. c:function:: int PyArg_VaParse(PyObject *args, const char *format, va_list vargs)
- Identical to :cfunc:`PyArg_ParseTuple`, except that it accepts a va_list rather
+ Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list rather
than a variable number of arguments.
-.. cfunction:: int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], ...)
+.. c:function:: int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], ...)
Parse the parameters of a function that takes both positional and keyword
parameters into local variables. Returns true on success; on failure, it
returns false and raises the appropriate exception.
-.. cfunction:: int PyArg_VaParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], va_list vargs)
+.. c:function:: int PyArg_VaParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], va_list vargs)
- Identical to :cfunc:`PyArg_ParseTupleAndKeywords`, except that it accepts a
+ Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a
va_list rather than a variable number of arguments.
+.. c:function:: int PyArg_ValidateKeywordArguments(PyObject *)
+
+ Ensure that the keys in the keywords argument dictionary are strings. This
+ is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since the
+ latter already does this check.
+
+ .. versionadded:: 3.2
+
+
.. XXX deprecated, will be removed
-.. cfunction:: int PyArg_Parse(PyObject *args, const char *format, ...)
+.. c:function:: int PyArg_Parse(PyObject *args, const char *format, ...)
Function used to deconstruct the argument lists of "old-style" functions ---
these are functions which use the :const:`METH_OLDARGS` parameter parsing
@@ -418,7 +412,7 @@ API Functions
however, and may continue to be used for that purpose.
-.. cfunction:: int PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, ...)
+.. c:function:: int PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, ...)
A simpler form of parameter retrieval which does not use a format string to
specify the types of the arguments. Functions which use this method to retrieve
@@ -427,7 +421,7 @@ API Functions
*args*; it must actually be a tuple. The length of the tuple must be at least
*min* and no more than *max*; *min* and *max* may be equal. Additional
arguments must be passed to the function, each of which should be a pointer to a
- :ctype:`PyObject\*` variable; these will be filled in with the values from
+ :c:type:`PyObject\*` variable; these will be filled in with the values from
*args*; they will contain borrowed references. The variables which correspond
to optional parameters not given by *args* will not be filled in; these should
be initialized by the caller. This function returns true on success and false if
@@ -450,8 +444,8 @@ API Functions
return result;
}
- The call to :cfunc:`PyArg_UnpackTuple` in this example is entirely equivalent to
- this call to :cfunc:`PyArg_ParseTuple`::
+ The call to :c:func:`PyArg_UnpackTuple` in this example is entirely equivalent to
+ this call to :c:func:`PyArg_ParseTuple`::
PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
@@ -460,14 +454,14 @@ API Functions
Building values
---------------
-.. cfunction:: PyObject* Py_BuildValue(const char *format, ...)
+.. c:function:: PyObject* Py_BuildValue(const char *format, ...)
Create a new value based on a format string similar to those accepted by the
- :cfunc:`PyArg_Parse\*` family of functions and a sequence of values. Returns
+ :c:func:`PyArg_Parse\*` family of functions and a sequence of values. Returns
the value or *NULL* in the case of an error; an exception will be raised if
*NULL* is returned.
- :cfunc:`Py_BuildValue` does not always build a tuple. It builds a tuple only if
+ :c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple only if
its format string contains two or more format units. If the format string is
empty, it returns ``None``; if it contains exactly one format unit, it returns
whatever object is described by that format unit. To force it to return a tuple
@@ -476,10 +470,10 @@ Building values
When memory buffers are passed as parameters to supply data to build objects, as
for the ``s`` and ``s#`` formats, the required data is copied. Buffers provided
by the caller are never referenced by the objects created by
- :cfunc:`Py_BuildValue`. In other words, if your code invokes :cfunc:`malloc`
- and passes the allocated memory to :cfunc:`Py_BuildValue`, your code is
- responsible for calling :cfunc:`free` for that memory once
- :cfunc:`Py_BuildValue` returns.
+ :c:func:`Py_BuildValue`. In other words, if your code invokes :c:func:`malloc`
+ and passes the allocated memory to :c:func:`Py_BuildValue`, your code is
+ responsible for calling :c:func:`free` for that memory once
+ :c:func:`Py_BuildValue` returns.
In the following description, the quoted form is the format unit; the entry in
(round) parentheses is the Python object type that the format unit will return;
@@ -522,72 +516,70 @@ Building values
and ``None`` is returned.
``U`` (:class:`str` or ``None``) [char \*]
- Convert a null-terminated C string to a Python unicode object. If the C string
- pointer is *NULL*, ``None`` is used.
+ Same as ``s``.
``U#`` (:class:`str` or ``None``) [char \*, int]
- Convert a C string and its length to a Python unicode object. If the C string
- pointer is *NULL*, the length is ignored and ``None`` is returned.
+ Same as ``s#``.
``i`` (:class:`int`) [int]
- Convert a plain C :ctype:`int` to a Python integer object.
+ Convert a plain C :c:type:`int` to a Python integer object.
``b`` (:class:`int`) [char]
- Convert a plain C :ctype:`char` to a Python integer object.
+ Convert a plain C :c:type:`char` to a Python integer object.
``h`` (:class:`int`) [short int]
- Convert a plain C :ctype:`short int` to a Python integer object.
+ Convert a plain C :c:type:`short int` to a Python integer object.
``l`` (:class:`int`) [long int]
- Convert a C :ctype:`long int` to a Python integer object.
+ Convert a C :c:type:`long int` to a Python integer object.
``B`` (:class:`int`) [unsigned char]
- Convert a C :ctype:`unsigned char` to a Python integer object.
+ Convert a C :c:type:`unsigned char` to a Python integer object.
``H`` (:class:`int`) [unsigned short int]
- Convert a C :ctype:`unsigned short int` to a Python integer object.
+ Convert a C :c:type:`unsigned short int` to a Python integer object.
``I`` (:class:`int`) [unsigned int]
- Convert a C :ctype:`unsigned int` to a Python integer object.
+ Convert a C :c:type:`unsigned int` to a Python integer object.
``k`` (:class:`int`) [unsigned long]
- Convert a C :ctype:`unsigned long` to a Python integer object.
+ Convert a C :c:type:`unsigned long` to a Python integer object.
``L`` (:class:`int`) [PY_LONG_LONG]
- Convert a C :ctype:`long long` to a Python integer object. Only available
- on platforms that support :ctype:`long long` (or :ctype:`_int64` on
+ Convert a C :c:type:`long long` to a Python integer object. Only available
+ on platforms that support :c:type:`long long` (or :c:type:`_int64` on
Windows).
``K`` (:class:`int`) [unsigned PY_LONG_LONG]
- Convert a C :ctype:`unsigned long long` to a Python integer object. Only
- available on platforms that support :ctype:`unsigned long long` (or
- :ctype:`unsigned _int64` on Windows).
+ Convert a C :c:type:`unsigned long long` to a Python integer object. Only
+ available on platforms that support :c:type:`unsigned long long` (or
+ :c:type:`unsigned _int64` on Windows).
``n`` (:class:`int`) [Py_ssize_t]
- Convert a C :ctype:`Py_ssize_t` to a Python integer.
+ Convert a C :c:type:`Py_ssize_t` to a Python integer.
``c`` (:class:`bytes` of length 1) [char]
- Convert a C :ctype:`int` representing a byte to a Python :class:`bytes` object of
+ Convert a C :c:type:`int` representing a byte to a Python :class:`bytes` object of
length 1.
``C`` (:class:`str` of length 1) [int]
- Convert a C :ctype:`int` representing a character to Python :class:`str`
+ Convert a C :c:type:`int` representing a character to Python :class:`str`
object of length 1.
``d`` (:class:`float`) [double]
- Convert a C :ctype:`double` to a Python floating point number.
+ Convert a C :c:type:`double` to a Python floating point number.
``f`` (:class:`float`) [float]
- Convert a C :ctype:`float` to a Python floating point number.
+ Convert a C :c:type:`float` to a Python floating point number.
``D`` (:class:`complex`) [Py_complex \*]
- Convert a C :ctype:`Py_complex` structure to a Python complex number.
+ Convert a C :c:type:`Py_complex` structure to a Python complex number.
``O`` (object) [PyObject \*]
Pass a Python object untouched (except for its reference count, which is
incremented by one). If the object passed in is a *NULL* pointer, it is assumed
that this was caused because the call producing the argument found an error and
- set an exception. Therefore, :cfunc:`Py_BuildValue` will return *NULL* but won't
+ set an exception. Therefore, :c:func:`Py_BuildValue` will return *NULL* but won't
raise an exception. If no exception has been raised yet, :exc:`SystemError` is
set.
@@ -601,7 +593,7 @@ Building values
``O&`` (object) [*converter*, *anything*]
Convert *anything* to a Python object through a *converter* function. The
- function is called with *anything* (which should be compatible with :ctype:`void
+ function is called with *anything* (which should be compatible with :c:type:`void
\*`) as its argument and should return a "new" Python object, or *NULL* if an
error occurred.
@@ -619,7 +611,7 @@ Building values
If there is an error in the format string, the :exc:`SystemError` exception is
set and *NULL* returned.
-.. cfunction:: PyObject* Py_VaBuildValue(const char *format, va_list vargs)
+.. c:function:: PyObject* Py_VaBuildValue(const char *format, va_list vargs)
- Identical to :cfunc:`Py_BuildValue`, except that it accepts a va_list
+ Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list
rather than a variable number of arguments.
diff --git a/Doc/c-api/bool.rst b/Doc/c-api/bool.rst
index 4479bc69df..a9fb342f7c 100644
--- a/Doc/c-api/bool.rst
+++ b/Doc/c-api/bool.rst
@@ -11,36 +11,36 @@ creation and deletion functions don't apply to booleans. The following macros
are available, however.
-.. cfunction:: int PyBool_Check(PyObject *o)
+.. c:function:: int PyBool_Check(PyObject *o)
- Return true if *o* is of type :cdata:`PyBool_Type`.
+ Return true if *o* is of type :c:data:`PyBool_Type`.
-.. cvar:: PyObject* Py_False
+.. c:var:: PyObject* Py_False
The Python ``False`` object. This object has no methods. It needs to be
treated just like any other object with respect to reference counts.
-.. cvar:: PyObject* Py_True
+.. c:var:: PyObject* Py_True
The Python ``True`` object. This object has no methods. It needs to be treated
just like any other object with respect to reference counts.
-.. cmacro:: Py_RETURN_FALSE
+.. c:macro:: Py_RETURN_FALSE
Return :const:`Py_False` from a function, properly incrementing its reference
count.
-.. cmacro:: Py_RETURN_TRUE
+.. c:macro:: Py_RETURN_TRUE
Return :const:`Py_True` from a function, properly incrementing its reference
count.
-.. cfunction:: PyObject* PyBool_FromLong(long v)
+.. c:function:: PyObject* PyBool_FromLong(long v)
Return a new reference to :const:`Py_True` or :const:`Py_False` depending on the
truth value of *v*.
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst
index 094f7f2239..5a34bc09ee 100644
--- a/Doc/c-api/buffer.rst
+++ b/Doc/c-api/buffer.rst
@@ -50,12 +50,12 @@ selectively allow or reject exporting of read-write and read-only buffers.
There are two ways for a consumer of the buffer interface to acquire a buffer
over a target object:
-* call :cfunc:`PyObject_GetBuffer` with the right parameters;
+* call :c:func:`PyObject_GetBuffer` with the right parameters;
-* call :cfunc:`PyArg_ParseTuple` (or one of its siblings) with one of the
+* call :c:func:`PyArg_ParseTuple` (or one of its siblings) with one of the
``y*``, ``w*`` or ``s*`` :ref:`format codes <arg-parsing>`.
-In both cases, :cfunc:`PyBuffer_Release` must be called when the buffer
+In both cases, :c:func:`PyBuffer_Release` must be called when the buffer
isn't needed anymore. Failure to do so could lead to various issues such as
resource leaks.
@@ -73,55 +73,55 @@ operating system library, or it could be used to pass around structured data
in its native, in-memory format.
Contrary to most data types exposed by the Python interpreter, buffers
-are not :ctype:`PyObject` pointers but rather simple C structures. This
+are not :c:type:`PyObject` pointers but rather simple C structures. This
allows them to be created and copied very simply. When a generic wrapper
around a buffer is needed, a :ref:`memoryview <memoryview-objects>` object
can be created.
-.. ctype:: Py_buffer
+.. c:type:: Py_buffer
- .. cmember:: void *buf
+ .. c:member:: void *buf
A pointer to the start of the memory for the object.
- .. cmember:: Py_ssize_t len
+ .. c:member:: Py_ssize_t len
:noindex:
The total length of the memory in bytes.
- .. cmember:: int readonly
+ .. c:member:: int readonly
An indicator of whether the buffer is read only.
- .. cmember:: const char *format
+ .. c:member:: const char *format
:noindex:
A *NULL* terminated string in :mod:`struct` module style syntax giving
the contents of the elements available through the buffer. If this is
*NULL*, ``"B"`` (unsigned bytes) is assumed.
- .. cmember:: int ndim
+ .. c:member:: int ndim
The number of dimensions the memory represents as a multi-dimensional
- array. If it is 0, :cdata:`strides` and :cdata:`suboffsets` must be
+ array. If it is 0, :c:data:`strides` and :c:data:`suboffsets` must be
*NULL*.
- .. cmember:: Py_ssize_t *shape
+ .. c:member:: Py_ssize_t *shape
- An array of :ctype:`Py_ssize_t`\s the length of :cdata:`ndim` giving the
+ An array of :c:type:`Py_ssize_t`\s the length of :c:data:`ndim` giving the
shape of the memory as a multi-dimensional array. Note that
``((*shape)[0] * ... * (*shape)[ndims-1])*itemsize`` should be equal to
- :cdata:`len`.
+ :c:data:`len`.
- .. cmember:: Py_ssize_t *strides
+ .. c:member:: Py_ssize_t *strides
- An array of :ctype:`Py_ssize_t`\s the length of :cdata:`ndim` giving the
+ An array of :c:type:`Py_ssize_t`\s the length of :c:data:`ndim` giving the
number of bytes to skip to get to a new element in each dimension.
- .. cmember:: Py_ssize_t *suboffsets
+ .. c:member:: Py_ssize_t *suboffsets
- An array of :ctype:`Py_ssize_t`\s the length of :cdata:`ndim`. If these
+ An array of :c:type:`Py_ssize_t`\s the length of :c:data:`ndim`. If these
suboffset numbers are greater than or equal to 0, then the value stored
along the indicated dimension is a pointer and the suboffset value
dictates how many bytes to add to the pointer after de-referencing. A
@@ -146,16 +146,16 @@ can be created.
}
- .. cmember:: Py_ssize_t itemsize
+ .. c:member:: Py_ssize_t itemsize
This is a storage for the itemsize (in bytes) of each element of the
shared memory. It is technically un-necessary as it can be obtained
- using :cfunc:`PyBuffer_SizeFromFormat`, however an exporter may know
+ using :c:func:`PyBuffer_SizeFromFormat`, however an exporter may know
this information without parsing the format string and it is necessary
to know the itemsize for proper interpretation of striding. Therefore,
storing it is more convenient and faster.
- .. cmember:: void *internal
+ .. c:member:: void *internal
This is for use internally by the exporting object. For example, this
might be re-cast as an integer by the exporter and used to store flags
@@ -168,32 +168,32 @@ Buffer-related functions
========================
-.. cfunction:: int PyObject_CheckBuffer(PyObject *obj)
+.. c:function:: int PyObject_CheckBuffer(PyObject *obj)
Return 1 if *obj* supports the buffer interface otherwise 0. When 1 is
- returned, it doesn't guarantee that :cfunc:`PyObject_GetBuffer` will
+ returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` will
succeed.
-.. cfunction:: int PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags)
+.. c:function:: int PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags)
Export a view over some internal data from the target object *obj*.
*obj* must not be NULL, and *view* must point to an existing
- :ctype:`Py_buffer` structure allocated by the caller (most uses of
+ :c:type:`Py_buffer` structure allocated by the caller (most uses of
this function will simply declare a local variable of type
- :ctype:`Py_buffer`). The *flags* argument is a bit field indicating
+ :c:type:`Py_buffer`). The *flags* argument is a bit field indicating
what kind of buffer is requested. The buffer interface allows
for complicated memory layout possibilities; however, some callers
won't want to handle all the complexity and instead request a simple
- view of the target object (using :cmacro:`PyBUF_SIMPLE` for a read-only
- view and :cmacro:`PyBUF_WRITABLE` for a read-write view).
+ view of the target object (using :c:macro:`PyBUF_SIMPLE` for a read-only
+ view and :c:macro:`PyBUF_WRITABLE` for a read-write view).
Some exporters may not be able to share memory in every possible way and
may need to raise errors to signal to some consumers that something is
just not possible. These errors should be a :exc:`BufferError` unless
there is another error that is actually causing the problem. The
exporter can use flags information to simplify how much of the
- :cdata:`Py_buffer` structure is filled in with non-default values and/or
+ :c:data:`Py_buffer` structure is filled in with non-default values and/or
raise an error if the object can't support a simpler view of its memory.
On success, 0 is returned and the *view* structure is filled with useful
@@ -202,7 +202,7 @@ Buffer-related functions
The following are the possible values to the *flags* arguments.
- .. cmacro:: PyBUF_SIMPLE
+ .. c:macro:: PyBUF_SIMPLE
This is the default flag. The returned buffer exposes a read-only
memory area. The format of data is assumed to be raw unsigned bytes,
@@ -210,47 +210,45 @@ Buffer-related functions
constant. It never needs to be '|'d to the others. The exporter will
raise an error if it cannot provide such a contiguous buffer of bytes.
- .. cmacro:: PyBUF_WRITABLE
+ .. c:macro:: PyBUF_WRITABLE
- Like :cmacro:`PyBUF_SIMPLE`, but the returned buffer is writable. If
+ Like :c:macro:`PyBUF_SIMPLE`, but the returned buffer is writable. If
the exporter doesn't support writable buffers, an error is raised.
- .. cmacro:: PyBUF_STRIDES
+ .. c:macro:: PyBUF_STRIDES
- This implies :cmacro:`PyBUF_ND`. The returned buffer must provide
+ This implies :c:macro:`PyBUF_ND`. The returned buffer must provide
strides information (i.e. the strides cannot be NULL). This would be
used when the consumer can handle strided, discontiguous arrays.
Handling strides automatically assumes you can handle shape. The
exporter can raise an error if a strided representation of the data is
not possible (i.e. without the suboffsets).
- .. cmacro:: PyBUF_ND
+ .. c:macro:: PyBUF_ND
The returned buffer must provide shape information. The memory will be
assumed C-style contiguous (last dimension varies the fastest). The
exporter may raise an error if it cannot provide this kind of
contiguous buffer. If this is not given then shape will be *NULL*.
- .. cmacro:: PyBUF_C_CONTIGUOUS
-
- .. cmacro:: PyBUF_F_CONTIGUOUS
-
- .. cmacro:: PyBUF_ANY_CONTIGUOUS
+ .. c:macro:: PyBUF_C_CONTIGUOUS
+ PyBUF_F_CONTIGUOUS
+ PyBUF_ANY_CONTIGUOUS
These flags indicate that the contiguity returned buffer must be
respectively, C-contiguous (last dimension varies the fastest), Fortran
contiguous (first dimension varies the fastest) or either one. All of
- these flags imply :cmacro:`PyBUF_STRIDES` and guarantee that the
+ these flags imply :c:macro:`PyBUF_STRIDES` and guarantee that the
strides buffer info structure will be filled in correctly.
- .. cmacro:: PyBUF_INDIRECT
+ .. c:macro:: PyBUF_INDIRECT
This flag indicates the returned buffer must have suboffsets
information (which can be NULL if no suboffsets are needed). This can
be used when the consumer can handle indirect array referencing implied
- by these suboffsets. This implies :cmacro:`PyBUF_STRIDES`.
+ by these suboffsets. This implies :c:macro:`PyBUF_STRIDES`.
- .. cmacro:: PyBUF_FORMAT
+ .. c:macro:: PyBUF_FORMAT
The returned buffer must have true format information if this flag is
provided. This would be used when the consumer is going to be checking
@@ -259,68 +257,68 @@ Buffer-related functions
explicitly requested then the format must be returned as *NULL* (which
means ``'B'``, or unsigned bytes).
- .. cmacro:: PyBUF_STRIDED
+ .. c:macro:: PyBUF_STRIDED
This is equivalent to ``(PyBUF_STRIDES | PyBUF_WRITABLE)``.
- .. cmacro:: PyBUF_STRIDED_RO
+ .. c:macro:: PyBUF_STRIDED_RO
This is equivalent to ``(PyBUF_STRIDES)``.
- .. cmacro:: PyBUF_RECORDS
+ .. c:macro:: PyBUF_RECORDS
This is equivalent to ``(PyBUF_STRIDES | PyBUF_FORMAT |
PyBUF_WRITABLE)``.
- .. cmacro:: PyBUF_RECORDS_RO
+ .. c:macro:: PyBUF_RECORDS_RO
This is equivalent to ``(PyBUF_STRIDES | PyBUF_FORMAT)``.
- .. cmacro:: PyBUF_FULL
+ .. c:macro:: PyBUF_FULL
This is equivalent to ``(PyBUF_INDIRECT | PyBUF_FORMAT |
PyBUF_WRITABLE)``.
- .. cmacro:: PyBUF_FULL_RO
+ .. c:macro:: PyBUF_FULL_RO
This is equivalent to ``(PyBUF_INDIRECT | PyBUF_FORMAT)``.
- .. cmacro:: PyBUF_CONTIG
+ .. c:macro:: PyBUF_CONTIG
This is equivalent to ``(PyBUF_ND | PyBUF_WRITABLE)``.
- .. cmacro:: PyBUF_CONTIG_RO
+ .. c:macro:: PyBUF_CONTIG_RO
This is equivalent to ``(PyBUF_ND)``.
-.. cfunction:: void PyBuffer_Release(Py_buffer *view)
+.. c:function:: void PyBuffer_Release(Py_buffer *view)
Release the buffer *view*. This should be called when the buffer is no
longer being used as it may free memory from it.
-.. cfunction:: Py_ssize_t PyBuffer_SizeFromFormat(const char *)
+.. c:function:: Py_ssize_t PyBuffer_SizeFromFormat(const char *)
- Return the implied :cdata:`~Py_buffer.itemsize` from the struct-stype
- :cdata:`~Py_buffer.format`.
+ Return the implied :c:data:`~Py_buffer.itemsize` from the struct-stype
+ :c:data:`~Py_buffer.format`.
-.. cfunction:: int PyBuffer_IsContiguous(Py_buffer *view, char fortran)
+.. c:function:: int PyBuffer_IsContiguous(Py_buffer *view, char fortran)
Return 1 if the memory defined by the *view* is C-style (*fortran* is
``'C'``) or Fortran-style (*fortran* is ``'F'``) contiguous or either one
(*fortran* is ``'A'``). Return 0 otherwise.
-.. cfunction:: void PyBuffer_FillContiguousStrides(int ndim, Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t itemsize, char fortran)
+.. c:function:: void PyBuffer_FillContiguousStrides(int ndim, Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t itemsize, char fortran)
Fill the *strides* array with byte-strides of a contiguous (C-style if
*fortran* is ``'C'`` or Fortran-style if *fortran* is ``'F'`` array of the
given shape with the given number of bytes per element.
-.. cfunction:: int PyBuffer_FillInfo(Py_buffer *view, PyObject *obj, void *buf, Py_ssize_t len, int readonly, int infoflags)
+.. c:function:: int PyBuffer_FillInfo(Py_buffer *view, PyObject *obj, void *buf, Py_ssize_t len, int readonly, int infoflags)
Fill in a buffer-info structure, *view*, correctly for an exporter that can
only share a contiguous chunk of memory of "unsigned bytes" of the given
diff --git a/Doc/c-api/bytearray.rst b/Doc/c-api/bytearray.rst
index 5e11d8a571..95ded96eb6 100644
--- a/Doc/c-api/bytearray.rst
+++ b/Doc/c-api/bytearray.rst
@@ -8,27 +8,27 @@ Byte Array Objects
.. index:: object: bytearray
-.. ctype:: PyByteArrayObject
+.. c:type:: PyByteArrayObject
- This subtype of :ctype:`PyObject` represents a Python bytearray object.
+ This subtype of :c:type:`PyObject` represents a Python bytearray object.
-.. cvar:: PyTypeObject PyByteArray_Type
+.. c:var:: PyTypeObject PyByteArray_Type
- This instance of :ctype:`PyTypeObject` represents the Python bytearray type;
+ This instance of :c:type:`PyTypeObject` represents the Python bytearray type;
it is the same object as :class:`bytearray` in the Python layer.
Type check macros
^^^^^^^^^^^^^^^^^
-.. cfunction:: int PyByteArray_Check(PyObject *o)
+.. c:function:: int PyByteArray_Check(PyObject *o)
Return true if the object *o* is a bytearray object or an instance of a
subtype of the bytearray type.
-.. cfunction:: int PyByteArray_CheckExact(PyObject *o)
+.. c:function:: int PyByteArray_CheckExact(PyObject *o)
Return true if the object *o* is a bytearray object, but not an instance of a
subtype of the bytearray type.
@@ -37,7 +37,7 @@ Type check macros
Direct API functions
^^^^^^^^^^^^^^^^^^^^
-.. cfunction:: PyObject* PyByteArray_FromObject(PyObject *o)
+.. c:function:: PyObject* PyByteArray_FromObject(PyObject *o)
Return a new bytearray object from any object, *o*, that implements the
buffer protocol.
@@ -45,29 +45,29 @@ Direct API functions
.. XXX expand about the buffer protocol, at least somewhere
-.. cfunction:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
+.. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
Create a new bytearray object from *string* and its length, *len*. On
failure, *NULL* is returned.
-.. cfunction:: PyObject* PyByteArray_Concat(PyObject *a, PyObject *b)
+.. c:function:: PyObject* PyByteArray_Concat(PyObject *a, PyObject *b)
Concat bytearrays *a* and *b* and return a new bytearray with the result.
-.. cfunction:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)
+.. c:function:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)
Return the size of *bytearray* after checking for a *NULL* pointer.
-.. cfunction:: char* PyByteArray_AsString(PyObject *bytearray)
+.. c:function:: char* PyByteArray_AsString(PyObject *bytearray)
Return the contents of *bytearray* as a char array after checking for a
*NULL* pointer.
-.. cfunction:: int PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)
+.. c:function:: int PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)
Resize the internal buffer of *bytearray* to *len*.
@@ -76,11 +76,11 @@ Macros
These macros trade safety for speed and they don't check pointers.
-.. cfunction:: char* PyByteArray_AS_STRING(PyObject *bytearray)
+.. c:function:: char* PyByteArray_AS_STRING(PyObject *bytearray)
- Macro version of :cfunc:`PyByteArray_AsString`.
+ Macro version of :c:func:`PyByteArray_AsString`.
-.. cfunction:: Py_ssize_t PyByteArray_GET_SIZE(PyObject *bytearray)
+.. c:function:: Py_ssize_t PyByteArray_GET_SIZE(PyObject *bytearray)
- Macro version of :cfunc:`PyByteArray_Size`.
+ Macro version of :c:func:`PyByteArray_Size`.
diff --git a/Doc/c-api/bytes.rst b/Doc/c-api/bytes.rst
index abd8744108..12ec80ca5e 100644
--- a/Doc/c-api/bytes.rst
+++ b/Doc/c-api/bytes.rst
@@ -11,46 +11,46 @@ called with a non-bytes parameter.
.. index:: object: bytes
-.. ctype:: PyBytesObject
+.. c:type:: PyBytesObject
- This subtype of :ctype:`PyObject` represents a Python bytes object.
+ This subtype of :c:type:`PyObject` represents a Python bytes object.
-.. cvar:: PyTypeObject PyBytes_Type
+.. c:var:: PyTypeObject PyBytes_Type
- This instance of :ctype:`PyTypeObject` represents the Python bytes type; it
+ This instance of :c:type:`PyTypeObject` represents the Python bytes type; it
is the same object as :class:`bytes` in the Python layer.
-.. cfunction:: int PyBytes_Check(PyObject *o)
+.. c:function:: int PyBytes_Check(PyObject *o)
Return true if the object *o* is a bytes object or an instance of a subtype
of the bytes type.
-.. cfunction:: int PyBytes_CheckExact(PyObject *o)
+.. c:function:: int PyBytes_CheckExact(PyObject *o)
Return true if the object *o* is a bytes object, but not an instance of a
subtype of the bytes type.
-.. cfunction:: PyObject* PyBytes_FromString(const char *v)
+.. c:function:: PyObject* PyBytes_FromString(const char *v)
Return a new bytes object with a copy of the string *v* as value on success,
and *NULL* on failure. The parameter *v* must not be *NULL*; it will not be
checked.
-.. cfunction:: PyObject* PyBytes_FromStringAndSize(const char *v, Py_ssize_t len)
+.. c:function:: PyObject* PyBytes_FromStringAndSize(const char *v, Py_ssize_t len)
Return a new bytes object with a copy of the string *v* as value and length
*len* on success, and *NULL* on failure. If *v* is *NULL*, the contents of
the bytes object are uninitialized.
-.. cfunction:: PyObject* PyBytes_FromFormat(const char *format, ...)
+.. c:function:: PyObject* PyBytes_FromFormat(const char *format, ...)
- Take a C :cfunc:`printf`\ -style *format* string and a variable number of
+ Take a C :c:func:`printf`\ -style *format* string and a variable number of
arguments, calculate the size of the resulting Python bytes object and return
a bytes object with the values formatted into it. The variable arguments
must be C types and must correspond exactly to the format characters in the
@@ -110,44 +110,44 @@ called with a non-bytes parameter.
copied as-is to the result string, and any extra arguments discarded.
-.. cfunction:: PyObject* PyBytes_FromFormatV(const char *format, va_list vargs)
+.. c:function:: PyObject* PyBytes_FromFormatV(const char *format, va_list vargs)
- Identical to :func:`PyBytes_FromFormat` except that it takes exactly two
+ Identical to :c:func:`PyBytes_FromFormat` except that it takes exactly two
arguments.
-.. cfunction:: PyObject* PyBytes_FromObject(PyObject *o)
+.. c:function:: PyObject* PyBytes_FromObject(PyObject *o)
Return the bytes representation of object *o* that implements the buffer
protocol.
-.. cfunction:: Py_ssize_t PyBytes_Size(PyObject *o)
+.. c:function:: Py_ssize_t PyBytes_Size(PyObject *o)
Return the length of the bytes in bytes object *o*.
-.. cfunction:: Py_ssize_t PyBytes_GET_SIZE(PyObject *o)
+.. c:function:: Py_ssize_t PyBytes_GET_SIZE(PyObject *o)
- Macro form of :cfunc:`PyBytes_Size` but without error checking.
+ Macro form of :c:func:`PyBytes_Size` but without error checking.
-.. cfunction:: char* PyBytes_AsString(PyObject *o)
+.. c:function:: char* PyBytes_AsString(PyObject *o)
Return a NUL-terminated representation of the contents of *o*. The pointer
refers to the internal buffer of *o*, not a copy. The data must not be
modified in any way, unless the string was just created using
``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If
- *o* is not a string object at all, :cfunc:`PyBytes_AsString` returns *NULL*
+ *o* is not a string object at all, :c:func:`PyBytes_AsString` returns *NULL*
and raises :exc:`TypeError`.
-.. cfunction:: char* PyBytes_AS_STRING(PyObject *string)
+.. c:function:: char* PyBytes_AS_STRING(PyObject *string)
- Macro form of :cfunc:`PyBytes_AsString` but without error checking.
+ Macro form of :c:func:`PyBytes_AsString` but without error checking.
-.. cfunction:: int PyBytes_AsStringAndSize(PyObject *obj, char **buffer, Py_ssize_t *length)
+.. c:function:: int PyBytes_AsStringAndSize(PyObject *obj, char **buffer, Py_ssize_t *length)
Return a NUL-terminated representation of the contents of the object *obj*
through the output variables *buffer* and *length*.
@@ -158,11 +158,11 @@ called with a non-bytes parameter.
The buffer refers to an internal string buffer of *obj*, not a copy. The data
must not be modified in any way, unless the string was just created using
``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If
- *string* is not a string object at all, :cfunc:`PyBytes_AsStringAndSize`
+ *string* is not a string object at all, :c:func:`PyBytes_AsStringAndSize`
returns ``-1`` and raises :exc:`TypeError`.
-.. cfunction:: void PyBytes_Concat(PyObject **bytes, PyObject *newpart)
+.. c:function:: void PyBytes_Concat(PyObject **bytes, PyObject *newpart)
Create a new bytes object in *\*bytes* containing the contents of *newpart*
appended to *bytes*; the caller will own the new reference. The reference to
@@ -171,14 +171,14 @@ called with a non-bytes parameter.
of *\*bytes* will be set to *NULL*; the appropriate exception will be set.
-.. cfunction:: void PyBytes_ConcatAndDel(PyObject **bytes, PyObject *newpart)
+.. c:function:: void PyBytes_ConcatAndDel(PyObject **bytes, PyObject *newpart)
Create a new string object in *\*bytes* containing the contents of *newpart*
appended to *bytes*. This version decrements the reference count of
*newpart*.
-.. cfunction:: int _PyBytes_Resize(PyObject **bytes, Py_ssize_t newsize)
+.. c:function:: int _PyBytes_Resize(PyObject **bytes, Py_ssize_t newsize)
A way to resize a bytes object even though it is "immutable". Only use this
to build up a brand new bytes object; don't use this if the bytes may already
diff --git a/Doc/c-api/capsule.rst b/Doc/c-api/capsule.rst
index 29393146bd..6f6250f671 100644
--- a/Doc/c-api/capsule.rst
+++ b/Doc/c-api/capsule.rst
@@ -10,33 +10,33 @@ Capsules
Refer to :ref:`using-capsules` for more information on using these objects.
-.. ctype:: PyCapsule
+.. c:type:: PyCapsule
- This subtype of :ctype:`PyObject` represents an opaque value, useful for C
- extension modules who need to pass an opaque value (as a :ctype:`void\*`
+ This subtype of :c:type:`PyObject` represents an opaque value, useful for C
+ extension modules who need to pass an opaque value (as a :c:type:`void\*`
pointer) through Python code to other C code. It is often used to make a C
function pointer defined in one module available to other modules, so the
regular import mechanism can be used to access C APIs defined in dynamically
loaded modules.
-.. ctype:: PyCapsule_Destructor
+.. c:type:: PyCapsule_Destructor
The type of a destructor callback for a capsule. Defined as::
typedef void (*PyCapsule_Destructor)(PyObject *);
- See :cfunc:`PyCapsule_New` for the semantics of PyCapsule_Destructor
+ See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor
callbacks.
-.. cfunction:: int PyCapsule_CheckExact(PyObject *p)
+.. c:function:: int PyCapsule_CheckExact(PyObject *p)
- Return true if its argument is a :ctype:`PyCapsule`.
+ Return true if its argument is a :c:type:`PyCapsule`.
-.. cfunction:: PyObject* PyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor)
+.. c:function:: PyObject* PyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor)
- Create a :ctype:`PyCapsule` encapsulating the *pointer*. The *pointer*
+ Create a :c:type:`PyCapsule` encapsulating the *pointer*. The *pointer*
argument may not be *NULL*.
On failure, set an exception and return *NULL*.
@@ -50,91 +50,91 @@ Refer to :ref:`using-capsules` for more information on using these objects.
If this capsule will be stored as an attribute of a module, the *name* should
be specified as ``modulename.attributename``. This will enable other modules
- to import the capsule using :cfunc:`PyCapsule_Import`.
+ to import the capsule using :c:func:`PyCapsule_Import`.
-.. cfunction:: void* PyCapsule_GetPointer(PyObject *capsule, const char *name)
+.. c:function:: void* PyCapsule_GetPointer(PyObject *capsule, const char *name)
Retrieve the *pointer* stored in the capsule. On failure, set an exception
and return *NULL*.
The *name* parameter must compare exactly to the name stored in the capsule.
If the name stored in the capsule is *NULL*, the *name* passed in must also
- be *NULL*. Python uses the C function :cfunc:`strcmp` to compare capsule
+ be *NULL*. Python uses the C function :c:func:`strcmp` to compare capsule
names.
-.. cfunction:: PyCapsule_Destructor PyCapsule_GetDestructor(PyObject *capsule)
+.. c:function:: PyCapsule_Destructor PyCapsule_GetDestructor(PyObject *capsule)
Return the current destructor stored in the capsule. On failure, set an
exception and return *NULL*.
It is legal for a capsule to have a *NULL* destructor. This makes a *NULL*
- return code somewhat ambiguous; use :cfunc:`PyCapsule_IsValid` or
- :cfunc:`PyErr_Occurred` to disambiguate.
+ return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or
+ :c:func:`PyErr_Occurred` to disambiguate.
-.. cfunction:: void* PyCapsule_GetContext(PyObject *capsule)
+.. c:function:: void* PyCapsule_GetContext(PyObject *capsule)
Return the current context stored in the capsule. On failure, set an
exception and return *NULL*.
It is legal for a capsule to have a *NULL* context. This makes a *NULL*
- return code somewhat ambiguous; use :cfunc:`PyCapsule_IsValid` or
- :cfunc:`PyErr_Occurred` to disambiguate.
+ return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or
+ :c:func:`PyErr_Occurred` to disambiguate.
-.. cfunction:: const char* PyCapsule_GetName(PyObject *capsule)
+.. c:function:: const char* PyCapsule_GetName(PyObject *capsule)
Return the current name stored in the capsule. On failure, set an exception
and return *NULL*.
It is legal for a capsule to have a *NULL* name. This makes a *NULL* return
- code somewhat ambiguous; use :cfunc:`PyCapsule_IsValid` or
- :cfunc:`PyErr_Occurred` to disambiguate.
+ code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or
+ :c:func:`PyErr_Occurred` to disambiguate.
-.. cfunction:: void* PyCapsule_Import(const char *name, int no_block)
+.. c:function:: void* PyCapsule_Import(const char *name, int no_block)
Import a pointer to a C object from a capsule attribute in a module. The
*name* parameter should specify the full name to the attribute, as in
``module.attribute``. The *name* stored in the capsule must match this
string exactly. If *no_block* is true, import the module without blocking
- (using :cfunc:`PyImport_ImportModuleNoBlock`). If *no_block* is false,
- import the module conventionally (using :cfunc:`PyImport_ImportModule`).
+ (using :c:func:`PyImport_ImportModuleNoBlock`). If *no_block* is false,
+ import the module conventionally (using :c:func:`PyImport_ImportModule`).
Return the capsule's internal *pointer* on success. On failure, set an
- exception and return *NULL*. However, if :cfunc:`PyCapsule_Import` failed to
+ exception and return *NULL*. However, if :c:func:`PyCapsule_Import` failed to
import the module, and *no_block* was true, no exception is set.
-.. cfunction:: int PyCapsule_IsValid(PyObject *capsule, const char *name)
+.. c:function:: int PyCapsule_IsValid(PyObject *capsule, const char *name)
Determines whether or not *capsule* is a valid capsule. A valid capsule is
- non-*NULL*, passes :cfunc:`PyCapsule_CheckExact`, has a non-*NULL* pointer
+ non-*NULL*, passes :c:func:`PyCapsule_CheckExact`, has a non-*NULL* pointer
stored in it, and its internal name matches the *name* parameter. (See
- :cfunc:`PyCapsule_GetPointer` for information on how capsule names are
+ :c:func:`PyCapsule_GetPointer` for information on how capsule names are
compared.)
- In other words, if :cfunc:`PyCapsule_IsValid` returns a true value, calls to
- any of the accessors (any function starting with :cfunc:`PyCapsule_Get`) are
+ In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls to
+ any of the accessors (any function starting with :c:func:`PyCapsule_Get`) are
guaranteed to succeed.
Return a nonzero value if the object is valid and matches the name passed in.
Return 0 otherwise. This function will not fail.
-.. cfunction:: int PyCapsule_SetContext(PyObject *capsule, void *context)
+.. c:function:: int PyCapsule_SetContext(PyObject *capsule, void *context)
Set the context pointer inside *capsule* to *context*.
Return 0 on success. Return nonzero and set an exception on failure.
-.. cfunction:: int PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor)
+.. c:function:: int PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor)
Set the destructor inside *capsule* to *destructor*.
Return 0 on success. Return nonzero and set an exception on failure.
-.. cfunction:: int PyCapsule_SetName(PyObject *capsule, const char *name)
+.. c:function:: int PyCapsule_SetName(PyObject *capsule, const char *name)
Set the name inside *capsule* to *name*. If non-*NULL*, the name must
outlive the capsule. If the previous *name* stored in the capsule was not
@@ -142,7 +142,7 @@ Refer to :ref:`using-capsules` for more information on using these objects.
Return 0 on success. Return nonzero and set an exception on failure.
-.. cfunction:: int PyCapsule_SetPointer(PyObject *capsule, void *pointer)
+.. c:function:: int PyCapsule_SetPointer(PyObject *capsule, void *pointer)
Set the void pointer inside *capsule* to *pointer*. The pointer may not be
*NULL*.
diff --git a/Doc/c-api/cell.rst b/Doc/c-api/cell.rst
index 3562ed9816..427259cc24 100644
--- a/Doc/c-api/cell.rst
+++ b/Doc/c-api/cell.rst
@@ -15,39 +15,39 @@ generated byte-code; these are not automatically de-referenced when accessed.
Cell objects are not likely to be useful elsewhere.
-.. ctype:: PyCellObject
+.. c:type:: PyCellObject
The C structure used for cell objects.
-.. cvar:: PyTypeObject PyCell_Type
+.. c:var:: PyTypeObject PyCell_Type
The type object corresponding to cell objects.
-.. cfunction:: int PyCell_Check(ob)
+.. c:function:: int PyCell_Check(ob)
Return true if *ob* is a cell object; *ob* must not be *NULL*.
-.. cfunction:: PyObject* PyCell_New(PyObject *ob)
+.. c:function:: PyObject* PyCell_New(PyObject *ob)
Create and return a new cell object containing the value *ob*. The parameter may
be *NULL*.
-.. cfunction:: PyObject* PyCell_Get(PyObject *cell)
+.. c:function:: PyObject* PyCell_Get(PyObject *cell)
Return the contents of the cell *cell*.
-.. cfunction:: PyObject* PyCell_GET(PyObject *cell)
+.. c:function:: PyObject* PyCell_GET(PyObject *cell)
Return the contents of the cell *cell*, but without checking that *cell* is
non-*NULL* and a cell object.
-.. cfunction:: int PyCell_Set(PyObject *cell, PyObject *value)
+.. c:function:: int PyCell_Set(PyObject *cell, PyObject *value)
Set the contents of the cell object *cell* to *value*. This releases the
reference to any current content of the cell. *value* may be *NULL*. *cell*
@@ -55,7 +55,7 @@ Cell objects are not likely to be useful elsewhere.
success, ``0`` will be returned.
-.. cfunction:: void PyCell_SET(PyObject *cell, PyObject *value)
+.. c:function:: void PyCell_SET(PyObject *cell, PyObject *value)
Sets the value of the cell object *cell* to *value*. No reference counts are
adjusted, and no checks are made for safety; *cell* must be non-*NULL* and must
diff --git a/Doc/c-api/cobject.rst b/Doc/c-api/cobject.rst
deleted file mode 100644
index ee65a9833c..0000000000
--- a/Doc/c-api/cobject.rst
+++ /dev/null
@@ -1,59 +0,0 @@
-.. highlightlang:: c
-
-.. _cobjects:
-
-CObjects
---------
-
-.. index:: object: CObject
-
-
-.. warning::
-
- The CObject API is deprecated as of Python 3.1. Please switch to the new
- :ref:`capsules` API.
-
-.. ctype:: PyCObject
-
- This subtype of :ctype:`PyObject` represents an opaque value, useful for C
- extension modules who need to pass an opaque value (as a :ctype:`void\*`
- pointer) through Python code to other C code. It is often used to make a C
- function pointer defined in one module available to other modules, so the
- regular import mechanism can be used to access C APIs defined in dynamically
- loaded modules.
-
-
-.. cfunction:: int PyCObject_Check(PyObject *p)
-
- Return true if its argument is a :ctype:`PyCObject`.
-
-
-.. cfunction:: PyObject* PyCObject_FromVoidPtr(void* cobj, void (*destr)(void *))
-
- Create a :ctype:`PyCObject` from the ``void *`` *cobj*. The *destr* function
- will be called when the object is reclaimed, unless it is *NULL*.
-
-
-.. cfunction:: PyObject* PyCObject_FromVoidPtrAndDesc(void* cobj, void* desc, void (*destr)(void *, void *))
-
- Create a :ctype:`PyCObject` from the :ctype:`void \*` *cobj*. The *destr*
- function will be called when the object is reclaimed. The *desc* argument can
- be used to pass extra callback data for the destructor function.
-
-
-.. cfunction:: void* PyCObject_AsVoidPtr(PyObject* self)
-
- Return the object :ctype:`void \*` that the :ctype:`PyCObject` *self* was
- created with.
-
-
-.. cfunction:: void* PyCObject_GetDesc(PyObject* self)
-
- Return the description :ctype:`void \*` that the :ctype:`PyCObject` *self* was
- created with.
-
-
-.. cfunction:: int PyCObject_SetVoidPtr(PyObject* self, void* cobj)
-
- Set the void pointer inside *self* to *cobj*. The :ctype:`PyCObject` must not
- have an associated destructor. Return true on success, false on failure.
diff --git a/Doc/c-api/code.rst b/Doc/c-api/code.rst
new file mode 100644
index 0000000000..52c42453b0
--- /dev/null
+++ b/Doc/c-api/code.rst
@@ -0,0 +1,50 @@
+.. highlightlang:: c
+
+.. _codeobjects:
+
+Code Objects
+------------
+
+.. sectionauthor:: Jeffrey Yasskin <jyasskin@gmail.com>
+
+
+.. index::
+ object: code
+
+Code objects are a low-level detail of the CPython implementation.
+Each one represents a chunk of executable code that hasn't yet been
+bound into a function.
+
+.. c:type:: PyCodeObject
+
+ The C structure of the objects used to describe code objects. The
+ fields of this type are subject to change at any time.
+
+
+.. c:var:: PyTypeObject PyCode_Type
+
+ This is an instance of :c:type:`PyTypeObject` representing the Python
+ :class:`code` type.
+
+
+.. c:function:: int PyCode_Check(PyObject *co)
+
+ Return true if *co* is a :class:`code` object
+
+.. c:function:: int PyCode_GetNumFree(PyObject *co)
+
+ Return the number of free variables in *co*.
+
+.. c:function:: PyCodeObject *PyCode_New(int argcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, int firstlineno, PyObject *lnotab)
+
+ Return a new code object. If you need a dummy code object to
+ create a frame, use :c:func:`PyCode_NewEmpty` instead. Calling
+ :c:func:`PyCode_New` directly can bind you to a precise Python
+ version since the definition of the bytecode changes often.
+
+
+.. c:function:: int PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno)
+
+ Return a new empty code object with the specified filename,
+ function name, and first line number. It is illegal to
+ :func:`exec` or :func:`eval` the resulting code object.
diff --git a/Doc/c-api/codec.rst b/Doc/c-api/codec.rst
index 2597d380af..8207ae044d 100644
--- a/Doc/c-api/codec.rst
+++ b/Doc/c-api/codec.rst
@@ -3,19 +3,19 @@
Codec registry and support functions
====================================
-.. cfunction:: int PyCodec_Register(PyObject *search_function)
+.. c:function:: int PyCodec_Register(PyObject *search_function)
Register a new codec search function.
As side effect, this tries to load the :mod:`encodings` package, if not yet
done, to make sure that it is always first in the list of search functions.
-.. cfunction:: int PyCodec_KnownEncoding(const char *encoding)
+.. c:function:: int PyCodec_KnownEncoding(const char *encoding)
Return ``1`` or ``0`` depending on whether there is a registered codec for
the given *encoding*.
-.. cfunction:: PyObject* PyCodec_Encode(PyObject *object, const char *encoding, const char *errors)
+.. c:function:: PyObject* PyCodec_Encode(PyObject *object, const char *encoding, const char *errors)
Generic codec based encoding API.
@@ -24,7 +24,7 @@ Codec registry and support functions
be *NULL* to use the default method defined for the codec. Raises a
:exc:`LookupError` if no encoder can be found.
-.. cfunction:: PyObject* PyCodec_Decode(PyObject *object, const char *encoding, const char *errors)
+.. c:function:: PyObject* PyCodec_Decode(PyObject *object, const char *encoding, const char *errors)
Generic codec based decoding API.
@@ -42,27 +42,27 @@ lower-case characters, which makes encodings looked up through this mechanism
effectively case-insensitive. If no codec is found, a :exc:`KeyError` is set
and *NULL* returned.
-.. cfunction:: PyObject* PyCodec_Encoder(const char *encoding)
+.. c:function:: PyObject* PyCodec_Encoder(const char *encoding)
Get an encoder function for the given *encoding*.
-.. cfunction:: PyObject* PyCodec_Decoder(const char *encoding)
+.. c:function:: PyObject* PyCodec_Decoder(const char *encoding)
Get a decoder function for the given *encoding*.
-.. cfunction:: PyObject* PyCodec_IncrementalEncoder(const char *encoding, const char *errors)
+.. c:function:: PyObject* PyCodec_IncrementalEncoder(const char *encoding, const char *errors)
Get an :class:`IncrementalEncoder` object for the given *encoding*.
-.. cfunction:: PyObject* PyCodec_IncrementalDecoder(const char *encoding, const char *errors)
+.. c:function:: PyObject* PyCodec_IncrementalDecoder(const char *encoding, const char *errors)
Get an :class:`IncrementalDecoder` object for the given *encoding*.
-.. cfunction:: PyObject* PyCodec_StreamReader(const char *encoding, PyObject *stream, const char *errors)
+.. c:function:: PyObject* PyCodec_StreamReader(const char *encoding, PyObject *stream, const char *errors)
Get a :class:`StreamReader` factory function for the given *encoding*.
-.. cfunction:: PyObject* PyCodec_StreamWriter(const char *encoding, PyObject *stream, const char *errors)
+.. c:function:: PyObject* PyCodec_StreamWriter(const char *encoding, PyObject *stream, const char *errors)
Get a :class:`StreamWriter` factory function for the given *encoding*.
@@ -70,7 +70,7 @@ and *NULL* returned.
Registry API for Unicode encoding error handlers
------------------------------------------------
-.. cfunction:: int PyCodec_RegisterError(const char *name, PyObject *error)
+.. c:function:: int PyCodec_RegisterError(const char *name, PyObject *error)
Register the error handling callback function *error* under the given *name*.
This callback function will be called by a codec when it encounters
@@ -89,29 +89,29 @@ Registry API for Unicode encoding error handlers
Return ``0`` on success, ``-1`` on error.
-.. cfunction:: PyObject* PyCodec_LookupError(const char *name)
+.. c:function:: PyObject* PyCodec_LookupError(const char *name)
Lookup the error handling callback function registered under *name*. As a
special case *NULL* can be passed, in which case the error handling callback
for "strict" will be returned.
-.. cfunction:: PyObject* PyCodec_StrictErrors(PyObject *exc)
+.. c:function:: PyObject* PyCodec_StrictErrors(PyObject *exc)
Raise *exc* as an exception.
-.. cfunction:: PyObject* PyCodec_IgnoreErrors(PyObject *exc)
+.. c:function:: PyObject* PyCodec_IgnoreErrors(PyObject *exc)
Ignore the unicode error, skipping the faulty input.
-.. cfunction:: PyObject* PyCodec_ReplaceErrors(PyObject *exc)
+.. c:function:: PyObject* PyCodec_ReplaceErrors(PyObject *exc)
Replace the unicode encode error with ``?`` or ``U+FFFD``.
-.. cfunction:: PyObject* PyCodec_XMLCharRefReplaceErrors(PyObject *exc)
+.. c:function:: PyObject* PyCodec_XMLCharRefReplaceErrors(PyObject *exc)
Replace the unicode encode error with XML character references.
-.. cfunction:: PyObject* PyCodec_BackslashReplaceErrors(PyObject *exc)
+.. c:function:: PyObject* PyCodec_BackslashReplaceErrors(PyObject *exc)
Replace the unicode encode error with backslash escapes (``\x``, ``\u`` and
``\U``).
diff --git a/Doc/c-api/complex.rst b/Doc/c-api/complex.rst
index 0bcdf4d41a..43dfe56c28 100644
--- a/Doc/c-api/complex.rst
+++ b/Doc/c-api/complex.rst
@@ -21,7 +21,7 @@ them as results do so *by value* rather than dereferencing them through
pointers. This is consistent throughout the API.
-.. ctype:: Py_complex
+.. c:type:: Py_complex
The C structure which corresponds to the value portion of a Python complex
number object. Most of the functions for dealing with complex number objects
@@ -34,39 +34,39 @@ pointers. This is consistent throughout the API.
} Py_complex;
-.. cfunction:: Py_complex _Py_c_sum(Py_complex left, Py_complex right)
+.. c:function:: Py_complex _Py_c_sum(Py_complex left, Py_complex right)
- Return the sum of two complex numbers, using the C :ctype:`Py_complex`
+ Return the sum of two complex numbers, using the C :c:type:`Py_complex`
representation.
-.. cfunction:: Py_complex _Py_c_diff(Py_complex left, Py_complex right)
+.. c:function:: Py_complex _Py_c_diff(Py_complex left, Py_complex right)
Return the difference between two complex numbers, using the C
- :ctype:`Py_complex` representation.
+ :c:type:`Py_complex` representation.
-.. cfunction:: Py_complex _Py_c_neg(Py_complex complex)
+.. c:function:: Py_complex _Py_c_neg(Py_complex complex)
Return the negation of the complex number *complex*, using the C
- :ctype:`Py_complex` representation.
+ :c:type:`Py_complex` representation.
-.. cfunction:: Py_complex _Py_c_prod(Py_complex left, Py_complex right)
+.. c:function:: Py_complex _Py_c_prod(Py_complex left, Py_complex right)
- Return the product of two complex numbers, using the C :ctype:`Py_complex`
+ Return the product of two complex numbers, using the C :c:type:`Py_complex`
representation.
-.. cfunction:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)
+.. c:function:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)
- Return the quotient of two complex numbers, using the C :ctype:`Py_complex`
+ Return the quotient of two complex numbers, using the C :c:type:`Py_complex`
representation.
-.. cfunction:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
+.. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
- Return the exponentiation of *num* by *exp*, using the C :ctype:`Py_complex`
+ Return the exponentiation of *num* by *exp*, using the C :c:type:`Py_complex`
representation.
@@ -74,52 +74,52 @@ Complex Numbers as Python Objects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. ctype:: PyComplexObject
+.. c:type:: PyComplexObject
- This subtype of :ctype:`PyObject` represents a Python complex number object.
+ This subtype of :c:type:`PyObject` represents a Python complex number object.
-.. cvar:: PyTypeObject PyComplex_Type
+.. c:var:: PyTypeObject PyComplex_Type
- This instance of :ctype:`PyTypeObject` represents the Python complex number
+ This instance of :c:type:`PyTypeObject` represents the Python complex number
type. It is the same object as :class:`complex` in the Python layer.
-.. cfunction:: int PyComplex_Check(PyObject *p)
+.. c:function:: int PyComplex_Check(PyObject *p)
- Return true if its argument is a :ctype:`PyComplexObject` or a subtype of
- :ctype:`PyComplexObject`.
+ Return true if its argument is a :c:type:`PyComplexObject` or a subtype of
+ :c:type:`PyComplexObject`.
-.. cfunction:: int PyComplex_CheckExact(PyObject *p)
+.. c:function:: int PyComplex_CheckExact(PyObject *p)
- Return true if its argument is a :ctype:`PyComplexObject`, but not a subtype of
- :ctype:`PyComplexObject`.
+ Return true if its argument is a :c:type:`PyComplexObject`, but not a subtype of
+ :c:type:`PyComplexObject`.
-.. cfunction:: PyObject* PyComplex_FromCComplex(Py_complex v)
+.. c:function:: PyObject* PyComplex_FromCComplex(Py_complex v)
- Create a new Python complex number object from a C :ctype:`Py_complex` value.
+ Create a new Python complex number object from a C :c:type:`Py_complex` value.
-.. cfunction:: PyObject* PyComplex_FromDoubles(double real, double imag)
+.. c:function:: PyObject* PyComplex_FromDoubles(double real, double imag)
- Return a new :ctype:`PyComplexObject` object from *real* and *imag*.
+ Return a new :c:type:`PyComplexObject` object from *real* and *imag*.
-.. cfunction:: double PyComplex_RealAsDouble(PyObject *op)
+.. c:function:: double PyComplex_RealAsDouble(PyObject *op)
- Return the real part of *op* as a C :ctype:`double`.
+ Return the real part of *op* as a C :c:type:`double`.
-.. cfunction:: double PyComplex_ImagAsDouble(PyObject *op)
+.. c:function:: double PyComplex_ImagAsDouble(PyObject *op)
- Return the imaginary part of *op* as a C :ctype:`double`.
+ Return the imaginary part of *op* as a C :c:type:`double`.
-.. cfunction:: Py_complex PyComplex_AsCComplex(PyObject *op)
+.. c:function:: Py_complex PyComplex_AsCComplex(PyObject *op)
- Return the :ctype:`Py_complex` value of the complex number *op*.
+ Return the :c:type:`Py_complex` value of the complex number *op*.
If *op* is not a Python complex number object but has a :meth:`__complex__`
method, this method will first be called to convert *op* to a Python complex
diff --git a/Doc/c-api/concrete.rst b/Doc/c-api/concrete.rst
index d72859989f..65904ee49d 100644
--- a/Doc/c-api/concrete.rst
+++ b/Doc/c-api/concrete.rst
@@ -11,7 +11,7 @@ The functions in this chapter are specific to certain Python object types.
Passing them an object of the wrong type is not a good idea; if you receive an
object from a Python program and you are not sure that it has the right type,
you must perform a type check first; for example, to check that an object is a
-dictionary, use :cfunc:`PyDict_Check`. The chapter is structured like the
+dictionary, use :c:func:`PyDict_Check`. The chapter is structured like the
"family tree" of Python object types.
.. warning::
@@ -102,7 +102,7 @@ Other Objects
memoryview.rst
weakref.rst
capsule.rst
- cobject.rst
cell.rst
gen.rst
datetime.rst
+ code.rst
diff --git a/Doc/c-api/conversion.rst b/Doc/c-api/conversion.rst
index ad3f2fa16b..dfc0a3aace 100644
--- a/Doc/c-api/conversion.rst
+++ b/Doc/c-api/conversion.rst
@@ -8,20 +8,20 @@ String conversion and formatting
Functions for number conversion and formatted string output.
-.. cfunction:: int PyOS_snprintf(char *str, size_t size, const char *format, ...)
+.. c:function:: int PyOS_snprintf(char *str, size_t size, const char *format, ...)
Output not more than *size* bytes to *str* according to the format string
*format* and the extra arguments. See the Unix man page :manpage:`snprintf(2)`.
-.. cfunction:: int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
+.. c:function:: int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
Output not more than *size* bytes to *str* according to the format string
*format* and the variable argument list *va*. Unix man page
:manpage:`vsnprintf(2)`.
-:cfunc:`PyOS_snprintf` and :cfunc:`PyOS_vsnprintf` wrap the Standard C library
-functions :cfunc:`snprintf` and :cfunc:`vsnprintf`. Their purpose is to
+:c:func:`PyOS_snprintf` and :c:func:`PyOS_vsnprintf` wrap the Standard C library
+functions :c:func:`snprintf` and :c:func:`vsnprintf`. Their purpose is to
guarantee consistent behavior in corner cases, which the Standard C functions do
not.
@@ -30,7 +30,7 @@ never write more than *size* bytes (including the trailing ``'\0'``) into str.
Both functions require that ``str != NULL``, ``size > 0`` and ``format !=
NULL``.
-If the platform doesn't have :cfunc:`vsnprintf` and the buffer size needed to
+If the platform doesn't have :c:func:`vsnprintf` and the buffer size needed to
avoid truncation exceeds *size* by more than 512 bytes, Python aborts with a
*Py_FatalError*.
@@ -51,24 +51,9 @@ The return value (*rv*) for these functions should be interpreted as follows:
The following functions provide locale-independent string to number conversions.
-.. cfunction:: double PyOS_ascii_strtod(const char *nptr, char **endptr)
+.. c:function:: double PyOS_string_to_double(const char *s, char **endptr, PyObject *overflow_exception)
- Convert a string to a :ctype:`double`. This function behaves like the Standard C
- function :cfunc:`strtod` does in the C locale. It does this without changing the
- current locale, since that would not be thread-safe.
-
- :cfunc:`PyOS_ascii_strtod` should typically be used for reading configuration
- files or other non-user input that should be locale independent.
-
- See the Unix man page :manpage:`strtod(2)` for details.
-
- .. deprecated:: 3.1
- Use :cfunc:`PyOS_string_to_double` instead.
-
-
-.. cfunction:: double PyOS_string_to_double(const char *s, char **endptr, PyObject *overflow_exception)
-
- Convert a string ``s`` to a :ctype:`double`, raising a Python
+ Convert a string ``s`` to a :c:type:`double`, raising a Python
exception on failure. The set of accepted strings corresponds to
the set of strings accepted by Python's :func:`float` constructor,
except that ``s`` must not have leading or trailing whitespace.
@@ -100,23 +85,9 @@ The following functions provide locale-independent string to number conversions.
.. versionadded:: 3.1
-.. cfunction:: char* PyOS_ascii_formatd(char *buffer, size_t buf_len, const char *format, double d)
-
- Convert a :ctype:`double` to a string using the ``'.'`` as the decimal
- separator. *format* is a :cfunc:`printf`\ -style format string specifying the
- number format. Allowed conversion characters are ``'e'``, ``'E'``, ``'f'``,
- ``'F'``, ``'g'`` and ``'G'``.
-
- The return value is a pointer to *buffer* with the converted string or NULL if
- the conversion failed.
+.. c:function:: char* PyOS_double_to_string(double val, char format_code, int precision, int flags, int *ptype)
- .. deprecated:: 3.1
- Use :cfunc:`PyOS_double_to_string` instead.
-
-
-.. cfunction:: char* PyOS_double_to_string(double val, char format_code, int precision, int flags, int *ptype)
-
- Convert a :ctype:`double` *val* to a string using supplied
+ Convert a :c:type:`double` *val* to a string using supplied
*format_code*, *precision*, and *flags*.
*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``,
@@ -134,7 +105,7 @@ The following functions provide locale-independent string to number conversions.
like an integer.
* *Py_DTSF_ALT* means to apply "alternate" formatting rules. See the
- documentation for the :cfunc:`PyOS_snprintf` ``'#'`` specifier for
+ documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for
details.
If *ptype* is non-NULL, then the value it points to will be set to one of
@@ -143,28 +114,18 @@ The following functions provide locale-independent string to number conversions.
The return value is a pointer to *buffer* with the converted string or
*NULL* if the conversion failed. The caller is responsible for freeing the
- returned string by calling :cfunc:`PyMem_Free`.
+ returned string by calling :c:func:`PyMem_Free`.
.. versionadded:: 3.1
-.. cfunction:: double PyOS_ascii_atof(const char *nptr)
-
- Convert a string to a :ctype:`double` in a locale-independent way.
-
- See the Unix man page :manpage:`atof(2)` for details.
-
- .. deprecated:: 3.1
- Use :cfunc:`PyOS_string_to_double` instead.
-
-
-.. cfunction:: char* PyOS_stricmp(char *s1, char *s2)
+.. c:function:: char* PyOS_stricmp(char *s1, char *s2)
Case insensitive comparison of strings. The function works almost
- identically to :cfunc:`strcmp` except that it ignores the case.
+ identically to :c:func:`strcmp` except that it ignores the case.
-.. cfunction:: char* PyOS_strnicmp(char *s1, char *s2, Py_ssize_t size)
+.. c:function:: char* PyOS_strnicmp(char *s1, char *s2, Py_ssize_t size)
Case insensitive comparison of strings. The function works almost
- identically to :cfunc:`strncmp` except that it ignores the case.
+ identically to :c:func:`strncmp` except that it ignores the case.
diff --git a/Doc/c-api/datetime.rst b/Doc/c-api/datetime.rst
index 6515babbde..fcd13954a3 100644
--- a/Doc/c-api/datetime.rst
+++ b/Doc/c-api/datetime.rst
@@ -8,93 +8,93 @@ DateTime Objects
Various date and time objects are supplied by the :mod:`datetime` module.
Before using any of these functions, the header file :file:`datetime.h` must be
included in your source (note that this is not included by :file:`Python.h`),
-and the macro :cmacro:`PyDateTime_IMPORT` must be invoked, usually as part of
+and the macro :c:macro:`PyDateTime_IMPORT` must be invoked, usually as part of
the module initialisation function. The macro puts a pointer to a C structure
-into a static variable, :cdata:`PyDateTimeAPI`, that is used by the following
+into a static variable, :c:data:`PyDateTimeAPI`, that is used by the following
macros.
Type-check macros:
-.. cfunction:: int PyDate_Check(PyObject *ob)
+.. c:function:: int PyDate_Check(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_DateType` or a subtype of
- :cdata:`PyDateTime_DateType`. *ob* must not be *NULL*.
+ Return true if *ob* is of type :c:data:`PyDateTime_DateType` or a subtype of
+ :c:data:`PyDateTime_DateType`. *ob* must not be *NULL*.
-.. cfunction:: int PyDate_CheckExact(PyObject *ob)
+.. c:function:: int PyDate_CheckExact(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_DateType`. *ob* must not be
+ Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not be
*NULL*.
-.. cfunction:: int PyDateTime_Check(PyObject *ob)
+.. c:function:: int PyDateTime_Check(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_DateTimeType` or a subtype of
- :cdata:`PyDateTime_DateTimeType`. *ob* must not be *NULL*.
+ Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType` or a subtype of
+ :c:data:`PyDateTime_DateTimeType`. *ob* must not be *NULL*.
-.. cfunction:: int PyDateTime_CheckExact(PyObject *ob)
+.. c:function:: int PyDateTime_CheckExact(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_DateTimeType`. *ob* must not
+ Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must not
be *NULL*.
-.. cfunction:: int PyTime_Check(PyObject *ob)
+.. c:function:: int PyTime_Check(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_TimeType` or a subtype of
- :cdata:`PyDateTime_TimeType`. *ob* must not be *NULL*.
+ Return true if *ob* is of type :c:data:`PyDateTime_TimeType` or a subtype of
+ :c:data:`PyDateTime_TimeType`. *ob* must not be *NULL*.
-.. cfunction:: int PyTime_CheckExact(PyObject *ob)
+.. c:function:: int PyTime_CheckExact(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_TimeType`. *ob* must not be
+ Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not be
*NULL*.
-.. cfunction:: int PyDelta_Check(PyObject *ob)
+.. c:function:: int PyDelta_Check(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_DeltaType` or a subtype of
- :cdata:`PyDateTime_DeltaType`. *ob* must not be *NULL*.
+ Return true if *ob* is of type :c:data:`PyDateTime_DeltaType` or a subtype of
+ :c:data:`PyDateTime_DeltaType`. *ob* must not be *NULL*.
-.. cfunction:: int PyDelta_CheckExact(PyObject *ob)
+.. c:function:: int PyDelta_CheckExact(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_DeltaType`. *ob* must not be
+ Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not be
*NULL*.
-.. cfunction:: int PyTZInfo_Check(PyObject *ob)
+.. c:function:: int PyTZInfo_Check(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_TZInfoType` or a subtype of
- :cdata:`PyDateTime_TZInfoType`. *ob* must not be *NULL*.
+ Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType` or a subtype of
+ :c:data:`PyDateTime_TZInfoType`. *ob* must not be *NULL*.
-.. cfunction:: int PyTZInfo_CheckExact(PyObject *ob)
+.. c:function:: int PyTZInfo_CheckExact(PyObject *ob)
- Return true if *ob* is of type :cdata:`PyDateTime_TZInfoType`. *ob* must not be
+ Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must not be
*NULL*.
Macros to create objects:
-.. cfunction:: PyObject* PyDate_FromDate(int year, int month, int day)
+.. c:function:: PyObject* PyDate_FromDate(int year, int month, int day)
Return a ``datetime.date`` object with the specified year, month and day.
-.. cfunction:: PyObject* PyDateTime_FromDateAndTime(int year, int month, int day, int hour, int minute, int second, int usecond)
+.. c:function:: PyObject* PyDateTime_FromDateAndTime(int year, int month, int day, int hour, int minute, int second, int usecond)
Return a ``datetime.datetime`` object with the specified year, month, day, hour,
minute, second and microsecond.
-.. cfunction:: PyObject* PyTime_FromTime(int hour, int minute, int second, int usecond)
+.. c:function:: PyObject* PyTime_FromTime(int hour, int minute, int second, int usecond)
Return a ``datetime.time`` object with the specified hour, minute, second and
microsecond.
-.. cfunction:: PyObject* PyDelta_FromDSU(int days, int seconds, int useconds)
+.. c:function:: PyObject* PyDelta_FromDSU(int days, int seconds, int useconds)
Return a ``datetime.timedelta`` object representing the given number of days,
seconds and microseconds. Normalization is performed so that the resulting
@@ -103,82 +103,82 @@ Macros to create objects:
Macros to extract fields from date objects. The argument must be an instance of
-:cdata:`PyDateTime_Date`, including subclasses (such as
-:cdata:`PyDateTime_DateTime`). The argument must not be *NULL*, and the type is
+:c:data:`PyDateTime_Date`, including subclasses (such as
+:c:data:`PyDateTime_DateTime`). The argument must not be *NULL*, and the type is
not checked:
-.. cfunction:: int PyDateTime_GET_YEAR(PyDateTime_Date *o)
+.. c:function:: int PyDateTime_GET_YEAR(PyDateTime_Date *o)
Return the year, as a positive int.
-.. cfunction:: int PyDateTime_GET_MONTH(PyDateTime_Date *o)
+.. c:function:: int PyDateTime_GET_MONTH(PyDateTime_Date *o)
Return the month, as an int from 1 through 12.
-.. cfunction:: int PyDateTime_GET_DAY(PyDateTime_Date *o)
+.. c:function:: int PyDateTime_GET_DAY(PyDateTime_Date *o)
Return the day, as an int from 1 through 31.
Macros to extract fields from datetime objects. The argument must be an
-instance of :cdata:`PyDateTime_DateTime`, including subclasses. The argument
+instance of :c:data:`PyDateTime_DateTime`, including subclasses. The argument
must not be *NULL*, and the type is not checked:
-.. cfunction:: int PyDateTime_DATE_GET_HOUR(PyDateTime_DateTime *o)
+.. c:function:: int PyDateTime_DATE_GET_HOUR(PyDateTime_DateTime *o)
Return the hour, as an int from 0 through 23.
-.. cfunction:: int PyDateTime_DATE_GET_MINUTE(PyDateTime_DateTime *o)
+.. c:function:: int PyDateTime_DATE_GET_MINUTE(PyDateTime_DateTime *o)
Return the minute, as an int from 0 through 59.
-.. cfunction:: int PyDateTime_DATE_GET_SECOND(PyDateTime_DateTime *o)
+.. c:function:: int PyDateTime_DATE_GET_SECOND(PyDateTime_DateTime *o)
Return the second, as an int from 0 through 59.
-.. cfunction:: int PyDateTime_DATE_GET_MICROSECOND(PyDateTime_DateTime *o)
+.. c:function:: int PyDateTime_DATE_GET_MICROSECOND(PyDateTime_DateTime *o)
Return the microsecond, as an int from 0 through 999999.
Macros to extract fields from time objects. The argument must be an instance of
-:cdata:`PyDateTime_Time`, including subclasses. The argument must not be *NULL*,
+:c:data:`PyDateTime_Time`, including subclasses. The argument must not be *NULL*,
and the type is not checked:
-.. cfunction:: int PyDateTime_TIME_GET_HOUR(PyDateTime_Time *o)
+.. c:function:: int PyDateTime_TIME_GET_HOUR(PyDateTime_Time *o)
Return the hour, as an int from 0 through 23.
-.. cfunction:: int PyDateTime_TIME_GET_MINUTE(PyDateTime_Time *o)
+.. c:function:: int PyDateTime_TIME_GET_MINUTE(PyDateTime_Time *o)
Return the minute, as an int from 0 through 59.
-.. cfunction:: int PyDateTime_TIME_GET_SECOND(PyDateTime_Time *o)
+.. c:function:: int PyDateTime_TIME_GET_SECOND(PyDateTime_Time *o)
Return the second, as an int from 0 through 59.
-.. cfunction:: int PyDateTime_TIME_GET_MICROSECOND(PyDateTime_Time *o)
+.. c:function:: int PyDateTime_TIME_GET_MICROSECOND(PyDateTime_Time *o)
Return the microsecond, as an int from 0 through 999999.
Macros for the convenience of modules implementing the DB API:
-.. cfunction:: PyObject* PyDateTime_FromTimestamp(PyObject *args)
+.. c:function:: PyObject* PyDateTime_FromTimestamp(PyObject *args)
Create and return a new ``datetime.datetime`` object given an argument tuple
suitable for passing to ``datetime.datetime.fromtimestamp()``.
-.. cfunction:: PyObject* PyDate_FromTimestamp(PyObject *args)
+.. c:function:: PyObject* PyDate_FromTimestamp(PyObject *args)
Create and return a new ``datetime.date`` object given an argument tuple
suitable for passing to ``datetime.date.fromtimestamp()``.
diff --git a/Doc/c-api/descriptor.rst b/Doc/c-api/descriptor.rst
index 5db257072a..c8f6fa5bcd 100644
--- a/Doc/c-api/descriptor.rst
+++ b/Doc/c-api/descriptor.rst
@@ -10,31 +10,31 @@ found in the dictionary of type objects.
.. XXX document these!
-.. cvar:: PyTypeObject PyProperty_Type
+.. c:var:: PyTypeObject PyProperty_Type
The type object for the built-in descriptor types.
-.. cfunction:: PyObject* PyDescr_NewGetSet(PyTypeObject *type, struct PyGetSetDef *getset)
+.. c:function:: PyObject* PyDescr_NewGetSet(PyTypeObject *type, struct PyGetSetDef *getset)
-.. cfunction:: PyObject* PyDescr_NewMember(PyTypeObject *type, struct PyMemberDef *meth)
+.. c:function:: PyObject* PyDescr_NewMember(PyTypeObject *type, struct PyMemberDef *meth)
-.. cfunction:: PyObject* PyDescr_NewMethod(PyTypeObject *type, struct PyMethodDef *meth)
+.. c:function:: PyObject* PyDescr_NewMethod(PyTypeObject *type, struct PyMethodDef *meth)
-.. cfunction:: PyObject* PyDescr_NewWrapper(PyTypeObject *type, struct wrapperbase *wrapper, void *wrapped)
+.. c:function:: PyObject* PyDescr_NewWrapper(PyTypeObject *type, struct wrapperbase *wrapper, void *wrapped)
-.. cfunction:: PyObject* PyDescr_NewClassMethod(PyTypeObject *type, PyMethodDef *method)
+.. c:function:: PyObject* PyDescr_NewClassMethod(PyTypeObject *type, PyMethodDef *method)
-.. cfunction:: int PyDescr_IsData(PyObject *descr)
+.. c:function:: int PyDescr_IsData(PyObject *descr)
Return true if the descriptor objects *descr* describes a data attribute, or
false if it describes a method. *descr* must be a descriptor object; there is
no error checking.
-.. cfunction:: PyObject* PyWrapper_New(PyObject *, PyObject *)
+.. c:function:: PyObject* PyWrapper_New(PyObject *, PyObject *)
diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst
index 5d355d1e61..6df84e075a 100644
--- a/Doc/c-api/dict.rst
+++ b/Doc/c-api/dict.rst
@@ -8,125 +8,125 @@ Dictionary Objects
.. index:: object: dictionary
-.. ctype:: PyDictObject
+.. c:type:: PyDictObject
- This subtype of :ctype:`PyObject` represents a Python dictionary object.
+ This subtype of :c:type:`PyObject` represents a Python dictionary object.
-.. cvar:: PyTypeObject PyDict_Type
+.. c:var:: PyTypeObject PyDict_Type
- This instance of :ctype:`PyTypeObject` represents the Python dictionary
+ This instance of :c:type:`PyTypeObject` represents the Python dictionary
type. This is the same object as :class:`dict` in the Python layer.
-.. cfunction:: int PyDict_Check(PyObject *p)
+.. c:function:: int PyDict_Check(PyObject *p)
Return true if *p* is a dict object or an instance of a subtype of the dict
type.
-.. cfunction:: int PyDict_CheckExact(PyObject *p)
+.. c:function:: int PyDict_CheckExact(PyObject *p)
Return true if *p* is a dict object, but not an instance of a subtype of
the dict type.
-.. cfunction:: PyObject* PyDict_New()
+.. c:function:: PyObject* PyDict_New()
Return a new empty dictionary, or *NULL* on failure.
-.. cfunction:: PyObject* PyDictProxy_New(PyObject *dict)
+.. c:function:: PyObject* PyDictProxy_New(PyObject *dict)
Return a proxy object for a mapping which enforces read-only behavior.
This is normally used to create a proxy to prevent modification of the
dictionary for non-dynamic class types.
-.. cfunction:: void PyDict_Clear(PyObject *p)
+.. c:function:: void PyDict_Clear(PyObject *p)
Empty an existing dictionary of all key-value pairs.
-.. cfunction:: int PyDict_Contains(PyObject *p, PyObject *key)
+.. c:function:: int PyDict_Contains(PyObject *p, PyObject *key)
Determine if dictionary *p* contains *key*. If an item in *p* is matches
*key*, return ``1``, otherwise return ``0``. On error, return ``-1``.
This is equivalent to the Python expression ``key in p``.
-.. cfunction:: PyObject* PyDict_Copy(PyObject *p)
+.. c:function:: PyObject* PyDict_Copy(PyObject *p)
Return a new dictionary that contains the same key-value pairs as *p*.
-.. cfunction:: int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val)
+.. c:function:: int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val)
Insert *value* into the dictionary *p* with a key of *key*. *key* must be
:term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return
``0`` on success or ``-1`` on failure.
-.. cfunction:: int PyDict_SetItemString(PyObject *p, const char *key, PyObject *val)
+.. c:function:: int PyDict_SetItemString(PyObject *p, const char *key, PyObject *val)
.. index:: single: PyUnicode_FromString()
Insert *value* into the dictionary *p* using *key* as a key. *key* should
- be a :ctype:`char\*`. The key object is created using
+ be a :c:type:`char\*`. The key object is created using
``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on
failure.
-.. cfunction:: int PyDict_DelItem(PyObject *p, PyObject *key)
+.. c:function:: int PyDict_DelItem(PyObject *p, PyObject *key)
Remove the entry in dictionary *p* with key *key*. *key* must be hashable;
if it isn't, :exc:`TypeError` is raised. Return ``0`` on success or ``-1``
on failure.
-.. cfunction:: int PyDict_DelItemString(PyObject *p, char *key)
+.. c:function:: int PyDict_DelItemString(PyObject *p, char *key)
Remove the entry in dictionary *p* which has a key specified by the string
*key*. Return ``0`` on success or ``-1`` on failure.
-.. cfunction:: PyObject* PyDict_GetItem(PyObject *p, PyObject *key)
+.. c:function:: PyObject* PyDict_GetItem(PyObject *p, PyObject *key)
Return the object from dictionary *p* which has a key *key*. Return *NULL*
if the key *key* is not present, but *without* setting an exception.
-.. cfunction:: PyObject* PyDict_GetItemWithError(PyObject *p, PyObject *key)
+.. c:function:: PyObject* PyDict_GetItemWithError(PyObject *p, PyObject *key)
- Variant of :cfunc:`PyDict_GetItem` that does not suppress
+ Variant of :c:func:`PyDict_GetItem` that does not suppress
exceptions. Return *NULL* **with** an exception set if an exception
occurred. Return *NULL* **without** an exception set if the key
wasn't present.
-.. cfunction:: PyObject* PyDict_GetItemString(PyObject *p, const char *key)
+.. c:function:: PyObject* PyDict_GetItemString(PyObject *p, const char *key)
- This is the same as :cfunc:`PyDict_GetItem`, but *key* is specified as a
- :ctype:`char\*`, rather than a :ctype:`PyObject\*`.
+ This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a
+ :c:type:`char\*`, rather than a :c:type:`PyObject\*`.
-.. cfunction:: PyObject* PyDict_Items(PyObject *p)
+.. c:function:: PyObject* PyDict_Items(PyObject *p)
- Return a :ctype:`PyListObject` containing all the items from the dictionary.
+ Return a :c:type:`PyListObject` containing all the items from the dictionary.
-.. cfunction:: PyObject* PyDict_Keys(PyObject *p)
+.. c:function:: PyObject* PyDict_Keys(PyObject *p)
- Return a :ctype:`PyListObject` containing all the keys from the dictionary.
+ Return a :c:type:`PyListObject` containing all the keys from the dictionary.
-.. cfunction:: PyObject* PyDict_Values(PyObject *p)
+.. c:function:: PyObject* PyDict_Values(PyObject *p)
- Return a :ctype:`PyListObject` containing all the values from the dictionary
+ Return a :c:type:`PyListObject` containing all the values from the dictionary
*p*.
-.. cfunction:: Py_ssize_t PyDict_Size(PyObject *p)
+.. c:function:: Py_ssize_t PyDict_Size(PyObject *p)
.. index:: builtin: len
@@ -134,14 +134,14 @@ Dictionary Objects
``len(p)`` on a dictionary.
-.. cfunction:: int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
+.. c:function:: int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
Iterate over all key-value pairs in the dictionary *p*. The
- :ctype:`Py_ssize_t` referred to by *ppos* must be initialized to ``0``
+ :c:type:`Py_ssize_t` referred to by *ppos* must be initialized to ``0``
prior to the first call to this function to start the iteration; the
function returns true for each pair in the dictionary, and false once all
pairs have been reported. The parameters *pkey* and *pvalue* should either
- point to :ctype:`PyObject\*` variables that will be filled in with each key
+ point to :c:type:`PyObject\*` variables that will be filled in with each key
and value, respectively, or may be *NULL*. Any references returned through
them are borrowed. *ppos* should not be altered during iteration. Its
value represents offsets within the internal dictionary structure, and
@@ -180,23 +180,23 @@ Dictionary Objects
}
-.. cfunction:: int PyDict_Merge(PyObject *a, PyObject *b, int override)
+.. c:function:: int PyDict_Merge(PyObject *a, PyObject *b, int override)
Iterate over mapping object *b* adding key-value pairs to dictionary *a*.
- *b* may be a dictionary, or any object supporting :func:`PyMapping_Keys`
- and :func:`PyObject_GetItem`. If *override* is true, existing pairs in *a*
+ *b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys`
+ and :c:func:`PyObject_GetItem`. If *override* is true, existing pairs in *a*
will be replaced if a matching key is found in *b*, otherwise pairs will
only be added if there is not a matching key in *a*. Return ``0`` on
success or ``-1`` if an exception was raised.
-.. cfunction:: int PyDict_Update(PyObject *a, PyObject *b)
+.. c:function:: int PyDict_Update(PyObject *a, PyObject *b)
This is the same as ``PyDict_Merge(a, b, 1)`` in C, or ``a.update(b)`` in
Python. Return ``0`` on success or ``-1`` if an exception was raised.
-.. cfunction:: int PyDict_MergeFromSeq2(PyObject *a, PyObject *seq2, int override)
+.. c:function:: int PyDict_MergeFromSeq2(PyObject *a, PyObject *seq2, int override)
Update or merge into dictionary *a*, from the key-value pairs in *seq2*.
*seq2* must be an iterable object producing iterable objects of length 2,
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index f465c5822c..4c946c1d6a 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -9,12 +9,12 @@ Exception Handling
The functions described in this chapter will let you handle and raise Python
exceptions. It is important to understand some of the basics of Python
-exception handling. It works somewhat like the Unix :cdata:`errno` variable:
+exception handling. It works somewhat like the Unix :c:data:`errno` variable:
there is a global indicator (per thread) of the last error that occurred. Most
functions don't clear this on success, but will set it to indicate the cause of
the error on failure. Most functions also return an error indicator, usually
*NULL* if they are supposed to return a pointer, or ``-1`` if they return an
-integer (exception: the :cfunc:`PyArg_\*` functions return ``1`` for success and
+integer (exception: the :c:func:`PyArg_\*` functions return ``1`` for success and
``0`` for failure).
When a function must fail because some function it called failed, it generally
@@ -35,7 +35,7 @@ in various ways. There is a separate error indicator for each thread.
Either alphabetical or some kind of structure.
-.. cfunction:: void PyErr_PrintEx(int set_sys_last_vars)
+.. c:function:: void PyErr_PrintEx(int set_sys_last_vars)
Print a standard traceback to ``sys.stderr`` and clear the error indicator.
Call this function only when the error indicator is set. (Otherwise it will
@@ -46,35 +46,35 @@ in various ways. There is a separate error indicator for each thread.
type, value and traceback of the printed exception, respectively.
-.. cfunction:: void PyErr_Print()
+.. c:function:: void PyErr_Print()
Alias for ``PyErr_PrintEx(1)``.
-.. cfunction:: PyObject* PyErr_Occurred()
+.. c:function:: PyObject* PyErr_Occurred()
Test whether the error indicator is set. If set, return the exception *type*
- (the first argument to the last call to one of the :cfunc:`PyErr_Set\*`
- functions or to :cfunc:`PyErr_Restore`). If not set, return *NULL*. You do not
- own a reference to the return value, so you do not need to :cfunc:`Py_DECREF`
+ (the first argument to the last call to one of the :c:func:`PyErr_Set\*`
+ functions or to :c:func:`PyErr_Restore`). If not set, return *NULL*. You do not
+ own a reference to the return value, so you do not need to :c:func:`Py_DECREF`
it.
.. note::
Do not compare the return value to a specific exception; use
- :cfunc:`PyErr_ExceptionMatches` instead, shown below. (The comparison could
+ :c:func:`PyErr_ExceptionMatches` instead, shown below. (The comparison could
easily fail since the exception may be an instance instead of a class, in the
case of a class exception, or it may the a subclass of the expected exception.)
-.. cfunction:: int PyErr_ExceptionMatches(PyObject *exc)
+.. c:function:: int PyErr_ExceptionMatches(PyObject *exc)
Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This
should only be called when an exception is actually set; a memory access
violation will occur if no exception has been raised.
-.. cfunction:: int PyErr_GivenExceptionMatches(PyObject *given, PyObject *exc)
+.. c:function:: int PyErr_GivenExceptionMatches(PyObject *given, PyObject *exc)
Return true if the *given* exception matches the exception in *exc*. If
*exc* is a class object, this also returns true when *given* is an instance
@@ -82,22 +82,22 @@ in various ways. There is a separate error indicator for each thread.
recursively in subtuples) are searched for a match.
-.. cfunction:: void PyErr_NormalizeException(PyObject**exc, PyObject**val, PyObject**tb)
+.. c:function:: void PyErr_NormalizeException(PyObject**exc, PyObject**val, PyObject**tb)
- Under certain circumstances, the values returned by :cfunc:`PyErr_Fetch` below
+ Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` below
can be "unnormalized", meaning that ``*exc`` is a class object but ``*val`` is
not an instance of the same class. This function can be used to instantiate
the class in that case. If the values are already normalized, nothing happens.
The delayed normalization is implemented to improve performance.
-.. cfunction:: void PyErr_Clear()
+.. c:function:: void PyErr_Clear()
Clear the error indicator. If the error indicator is not set, there is no
effect.
-.. cfunction:: void PyErr_Fetch(PyObject **ptype, PyObject **pvalue, PyObject **ptraceback)
+.. c:function:: void PyErr_Fetch(PyObject **ptype, PyObject **pvalue, PyObject **ptraceback)
Retrieve the error indicator into three variables whose addresses are passed.
If the error indicator is not set, set all three variables to *NULL*. If it is
@@ -110,7 +110,7 @@ in various ways. There is a separate error indicator for each thread.
by code that needs to save and restore the error indicator temporarily.
-.. cfunction:: void PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
+.. c:function:: void PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
Set the error indicator from the three objects. If the error indicator is
already set, it is cleared first. If the objects are *NULL*, the error
@@ -125,107 +125,129 @@ in various ways. There is a separate error indicator for each thread.
.. note::
This function is normally only used by code that needs to save and restore the
- error indicator temporarily; use :cfunc:`PyErr_Fetch` to save the current
+ error indicator temporarily; use :c:func:`PyErr_Fetch` to save the current
exception state.
-.. cfunction:: void PyErr_SetString(PyObject *type, const char *message)
+.. c:function:: void PyErr_SetString(PyObject *type, const char *message)
This is the most common way to set the error indicator. The first argument
specifies the exception type; it is normally one of the standard exceptions,
- e.g. :cdata:`PyExc_RuntimeError`. You need not increment its reference count.
- The second argument is an error message; it is converted to a string object.
+ e.g. :c:data:`PyExc_RuntimeError`. You need not increment its reference count.
+ The second argument is an error message; it is decoded from ``'utf-8``'.
-.. cfunction:: void PyErr_SetObject(PyObject *type, PyObject *value)
+.. c:function:: void PyErr_SetObject(PyObject *type, PyObject *value)
- This function is similar to :cfunc:`PyErr_SetString` but lets you specify an
+ This function is similar to :c:func:`PyErr_SetString` but lets you specify an
arbitrary Python object for the "value" of the exception.
-.. cfunction:: PyObject* PyErr_Format(PyObject *exception, const char *format, ...)
+.. c:function:: PyObject* PyErr_Format(PyObject *exception, const char *format, ...)
This function sets the error indicator and returns *NULL*. *exception*
should be a Python exception class. The *format* and subsequent
parameters help format the error message; they have the same meaning and
- values as in :cfunc:`PyUnicode_FromFormat`.
+ values as in :c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded
+ string.
-.. cfunction:: void PyErr_SetNone(PyObject *type)
+.. c:function:: void PyErr_SetNone(PyObject *type)
This is a shorthand for ``PyErr_SetObject(type, Py_None)``.
-.. cfunction:: int PyErr_BadArgument()
+.. c:function:: int PyErr_BadArgument()
This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where
*message* indicates that a built-in operation was invoked with an illegal
argument. It is mostly for internal use.
-.. cfunction:: PyObject* PyErr_NoMemory()
+.. c:function:: PyObject* PyErr_NoMemory()
This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns *NULL*
so an object allocation function can write ``return PyErr_NoMemory();`` when it
runs out of memory.
-.. cfunction:: PyObject* PyErr_SetFromErrno(PyObject *type)
+.. c:function:: PyObject* PyErr_SetFromErrno(PyObject *type)
.. index:: single: strerror()
This is a convenience function to raise an exception when a C library function
- has returned an error and set the C variable :cdata:`errno`. It constructs a
- tuple object whose first item is the integer :cdata:`errno` value and whose
- second item is the corresponding error message (gotten from :cfunc:`strerror`),
+ has returned an error and set the C variable :c:data:`errno`. It constructs a
+ tuple object whose first item is the integer :c:data:`errno` value and whose
+ second item is the corresponding error message (gotten from :c:func:`strerror`),
and then calls ``PyErr_SetObject(type, object)``. On Unix, when the
- :cdata:`errno` value is :const:`EINTR`, indicating an interrupted system call,
- this calls :cfunc:`PyErr_CheckSignals`, and if that set the error indicator,
+ :c:data:`errno` value is :const:`EINTR`, indicating an interrupted system call,
+ this calls :c:func:`PyErr_CheckSignals`, and if that set the error indicator,
leaves it set to that. The function always returns *NULL*, so a wrapper
function around a system call can write ``return PyErr_SetFromErrno(type);``
when the system call returns an error.
-.. cfunction:: PyObject* PyErr_SetFromErrnoWithFilename(PyObject *type, const char *filename)
+.. c:function:: PyObject* PyErr_SetFromErrnoWithFilename(PyObject *type, const char *filename)
- Similar to :cfunc:`PyErr_SetFromErrno`, with the additional behavior that if
+ Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that if
*filename* is not *NULL*, it is passed to the constructor of *type* as a third
parameter. In the case of exceptions such as :exc:`IOError` and :exc:`OSError`,
this is used to define the :attr:`filename` attribute of the exception instance.
+ *filename* is decoded from the filesystem encoding
+ (:func:`sys.getfilesystemencoding`).
-.. cfunction:: PyObject* PyErr_SetFromWindowsErr(int ierr)
+.. c:function:: PyObject* PyErr_SetFromWindowsErr(int ierr)
This is a convenience function to raise :exc:`WindowsError`. If called with
- *ierr* of :cdata:`0`, the error code returned by a call to :cfunc:`GetLastError`
- is used instead. It calls the Win32 function :cfunc:`FormatMessage` to retrieve
- the Windows description of error code given by *ierr* or :cfunc:`GetLastError`,
+ *ierr* of :c:data:`0`, the error code returned by a call to :c:func:`GetLastError`
+ is used instead. It calls the Win32 function :c:func:`FormatMessage` to retrieve
+ the Windows description of error code given by *ierr* or :c:func:`GetLastError`,
then it constructs a tuple object whose first item is the *ierr* value and whose
second item is the corresponding error message (gotten from
- :cfunc:`FormatMessage`), and then calls ``PyErr_SetObject(PyExc_WindowsError,
+ :c:func:`FormatMessage`), and then calls ``PyErr_SetObject(PyExc_WindowsError,
object)``. This function always returns *NULL*. Availability: Windows.
-.. cfunction:: PyObject* PyErr_SetExcFromWindowsErr(PyObject *type, int ierr)
+.. c:function:: PyObject* PyErr_SetExcFromWindowsErr(PyObject *type, int ierr)
- Similar to :cfunc:`PyErr_SetFromWindowsErr`, with an additional parameter
+ Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter
specifying the exception type to be raised. Availability: Windows.
-.. cfunction:: PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename)
+.. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename)
- Similar to :cfunc:`PyErr_SetFromWindowsErr`, with the additional behavior that
+ Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior that
if *filename* is not *NULL*, it is passed to the constructor of
- :exc:`WindowsError` as a third parameter. Availability: Windows.
+ :exc:`WindowsError` as a third parameter. *filename* is decoded from the
+ filesystem encoding (:func:`sys.getfilesystemencoding`). Availability:
+ Windows.
-.. cfunction:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, char *filename)
+.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, char *filename)
- Similar to :cfunc:`PyErr_SetFromWindowsErrWithFilename`, with an additional
+ Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional
parameter specifying the exception type to be raised. Availability: Windows.
-.. cfunction:: void PyErr_BadInternalCall()
+.. c:function:: void PyErr_SyntaxLocationEx(char *filename, int lineno, int col_offset)
+
+ Set file, line, and offset information for the current exception. If the
+ current exception is not a :exc:`SyntaxError`, then it sets additional
+ attributes, which make the exception printing subsystem think the exception
+ is a :exc:`SyntaxError`. *filename* is decoded from the filesystem encoding
+ (:func:`sys.getfilesystemencoding`).
+
+.. versionadded:: 3.2
+
+
+.. c:function:: void PyErr_SyntaxLocation(char *filename, int lineno)
+
+ Like :c:func:`PyErr_SyntaxLocationExc`, but the col_offset parameter is
+ omitted.
+
+
+.. c:function:: void PyErr_BadInternalCall()
This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``,
where *message* indicates that an internal operation (e.g. a Python/C API
@@ -233,13 +255,13 @@ in various ways. There is a separate error indicator for each thread.
use.
-.. cfunction:: int PyErr_WarnEx(PyObject *category, char *message, int stacklevel)
+.. c:function:: int PyErr_WarnEx(PyObject *category, char *message, int stack_level)
Issue a warning message. The *category* argument is a warning category (see
- below) or *NULL*; the *message* argument is a message string. *stacklevel* is a
+ below) or *NULL*; the *message* argument is an UTF-8 encoded string. *stack_level* is a
positive number giving a number of stack frames; the warning will be issued from
- the currently executing line of code in that stack frame. A *stacklevel* of 1
- is the function calling :cfunc:`PyErr_WarnEx`, 2 is the function above that,
+ the currently executing line of code in that stack frame. A *stack_level* of 1
+ is the function calling :c:func:`PyErr_WarnEx`, 2 is the function above that,
and so forth.
This function normally prints a warning message to *sys.stderr*; however, it is
@@ -251,35 +273,45 @@ in various ways. There is a separate error indicator for each thread.
is raised. (It is not possible to determine whether a warning message is
actually printed, nor what the reason is for the exception; this is
intentional.) If an exception is raised, the caller should do its normal
- exception handling (for example, :cfunc:`Py_DECREF` owned references and return
+ exception handling (for example, :c:func:`Py_DECREF` owned references and return
an error value).
- Warning categories must be subclasses of :cdata:`Warning`; the default warning
- category is :cdata:`RuntimeWarning`. The standard Python warning categories are
+ Warning categories must be subclasses of :c:data:`Warning`; the default warning
+ category is :c:data:`RuntimeWarning`. The standard Python warning categories are
available as global variables whose names are ``PyExc_`` followed by the Python
- exception name. These have the type :ctype:`PyObject\*`; they are all class
- objects. Their names are :cdata:`PyExc_Warning`, :cdata:`PyExc_UserWarning`,
- :cdata:`PyExc_UnicodeWarning`, :cdata:`PyExc_DeprecationWarning`,
- :cdata:`PyExc_SyntaxWarning`, :cdata:`PyExc_RuntimeWarning`, and
- :cdata:`PyExc_FutureWarning`. :cdata:`PyExc_Warning` is a subclass of
- :cdata:`PyExc_Exception`; the other warning categories are subclasses of
- :cdata:`PyExc_Warning`.
+ exception name. These have the type :c:type:`PyObject\*`; they are all class
+ objects. Their names are :c:data:`PyExc_Warning`, :c:data:`PyExc_UserWarning`,
+ :c:data:`PyExc_UnicodeWarning`, :c:data:`PyExc_DeprecationWarning`,
+ :c:data:`PyExc_SyntaxWarning`, :c:data:`PyExc_RuntimeWarning`, and
+ :c:data:`PyExc_FutureWarning`. :c:data:`PyExc_Warning` is a subclass of
+ :c:data:`PyExc_Exception`; the other warning categories are subclasses of
+ :c:data:`PyExc_Warning`.
For information about warning control, see the documentation for the
:mod:`warnings` module and the :option:`-W` option in the command line
documentation. There is no C API for warning control.
-.. cfunction:: int PyErr_WarnExplicit(PyObject *category, const char *message, const char *filename, int lineno, const char *module, PyObject *registry)
+.. c:function:: int PyErr_WarnExplicit(PyObject *category, const char *message, const char *filename, int lineno, const char *module, PyObject *registry)
Issue a warning message with explicit control over all warning attributes. This
is a straightforward wrapper around the Python function
:func:`warnings.warn_explicit`, see there for more information. The *module*
and *registry* arguments may be set to *NULL* to get the default effect
- described there.
+ described there. *message* and *module* are UTF-8 encoded strings,
+ *filename* is decoded from the filesystem encoding
+ (:func:`sys.getfilesystemencoding`).
+
+
+.. c:function:: int PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...)
+ Function similar to :c:func:`PyErr_WarnEx`, but use
+ :c:func:`PyUnicode_FromFormat` to format the warning message. *format* is
+ an ASCII-encoded string.
-.. cfunction:: int PyErr_CheckSignals()
+ .. versionadded:: 3.2
+
+.. c:function:: int PyErr_CheckSignals()
.. index::
module: signal
@@ -296,21 +328,21 @@ in various ways. There is a separate error indicator for each thread.
cleared if it was previously set.
-.. cfunction:: void PyErr_SetInterrupt()
+.. c:function:: void PyErr_SetInterrupt()
.. index::
single: SIGINT
single: KeyboardInterrupt (built-in exception)
This function simulates the effect of a :const:`SIGINT` signal arriving --- the
- next time :cfunc:`PyErr_CheckSignals` is called, :exc:`KeyboardInterrupt` will
+ next time :c:func:`PyErr_CheckSignals` is called, :exc:`KeyboardInterrupt` will
be raised. It may be called without holding the interpreter lock.
.. % XXX This was described as obsolete, but is used in
.. % _thread.interrupt_main() (used from IDLE), so it's still needed.
-.. cfunction:: int PySignal_SetWakeupFd(int fd)
+.. c:function:: int PySignal_SetWakeupFd(int fd)
This utility function specifies a file descriptor to which a ``'\0'`` byte will
be written whenever a signal is received. It returns the previous such file
@@ -320,13 +352,13 @@ in various ways. There is a separate error indicator for each thread.
only be called from the main thread.
-.. cfunction:: PyObject* PyErr_NewException(char *name, PyObject *base, PyObject *dict)
+.. c:function:: PyObject* PyErr_NewException(char *name, PyObject *base, PyObject *dict)
This utility function creates and returns a new exception object. The *name*
argument must be the name of the new exception, a C string of the form
``module.class``. The *base* and *dict* arguments are normally *NULL*. This
creates a class object derived from :exc:`Exception` (accessible in C as
- :cdata:`PyExc_Exception`).
+ :c:data:`PyExc_Exception`).
The :attr:`__module__` attribute of the new class is set to the first part (up
to the last dot) of the *name* argument, and the class name is set to the last
@@ -335,7 +367,16 @@ in various ways. There is a separate error indicator for each thread.
argument can be used to specify a dictionary of class variables and methods.
-.. cfunction:: void PyErr_WriteUnraisable(PyObject *obj)
+.. c:function:: PyObject* PyErr_NewExceptionWithDoc(char *name, char *doc, PyObject *base, PyObject *dict)
+
+ Same as :c:func:`PyErr_NewException`, except that the new exception class can
+ easily be given a docstring: If *doc* is non-*NULL*, it will be used as the
+ docstring for the exception class.
+
+ .. versionadded:: 3.2
+
+
+.. c:function:: void PyErr_WriteUnraisable(PyObject *obj)
This utility function prints a warning message to ``sys.stderr`` when an
exception has been set but it is impossible for the interpreter to actually
@@ -350,20 +391,20 @@ in various ways. There is a separate error indicator for each thread.
Exception Objects
=================
-.. cfunction:: PyObject* PyException_GetTraceback(PyObject *ex)
+.. c:function:: PyObject* PyException_GetTraceback(PyObject *ex)
Return the traceback associated with the exception as a new reference, as
accessible from Python through :attr:`__traceback__`. If there is no
traceback associated, this returns *NULL*.
-.. cfunction:: int PyException_SetTraceback(PyObject *ex, PyObject *tb)
+.. c:function:: int PyException_SetTraceback(PyObject *ex, PyObject *tb)
Set the traceback associated with the exception to *tb*. Use ``Py_None`` to
clear it.
-.. cfunction:: PyObject* PyException_GetContext(PyObject *ex)
+.. c:function:: PyObject* PyException_GetContext(PyObject *ex)
Return the context (another exception instance during whose handling *ex* was
raised) associated with the exception as a new reference, as accessible from
@@ -371,14 +412,14 @@ Exception Objects
returns *NULL*.
-.. cfunction:: void PyException_SetContext(PyObject *ex, PyObject *ctx)
+.. c:function:: void PyException_SetContext(PyObject *ex, PyObject *ctx)
Set the context associated with the exception to *ctx*. Use *NULL* to clear
it. There is no type check to make sure that *ctx* is an exception instance.
This steals a reference to *ctx*.
-.. cfunction:: PyObject* PyException_GetCause(PyObject *ex)
+.. c:function:: PyObject* PyException_GetCause(PyObject *ex)
Return the cause (another exception instance set by ``raise ... from ...``)
associated with the exception as a new reference, as accessible from Python
@@ -386,7 +427,7 @@ Exception Objects
*NULL*.
-.. cfunction:: void PyException_SetCause(PyObject *ex, PyObject *ctx)
+.. c:function:: void PyException_SetCause(PyObject *ex, PyObject *ctx)
Set the cause associated with the exception to *ctx*. Use *NULL* to clear
it. There is no type check to make sure that *ctx* is an exception instance.
@@ -400,71 +441,73 @@ Unicode Exception Objects
The following functions are used to create and modify Unicode exceptions from C.
-.. cfunction:: PyObject* PyUnicodeDecodeError_Create(const char *encoding, const char *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
+.. c:function:: PyObject* PyUnicodeDecodeError_Create(const char *encoding, const char *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
Create a :class:`UnicodeDecodeError` object with the attributes *encoding*,
- *object*, *length*, *start*, *end* and *reason*.
+ *object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are
+ UTF-8 encoded strings.
-.. cfunction:: PyObject* PyUnicodeEncodeError_Create(const char *encoding, const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
+.. c:function:: PyObject* PyUnicodeEncodeError_Create(const char *encoding, const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
Create a :class:`UnicodeEncodeError` object with the attributes *encoding*,
- *object*, *length*, *start*, *end* and *reason*.
+ *object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are
+ UTF-8 encoded strings.
-.. cfunction:: PyObject* PyUnicodeTranslateError_Create(const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
+.. c:function:: PyObject* PyUnicodeTranslateError_Create(const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
Create a :class:`UnicodeTranslateError` object with the attributes *object*,
- *length*, *start*, *end* and *reason*.
+ *length*, *start*, *end* and *reason*. *reason* is an UTF-8 encoded string.
-.. cfunction:: PyObject* PyUnicodeDecodeError_GetEncoding(PyObject *exc)
- PyObject* PyUnicodeEncodeError_GetEncoding(PyObject *exc)
+.. c:function:: PyObject* PyUnicodeDecodeError_GetEncoding(PyObject *exc)
+ PyObject* PyUnicodeEncodeError_GetEncoding(PyObject *exc)
Return the *encoding* attribute of the given exception object.
-.. cfunction:: PyObject* PyUnicodeDecodeError_GetObject(PyObject *exc)
- PyObject* PyUnicodeEncodeError_GetObject(PyObject *exc)
- PyObject* PyUnicodeTranslateError_GetObject(PyObject *exc)
+.. c:function:: PyObject* PyUnicodeDecodeError_GetObject(PyObject *exc)
+ PyObject* PyUnicodeEncodeError_GetObject(PyObject *exc)
+ PyObject* PyUnicodeTranslateError_GetObject(PyObject *exc)
Return the *object* attribute of the given exception object.
-.. cfunction:: int PyUnicodeDecodeError_GetStart(PyObject *exc, Py_ssize_t *start)
- int PyUnicodeEncodeError_GetStart(PyObject *exc, Py_ssize_t *start)
- int PyUnicodeTranslateError_GetStart(PyObject *exc, Py_ssize_t *start)
+.. c:function:: int PyUnicodeDecodeError_GetStart(PyObject *exc, Py_ssize_t *start)
+ int PyUnicodeEncodeError_GetStart(PyObject *exc, Py_ssize_t *start)
+ int PyUnicodeTranslateError_GetStart(PyObject *exc, Py_ssize_t *start)
Get the *start* attribute of the given exception object and place it into
*\*start*. *start* must not be *NULL*. Return ``0`` on success, ``-1`` on
failure.
-.. cfunction:: int PyUnicodeDecodeError_SetStart(PyObject *exc, Py_ssize_t start)
- int PyUnicodeEncodeError_SetStart(PyObject *exc, Py_ssize_t start)
- int PyUnicodeTranslateError_SetStart(PyObject *exc, Py_ssize_t start)
+.. c:function:: int PyUnicodeDecodeError_SetStart(PyObject *exc, Py_ssize_t start)
+ int PyUnicodeEncodeError_SetStart(PyObject *exc, Py_ssize_t start)
+ int PyUnicodeTranslateError_SetStart(PyObject *exc, Py_ssize_t start)
Set the *start* attribute of the given exception object to *start*. Return
``0`` on success, ``-1`` on failure.
-.. cfunction:: int PyUnicodeDecodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
- int PyUnicodeEncodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
- int PyUnicodeTranslateError_GetEnd(PyObject *exc, Py_ssize_t *end)
+.. c:function:: int PyUnicodeDecodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
+ int PyUnicodeEncodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
+ int PyUnicodeTranslateError_GetEnd(PyObject *exc, Py_ssize_t *end)
Get the *end* attribute of the given exception object and place it into
*\*end*. *end* must not be *NULL*. Return ``0`` on success, ``-1`` on
failure.
-.. cfunction:: int PyUnicodeDecodeError_SetEnd(PyObject *exc, Py_ssize_t end)
- int PyUnicodeEncodeError_SetEnd(PyObject *exc, Py_ssize_t end)
- int PyUnicodeTranslateError_SetEnd(PyObject *exc, Py_ssize_t end)
+.. c:function:: int PyUnicodeDecodeError_SetEnd(PyObject *exc, Py_ssize_t end)
+ int PyUnicodeEncodeError_SetEnd(PyObject *exc, Py_ssize_t end)
+ int PyUnicodeTranslateError_SetEnd(PyObject *exc, Py_ssize_t end)
Set the *end* attribute of the given exception object to *end*. Return ``0``
on success, ``-1`` on failure.
-.. cfunction:: PyObject* PyUnicodeDecodeError_GetReason(PyObject *exc)
- PyObject* PyUnicodeEncodeError_GetReason(PyObject *exc)
- PyObject* PyUnicodeTranslateError_GetReason(PyObject *exc)
+.. c:function:: PyObject* PyUnicodeDecodeError_GetReason(PyObject *exc)
+ PyObject* PyUnicodeEncodeError_GetReason(PyObject *exc)
+ PyObject* PyUnicodeTranslateError_GetReason(PyObject *exc)
Return the *reason* attribute of the given exception object.
-.. cfunction:: int PyUnicodeDecodeError_SetReason(PyObject *exc, const char *reason)
- int PyUnicodeEncodeError_SetReason(PyObject *exc, const char *reason)
- int PyUnicodeTranslateError_SetReason(PyObject *exc, const char *reason)
+.. c:function:: int PyUnicodeDecodeError_SetReason(PyObject *exc, const char *reason)
+ int PyUnicodeEncodeError_SetReason(PyObject *exc, const char *reason)
+ int PyUnicodeTranslateError_SetReason(PyObject *exc, const char *reason)
Set the *reason* attribute of the given exception object to *reason*. Return
``0`` on success, ``-1`` on failure.
@@ -478,12 +521,12 @@ level, both in the core and in extension modules. They are needed if the
recursive code does not necessarily invoke Python code (which tracks its
recursion depth automatically).
-.. cfunction:: int Py_EnterRecursiveCall(char *where)
+.. c:function:: int Py_EnterRecursiveCall(char *where)
Marks a point where a recursive C-level call is about to be performed.
If :const:`USE_STACKCHECK` is defined, this function checks if the the OS
- stack overflowed using :cfunc:`PyOS_CheckStack`. In this is the case, it
+ stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it
sets a :exc:`MemoryError` and returns a nonzero value.
The function then checks if the recursion limit is reached. If this is the
@@ -494,10 +537,39 @@ recursion depth automatically).
concatenated to the :exc:`RuntimeError` message caused by the recursion depth
limit.
-.. cfunction:: void Py_LeaveRecursiveCall()
+.. c:function:: void Py_LeaveRecursiveCall()
+
+ Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each
+ *successful* invocation of :c:func:`Py_EnterRecursiveCall`.
+
+Properly implementing :attr:`tp_repr` for container types requires
+special recursion handling. In addition to protecting the stack,
+:attr:`tp_repr` also needs to track objects to prevent cycles. The
+following two functions facilitate this functionality. Effectively,
+these are the C equivalent to :func:`reprlib.recursive_repr`.
+
+.. c:function:: int Py_ReprEnter(PyObject *object)
+
+ Called at the beginning of the :attr:`tp_repr` implementation to
+ detect cycles.
+
+ If the object has already been processed, the function returns a
+ positive integer. In that case the :attr:`tp_repr` implementation
+ should return a string object indicating a cycle. As examples,
+ :class:`dict` objects return ``{...}`` and :class:`list` objects
+ return ``[...]``.
+
+ The function will return a negative integer if the recursion limit
+ is reached. In that case the :attr:`tp_repr` implementation should
+ typically return ``NULL``.
+
+ Otherwise, the function returns zero and the :attr:`tp_repr`
+ implementation can continue normally.
+
+.. c:function:: void Py_ReprLeave(PyObject *object)
- Ends a :cfunc:`Py_EnterRecursiveCall`. Must be called once for each
- *successful* invocation of :cfunc:`Py_EnterRecursiveCall`.
+ Ends a :c:func:`Py_ReprEnter`. Must be called once for each
+ invocation of :c:func:`Py_ReprEnter` that returns zero.
.. _standardexceptions:
@@ -507,68 +579,68 @@ Standard Exceptions
All standard Python exceptions are available as global variables whose names are
``PyExc_`` followed by the Python exception name. These have the type
-:ctype:`PyObject\*`; they are all class objects. For completeness, here are all
+:c:type:`PyObject\*`; they are all class objects. For completeness, here are all
the variables:
-+------------------------------------+----------------------------+----------+
-| C Name | Python Name | Notes |
-+====================================+============================+==========+
-| :cdata:`PyExc_BaseException` | :exc:`BaseException` | \(1) |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_Exception` | :exc:`Exception` | \(1) |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_ArithmeticError` | :exc:`ArithmeticError` | \(1) |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_LookupError` | :exc:`LookupError` | \(1) |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_AssertionError` | :exc:`AssertionError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_AttributeError` | :exc:`AttributeError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_EOFError` | :exc:`EOFError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_EnvironmentError` | :exc:`EnvironmentError` | \(1) |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_FloatingPointError` | :exc:`FloatingPointError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_IOError` | :exc:`IOError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_ImportError` | :exc:`ImportError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_IndexError` | :exc:`IndexError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_KeyError` | :exc:`KeyError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_KeyboardInterrupt` | :exc:`KeyboardInterrupt` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_MemoryError` | :exc:`MemoryError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_NameError` | :exc:`NameError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_NotImplementedError` | :exc:`NotImplementedError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_OSError` | :exc:`OSError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_OverflowError` | :exc:`OverflowError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_ReferenceError` | :exc:`ReferenceError` | \(2) |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_RuntimeError` | :exc:`RuntimeError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_SyntaxError` | :exc:`SyntaxError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_SystemError` | :exc:`SystemError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_SystemExit` | :exc:`SystemExit` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_TypeError` | :exc:`TypeError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_ValueError` | :exc:`ValueError` | |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_WindowsError` | :exc:`WindowsError` | \(3) |
-+------------------------------------+----------------------------+----------+
-| :cdata:`PyExc_ZeroDivisionError` | :exc:`ZeroDivisionError` | |
-+------------------------------------+----------------------------+----------+
++-------------------------------------+----------------------------+----------+
+| C Name | Python Name | Notes |
++=====================================+============================+==========+
+| :c:data:`PyExc_BaseException` | :exc:`BaseException` | \(1) |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_Exception` | :exc:`Exception` | \(1) |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_ArithmeticError` | :exc:`ArithmeticError` | \(1) |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_LookupError` | :exc:`LookupError` | \(1) |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_AssertionError` | :exc:`AssertionError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_AttributeError` | :exc:`AttributeError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_EOFError` | :exc:`EOFError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_EnvironmentError` | :exc:`EnvironmentError` | \(1) |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_FloatingPointError` | :exc:`FloatingPointError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_IOError` | :exc:`IOError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_ImportError` | :exc:`ImportError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_IndexError` | :exc:`IndexError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_KeyError` | :exc:`KeyError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_KeyboardInterrupt` | :exc:`KeyboardInterrupt` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_MemoryError` | :exc:`MemoryError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_NameError` | :exc:`NameError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_NotImplementedError` | :exc:`NotImplementedError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_OSError` | :exc:`OSError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_OverflowError` | :exc:`OverflowError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_ReferenceError` | :exc:`ReferenceError` | \(2) |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_RuntimeError` | :exc:`RuntimeError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_SyntaxError` | :exc:`SyntaxError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_SystemError` | :exc:`SystemError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_SystemExit` | :exc:`SystemExit` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_TypeError` | :exc:`TypeError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_ValueError` | :exc:`ValueError` | |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_WindowsError` | :exc:`WindowsError` | \(3) |
++-------------------------------------+----------------------------+----------+
+| :c:data:`PyExc_ZeroDivisionError` | :exc:`ZeroDivisionError` | |
++-------------------------------------+----------------------------+----------+
.. index::
single: PyExc_BaseException
diff --git a/Doc/c-api/file.rst b/Doc/c-api/file.rst
index cc851e6be8..c5a4a594b2 100644
--- a/Doc/c-api/file.rst
+++ b/Doc/c-api/file.rst
@@ -8,7 +8,7 @@ File Objects
.. index:: object: file
These APIs are a minimal emulation of the Python 2 C API for built-in file
-objects, which used to rely on the buffered I/O (:ctype:`FILE\*`) support
+objects, which used to rely on the buffered I/O (:c:type:`FILE\*`) support
from the C standard library. In Python 3, files and streams use the new
:mod:`io` module, which defines several layers over the low-level unbuffered
I/O of the operating system. The functions described below are
@@ -17,13 +17,14 @@ error reporting in the interpreter; third-party code is advised to access
the :mod:`io` APIs instead.
-.. cfunction:: PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding, char *errors, char *newline, int closefd)
+.. c:function:: PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding, char *errors, char *newline, int closefd)
Create a Python file object from the file descriptor of an already
opened file *fd*. The arguments *name*, *encoding*, *errors* and *newline*
can be *NULL* to use the defaults; *buffering* can be *-1* to use the
- default. Return *NULL* on failure. For a more comprehensive description of
- the arguments, please refer to the :func:`io.open` function documentation.
+ default. *name* is ignored and kept for backward compatibility. Return
+ *NULL* on failure. For a more comprehensive description of the arguments,
+ please refer to the :func:`io.open` function documentation.
.. warning::
@@ -31,17 +32,20 @@ the :mod:`io` APIs instead.
OS-level file descriptors can produce various issues (such as unexpected
ordering of data).
+ .. versionchanged:: 3.2
+ Ignore *name* attribute.
-.. cfunction:: int PyObject_AsFileDescriptor(PyObject *p)
- Return the file descriptor associated with *p* as an :ctype:`int`. If the
+.. c:function:: int PyObject_AsFileDescriptor(PyObject *p)
+
+ Return the file descriptor associated with *p* as an :c:type:`int`. If the
object is an integer, its value is returned. If not, the
object's :meth:`fileno` method is called if it exists; the method must return
an integer, which is returned as the file descriptor value. Sets an
exception and returns ``-1`` on failure.
-.. cfunction:: PyObject* PyFile_GetLine(PyObject *p, int n)
+.. c:function:: PyObject* PyFile_GetLine(PyObject *p, int n)
.. index:: single: EOFError (built-in exception)
@@ -55,7 +59,7 @@ the :mod:`io` APIs instead.
raised if the end of the file is reached immediately.
-.. cfunction:: int PyFile_WriteObject(PyObject *obj, PyObject *p, int flags)
+.. c:function:: int PyFile_WriteObject(PyObject *obj, PyObject *p, int flags)
.. index:: single: Py_PRINT_RAW
@@ -65,7 +69,7 @@ the :mod:`io` APIs instead.
appropriate exception will be set.
-.. cfunction:: int PyFile_WriteString(const char *s, PyObject *p)
+.. c:function:: int PyFile_WriteString(const char *s, PyObject *p)
Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on
failure; the appropriate exception will be set.
diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst
index 93769aa1f4..757efd363d 100644
--- a/Doc/c-api/float.rst
+++ b/Doc/c-api/float.rst
@@ -8,70 +8,70 @@ Floating Point Objects
.. index:: object: floating point
-.. ctype:: PyFloatObject
+.. c:type:: PyFloatObject
- This subtype of :ctype:`PyObject` represents a Python floating point object.
+ This subtype of :c:type:`PyObject` represents a Python floating point object.
-.. cvar:: PyTypeObject PyFloat_Type
+.. c:var:: PyTypeObject PyFloat_Type
- This instance of :ctype:`PyTypeObject` represents the Python floating point
+ This instance of :c:type:`PyTypeObject` represents the Python floating point
type. This is the same object as :class:`float` in the Python layer.
-.. cfunction:: int PyFloat_Check(PyObject *p)
+.. c:function:: int PyFloat_Check(PyObject *p)
- Return true if its argument is a :ctype:`PyFloatObject` or a subtype of
- :ctype:`PyFloatObject`.
+ Return true if its argument is a :c:type:`PyFloatObject` or a subtype of
+ :c:type:`PyFloatObject`.
-.. cfunction:: int PyFloat_CheckExact(PyObject *p)
+.. c:function:: int PyFloat_CheckExact(PyObject *p)
- Return true if its argument is a :ctype:`PyFloatObject`, but not a subtype of
- :ctype:`PyFloatObject`.
+ Return true if its argument is a :c:type:`PyFloatObject`, but not a subtype of
+ :c:type:`PyFloatObject`.
-.. cfunction:: PyObject* PyFloat_FromString(PyObject *str)
+.. c:function:: PyObject* PyFloat_FromString(PyObject *str)
- Create a :ctype:`PyFloatObject` object based on the string value in *str*, or
+ Create a :c:type:`PyFloatObject` object based on the string value in *str*, or
*NULL* on failure.
-.. cfunction:: PyObject* PyFloat_FromDouble(double v)
+.. c:function:: PyObject* PyFloat_FromDouble(double v)
- Create a :ctype:`PyFloatObject` object from *v*, or *NULL* on failure.
+ Create a :c:type:`PyFloatObject` object from *v*, or *NULL* on failure.
-.. cfunction:: double PyFloat_AsDouble(PyObject *pyfloat)
+.. c:function:: double PyFloat_AsDouble(PyObject *pyfloat)
- Return a C :ctype:`double` representation of the contents of *pyfloat*. If
+ Return a C :c:type:`double` representation of the contents of *pyfloat*. If
*pyfloat* is not a Python floating point object but has a :meth:`__float__`
method, this method will first be called to convert *pyfloat* into a float.
-.. cfunction:: double PyFloat_AS_DOUBLE(PyObject *pyfloat)
+.. c:function:: double PyFloat_AS_DOUBLE(PyObject *pyfloat)
- Return a C :ctype:`double` representation of the contents of *pyfloat*, but
+ Return a C :c:type:`double` representation of the contents of *pyfloat*, but
without error checking.
-.. cfunction:: PyObject* PyFloat_GetInfo(void)
+.. c:function:: PyObject* PyFloat_GetInfo(void)
Return a structseq instance which contains information about the
precision, minimum and maximum values of a float. It's a thin wrapper
around the header file :file:`float.h`.
-.. cfunction:: double PyFloat_GetMax()
+.. c:function:: double PyFloat_GetMax()
- Return the maximum representable finite float *DBL_MAX* as C :ctype:`double`.
+ Return the maximum representable finite float *DBL_MAX* as C :c:type:`double`.
-.. cfunction:: double PyFloat_GetMin()
+.. c:function:: double PyFloat_GetMin()
- Return the minimum normalized positive float *DBL_MIN* as C :ctype:`double`.
+ Return the minimum normalized positive float *DBL_MIN* as C :c:type:`double`.
-.. cfunction:: int PyFloat_ClearFreeList()
+.. c:function:: int PyFloat_ClearFreeList()
Clear the float free list. Return the number of items that could not
be freed.
diff --git a/Doc/c-api/function.rst b/Doc/c-api/function.rst
index 3512fe2206..31805fd0ad 100644
--- a/Doc/c-api/function.rst
+++ b/Doc/c-api/function.rst
@@ -10,26 +10,26 @@ Function Objects
There are a few functions specific to Python functions.
-.. ctype:: PyFunctionObject
+.. c:type:: PyFunctionObject
The C structure used for functions.
-.. cvar:: PyTypeObject PyFunction_Type
+.. c:var:: PyTypeObject PyFunction_Type
.. index:: single: MethodType (in module types)
- This is an instance of :ctype:`PyTypeObject` and represents the Python function
+ This is an instance of :c:type:`PyTypeObject` and represents the Python function
type. It is exposed to Python programmers as ``types.FunctionType``.
-.. cfunction:: int PyFunction_Check(PyObject *o)
+.. c:function:: int PyFunction_Check(PyObject *o)
- Return true if *o* is a function object (has type :cdata:`PyFunction_Type`).
+ Return true if *o* is a function object (has type :c:data:`PyFunction_Type`).
The parameter must not be *NULL*.
-.. cfunction:: PyObject* PyFunction_New(PyObject *code, PyObject *globals)
+.. c:function:: PyObject* PyFunction_New(PyObject *code, PyObject *globals)
Return a new function object associated with the code object *code*. *globals*
must be a dictionary with the global variables accessible to the function.
@@ -38,30 +38,30 @@ There are a few functions specific to Python functions.
object, the argument defaults and closure are set to *NULL*.
-.. cfunction:: PyObject* PyFunction_GetCode(PyObject *op)
+.. c:function:: PyObject* PyFunction_GetCode(PyObject *op)
Return the code object associated with the function object *op*.
-.. cfunction:: PyObject* PyFunction_GetGlobals(PyObject *op)
+.. c:function:: PyObject* PyFunction_GetGlobals(PyObject *op)
Return the globals dictionary associated with the function object *op*.
-.. cfunction:: PyObject* PyFunction_GetModule(PyObject *op)
+.. c:function:: PyObject* PyFunction_GetModule(PyObject *op)
Return the *__module__* attribute of the function object *op*. This is normally
a string containing the module name, but can be set to any other object by
Python code.
-.. cfunction:: PyObject* PyFunction_GetDefaults(PyObject *op)
+.. c:function:: PyObject* PyFunction_GetDefaults(PyObject *op)
Return the argument default values of the function object *op*. This can be a
tuple of arguments or *NULL*.
-.. cfunction:: int PyFunction_SetDefaults(PyObject *op, PyObject *defaults)
+.. c:function:: int PyFunction_SetDefaults(PyObject *op, PyObject *defaults)
Set the argument default values for the function object *op*. *defaults* must be
*Py_None* or a tuple.
@@ -69,13 +69,13 @@ There are a few functions specific to Python functions.
Raises :exc:`SystemError` and returns ``-1`` on failure.
-.. cfunction:: PyObject* PyFunction_GetClosure(PyObject *op)
+.. c:function:: PyObject* PyFunction_GetClosure(PyObject *op)
Return the closure associated with the function object *op*. This can be *NULL*
or a tuple of cell objects.
-.. cfunction:: int PyFunction_SetClosure(PyObject *op, PyObject *closure)
+.. c:function:: int PyFunction_SetClosure(PyObject *op, PyObject *closure)
Set the closure associated with the function object *op*. *closure* must be
*Py_None* or a tuple of cell objects.
@@ -83,13 +83,13 @@ There are a few functions specific to Python functions.
Raises :exc:`SystemError` and returns ``-1`` on failure.
-.. cfunction:: PyObject *PyFunction_GetAnnotations(PyObject *op)
+.. c:function:: PyObject *PyFunction_GetAnnotations(PyObject *op)
Return the annotations of the function object *op*. This can be a
mutable dictionary or *NULL*.
-.. cfunction:: int PyFunction_SetAnnotations(PyObject *op, PyObject *annotations)
+.. c:function:: int PyFunction_SetAnnotations(PyObject *op, PyObject *annotations)
Set the annotations for the function object *op*. *annotations*
must be a dictionary or *Py_None*.
diff --git a/Doc/c-api/gcsupport.rst b/Doc/c-api/gcsupport.rst
index 1a280c823a..3875ff2c65 100644
--- a/Doc/c-api/gcsupport.rst
+++ b/Doc/c-api/gcsupport.rst
@@ -27,32 +27,32 @@ include the :const:`Py_TPFLAGS_HAVE_GC` and provide an implementation of the
Constructors for container types must conform to two rules:
-#. The memory for the object must be allocated using :cfunc:`PyObject_GC_New`
- or :cfunc:`PyObject_GC_NewVar`.
+#. The memory for the object must be allocated using :c:func:`PyObject_GC_New`
+ or :c:func:`PyObject_GC_NewVar`.
#. Once all the fields which may contain references to other containers are
- initialized, it must call :cfunc:`PyObject_GC_Track`.
+ initialized, it must call :c:func:`PyObject_GC_Track`.
-.. cfunction:: TYPE* PyObject_GC_New(TYPE, PyTypeObject *type)
+.. c:function:: TYPE* PyObject_GC_New(TYPE, PyTypeObject *type)
- Analogous to :cfunc:`PyObject_New` but for container objects with the
+ Analogous to :c:func:`PyObject_New` but for container objects with the
:const:`Py_TPFLAGS_HAVE_GC` flag set.
-.. cfunction:: TYPE* PyObject_GC_NewVar(TYPE, PyTypeObject *type, Py_ssize_t size)
+.. c:function:: TYPE* PyObject_GC_NewVar(TYPE, PyTypeObject *type, Py_ssize_t size)
- Analogous to :cfunc:`PyObject_NewVar` but for container objects with the
+ Analogous to :c:func:`PyObject_NewVar` but for container objects with the
:const:`Py_TPFLAGS_HAVE_GC` flag set.
-.. cfunction:: TYPE* PyObject_GC_Resize(TYPE, PyVarObject *op, Py_ssize_t newsize)
+.. c:function:: TYPE* PyObject_GC_Resize(TYPE, PyVarObject *op, Py_ssize_t newsize)
- Resize an object allocated by :cfunc:`PyObject_NewVar`. Returns the
+ Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the
resized object or *NULL* on failure.
-.. cfunction:: void PyObject_GC_Track(PyObject *op)
+.. c:function:: void PyObject_GC_Track(PyObject *op)
Adds the object *op* to the set of container objects tracked by the
collector. The collector can run at unexpected times so objects must be
@@ -61,44 +61,44 @@ Constructors for container types must conform to two rules:
end of the constructor.
-.. cfunction:: void _PyObject_GC_TRACK(PyObject *op)
+.. c:function:: void _PyObject_GC_TRACK(PyObject *op)
- A macro version of :cfunc:`PyObject_GC_Track`. It should not be used for
+ A macro version of :c:func:`PyObject_GC_Track`. It should not be used for
extension modules.
Similarly, the deallocator for the object must conform to a similar pair of
rules:
#. Before fields which refer to other containers are invalidated,
- :cfunc:`PyObject_GC_UnTrack` must be called.
+ :c:func:`PyObject_GC_UnTrack` must be called.
-#. The object's memory must be deallocated using :cfunc:`PyObject_GC_Del`.
+#. The object's memory must be deallocated using :c:func:`PyObject_GC_Del`.
-.. cfunction:: void PyObject_GC_Del(void *op)
+.. c:function:: void PyObject_GC_Del(void *op)
- Releases memory allocated to an object using :cfunc:`PyObject_GC_New` or
- :cfunc:`PyObject_GC_NewVar`.
+ Releases memory allocated to an object using :c:func:`PyObject_GC_New` or
+ :c:func:`PyObject_GC_NewVar`.
-.. cfunction:: void PyObject_GC_UnTrack(void *op)
+.. c:function:: void PyObject_GC_UnTrack(void *op)
Remove the object *op* from the set of container objects tracked by the
- collector. Note that :cfunc:`PyObject_GC_Track` can be called again on
+ collector. Note that :c:func:`PyObject_GC_Track` can be called again on
this object to add it back to the set of tracked objects. The deallocator
(:attr:`tp_dealloc` handler) should call this for the object before any of
the fields used by the :attr:`tp_traverse` handler become invalid.
-.. cfunction:: void _PyObject_GC_UNTRACK(PyObject *op)
+.. c:function:: void _PyObject_GC_UNTRACK(PyObject *op)
- A macro version of :cfunc:`PyObject_GC_UnTrack`. It should not be used for
+ A macro version of :c:func:`PyObject_GC_UnTrack`. It should not be used for
extension modules.
The :attr:`tp_traverse` handler accepts a function parameter of this type:
-.. ctype:: int (*visitproc)(PyObject *object, void *arg)
+.. c:type:: int (*visitproc)(PyObject *object, void *arg)
Type of the visitor function passed to the :attr:`tp_traverse` handler.
The function should be called with an object to traverse as *object* and
@@ -110,7 +110,7 @@ The :attr:`tp_traverse` handler accepts a function parameter of this type:
The :attr:`tp_traverse` handler must have the following type:
-.. ctype:: int (*traverseproc)(PyObject *self, visitproc visit, void *arg)
+.. c:type:: int (*traverseproc)(PyObject *self, visitproc visit, void *arg)
Traversal function for a container object. Implementations must call the
*visit* function for each object directly contained by *self*, with the
@@ -119,12 +119,12 @@ The :attr:`tp_traverse` handler must have the following type:
object argument. If *visit* returns a non-zero value that value should be
returned immediately.
-To simplify writing :attr:`tp_traverse` handlers, a :cfunc:`Py_VISIT` macro is
+To simplify writing :attr:`tp_traverse` handlers, a :c:func:`Py_VISIT` macro is
provided. In order to use this macro, the :attr:`tp_traverse` implementation
must name its arguments exactly *visit* and *arg*:
-.. cfunction:: void Py_VISIT(PyObject *o)
+.. c:function:: void Py_VISIT(PyObject *o)
Call the *visit* callback, with arguments *o* and *arg*. If *visit* returns
a non-zero value, then return it. Using this macro, :attr:`tp_traverse`
@@ -138,15 +138,15 @@ must name its arguments exactly *visit* and *arg*:
return 0;
}
-The :attr:`tp_clear` handler must be of the :ctype:`inquiry` type, or *NULL*
+The :attr:`tp_clear` handler must be of the :c:type:`inquiry` type, or *NULL*
if the object is immutable.
-.. ctype:: int (*inquiry)(PyObject *self)
+.. c:type:: int (*inquiry)(PyObject *self)
Drop references that may have created reference cycles. Immutable objects
do not have to define this method since they can never directly create
reference cycles. Note that the object must still be valid after calling
- this method (don't just call :cfunc:`Py_DECREF` on a reference). The
+ this method (don't just call :c:func:`Py_DECREF` on a reference). The
collector will call this method if it detects that this object is involved
in a reference cycle.
diff --git a/Doc/c-api/gen.rst b/Doc/c-api/gen.rst
index 0d3789a25f..33cd27a5aa 100644
--- a/Doc/c-api/gen.rst
+++ b/Doc/c-api/gen.rst
@@ -7,31 +7,31 @@ Generator Objects
Generator objects are what Python uses to implement generator iterators. They
are normally created by iterating over a function that yields values, rather
-than explicitly calling :cfunc:`PyGen_New`.
+than explicitly calling :c:func:`PyGen_New`.
-.. ctype:: PyGenObject
+.. c:type:: PyGenObject
The C structure used for generator objects.
-.. cvar:: PyTypeObject PyGen_Type
+.. c:var:: PyTypeObject PyGen_Type
The type object corresponding to generator objects
-.. cfunction:: int PyGen_Check(ob)
+.. c:function:: int PyGen_Check(ob)
Return true if *ob* is a generator object; *ob* must not be *NULL*.
-.. cfunction:: int PyGen_CheckExact(ob)
+.. c:function:: int PyGen_CheckExact(ob)
Return true if *ob*'s type is *PyGen_Type* is a generator object; *ob* must not
be *NULL*.
-.. cfunction:: PyObject* PyGen_New(PyFrameObject *frame)
+.. c:function:: PyObject* PyGen_New(PyFrameObject *frame)
Create and return a new generator object based on the *frame* object. A
reference to *frame* is stolen by this function. The parameter must not be
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst
index ff79112edf..cf48363e10 100644
--- a/Doc/c-api/import.rst
+++ b/Doc/c-api/import.rst
@@ -6,14 +6,14 @@ Importing Modules
=================
-.. cfunction:: PyObject* PyImport_ImportModule(const char *name)
+.. c:function:: PyObject* PyImport_ImportModule(const char *name)
.. index::
single: package variable; __all__
single: __all__ (package variable)
single: modules (in module sys)
- This is a simplified interface to :cfunc:`PyImport_ImportModuleEx` below,
+ This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below,
leaving the *globals* and *locals* arguments set to *NULL* and *level* set
to 0. When the *name*
argument contains a dot (when it specifies a submodule of a package), the
@@ -28,18 +28,18 @@ Importing Modules
This function always uses absolute imports.
-.. cfunction:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
+.. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
- This version of :cfunc:`PyImport_ImportModule` does not block. It's intended
+ This version of :c:func:`PyImport_ImportModule` does not block. It's intended
to be used in C functions that import other modules to execute a function.
The import may block if another thread holds the import lock. The function
- :cfunc:`PyImport_ImportModuleNoBlock` never blocks. It first tries to fetch
- the module from sys.modules and falls back to :cfunc:`PyImport_ImportModule`
+ :c:func:`PyImport_ImportModuleNoBlock` never blocks. It first tries to fetch
+ the module from sys.modules and falls back to :c:func:`PyImport_ImportModule`
unless the lock is held, in which case the function will raise an
:exc:`ImportError`.
-.. cfunction:: PyObject* PyImport_ImportModuleEx(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
+.. c:function:: PyObject* PyImport_ImportModuleEx(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
.. index:: builtin: __import__
@@ -54,10 +54,10 @@ Importing Modules
was given.
Failing imports remove incomplete module objects, like with
- :cfunc:`PyImport_ImportModule`.
+ :c:func:`PyImport_ImportModule`.
-.. cfunction:: PyObject* PyImport_ImportModuleLevel(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level)
+.. c:function:: PyObject* PyImport_ImportModuleLevel(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level)
Import a module. This is best described by referring to the built-in Python
function :func:`__import__`, as the standard :func:`__import__` function calls
@@ -69,7 +69,7 @@ Importing Modules
top-level package, unless a non-empty *fromlist* was given.
-.. cfunction:: PyObject* PyImport_Import(PyObject *name)
+.. c:function:: PyObject* PyImport_Import(PyObject *name)
This is a higher-level interface that calls the current "import hook
function" (with an explicit *level* of 0, meaning absolute import). It
@@ -80,13 +80,13 @@ Importing Modules
This function always uses absolute imports.
-.. cfunction:: PyObject* PyImport_ReloadModule(PyObject *m)
+.. c:function:: PyObject* PyImport_ReloadModule(PyObject *m)
Reload a module. Return a new reference to the reloaded module, or *NULL* with
an exception set on failure (the module still exists in this case).
-.. cfunction:: PyObject* PyImport_AddModule(const char *name)
+.. c:function:: PyObject* PyImport_AddModule(const char *name)
Return the module object corresponding to a module name. The *name* argument
may be of the form ``package.module``. First check the modules dictionary if
@@ -96,12 +96,12 @@ Importing Modules
.. note::
This function does not load or import the module; if the module wasn't already
- loaded, you will get an empty module object. Use :cfunc:`PyImport_ImportModule`
+ loaded, you will get an empty module object. Use :c:func:`PyImport_ImportModule`
or one of its variants to import a module. Package structures implied by a
dotted name for *name* are not created if not already present.
-.. cfunction:: PyObject* PyImport_ExecCodeModule(char *name, PyObject *co)
+.. c:function:: PyObject* PyImport_ExecCodeModule(char *name, PyObject *co)
.. index:: builtin: compile
@@ -110,32 +110,61 @@ Importing Modules
:func:`compile`, load the module. Return a new reference to the module object,
or *NULL* with an exception set if an error occurred. *name*
is removed from :attr:`sys.modules` in error cases, even if *name* was already
- in :attr:`sys.modules` on entry to :cfunc:`PyImport_ExecCodeModule`. Leaving
+ in :attr:`sys.modules` on entry to :c:func:`PyImport_ExecCodeModule`. Leaving
incompletely initialized modules in :attr:`sys.modules` is dangerous, as imports of
such modules have no way to know that the module object is an unknown (and
probably damaged with respect to the module author's intents) state.
+ The module's :attr:`__file__` attribute will be set to the code object's
+ :c:member:`co_filename`.
+
This function will reload the module if it was already imported. See
- :cfunc:`PyImport_ReloadModule` for the intended way to reload a module.
+ :c:func:`PyImport_ReloadModule` for the intended way to reload a module.
If *name* points to a dotted name of the form ``package.module``, any package
structures not already created will still not be created.
+ See also :c:func:`PyImport_ExecCodeModuleEx` and
+ :c:func:`PyImport_ExecCodeModuleWithPathnames`.
+
+
+.. c:function:: PyObject* PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
+
+ Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute of
+ the module object is set to *pathname* if it is non-``NULL``.
+
+ See also :c:func:`PyImport_ExecCodeModuleWithPathnames`.
+
-.. cfunction:: long PyImport_GetMagicNumber()
+.. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(char *name, PyObject *co, char *pathname, char *cpathname)
+
+ Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__cached__`
+ attribute of the module object is set to *cpathname* if it is
+ non-``NULL``. Of the three functions, this is the preferred one to use.
+
+ .. versionadded:: 3.2
+
+.. c:function:: long PyImport_GetMagicNumber()
Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` and
:file:`.pyo` files). The magic number should be present in the first four bytes
of the bytecode file, in little-endian byte order.
-.. cfunction:: PyObject* PyImport_GetModuleDict()
+.. c:function:: const char * PyImport_GetMagicTag()
+
+ Return the magic tag string for :pep:`3147` format Python bytecode file
+ names.
+
+ .. versionadded:: 3.2
+
+.. c:function:: PyObject* PyImport_GetModuleDict()
Return the dictionary used for the module administration (a.k.a.
``sys.modules``). Note that this is a per-interpreter variable.
-.. cfunction:: PyObject* PyImport_GetImporter(PyObject *path)
+.. c:function:: PyObject* PyImport_GetImporter(PyObject *path)
Return an importer object for a :data:`sys.path`/:attr:`pkg.__path__` item
*path*, possibly by fetching it from the :data:`sys.path_importer_cache`
@@ -146,41 +175,41 @@ Importing Modules
to the importer object.
-.. cfunction:: void _PyImport_Init()
+.. c:function:: void _PyImport_Init()
Initialize the import mechanism. For internal use only.
-.. cfunction:: void PyImport_Cleanup()
+.. c:function:: void PyImport_Cleanup()
Empty the module table. For internal use only.
-.. cfunction:: void _PyImport_Fini()
+.. c:function:: void _PyImport_Fini()
Finalize the import mechanism. For internal use only.
-.. cfunction:: PyObject* _PyImport_FindExtension(char *, char *)
+.. c:function:: PyObject* _PyImport_FindExtension(char *, char *)
For internal use only.
-.. cfunction:: PyObject* _PyImport_FixupExtension(char *, char *)
+.. c:function:: PyObject* _PyImport_FixupExtension(char *, char *)
For internal use only.
-.. cfunction:: int PyImport_ImportFrozenModule(char *name)
+.. c:function:: int PyImport_ImportFrozenModule(char *name)
Load a frozen module named *name*. Return ``1`` for success, ``0`` if the
module is not found, and ``-1`` with an exception set if the initialization
failed. To access the imported module on a successful load, use
- :cfunc:`PyImport_ImportModule`. (Note the misnomer --- this function would
+ :c:func:`PyImport_ImportModule`. (Note the misnomer --- this function would
reload the module if it was already imported.)
-.. ctype:: struct _frozen
+.. c:type:: struct _frozen
.. index:: single: freeze utility
@@ -196,30 +225,30 @@ Importing Modules
};
-.. cvar:: struct _frozen* PyImport_FrozenModules
+.. c:var:: struct _frozen* PyImport_FrozenModules
- This pointer is initialized to point to an array of :ctype:`struct _frozen`
+ This pointer is initialized to point to an array of :c:type:`struct _frozen`
records, terminated by one whose members are all *NULL* or zero. When a frozen
module is imported, it is searched in this table. Third-party code could play
tricks with this to provide a dynamically created collection of frozen modules.
-.. cfunction:: int PyImport_AppendInittab(const char *name, PyObject* (*initfunc)(void))
+.. c:function:: int PyImport_AppendInittab(const char *name, PyObject* (*initfunc)(void))
Add a single module to the existing table of built-in modules. This is a
- convenience wrapper around :cfunc:`PyImport_ExtendInittab`, returning ``-1`` if
+ convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning ``-1`` if
the table could not be extended. The new module can be imported by the name
*name*, and uses the function *initfunc* as the initialization function called
on the first attempted import. This should be called before
- :cfunc:`Py_Initialize`.
+ :c:func:`Py_Initialize`.
-.. ctype:: struct _inittab
+.. c:type:: struct _inittab
Structure describing a single entry in the list of built-in modules. Each of
these structures gives the name and initialization function for a module built
into the interpreter. Programs which embed Python may use an array of these
- structures in conjunction with :cfunc:`PyImport_ExtendInittab` to provide
+ structures in conjunction with :c:func:`PyImport_ExtendInittab` to provide
additional built-in modules. The structure is defined in
:file:`Include/import.h` as::
@@ -229,11 +258,11 @@ Importing Modules
};
-.. cfunction:: int PyImport_ExtendInittab(struct _inittab *newtab)
+.. c:function:: int PyImport_ExtendInittab(struct _inittab *newtab)
Add a collection of modules to the table of built-in modules. The *newtab*
array must end with a sentinel entry which contains *NULL* for the :attr:`name`
field; failure to provide the sentinel value can result in a memory fault.
Returns ``0`` on success or ``-1`` if insufficient memory could be allocated to
extend the internal table. In the event of failure, no modules are added to the
- internal table. This should be called before :cfunc:`Py_Initialize`.
+ internal table. This should be called before :c:func:`Py_Initialize`.
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index b2fa3ee6e1..1806867e5e 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -12,13 +12,11 @@ Initializing and finalizing the interpreter
===========================================
-.. cfunction:: void Py_Initialize()
+.. c:function:: void Py_Initialize()
.. index::
single: Py_SetProgramName()
single: PyEval_InitThreads()
- single: PyEval_ReleaseLock()
- single: PyEval_AcquireLock()
single: modules (in module sys)
single: path (in module sys)
module: builtins
@@ -31,38 +29,37 @@ Initializing and finalizing the interpreter
Initialize the Python interpreter. In an application embedding Python, this
should be called before using any other Python/C API functions; with the
- exception of :cfunc:`Py_SetProgramName`, :cfunc:`PyEval_InitThreads`,
- :cfunc:`PyEval_ReleaseLock`, and :cfunc:`PyEval_AcquireLock`. This initializes
+ exception of :c:func:`Py_SetProgramName` and :c:func:`Py_SetPath`. This initializes
the table of loaded modules (``sys.modules``), and creates the fundamental
modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It also initializes
the module search path (``sys.path``). It does not set ``sys.argv``; use
- :cfunc:`PySys_SetArgvEx` for that. This is a no-op when called for a second time
- (without calling :cfunc:`Py_Finalize` first). There is no return value; it is a
+ :c:func:`PySys_SetArgvEx` for that. This is a no-op when called for a second time
+ (without calling :c:func:`Py_Finalize` first). There is no return value; it is a
fatal error if the initialization fails.
-.. cfunction:: void Py_InitializeEx(int initsigs)
+.. c:function:: void Py_InitializeEx(int initsigs)
- This function works like :cfunc:`Py_Initialize` if *initsigs* is 1. If
+ This function works like :c:func:`Py_Initialize` if *initsigs* is 1. If
*initsigs* is 0, it skips initialization registration of signal handlers, which
might be useful when Python is embedded.
-.. cfunction:: int Py_IsInitialized()
+.. c:function:: int Py_IsInitialized()
Return true (nonzero) when the Python interpreter has been initialized, false
- (zero) if not. After :cfunc:`Py_Finalize` is called, this returns false until
- :cfunc:`Py_Initialize` is called again.
+ (zero) if not. After :c:func:`Py_Finalize` is called, this returns false until
+ :c:func:`Py_Initialize` is called again.
-.. cfunction:: void Py_Finalize()
+.. c:function:: void Py_Finalize()
- Undo all initializations made by :cfunc:`Py_Initialize` and subsequent use of
+ Undo all initializations made by :c:func:`Py_Initialize` and subsequent use of
Python/C API functions, and destroy all sub-interpreters (see
- :cfunc:`Py_NewInterpreter` below) that were created and not yet destroyed since
- the last call to :cfunc:`Py_Initialize`. Ideally, this frees all memory
+ :c:func:`Py_NewInterpreter` below) that were created and not yet destroyed since
+ the last call to :c:func:`Py_Initialize`. Ideally, this frees all memory
allocated by the Python interpreter. This is a no-op when called for a second
- time (without calling :cfunc:`Py_Initialize` again first). There is no return
+ time (without calling :c:func:`Py_Initialize` again first). There is no return
value; errors during finalization are ignored.
This function is provided for a number of reasons. An embedding application
@@ -81,26 +78,26 @@ Initializing and finalizing the interpreter
please report it). Memory tied up in circular references between objects is not
freed. Some memory allocated by extension modules may not be freed. Some
extensions may not work properly if their initialization routine is called more
- than once; this can happen if an application calls :cfunc:`Py_Initialize` and
- :cfunc:`Py_Finalize` more than once.
+ than once; this can happen if an application calls :c:func:`Py_Initialize` and
+ :c:func:`Py_Finalize` more than once.
Process-wide parameters
=======================
-.. cfunction:: void Py_SetProgramName(wchar_t *name)
+.. c:function:: void Py_SetProgramName(wchar_t *name)
.. index::
single: Py_Initialize()
single: main()
single: Py_GetPath()
- This function should be called before :cfunc:`Py_Initialize` is called for
+ This function should be called before :c:func:`Py_Initialize` is called for
the first time, if it is called at all. It tells the interpreter the value
- of the ``argv[0]`` argument to the :cfunc:`main` function of the program
+ of the ``argv[0]`` argument to the :c:func:`main` function of the program
(converted to wide characters).
- This is used by :cfunc:`Py_GetPath` and some other functions below to find
+ This is used by :c:func:`Py_GetPath` and some other functions below to find
the Python run-time libraries relative to the interpreter executable. The
default value is ``'python'``. The argument should point to a
zero-terminated wide character string in static storage whose contents will not
@@ -108,20 +105,20 @@ Process-wide parameters
interpreter will change the contents of this storage.
-.. cfunction:: wchar* Py_GetProgramName()
+.. c:function:: wchar* Py_GetProgramName()
.. index:: single: Py_SetProgramName()
- Return the program name set with :cfunc:`Py_SetProgramName`, or the default.
+ Return the program name set with :c:func:`Py_SetProgramName`, or the default.
The returned string points into static storage; the caller should not modify its
value.
-.. cfunction:: wchar_t* Py_GetPrefix()
+.. c:function:: wchar_t* Py_GetPrefix()
Return the *prefix* for installed platform-independent files. This is derived
through a number of complicated rules from the program name set with
- :cfunc:`Py_SetProgramName` and some environment variables; for example, if the
+ :c:func:`Py_SetProgramName` and some environment variables; for example, if the
program name is ``'/usr/local/bin/python'``, the prefix is ``'/usr/local'``. The
returned string points into static storage; the caller should not modify its
value. This corresponds to the :makevar:`prefix` variable in the top-level
@@ -130,11 +127,11 @@ Process-wide parameters
It is only useful on Unix. See also the next function.
-.. cfunction:: wchar_t* Py_GetExecPrefix()
+.. c:function:: wchar_t* Py_GetExecPrefix()
Return the *exec-prefix* for installed platform-*dependent* files. This is
derived through a number of complicated rules from the program name set with
- :cfunc:`Py_SetProgramName` and some environment variables; for example, if the
+ :c:func:`Py_SetProgramName` and some environment variables; for example, if the
program name is ``'/usr/local/bin/python'``, the exec-prefix is
``'/usr/local'``. The returned string points into static storage; the caller
should not modify its value. This corresponds to the :makevar:`exec_prefix`
@@ -165,7 +162,7 @@ Process-wide parameters
platform.
-.. cfunction:: wchar_t* Py_GetProgramFullPath()
+.. c:function:: wchar_t* Py_GetProgramFullPath()
.. index::
single: Py_SetProgramName()
@@ -173,19 +170,20 @@ Process-wide parameters
Return the full program name of the Python executable; this is computed as a
side-effect of deriving the default module search path from the program name
- (set by :cfunc:`Py_SetProgramName` above). The returned string points into
+ (set by :c:func:`Py_SetProgramName` above). The returned string points into
static storage; the caller should not modify its value. The value is available
to Python code as ``sys.executable``.
-.. cfunction:: wchar_t* Py_GetPath()
+.. c:function:: wchar_t* Py_GetPath()
.. index::
triple: module; search; path
single: path (in module sys)
+ single: Py_SetPath()
Return the default module search path; this is computed from the program name
- (set by :cfunc:`Py_SetProgramName` above) and some environment variables.
+ (set by :c:func:`Py_SetProgramName` above) and some environment variables.
The returned string consists of a series of directory names separated by a
platform dependent delimiter character. The delimiter character is ``':'``
on Unix and Mac OS X, ``';'`` on Windows. The returned string points into
@@ -197,7 +195,26 @@ Process-wide parameters
.. XXX should give the exact rules
-.. cfunction:: const char* Py_GetVersion()
+.. c:function:: void Py_SetPath(const wchar_t *)
+
+ .. index::
+ triple: module; search; path
+ single: path (in module sys)
+ single: Py_GetPath()
+
+ Set the default module search path. If this function is called before
+ :c:func:`Py_Initialize`, then :c:func:`Py_GetPath` won't attempt to compute a
+ default search path but uses the one provided instead. This is useful if
+ Python is embedded by an application that has full knowledge of the location
+ of all modules. The path components should be separated by semicolons.
+
+ This also causes :data:`sys.executable` to be set only to the raw program
+ name (see :c:func:`Py_SetProgramName`) and for :data:`sys.prefix` and
+ :data:`sys.exec_prefix` to be empty. It is up to the caller to modify these
+ if required after calling :c:func:`Py_Initialize`.
+
+
+.. c:function:: const char* Py_GetVersion()
Return the version of this Python interpreter. This is a string that looks
something like ::
@@ -212,7 +229,7 @@ Process-wide parameters
modify its value. The value is available to Python code as :data:`sys.version`.
-.. cfunction:: const char* Py_GetPlatform()
+.. c:function:: const char* Py_GetPlatform()
.. index:: single: platform (in module sys)
@@ -225,7 +242,7 @@ Process-wide parameters
to Python code as ``sys.platform``.
-.. cfunction:: const char* Py_GetCopyright()
+.. c:function:: const char* Py_GetCopyright()
Return the official copyright string for the current Python version, for example
@@ -237,7 +254,7 @@ Process-wide parameters
value. The value is available to Python code as ``sys.copyright``.
-.. cfunction:: const char* Py_GetCompiler()
+.. c:function:: const char* Py_GetCompiler()
Return an indication of the compiler used to build the current Python version,
in square brackets, for example::
@@ -251,7 +268,7 @@ Process-wide parameters
``sys.version``.
-.. cfunction:: const char* Py_GetBuildInfo()
+.. c:function:: const char* Py_GetBuildInfo()
Return information about the sequence number and build date and time of the
current Python interpreter instance, for example ::
@@ -265,7 +282,7 @@ Process-wide parameters
``sys.version``.
-.. cfunction:: void PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
+.. c:function:: void PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
.. index::
single: main()
@@ -273,12 +290,12 @@ Process-wide parameters
single: argv (in module sys)
Set :data:`sys.argv` based on *argc* and *argv*. These parameters are
- similar to those passed to the program's :cfunc:`main` function with the
+ similar to those passed to the program's :c:func:`main` function with the
difference that the first entry should refer to the script file to be
executed rather than the executable hosting the Python interpreter. If there
isn't a script that will be run, the first entry in *argv* can be an empty
string. If this function fails to initialize :data:`sys.argv`, a fatal
- condition is signalled using :cfunc:`Py_FatalError`.
+ condition is signalled using :c:func:`Py_FatalError`.
If *updatepath* is zero, this is all the function does. If *updatepath*
is non-zero, the function also modifies :data:`sys.path` according to the
@@ -300,7 +317,7 @@ Process-wide parameters
On versions before 3.1.3, you can achieve the same effect by manually
popping the first :data:`sys.path` element after having called
- :cfunc:`PySys_SetArgv`, for example using::
+ :c:func:`PySys_SetArgv`, for example using::
PyRun_SimpleString("import sys; sys.path.pop(0)\n");
@@ -310,12 +327,12 @@ Process-wide parameters
check w/ Guido.
-.. cfunction:: void PySys_SetArgv(int argc, wchar_t **argv)
+.. c:function:: void PySys_SetArgv(int argc, wchar_t **argv)
- This function works like :cfunc:`PySys_SetArgvEx` with *updatepath* set to 1.
+ This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to 1.
-.. cfunction:: void Py_SetPythonHome(wchar_t *home)
+.. c:function:: void Py_SetPythonHome(wchar_t *home)
Set the default "home" directory, that is, the location of the standard
Python libraries. See :envvar:`PYTHONHOME` for the meaning of the
@@ -327,10 +344,10 @@ Process-wide parameters
this storage.
-.. cfunction:: w_char* Py_GetPythonHome()
+.. c:function:: w_char* Py_GetPythonHome()
Return the default "home", that is, the value set by a previous call to
- :cfunc:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME`
+ :c:func:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME`
environment variable if it is set.
@@ -352,12 +369,12 @@ operations could cause problems in a multi-threaded program: for example, when
two threads simultaneously increment the reference count of the same object, the
reference count could end up being incremented only once instead of twice.
-.. index:: single: setcheckinterval() (in module sys)
+.. index:: single: setswitchinterval() (in module sys)
Therefore, the rule exists that only the thread that has acquired the
:term:`GIL` may operate on Python objects or call Python/C API functions.
In order to emulate concurrency of execution, the interpreter regularly
-tries to switch threads (see :func:`sys.setcheckinterval`). The lock is also
+tries to switch threads (see :func:`sys.setswitchinterval`). The lock is also
released around potentially blocking I/O operations like reading or writing
a file, so that other Python threads can run in the meantime.
@@ -366,9 +383,9 @@ a file, so that other Python threads can run in the meantime.
single: PyThreadState
The Python interpreter keeps some thread-specific bookkeeping information
-inside a data structure called :ctype:`PyThreadState`. There's also one
-global variable pointing to the current :ctype:`PyThreadState`: it can
-be retrieved using :cfunc:`PyThreadState_Get`.
+inside a data structure called :c:type:`PyThreadState`. There's also one
+global variable pointing to the current :c:type:`PyThreadState`: it can
+be retrieved using :c:func:`PyThreadState_Get`.
Releasing the GIL from extension code
-------------------------------------
@@ -392,8 +409,8 @@ This is so common that a pair of macros exists to simplify it::
single: Py_BEGIN_ALLOW_THREADS
single: Py_END_ALLOW_THREADS
-The :cmacro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a
-hidden local variable; the :cmacro:`Py_END_ALLOW_THREADS` macro closes the
+The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a
+hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the
block. These two macros are still available when Python is compiled without
thread support (they simply have an empty expansion).
@@ -443,7 +460,7 @@ storing their thread state pointer, before you can start using the Python/C
API. When you are done, you should reset the thread state pointer, release
the GIL, and finally free the thread state data structure.
-The :cfunc:`PyGILState_Ensure` and :cfunc:`PyGILState_Release` functions do
+The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions do
all of the above automatically. The typical idiom for calling into Python
from a C thread is::
@@ -457,14 +474,14 @@ from a C thread is::
/* Release the thread. No Python API allowed beyond this point. */
PyGILState_Release(gstate);
-Note that the :cfunc:`PyGILState_\*` functions assume there is only one global
-interpreter (created automatically by :cfunc:`Py_Initialize`). Python
+Note that the :c:func:`PyGILState_\*` functions assume there is only one global
+interpreter (created automatically by :c:func:`Py_Initialize`). Python
supports the creation of additional interpreters (using
-:cfunc:`Py_NewInterpreter`), but mixing multiple interpreters and the
-:cfunc:`PyGILState_\*` API is unsupported.
+:c:func:`Py_NewInterpreter`), but mixing multiple interpreters and the
+:c:func:`PyGILState_\*` API is unsupported.
Another important thing to note about threads is their behaviour in the face
-of the C :cfunc:`fork` call. On most systems with :cfunc:`fork`, after a
+of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a
process forks only the thread that issued the fork will exist. That also
means any locks held by other threads will never be released. Python solves
this for :func:`os.fork` by acquiring the locks it uses internally before
@@ -472,12 +489,12 @@ the fork, and releasing them afterwards. In addition, it resets any
:ref:`lock-objects` in the child. When extending or embedding Python, there
is no way to inform Python of additional (non-Python) locks that need to be
acquired before or reset after a fork. OS facilities such as
-:cfunc:`pthread_atfork` would need to be used to accomplish the same thing.
-Additionally, when extending or embedding Python, calling :cfunc:`fork`
+:c:func:`pthread_atfork` would need to be used to accomplish the same thing.
+Additionally, when extending or embedding Python, calling :c:func:`fork`
directly rather than through :func:`os.fork` (and returning to or calling
into Python) may result in a deadlock by one of Python's internal locks
being held by a thread that is defunct after the fork.
-:cfunc:`PyOS_AfterFork` tries to reset the necessary locks, but is not
+:c:func:`PyOS_AfterFork` tries to reset the necessary locks, but is not
always able to.
@@ -487,7 +504,7 @@ High-level API
These are the most commonly used types and functions when writing C extension
code, or when embedding the Python interpreter:
-.. ctype:: PyInterpreterState
+.. c:type:: PyInterpreterState
This data structure represents the state shared by a number of cooperating
threads. Threads belonging to the same interpreter share their module
@@ -500,31 +517,30 @@ code, or when embedding the Python interpreter:
interpreter they belong.
-.. ctype:: PyThreadState
+.. c:type:: PyThreadState
This data structure represents the state of a single thread. The only public
- data member is :ctype:`PyInterpreterState \*`:attr:`interp`, which points to
+ data member is :c:type:`PyInterpreterState \*`:attr:`interp`, which points to
this thread's interpreter state.
-.. cfunction:: void PyEval_InitThreads()
+.. c:function:: void PyEval_InitThreads()
.. index::
- single: PyEval_ReleaseLock()
+ single: PyEval_AcquireThread()
single: PyEval_ReleaseThread()
single: PyEval_SaveThread()
single: PyEval_RestoreThread()
Initialize and acquire the global interpreter lock. It should be called in the
main thread before creating a second thread or engaging in any other thread
- operations such as :cfunc:`PyEval_ReleaseLock` or
- ``PyEval_ReleaseThread(tstate)``. It is not needed before calling
- :cfunc:`PyEval_SaveThread` or :cfunc:`PyEval_RestoreThread`.
+ operations such as ``PyEval_ReleaseThread(tstate)``. It is not needed before
+ calling :c:func:`PyEval_SaveThread` or :c:func:`PyEval_RestoreThread`.
- .. index:: single: Py_Initialize()
+ This is a no-op when called for a second time.
- This is a no-op when called for a second time. It is safe to call this function
- before calling :cfunc:`Py_Initialize`.
+ .. versionchanged:: 3.2
+ This function cannot be called before :c:func:`Py_Initialize()` anymore.
.. index:: module: _thread
@@ -537,7 +553,7 @@ code, or when embedding the Python interpreter:
when this function initializes the global interpreter lock, it also acquires
it. Before the Python :mod:`_thread` module creates a new thread, knowing
that either it has the lock or the lock hasn't been created yet, it calls
- :cfunc:`PyEval_InitThreads`. When this call returns, it is guaranteed that
+ :c:func:`PyEval_InitThreads`. When this call returns, it is guaranteed that
the lock has been created and that the calling thread has acquired it.
It is **not** safe to call this function when it is unknown which thread (if
@@ -546,15 +562,15 @@ code, or when embedding the Python interpreter:
This function is not available when thread support is disabled at compile time.
-.. cfunction:: int PyEval_ThreadsInitialized()
+.. c:function:: int PyEval_ThreadsInitialized()
- Returns a non-zero value if :cfunc:`PyEval_InitThreads` has been called. This
+ Returns a non-zero value if :c:func:`PyEval_InitThreads` has been called. This
function can be called without holding the GIL, and therefore can be used to
avoid calls to the locking API when running single-threaded. This function is
not available when thread support is disabled at compile time.
-.. cfunction:: PyThreadState* PyEval_SaveThread()
+.. c:function:: PyThreadState* PyEval_SaveThread()
Release the global interpreter lock (if it has been created and thread
support is enabled) and reset the thread state to *NULL*, returning the
@@ -563,7 +579,7 @@ code, or when embedding the Python interpreter:
when thread support is disabled at compile time.)
-.. cfunction:: void PyEval_RestoreThread(PyThreadState *tstate)
+.. c:function:: void PyEval_RestoreThread(PyThreadState *tstate)
Acquire the global interpreter lock (if it has been created and thread
support is enabled) and set the thread state to *tstate*, which must not be
@@ -572,23 +588,23 @@ code, or when embedding the Python interpreter:
when thread support is disabled at compile time.)
-.. cfunction:: PyThreadState* PyThreadState_Get()
+.. c:function:: PyThreadState* PyThreadState_Get()
Return the current thread state. The global interpreter lock must be held.
When the current thread state is *NULL*, this issues a fatal error (so that
the caller needn't check for *NULL*).
-.. cfunction:: PyThreadState* PyThreadState_Swap(PyThreadState *tstate)
+.. c:function:: PyThreadState* PyThreadState_Swap(PyThreadState *tstate)
Swap the current thread state with the thread state given by the argument
*tstate*, which may be *NULL*. The global interpreter lock must be held
and is not released.
-.. cfunction:: void PyEval_ReInitThreads()
+.. c:function:: void PyEval_ReInitThreads()
- This function is called from :cfunc:`PyOS_AfterFork` to ensure that newly
+ This function is called from :c:func:`PyOS_AfterFork` to ensure that newly
created child processes don't hold locks referring to threads which
are not running in the child process.
@@ -596,71 +612,71 @@ code, or when embedding the Python interpreter:
The following functions use thread-local storage, and are not compatible
with sub-interpreters:
-.. cfunction:: PyGILState_STATE PyGILState_Ensure()
+.. c:function:: PyGILState_STATE PyGILState_Ensure()
Ensure that the current thread is ready to call the Python C API regardless
of the current state of Python, or of the global interpreter lock. This may
be called as many times as desired by a thread as long as each call is
- matched with a call to :cfunc:`PyGILState_Release`. In general, other
- thread-related APIs may be used between :cfunc:`PyGILState_Ensure` and
- :cfunc:`PyGILState_Release` calls as long as the thread state is restored to
+ matched with a call to :c:func:`PyGILState_Release`. In general, other
+ thread-related APIs may be used between :c:func:`PyGILState_Ensure` and
+ :c:func:`PyGILState_Release` calls as long as the thread state is restored to
its previous state before the Release(). For example, normal usage of the
- :cmacro:`Py_BEGIN_ALLOW_THREADS` and :cmacro:`Py_END_ALLOW_THREADS` macros is
+ :c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS` macros is
acceptable.
The return value is an opaque "handle" to the thread state when
- :cfunc:`PyGILState_Ensure` was called, and must be passed to
- :cfunc:`PyGILState_Release` to ensure Python is left in the same state. Even
+ :c:func:`PyGILState_Ensure` was called, and must be passed to
+ :c:func:`PyGILState_Release` to ensure Python is left in the same state. Even
though recursive calls are allowed, these handles *cannot* be shared - each
- unique call to :cfunc:`PyGILState_Ensure` must save the handle for its call
- to :cfunc:`PyGILState_Release`.
+ unique call to :c:func:`PyGILState_Ensure` must save the handle for its call
+ to :c:func:`PyGILState_Release`.
When the function returns, the current thread will hold the GIL and be able
to call arbitrary Python code. Failure is a fatal error.
-.. cfunction:: void PyGILState_Release(PyGILState_STATE)
+.. c:function:: void PyGILState_Release(PyGILState_STATE)
Release any resources previously acquired. After this call, Python's state will
- be the same as it was prior to the corresponding :cfunc:`PyGILState_Ensure` call
+ be the same as it was prior to the corresponding :c:func:`PyGILState_Ensure` call
(but generally this state will be unknown to the caller, hence the use of the
GILState API).
- Every call to :cfunc:`PyGILState_Ensure` must be matched by a call to
- :cfunc:`PyGILState_Release` on the same thread.
+ Every call to :c:func:`PyGILState_Ensure` must be matched by a call to
+ :c:func:`PyGILState_Release` on the same thread.
The following macros are normally used without a trailing semicolon; look for
example usage in the Python source distribution.
-.. cmacro:: Py_BEGIN_ALLOW_THREADS
+.. c:macro:: Py_BEGIN_ALLOW_THREADS
This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();``.
Note that it contains an opening brace; it must be matched with a following
- :cmacro:`Py_END_ALLOW_THREADS` macro. See above for further discussion of this
+ :c:macro:`Py_END_ALLOW_THREADS` macro. See above for further discussion of this
macro. It is a no-op when thread support is disabled at compile time.
-.. cmacro:: Py_END_ALLOW_THREADS
+.. c:macro:: Py_END_ALLOW_THREADS
This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it contains
a closing brace; it must be matched with an earlier
- :cmacro:`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion of
+ :c:macro:`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion of
this macro. It is a no-op when thread support is disabled at compile time.
-.. cmacro:: Py_BLOCK_THREADS
+.. c:macro:: Py_BLOCK_THREADS
This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to
- :cmacro:`Py_END_ALLOW_THREADS` without the closing brace. It is a no-op when
+ :c:macro:`Py_END_ALLOW_THREADS` without the closing brace. It is a no-op when
thread support is disabled at compile time.
-.. cmacro:: Py_UNBLOCK_THREADS
+.. c:macro:: Py_UNBLOCK_THREADS
This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to
- :cmacro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable
+ :c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable
declaration. It is a no-op when thread support is disabled at compile time.
@@ -672,47 +688,47 @@ at compile time, and must be called only when the global interpreter lock has
been created.
-.. cfunction:: PyInterpreterState* PyInterpreterState_New()
+.. c:function:: PyInterpreterState* PyInterpreterState_New()
Create a new interpreter state object. The global interpreter lock need not
be held, but may be held if it is necessary to serialize calls to this
function.
-.. cfunction:: void PyInterpreterState_Clear(PyInterpreterState *interp)
+.. c:function:: void PyInterpreterState_Clear(PyInterpreterState *interp)
Reset all information in an interpreter state object. The global interpreter
lock must be held.
-.. cfunction:: void PyInterpreterState_Delete(PyInterpreterState *interp)
+.. c:function:: void PyInterpreterState_Delete(PyInterpreterState *interp)
Destroy an interpreter state object. The global interpreter lock need not be
held. The interpreter state must have been reset with a previous call to
- :cfunc:`PyInterpreterState_Clear`.
+ :c:func:`PyInterpreterState_Clear`.
-.. cfunction:: PyThreadState* PyThreadState_New(PyInterpreterState *interp)
+.. c:function:: PyThreadState* PyThreadState_New(PyInterpreterState *interp)
Create a new thread state object belonging to the given interpreter object.
The global interpreter lock need not be held, but may be held if it is
necessary to serialize calls to this function.
-.. cfunction:: void PyThreadState_Clear(PyThreadState *tstate)
+.. c:function:: void PyThreadState_Clear(PyThreadState *tstate)
Reset all information in a thread state object. The global interpreter lock
must be held.
-.. cfunction:: void PyThreadState_Delete(PyThreadState *tstate)
+.. c:function:: void PyThreadState_Delete(PyThreadState *tstate)
Destroy a thread state object. The global interpreter lock need not be held.
The thread state must have been reset with a previous call to
- :cfunc:`PyThreadState_Clear`.
+ :c:func:`PyThreadState_Clear`.
-.. cfunction:: PyObject* PyThreadState_GetDict()
+.. c:function:: PyObject* PyThreadState_GetDict()
Return a dictionary in which extensions can store thread-specific state
information. Each extension should use a unique key to use to store state in
@@ -721,7 +737,7 @@ been created.
the caller should assume no current thread state is available.
-.. cfunction:: int PyThreadState_SetAsyncExc(long id, PyObject *exc)
+.. c:function:: int PyThreadState_SetAsyncExc(long id, PyObject *exc)
Asynchronously raise an exception in a thread. The *id* argument is the thread
id of the target thread; *exc* is the exception object to be raised. This
@@ -732,18 +748,18 @@ been created.
exception (if any) for the thread is cleared. This raises no exceptions.
-.. cfunction:: void PyEval_AcquireThread(PyThreadState *tstate)
+.. c:function:: void PyEval_AcquireThread(PyThreadState *tstate)
Acquire the global interpreter lock and set the current thread state to
*tstate*, which should not be *NULL*. The lock must have been created earlier.
If this thread already has the lock, deadlock ensues.
- :cfunc:`PyEval_RestoreThread` is a higher-level function which is always
+ :c:func:`PyEval_RestoreThread` is a higher-level function which is always
available (even when thread support isn't enabled or when threads have
not been initialized).
-.. cfunction:: void PyEval_ReleaseThread(PyThreadState *tstate)
+.. c:function:: void PyEval_ReleaseThread(PyThreadState *tstate)
Reset the current thread state to *NULL* and release the global interpreter
lock. The lock must have been created earlier and must be held by the current
@@ -751,29 +767,29 @@ been created.
that it represents the current thread state --- if it isn't, a fatal error is
reported.
- :cfunc:`PyEval_SaveThread` is a higher-level function which is always
+ :c:func:`PyEval_SaveThread` is a higher-level function which is always
available (even when thread support isn't enabled or when threads have
not been initialized).
-.. cfunction:: void PyEval_AcquireLock()
+.. c:function:: void PyEval_AcquireLock()
Acquire the global interpreter lock. The lock must have been created earlier.
If this thread already has the lock, a deadlock ensues.
- .. warning::
- This function does not change the current thread state. Please use
- :cfunc:`PyEval_RestoreThread` or :cfunc:`PyEval_AcquireThread`
+ .. deprecated:: 3.2
+ This function does not update the current thread state. Please use
+ :c:func:`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread`
instead.
-.. cfunction:: void PyEval_ReleaseLock()
+.. c:function:: void PyEval_ReleaseLock()
Release the global interpreter lock. The lock must have been created earlier.
- .. warning::
- This function does not change the current thread state. Please use
- :cfunc:`PyEval_SaveThread` or :cfunc:`PyEval_ReleaseThread`
+ .. deprecated:: 3.2
+ This function does not update the current thread state. Please use
+ :c:func:`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread`
instead.
@@ -784,11 +800,11 @@ While in most uses, you will only embed a single Python interpreter, there
are cases where you need to create several independent interpreters in the
same process and perhaps even in the same thread. Sub-interpreters allow
you to do that. You can switch between sub-interpreters using the
-:cfunc:`PyThreadState_Swap` function. You can create and destroy them
+:c:func:`PyThreadState_Swap` function. You can create and destroy them
using the following functions:
-.. cfunction:: PyThreadState* Py_NewInterpreter()
+.. c:function:: PyThreadState* Py_NewInterpreter()
.. index::
module: builtins
@@ -830,13 +846,13 @@ using the following functions:
and filled with the contents of this copy; the extension's ``init`` function is
not called. Note that this is different from what happens when an extension is
imported after the interpreter has been completely re-initialized by calling
- :cfunc:`Py_Finalize` and :cfunc:`Py_Initialize`; in that case, the extension's
+ :c:func:`Py_Finalize` and :c:func:`Py_Initialize`; in that case, the extension's
``initmodule`` function *is* called again.
.. index:: single: close() (in module os)
-.. cfunction:: void Py_EndInterpreter(PyThreadState *tstate)
+.. c:function:: void Py_EndInterpreter(PyThreadState *tstate)
.. index:: single: Py_Finalize()
@@ -845,7 +861,7 @@ using the following functions:
states below. When the call returns, the current thread state is *NULL*. All
thread states associated with this interpreter are destroyed. (The global
interpreter lock must be held before calling this function and is still held
- when it returns.) :cfunc:`Py_Finalize` will destroy all sub-interpreters that
+ when it returns.) :c:func:`Py_Finalize` will destroy all sub-interpreters that
haven't been explicitly destroyed at that point.
@@ -866,11 +882,11 @@ instances or classes between sub-interpreters, since import operations executed
by such objects may affect the wrong (sub-)interpreter's dictionary of loaded
modules.
-Also note that combining this functionality with :cfunc:`PyGILState_\*` APIs
+Also note that combining this functionality with :c:func:`PyGILState_\*` APIs
is delicate, because these APIs assume a bijection between Python thread states
and OS-level threads, an assumption broken by the presence of sub-interpreters.
It is highly recommended that you don't switch sub-interpreters between a pair
-of matching :cfunc:`PyGILState_Ensure` and :cfunc:`PyGILState_Release` calls.
+of matching :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` calls.
Furthermore, extensions (such as :mod:`ctypes`) using these APIs to allow calling
of Python code from non-Python created threads will probably be broken when using
sub-interpreters.
@@ -892,7 +908,7 @@ a worker thread and the actual call than made at the earliest convenience by the
main thread where it has possession of the global interpreter lock and can
perform any Python API calls.
-.. cfunction:: int Py_AddPendingCall(int (*func)(void *), void *arg)
+.. c:function:: int Py_AddPendingCall(int (*func)(void *), void *arg)
.. index:: single: Py_AddPendingCall()
@@ -937,10 +953,10 @@ events reported to the trace function are the same as had been reported to the
Python-level trace functions in previous versions.
-.. ctype:: int (*Py_tracefunc)(PyObject *obj, PyFrameObject *frame, int what, PyObject *arg)
+.. c:type:: int (*Py_tracefunc)(PyObject *obj, PyFrameObject *frame, int what, PyObject *arg)
- The type of the trace function registered using :cfunc:`PyEval_SetProfile` and
- :cfunc:`PyEval_SetTrace`. The first parameter is the object passed to the
+ The type of the trace function registered using :c:func:`PyEval_SetProfile` and
+ :c:func:`PyEval_SetTrace`. The first parameter is the object passed to the
registration function as *obj*, *frame* is the frame object to which the event
pertains, *what* is one of the constants :const:`PyTrace_CALL`,
:const:`PyTrace_EXCEPTION`, :const:`PyTrace_LINE`, :const:`PyTrace_RETURN`,
@@ -968,18 +984,18 @@ Python-level trace functions in previous versions.
+------------------------------+--------------------------------------+
-.. cvar:: int PyTrace_CALL
+.. c:var:: int PyTrace_CALL
- The value of the *what* parameter to a :ctype:`Py_tracefunc` function when a new
+ The value of the *what* parameter to a :c:type:`Py_tracefunc` function when a new
call to a function or method is being reported, or a new entry into a generator.
Note that the creation of the iterator for a generator function is not reported
as there is no control transfer to the Python bytecode in the corresponding
frame.
-.. cvar:: int PyTrace_EXCEPTION
+.. c:var:: int PyTrace_EXCEPTION
- The value of the *what* parameter to a :ctype:`Py_tracefunc` function when an
+ The value of the *what* parameter to a :c:type:`Py_tracefunc` function when an
exception has been raised. The callback function is called with this value for
*what* when after any bytecode is processed after which the exception becomes
set within the frame being executed. The effect of this is that as exception
@@ -988,37 +1004,37 @@ Python-level trace functions in previous versions.
these events; they are not needed by the profiler.
-.. cvar:: int PyTrace_LINE
+.. c:var:: int PyTrace_LINE
The value passed as the *what* parameter to a trace function (but not a
profiling function) when a line-number event is being reported.
-.. cvar:: int PyTrace_RETURN
+.. c:var:: int PyTrace_RETURN
- The value for the *what* parameter to :ctype:`Py_tracefunc` functions when a
+ The value for the *what* parameter to :c:type:`Py_tracefunc` functions when a
call is returning without propagating an exception.
-.. cvar:: int PyTrace_C_CALL
+.. c:var:: int PyTrace_C_CALL
- The value for the *what* parameter to :ctype:`Py_tracefunc` functions when a C
+ The value for the *what* parameter to :c:type:`Py_tracefunc` functions when a C
function is about to be called.
-.. cvar:: int PyTrace_C_EXCEPTION
+.. c:var:: int PyTrace_C_EXCEPTION
- The value for the *what* parameter to :ctype:`Py_tracefunc` functions when a C
+ The value for the *what* parameter to :c:type:`Py_tracefunc` functions when a C
function has raised an exception.
-.. cvar:: int PyTrace_C_RETURN
+.. c:var:: int PyTrace_C_RETURN
- The value for the *what* parameter to :ctype:`Py_tracefunc` functions when a C
+ The value for the *what* parameter to :c:type:`Py_tracefunc` functions when a C
function has returned.
-.. cfunction:: void PyEval_SetProfile(Py_tracefunc func, PyObject *obj)
+.. c:function:: void PyEval_SetProfile(Py_tracefunc func, PyObject *obj)
Set the profiler function to *func*. The *obj* parameter is passed to the
function as its first parameter, and may be any Python object, or *NULL*. If
@@ -1028,13 +1044,13 @@ Python-level trace functions in previous versions.
events.
-.. cfunction:: void PyEval_SetTrace(Py_tracefunc func, PyObject *obj)
+.. c:function:: void PyEval_SetTrace(Py_tracefunc func, PyObject *obj)
Set the tracing function to *func*. This is similar to
- :cfunc:`PyEval_SetProfile`, except the tracing function does receive line-number
+ :c:func:`PyEval_SetProfile`, except the tracing function does receive line-number
events.
-.. cfunction:: PyObject* PyEval_GetCallStats(PyObject *self)
+.. c:function:: PyObject* PyEval_GetCallStats(PyObject *self)
Return a tuple of function call counts. There are constants defined for the
positions within the tuple:
@@ -1086,25 +1102,25 @@ Advanced Debugger Support
These functions are only intended to be used by advanced debugging tools.
-.. cfunction:: PyInterpreterState* PyInterpreterState_Head()
+.. c:function:: PyInterpreterState* PyInterpreterState_Head()
Return the interpreter state object at the head of the list of all such objects.
-.. cfunction:: PyInterpreterState* PyInterpreterState_Next(PyInterpreterState *interp)
+.. c:function:: PyInterpreterState* PyInterpreterState_Next(PyInterpreterState *interp)
Return the next interpreter state object after *interp* from the list of all
such objects.
-.. cfunction:: PyThreadState * PyInterpreterState_ThreadHead(PyInterpreterState *interp)
+.. c:function:: PyThreadState * PyInterpreterState_ThreadHead(PyInterpreterState *interp)
- Return the a pointer to the first :ctype:`PyThreadState` object in the list of
+ Return the a pointer to the first :c:type:`PyThreadState` object in the list of
threads associated with the interpreter *interp*.
-.. cfunction:: PyThreadState* PyThreadState_Next(PyThreadState *tstate)
+.. c:function:: PyThreadState* PyThreadState_Next(PyThreadState *tstate)
Return the next thread state object after *tstate* from the list of all such
- objects belonging to the same :ctype:`PyInterpreterState` object.
+ objects belonging to the same :c:type:`PyInterpreterState` object.
diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst
index c008b5c93d..83b98f9b4c 100644
--- a/Doc/c-api/intro.rst
+++ b/Doc/c-api/intro.rst
@@ -88,15 +88,15 @@ Objects, Types and Reference Counts
.. index:: object: type
Most Python/C API functions have one or more arguments as well as a return value
-of type :ctype:`PyObject\*`. This type is a pointer to an opaque data type
+of type :c:type:`PyObject\*`. This type is a pointer to an opaque data type
representing an arbitrary Python object. Since all Python object types are
treated the same way by the Python language in most situations (e.g.,
assignments, scope rules, and argument passing), it is only fitting that they
should be represented by a single C type. Almost all Python objects live on the
heap: you never declare an automatic or static variable of type
-:ctype:`PyObject`, only pointer variables of type :ctype:`PyObject\*` can be
+:c:type:`PyObject`, only pointer variables of type :c:type:`PyObject\*` can be
declared. The sole exception are the type objects; since these must never be
-deallocated, they are typically static :ctype:`PyTypeObject` objects.
+deallocated, they are typically static :c:type:`PyTypeObject` objects.
All Python objects (even Python integers) have a :dfn:`type` and a
:dfn:`reference count`. An object's type determines what kind of object it is
@@ -127,8 +127,8 @@ that.")
single: Py_DECREF()
Reference counts are always manipulated explicitly. The normal way is to use
-the macro :cfunc:`Py_INCREF` to increment an object's reference count by one,
-and :cfunc:`Py_DECREF` to decrement it by one. The :cfunc:`Py_DECREF` macro
+the macro :c:func:`Py_INCREF` to increment an object's reference count by one,
+and :c:func:`Py_DECREF` to decrement it by one. The :c:func:`Py_DECREF` macro
is considerably more complex than the incref one, since it must check whether
the reference count becomes zero and then cause the object's deallocator to be
called. The deallocator is a function pointer contained in the object's type
@@ -159,13 +159,13 @@ for a while without incrementing its reference count. Some other operation might
conceivably remove the object from the list, decrementing its reference count
and possible deallocating it. The real danger is that innocent-looking
operations may invoke arbitrary Python code which could do this; there is a code
-path which allows control to flow back to the user from a :cfunc:`Py_DECREF`, so
+path which allows control to flow back to the user from a :c:func:`Py_DECREF`, so
almost any operation is potentially dangerous.
A safe approach is to always use the generic operations (functions whose name
begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or ``PyMapping_``).
These operations always increment the reference count of the object they return.
-This leaves the caller with the responsibility to call :cfunc:`Py_DECREF` when
+This leaves the caller with the responsibility to call :c:func:`Py_DECREF` when
they are done with the result; this soon becomes second nature.
@@ -180,7 +180,7 @@ to objects (objects are not owned: they are always shared). "Owning a
reference" means being responsible for calling Py_DECREF on it when the
reference is no longer needed. Ownership can also be transferred, meaning that
the code that receives ownership of the reference then becomes responsible for
-eventually decref'ing it by calling :cfunc:`Py_DECREF` or :cfunc:`Py_XDECREF`
+eventually decref'ing it by calling :c:func:`Py_DECREF` or :c:func:`Py_XDECREF`
when it's no longer needed---or passing on this responsibility (usually to its
caller). When a function passes ownership of a reference on to its caller, the
caller is said to receive a *new* reference. When no ownership is transferred,
@@ -198,7 +198,7 @@ responsible for it any longer.
single: PyTuple_SetItem()
Few functions steal references; the two notable exceptions are
-:cfunc:`PyList_SetItem` and :cfunc:`PyTuple_SetItem`, which steal a reference
+:c:func:`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference
to the item (but not to the tuple or list into which the item is put!). These
functions were designed to steal a reference because of a common idiom for
populating a tuple or list with newly created objects; for example, the code to
@@ -212,21 +212,21 @@ error handling for the moment; a better way to code this is shown below)::
PyTuple_SetItem(t, 1, PyLong_FromLong(2L));
PyTuple_SetItem(t, 2, PyString_FromString("three"));
-Here, :cfunc:`PyLong_FromLong` returns a new reference which is immediately
-stolen by :cfunc:`PyTuple_SetItem`. When you want to keep using an object
-although the reference to it will be stolen, use :cfunc:`Py_INCREF` to grab
+Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately
+stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object
+although the reference to it will be stolen, use :c:func:`Py_INCREF` to grab
another reference before calling the reference-stealing function.
-Incidentally, :cfunc:`PyTuple_SetItem` is the *only* way to set tuple items;
-:cfunc:`PySequence_SetItem` and :cfunc:`PyObject_SetItem` refuse to do this
+Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple items;
+:c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to do this
since tuples are an immutable data type. You should only use
-:cfunc:`PyTuple_SetItem` for tuples that you are creating yourself.
+:c:func:`PyTuple_SetItem` for tuples that you are creating yourself.
-Equivalent code for populating a list can be written using :cfunc:`PyList_New`
-and :cfunc:`PyList_SetItem`.
+Equivalent code for populating a list can be written using :c:func:`PyList_New`
+and :c:func:`PyList_SetItem`.
However, in practice, you will rarely use these ways of creating and populating
-a tuple or list. There's a generic function, :cfunc:`Py_BuildValue`, that can
+a tuple or list. There's a generic function, :c:func:`Py_BuildValue`, that can
create most common objects from C values, directed by a :dfn:`format string`.
For example, the above two blocks of code could be replaced by the following
(which also takes care of the error checking)::
@@ -236,7 +236,7 @@ For example, the above two blocks of code could be replaced by the following
tuple = Py_BuildValue("(iis)", 1, 2, "three");
list = Py_BuildValue("[iis]", 1, 2, "three");
-It is much more common to use :cfunc:`PyObject_SetItem` and friends with items
+It is much more common to use :c:func:`PyObject_SetItem` and friends with items
whose references you are only borrowing, like arguments that were passed in to
the function you are writing. In that case, their behaviour regarding reference
counts is much saner, since you don't have to increment a reference count so you
@@ -270,15 +270,15 @@ for that reference, many functions that return a reference to an object give
you ownership of the reference. The reason is simple: in many cases, the
returned object is created on the fly, and the reference you get is the only
reference to the object. Therefore, the generic functions that return object
-references, like :cfunc:`PyObject_GetItem` and :cfunc:`PySequence_GetItem`,
+references, like :c:func:`PyObject_GetItem` and :c:func:`PySequence_GetItem`,
always return a new reference (the caller becomes the owner of the reference).
It is important to realize that whether you own a reference returned by a
function depends on which function you call only --- *the plumage* (the type of
the object passed as an argument to the function) *doesn't enter into it!*
-Thus, if you extract an item from a list using :cfunc:`PyList_GetItem`, you
+Thus, if you extract an item from a list using :c:func:`PyList_GetItem`, you
don't own the reference --- but if you obtain the same item from the same list
-using :cfunc:`PySequence_GetItem` (which happens to take exactly the same
+using :c:func:`PySequence_GetItem` (which happens to take exactly the same
arguments), you do own a reference to the returned object.
.. index::
@@ -286,8 +286,8 @@ arguments), you do own a reference to the returned object.
single: PySequence_GetItem()
Here is an example of how you could write a function that computes the sum of
-the items in a list of integers; once using :cfunc:`PyList_GetItem`, and once
-using :cfunc:`PySequence_GetItem`. ::
+the items in a list of integers; once using :c:func:`PyList_GetItem`, and once
+using :c:func:`PySequence_GetItem`. ::
long
sum_list(PyObject *list)
@@ -340,8 +340,8 @@ Types
-----
There are few other data types that play a significant role in the Python/C
-API; most are simple C types such as :ctype:`int`, :ctype:`long`,
-:ctype:`double` and :ctype:`char\*`. A few structure types are used to
+API; most are simple C types such as :c:type:`int`, :c:type:`long`,
+:c:type:`double` and :c:type:`char\*`. A few structure types are used to
describe static tables used to list the functions exported by a module or the
data attributes of a new object type, and another is used to describe the value
of a complex number. These will be discussed together with the functions that
@@ -370,7 +370,7 @@ indicator is either *NULL* or ``-1``, depending on the function's return type.
A few functions return a Boolean true/false result, with false indicating an
error. Very few functions return no explicit error indicator or have an
ambiguous return value, and require explicit testing for errors with
-:cfunc:`PyErr_Occurred`. These exceptions are always explicitly documented.
+:c:func:`PyErr_Occurred`. These exceptions are always explicitly documented.
.. index::
single: PyErr_SetString()
@@ -379,11 +379,11 @@ ambiguous return value, and require explicit testing for errors with
Exception state is maintained in per-thread storage (this is equivalent to
using global storage in an unthreaded application). A thread can be in one of
two states: an exception has occurred, or not. The function
-:cfunc:`PyErr_Occurred` can be used to check for this: it returns a borrowed
+:c:func:`PyErr_Occurred` can be used to check for this: it returns a borrowed
reference to the exception type object when an exception has occurred, and
*NULL* otherwise. There are a number of functions to set the exception state:
-:cfunc:`PyErr_SetString` is the most common (though not the most general)
-function to set the exception state, and :cfunc:`PyErr_Clear` clears the
+:c:func:`PyErr_SetString` is the most common (though not the most general)
+function to set the exception state, and :c:func:`PyErr_Clear` clears the
exception state.
The full exception state consists of three objects (all of which can be
@@ -419,7 +419,7 @@ and lose important information about the exact cause of the error.
.. index:: single: sum_sequence()
A simple example of detecting exceptions and passing them on is shown in the
-:cfunc:`sum_sequence` example above. It so happens that that example doesn't
+:c:func:`sum_sequence` example above. It so happens that that example doesn't
need to clean up any owned references when it detects an error. The following
example function shows some error cleanup. First, to remind you why you like
Python, we show the equivalent Python code::
@@ -486,10 +486,10 @@ Here is the corresponding C code, in all its glory::
single: Py_XDECREF()
This example represents an endorsed use of the ``goto`` statement in C!
-It illustrates the use of :cfunc:`PyErr_ExceptionMatches` and
-:cfunc:`PyErr_Clear` to handle specific exceptions, and the use of
-:cfunc:`Py_XDECREF` to dispose of owned references that may be *NULL* (note the
-``'X'`` in the name; :cfunc:`Py_DECREF` would crash when confronted with a
+It illustrates the use of :c:func:`PyErr_ExceptionMatches` and
+:c:func:`PyErr_Clear` to handle specific exceptions, and the use of
+:c:func:`Py_XDECREF` to dispose of owned references that may be *NULL* (note the
+``'X'`` in the name; :c:func:`Py_DECREF` would crash when confronted with a
*NULL* reference). It is important that the variables used to hold owned
references are initialized to *NULL* for this to work; likewise, the proposed
return value is initialized to ``-1`` (failure) and only set to success after
@@ -514,20 +514,20 @@ interpreter can only be used after the interpreter has been initialized.
triple: module; search; path
single: path (in module sys)
-The basic initialization function is :cfunc:`Py_Initialize`. This initializes
+The basic initialization function is :c:func:`Py_Initialize`. This initializes
the table of loaded modules, and creates the fundamental modules
:mod:`builtins`, :mod:`__main__`, and :mod:`sys`. It also
initializes the module search path (``sys.path``).
-.. index:: single: PySys_SetArgv()
+.. index:: single: PySys_SetArgvEx()
-:cfunc:`Py_Initialize` does not set the "script argument list" (``sys.argv``).
-If this variable is needed by Python code that will be executed later, it must
-be set explicitly with a call to ``PySys_SetArgv(argc, argv)`` subsequent to
-the call to :cfunc:`Py_Initialize`.
+:c:func:`Py_Initialize` does not set the "script argument list" (``sys.argv``).
+If this variable is needed by Python code that will be executed later, it must
+be set explicitly with a call to ``PySys_SetArgvEx(argc, argv, updatepath)``
+after the call to :c:func:`Py_Initialize`.
On most systems (in particular, on Unix and Windows, although the details are
-slightly different), :cfunc:`Py_Initialize` calculates the module search path
+slightly different), :c:func:`Py_Initialize` calculates the module search path
based upon its best guess for the location of the standard Python interpreter
executable, assuming that the Python library is found in a fixed location
relative to the Python interpreter executable. In particular, it looks for a
@@ -551,22 +551,22 @@ front of the standard path by setting :envvar:`PYTHONPATH`.
single: Py_GetProgramFullPath()
The embedding application can steer the search by calling
-``Py_SetProgramName(file)`` *before* calling :cfunc:`Py_Initialize`. Note that
+``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. Note that
:envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` is still
inserted in front of the standard path. An application that requires total
-control has to provide its own implementation of :cfunc:`Py_GetPath`,
-:cfunc:`Py_GetPrefix`, :cfunc:`Py_GetExecPrefix`, and
-:cfunc:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`).
+control has to provide its own implementation of :c:func:`Py_GetPath`,
+:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, and
+:c:func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`).
.. index:: single: Py_IsInitialized()
Sometimes, it is desirable to "uninitialize" Python. For instance, the
application may want to start over (make another call to
-:cfunc:`Py_Initialize`) or the application is simply done with its use of
+:c:func:`Py_Initialize`) or the application is simply done with its use of
Python and wants to free memory allocated by Python. This can be accomplished
-by calling :cfunc:`Py_Finalize`. The function :cfunc:`Py_IsInitialized` returns
+by calling :c:func:`Py_Finalize`. The function :c:func:`Py_IsInitialized` returns
true if Python is currently in the initialized state. More information about
-these functions is given in a later chapter. Notice that :cfunc:`Py_Finalize`
+these functions is given in a later chapter. Notice that :c:func:`Py_Finalize`
does *not* free all memory allocated by the Python interpreter, e.g. memory
allocated by extension modules currently cannot be released.
@@ -586,11 +586,11 @@ available that support tracing of reference counts, debugging the memory
allocator, or low-level profiling of the main interpreter loop. Only the most
frequently-used builds will be described in the remainder of this section.
-Compiling the interpreter with the :cmacro:`Py_DEBUG` macro defined produces
-what is generally meant by "a debug build" of Python. :cmacro:`Py_DEBUG` is
+Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined produces
+what is generally meant by "a debug build" of Python. :c:macro:`Py_DEBUG` is
enabled in the Unix build by adding :option:`--with-pydebug` to the
:file:`configure` command. It is also implied by the presence of the
-not-Python-specific :cmacro:`_DEBUG` macro. When :cmacro:`Py_DEBUG` is enabled
+not-Python-specific :c:macro:`_DEBUG` macro. When :c:macro:`Py_DEBUG` is enabled
in the Unix build, compiler optimization is disabled.
In addition to the reference count debugging described below, the following
@@ -619,11 +619,11 @@ extra checks are performed:
There may be additional checks not mentioned here.
-Defining :cmacro:`Py_TRACE_REFS` enables reference tracing. When defined, a
+Defining :c:macro:`Py_TRACE_REFS` enables reference tracing. When defined, a
circular doubly linked list of active objects is maintained by adding two extra
-fields to every :ctype:`PyObject`. Total allocations are tracked as well. Upon
+fields to every :c:type:`PyObject`. Total allocations are tracked as well. Upon
exit, all existing references are printed. (In interactive mode this happens
-after every statement run by the interpreter.) Implied by :cmacro:`Py_DEBUG`.
+after every statement run by the interpreter.) Implied by :c:macro:`Py_DEBUG`.
Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source distribution
for more detailed information.
diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst
index ba7e9e3a18..3f0f554dad 100644
--- a/Doc/c-api/iter.rst
+++ b/Doc/c-api/iter.rst
@@ -7,12 +7,12 @@ Iterator Protocol
There are only a couple of functions specifically for working with iterators.
-.. cfunction:: int PyIter_Check(PyObject *o)
+.. c:function:: int PyIter_Check(PyObject *o)
Return true if the object *o* supports the iterator protocol.
-.. cfunction:: PyObject* PyIter_Next(PyObject *o)
+.. c:function:: PyObject* PyIter_Next(PyObject *o)
Return the next value from the iteration *o*. If the object is an iterator,
this retrieves the next value from the iteration, and returns *NULL* with no
diff --git a/Doc/c-api/iterator.rst b/Doc/c-api/iterator.rst
index 86650800a4..82cb4eba8a 100644
--- a/Doc/c-api/iterator.rst
+++ b/Doc/c-api/iterator.rst
@@ -12,37 +12,37 @@ the callable for each item in the sequence, and ending the iteration when the
sentinel value is returned.
-.. cvar:: PyTypeObject PySeqIter_Type
+.. c:var:: PyTypeObject PySeqIter_Type
- Type object for iterator objects returned by :cfunc:`PySeqIter_New` and the
+ Type object for iterator objects returned by :c:func:`PySeqIter_New` and the
one-argument form of the :func:`iter` built-in function for built-in sequence
types.
-.. cfunction:: int PySeqIter_Check(op)
+.. c:function:: int PySeqIter_Check(op)
- Return true if the type of *op* is :cdata:`PySeqIter_Type`.
+ Return true if the type of *op* is :c:data:`PySeqIter_Type`.
-.. cfunction:: PyObject* PySeqIter_New(PyObject *seq)
+.. c:function:: PyObject* PySeqIter_New(PyObject *seq)
Return an iterator that works with a general sequence object, *seq*. The
iteration ends when the sequence raises :exc:`IndexError` for the subscripting
operation.
-.. cvar:: PyTypeObject PyCallIter_Type
+.. c:var:: PyTypeObject PyCallIter_Type
- Type object for iterator objects returned by :cfunc:`PyCallIter_New` and the
+ Type object for iterator objects returned by :c:func:`PyCallIter_New` and the
two-argument form of the :func:`iter` built-in function.
-.. cfunction:: int PyCallIter_Check(op)
+.. c:function:: int PyCallIter_Check(op)
- Return true if the type of *op* is :cdata:`PyCallIter_Type`.
+ Return true if the type of *op* is :c:data:`PyCallIter_Type`.
-.. cfunction:: PyObject* PyCallIter_New(PyObject *callable, PyObject *sentinel)
+.. c:function:: PyObject* PyCallIter_New(PyObject *callable, PyObject *sentinel)
Return a new iterator. The first parameter, *callable*, can be any Python
callable object that can be called with no parameters; each call to it should
diff --git a/Doc/c-api/list.rst b/Doc/c-api/list.rst
index 4e3d500b69..feb9015b6d 100644
--- a/Doc/c-api/list.rst
+++ b/Doc/c-api/list.rst
@@ -8,30 +8,30 @@ List Objects
.. index:: object: list
-.. ctype:: PyListObject
+.. c:type:: PyListObject
- This subtype of :ctype:`PyObject` represents a Python list object.
+ This subtype of :c:type:`PyObject` represents a Python list object.
-.. cvar:: PyTypeObject PyList_Type
+.. c:var:: PyTypeObject PyList_Type
- This instance of :ctype:`PyTypeObject` represents the Python list type.
+ This instance of :c:type:`PyTypeObject` represents the Python list type.
This is the same object as :class:`list` in the Python layer.
-.. cfunction:: int PyList_Check(PyObject *p)
+.. c:function:: int PyList_Check(PyObject *p)
Return true if *p* is a list object or an instance of a subtype of the list
type.
-.. cfunction:: int PyList_CheckExact(PyObject *p)
+.. c:function:: int PyList_CheckExact(PyObject *p)
Return true if *p* is a list object, but not an instance of a subtype of
the list type.
-.. cfunction:: PyObject* PyList_New(Py_ssize_t len)
+.. c:function:: PyObject* PyList_New(Py_ssize_t len)
Return a new list of length *len* on success, or *NULL* on failure.
@@ -39,11 +39,11 @@ List Objects
If *len* is greater than zero, the returned list object's items are
set to ``NULL``. Thus you cannot use abstract API functions such as
- :cfunc:`PySequence_SetItem` or expose the object to Python code before
- setting all items to a real object with :cfunc:`PyList_SetItem`.
+ :c:func:`PySequence_SetItem` or expose the object to Python code before
+ setting all items to a real object with :c:func:`PyList_SetItem`.
-.. cfunction:: Py_ssize_t PyList_Size(PyObject *list)
+.. c:function:: Py_ssize_t PyList_Size(PyObject *list)
.. index:: builtin: len
@@ -51,12 +51,12 @@ List Objects
``len(list)`` on a list object.
-.. cfunction:: Py_ssize_t PyList_GET_SIZE(PyObject *list)
+.. c:function:: Py_ssize_t PyList_GET_SIZE(PyObject *list)
- Macro form of :cfunc:`PyList_Size` without error checking.
+ Macro form of :c:func:`PyList_Size` without error checking.
-.. cfunction:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index)
+.. c:function:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index)
Return the object at position *index* in the list pointed to by *list*. The
position must be positive, indexing from the end of the list is not
@@ -64,12 +64,12 @@ List Objects
:exc:`IndexError` exception.
-.. cfunction:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i)
+.. c:function:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i)
- Macro form of :cfunc:`PyList_GetItem` without error checking.
+ Macro form of :c:func:`PyList_GetItem` without error checking.
-.. cfunction:: int PyList_SetItem(PyObject *list, Py_ssize_t index, PyObject *item)
+.. c:function:: int PyList_SetItem(PyObject *list, Py_ssize_t index, PyObject *item)
Set the item at index *index* in list to *item*. Return ``0`` on success
or ``-1`` on failure.
@@ -80,34 +80,34 @@ List Objects
an item already in the list at the affected position.
-.. cfunction:: void PyList_SET_ITEM(PyObject *list, Py_ssize_t i, PyObject *o)
+.. c:function:: void PyList_SET_ITEM(PyObject *list, Py_ssize_t i, PyObject *o)
- Macro form of :cfunc:`PyList_SetItem` without error checking. This is
+ Macro form of :c:func:`PyList_SetItem` without error checking. This is
normally only used to fill in new lists where there is no previous content.
.. note::
This macro "steals" a reference to *item*, and, unlike
- :cfunc:`PyList_SetItem`, does *not* discard a reference to any item that
+ :c:func:`PyList_SetItem`, does *not* discard a reference to any item that
is being replaced; any reference in *list* at position *i* will be
leaked.
-.. cfunction:: int PyList_Insert(PyObject *list, Py_ssize_t index, PyObject *item)
+.. c:function:: int PyList_Insert(PyObject *list, Py_ssize_t index, PyObject *item)
Insert the item *item* into list *list* in front of index *index*. Return
``0`` if successful; return ``-1`` and set an exception if unsuccessful.
Analogous to ``list.insert(index, item)``.
-.. cfunction:: int PyList_Append(PyObject *list, PyObject *item)
+.. c:function:: int PyList_Append(PyObject *list, PyObject *item)
Append the object *item* at the end of list *list*. Return ``0`` if
successful; return ``-1`` and set an exception if unsuccessful. Analogous
to ``list.append(item)``.
-.. cfunction:: PyObject* PyList_GetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high)
+.. c:function:: PyObject* PyList_GetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high)
Return a list of the objects in *list* containing the objects *between* *low*
and *high*. Return *NULL* and set an exception if unsuccessful. Analogous
@@ -115,7 +115,7 @@ List Objects
supported.
-.. cfunction:: int PyList_SetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high, PyObject *itemlist)
+.. c:function:: int PyList_SetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high, PyObject *itemlist)
Set the slice of *list* between *low* and *high* to the contents of
*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may
@@ -124,19 +124,19 @@ List Objects
slicing from Python, are not supported.
-.. cfunction:: int PyList_Sort(PyObject *list)
+.. c:function:: int PyList_Sort(PyObject *list)
Sort the items of *list* in place. Return ``0`` on success, ``-1`` on
failure. This is equivalent to ``list.sort()``.
-.. cfunction:: int PyList_Reverse(PyObject *list)
+.. c:function:: int PyList_Reverse(PyObject *list)
Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on
failure. This is the equivalent of ``list.reverse()``.
-.. cfunction:: PyObject* PyList_AsTuple(PyObject *list)
+.. c:function:: PyObject* PyList_AsTuple(PyObject *list)
.. index:: builtin: tuple
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index 9f8e3c5f64..b2295e0fad 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -10,32 +10,32 @@ Integer Objects
All integers are implemented as "long" integer objects of arbitrary size.
-.. ctype:: PyLongObject
+.. c:type:: PyLongObject
- This subtype of :ctype:`PyObject` represents a Python integer object.
+ This subtype of :c:type:`PyObject` represents a Python integer object.
-.. cvar:: PyTypeObject PyLong_Type
+.. c:var:: PyTypeObject PyLong_Type
- This instance of :ctype:`PyTypeObject` represents the Python integer type.
+ This instance of :c:type:`PyTypeObject` represents the Python integer type.
This is the same object as :class:`int` in the Python layer.
-.. cfunction:: int PyLong_Check(PyObject *p)
+.. c:function:: int PyLong_Check(PyObject *p)
- Return true if its argument is a :ctype:`PyLongObject` or a subtype of
- :ctype:`PyLongObject`.
+ Return true if its argument is a :c:type:`PyLongObject` or a subtype of
+ :c:type:`PyLongObject`.
-.. cfunction:: int PyLong_CheckExact(PyObject *p)
+.. c:function:: int PyLong_CheckExact(PyObject *p)
- Return true if its argument is a :ctype:`PyLongObject`, but not a subtype of
- :ctype:`PyLongObject`.
+ Return true if its argument is a :c:type:`PyLongObject`, but not a subtype of
+ :c:type:`PyLongObject`.
-.. cfunction:: PyObject* PyLong_FromLong(long v)
+.. c:function:: PyObject* PyLong_FromLong(long v)
- Return a new :ctype:`PyLongObject` object from *v*, or *NULL* on failure.
+ Return a new :c:type:`PyLongObject` object from *v*, or *NULL* on failure.
The current implementation keeps an array of integer objects for all integers
between ``-5`` and ``256``, when you create an int in that range you actually
@@ -44,47 +44,47 @@ All integers are implemented as "long" integer objects of arbitrary size.
undefined. :-)
-.. cfunction:: PyObject* PyLong_FromUnsignedLong(unsigned long v)
+.. c:function:: PyObject* PyLong_FromUnsignedLong(unsigned long v)
- Return a new :ctype:`PyLongObject` object from a C :ctype:`unsigned long`, or
+ Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long`, or
*NULL* on failure.
-.. cfunction:: PyObject* PyLong_FromSsize_t(Py_ssize_t v)
+.. c:function:: PyObject* PyLong_FromSsize_t(Py_ssize_t v)
- Return a new :ctype:`PyLongObject` object from a C :ctype:`Py_ssize_t`, or
+ Return a new :c:type:`PyLongObject` object from a C :c:type:`Py_ssize_t`, or
*NULL* on failure.
-.. cfunction:: PyObject* PyLong_FromSize_t(size_t v)
+.. c:function:: PyObject* PyLong_FromSize_t(size_t v)
- Return a new :ctype:`PyLongObject` object from a C :ctype:`size_t`, or
+ Return a new :c:type:`PyLongObject` object from a C :c:type:`size_t`, or
*NULL* on failure.
-.. cfunction:: PyObject* PyLong_FromLongLong(PY_LONG_LONG v)
+.. c:function:: PyObject* PyLong_FromLongLong(PY_LONG_LONG v)
- Return a new :ctype:`PyLongObject` object from a C :ctype:`long long`, or *NULL*
+ Return a new :c:type:`PyLongObject` object from a C :c:type:`long long`, or *NULL*
on failure.
-.. cfunction:: PyObject* PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG v)
+.. c:function:: PyObject* PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG v)
- Return a new :ctype:`PyLongObject` object from a C :ctype:`unsigned long long`,
+ Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long long`,
or *NULL* on failure.
-.. cfunction:: PyObject* PyLong_FromDouble(double v)
+.. c:function:: PyObject* PyLong_FromDouble(double v)
- Return a new :ctype:`PyLongObject` object from the integer part of *v*, or
+ Return a new :c:type:`PyLongObject` object from the integer part of *v*, or
*NULL* on failure.
-.. cfunction:: PyObject* PyLong_FromString(char *str, char **pend, int base)
+.. c:function:: PyObject* PyLong_FromString(char *str, char **pend, int base)
- Return a new :ctype:`PyLongObject` based on the string value in *str*, which
+ Return a new :c:type:`PyLongObject` based on the string value in *str*, which
is interpreted according to the radix in *base*. If *pend* is non-*NULL*,
- ``*pend`` will point to the first character in *str* which follows the
+ *\*pend* will point to the first character in *str* which follows the
representation of the number. If *base* is ``0``, the radix will be
determined based on the leading characters of *str*: if *str* starts with
``'0x'`` or ``'0X'``, radix 16 will be used; if *str* starts with ``'0o'`` or
@@ -94,85 +94,101 @@ All integers are implemented as "long" integer objects of arbitrary size.
ignored. If there are no digits, :exc:`ValueError` will be raised.
-.. cfunction:: PyObject* PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base)
+.. c:function:: PyObject* PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base)
Convert a sequence of Unicode digits to a Python integer value. The Unicode
- string is first encoded to a byte string using :cfunc:`PyUnicode_EncodeDecimal`
- and then converted using :cfunc:`PyLong_FromString`.
+ string is first encoded to a byte string using :c:func:`PyUnicode_EncodeDecimal`
+ and then converted using :c:func:`PyLong_FromString`.
-.. cfunction:: PyObject* PyLong_FromVoidPtr(void *p)
+.. c:function:: PyObject* PyLong_FromVoidPtr(void *p)
Create a Python integer from the pointer *p*. The pointer value can be
- retrieved from the resulting value using :cfunc:`PyLong_AsVoidPtr`.
+ retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`.
.. XXX alias PyLong_AS_LONG (for now)
-.. cfunction:: long PyLong_AsLong(PyObject *pylong)
+.. c:function:: long PyLong_AsLong(PyObject *pylong)
.. index::
single: LONG_MAX
single: OverflowError (built-in exception)
- Return a C :ctype:`long` representation of the contents of *pylong*. If
+ Return a C :c:type:`long` representation of the contents of *pylong*. If
*pylong* is greater than :const:`LONG_MAX`, raise an :exc:`OverflowError`,
and return -1. Convert non-long objects automatically to long first,
and return -1 if that raises exceptions.
-.. cfunction:: long PyLong_AsLongAndOverflow(PyObject *pylong, int* overflow)
+.. c:function:: long PyLong_AsLongAndOverflow(PyObject *pylong, int *overflow)
- Return a C :ctype:`long` representation of the contents of *pylong*. If
- *pylong* is greater than :const:`LONG_MAX`, return -1 and
- set `*overflow` to 1 (for overflow) or -1 (for underflow).
- If an exception is set because of type errors, also return -1.
+ Return a C :c:type:`long` representation of the contents of
+ *pylong*. If *pylong* is greater than :const:`LONG_MAX` or less
+ than :const:`LONG_MIN`, set *\*overflow* to ``1`` or ``-1``,
+ respectively, and return ``-1``; otherwise, set *\*overflow* to
+ ``0``. If any other exception occurs (for example a TypeError or
+ MemoryError), then ``-1`` will be returned and *\*overflow* will
+ be ``0``.
-.. cfunction:: Py_ssize_t PyLong_AsSsize_t(PyObject *pylong)
+.. c:function:: PY_LONG_LONG PyLong_AsLongLongAndOverflow(PyObject *pylong, int *overflow)
+
+ Return a C :c:type:`long long` representation of the contents of
+ *pylong*. If *pylong* is greater than :const:`PY_LLONG_MAX` or less
+ than :const:`PY_LLONG_MIN`, set *\*overflow* to ``1`` or ``-1``,
+ respectively, and return ``-1``; otherwise, set *\*overflow* to
+ ``0``. If any other exception occurs (for example a TypeError or
+ MemoryError), then ``-1`` will be returned and *\*overflow* will
+ be ``0``.
+
+ .. versionadded:: 3.2
+
+
+.. c:function:: Py_ssize_t PyLong_AsSsize_t(PyObject *pylong)
.. index::
single: PY_SSIZE_T_MAX
single: OverflowError (built-in exception)
- Return a C :ctype:`Py_ssize_t` representation of the contents of *pylong*.
+ Return a C :c:type:`Py_ssize_t` representation of the contents of *pylong*.
If *pylong* is greater than :const:`PY_SSIZE_T_MAX`, an :exc:`OverflowError`
is raised and ``-1`` will be returned.
-.. cfunction:: unsigned long PyLong_AsUnsignedLong(PyObject *pylong)
+.. c:function:: unsigned long PyLong_AsUnsignedLong(PyObject *pylong)
.. index::
single: ULONG_MAX
single: OverflowError (built-in exception)
- Return a C :ctype:`unsigned long` representation of the contents of *pylong*.
+ Return a C :c:type:`unsigned long` representation of the contents of *pylong*.
If *pylong* is greater than :const:`ULONG_MAX`, an :exc:`OverflowError` is
raised.
-.. cfunction:: size_t PyLong_AsSize_t(PyObject *pylong)
+.. c:function:: size_t PyLong_AsSize_t(PyObject *pylong)
- Return a :ctype:`size_t` representation of the contents of *pylong*. If
- *pylong* is greater than the maximum value for a :ctype:`size_t`, an
+ Return a :c:type:`size_t` representation of the contents of *pylong*. If
+ *pylong* is greater than the maximum value for a :c:type:`size_t`, an
:exc:`OverflowError` is raised.
-.. cfunction:: PY_LONG_LONG PyLong_AsLongLong(PyObject *pylong)
+.. c:function:: PY_LONG_LONG PyLong_AsLongLong(PyObject *pylong)
.. index::
single: OverflowError (built-in exception)
- Return a C :ctype:`long long` from a Python integer. If *pylong*
- cannot be represented as a :ctype:`long long`, an
+ Return a C :c:type:`long long` from a Python integer. If *pylong*
+ cannot be represented as a :c:type:`long long`, an
:exc:`OverflowError` is raised and ``-1`` is returned.
-.. cfunction:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *pylong)
+.. c:function:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *pylong)
.. index::
single: OverflowError (built-in exception)
- Return a C :ctype:`unsigned long long` from a Python integer. If
- *pylong* cannot be represented as an :ctype:`unsigned long long`,
+ Return a C :c:type:`unsigned long long` from a Python integer. If
+ *pylong* cannot be represented as an :c:type:`unsigned long long`,
an :exc:`OverflowError` is raised and ``(unsigned long long)-1`` is
returned.
@@ -180,28 +196,28 @@ All integers are implemented as "long" integer objects of arbitrary size.
A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`.
-.. cfunction:: unsigned long PyLong_AsUnsignedLongMask(PyObject *io)
+.. c:function:: unsigned long PyLong_AsUnsignedLongMask(PyObject *io)
- Return a C :ctype:`unsigned long` from a Python integer, without checking for
+ Return a C :c:type:`unsigned long` from a Python integer, without checking for
overflow.
-.. cfunction:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLongMask(PyObject *io)
+.. c:function:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLongMask(PyObject *io)
- Return a C :ctype:`unsigned long long` from a Python integer, without
+ Return a C :c:type:`unsigned long long` from a Python integer, without
checking for overflow.
-.. cfunction:: double PyLong_AsDouble(PyObject *pylong)
+.. c:function:: double PyLong_AsDouble(PyObject *pylong)
- Return a C :ctype:`double` representation of the contents of *pylong*. If
- *pylong* cannot be approximately represented as a :ctype:`double`, an
+ Return a C :c:type:`double` representation of the contents of *pylong*. If
+ *pylong* cannot be approximately represented as a :c:type:`double`, an
:exc:`OverflowError` exception is raised and ``-1.0`` will be returned.
-.. cfunction:: void* PyLong_AsVoidPtr(PyObject *pylong)
+.. c:function:: void* PyLong_AsVoidPtr(PyObject *pylong)
- Convert a Python integer *pylong* to a C :ctype:`void` pointer.
+ Convert a Python integer *pylong* to a C :c:type:`void` pointer.
If *pylong* cannot be converted, an :exc:`OverflowError` will be raised. This
- is only assured to produce a usable :ctype:`void` pointer for values created
- with :cfunc:`PyLong_FromVoidPtr`.
+ is only assured to produce a usable :c:type:`void` pointer for values created
+ with :c:func:`PyLong_FromVoidPtr`.
diff --git a/Doc/c-api/mapping.rst b/Doc/c-api/mapping.rst
index 5b2de14783..0ef29616e5 100644
--- a/Doc/c-api/mapping.rst
+++ b/Doc/c-api/mapping.rst
@@ -6,13 +6,13 @@ Mapping Protocol
================
-.. cfunction:: int PyMapping_Check(PyObject *o)
+.. c:function:: int PyMapping_Check(PyObject *o)
Return ``1`` if the object provides mapping protocol, and ``0`` otherwise. This
function always succeeds.
-.. cfunction:: Py_ssize_t PyMapping_Size(PyObject *o)
+.. c:function:: Py_ssize_t PyMapping_Size(PyObject *o)
Py_ssize_t PyMapping_Length(PyObject *o)
.. index:: builtin: len
@@ -22,58 +22,58 @@ Mapping Protocol
expression ``len(o)``.
-.. cfunction:: int PyMapping_DelItemString(PyObject *o, char *key)
+.. c:function:: int PyMapping_DelItemString(PyObject *o, char *key)
Remove the mapping for object *key* from the object *o*. Return ``-1`` on
failure. This is equivalent to the Python statement ``del o[key]``.
-.. cfunction:: int PyMapping_DelItem(PyObject *o, PyObject *key)
+.. c:function:: int PyMapping_DelItem(PyObject *o, PyObject *key)
Remove the mapping for object *key* from the object *o*. Return ``-1`` on
failure. This is equivalent to the Python statement ``del o[key]``.
-.. cfunction:: int PyMapping_HasKeyString(PyObject *o, char *key)
+.. c:function:: int PyMapping_HasKeyString(PyObject *o, char *key)
On success, return ``1`` if the mapping object has the key *key* and ``0``
otherwise. This is equivalent to the Python expression ``key in o``.
This function always succeeds.
-.. cfunction:: int PyMapping_HasKey(PyObject *o, PyObject *key)
+.. c:function:: int PyMapping_HasKey(PyObject *o, PyObject *key)
Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. This
is equivalent to the Python expression ``key in o``. This function always
succeeds.
-.. cfunction:: PyObject* PyMapping_Keys(PyObject *o)
+.. c:function:: PyObject* PyMapping_Keys(PyObject *o)
On success, return a list of the keys in object *o*. On failure, return *NULL*.
This is equivalent to the Python expression ``list(o.keys())``.
-.. cfunction:: PyObject* PyMapping_Values(PyObject *o)
+.. c:function:: PyObject* PyMapping_Values(PyObject *o)
On success, return a list of the values in object *o*. On failure, return
*NULL*. This is equivalent to the Python expression ``list(o.values())``.
-.. cfunction:: PyObject* PyMapping_Items(PyObject *o)
+.. c:function:: PyObject* PyMapping_Items(PyObject *o)
On success, return a list of the items in object *o*, where each item is a tuple
containing a key-value pair. On failure, return *NULL*. This is equivalent to
the Python expression ``list(o.items())``.
-.. cfunction:: PyObject* PyMapping_GetItemString(PyObject *o, char *key)
+.. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, char *key)
Return element of *o* corresponding to the object *key* or *NULL* on failure.
This is the equivalent of the Python expression ``o[key]``.
-.. cfunction:: int PyMapping_SetItemString(PyObject *o, char *key, PyObject *v)
+.. c:function:: int PyMapping_SetItemString(PyObject *o, char *key, PyObject *v)
Map the object *key* to the value *v* in object *o*. Returns ``-1`` on failure.
This is the equivalent of the Python statement ``o[key] = v``.
diff --git a/Doc/c-api/marshal.rst b/Doc/c-api/marshal.rst
index 04b0b88e6f..da402a8086 100644
--- a/Doc/c-api/marshal.rst
+++ b/Doc/c-api/marshal.rst
@@ -19,20 +19,20 @@ unmarshalling. Version 2 uses a binary format for floating point numbers.
*Py_MARSHAL_VERSION* indicates the current file format (currently 2).
-.. cfunction:: void PyMarshal_WriteLongToFile(long value, FILE *file, int version)
+.. c:function:: void PyMarshal_WriteLongToFile(long value, FILE *file, int version)
- Marshal a :ctype:`long` integer, *value*, to *file*. This will only write
+ Marshal a :c:type:`long` integer, *value*, to *file*. This will only write
the least-significant 32 bits of *value*; regardless of the size of the
- native :ctype:`long` type. *version* indicates the file format.
+ native :c:type:`long` type. *version* indicates the file format.
-.. cfunction:: void PyMarshal_WriteObjectToFile(PyObject *value, FILE *file, int version)
+.. c:function:: void PyMarshal_WriteObjectToFile(PyObject *value, FILE *file, int version)
Marshal a Python object, *value*, to *file*.
*version* indicates the file format.
-.. cfunction:: PyObject* PyMarshal_WriteObjectToString(PyObject *value, int version)
+.. c:function:: PyObject* PyMarshal_WriteObjectToString(PyObject *value, int version)
Return a string object containing the marshalled representation of *value*.
*version* indicates the file format.
@@ -47,31 +47,31 @@ no error. What's the right way to tell? Should only non-negative values be
written using these routines?
-.. cfunction:: long PyMarshal_ReadLongFromFile(FILE *file)
+.. c:function:: long PyMarshal_ReadLongFromFile(FILE *file)
- Return a C :ctype:`long` from the data stream in a :ctype:`FILE\*` opened
+ Return a C :c:type:`long` from the data stream in a :c:type:`FILE\*` opened
for reading. Only a 32-bit value can be read in using this function,
- regardless of the native size of :ctype:`long`.
+ regardless of the native size of :c:type:`long`.
-.. cfunction:: int PyMarshal_ReadShortFromFile(FILE *file)
+.. c:function:: int PyMarshal_ReadShortFromFile(FILE *file)
- Return a C :ctype:`short` from the data stream in a :ctype:`FILE\*` opened
+ Return a C :c:type:`short` from the data stream in a :c:type:`FILE\*` opened
for reading. Only a 16-bit value can be read in using this function,
- regardless of the native size of :ctype:`short`.
+ regardless of the native size of :c:type:`short`.
-.. cfunction:: PyObject* PyMarshal_ReadObjectFromFile(FILE *file)
+.. c:function:: PyObject* PyMarshal_ReadObjectFromFile(FILE *file)
- Return a Python object from the data stream in a :ctype:`FILE\*` opened for
+ Return a Python object from the data stream in a :c:type:`FILE\*` opened for
reading. On error, sets the appropriate exception (:exc:`EOFError` or
:exc:`TypeError`) and returns *NULL*.
-.. cfunction:: PyObject* PyMarshal_ReadLastObjectFromFile(FILE *file)
+.. c:function:: PyObject* PyMarshal_ReadLastObjectFromFile(FILE *file)
- Return a Python object from the data stream in a :ctype:`FILE\*` opened for
- reading. Unlike :cfunc:`PyMarshal_ReadObjectFromFile`, this function
+ Return a Python object from the data stream in a :c:type:`FILE\*` opened for
+ reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function
assumes that no further objects will be read from the file, allowing it to
aggressively load file data into memory so that the de-serialization can
operate from data in memory rather than reading a byte at a time from the
@@ -80,7 +80,7 @@ written using these routines?
(:exc:`EOFError` or :exc:`TypeError`) and returns *NULL*.
-.. cfunction:: PyObject* PyMarshal_ReadObjectFromString(char *string, Py_ssize_t len)
+.. c:function:: PyObject* PyMarshal_ReadObjectFromString(char *string, Py_ssize_t len)
Return a Python object from the data stream in a character buffer
containing *len* bytes pointed to by *string*. On error, sets the
diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst
index 81d7cd96cf..b80b3d53d9 100644
--- a/Doc/c-api/memory.rst
+++ b/Doc/c-api/memory.rst
@@ -47,8 +47,8 @@ API functions listed in this document.
single: free()
To avoid memory corruption, extension writers should never try to operate on
-Python objects with the functions exported by the C library: :cfunc:`malloc`,
-:cfunc:`calloc`, :cfunc:`realloc` and :cfunc:`free`. This will result in mixed
+Python objects with the functions exported by the C library: :c:func:`malloc`,
+:c:func:`calloc`, :c:func:`realloc` and :c:func:`free`. This will result in mixed
calls between the C allocator and the Python memory manager with fatal
consequences, because they implement different algorithms and operate on
different heaps. However, one may safely allocate and release memory blocks
@@ -94,65 +94,65 @@ behavior when requesting zero bytes, are available for allocating and releasing
memory from the Python heap:
-.. cfunction:: void* PyMem_Malloc(size_t n)
+.. c:function:: void* PyMem_Malloc(size_t n)
- Allocates *n* bytes and returns a pointer of type :ctype:`void\*` to the
+ Allocates *n* bytes and returns a pointer of type :c:type:`void\*` to the
allocated memory, or *NULL* if the request fails. Requesting zero bytes returns
- a distinct non-*NULL* pointer if possible, as if :cfunc:`PyMem_Malloc(1)` had
+ a distinct non-*NULL* pointer if possible, as if :c:func:`PyMem_Malloc(1)` had
been called instead. The memory will not have been initialized in any way.
-.. cfunction:: void* PyMem_Realloc(void *p, size_t n)
+.. c:function:: void* PyMem_Realloc(void *p, size_t n)
Resizes the memory block pointed to by *p* to *n* bytes. The contents will be
unchanged to the minimum of the old and the new sizes. If *p* is *NULL*, the
- call is equivalent to :cfunc:`PyMem_Malloc(n)`; else if *n* is equal to zero,
+ call is equivalent to :c:func:`PyMem_Malloc(n)`; else if *n* is equal to zero,
the memory block is resized but is not freed, and the returned pointer is
non-*NULL*. Unless *p* is *NULL*, it must have been returned by a previous call
- to :cfunc:`PyMem_Malloc` or :cfunc:`PyMem_Realloc`. If the request fails,
- :cfunc:`PyMem_Realloc` returns *NULL* and *p* remains a valid pointer to the
+ to :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`. If the request fails,
+ :c:func:`PyMem_Realloc` returns *NULL* and *p* remains a valid pointer to the
previous memory area.
-.. cfunction:: void PyMem_Free(void *p)
+.. c:function:: void PyMem_Free(void *p)
Frees the memory block pointed to by *p*, which must have been returned by a
- previous call to :cfunc:`PyMem_Malloc` or :cfunc:`PyMem_Realloc`. Otherwise, or
- if :cfunc:`PyMem_Free(p)` has been called before, undefined behavior occurs. If
+ previous call to :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`. Otherwise, or
+ if :c:func:`PyMem_Free(p)` has been called before, undefined behavior occurs. If
*p* is *NULL*, no operation is performed.
The following type-oriented macros are provided for convenience. Note that
*TYPE* refers to any C type.
-.. cfunction:: TYPE* PyMem_New(TYPE, size_t n)
+.. c:function:: TYPE* PyMem_New(TYPE, size_t n)
- Same as :cfunc:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes of
- memory. Returns a pointer cast to :ctype:`TYPE\*`. The memory will not have
+ Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes of
+ memory. Returns a pointer cast to :c:type:`TYPE\*`. The memory will not have
been initialized in any way.
-.. cfunction:: TYPE* PyMem_Resize(void *p, TYPE, size_t n)
+.. c:function:: TYPE* PyMem_Resize(void *p, TYPE, size_t n)
- Same as :cfunc:`PyMem_Realloc`, but the memory block is resized to ``(n *
- sizeof(TYPE))`` bytes. Returns a pointer cast to :ctype:`TYPE\*`. On return,
+ Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n *
+ sizeof(TYPE))`` bytes. Returns a pointer cast to :c:type:`TYPE\*`. On return,
*p* will be a pointer to the new memory area, or *NULL* in the event of
failure. This is a C preprocessor macro; p is always reassigned. Save
the original value of p to avoid losing memory when handling errors.
-.. cfunction:: void PyMem_Del(void *p)
+.. c:function:: void PyMem_Del(void *p)
- Same as :cfunc:`PyMem_Free`.
+ Same as :c:func:`PyMem_Free`.
In addition, the following macro sets are provided for calling the Python memory
allocator directly, without involving the C API functions listed above. However,
note that their use does not preserve binary compatibility across Python
versions and is therefore deprecated in extension modules.
-:cfunc:`PyMem_MALLOC`, :cfunc:`PyMem_REALLOC`, :cfunc:`PyMem_FREE`.
+:c:func:`PyMem_MALLOC`, :c:func:`PyMem_REALLOC`, :c:func:`PyMem_FREE`.
-:cfunc:`PyMem_NEW`, :cfunc:`PyMem_RESIZE`, :cfunc:`PyMem_DEL`.
+:c:func:`PyMem_NEW`, :c:func:`PyMem_RESIZE`, :c:func:`PyMem_DEL`.
.. _memoryexamples:
@@ -201,8 +201,8 @@ allocators operating on different heaps. ::
free(buf1); /* Fatal -- should be PyMem_Del() */
In addition to the functions aimed at handling raw memory blocks from the Python
-heap, objects in Python are allocated and released with :cfunc:`PyObject_New`,
-:cfunc:`PyObject_NewVar` and :cfunc:`PyObject_Del`.
+heap, objects in Python are allocated and released with :c:func:`PyObject_New`,
+:c:func:`PyObject_NewVar` and :c:func:`PyObject_Del`.
These will be explained in the next chapter on defining and implementing new
object types in C.
diff --git a/Doc/c-api/memoryview.rst b/Doc/c-api/memoryview.rst
index 9003d3e26d..34ecd12189 100644
--- a/Doc/c-api/memoryview.rst
+++ b/Doc/c-api/memoryview.rst
@@ -13,22 +13,22 @@ A :class:`memoryview` object exposes the C level :ref:`buffer interface
any other object.
-.. cfunction:: PyObject *PyMemoryView_FromObject(PyObject *obj)
+.. c:function:: PyObject *PyMemoryView_FromObject(PyObject *obj)
Create a memoryview object from an object that provides the buffer interface.
If *obj* supports writable buffer exports, the memoryview object will be
readable and writable, other it will be read-only.
-.. cfunction:: PyObject *PyMemoryView_FromBuffer(Py_buffer *view)
+.. c:function:: PyObject *PyMemoryView_FromBuffer(Py_buffer *view)
Create a memoryview object wrapping the given buffer structure *view*.
The memoryview object then owns the buffer represented by *view*, which
- means you shouldn't try to call :cfunc:`PyBuffer_Release` yourself: it
+ means you shouldn't try to call :c:func:`PyBuffer_Release` yourself: it
will be done on deallocation of the memoryview object.
-.. cfunction:: PyObject *PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char order)
+.. c:function:: PyObject *PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char order)
Create a memoryview object to a contiguous chunk of memory (in either
'C' or 'F'ortran *order*) from an object that defines the buffer
@@ -37,13 +37,13 @@ any other object.
new bytes object.
-.. cfunction:: int PyMemoryView_Check(PyObject *obj)
+.. c:function:: int PyMemoryView_Check(PyObject *obj)
Return true if the object *obj* is a memoryview object. It is not
currently allowed to create subclasses of :class:`memoryview`.
-.. cfunction:: Py_buffer *PyMemoryView_GET_BUFFER(PyObject *obj)
+.. c:function:: Py_buffer *PyMemoryView_GET_BUFFER(PyObject *obj)
Return a pointer to the buffer structure wrapped by the given
memoryview object. The object **must** be a memoryview instance;
diff --git a/Doc/c-api/method.rst b/Doc/c-api/method.rst
index d8b2ed89ee..27f9576332 100644
--- a/Doc/c-api/method.rst
+++ b/Doc/c-api/method.rst
@@ -7,38 +7,38 @@ Instance Method Objects
.. index:: object: instancemethod
-An instance method is a wrapper for a :cdata:`PyCFunction` and the new way
-to bind a :cdata:`PyCFunction` to a class object. It replaces the former call
+An instance method is a wrapper for a :c:data:`PyCFunction` and the new way
+to bind a :c:data:`PyCFunction` to a class object. It replaces the former call
``PyMethod_New(func, NULL, class)``.
-.. cvar:: PyTypeObject PyInstanceMethod_Type
+.. c:var:: PyTypeObject PyInstanceMethod_Type
- This instance of :ctype:`PyTypeObject` represents the Python instance
+ This instance of :c:type:`PyTypeObject` represents the Python instance
method type. It is not exposed to Python programs.
-.. cfunction:: int PyInstanceMethod_Check(PyObject *o)
+.. c:function:: int PyInstanceMethod_Check(PyObject *o)
Return true if *o* is an instance method object (has type
- :cdata:`PyInstanceMethod_Type`). The parameter must not be *NULL*.
+ :c:data:`PyInstanceMethod_Type`). The parameter must not be *NULL*.
-.. cfunction:: PyObject* PyInstanceMethod_New(PyObject *func)
+.. c:function:: PyObject* PyInstanceMethod_New(PyObject *func)
Return a new instance method object, with *func* being any callable object
*func* is is the function that will be called when the instance method is
called.
-.. cfunction:: PyObject* PyInstanceMethod_Function(PyObject *im)
+.. c:function:: PyObject* PyInstanceMethod_Function(PyObject *im)
Return the function object associated with the instance method *im*.
-.. cfunction:: PyObject* PyInstanceMethod_GET_FUNCTION(PyObject *im)
+.. c:function:: PyObject* PyInstanceMethod_GET_FUNCTION(PyObject *im)
- Macro version of :cfunc:`PyInstanceMethod_Function` which avoids error checking.
+ Macro version of :c:func:`PyInstanceMethod_Function` which avoids error checking.
.. _method-objects:
@@ -53,48 +53,48 @@ an user-defined class. Unbound methods (methods bound to a class object) are
no longer available.
-.. cvar:: PyTypeObject PyMethod_Type
+.. c:var:: PyTypeObject PyMethod_Type
.. index:: single: MethodType (in module types)
- This instance of :ctype:`PyTypeObject` represents the Python method type. This
+ This instance of :c:type:`PyTypeObject` represents the Python method type. This
is exposed to Python programs as ``types.MethodType``.
-.. cfunction:: int PyMethod_Check(PyObject *o)
+.. c:function:: int PyMethod_Check(PyObject *o)
- Return true if *o* is a method object (has type :cdata:`PyMethod_Type`). The
+ Return true if *o* is a method object (has type :c:data:`PyMethod_Type`). The
parameter must not be *NULL*.
-.. cfunction:: PyObject* PyMethod_New(PyObject *func, PyObject *self)
+.. c:function:: PyObject* PyMethod_New(PyObject *func, PyObject *self)
Return a new method object, with *func* being any callable object and *self*
the instance the method should be bound. *func* is is the function that will
be called when the method is called. *self* must not be *NULL*.
-.. cfunction:: PyObject* PyMethod_Function(PyObject *meth)
+.. c:function:: PyObject* PyMethod_Function(PyObject *meth)
Return the function object associated with the method *meth*.
-.. cfunction:: PyObject* PyMethod_GET_FUNCTION(PyObject *meth)
+.. c:function:: PyObject* PyMethod_GET_FUNCTION(PyObject *meth)
- Macro version of :cfunc:`PyMethod_Function` which avoids error checking.
+ Macro version of :c:func:`PyMethod_Function` which avoids error checking.
-.. cfunction:: PyObject* PyMethod_Self(PyObject *meth)
+.. c:function:: PyObject* PyMethod_Self(PyObject *meth)
Return the instance associated with the method *meth*.
-.. cfunction:: PyObject* PyMethod_GET_SELF(PyObject *meth)
+.. c:function:: PyObject* PyMethod_GET_SELF(PyObject *meth)
- Macro version of :cfunc:`PyMethod_Self` which avoids error checking.
+ Macro version of :c:func:`PyMethod_Self` which avoids error checking.
-.. cfunction:: int PyMethod_ClearFreeList()
+.. c:function:: int PyMethod_ClearFreeList()
Clear the free list. Return the total number of freed items.
diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst
index 12816c9fd8..ffd68e3084 100644
--- a/Doc/c-api/module.rst
+++ b/Doc/c-api/module.rst
@@ -10,26 +10,26 @@ Module Objects
There are only a few functions special to module objects.
-.. cvar:: PyTypeObject PyModule_Type
+.. c:var:: PyTypeObject PyModule_Type
.. index:: single: ModuleType (in module types)
- This instance of :ctype:`PyTypeObject` represents the Python module type. This
+ This instance of :c:type:`PyTypeObject` represents the Python module type. This
is exposed to Python programs as ``types.ModuleType``.
-.. cfunction:: int PyModule_Check(PyObject *p)
+.. c:function:: int PyModule_Check(PyObject *p)
Return true if *p* is a module object, or a subtype of a module object.
-.. cfunction:: int PyModule_CheckExact(PyObject *p)
+.. c:function:: int PyModule_CheckExact(PyObject *p)
Return true if *p* is a module object, but not a subtype of
- :cdata:`PyModule_Type`.
+ :c:data:`PyModule_Type`.
-.. cfunction:: PyObject* PyModule_New(const char *name)
+.. c:function:: PyObject* PyModule_New(const char *name)
.. index::
single: __name__ (module attribute)
@@ -41,18 +41,18 @@ There are only a few functions special to module objects.
the caller is responsible for providing a :attr:`__file__` attribute.
-.. cfunction:: PyObject* PyModule_GetDict(PyObject *module)
+.. c:function:: PyObject* PyModule_GetDict(PyObject *module)
.. index:: single: __dict__ (module attribute)
Return the dictionary object that implements *module*'s namespace; this object
is the same as the :attr:`__dict__` attribute of the module object. This
function never fails. It is recommended extensions use other
- :cfunc:`PyModule_\*` and :cfunc:`PyObject_\*` functions rather than directly
+ :c:func:`PyModule_\*` and :c:func:`PyObject_\*` functions rather than directly
manipulate a module's :attr:`__dict__`.
-.. cfunction:: char* PyModule_GetName(PyObject *module)
+.. c:function:: char* PyModule_GetName(PyObject *module)
.. index::
single: __name__ (module attribute)
@@ -62,29 +62,42 @@ There are only a few functions special to module objects.
or if it is not a string, :exc:`SystemError` is raised and *NULL* is returned.
-.. cfunction:: char* PyModule_GetFilename(PyObject *module)
+.. c:function:: char* PyModule_GetFilename(PyObject *module)
+
+ Similar to :c:func:`PyModule_GetFilenameObject` but return the filename
+ encoded to 'utf-8'.
+
+ .. deprecated:: 3.2
+ :c:func:`PyModule_GetFilename` raises :c:type:`UnicodeEncodeError` on
+ unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead.
+
+
+.. c:function:: PyObject* PyModule_GetFilenameObject(PyObject *module)
.. index::
single: __file__ (module attribute)
single: SystemError (built-in exception)
Return the name of the file from which *module* was loaded using *module*'s
- :attr:`__file__` attribute. If this is not defined, or if it is not a string,
- raise :exc:`SystemError` and return *NULL*.
+ :attr:`__file__` attribute. If this is not defined, or if it is not a
+ unicode string, raise :exc:`SystemError` and return *NULL*; otherwise return
+ a reference to a :c:type:`PyUnicodeObject`.
+
+ .. versionadded:: 3.2
-.. cfunction:: void* PyModule_GetState(PyObject *module)
+.. c:function:: void* PyModule_GetState(PyObject *module)
Return the "state" of the module, that is, a pointer to the block of memory
allocated at module creation time, or *NULL*. See
- :cmember:`PyModuleDef.m_size`.
+ :c:member:`PyModuleDef.m_size`.
-.. cfunction:: PyModuleDef* PyModule_GetDef(PyObject *module)
+.. c:function:: PyModuleDef* PyModule_GetDef(PyObject *module)
- Return a pointer to the :ctype:`PyModuleDef` struct from which the module was
+ Return a pointer to the :c:type:`PyModuleDef` struct from which the module was
created, or *NULL* if the module wasn't created with
- :cfunc:`PyModule_Create`.
+ :c:func:`PyModule_Create`.
Initializing C modules
@@ -92,14 +105,14 @@ Initializing C modules
These functions are usually used in the module initialization function.
-.. cfunction:: PyObject* PyModule_Create(PyModuleDef *module)
+.. c:function:: PyObject* PyModule_Create(PyModuleDef *module)
Create a new module object, given the definition in *module*. This behaves
- like :cfunc:`PyModule_Create2` with *module_api_version* set to
+ like :c:func:`PyModule_Create2` with *module_api_version* set to
:const:`PYTHON_API_VERSION`.
-.. cfunction:: PyObject* PyModule_Create2(PyModuleDef *module, int module_api_version)
+.. c:function:: PyObject* PyModule_Create2(PyModuleDef *module, int module_api_version)
Create a new module object, given the definition in *module*, assuming the
API version *module_api_version*. If that version does not match the version
@@ -107,89 +120,89 @@ These functions are usually used in the module initialization function.
.. note::
- Most uses of this function should be using :cfunc:`PyModule_Create`
+ Most uses of this function should be using :c:func:`PyModule_Create`
instead; only use this if you are sure you need it.
-.. ctype:: PyModuleDef
+.. c:type:: PyModuleDef
This struct holds all information that is needed to create a module object.
There is usually only one static variable of that type for each module, which
- is statically initialized and then passed to :cfunc:`PyModule_Create` in the
+ is statically initialized and then passed to :c:func:`PyModule_Create` in the
module initialization function.
- .. cmember:: PyModuleDef_Base m_base
+ .. c:member:: PyModuleDef_Base m_base
Always initialize this member to :const:`PyModuleDef_HEAD_INIT`.
- .. cmember:: char* m_name
+ .. c:member:: char* m_name
Name for the new module.
- .. cmember:: char* m_doc
+ .. c:member:: char* m_doc
Docstring for the module; usually a docstring variable created with
- :cfunc:`PyDoc_STRVAR` is used.
+ :c:func:`PyDoc_STRVAR` is used.
- .. cmember:: Py_ssize_t m_size
+ .. c:member:: Py_ssize_t m_size
If the module object needs additional memory, this should be set to the
number of bytes to allocate; a pointer to the block of memory can be
- retrieved with :cfunc:`PyModule_GetState`. If no memory is needed, set
+ retrieved with :c:func:`PyModule_GetState`. If no memory is needed, set
this to ``-1``.
This memory should be used, rather than static globals, to hold per-module
state, since it is then safe for use in multiple sub-interpreters. It is
- freed when the module object is deallocated, after the :cmember:`m_free`
+ freed when the module object is deallocated, after the :c:member:`m_free`
function has been called, if present.
- .. cmember:: PyMethodDef* m_methods
+ .. c:member:: PyMethodDef* m_methods
A pointer to a table of module-level functions, described by
- :ctype:`PyMethodDef` values. Can be *NULL* if no functions are present.
+ :c:type:`PyMethodDef` values. Can be *NULL* if no functions are present.
- .. cmember:: inquiry m_reload
+ .. c:member:: inquiry m_reload
Currently unused, should be *NULL*.
- .. cmember:: traverseproc m_traverse
+ .. c:member:: traverseproc m_traverse
A traversal function to call during GC traversal of the module object, or
*NULL* if not needed.
- .. cmember:: inquiry m_clear
+ .. c:member:: inquiry m_clear
A clear function to call during GC clearing of the module object, or
*NULL* if not needed.
- .. cmember:: freefunc m_free
+ .. c:member:: freefunc m_free
A function to call during deallocation of the module object, or *NULL* if
not needed.
-.. cfunction:: int PyModule_AddObject(PyObject *module, const char *name, PyObject *value)
+.. c:function:: int PyModule_AddObject(PyObject *module, const char *name, PyObject *value)
Add an object to *module* as *name*. This is a convenience function which can
be used from the module's initialization function. This steals a reference to
*value*. Return ``-1`` on error, ``0`` on success.
-.. cfunction:: int PyModule_AddIntConstant(PyObject *module, const char *name, long value)
+.. c:function:: int PyModule_AddIntConstant(PyObject *module, const char *name, long value)
Add an integer constant to *module* as *name*. This convenience function can be
used from the module's initialization function. Return ``-1`` on error, ``0`` on
success.
-.. cfunction:: int PyModule_AddStringConstant(PyObject *module, const char *name, const char *value)
+.. c:function:: int PyModule_AddStringConstant(PyObject *module, const char *name, const char *value)
Add a string constant to *module* as *name*. This convenience function can be
used from the module's initialization function. The string *value* must be
null-terminated. Return ``-1`` on error, ``0`` on success.
-.. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro)
+.. c:function:: int PyModule_AddIntMacro(PyObject *module, macro)
Add an int constant to *module*. The name and the value are taken from
*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int
@@ -197,6 +210,6 @@ These functions are usually used in the module initialization function.
Return ``-1`` on error, ``0`` on success.
-.. cfunction:: int PyModule_AddStringMacro(PyObject *module, macro)
+.. c:function:: int PyModule_AddStringMacro(PyObject *module, macro)
Add a string constant to *module*.
diff --git a/Doc/c-api/none.rst b/Doc/c-api/none.rst
index 70e2c04bd0..b9ac26921d 100644
--- a/Doc/c-api/none.rst
+++ b/Doc/c-api/none.rst
@@ -7,20 +7,20 @@ The None Object
.. index:: object: None
-Note that the :ctype:`PyTypeObject` for ``None`` is not directly exposed in the
+Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in the
Python/C API. Since ``None`` is a singleton, testing for object identity (using
-``==`` in C) is sufficient. There is no :cfunc:`PyNone_Check` function for the
+``==`` in C) is sufficient. There is no :c:func:`PyNone_Check` function for the
same reason.
-.. cvar:: PyObject* Py_None
+.. c:var:: PyObject* Py_None
The Python ``None`` object, denoting lack of value. This object has no methods.
It needs to be treated just like any other object with respect to reference
counts.
-.. cmacro:: Py_RETURN_NONE
+.. c:macro:: Py_RETURN_NONE
- Properly handle returning :cdata:`Py_None` from within a C function (that is,
+ Properly handle returning :c:data:`Py_None` from within a C function (that is,
increment the reference count of None and return it.)
diff --git a/Doc/c-api/number.rst b/Doc/c-api/number.rst
index 57ef293ded..eda722d9e8 100644
--- a/Doc/c-api/number.rst
+++ b/Doc/c-api/number.rst
@@ -6,37 +6,37 @@ Number Protocol
===============
-.. cfunction:: int PyNumber_Check(PyObject *o)
+.. c:function:: int PyNumber_Check(PyObject *o)
Returns ``1`` if the object *o* provides numeric protocols, and false otherwise.
This function always succeeds.
-.. cfunction:: PyObject* PyNumber_Add(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_Add(PyObject *o1, PyObject *o2)
Returns the result of adding *o1* and *o2*, or *NULL* on failure. This is the
equivalent of the Python expression ``o1 + o2``.
-.. cfunction:: PyObject* PyNumber_Subtract(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_Subtract(PyObject *o1, PyObject *o2)
Returns the result of subtracting *o2* from *o1*, or *NULL* on failure. This is
the equivalent of the Python expression ``o1 - o2``.
-.. cfunction:: PyObject* PyNumber_Multiply(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_Multiply(PyObject *o1, PyObject *o2)
Returns the result of multiplying *o1* and *o2*, or *NULL* on failure. This is
the equivalent of the Python expression ``o1 * o2``.
-.. cfunction:: PyObject* PyNumber_FloorDivide(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_FloorDivide(PyObject *o1, PyObject *o2)
Return the floor of *o1* divided by *o2*, or *NULL* on failure. This is
equivalent to the "classic" division of integers.
-.. cfunction:: PyObject* PyNumber_TrueDivide(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_TrueDivide(PyObject *o1, PyObject *o2)
Return a reasonable approximation for the mathematical value of *o1* divided by
*o2*, or *NULL* on failure. The return value is "approximate" because binary
@@ -45,13 +45,13 @@ Number Protocol
passed two integers.
-.. cfunction:: PyObject* PyNumber_Remainder(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_Remainder(PyObject *o1, PyObject *o2)
Returns the remainder of dividing *o1* by *o2*, or *NULL* on failure. This is
the equivalent of the Python expression ``o1 % o2``.
-.. cfunction:: PyObject* PyNumber_Divmod(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_Divmod(PyObject *o1, PyObject *o2)
.. index:: builtin: divmod
@@ -59,29 +59,29 @@ Number Protocol
the equivalent of the Python expression ``divmod(o1, o2)``.
-.. cfunction:: PyObject* PyNumber_Power(PyObject *o1, PyObject *o2, PyObject *o3)
+.. c:function:: PyObject* PyNumber_Power(PyObject *o1, PyObject *o2, PyObject *o3)
.. index:: builtin: pow
See the built-in function :func:`pow`. Returns *NULL* on failure. This is the
equivalent of the Python expression ``pow(o1, o2, o3)``, where *o3* is optional.
- If *o3* is to be ignored, pass :cdata:`Py_None` in its place (passing *NULL* for
+ If *o3* is to be ignored, pass :c:data:`Py_None` in its place (passing *NULL* for
*o3* would cause an illegal memory access).
-.. cfunction:: PyObject* PyNumber_Negative(PyObject *o)
+.. c:function:: PyObject* PyNumber_Negative(PyObject *o)
Returns the negation of *o* on success, or *NULL* on failure. This is the
equivalent of the Python expression ``-o``.
-.. cfunction:: PyObject* PyNumber_Positive(PyObject *o)
+.. c:function:: PyObject* PyNumber_Positive(PyObject *o)
Returns *o* on success, or *NULL* on failure. This is the equivalent of the
Python expression ``+o``.
-.. cfunction:: PyObject* PyNumber_Absolute(PyObject *o)
+.. c:function:: PyObject* PyNumber_Absolute(PyObject *o)
.. index:: builtin: abs
@@ -89,71 +89,71 @@ Number Protocol
of the Python expression ``abs(o)``.
-.. cfunction:: PyObject* PyNumber_Invert(PyObject *o)
+.. c:function:: PyObject* PyNumber_Invert(PyObject *o)
Returns the bitwise negation of *o* on success, or *NULL* on failure. This is
the equivalent of the Python expression ``~o``.
-.. cfunction:: PyObject* PyNumber_Lshift(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_Lshift(PyObject *o1, PyObject *o2)
Returns the result of left shifting *o1* by *o2* on success, or *NULL* on
failure. This is the equivalent of the Python expression ``o1 << o2``.
-.. cfunction:: PyObject* PyNumber_Rshift(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_Rshift(PyObject *o1, PyObject *o2)
Returns the result of right shifting *o1* by *o2* on success, or *NULL* on
failure. This is the equivalent of the Python expression ``o1 >> o2``.
-.. cfunction:: PyObject* PyNumber_And(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_And(PyObject *o1, PyObject *o2)
Returns the "bitwise and" of *o1* and *o2* on success and *NULL* on failure.
This is the equivalent of the Python expression ``o1 & o2``.
-.. cfunction:: PyObject* PyNumber_Xor(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_Xor(PyObject *o1, PyObject *o2)
Returns the "bitwise exclusive or" of *o1* by *o2* on success, or *NULL* on
failure. This is the equivalent of the Python expression ``o1 ^ o2``.
-.. cfunction:: PyObject* PyNumber_Or(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_Or(PyObject *o1, PyObject *o2)
Returns the "bitwise or" of *o1* and *o2* on success, or *NULL* on failure.
This is the equivalent of the Python expression ``o1 | o2``.
-.. cfunction:: PyObject* PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2)
Returns the result of adding *o1* and *o2*, or *NULL* on failure. The operation
is done *in-place* when *o1* supports it. This is the equivalent of the Python
statement ``o1 += o2``.
-.. cfunction:: PyObject* PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2)
Returns the result of subtracting *o2* from *o1*, or *NULL* on failure. The
operation is done *in-place* when *o1* supports it. This is the equivalent of
the Python statement ``o1 -= o2``.
-.. cfunction:: PyObject* PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2)
Returns the result of multiplying *o1* and *o2*, or *NULL* on failure. The
operation is done *in-place* when *o1* supports it. This is the equivalent of
the Python statement ``o1 *= o2``.
-.. cfunction:: PyObject* PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2)
Returns the mathematical floor of dividing *o1* by *o2*, or *NULL* on failure.
The operation is done *in-place* when *o1* supports it. This is the equivalent
of the Python statement ``o1 //= o2``.
-.. cfunction:: PyObject* PyNumber_InPlaceTrueDivide(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceTrueDivide(PyObject *o1, PyObject *o2)
Return a reasonable approximation for the mathematical value of *o1* divided by
*o2*, or *NULL* on failure. The return value is "approximate" because binary
@@ -162,72 +162,60 @@ Number Protocol
passed two integers. The operation is done *in-place* when *o1* supports it.
-.. cfunction:: PyObject* PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2)
Returns the remainder of dividing *o1* by *o2*, or *NULL* on failure. The
operation is done *in-place* when *o1* supports it. This is the equivalent of
the Python statement ``o1 %= o2``.
-.. cfunction:: PyObject* PyNumber_InPlacePower(PyObject *o1, PyObject *o2, PyObject *o3)
+.. c:function:: PyObject* PyNumber_InPlacePower(PyObject *o1, PyObject *o2, PyObject *o3)
.. index:: builtin: pow
See the built-in function :func:`pow`. Returns *NULL* on failure. The operation
is done *in-place* when *o1* supports it. This is the equivalent of the Python
- statement ``o1 **= o2`` when o3 is :cdata:`Py_None`, or an in-place variant of
- ``pow(o1, o2, o3)`` otherwise. If *o3* is to be ignored, pass :cdata:`Py_None`
+ statement ``o1 **= o2`` when o3 is :c:data:`Py_None`, or an in-place variant of
+ ``pow(o1, o2, o3)`` otherwise. If *o3* is to be ignored, pass :c:data:`Py_None`
in its place (passing *NULL* for *o3* would cause an illegal memory access).
-.. cfunction:: PyObject* PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2)
Returns the result of left shifting *o1* by *o2* on success, or *NULL* on
failure. The operation is done *in-place* when *o1* supports it. This is the
equivalent of the Python statement ``o1 <<= o2``.
-.. cfunction:: PyObject* PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2)
Returns the result of right shifting *o1* by *o2* on success, or *NULL* on
failure. The operation is done *in-place* when *o1* supports it. This is the
equivalent of the Python statement ``o1 >>= o2``.
-.. cfunction:: PyObject* PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2)
Returns the "bitwise and" of *o1* and *o2* on success and *NULL* on failure. The
operation is done *in-place* when *o1* supports it. This is the equivalent of
the Python statement ``o1 &= o2``.
-.. cfunction:: PyObject* PyNumber_InPlaceXor(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceXor(PyObject *o1, PyObject *o2)
Returns the "bitwise exclusive or" of *o1* by *o2* on success, or *NULL* on
failure. The operation is done *in-place* when *o1* supports it. This is the
equivalent of the Python statement ``o1 ^= o2``.
-.. cfunction:: PyObject* PyNumber_InPlaceOr(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PyNumber_InPlaceOr(PyObject *o1, PyObject *o2)
Returns the "bitwise or" of *o1* and *o2* on success, or *NULL* on failure. The
operation is done *in-place* when *o1* supports it. This is the equivalent of
the Python statement ``o1 |= o2``.
-.. cfunction:: PyObject* PyNumber_Int(PyObject *o)
-
- Returns the *o* converted to an integer object on success, or *NULL* on
- failure. This is the equivalent of the Python expression ``int(o)``.
-
- .. note::
-
- This function is defined in the transitional :file:`intobject.h`
- header file. It will be removed completely in Python 3.1. Use
- the :cfunc:`PyNumber_Long` function instead.
-
-
-.. cfunction:: PyObject* PyNumber_Long(PyObject *o)
+.. c:function:: PyObject* PyNumber_Long(PyObject *o)
.. index:: builtin: int
@@ -235,7 +223,7 @@ Number Protocol
failure. This is the equivalent of the Python expression ``int(o)``.
-.. cfunction:: PyObject* PyNumber_Float(PyObject *o)
+.. c:function:: PyObject* PyNumber_Float(PyObject *o)
.. index:: builtin: float
@@ -243,22 +231,22 @@ Number Protocol
This is the equivalent of the Python expression ``float(o)``.
-.. cfunction:: PyObject* PyNumber_Index(PyObject *o)
+.. c:function:: PyObject* PyNumber_Index(PyObject *o)
Returns the *o* converted to a Python int on success or *NULL* with a
:exc:`TypeError` exception raised on failure.
-.. cfunction:: PyObject* PyNumber_ToBase(PyObject *n, int base)
+.. c:function:: PyObject* PyNumber_ToBase(PyObject *n, int base)
Returns the integer *n* converted to *base* as a string with a base
marker of ``'0b'``, ``'0o'``, or ``'0x'`` if applicable. When
*base* is not 2, 8, 10, or 16, the format is ``'x#num'`` where x is the
base. If *n* is not an int object, it is converted with
- :cfunc:`PyNumber_Index` first.
+ :c:func:`PyNumber_Index` first.
-.. cfunction:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc)
+.. c:function:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc)
Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an
integer. If *o* can be converted to a Python int but the attempt to
@@ -269,7 +257,7 @@ Number Protocol
integer or *PY_SSIZE_T_MAX* for a positive integer.
-.. cfunction:: int PyIndex_Check(PyObject *o)
+.. c:function:: int PyIndex_Check(PyObject *o)
Returns True if *o* is an index integer (has the nb_index slot of the
tp_as_number structure filled in).
diff --git a/Doc/c-api/objbuffer.rst b/Doc/c-api/objbuffer.rst
index 728d38343f..e7f4fde002 100644
--- a/Doc/c-api/objbuffer.rst
+++ b/Doc/c-api/objbuffer.rst
@@ -12,13 +12,13 @@ around the :ref:`new buffer protocol <bufferobjects>`, but they don't give
you control over the lifetime of the resources acquired when a buffer is
exported.
-Therefore, it is recommended that you call :cfunc:`PyObject_GetBuffer`
+Therefore, it is recommended that you call :c:func:`PyObject_GetBuffer`
(or the ``y*`` or ``w*`` :ref:`format codes <arg-parsing>` with the
-:cfunc:`PyArg_ParseTuple` family of functions) to get a buffer view over
-an object, and :cfunc:`PyBuffer_Release` when the buffer view can be released.
+:c:func:`PyArg_ParseTuple` family of functions) to get a buffer view over
+an object, and :c:func:`PyBuffer_Release` when the buffer view can be released.
-.. cfunction:: int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t *buffer_len)
+.. c:function:: int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t *buffer_len)
Returns a pointer to a read-only memory location usable as character-based
input. The *obj* argument must support the single-segment character buffer
@@ -27,7 +27,7 @@ an object, and :cfunc:`PyBuffer_Release` when the buffer view can be released.
:exc:`TypeError` on error.
-.. cfunction:: int PyObject_AsReadBuffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len)
+.. c:function:: int PyObject_AsReadBuffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len)
Returns a pointer to a read-only memory location containing arbitrary data.
The *obj* argument must support the single-segment readable buffer
@@ -36,13 +36,13 @@ an object, and :cfunc:`PyBuffer_Release` when the buffer view can be released.
:exc:`TypeError` on error.
-.. cfunction:: int PyObject_CheckReadBuffer(PyObject *o)
+.. c:function:: int PyObject_CheckReadBuffer(PyObject *o)
Returns ``1`` if *o* supports the single-segment readable buffer interface.
Otherwise returns ``0``.
-.. cfunction:: int PyObject_AsWriteBuffer(PyObject *obj, void **buffer, Py_ssize_t *buffer_len)
+.. c:function:: int PyObject_AsWriteBuffer(PyObject *obj, void **buffer, Py_ssize_t *buffer_len)
Returns a pointer to a writable memory location. The *obj* argument must
support the single-segment, character buffer interface. On success,
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index fd3a6d2380..d0d45ad001 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -6,7 +6,7 @@ Object Protocol
===============
-.. cfunction:: int PyObject_Print(PyObject *o, FILE *fp, int flags)
+.. c:function:: int PyObject_Print(PyObject *o, FILE *fp, int flags)
Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument
is used to enable certain printing options. The only option currently supported
@@ -14,35 +14,35 @@ Object Protocol
instead of the :func:`repr`.
-.. cfunction:: int PyObject_HasAttr(PyObject *o, PyObject *attr_name)
+.. c:function:: int PyObject_HasAttr(PyObject *o, PyObject *attr_name)
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This
is equivalent to the Python expression ``hasattr(o, attr_name)``. This function
always succeeds.
-.. cfunction:: int PyObject_HasAttrString(PyObject *o, const char *attr_name)
+.. c:function:: int PyObject_HasAttrString(PyObject *o, const char *attr_name)
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This
is equivalent to the Python expression ``hasattr(o, attr_name)``. This function
always succeeds.
-.. cfunction:: PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name)
+.. c:function:: PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name)
Retrieve an attribute named *attr_name* from object *o*. Returns the attribute
value on success, or *NULL* on failure. This is the equivalent of the Python
expression ``o.attr_name``.
-.. cfunction:: PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name)
+.. c:function:: PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name)
Retrieve an attribute named *attr_name* from object *o*. Returns the attribute
value on success, or *NULL* on failure. This is the equivalent of the Python
expression ``o.attr_name``.
-.. cfunction:: PyObject* PyObject_GenericGetAttr(PyObject *o, PyObject *name)
+.. c:function:: PyObject* PyObject_GenericGetAttr(PyObject *o, PyObject *name)
Generic attribute getter function that is meant to be put into a type
object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary
@@ -52,21 +52,21 @@ Object Protocol
descriptors don't. Otherwise, an :exc:`AttributeError` is raised.
-.. cfunction:: int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v)
+.. c:function:: int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v)
Set the value of the attribute named *attr_name*, for object *o*, to the value
*v*. Returns ``-1`` on failure. This is the equivalent of the Python statement
``o.attr_name = v``.
-.. cfunction:: int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v)
+.. c:function:: int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v)
Set the value of the attribute named *attr_name*, for object *o*, to the value
*v*. Returns ``-1`` on failure. This is the equivalent of the Python statement
``o.attr_name = v``.
-.. cfunction:: int PyObject_GenericSetAttr(PyObject *o, PyObject *name, PyObject *value)
+.. c:function:: int PyObject_GenericSetAttr(PyObject *o, PyObject *name, PyObject *value)
Generic attribute setter function that is meant to be put into a type
object's ``tp_setattro`` slot. It looks for a data descriptor in the
@@ -76,19 +76,19 @@ Object Protocol
an :exc:`AttributeError` is raised and ``-1`` is returned.
-.. cfunction:: int PyObject_DelAttr(PyObject *o, PyObject *attr_name)
+.. c:function:: int PyObject_DelAttr(PyObject *o, PyObject *attr_name)
Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on failure.
This is the equivalent of the Python statement ``del o.attr_name``.
-.. cfunction:: int PyObject_DelAttrString(PyObject *o, const char *attr_name)
+.. c:function:: int PyObject_DelAttrString(PyObject *o, const char *attr_name)
Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on failure.
This is the equivalent of the Python statement ``del o.attr_name``.
-.. cfunction:: PyObject* PyObject_RichCompare(PyObject *o1, PyObject *o2, int opid)
+.. c:function:: PyObject* PyObject_RichCompare(PyObject *o1, PyObject *o2, int opid)
Compare the values of *o1* and *o2* using the operation specified by *opid*,
which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`,
@@ -98,7 +98,7 @@ Object Protocol
to *opid*. Returns the value of the comparison on success, or *NULL* on failure.
-.. cfunction:: int PyObject_RichCompareBool(PyObject *o1, PyObject *o2, int opid)
+.. c:function:: int PyObject_RichCompareBool(PyObject *o1, PyObject *o2, int opid)
Compare the values of *o1* and *o2* using the operation specified by *opid*,
which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`,
@@ -109,10 +109,10 @@ Object Protocol
*opid*.
.. note::
- If *o1* and *o2* are the same object, :cfunc:`PyObject_RichCompareBool`
+ If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool`
will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`.
-.. cfunction:: PyObject* PyObject_Repr(PyObject *o)
+.. c:function:: PyObject* PyObject_Repr(PyObject *o)
.. index:: builtin: repr
@@ -121,18 +121,18 @@ Object Protocol
Python expression ``repr(o)``. Called by the :func:`repr` built-in function.
-.. cfunction:: PyObject* PyObject_ASCII(PyObject *o)
+.. c:function:: PyObject* PyObject_ASCII(PyObject *o)
.. index:: builtin: ascii
- As :cfunc:`PyObject_Repr`, compute a string representation of object *o*, but
+ As :c:func:`PyObject_Repr`, compute a string representation of object *o*, but
escape the non-ASCII characters in the string returned by
- :cfunc:`PyObject_Repr` with ``\x``, ``\u`` or ``\U`` escapes. This generates
- a string similar to that returned by :cfunc:`PyObject_Repr` in Python 2.
+ :c:func:`PyObject_Repr` with ``\x``, ``\u`` or ``\U`` escapes. This generates
+ a string similar to that returned by :c:func:`PyObject_Repr` in Python 2.
Called by the :func:`ascii` built-in function.
-.. cfunction:: PyObject* PyObject_Str(PyObject *o)
+.. c:function:: PyObject* PyObject_Str(PyObject *o)
.. index:: builtin: str
@@ -141,20 +141,21 @@ Object Protocol
Python expression ``str(o)``. Called by the :func:`str` built-in function
and, therefore, by the :func:`print` function.
-.. cfunction:: PyObject* PyObject_Bytes(PyObject *o)
+.. c:function:: PyObject* PyObject_Bytes(PyObject *o)
.. index:: builtin: bytes
- Compute a bytes representation of object *o*. *NULL* is returned on failure
- and a bytes object on success. This is equivalent to the Python expression
- ``bytes(o)``.
+ Compute a bytes representation of object *o*. *NULL* is returned on
+ failure and a bytes object on success. This is equivalent to the Python
+ expression ``bytes(o)``, when *o* is not an integer. Unlike ``bytes(o)``,
+ a TypeError is raised when *o* is an integer instead of a zero-initialized
+ bytes object.
-
-.. cfunction:: int PyObject_IsInstance(PyObject *inst, PyObject *cls)
+.. c:function:: int PyObject_IsInstance(PyObject *inst, PyObject *cls)
Returns ``1`` if *inst* is an instance of the class *cls* or a subclass of
*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception. If
- *cls* is a type object rather than a class object, :cfunc:`PyObject_IsInstance`
+ *cls* is a type object rather than a class object, :c:func:`PyObject_IsInstance`
returns ``1`` if *inst* is of type *cls*. If *cls* is a tuple, the check will
be done against every entry in *cls*. The result will be ``1`` when at least one
of the checks returns ``1``, otherwise it will be ``0``. If *inst* is not a
@@ -170,13 +171,13 @@ of. If :class:`A` and :class:`B` are class objects, :class:`B` is a subclass of
:class:`A` if it inherits from :class:`A` either directly or indirectly. If
either is not a class object, a more general mechanism is used to determine the
class relationship of the two objects. When testing if *B* is a subclass of
-*A*, if *A* is *B*, :cfunc:`PyObject_IsSubclass` returns true. If *A* and *B*
+*A*, if *A* is *B*, :c:func:`PyObject_IsSubclass` returns true. If *A* and *B*
are different objects, *B*'s :attr:`__bases__` attribute is searched in a
depth-first fashion for *A* --- the presence of the :attr:`__bases__` attribute
is considered sufficient for this determination.
-.. cfunction:: int PyObject_IsSubclass(PyObject *derived, PyObject *cls)
+.. c:function:: int PyObject_IsSubclass(PyObject *derived, PyObject *cls)
Returns ``1`` if the class *derived* is identical to or derived from the class
*cls*, otherwise returns ``0``. In case of an error, returns ``-1``. If *cls*
@@ -186,13 +187,13 @@ is considered sufficient for this determination.
this function uses the generic algorithm described above.
-.. cfunction:: int PyCallable_Check(PyObject *o)
+.. c:function:: int PyCallable_Check(PyObject *o)
Determine if the object *o* is callable. Return ``1`` if the object is callable
and ``0`` otherwise. This function always succeeds.
-.. cfunction:: PyObject* PyObject_Call(PyObject *callable_object, PyObject *args, PyObject *kw)
+.. c:function:: PyObject* PyObject_Call(PyObject *callable_object, PyObject *args, PyObject *kw)
Call a callable Python object *callable_object*, with arguments given by the
tuple *args*, and named arguments given by the dictionary *kw*. If no named
@@ -202,7 +203,7 @@ is considered sufficient for this determination.
``callable_object(*args, **kw)``.
-.. cfunction:: PyObject* PyObject_CallObject(PyObject *callable_object, PyObject *args)
+.. c:function:: PyObject* PyObject_CallObject(PyObject *callable_object, PyObject *args)
Call a callable Python object *callable_object*, with arguments given by the
tuple *args*. If no arguments are needed, then *args* may be *NULL*. Returns
@@ -210,54 +211,58 @@ is considered sufficient for this determination.
of the Python expression ``callable_object(*args)``.
-.. cfunction:: PyObject* PyObject_CallFunction(PyObject *callable, char *format, ...)
+.. c:function:: PyObject* PyObject_CallFunction(PyObject *callable, char *format, ...)
Call a callable Python object *callable*, with a variable number of C arguments.
- The C arguments are described using a :cfunc:`Py_BuildValue` style format
+ The C arguments are described using a :c:func:`Py_BuildValue` style format
string. The format may be *NULL*, indicating that no arguments are provided.
Returns the result of the call on success, or *NULL* on failure. This is the
equivalent of the Python expression ``callable(*args)``. Note that if you only
- pass :ctype:`PyObject \*` args, :cfunc:`PyObject_CallFunctionObjArgs` is a
+ pass :c:type:`PyObject \*` args, :c:func:`PyObject_CallFunctionObjArgs` is a
faster alternative.
-.. cfunction:: PyObject* PyObject_CallMethod(PyObject *o, char *method, char *format, ...)
+.. c:function:: PyObject* PyObject_CallMethod(PyObject *o, char *method, char *format, ...)
Call the method named *method* of object *o* with a variable number of C
- arguments. The C arguments are described by a :cfunc:`Py_BuildValue` format
+ arguments. The C arguments are described by a :c:func:`Py_BuildValue` format
string that should produce a tuple. The format may be *NULL*, indicating that
no arguments are provided. Returns the result of the call on success, or *NULL*
on failure. This is the equivalent of the Python expression ``o.method(args)``.
- Note that if you only pass :ctype:`PyObject \*` args,
- :cfunc:`PyObject_CallMethodObjArgs` is a faster alternative.
+ Note that if you only pass :c:type:`PyObject \*` args,
+ :c:func:`PyObject_CallMethodObjArgs` is a faster alternative.
-.. cfunction:: PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ..., NULL)
+.. c:function:: PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ..., NULL)
Call a callable Python object *callable*, with a variable number of
- :ctype:`PyObject\*` arguments. The arguments are provided as a variable number
+ :c:type:`PyObject\*` arguments. The arguments are provided as a variable number
of parameters followed by *NULL*. Returns the result of the call on success, or
*NULL* on failure.
-.. cfunction:: PyObject* PyObject_CallMethodObjArgs(PyObject *o, PyObject *name, ..., NULL)
+.. c:function:: PyObject* PyObject_CallMethodObjArgs(PyObject *o, PyObject *name, ..., NULL)
Calls a method of the object *o*, where the name of the method is given as a
Python string object in *name*. It is called with a variable number of
- :ctype:`PyObject\*` arguments. The arguments are provided as a variable number
+ :c:type:`PyObject\*` arguments. The arguments are provided as a variable number
of parameters followed by *NULL*. Returns the result of the call on success, or
*NULL* on failure.
-.. cfunction:: long PyObject_Hash(PyObject *o)
+.. c:function:: Py_hash_t PyObject_Hash(PyObject *o)
.. index:: builtin: hash
Compute and return the hash value of an object *o*. On failure, return ``-1``.
This is the equivalent of the Python expression ``hash(o)``.
+ .. versionchanged:: 3.2
+ The return type is now Py_hash_t. This is a signed integer the same size
+ as Py_ssize_t.
+
-.. cfunction:: long PyObject_HashNotImplemented(PyObject *o)
+.. c:function:: Py_hash_t PyObject_HashNotImplemented(PyObject *o)
Set a :exc:`TypeError` indicating that ``type(o)`` is not hashable and return ``-1``.
This function receives special treatment when stored in a ``tp_hash`` slot,
@@ -265,21 +270,21 @@ is considered sufficient for this determination.
hashable.
-.. cfunction:: int PyObject_IsTrue(PyObject *o)
+.. c:function:: int PyObject_IsTrue(PyObject *o)
Returns ``1`` if the object *o* is considered to be true, and ``0`` otherwise.
This is equivalent to the Python expression ``not not o``. On failure, return
``-1``.
-.. cfunction:: int PyObject_Not(PyObject *o)
+.. c:function:: int PyObject_Not(PyObject *o)
Returns ``0`` if the object *o* is considered to be true, and ``1`` otherwise.
This is equivalent to the Python expression ``not o``. On failure, return
``-1``.
-.. cfunction:: PyObject* PyObject_Type(PyObject *o)
+.. c:function:: PyObject* PyObject_Type(PyObject *o)
.. index:: builtin: type
@@ -288,17 +293,17 @@ is considered sufficient for this determination.
is equivalent to the Python expression ``type(o)``. This function increments the
reference count of the return value. There's really no reason to use this
function instead of the common expression ``o->ob_type``, which returns a
- pointer of type :ctype:`PyTypeObject\*`, except when the incremented reference
+ pointer of type :c:type:`PyTypeObject\*`, except when the incremented reference
count is needed.
-.. cfunction:: int PyObject_TypeCheck(PyObject *o, PyTypeObject *type)
+.. c:function:: int PyObject_TypeCheck(PyObject *o, PyTypeObject *type)
Return true if the object *o* is of type *type* or a subtype of *type*. Both
parameters must be non-*NULL*.
-.. cfunction:: Py_ssize_t PyObject_Length(PyObject *o)
+.. c:function:: Py_ssize_t PyObject_Length(PyObject *o)
Py_ssize_t PyObject_Size(PyObject *o)
.. index:: builtin: len
@@ -308,34 +313,34 @@ is considered sufficient for this determination.
returned. This is the equivalent to the Python expression ``len(o)``.
-.. cfunction:: PyObject* PyObject_GetItem(PyObject *o, PyObject *key)
+.. c:function:: PyObject* PyObject_GetItem(PyObject *o, PyObject *key)
Return element of *o* corresponding to the object *key* or *NULL* on failure.
This is the equivalent of the Python expression ``o[key]``.
-.. cfunction:: int PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v)
+.. c:function:: int PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v)
Map the object *key* to the value *v*. Returns ``-1`` on failure. This is the
equivalent of the Python statement ``o[key] = v``.
-.. cfunction:: int PyObject_DelItem(PyObject *o, PyObject *key)
+.. c:function:: int PyObject_DelItem(PyObject *o, PyObject *key)
Delete the mapping for *key* from *o*. Returns ``-1`` on failure. This is the
equivalent of the Python statement ``del o[key]``.
-.. cfunction:: PyObject* PyObject_Dir(PyObject *o)
+.. c:function:: PyObject* PyObject_Dir(PyObject *o)
This is equivalent to the Python expression ``dir(o)``, returning a (possibly
empty) list of strings appropriate for the object argument, or *NULL* if there
was an error. If the argument is *NULL*, this is like the Python ``dir()``,
returning the names of the current locals; in this case, if no execution frame
- is active then *NULL* is returned but :cfunc:`PyErr_Occurred` will return false.
+ is active then *NULL* is returned but :c:func:`PyErr_Occurred` will return false.
-.. cfunction:: PyObject* PyObject_GetIter(PyObject *o)
+.. c:function:: PyObject* PyObject_GetIter(PyObject *o)
This is equivalent to the Python expression ``iter(o)``. It returns a new
iterator for the object argument, or the object itself if the object is already
diff --git a/Doc/c-api/refcounting.rst b/Doc/c-api/refcounting.rst
index c0f4ca12dc..4f512ecdbe 100644
--- a/Doc/c-api/refcounting.rst
+++ b/Doc/c-api/refcounting.rst
@@ -11,22 +11,22 @@ The macros in this section are used for managing reference counts of Python
objects.
-.. cfunction:: void Py_INCREF(PyObject *o)
+.. c:function:: void Py_INCREF(PyObject *o)
Increment the reference count for object *o*. The object must not be *NULL*; if
- you aren't sure that it isn't *NULL*, use :cfunc:`Py_XINCREF`.
+ you aren't sure that it isn't *NULL*, use :c:func:`Py_XINCREF`.
-.. cfunction:: void Py_XINCREF(PyObject *o)
+.. c:function:: void Py_XINCREF(PyObject *o)
Increment the reference count for object *o*. The object may be *NULL*, in
which case the macro has no effect.
-.. cfunction:: void Py_DECREF(PyObject *o)
+.. c:function:: void Py_DECREF(PyObject *o)
Decrement the reference count for object *o*. The object must not be *NULL*; if
- you aren't sure that it isn't *NULL*, use :cfunc:`Py_XDECREF`. If the reference
+ you aren't sure that it isn't *NULL*, use :c:func:`Py_XDECREF`. If the reference
count reaches zero, the object's type's deallocation function (which must not be
*NULL*) is invoked.
@@ -36,25 +36,25 @@ objects.
when a class instance with a :meth:`__del__` method is deallocated). While
exceptions in such code are not propagated, the executed code has free access to
all Python global variables. This means that any object that is reachable from
- a global variable should be in a consistent state before :cfunc:`Py_DECREF` is
+ a global variable should be in a consistent state before :c:func:`Py_DECREF` is
invoked. For example, code to delete an object from a list should copy a
reference to the deleted object in a temporary variable, update the list data
- structure, and then call :cfunc:`Py_DECREF` for the temporary variable.
+ structure, and then call :c:func:`Py_DECREF` for the temporary variable.
-.. cfunction:: void Py_XDECREF(PyObject *o)
+.. c:function:: void Py_XDECREF(PyObject *o)
Decrement the reference count for object *o*. The object may be *NULL*, in
which case the macro has no effect; otherwise the effect is the same as for
- :cfunc:`Py_DECREF`, and the same warning applies.
+ :c:func:`Py_DECREF`, and the same warning applies.
-.. cfunction:: void Py_CLEAR(PyObject *o)
+.. c:function:: void Py_CLEAR(PyObject *o)
Decrement the reference count for object *o*. The object may be *NULL*, in
which case the macro has no effect; otherwise the effect is the same as for
- :cfunc:`Py_DECREF`, except that the argument is also set to *NULL*. The warning
- for :cfunc:`Py_DECREF` does not apply with respect to the object passed because
+ :c:func:`Py_DECREF`, except that the argument is also set to *NULL*. The warning
+ for :c:func:`Py_DECREF` does not apply with respect to the object passed because
the macro carefully uses a temporary variable and sets the argument to *NULL*
before decrementing its reference count.
@@ -64,10 +64,10 @@ objects.
The following functions are for runtime dynamic embedding of Python:
``Py_IncRef(PyObject *o)``, ``Py_DecRef(PyObject *o)``. They are
-simply exported function versions of :cfunc:`Py_XINCREF` and
-:cfunc:`Py_XDECREF`, respectively.
+simply exported function versions of :c:func:`Py_XINCREF` and
+:c:func:`Py_XDECREF`, respectively.
The following functions or macros are only for use within the interpreter core:
-:cfunc:`_Py_Dealloc`, :cfunc:`_Py_ForgetReference`, :cfunc:`_Py_NewReference`,
-as well as the global variable :cdata:`_Py_RefTotal`.
+:c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:`_Py_NewReference`,
+as well as the global variable :c:data:`_Py_RefTotal`.
diff --git a/Doc/c-api/reflection.rst b/Doc/c-api/reflection.rst
index 4f46c7fae8..96893652f7 100644
--- a/Doc/c-api/reflection.rst
+++ b/Doc/c-api/reflection.rst
@@ -5,40 +5,45 @@
Reflection
==========
-.. cfunction:: PyObject* PyEval_GetBuiltins()
+.. c:function:: PyObject* PyEval_GetBuiltins()
Return a dictionary of the builtins in the current execution frame,
or the interpreter of the thread state if no frame is currently executing.
-.. cfunction:: PyObject* PyEval_GetLocals()
+.. c:function:: PyObject* PyEval_GetLocals()
Return a dictionary of the local variables in the current execution frame,
or *NULL* if no frame is currently executing.
-.. cfunction:: PyObject* PyEval_GetGlobals()
+.. c:function:: PyObject* PyEval_GetGlobals()
Return a dictionary of the global variables in the current execution frame,
or *NULL* if no frame is currently executing.
-.. cfunction:: PyFrameObject* PyEval_GetFrame()
+.. c:function:: PyFrameObject* PyEval_GetFrame()
Return the current thread state's frame, which is *NULL* if no frame is
currently executing.
-.. cfunction:: const char* PyEval_GetFuncName(PyObject *func)
+.. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame)
+
+ Return the line number that *frame* is currently executing.
+
+
+.. c:function:: const char* PyEval_GetFuncName(PyObject *func)
Return the name of *func* if it is a function, class or instance object, else the
name of *func*\s type.
-.. cfunction:: const char* PyEval_GetFuncDesc(PyObject *func)
+.. c:function:: const char* PyEval_GetFuncDesc(PyObject *func)
Return a description string, depending on the type of *func*.
Return values include "()" for functions and methods, " constructor",
" instance", and " object". Concatenated with the result of
- :cfunc:`PyEval_GetFuncName`, the result will be a description of
+ :c:func:`PyEval_GetFuncName`, the result will be a description of
*func*.
diff --git a/Doc/c-api/sequence.rst b/Doc/c-api/sequence.rst
index d8631770fb..599074cddf 100644
--- a/Doc/c-api/sequence.rst
+++ b/Doc/c-api/sequence.rst
@@ -6,13 +6,13 @@ Sequence Protocol
=================
-.. cfunction:: int PySequence_Check(PyObject *o)
+.. c:function:: int PySequence_Check(PyObject *o)
Return ``1`` if the object provides sequence protocol, and ``0`` otherwise.
This function always succeeds.
-.. cfunction:: Py_ssize_t PySequence_Size(PyObject *o)
+.. c:function:: Py_ssize_t PySequence_Size(PyObject *o)
Py_ssize_t PySequence_Length(PyObject *o)
.. index:: builtin: len
@@ -22,96 +22,96 @@ Sequence Protocol
Python expression ``len(o)``.
-.. cfunction:: PyObject* PySequence_Concat(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PySequence_Concat(PyObject *o1, PyObject *o2)
Return the concatenation of *o1* and *o2* on success, and *NULL* on failure.
This is the equivalent of the Python expression ``o1 + o2``.
-.. cfunction:: PyObject* PySequence_Repeat(PyObject *o, Py_ssize_t count)
+.. c:function:: PyObject* PySequence_Repeat(PyObject *o, Py_ssize_t count)
Return the result of repeating sequence object *o* *count* times, or *NULL* on
failure. This is the equivalent of the Python expression ``o * count``.
-.. cfunction:: PyObject* PySequence_InPlaceConcat(PyObject *o1, PyObject *o2)
+.. c:function:: PyObject* PySequence_InPlaceConcat(PyObject *o1, PyObject *o2)
Return the concatenation of *o1* and *o2* on success, and *NULL* on failure.
The operation is done *in-place* when *o1* supports it. This is the equivalent
of the Python expression ``o1 += o2``.
-.. cfunction:: PyObject* PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count)
+.. c:function:: PyObject* PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count)
Return the result of repeating sequence object *o* *count* times, or *NULL* on
failure. The operation is done *in-place* when *o* supports it. This is the
equivalent of the Python expression ``o *= count``.
-.. cfunction:: PyObject* PySequence_GetItem(PyObject *o, Py_ssize_t i)
+.. c:function:: PyObject* PySequence_GetItem(PyObject *o, Py_ssize_t i)
Return the *i*\ th element of *o*, or *NULL* on failure. This is the equivalent of
the Python expression ``o[i]``.
-.. cfunction:: PyObject* PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)
+.. c:function:: PyObject* PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)
Return the slice of sequence object *o* between *i1* and *i2*, or *NULL* on
failure. This is the equivalent of the Python expression ``o[i1:i2]``.
-.. cfunction:: int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v)
+.. c:function:: int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v)
Assign object *v* to the *i*\ th element of *o*. Returns ``-1`` on failure. This
is the equivalent of the Python statement ``o[i] = v``. This function *does
not* steal a reference to *v*.
-.. cfunction:: int PySequence_DelItem(PyObject *o, Py_ssize_t i)
+.. c:function:: int PySequence_DelItem(PyObject *o, Py_ssize_t i)
Delete the *i*\ th element of object *o*. Returns ``-1`` on failure. This is the
equivalent of the Python statement ``del o[i]``.
-.. cfunction:: int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, PyObject *v)
+.. c:function:: int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, PyObject *v)
Assign the sequence object *v* to the slice in sequence object *o* from *i1* to
*i2*. This is the equivalent of the Python statement ``o[i1:i2] = v``.
-.. cfunction:: int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)
+.. c:function:: int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)
Delete the slice in sequence object *o* from *i1* to *i2*. Returns ``-1`` on
failure. This is the equivalent of the Python statement ``del o[i1:i2]``.
-.. cfunction:: Py_ssize_t PySequence_Count(PyObject *o, PyObject *value)
+.. c:function:: Py_ssize_t PySequence_Count(PyObject *o, PyObject *value)
Return the number of occurrences of *value* in *o*, that is, return the number
of keys for which ``o[key] == value``. On failure, return ``-1``. This is
equivalent to the Python expression ``o.count(value)``.
-.. cfunction:: int PySequence_Contains(PyObject *o, PyObject *value)
+.. c:function:: int PySequence_Contains(PyObject *o, PyObject *value)
Determine if *o* contains *value*. If an item in *o* is equal to *value*,
return ``1``, otherwise return ``0``. On error, return ``-1``. This is
equivalent to the Python expression ``value in o``.
-.. cfunction:: Py_ssize_t PySequence_Index(PyObject *o, PyObject *value)
+.. c:function:: Py_ssize_t PySequence_Index(PyObject *o, PyObject *value)
Return the first index *i* for which ``o[i] == value``. On error, return
``-1``. This is equivalent to the Python expression ``o.index(value)``.
-.. cfunction:: PyObject* PySequence_List(PyObject *o)
+.. c:function:: PyObject* PySequence_List(PyObject *o)
Return a list object with the same contents as the arbitrary sequence *o*. The
returned list is guaranteed to be new.
-.. cfunction:: PyObject* PySequence_Tuple(PyObject *o)
+.. c:function:: PyObject* PySequence_Tuple(PyObject *o)
.. index:: builtin: tuple
@@ -121,42 +121,42 @@ Sequence Protocol
equivalent to the Python expression ``tuple(o)``.
-.. cfunction:: PyObject* PySequence_Fast(PyObject *o, const char *m)
+.. c:function:: PyObject* PySequence_Fast(PyObject *o, const char *m)
Returns the sequence *o* as a tuple, unless it is already a tuple or list, in
- which case *o* is returned. Use :cfunc:`PySequence_Fast_GET_ITEM` to access the
+ which case *o* is returned. Use :c:func:`PySequence_Fast_GET_ITEM` to access the
members of the result. Returns *NULL* on failure. If the object is not a
sequence, raises :exc:`TypeError` with *m* as the message text.
-.. cfunction:: PyObject* PySequence_Fast_GET_ITEM(PyObject *o, Py_ssize_t i)
+.. c:function:: PyObject* PySequence_Fast_GET_ITEM(PyObject *o, Py_ssize_t i)
Return the *i*\ th element of *o*, assuming that *o* was returned by
- :cfunc:`PySequence_Fast`, *o* is not *NULL*, and that *i* is within bounds.
+ :c:func:`PySequence_Fast`, *o* is not *NULL*, and that *i* is within bounds.
-.. cfunction:: PyObject** PySequence_Fast_ITEMS(PyObject *o)
+.. c:function:: PyObject** PySequence_Fast_ITEMS(PyObject *o)
Return the underlying array of PyObject pointers. Assumes that *o* was returned
- by :cfunc:`PySequence_Fast` and *o* is not *NULL*.
+ by :c:func:`PySequence_Fast` and *o* is not *NULL*.
Note, if a list gets resized, the reallocation may relocate the items array.
So, only use the underlying array pointer in contexts where the sequence
cannot change.
-.. cfunction:: PyObject* PySequence_ITEM(PyObject *o, Py_ssize_t i)
+.. c:function:: PyObject* PySequence_ITEM(PyObject *o, Py_ssize_t i)
Return the *i*\ th element of *o* or *NULL* on failure. Macro form of
- :cfunc:`PySequence_GetItem` but without checking that
- :cfunc:`PySequence_Check(o)` is true and without adjustment for negative
+ :c:func:`PySequence_GetItem` but without checking that
+ :c:func:`PySequence_Check(o)` is true and without adjustment for negative
indices.
-.. cfunction:: Py_ssize_t PySequence_Fast_GET_SIZE(PyObject *o)
+.. c:function:: Py_ssize_t PySequence_Fast_GET_SIZE(PyObject *o)
Returns the length of *o*, assuming that *o* was returned by
- :cfunc:`PySequence_Fast` and that *o* is not *NULL*. The size can also be
- gotten by calling :cfunc:`PySequence_Size` on *o*, but
- :cfunc:`PySequence_Fast_GET_SIZE` is faster because it can assume *o* is a list
+ :c:func:`PySequence_Fast` and that *o* is not *NULL*. The size can also be
+ gotten by calling :c:func:`PySequence_Size` on *o*, but
+ :c:func:`PySequence_Fast_GET_SIZE` is faster because it can assume *o* is a list
or tuple.
diff --git a/Doc/c-api/set.rst b/Doc/c-api/set.rst
index 4348108421..66b47c4f71 100644
--- a/Doc/c-api/set.rst
+++ b/Doc/c-api/set.rst
@@ -14,20 +14,20 @@ Set Objects
This section details the public API for :class:`set` and :class:`frozenset`
objects. Any functionality not listed below is best accessed using the either
-the abstract object protocol (including :cfunc:`PyObject_CallMethod`,
-:cfunc:`PyObject_RichCompareBool`, :cfunc:`PyObject_Hash`,
-:cfunc:`PyObject_Repr`, :cfunc:`PyObject_IsTrue`, :cfunc:`PyObject_Print`, and
-:cfunc:`PyObject_GetIter`) or the abstract number protocol (including
-:cfunc:`PyNumber_And`, :cfunc:`PyNumber_Subtract`, :cfunc:`PyNumber_Or`,
-:cfunc:`PyNumber_Xor`, :cfunc:`PyNumber_InPlaceAnd`,
-:cfunc:`PyNumber_InPlaceSubtract`, :cfunc:`PyNumber_InPlaceOr`, and
-:cfunc:`PyNumber_InPlaceXor`).
+the abstract object protocol (including :c:func:`PyObject_CallMethod`,
+:c:func:`PyObject_RichCompareBool`, :c:func:`PyObject_Hash`,
+:c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:`PyObject_Print`, and
+:c:func:`PyObject_GetIter`) or the abstract number protocol (including
+:c:func:`PyNumber_And`, :c:func:`PyNumber_Subtract`, :c:func:`PyNumber_Or`,
+:c:func:`PyNumber_Xor`, :c:func:`PyNumber_InPlaceAnd`,
+:c:func:`PyNumber_InPlaceSubtract`, :c:func:`PyNumber_InPlaceOr`, and
+:c:func:`PyNumber_InPlaceXor`).
-.. ctype:: PySetObject
+.. c:type:: PySetObject
- This subtype of :ctype:`PyObject` is used to hold the internal data for both
- :class:`set` and :class:`frozenset` objects. It is like a :ctype:`PyDictObject`
+ This subtype of :c:type:`PyObject` is used to hold the internal data for both
+ :class:`set` and :class:`frozenset` objects. It is like a :c:type:`PyDictObject`
in that it is a fixed size for small sets (much like tuple storage) and will
point to a separate, variable sized block of memory for medium and large sized
sets (much like list storage). None of the fields of this structure should be
@@ -35,49 +35,49 @@ the abstract object protocol (including :cfunc:`PyObject_CallMethod`,
the documented API rather than by manipulating the values in the structure.
-.. cvar:: PyTypeObject PySet_Type
+.. c:var:: PyTypeObject PySet_Type
- This is an instance of :ctype:`PyTypeObject` representing the Python
+ This is an instance of :c:type:`PyTypeObject` representing the Python
:class:`set` type.
-.. cvar:: PyTypeObject PyFrozenSet_Type
+.. c:var:: PyTypeObject PyFrozenSet_Type
- This is an instance of :ctype:`PyTypeObject` representing the Python
+ This is an instance of :c:type:`PyTypeObject` representing the Python
:class:`frozenset` type.
The following type check macros work on pointers to any Python object. Likewise,
the constructor functions work with any iterable Python object.
-.. cfunction:: int PySet_Check(PyObject *p)
+.. c:function:: int PySet_Check(PyObject *p)
Return true if *p* is a :class:`set` object or an instance of a subtype.
-.. cfunction:: int PyFrozenSet_Check(PyObject *p)
+.. c:function:: int PyFrozenSet_Check(PyObject *p)
Return true if *p* is a :class:`frozenset` object or an instance of a
subtype.
-.. cfunction:: int PyAnySet_Check(PyObject *p)
+.. c:function:: int PyAnySet_Check(PyObject *p)
Return true if *p* is a :class:`set` object, a :class:`frozenset` object, or an
instance of a subtype.
-.. cfunction:: int PyAnySet_CheckExact(PyObject *p)
+.. c:function:: int PyAnySet_CheckExact(PyObject *p)
Return true if *p* is a :class:`set` object or a :class:`frozenset` object but
not an instance of a subtype.
-.. cfunction:: int PyFrozenSet_CheckExact(PyObject *p)
+.. c:function:: int PyFrozenSet_CheckExact(PyObject *p)
Return true if *p* is a :class:`frozenset` object but not an instance of a
subtype.
-.. cfunction:: PyObject* PySet_New(PyObject *iterable)
+.. c:function:: PyObject* PySet_New(PyObject *iterable)
Return a new :class:`set` containing objects returned by the *iterable*. The
*iterable* may be *NULL* to create a new empty set. Return the new set on
@@ -86,7 +86,7 @@ the constructor functions work with any iterable Python object.
(``c=set(s)``).
-.. cfunction:: PyObject* PyFrozenSet_New(PyObject *iterable)
+.. c:function:: PyObject* PyFrozenSet_New(PyObject *iterable)
Return a new :class:`frozenset` containing objects returned by the *iterable*.
The *iterable* may be *NULL* to create a new empty frozenset. Return the new
@@ -98,7 +98,7 @@ The following functions and macros are available for instances of :class:`set`
or :class:`frozenset` or instances of their subtypes.
-.. cfunction:: Py_ssize_t PySet_Size(PyObject *anyset)
+.. c:function:: Py_ssize_t PySet_Size(PyObject *anyset)
.. index:: builtin: len
@@ -107,12 +107,12 @@ or :class:`frozenset` or instances of their subtypes.
:class:`set`, :class:`frozenset`, or an instance of a subtype.
-.. cfunction:: Py_ssize_t PySet_GET_SIZE(PyObject *anyset)
+.. c:function:: Py_ssize_t PySet_GET_SIZE(PyObject *anyset)
- Macro form of :cfunc:`PySet_Size` without error checking.
+ Macro form of :c:func:`PySet_Size` without error checking.
-.. cfunction:: int PySet_Contains(PyObject *anyset, PyObject *key)
+.. c:function:: int PySet_Contains(PyObject *anyset, PyObject *key)
Return 1 if found, 0 if not found, and -1 if an error is encountered. Unlike
the Python :meth:`__contains__` method, this function does not automatically
@@ -121,10 +121,10 @@ or :class:`frozenset` or instances of their subtypes.
:class:`set`, :class:`frozenset`, or an instance of a subtype.
-.. cfunction:: int PySet_Add(PyObject *set, PyObject *key)
+.. c:function:: int PySet_Add(PyObject *set, PyObject *key)
Add *key* to a :class:`set` instance. Also works with :class:`frozenset`
- instances (like :cfunc:`PyTuple_SetItem` it can be used to fill-in the values
+ instances (like :c:func:`PyTuple_SetItem` it can be used to fill-in the values
of brand new frozensets before they are exposed to other code). Return 0 on
success or -1 on failure. Raise a :exc:`TypeError` if the *key* is
unhashable. Raise a :exc:`MemoryError` if there is no room to grow. Raise a
@@ -136,7 +136,7 @@ The following functions are available for instances of :class:`set` or its
subtypes but not for instances of :class:`frozenset` or its subtypes.
-.. cfunction:: int PySet_Discard(PyObject *set, PyObject *key)
+.. c:function:: int PySet_Discard(PyObject *set, PyObject *key)
Return 1 if found and removed, 0 if not found (no action taken), and -1 if an
error is encountered. Does not raise :exc:`KeyError` for missing keys. Raise a
@@ -146,7 +146,7 @@ subtypes but not for instances of :class:`frozenset` or its subtypes.
instance of :class:`set` or its subtype.
-.. cfunction:: PyObject* PySet_Pop(PyObject *set)
+.. c:function:: PyObject* PySet_Pop(PyObject *set)
Return a new reference to an arbitrary object in the *set*, and removes the
object from the *set*. Return *NULL* on failure. Raise :exc:`KeyError` if the
@@ -154,6 +154,6 @@ subtypes but not for instances of :class:`frozenset` or its subtypes.
:class:`set` or its subtype.
-.. cfunction:: int PySet_Clear(PyObject *set)
+.. c:function:: int PySet_Clear(PyObject *set)
Empty an existing set of all elements.
diff --git a/Doc/c-api/slice.rst b/Doc/c-api/slice.rst
index f33cd533c2..e157df216c 100644
--- a/Doc/c-api/slice.rst
+++ b/Doc/c-api/slice.rst
@@ -6,18 +6,18 @@ Slice Objects
-------------
-.. cvar:: PyTypeObject PySlice_Type
+.. c:var:: PyTypeObject PySlice_Type
The type object for slice objects. This is the same as :class:`slice` in the
Python layer.
-.. cfunction:: int PySlice_Check(PyObject *ob)
+.. c:function:: int PySlice_Check(PyObject *ob)
Return true if *ob* is a slice object; *ob* must not be *NULL*.
-.. cfunction:: PyObject* PySlice_New(PyObject *start, PyObject *stop, PyObject *step)
+.. c:function:: PyObject* PySlice_New(PyObject *start, PyObject *stop, PyObject *step)
Return a new slice object with the given values. The *start*, *stop*, and
*step* parameters are used as the values of the slice object attributes of
@@ -26,7 +26,7 @@ Slice Objects
the new object could not be allocated.
-.. cfunction:: int PySlice_GetIndices(PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
+.. c:function:: int PySlice_GetIndices(PyObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
Retrieve the start, stop and step indices from the slice object *slice*,
assuming a sequence of length *length*. Treats indices greater than
@@ -38,13 +38,21 @@ Slice Objects
You probably do not want to use this function.
+ .. versionchanged:: 3.2
+ The parameter type for the *slice* parameter was ``PySliceObject*``
+ before.
-.. cfunction:: int PySlice_GetIndicesEx(PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)
- Usable replacement for :cfunc:`PySlice_GetIndices`. Retrieve the start,
+.. c:function:: int PySlice_GetIndicesEx(PyObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)
+
+ Usable replacement for :c:func:`PySlice_GetIndices`. Retrieve the start,
stop, and step indices from the slice object *slice* assuming a sequence of
length *length*, and store the length of the slice in *slicelength*. Out
of bounds indices are clipped in a manner consistent with the handling of
normal slices.
Returns 0 on success and -1 on error with exception set.
+
+ .. versionchanged:: 3.2
+ The parameter type for the *slice* parameter was ``PySliceObject*``
+ before.
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index dbacedf041..bb741fb099 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -11,12 +11,12 @@ are used.
All Python objects ultimately share a small number of fields at the beginning
of the object's representation in memory. These are represented by the
-:ctype:`PyObject` and :ctype:`PyVarObject` types, which are defined, in turn,
+:c:type:`PyObject` and :c:type:`PyVarObject` types, which are defined, in turn,
by the expansions of some macros also used, whether directly or indirectly, in
the definition of all other Python objects.
-.. ctype:: PyObject
+.. c:type:: PyObject
All object types are extensions of this type. This is a type which
contains the information Python needs to treat a pointer to an object as an
@@ -26,88 +26,88 @@ the definition of all other Python objects.
macro.
-.. ctype:: PyVarObject
+.. c:type:: PyVarObject
- This is an extension of :ctype:`PyObject` that adds the :attr:`ob_size`
+ This is an extension of :c:type:`PyObject` that adds the :attr:`ob_size`
field. This is only used for objects that have some notion of *length*.
This type does not often appear in the Python/C API. It corresponds to the
fields defined by the expansion of the ``PyObject_VAR_HEAD`` macro.
-These macros are used in the definition of :ctype:`PyObject` and
-:ctype:`PyVarObject`:
+These macros are used in the definition of :c:type:`PyObject` and
+:c:type:`PyVarObject`:
.. XXX need to document PEP 3123 changes here
-.. cmacro:: PyObject_HEAD
+.. c:macro:: PyObject_HEAD
This is a macro which expands to the declarations of the fields of the
- :ctype:`PyObject` type; it is used when declaring new types which represent
+ :c:type:`PyObject` type; it is used when declaring new types which represent
objects without a varying length. The specific fields it expands to depend
- on the definition of :cmacro:`Py_TRACE_REFS`. By default, that macro is
- not defined, and :cmacro:`PyObject_HEAD` expands to::
+ on the definition of :c:macro:`Py_TRACE_REFS`. By default, that macro is
+ not defined, and :c:macro:`PyObject_HEAD` expands to::
Py_ssize_t ob_refcnt;
PyTypeObject *ob_type;
- When :cmacro:`Py_TRACE_REFS` is defined, it expands to::
+ When :c:macro:`Py_TRACE_REFS` is defined, it expands to::
PyObject *_ob_next, *_ob_prev;
Py_ssize_t ob_refcnt;
PyTypeObject *ob_type;
-.. cmacro:: PyObject_VAR_HEAD
+.. c:macro:: PyObject_VAR_HEAD
This is a macro which expands to the declarations of the fields of the
- :ctype:`PyVarObject` type; it is used when declaring new types which
+ :c:type:`PyVarObject` type; it is used when declaring new types which
represent objects with a length that varies from instance to instance.
This macro always expands to::
PyObject_HEAD
Py_ssize_t ob_size;
- Note that :cmacro:`PyObject_HEAD` is part of the expansion, and that its own
- expansion varies depending on the definition of :cmacro:`Py_TRACE_REFS`.
+ Note that :c:macro:`PyObject_HEAD` is part of the expansion, and that its own
+ expansion varies depending on the definition of :c:macro:`Py_TRACE_REFS`.
-.. cmacro:: PyObject_HEAD_INIT(type)
+.. c:macro:: PyObject_HEAD_INIT(type)
This is a macro which expands to initialization values for a new
- :ctype:`PyObject` type. This macro expands to::
+ :c:type:`PyObject` type. This macro expands to::
_PyObject_EXTRA_INIT
1, type,
-.. cmacro:: PyVarObject_HEAD_INIT(type, size)
+.. c:macro:: PyVarObject_HEAD_INIT(type, size)
This is a macro which expands to initialization values for a new
- :ctype:`PyVarObject` type, including the :attr:`ob_size` field.
+ :c:type:`PyVarObject` type, including the :attr:`ob_size` field.
This macro expands to::
_PyObject_EXTRA_INIT
1, type, size,
-.. ctype:: PyCFunction
+.. c:type:: PyCFunction
Type of the functions used to implement most Python callables in C.
- Functions of this type take two :ctype:`PyObject\*` parameters and return
+ Functions of this type take two :c:type:`PyObject\*` parameters and return
one such value. If the return value is *NULL*, an exception shall have
been set. If not *NULL*, the return value is interpreted as the return
value of the function as exposed in Python. The function must return a new
reference.
-.. ctype:: PyCFunctionWithKeywords
+.. c:type:: PyCFunctionWithKeywords
Type of the functions used to implement Python callables in C that take
- keyword arguments: they take three :ctype:`PyObject\*` parameters and return
- one such value. See :ctype:`PyCFunction` above for the meaning of the return
+ keyword arguments: they take three :c:type:`PyObject\*` parameters and return
+ one such value. See :c:type:`PyCFunction` above for the meaning of the return
value.
-.. ctype:: PyMethodDef
+.. c:type:: PyMethodDef
Structure used to describe a method of an extension type. This structure has
four fields:
@@ -128,10 +128,10 @@ These macros are used in the definition of :ctype:`PyObject` and
+------------------+-------------+-------------------------------+
The :attr:`ml_meth` is a C function pointer. The functions may be of different
-types, but they always return :ctype:`PyObject\*`. If the function is not of
-the :ctype:`PyCFunction`, the compiler will require a cast in the method table.
-Even though :ctype:`PyCFunction` defines the first parameter as
-:ctype:`PyObject\*`, it is common that the method implementation uses a the
+types, but they always return :c:type:`PyObject\*`. If the function is not of
+the :c:type:`PyCFunction`, the compiler will require a cast in the method table.
+Even though :c:type:`PyCFunction` defines the first parameter as
+:c:type:`PyObject\*`, it is common that the method implementation uses a the
specific C type of the *self* object.
The :attr:`ml_flags` field is a bitfield which can include the following flags.
@@ -145,27 +145,27 @@ convention flags can be combined with a binding flag.
.. data:: METH_VARARGS
This is the typical calling convention, where the methods have the type
- :ctype:`PyCFunction`. The function expects two :ctype:`PyObject\*` values.
+ :c:type:`PyCFunction`. The function expects two :c:type:`PyObject\*` values.
The first one is the *self* object for methods; for module functions, it is
the module object. The second parameter (often called *args*) is a tuple
object representing all arguments. This parameter is typically processed
- using :cfunc:`PyArg_ParseTuple` or :cfunc:`PyArg_UnpackTuple`.
+ using :c:func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`.
.. data:: METH_KEYWORDS
- Methods with these flags must be of type :ctype:`PyCFunctionWithKeywords`.
+ Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`.
The function expects three parameters: *self*, *args*, and a dictionary of
all the keyword arguments. The flag is typically combined with
:const:`METH_VARARGS`, and the parameters are typically processed using
- :cfunc:`PyArg_ParseTupleAndKeywords`.
+ :c:func:`PyArg_ParseTupleAndKeywords`.
.. data:: METH_NOARGS
Methods without parameters don't need to check whether arguments are given if
they are listed with the :const:`METH_NOARGS` flag. They need to be of type
- :ctype:`PyCFunction`. The first parameter is typically named *self* and will
+ :c:type:`PyCFunction`. The first parameter is typically named *self* and will
hold a reference to the module or object instance. In all cases the second
parameter will be *NULL*.
@@ -173,9 +173,9 @@ convention flags can be combined with a binding flag.
.. data:: METH_O
Methods with a single object argument can be listed with the :const:`METH_O`
- flag, instead of invoking :cfunc:`PyArg_ParseTuple` with a ``"O"`` argument.
- They have the type :ctype:`PyCFunction`, with the *self* parameter, and a
- :ctype:`PyObject\*` parameter representing the single argument.
+ flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``"O"`` argument.
+ They have the type :c:type:`PyCFunction`, with the *self* parameter, and a
+ :c:type:`PyObject\*` parameter representing the single argument.
These two constants are not used to indicate the calling convention but the
@@ -219,7 +219,7 @@ definition with the same method name.
than wrapper object calls.
-.. ctype:: PyMemberDef
+.. c:type:: PyMemberDef
Structure which describes an attribute of a type which corresponds to a C
struct member. Its fields are:
@@ -271,14 +271,14 @@ definition with the same method name.
T_PYSSIZET Py_ssize_t
=============== ==================
- :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that
- :cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and
- :cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`. Try to use
- :cmacro:`T_OBJECT_EX` over :cmacro:`T_OBJECT` because :cmacro:`T_OBJECT_EX`
+ :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` differ in that
+ :c:macro:`T_OBJECT` returns ``None`` if the member is *NULL* and
+ :c:macro:`T_OBJECT_EX` raises an :exc:`AttributeError`. Try to use
+ :c:macro:`T_OBJECT_EX` over :c:macro:`T_OBJECT` because :c:macro:`T_OBJECT_EX`
handles use of the :keyword:`del` statement on that attribute more correctly
- than :cmacro:`T_OBJECT`.
+ than :c:macro:`T_OBJECT`.
- :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for
- read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies
- :cmacro:`READONLY`. Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX`
+ :attr:`flags` can be 0 for write and read access or :c:macro:`READONLY` for
+ read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies
+ :c:macro:`READONLY`. Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX`
members can be deleted. (They are set to *NULL*).
diff --git a/Doc/c-api/sys.rst b/Doc/c-api/sys.rst
index adadfe55da..252bd1ad06 100644
--- a/Doc/c-api/sys.rst
+++ b/Doc/c-api/sys.rst
@@ -6,16 +6,16 @@ Operating System Utilities
==========================
-.. cfunction:: int Py_FdIsInteractive(FILE *fp, const char *filename)
+.. c:function:: int Py_FdIsInteractive(FILE *fp, const char *filename)
Return true (nonzero) if the standard I/O file *fp* with name *filename* is
deemed interactive. This is the case for files for which ``isatty(fileno(fp))``
- is true. If the global flag :cdata:`Py_InteractiveFlag` is true, this function
+ is true. If the global flag :c:data:`Py_InteractiveFlag` is true, this function
also returns true if the *filename* pointer is *NULL* or if the name is equal to
one of the strings ``'<stdin>'`` or ``'???'``.
-.. cfunction:: void PyOS_AfterFork()
+.. c:function:: void PyOS_AfterFork()
Function to update some internal state after a process fork; this should be
called in the new process if the Python interpreter will continue to be used.
@@ -23,7 +23,7 @@ Operating System Utilities
to be called.
-.. cfunction:: int PyOS_CheckStack()
+.. c:function:: int PyOS_CheckStack()
Return true when the interpreter runs out of stack space. This is a reliable
check, but is only available when :const:`USE_STACKCHECK` is defined (currently
@@ -32,20 +32,20 @@ Operating System Utilities
own code.
-.. cfunction:: PyOS_sighandler_t PyOS_getsig(int i)
+.. c:function:: PyOS_sighandler_t PyOS_getsig(int i)
Return the current signal handler for signal *i*. This is a thin wrapper around
- either :cfunc:`sigaction` or :cfunc:`signal`. Do not call those functions
- directly! :ctype:`PyOS_sighandler_t` is a typedef alias for :ctype:`void
+ either :c:func:`sigaction` or :c:func:`signal`. Do not call those functions
+ directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:type:`void
(\*)(int)`.
-.. cfunction:: PyOS_sighandler_t PyOS_setsig(int i, PyOS_sighandler_t h)
+.. c:function:: PyOS_sighandler_t PyOS_setsig(int i, PyOS_sighandler_t h)
Set the signal handler for signal *i* to be *h*; return the old signal handler.
- This is a thin wrapper around either :cfunc:`sigaction` or :cfunc:`signal`. Do
- not call those functions directly! :ctype:`PyOS_sighandler_t` is a typedef
- alias for :ctype:`void (\*)(int)`.
+ This is a thin wrapper around either :c:func:`sigaction` or :c:func:`signal`. Do
+ not call those functions directly! :c:type:`PyOS_sighandler_t` is a typedef
+ alias for :c:type:`void (\*)(int)`.
.. _systemfunctions:
@@ -56,38 +56,42 @@ These are utility functions that make functionality from the :mod:`sys` module
accessible to C code. They all work with the current interpreter thread's
:mod:`sys` module's dict, which is contained in the internal thread state structure.
-.. cfunction:: PyObject *PySys_GetObject(char *name)
+.. c:function:: PyObject *PySys_GetObject(char *name)
Return the object *name* from the :mod:`sys` module or *NULL* if it does
not exist, without setting an exception.
-.. cfunction:: FILE *PySys_GetFile(char *name, FILE *def)
+.. c:function:: FILE *PySys_GetFile(char *name, FILE *def)
- Return the :ctype:`FILE*` associated with the object *name* in the
+ Return the :c:type:`FILE*` associated with the object *name* in the
:mod:`sys` module, or *def* if *name* is not in the module or is not associated
- with a :ctype:`FILE*`.
+ with a :c:type:`FILE*`.
-.. cfunction:: int PySys_SetObject(char *name, PyObject *v)
+.. c:function:: int PySys_SetObject(char *name, PyObject *v)
Set *name* in the :mod:`sys` module to *v* unless *v* is *NULL*, in which
case *name* is deleted from the sys module. Returns ``0`` on success, ``-1``
on error.
-.. cfunction:: void PySys_ResetWarnOptions()
+.. c:function:: void PySys_ResetWarnOptions()
Reset :data:`sys.warnoptions` to an empty list.
-.. cfunction:: void PySys_AddWarnOption(wchar_t *s)
+.. c:function:: void PySys_AddWarnOption(wchar_t *s)
Append *s* to :data:`sys.warnoptions`.
-.. cfunction:: void PySys_SetPath(wchar_t *path)
+.. c:function:: void PySys_AddWarnOptionUnicode(PyObject *unicode)
+
+ Append *unicode* to :data:`sys.warnoptions`.
+
+.. c:function:: void PySys_SetPath(wchar_t *path)
Set :data:`sys.path` to a list object of paths found in *path* which should
be a list of paths separated with the platform's search path delimiter
(``:`` on Unix, ``;`` on Windows).
-.. cfunction:: void PySys_WriteStdout(const char *format, ...)
+.. c:function:: void PySys_WriteStdout(const char *format, ...)
Write the output string described by *format* to :data:`sys.stdout`. No
exceptions are raised, even if truncation occurs (see below).
@@ -103,9 +107,40 @@ accessible to C code. They all work with the current interpreter thread's
If a problem occurs, or :data:`sys.stdout` is unset, the formatted message
is written to the real (C level) *stdout*.
-.. cfunction:: void PySys_WriteStderr(const char *format, ...)
+.. c:function:: void PySys_WriteStderr(const char *format, ...)
+
+ As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr*
+ instead.
+
+.. c:function:: void PySys_FormatStdout(const char *format, ...)
+
+ Function similar to PySys_WriteStdout() but format the message using
+ :c:func:`PyUnicode_FromFormatV` and don't truncate the message to an
+ arbitrary length.
+
+ .. versionadded:: 3.2
+
+.. c:function:: void PySys_FormatStderr(const char *format, ...)
+
+ As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr*
+ instead.
+
+ .. versionadded:: 3.2
+
+.. c:function:: void PySys_AddXOption(const wchar_t *s)
+
+ Parse *s* as a set of :option:`-X` options and add them to the current
+ options mapping as returned by :c:func:`PySys_GetXOptions`.
+
+ .. versionadded:: 3.2
+
+.. c:function:: PyObject *PySys_GetXOptions()
+
+ Return the current dictionary of :option:`-X` options, similarly to
+ :data:`sys._xoptions`. On error, *NULL* is returned and an exception is
+ set.
- As above, but write to :data:`sys.stderr` or *stderr* instead.
+ .. versionadded:: 3.2
.. _processcontrol:
@@ -114,7 +149,7 @@ Process Control
===============
-.. cfunction:: void Py_FatalError(const char *message)
+.. c:function:: void Py_FatalError(const char *message)
.. index:: single: abort()
@@ -122,30 +157,30 @@ Process Control
This function should only be invoked when a condition is detected that would
make it dangerous to continue using the Python interpreter; e.g., when the
object administration appears to be corrupted. On Unix, the standard C library
- function :cfunc:`abort` is called which will attempt to produce a :file:`core`
+ function :c:func:`abort` is called which will attempt to produce a :file:`core`
file.
-.. cfunction:: void Py_Exit(int status)
+.. c:function:: void Py_Exit(int status)
.. index::
single: Py_Finalize()
single: exit()
- Exit the current process. This calls :cfunc:`Py_Finalize` and then calls the
+ Exit the current process. This calls :c:func:`Py_Finalize` and then calls the
standard C library function ``exit(status)``.
-.. cfunction:: int Py_AtExit(void (*func) ())
+.. c:function:: int Py_AtExit(void (*func) ())
.. index::
single: Py_Finalize()
single: cleanup functions
- Register a cleanup function to be called by :cfunc:`Py_Finalize`. The cleanup
+ Register a cleanup function to be called by :c:func:`Py_Finalize`. The cleanup
function will be called with no arguments and should return no value. At most
32 cleanup functions can be registered. When the registration is successful,
- :cfunc:`Py_AtExit` returns ``0``; on failure, it returns ``-1``. The cleanup
+ :c:func:`Py_AtExit` returns ``0``; on failure, it returns ``-1``. The cleanup
function registered last is called first. Each cleanup function will be called
at most once. Since Python's internal finalization will have completed before
the cleanup function, no Python APIs should be called by *func*.
diff --git a/Doc/c-api/tuple.rst b/Doc/c-api/tuple.rst
index 612acc754e..3cbfe5bcaa 100644
--- a/Doc/c-api/tuple.rst
+++ b/Doc/c-api/tuple.rst
@@ -8,70 +8,70 @@ Tuple Objects
.. index:: object: tuple
-.. ctype:: PyTupleObject
+.. c:type:: PyTupleObject
- This subtype of :ctype:`PyObject` represents a Python tuple object.
+ This subtype of :c:type:`PyObject` represents a Python tuple object.
-.. cvar:: PyTypeObject PyTuple_Type
+.. c:var:: PyTypeObject PyTuple_Type
- This instance of :ctype:`PyTypeObject` represents the Python tuple type; it
+ This instance of :c:type:`PyTypeObject` represents the Python tuple type; it
is the same object as :class:`tuple` in the Python layer.
-.. cfunction:: int PyTuple_Check(PyObject *p)
+.. c:function:: int PyTuple_Check(PyObject *p)
Return true if *p* is a tuple object or an instance of a subtype of the tuple
type.
-.. cfunction:: int PyTuple_CheckExact(PyObject *p)
+.. c:function:: int PyTuple_CheckExact(PyObject *p)
Return true if *p* is a tuple object, but not an instance of a subtype of the
tuple type.
-.. cfunction:: PyObject* PyTuple_New(Py_ssize_t len)
+.. c:function:: PyObject* PyTuple_New(Py_ssize_t len)
Return a new tuple object of size *len*, or *NULL* on failure.
-.. cfunction:: PyObject* PyTuple_Pack(Py_ssize_t n, ...)
+.. c:function:: PyObject* PyTuple_Pack(Py_ssize_t n, ...)
Return a new tuple object of size *n*, or *NULL* on failure. The tuple values
are initialized to the subsequent *n* C arguments pointing to Python objects.
``PyTuple_Pack(2, a, b)`` is equivalent to ``Py_BuildValue("(OO)", a, b)``.
-.. cfunction:: Py_ssize_t PyTuple_Size(PyObject *p)
+.. c:function:: Py_ssize_t PyTuple_Size(PyObject *p)
Take a pointer to a tuple object, and return the size of that tuple.
-.. cfunction:: Py_ssize_t PyTuple_GET_SIZE(PyObject *p)
+.. c:function:: Py_ssize_t PyTuple_GET_SIZE(PyObject *p)
Return the size of the tuple *p*, which must be non-*NULL* and point to a tuple;
no error checking is performed.
-.. cfunction:: PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos)
+.. c:function:: PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos)
Return the object at position *pos* in the tuple pointed to by *p*. If *pos* is
out of bounds, return *NULL* and sets an :exc:`IndexError` exception.
-.. cfunction:: PyObject* PyTuple_GET_ITEM(PyObject *p, Py_ssize_t pos)
+.. c:function:: PyObject* PyTuple_GET_ITEM(PyObject *p, Py_ssize_t pos)
- Like :cfunc:`PyTuple_GetItem`, but does no checking of its arguments.
+ Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments.
-.. cfunction:: PyObject* PyTuple_GetSlice(PyObject *p, Py_ssize_t low, Py_ssize_t high)
+.. c:function:: PyObject* PyTuple_GetSlice(PyObject *p, Py_ssize_t low, Py_ssize_t high)
Take a slice of the tuple pointed to by *p* from *low* to *high* and return it
as a new tuple.
-.. cfunction:: int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o)
+.. c:function:: int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o)
Insert a reference to object *o* at position *pos* of the tuple pointed to by
*p*. Return ``0`` on success.
@@ -81,9 +81,9 @@ Tuple Objects
This function "steals" a reference to *o*.
-.. cfunction:: void PyTuple_SET_ITEM(PyObject *p, Py_ssize_t pos, PyObject *o)
+.. c:function:: void PyTuple_SET_ITEM(PyObject *p, Py_ssize_t pos, PyObject *o)
- Like :cfunc:`PyTuple_SetItem`, but does no error checking, and should *only* be
+ Like :c:func:`PyTuple_SetItem`, but does no error checking, and should *only* be
used to fill in brand new tuples.
.. note::
@@ -91,7 +91,7 @@ Tuple Objects
This function "steals" a reference to *o*.
-.. cfunction:: int _PyTuple_Resize(PyObject **p, Py_ssize_t newsize)
+.. c:function:: int _PyTuple_Resize(PyObject **p, Py_ssize_t newsize)
Can be used to resize a tuple. *newsize* will be the new length of the tuple.
Because tuples are *supposed* to be immutable, this should only be used if there
@@ -105,6 +105,6 @@ Tuple Objects
raises :exc:`MemoryError` or :exc:`SystemError`.
-.. cfunction:: int PyTuple_ClearFreeList()
+.. c:function:: int PyTuple_ClearFreeList()
Clear the free list. Return the total number of freed items.
diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst
index d2a567656e..b3386eaa8b 100644
--- a/Doc/c-api/type.rst
+++ b/Doc/c-api/type.rst
@@ -8,69 +8,77 @@ Type Objects
.. index:: object: type
-.. ctype:: PyTypeObject
+.. c:type:: PyTypeObject
The C structure of the objects used to describe built-in types.
-.. cvar:: PyObject* PyType_Type
+.. c:var:: PyObject* PyType_Type
This is the type object for type objects; it is the same object as
:class:`type` in the Python layer.
-.. cfunction:: int PyType_Check(PyObject *o)
+.. c:function:: int PyType_Check(PyObject *o)
Return true if the object *o* is a type object, including instances of types
derived from the standard type object. Return false in all other cases.
-.. cfunction:: int PyType_CheckExact(PyObject *o)
+.. c:function:: int PyType_CheckExact(PyObject *o)
Return true if the object *o* is a type object, but not a subtype of the
standard type object. Return false in all other cases.
-.. cfunction:: unsigned int PyType_ClearCache()
+.. c:function:: unsigned int PyType_ClearCache()
Clear the internal lookup cache. Return the current version tag.
+.. c:function:: long PyType_GetFlags(PyTypeObject* type)
-.. cfunction:: void PyType_Modified(PyTypeObject *type)
+ Return the :attr:`tp_flags` member of *type*. This function is primarily
+ meant for use with `Py_LIMITED_API`; the individual flag bits are
+ guaranteed to be stable across Python releases, but access to
+ :attr:`tp_flags` itself is not part of the limited API.
+
+ .. versionadded:: 3.2
+
+.. c:function:: void PyType_Modified(PyTypeObject *type)
Invalidate the internal lookup cache for the type and all of its
subtypes. This function must be called after any manual
modification of the attributes or base classes of the type.
-.. cfunction:: int PyType_HasFeature(PyObject *o, int feature)
+.. c:function:: int PyType_HasFeature(PyObject *o, int feature)
Return true if the type object *o* sets the feature *feature*. Type features
are denoted by single bit flags.
-.. cfunction:: int PyType_IS_GC(PyObject *o)
+.. c:function:: int PyType_IS_GC(PyObject *o)
Return true if the type object includes support for the cycle detector; this
tests the type flag :const:`Py_TPFLAGS_HAVE_GC`.
-.. cfunction:: int PyType_IsSubtype(PyTypeObject *a, PyTypeObject *b)
+.. c:function:: int PyType_IsSubtype(PyTypeObject *a, PyTypeObject *b)
Return true if *a* is a subtype of *b*.
-.. cfunction:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
+.. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
XXX: Document.
-.. cfunction:: PyObject* PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
+.. c:function:: PyObject* PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
XXX: Document.
-.. cfunction:: int PyType_Ready(PyTypeObject *type)
+.. c:function:: int PyType_Ready(PyTypeObject *type)
Finalize a type object. This should be called on all type objects to finish
their initialization. This function is responsible for adding inherited slots
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 7aa827af88..4a6335c869 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -6,9 +6,9 @@ Type Objects
============
Perhaps one of the most important structures of the Python object system is the
-structure that defines a new type: the :ctype:`PyTypeObject` structure. Type
-objects can be handled using any of the :cfunc:`PyObject_\*` or
-:cfunc:`PyType_\*` functions, but do not offer much that's interesting to most
+structure that defines a new type: the :c:type:`PyTypeObject` structure. Type
+objects can be handled using any of the :c:func:`PyObject_\*` or
+:c:func:`PyType_\*` functions, but do not offer much that's interesting to most
Python applications. These objects are fundamental to how objects behave, so
they are very important to the interpreter itself and to any extension module
that implements new types.
@@ -25,21 +25,21 @@ intintargfunc, intobjargproc, intintobjargproc, objobjargproc, destructor,
freefunc, printfunc, getattrfunc, getattrofunc, setattrfunc, setattrofunc,
reprfunc, hashfunc
-The structure definition for :ctype:`PyTypeObject` can be found in
+The structure definition for :c:type:`PyTypeObject` can be found in
:file:`Include/object.h`. For convenience of reference, this repeats the
definition found there:
.. literalinclude:: ../includes/typestruct.h
-The type object structure extends the :ctype:`PyVarObject` structure. The
+The type object structure extends the :c:type:`PyVarObject` structure. The
:attr:`ob_size` field is used for dynamic types (created by :func:`type_new`,
-usually called from a class statement). Note that :cdata:`PyType_Type` (the
+usually called from a class statement). Note that :c:data:`PyType_Type` (the
metatype) initializes :attr:`tp_itemsize`, which means that its instances (i.e.
type objects) *must* have the :attr:`ob_size` field.
-.. cmember:: PyObject* PyObject._ob_next
+.. c:member:: PyObject* PyObject._ob_next
PyObject* PyObject._ob_prev
These fields are only present when the macro ``Py_TRACE_REFS`` is defined.
@@ -54,7 +54,7 @@ type objects) *must* have the :attr:`ob_size` field.
These fields are not inherited by subtypes.
-.. cmember:: Py_ssize_t PyObject.ob_refcnt
+.. c:member:: Py_ssize_t PyObject.ob_refcnt
This is the type object's reference count, initialized to ``1`` by the
``PyObject_HEAD_INIT`` macro. Note that for statically allocated type objects,
@@ -65,7 +65,7 @@ type objects) *must* have the :attr:`ob_size` field.
This field is not inherited by subtypes.
-.. cmember:: PyTypeObject* PyObject.ob_type
+.. c:member:: PyTypeObject* PyObject.ob_type
This is the type's type, in other words its metatype. It is initialized by the
argument to the ``PyObject_HEAD_INIT`` macro, and its value should normally be
@@ -79,14 +79,14 @@ type objects) *must* have the :attr:`ob_size` field.
Foo_Type.ob_type = &PyType_Type;
This should be done before any instances of the type are created.
- :cfunc:`PyType_Ready` checks if :attr:`ob_type` is *NULL*, and if so,
+ :c:func:`PyType_Ready` checks if :attr:`ob_type` is *NULL*, and if so,
initializes it to the :attr:`ob_type` field of the base class.
- :cfunc:`PyType_Ready` will not change this field if it is non-zero.
+ :c:func:`PyType_Ready` will not change this field if it is non-zero.
This field is inherited by subtypes.
-.. cmember:: Py_ssize_t PyVarObject.ob_size
+.. c:member:: Py_ssize_t PyVarObject.ob_size
For statically allocated type objects, this should be initialized to zero. For
dynamically allocated type objects, this field has a special internal meaning.
@@ -94,7 +94,7 @@ type objects) *must* have the :attr:`ob_size` field.
This field is not inherited by subtypes.
-.. cmember:: char* PyTypeObject.tp_name
+.. c:member:: char* PyTypeObject.tp_name
Pointer to a NUL-terminated string containing the name of the type. For types
that are accessible as module globals, the string should be the full module
@@ -121,7 +121,7 @@ type objects) *must* have the :attr:`ob_size` field.
This field is not inherited by subtypes.
-.. cmember:: Py_ssize_t PyTypeObject.tp_basicsize
+.. c:member:: Py_ssize_t PyTypeObject.tp_basicsize
Py_ssize_t PyTypeObject.tp_itemsize
These fields allow calculating the size in bytes of instances of the type.
@@ -143,7 +143,7 @@ type objects) *must* have the :attr:`ob_size` field.
field).
The basic size includes the fields in the instance declared by the macro
- :cmacro:`PyObject_HEAD` or :cmacro:`PyObject_VAR_HEAD` (whichever is used to
+ :c:macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD` (whichever is used to
declare the instance struct) and this in turn includes the :attr:`_ob_prev` and
:attr:`_ob_next` fields if they are present. This means that the only correct
way to get an initializer for the :attr:`tp_basicsize` is to use the
@@ -163,14 +163,14 @@ type objects) *must* have the :attr:`ob_size` field.
alignment requirement for ``double``).
-.. cmember:: destructor PyTypeObject.tp_dealloc
+.. c:member:: destructor PyTypeObject.tp_dealloc
A pointer to the instance destructor function. This function must be defined
unless the type guarantees that its instances will never be deallocated (as is
the case for the singletons ``None`` and ``Ellipsis``).
- The destructor function is called by the :cfunc:`Py_DECREF` and
- :cfunc:`Py_XDECREF` macros when the new reference count is zero. At this point,
+ The destructor function is called by the :c:func:`Py_DECREF` and
+ :c:func:`Py_XDECREF` macros when the new reference count is zero. At this point,
the instance is still in existence, but there are no references to it. The
destructor function should free all references which the instance owns, free all
memory buffers owned by the instance (using the freeing function corresponding
@@ -179,15 +179,15 @@ type objects) *must* have the :attr:`ob_size` field.
subtypable (doesn't have the :const:`Py_TPFLAGS_BASETYPE` flag bit set), it is
permissible to call the object deallocator directly instead of via
:attr:`tp_free`. The object deallocator should be the one used to allocate the
- instance; this is normally :cfunc:`PyObject_Del` if the instance was allocated
- using :cfunc:`PyObject_New` or :cfunc:`PyObject_VarNew`, or
- :cfunc:`PyObject_GC_Del` if the instance was allocated using
- :cfunc:`PyObject_GC_New` or :cfunc:`PyObject_GC_NewVar`.
+ instance; this is normally :c:func:`PyObject_Del` if the instance was allocated
+ using :c:func:`PyObject_New` or :c:func:`PyObject_VarNew`, or
+ :c:func:`PyObject_GC_Del` if the instance was allocated using
+ :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`.
This field is inherited by subtypes.
-.. cmember:: printfunc PyTypeObject.tp_print
+.. c:member:: printfunc PyTypeObject.tp_print
An optional pointer to the instance print function.
@@ -198,7 +198,7 @@ type objects) *must* have the :attr:`ob_size` field.
*NULL*. A type should never implement :attr:`tp_print` in a way that produces
different output than :attr:`tp_repr` or :attr:`tp_str` would.
- The print function is called with the same signature as :cfunc:`PyObject_Print`:
+ The print function is called with the same signature as :c:func:`PyObject_Print`:
``int tp_print(PyObject *self, FILE *file, int flags)``. The *self* argument is
the instance to be printed. The *file* argument is the stdio file to which it
is to be printed. The *flags* argument is composed of flag bits. The only flag
@@ -216,47 +216,47 @@ type objects) *must* have the :attr:`ob_size` field.
This field is inherited by subtypes.
-.. cmember:: getattrfunc PyTypeObject.tp_getattr
+.. c:member:: getattrfunc PyTypeObject.tp_getattr
An optional pointer to the get-attribute-string function.
This field is deprecated. When it is defined, it should point to a function
that acts the same as the :attr:`tp_getattro` function, but taking a C string
instead of a Python string object to give the attribute name. The signature is
- the same as for :cfunc:`PyObject_GetAttrString`.
+ the same as for :c:func:`PyObject_GetAttrString`.
This field is inherited by subtypes together with :attr:`tp_getattro`: a subtype
inherits both :attr:`tp_getattr` and :attr:`tp_getattro` from its base type when
the subtype's :attr:`tp_getattr` and :attr:`tp_getattro` are both *NULL*.
-.. cmember:: setattrfunc PyTypeObject.tp_setattr
+.. c:member:: setattrfunc PyTypeObject.tp_setattr
An optional pointer to the set-attribute-string function.
This field is deprecated. When it is defined, it should point to a function
that acts the same as the :attr:`tp_setattro` function, but taking a C string
instead of a Python string object to give the attribute name. The signature is
- the same as for :cfunc:`PyObject_SetAttrString`.
+ the same as for :c:func:`PyObject_SetAttrString`.
This field is inherited by subtypes together with :attr:`tp_setattro`: a subtype
inherits both :attr:`tp_setattr` and :attr:`tp_setattro` from its base type when
the subtype's :attr:`tp_setattr` and :attr:`tp_setattro` are both *NULL*.
-.. cmember:: void* PyTypeObject.tp_reserved
+.. c:member:: void* PyTypeObject.tp_reserved
Reserved slot, formerly known as tp_compare.
-.. cmember:: reprfunc PyTypeObject.tp_repr
+.. c:member:: reprfunc PyTypeObject.tp_repr
.. index:: builtin: repr
An optional pointer to a function that implements the built-in function
:func:`repr`.
- The signature is the same as for :cfunc:`PyObject_Repr`; it must return a string
+ The signature is the same as for :c:func:`PyObject_Repr`; it must return a string
or a Unicode object. Ideally, this function should return a string that, when
passed to :func:`eval`, given a suitable environment, returns an object with the
same value. If this is not feasible, it should return a string starting with
@@ -269,7 +269,7 @@ type objects) *must* have the :attr:`ob_size` field.
This field is inherited by subtypes.
-.. cmember:: PyNumberMethods* tp_as_number
+.. c:member:: PyNumberMethods* tp_as_number
Pointer to an additional structure that contains fields relevant only to
objects which implement the number protocol. These fields are documented in
@@ -279,7 +279,7 @@ type objects) *must* have the :attr:`ob_size` field.
inherited individually.
-.. cmember:: PySequenceMethods* tp_as_sequence
+.. c:member:: PySequenceMethods* tp_as_sequence
Pointer to an additional structure that contains fields relevant only to
objects which implement the sequence protocol. These fields are documented
@@ -289,7 +289,7 @@ type objects) *must* have the :attr:`ob_size` field.
are inherited individually.
-.. cmember:: PyMappingMethods* tp_as_mapping
+.. c:member:: PyMappingMethods* tp_as_mapping
Pointer to an additional structure that contains fields relevant only to
objects which implement the mapping protocol. These fields are documented in
@@ -299,25 +299,25 @@ type objects) *must* have the :attr:`ob_size` field.
are inherited individually.
-.. cmember:: hashfunc PyTypeObject.tp_hash
+.. c:member:: hashfunc PyTypeObject.tp_hash
.. index:: builtin: hash
An optional pointer to a function that implements the built-in function
:func:`hash`.
- The signature is the same as for :cfunc:`PyObject_Hash`; it must return a C
- long. The value ``-1`` should not be returned as a normal return value; when an
- error occurs during the computation of the hash value, the function should set
- an exception and return ``-1``.
+ The signature is the same as for :c:func:`PyObject_Hash`; it must return a
+ value of the type Py_hash_t. The value ``-1`` should not be returned as a
+ normal return value; when an error occurs during the computation of the hash
+ value, the function should set an exception and return ``-1``.
- This field can be set explicitly to :cfunc:`PyObject_HashNotImplemented` to
+ This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to
block inheritance of the hash method from a parent type. This is interpreted
as the equivalent of ``__hash__ = None`` at the Python level, causing
``isinstance(o, collections.Hashable)`` to correctly return ``False``. Note
that the converse is also true - setting ``__hash__ = None`` on a class at
the Python level will result in the ``tp_hash`` slot being set to
- :cfunc:`PyObject_HashNotImplemented`.
+ :c:func:`PyObject_HashNotImplemented`.
When this field is not set, an attempt to take the hash of the
object raises :exc:`TypeError`.
@@ -328,39 +328,39 @@ type objects) *must* have the :attr:`ob_size` field.
:attr:`tp_richcompare` and :attr:`tp_hash` are both *NULL*.
-.. cmember:: ternaryfunc PyTypeObject.tp_call
+.. c:member:: ternaryfunc PyTypeObject.tp_call
An optional pointer to a function that implements calling the object. This
should be *NULL* if the object is not callable. The signature is the same as
- for :cfunc:`PyObject_Call`.
+ for :c:func:`PyObject_Call`.
This field is inherited by subtypes.
-.. cmember:: reprfunc PyTypeObject.tp_str
+.. c:member:: reprfunc PyTypeObject.tp_str
An optional pointer to a function that implements the built-in operation
:func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls the
- constructor for that type. This constructor calls :cfunc:`PyObject_Str` to do
- the actual work, and :cfunc:`PyObject_Str` will call this handler.)
+ constructor for that type. This constructor calls :c:func:`PyObject_Str` to do
+ the actual work, and :c:func:`PyObject_Str` will call this handler.)
- The signature is the same as for :cfunc:`PyObject_Str`; it must return a string
+ The signature is the same as for :c:func:`PyObject_Str`; it must return a string
or a Unicode object. This function should return a "friendly" string
representation of the object, as this is the representation that will be used,
among other things, by the :func:`print` function.
- When this field is not set, :cfunc:`PyObject_Repr` is called to return a string
+ When this field is not set, :c:func:`PyObject_Repr` is called to return a string
representation.
This field is inherited by subtypes.
-.. cmember:: getattrofunc PyTypeObject.tp_getattro
+.. c:member:: getattrofunc PyTypeObject.tp_getattro
An optional pointer to the get-attribute function.
- The signature is the same as for :cfunc:`PyObject_GetAttr`. It is usually
- convenient to set this field to :cfunc:`PyObject_GenericGetAttr`, which
+ The signature is the same as for :c:func:`PyObject_GetAttr`. It is usually
+ convenient to set this field to :c:func:`PyObject_GenericGetAttr`, which
implements the normal way of looking for object attributes.
This field is inherited by subtypes together with :attr:`tp_getattr`: a subtype
@@ -368,12 +368,12 @@ type objects) *must* have the :attr:`ob_size` field.
the subtype's :attr:`tp_getattr` and :attr:`tp_getattro` are both *NULL*.
-.. cmember:: setattrofunc PyTypeObject.tp_setattro
+.. c:member:: setattrofunc PyTypeObject.tp_setattro
An optional pointer to the set-attribute function.
- The signature is the same as for :cfunc:`PyObject_SetAttr`. It is usually
- convenient to set this field to :cfunc:`PyObject_GenericSetAttr`, which
+ The signature is the same as for :c:func:`PyObject_SetAttr`. It is usually
+ convenient to set this field to :c:func:`PyObject_GenericSetAttr`, which
implements the normal way of setting object attributes.
This field is inherited by subtypes together with :attr:`tp_setattr`: a subtype
@@ -381,7 +381,7 @@ type objects) *must* have the :attr:`ob_size` field.
the subtype's :attr:`tp_setattr` and :attr:`tp_setattro` are both *NULL*.
-.. cmember:: PyBufferProcs* PyTypeObject.tp_as_buffer
+.. c:member:: PyBufferProcs* PyTypeObject.tp_as_buffer
Pointer to an additional structure that contains fields relevant only to objects
which implement the buffer interface. These fields are documented in
@@ -391,7 +391,7 @@ type objects) *must* have the :attr:`ob_size` field.
inherited individually.
-.. cmember:: long PyTypeObject.tp_flags
+.. c:member:: long PyTypeObject.tp_flags
This field is a bit mask of various flags. Some flags indicate variant
semantics for certain situations; others are used to indicate that certain
@@ -414,7 +414,7 @@ type objects) *must* have the :attr:`ob_size` field.
The following bit masks are currently defined; these can be ORed together using
the ``|`` operator to form the value of the :attr:`tp_flags` field. The macro
- :cfunc:`PyType_HasFeature` takes a type and a flags value, *tp* and *f*, and
+ :c:func:`PyType_HasFeature` takes a type and a flags value, *tp* and *f*, and
checks whether ``tp->tp_flags & f`` is non-zero.
@@ -438,20 +438,20 @@ type objects) *must* have the :attr:`ob_size` field.
.. data:: Py_TPFLAGS_READY
This bit is set when the type object has been fully initialized by
- :cfunc:`PyType_Ready`.
+ :c:func:`PyType_Ready`.
.. data:: Py_TPFLAGS_READYING
- This bit is set while :cfunc:`PyType_Ready` is in the process of initializing
+ This bit is set while :c:func:`PyType_Ready` is in the process of initializing
the type object.
.. data:: Py_TPFLAGS_HAVE_GC
This bit is set when the object supports garbage collection. If this bit
- is set, instances must be created using :cfunc:`PyObject_GC_New` and
- destroyed using :cfunc:`PyObject_GC_Del`. More information in section
+ is set, instances must be created using :c:func:`PyObject_GC_New` and
+ destroyed using :c:func:`PyObject_GC_Del`. More information in section
:ref:`supporting-cycle-detection`. This bit also implies that the
GC-related fields :attr:`tp_traverse` and :attr:`tp_clear` are present in
the type object.
@@ -465,7 +465,7 @@ type objects) *must* have the :attr:`ob_size` field.
:const:`Py_TPFLAGS_HAVE_VERSION_TAG`.
-.. cmember:: char* PyTypeObject.tp_doc
+.. c:member:: char* PyTypeObject.tp_doc
An optional pointer to a NUL-terminated C string giving the docstring for this
type object. This is exposed as the :attr:`__doc__` attribute on the type and
@@ -474,7 +474,7 @@ type objects) *must* have the :attr:`ob_size` field.
This field is *not* inherited by subtypes.
-.. cmember:: traverseproc PyTypeObject.tp_traverse
+.. c:member:: traverseproc PyTypeObject.tp_traverse
An optional pointer to a traversal function for the garbage collector. This is
only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. More information
@@ -483,8 +483,8 @@ type objects) *must* have the :attr:`ob_size` field.
The :attr:`tp_traverse` pointer is used by the garbage collector to detect
reference cycles. A typical implementation of a :attr:`tp_traverse` function
- simply calls :cfunc:`Py_VISIT` on each of the instance's members that are Python
- objects. For example, this is function :cfunc:`local_traverse` from the
+ simply calls :c:func:`Py_VISIT` on each of the instance's members that are Python
+ objects. For example, this is function :c:func:`local_traverse` from the
:mod:`_thread` extension module::
static int
@@ -496,7 +496,7 @@ type objects) *must* have the :attr:`ob_size` field.
return 0;
}
- Note that :cfunc:`Py_VISIT` is called only on those members that can participate
+ Note that :c:func:`Py_VISIT` is called only on those members that can participate
in reference cycles. Although there is also a ``self->key`` member, it can only
be *NULL* or a Python string and therefore cannot be part of a reference cycle.
@@ -504,8 +504,8 @@ type objects) *must* have the :attr:`ob_size` field.
debugging aid you may want to visit it anyway just so the :mod:`gc` module's
:func:`get_referents` function will include it.
- Note that :cfunc:`Py_VISIT` requires the *visit* and *arg* parameters to
- :cfunc:`local_traverse` to have these specific names; don't name them just
+ Note that :c:func:`Py_VISIT` requires the *visit* and *arg* parameters to
+ :c:func:`local_traverse` to have these specific names; don't name them just
anything.
This field is inherited by subtypes together with :attr:`tp_clear` and the
@@ -514,7 +514,7 @@ type objects) *must* have the :attr:`ob_size` field.
the subtype.
-.. cmember:: inquiry PyTypeObject.tp_clear
+.. c:member:: inquiry PyTypeObject.tp_clear
An optional pointer to a clear function for the garbage collector. This is only
used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set.
@@ -543,7 +543,7 @@ type objects) *must* have the :attr:`ob_size` field.
return 0;
}
- The :cfunc:`Py_CLEAR` macro should be used, because clearing references is
+ The :c:func:`Py_CLEAR` macro should be used, because clearing references is
delicate: the reference to the contained object must not be decremented until
after the pointer to the contained object is set to *NULL*. This is because
decrementing the reference count may cause the contained object to become trash,
@@ -552,7 +552,7 @@ type objects) *must* have the :attr:`ob_size` field.
contained object). If it's possible for such code to reference *self* again,
it's important that the pointer to the contained object be *NULL* at that time,
so that *self* knows the contained object can no longer be used. The
- :cfunc:`Py_CLEAR` macro performs the operations in a safe order.
+ :c:func:`Py_CLEAR` macro performs the operations in a safe order.
Because the goal of :attr:`tp_clear` functions is to break reference cycles,
it's not necessary to clear contained objects like Python strings or Python
@@ -569,7 +569,7 @@ type objects) *must* have the :attr:`ob_size` field.
the subtype.
-.. cmember:: richcmpfunc PyTypeObject.tp_richcompare
+.. c:member:: richcmpfunc PyTypeObject.tp_richcompare
An optional pointer to the rich comparison function, whose signature is
``PyObject *tp_richcompare(PyObject *a, PyObject *b, int op)``.
@@ -591,7 +591,7 @@ type objects) *must* have the :attr:`ob_size` field.
*NULL*.
The following constants are defined to be used as the third argument for
- :attr:`tp_richcompare` and for :cfunc:`PyObject_RichCompare`:
+ :attr:`tp_richcompare` and for :c:func:`PyObject_RichCompare`:
+----------------+------------+
| Constant | Comparison |
@@ -610,13 +610,13 @@ type objects) *must* have the :attr:`ob_size` field.
+----------------+------------+
-.. cmember:: long PyTypeObject.tp_weaklistoffset
+.. c:member:: long PyTypeObject.tp_weaklistoffset
If the instances of this type are weakly referenceable, this field is greater
than zero and contains the offset in the instance structure of the weak
reference list head (ignoring the GC header, if present); this offset is used by
- :cfunc:`PyObject_ClearWeakRefs` and the :cfunc:`PyWeakref_\*` functions. The
- instance structure needs to include a field of type :ctype:`PyObject\*` which is
+ :c:func:`PyObject_ClearWeakRefs` and the :c:func:`PyWeakref_\*` functions. The
+ instance structure needs to include a field of type :c:type:`PyObject\*` which is
initialized to *NULL*.
Do not confuse this field with :attr:`tp_weaklist`; that is the list head for
@@ -641,18 +641,18 @@ type objects) *must* have the :attr:`ob_size` field.
:attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its
base type.
-.. cmember:: getiterfunc PyTypeObject.tp_iter
+.. c:member:: getiterfunc PyTypeObject.tp_iter
An optional pointer to a function that returns an iterator for the object. Its
presence normally signals that the instances of this type are iterable (although
sequences may be iterable without this function).
- This function has the same signature as :cfunc:`PyObject_GetIter`.
+ This function has the same signature as :c:func:`PyObject_GetIter`.
This field is inherited by subtypes.
-.. cmember:: iternextfunc PyTypeObject.tp_iternext
+.. c:member:: iternextfunc PyTypeObject.tp_iternext
An optional pointer to a function that returns the next item in an iterator.
When the iterator is exhausted, it must return *NULL*; a :exc:`StopIteration`
@@ -664,14 +664,14 @@ type objects) *must* have the :attr:`ob_size` field.
function should return the iterator instance itself (not a new iterator
instance).
- This function has the same signature as :cfunc:`PyIter_Next`.
+ This function has the same signature as :c:func:`PyIter_Next`.
This field is inherited by subtypes.
-.. cmember:: struct PyMethodDef* PyTypeObject.tp_methods
+.. c:member:: struct PyMethodDef* PyTypeObject.tp_methods
- An optional pointer to a static *NULL*-terminated array of :ctype:`PyMethodDef`
+ An optional pointer to a static *NULL*-terminated array of :c:type:`PyMethodDef`
structures, declaring regular methods of this type.
For each entry in the array, an entry is added to the type's dictionary (see
@@ -681,9 +681,9 @@ type objects) *must* have the :attr:`ob_size` field.
different mechanism).
-.. cmember:: struct PyMemberDef* PyTypeObject.tp_members
+.. c:member:: struct PyMemberDef* PyTypeObject.tp_members
- An optional pointer to a static *NULL*-terminated array of :ctype:`PyMemberDef`
+ An optional pointer to a static *NULL*-terminated array of :c:type:`PyMemberDef`
structures, declaring regular data members (fields or slots) of instances of
this type.
@@ -694,9 +694,9 @@ type objects) *must* have the :attr:`ob_size` field.
different mechanism).
-.. cmember:: struct PyGetSetDef* PyTypeObject.tp_getset
+.. c:member:: struct PyGetSetDef* PyTypeObject.tp_getset
- An optional pointer to a static *NULL*-terminated array of :ctype:`PyGetSetDef`
+ An optional pointer to a static *NULL*-terminated array of :c:type:`PyGetSetDef`
structures, declaring computed attributes of instances of this type.
For each entry in the array, an entry is added to the type's dictionary (see
@@ -721,7 +721,7 @@ type objects) *must* have the :attr:`ob_size` field.
} PyGetSetDef;
-.. cmember:: PyTypeObject* PyTypeObject.tp_base
+.. c:member:: PyTypeObject* PyTypeObject.tp_base
An optional pointer to a base type from which type properties are inherited. At
this level, only single inheritance is supported; multiple inheritance require
@@ -732,13 +732,13 @@ type objects) *must* have the :attr:`ob_size` field.
:class:`object`).
-.. cmember:: PyObject* PyTypeObject.tp_dict
+.. c:member:: PyObject* PyTypeObject.tp_dict
- The type's dictionary is stored here by :cfunc:`PyType_Ready`.
+ The type's dictionary is stored here by :c:func:`PyType_Ready`.
This field should normally be initialized to *NULL* before PyType_Ready is
called; it may also be initialized to a dictionary containing initial attributes
- for the type. Once :cfunc:`PyType_Ready` has initialized the type, extra
+ for the type. Once :c:func:`PyType_Ready` has initialized the type, extra
attributes for the type may be added to this dictionary only if they don't
correspond to overloaded operations (like :meth:`__add__`).
@@ -746,7 +746,7 @@ type objects) *must* have the :attr:`ob_size` field.
are inherited through a different mechanism).
-.. cmember:: descrgetfunc PyTypeObject.tp_descr_get
+.. c:member:: descrgetfunc PyTypeObject.tp_descr_get
An optional pointer to a "descriptor get" function.
@@ -759,7 +759,7 @@ type objects) *must* have the :attr:`ob_size` field.
This field is inherited by subtypes.
-.. cmember:: descrsetfunc PyTypeObject.tp_descr_set
+.. c:member:: descrsetfunc PyTypeObject.tp_descr_set
An optional pointer to a "descriptor set" function.
@@ -772,12 +772,12 @@ type objects) *must* have the :attr:`ob_size` field.
.. XXX explain.
-.. cmember:: long PyTypeObject.tp_dictoffset
+.. c:member:: long PyTypeObject.tp_dictoffset
If the instances of this type have a dictionary containing instance variables,
this field is non-zero and contains the offset in the instances of the type of
the instance variable dictionary; this offset is used by
- :cfunc:`PyObject_GenericGetAttr`.
+ :c:func:`PyObject_GenericGetAttr`.
Do not confuse this field with :attr:`tp_dict`; that is the dictionary for
attributes of the type object itself.
@@ -805,7 +805,7 @@ type objects) *must* have the :attr:`ob_size` field.
taken from the type object, and :attr:`ob_size` is taken from the instance. The
absolute value is taken because ints use the sign of :attr:`ob_size` to
store the sign of the number. (There's never a need to do this calculation
- yourself; it is done for you by :cfunc:`_PyObject_GetDictPtr`.)
+ yourself; it is done for you by :c:func:`_PyObject_GetDictPtr`.)
This field is inherited by subtypes, but see the rules listed below. A subtype
may override this offset; this means that the subtype instances store the
@@ -825,7 +825,7 @@ type objects) *must* have the :attr:`ob_size` field.
added as a feature just like :attr:`__weakref__` though.)
-.. cmember:: initproc PyTypeObject.tp_init
+.. c:member:: initproc PyTypeObject.tp_init
An optional pointer to an instance initialization function.
@@ -852,7 +852,7 @@ type objects) *must* have the :attr:`ob_size` field.
This field is inherited by subtypes.
-.. cmember:: allocfunc PyTypeObject.tp_alloc
+.. c:member:: allocfunc PyTypeObject.tp_alloc
An optional pointer to an instance allocation function.
@@ -875,11 +875,11 @@ type objects) *must* have the :attr:`ob_size` field.
This field is inherited by static subtypes, but not by dynamic subtypes
(subtypes created by a class statement); in the latter, this field is always set
- to :cfunc:`PyType_GenericAlloc`, to force a standard heap allocation strategy.
+ to :c:func:`PyType_GenericAlloc`, to force a standard heap allocation strategy.
That is also the recommended value for statically defined types.
-.. cmember:: newfunc PyTypeObject.tp_new
+.. c:member:: newfunc PyTypeObject.tp_new
An optional pointer to an instance creation function.
@@ -909,22 +909,22 @@ type objects) *must* have the :attr:`ob_size` field.
whose :attr:`tp_base` is *NULL* or ``&PyBaseObject_Type``.
-.. cmember:: destructor PyTypeObject.tp_free
+.. c:member:: destructor PyTypeObject.tp_free
An optional pointer to an instance deallocation function. Its signature is
- :ctype:`freefunc`::
+ :c:type:`freefunc`::
void tp_free(void *)
- An initializer that is compatible with this signature is :cfunc:`PyObject_Free`.
+ An initializer that is compatible with this signature is :c:func:`PyObject_Free`.
This field is inherited by static subtypes, but not by dynamic subtypes
(subtypes created by a class statement); in the latter, this field is set to a
- deallocator suitable to match :cfunc:`PyType_GenericAlloc` and the value of the
+ deallocator suitable to match :c:func:`PyType_GenericAlloc` and the value of the
:const:`Py_TPFLAGS_HAVE_GC` flag bit.
-.. cmember:: inquiry PyTypeObject.tp_is_gc
+.. c:member:: inquiry PyTypeObject.tp_is_gc
An optional pointer to a function called by the garbage collector.
@@ -939,13 +939,13 @@ type objects) *must* have the :attr:`ob_size` field.
int tp_is_gc(PyObject *self)
(The only example of this are types themselves. The metatype,
- :cdata:`PyType_Type`, defines this function to distinguish between statically
+ :c:data:`PyType_Type`, defines this function to distinguish between statically
and dynamically allocated types.)
This field is inherited by subtypes.
-.. cmember:: PyObject* PyTypeObject.tp_bases
+.. c:member:: PyObject* PyTypeObject.tp_bases
Tuple of base types.
@@ -955,25 +955,25 @@ type objects) *must* have the :attr:`ob_size` field.
This field is not inherited.
-.. cmember:: PyObject* PyTypeObject.tp_mro
+.. c:member:: PyObject* PyTypeObject.tp_mro
Tuple containing the expanded set of base types, starting with the type itself
and ending with :class:`object`, in Method Resolution Order.
- This field is not inherited; it is calculated fresh by :cfunc:`PyType_Ready`.
+ This field is not inherited; it is calculated fresh by :c:func:`PyType_Ready`.
-.. cmember:: PyObject* PyTypeObject.tp_cache
+.. c:member:: PyObject* PyTypeObject.tp_cache
Unused. Not inherited. Internal use only.
-.. cmember:: PyObject* PyTypeObject.tp_subclasses
+.. c:member:: PyObject* PyTypeObject.tp_subclasses
List of weak references to subclasses. Not inherited. Internal use only.
-.. cmember:: PyObject* PyTypeObject.tp_weaklist
+.. c:member:: PyObject* PyTypeObject.tp_weaklist
Weak reference list head, for weak references to this type object. Not
inherited. Internal use only.
@@ -984,22 +984,22 @@ documented here for completeness. None of these fields are inherited by
subtypes.
-.. cmember:: Py_ssize_t PyTypeObject.tp_allocs
+.. c:member:: Py_ssize_t PyTypeObject.tp_allocs
Number of allocations.
-.. cmember:: Py_ssize_t PyTypeObject.tp_frees
+.. c:member:: Py_ssize_t PyTypeObject.tp_frees
Number of frees.
-.. cmember:: Py_ssize_t PyTypeObject.tp_maxalloc
+.. c:member:: Py_ssize_t PyTypeObject.tp_maxalloc
Maximum simultaneously allocated objects.
-.. cmember:: PyTypeObject* PyTypeObject.tp_next
+.. c:member:: PyTypeObject* PyTypeObject.tp_next
Pointer to the next type object with a non-zero :attr:`tp_allocs` field.
@@ -1022,7 +1022,7 @@ Number Object Structures
.. sectionauthor:: Amaury Forgeot d'Arc
-.. ctype:: PyNumberMethods
+.. c:type:: PyNumberMethods
This structure holds pointers to the functions which an object uses to
implement the number protocol. Each function is used by the function of
@@ -1081,8 +1081,8 @@ Number Object Structures
.. note::
- The :cdata:`nb_reserved` field should always be ``NULL``. It
- was previously called :cdata:`nb_long`, and was renamed in
+ The :c:data:`nb_reserved` field should always be ``NULL``. It
+ was previously called :c:data:`nb_long`, and was renamed in
Python 3.0.1.
@@ -1094,26 +1094,26 @@ Mapping Object Structures
.. sectionauthor:: Amaury Forgeot d'Arc
-.. ctype:: PyMappingMethods
+.. c:type:: PyMappingMethods
This structure holds pointers to the functions which an object uses to
implement the mapping protocol. It has three members:
-.. cmember:: lenfunc PyMappingMethods.mp_length
+.. c:member:: lenfunc PyMappingMethods.mp_length
- This function is used by :cfunc:`PyMapping_Length` and
- :cfunc:`PyObject_Size`, and has the same signature. This slot may be set to
+ This function is used by :c:func:`PyMapping_Length` and
+ :c:func:`PyObject_Size`, and has the same signature. This slot may be set to
*NULL* if the object has no defined length.
-.. cmember:: binaryfunc PyMappingMethods.mp_subscript
+.. c:member:: binaryfunc PyMappingMethods.mp_subscript
- This function is used by :cfunc:`PyObject_GetItem` and has the same
- signature. This slot must be filled for the :cfunc:`PyMapping_Check`
+ This function is used by :c:func:`PyObject_GetItem` and has the same
+ signature. This slot must be filled for the :c:func:`PyMapping_Check`
function to return ``1``, it can be *NULL* otherwise.
-.. cmember:: objobjargproc PyMappingMethods.mp_ass_subscript
+.. c:member:: objobjargproc PyMappingMethods.mp_ass_subscript
- This function is used by :cfunc:`PyObject_SetItem` and has the same
+ This function is used by :c:func:`PyObject_SetItem` and has the same
signature. If this slot is *NULL*, the object does not support item
assignment.
@@ -1126,32 +1126,32 @@ Sequence Object Structures
.. sectionauthor:: Amaury Forgeot d'Arc
-.. ctype:: PySequenceMethods
+.. c:type:: PySequenceMethods
This structure holds pointers to the functions which an object uses to
implement the sequence protocol.
-.. cmember:: lenfunc PySequenceMethods.sq_length
+.. c:member:: lenfunc PySequenceMethods.sq_length
- This function is used by :cfunc:`PySequence_Size` and :cfunc:`PyObject_Size`,
+ This function is used by :c:func:`PySequence_Size` and :c:func:`PyObject_Size`,
and has the same signature.
-.. cmember:: binaryfunc PySequenceMethods.sq_concat
+.. c:member:: binaryfunc PySequenceMethods.sq_concat
- This function is used by :cfunc:`PySequence_Concat` and has the same
+ This function is used by :c:func:`PySequence_Concat` and has the same
signature. It is also used by the ``+`` operator, after trying the numeric
addition via the :attr:`tp_as_number.nb_add` slot.
-.. cmember:: ssizeargfunc PySequenceMethods.sq_repeat
+.. c:member:: ssizeargfunc PySequenceMethods.sq_repeat
- This function is used by :cfunc:`PySequence_Repeat` and has the same
+ This function is used by :c:func:`PySequence_Repeat` and has the same
signature. It is also used by the ``*`` operator, after trying numeric
multiplication via the :attr:`tp_as_number.nb_mul` slot.
-.. cmember:: ssizeargfunc PySequenceMethods.sq_item
+.. c:member:: ssizeargfunc PySequenceMethods.sq_item
- This function is used by :cfunc:`PySequence_GetItem` and has the same
- signature. This slot must be filled for the :cfunc:`PySequence_Check`
+ This function is used by :c:func:`PySequence_GetItem` and has the same
+ signature. This slot must be filled for the :c:func:`PySequence_Check`
function to return ``1``, it can be *NULL* otherwise.
Negative indexes are handled as follows: if the :attr:`sq_length` slot is
@@ -1159,27 +1159,27 @@ Sequence Object Structures
index which is passed to :attr:`sq_item`. If :attr:`sq_length` is *NULL*,
the index is passed as is to the function.
-.. cmember:: ssizeobjargproc PySequenceMethods.sq_ass_item
+.. c:member:: ssizeobjargproc PySequenceMethods.sq_ass_item
- This function is used by :cfunc:`PySequence_SetItem` and has the same
+ This function is used by :c:func:`PySequence_SetItem` and has the same
signature. This slot may be left to *NULL* if the object does not support
item assignment.
-.. cmember:: objobjproc PySequenceMethods.sq_contains
+.. c:member:: objobjproc PySequenceMethods.sq_contains
- This function may be used by :cfunc:`PySequence_Contains` and has the same
+ This function may be used by :c:func:`PySequence_Contains` and has the same
signature. This slot may be left to *NULL*, in this case
- :cfunc:`PySequence_Contains` simply traverses the sequence until it finds a
+ :c:func:`PySequence_Contains` simply traverses the sequence until it finds a
match.
-.. cmember:: binaryfunc PySequenceMethods.sq_inplace_concat
+.. c:member:: binaryfunc PySequenceMethods.sq_inplace_concat
- This function is used by :cfunc:`PySequence_InPlaceConcat` and has the same
+ This function is used by :c:func:`PySequence_InPlaceConcat` and has the same
signature. It should modify its first operand, and return it.
-.. cmember:: ssizeargfunc PySequenceMethods.sq_inplace_repeat
+.. c:member:: ssizeargfunc PySequenceMethods.sq_inplace_repeat
- This function is used by :cfunc:`PySequence_InPlaceRepeat` and has the same
+ This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same
signature. It should modify its first operand, and return it.
.. XXX need to explain precedence between mapping and sequence
@@ -1199,40 +1199,40 @@ The :ref:`buffer interface <bufferobjects>` exports a model where an object can
data.
If an object does not export the buffer interface, then its :attr:`tp_as_buffer`
-member in the :ctype:`PyTypeObject` structure should be *NULL*. Otherwise, the
-:attr:`tp_as_buffer` will point to a :ctype:`PyBufferProcs` structure.
+member in the :c:type:`PyTypeObject` structure should be *NULL*. Otherwise, the
+:attr:`tp_as_buffer` will point to a :c:type:`PyBufferProcs` structure.
-.. ctype:: PyBufferProcs
+.. c:type:: PyBufferProcs
Structure used to hold the function pointers which define an implementation of
the buffer protocol.
- .. cmember:: getbufferproc bf_getbuffer
+ .. c:member:: getbufferproc bf_getbuffer
- This should fill a :ctype:`Py_buffer` with the necessary data for
+ This should fill a :c:type:`Py_buffer` with the necessary data for
exporting the type. The signature of :data:`getbufferproc` is ``int
(PyObject *obj, Py_buffer *view, int flags)``. *obj* is the object to
- export, *view* is the :ctype:`Py_buffer` struct to fill, and *flags* gives
+ export, *view* is the :c:type:`Py_buffer` struct to fill, and *flags* gives
the conditions the caller wants the memory under. (See
- :cfunc:`PyObject_GetBuffer` for all flags.) :cmember:`bf_getbuffer` is
+ :c:func:`PyObject_GetBuffer` for all flags.) :c:member:`bf_getbuffer` is
responsible for filling *view* with the appropriate information.
- (:cfunc:`PyBuffer_FillView` can be used in simple cases.) See
- :ctype:`Py_buffer`\s docs for what needs to be filled in.
+ (:c:func:`PyBuffer_FillView` can be used in simple cases.) See
+ :c:type:`Py_buffer`\s docs for what needs to be filled in.
- .. cmember:: releasebufferproc bf_releasebuffer
+ .. c:member:: releasebufferproc bf_releasebuffer
This should release the resources of the buffer. The signature of
- :cdata:`releasebufferproc` is ``void (PyObject *obj, Py_buffer *view)``.
- If the :cdata:`bf_releasebuffer` function is not provided (i.e. it is
+ :c:data:`releasebufferproc` is ``void (PyObject *obj, Py_buffer *view)``.
+ If the :c:data:`bf_releasebuffer` function is not provided (i.e. it is
*NULL*), then it does not ever need to be called.
The exporter of the buffer interface must make sure that any memory
- pointed to in the :ctype:`Py_buffer` structure remains valid until
+ pointed to in the :c:type:`Py_buffer` structure remains valid until
releasebuffer is called. Exporters will need to define a
- :cdata:`bf_releasebuffer` function if they can re-allocate their memory,
+ :c:data:`bf_releasebuffer` function if they can re-allocate their memory,
strides, shape, suboffsets, or format variables which they might share
through the struct bufferinfo.
- See :cfunc:`PyBuffer_Release`.
+ See :c:func:`PyBuffer_Release`.
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index a91f258e58..f48eb73bfd 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -17,75 +17,75 @@ These are the basic Unicode object types used for the Unicode implementation in
Python:
-.. ctype:: Py_UNICODE
+.. c:type:: Py_UNICODE
This type represents the storage type which is used by Python internally as
basis for holding Unicode ordinals. Python's default builds use a 16-bit type
- for :ctype:`Py_UNICODE` and store Unicode values internally as UCS2. It is also
+ for :c:type:`Py_UNICODE` and store Unicode values internally as UCS2. It is also
possible to build a UCS4 version of Python (most recent Linux distributions come
with UCS4 builds of Python). These builds then use a 32-bit type for
- :ctype:`Py_UNICODE` and store Unicode data internally as UCS4. On platforms
- where :ctype:`wchar_t` is available and compatible with the chosen Python
- Unicode build variant, :ctype:`Py_UNICODE` is a typedef alias for
- :ctype:`wchar_t` to enhance native platform compatibility. On all other
- platforms, :ctype:`Py_UNICODE` is a typedef alias for either :ctype:`unsigned
- short` (UCS2) or :ctype:`unsigned long` (UCS4).
+ :c:type:`Py_UNICODE` and store Unicode data internally as UCS4. On platforms
+ where :c:type:`wchar_t` is available and compatible with the chosen Python
+ Unicode build variant, :c:type:`Py_UNICODE` is a typedef alias for
+ :c:type:`wchar_t` to enhance native platform compatibility. On all other
+ platforms, :c:type:`Py_UNICODE` is a typedef alias for either :c:type:`unsigned
+ short` (UCS2) or :c:type:`unsigned long` (UCS4).
Note that UCS2 and UCS4 Python builds are not binary compatible. Please keep
this in mind when writing extensions or interfaces.
-.. ctype:: PyUnicodeObject
+.. c:type:: PyUnicodeObject
- This subtype of :ctype:`PyObject` represents a Python Unicode object.
+ This subtype of :c:type:`PyObject` represents a Python Unicode object.
-.. cvar:: PyTypeObject PyUnicode_Type
+.. c:var:: PyTypeObject PyUnicode_Type
- This instance of :ctype:`PyTypeObject` represents the Python Unicode type. It
+ This instance of :c:type:`PyTypeObject` represents the Python Unicode type. It
is exposed to Python code as ``str``.
The following APIs are really C macros and can be used to do fast checks and to
access internal read-only data of Unicode objects:
-.. cfunction:: int PyUnicode_Check(PyObject *o)
+.. c:function:: int PyUnicode_Check(PyObject *o)
Return true if the object *o* is a Unicode object or an instance of a Unicode
subtype.
-.. cfunction:: int PyUnicode_CheckExact(PyObject *o)
+.. c:function:: int PyUnicode_CheckExact(PyObject *o)
Return true if the object *o* is a Unicode object, but not an instance of a
subtype.
-.. cfunction:: Py_ssize_t PyUnicode_GET_SIZE(PyObject *o)
+.. c:function:: Py_ssize_t PyUnicode_GET_SIZE(PyObject *o)
- Return the size of the object. *o* has to be a :ctype:`PyUnicodeObject` (not
+ Return the size of the object. *o* has to be a :c:type:`PyUnicodeObject` (not
checked).
-.. cfunction:: Py_ssize_t PyUnicode_GET_DATA_SIZE(PyObject *o)
+.. c:function:: Py_ssize_t PyUnicode_GET_DATA_SIZE(PyObject *o)
Return the size of the object's internal buffer in bytes. *o* has to be a
- :ctype:`PyUnicodeObject` (not checked).
+ :c:type:`PyUnicodeObject` (not checked).
-.. cfunction:: Py_UNICODE* PyUnicode_AS_UNICODE(PyObject *o)
+.. c:function:: Py_UNICODE* PyUnicode_AS_UNICODE(PyObject *o)
- Return a pointer to the internal :ctype:`Py_UNICODE` buffer of the object. *o*
- has to be a :ctype:`PyUnicodeObject` (not checked).
+ Return a pointer to the internal :c:type:`Py_UNICODE` buffer of the object. *o*
+ has to be a :c:type:`PyUnicodeObject` (not checked).
-.. cfunction:: const char* PyUnicode_AS_DATA(PyObject *o)
+.. c:function:: const char* PyUnicode_AS_DATA(PyObject *o)
Return a pointer to the internal buffer of the object. *o* has to be a
- :ctype:`PyUnicodeObject` (not checked).
+ :c:type:`PyUnicodeObject` (not checked).
-.. cfunction:: int PyUnicode_ClearFreeList()
+.. c:function:: int PyUnicode_ClearFreeList()
Clear the free list. Return the total number of freed items.
@@ -98,57 +98,57 @@ are available through these macros which are mapped to C functions depending on
the Python configuration.
-.. cfunction:: int Py_UNICODE_ISSPACE(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISSPACE(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is a whitespace character.
-.. cfunction:: int Py_UNICODE_ISLOWER(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISLOWER(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is a lowercase character.
-.. cfunction:: int Py_UNICODE_ISUPPER(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISUPPER(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is an uppercase character.
-.. cfunction:: int Py_UNICODE_ISTITLE(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISTITLE(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is a titlecase character.
-.. cfunction:: int Py_UNICODE_ISLINEBREAK(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISLINEBREAK(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is a linebreak character.
-.. cfunction:: int Py_UNICODE_ISDECIMAL(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISDECIMAL(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is a decimal character.
-.. cfunction:: int Py_UNICODE_ISDIGIT(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISDIGIT(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is a digit character.
-.. cfunction:: int Py_UNICODE_ISNUMERIC(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISNUMERIC(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is a numeric character.
-.. cfunction:: int Py_UNICODE_ISALPHA(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISALPHA(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is an alphabetic character.
-.. cfunction:: int Py_UNICODE_ISALNUM(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISALNUM(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is an alphanumeric character.
-.. cfunction:: int Py_UNICODE_ISPRINTABLE(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_ISPRINTABLE(Py_UNICODE ch)
Return 1 or 0 depending on whether *ch* is a printable character.
Nonprintable characters are those characters defined in the Unicode character
@@ -162,34 +162,34 @@ the Python configuration.
These APIs can be used for fast direct character conversions:
-.. cfunction:: Py_UNICODE Py_UNICODE_TOLOWER(Py_UNICODE ch)
+.. c:function:: Py_UNICODE Py_UNICODE_TOLOWER(Py_UNICODE ch)
Return the character *ch* converted to lower case.
-.. cfunction:: Py_UNICODE Py_UNICODE_TOUPPER(Py_UNICODE ch)
+.. c:function:: Py_UNICODE Py_UNICODE_TOUPPER(Py_UNICODE ch)
Return the character *ch* converted to upper case.
-.. cfunction:: Py_UNICODE Py_UNICODE_TOTITLE(Py_UNICODE ch)
+.. c:function:: Py_UNICODE Py_UNICODE_TOTITLE(Py_UNICODE ch)
Return the character *ch* converted to title case.
-.. cfunction:: int Py_UNICODE_TODECIMAL(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_TODECIMAL(Py_UNICODE ch)
Return the character *ch* converted to a decimal positive integer. Return
``-1`` if this is not possible. This macro does not raise exceptions.
-.. cfunction:: int Py_UNICODE_TODIGIT(Py_UNICODE ch)
+.. c:function:: int Py_UNICODE_TODIGIT(Py_UNICODE ch)
Return the character *ch* converted to a single digit integer. Return ``-1`` if
this is not possible. This macro does not raise exceptions.
-.. cfunction:: double Py_UNICODE_TONUMERIC(Py_UNICODE ch)
+.. c:function:: double Py_UNICODE_TONUMERIC(Py_UNICODE ch)
Return the character *ch* converted to a double. Return ``-1.0`` if this is not
possible. This macro does not raise exceptions.
@@ -202,7 +202,7 @@ To create Unicode objects and access their basic sequence properties, use these
APIs:
-.. cfunction:: PyObject* PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size)
+.. c:function:: PyObject* PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size)
Create a Unicode object from the Py_UNICODE buffer *u* of the given size. *u*
may be *NULL* which causes the contents to be undefined. It is the user's
@@ -212,7 +212,7 @@ APIs:
is *NULL*.
-.. cfunction:: PyObject* PyUnicode_FromStringAndSize(const char *u, Py_ssize_t size)
+.. c:function:: PyObject* PyUnicode_FromStringAndSize(const char *u, Py_ssize_t size)
Create a Unicode object from the char buffer *u*. The bytes will be interpreted
as being UTF-8 encoded. *u* may also be *NULL* which
@@ -222,23 +222,26 @@ APIs:
the resulting Unicode object is only allowed when *u* is *NULL*.
-.. cfunction:: PyObject *PyUnicode_FromString(const char *u)
+.. c:function:: PyObject *PyUnicode_FromString(const char *u)
Create a Unicode object from an UTF-8 encoded null-terminated char buffer
*u*.
-.. cfunction:: PyObject* PyUnicode_FromFormat(const char *format, ...)
+.. c:function:: PyObject* PyUnicode_FromFormat(const char *format, ...)
- Take a C :cfunc:`printf`\ -style *format* string and a variable number of
+ Take a C :c:func:`printf`\ -style *format* string and a variable number of
arguments, calculate the size of the resulting Python unicode string and return
a string with the values formatted into it. The variable arguments must be C
types and must correspond exactly to the format characters in the *format*
- string. The following format characters are allowed:
+ ASCII-encoded string. The following format characters are allowed:
+ .. % This should be exactly the same as the table in PyErr_Format.
.. % The descriptions for %zd and %zu are wrong, but the truth is complicated
.. % because not all compilers support the %z width modifier -- we fake it
.. % when necessary via interpolating PY_FORMAT_SIZE_T.
+ .. % Similar comments apply to the %ll width modifier and
+ .. % PY_FORMAT_LONG_LONG.
+-------------------+---------------------+--------------------------------+
| Format Characters | Type | Comment |
@@ -260,6 +263,12 @@ APIs:
| :attr:`%lu` | unsigned long | Exactly equivalent to |
| | | ``printf("%lu")``. |
+-------------------+---------------------+--------------------------------+
+ | :attr:`%lld` | long long | Exactly equivalent to |
+ | | | ``printf("%lld")``. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%llu` | unsigned long long | Exactly equivalent to |
+ | | | ``printf("%llu")``. |
+ +-------------------+---------------------+--------------------------------+
| :attr:`%zd` | Py_ssize_t | Exactly equivalent to |
| | | ``printf("%zd")``. |
+-------------------+---------------------+--------------------------------+
@@ -296,34 +305,59 @@ APIs:
| | | *NULL*). |
+-------------------+---------------------+--------------------------------+
| :attr:`%S` | PyObject\* | The result of calling |
- | | | :func:`PyObject_Str`. |
+ | | | :c:func:`PyObject_Str`. |
+-------------------+---------------------+--------------------------------+
| :attr:`%R` | PyObject\* | The result of calling |
- | | | :func:`PyObject_Repr`. |
+ | | | :c:func:`PyObject_Repr`. |
+-------------------+---------------------+--------------------------------+
An unrecognized format character causes all the rest of the format string to be
copied as-is to the result string, and any extra arguments discarded.
+ .. note::
+
+ The `"%lld"` and `"%llu"` format specifiers are only available
+ when :const:`HAVE_LONG_LONG` is defined.
+
+ .. versionchanged:: 3.2
+ Support for ``"%lld"`` and ``"%llu"`` added.
-.. cfunction:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs)
- Identical to :func:`PyUnicode_FromFormat` except that it takes exactly two
+.. c:function:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs)
+
+ Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two
arguments.
+.. c:function:: PyObject* PyUnicode_TransformDecimalToASCII(Py_UNICODE *s, Py_ssize_t size)
+
+ Create a Unicode object by replacing all decimal digits in
+ :c:type:`Py_UNICODE` buffer of the given *size* by ASCII digits 0--9
+ according to their decimal value. Return *NULL* if an exception
+ occurs.
-.. cfunction:: Py_UNICODE* PyUnicode_AsUnicode(PyObject *unicode)
- Return a read-only pointer to the Unicode object's internal :ctype:`Py_UNICODE`
+.. c:function:: Py_UNICODE* PyUnicode_AsUnicode(PyObject *unicode)
+
+ Return a read-only pointer to the Unicode object's internal :c:type:`Py_UNICODE`
buffer, *NULL* if *unicode* is not a Unicode object.
-.. cfunction:: Py_ssize_t PyUnicode_GetSize(PyObject *unicode)
+.. c:function:: Py_UNICODE* PyUnicode_AsUnicodeCopy(PyObject *unicode)
+
+ Create a copy of a Unicode string ending with a nul character. Return *NULL*
+ and raise a :exc:`MemoryError` exception on memory allocation failure,
+ otherwise return a new allocated buffer (use :c:func:`PyMem_Free` to free the
+ buffer).
+
+ .. versionadded:: 3.2
+
+
+.. c:function:: Py_ssize_t PyUnicode_GetSize(PyObject *unicode)
Return the length of the Unicode object.
-.. cfunction:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, const char *encoding, const char *errors)
+.. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, const char *encoding, const char *errors)
Coerce an encoded object *obj* to an Unicode object and return a reference with
incremented refcount.
@@ -340,77 +374,125 @@ APIs:
decref'ing the returned objects.
-.. cfunction:: PyObject* PyUnicode_FromObject(PyObject *obj)
+.. c:function:: PyObject* PyUnicode_FromObject(PyObject *obj)
Shortcut for ``PyUnicode_FromEncodedObject(obj, NULL, "strict")`` which is used
throughout the interpreter whenever coercion to Unicode is needed.
-If the platform supports :ctype:`wchar_t` and provides a header file wchar.h,
+If the platform supports :c:type:`wchar_t` and provides a header file wchar.h,
Python can interface directly to this type using the following functions.
-Support is optimized if Python's own :ctype:`Py_UNICODE` type is identical to
-the system's :ctype:`wchar_t`.
+Support is optimized if Python's own :c:type:`Py_UNICODE` type is identical to
+the system's :c:type:`wchar_t`.
File System Encoding
""""""""""""""""""""
To encode and decode file names and other environment strings,
-:cdata:`Py_FileSystemEncoding` should be used as the encoding, and
+:c:data:`Py_FileSystemEncoding` should be used as the encoding, and
``"surrogateescape"`` should be used as the error handler (:pep:`383`). To
encode file names during argument parsing, the ``"O&"`` converter should be
-used, passing :cfunc:`PyUnicode_FSConverter` as the conversion function:
+used, passing :c:func:`PyUnicode_FSConverter` as the conversion function:
-.. cfunction:: int PyUnicode_FSConverter(PyObject* obj, void* result)
+.. c:function:: int PyUnicode_FSConverter(PyObject* obj, void* result)
- Convert *obj* into *result*, using :cdata:`Py_FileSystemDefaultEncoding`,
- and the ``"surrogateescape"`` error handler. *result* must be a
- ``PyObject*``, return a :func:`bytes` object which must be released if it
- is no longer used.
+ ParseTuple converter: encode :class:`str` objects to :class:`bytes` using
+ :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` objects are output as-is.
+ *result* must be a :c:type:`PyBytesObject*` which must be released when it is
+ no longer used.
.. versionadded:: 3.1
-.. cfunction:: PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
+To decode file names during argument parsing, the ``"O&"`` converter should be
+used, passing :c:func:`PyUnicode_FSDecoder` as the conversion function:
+
+.. c:function:: int PyUnicode_FSDecoder(PyObject* obj, void* result)
+
+ ParseTuple converter: decode :class:`bytes` objects to :class:`str` using
+ :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are output
+ as-is. *result* must be a :c:type:`PyUnicodeObject*` which must be released
+ when it is no longer used.
+
+ .. versionadded:: 3.2
+
+
+.. c:function:: PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
- Decode a null-terminated string using :cdata:`Py_FileSystemDefaultEncoding`
- and the ``"surrogateescape"`` error handler.
+ Decode a string using :c:data:`Py_FileSystemDefaultEncoding` and the
+ ``'surrogateescape'`` error handler, or ``'strict'`` on Windows.
- If :cdata:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8.
+ If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the
+ locale encoding.
- Use :func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length.
+ .. versionchanged:: 3.2
+ Use ``'strict'`` error handler on Windows.
-.. cfunction:: PyObject* PyUnicode_DecodeFSDefault(const char *s)
- Decode a string using :cdata:`Py_FileSystemDefaultEncoding` and
- the ``"surrogateescape"`` error handler.
+.. c:function:: PyObject* PyUnicode_DecodeFSDefault(const char *s)
- If :cdata:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8.
+ Decode a null-terminated string using :c:data:`Py_FileSystemDefaultEncoding`
+ and the ``'surrogateescape'`` error handler, or ``'strict'`` on Windows.
+
+ If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the
+ locale encoding.
+
+ Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length.
+
+ .. versionchanged:: 3.2
+ Use ``'strict'`` error handler on Windows.
+
+
+.. c:function:: PyObject* PyUnicode_EncodeFSDefault(PyObject *unicode)
+
+ Encode a Unicode object to :c:data:`Py_FileSystemDefaultEncoding` with the
+ ``'surrogateescape'`` error handler, or ``'strict'`` on Windows, and return
+ :class:`bytes`.
+
+ If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the
+ locale encoding.
+
+ .. versionadded:: 3.2
wchar_t Support
"""""""""""""""
-:ctype:`wchar_t` support for platforms which support it:
+:c:type:`wchar_t` support for platforms which support it:
-.. cfunction:: PyObject* PyUnicode_FromWideChar(const wchar_t *w, Py_ssize_t size)
+.. c:function:: PyObject* PyUnicode_FromWideChar(const wchar_t *w, Py_ssize_t size)
- Create a Unicode object from the :ctype:`wchar_t` buffer *w* of the given *size*.
+ Create a Unicode object from the :c:type:`wchar_t` buffer *w* of the given *size*.
Passing -1 as the *size* indicates that the function must itself compute the length,
using wcslen.
Return *NULL* on failure.
-.. cfunction:: Py_ssize_t PyUnicode_AsWideChar(PyUnicodeObject *unicode, wchar_t *w, Py_ssize_t size)
+.. c:function:: Py_ssize_t PyUnicode_AsWideChar(PyUnicodeObject *unicode, wchar_t *w, Py_ssize_t size)
- Copy the Unicode object contents into the :ctype:`wchar_t` buffer *w*. At most
- *size* :ctype:`wchar_t` characters are copied (excluding a possibly trailing
- 0-termination character). Return the number of :ctype:`wchar_t` characters
- copied or -1 in case of an error. Note that the resulting :ctype:`wchar_t`
+ Copy the Unicode object contents into the :c:type:`wchar_t` buffer *w*. At most
+ *size* :c:type:`wchar_t` characters are copied (excluding a possibly trailing
+ 0-termination character). Return the number of :c:type:`wchar_t` characters
+ copied or -1 in case of an error. Note that the resulting :c:type:`wchar_t`
string may or may not be 0-terminated. It is the responsibility of the caller
- to make sure that the :ctype:`wchar_t` string is 0-terminated in case this is
+ to make sure that the :c:type:`wchar_t` string is 0-terminated in case this is
required by the application.
+.. c:function:: wchar_t* PyUnicode_AsWideCharString(PyObject *unicode, Py_ssize_t *size)
+
+ Convert the Unicode object to a wide character string. The output string
+ always ends with a nul character. If *size* is not *NULL*, write the number
+ of wide characters (excluding the trailing 0-termination character) into
+ *\*size*.
+
+ Returns a buffer allocated by :c:func:`PyMem_Alloc` (use :c:func:`PyMem_Free`
+ to free it) on success. On error, returns *NULL*, *\*size* is undefined and
+ raises a :exc:`MemoryError`.
+
+ .. versionadded:: 3.2
+
+
.. _builtincodecs:
Built-in Codecs
@@ -425,8 +507,8 @@ constructor.
Setting encoding to *NULL* causes the default encoding to be used
which is ASCII. The file system calls should use
-:cfunc:`PyUnicode_FSConverter` for encoding file names. This uses the
-variable :cdata:`Py_FileSystemDefaultEncoding` internally. This
+:c:func:`PyUnicode_FSConverter` for encoding file names. This uses the
+variable :c:data:`Py_FileSystemDefaultEncoding` internally. This
variable should be treated as read-only: on some systems, it will be a
pointer to a static string, on others, it will change at run-time
(such as when the application invokes setlocale).
@@ -445,7 +527,7 @@ Generic Codecs
These are the generic codec APIs:
-.. cfunction:: PyObject* PyUnicode_Decode(const char *s, Py_ssize_t size, const char *encoding, const char *errors)
+.. c:function:: PyObject* PyUnicode_Decode(const char *s, Py_ssize_t size, const char *encoding, const char *errors)
Create a Unicode object by decoding *size* bytes of the encoded string *s*.
*encoding* and *errors* have the same meaning as the parameters of the same name
@@ -454,16 +536,16 @@ These are the generic codec APIs:
the codec.
-.. cfunction:: PyObject* PyUnicode_Encode(const Py_UNICODE *s, Py_ssize_t size, const char *encoding, const char *errors)
+.. c:function:: PyObject* PyUnicode_Encode(const Py_UNICODE *s, Py_ssize_t size, const char *encoding, const char *errors)
- Encode the :ctype:`Py_UNICODE` buffer *s* of the given *size* and return a Python
+ Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* and return a Python
bytes object. *encoding* and *errors* have the same meaning as the
parameters of the same name in the Unicode :meth:`encode` method. The codec
to be used is looked up using the Python codec registry. Return *NULL* if an
exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_AsEncodedString(PyObject *unicode, const char *encoding, const char *errors)
+.. c:function:: PyObject* PyUnicode_AsEncodedString(PyObject *unicode, const char *encoding, const char *errors)
Encode a Unicode object and return the result as Python bytes object.
*encoding* and *errors* have the same meaning as the parameters of the same
@@ -478,28 +560,28 @@ UTF-8 Codecs
These are the UTF-8 codec APIs:
-.. cfunction:: PyObject* PyUnicode_DecodeUTF8(const char *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_DecodeUTF8(const char *s, Py_ssize_t size, const char *errors)
Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string
*s*. Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_DecodeUTF8Stateful(const char *s, Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
+.. c:function:: PyObject* PyUnicode_DecodeUTF8Stateful(const char *s, Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
- If *consumed* is *NULL*, behave like :cfunc:`PyUnicode_DecodeUTF8`. If
+ If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeUTF8`. If
*consumed* is not *NULL*, trailing incomplete UTF-8 byte sequences will not be
treated as an error. Those bytes will not be decoded and the number of bytes
that have been decoded will be stored in *consumed*.
-.. cfunction:: PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
- Encode the :ctype:`Py_UNICODE` buffer *s* of the given *size* using UTF-8 and
+ Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* using UTF-8 and
return a Python bytes object. Return *NULL* if an exception was raised by
the codec.
-.. cfunction:: PyObject* PyUnicode_AsUTF8String(PyObject *unicode)
+.. c:function:: PyObject* PyUnicode_AsUTF8String(PyObject *unicode)
Encode a Unicode object using UTF-8 and return the result as Python bytes
object. Error handling is "strict". Return *NULL* if an exception was
@@ -512,7 +594,7 @@ UTF-32 Codecs
These are the UTF-32 codec APIs:
-.. cfunction:: PyObject* PyUnicode_DecodeUTF32(const char *s, Py_ssize_t size, const char *errors, int *byteorder)
+.. c:function:: PyObject* PyUnicode_DecodeUTF32(const char *s, Py_ssize_t size, const char *errors, int *byteorder)
Decode *size* bytes from a UTF-32 encoded buffer string and return the
corresponding Unicode object. *errors* (if non-*NULL*) defines the error
@@ -540,16 +622,16 @@ These are the UTF-32 codec APIs:
Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_DecodeUTF32Stateful(const char *s, Py_ssize_t size, const char *errors, int *byteorder, Py_ssize_t *consumed)
+.. c:function:: PyObject* PyUnicode_DecodeUTF32Stateful(const char *s, Py_ssize_t size, const char *errors, int *byteorder, Py_ssize_t *consumed)
- If *consumed* is *NULL*, behave like :cfunc:`PyUnicode_DecodeUTF32`. If
- *consumed* is not *NULL*, :cfunc:`PyUnicode_DecodeUTF32Stateful` will not treat
+ If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeUTF32`. If
+ *consumed* is not *NULL*, :c:func:`PyUnicode_DecodeUTF32Stateful` will not treat
trailing incomplete UTF-32 byte sequences (such as a number of bytes not divisible
by four) as an error. Those bytes will not be decoded and the number of bytes
that have been decoded will be stored in *consumed*.
-.. cfunction:: PyObject* PyUnicode_EncodeUTF32(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder)
+.. c:function:: PyObject* PyUnicode_EncodeUTF32(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder)
Return a Python bytes object holding the UTF-32 encoded value of the Unicode
data in *s*. Output is written according to the following byte order::
@@ -567,7 +649,7 @@ These are the UTF-32 codec APIs:
Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_AsUTF32String(PyObject *unicode)
+.. c:function:: PyObject* PyUnicode_AsUTF32String(PyObject *unicode)
Return a Python byte string using the UTF-32 encoding in native byte
order. The string always starts with a BOM mark. Error handling is "strict".
@@ -580,7 +662,7 @@ UTF-16 Codecs
These are the UTF-16 codec APIs:
-.. cfunction:: PyObject* PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors, int *byteorder)
+.. c:function:: PyObject* PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors, int *byteorder)
Decode *size* bytes from a UTF-16 encoded buffer string and return the
corresponding Unicode object. *errors* (if non-*NULL*) defines the error
@@ -607,16 +689,16 @@ These are the UTF-16 codec APIs:
Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_DecodeUTF16Stateful(const char *s, Py_ssize_t size, const char *errors, int *byteorder, Py_ssize_t *consumed)
+.. c:function:: PyObject* PyUnicode_DecodeUTF16Stateful(const char *s, Py_ssize_t size, const char *errors, int *byteorder, Py_ssize_t *consumed)
- If *consumed* is *NULL*, behave like :cfunc:`PyUnicode_DecodeUTF16`. If
- *consumed* is not *NULL*, :cfunc:`PyUnicode_DecodeUTF16Stateful` will not treat
+ If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeUTF16`. If
+ *consumed* is not *NULL*, :c:func:`PyUnicode_DecodeUTF16Stateful` will not treat
trailing incomplete UTF-16 byte sequences (such as an odd number of bytes or a
split surrogate pair) as an error. Those bytes will not be decoded and the
number of bytes that have been decoded will be stored in *consumed*.
-.. cfunction:: PyObject* PyUnicode_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder)
+.. c:function:: PyObject* PyUnicode_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder)
Return a Python bytes object holding the UTF-16 encoded value of the Unicode
data in *s*. Output is written according to the following byte order::
@@ -628,14 +710,14 @@ These are the UTF-16 codec APIs:
If byteorder is ``0``, the output string will always start with the Unicode BOM
mark (U+FEFF). In the other two modes, no BOM mark is prepended.
- If *Py_UNICODE_WIDE* is defined, a single :ctype:`Py_UNICODE` value may get
- represented as a surrogate pair. If it is not defined, each :ctype:`Py_UNICODE`
+ If *Py_UNICODE_WIDE* is defined, a single :c:type:`Py_UNICODE` value may get
+ represented as a surrogate pair. If it is not defined, each :c:type:`Py_UNICODE`
values is interpreted as an UCS-2 character.
Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_AsUTF16String(PyObject *unicode)
+.. c:function:: PyObject* PyUnicode_AsUTF16String(PyObject *unicode)
Return a Python byte string using the UTF-16 encoding in native byte
order. The string always starts with a BOM mark. Error handling is "strict".
@@ -648,23 +730,23 @@ UTF-7 Codecs
These are the UTF-7 codec APIs:
-.. cfunction:: PyObject* PyUnicode_DecodeUTF7(const char *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_DecodeUTF7(const char *s, Py_ssize_t size, const char *errors)
Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string
*s*. Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_DecodeUTF7Stateful(const char *s, Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
+.. c:function:: PyObject* PyUnicode_DecodeUTF7Stateful(const char *s, Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
- If *consumed* is *NULL*, behave like :cfunc:`PyUnicode_DecodeUTF7`. If
+ If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeUTF7`. If
*consumed* is not *NULL*, trailing incomplete UTF-7 base-64 sections will not
be treated as an error. Those bytes will not be decoded and the number of
bytes that have been decoded will be stored in *consumed*.
-.. cfunction:: PyObject* PyUnicode_EncodeUTF7(const Py_UNICODE *s, Py_ssize_t size, int base64SetO, int base64WhiteSpace, const char *errors)
+.. c:function:: PyObject* PyUnicode_EncodeUTF7(const Py_UNICODE *s, Py_ssize_t size, int base64SetO, int base64WhiteSpace, const char *errors)
- Encode the :ctype:`Py_UNICODE` buffer of the given size using UTF-7 and
+ Encode the :c:type:`Py_UNICODE` buffer of the given size using UTF-7 and
return a Python bytes object. Return *NULL* if an exception was raised by
the codec.
@@ -680,20 +762,20 @@ Unicode-Escape Codecs
These are the "Unicode Escape" codec APIs:
-.. cfunction:: PyObject* PyUnicode_DecodeUnicodeEscape(const char *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_DecodeUnicodeEscape(const char *s, Py_ssize_t size, const char *errors)
Create a Unicode object by decoding *size* bytes of the Unicode-Escape encoded
string *s*. Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size)
+.. c:function:: PyObject* PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size)
- Encode the :ctype:`Py_UNICODE` buffer of the given size using Unicode-Escape and
+ Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Unicode-Escape and
return a Python string object. Return *NULL* if an exception was raised by the
codec.
-.. cfunction:: PyObject* PyUnicode_AsUnicodeEscapeString(PyObject *unicode)
+.. c:function:: PyObject* PyUnicode_AsUnicodeEscapeString(PyObject *unicode)
Encode a Unicode object using Unicode-Escape and return the result as Python
string object. Error handling is "strict". Return *NULL* if an exception was
@@ -706,20 +788,20 @@ Raw-Unicode-Escape Codecs
These are the "Raw Unicode Escape" codec APIs:
-.. cfunction:: PyObject* PyUnicode_DecodeRawUnicodeEscape(const char *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_DecodeRawUnicodeEscape(const char *s, Py_ssize_t size, const char *errors)
Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape
encoded string *s*. Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
- Encode the :ctype:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-Escape
+ Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-Escape
and return a Python string object. Return *NULL* if an exception was raised by
the codec.
-.. cfunction:: PyObject* PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode)
+.. c:function:: PyObject* PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode)
Encode a Unicode object using Raw-Unicode-Escape and return the result as
Python string object. Error handling is "strict". Return *NULL* if an exception
@@ -733,20 +815,20 @@ These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 Unicode
ordinals and only these are accepted by the codecs during encoding.
-.. cfunction:: PyObject* PyUnicode_DecodeLatin1(const char *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_DecodeLatin1(const char *s, Py_ssize_t size, const char *errors)
Create a Unicode object by decoding *size* bytes of the Latin-1 encoded string
*s*. Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_EncodeLatin1(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_EncodeLatin1(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
- Encode the :ctype:`Py_UNICODE` buffer of the given *size* using Latin-1 and
+ Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Latin-1 and
return a Python bytes object. Return *NULL* if an exception was raised by
the codec.
-.. cfunction:: PyObject* PyUnicode_AsLatin1String(PyObject *unicode)
+.. c:function:: PyObject* PyUnicode_AsLatin1String(PyObject *unicode)
Encode a Unicode object using Latin-1 and return the result as Python bytes
object. Error handling is "strict". Return *NULL* if an exception was
@@ -760,20 +842,20 @@ These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All other
codes generate errors.
-.. cfunction:: PyObject* PyUnicode_DecodeASCII(const char *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_DecodeASCII(const char *s, Py_ssize_t size, const char *errors)
Create a Unicode object by decoding *size* bytes of the ASCII encoded string
*s*. Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_EncodeASCII(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_EncodeASCII(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
- Encode the :ctype:`Py_UNICODE` buffer of the given *size* using ASCII and
+ Encode the :c:type:`Py_UNICODE` buffer of the given *size* using ASCII and
return a Python bytes object. Return *NULL* if an exception was raised by
the codec.
-.. cfunction:: PyObject* PyUnicode_AsASCIIString(PyObject *unicode)
+.. c:function:: PyObject* PyUnicode_AsASCIIString(PyObject *unicode)
Encode a Unicode object using ASCII and return the result as Python bytes
object. Error handling is "strict". Return *NULL* if an exception was
@@ -806,7 +888,7 @@ characters to different code points.
These are the mapping codec APIs:
-.. cfunction:: PyObject* PyUnicode_DecodeCharmap(const char *s, Py_ssize_t size, PyObject *mapping, const char *errors)
+.. c:function:: PyObject* PyUnicode_DecodeCharmap(const char *s, Py_ssize_t size, PyObject *mapping, const char *errors)
Create a Unicode object by decoding *size* bytes of the encoded string *s* using
the given *mapping* object. Return *NULL* if an exception was raised by the
@@ -816,14 +898,14 @@ These are the mapping codec APIs:
treated as "undefined mapping".
-.. cfunction:: PyObject* PyUnicode_EncodeCharmap(const Py_UNICODE *s, Py_ssize_t size, PyObject *mapping, const char *errors)
+.. c:function:: PyObject* PyUnicode_EncodeCharmap(const Py_UNICODE *s, Py_ssize_t size, PyObject *mapping, const char *errors)
- Encode the :ctype:`Py_UNICODE` buffer of the given *size* using the given
+ Encode the :c:type:`Py_UNICODE` buffer of the given *size* using the given
*mapping* object and return a Python string object. Return *NULL* if an
exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_AsCharmapString(PyObject *unicode, PyObject *mapping)
+.. c:function:: PyObject* PyUnicode_AsCharmapString(PyObject *unicode, PyObject *mapping)
Encode a Unicode object using the given *mapping* object and return the result
as Python string object. Error handling is "strict". Return *NULL* if an
@@ -832,9 +914,9 @@ These are the mapping codec APIs:
The following codec API is special in that maps Unicode to Unicode.
-.. cfunction:: PyObject* PyUnicode_TranslateCharmap(const Py_UNICODE *s, Py_ssize_t size, PyObject *table, const char *errors)
+.. c:function:: PyObject* PyUnicode_TranslateCharmap(const Py_UNICODE *s, Py_ssize_t size, PyObject *table, const char *errors)
- Translate a :ctype:`Py_UNICODE` buffer of the given *size* by applying a
+ Translate a :c:type:`Py_UNICODE` buffer of the given *size* by applying a
character mapping *table* to it and return the resulting Unicode object. Return
*NULL* when an exception was raised by the codec.
@@ -846,6 +928,7 @@ The following codec API is special in that maps Unicode to Unicode.
:exc:`LookupError`) are left untouched and are copied as-is.
+
MBCS codecs for Windows
"""""""""""""""""""""""
@@ -854,29 +937,28 @@ use the Win32 MBCS converters to implement the conversions. Note that MBCS (or
DBCS) is a class of encodings, not just one. The target encoding is defined by
the user settings on the machine running the codec.
-
-.. cfunction:: PyObject* PyUnicode_DecodeMBCS(const char *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_DecodeMBCS(const char *s, Py_ssize_t size, const char *errors)
Create a Unicode object by decoding *size* bytes of the MBCS encoded string *s*.
Return *NULL* if an exception was raised by the codec.
-.. cfunction:: PyObject* PyUnicode_DecodeMBCSStateful(const char *s, int size, const char *errors, int *consumed)
+.. c:function:: PyObject* PyUnicode_DecodeMBCSStateful(const char *s, int size, const char *errors, int *consumed)
- If *consumed* is *NULL*, behave like :cfunc:`PyUnicode_DecodeMBCS`. If
- *consumed* is not *NULL*, :cfunc:`PyUnicode_DecodeMBCSStateful` will not decode
+ If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeMBCS`. If
+ *consumed* is not *NULL*, :c:func:`PyUnicode_DecodeMBCSStateful` will not decode
trailing lead byte and the number of bytes that have been decoded will be stored
in *consumed*.
-.. cfunction:: PyObject* PyUnicode_EncodeMBCS(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
+.. c:function:: PyObject* PyUnicode_EncodeMBCS(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
- Encode the :ctype:`Py_UNICODE` buffer of the given *size* using MBCS and return
+ Encode the :c:type:`Py_UNICODE` buffer of the given *size* using MBCS and return
a Python bytes object. Return *NULL* if an exception was raised by the
codec.
-.. cfunction:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode)
+.. c:function:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode)
Encode a Unicode object using MBCS and return the result as Python bytes
object. Error handling is "strict". Return *NULL* if an exception was
@@ -899,12 +981,12 @@ integers as appropriate.
They all return *NULL* or ``-1`` if an exception occurs.
-.. cfunction:: PyObject* PyUnicode_Concat(PyObject *left, PyObject *right)
+.. c:function:: PyObject* PyUnicode_Concat(PyObject *left, PyObject *right)
Concat two strings giving a new Unicode string.
-.. cfunction:: PyObject* PyUnicode_Split(PyObject *s, PyObject *sep, Py_ssize_t maxsplit)
+.. c:function:: PyObject* PyUnicode_Split(PyObject *s, PyObject *sep, Py_ssize_t maxsplit)
Split a string giving a list of Unicode strings. If *sep* is *NULL*, splitting
will be done at all whitespace substrings. Otherwise, splits occur at the given
@@ -912,14 +994,14 @@ They all return *NULL* or ``-1`` if an exception occurs.
set. Separators are not included in the resulting list.
-.. cfunction:: PyObject* PyUnicode_Splitlines(PyObject *s, int keepend)
+.. c:function:: PyObject* PyUnicode_Splitlines(PyObject *s, int keepend)
Split a Unicode string at line breaks, returning a list of Unicode strings.
CRLF is considered to be one line break. If *keepend* is 0, the Line break
characters are not included in the resulting strings.
-.. cfunction:: PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)
+.. c:function:: PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)
Translate a string by applying a character mapping table to it and return the
resulting Unicode object.
@@ -935,20 +1017,20 @@ They all return *NULL* or ``-1`` if an exception occurs.
use the default error handling.
-.. cfunction:: PyObject* PyUnicode_Join(PyObject *separator, PyObject *seq)
+.. c:function:: PyObject* PyUnicode_Join(PyObject *separator, PyObject *seq)
Join a sequence of strings using the given *separator* and return the resulting
Unicode string.
-.. cfunction:: int PyUnicode_Tailmatch(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end, int direction)
+.. c:function:: int PyUnicode_Tailmatch(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end, int direction)
Return 1 if *substr* matches ``str[start:end]`` at the given tail end
(*direction* == -1 means to do a prefix match, *direction* == 1 a suffix match),
0 otherwise. Return ``-1`` if an error occurred.
-.. cfunction:: Py_ssize_t PyUnicode_Find(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end, int direction)
+.. c:function:: Py_ssize_t PyUnicode_Find(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end, int direction)
Return the first position of *substr* in ``str[start:end]`` using the given
*direction* (*direction* == 1 means to do a forward search, *direction* == -1 a
@@ -957,32 +1039,34 @@ They all return *NULL* or ``-1`` if an exception occurs.
occurred and an exception has been set.
-.. cfunction:: Py_ssize_t PyUnicode_Count(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end)
+.. c:function:: Py_ssize_t PyUnicode_Count(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end)
Return the number of non-overlapping occurrences of *substr* in
``str[start:end]``. Return ``-1`` if an error occurred.
-.. cfunction:: PyObject* PyUnicode_Replace(PyObject *str, PyObject *substr, PyObject *replstr, Py_ssize_t maxcount)
+.. c:function:: PyObject* PyUnicode_Replace(PyObject *str, PyObject *substr, PyObject *replstr, Py_ssize_t maxcount)
Replace at most *maxcount* occurrences of *substr* in *str* with *replstr* and
return the resulting Unicode object. *maxcount* == -1 means replace all
occurrences.
-.. cfunction:: int PyUnicode_Compare(PyObject *left, PyObject *right)
+.. c:function:: int PyUnicode_Compare(PyObject *left, PyObject *right)
Compare two strings and return -1, 0, 1 for less than, equal, and greater than,
respectively.
-.. cfunction:: int PyUnicode_CompareWithASCIIString(PyObject *uni, char *string)
+.. c:function:: int PyUnicode_CompareWithASCIIString(PyObject *uni, char *string)
Compare a unicode object, *uni*, with *string* and return -1, 0, 1 for less
- than, equal, and greater than, respectively.
+ than, equal, and greater than, respectively. It is best to pass only
+ ASCII-encoded strings, but the function interprets the input string as
+ ISO-8859-1 if it contains non-ASCII characters".
-.. cfunction:: int PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
+.. c:function:: int PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
Rich compare two unicode strings and return one of the following:
@@ -998,13 +1082,13 @@ They all return *NULL* or ``-1`` if an exception occurs.
:const:`Py_NE`, :const:`Py_LT`, and :const:`Py_LE`.
-.. cfunction:: PyObject* PyUnicode_Format(PyObject *format, PyObject *args)
+.. c:function:: PyObject* PyUnicode_Format(PyObject *format, PyObject *args)
Return a new string object from *format* and *args*; this is analogous to
``format % args``. The *args* argument must be a tuple.
-.. cfunction:: int PyUnicode_Contains(PyObject *container, PyObject *element)
+.. c:function:: int PyUnicode_Contains(PyObject *container, PyObject *element)
Check whether *element* is contained in *container* and return true or false
accordingly.
@@ -1013,7 +1097,7 @@ They all return *NULL* or ``-1`` if an exception occurs.
there was an error.
-.. cfunction:: void PyUnicode_InternInPlace(PyObject **string)
+.. c:function:: void PyUnicode_InternInPlace(PyObject **string)
Intern the argument *\*string* in place. The argument must be the address of a
pointer variable pointing to a Python unicode string object. If there is an
@@ -1026,10 +1110,10 @@ They all return *NULL* or ``-1`` if an exception occurs.
if and only if you owned it before the call.)
-.. cfunction:: PyObject* PyUnicode_InternFromString(const char *v)
+.. c:function:: PyObject* PyUnicode_InternFromString(const char *v)
- A combination of :cfunc:`PyUnicode_FromString` and
- :cfunc:`PyUnicode_InternInPlace`, returning either a new unicode string object
+ A combination of :c:func:`PyUnicode_FromString` and
+ :c:func:`PyUnicode_InternInPlace`, returning either a new unicode string object
that has been interned, or a new ("owned") reference to an earlier interned
string object with the same value.
diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst
index 66789a963d..26e07160c1 100644
--- a/Doc/c-api/veryhigh.rst
+++ b/Doc/c-api/veryhigh.rst
@@ -16,21 +16,21 @@ parameter. The available start symbols are :const:`Py_eval_input`,
:const:`Py_file_input`, and :const:`Py_single_input`. These are described
following the functions which accept them as parameters.
-Note also that several of these functions take :ctype:`FILE\*` parameters. One
-particular issue which needs to be handled carefully is that the :ctype:`FILE`
+Note also that several of these functions take :c:type:`FILE\*` parameters. One
+particular issue which needs to be handled carefully is that the :c:type:`FILE`
structure for different C libraries can be different and incompatible. Under
Windows (at least), it is possible for dynamically linked extensions to actually
-use different libraries, so care should be taken that :ctype:`FILE\*` parameters
+use different libraries, so care should be taken that :c:type:`FILE\*` parameters
are only passed to these functions if it is certain that they were created by
the same library that the Python runtime is using.
-.. cfunction:: int Py_Main(int argc, wchar_t **argv)
+.. c:function:: int Py_Main(int argc, wchar_t **argv)
The main program for the standard interpreter. This is made
available for programs which embed Python. The *argc* and *argv*
parameters should be prepared exactly as those which are passed to
- a C program's :cfunc:`main` function (converted to wchar_t
+ a C program's :c:func:`main` function (converted to wchar_t
according to the user's locale). It is important to note that the
argument list may be modified (but the contents of the strings
pointed to by the argument list are not). The return value will be
@@ -43,40 +43,41 @@ the same library that the Python runtime is using.
``Py_InspectFlag`` is not set.
-.. cfunction:: int PyRun_AnyFile(FILE *fp, const char *filename)
+.. c:function:: int PyRun_AnyFile(FILE *fp, const char *filename)
- This is a simplified interface to :cfunc:`PyRun_AnyFileExFlags` below, leaving
+ This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, leaving
*closeit* set to ``0`` and *flags* set to *NULL*.
-.. cfunction:: int PyRun_AnyFileFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
+.. c:function:: int PyRun_AnyFileFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
- This is a simplified interface to :cfunc:`PyRun_AnyFileExFlags` below, leaving
+ This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, leaving
the *closeit* argument set to ``0``.
-.. cfunction:: int PyRun_AnyFileEx(FILE *fp, const char *filename, int closeit)
+.. c:function:: int PyRun_AnyFileEx(FILE *fp, const char *filename, int closeit)
- This is a simplified interface to :cfunc:`PyRun_AnyFileExFlags` below, leaving
+ This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, leaving
the *flags* argument set to *NULL*.
-.. cfunction:: int PyRun_AnyFileExFlags(FILE *fp, const char *filename, int closeit, PyCompilerFlags *flags)
+.. c:function:: int PyRun_AnyFileExFlags(FILE *fp, const char *filename, int closeit, PyCompilerFlags *flags)
If *fp* refers to a file associated with an interactive device (console or
terminal input or Unix pseudo-terminal), return the value of
- :cfunc:`PyRun_InteractiveLoop`, otherwise return the result of
- :cfunc:`PyRun_SimpleFile`. If *filename* is *NULL*, this function uses
- ``"???"`` as the filename.
+ :c:func:`PyRun_InteractiveLoop`, otherwise return the result of
+ :c:func:`PyRun_SimpleFile`. *filename* is decoded from the filesystem
+ encoding (:func:`sys.getfilesystemencoding`). If *filename* is *NULL*, this
+ function uses ``"???"`` as the filename.
-.. cfunction:: int PyRun_SimpleString(const char *command)
+.. c:function:: int PyRun_SimpleString(const char *command)
- This is a simplified interface to :cfunc:`PyRun_SimpleStringFlags` below,
+ This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below,
leaving the *PyCompilerFlags\** argument set to NULL.
-.. cfunction:: int PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags)
+.. c:function:: int PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags)
Executes the Python source code from *command* in the :mod:`__main__` module
according to the *flags* argument. If :mod:`__main__` does not already exist, it
@@ -89,103 +90,109 @@ the same library that the Python runtime is using.
``Py_InspectFlag`` is not set.
-.. cfunction:: int PyRun_SimpleFile(FILE *fp, const char *filename)
+.. c:function:: int PyRun_SimpleFile(FILE *fp, const char *filename)
- This is a simplified interface to :cfunc:`PyRun_SimpleFileExFlags` below,
+ This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below,
leaving *closeit* set to ``0`` and *flags* set to *NULL*.
-.. cfunction:: int PyRun_SimpleFileFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
+.. c:function:: int PyRun_SimpleFileFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
- This is a simplified interface to :cfunc:`PyRun_SimpleFileExFlags` below,
+ This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below,
leaving *closeit* set to ``0``.
-.. cfunction:: int PyRun_SimpleFileEx(FILE *fp, const char *filename, int closeit)
+.. c:function:: int PyRun_SimpleFileEx(FILE *fp, const char *filename, int closeit)
- This is a simplified interface to :cfunc:`PyRun_SimpleFileExFlags` below,
+ This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below,
leaving *flags* set to *NULL*.
-.. cfunction:: int PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit, PyCompilerFlags *flags)
+.. c:function:: int PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit, PyCompilerFlags *flags)
- Similar to :cfunc:`PyRun_SimpleStringFlags`, but the Python source code is read
- from *fp* instead of an in-memory string. *filename* should be the name of the
- file. If *closeit* is true, the file is closed before PyRun_SimpleFileExFlags
- returns.
+ Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is read
+ from *fp* instead of an in-memory string. *filename* should be the name of
+ the file, it is decoded from the filesystem encoding
+ (:func:`sys.getfilesystemencoding`). If *closeit* is true, the file is
+ closed before PyRun_SimpleFileExFlags returns.
-.. cfunction:: int PyRun_InteractiveOne(FILE *fp, const char *filename)
+.. c:function:: int PyRun_InteractiveOne(FILE *fp, const char *filename)
- This is a simplified interface to :cfunc:`PyRun_InteractiveOneFlags` below,
+ This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below,
leaving *flags* set to *NULL*.
-.. cfunction:: int PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
+.. c:function:: int PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
Read and execute a single statement from a file associated with an
interactive device according to the *flags* argument. The user will be
- prompted using ``sys.ps1`` and ``sys.ps2``. Returns ``0`` when the input was
+ prompted using ``sys.ps1`` and ``sys.ps2``. *filename* is decoded from the
+ filesystem encoding (:func:`sys.getfilesystemencoding`).
+
+ Returns ``0`` when the input was
executed successfully, ``-1`` if there was an exception, or an error code
from the :file:`errcode.h` include file distributed as part of Python if
there was a parse error. (Note that :file:`errcode.h` is not included by
:file:`Python.h`, so must be included specifically if needed.)
-.. cfunction:: int PyRun_InteractiveLoop(FILE *fp, const char *filename)
+.. c:function:: int PyRun_InteractiveLoop(FILE *fp, const char *filename)
- This is a simplified interface to :cfunc:`PyRun_InteractiveLoopFlags` below,
+ This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` below,
leaving *flags* set to *NULL*.
-.. cfunction:: int PyRun_InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
+.. c:function:: int PyRun_InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
Read and execute statements from a file associated with an interactive device
until EOF is reached. The user will be prompted using ``sys.ps1`` and
- ``sys.ps2``. Returns ``0`` at EOF.
+ ``sys.ps2``. *filename* is decoded from the filesystem encoding
+ (:func:`sys.getfilesystemencoding`). Returns ``0`` at EOF.
-.. cfunction:: struct _node* PyParser_SimpleParseString(const char *str, int start)
+.. c:function:: struct _node* PyParser_SimpleParseString(const char *str, int start)
This is a simplified interface to
- :cfunc:`PyParser_SimpleParseStringFlagsFilename` below, leaving *filename* set
+ :c:func:`PyParser_SimpleParseStringFlagsFilename` below, leaving *filename* set
to *NULL* and *flags* set to ``0``.
-.. cfunction:: struct _node* PyParser_SimpleParseStringFlags( const char *str, int start, int flags)
+.. c:function:: struct _node* PyParser_SimpleParseStringFlags( const char *str, int start, int flags)
This is a simplified interface to
- :cfunc:`PyParser_SimpleParseStringFlagsFilename` below, leaving *filename* set
+ :c:func:`PyParser_SimpleParseStringFlagsFilename` below, leaving *filename* set
to *NULL*.
-.. cfunction:: struct _node* PyParser_SimpleParseStringFlagsFilename( const char *str, const char *filename, int start, int flags)
+.. c:function:: struct _node* PyParser_SimpleParseStringFlagsFilename( const char *str, const char *filename, int start, int flags)
Parse Python source code from *str* using the start token *start* according to
the *flags* argument. The result can be used to create a code object which can
be evaluated efficiently. This is useful if a code fragment must be evaluated
- many times.
+ many times. *filename* is decoded from the filesystem encoding
+ (:func:`sys.getfilesystemencoding`).
-.. cfunction:: struct _node* PyParser_SimpleParseFile(FILE *fp, const char *filename, int start)
+.. c:function:: struct _node* PyParser_SimpleParseFile(FILE *fp, const char *filename, int start)
- This is a simplified interface to :cfunc:`PyParser_SimpleParseFileFlags` below,
+ This is a simplified interface to :c:func:`PyParser_SimpleParseFileFlags` below,
leaving *flags* set to ``0``
-.. cfunction:: struct _node* PyParser_SimpleParseFileFlags(FILE *fp, const char *filename, int start, int flags)
+.. c:function:: struct _node* PyParser_SimpleParseFileFlags(FILE *fp, const char *filename, int start, int flags)
- Similar to :cfunc:`PyParser_SimpleParseStringFlagsFilename`, but the Python
+ Similar to :c:func:`PyParser_SimpleParseStringFlagsFilename`, but the Python
source code is read from *fp* instead of an in-memory string.
-.. cfunction:: PyObject* PyRun_String(const char *str, int start, PyObject *globals, PyObject *locals)
+.. c:function:: PyObject* PyRun_String(const char *str, int start, PyObject *globals, PyObject *locals)
- This is a simplified interface to :cfunc:`PyRun_StringFlags` below, leaving
+ This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving
*flags* set to *NULL*.
-.. cfunction:: PyObject* PyRun_StringFlags(const char *str, int start, PyObject *globals, PyObject *locals, PyCompilerFlags *flags)
+.. c:function:: PyObject* PyRun_StringFlags(const char *str, int start, PyObject *globals, PyObject *locals, PyCompilerFlags *flags)
Execute Python source code from *str* in the context specified by the
dictionaries *globals* and *locals* with the compiler flags specified by
@@ -196,57 +203,73 @@ the same library that the Python runtime is using.
exception was raised.
-.. cfunction:: PyObject* PyRun_File(FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals)
+.. c:function:: PyObject* PyRun_File(FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals)
- This is a simplified interface to :cfunc:`PyRun_FileExFlags` below, leaving
+ This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving
*closeit* set to ``0`` and *flags* set to *NULL*.
-.. cfunction:: PyObject* PyRun_FileEx(FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals, int closeit)
+.. c:function:: PyObject* PyRun_FileEx(FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals, int closeit)
- This is a simplified interface to :cfunc:`PyRun_FileExFlags` below, leaving
+ This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving
*flags* set to *NULL*.
-.. cfunction:: PyObject* PyRun_FileFlags(FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals, PyCompilerFlags *flags)
+.. c:function:: PyObject* PyRun_FileFlags(FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals, PyCompilerFlags *flags)
- This is a simplified interface to :cfunc:`PyRun_FileExFlags` below, leaving
+ This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving
*closeit* set to ``0``.
-.. cfunction:: PyObject* PyRun_FileExFlags(FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals, int closeit, PyCompilerFlags *flags)
+.. c:function:: PyObject* PyRun_FileExFlags(FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals, int closeit, PyCompilerFlags *flags)
- Similar to :cfunc:`PyRun_StringFlags`, but the Python source code is read from
- *fp* instead of an in-memory string. *filename* should be the name of the file.
- If *closeit* is true, the file is closed before :cfunc:`PyRun_FileExFlags`
+ Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read from
+ *fp* instead of an in-memory string. *filename* should be the name of the file,
+ it is decoded from the filesystem encoding (:func:`sys.getfilesystemencoding`).
+ If *closeit* is true, the file is closed before :c:func:`PyRun_FileExFlags`
returns.
-.. cfunction:: PyObject* Py_CompileString(const char *str, const char *filename, int start)
+.. c:function:: PyObject* Py_CompileString(const char *str, const char *filename, int start)
- This is a simplified interface to :cfunc:`Py_CompileStringFlags` below, leaving
+ This is a simplified interface to :c:func:`Py_CompileStringFlags` below, leaving
*flags* set to *NULL*.
-.. cfunction:: PyObject* Py_CompileStringFlags(const char *str, const char *filename, int start, PyCompilerFlags *flags)
+.. c:function:: PyObject* Py_CompileStringFlags(const char *str, const char *filename, int start, PyCompilerFlags *flags)
+
+ This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, with
+ *optimize* set to ``-1``.
+
+
+.. c:function:: PyObject* Py_CompileStringExFlags(const char *str, const char *filename, int start, PyCompilerFlags *flags, int optimize)
Parse and compile the Python source code in *str*, returning the resulting code
object. The start token is given by *start*; this can be used to constrain the
code which can be compiled and should be :const:`Py_eval_input`,
:const:`Py_file_input`, or :const:`Py_single_input`. The filename specified by
*filename* is used to construct the code object and may appear in tracebacks or
- :exc:`SyntaxError` exception messages. This returns *NULL* if the code cannot
- be parsed or compiled.
+ :exc:`SyntaxError` exception messages, it is decoded from the filesystem
+ encoding (:func:`sys.getfilesystemencoding`). This returns *NULL* if the
+ code cannot be parsed or compiled.
+
+ The integer *optimize* specifies the optimization level of the compiler; a
+ value of ``-1`` selects the optimization level of the interpreter as given by
+ :option:`-O` options. Explicit levels are ``0`` (no optimization;
+ ``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false)
+ or ``2`` (docstrings are removed too).
+
+ .. versionadded:: 3.2
-.. cfunction:: PyObject* PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
+.. c:function:: PyObject* PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals)
- This is a simplified interface to :cfunc:`PyEval_EvalCodeEx`, with just
+ This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just
the code object, and the dictionaries of global and local variables.
The other arguments are set to *NULL*.
-.. cfunction:: PyObject* PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argcount, PyObject **kws, int kwcount, PyObject **defs, int defcount, PyObject *closure)
+.. c:function:: PyObject* PyEval_EvalCodeEx(PyObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argcount, PyObject **kws, int kwcount, PyObject **defs, int defcount, PyObject *closure)
Evaluate a precompiled code object, given a particular environment for its
evaluation. This environment consists of dictionaries of global and local
@@ -254,13 +277,13 @@ the same library that the Python runtime is using.
cells.
-.. cfunction:: PyObject* PyEval_EvalFrame(PyFrameObject *f)
+.. c:function:: PyObject* PyEval_EvalFrame(PyFrameObject *f)
Evaluate an execution frame. This is a simplified interface to
PyEval_EvalFrameEx, for backward compatibility.
-.. cfunction:: PyObject* PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
+.. c:function:: PyObject* PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
This is the main, unvarnished function of Python interpretation. It is
literally 2000 lines long. The code object associated with the execution
@@ -270,39 +293,39 @@ the same library that the Python runtime is using.
:meth:`throw` methods of generator objects.
-.. cfunction:: int PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
+.. c:function:: int PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
This function changes the flags of the current evaluation frame, and returns
true on success, false on failure.
-.. cvar:: int Py_eval_input
+.. c:var:: int Py_eval_input
.. index:: single: Py_CompileString()
The start symbol from the Python grammar for isolated expressions; for use with
- :cfunc:`Py_CompileString`.
+ :c:func:`Py_CompileString`.
-.. cvar:: int Py_file_input
+.. c:var:: int Py_file_input
.. index:: single: Py_CompileString()
The start symbol from the Python grammar for sequences of statements as read
- from a file or other source; for use with :cfunc:`Py_CompileString`. This is
+ from a file or other source; for use with :c:func:`Py_CompileString`. This is
the symbol to use when compiling arbitrarily long Python source code.
-.. cvar:: int Py_single_input
+.. c:var:: int Py_single_input
.. index:: single: Py_CompileString()
The start symbol from the Python grammar for a single statement; for use with
- :cfunc:`Py_CompileString`. This is the symbol used for the interactive
+ :c:func:`Py_CompileString`. This is the symbol used for the interactive
interpreter loop.
-.. ctype:: struct PyCompilerFlags
+.. c:type:: struct PyCompilerFlags
This is the structure used to hold compiler flags. In cases where code is only
being compiled, it is passed as ``int flags``, and in cases where code is being
@@ -318,7 +341,7 @@ the same library that the Python runtime is using.
}
-.. cvar:: int CO_FUTURE_DIVISION
+.. c:var:: int CO_FUTURE_DIVISION
This bit can be set in *flags* to cause division operator ``/`` to be
interpreted as "true division" according to :pep:`238`.
diff --git a/Doc/c-api/weakref.rst b/Doc/c-api/weakref.rst
index 8a36110386..6b053c8692 100644
--- a/Doc/c-api/weakref.rst
+++ b/Doc/c-api/weakref.rst
@@ -11,22 +11,22 @@ simple reference object, and the second acts as a proxy for the original object
as much as it can.
-.. cfunction:: int PyWeakref_Check(ob)
+.. c:function:: int PyWeakref_Check(ob)
Return true if *ob* is either a reference or proxy object.
-.. cfunction:: int PyWeakref_CheckRef(ob)
+.. c:function:: int PyWeakref_CheckRef(ob)
Return true if *ob* is a reference object.
-.. cfunction:: int PyWeakref_CheckProxy(ob)
+.. c:function:: int PyWeakref_CheckProxy(ob)
Return true if *ob* is a proxy object.
-.. cfunction:: PyObject* PyWeakref_NewRef(PyObject *ob, PyObject *callback)
+.. c:function:: PyObject* PyWeakref_NewRef(PyObject *ob, PyObject *callback)
Return a weak reference object for the object *ob*. This will always return
a new reference, but is not guaranteed to create a new object; an existing
@@ -38,7 +38,7 @@ as much as it can.
*NULL*, this will return *NULL* and raise :exc:`TypeError`.
-.. cfunction:: PyObject* PyWeakref_NewProxy(PyObject *ob, PyObject *callback)
+.. c:function:: PyObject* PyWeakref_NewProxy(PyObject *ob, PyObject *callback)
Return a weak reference proxy object for the object *ob*. This will always
return a new reference, but is not guaranteed to create a new object; an
@@ -50,7 +50,7 @@ as much as it can.
``None``, or *NULL*, this will return *NULL* and raise :exc:`TypeError`.
-.. cfunction:: PyObject* PyWeakref_GetObject(PyObject *ref)
+.. c:function:: PyObject* PyWeakref_GetObject(PyObject *ref)
Return the referenced object from a weak reference, *ref*. If the referent is
no longer live, returns :const:`Py_None`.
@@ -58,12 +58,12 @@ as much as it can.
.. warning::
This function returns a **borrowed reference** to the referenced object.
- This means that you should always call :cfunc:`Py_INCREF` on the object
+ This means that you should always call :c:func:`Py_INCREF` on the object
except if you know that it cannot be destroyed while you are still
using it.
-.. cfunction:: PyObject* PyWeakref_GET_OBJECT(PyObject *ref)
+.. c:function:: PyObject* PyWeakref_GET_OBJECT(PyObject *ref)
- Similar to :cfunc:`PyWeakref_GetObject`, but implemented as a macro that does no
+ Similar to :c:func:`PyWeakref_GetObject`, but implemented as a macro that does no
error checking.
diff --git a/Doc/conf.py b/Doc/conf.py
index 5939f7a907..ce64f06198 100644
--- a/Doc/conf.py
+++ b/Doc/conf.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Python documentation build configuration file
#
@@ -66,6 +65,9 @@ highlight_language = 'python3'
# Options for HTML output
# -----------------------
+html_theme = 'default'
+html_theme_options = {'collapsiblesidebar': True}
+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
@@ -86,7 +88,7 @@ html_additional_pages = {
}
# Output an OpenSearch description file.
-html_use_opensearch = 'http://docs.python.org/3.1'
+html_use_opensearch = 'http://docs.python.org/dev/py3k'
# Additional static files.
html_static_path = ['tools/sphinxext/static']
@@ -154,7 +156,7 @@ latex_preamble = r'''
latex_appendices = ['glossary', 'about', 'license', 'copyright']
# Get LaTeX to handle Unicode correctly
-latex_elements = {'inputenc': r'\usepackage[utf8x]{inputenc}'}
+latex_elements = {'inputenc': r'\usepackage[utf8x]{inputenc}', 'utf8extra': ''}
# Options for the coverage checker
# --------------------------------
diff --git a/Doc/copyright.rst b/Doc/copyright.rst
index 893b541b22..ff6b677252 100644
--- a/Doc/copyright.rst
+++ b/Doc/copyright.rst
@@ -4,7 +4,7 @@ Copyright
Python and this documentation is:
-Copyright © 2001-2010 Python Software Foundation. All rights reserved.
+Copyright © 2001-2011 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved.
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
index dc058d54ee..f2a87670db 100644
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -281,6 +281,12 @@ PyErr_NewException:char*:name::
PyErr_NewException:PyObject*:base:0:
PyErr_NewException:PyObject*:dict:0:
+PyErr_NewExceptionWithDoc:PyObject*::+1:
+PyErr_NewExceptionWithDoc:char*:name::
+PyErr_NewExceptionWithDoc:char*:doc::
+PyErr_NewExceptionWithDoc:PyObject*:base:0:
+PyErr_NewExceptionWithDoc:PyObject*:dict:0:
+
PyErr_NoMemory:PyObject*::null:
PyErr_NormalizeException:void:::
@@ -493,6 +499,11 @@ PyImport_ExecCodeModule:PyObject*::+1:
PyImport_ExecCodeModule:char*:name::
PyImport_ExecCodeModule:PyObject*:co:0:
+PyImport_ExecCodeModuleEx:PyObject*::+1:
+PyImport_ExecCodeModuleEx:char*:name::
+PyImport_ExecCodeModuleEx:PyObject*:co:0:
+PyImport_ExecCodeModuleEx:char*:pathname::
+
PyImport_GetMagicNumber:long:::
PyImport_GetModuleDict:PyObject*::0:
@@ -512,6 +523,13 @@ PyImport_ImportModuleEx:PyObject*:globals:0:???
PyImport_ImportModuleEx:PyObject*:locals:0:???
PyImport_ImportModuleEx:PyObject*:fromlist:0:???
+PyImport_ImportModuleLevel:PyObject*::+1:
+PyImport_ImportModuleLevel:char*:name::
+PyImport_ImportModuleLevel:PyObject*:globals:0:???
+PyImport_ImportModuleLevel:PyObject*:locals:0:???
+PyImport_ImportModuleLevel:PyObject*:fromlist:0:???
+PyImport_ImportModuleLevel:int:level::
+
PyImport_ReloadModule:PyObject*::+1:
PyImport_ReloadModule:PyObject*:m:0:
@@ -828,9 +846,6 @@ PyNumber_InPlaceXor:PyObject*::+1:
PyNumber_InPlaceXor:PyObject*:v:0:
PyNumber_InPlaceXor:PyObject*:w:0:
-PyNumber_Int:PyObject*::+1:
-PyNumber_Int:PyObject*:o:0:
-
PyNumber_Invert:PyObject*::+1:
PyNumber_Invert:PyObject*:o:0:
@@ -1290,6 +1305,9 @@ PyString_AsEncodedString:const char*:errors::
PySys_AddWarnOption:void:::
PySys_AddWarnOption:char*:s::
+PySys_AddXOption:void:::
+PySys_AddXOption:const wchar_t*:s::
+
PySys_GetFile:FILE*:::
PySys_GetFile:char*:name::
PySys_GetFile:FILE*:def::
@@ -1297,6 +1315,8 @@ PySys_GetFile:FILE*:def::
PySys_GetObject:PyObject*::0:
PySys_GetObject:char*:name::
+PySys_GetXOptions:PyObject*::0:
+
PySys_SetArgv:int:::
PySys_SetArgv:int:argc::
PySys_SetArgv:char**:argv::
diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst
index 81de1ad1ea..a7dc68e3a9 100644
--- a/Doc/distutils/apiref.rst
+++ b/Doc/distutils/apiref.rst
@@ -147,11 +147,11 @@ setup script). Indirectly provides the :class:`distutils.dist.Distribution` and
In addition, the :mod:`distutils.core` module exposed a number of classes that
live elsewhere.
-* :class:`~distutils.extension.Extension` from :mod:`distutils.extension`
+* :class:`Extension` from :mod:`distutils.extension`
-* :class:`~distutils.cmd.Command` from :mod:`distutils.cmd`
+* :class:`Command` from :mod:`distutils.cmd`
-* :class:`~distutils.dist.Distribution` from :mod:`distutils.dist`
+* :class:`Distribution` from :mod:`distutils.dist`
A short description of each of these follows, but see the relevant module for
the full reference.
@@ -1311,8 +1311,7 @@ provides the following additional features:
the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the
command line sets *verbose* to false.
-.. XXX Should be replaced with :mod:`optparse`.
-
+.. XXX Should be replaced with optparse
.. function:: fancy_getopt(options, negative_opt, object, args)
@@ -1679,8 +1678,8 @@ lines, and joining lines with backslashes.
===================================================================
.. module:: distutils.cmd
- :synopsis: This module provides the abstract base class Command. This class
- is subclassed by the modules in the distutils.command subpackage.
+ :synopsis: This module provides the abstract base class Command. This class is subclassed
+ by the modules in the distutils.command subpackage.
This module supplies the abstract base class :class:`Command`.
@@ -1690,84 +1689,20 @@ This module supplies the abstract base class :class:`Command`.
Abstract base class for defining command classes, the "worker bees" of the
Distutils. A useful analogy for command classes is to think of them as
- subroutines with local variables called *options*. The options are declared
- in :meth:`initialize_options` and defined (given their final values) in
- :meth:`finalize_options`, both of which must be defined by every command
- class. The distinction between the two is necessary because option values
- might come from the outside world (command line, config file, ...), and any
- options dependent on other options must be computed after these outside
- influences have been processed --- hence :meth:`finalize_options`. The body
- of the subroutine, where it does all its work based on the values of its
- options, is the :meth:`run` method, which must also be implemented by every
- command class.
-
- The class constructor takes a single argument *dist*, a :class:`Distribution`
+ subroutines with local variables called *options*. The options are declared in
+ :meth:`initialize_options` and defined (given their final values) in
+ :meth:`finalize_options`, both of which must be defined by every command class.
+ The distinction between the two is necessary because option values might come
+ from the outside world (command line, config file, ...), and any options
+ dependent on other options must be computed after these outside influences have
+ been processed --- hence :meth:`finalize_options`. The body of the subroutine,
+ where it does all its work based on the values of its options, is the
+ :meth:`run` method, which must also be implemented by every command class.
+
+ The class constructor takes a single argument *dist*, a :class:`Distribution`
instance.
-Creating a new Distutils command
-================================
-
-This section outlines the steps to create a new Distutils command.
-
-A new command lives in a module in the :mod:`distutils.command` package. There
-is a sample template in that directory called :file:`command_template`. Copy
-this file to a new module with the same name as the new command you're
-implementing. This module should implement a class with the same name as the
-module (and the command). So, for instance, to create the command
-``peel_banana`` (so that users can run ``setup.py peel_banana``), you'd copy
-:file:`command_template` to :file:`distutils/command/peel_banana.py`, then edit
-it so that it's implementing the class :class:`peel_banana`, a subclass of
-:class:`distutils.cmd.Command`.
-
-Subclasses of :class:`Command` must define the following methods.
-
-.. method:: Command.initialize_options()
-
- Set default values for all the options that this command supports. Note that
- these defaults may be overridden by other commands, by the setup script, by
- config files, or by the command-line. Thus, this is not the place to code
- dependencies between options; generally, :meth:`initialize_options`
- implementations are just a bunch of ``self.foo = None`` assignments.
-
-
-.. method:: Command.finalize_options()
-
- Set final values for all the options that this command supports. This is
- always called as late as possible, ie. after any option assignments from the
- command-line or from other commands have been done. Thus, this is the place
- to to code option dependencies: if *foo* depends on *bar*, then it is safe to
- set *foo* from *bar* as long as *foo* still has the same value it was
- assigned in :meth:`initialize_options`.
-
-
-.. method:: Command.run()
-
- A command's raison d'etre: carry out the action it exists to perform, controlled
- by the options initialized in :meth:`initialize_options`, customized by other
- commands, the setup script, the command-line, and config files, and finalized in
- :meth:`finalize_options`. All terminal output and filesystem interaction should
- be done by :meth:`run`.
-
-
-.. attribute:: Command.sub_commands
-
- *sub_commands* formalizes the notion of a "family" of commands,
- e.g. ``install`` as the parent with sub-commands ``install_lib``,
- ``install_headers``, etc. The parent of a family of commands defines
- *sub_commands* as a class attribute; it's a list of 2-tuples ``(command_name,
- predicate)``, with *command_name* a string and *predicate* a function, a
- string or ``None``. *predicate* is a method of the parent command that
- determines whether the corresponding command is applicable in the current
- situation. (E.g. we ``install_headers`` is only applicable if we have any C
- header files to install.) If *predicate* is ``None``, that command is always
- applicable.
-
- *sub_commands* is usually defined at the *end* of a class, because
- predicates can be methods of the class, so they must already have been
- defined. The canonical example is the :command:`install` command.
-
-
:mod:`distutils.command` --- Individual Distutils commands
==========================================================
@@ -2006,3 +1941,76 @@ The ``register`` command registers the package with the Python Package Index.
This is described in more detail in :pep:`301`.
.. % todo
+
+:mod:`distutils.command.check` --- Check the meta-data of a package
+===================================================================
+
+.. module:: distutils.command.check
+ :synopsis: Check the metadata of a package
+
+
+The ``check`` command performs some tests on the meta-data of a package.
+For example, it verifies that all required meta-data are provided as
+the arguments passed to the :func:`setup` function.
+
+.. % todo
+
+
+Creating a new Distutils command
+================================
+
+This section outlines the steps to create a new Distutils command.
+
+A new command lives in a module in the :mod:`distutils.command` package. There
+is a sample template in that directory called :file:`command_template`. Copy
+this file to a new module with the same name as the new command you're
+implementing. This module should implement a class with the same name as the
+module (and the command). So, for instance, to create the command
+``peel_banana`` (so that users can run ``setup.py peel_banana``), you'd copy
+:file:`command_template` to :file:`distutils/command/peel_banana.py`, then edit
+it so that it's implementing the class :class:`peel_banana`, a subclass of
+:class:`distutils.cmd.Command`.
+
+Subclasses of :class:`Command` must define the following methods.
+
+
+.. method:: Command.initialize_options()
+
+ Set default values for all the options that this command supports. Note that
+ these defaults may be overridden by other commands, by the setup script, by
+ config files, or by the command-line. Thus, this is not the place to code
+ dependencies between options; generally, :meth:`initialize_options`
+ implementations are just a bunch of ``self.foo = None`` assignments.
+
+
+.. method:: Command.finalize_options()
+
+ Set final values for all the options that this command supports. This is
+ always called as late as possible, ie. after any option assignments from the
+ command-line or from other commands have been done. Thus, this is the place
+ to to code option dependencies: if *foo* depends on *bar*, then it is safe to
+ set *foo* from *bar* as long as *foo* still has the same value it was
+ assigned in :meth:`initialize_options`.
+
+
+.. method:: Command.run()
+
+ A command's raison d'etre: carry out the action it exists to perform, controlled
+ by the options initialized in :meth:`initialize_options`, customized by other
+ commands, the setup script, the command-line, and config files, and finalized in
+ :meth:`finalize_options`. All terminal output and filesystem interaction should
+ be done by :meth:`run`.
+
+*sub_commands* formalizes the notion of a "family" of commands, eg. ``install``
+as the parent with sub-commands ``install_lib``, ``install_headers``, etc. The
+parent of a family of commands defines *sub_commands* as a class attribute; it's
+a list of 2-tuples ``(command_name, predicate)``, with *command_name* a string
+and *predicate* a function, a string or None. *predicate* is a method of
+the parent command that determines whether the corresponding command is
+applicable in the current situation. (Eg. we ``install_headers`` is only
+applicable if we have any C header files to install.) If *predicate* is None,
+that command is always applicable.
+
+*sub_commands* is usually defined at the \*end\* of a class, because predicates
+can be methods of the class, so they must already have been defined. The
+canonical example is the :command:`install` command.
diff --git a/Doc/distutils/builtdist.rst b/Doc/distutils/builtdist.rst
index 2697ba04cb..d1ab7dbce9 100644
--- a/Doc/distutils/builtdist.rst
+++ b/Doc/distutils/builtdist.rst
@@ -139,13 +139,13 @@ The following sections give details on the individual :command:`bdist_\*`
commands.
-.. _creating-dumb:
+.. .. _creating-dumb:
-Creating dumb built distributions
-=================================
+.. Creating dumb built distributions
+.. =================================
.. XXX Need to document absolute vs. prefix-relative packages here, but first
- I have to implement it!
+ I have to implement it!
.. _creating-rpms:
@@ -425,7 +425,7 @@ built-in functions in the installation script.
Which folders are available depends on the exact Windows version, and probably
also the configuration. For details refer to Microsoft's documentation of the
- :cfunc:`SHGetSpecialFolderPath` function.
+ :c:func:`SHGetSpecialFolderPath` function.
.. function:: create_shortcut(target, description, filename[, arguments[, workdir[, iconpath[, iconindex]]]])
diff --git a/Doc/distutils/commandref.rst b/Doc/distutils/commandref.rst
index fbe40de6c2..6a2ac960f1 100644
--- a/Doc/distutils/commandref.rst
+++ b/Doc/distutils/commandref.rst
@@ -53,7 +53,7 @@ This command installs all (Python) scripts in the distribution.
Creating a source distribution: the :command:`sdist` command
============================================================
-**\*\*** fragment moved down from above: needs context! **\*\***
+.. XXX fragment moved down from above: needs context!
The manifest template commands are:
@@ -90,7 +90,7 @@ character, and ``[range]`` matches any of the characters in *range* (e.g.,
character" is platform-specific: on Unix it is anything except slash; on Windows
anything except backslash or colon.
-**\*\*** Windows support not there yet **\*\***
+.. XXX Windows support not there yet
.. % \section{Creating a built distribution: the
.. % \protect\command{bdist} command family}
diff --git a/Doc/distutils/examples.rst b/Doc/distutils/examples.rst
index e8d1ec9937..b268486398 100644
--- a/Doc/distutils/examples.rst
+++ b/Doc/distutils/examples.rst
@@ -258,9 +258,8 @@ Running the ``check`` command will display some warnings::
If you use the reStructuredText syntax in the ``long_description`` field and
-`docutils <http://docutils.sourceforge.net/>`_ is installed you can check if
-the syntax is fine with the ``check`` command, using the ``restructuredtext``
-option.
+`docutils`_ is installed you can check if the syntax is fine with the
+``check`` command, using the ``restructuredtext`` option.
For example, if the :file:`setup.py` script is changed like this::
@@ -291,3 +290,4 @@ by using the :mod:`docutils` parser::
.. % \section{Putting it all together}
+.. _docutils: http://docutils.sourceforge.net
diff --git a/Doc/distutils/extending.rst b/Doc/distutils/extending.rst
index 5a70d031cc..972ff02c03 100644
--- a/Doc/distutils/extending.rst
+++ b/Doc/distutils/extending.rst
@@ -15,8 +15,8 @@ want to modify existing commands; many simply add a few file extensions that
should be copied into packages in addition to :file:`.py` files as a
convenience.
-Most distutils command implementations are subclasses of the
-:class:`distutils.cmd.Command` class. New commands may directly inherit from
+Most distutils command implementations are subclasses of the :class:`Command`
+class from :mod:`distutils.cmd`. New commands may directly inherit from
:class:`Command`, while replacements often derive from :class:`Command`
indirectly, directly subclassing the command they are replacing. Commands are
required to derive from :class:`Command`.
diff --git a/Doc/distutils/sourcedist.rst b/Doc/distutils/sourcedist.rst
index 2dea83d06c..15d0bafd71 100644
--- a/Doc/distutils/sourcedist.rst
+++ b/Doc/distutils/sourcedist.rst
@@ -68,10 +68,10 @@ source distribution:
:option:`packages` options
* all C source files mentioned in the :option:`ext_modules` or
- :option:`libraries` options
+ :option:`libraries` options (
- .. XXX Getting C library sources is currently broken -- no
- :meth:`get_source_files` method in :file:`build_clib.py`!
+ .. XXX getting C library sources currently broken---no
+ :meth:`get_source_files` method in :file:`build_clib.py`!
* scripts identified by the :option:`scripts` option
See :ref:`distutils-installing-scripts`.
diff --git a/Doc/distutils/uploading.rst b/Doc/distutils/uploading.rst
index fd0c50873c..1b3cb589ec 100644
--- a/Doc/distutils/uploading.rst
+++ b/Doc/distutils/uploading.rst
@@ -67,9 +67,10 @@ In that case, :file:`README.txt` is a regular reStructuredText text file located
in the root of the package besides :file:`setup.py`.
To prevent registering broken reStructuredText content, you can use the
-:program:`rst2html` program that is provided by the :mod:`docutils` package
-and check the ``long_description`` from the command line::
+:program:`rst2html` program that is provided by the :mod:`docutils` package and
+check the ``long_description`` from the command line::
$ python setup.py --long-description | rst2html.py > output.html
-:mod:`docutils` will display a warning if there's something wrong with your syntax.
+:mod:`docutils` will display a warning if there's something wrong with your
+syntax.
diff --git a/Doc/documenting/building.rst b/Doc/documenting/building.rst
index 9ab25196df..19cf26bbd7 100644
--- a/Doc/documenting/building.rst
+++ b/Doc/documenting/building.rst
@@ -16,9 +16,9 @@ installed Python and Subversion, you can just run ::
make html
-to check out the necessary toolset in the `tools/` subdirectory and build the
-HTML output files. To view the generated HTML, point your favorite browser at
-the top-level index `build/html/index.html` after running "make".
+to check out the necessary toolset in the :file:`tools/` subdirectory and build
+the HTML output files. To view the generated HTML, point your favorite browser
+at the top-level index :file:`build/html/index.html` after running "make".
Available make targets are:
@@ -49,10 +49,10 @@ Available make targets are:
* "pydoc-topics", which builds a Python module containing a dictionary with
plain text documentation for the labels defined in
- `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and
+ :file:`tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and
keyword help.
-A "make update" updates the Subversion checkouts in `tools/`.
+A "make update" updates the Subversion checkouts in :file:`tools/`.
Without make
diff --git a/Doc/documenting/markup.rst b/Doc/documenting/markup.rst
index a2b91238a9..57d9eeba14 100644
--- a/Doc/documenting/markup.rst
+++ b/Doc/documenting/markup.rst
@@ -107,11 +107,11 @@ index entries more informative.
The directives are:
-.. describe:: cfunction
+.. describe:: c:function
Describes a C function. The signature should be given as in C, e.g.::
- .. cfunction:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
+ .. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
This is also used to describe function-like preprocessor macros. The names
of the arguments should be given so they may be used in the description.
@@ -119,29 +119,29 @@ The directives are:
Note that you don't have to backslash-escape asterisks in the signature,
as it is not parsed by the reST inliner.
-.. describe:: cmember
+.. describe:: c:member
Describes a C struct member. Example signature::
- .. cmember:: PyObject* PyTypeObject.tp_bases
+ .. c:member:: PyObject* PyTypeObject.tp_bases
The text of the description should include the range of values allowed, how
the value should be interpreted, and whether the value can be changed.
References to structure members in text should use the ``member`` role.
-.. describe:: cmacro
+.. describe:: c:macro
Describes a "simple" C macro. Simple macros are macros which are used
for code expansion, but which do not take arguments so cannot be described as
functions. This is not to be used for simple constant definitions. Examples
- of its use in the Python documentation include :cmacro:`PyObject_HEAD` and
- :cmacro:`Py_BEGIN_ALLOW_THREADS`.
+ of its use in the Python documentation include :c:macro:`PyObject_HEAD` and
+ :c:macro:`Py_BEGIN_ALLOW_THREADS`.
-.. describe:: ctype
+.. describe:: c:type
Describes a C type. The signature should just be the type name.
-.. describe:: cvar
+.. describe:: c:var
Describes a global C variable. The signature should include the type, such
as::
@@ -177,6 +177,37 @@ The directives are:
are modified), side effects, and possible exceptions. A small example may be
provided.
+.. describe:: decorator
+
+ Describes a decorator function. The signature should *not* represent the
+ signature of the actual function, but the usage as a decorator. For example,
+ given the functions
+
+ .. code-block:: python
+
+ def removename(func):
+ func.__name__ = ''
+ return func
+
+ def setnewname(name):
+ def decorator(func):
+ func.__name__ = name
+ return func
+ return decorator
+
+ the descriptions should look like this::
+
+ .. decorator:: removename
+
+ Remove name of the decorated function.
+
+ .. decorator:: setnewname(name)
+
+ Set name of the decorated function to *name*.
+
+ There is no ``deco`` role to link to a decorator that is marked up with
+ this directive; rather, use the ``:func:`` role.
+
.. describe:: class
Describes a class. The signature can include parentheses with parameters
@@ -211,6 +242,12 @@ The directives are:
described for ``function``. This directive should be nested in a class
directive, like in the example above.
+.. describe:: decoratormethod
+
+ Same as ``decorator``, but for decorators that are methods.
+
+ Refer to a decorator method using the ``:meth:`` role.
+
.. describe:: opcode
Describes a Python :term:`bytecode` instruction.
@@ -383,22 +420,26 @@ the currently documented class.
The following roles create cross-references to C-language constructs if they
are defined in the API documentation:
-.. describe:: cdata
+.. describe:: c:data
The name of a C-language variable.
-.. describe:: cfunc
+.. describe:: c:func
The name of a C-language function. Should include trailing parentheses.
-.. describe:: cmacro
+.. describe:: c:macro
The name of a "simple" C macro, as defined above.
-.. describe:: ctype
+.. describe:: c:type
The name of a C-language type.
+.. describe:: c:member
+
+ The name of a C type member, as defined above.
+
The following role does possibly create a cross-reference, but does not refer
to objects:
@@ -541,10 +582,6 @@ in a different style:
If you don't need the "variable part" indication, use the standard
````code```` instead.
-.. describe:: var
-
- A Python or C variable or parameter name.
-
The following roles generate external links:
@@ -590,6 +627,8 @@ Example::
The ``:ref:`` invocation is replaced with the section title.
+Alternatively, you can reference any label (not just section titles)
+if you provide the link text ``:ref:`link text <reference-label>```.
Paragraph-level markup
----------------------
diff --git a/Doc/documenting/style.rst b/Doc/documenting/style.rst
index c3dded9b77..d0557119fb 100644
--- a/Doc/documenting/style.rst
+++ b/Doc/documenting/style.rst
@@ -1,14 +1,18 @@
.. highlightlang:: rest
-Style Guide
+Style guide
===========
The Python documentation should follow the `Apple Publications Style Guide`_
wherever possible. This particular style guide was selected mostly because it
seems reasonable and is easy to get online.
-Topics which are not covered in Apple's style guide will be discussed in
-this document.
+Topics which are either not covered in Apple's style guide or treated
+differently in Python documentation will be discussed in this
+document.
+
+Use of whitespace
+-----------------
All reST files use an indentation of 3 spaces. The maximum line length is 80
characters for normal text, but tables, deeply indented code samples and long
@@ -21,6 +25,9 @@ A sentence-ending period may be followed by one or two spaces; while reST
ignores the second space, it is customarily put in by some users, for example
to aid Emacs' auto-fill mode.
+Footnotes
+---------
+
Footnotes are generally discouraged, though they may be used when they are the
best way to present specific information. When a footnote reference is added at
the end of the sentence, it should follow the sentence-ending punctuation. The
@@ -34,6 +41,36 @@ the footnote reference.
Footnotes may appear in the middle of sentences where appropriate.
+Capitalization
+--------------
+
+.. sidebar:: Sentence case
+
+ Sentence case is a set of capitalization rules used in English
+ sentences: the first word is always capitalized and other words are
+ only capitalized if there is a specific rule requiring it.
+
+Apple style guide recommends the use of title case in section titles.
+However, rules for which words should be capitalized in title case
+vary greaty between publications.
+
+In Python documentation, use of sentence case in section titles is
+preferable, but consistency within a unit is more important than
+following this rule. If you add a section to the chapter where most
+sections are in title case you can either convert all titles to
+sentence case or use the dominant style in the new section title.
+
+Sentences that start with a word for which specific rules require
+starting it with a lower case letter should be avoided in titles and
+elsewhere.
+
+.. note::
+
+ Sections that describe a library module often have titles in the
+ form of "modulename --- Short description of the module." In this
+ case, the description should be capitalized as a stand-alone
+ sentence.
+
Many special names are used in the Python documentation, including the names of
operating systems, programming languages, standards bodies, and the like. Most
of these entities are not assigned any special markup, but the preferred
@@ -44,26 +81,32 @@ Other terms and words deserve special mention as well; these conventions should
be used to ensure consistency throughout the documentation:
CPU
- For "central processing unit." Many style guides say this should be spelled
- out on the first use (and if you must use it, do so!). For the Python
- documentation, this abbreviation should be avoided since there's no
- reasonable way to predict which occurrence will be the first seen by the
- reader. It is better to use the word "processor" instead.
+ For "central processing unit." Many style guides say this should be
+ spelled out on the first use (and if you must use it, do so!). For
+ the Python documentation, this abbreviation should be avoided since
+ there's no reasonable way to predict which occurrence will be the
+ first seen by the reader. It is better to use the word "processor"
+ instead.
POSIX
- The name assigned to a particular group of standards. This is always
- uppercase.
+ The name assigned to a particular group of standards. This is always
+ uppercase.
Python
- The name of our favorite programming language is always capitalized.
+ The name of our favorite programming language is always capitalized.
+
+reST
+ For "reStructuredText," an easy to read, plaintext markup syntax
+ used to produce Python documentation. When spelled out, it is
+ always one word and both forms start with a lower case 'r'.
Unicode
- The name of a character set and matching encoding. This is always written
- capitalized.
+ The name of a character coding system. This is always written
+ capitalized.
Unix
- The name of the operating system developed at AT&T Bell Labs in the early
- 1970s.
+ The name of the operating system developed at AT&T Bell Labs in the early
+ 1970s.
.. _Apple Publications Style Guide: http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2009.pdf
diff --git a/Doc/extending/embedding.rst b/Doc/extending/embedding.rst
index 2ea12532b0..e261048169 100644
--- a/Doc/extending/embedding.rst
+++ b/Doc/extending/embedding.rst
@@ -25,19 +25,16 @@ the Python interpreter to run some Python code.
So if you are embedding Python, you are providing your own main program. One of
the things this main program has to do is initialize the Python interpreter. At
-the very least, you have to call the function :cfunc:`Py_Initialize`. There are
+the very least, you have to call the function :c:func:`Py_Initialize`. There are
optional calls to pass command line arguments to Python. Then later you can
call the interpreter from any part of the application.
There are several different ways to call the interpreter: you can pass a string
-containing Python statements to :cfunc:`PyRun_SimpleString`, or you can pass a
+containing Python statements to :c:func:`PyRun_SimpleString`, or you can pass a
stdio file pointer and a file name (for identification in error messages only)
-to :cfunc:`PyRun_SimpleFile`. You can also call the lower-level operations
+to :c:func:`PyRun_SimpleFile`. You can also call the lower-level operations
described in the previous chapters to construct and use Python objects.
-A simple demo of embedding Python can be found in the directory
-:file:`Demo/embed/` of the source distribution.
-
.. seealso::
@@ -69,12 +66,12 @@ perform some operation on a file. ::
}
The above code first initializes the Python interpreter with
-:cfunc:`Py_Initialize`, followed by the execution of a hard-coded Python script
-that print the date and time. Afterwards, the :cfunc:`Py_Finalize` call shuts
+:c:func:`Py_Initialize`, followed by the execution of a hard-coded Python script
+that print the date and time. Afterwards, the :c:func:`Py_Finalize` call shuts
the interpreter down, followed by the end of the program. In a real program,
you may want to get the Python script from another source, perhaps a text-editor
routine, a file, or a database. Getting the Python code from a file can better
-be done by using the :cfunc:`PyRun_SimpleFile` function, which saves you the
+be done by using the :c:func:`PyRun_SimpleFile` function, which saves you the
trouble of allocating memory space and loading the file contents.
@@ -162,8 +159,8 @@ interesting part with respect to embedding Python starts with ::
pModule = PyImport_Import(pName);
After initializing the interpreter, the script is loaded using
-:cfunc:`PyImport_Import`. This routine needs a Python string as its argument,
-which is constructed using the :cfunc:`PyString_FromString` data conversion
+:c:func:`PyImport_Import`. This routine needs a Python string as its argument,
+which is constructed using the :c:func:`PyString_FromString` data conversion
routine. ::
pFunc = PyObject_GetAttrString(pModule, argv[2]);
@@ -175,7 +172,7 @@ routine. ::
Py_XDECREF(pFunc);
Once the script is loaded, the name we're looking for is retrieved using
-:cfunc:`PyObject_GetAttrString`. If the name exists, and the object returned is
+:c:func:`PyObject_GetAttrString`. If the name exists, and the object returned is
callable, you can safely assume that it is a function. The program then
proceeds by constructing a tuple of arguments as normal. The call to the Python
function is then made with::
@@ -229,8 +226,8 @@ Python extension. For example::
return PyModule_Create(&EmbModule);
}
-Insert the above code just above the :cfunc:`main` function. Also, insert the
-following two statements before the call to :cfunc:`Py_Initialize`::
+Insert the above code just above the :c:func:`main` function. Also, insert the
+following two statements before the call to :c:func:`Py_Initialize`::
numargs = argc;
PyImport_AppendInittab("emb", &PyInit_emb);
diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst
index 68dc9d662b..c4ced1af8b 100644
--- a/Doc/extending/extending.rst
+++ b/Doc/extending/extending.rst
@@ -20,6 +20,13 @@ source file by including the header ``"Python.h"``.
The compilation of an extension module depends on its intended use as well as on
your system setup; details are given in later chapters.
+Do note that if your use case is calling C library functions or system calls,
+you should consider using the :mod:`ctypes` module rather than writing custom
+C code. Not only does :mod:`ctypes` let you write Python code to interface
+with C code, but it is more portable between implementations of Python than
+writing and compiling an extension module which typically ties you to CPython.
+
+
.. _extending-simpleexample:
@@ -28,7 +35,7 @@ A Simple Example
Let's create an extension module called ``spam`` (the favorite food of Monty
Python fans...) and let's say we want to create a Python interface to the C
-library function :cfunc:`system`. [#]_ This function takes a null-terminated
+library function :c:func:`system`. [#]_ This function takes a null-terminated
character string as argument and returns an integer. We want this function to
be callable from Python as follows::
@@ -58,8 +65,8 @@ All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or
since they are used extensively by the Python interpreter, ``"Python.h"``
includes a few standard header files: ``<stdio.h>``, ``<string.h>``,
``<errno.h>``, and ``<stdlib.h>``. If the latter header file does not exist on
-your system, it declares the functions :cfunc:`malloc`, :cfunc:`free` and
-:cfunc:`realloc` directly.
+your system, it declares the functions :c:func:`malloc`, :c:func:`free` and
+:c:func:`realloc` directly.
The next thing we add to our module file is the C function that will be called
when the Python expression ``spam.system(string)`` is evaluated (we'll see
@@ -89,12 +96,12 @@ The *args* argument will be a pointer to a Python tuple object containing the
arguments. Each item of the tuple corresponds to an argument in the call's
argument list. The arguments are Python objects --- in order to do anything
with them in our C function we have to convert them to C values. The function
-:cfunc:`PyArg_ParseTuple` in the Python API checks the argument types and
+:c:func:`PyArg_ParseTuple` in the Python API checks the argument types and
converts them to C values. It uses a template string to determine the required
types of the arguments as well as the types of the C variables into which to
store the converted values. More about this later.
-:cfunc:`PyArg_ParseTuple` returns true (nonzero) if all arguments have the right
+:c:func:`PyArg_ParseTuple` returns true (nonzero) if all arguments have the right
type and its components have been stored in the variables whose addresses are
passed. It returns false (zero) if an invalid argument list was passed. In the
latter case it also raises an appropriate exception so the calling function can
@@ -119,77 +126,77 @@ to know about them to understand how errors are passed around.
The Python API defines a number of functions to set various types of exceptions.
-The most common one is :cfunc:`PyErr_SetString`. Its arguments are an exception
+The most common one is :c:func:`PyErr_SetString`. Its arguments are an exception
object and a C string. The exception object is usually a predefined object like
-:cdata:`PyExc_ZeroDivisionError`. The C string indicates the cause of the error
+:c:data:`PyExc_ZeroDivisionError`. The C string indicates the cause of the error
and is converted to a Python string object and stored as the "associated value"
of the exception.
-Another useful function is :cfunc:`PyErr_SetFromErrno`, which only takes an
+Another useful function is :c:func:`PyErr_SetFromErrno`, which only takes an
exception argument and constructs the associated value by inspection of the
-global variable :cdata:`errno`. The most general function is
-:cfunc:`PyErr_SetObject`, which takes two object arguments, the exception and
-its associated value. You don't need to :cfunc:`Py_INCREF` the objects passed
+global variable :c:data:`errno`. The most general function is
+:c:func:`PyErr_SetObject`, which takes two object arguments, the exception and
+its associated value. You don't need to :c:func:`Py_INCREF` the objects passed
to any of these functions.
You can test non-destructively whether an exception has been set with
-:cfunc:`PyErr_Occurred`. This returns the current exception object, or *NULL*
+:c:func:`PyErr_Occurred`. This returns the current exception object, or *NULL*
if no exception has occurred. You normally don't need to call
-:cfunc:`PyErr_Occurred` to see whether an error occurred in a function call,
+:c:func:`PyErr_Occurred` to see whether an error occurred in a function call,
since you should be able to tell from the return value.
When a function *f* that calls another function *g* detects that the latter
fails, *f* should itself return an error value (usually *NULL* or ``-1``). It
-should *not* call one of the :cfunc:`PyErr_\*` functions --- one has already
+should *not* call one of the :c:func:`PyErr_\*` functions --- one has already
been called by *g*. *f*'s caller is then supposed to also return an error
-indication to *its* caller, again *without* calling :cfunc:`PyErr_\*`, and so on
+indication to *its* caller, again *without* calling :c:func:`PyErr_\*`, and so on
--- the most detailed cause of the error was already reported by the function
that first detected it. Once the error reaches the Python interpreter's main
loop, this aborts the currently executing Python code and tries to find an
exception handler specified by the Python programmer.
(There are situations where a module can actually give a more detailed error
-message by calling another :cfunc:`PyErr_\*` function, and in such cases it is
+message by calling another :c:func:`PyErr_\*` function, and in such cases it is
fine to do so. As a general rule, however, this is not necessary, and can cause
information about the cause of the error to be lost: most operations can fail
for a variety of reasons.)
To ignore an exception set by a function call that failed, the exception
-condition must be cleared explicitly by calling :cfunc:`PyErr_Clear`. The only
-time C code should call :cfunc:`PyErr_Clear` is if it doesn't want to pass the
+condition must be cleared explicitly by calling :c:func:`PyErr_Clear`. The only
+time C code should call :c:func:`PyErr_Clear` is if it doesn't want to pass the
error on to the interpreter but wants to handle it completely by itself
(possibly by trying something else, or pretending nothing went wrong).
-Every failing :cfunc:`malloc` call must be turned into an exception --- the
-direct caller of :cfunc:`malloc` (or :cfunc:`realloc`) must call
-:cfunc:`PyErr_NoMemory` and return a failure indicator itself. All the
-object-creating functions (for example, :cfunc:`PyLong_FromLong`) already do
-this, so this note is only relevant to those who call :cfunc:`malloc` directly.
+Every failing :c:func:`malloc` call must be turned into an exception --- the
+direct caller of :c:func:`malloc` (or :c:func:`realloc`) must call
+:c:func:`PyErr_NoMemory` and return a failure indicator itself. All the
+object-creating functions (for example, :c:func:`PyLong_FromLong`) already do
+this, so this note is only relevant to those who call :c:func:`malloc` directly.
-Also note that, with the important exception of :cfunc:`PyArg_ParseTuple` and
+Also note that, with the important exception of :c:func:`PyArg_ParseTuple` and
friends, functions that return an integer status usually return a positive value
or zero for success and ``-1`` for failure, like Unix system calls.
-Finally, be careful to clean up garbage (by making :cfunc:`Py_XDECREF` or
-:cfunc:`Py_DECREF` calls for objects you have already created) when you return
+Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` or
+:c:func:`Py_DECREF` calls for objects you have already created) when you return
an error indicator!
The choice of which exception to raise is entirely yours. There are predeclared
C objects corresponding to all built-in Python exceptions, such as
-:cdata:`PyExc_ZeroDivisionError`, which you can use directly. Of course, you
-should choose exceptions wisely --- don't use :cdata:`PyExc_TypeError` to mean
-that a file couldn't be opened (that should probably be :cdata:`PyExc_IOError`).
-If something's wrong with the argument list, the :cfunc:`PyArg_ParseTuple`
-function usually raises :cdata:`PyExc_TypeError`. If you have an argument whose
+:c:data:`PyExc_ZeroDivisionError`, which you can use directly. Of course, you
+should choose exceptions wisely --- don't use :c:data:`PyExc_TypeError` to mean
+that a file couldn't be opened (that should probably be :c:data:`PyExc_IOError`).
+If something's wrong with the argument list, the :c:func:`PyArg_ParseTuple`
+function usually raises :c:data:`PyExc_TypeError`. If you have an argument whose
value must be in a particular range or must satisfy other conditions,
-:cdata:`PyExc_ValueError` is appropriate.
+:c:data:`PyExc_ValueError` is appropriate.
You can also define a new exception that is unique to your module. For this, you
usually declare a static object variable at the beginning of your file::
static PyObject *SpamError;
-and initialize it in your module's initialization function (:cfunc:`PyInit_spam`)
+and initialize it in your module's initialization function (:c:func:`PyInit_spam`)
with an exception object (leaving out the error checking for now)::
PyMODINIT_FUNC
@@ -208,14 +215,14 @@ with an exception object (leaving out the error checking for now)::
}
Note that the Python name for the exception object is :exc:`spam.error`. The
-:cfunc:`PyErr_NewException` function may create a class with the base class
+:c:func:`PyErr_NewException` function may create a class with the base class
being :exc:`Exception` (unless another class is passed in instead of *NULL*),
described in :ref:`bltin-exceptions`.
-Note also that the :cdata:`SpamError` variable retains a reference to the newly
+Note also that the :c:data:`SpamError` variable retains a reference to the newly
created exception class; this is intentional! Since the exception could be
removed from the module by external code, an owned reference to the class is
-needed to ensure that it will not be discarded, causing :cdata:`SpamError` to
+needed to ensure that it will not be discarded, causing :c:data:`SpamError` to
become a dangling pointer. Should it become a dangling pointer, C code which
raises the exception could cause a core dump or other unintended side effects.
@@ -223,7 +230,7 @@ We discuss the use of ``PyMODINIT_FUNC`` as a function return type later in this
sample.
The :exc:`spam.error` exception can be raised in your extension module using a
-call to :cfunc:`PyErr_SetString` as shown below::
+call to :c:func:`PyErr_SetString` as shown below::
static PyObject *
spam_system(PyObject *self, PyObject *args)
@@ -255,19 +262,19 @@ statement::
It returns *NULL* (the error indicator for functions returning object pointers)
if an error is detected in the argument list, relying on the exception set by
-:cfunc:`PyArg_ParseTuple`. Otherwise the string value of the argument has been
-copied to the local variable :cdata:`command`. This is a pointer assignment and
+:c:func:`PyArg_ParseTuple`. Otherwise the string value of the argument has been
+copied to the local variable :c:data:`command`. This is a pointer assignment and
you are not supposed to modify the string to which it points (so in Standard C,
-the variable :cdata:`command` should properly be declared as ``const char
+the variable :c:data:`command` should properly be declared as ``const char
*command``).
-The next statement is a call to the Unix function :cfunc:`system`, passing it
-the string we just got from :cfunc:`PyArg_ParseTuple`::
+The next statement is a call to the Unix function :c:func:`system`, passing it
+the string we just got from :c:func:`PyArg_ParseTuple`::
sts = system(command);
-Our :func:`spam.system` function must return the value of :cdata:`sts` as a
-Python object. This is done using the function :cfunc:`PyLong_FromLong`. ::
+Our :func:`spam.system` function must return the value of :c:data:`sts` as a
+Python object. This is done using the function :c:func:`PyLong_FromLong`. ::
return PyLong_FromLong(sts);
@@ -275,14 +282,14 @@ In this case, it will return an integer object. (Yes, even integers are objects
on the heap in Python!)
If you have a C function that returns no useful argument (a function returning
-:ctype:`void`), the corresponding Python function must return ``None``. You
-need this idiom to do so (which is implemented by the :cmacro:`Py_RETURN_NONE`
+:c:type:`void`), the corresponding Python function must return ``None``. You
+need this idiom to do so (which is implemented by the :c:macro:`Py_RETURN_NONE`
macro)::
Py_INCREF(Py_None);
return Py_None;
-:cdata:`Py_None` is the C name for the special Python object ``None``. It is a
+:c:data:`Py_None` is the C name for the special Python object ``None``. It is a
genuine Python object rather than a *NULL* pointer, which means "error" in most
contexts, as we have seen.
@@ -292,7 +299,7 @@ contexts, as we have seen.
The Module's Method Table and Initialization Function
=====================================================
-I promised to show how :cfunc:`spam_system` is called from Python programs.
+I promised to show how :c:func:`spam_system` is called from Python programs.
First, we need to list its name and address in a "method table"::
static PyMethodDef SpamMethods[] = {
@@ -306,16 +313,16 @@ First, we need to list its name and address in a "method table"::
Note the third entry (``METH_VARARGS``). This is a flag telling the interpreter
the calling convention to be used for the C function. It should normally always
be ``METH_VARARGS`` or ``METH_VARARGS | METH_KEYWORDS``; a value of ``0`` means
-that an obsolete variant of :cfunc:`PyArg_ParseTuple` is used.
+that an obsolete variant of :c:func:`PyArg_ParseTuple` is used.
When using only ``METH_VARARGS``, the function should expect the Python-level
parameters to be passed in as a tuple acceptable for parsing via
-:cfunc:`PyArg_ParseTuple`; more information on this function is provided below.
+:c:func:`PyArg_ParseTuple`; more information on this function is provided below.
The :const:`METH_KEYWORDS` bit may be set in the third field if keyword
arguments should be passed to the function. In this case, the C function should
accept a third ``PyObject \*`` parameter which will be a dictionary of keywords.
-Use :cfunc:`PyArg_ParseTupleAndKeywords` to parse the arguments to such a
+Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments to such a
function.
The method table must be referenced in the module definition structure::
@@ -331,7 +338,7 @@ The method table must be referenced in the module definition structure::
This structure, in turn, must be passed to the interpreter in the module's
initialization function. The initialization function must be named
-:cfunc:`PyInit_name`, where *name* is the name of the module, and should be the
+:c:func:`PyInit_name`, where *name* is the name of the module, and should be the
only non-\ ``static`` item defined in the module file::
PyMODINIT_FUNC
@@ -345,25 +352,25 @@ declares any special linkage declarations required by the platform, and for C++
declares the function as ``extern "C"``.
When the Python program imports module :mod:`spam` for the first time,
-:cfunc:`PyInit_spam` is called. (See below for comments about embedding Python.)
-It calls :cfunc:`PyModule_Create`, which returns a module object, and
+:c:func:`PyInit_spam` is called. (See below for comments about embedding Python.)
+It calls :c:func:`PyModule_Create`, which returns a module object, and
inserts built-in function objects into the newly created module based upon the
-table (an array of :ctype:`PyMethodDef` structures) found in the module definition.
-:cfunc:`PyModule_Create` returns a pointer to the module object
+table (an array of :c:type:`PyMethodDef` structures) found in the module definition.
+:c:func:`PyModule_Create` returns a pointer to the module object
that it creates. It may abort with a fatal error for
certain errors, or return *NULL* if the module could not be initialized
satisfactorily. The init function must return the module object to its caller,
so that it then gets inserted into ``sys.modules``.
-When embedding Python, the :cfunc:`PyInit_spam` function is not called
-automatically unless there's an entry in the :cdata:`PyImport_Inittab` table.
-To add the module to the initialization table, use :cfunc:`PyImport_AppendInittab`,
+When embedding Python, the :c:func:`PyInit_spam` function is not called
+automatically unless there's an entry in the :c:data:`PyImport_Inittab` table.
+To add the module to the initialization table, use :c:func:`PyImport_AppendInittab`,
optionally followed by an import of the module::
int
main(int argc, char *argv[])
{
- /* Add a builtin module, before Py_Initialize */
+ /* Add a built-in module, before Py_Initialize */
PyImport_AppendInittab("spam", PyInit_spam);
/* Pass argv[0] to the Python interpreter */
@@ -383,19 +390,14 @@ source distribution.
.. note::
Removing entries from ``sys.modules`` or importing compiled modules into
- multiple interpreters within a process (or following a :cfunc:`fork` without an
- intervening :cfunc:`exec`) can create problems for some extension modules.
+ multiple interpreters within a process (or following a :c:func:`fork` without an
+ intervening :c:func:`exec`) can create problems for some extension modules.
Extension module authors should exercise caution when initializing internal data
structures.
A more substantial example module is included in the Python source distribution
as :file:`Modules/xxmodule.c`. This file may be used as a template or simply
-read as an example. The :program:`modulator.py` script included in the source
-distribution or Windows install provides a simple graphical user interface for
-declaring the functions and objects which a module should implement, and can
-generate a template which can be filled in. The script lives in the
-:file:`Tools/modulator/` directory; see the :file:`README` file there for more
-information.
+read as an example.
.. _compilation:
@@ -453,7 +455,7 @@ look at the implementation of the :option:`-c` command line option in
Calling a Python function is easy. First, the Python program must somehow pass
you the Python function object. You should provide a function (or some other
interface) to do this. When this function is called, save a pointer to the
-Python function object (be careful to :cfunc:`Py_INCREF` it!) in a global
+Python function object (be careful to :c:func:`Py_INCREF` it!) in a global
variable --- or wherever you see fit. For example, the following function might
be part of a module definition::
@@ -482,10 +484,10 @@ be part of a module definition::
This function must be registered with the interpreter using the
:const:`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The
-:cfunc:`PyArg_ParseTuple` function and its arguments are documented in section
+:c:func:`PyArg_ParseTuple` function and its arguments are documented in section
:ref:`parsetuple`.
-The macros :cfunc:`Py_XINCREF` and :cfunc:`Py_XDECREF` increment/decrement the
+The macros :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF` increment/decrement the
reference count of an object and are safe in the presence of *NULL* pointers
(but note that *temp* will not be *NULL* in this context). More info on them
in section :ref:`refcounts`.
@@ -493,12 +495,12 @@ in section :ref:`refcounts`.
.. index:: single: PyObject_CallObject()
Later, when it is time to call the function, you call the C function
-:cfunc:`PyObject_CallObject`. This function has two arguments, both pointers to
+:c:func:`PyObject_CallObject`. This function has two arguments, both pointers to
arbitrary Python objects: the Python function, and the argument list. The
argument list must always be a tuple object, whose length is the number of
arguments. To call the Python function with no arguments, pass in NULL, or
an empty tuple; to call it with one argument, pass a singleton tuple.
-:cfunc:`Py_BuildValue` returns a tuple when its format string consists of zero
+:c:func:`Py_BuildValue` returns a tuple when its format string consists of zero
or more format codes between parentheses. For example::
int arg;
@@ -512,25 +514,25 @@ or more format codes between parentheses. For example::
result = PyObject_CallObject(my_callback, arglist);
Py_DECREF(arglist);
-:cfunc:`PyObject_CallObject` returns a Python object pointer: this is the return
-value of the Python function. :cfunc:`PyObject_CallObject` is
+:c:func:`PyObject_CallObject` returns a Python object pointer: this is the return
+value of the Python function. :c:func:`PyObject_CallObject` is
"reference-count-neutral" with respect to its arguments. In the example a new
-tuple was created to serve as the argument list, which is :cfunc:`Py_DECREF`\
+tuple was created to serve as the argument list, which is :c:func:`Py_DECREF`\
-ed immediately after the call.
-The return value of :cfunc:`PyObject_CallObject` is "new": either it is a brand
+The return value of :c:func:`PyObject_CallObject` is "new": either it is a brand
new object, or it is an existing object whose reference count has been
incremented. So, unless you want to save it in a global variable, you should
-somehow :cfunc:`Py_DECREF` the result, even (especially!) if you are not
+somehow :c:func:`Py_DECREF` the result, even (especially!) if you are not
interested in its value.
Before you do this, however, it is important to check that the return value
isn't *NULL*. If it is, the Python function terminated by raising an exception.
-If the C code that called :cfunc:`PyObject_CallObject` is called from Python, it
+If the C code that called :c:func:`PyObject_CallObject` is called from Python, it
should now return an error indication to its Python caller, so the interpreter
can print a stack trace, or the calling Python code can handle the exception.
If this is not possible or desirable, the exception should be cleared by calling
-:cfunc:`PyErr_Clear`. For example::
+:c:func:`PyErr_Clear`. For example::
if (result == NULL)
return NULL; /* Pass error back */
@@ -538,12 +540,12 @@ If this is not possible or desirable, the exception should be cleared by calling
Py_DECREF(result);
Depending on the desired interface to the Python callback function, you may also
-have to provide an argument list to :cfunc:`PyObject_CallObject`. In some cases
+have to provide an argument list to :c:func:`PyObject_CallObject`. In some cases
the argument list is also provided by the Python program, through the same
interface that specified the callback function. It can then be saved and used
in the same manner as the function object. In other cases, you may have to
construct a new tuple to pass as the argument list. The simplest way to do this
-is to call :cfunc:`Py_BuildValue`. For example, if you want to pass an integral
+is to call :c:func:`Py_BuildValue`. For example, if you want to pass an integral
event code, you might use the following code::
PyObject *arglist;
@@ -558,11 +560,11 @@ event code, you might use the following code::
Note the placement of ``Py_DECREF(arglist)`` immediately after the call, before
the error check! Also note that strictly speaking this code is not complete:
-:cfunc:`Py_BuildValue` may run out of memory, and this should be checked.
+:c:func:`Py_BuildValue` may run out of memory, and this should be checked.
You may also call a function with keyword arguments by using
-:cfunc:`PyObject_Call`, which supports arguments and keyword arguments. As in
-the above example, we use :cfunc:`Py_BuildValue` to construct the dictionary. ::
+:c:func:`PyObject_Call`, which supports arguments and keyword arguments. As in
+the above example, we use :c:func:`Py_BuildValue` to construct the dictionary. ::
PyObject *dict;
...
@@ -582,7 +584,7 @@ Extracting Parameters in Extension Functions
.. index:: single: PyArg_ParseTuple()
-The :cfunc:`PyArg_ParseTuple` function is declared as follows::
+The :c:func:`PyArg_ParseTuple` function is declared as follows::
int PyArg_ParseTuple(PyObject *arg, char *format, ...);
@@ -592,7 +594,7 @@ whose syntax is explained in :ref:`arg-parsing` in the Python/C API Reference
Manual. The remaining arguments must be addresses of variables whose type is
determined by the format string.
-Note that while :cfunc:`PyArg_ParseTuple` checks that the Python arguments have
+Note that while :c:func:`PyArg_ParseTuple` checks that the Python arguments have
the required types, it cannot check the validity of the addresses of C variables
passed to the call: if you make mistakes there, your code will probably crash or
at least overwrite random bits in memory. So be careful!
@@ -674,17 +676,17 @@ Keyword Parameters for Extension Functions
.. index:: single: PyArg_ParseTupleAndKeywords()
-The :cfunc:`PyArg_ParseTupleAndKeywords` function is declared as follows::
+The :c:func:`PyArg_ParseTupleAndKeywords` function is declared as follows::
int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict,
char *format, char *kwlist[], ...);
The *arg* and *format* parameters are identical to those of the
-:cfunc:`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of
+:c:func:`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of
keywords received as the third parameter from the Python runtime. The *kwlist*
parameter is a *NULL*-terminated list of strings which identify the parameters;
the names are matched with the type information from *format* from left to
-right. On success, :cfunc:`PyArg_ParseTupleAndKeywords` returns true, otherwise
+right. On success, :c:func:`PyArg_ParseTupleAndKeywords` returns true, otherwise
it returns false and raises an appropriate exception.
.. note::
@@ -748,19 +750,19 @@ Philbrick (philbrick@hks.com)::
Building Arbitrary Values
=========================
-This function is the counterpart to :cfunc:`PyArg_ParseTuple`. It is declared
+This function is the counterpart to :c:func:`PyArg_ParseTuple`. It is declared
as follows::
PyObject *Py_BuildValue(char *format, ...);
It recognizes a set of format units similar to the ones recognized by
-:cfunc:`PyArg_ParseTuple`, but the arguments (which are input to the function,
+:c:func:`PyArg_ParseTuple`, but the arguments (which are input to the function,
not output) must not be pointers, just values. It returns a new Python object,
suitable for returning from a C function called from Python.
-One difference with :cfunc:`PyArg_ParseTuple`: while the latter requires its
+One difference with :c:func:`PyArg_ParseTuple`: while the latter requires its
first argument to be a tuple (since Python argument lists are always represented
-as tuples internally), :cfunc:`Py_BuildValue` does not always build a tuple. It
+as tuples internally), :c:func:`Py_BuildValue` does not always build a tuple. It
builds a tuple only if its format string contains two or more format units. If
the format string is empty, it returns ``None``; if it contains exactly one
format unit, it returns whatever object is described by that format unit. To
@@ -794,18 +796,18 @@ Reference Counts
In languages like C or C++, the programmer is responsible for dynamic allocation
and deallocation of memory on the heap. In C, this is done using the functions
-:cfunc:`malloc` and :cfunc:`free`. In C++, the operators ``new`` and
+:c:func:`malloc` and :c:func:`free`. In C++, the operators ``new`` and
``delete`` are used with essentially the same meaning and we'll restrict
the following discussion to the C case.
-Every block of memory allocated with :cfunc:`malloc` should eventually be
-returned to the pool of available memory by exactly one call to :cfunc:`free`.
-It is important to call :cfunc:`free` at the right time. If a block's address
-is forgotten but :cfunc:`free` is not called for it, the memory it occupies
+Every block of memory allocated with :c:func:`malloc` should eventually be
+returned to the pool of available memory by exactly one call to :c:func:`free`.
+It is important to call :c:func:`free` at the right time. If a block's address
+is forgotten but :c:func:`free` is not called for it, the memory it occupies
cannot be reused until the program terminates. This is called a :dfn:`memory
-leak`. On the other hand, if a program calls :cfunc:`free` for a block and then
+leak`. On the other hand, if a program calls :c:func:`free` for a block and then
continues to use the block, it creates a conflict with re-use of the block
-through another :cfunc:`malloc` call. This is called :dfn:`using freed memory`.
+through another :c:func:`malloc` call. This is called :dfn:`using freed memory`.
It has the same bad consequences as referencing uninitialized data --- core
dumps, wrong results, mysterious crashes.
@@ -822,7 +824,7 @@ long-running process that uses the leaking function frequently. Therefore, it's
important to prevent leaks from happening by having a coding convention or
strategy that minimizes this kind of errors.
-Since Python makes heavy use of :cfunc:`malloc` and :cfunc:`free`, it needs a
+Since Python makes heavy use of :c:func:`malloc` and :c:func:`free`, it needs a
strategy to avoid memory leaks as well as the use of freed memory. The chosen
method is called :dfn:`reference counting`. The principle is simple: every
object contains a counter, which is incremented when a reference to the object
@@ -834,11 +836,11 @@ An alternative strategy is called :dfn:`automatic garbage collection`.
(Sometimes, reference counting is also referred to as a garbage collection
strategy, hence my use of "automatic" to distinguish the two.) The big
advantage of automatic garbage collection is that the user doesn't need to call
-:cfunc:`free` explicitly. (Another claimed advantage is an improvement in speed
+:c:func:`free` explicitly. (Another claimed advantage is an improvement in speed
or memory usage --- this is no hard fact however.) The disadvantage is that for
C, there is no truly portable automatic garbage collector, while reference
-counting can be implemented portably (as long as the functions :cfunc:`malloc`
-and :cfunc:`free` are available --- which the C Standard guarantees). Maybe some
+counting can be implemented portably (as long as the functions :c:func:`malloc`
+and :c:func:`free` are available --- which the C Standard guarantees). Maybe some
day a sufficiently portable automatic garbage collector will be available for C.
Until then, we'll have to live with reference counts.
@@ -873,9 +875,9 @@ Reference Counting in Python
----------------------------
There are two macros, ``Py_INCREF(x)`` and ``Py_DECREF(x)``, which handle the
-incrementing and decrementing of the reference count. :cfunc:`Py_DECREF` also
+incrementing and decrementing of the reference count. :c:func:`Py_DECREF` also
frees the object when the count reaches zero. For flexibility, it doesn't call
-:cfunc:`free` directly --- rather, it makes a call through a function pointer in
+:c:func:`free` directly --- rather, it makes a call through a function pointer in
the object's :dfn:`type object`. For this purpose (and others), every object
also contains a pointer to its type object.
@@ -883,13 +885,13 @@ The big question now remains: when to use ``Py_INCREF(x)`` and ``Py_DECREF(x)``?
Let's first introduce some terms. Nobody "owns" an object; however, you can
:dfn:`own a reference` to an object. An object's reference count is now defined
as the number of owned references to it. The owner of a reference is
-responsible for calling :cfunc:`Py_DECREF` when the reference is no longer
+responsible for calling :c:func:`Py_DECREF` when the reference is no longer
needed. Ownership of a reference can be transferred. There are three ways to
-dispose of an owned reference: pass it on, store it, or call :cfunc:`Py_DECREF`.
+dispose of an owned reference: pass it on, store it, or call :c:func:`Py_DECREF`.
Forgetting to dispose of an owned reference creates a memory leak.
It is also possible to :dfn:`borrow` [#]_ a reference to an object. The
-borrower of a reference should not call :cfunc:`Py_DECREF`. The borrower must
+borrower of a reference should not call :c:func:`Py_DECREF`. The borrower must
not hold on to the object longer than the owner from which it was borrowed.
Using a borrowed reference after the owner has disposed of it risks using freed
memory and should be avoided completely. [#]_
@@ -903,7 +905,7 @@ reference can be used after the owner from which it was borrowed has in fact
disposed of it.
A borrowed reference can be changed into an owned reference by calling
-:cfunc:`Py_INCREF`. This does not affect the status of the owner from which the
+:c:func:`Py_INCREF`. This does not affect the status of the owner from which the
reference was borrowed --- it creates a new owned reference, and gives full
owner responsibilities (the new owner must dispose of the reference properly, as
well as the previous owner).
@@ -920,36 +922,36 @@ reference or not.
Most functions that return a reference to an object pass on ownership with the
reference. In particular, all functions whose function it is to create a new
-object, such as :cfunc:`PyLong_FromLong` and :cfunc:`Py_BuildValue`, pass
+object, such as :c:func:`PyLong_FromLong` and :c:func:`Py_BuildValue`, pass
ownership to the receiver. Even if the object is not actually new, you still
receive ownership of a new reference to that object. For instance,
-:cfunc:`PyLong_FromLong` maintains a cache of popular values and can return a
+:c:func:`PyLong_FromLong` maintains a cache of popular values and can return a
reference to a cached item.
Many functions that extract objects from other objects also transfer ownership
-with the reference, for instance :cfunc:`PyObject_GetAttrString`. The picture
+with the reference, for instance :c:func:`PyObject_GetAttrString`. The picture
is less clear, here, however, since a few common routines are exceptions:
-:cfunc:`PyTuple_GetItem`, :cfunc:`PyList_GetItem`, :cfunc:`PyDict_GetItem`, and
-:cfunc:`PyDict_GetItemString` all return references that you borrow from the
+:c:func:`PyTuple_GetItem`, :c:func:`PyList_GetItem`, :c:func:`PyDict_GetItem`, and
+:c:func:`PyDict_GetItemString` all return references that you borrow from the
tuple, list or dictionary.
-The function :cfunc:`PyImport_AddModule` also returns a borrowed reference, even
+The function :c:func:`PyImport_AddModule` also returns a borrowed reference, even
though it may actually create the object it returns: this is possible because an
owned reference to the object is stored in ``sys.modules``.
When you pass an object reference into another function, in general, the
function borrows the reference from you --- if it needs to store it, it will use
-:cfunc:`Py_INCREF` to become an independent owner. There are exactly two
-important exceptions to this rule: :cfunc:`PyTuple_SetItem` and
-:cfunc:`PyList_SetItem`. These functions take over ownership of the item passed
-to them --- even if they fail! (Note that :cfunc:`PyDict_SetItem` and friends
+:c:func:`Py_INCREF` to become an independent owner. There are exactly two
+important exceptions to this rule: :c:func:`PyTuple_SetItem` and
+:c:func:`PyList_SetItem`. These functions take over ownership of the item passed
+to them --- even if they fail! (Note that :c:func:`PyDict_SetItem` and friends
don't take over ownership --- they are "normal.")
When a C function is called from Python, it borrows references to its arguments
from the caller. The caller owns a reference to the object, so the borrowed
reference's lifetime is guaranteed until the function returns. Only when such a
borrowed reference must be stored or passed on, it must be turned into an owned
-reference by calling :cfunc:`Py_INCREF`.
+reference by calling :c:func:`Py_INCREF`.
The object reference returned from a C function that is called from Python must
be an owned reference --- ownership is transferred from the function to its
@@ -965,7 +967,7 @@ There are a few situations where seemingly harmless use of a borrowed reference
can lead to problems. These all have to do with implicit invocations of the
interpreter, which can cause the owner of a reference to dispose of it.
-The first and most important case to know about is using :cfunc:`Py_DECREF` on
+The first and most important case to know about is using :c:func:`Py_DECREF` on
an unrelated object while borrowing a reference to a list item. For instance::
void
@@ -981,7 +983,7 @@ This function first borrows a reference to ``list[0]``, then replaces
``list[1]`` with the value ``0``, and finally prints the borrowed reference.
Looks harmless, right? But it's not!
-Let's follow the control flow into :cfunc:`PyList_SetItem`. The list owns
+Let's follow the control flow into :c:func:`PyList_SetItem`. The list owns
references to all its items, so when item 1 is replaced, it has to dispose of
the original item 1. Now let's suppose the original item 1 was an instance of a
user-defined class, and let's further suppose that the class defined a
@@ -990,8 +992,8 @@ disposing of it will call its :meth:`__del__` method.
Since it is written in Python, the :meth:`__del__` method can execute arbitrary
Python code. Could it perhaps do something to invalidate the reference to
-``item`` in :cfunc:`bug`? You bet! Assuming that the list passed into
-:cfunc:`bug` is accessible to the :meth:`__del__` method, it could execute a
+``item`` in :c:func:`bug`? You bet! Assuming that the list passed into
+:c:func:`bug` is accessible to the :meth:`__del__` method, it could execute a
statement to the effect of ``del list[0]``, and assuming this was the last
reference to that object, it would free the memory associated with it, thereby
invalidating ``item``.
@@ -1018,8 +1020,8 @@ The second case of problems with a borrowed reference is a variant involving
threads. Normally, multiple threads in the Python interpreter can't get in each
other's way, because there is a global lock protecting Python's entire object
space. However, it is possible to temporarily release this lock using the macro
-:cmacro:`Py_BEGIN_ALLOW_THREADS`, and to re-acquire it using
-:cmacro:`Py_END_ALLOW_THREADS`. This is common around blocking I/O calls, to
+:c:macro:`Py_BEGIN_ALLOW_THREADS`, and to re-acquire it using
+:c:macro:`Py_END_ALLOW_THREADS`. This is common around blocking I/O calls, to
let other threads use the processor while waiting for the I/O to complete.
Obviously, the following function has the same problem as the previous one::
@@ -1048,11 +1050,11 @@ function --- if each function were to test for *NULL*, there would be a lot of
redundant tests and the code would run more slowly.
It is better to test for *NULL* only at the "source:" when a pointer that may be
-*NULL* is received, for example, from :cfunc:`malloc` or from a function that
+*NULL* is received, for example, from :c:func:`malloc` or from a function that
may raise an exception.
-The macros :cfunc:`Py_INCREF` and :cfunc:`Py_DECREF` do not check for *NULL*
-pointers --- however, their variants :cfunc:`Py_XINCREF` and :cfunc:`Py_XDECREF`
+The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for *NULL*
+pointers --- however, their variants :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF`
do.
The macros for checking for a particular object type (``Pytype_Check()``) don't
@@ -1126,7 +1128,7 @@ other extension modules must be exported in a different way.
Python provides a special mechanism to pass C-level information (pointers) from
one extension module to another one: Capsules. A Capsule is a Python data type
-which stores a pointer (:ctype:`void \*`). Capsules can only be created and
+which stores a pointer (:c:type:`void \*`). Capsules can only be created and
accessed via their C API, but they can be passed around like any other Python
object. In particular, they can be assigned to a name in an extension module's
namespace. Other extension modules can then import this module, retrieve the
@@ -1139,8 +1141,8 @@ various tasks of storing and retrieving the pointers can be distributed in
different ways between the module providing the code and the client modules.
Whichever method you choose, it's important to name your Capsules properly.
-The function :cfunc:`PyCapsule_New` takes a name parameter
-(:ctype:`const char \*`); you're permitted to pass in a *NULL* name, but
+The function :c:func:`PyCapsule_New` takes a name parameter
+(:c:type:`const char \*`); you're permitted to pass in a *NULL* name, but
we strongly encourage you to specify a name. Properly named Capsules provide
a degree of runtime type-safety; there is no feasible way to tell one unnamed
Capsule from another.
@@ -1150,7 +1152,7 @@ this convention::
modulename.attributename
-The convenience function :cfunc:`PyCapsule_Import` makes it easy to
+The convenience function :c:func:`PyCapsule_Import` makes it easy to
load a C API provided via a Capsule, but only if the Capsule's name
matches this convention. This behavior gives C API users a high degree
of certainty that the Capsule they load contains the correct C API.
@@ -1158,19 +1160,19 @@ of certainty that the Capsule they load contains the correct C API.
The following example demonstrates an approach that puts most of the burden on
the writer of the exporting module, which is appropriate for commonly used
library modules. It stores all C API pointers (just one in the example!) in an
-array of :ctype:`void` pointers which becomes the value of a Capsule. The header
+array of :c:type:`void` pointers which becomes the value of a Capsule. The header
file corresponding to the module provides a macro that takes care of importing
the module and retrieving its C API pointers; client modules only have to call
this macro before accessing the C API.
The exporting module is a modification of the :mod:`spam` module from section
:ref:`extending-simpleexample`. The function :func:`spam.system` does not call
-the C library function :cfunc:`system` directly, but a function
-:cfunc:`PySpam_System`, which would of course do something more complicated in
+the C library function :c:func:`system` directly, but a function
+:c:func:`PySpam_System`, which would of course do something more complicated in
reality (such as adding "spam" to every command). This function
-:cfunc:`PySpam_System` is also exported to other extension modules.
+:c:func:`PySpam_System` is also exported to other extension modules.
-The function :cfunc:`PySpam_System` is a plain C function, declared
+The function :c:func:`PySpam_System` is a plain C function, declared
``static`` like everything else::
static int
@@ -1179,7 +1181,7 @@ The function :cfunc:`PySpam_System` is a plain C function, declared
return system(command);
}
-The function :cfunc:`spam_system` is modified in a trivial way::
+The function :c:func:`spam_system` is modified in a trivial way::
static PyObject *
spam_system(PyObject *self, PyObject *args)
@@ -1283,8 +1285,8 @@ like this::
#endif /* !defined(Py_SPAMMODULE_H) */
All that a client module must do in order to have access to the function
-:cfunc:`PySpam_System` is to call the function (or rather macro)
-:cfunc:`import_spam` in its initialization function::
+:c:func:`PySpam_System` is to call the function (or rather macro)
+:c:func:`import_spam` in its initialization function::
PyMODINIT_FUNC
PyInit_client(void)
diff --git a/Doc/extending/newtypes.rst b/Doc/extending/newtypes.rst
index d48efc94f1..75836c7807 100644
--- a/Doc/extending/newtypes.rst
+++ b/Doc/extending/newtypes.rst
@@ -26,7 +26,7 @@ The Basics
==========
The Python runtime sees all Python objects as variables of type
-:ctype:`PyObject\*`. A :ctype:`PyObject` is not a very magnificent object - it
+:c:type:`PyObject\*`. A :c:type:`PyObject` is not a very magnificent object - it
just contains the refcount and a pointer to the object's "type object". This is
where the action is; the type object determines which (C) functions get called
when, for instance, an attribute gets looked up on an object or it is multiplied
@@ -95,7 +95,7 @@ Moving on, we come to the crunch --- the type object. ::
"Noddy objects", /* tp_doc */
};
-Now if you go and look up the definition of :ctype:`PyTypeObject` in
+Now if you go and look up the definition of :c:type:`PyTypeObject` in
:file:`object.h` you'll see that it has many more fields that the definition
above. The remaining fields will be filled with zeros by the C compiler, and
it's common practice to not specify them explicitly unless you need them.
@@ -111,7 +111,7 @@ This line is a bit of a wart; what we'd like to write is::
as the type of a type object is "type", but this isn't strictly conforming C and
some compilers complain. Fortunately, this member will be filled in for us by
-:cfunc:`PyType_Ready`. ::
+:c:func:`PyType_Ready`. ::
"noddy.Noddy", /* tp_name */
@@ -130,7 +130,7 @@ the type is :class:`Noddy`, so we set the type name to :class:`noddy.Noddy`. ::
sizeof(noddy_NoddyObject), /* tp_basicsize */
This is so that Python knows how much memory to allocate when you call
-:cfunc:`PyObject_New`.
+:c:func:`PyObject_New`.
.. note::
@@ -170,12 +170,12 @@ the module. We'll expand this example later to have more interesting behavior.
For now, all we want to be able to do is to create new :class:`Noddy` objects.
To enable object creation, we have to provide a :attr:`tp_new` implementation.
In this case, we can just use the default implementation provided by the API
-function :cfunc:`PyType_GenericNew`. We'd like to just assign this to the
+function :c:func:`PyType_GenericNew`. We'd like to just assign this to the
:attr:`tp_new` slot, but we can't, for portability sake, On some platforms or
compilers, we can't statically initialize a structure member with a function
defined in another C module, so, instead, we'll assign the :attr:`tp_new` slot
in the module initialization function just before calling
-:cfunc:`PyType_Ready`::
+:c:func:`PyType_Ready`::
noddy_NoddyType.tp_new = PyType_GenericNew;
if (PyType_Ready(&noddy_NoddyType) < 0)
@@ -185,7 +185,7 @@ All the other type methods are *NULL*, so we'll go over them later --- that's
for a later section!
Everything else in the file should be familiar, except for some code in
-:cfunc:`PyInit_noddy`::
+:c:func:`PyInit_noddy`::
if (PyType_Ready(&noddy_NoddyType) < 0)
return;
@@ -273,7 +273,7 @@ which is assigned to the :attr:`tp_dealloc` member::
(destructor)Noddy_dealloc, /*tp_dealloc*/
This method decrements the reference counts of the two Python attributes. We use
-:cfunc:`Py_XDECREF` here because the :attr:`first` and :attr:`last` members
+:c:func:`Py_XDECREF` here because the :attr:`first` and :attr:`last` members
could be *NULL*. It then calls the :attr:`tp_free` member of the object's type
to free the object's memory. Note that the object's type might not be
:class:`NoddyType`, because the object may be an instance of a subclass.
@@ -319,8 +319,8 @@ the :meth:`__new__` method. One reason to implement a new method is to assure
the initial values of instance variables. In this case, we use the new method
to make sure that the initial values of the members :attr:`first` and
:attr:`last` are not *NULL*. If we didn't care whether the initial values were
-*NULL*, we could have used :cfunc:`PyType_GenericNew` as our new method, as we
-did before. :cfunc:`PyType_GenericNew` initializes all of the instance variable
+*NULL*, we could have used :c:func:`PyType_GenericNew` as our new method, as we
+did before. :c:func:`PyType_GenericNew` initializes all of the instance variable
members to *NULL*.
The new method is a static method that is passed the type being instantiated and
@@ -330,7 +330,7 @@ often ignore the arguments, leaving the argument handling to initializer
methods. Note that if the type supports subclassing, the type passed may not be
the type being defined. The new method calls the tp_alloc slot to allocate
memory. We don't fill the :attr:`tp_alloc` slot ourselves. Rather
-:cfunc:`PyType_Ready` fills it for us by inheriting it from our base class,
+:c:func:`PyType_Ready` fills it for us by inheriting it from our base class,
which is :class:`object` by default. Most types use the default allocation.
.. note::
@@ -515,8 +515,8 @@ object being created or used, so all we need to do is to add the
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
-We rename :cfunc:`PyInit_noddy` to :cfunc:`PyInit_noddy2` and update the module
-name in the :ctype:`PyModuleDef` struct.
+We rename :c:func:`PyInit_noddy` to :c:func:`PyInit_noddy2` and update the module
+name in the :c:type:`PyModuleDef` struct.
Finally, we update our :file:`setup.py` file to build the new module::
@@ -582,7 +582,7 @@ closure. The new value may be *NULL*, in which case the attribute is being
deleted. In our setter, we raise an error if the attribute is deleted or if the
attribute value is not a string.
-We create an array of :ctype:`PyGetSetDef` structures::
+We create an array of :c:type:`PyGetSetDef` structures::
static PyGetSetDef Noddy_getseters[] = {
{"first",
@@ -602,7 +602,7 @@ and register it in the :attr:`tp_getset` slot::
to register our attribute getters and setters.
-The last item in a :ctype:`PyGetSetDef` structure is the closure mentioned
+The last item in a :c:type:`PyGetSetDef` structure is the closure mentioned
above. In this case, we aren't using the closure, so we just pass *NULL*.
We also remove the member definitions for these attributes::
@@ -647,8 +647,8 @@ be passed::
With these changes, we can assure that the :attr:`first` and :attr:`last`
members are never *NULL* so we can remove checks for *NULL* values in almost all
-cases. This means that most of the :cfunc:`Py_XDECREF` calls can be converted to
-:cfunc:`Py_DECREF` calls. The only place we can't change these calls is in the
+cases. This means that most of the :c:func:`Py_XDECREF` calls can be converted to
+:c:func:`Py_DECREF` calls. The only place we can't change these calls is in the
deallocator, where there is the possibility that the initialization of these
members failed in the constructor.
@@ -713,13 +713,13 @@ cycles::
}
For each subobject that can participate in cycles, we need to call the
-:cfunc:`visit` function, which is passed to the traversal method. The
-:cfunc:`visit` function takes as arguments the subobject and the extra argument
+:c:func:`visit` function, which is passed to the traversal method. The
+:c:func:`visit` function takes as arguments the subobject and the extra argument
*arg* passed to the traversal method. It returns an integer value that must be
returned if it is non-zero.
-Python provides a :cfunc:`Py_VISIT` macro that automates calling visit
-functions. With :cfunc:`Py_VISIT`, :cfunc:`Noddy_traverse` can be simplified::
+Python provides a :c:func:`Py_VISIT` macro that automates calling visit
+functions. With :c:func:`Py_VISIT`, :c:func:`Noddy_traverse` can be simplified::
static int
Noddy_traverse(Noddy *self, visitproc visit, void *arg)
@@ -732,7 +732,7 @@ functions. With :cfunc:`Py_VISIT`, :cfunc:`Noddy_traverse` can be simplified::
.. note::
Note that the :attr:`tp_traverse` implementation must name its arguments exactly
- *visit* and *arg* in order to use :cfunc:`Py_VISIT`. This is to encourage
+ *visit* and *arg* in order to use :c:func:`Py_VISIT`. This is to encourage
uniformity across these boring implementations.
We also need to provide a method for clearing any subobjects that can
@@ -762,18 +762,18 @@ to use it::
Py_TYPE(self)->tp_free((PyObject*)self);
}
-Notice the use of a temporary variable in :cfunc:`Noddy_clear`. We use the
+Notice the use of a temporary variable in :c:func:`Noddy_clear`. We use the
temporary variable so that we can set each member to *NULL* before decrementing
its reference count. We do this because, as was discussed earlier, if the
reference count drops to zero, we might cause code to run that calls back into
the object. In addition, because we now support garbage collection, we also
have to worry about code being run that triggers garbage collection. If garbage
collection is run, our :attr:`tp_traverse` handler could get called. We can't
-take a chance of having :cfunc:`Noddy_traverse` called when a member's reference
+take a chance of having :c:func:`Noddy_traverse` called when a member's reference
count has dropped to zero and its value hasn't been set to *NULL*.
-Python provides a :cfunc:`Py_CLEAR` that automates the careful decrementing of
-reference counts. With :cfunc:`Py_CLEAR`, the :cfunc:`Noddy_clear` function can
+Python provides a :c:func:`Py_CLEAR` that automates the careful decrementing of
+reference counts. With :c:func:`Py_CLEAR`, the :c:func:`Noddy_clear` function can
be simplified::
static int
@@ -829,7 +829,7 @@ previous sections. We will break down the main differences between them. ::
The primary difference for derived type objects is that the base type's object
structure must be the first value. The base type will already include the
-:cfunc:`PyObject_HEAD` at the beginning of its structure.
+:c:func:`PyObject_HEAD` at the beginning of its structure.
When a Python object is a :class:`Shoddy` instance, its *PyObject\** pointer can
be safely cast to both *PyListObject\** and *Shoddy\**. ::
@@ -851,10 +851,10 @@ This pattern is important when writing a type with custom :attr:`new` and
memory for the object with :attr:`tp_alloc`, that will be handled by the base
class when calling its :attr:`tp_new`.
-When filling out the :cfunc:`PyTypeObject` for the :class:`Shoddy` type, you see
-a slot for :cfunc:`tp_base`. Due to cross platform compiler issues, you can't
-fill that field directly with the :cfunc:`PyList_Type`; it can be done later in
-the module's :cfunc:`init` function. ::
+When filling out the :c:func:`PyTypeObject` for the :class:`Shoddy` type, you see
+a slot for :c:func:`tp_base`. Due to cross platform compiler issues, you can't
+fill that field directly with the :c:func:`PyList_Type`; it can be done later in
+the module's :c:func:`init` function. ::
PyMODINIT_FUNC
PyInit_shoddy(void)
@@ -874,12 +874,12 @@ the module's :cfunc:`init` function. ::
return m;
}
-Before calling :cfunc:`PyType_Ready`, the type structure must have the
+Before calling :c:func:`PyType_Ready`, the type structure must have the
:attr:`tp_base` slot filled in. When we are deriving a new type, it is not
-necessary to fill out the :attr:`tp_alloc` slot with :cfunc:`PyType_GenericNew`
+necessary to fill out the :attr:`tp_alloc` slot with :c:func:`PyType_GenericNew`
-- the allocate function from the base type will be inherited.
-After that, calling :cfunc:`PyType_Ready` and adding the type object to the
+After that, calling :c:func:`PyType_Ready` and adding the type object to the
module is the same as with the basic :class:`Noddy` examples.
@@ -891,7 +891,7 @@ Type Methods
This section aims to give a quick fly-by on the various type methods you can
implement and what they do.
-Here is the definition of :ctype:`PyTypeObject`, with some fields only used in
+Here is the definition of :c:type:`PyTypeObject`, with some fields only used in
debug builds omitted:
.. literalinclude:: ../includes/typestruct.h
@@ -969,8 +969,8 @@ which a deallocator performs which may cause additional Python code to be
executed may detect that an exception has been set. This can lead to misleading
errors from the interpreter. The proper way to protect against this is to save
a pending exception before performing the unsafe action, and restoring it when
-done. This can be done using the :cfunc:`PyErr_Fetch` and
-:cfunc:`PyErr_Restore` functions::
+done. This can be done using the :c:func:`PyErr_Fetch` and
+:c:func:`PyErr_Restore` functions::
static void
my_dealloc(PyObject *obj)
@@ -1060,8 +1060,8 @@ a special case, for which the new value passed to the handler is *NULL*.
Python supports two pairs of attribute handlers; a type that supports attributes
only needs to implement the functions for one pair. The difference is that one
-pair takes the name of the attribute as a :ctype:`char\*`, while the other
-accepts a :ctype:`PyObject\*`. Each type can use whichever pair makes more
+pair takes the name of the attribute as a :c:type:`char\*`, while the other
+accepts a :c:type:`PyObject\*`. Each type can use whichever pair makes more
sense for the implementation's convenience. ::
getattrfunc tp_getattr; /* char * version */
@@ -1072,7 +1072,7 @@ sense for the implementation's convenience. ::
If accessing attributes of an object is always a simple operation (this will be
explained shortly), there are generic implementations which can be used to
-provide the :ctype:`PyObject\*` version of the attribute management functions.
+provide the :c:type:`PyObject\*` version of the attribute management functions.
The actual need for type-specific attribute handlers almost completely
disappeared starting with Python 2.2, though there are many examples which have
not been updated to use some of the new generic mechanism that is available.
@@ -1086,7 +1086,7 @@ Generic Attribute Management
Most extension types only use *simple* attributes. So, what makes the
attributes simple? There are only a couple of conditions that must be met:
-#. The name of the attributes must be known when :cfunc:`PyType_Ready` is
+#. The name of the attributes must be known when :c:func:`PyType_Ready` is
called.
#. No special processing is needed to record that an attribute was looked up or
@@ -1095,7 +1095,7 @@ attributes simple? There are only a couple of conditions that must be met:
Note that this list does not place any restrictions on the values of the
attributes, when the values are computed, or how relevant data is stored.
-When :cfunc:`PyType_Ready` is called, it uses three tables referenced by the
+When :c:func:`PyType_Ready` is called, it uses three tables referenced by the
type object to create :term:`descriptor`\s which are placed in the dictionary of the
type object. Each descriptor controls access to one attribute of the instance
object. Each of the tables is optional; if all three are *NULL*, instances of
@@ -1110,7 +1110,7 @@ The tables are declared as three fields of the type object::
struct PyGetSetDef *tp_getset;
If :attr:`tp_methods` is not *NULL*, it must refer to an array of
-:ctype:`PyMethodDef` structures. Each entry in the table is an instance of this
+:c:type:`PyMethodDef` structures. Each entry in the table is an instance of this
structure::
typedef struct PyMethodDef {
@@ -1192,9 +1192,9 @@ of *NULL* is required.
Type-specific Attribute Management
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-For simplicity, only the :ctype:`char\*` version will be demonstrated here; the
-type of the name parameter is the only difference between the :ctype:`char\*`
-and :ctype:`PyObject\*` flavors of the interface. This example effectively does
+For simplicity, only the :c:type:`char\*` version will be demonstrated here; the
+type of the name parameter is the only difference between the :c:type:`char\*`
+and :c:type:`PyObject\*` flavors of the interface. This example effectively does
the same thing as the generic example above, but does not use the generic
support added in Python 2.2. It explains how the handler functions are
called, so that if you do need to extend their functionality, you'll understand
@@ -1242,8 +1242,8 @@ Object Comparison
The :attr:`tp_richcompare` handler is called when comparisons are needed. It is
analogous to the :ref:`rich comparison methods <richcmpfuncs>`, like
-:meth:`__lt__`, and also called by :cfunc:`PyObject_RichCompare` and
-:cfunc:`PyObject_RichCompareBool`.
+:meth:`__lt__`, and also called by :c:func:`PyObject_RichCompare` and
+:c:func:`PyObject_RichCompareBool`.
This function is called with two Python objects and the operator as arguments,
where the operator is one of ``Py_EQ``, ``Py_NE``, ``Py_LE``, ``Py_GT``,
@@ -1306,8 +1306,8 @@ to indicate the presence of a slot, but a slot may still be unfilled.) ::
If you wish your object to be able to act like a number, a sequence, or a
mapping object, then you place the address of a structure that implements the C
-type :ctype:`PyNumberMethods`, :ctype:`PySequenceMethods`, or
-:ctype:`PyMappingMethods`, respectively. It is up to you to fill in this
+type :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, or
+:c:type:`PyMappingMethods`, respectively. It is up to you to fill in this
structure with appropriate values. You can find examples of the use of each of
these in the :file:`Objects` directory of the Python source distribution. ::
@@ -1339,11 +1339,11 @@ This function takes three arguments:
the call is ``obj1('hello')``, then *arg1* is ``obj1``.
#. *arg2* is a tuple containing the arguments to the call. You can use
- :cfunc:`PyArg_ParseTuple` to extract the arguments.
+ :c:func:`PyArg_ParseTuple` to extract the arguments.
#. *arg3* is a dictionary of keyword arguments that were passed. If this is
non-*NULL* and you support keyword arguments, use
- :cfunc:`PyArg_ParseTupleAndKeywords` to extract the arguments. If you do not
+ :c:func:`PyArg_ParseTupleAndKeywords` to extract the arguments. If you do not
want to support keyword arguments and this is non-*NULL*, raise a
:exc:`TypeError` with a message saying that keyword arguments are not supported.
@@ -1417,7 +1417,7 @@ to participate in the weak reference mechanism without incurring the overhead on
those objects which do not benefit by weak referencing (such as numbers).
For an object to be weakly referencable, the extension must include a
-:ctype:`PyObject\*` field in the instance structure for the use of the weak
+:c:type:`PyObject\*` field in the instance structure for the use of the weak
reference mechanism; it must be initialized to *NULL* by the object's
constructor. It must also set the :attr:`tp_weaklistoffset` field of the
corresponding type object to the offset of the field. For example, the instance
@@ -1493,7 +1493,7 @@ the function you want (for example, ``tp_richcompare``). You will find examples
of the function you want to implement.
When you need to verify that an object is an instance of the type you are
-implementing, use the :cfunc:`PyObject_TypeCheck` function. A sample of its use
+implementing, use the :c:func:`PyObject_TypeCheck` function. A sample of its use
might be something like the following::
if (! PyObject_TypeCheck(some_object, &MyType)) {
diff --git a/Doc/extending/windows.rst b/Doc/extending/windows.rst
index d1d0cf7ee9..3fd5e576de 100644
--- a/Doc/extending/windows.rst
+++ b/Doc/extending/windows.rst
@@ -98,8 +98,8 @@ described here are distributed with the Python sources in the
it. Copy your C sources into it. Note that the module source file name does
not necessarily have to match the module name, but the name of the
initialization function should match the module name --- you can only import a
- module :mod:`spam` if its initialization function is called :cfunc:`initspam`,
- and it should call :cfunc:`Py_InitModule` with the string ``"spam"`` as its
+ module :mod:`spam` if its initialization function is called :c:func:`initspam`,
+ and it should call :c:func:`Py_InitModule` with the string ``"spam"`` as its
first argument (use the minimal :file:`example.c` in this directory as a guide).
By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`.
The output file should be called :file:`spam.pyd` (in Release mode) or
@@ -259,7 +259,7 @@ use these commands::
The first command created three files: :file:`spam.obj`, :file:`spam.dll` and
:file:`spam.lib`. :file:`Spam.dll` does not contain any Python functions (such
-as :cfunc:`PyArg_ParseTuple`), but it does know how to find the Python code
+as :c:func:`PyArg_ParseTuple`), but it does know how to find the Python code
thanks to :file:`pythonXY.lib`.
The second command created :file:`ni.dll` (and :file:`.obj` and :file:`.lib`),
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst
index 3889774ee5..b9faf576bf 100644
--- a/Doc/faq/design.rst
+++ b/Doc/faq/design.rst
@@ -418,11 +418,9 @@ much speed.
.. XXX check which of these projects are still alive
There are also several programs which make it easier to intermingle Python and C
-code in various ways to increase performance. See, for example, `Psyco
-<http://psyco.sourceforge.net/>`_, `Pyrex
-<http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/>`_, `PyInline
-<http://pyinline.sourceforge.net/>`_, `Py2Cmod
-<http://sourceforge.net/projects/py2cmod/>`_, and `Weave
+code in various ways to increase performance. See, for example, `Cython
+<http://cython.org/>`_, `Pyrex
+<http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/>`_ and `Weave
<http://www.scipy.org/Weave>`_.
@@ -649,9 +647,10 @@ order to remind you of that fact, it does not return the sorted list. This way,
you won't be fooled into accidentally overwriting a list when you need a sorted
copy but also need to keep the unsorted version around.
-In Python 2.4 a new builtin -- :func:`sorted` -- has been added. This function
-creates a new list from a provided iterable, sorts it and returns it. For
-example, here's how to iterate over the keys of a dictionary in sorted order::
+In Python 2.4 a new built-in function -- :func:`sorted` -- has been added.
+This function creates a new list from a provided iterable, sorts it and returns
+it. For example, here's how to iterate over the keys of a dictionary in sorted
+order::
for key in sorted(mydict):
... # do whatever with mydict[key]...
diff --git a/Doc/faq/extending.rst b/Doc/faq/extending.rst
index 6527ff189b..fa8e6e77ed 100644
--- a/Doc/faq/extending.rst
+++ b/Doc/faq/extending.rst
@@ -45,10 +45,11 @@ time-critical functions in your code, and gain a significant improvement with
very little effort, as long as you're running on a machine with an
x86-compatible processor.
-`Pyrex <http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/>`_ is a compiler
-that accepts a slightly modified form of Python and generates the corresponding
-C code. Pyrex makes it possible to write an extension without having to learn
-Python's C API.
+`Cython <http://cython.org>`_ and its relative `Pyrex
+<http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/>`_ are compilers
+that accept a slightly modified form of Python and generate the corresponding
+C code. Cython and Pyrex make it possible to write an extension without having
+to learn Python's C API.
If you need to interface to some C or C++ library for which no Python extension
currently exists, you can try wrapping the library's data types and functions
@@ -56,47 +57,48 @@ with a tool such as `SWIG <http://www.swig.org>`_. `SIP
<http://www.riverbankcomputing.co.uk/software/sip/>`__, `CXX
<http://cxx.sourceforge.net/>`_ `Boost
<http://www.boost.org/libs/python/doc/index.html>`_, or `Weave
-<http://www.scipy.org/Weave>`_ are also alternatives for wrapping C++ libraries.
+<http://www.scipy.org/Weave>`_ are also alternatives for wrapping
+C++ libraries.
How can I execute arbitrary Python statements from C?
-----------------------------------------------------
-The highest-level function to do this is :cfunc:`PyRun_SimpleString` which takes
+The highest-level function to do this is :c:func:`PyRun_SimpleString` which takes
a single string argument to be executed in the context of the module
``__main__`` and returns 0 for success and -1 when an exception occurred
(including ``SyntaxError``). If you want more control, use
-:cfunc:`PyRun_String`; see the source for :cfunc:`PyRun_SimpleString` in
+:c:func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in
``Python/pythonrun.c``.
How can I evaluate an arbitrary Python expression from C?
---------------------------------------------------------
-Call the function :cfunc:`PyRun_String` from the previous question with the
-start symbol :cdata:`Py_eval_input`; it parses an expression, evaluates it and
+Call the function :c:func:`PyRun_String` from the previous question with the
+start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it and
returns its value.
How do I extract C values from a Python object?
-----------------------------------------------
-That depends on the object's type. If it's a tuple, :cfunc:`PyTuple_Size`
-returns its length and :cfunc:`PyTuple_GetItem` returns the item at a specified
-index. Lists have similar functions, :cfunc:`PyListSize` and
-:cfunc:`PyList_GetItem`.
+That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size`
+returns its length and :c:func:`PyTuple_GetItem` returns the item at a specified
+index. Lists have similar functions, :c:func:`PyListSize` and
+:c:func:`PyList_GetItem`.
-For strings, :cfunc:`PyString_Size` returns its length and
-:cfunc:`PyString_AsString` a pointer to its value. Note that Python strings may
-contain null bytes so C's :cfunc:`strlen` should not be used.
+For strings, :c:func:`PyString_Size` returns its length and
+:c:func:`PyString_AsString` a pointer to its value. Note that Python strings may
+contain null bytes so C's :c:func:`strlen` should not be used.
To test the type of an object, first make sure it isn't *NULL*, and then use
-:cfunc:`PyString_Check`, :cfunc:`PyTuple_Check`, :cfunc:`PyList_Check`, etc.
+:c:func:`PyString_Check`, :c:func:`PyTuple_Check`, :c:func:`PyList_Check`, etc.
There is also a high-level API to Python objects which is provided by the
so-called 'abstract' interface -- read ``Include/abstract.h`` for further
details. It allows interfacing with any kind of Python sequence using calls
-like :cfunc:`PySequence_Length`, :cfunc:`PySequence_GetItem`, etc.) as well as
+like :c:func:`PySequence_Length`, :c:func:`PySequence_GetItem`, etc.) as well as
many other useful protocols.
@@ -105,7 +107,7 @@ How do I use Py_BuildValue() to create a tuple of arbitrary length?
You can't. Use ``t = PyTuple_New(n)`` instead, and fill it with objects using
``PyTuple_SetItem(t, i, o)`` -- note that this "eats" a reference count of
-``o``, so you have to :cfunc:`Py_INCREF` it. Lists have similar functions
+``o``, so you have to :c:func:`Py_INCREF` it. Lists have similar functions
``PyList_New(n)`` and ``PyList_SetItem(l, i, o)``. Note that you *must* set all
the tuple items to some value before you pass the tuple to Python code --
``PyTuple_New(n)`` initializes them to NULL, which isn't a valid Python value.
@@ -114,9 +116,9 @@ the tuple items to some value before you pass the tuple to Python code --
How do I call an object's method from C?
----------------------------------------
-The :cfunc:`PyObject_CallMethod` function can be used to call an arbitrary
+The :c:func:`PyObject_CallMethod` function can be used to call an arbitrary
method of an object. The parameters are the object, the name of the method to
-call, a format string like that used with :cfunc:`Py_BuildValue`, and the
+call, a format string like that used with :c:func:`Py_BuildValue`, and the
argument values::
PyObject *
@@ -124,7 +126,7 @@ argument values::
char *arg_format, ...);
This works for any object that has methods -- whether built-in or user-defined.
-You are responsible for eventually :cfunc:`Py_DECREF`\ 'ing the return value.
+You are responsible for eventually :c:func:`Py_DECREF`\ 'ing the return value.
To call, e.g., a file object's "seek" method with arguments 10, 0 (assuming the
file object pointer is "f")::
@@ -137,7 +139,7 @@ file object pointer is "f")::
Py_DECREF(res);
}
-Note that since :cfunc:`PyObject_CallObject` *always* wants a tuple for the
+Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the
argument list, to call a function without arguments, pass "()" for the format,
and to call a function with one argument, surround the argument in parentheses,
e.g. "(i)".
@@ -188,7 +190,7 @@ module) as follows::
attr = PyObject_GetAttrString(module, "<attrname>");
-Calling :cfunc:`PyObject_SetAttrString` to assign to variables in the module
+Calling :c:func:`PyObject_SetAttrString` to assign to variables in the module
also works.
@@ -201,11 +203,7 @@ begin by reading :ref:`the "Extending and Embedding" document
whole lot of difference between C and C++ -- so the strategy of building a new
Python type around a C structure (pointer) type will also work for C++ objects.
-For C++ libraries, you can look at `SIP
-<http://www.riverbankcomputing.co.uk/sip/>`_, `CXX
-<http://cxx.sourceforge.net/>`_, `Boost
-<http://www.boost.org/libs/python/doc/index.html>`_, `Weave
-<http://www.scipy.org/Weave>`_ or `SWIG <http://www.swig.org>`_
+For C++ libraries, see :ref:`c-wrapper-software`.
I added a module using the Setup file and the make fails; why?
@@ -273,16 +271,16 @@ the input is invalid.
In Python you can use the :mod:`codeop` module, which approximates the parser's
behavior sufficiently. IDLE uses this, for example.
-The easiest way to do it in C is to call :cfunc:`PyRun_InteractiveLoop` (perhaps
+The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` (perhaps
in a separate thread) and let the Python interpreter handle the input for
-you. You can also set the :cfunc:`PyOS_ReadlineFunctionPointer` to point at your
+you. You can also set the :c:func:`PyOS_ReadlineFunctionPointer` to point at your
custom input function. See ``Modules/readline.c`` and ``Parser/myreadline.c``
for more hints.
However sometimes you have to run the embedded Python interpreter in the same
thread as your rest application and you can't allow the
-:cfunc:`PyRun_InteractiveLoop` to stop while waiting for user input. The one
-solution then is to call :cfunc:`PyParser_ParseString` and test for ``e.error``
+:c:func:`PyRun_InteractiveLoop` to stop while waiting for user input. The one
+solution then is to call :c:func:`PyParser_ParseString` and test for ``e.error``
equal to ``E_EOF``, which means the input is incomplete). Here's a sample code
fragment, untested, inspired by code from Alex Farber::
@@ -313,8 +311,8 @@ fragment, untested, inspired by code from Alex Farber::
}
Another solution is trying to compile the received string with
-:cfunc:`Py_CompileString`. If it compiles without errors, try to execute the
-returned code object by calling :cfunc:`PyEval_EvalCode`. Otherwise save the
+:c:func:`Py_CompileString`. If it compiles without errors, try to execute the
+returned code object by calling :c:func:`PyEval_EvalCode`. Otherwise save the
input for later. If the compilation fails, find out if it's an error or just
more input is required - by extracting the message string from the exception
tuple and comparing it to the string "unexpected EOF while parsing". Here is a
@@ -382,7 +380,7 @@ complete example using the GNU readline library (you may want to ignore
if (ps1 == prompt || /* ">>> " or */
'\n' == code[i + j - 1]) /* "... " and double '\n' */
{ /* so execute it */
- dum = PyEval_EvalCode ((PyCodeObject *)src, glb, loc);
+ dum = PyEval_EvalCode (src, glb, loc);
Py_XDECREF (dum);
Py_XDECREF (src);
free (code);
@@ -443,7 +441,7 @@ extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``).
Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)?
----------------------------------------------------------------------------------------------------------------
-In Python 2.2, you can inherit from builtin classes such as :class:`int`,
+In Python 2.2, you can inherit from built-in classes such as :class:`int`,
:class:`list`, :class:`dict`, etc.
The Boost Python Library (BPL, http://www.boost.org/libs/python/doc/index.html)
@@ -466,8 +464,8 @@ This can easily occur when using pre-built extension packages. RedHat Linux
7.x, in particular, provided a "python2" binary that is compiled with 4-byte
Unicode. This only causes the link failure if the extension uses any of the
``PyUnicode_*()`` functions. It is also a problem if an extension uses any of
-the Unicode-related format specifiers for :cfunc:`Py_BuildValue` (or similar) or
-parameter specifications for :cfunc:`PyArg_ParseTuple`.
+the Unicode-related format specifiers for :c:func:`Py_BuildValue` (or similar) or
+parameter specifications for :c:func:`PyArg_ParseTuple`.
You can check the size of the Unicode character a Python interpreter is using by
checking the value of sys.maxunicode:
diff --git a/Doc/faq/gui.rst b/Doc/faq/gui.rst
index 03177c9586..e502ef81e8 100644
--- a/Doc/faq/gui.rst
+++ b/Doc/faq/gui.rst
@@ -15,7 +15,9 @@ General GUI Questions
What platform-independent GUI toolkits exist for Python?
========================================================
-Depending on what platform(s) you are aiming at, there are several.
+Depending on what platform(s) you are aiming at, there are several. Some
+of them haven't been ported to Python 3 yet. At least `Tkinter`_ and `Qt`_
+are known to be Python 3-compatible.
.. XXX check links
@@ -23,12 +25,14 @@ Tkinter
-------
Standard builds of Python include an object-oriented interface to the Tcl/Tk
-widget set, called Tkinter. This is probably the easiest to install and use.
-For more info about Tk, including pointers to the source, see the Tcl/Tk home
-page at http://www.tcl.tk. Tcl/Tk is fully portable to the MacOS, Windows, and
-Unix platforms.
-
-wxWindows
+widget set, called :ref:`tkinter <Tkinter>`. This is probably the easiest to
+install (since it comes included with most
+`binary distributions <http://www.python.org/download/>`_ of Python) and use.
+For more info about Tk, including pointers to the source, see the
+`Tcl/Tk home page <http://www.tcl.tk>`_. Tcl/Tk is fully portable to the
+MacOS, Windows, and Unix platforms.
+
+wxWidgets
---------
wxWidgets (http://www.wxwidgets.org) is a free, portable GUI class
@@ -47,22 +51,25 @@ Both wxWidgets and wxPython are free, open source, software with
permissive licences that allow their use in commercial products as
well as in freeware or shareware.
+
Qt
---
-There are bindings available for the Qt toolkit (`PyQt
-<http://www.riverbankcomputing.co.uk/software/pyqt/>`_) and for KDE (PyKDE). If
-you're writing open source software, you don't need to pay for PyQt, but if you
-want to write proprietary applications, you must buy a PyQt license from
-`Riverbank Computing <http://www.riverbankcomputing.co.uk>`_ and (up to Qt 4.4;
-Qt 4.5 upwards is licensed under the LGPL license) a Qt license from `Trolltech
-<http://www.trolltech.com>`_.
+There are bindings available for the Qt toolkit (using either `PyQt
+<http://www.riverbankcomputing.co.uk/software/pyqt/>`_ or `PySide
+<http://www.pyside.org/>`_) and for KDE (`PyKDE <http://www.riverbankcomputing.co.uk/software/pykde/intro>`__).
+PyQt is currently more mature than PySide, but you must buy a PyQt license from
+`Riverbank Computing <http://www.riverbankcomputing.co.uk/software/pyqt/license>`_
+if you want to write proprietary applications. PySide is free for all applications.
+
+Qt 4.5 upwards is licensed under the LGPL license; also, commercial licenses
+are available from `Nokia <http://qt.nokia.com/>`_.
Gtk+
----
PyGtk bindings for the `Gtk+ toolkit <http://www.gtk.org>`_ have been
-implemented by by James Henstridge; see ftp://ftp.gtk.org/pub/gtk/python/.
+implemented by James Henstridge; see <http://www.pygtk.org>.
FLTK
----
@@ -91,14 +98,15 @@ What platform-specific GUI toolkits exist for Python?
`The Mac port <http://python.org/download/mac>`_ by Jack Jansen has a rich and
ever-growing set of modules that support the native Mac toolbox calls. The port
-includes support for MacOS9 and MacOS X's Carbon libraries. By installing the
-`PyObjc Objective-C bridge <http://pyobjc.sourceforge.net>`_, Python programs
-can use MacOS X's Cocoa libraries. See the documentation that comes with the Mac
-port.
+supports MacOS X's Carbon libraries.
+
+By installing the `PyObjc Objective-C bridge
+<http://pyobjc.sourceforge.net>`_, Python programs can use MacOS X's
+Cocoa libraries. See the documentation that comes with the Mac port.
:ref:`Pythonwin <windows-faq>` by Mark Hammond includes an interface to the
-Microsoft Foundation Classes and a Python programming environment using it
-that's written mostly in Python.
+Microsoft Foundation Classes and a Python programming environment
+that's written mostly in Python using the MFC classes.
Tkinter questions
@@ -111,23 +119,26 @@ Freeze is a tool to create stand-alone applications. When freezing Tkinter
applications, the applications will not be truly stand-alone, as the application
will still need the Tcl and Tk libraries.
-One solution is to ship the application with the tcl and tk libraries, and point
+One solution is to ship the application with the Tcl and Tk libraries, and point
to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:`TK_LIBRARY`
environment variables.
To get truly stand-alone applications, the Tcl scripts that form the library
have to be integrated into the application as well. One tool supporting that is
SAM (stand-alone modules), which is part of the Tix distribution
-(http://tix.mne.com). Build Tix with SAM enabled, perform the appropriate call
-to Tclsam_init etc inside Python's Modules/tkappinit.c, and link with libtclsam
-and libtksam (you might include the Tix libraries as well).
+(http://tix.sourceforge.net/).
+
+Build Tix with SAM enabled, perform the appropriate call to
+:c:func:`Tclsam_init`, etc. inside Python's
+:file:`Modules/tkappinit.c`, and link with libtclsam and libtksam (you
+might include the Tix libraries as well).
Can I have Tk events handled while waiting for I/O?
---------------------------------------------------
Yes, and you don't even need threads! But you'll have to restructure your I/O
-code a bit. Tk has the equivalent of Xt's XtAddInput() call, which allows you
+code a bit. Tk has the equivalent of Xt's :c:func:`XtAddInput()` call, which allows you
to register a callback function which will be called from the Tk mainloop when
I/O is possible on a file descriptor. Here's what you need::
diff --git a/Doc/faq/installed.rst b/Doc/faq/installed.rst
index 390c85abe4..efec9bf791 100644
--- a/Doc/faq/installed.rst
+++ b/Doc/faq/installed.rst
@@ -24,14 +24,14 @@ there are several possible ways it could have gotten there.
it; you'll have to figure out who's been using the machine and might have
installed it.
* A third-party application installed on the machine might have been written in
- Python and included a Python installation. For a home computer, the most
- common such application is `PySol <http://pysolfc.sourceforge.net/>`_, a
- solitaire game that includes over 1000 different games and variations.
+ Python and included a Python installation. There are many such applications,
+ from GUI programs to network servers and administrative scripts.
* Some Windows machines also have Python installed. At this writing we're aware
of computers from Hewlett-Packard and Compaq that include Python. Apparently
some of HP/Compaq's administrative tools are written in Python.
-* All Apple computers running Mac OS X have Python installed; it's included in
- the base installation.
+* Many Unix-compatible operating systems, such as Mac OS X and some Linux
+ distributions, have Python installed by default; it's included in the base
+ installation.
Can I delete Python?
diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst
index 180bd3916f..ee099cfbe9 100644
--- a/Doc/faq/library.rst
+++ b/Doc/faq/library.rst
@@ -25,10 +25,10 @@ your topic of interest will usually find something helpful.
Where is the math.py (socket.py, regex.py, etc.) source file?
-------------------------------------------------------------
-If you can't find a source file for a module it may be a builtin or dynamically
-loaded module implemented in C, C++ or other compiled language. In this case
-you may not have the source file or it may be something like mathmodule.c,
-somewhere in a C source directory (not on the Python Path).
+If you can't find a source file for a module it may be a built-in or
+dynamically loaded module implemented in C, C++ or other compiled language.
+In this case you may not have the source file or it may be something like
+mathmodule.c, somewhere in a C source directory (not on the Python Path).
There are (at least) three kinds of modules in Python:
@@ -285,11 +285,15 @@ queue as there are threads.
How do I parcel out work among a bunch of worker threads?
---------------------------------------------------------
-Use the :mod:`queue` module to create a queue containing a list of jobs. The
-:class:`~queue.Queue` class maintains a list of objects with ``.put(obj)`` to
-add an item to the queue and ``.get()`` to return an item. The class will take
-care of the locking necessary to ensure that each job is handed out exactly
-once.
+The easiest way is to use the new :mod:`concurrent.futures` module,
+especially the :mod:`~concurrent.futures.ThreadPoolExecutor` class.
+
+Or, if you want fine control over the dispatching algorithm, you can write
+your own logic manually. Use the :mod:`queue` module to create a queue
+containing a list of jobs. The :class:`~queue.Queue` class maintains a
+list of objects with ``.put(obj)`` to add an item to the queue and ``.get()``
+to return an item. The class will take care of the locking necessary to
+ensure that each job is handed out exactly once.
Here's a trivial example::
@@ -352,7 +356,7 @@ provides a featureful interface.
What kinds of global value mutation are thread-safe?
----------------------------------------------------
-A global interpreter lock (GIL) is used internally to ensure that only one
+A :term:`global interpreter lock` (GIL) is used internally to ensure that only one
thread runs in the Python VM at a time. In general, Python offers to switch
among threads only between bytecode instructions; how frequently it switches can
be set via :func:`sys.setswitchinterval`. Each bytecode instruction and
@@ -361,7 +365,7 @@ therefore atomic from the point of view of a Python program.
In theory, this means an exact accounting requires an exact understanding of the
PVM bytecode implementation. In practice, it means that operations on shared
-variables of builtin data types (ints, lists, dicts, etc) that "look atomic"
+variables of built-in data types (ints, lists, dicts, etc) that "look atomic"
really are.
For example, the following operations are all atomic (L, L1, L2 are lists, D,
@@ -395,32 +399,34 @@ lists. When in doubt, use a mutex!
Can't we get rid of the Global Interpreter Lock?
------------------------------------------------
-.. XXX mention multiprocessing
.. XXX link to dbeazley's talk about GIL?
-The Global Interpreter Lock (GIL) is often seen as a hindrance to Python's
+The :term:`global interpreter lock` (GIL) is often seen as a hindrance to Python's
deployment on high-end multiprocessor server machines, because a multi-threaded
Python program effectively only uses one CPU, due to the insistence that
(almost) all Python code can only run while the GIL is held.
Back in the days of Python 1.5, Greg Stein actually implemented a comprehensive
patch set (the "free threading" patches) that removed the GIL and replaced it
-with fine-grained locking. Unfortunately, even on Windows (where locks are very
-efficient) this ran ordinary Python code about twice as slow as the interpreter
-using the GIL. On Linux the performance loss was even worse because pthread
-locks aren't as efficient.
-
-Since then, the idea of getting rid of the GIL has occasionally come up but
-nobody has found a way to deal with the expected slowdown, and users who don't
-use threads would not be happy if their code ran at half at the speed. Greg's
-free threading patch set has not been kept up-to-date for later Python versions.
+with fine-grained locking. Adam Olsen recently did a similar experiment
+in his `python-safethread <http://code.google.com/p/python-safethread/>`_
+project. Unfortunately, both experiments exhibited a sharp drop in single-thread
+performance (at least 30% slower), due to the amount of fine-grained locking
+necessary to compensate for the removal of the GIL.
This doesn't mean that you can't make good use of Python on multi-CPU machines!
You just have to be creative with dividing the work up between multiple
-*processes* rather than multiple *threads*. Judicious use of C extensions will
-also help; if you use a C extension to perform a time-consuming task, the
-extension can release the GIL while the thread of execution is in the C code and
-allow other threads to get some work done.
+*processes* rather than multiple *threads*. The
+:class:`~concurrent.futures.ProcessPoolExecutor` class in the new
+:mod:`concurrent.futures` module provides an easy way of doing so; the
+:mod:`multiprocessing` module provides a lower-level API in case you want
+more control over dispatching of tasks.
+
+Judicious use of C extensions will also help; if you use a C extension to
+perform a time-consuming task, the extension can release the GIL while the
+thread of execution is in the C code and allow other threads to get some work
+done. Some standard library modules such as :mod:`zlib` and :mod:`hashlib`
+already do this.
It has been suggested that the GIL should be a per-interpreter-state lock rather
than truly global; interpreters then wouldn't be able to share objects.
@@ -511,9 +517,9 @@ I can't seem to use os.read() on a pipe created with os.popen(); why?
:func:`os.read` is a low-level function which takes a file descriptor, a small
integer representing the opened file. :func:`os.popen` creates a high-level
-file object, the same type returned by the builtin :func:`open` function. Thus,
-to read n bytes from a pipe p created with :func:`os.popen`, you need to use
-``p.read(n)``.
+file object, the same type returned by the built-in :func:`open` function.
+Thus, to read n bytes from a pipe p created with :func:`os.popen`, you need to
+use ``p.read(n)``.
.. XXX update to use subprocess. See the :ref:`subprocess-replacements` section.
@@ -751,7 +757,8 @@ some sample code::
How do I avoid blocking in the connect() method of a socket?
------------------------------------------------------------
-The select module is commonly used to help with asynchronous I/O on sockets.
+The :mod:`select` module is commonly used to help with asynchronous I/O on
+sockets.
To prevent the TCP connect from blocking, you can set the socket to non-blocking
mode. Then when you do the ``connect()``, you will either connect immediately
@@ -765,6 +772,12 @@ just return the errno value. To poll, you can call ``connect_ex()`` again later
-- ``0`` or ``errno.EISCONN`` indicate that you're connected -- or you can pass this
socket to select to check if it's writable.
+.. note::
+ The :mod:`asyncore` module presents a framework-like approach to the problem
+ of writing non-blocking networking code.
+ The third-party `Twisted <http://twistedmatrix.com/>`_ library is
+ a popular and feature-rich alternative.
+
Databases
=========
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index 7226e703a1..07e681837a 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -127,9 +127,9 @@ increased speed.
.. XXX seems to have overlap with other questions!
-`Pyrex <http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/>`_ can compile a
-slightly modified version of Python code into a C extension, and can be used on
-many different platforms.
+`Cython <http://cython.org>`_ and `Pyrex <http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/>`_
+can compile a slightly modified version of Python code into a C extension, and
+can be used on many different platforms.
`Psyco <http://psyco.sourceforge.net>`_ is a just-in-time compiler that
translates Python code into x86 assembly language. If you can use it, Psyco can
@@ -178,9 +178,10 @@ it is much shorter and far faster to use ::
L2 = list(L1[:3]) # "list" is redundant if L1 is a list.
-Note that the functionally-oriented builtins such as :func:`map`, :func:`zip`,
-and friends can be a convenient accelerator for loops that perform a single
-task. For example to pair the elements of two lists together::
+Note that the functionally-oriented built-in functions such as :func:`map`,
+:func:`zip`, and friends can be a convenient accelerator for loops that
+perform a single task. For example to pair the elements of two lists
+together::
>>> list(zip([1, 2, 3], [4, 5, 6]))
[(1, 4), (2, 5), (3, 6)]
@@ -203,7 +204,7 @@ manipulating strings, use the ``replace()`` and the ``format()`` :ref:`methods
on string objects <string-methods>`. Use regular expressions only when you're
not dealing with constant string patterns.
-Be sure to use the :meth:`list.sort` builtin method to do sorting, and see the
+Be sure to use the :meth:`list.sort` built-in method to do sorting, and see the
`sorting mini-HOWTO <http://wiki.python.org/moin/HowTo/Sorting>`_ for examples
of moderately advanced usage. :meth:`list.sort` beats other techniques for
sorting in all but the most extreme circumstances.
@@ -361,7 +362,7 @@ Though a bit surprising at first, a moment's consideration explains this. On
one hand, requiring :keyword:`global` for assigned variables provides a bar
against unintended side-effects. On the other hand, if ``global`` was required
for all global references, you'd be using ``global`` all the time. You'd have
-to declare as global every reference to a builtin function or to a component of
+to declare as global every reference to a built-in function or to a component of
an imported module. This clutter would defeat the usefulness of the ``global``
declaration for identifying side-effects.
@@ -987,8 +988,8 @@ and then convert decimal strings to numeric values using :func:`int` or
:func:`float`. ``split()`` supports an optional "sep" parameter which is useful
if the line uses something other than whitespace as a separator.
-For more complicated input parsing, regular expressions more powerful than C's
-:cfunc:`sscanf` and better suited for the task.
+For more complicated input parsing, regular expressions are more powerful
+than C's :c:func:`sscanf` and better suited for the task.
What does 'UnicodeDecodeError' or 'UnicodeEncodeError' error mean?
@@ -1033,7 +1034,7 @@ trailing newline from a string.
How do I iterate over a sequence in reverse order?
--------------------------------------------------
-Use the :func:`reversed` builtin function, which is new in Python 2.4::
+Use the :func:`reversed` built-in function, which is new in Python 2.4::
for x in reversed(sequence):
... # do something with x...
diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst
index 7cd16b0f11..8a20950773 100644
--- a/Doc/faq/windows.rst
+++ b/Doc/faq/windows.rst
@@ -445,7 +445,7 @@ present, and ``getch()`` which gets one character without echoing it.
How do I emulate os.kill() in Windows?
--------------------------------------
-To terminate a process, you can use ctypes::
+Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`::
import ctypes
@@ -455,6 +455,11 @@ To terminate a process, you can use ctypes::
handle = kernel32.OpenProcess(1, 0, pid)
return (0 != kernel32.TerminateProcess(handle, 0))
+In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function,
+with the additional feature of being able to send CTRL+C and CTRL+BREAK
+to console subprocesses which are designed to handle those signals. See
+:func:`os.kill` for further details.
+
Why does os.path.isdir() fail on NT shared directories?
-------------------------------------------------------
@@ -536,7 +541,7 @@ assumed by the Python interpreter it won't work.
The Python 1.5.* DLLs (``python15.dll``) are all compiled with MS VC++ 5.0 and
with multithreading-DLL options (``/MD``).
-If you can't change compilers or flags, try using :cfunc:`Py_RunSimpleString`.
+If you can't change compilers or flags, try using :c:func:`Py_RunSimpleString`.
A trick to get it to run an arbitrary file is to construct a call to
:func:`execfile` with the name of your file as argument.
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index 743154510f..ec8af62553 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -27,7 +27,7 @@ Glossary
:ref:`2to3-reference`.
abstract base class
- Abstract Base Classes (abbreviated ABCs) complement :term:`duck-typing` by
+ :ref:`abstract-base-classes` complement :term:`duck-typing` by
providing a way to define interfaces when other techniques like
:func:`hasattr` would be clumsy. Python comes with many built-in ABCs for
data structures (in the :mod:`collections` module), numbers (in the
@@ -57,11 +57,14 @@ Glossary
bytecode
Python source code is compiled into bytecode, the internal representation
- of a Python program in the interpreter. The bytecode is also cached in
- ``.pyc`` and ``.pyo`` files so that executing the same file is faster the
- second time (recompilation from source to bytecode can be avoided). This
- "intermediate language" is said to run on a :term:`virtual machine`
- that executes the machine code corresponding to each bytecode.
+ of a Python program in the CPython interpreter. The bytecode is also
+ cached in ``.pyc`` and ``.pyo`` files so that executing the same file is
+ faster the second time (recompilation from source to bytecode can be
+ avoided). This "intermediate language" is said to run on a
+ :term:`virtual machine` that executes the machine code corresponding to
+ each bytecode. Do note that bytecodes are not expected to work between
+ different Python virtual machines, nor to be stable between Python
+ releases.
A list of bytecode instructions can be found in the documentation for
:ref:`the dis module <bytecodes>`.
@@ -234,6 +237,8 @@ Glossary
performs garbage collection via reference counting and a cyclic garbage
collector that is able to detect and break reference cycles.
+ .. index:: single: generator
+
generator
A function which returns an iterator. It looks like a normal function
except that it contains :keyword:`yield` statements for producing a series
@@ -247,7 +252,7 @@ Glossary
.. index:: single: generator expression
generator expression
- An expression that returns a generator. It looks like a normal expression
+ An expression that returns an iterator. It looks like a normal expression
followed by a :keyword:`for` expression defining a loop variable, range,
and an optional :keyword:`if` expression. The combined expression
generates values for an enclosing function::
@@ -327,7 +332,7 @@ Glossary
slowly. See also :term:`interactive`.
iterable
- A container object capable of returning its members one at a
+ An object capable of returning its members one at a
time. Examples of iterables include all sequence types (such as
:class:`list`, :class:`str`, and :class:`tuple`) and some non-sequence
types like :class:`dict` and :class:`file` and objects of any classes you
@@ -397,6 +402,12 @@ Glossary
the :term:`EAFP` approach and is characterized by the presence of many
:keyword:`if` statements.
+ In a multi-threaded environment, the LBYL approach can risk introducing a
+ race condition between "the looking" and "the leaping". For example, the
+ code, ``if key in mapping: return mapping[key]`` can fail if another
+ thread removes *key* from *mapping* after the test, but before the lookup.
+ This issue can be solved with locks or by using the EAFP approach.
+
list
A built-in Python :term:`sequence`. Despite its name it is more akin
to an array in other languages than to a linked list since access to
@@ -417,9 +428,11 @@ Glossary
:class:`importlib.abc.Loader` for an :term:`abstract base class`.
mapping
- A container object (such as :class:`dict`) which supports arbitrary key
- lookups using the special method :meth:`__getitem__`. Mappings also
- support :meth:`__len__`, :meth:`__iter__`, and :meth:`__contains__`.
+ A container object that supports arbitrary key lookups and implements the
+ methods specified in the :class:`Mapping` or :class:`MutableMapping`
+ :ref:`abstract base classes <abstract-base-classes>`. Examples include
+ :class:`dict`, :class:`collections.defaultdict`,
+ :class:`collections.OrderedDict` and :class:`collections.Counter`.
metaclass
The class of a class. Class definitions create a class name, a class
@@ -440,6 +453,14 @@ Glossary
its first :term:`argument` (which is usually called ``self``).
See :term:`function` and :term:`nested scope`.
+ method resolution order
+ Method Resolution Order is the order in which base classes are searched
+ for a member during lookup. See `The Python 2.3 Method Resolution Order
+ <http://www.python.org/download/releases/2.3/mro/>`_.
+
+ MRO
+ See :term:`method resolution order`.
+
mutable
Mutable objects can change their value but keep their :func:`id`. See
also :term:`immutable`.
diff --git a/Doc/howto/cporting.rst b/Doc/howto/cporting.rst
index d20e4a6a94..71844969b6 100644
--- a/Doc/howto/cporting.rst
+++ b/Doc/howto/cporting.rst
@@ -22,7 +22,7 @@ Conditional compilation
=======================
The easiest way to compile only some code for 3.0 is to check if
-:cmacro:`PY_MAJOR_VERSION` is greater than or equal to 3. ::
+:c:macro:`PY_MAJOR_VERSION` is greater than or equal to 3. ::
#if PY_MAJOR_VERSION >= 3
#define IS_PY3K
@@ -47,12 +47,12 @@ Python 3.0's :func:`str` (``PyString_*`` functions in C) type is equivalent to
2.x's :func:`unicode` (``PyUnicode_*``). The old 8-bit string type has become
:func:`bytes`. Python 2.6 and later provide a compatibility header,
:file:`bytesobject.h`, mapping ``PyBytes`` names to ``PyString`` ones. For best
-compatibility with 3.0, :ctype:`PyUnicode` should be used for textual data and
-:ctype:`PyBytes` for binary data. It's also important to remember that
-:ctype:`PyBytes` and :ctype:`PyUnicode` in 3.0 are not interchangeable like
-:ctype:`PyString` and :ctype:`PyUnicode` are in 2.x. The following example
-shows best practices with regards to :ctype:`PyUnicode`, :ctype:`PyString`,
-and :ctype:`PyBytes`. ::
+compatibility with 3.0, :c:type:`PyUnicode` should be used for textual data and
+:c:type:`PyBytes` for binary data. It's also important to remember that
+:c:type:`PyBytes` and :c:type:`PyUnicode` in 3.0 are not interchangeable like
+:c:type:`PyString` and :c:type:`PyUnicode` are in 2.x. The following example
+shows best practices with regards to :c:type:`PyUnicode`, :c:type:`PyString`,
+and :c:type:`PyBytes`. ::
#include "stdlib.h"
#include "Python.h"
@@ -120,7 +120,7 @@ can also be used in some cases. ::
Module initialization and state
===============================
-Python 3.0 has a revamped extension module initialization system. (See PEP
+Python 3.0 has a revamped extension module initialization system. (See
:pep:`3121`.) Instead of storing module state in globals, they should be stored
in an interpreter specific structure. Creating modules that act correctly in
both 2.x and 3.0 is tricky. The following simple example demonstrates how. ::
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
index cdb6a8ec3d..81bb8ca534 100644
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -97,7 +97,7 @@ transforms ``b.x`` into ``type(b).__dict__['x'].__get__(b, type(b))``. The
implementation works through a precedence chain that gives data descriptors
priority over instance variables, instance variables priority over non-data
descriptors, and assigns lowest priority to :meth:`__getattr__` if provided. The
-full C implementation can be found in :cfunc:`PyObject_GenericGetAttr()` in
+full C implementation can be found in :c:func:`PyObject_GenericGetAttr()` in
`Objects/object.c <http://svn.python.org/view/python/trunk/Objects/object.c?view=markup>`_\.
For classes, the machinery is in :meth:`type.__getattribute__` which transforms
@@ -131,7 +131,7 @@ search using :meth:`object.__getattribute__`.
Note, in Python 2.2, ``super(B, obj).m()`` would only invoke :meth:`__get__` if
``m`` was a data descriptor. In Python 2.3, non-data descriptors also get
invoked unless an old-style class is involved. The implementation details are
-in :cfunc:`super_getattro()` in
+in :c:func:`super_getattro()` in
`Objects/typeobject.c <http://svn.python.org/view/python/trunk/Objects/typeobject.c?view=markup>`_
and a pure Python equivalent can be found in `Guido's Tutorial`_.
@@ -297,7 +297,7 @@ Running the interpreter shows how the function descriptor works in practice::
The output suggests that bound and unbound methods are two different types.
While they could have been implemented that way, the actual C implementation of
-:ctype:`PyMethod_Type` in
+:c:type:`PyMethod_Type` in
`Objects/classobject.c <http://svn.python.org/view/python/trunk/Objects/classobject.c?view=markup>`_
is a single object with two different representations depending on whether the
:attr:`im_self` field is set or is *NULL* (the C equivalent of *None*).
diff --git a/Doc/howto/doanddont.rst b/Doc/howto/doanddont.rst
deleted file mode 100644
index 365a6209d4..0000000000
--- a/Doc/howto/doanddont.rst
+++ /dev/null
@@ -1,290 +0,0 @@
-************************************
- Idioms and Anti-Idioms in Python
-************************************
-
-:Author: Moshe Zadka
-
-This document is placed in the public domain.
-
-
-.. topic:: Abstract
-
- This document can be considered a companion to the tutorial. It shows how to use
- Python, and even more importantly, how *not* to use Python.
-
-
-Language Constructs You Should Not Use
-======================================
-
-While Python has relatively few gotchas compared to other languages, it still
-has some constructs which are only useful in corner cases, or are plain
-dangerous.
-
-
-from module import \*
----------------------
-
-
-Inside Function Definitions
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-``from module import *`` is *invalid* inside function definitions. While many
-versions of Python do not check for the invalidity, it does not make it more
-valid, no more than having a smart lawyer makes a man innocent. Do not use it
-like that ever. Even in versions where it was accepted, it made the function
-execution slower, because the compiler could not be certain which names are
-local and which are global. In Python 2.1 this construct causes warnings, and
-sometimes even errors.
-
-
-At Module Level
-^^^^^^^^^^^^^^^
-
-While it is valid to use ``from module import *`` at module level it is usually
-a bad idea. For one, this loses an important property Python otherwise has ---
-you can know where each toplevel name is defined by a simple "search" function
-in your favourite editor. You also open yourself to trouble in the future, if
-some module grows additional functions or classes.
-
-One of the most awful question asked on the newsgroup is why this code::
-
- f = open("www")
- f.read()
-
-does not work. Of course, it works just fine (assuming you have a file called
-"www".) But it does not work if somewhere in the module, the statement ``from os
-import *`` is present. The :mod:`os` module has a function called :func:`open`
-which returns an integer. While it is very useful, shadowing builtins is one of
-its least useful properties.
-
-Remember, you can never know for sure what names a module exports, so either
-take what you need --- ``from module import name1, name2``, or keep them in the
-module and access on a per-need basis --- ``import module; print(module.name)``.
-
-
-When It Is Just Fine
-^^^^^^^^^^^^^^^^^^^^
-
-There are situations in which ``from module import *`` is just fine:
-
-* The interactive prompt. For example, ``from math import *`` makes Python an
- amazing scientific calculator.
-
-* When extending a module in C with a module in Python.
-
-* When the module advertises itself as ``from import *`` safe.
-
-
-from module import name1, name2
--------------------------------
-
-This is a "don't" which is much weaker than the previous "don't"s but is still
-something you should not do if you don't have good reasons to do that. The
-reason it is usually bad idea is because you suddenly have an object which lives
-in two separate namespaces. When the binding in one namespace changes, the
-binding in the other will not, so there will be a discrepancy between them. This
-happens when, for example, one module is reloaded, or changes the definition of
-a function at runtime.
-
-Bad example::
-
- # foo.py
- a = 1
-
- # bar.py
- from foo import a
- if something():
- a = 2 # danger: foo.a != a
-
-Good example::
-
- # foo.py
- a = 1
-
- # bar.py
- import foo
- if something():
- foo.a = 2
-
-
-except:
--------
-
-Python has the ``except:`` clause, which catches all exceptions. Since *every*
-error in Python raises an exception, using ``except:`` can make many
-programming errors look like runtime problems, which hinders the debugging
-process.
-
-The following code shows a great example of why this is bad::
-
- try:
- foo = opne("file") # misspelled "open"
- except:
- sys.exit("could not open file!")
-
-The second line triggers a :exc:`NameError`, which is caught by the except
-clause. The program will exit, and the error message the program prints will
-make you think the problem is the readability of ``"file"`` when in fact
-the real error has nothing to do with ``"file"``.
-
-A better way to write the above is ::
-
- try:
- foo = opne("file")
- except IOError:
- sys.exit("could not open file")
-
-When this is run, Python will produce a traceback showing the :exc:`NameError`,
-and it will be immediately apparent what needs to be fixed.
-
-.. index:: bare except, except; bare
-
-Because ``except:`` catches *all* exceptions, including :exc:`SystemExit`,
-:exc:`KeyboardInterrupt`, and :exc:`GeneratorExit` (which is not an error and
-should not normally be caught by user code), using a bare ``except:`` is almost
-never a good idea. In situations where you need to catch all "normal" errors,
-such as in a framework that runs callbacks, you can catch the base class for
-all normal exceptions, :exc:`Exception`.
-
-
-Exceptions
-==========
-
-Exceptions are a useful feature of Python. You should learn to raise them
-whenever something unexpected occurs, and catch them only where you can do
-something about them.
-
-The following is a very popular anti-idiom ::
-
- def get_status(file):
- if not os.path.exists(file):
- print("file not found")
- sys.exit(1)
- return open(file).readline()
-
-Consider the case where the file gets deleted between the time the call to
-:func:`os.path.exists` is made and the time :func:`open` is called. In that
-case the last line will raise an :exc:`IOError`. The same thing would happen
-if *file* exists but has no read permission. Since testing this on a normal
-machine on existent and non-existent files makes it seem bugless, the test
-results will seem fine, and the code will get shipped. Later an unhandled
-:exc:`IOError` (or perhaps some other :exc:`EnvironmentError`) escapes to the
-user, who gets to watch the ugly traceback.
-
-Here is a somewhat better way to do it. ::
-
- def get_status(file):
- try:
- return open(file).readline()
- except EnvironmentError as err:
- print("Unable to open file: {}".format(err))
- sys.exit(1)
-
-In this version, *either* the file gets opened and the line is read (so it
-works even on flaky NFS or SMB connections), or an error message is printed
-that provides all the available information on why the open failed, and the
-application is aborted.
-
-However, even this version of :func:`get_status` makes too many assumptions ---
-that it will only be used in a short running script, and not, say, in a long
-running server. Sure, the caller could do something like ::
-
- try:
- status = get_status(log)
- except SystemExit:
- status = None
-
-But there is a better way. You should try to use as few ``except`` clauses in
-your code as you can --- the ones you do use will usually be inside calls which
-should always succeed, or a catch-all in a main function.
-
-So, an even better version of :func:`get_status()` is probably ::
-
- def get_status(file):
- return open(file).readline()
-
-The caller can deal with the exception if it wants (for example, if it tries
-several files in a loop), or just let the exception filter upwards to *its*
-caller.
-
-But the last version still has a serious problem --- due to implementation
-details in CPython, the file would not be closed when an exception is raised
-until the exception handler finishes; and, worse, in other implementations
-(e.g., Jython) it might not be closed at all regardless of whether or not
-an exception is raised.
-
-The best version of this function uses the ``open()`` call as a context
-manager, which will ensure that the file gets closed as soon as the
-function returns::
-
- def get_status(file):
- with open(file) as fp:
- return fp.readline()
-
-
-Using the Batteries
-===================
-
-Every so often, people seem to be writing stuff in the Python library again,
-usually poorly. While the occasional module has a poor interface, it is usually
-much better to use the rich standard library and data types that come with
-Python than inventing your own.
-
-A useful module very few people know about is :mod:`os.path`. It always has the
-correct path arithmetic for your operating system, and will usually be much
-better than whatever you come up with yourself.
-
-Compare::
-
- # ugh!
- return dir+"/"+file
- # better
- return os.path.join(dir, file)
-
-More useful functions in :mod:`os.path`: :func:`basename`, :func:`dirname` and
-:func:`splitext`.
-
-There are also many useful built-in functions people seem not to be aware of
-for some reason: :func:`min` and :func:`max` can find the minimum/maximum of
-any sequence with comparable semantics, for example, yet many people write
-their own :func:`max`/:func:`min`. Another highly useful function is
-:func:`functools.reduce` which can be used to repeatly apply a binary
-operation to a sequence, reducing it to a single value. For example, compute
-a factorial with a series of multiply operations::
-
- >>> n = 4
- >>> import operator, functools
- >>> functools.reduce(operator.mul, range(1, n+1))
- 24
-
-When it comes to parsing numbers, note that :func:`float`, :func:`int` and
-:func:`long` all accept string arguments and will reject ill-formed strings
-by raising an :exc:`ValueError`.
-
-
-Using Backslash to Continue Statements
-======================================
-
-Since Python treats a newline as a statement terminator, and since statements
-are often more than is comfortable to put in one line, many people do::
-
- if foo.bar()['first'][0] == baz.quux(1, 2)[5:9] and \
- calculate_number(10, 20) != forbulate(500, 360):
- pass
-
-You should realize that this is dangerous: a stray space after the ``\`` would
-make this line wrong, and stray spaces are notoriously hard to see in editors.
-In this case, at least it would be a syntax error, but if the code was::
-
- value = foo.bar()['first'][0]*baz.quux(1, 2)[5:9] \
- + calculate_number(10, 20)*forbulate(500, 360)
-
-then it would just be subtly wrong.
-
-It is usually much better to use the implicit continuation inside parenthesis:
-
-This version is bulletproof::
-
- value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9]
- + calculate_number(10, 20)*forbulate(500, 360))
-
diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst
index 417ae0047e..11fe108f73 100644
--- a/Doc/howto/index.rst
+++ b/Doc/howto/index.rst
@@ -14,11 +14,13 @@ Currently, the HOWTOs are:
:maxdepth: 1
advocacy.rst
+ pyporting.rst
cporting.rst
curses.rst
descriptor.rst
- doanddont.rst
functional.rst
+ logging.rst
+ logging-cookbook.rst
regex.rst
sockets.rst
sorting.rst
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst
new file mode 100644
index 0000000000..198d89231b
--- /dev/null
+++ b/Doc/howto/logging-cookbook.rst
@@ -0,0 +1,1039 @@
+.. _logging-cookbook:
+
+================
+Logging Cookbook
+================
+
+:Author: Vinay Sajip <vinay_sajip at red-dove dot com>
+
+This page contains a number of recipes related to logging, which have been found
+useful in the past.
+
+.. currentmodule:: logging
+
+Using logging in multiple modules
+---------------------------------
+
+Multiple calls to ``logging.getLogger('someLogger')`` return a reference to the
+same logger object. This is true not only within the same module, but also
+across modules as long as it is in the same Python interpreter process. It is
+true for references to the same object; additionally, application code can
+define and configure a parent logger in one module and create (but not
+configure) a child logger in a separate module, and all logger calls to the
+child will pass up to the parent. Here is a main module::
+
+ import logging
+ import auxiliary_module
+
+ # create logger with 'spam_application'
+ logger = logging.getLogger('spam_application')
+ logger.setLevel(logging.DEBUG)
+ # create file handler which logs even debug messages
+ fh = logging.FileHandler('spam.log')
+ fh.setLevel(logging.DEBUG)
+ # create console handler with a higher log level
+ ch = logging.StreamHandler()
+ ch.setLevel(logging.ERROR)
+ # create formatter and add it to the handlers
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+ fh.setFormatter(formatter)
+ ch.setFormatter(formatter)
+ # add the handlers to the logger
+ logger.addHandler(fh)
+ logger.addHandler(ch)
+
+ logger.info('creating an instance of auxiliary_module.Auxiliary')
+ a = auxiliary_module.Auxiliary()
+ logger.info('created an instance of auxiliary_module.Auxiliary')
+ logger.info('calling auxiliary_module.Auxiliary.do_something')
+ a.do_something()
+ logger.info('finished auxiliary_module.Auxiliary.do_something')
+ logger.info('calling auxiliary_module.some_function()')
+ auxiliary_module.some_function()
+ logger.info('done with auxiliary_module.some_function()')
+
+Here is the auxiliary module::
+
+ import logging
+
+ # create logger
+ module_logger = logging.getLogger('spam_application.auxiliary')
+
+ class Auxiliary:
+ def __init__(self):
+ self.logger = logging.getLogger('spam_application.auxiliary.Auxiliary')
+ self.logger.info('creating an instance of Auxiliary')
+ def do_something(self):
+ self.logger.info('doing something')
+ a = 1 + 1
+ self.logger.info('done doing something')
+
+ def some_function():
+ module_logger.info('received a call to "some_function"')
+
+The output looks like this::
+
+ 2005-03-23 23:47:11,663 - spam_application - INFO -
+ creating an instance of auxiliary_module.Auxiliary
+ 2005-03-23 23:47:11,665 - spam_application.auxiliary.Auxiliary - INFO -
+ creating an instance of Auxiliary
+ 2005-03-23 23:47:11,665 - spam_application - INFO -
+ created an instance of auxiliary_module.Auxiliary
+ 2005-03-23 23:47:11,668 - spam_application - INFO -
+ calling auxiliary_module.Auxiliary.do_something
+ 2005-03-23 23:47:11,668 - spam_application.auxiliary.Auxiliary - INFO -
+ doing something
+ 2005-03-23 23:47:11,669 - spam_application.auxiliary.Auxiliary - INFO -
+ done doing something
+ 2005-03-23 23:47:11,670 - spam_application - INFO -
+ finished auxiliary_module.Auxiliary.do_something
+ 2005-03-23 23:47:11,671 - spam_application - INFO -
+ calling auxiliary_module.some_function()
+ 2005-03-23 23:47:11,672 - spam_application.auxiliary - INFO -
+ received a call to 'some_function'
+ 2005-03-23 23:47:11,673 - spam_application - INFO -
+ done with auxiliary_module.some_function()
+
+Multiple handlers and formatters
+--------------------------------
+
+Loggers are plain Python objects. The :func:`addHandler` method has no minimum
+or maximum quota for the number of handlers you may add. Sometimes it will be
+beneficial for an application to log all messages of all severities to a text
+file while simultaneously logging errors or above to the console. To set this
+up, simply configure the appropriate handlers. The logging calls in the
+application code will remain unchanged. Here is a slight modification to the
+previous simple module-based configuration example::
+
+ import logging
+
+ logger = logging.getLogger('simple_example')
+ logger.setLevel(logging.DEBUG)
+ # create file handler which logs even debug messages
+ fh = logging.FileHandler('spam.log')
+ fh.setLevel(logging.DEBUG)
+ # create console handler with a higher log level
+ ch = logging.StreamHandler()
+ ch.setLevel(logging.ERROR)
+ # create formatter and add it to the handlers
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+ ch.setFormatter(formatter)
+ fh.setFormatter(formatter)
+ # add the handlers to logger
+ logger.addHandler(ch)
+ logger.addHandler(fh)
+
+ # 'application' code
+ logger.debug('debug message')
+ logger.info('info message')
+ logger.warn('warn message')
+ logger.error('error message')
+ logger.critical('critical message')
+
+Notice that the 'application' code does not care about multiple handlers. All
+that changed was the addition and configuration of a new handler named *fh*.
+
+The ability to create new handlers with higher- or lower-severity filters can be
+very helpful when writing and testing an application. Instead of using many
+``print`` statements for debugging, use ``logger.debug``: Unlike the print
+statements, which you will have to delete or comment out later, the logger.debug
+statements can remain intact in the source code and remain dormant until you
+need them again. At that time, the only change that needs to happen is to
+modify the severity level of the logger and/or handler to debug.
+
+.. _multiple-destinations:
+
+Logging to multiple destinations
+--------------------------------
+
+Let's say you want to log to console and file with different message formats and
+in differing circumstances. Say you want to log messages with levels of DEBUG
+and higher to file, and those messages at level INFO and higher to the console.
+Let's also assume that the file should contain timestamps, but the console
+messages should not. Here's how you can achieve this::
+
+ import logging
+
+ # set up logging to file - see previous section for more details
+ logging.basicConfig(level=logging.DEBUG,
+ format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
+ datefmt='%m-%d %H:%M',
+ filename='/temp/myapp.log',
+ filemode='w')
+ # define a Handler which writes INFO messages or higher to the sys.stderr
+ console = logging.StreamHandler()
+ console.setLevel(logging.INFO)
+ # set a format which is simpler for console use
+ formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
+ # tell the handler to use this format
+ console.setFormatter(formatter)
+ # add the handler to the root logger
+ logging.getLogger('').addHandler(console)
+
+ # Now, we can log to the root logger, or any other logger. First the root...
+ logging.info('Jackdaws love my big sphinx of quartz.')
+
+ # Now, define a couple of other loggers which might represent areas in your
+ # application:
+
+ logger1 = logging.getLogger('myapp.area1')
+ logger2 = logging.getLogger('myapp.area2')
+
+ logger1.debug('Quick zephyrs blow, vexing daft Jim.')
+ logger1.info('How quickly daft jumping zebras vex.')
+ logger2.warning('Jail zesty vixen who grabbed pay from quack.')
+ logger2.error('The five boxing wizards jump quickly.')
+
+When you run this, on the console you will see ::
+
+ root : INFO Jackdaws love my big sphinx of quartz.
+ myapp.area1 : INFO How quickly daft jumping zebras vex.
+ myapp.area2 : WARNING Jail zesty vixen who grabbed pay from quack.
+ myapp.area2 : ERROR The five boxing wizards jump quickly.
+
+and in the file you will see something like ::
+
+ 10-22 22:19 root INFO Jackdaws love my big sphinx of quartz.
+ 10-22 22:19 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.
+ 10-22 22:19 myapp.area1 INFO How quickly daft jumping zebras vex.
+ 10-22 22:19 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.
+ 10-22 22:19 myapp.area2 ERROR The five boxing wizards jump quickly.
+
+As you can see, the DEBUG message only shows up in the file. The other messages
+are sent to both destinations.
+
+This example uses console and file handlers, but you can use any number and
+combination of handlers you choose.
+
+
+Configuration server example
+----------------------------
+
+Here is an example of a module using the logging configuration server::
+
+ import logging
+ import logging.config
+ import time
+ import os
+
+ # read initial config file
+ logging.config.fileConfig('logging.conf')
+
+ # create and start listener on port 9999
+ t = logging.config.listen(9999)
+ t.start()
+
+ logger = logging.getLogger('simpleExample')
+
+ try:
+ # loop through logging calls to see the difference
+ # new configurations make, until Ctrl+C is pressed
+ while True:
+ logger.debug('debug message')
+ logger.info('info message')
+ logger.warn('warn message')
+ logger.error('error message')
+ logger.critical('critical message')
+ time.sleep(5)
+ except KeyboardInterrupt:
+ # cleanup
+ logging.config.stopListening()
+ t.join()
+
+And here is a script that takes a filename and sends that file to the server,
+properly preceded with the binary-encoded length, as the new logging
+configuration::
+
+ #!/usr/bin/env python
+ import socket, sys, struct
+
+ with open(sys.argv[1], 'rb') as f:
+ data_to_send = f.read()
+
+ HOST = 'localhost'
+ PORT = 9999
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ print('connecting...')
+ s.connect((HOST, PORT))
+ print('sending config...')
+ s.send(struct.pack('>L', len(data_to_send)))
+ s.send(data_to_send)
+ s.close()
+ print('complete')
+
+
+Dealing with handlers that block
+--------------------------------
+
+.. currentmodule:: logging.handlers
+
+Sometimes you have to get your logging handlers to do their work without
+blocking the thread you’re logging from. This is common in Web applications,
+though of course it also occurs in other scenarios.
+
+A common culprit which demonstrates sluggish behaviour is the
+:class:`SMTPHandler`: sending emails can take a long time, for a
+number of reasons outside the developer’s control (for example, a poorly
+performing mail or network infrastructure). But almost any network-based
+handler can block: Even a :class:`SocketHandler` operation may do a
+DNS query under the hood which is too slow (and this query can be deep in the
+socket library code, below the Python layer, and outside your control).
+
+One solution is to use a two-part approach. For the first part, attach only a
+:class:`QueueHandler` to those loggers which are accessed from
+performance-critical threads. They simply write to their queue, which can be
+sized to a large enough capacity or initialized with no upper bound to their
+size. The write to the queue will typically be accepted quickly, though you
+will probably need to catch the :exc:`queue.Full` exception as a precaution
+in your code. If you are a library developer who has performance-critical
+threads in their code, be sure to document this (together with a suggestion to
+attach only ``QueueHandlers`` to your loggers) for the benefit of other
+developers who will use your code.
+
+The second part of the solution is :class:`QueueListener`, which has been
+designed as the counterpart to :class:`QueueHandler`. A
+:class:`QueueListener` is very simple: it’s passed a queue and some handlers,
+and it fires up an internal thread which listens to its queue for LogRecords
+sent from ``QueueHandlers`` (or any other source of ``LogRecords``, for that
+matter). The ``LogRecords`` are removed from the queue and passed to the
+handlers for processing.
+
+The advantage of having a separate :class:`QueueListener` class is that you
+can use the same instance to service multiple ``QueueHandlers``. This is more
+resource-friendly than, say, having threaded versions of the existing handler
+classes, which would eat up one thread per handler for no particular benefit.
+
+An example of using these two classes follows (imports omitted)::
+
+ que = queue.Queue(-1) # no limit on size
+ queue_handler = QueueHandler(que)
+ handler = logging.StreamHandler()
+ listener = QueueListener(que, handler)
+ root = logging.getLogger()
+ root.addHandler(queue_handler)
+ formatter = logging.Formatter('%(threadName)s: %(message)s')
+ handler.setFormatter(formatter)
+ listener.start()
+ # The log output will display the thread which generated
+ # the event (the main thread) rather than the internal
+ # thread which monitors the internal queue. This is what
+ # you want to happen.
+ root.warning('Look out!')
+ listener.stop()
+
+which, when run, will produce::
+
+ MainThread: Look out!
+
+
+.. _network-logging:
+
+Sending and receiving logging events across a network
+-----------------------------------------------------
+
+Let's say you want to send logging events across a network, and handle them at
+the receiving end. A simple way of doing this is attaching a
+:class:`SocketHandler` instance to the root logger at the sending end::
+
+ import logging, logging.handlers
+
+ rootLogger = logging.getLogger('')
+ rootLogger.setLevel(logging.DEBUG)
+ socketHandler = logging.handlers.SocketHandler('localhost',
+ logging.handlers.DEFAULT_TCP_LOGGING_PORT)
+ # don't bother with a formatter, since a socket handler sends the event as
+ # an unformatted pickle
+ rootLogger.addHandler(socketHandler)
+
+ # Now, we can log to the root logger, or any other logger. First the root...
+ logging.info('Jackdaws love my big sphinx of quartz.')
+
+ # Now, define a couple of other loggers which might represent areas in your
+ # application:
+
+ logger1 = logging.getLogger('myapp.area1')
+ logger2 = logging.getLogger('myapp.area2')
+
+ logger1.debug('Quick zephyrs blow, vexing daft Jim.')
+ logger1.info('How quickly daft jumping zebras vex.')
+ logger2.warning('Jail zesty vixen who grabbed pay from quack.')
+ logger2.error('The five boxing wizards jump quickly.')
+
+At the receiving end, you can set up a receiver using the :mod:`socketserver`
+module. Here is a basic working example::
+
+ import pickle
+ import logging
+ import logging.handlers
+ import socketserver
+ import struct
+
+
+ class LogRecordStreamHandler(socketserver.StreamRequestHandler):
+ """Handler for a streaming logging request.
+
+ This basically logs the record using whatever logging policy is
+ configured locally.
+ """
+
+ def handle(self):
+ """
+ Handle multiple requests - each expected to be a 4-byte length,
+ followed by the LogRecord in pickle format. Logs the record
+ according to whatever policy is configured locally.
+ """
+ while True:
+ chunk = self.connection.recv(4)
+ if len(chunk) < 4:
+ break
+ slen = struct.unpack('>L', chunk)[0]
+ chunk = self.connection.recv(slen)
+ while len(chunk) < slen:
+ chunk = chunk + self.connection.recv(slen - len(chunk))
+ obj = self.unPickle(chunk)
+ record = logging.makeLogRecord(obj)
+ self.handleLogRecord(record)
+
+ def unPickle(self, data):
+ return pickle.loads(data)
+
+ def handleLogRecord(self, record):
+ # if a name is specified, we use the named logger rather than the one
+ # implied by the record.
+ if self.server.logname is not None:
+ name = self.server.logname
+ else:
+ name = record.name
+ logger = logging.getLogger(name)
+ # N.B. EVERY record gets logged. This is because Logger.handle
+ # is normally called AFTER logger-level filtering. If you want
+ # to do filtering, do it at the client end to save wasting
+ # cycles and network bandwidth!
+ logger.handle(record)
+
+ class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):
+ """
+ Simple TCP socket-based logging receiver suitable for testing.
+ """
+
+ allow_reuse_address = 1
+
+ def __init__(self, host='localhost',
+ port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
+ handler=LogRecordStreamHandler):
+ socketserver.ThreadingTCPServer.__init__(self, (host, port), handler)
+ self.abort = 0
+ self.timeout = 1
+ self.logname = None
+
+ def serve_until_stopped(self):
+ import select
+ abort = 0
+ while not abort:
+ rd, wr, ex = select.select([self.socket.fileno()],
+ [], [],
+ self.timeout)
+ if rd:
+ self.handle_request()
+ abort = self.abort
+
+ def main():
+ logging.basicConfig(
+ format='%(relativeCreated)5d %(name)-15s %(levelname)-8s %(message)s')
+ tcpserver = LogRecordSocketReceiver()
+ print('About to start TCP server...')
+ tcpserver.serve_until_stopped()
+
+ if __name__ == '__main__':
+ main()
+
+First run the server, and then the client. On the client side, nothing is
+printed on the console; on the server side, you should see something like::
+
+ About to start TCP server...
+ 59 root INFO Jackdaws love my big sphinx of quartz.
+ 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.
+ 69 myapp.area1 INFO How quickly daft jumping zebras vex.
+ 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.
+ 69 myapp.area2 ERROR The five boxing wizards jump quickly.
+
+Note that there are some security issues with pickle in some scenarios. If
+these affect you, you can use an alternative serialization scheme by overriding
+the :meth:`makePickle` method and implementing your alternative there, as
+well as adapting the above script to use your alternative serialization.
+
+
+.. _context-info:
+
+Adding contextual information to your logging output
+----------------------------------------------------
+
+Sometimes you want logging output to contain contextual information in
+addition to the parameters passed to the logging call. For example, in a
+networked application, it may be desirable to log client-specific information
+in the log (e.g. remote client's username, or IP address). Although you could
+use the *extra* parameter to achieve this, it's not always convenient to pass
+the information in this way. While it might be tempting to create
+:class:`Logger` instances on a per-connection basis, this is not a good idea
+because these instances are not garbage collected. While this is not a problem
+in practice, when the number of :class:`Logger` instances is dependent on the
+level of granularity you want to use in logging an application, it could
+be hard to manage if the number of :class:`Logger` instances becomes
+effectively unbounded.
+
+
+Using LoggerAdapters to impart contextual information
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+An easy way in which you can pass contextual information to be output along
+with logging event information is to use the :class:`LoggerAdapter` class.
+This class is designed to look like a :class:`Logger`, so that you can call
+:meth:`debug`, :meth:`info`, :meth:`warning`, :meth:`error`,
+:meth:`exception`, :meth:`critical` and :meth:`log`. These methods have the
+same signatures as their counterparts in :class:`Logger`, so you can use the
+two types of instances interchangeably.
+
+When you create an instance of :class:`LoggerAdapter`, you pass it a
+:class:`Logger` instance and a dict-like object which contains your contextual
+information. When you call one of the logging methods on an instance of
+:class:`LoggerAdapter`, it delegates the call to the underlying instance of
+:class:`Logger` passed to its constructor, and arranges to pass the contextual
+information in the delegated call. Here's a snippet from the code of
+:class:`LoggerAdapter`::
+
+ def debug(self, msg, *args, **kwargs):
+ """
+ Delegate a debug call to the underlying logger, after adding
+ contextual information from this adapter instance.
+ """
+ msg, kwargs = self.process(msg, kwargs)
+ self.logger.debug(msg, *args, **kwargs)
+
+The :meth:`process` method of :class:`LoggerAdapter` is where the contextual
+information is added to the logging output. It's passed the message and
+keyword arguments of the logging call, and it passes back (potentially)
+modified versions of these to use in the call to the underlying logger. The
+default implementation of this method leaves the message alone, but inserts
+an 'extra' key in the keyword argument whose value is the dict-like object
+passed to the constructor. Of course, if you had passed an 'extra' keyword
+argument in the call to the adapter, it will be silently overwritten.
+
+The advantage of using 'extra' is that the values in the dict-like object are
+merged into the :class:`LogRecord` instance's __dict__, allowing you to use
+customized strings with your :class:`Formatter` instances which know about
+the keys of the dict-like object. If you need a different method, e.g. if you
+want to prepend or append the contextual information to the message string,
+you just need to subclass :class:`LoggerAdapter` and override :meth:`process`
+to do what you need. Here's an example script which uses this class, which
+also illustrates what dict-like behaviour is needed from an arbitrary
+'dict-like' object for use in the constructor::
+
+ import logging
+
+ class ConnInfo:
+ """
+ An example class which shows how an arbitrary class can be used as
+ the 'extra' context information repository passed to a LoggerAdapter.
+ """
+
+ def __getitem__(self, name):
+ """
+ To allow this instance to look like a dict.
+ """
+ from random import choice
+ if name == 'ip':
+ result = choice(['127.0.0.1', '192.168.0.1'])
+ elif name == 'user':
+ result = choice(['jim', 'fred', 'sheila'])
+ else:
+ result = self.__dict__.get(name, '?')
+ return result
+
+ def __iter__(self):
+ """
+ To allow iteration over keys, which will be merged into
+ the LogRecord dict before formatting and output.
+ """
+ keys = ['ip', 'user']
+ keys.extend(self.__dict__.keys())
+ return keys.__iter__()
+
+ if __name__ == '__main__':
+ from random import choice
+ levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL)
+ a1 = logging.LoggerAdapter(logging.getLogger('a.b.c'),
+ { 'ip' : '123.231.231.123', 'user' : 'sheila' })
+ logging.basicConfig(level=logging.DEBUG,
+ format='%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s')
+ a1.debug('A debug message')
+ a1.info('An info message with %s', 'some parameters')
+ a2 = logging.LoggerAdapter(logging.getLogger('d.e.f'), ConnInfo())
+ for x in range(10):
+ lvl = choice(levels)
+ lvlname = logging.getLevelName(lvl)
+ a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, 'parameters')
+
+When this script is run, the output should look something like this::
+
+ 2008-01-18 14:49:54,023 a.b.c DEBUG IP: 123.231.231.123 User: sheila A debug message
+ 2008-01-18 14:49:54,023 a.b.c INFO IP: 123.231.231.123 User: sheila An info message with some parameters
+ 2008-01-18 14:49:54,023 d.e.f CRITICAL IP: 192.168.0.1 User: jim A message at CRITICAL level with 2 parameters
+ 2008-01-18 14:49:54,033 d.e.f INFO IP: 192.168.0.1 User: jim A message at INFO level with 2 parameters
+ 2008-01-18 14:49:54,033 d.e.f WARNING IP: 192.168.0.1 User: sheila A message at WARNING level with 2 parameters
+ 2008-01-18 14:49:54,033 d.e.f ERROR IP: 127.0.0.1 User: fred A message at ERROR level with 2 parameters
+ 2008-01-18 14:49:54,033 d.e.f ERROR IP: 127.0.0.1 User: sheila A message at ERROR level with 2 parameters
+ 2008-01-18 14:49:54,033 d.e.f WARNING IP: 192.168.0.1 User: sheila A message at WARNING level with 2 parameters
+ 2008-01-18 14:49:54,033 d.e.f WARNING IP: 192.168.0.1 User: jim A message at WARNING level with 2 parameters
+ 2008-01-18 14:49:54,033 d.e.f INFO IP: 192.168.0.1 User: fred A message at INFO level with 2 parameters
+ 2008-01-18 14:49:54,033 d.e.f WARNING IP: 192.168.0.1 User: sheila A message at WARNING level with 2 parameters
+ 2008-01-18 14:49:54,033 d.e.f WARNING IP: 127.0.0.1 User: jim A message at WARNING level with 2 parameters
+
+
+.. _filters-contextual:
+
+Using Filters to impart contextual information
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can also add contextual information to log output using a user-defined
+:class:`Filter`. ``Filter`` instances are allowed to modify the ``LogRecords``
+passed to them, including adding additional attributes which can then be output
+using a suitable format string, or if needed a custom :class:`Formatter`.
+
+For example in a web application, the request being processed (or at least,
+the interesting parts of it) can be stored in a threadlocal
+(:class:`threading.local`) variable, and then accessed from a ``Filter`` to
+add, say, information from the request - say, the remote IP address and remote
+user's username - to the ``LogRecord``, using the attribute names 'ip' and
+'user' as in the ``LoggerAdapter`` example above. In that case, the same format
+string can be used to get similar output to that shown above. Here's an example
+script::
+
+ import logging
+ from random import choice
+
+ class ContextFilter(logging.Filter):
+ """
+ This is a filter which injects contextual information into the log.
+
+ Rather than use actual contextual information, we just use random
+ data in this demo.
+ """
+
+ USERS = ['jim', 'fred', 'sheila']
+ IPS = ['123.231.231.123', '127.0.0.1', '192.168.0.1']
+
+ def filter(self, record):
+
+ record.ip = choice(ContextFilter.IPS)
+ record.user = choice(ContextFilter.USERS)
+ return True
+
+ if __name__ == '__main__':
+ levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL)
+ logging.basicConfig(level=logging.DEBUG,
+ format='%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s')
+ a1 = logging.getLogger('a.b.c')
+ a2 = logging.getLogger('d.e.f')
+
+ f = ContextFilter()
+ a1.addFilter(f)
+ a2.addFilter(f)
+ a1.debug('A debug message')
+ a1.info('An info message with %s', 'some parameters')
+ for x in range(10):
+ lvl = choice(levels)
+ lvlname = logging.getLevelName(lvl)
+ a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, 'parameters')
+
+which, when run, produces something like::
+
+ 2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A debug message
+ 2010-09-06 22:38:15,300 a.b.c INFO IP: 192.168.0.1 User: sheila An info message with some parameters
+ 2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A message at CRITICAL level with 2 parameters
+ 2010-09-06 22:38:15,300 d.e.f ERROR IP: 127.0.0.1 User: jim A message at ERROR level with 2 parameters
+ 2010-09-06 22:38:15,300 d.e.f DEBUG IP: 127.0.0.1 User: sheila A message at DEBUG level with 2 parameters
+ 2010-09-06 22:38:15,300 d.e.f ERROR IP: 123.231.231.123 User: fred A message at ERROR level with 2 parameters
+ 2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 192.168.0.1 User: jim A message at CRITICAL level with 2 parameters
+ 2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A message at CRITICAL level with 2 parameters
+ 2010-09-06 22:38:15,300 d.e.f DEBUG IP: 192.168.0.1 User: jim A message at DEBUG level with 2 parameters
+ 2010-09-06 22:38:15,301 d.e.f ERROR IP: 127.0.0.1 User: sheila A message at ERROR level with 2 parameters
+ 2010-09-06 22:38:15,301 d.e.f DEBUG IP: 123.231.231.123 User: fred A message at DEBUG level with 2 parameters
+ 2010-09-06 22:38:15,301 d.e.f INFO IP: 123.231.231.123 User: fred A message at INFO level with 2 parameters
+
+
+.. _multiple-processes:
+
+Logging to a single file from multiple processes
+------------------------------------------------
+
+Although logging is thread-safe, and logging to a single file from multiple
+threads in a single process *is* supported, logging to a single file from
+*multiple processes* is *not* supported, because there is no standard way to
+serialize access to a single file across multiple processes in Python. If you
+need to log to a single file from multiple processes, one way of doing this is
+to have all the processes log to a :class:`SocketHandler`, and have a separate
+process which implements a socket server which reads from the socket and logs
+to file. (If you prefer, you can dedicate one thread in one of the existing
+processes to perform this function.) The following section documents this
+approach in more detail and includes a working socket receiver which can be
+used as a starting point for you to adapt in your own applications.
+
+If you are using a recent version of Python which includes the
+:mod:`multiprocessing` module, you could write your own handler which uses the
+:class:`Lock` class from this module to serialize access to the file from
+your processes. The existing :class:`FileHandler` and subclasses do not make
+use of :mod:`multiprocessing` at present, though they may do so in the future.
+Note that at present, the :mod:`multiprocessing` module does not provide
+working lock functionality on all platforms (see
+http://bugs.python.org/issue3770).
+
+.. currentmodule:: logging.handlers
+
+Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send
+all logging events to one of the processes in your multi-process application.
+The following example script demonstrates how you can do this; in the example
+a separate listener process listens for events sent by other processes and logs
+them according to its own logging configuration. Although the example only
+demonstrates one way of doing it (for example, you may want to use a listener
+thread rather than a separate listener process -- the implementation would be
+analogous) it does allow for completely different logging configurations for
+the listener and the other processes in your application, and can be used as
+the basis for code meeting your own specific requirements::
+
+ # You'll need these imports in your own code
+ import logging
+ import logging.handlers
+ import multiprocessing
+
+ # Next two import lines for this demo only
+ from random import choice, random
+ import time
+
+ #
+ # Because you'll want to define the logging configurations for listener and workers, the
+ # listener and worker process functions take a configurer parameter which is a callable
+ # for configuring logging for that process. These functions are also passed the queue,
+ # which they use for communication.
+ #
+ # In practice, you can configure the listener however you want, but note that in this
+ # simple example, the listener does not apply level or filter logic to received records.
+ # In practice, you would probably want to do this logic in the worker processes, to avoid
+ # sending events which would be filtered out between processes.
+ #
+ # The size of the rotated files is made small so you can see the results easily.
+ def listener_configurer():
+ root = logging.getLogger()
+ h = logging.handlers.RotatingFileHandler('/tmp/mptest.log', 'a', 300, 10)
+ f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s %(levelname)-8s %(message)s')
+ h.setFormatter(f)
+ root.addHandler(h)
+
+ # This is the listener process top-level loop: wait for logging events
+ # (LogRecords)on the queue and handle them, quit when you get a None for a
+ # LogRecord.
+ def listener_process(queue, configurer):
+ configurer()
+ while True:
+ try:
+ record = queue.get()
+ if record is None: # We send this as a sentinel to tell the listener to quit.
+ break
+ logger = logging.getLogger(record.name)
+ logger.handle(record) # No level or filter logic applied - just do it!
+ except (KeyboardInterrupt, SystemExit):
+ raise
+ except:
+ import sys, traceback
+ print >> sys.stderr, 'Whoops! Problem:'
+ traceback.print_exc(file=sys.stderr)
+
+ # Arrays used for random selections in this demo
+
+ LEVELS = [logging.DEBUG, logging.INFO, logging.WARNING,
+ logging.ERROR, logging.CRITICAL]
+
+ LOGGERS = ['a.b.c', 'd.e.f']
+
+ MESSAGES = [
+ 'Random message #1',
+ 'Random message #2',
+ 'Random message #3',
+ ]
+
+ # The worker configuration is done at the start of the worker process run.
+ # Note that on Windows you can't rely on fork semantics, so each process
+ # will run the logging configuration code when it starts.
+ def worker_configurer(queue):
+ h = logging.handlers.QueueHandler(queue) # Just the one handler needed
+ root = logging.getLogger()
+ root.addHandler(h)
+ root.setLevel(logging.DEBUG) # send all messages, for demo; no other level or filter logic applied.
+
+ # This is the worker process top-level loop, which just logs ten events with
+ # random intervening delays before terminating.
+ # The print messages are just so you know it's doing something!
+ def worker_process(queue, configurer):
+ configurer(queue)
+ name = multiprocessing.current_process().name
+ print('Worker started: %s' % name)
+ for i in range(10):
+ time.sleep(random())
+ logger = logging.getLogger(choice(LOGGERS))
+ level = choice(LEVELS)
+ message = choice(MESSAGES)
+ logger.log(level, message)
+ print('Worker finished: %s' % name)
+
+ # Here's where the demo gets orchestrated. Create the queue, create and start
+ # the listener, create ten workers and start them, wait for them to finish,
+ # then send a None to the queue to tell the listener to finish.
+ def main():
+ queue = multiprocessing.Queue(-1)
+ listener = multiprocessing.Process(target=listener_process,
+ args=(queue, listener_configurer))
+ listener.start()
+ workers = []
+ for i in range(10):
+ worker = multiprocessing.Process(target=worker_process,
+ args=(queue, worker_configurer))
+ workers.append(worker)
+ worker.start()
+ for w in workers:
+ w.join()
+ queue.put_nowait(None)
+ listener.join()
+
+ if __name__ == '__main__':
+ main()
+
+A variant of the above script keeps the logging in the main process, in a
+separate thread::
+
+ import logging
+ import logging.config
+ import logging.handlers
+ from multiprocessing import Process, Queue
+ import random
+ import threading
+ import time
+
+ def logger_thread(q):
+ while True:
+ record = q.get()
+ if record is None:
+ break
+ logger = logging.getLogger(record.name)
+ logger.handle(record)
+
+
+ def worker_process(q):
+ qh = logging.handlers.QueueHandler(q)
+ root = logging.getLogger()
+ root.setLevel(logging.DEBUG)
+ root.addHandler(qh)
+ levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,
+ logging.CRITICAL]
+ loggers = ['foo', 'foo.bar', 'foo.bar.baz',
+ 'spam', 'spam.ham', 'spam.ham.eggs']
+ for i in range(100):
+ lvl = random.choice(levels)
+ logger = logging.getLogger(random.choice(loggers))
+ logger.log(lvl, 'Message no. %d', i)
+
+ if __name__ == '__main__':
+ q = Queue()
+ d = {
+ 'version': 1,
+ 'formatters': {
+ 'detailed': {
+ 'class': 'logging.Formatter',
+ 'format': '%(asctime)s %(name)-15s %(levelname)-8s %(processName)-10s %(message)s'
+ }
+ },
+ 'handlers': {
+ 'console': {
+ 'class': 'logging.StreamHandler',
+ 'level': 'INFO',
+ },
+ 'file': {
+ 'class': 'logging.FileHandler',
+ 'filename': 'mplog.log',
+ 'mode': 'w',
+ 'formatter': 'detailed',
+ },
+ 'foofile': {
+ 'class': 'logging.FileHandler',
+ 'filename': 'mplog-foo.log',
+ 'mode': 'w',
+ 'formatter': 'detailed',
+ },
+ 'errors': {
+ 'class': 'logging.FileHandler',
+ 'filename': 'mplog-errors.log',
+ 'mode': 'w',
+ 'level': 'ERROR',
+ 'formatter': 'detailed',
+ },
+ },
+ 'loggers': {
+ 'foo': {
+ 'handlers' : ['foofile']
+ }
+ },
+ 'root': {
+ 'level': 'DEBUG',
+ 'handlers': ['console', 'file', 'errors']
+ },
+ }
+ workers = []
+ for i in range(5):
+ wp = Process(target=worker_process, name='worker %d' % (i + 1), args=(q,))
+ workers.append(wp)
+ wp.start()
+ logging.config.dictConfig(d)
+ lp = threading.Thread(target=logger_thread, args=(q,))
+ lp.start()
+ # At this point, the main process could do some useful work of its own
+ # Once it's done that, it can wait for the workers to terminate...
+ for wp in workers:
+ wp.join()
+ # And now tell the logging thread to finish up, too
+ q.put(None)
+ lp.join()
+
+This variant shows how you can e.g. apply configuration for particular loggers
+- e.g. the ``foo`` logger has a special handler which stores all events in the
+``foo`` subsystem in a file ``mplog-foo.log``. This will be used by the logging
+machinery in the main process (even though the logging events are generated in
+the worker processes) to direct the messages to the appropriate destinations.
+
+Using file rotation
+-------------------
+
+.. sectionauthor:: Doug Hellmann, Vinay Sajip (changes)
+.. (see <http://blog.doughellmann.com/2007/05/pymotw-logging.html>)
+
+Sometimes you want to let a log file grow to a certain size, then open a new
+file and log to that. You may want to keep a certain number of these files, and
+when that many files have been created, rotate the files so that the number of
+files and the size of the files both remain bounded. For this usage pattern, the
+logging package provides a :class:`RotatingFileHandler`::
+
+ import glob
+ import logging
+ import logging.handlers
+
+ LOG_FILENAME = 'logging_rotatingfile_example.out'
+
+ # Set up a specific logger with our desired output level
+ my_logger = logging.getLogger('MyLogger')
+ my_logger.setLevel(logging.DEBUG)
+
+ # Add the log message handler to the logger
+ handler = logging.handlers.RotatingFileHandler(
+ LOG_FILENAME, maxBytes=20, backupCount=5)
+
+ my_logger.addHandler(handler)
+
+ # Log some messages
+ for i in range(20):
+ my_logger.debug('i = %d' % i)
+
+ # See what files are created
+ logfiles = glob.glob('%s*' % LOG_FILENAME)
+
+ for filename in logfiles:
+ print(filename)
+
+The result should be 6 separate files, each with part of the log history for the
+application::
+
+ logging_rotatingfile_example.out
+ logging_rotatingfile_example.out.1
+ logging_rotatingfile_example.out.2
+ logging_rotatingfile_example.out.3
+ logging_rotatingfile_example.out.4
+ logging_rotatingfile_example.out.5
+
+The most current file is always :file:`logging_rotatingfile_example.out`,
+and each time it reaches the size limit it is renamed with the suffix
+``.1``. Each of the existing backup files is renamed to increment the suffix
+(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased.
+
+Obviously this example sets the log length much much too small as an extreme
+example. You would want to set *maxBytes* to an appropriate value.
+
+.. _zeromq-handlers:
+
+Subclassing QueueHandler - a ZeroMQ example
+-------------------------------------------
+
+You can use a :class:`QueueHandler` subclass to send messages to other kinds
+of queues, for example a ZeroMQ 'publish' socket. In the example below,the
+socket is created separately and passed to the handler (as its 'queue')::
+
+ import zmq # using pyzmq, the Python binding for ZeroMQ
+ import json # for serializing records portably
+
+ ctx = zmq.Context()
+ sock = zmq.Socket(ctx, zmq.PUB) # or zmq.PUSH, or other suitable value
+ sock.bind('tcp://*:5556') # or wherever
+
+ class ZeroMQSocketHandler(QueueHandler):
+ def enqueue(self, record):
+ data = json.dumps(record.__dict__)
+ self.queue.send(data)
+
+ handler = ZeroMQSocketHandler(sock)
+
+
+Of course there are other ways of organizing this, for example passing in the
+data needed by the handler to create the socket::
+
+ class ZeroMQSocketHandler(QueueHandler):
+ def __init__(self, uri, socktype=zmq.PUB, ctx=None):
+ self.ctx = ctx or zmq.Context()
+ socket = zmq.Socket(self.ctx, socktype)
+ socket.bind(uri)
+ QueueHandler.__init__(self, socket)
+
+ def enqueue(self, record):
+ data = json.dumps(record.__dict__)
+ self.queue.send(data)
+
+ def close(self):
+ self.queue.close()
+
+
+Subclassing QueueListener - a ZeroMQ example
+--------------------------------------------
+
+You can also subclass :class:`QueueListener` to get messages from other kinds
+of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::
+
+ class ZeroMQSocketListener(QueueListener):
+ def __init__(self, uri, *handlers, **kwargs):
+ self.ctx = kwargs.get('ctx') or zmq.Context()
+ socket = zmq.Socket(self.ctx, zmq.SUB)
+ socket.setsockopt(zmq.SUBSCRIBE, '') # subscribe to everything
+ socket.connect(uri)
+
+ def dequeue(self):
+ msg = self.queue.recv()
+ return logging.makeLogRecord(json.loads(msg))
+
+
+.. seealso::
+
+ Module :mod:`logging`
+ API reference for the logging module.
+
+ Module :mod:`logging.config`
+ Configuration API for the logging module.
+
+ Module :mod:`logging.handlers`
+ Useful handlers included with the logging module.
+
+ :ref:`A basic logging tutorial <logging-basic-tutorial>`
+
+ :ref:`A more advanced logging tutorial <logging-advanced-tutorial>`
diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst
new file mode 100644
index 0000000000..a7d6024a77
--- /dev/null
+++ b/Doc/howto/logging.rst
@@ -0,0 +1,1026 @@
+=============
+Logging HOWTO
+=============
+
+:Author: Vinay Sajip <vinay_sajip at red-dove dot com>
+
+.. _logging-basic-tutorial:
+
+.. currentmodule:: logging
+
+Basic Logging Tutorial
+----------------------
+
+Logging is a means of tracking events that happen when some software runs. The
+software's developer adds logging calls to their code to indicate that certain
+events have occurred. An event is described by a descriptive message which can
+optionally contain variable data (i.e. data that is potentially different for
+each occurrence of the event). Events also have an importance which the
+developer ascribes to the event; the importance can also be called the *level*
+or *severity*.
+
+When to use logging
+^^^^^^^^^^^^^^^^^^^
+
+Logging provides a set of convenience functions for simple logging usage. These
+are :func:`debug`, :func:`info`, :func:`warning`, :func:`error` and
+:func:`critical`. To determine when to use logging, see the table below, which
+states, for each of a set of common tasks, the best tool to use for it.
+
++-------------------------------------+--------------------------------------+
+| Task you want to perform | The best tool for the task |
++=====================================+======================================+
+| Display console output for ordinary | :func:`print` |
+| usage of a command line script or | |
+| program | |
++-------------------------------------+--------------------------------------+
+| Report events that occur during | :func:`logging.info` (or |
+| normal operation of a program (e.g. | :func:`logging.debug` for very |
+| for status monitoring or fault | detailed output for diagnostic |
+| investigation) | purposes) |
++-------------------------------------+--------------------------------------+
+| Issue a warning regarding a | :func:`warnings.warn` in library |
+| particular runtime event | code if the issue is avoidable and |
+| | the client application should be |
+| | modified to eliminate the warning |
+| | |
+| | :func:`logging.warning` if there is |
+| | nothing the client application can do|
+| | about the situation, but the event |
+| | should still be noted |
++-------------------------------------+--------------------------------------+
+| Report an error regarding a | Raise an exception |
+| particular runtime event | |
++-------------------------------------+--------------------------------------+
+| Report suppression of an error | :func:`logging.error`, |
+| without raising an exception (e.g. | :func:`logging.exception` or |
+| error handler in a long-running | :func:`logging.critical` as |
+| server process) | appropriate for the specific error |
+| | and application domain |
++-------------------------------------+--------------------------------------+
+
+The logging functions are named after the level or severity of the events
+they are used to track. The standard levels and their applicability are
+described below (in increasing order of severity):
+
++--------------+---------------------------------------------+
+| Level | When it's used |
++==============+=============================================+
+| ``DEBUG`` | Detailed information, typically of interest |
+| | only when diagnosing problems. |
++--------------+---------------------------------------------+
+| ``INFO`` | Confirmation that things are working as |
+| | expected. |
++--------------+---------------------------------------------+
+| ``WARNING`` | An indication that something unexpected |
+| | happened, or indicative of some problem in |
+| | the near future (e.g. 'disk space low'). |
+| | The software is still working as expected. |
++--------------+---------------------------------------------+
+| ``ERROR`` | Due to a more serious problem, the software |
+| | has not been able to perform some function. |
++--------------+---------------------------------------------+
+| ``CRITICAL`` | A serious error, indicating that the program|
+| | itself may be unable to continue running. |
++--------------+---------------------------------------------+
+
+The default level is ``WARNING``, which means that only events of this level
+and above will be tracked, unless the logging package is configured to do
+otherwise.
+
+Events that are tracked can be handled in different ways. The simplest way of
+handling tracked events is to print them to the console. Another common way
+is to write them to a disk file.
+
+
+.. _howto-minimal-example:
+
+A simple example
+^^^^^^^^^^^^^^^^
+
+A very simple example is::
+
+ import logging
+ logging.warning('Watch out!') # will print a message to the console
+ logging.info('I told you so') # will not print anything
+
+If you type these lines into a script and run it, you'll see::
+
+ WARNING:root:Watch out!
+
+printed out on the console. The ``INFO`` message doesn't appear because the
+default level is ``WARNING``. The printed message includes the indication of
+the level and the description of the event provided in the logging call, i.e.
+'Watch out!'. Don't worry about the 'root' part for now: it will be explained
+later. The actual output can be formatted quite flexibly if you need that;
+formatting options will also be explained later.
+
+
+Logging to a file
+^^^^^^^^^^^^^^^^^
+
+A very common situation is that of recording logging events in a file, so let's
+look at that next::
+
+ import logging
+ logging.basicConfig(filename='example.log',level=logging.DEBUG)
+ logging.debug('This message should go to the log file')
+ logging.info('So should this')
+ logging.warning('And this, too')
+
+And now if we open the file and look at what we have, we should find the log
+messages::
+
+ DEBUG:root:This message should go to the log file
+ INFO:root:So should this
+ WARNING:root:And this, too
+
+This example also shows how you can set the logging level which acts as the
+threshold for tracking. In this case, because we set the threshold to
+``DEBUG``, all of the messages were printed.
+
+If you want to set the logging level from a command-line option such as::
+
+ --log=INFO
+
+and you have the value of the parameter passed for ``--log`` in some variable
+*loglevel*, you can use::
+
+ getattr(logging, loglevel.upper())
+
+to get the value which you'll pass to :func:`basicConfig` via the *level*
+argument. You may want to error check any user input value, perhaps as in the
+following example::
+
+ # assuming loglevel is bound to the string value obtained from the
+ # command line argument. Convert to upper case to allow the user to
+ # specify --log=DEBUG or --log=debug
+ numeric_level = getattr(logging, loglevel.upper(), None)
+ if not isinstance(numeric_level, int):
+ raise ValueError('Invalid log level: %s' % loglevel)
+ logging.basicConfig(level=numeric_level, ...)
+
+The call to :func:`basicConfig` should come *before* any calls to :func:`debug`,
+:func:`info` etc. As it's intended as a one-off simple configuration facility,
+only the first call will actually do anything: subsequent calls are effectively
+no-ops.
+
+If you run the above script several times, the messages from successive runs
+are appended to the file *example.log*. If you want each run to start afresh,
+not remembering the messages from earlier runs, you can specify the *filemode*
+argument, by changing the call in the above example to::
+
+ logging.basicConfig(filename='example.log', filemode='w', level=logging.DEBUG)
+
+The output will be the same as before, but the log file is no longer appended
+to, so the messages from earlier runs are lost.
+
+
+Logging from multiple modules
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If your program consists of multiple modules, here's an example of how you
+could organize logging in it::
+
+ # myapp.py
+ import logging
+ import mylib
+
+ def main():
+ logging.basicConfig(filename='myapp.log', level=logging.INFO)
+ logging.info('Started')
+ mylib.do_something()
+ logging.info('Finished')
+
+ if __name__ == '__main__':
+ main()
+
+::
+
+ # mylib.py
+ import logging
+
+ def do_something():
+ logging.info('Doing something')
+
+If you run *myapp.py*, you should see this in *myapp.log*::
+
+ INFO:root:Started
+ INFO:root:Doing something
+ INFO:root:Finished
+
+which is hopefully what you were expecting to see. You can generalize this to
+multiple modules, using the pattern in *mylib.py*. Note that for this simple
+usage pattern, you won't know, by looking in the log file, *where* in your
+application your messages came from, apart from looking at the event
+description. If you want to track the location of your messages, you'll need
+to refer to the documentation beyond the tutorial level -- see
+:ref:`logging-advanced-tutorial`.
+
+
+Logging variable data
+^^^^^^^^^^^^^^^^^^^^^
+
+To log variable data, use a format string for the event description message and
+append the variable data as arguments. For example::
+
+ import logging
+ logging.warning('%s before you %s', 'Look', 'leap!')
+
+will display::
+
+ WARNING:root:Look before you leap!
+
+As you can see, merging of variable data into the event description message
+uses the old, %-style of string formatting. This is for backwards
+compatibility: the logging package pre-dates newer formatting options such as
+:meth:`str.format` and :class:`string.Template`. These newer formatting
+options *are* supported, but exploring them is outside the scope of this
+tutorial.
+
+
+Changing the format of displayed messages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To change the format which is used to display messages, you need to
+specify the format you want to use::
+
+ import logging
+ logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
+ logging.debug('This message should appear on the console')
+ logging.info('So should this')
+ logging.warning('And this, too')
+
+which would print::
+
+ DEBUG:This message should appear on the console
+ INFO:So should this
+ WARNING:And this, too
+
+Notice that the 'root' which appeared in earlier examples has disappeared. For
+a full set of things that can appear in format strings, you can refer to the
+documentation for :ref:`logrecord-attributes`, but for simple usage, you just
+need the *levelname* (severity), *message* (event description, including
+variable data) and perhaps to display when the event occurred. This is
+described in the next section.
+
+
+Displaying the date/time in messages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To display the date and time of an event, you would place '%(asctime)s' in
+your format string::
+
+ import logging
+ logging.basicConfig(format='%(asctime)s %(message)s')
+ logging.warning('is when this event was logged.')
+
+which should print something like this::
+
+ 2010-12-12 11:41:42,612 is when this event was logged.
+
+The default format for date/time display (shown above) is ISO8601. If you need
+more control over the formatting of the date/time, provide a *datefmt*
+argument to ``basicConfig``, as in this example::
+
+ import logging
+ logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
+ logging.warning('is when this event was logged.')
+
+which would display something like this::
+
+ 12/12/2010 11:46:36 AM is when this event was logged.
+
+The format of the *datefmt* argument is the same as supported by
+:func:`time.strftime`.
+
+
+Next Steps
+^^^^^^^^^^
+
+That concludes the basic tutorial. It should be enough to get you up and
+running with logging. There's a lot more that the logging package offers, but
+to get the best out of it, you'll need to invest a little more of your time in
+reading the following sections. If you're ready for that, grab some of your
+favourite beverage and carry on.
+
+If your logging needs are simple, then use the above examples to incorporate
+logging into your own scripts, and if you run into problems or don't
+understand something, please post a question on the comp.lang.python Usenet
+group (available at http://groups.google.com/group/comp.lang.python) and you
+should receive help before too long.
+
+Still here? You can carry on reading the next few sections, which provide a
+slightly more advanced/in-depth tutorial than the basic one above. After that,
+you can take a look at the :ref:`logging-cookbook`.
+
+.. _logging-advanced-tutorial:
+
+
+Advanced Logging Tutorial
+-------------------------
+
+The logging library takes a modular approach and offers several categories
+of components: loggers, handlers, filters, and formatters.
+
+* Loggers expose the interface that application code directly uses.
+* Handlers send the log records (created by loggers) to the appropriate
+ destination.
+* Filters provide a finer grained facility for determining which log records
+ to output.
+* Formatters specify the layout of log records in the final output.
+
+Logging is performed by calling methods on instances of the :class:`Logger`
+class (hereafter called :dfn:`loggers`). Each instance has a name, and they are
+conceptually arranged in a namespace hierarchy using dots (periods) as
+separators. For example, a logger named 'scan' is the parent of loggers
+'scan.text', 'scan.html' and 'scan.pdf'. Logger names can be anything you want,
+and indicate the area of an application in which a logged message originates.
+
+A good convention to use when naming loggers is to use a module-level logger,
+in each module which uses logging, named as follows::
+
+ logger = logging.getLogger(__name__)
+
+This means that logger names track the package/module hierarchy, and it's
+intuitively obvious where events are logged just from the logger name.
+
+The root of the hierarchy of loggers is called the root logger. That's the
+logger used by the functions :func:`debug`, :func:`info`, :func:`warning`,
+:func:`error` and :func:`critical`, which just call the same-named method of
+the root logger. The functions and the methods have the same signatures. The
+root logger's name is printed as 'root' in the logged output.
+
+It is, of course, possible to log messages to different destinations. Support
+is included in the package for writing log messages to files, HTTP GET/POST
+locations, email via SMTP, generic sockets, queues, or OS-specific logging
+mechanisms such as syslog or the Windows NT event log. Destinations are served
+by :dfn:`handler` classes. You can create your own log destination class if
+you have special requirements not met by any of the built-in handler classes.
+
+By default, no destination is set for any logging messages. You can specify
+a destination (such as console or file) by using :func:`basicConfig` as in the
+tutorial examples. If you call the functions :func:`debug`, :func:`info`,
+:func:`warning`, :func:`error` and :func:`critical`, they will check to see
+if no destination is set; and if one is not set, they will set a destination
+of the console (``sys.stderr``) and a default format for the displayed
+message before delegating to the root logger to do the actual message output.
+
+The default format set by :func:`basicConfig` for messages is::
+
+ severity:logger name:message
+
+You can change this by passing a format string to :func:`basicConfig` with the
+*format* keyword argument. For all options regarding how a format string is
+constructed, see :ref:`formatter-objects`.
+
+
+Loggers
+^^^^^^^
+
+:class:`Logger` objects have a threefold job. First, they expose several
+methods to application code so that applications can log messages at runtime.
+Second, logger objects determine which log messages to act upon based upon
+severity (the default filtering facility) or filter objects. Third, logger
+objects pass along relevant log messages to all interested log handlers.
+
+The most widely used methods on logger objects fall into two categories:
+configuration and message sending.
+
+These are the most common configuration methods:
+
+* :meth:`Logger.setLevel` specifies the lowest-severity log message a logger
+ will handle, where debug is the lowest built-in severity level and critical
+ is the highest built-in severity. For example, if the severity level is
+ INFO, the logger will handle only INFO, WARNING, ERROR, and CRITICAL messages
+ and will ignore DEBUG messages.
+
+* :meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove
+ handler objects from the logger object. Handlers are covered in more detail
+ in :ref:`handler-basic`.
+
+* :meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove filter
+ objects from the logger object. Filters are covered in more detail in
+ :ref:`filter`.
+
+You don't need to always call these methods on every logger you create. See the
+last two paragraphs in this section.
+
+With the logger object configured, the following methods create log messages:
+
+* :meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`,
+ :meth:`Logger.error`, and :meth:`Logger.critical` all create log records with
+ a message and a level that corresponds to their respective method names. The
+ message is actually a format string, which may contain the standard string
+ substitution syntax of :const:`%s`, :const:`%d`, :const:`%f`, and so on. The
+ rest of their arguments is a list of objects that correspond with the
+ substitution fields in the message. With regard to :const:`**kwargs`, the
+ logging methods care only about a keyword of :const:`exc_info` and use it to
+ determine whether to log exception information.
+
+* :meth:`Logger.exception` creates a log message similar to
+ :meth:`Logger.error`. The difference is that :meth:`Logger.exception` dumps a
+ stack trace along with it. Call this method only from an exception handler.
+
+* :meth:`Logger.log` takes a log level as an explicit argument. This is a
+ little more verbose for logging messages than using the log level convenience
+ methods listed above, but this is how to log at custom log levels.
+
+:func:`getLogger` returns a reference to a logger instance with the specified
+name if it is provided, or ``root`` if not. The names are period-separated
+hierarchical structures. Multiple calls to :func:`getLogger` with the same name
+will return a reference to the same logger object. Loggers that are further
+down in the hierarchical list are children of loggers higher up in the list.
+For example, given a logger with a name of ``foo``, loggers with names of
+``foo.bar``, ``foo.bar.baz``, and ``foo.bam`` are all descendants of ``foo``.
+
+Loggers have a concept of *effective level*. If a level is not explicitly set
+on a logger, the level of its parent is used instead as its effective level.
+If the parent has no explicit level set, *its* parent is examined, and so on -
+all ancestors are searched until an explicitly set level is found. The root
+logger always has an explicit level set (``WARNING`` by default). When deciding
+whether to process an event, the effective level of the logger is used to
+determine whether the event is passed to the logger's handlers.
+
+Child loggers propagate messages up to the handlers associated with their
+ancestor loggers. Because of this, it is unnecessary to define and configure
+handlers for all the loggers an application uses. It is sufficient to
+configure handlers for a top-level logger and create child loggers as needed.
+(You can, however, turn off propagation by setting the *propagate*
+attribute of a logger to *False*.)
+
+
+.. _handler-basic:
+
+Handlers
+^^^^^^^^
+
+:class:`~logging.Handler` objects are responsible for dispatching the
+appropriate log messages (based on the log messages' severity) to the handler's
+specified destination. Logger objects can add zero or more handler objects to
+themselves with an :func:`addHandler` method. As an example scenario, an
+application may want to send all log messages to a log file, all log messages
+of error or higher to stdout, and all messages of critical to an email address.
+This scenario requires three individual handlers where each handler is
+responsible for sending messages of a specific severity to a specific location.
+
+The standard library includes quite a few handler types (see
+:ref:`useful-handlers`); the tutorials use mainly :class:`StreamHandler` and
+:class:`FileHandler` in its examples.
+
+There are very few methods in a handler for application developers to concern
+themselves with. The only handler methods that seem relevant for application
+developers who are using the built-in handler objects (that is, not creating
+custom handlers) are the following configuration methods:
+
+* The :meth:`Handler.setLevel` method, just as in logger objects, specifies the
+ lowest severity that will be dispatched to the appropriate destination. Why
+ are there two :func:`setLevel` methods? The level set in the logger
+ determines which severity of messages it will pass to its handlers. The level
+ set in each handler determines which messages that handler will send on.
+
+* :func:`setFormatter` selects a Formatter object for this handler to use.
+
+* :func:`addFilter` and :func:`removeFilter` respectively configure and
+ deconfigure filter objects on handlers.
+
+Application code should not directly instantiate and use instances of
+:class:`Handler`. Instead, the :class:`Handler` class is a base class that
+defines the interface that all handlers should have and establishes some
+default behavior that child classes can use (or override).
+
+
+Formatters
+^^^^^^^^^^
+
+Formatter objects configure the final order, structure, and contents of the log
+message. Unlike the base :class:`logging.Handler` class, application code may
+instantiate formatter classes, although you could likely subclass the formatter
+if your application needs special behavior. The constructor takes three
+optional arguments -- a message format string, a date format string and a style
+indicator.
+
+.. method:: logging.Formatter.__init__(fmt=None, datefmt=None, style='%')
+
+If there is no message format string, the default is to use the
+raw message. If there is no date format string, the default date format is::
+
+ %Y-%m-%d %H:%M:%S
+
+with the milliseconds tacked on at the end. The ``style`` is one of `%`, '{'
+or '$'. If one of these is not specified, then '%' will be used.
+
+If the ``style`` is '%', the message format string uses
+``%(<dictionary key>)s`` styled string substitution; the possible keys are
+documented in :ref:`logrecord-attributes`. If the style is '{', the message
+format string is assumed to be compatible with :meth:`str.format` (using
+keyword arguments), while if the style is '$' then the message format string
+should conform to what is expected by :meth:`string.Template.substitute`.
+
+.. versionchanged:: 3.2
+ Added the ``style`` parameter.
+
+The following message format string will log the time in a human-readable
+format, the severity of the message, and the contents of the message, in that
+order::
+
+ '%(asctime)s - %(levelname)s - %(message)s'
+
+Formatters use a user-configurable function to convert the creation time of a
+record to a tuple. By default, :func:`time.localtime` is used; to change this
+for a particular formatter instance, set the ``converter`` attribute of the
+instance to a function with the same signature as :func:`time.localtime` or
+:func:`time.gmtime`. To change it for all formatters, for example if you want
+all logging times to be shown in GMT, set the ``converter`` attribute in the
+Formatter class (to ``time.gmtime`` for GMT display).
+
+
+Configuring Logging
+^^^^^^^^^^^^^^^^^^^
+
+.. currentmodule:: logging.config
+
+Programmers can configure logging in three ways:
+
+1. Creating loggers, handlers, and formatters explicitly using Python
+ code that calls the configuration methods listed above.
+2. Creating a logging config file and reading it using the :func:`fileConfig`
+ function.
+3. Creating a dictionary of configuration information and passing it
+ to the :func:`dictConfig` function.
+
+For the reference documentation on the last two options, see
+:ref:`logging-config-api`. The following example configures a very simple
+logger, a console handler, and a simple formatter using Python code::
+
+ import logging
+
+ # create logger
+ logger = logging.getLogger('simple_example')
+ logger.setLevel(logging.DEBUG)
+
+ # create console handler and set level to debug
+ ch = logging.StreamHandler()
+ ch.setLevel(logging.DEBUG)
+
+ # create formatter
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+
+ # add formatter to ch
+ ch.setFormatter(formatter)
+
+ # add ch to logger
+ logger.addHandler(ch)
+
+ # 'application' code
+ logger.debug('debug message')
+ logger.info('info message')
+ logger.warn('warn message')
+ logger.error('error message')
+ logger.critical('critical message')
+
+Running this module from the command line produces the following output::
+
+ $ python simple_logging_module.py
+ 2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message
+ 2005-03-19 15:10:26,620 - simple_example - INFO - info message
+ 2005-03-19 15:10:26,695 - simple_example - WARNING - warn message
+ 2005-03-19 15:10:26,697 - simple_example - ERROR - error message
+ 2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message
+
+The following Python module creates a logger, handler, and formatter nearly
+identical to those in the example listed above, with the only difference being
+the names of the objects::
+
+ import logging
+ import logging.config
+
+ logging.config.fileConfig('logging.conf')
+
+ # create logger
+ logger = logging.getLogger('simpleExample')
+
+ # 'application' code
+ logger.debug('debug message')
+ logger.info('info message')
+ logger.warn('warn message')
+ logger.error('error message')
+ logger.critical('critical message')
+
+Here is the logging.conf file::
+
+ [loggers]
+ keys=root,simpleExample
+
+ [handlers]
+ keys=consoleHandler
+
+ [formatters]
+ keys=simpleFormatter
+
+ [logger_root]
+ level=DEBUG
+ handlers=consoleHandler
+
+ [logger_simpleExample]
+ level=DEBUG
+ handlers=consoleHandler
+ qualname=simpleExample
+ propagate=0
+
+ [handler_consoleHandler]
+ class=StreamHandler
+ level=DEBUG
+ formatter=simpleFormatter
+ args=(sys.stdout,)
+
+ [formatter_simpleFormatter]
+ format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
+ datefmt=
+
+The output is nearly identical to that of the non-config-file-based example::
+
+ $ python simple_logging_config.py
+ 2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message
+ 2005-03-19 15:38:55,979 - simpleExample - INFO - info message
+ 2005-03-19 15:38:56,054 - simpleExample - WARNING - warn message
+ 2005-03-19 15:38:56,055 - simpleExample - ERROR - error message
+ 2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message
+
+You can see that the config file approach has a few advantages over the Python
+code approach, mainly separation of configuration and code and the ability of
+noncoders to easily modify the logging properties.
+
+.. currentmodule:: logging
+
+Note that the class names referenced in config files need to be either relative
+to the logging module, or absolute values which can be resolved using normal
+import mechanisms. Thus, you could use either
+:class:`~logging.handlers.WatchedFileHandler` (relative to the logging module) or
+``mypackage.mymodule.MyHandler`` (for a class defined in package ``mypackage``
+and module ``mymodule``, where ``mypackage`` is available on the Python import
+path).
+
+In Python 3.2, a new means of configuring logging has been introduced, using
+dictionaries to hold configuration information. This provides a superset of the
+functionality of the config-file-based approach outlined above, and is the
+recommended configuration method for new applications and deployments. Because
+a Python dictionary is used to hold configuration information, and since you
+can populate that dictionary using different means, you have more options for
+configuration. For example, you can use a configuration file in JSON format,
+or, if you have access to YAML processing functionality, a file in YAML
+format, to populate the configuration dictionary. Or, of course, you can
+construct the dictionary in Python code, receive it in pickled form over a
+socket, or use whatever approach makes sense for your application.
+
+Here's an example of the same configuration as above, in YAML format for
+the new dictionary-based approach::
+
+ version: 1
+ formatters:
+ simple:
+ format: format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
+ handlers:
+ console:
+ class: logging.StreamHandler
+ level: DEBUG
+ formatter: simple
+ stream: ext://sys.stdout
+ loggers:
+ simpleExample:
+ level: DEBUG
+ handlers: [console]
+ propagate: no
+ root:
+ level: DEBUG
+ handlers: [console]
+
+For more information about logging using a dictionary, see
+:ref:`logging-config-api`.
+
+What happens if no configuration is provided
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If no logging configuration is provided, it is possible to have a situation
+where a logging event needs to be output, but no handlers can be found to
+output the event. The behaviour of the logging package in these
+circumstances is dependent on the Python version.
+
+For versions of Python prior to 3.2, the behaviour is as follows:
+
+* If *logging.raiseExceptions* is *False* (production mode), the event is
+ silently dropped.
+
+* If *logging.raiseExceptions* is *True* (development mode), a message
+ 'No handlers could be found for logger X.Y.Z' is printed once.
+
+In Python 3.2 and later, the behaviour is as follows:
+
+* The event is output using a 'handler of last resort', stored in
+ ``logging.lastResort``. This internal handler is not associated with any
+ logger, and acts like a :class:`~logging.StreamHandler` which writes the
+ event description message to the current value of ``sys.stderr`` (therefore
+ respecting any redirections which may be in effect). No formatting is
+ done on the message - just the bare event description message is printed.
+ The handler's level is set to ``WARNING``, so all events at this and
+ greater severities will be output.
+
+To obtain the pre-3.2 behaviour, ``logging.lastResort`` can be set to *None*.
+
+.. _library-config:
+
+Configuring Logging for a Library
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When developing a library which uses logging, you should take care to
+document how the library uses logging - for example, the names of loggers
+used. Some consideration also needs to be given to its logging configuration.
+If the using application does not use logging, and library code makes logging
+calls, then (as described in the previous section) events of severity
+``WARNING`` and greater will be printed to ``sys.stderr``. This is regarded as
+the best default behaviour.
+
+If for some reason you *don't* want these messages printed in the absence of
+any logging configuration, you can attach a do-nothing handler to the top-level
+logger for your library. This avoids the message being printed, since a handler
+will be always be found for the library's events: it just doesn't produce any
+output. If the library user configures logging for application use, presumably
+that configuration will add some handlers, and if levels are suitably
+configured then logging calls made in library code will send output to those
+handlers, as normal.
+
+A do-nothing handler is included in the logging package:
+:class:`~logging.NullHandler` (since Python 3.1). An instance of this handler
+could be added to the top-level logger of the logging namespace used by the
+library (*if* you want to prevent your library's logged events being output to
+``sys.stderr`` in the absence of logging configuration). If all logging by a
+library *foo* is done using loggers with names matching 'foo.x', 'foo.x.y',
+etc. then the code::
+
+ import logging
+ logging.getLogger('foo').addHandler(logging.NullHandler())
+
+should have the desired effect. If an organisation produces a number of
+libraries, then the logger name specified can be 'orgname.foo' rather than
+just 'foo'.
+
+**PLEASE NOTE:** It is strongly advised that you *do not add any handlers other
+than* :class:`~logging.NullHandler` *to your library's loggers*. This is
+because the configuration of handlers is the prerogative of the application
+developer who uses your library. The application developer knows their target
+audience and what handlers are most appropriate for their application: if you
+add handlers 'under the hood', you might well interfere with their ability to
+carry out unit tests and deliver logs which suit their requirements.
+
+
+Logging Levels
+--------------
+
+The numeric values of logging levels are given in the following table. These are
+primarily of interest if you want to define your own levels, and need them to
+have specific values relative to the predefined levels. If you define a level
+with the same numeric value, it overwrites the predefined value; the predefined
+name is lost.
+
++--------------+---------------+
+| Level | Numeric value |
++==============+===============+
+| ``CRITICAL`` | 50 |
++--------------+---------------+
+| ``ERROR`` | 40 |
++--------------+---------------+
+| ``WARNING`` | 30 |
++--------------+---------------+
+| ``INFO`` | 20 |
++--------------+---------------+
+| ``DEBUG`` | 10 |
++--------------+---------------+
+| ``NOTSET`` | 0 |
++--------------+---------------+
+
+Levels can also be associated with loggers, being set either by the developer or
+through loading a saved logging configuration. When a logging method is called
+on a logger, the logger compares its own level with the level associated with
+the method call. If the logger's level is higher than the method call's, no
+logging message is actually generated. This is the basic mechanism controlling
+the verbosity of logging output.
+
+Logging messages are encoded as instances of the :class:`~logging.LogRecord`
+class. When a logger decides to actually log an event, a
+:class:`~logging.LogRecord` instance is created from the logging message.
+
+Logging messages are subjected to a dispatch mechanism through the use of
+:dfn:`handlers`, which are instances of subclasses of the :class:`Handler`
+class. Handlers are responsible for ensuring that a logged message (in the form
+of a :class:`LogRecord`) ends up in a particular location (or set of locations)
+which is useful for the target audience for that message (such as end users,
+support desk staff, system administrators, developers). Handlers are passed
+:class:`LogRecord` instances intended for particular destinations. Each logger
+can have zero, one or more handlers associated with it (via the
+:meth:`~Logger.addHandler` method of :class:`Logger`). In addition to any
+handlers directly associated with a logger, *all handlers associated with all
+ancestors of the logger* are called to dispatch the message (unless the
+*propagate* flag for a logger is set to a false value, at which point the
+passing to ancestor handlers stops).
+
+Just as for loggers, handlers can have levels associated with them. A handler's
+level acts as a filter in the same way as a logger's level does. If a handler
+decides to actually dispatch an event, the :meth:`~Handler.emit` method is used
+to send the message to its destination. Most user-defined subclasses of
+:class:`Handler` will need to override this :meth:`~Handler.emit`.
+
+.. _custom-levels:
+
+Custom Levels
+^^^^^^^^^^^^^
+
+Defining your own levels is possible, but should not be necessary, as the
+existing levels have been chosen on the basis of practical experience.
+However, if you are convinced that you need custom levels, great care should
+be exercised when doing this, and it is possibly *a very bad idea to define
+custom levels if you are developing a library*. That's because if multiple
+library authors all define their own custom levels, there is a chance that
+the logging output from such multiple libraries used together will be
+difficult for the using developer to control and/or interpret, because a
+given numeric value might mean different things for different libraries.
+
+.. _useful-handlers:
+
+Useful Handlers
+---------------
+
+In addition to the base :class:`Handler` class, many useful subclasses are
+provided:
+
+#. :class:`StreamHandler` instances send messages to streams (file-like
+ objects).
+
+#. :class:`FileHandler` instances send messages to disk files.
+
+#. :class:`~handlers.BaseRotatingHandler` is the base class for handlers that
+ rotate log files at a certain point. It is not meant to be instantiated
+ directly. Instead, use :class:`~handlers.RotatingFileHandler` or
+ :class:`~handlers.TimedRotatingFileHandler`.
+
+#. :class:`~handlers.RotatingFileHandler` instances send messages to disk
+ files, with support for maximum log file sizes and log file rotation.
+
+#. :class:`~handlers.TimedRotatingFileHandler` instances send messages to
+ disk files, rotating the log file at certain timed intervals.
+
+#. :class:`~handlers.SocketHandler` instances send messages to TCP/IP
+ sockets.
+
+#. :class:`~handlers.DatagramHandler` instances send messages to UDP
+ sockets.
+
+#. :class:`~handlers.SMTPHandler` instances send messages to a designated
+ email address.
+
+#. :class:`~handlers.SysLogHandler` instances send messages to a Unix
+ syslog daemon, possibly on a remote machine.
+
+#. :class:`~handlers.NTEventLogHandler` instances send messages to a
+ Windows NT/2000/XP event log.
+
+#. :class:`~handlers.MemoryHandler` instances send messages to a buffer
+ in memory, which is flushed whenever specific criteria are met.
+
+#. :class:`~handlers.HTTPHandler` instances send messages to an HTTP
+ server using either ``GET`` or ``POST`` semantics.
+
+#. :class:`~handlers.WatchedFileHandler` instances watch the file they are
+ logging to. If the file changes, it is closed and reopened using the file
+ name. This handler is only useful on Unix-like systems; Windows does not
+ support the underlying mechanism used.
+
+#. :class:`~handlers.QueueHandler` instances send messages to a queue, such as
+ those implemented in the :mod:`queue` or :mod:`multiprocessing` modules.
+
+#. :class:`NullHandler` instances do nothing with error messages. They are used
+ by library developers who want to use logging, but want to avoid the 'No
+ handlers could be found for logger XXX' message which can be displayed if
+ the library user has not configured logging. See :ref:`library-config` for
+ more information.
+
+.. versionadded:: 3.1
+ The :class:`NullHandler` class.
+
+.. versionadded:: 3.2
+ The :class:`~handlers.QueueHandler` class.
+
+The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler`
+classes are defined in the core logging package. The other handlers are
+defined in a sub- module, :mod:`logging.handlers`. (There is also another
+sub-module, :mod:`logging.config`, for configuration functionality.)
+
+Logged messages are formatted for presentation through instances of the
+:class:`Formatter` class. They are initialized with a format string suitable for
+use with the % operator and a dictionary.
+
+For formatting multiple messages in a batch, instances of
+:class:`BufferingFormatter` can be used. In addition to the format string (which
+is applied to each message in the batch), there is provision for header and
+trailer format strings.
+
+When filtering based on logger level and/or handler level is not enough,
+instances of :class:`Filter` can be added to both :class:`Logger` and
+:class:`Handler` instances (through their :meth:`addFilter` method). Before
+deciding to process a message further, both loggers and handlers consult all
+their filters for permission. If any filter returns a false value, the message
+is not processed further.
+
+The basic :class:`Filter` functionality allows filtering by specific logger
+name. If this feature is used, messages sent to the named logger and its
+children are allowed through the filter, and all others dropped.
+
+
+.. _logging-exceptions:
+
+Exceptions raised during logging
+--------------------------------
+
+The logging package is designed to swallow exceptions which occur while logging
+in production. This is so that errors which occur while handling logging events
+- such as logging misconfiguration, network or other similar errors - do not
+cause the application using logging to terminate prematurely.
+
+:class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never
+swallowed. Other exceptions which occur during the :meth:`emit` method of a
+:class:`Handler` subclass are passed to its :meth:`handleError` method.
+
+The default implementation of :meth:`handleError` in :class:`Handler` checks
+to see if a module-level variable, :data:`raiseExceptions`, is set. If set, a
+traceback is printed to :data:`sys.stderr`. If not set, the exception is swallowed.
+
+**Note:** The default value of :data:`raiseExceptions` is ``True``. This is because
+during development, you typically want to be notified of any exceptions that
+occur. It's advised that you set :data:`raiseExceptions` to ``False`` for production
+usage.
+
+.. currentmodule:: logging
+
+.. _arbitrary-object-messages:
+
+Using arbitrary objects as messages
+-----------------------------------
+
+In the preceding sections and examples, it has been assumed that the message
+passed when logging the event is a string. However, this is not the only
+possibility. You can pass an arbitrary object as a message, and its
+:meth:`__str__` method will be called when the logging system needs to convert
+it to a string representation. In fact, if you want to, you can avoid
+computing a string representation altogether - for example, the
+:class:`SocketHandler` emits an event by pickling it and sending it over the
+wire.
+
+
+Optimization
+------------
+
+Formatting of message arguments is deferred until it cannot be avoided.
+However, computing the arguments passed to the logging method can also be
+expensive, and you may want to avoid doing it if the logger will just throw
+away your event. To decide what to do, you can call the :meth:`isEnabledFor`
+method which takes a level argument and returns true if the event would be
+created by the Logger for that level of call. You can write code like this::
+
+ if logger.isEnabledFor(logging.DEBUG):
+ logger.debug('Message with %s, %s', expensive_func1(),
+ expensive_func2())
+
+so that if the logger's threshold is set above ``DEBUG``, the calls to
+:func:`expensive_func1` and :func:`expensive_func2` are never made.
+
+There are other optimizations which can be made for specific applications which
+need more precise control over what logging information is collected. Here's a
+list of things you can do to avoid processing during logging which you don't
+need:
+
++-----------------------------------------------+----------------------------------------+
+| What you don't want to collect | How to avoid collecting it |
++===============================================+========================================+
+| Information about where calls were made from. | Set ``logging._srcfile`` to ``None``. |
++-----------------------------------------------+----------------------------------------+
+| Threading information. | Set ``logging.logThreads`` to ``0``. |
++-----------------------------------------------+----------------------------------------+
+| Process information. | Set ``logging.logProcesses`` to ``0``. |
++-----------------------------------------------+----------------------------------------+
+
+Also note that the core logging module only includes the basic handlers. If
+you don't import :mod:`logging.handlers` and :mod:`logging.config`, they won't
+take up any memory.
+
+.. seealso::
+
+ Module :mod:`logging`
+ API reference for the logging module.
+
+ Module :mod:`logging.config`
+ Configuration API for the logging module.
+
+ Module :mod:`logging.handlers`
+ Useful handlers included with the logging module.
+
+ :ref:`A logging cookbook <logging-cookbook>`
+
diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst
new file mode 100644
index 0000000000..124ef33ae4
--- /dev/null
+++ b/Doc/howto/pyporting.rst
@@ -0,0 +1,703 @@
+.. _pyporting-howto:
+
+*********************************
+Porting Python 2 Code to Python 3
+*********************************
+
+:author: Brett Cannon
+
+.. topic:: Abstract
+
+ With Python 3 being the future of Python while Python 2 is still in active
+ use, it is good to have your project available for both major releases of
+ Python. This guide is meant to help you choose which strategy works best
+ for your project to support both Python 2 & 3 along with how to execute
+ that strategy.
+
+ If you are looking to port an extension module instead of pure Python code,
+ please see :ref:`cporting-howto`.
+
+
+Choosing a Strategy
+===================
+
+When a project makes the decision that it's time to support both Python 2 & 3,
+a decision needs to be made as to how to go about accomplishing that goal.
+The chosen strategy will depend on how large the project's existing
+codebase is and how much divergence you want from your Python 2 codebase from
+your Python 3 one (e.g., starting a new version with Python 3).
+
+If your project is brand-new or does not have a large codebase, then you may
+want to consider writing/porting :ref:`all of your code for Python 3
+and use 3to2 <use_3to2>` to port your code for Python 2.
+
+If you would prefer to maintain a codebase which is semantically **and**
+syntactically compatible with Python 2 & 3 simultaneously, you can write
+:ref:`use_same_source`. While this tends to lead to somewhat non-idiomatic
+code, it does mean you keep a rapid development process for you, the developer.
+
+Finally, you do have the option of :ref:`using 2to3 <use_2to3>` to translate
+Python 2 code into Python 3 code (with some manual help). This can take the
+form of branching your code and using 2to3 to start a Python 3 branch. You can
+also have users perform the translation as installation time automatically so
+that you only have to maintain a Python 2 codebase.
+
+Regardless of which approach you choose, porting is not as hard or
+time-consuming as you might initially think. You can also tackle the problem
+piece-meal as a good portion of porting is simply updating your code to follow
+current best practices in a Python 2/3 compatible way.
+
+
+Universal Bits of Advice
+------------------------
+
+Regardless of what strategy you pick, there are a few things you should
+consider.
+
+One is make sure you have a robust test suite. You need to make sure everything
+continues to work, just like when you support a new minor version of Python.
+This means making sure your test suite is thorough and is ported properly
+between Python 2 & 3. You will also most likely want to use something like tox_
+to automate testing between both a Python 2 and Python 3 VM.
+
+Two, once your project has Python 3 support, make sure to add the proper
+classifier on the Cheeseshop_ (PyPI_). To have your project listed as Python 3
+compatible it must have the
+`Python 3 classifier <http://pypi.python.org/pypi?:action=browse&c=533>`_
+(from
+http://techspot.zzzeek.org/2011/01/24/zzzeek-s-guide-to-python-3-porting/)::
+
+ setup(
+ name='Your Library',
+ version='1.0',
+ classifiers=[
+ # make sure to use :: Python *and* :: Python :: 3 so
+ # that pypi can list the package on the python 3 page
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 3'
+ ],
+ packages=['yourlibrary'],
+ # make sure to add custom_fixers to the MANIFEST.in
+ include_package_data=True,
+ # ...
+ )
+
+
+Doing so will cause your project to show up in the
+`Python 3 packages list
+<http://pypi.python.org/pypi?:action=browse&c=533&show=all>`_. You will know
+you set the classifier properly as visiting your project page on the Cheeseshop
+will show a Python 3 logo in the upper-left corner of the page.
+
+Three, the six_ project provides a library which helps iron out differences
+between Python 2 & 3. If you find there is a sticky point that is a continual
+point of contention in your translation or maintenance of code, consider using
+a source-compatible solution relying on six. If you have to create your own
+Python 2/3 compatible solution, you can use ``sys.version_info[0] >= 3`` as a
+guard.
+
+Four, read all the approaches. Just because some bit of advice applies to one
+approach more than another doesn't mean that some advice doesn't apply to other
+strategies.
+
+Five, drop support for older Python versions if possible. `Python 2.5`_
+introduced a lot of useful syntax and libraries which have become idiomatic
+in Python 3. `Python 2.6`_ introduced future statements which makes
+compatibility much easier if you are going from Python 2 to 3.
+`Python 2.7`_ continues the trend in the stdlib. So choose the newest version
+of Python which you believe can be your minimum support version
+and work from there.
+
+
+.. _tox: http://codespeak.net/tox/
+.. _Cheeseshop:
+.. _PyPI: http://pypi.python.org/
+.. _six: http://packages.python.org/six
+.. _Python 2.7: http://www.python.org/2.7.x
+.. _Python 2.6: http://www.python.org/2.6.x
+.. _Python 2.5: http://www.python.org/2.5.x
+.. _Python 2.4: http://www.python.org/2.4.x
+.. _Python 2.3: http://www.python.org/2.3.x
+.. _Python 2.2: http://www.python.org/2.2.x
+
+
+.. _use_3to2:
+
+Python 3 and 3to2
+=================
+
+If you are starting a new project or your codebase is small enough, you may
+want to consider writing your code for Python 3 and backporting to Python 2
+using 3to2_. Thanks to Python 3 being more strict about things than Python 2
+(e.g., bytes vs. strings), the source translation can be easier and more
+straightforward than from Python 2 to 3. Plus it gives you more direct
+experience developing in Python 3 which, since it is the future of Python, is a
+good thing long-term.
+
+A drawback of this approach is that 3to2 is a third-party project. This means
+that the Python core developers (and thus this guide) can make no promises
+about how well 3to2 works at any time. There is nothing to suggest, though,
+that 3to2 is not a high-quality project.
+
+
+.. _3to2: https://bitbucket.org/amentajo/lib3to2/overview
+
+
+.. _use_2to3:
+
+Python 2 and 2to3
+=================
+
+Included with Python since 2.6, the 2to3_ tool (and :mod:`lib2to3` module)
+helps with porting Python 2 to Python 3 by performing various source
+translations. This is a perfect solution for projects which wish to branch
+their Python 3 code from their Python 2 codebase and maintain them as
+independent codebases. You can even begin preparing to use this approach
+today by writing future-compatible Python code which works cleanly in
+Python 2 in conjunction with 2to3; all steps outlined below will work
+with Python 2 code up to the point when the actual use of 2to3 occurs.
+
+Use of 2to3 as an on-demand translation step at install time is also possible,
+preventing the need to maintain a separate Python 3 codebase, but this approach
+does come with some drawbacks. While users will only have to pay the
+translation cost once at installation, you as a developer will need to pay the
+cost regularly during development. If your codebase is sufficiently large
+enough then the translation step ends up acting like a compilation step,
+robbing you of the rapid development process you are used to with Python.
+Obviously the time required to translate a project will vary, so do an
+experimental translation just to see how long it takes to evaluate whether you
+prefer this approach compared to using :ref:`use_same_source` or simply keeping
+a separate Python 3 codebase.
+
+Below are the typical steps taken by a project which uses a 2to3-based approach
+to supporting Python 2 & 3.
+
+
+Support Python 2.7
+------------------
+
+As a first step, make sure that your project is compatible with `Python 2.7`_.
+This is just good to do as Python 2.7 is the last release of Python 2 and thus
+will be used for a rather long time. It also allows for use of the ``-3`` flag
+to Python to help discover places in your code which 2to3 cannot handle but are
+known to cause issues.
+
+Try to Support `Python 2.6`_ and Newer Only
+-------------------------------------------
+
+While not possible for all projects, if you can support `Python 2.6`_ and newer
+**only**, your life will be much easier. Various future statements, stdlib
+additions, etc. exist only in Python 2.6 and later which greatly assist in
+porting to Python 3. But if you project must keep support for `Python 2.5`_ (or
+even `Python 2.4`_) then it is still possible to port to Python 3.
+
+Below are the benefits you gain if you only have to support Python 2.6 and
+newer. Some of these options are personal choice while others are
+**strongly** recommended (the ones that are more for personal choice are
+labeled as such). If you continue to support older versions of Python then you
+at least need to watch out for situations that these solutions fix.
+
+
+``from __future__ import print_function``
+'''''''''''''''''''''''''''''''''''''''''
+
+This is a personal choice. 2to3 handles the translation from the print
+statement to the print function rather well so this is an optional step. This
+future statement does help, though, with getting used to typing
+``print('Hello, World')`` instead of ``print 'Hello, World'``.
+
+
+``from __future__ import unicode_literals``
+'''''''''''''''''''''''''''''''''''''''''''
+
+Another personal choice. You can always mark what you want to be a (unicode)
+string with a ``u`` prefix to get the same effect. But regardless of whether
+you use this future statement or not, you **must** make sure you know exactly
+which Python 2 strings you want to be bytes, and which are to be strings. This
+means you should, **at minimum** mark all strings that are meant to be text
+strings with a ``u`` prefix if you do not use this future statement.
+
+
+Bytes literals
+''''''''''''''
+
+This is a **very** important one. The ability to prefix Python 2 strings that
+are meant to contain bytes with a ``b`` prefix help to very clearly delineate
+what is and is not a Python 3 string. When you run 2to3 on code, all Python 2
+strings become Python 3 strings **unless** they are prefixed with ``b``.
+
+There are some differences between byte literals in Python 2 and those in
+Python 3 thanks to the bytes type just being an alias to ``str`` in Python 2.
+Probably the biggest "gotcha" is that indexing results in different values. In
+Python 2, the value of ``b'py'[1]`` is ``'y'``, while in Python 3 it's ``121``.
+You can avoid this disparity by always slicing at the size of a single element:
+``b'py'[1:2]`` is ``'y'`` in Python 2 and ``b'y'`` in Python 3 (i.e., close
+enough).
+
+You cannot concatenate bytes and strings in Python 3. But since in Python
+2 has bytes aliased to ``str``, it will succeed: ``b'a' + u'b'`` works in
+Python 2, but ``b'a' + 'b'`` in Python 3 is a :exc:`TypeError`. A similar issue
+also comes about when doing comparisons between bytes and strings.
+
+
+Supporting `Python 2.5`_ and Newer Only
+---------------------------------------
+
+If you are supporting `Python 2.5`_ and newer there are still some features of
+Python that you can utilize.
+
+
+``from __future__ import absolute_import``
+''''''''''''''''''''''''''''''''''''''''''
+
+Implicit relative imports (e.g., importing ``spam.bacon`` from within
+``spam.eggs`` with the statement ``import bacon``) does not work in Python 3.
+This future statement moves away from that and allows the use of explicit
+relative imports (e.g., ``from . import bacon``).
+
+In `Python 2.5`_ you must use
+the __future__ statement to get to use explicit relative imports and prevent
+implicit ones. In `Python 2.6`_ explicit relative imports are available without
+the statement, but you still want the __future__ statement to prevent implicit
+relative imports. In `Python 2.7`_ the __future__ statement is not needed. In
+other words, unless you are only supporting Python 2.7 or a version earlier
+than Python 2.5, use the __future__ statement.
+
+
+
+Handle Common "Gotchas"
+-----------------------
+
+There are a few things that just consistently come up as sticking points for
+people which 2to3 cannot handle automatically or can easily be done in Python 2
+to help modernize your code.
+
+
+``from __future__ import division``
+'''''''''''''''''''''''''''''''''''
+
+While the exact same outcome can be had by using the ``-Qnew`` argument to
+Python, using this future statement lifts the requirement that your users use
+the flag to get the expected behavior of division in Python 3
+(e.g., ``1/2 == 0.5; 1//2 == 0``).
+
+
+
+Specify when opening a file as binary
+'''''''''''''''''''''''''''''''''''''
+
+Unless you have been working on Windows, there is a chance you have not always
+bothered to add the ``b`` mode when opening a binary file (e.g., ``rb`` for
+binary reading). Under Python 3, binary files and text files are clearly
+distinct and mutually incompatible; see the :mod:`io` module for details.
+Therefore, you **must** make a decision of whether a file will be used for
+binary access (allowing to read and/or write bytes data) or text access
+(allowing to read and/or write unicode data).
+
+Text files
+''''''''''
+
+Text files created using ``open()`` under Python 2 return byte strings,
+while under Python 3 they return unicode strings. Depending on your porting
+strategy, this can be an issue.
+
+If you want text files to return unicode strings in Python 2, you have two
+possibilities:
+
+* Under Python 2.6 and higher, use :func:`io.open`. Since :func:`io.open`
+ is essentially the same function in both Python 2 and Python 3, it will
+ help iron out any issues that might arise.
+
+* If pre-2.6 compatibility is needed, then you should use :func:`codecs.open`
+ instead. This will make sure that you get back unicode strings in Python 2.
+
+Subclass ``object``
+'''''''''''''''''''
+
+New-style classes have been around since `Python 2.2`_. You need to make sure
+you are subclassing from ``object`` to avoid odd edge cases involving method
+resolution order, etc. This continues to be totally valid in Python 3 (although
+unneeded as all classes implicitly inherit from ``object``).
+
+
+Deal With the Bytes/String Dichotomy
+''''''''''''''''''''''''''''''''''''
+
+One of the biggest issues people have when porting code to Python 3 is handling
+the bytes/string dichotomy. Because Python 2 allowed the ``str`` type to hold
+textual data, people have over the years been rather loose in their delineation
+of what ``str`` instances held text compared to bytes. In Python 3 you cannot
+be so care-free anymore and need to properly handle the difference. The key
+handling this issue to to make sure that **every** string literal in your
+Python 2 code is either syntactically of functionally marked as either bytes or
+text data. After this is done you then need to make sure your APIs are designed
+to either handle a specific type or made to be properly polymorphic.
+
+
+Mark Up Python 2 String Literals
+********************************
+
+First thing you must do is designate every single string literal in Python 2
+as either textual or bytes data. If you are only supporting Python 2.6 or
+newer, this can be accomplished by marking bytes literals with a ``b`` prefix
+and then designating textual data with a ``u`` prefix or using the
+``unicode_literals`` future statement.
+
+If your project supports versions of Python pre-dating 2.6, then you should use
+the six_ project and its ``b()`` function to denote bytes literals. For text
+literals you can either use six's ``u()`` function or use a ``u`` prefix.
+
+
+Decide what APIs Will Accept
+****************************
+
+In Python 2 it was very easy to accidentally create an API that accepted both
+bytes and textual data. But in Python 3, thanks to the more strict handling of
+disparate types, this loose usage of bytes and text together tends to fail.
+
+Take the dict ``{b'a': 'bytes', u'a': 'text'}`` in Python 2.6. It creates the
+dict ``{u'a': 'text'}`` since ``b'a' == u'a'``. But in Python 3 the equivalent
+dict creates ``{b'a': 'bytes', 'a': 'text'}``, i.e., no lost data. Similar
+issues can crop up when transitioning Python 2 code to Python 3.
+
+This means you need to choose what an API is going to accept and create and
+consistently stick to that API in both Python 2 and 3.
+
+
+Bytes / Unicode Comparison
+**************************
+
+In Python 3, mixing bytes and unicode is forbidden in most situations; it
+will raise a :class:`TypeError` where Python 2 would have attempted an implicit
+coercion between types. However, there is one case where it doesn't and
+it can be very misleading::
+
+ >>> b"" == ""
+ False
+
+This is because an equality comparison is required by the language to always
+succeed (and return ``False`` for incompatible types). However, this also
+means that code incorrectly ported to Python 3 can display buggy behaviour
+if such comparisons are silently executed. To detect such situations,
+Python 3 has a ``-b`` flag that will display a warning::
+
+ $ python3 -b
+ >>> b"" == ""
+ __main__:1: BytesWarning: Comparison between bytes and string
+ False
+
+To turn the warning into an exception, use the ``-bb`` flag instead::
+
+ $ python3 -bb
+ >>> b"" == ""
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ BytesWarning: Comparison between bytes and string
+
+
+Indexing bytes objects
+''''''''''''''''''''''
+
+Another potentially surprising change is the indexing behaviour of bytes
+objects in Python 3::
+
+ >>> b"xyz"[0]
+ 120
+
+Indeed, Python 3 bytes objects (as well as :class:`bytearray` objects)
+are sequences of integers. But code converted from Python 2 will often
+assume that indexing a bytestring produces another bytestring, not an
+integer. To reconcile both behaviours, use slicing::
+
+ >>> b"xyz"[0:1]
+ b'x'
+ >>> n = 1
+ >>> b"xyz"[n:n+1]
+ b'y'
+
+The only remaining gotcha is that an out-of-bounds slice returns an empty
+bytes object instead of raising ``IndexError``:
+
+ >>> b"xyz"[3]
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ IndexError: index out of range
+ >>> b"xyz"[3:4]
+ b''
+
+
+``__str__()``/``__unicode__()``
+'''''''''''''''''''''''''''''''
+
+In Python 2, objects can specify both a string and unicode representation of
+themselves. In Python 3, though, there is only a string representation. This
+becomes an issue as people can inadvertently do things in their ``__str__()``
+methods which have unpredictable results (e.g., infinite recursion if you
+happen to use the ``unicode(self).encode('utf8')`` idiom as the body of your
+``__str__()`` method).
+
+There are two ways to solve this issue. One is to use a custom 2to3 fixer. The
+blog post at http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/
+specifies how to do this. That will allow 2to3 to change all instances of ``def
+__unicode(self): ...`` to ``def __str__(self): ...``. This does require you
+define your ``__str__()`` method in Python 2 before your ``__unicode__()``
+method.
+
+The other option is to use a mixin class. This allows you to only define a
+``__unicode__()`` method for your class and let the mixin derive
+``__str__()`` for you (code from
+http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/)::
+
+ import sys
+
+ class UnicodeMixin(object):
+
+ """Mixin class to handle defining the proper __str__/__unicode__
+ methods in Python 2 or 3."""
+
+ if sys.version_info[0] >= 3: # Python 3
+ def __str__(self):
+ return self.__unicode__()
+ else: # Python 2
+ def __str__(self):
+ return self.__unicode__().encode('utf8')
+
+
+ class Spam(UnicodeMixin):
+
+ def __unicode__(self):
+ return u'spam-spam-bacon-spam' # 2to3 will remove the 'u' prefix
+
+
+Don't Index on Exceptions
+'''''''''''''''''''''''''
+
+In Python 2, the following worked::
+
+ >>> exc = Exception(1, 2, 3)
+ >>> exc.args[1]
+ 2
+ >>> exc[1] # Python 2 only!
+ 2
+
+But in Python 3, indexing directly on an exception is an error. You need to
+make sure to only index on the :attr:`BaseException.args` attribute which is a
+sequence containing all arguments passed to the :meth:`__init__` method.
+
+Even better is to use the documented attributes the exception provides.
+
+Don't use ``__getslice__`` & Friends
+''''''''''''''''''''''''''''''''''''
+
+Been deprecated for a while, but Python 3 finally drops support for
+``__getslice__()``, etc. Move completely over to :meth:`__getitem__` and
+friends.
+
+
+Updating doctests
+'''''''''''''''''
+
+2to3_ will attempt to generate fixes for doctests that it comes across. It's
+not perfect, though. If you wrote a monolithic set of doctests (e.g., a single
+docstring containing all of your doctests), you should at least consider
+breaking the doctests up into smaller pieces to make it more manageable to fix.
+Otherwise it might very well be worth your time and effort to port your tests
+to :mod:`unittest`.
+
+
+Eliminate ``-3`` Warnings
+-------------------------
+
+When you run your application's test suite, run it using the ``-3`` flag passed
+to Python. This will cause various warnings to be raised during execution about
+things that 2to3 cannot handle automatically (e.g., modules that have been
+removed). Try to eliminate those warnings to make your code even more portable
+to Python 3.
+
+
+Run 2to3
+--------
+
+Once you have made your Python 2 code future-compatible with Python 3, it's
+time to use 2to3_ to actually port your code.
+
+
+Manually
+''''''''
+
+To manually convert source code using 2to3_, you use the ``2to3`` script that
+is installed with Python 2.6 and later.::
+
+ 2to3 <directory or file to convert>
+
+This will cause 2to3 to write out a diff with all of the fixers applied for the
+converted source code. If you would like 2to3 to go ahead and apply the changes
+you can pass it the ``-w`` flag::
+
+ 2to3 -w <stuff to convert>
+
+There are other flags available to control exactly which fixers are applied,
+etc.
+
+
+During Installation
+'''''''''''''''''''
+
+When a user installs your project for Python 3, you can have either
+:mod:`distutils` or Distribute_ run 2to3_ on your behalf.
+For distutils, use the following idiom::
+
+ try: # Python 3
+ from distutils.command.build_py import build_py_2to3 as build_py
+ except ImportError: # Python 2
+ from distutils.command.build_py import build_py
+
+ setup(cmdclass = {'build_py': build_py},
+ # ...
+ )
+
+For Distribute::
+
+ setup(use_2to3=True,
+ # ...
+ )
+
+This will allow you to not have to distribute a separate Python 3 version of
+your project. It does require, though, that when you perform development that
+you at least build your project and use the built Python 3 source for testing.
+
+
+Verify & Test
+-------------
+
+At this point you should (hopefully) have your project converted in such a way
+that it works in Python 3. Verify it by running your unit tests and making sure
+nothing has gone awry. If you miss something then figure out how to fix it in
+Python 3, backport to your Python 2 code, and run your code through 2to3 again
+to verify the fix transforms properly.
+
+
+.. _2to3: http://docs.python.org/py3k/library/2to3.html
+.. _Distribute: http://packages.python.org/distribute/
+
+
+.. _use_same_source:
+
+Python 2/3 Compatible Source
+============================
+
+While it may seem counter-intuitive, you can write Python code which is
+source-compatible between Python 2 & 3. It does lead to code that is not
+entirely idiomatic Python (e.g., having to extract the currently raised
+exception from ``sys.exc_info()[1]``), but it can be run under Python 2
+**and** Python 3 without using 2to3_ as a translation step (although the tool
+should be used to help find potential portability problems). This allows you to
+continue to have a rapid development process regardless of whether you are
+developing under Python 2 or Python 3. Whether this approach or using
+:ref:`use_2to3` works best for you will be a per-project decision.
+
+To get a complete idea of what issues you will need to deal with, see the
+`What's New in Python 3.0`_. Others have reorganized the data in other formats
+such as http://docs.pythonsprints.com/python3_porting/py-porting.html .
+
+The following are some steps to take to try to support both Python 2 & 3 from
+the same source code.
+
+
+.. _What's New in Python 3.0: http://docs.python.org/release/3.0/whatsnew/3.0.html
+
+
+Follow The Steps for Using 2to3_
+--------------------------------
+
+All of the steps outlined in how to
+:ref:`port Python 2 code with 2to3 <use_2to3>` apply
+to creating a Python 2/3 codebase. This includes trying only support Python 2.6
+or newer (the :mod:`__future__` statements work in Python 3 without issue),
+eliminating warnings that are triggered by ``-3``, etc.
+
+You should even consider running 2to3_ over your code (without committing the
+changes). This will let you know where potential pain points are within your
+code so that you can fix them properly before they become an issue.
+
+
+Use six_
+--------
+
+The six_ project contains many things to help you write portable Python code.
+You should make sure to read its documentation from beginning to end and use
+any and all features it provides. That way you will minimize any mistakes you
+might make in writing cross-version code.
+
+
+Capturing the Currently Raised Exception
+----------------------------------------
+
+One change between Python 2 and 3 that will require changing how you code (if
+you support `Python 2.5`_ and earlier) is
+accessing the currently raised exception. In Python 2.5 and earlier the syntax
+to access the current exception is::
+
+ try:
+ raise Exception()
+ except Exception, exc:
+ # Current exception is 'exc'
+ pass
+
+This syntax changed in Python 3 (and backported to `Python 2.6`_ and later)
+to::
+
+ try:
+ raise Exception()
+ except Exception as exc:
+ # Current exception is 'exc'
+ # In Python 3, 'exc' is restricted to the block; Python 2.6 will "leak"
+ pass
+
+Because of this syntax change you must change to capturing the current
+exception to::
+
+ try:
+ raise Exception()
+ except Exception:
+ import sys
+ exc = sys.exc_info()[1]
+ # Current exception is 'exc'
+ pass
+
+You can get more information about the raised exception from
+:func:`sys.exc_info` than simply the current exception instance, but you most
+likely don't need it.
+
+.. note::
+ In Python 3, the traceback is attached to the exception instance
+ through the ``__traceback__`` attribute. If the instance is saved in
+ a local variable that persists outside of the ``except`` block, the
+ traceback will create a reference cycle with the current frame and its
+ dictionary of local variables. This will delay reclaiming dead
+ resources until the next cyclic :term:`garbage collection` pass.
+
+ In Python 2, this problem only occurs if you save the traceback itself
+ (e.g. the third element of the tuple returned by :func:`sys.exc_info`)
+ in a variable.
+
+
+Other Resources
+===============
+
+The authors of the following blog posts, wiki pages, and books deserve special
+thanks for making public their tips for porting Python 2 code to Python 3 (and
+thus helping provide information for this document):
+
+* http://python3porting.com/
+* http://docs.pythonsprints.com/python3_porting/py-porting.html
+* http://techspot.zzzeek.org/2011/01/24/zzzeek-s-guide-to-python-3-porting/
+* http://dabeaz.blogspot.com/2011/01/porting-py65-and-my-superboard-to.html
+* http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/
+* http://lucumr.pocoo.org/2010/2/11/porting-to-python-3-a-guide/
+* http://wiki.python.org/moin/PortingPythonToPy3k
+
+If you feel there is something missing from this document that should be added,
+please email the python-porting_ mailing list.
+
+.. _python-porting: http://mail.python.org/mailman/listinfo/python-porting
diff --git a/Doc/howto/sorting.rst b/Doc/howto/sorting.rst
index 351713f2cf..d9c70e2d8a 100644
--- a/Doc/howto/sorting.rst
+++ b/Doc/howto/sorting.rst
@@ -23,7 +23,7 @@ returns a new sorted list::
>>> sorted([5, 2, 3, 1, 4])
[1, 2, 3, 4, 5]
-You can also use the :meth:`list.sort` method of a list. It modifies the list
+You can also use the :meth:`list.sort` method. It modifies the list
in-place (and returns *None* to avoid confusion). Usually it's less convenient
than :func:`sorted` - but if you don't need the original list, it's slightly
more efficient.
@@ -87,9 +87,9 @@ Operator Module Functions
=========================
The key-function patterns shown above are very common, so Python provides
-convenience functions to make accessor functions easier and faster. The operator
-module has :func:`operator.itemgetter`, :func:`operator.attrgetter`, and
-an :func:`operator.methodcaller` function.
+convenience functions to make accessor functions easier and faster. The
+:mod:`operator` module has :func:`~operator.itemgetter`,
+:func:`~operator.attrgetter`, and an :func:`~operator.methodcaller` function.
Using those functions, the above examples become simpler and faster:
@@ -247,6 +247,8 @@ To convert to a key function, just wrap the old comparison function:
>>> sorted([5, 2, 4, 1, 3], key=cmp_to_key(reverse_numeric))
[5, 4, 3, 2, 1]
+In Python 3.2, the :func:`functools.cmp_to_key` function was added to the
+:mod:`functools` module in the standard library.
Odd and Ends
============
@@ -254,7 +256,7 @@ Odd and Ends
* For locale aware sorting, use :func:`locale.strxfrm` for a key function or
:func:`locale.strcoll` for a comparison function.
-* The *reverse* parameter still maintains sort stability (i.e. records with
+* The *reverse* parameter still maintains sort stability (so that records with
equal keys retain the original order). Interestingly, that effect can be
simulated without the parameter by using the builtin :func:`reversed` function
twice:
diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst
index 13efa7610f..77fcd26f75 100644
--- a/Doc/howto/unicode.rst
+++ b/Doc/howto/unicode.rst
@@ -4,13 +4,11 @@
Unicode HOWTO
*****************
-:Release: 1.11
+:Release: 1.12
-This HOWTO discusses Python 2.x's support for Unicode, and explains
+This HOWTO discusses Python support for Unicode, and explains
various problems that people commonly encounter when trying to work
-with Unicode. (This HOWTO has not yet been updated to cover the 3.x
-versions of Python.)
-
+with Unicode.
Introduction to Unicode
=======================
@@ -44,14 +42,14 @@ In the 1980s, almost all personal computers were 8-bit, meaning that bytes could
hold values ranging from 0 to 255. ASCII codes only went up to 127, so some
machines assigned values between 128 and 255 to accented characters. Different
machines had different codes, however, which led to problems exchanging files.
-Eventually various commonly used sets of values for the 128-255 range emerged.
+Eventually various commonly used sets of values for the 128--255 range emerged.
Some were true standards, defined by the International Standards Organization,
and some were **de facto** conventions that were invented by one company or
another and managed to catch on.
255 characters aren't very many. For example, you can't fit both the accented
characters used in Western Europe and the Cyrillic alphabet used for Russian
-into the 128-255 range because there are more than 127 such characters.
+into the 128--255 range because there are more than 127 such characters.
You could write files using different codes (all your Russian files in a coding
system called KOI8, all your French files in a different coding system called
@@ -64,8 +62,8 @@ bits means you have 2^16 = 65,536 distinct values available, making it possible
to represent many different characters from many different alphabets; an initial
goal was to have Unicode contain the alphabets for every single human language.
It turns out that even 16 bits isn't enough to meet that goal, and the modern
-Unicode specification uses a wider range of codes, 0-1,114,111 (0x10ffff in
-base-16).
+Unicode specification uses a wider range of codes, 0 through 1,114,111 (0x10ffff
+in base 16).
There's a related ISO standard, ISO 10646. Unicode and ISO 10646 were
originally separate efforts, but the specifications were merged with the 1.1
@@ -90,7 +88,7 @@ meanings.
The Unicode standard describes how characters are represented by **code
points**. A code point is an integer value, usually denoted in base 16. In the
standard, a code point is written using the notation U+12ca to mean the
-character with value 0x12ca (4810 decimal). The Unicode standard contains a lot
+character with value 0x12ca (4,810 decimal). The Unicode standard contains a lot
of tables listing characters and their corresponding code points::
0061 'a'; LATIN SMALL LETTER A
@@ -117,10 +115,10 @@ Encodings
---------
To summarize the previous section: a Unicode string is a sequence of code
-points, which are numbers from 0 to 0x10ffff. This sequence needs to be
-represented as a set of bytes (meaning, values from 0-255) in memory. The rules
-for translating a Unicode string into a sequence of bytes are called an
-**encoding**.
+points, which are numbers from 0 through 0x10ffff (1,114,111 decimal). This
+sequence needs to be represented as a set of bytes (meaning, values
+from 0 through 255) in memory. The rules for translating a Unicode string
+into a sequence of bytes are called an **encoding**.
The first encoding you might think of is an array of 32-bit integers. In this
representation, the string "Python" would look like this::
@@ -164,7 +162,7 @@ encoding, for example, are simple; for each code point:
case.)
Latin-1, also known as ISO-8859-1, is a similar encoding. Unicode code points
-0-255 are identical to the Latin-1 values, so converting to this encoding simply
+0--255 are identical to the Latin-1 values, so converting to this encoding simply
requires converting code points to byte values; if a code point larger than 255
is encountered, the string can't be encoded into Latin-1.
@@ -226,8 +224,8 @@ Wikipedia entries are often helpful; see the entries for "character encoding"
<http://en.wikipedia.org/wiki/UTF-8>, for example.
-Python 2.x's Unicode Support
-============================
+Python's Unicode Support
+========================
Now that you've learned the rudiments of Unicode, we can look at Python's
Unicode features.
@@ -284,10 +282,10 @@ that contains the corresponding code point. The reverse operation is the
built-in :func:`ord` function that takes a one-character Unicode string and
returns the code point value::
- >>> chr(40960)
- '\ua000'
- >>> ord('\ua000')
- 40960
+ >>> chr(57344)
+ '\ue000'
+ >>> ord('\ue000')
+ 57344
Converting to Bytes
-------------------
@@ -329,7 +327,8 @@ Unicode Literals in Python Source Code
In Python source code, specific Unicode code points can be written using the
``\u`` escape sequence, which is followed by four hex digits giving the code
-point. The ``\U`` escape sequence is similar, but expects 8 hex digits, not 4::
+point. The ``\U`` escape sequence is similar, but expects eight hex digits,
+not four::
>>> s = "a\xac\u1234\u20ac\U00008000"
^^^^ two-digit hex escape
@@ -409,7 +408,7 @@ These are grouped into categories such as "Letter", "Number", "Punctuation", or
from the above output, ``'Ll'`` means 'Letter, lowercase', ``'No'`` means
"Number, other", ``'Mn'`` is "Mark, nonspacing", and ``'So'`` is "Symbol,
other". See
-<http://unicode.org/Public/5.1.0/ucd/UCD.html#General_Category_Values> for a
+<http://www.unicode.org/reports/tr44/#General_Category_Values> for a
list of category codes.
References
@@ -468,18 +467,17 @@ like those in string objects' :meth:`encode` and :meth:`decode` methods.
Reading Unicode from a file is therefore simple::
- f = open('unicode.rst', encoding='utf-8')
- for line in f:
- print(repr(line))
+ with open('unicode.rst', encoding='utf-8') as f:
+ for line in f:
+ print(repr(line))
It's also possible to open files in update mode, allowing both reading and
writing::
- f = open('test', encoding='utf-8', mode='w+')
- f.write('\u4500 blah blah blah\n')
- f.seek(0)
- print(repr(f.readline()[:1]))
- f.close()
+ with open('test', encoding='utf-8', mode='w+') as f:
+ f.write('\u4500 blah blah blah\n')
+ f.seek(0)
+ print(repr(f.readline()[:1]))
The Unicode character U+FEFF is used as a byte-order mark (BOM), and is often
written as the first character of a file in order to assist with autodetection
@@ -516,14 +514,13 @@ usually just provide the Unicode string as the filename, and it will be
automatically converted to the right encoding for you::
filename = 'filename\u4500abc'
- f = open(filename, 'w')
- f.write('blah\n')
- f.close()
+ with open(filename, 'w') as f:
+ f.write('blah\n')
Functions in the :mod:`os` module such as :func:`os.stat` will also accept Unicode
filenames.
-:func:`os.listdir`, which returns filenames, raises an issue: should it return
+Function :func:`os.listdir`, which returns filenames, raises an issue: should it return
the Unicode version of filenames, or should it return byte strings containing
the encoded versions? :func:`os.listdir` will do both, depending on whether you
provided the directory path as a byte string or a Unicode string. If you pass a
@@ -572,14 +569,6 @@ strings, you will find your program vulnerable to bugs wherever you combine the
two different kinds of strings. There is no automatic encoding or decoding if
you do e.g. ``str + bytes``, a :exc:`TypeError` is raised for this expression.
-It's easy to miss such problems if you only test your software with data that
-doesn't contain any accents; everything will seem to work, but there's actually
-a bug in your program waiting for the first user who attempts to use characters
-> 127. A second tip, therefore, is:
-
- Include characters > 127 and, even better, characters > 255 in your test
- data.
-
When using data coming from a web browser or some other untrusted source, a
common technique is to check for illegal characters in a string before using the
string in a generated command line or storing it in a database. If you're doing
@@ -597,8 +586,8 @@ this code::
if '/' in filename:
raise ValueError("'/' not allowed in filenames")
unicode_name = filename.decode(encoding)
- f = open(unicode_name, 'r')
- # ... return contents of file ...
+ with open(unicode_name, 'r') as f:
+ # ... return contents of file ...
However, if an attacker could specify the ``'base64'`` encoding, they could pass
``'L2V0Yy9wYXNzd2Q='``, which is the base-64 encoded form of the string
@@ -613,27 +602,30 @@ The PDF slides for Marc-André Lemburg's presentation "Writing Unicode-aware
Applications in Python" are available at
<http://downloads.egenix.com/python/LSM2005-Developing-Unicode-aware-applications-in-Python.pdf>
and discuss questions of character encodings as well as how to internationalize
-and localize an application.
+and localize an application. These slides cover Python 2.x only.
-Revision History and Acknowledgements
-=====================================
+Acknowledgements
+================
Thanks to the following people who have noted errors or offered suggestions on
this article: Nicholas Bastin, Marius Gedminas, Kent Johnson, Ken Krugler,
Marc-André Lemburg, Martin von Löwis, Chad Whitacre.
-Version 1.0: posted August 5 2005.
+.. comment
+ Revision History
+
+ Version 1.0: posted August 5 2005.
-Version 1.01: posted August 7 2005. Corrects factual and markup errors; adds
-several links.
+ Version 1.01: posted August 7 2005. Corrects factual and markup errors; adds
+ several links.
-Version 1.02: posted August 16 2005. Corrects factual errors.
+ Version 1.02: posted August 16 2005. Corrects factual errors.
-Version 1.1: Feb-Nov 2008. Updates the document with respect to Python 3 changes.
+ Version 1.1: Feb-Nov 2008. Updates the document with respect to Python 3 changes.
-Version 1.11: posted June 20 2010. Notes that Python 3.x is not covered,
-and that the HOWTO only covers 2.x.
+ Version 1.11: posted June 20 2010. Notes that Python 3.x is not covered,
+ and that the HOWTO only covers 2.x.
.. comment Describe Python 3.x support (new section? new document?)
.. comment Additional topic: building Python w/ UCS2 or UCS4 support
diff --git a/Doc/howto/webservers.rst b/Doc/howto/webservers.rst
index caf0ad6667..c4ac2b2f78 100644
--- a/Doc/howto/webservers.rst
+++ b/Doc/howto/webservers.rst
@@ -293,7 +293,7 @@ following WSGI-application::
# -*- coding: UTF-8 -*-
import sys, os
- from cgi import escape
+ from html import escape
from flup.server.fcgi import WSGIServer
def app(environ, start_response):
diff --git a/Doc/includes/dbpickle.py b/Doc/includes/dbpickle.py
index c021eac6c3..b88ee87d87 100644
--- a/Doc/includes/dbpickle.py
+++ b/Doc/includes/dbpickle.py
@@ -47,7 +47,8 @@ class DBUnpickler(pickle.Unpickler):
def main():
- import io, pprint
+ import io
+ import pprint
# Initialize and populate our database.
conn = sqlite3.connect(":memory:")
diff --git a/Doc/includes/email-alternative.py b/Doc/includes/email-alternative.py
index 82e3ffa3b3..33c430ab95 100644
--- a/Doc/includes/email-alternative.py
+++ b/Doc/includes/email-alternative.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python3
import smtplib
diff --git a/Doc/includes/email-dir.py b/Doc/includes/email-dir.py
index 035442bc3a..cc5529e8fe 100644
--- a/Doc/includes/email-dir.py
+++ b/Doc/includes/email-dir.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Send the contents of a directory as a MIME message."""
diff --git a/Doc/includes/email-headers.py b/Doc/includes/email-headers.py
new file mode 100644
index 0000000000..a53317dbd8
--- /dev/null
+++ b/Doc/includes/email-headers.py
@@ -0,0 +1,17 @@
+# Import the email modules we'll need
+from email.parser import Parser
+
+# If the e-mail headers are in a file, uncomment this line:
+#headers = Parser().parse(open(messagefile, 'r'))
+
+# Or for parsing headers in a string, use:
+headers = Parser().parsestr('From: <user@example.com>\n'
+ 'To: <someone_else@example.com>\n'
+ 'Subject: Test message\n'
+ '\n'
+ 'Body would go here\n')
+
+# Now the header items can be accessed as a dictionary:
+print('To: %s' % headers['to'])
+print('From: %s' % headers['from'])
+print('Subject: %s' % headers['subject'])
diff --git a/Doc/includes/email-mime.py b/Doc/includes/email-mime.py
index 7b1c028fad..a90edc1373 100644
--- a/Doc/includes/email-mime.py
+++ b/Doc/includes/email-mime.py
@@ -27,5 +27,5 @@ for file in pngfiles:
# Send the email via our own SMTP server.
s = smtplib.SMTP('localhost')
-s.sendmail(me, family, msg.as_string())
+s.send_message(msg)
s.quit()
diff --git a/Doc/includes/email-simple.py b/Doc/includes/email-simple.py
index 29bd0782d6..077568d563 100644
--- a/Doc/includes/email-simple.py
+++ b/Doc/includes/email-simple.py
@@ -17,8 +17,7 @@ msg['Subject'] = 'The contents of %s' % textfile
msg['From'] = me
msg['To'] = you
-# Send the message via our own SMTP server, but don't include the
-# envelope header.
+# Send the message via our own SMTP server.
s = smtplib.SMTP('localhost')
-s.sendmail(me, [you], msg.as_string())
+s.send_message(msg)
s.quit()
diff --git a/Doc/includes/email-unpack.py b/Doc/includes/email-unpack.py
index a8f712d26f..3653543566 100644
--- a/Doc/includes/email-unpack.py
+++ b/Doc/includes/email-unpack.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unpack a MIME message into a directory of files."""
diff --git a/Doc/includes/minidom-example.py b/Doc/includes/minidom-example.py
index 88048c0c6a..5ee7682c19 100644
--- a/Doc/includes/minidom-example.py
+++ b/Doc/includes/minidom-example.py
@@ -19,11 +19,11 @@ document = """\
dom = xml.dom.minidom.parseString(document)
def getText(nodelist):
- rc = ""
+ rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
- rc = rc + node.data
- return rc
+ rc.append(node.data)
+ return ''.join(rc)
def handleSlideshow(slideshow):
print("<html>")
diff --git a/Doc/includes/mp_benchmarks.py b/Doc/includes/mp_benchmarks.py
index 72d4426c25..acdf6425bc 100644
--- a/Doc/includes/mp_benchmarks.py
+++ b/Doc/includes/mp_benchmarks.py
@@ -5,7 +5,12 @@
# All rights reserved.
#
-import time, sys, multiprocessing, threading, queue, gc
+import time
+import sys
+import multiprocessing
+import threading
+import queue
+import gc
if sys.platform == 'win32':
_timer = time.clock
@@ -111,7 +116,7 @@ def test_seqspeed(seq):
for i in range(iterations):
a = seq[5]
- elapsed = _timer()-t
+ elapsed = _timer() - t
print(iterations, 'iterations in', elapsed, 'seconds')
print('average number/sec:', iterations/elapsed)
@@ -132,7 +137,7 @@ def test_lockspeed(l):
l.acquire()
l.release()
- elapsed = _timer()-t
+ elapsed = _timer() - t
print(iterations, 'iterations in', elapsed, 'seconds')
print('average number/sec:', iterations/elapsed)
@@ -169,7 +174,7 @@ def test_conditionspeed(Process, c):
c.notify()
c.wait()
- elapsed = _timer()-t
+ elapsed = _timer() - t
c.release()
p.join()
diff --git a/Doc/includes/mp_pool.py b/Doc/includes/mp_pool.py
index e360703bd1..1578498754 100644
--- a/Doc/includes/mp_pool.py
+++ b/Doc/includes/mp_pool.py
@@ -25,18 +25,18 @@ def calculatestar(args):
return calculate(*args)
def mul(a, b):
- time.sleep(0.5*random.random())
+ time.sleep(0.5 * random.random())
return a * b
def plus(a, b):
- time.sleep(0.5*random.random())
+ time.sleep(0.5 * random.random())
return a + b
def f(x):
- return 1.0 / (x-5.0)
+ return 1.0 / (x - 5.0)
def pow3(x):
- return x**3
+ return x ** 3
def noop(x):
pass
diff --git a/Doc/includes/mp_synchronize.py b/Doc/includes/mp_synchronize.py
index fd393f2888..81dbc387fc 100644
--- a/Doc/includes/mp_synchronize.py
+++ b/Doc/includes/mp_synchronize.py
@@ -5,7 +5,9 @@
# All rights reserved.
#
-import time, sys, random
+import time
+import sys
+import random
from queue import Empty
import multiprocessing # may get overwritten
@@ -237,9 +239,9 @@ def test(namespace=multiprocessing):
multiprocessing = namespace
- for func in [ test_value, test_queue, test_condition,
- test_semaphore, test_join_timeout, test_event,
- test_sharedvalues ]:
+ for func in [test_value, test_queue, test_condition,
+ test_semaphore, test_join_timeout, test_event,
+ test_sharedvalues]:
print('\n\t######## %s\n' % func.__name__)
func()
diff --git a/Doc/includes/mp_webserver.py b/Doc/includes/mp_webserver.py
index 0878de110d..651024d939 100644
--- a/Doc/includes/mp_webserver.py
+++ b/Doc/includes/mp_webserver.py
@@ -24,7 +24,7 @@ if sys.platform == 'win32':
def note(format, *args):
- sys.stderr.write('[%s]\t%s\n' % (current_process().name, format%args))
+ sys.stderr.write('[%s]\t%s\n' % (current_process().name, format % args))
class RequestHandler(SimpleHTTPRequestHandler):
@@ -45,7 +45,7 @@ def runpool(address, number_of_processes):
server = HTTPServer(address, RequestHandler)
# create child processes to act as workers
- for i in range(number_of_processes-1):
+ for i in range(number_of_processes - 1):
Process(target=serve_forever, args=(server,)).start()
# main process also acts as a worker
diff --git a/Doc/includes/sqlite3/adapter_datetime.py b/Doc/includes/sqlite3/adapter_datetime.py
index 5869e22b32..be33395100 100644
--- a/Doc/includes/sqlite3/adapter_datetime.py
+++ b/Doc/includes/sqlite3/adapter_datetime.py
@@ -1,5 +1,6 @@
import sqlite3
-import datetime, time
+import datetime
+import time
def adapt_datetime(ts):
return time.mktime(ts.timetuple())
diff --git a/Doc/includes/sqlite3/load_extension.py b/Doc/includes/sqlite3/load_extension.py
new file mode 100644
index 0000000000..015aa0de8c
--- /dev/null
+++ b/Doc/includes/sqlite3/load_extension.py
@@ -0,0 +1,26 @@
+import sqlite3
+
+con = sqlite3.connect(":memory:")
+
+# enable extension loading
+con.enable_load_extension(True)
+
+# Load the fulltext search extension
+con.execute("select load_extension('./fts3.so')")
+
+# alternatively you can load the extension using an API call:
+# con.load_extension("./fts3.so")
+
+# disable extension laoding again
+con.enable_load_extension(False)
+
+# example from SQLite wiki
+con.execute("create virtual table recipe using fts3(name, ingredients)")
+con.executescript("""
+ insert into recipe (name, ingredients) values ('broccoli stew', 'broccoli peppers cheese tomatoes');
+ insert into recipe (name, ingredients) values ('pumpkin stew', 'pumpkin onions garlic celery');
+ insert into recipe (name, ingredients) values ('broccoli pie', 'broccoli cheese onions flour');
+ insert into recipe (name, ingredients) values ('pumpkin pie', 'pumpkin sugar flour butter');
+ """)
+for row in con.execute("select rowid, name, ingredients from recipe where name match 'pie'"):
+ print(row)
diff --git a/Doc/includes/turtle-star.py b/Doc/includes/turtle-star.py
new file mode 100644
index 0000000000..1a5db761b3
--- /dev/null
+++ b/Doc/includes/turtle-star.py
@@ -0,0 +1,10 @@
+from turtle import *
+color('red', 'yellow')
+begin_fill()
+while True:
+ forward(200)
+ left(170)
+ if abs(pos()) < 1:
+ break
+end_fill()
+done()
diff --git a/Doc/includes/tzinfo-examples.py b/Doc/includes/tzinfo-examples.py
index 5132429fb4..3a8cf47eaf 100644
--- a/Doc/includes/tzinfo-examples.py
+++ b/Doc/includes/tzinfo-examples.py
@@ -27,7 +27,7 @@ class FixedOffset(tzinfo):
"""Fixed offset in minutes east from UTC."""
def __init__(self, offset, name):
- self.__offset = timedelta(minutes = offset)
+ self.__offset = timedelta(minutes=offset)
self.__name = name
def utcoffset(self, dt):
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
index 6a11c5accc..31c1d7ff12 100644
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -691,6 +691,9 @@ And on Windows, the configuration files are:
| local | :file:`setup.cfg` | \(3) |
+--------------+-------------------------------------------------+-------+
+On all platforms, the "personal" file can be temporarily disabled by
+passing the `--no-user-cfg` option.
+
Notes:
(1)
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index de31251cec..b3efeab21c 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -141,7 +141,7 @@ and off individually. They are described here in more detail.
.. 2to3fixer:: exec
- Converts the :keyword:`exec` statement to the :func:`exec` function.
+ Converts the ``exec`` statement to the :func:`exec` function.
.. 2to3fixer:: execfile
@@ -267,6 +267,25 @@ and off individually. They are described here in more detail.
Converts octal literals into the new syntax.
+.. 2to3fixer:: operator
+
+ Converts calls to various functions in the :mod:`operator` module to other,
+ but equivalent, function calls. When needed, the appropriate ``import``
+ statements are added, e.g. ``import collections``. The following mapping
+ are made:
+
+ ================================== ==========================================
+ From To
+ ================================== ==========================================
+ ``operator.isCallable(obj)`` ``hasattr(obj, '__call__')``
+ ``operator.sequenceIncludes(obj)`` ``operator.contains(obj)``
+ ``operator.isSequenceType(obj)`` ``isinstance(obj, collections.Sequence)``
+ ``operator.isMappingType(obj)`` ``isinstance(obj, collections.Mapping)``
+ ``operator.isNumberType(obj)`` ``isinstance(obj, numbers.Number)``
+ ``operator.repeat(obj, n)`` ``operator.mul(obj, n)``
+ ``operator.irepeat(obj, n)`` ``operator.imul(obj, n)``
+ ================================== ==========================================
+
.. 2to3fixer:: paren
Add extra parenthesis where they are required in list comprehensions. For
@@ -274,7 +293,7 @@ and off individually. They are described here in more detail.
.. 2to3fixer:: print
- Converts the :keyword:`print` statement to the :func:`print` function.
+ Converts the ``print`` statement to the :func:`print` function.
.. 2to3fixer:: raise
diff --git a/Doc/library/__future__.rst b/Doc/library/__future__.rst
index 2348217f3d..0acccc591b 100644
--- a/Doc/library/__future__.rst
+++ b/Doc/library/__future__.rst
@@ -4,6 +4,9 @@
.. module:: __future__
:synopsis: Future statement definitions
+**Source code:** :source:`Lib/__future__.py`
+
+--------------
:mod:`__future__` is a real module, and serves three purposes:
diff --git a/Doc/library/_dummy_thread.rst b/Doc/library/_dummy_thread.rst
index 62e57080a7..83aec12bbb 100644
--- a/Doc/library/_dummy_thread.rst
+++ b/Doc/library/_dummy_thread.rst
@@ -4,6 +4,9 @@
.. module:: _dummy_thread
:synopsis: Drop-in replacement for the _thread module.
+**Source code:** :source:`Lib/_dummy_thread.py`
+
+--------------
This module provides a duplicate interface to the :mod:`_thread` module. It is
meant to be imported when the :mod:`_thread` module is not provided on a
diff --git a/Doc/library/_thread.rst b/Doc/library/_thread.rst
index cb624078ca..369e9cd01e 100644
--- a/Doc/library/_thread.rst
+++ b/Doc/library/_thread.rst
@@ -28,7 +28,7 @@ implementation. For systems lacking the :mod:`_thread` module, the
:mod:`_dummy_thread` module is available. It duplicates this module's interface
and can be used as a drop-in replacement.
-It defines the following constant and functions:
+It defines the following constants and functions:
.. exception:: error
@@ -103,18 +103,42 @@ It defines the following constant and functions:
Availability: Windows, systems with POSIX threads.
+.. data:: TIMEOUT_MAX
+
+ The maximum value allowed for the *timeout* parameter of
+ :meth:`Lock.acquire`. Specifying a timeout greater than this value will
+ raise an :exc:`OverflowError`.
+
+ .. versionadded:: 3.2
+
+
Lock objects have the following methods:
-.. method:: lock.acquire([waitflag])
+.. method:: lock.acquire(waitflag=1, timeout=-1)
- Without the optional argument, this method acquires the lock unconditionally, if
+ Without any optional argument, this method acquires the lock unconditionally, if
necessary waiting until it is released by another thread (only one thread at a
- time can acquire a lock --- that's their reason for existence). If the integer
- *waitflag* argument is present, the action depends on its value: if it is zero,
- the lock is only acquired if it can be acquired immediately without waiting,
- while if it is nonzero, the lock is acquired unconditionally as before. The
- return value is ``True`` if the lock is acquired successfully, ``False`` if not.
+ time can acquire a lock --- that's their reason for existence).
+
+ If the integer *waitflag* argument is present, the action depends on its
+ value: if it is zero, the lock is only acquired if it can be acquired
+ immediately without waiting, while if it is nonzero, the lock is acquired
+ unconditionally as above.
+
+ If the floating-point *timeout* argument is present and positive, it
+ specifies the maximum wait time in seconds before returning. A negative
+ *timeout* argument specifies an unbounded wait. You cannot specify
+ a *timeout* if *waitflag* is zero.
+
+ The return value is ``True`` if the lock is acquired successfully,
+ ``False`` if not.
+
+ .. versionchanged:: 3.2
+ The *timeout* parameter is new.
+
+ .. versionchanged:: 3.2
+ Lock acquires can now be interrupted by signals on POSIX.
.. method:: lock.release()
@@ -156,12 +180,10 @@ In addition to these methods, lock objects can also be used via the
* It is not possible to interrupt the :meth:`acquire` method on a lock --- the
:exc:`KeyboardInterrupt` exception will happen after the lock has been acquired.
- .. index:: pair: threads; IRIX
-
* When the main thread exits, it is system defined whether the other threads
- survive. On SGI IRIX using the native thread implementation, they survive. On
- most other systems, they are killed without executing :keyword:`try` ...
- :keyword:`finally` clauses or executing object destructors.
+ survive. On most systems, they are killed without executing
+ :keyword:`try` ... :keyword:`finally` clauses or executing object
+ destructors.
* When the main thread exits, it does not do any of its usual cleanup (except
that :keyword:`try` ... :keyword:`finally` clauses are honored), and the
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
index aa1cc7871e..9fadbd234e 100644
--- a/Doc/library/abc.rst
+++ b/Doc/library/abc.rst
@@ -7,6 +7,10 @@
.. sectionauthor:: Georg Brandl
.. much of the content adapted from docstrings
+**Source code:** :source:`Lib/abc.py`
+
+--------------
+
This module provides the infrastructure for defining an :term:`abstract base
class` (ABCs) in Python, as outlined in :pep:`3119`; see the PEP for why this
was added to Python. (See also :pep:`3141` and the :mod:`numbers` module
@@ -122,7 +126,7 @@ This module provides the following class:
It also provides the following decorators:
-.. function:: abstractmethod(function)
+.. decorator:: abstractmethod(function)
A decorator indicating abstract methods.
@@ -157,6 +161,36 @@ It also provides the following decorators:
multiple-inheritance.
+.. decorator:: abstractclassmethod(function)
+
+ A subclass of the built-in :func:`classmethod`, indicating an abstract
+ classmethod. Otherwise it is similar to :func:`abstractmethod`.
+
+ Usage::
+
+ class C(metaclass=ABCMeta):
+ @abstractclassmethod
+ def my_abstract_classmethod(cls, ...):
+ ...
+
+ .. versionadded:: 3.2
+
+
+.. decorator:: abstractstaticmethod(function)
+
+ A subclass of the built-in :func:`staticmethod`, indicating an abstract
+ staticmethod. Otherwise it is similar to :func:`abstractmethod`.
+
+ Usage::
+
+ class C(metaclass=ABCMeta):
+ @abstractstaticmethod
+ def my_abstract_staticmethod(...):
+ ...
+
+ .. versionadded:: 3.2
+
+
.. function:: abstractproperty(fget=None, fset=None, fdel=None, doc=None)
A subclass of the built-in :func:`property`, indicating an abstract property.
diff --git a/Doc/library/aifc.rst b/Doc/library/aifc.rst
index 304437d9a2..999bad83ca 100644
--- a/Doc/library/aifc.rst
+++ b/Doc/library/aifc.rst
@@ -10,6 +10,10 @@
single: AIFF
single: AIFF-C
+**Source code:** :source:`Lib/aifc.py`
+
+--------------
+
This module provides support for reading and writing AIFF and AIFF-C files.
AIFF is Audio Interchange File Format, a format for storing digital audio
samples in a file. AIFF-C is a newer version of the format that includes the
diff --git a/Doc/library/allos.rst b/Doc/library/allos.rst
index f25c3b8751..bf91717447 100644
--- a/Doc/library/allos.rst
+++ b/Doc/library/allos.rst
@@ -15,9 +15,12 @@ but they are available on most other systems as well. Here's an overview:
os.rst
io.rst
time.rst
+ argparse.rst
optparse.rst
getopt.rst
logging.rst
+ logging.config.rst
+ logging.handlers.rst
getpass.rst
curses.rst
curses.ascii.rst
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
new file mode 100644
index 0000000000..61e1786b01
--- /dev/null
+++ b/Doc/library/argparse.rst
@@ -0,0 +1,1816 @@
+:mod:`argparse` --- Parser for command-line options, arguments and sub-commands
+===============================================================================
+
+.. module:: argparse
+ :synopsis: Command-line option and argument-parsing library.
+.. moduleauthor:: Steven Bethard <steven.bethard@gmail.com>
+.. sectionauthor:: Steven Bethard <steven.bethard@gmail.com>
+
+**Source code:** :source:`Lib/argparse.py`
+
+.. versionadded:: 3.2
+
+--------------
+
+The :mod:`argparse` module makes it easy to write user-friendly command-line
+interfaces. The program defines what arguments it requires, and :mod:`argparse`
+will figure out how to parse those out of :data:`sys.argv`. The :mod:`argparse`
+module also automatically generates help and usage messages and issues errors
+when users give the program invalid arguments.
+
+
+Example
+-------
+
+The following code is a Python program that takes a list of integers and
+produces either the sum or the max::
+
+ import argparse
+
+ parser = argparse.ArgumentParser(description='Process some integers.')
+ parser.add_argument('integers', metavar='N', type=int, nargs='+',
+ help='an integer for the accumulator')
+ parser.add_argument('--sum', dest='accumulate', action='store_const',
+ const=sum, default=max,
+ help='sum the integers (default: find the max)')
+
+ args = parser.parse_args()
+ print(args.accumulate(args.integers))
+
+Assuming the Python code above is saved into a file called ``prog.py``, it can
+be run at the command line and provides useful help messages::
+
+ $ prog.py -h
+ usage: prog.py [-h] [--sum] N [N ...]
+
+ Process some integers.
+
+ positional arguments:
+ N an integer for the accumulator
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --sum sum the integers (default: find the max)
+
+When run with the appropriate arguments, it prints either the sum or the max of
+the command-line integers::
+
+ $ prog.py 1 2 3 4
+ 4
+
+ $ prog.py 1 2 3 4 --sum
+ 10
+
+If invalid arguments are passed in, it will issue an error::
+
+ $ prog.py a b c
+ usage: prog.py [-h] [--sum] N [N ...]
+ prog.py: error: argument N: invalid int value: 'a'
+
+The following sections walk you through this example.
+
+
+Creating a parser
+^^^^^^^^^^^^^^^^^
+
+The first step in using the :mod:`argparse` is creating an
+:class:`ArgumentParser` object::
+
+ >>> parser = argparse.ArgumentParser(description='Process some integers.')
+
+The :class:`ArgumentParser` object will hold all the information necessary to
+parse the command line into Python data types.
+
+
+Adding arguments
+^^^^^^^^^^^^^^^^
+
+Filling an :class:`ArgumentParser` with information about program arguments is
+done by making calls to the :meth:`~ArgumentParser.add_argument` method.
+Generally, these calls tell the :class:`ArgumentParser` how to take the strings
+on the command line and turn them into objects. This information is stored and
+used when :meth:`~ArgumentParser.parse_args` is called. For example::
+
+ >>> parser.add_argument('integers', metavar='N', type=int, nargs='+',
+ ... help='an integer for the accumulator')
+ >>> parser.add_argument('--sum', dest='accumulate', action='store_const',
+ ... const=sum, default=max,
+ ... help='sum the integers (default: find the max)')
+
+Later, calling :meth:`~ArgumentParser.parse_args` will return an object with
+two attributes, ``integers`` and ``accumulate``. The ``integers`` attribute
+will be a list of one or more ints, and the ``accumulate`` attribute will be
+either the :func:`sum` function, if ``--sum`` was specified at the command line,
+or the :func:`max` function if it was not.
+
+
+Parsing arguments
+^^^^^^^^^^^^^^^^^
+
+:class:`ArgumentParser` parses args through the
+:meth:`~ArgumentParser.parse_args` method. This will inspect the command line,
+convert each arg to the appropriate type and then invoke the appropriate action.
+In most cases, this means a simple namespace object will be built up from
+attributes parsed out of the command line::
+
+ >>> parser.parse_args(['--sum', '7', '-1', '42'])
+ Namespace(accumulate=<built-in function sum>, integers=[7, -1, 42])
+
+In a script, :meth:`~ArgumentParser.parse_args` will typically be called with no
+arguments, and the :class:`ArgumentParser` will automatically determine the
+command-line args from :data:`sys.argv`.
+
+
+ArgumentParser objects
+----------------------
+
+.. class:: ArgumentParser([description], [epilog], [prog], [usage], [add_help], \
+ [argument_default], [parents], [prefix_chars], \
+ [conflict_handler], [formatter_class])
+
+ Create a new :class:`ArgumentParser` object. Each parameter has its own more
+ detailed description below, but in short they are:
+
+ * description_ - Text to display before the argument help.
+
+ * epilog_ - Text to display after the argument help.
+
+ * add_help_ - Add a -h/--help option to the parser. (default: ``True``)
+
+ * argument_default_ - Set the global default value for arguments.
+ (default: ``None``)
+
+ * parents_ - A list of :class:`ArgumentParser` objects whose arguments should
+ also be included.
+
+ * prefix_chars_ - The set of characters that prefix optional arguments.
+ (default: '-')
+
+ * fromfile_prefix_chars_ - The set of characters that prefix files from
+ which additional arguments should be read. (default: ``None``)
+
+ * formatter_class_ - A class for customizing the help output.
+
+ * conflict_handler_ - Usually unnecessary, defines strategy for resolving
+ conflicting optionals.
+
+ * prog_ - The name of the program (default:
+ :data:`sys.argv[0]`)
+
+ * usage_ - The string describing the program usage (default: generated)
+
+The following sections describe how each of these are used.
+
+
+description
+^^^^^^^^^^^
+
+Most calls to the :class:`ArgumentParser` constructor will use the
+``description=`` keyword argument. This argument gives a brief description of
+what the program does and how it works. In help messages, the description is
+displayed between the command-line usage string and the help messages for the
+various arguments::
+
+ >>> parser = argparse.ArgumentParser(description='A foo that bars')
+ >>> parser.print_help()
+ usage: argparse.py [-h]
+
+ A foo that bars
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+By default, the description will be line-wrapped so that it fits within the
+given space. To change this behavior, see the formatter_class_ argument.
+
+
+epilog
+^^^^^^
+
+Some programs like to display additional description of the program after the
+description of the arguments. Such text can be specified using the ``epilog=``
+argument to :class:`ArgumentParser`::
+
+ >>> parser = argparse.ArgumentParser(
+ ... description='A foo that bars',
+ ... epilog="And that's how you'd foo a bar")
+ >>> parser.print_help()
+ usage: argparse.py [-h]
+
+ A foo that bars
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+ And that's how you'd foo a bar
+
+As with the description_ argument, the ``epilog=`` text is by default
+line-wrapped, but this behavior can be adjusted with the formatter_class_
+argument to :class:`ArgumentParser`.
+
+
+add_help
+^^^^^^^^
+
+By default, ArgumentParser objects add an option which simply displays
+the parser's help message. For example, consider a file named
+``myprogram.py`` containing the following code::
+
+ import argparse
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--foo', help='foo help')
+ args = parser.parse_args()
+
+If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser
+help will be printed::
+
+ $ python myprogram.py --help
+ usage: myprogram.py [-h] [--foo FOO]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+
+Occasionally, it may be useful to disable the addition of this help option.
+This can be achieved by passing ``False`` as the ``add_help=`` argument to
+:class:`ArgumentParser`::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)
+ >>> parser.add_argument('--foo', help='foo help')
+ >>> parser.print_help()
+ usage: PROG [--foo FOO]
+
+ optional arguments:
+ --foo FOO foo help
+
+The help option is typically ``-h/--help``. The exception to this is
+if the ``prefix_chars=`` is specified and does not include ``'-'``, in
+which case ``-h`` and ``--help`` are not valid options. In
+this case, the first character in ``prefix_chars`` is used to prefix
+the help options::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')
+ >>> parser.print_help()
+ usage: PROG [+h]
+
+ optional arguments:
+ +h, ++help show this help message and exit
+
+
+prefix_chars
+^^^^^^^^^^^^
+
+Most command-line options will use ``'-'`` as the prefix, e.g. ``-f/--foo``.
+Parsers that need to support different or additional prefix
+characters, e.g. for options
+like ``+f`` or ``/foo``, may specify them using the ``prefix_chars=`` argument
+to the ArgumentParser constructor::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')
+ >>> parser.add_argument('+f')
+ >>> parser.add_argument('++bar')
+ >>> parser.parse_args('+f X ++bar Y'.split())
+ Namespace(bar='Y', f='X')
+
+The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of
+characters that does not include ``'-'`` will cause ``-f/--foo`` options to be
+disallowed.
+
+
+fromfile_prefix_chars
+^^^^^^^^^^^^^^^^^^^^^
+
+Sometimes, for example when dealing with a particularly long argument lists, it
+may make sense to keep the list of arguments in a file rather than typing it out
+at the command line. If the ``fromfile_prefix_chars=`` argument is given to the
+:class:`ArgumentParser` constructor, then arguments that start with any of the
+specified characters will be treated as files, and will be replaced by the
+arguments they contain. For example::
+
+ >>> with open('args.txt', 'w') as fp:
+ ... fp.write('-f\nbar')
+ >>> parser = argparse.ArgumentParser(fromfile_prefix_chars='@')
+ >>> parser.add_argument('-f')
+ >>> parser.parse_args(['-f', 'foo', '@args.txt'])
+ Namespace(f='bar')
+
+Arguments read from a file must by default be one per line (but see also
+:meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they
+were in the same place as the original file referencing argument on the command
+line. So in the example above, the expression ``['-f', 'foo', '@args.txt']``
+is considered equivalent to the expression ``['-f', 'foo', '-f', 'bar']``.
+
+The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that
+arguments will never be treated as file references.
+
+
+argument_default
+^^^^^^^^^^^^^^^^
+
+Generally, argument defaults are specified either by passing a default to
+:meth:`~ArgumentParser.add_argument` or by calling the
+:meth:`~ArgumentParser.set_defaults` methods with a specific set of name-value
+pairs. Sometimes however, it may be useful to specify a single parser-wide
+default for arguments. This can be accomplished by passing the
+``argument_default=`` keyword argument to :class:`ArgumentParser`. For example,
+to globally suppress attribute creation on :meth:`~ArgumentParser.parse_args`
+calls, we supply ``argument_default=SUPPRESS``::
+
+ >>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)
+ >>> parser.add_argument('--foo')
+ >>> parser.add_argument('bar', nargs='?')
+ >>> parser.parse_args(['--foo', '1', 'BAR'])
+ Namespace(bar='BAR', foo='1')
+ >>> parser.parse_args([])
+ Namespace()
+
+
+parents
+^^^^^^^
+
+Sometimes, several parsers share a common set of arguments. Rather than
+repeating the definitions of these arguments, a single parser with all the
+shared arguments and passed to ``parents=`` argument to :class:`ArgumentParser`
+can be used. The ``parents=`` argument takes a list of :class:`ArgumentParser`
+objects, collects all the positional and optional actions from them, and adds
+these actions to the :class:`ArgumentParser` object being constructed::
+
+ >>> parent_parser = argparse.ArgumentParser(add_help=False)
+ >>> parent_parser.add_argument('--parent', type=int)
+
+ >>> foo_parser = argparse.ArgumentParser(parents=[parent_parser])
+ >>> foo_parser.add_argument('foo')
+ >>> foo_parser.parse_args(['--parent', '2', 'XXX'])
+ Namespace(foo='XXX', parent=2)
+
+ >>> bar_parser = argparse.ArgumentParser(parents=[parent_parser])
+ >>> bar_parser.add_argument('--bar')
+ >>> bar_parser.parse_args(['--bar', 'YYY'])
+ Namespace(bar='YYY', parent=None)
+
+Note that most parent parsers will specify ``add_help=False``. Otherwise, the
+:class:`ArgumentParser` will see two ``-h/--help`` options (one in the parent
+and one in the child) and raise an error.
+
+.. note::
+ You must fully initialize the parsers before passing them via ``parents=``.
+ If you change the parent parsers after the child parser, those changes will
+ not be reflected in the child.
+
+
+formatter_class
+^^^^^^^^^^^^^^^
+
+:class:`ArgumentParser` objects allow the help formatting to be customized by
+specifying an alternate formatting class. Currently, there are three such
+classes:
+
+.. class:: RawDescriptionHelpFormatter
+ RawTextHelpFormatter
+ ArgumentDefaultsHelpFormatter
+
+The first two allow more control over how textual descriptions are displayed,
+while the last automatically adds information about argument default values.
+
+By default, :class:`ArgumentParser` objects line-wrap the description_ and
+epilog_ texts in command-line help messages::
+
+ >>> parser = argparse.ArgumentParser(
+ ... prog='PROG',
+ ... description='''this description
+ ... was indented weird
+ ... but that is okay''',
+ ... epilog='''
+ ... likewise for this epilog whose whitespace will
+ ... be cleaned up and whose words will be wrapped
+ ... across a couple lines''')
+ >>> parser.print_help()
+ usage: PROG [-h]
+
+ this description was indented weird but that is okay
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+ likewise for this epilog whose whitespace will be cleaned up and whose words
+ will be wrapped across a couple lines
+
+Passing :class:`~argparse.RawDescriptionHelpFormatter` as ``formatter_class=``
+indicates that description_ and epilog_ are already correctly formatted and
+should not be line-wrapped::
+
+ >>> parser = argparse.ArgumentParser(
+ ... prog='PROG',
+ ... formatter_class=argparse.RawDescriptionHelpFormatter,
+ ... description=textwrap.dedent('''\
+ ... Please do not mess up this text!
+ ... --------------------------------
+ ... I have indented it
+ ... exactly the way
+ ... I want it
+ ... '''))
+ >>> parser.print_help()
+ usage: PROG [-h]
+
+ Please do not mess up this text!
+ --------------------------------
+ I have indented it
+ exactly the way
+ I want it
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+:class:`RawTextHelpFormatter` maintains whitespace for all sorts of help text
+including argument descriptions.
+
+The other formatter class available, :class:`ArgumentDefaultsHelpFormatter`,
+will add information about the default value of each of the arguments::
+
+ >>> parser = argparse.ArgumentParser(
+ ... prog='PROG',
+ ... formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+ >>> parser.add_argument('--foo', type=int, default=42, help='FOO!')
+ >>> parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')
+ >>> parser.print_help()
+ usage: PROG [-h] [--foo FOO] [bar [bar ...]]
+
+ positional arguments:
+ bar BAR! (default: [1, 2, 3])
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO FOO! (default: 42)
+
+
+conflict_handler
+^^^^^^^^^^^^^^^^
+
+:class:`ArgumentParser` objects do not allow two actions with the same option
+string. By default, :class:`ArgumentParser` objects raises an exception if an
+attempt is made to create an argument with an option string that is already in
+use::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('-f', '--foo', help='old foo help')
+ >>> parser.add_argument('--foo', help='new foo help')
+ Traceback (most recent call last):
+ ..
+ ArgumentError: argument --foo: conflicting option string(s): --foo
+
+Sometimes (e.g. when using parents_) it may be useful to simply override any
+older arguments with the same option string. To get this behavior, the value
+``'resolve'`` can be supplied to the ``conflict_handler=`` argument of
+:class:`ArgumentParser`::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG', conflict_handler='resolve')
+ >>> parser.add_argument('-f', '--foo', help='old foo help')
+ >>> parser.add_argument('--foo', help='new foo help')
+ >>> parser.print_help()
+ usage: PROG [-h] [-f FOO] [--foo FOO]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -f FOO old foo help
+ --foo FOO new foo help
+
+Note that :class:`ArgumentParser` objects only remove an action if all of its
+option strings are overridden. So, in the example above, the old ``-f/--foo``
+action is retained as the ``-f`` action, because only the ``--foo`` option
+string was overridden.
+
+
+prog
+^^^^
+
+By default, :class:`ArgumentParser` objects uses ``sys.argv[0]`` to determine
+how to display the name of the program in help messages. This default is almost
+always desirable because it will make the help messages match how the program was
+invoked on the command line. For example, consider a file named
+``myprogram.py`` with the following code::
+
+ import argparse
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--foo', help='foo help')
+ args = parser.parse_args()
+
+The help for this program will display ``myprogram.py`` as the program name
+(regardless of where the program was invoked from)::
+
+ $ python myprogram.py --help
+ usage: myprogram.py [-h] [--foo FOO]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+ $ cd ..
+ $ python subdir\myprogram.py --help
+ usage: myprogram.py [-h] [--foo FOO]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+
+To change this default behavior, another value can be supplied using the
+``prog=`` argument to :class:`ArgumentParser`::
+
+ >>> parser = argparse.ArgumentParser(prog='myprogram')
+ >>> parser.print_help()
+ usage: myprogram [-h]
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+Note that the program name, whether determined from ``sys.argv[0]`` or from the
+``prog=`` argument, is available to help messages using the ``%(prog)s`` format
+specifier.
+
+::
+
+ >>> parser = argparse.ArgumentParser(prog='myprogram')
+ >>> parser.add_argument('--foo', help='foo of the %(prog)s program')
+ >>> parser.print_help()
+ usage: myprogram [-h] [--foo FOO]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo of the myprogram program
+
+
+usage
+^^^^^
+
+By default, :class:`ArgumentParser` calculates the usage message from the
+arguments it contains::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('--foo', nargs='?', help='foo help')
+ >>> parser.add_argument('bar', nargs='+', help='bar help')
+ >>> parser.print_help()
+ usage: PROG [-h] [--foo [FOO]] bar [bar ...]
+
+ positional arguments:
+ bar bar help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo [FOO] foo help
+
+The default message can be overridden with the ``usage=`` keyword argument::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s [options]')
+ >>> parser.add_argument('--foo', nargs='?', help='foo help')
+ >>> parser.add_argument('bar', nargs='+', help='bar help')
+ >>> parser.print_help()
+ usage: PROG [options]
+
+ positional arguments:
+ bar bar help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo [FOO] foo help
+
+The ``%(prog)s`` format specifier is available to fill in the program name in
+your usage messages.
+
+
+The add_argument() method
+-------------------------
+
+.. method:: ArgumentParser.add_argument(name or flags..., [action], [nargs], \
+ [const], [default], [type], [choices], [required], \
+ [help], [metavar], [dest])
+
+ Define how a single command-line argument should be parsed. Each parameter
+ has its own more detailed description below, but in short they are:
+
+ * `name or flags`_ - Either a name or a list of option strings, e.g. ``foo``
+ or ``-f, --foo``.
+
+ * action_ - The basic type of action to be taken when this argument is
+ encountered at the command line.
+
+ * nargs_ - The number of command-line arguments that should be consumed.
+
+ * const_ - A constant value required by some action_ and nargs_ selections.
+
+ * default_ - The value produced if the argument is absent from the
+ command line.
+
+ * type_ - The type to which the command-line argument should be converted.
+
+ * choices_ - A container of the allowable values for the argument.
+
+ * required_ - Whether or not the command-line option may be omitted
+ (optionals only).
+
+ * help_ - A brief description of what the argument does.
+
+ * metavar_ - A name for the argument in usage messages.
+
+ * dest_ - The name of the attribute to be added to the object returned by
+ :meth:`parse_args`.
+
+The following sections describe how each of these are used.
+
+
+name or flags
+^^^^^^^^^^^^^
+
+The :meth:`~ArgumentParser.add_argument` method must know whether an optional
+argument, like ``-f`` or ``--foo``, or a positional argument, like a list of
+filenames, is expected. The first arguments passed to
+:meth:`~ArgumentParser.add_argument` must therefore be either a series of
+flags, or a simple argument name. For example, an optional argument could
+be created like::
+
+ >>> parser.add_argument('-f', '--foo')
+
+while a positional argument could be created like::
+
+ >>> parser.add_argument('bar')
+
+When :meth:`~ArgumentParser.parse_args` is called, optional arguments will be
+identified by the ``-`` prefix, and the remaining arguments will be assumed to
+be positional::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('-f', '--foo')
+ >>> parser.add_argument('bar')
+ >>> parser.parse_args(['BAR'])
+ Namespace(bar='BAR', foo=None)
+ >>> parser.parse_args(['BAR', '--foo', 'FOO'])
+ Namespace(bar='BAR', foo='FOO')
+ >>> parser.parse_args(['--foo', 'FOO'])
+ usage: PROG [-h] [-f FOO] bar
+ PROG: error: too few arguments
+
+
+action
+^^^^^^
+
+:class:`ArgumentParser` objects associate command-line args with actions. These
+actions can do just about anything with the command-line args associated with
+them, though most actions simply add an attribute to the object returned by
+:meth:`~ArgumentParser.parse_args`. The ``action`` keyword argument specifies
+how the command-line args should be handled. The supported actions are:
+
+* ``'store'`` - This just stores the argument's value. This is the default
+ action. For example::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo')
+ >>> parser.parse_args('--foo 1'.split())
+ Namespace(foo='1')
+
+* ``'store_const'`` - This stores the value specified by the const_ keyword
+ argument. (Note that the const_ keyword argument defaults to the rather
+ unhelpful ``None``.) The ``'store_const'`` action is most commonly used with
+ optional arguments that specify some sort of flag. For example::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', action='store_const', const=42)
+ >>> parser.parse_args('--foo'.split())
+ Namespace(foo=42)
+
+* ``'store_true'`` and ``'store_false'`` - These store the values ``True`` and
+ ``False`` respectively. These are special cases of ``'store_const'``. For
+ example::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', action='store_true')
+ >>> parser.add_argument('--bar', action='store_false')
+ >>> parser.parse_args('--foo --bar'.split())
+ Namespace(bar=False, foo=True)
+
+* ``'append'`` - This stores a list, and appends each argument value to the
+ list. This is useful to allow an option to be specified multiple times.
+ Example usage::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', action='append')
+ >>> parser.parse_args('--foo 1 --foo 2'.split())
+ Namespace(foo=['1', '2'])
+
+* ``'append_const'`` - This stores a list, and appends the value specified by
+ the const_ keyword argument to the list. (Note that the const_ keyword
+ argument defaults to ``None``.) The ``'append_const'`` action is typically
+ useful when multiple arguments need to store constants to the same list. For
+ example::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--str', dest='types', action='append_const', const=str)
+ >>> parser.add_argument('--int', dest='types', action='append_const', const=int)
+ >>> parser.parse_args('--str --int'.split())
+ Namespace(types=[<type 'str'>, <type 'int'>])
+
+* ``'version'`` - This expects a ``version=`` keyword argument in the
+ :meth:`~ArgumentParser.add_argument` call, and prints version information
+ and exits when invoked.
+
+ >>> import argparse
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('--version', action='version', version='%(prog)s 2.0')
+ >>> parser.parse_args(['--version'])
+ PROG 2.0
+
+You can also specify an arbitrary action by passing an object that implements
+the Action API. The easiest way to do this is to extend
+:class:`argparse.Action`, supplying an appropriate ``__call__`` method. The
+``__call__`` method should accept four parameters:
+
+* ``parser`` - The ArgumentParser object which contains this action.
+
+* ``namespace`` - The namespace object that will be returned by
+ :meth:`~ArgumentParser.parse_args`. Most actions add an attribute to this
+ object.
+
+* ``values`` - The associated command-line args, with any type-conversions
+ applied. (Type-conversions are specified with the type_ keyword argument to
+ :meth:`~ArgumentParser.add_argument`.
+
+* ``option_string`` - The option string that was used to invoke this action.
+ The ``option_string`` argument is optional, and will be absent if the action
+ is associated with a positional argument.
+
+An example of a custom action::
+
+ >>> class FooAction(argparse.Action):
+ ... def __call__(self, parser, namespace, values, option_string=None):
+ ... print('%r %r %r' % (namespace, values, option_string))
+ ... setattr(namespace, self.dest, values)
+ ...
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', action=FooAction)
+ >>> parser.add_argument('bar', action=FooAction)
+ >>> args = parser.parse_args('1 --foo 2'.split())
+ Namespace(bar=None, foo=None) '1' None
+ Namespace(bar='1', foo=None) '2' '--foo'
+ >>> args
+ Namespace(bar='1', foo='2')
+
+
+nargs
+^^^^^
+
+ArgumentParser objects usually associate a single command-line argument with a
+single action to be taken. The ``nargs`` keyword argument associates a
+different number of command-line arguments with a single action. The supported
+values are:
+
+* N (an integer). N args from the command line will be gathered together into a
+ list. For example::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', nargs=2)
+ >>> parser.add_argument('bar', nargs=1)
+ >>> parser.parse_args('c --foo a b'.split())
+ Namespace(bar=['c'], foo=['a', 'b'])
+
+ Note that ``nargs=1`` produces a list of one item. This is different from
+ the default, in which the item is produced by itself.
+
+* ``'?'``. One arg will be consumed from the command line if possible, and
+ produced as a single item. If no command-line arg is present, the value from
+ default_ will be produced. Note that for optional arguments, there is an
+ additional case - the option string is present but not followed by a
+ command-line arg. In this case the value from const_ will be produced. Some
+ examples to illustrate this::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', nargs='?', const='c', default='d')
+ >>> parser.add_argument('bar', nargs='?', default='d')
+ >>> parser.parse_args('XX --foo YY'.split())
+ Namespace(bar='XX', foo='YY')
+ >>> parser.parse_args('XX --foo'.split())
+ Namespace(bar='XX', foo='c')
+ >>> parser.parse_args(''.split())
+ Namespace(bar='d', foo='d')
+
+ One of the more common uses of ``nargs='?'`` is to allow optional input and
+ output files::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),
+ ... default=sys.stdin)
+ >>> parser.add_argument('outfile', nargs='?', type=argparse.FileType('w'),
+ ... default=sys.stdout)
+ >>> parser.parse_args(['input.txt', 'output.txt'])
+ Namespace(infile=<_io.TextIOWrapper name='input.txt' encoding='UTF-8'>,
+ outfile=<_io.TextIOWrapper name='output.txt' encoding='UTF-8'>)
+ >>> parser.parse_args([])
+ Namespace(infile=<_io.TextIOWrapper name='<stdin>' encoding='UTF-8'>,
+ outfile=<_io.TextIOWrapper name='<stdout>' encoding='UTF-8'>)
+
+* ``'*'``. All command-line args present are gathered into a list. Note that
+ it generally doesn't make much sense to have more than one positional argument
+ with ``nargs='*'``, but multiple optional arguments with ``nargs='*'`` is
+ possible. For example::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', nargs='*')
+ >>> parser.add_argument('--bar', nargs='*')
+ >>> parser.add_argument('baz', nargs='*')
+ >>> parser.parse_args('a b --foo x y --bar 1 2'.split())
+ Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])
+
+* ``'+'``. Just like ``'*'``, all command-line args present are gathered into a
+ list. Additionally, an error message will be generated if there wasn't at
+ least one command-line arg present. For example::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('foo', nargs='+')
+ >>> parser.parse_args('a b'.split())
+ Namespace(foo=['a', 'b'])
+ >>> parser.parse_args(''.split())
+ usage: PROG [-h] foo [foo ...]
+ PROG: error: too few arguments
+
+If the ``nargs`` keyword argument is not provided, the number of args consumed
+is determined by the action_. Generally this means a single command-line arg
+will be consumed and a single item (not a list) will be produced.
+
+
+const
+^^^^^
+
+The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to hold
+constant values that are not read from the command line but are required for
+the various :class:`ArgumentParser` actions. The two most common uses of it are:
+
+* When :meth:`~ArgumentParser.add_argument` is called with
+ ``action='store_const'`` or ``action='append_const'``. These actions add the
+ ``const`` value to one of the attributes of the object returned by :meth:`~ArgumentParser.parse_args`. See the action_ description for examples.
+
+* When :meth:`~ArgumentParser.add_argument` is called with option strings
+ (like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional
+ argument that can be followed by zero or one command-line args.
+ When parsing the command line, if the option string is encountered with no
+ command-line arg following it, the value of ``const`` will be assumed instead.
+ See the nargs_ description for examples.
+
+The ``const`` keyword argument defaults to ``None``.
+
+
+default
+^^^^^^^
+
+All optional arguments and some positional arguments may be omitted at the
+command line. The ``default`` keyword argument of
+:meth:`~ArgumentParser.add_argument`, whose value defaults to ``None``,
+specifies what value should be used if the command-line arg is not present.
+For optional arguments, the ``default`` value is used when the option string
+was not present at the command line::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', default=42)
+ >>> parser.parse_args('--foo 2'.split())
+ Namespace(foo='2')
+ >>> parser.parse_args(''.split())
+ Namespace(foo=42)
+
+For positional arguments with nargs_ ``='?'`` or ``'*'``, the ``default`` value
+is used when no command-line arg was present::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('foo', nargs='?', default=42)
+ >>> parser.parse_args('a'.split())
+ Namespace(foo='a')
+ >>> parser.parse_args(''.split())
+ Namespace(foo=42)
+
+
+Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if the
+command-line argument was not present.::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', default=argparse.SUPPRESS)
+ >>> parser.parse_args([])
+ Namespace()
+ >>> parser.parse_args(['--foo', '1'])
+ Namespace(foo='1')
+
+
+type
+^^^^
+
+By default, :class:`ArgumentParser` objects read command-line args in as simple
+strings. However, quite often the command-line string should instead be
+interpreted as another type, like a :class:`float` or :class:`int`. The
+``type`` keyword argument of :meth:`~ArgumentParser.add_argument` allows any
+necessary type-checking and type-conversions to be performed. Common built-in
+types and functions can be used directly as the value of the ``type`` argument::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('foo', type=int)
+ >>> parser.add_argument('bar', type=open)
+ >>> parser.parse_args('2 temp.txt'.split())
+ Namespace(bar=<_io.TextIOWrapper name='temp.txt' encoding='UTF-8'>, foo=2)
+
+To ease the use of various types of files, the argparse module provides the
+factory FileType which takes the ``mode=`` and ``bufsize=`` arguments of the
+:func:`open` function. For example, ``FileType('w')`` can be used to create a
+writable file::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('bar', type=argparse.FileType('w'))
+ >>> parser.parse_args(['out.txt'])
+ Namespace(bar=<_io.TextIOWrapper name='out.txt' encoding='UTF-8'>)
+
+``type=`` can take any callable that takes a single string argument and returns
+the type-converted value::
+
+ >>> def perfect_square(string):
+ ... value = int(string)
+ ... sqrt = math.sqrt(value)
+ ... if sqrt != int(sqrt):
+ ... msg = "%r is not a perfect square" % string
+ ... raise argparse.ArgumentTypeError(msg)
+ ... return value
+ ...
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('foo', type=perfect_square)
+ >>> parser.parse_args('9'.split())
+ Namespace(foo=9)
+ >>> parser.parse_args('7'.split())
+ usage: PROG [-h] foo
+ PROG: error: argument foo: '7' is not a perfect square
+
+The choices_ keyword argument may be more convenient for type checkers that
+simply check against a range of values::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('foo', type=int, choices=range(5, 10))
+ >>> parser.parse_args('7'.split())
+ Namespace(foo=7)
+ >>> parser.parse_args('11'.split())
+ usage: PROG [-h] {5,6,7,8,9}
+ PROG: error: argument foo: invalid choice: 11 (choose from 5, 6, 7, 8, 9)
+
+See the choices_ section for more details.
+
+
+choices
+^^^^^^^
+
+Some command-line args should be selected from a restricted set of values.
+These can be handled by passing a container object as the ``choices`` keyword
+argument to :meth:`~ArgumentParser.add_argument`. When the command line is
+parsed, arg values will be checked, and an error message will be displayed if
+the arg was not one of the acceptable values::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('foo', choices='abc')
+ >>> parser.parse_args('c'.split())
+ Namespace(foo='c')
+ >>> parser.parse_args('X'.split())
+ usage: PROG [-h] {a,b,c}
+ PROG: error: argument foo: invalid choice: 'X' (choose from 'a', 'b', 'c')
+
+Note that inclusion in the ``choices`` container is checked after any type_
+conversions have been performed, so the type of the objects in the ``choices``
+container should match the type_ specified::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('foo', type=complex, choices=[1, 1j])
+ >>> parser.parse_args('1j'.split())
+ Namespace(foo=1j)
+ >>> parser.parse_args('-- -4'.split())
+ usage: PROG [-h] {1,1j}
+ PROG: error: argument foo: invalid choice: (-4+0j) (choose from 1, 1j)
+
+Any object that supports the ``in`` operator can be passed as the ``choices``
+value, so :class:`dict` objects, :class:`set` objects, custom containers,
+etc. are all supported.
+
+
+required
+^^^^^^^^
+
+In general, the :mod:`argparse` module assumes that flags like ``-f`` and ``--bar``
+indicate *optional* arguments, which can always be omitted at the command line.
+To make an option *required*, ``True`` can be specified for the ``required=``
+keyword argument to :meth:`~ArgumentParser.add_argument`::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', required=True)
+ >>> parser.parse_args(['--foo', 'BAR'])
+ Namespace(foo='BAR')
+ >>> parser.parse_args([])
+ usage: argparse.py [-h] [--foo FOO]
+ argparse.py: error: option --foo is required
+
+As the example shows, if an option is marked as ``required``,
+:meth:`~ArgumentParser.parse_args` will report an error if that option is not
+present at the command line.
+
+.. note::
+
+ Required options are generally considered bad form because users expect
+ *options* to be *optional*, and thus they should be avoided when possible.
+
+
+help
+^^^^
+
+The ``help`` value is a string containing a brief description of the argument.
+When a user requests help (usually by using ``-h`` or ``--help`` at the
+command line), these ``help`` descriptions will be displayed with each
+argument::
+
+ >>> parser = argparse.ArgumentParser(prog='frobble')
+ >>> parser.add_argument('--foo', action='store_true',
+ ... help='foo the bars before frobbling')
+ >>> parser.add_argument('bar', nargs='+',
+ ... help='one of the bars to be frobbled')
+ >>> parser.parse_args('-h'.split())
+ usage: frobble [-h] [--foo] bar [bar ...]
+
+ positional arguments:
+ bar one of the bars to be frobbled
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo foo the bars before frobbling
+
+The ``help`` strings can include various format specifiers to avoid repetition
+of things like the program name or the argument default_. The available
+specifiers include the program name, ``%(prog)s`` and most keyword arguments to
+:meth:`~ArgumentParser.add_argument`, e.g. ``%(default)s``, ``%(type)s``, etc.::
+
+ >>> parser = argparse.ArgumentParser(prog='frobble')
+ >>> parser.add_argument('bar', nargs='?', type=int, default=42,
+ ... help='the bar to %(prog)s (default: %(default)s)')
+ >>> parser.print_help()
+ usage: frobble [-h] [bar]
+
+ positional arguments:
+ bar the bar to frobble (default: 42)
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+
+metavar
+^^^^^^^
+
+When :class:`ArgumentParser` generates help messages, it need some way to refer
+to each expected argument. By default, ArgumentParser objects use the dest_
+value as the "name" of each object. By default, for positional argument
+actions, the dest_ value is used directly, and for optional argument actions,
+the dest_ value is uppercased. So, a single positional argument with
+``dest='bar'`` will that argument will be referred to as ``bar``. A single
+optional argument ``--foo`` that should be followed by a single command-line arg
+will be referred to as ``FOO``. An example::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo')
+ >>> parser.add_argument('bar')
+ >>> parser.parse_args('X --foo Y'.split())
+ Namespace(bar='X', foo='Y')
+ >>> parser.print_help()
+ usage: [-h] [--foo FOO] bar
+
+ positional arguments:
+ bar
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO
+
+An alternative name can be specified with ``metavar``::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', metavar='YYY')
+ >>> parser.add_argument('bar', metavar='XXX')
+ >>> parser.parse_args('X --foo Y'.split())
+ Namespace(bar='X', foo='Y')
+ >>> parser.print_help()
+ usage: [-h] [--foo YYY] XXX
+
+ positional arguments:
+ XXX
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo YYY
+
+Note that ``metavar`` only changes the *displayed* name - the name of the
+attribute on the :meth:`~ArgumentParser.parse_args` object is still determined
+by the dest_ value.
+
+Different values of ``nargs`` may cause the metavar to be used multiple times.
+Providing a tuple to ``metavar`` specifies a different display for each of the
+arguments::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('-x', nargs=2)
+ >>> parser.add_argument('--foo', nargs=2, metavar=('bar', 'baz'))
+ >>> parser.print_help()
+ usage: PROG [-h] [-x X X] [--foo bar baz]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X X
+ --foo bar baz
+
+
+dest
+^^^^
+
+Most :class:`ArgumentParser` actions add some value as an attribute of the
+object returned by :meth:`~ArgumentParser.parse_args`. The name of this
+attribute is determined by the ``dest`` keyword argument of
+:meth:`~ArgumentParser.add_argument`. For positional argument actions,
+``dest`` is normally supplied as the first argument to
+:meth:`~ArgumentParser.add_argument`::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('bar')
+ >>> parser.parse_args('XXX'.split())
+ Namespace(bar='XXX')
+
+For optional argument actions, the value of ``dest`` is normally inferred from
+the option strings. :class:`ArgumentParser` generates the value of ``dest`` by
+taking the first long option string and stripping away the initial ``'--'``
+string. If no long option strings were supplied, ``dest`` will be derived from
+the first short option string by stripping the initial ``'-'`` character. Any
+internal ``'-'`` characters will be converted to ``'_'`` characters to make sure
+the string is a valid attribute name. The examples below illustrate this
+behavior::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('-f', '--foo-bar', '--foo')
+ >>> parser.add_argument('-x', '-y')
+ >>> parser.parse_args('-f 1 -x 2'.split())
+ Namespace(foo_bar='1', x='2')
+ >>> parser.parse_args('--foo 1 -y 2'.split())
+ Namespace(foo_bar='1', x='2')
+
+``dest`` allows a custom attribute name to be provided::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', dest='bar')
+ >>> parser.parse_args('--foo XXX'.split())
+ Namespace(bar='XXX')
+
+
+The parse_args() method
+-----------------------
+
+.. method:: ArgumentParser.parse_args(args=None, namespace=None)
+
+ Convert argument strings to objects and assign them as attributes of the
+ namespace. Return the populated namespace.
+
+ Previous calls to :meth:`add_argument` determine exactly what objects are
+ created and how they are assigned. See the documentation for
+ :meth:`add_argument` for details.
+
+ By default, the arg strings are taken from :data:`sys.argv`, and a new empty
+ :class:`Namespace` object is created for the attributes.
+
+
+Option value syntax
+^^^^^^^^^^^^^^^^^^^
+
+The :meth:`~ArgumentParser.parse_args` method supports several ways of
+specifying the value of an option (if it takes one). In the simplest case, the
+option and its value are passed as two separate arguments::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('-x')
+ >>> parser.add_argument('--foo')
+ >>> parser.parse_args('-x X'.split())
+ Namespace(foo=None, x='X')
+ >>> parser.parse_args('--foo FOO'.split())
+ Namespace(foo='FOO', x=None)
+
+For long options (options with names longer than a single character), the option
+and value can also be passed as a single command-line argument, using ``=`` to
+separate them::
+
+ >>> parser.parse_args('--foo=FOO'.split())
+ Namespace(foo='FOO', x=None)
+
+For short options (options only one character long), the option and its value
+can be concatenated::
+
+ >>> parser.parse_args('-xX'.split())
+ Namespace(foo=None, x='X')
+
+Several short options can be joined together, using only a single ``-`` prefix,
+as long as only the last option (or none of them) requires a value::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('-x', action='store_true')
+ >>> parser.add_argument('-y', action='store_true')
+ >>> parser.add_argument('-z')
+ >>> parser.parse_args('-xyzZ'.split())
+ Namespace(x=True, y=True, z='Z')
+
+
+Invalid arguments
+^^^^^^^^^^^^^^^^^
+
+While parsing the command line, :meth:`~ArgumentParser.parse_args` checks for a
+variety of errors, including ambiguous options, invalid types, invalid options,
+wrong number of positional arguments, etc. When it encounters such an error,
+it exits and prints the error along with a usage message::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('--foo', type=int)
+ >>> parser.add_argument('bar', nargs='?')
+
+ >>> # invalid type
+ >>> parser.parse_args(['--foo', 'spam'])
+ usage: PROG [-h] [--foo FOO] [bar]
+ PROG: error: argument --foo: invalid int value: 'spam'
+
+ >>> # invalid option
+ >>> parser.parse_args(['--bar'])
+ usage: PROG [-h] [--foo FOO] [bar]
+ PROG: error: no such option: --bar
+
+ >>> # wrong number of arguments
+ >>> parser.parse_args(['spam', 'badger'])
+ usage: PROG [-h] [--foo FOO] [bar]
+ PROG: error: extra arguments found: badger
+
+
+Arguments containing ``"-"``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The :meth:`~ArgumentParser.parse_args` method attempts to give errors whenever
+the user has clearly made a mistake, but some situations are inherently
+ambiguous. For example, the command-line arg ``'-1'`` could either be an
+attempt to specify an option or an attempt to provide a positional argument.
+The :meth:`~ArgumentParser.parse_args` method is cautious here: positional
+arguments may only begin with ``'-'`` if they look like negative numbers and
+there are no options in the parser that look like negative numbers::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('-x')
+ >>> parser.add_argument('foo', nargs='?')
+
+ >>> # no negative number options, so -1 is a positional argument
+ >>> parser.parse_args(['-x', '-1'])
+ Namespace(foo=None, x='-1')
+
+ >>> # no negative number options, so -1 and -5 are positional arguments
+ >>> parser.parse_args(['-x', '-1', '-5'])
+ Namespace(foo='-5', x='-1')
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('-1', dest='one')
+ >>> parser.add_argument('foo', nargs='?')
+
+ >>> # negative number options present, so -1 is an option
+ >>> parser.parse_args(['-1', 'X'])
+ Namespace(foo=None, one='X')
+
+ >>> # negative number options present, so -2 is an option
+ >>> parser.parse_args(['-2'])
+ usage: PROG [-h] [-1 ONE] [foo]
+ PROG: error: no such option: -2
+
+ >>> # negative number options present, so both -1s are options
+ >>> parser.parse_args(['-1', '-1'])
+ usage: PROG [-h] [-1 ONE] [foo]
+ PROG: error: argument -1: expected one argument
+
+If you have positional arguments that must begin with ``'-'`` and don't look
+like negative numbers, you can insert the pseudo-argument ``'--'`` which tells
+:meth:`~ArgumentParser.parse_args` that everything after that is a positional
+argument::
+
+ >>> parser.parse_args(['--', '-f'])
+ Namespace(foo='-f', one=None)
+
+
+Argument abbreviations
+^^^^^^^^^^^^^^^^^^^^^^
+
+The :meth:`~ArgumentParser.parse_args` method allows long options to be
+abbreviated if the abbreviation is unambiguous::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('-bacon')
+ >>> parser.add_argument('-badger')
+ >>> parser.parse_args('-bac MMM'.split())
+ Namespace(bacon='MMM', badger=None)
+ >>> parser.parse_args('-bad WOOD'.split())
+ Namespace(bacon=None, badger='WOOD')
+ >>> parser.parse_args('-ba BA'.split())
+ usage: PROG [-h] [-bacon BACON] [-badger BADGER]
+ PROG: error: ambiguous option: -ba could match -badger, -bacon
+
+An error is produced for arguments that could produce more than one options.
+
+
+Beyond ``sys.argv``
+^^^^^^^^^^^^^^^^^^^
+
+Sometimes it may be useful to have an ArgumentParser parse args other than those
+of :data:`sys.argv`. This can be accomplished by passing a list of strings to
+:meth:`~ArgumentParser.parse_args`. This is useful for testing at the
+interactive prompt::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument(
+ ... 'integers', metavar='int', type=int, choices=range(10),
+ ... nargs='+', help='an integer in the range 0..9')
+ >>> parser.add_argument(
+ ... '--sum', dest='accumulate', action='store_const', const=sum,
+ ... default=max, help='sum the integers (default: find the max)')
+ >>> parser.parse_args(['1', '2', '3', '4'])
+ Namespace(accumulate=<built-in function max>, integers=[1, 2, 3, 4])
+ >>> parser.parse_args('1 2 3 4 --sum'.split())
+ Namespace(accumulate=<built-in function sum>, integers=[1, 2, 3, 4])
+
+
+The Namespace object
+^^^^^^^^^^^^^^^^^^^^
+
+By default, :meth:`~ArgumentParser.parse_args` will return a new object of type
+:class:`Namespace` where the necessary attributes have been set. This class is
+deliberately simple, just an :class:`object` subclass with a readable string
+representation. If you prefer to have dict-like view of the attributes, you
+can use the standard Python idiom via :func:`vars`::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo')
+ >>> args = parser.parse_args(['--foo', 'BAR'])
+ >>> vars(args)
+ {'foo': 'BAR'}
+
+It may also be useful to have an :class:`ArgumentParser` assign attributes to an
+already existing object, rather than a new :class:`Namespace` object. This can
+be achieved by specifying the ``namespace=`` keyword argument::
+
+ >>> class C:
+ ... pass
+ ...
+ >>> c = C()
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo')
+ >>> parser.parse_args(args=['--foo', 'BAR'], namespace=c)
+ >>> c.foo
+ 'BAR'
+
+
+Other utilities
+---------------
+
+Sub-commands
+^^^^^^^^^^^^
+
+.. method:: ArgumentParser.add_subparsers()
+
+ Many programs split up their functionality into a number of sub-commands,
+ for example, the ``svn`` program can invoke sub-commands like ``svn
+ checkout``, ``svn update``, and ``svn commit``. Splitting up functionality
+ this way can be a particularly good idea when a program performs several
+ different functions which require different kinds of command-line arguments.
+ :class:`ArgumentParser` supports the creation of such sub-commands with the
+ :meth:`add_subparsers` method. The :meth:`add_subparsers` method is normally
+ called with no arguments and returns an special action object. This object
+ has a single method, :meth:`~ArgumentParser.add_parser`, which takes a
+ command name and any :class:`ArgumentParser` constructor arguments, and
+ returns an :class:`ArgumentParser` object that can be modified as usual.
+
+ Some example usage::
+
+ >>> # create the top-level parser
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> parser.add_argument('--foo', action='store_true', help='foo help')
+ >>> subparsers = parser.add_subparsers(help='sub-command help')
+ >>>
+ >>> # create the parser for the "a" command
+ >>> parser_a = subparsers.add_parser('a', help='a help')
+ >>> parser_a.add_argument('bar', type=int, help='bar help')
+ >>>
+ >>> # create the parser for the "b" command
+ >>> parser_b = subparsers.add_parser('b', help='b help')
+ >>> parser_b.add_argument('--baz', choices='XYZ', help='baz help')
+ >>>
+ >>> # parse some arg lists
+ >>> parser.parse_args(['a', '12'])
+ Namespace(bar=12, foo=False)
+ >>> parser.parse_args(['--foo', 'b', '--baz', 'Z'])
+ Namespace(baz='Z', foo=True)
+
+ Note that the object returned by :meth:`parse_args` will only contain
+ attributes for the main parser and the subparser that was selected by the
+ command line (and not any other subparsers). So in the example above, when
+ the ``"a"`` command is specified, only the ``foo`` and ``bar`` attributes are
+ present, and when the ``"b"`` command is specified, only the ``foo`` and
+ ``baz`` attributes are present.
+
+ Similarly, when a help message is requested from a subparser, only the help
+ for that particular parser will be printed. The help message will not
+ include parent parser or sibling parser messages. (A help message for each
+ subparser command, however, can be given by supplying the ``help=`` argument
+ to :meth:`add_parser` as above.)
+
+ ::
+
+ >>> parser.parse_args(['--help'])
+ usage: PROG [-h] [--foo] {a,b} ...
+
+ positional arguments:
+ {a,b} sub-command help
+ a a help
+ b b help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo foo help
+
+ >>> parser.parse_args(['a', '--help'])
+ usage: PROG a [-h] bar
+
+ positional arguments:
+ bar bar help
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+ >>> parser.parse_args(['b', '--help'])
+ usage: PROG b [-h] [--baz {X,Y,Z}]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --baz {X,Y,Z} baz help
+
+ The :meth:`add_subparsers` method also supports ``title`` and ``description``
+ keyword arguments. When either is present, the subparser's commands will
+ appear in their own group in the help output. For example::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> subparsers = parser.add_subparsers(title='subcommands',
+ ... description='valid subcommands',
+ ... help='additional help')
+ >>> subparsers.add_parser('foo')
+ >>> subparsers.add_parser('bar')
+ >>> parser.parse_args(['-h'])
+ usage: [-h] {foo,bar} ...
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+ subcommands:
+ valid subcommands
+
+ {foo,bar} additional help
+
+ Furthermore, ``add_parser`` supports an additional ``aliases`` argument,
+ which allows multiple strings to refer to the same subparser. This example,
+ like ``svn``, aliases ``co`` as a shorthand for ``checkout``::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> subparsers = parser.add_subparsers()
+ >>> checkout = subparsers.add_parser('checkout', aliases=['co'])
+ >>> checkout.add_argument('foo')
+ >>> parser.parse_args(['co', 'bar'])
+ Namespace(foo='bar')
+
+ One particularly effective way of handling sub-commands is to combine the use
+ of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so
+ that each subparser knows which Python function it should execute. For
+ example::
+
+ >>> # sub-command functions
+ >>> def foo(args):
+ ... print(args.x * args.y)
+ ...
+ >>> def bar(args):
+ ... print('((%s))' % args.z)
+ ...
+ >>> # create the top-level parser
+ >>> parser = argparse.ArgumentParser()
+ >>> subparsers = parser.add_subparsers()
+ >>>
+ >>> # create the parser for the "foo" command
+ >>> parser_foo = subparsers.add_parser('foo')
+ >>> parser_foo.add_argument('-x', type=int, default=1)
+ >>> parser_foo.add_argument('y', type=float)
+ >>> parser_foo.set_defaults(func=foo)
+ >>>
+ >>> # create the parser for the "bar" command
+ >>> parser_bar = subparsers.add_parser('bar')
+ >>> parser_bar.add_argument('z')
+ >>> parser_bar.set_defaults(func=bar)
+ >>>
+ >>> # parse the args and call whatever function was selected
+ >>> args = parser.parse_args('foo 1 -x 2'.split())
+ >>> args.func(args)
+ 2.0
+ >>>
+ >>> # parse the args and call whatever function was selected
+ >>> args = parser.parse_args('bar XYZYX'.split())
+ >>> args.func(args)
+ ((XYZYX))
+
+ This way, you can let :meth:`parse_args` do the job of calling the
+ appropriate function after argument parsing is complete. Associating
+ functions with actions like this is typically the easiest way to handle the
+ different actions for each of your subparsers. However, if it is necessary
+ to check the name of the subparser that was invoked, the ``dest`` keyword
+ argument to the :meth:`add_subparsers` call will work::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> subparsers = parser.add_subparsers(dest='subparser_name')
+ >>> subparser1 = subparsers.add_parser('1')
+ >>> subparser1.add_argument('-x')
+ >>> subparser2 = subparsers.add_parser('2')
+ >>> subparser2.add_argument('y')
+ >>> parser.parse_args(['2', 'frobble'])
+ Namespace(subparser_name='2', y='frobble')
+
+
+FileType objects
+^^^^^^^^^^^^^^^^
+
+.. class:: FileType(mode='r', bufsize=None)
+
+ The :class:`FileType` factory creates objects that can be passed to the type
+ argument of :meth:`ArgumentParser.add_argument`. Arguments that have
+ :class:`FileType` objects as their type will open command-line args as files
+ with the requested modes and buffer sizes:
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--output', type=argparse.FileType('wb', 0))
+ >>> parser.parse_args(['--output', 'out'])
+ Namespace(output=<_io.BufferedWriter name='out'>)
+
+ FileType objects understand the pseudo-argument ``'-'`` and automatically
+ convert this into ``sys.stdin`` for readable :class:`FileType` objects and
+ ``sys.stdout`` for writable :class:`FileType` objects:
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('infile', type=argparse.FileType('r'))
+ >>> parser.parse_args(['-'])
+ Namespace(infile=<_io.TextIOWrapper name='<stdin>' encoding='UTF-8'>)
+
+
+Argument groups
+^^^^^^^^^^^^^^^
+
+.. method:: ArgumentParser.add_argument_group(title=None, description=None)
+
+ By default, :class:`ArgumentParser` groups command-line arguments into
+ "positional arguments" and "optional arguments" when displaying help
+ messages. When there is a better conceptual grouping of arguments than this
+ default one, appropriate groups can be created using the
+ :meth:`add_argument_group` method::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)
+ >>> group = parser.add_argument_group('group')
+ >>> group.add_argument('--foo', help='foo help')
+ >>> group.add_argument('bar', help='bar help')
+ >>> parser.print_help()
+ usage: PROG [--foo FOO] bar
+
+ group:
+ bar bar help
+ --foo FOO foo help
+
+ The :meth:`add_argument_group` method returns an argument group object which
+ has an :meth:`~ArgumentParser.add_argument` method just like a regular
+ :class:`ArgumentParser`. When an argument is added to the group, the parser
+ treats it just like a normal argument, but displays the argument in a
+ separate group for help messages. The :meth:`add_argument_group` method
+ accepts *title* and *description* arguments which can be used to
+ customize this display::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)
+ >>> group1 = parser.add_argument_group('group1', 'group1 description')
+ >>> group1.add_argument('foo', help='foo help')
+ >>> group2 = parser.add_argument_group('group2', 'group2 description')
+ >>> group2.add_argument('--bar', help='bar help')
+ >>> parser.print_help()
+ usage: PROG [--bar BAR] foo
+
+ group1:
+ group1 description
+
+ foo foo help
+
+ group2:
+ group2 description
+
+ --bar BAR bar help
+
+ Note that any arguments not your user defined groups will end up back in the
+ usual "positional arguments" and "optional arguments" sections.
+
+
+Mutual exclusion
+^^^^^^^^^^^^^^^^
+
+.. method:: add_mutually_exclusive_group(required=False)
+
+ Create a mutually exclusive group. :mod:`argparse` will make sure that only
+ one of the arguments in the mutually exclusive group was present on the
+ command line::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> group = parser.add_mutually_exclusive_group()
+ >>> group.add_argument('--foo', action='store_true')
+ >>> group.add_argument('--bar', action='store_false')
+ >>> parser.parse_args(['--foo'])
+ Namespace(bar=True, foo=True)
+ >>> parser.parse_args(['--bar'])
+ Namespace(bar=False, foo=False)
+ >>> parser.parse_args(['--foo', '--bar'])
+ usage: PROG [-h] [--foo | --bar]
+ PROG: error: argument --bar: not allowed with argument --foo
+
+ The :meth:`add_mutually_exclusive_group` method also accepts a *required*
+ argument, to indicate that at least one of the mutually exclusive arguments
+ is required::
+
+ >>> parser = argparse.ArgumentParser(prog='PROG')
+ >>> group = parser.add_mutually_exclusive_group(required=True)
+ >>> group.add_argument('--foo', action='store_true')
+ >>> group.add_argument('--bar', action='store_false')
+ >>> parser.parse_args([])
+ usage: PROG [-h] (--foo | --bar)
+ PROG: error: one of the arguments --foo --bar is required
+
+ Note that currently mutually exclusive argument groups do not support the
+ *title* and *description* arguments of
+ :meth:`~ArgumentParser.add_argument_group`.
+
+
+Parser defaults
+^^^^^^^^^^^^^^^
+
+.. method:: ArgumentParser.set_defaults(**kwargs)
+
+ Most of the time, the attributes of the object returned by :meth:`parse_args`
+ will be fully determined by inspecting the command-line args and the argument
+ actions. :meth:`set_defaults` allows some additional
+ attributes that are determined without any inspection of the command line to
+ be added::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('foo', type=int)
+ >>> parser.set_defaults(bar=42, baz='badger')
+ >>> parser.parse_args(['736'])
+ Namespace(bar=42, baz='badger', foo=736)
+
+ Note that parser-level defaults always override argument-level defaults::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', default='bar')
+ >>> parser.set_defaults(foo='spam')
+ >>> parser.parse_args([])
+ Namespace(foo='spam')
+
+ Parser-level defaults can be particularly useful when working with multiple
+ parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an
+ example of this type.
+
+.. method:: ArgumentParser.get_default(dest)
+
+ Get the default value for a namespace attribute, as set by either
+ :meth:`~ArgumentParser.add_argument` or by
+ :meth:`~ArgumentParser.set_defaults`::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', default='badger')
+ >>> parser.get_default('foo')
+ 'badger'
+
+
+Printing help
+^^^^^^^^^^^^^
+
+In most typical applications, :meth:`~ArgumentParser.parse_args` will take
+care of formatting and printing any usage or error messages. However, several
+formatting methods are available:
+
+.. method:: ArgumentParser.print_usage(file=None)
+
+ Print a brief description of how the :class:`ArgumentParser` should be
+ invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is
+ assumed.
+
+.. method:: ArgumentParser.print_help(file=None)
+
+ Print a help message, including the program usage and information about the
+ arguments registered with the :class:`ArgumentParser`. If *file* is
+ ``None``, :data:`sys.stdout` is assumed.
+
+There are also variants of these methods that simply return a string instead of
+printing it:
+
+.. method:: ArgumentParser.format_usage()
+
+ Return a string containing a brief description of how the
+ :class:`ArgumentParser` should be invoked on the command line.
+
+.. method:: ArgumentParser.format_help()
+
+ Return a string containing a help message, including the program usage and
+ information about the arguments registered with the :class:`ArgumentParser`.
+
+
+Partial parsing
+^^^^^^^^^^^^^^^
+
+.. method:: ArgumentParser.parse_known_args(args=None, namespace=None)
+
+Sometimes a script may only parse a few of the command-line arguments, passing
+the remaining arguments on to another script or program. In these cases, the
+:meth:`~ArgumentParser.parse_known_args` method can be useful. It works much like
+:meth:`~ArgumentParser.parse_args` except that it does not produce an error when
+extra arguments are present. Instead, it returns a two item tuple containing
+the populated namespace and the list of remaining argument strings.
+
+::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--foo', action='store_true')
+ >>> parser.add_argument('bar')
+ >>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])
+ (Namespace(bar='BAR', foo=True), ['--badger', 'spam'])
+
+
+Customizing file parsing
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. method:: ArgumentParser.convert_arg_line_to_args(arg_line)
+
+ Arguments that are read from a file (see the *fromfile_prefix_chars*
+ keyword argument to the :class:`ArgumentParser` constructor) are read one
+ argument per line. :meth:`convert_arg_line_to_args` can be overriden for
+ fancier reading.
+
+ This method takes a single argument *arg_line* which is a string read from
+ the argument file. It returns a list of arguments parsed from this string.
+ The method is called once per line read from the argument file, in order.
+
+ A useful override of this method is one that treats each space-separated word
+ as an argument::
+
+ def convert_arg_line_to_args(self, arg_line):
+ for arg in arg_line.split():
+ if not arg.strip():
+ continue
+ yield arg
+
+
+Exiting methods
+^^^^^^^^^^^^^^^
+
+.. method:: ArgumentParser.exit(status=0, message=None)
+
+ This method terminates the program, exiting with the specified *status*
+ and, if given, it prints a *message* before that.
+
+.. method:: ArgumentParser.error(message)
+
+ This method prints a usage message including the *message* to the
+ standard output and terminates the program with a status code of 2.
+
+.. _upgrading-optparse-code:
+
+Upgrading optparse code
+-----------------------
+
+Originally, the :mod:`argparse` module had attempted to maintain compatibility
+with :mod:`optparse`. However, :mod:`optparse` was difficult to extend
+transparently, particularly with the changes required to support the new
+``nargs=`` specifiers and better usage messages. When most everything in
+:mod:`optparse` had either been copy-pasted over or monkey-patched, it no
+longer seemed practical to try to maintain the backwards compatibility.
+
+A partial upgrade path from :mod:`optparse` to :mod:`argparse`:
+
+* Replace all :meth:`optparse.OptionParser.add_option` calls with
+ :meth:`ArgumentParser.add_argument` calls.
+
+* Replace ``options, args = parser.parse_args()`` with ``args =
+ parser.parse_args()`` and add additional :meth:`ArgumentParser.add_argument`
+ calls for the positional arguments.
+
+* Replace callback actions and the ``callback_*`` keyword arguments with
+ ``type`` or ``action`` arguments.
+
+* Replace string names for ``type`` keyword arguments with the corresponding
+ type objects (e.g. int, float, complex, etc).
+
+* Replace :class:`optparse.Values` with :class:`Namespace` and
+ :exc:`optparse.OptionError` and :exc:`optparse.OptionValueError` with
+ :exc:`ArgumentError`.
+
+* Replace strings with implicit arguments such as ``%default`` or ``%prog`` with
+ the standard Python syntax to use dictionaries to format strings, that is,
+ ``%(default)s`` and ``%(prog)s``.
+
+* Replace the OptionParser constructor ``version`` argument with a call to
+ ``parser.add_argument('--version', action='version', version='<the version>')``
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
index 3ffc64d037..d563cceb77 100644
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -60,7 +60,7 @@ The module defines the following type:
appropriate type.
If given a list or string, the initializer is passed to the new array's
- :meth:`fromlist`, :meth:`fromstring`, or :meth:`fromunicode` method (see below)
+ :meth:`fromlist`, :meth:`frombytes`, or :meth:`fromunicode` method (see below)
to add initial items to the array. Otherwise, the iterable initializer is
passed to the :meth:`extend` method.
@@ -99,7 +99,7 @@ The following data items and methods are also supported:
memory buffer in bytes can be computed as ``array.buffer_info()[1] *
array.itemsize``. This is occasionally useful when working with low-level (and
inherently unsafe) I/O interfaces that require memory addresses, such as certain
- :cfunc:`ioctl` operations. The returned numbers are valid as long as the array
+ :c:func:`ioctl` operations. The returned numbers are valid as long as the array
exists and no length-changing operations are applied to it.
.. note::
@@ -132,6 +132,15 @@ The following data items and methods are also supported:
must be the right type to be appended to the array.
+.. method:: array.frombytes(s)
+
+ Appends items from the string, interpreting the string as an array of machine
+ values (as if it had been read from a file using the :meth:`fromfile` method).
+
+ .. versionadded:: 3.2
+ :meth:`fromstring` is renamed to :meth:`frombytes` for clarity.
+
+
.. method:: array.fromfile(f, n)
Read *n* items (as machine values) from the :term:`file object` *f* and append
@@ -147,17 +156,16 @@ The following data items and methods are also supported:
a.append(x)`` except that if there is a type error, the array is unchanged.
-.. method:: array.fromstring(s)
+.. method:: array.fromstring()
- Appends items from the string, interpreting the string as an array of machine
- values (as if it had been read from a file using the :meth:`fromfile` method).
+ Deprecated alias for :meth:`frombytes`.
.. method:: array.fromunicode(s)
Extends this array with data from the given unicode string. The array must
be a type ``'u'`` array; otherwise a :exc:`ValueError` is raised. Use
- ``array.fromstring(unicodestring.encode(enc))`` to append Unicode data to an
+ ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to an
array of some other type.
@@ -190,6 +198,16 @@ The following data items and methods are also supported:
Reverse the order of the items in the array.
+.. method:: array.tobytes()
+
+ Convert the array to an array of machine values and return the bytes
+ representation (the same sequence of bytes that would be written to a file by
+ the :meth:`tofile` method.)
+
+ .. versionadded:: 3.2
+ :meth:`tostring` is renamed to :meth:`tobytes` for clarity.
+
+
.. method:: array.tofile(f)
Write all items (as machine values) to the :term:`file object` *f*.
@@ -202,15 +220,13 @@ The following data items and methods are also supported:
.. method:: array.tostring()
- Convert the array to an array of machine values and return the string
- representation (the same sequence of bytes that would be written to a file by
- the :meth:`tofile` method.)
+ Deprecated alias for :meth:`tobytes`.
.. method:: array.tounicode()
Convert the array to a unicode string. The array must be a type ``'u'`` array;
- otherwise a :exc:`ValueError` is raised. Use ``array.tostring().decode(enc)`` to
+ otherwise a :exc:`ValueError` is raised. Use ``array.tobytes().decode(enc)`` to
obtain a unicode string from an array of some other type.
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index 08ee714d53..e2c0b6d17d 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -7,6 +7,9 @@
.. sectionauthor:: Martin v. Löwis <martin@v.loewis.de>
.. sectionauthor:: Georg Brandl <georg@python.org>
+**Source code:** :source:`Lib/ast.py`
+
+--------------
The :mod:`ast` module helps Python applications to process trees of the Python
abstract syntax grammar. The abstract syntax itself might change with each
@@ -117,12 +120,15 @@ and classes for traversing abstract syntax trees:
Safely evaluate an expression node or a string containing a Python
expression. The string or node provided may only consist of the following
- Python literal structures: strings, numbers, tuples, lists, dicts, booleans,
- and ``None``.
+ Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
+ sets, booleans, and ``None``.
This can be used for safely evaluating strings containing Python expressions
from untrusted sources without the need to parse the values oneself.
+ .. versionchanged:: 3.2
+ Now allows bytes and set literals.
+
.. function:: get_docstring(node, clean=True)
diff --git a/Doc/library/asynchat.rst b/Doc/library/asynchat.rst
index 3b8eb1240f..75b3cdaad3 100644
--- a/Doc/library/asynchat.rst
+++ b/Doc/library/asynchat.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Sam Rushing <rushing@nightmare.com>
.. sectionauthor:: Steve Holden <sholden@holdenweb.com>
+**Source code:** :source:`Lib/asynchat.py`
+
+--------------
This module builds on the :mod:`asyncore` infrastructure, simplifying
asynchronous clients and servers and making it easier to handle protocols
@@ -31,7 +34,7 @@ connection requests.
Like :class:`asyncore.dispatcher`, :class:`async_chat` defines a set of
events that are generated by an analysis of socket conditions after a
- :cfunc:`select` call. Once the polling loop has been started the
+ :c:func:`select` call. Once the polling loop has been started the
:class:`async_chat` object's methods are called by the event-processing
framework with no action on the part of the programmer.
diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst
index b6fe2bbea2..5f95d41161 100644
--- a/Doc/library/asyncore.rst
+++ b/Doc/library/asyncore.rst
@@ -9,6 +9,9 @@
.. sectionauthor:: Steve Holden <sholden@holdenweb.com>
.. heavily adapted from original documentation by Sam Rushing
+**Source code:** :source:`Lib/asyncore.py`
+
+--------------
This module provides the basic infrastructure for writing asynchronous socket
service clients and servers.
@@ -22,7 +25,7 @@ bound. If your program is processor bound, then pre-emptive scheduled threads
are probably what you really need. Network servers are rarely processor
bound, however.
-If your operating system supports the :cfunc:`select` system call in its I/O
+If your operating system supports the :c:func:`select` system call in its I/O
library (and nearly all do), then you can use it to juggle multiple
communication channels at once; doing other work while your I/O is taking
place in the "background." Although this strategy can seem strange and
@@ -86,14 +89,14 @@ any that have been added to the map during asynchronous service) is closed.
| ``handle_close()`` | Implied by a read event with no data |
| | available |
+----------------------+----------------------------------------+
- | ``handle_accept()`` | Implied by a read event on a listening |
+ | ``handle_accepted()``| Implied by a read event on a listening |
| | socket |
+----------------------+----------------------------------------+
During asynchronous processing, each mapped channel's :meth:`readable` and
:meth:`writable` methods are used to determine whether the channel's socket
- should be added to the list of channels :cfunc:`select`\ ed or
- :cfunc:`poll`\ ed for read and write events.
+ should be added to the list of channels :c:func:`select`\ ed or
+ :c:func:`poll`\ ed for read and write events.
Thus, the set of channel events is larger than the basic socket events. The
full set of methods that can be overridden in your subclass follows:
@@ -144,7 +147,21 @@ any that have been added to the map during asynchronous service) is closed.
Called on listening channels (passive openers) when a connection can be
established with a new remote endpoint that has issued a :meth:`connect`
- call for the local endpoint.
+ call for the local endpoint. Deprecated in version 3.2; use
+ :meth:`handle_accepted` instead.
+
+ .. deprecated:: 3.2
+
+
+ .. method:: handle_accepted(sock, addr)
+
+ Called on listening channels (passive openers) when a connection has been
+ established with a new remote endpoint that has issued a :meth:`connect`
+ call for the local endpoint. *conn* is a *new* socket object usable to
+ send and receive data on the connection, and *address* is the address
+ bound to the socket on the other end of the connection.
+
+ .. versionadded:: 3.2
.. method:: readable()
@@ -201,7 +218,8 @@ any that have been added to the map during asynchronous service) is closed.
.. method:: bind(address)
Bind the socket to *address*. The socket must not already be bound. (The
- format of *address* depends on the address family --- see above.) To mark
+ format of *address* depends on the address family --- refer to the
+ :mod:`socket` documentation for more information.) To mark
the socket as re-usable (setting the :const:`SO_REUSEADDR` option), call
the :class:`dispatcher` object's :meth:`set_reuse_addr` method.
@@ -225,6 +243,7 @@ any that have been added to the map during asynchronous service) is closed.
flushed). Sockets are automatically closed when they are
garbage-collected.
+
.. class:: dispatcher_with_send()
A :class:`dispatcher` subclass which adds simple buffered output capability,
@@ -234,9 +253,9 @@ any that have been added to the map during asynchronous service) is closed.
.. class:: file_dispatcher()
A file_dispatcher takes a file descriptor or :term:`file object` along
- with an optional map argument and wraps it for use with the :cfunc:`poll`
- or :cfunc:`loop` functions. If provided a file object or anything with a
- :cfunc:`fileno` method, that method will be called and passed to the
+ with an optional map argument and wraps it for use with the :c:func:`poll`
+ or :c:func:`loop` functions. If provided a file object or anything with a
+ :c:func:`fileno` method, that method will be called and passed to the
:class:`file_wrapper` constructor. Availability: UNIX.
.. class:: file_wrapper()
@@ -283,15 +302,15 @@ implement its socket handling::
self.buffer = self.buffer[sent:]
- client = HTTPClient('www.python.org', '/')
- asyncore.loop()
+ client = HTTPClient('www.python.org', '/')
+ asyncore.loop()
.. _asyncore-example-2:
asyncore Example basic echo server
----------------------------------
-Here is abasic echo server that uses the :class:`dispatcher` class to accept
+Here is a basic echo server that uses the :class:`dispatcher` class to accept
connections and dispatches the incoming connections to a handler::
import asyncore
@@ -301,7 +320,8 @@ connections and dispatches the incoming connections to a handler::
def handle_read(self):
data = self.recv(8192)
- self.send(data)
+ if data:
+ self.send(data)
class EchoServer(asyncore.dispatcher):
@@ -312,14 +332,9 @@ connections and dispatches the incoming connections to a handler::
self.bind((host, port))
self.listen(5)
- def handle_accept(self):
- pair = self.accept()
- if pair is None:
- return
- else:
- sock, addr = pair
- print('Incoming connection from %s' % repr(addr))
- handler = EchoHandler(sock)
+ def handle_accepted(self, sock, addr):
+ print('Incoming connection from %s' % repr(addr))
+ handler = EchoHandler(sock)
server = EchoServer('localhost', 8080)
asyncore.loop()
diff --git a/Doc/library/atexit.rst b/Doc/library/atexit.rst
index 104c73027d..cc1051bf74 100644
--- a/Doc/library/atexit.rst
+++ b/Doc/library/atexit.rst
@@ -98,3 +98,4 @@ Usage as a :term:`decorator`::
This obviously only works with functions that don't take arguments.
+
diff --git a/Doc/library/base64.rst b/Doc/library/base64.rst
index c10a74ac8a..2401ae7a13 100644
--- a/Doc/library/base64.rst
+++ b/Doc/library/base64.rst
@@ -37,7 +37,7 @@ The modern interface provides:
The encoded byte string is returned.
-.. function:: b64decode(s, altchars=None)
+.. function:: b64decode(s, altchars=None, validate=False)
Decode a Base64 encoded byte string.
@@ -45,9 +45,13 @@ The modern interface provides:
at least length 2 (additional characters are ignored) which specifies the
alternative alphabet used instead of the ``+`` and ``/`` characters.
- The decoded byte string is returned. A :exc:`TypeError` is raised if *s* were
- incorrectly padded or if there are non-alphabet characters present in the
- string.
+ The decoded string is returned. A `binascii.Error` is raised if *s* is
+ incorrectly padded.
+
+ If *validate* is ``False`` (the default), non-base64-alphabet characters are
+ discarded prior to the padding check. If *validate* is ``True``,
+ non-base64-alphabet characters in the input result in a
+ :exc:`binascii.Error`.
.. function:: standard_b64encode(s)
diff --git a/Doc/library/bdb.rst b/Doc/library/bdb.rst
index 4795ec943b..07376024b8 100644
--- a/Doc/library/bdb.rst
+++ b/Doc/library/bdb.rst
@@ -4,6 +4,10 @@
.. module:: bdb
:synopsis: Debugger framework.
+**Source code:** :source:`Lib/bdb.py`
+
+--------------
+
The :mod:`bdb` module handles basic debugger functions, like setting breakpoints
or managing execution via the debugger.
@@ -50,9 +54,10 @@ The :mod:`bdb` module also defines two classes:
Mark the breakpoint as disabled.
- .. method:: bpprint(out=None)
+ .. method:: bpformat()
- Print all the information about the breakpoint:
+ Return a string with all the information about the breakpoint, nicely
+ formatted:
* The breakpoint number.
* If it is temporary or not.
@@ -61,6 +66,13 @@ The :mod:`bdb` module also defines two classes:
* If it must be ignored the next N times.
* The breakpoint hit count.
+ .. versionadded:: 3.2
+
+ .. method:: bpprint(out=None)
+
+ Print the output of :meth:`bpformat` to the file *out*, or if it is
+ ``None``, to standard output.
+
.. class:: Bdb(skip=None)
@@ -267,6 +279,15 @@ The :mod:`bdb` module also defines two classes:
Delete all existing breakpoints.
+ .. method:: get_bpbynumber(arg)
+
+ Return a breakpoint specified by the given number. If *arg* is a string,
+ it will be converted to a number. If *arg* is a non-numeric string, if
+ the given breakpoint never existed or has been deleted, a
+ :exc:`ValueError` is raised.
+
+ .. versionadded:: 3.2
+
.. method:: get_break(filename, lineno)
Check if there is a breakpoint for *lineno* of *filename*.
diff --git a/Doc/library/binascii.rst b/Doc/library/binascii.rst
index 2f7851a0f9..2aa3702cfe 100644
--- a/Doc/library/binascii.rst
+++ b/Doc/library/binascii.rst
@@ -18,6 +18,11 @@ use these functions directly but use wrapper modules like :mod:`uu`,
low-level functions written in C for greater speed that are used by the
higher-level modules.
+.. note::
+
+ Encoding and decoding functions do not accept Unicode strings. Only bytestring
+ and bytearray objects can be processed.
+
The :mod:`binascii` module defines the following functions:
@@ -54,6 +59,9 @@ The :mod:`binascii` module defines the following functions:
data. More than one line may be passed at a time. If the optional argument
*header* is present and true, underscores will be decoded as spaces.
+ .. versionchanged:: 3.2
+ Accept only bytestring or bytearray objects as input.
+
.. function:: b2a_qp(data, quotetabs=False, istext=True, header=False)
@@ -83,6 +91,9 @@ The :mod:`binascii` module defines the following functions:
decompressed data, unless data input data ends in an orphaned repeat indicator,
in which case the :exc:`Incomplete` exception is raised.
+ .. versionchanged:: 3.2
+ Accept only bytestring or bytearray objects as input.
+
.. function:: rlecode_hqx(data)
@@ -139,6 +150,9 @@ The :mod:`binascii` module defines the following functions:
of hexadecimal digits (which can be upper or lower case), otherwise a
:exc:`TypeError` is raised.
+ .. versionchanged:: 3.2
+ Accept only bytestring or bytearray objects as input.
+
.. exception:: Error
@@ -164,4 +178,3 @@ The :mod:`binascii` module defines the following functions:
Module :mod:`quopri`
Support for quoted-printable encoding used in MIME email messages.
-
diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst
index eb231598ed..13b0147190 100644
--- a/Doc/library/bisect.rst
+++ b/Doc/library/bisect.rst
@@ -7,6 +7,10 @@
.. sectionauthor:: Raymond Hettinger <python at rcn.com>
.. example based on the PyModules FAQ entry by Aaron Watters <arw@pythonpros.com>
+**Source code:** :source:`Lib/bisect.py`
+
+--------------
+
This module provides support for maintaining a list in sorted order without
having to sort the list after each insertion. For long lists of items with
expensive comparison operations, this can be an improvement over the more common
diff --git a/Doc/library/builtins.rst b/Doc/library/builtins.rst
index f0d2a60a3c..c495728913 100644
--- a/Doc/library/builtins.rst
+++ b/Doc/library/builtins.rst
@@ -7,7 +7,7 @@
This module provides direct access to all 'built-in' identifiers of Python; for
example, ``builtins.open`` is the full name for the built-in function
-:func:`open`. See chapter :ref:`builtin`.
+:func:`open`.
This module is not normally accessed explicitly by most applications, but can be
useful in modules that provide objects with the same name as a built-in value,
diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst
index c8dac49e3c..f4952711cb 100644
--- a/Doc/library/calendar.rst
+++ b/Doc/library/calendar.rst
@@ -6,6 +6,9 @@
of the Unix cal program.
.. sectionauthor:: Drew Csillag <drew_csillag@geocities.com>
+**Source code:** :source:`Lib/calendar.py`
+
+--------------
This module allows you to output calendars like the Unix :program:`cal` program,
and provides additional useful functions related to the calendar. By default,
@@ -16,7 +19,7 @@ are given as integers. For related
functionality, see also the :mod:`datetime` and :mod:`time` modules.
Most of these functions and classes rely on the :mod:`datetime` module which
-uses an idealized calendar, the current Gregorian calendar indefinitely extended
+uses an idealized calendar, the current Gregorian calendar extended
in both directions. This matches the definition of the "proleptic Gregorian"
calendar in Dershowitz and Reingold's book "Calendrical Calculations", where
it's the base calendar for all computations.
@@ -309,4 +312,3 @@ The :mod:`calendar` module exports the following data attributes:
Module :mod:`time`
Low-level time related functions.
-
diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst
index 734031dd09..1e2498d460 100644
--- a/Doc/library/cgi.rst
+++ b/Doc/library/cgi.rst
@@ -13,6 +13,10 @@
single: URL
single: Common Gateway Interface
+**Source code:** :source:`Lib/cgi.py`
+
+--------------
+
Support module for Common Gateway Interface (CGI) scripts.
This module defines a number of utilities for use by CGI scripts written in
@@ -324,15 +328,13 @@ algorithms implemented in this module in other circumstances.
Convert the characters ``'&'``, ``'<'`` and ``'>'`` in string *s* to HTML-safe
sequences. Use this if you need to display text that might contain such
characters in HTML. If the optional flag *quote* is true, the quotation mark
- character (``'"'``) is also translated; this helps for inclusion in an HTML
- attribute value, as in ``<A HREF="...">``. If the value to be quoted might
- include single- or double-quote characters, or both, consider using the
- :func:`~xml.sax.saxutils.quoteattr` function in the :mod:`xml.sax.saxutils`
- module instead.
+ character (``"``) is also translated; this helps for inclusion in an HTML
+ attribute value delimited by double quotes, as in ``<a href="...">``. Note
+ that single quotes are never translated.
- If the value to be quoted might include single- or double-quote characters,
- or both, consider using the :func:`quoteattr` function in the
- :mod:`xml.sax.saxutils` module instead.
+ .. deprecated:: 3.2
+ This function is unsafe because *quote* is false by default, and therefore
+ deprecated. Use :func:`html.escape` instead.
.. _cgi-security:
@@ -510,8 +512,8 @@ Common problems and solutions
.. rubric:: Footnotes
-.. [#] Note that some recent versions of the HTML specification do state what order the
- field values should be supplied in, but knowing whether a request was
- received from a conforming browser, or even from a browser at all, is tedious
- and error-prone.
+.. [#] Note that some recent versions of the HTML specification do state what
+ order the field values should be supplied in, but knowing whether a request
+ was received from a conforming browser, or even from a browser at all, is
+ tedious and error-prone.
diff --git a/Doc/library/cmath.rst b/Doc/library/cmath.rst
index 14b909bd28..d7778df317 100644
--- a/Doc/library/cmath.rst
+++ b/Doc/library/cmath.rst
@@ -187,15 +187,24 @@ Hyperbolic functions
Classification functions
------------------------
+.. function:: isfinite(x)
+
+ Return ``True`` if both the real and imaginary parts of *x* are finite, and
+ ``False`` otherwise.
+
+ .. versionadded:: 3.2
+
+
.. function:: isinf(x)
- Return *True* if the real or the imaginary part of x is positive
- or negative infinity.
+ Return ``True`` if either the real or the imaginary part of *x* is an
+ infinity, and ``False`` otherwise.
.. function:: isnan(x)
- Return *True* if the real or imaginary part of x is not a number (NaN).
+ Return ``True`` if either the real or the imaginary part of *x* is a NaN,
+ and ``False`` otherwise.
Constants
diff --git a/Doc/library/cmd.rst b/Doc/library/cmd.rst
index d789270eb9..464764d793 100644
--- a/Doc/library/cmd.rst
+++ b/Doc/library/cmd.rst
@@ -5,13 +5,15 @@
:synopsis: Build line-oriented command interpreters.
.. sectionauthor:: Eric S. Raymond <esr@snark.thyrsus.com>
+**Source code:** :source:`Lib/cmd.py`
+
+--------------
The :class:`Cmd` class provides a simple framework for writing line-oriented
command interpreters. These are often useful for test harnesses, administrative
tools, and prototypes that will later be wrapped in a more sophisticated
interface.
-
.. class:: Cmd(completekey='tab', stdin=None, stdout=None)
A :class:`Cmd` instance or subclass instance is a line-oriented interpreter
@@ -203,3 +205,161 @@ Instances of :class:`Cmd` subclasses have some public instance variables:
:mod:`readline`, on systems that support it, the interpreter will automatically
support :program:`Emacs`\ -like line editing and command-history keystrokes.)
+Cmd Example
+-----------
+
+.. sectionauthor:: Raymond Hettinger <python at rcn dot com>
+
+The :mod:`cmd` module is mainly useful for building custom shells that let a
+user work with a program interactively.
+
+This section presents a simple example of how to build a shell around a few of
+the commands in the :mod:`turtle` module.
+
+Basic turtle commands such as :meth:`~turtle.forward` are added to a
+:class:`Cmd` subclass with method named :meth:`do_forward`. The argument is
+converted to a number and dispatched to the turtle module. The docstring is
+used in the help utility provided by the shell.
+
+The example also includes a basic record and playback facility implemented with
+the :meth:`~Cmd.precmd` method which is responsible for converting the input to
+lowercase and writing the commands to a file. The :meth:`do_playback` method
+reads the file and adds the recorded commands to the :attr:`cmdqueue` for
+immediate playback::
+
+ import cmd, sys
+ from turtle import *
+
+ class TurtleShell(cmd.Cmd):
+ intro = 'Welcome to the turtle shell. Type help or ? to list commands.\n'
+ prompt = '(turtle) '
+ file = None
+
+ # ----- basic turtle commands -----
+ def do_forward(self, arg):
+ 'Move the turtle forward by the specified distance: FORWARD 10'
+ forward(*parse(arg))
+ def do_right(self, arg):
+ 'Turn turtle right by given number of degrees: RIGHT 20'
+ right(*parse(arg))
+ def do_left(self, arg):
+ 'Turn turtle left by given number of degrees: LEFT 90'
+ right(*parse(arg))
+ def do_goto(self, arg):
+ 'Move turtle to an absolute position with changing orientation. GOTO 100 200'
+ goto(*parse(arg))
+ def do_home(self, arg):
+ 'Return turtle to the home postion: HOME'
+ home()
+ def do_circle(self, arg):
+ 'Draw circle with given radius an options extent and steps: CIRCLE 50'
+ circle(*parse(arg))
+ def do_position(self, arg):
+ 'Print the current turle position: POSITION'
+ print('Current position is %d %d\n' % position())
+ def do_heading(self, arg):
+ 'Print the current turle heading in degrees: HEADING'
+ print('Current heading is %d\n' % (heading(),))
+ def do_color(self, arg):
+ 'Set the color: COLOR BLUE'
+ color(arg.lower())
+ def do_undo(self, arg):
+ 'Undo (repeatedly) the last turtle action(s): UNDO'
+ def do_reset(self, arg):
+ 'Clear the screen and return turtle to center: RESET'
+ reset()
+ def do_bye(self, arg):
+ 'Stop recording, close the turtle window, and exit: BYE'
+ print('Thank you for using Turtle')
+ self.close()
+ bye()
+ sys.exit(0)
+
+ # ----- record and playback -----
+ def do_record(self, arg):
+ 'Save future commands to filename: RECORD rose.cmd'
+ self.file = open(arg, 'w')
+ def do_playback(self, arg):
+ 'Playback commands from a file: PLAYBACK rose.cmd'
+ self.close()
+ cmds = open(arg).read().splitlines()
+ self.cmdqueue.extend(cmds)
+ def precmd(self, line):
+ line = line.lower()
+ if self.file and 'playback' not in line:
+ print(line, file=self.file)
+ return line
+ def close(self):
+ if self.file:
+ self.file.close()
+ self.file = None
+
+ def parse(arg):
+ 'Convert a series of zero or more numbers to an argument tuple'
+ return tuple(map(int, arg.split()))
+
+ if __name__ == '__main__':
+ TurtleShell().cmdloop()
+
+
+Here is a sample session with the turtle shell showing the help functions, using
+blank lines to repeat commands, and the simple record and playback facility::
+
+ Welcome to the turtle shell. Type help or ? to list commands.
+
+ (turtle) ?
+
+ Documented commands (type help <topic>):
+ ========================================
+ bye color goto home playback record right
+ circle forward heading left position reset undo
+
+ (turtle) help forward
+ Move the turtle forward by the specified distance: FORWARD 10
+ (turtle) record spiral.cmd
+ (turtle) position
+ Current position is 0 0
+
+ (turtle) heading
+ Current heading is 0
+
+ (turtle) reset
+ (turtle) circle 20
+ (turtle) right 30
+ (turtle) circle 40
+ (turtle) right 30
+ (turtle) circle 60
+ (turtle) right 30
+ (turtle) circle 80
+ (turtle) right 30
+ (turtle) circle 100
+ (turtle) right 30
+ (turtle) circle 120
+ (turtle) right 30
+ (turtle) circle 120
+ (turtle) heading
+ Current heading is 180
+
+ (turtle) forward 100
+ (turtle)
+ (turtle) right 90
+ (turtle) forward 100
+ (turtle)
+ (turtle) right 90
+ (turtle) forward 400
+ (turtle) right 90
+ (turtle) forward 500
+ (turtle) right 90
+ (turtle) forward 400
+ (turtle) right 90
+ (turtle) forward 300
+ (turtle) playback spiral.cmd
+ Current position is 0 0
+
+ Current heading is 0
+
+ Current heading is 180
+
+ (turtle) bye
+ Thank you for using Turtle
+
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index d07dafaa98..922bcf488a 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -787,9 +787,9 @@ Encodings and Unicode
---------------------
Strings are stored internally as sequences of codepoints (to be precise
-as :ctype:`Py_UNICODE` arrays). Depending on the way Python is compiled (either
+as :c:type:`Py_UNICODE` arrays). Depending on the way Python is compiled (either
via ``--without-wide-unicode`` or ``--with-wide-unicode``, with the
-former being the default) :ctype:`Py_UNICODE` is either a 16-bit or 32-bit data
+former being the default) :c:type:`Py_UNICODE` is either a 16-bit or 32-bit data
type. Once a string object is used outside of CPU and memory, CPU endianness
and how these arrays are stored as bytes become an issue. Transforming a
string object into a sequence of bytes is called encoding and recreating the
@@ -936,6 +936,8 @@ particular, the following variants typically exist:
| cp500 | EBCDIC-CP-BE, EBCDIC-CP-CH, | Western Europe |
| | IBM500 | |
+-----------------+--------------------------------+--------------------------------+
+| cp720 | | Arabic |
++-----------------+--------------------------------+--------------------------------+
| cp737 | | Greek |
+-----------------+--------------------------------+--------------------------------+
| cp775 | IBM775 | Baltic languages |
@@ -951,6 +953,8 @@ particular, the following variants typically exist:
+-----------------+--------------------------------+--------------------------------+
| cp857 | 857, IBM857 | Turkish |
+-----------------+--------------------------------+--------------------------------+
+| cp858 | 858, IBM858 | Western Europe |
++-----------------+--------------------------------+--------------------------------+
| cp860 | 860, IBM860 | Portuguese |
+-----------------+--------------------------------+--------------------------------+
| cp861 | 861, CP-IS, IBM861 | Icelandic |
@@ -1086,7 +1090,7 @@ particular, the following variants typically exist:
+-----------------+--------------------------------+--------------------------------+
| mac_latin2 | maclatin2, maccentraleurope | Central and Eastern Europe |
+-----------------+--------------------------------+--------------------------------+
-| mac_roman | macroman | Western Europe |
+| mac_roman | macroman, macintosh | Western Europe |
+-----------------+--------------------------------+--------------------------------+
| mac_turkish | macturkish | Turkish |
+-----------------+--------------------------------+--------------------------------+
@@ -1110,9 +1114,9 @@ particular, the following variants typically exist:
+-----------------+--------------------------------+--------------------------------+
| utf_16 | U16, utf16 | all languages |
+-----------------+--------------------------------+--------------------------------+
-| utf_16_be | UTF-16BE | all languages (BMP only) |
+| utf_16_be | UTF-16BE | all languages |
+-----------------+--------------------------------+--------------------------------+
-| utf_16_le | UTF-16LE | all languages (BMP only) |
+| utf_16_le | UTF-16LE | all languages |
+-----------------+--------------------------------+--------------------------------+
| utf_7 | U7, unicode-1-1-utf-7 | all languages |
+-----------------+--------------------------------+--------------------------------+
@@ -1161,6 +1165,44 @@ particular, the following variants typically exist:
| | | operand |
+--------------------+---------+---------------------------+
+The following codecs provide bytes-to-bytes mappings.
+
++--------------------+---------------------------+---------------------------+
+| Codec | Aliases | Purpose |
++====================+===========================+===========================+
+| base64_codec | base64, base-64 | Convert operand to MIME |
+| | | base64 |
++--------------------+---------------------------+---------------------------+
+| bz2_codec | bz2 | Compress the operand |
+| | | using bz2 |
++--------------------+---------------------------+---------------------------+
+| hex_codec | hex | Convert operand to |
+| | | hexadecimal |
+| | | representation, with two |
+| | | digits per byte |
++--------------------+---------------------------+---------------------------+
+| quopri_codec | quopri, quoted-printable, | Convert operand to MIME |
+| | quotedprintable | quoted printable |
++--------------------+---------------------------+---------------------------+
+| uu_codec | uu | Convert the operand using |
+| | | uuencode |
++--------------------+---------------------------+---------------------------+
+| zlib_codec | zip, zlib | Compress the operand |
+| | | using gzip |
++--------------------+---------------------------+---------------------------+
+
+The following codecs provide string-to-string mappings.
+
++--------------------+---------------------------+---------------------------+
+| Codec | Aliases | Purpose |
++====================+===========================+===========================+
+| rot_13 | rot13 | Returns the Caesar-cypher |
+| | | encryption of the operand |
++--------------------+---------------------------+---------------------------+
+
+.. versionadded:: 3.2
+ bytes-to-bytes and string-to-string codecs.
+
:mod:`encodings.idna` --- Internationalized Domain Names in Applications
------------------------------------------------------------------------
@@ -1227,6 +1269,23 @@ functions can be used directly if desired.
Convert a label to Unicode, as specified in :rfc:`3490`.
+:mod:`encodings.mbcs` --- Windows ANSI codepage
+-----------------------------------------------
+
+.. module:: encodings.mbcs
+ :synopsis: Windows ANSI codepage
+
+Encode operand according to the ANSI codepage (CP_ACP). This codec only
+supports ``'strict'`` and ``'replace'`` error handlers to encode, and
+``'strict'`` and ``'ignore'`` error handlers to decode.
+
+Availability: Windows only.
+
+.. versionchanged:: 3.2
+ Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used
+ to encode, and ``'ignore'`` to decode.
+
+
:mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature
-------------------------------------------------------------
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 68a79f12d0..d29bc175b4 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -13,6 +13,10 @@
import itertools
__name__ = '<doctest>'
+**Source code:** :source:`Lib/collections.py` and :source:`Lib/_abcoll.py`
+
+--------------
+
This module implements specialized container datatypes providing alternatives to
Python's general purpose built-in containers, :class:`dict`, :class:`list`,
:class:`set`, and :class:`tuple`.
@@ -29,7 +33,7 @@ Python's general purpose built-in containers, :class:`dict`, :class:`list`,
===================== ====================================================================
In addition to the concrete container classes, the collections module provides
-ABCs (abstract base classes) that can be used to test whether a class provides a
+:ref:`abstract-base-classes` that can be used to test whether a class provides a
particular interface, for example, whether it is hashable or a mapping.
@@ -85,7 +89,7 @@ For example::
.. versionadded:: 3.1
- Counter objects support two methods beyond those available for all
+ Counter objects support three methods beyond those available for all
dictionaries:
.. method:: elements()
@@ -108,6 +112,19 @@ For example::
>>> Counter('abracadabra').most_common(3)
[('a', 5), ('r', 2), ('b', 2)]
+ .. method:: subtract([iterable-or-mapping])
+
+ Elements are subtracted from an *iterable* or from another *mapping*
+ (or counter). Like :meth:`dict.update` but subtracts counts instead
+ of replacing them. Both inputs and outputs may be zero or negative.
+
+ >>> c = Counter(a=4, b=2, c=0, d=-2)
+ >>> d = Counter(a=1, b=2, c=3, d=4)
+ >>> c.subtract(d)
+ Counter({'a': 3, 'b': 0, 'c': -3, 'd': -6})
+
+ .. versionadded:: 3.2
+
The usual dictionary methods are available for :class:`Counter` objects
except for two which work differently for counters.
@@ -188,14 +205,14 @@ counts, but the output will exclude results with counts of zero or less.
* `Bag class <http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html>`_
in Smalltalk.
- * Wikipedia entry for `Multisets <http://en.wikipedia.org/wiki/Multiset>`_\.
+ * Wikipedia entry for `Multisets <http://en.wikipedia.org/wiki/Multiset>`_.
* `C++ multisets <http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm>`_
tutorial with examples.
* For mathematical operations on multisets and their use cases, see
*Knuth, Donald. The Art of Computer Programming Volume II,
- Section 4.6.3, Exercise 19*\.
+ Section 4.6.3, Exercise 19*.
* To enumerate all distinct multisets of a given size over a given set of
elements, see :func:`itertools.combinations_with_replacement`.
@@ -248,6 +265,13 @@ counts, but the output will exclude results with counts of zero or less.
Remove all elements from the deque leaving it with length 0.
+ .. method:: count(x)
+
+ Count the number of deque elements equal to *x*.
+
+ .. versionadded:: 3.2
+
+
.. method:: extend(iterable)
Extend the right side of the deque by appending elements from the iterable
@@ -279,6 +303,13 @@ counts, but the output will exclude results with counts of zero or less.
:exc:`ValueError`.
+ .. method:: reverse()
+
+ Reverse the elements of the deque in-place and then return ``None``.
+
+ .. versionadded:: 3.2
+
+
.. method:: rotate(n)
Rotate the deque *n* steps to the right. If *n* is negative, rotate to
@@ -555,11 +586,15 @@ they add the ability to access fields by name instead of position index.
.. versionchanged:: 3.1
Added support for *rename*.
-Example:
.. doctest::
:options: +NORMALIZE_WHITESPACE
+ >>> # Basic example
+ >>> Point = namedtuple('Point', ['x', 'y'])
+ >>> p = Point(x=10, y=11)
+
+ >>> # Example using the verbose option to print the class definition
>>> Point = namedtuple('Point', 'x y', verbose=True)
class Point(tuple):
'Point(x, y)'
@@ -569,6 +604,7 @@ Example:
_fields = ('x', 'y')
<BLANKLINE>
def __new__(_cls, x, y):
+ 'Create a new instance of Point(x, y)'
return _tuple.__new__(_cls, (x, y))
<BLANKLINE>
@classmethod
@@ -580,7 +616,8 @@ Example:
return result
<BLANKLINE>
def __repr__(self):
- return 'Point(x=%r, y=%r)' % self
+ 'Return a nicely formatted representation string'
+ return self.__class__.__name__ + '(x=%r, y=%r)' % self
<BLANKLINE>
def _asdict(self):
'Return a new OrderedDict which maps field names to their values'
@@ -594,10 +631,11 @@ Example:
return result
<BLANKLINE>
def __getnewargs__(self):
+ 'Return self as a plain tuple. Used by copy and pickle.'
return tuple(self)
<BLANKLINE>
- x = _property(_itemgetter(0))
- y = _property(_itemgetter(1))
+ x = _property(_itemgetter(0), doc='Alias for field number 0')
+ y = _property(_itemgetter(1), doc='Alias for field number 1')
>>> p = Point(11, y=22) # instantiate with positional or keyword arguments
>>> p[0] + p[1] # indexable like the plain tuple (11, 22)
@@ -698,15 +736,15 @@ functionality with a subclass. Here is how to add a calculated field and
a fixed-width print format:
>>> class Point(namedtuple('Point', 'x y')):
- ... __slots__ = ()
- ... @property
- ... def hypot(self):
- ... return (self.x ** 2 + self.y ** 2) ** 0.5
- ... def __str__(self):
- ... return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot)
+ __slots__ = ()
+ @property
+ def hypot(self):
+ return (self.x ** 2 + self.y ** 2) ** 0.5
+ def __str__(self):
+ return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot)
>>> for p in Point(3, 4), Point(14, 5/7):
- ... print(p)
+ print(p)
Point: x= 3.000 y= 4.000 hypot= 5.000
Point: x=14.000 y= 0.714 hypot=14.018
@@ -733,12 +771,19 @@ and more efficient to use a simple class declaration:
>>> Status.open, Status.pending, Status.closed
(0, 1, 2)
>>> class Status:
- ... open, pending, closed = range(3)
+ open, pending, closed = range(3)
.. seealso::
- `Named tuple recipe <http://code.activestate.com/recipes/500261/>`_
- adapted for Python 2.4.
+ * `Named tuple recipe <http://code.activestate.com/recipes/500261/>`_
+ adapted for Python 2.4.
+
+ * `Recipe for named tuple abstract base class with a metaclass mix-in
+ <http://code.activestate.com/recipes/577629-namedtupleabc-abstract-base-class-mix-in-for-named/>`_
+ by Jan Kaliszewski. Besides providing an :term:`abstract base class` for
+ named tuples, it also supports an alternate :term:`metaclass`-based
+ constructor that is convenient for use cases where named tuples are being
+ subclassed.
:class:`OrderedDict` objects
@@ -764,6 +809,23 @@ the items are returned in the order their keys were first added.
(key, value) pair. The pairs are returned in LIFO order if *last* is true
or FIFO order if false.
+ .. method:: move_to_end(key, last=True)
+
+ Move an existing *key* to either end of an ordered dictionary. The item
+ is moved to the right end if *last* is true (the default) or to the
+ beginning if *last* is false. Raises :exc:`KeyError` if the *key* does
+ not exist::
+
+ >>> d = OrderedDict.fromkeys('abcde')
+ >>> d.move_to_end('b')
+ >>> ''.join(d.keys)
+ 'acdeb'
+ >>> d.move_to_end('b', last=False)
+ >>> ''.join(d.keys)
+ 'bacde'
+
+ .. versionadded:: 3.2
+
In addition to the usual mapping methods, ordered dictionaries also support
reverse iteration using :func:`reversed`.
@@ -864,6 +926,7 @@ attribute.
class.
+
:class:`UserList` objects
-------------------------
@@ -923,6 +986,7 @@ attribute.
subclass) or an arbitrary sequence which can be converted into a string using
the built-in :func:`str` function.
+.. _abstract-base-classes:
ABCs - abstract base classes
----------------------------
@@ -939,7 +1003,7 @@ ABC Inherits from Abstract Methods Mixin
:class:`Sized` ``__len__``
:class:`Callable` ``__call__``
-:class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``,
+:class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``, ``__iter__``, ``__reversed__``,
:class:`Iterable`, ``index``, and ``count``
:class:`Container`
@@ -1074,6 +1138,9 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
.. seealso::
+ * Latest version of the :source:`Python source code for the collections
+ abstract base classes <Lib/_abcoll.py>`
+
* `OrderedSet recipe <http://code.activestate.com/recipes/576694/>`_ for an
example built on :class:`MutableSet`.
diff --git a/Doc/library/colorsys.rst b/Doc/library/colorsys.rst
index 2cbc704db1..dbab7063e1 100644
--- a/Doc/library/colorsys.rst
+++ b/Doc/library/colorsys.rst
@@ -5,6 +5,9 @@
:synopsis: Conversion functions between RGB and other color systems.
.. sectionauthor:: David Ascher <da@python.net>
+**Source code:** :source:`Lib/colorsys.py`
+
+--------------
The :mod:`colorsys` module defines bidirectional conversions of color values
between colors expressed in the RGB (Red Green Blue) color space used in
diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst
index 8a93f9b719..cb7a09c0fb 100644
--- a/Doc/library/compileall.rst
+++ b/Doc/library/compileall.rst
@@ -52,11 +52,30 @@ compile Python sources.
regex is used to search the full path to each file considered for
compilation, and if the regex produces a match, the file is skipped.
+.. cmdoption:: -i list
+
+ Read the file ``list`` and add each line that it contains to the list of
+ files and directories to compile. If ``list`` is ``-``, read lines from
+ ``stdin``.
+
+.. cmdoption:: -b
+
+ Write the byte-code files to their legacy locations and names, which may
+ overwrite byte-code files created by another version of Python. The default
+ is to write files to their :pep:`3147` locations and names, which allows
+ byte-code files from multiple versions of Python to coexist.
+
+.. versionchanged:: 3.2
+ Added the ``-i``, ``-b`` and ``-h`` options.
+
+There is no command-line option to control the optimization level used by the
+:func:`compile` function, because the Python interpreter itself already
+provides the option: :program:`python -O -m compileall`.
Public functions
----------------
-.. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=False)
+.. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=False, legacy=False, optimize=-1)
Recursively descend the directory tree named by *dir*, compiling all :file:`.py`
files along the way.
@@ -80,7 +99,49 @@ Public functions
If *quiet* is true, nothing is printed to the standard output unless errors
occur.
-.. function:: compile_path(skip_curdir=True, maxlevels=0, force=False)
+ If *legacy* is true, byte-code files are written to their legacy locations
+ and names, which may overwrite byte-code files created by another version of
+ Python. The default is to write files to their :pep:`3147` locations and
+ names, which allows byte-code files from multiple versions of Python to
+ coexist.
+
+ *optimize* specifies the optimization level for the compiler. It is passed to
+ the built-in :func:`compile` function.
+
+ .. versionchanged:: 3.2
+ Added the *legacy* and *optimize* parameter.
+
+
+.. function:: compile_file(fullname, ddir=None, force=False, rx=None, quiet=False, legacy=False, optimize=-1)
+
+ Compile the file with path *fullname*.
+
+ If *ddir* is given, it is prepended to the path to the file being compiled
+ for use in compilation time tracebacks, and is also compiled in to the
+ byte-code file, where it will be used in tracebacks and other messages in
+ cases where the source file does not exist at the time the byte-code file is
+ executed.
+
+ If *rx* is given, its search method is passed the full path name to the
+ file being compiled, and if it returns a true value, the file is not
+ compiled and ``True`` is returned.
+
+ If *quiet* is true, nothing is printed to the standard output unless errors
+ occur.
+
+ If *legacy* is true, byte-code files are written to their legacy locations
+ and names, which may overwrite byte-code files created by another version of
+ Python. The default is to write files to their :pep:`3147` locations and
+ names, which allows byte-code files from multiple versions of Python to
+ coexist.
+
+ *optimize* specifies the optimization level for the compiler. It is passed to
+ the built-in :func:`compile` function.
+
+ .. versionadded:: 3.2
+
+
+.. function:: compile_path(skip_curdir=True, maxlevels=0, force=False, legacy=False, optimize=-1)
Byte-compile all the :file:`.py` files found along ``sys.path``. If
*skip_curdir* is true (the default), the current directory is not included
@@ -88,6 +149,10 @@ Public functions
function. Note that unlike the other compile functions, ``maxlevels``
defaults to ``0``.
+ .. versionchanged:: 3.2
+ Added the *legacy* and *optimize* parameter.
+
+
To force a recompile of all the :file:`.py` files in the :file:`Lib/`
subdirectory and all its subdirectories::
diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst
new file mode 100644
index 0000000000..e5d13f37f3
--- /dev/null
+++ b/Doc/library/concurrent.futures.rst
@@ -0,0 +1,371 @@
+:mod:`concurrent.futures` --- Launching parallel tasks
+======================================================
+
+.. module:: concurrent.futures
+ :synopsis: Execute computations concurrently using threads or processes.
+
+**Source code:** :source:`Lib/concurrent/futures/thread.py`
+and :source:`Lib/concurrent/futures/process.py`
+
+.. versionadded:: 3.2
+
+--------------
+
+The :mod:`concurrent.futures` module provides a high-level interface for
+asynchronously executing callables.
+
+The asynchronous execution can be be performed with threads, using
+:class:`ThreadPoolExecutor`, or separate processes, using
+:class:`ProcessPoolExecutor`. Both implement the same interface, which is
+defined by the abstract :class:`Executor` class.
+
+
+Executor Objects
+----------------
+
+.. class:: Executor
+
+ An abstract class that provides methods to execute calls asynchronously. It
+ should not be used directly, but through its concrete subclasses.
+
+ .. method:: submit(fn, *args, **kwargs)
+
+ Schedules the callable, *fn*, to be executed as ``fn(*args **kwargs)``
+ and returns a :class:`Future` object representing the execution of the
+ callable. ::
+
+ with ThreadPoolExecutor(max_workers=1) as executor:
+ future = executor.submit(pow, 323, 1235)
+ print(future.result())
+
+ .. method:: map(func, *iterables, timeout=None)
+
+ Equivalent to ``map(func, *iterables)`` except *func* is executed
+ asynchronously and several calls to *func* may be made concurrently. The
+ returned iterator raises a :exc:`TimeoutError` if :meth:`__next__()` is
+ called and the result isn't available after *timeout* seconds from the
+ original call to :meth:`Executor.map`. *timeout* can be an int or a
+ float. If *timeout* is not specified or ``None``, there is no limit to
+ the wait time. If a call raises an exception, then that exception will
+ be raised when its value is retrieved from the iterator.
+
+ .. method:: shutdown(wait=True)
+
+ Signal the executor that it should free any resources that it is using
+ when the currently pending futures are done executing. Calls to
+ :meth:`Executor.submit` and :meth:`Executor.map` made after shutdown will
+ raise :exc:`RuntimeError`.
+
+ If *wait* is ``True`` then this method will not return until all the
+ pending futures are done executing and the resources associated with the
+ executor have been freed. If *wait* is ``False`` then this method will
+ return immediately and the resources associated with the executor will be
+ freed when all pending futures are done executing. Regardless of the
+ value of *wait*, the entire Python program will not exit until all
+ pending futures are done executing.
+
+ You can avoid having to call this method explicitly if you use the
+ :keyword:`with` statement, which will shutdown the :class:`Executor`
+ (waiting as if :meth:`Executor.shutdown` were called with *wait* set to
+ ``True``)::
+
+ import shutil
+ with ThreadPoolExecutor(max_workers=4) as e:
+ e.submit(shutil.copy, 'src1.txt', 'dest1.txt')
+ e.submit(shutil.copy, 'src2.txt', 'dest2.txt')
+ e.submit(shutil.copy, 'src3.txt', 'dest3.txt')
+ e.submit(shutil.copy, 'src3.txt', 'dest4.txt')
+
+
+ThreadPoolExecutor
+------------------
+
+:class:`ThreadPoolExecutor` is a :class:`Executor` subclass that uses a pool of
+threads to execute calls asynchronously.
+
+Deadlocks can occur when the callable associated with a :class:`Future` waits on
+the results of another :class:`Future`. For example::
+
+ import time
+ def wait_on_b():
+ time.sleep(5)
+ print(b.result()) # b will never complete because it is waiting on a.
+ return 5
+
+ def wait_on_a():
+ time.sleep(5)
+ print(a.result()) # a will never complete because it is waiting on b.
+ return 6
+
+
+ executor = ThreadPoolExecutor(max_workers=2)
+ a = executor.submit(wait_on_b)
+ b = executor.submit(wait_on_a)
+
+And::
+
+ def wait_on_future():
+ f = executor.submit(pow, 5, 2)
+ # This will never complete because there is only one worker thread and
+ # it is executing this function.
+ print(f.result())
+
+ executor = ThreadPoolExecutor(max_workers=1)
+ executor.submit(wait_on_future)
+
+
+.. class:: ThreadPoolExecutor(max_workers)
+
+ An :class:`Executor` subclass that uses a pool of at most *max_workers*
+ threads to execute calls asynchronously.
+
+
+.. _threadpoolexecutor-example:
+
+ThreadPoolExecutor Example
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+::
+
+ import concurrent.futures
+ import urllib.request
+
+ URLS = ['http://www.foxnews.com/',
+ 'http://www.cnn.com/',
+ 'http://europe.wsj.com/',
+ 'http://www.bbc.co.uk/',
+ 'http://some-made-up-domain.com/']
+
+ def load_url(url, timeout):
+ return urllib.request.urlopen(url, timeout=timeout).read()
+
+ with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
+ future_to_url = dict((executor.submit(load_url, url, 60), url)
+ for url in URLS)
+
+ for future in concurrent.futures.as_completed(future_to_url):
+ url = future_to_url[future]
+ if future.exception() is not None:
+ print('%r generated an exception: %s' % (url,
+ future.exception()))
+ else:
+ print('%r page is %d bytes' % (url, len(future.result())))
+
+
+ProcessPoolExecutor
+-------------------
+
+The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that
+uses a pool of processes to execute calls asynchronously.
+:class:`ProcessPoolExecutor` uses the :mod:`multiprocessing` module, which
+allows it to side-step the :term:`Global Interpreter Lock` but also means that
+only picklable objects can be executed and returned.
+
+Calling :class:`Executor` or :class:`Future` methods from a callable submitted
+to a :class:`ProcessPoolExecutor` will result in deadlock.
+
+.. class:: ProcessPoolExecutor(max_workers=None)
+
+ An :class:`Executor` subclass that executes calls asynchronously using a pool
+ of at most *max_workers* processes. If *max_workers* is ``None`` or not
+ given, it will default to the number of processors on the machine.
+
+
+.. _processpoolexecutor-example:
+
+ProcessPoolExecutor Example
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+::
+
+ import concurrent.futures
+ import math
+
+ PRIMES = [
+ 112272535095293,
+ 112582705942171,
+ 112272535095293,
+ 115280095190773,
+ 115797848077099,
+ 1099726899285419]
+
+ def is_prime(n):
+ if n % 2 == 0:
+ return False
+
+ sqrt_n = int(math.floor(math.sqrt(n)))
+ for i in range(3, sqrt_n + 1, 2):
+ if n % i == 0:
+ return False
+ return True
+
+ def main():
+ with concurrent.futures.ProcessPoolExecutor() as executor:
+ for number, prime in zip(PRIMES, executor.map(is_prime, PRIMES)):
+ print('%d is prime: %s' % (number, prime))
+
+ if __name__ == '__main__':
+ main()
+
+
+Future Objects
+--------------
+
+The :class:`Future` class encapsulates the asynchronous execution of a callable.
+:class:`Future` instances are created by :meth:`Executor.submit`.
+
+.. class:: Future
+
+ Encapsulates the asynchronous execution of a callable. :class:`Future`
+ instances are created by :meth:`Executor.submit` and should not be created
+ directly except for testing.
+
+ .. method:: cancel()
+
+ Attempt to cancel the call. If the call is currently being executed and
+ cannot be cancelled then the method will return ``False``, otherwise the
+ call will be cancelled and the method will return ``True``.
+
+ .. method:: cancelled()
+
+ Return ``True`` if the call was successfully cancelled.
+
+ .. method:: running()
+
+ Return ``True`` if the call is currently being executed and cannot be
+ cancelled.
+
+ .. method:: done()
+
+ Return ``True`` if the call was successfully cancelled or finished
+ running.
+
+ .. method:: result(timeout=None)
+
+ Return the value returned by the call. If the call hasn't yet completed
+ then this method will wait up to *timeout* seconds. If the call hasn't
+ completed in *timeout* seconds, then a :exc:`TimeoutError` will be
+ raised. *timeout* can be an int or float. If *timeout* is not specified
+ or ``None``, there is no limit to the wait time.
+
+ If the future is cancelled before completing then :exc:`CancelledError`
+ will be raised.
+
+ If the call raised, this method will raise the same exception.
+
+ .. method:: exception(timeout=None)
+
+ Return the exception raised by the call. If the call hasn't yet
+ completed then this method will wait up to *timeout* seconds. If the
+ call hasn't completed in *timeout* seconds, then a :exc:`TimeoutError`
+ will be raised. *timeout* can be an int or float. If *timeout* is not
+ specified or ``None``, there is no limit to the wait time.
+
+ If the future is cancelled before completing then :exc:`CancelledError`
+ will be raised.
+
+ If the call completed without raising, ``None`` is returned.
+
+ .. method:: add_done_callback(fn)
+
+ Attaches the callable *fn* to the future. *fn* will be called, with the
+ future as its only argument, when the future is cancelled or finishes
+ running.
+
+ Added callables are called in the order that they were added and are
+ always called in a thread belonging to the process that added them. If
+ the callable raises a :exc:`Exception` subclass, it will be logged and
+ ignored. If the callable raises a :exc:`BaseException` subclass, the
+ behavior is undefined.
+
+ If the future has already completed or been cancelled, *fn* will be
+ called immediately.
+
+ The following :class:`Future` methods are meant for use in unit tests and
+ :class:`Executor` implementations.
+
+ .. method:: set_running_or_notify_cancel()
+
+ This method should only be called by :class:`Executor` implementations
+ before executing the work associated with the :class:`Future` and by unit
+ tests.
+
+ If the method returns ``False`` then the :class:`Future` was cancelled,
+ i.e. :meth:`Future.cancel` was called and returned `True`. Any threads
+ waiting on the :class:`Future` completing (i.e. through
+ :func:`as_completed` or :func:`wait`) will be woken up.
+
+ If the method returns ``True`` then the :class:`Future` was not cancelled
+ and has been put in the running state, i.e. calls to
+ :meth:`Future.running` will return `True`.
+
+ This method can only be called once and cannot be called after
+ :meth:`Future.set_result` or :meth:`Future.set_exception` have been
+ called.
+
+ .. method:: set_result(result)
+
+ Sets the result of the work associated with the :class:`Future` to
+ *result*.
+
+ This method should only be used by :class:`Executor` implementations and
+ unit tests.
+
+ .. method:: set_exception(exception)
+
+ Sets the result of the work associated with the :class:`Future` to the
+ :class:`Exception` *exception*.
+
+ This method should only be used by :class:`Executor` implementations and
+ unit tests.
+
+
+Module Functions
+----------------
+
+.. function:: wait(fs, timeout=None, return_when=ALL_COMPLETED)
+
+ Wait for the :class:`Future` instances (possibly created by different
+ :class:`Executor` instances) given by *fs* to complete. Returns a named
+ 2-tuple of sets. The first set, named ``done``, contains the futures that
+ completed (finished or were cancelled) before the wait completed. The second
+ set, named ``not_done``, contains uncompleted futures.
+
+ *timeout* can be used to control the maximum number of seconds to wait before
+ returning. *timeout* can be an int or float. If *timeout* is not specified
+ or ``None``, there is no limit to the wait time.
+
+ *return_when* indicates when this function should return. It must be one of
+ the following constants:
+
+ +-----------------------------+----------------------------------------+
+ | Constant | Description |
+ +=============================+========================================+
+ | :const:`FIRST_COMPLETED` | The function will return when any |
+ | | future finishes or is cancelled. |
+ +-----------------------------+----------------------------------------+
+ | :const:`FIRST_EXCEPTION` | The function will return when any |
+ | | future finishes by raising an |
+ | | exception. If no future raises an |
+ | | exception then it is equivalent to |
+ | | :const:`ALL_COMPLETED`. |
+ +-----------------------------+----------------------------------------+
+ | :const:`ALL_COMPLETED` | The function will return when all |
+ | | futures finish or are cancelled. |
+ +-----------------------------+----------------------------------------+
+
+.. function:: as_completed(fs, timeout=None)
+
+ Returns an iterator over the :class:`Future` instances (possibly created by
+ different :class:`Executor` instances) given by *fs* that yields futures as
+ they complete (finished or were cancelled). Any futures that completed
+ before :func:`as_completed` is called will be yielded first. The returned
+ iterator raises a :exc:`TimeoutError` if :meth:`__next__` is called and the
+ result isn't available after *timeout* seconds from the original call to
+ :func:`as_completed`. *timeout* can be an int or float. If *timeout* is not
+ specified or ``None``, there is no limit to the wait time.
+
+
+.. seealso::
+
+ :pep:`3148` -- futures - execute computations asynchronously
+ The proposal which described this feature for inclusion in the Python
+ standard library.
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst
index 2cef232bb5..1a88bbd2d5 100644
--- a/Doc/library/configparser.rst
+++ b/Doc/library/configparser.rst
@@ -7,7 +7,9 @@
.. moduleauthor:: Ken Manheimer <klm@zope.com>
.. moduleauthor:: Barry Warsaw <bwarsaw@python.org>
.. moduleauthor:: Eric S. Raymond <esr@thyrsus.com>
+.. moduleauthor:: Åukasz Langa <lukasz@langa.pl>
.. sectionauthor:: Christopher G. Petrilli <petrilli@amber.org>
+.. sectionauthor:: Åukasz Langa <lukasz@langa.pl>
.. index::
pair: .ini; file
@@ -15,11 +17,10 @@
single: ini file
single: Windows ini file
-This module defines the class :class:`ConfigParser`. The :class:`ConfigParser`
-class implements a basic configuration file parser language which provides a
-structure similar to what you would find on Microsoft Windows INI files. You
-can use this to write Python programs which can be customized by end users
-easily.
+This module provides the :class:`ConfigParser` class which implements a basic
+configuration language which provides a structure similar to what's found in
+Microsoft Windows INI files. You can use this to write Python programs which
+can be customized by end users easily.
.. note::
@@ -36,444 +37,1234 @@ easily.
The json module implements a subset of JavaScript syntax which can also
be used for this purpose.
-The configuration file consists of sections, led by a ``[section]`` header and
-followed by ``name: value`` entries, with continuations in the style of
-:rfc:`822` (see section 3.1.1, "LONG HEADER FIELDS"); ``name=value`` is also
-accepted. Note that leading whitespace is removed from values. The optional
-values can contain format strings which refer to other values in the same
-section, or values in a special ``DEFAULT`` section. Additional defaults can be
-provided on initialization and retrieval. Lines beginning with ``'#'`` or
-``';'`` are ignored and may be used to provide comments.
-Configuration files may include comments, prefixed by specific characters (``#``
-and ``;``). Comments may appear on their own in an otherwise empty line, or may
-be entered in lines holding values or section names. In the latter case, they
-need to be preceded by a whitespace character to be recognized as a comment.
-(For backwards compatibility, only ``;`` starts an inline comment, while ``#``
-does not.)
+Quick Start
+-----------
+
+Let's take a very basic configuration file that looks like this:
+
+.. code-block:: ini
+
+ [DEFAULT]
+ ServerAliveInterval = 45
+ Compression = yes
+ CompressionLevel = 9
+ ForwardX11 = yes
+
+ [bitbucket.org]
+ User = hg
+
+ [topsecret.server.com]
+ Port = 50022
+ ForwardX11 = no
+
+The structure of INI files is described `in the following section
+<#supported-ini-file-structure>`_. Essentially, the file
+consists of sections, each of which contains keys with values.
+:mod:`configparser` classes can read and write such files. Let's start by
+creating the above configuration file programatically.
+
+.. doctest::
+
+ >>> import configparser
+ >>> config = configparser.ConfigParser()
+ >>> config['DEFAULT'] = {'ServerAliveInterval': '45',
+ ... 'Compression': 'yes',
+ ... 'CompressionLevel': '9'}
+ >>> config['bitbucket.org'] = {}
+ >>> config['bitbucket.org']['User'] = 'hg'
+ >>> config['topsecret.server.com'] = {}
+ >>> topsecret = config['topsecret.server.com']
+ >>> topsecret['Port'] = '50022' # mutates the parser
+ >>> topsecret['ForwardX11'] = 'no' # same here
+ >>> config['DEFAULT']['ForwardX11'] = 'yes'
+ >>> with open('example.ini', 'w') as configfile:
+ ... config.write(configfile)
+ ...
+
+As you can see, we can treat a config parser much like a dictionary.
+There are differences, `outlined later <#mapping-protocol-access>`_, but
+the behavior is very close to what you would expect from a dictionary.
+
+Now that we have created and saved a configuration file, let's read it
+back and explore the data it holds.
+
+.. doctest::
+
+ >>> import configparser
+ >>> config = configparser.ConfigParser()
+ >>> config.sections()
+ []
+ >>> config.read('example.ini')
+ ['example.ini']
+ >>> config.sections()
+ ['bitbucket.org', 'topsecret.server.com']
+ >>> 'bitbucket.org' in config
+ True
+ >>> 'bytebong.com' in config
+ False
+ >>> config['bitbucket.org']['User']
+ 'hg'
+ >>> config['DEFAULT']['Compression']
+ 'yes'
+ >>> topsecret = config['topsecret.server.com']
+ >>> topsecret['ForwardX11']
+ 'no'
+ >>> topsecret['Port']
+ '50022'
+ >>> for key in config['bitbucket.org']: print(key)
+ ...
+ user
+ compressionlevel
+ serveraliveinterval
+ compression
+ forwardx11
+ >>> config['bitbucket.org']['ForwardX11']
+ 'yes'
+
+As we can see above, the API is pretty straightforward. The only bit of magic
+involves the ``DEFAULT`` section which provides default values for all other
+sections [1]_. Note also that keys in sections are
+case-insensitive and stored in lowercase [1]_.
+
+
+Supported Datatypes
+-------------------
+
+Config parsers do not guess datatypes of values in configuration files, always
+storing them internally as strings. This means that if you need other
+datatypes, you should convert on your own:
+
+.. doctest::
+
+ >>> int(topsecret['Port'])
+ 50022
+ >>> float(topsecret['CompressionLevel'])
+ 9.0
+
+Extracting Boolean values is not that simple, though. Passing the value
+to ``bool()`` would do no good since ``bool('False')`` is still
+``True``. This is why config parsers also provide :meth:`getboolean`.
+This method is case-insensitive and recognizes Boolean values from
+``'yes'``/``'no'``, ``'on'``/``'off'`` and ``'1'``/``'0'`` [1]_.
+For example:
+
+.. doctest::
+
+ >>> topsecret.getboolean('ForwardX11')
+ False
+ >>> config['bitbucket.org'].getboolean('ForwardX11')
+ True
+ >>> config.getboolean('bitbucket.org', 'Compression')
+ True
+
+Apart from :meth:`getboolean`, config parsers also provide equivalent
+:meth:`getint` and :meth:`getfloat` methods, but these are far less
+useful since conversion using :func:`int` and :func:`float` is
+sufficient for these types.
+
+
+Fallback Values
+---------------
+
+As with a dictionary, you can use a section's :meth:`get` method to
+provide fallback values:
+
+.. doctest::
+
+ >>> topsecret.get('Port')
+ '50022'
+ >>> topsecret.get('CompressionLevel')
+ '9'
+ >>> topsecret.get('Cipher')
+ >>> topsecret.get('Cipher', '3des-cbc')
+ '3des-cbc'
+
+Please note that default values have precedence over fallback values.
+For instance, in our example the ``'CompressionLevel'`` key was
+specified only in the ``'DEFAULT'`` section. If we try to get it from
+the section ``'topsecret.server.com'``, we will always get the default,
+even if we specify a fallback:
+
+.. doctest::
+
+ >>> topsecret.get('CompressionLevel', '3')
+ '9'
+
+One more thing to be aware of is that the parser-level :meth:`get` method
+provides a custom, more complex interface, maintained for backwards
+compatibility. When using this method, a fallback value can be provided via
+the ``fallback`` keyword-only argument:
+
+.. doctest::
+
+ >>> config.get('bitbucket.org', 'monster',
+ ... fallback='No such things as monsters')
+ 'No such things as monsters'
+
+The same ``fallback`` argument can be used with the :meth:`getint`,
+:meth:`getfloat` and :meth:`getboolean` methods, for example:
+
+.. doctest::
+
+ >>> 'BatchMode' in topsecret
+ False
+ >>> topsecret.getboolean('BatchMode', fallback=True)
+ True
+ >>> config['DEFAULT']['BatchMode'] = 'no'
+ >>> topsecret.getboolean('BatchMode', fallback=True)
+ False
+
+
+Supported INI File Structure
+----------------------------
+
+A configuration file consists of sections, each led by a ``[section]`` header,
+followed by key/value entries separated by a specific string (``=`` or ``:`` by
+default [1]_). By default, section names are case sensitive but keys are not
+[1]_. Leading and trailing whitespace is removed from keys and values.
+Values can be omitted, in which case the key/value delimiter may also be left
+out. Values can also span multiple lines, as long as they are indented deeper
+than the first line of the value. Depending on the parser's mode, blank lines
+may be treated as parts of multiline values or ignored.
+
+Configuration files may include comments, prefixed by specific
+characters (``#`` and ``;`` by default [1]_). Comments may appear on
+their own on an otherwise empty line, possibly indented. [1]_
+
+For example:
+
+.. code-block:: ini
+
+ [Simple Values]
+ key=value
+ spaces in keys=allowed
+ spaces in values=allowed as well
+ spaces around the delimiter = obviously
+ you can also use : to delimit keys from values
+
+ [All Values Are Strings]
+ values like this: 1000000
+ or this: 3.14159265359
+ are they treated as numbers? : no
+ integers, floats and booleans are held as: strings
+ can use the API to get converted values directly: true
+
+ [Multiline Values]
+ chorus: I'm a lumberjack, and I'm okay
+ I sleep all night and I work all day
+
+ [No Values]
+ key_without_value
+ empty string value here =
-On top of the core functionality, :class:`SafeConfigParser` supports
-interpolation. This means values can contain format strings which refer to
-other values in the same section, or values in a special ``DEFAULT`` section.
-Additional defaults can be provided on initialization.
+ [You can use comments]
+ # like this
+ ; or this
-For example::
+ # By default only in an empty line.
+ # Inline comments can be harmful because they prevent users
+ # from using the delimiting characters as parts of values.
+ # That being said, this can be customized.
+
+ [Sections Can Be Indented]
+ can_values_be_as_well = True
+ does_that_mean_anything_special = False
+ purpose = formatting for readability
+ multiline_values = are
+ handled just fine as
+ long as they are indented
+ deeper than the first line
+ of a value
+ # Did I mention we can indent comments, too?
+
+
+Interpolation of values
+-----------------------
- [My Section]
- foodir: %(dir)s/whatever
- dir=frob
- long: this value continues
- in the next line
+On top of the core functionality, :class:`ConfigParser` supports
+interpolation. This means values can be preprocessed before returning them
+from ``get()`` calls.
-would resolve the ``%(dir)s`` to the value of ``dir`` (``frob`` in this case).
-All reference expansions are done on demand.
+.. class:: BasicInterpolation()
-Default values can be specified by passing them into the :class:`ConfigParser`
-constructor as a dictionary. Additional defaults may be passed into the
-:meth:`get` method which will override all others.
+ The default implementation used by :class:`ConfigParser`. It enables
+ values to contain format strings which refer to other values in the same
+ section, or values in the special default section [1]_. Additional default
+ values can be provided on initialization.
-Sections are normally stored in a built-in dictionary. An alternative dictionary
-type can be passed to the :class:`ConfigParser` constructor. For example, if a
-dictionary type is passed that sorts its keys, the sections will be sorted on
-write-back, as will be the keys within each section.
+ For example:
+ .. code-block:: ini
-.. class:: RawConfigParser(defaults=None, dict_type=collections.OrderedDict)
+ [Paths]
+ home_dir: /Users
+ my_dir: %(home_dir)s/lumberjack
+ my_pictures: %(my_dir)s/Pictures
- The basic configuration object. When *defaults* is given, it is initialized
- into the dictionary of intrinsic defaults. When *dict_type* is given, it will
- be used to create the dictionary objects for the list of sections, for the
- options within a section, and for the default values. This class does not
- support the magical interpolation behavior.
- .. versionchanged:: 3.1
- The default *dict_type* is :class:`collections.OrderedDict`.
+ In the example above, :class:`ConfigParser` with *interpolation* set to
+ ``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of
+ ``home_dir`` (``/Users`` in this case). ``%(my_dir)s`` in effect would
+ resolve to ``/Users/lumberjack``. All interpolations are done on demand so
+ keys used in the chain of references do not have to be specified in any
+ specific order in the configuration file.
+ With ``interpolation`` set to ``None``, the parser would simply return
+ ``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and
+ ``%(home_dir)s/lumberjack`` as the value of ``my_dir``.
-.. class:: ConfigParser(defaults=None, dict_type=collections.OrderedDict)
+.. class:: ExtendedInterpolation()
- Derived class of :class:`RawConfigParser` that implements the magical
- interpolation feature and adds optional arguments to the :meth:`get` and
- :meth:`items` methods. The values in *defaults* must be appropriate for the
- ``%()s`` string interpolation. Note that *__name__* is an intrinsic default;
- its value is the section name, and will override any value provided in
- *defaults*.
+ An alternative handler for interpolation which implements a more advanced
+ syntax, used for instance in ``zc.buildout``. Extended interpolation is
+ using ``${section:option}`` to denote a value from a foreign section.
+ Interpolation can span multiple levels. For convenience, if the ``section:``
+ part is omitted, interpolation defaults to the current section (and possibly
+ the default values from the special section).
- All option names used in interpolation will be passed through the
- :meth:`optionxform` method just like any other option name reference. For
- example, using the default implementation of :meth:`optionxform` (which converts
- option names to lower case), the values ``foo %(bar)s`` and ``foo %(BAR)s`` are
- equivalent.
+ For example, the configuration specified above with basic interpolation,
+ would look like this with extended interpolation:
- .. versionchanged:: 3.1
- The default *dict_type* is :class:`collections.OrderedDict`.
+ .. code-block:: ini
+
+ [Paths]
+ home_dir: /Users
+ my_dir: ${home_dir}/lumberjack
+ my_pictures: ${my_dir}/Pictures
+
+ Values from other sections can be fetched as well:
+
+ .. code-block:: ini
+
+ [Common]
+ home_dir: /Users
+ library_dir: /Library
+ system_dir: /System
+ macports_dir: /opt/local
+ [Frameworks]
+ Python: 3.2
+ path: ${Common:system_dir}/Library/Frameworks/
-.. class:: SafeConfigParser(defaults=None, dict_type=collections.OrderedDict)
+ [Arthur]
+ nickname: Two Sheds
+ last_name: Jackson
+ my_dir: ${Common:home_dir}/twosheds
+ my_pictures: ${my_dir}/Pictures
+ python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}
- Derived class of :class:`ConfigParser` that implements a more-sane variant of
- the magical interpolation feature. This implementation is more predictable as
- well. New applications should prefer this version if they don't need to be
- compatible with older versions of Python.
+Mapping Protocol Access
+-----------------------
+
+.. versionadded:: 3.2
+
+Mapping protocol access is a generic name for functionality that enables using
+custom objects as if they were dictionaries. In case of :mod:`configparser`,
+the mapping interface implementation is using the
+``parser['section']['option']`` notation.
+
+``parser['section']`` in particular returns a proxy for the section's data in
+the parser. This means that the values are not copied but they are taken from
+the original parser on demand. What's even more important is that when values
+are changed on a section proxy, they are actually mutated in the original
+parser.
+
+:mod:`configparser` objects behave as close to actual dictionaries as possible.
+The mapping interface is complete and adheres to the ``MutableMapping`` ABC.
+However, there are a few differences that should be taken into account:
+
+* By default, all keys in sections are accessible in a case-insensitive manner
+ [1]_. E.g. ``for option in parser["section"]`` yields only ``optionxform``'ed
+ option key names. This means lowercased keys by default. At the same time,
+ for a section that holds the key ``'a'``, both expressions return ``True``::
+
+ "a" in parser["section"]
+ "A" in parser["section"]
+
+* All sections include ``DEFAULTSECT`` values as well which means that
+ ``.clear()`` on a section may not leave the section visibly empty. This is
+ because default values cannot be deleted from the section (because technically
+ they are not there). If they are overriden in the section, deleting causes
+ the default value to be visible again. Trying to delete a default value
+ causes a ``KeyError``.
+
+* Trying to delete the ``DEFAULTSECT`` raises ``ValueError``.
+
+* ``parser.get(section, option, **kwargs)`` - the second argument is **not**
+ a fallback value. Note however that the section-level ``get()`` methods are
+ compatible both with the mapping protocol and the classic configparser API.
+
+* ``parser.items()`` is compatible with the mapping protocol (returns a list of
+ *section_name*, *section_proxy* pairs including the DEFAULTSECT). However,
+ this method can also be invoked with arguments: ``parser.items(section, raw,
+ vars)``. The latter call returns a list of *option*, *value* pairs for
+ a specified ``section``, with all interpolations expanded (unless
+ ``raw=True`` is provided).
+
+The mapping protocol is implemented on top of the existing legacy API so that
+subclasses overriding the original interface still should have mappings working
+as expected.
+
+
+Customizing Parser Behaviour
+----------------------------
+
+There are nearly as many INI format variants as there are applications using it.
+:mod:`configparser` goes a long way to provide support for the largest sensible
+set of INI styles available. The default functionality is mainly dictated by
+historical background and it's very likely that you will want to customize some
+of the features.
+
+The most common way to change the way a specific config parser works is to use
+the :meth:`__init__` options:
+
+* *defaults*, default value: ``None``
+
+ This option accepts a dictionary of key-value pairs which will be initially
+ put in the ``DEFAULT`` section. This makes for an elegant way to support
+ concise configuration files that don't specify values which are the same as
+ the documented default.
+
+ Hint: if you want to specify default values for a specific section, use
+ :meth:`read_dict` before you read the actual file.
+
+* *dict_type*, default value: :class:`collections.OrderedDict`
+
+ This option has a major impact on how the mapping protocol will behave and how
+ the written configuration files look. With the default ordered
+ dictionary, every section is stored in the order they were added to the
+ parser. Same goes for options within sections.
+
+ An alternative dictionary type can be used for example to sort sections and
+ options on write-back. You can also use a regular dictionary for performance
+ reasons.
+
+ Please note: there are ways to add a set of key-value pairs in a single
+ operation. When you use a regular dictionary in those operations, the order
+ of the keys may be random. For example:
+
+ .. doctest::
+
+ >>> parser = configparser.ConfigParser()
+ >>> parser.read_dict({'section1': {'key1': 'value1',
+ ... 'key2': 'value2',
+ ... 'key3': 'value3'},
+ ... 'section2': {'keyA': 'valueA',
+ ... 'keyB': 'valueB',
+ ... 'keyC': 'valueC'},
+ ... 'section3': {'foo': 'x',
+ ... 'bar': 'y',
+ ... 'baz': 'z'}
+ ... })
+ >>> parser.sections()
+ ['section3', 'section2', 'section1']
+ >>> [option for option in parser['section3']]
+ ['baz', 'foo', 'bar']
+
+ In these operations you need to use an ordered dictionary as well:
+
+ .. doctest::
+
+ >>> from collections import OrderedDict
+ >>> parser = configparser.ConfigParser()
+ >>> parser.read_dict(
+ ... OrderedDict((
+ ... ('s1',
+ ... OrderedDict((
+ ... ('1', '2'),
+ ... ('3', '4'),
+ ... ('5', '6'),
+ ... ))
+ ... ),
+ ... ('s2',
+ ... OrderedDict((
+ ... ('a', 'b'),
+ ... ('c', 'd'),
+ ... ('e', 'f'),
+ ... ))
+ ... ),
+ ... ))
+ ... )
+ >>> parser.sections()
+ ['s1', 's2']
+ >>> [option for option in parser['s1']]
+ ['1', '3', '5']
+ >>> [option for option in parser['s2'].values()]
+ ['b', 'd', 'f']
+
+* *allow_no_value*, default value: ``False``
+
+ Some configuration files are known to include settings without values, but
+ which otherwise conform to the syntax supported by :mod:`configparser`. The
+ *allow_no_value* parameter to the constructor can be used to
+ indicate that such values should be accepted:
+
+ .. doctest::
+
+ >>> import configparser
+
+ >>> sample_config = """
+ ... [mysqld]
+ ... user = mysql
+ ... pid-file = /var/run/mysqld/mysqld.pid
+ ... skip-external-locking
+ ... old_passwords = 1
+ ... skip-bdb
+ ... # we don't need ACID today
+ ... skip-innodb
+ ... """
+ >>> config = configparser.ConfigParser(allow_no_value=True)
+ >>> config.read_string(sample_config)
+
+ >>> # Settings with values are treated as before:
+ >>> config["mysqld"]["user"]
+ 'mysql'
+
+ >>> # Settings without values provide None:
+ >>> config["mysqld"]["skip-bdb"]
+
+ >>> # Settings which aren't specified still raise an error:
+ >>> config["mysqld"]["does-not-exist"]
+ Traceback (most recent call last):
+ ...
+ KeyError: 'does-not-exist'
+
+* *delimiters*, default value: ``('=', ':')``
+
+ Delimiters are substrings that delimit keys from values within a section. The
+ first occurence of a delimiting substring on a line is considered a delimiter.
+ This means values (but not keys) can contain the delimiters.
+
+ See also the *space_around_delimiters* argument to
+ :meth:`ConfigParser.write`.
+
+* *comment_prefixes*, default value: ``('#', ';')``
+
+* *inline_comment_prefixes*, default value: ``None``
+
+ Comment prefixes are strings that indicate the start of a valid comment within
+ a config file. *comment_prefixes* are used only on otherwise empty lines
+ (optionally indented) whereas *inline_comment_prefixes* can be used after
+ every valid value (e.g. section names, options and empty lines as well). By
+ default inline comments are disabled and ``'#'`` and ``';'`` are used as
+ prefixes for whole line comments.
+
+ .. versionchanged:: 3.2
+ In previous versions of :mod:`configparser` behaviour matched
+ ``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``.
+
+ Please note that config parsers don't support escaping of comment prefixes so
+ using *inline_comment_prefixes* may prevent users from specifying option
+ values with characters used as comment prefixes. When in doubt, avoid setting
+ *inline_comment_prefixes*. In any circumstances, the only way of storing
+ comment prefix characters at the beginning of a line in multiline values is to
+ interpolate the prefix, for example::
+
+ >>> from configparser import ConfigParser, ExtendedInterpolation
+ >>> parser = ConfigParser(interpolation=ExtendedInterpolation())
+ >>> # the default BasicInterpolation could be used as well
+ >>> parser.read_string("""
+ ... [DEFAULT]
+ ... hash = #
+ ...
+ ... [hashes]
+ ... shebang =
+ ... ${hash}!/usr/bin/env python
+ ... ${hash} -*- coding: utf-8 -*-
+ ...
+ ... extensions =
+ ... enabled_extension
+ ... another_extension
+ ... #disabled_by_comment
+ ... yet_another_extension
+ ...
+ ... interpolation not necessary = if # is not at line start
+ ... even in multiline values = line #1
+ ... line #2
+ ... line #3
+ ... """)
+ >>> print(parser['hashes']['shebang'])
+
+ #!/usr/bin/env python
+ # -*- coding: utf-8 -*-
+ >>> print(parser['hashes']['extensions'])
+
+ enabled_extension
+ another_extension
+ yet_another_extension
+ >>> print(parser['hashes']['interpolation not necessary'])
+ if # is not at line start
+ >>> print(parser['hashes']['even in multiline values'])
+ line #1
+ line #2
+ line #3
+
+* *strict*, default value: ``True``
+
+ When set to ``True``, the parser will not allow for any section or option
+ duplicates while reading from a single source (using :meth:`read_file`,
+ :meth:`read_string` or :meth:`read_dict`). It is recommended to use strict
+ parsers in new applications.
+
+ .. versionchanged:: 3.2
+ In previous versions of :mod:`configparser` behaviour matched
+ ``strict=False``.
+
+* *empty_lines_in_values*, default value: ``True``
+
+ In config parsers, values can span multiple lines as long as they are
+ indented more than the key that holds them. By default parsers also let
+ empty lines to be parts of values. At the same time, keys can be arbitrarily
+ indented themselves to improve readability. In consequence, when
+ configuration files get big and complex, it is easy for the user to lose
+ track of the file structure. Take for instance:
+
+ .. code-block:: ini
+
+ [Section]
+ key = multiline
+ value with a gotcha
+
+ this = is still a part of the multiline value of 'key'
+
+ This can be especially problematic for the user to see if she's using a
+ proportional font to edit the file. That is why when your application does
+ not need values with empty lines, you should consider disallowing them. This
+ will make empty lines split keys every time. In the example above, it would
+ produce two keys, ``key`` and ``this``.
+
+* *default_section*, default value: ``configparser.DEFAULTSECT`` (that is:
+ ``"DEFAULT"``)
+
+ The convention of allowing a special section of default values for other
+ sections or interpolation purposes is a powerful concept of this library,
+ letting users create complex declarative configurations. This section is
+ normally called ``"DEFAULT"`` but this can be customized to point to any
+ other valid section name. Some typical values include: ``"general"`` or
+ ``"common"``. The name provided is used for recognizing default sections when
+ reading from any source and is used when writing configuration back to
+ a file. Its current value can be retrieved using the
+ ``parser_instance.default_section`` attribute and may be modified at runtime
+ (i.e. to convert files from one format to another).
+
+* *interpolation*, default value: ``configparser.BasicInterpolation``
+
+ Interpolation behaviour may be customized by providing a custom handler
+ through the *interpolation* argument. ``None`` can be used to turn off
+ interpolation completely, ``ExtendedInterpolation()`` provides a more
+ advanced variant inspired by ``zc.buildout``. More on the subject in the
+ `dedicated documentation section <#interpolation-of-values>`_.
+ :class:`RawConfigParser` has a default value of ``None``.
+
+
+More advanced customization may be achieved by overriding default values of
+these parser attributes. The defaults are defined on the classes, so they
+may be overriden by subclasses or by attribute assignment.
+
+.. attribute:: BOOLEAN_STATES
+
+ By default when using :meth:`getboolean`, config parsers consider the
+ following values ``True``: ``'1'``, ``'yes'``, ``'true'``, ``'on'`` and the
+ following values ``False``: ``'0'``, ``'no'``, ``'false'``, ``'off'``. You
+ can override this by specifying a custom dictionary of strings and their
+ Boolean outcomes. For example:
+
+ .. doctest::
+
+ >>> custom = configparser.ConfigParser()
+ >>> custom['section1'] = {'funky': 'nope'}
+ >>> custom['section1'].getboolean('funky')
+ Traceback (most recent call last):
+ ...
+ ValueError: Not a boolean: nope
+ >>> custom.BOOLEAN_STATES = {'sure': True, 'nope': False}
+ >>> custom['section1'].getboolean('funky')
+ False
+
+ Other typical Boolean pairs include ``accept``/``reject`` or
+ ``enabled``/``disabled``.
+
+.. method:: optionxform(option)
+
+ This method transforms option names on every read, get, or set
+ operation. The default converts the name to lowercase. This also
+ means that when a configuration file gets written, all keys will be
+ lowercase. Override this method if that's unsuitable.
+ For example:
+
+ .. doctest::
+
+ >>> config = """
+ ... [Section1]
+ ... Key = Value
+ ...
+ ... [Section2]
+ ... AnotherKey = Value
+ ... """
+ >>> typical = configparser.ConfigParser()
+ >>> typical.read_string(config)
+ >>> list(typical['Section1'].keys())
+ ['key']
+ >>> list(typical['Section2'].keys())
+ ['anotherkey']
+ >>> custom = configparser.RawConfigParser()
+ >>> custom.optionxform = lambda option: option
+ >>> custom.read_string(config)
+ >>> list(custom['Section1'].keys())
+ ['Key']
+ >>> list(custom['Section2'].keys())
+ ['AnotherKey']
+
+.. attribute:: SECTCRE
+
+ A compiled regular expression used to parse section headers. The default
+ matches ``[section]`` to the name ``"section"``. Whitespace is considered part
+ of the section name, thus ``[ larch ]`` will be read as a section of name
+ ``" larch "``. Override this attribute if that's unsuitable. For example:
+
+ .. doctest::
+
+ >>> config = """
+ ... [Section 1]
+ ... option = value
+ ...
+ ... [ Section 2 ]
+ ... another = val
+ ... """
+ >>> typical = ConfigParser()
+ >>> typical.read_string(config)
+ >>> typical.sections()
+ ['Section 1', ' Section 2 ']
+ >>> custom = ConfigParser()
+ >>> custom.SECTCRE = re.compile(r"\[ *(?P<header>[^]]+?) *\]")
+ >>> custom.read_string(config)
+ >>> custom.sections()
+ ['Section 1', 'Section 2']
+
+ .. note::
+
+ While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing
+ option lines, it's not recommended to override it because that would
+ interfere with constructor options *allow_no_value* and *delimiters*.
+
+
+Legacy API Examples
+-------------------
+
+Mainly because of backwards compatibility concerns, :mod:`configparser`
+provides also a legacy API with explicit ``get``/``set`` methods. While there
+are valid use cases for the methods outlined below, mapping protocol access is
+preferred for new projects. The legacy API is at times more advanced,
+low-level and downright counterintuitive.
+
+An example of writing to a configuration file::
+
+ import configparser
- .. XXX Need to explain what's safer/more predictable about it.
+ config = configparser.RawConfigParser()
+
+ # Please note that using RawConfigParser's set functions, you can assign
+ # non-string values to keys internally, but will receive an error when
+ # attempting to write to a file or when you get it in non-raw mode. Setting
+ # values using the mapping protocol or ConfigParser's set() does not allow
+ # such assignments to take place.
+ config.add_section('Section1')
+ config.set('Section1', 'int', '15')
+ config.set('Section1', 'bool', 'true')
+ config.set('Section1', 'float', '3.1415')
+ config.set('Section1', 'baz', 'fun')
+ config.set('Section1', 'bar', 'Python')
+ config.set('Section1', 'foo', '%(bar)s is %(baz)s!')
+
+ # Writing our configuration file to 'example.cfg'
+ with open('example.cfg', 'w') as configfile:
+ config.write(configfile)
+
+An example of reading the configuration file again::
+
+ import configparser
+
+ config = configparser.RawConfigParser()
+ config.read('example.cfg')
+
+ # getfloat() raises an exception if the value is not a float
+ # getint() and getboolean() also do this for their respective types
+ float = config.getfloat('Section1', 'float')
+ int = config.getint('Section1', 'int')
+ print(float + int)
+
+ # Notice that the next output does not interpolate '%(bar)s' or '%(baz)s'.
+ # This is because we are using a RawConfigParser().
+ if config.getboolean('Section1', 'bool'):
+ print(config.get('Section1', 'foo'))
+
+To get interpolation, use :class:`ConfigParser`::
+
+ import configparser
+
+ cfg = configparser.ConfigParser()
+ cfg.read('example.cfg')
+
+ # Set the optional `raw` argument of get() to True if you wish to disable
+ # interpolation in a single get operation.
+ print(cfg.get('Section1', 'foo', raw=False)) # -> "Python is fun!"
+ print(cfg.get('Section1', 'foo', raw=True)) # -> "%(bar)s is %(baz)s!"
+
+ # The optional `vars` argument is a dict with members that will take
+ # precedence in interpolation.
+ print(cfg.get('Section1', 'foo', vars={'bar': 'Documentation',
+ 'baz': 'evil'}))
+
+ # The optional `fallback` argument can be used to provide a fallback value
+ print(cfg.get('Section1', 'foo'))
+ # -> "Python is fun!"
+
+ print(cfg.get('Section1', 'foo', fallback='Monty is not.'))
+ # -> "Python is fun!"
+
+ print(cfg.get('Section1', 'monster', fallback='No such things as monsters.'))
+ # -> "No such things as monsters."
+
+ # A bare print(cfg.get('Section1', 'monster')) would raise NoOptionError
+ # but we can also use:
+
+ print(cfg.get('Section1', 'monster', fallback=None))
+ # -> None
+
+Default values are available in both types of ConfigParsers. They are used in
+interpolation if an option used is not defined elsewhere. ::
+
+ import configparser
+
+ # New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each
+ config = configparser.ConfigParser({'bar': 'Life', 'baz': 'hard'})
+ config.read('example.cfg')
+
+ print(config.get('Section1', 'foo')) # -> "Python is fun!"
+ config.remove_option('Section1', 'bar')
+ config.remove_option('Section1', 'baz')
+ print(config.get('Section1', 'foo')) # -> "Life is hard!"
+
+
+.. _configparser-objects:
+
+ConfigParser Objects
+--------------------
+
+.. class:: ConfigParser(defaults=None, dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=configparser.DEFAULTSECT, interpolation=BasicInterpolation())
+
+ The main configuration parser. When *defaults* is given, it is initialized
+ into the dictionary of intrinsic defaults. When *dict_type* is given, it
+ will be used to create the dictionary objects for the list of sections, for
+ the options within a section, and for the default values.
+
+ When *delimiters* is given, it is used as the set of substrings that
+ divide keys from values. When *comment_prefixes* is given, it will be used
+ as the set of substrings that prefix comments in otherwise empty lines.
+ Comments can be indented. When *inline_comment_prefixes* is given, it will be
+ used as the set of substrings that prefix comments in non-empty lines.
+
+ line and inline comments. For backwards compatibility, the default value for
+ *comment_prefixes* is a special value that indicates that ``;`` and ``#`` can
+ start whole line comments while only ``;`` can start inline comments.
+
+ When *strict* is ``True`` (the default), the parser won't allow for
+ any section or option duplicates while reading from a single source (file,
+ string or dictionary), raising :exc:`DuplicateSectionError` or
+ :exc:`DuplicateOptionError`. When *empty_lines_in_values* is ``False``
+ (default: ``True``), each empty line marks the end of an option. Otherwise,
+ internal empty lines of a multiline option are kept as part of the value.
+ When *allow_no_value* is ``True`` (default: ``False``), options without
+ values are accepted; the value held for these is ``None`` and they are
+ serialized without the trailing delimiter.
+
+ When *default_section* is given, it specifies the name for the special
+ section holding default values for other sections and interpolation purposes
+ (normally named ``"DEFAULT"``). This value can be retrieved and changed on
+ runtime using the ``default_section`` instance attribute.
+
+ Interpolation behaviour may be customized by providing a custom handler
+ through the *interpolation* argument. ``None`` can be used to turn off
+ interpolation completely, ``ExtendedInterpolation()`` provides a more
+ advanced variant inspired by ``zc.buildout``. More on the subject in the
+ `dedicated documentation section <#interpolation-of-values>`_.
+
+ All option names used in interpolation will be passed through the
+ :meth:`optionxform` method just like any other option name reference. For
+ example, using the default implementation of :meth:`optionxform` (which
+ converts option names to lower case), the values ``foo %(bar)s`` and ``foo
+ %(BAR)s`` are equivalent.
.. versionchanged:: 3.1
The default *dict_type* is :class:`collections.OrderedDict`.
+ .. versionchanged:: 3.2
+ *allow_no_value*, *delimiters*, *comment_prefixes*, *strict*,
+ *empty_lines_in_values*, *default_section* and *interpolation* were
+ added.
-.. exception:: Error
- Base class for all other configparser exceptions.
+ .. method:: defaults()
+ Return a dictionary containing the instance-wide defaults.
-.. exception:: NoSectionError
- Exception raised when a specified section is not found.
+ .. method:: sections()
+ Return a list of the sections available; the *default section* is not
+ included in the list.
-.. exception:: DuplicateSectionError
- Exception raised if :meth:`add_section` is called with the name of a section
- that is already present.
+ .. method:: add_section(section)
+ Add a section named *section* to the instance. If a section by the given
+ name already exists, :exc:`DuplicateSectionError` is raised. If the
+ *default section* name is passed, :exc:`ValueError` is raised. The name
+ of the section must be a string; if not, :exc:`TypeError` is raised.
-.. exception:: NoOptionError
+ .. versionchanged:: 3.2
+ Non-string section names raise :exc:`TypeError`.
- Exception raised when a specified option is not found in the specified section.
+ .. method:: has_section(section)
-.. exception:: InterpolationError
+ Indicates whether the named *section* is present in the configuration.
+ The *default section* is not acknowledged.
- Base class for exceptions raised when problems occur performing string
- interpolation.
+ .. method:: options(section)
-.. exception:: InterpolationDepthError
+ Return a list of options available in the specified *section*.
- Exception raised when string interpolation cannot be completed because the
- number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of
- :exc:`InterpolationError`.
+ .. method:: has_option(section, option)
-.. exception:: InterpolationMissingOptionError
+ If the given *section* exists, and contains the given *option*, return
+ :const:`True`; otherwise return :const:`False`. If the specified
+ *section* is :const:`None` or an empty string, DEFAULT is assumed.
- Exception raised when an option referenced from a value does not exist. Subclass
- of :exc:`InterpolationError`.
+ .. method:: read(filenames, encoding=None)
-.. exception:: InterpolationSyntaxError
+ Attempt to read and parse a list of filenames, returning a list of
+ filenames which were successfully parsed. If *filenames* is a string, it
+ is treated as a single filename. If a file named in *filenames* cannot
+ be opened, that file will be ignored. This is designed so that you can
+ specify a list of potential configuration file locations (for example,
+ the current directory, the user's home directory, and some system-wide
+ directory), and all existing configuration files in the list will be
+ read. If none of the named files exist, the :class:`ConfigParser`
+ instance will contain an empty dataset. An application which requires
+ initial values to be loaded from a file should load the required file or
+ files using :meth:`read_file` before calling :meth:`read` for any
+ optional files::
- Exception raised when the source text into which substitutions are made does not
- conform to the required syntax. Subclass of :exc:`InterpolationError`.
+ import configparser, os
+ config = configparser.ConfigParser()
+ config.read_file(open('defaults.cfg'))
+ config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],
+ encoding='cp1250')
-.. exception:: MissingSectionHeaderError
+ .. versionadded:: 3.2
+ The *encoding* parameter. Previously, all files were read using the
+ default encoding for :func:`open`.
- Exception raised when attempting to parse a file which has no section headers.
+ .. method:: read_file(f, source=None)
-.. exception:: ParsingError
+ Read and parse configuration data from *f* which must be an iterable
+ yielding Unicode strings (for example files opened in text mode).
- Exception raised when errors occur attempting to parse a file.
+ Optional argument *source* specifies the name of the file being read. If
+ not given and *f* has a :attr:`name` attribute, that is used for
+ *source*; the default is ``'<???>'``.
+ .. versionadded:: 3.2
+ Replaces :meth:`readfp`.
-.. data:: MAX_INTERPOLATION_DEPTH
+ .. method:: read_string(string, source='<string>')
- The maximum depth for recursive interpolation for :meth:`get` when the *raw*
- parameter is false. This is relevant only for the :class:`ConfigParser` class.
+ Parse configuration data from a string.
+ Optional argument *source* specifies a context-specific name of the
+ string passed. If not given, ``'<string>'`` is used. This should
+ commonly be a filesystem path or a URL.
-.. seealso::
+ .. versionadded:: 3.2
- Module :mod:`shlex`
- Support for a creating Unix shell-like mini-languages which can be used as an
- alternate format for application configuration files.
+ .. method:: read_dict(dictionary, source='<dict>')
-.. _rawconfigparser-objects:
+ Load configuration from any object that provides a dict-like ``items()``
+ method. Keys are section names, values are dictionaries with keys and
+ values that should be present in the section. If the used dictionary
+ type preserves order, sections and their keys will be added in order.
+ Values are automatically converted to strings.
-RawConfigParser Objects
------------------------
+ Optional argument *source* specifies a context-specific name of the
+ dictionary passed. If not given, ``<dict>`` is used.
-:class:`RawConfigParser` instances have the following methods:
+ This method can be used to copy state between parsers.
+ .. versionadded:: 3.2
-.. method:: RawConfigParser.defaults()
- Return a dictionary containing the instance-wide defaults.
+ .. method:: get(section, option, raw=False, [vars, fallback])
+ Get an *option* value for the named *section*. If *vars* is provided, it
+ must be a dictionary. The *option* is looked up in *vars* (if provided),
+ *section*, and in *DEFAULTSECT* in that order. If the key is not found
+ and *fallback* is provided, it is used as a fallback value. ``None`` can
+ be provided as a *fallback* value.
-.. method:: RawConfigParser.sections()
+ All the ``'%'`` interpolations are expanded in the return values, unless
+ the *raw* argument is true. Values for interpolation keys are looked up
+ in the same manner as the option.
- Return a list of the sections available; ``DEFAULT`` is not included in the
- list.
+ .. versionchanged:: 3.2
+ Arguments *raw*, *vars* and *fallback* are keyword only to protect
+ users from trying to use the third argument as the *fallback* fallback
+ (especially when using the mapping protocol).
-.. method:: RawConfigParser.add_section(section)
+ .. method:: getint(section, option, raw=False, [vars, fallback])
- Add a section named *section* to the instance. If a section by the given name
- already exists, :exc:`DuplicateSectionError` is raised. If the name
- ``DEFAULT`` (or any of it's case-insensitive variants) is passed,
- :exc:`ValueError` is raised.
+ A convenience method which coerces the *option* in the specified *section*
+ to an integer. See :meth:`get` for explanation of *raw*, *vars* and
+ *fallback*.
-.. method:: RawConfigParser.has_section(section)
- Indicates whether the named section is present in the configuration. The
- ``DEFAULT`` section is not acknowledged.
+ .. method:: getfloat(section, option, raw=False, [vars, fallback])
+ A convenience method which coerces the *option* in the specified *section*
+ to a floating point number. See :meth:`get` for explanation of *raw*,
+ *vars* and *fallback*.
-.. method:: RawConfigParser.options(section)
- Returns a list of options available in the specified *section*.
+ .. method:: getboolean(section, option, raw=False, [vars, fallback])
+ A convenience method which coerces the *option* in the specified *section*
+ to a Boolean value. Note that the accepted values for the option are
+ ``'1'``, ``'yes'``, ``'true'``, and ``'on'``, which cause this method to
+ return ``True``, and ``'0'``, ``'no'``, ``'false'``, and ``'off'``, which
+ cause it to return ``False``. These string values are checked in a
+ case-insensitive manner. Any other value will cause it to raise
+ :exc:`ValueError`. See :meth:`get` for explanation of *raw*, *vars* and
+ *fallback*.
-.. method:: RawConfigParser.has_option(section, option)
- If the given section exists, and contains the given option, return
- :const:`True`; otherwise return :const:`False`.
+ .. method:: items([section], raw=False, vars=None)
+ When *section* is not given, return a list of *section_name*,
+ *section_proxy* pairs, including DEFAULTSECT.
-.. method:: RawConfigParser.read(filenames)
+ Otherwise, return a list of *name*, *value* pairs for the options in the
+ given *section*. Optional arguments have the same meaning as for the
+ :meth:`get` method.
- Attempt to read and parse a list of filenames, returning a list of filenames
- which were successfully parsed. If *filenames* is a string,
- it is treated as a single filename. If a file named in *filenames* cannot be
- opened, that file will be ignored. This is designed so that you can specify a
- list of potential configuration file locations (for example, the current
- directory, the user's home directory, and some system-wide directory), and all
- existing configuration files in the list will be read. If none of the named
- files exist, the :class:`ConfigParser` instance will contain an empty dataset.
- An application which requires initial values to be loaded from a file should
- load the required file or files using :meth:`readfp` before calling :meth:`read`
- for any optional files::
- import configparser, os
+ .. method:: set(section, option, value)
- config = configparser.ConfigParser()
- config.readfp(open('defaults.cfg'))
- config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')])
+ If the given section exists, set the given option to the specified value;
+ otherwise raise :exc:`NoSectionError`. *option* and *value* must be
+ strings; if not, :exc:`TypeError` is raised.
-.. method:: RawConfigParser.readfp(fp, filename=None)
+ .. method:: write(fileobject, space_around_delimiters=True)
- Read and parse configuration data from the file or file-like object in *fp*
- (only the :meth:`readline` method is used). The file-like object must
- operate in text mode, i.e. return strings from :meth:`readline`.
+ Write a representation of the configuration to the specified :term:`file
+ object`, which must be opened in text mode (accepting strings). This
+ representation can be parsed by a future :meth:`read` call. If
+ *space_around_delimiters* is true, delimiters between
+ keys and values are surrounded by spaces.
- If *filename* is omitted and *fp* has a :attr:`name` attribute, that is used
- for *filename*; the default is ``<???>``.
+ .. method:: remove_option(section, option)
-.. method:: RawConfigParser.get(section, option)
+ Remove the specified *option* from the specified *section*. If the
+ section does not exist, raise :exc:`NoSectionError`. If the option
+ existed to be removed, return :const:`True`; otherwise return
+ :const:`False`.
- Get an *option* value for the named *section*.
+ .. method:: remove_section(section)
-.. method:: RawConfigParser.getint(section, option)
+ Remove the specified *section* from the configuration. If the section in
+ fact existed, return ``True``. Otherwise return ``False``.
- A convenience method which coerces the *option* in the specified *section* to an
- integer.
+ .. method:: optionxform(option)
-.. method:: RawConfigParser.getfloat(section, option)
+ Transforms the option name *option* as found in an input file or as passed
+ in by client code to the form that should be used in the internal
+ structures. The default implementation returns a lower-case version of
+ *option*; subclasses may override this or client code can set an attribute
+ of this name on instances to affect this behavior.
- A convenience method which coerces the *option* in the specified *section* to a
- floating point number.
+ You don't need to subclass the parser to use this method, you can also
+ set it on an instance, to a function that takes a string argument and
+ returns a string. Setting it to ``str``, for example, would make option
+ names case sensitive::
+ cfgparser = ConfigParser()
+ cfgparser.optionxform = str
-.. method:: RawConfigParser.getboolean(section, option)
+ Note that when reading configuration files, whitespace around the option
+ names is stripped before :meth:`optionxform` is called.
- A convenience method which coerces the *option* in the specified *section* to a
- Boolean value. Note that the accepted values for the option are ``"1"``,
- ``"yes"``, ``"true"``, and ``"on"``, which cause this method to return ``True``,
- and ``"0"``, ``"no"``, ``"false"``, and ``"off"``, which cause it to return
- ``False``. These string values are checked in a case-insensitive manner. Any
- other value will cause it to raise :exc:`ValueError`.
+ .. method:: readfp(fp, filename=None)
-.. method:: RawConfigParser.items(section)
+ .. deprecated:: 3.2
+ Use :meth:`read_file` instead.
- Return a list of ``(name, value)`` pairs for each option in the given *section*.
+ .. versionchanged:: 3.2
+ :meth:`readfp` now iterates on *f* instead of calling ``f.readline()``.
+ For existing code calling :meth:`readfp` with arguments which don't
+ support iteration, the following generator may be used as a wrapper
+ around the file-like object::
-.. method:: RawConfigParser.set(section, option, value)
+ def readline_generator(f):
+ line = f.readline()
+ while line:
+ yield line
+ line = f.readline()
- If the given section exists, set the given option to the specified value;
- otherwise raise :exc:`NoSectionError`. While it is possible to use
- :class:`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters set to
- true) for *internal* storage of non-string values, full functionality (including
- interpolation and output to files) can only be achieved using string values.
+ Instead of ``parser.readfp(f)`` use
+ ``parser.read_file(readline_generator(f))``.
-.. method:: RawConfigParser.write(fileobject)
+.. data:: MAX_INTERPOLATION_DEPTH
- Write a representation of the configuration to the specified :term:`file object`,
- which must be opened in text mode (accepting strings). This representation
- can be parsed by a future :meth:`read` call.
+ The maximum depth for recursive interpolation for :meth:`get` when the *raw*
+ parameter is false. This is relevant only when the default *interpolation*
+ is used.
-.. method:: RawConfigParser.remove_option(section, option)
+.. _rawconfigparser-objects:
- Remove the specified *option* from the specified *section*. If the section does
- not exist, raise :exc:`NoSectionError`. If the option existed to be removed,
- return :const:`True`; otherwise return :const:`False`.
+RawConfigParser Objects
+-----------------------
+.. class:: RawConfigParser(defaults=None, dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=configaparser.DEFAULTSECT, interpolation=None)
-.. method:: RawConfigParser.remove_section(section)
+ Legacy variant of the :class:`ConfigParser` with interpolation disabled
+ by default and unsafe ``add_section`` and ``set`` methods.
- Remove the specified *section* from the configuration. If the section in fact
- existed, return ``True``. Otherwise return ``False``.
+ .. note::
+ Consider using :class:`ConfigParser` instead which checks types of
+ the values to be stored internally. If you don't want interpolation, you
+ can use ``ConfigParser(interpolation=None)``.
-.. method:: RawConfigParser.optionxform(option)
+ .. method:: add_section(section)
- Transforms the option name *option* as found in an input file or as passed in
- by client code to the form that should be used in the internal structures.
- The default implementation returns a lower-case version of *option*;
- subclasses may override this or client code can set an attribute of this name
- on instances to affect this behavior.
+ Add a section named *section* to the instance. If a section by the given
+ name already exists, :exc:`DuplicateSectionError` is raised. If the
+ *default section* name is passed, :exc:`ValueError` is raised.
- You don't necessarily need to subclass a ConfigParser to use this method, you
- can also re-set it on an instance, to a function that takes a string
- argument. Setting it to ``str``, for example, would make option names case
- sensitive::
+ Type of *section* is not checked which lets users create non-string named
+ sections. This behaviour is unsupported and may cause internal errors.
- cfgparser = ConfigParser()
- ...
- cfgparser.optionxform = str
- Note that when reading configuration files, whitespace around the
- option names are stripped before :meth:`optionxform` is called.
+ .. method:: set(section, option, value)
+ If the given section exists, set the given option to the specified value;
+ otherwise raise :exc:`NoSectionError`. While it is possible to use
+ :class:`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters
+ set to true) for *internal* storage of non-string values, full
+ functionality (including interpolation and output to files) can only be
+ achieved using string values.
-.. _configparser-objects:
+ This method lets users assign non-string values to keys internally. This
+ behaviour is unsupported and will cause errors when attempting to write
+ to a file or get it in non-raw mode. **Use the mapping protocol API**
+ which does not allow such assignments to take place.
-ConfigParser Objects
---------------------
-The :class:`ConfigParser` class extends some methods of the
-:class:`RawConfigParser` interface, adding some optional arguments.
+Exceptions
+----------
+.. exception:: Error
-.. method:: ConfigParser.get(section, option, raw=False, vars=None)
+ Base class for all other :mod:`configparser` exceptions.
- Get an *option* value for the named *section*. If *vars* is provided, it
- must be a dictionary. The *option* is looked up in *vars* (if provided),
- *section*, and in *defaults* in that order.
- All the ``'%'`` interpolations are expanded in the return values, unless the
- *raw* argument is true. Values for interpolation keys are looked up in the
- same manner as the option.
+.. exception:: NoSectionError
+ Exception raised when a specified section is not found.
-.. method:: ConfigParser.items(section, raw=False, vars=None)
- Return a list of ``(name, value)`` pairs for each option in the given *section*.
- Optional arguments have the same meaning as for the :meth:`get` method.
+.. exception:: DuplicateSectionError
+ Exception raised if :meth:`add_section` is called with the name of a section
+ that is already present or in strict parsers when a section if found more
+ than once in a single input file, string or dictionary.
-.. _safeconfigparser-objects:
+ .. versionadded:: 3.2
+ Optional ``source`` and ``lineno`` attributes and arguments to
+ :meth:`__init__` were added.
-SafeConfigParser Objects
-------------------------
-The :class:`SafeConfigParser` class implements the same extended interface as
-:class:`ConfigParser`, with the following addition:
+.. exception:: DuplicateOptionError
+ Exception raised by strict parsers if a single option appears twice during
+ reading from a single file, string or dictionary. This catches misspellings
+ and case sensitivity-related errors, e.g. a dictionary may have two keys
+ representing the same case-insensitive configuration key.
-.. method:: SafeConfigParser.set(section, option, value)
- If the given section exists, set the given option to the specified value;
- otherwise raise :exc:`NoSectionError`. *value* must be a string; if it is
- not, :exc:`TypeError` is raised.
+.. exception:: NoOptionError
+ Exception raised when a specified option is not found in the specified
+ section.
-Examples
---------
-An example of writing to a configuration file::
+.. exception:: InterpolationError
- import configparser
+ Base class for exceptions raised when problems occur performing string
+ interpolation.
- config = configparser.RawConfigParser()
- # When adding sections or items, add them in the reverse order of
- # how you want them to be displayed in the actual file.
- # In addition, please note that using RawConfigParser's and the raw
- # mode of ConfigParser's respective set functions, you can assign
- # non-string values to keys internally, but will receive an error
- # when attempting to write to a file or when you get it in non-raw
- # mode. SafeConfigParser does not allow such assignments to take place.
- config.add_section('Section1')
- config.set('Section1', 'int', '15')
- config.set('Section1', 'bool', 'true')
- config.set('Section1', 'float', '3.1415')
- config.set('Section1', 'baz', 'fun')
- config.set('Section1', 'bar', 'Python')
- config.set('Section1', 'foo', '%(bar)s is %(baz)s!')
+.. exception:: InterpolationDepthError
- # Writing our configuration file to 'example.cfg'
- with open('example.cfg', 'w') as configfile:
- config.write(configfile)
+ Exception raised when string interpolation cannot be completed because the
+ number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of
+ :exc:`InterpolationError`.
-An example of reading the configuration file again::
- import configparser
+.. exception:: InterpolationMissingOptionError
- config = configparser.RawConfigParser()
- config.read('example.cfg')
+ Exception raised when an option referenced from a value does not exist.
+ Subclass of :exc:`InterpolationError`.
- # getfloat() raises an exception if the value is not a float
- # getint() and getboolean() also do this for their respective types
- float = config.getfloat('Section1', 'float')
- int = config.getint('Section1', 'int')
- print(float + int)
- # Notice that the next output does not interpolate '%(bar)s' or '%(baz)s'.
- # This is because we are using a RawConfigParser().
- if config.getboolean('Section1', 'bool'):
- print(config.get('Section1', 'foo'))
+.. exception:: InterpolationSyntaxError
-To get interpolation, you will need to use a :class:`ConfigParser` or
-:class:`SafeConfigParser`::
+ Exception raised when the source text into which substitutions are made does
+ not conform to the required syntax. Subclass of :exc:`InterpolationError`.
- import configparser
- config = configparser.ConfigParser()
- config.read('example.cfg')
+.. exception:: MissingSectionHeaderError
- # Set the third, optional argument of get to 1 if you wish to use raw mode.
- print(config.get('Section1', 'foo', 0)) # -> "Python is fun!"
- print(config.get('Section1', 'foo', 1)) # -> "%(bar)s is %(baz)s!"
+ Exception raised when attempting to parse a file which has no section
+ headers.
- # The optional fourth argument is a dict with members that will take
- # precedence in interpolation.
- print(config.get('Section1', 'foo', 0, {'bar': 'Documentation',
- 'baz': 'evil'}))
-Defaults are available in all three types of ConfigParsers. They are used in
-interpolation if an option used is not defined elsewhere. ::
+.. exception:: ParsingError
- import configparser
+ Exception raised when errors occur attempting to parse a file.
- # New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each
- config = configparser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'})
- config.read('example.cfg')
+ .. versionchanged:: 3.2
+ The ``filename`` attribute and :meth:`__init__` argument were renamed to
+ ``source`` for consistency.
- print(config.get('Section1', 'foo')) # -> "Python is fun!"
- config.remove_option('Section1', 'bar')
- config.remove_option('Section1', 'baz')
- print(config.get('Section1', 'foo')) # -> "Life is hard!"
-The function ``opt_move`` below can be used to move options between sections::
-
- def opt_move(config, section1, section2, option):
- try:
- config.set(section2, option, config.get(section1, option, 1))
- except configparser.NoSectionError:
- # Create non-existent section
- config.add_section(section2)
- opt_move(config, section1, section2, option)
- else:
- config.remove_option(section1, option)
+.. rubric:: Footnotes
+
+.. [1] Config parsers allow for heavy customization. If you are interested in
+ changing the behaviour outlined by the footnote reference, consult the
+ `Customizing Parser Behaviour`_ section.
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
index ca37f0f16a..e8dc17fed3 100644
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -4,6 +4,9 @@
.. module:: contextlib
:synopsis: Utilities for with-statement contexts.
+**Source code:** :source:`Lib/contextlib.py`
+
+--------------
This module provides utilities for common tasks involving the :keyword:`with`
statement. For more information see also :ref:`typecontextmanager` and
@@ -12,7 +15,7 @@ statement. For more information see also :ref:`typecontextmanager` and
Functions provided:
-.. function:: contextmanager(func)
+.. decorator:: contextmanager
This function is a :term:`decorator` that can be used to define a factory
function for :keyword:`with` statement context managers, without needing to
@@ -51,54 +54,15 @@ Functions provided:
the exception has been handled, and execution will resume with the statement
immediately following the :keyword:`with` statement.
+ :func:`contextmanager` uses :class:`ContextDecorator` so the context managers
+ it creates can be used as decorators as well as in :keyword:`with` statements.
+ When used as a decorator, a new generator instance is implicitly created on
+ each function call (this allows the otherwise "one-shot" context managers
+ created by :func:`contextmanager` to meet the requirement that context
+ managers support multiple invocations in order to be used as decorators).
-.. function:: nested(mgr1[, mgr2[, ...]])
-
- Combine multiple context managers into a single nested context manager.
-
- This function has been deprecated in favour of the multiple manager form
- of the :keyword:`with` statement.
-
- The one advantage of this function over the multiple manager form of the
- :keyword:`with` statement is that argument unpacking allows it to be
- used with a variable number of context managers as follows::
-
- from contextlib import nested
-
- with nested(*managers):
- do_something()
-
- Note that if the :meth:`__exit__` method of one of the nested context managers
- indicates an exception should be suppressed, no exception information will be
- passed to any remaining outer context managers. Similarly, if the
- :meth:`__exit__` method of one of the nested managers raises an exception, any
- previous exception state will be lost; the new exception will be passed to the
- :meth:`__exit__` methods of any remaining outer context managers. In general,
- :meth:`__exit__` methods should avoid raising exceptions, and in particular they
- should not re-raise a passed-in exception.
-
- This function has two major quirks that have led to it being deprecated. Firstly,
- as the context managers are all constructed before the function is invoked, the
- :meth:`__new__` and :meth:`__init__` methods of the inner context managers are
- not actually covered by the scope of the outer context managers. That means, for
- example, that using :func:`nested` to open two files is a programming error as the
- first file will not be closed promptly if an exception is thrown when opening
- the second file.
-
- Secondly, if the :meth:`__enter__` method of one of the inner context managers
- raises an exception that is caught and suppressed by the :meth:`__exit__` method
- of one of the outer context managers, this construct will raise
- :exc:`RuntimeError` rather than skipping the body of the :keyword:`with`
- statement.
-
- Developers that need to support nesting of a variable number of context managers
- can either use the :mod:`warnings` module to suppress the DeprecationWarning
- raised by this function or else use this function as a model for an application
- specific implementation.
-
- .. deprecated:: 3.1
- The with-statement now supports this functionality directly (without the
- confusing error prone quirks).
+ .. versionchanged:: 3.2
+ Use of :class:`ContextDecorator`.
.. function:: closing(thing)
@@ -128,6 +92,82 @@ Functions provided:
``page.close()`` will be called when the :keyword:`with` block is exited.
+.. class:: ContextDecorator()
+
+ A base class that enables a context manager to also be used as a decorator.
+
+ Context managers inheriting from ``ContextDecorator`` have to implement
+ ``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional
+ exception handling even when used as a decorator.
+
+ ``ContextDecorator`` is used by :func:`contextmanager`, so you get this
+ functionality automatically.
+
+ Example of ``ContextDecorator``::
+
+ from contextlib import ContextDecorator
+
+ class mycontext(ContextDecorator):
+ def __enter__(self):
+ print('Starting')
+ return self
+
+ def __exit__(self, *exc):
+ print('Finishing')
+ return False
+
+ >>> @mycontext()
+ ... def function():
+ ... print('The bit in the middle')
+ ...
+ >>> function()
+ Starting
+ The bit in the middle
+ Finishing
+
+ >>> with mycontext():
+ ... print('The bit in the middle')
+ ...
+ Starting
+ The bit in the middle
+ Finishing
+
+ This change is just syntactic sugar for any construct of the following form::
+
+ def f():
+ with cm():
+ # Do stuff
+
+ ``ContextDecorator`` lets you instead write::
+
+ @cm()
+ def f():
+ # Do stuff
+
+ It makes it clear that the ``cm`` applies to the whole function, rather than
+ just a piece of it (and saving an indentation level is nice, too).
+
+ Existing context managers that already have a base class can be extended by
+ using ``ContextDecorator`` as a mixin class::
+
+ from contextlib import ContextDecorator
+
+ class mycontext(ContextBaseClass, ContextDecorator):
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *exc):
+ return False
+
+ .. note::
+ As the decorated function must be able to be called multiple times, the
+ underlying context manager must support use in multiple :keyword:`with`
+ statements. If this is not the case, then the original construct with the
+ explicit :keyword:`with` statement inside the function should be used.
+
+ .. versionadded:: 3.2
+
+
.. seealso::
:pep:`0343` - The "with" statement
diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst
index 92ba6da7d1..edbe7263df 100644
--- a/Doc/library/csv.rst
+++ b/Doc/library/csv.rst
@@ -188,6 +188,15 @@ The :mod:`csv` module defines the following classes:
TAB-delimited file. It is registered with the dialect name ``'excel-tab'``.
+.. class:: unix_dialect()
+
+ The :class:`unix_dialect` class defines the usual properties of a CSV file
+ generated on UNIX systems, i.e. using ``'\n'`` as line terminator and quoting
+ all fields. It is registered with the dialect name ``'unix'``.
+
+ .. versionadded:: 3.2
+
+
.. class:: Sniffer()
The :class:`Sniffer` class is used to deduce the format of a CSV file.
@@ -393,6 +402,16 @@ Writer objects have the following public attribute:
A read-only description of the dialect in use by the writer.
+DictWriter objects have the following public method:
+
+
+.. method:: DictWriter.writeheader()
+
+ Write a row with the field names (as specified in the constructor).
+
+ .. versionadded:: 3.2
+
+
.. _csv-examples:
Examples
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index d1d025bf52..33d1f7e9cd 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -38,7 +38,7 @@ You load libraries by accessing them as attributes of these objects. *cdll*
loads libraries which export functions using the standard ``cdecl`` calling
convention, while *windll* libraries call functions using the ``stdcall``
calling convention. *oledll* also uses the ``stdcall`` calling convention, and
-assumes the functions return a Windows :ctype:`HRESULT` error code. The error
+assumes the functions return a Windows :c:type:`HRESULT` error code. The error
code is used to automatically raise a :class:`WindowsError` exception when the
function call fails.
@@ -198,9 +198,9 @@ should be careful anyway.
``None``, integers, bytes objects and (unicode) strings are the only native
Python objects that can directly be used as parameters in these function calls.
``None`` is passed as a C ``NULL`` pointer, bytes objects and strings are passed
-as pointer to the memory block that contains their data (:ctype:`char *` or
-:ctype:`wchar_t *`). Python integers are passed as the platforms default C
-:ctype:`int` type, their value is masked to fit into the C type.
+as pointer to the memory block that contains their data (:c:type:`char *` or
+:c:type:`wchar_t *`). Python integers are passed as the platforms default C
+:c:type:`int` type, their value is masked to fit into the C type.
Before we move on calling functions with other parameter types, we have to learn
more about :mod:`ctypes` data types.
@@ -213,48 +213,48 @@ Fundamental data types
:mod:`ctypes` defines a number of primitive C compatible data types :
-+----------------------+----------------------------------------+----------------------------+
-| ctypes type | C type | Python type |
-+======================+========================================+============================+
-| :class:`c_bool` | :ctype:`_Bool` | bool (1) |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_char` | :ctype:`char` | 1-character bytes object |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_wchar` | :ctype:`wchar_t` | 1-character string |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_byte` | :ctype:`char` | int |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_ubyte` | :ctype:`unsigned char` | int |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_short` | :ctype:`short` | int |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_ushort` | :ctype:`unsigned short` | int |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_int` | :ctype:`int` | int |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_uint` | :ctype:`unsigned int` | int |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_long` | :ctype:`long` | int |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_ulong` | :ctype:`unsigned long` | int |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_longlong` | :ctype:`__int64` or :ctype:`long long` | int |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_ulonglong` | :ctype:`unsigned __int64` or | int |
-| | :ctype:`unsigned long long` | |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_float` | :ctype:`float` | float |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_double` | :ctype:`double` | float |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_longdouble`| :ctype:`long double` | float |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_char_p` | :ctype:`char *` (NUL terminated) | bytes object or ``None`` |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_wchar_p` | :ctype:`wchar_t *` (NUL terminated) | string or ``None`` |
-+----------------------+----------------------------------------+----------------------------+
-| :class:`c_void_p` | :ctype:`void *` | int or ``None`` |
-+----------------------+----------------------------------------+----------------------------+
++----------------------+------------------------------------------+----------------------------+
+| ctypes type | C type | Python type |
++======================+==========================================+============================+
+| :class:`c_bool` | :c:type:`_Bool` | bool (1) |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_char` | :c:type:`char` | 1-character bytes object |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_wchar` | :c:type:`wchar_t` | 1-character string |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_byte` | :c:type:`char` | int |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_ubyte` | :c:type:`unsigned char` | int |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_short` | :c:type:`short` | int |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_ushort` | :c:type:`unsigned short` | int |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_int` | :c:type:`int` | int |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_uint` | :c:type:`unsigned int` | int |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_long` | :c:type:`long` | int |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_ulong` | :c:type:`unsigned long` | int |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_longlong` | :c:type:`__int64` or :c:type:`long long` | int |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_ulonglong` | :c:type:`unsigned __int64` or | int |
+| | :c:type:`unsigned long long` | |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_float` | :c:type:`float` | float |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_double` | :c:type:`double` | float |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_longdouble`| :c:type:`long double` | float |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_char_p` | :c:type:`char *` (NUL terminated) | bytes object or ``None`` |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_wchar_p` | :c:type:`wchar_t *` (NUL terminated) | string or ``None`` |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_void_p` | :c:type:`void *` | int or ``None`` |
++----------------------+------------------------------------------+----------------------------+
(1)
The constructor accepts any object with a truth value.
@@ -325,7 +325,7 @@ property::
The :func:`create_string_buffer` function replaces the :func:`c_buffer` function
(which is still available as an alias), as well as the :func:`c_string` function
from earlier ctypes releases. To create a mutable memory block containing
-unicode characters of the C type :ctype:`wchar_t` use the
+unicode characters of the C type :c:type:`wchar_t` use the
:func:`create_unicode_buffer` function.
@@ -436,7 +436,7 @@ integer, string, bytes, a :mod:`ctypes` instance, or an object with an
Return types
^^^^^^^^^^^^
-By default functions are assumed to return the C :ctype:`int` type. Other
+By default functions are assumed to return the C :c:type:`int` type. Other
return types can be specified by setting the :attr:`restype` attribute of the
function object.
@@ -935,8 +935,8 @@ argument, and the callback functions expected argument types as the remaining
arguments.
I will present an example here which uses the standard C library's
-:cfunc:`qsort` function, this is used to sort items with the help of a callback
-function. :cfunc:`qsort` will be used to sort an array of integers::
+:c:func:`qsort` function, this is used to sort items with the help of a callback
+function. :c:func:`qsort` will be used to sort an array of integers::
>>> IntArray5 = c_int * 5
>>> ia = IntArray5(5, 1, 7, 33, 99)
@@ -1077,7 +1077,7 @@ Accessing values exported from dlls
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some shared libraries not only export functions, they also export variables. An
-example in the Python library itself is the :cdata:`Py_OptimizeFlag`, an integer
+example in the Python library itself is the :c:data:`Py_OptimizeFlag`, an integer
set to 0, 1, or 2, depending on the :option:`-O` or :option:`-OO` flag given on
startup.
@@ -1095,11 +1095,11 @@ have printed ``c_long(1)``, or ``c_long(2)`` if :option:`-OO` would have been
specified.
An extended example which also demonstrates the use of pointers accesses the
-:cdata:`PyImport_FrozenModules` pointer exported by Python.
+:c:data:`PyImport_FrozenModules` pointer exported by Python.
Quoting the docs for that value:
- This pointer is initialized to point to an array of :ctype:`struct _frozen`
+ This pointer is initialized to point to an array of :c:type:`struct _frozen`
records, terminated by one whose members are all *NULL* or zero. When a frozen
module is imported, it is searched in this table. Third-party code could play
tricks with this to provide a dynamically created collection of frozen modules.
@@ -1116,7 +1116,7 @@ size, we show only how this table can be read with :mod:`ctypes`::
...
>>>
-We have defined the :ctype:`struct _frozen` data type, so we can get the pointer
+We have defined the :c:type:`struct _frozen` data type, so we can get the pointer
to the table::
>>> FrozenTable = POINTER(struct_frozen)
@@ -1335,7 +1335,7 @@ way is to instantiate one of the following classes:
Instances of this class represent loaded shared libraries. Functions in these
libraries use the standard C calling convention, and are assumed to return
- :ctype:`int`.
+ :c:type:`int`.
.. class:: OleDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False)
@@ -1352,7 +1352,7 @@ way is to instantiate one of the following classes:
Windows only: Instances of this class represent loaded shared libraries,
functions in these libraries use the ``stdcall`` calling convention, and are
- assumed to return :ctype:`int` by default.
+ assumed to return :c:type:`int` by default.
On Windows CE only the standard calling convention is used, for convenience the
:class:`WinDLL` and :class:`OleDLL` use the standard calling convention on this
@@ -1493,7 +1493,7 @@ object is available:
An instance of :class:`PyDLL` that exposes Python C API functions as
attributes. Note that all these functions are assumed to return C
- :ctype:`int`, which is of course not always the truth, so you have to assign
+ :c:type:`int`, which is of course not always the truth, so you have to assign
the correct :attr:`restype` attribute to use these functions.
@@ -1522,10 +1522,10 @@ They are instances of a private class:
.. attribute:: restype
Assign a ctypes type to specify the result type of the foreign function.
- Use ``None`` for :ctype:`void`, a function not returning anything.
+ Use ``None`` for :c:type:`void`, a function not returning anything.
It is possible to assign a callable Python object that is not a ctypes
- type, in this case the function is assumed to return a C :ctype:`int`, and
+ type, in this case the function is assumed to return a C :c:type:`int`, and
the callable will be called with this integer, allowing to do further
processing or error checking. Using this is deprecated, for more flexible
post processing or error checking use a ctypes data type as
@@ -1935,22 +1935,6 @@ Utility functions
but it is possible to enlarge the buffer.
-.. function:: set_conversion_mode(encoding, errors)
-
- This function sets the rules that ctypes objects use when converting between
- bytes objects and (unicode) strings. *encoding* must be a string specifying an
- encoding, like ``'utf-8'`` or ``'mbcs'``, *errors* must be a string specifying
- the error handling on encoding/decoding errors. Examples of possible values are
- ``'strict'``, ``'replace'``, or ``'ignore'``.
-
- :func:`set_conversion_mode` returns a 2-tuple containing the previous
- conversion rules. On windows, the initial conversion rules are ``('mbcs',
- 'ignore')``, on other systems ``('ascii', 'strict')``.
-
- You can set the *encoding* to ``'undefined'`` to completely disable automatic
- conversions.
-
-
.. function:: set_errno(value)
Set the current value of the ctypes-private copy of the system :data:`errno`
@@ -2120,21 +2104,21 @@ These are the fundamental ctypes data types:
.. class:: c_byte
- Represents the C :ctype:`signed char` datatype, and interprets the value as
+ Represents the C :c:type:`signed char` datatype, and interprets the value as
small integer. The constructor accepts an optional integer initializer; no
overflow checking is done.
.. class:: c_char
- Represents the C :ctype:`char` datatype, and interprets the value as a single
+ Represents the C :c:type:`char` datatype, and interprets the value as a single
character. The constructor accepts an optional string initializer, the
length of the string must be exactly one character.
.. class:: c_char_p
- Represents the C :ctype:`char *` datatype when it points to a zero-terminated
+ Represents the C :c:type:`char *` datatype when it points to a zero-terminated
string. For a general character pointer that may also point to binary data,
``POINTER(c_char)`` must be used. The constructor accepts an integer
address, or a bytes object.
@@ -2142,173 +2126,180 @@ These are the fundamental ctypes data types:
.. class:: c_double
- Represents the C :ctype:`double` datatype. The constructor accepts an
+ Represents the C :c:type:`double` datatype. The constructor accepts an
optional float initializer.
.. class:: c_longdouble
- Represents the C :ctype:`long double` datatype. The constructor accepts an
+ Represents the C :c:type:`long double` datatype. The constructor accepts an
optional float initializer. On platforms where ``sizeof(long double) ==
sizeof(double)`` it is an alias to :class:`c_double`.
.. class:: c_float
- Represents the C :ctype:`float` datatype. The constructor accepts an
+ Represents the C :c:type:`float` datatype. The constructor accepts an
optional float initializer.
.. class:: c_int
- Represents the C :ctype:`signed int` datatype. The constructor accepts an
+ Represents the C :c:type:`signed int` datatype. The constructor accepts an
optional integer initializer; no overflow checking is done. On platforms
where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`.
.. class:: c_int8
- Represents the C 8-bit :ctype:`signed int` datatype. Usually an alias for
+ Represents the C 8-bit :c:type:`signed int` datatype. Usually an alias for
:class:`c_byte`.
.. class:: c_int16
- Represents the C 16-bit :ctype:`signed int` datatype. Usually an alias for
+ Represents the C 16-bit :c:type:`signed int` datatype. Usually an alias for
:class:`c_short`.
.. class:: c_int32
- Represents the C 32-bit :ctype:`signed int` datatype. Usually an alias for
+ Represents the C 32-bit :c:type:`signed int` datatype. Usually an alias for
:class:`c_int`.
.. class:: c_int64
- Represents the C 64-bit :ctype:`signed int` datatype. Usually an alias for
+ Represents the C 64-bit :c:type:`signed int` datatype. Usually an alias for
:class:`c_longlong`.
.. class:: c_long
- Represents the C :ctype:`signed long` datatype. The constructor accepts an
+ Represents the C :c:type:`signed long` datatype. The constructor accepts an
optional integer initializer; no overflow checking is done.
.. class:: c_longlong
- Represents the C :ctype:`signed long long` datatype. The constructor accepts
+ Represents the C :c:type:`signed long long` datatype. The constructor accepts
an optional integer initializer; no overflow checking is done.
.. class:: c_short
- Represents the C :ctype:`signed short` datatype. The constructor accepts an
+ Represents the C :c:type:`signed short` datatype. The constructor accepts an
optional integer initializer; no overflow checking is done.
.. class:: c_size_t
- Represents the C :ctype:`size_t` datatype.
+ Represents the C :c:type:`size_t` datatype.
+
+
+.. class:: c_ssize_t
+
+ Represents the C :c:type:`ssize_t` datatype.
+
+ .. versionadded:: 3.2
.. class:: c_ubyte
- Represents the C :ctype:`unsigned char` datatype, it interprets the value as
+ Represents the C :c:type:`unsigned char` datatype, it interprets the value as
small integer. The constructor accepts an optional integer initializer; no
overflow checking is done.
.. class:: c_uint
- Represents the C :ctype:`unsigned int` datatype. The constructor accepts an
+ Represents the C :c:type:`unsigned int` datatype. The constructor accepts an
optional integer initializer; no overflow checking is done. On platforms
where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`.
.. class:: c_uint8
- Represents the C 8-bit :ctype:`unsigned int` datatype. Usually an alias for
+ Represents the C 8-bit :c:type:`unsigned int` datatype. Usually an alias for
:class:`c_ubyte`.
.. class:: c_uint16
- Represents the C 16-bit :ctype:`unsigned int` datatype. Usually an alias for
+ Represents the C 16-bit :c:type:`unsigned int` datatype. Usually an alias for
:class:`c_ushort`.
.. class:: c_uint32
- Represents the C 32-bit :ctype:`unsigned int` datatype. Usually an alias for
+ Represents the C 32-bit :c:type:`unsigned int` datatype. Usually an alias for
:class:`c_uint`.
.. class:: c_uint64
- Represents the C 64-bit :ctype:`unsigned int` datatype. Usually an alias for
+ Represents the C 64-bit :c:type:`unsigned int` datatype. Usually an alias for
:class:`c_ulonglong`.
.. class:: c_ulong
- Represents the C :ctype:`unsigned long` datatype. The constructor accepts an
+ Represents the C :c:type:`unsigned long` datatype. The constructor accepts an
optional integer initializer; no overflow checking is done.
.. class:: c_ulonglong
- Represents the C :ctype:`unsigned long long` datatype. The constructor
+ Represents the C :c:type:`unsigned long long` datatype. The constructor
accepts an optional integer initializer; no overflow checking is done.
.. class:: c_ushort
- Represents the C :ctype:`unsigned short` datatype. The constructor accepts
+ Represents the C :c:type:`unsigned short` datatype. The constructor accepts
an optional integer initializer; no overflow checking is done.
.. class:: c_void_p
- Represents the C :ctype:`void *` type. The value is represented as integer.
+ Represents the C :c:type:`void *` type. The value is represented as integer.
The constructor accepts an optional integer initializer.
.. class:: c_wchar
- Represents the C :ctype:`wchar_t` datatype, and interprets the value as a
+ Represents the C :c:type:`wchar_t` datatype, and interprets the value as a
single character unicode string. The constructor accepts an optional string
initializer, the length of the string must be exactly one character.
.. class:: c_wchar_p
- Represents the C :ctype:`wchar_t *` datatype, which must be a pointer to a
+ Represents the C :c:type:`wchar_t *` datatype, which must be a pointer to a
zero-terminated wide character string. The constructor accepts an integer
address, or a string.
.. class:: c_bool
- Represent the C :ctype:`bool` datatype (more accurately, :ctype:`_Bool` from
+ Represent the C :c:type:`bool` datatype (more accurately, :c:type:`_Bool` from
C99). Its value can be True or False, and the constructor accepts any object
that has a truth value.
.. class:: HRESULT
- Windows only: Represents a :ctype:`HRESULT` value, which contains success or
+ Windows only: Represents a :c:type:`HRESULT` value, which contains success or
error information for a function or method call.
.. class:: py_object
- Represents the C :ctype:`PyObject *` datatype. Calling this without an
- argument creates a ``NULL`` :ctype:`PyObject *` pointer.
+ Represents the C :c:type:`PyObject *` datatype. Calling this without an
+ argument creates a ``NULL`` :c:type:`PyObject *` pointer.
The :mod:`ctypes.wintypes` module provides quite some other Windows specific
-data types, for example :ctype:`HWND`, :ctype:`WPARAM`, or :ctype:`DWORD`. Some
-useful structures like :ctype:`MSG` or :ctype:`RECT` are also defined.
+data types, for example :c:type:`HWND`, :c:type:`WPARAM`, or :c:type:`DWORD`. Some
+useful structures like :c:type:`MSG` or :c:type:`RECT` are also defined.
.. _ctypes-structured-data-types:
diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst
index 6d2baa0f99..1ca22c843c 100644
--- a/Doc/library/curses.rst
+++ b/Doc/library/curses.rst
@@ -49,7 +49,7 @@ Linux and the BSD variants of Unix.
Tutorial material on using curses with Python, by Andrew Kuchling and Eric
Raymond.
- The :file:`Demo/curses/` directory in the Python source distribution contains
+ The :file:`Tools/demo/` directory in the Python source distribution contains
some example programs using the curses bindings provided by this module.
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index 26d9946630..de9ad449b2 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -28,11 +28,14 @@ For applications requiring more, :class:`datetime` and :class:`time` objects
have an optional time zone information member, :attr:`tzinfo`, that can contain
an instance of a subclass of the abstract :class:`tzinfo` class. These
:class:`tzinfo` objects capture information about the offset from UTC time, the
-time zone name, and whether Daylight Saving Time is in effect. Note that no
-concrete :class:`tzinfo` classes are supplied by the :mod:`datetime` module.
-Supporting timezones at whatever level of detail is required is up to the
-application. The rules for time adjustment across the world are more political
-than rational, and there is no standard suitable for every application.
+time zone name, and whether Daylight Saving Time is in effect. Note that only
+one concrete :class:`tzinfo` class, the :class:`timezone` class, is supplied by the
+:mod:`datetime` module. The :class:`timezone` class can reprsent simple
+timezones with fixed offset from UTC such as UTC itself or North American EST and
+EDT timezones. Supporting timezones at whatever level of detail is
+required is up to the application. The rules for time adjustment across the
+world are more political than rational, change frequently, and there is no
+standard suitable for every application aside from UTC.
The :mod:`datetime` module exports the following constants:
@@ -99,6 +102,14 @@ Available Types
time adjustment (for example, to account for time zone and/or daylight saving
time).
+.. class:: timezone
+
+ A class that implements the :class:`tzinfo` abstract base class as a
+ fixed offset from the UTC.
+
+ .. versionadded:: 3.2
+
+
Objects of these types are immutable.
Objects of the :class:`date` type are always naive.
@@ -116,6 +127,7 @@ Subclass relationships::
object
timedelta
tzinfo
+ timezone
time
date
datetime
@@ -220,8 +232,28 @@ Supported operations:
| | In general, *t1* \* i == *t1* \* (i-1) + *t1* |
| | is true. (1) |
+--------------------------------+-----------------------------------------------+
-| ``t1 = t2 // i`` | The floor is computed and the remainder (if |
-| | any) is thrown away. (3) |
+| ``t1 = t2 * f or t1 = f * t2`` | Delta multiplied by a float. The result is |
+| | rounded to the nearest multiple of |
+| | timedelta.resolution using round-half-to-even.|
++--------------------------------+-----------------------------------------------+
+| ``f = t2 / t3`` | Division (3) of *t2* by *t3*. Returns a |
+| | :class:`float` object. |
++--------------------------------+-----------------------------------------------+
+| ``t1 = t2 / f or t1 = t2 / i`` | Delta divided by a float or an int. The result|
+| | is rounded to the nearest multiple of |
+| | timedelta.resolution using round-half-to-even.|
++--------------------------------+-----------------------------------------------+
+| ``t1 = t2 // i`` or | The floor is computed and the remainder (if |
+| ``t1 = t2 // t3`` | any) is thrown away. In the second case, an |
+| | integer is returned. (3) |
++--------------------------------+-----------------------------------------------+
+| ``t1 = t2 % t3`` | The remainder is computed as a |
+| | :class:`timedelta` object. (3) |
++--------------------------------+-----------------------------------------------+
+| ``q, r = divmod(t1, t2)`` | Computes the quotient and the remainder: |
+| | ``q = t1 // t2`` (3) and ``r = t1 % t2``. |
+| | q is an integer and r is a :class:`timedelta` |
+| | object. |
+--------------------------------+-----------------------------------------------+
| ``+t1`` | Returns a :class:`timedelta` object with the |
| | same value. (2) |
@@ -270,6 +302,13 @@ In addition to the operations listed above :class:`timedelta` objects support
certain additions and subtractions with :class:`date` and :class:`datetime`
objects (see below).
+.. versionchanged:: 3.2
+ Floor division and true division of a :class:`timedelta` object by another
+ :class:`timedelta` object are now supported, as are remainder operations and
+ the :func:`divmod` function. True division and multiplication of a
+ :class:`timedelta` object by a :class:`float` object are now supported.
+
+
Comparisons of :class:`timedelta` objects are supported with the
:class:`timedelta` object representing the smaller duration considered to be the
smaller timedelta. In order to stop mixed-type comparisons from falling back to
@@ -282,12 +321,27 @@ comparison is ``==`` or ``!=``. The latter cases return :const:`False` or
efficient pickling, and in Boolean contexts, a :class:`timedelta` object is
considered to be true if and only if it isn't equal to ``timedelta(0)``.
+Instance methods:
+
+.. method:: timedelta.total_seconds()
+
+ Return the total number of seconds contained in the duration. Equivalent to
+ ``td / timedelta(seconds=1)``.
+
+ Note that for very large time intervals (greater than 270 years on
+ most platforms) this method will lose microsecond accuracy.
+
+ .. versionadded:: 3.2
+
+
Example usage:
>>> from datetime import timedelta
>>> year = timedelta(days=365)
>>> another_year = timedelta(weeks=40, days=84, hours=23,
... minutes=50, seconds=600) # adds up to 365 days
+ >>> year.total_seconds()
+ 31536000.0
>>> year == another_year
True
>>> ten_years = 10 * year
@@ -342,7 +396,7 @@ Other constructors, all class methods:
Return the local date corresponding to the POSIX timestamp, such as is returned
by :func:`time.time`. This may raise :exc:`ValueError`, if the timestamp is out
- of the range of values supported by the platform C :cfunc:`localtime` function.
+ of the range of values supported by the platform C :c:func:`localtime` function.
It's common for this to be restricted to years from 1970 through 2038. Note
that on non-POSIX systems that include leap seconds in their notion of a
timestamp, leap seconds are ignored by :meth:`fromtimestamp`.
@@ -516,7 +570,7 @@ Instance methods:
Return a string representing the date, for example ``date(2002, 12,
4).ctime() == 'Wed Dec 4 00:00:00 2002'``. ``d.ctime()`` is equivalent to
``time.ctime(time.mktime(d.timetuple()))`` on platforms where the native C
- :cfunc:`ctime` function (which :func:`time.ctime` invokes, but which
+ :c:func:`ctime` function (which :func:`time.ctime` invokes, but which
:meth:`date.ctime` does not invoke) conforms to the C standard.
@@ -623,7 +677,7 @@ Other constructors, all class methods:
or not specified, this is like :meth:`today`, but, if possible, supplies more
precision than can be gotten from going through a :func:`time.time` timestamp
(for example, this may be possible on platforms supplying the C
- :cfunc:`gettimeofday` function).
+ :c:func:`gettimeofday` function).
Else *tz* must be an instance of a class :class:`tzinfo` subclass, and the
current date and time are converted to *tz*'s time zone. In this case the
@@ -635,8 +689,8 @@ Other constructors, all class methods:
Return the current UTC date and time, with :attr:`tzinfo` ``None``. This is like
:meth:`now`, but returns the current UTC date and time, as a naive
- :class:`datetime` object. See also :meth:`now`.
-
+ :class:`datetime` object. An aware current UTC datetime can be obtained by
+ calling ``datetime.now(timezone.utc)``. See also :meth:`now`.
.. classmethod:: datetime.fromtimestamp(timestamp, tz=None)
@@ -651,8 +705,8 @@ Other constructors, all class methods:
``tz.fromutc(datetime.utcfromtimestamp(timestamp).replace(tzinfo=tz))``.
:meth:`fromtimestamp` may raise :exc:`ValueError`, if the timestamp is out of
- the range of values supported by the platform C :cfunc:`localtime` or
- :cfunc:`gmtime` functions. It's common for this to be restricted to years in
+ the range of values supported by the platform C :c:func:`localtime` or
+ :c:func:`gmtime` functions. It's common for this to be restricted to years in
1970 through 2038. Note that on non-POSIX systems that include leap seconds in
their notion of a timestamp, leap seconds are ignored by :meth:`fromtimestamp`,
and then it's possible to have two timestamps differing by a second that yield
@@ -663,7 +717,7 @@ Other constructors, all class methods:
Return the UTC :class:`datetime` corresponding to the POSIX timestamp, with
:attr:`tzinfo` ``None``. This may raise :exc:`ValueError`, if the timestamp is
- out of the range of values supported by the platform C :cfunc:`gmtime` function.
+ out of the range of values supported by the platform C :c:func:`gmtime` function.
It's common for this to be restricted to years in 1970 through 2038. See also
:meth:`fromtimestamp`.
@@ -927,7 +981,7 @@ Instance methods:
of the result is set according to the :meth:`dst` method: :attr:`tzinfo` is
``None`` or :meth:`dst` returns ``None``, :attr:`tm_isdst` is set to ``-1``;
else if :meth:`dst` returns a non-zero value, :attr:`tm_isdst` is set to ``1``;
- else ``tm_isdst`` is set to ``0``.
+ else :attr:`tm_isdst` is set to ``0``.
.. method:: datetime.utctimetuple()
@@ -937,10 +991,10 @@ Instance methods:
``d.dst()`` returns. DST is never in effect for a UTC time.
If *d* is aware, *d* is normalized to UTC time, by subtracting
- ``d.utcoffset()``, and a :class:`time.struct_time` for the normalized time is
- returned. :attr:`tm_isdst` is forced to 0. Note that the result's
- :attr:`tm_year` member may be :const:`MINYEAR`\ -1 or :const:`MAXYEAR`\ +1, if
- *d*.year was ``MINYEAR`` or ``MAXYEAR`` and UTC adjustment spills over a year
+ ``d.utcoffset()``, and a :class:`time.struct_time` for the
+ normalized time is returned. :attr:`tm_isdst` is forced to 0. Note
+ that an :exc:`OverflowError` may be raised if *d*.year was
+ ``MINYEAR`` or ``MAXYEAR`` and UTC adjustment spills over a year
boundary.
@@ -1002,7 +1056,7 @@ Instance methods:
Return a string representing the date and time, for example ``datetime(2002, 12,
4, 20, 30, 40).ctime() == 'Wed Dec 4 20:30:40 2002'``. ``d.ctime()`` is
equivalent to ``time.ctime(time.mktime(d.timetuple()))`` on platforms where the
- native C :cfunc:`ctime` function (which :func:`time.ctime` invokes, but which
+ native C :c:func:`ctime` function (which :func:`time.ctime` invokes, but which
:meth:`datetime.ctime` does not invoke) conforms to the C standard.
@@ -1293,8 +1347,10 @@ Example:
:class:`tzinfo` is an abstract base class, meaning that this class should not be
instantiated directly. You need to derive a concrete subclass, and (at least)
supply implementations of the standard :class:`tzinfo` methods needed by the
-:class:`datetime` methods you use. The :mod:`datetime` module does not supply
-any concrete subclasses of :class:`tzinfo`.
+:class:`datetime` methods you use. The :mod:`datetime` module supplies
+a simple concrete subclass of :class:`tzinfo` :class:`timezone` which can reprsent
+timezones with fixed offset from UTC such as UTC itself or North American EST and
+EDT.
An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the
constructors for :class:`datetime` and :class:`time` objects. The latter objects
@@ -1312,7 +1368,7 @@ methods. Exactly which methods are needed depends on the uses made of aware
:mod:`datetime` objects. If in doubt, simply implement all of them.
-.. method:: tzinfo.utcoffset(self, dt)
+.. method:: tzinfo.utcoffset(dt)
Return offset of local time from UTC, in minutes east of UTC. If local time is
west of UTC, this should be negative. Note that this is intended to be the
@@ -1334,7 +1390,7 @@ methods. Exactly which methods are needed depends on the uses made of aware
:exc:`NotImplementedError`.
-.. method:: tzinfo.dst(self, dt)
+.. method:: tzinfo.dst(dt)
Return the daylight saving time (DST) adjustment, in minutes east of UTC, or
``None`` if DST information isn't known. Return ``timedelta(0)`` if DST is not
@@ -1382,7 +1438,7 @@ methods. Exactly which methods are needed depends on the uses made of aware
The default implementation of :meth:`dst` raises :exc:`NotImplementedError`.
-.. method:: tzinfo.tzname(self, dt)
+.. method:: tzinfo.tzname(dt)
Return the time zone name corresponding to the :class:`datetime` object *dt*, as
a string. Nothing about string names is defined by the :mod:`datetime` module,
@@ -1418,7 +1474,7 @@ time, and not need worry about objects in other timezones.
There is one more :class:`tzinfo` method that a subclass may wish to override:
-.. method:: tzinfo.fromutc(self, dt)
+.. method:: tzinfo.fromutc(dt)
This is called from the default :class:`datetime.astimezone()` implementation.
When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time members
@@ -1495,9 +1551,65 @@ arranged, as in the example, by expressing DST switch times in the time zone's
standard local time.
Applications that can't bear such ambiguities should avoid using hybrid
-:class:`tzinfo` subclasses; there are no ambiguities when using UTC, or any
-other fixed-offset :class:`tzinfo` subclass (such as a class representing only
-EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)).
+:class:`tzinfo` subclasses; there are no ambiguities when using :class:`timezone`,
+or any other fixed-offset :class:`tzinfo` subclass (such as a class representing
+only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)).
+
+
+.. _datetime-timezone:
+
+:class:`timezone` Objects
+--------------------------
+
+A :class:`timezone` object represents a timezone that is defined by a
+fixed offset from UTC. Note that objects of this class cannot be used
+to represent timezone information in the locations where different
+offsets are used in different days of the year or where historical
+changes have been made to civil time.
+
+
+.. class:: timezone(offset[, name])
+
+ The *offset* argument must be specified as a :class:`timedelta`
+ object representing the difference between the local time and UTC. It must
+ be strictly between ``-timedelta(hours=24)`` and
+ ``timedelta(hours=24)`` and represent a whole number of minutes,
+ otherwise :exc:`ValueError` is raised.
+
+ The *name* argument is optional. If specified it must be a string that
+ is used as the value returned by the ``tzname(dt)`` method. Otherwise,
+ ``tzname(dt)`` returns a string 'UTCsHH:MM', where s is the sign of
+ *offset*, HH and MM are two digits of ``offset.hours`` and
+ ``offset.minutes`` respectively.
+
+.. method:: timezone.utcoffset(dt)
+
+ Return the fixed value specified when the :class:`timezone` instance is
+ constructed. The *dt* argument is ignored. The return value is a
+ :class:`timedelta` instance equal to the difference between the
+ local time and UTC.
+
+.. method:: timezone.tzname(dt)
+
+ Return the fixed value specified when the :class:`timezone` instance is
+ constructed or a string 'UTCsHH:MM', where s is the sign of
+ *offset*, HH and MM are two digits of ``offset.hours`` and
+ ``offset.minutes`` respectively.
+
+.. method:: timezone.dst(dt)
+
+ Always returns ``None``.
+
+.. method:: timezone.fromutc(dt)
+
+ Return ``dt + offset``. The *dt* argument must be an aware
+ :class:`datetime` instance, with ``tzinfo`` set to ``self``.
+
+Class attributes:
+
+.. attribute:: timezone.utc
+
+ The UTC timezone, ``timezone(timedelta(0))``.
.. _strftime-strptime-behavior:
@@ -1549,9 +1661,6 @@ version) requires, and these work on all platforms with a standard C
implementation. Note that the 1999 version of the C standard added additional
format codes.
-The exact range of years for which :meth:`strftime` works also varies across
-platforms. Regardless of platform, years before 1900 cannot be used.
-
+-----------+--------------------------------+-------+
| Directive | Meaning | Notes |
+===========+================================+=======+
@@ -1594,7 +1703,7 @@ platforms. Regardless of platform, years before 1900 cannot be used.
| | AM or PM. | |
+-----------+--------------------------------+-------+
| ``%S`` | Second as a decimal number | \(3) |
-| | [00,61]. | |
+| | [00,59]. | |
+-----------+--------------------------------+-------+
| ``%U`` | Week number of the year | \(4) |
| | (Sunday as the first day of | |
@@ -1624,10 +1733,11 @@ platforms. Regardless of platform, years before 1900 cannot be used.
| ``%y`` | Year without century as a | |
| | decimal number [00,99]. | |
+-----------+--------------------------------+-------+
-| ``%Y`` | Year with century as a decimal | |
-| | number. | |
+| ``%Y`` | Year with century as a decimal | \(5) |
+| | number [0001,9999] (strptime), | |
+| | [1000,9999] (strftime). | |
+-----------+--------------------------------+-------+
-| ``%z`` | UTC offset in the form +HHMM | \(5) |
+| ``%z`` | UTC offset in the form +HHMM | \(6) |
| | or -HHMM (empty string if the | |
| | the object is naive). | |
+-----------+--------------------------------+-------+
@@ -1651,17 +1761,30 @@ Notes:
the output hour field if the ``%I`` directive is used to parse the hour.
(3)
- The range really is ``0`` to ``61``; according to the Posix standard this
- accounts for leap seconds and the (very rare) double leap seconds.
- The :mod:`time` module may produce and does accept leap seconds since
- it is based on the Posix standard, but the :mod:`datetime` module
- does not accept leap seconds in :meth:`strptime` input nor will it
- produce them in :func:`strftime` output.
+ Unlike :mod:`time` module, :mod:`datetime` module does not support
+ leap seconds.
(4)
When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used in
calculations when the day of the week and the year are specified.
(5)
+ For technical reasons, :meth:`strftime` method does not support
+ dates before year 1000: ``t.strftime(format)`` will raise a
+ :exc:`ValueError` when ``t.year < 1000`` even if ``format`` does
+ not contain ``%Y`` directive. The :meth:`strptime` method can
+ parse years in the full [1, 9999] range, but years < 1000 must be
+ zero-filled to 4-digit width.
+
+ .. versionchanged:: 3.2
+ In previous versions, :meth:`strftime` method was restricted to
+ years >= 1900.
+
+(6)
For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``,
``%z`` is replaced with the string ``'-0330'``.
+
+.. versionchanged:: 3.2
+ When the ``%z`` directive is provided to the :meth:`strptime` method, an
+ aware :class:`datetime` object will be produced. The ``tzinfo`` of the
+ result will be set to a :class:`timezone` instance.
diff --git a/Doc/library/dbm.rst b/Doc/library/dbm.rst
index cbefc1aa11..e3d50b9d94 100644
--- a/Doc/library/dbm.rst
+++ b/Doc/library/dbm.rst
@@ -61,10 +61,15 @@ the Oracle Berkeley DB.
modified by the prevailing umask).
-The object returned by :func:`.open` supports most of the same functionality as
+The object returned by :func:`.open` supports the same basic functionality as
dictionaries; keys and their corresponding values can be stored, retrieved, and
deleted, and the :keyword:`in` operator and the :meth:`keys` method are
-available. Key and values are always stored as bytes. This means that when
+available, as well as :meth:`get` and :meth:`setdefault`.
+
+.. versionchanged:: 3.2
+ :meth:`get` and :meth:`setdefault` are now available in all database modules.
+
+Key and values are always stored as bytes. This means that when
strings are used they are implicitly converted to the default encoding before
being stored.
diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst
index 758dcce9e3..9d5b32ffac 100644
--- a/Doc/library/decimal.rst
+++ b/Doc/library/decimal.rst
@@ -123,15 +123,14 @@ precision, rounding, or enabled traps::
>>> from decimal import *
>>> getcontext()
Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999999, Emax=999999999,
- capitals=1, flags=[], traps=[Overflow, DivisionByZero,
+ capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero,
InvalidOperation])
>>> getcontext().prec = 7 # Set a new precision
-Decimal instances can be constructed from integers, strings, or tuples. To
-create a Decimal from a :class:`float`, first convert it to a string. This
-serves as an explicit reminder of the details of the conversion (including
-representation error). Decimal numbers include special values such as
+Decimal instances can be constructed from integers, strings, floats, or tuples.
+Construction from an integer or a float performs an exact conversion of the
+value of that integer or float. Decimal numbers include special values such as
:const:`NaN` which stands for "Not a number", positive and negative
:const:`Infinity`, and :const:`-0`.
@@ -140,10 +139,12 @@ representation error). Decimal numbers include special values such as
Decimal('10')
>>> Decimal('3.14')
Decimal('3.14')
+ >>> Decimal(3.14)
+ Decimal('3.140000000000000124344978758017532527446746826171875')
>>> Decimal((0, (3, 1, 4), -2))
Decimal('3.14')
>>> Decimal(str(2.0 ** 0.5))
- Decimal('1.41421356237')
+ Decimal('1.4142135623730951')
>>> Decimal(2) ** Decimal('0.5')
Decimal('1.414213562373095048801688724')
>>> Decimal('NaN')
@@ -244,7 +245,7 @@ enabled:
>>> ExtendedContext
Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999999, Emax=999999999,
- capitals=1, flags=[], traps=[])
+ capitals=1, clamp=0, flags=[], traps=[])
>>> setcontext(ExtendedContext)
>>> Decimal(1) / Decimal(7)
Decimal('0.142857143')
@@ -269,7 +270,7 @@ using the :meth:`clear_flags` method. ::
Decimal('3.14159292')
>>> getcontext()
Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999999, Emax=999999999,
- capitals=1, flags=[Inexact, Rounded], traps=[])
+ capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[])
The *flags* entry shows that the rational approximation to :const:`Pi` was
rounded (digits beyond the context precision were thrown away) and that the
@@ -309,7 +310,7 @@ Decimal objects
Construct a new :class:`Decimal` object based from *value*.
- *value* can be an integer, string, tuple, or another :class:`Decimal`
+ *value* can be an integer, string, tuple, :class:`float`, or another :class:`Decimal`
object. If no *value* is given, returns ``Decimal('0')``. If *value* is a
string, it should conform to the decimal numeric string syntax after leading
and trailing whitespace characters are removed::
@@ -335,6 +336,12 @@ Decimal objects
digits, and an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), -3))``
returns ``Decimal('1.414')``.
+ If *value* is a :class:`float`, the binary floating point value is losslessly
+ converted to its exact decimal equivalent. This conversion can often require
+ 53 or more digits of precision. For example, ``Decimal(float('1.1'))``
+ converts to
+ ``Decimal('1.100000000000000088817841970012523233890533447265625')``.
+
The *context* precision does not affect how many digits are stored. That is
determined exclusively by the number of digits in *value*. For example,
``Decimal('3.00000')`` records all five zeros even if the context precision is
@@ -347,6 +354,10 @@ Decimal objects
Once constructed, :class:`Decimal` objects are immutable.
+ .. versionchanged:: 3.2
+ The argument to the constructor is now permitted to be a :class:`float`
+ instance.
+
Decimal floating point objects share many properties with the other built-in
numeric types such as :class:`float` and :class:`int`. All of the usual math
operations and special methods apply. Likewise, decimal objects can be
@@ -354,6 +365,18 @@ Decimal objects
compared, sorted, and coerced to another type (such as :class:`float` or
:class:`int`).
+ Decimal objects cannot generally be combined with floats or
+ instances of :class:`fractions.Fraction` in arithmetic operations:
+ an attempt to add a :class:`Decimal` to a :class:`float`, for
+ example, will raise a :exc:`TypeError`. However, it is possible to
+ use Python's comparison operators to compare a :class:`Decimal`
+ instance ``x`` with another number ``y``. This avoids confusing results
+ when doing equality comparisons between numbers of different types.
+
+ .. versionchanged:: 3.2
+ Mixed-type comparisons between :class:`Decimal` instances and other
+ numeric types are now fully supported.
+
In addition to the standard numeric properties, decimal floating point
objects also have a number of specialized methods:
@@ -468,6 +491,9 @@ Decimal objects
`0x1.999999999999ap-4`. That equivalent value in decimal is
`0.1000000000000000055511151231257827021181583404541015625`.
+ .. note:: From Python 3.2 onwards, a :class:`Decimal` instance
+ can also be constructed directly from a :class:`float`.
+
.. doctest::
>>> Decimal.from_float(0.1)
@@ -861,7 +887,7 @@ In addition to the three supplied contexts, new contexts can be created with the
:class:`Context` constructor.
-.. class:: Context(prec=None, rounding=None, traps=None, flags=None, Emin=None, Emax=None, capitals=1)
+.. class:: Context(prec=None, rounding=None, traps=None, flags=None, Emin=None, Emax=None, capitals=None, clamp=None)
Creates a new context. If a field is not specified or is :const:`None`, the
default values are copied from the :const:`DefaultContext`. If the *flags*
@@ -892,13 +918,33 @@ In addition to the three supplied contexts, new contexts can be created with the
:const:`1`, exponents are printed with a capital :const:`E`; otherwise, a
lowercase :const:`e` is used: :const:`Decimal('6.02e+23')`.
+ The *clamp* field is either :const:`0` (the default) or :const:`1`.
+ If set to :const:`1`, the exponent ``e`` of a :class:`Decimal`
+ instance representable in this context is strictly limited to the
+ range ``Emin - prec + 1 <= e <= Emax - prec + 1``. If *clamp* is
+ :const:`0` then a weaker condition holds: the adjusted exponent of
+ the :class:`Decimal` instance is at most ``Emax``. When *clamp* is
+ :const:`1`, a large normal number will, where possible, have its
+ exponent reduced and a corresponding number of zeros added to its
+ coefficient, in order to fit the exponent constraints; this
+ preserves the value of the number but loses information about
+ significant trailing zeros. For example::
+
+ >>> Context(prec=6, Emax=999, clamp=1).create_decimal('1.23e999')
+ Decimal('1.23000E+999')
+
+ A *clamp* value of :const:`1` allows compatibility with the
+ fixed-width decimal interchange formats specified in IEEE 754.
The :class:`Context` class defines several general purpose methods as well as
a large number of methods for doing arithmetic directly in a given context.
In addition, for each of the :class:`Decimal` methods described above (with
the exception of the :meth:`adjusted` and :meth:`as_tuple` methods) there is
- a corresponding :class:`Context` method. For example, ``C.exp(x)`` is
- equivalent to ``x.exp(context=C)``.
+ a corresponding :class:`Context` method. For example, for a :class:`Context`
+ instance ``C`` and :class:`Decimal` instance ``x``, ``C.exp(x)`` is
+ equivalent to ``x.exp(context=C)``. Each :class:`Context` method accepts a
+ Python integer (an instance of :class:`int`) anywhere that a
+ Decimal instance is accepted.
.. method:: clear_flags()
@@ -963,7 +1009,6 @@ In addition to the three supplied contexts, new contexts can be created with the
value for subnormal results. When underflow occurs, the exponent is set
to :const:`Etiny`.
-
.. method:: Etop()
Returns a value equal to ``Emax - prec + 1``.
@@ -1612,7 +1657,8 @@ to work with the :class:`Decimal` class::
build(trailneg)
for i in range(places):
build(next() if digits else '0')
- build(dp)
+ if places:
+ build(dp)
if not digits:
build('0')
i = 0
@@ -1672,6 +1718,9 @@ to work with the :class:`Decimal` class::
def cos(x):
"""Return the cosine of x as measured in radians.
+ The Taylor series approximation works best for a small value of x.
+ For larger values, first compute x = x % (2 * pi).
+
>>> print(cos(Decimal('0.5')))
0.8775825618903727161162815826
>>> print(cos(0.5))
@@ -1695,6 +1744,9 @@ to work with the :class:`Decimal` class::
def sin(x):
"""Return the sine of x as measured in radians.
+ The Taylor series approximation works best for a small value of x.
+ For larger values, first compute x = x % (2 * pi).
+
>>> print(sin(Decimal('0.5')))
0.4794255386042030002732879352
>>> print(sin(0.5))
@@ -1821,37 +1873,15 @@ value unchanged:
Q. Is there a way to convert a regular float to a :class:`Decimal`?
-A. Yes, all binary floating point numbers can be exactly expressed as a
-Decimal. An exact conversion may take more precision than intuition would
-suggest, so we trap :const:`Inexact` to signal a need for more precision:
-
-.. testcode::
-
- def float_to_decimal(f):
- "Convert a floating point number to a Decimal with no loss of information"
- n, d = f.as_integer_ratio()
- with localcontext() as ctx:
- ctx.traps[Inexact] = True
- while True:
- try:
- return Decimal(n) / Decimal(d)
- except Inexact:
- ctx.prec += 1
+A. Yes, any binary floating point number can be exactly expressed as a
+Decimal though an exact conversion may take more precision than intuition would
+suggest:
.. doctest::
- >>> float_to_decimal(math.pi)
+ >>> Decimal(math.pi)
Decimal('3.141592653589793115997963468544185161590576171875')
-Q. Why isn't the :func:`float_to_decimal` routine included in the module?
-
-A. There is some question about whether it is advisable to mix binary and
-decimal floating point. Also, its use requires some care to avoid the
-representation issues associated with binary floating point:
-
- >>> float_to_decimal(1.1)
- Decimal('1.100000000000000088817841970012523233890533447265625')
-
Q. Within a complex calculation, how can I make sure that I haven't gotten a
spurious result because of insufficient precision or rounding anomalies.
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index 6dea8c1bb8..bdc37b3e0a 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -17,6 +17,7 @@ can be used for example, for comparing files, and can produce difference
information in various formats, including HTML and context and unified
diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
+
.. class:: SequenceMatcher
This is a flexible class for comparing pairs of sequences of any type, so long
@@ -35,11 +36,17 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
complicated way on how many elements the sequences have in common; best case
time is linear.
- **Heuristic:** To speed-up matching, items whose duplicates appear more than 1% of
- the time in sequences of at least 200 items are treated as junk. This has the
- unfortunate side-effect of giving bad results for sequences constructed from
- a small set of items. An option to turn off the heuristic will be added to
- Python 3.2.
+ **Automatic junk heuristic:** :class:`SequenceMatcher` supports a heuristic that
+ automatically treats certain sequence items as junk. The heuristic counts how many
+ times each individual item appears in the sequence. If an item's duplicates (after
+ the first one) account for more than 1% of the sequence and the sequence is at least
+ 200 items long, this item is marked as "popular" and is treated as junk for
+ the purpose of sequence matching. This heuristic can be turned off by setting
+ the ``autojunk`` argument to ``False`` when creating the :class:`SequenceMatcher`.
+
+ .. versionadded:: 3.2
+ The *autojunk* parameter.
+
.. class:: Differ
@@ -145,8 +152,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
The context diff format normally has a header for filenames and modification
times. Any or all of these may be specified using strings for *fromfile*,
- *tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
- expressed in the format returned by :func:`time.ctime`. If not specified, the
+ *tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
+ expressed in the ISO 8601 format. If not specified, the
strings default to blanks.
>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
@@ -277,8 +284,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
The context diff format normally has a header for filenames and modification
times. Any or all of these may be specified using strings for *fromfile*,
- *tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
- expressed in the format returned by :func:`time.ctime`. If not specified, the
+ *tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
+ expressed in the ISO 8601 format. If not specified, the
strings default to blanks.
@@ -329,7 +336,7 @@ SequenceMatcher Objects
The :class:`SequenceMatcher` class has this constructor:
-.. class:: SequenceMatcher(isjunk=None, a='', b='')
+.. class:: SequenceMatcher(isjunk=None, a='', b='', autojunk=True)
Optional argument *isjunk* must be ``None`` (the default) or a one-argument
function that takes a sequence element and returns true if and only if the
@@ -345,6 +352,22 @@ The :class:`SequenceMatcher` class has this constructor:
The optional arguments *a* and *b* are sequences to be compared; both default to
empty strings. The elements of both sequences must be :term:`hashable`.
+ The optional argument *autojunk* can be used to disable the automatic junk
+ heuristic.
+
+ .. versionadded:: 3.2
+ The *autojunk* parameter.
+
+ SequenceMatcher objects get three data attributes: *bjunk* is the
+ set of elements of *b* for which *isjunk* is True; *bpopular* is the set of
+ non-junk elements considered popular by the heuristic (if it is not
+ disabled); *b2j* is a dict mapping the remaining elements of *b* to a list
+ of positions where they occur. All three are reset whenever *b* is reset
+ with :meth:`set_seqs` or :meth:`set_seq2`.
+
+ .. versionadded:: 3.2
+ The *bjunk* and *bpopular* attributes.
+
:class:`SequenceMatcher` objects have the following methods:
.. method:: set_seqs(a, b)
@@ -460,13 +483,15 @@ The :class:`SequenceMatcher` class has this constructor:
>>> b = "abycdf"
>>> s = SequenceMatcher(None, a, b)
>>> for tag, i1, i2, j1, j2 in s.get_opcodes():
- ... print(("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %
- ... (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2])))
- delete a[0:1] (q) b[0:0] ()
- equal a[1:3] (ab) b[0:2] (ab)
- replace a[3:4] (x) b[2:3] (y)
- equal a[4:6] (cd) b[3:5] (cd)
- insert a[6:6] () b[5:6] (f)
+ print('{:7} a[{}:{}] --> b[{}:{}] {!r:>8} --> {!r}'.format(
+ tag, i1, i2, j1, j2, a[i1:i2], b[j1:j2]))
+
+
+ delete a[0:1] --> b[0:0] 'q' --> ''
+ equal a[1:3] --> b[0:2] 'ab' --> 'ab'
+ replace a[3:4] --> b[2:3] 'x' --> 'y'
+ equal a[4:6] --> b[3:5] 'cd' --> 'cd'
+ insert a[6:6] --> b[5:6] '' --> 'f'
.. method:: get_grouped_opcodes(n=3)
@@ -524,7 +549,7 @@ different results due to differing levels of approximation, although
SequenceMatcher Examples
------------------------
-This example compares two strings, considering blanks to be "junk:"
+This example compares two strings, considering blanks to be "junk":
>>> s = SequenceMatcher(lambda x: x == " ",
... "private Thread currentThread;",
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index 4aae06b60b..79cc583b75 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -4,6 +4,9 @@
.. module:: dis
:synopsis: Disassembler for Python bytecode.
+**Source code:** :source:`Lib/dis.py`
+
+--------------
The :mod:`dis` module supports the analysis of CPython :term:`bytecode` by
disassembling it. The CPython bytecode which this module takes as an
@@ -12,7 +15,7 @@ and the interpreter.
.. impl-detail::
- Bytecode is an implementation detail of the CPython interpreter! No
+ Bytecode is an implementation detail of the CPython interpreter. No
guarantees are made that bytecode will not be added, removed, or changed
between versions of Python. Use of this module should not be considered to
work across Python VMs or Python releases.
@@ -36,6 +39,28 @@ the following command can be used to get the disassembly of :func:`myfunc`::
The :mod:`dis` module defines the following functions and constants:
+.. function:: code_info(x)
+
+ Return a formatted multi-line string with detailed code object information
+ for the supplied function, method, source code string or code object.
+
+ Note that the exact contents of code info strings are highly implementation
+ dependent and they may change arbitrarily across Python VMs or Python
+ releases.
+
+ .. versionadded:: 3.2
+
+
+.. function:: show_code(x)
+
+ Print detailed code object information for the supplied function, method,
+ source code string or code object to stdout.
+
+ This is a convenient shorthand for ``print(code_info(x))``, intended for
+ interactive exploration at the interpreter prompt.
+
+ .. versionadded:: 3.2
+
.. function:: dis(x=None)
Disassemble the *x* object. *x* can denote either a module, a class, a
@@ -172,15 +197,15 @@ The Python compiler currently generates the following bytecode instructions.
three.
-.. opcode:: ROT_FOUR
+.. opcode:: DUP_TOP
- Lifts second, third and forth stack item one position up, moves top down to
- position four.
+ Duplicates the reference on top of the stack.
-.. opcode:: DUP_TOP
+.. opcode:: DUP_TOP_TWO
- Duplicates the reference on top of the stack.
+ Duplicates the two references on top of the stack, leaving them in the
+ same order.
**Unary operations**
@@ -445,6 +470,18 @@ the stack so that it is available for further iterations of the loop.
by ``CALL_FUNCTION`` to construct a class.
+.. opcode:: SETUP_WITH (delta)
+
+ This opcode performs several operations before a with block starts. First,
+ it loads :meth:`~object.__exit__` from the context manager and pushes it onto
+ the stack for later use by :opcode:`WITH_CLEANUP`. Then,
+ :meth:`~object.__enter__` is called, and a finally block pointing to *delta*
+ is pushed. Finally, the result of calling the enter method is pushed onto
+ the stack. The next opcode will either ignore it (:opcode:`POP_TOP`), or
+ store it in (a) variable(s) (:opcode:`STORE_FAST`, :opcode:`STORE_NAME`, or
+ :opcode:`UNPACK_SEQUENCE`).
+
+
.. opcode:: WITH_CLEANUP
Cleans up the stack when a :keyword:`with` statement block exits. TOS is
@@ -507,12 +544,6 @@ the more significant byte last.
are put onto the stack right-to-left.
-.. opcode:: DUP_TOPX (count)
-
- Duplicate *count* items, keeping them in the same order. Due to implementation
- limits, *count* should be between 1 and 5 inclusive.
-
-
.. opcode:: STORE_ATTR (namei)
Implements ``TOS.name = TOS1``, where *namei* is the index of name in
@@ -695,6 +726,12 @@ the more significant byte last.
storage.
+.. opcode:: DELETE_DEREF (i)
+
+ Empties the cell contained in slot *i* of the cell and free variable storage.
+ Used by the :keyword:`del` statement.
+
+
.. opcode:: RAISE_VARARGS (argc)
Raises an exception. *argc* indicates the number of parameters to the raise
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst
index 5f40432e45..29fbd64504 100644
--- a/Doc/library/doctest.rst
+++ b/Doc/library/doctest.rst
@@ -452,8 +452,9 @@ Some details you should read once, but won't need to remember:
with an alphanumeric is taken to be the start of the exception detail. Of
course this does the right thing for genuine tracebacks.
-* When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is is specified,
- everything following the leftmost colon is ignored.
+* When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is specified,
+ everything following the leftmost colon and any module information in the
+ exception name is ignored.
* The interactive shell omits the traceback header line for some
:exc:`SyntaxError`\ s. But doctest uses the traceback header line to
@@ -543,20 +544,38 @@ doctest decides whether actual output matches an example's expected output:
exception raised is ``ValueError: 3*14``, but will fail, e.g., if
:exc:`TypeError` is raised.
- Note that a similar effect can be obtained using :const:`ELLIPSIS`, and
- :const:`IGNORE_EXCEPTION_DETAIL` may go away when Python releases prior to 2.4
- become uninteresting. Until then, :const:`IGNORE_EXCEPTION_DETAIL` is the only
- clear way to write a doctest that doesn't care about the exception detail yet
- continues to pass under Python releases prior to 2.4 (doctest directives appear
- to be comments to them). For example, ::
+ It will also ignore the module name used in Python 3 doctest reports. Hence
+ both these variations will work regardless of whether the test is run under
+ Python 2.7 or Python 3.2 (or later versions):
+
+ >>> raise CustomError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+ Traceback (most recent call last):
+ CustomError: message
+
+ >>> raise CustomError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+ Traceback (most recent call last):
+ my_module.CustomError: message
+
+ Note that :const:`ELLIPSIS` can also be used to ignore the
+ details of the exception message, but such a test may still fail based
+ on whether or not the module details are printed as part of the
+ exception name. Using :const:`IGNORE_EXCEPTION_DETAIL` and the details
+ from Python 2.3 is also the only clear way to write a doctest that doesn't
+ care about the exception detail yet continues to pass under Python 2.3 or
+ earlier (those releases do not support doctest directives and ignore them
+ as irrelevant comments). For example, ::
>>> (1, 2)[3] = 'moo' #doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: object doesn't support item assignment
- passes under Python 2.4 and Python 2.3. The detail changed in 2.4, to say "does
- not" instead of "doesn't".
+ passes under Python 2.3 and later Python versions, even though the detail
+ changed in Python 2.4 to say "does not" instead of "doesn't".
+
+ .. versionchanged:: 3.2
+ :const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating
+ to the module containing the exception under test.
.. data:: SKIP
@@ -671,7 +690,6 @@ usually the only meaningful choice. However, option flags can also be passed to
functions that run doctests, establishing different defaults. In such cases,
disabling an option via ``-`` in a directive can be useful.
-
There's also a way to register new option flag names, although this isn't useful
unless you intend to extend :mod:`doctest` internals via subclassing:
@@ -895,18 +913,16 @@ Unittest API
As your collection of doctest'ed modules grows, you'll want a way to run all
their doctests systematically. :mod:`doctest` provides two functions that can
be used to create :mod:`unittest` test suites from modules and text files
-containing doctests. These test suites can then be run using :mod:`unittest`
-test runners::
+containing doctests. To integrate with :mod:`unittest` test discovery, include
+a :func:`load_tests` function in your test module::
import unittest
import doctest
- import my_module_with_doctests, and_another
+ import my_module_with_doctests
- suite = unittest.TestSuite()
- for mod in my_module_with_doctests, and_another:
- suite.addTest(doctest.DocTestSuite(mod))
- runner = unittest.TextTestRunner()
- runner.run(suite)
+ def load_tests(loader, tests, ignore):
+ tests.addTests(doctest.DocTestSuite(my_module_with_doctests))
+ return tests
There are two main functions for creating :class:`unittest.TestSuite` instances
from text files and modules with doctests:
diff --git a/Doc/library/dummy_threading.rst b/Doc/library/dummy_threading.rst
index 0658df2d27..b578324873 100644
--- a/Doc/library/dummy_threading.rst
+++ b/Doc/library/dummy_threading.rst
@@ -4,6 +4,9 @@
.. module:: dummy_threading
:synopsis: Drop-in replacement for the threading module.
+**Source code:** :source:`Lib/dummy_threading.py`
+
+--------------
This module provides a duplicate interface to the :mod:`threading` module. It
is meant to be imported when the :mod:`_thread` module is not provided on a
diff --git a/Doc/library/email-examples.rst b/Doc/library/email-examples.rst
index c1b16da394..32cecf3486 100644
--- a/Doc/library/email-examples.rst
+++ b/Doc/library/email-examples.rst
@@ -11,6 +11,12 @@ First, let's see how to create and send a simple text message:
.. literalinclude:: ../includes/email-simple.py
+And parsing RFC822 headers can easily be done by the parse(filename) or
+parsestr(message_as_string) methods of the Parser() class:
+
+.. literalinclude:: ../includes/email-headers.py
+
+
Here's an example of how to send a MIME message containing a bunch of family
pictures that may be residing in a directory:
diff --git a/Doc/library/email.generator.rst b/Doc/library/email.generator.rst
index 930905aee0..85b32fe7fe 100644
--- a/Doc/library/email.generator.rst
+++ b/Doc/library/email.generator.rst
@@ -22,6 +22,12 @@ the Generator on a :class:`~email.message.Message` constructed by program may
result in changes to the :class:`~email.message.Message` object as defaults are
filled in.
+:class:`bytes` output can be generated using the :class:`BytesGenerator` class.
+If the message object structure contains non-ASCII bytes, this generator's
+:meth:`~BytesGenerator.flatten` method will emit the original bytes. Parsing a
+binary message and then flattening it with :class:`BytesGenerator` should be
+idempotent for standards compliant messages.
+
Here are the public methods of the :class:`Generator` class, imported from the
:mod:`email.generator` module:
@@ -50,7 +56,7 @@ Here are the public methods of the :class:`Generator` class, imported from the
The other public :class:`Generator` methods are:
- .. method:: flatten(msg, unixfrom=False)
+ .. method:: flatten(msg, unixfrom=False, linesep='\\n')
Print the textual representation of the message object structure rooted at
*msg* to the output file specified when the :class:`Generator` instance
@@ -65,6 +71,21 @@ Here are the public methods of the :class:`Generator` class, imported from the
Note that for subparts, no envelope header is ever printed.
+ Optional *linesep* specifies the line separator character used to
+ terminate lines in the output. It defaults to ``\n`` because that is
+ the most useful value for Python application code (other library packages
+ expect ``\n`` separated lines). ``linesep=\r\n`` can be used to
+ generate output with RFC-compliant line separators.
+
+ Messages parsed with a Bytes parser that have a
+ :mailheader:`Content-Transfer-Encoding` of 8bit will be converted to a
+ use a 7bit Content-Transfer-Encoding. Non-ASCII bytes in the headers
+ will be :rfc:`2047` encoded with a charset of `unknown-8bit`.
+
+ .. versionchanged:: 3.2
+ Added support for re-encoding 8bit message bodies, and the *linesep*
+ argument.
+
.. method:: clone(fp)
Return an independent clone of this :class:`Generator` instance with the
@@ -76,11 +97,81 @@ Here are the public methods of the :class:`Generator` class, imported from the
:class:`Generator`'s constructor. This provides just enough file-like API
for :class:`Generator` instances to be used in the :func:`print` function.
-As a convenience, see the methods :meth:`Message.as_string` and
-``str(aMessage)``, a.k.a. :meth:`Message.__str__`, which simplify the generation
-of a formatted string representation of a message object. For more detail, see
+As a convenience, see the :class:`~email.message.Message` methods
+:meth:`~email.message.Message.as_string` and ``str(aMessage)``, a.k.a.
+:meth:`~email.message.Message.__str__`, which simplify the generation of a
+formatted string representation of a message object. For more detail, see
:mod:`email.message`.
+.. class:: BytesGenerator(outfp, mangle_from_=True, maxheaderlen=78)
+
+ The constructor for the :class:`BytesGenerator` class takes a binary
+ :term:`file-like object` called *outfp* for an argument. *outfp* must
+ support a :meth:`write` method that accepts binary data.
+
+ Optional *mangle_from_* is a flag that, when ``True``, puts a ``>``
+ character in front of any line in the body that starts exactly as ``From``,
+ i.e. ``From`` followed by a space at the beginning of the line. This is the
+ only guaranteed portable way to avoid having such lines be mistaken for a
+ Unix mailbox format envelope header separator (see `WHY THE CONTENT-LENGTH
+ FORMAT IS BAD <http://www.jwz.org/doc/content-length.html>`_ for details).
+ *mangle_from_* defaults to ``True``, but you might want to set this to
+ ``False`` if you are not writing Unix mailbox format files.
+
+ Optional *maxheaderlen* specifies the longest length for a non-continued
+ header. When a header line is longer than *maxheaderlen* (in characters,
+ with tabs expanded to 8 spaces), the header will be split as defined in the
+ :class:`~email.header.Header` class. Set to zero to disable header
+ wrapping. The default is 78, as recommended (but not required) by
+ :rfc:`2822`.
+
+ The other public :class:`BytesGenerator` methods are:
+
+
+ .. method:: flatten(msg, unixfrom=False, linesep='\n')
+
+ Print the textual representation of the message object structure rooted
+ at *msg* to the output file specified when the :class:`BytesGenerator`
+ instance was created. Subparts are visited depth-first and the resulting
+ text will be properly MIME encoded. If the input that created the *msg*
+ contained bytes with the high bit set and those bytes have not been
+ modified, they will be copied faithfully to the output, even if doing so
+ is not strictly RFC compliant. (To produce strictly RFC compliant
+ output, use the :class:`Generator` class.)
+
+ Messages parsed with a Bytes parser that have a
+ :mailheader:`Content-Transfer-Encoding` of 8bit will be reconstructed
+ as 8bit if they have not been modified.
+
+ Optional *unixfrom* is a flag that forces the printing of the envelope
+ header delimiter before the first :rfc:`2822` header of the root message
+ object. If the root object has no envelope header, a standard one is
+ crafted. By default, this is set to ``False`` to inhibit the printing of
+ the envelope delimiter.
+
+ Note that for subparts, no envelope header is ever printed.
+
+ Optional *linesep* specifies the line separator character used to
+ terminate lines in the output. It defaults to ``\n`` because that is
+ the most useful value for Python application code (other library packages
+ expect ``\n`` separated lines). ``linesep=\r\n`` can be used to
+ generate output with RFC-compliant line separators.
+
+ .. method:: clone(fp)
+
+ Return an independent clone of this :class:`BytesGenerator` instance with
+ the exact same options.
+
+ .. method:: write(s)
+
+ Write the string *s* to the underlying file object. *s* is encoded using
+ the ``ASCII`` codec and written to the *write* method of the *outfp*
+ *outfp* passed to the :class:`BytesGenerator`'s constructor. This
+ provides just enough file-like API for :class:`BytesGenerator` instances
+ to be used in the :func:`print` function.
+
+ .. versionadded:: 3.2
+
The :mod:`email.generator` module also provides a derived class, called
:class:`DecodedGenerator` which is like the :class:`Generator` base class,
except that non-\ :mimetype:`text` parts are substituted with a format string
diff --git a/Doc/library/email.header.rst b/Doc/library/email.header.rst
index 2202637027..c385cf31c8 100644
--- a/Doc/library/email.header.rst
+++ b/Doc/library/email.header.rst
@@ -104,25 +104,48 @@ Here is the :class:`Header` class description:
Optional *errors* is passed as the errors argument to the decode call
if *s* is a byte string.
- .. method:: encode(splitchars=';, \\t', maxlinelen=None)
+
+ .. method:: encode(splitchars=';, \\t', maxlinelen=None, linesep='\\n')
Encode a message header into an RFC-compliant format, possibly wrapping
long lines and encapsulating non-ASCII parts in base64 or quoted-printable
- encodings. Optional *splitchars* is a string containing characters to
- split long ASCII lines on, in rough support of :rfc:`2822`'s *highest
- level syntactic breaks*. This doesn't affect :rfc:`2047` encoded lines.
+ encodings.
+
+ Optional *splitchars* is a string containing characters which should be
+ given extra weight by the splitting algorithm during normal header
+ wrapping. This is in very rough support of :RFC:`2822`\'s 'higher level
+ syntactic breaks': split points preceded by a splitchar are preferred
+ during line splitting, with the characters preferred in the order in
+ which they appear in the string. Space and tab may be included in the
+ string to indicate whether preference should be given to one over the
+ other as a split point when other split chars do not appear in the line
+ being split. Splitchars does not affect :RFC:`2047` encoded lines.
*maxlinelen*, if given, overrides the instance's value for the maximum
line length.
+ *linesep* specifies the characters used to separate the lines of the
+ folded header. It defaults to the most useful value for Python
+ application code (``\n``), but ``\r\n`` can be specified in order
+ to produce headers with RFC-compliant line separators.
+
+ .. versionchanged:: 3.2
+ Added the *linesep* argument.
+
The :class:`Header` class also provides a number of methods to support
standard operators and built-in functions.
.. method:: __str__()
- A helper for :class:`str`'s :func:`encode` method. Returns the header as
- a Unicode string.
+ Returns an approximation of the :class:`Header` as a string, using an
+ unlimited line length. All pieces are converted to unicode using the
+ specified encoding and joined together appropriately. Any pieces with a
+ charset of `unknown-8bit` are decoded as `ASCII` using the `replace`
+ error handler.
+
+ .. versionchanged:: 3.2
+ Added handling for the `unknown-8bit` charset.
.. method:: __eq__(other)
diff --git a/Doc/library/email.message.rst b/Doc/library/email.message.rst
index 4b23f6acd9..1e6a485353 100644
--- a/Doc/library/email.message.rst
+++ b/Doc/library/email.message.rst
@@ -112,9 +112,18 @@ Here are the methods of the :class:`Message` class:
be decoded if this header's value is ``quoted-printable`` or ``base64``.
If some other encoding is used, or :mailheader:`Content-Transfer-Encoding`
header is missing, or if the payload has bogus base64 data, the payload is
- returned as-is (undecoded). If the message is a multipart and the
- *decode* flag is ``True``, then ``None`` is returned. The default for
- *decode* is ``False``.
+ returned as-is (undecoded). In all cases the returned value is binary
+ data. If the message is a multipart and the *decode* flag is ``True``,
+ then ``None`` is returned.
+
+ When *decode* is ``False`` (the default) the body is returned as a string
+ without decoding the :mailheader:`Content-Transfer-Encoding`. However,
+ for a :mailheader:`Content-Transfer-Encoding` of 8bit, an attempt is made
+ to decode the original bytes using the ``charset`` specified by the
+ :mailheader:`Content-Type` header, using the ``replace`` error handler.
+ If no ``charset`` is specified, or if the ``charset`` given is not
+ recognized by the email package, the body is decoded using the default
+ ASCII charset.
.. method:: set_payload(payload, charset=None)
@@ -168,6 +177,11 @@ Here are the methods of the :class:`Message` class:
Note that in all cases, any envelope header present in the message is not
included in the mapping interface.
+ In a model generated from bytes, any header values that (in contravention of
+ the RFCs) contain non-ASCII bytes will, when retrieved through this
+ interface, be represented as :class:`~email.header.Header` objects with
+ a charset of `unknown-8bit`.
+
.. method:: __len__()
@@ -263,10 +277,10 @@ Here are the methods of the :class:`Message` class:
it can be specified as a three tuple in the format
``(CHARSET, LANGUAGE, VALUE)``, where ``CHARSET`` is a string naming the
charset to be used to encode the value, ``LANGUAGE`` can usually be set
- to ``None`` or the empty string (see :RFC:`2231` for other possibilities),
+ to ``None`` or the empty string (see :rfc:`2231` for other possibilities),
and ``VALUE`` is the string value containing non-ASCII code points. If
a three tuple is not passed and the value contains non-ASCII characters,
- it is automatically encoded in :RFC`2231` format using a ``CHARSET``
+ it is automatically encoded in :rfc:`2231` format using a ``CHARSET``
of ``utf-8`` and a ``LANGUAGE`` of ``None``.
Here's an example::
diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst
index 32f4ff164b..77a0b698d1 100644
--- a/Doc/library/email.parser.rst
+++ b/Doc/library/email.parser.rst
@@ -80,6 +80,14 @@ Here is the API for the :class:`FeedParser`:
if you feed more data to a closed :class:`FeedParser`.
+.. class:: BytesFeedParser(_factory=email.message.Message)
+
+ Works exactly like :class:`FeedParser` except that the input to the
+ :meth:`~FeedParser.feed` method must be bytes and not string.
+
+ .. versionadded:: 3.2
+
+
Parser class API
^^^^^^^^^^^^^^^^
@@ -131,7 +139,7 @@ class.
Similar to the :meth:`parse` method, except it takes a string object
instead of a file-like object. Calling this method on a string is exactly
- equivalent to wrapping *text* in a :class:`StringIO` instance first and
+ equivalent to wrapping *text* in a :class:`~io.StringIO` instance first and
calling :meth:`parse`.
Optional *headersonly* is a flag specifying whether to stop parsing after
@@ -139,25 +147,78 @@ class.
the entire contents of the file.
+.. class:: BytesParser(_class=email.message.Message, strict=None)
+
+ This class is exactly parallel to :class:`Parser`, but handles bytes input.
+ The *_class* and *strict* arguments are interpreted in the same way as for
+ the :class:`Parser` constructor. *strict* is supported only to make porting
+ code easier; it is deprecated.
+
+ .. method:: parse(fp, headeronly=False)
+
+ Read all the data from the binary file-like object *fp*, parse the
+ resulting bytes, and return the message object. *fp* must support
+ both the :meth:`readline` and the :meth:`read` methods on file-like
+ objects.
+
+ The bytes contained in *fp* must be formatted as a block of :rfc:`2822`
+ style headers and header continuation lines, optionally preceded by a
+ envelope header. The header block is terminated either by the end of the
+ data or by a blank line. Following the header block is the body of the
+ message (which may contain MIME-encoded subparts, including subparts
+ with a :mailheader:`Content-Transfer-Encoding` of ``8bit``.
+
+ Optional *headersonly* is a flag specifying whether to stop parsing after
+ reading the headers or not. The default is ``False``, meaning it parses
+ the entire contents of the file.
+
+ .. method:: parsebytes(bytes, headersonly=False)
+
+ Similar to the :meth:`parse` method, except it takes a byte string object
+ instead of a file-like object. Calling this method on a byte string is
+ exactly equivalent to wrapping *text* in a :class:`~io.BytesIO` instance
+ first and calling :meth:`parse`.
+
+ Optional *headersonly* is as with the :meth:`parse` method.
+
+ .. versionadded:: 3.2
+
+
Since creating a message object structure from a string or a file object is such
-a common task, two functions are provided as a convenience. They are available
+a common task, four functions are provided as a convenience. They are available
in the top-level :mod:`email` package namespace.
.. currentmodule:: email
-.. function:: message_from_string(s[, _class][, strict])
+.. function:: message_from_string(s, _class=email.message.Message, strict=None)
Return a message object structure from a string. This is exactly equivalent to
``Parser().parsestr(s)``. Optional *_class* and *strict* are interpreted as
with the :class:`Parser` class constructor.
+.. function:: message_from_bytes(s, _class=email.message.Message, strict=None)
+
+ Return a message object structure from a byte string. This is exactly
+ equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and
+ *strict* are interpreted as with the :class:`Parser` class constructor.
+
+ .. versionadded:: 3.2
-.. function:: message_from_file(fp[, _class][, strict])
+.. function:: message_from_file(fp, _class=email.message.Message, strict=None)
Return a message object structure tree from an open :term:`file object`.
This is exactly equivalent to ``Parser().parse(fp)``. Optional *_class*
and *strict* are interpreted as with the :class:`Parser` class constructor.
+.. function:: message_from_binary_file(fp, _class=email.message.Message, strict=None)
+
+ Return a message object structure tree from an open binary :term:`file
+ object`. This is exactly equivalent to ``BytesParser().parse(fp)``.
+ Optional *_class* and *strict* are interpreted as with the :class:`Parser`
+ class constructor.
+
+ .. versionadded:: 3.2
+
Here's an example of how you might use this at an interactive Python prompt::
>>> import email
diff --git a/Doc/library/email.rst b/Doc/library/email.rst
index d3f1908150..4530b9506e 100644
--- a/Doc/library/email.rst
+++ b/Doc/library/email.rst
@@ -6,7 +6,7 @@
email messages, including MIME documents.
.. moduleauthor:: Barry A. Warsaw <barry@python.org>
.. sectionauthor:: Barry A. Warsaw <barry@python.org>
-.. Copyright (C) 2001-2007 Python Software Foundation
+.. Copyright (C) 2001-2010 Python Software Foundation
The :mod:`email` package is a library for managing email messages, including
@@ -92,6 +92,44 @@ table also describes the Python compatibility of each version of the package.
+---------------+------------------------------+-----------------------+
| :const:`4.0` | Python 2.5 | Python 2.3 to 2.5 |
+---------------+------------------------------+-----------------------+
+| :const:`5.0` | Python 3.0 and Python 3.1 | Python 3.0 to 3.2 |
++---------------+------------------------------+-----------------------+
+| :const:`5.1` | Python 3.2 | Python 3.0 to 3.2 |
++---------------+------------------------------+-----------------------+
+
+Here are the major differences between :mod:`email` version 5.1 and
+version 5.0:
+
+* It is once again possible to parse messages containing non-ASCII bytes,
+ and to reproduce such messages if the data containing the non-ASCII
+ bytes is not modified.
+
+* New functions :func:`message_from_bytes` and :func:`message_from_binary_file`,
+ and new classes :class:`~email.parser.BytesFeedParser` and
+ :class:`~email.parser.BytesParser` allow binary message data to be parsed
+ into model objects.
+
+* Given bytes input to the model, :meth:`~email.message.Message.get_payload`
+ will by default decode a message body that has a
+ :mailheader:`Content-Transfer-Encoding` of ``8bit`` using the charset
+ specified in the MIME headers and return the resulting string.
+
+* Given bytes input to the model, :class:`~email.generator.Generator` will
+ convert message bodies that have a :mailheader:`Content-Transfer-Encoding` of
+ 8bit to instead have a 7bit Content-Transfer-Encoding.
+
+* New class :class:`~email.generator.BytesGenerator` produces bytes
+ as output, preserving any unchanged non-ASCII data that was
+ present in the input used to build the model, including message bodies
+ with a :mailheader:`Content-Transfer-Encoding` of 8bit.
+
+Here are the major differences between :mod:`email` version 5.0 and version 4:
+
+* All operations are on unicode strings. Text inputs must be strings,
+ text outputs are strings. Outputs are limited to the ASCII character
+ set and so can be encoded to ASCII for transmission. Inputs are also
+ limited to ASCII; this is an acknowledged limitation of email 5.0 and
+ means it can only be used to parse email that is 7bit clean.
Here are the major differences between :mod:`email` version 4 and version 3:
diff --git a/Doc/library/email.util.rst b/Doc/library/email.util.rst
index a1ce3017f4..f7b777a01d 100644
--- a/Doc/library/email.util.rst
+++ b/Doc/library/email.util.rst
@@ -105,11 +105,17 @@ There are several useful utilities provided in the :mod:`email.utils` module:
``False``. The default is ``False``.
-.. function:: make_msgid(idstring=None)
+.. function:: make_msgid(idstring=None, domain=None)
Returns a string suitable for an :rfc:`2822`\ -compliant
:mailheader:`Message-ID` header. Optional *idstring* if given, is a string
- used to strengthen the uniqueness of the message id.
+ used to strengthen the uniqueness of the message id. Optional *domain* if
+ given provides the portion of the msgid after the '@'. The default is the
+ local hostname. It is not normally necessary to override this default, but
+ may be useful certain cases, such as a constructing distributed system that
+ uses a consistent domain name across multiple hosts.
+
+ .. versionchanged:: 3.2 domain keyword added
.. function:: decode_rfc2231(s)
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 4159287eb4..528febd031 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -197,7 +197,7 @@ The following exceptions are the exceptions that are usually raised.
Raised when an operation runs out of memory but the situation may still be
rescued (by deleting some objects). The associated value is a string indicating
what kind of (internal) operation ran out of memory. Note that because of the
- underlying memory management architecture (C's :cfunc:`malloc` function), the
+ underlying memory management architecture (C's :c:func:`malloc` function), the
interpreter may not always be able to completely recover from this situation; it
nevertheless raises an exception so that a stack traceback can be printed, in
case a run-away program was the cause.
@@ -224,8 +224,8 @@ The following exceptions are the exceptions that are usually raised.
This exception is derived from :exc:`EnvironmentError`. It is raised when a
function returns a system-related error (not for illegal argument types or
other incidental errors). The :attr:`errno` attribute is a numeric error
- code from :cdata:`errno`, and the :attr:`strerror` attribute is the
- corresponding string, as would be printed by the C function :cfunc:`perror`.
+ code from :c:data:`errno`, and the :attr:`strerror` attribute is the
+ corresponding string, as would be printed by the C function :c:func:`perror`.
See the module :mod:`errno`, which contains names for the error codes defined
by the underlying operating system.
@@ -261,8 +261,8 @@ The following exceptions are the exceptions that are usually raised.
.. exception:: StopIteration
- Raised by builtin :func:`next` and an :term:`iterator`\'s :meth:`__next__`
- method to signal that there are no further values.
+ Raised by built-in function :func:`next` and an :term:`iterator`\'s
+ :meth:`__next__` method to signal that there are no further values.
.. exception:: SyntaxError
@@ -307,7 +307,7 @@ The following exceptions are the exceptions that are usually raised.
This exception is raised by the :func:`sys.exit` function. When it is not
handled, the Python interpreter exits; no stack traceback is printed. If the
associated value is an integer, it specifies the system exit status (passed
- to C's :cfunc:`exit` function); if it is ``None``, the exit status is zero;
+ to C's :c:func:`exit` function); if it is ``None``, the exit status is zero;
if it has another type (such as a string), the object's value is printed and
the exit status is one.
@@ -380,9 +380,9 @@ The following exceptions are the exceptions that are usually raised.
.. exception:: WindowsError
Raised when a Windows-specific error occurs or when the error number does not
- correspond to an :cdata:`errno` value. The :attr:`winerror` and
+ correspond to an :c:data:`errno` value. The :attr:`winerror` and
:attr:`strerror` values are created from the return values of the
- :cfunc:`GetLastError` and :cfunc:`FormatMessage` functions from the Windows
+ :c:func:`GetLastError` and :c:func:`FormatMessage` functions from the Windows
Platform API. The :attr:`errno` value maps the :attr:`winerror` value to
corresponding ``errno.h`` values. This is a subclass of :exc:`OSError`.
@@ -442,10 +442,20 @@ module for more information.
Base class for warnings related to Unicode.
+
.. exception:: BytesWarning
Base class for warnings related to :class:`bytes` and :class:`buffer`.
+
+.. exception:: ResourceWarning
+
+ Base class for warnings related to resource usage.
+
+ .. versionadded:: 3.2
+
+
+
Exception hierarchy
-------------------
diff --git a/Doc/library/fcntl.rst b/Doc/library/fcntl.rst
index dd76d656ba..6192400c9d 100644
--- a/Doc/library/fcntl.rst
+++ b/Doc/library/fcntl.rst
@@ -12,7 +12,7 @@
pair: UNIX; I/O control
This module performs file control and I/O control on file descriptors. It is an
-interface to the :cfunc:`fcntl` and :cfunc:`ioctl` Unix routines.
+interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines.
All functions in this module take a file descriptor *fd* as their first
argument. This can be an integer file descriptor, such as returned by
@@ -30,17 +30,17 @@ The module defines the following functions:
:mod:`fcntl` module. The argument *arg* is optional, and defaults to the integer
value ``0``. When present, it can either be an integer value, or a string.
With the argument missing or an integer value, the return value of this function
- is the integer return value of the C :cfunc:`fcntl` call. When the argument is
+ is the integer return value of the C :c:func:`fcntl` call. When the argument is
a string it represents a binary structure, e.g. created by :func:`struct.pack`.
The binary data is copied to a buffer whose address is passed to the C
- :cfunc:`fcntl` call. The return value after a successful call is the contents
+ :c:func:`fcntl` call. The return value after a successful call is the contents
of the buffer, converted to a string object. The length of the returned string
will be the same as the length of the *arg* argument. This is limited to 1024
bytes. If the information returned in the buffer by the operating system is
larger than 1024 bytes, this is most likely to result in a segmentation
violation or a more subtle data corruption.
- If the :cfunc:`fcntl` fails, an :exc:`IOError` is raised.
+ If the :c:func:`fcntl` fails, an :exc:`IOError` is raised.
.. function:: ioctl(fd, op[, arg[, mutate_flag]])
@@ -91,7 +91,7 @@ The module defines the following functions:
Perform the lock operation *op* on file descriptor *fd* (file objects providing
a :meth:`fileno` method are accepted as well). See the Unix manual
:manpage:`flock(2)` for details. (On some systems, this function is emulated
- using :cfunc:`fcntl`.)
+ using :c:func:`fcntl`.)
.. function:: lockf(fd, operation, [length, [start, [whence]]])
diff --git a/Doc/library/filecmp.rst b/Doc/library/filecmp.rst
index f57dcceff0..e0ffff704e 100644
--- a/Doc/library/filecmp.rst
+++ b/Doc/library/filecmp.rst
@@ -5,6 +5,9 @@
:synopsis: Compare files efficiently.
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
+**Source code:** :source:`Lib/filecmp.py`
+
+--------------
The :mod:`filecmp` module defines functions to compare files and directories,
with various optional time/correctness trade-offs. For comparing files,
diff --git a/Doc/library/fileformats.rst b/Doc/library/fileformats.rst
index 980d4f5ffb..e9c2e1fbbd 100644
--- a/Doc/library/fileformats.rst
+++ b/Doc/library/fileformats.rst
@@ -5,7 +5,7 @@ File Formats
************
The modules described in this chapter parse various miscellaneous file formats
-that aren't markup languages or are related to e-mail.
+that aren't markup languages and are not related to e-mail.
.. toctree::
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst
index d98a198f5c..ac4431145d 100644
--- a/Doc/library/fileinput.rst
+++ b/Doc/library/fileinput.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Guido van Rossum <guido@python.org>
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/fileinput.py`
+
+--------------
This module implements a helper class and functions to quickly write a
loop over standard input or a list of files. If you just want to read or
@@ -24,7 +27,7 @@ as the first argument to :func:`.input`. A single file name is also allowed.
All files are opened in text mode by default, but you can override this by
specifying the *mode* parameter in the call to :func:`.input` or
-:class:`FileInput()`. If an I/O error occurs during opening or reading a file,
+:class:`FileInput`. If an I/O error occurs during opening or reading a file,
:exc:`IOError` is raised.
If ``sys.stdin`` is used more than once, the second and further use will return
@@ -54,6 +57,17 @@ The following function is the primary interface of this module:
during iteration. The parameters to this function will be passed along to the
constructor of the :class:`FileInput` class.
+ The :class:`FileInput` instance can be used as a context manager in the
+ :keyword:`with` statement. In this example, *input* is closed after the
+ :keyword:`with` statement is exited, even if an exception occurs::
+
+ with fileinput.input(files=('spam.txt', 'eggs.txt')) as f:
+ for line in f:
+ process(line)
+
+ .. versionchanged:: 3.2
+ Can be used as a context manager.
+
The following functions use the global state created by :func:`fileinput.input`;
if there is no active state, :exc:`RuntimeError` is raised.
@@ -132,13 +146,23 @@ available for subclassing as well:
*filename* and *mode*, and returns an accordingly opened file-like object. You
cannot use *inplace* and *openhook* together.
+ A :class:`FileInput` instance can be used as a context manager in the
+ :keyword:`with` statement. In this example, *input* is closed after the
+ :keyword:`with` statement is exited, even if an exception occurs::
+
+ with FileInput(files=('spam.txt', 'eggs.txt')) as input:
+ process(input)
+
+ .. versionchanged:: 3.2
+ Can be used as a context manager.
+
-**Optional in-place filtering:** if the keyword argument ``inplace=1`` is passed
-to :func:`fileinput.input` or to the :class:`FileInput` constructor, the file is
-moved to a backup file and standard output is directed to the input file (if a
-file of the same name as the backup file already exists, it will be replaced
-silently). This makes it possible to write a filter that rewrites its input
-file in place. If the *backup* parameter is given (typically as
+**Optional in-place filtering:** if the keyword argument ``inplace=True`` is
+passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, the
+file is moved to a backup file and standard output is directed to the input file
+(if a file of the same name as the backup file already exists, it will be
+replaced silently). This makes it possible to write a filter that rewrites its
+input file in place. If the *backup* parameter is given (typically as
``backup='.<some extension>'``), it specifies the extension for the backup file,
and the backup file remains around; by default, the extension is ``'.bak'`` and
it is deleted when the output file is closed. In-place filtering is disabled
diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst
index 7fa6148180..4ba6b77f8e 100644
--- a/Doc/library/fnmatch.rst
+++ b/Doc/library/fnmatch.rst
@@ -9,6 +9,10 @@
.. index:: module: re
+**Source code:** :source:`Lib/fnmatch.py`
+
+--------------
+
This module provides support for Unix shell-style wildcards, which are *not* the
same as regular expressions (which are documented in the :mod:`re` module). The
special characters used in shell-style wildcards are:
@@ -70,6 +74,8 @@ patterns.
Return the shell-style *pattern* converted to a regular expression.
+ Be aware there is no way to quote meta-characters.
+
Example:
>>> import fnmatch, re
@@ -86,4 +92,3 @@ patterns.
Module :mod:`glob`
Unix shell-style path expansion.
-
diff --git a/Doc/library/fractions.rst b/Doc/library/fractions.rst
index 79600269c9..a3ad44a655 100644
--- a/Doc/library/fractions.rst
+++ b/Doc/library/fractions.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Jeffrey Yasskin <jyasskin at gmail.com>
.. sectionauthor:: Jeffrey Yasskin <jyasskin at gmail.com>
+**Source code:** :source:`Lib/fractions.py`
+
+--------------
The :mod:`fractions` module provides support for rational number arithmetic.
@@ -15,17 +18,24 @@ another rational number, or from a string.
.. class:: Fraction(numerator=0, denominator=1)
Fraction(other_fraction)
+ Fraction(float)
+ Fraction(decimal)
Fraction(string)
- The first version requires that *numerator* and *denominator* are
- instances of :class:`numbers.Rational` and returns a new
- :class:`Fraction` instance with value ``numerator/denominator``. If
- *denominator* is :const:`0`, it raises a
- :exc:`ZeroDivisionError`. The second version requires that
- *other_fraction* is an instance of :class:`numbers.Rational` and
- returns an :class:`Fraction` instance with the same value. The
- last version of the constructor expects a string instance. The
- usual form for this string is::
+ The first version requires that *numerator* and *denominator* are instances
+ of :class:`numbers.Rational` and returns a new :class:`Fraction` instance
+ with value ``numerator/denominator``. If *denominator* is :const:`0`, it
+ raises a :exc:`ZeroDivisionError`. The second version requires that
+ *other_fraction* is an instance of :class:`numbers.Rational` and returns a
+ :class:`Fraction` instance with the same value. The next two versions accept
+ either a :class:`float` or a :class:`decimal.Decimal` instance, and return a
+ :class:`Fraction` instance with exactly the same value. Note that due to the
+ usual issues with binary floating-point (see :ref:`tut-fp-issues`), the
+ argument to ``Fraction(1.1)`` is not exactly equal to 11/10, and so
+ ``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as one might expect.
+ (But see the documentation for the :meth:`limit_denominator` method below.)
+ The last version of the constructor expects a string or unicode instance.
+ The usual form for this instance is::
[sign] numerator ['/' denominator]
@@ -55,6 +65,13 @@ another rational number, or from a string.
Fraction(-1, 8)
>>> Fraction('7e-6')
Fraction(7, 1000000)
+ >>> Fraction(2.25)
+ Fraction(9, 4)
+ >>> Fraction(1.1)
+ Fraction(2476979795053773, 2251799813685248)
+ >>> from decimal import Decimal
+ >>> Fraction(Decimal('1.1'))
+ Fraction(11, 10)
The :class:`Fraction` class inherits from the abstract base class
@@ -63,6 +80,10 @@ another rational number, or from a string.
and should be treated as immutable. In addition,
:class:`Fraction` has the following methods:
+ .. versionchanged:: 3.2
+ The :class:`Fraction` constructor now accepts :class:`float` and
+ :class:`decimal.Decimal` instances.
+
.. method:: from_float(flt)
@@ -70,12 +91,19 @@ another rational number, or from a string.
value of *flt*, which must be a :class:`float`. Beware that
``Fraction.from_float(0.3)`` is not the same value as ``Fraction(3, 10)``
+ .. note:: From Python 3.2 onwards, you can also construct a
+ :class:`Fraction` instance directly from a :class:`float`.
+
.. method:: from_decimal(dec)
This class method constructs a :class:`Fraction` representing the exact
value of *dec*, which must be a :class:`decimal.Decimal` instance.
+ .. note:: From Python 3.2 onwards, you can also construct a
+ :class:`Fraction` instance directly from a :class:`decimal.Decimal`
+ instance.
+
.. method:: limit_denominator(max_denominator=1000000)
@@ -90,10 +118,12 @@ another rational number, or from a string.
or for recovering a rational number that's represented as a float:
>>> from math import pi, cos
- >>> Fraction.from_float(cos(pi/3))
+ >>> Fraction(cos(pi/3))
Fraction(4503599627370497, 9007199254740992)
- >>> Fraction.from_float(cos(pi/3)).limit_denominator()
+ >>> Fraction(cos(pi/3)).limit_denominator()
Fraction(1, 2)
+ >>> Fraction(1.1).limit_denominator()
+ Fraction(11, 10)
.. method:: __floor__()
diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst
index 5545505273..5bbef4f233 100644
--- a/Doc/library/ftplib.rst
+++ b/Doc/library/ftplib.rst
@@ -9,6 +9,10 @@
pair: FTP; protocol
single: FTP; ftplib (standard module)
+**Source code:** :source:`Lib/ftplib.py`
+
+--------------
+
This module defines the class :class:`FTP` and a few related items. The
:class:`FTP` class implements the client side of the FTP protocol. You can use
this to write Python programs that perform a variety of automated FTP jobs, such
@@ -33,8 +37,8 @@ Here's a sample session using the :mod:`ftplib` module::
'226 Transfer complete.'
>>> ftp.quit()
-The module defines the following items:
+The module defines the following items:
.. class:: FTP(host='', user='', passwd='', acct=''[, timeout])
@@ -46,6 +50,61 @@ The module defines the following items:
connection attempt (if is not specified, the global default timeout setting
will be used).
+ :class:`FTP` class supports the :keyword:`with` statement. Here is a sample
+ on how using it:
+
+ >>> from ftplib import FTP
+ >>> with FTP("ftp1.at.proftpd.org") as ftp:
+ ... ftp.login()
+ ... ftp.dir()
+ ...
+ '230 Anonymous login ok, restrictions apply.'
+ dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 .
+ dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 ..
+ dr-xr-xr-x 5 ftp ftp 4096 May 6 10:43 CentOS
+ dr-xr-xr-x 3 ftp ftp 18 Jul 10 2008 Fedora
+ >>>
+
+ .. versionchanged:: 3.2
+ Support for the :keyword:`with` statement was added.
+
+
+.. class:: FTP_TLS(host='', user='', passwd='', acct='', [keyfile[, certfile[, context[, timeout]]]])
+
+ A :class:`FTP` subclass which adds TLS support to FTP as described in
+ :rfc:`4217`.
+ Connect as usual to port 21 implicitly securing the FTP control connection
+ before authenticating. Securing the data connection requires the user to
+ explicitly ask for it by calling the :meth:`prot_p` method.
+ *keyfile* and *certfile* are optional -- they can contain a PEM formatted
+ private key and certificate chain file name for the SSL connection.
+ *context* parameter is a :class:`ssl.SSLContext` object which allows
+ bundling SSL configuration options, certificates and private keys into a
+ single (potentially long-lived) structure.
+
+ .. versionadded:: 3.2
+
+ Here's a sample session using the :class:`FTP_TLS` class:
+
+ >>> from ftplib import FTP_TLS
+ >>> ftps = FTP_TLS('ftp.python.org')
+ >>> ftps.login() # login anonymously before securing control channel
+ >>> ftps.prot_p() # switch to secure data connection
+ >>> ftps.retrlines('LIST') # list directory content securely
+ total 9
+ drwxr-xr-x 8 root wheel 1024 Jan 3 1994 .
+ drwxr-xr-x 8 root wheel 1024 Jan 3 1994 ..
+ drwxr-xr-x 2 root wheel 1024 Jan 3 1994 bin
+ drwxr-xr-x 2 root wheel 1024 Jan 3 1994 etc
+ d-wxrwxr-x 2 ftp wheel 1024 Sep 5 13:43 incoming
+ drwxr-xr-x 2 root wheel 1024 Nov 17 1993 lib
+ drwxr-xr-x 6 1094 wheel 1024 Sep 13 19:07 pub
+ drwxr-xr-x 3 root wheel 1024 Jan 3 1994 usr
+ -rw-r--r-- 1 root root 312 Aug 1 1994 welcome.msg
+ '226 Transfer complete.'
+ >>> ftps.quit()
+ >>>
+
.. exception:: error_reply
@@ -197,14 +256,18 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
Passive mode is on by default.
-.. method:: FTP.storbinary(cmd, file, blocksize=8192, callback=None)
+.. method:: FTP.storbinary(cmd, file, blocksize=8192, callback=None, rest=None)
Store a file in binary transfer mode. *cmd* should be an appropriate
``STOR`` command: ``"STOR filename"``. *file* is an open :term:`file object`
which is read until EOF using its :meth:`read` method in blocks of size
*blocksize* to provide the data to be stored. The *blocksize* argument
defaults to 8192. *callback* is an optional single parameter callable that
- is called on each block of data after it is sent.
+ is called on each block of data after it is sent. *rest* means the same thing
+ as in the :meth:`transfercmd` method.
+
+ .. versionchanged:: 3.2
+ *rest* parameter added.
.. method:: FTP.storlines(cmd, file, callback=None)
@@ -319,3 +382,26 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
:meth:`close` or :meth:`quit` you cannot reopen the connection by issuing
another :meth:`login` method).
+
+FTP_TLS Objects
+---------------
+
+:class:`FTP_TLS` class inherits from :class:`FTP`, defining these additional objects:
+
+.. attribute:: FTP_TLS.ssl_version
+
+ The SSL version to use (defaults to *TLSv1*).
+
+.. method:: FTP_TLS.auth()
+
+ Set up secure control connection by using TLS or SSL, depending on what specified in :meth:`ssl_version` attribute.
+
+.. method:: FTP_TLS.prot_p()
+
+ Set up secure data connection.
+
+.. method:: FTP_TLS.prot_c()
+
+ Set up clear text data connection.
+
+
diff --git a/Doc/library/functional.rst b/Doc/library/functional.rst
new file mode 100644
index 0000000000..5b6185a65c
--- /dev/null
+++ b/Doc/library/functional.rst
@@ -0,0 +1,15 @@
+******************************
+Functional Programming Modules
+******************************
+
+The modules described in this chapter provide functions and classes that support
+a functional programming style, and general operations on callables.
+
+The following modules are documented in this chapter:
+
+
+.. toctree::
+
+ itertools.rst
+ functools.rst
+ operator.rst
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 1547f6d9c8..3020128ce5 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -10,20 +10,20 @@ are always available. They are listed here in alphabetical order.
=================== ================= ================== ================ ====================
.. .. Built-in Functions .. ..
=================== ================= ================== ================ ====================
-:func:`abs` :func:`dir` :func:`hex` :func:`next` :func:`slice`
-:func:`all` :func:`divmod` :func:`id` :func:`object` :func:`sorted`
-:func:`any` :func:`enumerate` :func:`input` :func:`oct` :func:`staticmethod`
-:func:`ascii` :func:`eval` :func:`int` :func:`open` :func:`str`
-:func:`bin` :func:`exec` :func:`isinstance` :func:`ord` :func:`sum`
-:func:`bool` :func:`filter` :func:`issubclass` :func:`pow` :func:`super`
-:func:`bytearray` :func:`float` :func:`iter` :func:`print` :func:`tuple`
-:func:`bytes` :func:`format` :func:`len` :func:`property` :func:`type`
+:func:`abs` :func:`dict` :func:`help` :func:`min` :func:`setattr`
+:func:`all` :func:`dir` :func:`hex` :func:`next` :func:`slice`
+:func:`any` :func:`divmod` :func:`id` :func:`object` :func:`sorted`
+:func:`ascii` :func:`enumerate` :func:`input` :func:`oct` :func:`staticmethod`
+:func:`bin` :func:`eval` :func:`int` :func:`open` :func:`str`
+:func:`bool` :func:`exec` :func:`isinstance` :func:`ord` :func:`sum`
+:func:`bytearray` :func:`filter` :func:`issubclass` :func:`pow` :func:`super`
+:func:`bytes` :func:`float` :func:`iter` :func:`print` :func:`tuple`
+:func:`callable` :func:`format` :func:`len` :func:`property` :func:`type`
:func:`chr` :func:`frozenset` :func:`list` :func:`range` :func:`vars`
:func:`classmethod` :func:`getattr` :func:`locals` :func:`repr` :func:`zip`
:func:`compile` :func:`globals` :func:`map` :func:`reversed` :func:`__import__`
:func:`complex` :func:`hasattr` :func:`max` :func:`round`
:func:`delattr` :func:`hash` :func:`memoryview` :func:`set`
-:func:`dict` :func:`help` :func:`min` :func:`setattr`
=================== ================= ================== ================ ====================
.. function:: abs(x)
@@ -121,6 +121,19 @@ are always available. They are listed here in alphabetical order.
Bytes objects can also be created with literals, see :ref:`strings`.
+.. function:: callable(object)
+
+ Return :const:`True` if the *object* argument appears callable,
+ :const:`False` if not. If this returns true, it is still possible that a
+ call fails, but if it is false, calling *object* will never succeed.
+ Note that classes are callable (calling a class returns a new instance);
+ instances are callable if their class has a :meth:`__call__` method.
+
+ .. versionadded:: 3.2
+ This function was first removed in Python 3.0 and then brought back
+ in Python 3.2.
+
+
.. function:: chr(i)
Return the string representing a character whose Unicode codepoint is the integer
@@ -161,7 +174,7 @@ are always available. They are listed here in alphabetical order.
type hierarchy in :ref:`types`.
-.. function:: compile(source, filename, mode, flags=0, dont_inherit=False)
+.. function:: compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)
Compile the *source* into a code or AST object. Code objects can be executed
by :func:`exec` or :func:`eval`. *source* can either be a string or an AST
@@ -193,16 +206,25 @@ are always available. They are listed here in alphabetical order.
can be found as the :attr:`compiler_flag` attribute on the :class:`_Feature`
instance in the :mod:`__future__` module.
+ The argument *optimize* specifies the optimization level of the compiler; the
+ default value of ``-1`` selects the optimization level of the interpreter as
+ given by :option:`-O` options. Explicit levels are ``0`` (no optimization;
+ ``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false)
+ or ``2`` (docstrings are removed too).
+
This function raises :exc:`SyntaxError` if the compiled source is invalid,
and :exc:`TypeError` if the source contains null bytes.
.. note::
- When compiling a string with multi-line statements, line endings must be
- represented by a single newline character (``'\n'``), and the input must
- be terminated by at least one newline character. If line endings are
- represented by ``'\r\n'``, use :meth:`str.replace` to change them into
- ``'\n'``.
+ When compiling a string with multi-line code in ``'single'`` or
+ ``'eval'`` mode, input must be terminated by at least one newline
+ character. This is to facilitate detection of incomplete and complete
+ statements in the :mod:`code` module.
+
+ .. versionchanged:: 3.2
+ Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode
+ does not have to end in a newline anymore. Added the *optimize* parameter.
.. function:: complex([real[, imag]])
@@ -346,7 +368,7 @@ are always available. They are listed here in alphabetical order.
This function can also be used to execute arbitrary code objects (such as
those created by :func:`compile`). In this case pass a code object instead
of a string. If the code object has been compiled with ``'exec'`` as the
- *kind* argument, :func:`eval`\'s return value will be ``None``.
+ *mode* argument, :func:`eval`\'s return value will be ``None``.
Hints: dynamic execution of statements is supported by the :func:`exec`
function. The :func:`globals` and :func:`locals` functions
@@ -414,26 +436,54 @@ are always available. They are listed here in alphabetical order.
.. function:: float([x])
- Convert a string or a number to floating point. If the argument is a string,
- it must contain a possibly signed decimal or floating point number, possibly
- embedded in whitespace. The argument may also be ``'[+|-]nan'`` or
- ``'[+|-]inf'``. Otherwise, the argument may be an integer or a floating
- point number, and a floating point number with the same value (within
- Python's floating point precision) is returned. If no argument is given,
- ``0.0`` is returned.
-
- .. note::
-
- .. index::
- single: NaN
- single: Infinity
-
- When passing in a string, values for NaN and Infinity may be returned,
- depending on the underlying C library. Float accepts the strings
- ``'nan'``, ``'inf'`` and ``'-inf'`` for NaN and positive or negative
- infinity. The case and a leading + are ignored as well as a leading - is
- ignored for NaN. Float always represents NaN and infinity as ``nan``,
- ``inf`` or ``-inf``.
+ .. index::
+ single: NaN
+ single: Infinity
+
+ Convert a string or a number to floating point.
+
+ If the argument is a string, it should contain a decimal number, optionally
+ preceded by a sign, and optionally embedded in whitespace. The optional
+ sign may be ``'+'`` or ``'-'``; a ``'+'`` sign has no effect on the value
+ produced. The argument may also be a string representing a NaN
+ (not-a-number), or a positive or negative infinity. More precisely, the
+ input must conform to the following grammar after leading and trailing
+ whitespace characters are removed:
+
+ .. productionlist::
+ sign: "+" | "-"
+ infinity: "Infinity" | "inf"
+ nan: "nan"
+ numeric_value: `floatnumber` | `infinity` | `nan`
+ numeric_string: [`sign`] `numeric_value`
+
+ Here ``floatnumber`` is the form of a Python floating-point literal,
+ described in :ref:`floating`. Case is not significant, so, for example,
+ "inf", "Inf", "INFINITY" and "iNfINity" are all acceptable spellings for
+ positive infinity.
+
+ Otherwise, if the argument is an integer or a floating point number, a
+ floating point number with the same value (within Python's floating point
+ precision) is returned. If the argument is outside the range of a Python
+ float, an :exc:`OverflowError` will be raised.
+
+ For a general Python object ``x``, ``float(x)`` delegates to
+ ``x.__float__()``.
+
+ If no argument is given, ``0.0`` is returned.
+
+ Examples::
+
+ >>> float('+1.23')
+ 1.23
+ >>> float(' -12345\n')
+ -12345.0
+ >>> float('1e-003')
+ 0.001
+ >>> float('+1E6')
+ 1000000.0
+ >>> float('-Infinity')
+ -inf
The float type is described in :ref:`typesnumeric`.
@@ -482,10 +532,10 @@ are always available. They are listed here in alphabetical order.
.. function:: hasattr(object, name)
- The arguments are an object and a string. The result is ``True`` if the string
- is the name of one of the object's attributes, ``False`` if not. (This is
- implemented by calling ``getattr(object, name)`` and seeing whether it raises an
- exception or not.)
+ The arguments are an object and a string. The result is ``True`` if the
+ string is the name of one of the object's attributes, ``False`` if not. (This
+ is implemented by calling ``getattr(object, name)`` and seeing whether it
+ raises an :exc:`AttributeError` or not.)
.. function:: hash(object)
@@ -653,6 +703,10 @@ are always available. They are listed here in alphabetical order.
The optional keyword-only *key* argument specifies a one-argument ordering
function like that used for :meth:`list.sort`.
+ If multiple items are maximal, the function returns the first one
+ encountered. This is consistent with other sort-stability preserving tools
+ such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and
+ ``heapq.nlargest(1, iterable, key=keyfunc)``.
.. function:: memoryview(obj)
:noindex:
@@ -670,6 +724,10 @@ are always available. They are listed here in alphabetical order.
The optional keyword-only *key* argument specifies a one-argument ordering
function like that used for :meth:`list.sort`.
+ If multiple items are minimal, the function returns the first one
+ encountered. This is consistent with other sort-stability preserving tools
+ such as ``sorted(iterable, key=keyfunc)[0]`` and ``heapq.nsmallest(1,
+ iterable, key=keyfunc)``.
.. function:: next(iterator[, default])
@@ -971,6 +1029,35 @@ are always available. They are listed here in alphabetical order.
>>> list(range(1, 0))
[]
+ Range objects implement the :class:`collections.Sequence` ABC, and provide
+ features such as containment tests, element index lookup, slicing and
+ support for negative indices:
+
+ >>> r = range(0, 20, 2)
+ >>> r
+ range(0, 20, 2)
+ >>> 11 in r
+ False
+ >>> 10 in r
+ True
+ >>> r.index(10)
+ 5
+ >>> r[5]
+ 10
+ >>> r[:5]
+ range(0, 10, 2)
+ >>> r[-1]
+ 18
+
+ Ranges containing absolute values larger than :data:`sys.maxsize` are permitted
+ but some features (such as :func:`len`) will raise :exc:`OverflowError`.
+
+ .. versionchanged:: 3.2
+ Implement the Sequence ABC.
+ Support slicing and negative indices.
+ Test integers for membership in constant time instead of iterating
+ through all items.
+
.. function:: repr(object)
@@ -1050,14 +1137,14 @@ are always available. They are listed here in alphabetical order.
Has two optional arguments which must be specified as keyword arguments.
*key* specifies a function of one argument that is used to extract a comparison
- key from each list element: ``key=str.lower``. The default value is ``None``.
+ key from each list element: ``key=str.lower``. The default value is ``None``
+ (compare the elements directly).
*reverse* is a boolean value. If set to ``True``, then the list elements are
sorted as if each comparison were reversed.
- To convert an old-style *cmp* function to a *key* function, see the
- `CmpToKey recipe in the ASPN cookbook
- <http://code.activestate.com/recipes/576653/>`_\.
+ Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a
+ *key* function.
For sorting examples and a brief sorting tutorial, see `Sorting HowTo
<http://wiki.python.org/moin/HowTo/Sorting/>`_\.
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 570f4d26a5..2316e80489 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -8,6 +8,9 @@
.. moduleauthor:: Nick Coghlan <ncoghlan@gmail.com>
.. sectionauthor:: Peter Harris <scav@blueyonder.co.uk>
+**Source code:** :source:`Lib/functools.py`
+
+--------------
The :mod:`functools` module is for higher-order functions: functions that act on
or return other functions. In general, any callable object can be treated as a
@@ -15,6 +18,123 @@ function for the purposes of this module.
The :mod:`functools` module defines the following functions:
+.. function:: cmp_to_key(func)
+
+ Transform an old-style comparison function to a key-function. Used with
+ tools that accept key functions (such as :func:`sorted`, :func:`min`,
+ :func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`,
+ :func:`itertools.groupby`). This function is primarily used as a transition
+ tool for programs being converted from Py2.x which supported the use of
+ comparison functions.
+
+ A compare function is any callable that accept two arguments, compares them,
+ and returns a negative number for less-than, zero for equality, or a positive
+ number for greater-than. A key function is a callable that accepts one
+ argument and returns another value indicating the position in the desired
+ collation sequence.
+
+ Example::
+
+ sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order
+
+ .. versionadded:: 3.2
+
+
+.. decorator:: lru_cache(maxsize=100)
+
+ Decorator to wrap a function with a memoizing callable that saves up to the
+ *maxsize* most recent calls. It can save time when an expensive or I/O bound
+ function is periodically called with the same arguments.
+
+ Since a dictionary is used to cache results, the positional and keyword
+ arguments to the function must be hashable.
+
+ If *maxsize* is set to None, the LRU feature is disabled and the cache
+ can grow without bound.
+
+ To help measure the effectiveness of the cache and tune the *maxsize*
+ parameter, the wrapped function is instrumented with a :func:`cache_info`
+ function that returns a :term:`named tuple` showing *hits*, *misses*,
+ *maxsize* and *currsize*. In a multi-threaded environment, the hits
+ and misses are approximate.
+
+ The decorator also provides a :func:`cache_clear` function for clearing or
+ invalidating the cache.
+
+ The original underlying function is accessible through the
+ :attr:`__wrapped__` attribute. This is useful for introspection, for
+ bypassing the cache, or for rewrapping the function with a different cache.
+
+ An `LRU (least recently used) cache
+ <http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used>`_ works
+ best when more recent calls are the best predictors of upcoming calls (for
+ example, the most popular articles on a news server tend to change daily).
+ The cache's size limit assures that the cache does not grow without bound on
+ long-running processes such as web servers.
+
+ Example of an LRU cache for static web content::
+
+ @lru_cache(maxsize=20)
+ def get_pep(num):
+ 'Retrieve text of a Python Enhancement Proposal'
+ resource = 'http://www.python.org/dev/peps/pep-%04d/' % num
+ try:
+ with urllib.request.urlopen(resource) as s:
+ return s.read()
+ except urllib.error.HTTPError:
+ return 'Not Found'
+
+ >>> for n in 8, 290, 308, 320, 8, 218, 320, 279, 289, 320, 9991:
+ ... pep = get_pep(n)
+ ... print(n, len(pep))
+
+ >>> print(get_pep.cache_info())
+ CacheInfo(hits=3, misses=8, maxsize=20, currsize=8)
+
+ Example of efficiently computing
+ `Fibonacci numbers <http://en.wikipedia.org/wiki/Fibonacci_number>`_
+ using a cache to implement a
+ `dynamic programming <http://en.wikipedia.org/wiki/Dynamic_programming>`_
+ technique::
+
+ @lru_cache(maxsize=None)
+ def fib(n):
+ if n < 2:
+ return n
+ return fib(n-1) + fib(n-2)
+
+ >>> print([fib(n) for n in range(16)])
+ [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]
+
+ >>> print(fib.cache_info())
+ CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)
+
+ .. versionadded:: 3.2
+
+.. decorator:: total_ordering
+
+ Given a class defining one or more rich comparison ordering methods, this
+ class decorator supplies the rest. This simplifies the effort involved
+ in specifying all of the possible rich comparison operations:
+
+ The class must define one of :meth:`__lt__`, :meth:`__le__`,
+ :meth:`__gt__`, or :meth:`__ge__`.
+ In addition, the class should supply an :meth:`__eq__` method.
+
+ For example::
+
+ @total_ordering
+ class Student:
+ def __eq__(self, other):
+ return ((self.lastname.lower(), self.firstname.lower()) ==
+ (other.lastname.lower(), other.firstname.lower()))
+ def __lt__(self, other):
+ return ((self.lastname.lower(), self.firstname.lower()) <
+ (other.lastname.lower(), other.firstname.lower()))
+
+ .. versionadded:: 3.2
+
+
.. function:: partial(func, *args, **keywords)
Return a new :class:`partial` object which when called will behave like *func*
@@ -70,14 +190,34 @@ The :mod:`functools` module defines the following functions:
documentation string) and *WRAPPER_UPDATES* (which updates the wrapper
function's *__dict__*, i.e. the instance dictionary).
+ To allow access to the original function for introspection and other purposes
+ (e.g. bypassing a caching decorator such as :func:`lru_cache`), this function
+ automatically adds a __wrapped__ attribute to the wrapper that refers to
+ the original function.
+
The main intended use for this function is in :term:`decorator` functions which
wrap the decorated function and return the wrapper. If the wrapper function is
not updated, the metadata of the returned function will reflect the wrapper
definition rather than the original function definition, which is typically less
than helpful.
+ :func:`update_wrapper` may be used with callables other than functions. Any
+ attributes named in *assigned* or *updated* that are missing from the object
+ being wrapped are ignored (i.e. this function will not attempt to set them
+ on the wrapper function). :exc:`AttributeError` is still raised if the
+ wrapper function itself is missing any attributes named in *updated*.
+
+ .. versionadded:: 3.2
+ Automatic addition of the ``__wrapped__`` attribute.
+
+ .. versionadded:: 3.2
+ Copying of the ``__annotations__`` attribute by default.
+
+ .. versionchanged:: 3.2
+ Missing attributes no longer trigger an :exc:`AttributeError`.
+
-.. function:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
+.. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
This is a convenience function for invoking ``partial(update_wrapper,
wrapped=wrapped, assigned=assigned, updated=updated)`` as a function decorator
diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst
index 34aba6515f..0281bb761f 100644
--- a/Doc/library/gc.rst
+++ b/Doc/library/gc.rst
@@ -43,7 +43,7 @@ The :mod:`gc` module provides the following functions:
:exc:`ValueError` is raised if the generation number is invalid. The number of
unreachable objects found is returned.
- The free lists maintained for a number of builtin types are cleared
+ The free lists maintained for a number of built-in types are cleared
whenever a full collection or collection of the highest generation (2)
is run. Not all items in some free lists may be freed due to the
particular implementation, in particular :class:`float`.
@@ -174,8 +174,15 @@ value but should not rebind it):
with :meth:`__del__` methods, and *garbage* can be examined in that case to
verify that no such cycles are being created.
- If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added to
- this list rather than freed.
+ If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added
+ to this list rather than freed.
+
+ .. versionchanged:: 3.2
+ If this list is non-empty at interpreter shutdown, a
+ :exc:`ResourceWarning` is emitted, which is silent by default. If
+ :const:`DEBUG_UNCOLLECTABLE` is set, in addition all uncollectable objects
+ are printed.
+
The following constants are provided for use with :func:`set_debug`:
@@ -194,9 +201,12 @@ The following constants are provided for use with :func:`set_debug`:
.. data:: DEBUG_UNCOLLECTABLE
Print information of uncollectable objects found (objects which are not
- reachable but cannot be freed by the collector). These objects will be added to
- the ``garbage`` list.
+ reachable but cannot be freed by the collector). These objects will be added
+ to the ``garbage`` list.
+ .. versionchanged:: 3.2
+ Also print the contents of the :data:`garbage` list at interpreter
+ shutdown, if it isn't empty.
.. data:: DEBUG_SAVEALL
diff --git a/Doc/library/getopt.rst b/Doc/library/getopt.rst
index 6a95142b44..bcfc4b59c4 100644
--- a/Doc/library/getopt.rst
+++ b/Doc/library/getopt.rst
@@ -1,13 +1,23 @@
-:mod:`getopt` --- Parser for command line options
-=================================================
+:mod:`getopt` --- C-style parser for command line options
+=========================================================
.. module:: getopt
:synopsis: Portable parser for command line options; support both short and
long option names.
+**Source code:** :source:`Lib/getopt.py`
+
+--------------
+
+.. note::
+ The :mod:`getopt` module is a parser for command line options whose API is
+ designed to be familiar to users of the C :c:func:`getopt` function. Users who
+ are unfamiliar with the C :c:func:`getopt` function or who would like to write
+ less code and get better help and error messages should consider using the
+ :mod:`argparse` module instead.
This module helps scripts to parse the command line arguments in ``sys.argv``.
-It supports the same conventions as the Unix :cfunc:`getopt` function (including
+It supports the same conventions as the Unix :c:func:`getopt` function (including
the special meanings of arguments of the form '``-``' and '``--``'). Long
options similar to those supported by GNU software may be used as well via an
optional third argument.
@@ -25,11 +35,11 @@ exception:
be parsed, without the leading reference to the running program. Typically, this
means ``sys.argv[1:]``. *shortopts* is the string of option letters that the
script wants to recognize, with options that require an argument followed by a
- colon (``':'``; i.e., the same format that Unix :cfunc:`getopt` uses).
+ colon (``':'``; i.e., the same format that Unix :c:func:`getopt` uses).
.. note::
- Unlike GNU :cfunc:`getopt`, after a non-option argument, all further
+ Unlike GNU :c:func:`getopt`, after a non-option argument, all further
arguments are considered also non-options. This is similar to the way
non-GNU Unix systems work.
@@ -136,9 +146,21 @@ In a script, typical usage is something like this::
if __name__ == "__main__":
main()
+Note that an equivalent command line interface could be produced with less code
+and more informative help and error messages by using the :mod:`argparse` module::
+
+ import argparse
+
+ if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-o', '--output')
+ parser.add_argument('-v', dest='verbose', action='store_true')
+ args = parser.parse_args()
+ # ... do something with args.output ...
+ # ... do something with args.verbose ..
.. seealso::
- Module :mod:`optparse`
- More object-oriented command line option parsing.
+ Module :mod:`argparse`
+ Alternative command line option and argument parsing library.
diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst
index 9e1528ba62..bc825cc822 100644
--- a/Doc/library/gettext.rst
+++ b/Doc/library/gettext.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Barry A. Warsaw <barry@zope.com>
.. sectionauthor:: Barry A. Warsaw <barry@zope.com>
+**Source code:** :source:`Lib/gettext.py`
+
+--------------
The :mod:`gettext` module provides internationalization (I18N) and localization
(L10N) services for your Python modules and applications. It supports both the
diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst
index 3e0322d1c9..3d31c116c8 100644
--- a/Doc/library/glob.rst
+++ b/Doc/library/glob.rst
@@ -7,6 +7,10 @@
.. index:: single: filenames; pathname expansion
+**Source code:** :source:`Lib/glob.py`
+
+--------------
+
The :mod:`glob` module finds all the pathnames matching a specified pattern
according to the rules used by the Unix shell. No tilde expansion is done, but
``*``, ``?``, and character ranges expressed with ``[]`` will be correctly
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index fdd859049c..659a027648 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -4,6 +4,10 @@
.. module:: gzip
:synopsis: Interfaces for gzip compression and decompression using file objects.
+**Source code:** :source:`Lib/gzip.py`
+
+--------------
+
This module provides a simple interface to compress and decompress files just
like the GNU programs :program:`gzip` and :program:`gunzip` would.
@@ -25,10 +29,10 @@ The module defines the following items:
.. class:: GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None)
- Constructor for the :class:`GzipFile` class, which simulates most of the methods
- of a :term:`file object`, with the exception of the :meth:`readinto` and
- :meth:`truncate` methods. At least one of *fileobj* and *filename* must be
- given a non-trivial value.
+ Constructor for the :class:`GzipFile` class, which simulates most of the
+ methods of a :term:`file object`, with the exception of the :meth:`truncate`
+ method. At least one of *fileobj* and *filename* must be given a non-trivial
+ value.
The new class instance is based on *fileobj*, which can be a regular file, a
:class:`StringIO` object, or any other object which simulates a file. It
@@ -62,15 +66,34 @@ The module defines the following items:
Calling a :class:`GzipFile` object's :meth:`close` method does not close
*fileobj*, since you might wish to append more material after the compressed
- data. This also allows you to pass a :class:`StringIO` object opened for
+ data. This also allows you to pass a :class:`io.BytesIO` object opened for
writing as *fileobj*, and retrieve the resulting memory buffer using the
- :class:`StringIO` object's :meth:`getvalue` method.
+ :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method.
+
+ :class:`GzipFile` supports the :class:`io.BufferedIOBase` interface,
+ including iteration and the :keyword:`with` statement. Only the
+ :meth:`read1` and :meth:`truncate` methods aren't implemented.
+
+ :class:`GzipFile` also provides the following method:
- :class:`GzipFile` supports the :keyword:`with` statement.
+ .. method:: peek([n])
+
+ Read *n* uncompressed bytes without advancing the file position.
+ At most one single read on the compressed stream is done to satisfy
+ the call. The number of bytes returned may be more or less than
+ requested.
+
+ .. versionadded:: 3.2
.. versionchanged:: 3.1
Support for the :keyword:`with` statement was added.
+ .. versionchanged:: 3.2
+ Support for zero-padded files was added.
+
+ .. versionchanged:: 3.2
+ Support for unseekable files was added.
+
.. function:: open(filename, mode='rb', compresslevel=9)
@@ -78,6 +101,21 @@ The module defines the following items:
The *filename* argument is required; *mode* defaults to ``'rb'`` and
*compresslevel* defaults to ``9``.
+.. function:: compress(data, compresslevel=9)
+
+ Compress the *data*, returning a :class:`bytes` object containing
+ the compressed data. *compresslevel* has the same meaning as in
+ the :class:`GzipFile` constructor above.
+
+ .. versionadded:: 3.2
+
+.. function:: decompress(data)
+
+ Decompress the *data*, returning a :class:`bytes` object containing the
+ uncompressed data.
+
+ .. versionadded:: 3.2
+
.. _gzip-usage-examples:
@@ -104,6 +142,11 @@ Example of how to GZIP compress an existing file::
with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:
f_out.writelines(f_in)
+Example of how to GZIP compress a binary string::
+
+ import gzip
+ s_in = b"Lots of content here"
+ s_out = gzip.compress(s_in)
.. seealso::
diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst
index b73d7536a5..bc8ab2ca6d 100644
--- a/Doc/library/hashlib.rst
+++ b/Doc/library/hashlib.rst
@@ -11,6 +11,10 @@
single: message digest, MD5
single: secure hash algorithm, SHA1, SHA224, SHA256, SHA384, SHA512
+**Source code:** :source:`Lib/hashlib.py`
+
+--------------
+
This module implements a common interface to many different secure hash and
message digest algorithms. Included are the FIPS secure hash algorithms SHA1,
SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as RSA's MD5
@@ -70,10 +74,13 @@ More condensed:
>>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'
-A generic :func:`new` constructor that takes the string name of the desired
-algorithm as its first parameter also exists to allow access to the above listed
-hashes as well as any other algorithms that your OpenSSL library may offer. The
-named constructors are much faster than :func:`new` and should be preferred.
+.. function:: new(name[, data])
+
+ Is a generic constructor that takes the string name of the desired
+ algorithm as its first parameter. It also exists to allow access to the
+ above listed hashes as well as any other algorithms that your OpenSSL
+ library may offer. The named constructors are much faster than :func:`new`
+ and should be preferred.
Using :func:`new` with an algorithm provided by OpenSSL:
@@ -82,6 +89,25 @@ Using :func:`new` with an algorithm provided by OpenSSL:
>>> h.hexdigest()
'cc4a5ce1b3df48aec5d22d1f16b894a0b894eccc'
+Hashlib provides the following constant attributes:
+
+.. data:: algorithms_guaranteed
+
+ Contains the names of the hash algorithms guaranteed to be supported
+ by this module on all platforms.
+
+ .. versionadded:: 3.2
+
+.. data:: algorithms_available
+
+ Contains the names of the hash algorithms that are available
+ in the running Python interpreter. These names will be recognized
+ when passed to :func:`new`. :attr:`algorithms_guaranteed`
+ will always be a subset. Duplicate algorithms with different
+ name formats may appear in this set (thanks to OpenSSL).
+
+ .. versionadded:: 3.2
+
The following values are provided as constant attributes of the hash objects
returned by the constructors:
diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst
index 7735365f79..c8634ba291 100644
--- a/Doc/library/heapq.rst
+++ b/Doc/library/heapq.rst
@@ -8,6 +8,10 @@
.. sectionauthor:: François Pinard
.. sectionauthor:: Raymond Hettinger
+**Source code:** :source:`Lib/heapq.py`
+
+--------------
+
This module provides an implementation of the heap queue algorithm, also known
as the priority queue algorithm.
diff --git a/Doc/library/hmac.rst b/Doc/library/hmac.rst
index b2bd98dfc7..0ca3eda083 100644
--- a/Doc/library/hmac.rst
+++ b/Doc/library/hmac.rst
@@ -7,6 +7,9 @@
.. moduleauthor:: Gerhard Häring <ghaering@users.sourceforge.net>
.. sectionauthor:: Gerhard Häring <ghaering@users.sourceforge.net>
+**Source code:** :source:`Lib/hmac.py`
+
+--------------
This module implements the HMAC algorithm as described by :rfc:`2104`.
diff --git a/Doc/library/html.entities.rst b/Doc/library/html.entities.rst
index aa67bae7a3..239ae50541 100644
--- a/Doc/library/html.entities.rst
+++ b/Doc/library/html.entities.rst
@@ -5,6 +5,9 @@
:synopsis: Definitions of HTML general entities.
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/html/entities.py`
+
+--------------
This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``,
and ``entitydefs``. ``entitydefs`` is used to provide the :attr:`entitydefs`
diff --git a/Doc/library/html.parser.rst b/Doc/library/html.parser.rst
index 1fa11a2ef0..06a3b1a3e8 100644
--- a/Doc/library/html.parser.rst
+++ b/Doc/library/html.parser.rst
@@ -9,12 +9,20 @@
single: HTML
single: XHTML
+**Source code:** :source:`Lib/html/parser.py`
+
+--------------
+
This module defines a class :class:`HTMLParser` which serves as the basis for
parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
-.. class:: HTMLParser()
+.. class:: HTMLParser(strict=True)
- The :class:`HTMLParser` class is instantiated without arguments.
+ Create a parser instance. If *strict* is ``True`` (the default), invalid
+ html results in :exc:`~html.parser.HTMLParseError` exceptions [#]_. If
+ *strict* is ``False``, the parser uses heuristics to make a best guess at
+ the intention of any invalid html it encounters, similar to the way most
+ browsers do.
An :class:`HTMLParser` instance is fed HTML data and calls handler functions when tags
begin and end. The :class:`HTMLParser` class is meant to be overridden by the
@@ -23,6 +31,8 @@ parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
This parser does not check that end tags match start tags or call the end-tag
handler for elements which are closed implicitly by closing an outer element.
+ .. versionchanged:: 3.2 *strict* keyword added
+
An exception is defined as well:
@@ -191,3 +201,8 @@ As a basic example, below is a very basic HTML parser that uses the
Encountered a html end tag
+.. rubric:: Footnotes
+
+.. [#] For backward compatibility reasons *strict* mode does not raise
+ exceptions for all non-compliant HTML. That is, some invalid HTML
+ is tolerated even in *strict* mode.
diff --git a/Doc/library/html.rst b/Doc/library/html.rst
new file mode 100644
index 0000000000..0063db60cd
--- /dev/null
+++ b/Doc/library/html.rst
@@ -0,0 +1,21 @@
+:mod:`html` --- HyperText Markup Language support
+=================================================
+
+.. module:: html
+ :synopsis: Helpers for manipulating HTML.
+
+.. versionadded:: 3.2
+
+**Source code:** :source:`Lib/html/__init__.py`
+
+--------------
+
+This module defines utilities to manipulate HTML.
+
+.. function:: escape(s, quote=True)
+
+ Convert the characters ``&``, ``<`` and ``>`` in string *s* to HTML-safe
+ sequences. Use this if you need to display text that might contain such
+ characters in HTML. If the optional flag *quote* is true, the characters
+ (``"``) and (``'``) are also translated; this helps for inclusion in an HTML
+ attribute value delimited by quotes, as in ``<a href="...">``.
diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst
index cbe4f05663..704585b525 100644
--- a/Doc/library/http.client.rst
+++ b/Doc/library/http.client.rst
@@ -11,30 +11,33 @@
.. index:: module: urllib.request
+**Source code:** :source:`Lib/http/client.py`
+
+--------------
+
This module defines classes which implement the client side of the HTTP and
HTTPS protocols. It is normally not used directly --- the module
:mod:`urllib.request` uses it to handle URLs that use HTTP and HTTPS.
.. note::
- HTTPS support is only available if the :mod:`socket` module was compiled with
- SSL support.
+ HTTPS support is only available if Python was compiled with SSL support
+ (through the :mod:`ssl` module).
The module provides the following classes:
-.. class:: HTTPConnection(host, port=None, strict=None[, timeout])
+.. class:: HTTPConnection(host, port=None[, strict[, timeout[, source_address]]])
An :class:`HTTPConnection` instance represents one transaction with an HTTP
server. It should be instantiated passing it a host and optional port
number. If no port number is passed, the port is extracted from the host
string if it has the form ``host:port``, else the default HTTP port (80) is
- used. When True, the optional parameter *strict* (which defaults to a false
- value) causes ``BadStatusLine`` to
- be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1
- status line. If the optional *timeout* parameter is given, blocking
+ used. If the optional *timeout* parameter is given, blocking
operations (like connection attempts) will timeout after that many seconds
(if it is not given, the global default timeout setting is used).
+ The optional *source_address* parameter may be a tuple of a (host, port)
+ to use as the source address the HTTP connection is made from.
For example, the following calls all create instances that connect to the server
at the same host and port::
@@ -44,24 +47,58 @@ The module provides the following classes:
>>> h3 = http.client.HTTPConnection('www.cwi.nl', 80)
>>> h3 = http.client.HTTPConnection('www.cwi.nl', 80, timeout=10)
+ .. versionchanged:: 3.2
+ *source_address* was added.
+
+ .. versionchanged:: 3.2
+ The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"
+ are not supported anymore.
-.. class:: HTTPSConnection(host, port=None, key_file=None, cert_file=None, strict=None[, timeout])
+
+.. class:: HTTPSConnection(host, port=None, key_file=None, cert_file=None[, strict[, timeout[, source_address]]], *, context=None, check_hostname=None)
A subclass of :class:`HTTPConnection` that uses SSL for communication with
- secure servers. Default port is ``443``. *key_file* is the name of a PEM
- formatted file that contains your private key, and *cert_file* is a PEM
- formatted certificate chain file; both can be used for authenticating
- yourself against the server.
+ secure servers. Default port is ``443``. If *context* is specified, it
+ must be a :class:`ssl.SSLContext` instance describing the various SSL
+ options. If *context* is specified and has a :attr:`~ssl.SSLContext.verify_mode`
+ of either :data:`~ssl.CERT_OPTIONAL` or :data:`~ssl.CERT_REQUIRED`, then
+ by default *host* is matched against the host name(s) allowed by the
+ server's certificate. If you want to change that behaviour, you can
+ explicitly set *check_hostname* to False.
+
+ *key_file* and *cert_file* are deprecated, please use
+ :meth:`ssl.SSLContext.load_cert_chain` instead.
+
+ If you access arbitrary hosts on the Internet, it is recommended to
+ require certificate checking and feed the *context* with a set of
+ trusted CA certificates::
+
+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ context.verify_mode = ssl.CERT_REQUIRED
+ context.load_verify_locations('/etc/pki/tls/certs/ca-bundle.crt')
+ h = client.HTTPSConnection('svn.python.org', 443, context=context)
+
+ .. versionchanged:: 3.2
+ *source_address*, *context* and *check_hostname* were added.
+
+ .. versionchanged:: 3.2
+ This class now supports HTTPS virtual hosts if possible (that is,
+ if :data:`ssl.HAS_SNI` is true).
- .. warning::
- This does not do any verification of the server's certificate.
+ .. versionchanged:: 3.2
+ The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"
+ are not supported anymore.
-.. class:: HTTPResponse(sock, debuglevel=0, strict=0, method=None, url=None)
+.. class:: HTTPResponse(sock, debuglevel=0[, strict], method=None, url=None)
Class whose instances are returned upon successful connection. Not
instantiated directly by user.
+ .. versionchanged:: 3.2
+ The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"
+ are not supported anymore.
+
The following exceptions are raised as appropriate:
@@ -360,14 +397,18 @@ HTTPConnection Objects
string.
The *body* may also be an open :term:`file object`, in which case the
- contents of the file is sent; this file object should support
- ``fileno()`` and ``read()`` methods. The header Content-Length is
- automatically set to the length of the file as reported by
- stat.
+ contents of the file is sent; this file object should support ``fileno()``
+ and ``read()`` methods. The header Content-Length is automatically set to
+ the length of the file as reported by stat. The *body* argument may also be
+ an iterable and Content-Length header should be explicitly provided when the
+ body is an iterable.
The *headers* argument should be a mapping of extra HTTP
headers to send with the request.
+ .. versionadded:: 3.2
+ *body* can now be an iterable.
+
.. method:: HTTPConnection.getresponse()
Should be called after a request is sent to get the response from the server.
@@ -389,6 +430,17 @@ HTTPConnection Objects
.. versionadded:: 3.1
+.. method:: HTTPConnection.set_tunnel(host, port=None, headers=None)
+
+ Set the host and the port for HTTP Connect Tunnelling. Normally used when it
+ is required to a HTTPS Connection through a proxy server.
+
+ The headers argument should be a mapping of extra HTTP headers to to sent
+ with the CONNECT request.
+
+ .. versionadded:: 3.2
+
+
.. method:: HTTPConnection.connect()
Connect to the server specified when the object was created.
@@ -511,9 +563,8 @@ Here is an example session that uses the ``GET`` method::
>>> data2 = r2.read()
>>> conn.close()
-Here is an example session that uses ``HEAD`` method. Note that ``HEAD`` method
-never returns any data. ::
-
+Here is an example session that uses the ``HEAD`` method. Note that the
+``HEAD`` method never returns any data. ::
>>> import http.client
>>> conn = http.client.HTTPConnection("www.python.org")
diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst
index 74d8d1626a..97714968f2 100644
--- a/Doc/library/http.cookiejar.rst
+++ b/Doc/library/http.cookiejar.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: John J. Lee <jjl@pobox.com>
.. sectionauthor:: John J. Lee <jjl@pobox.com>
+**Source code:** :source:`Lib/http/cookiejar.py`
+
+--------------
The :mod:`http.cookiejar` module defines classes for automatic handling of HTTP
cookies. It is useful for accessing web sites that require small pieces of data
diff --git a/Doc/library/http.cookies.rst b/Doc/library/http.cookies.rst
index 472ddcf5b7..d8a437b362 100644
--- a/Doc/library/http.cookies.rst
+++ b/Doc/library/http.cookies.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Timothy O'Malley <timo@alum.mit.edu>
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
+**Source code:** :source:`Lib/http/cookies.py`
+
+--------------
The :mod:`http.cookies` module defines classes for abstracting the concept of
cookies, an HTTP state management mechanism. It supports both simple string-only
diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst
index 1ca1620813..e3a3a10dd1 100644
--- a/Doc/library/http.server.rst
+++ b/Doc/library/http.server.rst
@@ -11,6 +11,10 @@
single: URL
single: httpd
+**Source code:** :source:`Lib/http/server.py`
+
+--------------
+
This module defines classes for implementing HTTP servers (Web servers).
One class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer` subclass.
@@ -155,6 +159,17 @@ of which this module provides three different variants:
This method will parse and dispatch the request to the appropriate
:meth:`do_\*` method. You should never need to override it.
+ .. method:: handle_expect_100()
+
+ When a HTTP/1.1 compliant server receives a ``Expect: 100-continue``
+ request header it responds back with a ``100 Continue`` followed by ``200
+ OK`` headers.
+ This method can be overridden to raise an error if the server does not
+ want the client to continue. For e.g. server can chose to send ``417
+ Expectation Failed`` as a response header and ``return False``.
+
+ .. versionadded:: 3.2
+
.. method:: send_error(code, message=None)
Sends and logs a complete error reply to the client. The numeric *code*
@@ -171,13 +186,29 @@ of which this module provides three different variants:
.. method:: send_header(keyword, value)
- Writes a specific HTTP header to the output stream. *keyword* should
- specify the header keyword, with *value* specifying its value.
+ Stores the HTTP header to an internal buffer which will be written to the
+ output stream when :meth:`end_headers` method is invoked.
+ *keyword* should specify the header keyword, with *value*
+ specifying its value.
+
+ .. versionchanged:: 3.2 Storing the headers in an internal buffer
+
+
+ .. method:: send_response_only(code, message=None)
+
+ Sends the reponse header only, used for the purposes when ``100
+ Continue`` response is sent by the server to the client. The headers not
+ buffered and sent directly the output stream.If the *message* is not
+ specified, the HTTP message corresponding the response *code* is sent.
+
+ .. versionadded:: 3.2
.. method:: end_headers()
- Sends a blank line, indicating the end of the HTTP headers in the
- response.
+ Write the buffered HTTP headers to the output stream and send a blank
+ line, indicating the end of the HTTP headers in the response.
+
+ .. versionchanged:: 3.2 Writing the buffered headers to the output stream.
.. method:: log_request(code='-', size='-')
diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst
index 04088ac5aa..1d92fe5339 100644
--- a/Doc/library/imaplib.rst
+++ b/Doc/library/imaplib.rst
@@ -16,6 +16,10 @@
pair: IMAP4_SSL; protocol
pair: IMAP4_stream; protocol
+**Source code:** :source:`Lib/imaplib.py`
+
+--------------
+
This module defines three classes, :class:`IMAP4`, :class:`IMAP4_SSL` and
:class:`IMAP4_stream`, which encapsulate a connection to an IMAP4 server and
implement a large subset of the IMAP4rev1 client protocol as defined in
@@ -56,6 +60,7 @@ Three exceptions are defined as attributes of the :class:`IMAP4` class:
write permission, and the mailbox will need to be re-opened to re-obtain write
permission.
+
There's also a subclass for secure connections:
@@ -68,6 +73,7 @@ There's also a subclass for secure connections:
and *certfile* are also optional - they can contain a PEM formatted private key
and certificate chain file for the SSL connection.
+
The second subclass allows for connections created by a child process:
@@ -83,9 +89,9 @@ The following utility functions are defined:
.. function:: Internaldate2tuple(datestr)
- Converts an IMAP4 INTERNALDATE string to Coordinated Universal Time. Returns a
- :mod:`time` module tuple.
-
+ Parse an IMAP4 ``INTERNALDATE`` string and return corresponding local
+ time. The return value is a :class:`time.struct_time` tuple or
+ None if the string has wrong format.
.. function:: Int2AP(num)
@@ -100,9 +106,13 @@ The following utility functions are defined:
.. function:: Time2Internaldate(date_time)
- Converts a :mod:`time` module tuple to an IMAP4 ``INTERNALDATE`` representation.
- Returns a string in the form: ``"DD-Mmm-YYYY HH:MM:SS +HHMM"`` (including
- double-quotes).
+ Convert *date_time* to an IMAP4 ``INTERNALDATE`` representation. The
+ return value is a string in the form: ``"DD-Mmm-YYYY HH:MM:SS
+ +HHMM"`` (including double-quotes). The *date_time* argument can be a
+ number (int or float) represening seconds since epoch (as returned
+ by :func:`time.time`), a 9-tuple representing local time (as returned by
+ :func:`time.localtime`), or a double-quoted string. In the last case, it
+ is assumed to already be in the correct format.
Note that IMAP4 message numbers change as the mailbox changes; in particular,
after an ``EXPUNGE`` command performs deletions the remaining messages are
@@ -408,6 +418,15 @@ An :class:`IMAP4` instance has the following methods:
This is an ``IMAP4rev1`` extension command.
+.. method:: IMAP4.starttls(ssl_context=None)
+
+ Send a ``STARTTLS`` command. The *ssl_context* argument is optional
+ and should be a :class:`ssl.SSLContext` object. This will enable
+ encryption on the IMAP connection.
+
+ .. versionadded:: 3.2
+
+
.. method:: IMAP4.status(mailbox, names)
Request named status conditions for *mailbox*.
diff --git a/Doc/library/imghdr.rst b/Doc/library/imghdr.rst
index 0c0722df17..32ec9cfc2f 100644
--- a/Doc/library/imghdr.rst
+++ b/Doc/library/imghdr.rst
@@ -4,6 +4,9 @@
.. module:: imghdr
:synopsis: Determine the type of image contained in a file or byte stream.
+**Source code:** :source:`Lib/imghdr.py`
+
+--------------
The :mod:`imghdr` module determines the type of image contained in a file or
byte stream.
diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst
index 2d83893d33..6e9845ed00 100644
--- a/Doc/library/imp.rst
+++ b/Doc/library/imp.rst
@@ -190,8 +190,43 @@ This module provides an interface to the mechanisms used to implement the
continue to use the old class definition. The same is true for derived classes.
-The following constants with integer values, defined in this module, are used to
-indicate the search result of :func:`find_module`.
+The following functions are conveniences for handling :pep:`3147` byte-compiled
+file paths.
+
+.. versionadded:: 3.2
+
+.. function:: cache_from_source(path, debug_override=None)
+
+ Return the :pep:`3147` path to the byte-compiled file associated with the
+ source *path*. For example, if *path* is ``/foo/bar/baz.py`` the return
+ value would be ``/foo/bar/__pycache__/baz.cpython-32.pyc`` for Python 3.2.
+ The ``cpython-32`` string comes from the current magic tag (see
+ :func:`get_tag`). The returned path will end in ``.pyc`` when
+ ``__debug__`` is True or ``.pyo`` for an optimized Python
+ (i.e. ``__debug__`` is False). By passing in True or False for
+ *debug_override* you can override the system's value for ``__debug__`` for
+ extension selection.
+
+ *path* need not exist.
+
+
+.. function:: source_from_cache(path)
+
+ Given the *path* to a :pep:`3147` file name, return the associated source code
+ file path. For example, if *path* is
+ ``/foo/bar/__pycache__/baz.cpython-32.pyc`` the returned path would be
+ ``/foo/bar/baz.py``. *path* need not exist, however if it does not conform
+ to :pep:`3147` format, a ``ValueError`` is raised.
+
+
+.. function:: get_tag()
+
+ Return the :pep:`3147` magic tag string matching this version of Python's
+ magic number, as returned by :func:`get_magic`.
+
+
+The following constants with integer values, defined in this module, are used
+to indicate the search result of :func:`find_module`.
.. data:: PY_SOURCE
@@ -273,10 +308,3 @@ in that version, since :func:`find_module` has been extended and
# Since we may exit via an exception, close fp explicitly.
if fp:
fp.close()
-
-.. index:: module: knee
-
-A more complete example that implements hierarchical module names and includes a
-:func:`reload` function can be found in the module :mod:`knee`. The :mod:`knee`
-module can be found in :file:`Demo/imputil/` in the Python source distribution.
-
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index cf13ba3033..c9f742ad03 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -18,12 +18,12 @@ implementation of the :keyword:`import` statement (and thus, by extension, the
:func:`__import__` function) in Python source code. This provides an
implementation of :keyword:`import` which is portable to any Python
interpreter. This also provides a reference implementation which is easier to
-comprehend than one in a programming language other than Python.
+comprehend than one implemented in a programming language other than Python.
-Two, the components to implement :keyword:`import` can be exposed in this
+Two, the components to implement :keyword:`import` are exposed in this
package, making it easier for users to create their own custom objects (known
generically as an :term:`importer`) to participate in the import process.
-Details on providing custom importers can be found in :pep:`302`.
+Details on custom importers can be found in :pep:`302`.
.. seealso::
@@ -32,12 +32,11 @@ Details on providing custom importers can be found in :pep:`302`.
`Packages specification <http://www.python.org/doc/essays/packages.html>`__
Original specification of packages. Some semantics have changed since
- the writing of this document (e.g. redirecting based on :keyword:`None`
+ the writing of this document (e.g. redirecting based on ``None``
in :data:`sys.modules`).
The :func:`.__import__` function
- The built-in function for which the :keyword:`import` statement is
- syntactic sugar.
+ The :keyword:`import` statement is syntactic sugar for this function.
:pep:`235`
Import on Case-Insensitive Platforms
@@ -46,7 +45,7 @@ Details on providing custom importers can be found in :pep:`302`.
Defining Python Source Code Encodings
:pep:`302`
- New Import Hooks.
+ New Import Hooks
:pep:`328`
Imports: Multi-Line and Absolute/Relative
@@ -57,14 +56,16 @@ Details on providing custom importers can be found in :pep:`302`.
:pep:`3120`
Using UTF-8 as the Default Source Encoding
+ :pep:`3147`
+ PYC Repository Directories
+
Functions
---------
.. function:: __import__(name, globals={}, locals={}, fromlist=list(), level=0)
- An implementation of the built-in :func:`__import__` function. See the
- built-in function's documentation for usage instructions.
+ An implementation of the built-in :func:`__import__` function.
.. function:: import_module(name, package=None)
@@ -108,7 +109,7 @@ are also provided to help in implementing the core ABCs.
module. If the :term:`finder` is found on :data:`sys.meta_path` and the
module to be searched for is a subpackage or module then *path* will
be the value of :attr:`__path__` from the parent package. If a loader
- cannot be found, :keyword:`None` is returned.
+ cannot be found, ``None`` is returned.
.. class:: Loader
@@ -184,14 +185,14 @@ are also provided to help in implementing the core ABCs.
.. method:: get_code(fullname)
An abstract method to return the :class:`code` object for a module.
- :keyword:`None` is returned if the module does not have a code object
+ ``None`` is returned if the module does not have a code object
(e.g. built-in module). :exc:`ImportError` is raised if loader cannot
find the requested module.
.. method:: get_source(fullname)
An abstract method to return the source of a module. It is returned as
- a text string with universal newlines. Returns :keyword:`None` if no
+ a text string with universal newlines. Returns ``None`` if no
source is available (e.g. a built-in module). Raises :exc:`ImportError`
if the loader cannot find the module specified.
@@ -202,21 +203,133 @@ are also provided to help in implementing the core ABCs.
:term:`loader` cannot find the module.
+.. class:: ExecutionLoader
+
+ An abstract base class which inherits from :class:`InspectLoader` that,
+ when implemented, helps a module to be executed as a script. The ABC
+ represents an optional :pep:`302` protocol.
+
+ .. method:: get_filename(fullname)
+
+ An abstract method that is to return the value of :attr:`__file__` for
+ the specified module. If no path is available, :exc:`ImportError` is
+ raised.
+
+ If source code is available, then the method should return the path to
+ the source file, regardless of whether a bytecode was used to load the
+ module.
+
+
+.. class:: SourceLoader
+
+ An abstract base class for implementing source (and optionally bytecode)
+ file loading. The class inherits from both :class:`ResourceLoader` and
+ :class:`ExecutionLoader`, requiring the implementation of:
+
+ * :meth:`ResourceLoader.get_data`
+ * :meth:`ExecutionLoader.get_filename`
+ Should only return the path to the source file; sourceless
+ loading is not supported.
+
+ The abstract methods defined by this class are to add optional bytecode
+ file support. Not implementing these optional methods causes the loader to
+ only work with source code. Implementing the methods allows the loader to
+ work with source *and* bytecode files; it does not allow for *sourceless*
+ loading where only bytecode is provided. Bytecode files are an
+ optimization to speed up loading by removing the parsing step of Python's
+ compiler, and so no bytecode-specific API is exposed.
+
+ .. method:: path_mtime(self, path)
+
+ Optional abstract method which returns the modification time for the
+ specified path.
+
+ .. method:: set_data(self, path, data)
+
+ Optional abstract method which writes the specified bytes to a file
+ path. Any intermediate directories which do not exist are to be created
+ automatically.
+
+ When writing to the path fails because the path is read-only
+ (:attr:`errno.EACCES`), do not propagate the exception.
+
+ .. method:: get_code(self, fullname)
+
+ Concrete implementation of :meth:`InspectLoader.get_code`.
+
+ .. method:: load_module(self, fullname)
+
+ Concrete implementation of :meth:`Loader.load_module`.
+
+ .. method:: get_source(self, fullname)
+
+ Concrete implementation of :meth:`InspectLoader.get_source`.
+
+ .. method:: is_package(self, fullname)
+
+ Concrete implementation of :meth:`InspectLoader.is_package`. A module
+ is determined to be a package if its file path is a file named
+ ``__init__`` when the file extension is removed.
+
+
.. class:: PyLoader
- An abstract base class inheriting from :class:`importlib.abc.InspectLoader`
- and :class:`importlib.abc.ResourceLoader` designed to ease the loading of
+ An abstract base class inheriting from
+ :class:`ExecutionLoader` and
+ :class:`ResourceLoader` designed to ease the loading of
Python source modules (bytecode is not handled; see
- :class:`importlib.abc.PyPycLoader` for a source/bytecode ABC). A subclass
+ :class:`SourceLoader` for a source/bytecode ABC). A subclass
implementing this ABC will only need to worry about exposing how the source
code is stored; all other details for loading Python source code will be
handled by the concrete implementations of key methods.
+ .. deprecated:: 3.2
+ This class has been deprecated in favor of :class:`SourceLoader` and is
+ slated for removal in Python 3.4. See below for how to create a
+ subclass that is compatible with Python 3.1 onwards.
+
+ If compatibility with Python 3.1 is required, then use the following idiom
+ to implement a subclass that will work with Python 3.1 onwards (make sure
+ to implement :meth:`ExecutionLoader.get_filename`)::
+
+ try:
+ from importlib.abc import SourceLoader
+ except ImportError:
+ from importlib.abc import PyLoader as SourceLoader
+
+
+ class CustomLoader(SourceLoader):
+ def get_filename(self, fullname):
+ """Return the path to the source file."""
+ # Implement ...
+
+ def source_path(self, fullname):
+ """Implement source_path in terms of get_filename."""
+ try:
+ return self.get_filename(fullname)
+ except ImportError:
+ return None
+
+ def is_package(self, fullname):
+ """Implement is_package by looking for an __init__ file
+ name as returned by get_filename."""
+ filename = os.path.basename(self.get_filename(fullname))
+ return os.path.splitext(filename)[0] == '__init__'
+
+
.. method:: source_path(fullname)
An abstract method that returns the path to the source code for a
- module. Should return :keyword:`None` if there is no source code.
- :exc:`ImportError` if the module cannot be found.
+ module. Should return ``None`` if there is no source code.
+ Raises :exc:`ImportError` if the loader knows it cannot handle the
+ module.
+
+ .. method:: get_filename(fullname)
+
+ A concrete implementation of
+ :meth:`importlib.abc.ExecutionLoader.get_filename` that
+ relies on :meth:`source_path`. If :meth:`source_path` returns
+ ``None``, then :exc:`ImportError` is raised.
.. method:: load_module(fullname)
@@ -231,43 +344,62 @@ are also provided to help in implementing the core ABCs.
A concrete implementation of
:meth:`importlib.abc.InspectLoader.get_code` that creates code objects
from Python source code, by requesting the source code (using
- :meth:`source_path` and :meth:`get_data`), converting it to standard
- newlines, and compiling it with the built-in :func:`compile` function.
+ :meth:`source_path` and :meth:`get_data`) and compiling it with the
+ built-in :func:`compile` function.
.. method:: get_source(fullname)
A concrete implementation of
:meth:`importlib.abc.InspectLoader.get_source`. Uses
- :meth:`importlib.abc.ResourceLoader.get_data` and :meth:`source_path` to
- get the source code. It tries to guess the source encoding using
+ :meth:`importlib.abc.ResourceLoader.get_data` and :meth:`source_path`
+ to get the source code. It tries to guess the source encoding using
:func:`tokenize.detect_encoding`.
.. class:: PyPycLoader
- An abstract base class inheriting from :class:`importlib.abc.PyLoader`.
+ An abstract base class inheriting from :class:`PyLoader`.
This ABC is meant to help in creating loaders that support both Python
source and bytecode.
+ .. deprecated:: 3.2
+ This class has been deprecated in favor of :class:`SourceLoader` and to
+ properly support :pep:`3147`. If compatibility is required with
+ Python 3.1, implement both :class:`SourceLoader` and :class:`PyLoader`;
+ instructions on how to do so are included in the documentation for
+ :class:`PyLoader`. Do note that this solution will not support
+ sourceless/bytecode-only loading; only source *and* bytecode loading.
+
.. method:: source_mtime(fullname)
An abstract method which returns the modification time for the source
code of the specified module. The modification time should be an
- integer. If there is no source code, return :keyword:`None`. If the
+ integer. If there is no source code, return ``None``. If the
module cannot be found then :exc:`ImportError` is raised.
.. method:: bytecode_path(fullname)
An abstract method which returns the path to the bytecode for the
- specified module, if it exists. It returns :keyword:`None`
+ specified module, if it exists. It returns ``None``
if no bytecode exists (yet).
- Raises :exc:`ImportError` if the module is not found.
+ Raises :exc:`ImportError` if the loader knows it cannot handle the
+ module.
+
+ .. method:: get_filename(fullname)
+
+ A concrete implementation of
+ :meth:`ExecutionLoader.get_filename` that relies on
+ :meth:`PyLoader.source_path` and :meth:`bytecode_path`.
+ If :meth:`source_path` returns a path, then that value is returned.
+ Else if :meth:`bytecode_path` returns a path, that path will be
+ returned. If a path is not available from both methods,
+ :exc:`ImportError` is raised.
.. method:: write_bytecode(fullname, bytecode)
An abstract method which has the loader write *bytecode* for future
- use. If the bytecode is written, return :keyword:`True`. Return
- :keyword:`False` if the bytecode could not be written. This method
+ use. If the bytecode is written, return ``True``. Return
+ ``False`` if the bytecode could not be written. This method
should not be called if :data:`sys.dont_write_bytecode` is true.
The *bytecode* argument should be a bytes string or bytes array.
@@ -311,7 +443,7 @@ find and load modules.
terms of :data:`sys.path`. No implicit path hooks are assumed for
simplification of the class and its semantics.
- Only class method are defined by this class to alleviate the need for
+ Only class methods are defined by this class to alleviate the need for
instantiation.
.. classmethod:: find_module(fullname, path=None)
@@ -325,7 +457,7 @@ find and load modules.
:data:`sys.path_importer_cache`, then :data:`sys.path_hooks` is
searched for a finder for the path entry and, if found, is stored in
:data:`sys.path_importer_cache` along with being queried about the
- module. If no finder is ever found then :keyword:`None` is returned.
+ module. If no finder is ever found then ``None`` is returned.
:mod:`importlib.util` -- Utility code for importers
@@ -337,7 +469,7 @@ find and load modules.
This module contains the various objects that help in the construction of
an :term:`importer`.
-.. function:: module_for_loader(method)
+.. decorator:: module_for_loader
A :term:`decorator` for a :term:`loader` method,
to handle selecting the proper
@@ -362,7 +494,7 @@ an :term:`importer`.
Use of this decorator handles all the details of which module object a
loader should initialize as specified by :pep:`302`.
-.. function:: set_loader(fxn)
+.. decorator:: set_loader
A :term:`decorator` for a :term:`loader` method,
to set the :attr:`__loader__`
@@ -370,11 +502,11 @@ an :term:`importer`.
does nothing. It is assumed that the first positional argument to the
wrapped method is what :attr:`__loader__` should be set to.
-.. function:: set_package(fxn)
+.. decorator:: set_package
A :term:`decorator` for a :term:`loader` to set the :attr:`__package__`
attribute on the module returned by the loader. If :attr:`__package__` is
- set and has a value other than :keyword:`None` it will not be changed.
+ set and has a value other than ``None`` it will not be changed.
Note that the module returned by the loader is what has the attribute
set on and not the module found in :data:`sys.modules`.
@@ -384,100 +516,3 @@ an :term:`importer`.
attribute to be used at the global level of the module during
initialization.
-
-Example
--------
-
-Below is an example meta path importer that uses a dict for back-end storage
-for source code. While not an optimal solution -- manipulations of
-:attr:`__path__` on packages does not influence import -- it does illustrate
-what little is required to implement an importer.
-
-.. testcode::
-
- """An importer where source is stored in a dict."""
- from importlib import abc
-
-
- class DictImporter(abc.Finder, abc.PyLoader):
-
- """A meta path importer that stores source code in a dict.
-
- The keys are the module names -- packages must end in ``.__init__``.
- The values must be something that can be passed to 'bytes'.
-
- """
-
- def __init__(self, memory):
- """Store the dict."""
- self.memory = memory
-
- def contains(self, name):
- """See if a module or package is in the dict."""
- if name in self.memory:
- return name
- package_name = '{}.__init__'.format(name)
- if package_name in self.memory:
- return package_name
- return False
-
- __contains__ = contains # Convenience.
-
- def find_module(self, fullname, path=None):
- """Find the module in the dict."""
- if fullname in self:
- return self
- return None
-
- def source_path(self, fullname):
- """Return the module name if the module is in the dict."""
- if not fullname in self:
- raise ImportError
- return fullname
-
- def get_data(self, path):
- """Return the bytes for the source.
-
- The value found in the dict is passed through 'bytes' before being
- returned.
-
- """
- name = self.contains(path)
- if not name:
- raise IOError
- return bytes(self.memory[name])
-
- def is_package(self, fullname):
- """Tell if module is a package based on whether the dict contains the
- name with ``.__init__`` appended to it."""
- if fullname not in self:
- raise ImportError
- if fullname in self.memory:
- return False
- # If name is in this importer but not as it is then it must end in
- # ``__init__``.
- else:
- return True
-
-.. testcode::
- :hide:
-
- import importlib
- import sys
-
-
- # Build the dict; keys of name, value of __package__.
- names = {'_top_level': '', '_pkg.__init__': '_pkg', '_pkg.mod': '_pkg'}
- source = {name: "name = {!r}".format(name).encode() for name in names}
-
- # Register the meta path importer.
- importer = DictImporter(source)
- sys.meta_path.append(importer)
-
- # Sanity check.
- for name in names:
- module = importlib.import_module(name)
- assert module.__name__ == name
- assert getattr(module, 'name') == name
- assert module.__loader__ is importer
- assert module.__package__ == names[name]
diff --git a/Doc/library/index.rst b/Doc/library/index.rst
index aa582dea1a..9ac688c8c9 100644
--- a/Doc/library/index.rst
+++ b/Doc/library/index.rst
@@ -43,13 +43,13 @@ the `Python Package Index <http://pypi.python.org/pypi>`_.
intro.rst
functions.rst
constants.rst
- objects.rst
stdtypes.rst
exceptions.rst
strings.rst
datatypes.rst
numeric.rst
+ functional.rst
filesys.rst
persistence.rst
archiving.rst
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 4def286c21..7a57a0d311 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Ka-Ping Yee <ping@lfw.org>
.. sectionauthor:: Ka-Ping Yee <ping@lfw.org>
+**Source code:** :source:`Lib/inspect.py`
+
+--------------
The :mod:`inspect` module provides several useful functions to help get
information about live objects such as modules, classes, methods, functions,
@@ -87,7 +90,7 @@ attributes:
| frame | f_back | next outer frame object |
| | | (this frame's caller) |
+-----------+-----------------+---------------------------+
-| | f_builtins | built-in namespace seen |
+| | f_builtins | builtins namespace seen |
| | | by this frame |
+-----------+-----------------+---------------------------+
| | f_code | code object being |
@@ -295,7 +298,7 @@ attributes:
.. impl-detail::
getsets are attributes defined in extension modules via
- :ctype:`PyGetSetDef` structures. For Python implementations without such
+ :c:type:`PyGetSetDef` structures. For Python implementations without such
types, this method will always return ``False``.
@@ -306,7 +309,7 @@ attributes:
.. impl-detail::
Member descriptors are attributes defined in extension modules via
- :ctype:`PyMemberDef` structures. For Python implementations without such
+ :c:type:`PyMemberDef` structures. For Python implementations without such
types, this method will always return ``False``.
@@ -451,6 +454,32 @@ Classes and functions
metatype is in use, cls will be the first element of the tuple.
+.. function:: getcallargs(func[, *args][, **kwds])
+
+ Bind the *args* and *kwds* to the argument names of the Python function or
+ method *func*, as if it was called with them. For bound methods, bind also the
+ first argument (typically named ``self``) to the associated instance. A dict
+ is returned, mapping the argument names (including the names of the ``*`` and
+ ``**`` arguments, if any) to their values from *args* and *kwds*. In case of
+ invoking *func* incorrectly, i.e. whenever ``func(*args, **kwds)`` would raise
+ an exception because of incompatible signature, an exception of the same type
+ and the same or similar message is raised. For example::
+
+ >>> from inspect import getcallargs
+ >>> def f(a, b=1, *pos, **named):
+ ... pass
+ >>> getcallargs(f, 1, 2, 3)
+ {'a': 1, 'named': {}, 'b': 2, 'pos': (3,)}
+ >>> getcallargs(f, a=2, x=4)
+ {'a': 2, 'named': {'x': 4}, 'b': 1, 'pos': ()}
+ >>> getcallargs(f)
+ Traceback (most recent call last):
+ ...
+ TypeError: f() takes at least 1 argument (0 given)
+
+ .. versionadded:: 3.2
+
+
.. _inspect-stack:
The interpreter stack
@@ -536,3 +565,81 @@ line.
entry in the list represents the caller; the last entry represents where the
exception was raised.
+
+Fetching attributes statically
+------------------------------
+
+Both :func:`getattr` and :func:`hasattr` can trigger code execution when
+fetching or checking for the existence of attributes. Descriptors, like
+properties, will be invoked and :meth:`__getattr__` and :meth:`__getattribute__`
+may be called.
+
+For cases where you want passive introspection, like documentation tools, this
+can be inconvenient. `getattr_static` has the same signature as :func:`getattr`
+but avoids executing code when it fetches attributes.
+
+.. function:: getattr_static(obj, attr, default=None)
+
+ Retrieve attributes without triggering dynamic lookup via the
+ descriptor protocol, `__getattr__` or `__getattribute__`.
+
+ Note: this function may not be able to retrieve all attributes
+ that getattr can fetch (like dynamically created attributes)
+ and may find attributes that getattr can't (like descriptors
+ that raise AttributeError). It can also return descriptors objects
+ instead of instance members.
+
+ If the instance `__dict__` is shadowed by another member (for example a
+ property) then this function will be unable to find instance members.
+
+ .. versionadded:: 3.2
+
+`getattr_static` does not resolve descriptors, for example slot descriptors or
+getset descriptors on objects implemented in C. The descriptor object
+is returned instead of the underlying attribute.
+
+You can handle these with code like the following. Note that
+for arbitrary getset descriptors invoking these may trigger
+code execution::
+
+ # example code for resolving the builtin descriptor types
+ class _foo:
+ __slots__ = ['foo']
+
+ slot_descriptor = type(_foo.foo)
+ getset_descriptor = type(type(open(__file__)).name)
+ wrapper_descriptor = type(str.__dict__['__add__'])
+ descriptor_types = (slot_descriptor, getset_descriptor, wrapper_descriptor)
+
+ result = getattr_static(some_object, 'foo')
+ if type(result) in descriptor_types:
+ try:
+ result = result.__get__()
+ except AttributeError:
+ # descriptors can raise AttributeError to
+ # indicate there is no underlying value
+ # in which case the descriptor itself will
+ # have to do
+ pass
+
+
+Current State of a Generator
+----------------------------
+
+When implementing coroutine schedulers and for other advanced uses of
+generators, it is useful to determine whether a generator is currently
+executing, is waiting to start or resume or execution, or has already
+terminated. :func:`getgeneratorstate` allows the current state of a
+generator to be determined easily.
+
+.. function:: getgeneratorstate(generator)
+
+ Get current state of a generator-iterator.
+
+ Possible states are:
+ * GEN_CREATED: Waiting to start execution.
+ * GEN_RUNNING: Currently being executed by the interpreter.
+ * GEN_SUSPENDED: Currently suspended at a yield expression.
+ * GEN_CLOSED: Execution has completed.
+
+ .. versionadded:: 3.2
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index bbe5112427..0584b70a1b 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -513,6 +513,24 @@ than raw I/O does.
:class:`BytesIO` provides or overrides these methods in addition to those
from :class:`BufferedIOBase` and :class:`IOBase`:
+ .. method:: getbuffer()
+
+ Return a readable and writable view over the contents of the buffer
+ without copying them. Also, mutating the view will transparently
+ update the contents of the buffer::
+
+ >>> b = io.BytesIO(b"abcdef")
+ >>> view = b.getbuffer()
+ >>> view[2:4] = b"56"
+ >>> b.getvalue()
+ b'ab56ef'
+
+ .. note::
+ As long as the view exists, the :class:`BytesIO` object cannot be
+ resized.
+
+ .. versionadded:: 3.2
+
.. method:: getvalue()
Return ``bytes`` containing the entire contents of the buffer.
@@ -767,37 +785,33 @@ Text I/O
inherits :class:`codecs.IncrementalDecoder`.
-Advanced topics
----------------
-
-Here we will discuss several advanced topics pertaining to the concrete
-I/O implementations described above.
-
Performance
-^^^^^^^^^^^
+-----------
+
+This section discusses the performance of the provided concrete I/O
+implementations.
Binary I/O
-""""""""""
-
-By reading and writing only large chunks of data even when the user asks
-for a single byte, buffered I/O is designed to hide any inefficiency in
-calling and executing the operating system's unbuffered I/O routines. The
-gain will vary very much depending on the OS and the kind of I/O which is
-performed (for example, on some contemporary OSes such as Linux, unbuffered
-disk I/O can be as fast as buffered I/O). The bottom line, however, is
-that buffered I/O will offer you predictable performance regardless of the
-platform and the backing device. Therefore, it is most always preferable to
-use buffered I/O rather than unbuffered I/O.
+^^^^^^^^^^
+
+By reading and writing only large chunks of data even when the user asks for a
+single byte, buffered I/O hides any inefficiency in calling and executing the
+operating system's unbuffered I/O routines. The gain depends on the OS and the
+kind of I/O which is performed. For example, on some modern OSes such as Linux,
+unbuffered disk I/O can be as fast as buffered I/O. The bottom line, however,
+is that buffered I/O offers predictable performance regardless of the platform
+and the backing device. Therefore, it is most always preferable to use buffered
+I/O rather than unbuffered I/O for binary datal
Text I/O
-""""""""
+^^^^^^^^
Text I/O over a binary storage (such as a file) is significantly slower than
-binary I/O over the same storage, because it implies conversions from
-unicode to binary data using a character codec. This can become noticeable
-if you handle huge amounts of text data (for example very large log files).
-Also, :meth:`TextIOWrapper.tell` and :meth:`TextIOWrapper.seek` are both
-quite slow due to the reconstruction algorithm used.
+binary I/O over the same storage, because it requires conversions between
+unicode and binary data using a character codec. This can become noticeable
+handling huge amounts of text data like large log files. Also,
+:meth:`TextIOWrapper.tell` and :meth:`TextIOWrapper.seek` are both quite slow
+due to the reconstruction algorithm used.
:class:`StringIO`, however, is a native in-memory unicode container and will
exhibit similar speed to :class:`BytesIO`.
@@ -805,9 +819,8 @@ exhibit similar speed to :class:`BytesIO`.
Multi-threading
^^^^^^^^^^^^^^^
-:class:`FileIO` objects are thread-safe to the extent that the operating
-system calls (such as ``read(2)`` under Unix) they are wrapping are thread-safe
-too.
+:class:`FileIO` objects are thread-safe to the extent that the operating system
+calls (such as ``read(2)`` under Unix) they wrap are thread-safe too.
Binary buffered objects (instances of :class:`BufferedReader`,
:class:`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`)
@@ -822,12 +835,13 @@ Reentrancy
Binary buffered objects (instances of :class:`BufferedReader`,
:class:`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`)
are not reentrant. While reentrant calls will not happen in normal situations,
-they can arise if you are doing I/O in a :mod:`signal` handler. If it is
-attempted to enter a buffered object again while already being accessed
-*from the same thread*, then a :exc:`RuntimeError` is raised.
-
-The above implicitly extends to text files, since the :func:`open()`
-function will wrap a buffered object inside a :class:`TextIOWrapper`. This
-includes standard streams and therefore affects the built-in function
-:func:`print()` as well.
+they can arise from doing I/O in a :mod:`signal` handler. If a thread tries to
+renter a buffered object which it is already accessing, a :exc:`RuntimeError` is
+raised. Note this doesn't prohibit a different thread from entering the
+buffered object.
+
+The above implicitly extends to text files, since the :func:`open()` function
+will wrap a buffered object inside a :class:`TextIOWrapper`. This includes
+standard streams and therefore affects the built-in function :func:`print()` as
+well.
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index add209153e..757823d9f1 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -46,6 +46,7 @@ Iterator Arguments Results
==================== ============================ ================================================= =============================================================
Iterator Arguments Results Example
==================== ============================ ================================================= =============================================================
+:func:`accumulate` p p0, p0+p1, p0+p1+p2, ... ``accumulate([1,2,3,4,5]) --> 1 3 6 10 15``
:func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... ``chain('ABC', 'DEF') --> A B C D E F``
:func:`compress` data, selectors (d[0] if s[0]), (d[1] if s[1]), ... ``compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F``
:func:`dropwhile` pred, seq seq[n], seq[n+1], starting when pred fails ``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1``
@@ -83,6 +84,22 @@ The following module functions all construct and return iterators. Some provide
streams of infinite length, so they should only be accessed by functions or
loops that truncate the stream.
+.. function:: accumulate(iterable)
+
+ Make an iterator that returns accumulated sums. Elements may be any addable
+ type including :class:`Decimal` or :class:`Fraction`. Equivalent to::
+
+ def accumulate(iterable):
+ 'Return running totals'
+ # accumulate([1,2,3,4,5]) --> 1 3 6 10 15
+ it = iter(iterable)
+ total = next(it)
+ yield total
+ for element in it:
+ total = total + element
+ yield total
+
+ .. versionadded:: 3.2
.. function:: chain(*iterables)
@@ -560,8 +577,8 @@ loops that truncate the stream.
.. _itertools-recipes:
-Recipes
--------
+Itertools Recipes
+-----------------
This section shows recipes for creating an extended toolset using the existing
itertools as building blocks.
@@ -653,6 +670,12 @@ which incur interpreter overhead.
pending -= 1
nexts = cycle(islice(nexts, pending))
+ def partition(pred, iterable):
+ 'Use a predicate to partition entries into false entries and true entries'
+ # partition(is_odd, range(10)) --> 0 2 4 6 8 and 1 3 5 7 9
+ t1, t2 = tee(iterable)
+ return filterfalse(pred, t1), filter(pred, t2)
+
def powerset(iterable):
"powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"
s = list(iterable)
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index 48acaf19d6..4ee17f2395 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -6,7 +6,7 @@
.. moduleauthor:: Bob Ippolito <bob@redivi.com>
.. sectionauthor:: Bob Ippolito <bob@redivi.com>
-JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript
+`JSON (JavaScript Object Notation) <http://json.org>`_ is a subset of JavaScript
syntax (ECMA-262 3rd edition) used as a lightweight data interchange format.
:mod:`json` exposes an API familiar to users of the standard library
@@ -134,10 +134,12 @@ Basic Usage
``inf``, ``-inf``) in strict compliance of the JSON specification, instead of
using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).
- If *indent* is a non-negative integer, then JSON array elements and object
- members will be pretty-printed with that indent level. An indent level of 0,
- or negative, will only insert newlines. ``None`` (the default) selects the
- most compact representation.
+ If *indent* is a non-negative integer or string, then JSON array elements and
+ object members will be pretty-printed with that indent level. An indent level
+ of 0, negative, or ``""`` will only insert newlines. ``None`` (the default)
+ selects the most compact representation. Using a positive integer indent
+ indents that many spaces per level. If *indent* is a string (such at '\t'),
+ that string is used to indent each level.
If *separators* is an ``(item_separator, dict_separator)`` tuple, then it
will be used instead of the default ``(', ', ': ')`` separators. ``(',',
diff --git a/Doc/library/keyword.rst b/Doc/library/keyword.rst
index a4bfa501bf..173db23544 100644
--- a/Doc/library/keyword.rst
+++ b/Doc/library/keyword.rst
@@ -4,6 +4,9 @@
.. module:: keyword
:synopsis: Test whether a string is a keyword in Python.
+**Source code:** :source:`Lib/keyword.py`
+
+--------------
This module allows a Python program to determine if a string is a keyword.
@@ -18,4 +21,3 @@ This module allows a Python program to determine if a string is a keyword.
Sequence containing all the keywords defined for the interpreter. If any
keywords are defined to only be active when particular :mod:`__future__`
statements are in effect, these will be included as well.
-
diff --git a/Doc/library/language.rst b/Doc/library/language.rst
index 3d907a0652..1eac32e459 100644
--- a/Doc/library/language.rst
+++ b/Doc/library/language.rst
@@ -26,4 +26,3 @@ These modules include:
compileall.rst
dis.rst
pickletools.rst
- distutils.rst
diff --git a/Doc/library/linecache.rst b/Doc/library/linecache.rst
index 688e297307..dacf8aa002 100644
--- a/Doc/library/linecache.rst
+++ b/Doc/library/linecache.rst
@@ -5,6 +5,9 @@
:synopsis: This module provides random access to individual lines from text files.
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
+**Source code:** :source:`Lib/linecache.py`
+
+--------------
The :mod:`linecache` module allows one to get any line from any file, while
attempting to optimize internally, using a cache, the common case where many
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst
index 5b2941eba5..dd6f9547f7 100644
--- a/Doc/library/locale.rst
+++ b/Doc/library/locale.rst
@@ -215,7 +215,7 @@ The :mod:`locale` module defines the following exception and functions:
.. note::
- The expression is in the syntax suitable for the :cfunc:`regex` function
+ The expression is in the syntax suitable for the :c:func:`regex` function
from the C library, which might differ from the syntax used in :mod:`re`.
.. data:: NOEXPR
@@ -535,7 +535,7 @@ catalogs, and the C library's search algorithms for locating message catalogs.
Python applications should normally find no need to invoke these functions, and
should use :mod:`gettext` instead. A known exception to this rule are
applications that link with additional C libraries which internally invoke
-:cfunc:`gettext` or :func:`dcgettext`. For these applications, it may be
+:c:func:`gettext` or :func:`dcgettext`. For these applications, it may be
necessary to bind the text domain, so that the libraries can properly locate
their message catalogs.
diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst
new file mode 100644
index 0000000000..bb80a7f0fe
--- /dev/null
+++ b/Doc/library/logging.config.rst
@@ -0,0 +1,680 @@
+:mod:`logging.config` --- Logging configuration
+===============================================
+
+.. module:: logging.config
+ :synopsis: Configuration of the logging module.
+
+
+.. moduleauthor:: Vinay Sajip <vinay_sajip@red-dove.com>
+.. sectionauthor:: Vinay Sajip <vinay_sajip@red-dove.com>
+
+.. sidebar:: Important
+
+ This page contains only reference information. For tutorials,
+ please see
+
+ * :ref:`Basic Tutorial <logging-basic-tutorial>`
+ * :ref:`Advanced Tutorial <logging-advanced-tutorial>`
+ * :ref:`Logging Cookbook <logging-cookbook>`
+
+This section describes the API for configuring the logging module.
+
+.. _logging-config-api:
+
+Configuration functions
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The following functions configure the logging module. They are located in the
+:mod:`logging.config` module. Their use is optional --- you can configure the
+logging module using these functions or by making calls to the main API (defined
+in :mod:`logging` itself) and defining handlers which are declared either in
+:mod:`logging` or :mod:`logging.handlers`.
+
+.. function:: dictConfig(config)
+
+ Takes the logging configuration from a dictionary. The contents of
+ this dictionary are described in :ref:`logging-config-dictschema`
+ below.
+
+ If an error is encountered during configuration, this function will
+ raise a :exc:`ValueError`, :exc:`TypeError`, :exc:`AttributeError`
+ or :exc:`ImportError` with a suitably descriptive message. The
+ following is a (possibly incomplete) list of conditions which will
+ raise an error:
+
+ * A ``level`` which is not a string or which is a string not
+ corresponding to an actual logging level.
+ * A ``propagate`` value which is not a boolean.
+ * An id which does not have a corresponding destination.
+ * A non-existent handler id found during an incremental call.
+ * An invalid logger name.
+ * Inability to resolve to an internal or external object.
+
+ Parsing is performed by the :class:`DictConfigurator` class, whose
+ constructor is passed the dictionary used for configuration, and
+ has a :meth:`configure` method. The :mod:`logging.config` module
+ has a callable attribute :attr:`dictConfigClass`
+ which is initially set to :class:`DictConfigurator`.
+ You can replace the value of :attr:`dictConfigClass` with a
+ suitable implementation of your own.
+
+ :func:`dictConfig` calls :attr:`dictConfigClass` passing
+ the specified dictionary, and then calls the :meth:`configure` method on
+ the returned object to put the configuration into effect::
+
+ def dictConfig(config):
+ dictConfigClass(config).configure()
+
+ For example, a subclass of :class:`DictConfigurator` could call
+ ``DictConfigurator.__init__()`` in its own :meth:`__init__()`, then
+ set up custom prefixes which would be usable in the subsequent
+ :meth:`configure` call. :attr:`dictConfigClass` would be bound to
+ this new subclass, and then :func:`dictConfig` could be called exactly as
+ in the default, uncustomized state.
+
+ .. versionadded:: 3.2
+
+.. function:: fileConfig(fname, defaults=None, disable_existing_loggers=True)
+
+ Reads the logging configuration from a :mod:`configparser`\-format file
+ named *fname*. This function can be called several times from an
+ application, allowing an end user to select from various pre-canned
+ configurations (if the developer provides a mechanism to present the choices
+ and load the chosen configuration).
+
+ :param defaults: Defaults to be passed to the ConfigParser can be specified
+ in this argument.
+
+ :param disable_existing_loggers: If specified as ``False``, loggers which
+ exist when this call is made are left
+ alone. The default is ``True`` because this
+ enables old behaviour in a backward-
+ compatible way. This behaviour is to
+ disable any existing loggers unless they or
+ their ancestors are explicitly named in the
+ logging configuration.
+
+
+.. function:: listen(port=DEFAULT_LOGGING_CONFIG_PORT)
+
+ Starts up a socket server on the specified port, and listens for new
+ configurations. If no port is specified, the module's default
+ :const:`DEFAULT_LOGGING_CONFIG_PORT` is used. Logging configurations will be
+ sent as a file suitable for processing by :func:`fileConfig`. Returns a
+ :class:`Thread` instance on which you can call :meth:`start` to start the
+ server, and which you can :meth:`join` when appropriate. To stop the server,
+ call :func:`stopListening`.
+
+ To send a configuration to the socket, read in the configuration file and
+ send it to the socket as a string of bytes preceded by a four-byte length
+ string packed in binary using ``struct.pack('>L', n)``.
+
+
+.. function:: stopListening()
+
+ Stops the listening server which was created with a call to :func:`listen`.
+ This is typically called before calling :meth:`join` on the return value from
+ :func:`listen`.
+
+
+.. _logging-config-dictschema:
+
+Configuration dictionary schema
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Describing a logging configuration requires listing the various
+objects to create and the connections between them; for example, you
+may create a handler named 'console' and then say that the logger
+named 'startup' will send its messages to the 'console' handler.
+These objects aren't limited to those provided by the :mod:`logging`
+module because you might write your own formatter or handler class.
+The parameters to these classes may also need to include external
+objects such as ``sys.stderr``. The syntax for describing these
+objects and connections is defined in :ref:`logging-config-dict-connections`
+below.
+
+Dictionary Schema Details
+"""""""""""""""""""""""""
+
+The dictionary passed to :func:`dictConfig` must contain the following
+keys:
+
+* *version* - to be set to an integer value representing the schema
+ version. The only valid value at present is 1, but having this key
+ allows the schema to evolve while still preserving backwards
+ compatibility.
+
+All other keys are optional, but if present they will be interpreted
+as described below. In all cases below where a 'configuring dict' is
+mentioned, it will be checked for the special ``'()'`` key to see if a
+custom instantiation is required. If so, the mechanism described in
+:ref:`logging-config-dict-userdef` below is used to create an instance;
+otherwise, the context is used to determine what to instantiate.
+
+* *formatters* - the corresponding value will be a dict in which each
+ key is a formatter id and each value is a dict describing how to
+ configure the corresponding Formatter instance.
+
+ The configuring dict is searched for keys ``format`` and ``datefmt``
+ (with defaults of ``None``) and these are used to construct a
+ :class:`logging.Formatter` instance.
+
+* *filters* - the corresponding value will be a dict in which each key
+ is a filter id and each value is a dict describing how to configure
+ the corresponding Filter instance.
+
+ The configuring dict is searched for the key ``name`` (defaulting to the
+ empty string) and this is used to construct a :class:`logging.Filter`
+ instance.
+
+* *handlers* - the corresponding value will be a dict in which each
+ key is a handler id and each value is a dict describing how to
+ configure the corresponding Handler instance.
+
+ The configuring dict is searched for the following keys:
+
+ * ``class`` (mandatory). This is the fully qualified name of the
+ handler class.
+
+ * ``level`` (optional). The level of the handler.
+
+ * ``formatter`` (optional). The id of the formatter for this
+ handler.
+
+ * ``filters`` (optional). A list of ids of the filters for this
+ handler.
+
+ All *other* keys are passed through as keyword arguments to the
+ handler's constructor. For example, given the snippet::
+
+ handlers:
+ console:
+ class : logging.StreamHandler
+ formatter: brief
+ level : INFO
+ filters: [allow_foo]
+ stream : ext://sys.stdout
+ file:
+ class : logging.handlers.RotatingFileHandler
+ formatter: precise
+ filename: logconfig.log
+ maxBytes: 1024
+ backupCount: 3
+
+ the handler with id ``console`` is instantiated as a
+ :class:`logging.StreamHandler`, using ``sys.stdout`` as the underlying
+ stream. The handler with id ``file`` is instantiated as a
+ :class:`logging.handlers.RotatingFileHandler` with the keyword arguments
+ ``filename='logconfig.log', maxBytes=1024, backupCount=3``.
+
+* *loggers* - the corresponding value will be a dict in which each key
+ is a logger name and each value is a dict describing how to
+ configure the corresponding Logger instance.
+
+ The configuring dict is searched for the following keys:
+
+ * ``level`` (optional). The level of the logger.
+
+ * ``propagate`` (optional). The propagation setting of the logger.
+
+ * ``filters`` (optional). A list of ids of the filters for this
+ logger.
+
+ * ``handlers`` (optional). A list of ids of the handlers for this
+ logger.
+
+ The specified loggers will be configured according to the level,
+ propagation, filters and handlers specified.
+
+* *root* - this will be the configuration for the root logger.
+ Processing of the configuration will be as for any logger, except
+ that the ``propagate`` setting will not be applicable.
+
+* *incremental* - whether the configuration is to be interpreted as
+ incremental to the existing configuration. This value defaults to
+ ``False``, which means that the specified configuration replaces the
+ existing configuration with the same semantics as used by the
+ existing :func:`fileConfig` API.
+
+ If the specified value is ``True``, the configuration is processed
+ as described in the section on :ref:`logging-config-dict-incremental`.
+
+* *disable_existing_loggers* - whether any existing loggers are to be
+ disabled. This setting mirrors the parameter of the same name in
+ :func:`fileConfig`. If absent, this parameter defaults to ``True``.
+ This value is ignored if *incremental* is ``True``.
+
+.. _logging-config-dict-incremental:
+
+Incremental Configuration
+"""""""""""""""""""""""""
+
+It is difficult to provide complete flexibility for incremental
+configuration. For example, because objects such as filters
+and formatters are anonymous, once a configuration is set up, it is
+not possible to refer to such anonymous objects when augmenting a
+configuration.
+
+Furthermore, there is not a compelling case for arbitrarily altering
+the object graph of loggers, handlers, filters, formatters at
+run-time, once a configuration is set up; the verbosity of loggers and
+handlers can be controlled just by setting levels (and, in the case of
+loggers, propagation flags). Changing the object graph arbitrarily in
+a safe way is problematic in a multi-threaded environment; while not
+impossible, the benefits are not worth the complexity it adds to the
+implementation.
+
+Thus, when the ``incremental`` key of a configuration dict is present
+and is ``True``, the system will completely ignore any ``formatters`` and
+``filters`` entries, and process only the ``level``
+settings in the ``handlers`` entries, and the ``level`` and
+``propagate`` settings in the ``loggers`` and ``root`` entries.
+
+Using a value in the configuration dict lets configurations to be sent
+over the wire as pickled dicts to a socket listener. Thus, the logging
+verbosity of a long-running application can be altered over time with
+no need to stop and restart the application.
+
+.. _logging-config-dict-connections:
+
+Object connections
+""""""""""""""""""
+
+The schema describes a set of logging objects - loggers,
+handlers, formatters, filters - which are connected to each other in
+an object graph. Thus, the schema needs to represent connections
+between the objects. For example, say that, once configured, a
+particular logger has attached to it a particular handler. For the
+purposes of this discussion, we can say that the logger represents the
+source, and the handler the destination, of a connection between the
+two. Of course in the configured objects this is represented by the
+logger holding a reference to the handler. In the configuration dict,
+this is done by giving each destination object an id which identifies
+it unambiguously, and then using the id in the source object's
+configuration to indicate that a connection exists between the source
+and the destination object with that id.
+
+So, for example, consider the following YAML snippet::
+
+ formatters:
+ brief:
+ # configuration for formatter with id 'brief' goes here
+ precise:
+ # configuration for formatter with id 'precise' goes here
+ handlers:
+ h1: #This is an id
+ # configuration of handler with id 'h1' goes here
+ formatter: brief
+ h2: #This is another id
+ # configuration of handler with id 'h2' goes here
+ formatter: precise
+ loggers:
+ foo.bar.baz:
+ # other configuration for logger 'foo.bar.baz'
+ handlers: [h1, h2]
+
+(Note: YAML used here because it's a little more readable than the
+equivalent Python source form for the dictionary.)
+
+The ids for loggers are the logger names which would be used
+programmatically to obtain a reference to those loggers, e.g.
+``foo.bar.baz``. The ids for Formatters and Filters can be any string
+value (such as ``brief``, ``precise`` above) and they are transient,
+in that they are only meaningful for processing the configuration
+dictionary and used to determine connections between objects, and are
+not persisted anywhere when the configuration call is complete.
+
+The above snippet indicates that logger named ``foo.bar.baz`` should
+have two handlers attached to it, which are described by the handler
+ids ``h1`` and ``h2``. The formatter for ``h1`` is that described by id
+``brief``, and the formatter for ``h2`` is that described by id
+``precise``.
+
+
+.. _logging-config-dict-userdef:
+
+User-defined objects
+""""""""""""""""""""
+
+The schema supports user-defined objects for handlers, filters and
+formatters. (Loggers do not need to have different types for
+different instances, so there is no support in this configuration
+schema for user-defined logger classes.)
+
+Objects to be configured are described by dictionaries
+which detail their configuration. In some places, the logging system
+will be able to infer from the context how an object is to be
+instantiated, but when a user-defined object is to be instantiated,
+the system will not know how to do this. In order to provide complete
+flexibility for user-defined object instantiation, the user needs
+to provide a 'factory' - a callable which is called with a
+configuration dictionary and which returns the instantiated object.
+This is signalled by an absolute import path to the factory being
+made available under the special key ``'()'``. Here's a concrete
+example::
+
+ formatters:
+ brief:
+ format: '%(message)s'
+ default:
+ format: '%(asctime)s %(levelname)-8s %(name)-15s %(message)s'
+ datefmt: '%Y-%m-%d %H:%M:%S'
+ custom:
+ (): my.package.customFormatterFactory
+ bar: baz
+ spam: 99.9
+ answer: 42
+
+The above YAML snippet defines three formatters. The first, with id
+``brief``, is a standard :class:`logging.Formatter` instance with the
+specified format string. The second, with id ``default``, has a
+longer format and also defines the time format explicitly, and will
+result in a :class:`logging.Formatter` initialized with those two format
+strings. Shown in Python source form, the ``brief`` and ``default``
+formatters have configuration sub-dictionaries::
+
+ {
+ 'format' : '%(message)s'
+ }
+
+and::
+
+ {
+ 'format' : '%(asctime)s %(levelname)-8s %(name)-15s %(message)s',
+ 'datefmt' : '%Y-%m-%d %H:%M:%S'
+ }
+
+respectively, and as these dictionaries do not contain the special key
+``'()'``, the instantiation is inferred from the context: as a result,
+standard :class:`logging.Formatter` instances are created. The
+configuration sub-dictionary for the third formatter, with id
+``custom``, is::
+
+ {
+ '()' : 'my.package.customFormatterFactory',
+ 'bar' : 'baz',
+ 'spam' : 99.9,
+ 'answer' : 42
+ }
+
+and this contains the special key ``'()'``, which means that
+user-defined instantiation is wanted. In this case, the specified
+factory callable will be used. If it is an actual callable it will be
+used directly - otherwise, if you specify a string (as in the example)
+the actual callable will be located using normal import mechanisms.
+The callable will be called with the **remaining** items in the
+configuration sub-dictionary as keyword arguments. In the above
+example, the formatter with id ``custom`` will be assumed to be
+returned by the call::
+
+ my.package.customFormatterFactory(bar='baz', spam=99.9, answer=42)
+
+The key ``'()'`` has been used as the special key because it is not a
+valid keyword parameter name, and so will not clash with the names of
+the keyword arguments used in the call. The ``'()'`` also serves as a
+mnemonic that the corresponding value is a callable.
+
+
+.. _logging-config-dict-externalobj:
+
+Access to external objects
+""""""""""""""""""""""""""
+
+There are times where a configuration needs to refer to objects
+external to the configuration, for example ``sys.stderr``. If the
+configuration dict is constructed using Python code, this is
+straightforward, but a problem arises when the configuration is
+provided via a text file (e.g. JSON, YAML). In a text file, there is
+no standard way to distinguish ``sys.stderr`` from the literal string
+``'sys.stderr'``. To facilitate this distinction, the configuration
+system looks for certain special prefixes in string values and
+treat them specially. For example, if the literal string
+``'ext://sys.stderr'`` is provided as a value in the configuration,
+then the ``ext://`` will be stripped off and the remainder of the
+value processed using normal import mechanisms.
+
+The handling of such prefixes is done in a way analogous to protocol
+handling: there is a generic mechanism to look for prefixes which
+match the regular expression ``^(?P<prefix>[a-z]+)://(?P<suffix>.*)$``
+whereby, if the ``prefix`` is recognised, the ``suffix`` is processed
+in a prefix-dependent manner and the result of the processing replaces
+the string value. If the prefix is not recognised, then the string
+value will be left as-is.
+
+
+.. _logging-config-dict-internalobj:
+
+Access to internal objects
+""""""""""""""""""""""""""
+
+As well as external objects, there is sometimes also a need to refer
+to objects in the configuration. This will be done implicitly by the
+configuration system for things that it knows about. For example, the
+string value ``'DEBUG'`` for a ``level`` in a logger or handler will
+automatically be converted to the value ``logging.DEBUG``, and the
+``handlers``, ``filters`` and ``formatter`` entries will take an
+object id and resolve to the appropriate destination object.
+
+However, a more generic mechanism is needed for user-defined
+objects which are not known to the :mod:`logging` module. For
+example, consider :class:`logging.handlers.MemoryHandler`, which takes
+a ``target`` argument which is another handler to delegate to. Since
+the system already knows about this class, then in the configuration,
+the given ``target`` just needs to be the object id of the relevant
+target handler, and the system will resolve to the handler from the
+id. If, however, a user defines a ``my.package.MyHandler`` which has
+an ``alternate`` handler, the configuration system would not know that
+the ``alternate`` referred to a handler. To cater for this, a generic
+resolution system allows the user to specify::
+
+ handlers:
+ file:
+ # configuration of file handler goes here
+
+ custom:
+ (): my.package.MyHandler
+ alternate: cfg://handlers.file
+
+The literal string ``'cfg://handlers.file'`` will be resolved in an
+analogous way to strings with the ``ext://`` prefix, but looking
+in the configuration itself rather than the import namespace. The
+mechanism allows access by dot or by index, in a similar way to
+that provided by ``str.format``. Thus, given the following snippet::
+
+ handlers:
+ email:
+ class: logging.handlers.SMTPHandler
+ mailhost: localhost
+ fromaddr: my_app@domain.tld
+ toaddrs:
+ - support_team@domain.tld
+ - dev_team@domain.tld
+ subject: Houston, we have a problem.
+
+in the configuration, the string ``'cfg://handlers'`` would resolve to
+the dict with key ``handlers``, the string ``'cfg://handlers.email``
+would resolve to the dict with key ``email`` in the ``handlers`` dict,
+and so on. The string ``'cfg://handlers.email.toaddrs[1]`` would
+resolve to ``'dev_team.domain.tld'`` and the string
+``'cfg://handlers.email.toaddrs[0]'`` would resolve to the value
+``'support_team@domain.tld'``. The ``subject`` value could be accessed
+using either ``'cfg://handlers.email.subject'`` or, equivalently,
+``'cfg://handlers.email[subject]'``. The latter form only needs to be
+used if the key contains spaces or non-alphanumeric characters. If an
+index value consists only of decimal digits, access will be attempted
+using the corresponding integer value, falling back to the string
+value if needed.
+
+Given a string ``cfg://handlers.myhandler.mykey.123``, this will
+resolve to ``config_dict['handlers']['myhandler']['mykey']['123']``.
+If the string is specified as ``cfg://handlers.myhandler.mykey[123]``,
+the system will attempt to retrieve the value from
+``config_dict['handlers']['myhandler']['mykey'][123]``, and fall back
+to ``config_dict['handlers']['myhandler']['mykey']['123']`` if that
+fails.
+
+.. _logging-config-fileformat:
+
+Configuration file format
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The configuration file format understood by :func:`fileConfig` is based on
+:mod:`configparser` functionality. The file must contain sections called
+``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the
+entities of each type which are defined in the file. For each such entity, there
+is a separate section which identifies how that entity is configured. Thus, for
+a logger named ``log01`` in the ``[loggers]`` section, the relevant
+configuration details are held in a section ``[logger_log01]``. Similarly, a
+handler called ``hand01`` in the ``[handlers]`` section will have its
+configuration held in a section called ``[handler_hand01]``, while a formatter
+called ``form01`` in the ``[formatters]`` section will have its configuration
+specified in a section called ``[formatter_form01]``. The root logger
+configuration must be specified in a section called ``[logger_root]``.
+
+Examples of these sections in the file are given below. ::
+
+ [loggers]
+ keys=root,log02,log03,log04,log05,log06,log07
+
+ [handlers]
+ keys=hand01,hand02,hand03,hand04,hand05,hand06,hand07,hand08,hand09
+
+ [formatters]
+ keys=form01,form02,form03,form04,form05,form06,form07,form08,form09
+
+The root logger must specify a level and a list of handlers. An example of a
+root logger section is given below. ::
+
+ [logger_root]
+ level=NOTSET
+ handlers=hand01
+
+The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` or
+``NOTSET``. For the root logger only, ``NOTSET`` means that all messages will be
+logged. Level values are :func:`eval`\ uated in the context of the ``logging``
+package's namespace.
+
+The ``handlers`` entry is a comma-separated list of handler names, which must
+appear in the ``[handlers]`` section. These names must appear in the
+``[handlers]`` section and have corresponding sections in the configuration
+file.
+
+For loggers other than the root logger, some additional information is required.
+This is illustrated by the following example. ::
+
+ [logger_parser]
+ level=DEBUG
+ handlers=hand01
+ propagate=1
+ qualname=compiler.parser
+
+The ``level`` and ``handlers`` entries are interpreted as for the root logger,
+except that if a non-root logger's level is specified as ``NOTSET``, the system
+consults loggers higher up the hierarchy to determine the effective level of the
+logger. The ``propagate`` entry is set to 1 to indicate that messages must
+propagate to handlers higher up the logger hierarchy from this logger, or 0 to
+indicate that messages are **not** propagated to handlers up the hierarchy. The
+``qualname`` entry is the hierarchical channel name of the logger, that is to
+say the name used by the application to get the logger.
+
+Sections which specify handler configuration are exemplified by the following.
+::
+
+ [handler_hand01]
+ class=StreamHandler
+ level=NOTSET
+ formatter=form01
+ args=(sys.stdout,)
+
+The ``class`` entry indicates the handler's class (as determined by :func:`eval`
+in the ``logging`` package's namespace). The ``level`` is interpreted as for
+loggers, and ``NOTSET`` is taken to mean 'log everything'.
+
+The ``formatter`` entry indicates the key name of the formatter for this
+handler. If blank, a default formatter (``logging._defaultFormatter``) is used.
+If a name is specified, it must appear in the ``[formatters]`` section and have
+a corresponding section in the configuration file.
+
+The ``args`` entry, when :func:`eval`\ uated in the context of the ``logging``
+package's namespace, is the list of arguments to the constructor for the handler
+class. Refer to the constructors for the relevant handlers, or to the examples
+below, to see how typical entries are constructed. ::
+
+ [handler_hand02]
+ class=FileHandler
+ level=DEBUG
+ formatter=form02
+ args=('python.log', 'w')
+
+ [handler_hand03]
+ class=handlers.SocketHandler
+ level=INFO
+ formatter=form03
+ args=('localhost', handlers.DEFAULT_TCP_LOGGING_PORT)
+
+ [handler_hand04]
+ class=handlers.DatagramHandler
+ level=WARN
+ formatter=form04
+ args=('localhost', handlers.DEFAULT_UDP_LOGGING_PORT)
+
+ [handler_hand05]
+ class=handlers.SysLogHandler
+ level=ERROR
+ formatter=form05
+ args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER)
+
+ [handler_hand06]
+ class=handlers.NTEventLogHandler
+ level=CRITICAL
+ formatter=form06
+ args=('Python Application', '', 'Application')
+
+ [handler_hand07]
+ class=handlers.SMTPHandler
+ level=WARN
+ formatter=form07
+ args=('localhost', 'from@abc', ['user1@abc', 'user2@xyz'], 'Logger Subject')
+
+ [handler_hand08]
+ class=handlers.MemoryHandler
+ level=NOTSET
+ formatter=form08
+ target=
+ args=(10, ERROR)
+
+ [handler_hand09]
+ class=handlers.HTTPHandler
+ level=NOTSET
+ formatter=form09
+ args=('localhost:9022', '/log', 'GET')
+
+Sections which specify formatter configuration are typified by the following. ::
+
+ [formatter_form01]
+ format=F1 %(asctime)s %(levelname)s %(message)s
+ datefmt=
+ class=logging.Formatter
+
+The ``format`` entry is the overall format string, and the ``datefmt`` entry is
+the :func:`strftime`\ -compatible date/time format string. If empty, the
+package substitutes ISO8601 format date/times, which is almost equivalent to
+specifying the date format string ``'%Y-%m-%d %H:%M:%S'``. The ISO8601 format
+also specifies milliseconds, which are appended to the result of using the above
+format string, with a comma separator. An example time in ISO8601 format is
+``2003-01-23 00:29:50,411``.
+
+The ``class`` entry is optional. It indicates the name of the formatter's class
+(as a dotted module and class name.) This option is useful for instantiating a
+:class:`Formatter` subclass. Subclasses of :class:`Formatter` can present
+exception tracebacks in an expanded or condensed format.
+
+.. seealso::
+
+ Module :mod:`logging`
+ API reference for the logging module.
+
+ Module :mod:`logging.handlers`
+ Useful handlers included with the logging module.
+
+
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst
new file mode 100644
index 0000000000..eda93023d8
--- /dev/null
+++ b/Doc/library/logging.handlers.rst
@@ -0,0 +1,850 @@
+:mod:`logging.handlers` --- Logging handlers
+============================================
+
+.. module:: logging.handlers
+ :synopsis: Handlers for the logging module.
+
+
+.. moduleauthor:: Vinay Sajip <vinay_sajip@red-dove.com>
+.. sectionauthor:: Vinay Sajip <vinay_sajip@red-dove.com>
+
+.. sidebar:: Important
+
+ This page contains only reference information. For tutorials,
+ please see
+
+ * :ref:`Basic Tutorial <logging-basic-tutorial>`
+ * :ref:`Advanced Tutorial <logging-advanced-tutorial>`
+ * :ref:`Logging Cookbook <logging-cookbook>`
+
+.. currentmodule:: logging
+
+The following useful handlers are provided in the package. Note that three of
+the handlers (:class:`StreamHandler`, :class:`FileHandler` and
+:class:`NullHandler`) are actually defined in the :mod:`logging` module itself,
+but have been documented here along with the other handlers.
+
+.. _stream-handler:
+
+StreamHandler
+^^^^^^^^^^^^^
+
+The :class:`StreamHandler` class, located in the core :mod:`logging` package,
+sends logging output to streams such as *sys.stdout*, *sys.stderr* or any
+file-like object (or, more precisely, any object which supports :meth:`write`
+and :meth:`flush` methods).
+
+
+.. class:: StreamHandler(stream=None)
+
+ Returns a new instance of the :class:`StreamHandler` class. If *stream* is
+ specified, the instance will use it for logging output; otherwise, *sys.stderr*
+ will be used.
+
+
+ .. method:: emit(record)
+
+ If a formatter is specified, it is used to format the record. The record
+ is then written to the stream with a terminator. If exception information
+ is present, it is formatted using :func:`traceback.print_exception` and
+ appended to the stream.
+
+
+ .. method:: flush()
+
+ Flushes the stream by calling its :meth:`flush` method. Note that the
+ :meth:`close` method is inherited from :class:`Handler` and so does
+ no output, so an explicit :meth:`flush` call may be needed at times.
+
+.. versionchanged:: 3.2
+ The ``StreamHandler`` class now has a ``terminator`` attribute, default
+ value ``'\n'``, which is used as the terminator when writing a formatted
+ record to a stream. If you don't want this newline termination, you can
+ set the handler instance's ``terminator`` attribute to the empty string.
+ In earlier versions, the terminator was hardcoded as ``'\n'``.
+
+.. _file-handler:
+
+FileHandler
+^^^^^^^^^^^
+
+The :class:`FileHandler` class, located in the core :mod:`logging` package,
+sends logging output to a disk file. It inherits the output functionality from
+:class:`StreamHandler`.
+
+
+.. class:: FileHandler(filename, mode='a', encoding=None, delay=False)
+
+ Returns a new instance of the :class:`FileHandler` class. The specified file is
+ opened and used as the stream for logging. If *mode* is not specified,
+ :const:`'a'` is used. If *encoding* is not *None*, it is used to open the file
+ with that encoding. If *delay* is true, then file opening is deferred until the
+ first call to :meth:`emit`. By default, the file grows indefinitely.
+
+
+ .. method:: close()
+
+ Closes the file.
+
+
+ .. method:: emit(record)
+
+ Outputs the record to the file.
+
+
+.. _null-handler:
+
+NullHandler
+^^^^^^^^^^^
+
+.. versionadded:: 3.1
+
+The :class:`NullHandler` class, located in the core :mod:`logging` package,
+does not do any formatting or output. It is essentially a 'no-op' handler
+for use by library developers.
+
+.. class:: NullHandler()
+
+ Returns a new instance of the :class:`NullHandler` class.
+
+ .. method:: emit(record)
+
+ This method does nothing.
+
+ .. method:: handle(record)
+
+ This method does nothing.
+
+ .. method:: createLock()
+
+ This method returns ``None`` for the lock, since there is no
+ underlying I/O to which access needs to be serialized.
+
+
+See :ref:`library-config` for more information on how to use
+:class:`NullHandler`.
+
+.. _watched-file-handler:
+
+WatchedFileHandler
+^^^^^^^^^^^^^^^^^^
+
+.. currentmodule:: logging.handlers
+
+The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
+module, is a :class:`FileHandler` which watches the file it is logging to. If
+the file changes, it is closed and reopened using the file name.
+
+A file change can happen because of usage of programs such as *newsyslog* and
+*logrotate* which perform log file rotation. This handler, intended for use
+under Unix/Linux, watches the file to see if it has changed since the last emit.
+(A file is deemed to have changed if its device or inode have changed.) If the
+file has changed, the old file stream is closed, and the file opened to get a
+new stream.
+
+This handler is not appropriate for use under Windows, because under Windows
+open log files cannot be moved or renamed - logging opens the files with
+exclusive locks - and so there is no need for such a handler. Furthermore,
+*ST_INO* is not supported under Windows; :func:`stat` always returns zero for
+this value.
+
+
+.. class:: WatchedFileHandler(filename[,mode[, encoding[, delay]]])
+
+ Returns a new instance of the :class:`WatchedFileHandler` class. The specified
+ file is opened and used as the stream for logging. If *mode* is not specified,
+ :const:`'a'` is used. If *encoding* is not *None*, it is used to open the file
+ with that encoding. If *delay* is true, then file opening is deferred until the
+ first call to :meth:`emit`. By default, the file grows indefinitely.
+
+
+ .. method:: emit(record)
+
+ Outputs the record to the file, but first checks to see if the file has
+ changed. If it has, the existing stream is flushed and closed and the
+ file opened again, before outputting the record to the file.
+
+.. _rotating-file-handler:
+
+RotatingFileHandler
+^^^^^^^^^^^^^^^^^^^
+
+The :class:`RotatingFileHandler` class, located in the :mod:`logging.handlers`
+module, supports rotation of disk log files.
+
+
+.. class:: RotatingFileHandler(filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=0)
+
+ Returns a new instance of the :class:`RotatingFileHandler` class. The specified
+ file is opened and used as the stream for logging. If *mode* is not specified,
+ ``'a'`` is used. If *encoding* is not *None*, it is used to open the file
+ with that encoding. If *delay* is true, then file opening is deferred until the
+ first call to :meth:`emit`. By default, the file grows indefinitely.
+
+ You can use the *maxBytes* and *backupCount* values to allow the file to
+ :dfn:`rollover` at a predetermined size. When the size is about to be exceeded,
+ the file is closed and a new file is silently opened for output. Rollover occurs
+ whenever the current log file is nearly *maxBytes* in length; if *maxBytes* is
+ zero, rollover never occurs. If *backupCount* is non-zero, the system will save
+ old log files by appending the extensions '.1', '.2' etc., to the filename. For
+ example, with a *backupCount* of 5 and a base file name of :file:`app.log`, you
+ would get :file:`app.log`, :file:`app.log.1`, :file:`app.log.2`, up to
+ :file:`app.log.5`. The file being written to is always :file:`app.log`. When
+ this file is filled, it is closed and renamed to :file:`app.log.1`, and if files
+ :file:`app.log.1`, :file:`app.log.2`, etc. exist, then they are renamed to
+ :file:`app.log.2`, :file:`app.log.3` etc. respectively.
+
+
+ .. method:: doRollover()
+
+ Does a rollover, as described above.
+
+
+ .. method:: emit(record)
+
+ Outputs the record to the file, catering for rollover as described
+ previously.
+
+.. _timed-rotating-file-handler:
+
+TimedRotatingFileHandler
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+The :class:`TimedRotatingFileHandler` class, located in the
+:mod:`logging.handlers` module, supports rotation of disk log files at certain
+timed intervals.
+
+
+.. class:: TimedRotatingFileHandler(filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False)
+
+ Returns a new instance of the :class:`TimedRotatingFileHandler` class. The
+ specified file is opened and used as the stream for logging. On rotating it also
+ sets the filename suffix. Rotating happens based on the product of *when* and
+ *interval*.
+
+ You can use the *when* to specify the type of *interval*. The list of possible
+ values is below. Note that they are not case sensitive.
+
+ +----------------+-----------------------+
+ | Value | Type of interval |
+ +================+=======================+
+ | ``'S'`` | Seconds |
+ +----------------+-----------------------+
+ | ``'M'`` | Minutes |
+ +----------------+-----------------------+
+ | ``'H'`` | Hours |
+ +----------------+-----------------------+
+ | ``'D'`` | Days |
+ +----------------+-----------------------+
+ | ``'W'`` | Week day (0=Monday) |
+ +----------------+-----------------------+
+ | ``'midnight'`` | Roll over at midnight |
+ +----------------+-----------------------+
+
+ The system will save old log files by appending extensions to the filename.
+ The extensions are date-and-time based, using the strftime format
+ ``%Y-%m-%d_%H-%M-%S`` or a leading portion thereof, depending on the
+ rollover interval.
+
+ When computing the next rollover time for the first time (when the handler
+ is created), the last modification time of an existing log file, or else
+ the current time, is used to compute when the next rotation will occur.
+
+ If the *utc* argument is true, times in UTC will be used; otherwise
+ local time is used.
+
+ If *backupCount* is nonzero, at most *backupCount* files
+ will be kept, and if more would be created when rollover occurs, the oldest
+ one is deleted. The deletion logic uses the interval to determine which
+ files to delete, so changing the interval may leave old files lying around.
+
+ If *delay* is true, then file opening is deferred until the first call to
+ :meth:`emit`.
+
+
+ .. method:: doRollover()
+
+ Does a rollover, as described above.
+
+
+ .. method:: emit(record)
+
+ Outputs the record to the file, catering for rollover as described above.
+
+
+.. _socket-handler:
+
+SocketHandler
+^^^^^^^^^^^^^
+
+The :class:`SocketHandler` class, located in the :mod:`logging.handlers` module,
+sends logging output to a network socket. The base class uses a TCP socket.
+
+
+.. class:: SocketHandler(host, port)
+
+ Returns a new instance of the :class:`SocketHandler` class intended to
+ communicate with a remote machine whose address is given by *host* and *port*.
+
+
+ .. method:: close()
+
+ Closes the socket.
+
+
+ .. method:: emit()
+
+ Pickles the record's attribute dictionary and writes it to the socket in
+ binary format. If there is an error with the socket, silently drops the
+ packet. If the connection was previously lost, re-establishes the
+ connection. To unpickle the record at the receiving end into a
+ :class:`LogRecord`, use the :func:`makeLogRecord` function.
+
+
+ .. method:: handleError()
+
+ Handles an error which has occurred during :meth:`emit`. The most likely
+ cause is a lost connection. Closes the socket so that we can retry on the
+ next event.
+
+
+ .. method:: makeSocket()
+
+ This is a factory method which allows subclasses to define the precise
+ type of socket they want. The default implementation creates a TCP socket
+ (:const:`socket.SOCK_STREAM`).
+
+
+ .. method:: makePickle(record)
+
+ Pickles the record's attribute dictionary in binary format with a length
+ prefix, and returns it ready for transmission across the socket.
+
+ Note that pickles aren't completely secure. If you are concerned about
+ security, you may want to override this method to implement a more secure
+ mechanism. For example, you can sign pickles using HMAC and then verify
+ them on the receiving end, or alternatively you can disable unpickling of
+ global objects on the receiving end.
+
+
+ .. method:: send(packet)
+
+ Send a pickled string *packet* to the socket. This function allows for
+ partial sends which can happen when the network is busy.
+
+
+ .. method:: createSocket()
+
+ Tries to create a socket; on failure, uses an exponential back-off
+ algorithm. On intial failure, the handler will drop the message it was
+ trying to send. When subsequent messages are handled by the same
+ instance, it will not try connecting until some time has passed. The
+ default parameters are such that the initial delay is one second, and if
+ after that delay the connection still can't be made, the handler will
+ double the delay each time up to a maximum of 30 seconds.
+
+ This behaviour is controlled by the following handler attributes:
+
+ * ``retryStart`` (initial delay, defaulting to 1.0 seconds).
+ * ``retryFactor`` (multiplier, defaulting to 2.0).
+ * ``retryMax`` (maximum delay, defaulting to 30.0 seconds).
+
+ This means that if the remote listener starts up *after* the handler has
+ been used, you could lose messages (since the handler won't even attempt
+ a connection until the delay has elapsed, but just silently drop messages
+ during the delay period).
+
+
+.. _datagram-handler:
+
+DatagramHandler
+^^^^^^^^^^^^^^^
+
+The :class:`DatagramHandler` class, located in the :mod:`logging.handlers`
+module, inherits from :class:`SocketHandler` to support sending logging messages
+over UDP sockets.
+
+
+.. class:: DatagramHandler(host, port)
+
+ Returns a new instance of the :class:`DatagramHandler` class intended to
+ communicate with a remote machine whose address is given by *host* and *port*.
+
+
+ .. method:: emit()
+
+ Pickles the record's attribute dictionary and writes it to the socket in
+ binary format. If there is an error with the socket, silently drops the
+ packet. To unpickle the record at the receiving end into a
+ :class:`LogRecord`, use the :func:`makeLogRecord` function.
+
+
+ .. method:: makeSocket()
+
+ The factory method of :class:`SocketHandler` is here overridden to create
+ a UDP socket (:const:`socket.SOCK_DGRAM`).
+
+
+ .. method:: send(s)
+
+ Send a pickled string to a socket.
+
+
+.. _syslog-handler:
+
+SysLogHandler
+^^^^^^^^^^^^^
+
+The :class:`SysLogHandler` class, located in the :mod:`logging.handlers` module,
+supports sending logging messages to a remote or local Unix syslog.
+
+
+.. class:: SysLogHandler(address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER, socktype=socket.SOCK_DGRAM)
+
+ Returns a new instance of the :class:`SysLogHandler` class intended to
+ communicate with a remote Unix machine whose address is given by *address* in
+ the form of a ``(host, port)`` tuple. If *address* is not specified,
+ ``('localhost', 514)`` is used. The address is used to open a socket. An
+ alternative to providing a ``(host, port)`` tuple is providing an address as a
+ string, for example '/dev/log'. In this case, a Unix domain socket is used to
+ send the message to the syslog. If *facility* is not specified,
+ :const:`LOG_USER` is used. The type of socket opened depends on the
+ *socktype* argument, which defaults to :const:`socket.SOCK_DGRAM` and thus
+ opens a UDP socket. To open a TCP socket (for use with the newer syslog
+ daemons such as rsyslog), specify a value of :const:`socket.SOCK_STREAM`.
+
+ Note that if your server is not listening on UDP port 514,
+ :class:`SysLogHandler` may appear not to work. In that case, check what
+ address you should be using for a domain socket - it's system dependent.
+ For example, on Linux it's usually '/dev/log' but on OS/X it's
+ '/var/run/syslog'. You'll need to check your platform and use the
+ appropriate address (you may need to do this check at runtime if your
+ application needs to run on several platforms). On Windows, you pretty
+ much have to use the UDP option.
+
+ .. versionchanged:: 3.2
+ *socktype* was added.
+
+
+ .. method:: close()
+
+ Closes the socket to the remote host.
+
+
+ .. method:: emit(record)
+
+ The record is formatted, and then sent to the syslog server. If exception
+ information is present, it is *not* sent to the server.
+
+
+ .. method:: encodePriority(facility, priority)
+
+ Encodes the facility and priority into an integer. You can pass in strings
+ or integers - if strings are passed, internal mapping dictionaries are
+ used to convert them to integers.
+
+ The symbolic ``LOG_`` values are defined in :class:`SysLogHandler` and
+ mirror the values defined in the ``sys/syslog.h`` header file.
+
+ **Priorities**
+
+ +--------------------------+---------------+
+ | Name (string) | Symbolic value|
+ +==========================+===============+
+ | ``alert`` | LOG_ALERT |
+ +--------------------------+---------------+
+ | ``crit`` or ``critical`` | LOG_CRIT |
+ +--------------------------+---------------+
+ | ``debug`` | LOG_DEBUG |
+ +--------------------------+---------------+
+ | ``emerg`` or ``panic`` | LOG_EMERG |
+ +--------------------------+---------------+
+ | ``err`` or ``error`` | LOG_ERR |
+ +--------------------------+---------------+
+ | ``info`` | LOG_INFO |
+ +--------------------------+---------------+
+ | ``notice`` | LOG_NOTICE |
+ +--------------------------+---------------+
+ | ``warn`` or ``warning`` | LOG_WARNING |
+ +--------------------------+---------------+
+
+ **Facilities**
+
+ +---------------+---------------+
+ | Name (string) | Symbolic value|
+ +===============+===============+
+ | ``auth`` | LOG_AUTH |
+ +---------------+---------------+
+ | ``authpriv`` | LOG_AUTHPRIV |
+ +---------------+---------------+
+ | ``cron`` | LOG_CRON |
+ +---------------+---------------+
+ | ``daemon`` | LOG_DAEMON |
+ +---------------+---------------+
+ | ``ftp`` | LOG_FTP |
+ +---------------+---------------+
+ | ``kern`` | LOG_KERN |
+ +---------------+---------------+
+ | ``lpr`` | LOG_LPR |
+ +---------------+---------------+
+ | ``mail`` | LOG_MAIL |
+ +---------------+---------------+
+ | ``news`` | LOG_NEWS |
+ +---------------+---------------+
+ | ``syslog`` | LOG_SYSLOG |
+ +---------------+---------------+
+ | ``user`` | LOG_USER |
+ +---------------+---------------+
+ | ``uucp`` | LOG_UUCP |
+ +---------------+---------------+
+ | ``local0`` | LOG_LOCAL0 |
+ +---------------+---------------+
+ | ``local1`` | LOG_LOCAL1 |
+ +---------------+---------------+
+ | ``local2`` | LOG_LOCAL2 |
+ +---------------+---------------+
+ | ``local3`` | LOG_LOCAL3 |
+ +---------------+---------------+
+ | ``local4`` | LOG_LOCAL4 |
+ +---------------+---------------+
+ | ``local5`` | LOG_LOCAL5 |
+ +---------------+---------------+
+ | ``local6`` | LOG_LOCAL6 |
+ +---------------+---------------+
+ | ``local7`` | LOG_LOCAL7 |
+ +---------------+---------------+
+
+ .. method:: mapPriority(levelname)
+
+ Maps a logging level name to a syslog priority name.
+ You may need to override this if you are using custom levels, or
+ if the default algorithm is not suitable for your needs. The
+ default algorithm maps ``DEBUG``, ``INFO``, ``WARNING``, ``ERROR`` and
+ ``CRITICAL`` to the equivalent syslog names, and all other level
+ names to 'warning'.
+
+.. _nt-eventlog-handler:
+
+NTEventLogHandler
+^^^^^^^^^^^^^^^^^
+
+The :class:`NTEventLogHandler` class, located in the :mod:`logging.handlers`
+module, supports sending logging messages to a local Windows NT, Windows 2000 or
+Windows XP event log. Before you can use it, you need Mark Hammond's Win32
+extensions for Python installed.
+
+
+.. class:: NTEventLogHandler(appname, dllname=None, logtype='Application')
+
+ Returns a new instance of the :class:`NTEventLogHandler` class. The *appname* is
+ used to define the application name as it appears in the event log. An
+ appropriate registry entry is created using this name. The *dllname* should give
+ the fully qualified pathname of a .dll or .exe which contains message
+ definitions to hold in the log (if not specified, ``'win32service.pyd'`` is used
+ - this is installed with the Win32 extensions and contains some basic
+ placeholder message definitions. Note that use of these placeholders will make
+ your event logs big, as the entire message source is held in the log. If you
+ want slimmer logs, you have to pass in the name of your own .dll or .exe which
+ contains the message definitions you want to use in the event log). The
+ *logtype* is one of ``'Application'``, ``'System'`` or ``'Security'``, and
+ defaults to ``'Application'``.
+
+
+ .. method:: close()
+
+ At this point, you can remove the application name from the registry as a
+ source of event log entries. However, if you do this, you will not be able
+ to see the events as you intended in the Event Log Viewer - it needs to be
+ able to access the registry to get the .dll name. The current version does
+ not do this.
+
+
+ .. method:: emit(record)
+
+ Determines the message ID, event category and event type, and then logs
+ the message in the NT event log.
+
+
+ .. method:: getEventCategory(record)
+
+ Returns the event category for the record. Override this if you want to
+ specify your own categories. This version returns 0.
+
+
+ .. method:: getEventType(record)
+
+ Returns the event type for the record. Override this if you want to
+ specify your own types. This version does a mapping using the handler's
+ typemap attribute, which is set up in :meth:`__init__` to a dictionary
+ which contains mappings for :const:`DEBUG`, :const:`INFO`,
+ :const:`WARNING`, :const:`ERROR` and :const:`CRITICAL`. If you are using
+ your own levels, you will either need to override this method or place a
+ suitable dictionary in the handler's *typemap* attribute.
+
+
+ .. method:: getMessageID(record)
+
+ Returns the message ID for the record. If you are using your own messages,
+ you could do this by having the *msg* passed to the logger being an ID
+ rather than a format string. Then, in here, you could use a dictionary
+ lookup to get the message ID. This version returns 1, which is the base
+ message ID in :file:`win32service.pyd`.
+
+.. _smtp-handler:
+
+SMTPHandler
+^^^^^^^^^^^
+
+The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` module,
+supports sending logging messages to an email address via SMTP.
+
+
+.. class:: SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None)
+
+ Returns a new instance of the :class:`SMTPHandler` class. The instance is
+ initialized with the from and to addresses and subject line of the email. The
+ *toaddrs* should be a list of strings. To specify a non-standard SMTP port, use
+ the (host, port) tuple format for the *mailhost* argument. If you use a string,
+ the standard SMTP port is used. If your SMTP server requires authentication, you
+ can specify a (username, password) tuple for the *credentials* argument.
+
+
+ .. method:: emit(record)
+
+ Formats the record and sends it to the specified addressees.
+
+
+ .. method:: getSubject(record)
+
+ If you want to specify a subject line which is record-dependent, override
+ this method.
+
+.. _memory-handler:
+
+MemoryHandler
+^^^^^^^^^^^^^
+
+The :class:`MemoryHandler` class, located in the :mod:`logging.handlers` module,
+supports buffering of logging records in memory, periodically flushing them to a
+:dfn:`target` handler. Flushing occurs whenever the buffer is full, or when an
+event of a certain severity or greater is seen.
+
+:class:`MemoryHandler` is a subclass of the more general
+:class:`BufferingHandler`, which is an abstract class. This buffers logging
+records in memory. Whenever each record is added to the buffer, a check is made
+by calling :meth:`shouldFlush` to see if the buffer should be flushed. If it
+should, then :meth:`flush` is expected to do the needful.
+
+
+.. class:: BufferingHandler(capacity)
+
+ Initializes the handler with a buffer of the specified capacity.
+
+
+ .. method:: emit(record)
+
+ Appends the record to the buffer. If :meth:`shouldFlush` returns true,
+ calls :meth:`flush` to process the buffer.
+
+
+ .. method:: flush()
+
+ You can override this to implement custom flushing behavior. This version
+ just zaps the buffer to empty.
+
+
+ .. method:: shouldFlush(record)
+
+ Returns true if the buffer is up to capacity. This method can be
+ overridden to implement custom flushing strategies.
+
+
+.. class:: MemoryHandler(capacity, flushLevel=ERROR, target=None)
+
+ Returns a new instance of the :class:`MemoryHandler` class. The instance is
+ initialized with a buffer size of *capacity*. If *flushLevel* is not specified,
+ :const:`ERROR` is used. If no *target* is specified, the target will need to be
+ set using :meth:`setTarget` before this handler does anything useful.
+
+
+ .. method:: close()
+
+ Calls :meth:`flush`, sets the target to :const:`None` and clears the
+ buffer.
+
+
+ .. method:: flush()
+
+ For a :class:`MemoryHandler`, flushing means just sending the buffered
+ records to the target, if there is one. The buffer is also cleared when
+ this happens. Override if you want different behavior.
+
+
+ .. method:: setTarget(target)
+
+ Sets the target handler for this handler.
+
+
+ .. method:: shouldFlush(record)
+
+ Checks for buffer full or a record at the *flushLevel* or higher.
+
+
+.. _http-handler:
+
+HTTPHandler
+^^^^^^^^^^^
+
+The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` module,
+supports sending logging messages to a Web server, using either ``GET`` or
+``POST`` semantics.
+
+
+.. class:: HTTPHandler(host, url, method='GET', secure=False, credentials=None)
+
+ Returns a new instance of the :class:`HTTPHandler` class. The *host* can be
+ of the form ``host:port``, should you need to use a specific port number.
+ If no *method* is specified, ``GET`` is used. If *secure* is True, an HTTPS
+ connection will be used. If *credentials* is specified, it should be a
+ 2-tuple consisting of userid and password, which will be placed in an HTTP
+ 'Authorization' header using Basic authentication. If you specify
+ credentials, you should also specify secure=True so that your userid and
+ password are not passed in cleartext across the wire.
+
+
+ .. method:: emit(record)
+
+ Sends the record to the Web server as a percent-encoded dictionary.
+
+
+.. _queue-handler:
+
+
+QueueHandler
+^^^^^^^^^^^^
+
+.. versionadded:: 3.2
+
+The :class:`QueueHandler` class, located in the :mod:`logging.handlers` module,
+supports sending logging messages to a queue, such as those implemented in the
+:mod:`queue` or :mod:`multiprocessing` modules.
+
+Along with the :class:`QueueListener` class, :class:`QueueHandler` can be used
+to let handlers do their work on a separate thread from the one which does the
+logging. This is important in Web applications and also other service
+applications where threads servicing clients need to respond as quickly as
+possible, while any potentially slow operations (such as sending an email via
+:class:`SMTPHandler`) are done on a separate thread.
+
+.. class:: QueueHandler(queue)
+
+ Returns a new instance of the :class:`QueueHandler` class. The instance is
+ initialized with the queue to send messages to. The queue can be any queue-
+ like object; it's used as-is by the :meth:`enqueue` method, which needs
+ to know how to send messages to it.
+
+
+ .. method:: emit(record)
+
+ Enqueues the result of preparing the LogRecord.
+
+ .. method:: prepare(record)
+
+ Prepares a record for queuing. The object returned by this
+ method is enqueued.
+
+ The base implementation formats the record to merge the message
+ and arguments, and removes unpickleable items from the record
+ in-place.
+
+ You might want to override this method if you want to convert
+ the record to a dict or JSON string, or send a modified copy
+ of the record while leaving the original intact.
+
+ .. method:: enqueue(record)
+
+ Enqueues the record on the queue using ``put_nowait()``; you may
+ want to override this if you want to use blocking behaviour, or a
+ timeout, or a customised queue implementation.
+
+
+
+.. queue-listener:
+
+QueueListener
+^^^^^^^^^^^^^
+
+.. versionadded:: 3.2
+
+The :class:`QueueListener` class, located in the :mod:`logging.handlers`
+module, supports receiving logging messages from a queue, such as those
+implemented in the :mod:`queue` or :mod:`multiprocessing` modules. The
+messages are received from a queue in an internal thread and passed, on
+the same thread, to one or more handlers for processing. While
+:class:`QueueListener` is not itself a handler, it is documented here
+because it works hand-in-hand with :class:`QueueHandler`.
+
+Along with the :class:`QueueHandler` class, :class:`QueueListener` can be used
+to let handlers do their work on a separate thread from the one which does the
+logging. This is important in Web applications and also other service
+applications where threads servicing clients need to respond as quickly as
+possible, while any potentially slow operations (such as sending an email via
+:class:`SMTPHandler`) are done on a separate thread.
+
+.. class:: QueueListener(queue, *handlers)
+
+ Returns a new instance of the :class:`QueueListener` class. The instance is
+ initialized with the queue to send messages to and a list of handlers which
+ will handle entries placed on the queue. The queue can be any queue-
+ like object; it's passed as-is to the :meth:`dequeue` method, which needs
+ to know how to get messages from it.
+
+ .. method:: dequeue(block)
+
+ Dequeues a record and return it, optionally blocking.
+
+ The base implementation uses ``get()``. You may want to override this
+ method if you want to use timeouts or work with custom queue
+ implementations.
+
+ .. method:: prepare(record)
+
+ Prepare a record for handling.
+
+ This implementation just returns the passed-in record. You may want to
+ override this method if you need to do any custom marshalling or
+ manipulation of the record before passing it to the handlers.
+
+ .. method:: handle(record)
+
+ Handle a record.
+
+ This just loops through the handlers offering them the record
+ to handle. The actual object passed to the handlers is that which
+ is returned from :meth:`prepare`.
+
+ .. method:: start()
+
+ Starts the listener.
+
+ This starts up a background thread to monitor the queue for
+ LogRecords to process.
+
+ .. method:: stop()
+
+ Stops the listener.
+
+ This asks the thread to terminate, and then waits for it to do so.
+ Note that if you don't call this before your application exits, there
+ may be some records still left on the queue, which won't be processed.
+
+
+.. seealso::
+
+ Module :mod:`logging`
+ API reference for the logging module.
+
+ Module :mod:`logging.config`
+ Configuration API for the logging module.
+
+
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 46b643f8e9..32f762d506 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -2,7 +2,7 @@
==============================================
.. module:: logging
- :synopsis: Flexible error logging system for applications.
+ :synopsis: Flexible event logging system for applications.
.. moduleauthor:: Vinay Sajip <vinay_sajip@red-dove.com>
@@ -11,833 +11,38 @@
.. index:: pair: Errors; logging
-This module defines functions and classes which implement a flexible error
-logging system for applications.
+.. sidebar:: Important
-Logging is performed by calling methods on instances of the :class:`Logger`
-class (hereafter called :dfn:`loggers`). Each instance has a name, and they are
-conceptually arranged in a namespace hierarchy using dots (periods) as
-separators. For example, a logger named "scan" is the parent of loggers
-"scan.text", "scan.html" and "scan.pdf". Logger names can be anything you want,
-and indicate the area of an application in which a logged message originates.
+ This page contains the API reference information. For tutorial
+ information and discussion of more advanced topics, see
-Logged messages also have levels of importance associated with them. The default
-levels provided are :const:`DEBUG`, :const:`INFO`, :const:`WARNING`,
-:const:`ERROR` and :const:`CRITICAL`. As a convenience, you indicate the
-importance of a logged message by calling an appropriate method of
-:class:`Logger`. The methods are :meth:`debug`, :meth:`info`, :meth:`warning`,
-:meth:`error` and :meth:`critical`, which mirror the default levels. You are not
-constrained to use these levels: you can specify your own and use a more general
-:class:`Logger` method, :meth:`log`, which takes an explicit level argument.
+ * :ref:`Basic Tutorial <logging-basic-tutorial>`
+ * :ref:`Advanced Tutorial <logging-advanced-tutorial>`
+ * :ref:`Logging Cookbook <logging-cookbook>`
-Logging tutorial
-----------------
+This module defines functions and classes which implement a flexible event
+logging system for applications and libraries.
The key benefit of having the logging API provided by a standard library module
is that all Python modules can participate in logging, so your application log
-can include messages from third-party modules.
+can include your own messages integrated with messages from third-party
+modules.
-It is, of course, possible to log messages with different verbosity levels or to
-different destinations. Support for writing log messages to files, HTTP
-GET/POST locations, email via SMTP, generic sockets, or OS-specific logging
-mechanisms are all supported by the standard module. You can also create your
-own log destination class if you have special requirements not met by any of the
-built-in classes.
+The module provides a lot of functionality and flexibility. If you are
+unfamiliar with logging, the best way to get to grips with it is to see the
+tutorials (see the links on the right).
-Simple examples
-^^^^^^^^^^^^^^^
-
-.. sectionauthor:: Doug Hellmann
-.. (see <http://blog.doughellmann.com/2007/05/pymotw-logging.html>)
+The basic classes defined by the module, together with their functions, are
+listed below.
-Most applications are probably going to want to log to a file, so let's start
-with that case. Using the :func:`basicConfig` function, we can set up the
-default handler so that debug messages are written to a file (in the example,
-we assume that you have the appropriate permissions to create a file called
-*example.log* in the current directory)::
-
- import logging
- LOG_FILENAME = 'example.log'
- logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
-
- logging.debug('This message should go to the log file')
-
-And now if we open the file and look at what we have, we should find the log
-message::
-
- DEBUG:root:This message should go to the log file
-
-If you run the script repeatedly, the additional log messages are appended to
-the file. To create a new file each time, you can pass a *filemode* argument to
-:func:`basicConfig` with a value of ``'w'``. Rather than managing the file size
-yourself, though, it is simpler to use a :class:`RotatingFileHandler`::
-
- import glob
- import logging
- import logging.handlers
-
- LOG_FILENAME = 'logging_rotatingfile_example.out'
-
- # Set up a specific logger with our desired output level
- my_logger = logging.getLogger('MyLogger')
- my_logger.setLevel(logging.DEBUG)
-
- # Add the log message handler to the logger
- handler = logging.handlers.RotatingFileHandler(
- LOG_FILENAME, maxBytes=20, backupCount=5)
+* Loggers expose the interface that application code directly uses.
+* Handlers send the log records (created by loggers) to the appropriate
+ destination.
+* Filters provide a finer grained facility for determining which log records
+ to output.
+* Formatters specify the layout of log records in the final output.
- my_logger.addHandler(handler)
-
- # Log some messages
- for i in range(20):
- my_logger.debug('i = %d' % i)
-
- # See what files are created
- logfiles = glob.glob('%s*' % LOG_FILENAME)
-
- for filename in logfiles:
- print(filename)
-
-The result should be 6 separate files, each with part of the log history for the
-application::
-
- logging_rotatingfile_example.out
- logging_rotatingfile_example.out.1
- logging_rotatingfile_example.out.2
- logging_rotatingfile_example.out.3
- logging_rotatingfile_example.out.4
- logging_rotatingfile_example.out.5
-
-The most current file is always :file:`logging_rotatingfile_example.out`,
-and each time it reaches the size limit it is renamed with the suffix
-``.1``. Each of the existing backup files is renamed to increment the suffix
-(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased.
-
-Obviously this example sets the log length much much too small as an extreme
-example. You would want to set *maxBytes* to an appropriate value.
-
-Another useful feature of the logging API is the ability to produce different
-messages at different log levels. This allows you to instrument your code with
-debug messages, for example, but turning the log level down so that those debug
-messages are not written for your production system. The default levels are
-``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``NOTSET``.
-
-The logger, handler, and log message call each specify a level. The log message
-is only emitted if the handler and logger are configured to emit messages of
-that level or lower. For example, if a message is ``CRITICAL``, and the logger
-is set to ``ERROR``, the message is emitted. If a message is a ``WARNING``, and
-the logger is set to produce only ``ERROR``\s, the message is not emitted::
-
- import logging
- import sys
-
- LEVELS = {'debug': logging.DEBUG,
- 'info': logging.INFO,
- 'warning': logging.WARNING,
- 'error': logging.ERROR,
- 'critical': logging.CRITICAL}
-
- if len(sys.argv) > 1:
- level_name = sys.argv[1]
- level = LEVELS.get(level_name, logging.NOTSET)
- logging.basicConfig(level=level)
-
- logging.debug('This is a debug message')
- logging.info('This is an info message')
- logging.warning('This is a warning message')
- logging.error('This is an error message')
- logging.critical('This is a critical error message')
-
-Run the script with an argument like 'debug' or 'warning' to see which messages
-show up at different levels::
-
- $ python logging_level_example.py debug
- DEBUG:root:This is a debug message
- INFO:root:This is an info message
- WARNING:root:This is a warning message
- ERROR:root:This is an error message
- CRITICAL:root:This is a critical error message
-
- $ python logging_level_example.py info
- INFO:root:This is an info message
- WARNING:root:This is a warning message
- ERROR:root:This is an error message
- CRITICAL:root:This is a critical error message
-
-You will notice that these log messages all have ``root`` embedded in them. The
-logging module supports a hierarchy of loggers with different names. An easy
-way to tell where a specific log message comes from is to use a separate logger
-object for each of your modules. Each new logger "inherits" the configuration
-of its parent, and log messages sent to a logger include the name of that
-logger. Optionally, each logger can be configured differently, so that messages
-from different modules are handled in different ways. Let's look at a simple
-example of how to log from different modules so it is easy to trace the source
-of the message::
-
- import logging
-
- logging.basicConfig(level=logging.WARNING)
-
- logger1 = logging.getLogger('package1.module1')
- logger2 = logging.getLogger('package2.module2')
-
- logger1.warning('This message comes from one module')
- logger2.warning('And this message comes from another module')
-
-And the output::
-
- $ python logging_modules_example.py
- WARNING:package1.module1:This message comes from one module
- WARNING:package2.module2:And this message comes from another module
-
-There are many more options for configuring logging, including different log
-message formatting options, having messages delivered to multiple destinations,
-and changing the configuration of a long-running application on the fly using a
-socket interface. All of these options are covered in depth in the library
-module documentation.
-
-Loggers
-^^^^^^^
-
-The logging library takes a modular approach and offers the several categories
-of components: loggers, handlers, filters, and formatters. Loggers expose the
-interface that application code directly uses. Handlers send the log records to
-the appropriate destination. Filters provide a finer grained facility for
-determining which log records to send on to a handler. Formatters specify the
-layout of the resultant log record.
-
-:class:`Logger` objects have a threefold job. First, they expose several
-methods to application code so that applications can log messages at runtime.
-Second, logger objects determine which log messages to act upon based upon
-severity (the default filtering facility) or filter objects. Third, logger
-objects pass along relevant log messages to all interested log handlers.
-
-The most widely used methods on logger objects fall into two categories:
-configuration and message sending.
-
-* :meth:`Logger.setLevel` specifies the lowest-severity log message a logger
- will handle, where debug is the lowest built-in severity level and critical is
- the highest built-in severity. For example, if the severity level is info,
- the logger will handle only info, warning, error, and critical messages and
- will ignore debug messages.
-
-* :meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove filter
- objects from the logger object. This tutorial does not address filters.
-
-With the logger object configured, the following methods create log messages:
-
-* :meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`,
- :meth:`Logger.error`, and :meth:`Logger.critical` all create log records with
- a message and a level that corresponds to their respective method names. The
- message is actually a format string, which may contain the standard string
- substitution syntax of :const:`%s`, :const:`%d`, :const:`%f`, and so on. The
- rest of their arguments is a list of objects that correspond with the
- substitution fields in the message. With regard to :const:`**kwargs`, the
- logging methods care only about a keyword of :const:`exc_info` and use it to
- determine whether to log exception information.
-
-* :meth:`Logger.exception` creates a log message similar to
- :meth:`Logger.error`. The difference is that :meth:`Logger.exception` dumps a
- stack trace along with it. Call this method only from an exception handler.
-
-* :meth:`Logger.log` takes a log level as an explicit argument. This is a
- little more verbose for logging messages than using the log level convenience
- methods listed above, but this is how to log at custom log levels.
-
-:func:`getLogger` returns a reference to a logger instance with the specified
-name if it is provided, or ``root`` if not. The names are period-separated
-hierarchical structures. Multiple calls to :func:`getLogger` with the same name
-will return a reference to the same logger object. Loggers that are further
-down in the hierarchical list are children of loggers higher up in the list.
-For example, given a logger with a name of ``foo``, loggers with names of
-``foo.bar``, ``foo.bar.baz``, and ``foo.bam`` are all descendants of ``foo``.
-Child loggers propagate messages up to the handlers associated with their
-ancestor loggers. Because of this, it is unnecessary to define and configure
-handlers for all the loggers an application uses. It is sufficient to
-configure handlers for a top-level logger and create child loggers as needed.
-
-
-Handlers
-^^^^^^^^
-
-:class:`Handler` objects are responsible for dispatching the appropriate log
-messages (based on the log messages' severity) to the handler's specified
-destination. Logger objects can add zero or more handler objects to themselves
-with an :func:`addHandler` method. As an example scenario, an application may
-want to send all log messages to a log file, all log messages of error or higher
-to stdout, and all messages of critical to an email address. This scenario
-requires three individual handlers where each handler is responsible for sending
-messages of a specific severity to a specific location.
-
-The standard library includes quite a few handler types; this tutorial uses only
-:class:`StreamHandler` and :class:`FileHandler` in its examples.
-
-There are very few methods in a handler for application developers to concern
-themselves with. The only handler methods that seem relevant for application
-developers who are using the built-in handler objects (that is, not creating
-custom handlers) are the following configuration methods:
-
-* The :meth:`Handler.setLevel` method, just as in logger objects, specifies the
- lowest severity that will be dispatched to the appropriate destination. Why
- are there two :func:`setLevel` methods? The level set in the logger
- determines which severity of messages it will pass to its handlers. The level
- set in each handler determines which messages that handler will send on.
-
-* :func:`setFormatter` selects a Formatter object for this handler to use.
-
-* :func:`addFilter` and :func:`removeFilter` respectively configure and
- deconfigure filter objects on handlers.
-
-Application code should not directly instantiate and use instances of
-:class:`Handler`. Instead, the :class:`Handler` class is a base class that
-defines the interface that all handlers should have and establishes some
-default behavior that child classes can use (or override).
-
-
-Formatters
-^^^^^^^^^^
-
-Formatter objects configure the final order, structure, and contents of the log
-message. Unlike the base :class:`logging.Handler` class, application code may
-instantiate formatter classes, although you could likely subclass the formatter
-if your application needs special behavior. The constructor takes two optional
-arguments: a message format string and a date format string. If there is no
-message format string, the default is to use the raw message. If there is no
-date format string, the default date format is::
-
- %Y-%m-%d %H:%M:%S
-
-with the milliseconds tacked on at the end.
-
-The message format string uses ``%(<dictionary key>)s`` styled string
-substitution; the possible keys are documented in :ref:`formatter-objects`.
-
-The following message format string will log the time in a human-readable
-format, the severity of the message, and the contents of the message, in that
-order::
-
- "%(asctime)s - %(levelname)s - %(message)s"
-
-Formatters use a user-configurable function to convert the creation time of a
-record to a tuple. By default, :func:`time.localtime` is used; to change this
-for a particular formatter instance, set the ``converter`` attribute of the
-instance to a function with the same signature as :func:`time.localtime` or
-:func:`time.gmtime`. To change it for all formatters, for example if you want
-all logging times to be shown in GMT, set the ``converter`` attribute in the
-Formatter class (to ``time.gmtime`` for GMT display).
-
-
-Configuring Logging
-^^^^^^^^^^^^^^^^^^^
-
-Programmers can configure logging either by creating loggers, handlers, and
-formatters explicitly in a main module with the configuration methods listed
-above (using Python code), or by creating a logging config file. The following
-code is an example of configuring a very simple logger, a console handler, and a
-simple formatter in a Python module::
-
- import logging
-
- # create logger
- logger = logging.getLogger("simple_example")
- logger.setLevel(logging.DEBUG)
- # create console handler and set level to debug
- ch = logging.StreamHandler()
- ch.setLevel(logging.DEBUG)
- # create formatter
- formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
- # add formatter to ch
- ch.setFormatter(formatter)
- # add ch to logger
- logger.addHandler(ch)
-
- # "application" code
- logger.debug("debug message")
- logger.info("info message")
- logger.warn("warn message")
- logger.error("error message")
- logger.critical("critical message")
-
-Running this module from the command line produces the following output::
-
- $ python simple_logging_module.py
- 2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message
- 2005-03-19 15:10:26,620 - simple_example - INFO - info message
- 2005-03-19 15:10:26,695 - simple_example - WARNING - warn message
- 2005-03-19 15:10:26,697 - simple_example - ERROR - error message
- 2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message
-
-The following Python module creates a logger, handler, and formatter nearly
-identical to those in the example listed above, with the only difference being
-the names of the objects::
-
- import logging
- import logging.config
-
- logging.config.fileConfig("logging.conf")
-
- # create logger
- logger = logging.getLogger("simpleExample")
-
- # "application" code
- logger.debug("debug message")
- logger.info("info message")
- logger.warn("warn message")
- logger.error("error message")
- logger.critical("critical message")
-
-Here is the logging.conf file::
-
- [loggers]
- keys=root,simpleExample
-
- [handlers]
- keys=consoleHandler
-
- [formatters]
- keys=simpleFormatter
-
- [logger_root]
- level=DEBUG
- handlers=consoleHandler
-
- [logger_simpleExample]
- level=DEBUG
- handlers=consoleHandler
- qualname=simpleExample
- propagate=0
-
- [handler_consoleHandler]
- class=StreamHandler
- level=DEBUG
- formatter=simpleFormatter
- args=(sys.stdout,)
-
- [formatter_simpleFormatter]
- format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
- datefmt=
-
-The output is nearly identical to that of the non-config-file-based example::
-
- $ python simple_logging_config.py
- 2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message
- 2005-03-19 15:38:55,979 - simpleExample - INFO - info message
- 2005-03-19 15:38:56,054 - simpleExample - WARNING - warn message
- 2005-03-19 15:38:56,055 - simpleExample - ERROR - error message
- 2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message
-
-You can see that the config file approach has a few advantages over the Python
-code approach, mainly separation of configuration and code and the ability of
-noncoders to easily modify the logging properties.
-
-.. _library-config:
-
-Configuring Logging for a Library
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-When developing a library which uses logging, some consideration needs to be
-given to its configuration. If the using application does not use logging, and
-library code makes logging calls, then a one-off message "No handlers could be
-found for logger X.Y.Z" is printed to the console. This message is intended
-to catch mistakes in logging configuration, but will confuse an application
-developer who is not aware of logging by the library.
-
-In addition to documenting how a library uses logging, a good way to configure
-library logging so that it does not cause a spurious message is to add a
-handler which does nothing. This avoids the message being printed, since a
-handler will be found: it just doesn't produce any output. If the library user
-configures logging for application use, presumably that configuration will add
-some handlers, and if levels are suitably configured then logging calls made
-in library code will send output to those handlers, as normal.
-
-A do-nothing handler can be simply defined as follows::
-
- import logging
-
- class NullHandler(logging.Handler):
- def emit(self, record):
- pass
-
-An instance of this handler should be added to the top-level logger of the
-logging namespace used by the library. If all logging by a library *foo* is
-done using loggers with names matching "foo.x.y", then the code::
-
- import logging
-
- h = NullHandler()
- logging.getLogger("foo").addHandler(h)
-
-should have the desired effect. If an organisation produces a number of
-libraries, then the logger name specified can be "orgname.foo" rather than
-just "foo".
-
-.. versionadded:: 3.1
- The :class:`NullHandler` class.
-
-
-Logging Levels
---------------
-
-The numeric values of logging levels are given in the following table. These are
-primarily of interest if you want to define your own levels, and need them to
-have specific values relative to the predefined levels. If you define a level
-with the same numeric value, it overwrites the predefined value; the predefined
-name is lost.
-
-+--------------+---------------+
-| Level | Numeric value |
-+==============+===============+
-| ``CRITICAL`` | 50 |
-+--------------+---------------+
-| ``ERROR`` | 40 |
-+--------------+---------------+
-| ``WARNING`` | 30 |
-+--------------+---------------+
-| ``INFO`` | 20 |
-+--------------+---------------+
-| ``DEBUG`` | 10 |
-+--------------+---------------+
-| ``NOTSET`` | 0 |
-+--------------+---------------+
-
-Levels can also be associated with loggers, being set either by the developer or
-through loading a saved logging configuration. When a logging method is called
-on a logger, the logger compares its own level with the level associated with
-the method call. If the logger's level is higher than the method call's, no
-logging message is actually generated. This is the basic mechanism controlling
-the verbosity of logging output.
-
-Logging messages are encoded as instances of the :class:`LogRecord` class. When
-a logger decides to actually log an event, a :class:`LogRecord` instance is
-created from the logging message.
-
-Logging messages are subjected to a dispatch mechanism through the use of
-:dfn:`handlers`, which are instances of subclasses of the :class:`Handler`
-class. Handlers are responsible for ensuring that a logged message (in the form
-of a :class:`LogRecord`) ends up in a particular location (or set of locations)
-which is useful for the target audience for that message (such as end users,
-support desk staff, system administrators, developers). Handlers are passed
-:class:`LogRecord` instances intended for particular destinations. Each logger
-can have zero, one or more handlers associated with it (via the
-:meth:`addHandler` method of :class:`Logger`). In addition to any handlers
-directly associated with a logger, *all handlers associated with all ancestors
-of the logger* are called to dispatch the message (unless the *propagate* flag
-for a logger is set to a false value, at which point the passing to ancestor
-handlers stops).
-
-Just as for loggers, handlers can have levels associated with them. A handler's
-level acts as a filter in the same way as a logger's level does. If a handler
-decides to actually dispatch an event, the :meth:`emit` method is used to send
-the message to its destination. Most user-defined subclasses of :class:`Handler`
-will need to override this :meth:`emit`.
-
-Useful Handlers
----------------
-
-In addition to the base :class:`Handler` class, many useful subclasses are
-provided:
-
-#. :class:`StreamHandler` instances send messages to streams (file-like
- objects).
-
-#. :class:`FileHandler` instances send messages to disk files.
-
-.. module:: logging.handlers
-
-#. :class:`BaseRotatingHandler` is the base class for handlers that
- rotate log files at a certain point. It is not meant to be instantiated
- directly. Instead, use :class:`RotatingFileHandler` or
- :class:`TimedRotatingFileHandler`.
-
-#. :class:`RotatingFileHandler` instances send messages to disk
- files, with support for maximum log file sizes and log file rotation.
-
-#. :class:`TimedRotatingFileHandler` instances send messages to
- disk files, rotating the log file at certain timed intervals.
-
-#. :class:`SocketHandler` instances send messages to TCP/IP
- sockets.
-
-#. :class:`DatagramHandler` instances send messages to UDP
- sockets.
-
-#. :class:`SMTPHandler` instances send messages to a designated
- email address.
-
-#. :class:`SysLogHandler` instances send messages to a Unix
- syslog daemon, possibly on a remote machine.
-
-#. :class:`NTEventLogHandler` instances send messages to a
- Windows NT/2000/XP event log.
-
-#. :class:`MemoryHandler` instances send messages to a buffer
- in memory, which is flushed whenever specific criteria are met.
-
-#. :class:`HTTPHandler` instances send messages to an HTTP
- server using either ``GET`` or ``POST`` semantics.
-
-#. :class:`WatchedFileHandler` instances watch the file they are
- logging to. If the file changes, it is closed and reopened using the file
- name. This handler is only useful on Unix-like systems; Windows does not
- support the underlying mechanism used.
-
-.. currentmodule:: logging
-
-#. :class:`NullHandler` instances do nothing with error messages. They are used
- by library developers who want to use logging, but want to avoid the "No
- handlers could be found for logger XXX" message which can be displayed if
- the library user has not configured logging. See :ref:`library-config` for
- more information.
-
-.. versionadded:: 3.1
- The :class:`NullHandler` class.
-
-The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler`
-classes are defined in the core logging package. The other handlers are
-defined in a sub- module, :mod:`logging.handlers`. (There is also another
-sub-module, :mod:`logging.config`, for configuration functionality.)
-
-Logged messages are formatted for presentation through instances of the
-:class:`Formatter` class. They are initialized with a format string suitable for
-use with the % operator and a dictionary.
-
-For formatting multiple messages in a batch, instances of
-:class:`BufferingFormatter` can be used. In addition to the format string (which
-is applied to each message in the batch), there is provision for header and
-trailer format strings.
-
-When filtering based on logger level and/or handler level is not enough,
-instances of :class:`Filter` can be added to both :class:`Logger` and
-:class:`Handler` instances (through their :meth:`addFilter` method). Before
-deciding to process a message further, both loggers and handlers consult all
-their filters for permission. If any filter returns a false value, the message
-is not processed further.
-
-The basic :class:`Filter` functionality allows filtering by specific logger
-name. If this feature is used, messages sent to the named logger and its
-children are allowed through the filter, and all others dropped.
-
-Module-Level Functions
-----------------------
-
-In addition to the classes described above, there are a number of module- level
-functions.
-
-
-.. function:: getLogger(name=None)
-
- Return a logger with the specified name or, if name is ``None``, return a
- logger which is the root logger of the hierarchy. If specified, the name is
- typically a dot-separated hierarchical name like *"a"*, *"a.b"* or *"a.b.c.d"*.
- Choice of these names is entirely up to the developer who is using logging.
-
- All calls to this function with a given name return the same logger instance.
- This means that logger instances never need to be passed between different parts
- of an application.
-
-
-.. function:: getLoggerClass()
-
- Return either the standard :class:`Logger` class, or the last class passed to
- :func:`setLoggerClass`. This function may be called from within a new class
- definition, to ensure that installing a customised :class:`Logger` class will
- not undo customisations already applied by other code. For example::
-
- class MyLogger(logging.getLoggerClass()):
- # ... override behaviour here
-
-
-.. function:: debug(msg, *args, **kwargs)
-
- Logs a message with level :const:`DEBUG` on the root logger. The *msg* is the
- message format string, and the *args* are the arguments which are merged into
- *msg* using the string formatting operator. (Note that this means that you can
- use keywords in the format string, together with a single dictionary argument.)
-
- There are two keyword arguments in *kwargs* which are inspected: *exc_info*
- which, if it does not evaluate as false, causes exception information to be
- added to the logging message. If an exception tuple (in the format returned by
- :func:`sys.exc_info`) is provided, it is used; otherwise, :func:`sys.exc_info`
- is called to get the exception information.
-
- The other optional keyword argument is *extra* which can be used to pass a
- dictionary which is used to populate the __dict__ of the LogRecord created for
- the logging event with user-defined attributes. These custom attributes can then
- be used as you like. For example, they could be incorporated into logged
- messages. For example::
-
- FORMAT = "%(asctime)-15s %(clientip)s %(user)-8s %(message)s"
- logging.basicConfig(format=FORMAT)
- d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
- logging.warning("Protocol problem: %s", "connection reset", extra=d)
-
- would print something like::
-
- 2006-02-08 22:20:02,165 192.168.0.1 fbloggs Protocol problem: connection reset
-
- The keys in the dictionary passed in *extra* should not clash with the keys used
- by the logging system. (See the :class:`Formatter` documentation for more
- information on which keys are used by the logging system.)
-
- If you choose to use these attributes in logged messages, you need to exercise
- some care. In the above example, for instance, the :class:`Formatter` has been
- set up with a format string which expects 'clientip' and 'user' in the attribute
- dictionary of the LogRecord. If these are missing, the message will not be
- logged because a string formatting exception will occur. So in this case, you
- always need to pass the *extra* dictionary with these keys.
-
- While this might be annoying, this feature is intended for use in specialized
- circumstances, such as multi-threaded servers where the same code executes in
- many contexts, and interesting conditions which arise are dependent on this
- context (such as remote client IP address and authenticated user name, in the
- above example). In such circumstances, it is likely that specialized
- :class:`Formatter`\ s would be used with particular :class:`Handler`\ s.
-
-
-.. function:: info(msg, *args, **kwargs)
-
- Logs a message with level :const:`INFO` on the root logger. The arguments are
- interpreted as for :func:`debug`.
-
-
-.. function:: warning(msg, *args, **kwargs)
-
- Logs a message with level :const:`WARNING` on the root logger. The arguments are
- interpreted as for :func:`debug`.
-
-
-.. function:: error(msg, *args, **kwargs)
-
- Logs a message with level :const:`ERROR` on the root logger. The arguments are
- interpreted as for :func:`debug`.
-
-
-.. function:: critical(msg, *args, **kwargs)
-
- Logs a message with level :const:`CRITICAL` on the root logger. The arguments
- are interpreted as for :func:`debug`.
-
-
-.. function:: exception(msg, *args)
-
- Logs a message with level :const:`ERROR` on the root logger. The arguments are
- interpreted as for :func:`debug`. Exception info is added to the logging
- message. This function should only be called from an exception handler.
-
-
-.. function:: log(level, msg, *args, **kwargs)
-
- Logs a message with level *level* on the root logger. The other arguments are
- interpreted as for :func:`debug`.
-
-
-.. function:: disable(lvl)
-
- Provides an overriding level *lvl* for all loggers which takes precedence over
- the logger's own level. When the need arises to temporarily throttle logging
- output down across the whole application, this function can be useful. Its
- effect is to disable all logging calls of severity *lvl* and below, so that
- if you call it with a value of INFO, then all INFO and DEBUG events would be
- discarded, whereas those of severity WARNING and above would be processed
- according to the logger's effective level.
-
-
-.. function:: addLevelName(lvl, levelName)
-
- Associates level *lvl* with text *levelName* in an internal dictionary, which is
- used to map numeric levels to a textual representation, for example when a
- :class:`Formatter` formats a message. This function can also be used to define
- your own levels. The only constraints are that all levels used must be
- registered using this function, levels should be positive integers and they
- should increase in increasing order of severity.
-
-
-.. function:: getLevelName(lvl)
-
- Returns the textual representation of logging level *lvl*. If the level is one
- of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`,
- :const:`INFO` or :const:`DEBUG` then you get the corresponding string. If you
- have associated levels with names using :func:`addLevelName` then the name you
- have associated with *lvl* is returned. If a numeric value corresponding to one
- of the defined levels is passed in, the corresponding string representation is
- returned. Otherwise, the string "Level %s" % lvl is returned.
-
-
-.. function:: makeLogRecord(attrdict)
-
- Creates and returns a new :class:`LogRecord` instance whose attributes are
- defined by *attrdict*. This function is useful for taking a pickled
- :class:`LogRecord` attribute dictionary, sent over a socket, and reconstituting
- it as a :class:`LogRecord` instance at the receiving end.
-
-
-.. function:: basicConfig(**kwargs)
-
- Does basic configuration for the logging system by creating a
- :class:`StreamHandler` with a default :class:`Formatter` and adding it to the
- root logger. The functions :func:`debug`, :func:`info`, :func:`warning`,
- :func:`error` and :func:`critical` will call :func:`basicConfig` automatically
- if no handlers are defined for the root logger.
-
- This function does nothing if the root logger already has handlers
- configured for it.
-
- The following keyword arguments are supported.
-
- +--------------+---------------------------------------------+
- | Format | Description |
- +==============+=============================================+
- | ``filename`` | Specifies that a FileHandler be created, |
- | | using the specified filename, rather than a |
- | | StreamHandler. |
- +--------------+---------------------------------------------+
- | ``filemode`` | Specifies the mode to open the file, if |
- | | filename is specified (if filemode is |
- | | unspecified, it defaults to 'a'). |
- +--------------+---------------------------------------------+
- | ``format`` | Use the specified format string for the |
- | | handler. |
- +--------------+---------------------------------------------+
- | ``datefmt`` | Use the specified date/time format. |
- +--------------+---------------------------------------------+
- | ``level`` | Set the root logger level to the specified |
- | | level. |
- +--------------+---------------------------------------------+
- | ``stream`` | Use the specified stream to initialize the |
- | | StreamHandler. Note that this argument is |
- | | incompatible with 'filename' - if both are |
- | | present, 'stream' is ignored. |
- +--------------+---------------------------------------------+
-
-
-.. function:: shutdown()
-
- Informs the logging system to perform an orderly shutdown by flushing and
- closing all handlers. This should be called at application exit and no
- further use of the logging system should be made after this call.
-
-
-.. function:: setLoggerClass(klass)
-
- Tells the logging system to use the class *klass* when instantiating a logger.
- The class should define :meth:`__init__` such that only a name argument is
- required, and the :meth:`__init__` should call :meth:`Logger.__init__`. This
- function is typically called before any loggers are instantiated by applications
- which need to use custom logger behavior.
-
-
-.. seealso::
-
- :pep:`282` - A Logging System
- The proposal which described this feature for inclusion in the Python standard
- library.
-
- `Original Python logging package <http://www.red-dove.com/python_logging.html>`_
- This is the original source for the :mod:`logging` package. The version of the
- package available from this site is suitable for use with Python 1.5.2, 2.1.x
- and 2.2.x, which do not include the :mod:`logging` package in the standard
- library.
.. _logger:
@@ -848,6 +53,7 @@ Loggers have the following attributes and methods. Note that Loggers are never
instantiated directly, but always through the module-level function
``logging.getLogger(name)``.
+.. class:: Logger
.. attribute:: Logger.propagate
@@ -864,7 +70,7 @@ instantiated directly, but always through the module-level function
the root logger, or delegation to the parent when the logger is a non-root
logger). Note that the root logger is created with level :const:`WARNING`.
- The term "delegation to the parent" means that if a logger has a level of
+ The term 'delegation to the parent' means that if a logger has a level of
NOTSET, its chain of ancestor loggers is traversed until either an ancestor with
a level other than NOTSET is found, or the root is reached.
@@ -892,6 +98,16 @@ instantiated directly, but always through the module-level function
:const:`NOTSET` is found, and that value is returned.
+.. method:: Logger.getChild(suffix)
+
+ Returns a logger which is a descendant to this logger, as determined by the suffix.
+ Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return the same
+ logger as would be returned by ``logging.getLogger('abc.def.ghi')``. This is a
+ convenience method, useful when the parent logger is named using e.g. ``__name__``
+ rather than a literal string.
+
+ .. versionadded:: 3.2
+
.. method:: Logger.debug(msg, *args, **kwargs)
@@ -900,23 +116,41 @@ instantiated directly, but always through the module-level function
*msg* using the string formatting operator. (Note that this means that you can
use keywords in the format string, together with a single dictionary argument.)
- There are two keyword arguments in *kwargs* which are inspected: *exc_info*
+ There are three keyword arguments in *kwargs* which are inspected: *exc_info*
which, if it does not evaluate as false, causes exception information to be
added to the logging message. If an exception tuple (in the format returned by
:func:`sys.exc_info`) is provided, it is used; otherwise, :func:`sys.exc_info`
is called to get the exception information.
- The other optional keyword argument is *extra* which can be used to pass a
+ The second optional keyword argument is *stack_info*, which defaults to
+ False. If specified as True, stack information is added to the logging
+ message, including the actual logging call. Note that this is not the same
+ stack information as that displayed through specifying *exc_info*: The
+ former is stack frames from the bottom of the stack up to the logging call
+ in the current thread, whereas the latter is information about stack frames
+ which have been unwound, following an exception, while searching for
+ exception handlers.
+
+ You can specify *stack_info* independently of *exc_info*, e.g. to just show
+ how you got to a certain point in your code, even when no exceptions were
+ raised. The stack frames are printed following a header line which says::
+
+ Stack (most recent call last):
+
+ This mimics the `Traceback (most recent call last):` which is used when
+ displaying exception frames.
+
+ The third keyword argument is *extra* which can be used to pass a
dictionary which is used to populate the __dict__ of the LogRecord created for
the logging event with user-defined attributes. These custom attributes can then
be used as you like. For example, they could be incorporated into logged
messages. For example::
- FORMAT = "%(asctime)-15s %(clientip)s %(user)-8s %(message)s"
+ FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
logging.basicConfig(format=FORMAT)
d = { 'clientip' : '192.168.0.1', 'user' : 'fbloggs' }
- logger = logging.getLogger("tcpserver")
- logger.warning("Protocol problem: %s", "connection reset", extra=d)
+ logger = logging.getLogger('tcpserver')
+ logger.warning('Protocol problem: %s', 'connection reset', extra=d)
would print something like ::
@@ -940,6 +174,9 @@ instantiated directly, but always through the module-level function
above example). In such circumstances, it is likely that specialized
:class:`Formatter`\ s would be used with particular :class:`Handler`\ s.
+ .. versionadded:: 3.2
+ The *stack_info* parameter was added.
+
.. method:: Logger.info(msg, *args, **kwargs)
@@ -1004,10 +241,11 @@ instantiated directly, but always through the module-level function
Removes the specified handler *hdlr* from this logger.
-.. method:: Logger.findCaller()
+.. method:: Logger.findCaller(stack_info=False)
Finds the caller's source filename and line number. Returns the filename, line
- number and function name as a 3-element tuple.
+ number, function name and stack information as a 4-element tuple. The stack
+ information is returned as *None* unless *stack_info* is *True*.
.. method:: Logger.handle(record)
@@ -1018,630 +256,22 @@ instantiated directly, but always through the module-level function
Logger-level filtering is applied using :meth:`~Logger.filter`.
-.. method:: Logger.makeRecord(name, lvl, fn, lno, msg, args, exc_info, func=None, extra=None)
+.. method:: Logger.makeRecord(name, lvl, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None)
This is a factory method which can be overridden in subclasses to create
specialized :class:`LogRecord` instances.
+.. method:: Logger.hasHandlers()
-.. _minimal-example:
-
-Basic example
--------------
-
-The :mod:`logging` package provides a lot of flexibility, and its configuration
-can appear daunting. This section demonstrates that simple use of the logging
-package is possible.
-
-The simplest example shows logging to the console::
-
- import logging
-
- logging.debug('A debug message')
- logging.info('Some information')
- logging.warning('A shot across the bows')
-
-If you run the above script, you'll see this::
-
- WARNING:root:A shot across the bows
-
-Because no particular logger was specified, the system used the root logger. The
-debug and info messages didn't appear because by default, the root logger is
-configured to only handle messages with a severity of WARNING or above. The
-message format is also a configuration default, as is the output destination of
-the messages - ``sys.stderr``. The severity level, the message format and
-destination can be easily changed, as shown in the example below::
-
- import logging
-
- logging.basicConfig(level=logging.DEBUG,
- format='%(asctime)s %(levelname)s %(message)s',
- filename='myapp.log',
- filemode='w')
- logging.debug('A debug message')
- logging.info('Some information')
- logging.warning('A shot across the bows')
+ Checks to see if this logger has any handlers configured. This is done by
+ looking for handlers in this logger and its parents in the logger hierarchy.
+ Returns True if a handler was found, else False. The method stops searching
+ up the hierarchy whenever a logger with the 'propagate' attribute set to
+ False is found - that will be the last logger which is checked for the
+ existence of handlers.
-The :meth:`basicConfig` method is used to change the configuration defaults,
-which results in output (written to ``myapp.log``) which should look
-something like the following::
-
- 2004-07-02 13:00:08,743 DEBUG A debug message
- 2004-07-02 13:00:08,743 INFO Some information
- 2004-07-02 13:00:08,743 WARNING A shot across the bows
-
-This time, all messages with a severity of DEBUG or above were handled, and the
-format of the messages was also changed, and output went to the specified file
-rather than the console.
-
-.. XXX logging should probably be updated for new string formatting!
-
-Formatting uses the old Python string formatting - see section
-:ref:`old-string-formatting`. The format string takes the following common
-specifiers. For a complete list of specifiers, consult the :class:`Formatter`
-documentation.
-
-+-------------------+-----------------------------------------------+
-| Format | Description |
-+===================+===============================================+
-| ``%(name)s`` | Name of the logger (logging channel). |
-+-------------------+-----------------------------------------------+
-| ``%(levelname)s`` | Text logging level for the message |
-| | (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, |
-| | ``'ERROR'``, ``'CRITICAL'``). |
-+-------------------+-----------------------------------------------+
-| ``%(asctime)s`` | Human-readable time when the |
-| | :class:`LogRecord` was created. By default |
-| | this is of the form "2003-07-08 16:49:45,896" |
-| | (the numbers after the comma are millisecond |
-| | portion of the time). |
-+-------------------+-----------------------------------------------+
-| ``%(message)s`` | The logged message. |
-+-------------------+-----------------------------------------------+
-
-To change the date/time format, you can pass an additional keyword parameter,
-*datefmt*, as in the following::
-
- import logging
-
- logging.basicConfig(level=logging.DEBUG,
- format='%(asctime)s %(levelname)-8s %(message)s',
- datefmt='%a, %d %b %Y %H:%M:%S',
- filename='/temp/myapp.log',
- filemode='w')
- logging.debug('A debug message')
- logging.info('Some information')
- logging.warning('A shot across the bows')
-
-which would result in output like ::
+ .. versionadded:: 3.2
- Fri, 02 Jul 2004 13:06:18 DEBUG A debug message
- Fri, 02 Jul 2004 13:06:18 INFO Some information
- Fri, 02 Jul 2004 13:06:18 WARNING A shot across the bows
-
-The date format string follows the requirements of :func:`strftime` - see the
-documentation for the :mod:`time` module.
-
-If, instead of sending logging output to the console or a file, you'd rather use
-a file-like object which you have created separately, you can pass it to
-:func:`basicConfig` using the *stream* keyword argument. Note that if both
-*stream* and *filename* keyword arguments are passed, the *stream* argument is
-ignored.
-
-Of course, you can put variable information in your output. To do this, simply
-have the message be a format string and pass in additional arguments containing
-the variable information, as in the following example::
-
- import logging
-
- logging.basicConfig(level=logging.DEBUG,
- format='%(asctime)s %(levelname)-8s %(message)s',
- datefmt='%a, %d %b %Y %H:%M:%S',
- filename='/temp/myapp.log',
- filemode='w')
- logging.error('Pack my box with %d dozen %s', 5, 'liquor jugs')
-
-which would result in ::
-
- Wed, 21 Jul 2004 15:35:16 ERROR Pack my box with 5 dozen liquor jugs
-
-
-.. _multiple-destinations:
-
-Logging to multiple destinations
---------------------------------
-
-Let's say you want to log to console and file with different message formats and
-in differing circumstances. Say you want to log messages with levels of DEBUG
-and higher to file, and those messages at level INFO and higher to the console.
-Let's also assume that the file should contain timestamps, but the console
-messages should not. Here's how you can achieve this::
-
- import logging
-
- # set up logging to file - see previous section for more details
- logging.basicConfig(level=logging.DEBUG,
- format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
- datefmt='%m-%d %H:%M',
- filename='/temp/myapp.log',
- filemode='w')
- # define a Handler which writes INFO messages or higher to the sys.stderr
- console = logging.StreamHandler()
- console.setLevel(logging.INFO)
- # set a format which is simpler for console use
- formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
- # tell the handler to use this format
- console.setFormatter(formatter)
- # add the handler to the root logger
- logging.getLogger('').addHandler(console)
-
- # Now, we can log to the root logger, or any other logger. First the root...
- logging.info('Jackdaws love my big sphinx of quartz.')
-
- # Now, define a couple of other loggers which might represent areas in your
- # application:
-
- logger1 = logging.getLogger('myapp.area1')
- logger2 = logging.getLogger('myapp.area2')
-
- logger1.debug('Quick zephyrs blow, vexing daft Jim.')
- logger1.info('How quickly daft jumping zebras vex.')
- logger2.warning('Jail zesty vixen who grabbed pay from quack.')
- logger2.error('The five boxing wizards jump quickly.')
-
-When you run this, on the console you will see ::
-
- root : INFO Jackdaws love my big sphinx of quartz.
- myapp.area1 : INFO How quickly daft jumping zebras vex.
- myapp.area2 : WARNING Jail zesty vixen who grabbed pay from quack.
- myapp.area2 : ERROR The five boxing wizards jump quickly.
-
-and in the file you will see something like ::
-
- 10-22 22:19 root INFO Jackdaws love my big sphinx of quartz.
- 10-22 22:19 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.
- 10-22 22:19 myapp.area1 INFO How quickly daft jumping zebras vex.
- 10-22 22:19 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.
- 10-22 22:19 myapp.area2 ERROR The five boxing wizards jump quickly.
-
-As you can see, the DEBUG message only shows up in the file. The other messages
-are sent to both destinations.
-
-This example uses console and file handlers, but you can use any number and
-combination of handlers you choose.
-
-.. _logging-exceptions:
-
-Exceptions raised during logging
---------------------------------
-
-The logging package is designed to swallow exceptions which occur while logging
-in production. This is so that errors which occur while handling logging events
-- such as logging misconfiguration, network or other similar errors - do not
-cause the application using logging to terminate prematurely.
-
-:class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never
-swallowed. Other exceptions which occur during the :meth:`emit` method of a
-:class:`Handler` subclass are passed to its :meth:`handleError` method.
-
-The default implementation of :meth:`handleError` in :class:`Handler` checks
-to see if a module-level variable, :data:`raiseExceptions`, is set. If set, a
-traceback is printed to :data:`sys.stderr`. If not set, the exception is swallowed.
-
-**Note:** The default value of :data:`raiseExceptions` is ``True``. This is because
-during development, you typically want to be notified of any exceptions that
-occur. It's advised that you set :data:`raiseExceptions` to ``False`` for production
-usage.
-
-.. _context-info:
-
-Adding contextual information to your logging output
-----------------------------------------------------
-
-Sometimes you want logging output to contain contextual information in
-addition to the parameters passed to the logging call. For example, in a
-networked application, it may be desirable to log client-specific information
-in the log (e.g. remote client's username, or IP address). Although you could
-use the *extra* parameter to achieve this, it's not always convenient to pass
-the information in this way. While it might be tempting to create
-:class:`Logger` instances on a per-connection basis, this is not a good idea
-because these instances are not garbage collected. While this is not a problem
-in practice, when the number of :class:`Logger` instances is dependent on the
-level of granularity you want to use in logging an application, it could
-be hard to manage if the number of :class:`Logger` instances becomes
-effectively unbounded.
-
-
-Using LoggerAdapters to impart contextual information
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-An easy way in which you can pass contextual information to be output along
-with logging event information is to use the :class:`LoggerAdapter` class.
-This class is designed to look like a :class:`Logger`, so that you can call
-:meth:`debug`, :meth:`info`, :meth:`warning`, :meth:`error`,
-:meth:`exception`, :meth:`critical` and :meth:`log`. These methods have the
-same signatures as their counterparts in :class:`Logger`, so you can use the
-two types of instances interchangeably.
-
-When you create an instance of :class:`LoggerAdapter`, you pass it a
-:class:`Logger` instance and a dict-like object which contains your contextual
-information. When you call one of the logging methods on an instance of
-:class:`LoggerAdapter`, it delegates the call to the underlying instance of
-:class:`Logger` passed to its constructor, and arranges to pass the contextual
-information in the delegated call. Here's a snippet from the code of
-:class:`LoggerAdapter`::
-
- def debug(self, msg, *args, **kwargs):
- """
- Delegate a debug call to the underlying logger, after adding
- contextual information from this adapter instance.
- """
- msg, kwargs = self.process(msg, kwargs)
- self.logger.debug(msg, *args, **kwargs)
-
-The :meth:`process` method of :class:`LoggerAdapter` is where the contextual
-information is added to the logging output. It's passed the message and
-keyword arguments of the logging call, and it passes back (potentially)
-modified versions of these to use in the call to the underlying logger. The
-default implementation of this method leaves the message alone, but inserts
-an "extra" key in the keyword argument whose value is the dict-like object
-passed to the constructor. Of course, if you had passed an "extra" keyword
-argument in the call to the adapter, it will be silently overwritten.
-
-The advantage of using "extra" is that the values in the dict-like object are
-merged into the :class:`LogRecord` instance's __dict__, allowing you to use
-customized strings with your :class:`Formatter` instances which know about
-the keys of the dict-like object. If you need a different method, e.g. if you
-want to prepend or append the contextual information to the message string,
-you just need to subclass :class:`LoggerAdapter` and override :meth:`process`
-to do what you need. Here's an example script which uses this class, which
-also illustrates what dict-like behaviour is needed from an arbitrary
-"dict-like" object for use in the constructor::
-
- import logging
-
- class ConnInfo:
- """
- An example class which shows how an arbitrary class can be used as
- the 'extra' context information repository passed to a LoggerAdapter.
- """
-
- def __getitem__(self, name):
- """
- To allow this instance to look like a dict.
- """
- from random import choice
- if name == "ip":
- result = choice(["127.0.0.1", "192.168.0.1"])
- elif name == "user":
- result = choice(["jim", "fred", "sheila"])
- else:
- result = self.__dict__.get(name, "?")
- return result
-
- def __iter__(self):
- """
- To allow iteration over keys, which will be merged into
- the LogRecord dict before formatting and output.
- """
- keys = ["ip", "user"]
- keys.extend(self.__dict__.keys())
- return keys.__iter__()
-
- if __name__ == "__main__":
- from random import choice
- levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL)
- a1 = logging.LoggerAdapter(logging.getLogger("a.b.c"),
- { "ip" : "123.231.231.123", "user" : "sheila" })
- logging.basicConfig(level=logging.DEBUG,
- format="%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s")
- a1.debug("A debug message")
- a1.info("An info message with %s", "some parameters")
- a2 = logging.LoggerAdapter(logging.getLogger("d.e.f"), ConnInfo())
- for x in range(10):
- lvl = choice(levels)
- lvlname = logging.getLevelName(lvl)
- a2.log(lvl, "A message at %s level with %d %s", lvlname, 2, "parameters")
-
-When this script is run, the output should look something like this::
-
- 2008-01-18 14:49:54,023 a.b.c DEBUG IP: 123.231.231.123 User: sheila A debug message
- 2008-01-18 14:49:54,023 a.b.c INFO IP: 123.231.231.123 User: sheila An info message with some parameters
- 2008-01-18 14:49:54,023 d.e.f CRITICAL IP: 192.168.0.1 User: jim A message at CRITICAL level with 2 parameters
- 2008-01-18 14:49:54,033 d.e.f INFO IP: 192.168.0.1 User: jim A message at INFO level with 2 parameters
- 2008-01-18 14:49:54,033 d.e.f WARNING IP: 192.168.0.1 User: sheila A message at WARNING level with 2 parameters
- 2008-01-18 14:49:54,033 d.e.f ERROR IP: 127.0.0.1 User: fred A message at ERROR level with 2 parameters
- 2008-01-18 14:49:54,033 d.e.f ERROR IP: 127.0.0.1 User: sheila A message at ERROR level with 2 parameters
- 2008-01-18 14:49:54,033 d.e.f WARNING IP: 192.168.0.1 User: sheila A message at WARNING level with 2 parameters
- 2008-01-18 14:49:54,033 d.e.f WARNING IP: 192.168.0.1 User: jim A message at WARNING level with 2 parameters
- 2008-01-18 14:49:54,033 d.e.f INFO IP: 192.168.0.1 User: fred A message at INFO level with 2 parameters
- 2008-01-18 14:49:54,033 d.e.f WARNING IP: 192.168.0.1 User: sheila A message at WARNING level with 2 parameters
- 2008-01-18 14:49:54,033 d.e.f WARNING IP: 127.0.0.1 User: jim A message at WARNING level with 2 parameters
-
-
-Using Filters to impart contextual information
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-You can also add contextual information to log output using a user-defined
-:class:`Filter`. ``Filter`` instances are allowed to modify the ``LogRecords``
-passed to them, including adding additional attributes which can then be output
-using a suitable format string, or if needed a custom :class:`Formatter`.
-
-For example in a web application, the request being processed (or at least,
-the interesting parts of it) can be stored in a threadlocal
-(:class:`threading.local`) variable, and then accessed from a ``Filter`` to
-add, say, information from the request - say, the remote IP address and remote
-user's username - to the ``LogRecord``, using the attribute names 'ip' and
-'user' as in the ``LoggerAdapter`` example above. In that case, the same format
-string can be used to get similar output to that shown above. Here's an example
-script::
-
- import logging
- from random import choice
-
- class ContextFilter(logging.Filter):
- """
- This is a filter which injects contextual information into the log.
-
- Rather than use actual contextual information, we just use random
- data in this demo.
- """
-
- USERS = ['jim', 'fred', 'sheila']
- IPS = ['123.231.231.123', '127.0.0.1', '192.168.0.1']
-
- def filter(self, record):
-
- record.ip = choice(ContextFilter.IPS)
- record.user = choice(ContextFilter.USERS)
- return True
-
- if __name__ == "__main__":
- levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL)
- a1 = logging.LoggerAdapter(logging.getLogger("a.b.c"),
- { "ip" : "123.231.231.123", "user" : "sheila" })
- logging.basicConfig(level=logging.DEBUG,
- format="%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s")
- a1 = logging.getLogger("a.b.c")
- a2 = logging.getLogger("d.e.f")
-
- f = ContextFilter()
- a1.addFilter(f)
- a2.addFilter(f)
- a1.debug("A debug message")
- a1.info("An info message with %s", "some parameters")
- for x in range(10):
- lvl = choice(levels)
- lvlname = logging.getLevelName(lvl)
- a2.log(lvl, "A message at %s level with %d %s", lvlname, 2, "parameters")
-
-which, when run, produces something like::
-
- 2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A debug message
- 2010-09-06 22:38:15,300 a.b.c INFO IP: 192.168.0.1 User: sheila An info message with some parameters
- 2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A message at CRITICAL level with 2 parameters
- 2010-09-06 22:38:15,300 d.e.f ERROR IP: 127.0.0.1 User: jim A message at ERROR level with 2 parameters
- 2010-09-06 22:38:15,300 d.e.f DEBUG IP: 127.0.0.1 User: sheila A message at DEBUG level with 2 parameters
- 2010-09-06 22:38:15,300 d.e.f ERROR IP: 123.231.231.123 User: fred A message at ERROR level with 2 parameters
- 2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 192.168.0.1 User: jim A message at CRITICAL level with 2 parameters
- 2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A message at CRITICAL level with 2 parameters
- 2010-09-06 22:38:15,300 d.e.f DEBUG IP: 192.168.0.1 User: jim A message at DEBUG level with 2 parameters
- 2010-09-06 22:38:15,301 d.e.f ERROR IP: 127.0.0.1 User: sheila A message at ERROR level with 2 parameters
- 2010-09-06 22:38:15,301 d.e.f DEBUG IP: 123.231.231.123 User: fred A message at DEBUG level with 2 parameters
- 2010-09-06 22:38:15,301 d.e.f INFO IP: 123.231.231.123 User: fred A message at INFO level with 2 parameters
-
-
-.. _multiple-processes:
-
-Logging to a single file from multiple processes
-------------------------------------------------
-
-Although logging is thread-safe, and logging to a single file from multiple
-threads in a single process *is* supported, logging to a single file from
-*multiple processes* is *not* supported, because there is no standard way to
-serialize access to a single file across multiple processes in Python. If you
-need to log to a single file from multiple processes, one way of doing this is
-to have all the processes log to a :class:`SocketHandler`, and have a separate
-process which implements a socket server which reads from the socket and logs
-to file. (If you prefer, you can dedicate one thread in one of the existing
-processes to perform this function.) The following section documents this
-approach in more detail and includes a working socket receiver which can be
-used as a starting point for you to adapt in your own applications.
-
-If you are using a recent version of Python which includes the
-:mod:`multiprocessing` module, you could write your own handler which uses the
-:class:`Lock` class from this module to serialize access to the file from
-your processes. The existing :class:`FileHandler` and subclasses do not make
-use of :mod:`multiprocessing` at present, though they may do so in the future.
-Note that at present, the :mod:`multiprocessing` module does not provide
-working lock functionality on all platforms (see
-http://bugs.python.org/issue3770).
-
-
-.. _network-logging:
-
-Sending and receiving logging events across a network
------------------------------------------------------
-
-Let's say you want to send logging events across a network, and handle them at
-the receiving end. A simple way of doing this is attaching a
-:class:`SocketHandler` instance to the root logger at the sending end::
-
- import logging, logging.handlers
-
- rootLogger = logging.getLogger('')
- rootLogger.setLevel(logging.DEBUG)
- socketHandler = logging.handlers.SocketHandler('localhost',
- logging.handlers.DEFAULT_TCP_LOGGING_PORT)
- # don't bother with a formatter, since a socket handler sends the event as
- # an unformatted pickle
- rootLogger.addHandler(socketHandler)
-
- # Now, we can log to the root logger, or any other logger. First the root...
- logging.info('Jackdaws love my big sphinx of quartz.')
-
- # Now, define a couple of other loggers which might represent areas in your
- # application:
-
- logger1 = logging.getLogger('myapp.area1')
- logger2 = logging.getLogger('myapp.area2')
-
- logger1.debug('Quick zephyrs blow, vexing daft Jim.')
- logger1.info('How quickly daft jumping zebras vex.')
- logger2.warning('Jail zesty vixen who grabbed pay from quack.')
- logger2.error('The five boxing wizards jump quickly.')
-
-At the receiving end, you can set up a receiver using the :mod:`socketserver`
-module. Here is a basic working example::
-
- import pickle
- import logging
- import logging.handlers
- import socketserver
- import struct
-
-
- class LogRecordStreamHandler(socketserver.StreamRequestHandler):
- """Handler for a streaming logging request.
-
- This basically logs the record using whatever logging policy is
- configured locally.
- """
-
- def handle(self):
- """
- Handle multiple requests - each expected to be a 4-byte length,
- followed by the LogRecord in pickle format. Logs the record
- according to whatever policy is configured locally.
- """
- while True:
- chunk = self.connection.recv(4)
- if len(chunk) < 4:
- break
- slen = struct.unpack(">L", chunk)[0]
- chunk = self.connection.recv(slen)
- while len(chunk) < slen:
- chunk = chunk + self.connection.recv(slen - len(chunk))
- obj = self.unPickle(chunk)
- record = logging.makeLogRecord(obj)
- self.handleLogRecord(record)
-
- def unPickle(self, data):
- return pickle.loads(data)
-
- def handleLogRecord(self, record):
- # if a name is specified, we use the named logger rather than the one
- # implied by the record.
- if self.server.logname is not None:
- name = self.server.logname
- else:
- name = record.name
- logger = logging.getLogger(name)
- # N.B. EVERY record gets logged. This is because Logger.handle
- # is normally called AFTER logger-level filtering. If you want
- # to do filtering, do it at the client end to save wasting
- # cycles and network bandwidth!
- logger.handle(record)
-
- class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):
- """simple TCP socket-based logging receiver suitable for testing.
- """
-
- allow_reuse_address = 1
-
- def __init__(self, host='localhost',
- port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
- handler=LogRecordStreamHandler):
- socketserver.ThreadingTCPServer.__init__(self, (host, port), handler)
- self.abort = 0
- self.timeout = 1
- self.logname = None
-
- def serve_until_stopped(self):
- import select
- abort = 0
- while not abort:
- rd, wr, ex = select.select([self.socket.fileno()],
- [], [],
- self.timeout)
- if rd:
- self.handle_request()
- abort = self.abort
-
- def main():
- logging.basicConfig(
- format="%(relativeCreated)5d %(name)-15s %(levelname)-8s %(message)s")
- tcpserver = LogRecordSocketReceiver()
- print("About to start TCP server...")
- tcpserver.serve_until_stopped()
-
- if __name__ == "__main__":
- main()
-
-First run the server, and then the client. On the client side, nothing is
-printed on the console; on the server side, you should see something like::
-
- About to start TCP server...
- 59 root INFO Jackdaws love my big sphinx of quartz.
- 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.
- 69 myapp.area1 INFO How quickly daft jumping zebras vex.
- 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.
- 69 myapp.area2 ERROR The five boxing wizards jump quickly.
-
-Note that there are some security issues with pickle in some scenarios. If
-these affect you, you can use an alternative serialization scheme by overriding
-the :meth:`makePickle` method and implementing your alternative there, as
-well as adapting the above script to use your alternative serialization.
-
-.. _arbitrary-object-messages:
-
-Using arbitrary objects as messages
------------------------------------
-
-In the preceding sections and examples, it has been assumed that the message
-passed when logging the event is a string. However, this is not the only
-possibility. You can pass an arbitrary object as a message, and its
-:meth:`__str__` method will be called when the logging system needs to convert
-it to a string representation. In fact, if you want to, you can avoid
-computing a string representation altogether - for example, the
-:class:`SocketHandler` emits an event by pickling it and sending it over the
-wire.
-
-Optimization
-------------
-
-Formatting of message arguments is deferred until it cannot be avoided.
-However, computing the arguments passed to the logging method can also be
-expensive, and you may want to avoid doing it if the logger will just throw
-away your event. To decide what to do, you can call the :meth:`isEnabledFor`
-method which takes a level argument and returns true if the event would be
-created by the Logger for that level of call. You can write code like this::
-
- if logger.isEnabledFor(logging.DEBUG):
- logger.debug("Message with %s, %s", expensive_func1(),
- expensive_func2())
-
-so that if the logger's threshold is set above ``DEBUG``, the calls to
-:func:`expensive_func1` and :func:`expensive_func2` are never made.
-
-There are other optimizations which can be made for specific applications which
-need more precise control over what logging information is collected. Here's a
-list of things you can do to avoid processing during logging which you don't
-need:
-
-+-----------------------------------------------+----------------------------------------+
-| What you don't want to collect | How to avoid collecting it |
-+===============================================+========================================+
-| Information about where calls were made from. | Set ``logging._srcfile`` to ``None``. |
-+-----------------------------------------------+----------------------------------------+
-| Threading information. | Set ``logging.logThreads`` to ``0``. |
-+-----------------------------------------------+----------------------------------------+
-| Process information. | Set ``logging.logProcesses`` to ``0``. |
-+-----------------------------------------------+----------------------------------------+
-
-Also note that the core logging module only includes the basic handlers. If
-you don't import :mod:`logging.handlers` and :mod:`logging.config`, they won't
-take up any memory.
.. _handler:
@@ -1749,643 +379,7 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call
is intended to be implemented by subclasses and so raises a
:exc:`NotImplementedError`.
-
-.. _stream-handler:
-
-StreamHandler
-^^^^^^^^^^^^^
-
-The :class:`StreamHandler` class, located in the core :mod:`logging` package,
-sends logging output to streams such as *sys.stdout*, *sys.stderr* or any
-file-like object (or, more precisely, any object which supports :meth:`write`
-and :meth:`flush` methods).
-
-
-.. currentmodule:: logging
-
-.. class:: StreamHandler(stream=None)
-
- Returns a new instance of the :class:`StreamHandler` class. If *stream* is
- specified, the instance will use it for logging output; otherwise, *sys.stderr*
- will be used.
-
-
- .. method:: emit(record)
-
- If a formatter is specified, it is used to format the record. The record
- is then written to the stream with a trailing newline. If exception
- information is present, it is formatted using
- :func:`traceback.print_exception` and appended to the stream.
-
-
- .. method:: flush()
-
- Flushes the stream by calling its :meth:`flush` method. Note that the
- :meth:`close` method is inherited from :class:`Handler` and so does
- no output, so an explicit :meth:`flush` call may be needed at times.
-
-
-.. _file-handler:
-
-FileHandler
-^^^^^^^^^^^
-
-The :class:`FileHandler` class, located in the core :mod:`logging` package,
-sends logging output to a disk file. It inherits the output functionality from
-:class:`StreamHandler`.
-
-
-.. class:: FileHandler(filename, mode='a', encoding=None, delay=0)
-
- Returns a new instance of the :class:`FileHandler` class. The specified file is
- opened and used as the stream for logging. If *mode* is not specified,
- :const:`'a'` is used. If *encoding* is not *None*, it is used to open the file
- with that encoding. If *delay* is true, then file opening is deferred until the
- first call to :meth:`emit`. By default, the file grows indefinitely.
-
-
- .. method:: close()
-
- Closes the file.
-
-
- .. method:: emit(record)
-
- Outputs the record to the file.
-
-
-.. _null-handler:
-
-NullHandler
-^^^^^^^^^^^
-
-.. versionadded:: 3.1
-
-The :class:`NullHandler` class, located in the core :mod:`logging` package,
-does not do any formatting or output. It is essentially a "no-op" handler
-for use by library developers.
-
-.. class:: NullHandler()
-
- Returns a new instance of the :class:`NullHandler` class.
-
- .. method:: emit(record)
-
- This method does nothing.
-
-See :ref:`library-config` for more information on how to use
-:class:`NullHandler`.
-
-.. _watched-file-handler:
-
-WatchedFileHandler
-^^^^^^^^^^^^^^^^^^
-
-.. currentmodule:: logging.handlers
-
-The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
-module, is a :class:`FileHandler` which watches the file it is logging to. If
-the file changes, it is closed and reopened using the file name.
-
-A file change can happen because of usage of programs such as *newsyslog* and
-*logrotate* which perform log file rotation. This handler, intended for use
-under Unix/Linux, watches the file to see if it has changed since the last emit.
-(A file is deemed to have changed if its device or inode have changed.) If the
-file has changed, the old file stream is closed, and the file opened to get a
-new stream.
-
-This handler is not appropriate for use under Windows, because under Windows
-open log files cannot be moved or renamed - logging opens the files with
-exclusive locks - and so there is no need for such a handler. Furthermore,
-*ST_INO* is not supported under Windows; :func:`stat` always returns zero for
-this value.
-
-
-.. class:: WatchedFileHandler(filename[,mode[, encoding[, delay]]])
-
- Returns a new instance of the :class:`WatchedFileHandler` class. The specified
- file is opened and used as the stream for logging. If *mode* is not specified,
- :const:`'a'` is used. If *encoding* is not *None*, it is used to open the file
- with that encoding. If *delay* is true, then file opening is deferred until the
- first call to :meth:`emit`. By default, the file grows indefinitely.
-
-
- .. method:: emit(record)
-
- Outputs the record to the file, but first checks to see if the file has
- changed. If it has, the existing stream is flushed and closed and the
- file opened again, before outputting the record to the file.
-
-.. _rotating-file-handler:
-
-RotatingFileHandler
-^^^^^^^^^^^^^^^^^^^
-
-The :class:`RotatingFileHandler` class, located in the :mod:`logging.handlers`
-module, supports rotation of disk log files.
-
-
-.. class:: RotatingFileHandler(filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=0)
-
- Returns a new instance of the :class:`RotatingFileHandler` class. The specified
- file is opened and used as the stream for logging. If *mode* is not specified,
- ``'a'`` is used. If *encoding* is not *None*, it is used to open the file
- with that encoding. If *delay* is true, then file opening is deferred until the
- first call to :meth:`emit`. By default, the file grows indefinitely.
-
- You can use the *maxBytes* and *backupCount* values to allow the file to
- :dfn:`rollover` at a predetermined size. When the size is about to be exceeded,
- the file is closed and a new file is silently opened for output. Rollover occurs
- whenever the current log file is nearly *maxBytes* in length; if *maxBytes* is
- zero, rollover never occurs. If *backupCount* is non-zero, the system will save
- old log files by appending the extensions ".1", ".2" etc., to the filename. For
- example, with a *backupCount* of 5 and a base file name of :file:`app.log`, you
- would get :file:`app.log`, :file:`app.log.1`, :file:`app.log.2`, up to
- :file:`app.log.5`. The file being written to is always :file:`app.log`. When
- this file is filled, it is closed and renamed to :file:`app.log.1`, and if files
- :file:`app.log.1`, :file:`app.log.2`, etc. exist, then they are renamed to
- :file:`app.log.2`, :file:`app.log.3` etc. respectively.
-
-
- .. method:: doRollover()
-
- Does a rollover, as described above.
-
-
- .. method:: emit(record)
-
- Outputs the record to the file, catering for rollover as described
- previously.
-
-.. _timed-rotating-file-handler:
-
-TimedRotatingFileHandler
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-The :class:`TimedRotatingFileHandler` class, located in the
-:mod:`logging.handlers` module, supports rotation of disk log files at certain
-timed intervals.
-
-
-.. class:: TimedRotatingFileHandler(filename, when='h', interval=1, backupCount=0, encoding=None, delay=0, utc=False)
-
- Returns a new instance of the :class:`TimedRotatingFileHandler` class. The
- specified file is opened and used as the stream for logging. On rotating it also
- sets the filename suffix. Rotating happens based on the product of *when* and
- *interval*.
-
- You can use the *when* to specify the type of *interval*. The list of possible
- values is below. Note that they are not case sensitive.
-
- +----------------+-----------------------+
- | Value | Type of interval |
- +================+=======================+
- | ``'S'`` | Seconds |
- +----------------+-----------------------+
- | ``'M'`` | Minutes |
- +----------------+-----------------------+
- | ``'H'`` | Hours |
- +----------------+-----------------------+
- | ``'D'`` | Days |
- +----------------+-----------------------+
- | ``'W'`` | Week day (0=Monday) |
- +----------------+-----------------------+
- | ``'midnight'`` | Roll over at midnight |
- +----------------+-----------------------+
-
- The system will save old log files by appending extensions to the filename.
- The extensions are date-and-time based, using the strftime format
- ``%Y-%m-%d_%H-%M-%S`` or a leading portion thereof, depending on the
- rollover interval.
-
- When computing the next rollover time for the first time (when the handler
- is created), the last modification time of an existing log file, or else
- the current time, is used to compute when the next rotation will occur.
-
- If the *utc* argument is true, times in UTC will be used; otherwise
- local time is used.
-
- If *backupCount* is nonzero, at most *backupCount* files
- will be kept, and if more would be created when rollover occurs, the oldest
- one is deleted. The deletion logic uses the interval to determine which
- files to delete, so changing the interval may leave old files lying around.
-
- If *delay* is true, then file opening is deferred until the first call to
- :meth:`emit`.
-
-
- .. method:: doRollover()
-
- Does a rollover, as described above.
-
-
- .. method:: emit(record)
-
- Outputs the record to the file, catering for rollover as described above.
-
-
-.. _socket-handler:
-
-SocketHandler
-^^^^^^^^^^^^^
-
-The :class:`SocketHandler` class, located in the :mod:`logging.handlers` module,
-sends logging output to a network socket. The base class uses a TCP socket.
-
-
-.. class:: SocketHandler(host, port)
-
- Returns a new instance of the :class:`SocketHandler` class intended to
- communicate with a remote machine whose address is given by *host* and *port*.
-
-
- .. method:: close()
-
- Closes the socket.
-
-
- .. method:: emit()
-
- Pickles the record's attribute dictionary and writes it to the socket in
- binary format. If there is an error with the socket, silently drops the
- packet. If the connection was previously lost, re-establishes the
- connection. To unpickle the record at the receiving end into a
- :class:`LogRecord`, use the :func:`makeLogRecord` function.
-
-
- .. method:: handleError()
-
- Handles an error which has occurred during :meth:`emit`. The most likely
- cause is a lost connection. Closes the socket so that we can retry on the
- next event.
-
-
- .. method:: makeSocket()
-
- This is a factory method which allows subclasses to define the precise
- type of socket they want. The default implementation creates a TCP socket
- (:const:`socket.SOCK_STREAM`).
-
-
- .. method:: makePickle(record)
-
- Pickles the record's attribute dictionary in binary format with a length
- prefix, and returns it ready for transmission across the socket.
-
- Note that pickles aren't completely secure. If you are concerned about
- security, you may want to override this method to implement a more secure
- mechanism. For example, you can sign pickles using HMAC and then verify
- them on the receiving end, or alternatively you can disable unpickling of
- global objects on the receiving end.
-
- .. method:: send(packet)
-
- Send a pickled string *packet* to the socket. This function allows for
- partial sends which can happen when the network is busy.
-
-
-.. _datagram-handler:
-
-DatagramHandler
-^^^^^^^^^^^^^^^
-
-The :class:`DatagramHandler` class, located in the :mod:`logging.handlers`
-module, inherits from :class:`SocketHandler` to support sending logging messages
-over UDP sockets.
-
-
-.. class:: DatagramHandler(host, port)
-
- Returns a new instance of the :class:`DatagramHandler` class intended to
- communicate with a remote machine whose address is given by *host* and *port*.
-
-
- .. method:: emit()
-
- Pickles the record's attribute dictionary and writes it to the socket in
- binary format. If there is an error with the socket, silently drops the
- packet. To unpickle the record at the receiving end into a
- :class:`LogRecord`, use the :func:`makeLogRecord` function.
-
-
- .. method:: makeSocket()
-
- The factory method of :class:`SocketHandler` is here overridden to create
- a UDP socket (:const:`socket.SOCK_DGRAM`).
-
-
- .. method:: send(s)
-
- Send a pickled string to a socket.
-
-
-.. _syslog-handler:
-
-SysLogHandler
-^^^^^^^^^^^^^
-
-The :class:`SysLogHandler` class, located in the :mod:`logging.handlers` module,
-supports sending logging messages to a remote or local Unix syslog.
-
-
-.. class:: SysLogHandler(address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER)
-
- Returns a new instance of the :class:`SysLogHandler` class intended to
- communicate with a remote Unix machine whose address is given by *address* in
- the form of a ``(host, port)`` tuple. If *address* is not specified,
- ``('localhost', 514)`` is used. The address is used to open a UDP socket. An
- alternative to providing a ``(host, port)`` tuple is providing an address as a
- string, for example "/dev/log". In this case, a Unix domain socket is used to
- send the message to the syslog. If *facility* is not specified,
- :const:`LOG_USER` is used.
-
-
- .. method:: close()
-
- Closes the socket to the remote host.
-
-
- .. method:: emit(record)
-
- The record is formatted, and then sent to the syslog server. If exception
- information is present, it is *not* sent to the server.
-
-
- .. method:: encodePriority(facility, priority)
-
- Encodes the facility and priority into an integer. You can pass in strings
- or integers - if strings are passed, internal mapping dictionaries are
- used to convert them to integers.
-
- The symbolic ``LOG_`` values are defined in :class:`SysLogHandler` and
- mirror the values defined in the ``sys/syslog.h`` header file.
-
- **Priorities**
-
- +--------------------------+---------------+
- | Name (string) | Symbolic value|
- +==========================+===============+
- | ``alert`` | LOG_ALERT |
- +--------------------------+---------------+
- | ``crit`` or ``critical`` | LOG_CRIT |
- +--------------------------+---------------+
- | ``debug`` | LOG_DEBUG |
- +--------------------------+---------------+
- | ``emerg`` or ``panic`` | LOG_EMERG |
- +--------------------------+---------------+
- | ``err`` or ``error`` | LOG_ERR |
- +--------------------------+---------------+
- | ``info`` | LOG_INFO |
- +--------------------------+---------------+
- | ``notice`` | LOG_NOTICE |
- +--------------------------+---------------+
- | ``warn`` or ``warning`` | LOG_WARNING |
- +--------------------------+---------------+
-
- **Facilities**
-
- +---------------+---------------+
- | Name (string) | Symbolic value|
- +===============+===============+
- | ``auth`` | LOG_AUTH |
- +---------------+---------------+
- | ``authpriv`` | LOG_AUTHPRIV |
- +---------------+---------------+
- | ``cron`` | LOG_CRON |
- +---------------+---------------+
- | ``daemon`` | LOG_DAEMON |
- +---------------+---------------+
- | ``ftp`` | LOG_FTP |
- +---------------+---------------+
- | ``kern`` | LOG_KERN |
- +---------------+---------------+
- | ``lpr`` | LOG_LPR |
- +---------------+---------------+
- | ``mail`` | LOG_MAIL |
- +---------------+---------------+
- | ``news`` | LOG_NEWS |
- +---------------+---------------+
- | ``syslog`` | LOG_SYSLOG |
- +---------------+---------------+
- | ``user`` | LOG_USER |
- +---------------+---------------+
- | ``uucp`` | LOG_UUCP |
- +---------------+---------------+
- | ``local0`` | LOG_LOCAL0 |
- +---------------+---------------+
- | ``local1`` | LOG_LOCAL1 |
- +---------------+---------------+
- | ``local2`` | LOG_LOCAL2 |
- +---------------+---------------+
- | ``local3`` | LOG_LOCAL3 |
- +---------------+---------------+
- | ``local4`` | LOG_LOCAL4 |
- +---------------+---------------+
- | ``local5`` | LOG_LOCAL5 |
- +---------------+---------------+
- | ``local6`` | LOG_LOCAL6 |
- +---------------+---------------+
- | ``local7`` | LOG_LOCAL7 |
- +---------------+---------------+
-
- .. method:: mapPriority(levelname)
-
- Maps a logging level name to a syslog priority name.
- You may need to override this if you are using custom levels, or
- if the default algorithm is not suitable for your needs. The
- default algorithm maps ``DEBUG``, ``INFO``, ``WARNING``, ``ERROR`` and
- ``CRITICAL`` to the equivalent syslog names, and all other level
- names to "warning".
-
-.. _nt-eventlog-handler:
-
-NTEventLogHandler
-^^^^^^^^^^^^^^^^^
-
-The :class:`NTEventLogHandler` class, located in the :mod:`logging.handlers`
-module, supports sending logging messages to a local Windows NT, Windows 2000 or
-Windows XP event log. Before you can use it, you need Mark Hammond's Win32
-extensions for Python installed.
-
-
-.. class:: NTEventLogHandler(appname, dllname=None, logtype='Application')
-
- Returns a new instance of the :class:`NTEventLogHandler` class. The *appname* is
- used to define the application name as it appears in the event log. An
- appropriate registry entry is created using this name. The *dllname* should give
- the fully qualified pathname of a .dll or .exe which contains message
- definitions to hold in the log (if not specified, ``'win32service.pyd'`` is used
- - this is installed with the Win32 extensions and contains some basic
- placeholder message definitions. Note that use of these placeholders will make
- your event logs big, as the entire message source is held in the log. If you
- want slimmer logs, you have to pass in the name of your own .dll or .exe which
- contains the message definitions you want to use in the event log). The
- *logtype* is one of ``'Application'``, ``'System'`` or ``'Security'``, and
- defaults to ``'Application'``.
-
-
- .. method:: close()
-
- At this point, you can remove the application name from the registry as a
- source of event log entries. However, if you do this, you will not be able
- to see the events as you intended in the Event Log Viewer - it needs to be
- able to access the registry to get the .dll name. The current version does
- not do this.
-
-
- .. method:: emit(record)
-
- Determines the message ID, event category and event type, and then logs
- the message in the NT event log.
-
-
- .. method:: getEventCategory(record)
-
- Returns the event category for the record. Override this if you want to
- specify your own categories. This version returns 0.
-
-
- .. method:: getEventType(record)
-
- Returns the event type for the record. Override this if you want to
- specify your own types. This version does a mapping using the handler's
- typemap attribute, which is set up in :meth:`__init__` to a dictionary
- which contains mappings for :const:`DEBUG`, :const:`INFO`,
- :const:`WARNING`, :const:`ERROR` and :const:`CRITICAL`. If you are using
- your own levels, you will either need to override this method or place a
- suitable dictionary in the handler's *typemap* attribute.
-
-
- .. method:: getMessageID(record)
-
- Returns the message ID for the record. If you are using your own messages,
- you could do this by having the *msg* passed to the logger being an ID
- rather than a format string. Then, in here, you could use a dictionary
- lookup to get the message ID. This version returns 1, which is the base
- message ID in :file:`win32service.pyd`.
-
-.. _smtp-handler:
-
-SMTPHandler
-^^^^^^^^^^^
-
-The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` module,
-supports sending logging messages to an email address via SMTP.
-
-
-.. class:: SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None)
-
- Returns a new instance of the :class:`SMTPHandler` class. The instance is
- initialized with the from and to addresses and subject line of the email. The
- *toaddrs* should be a list of strings. To specify a non-standard SMTP port, use
- the (host, port) tuple format for the *mailhost* argument. If you use a string,
- the standard SMTP port is used. If your SMTP server requires authentication, you
- can specify a (username, password) tuple for the *credentials* argument.
-
-
- .. method:: emit(record)
-
- Formats the record and sends it to the specified addressees.
-
-
- .. method:: getSubject(record)
-
- If you want to specify a subject line which is record-dependent, override
- this method.
-
-.. _memory-handler:
-
-MemoryHandler
-^^^^^^^^^^^^^
-
-The :class:`MemoryHandler` class, located in the :mod:`logging.handlers` module,
-supports buffering of logging records in memory, periodically flushing them to a
-:dfn:`target` handler. Flushing occurs whenever the buffer is full, or when an
-event of a certain severity or greater is seen.
-
-:class:`MemoryHandler` is a subclass of the more general
-:class:`BufferingHandler`, which is an abstract class. This buffers logging
-records in memory. Whenever each record is added to the buffer, a check is made
-by calling :meth:`shouldFlush` to see if the buffer should be flushed. If it
-should, then :meth:`flush` is expected to do the needful.
-
-
-.. class:: BufferingHandler(capacity)
-
- Initializes the handler with a buffer of the specified capacity.
-
-
- .. method:: emit(record)
-
- Appends the record to the buffer. If :meth:`shouldFlush` returns true,
- calls :meth:`flush` to process the buffer.
-
-
- .. method:: flush()
-
- You can override this to implement custom flushing behavior. This version
- just zaps the buffer to empty.
-
-
- .. method:: shouldFlush(record)
-
- Returns true if the buffer is up to capacity. This method can be
- overridden to implement custom flushing strategies.
-
-
-.. class:: MemoryHandler(capacity, flushLevel=ERROR, target=None)
-
- Returns a new instance of the :class:`MemoryHandler` class. The instance is
- initialized with a buffer size of *capacity*. If *flushLevel* is not specified,
- :const:`ERROR` is used. If no *target* is specified, the target will need to be
- set using :meth:`setTarget` before this handler does anything useful.
-
-
- .. method:: close()
-
- Calls :meth:`flush`, sets the target to :const:`None` and clears the
- buffer.
-
-
- .. method:: flush()
-
- For a :class:`MemoryHandler`, flushing means just sending the buffered
- records to the target, if there is one. Override if you want different
- behavior.
-
-
- .. method:: setTarget(target)
-
- Sets the target handler for this handler.
-
-
- .. method:: shouldFlush(record)
-
- Checks for buffer full or a record at the *flushLevel* or higher.
-
-
-.. _http-handler:
-
-HTTPHandler
-^^^^^^^^^^^
-
-The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` module,
-supports sending logging messages to a Web server, using either ``GET`` or
-``POST`` semantics.
-
-
-.. class:: HTTPHandler(host, url, method='GET')
-
- Returns a new instance of the :class:`HTTPHandler` class. The instance is
- initialized with a host address, url and HTTP method. The *host* can be of the
- form ``host:port``, should you need to use a specific port number. If no
- *method* is specified, ``GET`` is used.
-
-
- .. method:: emit(record)
-
- Sends the record to the Web server as a percent-encoded dictionary.
-
+For a list of handlers included as standard, see :mod:`logging.handlers`.
.. _formatter-objects:
@@ -2394,7 +388,7 @@ Formatter Objects
.. currentmodule:: logging
-:class:`Formatter`\ s have the following attributes and methods. They are
+:class:`Formatter` objects have the following attributes and methods. They are
responsible for converting a :class:`LogRecord` to (usually) a string which can
be interpreted by either a human or an external system. The base
:class:`Formatter` allows a formatting string to be specified. If none is
@@ -2407,64 +401,11 @@ into a :class:`LogRecord`'s *message* attribute. This format string contains
standard Python %-style mapping keys. See section :ref:`old-string-formatting`
for more information on string formatting.
-Currently, the useful mapping keys in a :class:`LogRecord` are:
-
-+-------------------------+-----------------------------------------------+
-| Format | Description |
-+=========================+===============================================+
-| ``%(name)s`` | Name of the logger (logging channel). |
-+-------------------------+-----------------------------------------------+
-| ``%(levelno)s`` | Numeric logging level for the message |
-| | (:const:`DEBUG`, :const:`INFO`, |
-| | :const:`WARNING`, :const:`ERROR`, |
-| | :const:`CRITICAL`). |
-+-------------------------+-----------------------------------------------+
-| ``%(levelname)s`` | Text logging level for the message |
-| | (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, |
-| | ``'ERROR'``, ``'CRITICAL'``). |
-+-------------------------+-----------------------------------------------+
-| ``%(pathname)s`` | Full pathname of the source file where the |
-| | logging call was issued (if available). |
-+-------------------------+-----------------------------------------------+
-| ``%(filename)s`` | Filename portion of pathname. |
-+-------------------------+-----------------------------------------------+
-| ``%(module)s`` | Module (name portion of filename). |
-+-------------------------+-----------------------------------------------+
-| ``%(funcName)s`` | Name of function containing the logging call. |
-+-------------------------+-----------------------------------------------+
-| ``%(lineno)d`` | Source line number where the logging call was |
-| | issued (if available). |
-+-------------------------+-----------------------------------------------+
-| ``%(created)f`` | Time when the :class:`LogRecord` was created |
-| | (as returned by :func:`time.time`). |
-+-------------------------+-----------------------------------------------+
-| ``%(relativeCreated)d`` | Time in milliseconds when the LogRecord was |
-| | created, relative to the time the logging |
-| | module was loaded. |
-+-------------------------+-----------------------------------------------+
-| ``%(asctime)s`` | Human-readable time when the |
-| | :class:`LogRecord` was created. By default |
-| | this is of the form "2003-07-08 16:49:45,896" |
-| | (the numbers after the comma are millisecond |
-| | portion of the time). |
-+-------------------------+-----------------------------------------------+
-| ``%(msecs)d`` | Millisecond portion of the time when the |
-| | :class:`LogRecord` was created. |
-+-------------------------+-----------------------------------------------+
-| ``%(thread)d`` | Thread ID (if available). |
-+-------------------------+-----------------------------------------------+
-| ``%(threadName)s`` | Thread name (if available). |
-+-------------------------+-----------------------------------------------+
-| ``%(process)d`` | Process ID (if available). |
-+-------------------------+-----------------------------------------------+
-| ``%(processName)s`` | Process name (if available). |
-+-------------------------+-----------------------------------------------+
-| ``%(message)s`` | The logged message, computed as ``msg % |
-| | args``. |
-+-------------------------+-----------------------------------------------+
-
-
-.. class:: Formatter(fmt=None, datefmt=None)
+The useful mapping keys in a :class:`LogRecord` are given in the section on
+:ref:`logrecord-attributes`.
+
+
+.. class:: Formatter(fmt=None, datefmt=None, style='%')
Returns a new instance of the :class:`Formatter` class. The instance is
initialized with a format string for the message as a whole, as well as a
@@ -2472,6 +413,14 @@ Currently, the useful mapping keys in a :class:`LogRecord` are:
specified, ``'%(message)s'`` is used. If no *datefmt* is specified, the
ISO8601 date format is used.
+ The *style* parameter can be one of '%', '{' or '$' and determines how
+ the format string will be merged with its data: using one of %-formatting,
+ :meth:`str.format` or :class:`string.Template`.
+
+ .. versionchanged:: 3.2
+ The *style* parameter was added.
+
+
.. method:: format(record)
The record's attribute dictionary is used as the operand to a string
@@ -2490,6 +439,9 @@ Currently, the useful mapping keys in a :class:`LogRecord` are:
formatter to handle the event doesn't use the cached value but
recalculates it afresh.
+ If stack information is available, it's appended after the exception
+ information, using :meth:`formatStack` to transform it if necessary.
+
.. method:: formatTime(record, datefmt=None)
@@ -2509,17 +461,23 @@ Currently, the useful mapping keys in a :class:`LogRecord` are:
just uses :func:`traceback.print_exception`. The resulting string is
returned.
+ .. method:: formatStack(stack_info)
+
+ Formats the specified stack information (a string as returned by
+ :func:`traceback.print_stack`, but with the last newline removed) as a
+ string. This default implementation just returns the input value.
+
.. _filter:
Filter Objects
--------------
-:class:`Filter`\ s can be used by :class:`Handler`\ s and :class:`Logger`\ s for
-more sophisticated filtering than is provided by levels. The base filter class
-only allows events which are below a certain point in the logger hierarchy. For
-example, a filter initialized with "A.B" will allow events logged by loggers
-"A.B", "A.B.C", "A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If
-initialized with the empty string, all events are passed.
+``Filters`` can be used by ``Handlers`` and ``Loggers`` for more sophisticated
+filtering than is provided by levels. The base filter class only allows events
+which are below a certain point in the logger hierarchy. For example, a filter
+initialized with 'A.B' will allow events logged by loggers 'A.B', 'A.B.C',
+'A.B.C.D', 'A.B.D' etc. but not 'A.BB', 'B.A.B' etc. If initialized with the
+empty string, all events are passed.
.. class:: Filter(name='')
@@ -2542,6 +500,28 @@ etc.) This means that events which have been generated by descendant loggers
will not be filtered by a logger's filter setting, unless the filter has also
been applied to those descendant loggers.
+You don't actually need to subclass ``Filter``: you can pass any instance
+which has a ``filter`` method with the same semantics.
+
+.. versionchanged:: 3.2
+ You don't need to create specialized ``Filter`` classes, or use other
+ classes with a ``filter`` method: you can use a function (or other
+ callable) as a filter. The filtering logic will check to see if the filter
+ object has a ``filter`` attribute: if it does, it's assumed to be a
+ ``Filter`` and its :meth:`~Filter.filter` method is called. Otherwise, it's
+ assumed to be a callable and called with the record as the single
+ parameter. The returned value should conform to that returned by
+ :meth:`~Filter.filter`.
+
+Although filters are used primarily to filter records based on more
+sophisticated criteria than levels, they get to see every record which is
+processed by the handler or logger they're attached to: this can be useful if
+you want to do things like counting how many records were processed by a
+particular logger or handler, or adding, changing or removing attributes in
+the LogRecord being processed. Obviously changing the LogRecord needs to be
+done with some care, but it does allow the injection of contextual information
+into logs (see :ref:`filters-contextual`).
+
.. _log-record:
LogRecord Objects
@@ -2553,7 +533,7 @@ every time something is logged, and can be created manually via
wire).
-.. class:: LogRecord(name, lvl, pathname, lineno, msg, args, exc_info, func=None)
+.. class:: LogRecord(name, level, pathname, lineno, msg, args, exc_info, func=None, sinfo=None)
Contains all the information pertinent to the event being logged.
@@ -2561,49 +541,153 @@ wire).
are combined using ``msg % args`` to create the :attr:`message` field of the
record.
- .. attribute:: args
-
- Tuple of arguments to be used in formatting :attr:`msg`.
-
- .. attribute:: exc_info
-
- Exception tuple (à la `sys.exc_info`) or `None` if no exception
- information is available.
-
- .. attribute:: func
-
- Name of the function of origin (i.e. in which the logging call was made).
-
- .. attribute:: lineno
-
- Line number in the source file of origin.
-
- .. attribute:: lvl
-
- Numeric logging level.
-
- .. attribute:: message
-
- Bound to the result of :meth:`getMessage` when
- :meth:`Formatter.format(record)<Formatter.format>` is invoked.
-
- .. attribute:: msg
-
- User-supplied :ref:`format string<string-formatting>` or arbitrary object
- (see :ref:`arbitrary-object-messages`) used in :meth:`getMessage`.
-
- .. attribute:: name
-
- Name of the logger that emitted the record.
-
- .. attribute:: pathname
-
- Absolute pathname of the source file of origin.
+ :param name: The name of the logger used to log the event represented by
+ this LogRecord.
+ :param level: The numeric level of the logging event (one of DEBUG, INFO etc.)
+ :param pathname: The full pathname of the source file where the logging call
+ was made.
+ :param lineno: The line number in the source file where the logging call was
+ made.
+ :param msg: The event description message, possibly a format string with
+ placeholders for variable data.
+ :param args: Variable data to merge into the *msg* argument to obtain the
+ event description.
+ :param exc_info: An exception tuple with the current exception information,
+ or *None* if no exception information is available.
+ :param func: The name of the function or method from which the logging call
+ was invoked.
+ :param sinfo: A text string representing stack information from the base of
+ the stack in the current thread, up to the logging call.
.. method:: getMessage()
Returns the message for this :class:`LogRecord` instance after merging any
- user-supplied arguments with the message.
+ user-supplied arguments with the message. If the user-supplied message
+ argument to the logging call is not a string, :func:`str` is called on it to
+ convert it to a string. This allows use of user-defined classes as
+ messages, whose ``__str__`` method can return the actual format string to
+ be used.
+
+ .. versionchanged:: 3.2
+ The creation of a ``LogRecord`` has been made more configurable by
+ providing a factory which is used to create the record. The factory can be
+ set using :func:`getLogRecordFactory` and :func:`setLogRecordFactory`
+ (see this for the factory's signature).
+
+ This functionality can be used to inject your own values into a
+ LogRecord at creation time. You can use the following pattern::
+
+ old_factory = logging.getLogRecordFactory()
+
+ def record_factory(*args, **kwargs):
+ record = old_factory(*args, **kwargs)
+ record.custom_attribute = 0xdecafbad
+ return record
+
+ logging.setLogRecordFactory(record_factory)
+
+ With this pattern, multiple factories could be chained, and as long
+ as they don't overwrite each other's attributes or unintentionally
+ overwrite the standard attributes listed above, there should be no
+ surprises.
+
+
+.. _logrecord-attributes:
+
+LogRecord attributes
+--------------------
+
+The LogRecord has a number of attributes, most of which are derived from the
+parameters to the constructor. (Note that the names do not always correspond
+exactly between the LogRecord constructor parameters and the LogRecord
+attributes.) These attributes can be used to merge data from the record into
+the format string. The following table lists (in alphabetical order) the
+attribute names, their meanings and the corresponding placeholder in a %-style
+format string.
+
+If you are using {}-formatting (:func:`str.format`), you can use
+``{attrname}`` as the placeholder in the format string. If you are using
+$-formatting (:class:`string.Template`), use the form ``${attrname}``. In
+both cases, of course, replace ``attrname`` with the actual attribute name
+you want to use.
+
+In the case of {}-formatting, you can specify formatting flags by placing them
+after the attribute name, separated from it with a colon. For example: a
+placeholder of ``{msecs:03d}`` would format a millisecond value of ``4`` as
+``004``. Refer to the :meth:`str.format` documentation for full details on
+the options available to you.
+
++----------------+-------------------------+-----------------------------------------------+
+| Attribute name | Format | Description |
++================+=========================+===============================================+
+| args | You shouldn't need to | The tuple of arguments merged into ``msg`` to |
+| | format this yourself. | produce ``message``. |
++----------------+-------------------------+-----------------------------------------------+
+| asctime | ``%(asctime)s`` | Human-readable time when the |
+| | | :class:`LogRecord` was created. By default |
+| | | this is of the form '2003-07-08 16:49:45,896' |
+| | | (the numbers after the comma are millisecond |
+| | | portion of the time). |
++----------------+-------------------------+-----------------------------------------------+
+| created | ``%(created)f`` | Time when the :class:`LogRecord` was created |
+| | | (as returned by :func:`time.time`). |
++----------------+-------------------------+-----------------------------------------------+
+| exc_info | You shouldn't need to | Exception tuple (à la ``sys.exc_info``) or, |
+| | format this yourself. | if no exception has occurred, *None*. |
++----------------+-------------------------+-----------------------------------------------+
+| filename | ``%(filename)s`` | Filename portion of ``pathname``. |
++----------------+-------------------------+-----------------------------------------------+
+| funcName | ``%(funcName)s`` | Name of function containing the logging call. |
++----------------+-------------------------+-----------------------------------------------+
+| levelname | ``%(levelname)s`` | Text logging level for the message |
+| | | (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, |
+| | | ``'ERROR'``, ``'CRITICAL'``). |
++----------------+-------------------------+-----------------------------------------------+
+| levelno | ``%(levelno)s`` | Numeric logging level for the message |
+| | | (:const:`DEBUG`, :const:`INFO`, |
+| | | :const:`WARNING`, :const:`ERROR`, |
+| | | :const:`CRITICAL`). |
++----------------+-------------------------+-----------------------------------------------+
+| lineno | ``%(lineno)d`` | Source line number where the logging call was |
+| | | issued (if available). |
++----------------+-------------------------+-----------------------------------------------+
+| module | ``%(module)s`` | Module (name portion of ``filename``). |
++----------------+-------------------------+-----------------------------------------------+
+| msecs | ``%(msecs)d`` | Millisecond portion of the time when the |
+| | | :class:`LogRecord` was created. |
++----------------+-------------------------+-----------------------------------------------+
+| message | ``%(message)s`` | The logged message, computed as ``msg % |
+| | | args``. This is set when |
+| | | :meth:`Formatter.format` is invoked. |
++----------------+-------------------------+-----------------------------------------------+
+| msg | You shouldn't need to | The format string passed in the original |
+| | format this yourself. | logging call. Merged with ``args`` to |
+| | | produce ``message``, or an arbitrary object |
+| | | (see :ref:`arbitrary-object-messages`). |
++----------------+-------------------------+-----------------------------------------------+
+| name | ``%(name)s`` | Name of the logger used to log the call. |
++----------------+-------------------------+-----------------------------------------------+
+| pathname | ``%(pathname)s`` | Full pathname of the source file where the |
+| | | logging call was issued (if available). |
++----------------+-------------------------+-----------------------------------------------+
+| process | ``%(process)d`` | Process ID (if available). |
++----------------+-------------------------+-----------------------------------------------+
+| processName | ``%(processName)s`` | Process name (if available). |
++----------------+-------------------------+-----------------------------------------------+
+| relativeCreated| ``%(relativeCreated)d`` | Time in milliseconds when the LogRecord was |
+| | | created, relative to the time the logging |
+| | | module was loaded. |
++----------------+-------------------------+-----------------------------------------------+
+| stack_info | You shouldn't need to | Stack frame information (where available) |
+| | format this yourself. | from the bottom of the stack in the current |
+| | | thread, up to and including the stack frame |
+| | | of the logging call which resulted in the |
+| | | creation of this record. |
++----------------+-------------------------+-----------------------------------------------+
+| thread | ``%(thread)d`` | Thread ID (if available). |
++----------------+-------------------------+-----------------------------------------------+
+| threadName | ``%(threadName)s`` | Thread name (if available). |
++----------------+-------------------------+-----------------------------------------------+
.. _logger-adapter:
@@ -2615,7 +699,6 @@ LoggerAdapter Objects
information into logging calls. For a usage example , see the section on
:ref:`adding contextual information to your logging output <context-info>`.
-
.. class:: LoggerAdapter(logger, extra)
Returns an instance of :class:`LoggerAdapter` initialized with an
@@ -2629,14 +712,18 @@ information into logging calls. For a usage example , see the section on
'extra'. The return value is a (*msg*, *kwargs*) tuple which has the
(possibly modified) versions of the arguments passed in.
-In addition to the above, :class:`LoggerAdapter` supports all the logging
+In addition to the above, :class:`LoggerAdapter` supports the following
methods of :class:`Logger`, i.e. :meth:`debug`, :meth:`info`, :meth:`warning`,
-:meth:`error`, :meth:`exception`, :meth:`critical` and :meth:`log`. These
-methods have the same signatures as their counterparts in :class:`Logger`, so
-you can use the two types of instances interchangeably.
+:meth:`error`, :meth:`exception`, :meth:`critical`, :meth:`log`,
+:meth:`isEnabledFor`, :meth:`getEffectiveLevel`, :meth:`setLevel`,
+:meth:`hasHandlers`. These methods have the same signatures as their
+counterparts in :class:`Logger`, so you can use the two types of instances
+interchangeably.
- The :meth:`isEnabledFor` method was added to :class:`LoggerAdapter`. This
- method delegates to the underlying logger.
+.. versionchanged:: 3.2
+ The :meth:`isEnabledFor`, :meth:`getEffectiveLevel`, :meth:`setLevel` and
+ :meth:`hasHandlers` methods were added to :class:`LoggerAdapter`. These
+ methods delegate to the underlying logger.
Thread Safety
@@ -2652,401 +739,338 @@ module, you may not be able to use logging from within such handlers. This is
because lock implementations in the :mod:`threading` module are not always
re-entrant, and so cannot be invoked from such signal handlers.
-Configuration
--------------
+
+Module-Level Functions
+----------------------
+
+In addition to the classes described above, there are a number of module- level
+functions.
-.. _logging-config-api:
+.. function:: getLogger(name=None)
-Configuration functions
-^^^^^^^^^^^^^^^^^^^^^^^
+ Return a logger with the specified name or, if name is ``None``, return a
+ logger which is the root logger of the hierarchy. If specified, the name is
+ typically a dot-separated hierarchical name like *'a'*, *'a.b'* or *'a.b.c.d'*.
+ Choice of these names is entirely up to the developer who is using logging.
+
+ All calls to this function with a given name return the same logger instance.
+ This means that logger instances never need to be passed between different parts
+ of an application.
-The following functions configure the logging module. They are located in the
-:mod:`logging.config` module. Their use is optional --- you can configure the
-logging module using these functions or by making calls to the main API (defined
-in :mod:`logging` itself) and defining handlers which are declared either in
-:mod:`logging` or :mod:`logging.handlers`.
+.. function:: getLoggerClass()
-.. function:: fileConfig(fname, defaults=None, disable_existing_loggers=True)
+ Return either the standard :class:`Logger` class, or the last class passed to
+ :func:`setLoggerClass`. This function may be called from within a new class
+ definition, to ensure that installing a customised :class:`Logger` class will
+ not undo customisations already applied by other code. For example::
- Reads the logging configuration from a :mod:`configparser`\-format file named
- *fname*. This function can be called several times from an application,
- allowing an end user the ability to select from various pre-canned
- configurations (if the developer provides a mechanism to present the choices
- and load the chosen configuration). Defaults to be passed to the ConfigParser
- can be specified in the *defaults* argument.
+ class MyLogger(logging.getLoggerClass()):
+ # ... override behaviour here
- If *disable_existing_loggers* is true, any existing loggers that are not
- children of named loggers will be disabled.
+.. function:: getLogRecordFactory()
-.. function:: listen(port=DEFAULT_LOGGING_CONFIG_PORT)
+ Return a callable which is used to create a :class:`LogRecord`.
- Starts up a socket server on the specified port, and listens for new
- configurations. If no port is specified, the module's default
- :const:`DEFAULT_LOGGING_CONFIG_PORT` is used. Logging configurations will be
- sent as a file suitable for processing by :func:`fileConfig`. Returns a
- :class:`Thread` instance on which you can call :meth:`start` to start the
- server, and which you can :meth:`join` when appropriate. To stop the server,
- call :func:`stopListening`.
+ .. versionadded:: 3.2
+ This function has been provided, along with :func:`setLogRecordFactory`,
+ to allow developers more control over how the :class:`LogRecord`
+ representing a logging event is constructed.
- To send a configuration to the socket, read in the configuration file and
- send it to the socket as a string of bytes preceded by a four-byte length
- string packed in binary using ``struct.pack('>L', n)``.
+ See :func:`setLogRecordFactory` for more information about the how the
+ factory is called.
+.. function:: debug(msg, *args, **kwargs)
-.. function:: stopListening()
+ Logs a message with level :const:`DEBUG` on the root logger. The *msg* is the
+ message format string, and the *args* are the arguments which are merged into
+ *msg* using the string formatting operator. (Note that this means that you can
+ use keywords in the format string, together with a single dictionary argument.)
- Stops the listening server which was created with a call to :func:`listen`.
- This is typically called before calling :meth:`join` on the return value from
- :func:`listen`.
+ There are three keyword arguments in *kwargs* which are inspected: *exc_info*
+ which, if it does not evaluate as false, causes exception information to be
+ added to the logging message. If an exception tuple (in the format returned by
+ :func:`sys.exc_info`) is provided, it is used; otherwise, :func:`sys.exc_info`
+ is called to get the exception information.
+ The second optional keyword argument is *stack_info*, which defaults to
+ False. If specified as True, stack information is added to the logging
+ message, including the actual logging call. Note that this is not the same
+ stack information as that displayed through specifying *exc_info*: The
+ former is stack frames from the bottom of the stack up to the logging call
+ in the current thread, whereas the latter is information about stack frames
+ which have been unwound, following an exception, while searching for
+ exception handlers.
-.. _logging-config-fileformat:
+ You can specify *stack_info* independently of *exc_info*, e.g. to just show
+ how you got to a certain point in your code, even when no exceptions were
+ raised. The stack frames are printed following a header line which says::
-Configuration file format
-^^^^^^^^^^^^^^^^^^^^^^^^^
+ Stack (most recent call last):
-The configuration file format understood by :func:`fileConfig` is based on
-:mod:`configparser` functionality. The file must contain sections called
-``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the
-entities of each type which are defined in the file. For each such entity, there
-is a separate section which identifies how that entity is configured. Thus, for
-a logger named ``log01`` in the ``[loggers]`` section, the relevant
-configuration details are held in a section ``[logger_log01]``. Similarly, a
-handler called ``hand01`` in the ``[handlers]`` section will have its
-configuration held in a section called ``[handler_hand01]``, while a formatter
-called ``form01`` in the ``[formatters]`` section will have its configuration
-specified in a section called ``[formatter_form01]``. The root logger
-configuration must be specified in a section called ``[logger_root]``.
+ This mimics the `Traceback (most recent call last):` which is used when
+ displaying exception frames.
-Examples of these sections in the file are given below. ::
-
- [loggers]
- keys=root,log02,log03,log04,log05,log06,log07
-
- [handlers]
- keys=hand01,hand02,hand03,hand04,hand05,hand06,hand07,hand08,hand09
-
- [formatters]
- keys=form01,form02,form03,form04,form05,form06,form07,form08,form09
-
-The root logger must specify a level and a list of handlers. An example of a
-root logger section is given below. ::
-
- [logger_root]
- level=NOTSET
- handlers=hand01
-
-The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` or
-``NOTSET``. For the root logger only, ``NOTSET`` means that all messages will be
-logged. Level values are :func:`eval`\ uated in the context of the ``logging``
-package's namespace.
-
-The ``handlers`` entry is a comma-separated list of handler names, which must
-appear in the ``[handlers]`` section. These names must appear in the
-``[handlers]`` section and have corresponding sections in the configuration
-file.
-
-For loggers other than the root logger, some additional information is required.
-This is illustrated by the following example. ::
-
- [logger_parser]
- level=DEBUG
- handlers=hand01
- propagate=1
- qualname=compiler.parser
-
-The ``level`` and ``handlers`` entries are interpreted as for the root logger,
-except that if a non-root logger's level is specified as ``NOTSET``, the system
-consults loggers higher up the hierarchy to determine the effective level of the
-logger. The ``propagate`` entry is set to 1 to indicate that messages must
-propagate to handlers higher up the logger hierarchy from this logger, or 0 to
-indicate that messages are **not** propagated to handlers up the hierarchy. The
-``qualname`` entry is the hierarchical channel name of the logger, that is to
-say the name used by the application to get the logger.
-
-Sections which specify handler configuration are exemplified by the following.
-::
-
- [handler_hand01]
- class=StreamHandler
- level=NOTSET
- formatter=form01
- args=(sys.stdout,)
-
-The ``class`` entry indicates the handler's class (as determined by :func:`eval`
-in the ``logging`` package's namespace). The ``level`` is interpreted as for
-loggers, and ``NOTSET`` is taken to mean "log everything".
-
-The ``formatter`` entry indicates the key name of the formatter for this
-handler. If blank, a default formatter (``logging._defaultFormatter``) is used.
-If a name is specified, it must appear in the ``[formatters]`` section and have
-a corresponding section in the configuration file.
-
-The ``args`` entry, when :func:`eval`\ uated in the context of the ``logging``
-package's namespace, is the list of arguments to the constructor for the handler
-class. Refer to the constructors for the relevant handlers, or to the examples
-below, to see how typical entries are constructed. ::
-
- [handler_hand02]
- class=FileHandler
- level=DEBUG
- formatter=form02
- args=('python.log', 'w')
-
- [handler_hand03]
- class=handlers.SocketHandler
- level=INFO
- formatter=form03
- args=('localhost', handlers.DEFAULT_TCP_LOGGING_PORT)
-
- [handler_hand04]
- class=handlers.DatagramHandler
- level=WARN
- formatter=form04
- args=('localhost', handlers.DEFAULT_UDP_LOGGING_PORT)
-
- [handler_hand05]
- class=handlers.SysLogHandler
- level=ERROR
- formatter=form05
- args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER)
-
- [handler_hand06]
- class=handlers.NTEventLogHandler
- level=CRITICAL
- formatter=form06
- args=('Python Application', '', 'Application')
-
- [handler_hand07]
- class=handlers.SMTPHandler
- level=WARN
- formatter=form07
- args=('localhost', 'from@abc', ['user1@abc', 'user2@xyz'], 'Logger Subject')
-
- [handler_hand08]
- class=handlers.MemoryHandler
- level=NOTSET
- formatter=form08
- target=
- args=(10, ERROR)
-
- [handler_hand09]
- class=handlers.HTTPHandler
- level=NOTSET
- formatter=form09
- args=('localhost:9022', '/log', 'GET')
-
-Sections which specify formatter configuration are typified by the following. ::
-
- [formatter_form01]
- format=F1 %(asctime)s %(levelname)s %(message)s
- datefmt=
- class=logging.Formatter
-
-The ``format`` entry is the overall format string, and the ``datefmt`` entry is
-the :func:`strftime`\ -compatible date/time format string. If empty, the
-package substitutes ISO8601 format date/times, which is almost equivalent to
-specifying the date format string ``"%Y-%m-%d %H:%M:%S"``. The ISO8601 format
-also specifies milliseconds, which are appended to the result of using the above
-format string, with a comma separator. An example time in ISO8601 format is
-``2003-01-23 00:29:50,411``.
-
-The ``class`` entry is optional. It indicates the name of the formatter's class
-(as a dotted module and class name.) This option is useful for instantiating a
-:class:`Formatter` subclass. Subclasses of :class:`Formatter` can present
-exception tracebacks in an expanded or condensed format.
-
-
-Configuration server example
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Here is an example of a module using the logging configuration server::
-
- import logging
- import logging.config
- import time
- import os
-
- # read initial config file
- logging.config.fileConfig("logging.conf")
-
- # create and start listener on port 9999
- t = logging.config.listen(9999)
- t.start()
-
- logger = logging.getLogger("simpleExample")
-
- try:
- # loop through logging calls to see the difference
- # new configurations make, until Ctrl+C is pressed
- while True:
- logger.debug("debug message")
- logger.info("info message")
- logger.warn("warn message")
- logger.error("error message")
- logger.critical("critical message")
- time.sleep(5)
- except KeyboardInterrupt:
- # cleanup
- logging.config.stopListening()
- t.join()
-
-And here is a script that takes a filename and sends that file to the server,
-properly preceded with the binary-encoded length, as the new logging
-configuration::
-
- #!/usr/bin/env python
- import socket, sys, struct
-
- data_to_send = open(sys.argv[1], "r").read()
-
- HOST = 'localhost'
- PORT = 9999
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- print("connecting...")
- s.connect((HOST, PORT))
- print("sending config...")
- s.send(struct.pack(">L", len(data_to_send)))
- s.send(data_to_send)
- s.close()
- print("complete")
-
-
-More examples
--------------
+ The third optional keyword argument is *extra* which can be used to pass a
+ dictionary which is used to populate the __dict__ of the LogRecord created for
+ the logging event with user-defined attributes. These custom attributes can then
+ be used as you like. For example, they could be incorporated into logged
+ messages. For example::
-Multiple handlers and formatters
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Loggers are plain Python objects. The :func:`addHandler` method has no minimum
-or maximum quota for the number of handlers you may add. Sometimes it will be
-beneficial for an application to log all messages of all severities to a text
-file while simultaneously logging errors or above to the console. To set this
-up, simply configure the appropriate handlers. The logging calls in the
-application code will remain unchanged. Here is a slight modification to the
-previous simple module-based configuration example::
-
- import logging
-
- logger = logging.getLogger("simple_example")
- logger.setLevel(logging.DEBUG)
- # create file handler which logs even debug messages
- fh = logging.FileHandler("spam.log")
- fh.setLevel(logging.DEBUG)
- # create console handler with a higher log level
- ch = logging.StreamHandler()
- ch.setLevel(logging.ERROR)
- # create formatter and add it to the handlers
- formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
- ch.setFormatter(formatter)
- fh.setFormatter(formatter)
- # add the handlers to logger
- logger.addHandler(ch)
- logger.addHandler(fh)
-
- # "application" code
- logger.debug("debug message")
- logger.info("info message")
- logger.warn("warn message")
- logger.error("error message")
- logger.critical("critical message")
-
-Notice that the "application" code does not care about multiple handlers. All
-that changed was the addition and configuration of a new handler named *fh*.
-
-The ability to create new handlers with higher- or lower-severity filters can be
-very helpful when writing and testing an application. Instead of using many
-``print`` statements for debugging, use ``logger.debug``: Unlike the print
-statements, which you will have to delete or comment out later, the logger.debug
-statements can remain intact in the source code and remain dormant until you
-need them again. At that time, the only change that needs to happen is to
-modify the severity level of the logger and/or handler to debug.
-
-
-Using logging in multiple modules
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-It was mentioned above that multiple calls to
-``logging.getLogger('someLogger')`` return a reference to the same logger
-object. This is true not only within the same module, but also across modules
-as long as it is in the same Python interpreter process. It is true for
-references to the same object; additionally, application code can define and
-configure a parent logger in one module and create (but not configure) a child
-logger in a separate module, and all logger calls to the child will pass up to
-the parent. Here is a main module::
-
- import logging
- import auxiliary_module
-
- # create logger with "spam_application"
- logger = logging.getLogger("spam_application")
- logger.setLevel(logging.DEBUG)
- # create file handler which logs even debug messages
- fh = logging.FileHandler("spam.log")
- fh.setLevel(logging.DEBUG)
- # create console handler with a higher log level
- ch = logging.StreamHandler()
- ch.setLevel(logging.ERROR)
- # create formatter and add it to the handlers
- formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
- fh.setFormatter(formatter)
- ch.setFormatter(formatter)
- # add the handlers to the logger
- logger.addHandler(fh)
- logger.addHandler(ch)
-
- logger.info("creating an instance of auxiliary_module.Auxiliary")
- a = auxiliary_module.Auxiliary()
- logger.info("created an instance of auxiliary_module.Auxiliary")
- logger.info("calling auxiliary_module.Auxiliary.do_something")
- a.do_something()
- logger.info("finished auxiliary_module.Auxiliary.do_something")
- logger.info("calling auxiliary_module.some_function()")
- auxiliary_module.some_function()
- logger.info("done with auxiliary_module.some_function()")
-
-Here is the auxiliary module::
-
- import logging
-
- # create logger
- module_logger = logging.getLogger("spam_application.auxiliary")
-
- class Auxiliary:
- def __init__(self):
- self.logger = logging.getLogger("spam_application.auxiliary.Auxiliary")
- self.logger.info("creating an instance of Auxiliary")
- def do_something(self):
- self.logger.info("doing something")
- a = 1 + 1
- self.logger.info("done doing something")
-
- def some_function():
- module_logger.info("received a call to \"some_function\"")
-
-The output looks like this::
-
- 2005-03-23 23:47:11,663 - spam_application - INFO -
- creating an instance of auxiliary_module.Auxiliary
- 2005-03-23 23:47:11,665 - spam_application.auxiliary.Auxiliary - INFO -
- creating an instance of Auxiliary
- 2005-03-23 23:47:11,665 - spam_application - INFO -
- created an instance of auxiliary_module.Auxiliary
- 2005-03-23 23:47:11,668 - spam_application - INFO -
- calling auxiliary_module.Auxiliary.do_something
- 2005-03-23 23:47:11,668 - spam_application.auxiliary.Auxiliary - INFO -
- doing something
- 2005-03-23 23:47:11,669 - spam_application.auxiliary.Auxiliary - INFO -
- done doing something
- 2005-03-23 23:47:11,670 - spam_application - INFO -
- finished auxiliary_module.Auxiliary.do_something
- 2005-03-23 23:47:11,671 - spam_application - INFO -
- calling auxiliary_module.some_function()
- 2005-03-23 23:47:11,672 - spam_application.auxiliary - INFO -
- received a call to "some_function"
- 2005-03-23 23:47:11,673 - spam_application - INFO -
- done with auxiliary_module.some_function()
+ FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
+ logging.basicConfig(format=FORMAT)
+ d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
+ logging.warning('Protocol problem: %s', 'connection reset', extra=d)
+
+ would print something like::
+
+ 2006-02-08 22:20:02,165 192.168.0.1 fbloggs Protocol problem: connection reset
+
+ The keys in the dictionary passed in *extra* should not clash with the keys used
+ by the logging system. (See the :class:`Formatter` documentation for more
+ information on which keys are used by the logging system.)
+
+ If you choose to use these attributes in logged messages, you need to exercise
+ some care. In the above example, for instance, the :class:`Formatter` has been
+ set up with a format string which expects 'clientip' and 'user' in the attribute
+ dictionary of the LogRecord. If these are missing, the message will not be
+ logged because a string formatting exception will occur. So in this case, you
+ always need to pass the *extra* dictionary with these keys.
+
+ While this might be annoying, this feature is intended for use in specialized
+ circumstances, such as multi-threaded servers where the same code executes in
+ many contexts, and interesting conditions which arise are dependent on this
+ context (such as remote client IP address and authenticated user name, in the
+ above example). In such circumstances, it is likely that specialized
+ :class:`Formatter`\ s would be used with particular :class:`Handler`\ s.
+
+ .. versionadded:: 3.2
+ The *stack_info* parameter was added.
+
+.. function:: info(msg, *args, **kwargs)
+
+ Logs a message with level :const:`INFO` on the root logger. The arguments are
+ interpreted as for :func:`debug`.
+
+
+.. function:: warning(msg, *args, **kwargs)
+
+ Logs a message with level :const:`WARNING` on the root logger. The arguments are
+ interpreted as for :func:`debug`.
+
+
+.. function:: error(msg, *args, **kwargs)
+
+ Logs a message with level :const:`ERROR` on the root logger. The arguments are
+ interpreted as for :func:`debug`.
+
+
+.. function:: critical(msg, *args, **kwargs)
+
+ Logs a message with level :const:`CRITICAL` on the root logger. The arguments
+ are interpreted as for :func:`debug`.
+
+
+.. function:: exception(msg, *args)
+
+ Logs a message with level :const:`ERROR` on the root logger. The arguments are
+ interpreted as for :func:`debug`. Exception info is added to the logging
+ message. This function should only be called from an exception handler.
+
+.. function:: log(level, msg, *args, **kwargs)
+
+ Logs a message with level *level* on the root logger. The other arguments are
+ interpreted as for :func:`debug`.
+
+ PLEASE NOTE: The above module-level functions which delegate to the root
+ logger should *not* be used in threads, in versions of Python earlier than
+ 2.7.1 and 3.2, unless at least one handler has been added to the root
+ logger *before* the threads are started. These convenience functions call
+ :func:`basicConfig` to ensure that at least one handler is available; in
+ earlier versions of Python, this can (under rare circumstances) lead to
+ handlers being added multiple times to the root logger, which can in turn
+ lead to multiple messages for the same event.
+
+.. function:: disable(lvl)
+
+ Provides an overriding level *lvl* for all loggers which takes precedence over
+ the logger's own level. When the need arises to temporarily throttle logging
+ output down across the whole application, this function can be useful. Its
+ effect is to disable all logging calls of severity *lvl* and below, so that
+ if you call it with a value of INFO, then all INFO and DEBUG events would be
+ discarded, whereas those of severity WARNING and above would be processed
+ according to the logger's effective level.
+
+
+.. function:: addLevelName(lvl, levelName)
+
+ Associates level *lvl* with text *levelName* in an internal dictionary, which is
+ used to map numeric levels to a textual representation, for example when a
+ :class:`Formatter` formats a message. This function can also be used to define
+ your own levels. The only constraints are that all levels used must be
+ registered using this function, levels should be positive integers and they
+ should increase in increasing order of severity.
+
+ NOTE: If you are thinking of defining your own levels, please see the section
+ on :ref:`custom-levels`.
+
+.. function:: getLevelName(lvl)
+
+ Returns the textual representation of logging level *lvl*. If the level is one
+ of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`,
+ :const:`INFO` or :const:`DEBUG` then you get the corresponding string. If you
+ have associated levels with names using :func:`addLevelName` then the name you
+ have associated with *lvl* is returned. If a numeric value corresponding to one
+ of the defined levels is passed in, the corresponding string representation is
+ returned. Otherwise, the string 'Level %s' % lvl is returned.
+
+
+.. function:: makeLogRecord(attrdict)
+
+ Creates and returns a new :class:`LogRecord` instance whose attributes are
+ defined by *attrdict*. This function is useful for taking a pickled
+ :class:`LogRecord` attribute dictionary, sent over a socket, and reconstituting
+ it as a :class:`LogRecord` instance at the receiving end.
+
+
+.. function:: basicConfig(**kwargs)
+
+ Does basic configuration for the logging system by creating a
+ :class:`StreamHandler` with a default :class:`Formatter` and adding it to the
+ root logger. The functions :func:`debug`, :func:`info`, :func:`warning`,
+ :func:`error` and :func:`critical` will call :func:`basicConfig` automatically
+ if no handlers are defined for the root logger.
+
+ This function does nothing if the root logger already has handlers
+ configured for it.
+
+ PLEASE NOTE: This function should be called from the main thread
+ before other threads are started. In versions of Python prior to
+ 2.7.1 and 3.2, if this function is called from multiple threads,
+ it is possible (in rare circumstances) that a handler will be added
+ to the root logger more than once, leading to unexpected results
+ such as messages being duplicated in the log.
+
+ The following keyword arguments are supported.
+
+ +--------------+---------------------------------------------+
+ | Format | Description |
+ +==============+=============================================+
+ | ``filename`` | Specifies that a FileHandler be created, |
+ | | using the specified filename, rather than a |
+ | | StreamHandler. |
+ +--------------+---------------------------------------------+
+ | ``filemode`` | Specifies the mode to open the file, if |
+ | | filename is specified (if filemode is |
+ | | unspecified, it defaults to 'a'). |
+ +--------------+---------------------------------------------+
+ | ``format`` | Use the specified format string for the |
+ | | handler. |
+ +--------------+---------------------------------------------+
+ | ``datefmt`` | Use the specified date/time format. |
+ +--------------+---------------------------------------------+
+ | ``style`` | If ``format`` is specified, use this style |
+ | | for the format string. One of '%', '{' or |
+ | | '$' for %-formatting, :meth:`str.format` or |
+ | | :class:`string.Template` respectively, and |
+ | | defaulting to '%' if not specified. |
+ +--------------+---------------------------------------------+
+ | ``level`` | Set the root logger level to the specified |
+ | | level. |
+ +--------------+---------------------------------------------+
+ | ``stream`` | Use the specified stream to initialize the |
+ | | StreamHandler. Note that this argument is |
+ | | incompatible with 'filename' - if both are |
+ | | present, 'stream' is ignored. |
+ +--------------+---------------------------------------------+
+
+ .. versionchanged:: 3.2
+ The ``style`` argument was added.
+
+
+.. function:: shutdown()
+
+ Informs the logging system to perform an orderly shutdown by flushing and
+ closing all handlers. This should be called at application exit and no
+ further use of the logging system should be made after this call.
+
+
+.. function:: setLoggerClass(klass)
+
+ Tells the logging system to use the class *klass* when instantiating a logger.
+ The class should define :meth:`__init__` such that only a name argument is
+ required, and the :meth:`__init__` should call :meth:`Logger.__init__`. This
+ function is typically called before any loggers are instantiated by applications
+ which need to use custom logger behavior.
+
+
+.. function:: setLogRecordFactory(factory)
+
+ Set a callable which is used to create a :class:`LogRecord`.
+
+ :param factory: The factory callable to be used to instantiate a log record.
+
+ .. versionadded:: 3.2
+ This function has been provided, along with :func:`getLogRecordFactory`, to
+ allow developers more control over how the :class:`LogRecord` representing
+ a logging event is constructed.
+
+ The factory has the following signature:
+
+ ``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, **kwargs)``
+
+ :name: The logger name.
+ :level: The logging level (numeric).
+ :fn: The full pathname of the file where the logging call was made.
+ :lno: The line number in the file where the logging call was made.
+ :msg: The logging message.
+ :args: The arguments for the logging message.
+ :exc_info: An exception tuple, or None.
+ :func: The name of the function or method which invoked the logging
+ call.
+ :sinfo: A stack traceback such as is provided by
+ :func:`traceback.print_stack`, showing the call hierarchy.
+ :kwargs: Additional keyword arguments.
+
+
+Integration with the warnings module
+------------------------------------
+
+The :func:`captureWarnings` function can be used to integrate :mod:`logging`
+with the :mod:`warnings` module.
+
+.. function:: captureWarnings(capture)
+
+ This function is used to turn the capture of warnings by logging on and
+ off.
+
+ If *capture* is ``True``, warnings issued by the :mod:`warnings` module will
+ be redirected to the logging system. Specifically, a warning will be
+ formatted using :func:`warnings.formatwarning` and the resulting string
+ logged to a logger named 'py.warnings' with a severity of `WARNING`.
+
+ If *capture* is ``False``, the redirection of warnings to the logging system
+ will stop, and warnings will be redirected to their original destinations
+ (i.e. those in effect before `captureWarnings(True)` was called).
+
+
+.. seealso::
+
+ Module :mod:`logging.config`
+ Configuration API for the logging module.
+
+ Module :mod:`logging.handlers`
+ Useful handlers included with the logging module.
+
+ :pep:`282` - A Logging System
+ The proposal which described this feature for inclusion in the Python standard
+ library.
+
+ `Original Python logging package <http://www.red-dove.com/python_logging.html>`_
+ This is the original source for the :mod:`logging` package. The version of the
+ package available from this site is suitable for use with Python 1.5.2, 2.1.x
+ and 2.2.x, which do not include the :mod:`logging` package in the standard
+ library.
diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst
index 7409af5f15..ff8cfea403 100644
--- a/Doc/library/mailbox.rst
+++ b/Doc/library/mailbox.rst
@@ -81,13 +81,16 @@ Maildir, mbox, MH, Babyl, and MMDF.
it.
Parameter *message* may be a :class:`Message` instance, an
- :class:`email.Message.Message` instance, a string, or a file-like object
- (which should be open in text mode). If *message* is an instance of the
+ :class:`email.Message.Message` instance, a string, a byte string, or a
+ file-like object (which should be open in binary mode). If *message* is
+ an instance of the
appropriate format-specific :class:`Message` subclass (e.g., if it's an
:class:`mboxMessage` instance and this is an :class:`mbox` instance), its
format-specific information is used. Otherwise, reasonable defaults for
format-specific information are used.
+ .. versionchanged:: 3.2 support for binary input
+
.. method:: remove(key)
__delitem__(key)
@@ -108,8 +111,9 @@ Maildir, mbox, MH, Babyl, and MMDF.
:exc:`KeyError` exception if no message already corresponds to *key*.
As with :meth:`add`, parameter *message* may be a :class:`Message`
- instance, an :class:`email.Message.Message` instance, a string, or a
- file-like object (which should be open in text mode). If *message* is an
+ instance, an :class:`email.Message.Message` instance, a string, a byte
+ string, or a file-like object (which should be open in binary mode). If
+ *message* is an
instance of the appropriate format-specific :class:`Message` subclass
(e.g., if it's an :class:`mboxMessage` instance and this is an
:class:`mbox` instance), its format-specific information is
@@ -171,24 +175,40 @@ Maildir, mbox, MH, Babyl, and MMDF.
raise a :exc:`KeyError` exception if no such message exists.
+ .. method:: get_bytes(key)
+
+ Return a byte representation of the message corresponding to *key*, or
+ raise a :exc:`KeyError` exception if no such message exists.
+
+ .. versionadded:: 3.2
+
+
.. method:: get_string(key)
Return a string representation of the message corresponding to *key*, or
- raise a :exc:`KeyError` exception if no such message exists.
+ raise a :exc:`KeyError` exception if no such message exists. The
+ message is processed through :class:`email.message.Message` to
+ convert it to a 7bit clean representation.
.. method:: get_file(key)
Return a file-like representation of the message corresponding to *key*,
- or raise a :exc:`KeyError` exception if no such message exists. The
- file-like object behaves as if open in binary mode. This file should be
+ or raise a :exc:`KeyError` exception if no such message exists. The
+ file-like object behaves as if open in binary mode. This file should be
closed once it is no longer needed.
+ .. versionchanged:: 3.2
+ The file object really is a binary file; previously it was incorrectly
+ returned in text mode. Also, the file-like object now supports the
+ context manager protocol: you can use a :keyword:`with` statement to
+ automatically close it.
+
.. note::
Unlike other representations of messages, file-like representations are
not necessarily independent of the :class:`Mailbox` instance that
- created them or of the underlying mailbox. More specific documentation
+ created them or of the underlying mailbox. More specific documentation
is provided by each subclass.
@@ -452,7 +472,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
unlock()
Three locking mechanisms are used---dot locking and, if available, the
- :cfunc:`flock` and :cfunc:`lockf` system calls.
+ :c:func:`flock` and :c:func:`lockf` system calls.
.. seealso::
@@ -566,7 +586,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
unlock()
Three locking mechanisms are used---dot locking and, if available, the
- :cfunc:`flock` and :cfunc:`lockf` system calls. For MH mailboxes, locking
+ :c:func:`flock` and :c:func:`lockf` system calls. For MH mailboxes, locking
the mailbox means locking the :file:`.mh_sequences` file and, only for the
duration of any operations that affect them, locking individual message
files.
@@ -664,7 +684,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
unlock()
Three locking mechanisms are used---dot locking and, if available, the
- :cfunc:`flock` and :cfunc:`lockf` system calls.
+ :c:func:`flock` and :c:func:`lockf` system calls.
.. seealso::
@@ -715,7 +735,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
unlock()
Three locking mechanisms are used---dot locking and, if available, the
- :cfunc:`flock` and :cfunc:`lockf` system calls.
+ :c:func:`flock` and :c:func:`lockf` system calls.
.. seealso::
@@ -742,9 +762,11 @@ Maildir, mbox, MH, Babyl, and MMDF.
If *message* is omitted, the new instance is created in a default, empty state.
If *message* is an :class:`email.Message.Message` instance, its contents are
copied; furthermore, any format-specific information is converted insofar as
- possible if *message* is a :class:`Message` instance. If *message* is a string
+ possible if *message* is a :class:`Message` instance. If *message* is a string,
+ a byte string,
or a file, it should contain an :rfc:`2822`\ -compliant message, which is read
- and parsed.
+ and parsed. Files should be open in binary mode, but text mode files
+ are accepted for backward compatibility.
The format-specific state and behaviors offered by subclasses vary, but in
general it is only the properties that are not specific to a particular
diff --git a/Doc/library/mailcap.rst b/Doc/library/mailcap.rst
index 0a0a79088e..4bb31bfc05 100644
--- a/Doc/library/mailcap.rst
+++ b/Doc/library/mailcap.rst
@@ -4,6 +4,9 @@
.. module:: mailcap
:synopsis: Mailcap file handling.
+**Source code:** :source:`Lib/mailcap.py`
+
+--------------
Mailcap files are used to configure how MIME-aware applications such as mail
readers and Web browsers react to files with different MIME types. (The name
diff --git a/Doc/library/markup.rst b/Doc/library/markup.rst
index ae97b6964e..49794ef707 100644
--- a/Doc/library/markup.rst
+++ b/Doc/library/markup.rst
@@ -20,6 +20,7 @@ definition of the Python bindings for the DOM and SAX interfaces.
.. toctree::
+ html.rst
html.parser.rst
html.entities.rst
pyexpat.rst
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index c760701ef1..98c5b334fc 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -97,15 +97,23 @@ Number-theoretic and representation functions
<http://code.activestate.com/recipes/393090/>`_\.
+.. function:: isfinite(x)
+
+ Return ``True`` if *x* is neither an infinity nor a NaN, and
+ ``False`` otherwise. (Note that ``0.0`` *is* considered finite.)
+
+ .. versionadded:: 3.2
+
+
.. function:: isinf(x)
- Check if the float *x* is positive or negative infinity.
+ Return ``True`` if *x* is a positive or negative infinity, and
+ ``False`` otherwise.
.. function:: isnan(x)
- Check if the float *x* is a NaN (not a number). For more information
- on NaNs, see the IEEE 754 standards.
+ Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise.
.. function:: ldexp(x, i)
@@ -146,6 +154,22 @@ Power and logarithmic functions
Return ``e**x``.
+.. function:: expm1(x)
+
+ Return ``e**x - 1``. For small floats *x*, the subtraction in ``exp(x) - 1``
+ can result in a `significant loss of precision
+ <http://en.wikipedia.org/wiki/Loss_of_significance>`_\; the :func:`expm1`
+ function provides a way to compute this quantity to full precision::
+
+ >>> from math import exp, expm1
+ >>> exp(1e-5) - 1 # gives result accurate to 11 places
+ 1.0000050000069649e-05
+ >>> expm1(1e-5) # result accurate to full precision
+ 1.0000050000166668e-05
+
+ .. versionadded:: 3.2
+
+
.. function:: log(x[, base])
With one argument, return the natural logarithm of *x* (to base *e*).
@@ -245,6 +269,9 @@ Angular conversion
Hyperbolic functions
--------------------
+`Hyperbolic functions <http://en.wikipedia.org/wiki/Hyperbolic_function>`_
+are analogs of trigonometric functions that are based on hyperbolas
+instead of circles.
.. function:: acosh(x)
@@ -276,6 +303,52 @@ Hyperbolic functions
Return the hyperbolic tangent of *x*.
+Special functions
+-----------------
+
+.. function:: erf(x)
+
+ Return the `error function <http://en.wikipedia.org/wiki/Error_function>`_ at
+ *x*.
+
+ The :func:`erf` function can be used to compute traditional statistical
+ functions such as the `cumulative standard normal distribution
+ <http://en.wikipedia.org/wiki/Normal_distribution#Cumulative_distribution_function>`_::
+
+ def phi(x):
+ 'Cumulative distribution function for the standard normal distribution'
+ return (1.0 + erf(x / sqrt(2.0))) / 2.0
+
+ .. versionadded:: 3.2
+
+
+.. function:: erfc(x)
+
+ Return the complementary error function at *x*. The `complementary error
+ function <http://en.wikipedia.org/wiki/Error_function>`_ is defined as
+ ``1.0 - erf(x)``. It is used for large values of *x* where a subtraction
+ from one would cause a `loss of significance
+ <http://en.wikipedia.org/wiki/Loss_of_significance>`_\.
+
+ .. versionadded:: 3.2
+
+
+.. function:: gamma(x)
+
+ Return the `Gamma function <http://en.wikipedia.org/wiki/Gamma_function>`_ at
+ *x*.
+
+ .. versionadded:: 3.2
+
+
+.. function:: lgamma(x)
+
+ Return the natural logarithm of the absolute value of the Gamma
+ function at *x*.
+
+ .. versionadded:: 3.2
+
+
Constants
---------
diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst
index fe1437a85b..17b0c07ae5 100644
--- a/Doc/library/mimetypes.rst
+++ b/Doc/library/mimetypes.rst
@@ -8,6 +8,10 @@
.. index:: pair: MIME; content type
+**Source code:** :source:`Lib/mimetypes.py`
+
+--------------
+
The :mod:`mimetypes` module converts between a filename or URL and the MIME type
associated with the filename extension. Conversions are provided from filename
to MIME type and from MIME type to filename extension; encodings are not
@@ -76,9 +80,13 @@ behavior of the module.
Initialize the internal data structures. If given, *files* must be a sequence
of file names which should be used to augment the default type map. If omitted,
- the file names to use are taken from :const:`knownfiles`. Each file named in
- *files* or :const:`knownfiles` takes precedence over those named before it.
- Calling :func:`init` repeatedly is allowed.
+ the file names to use are taken from :const:`knownfiles`; on Windows, the
+ current registry settings are loaded. Each file named in *files* or
+ :const:`knownfiles` takes precedence over those named before it. Calling
+ :func:`init` repeatedly is allowed.
+
+ .. versionchanged:: 3.2
+ Previously, Windows registry settings were ignored.
.. function:: read_mime_types(filename)
@@ -228,3 +236,9 @@ MimeTypes Objects
Load MIME type information from an open file. The file must have the format of
the standard :file:`mime.types` files.
+
+.. method:: MimeTypes.read_windows_registry()
+
+ Load MIME type information from the Windows registry. Availability: Windows.
+
+ .. versionadded:: 3.2
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index e061088a69..7a901c93f7 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -115,6 +115,18 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
map.close()
+ :class:`mmap` can also be used as a context manager in a :keyword:`with`
+ statement.::
+
+ import mmap
+
+ with mmap.mmap(-1, 13) as map:
+ map.write("Hello world!")
+
+ .. versionadded:: 3.2
+ Context manager support.
+
+
The next example demonstrates how to create an anonymous map and exchange
data between the parent and child processes::
@@ -135,13 +147,19 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
Memory-mapped file objects support the following methods:
-
.. method:: close()
Close the file. Subsequent calls to other methods of the object will
result in an exception being raised.
+ .. attribute:: closed
+
+ True if the file is closed.
+
+ .. versionadded:: 3.2
+
+
.. method:: find(sub[, start[, end]])
Returns the lowest index in the object where the subsequence *sub* is
diff --git a/Doc/library/modulefinder.rst b/Doc/library/modulefinder.rst
index 41b387bb99..d42c6ab783 100644
--- a/Doc/library/modulefinder.rst
+++ b/Doc/library/modulefinder.rst
@@ -7,6 +7,9 @@
.. module:: modulefinder
:synopsis: Find modules used by a script.
+**Source code:** :source:`Lib/modulefinder.py`
+
+--------------
This module provides a :class:`ModuleFinder` class that can be used to determine
the set of modules imported by a script. ``modulefinder.py`` can also be run as
diff --git a/Doc/library/msilib.rst b/Doc/library/msilib.rst
index f27c3d803c..270f4ff9f2 100644
--- a/Doc/library/msilib.rst
+++ b/Doc/library/msilib.rst
@@ -42,7 +42,7 @@ structures.
.. function:: UuidCreate()
Return the string representation of a new unique identifier. This wraps the
- Windows API functions :cfunc:`UuidCreate` and :cfunc:`UuidToString`.
+ Windows API functions :c:func:`UuidCreate` and :c:func:`UuidToString`.
.. function:: OpenDatabase(path, persist)
@@ -58,7 +58,7 @@ structures.
.. function:: CreateRecord(count)
- Return a new record object by calling :cfunc:`MSICreateRecord`. *count* is the
+ Return a new record object by calling :c:func:`MSICreateRecord`. *count* is the
number of fields of the record.
@@ -133,20 +133,20 @@ Database Objects
.. method:: Database.OpenView(sql)
- Return a view object, by calling :cfunc:`MSIDatabaseOpenView`. *sql* is the SQL
+ Return a view object, by calling :c:func:`MSIDatabaseOpenView`. *sql* is the SQL
statement to execute.
.. method:: Database.Commit()
Commit the changes pending in the current transaction, by calling
- :cfunc:`MSIDatabaseCommit`.
+ :c:func:`MSIDatabaseCommit`.
.. method:: Database.GetSummaryInformation(count)
Return a new summary information object, by calling
- :cfunc:`MsiGetSummaryInformation`. *count* is the maximum number of updated
+ :c:func:`MsiGetSummaryInformation`. *count* is the maximum number of updated
values.
@@ -164,7 +164,7 @@ View Objects
.. method:: View.Execute(params)
- Execute the SQL query of the view, through :cfunc:`MSIViewExecute`. If
+ Execute the SQL query of the view, through :c:func:`MSIViewExecute`. If
*params* is not ``None``, it is a record describing actual values of the
parameter tokens in the query.
@@ -172,18 +172,18 @@ View Objects
.. method:: View.GetColumnInfo(kind)
Return a record describing the columns of the view, through calling
- :cfunc:`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or
+ :c:func:`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or
``MSICOLINFO_TYPES``.
.. method:: View.Fetch()
- Return a result record of the query, through calling :cfunc:`MsiViewFetch`.
+ Return a result record of the query, through calling :c:func:`MsiViewFetch`.
.. method:: View.Modify(kind, data)
- Modify the view, by calling :cfunc:`MsiViewModify`. *kind* can be one of
+ Modify the view, by calling :c:func:`MsiViewModify`. *kind* can be one of
``MSIMODIFY_SEEK``, ``MSIMODIFY_REFRESH``, ``MSIMODIFY_INSERT``,
``MSIMODIFY_UPDATE``, ``MSIMODIFY_ASSIGN``, ``MSIMODIFY_REPLACE``,
``MSIMODIFY_MERGE``, ``MSIMODIFY_DELETE``, ``MSIMODIFY_INSERT_TEMPORARY``,
@@ -195,7 +195,7 @@ View Objects
.. method:: View.Close()
- Close the view, through :cfunc:`MsiViewClose`.
+ Close the view, through :c:func:`MsiViewClose`.
.. seealso::
@@ -214,7 +214,7 @@ Summary Information Objects
.. method:: SummaryInformation.GetProperty(field)
- Return a property of the summary, through :cfunc:`MsiSummaryInfoGetProperty`.
+ Return a property of the summary, through :c:func:`MsiSummaryInfoGetProperty`.
*field* is the name of the property, and can be one of the constants
``PID_CODEPAGE``, ``PID_TITLE``, ``PID_SUBJECT``, ``PID_AUTHOR``,
``PID_KEYWORDS``, ``PID_COMMENTS``, ``PID_TEMPLATE``, ``PID_LASTAUTHOR``,
@@ -226,12 +226,12 @@ Summary Information Objects
.. method:: SummaryInformation.GetPropertyCount()
Return the number of summary properties, through
- :cfunc:`MsiSummaryInfoGetPropertyCount`.
+ :c:func:`MsiSummaryInfoGetPropertyCount`.
.. method:: SummaryInformation.SetProperty(field, value)
- Set a property through :cfunc:`MsiSummaryInfoSetProperty`. *field* can have the
+ Set a property through :c:func:`MsiSummaryInfoSetProperty`. *field* can have the
same values as in :meth:`GetProperty`, *value* is the new value of the property.
Possible value types are integer and string.
@@ -239,7 +239,7 @@ Summary Information Objects
.. method:: SummaryInformation.Persist()
Write the modified properties to the summary information stream, using
- :cfunc:`MsiSummaryInfoPersist`.
+ :c:func:`MsiSummaryInfoPersist`.
.. seealso::
@@ -258,7 +258,7 @@ Record Objects
.. method:: Record.GetFieldCount()
Return the number of fields of the record, through
- :cfunc:`MsiRecordGetFieldCount`.
+ :c:func:`MsiRecordGetFieldCount`.
.. method:: Record.GetInteger(field)
@@ -275,25 +275,25 @@ Record Objects
.. method:: Record.SetString(field, value)
- Set *field* to *value* through :cfunc:`MsiRecordSetString`. *field* must be an
+ Set *field* to *value* through :c:func:`MsiRecordSetString`. *field* must be an
integer; *value* a string.
.. method:: Record.SetStream(field, value)
Set *field* to the contents of the file named *value*, through
- :cfunc:`MsiRecordSetStream`. *field* must be an integer; *value* a string.
+ :c:func:`MsiRecordSetStream`. *field* must be an integer; *value* a string.
.. method:: Record.SetInteger(field, value)
- Set *field* to *value* through :cfunc:`MsiRecordSetInteger`. Both *field* and
+ Set *field* to *value* through :c:func:`MsiRecordSetInteger`. Both *field* and
*value* must be an integer.
.. method:: Record.ClearData()
- Set all fields of the record to 0, through :cfunc:`MsiRecordClearData`.
+ Set all fields of the record to 0, through :c:func:`MsiRecordClearData`.
.. seealso::
diff --git a/Doc/library/msvcrt.rst b/Doc/library/msvcrt.rst
index d968833251..889a0c5eb1 100644
--- a/Doc/library/msvcrt.rst
+++ b/Doc/library/msvcrt.rst
@@ -90,12 +90,12 @@ Console I/O
.. function:: getch()
- Read a keypress and return the resulting character. Nothing is echoed to the
- console. This call will block if a keypress is not already available, but will
- not wait for :kbd:`Enter` to be pressed. If the pressed key was a special
- function key, this will return ``'\000'`` or ``'\xe0'``; the next call will
- return the keycode. The :kbd:`Control-C` keypress cannot be read with this
- function.
+ Read a keypress and return the resulting character as a byte string.
+ Nothing is echoed to the console. This call will block if a keypress
+ is not already available, but will not wait for :kbd:`Enter` to be
+ pressed. If the pressed key was a special function key, this will
+ return ``'\000'`` or ``'\xe0'``; the next call will return the keycode.
+ The :kbd:`Control-C` keypress cannot be read with this function.
.. function:: getwch()
@@ -116,7 +116,7 @@ Console I/O
.. function:: putch(char)
- Print the character *char* to the console without buffering.
+ Print the byte string *char* to the console without buffering.
.. function:: putwch(unicode_char)
@@ -126,8 +126,8 @@ Console I/O
.. function:: ungetch(char)
- Cause the character *char* to be "pushed back" into the console buffer; it will
- be the next character read by :func:`getch` or :func:`getche`.
+ Cause the byte string *char* to be "pushed back" into the console buffer;
+ it will be the next character read by :func:`getch` or :func:`getche`.
.. function:: ungetwch(unicode_char)
@@ -143,5 +143,5 @@ Other Functions
.. function:: heapmin()
- Force the :cfunc:`malloc` heap to clean itself up and return unused blocks to
+ Force the :c:func:`malloc` heap to clean itself up and return unused blocks to
the operating system. On failure, this raises :exc:`IOError`.
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index cb20a5c75c..92d5272948 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -16,7 +16,7 @@ to this, the :mod:`multiprocessing` module allows the programmer to fully
leverage multiple processors on a given machine. It runs on both Unix and
Windows.
-.. warning::
+.. note::
Some of this package's functionality requires a functioning shared semaphore
implementation on the host operating system. Without one, the
@@ -120,7 +120,9 @@ processes:
print(q.get()) # prints "[42, None, 'hello']"
p.join()
- Queues are thread and process safe.
+ Queues are thread and process safe, but note that they must never
+ be instantiated as a side effect of importing a module: this can lead
+ to a deadlock! (see :ref:`threaded-imports`)
**Pipes**
@@ -406,7 +408,7 @@ The :mod:`multiprocessing` package mostly replicates the API of the
.. method:: terminate()
Terminate the process. On Unix this is done using the ``SIGTERM`` signal;
- on Windows :cfunc:`TerminateProcess` is used. Note that exit handlers and
+ on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and
finally clauses, etc., will not be executed.
Note that descendant processes of the process will *not* be terminated --
@@ -420,9 +422,9 @@ The :mod:`multiprocessing` package mostly replicates the API of the
acquired a lock or semaphore etc. then terminating it is liable to
cause other processes to deadlock.
- Note that the :meth:`start`, :meth:`join`, :meth:`is_alive` and
- :attr:`exit_code` methods should only be called by the process that created
- the process object.
+ Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`,
+ :meth:`terminate` and :attr:`exit_code` methods should only be called by
+ the process that created the process object.
Example usage of some of the methods of :class:`Process`:
@@ -1130,7 +1132,7 @@ their parent process exits. The manager classes are defined in the
Create a BaseManager object.
- Once created one should call :meth:`start` or :meth:`serve_forever` to ensure
+ Once created one should call :meth:`start` or ``get_server().serve_forever()`` to ensure
that the manager object refers to a started manager process.
*address* is the address on which the manager process listens for new
@@ -1146,10 +1148,6 @@ their parent process exits. The manager classes are defined in the
Start a subprocess to start the manager. If *initializer* is not ``None``
then the subprocess will call ``initializer(*initargs)`` when it starts.
- .. method:: serve_forever()
-
- Run the server in the current process.
-
.. method:: get_server()
Returns a :class:`Server` object which represents the actual server under
@@ -1552,7 +1550,7 @@ Process Pools
One can create a pool of processes which will carry out tasks submitted to it
with the :class:`Pool` class.
-.. class:: multiprocessing.Pool([processes[, initializer[, initargs]]])
+.. class:: multiprocessing.Pool([processes[, initializer[, initargs[, maxtasksperchild]]]])
A process pool object which controls a pool of worker processes to which jobs
can be submitted. It supports asynchronous results with timeouts and
@@ -1563,6 +1561,22 @@ with the :class:`Pool` class.
*initializer* is not ``None`` then each worker process will call
``initializer(*initargs)`` when it starts.
+ .. versionadded:: 3.2
+ *maxtasksperchild* is the number of tasks a worker process can complete
+ before it will exit and be replaced with a fresh worker process, to enable
+ unused resources to be freed. The default *maxtasksperchild* is None, which
+ means worker processes will live as long as the pool.
+
+ .. note::
+
+ Worker processes within a :class:`Pool` typically live for the complete
+ duration of the Pool's work queue. A frequent pattern found in other
+ systems (such as Apache, mod_wsgi, etc) to free resources held by
+ workers is to allow a worker within a pool to complete only a set
+ amount of work before being exiting, being cleaned up and a new
+ process spawned to replace the old one. The *maxtasksperchild*
+ argument to the :class:`Pool` exposes this ability to the end user.
+
.. method:: apply(func[, args[, kwds]])
Call *func* with arguments *args* and keyword arguments *kwds*. It blocks
@@ -1570,14 +1584,21 @@ with the :class:`Pool` class.
suited for performing work in parallel. Additionally, the passed in
function is only executed in one of the workers of the pool.
- .. method:: apply_async(func[, args[, kwds[, callback]]])
+ .. method:: apply_async(func[, args[, kwds[, callback[, error_callback]]]])
A variant of the :meth:`apply` method which returns a result object.
If *callback* is specified then it should be a callable which accepts a
single argument. When the result becomes ready *callback* is applied to
- it (unless the call failed). *callback* should complete immediately since
- otherwise the thread which handles the results will get blocked.
+ it, that is unless the call failed, in which case the *error_callback*
+ is applied instead
+
+ If *error_callback* is specified then it should be a callable which
+ accepts a single argument. If the target function fails, then
+ the *error_callback* is called with the exception instance.
+
+ Callbacks should complete immediately since otherwise the thread which
+ handles the results will get blocked.
.. method:: map(func, iterable[, chunksize])
@@ -1594,8 +1615,15 @@ with the :class:`Pool` class.
If *callback* is specified then it should be a callable which accepts a
single argument. When the result becomes ready *callback* is applied to
- it (unless the call failed). *callback* should complete immediately since
- otherwise the thread which handles the results will get blocked.
+ it, that is unless the call failed, in which case the *error_callback*
+ is applied instead
+
+ If *error_callback* is specified then it should be a callable which
+ accepts a single argument. If the target function fails, then
+ the *error_callback* is called with the exception instance.
+
+ Callbacks should complete immediately since otherwise the thread which
+ handles the results will get blocked.
.. method:: imap(func, iterable[, chunksize])
diff --git a/Doc/library/netrc.rst b/Doc/library/netrc.rst
index 91990df029..3f38cbce7a 100644
--- a/Doc/library/netrc.rst
+++ b/Doc/library/netrc.rst
@@ -7,6 +7,9 @@
.. moduleauthor:: Eric S. Raymond <esr@snark.thyrsus.com>
.. sectionauthor:: Eric S. Raymond <esr@snark.thyrsus.com>
+**Source code:** :source:`Lib/netrc.py`
+
+--------------
The :class:`netrc` class parses and encapsulates the netrc file format used by
the Unix :program:`ftp` program and other FTP clients.
diff --git a/Doc/library/nntplib.rst b/Doc/library/nntplib.rst
index c3cbd2bc95..164f149096 100644
--- a/Doc/library/nntplib.rst
+++ b/Doc/library/nntplib.rst
@@ -10,101 +10,122 @@
pair: NNTP; protocol
single: Network News Transfer Protocol
+**Source code:** :source:`Lib/nntplib.py`
+
+--------------
+
This module defines the class :class:`NNTP` which implements the client side of
-the NNTP protocol. It can be used to implement a news reader or poster, or
-automated news processors. For more information on NNTP (Network News Transfer
-Protocol), see Internet :rfc:`977`.
+the Network News Transfer Protocol. It can be used to implement a news reader
+or poster, or automated news processors. It is compatible with :rfc:`3977`
+as well as the older :rfc:`977` and :rfc:`2980`.
Here are two small examples of how it can be used. To list some statistics
about a newsgroup and print the subjects of the last 10 articles::
- >>> s = NNTP('news.gmane.org')
+ >>> s = nntplib.NNTP('news.gmane.org')
>>> resp, count, first, last, name = s.group('gmane.comp.python.committers')
>>> print('Group', name, 'has', count, 'articles, range', first, 'to', last)
- Group gmane.comp.python.committers has 1071 articles, range 1 to 1071
- >>> resp, subs = s.xhdr('subject', first + '-' + last)
- >>> for id, sub in subs[-10:]: print(id, sub)
+ Group gmane.comp.python.committers has 1096 articles, range 1 to 1096
+ >>> resp, overviews = s.over((last - 9, last))
+ >>> for id, over in overviews:
+ ... print(id, nntplib.decode_header(over['subject']))
...
- 1062 Re: Mercurial Status?
- 1063 Re: [python-committers] (Windows) buildbots on 3.x
- 1064 Re: Mercurial Status?
- 1065 Re: Mercurial Status?
- 1066 Python 2.6.6 status
- 1067 Commit Privileges for Ask Solem
- 1068 Re: Commit Privileges for Ask Solem
- 1069 Re: Commit Privileges for Ask Solem
- 1070 Re: Commit Privileges for Ask Solem
- 1071 2.6.6 rc 2
+ 1087 Re: Commit privileges for Åukasz Langa
+ 1088 Re: 3.2 alpha 2 freeze
+ 1089 Re: 3.2 alpha 2 freeze
+ 1090 Re: Commit privileges for Åukasz Langa
+ 1091 Re: Commit privileges for Åukasz Langa
+ 1092 Updated ssh key
+ 1093 Re: Updated ssh key
+ 1094 Re: Updated ssh key
+ 1095 Hello fellow committers!
+ 1096 Re: Hello fellow committers!
>>> s.quit()
'205 Bye!'
-To post an article from a file (this assumes that the article has valid
+To post an article from a binary file (this assumes that the article has valid
headers, and that you have right to post on the particular newsgroup)::
- >>> s = NNTP('news.gmane.org')
- >>> f = open('/tmp/article')
+ >>> s = nntplib.NNTP('news.gmane.org')
+ >>> f = open('/tmp/article.txt', 'rb')
>>> s.post(f)
'240 Article posted successfully.'
>>> s.quit()
'205 Bye!'
-The module itself defines the following items:
+The module itself defines the following classes:
-.. class:: NNTP(host[, port [, user[, password [, readermode][, usenetrc]]]])
+.. class:: NNTP(host, port=119, user=None, password=None, readermode=None, usenetrc=False, [timeout])
- Return a new instance of the :class:`NNTP` class, representing a connection
- to the NNTP server running on host *host*, listening at port *port*. The
- default *port* is 119. If the optional *user* and *password* are provided,
- or if suitable credentials are present in :file:`/.netrc` and the optional
- flag *usenetrc* is true (the default), the ``AUTHINFO USER`` and ``AUTHINFO
- PASS`` commands are used to identify and authenticate the user to the server.
- If the optional flag *readermode* is true, then a ``mode reader`` command is
- sent before authentication is performed. Reader mode is sometimes necessary
- if you are connecting to an NNTP server on the local machine and intend to
- call reader-specific commands, such as ``group``. If you get unexpected
+ Return a new :class:`NNTP` object, representing a connection
+ to the NNTP server running on host *host*, listening at port *port*.
+ An optional *timeout* can be specified for the socket connection.
+ If the optional *user* and *password* are provided, or if suitable
+ credentials are present in :file:`/.netrc` and the optional flag *usenetrc*
+ is true, the ``AUTHINFO USER`` and ``AUTHINFO PASS`` commands are used
+ to identify and authenticate the user to the server. If the optional
+ flag *readermode* is true, then a ``mode reader`` command is sent before
+ authentication is performed. Reader mode is sometimes necessary if you are
+ connecting to an NNTP server on the local machine and intend to call
+ reader-specific commands, such as ``group``. If you get unexpected
:exc:`NNTPPermanentError`\ s, you might need to set *readermode*.
- *readermode* defaults to ``None``. *usenetrc* defaults to ``True``.
+
+ .. versionchanged:: 3.2
+ *usenetrc* is now False by default.
+
+
+.. class:: NNTP_SSL(host, port=563, user=None, password=None, ssl_context=None, readermode=None, usenetrc=False, [timeout])
+
+ Return a new :class:`NNTP_SSL` object, representing an encrypted
+ connection to the NNTP server running on host *host*, listening at
+ port *port*. :class:`NNTP_SSL` objects have the same methods as
+ :class:`NNTP` objects. If *port* is omitted, port 563 (NNTPS) is used.
+ *ssl_context* is also optional, and is a :class:`~ssl.SSLContext` object.
+ All other parameters behave the same as for :class:`NNTP`.
+
+ Note that SSL-on-563 is discouraged per :rfc:`4642`, in favor of
+ STARTTLS as described below. However, some servers only support the
+ former.
+
+ .. versionadded:: 3.2
.. exception:: NNTPError
- Derived from the standard exception :exc:`Exception`, this is the base class for
- all exceptions raised by the :mod:`nntplib` module.
+ Derived from the standard exception :exc:`Exception`, this is the base
+ class for all exceptions raised by the :mod:`nntplib` module. Instances
+ of this class have the following attribute:
+
+ .. attribute:: response
+
+ The response of the server if available, as a :class:`str` object.
.. exception:: NNTPReplyError
- Exception raised when an unexpected reply is received from the server. For
- backwards compatibility, the exception ``error_reply`` is equivalent to this
- class.
+ Exception raised when an unexpected reply is received from the server.
.. exception:: NNTPTemporaryError
- Exception raised when an error code in the range 400--499 is received. For
- backwards compatibility, the exception ``error_temp`` is equivalent to this
- class.
+ Exception raised when a response code in the range 400--499 is received.
.. exception:: NNTPPermanentError
- Exception raised when an error code in the range 500--599 is received. For
- backwards compatibility, the exception ``error_perm`` is equivalent to this
- class.
+ Exception raised when a response code in the range 500--599 is received.
.. exception:: NNTPProtocolError
Exception raised when a reply is received from the server that does not begin
- with a digit in the range 1--5. For backwards compatibility, the exception
- ``error_proto`` is equivalent to this class.
+ with a digit in the range 1--5.
.. exception:: NNTPDataError
- Exception raised when there is some error in the response data. For backwards
- compatibility, the exception ``error_data`` is equivalent to this class.
+ Exception raised when there is some error in the response data.
.. _nntp-objects:
@@ -112,10 +133,51 @@ The module itself defines the following items:
NNTP Objects
------------
-NNTP instances have the following methods. The *response* that is returned as
-the first item in the return tuple of almost all methods is the server's
-response: a string beginning with a three-digit code. If the server's response
-indicates an error, the method raises one of the above exceptions.
+When connected, :class:`NNTP` and :class:`NNTP_SSL` objects support the
+following methods and attributes.
+
+Attributes
+^^^^^^^^^^
+
+.. attribute:: NNTP.nntp_version
+
+ An integer representing the version of the NNTP protocol supported by the
+ server. In practice, this should be ``2`` for servers advertising
+ :rfc:`3977` compliance and ``1`` for others.
+
+ .. versionadded:: 3.2
+
+.. attribute:: NNTP.nntp_implementation
+
+ A string describing the software name and version of the NNTP server,
+ or :const:`None` if not advertised by the server.
+
+ .. versionadded:: 3.2
+
+Methods
+^^^^^^^
+
+The *response* that is returned as the first item in the return tuple of almost
+all methods is the server's response: a string beginning with a three-digit
+code. If the server's response indicates an error, the method raises one of
+the above exceptions.
+
+Many of the following methods take an optional keyword-only argument *file*.
+When the *file* argument is supplied, it must be either a :term:`file object`
+opened for binary writing, or the name of an on-disk file to be written to.
+The method will then write any data returned by the server (except for the
+response line and the terminating dot) to the file; any list of lines,
+tuples or objects that the method normally returns will be empty.
+
+.. versionchanged:: 3.2
+ Many of the following methods have been reworked and fixed, which makes
+ them incompatible with their 3.1 counterparts.
+
+
+.. method:: NNTP.quit()
+
+ Send a ``QUIT`` command and close the connection. Once this method has been
+ called, no other methods of the NNTP object should be called.
.. method:: NNTP.getwelcome()
@@ -125,62 +187,114 @@ indicates an error, the method raises one of the above exceptions.
that may be relevant to the user.)
-.. method:: NNTP.set_debuglevel(level)
+.. method:: NNTP.getcapabilities()
- Set the instance's debugging level. This controls the amount of debugging
- output printed. The default, ``0``, produces no debugging output. A value of
- ``1`` produces a moderate amount of debugging output, generally a single line
- per request or response. A value of ``2`` or higher produces the maximum amount
- of debugging output, logging each line sent and received on the connection
- (including message text).
+ Return the :rfc:`3977` capabilities advertised by the server, as a
+ :class:`dict` instance mapping capability names to (possibly empty) lists
+ of values. On legacy servers which don't understand the ``CAPABILITIES``
+ command, an empty dictionary is returned instead.
+
+ >>> s = NNTP('news.gmane.org')
+ >>> 'POST' in s.getcapabilities()
+ True
+
+ .. versionadded:: 3.2
+
+
+.. method:: NNTP.login(user=None, password=None, usenetrc=True)
+
+ Send ``AUTHINFO`` commands with the user name and password. If *user*
+ and *password* are None and *usenetrc* is True, credentials from
+ ``~/.netrc`` will be used if possible.
+ Unless intentionally delayed, login is normally performed during the
+ :class:`NNTP` object initialization and separately calling this function
+ is unnecessary. To force authentication to be delayed, you must not set
+ *user* or *password* when creating the object, and must set *usenetrc* to
+ False.
-.. method:: NNTP.newgroups(date, time, [file])
+ .. versionadded:: 3.2
- Send a ``NEWGROUPS`` command. The *date* argument should be a string of the
- form ``'yymmdd'`` indicating the date, and *time* should be a string of the form
- ``'hhmmss'`` indicating the time. Return a pair ``(response, groups)`` where
- *groups* is a list of group names that are new since the given date and time. If
- the *file* parameter is supplied, then the output of the ``NEWGROUPS`` command
- is stored in a file. If *file* is a string, then the method will open a file
- object with that name, write to it then close it. If *file* is a :term:`file
- object`, then it will start calling :meth:`write` on it to store the lines of
- the command output. If *file* is supplied, then the returned *list* is an empty list.
+.. method:: NNTP.starttls(ssl_context=None)
-.. method:: NNTP.newnews(group, date, time, [file])
+ Send a ``STARTTLS`` command. The *ssl_context* argument is optional
+ and should be a :class:`ssl.SSLContext` object. This will enable
+ encryption on the NNTP connection.
+
+ Note that this may not be done after authentication information has
+ been transmitted, and authentication occurs by default if possible during a
+ :class:`NNTP` object initialization. See :meth:`NNTP.login` for information
+ on suppressing this behavior.
+
+ .. versionadded:: 3.2
+
+
+.. method:: NNTP.newgroups(date, *, file=None)
+
+ Send a ``NEWGROUPS`` command. The *date* argument should be a
+ :class:`datetime.date` or :class:`datetime.datetime` object.
+ Return a pair ``(response, groups)`` where *groups* is a list representing
+ the groups that are new since the given *date*. If *file* is supplied,
+ though, then *groups* will be empty.
+
+ >>> from datetime import date, timedelta
+ >>> resp, groups = s.newgroups(date.today() - timedelta(days=3))
+ >>> len(groups)
+ 85
+ >>> groups[0]
+ GroupInfo(group='gmane.network.tor.devel', last='4', first='1', flag='m')
+
+
+.. method:: NNTP.newnews(group, date, *, file=None)
Send a ``NEWNEWS`` command. Here, *group* is a group name or ``'*'``, and
- *date* and *time* have the same meaning as for :meth:`newgroups`. Return a pair
- ``(response, articles)`` where *articles* is a list of message ids. If the
- *file* parameter is supplied, then the output of the ``NEWNEWS`` command is
- stored in a file. If *file* is a string, then the method will open a file
- object with that name, write to it then close it. If *file* is a :term:`file
- object`, then it will start calling :meth:`write` on it to store the lines of the
- command output. If *file* is supplied, then the returned *list* is an empty list.
-
-
-.. method:: NNTP.list([file])
-
- Send a ``LIST`` command. Return a pair ``(response, list)`` where *list* is a
- list of tuples. Each tuple has the form ``(group, last, first, flag)``, where
- *group* is a group name, *last* and *first* are the last and first article
- numbers (as strings), and *flag* is ``'y'`` if posting is allowed, ``'n'`` if
- not, and ``'m'`` if the newsgroup is moderated. (Note the ordering: *last*,
- *first*.) If the *file* parameter is supplied, then the output of the ``LIST``
- command is stored in a file. If *file* is a string, then the method will open
- a file with that name, write to it then close it. If *file* is a :term:`file
- object`, then it will start calling :meth:`write` on it to store the lines of
- the command output. If *file* is supplied, then the returned *list* is an empty
- list.
+ *date* has the same meaning as for :meth:`newgroups`. Return a pair
+ ``(response, articles)`` where *articles* is a list of message ids.
+
+ This command is frequently disabled by NNTP server administrators.
+
+
+.. method:: NNTP.list(group_pattern=None, *, file=None)
+
+ Send a ``LIST`` or ``LIST ACTIVE`` command. Return a pair
+ ``(response, list)`` where *list* is a list of tuples representing all
+ the groups available from this NNTP server, optionally matching the
+ pattern string *group_pattern*. Each tuple has the form
+ ``(group, last, first, flag)``, where *group* is a group name, *last*
+ and *first* are the last and first article numbers, and *flag* usually
+ takes one of these values:
+
+ * ``y``: Local postings and articles from peers are allowed.
+ * ``m``: The group is moderated and all postings must be approved.
+ * ``n``: No local postings are allowed, only articles from peers.
+ * ``j``: Articles from peers are filed in the junk group instead.
+ * ``x``: No local postings, and articles from peers are ignored.
+ * ``=foo.bar``: Articles are filed in the ``foo.bar`` group instead.
+
+ If *flag* has another value, then the status of the newsgroup should be
+ considered unknown.
+
+ This command can return very large results, especially if *group_pattern*
+ is not specified. It is best to cache the results offline unless you
+ really need to refresh them.
+
+ .. versionchanged:: 3.2
+ *group_pattern* was added.
.. method:: NNTP.descriptions(grouppattern)
Send a ``LIST NEWSGROUPS`` command, where *grouppattern* is a wildmat string as
- specified in RFC2980 (it's essentially the same as DOS or UNIX shell wildcard
- strings). Return a pair ``(response, list)``, where *list* is a list of tuples
- containing ``(name, title)``.
+ specified in :rfc:`3977` (it's essentially the same as DOS or UNIX shell wildcard
+ strings). Return a pair ``(response, descriptions)``, where *descriptions*
+ is a dictionary mapping group names to textual descriptions.
+
+ >>> resp, descs = s.descriptions('gmane.comp.python.*')
+ >>> len(descs)
+ 295
+ >>> descs.popitem()
+ ('gmane.comp.python.bio.general', 'BioPython discussion list (Moderated)')
.. method:: NNTP.description(group)
@@ -195,30 +309,75 @@ indicates an error, the method raises one of the above exceptions.
.. method:: NNTP.group(name)
- Send a ``GROUP`` command, where *name* is the group name. Return a tuple
- ``(response, count, first, last, name)`` where *count* is the (estimated) number
- of articles in the group, *first* is the first article number in the group,
- *last* is the last article number in the group, and *name* is the group name.
- The numbers are returned as strings.
+ Send a ``GROUP`` command, where *name* is the group name. The group is
+ selected as the current group, if it exists. Return a tuple
+ ``(response, count, first, last, name)`` where *count* is the (estimated)
+ number of articles in the group, *first* is the first article number in
+ the group, *last* is the last article number in the group, and *name*
+ is the group name.
+
+
+.. method:: NNTP.over(message_spec, *, file=None)
+
+ Send a ``OVER`` command, or a ``XOVER`` command on legacy servers.
+ *message_spec* can be either a string representing a message id, or
+ a ``(first, last)`` tuple of numbers indicating a range of articles in
+ the current group, or a ``(first, None)`` tuple indicating a range of
+ articles starting from *first* to the last article in the current group,
+ or :const:`None` to select the current article in the current group.
+
+ Return a pair ``(response, overviews)``. *overviews* is a list of
+ ``(article_number, overview)`` tuples, one for each article selected
+ by *message_spec*. Each *overview* is a dictionary with the same number
+ of items, but this number depends on the server. These items are either
+ message headers (the key is then the lower-cased header name) or metadata
+ items (the key is then the metadata name prepended with ``":"``). The
+ following items are guaranteed to be present by the NNTP specification:
+
+ * the ``subject``, ``from``, ``date``, ``message-id`` and ``references``
+ headers
+ * the ``:bytes`` metadata: the number of bytes in the entire raw article
+ (including headers and body)
+ * the ``:lines`` metadata: the number of lines in the article body
+
+ The value of each item is either a string, or :const:`None` if not present.
+
+ It is advisable to use the :func:`decode_header` function on header
+ values when they may contain non-ASCII characters::
+
+ >>> _, _, first, last, _ = s.group('gmane.comp.python.devel')
+ >>> resp, overviews = s.over((last, last))
+ >>> art_num, over = overviews[0]
+ >>> art_num
+ 117216
+ >>> list(over.keys())
+ ['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']
+ >>> over['from']
+ '=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= <martin@v.loewis.de>'
+ >>> nntplib.decode_header(over['from'])
+ '"Martin v. Löwis" <martin@v.loewis.de>'
+
+ .. versionadded:: 3.2
-.. method:: NNTP.help([file])
+.. method:: NNTP.help(*, file=None)
Send a ``HELP`` command. Return a pair ``(response, list)`` where *list* is a
- list of help strings. If the *file* parameter is supplied, then the output of
- the ``HELP`` command is stored in a file. If *file* is a string, then the
- method will open a file with that name, write to it then close it. If *file*
- is a :term:`file object`, then it will start calling :meth:`write` on it to store
- the lines of the command output. If *file* is supplied, then the returned *list*
- is an empty list.
+ list of help strings.
-.. method:: NNTP.stat(id)
+.. method:: NNTP.stat(message_spec=None)
- Send a ``STAT`` command, where *id* is the message id (enclosed in ``'<'`` and
- ``'>'``) or an article number (as a string). Return a triple ``(response,
- number, id)`` where *number* is the article number (as a string) and *id* is the
- message id (enclosed in ``'<'`` and ``'>'``).
+ Send a ``STAT`` command, where *message_spec* is either a message id
+ (enclosed in ``'<'`` and ``'>'``) or an article number in the current group.
+ If *message_spec* is omitted or :const:`None`, the current article in the
+ current group is considered. Return a triple ``(response, number, id)``
+ where *number* is the article number and *id* is the message id.
+
+ >>> _, _, first, last, _ = s.group('gmane.comp.python.devel')
+ >>> resp, number, message_id = s.stat(first)
+ >>> number, message_id
+ (9099, '<20030112190404.GE29873@epoch.metaslash.com>')
.. method:: NNTP.next()
@@ -231,28 +390,69 @@ indicates an error, the method raises one of the above exceptions.
Send a ``LAST`` command. Return as for :meth:`stat`.
-.. method:: NNTP.head(id)
+.. method:: NNTP.article(message_spec=None, *, file=None)
+
+ Send an ``ARTICLE`` command, where *message_spec* has the same meaning as
+ for :meth:`stat`. Return a tuple ``(response, info)`` where *info*
+ is a :class:`~collections.namedtuple` with three members *number*,
+ *message_id* and *lines* (in that order). *number* is the article number
+ in the group (or 0 if the information is not available), *message_id* the
+ message id as a string, and *lines* a list of lines (without terminating
+ newlines) comprising the raw message including headers and body.
+
+ >>> resp, info = s.article('<20030112190404.GE29873@epoch.metaslash.com>')
+ >>> info.number
+ 0
+ >>> info.message_id
+ '<20030112190404.GE29873@epoch.metaslash.com>'
+ >>> len(info.lines)
+ 65
+ >>> info.lines[0]
+ b'Path: main.gmane.org!not-for-mail'
+ >>> info.lines[1]
+ b'From: Neal Norwitz <neal@metaslash.com>'
+ >>> info.lines[-3:]
+ [b'There is a patch for 2.3 as well as 2.2.', b'', b'Neal']
+
+
+.. method:: NNTP.head(message_spec=None, *, file=None)
+
+ Same as :meth:`article()`, but sends a ``HEAD`` command. The *lines*
+ returned (or written to *file*) will only contain the message headers, not
+ the body.
+
- Send a ``HEAD`` command, where *id* has the same meaning as for :meth:`stat`.
- Return a tuple ``(response, number, id, list)`` where the first three are the
- same as for :meth:`stat`, and *list* is a list of the article's headers (an
- uninterpreted list of lines, without trailing newlines).
+.. method:: NNTP.body(message_spec=None, *, file=None)
+ Same as :meth:`article()`, but sends a ``BODY`` command. The *lines*
+ returned (or written to *file*) will only contain the message body, not the
+ headers.
-.. method:: NNTP.body(id,[file])
- Send a ``BODY`` command, where *id* has the same meaning as for :meth:`stat`.
- If the *file* parameter is supplied, then the body is stored in a file. If
- *file* is a string, then the method will open a file with that name, write
- to it then close it. If *file* is a :term:`file object`, then it will start
- calling :meth:`write` on it to store the lines of the body. Return as for
- :meth:`head`. If *file* is supplied, then the returned *list* is an empty list.
+.. method:: NNTP.post(data)
+ Post an article using the ``POST`` command. The *data* argument is either
+ a :term:`file object` opened for binary reading, or any iterable of bytes
+ objects (representing raw lines of the article to be posted). It should
+ represent a well-formed news article, including the required headers. The
+ :meth:`post` method automatically escapes lines beginning with ``.`` and
+ appends the termination line.
-.. method:: NNTP.article(id)
+ If the method succeeds, the server's response is returned. If the server
+ refuses posting, a :class:`NNTPReplyError` is raised.
+
+
+.. method:: NNTP.ihave(message_id, data)
+
+ Send an ``IHAVE`` command. *message_id* is the id of the message to send
+ to the server (enclosed in ``'<'`` and ``'>'``). The *data* parameter
+ and the return value are the same as for :meth:`post()`.
+
+
+.. method:: NNTP.date()
- Send an ``ARTICLE`` command, where *id* has the same meaning as for
- :meth:`stat`. Return as for :meth:`head`.
+ Return a pair ``(response, date)``. *date* is a :class:`~datetime.datetime`
+ object containing the current date and time of the server.
.. method:: NNTP.slave()
@@ -260,10 +460,23 @@ indicates an error, the method raises one of the above exceptions.
Send a ``SLAVE`` command. Return the server's *response*.
-.. method:: NNTP.xhdr(header, string, [file])
+.. method:: NNTP.set_debuglevel(level)
- Send an ``XHDR`` command. This command is not defined in the RFC but is a
- common extension. The *header* argument is a header keyword, e.g.
+ Set the instance's debugging level. This controls the amount of debugging
+ output printed. The default, ``0``, produces no debugging output. A value of
+ ``1`` produces a moderate amount of debugging output, generally a single line
+ per request or response. A value of ``2`` or higher produces the maximum amount
+ of debugging output, logging each line sent and received on the connection
+ (including message text).
+
+
+The following are optional NNTP extensions defined in :rfc:`2980`. Some of
+them have been superseded by newer commands in :rfc:`3977`.
+
+
+.. method:: NNTP.xhdr(header, string, *, file=None)
+
+ Send an ``XHDR`` command. The *header* argument is a header keyword, e.g.
``'subject'``. The *string* argument should have the form ``'first-last'``
where *first* and *last* are the first and last article numbers to search.
Return a pair ``(response, list)``, where *list* is a list of pairs ``(id,
@@ -276,66 +489,55 @@ indicates an error, the method raises one of the above exceptions.
returned *list* is an empty list.
-.. method:: NNTP.post(file)
-
- Post an article using the ``POST`` command. The *file* argument is an open file
- object which is read until EOF using its :meth:`readline` method. It should be
- a well-formed news article, including the required headers. The :meth:`post`
- method automatically escapes lines beginning with ``.``.
+.. method:: NNTP.xover(start, end, *, file=None)
+ Send an ``XOVER`` command. *start* and *end* are article numbers
+ delimiting the range of articles to select. The return value is the
+ same of for :meth:`over()`. It is recommended to use :meth:`over()`
+ instead, since it will automatically use the newer ``OVER`` command
+ if available.
-.. method:: NNTP.ihave(id, file)
-
- Send an ``IHAVE`` command. *id* is a message id (enclosed in ``'<'`` and
- ``'>'``). If the response is not an error, treat *file* exactly as for the
- :meth:`post` method.
-
-
-.. method:: NNTP.date()
-
- Return a triple ``(response, date, time)``, containing the current date and time
- in a form suitable for the :meth:`newnews` and :meth:`newgroups` methods. This
- is an optional NNTP extension, and may not be supported by all servers.
+.. method:: NNTP.xpath(id)
-.. method:: NNTP.xgtitle(name, [file])
+ Return a pair ``(resp, path)``, where *path* is the directory path to the
+ article with message ID *id*. Most of the time, this extension is not
+ enabled by NNTP server administrators.
- Process an ``XGTITLE`` command, returning a pair ``(response, list)``, where
- *list* is a list of tuples containing ``(name, title)``. If the *file* parameter
- is supplied, then the output of the ``XGTITLE`` command is stored in a file.
- If *file* is a string, then the method will open a file with that name, write
- to it then close it. If *file* is a :term:`file object`, then it will start
- calling :meth:`write` on it to store the lines of the command output. If *file*
- is supplied, then the returned *list* is an empty list. This is an optional NNTP
- extension, and may not be supported by all servers.
- RFC2980 says "It is suggested that this extension be deprecated". Use
- :meth:`descriptions` or :meth:`description` instead.
+.. XXX deprecated:
+ .. method:: NNTP.xgtitle(name, *, file=None)
-.. method:: NNTP.xover(start, end, [file])
+ Process an ``XGTITLE`` command, returning a pair ``(response, list)``, where
+ *list* is a list of tuples containing ``(name, title)``. If the *file* parameter
+ is supplied, then the output of the ``XGTITLE`` command is stored in a file.
+ If *file* is a string, then the method will open a file with that name, write
+ to it then close it. If *file* is a :term:`file object`, then it will start
+ calling :meth:`write` on it to store the lines of the command output. If *file*
+ is supplied, then the returned *list* is an empty list. This is an optional NNTP
+ extension, and may not be supported by all servers.
- Return a pair ``(resp, list)``. *list* is a list of tuples, one for each
- article in the range delimited by the *start* and *end* article numbers. Each
- tuple is of the form ``(article number, subject, poster, date, id, references,
- size, lines)``. If the *file* parameter is supplied, then the output of the
- ``XOVER`` command is stored in a file. If *file* is a string, then the method
- will open a file with that name, write to it then close it. If *file* is a
- :term:`file object`, then it will start calling :meth:`write` on it to store the
- lines of the command output. If *file* is supplied, then the returned *list* is
- an empty list. This is an optional NNTP extension, and may not be supported by
- all servers.
+ RFC2980 says "It is suggested that this extension be deprecated". Use
+ :meth:`descriptions` or :meth:`description` instead.
-.. method:: NNTP.xpath(id)
+Utility functions
+-----------------
- Return a pair ``(resp, path)``, where *path* is the directory path to the
- article with message ID *id*. This is an optional NNTP extension, and may not
- be supported by all servers.
+The module also defines the following utility function:
-.. method:: NNTP.quit()
+.. function:: decode_header(header_str)
- Send a ``QUIT`` command and close the connection. Once this method has been
- called, no other methods of the NNTP object should be called.
+ Decode a header value, un-escaping any escaped non-ASCII characters.
+ *header_str* must be a :class:`str` object. The unescaped value is
+ returned. Using this function is recommended to display some headers
+ in a human readable form::
+ >>> decode_header("Some subject")
+ 'Some subject'
+ >>> decode_header("=?ISO-8859-15?Q?D=E9buter_en_Python?=")
+ 'Débuter en Python'
+ >>> decode_header("Re: =?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U=?=")
+ 'Re: problème de matrice'
diff --git a/Doc/library/numeric.rst b/Doc/library/numeric.rst
index 641f58885c..ba22cb6882 100644
--- a/Doc/library/numeric.rst
+++ b/Doc/library/numeric.rst
@@ -23,6 +23,3 @@ The following modules are documented in this chapter:
decimal.rst
fractions.rst
random.rst
- itertools.rst
- functools.rst
- operator.rst
diff --git a/Doc/library/objects.rst b/Doc/library/objects.rst
deleted file mode 100644
index 1b7516117a..0000000000
--- a/Doc/library/objects.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-
-.. _builtin:
-
-****************
-Built-in Objects
-****************
-
-.. index::
- pair: built-in; types
- pair: built-in; exceptions
- pair: built-in; functions
- pair: built-in; constants
- single: symbol table
-
-Names for built-in exceptions and functions and a number of constants are found
-in a separate symbol table. This table is searched last when the interpreter
-looks up the meaning of a name, so local and global user-defined names can
-override built-in names. Built-in types are described together here for easy
-reference.
-
-The tables in this chapter document the priorities of operators by listing them
-in order of ascending priority (within a table) and grouping operators that have
-the same priority in the same box. Binary operators of the same priority group
-from left to right. (Unary operators group from right to left, but there you
-have no real choice.) See :ref:`operator-summary` for the complete picture on
-operator priorities.
-
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst
index 43bdeef465..1dc0e144d2 100644
--- a/Doc/library/operator.rst
+++ b/Doc/library/operator.rst
@@ -9,7 +9,7 @@
.. testsetup::
import operator
- from operator import itemgetter
+ from operator import itemgetter, iadd
The :mod:`operator` module exports a set of functions implemented in C
@@ -225,91 +225,6 @@ Operations which work with sequences (some of them with mappings too) include:
Set the value of *a* at index *b* to *c*.
-
-Many operations have an "in-place" version. The following functions provide a
-more primitive access to in-place operators than the usual syntax does; for
-example, the :term:`statement` ``x += y`` is equivalent to
-``x = operator.iadd(x, y)``. Another way to put it is to say that
-``z = operator.iadd(x, y)`` is equivalent to the compound statement
-``z = x; z += y``.
-
-.. function:: iadd(a, b)
- __iadd__(a, b)
-
- ``a = iadd(a, b)`` is equivalent to ``a += b``.
-
-
-.. function:: iand(a, b)
- __iand__(a, b)
-
- ``a = iand(a, b)`` is equivalent to ``a &= b``.
-
-
-.. function:: iconcat(a, b)
- __iconcat__(a, b)
-
- ``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences.
-
-
-.. function:: ifloordiv(a, b)
- __ifloordiv__(a, b)
-
- ``a = ifloordiv(a, b)`` is equivalent to ``a //= b``.
-
-
-.. function:: ilshift(a, b)
- __ilshift__(a, b)
-
- ``a = ilshift(a, b)`` is equivalent to ``a <<= b``.
-
-
-.. function:: imod(a, b)
- __imod__(a, b)
-
- ``a = imod(a, b)`` is equivalent to ``a %= b``.
-
-
-.. function:: imul(a, b)
- __imul__(a, b)
-
- ``a = imul(a, b)`` is equivalent to ``a *= b``.
-
-
-.. function:: ior(a, b)
- __ior__(a, b)
-
- ``a = ior(a, b)`` is equivalent to ``a |= b``.
-
-
-.. function:: ipow(a, b)
- __ipow__(a, b)
-
- ``a = ipow(a, b)`` is equivalent to ``a **= b``.
-
-
-.. function:: irshift(a, b)
- __irshift__(a, b)
-
- ``a = irshift(a, b)`` is equivalent to ``a >>= b``.
-
-
-.. function:: isub(a, b)
- __isub__(a, b)
-
- ``a = isub(a, b)`` is equivalent to ``a -= b``.
-
-
-.. function:: itruediv(a, b)
- __itruediv__(a, b)
-
- ``a = itruediv(a, b)`` is equivalent to ``a /= b``.
-
-
-.. function:: ixor(a, b)
- __ixor__(a, b)
-
- ``a = ixor(a, b)`` is equivalent to ``a ^= b``.
-
Example: Build a dictionary that maps the ordinals from ``0`` to ``255`` to
their character equivalents.
@@ -335,6 +250,8 @@ expect a function argument.
b.date)``. Equivalent to::
def attrgetter(*items):
+ if any(not isinstance(item, str) for item in items):
+ raise TypeError('attribute name must be a string')
if len(items) == 1:
attr = items[0]
def g(obj):
@@ -488,3 +405,112 @@ Python syntax and the functions in the :mod:`operator` module.
| Ordering | ``a > b`` | ``gt(a, b)`` |
+-----------------------+-------------------------+---------------------------------------+
+Inplace Operators
+=================
+
+Many operations have an "in-place" version. Listed below are functions
+providing a more primitive access to in-place operators than the usual syntax
+does; for example, the :term:`statement` ``x += y`` is equivalent to
+``x = operator.iadd(x, y)``. Another way to put it is to say that
+``z = operator.iadd(x, y)`` is equivalent to the compound statement
+``z = x; z += y``.
+
+In those examples, note that when an in-place method is called, the computation
+and assignment are performed in two separate steps. The in-place functions
+listed below only do the first step, calling the in-place method. The second
+step, assignment, is not handled.
+
+For immutable targets such as strings, numbers, and tuples, the updated
+value is computed, but not assigned back to the input variable:
+
+>>> a = 'hello'
+>>> iadd(a, ' world')
+'hello world'
+>>> a
+'hello'
+
+For mutable targets such as lists and dictionaries, the inplace method
+will perform the update, so no subsequent assignment is necessary:
+
+>>> s = ['h', 'e', 'l', 'l', 'o']
+>>> iadd(s, [' ', 'w', 'o', 'r', 'l', 'd'])
+['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
+>>> s
+['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
+
+.. function:: iadd(a, b)
+ __iadd__(a, b)
+
+ ``a = iadd(a, b)`` is equivalent to ``a += b``.
+
+
+.. function:: iand(a, b)
+ __iand__(a, b)
+
+ ``a = iand(a, b)`` is equivalent to ``a &= b``.
+
+
+.. function:: iconcat(a, b)
+ __iconcat__(a, b)
+
+ ``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences.
+
+
+.. function:: ifloordiv(a, b)
+ __ifloordiv__(a, b)
+
+ ``a = ifloordiv(a, b)`` is equivalent to ``a //= b``.
+
+
+.. function:: ilshift(a, b)
+ __ilshift__(a, b)
+
+ ``a = ilshift(a, b)`` is equivalent to ``a <<= b``.
+
+
+.. function:: imod(a, b)
+ __imod__(a, b)
+
+ ``a = imod(a, b)`` is equivalent to ``a %= b``.
+
+
+.. function:: imul(a, b)
+ __imul__(a, b)
+
+ ``a = imul(a, b)`` is equivalent to ``a *= b``.
+
+
+.. function:: ior(a, b)
+ __ior__(a, b)
+
+ ``a = ior(a, b)`` is equivalent to ``a |= b``.
+
+
+.. function:: ipow(a, b)
+ __ipow__(a, b)
+
+ ``a = ipow(a, b)`` is equivalent to ``a **= b``.
+
+
+.. function:: irshift(a, b)
+ __irshift__(a, b)
+
+ ``a = irshift(a, b)`` is equivalent to ``a >>= b``.
+
+
+.. function:: isub(a, b)
+ __isub__(a, b)
+
+ ``a = isub(a, b)`` is equivalent to ``a -= b``.
+
+
+.. function:: itruediv(a, b)
+ __itruediv__(a, b)
+
+ ``a = itruediv(a, b)`` is equivalent to ``a /= b``.
+
+
+.. function:: ixor(a, b)
+ __ixor__(a, b)
+
+ ``a = ixor(a, b)`` is equivalent to ``a ^= b``.
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index 87ec4de8d9..58fb7cd732 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -1,11 +1,19 @@
-:mod:`optparse` --- More powerful command line option parser
-============================================================
+:mod:`optparse` --- Parser for command line options
+===================================================
.. module:: optparse
- :synopsis: More convenient, flexible, and powerful command-line parsing library.
+ :synopsis: Command-line option parsing library.
+ :deprecated:
.. moduleauthor:: Greg Ward <gward@python.net>
.. sectionauthor:: Greg Ward <gward@python.net>
+**Source code:** :source:`Lib/optparse.py`
+
+--------------
+
+.. deprecated:: 2.7
+ The :mod:`optparse` module is deprecated and will not be developed further;
+ development will continue with the :mod:`argparse` module.
:mod:`optparse` is a more convenient, flexible, and powerful library for parsing
command-line options than the old :mod:`getopt` module. :mod:`optparse` uses a
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index 28a7affa7a..522b94cee9 100644
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -201,6 +201,7 @@ applications should use string objects to access all files.
Normalize the case of a pathname. On Unix and Mac OS X, this returns the
path unchanged; on case-insensitive filesystems, it converts the path to
lowercase. On Windows, it also converts forward slashes to backward slashes.
+ Raise a TypeError if the type of *path* is not ``str`` or ``bytes``.
.. function:: normpath(path)
@@ -220,7 +221,7 @@ applications should use string objects to access all files.
links encountered in the path (if they are supported by the operating system).
-.. function:: relpath(path[, start])
+.. function:: relpath(path, start=None)
Return a relative filepath to *path* either from the current directory or from
an optional *start* point.
@@ -232,18 +233,27 @@ applications should use string objects to access all files.
.. function:: samefile(path1, path2)
- Return ``True`` if both pathname arguments refer to the same file or directory
- (as indicated by device number and i-node number). Raise an exception if a
- :func:`os.stat` call on either pathname fails.
+ Return ``True`` if both pathname arguments refer to the same file or directory.
+ On Unix, this is determined by the device number and i-node number and raises an
+ exception if a :func:`os.stat` call on either pathname fails.
- Availability: Unix.
+ On Windows, two files are the same if they resolve to the same final path
+ name using the Windows API call GetFinalPathNameByHandle. This function
+ raises an exception if handles cannot be obtained to either file.
+
+ Availability: Unix, Windows.
+
+ .. versionchanged:: 3.2
+ Added Windows support.
.. function:: sameopenfile(fp1, fp2)
Return ``True`` if the file descriptors *fp1* and *fp2* refer to the same file.
- Availability: Unix.
+ Availability: Unix, Windows.
+
+ .. versionchanged:: 3.2 Added Windows support.
.. function:: samestat(stat1, stat2)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 3f6d69d149..fe785fc47c 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -109,6 +109,10 @@ process and user.
to modify the environment as well as query the environment. :func:`putenv` will
be called automatically when the mapping is modified.
+ On Unix, keys and values use :func:`sys.getfilesystemencoding` and
+ ``'surrogateescape'`` error handler. Use :data:`environb` if you would like
+ to use a different encoding.
+
.. note::
Calling :func:`putenv` directly does not change ``os.environ``, so it's better
@@ -118,7 +122,7 @@ process and user.
On some platforms, including FreeBSD and Mac OS X, setting ``environ`` may
cause memory leaks. Refer to the system documentation for
- :cfunc:`putenv`.
+ :c:func:`putenv`.
If :func:`putenv` is not provided, a modified copy of this mapping may be
passed to the appropriate process-creation functions to cause child processes
@@ -130,6 +134,19 @@ process and user.
one of the :meth:`pop` or :meth:`clear` methods is called.
+.. data:: environb
+
+ Bytes version of :data:`environ`: a mapping object representing the
+ environment as byte strings. :data:`environ` and :data:`environb` are
+ synchronized (modify :data:`environb` updates :data:`environ`, and vice
+ versa).
+
+ :data:`environb` is only available if :data:`supports_bytes_environ` is
+ True.
+
+ .. versionadded:: 3.2
+
+
.. function:: chdir(path)
fchdir(fd)
getcwd()
@@ -138,6 +155,37 @@ process and user.
These functions are described in :ref:`os-file-dir`.
+.. function:: fsencode(filename)
+
+ Encode *filename* to the filesystem encoding with ``'surrogateescape'``
+ error handler, or ``'strict'`` on Windows; return :class:`bytes` unchanged.
+
+ :func:`fsdecode` is the reverse function.
+
+ .. versionadded:: 3.2
+
+
+.. function:: fsdecode(filename)
+
+ Decode *filename* from the filesystem encoding with ``'surrogateescape'``
+ error handler, or ``'strict'`` on Windows; return :class:`str` unchanged.
+
+ :func:`fsencode` is the reverse function.
+
+ .. versionadded:: 3.2
+
+
+.. function:: get_exec_path(env=None)
+
+ Returns the list of directories that will be searched for a named
+ executable, similar to a shell, when launching a process.
+ *env*, when specified, should be an environment variable dictionary
+ to lookup the PATH in.
+ By default, when *env* is None, :data:`environ` is used.
+
+ .. versionadded:: 3.2
+
+
.. function:: ctermid()
Return the filename corresponding to the controlling terminal of the process.
@@ -178,15 +226,26 @@ process and user.
Availability: Unix.
+.. function:: initgroups(username, gid)
+
+ Call the system initgroups() to initialize the group access list with all of
+ the groups of which the specified username is a member, plus the specified
+ group id.
+
+ Availability: Unix.
+
+ .. versionadded:: 3.2
+
+
.. function:: getlogin()
Return the name of the user logged in on the controlling terminal of the
- process. For most purposes, it is more useful to use the environment variable
- :envvar:`LOGNAME` to find out who the user is, or
+ process. For most purposes, it is more useful to use the environment variables
+ :envvar:`LOGNAME` or :envvar:`USERNAME` to find out who the user is, or
``pwd.getpwuid(os.getuid())[0]`` to get the login name of the currently
effective user id.
- Availability: Unix.
+ Availability: Unix, Windows.
.. function:: getpgid(pid)
@@ -218,10 +277,34 @@ process and user.
.. index:: single: process; id of parent
- Return the parent's process id.
+ Return the parent's process id. When the parent process has exited, on Unix
+ the id returned is the one of the init process (1), on Windows it is still
+ the same id, which may be already reused by another process.
+
+ Availability: Unix, Windows
+
+ .. versionchanged:: 3.2
+ Added support for Windows.
+
+.. function:: getresuid()
+
+ Return a tuple (ruid, euid, suid) denoting the current process's
+ real, effective, and saved user ids.
Availability: Unix.
+ .. versionadded:: 3.2
+
+
+.. function:: getresgid()
+
+ Return a tuple (rgid, egid, sgid) denoting the current process's
+ real, effective, and saved group ids.
+
+ Availability: Unix.
+
+ .. versionadded:: 3.2
+
.. function:: getuid()
@@ -232,19 +315,33 @@ process and user.
Availability: Unix.
-.. function:: getenv(varname[, value])
+.. function:: getenv(key, default=None)
+
+ Return the value of the environment variable *key* if it exists, or
+ *default* if it doesn't. *key*, *default* and the result are str.
- Return the value of the environment variable *varname* if it exists, or *value*
- if it doesn't. *value* defaults to ``None``.
+ On Unix, keys and values are decoded with :func:`sys.getfilesystemencoding`
+ and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you
+ would like to use a different encoding.
Availability: most flavors of Unix, Windows.
-.. function:: putenv(varname, value)
+.. function:: getenvb(key, default=None)
+
+ Return the value of the environment variable *key* if it exists, or
+ *default* if it doesn't. *key*, *default* and the result are bytes.
+
+ Availability: most flavors of Unix.
+
+ .. versionadded:: 3.2
+
+
+.. function:: putenv(key, value)
.. index:: single: environment variables; setting
- Set the environment variable named *varname* to the string *value*. Such
+ Set the environment variable named *key* to the string *value*. Such
changes to the environment affect subprocesses started with :func:`os.system`,
:func:`popen` or :func:`fork` and :func:`execv`.
@@ -293,7 +390,7 @@ process and user.
.. function:: setpgrp()
- Call the system call :cfunc:`setpgrp` or :cfunc:`setpgrp(0, 0)` depending on
+ Call the system call :c:func:`setpgrp` or :c:func:`setpgrp(0, 0)` depending on
which version is implemented (if any). See the Unix manual for the semantics.
Availability: Unix.
@@ -301,37 +398,55 @@ process and user.
.. function:: setpgid(pid, pgrp)
- Call the system call :cfunc:`setpgid` to set the process group id of the
+ Call the system call :c:func:`setpgid` to set the process group id of the
process with id *pid* to the process group with id *pgrp*. See the Unix manual
for the semantics.
Availability: Unix.
-.. function:: setreuid(ruid, euid)
+.. function:: setregid(rgid, egid)
- Set the current process's real and effective user ids.
+ Set the current process's real and effective group ids.
Availability: Unix.
-.. function:: setregid(rgid, egid)
+.. function:: setresgid(rgid, egid, sgid)
- Set the current process's real and effective group ids.
+ Set the current process's real, effective, and saved group ids.
+
+ Availability: Unix.
+
+ .. versionadded:: 3.2
+
+
+.. function:: setresuid(ruid, euid, suid)
+
+ Set the current process's real, effective, and saved user ids.
+
+ Availability: Unix.
+
+ .. versionadded:: 3.2
+
+
+.. function:: setreuid(ruid, euid)
+
+ Set the current process's real and effective user ids.
Availability: Unix.
.. function:: getsid(pid)
- Call the system call :cfunc:`getsid`. See the Unix manual for the semantics.
+ Call the system call :c:func:`getsid`. See the Unix manual for the semantics.
Availability: Unix.
.. function:: setsid()
- Call the system call :cfunc:`setsid`. See the Unix manual for the semantics.
+ Call the system call :c:func:`setsid`. See the Unix manual for the semantics.
Availability: Unix.
@@ -349,12 +464,20 @@ process and user.
.. function:: strerror(code)
Return the error message corresponding to the error code in *code*.
- On platforms where :cfunc:`strerror` returns ``NULL`` when given an unknown
+ On platforms where :c:func:`strerror` returns ``NULL`` when given an unknown
error number, :exc:`ValueError` is raised.
Availability: Unix, Windows.
+.. data:: supports_bytes_environ
+
+ True if the native OS type of the environment is bytes (eg. False on
+ Windows).
+
+ .. versionadded:: 3.2
+
+
.. function:: umask(mask)
Set the current numeric umask and return the previous umask.
@@ -378,11 +501,11 @@ process and user.
Availability: recent flavors of Unix.
-.. function:: unsetenv(varname)
+.. function:: unsetenv(key)
.. index:: single: environment variables; deleting
- Unset (delete) the environment variable named *varname*. Such changes to the
+ Unset (delete) the environment variable named *key*. Such changes to the
environment affect subprocesses started with :func:`os.system`, :func:`popen` or
:func:`fork` and :func:`execv`.
@@ -414,7 +537,7 @@ These functions create new :term:`file objects <file object>`. (See also :func:`
``'r'``, ``'w'``, or ``'a'``, otherwise a :exc:`ValueError` is raised.
On Unix, when the *mode* argument starts with ``'a'``, the *O_APPEND* flag is
- set on the file descriptor (which the :cfunc:`fdopen` implementation already
+ set on the file descriptor (which the :c:func:`fdopen` implementation already
does on most platforms).
Availability: Unix, Windows.
@@ -550,7 +673,7 @@ as internal buffering of data.
.. function:: fsync(fd)
Force write of file with filedescriptor *fd* to disk. On Unix, this calls the
- native :cfunc:`fsync` function; on Windows, the MS :cfunc:`_commit` function.
+ native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` function.
If you're starting with a buffered Python :term:`file object` *f*, first do
``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all internal
@@ -612,7 +735,7 @@ as internal buffering of data.
This function is intended for low-level I/O. For normal usage, use the
built-in function :func:`open`, which returns a :term:`file object` with
- :meth:`~file.read` and :meth:`~file.wprite` methods (and many more). To
+ :meth:`~file.read` and :meth:`~file.write` methods (and many more). To
wrap a file descriptor in a file object, use :func:`fdopen`.
@@ -935,13 +1058,16 @@ Files and Directories
Create a hard link pointing to *source* named *link_name*.
- Availability: Unix.
+ Availability: Unix, Windows.
+
+ .. versionchanged:: 3.2
+ Added Windows support.
-.. function:: listdir(path)
+.. function:: listdir(path='.')
Return a list containing the names of the entries in the directory given by
- *path*. The list is in arbitrary order. It does not include the special
+ *path* (default: ``'.'``). The list is in arbitrary order. It does not include the special
entries ``'.'`` and ``'..'`` even if they are present in the directory.
This function can be called with a bytes or string argument, and returns
@@ -949,14 +1075,19 @@ Files and Directories
Availability: Unix, Windows.
+ .. versionchanged:: 3.2
+ The *path* parameter became optional.
.. function:: lstat(path)
- Perform the equivalent of an :cfunc:`lstat` system call on the given path.
+ Perform the equivalent of an :c:func:`lstat` system call on the given path.
Similar to :func:`~os.stat`, but does not follow symbolic links. On
platforms that do not support symbolic links, this is an alias for
:func:`~os.stat`.
+ .. versionchanged:: 3.2
+ Added support for Windows 6.0 (Vista) symbolic links.
+
.. function:: mkfifo(path[, mode])
@@ -973,28 +1104,27 @@ Files and Directories
Availability: Unix.
-.. function:: mknod(filename[, mode=0o600, device])
+.. function:: mknod(filename[, mode=0o600[, device]])
Create a filesystem node (file, device special file or named pipe) named
- *filename*. *mode* specifies both the permissions to use and the type of node to
- be created, being combined (bitwise OR) with one of ``stat.S_IFREG``,
- ``stat.S_IFCHR``, ``stat.S_IFBLK``,
- and ``stat.S_IFIFO`` (those constants are available in :mod:`stat`).
- For ``stat.S_IFCHR`` and
- ``stat.S_IFBLK``, *device* defines the newly created device special file (probably using
+ *filename*. *mode* specifies both the permissions to use and the type of node
+ to be created, being combined (bitwise OR) with one of ``stat.S_IFREG``,
+ ``stat.S_IFCHR``, ``stat.S_IFBLK``, and ``stat.S_IFIFO`` (those constants are
+ available in :mod:`stat`). For ``stat.S_IFCHR`` and ``stat.S_IFBLK``,
+ *device* defines the newly created device special file (probably using
:func:`os.makedev`), otherwise it is ignored.
.. function:: major(device)
Extract the device major number from a raw device number (usually the
- :attr:`st_dev` or :attr:`st_rdev` field from :ctype:`stat`).
+ :attr:`st_dev` or :attr:`st_rdev` field from :c:type:`stat`).
.. function:: minor(device)
Extract the device minor number from a raw device number (usually the
- :attr:`st_dev` or :attr:`st_rdev` field from :ctype:`stat`).
+ :attr:`st_dev` or :attr:`st_rdev` field from :c:type:`stat`).
.. function:: makedev(major, minor)
@@ -1015,17 +1145,20 @@ Files and Directories
Availability: Unix, Windows.
-.. function:: makedirs(path, mode=0o777)
+.. function:: makedirs(path, mode=0o777, exist_ok=False)
.. index::
single: directory; creating
single: UNC paths; and os.makedirs()
Recursive directory creation function. Like :func:`mkdir`, but makes all
- intermediate-level directories needed to contain the leaf directory. Raises
- an :exc:`error` exception if the leaf directory already exists or cannot be
- created. The default *mode* is ``0o777`` (octal). On some systems, *mode*
- is ignored. Where it is used, the current umask value is first masked out.
+ intermediate-level directories needed to contain the leaf directory. If
+ the target directory with the same mode as specified already exists,
+ raises an :exc:`OSError` exception if *exist_ok* is False, otherwise no
+ exception is raised. If the directory cannot be created in other cases,
+ raises an :exc:`OSError` exception. The default *mode* is ``0o777`` (octal).
+ On some systems, *mode* is ignored. Where it is used, the current umask
+ value is first masked out.
.. note::
@@ -1034,6 +1167,9 @@ Files and Directories
This function handles UNC paths correctly.
+ .. versionadded:: 3.2
+ The *exist_ok* parameter.
+
.. function:: pathconf(path, name)
@@ -1072,7 +1208,10 @@ Files and Directories
and the call may raise an UnicodeDecodeError. If the *path* is a bytes
object, the result will be a bytes object.
- Availability: Unix.
+ Availability: Unix, Windows
+
+ .. versionchanged:: 3.2
+ Added support for Windows 6.0 (Vista) symbolic links.
.. function:: remove(path)
@@ -1139,11 +1278,11 @@ Files and Directories
.. function:: stat(path)
- Perform the equivalent of a :cfunc:`stat` system call on the given path.
+ Perform the equivalent of a :c:func:`stat` system call on the given path.
(This function follows symlinks; to stat a symlink use :func:`lstat`.)
The return value is an object whose attributes correspond to the members
- of the :ctype:`stat` structure, namely:
+ of the :c:type:`stat` structure, namely:
* :attr:`st_mode` - protection bits,
* :attr:`st_ino` - inode number,
@@ -1187,7 +1326,7 @@ Files and Directories
For backward compatibility, the return value of :func:`~os.stat` is also accessible
as a tuple of at least 10 integers giving the most important (and portable)
- members of the :ctype:`stat` structure, in the order :attr:`st_mode`,
+ members of the :c:type:`stat` structure, in the order :attr:`st_mode`,
:attr:`st_ino`, :attr:`st_dev`, :attr:`st_nlink`, :attr:`st_uid`,
:attr:`st_gid`, :attr:`st_size`, :attr:`st_atime`, :attr:`st_mtime`,
:attr:`st_ctime`. More items may be added at the end by some implementations.
@@ -1195,7 +1334,7 @@ Files and Directories
.. index:: module: stat
The standard module :mod:`stat` defines functions and constants that are useful
- for extracting information from a :ctype:`stat` structure. (On Windows, some
+ for extracting information from a :c:type:`stat` structure. (On Windows, some
items are filled with dummy values.)
Example::
@@ -1203,9 +1342,11 @@ Files and Directories
>>> import os
>>> statinfo = os.stat('somefile.txt')
>>> statinfo
- (33188, 422511, 769, 1, 1032, 100, 926, 1105022698,1105022732, 1105022732)
+ posix.stat_result(st_mode=33188, st_ino=7876932, st_dev=234881026,
+ st_nlink=1, st_uid=501, st_gid=501, st_size=264, st_atime=1297230295,
+ st_mtime=1297230027, st_ctime=1297230027)
>>> statinfo.st_size
- 926
+ 264
Availability: Unix, Windows.
@@ -1237,21 +1378,58 @@ Files and Directories
.. function:: statvfs(path)
- Perform a :cfunc:`statvfs` system call on the given path. The return value is
+ Perform a :c:func:`statvfs` system call on the given path. The return value is
an object whose attributes describe the filesystem on the given path, and
- correspond to the members of the :ctype:`statvfs` structure, namely:
+ correspond to the members of the :c:type:`statvfs` structure, namely:
:attr:`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:`f_bfree`,
:attr:`f_bavail`, :attr:`f_files`, :attr:`f_ffree`, :attr:`f_favail`,
:attr:`f_flag`, :attr:`f_namemax`.
+ Two module-level constants are defined for the :attr:`f_flag` attribute's
+ bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted
+ read-only, and if :const:`ST_NOSUID` is set, the semantics of
+ setuid/setgid bits are disabled or not supported.
+
+ .. versionchanged:: 3.2
+ The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added.
+
Availability: Unix.
.. function:: symlink(source, link_name)
+ symlink(source, link_name, target_is_directory=False)
Create a symbolic link pointing to *source* named *link_name*.
- Availability: Unix.
+ On Windows, symlink version takes an additional optional parameter,
+ *target_is_directory*, which defaults to ``False``.
+
+ On Windows, a symlink represents a file or a directory, and does not morph to
+ the target dynamically. For this reason, when creating a symlink on Windows,
+ if the target is not already present, the symlink will default to being a
+ file symlink. If *target_is_directory* is set to ``True``, the symlink will
+ be created as a directory symlink. This parameter is ignored if the target
+ exists (and the symlink is created with the same type as the target).
+
+ Symbolic link support was introduced in Windows 6.0 (Vista). :func:`symlink`
+ will raise a :exc:`NotImplementedError` on Windows versions earlier than 6.0.
+
+ .. note::
+
+ The *SeCreateSymbolicLinkPrivilege* is required in order to successfully
+ create symlinks. This privilege is not typically granted to regular
+ users but is available to accounts which can escalate privileges to the
+ administrator level. Either obtaining the privilege or running your
+ application as an administrator are ways to successfully create symlinks.
+
+
+ :exc:`OSError` is raised when the function is called by an unprivileged
+ user.
+
+ Availability: Unix, Windows.
+
+ .. versionchanged:: 3.2
+ Added support for Windows 6.0 (Vista) symbolic links.
.. function:: unlink(path)
@@ -1279,7 +1457,7 @@ Files and Directories
Availability: Unix, Windows.
-.. function:: walk(top[, topdown=True [, onerror=None[, followlinks=False]]])
+.. function:: walk(top, topdown=True, onerror=None, followlinks=False)
.. index::
single: directory; walking
@@ -1373,7 +1551,7 @@ The various :func:`exec\*` functions take a list of arguments for the new
program loaded into the process. In each case, the first of these arguments is
passed to the new program as its own name rather than as an argument a user may
have typed on a command line. For the C programmer, this is the ``argv[0]``
-passed to a program's :cfunc:`main`. For example, ``os.execv('/bin/echo',
+passed to a program's :c:func:`main`. For example, ``os.execv('/bin/echo',
['foo', 'bar'])`` will only print ``bar`` on standard output; ``foo`` will seem
to be ignored.
@@ -1616,7 +1794,17 @@ written in Python, such as a mail server's external command delivery program.
Send signal *sig* to the process *pid*. Constants for the specific signals
available on the host platform are defined in the :mod:`signal` module.
- Availability: Unix.
+
+ Windows: The :data:`signal.CTRL_C_EVENT` and
+ :data:`signal.CTRL_BREAK_EVENT` signals are special signals which can
+ only be sent to console processes which share a common console window,
+ e.g., some subprocesses. Any other value for *sig* will cause the process
+ to be unconditionally killed by the TerminateProcess API, and the exit code
+ will be set to *sig*. The Windows version of :func:`kill` additionally takes
+ process handles to be killed.
+
+ .. versionadded:: 3.2
+ Windows support.
.. function:: killpg(pgid, sig)
@@ -1767,7 +1955,7 @@ written in Python, such as a mail server's external command delivery program.
There is no option to wait for the application to close, and no way to retrieve
the application's exit status. The *path* parameter is relative to the current
directory. If you want to use an absolute path, make sure the first character
- is not a slash (``'/'``); the underlying Win32 :cfunc:`ShellExecute` function
+ is not a slash (``'/'``); the underlying Win32 :c:func:`ShellExecute` function
doesn't work if it is. Use the :func:`os.path.normpath` function to ensure that
the path is properly encoded for Win32.
@@ -1777,14 +1965,14 @@ written in Python, such as a mail server's external command delivery program.
.. function:: system(command)
Execute the command (a string) in a subshell. This is implemented by calling
- the Standard C function :cfunc:`system`, and has the same limitations.
+ the Standard C function :c:func:`system`, and has the same limitations.
Changes to :data:`sys.stdin`, etc. are not reflected in the environment of
the executed command. If *command* generates any output, it will be sent to
the interpreter standard output stream.
On Unix, the return value is the exit status of the process encoded in the
format specified for :func:`wait`. Note that POSIX does not specify the
- meaning of the return value of the C :cfunc:`system` function, so the return
+ meaning of the return value of the C :c:func:`system` function, so the return
value of the Python function is system-dependent.
On Windows, the return value is that returned by the system shell after
diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst
index 3972f14bcb..3b5a7e4212 100644
--- a/Doc/library/ossaudiodev.rst
+++ b/Doc/library/ossaudiodev.rst
@@ -1,4 +1,3 @@
-
:mod:`ossaudiodev` --- Access to OSS-compatible audio devices
=============================================================
@@ -57,7 +56,7 @@ the standard audio interface for Linux and recent versions of FreeBSD.
what went wrong.
(If :mod:`ossaudiodev` receives an error from a system call such as
- :cfunc:`open`, :cfunc:`write`, or :cfunc:`ioctl`, it raises :exc:`IOError`.
+ :c:func:`open`, :c:func:`write`, or :c:func:`ioctl`, it raises :exc:`IOError`.
Errors detected directly by :mod:`ossaudiodev` result in :exc:`OSSAudioError`.)
(For backwards compatibility, the exception class is also available as
@@ -160,6 +159,11 @@ and (read-only) attributes:
is only useful in non-blocking mode. Has no return value, since the amount of
data written is always equal to the amount of data supplied.
+.. versionchanged:: 3.2
+ Audio device objects also support the context manager protocol, i.e. they can
+ be used in a :keyword:`with` statement.
+
+
The following methods each map to exactly one :func:`ioctl` system call. The
correspondence is obvious: for example, :meth:`setfmt` corresponds to the
``SNDCTL_DSP_SETFMT`` ioctl, and :meth:`sync` to ``SNDCTL_DSP_SYNC`` (this can
@@ -347,6 +351,10 @@ The mixer object provides two file-like methods:
Returns the file handle number of the open mixer device file.
+.. versionchanged:: 3.2
+ Mixer objects also support the context manager protocol.
+
+
The remaining methods are specific to audio mixing:
diff --git a/Doc/library/parser.rst b/Doc/library/parser.rst
index 50b94c1750..3e1e31bc79 100644
--- a/Doc/library/parser.rst
+++ b/Doc/library/parser.rst
@@ -1,4 +1,3 @@
-
:mod:`parser` --- Access Python parse trees
===========================================
@@ -165,7 +164,7 @@ executable code objects. Parse trees may be extracted with or without line
numbering information.
-.. function:: st2list(st[, line_info])
+.. function:: st2list(st, line_info=False, col_info=False)
This function accepts an ST object from the caller in *st* and returns a
Python list representing the equivalent parse tree. The resulting list
@@ -183,7 +182,7 @@ numbering information.
This information is omitted if the flag is false or omitted.
-.. function:: st2tuple(st[, line_info])
+.. function:: st2tuple(st, line_info=False, col_info=False)
This function accepts an ST object from the caller in *st* and returns a
Python tuple representing the equivalent parse tree. Other than returning a
@@ -194,7 +193,7 @@ numbering information.
information is omitted if the flag is false or omitted.
-.. function:: compilest(st[, filename='<syntax-tree>'])
+.. function:: compilest(st, filename='<syntax-tree>')
.. index::
builtin: exec
@@ -293,7 +292,7 @@ ST objects (using the :mod:`pickle` module) is also supported.
ST objects have the following methods:
-.. method:: ST.compile([filename])
+.. method:: ST.compile(filename='<syntax-tree>')
Same as ``compilest(st, filename)``.
@@ -308,14 +307,14 @@ ST objects have the following methods:
Same as ``issuite(st)``.
-.. method:: ST.tolist([line_info])
+.. method:: ST.tolist(line_info=False, col_info=False)
- Same as ``st2list(st, line_info)``.
+ Same as ``st2list(st, line_info, col_info)``.
-.. method:: ST.totuple([line_info])
+.. method:: ST.totuple(line_info=False, col_info=False)
- Same as ``st2tuple(st, line_info)``.
+ Same as ``st2tuple(st, line_info, col_info)``.
Example: Emulation of :func:`compile`
diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst
index ee63ebb15b..1e9de63b69 100644
--- a/Doc/library/pdb.rst
+++ b/Doc/library/pdb.rst
@@ -20,9 +20,9 @@ supports post-mortem debugging and can be called under program control.
module: bdb
module: cmd
-The debugger is extensible --- it is actually defined as the class :class:`Pdb`.
+The debugger is extensible -- it is actually defined as the class :class:`Pdb`.
This is currently undocumented but easily understood by reading the source. The
-extension interface uses the modules :mod:`bdb` (undocumented) and :mod:`cmd`.
+extension interface uses the modules :mod:`bdb` and :mod:`cmd`.
The debugger's prompt is ``(Pdb)``. Typical usage to run a program under control
of the debugger is::
@@ -44,19 +44,23 @@ example::
python3 -m pdb myscript.py
When invoked as a script, pdb will automatically enter post-mortem debugging if
-the program being debugged exits abnormally. After post-mortem debugging (or
-after normal exit of the program), pdb will restart the program. Automatic
+the program being debugged exits abnormally. After post-mortem debugging (or
+after normal exit of the program), pdb will restart the program. Automatic
restarting preserves pdb's state (such as breakpoints) and in most cases is more
useful than quitting the debugger upon program's exit.
+.. versionadded:: 3.2
+ :file:`pdb.py` now accepts a ``-c`` option that executes commands as if given
+ in a :file:`.pdbrc` file, see :ref:`debugger-commands`.
+
The typical usage to break into the debugger from a running program is to
insert ::
import pdb; pdb.set_trace()
at the location you want to break into the debugger. You can then step through
-the code following this statement, and continue running without the debugger using
-the ``c`` command.
+the code following this statement, and continue running without the debugger
+using the :pdbcmd:`continue` command.
The typical usage to inspect a crashed program is::
@@ -79,29 +83,31 @@ The typical usage to inspect a crashed program is::
The module defines the following functions; each enters the debugger in a
slightly different way:
-.. function:: run(statement[, globals[, locals]])
+.. function:: run(statement, globals=None, locals=None)
- Execute the *statement* (given as a string) under debugger control. The
- debugger prompt appears before any code is executed; you can set breakpoints and
- type ``continue``, or you can step through the statement using ``step`` or
- ``next`` (all these commands are explained below). The optional *globals* and
- *locals* arguments specify the environment in which the code is executed; by
- default the dictionary of the module :mod:`__main__` is used. (See the
- explanation of the built-in :func:`exec` or :func:`eval` functions.)
+ Execute the *statement* (given as a string or a code object) under debugger
+ control. The debugger prompt appears before any code is executed; you can
+ set breakpoints and type :pdbcmd:`continue`, or you can step through the
+ statement using :pdbcmd:`step` or :pdbcmd:`next` (all these commands are
+ explained below). The optional *globals* and *locals* arguments specify the
+ environment in which the code is executed; by default the dictionary of the
+ module :mod:`__main__` is used. (See the explanation of the built-in
+ :func:`exec` or :func:`eval` functions.)
-.. function:: runeval(expression[, globals[, locals]])
+.. function:: runeval(expression, globals=None, locals=None)
- Evaluate the *expression* (given as a string) under debugger control. When
- :func:`runeval` returns, it returns the value of the expression. Otherwise this
- function is similar to :func:`run`.
+ Evaluate the *expression* (given as a string or a code object) under debugger
+ control. When :func:`runeval` returns, it returns the value of the
+ expression. Otherwise this function is similar to :func:`run`.
-.. function:: runcall(function[, argument, ...])
+.. function:: runcall(function, *args, **kwds)
- Call the *function* (a function or method object, not a string) with the given
- arguments. When :func:`runcall` returns, it returns whatever the function call
- returned. The debugger prompt appears as soon as the function is entered.
+ Call the *function* (a function or method object, not a string) with the
+ given arguments. When :func:`runcall` returns, it returns whatever the
+ function call returned. The debugger prompt appears as soon as the function
+ is entered.
.. function:: set_trace()
@@ -111,7 +117,7 @@ slightly different way:
being debugged (e.g. when an assertion fails).
-.. function:: post_mortem([traceback])
+.. function:: post_mortem(traceback=None)
Enter post-mortem debugging of the given *traceback* object. If no
*traceback* is given, it uses the one of the exception that is currently
@@ -129,7 +135,8 @@ The ``run*`` functions and :func:`set_trace` are aliases for instantiating the
:class:`Pdb` class and calling the method of the same name. If you want to
access further features, you have to do this yourself:
-.. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None)
+.. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None, \
+ nosigint=False)
:class:`Pdb` is the debugger class.
@@ -140,6 +147,11 @@ access further features, you have to do this yourself:
patterns. The debugger will not step into frames that originate in a module
that matches one of these patterns. [1]_
+ By default, Pdb sets a handler for the SIGINT signal (which is sent when the
+ user presses Ctrl-C on the console) when you give a ``continue`` command.
+ This allows you to break into the debugger again by pressing Ctrl-C. If you
+ want Pdb not to touch the SIGINT handler, set *nosigint* tot true.
+
Example call to enable tracing with *skip*::
import pdb; pdb.Pdb(skip=['django.*']).set_trace()
@@ -147,9 +159,13 @@ access further features, you have to do this yourself:
.. versionadded:: 3.1
The *skip* argument.
- .. method:: run(statement[, globals[, locals]])
- runeval(expression[, globals[, locals]])
- runcall(function[, argument, ...])
+ .. versionadded:: 3.2
+ The *nosigint* argument. Previously, a SIGINT handler was never set by
+ Pdb.
+
+ .. method:: run(statement, globals=None, locals=None)
+ runeval(expression, globals=None, locals=None)
+ runcall(function, *args, **kwds)
set_trace()
See the documentation for the functions explained above.
@@ -160,16 +176,17 @@ access further features, you have to do this yourself:
Debugger Commands
-----------------
-The debugger recognizes the following commands. Most commands can be
-abbreviated to one or two letters; e.g. ``h(elp)`` means that either ``h`` or
-``help`` can be used to enter the help command (but not ``he`` or ``hel``, nor
-``H`` or ``Help`` or ``HELP``). Arguments to commands must be separated by
-whitespace (spaces or tabs). Optional arguments are enclosed in square brackets
-(``[]``) in the command syntax; the square brackets must not be typed.
-Alternatives in the command syntax are separated by a vertical bar (``|``).
+The commands recognized by the debugger are listed below. Most commands can be
+abbreviated to one or two letters as indicated; e.g. ``h(elp)`` means that
+either ``h`` or ``help`` can be used to enter the help command (but not ``he``
+or ``hel``, nor ``H`` or ``Help`` or ``HELP``). Arguments to commands must be
+separated by whitespace (spaces or tabs). Optional arguments are enclosed in
+square brackets (``[]``) in the command syntax; the square brackets must not be
+typed. Alternatives in the command syntax are separated by a vertical bar
+(``|``).
Entering a blank line repeats the last command entered. Exception: if the last
-command was a ``list`` command, the next 11 lines are listed.
+command was a :pdbcmd:`list` command, the next 11 lines are listed.
Commands that the debugger doesn't recognize are assumed to be Python statements
and are executed in the context of the program being debugged. Python
@@ -179,92 +196,112 @@ change a variable or call a function. When an exception occurs in such a
statement, the exception name is printed but the debugger's state is not
changed.
+The debugger supports :ref:`aliases <debugger-aliases>`. Aliases can have
+parameters which allows one a certain level of adaptability to the context under
+examination.
+
Multiple commands may be entered on a single line, separated by ``;;``. (A
single ``;`` is not used as it is the separator for multiple commands in a line
-that is passed to the Python parser.) No intelligence is applied to separating
+that is passed to the Python parser.) No intelligence is applied to separating
the commands; the input is split at the first ``;;`` pair, even if it is in the
middle of a quoted string.
-The debugger supports aliases. Aliases can have parameters which allows one a
-certain level of adaptability to the context under examination.
-
.. index::
pair: .pdbrc; file
triple: debugger; configuration; file
-If a file :file:`.pdbrc` exists in the user's home directory or in the current
+If a file :file:`.pdbrc` exists in the user's home directory or in the current
directory, it is read in and executed as if it had been typed at the debugger
-prompt. This is particularly useful for aliases. If both files exist, the one
+prompt. This is particularly useful for aliases. If both files exist, the one
in the home directory is read first and aliases defined there can be overridden
by the local file.
-h(elp) [*command*]
+.. versionchanged:: 3.2
+ :file:`.pdbrc` can now contain commands that continue debugging, such as
+ :pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no
+ effect.
+
+
+.. pdbcommand:: h(elp) [command]
+
Without argument, print the list of available commands. With a *command* as
argument, print help about that command. ``help pdb`` displays the full
- documentation file; if the environment variable :envvar:`PAGER` is defined, the
- file is piped through that command instead. Since the *command* argument must
- be an identifier, ``help exec`` must be entered to get help on the ``!``
- command.
+ documentation (the docstring of the :mod:`pdb` module). Since the *command*
+ argument must be an identifier, ``help exec`` must be entered to get help on
+ the ``!`` command.
+
+.. pdbcommand:: w(here)
-w(here)
Print a stack trace, with the most recent frame at the bottom. An arrow
indicates the current frame, which determines the context of most commands.
-d(own)
- Move the current frame one level down in the stack trace (to a newer frame).
+.. pdbcommand:: d(own) [count]
+
+ Move the current frame *count* (default one) levels down in the stack trace
+ (to a newer frame).
+
+.. pdbcommand:: u(p) [count]
+
+ Move the current frame *count* (default one) levels up in the stack trace (to
+ an older frame).
-u(p)
- Move the current frame one level up in the stack trace (to an older frame).
+.. pdbcommand:: b(reak) [([filename:]lineno | function) [, condition]]
-b(reak) [[*filename*:]\ *lineno* | *function*\ [, *condition*]]
With a *lineno* argument, set a break there in the current file. With a
- *function* argument, set a break at the first executable statement within that
- function. The line number may be prefixed with a filename and a colon, to
- specify a breakpoint in another file (probably one that hasn't been loaded yet).
- The file is searched on ``sys.path``. Note that each breakpoint is assigned a
- number to which all the other breakpoint commands refer.
+ *function* argument, set a break at the first executable statement within
+ that function. The line number may be prefixed with a filename and a colon,
+ to specify a breakpoint in another file (probably one that hasn't been loaded
+ yet). The file is searched on :data:`sys.path`. Note that each breakpoint
+ is assigned a number to which all the other breakpoint commands refer.
- If a second argument is present, it is an expression which must evaluate to true
- before the breakpoint is honored.
+ If a second argument is present, it is an expression which must evaluate to
+ true before the breakpoint is honored.
- Without argument, list all breaks, including for each breakpoint, the number of
- times that breakpoint has been hit, the current ignore count, and the associated
- condition if any.
+ Without argument, list all breaks, including for each breakpoint, the number
+ of times that breakpoint has been hit, the current ignore count, and the
+ associated condition if any.
-tbreak [[*filename*:]\ *lineno* | *function*\ [, *condition*]]
- Temporary breakpoint, which is removed automatically when it is first hit. The
- arguments are the same as break.
+.. pdbcommand:: tbreak [([filename:]lineno | function) [, condition]]
+
+ Temporary breakpoint, which is removed automatically when it is first hit.
+ The arguments are the same as for :pdbcmd:`break`.
+
+.. pdbcommand:: cl(ear) [filename:lineno | bpnumber [bpnumber ...]]
-cl(ear) [*filename:lineno* | *bpnumber* [*bpnumber ...*]]
With a *filename:lineno* argument, clear all the breakpoints at this line.
With a space separated list of breakpoint numbers, clear those breakpoints.
Without argument, clear all breaks (but first ask confirmation).
-disable [*bpnumber* [*bpnumber ...*]]
- Disables the breakpoints given as a space separated list of breakpoint numbers.
- Disabling a breakpoint means it cannot cause the program to stop execution, but
- unlike clearing a breakpoint, it remains in the list of breakpoints and can be
- (re-)enabled.
+.. pdbcommand:: disable [bpnumber [bpnumber ...]]
+
+ Disable the breakpoints given as a space separated list of breakpoint
+ numbers. Disabling a breakpoint means it cannot cause the program to stop
+ execution, but unlike clearing a breakpoint, it remains in the list of
+ breakpoints and can be (re-)enabled.
-enable [*bpnumber* [*bpnumber ...*]]
- Enables the breakpoints specified.
+.. pdbcommand:: enable [bpnumber [bpnumber ...]]
-ignore *bpnumber* [*count*]
- Sets the ignore count for the given breakpoint number. If count is omitted, the
- ignore count is set to 0. A breakpoint becomes active when the ignore count is
- zero. When non-zero, the count is decremented each time the breakpoint is
- reached and the breakpoint is not disabled and any associated condition
- evaluates to true.
+ Enable the breakpoints specified.
-condition *bpnumber* [*condition*]
- Condition is an expression which must evaluate to true before the breakpoint is
- honored. If condition is absent, any existing condition is removed; i.e., the
- breakpoint is made unconditional.
+.. pdbcommand:: ignore bpnumber [count]
+
+ Set the ignore count for the given breakpoint number. If count is omitted,
+ the ignore count is set to 0. A breakpoint becomes active when the ignore
+ count is zero. When non-zero, the count is decremented each time the
+ breakpoint is reached and the breakpoint is not disabled and any associated
+ condition evaluates to true.
+
+.. pdbcommand:: condition bpnumber [condition]
+
+ Set a new *condition* for the breakpoint, an expression which must evaluate
+ to true before the breakpoint is honored. If *condition* is absent, any
+ existing condition is removed; i.e., the breakpoint is made unconditional.
+
+.. pdbcommand:: commands [bpnumber]
-commands [*bpnumber*]
Specify a list of commands for breakpoint number *bpnumber*. The commands
- themselves appear on the following lines. Type a line containing just 'end' to
- terminate the commands. An example::
+ themselves appear on the following lines. Type a line containing just
+ ``end`` to terminate the commands. An example::
(Pdb) commands 1
(com) print some_variable
@@ -272,12 +309,12 @@ commands [*bpnumber*]
(Pdb)
To remove all commands from a breakpoint, type commands and follow it
- immediately with end; that is, give no commands.
+ immediately with ``end``; that is, give no commands.
With no *bpnumber* argument, commands refers to the last breakpoint set.
- You can use breakpoint commands to start your program up again. Simply use the
- continue command, or step, or any other command that resumes execution.
+ You can use breakpoint commands to start your program up again. Simply use
+ the continue command, or step, or any other command that resumes execution.
Specifying any command resuming execution (currently continue, step, next,
return, jump, quit and their abbreviations) terminates the command list (as if
@@ -291,91 +328,169 @@ commands [*bpnumber*]
that are to print a specific message and then continue. If none of the other
commands print anything, you see no sign that the breakpoint was reached.
-s(tep)
+.. pdbcommand:: s(tep)
+
Execute the current line, stop at the first possible occasion (either in a
function that is called or on the next line in the current function).
-n(ext)
- Continue execution until the next line in the current function is reached or it
- returns. (The difference between ``next`` and ``step`` is that ``step`` stops
- inside a called function, while ``next`` executes called functions at (nearly)
- full speed, only stopping at the next line in the current function.)
+.. pdbcommand:: n(ext)
+
+ Continue execution until the next line in the current function is reached or
+ it returns. (The difference between :pdbcmd:`next` and :pdbcmd:`step` is
+ that :pdbcmd:`step` stops inside a called function, while :pdbcmd:`next`
+ executes called functions at (nearly) full speed, only stopping at the next
+ line in the current function.)
+
+.. pdbcommand:: unt(il) [lineno]
-unt(il)
- Continue execution until the line with the line number greater than the
- current one is reached or when returning from current frame.
+ Without argument, continue execution until the line with a number greater
+ than the current one is reached.
+
+ With a line number, continue execution until a line with a number greater or
+ equal to that is reached. In both cases, also stop when the current frame
+ returns.
+
+ .. versionchanged:: 3.2
+ Allow giving an explicit line number.
+
+.. pdbcommand:: r(eturn)
-r(eturn)
Continue execution until the current function returns.
-c(ont(inue))
+.. pdbcommand:: c(ont(inue))
+
Continue execution, only stop when a breakpoint is encountered.
-j(ump) *lineno*
+.. pdbcommand:: j(ump) lineno
+
Set the next line that will be executed. Only available in the bottom-most
- frame. This lets you jump back and execute code again, or jump forward to skip
- code that you don't want to run.
+ frame. This lets you jump back and execute code again, or jump forward to
+ skip code that you don't want to run.
- It should be noted that not all jumps are allowed --- for instance it is not
+ It should be noted that not all jumps are allowed -- for instance it is not
possible to jump into the middle of a :keyword:`for` loop or out of a
:keyword:`finally` clause.
-l(ist) [*first*\ [, *last*]]
- List source code for the current file. Without arguments, list 11 lines around
- the current line or continue the previous listing. With one argument, list 11
- lines around at that line. With two arguments, list the given range; if the
- second argument is less than the first, it is interpreted as a count.
+.. pdbcommand:: l(ist) [first[, last]]
+
+ List source code for the current file. Without arguments, list 11 lines
+ around the current line or continue the previous listing. With ``.`` as
+ argument, list 11 lines around the current line. With one argument,
+ list 11 lines around at that line. With two arguments, list the given range;
+ if the second argument is less than the first, it is interpreted as a count.
+
+ The current line in the current frame is indicated by ``->``. If an
+ exception is being debugged, the line where the exception was originally
+ raised or propagated is indicated by ``>>``, if it differs from the current
+ line.
+
+ .. versionadded:: 3.2
+ The ``>>`` marker.
+
+.. pdbcommand:: ll | longlist
+
+ List all source code for the current function or frame. Interesting lines
+ are marked as for :pdbcmd:`list`.
+
+ .. versionadded:: 3.2
+
+.. pdbcommand:: a(rgs)
-a(rgs)
Print the argument list of the current function.
-p(rint) *expression*
+.. pdbcommand:: p(rint) expression
+
Evaluate the *expression* in the current context and print its value.
-pp *expression*
- Like the ``p`` command, except the value of the expression is pretty-printed
- using the :mod:`pprint` module.
+.. pdbcommand:: pp expression
+
+ Like the :pdbcmd:`print` command, except the value of the expression is
+ pretty-printed using the :mod:`pprint` module.
+
+.. pdbcommand:: whatis expression
+
+ Print the type of the *expression*.
+
+.. pdbcommand:: source expression
+
+ Try to get source code for the given object and display it.
+
+ .. versionadded:: 3.2
+
+.. pdbcommand:: display [expression]
+
+ Display the value of the expression if it changed, each time execution stops
+ in the current frame.
-alias [*name* [command]]
- Creates an alias called *name* that executes *command*. The command must *not*
- be enclosed in quotes. Replaceable parameters can be indicated by ``%1``,
- ``%2``, and so on, while ``%*`` is replaced by all the parameters. If no
- command is given, the current alias for *name* is shown. If no arguments are
- given, all aliases are listed.
+ Without expression, list all display expressions for the current frame.
- Aliases may be nested and can contain anything that can be legally typed at the
- pdb prompt. Note that internal pdb commands *can* be overridden by aliases.
- Such a command is then hidden until the alias is removed. Aliasing is
- recursively applied to the first word of the command line; all other words in
- the line are left alone.
+ .. versionadded:: 3.2
+
+.. pdbcommand:: undisplay [expression]
+
+ Do not display the expression any more in the current frame. Without
+ expression, clear all display expressions for the current frame.
+
+ .. versionadded:: 3.2
+
+.. pdbcommand:: interact
+
+ Start an interative interpreter (using the :mod:`code` module) whose global
+ namespace contains all the (global and local) names found in the current
+ scope.
+
+ .. versionadded:: 3.2
+
+.. _debugger-aliases:
+
+.. pdbcommand:: alias [name [command]]
+
+ Create an alias called *name* that executes *command*. The command must
+ *not* be enclosed in quotes. Replaceable parameters can be indicated by
+ ``%1``, ``%2``, and so on, while ``%*`` is replaced by all the parameters.
+ If no command is given, the current alias for *name* is shown. If no
+ arguments are given, all aliases are listed.
+
+ Aliases may be nested and can contain anything that can be legally typed at
+ the pdb prompt. Note that internal pdb commands *can* be overridden by
+ aliases. Such a command is then hidden until the alias is removed. Aliasing
+ is recursively applied to the first word of the command line; all other words
+ in the line are left alone.
As an example, here are two useful aliases (especially when placed in the
:file:`.pdbrc` file)::
- #Print instance variables (usage "pi classInst")
+ # Print instance variables (usage "pi classInst")
alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
- #Print instance variables in self
+ # Print instance variables in self
alias ps pi self
-unalias *name*
- Deletes the specified alias.
+.. pdbcommand:: unalias name
+
+ Delete the specified alias.
+
+.. pdbcommand:: ! statement
-[!]\ *statement*
Execute the (one-line) *statement* in the context of the current stack frame.
The exclamation point can be omitted unless the first word of the statement
- resembles a debugger command. To set a global variable, you can prefix the
- assignment command with a ``global`` command on the same line, e.g.::
+ resembles a debugger command. To set a global variable, you can prefix the
+ assignment command with a :keyword:`global` statement on the same line,
+ e.g.::
(Pdb) global list_options; list_options = ['-l']
(Pdb)
-run [*args* ...]
- Restart the debugged Python program. If an argument is supplied, it is split
- with "shlex" and the result is used as the new sys.argv. History, breakpoints,
- actions and debugger options are preserved. "restart" is an alias for "run".
+.. pdbcommand:: run [args ...]
+ restart [args ...]
+
+ Restart the debugged Python program. If an argument is supplied, it is split
+ with :mod:`shlex` and the result is used as the new :data:`sys.argv`.
+ History, breakpoints, actions and debugger options are preserved.
+ :pdbcmd:`restart` is an alias for :pdbcmd:`run`.
+
+.. pdbcommand:: q(uit)
-q(uit)
- Quit from the debugger. The program being executed is aborted.
+ Quit from the debugger. The program being executed is aborted.
.. rubric:: Footnotes
diff --git a/Doc/library/persistence.rst b/Doc/library/persistence.rst
index b90b2e1a80..d5bb193fa3 100644
--- a/Doc/library/persistence.rst
+++ b/Doc/library/persistence.rst
@@ -1,4 +1,3 @@
-
.. _persistence:
****************
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
index 1850b00374..73f0611a16 100644
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -141,7 +141,7 @@ an unpickler, then you call the unpickler's :meth:`load` method. The
The :mod:`pickle` module provides the following functions to make the pickling
process more convenient:
-.. function:: dump(obj, file[, protocol, \*, fix_imports=True])
+.. function:: dump(obj, file, protocol=None, \*, fix_imports=True)
Write a pickled representation of *obj* to the open :term:`file object` *file*.
This is equivalent to ``Pickler(file, protocol).dump(obj)``.
@@ -163,7 +163,7 @@ process more convenient:
map the new Python 3.x names to the old module names used in Python 2.x,
so that the pickle data stream is readable with Python 2.x.
-.. function:: dumps(obj[, protocol, \*, fix_imports=True])
+.. function:: dumps(obj, protocol=None, \*, fix_imports=True)
Return the pickled representation of the object as a :class:`bytes`
object, instead of writing it to a file.
@@ -180,7 +180,7 @@ process more convenient:
map the new Python 3.x names to the old module names used in Python 2.x,
so that the pickle data stream is readable with Python 2.x.
-.. function:: load(file, [\*, fix_imports=True, encoding="ASCII", errors="strict"])
+.. function:: load(file, \*, fix_imports=True, encoding="ASCII", errors="strict")
Read a pickled object representation from the open :term:`file object` *file*
and return the reconstituted object hierarchy specified therein. This is
@@ -203,7 +203,7 @@ process more convenient:
*errors* tell pickle how to decode 8-bit string instances pickled by Python
2.x; these default to 'ASCII' and 'strict', respectively.
-.. function:: loads(bytes_object, [\*, fix_imports=True, encoding="ASCII", errors="strict"])
+.. function:: loads(bytes_object, \*, fix_imports=True, encoding="ASCII", errors="strict")
Read a pickled object hierarchy from a :class:`bytes` object and return the
reconstituted object hierarchy specified therein
@@ -248,7 +248,7 @@ The :mod:`pickle` module defines three exceptions:
The :mod:`pickle` module exports two classes, :class:`Pickler` and
:class:`Unpickler`:
-.. class:: Pickler(file[, protocol, \*, fix_imports=True])
+.. class:: Pickler(file, protocol=None, \*, fix_imports=True)
This takes a binary file for writing a pickle data stream.
@@ -296,7 +296,7 @@ The :mod:`pickle` module exports two classes, :class:`Pickler` and
Use :func:`pickletools.optimize` if you need more compact pickles.
-.. class:: Unpickler(file, [\*, fix_imports=True, encoding="ASCII", errors="strict"])
+.. class:: Unpickler(file, \*, fix_imports=True, encoding="ASCII", errors="strict")
This takes a binary file for reading a pickle data stream.
diff --git a/Doc/library/pickletools.rst b/Doc/library/pickletools.rst
index 88ecbab919..4c0a148bc3 100644
--- a/Doc/library/pickletools.rst
+++ b/Doc/library/pickletools.rst
@@ -2,7 +2,13 @@
==================================================
.. module:: pickletools
- :synopsis: Contains extensive comments about the pickle protocols and pickle-machine opcodes, as well as some useful functions.
+ :synopsis: Contains extensive comments about the pickle protocols and
+ pickle-machine opcodes, as well as some useful functions.
+
+**Source code:** :source:`Lib/pickletools.py`
+
+--------------
+
This module contains various constants relating to the intimate details of the
:mod:`pickle` module, some lengthy comments about the implementation, and a
@@ -11,15 +17,81 @@ are useful for Python core developers who are working on the :mod:`pickle`;
ordinary users of the :mod:`pickle` module probably won't find the
:mod:`pickletools` module relevant.
+Command line usage
+------------------
+
+.. versionadded:: 3.2
+
+When invoked from the command line, ``python -m pickletools`` will
+disassemble the contents of one or more pickle files. Note that if
+you want to see the Python object stored in the pickle rather than the
+details of pickle format, you may want to use ``-m pickle`` instead.
+However, when the pickle file that you want to examine comes from an
+untrusted source, ``-m pickletools`` is a safer option because it does
+not execute pickle bytecode.
+
+For example, with a tuple ``(1, 2)`` pickled in file ``x.pickle``::
+
+ $ python -m pickle x.pickle
+ (1, 2)
+
+ $ python -m pickletools x.pickle
+ 0: \x80 PROTO 3
+ 2: K BININT1 1
+ 4: K BININT1 2
+ 6: \x86 TUPLE2
+ 7: q BINPUT 0
+ 9: . STOP
+ highest protocol among opcodes = 2
+
+Command line options
+^^^^^^^^^^^^^^^^^^^^
+
+.. program:: pickletools
+
+.. cmdoption:: -a, --annotate
+
+ Annotate each line with a short opcode description.
+
+.. cmdoption:: -o, --output=<file>
+
+ Name of a file where the output should be written.
+
+.. cmdoption:: -l, --indentlevel=<num>
+
+ The number of blanks by which to indent a new MARK level.
+
+.. cmdoption:: -m, --memo
+
+ When multiple objects are disassembled, preserve memo between
+ disassemblies.
+
+.. cmdoption:: -p, --preamble=<preamble>
+
+ When more than one pickle file are specified, print given preamble
+ before each disassembly.
+
+
+
+Programmatic Interface
+----------------------
+
+
+.. function:: dis(pickle, out=None, memo=None, indentlevel=4, annotate=0)
-.. function:: dis(pickle[, out=None, memo=None, indentlevel=4])
+ Outputs a symbolic disassembly of the pickle to the file-like
+ object *out*, defaulting to ``sys.stdout``. *pickle* can be a
+ string or a file-like object. *memo* can be a Python dictionary
+ that will be used as the pickle's memo; it can be used to perform
+ disassemblies across multiple pickles created by the same
+ pickler. Successive levels, indicated by ``MARK`` opcodes in the
+ stream, are indented by *indentlevel* spaces. If a nonzero value
+ is given to *annotate*, each opcode in the output is annotated with
+ a short description. The value of *annotate* is used as a hint for
+ the column where annotation should start.
- Outputs a symbolic disassembly of the pickle to the file-like object *out*,
- defaulting to ``sys.stdout``. *pickle* can be a string or a file-like object.
- *memo* can be a Python dictionary that will be used as the pickle's memo; it can
- be used to perform disassemblies across multiple pickles created by the same
- pickler. Successive levels, indicated by ``MARK`` opcodes in the stream, are
- indented by *indentlevel* spaces.
+ .. versionadded:: 3.2
+ The *annotate* argument.
.. function:: genops(pickle)
diff --git a/Doc/library/pipes.rst b/Doc/library/pipes.rst
index 1f2b2ff239..016a720470 100644
--- a/Doc/library/pipes.rst
+++ b/Doc/library/pipes.rst
@@ -1,4 +1,3 @@
-
:mod:`pipes` --- Interface to shell pipelines
=============================================
@@ -7,6 +6,9 @@
:synopsis: A Python interface to Unix shell pipelines.
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
+**Source code:** :source:`Lib/pipes.py`
+
+--------------
The :mod:`pipes` module defines a class to abstract the concept of a *pipeline*
--- a sequence of converters from one file to another.
diff --git a/Doc/library/pkgutil.rst b/Doc/library/pkgutil.rst
index 5a59f28a05..3118ff2047 100644
--- a/Doc/library/pkgutil.rst
+++ b/Doc/library/pkgutil.rst
@@ -1,10 +1,13 @@
-
:mod:`pkgutil` --- Package extension utility
============================================
.. module:: pkgutil
:synopsis: Utilities for the import system.
+**Source code:** :source:`Lib/pkgutil.py`
+
+--------------
+
This module provides utilities for the import system, in particular package
support.
@@ -168,10 +171,10 @@ support.
Get a resource from a package.
- This is a wrapper for the PEP 302 loader :func:`get_data` API. The package
- argument should be the name of a package, in standard module format
- (foo.bar). The resource argument should be in the form of a relative
- filename, using ``/`` as the path separator. The parent directory name
+ This is a wrapper for the :pep:`302` loader :func:`get_data` API. The
+ *package* argument should be the name of a package, in standard module format
+ (``foo.bar``). The *resource* argument should be in the form of a relative
+ filename, using ``/`` as the path separator. The parent directory name
``..`` is not allowed, and nor is a rooted name (starting with a ``/``).
The function returns a binary string that is the contents of the specified
@@ -183,5 +186,5 @@ support.
d = os.path.dirname(sys.modules[package].__file__)
data = open(os.path.join(d, resource), 'rb').read()
- If the package cannot be located or loaded, or it uses a PEP 302 loader
+ If the package cannot be located or loaded, or it uses a :pep:`302` loader
which does not support :func:`get_data`, then ``None`` is returned.
diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst
index 36275ed226..d8e516633e 100644
--- a/Doc/library/platform.rst
+++ b/Doc/library/platform.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Marc-Andre Lemburg <mal@egenix.com>
.. sectionauthor:: Bjorn Pettersen <bpettersen@corp.fairisaac.com>
+**Source code:** :source:`Lib/platform.py`
+
+--------------
.. note::
@@ -27,8 +30,8 @@ Cross Platform
returned as strings.
Values that cannot be determined are returned as given by the parameter presets.
- If bits is given as ``''``, the :cfunc:`sizeof(pointer)` (or
- :cfunc:`sizeof(long)` on Python version < 1.5.2) is used as indicator for the
+ If bits is given as ``''``, the :c:func:`sizeof(pointer)` (or
+ :c:func:`sizeof(long)` on Python version < 1.5.2) is used as indicator for the
supported pointer size.
The function relies on the system's :file:`file` command to do the actual work.
@@ -225,7 +228,7 @@ Mac OS Platform
Entries which cannot be determined are set to ``''``. All tuple entries are
strings.
- Documentation for the underlying :cfunc:`gestalt` API is available online at
+ Documentation for the underlying :c:func:`gestalt` API is available online at
http://www.rgaros.nl/gestalt/.
diff --git a/Doc/library/plistlib.rst b/Doc/library/plistlib.rst
index 36c9eb3087..ae5e94d1a9 100644
--- a/Doc/library/plistlib.rst
+++ b/Doc/library/plistlib.rst
@@ -11,6 +11,10 @@
pair: plist; file
single: property list
+**Source code:** :source:`Lib/plistlib.py`
+
+--------------
+
This module provides an interface for reading and writing the "property list"
XML files used mainly by Mac OS X.
diff --git a/Doc/library/poplib.rst b/Doc/library/poplib.rst
index 0b2c033af5..d11d937b1f 100644
--- a/Doc/library/poplib.rst
+++ b/Doc/library/poplib.rst
@@ -1,4 +1,3 @@
-
:mod:`poplib` --- POP3 protocol client
======================================
@@ -9,6 +8,10 @@
.. index:: pair: POP3; protocol
+**Source code:** :source:`Lib/poplib.py`
+
+--------------
+
This module defines a class, :class:`POP3`, which encapsulates a connection to a
POP3 server and implements the protocol as defined in :rfc:`1725`. The
:class:`POP3` class supports both the minimal and optional command sets.
@@ -24,7 +27,7 @@ mailserver supports IMAP, you would be better off using the
A single class is provided by the :mod:`poplib` module:
-.. class:: POP3(host[, port[, timeout]])
+.. class:: POP3(host, port=POP3_PORT[, timeout])
This class implements the actual POP3 protocol. The connection is created when
the instance is initialized. If *port* is omitted, the standard POP3 port (110)
@@ -33,12 +36,19 @@ A single class is provided by the :mod:`poplib` module:
be used).
-.. class:: POP3_SSL(host[, port[, keyfile[, certfile]]])
+.. class:: POP3_SSL(host, port=POP3_SSL_PORT, keyfile=None, certfile=None, timeout=None, context=None)
This is a subclass of :class:`POP3` that connects to the server over an SSL
encrypted socket. If *port* is not specified, 995, the standard POP3-over-SSL
port is used. *keyfile* and *certfile* are also optional - they can contain a
PEM formatted private key and certificate chain file for the SSL connection.
+ *timeout* works as in the :class:`POP3` constructor. *context* parameter is a
+ :class:`ssl.SSLContext` object which allows bundling SSL configuration
+ options, certificates and private keys into a single (potentially long-lived)
+ structure.
+
+ .. versionchanged:: 3.2
+ *context* parameter added.
One exception is defined as an attribute of the :mod:`poplib` module:
@@ -160,7 +170,7 @@ An :class:`POP3` instance has the following methods:
POP3 servers you will use before trusting it.
-.. method:: POP3.uidl([which])
+.. method:: POP3.uidl(which=None)
Return message digest (unique id) list. If *which* is specified, result contains
the unique id for that message in the form ``'response mesgnum uid``, otherwise
diff --git a/Doc/library/posix.rst b/Doc/library/posix.rst
index c33d9e59ad..07db2b2af8 100644
--- a/Doc/library/posix.rst
+++ b/Doc/library/posix.rst
@@ -38,13 +38,13 @@ Large File Support
Several operating systems (including AIX, HP-UX, Irix and Solaris) provide
support for files that are larger than 2 GB from a C programming model where
-:ctype:`int` and :ctype:`long` are 32-bit values. This is typically accomplished
+:c:type:`int` and :c:type:`long` are 32-bit values. This is typically accomplished
by defining the relevant size and offset types as 64-bit values. Such files are
sometimes referred to as :dfn:`large files`.
-Large file support is enabled in Python when the size of an :ctype:`off_t` is
-larger than a :ctype:`long` and the :ctype:`long long` type is available and is
-at least as large as an :ctype:`off_t`.
+Large file support is enabled in Python when the size of an :c:type:`off_t` is
+larger than a :c:type:`long` and the :c:type:`long long` type is available and is
+at least as large as an :c:type:`off_t`.
It may be necessary to configure and compile Python with certain compiler flags
to enable this mode. For example, it is enabled by default with recent versions
of Irix, but with Solaris 2.6 and 2.7 you need to do something like::
@@ -69,17 +69,22 @@ In addition to many functions described in the :mod:`os` module documentation,
.. data:: environ
A dictionary representing the string environment at the time the interpreter
- was started. For example, ``environ['HOME']`` is the pathname of your home
- directory, equivalent to ``getenv("HOME")`` in C.
+ was started. Keys and values are bytes on Unix and str on Windows. For
+ example, ``environ[b'HOME']`` (``environ['HOME']`` on Windows) is the
+ pathname of your home directory, equivalent to ``getenv("HOME")`` in C.
Modifying this dictionary does not affect the string environment passed on by
:func:`execv`, :func:`popen` or :func:`system`; if you need to change the
environment, pass ``environ`` to :func:`execve` or add variable assignments and
export statements to the command string for :func:`system` or :func:`popen`.
+ .. versionchanged:: 3.2
+ On Unix, keys and values are bytes.
+
.. note::
- The :mod:`os` module provides an alternate implementation of ``environ`` which
- updates the environment on modification. Note also that updating ``os.environ``
- will render this dictionary obsolete. Use of the :mod:`os` module version of
- this is recommended over direct access to the :mod:`posix` module.
+ The :mod:`os` module provides an alternate implementation of ``environ``
+ which updates the environment on modification. Note also that updating
+ :data:`os.environ` will render this dictionary obsolete. Use of the
+ :mod:`os` module version of this is recommended over direct access to the
+ :mod:`posix` module.
diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst
index d1d1baeeab..9ab12eea1d 100644
--- a/Doc/library/pprint.rst
+++ b/Doc/library/pprint.rst
@@ -1,4 +1,3 @@
-
:mod:`pprint` --- Data pretty printer
=====================================
@@ -7,6 +6,9 @@
.. moduleauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/pprint.py`
+
+--------------
The :mod:`pprint` module provides a capability to "pretty-print" arbitrary
Python data structures in a form which can be used as input to the interpreter.
@@ -27,7 +29,7 @@ The :mod:`pprint` module defines one class:
.. First the implementation class:
-.. class:: PrettyPrinter(...)
+.. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None)
Construct a :class:`PrettyPrinter` instance. This constructor understands
several keyword parameters. An output stream may be set using the *stream*
@@ -62,21 +64,20 @@ The :mod:`pprint` module defines one class:
>>> pp.pprint(tup)
('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead', (...)))))))
-The :class:`PrettyPrinter` class supports several derivative functions:
-.. Now the derivative functions:
+The :class:`PrettyPrinter` class supports several derivative functions:
-.. function:: pformat(object[, indent[, width[, depth]]])
+.. function:: pformat(object, indent=1, width=80, depth=None)
Return the formatted representation of *object* as a string. *indent*, *width*
and *depth* will be passed to the :class:`PrettyPrinter` constructor as
formatting parameters.
-.. function:: pprint(object[, stream[, indent[, width[, depth]]]])
+.. function:: pprint(object, stream=None, indent=1, width=80, depth=None)
Prints the formatted representation of *object* on *stream*, followed by a
- newline. If *stream* is omitted, ``sys.stdout`` is used. This may be used
+ newline. If *stream* is ``None``, ``sys.stdout`` is used. This may be used
in the interactive interpreter instead of the :func:`print` function for
inspecting values (you can even reassign ``print = pprint.pprint`` for use
within a scope). *indent*, *width* and *depth* will be passed to the
@@ -191,7 +192,8 @@ are converted to strings. The default implementation uses the internals of the
pprint Example
--------------
-This example demonstrates several uses of the :func:`pprint` function and its parameters.
+This example demonstrates several uses of the :func:`pprint` function and its
+parameters.
>>> import pprint
>>> tup = ('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead',
diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst
index 82cc2eb3c9..3931836f70 100644
--- a/Doc/library/profile.rst
+++ b/Doc/library/profile.rst
@@ -1,4 +1,3 @@
-
.. _profile:
********************
@@ -10,6 +9,9 @@ The Python Profilers
.. module:: profile
:synopsis: Python source profiler.
+**Source code:** :source:`Lib/profile.py` and :source:`Lib/pstats.py`
+
+--------------
.. _profiler-introduction:
@@ -219,7 +221,7 @@ discussion of how to derive "better" profilers from the classes presented, or
reading the source code for these modules.
-.. function:: run(command[, filename])
+.. function:: run(command, filename=None, sort=-1)
This function takes a single argument that can be passed to the :func:`exec`
function, and an optional file name. In all cases this routine attempts to
@@ -248,8 +250,8 @@ reading the source code for these modules.
for the number of calls,
tottime
- for the total time spent in the given function (and excluding time made in calls
- to sub-functions),
+ for the total time spent in the given function (and excluding time made in
+ calls to sub-functions),
percall
is the quotient of ``tottime`` divided by ``ncalls``
@@ -269,24 +271,25 @@ reading the source code for these modules.
calls. Note that when the function does not recurse, these two values are the
same, and only the single figure is printed.
+ If *sort* is given, it can be one of ``'stdname'`` (sort by filename:lineno),
+ ``'calls'`` (sort by number of calls), ``'time'`` (sort by total time) or
+ ``'cumulative'`` (sort by cumulative time). The default is ``'stdname'``.
+
-.. function:: runctx(command, globals, locals[, filename])
+.. function:: runctx(command, globals, locals, filename=None)
This function is similar to :func:`run`, with added arguments to supply the
globals and locals dictionaries for the *command* string.
-Analysis of the profiler data is done using the :class:`Stats` class.
-
-.. note::
- The :class:`Stats` class is defined in the :mod:`pstats` module.
+Analysis of the profiler data is done using the :class:`pstats.Stats` class.
.. module:: pstats
:synopsis: Statistics object for use with the profiler.
-.. class:: Stats(filename[, stream=sys.stdout[, ...]])
+.. class:: Stats(*filenames, stream=sys.stdout)
This class constructor creates an instance of a "statistics object" from a
*filename* (or set of filenames). :class:`Stats` objects are manipulated by
@@ -326,7 +329,7 @@ The :class:`Stats` Class
accumulated into a single entry.
-.. method:: Stats.add(filename[, ...])
+.. method:: Stats.add(*filenames)
This method of the :class:`Stats` class accumulates additional profiling
information into the current profiling object. Its arguments should refer to
@@ -343,7 +346,7 @@ The :class:`Stats` Class
:class:`profile.Profile` and :class:`cProfile.Profile` classes.
-.. method:: Stats.sort_stats(key[, ...])
+.. method:: Stats.sort_stats(*keys)
This method modifies the :class:`Stats` object by sorting it according to the
supplied criteria. The argument is typically a string identifying the basis of
@@ -410,7 +413,7 @@ The :class:`Stats` Class
.. This method is provided primarily for compatibility with the old profiler.
-.. method:: Stats.print_stats([restriction, ...])
+.. method:: Stats.print_stats(*restrictions)
This method for the :class:`Stats` class prints out a report as described in the
:func:`profile.run` definition.
@@ -439,7 +442,7 @@ The :class:`Stats` Class
then proceed to only print the first 10% of them.
-.. method:: Stats.print_callers([restriction, ...])
+.. method:: Stats.print_callers(*restrictions)
This method for the :class:`Stats` class prints a list of all functions that
called each function in the profiled database. The ordering is identical to
@@ -457,7 +460,7 @@ The :class:`Stats` Class
the current function while it was invoked by this specific caller.
-.. method:: Stats.print_callees([restriction, ...])
+.. method:: Stats.print_callees(*restrictions)
This method for the :class:`Stats` class prints a list of all function that were
called by the indicated function. Aside from this reversal of direction of
diff --git a/Doc/library/pty.rst b/Doc/library/pty.rst
index be879f24ac..2b9385b5f9 100644
--- a/Doc/library/pty.rst
+++ b/Doc/library/pty.rst
@@ -1,4 +1,3 @@
-
:mod:`pty` --- Pseudo-terminal utilities
========================================
@@ -46,3 +45,50 @@ The :mod:`pty` module defines the following functions:
a file descriptor. The defaults try to read 1024 bytes each time they are
called.
+
+Example
+-------
+
+.. sectionauthor:: Steen Lumholt
+
+The following program acts like the Unix command :manpage:`script(1)`, using a
+pseudo-terminal to record all input and output of a terminal session in a
+"typescript". ::
+
+ import sys, os, time, getopt
+ import pty
+
+ mode = 'wb'
+ shell = 'sh'
+ filename = 'typescript'
+ if 'SHELL' in os.environ:
+ shell = os.environ['SHELL']
+
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], 'ap')
+ except getopt.error as msg:
+ print('%s: %s' % (sys.argv[0], msg))
+ sys.exit(2)
+
+ for opt, arg in opts:
+ # option -a: append to typescript file
+ if opt == '-a':
+ mode = 'ab'
+ # option -p: use a Python shell as the terminal command
+ elif opt == '-p':
+ shell = sys.executable
+ if args:
+ filename = args[0]
+
+ script = open(filename, mode)
+
+ def read(fd):
+ data = os.read(fd, 1024)
+ script.write(data)
+ return data
+
+ sys.stdout.write('Script started, file is %s\n' % filename)
+ script.write(('Script started on %s\n' % time.asctime()).encode())
+ pty.spawn(shell, read)
+ script.write(('Script done on %s\n' % time.asctime()).encode())
+ sys.stdout.write('Script done, file is %s\n' % filename)
diff --git a/Doc/library/pwd.rst b/Doc/library/pwd.rst
index 562afd920f..2c17d9e036 100644
--- a/Doc/library/pwd.rst
+++ b/Doc/library/pwd.rst
@@ -1,4 +1,3 @@
-
:mod:`pwd` --- The password database
====================================
diff --git a/Doc/library/py_compile.rst b/Doc/library/py_compile.rst
index 0891862496..07ddc25422 100644
--- a/Doc/library/py_compile.rst
+++ b/Doc/library/py_compile.rst
@@ -8,6 +8,10 @@
.. index:: pair: file; byte-code
+**Source code:** :source:`Lib/py_compile.py`
+
+--------------
+
The :mod:`py_compile` module provides a function to generate a byte-code file
from a source file, and another function used when the module source file is
invoked as a script.
@@ -22,24 +26,42 @@ byte-code cache files in the directory containing the source code.
Exception raised when an error occurs while attempting to compile the file.
-.. function:: compile(file[, cfile[, dfile[, doraise]]])
+.. function:: compile(file, cfile=None, dfile=None, doraise=False, optimize=-1)
+
+ Compile a source file to byte-code and write out the byte-code cache file.
+ The source code is loaded from the file name *file*. The byte-code is
+ written to *cfile*, which defaults to the :PEP:`3147` path, ending in
+ ``.pyc`` (``.pyo`` if optimization is enabled in the current interpreter).
+ For example, if *file* is ``/foo/bar/baz.py`` *cfile* will default to
+ ``/foo/bar/__pycache__/baz.cpython-32.pyc`` for Python 3.2. If *dfile* is
+ specified, it is used as the name of the source file in error messages when
+ instead of *file*. If *doraise* is true, a :exc:`PyCompileError` is raised
+ when an error is encountered while compiling *file*. If *doraise* is false
+ (the default), an error string is written to ``sys.stderr``, but no exception
+ is raised. This function returns the path to byte-compiled file, i.e.
+ whatever *cfile* value was used.
- Compile a source file to byte-code and write out the byte-code cache file. The
- source code is loaded from the file name *file*. The byte-code is written to
- *cfile*, which defaults to *file* ``+`` ``'c'`` (``'o'`` if optimization is
- enabled in the current interpreter). If *dfile* is specified, it is used as the
- name of the source file in error messages instead of *file*. If *doraise* is
- true, a :exc:`PyCompileError` is raised when an error is encountered while
- compiling *file*. If *doraise* is false (the default), an error string is
- written to ``sys.stderr``, but no exception is raised.
+ *optimize* controls the optimization level and is passed to the built-in
+ :func:`compile` function. The default of ``-1`` selects the optimization
+ level of the current interpreter.
+ .. versionchanged:: 3.2
+ Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous
+ default was *file* + ``'c'`` (``'o'`` if optimization was enabled).
+ Also added the *optimize* parameter.
-.. function:: main([args])
+
+.. function:: main(args=None)
Compile several source files. The files named in *args* (or on the command
- line, if *args* is not specified) are compiled and the resulting bytecode is
+ line, if *args* is ``None``) are compiled and the resulting bytecode is
cached in the normal manner. This function does not search a directory
structure to locate source files; it only compiles files named explicitly.
+ If ``'-'`` is the only parameter in args, the list of files is taken from
+ standard input.
+
+ .. versionchanged:: 3.2
+ Added support for ``'-'``.
When this module is run as a script, the :func:`main` is used to compile all the
files named on the command line. The exit status is nonzero if one of the files
diff --git a/Doc/library/pyclbr.rst b/Doc/library/pyclbr.rst
index 36b46f483d..d4a76a6479 100644
--- a/Doc/library/pyclbr.rst
+++ b/Doc/library/pyclbr.rst
@@ -1,4 +1,3 @@
-
:mod:`pyclbr` --- Python class browser support
==============================================
@@ -6,6 +5,9 @@
:synopsis: Supports information extraction for a Python class browser.
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/pyclbr.py`
+
+--------------
The :mod:`pyclbr` module can be used to determine some limited information
about the classes, methods and top-level functions defined in a module. The
@@ -17,7 +19,7 @@ not implemented in Python, including all standard and optional extension
modules.
-.. function:: readmodule(module[, path=None])
+.. function:: readmodule(module, path=None)
Read a module and return a dictionary mapping class names to class
descriptor objects. The parameter *module* should be the name of a
@@ -26,7 +28,7 @@ modules.
of ``sys.path``, which is used to locate module source code.
-.. function:: readmodule_ex(module[, path=None])
+.. function:: readmodule_ex(module, path=None)
Like :func:`readmodule`, but the returned dictionary, in addition to
mapping class names to class descriptor objects, also maps top-level
diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst
index 01f48b1e0f..e100865515 100644
--- a/Doc/library/pydoc.rst
+++ b/Doc/library/pydoc.rst
@@ -1,4 +1,3 @@
-
:mod:`pydoc` --- Documentation generator and online help system
===============================================================
@@ -13,6 +12,10 @@
single: documentation; online
single: help; online
+**Source code:** :source:`Lib/pydoc.py`
+
+--------------
+
The :mod:`pydoc` module automatically generates documentation from Python
modules. The documentation can be presented as pages of text on the console,
served to a Web browser, or saved to HTML files.
@@ -51,12 +54,21 @@ manner similar to the Unix :program:`man` command. The synopsis line of a
module is the first line of its documentation string.
You can also use :program:`pydoc` to start an HTTP server on the local machine
-that will serve documentation to visiting Web browsers. :program:`pydoc -p 1234`
-will start a HTTP server on port 1234, allowing you to browse
-the documentation at ``http://localhost:1234/`` in your preferred Web browser.
+that will serve documentation to visiting Web browsers. :program:`pydoc -p 1234`
+will start a HTTP server on port 1234, allowing you to browse the
+documentation at ``http://localhost:1234/`` in your preferred Web browser.
+Specifying ``0`` as the port number will select an arbitrary unused port.
+
:program:`pydoc -g` will start the server and additionally bring up a
small :mod:`tkinter`\ -based graphical interface to help you search for
-documentation pages.
+documentation pages. The ``-g`` option is deprecated, since the server can
+now be controlled directly from HTTP clients.
+
+:program:`pydoc -b` will start the server and additionally open a web
+browser to a module index page. Each served page has a navigation bar at the
+top where you can *Get* help on an individual item, *Search* all modules with a
+keyword in their synopsis line, and go to the *Module index*, *Topics* and
+*Keywords* pages.
When :program:`pydoc` generates documentation, it uses the current environment
and path to locate modules. Thus, invoking :program:`pydoc spam`
@@ -70,3 +82,5 @@ be overridden by setting the :envvar:`PYTHONDOCS` environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
+.. versionchanged:: 3.2
+ Added the ``-b`` option, deprecated the ``-g`` option.
diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst
index 1eb9db1122..a648cfa529 100644
--- a/Doc/library/pyexpat.rst
+++ b/Doc/library/pyexpat.rst
@@ -1,4 +1,3 @@
-
:mod:`xml.parsers.expat` --- Fast XML parsing using Expat
=========================================================
@@ -56,7 +55,7 @@ The :mod:`xml.parsers.expat` module contains two functions:
Returns an explanatory string for a given error number *errno*.
-.. function:: ParserCreate([encoding[, namespace_separator]])
+.. function:: ParserCreate(encoding=None, namespace_separator=None)
Creates and returns a new :class:`xmlparser` object. *encoding*, if specified,
must be a string naming the encoding used by the XML data. Expat doesn't
@@ -177,7 +176,7 @@ XMLParser Objects
This method can only be called before the :meth:`Parse` or :meth:`ParseFile`
methods are called; calling it after either of those have been called causes
:exc:`ExpatError` to be raised with the :attr:`code` attribute set to
- :const:`errors.XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING`.
+ ``errors.codes[errors.XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING]``.
:class:`xmlparser` objects have the following attributes:
@@ -475,8 +474,21 @@ ExpatError Exceptions
.. attribute:: ExpatError.code
- Expat's internal error number for the specific error. This will match one of
- the constants defined in the ``errors`` object from this module.
+ Expat's internal error number for the specific error. The
+ :data:`errors.messages` dictionary maps these error numbers to Expat's error
+ messages. For example::
+
+ from xml.parsers.expat import ParserCreate, ExpatError, errors
+
+ p = ParserCreate()
+ try:
+ p.Parse(some_xml_document)
+ except ExpatError as err:
+ print("Error:", errors.messages[err.code])
+
+ The :mod:`errors` module also provides error message constants and a
+ dictionary :data:`~errors.codes` mapping these messages back to the error
+ codes, see below.
.. attribute:: ExpatError.lineno
@@ -538,15 +550,16 @@ The output from this program is::
Content Model Descriptions
--------------------------
-.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+.. module:: xml.parsers.expat.model
+.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
Content modules are described using nested tuples. Each tuple contains four
values: the type, the quantifier, the name, and a tuple of children. Children
are simply additional content module descriptions.
-The values of the first two fields are constants defined in the ``model`` object
-of the :mod:`xml.parsers.expat` module. These constants can be collected in two
+The values of the first two fields are constants defined in the
+:mod:`xml.parsers.expat.model` module. These constants can be collected in two
groups: the model type group and the quantifier group.
The constants in the model type group are:
@@ -618,143 +631,139 @@ The constants in the quantifier group are:
Expat error constants
---------------------
-The following constants are provided in the ``errors`` object of the
-:mod:`xml.parsers.expat` module. These constants are useful in interpreting
-some of the attributes of the :exc:`ExpatError` exception objects raised when an
-error has occurred.
+.. module:: xml.parsers.expat.errors
+
+The following constants are provided in the :mod:`xml.parsers.expat.errors`
+module. These constants are useful in interpreting some of the attributes of
+the :exc:`ExpatError` exception objects raised when an error has occurred.
+Since for backwards compatibility reasons, the constants' value is the error
+*message* and not the numeric error *code*, you do this by comparing its
+:attr:`code` attribute with
+:samp:`errors.codes[errors.XML_ERROR_{CONSTANT_NAME}]`.
+
+The ``errors`` module has the following attributes:
+
+.. data:: codes
+
+ A dictionary mapping numeric error codes to their string descriptions.
+
+ .. versionadded:: 3.2
+
+
+.. data:: messages
-The ``errors`` object has the following attributes:
+ A dictionary mapping string descriptions to their error codes.
+
+ .. versionadded:: 3.2
.. data:: XML_ERROR_ASYNC_ENTITY
- :noindex:
.. data:: XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
- :noindex:
An entity reference in an attribute value referred to an external entity instead
of an internal entity.
.. data:: XML_ERROR_BAD_CHAR_REF
- :noindex:
A character reference referred to a character which is illegal in XML (for
example, character ``0``, or '``&#0;``').
.. data:: XML_ERROR_BINARY_ENTITY_REF
- :noindex:
An entity reference referred to an entity which was declared with a notation, so
cannot be parsed.
.. data:: XML_ERROR_DUPLICATE_ATTRIBUTE
- :noindex:
An attribute was used more than once in a start tag.
.. data:: XML_ERROR_INCORRECT_ENCODING
- :noindex:
.. data:: XML_ERROR_INVALID_TOKEN
- :noindex:
Raised when an input byte could not properly be assigned to a character; for
example, a NUL byte (value ``0``) in a UTF-8 input stream.
.. data:: XML_ERROR_JUNK_AFTER_DOC_ELEMENT
- :noindex:
Something other than whitespace occurred after the document element.
.. data:: XML_ERROR_MISPLACED_XML_PI
- :noindex:
An XML declaration was found somewhere other than the start of the input data.
.. data:: XML_ERROR_NO_ELEMENTS
- :noindex:
The document contains no elements (XML requires all documents to contain exactly
one top-level element)..
.. data:: XML_ERROR_NO_MEMORY
- :noindex:
Expat was not able to allocate memory internally.
.. data:: XML_ERROR_PARAM_ENTITY_REF
- :noindex:
A parameter entity reference was found where it was not allowed.
.. data:: XML_ERROR_PARTIAL_CHAR
- :noindex:
An incomplete character was found in the input.
.. data:: XML_ERROR_RECURSIVE_ENTITY_REF
- :noindex:
An entity reference contained another reference to the same entity; possibly via
a different name, and possibly indirectly.
.. data:: XML_ERROR_SYNTAX
- :noindex:
Some unspecified syntax error was encountered.
.. data:: XML_ERROR_TAG_MISMATCH
- :noindex:
An end tag did not match the innermost open start tag.
.. data:: XML_ERROR_UNCLOSED_TOKEN
- :noindex:
Some token (such as a start tag) was not closed before the end of the stream or
the next token was encountered.
.. data:: XML_ERROR_UNDEFINED_ENTITY
- :noindex:
A reference was made to a entity which was not defined.
.. data:: XML_ERROR_UNKNOWN_ENCODING
- :noindex:
The document encoding is not supported by Expat.
.. data:: XML_ERROR_UNCLOSED_CDATA_SECTION
- :noindex:
A CDATA marked section was not closed.
.. data:: XML_ERROR_EXTERNAL_ENTITY_HANDLING
- :noindex:
.. data:: XML_ERROR_NOT_STANDALONE
- :noindex:
The parser determined that the document was not "standalone" though it declared
itself to be in the XML declaration, and the :attr:`NotStandaloneHandler` was
@@ -762,15 +771,12 @@ The ``errors`` object has the following attributes:
.. data:: XML_ERROR_UNEXPECTED_STATE
- :noindex:
.. data:: XML_ERROR_ENTITY_DECLARED_IN_PE
- :noindex:
.. data:: XML_ERROR_FEATURE_REQUIRES_XML_DTD
- :noindex:
An operation was requested that requires DTD support to be compiled in, but
Expat was configured without DTD support. This should never be reported by a
@@ -778,7 +784,6 @@ The ``errors`` object has the following attributes:
.. data:: XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
- :noindex:
A behavioral change was requested after parsing started that can only be changed
before parsing has started. This is (currently) only raised by
@@ -786,63 +791,53 @@ The ``errors`` object has the following attributes:
.. data:: XML_ERROR_UNBOUND_PREFIX
- :noindex:
An undeclared prefix was found when namespace processing was enabled.
.. data:: XML_ERROR_UNDECLARING_PREFIX
- :noindex:
The document attempted to remove the namespace declaration associated with a
prefix.
.. data:: XML_ERROR_INCOMPLETE_PE
- :noindex:
A parameter entity contained incomplete markup.
.. data:: XML_ERROR_XML_DECL
- :noindex:
The document contained no document element at all.
.. data:: XML_ERROR_TEXT_DECL
- :noindex:
There was an error parsing a text declaration in an external entity.
.. data:: XML_ERROR_PUBLICID
- :noindex:
Characters were found in the public id that are not allowed.
.. data:: XML_ERROR_SUSPENDED
- :noindex:
The requested operation was made on a suspended parser, but isn't allowed. This
includes attempts to provide additional input or to stop the parser.
.. data:: XML_ERROR_NOT_SUSPENDED
- :noindex:
An attempt to resume the parser was made when the parser had not been suspended.
.. data:: XML_ERROR_ABORTED
- :noindex:
This should not be reported to Python applications.
.. data:: XML_ERROR_FINISHED
- :noindex:
The requested operation was made on a parser which was finished parsing input,
but isn't allowed. This includes attempts to provide additional input or to
@@ -850,7 +845,6 @@ The ``errors`` object has the following attributes:
.. data:: XML_ERROR_SUSPEND_PE
- :noindex:
.. rubric:: Footnotes
diff --git a/Doc/library/python.rst b/Doc/library/python.rst
index 7d4d8279ba..b67fbfc281 100644
--- a/Doc/library/python.rst
+++ b/Doc/library/python.rst
@@ -1,4 +1,3 @@
-
.. _python:
***********************
@@ -13,6 +12,7 @@ overview:
.. toctree::
sys.rst
+ sysconfig.rst
builtins.rst
__main__.rst
warnings.rst
@@ -25,3 +25,4 @@ overview:
inspect.rst
site.rst
fpectl.rst
+ distutils.rst
diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst
index e16d6e98a1..26336ef515 100644
--- a/Doc/library/queue.rst
+++ b/Doc/library/queue.rst
@@ -1,10 +1,12 @@
-
:mod:`queue` --- A synchronized queue class
===========================================
.. module:: queue
:synopsis: A synchronized queue class.
+**Source code:** :source:`Lib/queue.py`
+
+--------------
The :mod:`queue` module implements multi-producer, multi-consumer queues.
It is especially useful in threaded programming when information must be
@@ -20,17 +22,17 @@ the first retrieved (operating like a stack). With a priority queue,
the entries are kept sorted (using the :mod:`heapq` module) and the
lowest valued entry is retrieved first.
+
The :mod:`queue` module defines the following classes and exceptions:
-.. class:: Queue(maxsize)
+.. class:: Queue(maxsize=0)
Constructor for a FIFO queue. *maxsize* is an integer that sets the upperbound
limit on the number of items that can be placed in the queue. Insertion will
block once this size has been reached, until queue items are consumed. If
*maxsize* is less than or equal to zero, the queue size is infinite.
-
-.. class:: LifoQueue(maxsize)
+.. class:: LifoQueue(maxsize=0)
Constructor for a LIFO queue. *maxsize* is an integer that sets the upperbound
limit on the number of items that can be placed in the queue. Insertion will
@@ -38,7 +40,7 @@ The :mod:`queue` module defines the following classes and exceptions:
*maxsize* is less than or equal to zero, the queue size is infinite.
-.. class:: PriorityQueue(maxsize)
+.. class:: PriorityQueue(maxsize=0)
Constructor for a priority queue. *maxsize* is an integer that sets the upperbound
limit on the number of items that can be placed in the queue. Insertion will
@@ -61,12 +63,6 @@ The :mod:`queue` module defines the following classes and exceptions:
Exception raised when non-blocking :meth:`put` (or :meth:`put_nowait`) is called
on a :class:`Queue` object which is full.
-.. seealso::
-
- :class:`collections.deque` is an alternative implementation of unbounded
- queues with fast atomic :func:`append` and :func:`popleft` operations that
- do not require locking.
-
.. _queueobjects:
@@ -100,7 +96,7 @@ provide the public methods described below.
guarantee that a subsequent call to put() will not block.
-.. method:: Queue.put(item[, block[, timeout]])
+.. method:: Queue.put(item, block=True, timeout=None)
Put *item* into the queue. If optional args *block* is true and *timeout* is
None (the default), block if necessary until a free slot is available. If
@@ -116,7 +112,7 @@ provide the public methods described below.
Equivalent to ``put(item, False)``.
-.. method:: Queue.get([block[, timeout]])
+.. method:: Queue.get(block=True, timeout=None)
Remove and return an item from the queue. If optional args *block* is true and
*timeout* is None (the default), block if necessary until an item is available.
@@ -177,3 +173,14 @@ Example of how to wait for enqueued tasks to be completed::
q.join() # block until all tasks are done
+
+.. seealso::
+
+ Class :class:`multiprocessing.Queue`
+ A queue class for use in a multi-processing (rather than multi-threading)
+ context.
+
+ :class:`collections.deque` is an alternative implementation of unbounded
+ queues with fast atomic :func:`append` and :func:`popleft` operations that
+ do not require locking.
+
diff --git a/Doc/library/quopri.rst b/Doc/library/quopri.rst
index a64337ef7c..755811adfd 100644
--- a/Doc/library/quopri.rst
+++ b/Doc/library/quopri.rst
@@ -1,4 +1,3 @@
-
:mod:`quopri` --- Encode and decode MIME quoted-printable data
==============================================================
@@ -10,6 +9,10 @@
pair: quoted-printable; encoding
single: MIME; quoted-printable encoding
+**Source code:** :source:`Lib/quopri.py`
+
+--------------
+
This module performs quoted-printable transport encoding and decoding, as
defined in :rfc:`1521`: "MIME (Multipurpose Internet Mail Extensions) Part One:
Mechanisms for Specifying and Describing the Format of Internet Message Bodies".
@@ -18,8 +21,7 @@ few nonprintable characters; the base64 encoding scheme available via the
:mod:`base64` module is more compact if there are many such characters, as when
sending a graphics file.
-
-.. function:: decode(input, output[,header])
+.. function:: decode(input, output, header=False)
Decode the contents of the *input* file and write the resulting decoded binary
data to the *output* file. *input* and *output* must be :term:`file objects
@@ -30,7 +32,7 @@ sending a graphics file.
Part Two: Message Header Extensions for Non-ASCII Text".
-.. function:: encode(input, output, quotetabs)
+.. function:: encode(input, output, quotetabs, header=False)
Encode the contents of the *input* file and write the resulting quoted-printable
data to the *output* file. *input* and *output* must be :term:`file objects
@@ -38,24 +40,24 @@ sending a graphics file.
empty string. *quotetabs* is a flag which controls whether to encode embedded
spaces and tabs; when true it encodes such embedded whitespace, and when
false it leaves them unencoded. Note that spaces and tabs appearing at the
- end of lines are always encoded, as per :rfc:`1521`.
+ end of lines are always encoded, as per :rfc:`1521`. *header* is a flag
+ which controls if spaces are encoded as underscores as per :rfc:`1522`.
-.. function:: decodestring(s[,header])
+.. function:: decodestring(s, header=False)
Like :func:`decode`, except that it accepts a source string and returns the
corresponding decoded string.
-.. function:: encodestring(s[, quotetabs])
+.. function:: encodestring(s, quotetabs=False, header=False)
Like :func:`encode`, except that it accepts a source string and returns the
- corresponding encoded string. *quotetabs* is optional (defaulting to 0), and is
- passed straight through to :func:`encode`.
+ corresponding encoded string. *quotetabs* and *header* are optional
+ (defaulting to ``False``), and are passed straight through to :func:`encode`.
.. seealso::
Module :mod:`base64`
Encode and decode MIME base64 data
-
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index 2976f5e392..f0c4add61a 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -1,17 +1,20 @@
-
:mod:`random` --- Generate pseudo-random numbers
================================================
.. module:: random
:synopsis: Generate pseudo-random numbers with various common distributions.
+**Source code:** :source:`Lib/random.py`
+
+--------------
This module implements pseudo-random number generators for various
distributions.
-For integers, uniform selection from a range. For sequences, uniform selection
-of a random element, a function to generate a random permutation of a list
-in-place, and a function for random sampling without replacement.
+For integers, there is uniform selection from a range. For sequences, there is
+uniform selection of a random element, a function to generate a random
+permutation of a list in-place, and a function for random sampling without
+replacement.
On the real line, there are functions to compute uniform, normal (Gaussian),
lognormal, negative exponential, gamma, and beta distributions. For generating
@@ -36,22 +39,30 @@ basic generator of your own devising: in that case, override the :meth:`random`,
Optionally, a new generator can supply a :meth:`getrandbits` method --- this
allows :meth:`randrange` to produce selections over an arbitrarily large range.
+The :mod:`random` module also provides the :class:`SystemRandom` class which
+uses the system function :func:`os.urandom` to generate random numbers
+from sources provided by the operating system.
+
Bookkeeping functions:
+.. function:: seed([x], version=2)
-.. function:: seed([x])
+ Initialize the random number generator.
- Initialize the basic random number generator. Optional argument *x* can be any
- :term:`hashable` object. If *x* is omitted or ``None``, current system time is used;
- current system time is also used to initialize the generator when the module is
- first imported. If randomness sources are provided by the operating system,
- they are used instead of the system time (see the :func:`os.urandom` function
- for details on availability).
+ If *x* is omitted or ``None``, the current system time is used. If
+ randomness sources are provided by the operating system, they are used
+ instead of the system time (see the :func:`os.urandom` function for details
+ on availability).
- If *x* is not ``None`` or an int, ``hash(x)`` is used instead. If *x* is an
- int, *x* is used directly.
+ If *x* is an int, it is used directly.
+ With version 2 (the default), a :class:`str`, :class:`bytes`, or :class:`bytearray`
+ object gets converted to an :class:`int` and all of its bits are used. With version 1,
+ the :func:`hash` of *x* is used instead.
+
+ .. versionchanged:: 3.2
+ Moved to the version 2 scheme which uses all of the bits in a string seed.
.. function:: getstate()
@@ -82,6 +93,13 @@ Functions for integers:
equivalent to ``choice(range(start, stop, step))``, but doesn't actually build a
range object.
+ The positional argument pattern matches that of :func:`range`. Keyword arguments
+ should not be used because the function may use them in unexpected ways.
+
+ .. versionchanged:: 3.2
+ :meth:`randrange` is more sophisticated about producing equally distributed
+ values. Formerly it used a style like ``int(random()*n)`` which could produce
+ slightly uneven distributions.
.. function:: randint(a, b)
@@ -213,29 +231,67 @@ be found in any statistics text.
parameter.
-Alternative Generators:
+Alternative Generator:
.. class:: SystemRandom([seed])
Class that uses the :func:`os.urandom` function for generating random numbers
from sources provided by the operating system. Not available on all systems.
- Does not rely on software state and sequences are not reproducible. Accordingly,
+ Does not rely on software state, and sequences are not reproducible. Accordingly,
the :meth:`seed` method has no effect and is ignored.
The :meth:`getstate` and :meth:`setstate` methods raise
:exc:`NotImplementedError` if called.
-Examples of basic usage::
+.. seealso::
+
+ M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-dimensionally
+ equidistributed uniform pseudorandom number generator", ACM Transactions on
+ Modeling and Computer Simulation Vol. 8, No. 1, January pp.3-30 1998.
+
+
+ `Complementary-Multiply-with-Carry recipe
+ <http://code.activestate.com/recipes/576707/>`_ for a compatible alternative
+ random number generator with a long period and comparatively simple update
+ operations.
+
+
+Notes on Reproducibility
+------------------------
+
+Sometimes it is useful to be able to reproduce the sequences given by a pseudo
+random number generator. By re-using a seed value, the same sequence should be
+reproducible from run to run as long as multiple threads are not running.
- >>> random.random() # Random float x, 0.0 <= x < 1.0
+Most of the random module's algorithms and seeding functions are subject to
+change across Python versions, but two aspects are guaranteed not to change:
+
+* If a new seeding method is added, then a backward compatible seeder will be
+ offered.
+
+* The generator's :meth:`random` method will continue to produce the same
+ sequence when the compatible seeder is given the same seed.
+
+.. _random-examples:
+
+Examples and Recipes
+--------------------
+
+Basic usage::
+
+ >>> random.random() # Random float x, 0.0 <= x < 1.0
0.37444887175646646
- >>> random.uniform(1, 10) # Random float x, 1.0 <= x < 10.0
+
+ >>> random.uniform(1, 10) # Random float x, 1.0 <= x < 10.0
1.1800146073117523
- >>> random.randint(1, 10) # Integer from 1 to 10, endpoints included
+
+ >>> random.randrange(10) # Integer from 0 to 9
7
- >>> random.randrange(0, 101, 2) # Even integer from 0 to 100
+
+ >>> random.randrange(0, 101, 2) # Even integer from 0 to 100
26
- >>> random.choice('abcdefghij') # Choose a random element
+
+ >>> random.choice('abcdefghij') # Single random element
'c'
>>> items = [1, 2, 3, 4, 5, 6, 7]
@@ -243,19 +299,25 @@ Examples of basic usage::
>>> items
[7, 3, 2, 5, 6, 4, 1]
- >>> random.sample([1, 2, 3, 4, 5], 3) # Choose 3 elements
+ >>> random.sample([1, 2, 3, 4, 5], 3) # Three samples without replacement
[4, 1, 5]
+A common task is to make a :func:`random.choice` with weighted probababilites.
+If the weights are small integer ratios, a simple technique is to build a sample
+population with repeats::
-.. seealso::
-
- M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-dimensionally
- equidistributed uniform pseudorandom number generator", ACM Transactions on
- Modeling and Computer Simulation Vol. 8, No. 1, January pp.3-30 1998.
+ >>> weighted_choices = [('Red', 3), ('Blue', 2), ('Yellow', 1), ('Green', 4)]
+ >>> population = [val for val, cnt in weighted_choices for i in range(cnt)]
+ >>> random.choice(population)
+ 'Green'
+A more general approach is to arrange the weights in a cumulative distribution
+with :func:`itertools.accumulate`, and then locate the random value with
+:func:`bisect.bisect`::
- `Complementary-Multiply-with-Carry recipe
- <http://code.activestate.com/recipes/576707/>`_ for a compatible alternative
- random number generator with a long period and comparatively simple update
- operations.
+ >>> choices, weights = zip(*weighted_choices)
+ >>> cumdist = list(itertools.accumulate(weights))
+ >>> x = random.random() * cumdist[-1]
+ >>> choices[bisect.bisect(cumdist, x)]
+ 'Blue'
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 1d90f791a7..3e9cf026f0 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -1,4 +1,3 @@
-
:mod:`re` --- Regular expression operations
===========================================
@@ -34,8 +33,9 @@ newline. Usually patterns will be expressed in Python code using this raw
string notation.
It is important to note that most regular expression operations are available as
-module-level functions and :class:`RegexObject` methods. The functions are
-shortcuts that don't require you to compile a regex object first, but miss some
+module-level functions and methods on
+:ref:`compiled regular expressions <re-objects>`. The functions are shortcuts
+that don't require you to compile a regex object first, but miss some
fine-tuning parameters.
.. seealso::
@@ -339,11 +339,12 @@ the second character. For example, ``\$`` matches the character ``'$'``.
``\d``
For Unicode (str) patterns:
- Matches any Unicode digit (which includes ``[0-9]``, and also many
- other digit characters). If the :const:`ASCII` flag is used only
- ``[0-9]`` is matched (but the flag affects the entire regular
- expression, so in such cases using an explicit ``[0-9]`` may be a
- better choice).
+ Matches any Unicode decimal digit (that is, any character in
+ Unicode character category [Nd]). This includes ``[0-9]``, and
+ also many other digit characters. If the :const:`ASCII` flag is
+ used only ``[0-9]`` is matched (but the flag affects the entire
+ regular expression, so in such cases using an explicit ``[0-9]``
+ may be a better choice).
For 8-bit (bytes) patterns:
Matches any decimal digit; this is equivalent to ``[0-9]``.
@@ -446,7 +447,7 @@ regular expressions. Most non-trivial applications always use the compiled
form.
-.. function:: compile(pattern[, flags])
+.. function:: compile(pattern, flags=0)
Compile a regular expression pattern into a regular expression object, which
can be used for matching using its :func:`match` and :func:`search` methods,
@@ -547,21 +548,21 @@ form.
-.. function:: search(pattern, string[, flags])
+.. function:: search(pattern, string, flags=0)
Scan through *string* looking for a location where the regular expression
- *pattern* produces a match, and return a corresponding :class:`MatchObject`
- instance. Return ``None`` if no position in the string matches the pattern; note
- that this is different from finding a zero-length match at some point in the
- string.
+ *pattern* produces a match, and return a corresponding :ref:`match object
+ <match-objects>`. Return ``None`` if no position in the string matches the
+ pattern; note that this is different from finding a zero-length match at some
+ point in the string.
-.. function:: match(pattern, string[, flags])
+.. function:: match(pattern, string, flags=0)
If zero or more characters at the beginning of *string* match the regular
- expression *pattern*, return a corresponding :class:`MatchObject` instance.
- Return ``None`` if the string does not match the pattern; note that this is
- different from a zero-length match.
+ expression *pattern*, return a corresponding :ref:`match object
+ <match-objects>`. Return ``None`` if the string does not match the pattern;
+ note that this is different from a zero-length match.
.. note::
@@ -569,7 +570,7 @@ form.
instead.
-.. function:: split(pattern, string[, maxsplit=0, flags=0])
+.. function:: split(pattern, string, maxsplit=0, flags=0)
Split *string* by the occurrences of *pattern*. If capturing parentheses are
used in *pattern*, then the text of all groups in the pattern are also returned
@@ -609,7 +610,7 @@ form.
Added the optional flags argument.
-.. function:: findall(pattern, string[, flags])
+.. function:: findall(pattern, string, flags=0)
Return all non-overlapping matches of *pattern* in *string*, as a list of
strings. The *string* is scanned left-to-right, and matches are returned in
@@ -619,16 +620,16 @@ form.
beginning of another match.
-.. function:: finditer(pattern, string[, flags])
+.. function:: finditer(pattern, string, flags=0)
- Return an :term:`iterator` yielding :class:`MatchObject` instances over all
- non-overlapping matches for the RE *pattern* in *string*. The *string* is
- scanned left-to-right, and matches are returned in the order found. Empty
+ Return an :term:`iterator` yielding :ref:`match objects <match-objects>` over
+ all non-overlapping matches for the RE *pattern* in *string*. The *string*
+ is scanned left-to-right, and matches are returned in the order found. Empty
matches are included in the result unless they touch the beginning of another
match.
-.. function:: sub(pattern, repl, string[, count, flags])
+.. function:: sub(pattern, repl, string, count=0, flags=0)
Return the string obtained by replacing the leftmost non-overlapping occurrences
of *pattern* in *string* by the replacement *repl*. If the pattern isn't found,
@@ -677,7 +678,7 @@ form.
Added the optional flags argument.
-.. function:: subn(pattern, repl, string[, count, flags])
+.. function:: subn(pattern, repl, string, count=0, flags=0)
Perform the same operation as :func:`sub`, but return a tuple ``(new_string,
number_of_subs_made)``.
@@ -711,107 +712,107 @@ form.
Regular Expression Objects
--------------------------
-.. class:: RegexObject
-
- The :class:`RegexObject` class supports the following methods and attributes:
+Compiled regular expression objects support the following methods and
+attributes.
- .. method:: RegexObject.search(string[, pos[, endpos]])
+.. method:: regex.search(string[, pos[, endpos]])
- Scan through *string* looking for a location where this regular expression
- produces a match, and return a corresponding :class:`MatchObject` instance.
- Return ``None`` if no position in the string matches the pattern; note that this
- is different from finding a zero-length match at some point in the string.
+ Scan through *string* looking for a location where this regular expression
+ produces a match, and return a corresponding :ref:`match object
+ <match-objects>`. Return ``None`` if no position in the string matches the
+ pattern; note that this is different from finding a zero-length match at some
+ point in the string.
- The optional second parameter *pos* gives an index in the string where the
- search is to start; it defaults to ``0``. This is not completely equivalent to
- slicing the string; the ``'^'`` pattern character matches at the real beginning
- of the string and at positions just after a newline, but not necessarily at the
- index where the search is to start.
+ The optional second parameter *pos* gives an index in the string where the
+ search is to start; it defaults to ``0``. This is not completely equivalent to
+ slicing the string; the ``'^'`` pattern character matches at the real beginning
+ of the string and at positions just after a newline, but not necessarily at the
+ index where the search is to start.
- The optional parameter *endpos* limits how far the string will be searched; it
- will be as if the string is *endpos* characters long, so only the characters
- from *pos* to ``endpos - 1`` will be searched for a match. If *endpos* is less
- than *pos*, no match will be found, otherwise, if *rx* is a compiled regular
- expression object, ``rx.search(string, 0, 50)`` is equivalent to
- ``rx.search(string[:50], 0)``.
+ The optional parameter *endpos* limits how far the string will be searched; it
+ will be as if the string is *endpos* characters long, so only the characters
+ from *pos* to ``endpos - 1`` will be searched for a match. If *endpos* is less
+ than *pos*, no match will be found, otherwise, if *rx* is a compiled regular
+ expression object, ``rx.search(string, 0, 50)`` is equivalent to
+ ``rx.search(string[:50], 0)``.
- >>> pattern = re.compile("d")
- >>> pattern.search("dog") # Match at index 0
- <_sre.SRE_Match object at ...>
- >>> pattern.search("dog", 1) # No match; search doesn't include the "d"
+ >>> pattern = re.compile("d")
+ >>> pattern.search("dog") # Match at index 0
+ <_sre.SRE_Match object at ...>
+ >>> pattern.search("dog", 1) # No match; search doesn't include the "d"
- .. method:: RegexObject.match(string[, pos[, endpos]])
+.. method:: regex.match(string[, pos[, endpos]])
- If zero or more characters at the *beginning* of *string* match this regular
- expression, return a corresponding :class:`MatchObject` instance. Return
- ``None`` if the string does not match the pattern; note that this is different
- from a zero-length match.
+ If zero or more characters at the *beginning* of *string* match this regular
+ expression, return a corresponding :ref:`match object <match-objects>`.
+ Return ``None`` if the string does not match the pattern; note that this is
+ different from a zero-length match.
- The optional *pos* and *endpos* parameters have the same meaning as for the
- :meth:`~RegexObject.search` method.
+ The optional *pos* and *endpos* parameters have the same meaning as for the
+ :meth:`~regex.search` method.
- .. note::
+ .. note::
- If you want to locate a match anywhere in *string*, use
- :meth:`~RegexObject.search` instead.
+ If you want to locate a match anywhere in *string*, use
+ :meth:`~regex.search` instead.
- >>> pattern = re.compile("o")
- >>> pattern.match("dog") # No match as "o" is not at the start of "dog".
- >>> pattern.match("dog", 1) # Match as "o" is the 2nd character of "dog".
- <_sre.SRE_Match object at ...>
+ >>> pattern = re.compile("o")
+ >>> pattern.match("dog") # No match as "o" is not at the start of "dog".
+ >>> pattern.match("dog", 1) # Match as "o" is the 2nd character of "dog".
+ <_sre.SRE_Match object at ...>
- .. method:: RegexObject.split(string[, maxsplit=0])
+.. method:: regex.split(string, maxsplit=0)
- Identical to the :func:`split` function, using the compiled pattern.
+ Identical to the :func:`split` function, using the compiled pattern.
- .. method:: RegexObject.findall(string[, pos[, endpos]])
+.. method:: regex.findall(string[, pos[, endpos]])
- Similar to the :func:`findall` function, using the compiled pattern, but
- also accepts optional *pos* and *endpos* parameters that limit the search
- region like for :meth:`match`.
+ Similar to the :func:`findall` function, using the compiled pattern, but
+ also accepts optional *pos* and *endpos* parameters that limit the search
+ region like for :meth:`match`.
- .. method:: RegexObject.finditer(string[, pos[, endpos]])
+.. method:: regex.finditer(string[, pos[, endpos]])
- Similar to the :func:`finditer` function, using the compiled pattern, but
- also accepts optional *pos* and *endpos* parameters that limit the search
- region like for :meth:`match`.
+ Similar to the :func:`finditer` function, using the compiled pattern, but
+ also accepts optional *pos* and *endpos* parameters that limit the search
+ region like for :meth:`match`.
- .. method:: RegexObject.sub(repl, string[, count=0])
+.. method:: regex.sub(repl, string, count=0)
- Identical to the :func:`sub` function, using the compiled pattern.
+ Identical to the :func:`sub` function, using the compiled pattern.
- .. method:: RegexObject.subn(repl, string[, count=0])
+.. method:: regex.subn(repl, string, count=0)
- Identical to the :func:`subn` function, using the compiled pattern.
+ Identical to the :func:`subn` function, using the compiled pattern.
- .. attribute:: RegexObject.flags
+.. attribute:: regex.flags
- The flags argument used when the RE object was compiled, or ``0`` if no flags
- were provided.
+ The flags argument used when the RE object was compiled, or ``0`` if no flags
+ were provided.
- .. attribute:: RegexObject.groups
+.. attribute:: regex.groups
- The number of capturing groups in the pattern.
+ The number of capturing groups in the pattern.
- .. attribute:: RegexObject.groupindex
+.. attribute:: regex.groupindex
- A dictionary mapping any symbolic group names defined by ``(?P<id>)`` to group
- numbers. The dictionary is empty if no symbolic groups were used in the
- pattern.
+ A dictionary mapping any symbolic group names defined by ``(?P<id>)`` to group
+ numbers. The dictionary is empty if no symbolic groups were used in the
+ pattern.
- .. attribute:: RegexObject.pattern
+.. attribute:: regex.pattern
- The pattern string from which the RE object was compiled.
+ The pattern string from which the RE object was compiled.
.. _match-objects:
@@ -819,181 +820,182 @@ Regular Expression Objects
Match Objects
-------------
-.. class:: MatchObject
+Match objects always have a boolean value of :const:`True`, so that you can test
+whether e.g. :func:`match` resulted in a match with a simple if statement. They
+support the following methods and attributes:
- Match Objects always have a boolean value of :const:`True`, so that you can test
- whether e.g. :func:`match` resulted in a match with a simple if statement. They
- support the following methods and attributes:
+.. method:: match.expand(template)
- .. method:: MatchObject.expand(template)
+ Return the string obtained by doing backslash substitution on the template
+ string *template*, as done by the :meth:`~regex.sub` method.
+ Escapes such as ``\n`` are converted to the appropriate characters,
+ and numeric backreferences (``\1``, ``\2``) and named backreferences
+ (``\g<1>``, ``\g<name>``) are replaced by the contents of the
+ corresponding group.
- Return the string obtained by doing backslash substitution on the template
- string *template*, as done by the :meth:`~RegexObject.sub` method. Escapes
- such as ``\n`` are converted to the appropriate characters, and numeric
- backreferences (``\1``, ``\2``) and named backreferences (``\g<1>``,
- ``\g<name>``) are replaced by the contents of the corresponding group.
+.. method:: match.group([group1, ...])
- .. method:: MatchObject.group([group1, ...])
+ Returns one or more subgroups of the match. If there is a single argument, the
+ result is a single string; if there are multiple arguments, the result is a
+ tuple with one item per argument. Without arguments, *group1* defaults to zero
+ (the whole match is returned). If a *groupN* argument is zero, the corresponding
+ return value is the entire matching string; if it is in the inclusive range
+ [1..99], it is the string matching the corresponding parenthesized group. If a
+ group number is negative or larger than the number of groups defined in the
+ pattern, an :exc:`IndexError` exception is raised. If a group is contained in a
+ part of the pattern that did not match, the corresponding result is ``None``.
+ If a group is contained in a part of the pattern that matched multiple times,
+ the last match is returned.
- Returns one or more subgroups of the match. If there is a single argument, the
- result is a single string; if there are multiple arguments, the result is a
- tuple with one item per argument. Without arguments, *group1* defaults to zero
- (the whole match is returned). If a *groupN* argument is zero, the corresponding
- return value is the entire matching string; if it is in the inclusive range
- [1..99], it is the string matching the corresponding parenthesized group. If a
- group number is negative or larger than the number of groups defined in the
- pattern, an :exc:`IndexError` exception is raised. If a group is contained in a
- part of the pattern that did not match, the corresponding result is ``None``.
- If a group is contained in a part of the pattern that matched multiple times,
- the last match is returned.
+ >>> m = re.match(r"(\w+) (\w+)", "Isaac Newton, physicist")
+ >>> m.group(0) # The entire match
+ 'Isaac Newton'
+ >>> m.group(1) # The first parenthesized subgroup.
+ 'Isaac'
+ >>> m.group(2) # The second parenthesized subgroup.
+ 'Newton'
+ >>> m.group(1, 2) # Multiple arguments give us a tuple.
+ ('Isaac', 'Newton')
- >>> m = re.match(r"(\w+) (\w+)", "Isaac Newton, physicist")
- >>> m.group(0) # The entire match
- 'Isaac Newton'
- >>> m.group(1) # The first parenthesized subgroup.
- 'Isaac'
- >>> m.group(2) # The second parenthesized subgroup.
- 'Newton'
- >>> m.group(1, 2) # Multiple arguments give us a tuple.
- ('Isaac', 'Newton')
+ If the regular expression uses the ``(?P<name>...)`` syntax, the *groupN*
+ arguments may also be strings identifying groups by their group name. If a
+ string argument is not used as a group name in the pattern, an :exc:`IndexError`
+ exception is raised.
- If the regular expression uses the ``(?P<name>...)`` syntax, the *groupN*
- arguments may also be strings identifying groups by their group name. If a
- string argument is not used as a group name in the pattern, an :exc:`IndexError`
- exception is raised.
+ A moderately complicated example:
- A moderately complicated example:
+ >>> m = re.match(r"(?P<first_name>\w+) (?P<last_name>\w+)", "Malcolm Reynolds")
+ >>> m.group('first_name')
+ 'Malcolm'
+ >>> m.group('last_name')
+ 'Reynolds'
- >>> m = re.match(r"(?P<first_name>\w+) (?P<last_name>\w+)", "Malcolm Reynolds")
- >>> m.group('first_name')
- 'Malcolm'
- >>> m.group('last_name')
- 'Reynolds'
+ Named groups can also be referred to by their index:
- Named groups can also be referred to by their index:
+ >>> m.group(1)
+ 'Malcolm'
+ >>> m.group(2)
+ 'Reynolds'
- >>> m.group(1)
- 'Malcolm'
- >>> m.group(2)
- 'Reynolds'
+ If a group matches multiple times, only the last match is accessible:
- If a group matches multiple times, only the last match is accessible:
+ >>> m = re.match(r"(..)+", "a1b2c3") # Matches 3 times.
+ >>> m.group(1) # Returns only the last match.
+ 'c3'
- >>> m = re.match(r"(..)+", "a1b2c3") # Matches 3 times.
- >>> m.group(1) # Returns only the last match.
- 'c3'
- .. method:: MatchObject.groups([default])
+.. method:: match.groups(default=None)
- Return a tuple containing all the subgroups of the match, from 1 up to however
- many groups are in the pattern. The *default* argument is used for groups that
- did not participate in the match; it defaults to ``None``.
+ Return a tuple containing all the subgroups of the match, from 1 up to however
+ many groups are in the pattern. The *default* argument is used for groups that
+ did not participate in the match; it defaults to ``None``.
- For example:
+ For example:
- >>> m = re.match(r"(\d+)\.(\d+)", "24.1632")
- >>> m.groups()
- ('24', '1632')
+ >>> m = re.match(r"(\d+)\.(\d+)", "24.1632")
+ >>> m.groups()
+ ('24', '1632')
- If we make the decimal place and everything after it optional, not all groups
- might participate in the match. These groups will default to ``None`` unless
- the *default* argument is given:
+ If we make the decimal place and everything after it optional, not all groups
+ might participate in the match. These groups will default to ``None`` unless
+ the *default* argument is given:
- >>> m = re.match(r"(\d+)\.?(\d+)?", "24")
- >>> m.groups() # Second group defaults to None.
- ('24', None)
- >>> m.groups('0') # Now, the second group defaults to '0'.
- ('24', '0')
+ >>> m = re.match(r"(\d+)\.?(\d+)?", "24")
+ >>> m.groups() # Second group defaults to None.
+ ('24', None)
+ >>> m.groups('0') # Now, the second group defaults to '0'.
+ ('24', '0')
- .. method:: MatchObject.groupdict([default])
+.. method:: match.groupdict(default=None)
- Return a dictionary containing all the *named* subgroups of the match, keyed by
- the subgroup name. The *default* argument is used for groups that did not
- participate in the match; it defaults to ``None``. For example:
+ Return a dictionary containing all the *named* subgroups of the match, keyed by
+ the subgroup name. The *default* argument is used for groups that did not
+ participate in the match; it defaults to ``None``. For example:
- >>> m = re.match(r"(?P<first_name>\w+) (?P<last_name>\w+)", "Malcolm Reynolds")
- >>> m.groupdict()
- {'first_name': 'Malcolm', 'last_name': 'Reynolds'}
+ >>> m = re.match(r"(?P<first_name>\w+) (?P<last_name>\w+)", "Malcolm Reynolds")
+ >>> m.groupdict()
+ {'first_name': 'Malcolm', 'last_name': 'Reynolds'}
- .. method:: MatchObject.start([group])
- MatchObject.end([group])
+.. method:: match.start([group])
+ match.end([group])
- Return the indices of the start and end of the substring matched by *group*;
- *group* defaults to zero (meaning the whole matched substring). Return ``-1`` if
- *group* exists but did not contribute to the match. For a match object *m*, and
- a group *g* that did contribute to the match, the substring matched by group *g*
- (equivalent to ``m.group(g)``) is ::
+ Return the indices of the start and end of the substring matched by *group*;
+ *group* defaults to zero (meaning the whole matched substring). Return ``-1`` if
+ *group* exists but did not contribute to the match. For a match object *m*, and
+ a group *g* that did contribute to the match, the substring matched by group *g*
+ (equivalent to ``m.group(g)``) is ::
- m.string[m.start(g):m.end(g)]
+ m.string[m.start(g):m.end(g)]
- Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched a
- null string. For example, after ``m = re.search('b(c?)', 'cba')``,
- ``m.start(0)`` is 1, ``m.end(0)`` is 2, ``m.start(1)`` and ``m.end(1)`` are both
- 2, and ``m.start(2)`` raises an :exc:`IndexError` exception.
+ Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched a
+ null string. For example, after ``m = re.search('b(c?)', 'cba')``,
+ ``m.start(0)`` is 1, ``m.end(0)`` is 2, ``m.start(1)`` and ``m.end(1)`` are both
+ 2, and ``m.start(2)`` raises an :exc:`IndexError` exception.
- An example that will remove *remove_this* from email addresses:
+ An example that will remove *remove_this* from email addresses:
- >>> email = "tony@tiremove_thisger.net"
- >>> m = re.search("remove_this", email)
- >>> email[:m.start()] + email[m.end():]
- 'tony@tiger.net'
+ >>> email = "tony@tiremove_thisger.net"
+ >>> m = re.search("remove_this", email)
+ >>> email[:m.start()] + email[m.end():]
+ 'tony@tiger.net'
- .. method:: MatchObject.span([group])
+.. method:: match.span([group])
- For :class:`MatchObject` *m*, return the 2-tuple ``(m.start(group),
- m.end(group))``. Note that if *group* did not contribute to the match, this is
- ``(-1, -1)``. *group* defaults to zero, the entire match.
+ For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note
+ that if *group* did not contribute to the match, this is ``(-1, -1)``.
+ *group* defaults to zero, the entire match.
- .. attribute:: MatchObject.pos
+.. attribute:: match.pos
+
+ The value of *pos* which was passed to the :meth:`~regex.search` or
+ :meth:`~regex.match` method of a :ref:`match object <match-objects>`. This
+ is the index into the string at which the RE engine started looking for a
+ match.
- The value of *pos* which was passed to the :meth:`~RegexObject.search` or
- :meth:`~RegexObject.match` method of the :class:`RegexObject`. This is the
- index into the string at which the RE engine started looking for a match.
+.. attribute:: match.endpos
- .. attribute:: MatchObject.endpos
+ The value of *endpos* which was passed to the :meth:`~regex.search` or
+ :meth:`~regex.match` method of a :ref:`match object <match-objects>`. This
+ is the index into the string beyond which the RE engine will not go.
- The value of *endpos* which was passed to the :meth:`~RegexObject.search` or
- :meth:`~RegexObject.match` method of the :class:`RegexObject`. This is the
- index into the string beyond which the RE engine will not go.
+.. attribute:: match.lastindex
- .. attribute:: MatchObject.lastindex
+ The integer index of the last matched capturing group, or ``None`` if no group
+ was matched at all. For example, the expressions ``(a)b``, ``((a)(b))``, and
+ ``((ab))`` will have ``lastindex == 1`` if applied to the string ``'ab'``, while
+ the expression ``(a)(b)`` will have ``lastindex == 2``, if applied to the same
+ string.
- The integer index of the last matched capturing group, or ``None`` if no group
- was matched at all. For example, the expressions ``(a)b``, ``((a)(b))``, and
- ``((ab))`` will have ``lastindex == 1`` if applied to the string ``'ab'``, while
- the expression ``(a)(b)`` will have ``lastindex == 2``, if applied to the same
- string.
+.. attribute:: match.lastgroup
- .. attribute:: MatchObject.lastgroup
+ The name of the last matched capturing group, or ``None`` if the group didn't
+ have a name, or if no group was matched at all.
- The name of the last matched capturing group, or ``None`` if the group didn't
- have a name, or if no group was matched at all.
+.. attribute:: match.re
- .. attribute:: MatchObject.re
+ The regular expression object whose :meth:`~regex.match` or
+ :meth:`~regex.search` method produced this match instance.
- The regular expression object whose :meth:`~RegexObject.match` or
- :meth:`~RegexObject.search` method produced this :class:`MatchObject`
- instance.
+.. attribute:: match.string
- .. attribute:: MatchObject.string
+ The string passed to :meth:`~regex.match` or :meth:`~regex.search`.
- The string passed to :meth:`~RegexObject.match` or
- :meth:`~RegexObject.search`.
+.. _re-examples:
-Examples
---------
+Regular Expression Examples
+---------------------------
Checking For a Pair
@@ -1035,8 +1037,7 @@ To match this with a regular expression, one could use backreferences as such:
"<Match: '354aa', groups=('a',)>"
To find out what card the pair consists of, one could use the
-:meth:`~MatchObject.group` method of :class:`MatchObject` in the following
-manner:
+:meth:`~match.group` method of the match object in the following manner:
.. doctest::
@@ -1059,14 +1060,14 @@ Simulating scanf()
.. index:: single: scanf()
-Python does not currently have an equivalent to :cfunc:`scanf`. Regular
+Python does not currently have an equivalent to :c:func:`scanf`. Regular
expressions are generally more powerful, though also more verbose, than
-:cfunc:`scanf` format strings. The table below offers some more-or-less
-equivalent mappings between :cfunc:`scanf` format tokens and regular
+:c:func:`scanf` format strings. The table below offers some more-or-less
+equivalent mappings between :c:func:`scanf` format tokens and regular
expressions.
+--------------------------------+---------------------------------------------+
-| :cfunc:`scanf` Token | Regular Expression |
+| :c:func:`scanf` Token | Regular Expression |
+================================+=============================================+
| ``%c`` | ``.`` |
+--------------------------------+---------------------------------------------+
@@ -1091,7 +1092,7 @@ To extract the filename and numbers from a string like ::
/usr/sbin/sendmail - 0 errors, 4 warnings
-you would use a :cfunc:`scanf` format like ::
+you would use a :c:func:`scanf` format like ::
%s - %d errors, %d warnings
@@ -1111,7 +1112,7 @@ recursion, you may encounter a :exc:`RuntimeError` exception with the message
>>> re.match('Begin (\w| )*? end', s).end()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
- File "/usr/local/lib/python3.1/re.py", line 132, in match
+ File "/usr/local/lib/python3.2/re.py", line 132, in match
return _compile(pattern, flags).match(string)
RuntimeError: maximum recursion limit exceeded
@@ -1250,10 +1251,10 @@ Finding all Adverbs and their Positions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If one wants more information about all matches of a pattern than the matched
-text, :func:`finditer` is useful as it provides instances of
-:class:`MatchObject` instead of strings. Continuing with the previous example,
-if one was a writer who wanted to find all of the adverbs *and their positions*
-in some text, he or she would use :func:`finditer` in the following manner:
+text, :func:`finditer` is useful as it provides :ref:`match objects
+<match-objects>` instead of strings. Continuing with the previous example, if
+one was a writer who wanted to find all of the adverbs *and their positions* in
+some text, he or she would use :func:`finditer` in the following manner:
>>> text = "He was carefully disguised but captured quickly by police."
>>> for m in re.finditer(r"\w+ly", text):
@@ -1284,3 +1285,69 @@ functionally identical:
<_sre.SRE_Match object at ...>
>>> re.match("\\\\", r"\\")
<_sre.SRE_Match object at ...>
+
+
+Writing a Tokenizer
+^^^^^^^^^^^^^^^^^^^
+
+A `tokenizer or scanner <http://en.wikipedia.org/wiki/Lexical_analysis>`_
+analyzes a string to categorize groups of characters. This is a useful first
+step in writing a compiler or interpreter.
+
+The text categories are specified with regular expressions. The technique is
+to combine those into a single master regular expression and to loop over
+successive matches::
+
+ Token = collections.namedtuple('Token', 'typ value line column')
+
+ def tokenize(s):
+ keywords = {'IF', 'THEN', 'FOR', 'NEXT', 'GOSUB', 'RETURN'}
+ tok_spec = [
+ ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number
+ ('ASSIGN', r':='), # Assignment operator
+ ('END', ';'), # Statement terminator
+ ('ID', r'[A-Za-z]+'), # Identifiers
+ ('OP', r'[+*\/\-]'), # Arithmetic operators
+ ('NEWLINE', r'\n'), # Line endings
+ ('SKIP', r'[ \t]'), # Skip over spaces and tabs
+ ]
+ tok_re = '|'.join('(?P<%s>%s)' % pair for pair in tok_spec)
+ gettok = re.compile(tok_re).match
+ line = 1
+ pos = line_start = 0
+ mo = gettok(s)
+ while mo is not None:
+ typ = mo.lastgroup
+ if typ == 'NEWLINE':
+ line_start = pos
+ line += 1
+ elif typ != 'SKIP':
+ if typ == 'ID' and val in keywords:
+ typ = val
+ yield Token(typ, mo.group(typ), line, mo.start()-line_start)
+ pos = mo.end()
+ mo = gettok(s, pos)
+ if pos != len(s):
+ raise RuntimeError('Unexpected character %r on line %d' %(s[pos], line))
+
+ >>> statements = '''\
+ total := total + price * quantity;
+ tax := price * 0.05;
+ '''
+ >>> for token in tokenize(statements):
+ ... print(token)
+ ...
+ Token(typ='ID', value='total', line=1, column=8)
+ Token(typ='ASSIGN', value=':=', line=1, column=14)
+ Token(typ='ID', value='total', line=1, column=17)
+ Token(typ='OP', value='+', line=1, column=23)
+ Token(typ='ID', value='price', line=1, column=25)
+ Token(typ='OP', value='*', line=1, column=31)
+ Token(typ='ID', value='quantity', line=1, column=33)
+ Token(typ='END', value=';', line=1, column=41)
+ Token(typ='ID', value='tax', line=2, column=9)
+ Token(typ='ASSIGN', value=':=', line=2, column=13)
+ Token(typ='ID', value='price', line=2, column=16)
+ Token(typ='OP', value='*', line=2, column=22)
+ Token(typ='NUMBER', value='0.05', line=2, column=24)
+ Token(typ='END', value=';', line=2, column=28)
diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst
index ab7b4b6ecb..ab5519775b 100644
--- a/Doc/library/readline.rst
+++ b/Doc/library/readline.rst
@@ -1,4 +1,3 @@
-
:mod:`readline` --- GNU readline interface
==========================================
@@ -25,6 +24,7 @@ function.
you can check for the text "libedit" in :const:`readline.__doc__`
to differentiate between GNU readline and libedit.
+
The :mod:`readline` module defines the following functions:
@@ -177,7 +177,6 @@ The :mod:`readline` module defines the following functions:
Append a line to the history buffer, as if it was the last line typed.
-
.. seealso::
Module :mod:`rlcompleter`
diff --git a/Doc/library/reprlib.rst b/Doc/library/reprlib.rst
index 958ead61a5..0e870daa3f 100644
--- a/Doc/library/reprlib.rst
+++ b/Doc/library/reprlib.rst
@@ -1,11 +1,13 @@
:mod:`reprlib` --- Alternate :func:`repr` implementation
========================================================
-
.. module:: reprlib
:synopsis: Alternate repr() implementation with size limits.
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/reprlib.py`
+
+--------------
The :mod:`reprlib` module provides a means for producing object representations
with limits on the size of the resulting strings. This is used in the Python
@@ -35,6 +37,29 @@ This module provides a class, an instance, and a function:
similar to that returned by the built-in function of the same name, but with
limits on most sizes.
+In addition to size-limiting tools, the module also provides a decorator for
+detecting recursive calls to :meth:`__repr__` and substituting a placeholder
+string instead.
+
+.. decorator:: recursive_repr(fillvalue="...")
+
+ Decorator for :meth:`__repr__` methods to detect recursive calls within the
+ same thread. If a recursive call is made, the *fillvalue* is returned,
+ otherwise, the usual :meth:`__repr__` call is made. For example:
+
+ >>> class MyList(list):
+ ... @recursive_repr()
+ ... def __repr__(self):
+ ... return '<' + '|'.join(map(repr, self)) + '>'
+ ...
+ >>> m = MyList('abc')
+ >>> m.append(m)
+ >>> m.append('x')
+ >>> print(m)
+ <'a'|'b'|'c'|...|'x'>
+
+ .. versionadded:: 3.2
+
.. _repr-objects:
diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst
index fbd7204f3a..c16b01301e 100644
--- a/Doc/library/resource.rst
+++ b/Doc/library/resource.rst
@@ -1,4 +1,3 @@
-
:mod:`resource` --- Resource usage information
==============================================
@@ -218,14 +217,14 @@ function to specify which processes information should be provided for.
.. data:: RUSAGE_SELF
- :const:`RUSAGE_SELF` should be used to request information pertaining only to
- the process itself.
+ Pass to :func:`getrusage` to request resources consumed by the calling
+ process, which is the sum of resources used by all threads in the process.
.. data:: RUSAGE_CHILDREN
- Pass to :func:`getrusage` to request resource information for child processes of
- the calling process.
+ Pass to :func:`getrusage` to request resources consumed by child processes
+ of the calling process which have been terminated and waited for.
.. data:: RUSAGE_BOTH
@@ -233,3 +232,10 @@ function to specify which processes information should be provided for.
Pass to :func:`getrusage` to request resources consumed by both the current
process and child processes. May not be available on all systems.
+
+.. data:: RUSAGE_THREAD
+
+ Pass to :func:`getrusage` to request resources consumed by the current
+ thread. May not be available on all systems.
+
+ .. versionadded:: 3.2
diff --git a/Doc/library/rlcompleter.rst b/Doc/library/rlcompleter.rst
index 6b3befcfee..633088d897 100644
--- a/Doc/library/rlcompleter.rst
+++ b/Doc/library/rlcompleter.rst
@@ -1,4 +1,3 @@
-
:mod:`rlcompleter` --- Completion function for GNU readline
===========================================================
@@ -6,6 +5,9 @@
:synopsis: Python identifier completion, suitable for the GNU readline library.
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
+**Source code:** :source:`Lib/rlcompleter.py`
+
+--------------
The :mod:`rlcompleter` module defines a completion function suitable for the
:mod:`readline` module by completing valid Python identifiers and keywords.
diff --git a/Doc/library/runpy.rst b/Doc/library/runpy.rst
index 1b481678e4..4df622cb1f 100644
--- a/Doc/library/runpy.rst
+++ b/Doc/library/runpy.rst
@@ -5,71 +5,132 @@
:synopsis: Locate and run Python modules without importing them first.
.. moduleauthor:: Nick Coghlan <ncoghlan@gmail.com>
+**Source code:** :source:`Lib/runpy.py`
-The :mod:`runpy` module is used to locate and run Python modules without
-importing them first. Its main use is to implement the :option:`-m` command line
-switch that allows scripts to be located using the Python module namespace
-rather than the filesystem.
-
-When executed as a script, the module effectively operates as follows::
+--------------
- del sys.argv[0] # Remove the runpy module from the arguments
- run_module(sys.argv[0], run_name="__main__", alter_sys=True)
+The :mod:`runpy` module is used to locate and run Python modules without
+importing them first. Its main use is to implement the :option:`-m` command
+line switch that allows scripts to be located using the Python module
+namespace rather than the filesystem.
-The :mod:`runpy` module provides a single function:
+The :mod:`runpy` module provides two functions:
-.. function:: run_module(mod_name[, init_globals] [, run_name][, alter_sys])
+.. function:: run_module(mod_name, init_globals=None, run_name=None, alter_sys=False)
- Execute the code of the specified module and return the resulting module globals
- dictionary. The module's code is first located using the standard import
- mechanism (refer to PEP 302 for details) and then executed in a fresh module
- namespace.
+ Execute the code of the specified module and return the resulting module
+ globals dictionary. The module's code is first located using the standard
+ import mechanism (refer to :pep:`302` for details) and then executed in a
+ fresh module namespace.
- If the supplied module name refers to a package rather than a normal module,
- then that package is imported and the ``__main__`` submodule within that
- package is then executed and the resulting module globals dictionary returned.
+ If the supplied module name refers to a package rather than a normal
+ module, then that package is imported and the ``__main__`` submodule within
+ that package is then executed and the resulting module globals dictionary
+ returned.
- The optional dictionary argument *init_globals* may be used to pre-populate the
- globals dictionary before the code is executed. The supplied dictionary will not
- be modified. If any of the special global variables below are defined in the
- supplied dictionary, those definitions are overridden by the ``run_module``
- function.
+ The optional dictionary argument *init_globals* may be used to pre-populate
+ the module's globals dictionary before the code is executed. The supplied
+ dictionary will not be modified. If any of the special global variables
+ below are defined in the supplied dictionary, those definitions are
+ overridden by :func:`run_module`.
- The special global variables ``__name__``, ``__file__``, ``__loader__``,
- ``__builtins__`` and ``__package__`` are set in the globals dictionary before
- the module code is executed.
+ The special global variables ``__name__``, ``__file__``, ``__cached__``,
+ ``__loader__``
+ and ``__package__`` are set in the globals dictionary before the module
+ code is executed (Note that this is a minimal set of variables - other
+ variables may be set implicitly as an interpreter implementation detail).
- ``__name__`` is set to *run_name* if this optional argument is supplied, to
- ``mod_name + '.__main__'`` if the named module is a package and to the
- *mod_name* argument otherwise.
+ ``__name__`` is set to *run_name* if this optional argument is not
+ :const:`None`, to ``mod_name + '.__main__'`` if the named module is a
+ package and to the *mod_name* argument otherwise.
- ``__loader__`` is set to the PEP 302 module loader used to retrieve the code for
- the module (This loader may be a wrapper around the standard import mechanism).
+ ``__file__`` is set to the name provided by the module loader. If the
+ loader does not make filename information available, this variable is set
+ to :const:`None`.
- ``__file__`` is set to the name provided by the module loader. If the loader
- does not make filename information available, this variable is set to ``None``.
+ ``__cached__`` will be set to ``None``.
- ``__builtins__`` is automatically initialised with a reference to the top level
- namespace of the :mod:`builtins` module.
+ ``__loader__`` is set to the :pep:`302` module loader used to retrieve the
+ code for the module (This loader may be a wrapper around the standard
+ import mechanism).
- ``__package__`` is set to *mod_name* if the named module is a package and to
- ``mod_name.rpartition('.')[0]`` otherwise.
+ ``__package__`` is set to *mod_name* if the named module is a package and
+ to ``mod_name.rpartition('.')[0]`` otherwise.
- If the argument *alter_sys* is supplied and evaluates to ``True``, then
- ``sys.argv[0]`` is updated with the value of ``__file__`` and
+ If the argument *alter_sys* is supplied and evaluates to :const:`True`,
+ then ``sys.argv[0]`` is updated with the value of ``__file__`` and
``sys.modules[__name__]`` is updated with a temporary module object for the
module being executed. Both ``sys.argv[0]`` and ``sys.modules[__name__]``
are restored to their original values before the function returns.
- Note that this manipulation of :mod:`sys` is not thread-safe. Other threads may
- see the partially initialised module, as well as the altered list of arguments.
- It is recommended that the :mod:`sys` module be left alone when invoking this
- function from threaded code.
+ Note that this manipulation of :mod:`sys` is not thread-safe. Other threads
+ may see the partially initialised module, as well as the altered list of
+ arguments. It is recommended that the :mod:`sys` module be left alone when
+ invoking this function from threaded code.
+
.. versionchanged:: 3.1
Added ability to execute packages by looking for a ``__main__`` submodule.
+ .. versionchanged:: 3.2
+ Added ``__cached__`` global variable (see :PEP:`3147`).
+
+
+.. function:: run_path(file_path, init_globals=None, run_name=None)
+
+ Execute the code at the named filesystem location and return the resulting
+ module globals dictionary. As with a script name supplied to the CPython
+ command line, the supplied path may refer to a Python source file, a
+ compiled bytecode file or a valid sys.path entry containing a ``__main__``
+ module (e.g. a zipfile containing a top-level ``__main__.py`` file).
+
+ For a simple script, the specified code is simply executed in a fresh
+ module namespace. For a valid sys.path entry (typically a zipfile or
+ directory), the entry is first added to the beginning of ``sys.path``. The
+ function then looks for and executes a :mod:`__main__` module using the
+ updated path. Note that there is no special protection against invoking
+ an existing :mod:`__main__` entry located elsewhere on ``sys.path`` if
+ there is no such module at the specified location.
+
+ The optional dictionary argument *init_globals* may be used to pre-populate
+ the module's globals dictionary before the code is executed. The supplied
+ dictionary will not be modified. If any of the special global variables
+ below are defined in the supplied dictionary, those definitions are
+ overridden by :func:`run_path`.
+
+ The special global variables ``__name__``, ``__file__``, ``__loader__``
+ and ``__package__`` are set in the globals dictionary before the module
+ code is executed (Note that this is a minimal set of variables - other
+ variables may be set implicitly as an interpreter implementation detail).
+
+ ``__name__`` is set to *run_name* if this optional argument is not
+ :const:`None` and to ``'<run_path>'`` otherwise.
+
+ ``__file__`` is set to the name provided by the module loader. If the
+ loader does not make filename information available, this variable is set
+ to :const:`None`. For a simple script, this will be set to ``file_path``.
+
+ ``__loader__`` is set to the :pep:`302` module loader used to retrieve the
+ code for the module (This loader may be a wrapper around the standard
+ import mechanism). For a simple script, this will be set to :const:`None`.
+
+ ``__package__`` is set to ``__name__.rpartition('.')[0]``.
+
+ A number of alterations are also made to the :mod:`sys` module. Firstly,
+ ``sys.path`` may be altered as described above. ``sys.argv[0]`` is updated
+ with the value of ``file_path`` and ``sys.modules[__name__]`` is updated
+ with a temporary module object for the module being executed. All
+ modifications to items in :mod:`sys` are reverted before the function
+ returns.
+
+ Note that, unlike :func:`run_module`, the alterations made to :mod:`sys`
+ are not optional in this function as these adjustments are essential to
+ allowing the execution of sys.path entries. As the thread-safety
+ limitations still apply, use of this function in threaded code should be
+ either serialised with the import lock or delegated to a separate process.
+
+ .. versionadded:: 3.2
.. seealso::
@@ -79,3 +140,4 @@ The :mod:`runpy` module provides a single function:
:pep:`366` - Main module explicit relative imports
PEP written and implemented by Nick Coghlan.
+ :ref:`using-on-general` - CPython command line details
diff --git a/Doc/library/sched.rst b/Doc/library/sched.rst
index 0290ec41cd..ab58237041 100644
--- a/Doc/library/sched.rst
+++ b/Doc/library/sched.rst
@@ -7,10 +7,13 @@
.. index:: single: event scheduling
+**Source code:** :source:`Lib/sched.py`
+
+--------------
+
The :mod:`sched` module defines a class which implements a general purpose event
scheduler:
-
.. class:: scheduler(timefunc, delayfunc)
The :class:`scheduler` class defines a generic interface to scheduling events.
diff --git a/Doc/library/select.rst b/Doc/library/select.rst
index 70f73700b4..f1fd126d94 100644
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -1,4 +1,3 @@
-
:mod:`select` --- Waiting for I/O completion
============================================
@@ -6,9 +5,9 @@
:synopsis: Wait for I/O completion on multiple streams.
-This module provides access to the :cfunc:`select` and :cfunc:`poll` functions
-available in most operating systems, :cfunc:`epoll` available on Linux 2.5+ and
-:cfunc:`kqueue` available on most BSD.
+This module provides access to the :c:func:`select` and :c:func:`poll` functions
+available in most operating systems, :c:func:`epoll` available on Linux 2.5+ and
+:c:func:`kqueue` available on most BSD.
Note that on Windows, it only works for sockets; on other operating systems,
it also works for other file types (in particular, on Unix, it works on pipes).
It cannot be used on regular files to determine whether a file has grown since
@@ -20,11 +19,11 @@ The module defines the following:
.. exception:: error
The exception raised when an error occurs. The accompanying value is a pair
- containing the numeric error code from :cdata:`errno` and the corresponding
- string, as would be printed by the C function :cfunc:`perror`.
+ containing the numeric error code from :c:data:`errno` and the corresponding
+ string, as would be printed by the C function :c:func:`perror`.
-.. function:: epoll([sizehint=-1])
+.. function:: epoll(sizehint=-1)
(Only supported on Linux 2.5.44 and newer.) Returns an edge polling object,
which can be used as Edge or Level Triggered interface for I/O events; see
@@ -54,7 +53,7 @@ The module defines the following:
.. function:: select(rlist, wlist, xlist[, timeout])
- This is a straightforward interface to the Unix :cfunc:`select` system call.
+ This is a straightforward interface to the Unix :c:func:`select` system call.
The first three arguments are sequences of 'waitable objects': either
integers representing file descriptors or objects with a parameterless method
named :meth:`fileno` returning such an integer:
@@ -91,10 +90,21 @@ The module defines the following:
.. index:: single: WinSock
File objects on Windows are not acceptable, but sockets are. On Windows,
- the underlying :cfunc:`select` function is provided by the WinSock
+ the underlying :c:func:`select` function is provided by the WinSock
library, and does not handle file descriptors that don't originate from
WinSock.
+.. attribute:: PIPE_BUF
+
+ The minimum number of bytes which can be written without blocking to a pipe
+ when the pipe has been reported as ready for writing by :func:`select`,
+ :func:`poll` or another interface in this module. This doesn't apply
+ to other kind of file-like objects such as sockets.
+
+ This value is guaranteed by POSIX to be at least 512. Availability: Unix.
+
+ .. versionadded:: 3.2
+
.. _epoll-objects:
@@ -124,15 +134,15 @@ Edge and Level Trigger Polling (epoll) Objects
| :const:`EPOLLONESHOT` | Set one-shot behavior. After one event is |
| | pulled out, the fd is internally disabled |
+-----------------------+-----------------------------------------------+
- | :const:`EPOLLRDNORM` | ??? |
+ | :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` |
+-----------------------+-----------------------------------------------+
- | :const:`EPOLLRDBAND` | ??? |
+ | :const:`EPOLLRDBAND` | Priority data band can be read. |
+-----------------------+-----------------------------------------------+
- | :const:`EPOLLWRNORM` | ??? |
+ | :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` |
+-----------------------+-----------------------------------------------+
- | :const:`EPOLLWRBAND` | ??? |
+ | :const:`EPOLLWRBAND` | Priority data may be written. |
+-----------------------+-----------------------------------------------+
- | :const:`EPOLLMSG` | ??? |
+ | :const:`EPOLLMSG` | Ignored. |
+-----------------------+-----------------------------------------------+
@@ -181,13 +191,13 @@ Edge and Level Trigger Polling (epoll) Objects
Polling Objects
---------------
-The :cfunc:`poll` system call, supported on most Unix systems, provides better
+The :c:func:`poll` system call, supported on most Unix systems, provides better
scalability for network servers that service many, many clients at the same
-time. :cfunc:`poll` scales better because the system call only requires listing
-the file descriptors of interest, while :cfunc:`select` builds a bitmap, turns
+time. :c:func:`poll` scales better because the system call only requires listing
+the file descriptors of interest, while :c:func:`select` builds a bitmap, turns
on bits for the fds of interest, and then afterward the whole bitmap has to be
-linearly scanned again. :cfunc:`select` is O(highest file descriptor), while
-:cfunc:`poll` is O(number of file descriptors).
+linearly scanned again. :c:func:`select` is O(highest file descriptor), while
+:c:func:`poll` is O(number of file descriptors).
.. method:: poll.register(fd[, eventmask])
@@ -226,7 +236,7 @@ linearly scanned again. :cfunc:`select` is O(highest file descriptor), while
.. method:: poll.modify(fd, eventmask)
Modifies an already registered fd. This has the same effect as
- :meth:`register(fd, eventmask)`. Attempting to modify a file descriptor
+ ``register(fd, eventmask)``. Attempting to modify a file descriptor
that was never registered causes an :exc:`IOError` exception with errno
:const:`ENOENT` to be raised.
diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst
index b2818141ec..9d7d5045e2 100644
--- a/Doc/library/shelve.rst
+++ b/Doc/library/shelve.rst
@@ -7,6 +7,10 @@
.. index:: module: pickle
+**Source code:** :source:`Lib/shelve.py`
+
+--------------
+
A "shelf" is a persistent, dictionary-like object. The difference with "dbm"
databases is that the values (not the keys!) in a shelf can be essentially
arbitrary Python objects --- anything that the :mod:`pickle` module can handle.
@@ -14,7 +18,7 @@ This includes most class instances, recursive data types, and objects containing
lots of shared sub-objects. The keys are ordinary strings.
-.. function:: open(filename[, flag='c'[, protocol=None[, writeback=False]]])
+.. function:: open(filename, flag='c', protocol=None, writeback=False)
Open a persistent dictionary. The filename specified is the base filename for
the underlying database. As a side-effect, an extension may be added to the
@@ -97,7 +101,7 @@ Restrictions
implementation used.
-.. class:: Shelf(dict[, protocol=None[, writeback=False]])
+.. class:: Shelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
A subclass of :class:`collections.MutableMapping` which stores pickled values
in the *dict* object.
@@ -111,8 +115,15 @@ Restrictions
This allows natural operations on mutable entries, but can consume much more
memory and make sync and close take a long time.
+ The *keyencoding* parameter is the encoding used to encode keys before they
+ are used with the underlying dict.
+
+ .. versionadded:: 3.2
+ The *keyencoding* parameter; previously, keys were always encoded in
+ UTF-8.
-.. class:: BsdDbShelf(dict[, protocol=None[, writeback=False]])
+
+.. class:: BsdDbShelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`,
:meth:`previous`, :meth:`last` and :meth:`set_location` which are available
@@ -121,11 +132,11 @@ Restrictions
modules. The *dict* object passed to the constructor must support those
methods. This is generally accomplished by calling one of
:func:`bsddb.hashopen`, :func:`bsddb.btopen` or :func:`bsddb.rnopen`. The
- optional *protocol* and *writeback* parameters have the same interpretation
- as for the :class:`Shelf` class.
+ optional *protocol*, *writeback*, and *keyencoding* parameters have the same
+ interpretation as for the :class:`Shelf` class.
-.. class:: DbfilenameShelf(filename[, flag='c'[, protocol=None[, writeback=False]]])
+.. class:: DbfilenameShelf(filename, flag='c', protocol=None, writeback=False)
A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-like
object. The underlying file will be opened using :func:`dbm.open`. By
diff --git a/Doc/library/shlex.rst b/Doc/library/shlex.rst
index ee241f4a52..03c9f98a04 100644
--- a/Doc/library/shlex.rst
+++ b/Doc/library/shlex.rst
@@ -1,4 +1,3 @@
-
:mod:`shlex` --- Simple lexical analysis
========================================
@@ -9,6 +8,9 @@
.. sectionauthor:: Eric S. Raymond <esr@snark.thyrsus.com>
.. sectionauthor:: Gustavo Niemeyer <niemeyer@conectiva.com>
+**Source code:** :source:`Lib/shlex.py`
+
+--------------
The :class:`shlex` class makes it easy to write lexical analyzers for simple
syntaxes resembling that of the Unix shell. This will often be useful for
@@ -18,7 +20,7 @@ applications) or for parsing quoted strings.
The :mod:`shlex` module defines the following functions:
-.. function:: split(s[, comments[, posix]])
+.. function:: split(s, comments=False, posix=True)
Split the string *s* using shell-like syntax. If *comments* is :const:`False`
(the default), the parsing of comments in the given string will be disabled
@@ -28,13 +30,14 @@ The :mod:`shlex` module defines the following functions:
.. note::
- Since the :func:`split` function instantiates a :class:`shlex` instance, passing
- ``None`` for *s* will read the string to split from standard input.
+ Since the :func:`split` function instantiates a :class:`shlex` instance,
+ passing ``None`` for *s* will read the string to split from standard
+ input.
The :mod:`shlex` module defines the following class:
-.. class:: shlex([instream[, infile[, posix]]])
+.. class:: shlex(instream=None, infile=None, posix=False)
A :class:`shlex` instance or subclass instance is a lexical analyzer object.
The initialization argument, if present, specifies where to read characters
@@ -111,7 +114,7 @@ A :class:`shlex` instance has the following methods:
:meth:`pop_source` methods.
-.. method:: shlex.push_source(stream[, filename])
+.. method:: shlex.push_source(newstream, newfile=None)
Push an input source stream onto the input stack. If the filename argument is
specified it will later be available for use in error messages. This is the
@@ -124,7 +127,7 @@ A :class:`shlex` instance has the following methods:
used internally when the lexer reaches EOF on a stacked input stream.
-.. method:: shlex.error_leader([file[, line]])
+.. method:: shlex.error_leader(infile=None, lineno=None)
This method generates an error message leader in the format of a Unix C compiler
error label; the format is ``'"%s", line %d: '``, where the ``%s`` is replaced
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index 7cf8550d47..1a878d5fd0 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -1,4 +1,3 @@
-
:mod:`shutil` --- High-level file operations
============================================
@@ -11,6 +10,10 @@
single: file; copying
single: copying files
+**Source code:** :source:`Lib/shutil.py`
+
+--------------
+
The :mod:`shutil` module offers a number of high-level operations on files and
collections of files. In particular, functions are provided which support file
copying and removal. For operations on individual files, see also the
@@ -19,7 +22,7 @@ copying and removal. For operations on individual files, see also the
.. warning::
Even the higher-level file copying functions (:func:`copy`, :func:`copy2`)
- can't copy all file metadata.
+ cannot copy all file metadata.
On POSIX platforms, this means that file owner and group are lost as well
as ACLs. On Mac OS, the resource fork and other metadata are not used.
@@ -28,6 +31,9 @@ copying and removal. For operations on individual files, see also the
are not copied.
+Directory and files operations
+------------------------------
+
.. function:: copyfileobj(fsrc, fdst[, length])
Copy the contents of the file-like object *fsrc* to the file-like object *fdst*.
@@ -86,7 +92,7 @@ copying and removal. For operations on individual files, see also the
match one of the glob-style *patterns* provided. See the example below.
-.. function:: copytree(src, dst[, symlinks=False[, ignore=None]])
+.. function:: copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False)
Recursively copy an entire directory tree rooted at *src*. The destination
directory, named by *dst*, must not already exist; it will be created as well
@@ -98,6 +104,13 @@ copying and removal. For operations on individual files, see also the
symbolic links in the new tree; if false or omitted, the contents of the
linked files are copied to the new tree.
+ When *symlinks* is false, if the file pointed by the symlink doesn't
+ exist, a exception will be added in the list of errors raised in
+ a :exc:`Error` exception at the end of the copy process.
+ You can set the optional *ignore_dangling_symlinks* flag to true if you
+ want to silence this exception. Notice that this option has no effect
+ on platforms that don't support :func:`os.symlink`.
+
If *ignore* is given, it must be a callable that will receive as its
arguments the directory being visited by :func:`copytree`, and a list of its
contents, as returned by :func:`os.listdir`. Since :func:`copytree` is
@@ -110,11 +123,21 @@ copying and removal. For operations on individual files, see also the
If exception(s) occur, an :exc:`Error` is raised with a list of reasons.
- The source code for this should be considered an example rather than the
- ultimate tool.
+ If *copy_function* is given, it must be a callable that will be used
+ to copy each file. It will be called with the source path and the
+ destination path as arguments. By default, :func:`copy2` is used, but any
+ function that supports the same signature (like :func:`copy`) can be used.
+ .. versionchanged:: 3.2
+ Added the *copy_function* argument to be able to provide a custom copy
+ function.
-.. function:: rmtree(path[, ignore_errors[, onerror]])
+ .. versionchanged:: 3.2
+ Added the *ignore_dangling_symlinks* argument to silent dangling symlinks
+ errors when *symlinks* is false.
+
+
+.. function:: rmtree(path, ignore_errors=False, onerror=None)
.. index:: single: directory; deleting
@@ -151,8 +174,8 @@ copying and removal. For operations on individual files, see also the
.. _shutil-example:
-Example
--------
+copytree example
+::::::::::::::::
This example is the implementation of the :func:`copytree` function, described
above, with the docstring omitted. It demonstrates many of the other functions
@@ -190,3 +213,182 @@ provided by this module. ::
if errors:
raise Error(errors)
+Another example that uses the :func:`ignore_patterns` helper::
+
+ from shutil import copytree, ignore_patterns
+
+ copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))
+
+This will copy everything except ``.pyc`` files and files or directories whose
+name starts with ``tmp``.
+
+Another example that uses the *ignore* argument to add a logging call::
+
+ from shutil import copytree
+ import logging
+
+ def _logpath(path, names):
+ logging.info('Working in %s' % path)
+ return [] # nothing will be ignored
+
+ copytree(source, destination, ignore=_logpath)
+
+
+.. _archiving-operations:
+
+Archiving operations
+--------------------
+
+.. function:: make_archive(base_name, format, [root_dir, [base_dir, [verbose, [dry_run, [owner, [group, [logger]]]]]]])
+
+ Create an archive file (such as zip or tar) and return its name.
+
+ *base_name* is the name of the file to create, including the path, minus
+ any format-specific extension. *format* is the archive format: one of
+ "zip", "tar", "bztar" (if the :mod:`bz2` module is available) or "gztar".
+
+ *root_dir* is a directory that will be the root directory of the
+ archive; for example, we typically chdir into *root_dir* before creating the
+ archive.
+
+ *base_dir* is the directory where we start archiving from;
+ i.e. *base_dir* will be the common prefix of all files and
+ directories in the archive.
+
+ *root_dir* and *base_dir* both default to the current directory.
+
+ *owner* and *group* are used when creating a tar archive. By default,
+ uses the current owner and group.
+
+ *logger* is an instance of :class:`logging.Logger`.
+
+ .. versionadded:: 3.2
+
+
+.. function:: get_archive_formats()
+
+ Returns a list of supported formats for archiving.
+ Each element of the returned sequence is a tuple ``(name, description)``
+
+ By default :mod:`shutil` provides these formats:
+
+ - *gztar*: gzip'ed tar-file
+ - *bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available.)
+ - *tar*: uncompressed tar file
+ - *zip*: ZIP file
+
+ You can register new formats or provide your own archiver for any existing
+ formats, by using :func:`register_archive_format`.
+
+ .. versionadded:: 3.2
+
+
+.. function:: register_archive_format(name, function, [extra_args, [description]])
+
+ Registers an archiver for the format *name*. *function* is a callable that
+ will be used to invoke the archiver.
+
+ If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be
+ used as extra keywords arguments when the archiver callable is used.
+
+ *description* is used by :func:`get_archive_formats` which returns the
+ list of archivers. Defaults to an empty list.
+
+ .. versionadded:: 3.2
+
+
+.. function:: unregister_archive_format(name)
+
+ Remove the archive format *name* from the list of supported formats.
+
+ .. versionadded:: 3.2
+
+
+.. function:: unpack_archive(filename[, extract_dir[, format]])
+
+ Unpack an archive. *filename* is the full path of the archive.
+
+ *extract_dir* is the name of the target directory where the archive is
+ unpacked. If not provided, the current working directory is used.
+
+ *format* is the archive format: one of "zip", "tar", or "gztar". Or any
+ other format registered with :func:`register_unpack_format`. If not
+ provided, :func:`unpack_archive` will use the archive file name extension
+ and see if an unpacker was registered for that extension. In case none is
+ found, a :exc:`ValueError` is raised.
+
+ .. versionadded:: 3.2
+
+
+.. function:: register_unpack_format(name, extensions, function[, extra_args[, description]])
+
+ Registers an unpack format. *name* is the name of the format and
+ *extensions* is a list of extensions corresponding to the format, like
+ ``.zip`` for Zip files.
+
+ *function* is the callable that will be used to unpack archives. The
+ callable will receive the path of the archive, followed by the directory
+ the archive must be extracted to.
+
+ When provided, *extra_args* is a sequence of ``(name, value)`` tuples that
+ will be passed as keywords arguments to the callable.
+
+ *description* can be provided to describe the format, and will be returned
+ by the :func:`get_unpack_formats` function.
+
+ .. versionadded:: 3.2
+
+
+.. function:: unregister_unpack_format(name)
+
+ Unregister an unpack format. *name* is the name of the format.
+
+ .. versionadded:: 3.2
+
+
+.. function:: get_unpack_formats()
+
+ Return a list of all registered formats for unpacking.
+ Each element of the returned sequence is a tuple
+ ``(name, extensions, description)``.
+
+ By default :mod:`shutil` provides these formats:
+
+ - *gztar*: gzip'ed tar-file
+ - *bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available.)
+ - *tar*: uncompressed tar file
+ - *zip*: ZIP file
+
+ You can register new formats or provide your own unpacker for any existing
+ formats, by using :func:`register_unpack_format`.
+
+ .. versionadded:: 3.2
+
+
+
+Archiving example
+:::::::::::::::::
+
+In this example, we create a gzip'ed tar-file archive containing all files
+found in the :file:`.ssh` directory of the user::
+
+ >>> from shutil import make_archive
+ >>> import os
+ >>> archive_name = os.path.expanduser(os.path.join('~', 'myarchive'))
+ >>> root_dir = os.path.expanduser(os.path.join('~', '.ssh'))
+ >>> make_archive(archive_name, 'gztar', root_dir)
+ '/Users/tarek/myarchive.tar.gz'
+
+The resulting archive contains::
+
+ $ tar -tzvf /Users/tarek/myarchive.tar.gz
+ drwx------ tarek/staff 0 2010-02-01 16:23:40 ./
+ -rw-r--r-- tarek/staff 609 2008-06-09 13:26:54 ./authorized_keys
+ -rwxr-xr-x tarek/staff 65 2008-06-09 13:26:54 ./config
+ -rwx------ tarek/staff 668 2008-06-09 13:26:54 ./id_dsa
+ -rwxr-xr-x tarek/staff 609 2008-06-09 13:26:54 ./id_dsa.pub
+ -rw------- tarek/staff 1675 2008-06-09 13:26:54 ./id_rsa
+ -rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub
+ -rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts
+
+
diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
index 309f71b3ce..698b1e74f4 100644
--- a/Doc/library/signal.rst
+++ b/Doc/library/signal.rst
@@ -1,4 +1,3 @@
-
:mod:`signal` --- Set handlers for asynchronous events
======================================================
@@ -69,12 +68,32 @@ The variables defined in the :mod:`signal` module are:
All the signal numbers are defined symbolically. For example, the hangup signal
is defined as :const:`signal.SIGHUP`; the variable names are identical to the
names used in C programs, as found in ``<signal.h>``. The Unix man page for
- ':cfunc:`signal`' lists the existing signals (on some systems this is
+ ':c:func:`signal`' lists the existing signals (on some systems this is
:manpage:`signal(2)`, on others the list is in :manpage:`signal(7)`). Note that
not all systems define the same set of signal names; only those names defined by
the system are defined by this module.
+.. data:: CTRL_C_EVENT
+
+ The signal corresponding to the CTRL+C keystroke event. This signal can
+ only be used with :func:`os.kill`.
+
+ Availability: Windows.
+
+ .. versionadded:: 3.2
+
+
+.. data:: CTRL_BREAK_EVENT
+
+ The signal corresponding to the CTRL+BREAK keystroke event. This signal can
+ only be used with :func:`os.kill`.
+
+ Availability: Windows.
+
+ .. versionadded:: 3.2
+
+
.. data:: NSIG
One more than the number of the highest signal number.
@@ -82,7 +101,8 @@ The variables defined in the :mod:`signal` module are:
.. data:: ITIMER_REAL
- Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration.
+ Decrements interval timer in real time, and delivers :const:`SIGALRM` upon
+ expiration.
.. data:: ITIMER_VIRTUAL
@@ -190,7 +210,7 @@ The :mod:`signal` module defines the following functions:
Note that installing a signal handler with :func:`signal` will reset the
restart behaviour to interruptible by implicitly calling
- :cfunc:`siginterrupt` with a true *flag* value for the given signal.
+ :c:func:`siginterrupt` with a true *flag* value for the given signal.
.. function:: signal(signalnum, handler)
diff --git a/Doc/library/site.rst b/Doc/library/site.rst
index bf65d177ed..b77f3cf02d 100644
--- a/Doc/library/site.rst
+++ b/Doc/library/site.rst
@@ -1,10 +1,12 @@
-
:mod:`site` --- Site-specific configuration hook
================================================
.. module:: site
:synopsis: A standard way to reference site-specific modules.
+**Source code:** :source:`Lib/site.py`
+
+--------------
**This module is automatically imported during initialization.** The automatic
import can be suppressed using the interpreter's :option:`-S` option.
@@ -116,6 +118,32 @@ empty, and the path manipulations are skipped; however the import of
Adds a directory to sys.path and processes its pth files.
+.. function:: getsitepackages()
+
+ Returns a list containing all global site-packages directories
+ (and possibly site-python).
+
+ .. versionadded:: 3.2
+
+.. function:: getuserbase()
+
+ Returns the "user base" directory path.
+
+ The "user base" directory can be used to store data. If the global
+ variable ``USER_BASE`` is not initialized yet, this function will also set
+ it.
+
+ .. versionadded:: 3.2
+
+.. function:: getusersitepackages()
+
+ Returns the user-specific site-packages directory path.
+
+ If the global variable ``USER_SITE`` is not initialized yet, this
+ function will also set it.
+
+ .. versionadded:: 3.2
.. XXX Update documentation
.. XXX document python -m site --user-base --user-site
+
diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst
index 276751634d..c391f710df 100644
--- a/Doc/library/smtpd.rst
+++ b/Doc/library/smtpd.rst
@@ -7,13 +7,18 @@
.. moduleauthor:: Barry Warsaw <barry@zope.com>
.. sectionauthor:: Moshe Zadka <moshez@moshez.org>
+**Source code:** :source:`Lib/smtpd.py`
+--------------
+This module offers several classes to implement SMTP (email) servers.
-This module offers several classes to implement SMTP servers. One is a generic
+Several server implementations are present; one is a generic
do-nothing implementation, which can be overridden, while the other two offer
specific mail-sending strategies.
+Additionally the SMTPChannel may be extended to implement very specific
+interaction behaviour with SMTP clients.
SMTPServer Objects
------------------
@@ -26,7 +31,6 @@ SMTPServer Objects
inherits from :class:`asyncore.dispatcher`, and so will insert itself into
:mod:`asyncore`'s event loop on instantiation.
-
.. method:: process_message(peer, mailfrom, rcpttos, data)
Raise :exc:`NotImplementedError` exception. Override this in subclasses to
@@ -37,6 +41,11 @@ SMTPServer Objects
containing the contents of the e-mail (which should be in :rfc:`2822`
format).
+ .. attribute:: channel_class
+
+ Override this in subclasses to use a custom :class:`SMTPChannel` for
+ managing SMTP clients.
+
DebuggingServer Objects
-----------------------
@@ -71,3 +80,91 @@ MailmanProxy Objects
running this has a good chance to make you into an open relay, so please be
careful.
+SMTPChannel Objects
+-------------------
+
+.. class:: SMTPChannel(server, conn, addr)
+
+ Create a new :class:`SMTPChannel` object which manages the communication
+ between the server and a single SMTP client.
+
+ To use a custom SMTPChannel implementation you need to override the
+ :attr:`SMTPServer.channel_class` of your :class:`SMTPServer`.
+
+ The :class:`SMTPChannel` has the following instance variables:
+
+ .. attribute:: smtp_server
+
+ Holds the :class:`SMTPServer` that spawned this channel.
+
+ .. attribute:: conn
+
+ Holds the socket object connecting to the client.
+
+ .. attribute:: addr
+
+ Holds the address of the client, the second value returned by
+ socket.accept()
+
+ .. attribute:: received_lines
+
+ Holds a list of the line strings (decoded using UTF-8) received from
+ the client. The lines have their "\r\n" line ending translated to "\n".
+
+ .. attribute:: smtp_state
+
+ Holds the current state of the channel. This will be either
+ :attr:`COMMAND` initially and then :attr:`DATA` after the client sends
+ a "DATA" line.
+
+ .. attribute:: seen_greeting
+
+ Holds a string containing the greeting sent by the client in its "HELO".
+
+ .. attribute:: mailfrom
+
+ Holds a string containing the address identified in the "MAIL FROM:" line
+ from the client.
+
+ .. attribute:: rcpttos
+
+ Holds a list of strings containing the addresses identified in the
+ "RCPT TO:" lines from the client.
+
+ .. attribute:: received_data
+
+ Holds a string containing all of the data sent by the client during the
+ DATA state, up to but not including the terminating "\r\n.\r\n".
+
+ .. attribute:: fqdn
+
+ Holds the fully-qualified domain name of the server as returned by
+ ``socket.getfqdn()``.
+
+ .. attribute:: peer
+
+ Holds the name of the client peer as returned by ``conn.getpeername()``
+ where ``conn`` is :attr:`conn`.
+
+ The :class:`SMTPChannel` operates by invoking methods named ``smtp_<command>``
+ upon reception of a command line from the client. Built into the base
+ :class:`SMTPChannel` class are methods for handling the following commands
+ (and responding to them appropriately):
+
+ ======== ===================================================================
+ Command Action taken
+ ======== ===================================================================
+ HELO Accepts the greeting from the client and stores it in
+ :attr:`seen_greeting`.
+ NOOP Takes no action.
+ QUIT Closes the connection cleanly.
+ MAIL Accepts the "MAIL FROM:" syntax and stores the supplied address as
+ :attr:`mailfrom`.
+ RCPT Accepts the "RCPT TO:" syntax and stores the supplied addresses in
+ the :attr:`rcpttos` list.
+ RSET Resets the :attr:`mailfrom`, :attr:`rcpttos`, and
+ :attr:`received_data`, but not the greeting.
+ DATA Sets the internal state to :attr:`DATA` and stores remaining lines
+ from the client in :attr:`received_data` until the terminator
+ "\r\n.\r\n" is received.
+ ======== ===================================================================
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst
index 9303c3edb5..531a64d73f 100644
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -1,4 +1,3 @@
-
:mod:`smtplib` --- SMTP protocol client
=======================================
@@ -11,13 +10,17 @@
pair: SMTP; protocol
single: Simple Mail Transfer Protocol
+**Source code:** :source:`Lib/smtplib.py`
+
+--------------
+
The :mod:`smtplib` module defines an SMTP client session object that can be used
to send mail to any Internet machine with an SMTP or ESMTP listener daemon. For
details of SMTP and ESMTP operation, consult :rfc:`821` (Simple Mail Transfer
Protocol) and :rfc:`1869` (SMTP Service Extensions).
-.. class:: SMTP([host[, port[, local_hostname[, timeout]]]])
+.. class:: SMTP(host='', port=0, local_hostname=None[, timeout])
A :class:`SMTP` instance encapsulates an SMTP connection. It has methods
that support a full repertoire of SMTP and ESMTP operations. If the optional
@@ -32,13 +35,13 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
:meth:`sendmail`, and :meth:`quit` methods. An example is included below.
-.. class:: SMTP_SSL([host[, port[, local_hostname[, keyfile[, certfile[, timeout]]]]]])
+.. class:: SMTP_SSL(host='', port=0, local_hostname=None, keyfile=None, certfile=None[, timeout])
A :class:`SMTP_SSL` instance behaves exactly the same as instances of
:class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL is
required from the beginning of the connection and using :meth:`starttls` is
not appropriate. If *host* is not specified, the local host is used. If
- *port* is omitted, the standard SMTP-over-SSL port (465) is used. *keyfile*
+ *port* is zero, the standard SMTP-over-SSL port (465) is used. *keyfile*
and *certfile* are also optional, and can contain a PEM formatted private key
and certificate chain file for the SSL connection. The optional *timeout*
parameter specifies a timeout in seconds for blocking operations like the
@@ -46,7 +49,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
will be used).
-.. class:: LMTP([host[, port[, local_hostname]]])
+.. class:: LMTP(host='', port=LMTP_PORT, local_hostname=None)
The LMTP protocol, which is very similar to ESMTP, is heavily based on the
standard SMTP client. It's common to use Unix sockets for LMTP, so our :meth:`connect`
@@ -142,7 +145,7 @@ An :class:`SMTP` instance has the following methods:
for connection and for all messages sent to and received from the server.
-.. method:: SMTP.connect([host[, port]])
+.. method:: SMTP.connect(host='localhost', port=0)
Connect to a host on a given port. The defaults are to connect to the local
host at the standard SMTP port (25). If the hostname ends with a colon (``':'``)
@@ -151,9 +154,9 @@ An :class:`SMTP` instance has the following methods:
the constructor if a host is specified during instantiation.
-.. method:: SMTP.docmd(cmd, [, argstring])
+.. method:: SMTP.docmd(cmd, args='')
- Send a command *cmd* to the server. The optional argument *argstring* is simply
+ Send a command *cmd* to the server. The optional argument *args* is simply
concatenated to the command, separated by a space.
This returns a 2-tuple composed of a numeric response code and the actual
@@ -167,7 +170,7 @@ An :class:`SMTP` instance has the following methods:
:exc:`SMTPServerDisconnected` will be raised.
-.. method:: SMTP.helo([hostname])
+.. method:: SMTP.helo(name='')
Identify yourself to the SMTP server using ``HELO``. The hostname argument
defaults to the fully qualified domain name of the local host.
@@ -178,7 +181,7 @@ An :class:`SMTP` instance has the following methods:
It will be implicitly called by the :meth:`sendmail` when necessary.
-.. method:: SMTP.ehlo([hostname])
+.. method:: SMTP.ehlo(name='')
Identify yourself to an ESMTP server using ``EHLO``. The hostname argument
defaults to the fully qualified domain name of the local host. Examine the
@@ -239,7 +242,7 @@ An :class:`SMTP` instance has the following methods:
No suitable authentication method was found.
-.. method:: SMTP.starttls([keyfile[, certfile]])
+.. method:: SMTP.starttls(keyfile=None, certfile=None)
Put the SMTP connection in TLS (Transport Layer Security) mode. All SMTP
commands that follow will be encrypted. You should then call :meth:`ehlo`
@@ -261,7 +264,7 @@ An :class:`SMTP` instance has the following methods:
SSL/TLS support is not available to your Python interpreter.
-.. method:: SMTP.sendmail(from_addr, to_addrs, msg[, mail_options, rcpt_options])
+.. method:: SMTP.sendmail(from_addr, to_addrs, msg, mail_options=[], rcpt_options=[])
Send mail. The required arguments are an :rfc:`822` from-address string, a list
of :rfc:`822` to-address strings (a bare string will be treated as a list with 1
@@ -275,9 +278,14 @@ An :class:`SMTP` instance has the following methods:
.. note::
The *from_addr* and *to_addrs* parameters are used to construct the message
- envelope used by the transport agents. The :class:`SMTP` does not modify the
+ envelope used by the transport agents. ``sendmail`` does not modify the
message headers in any way.
+ msg may be a string containing characters in the ASCII range, or a byte
+ string. A string is encoded to bytes using the ascii codec, and lone ``\r``
+ and ``\n`` characters are converted to ``\r\n`` characters. A byte string
+ is not modified.
+
If there has been no previous ``EHLO`` or ``HELO`` command this session, this
method tries ESMTP ``EHLO`` first. If the server does ESMTP, message size and
each of the specified options will be passed to it (if the option is in the
@@ -312,6 +320,27 @@ An :class:`SMTP` instance has the following methods:
Unless otherwise noted, the connection will be open even after an exception is
raised.
+ .. versionchanged:: 3.2 *msg* may be a byte string.
+
+
+.. method:: SMTP.send_message(msg, from_addr=None, to_addrs=None, mail_options=[], rcpt_options=[])
+
+ This is a convenience method for calling :meth:`sendmail` with the message
+ represented by an :class:`email.message.Message` object. The arguments have
+ the same meaning as for :meth:`sendmail`, except that *msg* is a ``Message``
+ object.
+
+ If *from_addr* is ``None``, ``send_message`` sets its value to the value of
+ the :mailheader:`From` header from *msg*. If *to_addrs* is ``None``,
+ ``send_message`` combines the values (if any) of the :mailheader:`To`,
+ :mailheader:`CC`, and :mailheader:`Bcc` fields from *msg*. Regardless of
+ the values of *from_addr* and *to_addrs*, ``send_message`` deletes any Bcc
+ field from *msg*. It then serializes *msg* using
+ :class:`~email.generator.BytesGenerator` with ``\r\n`` as the *linesep*, and
+ calls :meth:`sendmail` to transmit the resulting message.
+
+ .. versionadded:: 3.2
+
.. method:: SMTP.quit()
@@ -367,5 +396,5 @@ example doesn't do any processing of the :rfc:`822` headers. In particular, the
.. note::
In general, you will want to use the :mod:`email` package's features to
- construct an email message, which you can then convert to a string and send
- via :meth:`sendmail`; see :ref:`email-examples`.
+ construct an email message, which you can then send
+ via :meth:`~smtplib.SMTP.send_message`; see :ref:`email-examples`.
diff --git a/Doc/library/sndhdr.rst b/Doc/library/sndhdr.rst
index 01a3917a32..f36df68703 100644
--- a/Doc/library/sndhdr.rst
+++ b/Doc/library/sndhdr.rst
@@ -1,4 +1,3 @@
-
:mod:`sndhdr` --- Determine type of sound file
==============================================
@@ -11,6 +10,10 @@
single: A-LAW
single: u-LAW
+**Source code:** :source:`Lib/sndhdr.py`
+
+--------------
+
The :mod:`sndhdr` provides utility functions which attempt to determine the type
of sound data which is in a file. When these functions are able to determine
what type of sound data is stored in a file, they return a tuple ``(type,
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index d61398c9f7..bfb8ae9414 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -1,4 +1,3 @@
-
:mod:`socket` --- Low-level networking interface
================================================
@@ -118,39 +117,44 @@ The module :mod:`socket` exports the following constants and functions:
.. index:: module: errno
- This exception is raised for socket-related errors. The accompanying value is
- either a string telling what went wrong or a pair ``(errno, string)``
- representing an error returned by a system call, similar to the value
- accompanying :exc:`os.error`. See the module :mod:`errno`, which contains names
- for the error codes defined by the underlying operating system.
+ A subclass of :exc:`IOError`, this exception is raised for socket-related
+ errors. It is recommended that you inspect its ``errno`` attribute to
+ discriminate between different kinds of errors.
+ .. seealso::
+ The :mod:`errno` module contains symbolic names for the error codes
+ defined by the underlying operating system.
-.. exception:: herror
- This exception is raised for address-related errors, i.e. for functions that use
- *h_errno* in the C API, including :func:`gethostbyname_ex` and
- :func:`gethostbyaddr`.
+.. exception:: herror
- The accompanying value is a pair ``(h_errno, string)`` representing an error
- returned by a library call. *string* represents the description of *h_errno*, as
- returned by the :cfunc:`hstrerror` C function.
+ A subclass of :exc:`socket.error`, this exception is raised for
+ address-related errors, i.e. for functions that use *h_errno* in the POSIX
+ C API, including :func:`gethostbyname_ex` and :func:`gethostbyaddr`.
+ The accompanying value is a pair ``(h_errno, string)`` representing an
+ error returned by a library call. *h_errno* is a numeric value, while
+ *string* represents the description of *h_errno*, as returned by the
+ :c:func:`hstrerror` C function.
.. exception:: gaierror
- This exception is raised for address-related errors, for :func:`getaddrinfo` and
- :func:`getnameinfo`. The accompanying value is a pair ``(error, string)``
- representing an error returned by a library call. *string* represents the
- description of *error*, as returned by the :cfunc:`gai_strerror` C function. The
- *error* value will match one of the :const:`EAI_\*` constants defined in this
- module.
+ A subclass of :exc:`socket.error`, this exception is raised for
+ address-related errors by :func:`getaddrinfo` and :func:`getnameinfo`.
+ The accompanying value is a pair ``(error, string)`` representing an error
+ returned by a library call. *string* represents the description of
+ *error*, as returned by the :c:func:`gai_strerror` C function. The
+ numeric *error* value will match one of the :const:`EAI_\*` constants
+ defined in this module.
.. exception:: timeout
- This exception is raised when a timeout occurs on a socket which has had
- timeouts enabled via a prior call to :meth:`~socket.settimeout`. The
- accompanying value is a string whose value is currently always "timed out".
+ A subclass of :exc:`socket.error`, this exception is raised when a timeout
+ occurs on a socket which has had timeouts enabled via a prior call to
+ :meth:`~socket.settimeout` (or implicitly through
+ :func:`~socket.setdefaulttimeout`). The accompanying value is a string
+ whose value is currently always "timed out".
.. data:: AF_UNIX
@@ -174,6 +178,21 @@ The module :mod:`socket` exports the following constants and functions:
(Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be generally
useful.)
+.. data:: SOCK_CLOEXEC
+ SOCK_NONBLOCK
+
+ These two constants, if defined, can be combined with the socket types and
+ allow you to set some flags atomically (thus avoiding possible race
+ conditions and the need for separate calls).
+
+ .. seealso::
+
+ `Secure File Descriptor Handling <http://udrepper.livejournal.com/20407.html>`_
+ for a more thorough explanation.
+
+ Availability: Linux >= 2.6.27.
+
+ .. versionadded:: 3.2
.. data:: SO_*
SOMAXCONN
@@ -215,7 +234,7 @@ The module :mod:`socket` exports the following constants and functions:
this platform.
-.. function:: create_connection(address[, timeout])
+.. function:: create_connection(address[, timeout[, source_address]])
Convenience function. Connect to *address* (a 2-tuple ``(host, port)``),
and return the socket object. Passing the optional *timeout* parameter will
@@ -223,8 +242,18 @@ The module :mod:`socket` exports the following constants and functions:
*timeout* is supplied, the global default timeout setting returned by
:func:`getdefaulttimeout` is used.
+ If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the
+ socket to bind to as its source address before connecting. If host or port
+ are '' or 0 respectively the OS default behavior will be used.
+
+ .. versionchanged:: 3.2
+ *source_address* was added.
-.. function:: getaddrinfo(host, port, family=0, socktype=0, proto=0, flags=0)
+ .. versionchanged:: 3.2
+ support for the :keyword:`with` statement was added.
+
+
+.. function:: getaddrinfo(host, port, family=0, type=0, proto=0, flags=0)
Translate the *host*/*port* argument into a sequence of 5-tuples that contain
all the necessary arguments for creating a socket connected to that service.
@@ -233,7 +262,7 @@ The module :mod:`socket` exports the following constants and functions:
port number or ``None``. By passing ``None`` as the value of *host*
and *port*, you can pass ``NULL`` to the underlying C API.
- The *family*, *socktype* and *proto* arguments can be optionally specified
+ The *family*, *type* and *proto* arguments can be optionally specified
in order to narrow the list of addresses returned. Passing zero as a
value for each of these arguments selects the full range of results.
The *flags* argument can be one or several of the ``AI_*`` constants,
@@ -243,9 +272,9 @@ The module :mod:`socket` exports the following constants and functions:
The function returns a list of 5-tuples with the following structure:
- ``(family, socktype, proto, canonname, sockaddr)``
+ ``(family, type, proto, canonname, sockaddr)``
- In these tuples, *family*, *socktype*, *proto* are all integers and are
+ In these tuples, *family*, *type*, *proto* are all integers and are
meant to be passed to the :func:`socket` function. *canonname* will be
a string representing the canonical name of the *host* if
:const:`AI_CANONNAME` is part of the *flags* argument; else *canonname*
@@ -259,10 +288,13 @@ The module :mod:`socket` exports the following constants and functions:
connection to ``www.python.org`` on port 80 (results may differ on your
system if IPv6 isn't enabled)::
- >>> socket.getaddrinfo("www.python.org", 80, 0, 0, socket.SOL_TCP)
+ >>> socket.getaddrinfo("www.python.org", 80, proto=socket.SOL_TCP)
[(2, 1, 6, '', ('82.94.164.162', 80)),
(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]
+ .. versionchanged:: 3.2
+ parameters can now be passed as single keyword arguments.
+
.. function:: getfqdn([name])
Return a fully qualified domain name for *name*. If *name* is omitted or empty,
@@ -368,6 +400,10 @@ The module :mod:`socket` exports the following constants and functions:
if defined on the platform; otherwise, the default is :const:`AF_INET`.
Availability: Unix.
+ .. versionchanged:: 3.2
+ The returned socket objects now support the whole socket API, rather
+ than a subset.
+
.. function:: fromfd(fd, family, type[, proto])
@@ -379,7 +415,6 @@ The module :mod:`socket` exports the following constants and functions:
This function is rarely needed, but can be used to get or set socket options on
a socket passed to a program as standard input or output (such as a server
started by the Unix inet daemon). The socket is assumed to be in blocking mode.
- Availability: Unix.
.. function:: ntohl(x)
@@ -415,7 +450,7 @@ The module :mod:`socket` exports the following constants and functions:
Convert an IPv4 address from dotted-quad string format (for example,
'123.45.67.89') to 32-bit packed binary format, as a bytes object four characters in
length. This is useful when conversing with a program that uses the standard C
- library and needs objects of type :ctype:`struct in_addr`, which is the C type
+ library and needs objects of type :c:type:`struct in_addr`, which is the C type
for the 32-bit packed binary this function returns.
:func:`inet_aton` also accepts strings with less than three dots; see the
@@ -423,7 +458,7 @@ The module :mod:`socket` exports the following constants and functions:
If the IPv4 address string passed to this function is invalid,
:exc:`socket.error` will be raised. Note that exactly what is valid depends on
- the underlying C implementation of :cfunc:`inet_aton`.
+ the underlying C implementation of :c:func:`inet_aton`.
:func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be used
instead for IPv4/v6 dual stack support.
@@ -434,7 +469,7 @@ The module :mod:`socket` exports the following constants and functions:
Convert a 32-bit packed IPv4 address (a bytes object four characters in
length) to its standard dotted-quad string representation (for example,
'123.45.67.89'). This is useful when conversing with a program that uses the
- standard C library and needs objects of type :ctype:`struct in_addr`, which
+ standard C library and needs objects of type :c:type:`struct in_addr`, which
is the C type for the 32-bit packed binary data this function takes as an
argument.
@@ -448,14 +483,14 @@ The module :mod:`socket` exports the following constants and functions:
Convert an IP address from its family-specific string format to a packed,
binary format. :func:`inet_pton` is useful when a library or network protocol
- calls for an object of type :ctype:`struct in_addr` (similar to
- :func:`inet_aton`) or :ctype:`struct in6_addr`.
+ calls for an object of type :c:type:`struct in_addr` (similar to
+ :func:`inet_aton`) or :c:type:`struct in6_addr`.
Supported values for *address_family* are currently :const:`AF_INET` and
:const:`AF_INET6`. If the IP address string *ip_string* is invalid,
:exc:`socket.error` will be raised. Note that exactly what is valid depends on
both the value of *address_family* and the underlying implementation of
- :cfunc:`inet_pton`.
+ :c:func:`inet_pton`.
Availability: Unix (maybe not all platforms).
@@ -465,8 +500,8 @@ The module :mod:`socket` exports the following constants and functions:
Convert a packed IP address (a bytes object of some number of characters) to its
standard, family-specific string representation (for example, ``'7.10.0.5'`` or
``'5aef:2b::8'``). :func:`inet_ntop` is useful when a library or network protocol
- returns an object of type :ctype:`struct in_addr` (similar to :func:`inet_ntoa`)
- or :ctype:`struct in6_addr`.
+ returns an object of type :c:type:`struct in_addr` (similar to :func:`inet_ntoa`)
+ or :c:type:`struct in6_addr`.
Supported values for *address_family* are currently :const:`AF_INET` and
:const:`AF_INET6`. If the string *packed_ip* is not the correct length for the
@@ -542,13 +577,22 @@ correspond to Unix system calls applicable to sockets.
.. method:: socket.connect_ex(address)
Like ``connect(address)``, but return an error indicator instead of raising an
- exception for errors returned by the C-level :cfunc:`connect` call (other
+ exception for errors returned by the C-level :c:func:`connect` call (other
problems, such as "host not found," can still raise exceptions). The error
indicator is ``0`` if the operation succeeded, otherwise the value of the
- :cdata:`errno` variable. This is useful to support, for example, asynchronous
+ :c:data:`errno` variable. This is useful to support, for example, asynchronous
connects.
+.. method:: socket.detach()
+
+ Put the socket object into closed state without actually closing the
+ underlying file descriptor. The file descriptor is returned, and can
+ be reused for other purposes.
+
+ .. versionadded:: 3.2
+
+
.. method:: socket.fileno()
Return the socket's file descriptor (a small integer). This is useful with
@@ -612,7 +656,8 @@ correspond to Unix system calls applicable to sockets.
is system-dependent (usually 5).
-.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, errors=None, newline=None)
+.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, \
+ errors=None, newline=None)
.. index:: single: I/O control; buffering
@@ -668,9 +713,9 @@ correspond to Unix system calls applicable to sockets.
Receive up to *nbytes* bytes from the socket, storing the data into a buffer
rather than creating a new bytestring. If *nbytes* is not specified (or 0),
- receive up to the size available in the given buffer. See the Unix manual page
- :manpage:`recv(2)` for the meaning of the optional argument *flags*; it defaults
- to zero.
+ receive up to the size available in the given buffer. Returns the number of
+ bytes received. See the Unix manual page :manpage:`recv(2)` for the meaning
+ of the optional argument *flags*; it defaults to zero.
.. method:: socket.send(bytes[, flags])
@@ -807,6 +852,21 @@ before calling :meth:`~socket.connect` or pass a timeout parameter to
return a connection timeout error of its own regardless of any Python socket
timeout setting.
+Timeouts and the ``accept`` method
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by
+the :meth:`~socket.accept` method inherit that timeout. Otherwise, the
+behaviour depends on settings of the listening socket:
+
+* if the listening socket is in *blocking mode* or in *timeout mode*,
+ the socket returned by :meth:`~socket.accept` is in *blocking mode*;
+
+* if the listening socket is in *non-blocking mode*, whether the socket
+ returned by :meth:`~socket.accept` is in blocking or non-blocking mode
+ is operating system-dependent. If you want to ensure cross-platform
+ behaviour, it is recommended you manually override this setting.
+
.. _socket-example:
diff --git a/Doc/library/socketserver.rst b/Doc/library/socketserver.rst
index 82d1107b12..ed547f5ea2 100644
--- a/Doc/library/socketserver.rst
+++ b/Doc/library/socketserver.rst
@@ -1,10 +1,13 @@
-
:mod:`socketserver` --- A framework for network servers
=======================================================
.. module:: socketserver
:synopsis: A framework for network servers.
+**Source code:** :source:`Lib/socketserver.py`
+
+--------------
+
The :mod:`socketserver` module simplifies the task of writing network servers.
There are four basic server classes: :class:`TCPServer` uses the Internet TCP
diff --git a/Doc/library/someos.rst b/Doc/library/someos.rst
index cf3eb6b6bf..d2009bbc18 100644
--- a/Doc/library/someos.rst
+++ b/Doc/library/someos.rst
@@ -15,6 +15,7 @@ some other systems as well (e.g. Windows). Here's an overview:
select.rst
threading.rst
multiprocessing.rst
+ concurrent.futures.rst
mmap.rst
readline.rst
rlcompleter.rst
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 0603738c67..7367674430 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -90,7 +90,7 @@ This example uses the iterator form::
.. seealso::
- http://www.pysqlite.org
+ http://code.google.com/p/pysqlite/
The pysqlite web page -- sqlite3 is developed externally under the name
"pysqlite".
@@ -227,6 +227,12 @@ Connection Objects
one of "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". See section
:ref:`sqlite3-controlling-transactions` for a more detailed explanation.
+.. attribute:: Connection.in_transaction
+
+ :const:`True` if a transaction is active (there are uncommitted changes),
+ :const:`False` otherwise. Read-only attribute.
+
+ .. versionadded:: 3.2
.. method:: Connection.cursor([cursorClass])
@@ -363,6 +369,29 @@ Connection Objects
method with :const:`None` for *handler*.
+.. method:: Connection.enable_load_extension(enabled)
+
+ This routine allows/disallows the SQLite engine to load SQLite extensions
+ from shared libraries. SQLite extensions can define new functions,
+ aggregates or whole new virtual table implementations. One well-known
+ extension is the fulltext-search extension distributed with SQLite.
+
+ .. versionadded:: 3.2
+
+ .. literalinclude:: ../includes/sqlite3/load_extension.py
+
+ Loadable extensions are disabled by default. See [#f1]_.
+
+.. method:: Connection.load_extension(path)
+
+ This routine loads a SQLite extension from a shared library. You have to
+ enable extension loading with :meth:`enable_load_extension` before you can
+ use this routine.
+
+ .. versionadded:: 3.2
+
+ Loadable extensions are disabled by default. See [#f1]_.
+
.. attribute:: Connection.row_factory
You can change this attribute to a callable that accepts the cursor and the
@@ -785,7 +814,8 @@ So if you are within a transaction and issue a command like ``CREATE TABLE
before executing that command. There are two reasons for doing that. The first
is that some of these commands don't work within transactions. The other reason
is that sqlite3 needs to keep track of the transaction state (if a transaction
-is active or not).
+is active or not). The current transaction state is exposed through the
+:attr:`Connection.in_transaction` attribute of the connection object.
You can control which kind of ``BEGIN`` statements sqlite3 implicitly executes
(or none at all) via the *isolation_level* parameter to the :func:`connect`
@@ -852,3 +882,10 @@ threads. If you still try to do so, you will get an exception at runtime.
The only exception is calling the :meth:`~Connection.interrupt` method, which
only makes sense to call from a different thread.
+
+.. rubric:: Footnotes
+
+.. [#f1] The sqlite3 module is not built with loadable extension support by
+ default, because some platforms (notably Mac OS X) have SQLite libraries which
+ are compiled without this feature. To get loadable extension support, you must
+ pass --enable-loadable-sqlite-extensions to configure.
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index ff7a016a3c..011d37806f 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -12,6 +12,10 @@
.. index:: TLS, SSL, Transport Layer Security, Secure Sockets Layer
+**Source code:** :source:`Lib/ssl.py`
+
+--------------
+
This module provides access to Transport Layer Security (often known as "Secure
Sockets Layer") encryption and peer authentication facilities for network
sockets, both client-side and server-side. This module uses the OpenSSL
@@ -31,23 +35,43 @@ the documents in the "See Also" section at the bottom.
This module provides a class, :class:`ssl.SSLSocket`, which is derived from the
:class:`socket.socket` type, and provides a socket-like wrapper that also
encrypts and decrypts the data going over the socket with SSL. It supports
-additional :meth:`read` and :meth:`write` methods, along with a method,
-:meth:`getpeercert`, to retrieve the certificate of the other side of the
-connection, and a method, :meth:`cipher`, to retrieve the cipher being used for
-the secure connection.
+additional methods such as :meth:`getpeercert`, which retrieves the
+certificate of the other side of the connection, and :meth:`cipher`,which
+retrieves the cipher being used for the secure connection.
+
+For more sophisticated applications, the :class:`ssl.SSLContext` class
+helps manage settings and certificates, which can then be inherited
+by SSL sockets created through the :meth:`SSLContext.wrap_socket` method.
+
Functions, Constants, and Exceptions
------------------------------------
.. exception:: SSLError
- Raised to signal an error from the underlying SSL implementation. This
- signifies some problem in the higher-level encryption and authentication
- layer that's superimposed on the underlying network connection. This error
+ Raised to signal an error from the underlying SSL implementation
+ (currently provided by the OpenSSL library). This signifies some
+ problem in the higher-level encryption and authentication layer that's
+ superimposed on the underlying network connection. This error
is a subtype of :exc:`socket.error`, which in turn is a subtype of
- :exc:`IOError`.
+ :exc:`IOError`. The error code and message of :exc:`SSLError` instances
+ are provided by the OpenSSL library.
+
+.. exception:: CertificateError
+
+ Raised to signal an error with a certificate (such as mismatching
+ hostname). Certificate errors detected by OpenSSL, though, raise
+ an :exc:`SSLError`.
+
+
+Socket creation
+^^^^^^^^^^^^^^^
-.. function:: wrap_socket(sock, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True)
+The following function allows for standalone socket creation. Starting from
+Python 3.2, it can be more flexible to use :meth:`SSLContext.wrap_socket`
+instead.
+
+.. function:: wrap_socket(sock, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True, ciphers=None)
Takes an instance ``sock`` of :class:`socket.socket`, and returns an instance
of :class:`ssl.SSLSocket`, a subtype of :class:`socket.socket`, which wraps
@@ -64,19 +88,6 @@ Functions, Constants, and Exceptions
connection. See the discussion of :ref:`ssl-certificates` for more
information on how the certificate is stored in the ``certfile``.
- Often the private key is stored in the same file as the certificate; in this
- case, only the ``certfile`` parameter need be passed. If the private key is
- stored in a separate file, both parameters must be used. If the private key
- is stored in the ``certfile``, it should come before the first certificate in
- the certificate chain::
-
- -----BEGIN RSA PRIVATE KEY-----
- ... (private key in base64 encoding) ...
- -----END RSA PRIVATE KEY-----
- -----BEGIN CERTIFICATE-----
- ... (certificate in base64 PEM encoding) ...
- -----END CERTIFICATE-----
-
The parameter ``server_side`` is a boolean which identifies whether
server-side or client-side behavior is desired from this socket.
@@ -110,14 +121,26 @@ Functions, Constants, and Exceptions
======================== ========= ========= ========== =========
*client* / **server** **SSLv2** **SSLv3** **SSLv23** **TLSv1**
------------------------ --------- --------- ---------- ---------
- *SSLv2* yes no yes* no
+ *SSLv2* yes no yes no
*SSLv3* yes yes yes no
*SSLv23* yes no yes no
*TLSv1* no no yes yes
======================== ========= ========= ========== =========
- In some older versions of OpenSSL (for instance, 0.9.7l on OS X 10.4), an
- SSLv2 client could not connect to an SSLv23 server.
+ .. note::
+
+ Which connections succeed will vary depending on the version of
+ OpenSSL. For instance, in some older versions of OpenSSL (such
+ as 0.9.7l on OS X 10.4), an SSLv2 client could not connect to an
+ SSLv23 server. Another example: beginning with OpenSSL 1.0.0,
+ an SSLv23 client will not actually attempt SSLv2 connections
+ unless you explicitly enable SSLv2 ciphers; for example, you
+ might specify ``"ALL"`` or ``"SSLv2"`` as the *ciphers* parameter
+ to enable them.
+
+ The *ciphers* parameter sets the available ciphers for this SSL object.
+ It should be a string in the `OpenSSL cipher list format
+ <http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`_.
The parameter ``do_handshake_on_connect`` specifies whether to do the SSL
handshake automatically after doing a :meth:`socket.connect`, or whether the
@@ -127,10 +150,17 @@ Functions, Constants, and Exceptions
blocking behavior of the socket I/O involved in the handshake.
The parameter ``suppress_ragged_eofs`` specifies how the
- :meth:`SSLSocket.read` method should signal unexpected EOF from the other end
+ :meth:`SSLSocket.recv` method should signal unexpected EOF from the other end
of the connection. If specified as :const:`True` (the default), it returns a
- normal EOF in response to unexpected EOF errors raised from the underlying
- socket; if :const:`False`, it will raise the exceptions back to the caller.
+ normal EOF (an empty bytes object) in response to unexpected EOF errors
+ raised from the underlying socket; if :const:`False`, it will raise the
+ exceptions back to the caller.
+
+ .. versionchanged:: 3.2
+ New optional argument *ciphers*.
+
+Random generation
+^^^^^^^^^^^^^^^^^
.. function:: RAND_status()
@@ -157,6 +187,32 @@ Functions, Constants, and Exceptions
string (so you can always use :const:`0.0`). See :rfc:`1750` for more
information on sources of entropy.
+Certificate handling
+^^^^^^^^^^^^^^^^^^^^
+
+.. function:: match_hostname(cert, hostname)
+
+ Verify that *cert* (in decoded format as returned by
+ :meth:`SSLSocket.getpeercert`) matches the given *hostname*. The rules
+ applied are those for checking the identity of HTTPS servers as outlined
+ in :rfc:`2818`, except that IP addresses are not currently supported.
+ In addition to HTTPS, this function should be suitable for checking the
+ identity of servers in various SSL-based protocols such as FTPS, IMAPS,
+ POPS and others.
+
+ :exc:`CertificateError` is raised on failure. On success, the function
+ returns nothing::
+
+ >>> cert = {'subject': ((('commonName', 'example.com'),),)}
+ >>> ssl.match_hostname(cert, "example.com")
+ >>> ssl.match_hostname(cert, "example.org")
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ File "/home/py3k/Lib/ssl.py", line 130, in match_hostname
+ ssl.CertificateError: hostname 'example.org' doesn't match 'example.com'
+
+ .. versionadded:: 3.2
+
.. function:: cert_time_to_seconds(timestring)
Returns a floating-point value containing a normal seconds-after-the-epoch
@@ -171,7 +227,6 @@ Functions, Constants, and Exceptions
>>> import time
>>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT"))
'Wed May 9 00:00:00 2007'
- >>>
.. function:: get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None)
@@ -194,26 +249,41 @@ Functions, Constants, and Exceptions
Given a certificate as an ASCII PEM string, returns a DER-encoded sequence of
bytes for that same certificate.
+Constants
+^^^^^^^^^
+
.. data:: CERT_NONE
- Value to pass to the ``cert_reqs`` parameter to :func:`sslobject` when no
- certificates will be required or validated from the other side of the socket
- connection.
+ Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs``
+ parameter to :func:`wrap_socket`. In this mode (the default), no
+ certificates will be required from the other side of the socket connection.
+ If a certificate is received from the other end, no attempt to validate it
+ is made.
+
+ See the discussion of :ref:`ssl-security` below.
.. data:: CERT_OPTIONAL
- Value to pass to the ``cert_reqs`` parameter to :func:`sslobject` when no
- certificates will be required from the other side of the socket connection,
- but if they are provided, will be validated. Note that use of this setting
- requires a valid certificate validation file also be passed as a value of the
- ``ca_certs`` parameter.
+ Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs``
+ parameter to :func:`wrap_socket`. In this mode no certificates will be
+ required from the other side of the socket connection; but if they
+ are provided, validation will be attempted and an :class:`SSLError`
+ will be raised on failure.
+
+ Use of this setting requires a valid set of CA certificates to
+ be passed, either to :meth:`SSLContext.load_verify_locations` or as a
+ value of the ``ca_certs`` parameter to :func:`wrap_socket`.
.. data:: CERT_REQUIRED
- Value to pass to the ``cert_reqs`` parameter to :func:`sslobject` when
- certificates will be required from the other side of the socket connection.
- Note that use of this setting requires a valid certificate validation file
- also be passed as a value of the ``ca_certs`` parameter.
+ Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs``
+ parameter to :func:`wrap_socket`. In this mode, certificates are
+ required from the other side of the socket connection; an :class:`SSLError`
+ will be raised if no certificate is provided, or if its validation fails.
+
+ Use of this setting requires a valid set of CA certificates to
+ be passed, either to :meth:`SSLContext.load_verify_locations` or as a
+ value of the ``ca_certs`` parameter to :func:`wrap_socket`.
.. data:: PROTOCOL_SSLv2
@@ -241,22 +311,101 @@ Functions, Constants, and Exceptions
modern version, and probably the best choice for maximum protection, if both
sides can speak it.
+.. data:: OP_ALL
+
+ Enables workarounds for various bugs present in other SSL implementations.
+ This option is set by default.
-SSLSocket Objects
------------------
+ .. versionadded:: 3.2
-.. method:: SSLSocket.read(nbytes=1024, buffer=None)
+.. data:: OP_NO_SSLv2
- Reads up to ``nbytes`` bytes from the SSL-encrypted channel and returns them.
- If the ``buffer`` is specified, it will attempt to read into the buffer the
- minimum of the size of the buffer and ``nbytes``, if that is specified. If
- no buffer is specified, an immutable buffer is allocated and returned with
- the data read from the socket.
+ Prevents an SSLv2 connection. This option is only applicable in
+ conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from
+ choosing SSLv2 as the protocol version.
-.. method:: SSLSocket.write(data)
+ .. versionadded:: 3.2
- Writes the ``data`` to the other side of the connection, using the SSL
- channel to encrypt. Returns the number of bytes written.
+.. data:: OP_NO_SSLv3
+
+ Prevents an SSLv3 connection. This option is only applicable in
+ conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from
+ choosing SSLv3 as the protocol version.
+
+ .. versionadded:: 3.2
+
+.. data:: OP_NO_TLSv1
+
+ Prevents a TLSv1 connection. This option is only applicable in
+ conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from
+ choosing TLSv1 as the protocol version.
+
+ .. versionadded:: 3.2
+
+.. data:: HAS_SNI
+
+ Whether the OpenSSL library has built-in support for the *Server Name
+ Indication* extension to the SSLv3 and TLSv1 protocols (as defined in
+ :rfc:`4366`). When true, you can use the *server_hostname* argument to
+ :meth:`SSLContext.wrap_socket`.
+
+ .. versionadded:: 3.2
+
+.. data:: OPENSSL_VERSION
+
+ The version string of the OpenSSL library loaded by the interpreter::
+
+ >>> ssl.OPENSSL_VERSION
+ 'OpenSSL 0.9.8k 25 Mar 2009'
+
+ .. versionadded:: 3.2
+
+.. data:: OPENSSL_VERSION_INFO
+
+ A tuple of five integers representing version information about the
+ OpenSSL library::
+
+ >>> ssl.OPENSSL_VERSION_INFO
+ (0, 9, 8, 11, 15)
+
+ .. versionadded:: 3.2
+
+.. data:: OPENSSL_VERSION_NUMBER
+
+ The raw version number of the OpenSSL library, as a single integer::
+
+ >>> ssl.OPENSSL_VERSION_NUMBER
+ 9470143
+ >>> hex(ssl.OPENSSL_VERSION_NUMBER)
+ '0x9080bf'
+
+ .. versionadded:: 3.2
+
+
+SSL Sockets
+-----------
+
+SSL sockets provide the following methods of :ref:`socket-objects`:
+
+- :meth:`~socket.socket.accept()`
+- :meth:`~socket.socket.bind()`
+- :meth:`~socket.socket.close()`
+- :meth:`~socket.socket.connect()`
+- :meth:`~socket.socket.detach()`
+- :meth:`~socket.socket.fileno()`
+- :meth:`~socket.socket.getpeername()`, :meth:`~socket.socket.getsockname()`
+- :meth:`~socket.socket.getsockopt()`, :meth:`~socket.socket.setsockopt()`
+- :meth:`~socket.socket.gettimeout()`, :meth:`~socket.socket.settimeout()`,
+ :meth:`~socket.socket.setblocking()`
+- :meth:`~socket.socket.listen()`
+- :meth:`~socket.socket.makefile()`
+- :meth:`~socket.socket.recv()`, :meth:`~socket.socket.recv_into()`
+ (but passing a non-zero ``flags`` argument is not allowed)
+- :meth:`~socket.socket.send()`, :meth:`~socket.socket.sendall()` (with
+ the same limitation)
+- :meth:`~socket.socket.shutdown()`
+
+They also have the following additional methods and attributes:
.. method:: SSLSocket.do_handshake()
@@ -288,11 +437,9 @@ SSLSocket Objects
certificate was not validated, the dict is empty. If the certificate was
validated, it returns a dict with the keys ``subject`` (the principal for
which the certificate was issued), and ``notAfter`` (the time after which the
- certificate should not be trusted). The certificate was already validated,
- so the ``notBefore`` and ``issuer`` fields are not returned. If a
- certificate contains an instance of the *Subject Alternative Name* extension
- (see :rfc:`3280`), there will also be a ``subjectAltName`` key in the
- dictionary.
+ certificate should not be trusted). If a certificate contains an instance
+ of the *Subject Alternative Name* extension (see :rfc:`3280`), there will
+ also be a ``subjectAltName`` key in the dictionary.
The "subject" field is a tuple containing the sequence of relative
distinguished names (RDNs) given in the certificate's data structure for the
@@ -314,6 +461,10 @@ SSLSocket Objects
been validated, but if :const:`CERT_NONE` was used to establish the
connection, the certificate, if present, will not have been validated.
+ .. versionchanged:: 3.2
+ The returned dictionary includes additional items such as ``issuer``
+ and ``notBefore``.
+
.. method:: SSLSocket.cipher()
Returns a three-value tuple containing the name of the cipher being used, the
@@ -329,6 +480,142 @@ SSLSocket Objects
returned socket should always be used for further communication with the
other side of the connection, rather than the original socket.
+
+.. attribute:: SSLSocket.context
+
+ The :class:`SSLContext` object this SSL socket is tied to. If the SSL
+ socket was created using the top-level :func:`wrap_socket` function
+ (rather than :meth:`SSLContext.wrap_socket`), this is a custom context
+ object created for this SSL socket.
+
+ .. versionadded:: 3.2
+
+
+SSL Contexts
+------------
+
+.. versionadded:: 3.2
+
+An SSL context holds various data longer-lived than single SSL connections,
+such as SSL configuration options, certificate(s) and private key(s).
+It also manages a cache of SSL sessions for server-side sockets, in order
+to speed up repeated connections from the same clients.
+
+.. class:: SSLContext(protocol)
+
+ Create a new SSL context. You must pass *protocol* which must be one
+ of the ``PROTOCOL_*`` constants defined in this module.
+ :data:`PROTOCOL_SSLv23` is recommended for maximum interoperability.
+
+
+:class:`SSLContext` objects have the following methods and attributes:
+
+.. method:: SSLContext.load_cert_chain(certfile, keyfile=None)
+
+ Load a private key and the corresponding certificate. The *certfile*
+ string must be the path to a single file in PEM format containing the
+ certificate as well as any number of CA certificates needed to establish
+ the certificate's authenticity. The *keyfile* string, if present, must
+ point to a file containing the private key in. Otherwise the private
+ key will be taken from *certfile* as well. See the discussion of
+ :ref:`ssl-certificates` for more information on how the certificate
+ is stored in the *certfile*.
+
+ An :class:`SSLError` is raised if the private key doesn't
+ match with the certificate.
+
+.. method:: SSLContext.load_verify_locations(cafile=None, capath=None)
+
+ Load a set of "certification authority" (CA) certificates used to validate
+ other peers' certificates when :data:`verify_mode` is other than
+ :data:`CERT_NONE`. At least one of *cafile* or *capath* must be specified.
+
+ The *cafile* string, if present, is the path to a file of concatenated
+ CA certificates in PEM format. See the discussion of
+ :ref:`ssl-certificates` for more information about how to arrange the
+ certificates in this file.
+
+ The *capath* string, if present, is
+ the path to a directory containing several CA certificates in PEM format,
+ following an `OpenSSL specific layout
+ <http://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html>`_.
+
+.. method:: SSLContext.set_default_verify_paths()
+
+ Load a set of default "certification authority" (CA) certificates from
+ a filesystem path defined when building the OpenSSL library. Unfortunately,
+ there's no easy way to know whether this method succeeds: no error is
+ returned if no certificates are to be found. When the OpenSSL library is
+ provided as part of the operating system, though, it is likely to be
+ configured properly.
+
+.. method:: SSLContext.set_ciphers(ciphers)
+
+ Set the available ciphers for sockets created with this context.
+ It should be a string in the `OpenSSL cipher list format
+ <http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`_.
+ If no cipher can be selected (because compile-time options or other
+ configuration forbids use of all the specified ciphers), an
+ :class:`SSLError` will be raised.
+
+ .. note::
+ when connected, the :meth:`SSLSocket.cipher` method of SSL sockets will
+ give the currently selected cipher.
+
+.. method:: SSLContext.wrap_socket(sock, server_side=False, \
+ do_handshake_on_connect=True, suppress_ragged_eofs=True, \
+ server_hostname=None)
+
+ Wrap an existing Python socket *sock* and return an :class:`SSLSocket`
+ object. The SSL socket is tied to the context, its settings and
+ certificates. The parameters *server_side*, *do_handshake_on_connect*
+ and *suppress_ragged_eofs* have the same meaning as in the top-level
+ :func:`wrap_socket` function.
+
+ On client connections, the optional parameter *server_hostname* specifies
+ the hostname of the service which we are connecting to. This allows a
+ single server to host multiple SSL-based services with distinct certificates,
+ quite similarly to HTTP virtual hosts. Specifying *server_hostname*
+ will raise a :exc:`ValueError` if the OpenSSL library doesn't have support
+ for it (that is, if :data:`HAS_SNI` is :const:`False`). Specifying
+ *server_hostname* will also raise a :exc:`ValueError` if *server_side*
+ is true.
+
+.. method:: SSLContext.session_stats()
+
+ Get statistics about the SSL sessions created or managed by this context.
+ A dictionary is returned which maps the names of each `piece of information
+ <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>`_ to their
+ numeric values. For example, here is the total number of hits and misses
+ in the session cache since the context was created::
+
+ >>> stats = context.session_stats()
+ >>> stats['hits'], stats['misses']
+ (0, 0)
+
+.. attribute:: SSLContext.options
+
+ An integer representing the set of SSL options enabled on this context.
+ The default value is :data:`OP_ALL`, but you can specify other options
+ such as :data:`OP_NO_SSLv2` by ORing them together.
+
+ .. note::
+ With versions of OpenSSL older than 0.9.8m, it is only possible
+ to set options, not to clear them. Attempting to clear an option
+ (by resetting the corresponding bits) will raise a ``ValueError``.
+
+.. attribute:: SSLContext.protocol
+
+ The protocol version chosen when constructing the context. This attribute
+ is read-only.
+
+.. attribute:: SSLContext.verify_mode
+
+ Whether to try to verify other peers' certificates and how to behave
+ if verification fails. This attribute must be one of
+ :data:`CERT_NONE`, :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`.
+
+
.. index:: single: certificates
.. index:: single: X509 certificate
@@ -374,6 +661,9 @@ and a footer line::
... (certificate in base64 PEM encoding) ...
-----END CERTIFICATE-----
+Certificate chains
+^^^^^^^^^^^^^^^^^^
+
The Python files which contain certificates can contain a sequence of
certificates, sometimes called a *certificate chain*. This chain should start
with the specific certificate for the principal who "is" the client or server,
@@ -397,6 +687,9 @@ certification authority's certificate::
... (the root certificate for the CA's issuer)...
-----END CERTIFICATE-----
+CA certificates
+^^^^^^^^^^^^^^^
+
If you are going to require validation of the other side of the connection's
certificate, you need to provide a "CA certs" file, filled with the certificate
chains for each issuer you are willing to trust. Again, this file just contains
@@ -416,6 +709,25 @@ peer is supposed to furnish the other certificates necessary to chain from its
certificate to a root certificate. See :rfc:`4158` for more discussion of the
way in which certification chains can be built.
+Combined key and certificate
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Often the private key is stored in the same file as the certificate; in this
+case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain`
+and :func:`wrap_socket` needs to be passed. If the private key is stored
+with the certificate, it should come before the first certificate in
+the certificate chain::
+
+ -----BEGIN RSA PRIVATE KEY-----
+ ... (private key in base64 encoding) ...
+ -----END RSA PRIVATE KEY-----
+ -----BEGIN CERTIFICATE-----
+ ... (certificate in base64 PEM encoding) ...
+ -----END CERTIFICATE-----
+
+Self-signed certificates
+^^^^^^^^^^^^^^^^^^^^^^^^
+
If you are going to create a server that provides SSL-encrypted connection
services, you will need to acquire a certificate for that service. There are
many ways of acquiring appropriate certificates, such as buying one from a
@@ -469,101 +781,180 @@ should use the following idiom::
Client-side operation
^^^^^^^^^^^^^^^^^^^^^
-This example connects to an SSL server, prints the server's address and
-certificate, sends some bytes, and reads part of the response::
+This example connects to an SSL server and prints the server's certificate::
import socket, ssl, pprint
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-
# require a certificate from the server
ssl_sock = ssl.wrap_socket(s,
ca_certs="/etc/ca_certs_file",
cert_reqs=ssl.CERT_REQUIRED)
-
ssl_sock.connect(('www.verisign.com', 443))
- print(repr(ssl_sock.getpeername()))
pprint.pprint(ssl_sock.getpeercert())
- print(pprint.pformat(ssl_sock.getpeercert()))
-
- # Set a simple HTTP request -- use http.client in actual code.
- ssl_sock.write("""GET / HTTP/1.0\r
- Host: www.verisign.com\r\n\r\n""")
-
- # Read a chunk of data. Will not necessarily
- # read all the data returned by the server.
- data = ssl_sock.read()
-
# note that closing the SSLSocket will also close the underlying socket
ssl_sock.close()
-As of September 6, 2007, the certificate printed by this program looked like
+As of October 6, 2010, the certificate printed by this program looks like
this::
- {'notAfter': 'May 8 23:59:59 2009 GMT',
- 'subject': ((('serialNumber', '2497886'),),
- (('1.3.6.1.4.1.311.60.2.1.3', 'US'),),
- (('1.3.6.1.4.1.311.60.2.1.2', 'Delaware'),),
- (('countryName', 'US'),),
- (('postalCode', '94043'),),
- (('stateOrProvinceName', 'California'),),
- (('localityName', 'Mountain View'),),
- (('streetAddress', '487 East Middlefield Road'),),
- (('organizationName', 'VeriSign, Inc.'),),
- (('organizationalUnitName',
- 'Production Security Services'),),
- (('organizationalUnitName',
- 'Terms of use at www.verisign.com/rpa (c)06'),),
- (('commonName', 'www.verisign.com'),))}
-
-which is a fairly poorly-formed ``subject`` field.
+ {'notAfter': 'May 25 23:59:59 2012 GMT',
+ 'subject': ((('1.3.6.1.4.1.311.60.2.1.3', 'US'),),
+ (('1.3.6.1.4.1.311.60.2.1.2', 'Delaware'),),
+ (('businessCategory', 'V1.0, Clause 5.(b)'),),
+ (('serialNumber', '2497886'),),
+ (('countryName', 'US'),),
+ (('postalCode', '94043'),),
+ (('stateOrProvinceName', 'California'),),
+ (('localityName', 'Mountain View'),),
+ (('streetAddress', '487 East Middlefield Road'),),
+ (('organizationName', 'VeriSign, Inc.'),),
+ (('organizationalUnitName', ' Production Security Services'),),
+ (('commonName', 'www.verisign.com'),))}
+
+This other example first creates an SSL context, instructs it to verify
+certificates sent by peers, and feeds it a set of recognized certificate
+authorities (CA)::
+
+ >>> context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ >>> context.verify_mode = ssl.CERT_REQUIRED
+ >>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")
+
+(it is assumed your operating system places a bundle of all CA certificates
+in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an error and have
+to adjust the location)
+
+When you use the context to connect to a server, :const:`CERT_REQUIRED`
+validates the server certificate: it ensures that the server certificate
+was signed with one of the CA certificates, and checks the signature for
+correctness::
+
+ >>> conn = context.wrap_socket(socket.socket(socket.AF_INET))
+ >>> conn.connect(("linuxfr.org", 443))
+
+You should then fetch the certificate and check its fields for conformity::
+
+ >>> cert = conn.getpeercert()
+ >>> ssl.match_hostname(cert, "linuxfr.org")
+
+Visual inspection shows that the certificate does identify the desired service
+(that is, the HTTPS host ``linuxfr.org``)::
+
+ >>> pprint.pprint(cert)
+ {'notAfter': 'Jun 26 21:41:46 2011 GMT',
+ 'subject': ((('commonName', 'linuxfr.org'),),),
+ 'subjectAltName': (('DNS', 'linuxfr.org'), ('othername', '<unsupported>'))}
+
+Now that you are assured of its authenticity, you can proceed to talk with
+the server::
+
+ >>> conn.sendall(b"HEAD / HTTP/1.0\r\nHost: linuxfr.org\r\n\r\n")
+ >>> pprint.pprint(conn.recv(1024).split(b"\r\n"))
+ [b'HTTP/1.1 302 Found',
+ b'Date: Sun, 16 May 2010 13:43:28 GMT',
+ b'Server: Apache/2.2',
+ b'Location: https://linuxfr.org/pub/',
+ b'Vary: Accept-Encoding',
+ b'Connection: close',
+ b'Content-Type: text/html; charset=iso-8859-1',
+ b'',
+ b'']
+
+See the discussion of :ref:`ssl-security` below.
+
Server-side operation
^^^^^^^^^^^^^^^^^^^^^
-For server operation, typically you'd need to have a server certificate, and
-private key, each in a file. You'd open a socket, bind it to a port, call
-:meth:`listen` on it, then start waiting for clients to connect::
+For server operation, typically you'll need to have a server certificate, and
+private key, each in a file. You'll first create a context holding the key
+and the certificate, so that clients can check your authenticity. Then
+you'll open a socket, bind it to a port, call :meth:`listen` on it, and start
+waiting for clients to connect::
import socket, ssl
+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ context.load_cert_chain(certfile="mycertfile", keyfile="mykeyfile")
+
bindsocket = socket.socket()
bindsocket.bind(('myaddr.mydomain.com', 10023))
bindsocket.listen(5)
-When one did, you'd call :meth:`accept` on the socket to get the new socket from
-the other end, and use :func:`wrap_socket` to create a server-side SSL context
-for it::
+When a client connects, you'll call :meth:`accept` on the socket to get the
+new socket from the other end, and use the context's :meth:`SSLContext.wrap_socket`
+method to create a server-side SSL socket for the connection::
while True:
newsocket, fromaddr = bindsocket.accept()
- connstream = ssl.wrap_socket(newsocket,
- server_side=True,
- certfile="mycertfile",
- keyfile="mykeyfile",
- ssl_version=ssl.PROTOCOL_TLSv1)
+ connstream = context.wrap_socket(newsocket, server_side=True)
try:
deal_with_client(connstream)
finally:
connstream.shutdown(socket.SHUT_RDWR)
connstream.close()
-Then you'd read data from the ``connstream`` and do something with it till you
+Then you'll read data from the ``connstream`` and do something with it till you
are finished with the client (or the client is finished with you)::
def deal_with_client(connstream):
- data = connstream.read()
- # null data means the client is finished with us
+ data = connstream.recv(1024)
+ # empty data means the client is finished with us
while data:
if not do_something(connstream, data):
# we'll assume do_something returns False
# when we're finished with client
break
- data = connstream.read()
+ data = connstream.recv(1024)
# finished with client
-And go back to listening for new client connections.
+And go back to listening for new client connections (of course, a real server
+would probably handle each client connection in a separate thread, or put
+the sockets in non-blocking mode and use an event loop).
+
+
+.. _ssl-security:
+
+Security considerations
+-----------------------
+
+Verifying certificates
+^^^^^^^^^^^^^^^^^^^^^^
+
+:const:`CERT_NONE` is the default. Since it does not authenticate the other
+peer, it can be insecure, especially in client mode where most of time you
+would like to ensure the authenticity of the server you're talking to.
+Therefore, when in client mode, it is highly recommended to use
+:const:`CERT_REQUIRED`. However, it is in itself not sufficient; you also
+have to check that the server certificate, which can be obtained by calling
+:meth:`SSLSocket.getpeercert`, matches the desired service. For many
+protocols and applications, the service can be identified by the hostname;
+in this case, the :func:`match_hostname` function can be used.
+
+In server mode, if you want to authenticate your clients using the SSL layer
+(rather than using a higher-level authentication mechanism), you'll also have
+to specify :const:`CERT_REQUIRED` and similarly check the client certificate.
+
+ .. note::
+
+ In client mode, :const:`CERT_OPTIONAL` and :const:`CERT_REQUIRED` are
+ equivalent unless anonymous ciphers are enabled (they are disabled
+ by default).
+
+Protocol versions
+^^^^^^^^^^^^^^^^^
+
+SSL version 2 is considered insecure and is therefore dangerous to use. If
+you want maximum compatibility between clients and servers, it is recommended
+to use :const:`PROTOCOL_SSLv23` as the protocol version and then disable
+SSLv2 explicitly using the :data:`SSLContext.options` attribute::
+
+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ context.options |= ssl.OP_NO_SSLv2
+
+The SSL context created above will allow SSLv3 and TLSv1 connections, but
+not SSLv2.
.. seealso::
@@ -582,3 +973,6 @@ And go back to listening for new client connections.
`RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile <http://www.ietf.org/rfc/rfc3280>`_
Housley et. al.
+
+ `RFC 4366: Transport Layer Security (TLS) Extensions <http://www.ietf.org/rfc/rfc4366>`_
+ Blake-Wilson et. al.
diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst
index 3419820975..cc879de625 100644
--- a/Doc/library/stat.rst
+++ b/Doc/library/stat.rst
@@ -6,11 +6,14 @@
os.lstat() and os.fstat().
.. sectionauthor:: Skip Montanaro <skip@automatrix.com>
+**Source code:** :source:`Lib/stat.py`
+
+--------------
The :mod:`stat` module defines constants and functions for interpreting the
results of :func:`os.stat`, :func:`os.fstat` and :func:`os.lstat` (if they
-exist). For complete details about the :cfunc:`stat`, :cfunc:`fstat` and
-:cfunc:`lstat` calls, consult the documentation for your system.
+exist). For complete details about the :c:func:`stat`, :c:func:`fstat` and
+:c:func:`lstat` calls, consult the documentation for your system.
The :mod:`stat` module defines the following functions to test for specific file
types:
@@ -68,7 +71,7 @@ mode:
Normally, you would use the :func:`os.path.is\*` functions for testing the type
of a file; the functions here are useful when you are doing multiple tests of
-the same file and wish to avoid the overhead of the :cfunc:`stat` system call
+the same file and wish to avoid the overhead of the :c:func:`stat` system call
for each test. These are also useful when checking for information about a file
that isn't handled by :mod:`os.path`, like the tests for block and character
devices.
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 7621eef4ae..e3c8b151cd 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -168,8 +168,9 @@ Objects of different types, except different numeric types, never compare equal.
Furthermore, some types (for example, function objects) support only a degenerate
notion of comparison where any two objects of that type are unequal. The ``<``,
``<=``, ``>`` and ``>=`` operators will raise a :exc:`TypeError` exception when
-any operand is a complex number, the objects are of different types that cannot
-be compared, or other cases where there is no defined ordering.
+comparing a complex number with another built-in numeric type, when the objects
+are of different types that cannot be compared, or in other cases where there is
+no defined ordering.
.. index::
single: __eq__() (instance method)
@@ -196,8 +197,8 @@ exception.
operator: in
operator: not in
-Two more operations with the same syntactic priority, ``in`` and ``not in``, are
-supported only by sequence types (below).
+Two more operations with the same syntactic priority, :keyword:`in` and
+:keyword:`not in`, are supported only by sequence types (below).
.. _typesnumeric:
@@ -216,7 +217,7 @@ Numeric Types --- :class:`int`, :class:`float`, :class:`complex`
There are three distinct numeric types: :dfn:`integers`, :dfn:`floating
point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a
subtype of integers. Integers have unlimited precision. Floating point
-numbers are usually implemented using :ctype:`double` in C; information
+numbers are usually implemented using :c:type:`double` in C; information
about the precision and internal representation of floating point
numbers for the machine on which your program is running is available
in :data:`sys.float_info`. Complex numbers have a real and imaginary
@@ -467,6 +468,69 @@ class`. In addition, it provides one more method:
.. versionadded:: 3.1
+.. method:: int.to_bytes(length, byteorder, \*, signed=False)
+
+ Return an array of bytes representing an integer.
+
+ >>> (1024).to_bytes(2, byteorder='big')
+ b'\x04\x00'
+ >>> (1024).to_bytes(10, byteorder='big')
+ b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00'
+ >>> (-1024).to_bytes(10, byteorder='big', signed=True)
+ b'\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x00'
+ >>> x = 1000
+ >>> x.to_bytes((x.bit_length() // 8) + 1, byteorder='little')
+ b'\xe8\x03'
+
+ The integer is represented using *length* bytes. An :exc:`OverflowError`
+ is raised if the integer is not representable with the given number of
+ bytes.
+
+ The *byteorder* argument determines the byte order used to represent the
+ integer. If *byteorder* is ``"big"``, the most significant byte is at the
+ beginning of the byte array. If *byteorder* is ``"little"``, the most
+ significant byte is at the end of the byte array. To request the native
+ byte order of the host system, use :data:`sys.byteorder` as the byte order
+ value.
+
+ The *signed* argument determines whether two's complement is used to
+ represent the integer. If *signed* is ``False`` and a negative integer is
+ given, an :exc:`OverflowError` is raised. The default value for *signed*
+ is ``False``.
+
+ .. versionadded:: 3.2
+
+.. classmethod:: int.from_bytes(bytes, byteorder, \*, signed=False)
+
+ Return the integer represented by the given array of bytes.
+
+ >>> int.from_bytes(b'\x00\x10', byteorder='big')
+ 16
+ >>> int.from_bytes(b'\x00\x10', byteorder='little')
+ 4096
+ >>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=True)
+ -1024
+ >>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=False)
+ 64512
+ >>> int.from_bytes([255, 0, 0], byteorder='big')
+ 16711680
+
+ The argument *bytes* must either support the buffer protocol or be an
+ iterable producing bytes. :class:`bytes` and :class:`bytearray` are
+ examples of built-in objects that support the buffer protocol.
+
+ The *byteorder* argument determines the byte order used to represent the
+ integer. If *byteorder* is ``"big"``, the most significant byte is at the
+ beginning of the byte array. If *byteorder* is ``"little"``, the most
+ significant byte is at the end of the byte array. To request the native
+ byte order of the host system, use :data:`sys.byteorder` as the byte order
+ value.
+
+ The *signed* argument indicates whether two's complement is used to
+ represent the integer.
+
+ .. versionadded:: 3.2
+
Additional Methods on Float
---------------------------
@@ -552,6 +616,109 @@ hexadecimal string representing the same number::
'0x1.d380000000000p+11'
+.. _numeric-hash:
+
+Hashing of numeric types
+------------------------
+
+For numbers ``x`` and ``y``, possibly of different types, it's a requirement
+that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`__hash__`
+method documentation for more details). For ease of implementation and
+efficiency across a variety of numeric types (including :class:`int`,
+:class:`float`, :class:`decimal.Decimal` and :class:`fractions.Fraction`)
+Python's hash for numeric types is based on a single mathematical function
+that's defined for any rational number, and hence applies to all instances of
+:class:`int` and :class:`fraction.Fraction`, and all finite instances of
+:class:`float` and :class:`decimal.Decimal`. Essentially, this function is
+given by reduction modulo ``P`` for a fixed prime ``P``. The value of ``P`` is
+made available to Python as the :attr:`modulus` attribute of
+:data:`sys.hash_info`.
+
+.. impl-detail::
+
+ Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C
+ longs and ``P = 2**61 - 1`` on machines with 64-bit C longs.
+
+Here are the rules in detail:
+
+ - If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible
+ by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n,
+ P)`` gives the inverse of ``n`` modulo ``P``.
+
+ - If ``x = m / n`` is a nonnegative rational number and ``n`` is
+ divisible by ``P`` (but ``m`` is not) then ``n`` has no inverse
+ modulo ``P`` and the rule above doesn't apply; in this case define
+ ``hash(x)`` to be the constant value ``sys.hash_info.inf``.
+
+ - If ``x = m / n`` is a negative rational number define ``hash(x)``
+ as ``-hash(-x)``. If the resulting hash is ``-1``, replace it with
+ ``-2``.
+
+ - The particular values ``sys.hash_info.inf``, ``-sys.hash_info.inf``
+ and ``sys.hash_info.nan`` are used as hash values for positive
+ infinity, negative infinity, or nans (respectively). (All hashable
+ nans have the same hash value.)
+
+ - For a :class:`complex` number ``z``, the hash values of the real
+ and imaginary parts are combined by computing ``hash(z.real) +
+ sys.hash_info.imag * hash(z.imag)``, reduced modulo
+ ``2**sys.hash_info.width`` so that it lies in
+ ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width -
+ 1))``. Again, if the result is ``-1``, it's replaced with ``-2``.
+
+
+To clarify the above rules, here's some example Python code,
+equivalent to the builtin hash, for computing the hash of a rational
+number, :class:`float`, or :class:`complex`::
+
+
+ import sys, math
+
+ def hash_fraction(m, n):
+ """Compute the hash of a rational number m / n.
+
+ Assumes m and n are integers, with n positive.
+ Equivalent to hash(fractions.Fraction(m, n)).
+
+ """
+ P = sys.hash_info.modulus
+ # Remove common factors of P. (Unnecessary if m and n already coprime.)
+ while m % P == n % P == 0:
+ m, n = m // P, n // P
+
+ if n % P == 0:
+ hash_ = sys.hash_info.inf
+ else:
+ # Fermat's Little Theorem: pow(n, P-1, P) is 1, so
+ # pow(n, P-2, P) gives the inverse of n modulo P.
+ hash_ = (abs(m) % P) * pow(n, P - 2, P) % P
+ if m < 0:
+ hash_ = -hash_
+ if hash_ == -1:
+ hash_ = -2
+ return hash_
+
+ def hash_float(x):
+ """Compute the hash of a float x."""
+
+ if math.isnan(x):
+ return sys.hash_info.nan
+ elif math.isinf(x):
+ return sys.hash_info.inf if x > 0 else -sys.hash_info.inf
+ else:
+ return hash_fraction(*x.as_integer_ratio())
+
+ def hash_complex(z):
+ """Compute the hash of a complex number z."""
+
+ hash_ = hash_float(z.real) + sys.hash_info.imag * hash_float(z.imag)
+ # do a signed reduction modulo 2**sys.hash_info.width
+ M = 2**(sys.hash_info.width - 1)
+ hash_ = (hash_ & (M - 1)) - (hash & M)
+ if hash_ == -1:
+ hash_ == -2
+ return hash_
+
.. _typeiter:
Iterator Types
@@ -657,22 +824,20 @@ constructor, :func:`bytes`, and from literals; use a ``b`` prefix with normal
string syntax: ``b'xyzzy'``. To construct byte arrays, use the
:func:`bytearray` function.
-.. warning::
-
- While string objects are sequences of characters (represented by strings of
- length 1), bytes and bytearray objects are sequences of *integers* (between 0
- and 255), representing the ASCII value of single bytes. That means that for
- a bytes or bytearray object *b*, ``b[0]`` will be an integer, while
- ``b[0:1]`` will be a bytes or bytearray object of length 1. The
- representation of bytes objects uses the literal format (``b'...'``) since it
- is generally more useful than e.g. ``bytes([50, 19, 100])``. You can always
- convert a bytes object into a list of integers using ``list(b)``.
-
- Also, while in previous Python versions, byte strings and Unicode strings
- could be exchanged for each other rather freely (barring encoding issues),
- strings and bytes are now completely separate concepts. There's no implicit
- en-/decoding if you pass an object of the wrong type. A string always
- compares unequal to a bytes or bytearray object.
+While string objects are sequences of characters (represented by strings of
+length 1), bytes and bytearray objects are sequences of *integers* (between 0
+and 255), representing the ASCII value of single bytes. That means that for
+a bytes or bytearray object *b*, ``b[0]`` will be an integer, while
+``b[0:1]`` will be a bytes or bytearray object of length 1. The
+representation of bytes objects uses the literal format (``b'...'``) since it
+is generally more useful than e.g. ``bytes([50, 19, 100])``. You can always
+convert a bytes object into a list of integers using ``list(b)``.
+
+Also, while in previous Python versions, byte strings and Unicode strings
+could be exchanged for each other rather freely (barring encoding issues),
+strings and bytes are now completely separate concepts. There's no implicit
+en-/decoding if you pass an object of the wrong type. A string always
+compares unequal to a bytes or bytearray object.
Lists are constructed with square brackets, separating items with commas: ``[a,
b, c]``. Tuples are constructed by the comma operator (not within square
@@ -681,8 +846,8 @@ the enclosing parentheses, such as ``a, b, c`` or ``()``. A single item tuple
must have a trailing comma, such as ``(d,)``.
Objects of type range are created using the :func:`range` function. They don't
-support slicing, concatenation or repetition, and using ``in``, ``not in``,
-:func:`min` or :func:`max` on them is inefficient.
+support concatenation or repetition, and using :func:`min` or :func:`max` on
+them is inefficient.
Most sequence types support the following operations. The ``in`` and ``not in``
operations have the same priorities as the comparison operations. The ``+`` and
@@ -691,7 +856,7 @@ operations have the same priorities as the comparison operations. The ``+`` and
This table lists the sequence operations sorted in ascending priority
(operations in the same box have the same priority). In the table, *s* and *t*
-are sequences of the same type; *n*, *i* and *j* are integers:
+are sequences of the same type; *n*, *i*, *j* and *k* are integers.
+------------------+--------------------------------+----------+
| Operation | Result | Notes |
@@ -817,11 +982,10 @@ String Methods
.. index:: pair: string; methods
-String objects support the methods listed below. Note that none of these
-methods take keyword arguments.
+String objects support the methods listed below.
-In addition, Python's strings support the sequence type methods described in
-the :ref:`typesseq` section. To output formatted strings, see the
+In addition, Python's strings support the sequence type methods described in the
+:ref:`typesseq` section. To output formatted strings, see the
:ref:`string-formatting` section. Also, see the :mod:`re` module for string
functions based on regular expressions.
@@ -844,12 +1008,12 @@ functions based on regular expressions.
interpreted as in slice notation.
-.. method:: str.encode([encoding[, errors]])
+.. method:: str.encode(encoding="utf-8", errors="strict")
- Return an encoded version of the string as a bytes object. Default encoding
- is the current default string encoding. *errors* may be given to set a
- different error handling scheme. The default for *errors* is ``'strict'``,
- meaning that encoding errors raise a :exc:`UnicodeError`. Other possible
+ Return an encoded version of the string as a bytes object. Default encoding
+ is ``'utf-8'``. *errors* may be given to set a different error handling scheme.
+ The default for *errors* is ``'strict'``, meaning that encoding errors raise
+ a :exc:`UnicodeError`. Other possible
values are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``,
``'backslashreplace'`` and any other name registered via
:func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a
@@ -886,12 +1050,12 @@ functions based on regular expressions.
.. method:: str.format(*args, **kwargs)
- Perform a string formatting operation. The *format_string* argument can
- contain literal text or replacement fields delimited by braces ``{}``. Each
- replacement field contains either the numeric index of a positional argument,
- or the name of a keyword argument. Returns a copy of *format_string* where
- each replacement field is replaced with the string value of the corresponding
- argument.
+ Perform a string formatting operation. The string on which this method is
+ called can contain literal text or replacement fields delimited by braces
+ ``{}``. Each replacement field contains either the numeric index of a
+ positional argument, or the name of a keyword argument. Returns a copy of
+ the string where each replacement field is replaced with the string value of
+ the corresponding argument.
>>> "The sum of 1 + 2 is {0}".format(1+2)
'The sum of 1 + 2 is 3'
@@ -900,6 +1064,22 @@ functions based on regular expressions.
that can be specified in format strings.
+.. method:: str.format_map(mapping)
+
+ Similar to ``str.format(**mapping)``, except that ``mapping`` is
+ used directly and not copied to a :class:`dict` . This is useful
+ if for example ``mapping`` is a dict subclass:
+
+ >>> class Default(dict):
+ ... def __missing__(self, key):
+ ... return key
+ ...
+ >>> '{name} was born in {country}'.format_map(Default(name='Guido'))
+ 'Guido was born in country'
+
+ .. versionadded:: 3.2
+
+
.. method:: str.index(sub[, start[, end]])
Like :meth:`find`, but raise :exc:`ValueError` when the substring is not found.
@@ -1252,7 +1432,7 @@ String objects have one unique built-in operation: the ``%`` operator (modulo).
This is also known as the string *formatting* or *interpolation* operator.
Given ``format % values`` (where *format* is a string), ``%`` conversion
specifications in *format* are replaced with zero or more elements of *values*.
-The effect is similar to the using :cfunc:`sprintf` in the C language.
+The effect is similar to the using :c:func:`sprintf` in the C language.
If *format* requires a single argument, *values* may be a single non-tuple
object. [#]_ Otherwise, *values* must be a tuple with exactly the number of
@@ -1425,11 +1605,23 @@ Range Type
The :class:`range` type is an immutable sequence which is commonly used for
looping. The advantage of the :class:`range` type is that an :class:`range`
object will always take the same amount of memory, no matter the size of the
-range it represents. There are no consistent performance advantages.
+range it represents.
+
+Range objects have relatively little behavior: they support indexing, contains,
+iteration, the :func:`len` function, and the following methods:
+
+.. method:: range.count(x)
+
+ Return the number of *i*'s for which ``s[i] == x``.
+
+ .. versionadded:: 3.2
+
+.. method:: range.index(x)
-Range objects have very little behavior: they only support indexing, iteration,
-and the :func:`len` function.
+ Return the smallest *i* such that ``s[i] == x``. Raises
+ :exc:`ValueError` when *x* is not in the range.
+ .. versionadded:: 3.2
.. _typesseq-mutable:
@@ -1547,6 +1739,9 @@ Notes:
*key* specifies a function of one argument that is used to extract a comparison
key from each list element: ``key=str.lower``. The default value is ``None``.
+ Use :func:`functools.cmp_to_key` to convert an
+ old-style *cmp* function to a *key* function.
+
*reverse* is a boolean value. If set to ``True``, then the list elements are
sorted as if each comparison were reversed.
@@ -1598,17 +1793,20 @@ Wherever one of these methods needs to interpret the bytes as characters
b = a.replace(b"a", b"f")
-.. method:: bytes.decode([encoding[, errors]])
- bytearray.decode([encoding[, errors]])
+.. method:: bytes.decode(encoding="utf-8", errors="strict")
+ bytearray.decode(encoding="utf-8", errors="strict")
- Return a string decoded from the given bytes. Default encoding is the
- current default string encoding. *errors* may be given to set a different
+ Return a string decoded from the given bytes. Default encoding is
+ ``'utf-8'``. *errors* may be given to set a different
error handling scheme. The default for *errors* is ``'strict'``, meaning
that encoding errors raise a :exc:`UnicodeError`. Other possible values are
``'ignore'``, ``'replace'`` and any other name registered via
:func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a
list of possible encodings, see section :ref:`standard-encodings`.
+ .. versionchanged:: 3.1
+ Added support for keyword arguments.
+
The bytes and bytearray types have an additional class method:
@@ -1929,8 +2127,20 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
returned or raised by the ``__missing__(key)`` call if the key is not
present. No other operations or methods invoke :meth:`__missing__`. If
:meth:`__missing__` is not defined, :exc:`KeyError` is raised.
- :meth:`__missing__` must be a method; it cannot be an instance variable. For
- an example, see :class:`collections.defaultdict`.
+ :meth:`__missing__` must be a method; it cannot be an instance variable::
+
+ >>> class Counter(dict):
+ ... def __missing__(self, key):
+ ... return 0
+ >>> c = Counter()
+ >>> c['red']
+ 0
+ >>> c['red'] += 1
+ >>> c['red']
+ 1
+
+ See :class:`collections.Counter` for a complete implementation including
+ other methods helpful for accumulating and managing tallies.
.. describe:: d[key] = value
@@ -2067,7 +2277,6 @@ since the entries are generally not unique.) For set-like views, all of the
operations defined for the abstract base class :class:`collections.Set` are
available (for example, ``==``, ``<``, or ``^``).
-
An example of dictionary view usage::
>>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}
@@ -2102,8 +2311,8 @@ An example of dictionary view usage::
.. _typememoryview:
-memoryview Types
-================
+memoryview type
+===============
:class:`memoryview` objects allow Python code to access the internal data
of an object that supports the :ref:`buffer protocol <bufferobjects>` without
@@ -2159,7 +2368,7 @@ copying. Memory is generally interpreted as simple bytes.
Notice how the size of the memoryview object cannot be changed.
- :class:`memoryview` has two methods:
+ :class:`memoryview` has several methods:
.. method:: tobytes()
@@ -2179,6 +2388,39 @@ copying. Memory is generally interpreted as simple bytes.
>>> memoryview(b'abc').tolist()
[97, 98, 99]
+ .. method:: release()
+
+ Release the underlying buffer exposed by the memoryview object. Many
+ objects take special actions when a view is held on them (for example,
+ a :class:`bytearray` would temporarily forbid resizing); therefore,
+ calling release() is handy to remove these restrictions (and free any
+ dangling resources) as soon as possible.
+
+ After this method has been called, any further operation on the view
+ raises a :class:`ValueError` (except :meth:`release()` itself which can
+ be called multiple times)::
+
+ >>> m = memoryview(b'abc')
+ >>> m.release()
+ >>> m[0]
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ ValueError: operation forbidden on released memoryview object
+
+ The context management protocol can be used for a similar effect,
+ using the ``with`` statement::
+
+ >>> with memoryview(b'abc') as m:
+ ... m[0]
+ ...
+ b'a'
+ >>> m[0]
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ ValueError: operation forbidden on released memoryview object
+
+ .. versionadded:: 3.2
+
There are also several readonly attributes available:
.. attribute:: format
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index b2d0bbaa4d..d45eb36923 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -11,6 +11,10 @@
:ref:`string-methods`
+**Source code:** :source:`Lib/string.py`
+
+--------------
+
String constants
----------------
@@ -340,9 +344,18 @@ following:
| | positive numbers, and a minus sign on negative numbers. |
+---------+----------------------------------------------------------+
-The ``'#'`` option is only valid for integers, and only for binary, octal, or
-hexadecimal output. If present, it specifies that the output will be prefixed
-by ``'0b'``, ``'0o'``, or ``'0x'``, respectively.
+
+The ``'#'`` option causes the "alternate form" to be used for the
+conversion. The alternate form is defined differently for different
+types. This option is only valid for integer, float, complex and
+Decimal types. For integers, when binary, octal, or hexadecimal output
+is used, this option adds the prefix respective ``'0b'``, ``'0o'``, or
+``'0x'`` to the output value. For floats, complex and Decimal the
+alternate form causes the result of the conversion to always contain a
+decimal-point character, even if no digits follow it. Normally, a
+decimal-point character appears in the result of these conversions
+only if a digit follows it. In addition, for ``'g'`` and ``'G'``
+conversions, trailing zeros are not removed from the result.
The ``','`` option signals the use of a comma for a thousands separator.
For a locale aware separator, use the ``'n'`` integer presentation type
@@ -705,6 +718,14 @@ to parse template strings. To do this, you can override these class attributes:
appropriate). The default value is the regular expression
``[_a-z][_a-z0-9]*``.
+* *flags* -- The regular expression flags that will be applied when compiling
+ the regular expression used for recognizing substitutions. The default value
+ is ``re.IGNORECASE``. Note that ``re.VERBOSE`` will always be added to the
+ flags, so custom *idpattern*\ s must follow conventions for verbose regular
+ expressions.
+
+ .. versionadded:: 3.2
+
Alternatively, you can provide the entire regular expression pattern by
overriding the class attribute *pattern*. If you do this, the value must be a
regular expression object with four named capturing groups. The capturing
@@ -727,7 +748,7 @@ rule:
Helper functions
----------------
-.. function:: capwords(s[, sep])
+.. function:: capwords(s, sep=None)
Split the argument into words using :meth:`str.split`, capitalize each word
using :meth:`str.capitalize`, and join the capitalized words using
@@ -736,12 +757,3 @@ Helper functions
and leading and trailing whitespace are removed, otherwise *sep* is used to
split and join the words.
-
-.. function:: maketrans(frm, to)
-
- Return a translation table suitable for passing to :meth:`bytes.translate`,
- that will map each character in *from* into the character at the same
- position in *to*; *from* and *to* must have the same length.
-
- .. deprecated:: 3.1
- Use the :meth:`bytes.maketrans` static method instead.
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst
index 1834cfd1af..42bfc14d96 100644
--- a/Doc/library/struct.rst
+++ b/Doc/library/struct.rst
@@ -21,8 +21,8 @@ structs and the intended conversion to/from Python values.
alignment is taken into account when unpacking. This behavior is chosen so
that the bytes of a packed struct correspond exactly to the layout in memory
of the corresponding C struct. To handle platform-independent data formats
- or omit implicit pad bytes, use `standard` size and alignment instead of
- `native` size and alignment: see :ref:`struct-alignment` for details.
+ or omit implicit pad bytes, use ``standard`` size and alignment instead of
+ ``native`` size and alignment: see :ref:`struct-alignment` for details.
Functions and Exceptions
------------------------
@@ -157,63 +157,66 @@ is, when the format string starts with one of ``'<'``, ``'>'``, ``'!'`` or
``'='``. When using native size, the size of the packed value is
platform-dependent.
-+--------+-------------------------+--------------------+----------------+------------+
-| Format | C Type | Python type | Standard size | Notes |
-+========+=========================+====================+================+============+
-| ``x`` | pad byte | no value | | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``c`` | :ctype:`char` | bytes of length 1 | 1 | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``b`` | :ctype:`signed char` | integer | 1 | \(1) |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``B`` | :ctype:`unsigned char` | integer | 1 | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``?`` | :ctype:`_Bool` | bool | 1 | \(2) |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``h`` | :ctype:`short` | integer | 2 | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``H`` | :ctype:`unsigned short` | integer | 2 | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``i`` | :ctype:`int` | integer | 4 | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``I`` | :ctype:`unsigned int` | integer | 4 | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``l`` | :ctype:`long` | integer | 4 | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``L`` | :ctype:`unsigned long` | integer | 4 | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``q`` | :ctype:`long long` | integer | 8 | \(3) |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``Q`` | :ctype:`unsigned long | integer | 8 | \(3) |
-| | long` | | | |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``f`` | :ctype:`float` | float | 4 | \(4) |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``d`` | :ctype:`double` | float | 8 | \(4) |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``s`` | :ctype:`char[]` | bytes | | \(1) |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``p`` | :ctype:`char[]` | bytes | | \(1) |
-+--------+-------------------------+--------------------+----------------+------------+
-| ``P`` | :ctype:`void \*` | integer | | \(5) |
-+--------+-------------------------+--------------------+----------------+------------+
++--------+--------------------------+--------------------+----------------+------------+
+| Format | C Type | Python type | Standard size | Notes |
++========+==========================+====================+================+============+
+| ``x`` | pad byte | no value | | |
++--------+--------------------------+--------------------+----------------+------------+
+| ``c`` | :c:type:`char` | bytes of length 1 | 1 | |
++--------+--------------------------+--------------------+----------------+------------+
+| ``b`` | :c:type:`signed char` | integer | 1 | \(1),\(3) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``B`` | :c:type:`unsigned char` | integer | 1 | \(3) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``?`` | :c:type:`_Bool` | bool | 1 | \(1) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``h`` | :c:type:`short` | integer | 2 | \(3) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``H`` | :c:type:`unsigned short` | integer | 2 | \(3) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``i`` | :c:type:`int` | integer | 4 | \(3) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``I`` | :c:type:`unsigned int` | integer | 4 | \(3) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``l`` | :c:type:`long` | integer | 4 | \(3) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``L`` | :c:type:`unsigned long` | integer | 4 | \(3) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``q`` | :c:type:`long long` | integer | 8 | \(2), \(3) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``Q`` | :c:type:`unsigned long | integer | 8 | \(2), \(3) |
+| | long` | | | |
++--------+--------------------------+--------------------+----------------+------------+
+| ``f`` | :c:type:`float` | float | 4 | \(4) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``d`` | :c:type:`double` | float | 8 | \(4) |
++--------+--------------------------+--------------------+----------------+------------+
+| ``s`` | :c:type:`char[]` | bytes | | |
++--------+--------------------------+--------------------+----------------+------------+
+| ``p`` | :c:type:`char[]` | bytes | | |
++--------+--------------------------+--------------------+----------------+------------+
+| ``P`` | :c:type:`void \*` | integer | | \(5) |
++--------+--------------------------+--------------------+----------------+------------+
Notes:
(1)
- The ``c``, ``s`` and ``p`` conversion codes operate on :class:`bytes`
- objects, but packing with such codes also supports :class:`str` objects,
- which are encoded using UTF-8.
+ The ``'?'`` conversion code corresponds to the :c:type:`_Bool` type defined by
+ C99. If this type is not available, it is simulated using a :c:type:`char`. In
+ standard mode, it is always represented by one byte.
(2)
- The ``'?'`` conversion code corresponds to the :ctype:`_Bool` type defined by
- C99. If this type is not available, it is simulated using a :ctype:`char`. In
- standard mode, it is always represented by one byte.
+ The ``'q'`` and ``'Q'`` conversion codes are available in native mode only if
+ the platform C compiler supports C :c:type:`long long`, or, on Windows,
+ :c:type:`__int64`. They are always available in standard modes.
(3)
- The ``'q'`` and ``'Q'`` conversion codes are available in native mode only if
- the platform C compiler supports C :ctype:`long long`, or, on Windows,
- :ctype:`__int64`. They are always available in standard modes.
+ When attempting to pack a non-integer using any of the integer conversion
+ codes, if the non-integer has a :meth:`__index__` method then that method is
+ called to convert the argument to an integer before packing.
+
+ .. versionchanged:: 3.2
+ Use of the :meth:`__index__` method for non-integers is new in 3.2.
(4)
For the ``'f'`` and ``'d'`` conversion codes, the packed representation uses
@@ -302,9 +305,9 @@ the result in a named tuple::
The ordering of format characters may have an impact on size since the padding
needed to satisfy alignment requirements is different::
- >>> pack('ci', '*', 0x12131415)
+ >>> pack('ci', b'*', 0x12131415)
b'*\x00\x00\x00\x12\x13\x14\x15'
- >>> pack('ic', 0x12131415, '*')
+ >>> pack('ic', 0x12131415, b'*')
b'\x12\x13\x14\x15*'
>>> calcsize('ci')
8
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 932ca8b084..e09994ce7d 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -28,7 +28,7 @@ Using the subprocess Module
This module defines one class called :class:`Popen`:
-.. class:: Popen(args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0)
+.. class:: Popen(args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=True, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=())
Arguments are:
@@ -41,7 +41,8 @@ This module defines one class called :class:`Popen`:
name for the executing program in utilities such as :program:`ps`.
On Unix, with *shell=False* (default): In this case, the Popen class uses
- :meth:`os.execvp` to execute the child program. *args* should normally be a
+ :meth:`os.execvp` like behavior to execute the child program.
+ *args* should normally be a
sequence. If a string is specified for *args*, it will be used as the name
or path of the program to execute; this will only work if the program is
being given no arguments.
@@ -130,25 +131,65 @@ This module defines one class called :class:`Popen`:
applications should be captured into the same file handle as for stdout.
If *preexec_fn* is set to a callable object, this object will be called in the
- child process just before the child is executed. (Unix only)
+ child process just before the child is executed.
+ (Unix only)
+
+ .. warning::
+
+ The *preexec_fn* parameter is not safe to use in the presence of threads
+ in your application. The child process could deadlock before exec is
+ called.
+ If you must use it, keep it trivial! Minimize the number of libraries
+ you call into.
+
+ .. note::
+
+ If you need to modify the environment for the child use the *env*
+ parameter rather than doing it in a *preexec_fn*.
+ The *start_new_session* parameter can take the place of a previously
+ common use of *preexec_fn* to call os.setsid() in the child.
If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` and
:const:`2` will be closed before the child process is executed. (Unix only).
- Or, on Windows, if *close_fds* is true then no handles will be inherited by the
+ The default varies by platform: Always true on Unix. On Windows it is
+ true when *stdin*/*stdout*/*stderr* are :const:`None`, false otherwise.
+ On Windows, if *close_fds* is true then no handles will be inherited by the
child process. Note that on Windows, you cannot set *close_fds* to true and
also redirect the standard handles by setting *stdin*, *stdout* or *stderr*.
- If *shell* is :const:`True`, the specified command will be executed through the
- shell.
+ .. versionchanged:: 3.2
+ The default for *close_fds* was changed from :const:`False` to
+ what is described above.
+
+ *pass_fds* is an optional sequence of file descriptors to keep open
+ between the parent and child. Providing any *pass_fds* forces
+ *close_fds* to be :const:`True`. (Unix only)
+
+ .. versionadded:: 3.2
+ The *pass_fds* parameter was added.
If *cwd* is not ``None``, the child's current directory will be changed to *cwd*
before it is executed. Note that this directory is not considered when
searching the executable, so you can't specify the program's path relative to
*cwd*.
+ If *restore_signals* is True (the default) all signals that Python has set to
+ SIG_IGN are restored to SIG_DFL in the child process before the exec.
+ Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals.
+ (Unix only)
+
+ .. versionchanged:: 3.2
+ *restore_signals* was added.
+
+ If *start_new_session* is True the setsid() system call will be made in the
+ child process prior to the execution of the subprocess. (Unix only)
+
+ .. versionchanged:: 3.2
+ *start_new_session* was added.
+
If *env* is not ``None``, it must be a mapping that defines the environment
- variables for the new process; these are used instead of inheriting the current
- process' environment, which is the default behavior.
+ variables for the new process; these are used instead of the default
+ behavior of inheriting the current process' environment.
.. note::
@@ -173,7 +214,18 @@ This module defines one class called :class:`Popen`:
If given, *startupinfo* will be a :class:`STARTUPINFO` object, which is
passed to the underlying ``CreateProcess`` function.
- *creationflags*, if given, can be :data:`CREATE_NEW_CONSOLE`. (Windows only)
+ *creationflags*, if given, can be :data:`CREATE_NEW_CONSOLE` or
+ :data:`CREATE_NEW_PROCESS_GROUP`. (Windows only)
+
+ Popen objects are supported as context managers via the :keyword:`with` statement,
+ closing any open file descriptors on exit.
+ ::
+
+ with Popen(["ifconfig"], stdout=PIPE) as proc:
+ log.write(proc.stdout.read())
+
+ .. versionchanged:: 3.2
+ Added context manager support.
.. data:: PIPE
@@ -201,15 +253,16 @@ This module also defines the following shortcut functions:
Run command with arguments. Wait for command to complete, then return the
:attr:`returncode` attribute.
- The arguments are the same as for the Popen constructor. Example::
+ The arguments are the same as for the :class:`Popen` constructor. Example::
>>> retcode = subprocess.call(["ls", "-l"])
.. warning::
- Like :meth:`Popen.wait`, this will deadlock if the child process
- generates enough output to a stdout or stderr pipe such that it blocks
- waiting for the OS pipe buffer to accept more data.
+ Like :meth:`Popen.wait`, this will deadlock when using
+ ``stdout=PIPE`` and/or ``stderr=PIPE`` and the child process
+ generates enough output to a pipe such that it blocks waiting
+ for the OS pipe buffer to accept more data.
.. function:: check_call(*popenargs, **kwargs)
@@ -219,7 +272,7 @@ This module also defines the following shortcut functions:
:exc:`CalledProcessError` object will have the return code in the
:attr:`returncode` attribute.
- The arguments are the same as for the Popen constructor. Example::
+ The arguments are the same as for the :class:`Popen` constructor. Example::
>>> subprocess.check_call(["ls", "-l"])
0
@@ -262,7 +315,7 @@ This module also defines the following shortcut functions:
``(status, output)``. *cmd* is actually run as ``{ cmd ; } 2>&1``, so that the
returned output will contain output or error messages. A trailing newline is
stripped from the output. The exit status for the command can be interpreted
- according to the rules for the C function :cfunc:`wait`. Example::
+ according to the rules for the C function :c:func:`wait`. Example::
>>> subprocess.getstatusoutput('ls /bin/ls')
(0, '/bin/ls')
@@ -333,9 +386,10 @@ Instances of the :class:`Popen` class have the following methods:
.. warning::
- This will deadlock if the child process generates enough output to a
- stdout or stderr pipe such that it blocks waiting for the OS pipe buffer
- to accept more data. Use :meth:`communicate` to avoid that.
+ This will deadlock when using ``stdout=PIPE`` and/or
+ ``stderr=PIPE`` and the child process generates enough output to
+ a pipe such that it blocks waiting for the OS pipe buffer to
+ accept more data. Use :meth:`communicate` to avoid that.
.. method:: Popen.communicate(input=None)
@@ -364,14 +418,15 @@ Instances of the :class:`Popen` class have the following methods:
.. note::
- On Windows only SIGTERM is supported so far. It's an alias for
- :meth:`terminate`.
+ On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and
+ CTRL_BREAK_EVENT can be sent to processes started with a *creationflags*
+ parameter which includes `CREATE_NEW_PROCESS_GROUP`.
.. method:: Popen.terminate()
Stop the child. On Posix OSs the method sends SIGTERM to the
- child. On Windows the Win32 API function :cfunc:`TerminateProcess` is called
+ child. On Windows the Win32 API function :c:func:`TerminateProcess` is called
to stop the child.
@@ -522,6 +577,14 @@ The :mod:`subprocess` module exposes the following constants.
This flag is always set when :class:`Popen` is created with ``shell=True``.
+.. data:: CREATE_NEW_PROCESS_GROUP
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ group will be created. This flag is necessary for using :func:`os.kill`
+ on the subprocess.
+
+ This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified.
+
.. _subprocess-replacements:
@@ -701,7 +764,8 @@ Replacing functions from the :mod:`popen2` module
* ``stdin=PIPE`` and ``stdout=PIPE`` must be specified.
* popen2 closes all file descriptors by default, but you have to specify
- ``close_fds=True`` with :class:`Popen`.
+ ``close_fds=True`` with :class:`Popen` to guarantee this behavior on
+ all platforms or past Python versions.
Notes
-----
@@ -735,3 +799,4 @@ runtime):
backslash escapes the next double quotation mark as
described in rule 3.
+
diff --git a/Doc/library/sunau.rst b/Doc/library/sunau.rst
index fc141e9eeb..4bdb99bea6 100644
--- a/Doc/library/sunau.rst
+++ b/Doc/library/sunau.rst
@@ -5,6 +5,9 @@
:synopsis: Provide an interface to the Sun AU sound format.
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
+**Source code:** :source:`Lib/sunau.py`
+
+--------------
The :mod:`sunau` module provides a convenient interface to the Sun AU sound
format. Note that this module is interface-compatible with the modules
diff --git a/Doc/library/symbol.rst b/Doc/library/symbol.rst
index 5134d47269..75a47923a8 100644
--- a/Doc/library/symbol.rst
+++ b/Doc/library/symbol.rst
@@ -5,6 +5,9 @@
:synopsis: Constants representing internal nodes of the parse tree.
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/symbol.py`
+
+--------------
This module provides constants which represent the numeric values of internal
nodes of the parse tree. Unlike most Python constants, these use lower-case
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index bb9f920587..006905262b 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -10,6 +10,13 @@ interpreter and to functions that interact strongly with the interpreter. It is
always available.
+.. data:: abiflags
+
+ On POSIX systems where Python is build with the standard ``configure``
+ script, this contains the ABI flags as specified by :pep:`3149`.
+
+ .. versionadded:: 3.2
+
.. data:: argv
The list of command line arguments passed to a Python script. ``argv[0]`` is the
@@ -92,13 +99,39 @@ always available.
.. function:: displayhook(value)
- If *value* is not ``None``, this function prints it to ``sys.stdout``, and saves
- it in ``builtins._``.
+ If *value* is not ``None``, this function prints ``repr(value)`` to
+ ``sys.stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is
+ not encodable to ``sys.stdout.encoding`` with ``sys.stdout.errors`` error
+ handler (which is probably ``'strict'``), encode it to
+ ``sys.stdout.encoding`` with ``'backslashreplace'`` error handler.
``sys.displayhook`` is called on the result of evaluating an :term:`expression`
entered in an interactive Python session. The display of these values can be
customized by assigning another one-argument function to ``sys.displayhook``.
+ Pseudo-code::
+
+ def displayhook(value):
+ if value is None:
+ return
+ # Set '_' to None to avoid recursion
+ builtins._ = None
+ text = repr(value)
+ try:
+ sys.stdout.write(text)
+ except UnicodeEncodeError:
+ bytes = text.encode(sys.stdout.encoding, 'backslashreplace')
+ if hasattr(sys.stdout, 'buffer'):
+ sys.stdout.buffer.write(bytes)
+ else:
+ text = bytes.decode(sys.stdout.encoding, 'strict')
+ sys.stdout.write(text)
+ sys.stdout.write("\n")
+ builtins._ = value
+
+ .. versionchanged:: 3.2
+ Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`.
+
.. function:: excepthook(type, value, traceback)
@@ -220,8 +253,12 @@ always available.
:const:`ignore_environment` :option:`-E`
:const:`verbose` :option:`-v`
:const:`bytes_warning` :option:`-b`
+ :const:`quiet` :option:`-q`
============================= =============================
+ .. versionchanged:: 3.2
+ Added ``quiet`` attribute for the new :option:`-q` flag.
+
.. data:: float_info
@@ -303,6 +340,9 @@ always available.
Return the interpreter's "check interval"; see :func:`setcheckinterval`.
+ .. deprecated:: 3.2
+ Use :func:`getswitchinterval` instead.
+
.. function:: getdefaultencoding()
@@ -312,22 +352,20 @@ always available.
.. function:: getdlopenflags()
- Return the current value of the flags that are used for :cfunc:`dlopen` calls.
+ Return the current value of the flags that are used for :c:func:`dlopen` calls.
The flag constants are defined in the :mod:`ctypes` and :mod:`DLFCN` modules.
Availability: Unix.
.. function:: getfilesystemencoding()
- Return the name of the encoding used to convert Unicode filenames into system
- file names, or ``None`` if the system default encoding is used. The result value
- depends on the operating system:
+ Return the name of the encoding used to convert Unicode filenames into
+ system file names. The result value depends on the operating system:
* On Mac OS X, the encoding is ``'utf-8'``.
* On Unix, the encoding is the user's preference according to the result of
- nl_langinfo(CODESET), or ``None`` if the ``nl_langinfo(CODESET)``
- failed.
+ nl_langinfo(CODESET), or ``'utf-8'`` if ``nl_langinfo(CODESET)`` failed.
* On Windows NT+, file names are Unicode natively, so no conversion is
performed. :func:`getfilesystemencoding` still returns ``'mbcs'``, as
@@ -337,6 +375,10 @@ always available.
* On Windows 9x, the encoding is ``'mbcs'``.
+ .. versionchanged:: 3.2
+ On Unix, use ``'utf-8'`` instead of ``None`` if ``nl_langinfo(CODESET)``
+ failed. :func:`getfilesystemencoding` result cannot be ``None``.
+
.. function:: getrefcount(object)
@@ -367,6 +409,17 @@ always available.
additional garbage collector overhead if the object is managed by the garbage
collector.
+ See `recursive sizeof recipe <http://code.activestate.com/recipes/577504>`_
+ for an example of using :func:`getsizeof` recursively to find the size of
+ containers and all their contents.
+
+.. function:: getswitchinterval()
+
+ Return the interpreter's "thread switch interval"; see
+ :func:`setswitchinterval`.
+
+ .. versionadded:: 3.2
+
.. function:: _getframe([depth])
@@ -408,9 +461,15 @@ always available.
.. function:: getwindowsversion()
- Return a tuple containing five components, describing the Windows version
- currently running. The elements are *major*, *minor*, *build*, *platform*, and
- *text*. *text* contains a string while all other values are integers.
+ Return a named tuple describing the Windows version
+ currently running. The named elements are *major*, *minor*,
+ *build*, *platform*, *service_pack*, *service_pack_minor*,
+ *service_pack_major*, *suite_mask*, and *product_type*.
+ *service_pack* contains a string while all other values are
+ integers. The components can also be accessed by name, so
+ ``sys.getwindowsversion()[0]`` is equivalent to
+ ``sys.getwindowsversion().major``. For compatibility with prior
+ versions, only the first 5 elements are retrievable by indexing.
*platform* may be one of the following values:
@@ -426,11 +485,54 @@ always available.
| :const:`3 (VER_PLATFORM_WIN32_CE)` | Windows CE |
+-----------------------------------------+-------------------------+
- This function wraps the Win32 :cfunc:`GetVersionEx` function; see the Microsoft
- documentation for more information about these fields.
+ *product_type* may be one of the following values:
+
+ +---------------------------------------+---------------------------------+
+ | Constant | Meaning |
+ +=======================================+=================================+
+ | :const:`1 (VER_NT_WORKSTATION)` | The system is a workstation. |
+ +---------------------------------------+---------------------------------+
+ | :const:`2 (VER_NT_DOMAIN_CONTROLLER)` | The system is a domain |
+ | | controller. |
+ +---------------------------------------+---------------------------------+
+ | :const:`3 (VER_NT_SERVER)` | The system is a server, but not |
+ | | a domain controller. |
+ +---------------------------------------+---------------------------------+
+
+
+ This function wraps the Win32 :c:func:`GetVersionEx` function; see the
+ Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information
+ about these fields.
Availability: Windows.
+ .. versionchanged:: 3.2
+ Changed to a named tuple and added *service_pack_minor*,
+ *service_pack_major*, *suite_mask*, and *product_type*.
+
+
+.. data:: hash_info
+
+ A structseq giving parameters of the numeric hash implementation. For
+ more details about hashing of numeric types, see :ref:`numeric-hash`.
+
+ +---------------------+--------------------------------------------------+
+ | attribute | explanation |
+ +=====================+==================================================+
+ | :const:`width` | width in bits used for hash values |
+ +---------------------+--------------------------------------------------+
+ | :const:`modulus` | prime modulus P used for numeric hash scheme |
+ +---------------------+--------------------------------------------------+
+ | :const:`inf` | hash value returned for a positive infinity |
+ +---------------------+--------------------------------------------------+
+ | :const:`nan` | hash value returned for a nan |
+ +---------------------+--------------------------------------------------+
+ | :const:`imag` | multiplier used for the imaginary part of a |
+ | | complex number |
+ +---------------------+--------------------------------------------------+
+
+ .. versionadded:: 3.2
+
.. data:: hexversion
@@ -525,7 +627,7 @@ always available.
.. data:: maxsize
- An integer giving the maximum value a variable of type :ctype:`Py_ssize_t` can
+ An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` can
take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` on a
64-bit platform.
@@ -544,7 +646,7 @@ always available.
imported. The :meth:`find_module` method is called at least with the
absolute name of the module being imported. If the module to be imported is
contained in package then the parent package's :attr:`__path__` attribute
- is passed in as a second argument. The method returns :keyword:`None` if
+ is passed in as a second argument. The method returns ``None`` if
the module cannot be found, else returns a :term:`loader`.
:data:`sys.meta_path` is searched before any implicit default finders or
@@ -597,7 +699,7 @@ always available.
A dictionary acting as a cache for :term:`finder` objects. The keys are
paths that have been passed to :data:`sys.path_hooks` and the values are
the finders that are found. If a path is a valid file system path but no
- explicit finder is found on :data:`sys.path_hooks` then :keyword:`None` is
+ explicit finder is found on :data:`sys.path_hooks` then ``None`` is
stored to represent the implicit default finder should be used. If the path
is not an existing path then :class:`imp.NullImporter` is set.
@@ -622,7 +724,6 @@ always available.
Mac OS X ``'darwin'``
OS/2 ``'os2'``
OS/2 EMX ``'os2emx'``
- AtheOS ``'atheos'``
================ ===========================
@@ -671,22 +772,15 @@ always available.
performance for programs using threads. Setting it to a value ``<=`` 0 checks
every virtual instruction, maximizing responsiveness as well as overhead.
-
-.. function:: setdefaultencoding(name)
-
- Set the current default string encoding used by the Unicode implementation. If
- *name* does not match any available encoding, :exc:`LookupError` is raised.
- This function is only intended to be used by the :mod:`site` module
- implementation and, where needed, by :mod:`sitecustomize`. Once used by the
- :mod:`site` module, it is removed from the :mod:`sys` module's namespace.
-
- .. Note that :mod:`site` is not imported if the :option:`-S` option is passed
- to the interpreter, in which case this function will remain available.
+ .. deprecated:: 3.2
+ This function doesn't have an effect anymore, as the internal logic for
+ thread switching and asynchronous tasks has been rewritten. Use
+ :func:`setswitchinterval` instead.
.. function:: setdlopenflags(n)
- Set the flags used by the interpreter for :cfunc:`dlopen` calls, such as when
+ Set the flags used by the interpreter for :c:func:`dlopen` calls, such as when
the interpreter loads extension modules. Among other things, this will enable a
lazy resolving of symbols when importing a module, if called as
``sys.setdlopenflags(0)``. To share symbols across extension modules, call as
@@ -696,15 +790,6 @@ always available.
:file:`/usr/include/dlfcn.h` using the :program:`h2py` script. Availability:
Unix.
-.. function:: setfilesystemencoding(enc)
-
- Set the encoding used when converting Python strings to file names to *enc*.
- By default, Python tries to determine the encoding it should use automatically
- on Unix; on Windows, it avoids such conversion completely. This function can
- be used when Python's determination of the encoding needs to be overwritten,
- e.g. when not all file names on disk can be decoded using the encoding that
- Python had chosen.
-
.. function:: setprofile(profilefunc)
.. index::
@@ -734,6 +819,19 @@ always available.
limit can lead to a crash.
+.. function:: setswitchinterval(interval)
+
+ Set the interpreter's thread switch interval (in seconds). This floating-point
+ value determines the ideal duration of the "timeslices" allocated to
+ concurrently running Python threads. Please note that the actual value
+ can be higher, especially if long-running internal functions or methods
+ are used. Also, which thread becomes scheduled at the end of the interval
+ is the operating system's decision. The interpreter doesn't have its
+ own scheduler.
+
+ .. versionadded:: 3.2
+
+
.. function:: settrace(tracefunc)
.. index::
@@ -766,9 +864,11 @@ always available.
specifies the local trace function.
``'line'``
- The interpreter is about to execute a new line of code (sometimes multiple
- line events on one line exist). The local trace function is called; *arg*
- is ``None``; the return value specifies the new local trace function.
+ The interpreter is about to execute a new line of code or re-execute the
+ condition of a loop. The local trace function is called; *arg* is
+ ``None``; the return value specifies the new local trace function. See
+ :file:`Objects/lnotab_notes.txt` for a detailed explanation of how this
+ works.
``'return'``
A function (or other code block) is about to return. The local trace
@@ -811,6 +911,10 @@ always available.
available only if Python was compiled with ``--with-tsc``. To understand
the output of this dump, read :file:`Python/ceval.c` in the Python sources.
+ .. impl-detail::
+ This function is intimately bound to CPython implementation details and
+ thus not likely to be implemented elsewhere.
+
.. data:: stdin
stdout
@@ -917,6 +1021,30 @@ always available.
module for informational purposes; modifying this value has no effect on the
registry keys used by Python. Availability: Windows.
+
+.. data:: _xoptions
+
+ A dictionary of the various implementation-specific flags passed through
+ the :option:`-X` command-line option. Option names are either mapped to
+ their values, if given explicitly, or to :const:`True`. Example::
+
+ $ ./python -Xa=b -Xc
+ Python 3.2a3+ (py3k, Oct 16 2010, 20:14:50)
+ [GCC 4.4.3] on linux2
+ Type "help", "copyright", "credits" or "license" for more information.
+ >>> import sys
+ >>> sys._xoptions
+ {'a': 'b', 'c': True}
+
+ .. impl-detail::
+
+ This is a CPython-specific way of accessing options passed through
+ :option:`-X`. Other implementations may export them through other
+ means, or not at all.
+
+ .. versionadded:: 3.2
+
+
.. rubric:: Citations
.. [C99] ISO/IEC 9899:1999. "Programming languages -- C." A public draft of this standard is available at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf .
diff --git a/Doc/library/sysconfig.rst b/Doc/library/sysconfig.rst
new file mode 100644
index 0000000000..1e89bd02ee
--- /dev/null
+++ b/Doc/library/sysconfig.rst
@@ -0,0 +1,259 @@
+:mod:`sysconfig` --- Provide access to Python's configuration information
+=========================================================================
+
+.. module:: sysconfig
+ :synopsis: Python's configuration information
+.. moduleauthor:: Tarek Ziade <tarek@ziade.org>
+.. sectionauthor:: Tarek Ziade <tarek@ziade.org>
+.. index::
+ single: configuration information
+
+**Source code:** :source:`Lib/sysconfig.py`
+
+.. versionadded:: 3.2
+
+--------------
+
+The :mod:`sysconfig` module provides access to Python's configuration
+information like the list of installation paths and the configuration variables
+relevant for the current platform.
+
+Configuration variables
+-----------------------
+
+A Python distribution contains a :file:`Makefile` and a :file:`pyconfig.h`
+header file that are necessary to build both the Python binary itself and
+third-party C extensions compiled using :mod:`distutils`.
+
+:mod:`sysconfig` puts all variables found in these files in a dictionary that
+can be accessed using :func:`get_config_vars` or :func:`get_config_var`.
+
+Notice that on Windows, it's a much smaller set.
+
+.. function:: get_config_vars(\*args)
+
+ With no arguments, return a dictionary of all configuration variables
+ relevant for the current platform.
+
+ With arguments, return a list of values that result from looking up each
+ argument in the configuration variable dictionary.
+
+ For each argument, if the value is not found, return ``None``.
+
+
+.. function:: get_config_var(name)
+
+ Return the value of a single variable *name*. Equivalent to
+ ``get_config_vars().get(name)``.
+
+ If *name* is not found, return ``None``.
+
+Example of usage::
+
+ >>> import sysconfig
+ >>> sysconfig.get_config_var('Py_ENABLE_SHARED')
+ 0
+ >>> sysconfig.get_config_var('LIBDIR')
+ '/usr/local/lib'
+ >>> sysconfig.get_config_vars('AR', 'CXX')
+ ['ar', 'g++']
+
+
+Installation paths
+------------------
+
+Python uses an installation scheme that differs depending on the platform and on
+the installation options. These schemes are stored in :mod:`sysconfig` under
+unique identifiers based on the value returned by :const:`os.name`.
+
+Every new component that is installed using :mod:`distutils` or a
+Distutils-based system will follow the same scheme to copy its file in the right
+places.
+
+Python currently supports seven schemes:
+
+- *posix_prefix*: scheme for Posix platforms like Linux or Mac OS X. This is
+ the default scheme used when Python or a component is installed.
+- *posix_home*: scheme for Posix platforms used when a *home* option is used
+ upon installation. This scheme is used when a component is installed through
+ Distutils with a specific home prefix.
+- *posix_user*: scheme for Posix platforms used when a component is installed
+ through Distutils and the *user* option is used. This scheme defines paths
+ located under the user home directory.
+- *nt*: scheme for NT platforms like Windows.
+- *nt_user*: scheme for NT platforms, when the *user* option is used.
+- *os2*: scheme for OS/2 platforms.
+- *os2_home*: scheme for OS/2 patforms, when the *user* option is used.
+
+Each scheme is itself composed of a series of paths and each path has a unique
+identifier. Python currently uses eight paths:
+
+- *stdlib*: directory containing the standard Python library files that are not
+ platform-specific.
+- *platstdlib*: directory containing the standard Python library files that are
+ platform-specific.
+- *platlib*: directory for site-specific, platform-specific files.
+- *purelib*: directory for site-specific, non-platform-specific files.
+- *include*: directory for non-platform-specific header files.
+- *platinclude*: directory for platform-specific header files.
+- *scripts*: directory for script files.
+- *data*: directory for data files.
+
+:mod:`sysconfig` provides some functions to determine these paths.
+
+.. function:: get_scheme_names()
+
+ Return a tuple containing all schemes currently supported in
+ :mod:`sysconfig`.
+
+
+.. function:: get_path_names()
+
+ Return a tuple containing all path names currently supported in
+ :mod:`sysconfig`.
+
+
+.. function:: get_path(name, [scheme, [vars, [expand]]])
+
+ Return an installation path corresponding to the path *name*, from the
+ install scheme named *scheme*.
+
+ *name* has to be a value from the list returned by :func:`get_path_names`.
+
+ :mod:`sysconfig` stores installation paths corresponding to each path name,
+ for each platform, with variables to be expanded. For instance the *stdlib*
+ path for the *nt* scheme is: ``{base}/Lib``.
+
+ :func:`get_path` will use the variables returned by :func:`get_config_vars`
+ to expand the path. All variables have default values for each platform so
+ one may call this function and get the default value.
+
+ If *scheme* is provided, it must be a value from the list returned by
+ :func:`get_path_names`. Otherwise, the default scheme for the current
+ platform is used.
+
+ If *vars* is provided, it must be a dictionary of variables that will update
+ the dictionary return by :func:`get_config_vars`.
+
+ If *expand* is set to ``False``, the path will not be expanded using the
+ variables.
+
+ If *name* is not found, return ``None``.
+
+
+.. function:: get_paths([scheme, [vars, [expand]]])
+
+ Return a dictionary containing all installation paths corresponding to an
+ installation scheme. See :func:`get_path` for more information.
+
+ If *scheme* is not provided, will use the default scheme for the current
+ platform.
+
+ If *vars* is provided, it must be a dictionary of variables that will
+ update the dictionary used to expand the paths.
+
+ If *expand* is set to False, the paths will not be expanded.
+
+ If *scheme* is not an existing scheme, :func:`get_paths` will raise a
+ :exc:`KeyError`.
+
+
+Other functions
+---------------
+
+.. function:: get_python_version()
+
+ Return the ``MAJOR.MINOR`` Python version number as a string. Similar to
+ ``sys.version[:3]``.
+
+
+.. function:: get_platform()
+
+ Return a string that identifies the current platform.
+
+ This is used mainly to distinguish platform-specific build directories and
+ platform-specific built distributions. Typically includes the OS name and
+ version and the architecture (as supplied by :func:`os.uname`), although the
+ exact information included depends on the OS; e.g. for IRIX the architecture
+ isn't particularly important (IRIX only runs on SGI hardware), but for Linux
+ the kernel version isn't particularly important.
+
+ Examples of returned values:
+
+ - linux-i586
+ - linux-alpha (?)
+ - solaris-2.6-sun4u
+ - irix-5.3
+ - irix64-6.2
+
+ Windows will return one of:
+
+ - win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
+ - win-ia64 (64bit Windows on Itanium)
+ - win32 (all others - specifically, sys.platform is returned)
+
+ Mac OS X can return:
+
+ - macosx-10.6-ppc
+ - macosx-10.4-ppc64
+ - macosx-10.3-i386
+ - macosx-10.4-fat
+
+ For other non-POSIX platforms, currently just returns :data:`sys.platform`.
+
+
+.. function:: is_python_build()
+
+ Return ``True`` if the current Python installation was built from source.
+
+
+.. function:: parse_config_h(fp[, vars])
+
+ Parse a :file:`config.h`\-style file.
+
+ *fp* is a file-like object pointing to the :file:`config.h`\-like file.
+
+ A dictionary containing name/value pairs is returned. If an optional
+ dictionary is passed in as the second argument, it is used instead of a new
+ dictionary, and updated with the values read in the file.
+
+
+.. function:: get_config_h_filename()
+
+ Return the path of :file:`pyconfig.h`.
+
+.. function:: get_makefile_filename()
+
+ Return the path of :file:`Makefile`.
+
+Using :mod:`sysconfig` as a script
+----------------------------------
+
+You can use :mod:`sysconfig` as a script with Python's *-m* option::
+
+ $ python -m sysconfig
+ Platform: "macosx-10.4-i386"
+ Python version: "3.2"
+ Current installation scheme: "posix_prefix"
+
+ Paths:
+ data = "/usr/local"
+ include = "/Users/tarek/Dev/svn.python.org/py3k/Include"
+ platinclude = "."
+ platlib = "/usr/local/lib/python3.2/site-packages"
+ platstdlib = "/usr/local/lib/python3.2"
+ purelib = "/usr/local/lib/python3.2/site-packages"
+ scripts = "/usr/local/bin"
+ stdlib = "/usr/local/lib/python3.2"
+
+ Variables:
+ AC_APPLE_UNIVERSAL_BUILD = "0"
+ AIX_GENUINE_CPLUSPLUS = "0"
+ AR = "ar"
+ ARFLAGS = "rc"
+ ASDLGEN = "./Parser/asdl_c.py"
+ ...
+
+This call will print in the standard output the information returned by
+:func:`get_platform`, :func:`get_python_version`, :func:`get_path` and
+:func:`get_config_vars`.
diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst
index 89dd38f4fc..a3b374a233 100644
--- a/Doc/library/syslog.rst
+++ b/Doc/library/syslog.rst
@@ -10,42 +10,63 @@ This module provides an interface to the Unix ``syslog`` library routines.
Refer to the Unix manual pages for a detailed description of the ``syslog``
facility.
+This module wraps the system ``syslog`` family of routines. A pure Python
+library that can speak to a syslog server is available in the
+:mod:`logging.handlers` module as :class:`SysLogHandler`.
+
The module defines the following functions:
.. function:: syslog([priority,] message)
- Send the string *message* to the system logger. A trailing newline is added if
- necessary. Each message is tagged with a priority composed of a *facility* and
- a *level*. The optional *priority* argument, which defaults to
- :const:`LOG_INFO`, determines the message priority. If the facility is not
- encoded in *priority* using logical-or (``LOG_INFO | LOG_USER``), the value
- given in the :func:`openlog` call is used.
+ Send the string *message* to the system logger. A trailing newline is added
+ if necessary. Each message is tagged with a priority composed of a
+ *facility* and a *level*. The optional *priority* argument, which defaults
+ to :const:`LOG_INFO`, determines the message priority. If the facility is
+ not encoded in *priority* using logical-or (``LOG_INFO | LOG_USER``), the
+ value given in the :func:`openlog` call is used.
+
+ If :func:`openlog` has not been called prior to the call to :func:`syslog`,
+ ``openlog()`` will be called with no arguments.
+
+.. function:: openlog([ident[, logopt[, facility]]])
-.. function:: openlog(ident[, logopt[, facility]])
+ Logging options of subsequent :func:`syslog` calls can be set by calling
+ :func:`openlog`. :func:`syslog` will call :func:`openlog` with no arguments
+ if the log is not currently open.
- Logging options other than the defaults can be set by explicitly opening the log
- file with :func:`openlog` prior to calling :func:`syslog`. The defaults are
- (usually) *ident* = ``'syslog'``, *logopt* = ``0``, *facility* =
- :const:`LOG_USER`. The *ident* argument is a string which is prepended to every
- message. The optional *logopt* argument is a bit field - see below for possible
- values to combine. The optional *facility* argument sets the default facility
- for messages which do not have a facility explicitly encoded.
+ The optional *ident* keyword argument is a string which is prepended to every
+ message, and defaults to ``sys.argv[0]`` with leading path components
+ stripped. The optional *logopt* keyword argument (default is 0) is a bit
+ field -- see below for possible values to combine. The optional *facility*
+ keyword argument (default is :const:`LOG_USER`) sets the default facility for
+ messages which do not have a facility explicitly encoded.
+
+ .. versionchanged:: 3.2
+ In previous versions, keyword arguments were not allowed, and *ident* was
+ required. The default for *ident* was dependent on the system libraries,
+ and often was ``python`` instead of the name of the python program file.
.. function:: closelog()
- Close the log file.
+ Reset the syslog module values and call the system library ``closelog()``.
+
+ This causes the module to behave as it does when initially imported. For
+ example, :func:`openlog` will be called on the first :func:`syslog` call (if
+ :func:`openlog` hasn't already been called), and *ident* and other
+ :func:`openlog` parameters are reset to defaults.
.. function:: setlogmask(maskpri)
- Set the priority mask to *maskpri* and return the previous mask value. Calls to
- :func:`syslog` with a priority level not set in *maskpri* are ignored. The
- default is to log all priorities. The function ``LOG_MASK(pri)`` calculates the
- mask for the individual priority *pri*. The function ``LOG_UPTO(pri)``
- calculates the mask for all priorities up to and including *pri*.
+ Set the priority mask to *maskpri* and return the previous mask value. Calls
+ to :func:`syslog` with a priority level not set in *maskpri* are ignored.
+ The default is to log all priorities. The function ``LOG_MASK(pri)``
+ calculates the mask for the individual priority *pri*. The function
+ ``LOG_UPTO(pri)`` calculates the mask for all priorities up to and including
+ *pri*.
The module defines the following constants:
@@ -63,3 +84,24 @@ Log options:
:const:`LOG_PID`, :const:`LOG_CONS`, :const:`LOG_NDELAY`, :const:`LOG_NOWAIT`
and :const:`LOG_PERROR` if defined in ``<syslog.h>``.
+
+Examples
+--------
+
+Simple example
+~~~~~~~~~~~~~~
+
+A simple set of examples::
+
+ import syslog
+
+ syslog.syslog('Processing started')
+ if error:
+ syslog.syslog(syslog.LOG_ERR, 'Processing started')
+
+An example of setting some log options, these would include the process ID in
+logged messages, and write the messages to the destination facility used for
+mail logging::
+
+ syslog.openlog(logopt=syslog.LOG_PID, facility=syslog.LOG_MAIL)
+ syslog.syslog('E-mail processing initiated...')
diff --git a/Doc/library/tabnanny.rst b/Doc/library/tabnanny.rst
index 549ce368b7..4f3e705cab 100644
--- a/Doc/library/tabnanny.rst
+++ b/Doc/library/tabnanny.rst
@@ -9,6 +9,10 @@
.. rudimentary documentation based on module comments
+**Source code:** :source:`Lib/tabnanny.py`
+
+--------------
+
For the time being this module is intended to be called as a script. However it
is possible to import it into an IDE and use the function :func:`check`
described below.
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index d5a511eaaf..9b7071bf69 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -8,6 +8,9 @@
.. moduleauthor:: Lars Gustäbel <lars@gustaebel.de>
.. sectionauthor:: Lars Gustäbel <lars@gustaebel.de>
+**Source code:** :source:`Lib/tarfile.py`
+
+--------------
The :mod:`tarfile` module makes it possible to read and write tar
archives, including those using gzip or bz2 compression.
@@ -20,7 +23,8 @@ Some facts and figures:
* read/write support for the POSIX.1-1988 (ustar) format.
* read/write support for the GNU tar format including *longname* and *longlink*
- extensions, read-only support for the *sparse* extension.
+ extensions, read-only support for all variants of the *sparse* extension
+ including restoration of sparse files.
* read/write support for the POSIX.1-2001 (pax) format.
@@ -185,8 +189,8 @@ The following variables are available on module level:
.. data:: ENCODING
- The default character encoding i.e. the value from either
- :func:`sys.getfilesystemencoding` or :func:`sys.getdefaultencoding`.
+ The default character encoding: ``'utf-8'`` on Windows,
+ :func:`sys.getfilesystemencoding` otherwise.
.. seealso::
@@ -209,8 +213,16 @@ a header block followed by data blocks. It is possible to store a file in a tar
archive several times. Each archive member is represented by a :class:`TarInfo`
object, see :ref:`tarinfo-objects` for details.
+A :class:`TarFile` object can be used as a context manager in a :keyword:`with`
+statement. It will automatically be closed when the block is completed. Please
+note that in the event of an exception an archive opened for writing will not
+be finalized; only the internally used file object will be closed. See the
+:ref:`tar-examples` section for a use case.
-.. class:: TarFile(name=None, mode='r', fileobj=None, format=DEFAULT_FORMAT, tarinfo=TarInfo, dereference=False, ignore_zeros=False, encoding=ENCODING, errors=None, pax_headers=None, debug=0, errorlevel=0)
+.. versionadded:: 3.2
+ Added support for the context manager protocol.
+
+.. class:: TarFile(name=None, mode='r', fileobj=None, format=DEFAULT_FORMAT, tarinfo=TarInfo, dereference=False, ignore_zeros=False, encoding=ENCODING, errors='surrogateescape', pax_headers=None, debug=0, errorlevel=0)
All following arguments are optional and can be accessed as instance attributes
as well.
@@ -259,6 +271,9 @@ object, see :ref:`tarinfo-objects` for details.
to be handled. The default settings will work for most users.
See section :ref:`tar-unicode` for in-depth information.
+ .. versionchanged:: 3.2
+ Use ``'surrogateescape'`` as the default for the *errors* argument.
+
The *pax_headers* argument is an optional dictionary of strings which
will be added as a pax global header if *format* is :const:`PAX_FORMAT`.
@@ -324,12 +339,13 @@ object, see :ref:`tarinfo-objects` for details.
dots ``".."``.
-.. method:: TarFile.extract(member, path="")
+.. method:: TarFile.extract(member, path="", set_attrs=True)
Extract a member from the archive to the current working directory, using its
full name. Its file information is extracted as accurately as possible. *member*
may be a filename or a :class:`TarInfo` object. You can specify a different
- directory using *path*.
+ directory using *path*. File attributes (owner, mtime, mode) are set unless
+ *set_attrs* is False.
.. note::
@@ -340,6 +356,8 @@ object, see :ref:`tarinfo-objects` for details.
See the warning for :meth:`extractall`.
+ .. versionchanged:: 3.2
+ Added the *set_attrs* parameter.
.. method:: TarFile.extractfile(member)
@@ -355,15 +373,27 @@ object, see :ref:`tarinfo-objects` for details.
and :meth:`close`, and also supports iteration over its lines.
-.. method:: TarFile.add(name, arcname=None, recursive=True, exclude=None)
+.. method:: TarFile.add(name, arcname=None, recursive=True, exclude=None, *, filter=None)
- Add the file *name* to the archive. *name* may be any type of file (directory,
- fifo, symbolic link, etc.). If given, *arcname* specifies an alternative name
- for the file in the archive. Directories are added recursively by default. This
- can be avoided by setting *recursive* to :const:`False`. If *exclude* is given,
- it must be a function that takes one filename argument and returns a boolean
- value. Depending on this value the respective file is either excluded
- (:const:`True`) or added (:const:`False`).
+ Add the file *name* to the archive. *name* may be any type of file
+ (directory, fifo, symbolic link, etc.). If given, *arcname* specifies an
+ alternative name for the file in the archive. Directories are added
+ recursively by default. This can be avoided by setting *recursive* to
+ :const:`False`. If *exclude* is given, it must be a function that takes one
+ filename argument and returns a boolean value. Depending on this value the
+ respective file is either excluded (:const:`True`) or added
+ (:const:`False`). If *filter* is specified it must be a keyword argument. It
+ should be a function that takes a :class:`TarInfo` object argument and
+ returns the changed :class:`TarInfo` object. If it instead returns
+ :const:`None` the :class:`TarInfo` object will be excluded from the
+ archive. See :ref:`tar-examples` for an example.
+
+ .. versionchanged:: 3.2
+ Added the *filter* parameter.
+
+ .. deprecated:: 3.2
+ The *exclude* parameter is deprecated, please use the *filter* parameter
+ instead.
.. method:: TarFile.addfile(tarinfo, fileobj=None)
@@ -430,11 +460,14 @@ It does *not* contain the file's data itself.
a :class:`TarInfo` object.
-.. method:: TarInfo.tobuf(format=DEFAULT_FORMAT, encoding=ENCODING, errors='strict')
+.. method:: TarInfo.tobuf(format=DEFAULT_FORMAT, encoding=ENCODING, errors='surrogateescape')
Create a string buffer from a :class:`TarInfo` object. For information on the
arguments see the constructor of the :class:`TarFile` class.
+ .. versionchanged:: 3.2
+ Use ``'surrogateescape'`` as the default for the *errors* argument.
+
A ``TarInfo`` object has the following public data attributes:
@@ -582,6 +615,13 @@ How to create an uncompressed tar archive from a list of filenames::
tar.add(name)
tar.close()
+The same example using the :keyword:`with` statement::
+
+ import tarfile
+ with tarfile.open("sample.tar", "w") as tar:
+ for name in ["foo", "bar", "quux"]:
+ tar.add(name)
+
How to read a gzip compressed tar archive and display some member information::
import tarfile
@@ -596,6 +636,18 @@ How to read a gzip compressed tar archive and display some member information::
print("something else.")
tar.close()
+How to create an archive and reset the user information using the *filter*
+parameter in :meth:`TarFile.add`::
+
+ import tarfile
+ def reset(tarinfo):
+ tarinfo.uid = tarinfo.gid = 0
+ tarinfo.uname = tarinfo.gname = "root"
+ return tarinfo
+ tar = tarfile.open("sample.tar.gz", "w:gz")
+ tar.add("foo", filter=reset)
+ tar.close()
+
.. _tar-formats:
@@ -663,11 +715,12 @@ metadata must be either decoded or encoded. If *encoding* is not set
appropriately, this conversion may fail.
The *errors* argument defines how characters are treated that cannot be
-converted. Possible values are listed in section :ref:`codec-base-classes`. In
-read mode the default scheme is ``'replace'``. This avoids unexpected
-:exc:`UnicodeError` exceptions and guarantees that an archive can always be
-read. In write mode the default value for *errors* is ``'strict'``. This
-ensures that name information is not altered unnoticed.
-
-In case of writing :const:`PAX_FORMAT` archives, *encoding* is ignored because
-non-ASCII metadata is stored using *UTF-8*.
+converted. Possible values are listed in section :ref:`codec-base-classes`.
+The default scheme is ``'surrogateescape'`` which Python also uses for its
+file system calls, see :ref:`os-filenames`.
+
+In case of :const:`PAX_FORMAT` archives, *encoding* is generally not needed
+because all the metadata is stored using *UTF-8*. *encoding* is only used in
+the rare cases when binary pax headers are decoded or when strings with
+surrogate characters are stored.
+
diff --git a/Doc/library/telnetlib.rst b/Doc/library/telnetlib.rst
index 6e3abdea4d..646634db7c 100644
--- a/Doc/library/telnetlib.rst
+++ b/Doc/library/telnetlib.rst
@@ -8,6 +8,10 @@
.. index:: single: protocol; Telnet
+**Source code:** :source:`Lib/telnetlib.py`
+
+--------------
+
The :mod:`telnetlib` module provides a :class:`Telnet` class that implements the
Telnet protocol. See :rfc:`854` for details about the protocol. In addition, it
provides symbolic constants for the protocol characters (see below), and for the
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
index a13df0dd22..01092fc5eb 100644
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -12,6 +12,10 @@
pair: temporary; file name
pair: temporary; file
+**Source code:** :source:`Lib/tempfile.py`
+
+--------------
+
This module generates temporary files and directories. It works on all
supported platforms. It provides three new functions,
:func:`NamedTemporaryFile`, :func:`mkstemp`, and :func:`mkdtemp`, which should
@@ -25,7 +29,7 @@ no longer necessary to use the global *tempdir* and *template* variables.
To maintain backward compatibility, the argument order is somewhat odd; it
is recommended to use keyword arguments for clarity.
-The module defines the following user-callable functions:
+The module defines the following user-callable items:
.. function:: TemporaryFile(mode='w+b', buffering=None, encoding=None, newline=None, suffix='', prefix='tmp', dir=None)
@@ -83,6 +87,24 @@ The module defines the following user-callable functions:
used in a :keyword:`with` statement, just like a normal file.
+.. function:: TemporaryDirectory(suffix='', prefix='tmp', dir=None)
+
+ This function creates a temporary directory using :func:`mkdtemp`
+ (the supplied arguments are passed directly to the underlying function).
+ The resulting object can be used as a context manager (see
+ :ref:`context-managers`). On completion of the context (or destruction
+ of the temporary directory object), the newly created temporary directory
+ and all its contents are removed from the filesystem.
+
+ The directory name can be retrieved from the :attr:`name` member
+ of the returned object.
+
+ The directory can be explicitly cleaned up by calling the
+ :func:`cleanup` method.
+
+ .. versionadded:: 3.2
+
+
.. function:: mkstemp(suffix='', prefix='tmp', dir=None, text=False)
Creates a temporary file in the most secure manner possible. There are
@@ -210,3 +232,36 @@ the appropriate function arguments, instead.
Return the filename prefix used to create temporary files. This does not
contain the directory component.
+
+Examples
+--------
+
+Here are some examples of typical usage of the :mod:`tempfile` module::
+
+ >>> import tempfile
+
+ # create a temporary file and write some data to it
+ >>> fp = tempfile.TemporaryFile()
+ >>> fp.write(b'Hello world!')
+ # read data from file
+ >>> fp.seek(0)
+ >>> fp.read()
+ b'Hello world!'
+ # close the file, it will be removed
+ >>> fp.close()
+
+ # create a temporary file using a context manager
+ >>> with tempfile.TemporaryFile() as fp:
+ ... fp.write(b'Hello world!')
+ ... fp.seek(0)
+ ... fp.read()
+ b'Hello world!'
+ >>>
+ # file is now closed and removed
+
+ # create a temporary directory using the context manager
+ >>> with tempfile.TemporaryDirectory() as tmpdirname:
+ ... print('created temporary directory', tmpdirname)
+ >>>
+ # directory and contents have been removed
+
diff --git a/Doc/library/test.rst b/Doc/library/test.rst
index 12f4c13e1b..9d02b0a8c5 100644
--- a/Doc/library/test.rst
+++ b/Doc/library/test.rst
@@ -5,7 +5,7 @@
:synopsis: Regression tests package containing the testing suite for Python.
.. sectionauthor:: Brett Cannon <brett@python.org>
-.. warning::
+.. note::
The :mod:`test` package is meant for internal use by Python only. It is
documented for the benefit of the core developers of Python. Any use of
this package outside of Python's standard library is discouraged as code
@@ -96,17 +96,17 @@ The goal for regression testing is to try to break code. This leads to a few
guidelines to be followed:
* The testing suite should exercise all classes, functions, and constants. This
- includes not just the external API that is to be presented to the outside world
- but also "private" code.
+ includes not just the external API that is to be presented to the outside
+ world but also "private" code.
* Whitebox testing (examining the code being tested when the tests are being
written) is preferred. Blackbox testing (testing only the published user
- interface) is not complete enough to make sure all boundary and edge cases are
- tested.
+ interface) is not complete enough to make sure all boundary and edge cases
+ are tested.
* Make sure all possible values are tested including invalid ones. This makes
- sure that not only all valid values are acceptable but also that improper values
- are handled correctly.
+ sure that not only all valid values are acceptable but also that improper
+ values are handled correctly.
* Exhaust as many code paths as possible. Test where branching occurs and thus
tailor input to make sure as many different paths through the code are taken.
@@ -126,8 +126,8 @@ guidelines to be followed:
behavior from side-effects of importing a module.
* Try to maximize code reuse. On occasion, tests will vary by something as small
- as what type of input is used. Minimize code duplication by subclassing a basic
- test class with a class that specifies the input::
+ as what type of input is used. Minimize code duplication by subclassing a
+ basic test class with a class that specifies the input::
class TestFuncAcceptsSequences(unittest.TestCase):
@@ -137,13 +137,13 @@ guidelines to be followed:
self.func(self.arg)
class AcceptLists(TestFuncAcceptsSequences):
- arg = [1,2,3]
+ arg = [1, 2, 3]
class AcceptStrings(TestFuncAcceptsSequences):
arg = 'abc'
class AcceptTuples(TestFuncAcceptsSequences):
- arg = (1,2,3)
+ arg = (1, 2, 3)
.. seealso::
@@ -157,32 +157,34 @@ guidelines to be followed:
Running tests using the command-line interface
----------------------------------------------
-The :mod:`test.regrtest` module can be run as a script to drive Python's regression
-test suite, thanks to the :option:`-m` option: :program:`python -m test.regrtest`.
+The :mod:`test` package can be run as a script to drive Python's regression
+test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under
+the hood, it uses :mod:`test.regrtest`; the call :program:`python -m
+test.regrtest` used in previous Python versions still works).
Running the script by itself automatically starts running all regression
tests in the :mod:`test` package. It does this by finding all modules in the
package whose name starts with ``test_``, importing them, and executing the
-function :func:`test_main` if present. The names of tests to execute may also be
-passed to the script. Specifying a single regression test (:program:`python
--m test.regrtest test_spam`) will minimize output and only print whether
-the test passed or failed and thus minimize output.
-
-Running :mod:`test.regrtest` directly allows what resources are available for
-tests to use to be set. You do this by using the :option:`-u` command-line
-option. Run :program:`python -m test.regrtest -uall` to turn on all
+function :func:`test_main` if present. The names of tests to execute may also
+be passed to the script. Specifying a single regression test (:program:`python
+-m test test_spam`) will minimize output and only print
+whether the test passed or failed and thus minimize output.
+
+Running :mod:`test` directly allows what resources are available for
+tests to use to be set. You do this by using the ``-u`` command-line
+option. Run :program:`python -m test -uall` to turn on all
resources; specifying ``all`` as an option for ``-u`` enables all
possible resources. If all but one resource is desired (a more common case), a
comma-separated list of resources that are not desired may be listed after
-``all``. The command :program:`python -m test.regrtest -uall,-audio,-largefile`
-will run :mod:`test.regrtest` with all resources except the ``audio`` and
+``all``. The command :program:`python -m test -uall,-audio,-largefile`
+will run :mod:`test` with all resources except the ``audio`` and
``largefile`` resources. For a list of all resources and more command-line
-options, run :program:`python -m test.regrtest -h`.
+options, run :program:`python -m test -h`.
Some other ways to execute the regression tests depend on what platform the
tests are being executed on. On Unix, you can run :program:`make test` at the
-top-level directory where Python was built. On Windows, executing
-:program:`rt.bat` from your :file:`PCBuild` directory will run all regression
-tests.
+top-level directory where Python was built. On Windows,
+executing :program:`rt.bat` from your :file:`PCBuild` directory will run all
+regression tests.
:mod:`test.support` --- Utility functions for tests
@@ -205,17 +207,11 @@ This module defines the following exceptions:
methods.
-.. exception:: TestSkipped
-
- Subclass of :exc:`TestFailed`. Raised when a test is skipped. This occurs when a
- needed resource (such as a network connection) is not available at the time of
- testing.
-
-
.. exception:: ResourceDenied
- Subclass of :exc:`TestSkipped`. Raised when a resource (such as a network
- connection) is not available. Raised by the :func:`requires` function.
+ Subclass of :exc:`unittest.SkipTest`. Raised when a resource (such as a
+ network connection) is not available. Raised by the :func:`requires`
+ function.
The :mod:`test.support` module defines the following constants:
@@ -234,44 +230,45 @@ The :mod:`test.support` module defines the following constants:
.. data:: TESTFN
- Set to the path that a temporary file may be created at. Any temporary that is
- created should be closed and unlinked (removed).
+ Set to a name that is safe to use as the name of a temporary file. Any
+ temporary file that is created should be closed and unlinked (removed).
The :mod:`test.support` module defines the following functions:
.. function:: forget(module_name)
- Removes the module named *module_name* from ``sys.modules`` and deletes any
+ Remove the module named *module_name* from ``sys.modules`` and delete any
byte-compiled files of the module.
.. function:: is_resource_enabled(resource)
- Returns :const:`True` if *resource* is enabled and available. The list of
+ Return :const:`True` if *resource* is enabled and available. The list of
available resources is only set when :mod:`test.regrtest` is executing the
tests.
.. function:: requires(resource, msg=None)
- Raises :exc:`ResourceDenied` if *resource* is not available. *msg* is the
- argument to :exc:`ResourceDenied` if it is raised. Always returns true if called
- by a function whose ``__name__`` is ``'__main__'``. Used when tests are executed
- by :mod:`test.regrtest`.
+ Raise :exc:`ResourceDenied` if *resource* is not available. *msg* is the
+ argument to :exc:`ResourceDenied` if it is raised. Always returns
+ :const:`True` if called by a function whose ``__name__`` is ``'__main__'``.
+ Used when tests are executed by :mod:`test.regrtest`.
.. function:: findfile(filename)
- Return the path to the file named *filename*. If no match is found *filename* is
- returned. This does not equal a failure since it could be the path to the file.
+ Return the path to the file named *filename*. If no match is found
+ *filename* is returned. This does not equal a failure since it could be the
+ path to the file.
-.. function:: run_unittest(*classes)
+.. function:: run_unittest(\*classes)
Execute :class:`unittest.TestCase` subclasses passed to the function. The
- function scans the classes for methods starting with the prefix ``test_`` and
- executes the tests individually.
+ function scans the classes for methods starting with the prefix ``test_``
+ and executes the tests individually.
It is also legal to pass strings as parameters; these should be keys in
``sys.modules``. Each associated module will be scanned by
@@ -284,37 +281,72 @@ The :mod:`test.support` module defines the following functions:
This will run all tests defined in the named module.
-.. function:: check_warnings()
+.. function:: check_warnings(\*filters, quiet=True)
+
+ A convenience wrapper for :func:`warnings.catch_warnings()` that makes it
+ easier to test that a warning was correctly raised. It is approximately
+ equivalent to calling ``warnings.catch_warnings(record=True)`` with
+ :meth:`warnings.simplefilter` set to ``always`` and with the option to
+ automatically validate the results that are recorded.
+
+ ``check_warnings`` accepts 2-tuples of the form ``("message regexp",
+ WarningCategory)`` as positional arguments. If one or more *filters* are
+ provided, or if the optional keyword argument *quiet* is :const:`False`,
+ it checks to make sure the warnings are as expected: each specified filter
+ must match at least one of the warnings raised by the enclosed code or the
+ test fails, and if any warnings are raised that do not match any of the
+ specified filters the test fails. To disable the first of these checks,
+ set *quiet* to :const:`True`.
+
+ If no arguments are specified, it defaults to::
+
+ check_warnings(("", Warning), quiet=True)
- A convenience wrapper for ``warnings.catch_warnings()`` that makes
- it easier to test that a warning was correctly raised with a single
- assertion. It is approximately equivalent to calling
- ``warnings.catch_warnings(record=True)``.
+ In this case all warnings are caught and no errors are raised.
- The main difference is that on entry to the context manager, a
- :class:`WarningRecorder` instance is returned instead of a simple list.
- The underlying warnings list is available via the recorder object's
- :attr:`warnings` attribute, while the attributes of the last raised
- warning are also accessible directly on the object. If no warning has
- been raised, then the latter attributes will all be :const:`None`.
+ On entry to the context manager, a :class:`WarningRecorder` instance is
+ returned. The underlying warnings list from
+ :func:`~warnings.catch_warnings` is available via the recorder object's
+ :attr:`warnings` attribute. As a convenience, the attributes of the object
+ representing the most recent warning can also be accessed directly through
+ the recorder object (see example below). If no warning has been raised,
+ then any of the attributes that would otherwise be expected on an object
+ representing a warning will return :const:`None`.
- A :meth:`reset` method is also provided on the recorder object. This
- method simply clears the warning list.
+ The recorder object also has a :meth:`reset` method, which clears the
+ warnings list.
- The context manager is used like this::
+ The context manager is designed to be used like this::
- with check_warnings() as w:
- warnings.simplefilter("always")
+ with check_warnings(("assertion is always true", SyntaxWarning),
+ ("", UserWarning)):
+ exec('assert(False, "Hey!")')
+ warnings.warn(UserWarning("Hide me!"))
+
+ In this case if either warning was not raised, or some other warning was
+ raised, :func:`check_warnings` would raise an error.
+
+ When a test needs to look more deeply into the warnings, rather than
+ just checking whether or not they occurred, code like this can be used::
+
+ with check_warnings(quiet=True) as w:
warnings.warn("foo")
- assert str(w.message) == "foo"
+ assert str(w.args[0]) == "foo"
warnings.warn("bar")
- assert str(w.message) == "bar"
- assert str(w.warnings[0].message) == "foo"
- assert str(w.warnings[1].message) == "bar"
+ assert str(w.args[0]) == "bar"
+ assert str(w.warnings[0].args[0]) == "foo"
+ assert str(w.warnings[1].args[0]) == "bar"
w.reset()
assert len(w.warnings) == 0
+ Here all warnings will be caught, and the test code tests the captured
+ warnings directly.
+
+ .. versionchanged:: 3.2
+ New optional arguments *filters* and *quiet*.
+
+
.. function:: captured_stdout()
This is a context manager that runs the :keyword:`with` statement body using
@@ -389,18 +421,19 @@ The :mod:`test.support` module defines the following classes:
.. class:: EnvironmentVarGuard()
- Class used to temporarily set or unset environment variables. Instances can be
- used as a context manager and have a complete dictionary interface for
- querying/modifying the underlying ``os.environ``. After exit from the context
- manager all changes to environment variables done through this instance will
- be rolled back.
+ Class used to temporarily set or unset environment variables. Instances can
+ be used as a context manager and have a complete dictionary interface for
+ querying/modifying the underlying ``os.environ``. After exit from the
+ context manager all changes to environment variables done through this
+ instance will be rolled back.
.. versionchanged:: 3.1
Added dictionary interface.
.. method:: EnvironmentVarGuard.set(envvar, value)
- Temporarily set the environment variable ``envvar`` to the value of ``value``.
+ Temporarily set the environment variable ``envvar`` to the value of
+ ``value``.
.. method:: EnvironmentVarGuard.unset(envvar)
@@ -412,4 +445,3 @@ The :mod:`test.support` module defines the following classes:
Class used to record warnings for unit tests. See documentation of
:func:`check_warnings` above for more details.
-
diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst
index 835701340a..a81496206d 100644
--- a/Doc/library/textwrap.rst
+++ b/Doc/library/textwrap.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Greg Ward <gward@python.net>
.. sectionauthor:: Greg Ward <gward@python.net>
+**Source code:** :source:`Lib/textwrap.py`
+
+--------------
The :mod:`textwrap` module provides two convenience functions, :func:`wrap` and
:func:`fill`, as well as :class:`TextWrapper`, the class that does all the work,
@@ -13,7 +16,6 @@ and a utility function :func:`dedent`. If you're just wrapping or filling one
or two text strings, the convenience functions should be good enough;
otherwise, you should use an instance of :class:`TextWrapper` for efficiency.
-
.. function:: wrap(text, width=70, **kwargs)
Wraps the single paragraph in *text* (a string) so every line is at most
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index fb1880915f..5f1b9bfb06 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -4,6 +4,9 @@
.. module:: threading
:synopsis: Thread-based parallelism.
+**Source code:** :source:`Lib/threading.py`
+
+--------------
This module constructs higher-level threading interfaces on top of the lower
level :mod:`_thread` module. See also the :mod:`queue` module.
@@ -24,8 +27,9 @@ The :mod:`dummy_threading` module is provided for situations where
libraries might overcome this limitation).
If you want your application to make better of use of the computational
resources of multi-core machines, you are advised to use
- :mod:`multiprocessing`. However, threading is still an appropriate model
- if you want to run multiple I/O-bound tasks simultaneously.
+ :mod:`multiprocessing` or :class:`concurrent.futures.ProcessPoolExecutor`.
+ However, threading is still an appropriate model if you want to run
+ multiple I/O-bound tasks simultaneously.
This module defines the following functions and objects:
@@ -182,6 +186,18 @@ This module defines the following functions and objects:
Availability: Windows, systems with POSIX threads.
+This module also defines the following constant:
+
+.. data:: TIMEOUT_MAX
+
+ The maximum value allowed for the *timeout* parameter of blocking functions
+ (:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition.wait`, etc.).
+ Specifying a timeout greater than this value will raise an
+ :exc:`OverflowError`.
+
+ .. versionadded:: 3.2
+
+
Detailed interfaces for the objects are documented below.
The design of this module is loosely based on Java's threading model. However,
@@ -376,7 +392,7 @@ and may vary across implementations.
All methods are executed atomically.
-.. method:: Lock.acquire([blocking])
+.. method:: Lock.acquire(blocking=True, timeout=-1)
Acquire a lock, blocking or non-blocking.
@@ -390,6 +406,21 @@ All methods are executed atomically.
without an argument would block, return false immediately; otherwise, do the
same thing as when called without arguments, and return true.
+ When invoked with the floating-point *timeout* argument set to a positive
+ value, block for at most the number of seconds specified by *timeout*
+ and as long as the lock cannot be acquired. A negative *timeout* argument
+ specifies an unbounded wait. It is forbidden to specify a *timeout*
+ when *blocking* is false.
+
+ The return value is ``True`` if the lock is acquired successfully,
+ ``False`` if not (for example if the *timeout* expired).
+
+ .. versionchanged:: 3.2
+ The *timeout* parameter is new.
+
+ .. versionchanged:: 3.2
+ Lock acquires can now be interrupted by signals on POSIX.
+
.. method:: Lock.release()
@@ -423,7 +454,7 @@ pair) resets the lock to unlocked and allows another thread blocked in
:meth:`acquire` to proceed.
-.. method:: RLock.acquire(blocking=True)
+.. method:: RLock.acquire(blocking=True, timeout=-1)
Acquire a lock, blocking or non-blocking.
@@ -442,6 +473,14 @@ pair) resets the lock to unlocked and allows another thread blocked in
without an argument would block, return false immediately; otherwise, do the
same thing as when called without arguments, and return true.
+ When invoked with the floating-point *timeout* argument set to a positive
+ value, block for at most the number of seconds specified by *timeout*
+ and as long as the lock cannot be acquired. Return true if the lock has
+ been acquired, false if the timeout has elapsed.
+
+ .. versionchanged:: 3.2
+ The *timeout* parameter is new.
+
.. method:: RLock.release()
@@ -513,6 +552,13 @@ state change can be interesting for only one or several waiting threads. E.g.
in a typical producer-consumer situation, adding one item to the buffer only
needs to wake up one consumer thread.
+Note: Condition variables can be, depending on the implementation, subject
+to both spurious wakeups (when :meth:`wait` returns without a :meth:`notify`
+call) and stolen wakeups (when another thread acquires the lock before the
+awoken thread.) For this reason, it is always necessary to verify the state
+the thread is waiting for when :meth:`wait` returns and optionally repeat
+the call as often as necessary.
+
.. class:: Condition(lock=None)
@@ -553,6 +599,41 @@ needs to wake up one consumer thread.
interface is then used to restore the recursion level when the lock is
reacquired.
+ The return value is ``True`` unless a given *timeout* expired, in which
+ case it is ``False``.
+
+ .. versionchanged:: 3.2
+ Previously, the method always returned ``None``.
+
+ .. method:: wait_for(predicate, timeout=None)
+
+ Wait until a condition evaluates to True. *predicate* should be a
+ callable which result will be interpreted as a boolean value.
+ A *timeout* may be provided giving the maximum time to wait.
+
+ This utility method may call :meth:`wait` repeatedly until the predicate
+ is satisfied, or until a timeout occurs. The return value is
+ the last return value of the predicate and will evaluate to
+ ``False`` if the method timed out.
+
+ Ignoring the timeout feature, calling this method is roughly equivalent to
+ writing::
+
+ while not predicate():
+ cv.wait()
+
+ Therefore, the same rules apply as with :meth:`wait`: The lock must be
+ held when called and is re-aquired on return. The predicate is evaluated
+ with the lock held.
+
+ Using this method, the consumer example above can be written thus::
+
+ with cv:
+ cv.wait_for(an_item_is_available)
+ get_an_available_item()
+
+ .. versionadded:: 3.2
+
.. method:: notify()
Wake up a thread waiting on this condition, if any. If the calling thread
@@ -599,7 +680,7 @@ waiting until some other thread calls :meth:`release`.
defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is
raised.
- .. method:: acquire(blocking=True)
+ .. method:: acquire(blocking=True, timeout=None)
Acquire a semaphore.
@@ -610,14 +691,18 @@ waiting until some other thread calls :meth:`release`.
interlocking so that if multiple :meth:`acquire` calls are blocked,
:meth:`release` will wake exactly one of them up. The implementation may
pick one at random, so the order in which blocked threads are awakened
- should not be relied on. There is no return value in this case.
-
- When invoked with *blocking* set to true, do the same thing as when called
- without arguments, and return true.
+ should not be relied on. Returns true (or blocks indefinitely).
When invoked with *blocking* set to false, do not block. If a call
- without an argument would block, return false immediately; otherwise, do
- the same thing as when called without arguments, and return true.
+ without an argument would block, return false immediately; otherwise,
+ do the same thing as when called without arguments, and return true.
+
+ When invoked with a *timeout* other than None, it will block for at
+ most *timeout* seconds. If acquire does not complete successfully in
+ that interval, return false. Return true otherwise.
+
+ .. versionchanged:: 3.2
+ The *timeout* parameter is new.
.. method:: release()
@@ -737,6 +822,108 @@ For example::
only work if the timer is still in its waiting stage.
+Barrier Objects
+---------------
+
+.. versionadded:: 3.2
+
+This class provides a simple synchronization primitive for use by a fixed number
+of threads that need to wait for each other. Each of the threads tries to pass
+the barrier by calling the :meth:`wait` method and will block until all of the
+threads have made the call. At this points, the threads are released
+simultanously.
+
+The barrier can be reused any number of times for the same number of threads.
+
+As an example, here is a simple way to synchronize a client and server thread::
+
+ b = Barrier(2, timeout=5)
+
+ def server():
+ start_server()
+ b.wait()
+ while True:
+ connection = accept_connection()
+ process_server_connection(connection)
+
+ def client():
+ b.wait()
+ while True:
+ connection = make_connection()
+ process_client_connection(connection)
+
+
+.. class:: Barrier(parties, action=None, timeout=None)
+
+ Create a barrier object for *parties* number of threads. An *action*, when
+ provided, is a callable to be called by one of the threads when they are
+ released. *timeout* is the default timeout value if none is specified for
+ the :meth:`wait` method.
+
+ .. method:: wait(timeout=None)
+
+ Pass the barrier. When all the threads party to the barrier have called
+ this function, they are all released simultaneously. If a *timeout* is
+ provided, is is used in preference to any that was supplied to the class
+ constructor.
+
+ The return value is an integer in the range 0 to *parties* -- 1, different
+ for each thread. This can be used to select a thread to do some special
+ housekeeping, e.g.::
+
+ i = barrier.wait()
+ if i == 0:
+ # Only one thread needs to print this
+ print("passed the barrier")
+
+ If an *action* was provided to the constructor, one of the threads will
+ have called it prior to being released. Should this call raise an error,
+ the barrier is put into the broken state.
+
+ If the call times out, the barrier is put into the broken state.
+
+ This method may raise a :class:`BrokenBarrierError` exception if the
+ barrier is broken or reset while a thread is waiting.
+
+ .. method:: reset()
+
+ Return the barrier to the default, empty state. Any threads waiting on it
+ will receive the :class:`BrokenBarrierError` exception.
+
+ Note that using this function may can require some external
+ synchronization if there are other threads whose state is unknown. If a
+ barrier is broken it may be better to just leave it and create a new one.
+
+ .. method:: abort()
+
+ Put the barrier into a broken state. This causes any active or future
+ calls to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use
+ this for example if one of the needs to abort, to avoid deadlocking the
+ application.
+
+ It may be preferable to simply create the barrier with a sensible
+ *timeout* value to automatically guard against one of the threads going
+ awry.
+
+ .. attribute:: parties
+
+ The number of threads required to pass the barrier.
+
+ .. attribute:: n_waiting
+
+ The number of threads currently waiting in the barrier.
+
+ .. attribute:: broken
+
+ A boolean that is ``True`` if the barrier is in the broken state.
+
+
+.. exception:: BrokenBarrierError
+
+ This exception, a subclass of :exc:`RuntimeError`, is raised when the
+ :class:`Barrier` object is reset or broken.
+
+
.. _with-locks:
Using locks, conditions, and semaphores in the :keyword:`with` statement
diff --git a/Doc/library/time.rst b/Doc/library/time.rst
index b91aa539df..28e994c61c 100644
--- a/Doc/library/time.rst
+++ b/Doc/library/time.rst
@@ -24,9 +24,9 @@ An explanation of some terminology and conventions is in order.
.. index:: single: Year 2038
-* The functions in this module do not handle dates and times before the epoch or
+* The functions in this module may not handle dates and times before the epoch or
far in the future. The cut-off point in the future is determined by the C
- library; for Unix, it is typically in 2038.
+ library; for 32-bit systems, it is typically in 2038.
.. index::
single: Year 2000
@@ -34,20 +34,31 @@ An explanation of some terminology and conventions is in order.
.. _time-y2kissues:
-* **Year 2000 (Y2K) issues**: Python depends on the platform's C library, which
+* **Year 2000 (Y2K) issues**: Python depends on the platform's C library, which
generally doesn't have year 2000 issues, since all dates and times are
- represented internally as seconds since the epoch. Functions accepting a
- :class:`struct_time` (see below) generally require a 4-digit year. For backward
- compatibility, 2-digit years are supported if the module variable
- ``accept2dyear`` is a non-zero integer; this variable is initialized to ``1``
- unless the environment variable :envvar:`PYTHONY2K` is set to a non-empty
- string, in which case it is initialized to ``0``. Thus, you can set
- :envvar:`PYTHONY2K` to a non-empty string in the environment to require 4-digit
- years for all year input. When 2-digit years are accepted, they are converted
- according to the POSIX or X/Open standard: values 69-99 are mapped to 1969-1999,
- and values 0--68 are mapped to 2000--2068. Values 100--1899 are always illegal.
- Note that this is new as of Python 1.5.2(a2); earlier versions, up to Python
- 1.5.1 and 1.5.2a1, would add 1900 to year values below 1900.
+ represented internally as seconds since the epoch. Function :func:`strptime`
+ can parse 2-digit years when given ``%y`` format code. When 2-digit years are
+ parsed, they are converted according to the POSIX and ISO C standards: values
+ 69--99 are mapped to 1969--1999, and values 0--68 are mapped to 2000--2068.
+
+ For backward compatibility, years with less than 4 digits are treated
+ specially by :func:`asctime`, :func:`mktime`, and :func:`strftime` functions
+ that operate on a 9-tuple or :class:`struct_time` values. If year (the first
+ value in the 9-tuple) is specified with less than 4 digits, its interpretation
+ depends on the value of ``accept2dyear`` variable.
+
+ If ``accept2dyear`` is true (default), a backward compatibility behavior is
+ invoked as follows:
+
+ - for 2-digit year, century is guessed according to POSIX rules for
+ ``%y`` strptime format. A deprecation warning is issued when century
+ information is guessed in this way.
+
+ - for 3-digit or negative year, a :exc:`ValueError` exception is raised.
+
+ If ``accept2dyear`` is false (set by the program or as a result of a
+ non-empty value assigned to ``PYTHONY2K`` environment variable) all year
+ values are interpreted as given.
.. index::
single: UTC
@@ -73,8 +84,8 @@ An explanation of some terminology and conventions is in order.
* On the other hand, the precision of :func:`time` and :func:`sleep` is better
than their Unix equivalents: times are expressed as floating point numbers,
:func:`time` returns the most accurate time available (using Unix
- :cfunc:`gettimeofday` where available), and :func:`sleep` will accept a time
- with a nonzero fraction (Unix :cfunc:`select` is used to implement this, where
+ :c:func:`gettimeofday` where available), and :func:`sleep` will accept a time
+ with a nonzero fraction (Unix :c:func:`select` is used to implement this, where
available).
* The time value as returned by :func:`gmtime`, :func:`localtime`, and
@@ -109,10 +120,19 @@ The module defines the following functions and data items:
.. data:: accept2dyear
- Boolean value indicating whether two-digit year values will be accepted. This
- is true by default, but will be set to false if the environment variable
- :envvar:`PYTHONY2K` has been set to a non-empty string. It may also be modified
- at run time.
+ Boolean value indicating whether two-digit year values will be
+ mapped to 1969--2068 range by :func:`asctime`, :func:`mktime`, and
+ :func:`strftime` functions. This is true by default, but will be
+ set to false if the environment variable :envvar:`PYTHONY2K` has
+ been set to a non-empty string. It may also be modified at run
+ time.
+
+ .. deprecated:: 3.2
+ Mapping of 2-digit year values by :func:`asctime`,
+ :func:`mktime`, and :func:`strftime` functions to 1969--2068
+ range is deprecated. Programs that need to process 2-digit
+ years should use ``%y`` code available in :func:`strptime`
+ function or convert 2-digit year values to 4-digit themselves.
.. data:: altzone
@@ -125,7 +145,7 @@ The module defines the following functions and data items:
.. function:: asctime([t])
Convert a tuple or :class:`struct_time` representing a time as returned by
- :func:`gmtime` or :func:`localtime` to a 24-character string of the following
+ :func:`gmtime` or :func:`localtime` to a string of the following
form: ``'Sun Jun 20 23:21:05 1993'``. If *t* is not provided, the current time
as returned by :func:`localtime` is used. Locale information is not used by
:func:`asctime`.
@@ -149,7 +169,7 @@ The module defines the following functions and data items:
On Windows, this function returns wall-clock seconds elapsed since the first
call to this function, as a floating point number, based on the Win32 function
- :cfunc:`QueryPerformanceCounter`. The resolution is typically better than one
+ :c:func:`QueryPerformanceCounter`. The resolution is typically better than one
microsecond.
@@ -288,7 +308,7 @@ The module defines the following functions and data items:
| ``%y`` | Year without century as a decimal number | |
| | [00,99]. | |
+-----------+------------------------------------------------+-------+
- | ``%Y`` | Year with century as a decimal number. | |
+ | ``%Y`` | Year with century as a decimal number. | \(4) |
| | | |
+-----------+------------------------------------------------+-------+
| ``%Z`` | Time zone name (no characters if no time zone | |
@@ -304,13 +324,20 @@ The module defines the following functions and data items:
the output hour field if the ``%I`` directive is used to parse the hour.
(2)
- The range really is ``0`` to ``61``; this accounts for leap seconds and the
- (very rare) double leap seconds.
+ The range really is ``0`` to ``61``; value ``60`` is valid in
+ timestamps representing leap seconds and value ``61`` is supported
+ for historical reasons.
(3)
When used with the :func:`strptime` function, ``%U`` and ``%W`` are only used in
calculations when the day of the week and the year are specified.
+ (4)
+ Produces different results depending on the value of
+ ``time.accept2dyear`` variable. See :ref:`Year 2000 (Y2K)
+ issues <time-y2kissues>` for details.
+
+
Here is an example, a format for dates compatible with that specified in the
:rfc:`2822` Internet email standard. [#]_ ::
@@ -380,7 +407,7 @@ The module defines the following functions and data items:
+-------+-------------------+---------------------------------+
| 4 | :attr:`tm_min` | range [0, 59] |
+-------+-------------------+---------------------------------+
- | 5 | :attr:`tm_sec` | range [0, 61]; see **(1)** in |
+ | 5 | :attr:`tm_sec` | range [0, 61]; see **(2)** in |
| | | :func:`strftime` description |
+-------+-------------------+---------------------------------+
| 6 | :attr:`tm_wday` | range [0, 6], Monday is 0 |
diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
index 4a0b9c257b..a03e40e1b3 100644
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -9,6 +9,10 @@
single: Benchmarking
single: Performance
+**Source code:** :source:`Lib/timeit.py`
+
+--------------
+
This module provides a simple way to time small bits of Python code. It has both
command line as well as callable interfaces. It avoids a number of common traps
for measuring execution times. See also Tim Peters' introduction to the
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index 7bb54fd4fa..ae5635f3c8 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -9,7 +9,9 @@
The :mod:`tkinter` package ("Tk interface") is the standard Python interface to
the Tk GUI toolkit. Both Tk and :mod:`tkinter` are available on most Unix
platforms, as well as on Windows systems. (Tk itself is not part of Python; it
-is maintained at ActiveState.)
+is maintained at ActiveState.) You can check that :mod:`tkinter` is properly
+installed on your system by running ``python -m tkinter`` from the command line;
+this should open a window demonstrating a simple Tk interface.
.. seealso::
@@ -657,9 +659,7 @@ relief
scrollcommand
This is almost always the :meth:`!set` method of some scrollbar widget, but can
- be any widget method that takes a single argument. Refer to the file
- :file:`Demo/tkinter/matt/canvas-with-scrollbars.py` in the Python source
- distribution for an example.
+ be any widget method that takes a single argument.
wrap:
Must be one of: ``"none"``, ``"char"``, or ``"word"``.
diff --git a/Doc/library/tkinter.tix.rst b/Doc/library/tkinter.tix.rst
index beb91e6ee1..289bffd1ad 100644
--- a/Doc/library/tkinter.tix.rst
+++ b/Doc/library/tkinter.tix.rst
@@ -84,11 +84,7 @@ Tix Widgets
-----------
`Tix <http://tix.sourceforge.net/dist/current/man/html/TixCmd/TixIntro.htm>`_
-introduces over 40 widget classes to the :mod:`tkinter` repertoire. There is a
-demo of all the :mod:`tkinter.tix` widgets in the :file:`Demo/tix` directory of
-the standard distribution.
-
-.. The Python sample code is still being added to Python, hence commented out
+introduces over 40 widget classes to the :mod:`tkinter` repertoire.
Basic Widgets
diff --git a/Doc/library/token.rst b/Doc/library/token.rst
index 991762f4e6..4b98eac928 100644
--- a/Doc/library/token.rst
+++ b/Doc/library/token.rst
@@ -5,6 +5,9 @@
:synopsis: Constants representing terminal nodes of the parse tree.
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/token.py`
+
+--------------
This module provides constants which represent the numeric values of leaf nodes
of the parse tree (terminal tokens). Refer to the file :file:`Grammar/Grammar`
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst
index 7017045f61..577d7cca4c 100644
--- a/Doc/library/tokenize.rst
+++ b/Doc/library/tokenize.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Ka Ping Yee
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/tokenize.py`
+
+--------------
The :mod:`tokenize` module provides a lexical scanner for Python source code,
implemented in Python. The scanner in this module returns comments as tokens
@@ -95,12 +98,25 @@ function it uses to do this is available:
It detects the encoding from the presence of a UTF-8 BOM or an encoding
cookie as specified in :pep:`263`. If both a BOM and a cookie are present,
- but disagree, a SyntaxError will be raised.
+ but disagree, a SyntaxError will be raised. Note that if the BOM is found,
+ ``'utf-8-sig'`` will be returned as an encoding.
+
+ If no encoding is specified, then the default of ``'utf-8'`` will be
+ returned.
+
+ Use :func:`open` to open Python source files: it uses
+ :func:`detect_encoding` to detect the file encoding.
+
- If no encoding is specified, then the default of ``'utf-8'`` will be returned.
+.. function:: open(filename)
+ Open a file in read only mode using the encoding detected by
+ :func:`detect_encoding`.
-Example of a script re-writer that transforms float literals into Decimal
+ .. versionadded:: 3.2
+
+
+Example of a script rewriter that transforms float literals into Decimal
objects::
from tokenize import tokenize, untokenize, NUMBER, STRING, NAME, OP
@@ -142,4 +158,3 @@ objects::
result.append((toknum, tokval))
return untokenize(result).decode('utf-8')
-
diff --git a/Doc/library/trace.rst b/Doc/library/trace.rst
index 7b49c8fd49..c4ddc56cf2 100644
--- a/Doc/library/trace.rst
+++ b/Doc/library/trace.rst
@@ -4,13 +4,15 @@
.. module:: trace
:synopsis: Trace or track Python statement execution.
+**Source code:** :source:`Lib/trace.py`
+
+--------------
The :mod:`trace` module allows you to trace program execution, generate
annotated statement coverage listings, print caller/callee relationships and
list functions executed during a program run. It can be used in another program
or from the command line.
-
.. _trace-cli:
Command-Line Usage
diff --git a/Doc/library/turtle-star.pdf b/Doc/library/turtle-star.pdf
new file mode 100644
index 0000000000..e354073dd4
--- /dev/null
+++ b/Doc/library/turtle-star.pdf
Binary files differ
diff --git a/Doc/library/turtle-star.png b/Doc/library/turtle-star.png
new file mode 100644
index 0000000000..caf36a3ab3
--- /dev/null
+++ b/Doc/library/turtle-star.png
Binary files differ
diff --git a/Doc/library/turtle-star.ps b/Doc/library/turtle-star.ps
new file mode 100644
index 0000000000..46362cb9f7
--- /dev/null
+++ b/Doc/library/turtle-star.ps
@@ -0,0 +1,447 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: Tk Canvas Widget
+%%For: Alexander Belopolsky
+%%Title: Window .4315905424
+%%CreationDate: Tue Nov 9 12:54:06 2010
+%%XBoundingBox: -172 -52 785 845
+%%BoundingBox: 290 290 520 520
+%%Pages: 1
+%%DocumentData: Clean7Bit
+%%Orientation: Portrait
+%%EndComments
+
+%%BeginProlog
+/CurrentEncoding [
+/space/space/space/space/space/space/space/space
+/space/space/space/space/space/space/space/space
+/space/space/space/space/space/space/space/space
+/space/space/space/space/space/space/space/space
+/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quotesingle
+/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash
+/zero/one/two/three/four/five/six/seven
+/eight/nine/colon/semicolon/less/equal/greater/question
+/at/A/B/C/D/E/F/G
+/H/I/J/K/L/M/N/O
+/P/Q/R/S/T/U/V/W
+/X/Y/Z/bracketleft/backslash/bracketright/asciicircum/underscore
+/grave/a/b/c/d/e/f/g
+/h/i/j/k/l/m/n/o
+/p/q/r/s/t/u/v/w
+/x/y/z/braceleft/bar/braceright/asciitilde/space
+/space/space/space/space/space/space/space/space
+/space/space/space/space/space/space/space/space
+/space/space/space/space/space/space/space/space
+/space/space/space/space/space/space/space/space
+/space/exclamdown/cent/sterling/currency/yen/brokenbar/section
+/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/hyphen/registered/macron
+/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered
+/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown
+/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
+/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis
+/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply
+/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
+/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
+/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
+/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide
+/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis
+] def
+
+50 dict begin
+% This is a standard prolog for Postscript generated by Tk's canvas
+% widget.
+% RCS: @(#) $Id$
+
+% The definitions below just define all of the variables used in
+% any of the procedures here. This is needed for obscure reasons
+% explained on p. 716 of the Postscript manual (Section H.2.7,
+% "Initializing Variables," in the section on Encapsulated Postscript).
+
+/baseline 0 def
+/stipimage 0 def
+/height 0 def
+/justify 0 def
+/lineLength 0 def
+/spacing 0 def
+/stipple 0 def
+/strings 0 def
+/xoffset 0 def
+/yoffset 0 def
+/tmpstip null def
+
+
+/cstringshow {
+ {
+ dup type /stringtype eq
+ { show } { glyphshow }
+ ifelse
+ }
+ forall
+} bind def
+
+
+
+/cstringwidth {
+ 0 exch 0 exch
+ {
+ dup type /stringtype eq
+ { stringwidth } {
+ currentfont /Encoding get exch 1 exch put (\001) stringwidth
+ }
+ ifelse
+ exch 3 1 roll add 3 1 roll add exch
+ }
+ forall
+} bind def
+
+% font ISOEncode font
+% This procedure changes the encoding of a font from the default
+% Postscript encoding to current system encoding. It's typically invoked just
+% before invoking "setfont". The body of this procedure comes from
+% Section 5.6.1 of the Postscript book.
+
+/ISOEncode {
+ dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding CurrentEncoding def
+ currentdict
+ end
+
+ % I'm not sure why it's necessary to use "definefont" on this new
+ % font, but it seems to be important; just use the name "Temporary"
+ % for the font.
+
+ /Temporary exch definefont
+} bind def
+
+% StrokeClip
+%
+% This procedure converts the current path into a clip area under
+% the assumption of stroking. It's a bit tricky because some Postscript
+% interpreters get errors during strokepath for dashed lines. If
+% this happens then turn off dashes and try again.
+
+/StrokeClip {
+ {strokepath} stopped {
+ (This Postscript printer gets limitcheck overflows when) =
+ (stippling dashed lines; lines will be printed solid instead.) =
+ [] 0 setdash strokepath} if
+ clip
+} bind def
+
+% desiredSize EvenPixels closestSize
+%
+% The procedure below is used for stippling. Given the optimal size
+% of a dot in a stipple pattern in the current user coordinate system,
+% compute the closest size that is an exact multiple of the device's
+% pixel size. This allows stipple patterns to be displayed without
+% aliasing effects.
+
+/EvenPixels {
+ % Compute exact number of device pixels per stipple dot.
+ dup 0 matrix currentmatrix dtransform
+ dup mul exch dup mul add sqrt
+
+ % Round to an integer, make sure the number is at least 1, and compute
+ % user coord distance corresponding to this.
+ dup round dup 1 lt {pop 1} if
+ exch div mul
+} bind def
+
+% width height string StippleFill --
+%
+% Given a path already set up and a clipping region generated from
+% it, this procedure will fill the clipping region with a stipple
+% pattern. "String" contains a proper image description of the
+% stipple pattern and "width" and "height" give its dimensions. Each
+% stipple dot is assumed to be about one unit across in the current
+% user coordinate system. This procedure trashes the graphics state.
+
+/StippleFill {
+ % The following code is needed to work around a NeWSprint bug.
+
+ /tmpstip 1 index def
+
+ % Change the scaling so that one user unit in user coordinates
+ % corresponds to the size of one stipple dot.
+ 1 EvenPixels dup scale
+
+ % Compute the bounding box occupied by the path (which is now
+ % the clipping region), and round the lower coordinates down
+ % to the nearest starting point for the stipple pattern. Be
+ % careful about negative numbers, since the rounding works
+ % differently on them.
+
+ pathbbox
+ 4 2 roll
+ 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll
+ 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll
+
+ % Stack now: width height string y1 y2 x1 x2
+ % Below is a doubly-nested for loop to iterate across this area
+ % in units of the stipple pattern size, going up columns then
+ % across rows, blasting out a stipple-pattern-sized rectangle at
+ % each position
+
+ 6 index exch {
+ 2 index 5 index 3 index {
+ % Stack now: width height string y1 y2 x y
+
+ gsave
+ 1 index exch translate
+ 5 index 5 index true matrix tmpstip imagemask
+ grestore
+ } for
+ pop
+ } for
+ pop pop pop pop pop
+} bind def
+
+% -- AdjustColor --
+% Given a color value already set for output by the caller, adjusts
+% that value to a grayscale or mono value if requested by the CL
+% variable.
+
+/AdjustColor {
+ CL 2 lt {
+ currentgray
+ CL 0 eq {
+ .5 lt {0} {1} ifelse
+ } if
+ setgray
+ } if
+} bind def
+
+% x y strings spacing xoffset yoffset justify stipple DrawText --
+% This procedure does all of the real work of drawing text. The
+% color and font must already have been set by the caller, and the
+% following arguments must be on the stack:
+%
+% x, y - Coordinates at which to draw text.
+% strings - An array of strings, one for each line of the text item,
+% in order from top to bottom.
+% spacing - Spacing between lines.
+% xoffset - Horizontal offset for text bbox relative to x and y: 0 for
+% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se.
+% yoffset - Vertical offset for text bbox relative to x and y: 0 for
+% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se.
+% justify - 0 for left justification, 0.5 for center, 1 for right justify.
+% stipple - Boolean value indicating whether or not text is to be
+% drawn in stippled fashion. If text is stippled,
+% procedure StippleText must have been defined to call
+% StippleFill in the right way.
+%
+% Also, when this procedure is invoked, the color and font must already
+% have been set for the text.
+
+/DrawText {
+ /stipple exch def
+ /justify exch def
+ /yoffset exch def
+ /xoffset exch def
+ /spacing exch def
+ /strings exch def
+
+ % First scan through all of the text to find the widest line.
+
+ /lineLength 0 def
+ strings {
+ cstringwidth pop
+ dup lineLength gt {/lineLength exch def} {pop} ifelse
+ newpath
+ } forall
+
+ % Compute the baseline offset and the actual font height.
+
+ 0 0 moveto (TXygqPZ) false charpath
+ pathbbox dup /baseline exch def
+ exch pop exch sub /height exch def pop
+ newpath
+
+ % Translate coordinates first so that the origin is at the upper-left
+ % corner of the text's bounding box. Remember that x and y for
+ % positioning are still on the stack.
+
+ translate
+ lineLength xoffset mul
+ strings length 1 sub spacing mul height add yoffset mul translate
+
+ % Now use the baseline and justification information to translate so
+ % that the origin is at the baseline and positioning point for the
+ % first line of text.
+
+ justify lineLength mul baseline neg translate
+
+ % Iterate over each of the lines to output it. For each line,
+ % compute its width again so it can be properly justified, then
+ % display it.
+
+ strings {
+ dup cstringwidth pop
+ justify neg mul 0 moveto
+ stipple {
+
+
+ % The text is stippled, so turn it into a path and print
+ % by calling StippledText, which in turn calls StippleFill.
+ % Unfortunately, many Postscript interpreters will get
+ % overflow errors if we try to do the whole string at
+ % once, so do it a character at a time.
+
+ gsave
+ /char (X) def
+ {
+ dup type /stringtype eq {
+ % This segment is a string.
+ {
+ char 0 3 -1 roll put
+ currentpoint
+ gsave
+ char true charpath clip StippleText
+ grestore
+ char stringwidth translate
+ moveto
+ } forall
+ } {
+ % This segment is glyph name
+ % Temporary override
+ currentfont /Encoding get exch 1 exch put
+ currentpoint
+ gsave (\001) true charpath clip StippleText
+ grestore
+ (\001) stringwidth translate
+ moveto
+ } ifelse
+ } forall
+ grestore
+ } {cstringshow} ifelse
+ 0 spacing neg translate
+ } forall
+} bind def
+
+%%EndProlog
+%%BeginSetup
+/CL 2 def
+%%EndSetup
+
+%%Page: 1 1
+save
+306.0 396.0 translate
+0.9995 0.9995 scale
+4 -449 translate
+-483 898 moveto 475 898 lineto 475 0 lineto -483 0 lineto closepath clip newpath
+gsave
+grestore
+gsave
+0 445 moveto
+200 445 lineto
+3.03844939755837 479.729635533386 lineto
+190.97697355474 411.325606868252 lineto
+17.7718927978523 511.325606868252 lineto
+170.980781421648 382.768084930944 lineto
+42.42325948434 535.97697355474 lineto
+142.42325948434 362.771892797852 lineto
+74.0192308192062 550.710416955034 lineto
+108.748866352592 353.748866352592 lineto
+108.748866352592 553.748866352592 lineto
+74.0192308192064 356.787315750151 lineto
+142.42325948434 544.725839907333 lineto
+42.4232594843401 371.520759150445 lineto
+170.980781421648 524.72964777424 lineto
+17.7718927978524 396.172125836932 lineto
+190.97697355474 496.172125836933 lineto
+3.03844939755834 427.768097171799 lineto
+200 462.497732705185 lineto
+-1.13686837721616e-13 462.497732705185 lineto
+196.961550602442 427.768097171799 lineto
+9.02302644525972 496.172125836932 lineto
+182.228107202148 396.172125836933 lineto
+29.0192185783518 524.72964777424 lineto
+157.57674051566 371.520759150445 lineto
+57.5767405156596 544.725839907332 lineto
+125.980769180794 356.787315750151 lineto
+91.2511336474073 553.748866352592 lineto
+91.2511336474079 353.748866352592 lineto
+125.980769180793 550.710416955034 lineto
+57.5767405156601 362.771892797852 lineto
+157.57674051566 535.97697355474 lineto
+29.0192185783522 382.768084930944 lineto
+182.228107202148 511.325606868253 lineto
+9.02302644525994 411.325606868252 lineto
+196.961550602442 479.729635533386 lineto
+-1.70530256582424e-13 445 lineto
+0 445 lineto
+1.000 1.000 0.000 setrgbcolor AdjustColor
+eofill
+grestore
+gsave
+0 445 moveto
+200 445 lineto
+3.03844939755837 479.729635533386 lineto
+190.97697355474 411.325606868252 lineto
+17.7718927978523 511.325606868252 lineto
+170.980781421648 382.768084930944 lineto
+42.42325948434 535.97697355474 lineto
+142.42325948434 362.771892797852 lineto
+74.0192308192062 550.710416955034 lineto
+108.748866352592 353.748866352592 lineto
+108.748866352592 553.748866352592 lineto
+74.0192308192064 356.787315750151 lineto
+142.42325948434 544.725839907333 lineto
+42.4232594843401 371.520759150445 lineto
+170.980781421648 524.72964777424 lineto
+17.7718927978524 396.172125836932 lineto
+190.97697355474 496.172125836933 lineto
+3.03844939755834 427.768097171799 lineto
+200 462.497732705185 lineto
+-1.13686837721616e-13 462.497732705185 lineto
+196.961550602442 427.768097171799 lineto
+9.02302644525972 496.172125836932 lineto
+182.228107202148 396.172125836933 lineto
+29.0192185783518 524.72964777424 lineto
+157.57674051566 371.520759150445 lineto
+57.5767405156596 544.725839907332 lineto
+125.980769180794 356.787315750151 lineto
+91.2511336474073 553.748866352592 lineto
+91.2511336474079 353.748866352592 lineto
+125.980769180793 550.710416955034 lineto
+57.5767405156601 362.771892797852 lineto
+157.57674051566 535.97697355474 lineto
+29.0192185783522 382.768084930944 lineto
+182.228107202148 511.325606868253 lineto
+9.02302644525994 411.325606868252 lineto
+196.961550602442 479.729635533386 lineto
+-1.70530256582424e-13 445 lineto
+1 setlinecap
+1 setlinejoin
+1 setlinewidth
+[] 0 setdash
+1.000 0.000 0.000 setrgbcolor AdjustColor
+stroke
+grestore
+gsave
+grestore
+gsave
+-1.70530256582424e-13 445 moveto
+-9.00000000000019 450 lineto
+-7.00000000000017 445 lineto
+-9.00000000000015 440 lineto
+-1.70530256582424e-13 445 lineto
+1.000 1.000 0.000 setrgbcolor AdjustColor
+eofill
+-1.70530256582424e-13 445 moveto
+-9.00000000000019 450 lineto
+-7.00000000000017 445 lineto
+-9.00000000000015 440 lineto
+-1.70530256582424e-13 445 lineto
+1 setlinejoin 1 setlinecap
+1 setlinewidth
+[] 0 setdash
+1.000 0.000 0.000 setrgbcolor AdjustColor
+stroke
+grestore
+restore showpage
+
+%%Trailer
+end
+%%EOF
+
diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst
index 1fe9699f96..e995a7c0c3 100644
--- a/Doc/library/turtle.rst
+++ b/Doc/library/turtle.rst
@@ -23,6 +23,16 @@ command ``turtle.forward(15)``, and it moves (on-screen!) 15 pixels in the
direction it is facing, drawing a line as it moves. Give it the command
``turtle.left(25)``, and it rotates in-place 25 degrees clockwise.
+.. sidebar:: Turtle star
+
+ Turtle can draw intricate shapes using programs that repeat simple
+ moves.
+
+ .. image:: turtle-star.*
+ :align: center
+
+ .. literalinclude:: ../includes/turtle-star.py
+
By combining together these and similar commands, intricate shapes and pictures
can easily be drawn.
@@ -1868,7 +1878,7 @@ Settings and special methods
>>> cv = screen.getcanvas()
>>> cv
- <turtle.ScrolledCanvas instance at 0x...>
+ <turtle.ScrolledCanvas object at ...>
.. function:: getshapes()
@@ -2258,7 +2268,7 @@ There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` is
stored and an additional one in the current working directory. The latter will
override the settings of the first one.
-The :file:`Demo/turtle` directory contains a :file:`turtle.cfg` file. You can
+The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. You can
study it as an example and see its effects when running the demos (preferably
not from within the demo-viewer).
@@ -2266,29 +2276,35 @@ not from within the demo-viewer).
Demo scripts
============
-There is a set of demo scripts in the turtledemo directory located in the
-:file:`Demo/turtle` directory in the source distribution.
+There is a set of demo scripts in the :mod:`turtledemo` package. These
+scripts can be run and viewed using the supplied demo viewer as follows::
+
+ python -m turtledemo
+
+Alternatively, you can run the demo scripts individually. For example, ::
+
+ python -m turtledemo.bytedesign
-It contains:
+The :mod:`turtledemo` package directory contains:
- a set of 15 demo scripts demonstrating different features of the new module
- :mod:`turtle`
-- a demo viewer :file:`turtleDemo.py` which can be used to view the sourcecode
+ :mod:`turtle`;
+- a demo viewer :file:`__main__.py` which can be used to view the sourcecode
of the scripts and run them at the same time. 14 of the examples can be
accessed via the Examples menu; all of them can also be run standalone.
-- The example :file:`turtledemo_two_canvases.py` demonstrates the simultaneous
+- The example :mod:`turtledemo.two_canvases` demonstrates the simultaneous
use of two canvases with the turtle module. Therefore it only can be run
standalone.
-- There is a :file:`turtle.cfg` file in this directory, which also serves as an
+- There is a :file:`turtle.cfg` file in this directory, which serves as an
example for how to write and use such files.
-The demoscripts are:
+The demo scripts are:
+----------------+------------------------------+-----------------------+
| Name | Description | Features |
+----------------+------------------------------+-----------------------+
| bytedesign | complex classical | :func:`tracer`, delay,|
-| | turtlegraphics pattern | :func:`update` |
+| | turtle graphics pattern | :func:`update` |
+----------------+------------------------------+-----------------------+
| chaos | graphs Verhulst dynamics, | world coordinates |
| | shows that computer's | |
@@ -2386,8 +2402,7 @@ Changes since Python 3.0
strings and numbers respectively.
- Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py`
- have been added to the Demo directory (source distribution only). As usual
- they can be viewed and executed within the demo viewer :file:`turtleDemo.py`.
+ have been added to the :file:`Lib/turtledemo` directory.
.. doctest::
diff --git a/Doc/library/types.rst b/Doc/library/types.rst
index 7caecaf4f6..d4a76b611b 100644
--- a/Doc/library/types.rst
+++ b/Doc/library/types.rst
@@ -4,6 +4,9 @@
.. module:: types
:synopsis: Names for built-in types.
+**Source code:** :source:`Lib/types.py`
+
+--------------
This module defines names for some object types that are used by the standard
Python interpreter, but not exposed as builtins like :class:`int` or
diff --git a/Doc/library/unicodedata.rst b/Doc/library/unicodedata.rst
index e1e6dc130e..bcb3da3114 100644
--- a/Doc/library/unicodedata.rst
+++ b/Doc/library/unicodedata.rst
@@ -13,14 +13,15 @@
single: character
pair: Unicode; database
-This module provides access to the Unicode Character Database which defines
-character properties for all Unicode characters. The data in this database is
-based on the :file:`UnicodeData.txt` file version 5.1.0 which is publicly
-available from ftp://ftp.unicode.org/.
-
-The module uses the same names and symbols as defined by the UnicodeData File
-Format 5.1.0 (see http://www.unicode.org/Public/5.1.0/ucd/UCD.html). It defines
-the following functions:
+This module provides access to the Unicode Character Database (UCD) which
+defines character properties for all Unicode characters. The data contained in
+this database is compiled from the `UCD version 6.0.0
+<http://www.unicode.org/Public/6.0.0/ucd>`_.
+
+The module uses the same names and symbols as defined by Unicode
+Standard Annex #44, `"Unicode Character Database"
+<http://www.unicode.org/reports/tr44/tr44-6.html>`_. It defines the
+following functions:
.. function:: lookup(name)
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index 01a036d28f..beed4ded86 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -97,6 +97,13 @@ need to derive from a specific class.
A special-interest-group for discussion of testing, and testing tools,
in Python.
+ The script :file:`Tools/unittestgui/unittestgui.py` in the Python source distribution is
+ a GUI tool for test discovery and execution. This is intended largely for ease of use
+ for those new to unit testing. For production environments it is recommended that
+ tests be driven by a continuous integration system such as `Hudson <http://hudson-ci.org/>`_
+ or `Buildbot <http://buildbot.net/trac>`_.
+
+
.. _unittest-minimal-example:
Basic example
@@ -204,14 +211,141 @@ modules, classes or even individual test methods::
You can pass in a list with any combination of module names, and fully
qualified class or method names.
+Test modules can be specified by file path as well::
+
+ python -m unittest tests/test_something.py
+
+This allows you to use the shell filename completion to specify the test module.
+The file specified must still be importable as a module. The path is converted
+to a module name by removing the '.py' and converting path separators into '.'.
+If you want to execute a test file that isn't importable as a module you should
+execute the file directly instead.
+
You can run tests with more detail (higher verbosity) by passing in the -v flag::
python -m unittest -v test_module
+When executed without arguments :ref:`unittest-test-discovery` is started::
+
+ python -m unittest
+
For a list of all the command-line options::
python -m unittest -h
+.. versionchanged:: 3.2
+ In earlier versions it was only possible to run individual test methods and
+ not modules or classes.
+
+
+Command-line options
+~~~~~~~~~~~~~~~~~~~~
+
+:program:`unittest` supports these command-line options:
+
+.. program:: unittest
+
+.. cmdoption:: -b, --buffer
+
+ The standard output and standard error streams are buffered during the test
+ run. Output during a passing test is discarded. Output is echoed normally
+ on test fail or error and is added to the failure messages.
+
+.. cmdoption:: -c, --catch
+
+ Control-C during the test run waits for the current test to end and then
+ reports all the results so far. A second control-C raises the normal
+ :exc:`KeyboardInterrupt` exception.
+
+ See `Signal Handling`_ for the functions that provide this functionality.
+
+.. cmdoption:: -f, --failfast
+
+ Stop the test run on the first error or failure.
+
+.. versionadded:: 3.2
+ The command-line options ``-b``, ``-c`` and ``-f`` were added.
+
+The command line can also be used for test discovery, for running all of the
+tests in a project or just a subset.
+
+
+.. _unittest-test-discovery:
+
+Test Discovery
+--------------
+
+.. versionadded:: 3.2
+
+Unittest supports simple test discovery. In order to be compatible with test
+discovery, all of the test files must be :ref:`modules <tut-modules>` or
+:ref:`packages <tut-packages>` importable from the top-level directory of
+the project (this means that their filenames must be valid
+:ref:`identifiers <identifiers>`).
+
+Test discovery is implemented in :meth:`TestLoader.discover`, but can also be
+used from the command line. The basic command-line usage is::
+
+ cd project_directory
+ python -m unittest discover
+
+.. note::
+
+ As a shortcut, ``python -m unittest`` is the equivalent of
+ ``python -m unittest discover``. If you want to pass arguments to test
+ discovery the `discover` sub-command must be used explicitly.
+
+The ``discover`` sub-command has the following options:
+
+.. program:: unittest discover
+
+.. cmdoption:: -v, --verbose
+
+ Verbose output
+
+.. cmdoption:: -s directory
+
+ Directory to start discovery ('.' default)
+
+.. cmdoption:: -p pattern
+
+ Pattern to match test files ('test*.py' default)
+
+.. cmdoption:: -t directory
+
+ Top level directory of project (defaults to start directory)
+
+The :option:`-s`, :option:`-p`, and :option:`-t` options can be passed in
+as positional arguments in that order. The following two command lines
+are equivalent::
+
+ python -m unittest discover -s project_directory -p '*_test.py'
+ python -m unittest discover project_directory '*_test.py'
+
+As well as being a path it is possible to pass a package name, for example
+``myproject.subpackage.test``, as the start directory. The package name you
+supply will then be imported and its location on the filesystem will be used
+as the start directory.
+
+.. caution::
+
+ Test discovery loads tests by importing them. Once test discovery has found
+ all the test files from the start directory you specify it turns the paths
+ into package names to import. For example :file:`foo/bar/baz.py` will be
+ imported as ``foo.bar.baz``.
+
+ If you have a package installed globally and attempt test discovery on
+ a different copy of the package then the import *could* happen from the
+ wrong place. If this happens test discovery will warn you and exit.
+
+ If you supply the start directory as a package name rather than a
+ path to a directory then discover assumes that whichever location it
+ imports from is the location you intended, so you will not get the
+ warning.
+
+Test modules and packages can customize test loading and discovery by through
+the `load_tests protocol`_.
+
.. _organizing-tests:
@@ -220,9 +354,9 @@ Organizing test code
The basic building blocks of unit testing are :dfn:`test cases` --- single
scenarios that must be set up and checked for correctness. In :mod:`unittest`,
-test cases are represented by instances of :mod:`unittest`'s :class:`TestCase`
-class. To make your own test cases you must write subclasses of
-:class:`TestCase`, or use :class:`FunctionTestCase`.
+test cases are represented by :class:`unittest.TestCase` instances.
+To make your own test cases you must write subclasses of
+:class:`TestCase` or use :class:`FunctionTestCase`.
An instance of a :class:`TestCase`\ -derived class is an object that can
completely run a single test method, together with optional set-up and tidy-up
@@ -532,24 +666,27 @@ the test unless the passed object has a certain attribute: ::
The following decorators implement test skipping and expected failures:
-.. function:: skip(reason)
+.. decorator:: skip(reason)
Unconditionally skip the decorated test. *reason* should describe why the
test is being skipped.
-.. function:: skipIf(condition, reason)
+.. decorator:: skipIf(condition, reason)
Skip the decorated test if *condition* is true.
-.. function:: skipUnless(condition, reason)
+.. decorator:: skipUnless(condition, reason)
Skip the decorated test unless *condition* is true.
-.. function:: expectedFailure
+.. decorator:: expectedFailure
Mark the test as an expected failure. If the test fails when run, the test
is not counted as a failure.
+Skipped tests will not have :meth:`setUp` or :meth:`tearDown` run around them.
+Skipped classes will not have :meth:`setUpClass` or :meth:`tearDownClass` run.
+
.. _unittest-contents:
@@ -586,6 +723,11 @@ Test cases
Here, we create two instances of :class:`WidgetTestCase`, each of which runs a
single test.
+ .. versionchanged::
+ `TestCase` can be instantiated successfully without providing a method
+ name. This makes it easier to experiment with `TestCase` from the
+ interactive interpreter.
+
*methodName* defaults to :meth:`runTest`.
:class:`TestCase` instances provide three groups of methods: one group used
@@ -615,6 +757,36 @@ Test cases
the outcome of the test method. The default implementation does nothing.
+ .. method:: setUpClass()
+
+ A class method called before tests in an individual class run.
+ ``setUpClass`` is called with the class as the only argument
+ and must be decorated as a :func:`classmethod`::
+
+ @classmethod
+ def setUpClass(cls):
+ ...
+
+ See `Class and Module Fixtures`_ for more details.
+
+ .. versionadded:: 3.2
+
+
+ .. method:: tearDownClass()
+
+ A class method called after tests in an individual class have run.
+ ``tearDownClass`` is called with the class as the only argument
+ and must be decorated as a :meth:`classmethod`::
+
+ @classmethod
+ def tearDownClass(cls):
+ ...
+
+ See `Class and Module Fixtures`_ for more details.
+
+ .. versionadded:: 3.2
+
+
.. method:: run(result=None)
Run the test, collecting the result into the test result object passed as
@@ -678,16 +850,22 @@ Test cases
| :meth:`assertNotIn(a, b) | ``a not in b`` | 3.1 |
| <TestCase.assertNotIn>` | | |
+-----------------------------------------+-----------------------------+---------------+
+ | :meth:`assertIsInstance(a, b) | ``isinstance(a, b)`` | 3.2 |
+ | <TestCase.assertIsInstance>` | | |
+ +-----------------------------------------+-----------------------------+---------------+
+ | :meth:`assertNotIsInstance(a, b) | ``not isinstance(a, b)`` | 3.2 |
+ | <TestCase.assertNotIsInstance>` | | |
+ +-----------------------------------------+-----------------------------+---------------+
All the assert methods (except :meth:`assertRaises`,
- :meth:`assertRaisesRegexp`, :meth:`assertWarns`, :meth:`assertWarnsRegexp`)
+ :meth:`assertRaisesRegex`, :meth:`assertWarns`, :meth:`assertWarnsRegex`)
accept a *msg* argument that, if specified, is used as the error message on
failure (see also :data:`longMessage`).
.. method:: assertEqual(first, second, msg=None)
- Test that *first* and *second* are equal. If the values do not compare
- equal, the test will fail.
+ Test that *first* and *second* are equal. If the values do not
+ compare equal, the test will fail.
In addition, if *first* and *second* are the exact same type and one of
list, tuple, dict, set, frozenset or str or any type that a subclass
@@ -699,11 +877,15 @@ Test cases
.. versionchanged:: 3.1
Added the automatic calling of type specific equality function.
+ .. versionchanged:: 3.2
+ :meth:`assertMultiLineEqual` added as the default type equality
+ function for comparing strings.
+
.. method:: assertNotEqual(first, second, msg=None)
- Test that *first* and *second* are not equal. If the values do compare
- equal, the test will fail.
+ Test that *first* and *second* are not equal. If the values do
+ compare equal, the test will fail.
.. method:: assertTrue(expr, msg=None)
assertFalse(expr, msg=None)
@@ -720,7 +902,8 @@ Test cases
.. method:: assertIs(first, second, msg=None)
assertIsNot(first, second, msg=None)
- Test that *first* and *second* evaluate (or don't evaluate) to the same object.
+ Test that *first* and *second* evaluate (or don't evaluate) to the
+ same object.
.. versionadded:: 3.1
@@ -741,6 +924,15 @@ Test cases
.. versionadded:: 3.1
+ .. method:: assertIsInstance(obj, cls, msg=None)
+ assertNotIsInstance(obj, cls, msg=None)
+
+ Test that *obj* is (or is not) an instance of *cls* (which can be a
+ class or a tuple of classes, as supported by :func:`isinstance`).
+
+ .. versionadded:: 3.2
+
+
It is also possible to check that exceptions and warnings are raised using
the following methods:
@@ -751,8 +943,14 @@ Test cases
| :meth:`assertRaises(exc, fun, *args, **kwds) | ``fun(*args, **kwds)`` raises `exc` | |
| <TestCase.assertRaises>` | | |
+---------------------------------------------------------+--------------------------------------+------------+
- | :meth:`assertRaisesRegexp(exc, re, fun, *args, **kwds) | ``fun(*args, **kwds)`` raises `exc` | 3.1 |
- | <TestCase.assertRaisesRegexp>` | and the message matches `re` | |
+ | :meth:`assertRaisesRegex(exc, re, fun, *args, **kwds) | ``fun(*args, **kwds)`` raises `exc` | 3.1 |
+ | <TestCase.assertRaisesRegex>` | and the message matches `re` | |
+ +---------------------------------------------------------+--------------------------------------+------------+
+ | :meth:`assertWarns(warn, fun, *args, **kwds) | ``fun(*args, **kwds)`` raises `warn` | 3.2 |
+ | <TestCase.assertWarns>` | | |
+ +---------------------------------------------------------+--------------------------------------+------------+
+ | :meth:`assertWarnsRegex(warn, re, fun, *args, **kwds) | ``fun(*args, **kwds)`` raises `warn` | 3.2 |
+ | <TestCase.assertWarnsRegex>` | and the message matches `re` | |
+---------------------------------------------------------+--------------------------------------+------------+
.. method:: assertRaises(exception, callable, *args, **kwds)
@@ -771,27 +969,97 @@ Test cases
with self.assertRaises(SomeException):
do_something()
+ The context manager will store the caught exception object in its
+ :attr:`exception` attribute. This can be useful if the intention
+ is to perform additional checks on the exception raised::
+
+ with self.assertRaises(SomeException) as cm:
+ do_something()
+
+ the_exception = cm.exception
+ self.assertEqual(the_exception.error_code, 3)
+
.. versionchanged:: 3.1
Added the ability to use :meth:`assertRaises` as a context manager.
+ .. versionchanged:: 3.2
+ Added the :attr:`exception` attribute.
- .. method:: assertRaisesRegexp(exception, regexp, callable, *args, **kwds)
- assertRaisesRegexp(exception, regexp)
- Like :meth:`assertRaises` but also tests that *regexp* matches
- on the string representation of the raised exception. *regexp* may be
+ .. method:: assertRaisesRegex(exception, regex, callable, *args, **kwds)
+ assertRaisesRegex(exception, regex)
+
+ Like :meth:`assertRaises` but also tests that *regex* matches
+ on the string representation of the raised exception. *regex* may be
a regular expression object or a string containing a regular expression
suitable for use by :func:`re.search`. Examples::
- self.assertRaisesRegexp(ValueError, 'invalid literal for.*XYZ$',
- int, 'XYZ')
+ self.assertRaisesRegex(ValueError, 'invalid literal for.*XYZ$',
+ int, 'XYZ')
or::
- with self.assertRaisesRegexp(ValueError, 'literal'):
+ with self.assertRaisesRegex(ValueError, 'literal'):
int('XYZ')
.. versionadded:: 3.1
+ under the name ``assertRaisesRegexp``.
+ .. versionchanged:: 3.2
+ Renamed to :meth:`assertRaisesRegex`.
+
+
+ .. method:: assertWarns(warning, callable, *args, **kwds)
+ assertWarns(warning)
+
+ Test that a warning is triggered when *callable* is called with any
+ positional or keyword arguments that are also passed to
+ :meth:`assertWarns`. The test passes if *warning* is triggered and
+ fails if it isn't. Also, any unexpected exception is an error.
+ To catch any of a group of warnings, a tuple containing the warning
+ classes may be passed as *warnings*.
+
+ If only the *warning* argument is given, returns a context manager so
+ that the code under test can be written inline rather than as a function::
+
+ with self.assertWarns(SomeWarning):
+ do_something()
+
+ The context manager will store the caught warning object in its
+ :attr:`warning` attribute, and the source line which triggered the
+ warnings in the :attr:`filename` and :attr:`lineno` attributes.
+ This can be useful if the intention is to perform additional checks
+ on the exception raised::
+
+ with self.assertWarns(SomeWarning) as cm:
+ do_something()
+
+ self.assertIn('myfile.py', cm.filename)
+ self.assertEqual(320, cm.lineno)
+
+ This method works regardless of the warning filters in place when it
+ is called.
+
+ .. versionadded:: 3.2
+
+
+ .. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds)
+ assertWarnsRegex(warning, regex)
+
+ Like :meth:`assertWarns` but also tests that *regex* matches on the
+ message of the triggered warning. *regex* may be a regular expression
+ object or a string containing a regular expression suitable for use
+ by :func:`re.search`. Example::
+
+ self.assertWarnsRegex(DeprecationWarning,
+ r'legacy_function\(\) is deprecated',
+ legacy_function, 'XYZ')
+
+ or::
+
+ with self.assertWarnsRegex(RuntimeWarning, 'unsafe frobnicating'):
+ frobnicate('/etc/passwd')
+
+ .. versionadded:: 3.2
@@ -818,11 +1086,15 @@ Test cases
| :meth:`assertLessEqual(a, b) | ``a <= b`` | 3.1 |
| <TestCase.assertLessEqual>` | | |
+---------------------------------------+--------------------------------+--------------+
- | :meth:`assertRegexpMatches(s, re) | ``regex.search(s)`` | 3.1 |
- | <TestCase.assertRegexpMatches>` | | |
+ | :meth:`assertRegex(s, re) | ``regex.search(s)`` | 3.1 |
+ | <TestCase.assertRegex>` | | |
+ +---------------------------------------+--------------------------------+--------------+
+ | :meth:`assertNotRegex(s, re) | ``not regex.search(s)`` | 3.2 |
+ | <TestCase.assertNotRegex>` | | |
+---------------------------------------+--------------------------------+--------------+
- | :meth:`assertDictContainsSubset(a, b) | all the key/value pairs | 3.1 |
- | <TestCase.assertDictContainsSubset>` | in `a` exist in `b` | |
+ | :meth:`assertCountEqual(a, b) | `a` and `b` have the same | 3.2 |
+ | <TestCase.assertCountEqual>` | elements in the same number, | |
+ | | regardless of their order | |
+---------------------------------------+--------------------------------+--------------+
@@ -840,6 +1112,11 @@ Test cases
Supplying both *delta* and *places* raises a ``TypeError``.
+ .. versionchanged:: 3.2
+ :meth:`assertAlmostEqual` automatically considers almost equal objects
+ that compare equal. :meth:`assertNotAlmostEqual` automatically fails
+ if the objects compare equal. Added the *delta* keyword argument.
+
.. method:: assertGreater(first, second, msg=None)
assertGreaterEqual(first, second, msg=None)
@@ -855,38 +1132,64 @@ Test cases
.. versionadded:: 3.1
- .. method:: assertRegexpMatches(text, regexp, msg=None)
+ .. method:: assertRegex(text, regex, msg=None)
+ assertNotRegex(text, regex, msg=None)
- Test that a *regexp* search matches *text*. In case
+ Test that a *regex* search matches (or does not match) *text*. In case
of failure, the error message will include the pattern and the *text* (or
- the pattern and the part of *text* that unexpectedly matched). *regexp*
+ the pattern and the part of *text* that unexpectedly matched). *regex*
may be a regular expression object or a string containing a regular
expression suitable for use by :func:`re.search`.
- .. versionadded:: 3.1 :meth:`~TestCase.assertRegexpMatches`
+ .. versionadded:: 3.1
+ under the name ``assertRegexpMatches``.
+ .. versionchanged:: 3.2
+ The method ``assertRegexpMatches()`` has been renamed to
+ :meth:`.assertRegex`.
+ .. versionadded:: 3.2
+ :meth:`.assertNotRegex`.
+
+ .. method:: assertDictContainsSubset(subset, dictionary, msg=None)
- .. method:: assertDictContainsSubset(expected, actual, msg=None)
+ Tests whether the key/value pairs in *dictionary* are a superset of
+ those in *subset*. If not, an error message listing the missing keys
+ and mismatched values is generated.
- Tests whether the key/value pairs in dictionary *actual* are a
- superset of those in *expected*. If not, an error message listing
- the missing keys and mismatched values is generated.
+ Note, the arguments are in the opposite order of what the method name
+ dictates. Instead, consider using the set-methods on :ref:`dictionary
+ views <dict-views>`, for example: ``d.keys() <= e.keys()`` or
+ ``d.items() <= d.items()``.
.. versionadded:: 3.1
.. deprecated:: 3.2
- .. method:: assertSameElements(actual, expected, msg=None)
+ .. method:: assertCountEqual(first, second, msg=None)
- Test that sequence *expected* contains the same elements as *actual*,
+ Test that sequence *first* contains the same elements as *second*,
+ regardless of their order. When they don't, an error message listing the
+ differences between the sequences will be generated.
+
+ Duplicate elements are *not* ignored when comparing *first* and
+ *second*. It verifies whether each element has the same count in both
+ sequences. Equivalent to:
+ ``assertEqual(Counter(list(first)), Counter(list(second)))``
+ but works with sequences of unhashable objects as well.
+
+ .. versionadded:: 3.2
+
+ .. method:: assertSameElements(first, second, msg=None)
+
+ Test that sequence *first* contains the same elements as *second*,
regardless of their order. When they don't, an error message listing
the differences between the sequences will be generated.
- Duplicate elements are ignored when comparing *actual* and *expected*.
- It is the equivalent of ``assertEqual(set(expected), set(actual))``
+ Duplicate elements are ignored when comparing *first* and *second*.
+ It is the equivalent of ``assertEqual(set(first), set(second))``
but it works with sequences of unhashable objects as well. Because
duplicates are ignored, this method has been deprecated in favour of
- :meth:`assertItemsEqual`.
+ :meth:`assertCountEqual`.
.. versionadded:: 3.1
.. deprecated:: 3.2
@@ -950,10 +1253,10 @@ Test cases
.. versionadded:: 3.1
- .. method:: assertSequenceEqual(seq1, seq2, msg=None, seq_type=None)
+ .. method:: assertSequenceEqual(first, second, msg=None, seq_type=None)
Tests that two sequences are equal. If a *seq_type* is supplied, both
- *seq1* and *seq2* must be instances of *seq_type* or a failure will
+ *first* and *second* must be instances of *seq_type* or a failure will
be raised. If the sequences are different an error message is
constructed that shows the difference between the two.
@@ -964,8 +1267,8 @@ Test cases
.. versionadded:: 3.1
- .. method:: assertListEqual(list1, list2, msg=None)
- assertTupleEqual(tuple1, tuple2, msg=None)
+ .. method:: assertListEqual(first, second, msg=None)
+ assertTupleEqual(first, second, msg=None)
Tests that two lists or tuples are equal. If not an error message is
constructed that shows only the differences between the two. An error
@@ -976,19 +1279,19 @@ Test cases
.. versionadded:: 3.1
- .. method:: assertSetEqual(set1, set2, msg=None)
+ .. method:: assertSetEqual(first, second, msg=None)
Tests that two sets are equal. If not, an error message is constructed
that lists the differences between the sets. This method is used by
default when comparing sets or frozensets with :meth:`assertEqual`.
- Fails if either of *set1* or *set2* does not have a :meth:`set.difference`
+ Fails if either of *first* or *second* does not have a :meth:`set.difference`
method.
.. versionadded:: 3.1
- .. method:: assertDictEqual(expected, actual, msg=None)
+ .. method:: assertDictEqual(first, second, msg=None)
Test that two dictionaries are equal. If not, an error message is
constructed that shows the differences in the dictionaries. This
@@ -1029,8 +1332,8 @@ Test cases
to ``True`` allows you to have a custom error message in addition to the
normal one.
- This attribute defaults to ``False``, meaning that a custom message passed
- to an assert method will silence the normal message.
+ This attribute defaults to ``True``. If set to False then a custom message
+ passed to an assert method will silence the normal message.
The class setting can be overridden in individual tests by assigning an
instance attribute to ``True`` or ``False`` before calling the assert methods.
@@ -1038,6 +1341,21 @@ Test cases
.. versionadded:: 3.1
+ .. attribute:: maxDiff
+
+ This attribute controls the maximum length of diffs output by assert
+ methods that report diffs on failure. It defaults to 80*8 characters.
+ Assert methods affected by this attribute are
+ :meth:`assertSequenceEqual` (including all the sequence comparison
+ methods that delegate to it), :meth:`assertDictEqual` and
+ :meth:`assertMultiLineEqual`.
+
+ Setting ``maxDiff`` to None means that there is no maximum length of
+ diffs.
+
+ .. versionadded:: 3.2
+
+
Testing frameworks can use the following methods to collect information on
the test:
@@ -1070,13 +1388,13 @@ Test cases
Returns a description of the test, or ``None`` if no description
has been provided. The default implementation of this method
returns the first line of the test method's docstring, if available,
- along with the method name.
+ or ``None``.
.. versionchanged:: 3.1
- In earlier versions this only returned the first line of the test
- method's docstring, if available or the :const:`None`. That led to
- undesirable behavior of not printing the test name when someone was
- thoughtful enough to write a docstring.
+ In 3.1 this was changed to add the test name to the short description
+ even in the presence of a docstring. This caused compatibility issues
+ with unittest extensions and adding the test name was moved to the
+ :class:`TextTestResult` in Python 3.2.
.. method:: addCleanup(function, *args, **kwargs)
@@ -1118,6 +1436,8 @@ Test cases
:mod:`unittest`-based test framework.
+.. _deprecated-aliases:
+
Deprecated aliases
##################
@@ -1125,21 +1445,27 @@ For historical reasons, some of the :class:`TestCase` methods had one or more
aliases that are now deprecated. The following table lists the correct names
along with their deprecated aliases:
- ============================== ===============================
- Method Name Deprecated alias(es)
- ============================== ===============================
- :meth:`.assertEqual` failUnlessEqual, assertEquals
- :meth:`.assertNotEqual` failIfEqual
- :meth:`.assertTrue` failUnless, assert\_
+ ============================== ====================== ======================
+ Method Name Deprecated alias Deprecated alias
+ ============================== ====================== ======================
+ :meth:`.assertEqual` failUnlessEqual assertEquals
+ :meth:`.assertNotEqual` failIfEqual assertNotEquals
+ :meth:`.assertTrue` failUnless assert\_
:meth:`.assertFalse` failIf
:meth:`.assertRaises` failUnlessRaises
- :meth:`.assertAlmostEqual` failUnlessAlmostEqual
- :meth:`.assertNotAlmostEqual` failIfAlmostEqual
- ============================== ===============================
+ :meth:`.assertAlmostEqual` failUnlessAlmostEqual assertAlmostEquals
+ :meth:`.assertNotAlmostEqual` failIfAlmostEqual assertNotAlmostEquals
+ :meth:`.assertRegex` assertRegexpMatches
+ :meth:`.assertRaisesRegex` assertRaisesRegexp
+ ============================== ====================== ======================
.. deprecated:: 3.1
- the aliases listed in the second column
-
+ the fail* aliases listed in the second column.
+ .. deprecated:: 3.2
+ the assert* aliases listed in the third column.
+ .. deprecated:: 3.2
+ ``assertRegexpMatches`` and ``assertRaisesRegexp`` have been renamed to
+ :meth:`.assertRegex` and :meth:`.assertRaisesRegex`
.. _testsuite-objects:
@@ -1209,6 +1535,11 @@ Grouping tests
(for example when counting tests or comparing for equality)
so the tests returned must be the same for repeated iterations.
+ .. versionchanged:: 3.2
+ In earlier versions the :class:`TestSuite` accessed tests directly rather
+ than through iteration, so overriding :meth:`__iter__` wasn't sufficient
+ for providing tests.
+
In the typical usage of a :class:`TestSuite` object, the :meth:`run` method
is invoked by a :class:`TestRunner` rather than by the end-user test harness.
@@ -1248,6 +1579,13 @@ Loading and running tests
directly does not play well with this method. Doing so, however, can
be useful when the fixtures are different and defined in subclasses.
+ If a module provides a ``load_tests`` function it will be called to
+ load the tests. This allows modules to customize test loading.
+ This is the `load_tests protocol`_.
+
+ .. versionchanged:: 3.2
+ Support for ``load_tests`` added.
+
.. method:: loadTestsFromName(name, module=None)
@@ -1287,6 +1625,39 @@ Loading and running tests
this should be a subclass of :class:`TestCase`.
+ .. method:: discover(start_dir, pattern='test*.py', top_level_dir=None)
+
+ Find and return all test modules from the specified start directory,
+ recursing into subdirectories to find them. Only test files that match
+ *pattern* will be loaded. (Using shell style pattern matching.) Only
+ module names that are importable (i.e. are valid Python identifiers) will
+ be loaded.
+
+ All test modules must be importable from the top level of the project. If
+ the start directory is not the top level directory then the top level
+ directory must be specified separately.
+
+ If importing a module fails, for example due to a syntax error, then this
+ will be recorded as a single error and discovery will continue.
+
+ If a test package name (directory with :file:`__init__.py`) matches the
+ pattern then the package will be checked for a ``load_tests``
+ function. If this exists then it will be called with *loader*, *tests*,
+ *pattern*.
+
+ If load_tests exists then discovery does *not* recurse into the package,
+ ``load_tests`` is responsible for loading all tests in the package.
+
+ The pattern is deliberately not stored as a loader attribute so that
+ packages can continue discovery themselves. *top_level_dir* is stored so
+ ``load_tests`` does not need to pass this argument in to
+ ``loader.discover()``.
+
+ *start_dir* can be a dotted module name as well as a directory.
+
+ .. versionadded:: 3.2
+
+
The following attributes of a :class:`TestLoader` can be configured either by
subclassing or assignment on an instance:
@@ -1375,6 +1746,24 @@ Loading and running tests
The total number of tests run so far.
+ .. attribute:: buffer
+
+ If set to true, ``sys.stdout`` and ``sys.stderr`` will be buffered in between
+ :meth:`startTest` and :meth:`stopTest` being called. Collected output will
+ only be echoed onto the real ``sys.stdout`` and ``sys.stderr`` if the test
+ fails or errors. Any output is also attached to the failure / error message.
+
+ .. versionadded:: 3.2
+
+
+ .. attribute:: failfast
+
+ If set to true :meth:`stop` will be called on the first failure or error,
+ halting the test run.
+
+ .. versionadded:: 3.2
+
+
.. method:: wasSuccessful()
Return ``True`` if all tests run so far have passed, otherwise returns
@@ -1403,18 +1792,11 @@ Loading and running tests
Called when the test case *test* is about to be run.
- The default implementation simply increments the instance's :attr:`testsRun`
- counter.
-
-
.. method:: stopTest(test)
Called after the test case *test* has been executed, regardless of the
outcome.
- The default implementation does nothing.
-
-
.. method:: startTestRun(test)
Called once before any tests are executed.
@@ -1485,6 +1867,16 @@ Loading and running tests
:attr:`unexpectedSuccesses` attribute.
+.. class:: TextTestResult(stream, descriptions, verbosity)
+
+ A concrete implementation of :class:`TestResult` used by the
+ :class:`TextTestRunner`.
+
+ .. versionadded:: 3.2
+ This class was previously named ``_TextTestResult``. The old name still
+ exists as an alias but is deprecated.
+
+
.. data:: defaultTestLoader
Instance of the :class:`TestLoader` class intended to be shared. If no
@@ -1492,20 +1884,46 @@ Loading and running tests
instead of repeatedly creating new instances.
-.. class:: TextTestRunner(stream=sys.stderr, descriptions=True, verbosity=1)
+.. class:: TextTestRunner(stream=None, descriptions=True, verbosity=1, runnerclass=None, warnings=None)
- A basic test runner implementation which prints results on standard error. It
+ A basic test runner implementation that outputs results to a stream. If *stream*
+ is `None`, the default, `sys.stderr` is used as the output stream. This class
has a few configurable parameters, but is essentially very simple. Graphical
applications which run test suites should provide alternate implementations.
+ By default this runner shows :exc:`DeprecationWarning`,
+ :exc:`PendingDeprecationWarning`, and :exc:`ImportWarning` even if they are
+ :ref:`ignored by default <warning-ignored>`. Deprecation warnings caused by
+ :ref:`deprecated unittest methods <deprecated-aliases>` are also
+ special-cased and, when the warning filters are ``'default'`` or ``'always'``,
+ they will appear only once per-module, in order to avoid too many warning
+ messages. This behavior can be overridden using the :option:`-Wd` or
+ :option:`-Wa` options and leaving *warnings* to ``None``.
+
+ .. versionchanged:: 3.2
+ Added the ``warnings`` argument.
+
+ .. versionchanged:: 3.2
+ The default stream is set to `sys.stderr` at instantiation time rather
+ than import time.
+
.. method:: _makeResult()
This method returns the instance of ``TestResult`` used by :meth:`run`.
It is not intended to be called directly, but can be overridden in
subclasses to provide a custom ``TestResult``.
+ ``_makeResult()`` instantiates the class or callable passed in the
+ ``TextTestRunner`` constructor as the ``resultclass`` argument. It
+ defaults to :class:`TextTestResult` if no ``resultclass`` is provided.
+ The result class is instantiated with the following arguments::
-.. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, testLoader=unittest.defaultTestLoader, exit=True)
+ stream, descriptions, verbosity
+
+
+.. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, \
+ testLoader=unittest.defaultTestLoader, exit=True, verbosity=1, \
+ failfast=None, catchbreak=None, buffer=None, warnings=None)
A command-line program that runs a set of tests; this is primarily for making
test modules conveniently executable. The simplest use for this function is to
@@ -1514,6 +1932,11 @@ Loading and running tests
if __name__ == '__main__':
unittest.main()
+ You can run tests with more detailed information by passing in the verbosity
+ argument::
+
+ if __name__ == '__main__':
+ unittest.main(verbosity=2)
The *testRunner* argument can either be a test runner class or an already
created instance of it. By default ``main`` calls :func:`sys.exit` with
@@ -1526,8 +1949,228 @@ Loading and running tests
>>> from unittest import main
>>> main(module='test_module', exit=False)
+ The ``failfast``, ``catchbreak`` and ``buffer`` parameters have the same
+ effect as the same-name `command-line options`_.
+
+ The *warning* argument specifies the :ref:`warning filter <warning-filter>`
+ that should be used while running the tests. If it's not specified, it will
+ remain ``None`` if a :option:`-W` option is passed to :program:`python`,
+ otherwise it will be set to ``'default'``.
+
Calling ``main`` actually returns an instance of the ``TestProgram`` class.
This stores the result of the tests run as the ``result`` attribute.
.. versionchanged:: 3.1
The ``exit`` parameter was added.
+
+ .. versionchanged:: 3.2
+ The ``verbosity``, ``failfast``, ``catchbreak``, ``buffer``
+ and ``warnings`` parameters were added.
+
+
+load_tests Protocol
+###################
+
+.. versionadded:: 3.2
+
+Modules or packages can customize how tests are loaded from them during normal
+test runs or test discovery by implementing a function called ``load_tests``.
+
+If a test module defines ``load_tests`` it will be called by
+:meth:`TestLoader.loadTestsFromModule` with the following arguments::
+
+ load_tests(loader, standard_tests, None)
+
+It should return a :class:`TestSuite`.
+
+*loader* is the instance of :class:`TestLoader` doing the loading.
+*standard_tests* are the tests that would be loaded by default from the
+module. It is common for test modules to only want to add or remove tests
+from the standard set of tests.
+The third argument is used when loading packages as part of test discovery.
+
+A typical ``load_tests`` function that loads tests from a specific set of
+:class:`TestCase` classes may look like::
+
+ test_cases = (TestCase1, TestCase2, TestCase3)
+
+ def load_tests(loader, tests, pattern):
+ suite = TestSuite()
+ for test_class in test_cases:
+ tests = loader.loadTestsFromTestCase(test_class)
+ suite.addTests(tests)
+ return suite
+
+If discovery is started, either from the command line or by calling
+:meth:`TestLoader.discover`, with a pattern that matches a package
+name then the package :file:`__init__.py` will be checked for ``load_tests``.
+
+.. note::
+
+ The default pattern is 'test*.py'. This matches all Python files
+ that start with 'test' but *won't* match any test directories.
+
+ A pattern like 'test*' will match test packages as well as
+ modules.
+
+If the package :file:`__init__.py` defines ``load_tests`` then it will be
+called and discovery not continued into the package. ``load_tests``
+is called with the following arguments::
+
+ load_tests(loader, standard_tests, pattern)
+
+This should return a :class:`TestSuite` representing all the tests
+from the package. (``standard_tests`` will only contain tests
+collected from :file:`__init__.py`.)
+
+Because the pattern is passed into ``load_tests`` the package is free to
+continue (and potentially modify) test discovery. A 'do nothing'
+``load_tests`` function for a test package would look like::
+
+ def load_tests(loader, standard_tests, pattern):
+ # top level directory cached on loader instance
+ this_dir = os.path.dirname(__file__)
+ package_tests = loader.discover(start_dir=this_dir, pattern=pattern)
+ standard_tests.addTests(package_tests)
+ return standard_tests
+
+
+Class and Module Fixtures
+-------------------------
+
+Class and module level fixtures are implemented in :class:`TestSuite`. When
+the test suite encounters a test from a new class then :meth:`tearDownClass`
+from the previous class (if there is one) is called, followed by
+:meth:`setUpClass` from the new class.
+
+Similarly if a test is from a different module from the previous test then
+``tearDownModule`` from the previous module is run, followed by
+``setUpModule`` from the new module.
+
+After all the tests have run the final ``tearDownClass`` and
+``tearDownModule`` are run.
+
+Note that shared fixtures do not play well with [potential] features like test
+parallelization and they break test isolation. They should be used with care.
+
+The default ordering of tests created by the unittest test loaders is to group
+all tests from the same modules and classes together. This will lead to
+``setUpClass`` / ``setUpModule`` (etc) being called exactly once per class and
+module. If you randomize the order, so that tests from different modules and
+classes are adjacent to each other, then these shared fixture functions may be
+called multiple times in a single test run.
+
+Shared fixtures are not intended to work with suites with non-standard
+ordering. A ``BaseTestSuite`` still exists for frameworks that don't want to
+support shared fixtures.
+
+If there are any exceptions raised during one of the shared fixture functions
+the test is reported as an error. Because there is no corresponding test
+instance an ``_ErrorHolder`` object (that has the same interface as a
+:class:`TestCase`) is created to represent the error. If you are just using
+the standard unittest test runner then this detail doesn't matter, but if you
+are a framework author it may be relevant.
+
+
+setUpClass and tearDownClass
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These must be implemented as class methods::
+
+ import unittest
+
+ class Test(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ cls._connection = createExpensiveConnectionObject()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls._connection.destroy()
+
+If you want the ``setUpClass`` and ``tearDownClass`` on base classes called
+then you must call up to them yourself. The implementations in
+:class:`TestCase` are empty.
+
+If an exception is raised during a ``setUpClass`` then the tests in the class
+are not run and the ``tearDownClass`` is not run. Skipped classes will not
+have ``setUpClass`` or ``tearDownClass`` run. If the exception is a
+``SkipTest`` exception then the class will be reported as having been skipped
+instead of as an error.
+
+
+setUpModule and tearDownModule
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These should be implemented as functions::
+
+ def setUpModule():
+ createConnection()
+
+ def tearDownModule():
+ closeConnection()
+
+If an exception is raised in a ``setUpModule`` then none of the tests in the
+module will be run and the ``tearDownModule`` will not be run. If the exception is a
+``SkipTest`` exception then the module will be reported as having been skipped
+instead of as an error.
+
+
+Signal Handling
+---------------
+
+.. versionadded:: 3.2
+
+The :option:`-c/--catch <unittest -c>` command-line option to unittest,
+along with the ``catchbreak`` parameter to :func:`unittest.main()`, provide
+more friendly handling of control-C during a test run. With catch break
+behavior enabled control-C will allow the currently running test to complete,
+and the test run will then end and report all the results so far. A second
+control-c will raise a :exc:`KeyboardInterrupt` in the usual way.
+
+The control-c handling signal handler attempts to remain compatible with code or
+tests that install their own :const:`signal.SIGINT` handler. If the ``unittest``
+handler is called but *isn't* the installed :const:`signal.SIGINT` handler,
+i.e. it has been replaced by the system under test and delegated to, then it
+calls the default handler. This will normally be the expected behavior by code
+that replaces an installed handler and delegates to it. For individual tests
+that need ``unittest`` control-c handling disabled the :func:`removeHandler`
+decorator can be used.
+
+There are a few utility functions for framework authors to enable control-c
+handling functionality within test frameworks.
+
+.. function:: installHandler()
+
+ Install the control-c handler. When a :const:`signal.SIGINT` is received
+ (usually in response to the user pressing control-c) all registered results
+ have :meth:`~TestResult.stop` called.
+
+
+.. function:: registerResult(result)
+
+ Register a :class:`TestResult` object for control-c handling. Registering a
+ result stores a weak reference to it, so it doesn't prevent the result from
+ being garbage collected.
+
+ Registering a :class:`TestResult` object has no side-effects if control-c
+ handling is not enabled, so test frameworks can unconditionally register
+ all results they create independently of whether or not handling is enabled.
+
+
+.. function:: removeResult(result)
+
+ Remove a registered result. Once a result has been removed then
+ :meth:`~TestResult.stop` will no longer be called on that result object in
+ response to a control-c.
+
+
+.. function:: removeHandler(function=None)
+
+ When called without arguments this function removes the control-c handler
+ if it has been installed. This function can also be used as a test decorator
+ to temporarily remove the handler whilst the test is being executed::
+
+ @unittest.removeHandler
+ def test_signal_handling(self):
+ ...
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
index 0ed27ba409..a6d72672ab 100644
--- a/Doc/library/urllib.parse.rst
+++ b/Doc/library/urllib.parse.rst
@@ -24,7 +24,15 @@ following URL schemes: ``file``, ``ftp``, ``gopher``, ``hdl``, ``http``,
``rsync``, ``rtsp``, ``rtspu``, ``sftp``, ``shttp``, ``sip``, ``sips``,
``snews``, ``svn``, ``svn+ssh``, ``telnet``, ``wais``.
-The :mod:`urllib.parse` module defines the following functions:
+The :mod:`urllib.parse` module defines functions that fall into two broad
+categories: URL parsing and URL quoting. These are covered in detail in
+the following sections.
+
+URL Parsing
+-----------
+
+The URL parsing functions focus on splitting a URL string into its components,
+or on combining URL components into a URL string.
.. function:: urlparse(urlstring, scheme='', allow_fragments=True)
@@ -104,8 +112,11 @@ The :mod:`urllib.parse` module defines the following functions:
See section :ref:`urlparse-result-object` for more information on the result
object.
+ .. versionchanged:: 3.2
+ Added IPv6 URL parsing capabilities.
+
-.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False)
+.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace')
Parse a query string given as a string argument (data of type
:mimetype:`application/x-www-form-urlencoded`). Data are returned as a
@@ -122,11 +133,19 @@ The :mod:`urllib.parse` module defines the following functions:
parsing errors. If false (the default), errors are silently ignored. If true,
errors raise a :exc:`ValueError` exception.
+ The optional *encoding* and *errors* parameters specify how to decode
+ percent-encoded sequences into Unicode characters, as accepted by the
+ :meth:`bytes.decode` method.
+
Use the :func:`urllib.parse.urlencode` function to convert such
dictionaries into query strings.
-.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False)
+ .. versionchanged:: 3.2
+ Add *encoding* and *errors* parameters.
+
+
+.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace')
Parse a query string given as a string argument (data of type
:mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of
@@ -142,9 +161,16 @@ The :mod:`urllib.parse` module defines the following functions:
parsing errors. If false (the default), errors are silently ignored. If true,
errors raise a :exc:`ValueError` exception.
+ The optional *encoding* and *errors* parameters specify how to decode
+ percent-encoded sequences into Unicode characters, as accepted by the
+ :meth:`bytes.decode` method.
+
Use the :func:`urllib.parse.urlencode` function to convert such lists of pairs into
query strings.
+ .. versionchanged:: 3.2
+ Add *encoding* and *errors* parameters.
+
.. function:: urlunparse(parts)
@@ -239,6 +265,162 @@ The :mod:`urllib.parse` module defines the following functions:
string. If there is no fragment identifier in *url*, return *url* unmodified
and an empty string.
+ The return value is actually an instance of a subclass of :class:`tuple`. This
+ class has the following additional read-only convenience attributes:
+
+ +------------------+-------+-------------------------+----------------------+
+ | Attribute | Index | Value | Value if not present |
+ +==================+=======+=========================+======================+
+ | :attr:`url` | 0 | URL with no fragment | empty string |
+ +------------------+-------+-------------------------+----------------------+
+ | :attr:`fragment` | 1 | Fragment identifier | empty string |
+ +------------------+-------+-------------------------+----------------------+
+
+ See section :ref:`urlparse-result-object` for more information on the result
+ object.
+
+ .. versionchanged:: 3.2
+ Result is a structured object rather than a simple 2-tuple.
+
+.. _parsing-ascii-encoded-bytes:
+
+Parsing ASCII Encoded Bytes
+---------------------------
+
+The URL parsing functions were originally designed to operate on character
+strings only. In practice, it is useful to be able to manipulate properly
+quoted and encoded URLs as sequences of ASCII bytes. Accordingly, the
+URL parsing functions in this module all operate on :class:`bytes` and
+:class:`bytearray` objects in addition to :class:`str` objects.
+
+If :class:`str` data is passed in, the result will also contain only
+:class:`str` data. If :class:`bytes` or :class:`bytearray` data is
+passed in, the result will contain only :class:`bytes` data.
+
+Attempting to mix :class:`str` data with :class:`bytes` or
+:class:`bytearray` in a single function call will result in a
+:exc:`TypeError` being raised, while attempting to pass in non-ASCII
+byte values will trigger :exc:`UnicodeDecodeError`.
+
+To support easier conversion of result objects between :class:`str` and
+:class:`bytes`, all return values from URL parsing functions provide
+either an :meth:`encode` method (when the result contains :class:`str`
+data) or a :meth:`decode` method (when the result contains :class:`bytes`
+data). The signatures of these methods match those of the corresponding
+:class:`str` and :class:`bytes` methods (except that the default encoding
+is ``'ascii'`` rather than ``'utf-8'``). Each produces a value of a
+corresponding type that contains either :class:`bytes` data (for
+:meth:`encode` methods) or :class:`str` data (for
+:meth:`decode` methods).
+
+Applications that need to operate on potentially improperly quoted URLs
+that may contain non-ASCII data will need to do their own decoding from
+bytes to characters before invoking the URL parsing methods.
+
+The behaviour described in this section applies only to the URL parsing
+functions. The URL quoting functions use their own rules when producing
+or consuming byte sequences as detailed in the documentation of the
+individual URL quoting functions.
+
+.. versionchanged:: 3.2
+ URL parsing functions now accept ASCII encoded byte sequences
+
+
+.. _urlparse-result-object:
+
+Structured Parse Results
+------------------------
+
+The result objects from the :func:`urlparse`, :func:`urlsplit` and
+:func:`urldefrag` functions are subclasses of the :class:`tuple` type.
+These subclasses add the attributes listed in the documentation for
+those functions, the encoding and decoding support described in the
+previous section, as well as an additional method:
+
+.. method:: urllib.parse.SplitResult.geturl()
+
+ Return the re-combined version of the original URL as a string. This may
+ differ from the original URL in that the scheme may be normalized to lower
+ case and empty components may be dropped. Specifically, empty parameters,
+ queries, and fragment identifiers will be removed.
+
+ For :func:`urldefrag` results, only empty fragment identifiers will be removed.
+ For :func:`urlsplit` and :func:`urlparse` results, all noted changes will be
+ made to the URL returned by this method.
+
+ The result of this method remains unchanged if passed back through the original
+ parsing function:
+
+ >>> from urllib.parse import urlsplit
+ >>> url = 'HTTP://www.Python.org/doc/#'
+ >>> r1 = urlsplit(url)
+ >>> r1.geturl()
+ 'http://www.Python.org/doc/'
+ >>> r2 = urlsplit(r1.geturl())
+ >>> r2.geturl()
+ 'http://www.Python.org/doc/'
+
+
+The following classes provide the implementations of the structured parse
+results when operating on :class:`str` objects:
+
+.. class:: DefragResult(url, fragment)
+
+ Concrete class for :func:`urldefrag` results containing :class:`str`
+ data. The :meth:`encode` method returns a :class:`DefragResultBytes`
+ instance.
+
+ .. versionadded:: 3.2
+
+.. class:: ParseResult(scheme, netloc, path, params, query, fragment)
+
+ Concrete class for :func:`urlparse` results containing :class:`str`
+ data. The :meth:`encode` method returns a :class:`ParseResultBytes`
+ instance.
+
+.. class:: SplitResult(scheme, netloc, path, query, fragment)
+
+ Concrete class for :func:`urlsplit` results containing :class:`str`
+ data. The :meth:`encode` method returns a :class:`SplitResultBytes`
+ instance.
+
+
+The following classes provide the implementations of the parse results when
+operating on :class:`bytes` or :class:`bytearray` objects:
+
+.. class:: DefragResultBytes(url, fragment)
+
+ Concrete class for :func:`urldefrag` results containing :class:`bytes`
+ data. The :meth:`decode` method returns a :class:`DefragResult`
+ instance.
+
+ .. versionadded:: 3.2
+
+.. class:: ParseResultBytes(scheme, netloc, path, params, query, fragment)
+
+ Concrete class for :func:`urlparse` results containing :class:`bytes`
+ data. The :meth:`decode` method returns a :class:`ParseResult`
+ instance.
+
+ .. versionadded:: 3.2
+
+.. class:: SplitResultBytes(scheme, netloc, path, query, fragment)
+
+ Concrete class for :func:`urlsplit` results containing :class:`bytes`
+ data. The :meth:`decode` method returns a :class:`SplitResult`
+ instance.
+
+ .. versionadded:: 3.2
+
+
+URL Quoting
+-----------
+
+The URL quoting functions focus on taking program data and making it safe
+for use as URL components by quoting special characters and appropriately
+encoding non-ASCII text. They also support reversing these operations to
+recreate the original data from the contents of a URL component if that
+task isn't already covered by the URL parsing functions above.
.. function:: quote(string, safe='/', encoding=None, errors=None)
@@ -319,16 +501,16 @@ The :mod:`urllib.parse` module defines the following functions:
If it is a :class:`str`, unescaped non-ASCII characters in *string*
are encoded into UTF-8 bytes.
- Example: ``unquote_to_bytes('a%26%EF')`` yields
- ``b'a&\xef'``.
+ Example: ``unquote_to_bytes('a%26%EF')`` yields ``b'a&\xef'``.
.. function:: urlencode(query, doseq=False, safe='', encoding=None, errors=None)
Convert a mapping object or a sequence of two-element tuples, which may
- either be a :class:`str` or a :class:`bytes`, to a "percent-encoded" string,
- suitable to pass to :func:`urlopen` above as the optional *data* argument.
- This is useful to pass a dictionary of form fields to a ``POST`` request.
+ either be a :class:`str` or a :class:`bytes`, to a "percent-encoded"
+ string. The resultant string must be converted to bytes using the
+ user-specified encoding before it is sent to :func:`urlopen` as the optional
+ *data* argument.
The resulting string is a series of ``key=value`` pairs separated by ``'&'``
characters, where both *key* and *value* are quoted using :func:`quote_plus`
above. When a sequence of two-element tuples is used as the *query*
@@ -337,12 +519,16 @@ The :mod:`urllib.parse` module defines the following functions:
the optional parameter *doseq* is evaluates to *True*, individual
``key=value`` pairs separated by ``'&'`` are generated for each element of
the value sequence for the key. The order of parameters in the encoded
- string will match the order of parameter tuples in the sequence. This module
- provides the functions :func:`parse_qs` and :func:`parse_qsl` which are used
- to parse query strings into Python data structures.
+ string will match the order of parameter tuples in the sequence.
When *query* parameter is a :class:`str`, the *safe*, *encoding* and *error*
- parameters are sent the :func:`quote_plus` for encoding.
+ parameters are passed down to :func:`quote_plus` for encoding.
+
+ To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are
+ provided in this module to parse query strings into Python data structures.
+
+ Refer to :ref:`urllib examples <urllib-examples>` to find out how urlencode
+ method can be used for generating query string for a URL or data for POST.
.. versionchanged:: 3.2
Query parameter supports bytes and string objects.
@@ -356,6 +542,9 @@ The :mod:`urllib.parse` module defines the following functions:
mostly for backward compatibility purposes and for certain de-facto
parsing requirements as commonly observed in major browsers.
+ :rfc:`2732` - Format for Literal IPv6 Addresses in URL's.
+ This specifies the parsing requirements of IPv6 URLs.
+
:rfc:`2396` - Uniform Resource Identifiers (URI): Generic Syntax
Document describing the generic syntactic requirements for both Uniform Resource
Names (URNs) and Uniform Resource Locators (URLs).
@@ -370,57 +559,3 @@ The :mod:`urllib.parse` module defines the following functions:
:rfc:`1738` - Uniform Resource Locators (URL)
This specifies the formal syntax and semantics of absolute URLs.
-
-
-.. _urlparse-result-object:
-
-Results of :func:`urlparse` and :func:`urlsplit`
-------------------------------------------------
-
-The result objects from the :func:`urlparse` and :func:`urlsplit` functions are
-subclasses of the :class:`tuple` type. These subclasses add the attributes
-described in those functions, as well as provide an additional method:
-
-.. method:: ParseResult.geturl()
-
- Return the re-combined version of the original URL as a string. This may differ
- from the original URL in that the scheme will always be normalized to lower case
- and empty components may be dropped. Specifically, empty parameters, queries,
- and fragment identifiers will be removed.
-
- The result of this method is a fixpoint if passed back through the original
- parsing function:
-
- >>> import urllib.parse
- >>> url = 'HTTP://www.Python.org/doc/#'
-
- >>> r1 = urllib.parse.urlsplit(url)
- >>> r1.geturl()
- 'http://www.Python.org/doc/'
-
- >>> r2 = urllib.parse.urlsplit(r1.geturl())
- >>> r2.geturl()
- 'http://www.Python.org/doc/'
-
-
-The following classes provide the implementations of the parse results:
-
-.. class:: BaseResult
-
- Base class for the concrete result classes. This provides most of the
- attribute definitions. It does not provide a :meth:`geturl` method. It is
- derived from :class:`tuple`, but does not override the :meth:`__init__` or
- :meth:`__new__` methods.
-
-
-.. class:: ParseResult(scheme, netloc, path, params, query, fragment)
-
- Concrete class for :func:`urlparse` results. The :meth:`__new__` method is
- overridden to support checking that the right number of arguments are passed.
-
-
-.. class:: SplitResult(scheme, netloc, path, query, fragment)
-
- Concrete class for :func:`urlsplit` results. The :meth:`__new__` method is
- overridden to support checking that the right number of arguments are passed.
-
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
index 3ba2c15023..3e24956c2c 100644
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -15,28 +15,37 @@ authentication, redirections, cookies and more.
The :mod:`urllib.request` module defines the following functions:
-.. function:: urlopen(url, data=None[, timeout])
+.. function:: urlopen(url, data=None[, timeout], *, cafile=None, capath=None)
Open the URL *url*, which can be either a string or a
:class:`Request` object.
- .. warning::
- HTTPS requests do not do any verification of the server's certificate.
-
- *data* may be a string specifying additional data to send to the
- server, or ``None`` if no such data is needed. Currently HTTP
- requests are the only ones that use *data*; the HTTP request will
- be a POST instead of a GET when the *data* parameter is provided.
- *data* should be a buffer in the standard
+ *data* may be a bytes object specifying additional data to send to the
+ server, or ``None`` if no such data is needed. *data* may also be an
+ iterable object and in that case Content-Length value must be specified in
+ the headers. Currently HTTP requests are the only ones that use *data*; the
+ HTTP request will be a POST instead of a GET when the *data* parameter is
+ provided. *data* should be a buffer in the standard
:mimetype:`application/x-www-form-urlencoded` format. The
- :func:`urllib.parse.urlencode` function takes a mapping or sequence
- of 2-tuples and returns a string in this format.
+ :func:`urllib.parse.urlencode` function takes a mapping or sequence of
+ 2-tuples and returns a string in this format. urllib.request module uses
+ HTTP/1.1 and includes ``Connection:close`` header in its HTTP requests.
The optional *timeout* parameter specifies a timeout in seconds for
blocking operations like the connection attempt (if not specified,
the global default timeout setting will be used). This actually
only works for HTTP, HTTPS and FTP connections.
+ The optional *cafile* and *capath* parameters specify a set of trusted
+ CA certificates for HTTPS requests. *cafile* should point to a single
+ file containing a bundle of CA certificates, whereas *capath* should
+ point to a directory of hashed certificate files. More information can
+ be found in :meth:`ssl.SSLContext.load_verify_locations`.
+
+ .. warning::
+ If neither *cafile* nor *capath* is specified, an HTTPS request
+ will not do any verification of the server's certificate.
+
This function returns a file-like object with two additional methods from
the :mod:`urllib.response` module
@@ -61,6 +70,16 @@ The :mod:`urllib.request` module defines the following functions:
Proxy handling, which was done by passing a dictionary parameter to
``urllib.urlopen``, can be obtained by using :class:`ProxyHandler` objects.
+ .. versionchanged:: 3.2
+ *cafile* and *capath* were added.
+
+ .. versionchanged:: 3.2
+ HTTPS virtual hosts are now supported if possible (that is, if
+ :data:`ssl.HAS_SNI` is true).
+
+ .. versionadded:: 3.2
+ *data* can be an iterable object.
+
.. function:: install_opener(opener)
Install an :class:`OpenerDirector` instance as the default global opener.
@@ -89,52 +108,6 @@ The :mod:`urllib.request` module defines the following functions:
member variable to modify its position in the handlers list.
-.. function:: urlretrieve(url, filename=None, reporthook=None, data=None)
-
- Copy a network object denoted by a URL to a local file, if necessary. If the URL
- points to a local file, or a valid cached copy of the object exists, the object
- is not copied. Return a tuple ``(filename, headers)`` where *filename* is the
- local file name under which the object can be found, and *headers* is whatever
- the :meth:`info` method of the object returned by :func:`urlopen` returned (for
- a remote object, possibly cached). Exceptions are the same as for
- :func:`urlopen`.
-
- The second argument, if present, specifies the file location to copy to (if
- absent, the location will be a tempfile with a generated name). The third
- argument, if present, is a hook function that will be called once on
- establishment of the network connection and once after each block read
- thereafter. The hook will be passed three arguments; a count of blocks
- transferred so far, a block size in bytes, and the total size of the file. The
- third argument may be ``-1`` on older FTP servers which do not return a file
- size in response to a retrieval request.
-
- If the *url* uses the :file:`http:` scheme identifier, the optional *data*
- argument may be given to specify a ``POST`` request (normally the request type
- is ``GET``). The *data* argument must in standard
- :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
- function below.
-
- :func:`urlretrieve` will raise :exc:`ContentTooShortError` when it detects that
- the amount of data available was less than the expected amount (which is the
- size reported by a *Content-Length* header). This can occur, for example, when
- the download is interrupted.
-
- The *Content-Length* is treated as a lower bound: if there's more data to read,
- :func:`urlretrieve` reads more data, but if less data is available, it raises
- the exception.
-
- You can still retrieve the downloaded data in this case, it is stored in the
- :attr:`content` attribute of the exception instance.
-
- If no *Content-Length* header was supplied, :func:`urlretrieve` can not
- check the size of the data it has downloaded, and just returns it. In
- this case you just have to assume that the download was successful.
-
-.. function:: urlcleanup()
-
- Clear the cache that may have been built up by previous calls to
- :func:`urlretrieve`.
-
.. function:: pathname2url(path)
Convert the pathname *path* from the local syntax for a path to the form used in
@@ -203,116 +176,6 @@ The following classes are provided:
fetching of the image, this should be true.
-.. class:: URLopener(proxies=None, **x509)
-
- Base class for opening and reading URLs. Unless you need to support opening
- objects using schemes other than :file:`http:`, :file:`ftp:`, or :file:`file:`,
- you probably want to use :class:`FancyURLopener`.
-
- By default, the :class:`URLopener` class sends a :mailheader:`User-Agent` header
- of ``urllib/VVV``, where *VVV* is the :mod:`urllib` version number.
- Applications can define their own :mailheader:`User-Agent` header by subclassing
- :class:`URLopener` or :class:`FancyURLopener` and setting the class attribute
- :attr:`version` to an appropriate string value in the subclass definition.
-
- The optional *proxies* parameter should be a dictionary mapping scheme names to
- proxy URLs, where an empty dictionary turns proxies off completely. Its default
- value is ``None``, in which case environmental proxy settings will be used if
- present, as discussed in the definition of :func:`urlopen`, above.
-
- Additional keyword parameters, collected in *x509*, may be used for
- authentication of the client when using the :file:`https:` scheme. The keywords
- *key_file* and *cert_file* are supported to provide an SSL key and certificate;
- both are needed to support client authentication.
-
- :class:`URLopener` objects will raise an :exc:`IOError` exception if the server
- returns an error code.
-
- .. method:: open(fullurl, data=None)
-
- Open *fullurl* using the appropriate protocol. This method sets up cache and
- proxy information, then calls the appropriate open method with its input
- arguments. If the scheme is not recognized, :meth:`open_unknown` is called.
- The *data* argument has the same meaning as the *data* argument of
- :func:`urlopen`.
-
-
- .. method:: open_unknown(fullurl, data=None)
-
- Overridable interface to open unknown URL types.
-
-
- .. method:: retrieve(url, filename=None, reporthook=None, data=None)
-
- Retrieves the contents of *url* and places it in *filename*. The return value
- is a tuple consisting of a local filename and either a
- :class:`email.message.Message` object containing the response headers (for remote
- URLs) or ``None`` (for local URLs). The caller must then open and read the
- contents of *filename*. If *filename* is not given and the URL refers to a
- local file, the input filename is returned. If the URL is non-local and
- *filename* is not given, the filename is the output of :func:`tempfile.mktemp`
- with a suffix that matches the suffix of the last path component of the input
- URL. If *reporthook* is given, it must be a function accepting three numeric
- parameters. It will be called after each chunk of data is read from the
- network. *reporthook* is ignored for local URLs.
-
- If the *url* uses the :file:`http:` scheme identifier, the optional *data*
- argument may be given to specify a ``POST`` request (normally the request type
- is ``GET``). The *data* argument must in standard
- :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
- function below.
-
-
- .. attribute:: version
-
- Variable that specifies the user agent of the opener object. To get
- :mod:`urllib` to tell servers that it is a particular user agent, set this in a
- subclass as a class variable or in the constructor before calling the base
- constructor.
-
-
-.. class:: FancyURLopener(...)
-
- :class:`FancyURLopener` subclasses :class:`URLopener` providing default handling
- for the following HTTP response codes: 301, 302, 303, 307 and 401. For the 30x
- response codes listed above, the :mailheader:`Location` header is used to fetch
- the actual URL. For 401 response codes (authentication required), basic HTTP
- authentication is performed. For the 30x response codes, recursion is bounded
- by the value of the *maxtries* attribute, which defaults to 10.
-
- For all other response codes, the method :meth:`http_error_default` is called
- which you can override in subclasses to handle the error appropriately.
-
- .. note::
-
- According to the letter of :rfc:`2616`, 301 and 302 responses to POST requests
- must not be automatically redirected without confirmation by the user. In
- reality, browsers do allow automatic redirection of these responses, changing
- the POST to a GET, and :mod:`urllib` reproduces this behaviour.
-
- The parameters to the constructor are the same as those for :class:`URLopener`.
-
- .. note::
-
- When performing basic authentication, a :class:`FancyURLopener` instance calls
- its :meth:`prompt_user_passwd` method. The default implementation asks the
- users for the required information on the controlling terminal. A subclass may
- override this method to support more appropriate behavior if needed.
-
- The :class:`FancyURLopener` class offers one additional method that should be
- overloaded to provide the appropriate behavior:
-
- .. method:: prompt_user_passwd(host, realm)
-
- Return information needed to authenticate the user at the given host in the
- specified security realm. The return value should be a tuple, ``(user,
- password)``, which can be used for basic authentication.
-
- The implementation prompts for this information on the terminal; an application
- should override this method to use an appropriate interaction model in the local
- environment.
-
-
.. class:: OpenerDirector()
The :class:`OpenerDirector` class opens URLs via :class:`BaseHandler`\ s chained
@@ -421,9 +284,13 @@ The following classes are provided:
A class to handle opening of HTTP URLs.
-.. class:: HTTPSHandler()
+.. class:: HTTPSHandler(debuglevel=0, context=None, check_hostname=None)
+
+ A class to handle opening of HTTPS URLs. *context* and *check_hostname*
+ have the same meaning as in :class:`http.client.HTTPSConnection`.
- A class to handle opening of HTTPS URLs.
+ .. versionchanged:: 3.2
+ *context* and *check_hostname* were added.
.. class:: FileHandler()
@@ -994,8 +861,12 @@ FileHandler Objects
.. method:: FileHandler.file_open(req)
Open the file locally, if there is no host name, or the host name is
- ``'localhost'``. Change the protocol to ``ftp`` otherwise, and retry opening it
- using :attr:`parent`.
+ ``'localhost'``.
+
+ This method is applicable only for local hostnames. When a remote hostname
+ is given, an :exc:`URLError` is raised.
+
+.. versionchanged:: 3.2
.. _ftp-handler-objects:
@@ -1100,7 +971,7 @@ when the Python installation supports SSL. ::
>>> import urllib.request
>>> req = urllib.request.Request(url='https://localhost/cgi-bin/test.cgi',
- ... data='This data is passed to stdin of the CGI')
+ ... data=b'This data is passed to stdin of the CGI')
>>> f = urllib.request.urlopen(req)
>>> print(f.read().decode('utf-8'))
Got Data: "This data is passed to stdin of the CGI"
@@ -1176,11 +1047,13 @@ containing parameters::
>>> f = urllib.request.urlopen("http://www.musi-cal.com/cgi-bin/query?%s" % params)
>>> print(f.read().decode('utf-8'))
-The following example uses the ``POST`` method instead::
+The following example uses the ``POST`` method instead. Note that params output
+from urlencode is encoded to bytes before it is sent to urlopen as data::
>>> import urllib.request
>>> import urllib.parse
>>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
+ >>> params = params.encode('utf-8')
>>> f = urllib.request.urlopen("http://www.musi-cal.com/cgi-bin/query", params)
>>> print(f.read().decode('utf-8'))
@@ -1201,6 +1074,170 @@ The following example uses no proxies at all, overriding environment settings::
>>> f.read().decode('utf-8')
+Legacy interface
+----------------
+
+The following functions and classes are ported from the Python 2 module
+``urllib`` (as opposed to ``urllib2``). They might become deprecated at
+some point in the future.
+
+
+.. function:: urlretrieve(url, filename=None, reporthook=None, data=None)
+
+ Copy a network object denoted by a URL to a local file, if necessary. If the URL
+ points to a local file, or a valid cached copy of the object exists, the object
+ is not copied. Return a tuple ``(filename, headers)`` where *filename* is the
+ local file name under which the object can be found, and *headers* is whatever
+ the :meth:`info` method of the object returned by :func:`urlopen` returned (for
+ a remote object, possibly cached). Exceptions are the same as for
+ :func:`urlopen`.
+
+ The second argument, if present, specifies the file location to copy to (if
+ absent, the location will be a tempfile with a generated name). The third
+ argument, if present, is a hook function that will be called once on
+ establishment of the network connection and once after each block read
+ thereafter. The hook will be passed three arguments; a count of blocks
+ transferred so far, a block size in bytes, and the total size of the file. The
+ third argument may be ``-1`` on older FTP servers which do not return a file
+ size in response to a retrieval request.
+
+ If the *url* uses the :file:`http:` scheme identifier, the optional *data*
+ argument may be given to specify a ``POST`` request (normally the request type
+ is ``GET``). The *data* argument must in standard
+ :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
+ function below.
+
+ :func:`urlretrieve` will raise :exc:`ContentTooShortError` when it detects that
+ the amount of data available was less than the expected amount (which is the
+ size reported by a *Content-Length* header). This can occur, for example, when
+ the download is interrupted.
+
+ The *Content-Length* is treated as a lower bound: if there's more data to read,
+ :func:`urlretrieve` reads more data, but if less data is available, it raises
+ the exception.
+
+ You can still retrieve the downloaded data in this case, it is stored in the
+ :attr:`content` attribute of the exception instance.
+
+ If no *Content-Length* header was supplied, :func:`urlretrieve` can not check
+ the size of the data it has downloaded, and just returns it. In this case
+ you just have to assume that the download was successful.
+
+.. function:: urlcleanup()
+
+ Clear the cache that may have been built up by previous calls to
+ :func:`urlretrieve`.
+
+.. class:: URLopener(proxies=None, **x509)
+
+ Base class for opening and reading URLs. Unless you need to support opening
+ objects using schemes other than :file:`http:`, :file:`ftp:`, or :file:`file:`,
+ you probably want to use :class:`FancyURLopener`.
+
+ By default, the :class:`URLopener` class sends a :mailheader:`User-Agent` header
+ of ``urllib/VVV``, where *VVV* is the :mod:`urllib` version number.
+ Applications can define their own :mailheader:`User-Agent` header by subclassing
+ :class:`URLopener` or :class:`FancyURLopener` and setting the class attribute
+ :attr:`version` to an appropriate string value in the subclass definition.
+
+ The optional *proxies* parameter should be a dictionary mapping scheme names to
+ proxy URLs, where an empty dictionary turns proxies off completely. Its default
+ value is ``None``, in which case environmental proxy settings will be used if
+ present, as discussed in the definition of :func:`urlopen`, above.
+
+ Additional keyword parameters, collected in *x509*, may be used for
+ authentication of the client when using the :file:`https:` scheme. The keywords
+ *key_file* and *cert_file* are supported to provide an SSL key and certificate;
+ both are needed to support client authentication.
+
+ :class:`URLopener` objects will raise an :exc:`IOError` exception if the server
+ returns an error code.
+
+ .. method:: open(fullurl, data=None)
+
+ Open *fullurl* using the appropriate protocol. This method sets up cache and
+ proxy information, then calls the appropriate open method with its input
+ arguments. If the scheme is not recognized, :meth:`open_unknown` is called.
+ The *data* argument has the same meaning as the *data* argument of
+ :func:`urlopen`.
+
+
+ .. method:: open_unknown(fullurl, data=None)
+
+ Overridable interface to open unknown URL types.
+
+
+ .. method:: retrieve(url, filename=None, reporthook=None, data=None)
+
+ Retrieves the contents of *url* and places it in *filename*. The return value
+ is a tuple consisting of a local filename and either a
+ :class:`email.message.Message` object containing the response headers (for remote
+ URLs) or ``None`` (for local URLs). The caller must then open and read the
+ contents of *filename*. If *filename* is not given and the URL refers to a
+ local file, the input filename is returned. If the URL is non-local and
+ *filename* is not given, the filename is the output of :func:`tempfile.mktemp`
+ with a suffix that matches the suffix of the last path component of the input
+ URL. If *reporthook* is given, it must be a function accepting three numeric
+ parameters. It will be called after each chunk of data is read from the
+ network. *reporthook* is ignored for local URLs.
+
+ If the *url* uses the :file:`http:` scheme identifier, the optional *data*
+ argument may be given to specify a ``POST`` request (normally the request type
+ is ``GET``). The *data* argument must in standard
+ :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
+ function below.
+
+
+ .. attribute:: version
+
+ Variable that specifies the user agent of the opener object. To get
+ :mod:`urllib` to tell servers that it is a particular user agent, set this in a
+ subclass as a class variable or in the constructor before calling the base
+ constructor.
+
+
+.. class:: FancyURLopener(...)
+
+ :class:`FancyURLopener` subclasses :class:`URLopener` providing default handling
+ for the following HTTP response codes: 301, 302, 303, 307 and 401. For the 30x
+ response codes listed above, the :mailheader:`Location` header is used to fetch
+ the actual URL. For 401 response codes (authentication required), basic HTTP
+ authentication is performed. For the 30x response codes, recursion is bounded
+ by the value of the *maxtries* attribute, which defaults to 10.
+
+ For all other response codes, the method :meth:`http_error_default` is called
+ which you can override in subclasses to handle the error appropriately.
+
+ .. note::
+
+ According to the letter of :rfc:`2616`, 301 and 302 responses to POST requests
+ must not be automatically redirected without confirmation by the user. In
+ reality, browsers do allow automatic redirection of these responses, changing
+ the POST to a GET, and :mod:`urllib` reproduces this behaviour.
+
+ The parameters to the constructor are the same as those for :class:`URLopener`.
+
+ .. note::
+
+ When performing basic authentication, a :class:`FancyURLopener` instance calls
+ its :meth:`prompt_user_passwd` method. The default implementation asks the
+ users for the required information on the controlling terminal. A subclass may
+ override this method to support more appropriate behavior if needed.
+
+ The :class:`FancyURLopener` class offers one additional method that should be
+ overloaded to provide the appropriate behavior:
+
+ .. method:: prompt_user_passwd(host, realm)
+
+ Return information needed to authenticate the user at the given host in the
+ specified security realm. The return value should be a tuple, ``(user,
+ password)``, which can be used for basic authentication.
+
+ The implementation prompts for this information on the terminal; an application
+ should override this method to use an appropriate interaction model in the local
+ environment.
+
+
:mod:`urllib.request` Restrictions
----------------------------------
diff --git a/Doc/library/uu.rst b/Doc/library/uu.rst
index 7813e448e8..d61c178831 100644
--- a/Doc/library/uu.rst
+++ b/Doc/library/uu.rst
@@ -5,6 +5,9 @@
:synopsis: Encode and decode files in uuencode format.
.. moduleauthor:: Lance Ellinghouse
+**Source code:** :source:`Lib/uu.py`
+
+--------------
This module encodes and decodes files in uuencode format, allowing arbitrary
binary data to be transferred over ASCII-only connections. Wherever a file
@@ -56,4 +59,3 @@ The :mod:`uu` module defines the following functions:
Module :mod:`binascii`
Support module containing ASCII-to-binary and binary-to-ASCII conversions.
-
diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst
index e62be551bb..274840b342 100644
--- a/Doc/library/warnings.rst
+++ b/Doc/library/warnings.rst
@@ -6,6 +6,9 @@
.. module:: warnings
:synopsis: Issue warning messages and control their disposition.
+**Source code:** :source:`Lib/warnings.py`
+
+--------------
Warning messages are typically issued in situations where it is useful to alert
the user of some condition in a program, where that condition (normally) doesn't
@@ -13,7 +16,7 @@ warrant raising an exception and terminating the program. For example, one
might want to issue a warning when a program uses an obsolete module.
Python programmers issue warnings by calling the :func:`warn` function defined
-in this module. (C programmers use :cfunc:`PyErr_WarnEx`; see
+in this module. (C programmers use :c:func:`PyErr_WarnEx`; see
:ref:`exceptionhandling` for details).
Warning messages are normally written to ``sys.stderr``, but their disposition
@@ -57,7 +60,7 @@ following warnings category classes are currently defined:
| :exc:`UserWarning` | The default category for :func:`warn`. |
+----------------------------------+-----------------------------------------------+
| :exc:`DeprecationWarning` | Base category for warnings about deprecated |
-| | features. |
+| | features (ignored by default). |
+----------------------------------+-----------------------------------------------+
| :exc:`SyntaxWarning` | Base category for warnings about dubious |
| | syntactic features. |
@@ -82,6 +85,9 @@ following warnings category classes are currently defined:
| :exc:`BytesWarning` | Base category for warnings related to |
| | :class:`bytes` and :class:`buffer`. |
+----------------------------------+-----------------------------------------------+
+| :exc:`ResourceWarning` | Base category for warnings related to |
+| | resource usage. |
++----------------------------------+-----------------------------------------------+
While these are technically built-in exceptions, they are documented here,
@@ -150,14 +156,6 @@ interpreter command line. The interpreter saves the arguments for all
:mod:`warnings` module parses these when it is first imported (invalid options
are ignored, after printing a message to ``sys.stderr``).
-The warnings that are ignored by default may be enabled by passing :option:`-Wd`
-to the interpreter. This enables default handling for all warnings, including
-those that are normally ignored by default. This is particular useful for
-enabling ImportWarning when debugging problems importing a developed package.
-ImportWarning can also be enabled explicitly in Python code using::
-
- warnings.simplefilter('default', ImportWarning)
-
Default Warning Filters
~~~~~~~~~~~~~~~~~~~~~~~
@@ -166,12 +164,19 @@ By default, Python installs several warning filters, which can be overridden by
the command-line options passed to :option:`-W` and calls to
:func:`filterwarnings`.
-* :exc:`PendingDeprecationWarning`, and :exc:`ImportWarning` are ignored.
+* :exc:`DeprecationWarning` and :exc:`PendingDeprecationWarning`, and
+ :exc:`ImportWarning` are ignored.
* :exc:`BytesWarning` is ignored unless the :option:`-b` option is given once or
twice; in this case this warning is either printed (``-b``) or turned into an
exception (``-bb``).
+* :exc:`ResourceWarning` is ignored unless Python was built in debug mode.
+
+.. versionchanged:: 3.2
+ :exc:`DeprecationWarning` is now ignored by default in addition to
+ :exc:`PendingDeprecationWarning`.
+
.. _warning-suppress:
@@ -194,7 +199,10 @@ the warning using the :class:`catch_warnings` context manager::
While within the context manager all warnings will simply be ignored. This
allows you to use known-deprecated code without having to see the warning while
not suppressing the warning for other code that might not be aware of its use
-of deprecated code.
+of deprecated code. Note: this can only be guaranteed in a single-threaded
+application. If two or more threads use the :class:`catch_warnings` context
+manager at the same time, the behavior is undefined.
+
.. _warning-testing:
@@ -232,7 +240,9 @@ Once the context manager exits, the warnings filter is restored to its state
when the context was entered. This prevents tests from changing the warnings
filter in unexpected ways between tests and leading to indeterminate test
results. The :func:`showwarning` function in the module is also restored to
-its original value.
+its original value. Note: this can only be guaranteed in a single-threaded
+application. If two or more threads use the :class:`catch_warnings` context
+manager at the same time, the behavior is undefined.
When testing multiple operations that raise the same kind of warning, it
is important to test them in a manner that confirms each operation is raising
@@ -242,6 +252,42 @@ continues to increase after each operation, or else delete the previous
entries from the warnings list before each new operation).
+.. _warning-ignored:
+
+Updating Code For New Versions of Python
+----------------------------------------
+
+Warnings that are only of interest to the developer are ignored by default. As
+such you should make sure to test your code with typically ignored warnings
+made visible. You can do this from the command-line by passing :option:`-Wd`
+to the interpreter (this is shorthand for :option:`-W default`). This enables
+default handling for all warnings, including those that are ignored by default.
+To change what action is taken for encountered warnings you simply change what
+argument is passed to :option:`-W`, e.g. :option:`-W error`. See the
+:option:`-W` flag for more details on what is possible.
+
+To programmatically do the same as :option:`-Wd`, use::
+
+ warnings.simplefilter('default')
+
+Make sure to execute this code as soon as possible. This prevents the
+registering of what warnings have been raised from unexpectedly influencing how
+future warnings are treated.
+
+Having certain warnings ignored by default is done to prevent a user from
+seeing warnings that are only of interest to the developer. As you do not
+necessarily have control over what interpreter a user uses to run their code,
+it is possible that a new version of Python will be released between your
+release cycles. The new interpreter release could trigger new warnings in your
+code that were not there in an older interpreter, e.g.
+:exc:`DeprecationWarning` for a module that you are using. While you as a
+developer want to be notified that your code is using a deprecated module, to a
+user this information is essentially noise and provides no benefit to them.
+
+The :mod:`unittest` module has been also updated to use the ``'default'``
+filter while running tests.
+
+
.. _warning-functions:
Available Functions
@@ -351,3 +397,11 @@ Available Context Managers
module returned when you import :mod:`warnings` whose filter will be
protected. This argument exists primarily for testing the :mod:`warnings`
module itself.
+
+ .. note::
+
+ The :class:`catch_warnings` manager works by replacing and
+ then later restoring the module's
+ :func:`showwarning` function and internal list of filter
+ specifications. This means the context manager is modifying
+ global state and therefore is not thread-safe.
diff --git a/Doc/library/wave.rst b/Doc/library/wave.rst
index 6cfa1a4733..afafb45c55 100644
--- a/Doc/library/wave.rst
+++ b/Doc/library/wave.rst
@@ -6,6 +6,10 @@
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
.. Documentations stolen from comments in file.
+**Source code:** :source:`Lib/wave.py`
+
+--------------
+
The :mod:`wave` module provides a convenient interface to the WAV sound format.
It does not support compression/decompression, but it does support mono/stereo.
@@ -162,6 +166,10 @@ Wave_write objects, as returned by :func:`.open`, have the following methods:
Set the frame rate to *n*.
+ .. versionchanged:: 3.2
+ A non-integral input to this method is rounded to the nearest
+ integer.
+
.. method:: Wave_write.setnframes(n)
diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst
index 10b69c98c0..63545abf3a 100644
--- a/Doc/library/weakref.rst
+++ b/Doc/library/weakref.rst
@@ -8,6 +8,9 @@
.. moduleauthor:: Martin von Löwis <martin@loewis.home.cs.tu-berlin.de>
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/weakref.py`
+
+--------------
The :mod:`weakref` module allows the Python programmer to create :dfn:`weak
references` to objects.
@@ -59,8 +62,11 @@ is exposed by the :mod:`weakref` module for the benefit of advanced uses.
Not all objects can be weakly referenced; those objects which can include class
instances, functions written in Python (but not in C), instance methods, sets,
frozensets, some :term:`file objects <file object>`, :term:`generator`\s, type
-objects, sockets, arrays, deques and regular expression pattern objects.
+objects, sockets, arrays, deques, regular expression pattern objects, and code
+objects.
+.. versionchanged:: 3.2
+ Added support for thread.lock, threading.Lock, and code objects.
Several built-in types such as :class:`list` and :class:`dict` do not directly
support weak references but can add support through subclassing::
diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst
index 20c091399f..23ba6c5471 100644
--- a/Doc/library/webbrowser.rst
+++ b/Doc/library/webbrowser.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/webbrowser.py`
+
+--------------
The :mod:`webbrowser` module provides a high-level interface to allow displaying
Web-based documents to users. Under most circumstances, simply calling the
diff --git a/Doc/library/winreg.rst b/Doc/library/winreg.rst
index 68f7e91263..5cf30ee03c 100644
--- a/Doc/library/winreg.rst
+++ b/Doc/library/winreg.rst
@@ -60,6 +60,33 @@ This module offers the following functions:
:exc:`WindowsError` exception is raised.
+.. function:: CreateKeyEx(key, sub_key, reserved=0, access=KEY_ALL_ACCESS)
+
+ Creates or opens the specified key, returning a
+ :ref:`handle object <handle-object>`.
+
+ *key* is an already open key, or one of the predefined
+ :ref:`HKEY_* constants <hkey-constants>`.
+
+ *sub_key* is a string that names the key this method opens or creates.
+
+ *res* is a reserved integer, and must be zero. The default is zero.
+
+ *sam* is an integer that specifies an access mask that describes the desired
+ security access for the key. Default is :const:`KEY_ALL_ACCESS`. See
+ :ref:`Access Rights <access-rights>` for other allowed values.
+
+ If *key* is one of the predefined keys, *sub_key* may be ``None``. In that
+ case, the handle returned is the same key handle passed in to the function.
+
+ If the key already exists, this function opens the existing key.
+
+ The return value is the handle of the opened key. If the function fails, a
+ :exc:`WindowsError` exception is raised.
+
+ .. versionadded:: 3.2
+
+
.. function:: DeleteKey(key, sub_key)
Deletes the specified key.
@@ -67,8 +94,8 @@ This module offers the following functions:
*key* is an already open key, or one of the predefined
:ref:`HKEY_* constants <hkey-constants>`.
- *sub_key* is a string that must be a subkey of the key identified by the *key*
- parameter. This value must not be ``None``, and the key may not have subkeys.
+ *sub_key* is a string that must be a subkey of the key identified by the *key*
+ parameter. This value must not be ``None``, and the key may not have subkeys.
*This method can not delete keys with subkeys.*
@@ -76,6 +103,39 @@ This module offers the following functions:
If the method fails, a :exc:`WindowsError` exception is raised.
+.. function:: DeleteKeyEx(key, sub_key, access=KEY_ALL_ACCESS, reserved=0)
+
+ Deletes the specified key.
+
+ .. note::
+ The :func:`DeleteKeyEx` function is implemented with the RegDeleteKeyEx
+ Windows API function, which is specific to 64-bit versions of Windows.
+ See the `RegDeleteKeyEx documentation
+ <http://msdn.microsoft.com/en-us/library/ms724847%28VS.85%29.aspx>`__.
+
+ *key* is an already open key, or one of the predefined
+ :ref:`HKEY_* constants <hkey-constants>`.
+
+ *sub_key* is a string that must be a subkey of the key identified by the
+ *key* parameter. This value must not be ``None``, and the key may not have
+ subkeys.
+
+ *res* is a reserved integer, and must be zero. The default is zero.
+
+ *sam* is an integer that specifies an access mask that describes the desired
+ security access for the key. Default is :const:`KEY_ALL_ACCESS`. See
+ :ref:`Access Rights <access-rights>` for other allowed values.
+
+ *This method can not delete keys with subkeys.*
+
+ If the method succeeds, the entire key, including all of its values, is
+ removed. If the method fails, a :exc:`WindowsError` exception is raised.
+
+ On unsupported Windows versions, :exc:`NotImplementedError` is raised.
+
+ .. versionadded:: 3.2
+
+
.. function:: DeleteValue(key, value)
Removes a named value from a registry key.
@@ -183,7 +243,7 @@ This module offers the following functions:
specified in *file_name* is relative to the remote computer.
-.. function:: OpenKey(key, sub_key[, res[, sam]])
+.. function:: OpenKey(key, sub_key, reserved=0, access=KEY_ALL_ACCESS)
Opens the specified key, returning a :ref:`handle object <handle-object>`.
@@ -202,6 +262,8 @@ This module offers the following functions:
If the function fails, :exc:`WindowsError` is raised.
+ .. versionchanged:: 3.2 Allow the use of named arguments.
+
.. function:: OpenKeyEx()
diff --git a/Doc/library/winsound.rst b/Doc/library/winsound.rst
index d54c999cd9..8356062078 100644
--- a/Doc/library/winsound.rst
+++ b/Doc/library/winsound.rst
@@ -22,7 +22,7 @@ provided by Windows platforms. It includes functions and several constants.
.. function:: PlaySound(sound, flags)
- Call the underlying :cfunc:`PlaySound` function from the Platform API. The
+ Call the underlying :c:func:`PlaySound` function from the Platform API. The
*sound* parameter may be a filename, audio data as a string, or ``None``. Its
interpretation depends on the value of *flags*, which can be a bitwise ORed
combination of the constants described below. If the *sound* parameter is
@@ -32,7 +32,7 @@ provided by Windows platforms. It includes functions and several constants.
.. function:: MessageBeep(type=MB_OK)
- Call the underlying :cfunc:`MessageBeep` function from the Platform API. This
+ Call the underlying :c:func:`MessageBeep` function from the Platform API. This
plays a sound as specified in the registry. The *type* argument specifies which
sound to play; possible values are ``-1``, ``MB_ICONASTERISK``,
``MB_ICONEXCLAMATION``, ``MB_ICONHAND``, ``MB_ICONQUESTION``, and ``MB_OK``, all
diff --git a/Doc/library/wsgiref.rst b/Doc/library/wsgiref.rst
index 231449ce9f..3969ea49cf 100644
--- a/Doc/library/wsgiref.rst
+++ b/Doc/library/wsgiref.rst
@@ -22,7 +22,7 @@ be used to add WSGI support to a web server or framework. It provides utilities
for manipulating WSGI environment variables and response headers, base classes
for implementing WSGI servers, a demo HTTP server that serves WSGI applications,
and a validation tool that checks WSGI servers and applications for conformance
-to the WSGI specification (:pep:`333`).
+to the WSGI specification (:pep:`3333`).
See http://www.wsgi.org for more information about WSGI, and links to tutorials
and other resources.
@@ -39,9 +39,9 @@ and other resources.
This module provides a variety of utility functions for working with WSGI
environments. A WSGI environment is a dictionary containing HTTP request
-variables as described in :pep:`333`. All of the functions taking an *environ*
+variables as described in :pep:`3333`. All of the functions taking an *environ*
parameter expect a WSGI-compliant dictionary to be supplied; please see
-:pep:`333` for a detailed specification.
+:pep:`3333` for a detailed specification.
.. function:: guess_scheme(environ)
@@ -60,7 +60,7 @@ parameter expect a WSGI-compliant dictionary to be supplied; please see
.. function:: request_uri(environ, include_query=True)
Return the full request URI, optionally including the query string, using the
- algorithm found in the "URL Reconstruction" section of :pep:`333`. If
+ algorithm found in the "URL Reconstruction" section of :pep:`3333`. If
*include_query* is false, the query string is not included in the resulting URI.
@@ -104,7 +104,7 @@ parameter expect a WSGI-compliant dictionary to be supplied; please see
This routine adds various parameters required for WSGI, including ``HTTP_HOST``,
``SERVER_NAME``, ``SERVER_PORT``, ``REQUEST_METHOD``, ``SCRIPT_NAME``,
- ``PATH_INFO``, and all of the :pep:`333`\ -defined ``wsgi.*`` variables. It
+ ``PATH_INFO``, and all of the :pep:`3333`\ -defined ``wsgi.*`` variables. It
only supplies default values, and does not replace any existing settings for
these variables.
@@ -152,8 +152,8 @@ also provides these miscellaneous utilities:
support both :meth:`__getitem__` and :meth:`__iter__` iteration styles, for
compatibility with Python 2.1 and Jython. As the object is iterated over, the
optional *blksize* parameter will be repeatedly passed to the *filelike*
- object's :meth:`read` method to obtain strings to yield. When :meth:`read`
- returns an empty string, iteration is ended and is not resumable.
+ object's :meth:`read` method to obtain bytestrings to yield. When :meth:`read`
+ returns an empty bytestring, iteration is ended and is not resumable.
If *filelike* has a :meth:`close` method, the returned object will also have a
:meth:`close` method, and it will invoke the *filelike* object's :meth:`close`
@@ -187,7 +187,7 @@ manipulation of WSGI response headers using a mapping-like interface.
.. class:: Headers(headers)
Create a mapping-like object wrapping *headers*, which must be a list of header
- name/value tuples as described in :pep:`333`.
+ name/value tuples as described in :pep:`3333`.
:class:`Headers` objects support typical mapping operations including
:meth:`__getitem__`, :meth:`get`, :meth:`__setitem__`, :meth:`setdefault`,
@@ -210,11 +210,11 @@ manipulation of WSGI response headers using a mapping-like interface.
:meth:`items`, which is the same as the length of the wrapped header list. In
fact, the :meth:`items` method just returns a copy of the wrapped header list.
- Calling ``str()`` on a :class:`Headers` object returns a formatted string
+ Calling ``bytes()`` on a :class:`Headers` object returns a formatted bytestring
suitable for transmission as HTTP response headers. Each header is placed on a
line with its value, separated by a colon and a space. Each line is terminated
- by a carriage return and line feed, and the string is terminated with a blank
- line.
+ by a carriage return and line feed, and the bytestring is terminated with a
+ blank line.
In addition to their mapping interface and formatting features, :class:`Headers`
objects also have the following methods for querying and adding multi-valued
@@ -272,7 +272,7 @@ request. (E.g., using the :func:`shift_path_info` function from
Create a new WSGI server listening on *host* and *port*, accepting connections
for *app*. The return value is an instance of the supplied *server_class*, and
will process requests using the specified *handler_class*. *app* must be a WSGI
- application object, as defined by :pep:`333`.
+ application object, as defined by :pep:`3333`.
Example usage::
@@ -346,7 +346,7 @@ request. (E.g., using the :func:`shift_path_info` function from
:attr:`base_environ` dictionary attribute and then adds various headers derived
from the HTTP request. Each call to this method should return a new dictionary
containing all of the relevant CGI environment variables as specified in
- :pep:`333`.
+ :pep:`3333`.
.. method:: WSGIRequestHandler.get_stderr()
@@ -376,7 +376,7 @@ application objects that validate communications between a WSGI server or
gateway and a WSGI application object, to check both sides for protocol
conformance.
-Note that this utility does not guarantee complete :pep:`333` compliance; an
+Note that this utility does not guarantee complete :pep:`3333` compliance; an
absence of errors from this module does not necessarily mean that errors do not
exist. However, if this module does produce an error, then it is virtually
certain that either the server or application is not 100% compliant.
@@ -401,7 +401,7 @@ Paste" library.
This wrapper may also generate output using the :mod:`warnings` module to
indicate behaviors that are questionable but which may not actually be
- prohibited by :pep:`333`. Unless they are suppressed using Python command-line
+ prohibited by :pep:`3333`. Unless they are suppressed using Python command-line
options or the :mod:`warnings` API, any such warnings will be written to
``sys.stderr`` (*not* ``wsgi.errors``, unless they happen to be the same
object).
@@ -456,6 +456,32 @@ input, output, and error streams.
environment.
+.. class:: IISCGIHandler()
+
+ A specialized alternative to :class:`CGIHandler`, for use when deploying on
+ Microsoft's IIS web server, without having set the config allowPathInfo
+ option (IIS>=7) or metabase allowPathInfoForScriptMappings (IIS<7).
+
+ By default, IIS gives a ``PATH_INFO`` that duplicates the ``SCRIPT_NAME`` at
+ the front, causing problems for WSGI applications that wish to implement
+ routing. This handler strips any such duplicated path.
+
+ IIS can be configured to pass the correct ``PATH_INFO``, but this causes
+ another bug where ``PATH_TRANSLATED`` is wrong. Luckily this variable is
+ rarely used and is not guaranteed by WSGI. On IIS<7, though, the
+ setting can only be made on a vhost level, affecting all other script
+ mappings, many of which break when exposed to the ``PATH_TRANSLATED`` bug.
+ For this reason IIS<7 is almost never deployed with the fix. (Even IIS7
+ rarely uses it because there is still no UI for it.)
+
+ There is no way for CGI code to tell whether the option was set, so a
+ separate handler class is provided. It is used in the same way as
+ :class:`CGIHandler`, i.e., by calling ``IISCGIHandler().run(app)``, where
+ ``app`` is the WSGI application object you wish to invoke.
+
+ .. versionadded:: 3.2
+
+
.. class:: BaseCGIHandler(stdin, stdout, stderr, environ, multithread=True, multiprocess=False)
Similar to :class:`CGIHandler`, but instead of using the :mod:`sys` and
@@ -626,7 +652,7 @@ input, output, and error streams.
This method can access the current error information using ``sys.exc_info()``,
and should pass that information to *start_response* when calling it (as
- described in the "Error Handling" section of :pep:`333`).
+ described in the "Error Handling" section of :pep:`3333`).
The default implementation just uses the :attr:`error_status`,
:attr:`error_headers`, and :attr:`error_body` attributes to generate an output
@@ -641,23 +667,23 @@ input, output, and error streams.
.. attribute:: BaseHandler.error_status
The HTTP status used for error responses. This should be a status string as
- defined in :pep:`333`; it defaults to a 500 code and message.
+ defined in :pep:`3333`; it defaults to a 500 code and message.
.. attribute:: BaseHandler.error_headers
The HTTP headers used for error responses. This should be a list of WSGI
- response headers (``(name, value)`` tuples), as described in :pep:`333`. The
+ response headers (``(name, value)`` tuples), as described in :pep:`3333`. The
default list just sets the content type to ``text/plain``.
.. attribute:: BaseHandler.error_body
- The error response body. This should be an HTTP response body string. It
+ The error response body. This should be an HTTP response body bytestring. It
defaults to the plain text, "A server error occurred. Please contact the
administrator."
- Methods and attributes for :pep:`333`'s "Optional Platform-Specific File
+ Methods and attributes for :pep:`3333`'s "Optional Platform-Specific File
Handling" feature:
@@ -696,6 +722,24 @@ input, output, and error streams.
version of the response set to the client. It defaults to ``"1.0"``.
+.. function:: read_environ()
+
+ Transcode CGI variables from ``os.environ`` to PEP 3333 "bytes in unicode"
+ strings, returning a new dictionary. This function is used by
+ :class:`CGIHandler` and :class:`IISCGIHandler` in place of directly using
+ ``os.environ``, which is not necessarily WSGI-compliant on all platforms
+ and web servers using Python 3 -- specifically, ones where the OS's
+ actual environment is Unicode (i.e. Windows), or ones where the environment
+ is bytes, but the system encoding used by Python to decode it is anything
+ other than ISO-8859-1 (e.g. Unix systems using UTF-8).
+
+ If you are implementing a CGI-based handler of your own, you probably want
+ to use this routine instead of just copying values out of ``os.environ``
+ directly.
+
+ .. versionadded:: 3.2
+
+
Examples
--------
diff --git a/Doc/library/xdrlib.rst b/Doc/library/xdrlib.rst
index 4fcb9cdfb6..1d3da0adbd 100644
--- a/Doc/library/xdrlib.rst
+++ b/Doc/library/xdrlib.rst
@@ -9,6 +9,10 @@
single: XDR
single: External Data Representation
+**Source code:** :source:`Lib/xdrlib.py`
+
+--------------
+
The :mod:`xdrlib` module supports the External Data Representation Standard as
described in :rfc:`1014`, written by Sun Microsystems, Inc. June 1987. It
supports most of the data types described in the RFC.
diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst
index 8364f35809..070967bb96 100644
--- a/Doc/library/xml.dom.minidom.rst
+++ b/Doc/library/xml.dom.minidom.rst
@@ -7,6 +7,9 @@
.. sectionauthor:: Paul Prescod <paul@prescod.net>
.. sectionauthor:: Martin v. Löwis <martin@v.loewis.de>
+**Source code:** :source:`Lib/xml/dom/minidom.py`
+
+--------------
:mod:`xml.dom.minidom` is a light-weight implementation of the Document Object
Model interface. It is intended to be simpler than the full DOM and also
@@ -82,22 +85,12 @@ document: the one that holds all others. Here is an example program::
dom3 = parseString("<myxml>Some data</myxml>")
assert dom3.documentElement.tagName == "myxml"
-When you are finished with a DOM, you should clean it up. This is necessary
-because some versions of Python do not support garbage collection of objects
-that refer to each other in a cycle. Until this restriction is removed from all
-versions of Python, it is safest to write your code as if cycles would not be
-cleaned up.
-
-The way to clean up a DOM is to call its :meth:`unlink` method::
-
- dom1.unlink()
- dom2.unlink()
- dom3.unlink()
-
-:meth:`unlink` is a :mod:`xml.dom.minidom`\ -specific extension to the DOM API.
-After calling :meth:`unlink` on a node, the node and its descendants are
-essentially useless.
-
+When you are finished with a DOM tree, you may optionally call the
+:meth:`unlink` method to encourage early cleanup of the now-unneeded
+objects. :meth:`unlink` is a :mod:`xml.dom.minidom`\ -specific
+extension to the DOM API that renders the node and its descendants are
+essentially useless. Otherwise, Python's garbage collector will
+eventually take care of the objects in the tree.
.. seealso::
@@ -124,6 +117,13 @@ module documentation. This section lists the differences between the API and
to be called on the :class:`Document` object, but may be called on child nodes
to discard children of that node.
+ You can avoid calling this method explicitly by using the :keyword:`with`
+ statement. The following code will automatically unlink *dom* when the
+ :keyword:`with` block is exited::
+
+ with xml.dom.minidom.parse(datasource) as dom:
+ ... # Work with dom.
+
.. method:: Node.writexml(writer, indent="", addindent="", newl="")
@@ -139,18 +139,20 @@ module documentation. This section lists the differences between the API and
.. method:: Node.toxml(encoding=None)
- Return the XML that the DOM represents as a string.
-
- With no argument, the XML header does not specify an encoding, and the result is
- Unicode string if the default encoding cannot represent all characters in the
- document. Encoding this string in an encoding other than UTF-8 is likely
- incorrect, since UTF-8 is the default encoding of XML.
+ Return a string or byte string containing the XML represented by
+ the DOM node.
- With an explicit *encoding* [1]_ argument, the result is a byte string in the
- specified encoding. It is recommended that this argument is always specified. To
- avoid :exc:`UnicodeError` exceptions in case of unrepresentable text data, the
- encoding argument should be specified as "utf-8".
+ With an explicit *encoding* [1]_ argument, the result is a byte
+ string in the specified encoding. It is recommended that you
+ always specify an encoding; you may use any encoding you like, but
+ an argument of "utf-8" is the most common choice, avoiding
+ :exc:`UnicodeError` exceptions in case of unrepresentable text
+ data.
+ With no *encoding* argument, the result is a Unicode string, and the
+ XML declaration in the resulting string does not specify an
+ encoding. Encoding this string in an encoding other than UTF-8 is
+ likely incorrect, since UTF-8 is the default encoding of XML.
.. method:: Node.toprettyxml(indent="", newl="", encoding="")
@@ -158,7 +160,8 @@ module documentation. This section lists the differences between the API and
indentation string and defaults to a tabulator; *newl* specifies the string
emitted at the end of each line and defaults to ``\n``.
- There's also an *encoding* argument; see :meth:`toxml`.
+ The *encoding* argument behaves like the corresponding argument of
+ :meth:`toxml`.
.. _dom-example:
@@ -243,7 +246,9 @@ utility to most DOM users.
.. rubric:: Footnotes
-.. [#] The encoding string included in XML output should conform to the
- appropriate standards. For example, "UTF-8" is valid, but "UTF8" is
- not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
+.. [#] The encoding name included in the XML output should conform to
+ the appropriate standards. For example, "UTF-8" is valid, but
+ "UTF8" is not valid in an XML document's declaration, even though
+ Python accepts it as an encoding name.
+ See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
and http://www.iana.org/assignments/character-sets .
diff --git a/Doc/library/xml.dom.pulldom.rst b/Doc/library/xml.dom.pulldom.rst
index 1893fba894..4a5ef4c135 100644
--- a/Doc/library/xml.dom.pulldom.rst
+++ b/Doc/library/xml.dom.pulldom.rst
@@ -5,6 +5,9 @@
:synopsis: Support for building partial DOM trees from SAX events.
.. moduleauthor:: Paul Prescod <paul@prescod.net>
+**Source code:** :source:`Lib/xml/dom/pulldom.py`
+
+--------------
:mod:`xml.dom.pulldom` allows building only selected portions of a Document
Object Model representation of a document from SAX events.
diff --git a/Doc/library/xml.dom.rst b/Doc/library/xml.dom.rst
index 45d30d6729..c1786a6306 100644
--- a/Doc/library/xml.dom.rst
+++ b/Doc/library/xml.dom.rst
@@ -693,18 +693,27 @@ Attr Objects
.. attribute:: Attr.name
- The attribute name. In a namespace-using document it may have colons in it.
+ The attribute name.
+ In a namespace-using document it may include a colon.
.. attribute:: Attr.localName
- The part of the name following the colon if there is one, else the entire name.
+ The part of the name following the colon if there is one, else the
+ entire name.
This is a read-only attribute.
.. attribute:: Attr.prefix
- The part of the name preceding the colon if there is one, else the empty string.
+ The part of the name preceding the colon if there is one, else the
+ empty string.
+
+
+.. attribute:: Attr.value
+
+ The text value of the attribute. This is a synonym for the
+ :attr:`nodeValue` attribute.
.. _dom-attributelist-objects:
@@ -967,29 +976,24 @@ Python.
Type Mapping
^^^^^^^^^^^^
-The primitive IDL types used in the DOM specification are mapped to Python types
+The IDL types used in the DOM specification are mapped to Python types
according to the following table.
+------------------+-------------------------------------------+
| IDL Type | Python Type |
+==================+===========================================+
-| ``boolean`` | ``IntegerType`` (with a value of ``0`` or |
-| | ``1``) |
+| ``boolean`` | ``bool`` or ``int`` |
+------------------+-------------------------------------------+
-| ``int`` | ``IntegerType`` |
+| ``int`` | ``int`` |
+------------------+-------------------------------------------+
-| ``long int`` | ``IntegerType`` |
+| ``long int`` | ``int`` |
+------------------+-------------------------------------------+
-| ``unsigned int`` | ``IntegerType`` |
+| ``unsigned int`` | ``int`` |
++------------------+-------------------------------------------+
+| ``DOMString`` | ``str`` or ``bytes`` |
++------------------+-------------------------------------------+
+| ``null`` | ``None`` |
+------------------+-------------------------------------------+
-
-Additionally, the :class:`DOMString` defined in the recommendation is mapped to
-a bytes or string object. Applications should be able to handle
-Unicode whenever a string is returned from the DOM.
-
-The IDL ``null`` value is mapped to ``None``, which may be accepted or
-provided by the implementation whenever ``null`` is allowed by the API.
-
.. _dom-accessor-methods:
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index bc04a5355e..18c35aa290 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -5,10 +5,13 @@
:synopsis: Implementation of the ElementTree API.
.. moduleauthor:: Fredrik Lundh <fredrik@pythonware.com>
+**Source code:** :source:`Lib/xml/etree/ElementTree.py`
-The Element type is a flexible container object, designed to store hierarchical
-data structures in memory. The type can be described as a cross between a list
-and a dictionary.
+--------------
+
+The :class:`Element` type is a flexible container object, designed to store
+hierarchical data structures in memory. The type can be described as a cross
+between a list and a dictionary.
Each element has a number of properties associated with it:
@@ -23,7 +26,8 @@ Each element has a number of properties associated with it:
* a number of child elements, stored in a Python sequence
-To create an element instance, use the Element or SubElement factory functions.
+To create an element instance, use the :class:`Element` constructor or the
+:func:`SubElement` factory function.
The :class:`ElementTree` class can be used to wrap an element structure, and
convert it from and to XML.
@@ -31,8 +35,14 @@ convert it from and to XML.
A C implementation of this API is available as :mod:`xml.etree.cElementTree`.
See http://effbot.org/zone/element-index.htm for tutorials and links to other
-docs. Fredrik Lundh's page is also the location of the development version of the
-xml.etree.ElementTree.
+docs. Fredrik Lundh's page is also the location of the development version of
+the xml.etree.ElementTree.
+
+.. versionchanged:: 3.2
+ The ElementTree API is updated to 1.3. For more information, see
+ `Introducing ElementTree 1.3
+ <http://effbot.org/zone/elementtree-13-intro.htm>`_.
+
.. _elementtree-functions:
@@ -43,16 +53,16 @@ Functions
.. function:: Comment(text=None)
Comment element factory. This factory function creates a special element
- that will be serialized as an XML comment. The comment string can be either
- an ASCII-only :class:`bytes` object or a :class:`str` object. *text* is a
- string containing the comment string. Returns an element instance
+ that will be serialized as an XML comment by the standard serializer. The
+ comment string can be either a bytestring or a Unicode string. *text* is a
+ string containing the comment string. Returns an element instance
representing a comment.
.. function:: dump(elem)
- Writes an element tree or element structure to sys.stdout. This function should
- be used for debugging only.
+ Writes an element tree or element structure to sys.stdout. This function
+ should be used for debugging only.
The exact output format is implementation dependent. In this version, it's
written as an ordinary XML file.
@@ -60,39 +70,36 @@ Functions
*elem* is an element tree or an individual element.
-.. function:: Element(tag, attrib={}, **extra)
+.. function:: fromstring(text)
- Element factory. This function returns an object implementing the standard
- Element interface. The exact class or type of that object is implementation
- dependent, but it will always be compatible with the _ElementInterface class in
- this module.
+ Parses an XML section from a string constant. Same as :func:`XML`. *text*
+ is a string containing XML data. Returns an :class:`Element` instance.
- The element name, attribute names, and attribute values can be either an
- ASCII-only :class:`bytes` object or a :class:`str` object. *tag* is the
- element name. *attrib* is an optional dictionary, containing element
- attributes. *extra* contains additional attributes, given as keyword
- arguments. Returns an element instance.
+.. function:: fromstringlist(sequence, parser=None)
-.. function:: fromstring(text)
+ Parses an XML document from a sequence of string fragments. *sequence* is a
+ list or other sequence containing XML data fragments. *parser* is an
+ optional parser instance. If not given, the standard :class:`XMLParser`
+ parser is used. Returns an :class:`Element` instance.
- Parses an XML section from a string constant. Same as XML. *text* is a string
- containing XML data. Returns an Element instance.
+ .. versionadded:: 3.2
.. function:: iselement(element)
- Checks if an object appears to be a valid element object. *element* is an
- element instance. Returns a true value if this is an element object.
+ Checks if an object appears to be a valid element object. *element* is an
+ element instance. Returns a true value if this is an element object.
-.. function:: iterparse(source, events=None)
+.. function:: iterparse(source, events=None, parser=None)
Parses an XML section into an element tree incrementally, and reports what's
going on to the user. *source* is a filename or :term:`file object` containing
XML data. *events* is a list of events to report back. If omitted, only "end"
- events are reported. Returns an :term:`iterator` providing ``(event, elem)``
- pairs.
+ events are reported. *parser* is an optional parser instance. If not
+ given, the standard :class:`XMLParser` parser is used. Returns an
+ :term:`iterator` providing ``(event, elem)`` pairs.
.. note::
@@ -107,196 +114,271 @@ Functions
.. function:: parse(source, parser=None)
- Parses an XML section into an element tree. *source* is a filename or file
- object containing XML data. *parser* is an optional parser instance. If not
- given, the standard XMLTreeBuilder parser is used. Returns an ElementTree
- instance.
+ Parses an XML section into an element tree. *source* is a filename or file
+ object containing XML data. *parser* is an optional parser instance. If
+ not given, the standard :class:`XMLParser` parser is used. Returns an
+ :class:`ElementTree` instance.
.. function:: ProcessingInstruction(target, text=None)
- PI element factory. This factory function creates a special element that will
- be serialized as an XML processing instruction. *target* is a string containing
- the PI target. *text* is a string containing the PI contents, if given. Returns
- an element instance, representing a processing instruction.
+ PI element factory. This factory function creates a special element that
+ will be serialized as an XML processing instruction. *target* is a string
+ containing the PI target. *text* is a string containing the PI contents, if
+ given. Returns an element instance, representing a processing instruction.
+
+
+.. function:: register_namespace(prefix, uri)
+
+ Registers a namespace prefix. The registry is global, and any existing
+ mapping for either the given prefix or the namespace URI will be removed.
+ *prefix* is a namespace prefix. *uri* is a namespace uri. Tags and
+ attributes in this namespace will be serialized with the given prefix, if at
+ all possible.
+
+ .. versionadded:: 3.2
.. function:: SubElement(parent, tag, attrib={}, **extra)
- Subelement factory. This function creates an element instance, and appends it
- to an existing element.
+ Subelement factory. This function creates an element instance, and appends
+ it to an existing element.
+
+ The element name, attribute names, and attribute values can be either
+ bytestrings or Unicode strings. *parent* is the parent element. *tag* is
+ the subelement name. *attrib* is an optional dictionary, containing element
+ attributes. *extra* contains additional attributes, given as keyword
+ arguments. Returns an element instance.
+
+
+.. function:: tostring(element, encoding="us-ascii", method="xml")
+
+ Generates a string representation of an XML element, including all
+ subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
+ the output encoding (default is US-ASCII). Use ``encoding="unicode"`` to
+ generate a Unicode string. *method* is either ``"xml"``,
+ ``"html"`` or ``"text"`` (default is ``"xml"``). Returns an (optionally)
+ encoded string containing the XML data.
- The element name, attribute names, and attribute values can be an ASCII-only
- :class:`bytes` object or a :class:`str` object. *parent* is the parent
- element. *tag* is the subelement name. *attrib* is an optional dictionary,
- containing element attributes. *extra* contains additional attributes, given
- as keyword arguments. Returns an element instance.
+.. function:: tostringlist(element, encoding="us-ascii", method="xml")
-.. function:: tostring(element, encoding=None)
+ Generates a string representation of an XML element, including all
+ subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
+ the output encoding (default is US-ASCII). Use ``encoding="unicode"`` to
+ generate a Unicode string. *method* is either ``"xml"``,
+ ``"html"`` or ``"text"`` (default is ``"xml"``). Returns a list of
+ (optionally) encoded strings containing the XML data. It does not guarantee
+ any specific sequence, except that ``"".join(tostringlist(element)) ==
+ tostring(element)``.
- Generates a string representation of an XML element, including all subelements.
- *element* is an Element instance. *encoding* is the output encoding (default is
- US-ASCII). Returns an encoded string containing the XML data.
+ .. versionadded:: 3.2
-.. function:: XML(text)
+.. function:: XML(text, parser=None)
Parses an XML section from a string constant. This function can be used to
- embed "XML literals" in Python code. *text* is a string containing XML data.
- Returns an Element instance.
+ embed "XML literals" in Python code. *text* is a string containing XML
+ data. *parser* is an optional parser instance. If not given, the standard
+ :class:`XMLParser` parser is used. Returns an :class:`Element` instance.
-.. function:: XMLID(text)
+.. function:: XMLID(text, parser=None)
Parses an XML section from a string constant, and also returns a dictionary
- which maps from element id:s to elements. *text* is a string containing XML
- data. Returns a tuple containing an Element instance and a dictionary.
+ which maps from element id:s to elements. *text* is a string containing XML
+ data. *parser* is an optional parser instance. If not given, the standard
+ :class:`XMLParser` parser is used. Returns a tuple containing an
+ :class:`Element` instance and a dictionary.
+
+
+.. _elementtree-element-objects:
+
+Element Objects
+---------------
+
+
+.. class:: Element(tag, attrib={}, **extra)
+
+ Element class. This class defines the Element interface, and provides a
+ reference implementation of this interface.
+
+ The element name, attribute names, and attribute values can be either
+ bytestrings or Unicode strings. *tag* is the element name. *attrib* is
+ an optional dictionary, containing element attributes. *extra* contains
+ additional attributes, given as keyword arguments.
+
+
+ .. attribute:: tag
+
+ A string identifying what kind of data this element represents (the
+ element type, in other words).
+
+
+ .. attribute:: text
+ The *text* attribute can be used to hold additional data associated with
+ the element. As the name implies this attribute is usually a string but
+ may be any application-specific object. If the element is created from
+ an XML file the attribute will contain any text found between the element
+ tags.
-.. _elementtree-element-interface:
-The Element Interface
----------------------
+ .. attribute:: tail
-Element objects returned by Element or SubElement have the following methods
-and attributes.
+ The *tail* attribute can be used to hold additional data associated with
+ the element. This attribute is usually a string but may be any
+ application-specific object. If the element is created from an XML file
+ the attribute will contain any text found after the element's end tag and
+ before the next tag.
-.. attribute:: Element.tag
+ .. attribute:: attrib
- A string identifying what kind of data this element represents (the element
- type, in other words).
+ A dictionary containing the element's attributes. Note that while the
+ *attrib* value is always a real mutable Python dictionary, an ElementTree
+ implementation may choose to use another internal representation, and
+ create the dictionary only if someone asks for it. To take advantage of
+ such implementations, use the dictionary methods below whenever possible.
+ The following dictionary-like methods work on the element attributes.
-.. attribute:: Element.text
- The *text* attribute can be used to hold additional data associated with the
- element. As the name implies this attribute is usually a string but may be any
- application-specific object. If the element is created from an XML file the
- attribute will contain any text found between the element tags.
+ .. method:: clear()
+ Resets an element. This function removes all subelements, clears all
+ attributes, and sets the text and tail attributes to None.
-.. attribute:: Element.tail
- The *tail* attribute can be used to hold additional data associated with the
- element. This attribute is usually a string but may be any application-specific
- object. If the element is created from an XML file the attribute will contain
- any text found after the element's end tag and before the next tag.
+ .. method:: get(key, default=None)
+ Gets the element attribute named *key*.
-.. attribute:: Element.attrib
+ Returns the attribute value, or *default* if the attribute was not found.
- A dictionary containing the element's attributes. Note that while the *attrib*
- value is always a real mutable Python dictionary, an ElementTree implementation
- may choose to use another internal representation, and create the dictionary
- only if someone asks for it. To take advantage of such implementations, use the
- dictionary methods below whenever possible.
-The following dictionary-like methods work on the element attributes.
+ .. method:: items()
+ Returns the element attributes as a sequence of (name, value) pairs. The
+ attributes are returned in an arbitrary order.
-.. method:: Element.clear()
- Resets an element. This function removes all subelements, clears all
- attributes, and sets the text and tail attributes to None.
+ .. method:: keys()
+ Returns the elements attribute names as a list. The names are returned
+ in an arbitrary order.
-.. method:: Element.get(key, default=None)
- Gets the element attribute named *key*.
+ .. method:: set(key, value)
- Returns the attribute value, or *default* if the attribute was not found.
+ Set the attribute *key* on the element to *value*.
+ The following methods work on the element's children (subelements).
-.. method:: Element.items()
- Returns the element attributes as a sequence of (name, value) pairs. The
- attributes are returned in an arbitrary order.
+ .. method:: append(subelement)
+ Adds the element *subelement* to the end of this elements internal list
+ of subelements.
-.. method:: Element.keys()
- Returns the elements attribute names as a list. The names are returned in an
- arbitrary order.
+ .. method:: extend(subelements)
+ Appends *subelements* from a sequence object with zero or more elements.
+ Raises :exc:`AssertionError` if a subelement is not a valid object.
-.. method:: Element.set(key, value)
+ .. versionadded:: 3.2
- Set the attribute *key* on the element to *value*.
-The following methods work on the element's children (subelements).
+ .. method:: find(match)
+ Finds the first subelement matching *match*. *match* may be a tag name
+ or path. Returns an element instance or ``None``.
-.. method:: Element.append(subelement)
- Adds the element *subelement* to the end of this elements internal list of
- subelements.
+ .. method:: findall(match)
+ Finds all matching subelements, by tag name or path. Returns a list
+ containing all matching elements in document order.
-.. method:: Element.find(match)
- Finds the first subelement matching *match*. *match* may be a tag name or path.
- Returns an element instance or ``None``.
+ .. method:: findtext(match, default=None)
+ Finds text for the first subelement matching *match*. *match* may be
+ a tag name or path. Returns the text content of the first matching
+ element, or *default* if no element was found. Note that if the matching
+ element has no text content an empty string is returned.
-.. method:: Element.findall(match)
- Finds all subelements matching *match*. *match* may be a tag name or path.
- Returns an iterable yielding all matching elements in document order.
+ .. method:: getchildren()
+ .. deprecated:: 3.2
+ Use ``list(elem)`` or iteration.
-.. method:: Element.findtext(condition, default=None)
- Finds text for the first subelement matching *condition*. *condition* may be a
- tag name or path. Returns the text content of the first matching element, or
- *default* if no element was found. Note that if the matching element has no
- text content an empty string is returned.
+ .. method:: getiterator(tag=None)
+
+ .. deprecated:: 3.2
+ Use method :meth:`Element.iter` instead.
+
+
+ .. method:: insert(index, element)
+
+ Inserts a subelement at the given position in this element.
+
+
+ .. method:: iter(tag=None)
+ Creates a tree :term:`iterator` with the current element as the root.
+ The iterator iterates over this element and all elements below it, in
+ document (depth first) order. If *tag* is not ``None`` or ``'*'``, only
+ elements whose tag equals *tag* are returned from the iterator. If the
+ tree structure is modified during iteration, the result is undefined.
-.. method:: Element.getchildren()
- Returns all subelements. The elements are returned in document order.
+ .. method:: iterfind(match)
+ Finds all matching subelements, by tag name or path. Returns an iterable
+ yielding all matching elements in document order.
-.. method:: Element.getiterator(tag=None)
+ .. versionadded:: 3.2
- Creates a tree iterator with the current element as the root. The iterator
- iterates over this element and all elements below it, in document (depth first)
- order. If *tag* is not ``None`` or ``'*'``, only elements whose tag equals
- *tag* are returned from the iterator.
+ .. method:: itertext()
-.. method:: Element.insert(index, element)
+ Creates a text iterator. The iterator loops over this element and all
+ subelements, in document order, and returns all inner text.
- Inserts a subelement at the given position in this element.
+ .. versionadded:: 3.2
-.. method:: Element.makeelement(tag, attrib)
+ .. method:: makeelement(tag, attrib)
- Creates a new element object of the same type as this element. Do not call this
- method, use the SubElement factory function instead.
+ Creates a new element object of the same type as this element. Do not
+ call this method, use the :func:`SubElement` factory function instead.
-.. method:: Element.remove(subelement)
+ .. method:: remove(subelement)
- Removes *subelement* from the element. Unlike the findXYZ methods this method
- compares elements based on the instance identity, not on tag value or contents.
+ Removes *subelement* from the element. Unlike the find\* methods this
+ method compares elements based on the instance identity, not on tag value
+ or contents.
-Element objects also support the following sequence type methods for working
-with subelements: :meth:`__delitem__`, :meth:`__getitem__`, :meth:`__setitem__`,
-:meth:`__len__`.
+ :class:`Element` objects also support the following sequence type methods
+ for working with subelements: :meth:`__delitem__`, :meth:`__getitem__`,
+ :meth:`__setitem__`, :meth:`__len__`.
-Caution: Because Element objects do not define a :meth:`__bool__` method,
-elements with no subelements will test as ``False``. ::
+ Caution: Elements with no subelements will test as ``False``. This behavior
+ will change in future versions. Use specific ``len(elem)`` or ``elem is
+ None`` test instead. ::
- element = root.find('foo')
+ element = root.find('foo')
- if not element: # careful!
- print("element not found, or element has no subelements")
+ if not element: # careful!
+ print("element not found, or element has no subelements")
- if element is None:
- print("element not found")
+ if element is None:
+ print("element not found")
.. _elementtree-elementtree-objects:
@@ -307,50 +389,49 @@ ElementTree Objects
.. class:: ElementTree(element=None, file=None)
- ElementTree wrapper class. This class represents an entire element hierarchy,
- and adds some extra support for serialization to and from standard XML.
+ ElementTree wrapper class. This class represents an entire element
+ hierarchy, and adds some extra support for serialization to and from
+ standard XML.
- *element* is the root element. The tree is initialized with the contents of the
- XML *file* if given.
+ *element* is the root element. The tree is initialized with the contents
+ of the XML *file* if given.
.. method:: _setroot(element)
Replaces the root element for this tree. This discards the current
contents of the tree, and replaces it with the given element. Use with
- care. *element* is an element instance.
+ care. *element* is an element instance.
- .. method:: find(path)
+ .. method:: find(match)
- Finds the first toplevel element with given tag. Same as
- getroot().find(path). *path* is the element to look for. Returns the
- first matching element, or ``None`` if no element was found.
+ Finds the first toplevel element matching *match*. *match* may be a tag
+ name or path. Same as getroot().find(match). Returns the first matching
+ element, or ``None`` if no element was found.
- .. method:: findall(path)
+ .. method:: findall(match)
- Finds all toplevel elements with the given tag. Same as
- getroot().findall(path). *path* is the element to look for. Returns a
- list or :term:`iterator` containing all matching elements, in document
- order.
+ Finds all matching subelements, by tag name or path. Same as
+ getroot().findall(match). *match* may be a tag name or path. Returns a
+ list containing all matching elements, in document order.
- .. method:: findtext(path, default=None)
+ .. method:: findtext(match, default=None)
Finds the element text for the first toplevel element with given tag.
- Same as getroot().findtext(path). *path* is the toplevel element to look
- for. *default* is the value to return if the element was not
- found. Returns the text content of the first matching element, or the
- default value no element was found. Note that if the element has is
- found, but has no text content, this method returns an empty string.
+ Same as getroot().findtext(match). *match* may be a tag name or path.
+ *default* is the value to return if the element was not found. Returns
+ the text content of the first matching element, or the default value no
+ element was found. Note that if the element is found, but has no text
+ content, this method returns an empty string.
.. method:: getiterator(tag=None)
- Creates and returns a tree iterator for the root element. The iterator
- loops over all elements in this tree, in section order. *tag* is the tag
- to look for (default is to return all elements)
+ .. deprecated:: 3.2
+ Use method :meth:`ElementTree.iter` instead.
.. method:: getroot()
@@ -358,19 +439,40 @@ ElementTree Objects
Returns the root element for this tree.
+ .. method:: iter(tag=None)
+
+ Creates and returns a tree iterator for the root element. The iterator
+ loops over all elements in this tree, in section order. *tag* is the tag
+ to look for (default is to return all elements)
+
+
+ .. method:: iterfind(match)
+
+ Finds all matching subelements, by tag name or path. Same as
+ getroot().iterfind(match). Returns an iterable yielding all matching
+ elements in document order.
+
+ .. versionadded:: 3.2
+
+
.. method:: parse(source, parser=None)
Loads an external XML section into this element tree. *source* is a file
name or :term:`file object`. *parser* is an optional parser instance.
- If not given, the standard XMLTreeBuilder parser is used. Returns the section
+ If not given, the standard XMLParser parser is used. Returns the section
root element.
- .. method:: write(file, encoding=None)
+ .. method:: write(file, encoding="us-ascii", xml_declaration=None, method="xml")
Writes the element tree to a file, as XML. *file* is a file name, or a
:term:`file object` opened for writing. *encoding* [1]_ is the output encoding
- (default is US-ASCII).
+ (default is US-ASCII). Use ``encoding="unicode"`` to write a Unicode string.
+ *xml_declaration* controls if an XML declaration
+ should be added to the file. Use False for never, True for always, None
+ for only if not US-ASCII or UTF-8 or Unicode (default is None). *method* is
+ either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``).
+ Returns an (optionally) encoded string.
This is the XML file that is going to be manipulated::
@@ -389,13 +491,13 @@ Example of changing the attribute "target" of every link in first paragraph::
>>> from xml.etree.ElementTree import ElementTree
>>> tree = ElementTree()
>>> tree.parse("index.xhtml")
- <Element html at b7d3f1ec>
+ <Element 'html' at 0xb77e6fac>
>>> p = tree.find("body/p") # Finds first occurrence of tag p in body
>>> p
- <Element p at 8416e0c>
- >>> links = p.getiterator("a") # Returns list of all links
+ <Element 'p' at 0xb77ec26c>
+ >>> links = list(p.iter("a")) # Returns list of all links
>>> links
- [<Element a at b7d4f9ec>, <Element a at b7d4fb0c>]
+ [<Element 'a' at 0xb77ec2ac>, <Element 'a' at 0xb77ec1cc>]
>>> for i in links: # Iterates through all found links
... i.attrib["target"] = "blank"
>>> tree.write("output.xhtml")
@@ -408,12 +510,12 @@ QName Objects
.. class:: QName(text_or_uri, tag=None)
- QName wrapper. This can be used to wrap a QName attribute value, in order to
- get proper namespace handling on output. *text_or_uri* is a string containing
- the QName value, in the form {uri}local, or, if the tag argument is given, the
- URI part of a QName. If *tag* is given, the first argument is interpreted as an
- URI, and this argument is interpreted as a local name. :class:`QName` instances
- are opaque.
+ QName wrapper. This can be used to wrap a QName attribute value, in order
+ to get proper namespace handling on output. *text_or_uri* is a string
+ containing the QName value, in the form {uri}local, or, if the tag argument
+ is given, the URI part of a QName. If *tag* is given, the first argument is
+ interpreted as an URI, and this argument is interpreted as a local name.
+ :class:`QName` instances are opaque.
.. _elementtree-treebuilder-objects:
@@ -424,74 +526,89 @@ TreeBuilder Objects
.. class:: TreeBuilder(element_factory=None)
- Generic element structure builder. This builder converts a sequence of start,
- data, and end method calls to a well-formed element structure. You can use this
- class to build an element structure using a custom XML parser, or a parser for
- some other XML-like format. The *element_factory* is called to create new
- Element instances when given.
+ Generic element structure builder. This builder converts a sequence of
+ start, data, and end method calls to a well-formed element structure. You
+ can use this class to build an element structure using a custom XML parser,
+ or a parser for some other XML-like format. The *element_factory* is called
+ to create new :class:`Element` instances when given.
.. method:: close()
- Flushes the parser buffers, and returns the toplevel document
- element. Returns an Element instance.
+ Flushes the builder buffers, and returns the toplevel document
+ element. Returns an :class:`Element` instance.
.. method:: data(data)
- Adds text to the current element. *data* is a string. This should be
- either an ASCII-only :class:`bytes` object or a :class:`str` object.
+ Adds text to the current element. *data* is a string. This should be
+ either a bytestring, or a Unicode string.
.. method:: end(tag)
- Closes the current element. *tag* is the element name. Returns the closed
- element.
+ Closes the current element. *tag* is the element name. Returns the
+ closed element.
.. method:: start(tag, attrs)
- Opens a new element. *tag* is the element name. *attrs* is a dictionary
- containing element attributes. Returns the opened element.
+ Opens a new element. *tag* is the element name. *attrs* is a dictionary
+ containing element attributes. Returns the opened element.
+
+ In addition, a custom :class:`TreeBuilder` object can provide the
+ following method:
-.. _elementtree-xmltreebuilder-objects:
+ .. method:: doctype(name, pubid, system)
+
+ Handles a doctype declaration. *name* is the doctype name. *pubid* is
+ the public identifier. *system* is the system identifier. This method
+ does not exist on the default :class:`TreeBuilder` class.
+
+ .. versionadded:: 3.2
-XMLTreeBuilder Objects
-----------------------
+.. _elementtree-xmlparser-objects:
-.. class:: XMLTreeBuilder(html=0, target=None)
+XMLParser Objects
+-----------------
- Element structure builder for XML source data, based on the expat parser. *html*
- are predefined HTML entities. This flag is not supported by the current
- implementation. *target* is the target object. If omitted, the builder uses an
- instance of the standard TreeBuilder class.
+
+.. class:: XMLParser(html=0, target=None, encoding=None)
+
+ :class:`Element` structure builder for XML source data, based on the expat
+ parser. *html* are predefined HTML entities. This flag is not supported by
+ the current implementation. *target* is the target object. If omitted, the
+ builder uses an instance of the standard TreeBuilder class. *encoding* [1]_
+ is optional. If given, the value overrides the encoding specified in the
+ XML file.
.. method:: close()
- Finishes feeding data to the parser. Returns an element structure.
+ Finishes feeding data to the parser. Returns an element structure.
.. method:: doctype(name, pubid, system)
- Handles a doctype declaration. *name* is the doctype name. *pubid* is the
- public identifier. *system* is the system identifier.
+ .. deprecated:: 3.2
+ Define the :meth:`TreeBuilder.doctype` method on a custom TreeBuilder
+ target.
.. method:: feed(data)
- Feeds data to the parser. *data* is encoded data.
+ Feeds data to the parser. *data* is encoded data.
-:meth:`XMLTreeBuilder.feed` calls *target*\'s :meth:`start` method
+:meth:`XMLParser.feed` calls *target*\'s :meth:`start` method
for each opening tag, its :meth:`end` method for each closing tag,
-and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close`
+and data is processed by method :meth:`data`. :meth:`XMLParser.close`
calls *target*\'s method :meth:`close`.
-:class:`XMLTreeBuilder` can be used not only for building a tree structure.
+:class:`XMLParser` can be used not only for building a tree structure.
This is an example of counting the maximum depth of an XML file::
- >>> from xml.etree.ElementTree import XMLTreeBuilder
+ >>> from xml.etree.ElementTree import XMLParser
>>> class MaxDepth: # The target object of the parser
... maxDepth = 0
... depth = 0
@@ -507,7 +624,7 @@ This is an example of counting the maximum depth of an XML file::
... return self.maxDepth
...
>>> target = MaxDepth()
- >>> parser = XMLTreeBuilder(target=target)
+ >>> parser = XMLParser(target=target)
>>> exampleXml = """
... <a>
... <b>
@@ -527,7 +644,6 @@ This is an example of counting the maximum depth of an XML file::
.. rubric:: Footnotes
.. [#] The encoding string included in XML output should conform to the
- appropriate standards. For example, "UTF-8" is valid, but "UTF8" is
- not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
+ appropriate standards. For example, "UTF-8" is valid, but "UTF8" is
+ not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
and http://www.iana.org/assignments/character-sets.
-
diff --git a/Doc/library/xml.etree.rst b/Doc/library/xml.etree.rst
deleted file mode 100644
index a944765417..0000000000
--- a/Doc/library/xml.etree.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-:mod:`xml.etree` --- The ElementTree API for XML
-================================================
-
-.. module:: xml.etree
- :synopsis: Package containing common ElementTree modules.
-.. moduleauthor:: Fredrik Lundh <fredrik@pythonware.com>
-
-
-The ElementTree package is a simple, efficient, and quite popular library for
-XML manipulation in Python. The :mod:`xml.etree` package contains the most
-common components from the ElementTree API library. In the current release,
-this package contains the :mod:`ElementTree`, :mod:`ElementPath`, and
-:mod:`ElementInclude` modules from the full ElementTree distribution.
-
-.. XXX To be continued!
-
-
-.. seealso::
-
- `ElementTree Overview <http://effbot.org/tag/elementtree>`_
- The home page for :mod:`ElementTree`. This includes links to additional
- documentation, alternative implementations, and other add-ons.
-
diff --git a/Doc/library/xml.sax.utils.rst b/Doc/library/xml.sax.utils.rst
index 95099f6709..ff36fd89e8 100644
--- a/Doc/library/xml.sax.utils.rst
+++ b/Doc/library/xml.sax.utils.rst
@@ -50,13 +50,19 @@ or as base classes.
using the reference concrete syntax.
-.. class:: XMLGenerator(out=None, encoding='iso-8859-1')
+.. class:: XMLGenerator(out=None, encoding='iso-8859-1', short_empty_elements=False)
This class implements the :class:`ContentHandler` interface by writing SAX
events back into an XML document. In other words, using an :class:`XMLGenerator`
as the content handler will reproduce the original document being parsed. *out*
should be a file-like object which will default to *sys.stdout*. *encoding* is
the encoding of the output stream which defaults to ``'iso-8859-1'``.
+ *short_empty_elements* controls the formatting of elements that contain no
+ content: if *False* (the default) they are emitted as a pair of start/end
+ tags, if set to *True* they are emitted as a single self-closed tag.
+
+ .. versionadded:: 3.2
+ short_empty_elements
.. class:: XMLFilterBase(base)
diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst
index d25cbaf5a5..a62021d473 100644
--- a/Doc/library/xmlrpc.client.rst
+++ b/Doc/library/xmlrpc.client.rst
@@ -10,6 +10,10 @@
.. XXX Not everything is documented yet. It might be good to describe
Marshaller, Unmarshaller, getparser, dumps, loads, and Transport.
+**Source code:** :source:`Lib/xmlrpc/client.py`
+
+--------------
+
XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP as a
transport. With it, a client can call methods with parameters on a remote
server (the server is named by a URI) and get back structured data. This module
diff --git a/Doc/library/xmlrpc.server.rst b/Doc/library/xmlrpc.server.rst
index 3cb2c3aaa1..67feba6d1f 100644
--- a/Doc/library/xmlrpc.server.rst
+++ b/Doc/library/xmlrpc.server.rst
@@ -6,6 +6,9 @@
.. moduleauthor:: Brian Quinlan <brianq@activestate.com>
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+**Source code:** :source:`Lib/xmlrpc/server.py`
+
+--------------
The :mod:`xmlrpc.server` module provides a basic server framework for XML-RPC
servers written in Python. Servers can either be free standing, using
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index 827b6b1e98..3282054485 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -6,6 +6,10 @@
.. moduleauthor:: James C. Ahlstrom <jim@interet.com>
.. sectionauthor:: James C. Ahlstrom <jim@interet.com>
+**Source code:** :source:`Lib/zipfile.py`
+
+--------------
+
The ZIP file format is a common archive and compression standard. This module
provides tools to create, read, write, append, and list a ZIP file. Any
advanced use of this module will require an understanding of the format, as
@@ -24,10 +28,18 @@ For other archive formats, see the :mod:`bz2`, :mod:`gzip`, and
The module defines the following items:
-.. exception:: BadZipfile
+.. exception:: BadZipFile
The error raised for bad ZIP files (old name: ``zipfile.error``).
+ .. versionadded:: 3.2
+
+
+.. exception:: BadZipfile
+
+ This is an alias for :exc:`BadZipFile` that exists for compatibility with
+ Python versions prior to 3.2. Usage is deprecated.
+
.. exception:: LargeZipFile
@@ -43,6 +55,7 @@ The module defines the following items:
.. class:: PyZipFile
+ :noindex:
Class for creating ZIP archives containing Python libraries.
@@ -101,30 +114,37 @@ ZipFile Objects
Open a ZIP file, where *file* can be either a path to a file (a string) or a
file-like object. The *mode* parameter should be ``'r'`` to read an existing
file, ``'w'`` to truncate and write a new file, or ``'a'`` to append to an
- existing file. If *mode* is ``'a'`` and *file* refers to an existing ZIP file,
- then additional files are added to it. If *file* does not refer to a ZIP file,
- then a new ZIP archive is appended to the file. This is meant for adding a ZIP
- archive to another file, such as :file:`python.exe`. Using ::
-
- cat myzip.zip >> python.exe
-
- also works, and at least :program:`WinZip` can read such files. If *mode* is
- ``a`` and the file does not exist at all, it is created. *compression* is the
- ZIP compression method to use when writing the archive, and should be
- :const:`ZIP_STORED` or :const:`ZIP_DEFLATED`; unrecognized values will cause
- :exc:`RuntimeError` to be raised. If :const:`ZIP_DEFLATED` is specified but the
- :mod:`zlib` module is not available, :exc:`RuntimeError` is also raised. The
- default is :const:`ZIP_STORED`. If *allowZip64* is ``True`` zipfile will create
- ZIP files that use the ZIP64 extensions when the zipfile is larger than 2 GB. If
- it is false (the default) :mod:`zipfile` will raise an exception when the ZIP
- file would require ZIP64 extensions. ZIP64 extensions are disabled by default
- because the default :program:`zip` and :program:`unzip` commands on Unix (the
- InfoZIP utilities) don't support these extensions.
+ existing file. If *mode* is ``'a'`` and *file* refers to an existing ZIP
+ file, then additional files are added to it. If *file* does not refer to a
+ ZIP file, then a new ZIP archive is appended to the file. This is meant for
+ adding a ZIP archive to another file (such as :file:`python.exe`). If
+ *mode* is ``a`` and the file does not exist at all, it is created.
+ *compression* is the ZIP compression method to use when writing the archive,
+ and should be :const:`ZIP_STORED` or :const:`ZIP_DEFLATED`; unrecognized
+ values will cause :exc:`RuntimeError` to be raised. If :const:`ZIP_DEFLATED`
+ is specified but the :mod:`zlib` module is not available, :exc:`RuntimeError`
+ is also raised. The default is :const:`ZIP_STORED`. If *allowZip64* is
+ ``True`` zipfile will create ZIP files that use the ZIP64 extensions when
+ the zipfile is larger than 2 GB. If it is false (the default) :mod:`zipfile`
+ will raise an exception when the ZIP file would require ZIP64 extensions.
+ ZIP64 extensions are disabled by default because the default :program:`zip`
+ and :program:`unzip` commands on Unix (the InfoZIP utilities) don't support
+ these extensions.
If the file is created with mode ``'a'`` or ``'w'`` and then
:meth:`close`\ d without adding any files to the archive, the appropriate
ZIP structures for an empty archive will be written to the file.
+ ZipFile is also a context manager and therefore supports the
+ :keyword:`with` statement. In the example, *myzip* is closed after the
+ :keyword:`with` statement's suite is finished---even if an exception occurs::
+
+ with ZipFile('spam.zip', 'w') as myzip:
+ myzip.write('eggs.txt')
+
+ .. versionadded:: 3.2
+ Added the ability to use :class:`ZipFile` as a context manager.
+
.. method:: ZipFile.close()
@@ -263,7 +283,7 @@ ZipFile Objects
byte, the name of the file in the archive will be truncated at the null byte.
-.. method:: ZipFile.writestr(zinfo_or_arcname, bytes)
+.. method:: ZipFile.writestr(zinfo_or_arcname, bytes[, compress_type])
Write the string *bytes* to the archive; *zinfo_or_arcname* is either the file
name it will be given in the archive, or a :class:`ZipInfo` instance. If it's
@@ -273,6 +293,10 @@ ZipFile Objects
created with mode ``'r'`` will raise a :exc:`RuntimeError`. Calling
:meth:`writestr` on a closed ZipFile will raise a :exc:`RuntimeError`.
+ If given, *compress_type* overrides the value given for the *compression*
+ parameter to the constructor for the new entry, or in the *zinfo_or_arcname*
+ (if that is a :class:`ZipInfo` instance).
+
.. note::
When passing a :class:`ZipInfo` instance as the *zinfo_or_arcname* parameter,
@@ -280,6 +304,9 @@ ZipFile Objects
member of the given :class:`ZipInfo` instance. By default, the
:class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`.
+ .. versionchanged:: 3.2
+ The *compression_type* argument.
+
The following data attributes are also available:
@@ -296,37 +323,53 @@ The following data attributes are also available:
string no longer than 65535 bytes. Comments longer than this will be
truncated in the written archive when :meth:`ZipFile.close` is called.
+
.. _pyzipfile-objects:
PyZipFile Objects
-----------------
The :class:`PyZipFile` constructor takes the same parameters as the
-:class:`ZipFile` constructor. Instances have one method in addition to those of
-:class:`ZipFile` objects.
-
-
-.. method:: PyZipFile.writepy(pathname, basename='')
-
- Search for files :file:`\*.py` and add the corresponding file to the archive.
- The corresponding file is a :file:`\*.pyo` file if available, else a
- :file:`\*.pyc` file, compiling if necessary. If the pathname is a file, the
- filename must end with :file:`.py`, and just the (corresponding
- :file:`\*.py[co]`) file is added at the top level (no path information). If the
- pathname is a file that does not end with :file:`.py`, a :exc:`RuntimeError`
- will be raised. If it is a directory, and the directory is not a package
- directory, then all the files :file:`\*.py[co]` are added at the top level. If
- the directory is a package directory, then all :file:`\*.py[co]` are added under
- the package name as a file path, and if any subdirectories are package
- directories, all of these are added recursively. *basename* is intended for
- internal use only. The :meth:`writepy` method makes archives with file names
- like this::
-
- string.pyc # Top level name
- test/__init__.pyc # Package directory
- test/testall.pyc # Module test.testall
- test/bogus/__init__.pyc # Subpackage directory
- test/bogus/myfile.pyc # Submodule test.bogus.myfile
+:class:`ZipFile` constructor, and one additional parameter, *optimize*.
+
+.. class:: PyZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=False, \
+ optimize=-1)
+
+ .. versionadded:: 3.2
+ The *optimize* parameter.
+
+ Instances have one method in addition to those of :class:`ZipFile` objects:
+
+ .. method:: PyZipFile.writepy(pathname, basename='')
+
+ Search for files :file:`\*.py` and add the corresponding file to the
+ archive.
+
+ If the *optimize* parameter to :class:`PyZipFile` was not given or ``-1``,
+ the corresponding file is a :file:`\*.pyo` file if available, else a
+ :file:`\*.pyc` file, compiling if necessary.
+
+ If the *optimize* parameter to :class:`PyZipFile` was ``0``, ``1`` or
+ ``2``, only files with that optimization level (see :func:`compile`) are
+ added to the archive, compiling if necessary.
+
+ If the pathname is a file, the filename must end with :file:`.py`, and
+ just the (corresponding :file:`\*.py[co]`) file is added at the top level
+ (no path information). If the pathname is a file that does not end with
+ :file:`.py`, a :exc:`RuntimeError` will be raised. If it is a directory,
+ and the directory is not a package directory, then all the files
+ :file:`\*.py[co]` are added at the top level. If the directory is a
+ package directory, then all :file:`\*.py[co]` are added under the package
+ name as a file path, and if any subdirectories are package directories,
+ all of these are added recursively. *basename* is intended for internal
+ use only. The :meth:`writepy` method makes archives with file names like
+ this::
+
+ string.pyc # Top level name
+ test/__init__.pyc # Package directory
+ test/testall.pyc # Module test.testall
+ test/bogus/__init__.pyc # Subpackage directory
+ test/bogus/myfile.pyc # Submodule test.bogus.myfile
.. _zipinfo-objects:
diff --git a/Doc/library/zipimport.rst b/Doc/library/zipimport.rst
index 57ac1e4061..2f0fa384af 100644
--- a/Doc/library/zipimport.rst
+++ b/Doc/library/zipimport.rst
@@ -26,18 +26,20 @@ Any files may be present in the ZIP archive, but only files :file:`.py` and
corresponding :file:`.pyc` or :file:`.pyo` file, meaning that if a ZIP archive
doesn't contain :file:`.pyc` files, importing may be rather slow.
+ZIP archives with an archive comment are currently not supported.
+
.. seealso::
`PKZIP Application Note <http://www.pkware.com/documents/casestudies/APPNOTE.TXT>`_
Documentation on the ZIP file format by Phil Katz, the creator of the format and
algorithms used.
- :pep:`0273` - Import Modules from Zip Archives
+ :pep:`273` - Import Modules from Zip Archives
Written by James C. Ahlstrom, who also provided an implementation. Python 2.3
follows the specification in PEP 273, but uses an implementation written by Just
van Rossum that uses the import hooks described in PEP 302.
- :pep:`0302` - New Import Hooks
+ :pep:`302` - New Import Hooks
The PEP to add the import hooks that help this module work.
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
index 862cf9132a..a7b8343c7e 100644
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -96,20 +96,24 @@ The available exception and functions in this module are:
Decompresses the bytes in *data*, returning a bytes object containing the
uncompressed data. The *wbits* parameter controls the size of the window
- buffer. If *bufsize* is given, it is used as the initial size of the output
+ buffer, and is discussed further below.
+ If *bufsize* is given, it is used as the initial size of the output
buffer. Raises the :exc:`error` exception if any error occurs.
The absolute value of *wbits* is the base two logarithm of the size of the
history buffer (the "window size") used when compressing data. Its absolute
value should be between 8 and 15 for the most recent versions of the zlib
library, larger values resulting in better compression at the expense of greater
- memory usage. The default value is 15. When *wbits* is negative, the standard
+ memory usage. When decompressing a stream, *wbits* must not be smaller
+ than the size originally used to compress the stream; using a too-small
+ value will result in an exception. The default value is therefore the
+ highest value, 15. When *wbits* is negative, the standard
:program:`gzip` header is suppressed.
*bufsize* is the initial size of the buffer used to hold decompressed data. If
more space is required, the buffer size will be increased as needed, so you
don't have to get this value exactly right; tuning it will only save a few calls
- to :cfunc:`malloc`. The default size is 16384.
+ to :c:func:`malloc`. The default size is 16384.
.. function:: decompressobj([wbits])
diff --git a/Doc/license.rst b/Doc/license.rst
index a4f0994eb3..a32b7abeb6 100644
--- a/Doc/license.rst
+++ b/Doc/license.rst
@@ -106,7 +106,10 @@ been GPL-compatible; the table below summarizes the various releases.
+----------------+--------------+------------+------------+-----------------+
| 3.1.1 | 3.1 | 2009 | PSF | yes |
+----------------+--------------+------------+------------+-----------------+
-
+| 3.1.2 | 3.1 | 2010 | PSF | yes |
++----------------+--------------+------------+------------+-----------------+
+| 3.2 | 3.1 | 2011 | PSF | yes |
++----------------+--------------+------------+------------+-----------------+
.. note::
@@ -135,7 +138,7 @@ Terms and conditions for accessing or otherwise using Python
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python |release| alone or in any derivative
version, provided, however, that PSF's License Agreement and PSF's notice of
- copyright, i.e., "Copyright © 2001-2010 Python Software Foundation; All Rights
+ copyright, i.e., "Copyright © 2001-2011 Python Software Foundation; All Rights
Reserved" are retained in Python |release| alone or in any derivative version
prepared by Licensee.
@@ -903,7 +906,7 @@ The :mod:`zlib` extension is built using an included copy of the zlib
sources unless the zlib version found on the system is too old to be
used for the build::
- Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+ Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff --git a/Doc/make.bat b/Doc/make.bat
index 6552aab65e..4ea2d519b2 100644
--- a/Doc/make.bat
+++ b/Doc/make.bat
@@ -34,7 +34,7 @@ echo.
goto end
:checkout
-svn co %SVNROOT%/external/Sphinx-0.6.5/sphinx tools/sphinx
+svn co %SVNROOT%/external/Sphinx-1.0.7/sphinx tools/sphinx
svn co %SVNROOT%/external/docutils-0.6/docutils tools/docutils
svn co %SVNROOT%/external/Jinja-2.3.1/jinja2 tools/jinja2
svn co %SVNROOT%/external/Pygments-1.3.1/pygments tools/pygments
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 31ae0ed45e..d261574db4 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -352,6 +352,8 @@ The execution of the :keyword:`with` statement with one "item" proceeds as follo
#. The context expression (the expression given in the :token:`with_item`) is
evaluated to obtain a context manager.
+#. The context manager's :meth:`__exit__` is loaded for later use.
+
#. The context manager's :meth:`__enter__` method is invoked.
#. If a target was included in the :keyword:`with` statement, the return value
@@ -361,9 +363,9 @@ The execution of the :keyword:`with` statement with one "item" proceeds as follo
The :keyword:`with` statement guarantees that if the :meth:`__enter__`
method returns without an error, then :meth:`__exit__` will always be
- called. Thus, if an error occurs during the assignment to the target
- list, it will be treated the same as an error occurring within the suite
- would be. See step 5 below.
+ called. Thus, if an error occurs during the assignment to the target list,
+ it will be treated the same as an error occurring within the suite would
+ be. See step 6 below.
#. The suite is executed.
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 6f874b6764..129f987a44 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1218,8 +1218,7 @@ Basic customization
Arguments to rich comparison methods are never coerced.
To automatically generate ordering operations from a single root operation,
- see the `Total Ordering recipe in the ASPN cookbook
- <http://code.activestate.com/recipes/576529/>`_\.
+ see :func:`functools.total_ordering`.
.. method:: object.__hash__(self)
@@ -1595,7 +1594,7 @@ attributes of *A* as they are defined within the body of the class statement.
Once those definitions are executed, the ordered dictionary is fully populated
and the metaclass's :meth:`__new__` method gets invoked. That method builds
the new type and it saves the ordered dictionary keys in an attribute
-called *members*.
+called ``members``.
Customizing instance and subclass checks
diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst
index d11e74196a..82e37a21fa 100644
--- a/Doc/reference/executionmodel.rst
+++ b/Doc/reference/executionmodel.rst
@@ -94,9 +94,7 @@ module, except those beginning with an underscore. This form may only be used
at the module level.
A target occurring in a :keyword:`del` statement is also considered bound for
-this purpose (though the actual semantics are to unbind the name). It is
-illegal to unbind a name that is referenced by an enclosing scope; the compiler
-will report a :exc:`SyntaxError`.
+this purpose (though the actual semantics are to unbind the name).
Each assignment or import statement occurs within a block defined by a class or
function definition or at the module level (the top-level code block).
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 944c39f4aa..f882952591 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -651,7 +651,7 @@ the call.
An implementation may provide built-in functions whose positional parameters
do not have names, even if they are 'named' for the purpose of documentation,
and which therefore cannot be supplied by keyword. In CPython, this is the
- case for functions implemented in C that use :cfunc:`PyArg_ParseTuple` to
+ case for functions implemented in C that use :c:func:`PyArg_ParseTuple` to
parse their arguments.
If there are more positional arguments than there are formal parameter slots, a
@@ -921,6 +921,11 @@ the left or right by the number of bits given by the second argument.
A right shift by *n* bits is defined as division by ``pow(2,n)``. A left shift
by *n* bits is defined as multiplication with ``pow(2,n)``.
+.. note::
+
+ In the current implementation, the right-hand operand is required
+ to be at most :attr:`sys.maxsize`. If the right-hand operand is larger than
+ :attr:`sys.maxsize` an :exc:`OverflowError` exception is raised.
.. _bitwise:
@@ -958,9 +963,9 @@ must be integers.
.. _comparisons:
.. _is:
-.. _isnot:
+.. _is not:
.. _in:
-.. _notin:
+.. _not in:
Comparisons
===========
@@ -1156,11 +1161,9 @@ not bother to return a value of the same type as its argument, so e.g., ``not
'foo'`` yields ``False``, not ``''``.)
-Conditional Expressions
+Conditional expressions
=======================
-.. versionadded:: 2.5
-
.. index::
pair: conditional; expression
pair: ternary; operator
@@ -1309,6 +1312,7 @@ groups from right to left).
| ``(expressions...)``, | Binding or tuple display, |
| ``[expressions...]``, | list display, |
| ``{key:datum...}``, | dictionary display, |
+| ``{expressions...}`` | set display |
+-----------------------------------------------+-------------------------------------+
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index 548e0a9ef7..a375117dac 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -385,11 +385,6 @@ namespace, depending on whether the name occurs in a :keyword:`global` statement
in the same code block. If the name is unbound, a :exc:`NameError` exception
will be raised.
-.. index:: pair: free; variable
-
-It is illegal to delete a name from the local namespace if it occurs as a free
-variable in a nested block.
-
.. index:: pair: attribute; deletion
Deletion of attribute references, subscriptions and slicings is passed to the
@@ -397,6 +392,11 @@ primary object involved; deletion of a slicing is in general equivalent to
assignment of an empty slice of the right type (but even this is determined by
the sliced object).
+.. versionchanged:: 3.2
+
+ Previously it was illegal to delete a name from the local namespace if it
+ occurs as a free variable in a nested block.
+
.. _return:
@@ -674,7 +674,9 @@ Once the name of the module is known (unless otherwise specified, the term
"module" will refer to both packages and modules), searching
for the module or package can begin. The first place checked is
:data:`sys.modules`, the cache of all modules that have been imported
-previously. If the module is found there then it is used in step (2) of import.
+previously. If the module is found there then it is used in step (2) of import
+unless ``None`` is found in :data:`sys.modules`, in which case
+:exc:`ImportError` is raised.
.. index::
single: sys.meta_path
@@ -691,7 +693,7 @@ within a package (as denoted by the existence of a dot in the name), then a
second argument to :meth:`find_module` is given as the value of the
:attr:`__path__` attribute from the parent package (everything up to the last
dot in the name of the module being imported). If a finder can find the module
-it returns a :term:`loader` (discussed later) or returns :keyword:`None`.
+it returns a :term:`loader` (discussed later) or returns ``None``.
.. index::
single: sys.path_hooks
@@ -718,11 +720,11 @@ finder cached then :data:`sys.path_hooks` is searched by calling each object in
the list with a single argument of the path, returning a finder or raises
:exc:`ImportError`. If a finder is returned then it is cached in
:data:`sys.path_importer_cache` and then used for that path entry. If no finder
-can be found but the path exists then a value of :keyword:`None` is
+can be found but the path exists then a value of ``None`` is
stored in :data:`sys.path_importer_cache` to signify that an implicit,
file-based finder that handles modules stored as individual files should be
used for that path. If the path does not exist then a finder which always
-returns :keyword:`None` is placed in the cache for the path.
+returns ``None`` is placed in the cache for the path.
.. index::
single: loader
@@ -786,7 +788,7 @@ first form of :keyword:`import`, an alternate local name can be supplied by
specifying ":keyword:`as` localname". If a name is not found,
:exc:`ImportError` is raised. If the list of identifiers is replaced by a star
(``'*'``), all public names defined in the module are bound in the local
-namespace of the :keyword:`import` statement..
+namespace of the :keyword:`import` statement.
.. index:: single: __all__ (optional module attribute)
@@ -818,7 +820,7 @@ leading dot means the current package where the module making the import
exists. Two dots means up one package level. Three dots is up two levels, etc.
So if you execute ``from . import mod`` from a module in the ``pkg`` package
then you will end up importing ``pkg.mod``. If you execute ``from ..subpkg2
-imprt mod`` from within ``pkg.subpkg1`` you will import ``pkg.subpkg2.mod``.
+import mod`` from within ``pkg.subpkg1`` you will import ``pkg.subpkg2.mod``.
The specification for relative imports is contained within :pep:`328`.
:func:`importlib.import_module` is provided to support applications that
@@ -944,7 +946,7 @@ definition, function definition, or :keyword:`import` statement.
**Programmer's note:** the :keyword:`global` is a directive to the parser. It
applies only to code parsed at the same time as the :keyword:`global` statement.
In particular, a :keyword:`global` statement contained in a string or code
-object supplied to the builtin :func:`exec` function does not affect the code
+object supplied to the built-in :func:`exec` function does not affect the code
block *containing* the function call, and code contained in such a string is
unaffected by :keyword:`global` statements in the code containing the function
call. The same applies to the :func:`eval` and :func:`compile` functions.
diff --git a/Doc/tools/rstlint.py b/Doc/tools/rstlint.py
index e977f217af..2cc3d1277c 100755
--- a/Doc/tools/rstlint.py
+++ b/Doc/tools/rstlint.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Check for stylistic and formal issues in .rst and .py
diff --git a/Doc/tools/sphinxext/download.html b/Doc/tools/sphinxext/download.html
index 4fca13882a..f89c4585f0 100644
--- a/Doc/tools/sphinxext/download.html
+++ b/Doc/tools/sphinxext/download.html
@@ -33,6 +33,10 @@ in the table are the size of the download files in megabytes.</p>
<td><a href="{{ dlbase }}/python-{{ release }}-docs-text.zip">Download</a> (ca. 2 MB)</td>
<td><a href="{{ dlbase }}/python-{{ release }}-docs-text.tar.bz2">Download</a> (ca. 1.5 MB)</td>
</tr>
+ <tr><td>EPUB</td>
+ <td><a href="{{ dlbase }}/python-{{ release }}-docs-epub.zip">Download</a> (ca. 3.5 MB)</td>
+ <td><a href="{{ dlbase }}/python-{{ release }}-docs-epub.tar.bz2">Download</a> (ca. 3.5 MB)</td>
+ </tr>
</table>
diff --git a/Doc/tools/sphinxext/indexcontent.html b/Doc/tools/sphinxext/indexcontent.html
index 30963c36dc..d5e17cd62b 100644
--- a/Doc/tools/sphinxext/indexcontent.html
+++ b/Doc/tools/sphinxext/indexcontent.html
@@ -34,7 +34,7 @@
<p><strong>Indices and tables:</strong></p>
<table class="contentstable" align="center"><tr>
<td width="50%">
- <p class="biglink"><a class="biglink" href="{{ pathto("modindex") }}">Global Module Index</a><br/>
+ <p class="biglink"><a class="biglink" href="{{ pathto("py-modindex") }}">Global Module Index</a><br/>
<span class="linkdescr">quick access to all modules</span></p>
<p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">General Index</a><br/>
<span class="linkdescr">all functions, classes, terms</span></p>
diff --git a/Doc/tools/sphinxext/indexsidebar.html b/Doc/tools/sphinxext/indexsidebar.html
index 086d8834a6..672492e600 100644
--- a/Doc/tools/sphinxext/indexsidebar.html
+++ b/Doc/tools/sphinxext/indexsidebar.html
@@ -3,7 +3,7 @@
<h3>Docs for other versions</h3>
<ul>
<li><a href="http://docs.python.org/2.7/">Python 2.7 (stable)</a></li>
- <li><a href="http://docs.python.org/dev/py3k/">Python 3.2 (in development)</a></li>
+ <li><a href="http://docs.python.org/3.1/">Python 3.1 (stable)</a></li>
<li><a href="http://www.python.org/doc/versions/">Old versions</a></li>
</ul>
diff --git a/Doc/tools/sphinxext/patchlevel.py b/Doc/tools/sphinxext/patchlevel.py
index 082858e41c..b070d60a42 100644
--- a/Doc/tools/sphinxext/patchlevel.py
+++ b/Doc/tools/sphinxext/patchlevel.py
@@ -68,4 +68,4 @@ def get_version_info():
return version, release
if __name__ == '__main__':
- print get_header_version_info('.')[1]
+ print(get_header_version_info('.')[1])
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py
index 7111c06c91..d928cfd1e0 100644
--- a/Doc/tools/sphinxext/pyspecific.py
+++ b/Doc/tools/sphinxext/pyspecific.py
@@ -10,8 +10,10 @@
"""
ISSUE_URI = 'http://bugs.python.org/issue%s'
+SOURCE_URI = 'http://hg.python.org/cpython/file/default/%s'
from docutils import nodes, utils
+from sphinx.util.nodes import split_explicit_title
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
from docutils.parsers.rst.states import Body
@@ -44,6 +46,16 @@ def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
return [refnode], []
+# Support for linking to Python source files easily
+
+def source_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
+ has_t, title, target = split_explicit_title(text)
+ title = utils.unescape(title)
+ target = utils.unescape(target)
+ refnode = nodes.reference(title, title, refuri=SOURCE_URI % target)
+ return [refnode], []
+
+
# Support for marking up implementation details
from sphinx.util.compat import Directive
@@ -72,6 +84,67 @@ class ImplementationDetail(Directive):
return [pnode]
+# Support for documenting decorators
+
+from sphinx import addnodes
+from sphinx.domains.python import PyModulelevel, PyClassmember
+
+class PyDecoratorMixin(object):
+ def handle_signature(self, sig, signode):
+ ret = super(PyDecoratorMixin, self).handle_signature(sig, signode)
+ signode.insert(0, addnodes.desc_addname('@', '@'))
+ return ret
+
+ def needs_arglist(self):
+ return False
+
+class PyDecoratorFunction(PyDecoratorMixin, PyModulelevel):
+ def run(self):
+ # a decorator function is a function after all
+ self.name = 'py:function'
+ return PyModulelevel.run(self)
+
+class PyDecoratorMethod(PyDecoratorMixin, PyClassmember):
+ def run(self):
+ self.name = 'py:method'
+ return PyClassmember.run(self)
+
+
+# Support for documenting version of removal in deprecations
+
+from sphinx.locale import versionlabels
+from sphinx.util.compat import Directive
+
+versionlabels['deprecated-removed'] = \
+ 'Deprecated since version %s, will be removed in version %s'
+
+class DeprecatedRemoved(Directive):
+ has_content = True
+ required_arguments = 2
+ optional_arguments = 1
+ final_argument_whitespace = True
+ option_spec = {}
+
+ def run(self):
+ node = addnodes.versionmodified()
+ node.document = self.state.document
+ node['type'] = 'deprecated-removed'
+ version = (self.arguments[0], self.arguments[1])
+ node['version'] = version
+ if len(self.arguments) == 3:
+ inodes, messages = self.state.inline_text(self.arguments[2],
+ self.lineno+1)
+ node.extend(inodes)
+ if self.content:
+ self.state.nested_parse(self.content, self.content_offset, node)
+ ret = [node] + messages
+ else:
+ ret = [node]
+ env = self.state.document.settings.env
+ env.note_versionchange('deprecated', version[0], node, self.lineno)
+ return ret
+
+
# Support for building "topic help" for pydoc
pydoc_topic_labels = [
@@ -119,10 +192,10 @@ class PydocTopicsBuilder(Builder):
for label in self.status_iterator(pydoc_topic_labels,
'building topics... ',
length=len(pydoc_topic_labels)):
- if label not in self.env.labels:
+ if label not in self.env.domaindata['std']['labels']:
self.warn('label %r not in documentation' % label)
continue
- docname, labelid, sectname = self.env.labels[label]
+ docname, labelid, sectname = self.env.domaindata['std']['labels'][label]
doctree = self.env.get_and_resolve_doctree(docname, self)
document = new_document('<section node>')
document.append(doctree.ids[labelid])
@@ -147,7 +220,6 @@ import suspicious
# Support for documenting Opcodes
import re
-from sphinx import addnodes
opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)(?:\s*\((.*)\))?')
@@ -165,11 +237,41 @@ def parse_opcode_signature(env, sig, signode):
return opname.strip()
+# Support for documenting pdb commands
+
+pdbcmd_sig_re = re.compile(r'([a-z()!]+)\s*(.*)')
+
+# later...
+#pdbargs_tokens_re = re.compile(r'''[a-zA-Z]+ | # identifiers
+# [.,:]+ | # punctuation
+# [\[\]()] | # parens
+# \s+ # whitespace
+# ''', re.X)
+
+def parse_pdb_command(env, sig, signode):
+ """Transform a pdb command signature into RST nodes."""
+ m = pdbcmd_sig_re.match(sig)
+ if m is None:
+ raise ValueError
+ name, args = m.groups()
+ fullname = name.replace('(', '').replace(')', '')
+ signode += addnodes.desc_name(name, name)
+ if args:
+ signode += addnodes.desc_addname(' '+args, ' '+args)
+ return fullname
+
+
def setup(app):
app.add_role('issue', issue_role)
+ app.add_role('source', source_role)
app.add_directive('impl-detail', ImplementationDetail)
+ app.add_directive('deprecated-removed', DeprecatedRemoved)
app.add_builder(PydocTopicsBuilder)
app.add_builder(suspicious.CheckSuspiciousMarkupBuilder)
app.add_description_unit('opcode', 'opcode', '%s (opcode)',
parse_opcode_signature)
+ app.add_description_unit('pdbcommand', 'pdbcmd', '%s (pdb command)',
+ parse_pdb_command)
app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)')
+ app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
+ app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
diff --git a/Doc/tools/sphinxext/static/basic.css b/Doc/tools/sphinxext/static/basic.css
index 2b47622ab8..65aa5f1011 100644
--- a/Doc/tools/sphinxext/static/basic.css
+++ b/Doc/tools/sphinxext/static/basic.css
@@ -253,8 +253,8 @@ table.docutils {
table.docutils td, table.docutils th {
padding: 2px 5px 2px 5px;
- border-left: 0;
- background-color: #eef;
+ border-left: 0;
+ background-color: #eef;
}
table.docutils td p.last, table.docutils th p.last {
@@ -270,7 +270,7 @@ table.footnote td, table.footnote th {
}
table.docutils th {
- border-top: 1px solid #cac;
+ border-top: 1px solid #cac;
background-color: #ede;
}
@@ -280,7 +280,7 @@ th {
}
th.head {
- text-align: center;
+ text-align: center;
}
/* -- other body styles ----------------------------------------------------- */
@@ -333,7 +333,7 @@ dl.glossary dt {
font-style: italic;
}
-p.deprecated {
+p.deprecated, p.deprecated-removed {
background-color: #ffe4e4;
border: 1px solid #f66;
padding: 7px
diff --git a/Doc/tools/sphinxext/susp-ignored.csv b/Doc/tools/sphinxext/susp-ignored.csv
index 4d4db94826..ef980917ea 100644
--- a/Doc/tools/sphinxext/susp-ignored.csv
+++ b/Doc/tools/sphinxext/susp-ignored.csv
@@ -186,6 +186,99 @@ documenting/fromlatex,152,:noindex,:noindex:
documenting/fromlatex,162,.. describe:,.. describe:: a == b
documenting/fromlatex,168,.. cmdoption:,.. cmdoption:: -O
documenting/fromlatex,168,.. envvar:,.. envvar:: PYTHONINSPECT
+documenting/markup,33,.. sectionauthor:,.. sectionauthor:: Guido van Rossum <guido@python.org>
+documenting/markup,42,:mod,:mod:`parrot` -- Dead parrot access
+documenting/markup,42,`,:mod:`parrot` -- Dead parrot access
+documenting/markup,42,.. module:,.. module:: parrot
+documenting/markup,42,:platform,":platform: Unix, Windows"
+documenting/markup,42,:synopsis,:synopsis: Analyze and reanimate dead parrots.
+documenting/markup,42,.. moduleauthor:,.. moduleauthor:: Eric Cleese <eric@python.invalid>
+documenting/markup,42,.. moduleauthor:,.. moduleauthor:: John Idle <john@python.invalid>
+documenting/markup,88,:noindex,:noindex:
+documenting/markup,95,.. function:,.. function:: spam(eggs)
+documenting/markup,95,:noindex,:noindex:
+documenting/markup,101,.. method:,.. method:: FileInput.input(...)
+documenting/markup,121,:function,c:function
+documenting/markup,121,.. c:,".. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)"
+documenting/markup,121,::,".. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)"
+documenting/markup,131,:member,c:member
+documenting/markup,131,.. c:,.. c:member:: PyObject* PyTypeObject.tp_bases
+documenting/markup,131,::,.. c:member:: PyObject* PyTypeObject.tp_bases
+documenting/markup,139,:macro,c:macro
+documenting/markup,143,:type,c:type
+documenting/markup,150,:var,c:var
+documenting/markup,150,.. cvar:,.. cvar:: PyObject* PyClass_Type
+documenting/markup,179,.. function:,".. function:: Timer.repeat([repeat=3[, number=1000000]])"
+documenting/markup,210,.. decorator:,.. decorator:: removename
+documenting/markup,210,.. decorator:,.. decorator:: setnewname(name)
+documenting/markup,210,:func,:func:
+documenting/markup,233,:meth,:meth:
+documenting/markup,246,.. cmdoption:,.. cmdoption:: -m <module>
+documenting/markup,264,.. describe:,.. describe:: opcode
+documenting/markup,293,.. highlightlang:,.. highlightlang:: c
+documenting/markup,313,.. literalinclude:,.. literalinclude:: example.py
+documenting/markup,328,:rolename,:rolename:`content`
+documenting/markup,328,`,:rolename:`content`
+documenting/markup,333,:role,:role:`title <target>`
+documenting/markup,333,`,:role:`title <target>`
+documenting/markup,339,:meth,:meth:`~Queue.Queue.get`
+documenting/markup,339,`,:meth:`~Queue.Queue.get`
+documenting/markup,387,:func,:func:`filter`
+documenting/markup,387,`,:func:`filter`
+documenting/markup,387,:func,:func:`foo.filter`
+documenting/markup,387,`,:func:`foo.filter`
+documenting/markup,393,:func,:func:`open`
+documenting/markup,393,`,:func:`open`
+documenting/markup,393,:func,:func:`.open`
+documenting/markup,393,`,:func:`.open`
+documenting/markup,409,:data,c:data
+documenting/markup,413,:func,c:func
+documenting/markup,417,:macro,c:macro
+documenting/markup,421,:type,c:type
+documenting/markup,426,:member,c:member
+documenting/markup,476,:file,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ...
+documenting/markup,476,`,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ...
+documenting/markup,495,:kbd,:kbd:`C-x C-f`
+documenting/markup,495,`,:kbd:`C-x C-f`
+documenting/markup,495,:kbd,:kbd:`Control-x Control-f`
+documenting/markup,495,`,:kbd:`Control-x Control-f`
+documenting/markup,509,:mailheader,:mailheader:`Content-Type`
+documenting/markup,509,`,:mailheader:`Content-Type`
+documenting/markup,518,:manpage,:manpage:`ls(1)`
+documenting/markup,518,`,:manpage:`ls(1)`
+documenting/markup,534,:menuselection,:menuselection:`Start --> Programs`
+documenting/markup,534,`,:menuselection:`Start --> Programs`
+documenting/markup,549,`,``code``
+documenting/markup,567,:file,:file:
+documenting/markup,567,`,``code``
+documenting/markup,602,:ref,:ref:`label-name`
+documenting/markup,602,`,:ref:`label-name`
+documenting/markup,606,:ref,"It refers to the section itself, see :ref:`my-reference-label`."
+documenting/markup,606,`,"It refers to the section itself, see :ref:`my-reference-label`."
+documenting/markup,615,:ref,:ref:
+documenting/markup,636,.. note:,.. note::
+documenting/markup,663,.. versionadded:,.. versionadded:: 3.1
+documenting/markup,688,::,.. impl-detail::
+documenting/markup,688,::,.. impl-detail:: This shortly mentions an implementation detail.
+documenting/markup,708,.. seealso:,.. seealso::
+documenting/markup,708,:mod,Module :mod:`zipfile`
+documenting/markup,708,`,Module :mod:`zipfile`
+documenting/markup,708,:mod,Documentation of the :mod:`zipfile` standard module.
+documenting/markup,708,`,Documentation of the :mod:`zipfile` standard module.
+documenting/markup,708,`,"`GNU tar manual, Basic Tar Format <http://link>`_"
+documenting/markup,722,.. centered:,.. centered::
+documenting/markup,767,.. toctree:,.. toctree::
+documenting/markup,767,:maxdepth,:maxdepth: 2
+documenting/markup,783,.. index:,.. index::
+documenting/markup,813,.. index:,".. index:: BNF, grammar, syntax, notation"
+documenting/markup,844,`,"unaryneg ::= ""-"" `integer`"
+documenting/markup,849,.. productionlist:,.. productionlist::
+documenting/markup,849,`,"try1_stmt: ""try"" "":"" `suite`"
+documenting/markup,849,`,": (""except"" [`expression` ["","" `target`]] "":"" `suite`)+"
+documenting/markup,849,`,": [""else"" "":"" `suite`]"
+documenting/markup,849,`,": [""finally"" "":"" `suite`]"
+documenting/markup,849,`,"try2_stmt: ""try"" "":"" `suite`"
+documenting/markup,849,`,": ""finally"" "":"" `suite`"
documenting/rest,33,`,``text``
documenting/rest,47,:rolename,:rolename:`content`
documenting/rest,47,`,:rolename:`content`
@@ -203,15 +296,15 @@ faq/windows,393,:REG,.py :REG_SZ: c:\<path to python>\python.exe -u %s %s
library/bisect,32,:hi,all(val >= x for val in a[i:hi])
library/bisect,42,:hi,all(val > x for val in a[i:hi])
library/http.client,52,:port,host:port
-library/nntplib,272,:bytes,:bytes
-library/nntplib,272,:lines,:lines
-library/nntplib,272,:lines,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']"
-library/nntplib,272,:bytes,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']"
+library/nntplib,,:bytes,:bytes
+library/nntplib,,:lines,:lines
+library/nntplib,,:lines,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']"
+library/nntplib,,:bytes,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']"
library/pickle,,:memory,"conn = sqlite3.connect("":memory:"")"
library/profile,,:lineno,"(sort by filename:lineno),"
library/socket,,::,"(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]"
-library/stdtypes,1026,:end,s[start:end]
-library/stdtypes,1195,:end,s[start:end]
+library/stdtypes,,:end,s[start:end]
+library/stdtypes,,:end,s[start:end]
library/urllib.request,,:close,Connection:close
library/urllib.request,,:password,"""joe:password@python.org"""
library/urllib.request,,:lang,"xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""en"" lang=""en"">\n\n<head>\n"
@@ -228,85 +321,68 @@ whatsnew/2.7,862,::,"export PYTHONWARNINGS=all,error:::Cookie:0"
whatsnew/2.7,862,:Cookie,"export PYTHONWARNINGS=all,error:::Cookie:0"
whatsnew/2.7,1619,::,>>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo')
whatsnew/2.7,1619,::,"ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]',"
-documenting/markup,33,.. sectionauthor:,.. sectionauthor:: Guido van Rossum <guido@python.org>
-documenting/markup,42,:mod,:mod:`parrot` -- Dead parrot access
-documenting/markup,42,`,:mod:`parrot` -- Dead parrot access
-documenting/markup,42,.. module:,.. module:: parrot
-documenting/markup,42,:platform,":platform: Unix, Windows"
-documenting/markup,42,:synopsis,:synopsis: Analyze and reanimate dead parrots.
-documenting/markup,42,.. moduleauthor:,.. moduleauthor:: Eric Cleese <eric@python.invalid>
-documenting/markup,42,.. moduleauthor:,.. moduleauthor:: John Idle <john@python.invalid>
-documenting/markup,88,:noindex,:noindex:
-documenting/markup,95,.. function:,.. function:: spam(eggs)
-documenting/markup,95,:noindex,:noindex:
-documenting/markup,101,.. method:,.. method:: FileInput.input(...)
-documenting/markup,121,.. cfunction:,".. cfunction:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)"
-documenting/markup,131,.. cmember:,.. cmember:: PyObject* PyTypeObject.tp_bases
-documenting/markup,150,.. cvar:,.. cvar:: PyObject* PyClass_Type
-documenting/markup,179,.. function:,".. function:: Timer.repeat([repeat=3[, number=1000000]])"
-documenting/markup,209,.. cmdoption:,.. cmdoption:: -m <module>
-documenting/markup,227,.. describe:,.. describe:: opcode
-documenting/markup,256,.. highlightlang:,.. highlightlang:: c
-documenting/markup,276,.. literalinclude:,.. literalinclude:: example.py
-documenting/markup,291,:rolename,:rolename:`content`
-documenting/markup,291,`,:rolename:`content`
-documenting/markup,296,:role,:role:`title <target>`
-documenting/markup,296,`,:role:`title <target>`
-documenting/markup,302,:meth,:meth:`~Queue.Queue.get`
-documenting/markup,302,`,:meth:`~Queue.Queue.get`
-documenting/markup,350,:func,:func:`filter`
-documenting/markup,350,`,:func:`filter`
-documenting/markup,350,:func,:func:`foo.filter`
-documenting/markup,350,`,:func:`foo.filter`
-documenting/markup,356,:func,:func:`open`
-documenting/markup,356,`,:func:`open`
-documenting/markup,356,:func,:func:`.open`
-documenting/markup,356,`,:func:`.open`
-documenting/markup,435,:file,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ...
-documenting/markup,435,`,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ...
-documenting/markup,454,:kbd,:kbd:`C-x C-f`
-documenting/markup,454,`,:kbd:`C-x C-f`
-documenting/markup,454,:kbd,:kbd:`Control-x Control-f`
-documenting/markup,454,`,:kbd:`Control-x Control-f`
-documenting/markup,468,:mailheader,:mailheader:`Content-Type`
-documenting/markup,468,`,:mailheader:`Content-Type`
-documenting/markup,477,:manpage,:manpage:`ls(1)`
-documenting/markup,477,`,:manpage:`ls(1)`
-documenting/markup,493,:menuselection,:menuselection:`Start --> Programs`
-documenting/markup,493,`,:menuselection:`Start --> Programs`
-documenting/markup,508,`,``code``
-documenting/markup,526,:file,:file:
-documenting/markup,526,`,``code``
-documenting/markup,561,:ref,:ref:`label-name`
-documenting/markup,561,`,:ref:`label-name`
-documenting/markup,565,:ref,"It refers to the section itself, see :ref:`my-reference-label`."
-documenting/markup,565,`,"It refers to the section itself, see :ref:`my-reference-label`."
-documenting/markup,574,:ref,:ref:
-documenting/markup,595,.. note:,.. note::
-documenting/markup,622,.. versionadded:,.. versionadded:: 3.1
-documenting/markup,647,::,.. impl-detail::
-documenting/markup,647,::,.. impl-detail:: This shortly mentions an implementation detail.
-documenting/markup,667,.. seealso:,.. seealso::
-documenting/markup,667,:mod,Module :mod:`zipfile`
-documenting/markup,667,`,Module :mod:`zipfile`
-documenting/markup,667,:mod,Documentation of the :mod:`zipfile` standard module.
-documenting/markup,667,`,Documentation of the :mod:`zipfile` standard module.
-documenting/markup,667,`,"`GNU tar manual, Basic Tar Format <http://link>`_"
-documenting/markup,681,.. centered:,.. centered::
-documenting/markup,726,.. toctree:,.. toctree::
-documenting/markup,726,:maxdepth,:maxdepth: 2
-documenting/markup,742,.. index:,.. index::
-documenting/markup,772,.. index:,".. index:: BNF, grammar, syntax, notation"
-documenting/markup,803,`,"unaryneg ::= ""-"" `integer`"
-documenting/markup,808,.. productionlist:,.. productionlist::
-documenting/markup,808,`,"try1_stmt: ""try"" "":"" `suite`"
-documenting/markup,808,`,": (""except"" [`expression` ["","" `target`]] "":"" `suite`)+"
-documenting/markup,808,`,": [""else"" "":"" `suite`]"
-documenting/markup,808,`,": [""finally"" "":"" `suite`]"
-documenting/markup,808,`,"try2_stmt: ""try"" "":"" `suite`"
-documenting/markup,808,`,": ""finally"" "":"" `suite`"
-library/importlib,396,`,The keys are the module names -- packages must end in ``.__init__``.
-library/importlib,396,`,"name with ``.__init__`` appended to it."""""""
-library/importlib,396,`,# ``__init__``.
-library/socket,249,::,"(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]"
-library/stdtypes,860,:end,s[start:end]
+library/configparser,,`,# Set the optional `raw` argument of get() to True if you wish to disable
+library/configparser,,`,# The optional `vars` argument is a dict with members that will take
+library/configparser,,`,# The optional `fallback` argument can be used to provide a fallback value
+library/configparser,,:option,${section:option}
+library/configparser,,:system,path: ${Common:system_dir}/Library/Frameworks/
+library/configparser,,:home,my_dir: ${Common:home_dir}/twosheds
+library/configparser,,:path,python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}
+library/configparser,,:Python,python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}
+library/pdb,,:lineno,[filename:lineno | bpnumber [bpnumber ...]]
+library/pdb,,:lineno,filename:lineno
+library/logging,,:Watch,WARNING:root:Watch out!
+library/logging,,:So,INFO:root:So should this
+library/logging,,:Started,INFO:root:Started
+library/logging,,:Doing,INFO:root:Doing something
+library/logging,,:Finished,INFO:root:Finished
+library/logging,,:Look,WARNING:root:Look before you leap!
+library/logging,,:So,INFO:So should this
+library/logging,,:logger,severity:logger name:message
+library/logging,,:message,severity:logger name:message
+whatsnew/3.2,,:directory,... ${buildout:directory}/downloads/dist
+whatsnew/3.2,,:location,... zope9-location = ${zope9:location}
+whatsnew/3.2,,:prefix,... zope-conf = ${custom:prefix}/etc/zope.conf
+howto/logging,,:root,WARNING:root:Watch out!
+howto/logging,,:Watch,WARNING:root:Watch out!
+howto/logging,,:root,DEBUG:root:This message should go to the log file
+howto/logging,,:This,DEBUG:root:This message should go to the log file
+howto/logging,,:root,INFO:root:So should this
+howto/logging,,:So,INFO:root:So should this
+howto/logging,,:root,"WARNING:root:And this, too"
+howto/logging,,:And,"WARNING:root:And this, too"
+howto/logging,,:root,INFO:root:Started
+howto/logging,,:Started,INFO:root:Started
+howto/logging,,:root,INFO:root:Doing something
+howto/logging,,:Doing,INFO:root:Doing something
+howto/logging,,:root,INFO:root:Finished
+howto/logging,,:Finished,INFO:root:Finished
+howto/logging,,:root,WARNING:root:Look before you leap!
+howto/logging,,:Look,WARNING:root:Look before you leap!
+howto/logging,,:This,DEBUG:This message should appear on the console
+howto/logging,,:So,INFO:So should this
+howto/logging,,:And,"WARNING:And this, too"
+howto/logging,,:logger,severity:logger name:message
+howto/logging,,:message,severity:logger name:message
+library/logging.handlers,,:port,host:port
+documenting/markup,613,`,:ref:`link text <reference-label>`
+library/imaplib,116,:MM,"""DD-Mmm-YYYY HH:MM:SS"
+library/imaplib,116,:SS,"""DD-Mmm-YYYY HH:MM:SS"
+whatsnew/3.2,,::,"$ export PYTHONWARNINGS='ignore::RuntimeWarning::,once::UnicodeWarning::'"
+howto/pyporting,75,::,# make sure to use :: Python *and* :: Python :: 3 so
+howto/pyporting,75,::,"'Programming Language :: Python',"
+howto/pyporting,75,::,'Programming Language :: Python :: 3'
+whatsnew/3.2,,:gz,">>> with tarfile.open(name='myarchive.tar.gz', mode='w:gz') as tf:"
+whatsnew/3.2,,:directory,${buildout:directory}/downloads/dist
+whatsnew/3.2,,:location,zope9-location = ${zope9:location}
+whatsnew/3.2,,:prefix,zope-conf = ${custom:prefix}/etc/zope.conf
+whatsnew/3.2,,:beef,>>> urllib.parse.urlparse('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/')
+whatsnew/3.2,,:cafe,>>> urllib.parse.urlparse('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/')
+whatsnew/3.2,,:affe,>>> urllib.parse.urlparse('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/')
+whatsnew/3.2,,:deaf,>>> urllib.parse.urlparse('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/')
+whatsnew/3.2,,:feed,>>> urllib.parse.urlparse('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/')
+whatsnew/3.2,,:beef,"netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]',"
+whatsnew/3.2,,:cafe,"netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]',"
+whatsnew/3.2,,:affe,"netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]',"
+whatsnew/3.2,,:deaf,"netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]',"
+whatsnew/3.2,,:feed,"netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]',"
diff --git a/Doc/tools/sphinxext/suspicious.py b/Doc/tools/sphinxext/suspicious.py
index f15e931b90..888b2318b3 100644
--- a/Doc/tools/sphinxext/suspicious.py
+++ b/Doc/tools/sphinxext/suspicious.py
@@ -49,13 +49,15 @@ import sys
from docutils import nodes
from sphinx.builders import Builder
-detect_all = re.compile(ur'''
+detect_all = re.compile(r'''
::(?=[^=])| # two :: (but NOT ::=)
:[a-zA-Z][a-zA-Z0-9]+| # :foo
`| # ` (seldom used by itself)
(?<!\.)\.\.[ \t]*\w+: # .. foo: (but NOT ... else:)
''', re.UNICODE | re.VERBOSE).finditer
+py3 = sys.version_info >= (3, 0)
+
class Rule:
def __init__(self, docname, lineno, issue, line):
@@ -136,7 +138,11 @@ class CheckSuspiciousMarkupBuilder(Builder):
if not self.any_issue: self.info()
self.any_issue = True
self.write_log_entry(lineno, issue, text)
- self.warn('[%s:%d] "%s" found in "%-.120s"' % (
+ if py3:
+ self.warn('[%s:%d] "%s" found in "%-.120s"' %
+ (self.docname, lineno, issue, text))
+ else:
+ self.warn('[%s:%d] "%s" found in "%-.120s"' % (
self.docname.encode(sys.getdefaultencoding(),'replace'),
lineno,
issue.encode(sys.getdefaultencoding(),'replace'),
@@ -144,13 +150,19 @@ class CheckSuspiciousMarkupBuilder(Builder):
self.app.statuscode = 1
def write_log_entry(self, lineno, issue, text):
- f = open(self.log_file_name, 'ab')
- writer = csv.writer(f, dialect)
- writer.writerow([self.docname.encode('utf-8'),
- lineno,
- issue.encode('utf-8'),
- text.strip().encode('utf-8')])
- f.close()
+ if py3:
+ f = open(self.log_file_name, 'a')
+ writer = csv.writer(f, dialect)
+ writer.writerow([self.docname, lineno, issue, text.strip()])
+ f.close()
+ else:
+ f = open(self.log_file_name, 'ab')
+ writer = csv.writer(f, dialect)
+ writer.writerow([self.docname.encode('utf-8'),
+ lineno,
+ issue.encode('utf-8'),
+ text.strip().encode('utf-8')])
+ f.close()
def load_rules(self, filename):
"""Load database of previously ignored issues.
@@ -160,18 +172,26 @@ class CheckSuspiciousMarkupBuilder(Builder):
"""
self.info("loading ignore rules... ", nonl=1)
self.rules = rules = []
- try: f = open(filename, 'rb')
- except IOError: return
+ try:
+ if py3:
+ f = open(filename, 'r')
+ else:
+ f = open(filename, 'rb')
+ except IOError:
+ return
for i, row in enumerate(csv.reader(f)):
if len(row) != 4:
raise ValueError(
"wrong format in %s, line %d: %s" % (filename, i+1, row))
docname, lineno, issue, text = row
- docname = docname.decode('utf-8')
- if lineno: lineno = int(lineno)
- else: lineno = None
- issue = issue.decode('utf-8')
- text = text.decode('utf-8')
+ if lineno:
+ lineno = int(lineno)
+ else:
+ lineno = None
+ if not py3:
+ docname = docname.decode('utf-8')
+ issue = issue.decode('utf-8')
+ text = text.decode('utf-8')
rule = Rule(docname, lineno, issue, text)
rules.append(rule)
f.close()
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index 82735df4cb..a328ab23a2 100644
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -717,7 +717,7 @@ object that defines the method :meth:`__next__` which accesses elements in the
container one at a time. When there are no more elements, :meth:`__next__`
raises a :exc:`StopIteration` exception which tells the :keyword:`for` loop to
terminate. You can call the :meth:`__next__` method using the :func:`next`
-builtin; this example shows how it all works::
+built-in function; this example shows how it all works::
>>> s = 'abc'
>>> it = iter(s)
@@ -730,7 +730,6 @@ builtin; this example shows how it all works::
>>> next(it)
'c'
>>> next(it)
-
Traceback (most recent call last):
File "<stdin>", line 1, in ?
next(it)
@@ -742,7 +741,7 @@ returns an object with a :meth:`__next__` method. If the class defines
:meth:`__next__`, then :meth:`__iter__` can just return ``self``::
class Reverse:
- "Iterator for looping over a sequence backwards"
+ """Iterator for looping over a sequence backwards."""
def __init__(self, data):
self.data = data
self.index = len(data)
@@ -754,6 +753,8 @@ returns an object with a :meth:`__next__` method. If the class defines
self.index = self.index - 1
return self.data[self.index]
+::
+
>>> rev = Reverse('spam')
>>> iter(rev)
<__main__.Reverse object at 0x00A1DB50>
@@ -782,6 +783,8 @@ easy to create::
for index in range(len(data)-1, -1, -1):
yield data[index]
+::
+
>>> for char in reverse('golf'):
... print(char)
...
diff --git a/Doc/tutorial/floatingpoint.rst b/Doc/tutorial/floatingpoint.rst
index c06568e39a..863fb28c75 100644
--- a/Doc/tutorial/floatingpoint.rst
+++ b/Doc/tutorial/floatingpoint.rst
@@ -92,18 +92,17 @@ thing in all languages that support your hardware's floating-point arithmetic
(although some languages may not *display* the difference by default, or in all
output modes).
-Python's built-in :func:`str` function produces only 12 significant digits, and
-you may wish to use that instead. It's unusual for ``eval(str(x))`` to
-reproduce *x*, but the output may be more pleasant to look at::
+For more pleasant output, you may may wish to use string formatting to produce a limited number of significant digits::
- >>> str(math.pi)
+ >>> format(math.pi, '.12g') # give 12 significant digits
'3.14159265359'
+ >>> format(math.pi, '.2f') # give 2 digits after the point
+ '3.14'
+
>>> repr(math.pi)
'3.141592653589793'
- >>> format(math.pi, '.2f')
- '3.14'
It's important to realize that this is, in a real sense, an illusion: you're
simply rounding the *display* of the true machine value.
diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst
index abe1ce09c0..00f5aea609 100644
--- a/Doc/tutorial/inputoutput.rst
+++ b/Doc/tutorial/inputoutput.rst
@@ -40,8 +40,8 @@ which can be read by the interpreter (or will force a :exc:`SyntaxError` if
there is not equivalent syntax). For objects which don't have a particular
representation for human consumption, :func:`str` will return the same value as
:func:`repr`. Many values, such as numbers or structures like lists and
-dictionaries, have the same representation using either function. Strings and
-floating point numbers, in particular, have two distinct representations.
+dictionaries, have the same representation using either function. Strings, in
+particular, have two distinct representations.
Some examples::
@@ -50,9 +50,7 @@ Some examples::
'Hello, world.'
>>> repr(s)
"'Hello, world.'"
- >>> str(1.0/7.0)
- '0.142857142857'
- >>> repr(1.0/7.0)
+ >>> str(1/7)
'0.14285714285714285'
>>> x = 10 * 3.25
>>> y = 200 * 200
@@ -162,7 +160,7 @@ Positional and keyword arguments can be arbitrarily combined::
An optional ``':'`` and format specifier can follow the field name. This allows
greater control over how the value is formatted. The following example
-truncates Pi to three places after the decimal.
+rounds Pi to three places after the decimal.
>>> import math
>>> print('The value of PI is approximately {0:.3f}.'.format(math.pi))
@@ -207,7 +205,7 @@ Old string formatting
---------------------
The ``%`` operator can also be used for string formatting. It interprets the
-left argument much like a :cfunc:`sprintf`\ -style format string to be applied
+left argument much like a :c:func:`sprintf`\ -style format string to be applied
to the right argument, and returns the string resulting from this formatting
operation. For example::
diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst
index 94d7562a13..8d743de34f 100644
--- a/Doc/tutorial/interpreter.rst
+++ b/Doc/tutorial/interpreter.rst
@@ -10,11 +10,11 @@ Using the Python Interpreter
Invoking the Interpreter
========================
-The Python interpreter is usually installed as :file:`/usr/local/bin/python3.1`
+The Python interpreter is usually installed as :file:`/usr/local/bin/python3.2`
on those machines where it is available; putting :file:`/usr/local/bin` in your
Unix shell's search path makes it possible to start it by typing the command ::
- python3.1
+ python3.2
to the shell. [#]_ Since the choice of the directory where the interpreter lives
is an installation option, other places are possible; check with your local
@@ -22,11 +22,11 @@ Python guru or system administrator. (E.g., :file:`/usr/local/python` is a
popular alternative location.)
On Windows machines, the Python installation is usually placed in
-:file:`C:\\Python31`, though you can change this when you're running the
+:file:`C:\\Python32`, though you can change this when you're running the
installer. To add this directory to your path, you can type the following
command into the command prompt in a DOS box::
- set path=%path%;C:\python31
+ set path=%path%;C:\python32
Typing an end-of-file character (:kbd:`Control-D` on Unix, :kbd:`Control-Z` on
Windows) at the primary prompt causes the interpreter to exit with a zero exit
@@ -94,8 +94,8 @@ with the *secondary prompt*, by default three dots (``...``). The interpreter
prints a welcome message stating its version number and a copyright notice
before printing the first prompt::
- $ python3.1
- Python 3.1 (py3k, Sep 12 2007, 12:21:02)
+ $ python3.2
+ Python 3.2 (py3k, Sep 12 2007, 12:21:02)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
@@ -148,7 +148,7 @@ Executable Python Scripts
On BSD'ish Unix systems, Python scripts can be made directly executable, like
shell scripts, by putting the line ::
- #! /usr/bin/env python3.1
+ #! /usr/bin/env python3.2
(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning
of the script and giving the file an executable mode. The ``#!`` must be the
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 3e42cee174..44519da97c 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -483,6 +483,12 @@ concatenated and so on::
>>> 3*a[:3] + ['Boo!']
['spam', 'eggs', 100, 'spam', 'eggs', 100, 'spam', 'eggs', 100, 'Boo!']
+All slice operations return a new list containing the requested elements. This
+means that the following slice returns a shallow copy of the list *a*::
+
+ >>> a[:]
+ ['spam', 'eggs', 100, 1234]
+
Unlike strings, which are *immutable*, it is possible to change individual
elements of a list::
diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst
index b138f65a7e..97297434ed 100644
--- a/Doc/tutorial/stdlib.rst
+++ b/Doc/tutorial/stdlib.rst
@@ -72,7 +72,7 @@ three`` at the command line::
The :mod:`getopt` module processes *sys.argv* using the conventions of the Unix
:func:`getopt` function. More powerful and flexible command line processing is
-provided by the :mod:`optparse` module.
+provided by the :mod:`argparse` module.
.. _tut-stderr:
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 3fe0c7aedd..d1f47eba89 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -1,5 +1,8 @@
.. highlightlang:: none
+.. ATTENTION: You probably should update Misc/python.man, too, if you modify
+.. this file.
+
.. _using-on-general:
Command line and environment
@@ -92,8 +95,9 @@ source.
file is not available.
If this option is given, the first element of :data:`sys.argv` will be the
- full path to the module file. As with the :option:`-c` option, the current
- directory will be added to the start of :data:`sys.path`.
+ full path to the module file (while the module file is being located, the
+ first element will be set to ``"-m"``). As with the :option:`-c` option,
+ the current directory will be added to the start of :data:`sys.path`.
Many standard library modules contain code that is invoked on their execution
as a script. An example is the :mod:`timeit` module::
@@ -111,6 +115,7 @@ source.
.. versionchanged:: 3.1
Supply the package name to run a ``__main__`` submodule.
+
.. describe:: -
Read commands from standard input (:data:`sys.stdin`). If standard input is
@@ -215,6 +220,13 @@ Miscellaneous options
Discard docstrings in addition to the :option:`-O` optimizations.
+.. cmdoption:: -q
+
+ Don't display the copyright and version messages even in interactive mode.
+
+ .. versionadded:: 3.2
+
+
.. cmdoption:: -s
Don't add user site directory to sys.path
@@ -294,7 +306,7 @@ Miscellaneous options
the remaining fields. Empty fields match all values; trailing empty fields
may be omitted. The *message* field matches the start of the warning message
printed; this match is case-insensitive. The *category* field matches the
- warning category. This must be a class name; the match test whether the
+ warning category. This must be a class name; the match tests whether the
actual warning category of the message is a subclass of the specified warning
category. The full class name must be given. The *module* field matches the
(fully-qualified) module name; this match is case-sensitive. The *line*
@@ -306,6 +318,8 @@ Miscellaneous options
:pep:`230` -- Warning framework
+ :envvar:`PYTHONWARNINGS`
+
.. cmdoption:: -x
@@ -314,6 +328,17 @@ Miscellaneous options
.. note:: The line numbers in error messages will be off by one.
+
+.. cmdoption:: -X
+
+ Reserved for various implementation-specific options. CPython currently
+ defines none of them, but allows to pass arbitrary values and retrieve
+ them through the :data:`sys._xoptions` dictionary.
+
+ .. versionchanged:: 3.2
+ It is now allowed to pass :option:`-X` with CPython.
+
+
Options you shouldn't use
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -323,11 +348,6 @@ Options you shouldn't use
.. _Jython: http://jython.org
-.. cmdoption:: -X
-
- Reserved for alternative implementations of Python to use for their own
- purposes.
-
.. _using-on-envvars:
Environment variables
@@ -437,9 +457,10 @@ These environment variables influence Python's behavior.
.. envvar:: PYTHONIOENCODING
- Overrides the encoding used for stdin/stdout/stderr, in the syntax
- ``encodingname:errorhandler``. The ``:errorhandler`` part is optional and
- has the same meaning as in :func:`str.encode`.
+ If this is set before running the interpreter, it overrides the encoding used
+ for stdin/stdout/stderr, in the syntax ``encodingname:errorhandler``. The
+ ``:errorhandler`` part is optional and has the same meaning as in
+ :func:`str.encode`.
For stderr, the ``:errorhandler`` part is ignored; the handler will always be
``'backslashreplace'``.
@@ -469,6 +490,12 @@ These environment variables influence Python's behavior.
value instead of the value got through the C runtime. Only works on
Mac OS X.
+.. envvar:: PYTHONWARNINGS
+
+ This is equivalent to the :option:`-W` option. If set to a comma
+ separated string, it is equivalent to specifying :option:`-W` multiple
+ times.
+
Debug-mode variables
~~~~~~~~~~~~~~~~~~~~
diff --git a/Doc/whatsnew/2.0.rst b/Doc/whatsnew/2.0.rst
index 3bb12b666c..850e57d4a6 100644
--- a/Doc/whatsnew/2.0.rst
+++ b/Doc/whatsnew/2.0.rst
@@ -189,7 +189,7 @@ support Unicode:
ignored and ``'replace'`` uses U+FFFD, the official replacement character, in
case of any problems.
-* The :keyword:`exec` statement, and various built-ins such as ``eval()``,
+* The ``exec`` statement, and various built-ins such as ``eval()``,
``getattr()``, and ``setattr()`` will also accept Unicode strings as well as
regular strings. (It's possible that the process of fixing this missed some
built-ins; if you find a built-in function that accepts strings but doesn't
@@ -515,11 +515,11 @@ functions::
# kw is a dictionary of keyword args
...
-The :keyword:`print` statement can now have its output directed to a file-like
-object by following the :keyword:`print` with ``>> file``, similar to the
+The ``print`` statement can now have its output directed to a file-like
+object by following the ``print`` with ``>> file``, similar to the
redirection operator in Unix shells. Previously you'd either have to use the
:meth:`write` method of the file-like object, which lacks the convenience and
-simplicity of :keyword:`print`, or you could assign a new value to
+simplicity of ``print``, or you could assign a new value to
``sys.stdout`` and then restore the old value. For sending output to standard
error, it's much easier to write this::
@@ -581,7 +581,7 @@ Consult the README in the Python source distribution for more instructions.
An attempt has been made to alleviate one of Python's warts, the often-confusing
:exc:`NameError` exception when code refers to a local variable before the
variable has been assigned a value. For example, the following code raises an
-exception on the :keyword:`print` statement in both 1.5.2 and 2.0; in 1.5.2 a
+exception on the ``print`` statement in both 1.5.2 and 2.0; in 1.5.2 a
:exc:`NameError` exception is raised, while 2.0 raises a new
:exc:`UnboundLocalError` exception. :exc:`UnboundLocalError` is a subclass of
:exc:`NameError`, so any existing code that expects :exc:`NameError` to be
diff --git a/Doc/whatsnew/2.1.rst b/Doc/whatsnew/2.1.rst
index 7f405213db..117af10c4f 100644
--- a/Doc/whatsnew/2.1.rst
+++ b/Doc/whatsnew/2.1.rst
@@ -81,13 +81,13 @@ though, since such code would have been pretty confusing to read in the first
place.
One side effect of the change is that the ``from module import *`` and
-:keyword:`exec` statements have been made illegal inside a function scope under
+``exec`` statements have been made illegal inside a function scope under
certain conditions. The Python reference manual has said all along that ``from
module import *`` is only legal at the top level of a module, but the CPython
interpreter has never enforced this before. As part of the implementation of
nested scopes, the compiler which turns Python source into bytecodes has to
generate different code to access variables in a containing scope. ``from
-module import *`` and :keyword:`exec` make it impossible for the compiler to
+module import *`` and ``exec`` make it impossible for the compiler to
figure this out, because they add names to the local namespace that are
unknowable at compile time. Therefore, if a function contains function
definitions or :keyword:`lambda` expressions with free variables, the compiler
@@ -102,11 +102,11 @@ To make the preceding explanation a bit clearer, here's an example::
def g():
return x
-Line 4 containing the :keyword:`exec` statement is a syntax error, since
-:keyword:`exec` would define a new local variable named ``x`` whose value should
+Line 4 containing the ``exec`` statement is a syntax error, since
+``exec`` would define a new local variable named ``x`` whose value should
be accessed by :func:`g`.
-This shouldn't be much of a limitation, since :keyword:`exec` is rarely used in
+This shouldn't be much of a limitation, since ``exec`` is rarely used in
most Python code (and when it is used, it's often a sign of a poor design
anyway).
diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst
index 89e4d76bef..1db1ee7dfd 100644
--- a/Doc/whatsnew/2.2.rst
+++ b/Doc/whatsnew/2.2.rst
@@ -754,7 +754,7 @@ Here are the changes 2.2 introduces:
* Classes can define methods called :meth:`__truediv__` and :meth:`__floordiv__`
to overload the two division operators. At the C level, there are also slots in
- the :ctype:`PyNumberMethods` structure so extension types can define the two
+ the :c:type:`PyNumberMethods` structure so extension types can define the two
operators.
* Python 2.2 supports some command-line arguments for testing whether code will
@@ -892,13 +892,13 @@ though, since such code would have been pretty confusing to read in the first
place.
One side effect of the change is that the ``from module import *`` and
-:keyword:`exec` statements have been made illegal inside a function scope under
+``exec`` statements have been made illegal inside a function scope under
certain conditions. The Python reference manual has said all along that ``from
module import *`` is only legal at the top level of a module, but the CPython
interpreter has never enforced this before. As part of the implementation of
nested scopes, the compiler which turns Python source into bytecodes has to
generate different code to access variables in a containing scope. ``from
-module import *`` and :keyword:`exec` make it impossible for the compiler to
+module import *`` and ``exec`` make it impossible for the compiler to
figure this out, because they add names to the local namespace that are
unknowable at compile time. Therefore, if a function contains function
definitions or :keyword:`lambda` expressions with free variables, the compiler
@@ -913,11 +913,11 @@ To make the preceding explanation a bit clearer, here's an example::
def g():
return x
-Line 4 containing the :keyword:`exec` statement is a syntax error, since
-:keyword:`exec` would define a new local variable named ``x`` whose value should
+Line 4 containing the ``exec`` statement is a syntax error, since
+``exec`` would define a new local variable named ``x`` whose value should
be accessed by :func:`g`.
-This shouldn't be much of a limitation, since :keyword:`exec` is rarely used in
+This shouldn't be much of a limitation, since ``exec`` is rarely used in
most Python code (and when it is used, it's often a sign of a poor design
anyway).
@@ -983,7 +983,7 @@ New and Improved Modules
Jun-ichiro "itojun" Hagino.)
* Two new format characters were added to the :mod:`struct` module for 64-bit
- integers on platforms that support the C :ctype:`long long` type. ``q`` is for
+ integers on platforms that support the C :c:type:`long long` type. ``q`` is for
a signed 64-bit integer, and ``Q`` is for an unsigned one. The value is
returned in Python's long integer type. (Contributed by Tim Peters.)
@@ -1057,16 +1057,16 @@ code, none of the changes described here will affect you very much.
at much higher speeds than Python-based functions and should reduce the overhead
of profiling and tracing. This will be of interest to authors of development
environments for Python. Two new C functions were added to Python's API,
- :cfunc:`PyEval_SetProfile` and :cfunc:`PyEval_SetTrace`. The existing
+ :c:func:`PyEval_SetProfile` and :c:func:`PyEval_SetTrace`. The existing
:func:`sys.setprofile` and :func:`sys.settrace` functions still exist, and have
simply been changed to use the new C-level interface. (Contributed by Fred L.
Drake, Jr.)
* Another low-level API, primarily of interest to implementors of Python
- debuggers and development tools, was added. :cfunc:`PyInterpreterState_Head` and
- :cfunc:`PyInterpreterState_Next` let a caller walk through all the existing
- interpreter objects; :cfunc:`PyInterpreterState_ThreadHead` and
- :cfunc:`PyThreadState_Next` allow looping over all the thread states for a given
+ debuggers and development tools, was added. :c:func:`PyInterpreterState_Head` and
+ :c:func:`PyInterpreterState_Next` let a caller walk through all the existing
+ interpreter objects; :c:func:`PyInterpreterState_ThreadHead` and
+ :c:func:`PyThreadState_Next` allow looping over all the thread states for a given
interpreter. (Contributed by David Beazley.)
* The C-level interface to the garbage collector has been changed to make it
@@ -1078,19 +1078,19 @@ code, none of the changes described here will affect you very much.
To upgrade an extension module to the new API, perform the following steps:
-* Rename :cfunc:`Py_TPFLAGS_GC` to :cfunc:`PyTPFLAGS_HAVE_GC`.
+* Rename :c:func:`Py_TPFLAGS_GC` to :c:func:`PyTPFLAGS_HAVE_GC`.
-* Use :cfunc:`PyObject_GC_New` or :cfunc:`PyObject_GC_NewVar` to allocate
- objects, and :cfunc:`PyObject_GC_Del` to deallocate them.
+* Use :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar` to allocate
+ objects, and :c:func:`PyObject_GC_Del` to deallocate them.
-* Rename :cfunc:`PyObject_GC_Init` to :cfunc:`PyObject_GC_Track` and
- :cfunc:`PyObject_GC_Fini` to :cfunc:`PyObject_GC_UnTrack`.
+* Rename :c:func:`PyObject_GC_Init` to :c:func:`PyObject_GC_Track` and
+ :c:func:`PyObject_GC_Fini` to :c:func:`PyObject_GC_UnTrack`.
-* Remove :cfunc:`PyGC_HEAD_SIZE` from object size calculations.
+* Remove :c:func:`PyGC_HEAD_SIZE` from object size calculations.
-* Remove calls to :cfunc:`PyObject_AS_GC` and :cfunc:`PyObject_FROM_GC`.
+* Remove calls to :c:func:`PyObject_AS_GC` and :c:func:`PyObject_FROM_GC`.
-* A new ``et`` format sequence was added to :cfunc:`PyArg_ParseTuple`; ``et``
+* A new ``et`` format sequence was added to :c:func:`PyArg_ParseTuple`; ``et``
takes both a parameter and an encoding name, and converts the parameter to the
given encoding if the parameter turns out to be a Unicode string, or leaves it
alone if it's an 8-bit string, assuming it to already be in the desired
@@ -1099,10 +1099,10 @@ code, none of the changes described here will affect you very much.
specified new encoding. (Contributed by M.-A. Lemburg, and used for the MBCS
support on Windows described in the following section.)
-* A different argument parsing function, :cfunc:`PyArg_UnpackTuple`, has been
+* A different argument parsing function, :c:func:`PyArg_UnpackTuple`, has been
added that's simpler and presumably faster. Instead of specifying a format
string, the caller simply gives the minimum and maximum number of arguments
- expected, and a set of pointers to :ctype:`PyObject\*` variables that will be
+ expected, and a set of pointers to :c:type:`PyObject\*` variables that will be
filled in with argument values.
* Two new flags :const:`METH_NOARGS` and :const:`METH_O` are available in method
@@ -1111,14 +1111,14 @@ code, none of the changes described here will affect you very much.
corresponding method that uses :const:`METH_VARARGS`. Also, the old
:const:`METH_OLDARGS` style of writing C methods is now officially deprecated.
-* Two new wrapper functions, :cfunc:`PyOS_snprintf` and :cfunc:`PyOS_vsnprintf`
+* Two new wrapper functions, :c:func:`PyOS_snprintf` and :c:func:`PyOS_vsnprintf`
were added to provide cross-platform implementations for the relatively new
- :cfunc:`snprintf` and :cfunc:`vsnprintf` C lib APIs. In contrast to the standard
- :cfunc:`sprintf` and :cfunc:`vsprintf` functions, the Python versions check the
+ :c:func:`snprintf` and :c:func:`vsnprintf` C lib APIs. In contrast to the standard
+ :c:func:`sprintf` and :c:func:`vsprintf` functions, the Python versions check the
bounds of the buffer used to protect against buffer overruns. (Contributed by
M.-A. Lemburg.)
-* The :cfunc:`_PyTuple_Resize` function has lost an unused parameter, so now it
+* The :c:func:`_PyTuple_Resize` function has lost an unused parameter, so now it
takes 2 parameters instead of 3. The third argument was never used, and can
simply be discarded when porting code from earlier versions to Python 2.2.
@@ -1219,7 +1219,7 @@ Some of the more notable changes are:
operator, but these features were rarely used and therefore buggy. The
:meth:`tolist` method and the :attr:`start`, :attr:`stop`, and :attr:`step`
attributes are also being deprecated. At the C level, the fourth argument to
- the :cfunc:`PyRange_New` function, ``repeat``, has also been deprecated.
+ the :c:func:`PyRange_New` function, ``repeat``, has also been deprecated.
* There were a bunch of patches to the dictionary implementation, mostly to fix
potential core dumps if a dictionary contains objects that sneakily changed
@@ -1242,8 +1242,8 @@ Some of the more notable changes are:
up to display the output. This patch makes it possible to import such scripts,
in case they're also usable as modules. (Implemented by David Bolen.)
-* On platforms where Python uses the C :cfunc:`dlopen` function to load
- extension modules, it's now possible to set the flags used by :cfunc:`dlopen`
+* On platforms where Python uses the C :c:func:`dlopen` function to load
+ extension modules, it's now possible to set the flags used by :c:func:`dlopen`
using the :func:`sys.getdlopenflags` and :func:`sys.setdlopenflags` functions.
(Contributed by Bram Stolk.)
diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst
index 3894f8744a..0cc29f608b 100644
--- a/Doc/whatsnew/2.3.rst
+++ b/Doc/whatsnew/2.3.rst
@@ -1797,8 +1797,8 @@ Pymalloc: A Specialized Object Allocator
Pymalloc, a specialized object allocator written by Vladimir Marangozov, was a
feature added to Python 2.1. Pymalloc is intended to be faster than the system
-:cfunc:`malloc` and to have less memory overhead for allocation patterns typical
-of Python programs. The allocator uses C's :cfunc:`malloc` function to get large
+:c:func:`malloc` and to have less memory overhead for allocation patterns typical
+of Python programs. The allocator uses C's :c:func:`malloc` function to get large
pools of memory and then fulfills smaller memory requests from these pools.
In 2.1 and 2.2, pymalloc was an experimental feature and wasn't enabled by
@@ -1814,13 +1814,13 @@ runtime.
There's one particularly common error that causes problems. There are a number
of memory allocation functions in Python's C API that have previously just been
-aliases for the C library's :cfunc:`malloc` and :cfunc:`free`, meaning that if
+aliases for the C library's :c:func:`malloc` and :c:func:`free`, meaning that if
you accidentally called mismatched functions the error wouldn't be noticeable.
When the object allocator is enabled, these functions aren't aliases of
-:cfunc:`malloc` and :cfunc:`free` any more, and calling the wrong function to
+:c:func:`malloc` and :c:func:`free` any more, and calling the wrong function to
free memory may get you a core dump. For example, if memory was allocated using
-:cfunc:`PyObject_Malloc`, it has to be freed using :cfunc:`PyObject_Free`, not
-:cfunc:`free`. A few modules included with Python fell afoul of this and had to
+:c:func:`PyObject_Malloc`, it has to be freed using :c:func:`PyObject_Free`, not
+:c:func:`free`. A few modules included with Python fell afoul of this and had to
be fixed; doubtless there are more third-party modules that will have the same
problem.
@@ -1831,14 +1831,14 @@ one family for allocating chunks of memory and another family of functions
specifically for allocating Python objects.
* To allocate and free an undistinguished chunk of memory use the "raw memory"
- family: :cfunc:`PyMem_Malloc`, :cfunc:`PyMem_Realloc`, and :cfunc:`PyMem_Free`.
+ family: :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc`, and :c:func:`PyMem_Free`.
* The "object memory" family is the interface to the pymalloc facility described
above and is biased towards a large number of "small" allocations:
- :cfunc:`PyObject_Malloc`, :cfunc:`PyObject_Realloc`, and :cfunc:`PyObject_Free`.
+ :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc`, and :c:func:`PyObject_Free`.
* To allocate and free Python objects, use the "object" family
- :cfunc:`PyObject_New`, :cfunc:`PyObject_NewVar`, and :cfunc:`PyObject_Del`.
+ :c:func:`PyObject_New`, :c:func:`PyObject_NewVar`, and :c:func:`PyObject_Del`.
Thanks to lots of work by Tim Peters, pymalloc in 2.3 also provides debugging
features to catch memory overwrites and doubled frees in both extension modules
@@ -1877,10 +1877,10 @@ Changes to Python's build process and to the C API include:
(:file:`libpython2.3.so`) by supplying :option:`--enable-shared` when running
Python's :program:`configure` script. (Contributed by Ondrej Palkovsky.)
-* The :cmacro:`DL_EXPORT` and :cmacro:`DL_IMPORT` macros are now deprecated.
+* The :c:macro:`DL_EXPORT` and :c:macro:`DL_IMPORT` macros are now deprecated.
Initialization functions for Python extension modules should now be declared
- using the new macro :cmacro:`PyMODINIT_FUNC`, while the Python core will
- generally use the :cmacro:`PyAPI_FUNC` and :cmacro:`PyAPI_DATA` macros.
+ using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python core will
+ generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` macros.
* The interpreter can be compiled without any docstrings for the built-in
functions and modules by supplying :option:`--without-doc-strings` to the
@@ -1888,19 +1888,19 @@ Changes to Python's build process and to the C API include:
but will also mean that you can't get help for Python's built-ins. (Contributed
by Gustavo Niemeyer.)
-* The :cfunc:`PyArg_NoArgs` macro is now deprecated, and code that uses it
+* The :c:func:`PyArg_NoArgs` macro is now deprecated, and code that uses it
should be changed. For Python 2.2 and later, the method definition table can
specify the :const:`METH_NOARGS` flag, signalling that there are no arguments,
and the argument checking can then be removed. If compatibility with pre-2.2
versions of Python is important, the code could use ``PyArg_ParseTuple(args,
"")`` instead, but this will be slower than using :const:`METH_NOARGS`.
-* :cfunc:`PyArg_ParseTuple` accepts new format characters for various sizes of
- unsigned integers: ``B`` for :ctype:`unsigned char`, ``H`` for :ctype:`unsigned
- short int`, ``I`` for :ctype:`unsigned int`, and ``K`` for :ctype:`unsigned
+* :c:func:`PyArg_ParseTuple` accepts new format characters for various sizes of
+ unsigned integers: ``B`` for :c:type:`unsigned char`, ``H`` for :c:type:`unsigned
+ short int`, ``I`` for :c:type:`unsigned int`, and ``K`` for :c:type:`unsigned
long long`.
-* A new function, :cfunc:`PyObject_DelItemString(mapping, char \*key)` was added
+* A new function, :c:func:`PyObject_DelItemString(mapping, char \*key)` was added
as shorthand for ``PyObject_DelItem(mapping, PyString_New(key))``.
* File objects now manage their internal string buffer differently, increasing
@@ -1910,7 +1910,7 @@ Changes to Python's build process and to the C API include:
* It's now possible to define class and static methods for a C extension type by
setting either the :const:`METH_CLASS` or :const:`METH_STATIC` flags in a
- method's :ctype:`PyMethodDef` structure.
+ method's :c:type:`PyMethodDef` structure.
* Python now includes a copy of the Expat XML parser's source code, removing any
dependence on a system version or local installation of Expat.
diff --git a/Doc/whatsnew/2.4.rst b/Doc/whatsnew/2.4.rst
index fadde50184..c52b5fb70d 100644
--- a/Doc/whatsnew/2.4.rst
+++ b/Doc/whatsnew/2.4.rst
@@ -469,7 +469,7 @@ PEP 327: Decimal Data Type
==========================
Python has always supported floating-point (FP) numbers, based on the underlying
-C :ctype:`double` type, as a data type. However, while most programming
+C :c:type:`double` type, as a data type. However, while most programming
languages provide a floating-point type, many people (even programmers) are
unaware that floating-point numbers don't represent certain decimal fractions
accurately. The new :class:`Decimal` type can represent these fractions
@@ -498,7 +498,7 @@ mantissa is multiplied by 4 (2 to the power of the exponent 2); 1.25 \* 4 equals
5.
Modern systems usually provide floating-point support that conforms to a
-standard called IEEE 754. C's :ctype:`double` type is usually implemented as a
+standard called IEEE 754. C's :c:type:`double` type is usually implemented as a
64-bit IEEE 754 number, which uses 52 bits of space for the mantissa. This
means that numbers can only be specified to 52 bits of precision. If you're
trying to represent numbers whose expansion repeats endlessly, the expansion is
@@ -736,7 +736,7 @@ display conventions that are localized to a particular country or language.
However, the module was careful to not change the numeric locale because various
functions in Python's implementation required that the numeric locale remain set
to the ``'C'`` locale. Often this was because the code was using the C
-library's :cfunc:`atof` function.
+library's :c:func:`atof` function.
Not setting the numeric locale caused trouble for extensions that used third-
party C libraries, however, because they wouldn't have the correct locale set.
@@ -746,11 +746,11 @@ numbers in the current locale.
The solution described in the PEP is to add three new functions to the Python
API that perform ASCII-only conversions, ignoring the locale setting:
-* :cfunc:`PyOS_ascii_strtod(str, ptr)` and :cfunc:`PyOS_ascii_atof(str, ptr)`
- both convert a string to a C :ctype:`double`.
+* :c:func:`PyOS_ascii_strtod(str, ptr)` and :c:func:`PyOS_ascii_atof(str, ptr)`
+ both convert a string to a C :c:type:`double`.
-* :cfunc:`PyOS_ascii_formatd(buffer, buf_len, format, d)` converts a
- :ctype:`double` to an ASCII string.
+* :c:func:`PyOS_ascii_formatd(buffer, buf_len, format, d)` converts a
+ :c:type:`double` to an ASCII string.
The code for these functions came from the GLib library
(http://library.gnome.org/devel/glib/stable/), whose developers kindly
@@ -896,7 +896,7 @@ Here are all of the changes that Python 2.4 makes to the core Python language.
(Contributed by Nick Coghlan.)
* The :func:`eval(expr, globals, locals)` and :func:`execfile(filename, globals,
- locals)` functions and the :keyword:`exec` statement now accept any mapping type
+ locals)` functions and the ``exec`` statement now accept any mapping type
for the *locals* parameter. Previously this had to be a regular Python
dictionary. (Contributed by Raymond Hettinger.)
@@ -938,7 +938,7 @@ Optimizations
* The machinery for growing and shrinking lists was optimized for speed and for
space efficiency. Appending and popping from lists now runs faster due to more
efficient code paths and less frequent use of the underlying system
- :cfunc:`realloc`. List comprehensions also benefit. :meth:`list.extend` was
+ :c:func:`realloc`. List comprehensions also benefit. :meth:`list.extend` was
also optimized and no longer converts its argument into a temporary list before
extending the base list. (Contributed by Raymond Hettinger.)
@@ -1445,34 +1445,34 @@ Build and C API Changes
Some of the changes to Python's build process and to the C API are:
* Three new convenience macros were added for common return values from
- extension functions: :cmacro:`Py_RETURN_NONE`, :cmacro:`Py_RETURN_TRUE`, and
- :cmacro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)
+ extension functions: :c:macro:`Py_RETURN_NONE`, :c:macro:`Py_RETURN_TRUE`, and
+ :c:macro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)
-* Another new macro, :cmacro:`Py_CLEAR(obj)`, decreases the reference count of
+* Another new macro, :c:macro:`Py_CLEAR(obj)`, decreases the reference count of
*obj* and sets *obj* to the null pointer. (Contributed by Jim Fulton.)
-* A new function, :cfunc:`PyTuple_Pack(N, obj1, obj2, ..., objN)`, constructs
+* A new function, :c:func:`PyTuple_Pack(N, obj1, obj2, ..., objN)`, constructs
tuples from a variable length argument list of Python objects. (Contributed by
Raymond Hettinger.)
-* A new function, :cfunc:`PyDict_Contains(d, k)`, implements fast dictionary
+* A new function, :c:func:`PyDict_Contains(d, k)`, implements fast dictionary
lookups without masking exceptions raised during the look-up process.
(Contributed by Raymond Hettinger.)
-* The :cmacro:`Py_IS_NAN(X)` macro returns 1 if its float or double argument
+* The :c:macro:`Py_IS_NAN(X)` macro returns 1 if its float or double argument
*X* is a NaN. (Contributed by Tim Peters.)
* C code can avoid unnecessary locking by using the new
- :cfunc:`PyEval_ThreadsInitialized` function to tell if any thread operations
+ :c:func:`PyEval_ThreadsInitialized` function to tell if any thread operations
have been performed. If this function returns false, no lock operations are
needed. (Contributed by Nick Coghlan.)
-* A new function, :cfunc:`PyArg_VaParseTupleAndKeywords`, is the same as
- :cfunc:`PyArg_ParseTupleAndKeywords` but takes a :ctype:`va_list` instead of a
+* A new function, :c:func:`PyArg_VaParseTupleAndKeywords`, is the same as
+ :c:func:`PyArg_ParseTupleAndKeywords` but takes a :c:type:`va_list` instead of a
number of arguments. (Contributed by Greg Chapman.)
* A new method flag, :const:`METH_COEXISTS`, allows a function defined in slots
- to co-exist with a :ctype:`PyCFunction` having the same name. This can halve
+ to co-exist with a :c:type:`PyCFunction` having the same name. This can halve
the access time for a method such as :meth:`set.__contains__`. (Contributed by
Raymond Hettinger.)
@@ -1486,8 +1486,8 @@ Some of the changes to Python's build process and to the C API are:
though that processor architecture doesn't call that register "the TSC
register". (Contributed by Jeremy Hylton.)
-* The :ctype:`tracebackobject` type has been renamed to
- :ctype:`PyTracebackObject`.
+* The :c:type:`tracebackobject` type has been renamed to
+ :c:type:`PyTracebackObject`.
.. ======================================================================
diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst
index c7f7d586ab..79d8ad22ec 100644
--- a/Doc/whatsnew/2.5.rst
+++ b/Doc/whatsnew/2.5.rst
@@ -870,31 +870,31 @@ to be able to remove the string-exception feature in a few releases.
PEP 353: Using ssize_t as the index type
========================================
-A wide-ranging change to Python's C API, using a new :ctype:`Py_ssize_t` type
-definition instead of :ctype:`int`, will permit the interpreter to handle more
+A wide-ranging change to Python's C API, using a new :c:type:`Py_ssize_t` type
+definition instead of :c:type:`int`, will permit the interpreter to handle more
data on 64-bit platforms. This change doesn't affect Python's capacity on 32-bit
platforms.
-Various pieces of the Python interpreter used C's :ctype:`int` type to store
+Various pieces of the Python interpreter used C's :c:type:`int` type to store
sizes or counts; for example, the number of items in a list or tuple were stored
-in an :ctype:`int`. The C compilers for most 64-bit platforms still define
-:ctype:`int` as a 32-bit type, so that meant that lists could only hold up to
+in an :c:type:`int`. The C compilers for most 64-bit platforms still define
+:c:type:`int` as a 32-bit type, so that meant that lists could only hold up to
``2**31 - 1`` = 2147483647 items. (There are actually a few different
programming models that 64-bit C compilers can use -- see
http://www.unix.org/version2/whatsnew/lp64_wp.html for a discussion -- but the
-most commonly available model leaves :ctype:`int` as 32 bits.)
+most commonly available model leaves :c:type:`int` as 32 bits.)
A limit of 2147483647 items doesn't really matter on a 32-bit platform because
you'll run out of memory before hitting the length limit. Each list item
requires space for a pointer, which is 4 bytes, plus space for a
-:ctype:`PyObject` representing the item. 2147483647\*4 is already more bytes
+:c:type:`PyObject` representing the item. 2147483647\*4 is already more bytes
than a 32-bit address space can contain.
It's possible to address that much memory on a 64-bit platform, however. The
pointers for a list that size would only require 16 GiB of space, so it's not
unreasonable that Python programmers might construct lists that large.
Therefore, the Python interpreter had to be changed to use some type other than
-:ctype:`int`, and this will be a 64-bit type on 64-bit platforms. The change
+:c:type:`int`, and this will be a 64-bit type on 64-bit platforms. The change
will cause incompatibilities on 64-bit machines, so it was deemed worth making
the transition now, while the number of 64-bit users is still relatively small.
(In 5 or 10 years, we may *all* be on 64-bit machines, and the transition would
@@ -902,15 +902,15 @@ be more painful then.)
This change most strongly affects authors of C extension modules. Python
strings and container types such as lists and tuples now use
-:ctype:`Py_ssize_t` to store their size. Functions such as
-:cfunc:`PyList_Size` now return :ctype:`Py_ssize_t`. Code in extension modules
-may therefore need to have some variables changed to :ctype:`Py_ssize_t`.
+:c:type:`Py_ssize_t` to store their size. Functions such as
+:c:func:`PyList_Size` now return :c:type:`Py_ssize_t`. Code in extension modules
+may therefore need to have some variables changed to :c:type:`Py_ssize_t`.
-The :cfunc:`PyArg_ParseTuple` and :cfunc:`Py_BuildValue` functions have a new
-conversion code, ``n``, for :ctype:`Py_ssize_t`. :cfunc:`PyArg_ParseTuple`'s
-``s#`` and ``t#`` still output :ctype:`int` by default, but you can define the
-macro :cmacro:`PY_SSIZE_T_CLEAN` before including :file:`Python.h` to make
-them return :ctype:`Py_ssize_t`.
+The :c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` functions have a new
+conversion code, ``n``, for :c:type:`Py_ssize_t`. :c:func:`PyArg_ParseTuple`'s
+``s#`` and ``t#`` still output :c:type:`int` by default, but you can define the
+macro :c:macro:`PY_SSIZE_T_CLEAN` before including :file:`Python.h` to make
+them return :c:type:`Py_ssize_t`.
:pep:`353` has a section on conversion guidelines that extension authors should
read to learn about supporting 64-bit platforms.
@@ -954,8 +954,8 @@ interpreter will check that the type returned is correct, and raises a
:exc:`TypeError` if this requirement isn't met.
A corresponding :attr:`nb_index` slot was added to the C-level
-:ctype:`PyNumberMethods` structure to let C extensions implement this protocol.
-:cfunc:`PyNumber_Index(obj)` can be used in extension code to call the
+:c:type:`PyNumberMethods` structure to let C extensions implement this protocol.
+:c:func:`PyNumber_Index(obj)` can be used in extension code to call the
:meth:`__index__` function and retrieve its result.
@@ -1179,7 +1179,7 @@ marked in the following list.
(Contributed by Bob Ippolito at the NeedForSpeed sprint.)
* The :mod:`re` module got a 1 or 2% speedup by switching to Python's allocator
- functions instead of the system's :cfunc:`malloc` and :cfunc:`free`.
+ functions instead of the system's :c:func:`malloc` and :c:func:`free`.
(Contributed by Jack Diederich at the NeedForSpeed sprint.)
* The code generator's peephole optimizer now performs simple constant folding
@@ -1203,7 +1203,7 @@ marked in the following list.
Sean Reifschneider at the NeedForSpeed sprint.)
* Importing now caches the paths tried, recording whether they exist or not so
- that the interpreter makes fewer :cfunc:`open` and :cfunc:`stat` calls on
+ that the interpreter makes fewer :c:func:`open` and :c:func:`stat` calls on
startup. (Contributed by Martin von Löwis and Georg Brandl.)
.. Patch 921466
@@ -1568,7 +1568,7 @@ complete list of changes, or look through the SVN logs for all the details.
reporting ``('CPython', 'trunk', '45313:45315')``.
This information is also available to C extensions via the
- :cfunc:`Py_GetBuildInfo` function that returns a string of build information
+ :c:func:`Py_GetBuildInfo` function that returns a string of build information
like this: ``"trunk:45355:45356M, Apr 13 2006, 07:42:19"``. (Contributed by
Barry Warsaw.)
@@ -1690,7 +1690,7 @@ attributes of the :class:`CDLL` object. ::
result = libc.printf("Line of output\n")
Type constructors for the various C types are provided: :func:`c_int`,
-:func:`c_float`, :func:`c_double`, :func:`c_char_p` (equivalent to :ctype:`char
+:func:`c_float`, :func:`c_double`, :func:`c_char_p` (equivalent to :c:type:`char
\*`), and so forth. Unlike Python's types, the C versions are all mutable; you
can assign to their :attr:`value` attribute to change the wrapped value. Python
integers and strings will be automatically converted to the corresponding C
@@ -1720,7 +1720,7 @@ attribute of the function object to change this::
``ctypes.pythonapi`` object. This object does *not* release the global
interpreter lock before calling a function, because the lock must be held when
calling into the interpreter's code. There's a :class:`py_object()` type
-constructor that will create a :ctype:`PyObject \*` pointer. A simple usage::
+constructor that will create a :c:type:`PyObject \*` pointer. A simple usage::
import ctypes
@@ -2087,8 +2087,8 @@ Changes to Python's build process and to the C API include:
http://scan.coverity.com for the statistics.
* The largest change to the C API came from :pep:`353`, which modifies the
- interpreter to use a :ctype:`Py_ssize_t` type definition instead of
- :ctype:`int`. See the earlier section :ref:`pep-353` for a discussion of this
+ interpreter to use a :c:type:`Py_ssize_t` type definition instead of
+ :c:type:`int`. See the earlier section :ref:`pep-353` for a discussion of this
change.
* The design of the bytecode compiler has changed a great deal, no longer
@@ -2113,10 +2113,10 @@ Changes to Python's build process and to the C API include:
discusses the design. To start learning about the code, read the definition of
the various AST nodes in :file:`Parser/Python.asdl`. A Python script reads this
file and generates a set of C structure definitions in
- :file:`Include/Python-ast.h`. The :cfunc:`PyParser_ASTFromString` and
- :cfunc:`PyParser_ASTFromFile`, defined in :file:`Include/pythonrun.h`, take
+ :file:`Include/Python-ast.h`. The :c:func:`PyParser_ASTFromString` and
+ :c:func:`PyParser_ASTFromFile`, defined in :file:`Include/pythonrun.h`, take
Python source as input and return the root of an AST representing the contents.
- This AST can then be turned into a code object by :cfunc:`PyAST_Compile`. For
+ This AST can then be turned into a code object by :c:func:`PyAST_Compile`. For
more information, read the source code, and then ask questions on python-dev.
The AST code was developed under Jeremy Hylton's management, and implemented by
@@ -2138,55 +2138,55 @@ Changes to Python's build process and to the C API include:
Note that this change means extension modules must be more careful when
allocating memory. Python's API has many different functions for allocating
- memory that are grouped into families. For example, :cfunc:`PyMem_Malloc`,
- :cfunc:`PyMem_Realloc`, and :cfunc:`PyMem_Free` are one family that allocates
- raw memory, while :cfunc:`PyObject_Malloc`, :cfunc:`PyObject_Realloc`, and
- :cfunc:`PyObject_Free` are another family that's supposed to be used for
+ memory that are grouped into families. For example, :c:func:`PyMem_Malloc`,
+ :c:func:`PyMem_Realloc`, and :c:func:`PyMem_Free` are one family that allocates
+ raw memory, while :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc`, and
+ :c:func:`PyObject_Free` are another family that's supposed to be used for
creating Python objects.
Previously these different families all reduced to the platform's
- :cfunc:`malloc` and :cfunc:`free` functions. This meant it didn't matter if
- you got things wrong and allocated memory with the :cfunc:`PyMem` function but
- freed it with the :cfunc:`PyObject` function. With 2.5's changes to obmalloc,
+ :c:func:`malloc` and :c:func:`free` functions. This meant it didn't matter if
+ you got things wrong and allocated memory with the :c:func:`PyMem` function but
+ freed it with the :c:func:`PyObject` function. With 2.5's changes to obmalloc,
these families now do different things and mismatches will probably result in a
segfault. You should carefully test your C extension modules with Python 2.5.
-* The built-in set types now have an official C API. Call :cfunc:`PySet_New`
- and :cfunc:`PyFrozenSet_New` to create a new set, :cfunc:`PySet_Add` and
- :cfunc:`PySet_Discard` to add and remove elements, and :cfunc:`PySet_Contains`
- and :cfunc:`PySet_Size` to examine the set's state. (Contributed by Raymond
+* The built-in set types now have an official C API. Call :c:func:`PySet_New`
+ and :c:func:`PyFrozenSet_New` to create a new set, :c:func:`PySet_Add` and
+ :c:func:`PySet_Discard` to add and remove elements, and :c:func:`PySet_Contains`
+ and :c:func:`PySet_Size` to examine the set's state. (Contributed by Raymond
Hettinger.)
* C code can now obtain information about the exact revision of the Python
- interpreter by calling the :cfunc:`Py_GetBuildInfo` function that returns a
+ interpreter by calling the :c:func:`Py_GetBuildInfo` function that returns a
string of build information like this: ``"trunk:45355:45356M, Apr 13 2006,
07:42:19"``. (Contributed by Barry Warsaw.)
* Two new macros can be used to indicate C functions that are local to the
current file so that a faster calling convention can be used.
- :cfunc:`Py_LOCAL(type)` declares the function as returning a value of the
+ :c:func:`Py_LOCAL(type)` declares the function as returning a value of the
specified *type* and uses a fast-calling qualifier.
- :cfunc:`Py_LOCAL_INLINE(type)` does the same thing and also requests the
- function be inlined. If :cfunc:`PY_LOCAL_AGGRESSIVE` is defined before
+ :c:func:`Py_LOCAL_INLINE(type)` does the same thing and also requests the
+ function be inlined. If :c:func:`PY_LOCAL_AGGRESSIVE` is defined before
:file:`python.h` is included, a set of more aggressive optimizations are enabled
for the module; you should benchmark the results to find out if these
optimizations actually make the code faster. (Contributed by Fredrik Lundh at
the NeedForSpeed sprint.)
-* :cfunc:`PyErr_NewException(name, base, dict)` can now accept a tuple of base
+* :c:func:`PyErr_NewException(name, base, dict)` can now accept a tuple of base
classes as its *base* argument. (Contributed by Georg Brandl.)
-* The :cfunc:`PyErr_Warn` function for issuing warnings is now deprecated in
- favour of :cfunc:`PyErr_WarnEx(category, message, stacklevel)` which lets you
+* The :c:func:`PyErr_Warn` function for issuing warnings is now deprecated in
+ favour of :c:func:`PyErr_WarnEx(category, message, stacklevel)` which lets you
specify the number of stack frames separating this function and the caller. A
- *stacklevel* of 1 is the function calling :cfunc:`PyErr_WarnEx`, 2 is the
+ *stacklevel* of 1 is the function calling :c:func:`PyErr_WarnEx`, 2 is the
function above that, and so forth. (Added by Neal Norwitz.)
* The CPython interpreter is still written in C, but the code can now be
compiled with a C++ compiler without errors. (Implemented by Anthony Baxter,
Martin von Löwis, Skip Montanaro.)
-* The :cfunc:`PyRange_New` function was removed. It was never documented, never
+* The :c:func:`PyRange_New` function was removed. It was never documented, never
used in the core code, and had dangerously lax error checking. In the unlikely
case that your extensions were using it, you can replace it by something like
the following::
@@ -2203,7 +2203,7 @@ Port-Specific Changes
---------------------
* MacOS X (10.3 and higher): dynamic loading of modules now uses the
- :cfunc:`dlopen` function instead of MacOS-specific functions.
+ :c:func:`dlopen` function instead of MacOS-specific functions.
* MacOS X: an :option:`--enable-universalsdk` switch was added to the
:program:`configure` script that compiles the interpreter as a universal binary
@@ -2259,15 +2259,15 @@ code:
Setting :attr:`rpc_paths` to ``None`` or an empty tuple disables this path
checking.
-* C API: Many functions now use :ctype:`Py_ssize_t` instead of :ctype:`int` to
+* C API: Many functions now use :c:type:`Py_ssize_t` instead of :c:type:`int` to
allow processing more data on 64-bit machines. Extension code may need to make
the same change to avoid warnings and to support 64-bit machines. See the
earlier section :ref:`pep-353` for a discussion of this change.
* C API: The obmalloc changes mean that you must be careful to not mix usage
- of the :cfunc:`PyMem_\*` and :cfunc:`PyObject_\*` families of functions. Memory
- allocated with one family's :cfunc:`\*_Malloc` must be freed with the
- corresponding family's :cfunc:`\*_Free` function.
+ of the :c:func:`PyMem_\*` and :c:func:`PyObject_\*` families of functions. Memory
+ allocated with one family's :c:func:`\*_Malloc` must be freed with the
+ corresponding family's :c:func:`\*_Free` function.
.. ======================================================================
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
index 1af78c2276..be2c6ff7af 100644
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -123,7 +123,7 @@ about features that will be removed in Python 3.0. You can run code
with this switch to see how much work will be necessary to port
code to 3.0. The value of this switch is available
to Python code as the boolean variable :data:`sys.py3kwarning`,
-and to C extension code as :cdata:`Py_Py3kWarningFlag`.
+and to C extension code as :c:data:`Py_Py3kWarningFlag`.
.. seealso::
@@ -979,10 +979,10 @@ can be used to include Unicode characters::
print len(s) # 12 Unicode characters
At the C level, Python 3.0 will rename the existing 8-bit
-string type, called :ctype:`PyStringObject` in Python 2.x,
-to :ctype:`PyBytesObject`. Python 2.6 uses ``#define``
-to support using the names :cfunc:`PyBytesObject`,
-:cfunc:`PyBytes_Check`, :cfunc:`PyBytes_FromStringAndSize`,
+string type, called :c:type:`PyStringObject` in Python 2.x,
+to :c:type:`PyBytesObject`. Python 2.6 uses ``#define``
+to support using the names :c:func:`PyBytesObject`,
+:c:func:`PyBytes_Check`, :c:func:`PyBytes_FromStringAndSize`,
and all the other functions and macros used with strings.
Instances of the :class:`bytes` type are immutable just
@@ -1014,8 +1014,8 @@ and some of the methods of lists, such as :meth:`append`,
bytearray(b'ABCde')
There's also a corresponding C API, with
-:cfunc:`PyByteArray_FromObject`,
-:cfunc:`PyByteArray_FromStringAndSize`,
+:c:func:`PyByteArray_FromObject`,
+:c:func:`PyByteArray_FromStringAndSize`,
and various other functions.
.. seealso::
@@ -1134,7 +1134,7 @@ indicate that the external caller is done.
.. XXX PyObject_GetBuffer not documented in c-api
-The *flags* argument to :cfunc:`PyObject_GetBuffer` specifies
+The *flags* argument to :c:func:`PyObject_GetBuffer` specifies
constraints upon the memory returned. Some examples are:
* :const:`PyBUF_WRITABLE` indicates that the memory must be writable.
@@ -1145,7 +1145,7 @@ constraints upon the memory returned. Some examples are:
requests a C-contiguous (last dimension varies the fastest) or
Fortran-contiguous (first dimension varies the fastest) array layout.
-Two new argument codes for :cfunc:`PyArg_ParseTuple`,
+Two new argument codes for :c:func:`PyArg_ParseTuple`,
``s*`` and ``z*``, return locked buffer objects for a parameter.
.. seealso::
@@ -1485,6 +1485,13 @@ Other Language Changes
Some smaller changes made to the core Python language are:
+* Directories and zip archives containing a :file:`__main__.py` file
+ can now be executed directly by passing their name to the
+ interpreter. The directory or zip archive is automatically inserted
+ as the first entry in sys.path. (Suggestion and initial patch by
+ Andy Chu, subsequently revised by Phillip J. Eby and Nick Coghlan;
+ :issue:`1739468`.)
+
* The :func:`hasattr` function was catching and ignoring all errors,
under the assumption that they meant a :meth:`__getattr__` method
was failing somehow and the return value of :func:`hasattr` would
@@ -1632,7 +1639,7 @@ Some smaller changes made to the core Python language are:
:meth:`__hash__` method inherited from a parent class, so
assigning ``None`` was implemented as an override. At the
C level, extensions can set ``tp_hash`` to
- :cfunc:`PyObject_HashNotImplemented`.
+ :c:func:`PyObject_HashNotImplemented`.
(Fixed by Nick Coghlan and Amaury Forgeot d'Arc; :issue:`2235`.)
* The :exc:`GeneratorExit` exception now subclasses
@@ -1702,7 +1709,7 @@ Optimizations
By default, this change is only applied to types that are included with
the Python core. Extension modules may not necessarily be compatible with
this cache,
- so they must explicitly add :cmacro:`Py_TPFLAGS_HAVE_VERSION_TAG`
+ so they must explicitly add :c:macro:`Py_TPFLAGS_HAVE_VERSION_TAG`
to the module's ``tp_flags`` field to enable the method cache.
(To be compatible with the method cache, the extension module's code
must not directly access and modify the ``tp_dict`` member of
@@ -1785,7 +1792,7 @@ changes, or look through the Subversion logs for all the details.
were applied. (Maintained by Josiah Carlson; see :issue:`1736190` for
one patch.)
-* The :mod:`bsddb` module also has a new maintainer, Jesús Cea, and the package
+* The :mod:`bsddb` module also has a new maintainer, Jesús Cea Avion, and the package
is now available as a standalone package. The web page for the package is
`www.jcea.es/programacion/pybsddb.htm
<http://www.jcea.es/programacion/pybsddb.htm>`__.
@@ -2281,7 +2288,7 @@ changes, or look through the Subversion logs for all the details.
(Contributed by Raymond Hettinger; :issue:`1861`.)
* The :mod:`select` module now has wrapper functions
- for the Linux :cfunc:`epoll` and BSD :cfunc:`kqueue` system calls.
+ for the Linux :c:func:`epoll` and BSD :c:func:`kqueue` system calls.
:meth:`modify` method was added to the existing :class:`poll`
objects; ``pollobj.modify(fd, eventmask)`` takes a file descriptor
or file object and an event mask, modifying the recorded event mask
@@ -2314,13 +2321,13 @@ changes, or look through the Subversion logs for all the details.
Calling ``signal.set_wakeup_fd(fd)`` sets a file descriptor
to be used; when a signal is received, a byte is written to that
file descriptor. There's also a C-level function,
- :cfunc:`PySignal_SetWakeupFd`, for setting the descriptor.
+ :c:func:`PySignal_SetWakeupFd`, for setting the descriptor.
Event loops will use this by opening a pipe to create two descriptors,
one for reading and one for writing. The writable descriptor
will be passed to :func:`set_wakeup_fd`, and the readable descriptor
will be added to the list of descriptors monitored by the event loop via
- :cfunc:`select` or :cfunc:`poll`.
+ :c:func:`select` or :c:func:`poll`.
On receiving a signal, a byte will be written and the main event loop
will be woken up, avoiding the need to poll.
@@ -2381,7 +2388,7 @@ changes, or look through the Subversion logs for all the details.
has been updated from version 2.3.2 in Python 2.5 to
version 2.4.1.
-* The :mod:`struct` module now supports the C99 :ctype:`_Bool` type,
+* The :mod:`struct` module now supports the C99 :c:type:`_Bool` type,
using the format character ``'?'``.
(Contributed by David Remahl.)
@@ -2389,7 +2396,7 @@ changes, or look through the Subversion logs for all the details.
now have :meth:`terminate`, :meth:`kill`, and :meth:`send_signal` methods.
On Windows, :meth:`send_signal` only supports the :const:`SIGTERM`
signal, and all these methods are aliases for the Win32 API function
- :cfunc:`TerminateProcess`.
+ :c:func:`TerminateProcess`.
(Contributed by Christian Heimes.)
* A new variable in the :mod:`sys` module, :attr:`float_info`, is an
@@ -2974,7 +2981,7 @@ Changes to Python's build process and to the C API include:
* Python now must be compiled with C89 compilers (after 19
years!). This means that the Python source tree has dropped its
- own implementations of :cfunc:`memmove` and :cfunc:`strerror`, which
+ own implementations of :c:func:`memmove` and :c:func:`strerror`, which
are in the C89 standard library.
* Python 2.6 can be built with Microsoft Visual Studio 2008 (version
@@ -2996,7 +3003,7 @@ Changes to Python's build process and to the C API include:
* The new buffer interface, previously described in
`the PEP 3118 section <#pep-3118-revised-buffer-protocol>`__,
- adds :cfunc:`PyObject_GetBuffer` and :cfunc:`PyBuffer_Release`,
+ adds :c:func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release`,
as well as a few other functions.
* Python's use of the C stdio library is now thread-safe, or at least
@@ -3004,27 +3011,27 @@ Changes to Python's build process and to the C API include:
bug occurred if one thread closed a file object while another thread
was reading from or writing to the object. In 2.6 file objects
have a reference count, manipulated by the
- :cfunc:`PyFile_IncUseCount` and :cfunc:`PyFile_DecUseCount`
+ :c:func:`PyFile_IncUseCount` and :c:func:`PyFile_DecUseCount`
functions. File objects can't be closed unless the reference count
- is zero. :cfunc:`PyFile_IncUseCount` should be called while the GIL
+ is zero. :c:func:`PyFile_IncUseCount` should be called while the GIL
is still held, before carrying out an I/O operation using the
- ``FILE *`` pointer, and :cfunc:`PyFile_DecUseCount` should be called
+ ``FILE *`` pointer, and :c:func:`PyFile_DecUseCount` should be called
immediately after the GIL is re-acquired.
(Contributed by Antoine Pitrou and Gregory P. Smith.)
* Importing modules simultaneously in two different threads no longer
deadlocks; it will now raise an :exc:`ImportError`. A new API
- function, :cfunc:`PyImport_ImportModuleNoBlock`, will look for a
+ function, :c:func:`PyImport_ImportModuleNoBlock`, will look for a
module in ``sys.modules`` first, then try to import it after
acquiring an import lock. If the import lock is held by another
thread, an :exc:`ImportError` is raised.
(Contributed by Christian Heimes.)
* Several functions return information about the platform's
- floating-point support. :cfunc:`PyFloat_GetMax` returns
+ floating-point support. :c:func:`PyFloat_GetMax` returns
the maximum representable floating point value,
- and :cfunc:`PyFloat_GetMin` returns the minimum
- positive value. :cfunc:`PyFloat_GetInfo` returns an object
+ and :c:func:`PyFloat_GetMin` returns the minimum
+ positive value. :c:func:`PyFloat_GetInfo` returns an object
containing more information from the :file:`float.h` file, such as
``"mant_dig"`` (number of digits in the mantissa), ``"epsilon"``
(smallest difference between 1.0 and the next largest value
@@ -3032,7 +3039,7 @@ Changes to Python's build process and to the C API include:
(Contributed by Christian Heimes; :issue:`1534`.)
* C functions and methods that use
- :cfunc:`PyComplex_AsCComplex` will now accept arguments that
+ :c:func:`PyComplex_AsCComplex` will now accept arguments that
have a :meth:`__complex__` method. In particular, the functions in the
:mod:`cmath` module will now accept objects with this method.
This is a backport of a Python 3.0 change.
@@ -3046,15 +3053,15 @@ Changes to Python's build process and to the C API include:
* Many C extensions define their own little macro for adding
integers and strings to the module's dictionary in the
``init*`` function. Python 2.6 finally defines standard macros
- for adding values to a module, :cmacro:`PyModule_AddStringMacro`
- and :cmacro:`PyModule_AddIntMacro()`. (Contributed by
+ for adding values to a module, :c:macro:`PyModule_AddStringMacro`
+ and :c:macro:`PyModule_AddIntMacro()`. (Contributed by
Christian Heimes.)
* Some macros were renamed in both 3.0 and 2.6 to make it clearer that
they are macros,
- not functions. :cmacro:`Py_Size()` became :cmacro:`Py_SIZE()`,
- :cmacro:`Py_Type()` became :cmacro:`Py_TYPE()`, and
- :cmacro:`Py_Refcnt()` became :cmacro:`Py_REFCNT()`.
+ not functions. :c:macro:`Py_Size()` became :c:macro:`Py_SIZE()`,
+ :c:macro:`Py_Type()` became :c:macro:`Py_TYPE()`, and
+ :c:macro:`Py_Refcnt()` became :c:macro:`Py_REFCNT()`.
The mixed-case macros are still available
in Python 2.6 for backward compatibility.
(:issue:`1629`)
@@ -3112,7 +3119,7 @@ Port-Specific Changes: Windows
* The :mod:`socket` module's socket objects now have an
:meth:`ioctl` method that provides a limited interface to the
- :cfunc:`WSAIoctl` system interface.
+ :c:func:`WSAIoctl` system interface.
* The :mod:`_winreg` module now has a function,
:func:`ExpandEnvironmentStrings`,
@@ -3258,13 +3265,13 @@ that may require changes to your code:
the implementation now explicitly checks for this case and raises
an :exc:`ImportError`.
-* C API: the :cfunc:`PyImport_Import` and :cfunc:`PyImport_ImportModule`
+* C API: the :c:func:`PyImport_Import` and :c:func:`PyImport_ImportModule`
functions now default to absolute imports, not relative imports.
This will affect C extensions that import other modules.
* C API: extension data types that shouldn't be hashable
should define their ``tp_hash`` slot to
- :cfunc:`PyObject_HashNotImplemented`.
+ :c:func:`PyObject_HashNotImplemented`.
* The :mod:`socket` module exception :exc:`socket.error` now inherits
from :exc:`IOError`. Previously it wasn't a subclass of
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
new file mode 100644
index 0000000000..d715617045
--- /dev/null
+++ b/Doc/whatsnew/2.7.rst
@@ -0,0 +1,2481 @@
+****************************
+ What's New in Python 2.7
+****************************
+
+:Author: A.M. Kuchling (amk at amk.ca)
+:Release: |release|
+:Date: |today|
+
+.. hyperlink all the methods & functions.
+
+.. T_STRING_INPLACE not described in main docs
+.. "Format String Syntax" in string.rst could use many more examples.
+
+.. $Id$
+ Rules for maintenance:
+
+ * Anyone can add text to this document. Do not spend very much time
+ on the wording of your changes, because your text will probably
+ get rewritten to some degree.
+
+ * The maintainer will go through Misc/NEWS periodically and add
+ changes; it's therefore more important to add your changes to
+ Misc/NEWS than to this file.
+
+ * This is not a complete list of every single change; completeness
+ is the purpose of Misc/NEWS. Some changes I consider too small
+ or esoteric to include. If such a change is added to the text,
+ I'll just remove it. (This is another reason you shouldn't spend
+ too much time on writing your addition.)
+
+ * If you want to draw your new text to the attention of the
+ maintainer, add 'XXX' to the beginning of the paragraph or
+ section.
+
+ * It's OK to just add a fragmentary note about a change. For
+ example: "XXX Describe the transmogrify() function added to the
+ socket module." The maintainer will research the change and
+ write the necessary text.
+
+ * You can comment out your additions if you like, but it's not
+ necessary (especially when a final release is some months away).
+
+ * Credit the author of a patch or bugfix. Just the name is
+ sufficient; the e-mail address isn't necessary.
+
+ * It's helpful to add the bug/patch number in a parenthetical comment.
+
+ XXX Describe the transmogrify() function added to the socket
+ module.
+ (Contributed by P.Y. Developer; :issue:`12345`.)
+
+ This saves the maintainer some effort going through the SVN logs
+ when researching a change.
+
+This article explains the new features in Python 2.7. The final
+release of 2.7 is currently scheduled for July 2010; the detailed
+schedule is described in :pep:`373`.
+
+Numeric handling has been improved in many ways, for both
+floating-point numbers and for the :class:`Decimal` class. There are
+some useful additions to the standard library, such as a greatly
+enhanced :mod:`unittest` module, the :mod:`argparse` module for
+parsing command-line options, convenient ordered-dictionary and
+:class:`Counter` classes in the :mod:`collections` module, and many
+other improvements.
+
+Python 2.7 is planned to be the last of the 2.x releases, so we worked
+on making it a good release for the long term. To help with porting
+to Python 3, several new features from the Python 3.x series have been
+included in 2.7.
+
+This article doesn't attempt to provide a complete specification of
+the new features, but instead provides a convenient overview. For
+full details, you should refer to the documentation for Python 2.7 at
+http://docs.python.org. If you want to understand the rationale for
+the design and implementation, refer to the PEP for a particular new
+feature or the issue on http://bugs.python.org in which a change was
+discussed. Whenever possible, "What's New in Python" links to the
+bug/patch item for each change.
+
+.. _whatsnew27-python31:
+
+The Future for Python 2.x
+=========================
+
+Python 2.7 is intended to be the last major release in the 2.x series.
+The Python maintainers are planning to focus their future efforts on
+the Python 3.x series.
+
+This means that 2.7 will remain in place for a long time, running
+production systems that have not been ported to Python 3.x.
+Two consequences of the long-term significance of 2.7 are:
+
+* It's very likely the 2.7 release will have a longer period of
+ maintenance compared to earlier 2.x versions. Python 2.7 will
+ continue to be maintained while the transition to 3.x continues, and
+ the developers are planning to support Python 2.7 with bug-fix
+ releases beyond the typical two years.
+
+* A policy decision was made to silence warnings only of interest to
+ developers. :exc:`DeprecationWarning` and its
+ descendants are now ignored unless otherwise requested, preventing
+ users from seeing warnings triggered by an application. This change
+ was also made in the branch that will become Python 3.2. (Discussed
+ on stdlib-sig and carried out in :issue:`7319`.)
+
+ In previous releases, :exc:`DeprecationWarning` messages were
+ enabled by default, providing Python developers with a clear
+ indication of where their code may break in a future major version
+ of Python.
+
+ However, there are increasingly many users of Python-based
+ applications who are not directly involved in the development of
+ those applications. :exc:`DeprecationWarning` messages are
+ irrelevant to such users, making them worry about an application
+ that's actually working correctly and burdening application developers
+ with responding to these concerns.
+
+ You can re-enable display of :exc:`DeprecationWarning` messages by
+ running Python with the :option:`-Wdefault` (short form:
+ :option:`-Wd`) switch, or by setting the :envvar:`PYTHONWARNINGS`
+ environment variable to ``"default"`` (or ``"d"``) before running
+ Python. Python code can also re-enable them
+ by calling ``warnings.simplefilter('default')``.
+
+
+Python 3.1 Features
+=======================
+
+Much as Python 2.6 incorporated features from Python 3.0,
+version 2.7 incorporates some of the new features
+in Python 3.1. The 2.x series continues to provide tools
+for migrating to the 3.x series.
+
+A partial list of 3.1 features that were backported to 2.7:
+
+* The syntax for set literals (``{1,2,3}`` is a mutable set).
+* Dictionary and set comprehensions (``{ i: i*2 for i in range(3)}``).
+* Multiple context managers in a single :keyword:`with` statement.
+* A new version of the :mod:`io` library, rewritten in C for performance.
+* The ordered-dictionary type described in :ref:`pep-0372`.
+* The new ``","`` format specifier described in :ref:`pep-0378`.
+* The :class:`memoryview` object.
+* A small subset of the :mod:`importlib` module,
+ `described below <#importlib-section>`__.
+* The :func:`repr` of a float ``x`` is shorter in many cases: it's now
+ based on the shortest decimal string that's guaranteed to round back
+ to ``x``. As in previous versions of Python, it's guaranteed that
+ ``float(repr(x))`` recovers ``x``.
+* Float-to-string and string-to-float conversions are correctly rounded.
+ The :func:`round` function is also now correctly rounded.
+* The :c:type:`PyCapsule` type, used to provide a C API for extension modules.
+* The :c:func:`PyLong_AsLongAndOverflow` C API function.
+
+Other new Python3-mode warnings include:
+
+* :func:`operator.isCallable` and :func:`operator.sequenceIncludes`,
+ which are not supported in 3.x, now trigger warnings.
+* The :option:`-3` switch now automatically
+ enables the :option:`-Qwarn` switch that causes warnings
+ about using classic division with integers and long integers.
+
+
+
+.. ========================================================================
+.. Large, PEP-level features and changes should be described here.
+.. ========================================================================
+
+.. _pep-0372:
+
+PEP 372: Adding an Ordered Dictionary to collections
+====================================================
+
+Regular Python dictionaries iterate over key/value pairs in arbitrary order.
+Over the years, a number of authors have written alternative implementations
+that remember the order that the keys were originally inserted. Based on
+the experiences from those implementations, 2.7 introduces a new
+:class:`~collections.OrderedDict` class in the :mod:`collections` module.
+
+The :class:`~collections.OrderedDict` API provides the same interface as regular
+dictionaries but iterates over keys and values in a guaranteed order
+depending on when a key was first inserted::
+
+ >>> from collections import OrderedDict
+ >>> d = OrderedDict([('first', 1),
+ ... ('second', 2),
+ ... ('third', 3)])
+ >>> d.items()
+ [('first', 1), ('second', 2), ('third', 3)]
+
+If a new entry overwrites an existing entry, the original insertion
+position is left unchanged::
+
+ >>> d['second'] = 4
+ >>> d.items()
+ [('first', 1), ('second', 4), ('third', 3)]
+
+Deleting an entry and reinserting it will move it to the end::
+
+ >>> del d['second']
+ >>> d['second'] = 5
+ >>> d.items()
+ [('first', 1), ('third', 3), ('second', 5)]
+
+The :meth:`~collections.OrderedDict.popitem` method has an optional *last*
+argument that defaults to True. If *last* is True, the most recently
+added key is returned and removed; if it's False, the
+oldest key is selected::
+
+ >>> od = OrderedDict([(x,0) for x in range(20)])
+ >>> od.popitem()
+ (19, 0)
+ >>> od.popitem()
+ (18, 0)
+ >>> od.popitem(last=False)
+ (0, 0)
+ >>> od.popitem(last=False)
+ (1, 0)
+
+Comparing two ordered dictionaries checks both the keys and values,
+and requires that the insertion order was the same::
+
+ >>> od1 = OrderedDict([('first', 1),
+ ... ('second', 2),
+ ... ('third', 3)])
+ >>> od2 = OrderedDict([('third', 3),
+ ... ('first', 1),
+ ... ('second', 2)])
+ >>> od1 == od2
+ False
+ >>> # Move 'third' key to the end
+ >>> del od2['third']; od2['third'] = 3
+ >>> od1 == od2
+ True
+
+Comparing an :class:`~collections.OrderedDict` with a regular dictionary
+ignores the insertion order and just compares the keys and values.
+
+How does the :class:`~collections.OrderedDict` work? It maintains a
+doubly-linked list of keys, appending new keys to the list as they're inserted.
+A secondary dictionary maps keys to their corresponding list node, so
+deletion doesn't have to traverse the entire linked list and therefore
+remains O(1).
+
+The standard library now supports use of ordered dictionaries in several
+modules.
+
+* The :mod:`ConfigParser` module uses them by default, meaning that
+ configuration files can now be read, modified, and then written back
+ in their original order.
+
+* The :meth:`~collections.somenamedtuple._asdict()` method for
+ :func:`collections.namedtuple` now returns an ordered dictionary with the
+ values appearing in the same order as the underlying tuple indices.
+
+* The :mod:`json` module's :class:`~json.JSONDecoder` class
+ constructor was extended with an *object_pairs_hook* parameter to
+ allow :class:`OrderedDict` instances to be built by the decoder.
+ Support was also added for third-party tools like
+ `PyYAML <http://pyyaml.org/>`_.
+
+.. seealso::
+
+ :pep:`372` - Adding an ordered dictionary to collections
+ PEP written by Armin Ronacher and Raymond Hettinger;
+ implemented by Raymond Hettinger.
+
+.. _pep-0378:
+
+PEP 378: Format Specifier for Thousands Separator
+=================================================
+
+To make program output more readable, it can be useful to add
+separators to large numbers, rendering them as
+18,446,744,073,709,551,616 instead of 18446744073709551616.
+
+The fully general solution for doing this is the :mod:`locale` module,
+which can use different separators ("," in North America, "." in
+Europe) and different grouping sizes, but :mod:`locale` is complicated
+to use and unsuitable for multi-threaded applications where different
+threads are producing output for different locales.
+
+Therefore, a simple comma-grouping mechanism has been added to the
+mini-language used by the :meth:`str.format` method. When
+formatting a floating-point number, simply include a comma between the
+width and the precision::
+
+ >>> '{:20,.2f}'.format(18446744073709551616.0)
+ '18,446,744,073,709,551,616.00'
+
+When formatting an integer, include the comma after the width:
+
+ >>> '{:20,d}'.format(18446744073709551616)
+ '18,446,744,073,709,551,616'
+
+This mechanism is not adaptable at all; commas are always used as the
+separator and the grouping is always into three-digit groups. The
+comma-formatting mechanism isn't as general as the :mod:`locale`
+module, but it's easier to use.
+
+.. seealso::
+
+ :pep:`378` - Format Specifier for Thousands Separator
+ PEP written by Raymond Hettinger; implemented by Eric Smith.
+
+PEP 389: The argparse Module for Parsing Command Lines
+======================================================
+
+The :mod:`argparse` module for parsing command-line arguments was
+added as a more powerful replacement for the
+:mod:`optparse` module.
+
+This means Python now supports three different modules for parsing
+command-line arguments: :mod:`getopt`, :mod:`optparse`, and
+:mod:`argparse`. The :mod:`getopt` module closely resembles the C
+library's :c:func:`getopt` function, so it remains useful if you're writing a
+Python prototype that will eventually be rewritten in C.
+:mod:`optparse` becomes redundant, but there are no plans to remove it
+because there are many scripts still using it, and there's no
+automated way to update these scripts. (Making the :mod:`argparse`
+API consistent with :mod:`optparse`'s interface was discussed but
+rejected as too messy and difficult.)
+
+In short, if you're writing a new script and don't need to worry
+about compatibility with earlier versions of Python, use
+:mod:`argparse` instead of :mod:`optparse`.
+
+Here's an example::
+
+ import argparse
+
+ parser = argparse.ArgumentParser(description='Command-line example.')
+
+ # Add optional switches
+ parser.add_argument('-v', action='store_true', dest='is_verbose',
+ help='produce verbose output')
+ parser.add_argument('-o', action='store', dest='output',
+ metavar='FILE',
+ help='direct output to FILE instead of stdout')
+ parser.add_argument('-C', action='store', type=int, dest='context',
+ metavar='NUM', default=0,
+ help='display NUM lines of added context')
+
+ # Allow any number of additional arguments.
+ parser.add_argument(nargs='*', action='store', dest='inputs',
+ help='input filenames (default is stdin)')
+
+ args = parser.parse_args()
+ print args.__dict__
+
+Unless you override it, :option:`-h` and :option:`--help` switches
+are automatically added, and produce neatly formatted output::
+
+ -> ./python.exe argparse-example.py --help
+ usage: argparse-example.py [-h] [-v] [-o FILE] [-C NUM] [inputs [inputs ...]]
+
+ Command-line example.
+
+ positional arguments:
+ inputs input filenames (default is stdin)
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v produce verbose output
+ -o FILE direct output to FILE instead of stdout
+ -C NUM display NUM lines of added context
+
+As with :mod:`optparse`, the command-line switches and arguments
+are returned as an object with attributes named by the *dest* parameters::
+
+ -> ./python.exe argparse-example.py -v
+ {'output': None,
+ 'is_verbose': True,
+ 'context': 0,
+ 'inputs': []}
+
+ -> ./python.exe argparse-example.py -v -o /tmp/output -C 4 file1 file2
+ {'output': '/tmp/output',
+ 'is_verbose': True,
+ 'context': 4,
+ 'inputs': ['file1', 'file2']}
+
+:mod:`argparse` has much fancier validation than :mod:`optparse`; you
+can specify an exact number of arguments as an integer, 0 or more
+arguments by passing ``'*'``, 1 or more by passing ``'+'``, or an
+optional argument with ``'?'``. A top-level parser can contain
+sub-parsers to define subcommands that have different sets of
+switches, as in ``svn commit``, ``svn checkout``, etc. You can
+specify an argument's type as :class:`~argparse.FileType`, which will
+automatically open files for you and understands that ``'-'`` means
+standard input or output.
+
+.. seealso::
+
+ `argparse module documentation <http://docs.python.org/dev/library/argparse.html>`__
+
+ `Upgrading optparse code to use argparse <http://docs.python.org/dev/library/argparse.html#upgrading-optparse-code>`__
+ Part of the Python documentation, describing how to convert
+ code that uses :mod:`optparse`.
+
+ :pep:`389` - argparse - New Command Line Parsing Module
+ PEP written and implemented by Steven Bethard.
+
+PEP 391: Dictionary-Based Configuration For Logging
+====================================================
+
+.. XXX not documented in library reference yet; add link here once it's added.
+
+The :mod:`logging` module is very flexible; applications can define
+a tree of logging subsystems, and each logger in this tree can filter
+out certain messages, format them differently, and direct messages to
+a varying number of handlers.
+
+All this flexibility can require a lot of configuration. You can
+write Python statements to create objects and set their properties,
+but a complex set-up requires verbose but boring code.
+:mod:`logging` also supports a :func:`~logging.config.fileConfig`
+function that parses a file, but the file format doesn't support
+configuring filters, and it's messier to generate programmatically.
+
+Python 2.7 adds a :func:`~logging.config.dictConfig` function that
+uses a dictionary to configure logging. There are many ways to
+produce a dictionary from different sources: construct one with code;
+parse a file containing JSON; or use a YAML parsing library if one is
+installed.
+
+The following example configures two loggers, the root logger and a
+logger named "network". Messages sent to the root logger will be
+sent to the system log using the syslog protocol, and messages
+to the "network" logger will be written to a :file:`network.log` file
+that will be rotated once the log reaches 1Mb.
+
+::
+
+ import logging
+ import logging.config
+
+ configdict = {
+ 'version': 1, # Configuration schema in use; must be 1 for now
+ 'formatters': {
+ 'standard': {
+ 'format': ('%(asctime)s %(name)-15s '
+ '%(levelname)-8s %(message)s')}},
+
+ 'handlers': {'netlog': {'backupCount': 10,
+ 'class': 'logging.handlers.RotatingFileHandler',
+ 'filename': '/logs/network.log',
+ 'formatter': 'standard',
+ 'level': 'INFO',
+ 'maxBytes': 1024*1024},
+ 'syslog': {'class': 'logging.handlers.SysLogHandler',
+ 'formatter': 'standard',
+ 'level': 'ERROR'}},
+
+ # Specify all the subordinate loggers
+ 'loggers': {
+ 'network': {
+ 'handlers': ['netlog']
+ }
+ },
+ # Specify properties of the root logger
+ 'root': {
+ 'handlers': ['syslog']
+ },
+ }
+
+ # Set up configuration
+ logging.config.dictConfig(configdict)
+
+ # As an example, log two error messages
+ logger = logging.getLogger('/')
+ logger.error('Database not found')
+
+ netlogger = logging.getLogger('network')
+ netlogger.error('Connection failed')
+
+Three smaller enhancements to the :mod:`logging` module, all
+implemented by Vinay Sajip, are:
+
+.. rev79293
+
+* The :class:`~logging.handlers.SysLogHandler` class now supports
+ syslogging over TCP. The constructor has a *socktype* parameter
+ giving the type of socket to use, either :const:`socket.SOCK_DGRAM`
+ for UDP or :const:`socket.SOCK_STREAM` for TCP. The default
+ protocol remains UDP.
+
+* :class:`Logger` instances gained a :meth:`getChild` method that retrieves a
+ descendant logger using a relative path. For example,
+ once you retrieve a logger by doing ``log = getLogger('app')``,
+ calling ``log.getChild('network.listen')`` is equivalent to
+ ``getLogger('app.network.listen')``.
+
+* The :class:`LoggerAdapter` class gained a :meth:`isEnabledFor` method
+ that takes a *level* and returns whether the underlying logger would
+ process a message of that level of importance.
+
+.. seealso::
+
+ :pep:`391` - Dictionary-Based Configuration For Logging
+ PEP written and implemented by Vinay Sajip.
+
+PEP 3106: Dictionary Views
+====================================================
+
+The dictionary methods :meth:`keys`, :meth:`values`, and :meth:`items`
+are different in Python 3.x. They return an object called a :dfn:`view`
+instead of a fully materialized list.
+
+It's not possible to change the return values of :meth:`keys`,
+:meth:`values`, and :meth:`items` in Python 2.7 because too much code
+would break. Instead the 3.x versions were added under the new names
+:meth:`viewkeys`, :meth:`viewvalues`, and :meth:`viewitems`.
+
+::
+
+ >>> d = dict((i*10, chr(65+i)) for i in range(26))
+ >>> d
+ {0: 'A', 130: 'N', 10: 'B', 140: 'O', 20: ..., 250: 'Z'}
+ >>> d.viewkeys()
+ dict_keys([0, 130, 10, 140, 20, 150, 30, ..., 250])
+
+Views can be iterated over, but the key and item views also behave
+like sets. The ``&`` operator performs intersection, and ``|``
+performs a union::
+
+ >>> d1 = dict((i*10, chr(65+i)) for i in range(26))
+ >>> d2 = dict((i**.5, i) for i in range(1000))
+ >>> d1.viewkeys() & d2.viewkeys()
+ set([0.0, 10.0, 20.0, 30.0])
+ >>> d1.viewkeys() | range(0, 30)
+ set([0, 1, 130, 3, 4, 5, 6, ..., 120, 250])
+
+The view keeps track of the dictionary and its contents change as the
+dictionary is modified::
+
+ >>> vk = d.viewkeys()
+ >>> vk
+ dict_keys([0, 130, 10, ..., 250])
+ >>> d[260] = '&'
+ >>> vk
+ dict_keys([0, 130, 260, 10, ..., 250])
+
+However, note that you can't add or remove keys while you're iterating
+over the view::
+
+ >>> for k in vk:
+ ... d[k*2] = k
+ ...
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ RuntimeError: dictionary changed size during iteration
+
+You can use the view methods in Python 2.x code, and the 2to3
+converter will change them to the standard :meth:`keys`,
+:meth:`values`, and :meth:`items` methods.
+
+.. seealso::
+
+ :pep:`3106` - Revamping dict.keys(), .values() and .items()
+ PEP written by Guido van Rossum.
+ Backported to 2.7 by Alexandre Vassalotti; :issue:`1967`.
+
+
+PEP 3137: The memoryview Object
+====================================================
+
+The :class:`memoryview` object provides a view of another object's
+memory content that matches the :class:`bytes` type's interface.
+
+ >>> import string
+ >>> m = memoryview(string.letters)
+ >>> m
+ <memory at 0x37f850>
+ >>> len(m) # Returns length of underlying object
+ 52
+ >>> m[0], m[25], m[26] # Indexing returns one byte
+ ('a', 'z', 'A')
+ >>> m2 = m[0:26] # Slicing returns another memoryview
+ >>> m2
+ <memory at 0x37f080>
+
+The content of the view can be converted to a string of bytes or
+a list of integers:
+
+ >>> m2.tobytes()
+ 'abcdefghijklmnopqrstuvwxyz'
+ >>> m2.tolist()
+ [97, 98, 99, 100, 101, 102, 103, ... 121, 122]
+ >>>
+
+:class:`memoryview` objects allow modifying the underlying object if
+it's a mutable object.
+
+ >>> m2[0] = 75
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ TypeError: cannot modify read-only memory
+ >>> b = bytearray(string.letters) # Creating a mutable object
+ >>> b
+ bytearray(b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
+ >>> mb = memoryview(b)
+ >>> mb[0] = '*' # Assign to view, changing the bytearray.
+ >>> b[0:5] # The bytearray has been changed.
+ bytearray(b'*bcde')
+ >>>
+
+.. seealso::
+
+ :pep:`3137` - Immutable Bytes and Mutable Buffer
+ PEP written by Guido van Rossum.
+ Implemented by Travis Oliphant, Antoine Pitrou and others.
+ Backported to 2.7 by Antoine Pitrou; :issue:`2396`.
+
+
+
+Other Language Changes
+======================
+
+Some smaller changes made to the core Python language are:
+
+* The syntax for set literals has been backported from Python 3.x.
+ Curly brackets are used to surround the contents of the resulting
+ mutable set; set literals are
+ distinguished from dictionaries by not containing colons and values.
+ ``{}`` continues to represent an empty dictionary; use
+ ``set()`` for an empty set.
+
+ >>> {1,2,3,4,5}
+ set([1, 2, 3, 4, 5])
+ >>> set() # empty set
+ set([])
+ >>> {} # empty dict
+ {}
+
+ Backported by Alexandre Vassalotti; :issue:`2335`.
+
+* Dictionary and set comprehensions are another feature backported from
+ 3.x, generalizing list/generator comprehensions to use
+ the literal syntax for sets and dictionaries.
+
+ >>> {x: x*x for x in range(6)}
+ {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
+ >>> {('a'*x) for x in range(6)}
+ set(['', 'a', 'aa', 'aaa', 'aaaa', 'aaaaa'])
+
+ Backported by Alexandre Vassalotti; :issue:`2333`.
+
+* The :keyword:`with` statement can now use multiple context managers
+ in one statement. Context managers are processed from left to right
+ and each one is treated as beginning a new :keyword:`with` statement.
+ This means that::
+
+ with A() as a, B() as b:
+ ... suite of statements ...
+
+ is equivalent to::
+
+ with A() as a:
+ with B() as b:
+ ... suite of statements ...
+
+ The :func:`contextlib.nested` function provides a very similar
+ function, so it's no longer necessary and has been deprecated.
+
+ (Proposed in http://codereview.appspot.com/53094; implemented by
+ Georg Brandl.)
+
+* Conversions between floating-point numbers and strings are
+ now correctly rounded on most platforms. These conversions occur
+ in many different places: :func:`str` on
+ floats and complex numbers; the :class:`float` and :class:`complex`
+ constructors;
+ numeric formatting; serializing and
+ deserializing floats and complex numbers using the
+ :mod:`marshal`, :mod:`pickle`
+ and :mod:`json` modules;
+ parsing of float and imaginary literals in Python code;
+ and :class:`~decimal.Decimal`-to-float conversion.
+
+ Related to this, the :func:`repr` of a floating-point number *x*
+ now returns a result based on the shortest decimal string that's
+ guaranteed to round back to *x* under correct rounding (with
+ round-half-to-even rounding mode). Previously it gave a string
+ based on rounding x to 17 decimal digits.
+
+ .. maybe add an example?
+
+ The rounding library responsible for this improvement works on
+ Windows and on Unix platforms using the gcc, icc, or suncc
+ compilers. There may be a small number of platforms where correct
+ operation of this code cannot be guaranteed, so the code is not
+ used on such systems. You can find out which code is being used
+ by checking :data:`sys.float_repr_style`, which will be ``short``
+ if the new code is in use and ``legacy`` if it isn't.
+
+ Implemented by Eric Smith and Mark Dickinson, using David Gay's
+ :file:`dtoa.c` library; :issue:`7117`.
+
+* Conversions from long integers and regular integers to floating
+ point now round differently, returning the floating-point number
+ closest to the number. This doesn't matter for small integers that
+ can be converted exactly, but for large numbers that will
+ unavoidably lose precision, Python 2.7 now approximates more
+ closely. For example, Python 2.6 computed the following::
+
+ >>> n = 295147905179352891391
+ >>> float(n)
+ 2.9514790517935283e+20
+ >>> n - long(float(n))
+ 65535L
+
+ Python 2.7's floating-point result is larger, but much closer to the
+ true value::
+
+ >>> n = 295147905179352891391
+ >>> float(n)
+ 2.9514790517935289e+20
+ >>> n - long(float(n))
+ -1L
+
+ (Implemented by Mark Dickinson; :issue:`3166`.)
+
+ Integer division is also more accurate in its rounding behaviours. (Also
+ implemented by Mark Dickinson; :issue:`1811`.)
+
+* Implicit coercion for complex numbers has been removed; the interpreter
+ will no longer ever attempt to call a :meth:`__coerce__` method on complex
+ objects. (Removed by Meador Inge and Mark Dickinson; :issue:`5211`.)
+
+* The :meth:`str.format` method now supports automatic numbering of the replacement
+ fields. This makes using :meth:`str.format` more closely resemble using
+ ``%s`` formatting::
+
+ >>> '{}:{}:{}'.format(2009, 04, 'Sunday')
+ '2009:4:Sunday'
+ >>> '{}:{}:{day}'.format(2009, 4, day='Sunday')
+ '2009:4:Sunday'
+
+ The auto-numbering takes the fields from left to right, so the first ``{...}``
+ specifier will use the first argument to :meth:`str.format`, the next
+ specifier will use the next argument, and so on. You can't mix auto-numbering
+ and explicit numbering -- either number all of your specifier fields or none
+ of them -- but you can mix auto-numbering and named fields, as in the second
+ example above. (Contributed by Eric Smith; :issue:`5237`.)
+
+ Complex numbers now correctly support usage with :func:`format`,
+ and default to being right-aligned.
+ Specifying a precision or comma-separation applies to both the real
+ and imaginary parts of the number, but a specified field width and
+ alignment is applied to the whole of the resulting ``1.5+3j``
+ output. (Contributed by Eric Smith; :issue:`1588` and :issue:`7988`.)
+
+ The 'F' format code now always formats its output using uppercase characters,
+ so it will now produce 'INF' and 'NAN'.
+ (Contributed by Eric Smith; :issue:`3382`.)
+
+ A low-level change: the :meth:`object.__format__` method now triggers
+ a :exc:`PendingDeprecationWarning` if it's passed a format string,
+ because the :meth:`__format__` method for :class:`object` converts
+ the object to a string representation and formats that. Previously
+ the method silently applied the format string to the string
+ representation, but that could hide mistakes in Python code. If
+ you're supplying formatting information such as an alignment or
+ precision, presumably you're expecting the formatting to be applied
+ in some object-specific way. (Fixed by Eric Smith; :issue:`7994`.)
+
+* The :func:`int` and :func:`long` types gained a ``bit_length``
+ method that returns the number of bits necessary to represent
+ its argument in binary::
+
+ >>> n = 37
+ >>> bin(n)
+ '0b100101'
+ >>> n.bit_length()
+ 6
+ >>> n = 2**123-1
+ >>> n.bit_length()
+ 123
+ >>> (n+1).bit_length()
+ 124
+
+ (Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.)
+
+* The :keyword:`import` statement will no longer try a relative import
+ if an absolute import (e.g. ``from .os import sep``) fails. This
+ fixes a bug, but could possibly break certain :keyword:`import`
+ statements that were only working by accident. (Fixed by Meador Inge;
+ :issue:`7902`.)
+
+* It's now possible for a subclass of the built-in :class:`unicode` type
+ to override the :meth:`__unicode__` method. (Implemented by
+ Victor Stinner; :issue:`1583863`.)
+
+* The :class:`bytearray` type's :meth:`~bytearray.translate` method now accepts
+ ``None`` as its first argument. (Fixed by Georg Brandl;
+ :issue:`4759`.)
+
+ .. bytearray doesn't seem to be documented
+
+* When using ``@classmethod`` and ``@staticmethod`` to wrap
+ methods as class or static methods, the wrapper object now
+ exposes the wrapped function as their :attr:`__func__` attribute.
+ (Contributed by Amaury Forgeot d'Arc, after a suggestion by
+ George Sakkis; :issue:`5982`.)
+
+* When a restricted set of attributes were set using ``__slots__``,
+ deleting an unset attribute would not raise :exc:`AttributeError`
+ as you would expect. Fixed by Benjamin Peterson; :issue:`7604`.)
+
+* Two new encodings are now supported: "cp720", used primarily for
+ Arabic text; and "cp858", a variant of CP 850 that adds the euro
+ symbol. (CP720 contributed by Alexander Belchenko and Amaury
+ Forgeot d'Arc in :issue:`1616979`; CP858 contributed by Tim Hatch in
+ :issue:`8016`.)
+
+* The :class:`file` object will now set the :attr:`filename` attribute
+ on the :exc:`IOError` exception when trying to open a directory
+ on POSIX platforms (noted by Jan Kaliszewski; :issue:`4764`), and
+ now explicitly checks for and forbids writing to read-only file objects
+ instead of trusting the C library to catch and report the error
+ (fixed by Stefan Krah; :issue:`5677`).
+
+* The Python tokenizer now translates line endings itself, so the
+ :func:`compile` built-in function now accepts code using any
+ line-ending convention. Additionally, it no longer requires that the
+ code end in a newline.
+
+* Extra parentheses in function definitions are illegal in Python 3.x,
+ meaning that you get a syntax error from ``def f((x)): pass``. In
+ Python3-warning mode, Python 2.7 will now warn about this odd usage.
+ (Noted by James Lingard; :issue:`7362`.)
+
+* It's now possible to create weak references to old-style class
+ objects. New-style classes were always weak-referenceable. (Fixed
+ by Antoine Pitrou; :issue:`8268`.)
+
+* When a module object is garbage-collected, the module's dictionary is
+ now only cleared if no one else is holding a reference to the
+ dictionary (:issue:`7140`).
+
+.. ======================================================================
+
+.. _new-27-interpreter:
+
+Interpreter Changes
+-------------------------------
+
+A new environment variable, :envvar:`PYTHONWARNINGS`,
+allows controlling warnings. It should be set to a string
+containing warning settings, equivalent to those
+used with the :option:`-W` switch, separated by commas.
+(Contributed by Brian Curtin; :issue:`7301`.)
+
+For example, the following setting will print warnings every time
+they occur, but turn warnings from the :mod:`Cookie` module into an
+error. (The exact syntax for setting an environment variable varies
+across operating systems and shells.)
+
+::
+
+ export PYTHONWARNINGS=all,error:::Cookie:0
+
+.. ======================================================================
+
+
+Optimizations
+-------------
+
+Several performance enhancements have been added:
+
+.. * A new :program:`configure` option, :option:`--with-computed-gotos`,
+ compiles the main bytecode interpreter loop using a new dispatch
+ mechanism that gives speedups of up to 20%, depending on the system
+ and benchmark. The new mechanism is only supported on certain
+ compilers, such as gcc, SunPro, and icc.
+
+* A new opcode was added to perform the initial setup for
+ :keyword:`with` statements, looking up the :meth:`__enter__` and
+ :meth:`__exit__` methods. (Contributed by Benjamin Peterson.)
+
+* The garbage collector now performs better for one common usage
+ pattern: when many objects are being allocated without deallocating
+ any of them. This would previously take quadratic
+ time for garbage collection, but now the number of full garbage collections
+ is reduced as the number of objects on the heap grows.
+ The new logic only performs a full garbage collection pass when
+ the middle generation has been collected 10 times and when the
+ number of survivor objects from the middle generation exceeds 10% of
+ the number of objects in the oldest generation. (Suggested by Martin
+ von Löwis and implemented by Antoine Pitrou; :issue:`4074`.)
+
+* The garbage collector tries to avoid tracking simple containers
+ which can't be part of a cycle. In Python 2.7, this is now true for
+ tuples and dicts containing atomic types (such as ints, strings,
+ etc.). Transitively, a dict containing tuples of atomic types won't
+ be tracked either. This helps reduce the cost of each
+ garbage collection by decreasing the number of objects to be
+ considered and traversed by the collector.
+ (Contributed by Antoine Pitrou; :issue:`4688`.)
+
+* Long integers are now stored internally either in base 2**15 or in base
+ 2**30, the base being determined at build time. Previously, they
+ were always stored in base 2**15. Using base 2**30 gives
+ significant performance improvements on 64-bit machines, but
+ benchmark results on 32-bit machines have been mixed. Therefore,
+ the default is to use base 2**30 on 64-bit machines and base 2**15
+ on 32-bit machines; on Unix, there's a new configure option
+ :option:`--enable-big-digits` that can be used to override this default.
+
+ Apart from the performance improvements this change should be
+ invisible to end users, with one exception: for testing and
+ debugging purposes there's a new structseq :data:`sys.long_info` that
+ provides information about the internal format, giving the number of
+ bits per digit and the size in bytes of the C type used to store
+ each digit::
+
+ >>> import sys
+ >>> sys.long_info
+ sys.long_info(bits_per_digit=30, sizeof_digit=4)
+
+ (Contributed by Mark Dickinson; :issue:`4258`.)
+
+ Another set of changes made long objects a few bytes smaller: 2 bytes
+ smaller on 32-bit systems and 6 bytes on 64-bit.
+ (Contributed by Mark Dickinson; :issue:`5260`.)
+
+* The division algorithm for long integers has been made faster
+ by tightening the inner loop, doing shifts instead of multiplications,
+ and fixing an unnecessary extra iteration.
+ Various benchmarks show speedups of between 50% and 150% for long
+ integer divisions and modulo operations.
+ (Contributed by Mark Dickinson; :issue:`5512`.)
+ Bitwise operations are also significantly faster (initial patch by
+ Gregory Smith; :issue:`1087418`).
+
+* The implementation of ``%`` checks for the left-side operand being
+ a Python string and special-cases it; this results in a 1-3%
+ performance increase for applications that frequently use ``%``
+ with strings, such as templating libraries.
+ (Implemented by Collin Winter; :issue:`5176`.)
+
+* List comprehensions with an ``if`` condition are compiled into
+ faster bytecode. (Patch by Antoine Pitrou, back-ported to 2.7
+ by Jeffrey Yasskin; :issue:`4715`.)
+
+* Converting an integer or long integer to a decimal string was made
+ faster by special-casing base 10 instead of using a generalized
+ conversion function that supports arbitrary bases.
+ (Patch by Gawain Bolton; :issue:`6713`.)
+
+* The :meth:`split`, :meth:`replace`, :meth:`rindex`,
+ :meth:`rpartition`, and :meth:`rsplit` methods of string-like types
+ (strings, Unicode strings, and :class:`bytearray` objects) now use a
+ fast reverse-search algorithm instead of a character-by-character
+ scan. This is sometimes faster by a factor of 10. (Added by
+ Florent Xicluna; :issue:`7462` and :issue:`7622`.)
+
+* The :mod:`pickle` and :mod:`cPickle` modules now automatically
+ intern the strings used for attribute names, reducing memory usage
+ of the objects resulting from unpickling. (Contributed by Jake
+ McGuire; :issue:`5084`.)
+
+* The :mod:`cPickle` module now special-cases dictionaries,
+ nearly halving the time required to pickle them.
+ (Contributed by Collin Winter; :issue:`5670`.)
+
+.. ======================================================================
+
+New and Improved Modules
+========================
+
+As in every release, Python's standard library received a number of
+enhancements and bug fixes. Here's a partial list of the most notable
+changes, sorted alphabetically by module name. Consult the
+:file:`Misc/NEWS` file in the source tree for a more complete list of
+changes, or look through the Subversion logs for all the details.
+
+* The :mod:`bdb` module's base debugging class :class:`~bdb.Bdb`
+ gained a feature for skipping modules. The constructor
+ now takes an iterable containing glob-style patterns such as
+ ``django.*``; the debugger will not step into stack frames
+ from a module that matches one of these patterns.
+ (Contributed by Maru Newby after a suggestion by
+ Senthil Kumaran; :issue:`5142`.)
+
+* The :mod:`binascii` module now supports the buffer API, so it can be
+ used with :class:`memoryview` instances and other similar buffer objects.
+ (Backported from 3.x by Florent Xicluna; :issue:`7703`.)
+
+* Updated module: the :mod:`bsddb` module has been updated from 4.7.2devel9
+ to version 4.8.4 of
+ `the pybsddb package <http://www.jcea.es/programacion/pybsddb.htm>`__.
+ The new version features better Python 3.x compatibility, various bug fixes,
+ and adds several new BerkeleyDB flags and methods.
+ (Updated by Jesús Cea Avión; :issue:`8156`. The pybsddb
+ changelog can be read at http://hg.jcea.es/pybsddb/file/tip/ChangeLog.)
+
+* The :mod:`bz2` module's :class:`~bz2.BZ2File` now supports the context
+ management protocol, so you can write ``with bz2.BZ2File(...) as f:``.
+ (Contributed by Hagen Fürstenau; :issue:`3860`.)
+
+* New class: the :class:`~collections.Counter` class in the :mod:`collections`
+ module is useful for tallying data. :class:`~collections.Counter` instances
+ behave mostly like dictionaries but return zero for missing keys instead of
+ raising a :exc:`KeyError`:
+
+ .. doctest::
+ :options: +NORMALIZE_WHITESPACE
+
+ >>> from collections import Counter
+ >>> c = Counter()
+ >>> for letter in 'here is a sample of english text':
+ ... c[letter] += 1
+ ...
+ >>> c
+ Counter({' ': 6, 'e': 5, 's': 3, 'a': 2, 'i': 2, 'h': 2,
+ 'l': 2, 't': 2, 'g': 1, 'f': 1, 'm': 1, 'o': 1, 'n': 1,
+ 'p': 1, 'r': 1, 'x': 1})
+ >>> c['e']
+ 5
+ >>> c['z']
+ 0
+
+ There are three additional :class:`~collections.Counter` methods.
+ :meth:`~collections.Counter.most_common` returns the N most common
+ elements and their counts. :meth:`~collections.Counter.elements`
+ returns an iterator over the contained elements, repeating each
+ element as many times as its count.
+ :meth:`~collections.Counter.subtract` takes an iterable and
+ subtracts one for each element instead of adding; if the argument is
+ a dictionary or another :class:`Counter`, the counts are
+ subtracted. ::
+
+ >>> c.most_common(5)
+ [(' ', 6), ('e', 5), ('s', 3), ('a', 2), ('i', 2)]
+ >>> c.elements() ->
+ 'a', 'a', ' ', ' ', ' ', ' ', ' ', ' ',
+ 'e', 'e', 'e', 'e', 'e', 'g', 'f', 'i', 'i',
+ 'h', 'h', 'm', 'l', 'l', 'o', 'n', 'p', 's',
+ 's', 's', 'r', 't', 't', 'x'
+ >>> c['e']
+ 5
+ >>> c.subtract('very heavy on the letter e')
+ >>> c['e'] # Count is now lower
+ -1
+
+ Contributed by Raymond Hettinger; :issue:`1696199`.
+
+ .. revision 79660
+
+ New class: :class:`~collections.OrderedDict` is described in the earlier
+ section :ref:`pep-0372`.
+
+ New method: The :class:`~collections.deque` data type now has a
+ :meth:`~collections.deque.count` method that returns the number of
+ contained elements equal to the supplied argument *x*, and a
+ :meth:`~collections.deque.reverse` method that reverses the elements
+ of the deque in-place. :class:`deque` also exposes its maximum
+ length as the read-only :attr:`~collections.deque.maxlen` attribute.
+ (Both features added by Raymond Hettinger.)
+
+ The :class:`~collections.namedtuple` class now has an optional *rename* parameter.
+ If *rename* is true, field names that are invalid because they've
+ been repeated or aren't legal Python identifiers will be
+ renamed to legal names that are derived from the field's
+ position within the list of fields:
+
+ >>> from collections import namedtuple
+ >>> T = namedtuple('T', ['field1', '$illegal', 'for', 'field2'], rename=True)
+ >>> T._fields
+ ('field1', '_1', '_2', 'field2')
+
+ (Added by Raymond Hettinger; :issue:`1818`.)
+
+ Finally, the :class:`~collections.Mapping` abstract base class now
+ returns :const:`NotImplemented` if a mapping is compared to
+ another type that isn't a :class:`Mapping`.
+ (Fixed by Daniel Stutzbach; :issue:`8729`.)
+
+* Constructors for the parsing classes in the :mod:`ConfigParser` module now
+ take a *allow_no_value* parameter, defaulting to false; if true,
+ options without values will be allowed. For example::
+
+ >>> import ConfigParser, StringIO
+ >>> sample_config = """
+ ... [mysqld]
+ ... user = mysql
+ ... pid-file = /var/run/mysqld/mysqld.pid
+ ... skip-bdb
+ ... """
+ >>> config = ConfigParser.RawConfigParser(allow_no_value=True)
+ >>> config.readfp(StringIO.StringIO(sample_config))
+ >>> config.get('mysqld', 'user')
+ 'mysql'
+ >>> print config.get('mysqld', 'skip-bdb')
+ None
+ >>> print config.get('mysqld', 'unknown')
+ Traceback (most recent call last):
+ ...
+ NoOptionError: No option 'unknown' in section: 'mysqld'
+
+ (Contributed by Mats Kindahl; :issue:`7005`.)
+
+* Deprecated function: :func:`contextlib.nested`, which allows
+ handling more than one context manager with a single :keyword:`with`
+ statement, has been deprecated, because the :keyword:`with` statement
+ now supports multiple context managers.
+
+* The :mod:`cookielib` module now ignores cookies that have an invalid
+ version field, one that doesn't contain an integer value. (Fixed by
+ John J. Lee; :issue:`3924`.)
+
+* The :mod:`copy` module's :func:`~copy.deepcopy` function will now
+ correctly copy bound instance methods. (Implemented by
+ Robert Collins; :issue:`1515`.)
+
+* The :mod:`ctypes` module now always converts ``None`` to a C NULL
+ pointer for arguments declared as pointers. (Changed by Thomas
+ Heller; :issue:`4606`.) The underlying `libffi library
+ <http://sourceware.org/libffi/>`__ has been updated to version
+ 3.0.9, containing various fixes for different platforms. (Updated
+ by Matthias Klose; :issue:`8142`.)
+
+* New method: the :mod:`datetime` module's :class:`~datetime.timedelta` class
+ gained a :meth:`~datetime.timedelta.total_seconds` method that returns the
+ number of seconds in the duration. (Contributed by Brian Quinlan; :issue:`5788`.)
+
+* New method: the :class:`~decimal.Decimal` class gained a
+ :meth:`~decimal.Decimal.from_float` class method that performs an exact
+ conversion of a floating-point number to a :class:`~decimal.Decimal`.
+ This exact conversion strives for the
+ closest decimal approximation to the floating-point representation's value;
+ the resulting decimal value will therefore still include the inaccuracy,
+ if any.
+ For example, ``Decimal.from_float(0.1)`` returns
+ ``Decimal('0.1000000000000000055511151231257827021181583404541015625')``.
+ (Implemented by Raymond Hettinger; :issue:`4796`.)
+
+ Comparing instances of :class:`Decimal` with floating-point
+ numbers now produces sensible results based on the numeric values
+ of the operands. Previously such comparisons would fall back to
+ Python's default rules for comparing objects, which produced arbitrary
+ results based on their type. Note that you still cannot combine
+ :class:`Decimal` and floating-point in other operations such as addition,
+ since you should be explicitly choosing how to convert between float and
+ :class:`Decimal`.
+ (Fixed by Mark Dickinson; :issue:`2531`.)
+
+ The constructor for :class:`~decimal.Decimal` now accepts
+ floating-point numbers (added by Raymond Hettinger; :issue:`8257`)
+ and non-European Unicode characters such as Arabic-Indic digits
+ (contributed by Mark Dickinson; :issue:`6595`).
+
+ Most of the methods of the :class:`~decimal.Context` class now accept integers
+ as well as :class:`~decimal.Decimal` instances; the only exceptions are the
+ :meth:`~decimal.Context.canonical` and :meth:`~decimal.Context.is_canonical`
+ methods. (Patch by Juan José Conti; :issue:`7633`.)
+
+ When using :class:`~decimal.Decimal` instances with a string's
+ :meth:`~str.format` method, the default alignment was previously
+ left-alignment. This has been changed to right-alignment, which is
+ more sensible for numeric types. (Changed by Mark Dickinson; :issue:`6857`.)
+
+ Comparisons involving a signaling NaN value (or ``sNAN``) now signal
+ :const:`InvalidOperation` instead of silently returning a true or
+ false value depending on the comparison operator. Quiet NaN values
+ (or ``NaN``) are now hashable. (Fixed by Mark Dickinson;
+ :issue:`7279`.)
+
+* The :mod:`difflib` module now produces output that is more
+ compatible with modern :command:`diff`/:command:`patch` tools
+ through one small change, using a tab character instead of spaces as
+ a separator in the header giving the filename. (Fixed by Anatoly
+ Techtonik; :issue:`7585`.)
+
+* The Distutils ``sdist`` command now always regenerates the
+ :file:`MANIFEST` file, since even if the :file:`MANIFEST.in` or
+ :file:`setup.py` files haven't been modified, the user might have
+ created some new files that should be included.
+ (Fixed by Tarek Ziadé; :issue:`8688`.)
+
+* The :mod:`doctest` module's :const:`IGNORE_EXCEPTION_DETAIL` flag
+ will now ignore the name of the module containing the exception
+ being tested. (Patch by Lennart Regebro; :issue:`7490`.)
+
+* The :mod:`email` module's :class:`~email.message.Message` class will
+ now accept a Unicode-valued payload, automatically converting the
+ payload to the encoding specified by :attr:`output_charset`.
+ (Added by R. David Murray; :issue:`1368247`.)
+
+* The :class:`~fractions.Fraction` class now accepts a single float or
+ :class:`~decimal.Decimal` instance, or two rational numbers, as
+ arguments to its constructor. (Implemented by Mark Dickinson;
+ rationals added in :issue:`5812`, and float/decimal in
+ :issue:`8294`.)
+
+ Ordering comparisons (``<``, ``<=``, ``>``, ``>=``) between
+ fractions and complex numbers now raise a :exc:`TypeError`.
+ This fixes an oversight, making the :class:`Fraction` match the other
+ numeric types.
+
+ .. revision 79455
+
+* New class: :class:`~ftplib.FTP_TLS` in
+ the :mod:`ftplib` module provides secure FTP
+ connections using TLS encapsulation of authentication as well as
+ subsequent control and data transfers.
+ (Contributed by Giampaolo Rodola; :issue:`2054`.)
+
+ The :meth:`~ftplib.FTP.storbinary` method for binary uploads can now restart
+ uploads thanks to an added *rest* parameter (patch by Pablo Mouzo;
+ :issue:`6845`.)
+
+* New class decorator: :func:`total_ordering` in the :mod:`functools`
+ module takes a class that defines an :meth:`__eq__` method and one of
+ :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, or :meth:`__ge__`,
+ and generates the missing comparison methods. Since the
+ :meth:`__cmp__` method is being deprecated in Python 3.x,
+ this decorator makes it easier to define ordered classes.
+ (Added by Raymond Hettinger; :issue:`5479`.)
+
+ New function: :func:`cmp_to_key` will take an old-style comparison
+ function that expects two arguments and return a new callable that
+ can be used as the *key* parameter to functions such as
+ :func:`sorted`, :func:`min` and :func:`max`, etc. The primary
+ intended use is to help with making code compatible with Python 3.x.
+ (Added by Raymond Hettinger.)
+
+* New function: the :mod:`gc` module's :func:`~gc.is_tracked` returns
+ true if a given instance is tracked by the garbage collector, false
+ otherwise. (Contributed by Antoine Pitrou; :issue:`4688`.)
+
+* The :mod:`gzip` module's :class:`~gzip.GzipFile` now supports the context
+ management protocol, so you can write ``with gzip.GzipFile(...) as f:``
+ (contributed by Hagen Fürstenau; :issue:`3860`), and it now implements
+ the :class:`io.BufferedIOBase` ABC, so you can wrap it with
+ :class:`io.BufferedReader` for faster processing
+ (contributed by Nir Aides; :issue:`7471`).
+ It's also now possible to override the modification time
+ recorded in a gzipped file by providing an optional timestamp to
+ the constructor. (Contributed by Jacques Frechet; :issue:`4272`.)
+
+ Files in gzip format can be padded with trailing zero bytes; the
+ :mod:`gzip` module will now consume these trailing bytes. (Fixed by
+ Tadek Pietraszek and Brian Curtin; :issue:`2846`.)
+
+* New attribute: the :mod:`hashlib` module now has an :attr:`~hashlib.hashlib.algorithms`
+ attribute containing a tuple naming the supported algorithms.
+ In Python 2.7, ``hashlib.algorithms`` contains
+ ``('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')``.
+ (Contributed by Carl Chenet; :issue:`7418`.)
+
+* The default :class:`~httplib.HTTPResponse` class used by the :mod:`httplib` module now
+ supports buffering, resulting in much faster reading of HTTP responses.
+ (Contributed by Kristján Valur Jónsson; :issue:`4879`.)
+
+ The :class:`~httplib.HTTPConnection` and :class:`~httplib.HTTPSConnection` classes
+ now support a *source_address* parameter, a ``(host, port)`` 2-tuple
+ giving the source address that will be used for the connection.
+ (Contributed by Eldon Ziegler; :issue:`3972`.)
+
+* The :mod:`ihooks` module now supports relative imports. Note that
+ :mod:`ihooks` is an older module for customizing imports,
+ superseded by the :mod:`imputil` module added in Python 2.0.
+ (Relative import support added by Neil Schemenauer.)
+
+ .. revision 75423
+
+* The :mod:`imaplib` module now supports IPv6 addresses.
+ (Contributed by Derek Morr; :issue:`1655`.)
+
+* New function: the :mod:`inspect` module's :func:`~inspect.getcallargs`
+ takes a callable and its positional and keyword arguments,
+ and figures out which of the callable's parameters will receive each argument,
+ returning a dictionary mapping argument names to their values. For example::
+
+ >>> from inspect import getcallargs
+ >>> def f(a, b=1, *pos, **named):
+ ... pass
+ >>> getcallargs(f, 1, 2, 3)
+ {'a': 1, 'b': 2, 'pos': (3,), 'named': {}}
+ >>> getcallargs(f, a=2, x=4)
+ {'a': 2, 'b': 1, 'pos': (), 'named': {'x': 4}}
+ >>> getcallargs(f)
+ Traceback (most recent call last):
+ ...
+ TypeError: f() takes at least 1 argument (0 given)
+
+ Contributed by George Sakkis; :issue:`3135`.
+
+* Updated module: The :mod:`io` library has been upgraded to the version shipped with
+ Python 3.1. For 3.1, the I/O library was entirely rewritten in C
+ and is 2 to 20 times faster depending on the task being performed. The
+ original Python version was renamed to the :mod:`_pyio` module.
+
+ One minor resulting change: the :class:`io.TextIOBase` class now
+ has an :attr:`errors` attribute giving the error setting
+ used for encoding and decoding errors (one of ``'strict'``, ``'replace'``,
+ ``'ignore'``).
+
+ The :class:`io.FileIO` class now raises an :exc:`OSError` when passed
+ an invalid file descriptor. (Implemented by Benjamin Peterson;
+ :issue:`4991`.) The :meth:`~io.IOBase.truncate` method now preserves the
+ file position; previously it would change the file position to the
+ end of the new file. (Fixed by Pascal Chambon; :issue:`6939`.)
+
+* New function: ``itertools.compress(data, selectors)`` takes two
+ iterators. Elements of *data* are returned if the corresponding
+ value in *selectors* is true::
+
+ itertools.compress('ABCDEF', [1,0,1,0,1,1]) =>
+ A, C, E, F
+
+ .. maybe here is better to use >>> list(itertools.compress(...)) instead
+
+ New function: ``itertools.combinations_with_replacement(iter, r)``
+ returns all the possible *r*-length combinations of elements from the
+ iterable *iter*. Unlike :func:`~itertools.combinations`, individual elements
+ can be repeated in the generated combinations::
+
+ itertools.combinations_with_replacement('abc', 2) =>
+ ('a', 'a'), ('a', 'b'), ('a', 'c'),
+ ('b', 'b'), ('b', 'c'), ('c', 'c')
+
+ Note that elements are treated as unique depending on their position
+ in the input, not their actual values.
+
+ The :func:`itertools.count` function now has a *step* argument that
+ allows incrementing by values other than 1. :func:`~itertools.count` also
+ now allows keyword arguments, and using non-integer values such as
+ floats or :class:`~decimal.Decimal` instances. (Implemented by Raymond
+ Hettinger; :issue:`5032`.)
+
+ :func:`itertools.combinations` and :func:`itertools.product`
+ previously raised :exc:`ValueError` for values of *r* larger than
+ the input iterable. This was deemed a specification error, so they
+ now return an empty iterator. (Fixed by Raymond Hettinger; :issue:`4816`.)
+
+* Updated module: The :mod:`json` module was upgraded to version 2.0.9 of the
+ simplejson package, which includes a C extension that makes
+ encoding and decoding faster.
+ (Contributed by Bob Ippolito; :issue:`4136`.)
+
+ To support the new :class:`collections.OrderedDict` type, :func:`json.load`
+ now has an optional *object_pairs_hook* parameter that will be called
+ with any object literal that decodes to a list of pairs.
+ (Contributed by Raymond Hettinger; :issue:`5381`.)
+
+* The :mod:`mailbox` module's :class:`Maildir` class now records the
+ timestamp on the directories it reads, and only re-reads them if the
+ modification time has subsequently changed. This improves
+ performance by avoiding unneeded directory scans. (Fixed by
+ A.M. Kuchling and Antoine Pitrou; :issue:`1607951`, :issue:`6896`.)
+
+* New functions: the :mod:`math` module gained
+ :func:`~math.erf` and :func:`~math.erfc` for the error function and the complementary error function,
+ :func:`~math.expm1` which computes ``e**x - 1`` with more precision than
+ using :func:`~math.exp` and subtracting 1,
+ :func:`~math.gamma` for the Gamma function, and
+ :func:`~math.lgamma` for the natural log of the Gamma function.
+ (Contributed by Mark Dickinson and nirinA raseliarison; :issue:`3366`.)
+
+* The :mod:`multiprocessing` module's :class:`Manager*` classes
+ can now be passed a callable that will be called whenever
+ a subprocess is started, along with a set of arguments that will be
+ passed to the callable.
+ (Contributed by lekma; :issue:`5585`.)
+
+ The :class:`~multiprocessing.Pool` class, which controls a pool of worker processes,
+ now has an optional *maxtasksperchild* parameter. Worker processes
+ will perform the specified number of tasks and then exit, causing the
+ :class:`~multiprocessing.Pool` to start a new worker. This is useful if tasks may leak
+ memory or other resources, or if some tasks will cause the worker to
+ become very large.
+ (Contributed by Charles Cazabon; :issue:`6963`.)
+
+* The :mod:`nntplib` module now supports IPv6 addresses.
+ (Contributed by Derek Morr; :issue:`1664`.)
+
+* New functions: the :mod:`os` module wraps the following POSIX system
+ calls: :func:`~os.getresgid` and :func:`~os.getresuid`, which return the
+ real, effective, and saved GIDs and UIDs;
+ :func:`~os.setresgid` and :func:`~os.setresuid`, which set
+ real, effective, and saved GIDs and UIDs to new values;
+ :func:`~os.initgroups`, which initialize the group access list
+ for the current process. (GID/UID functions
+ contributed by Travis H.; :issue:`6508`. Support for initgroups added
+ by Jean-Paul Calderone; :issue:`7333`.)
+
+ The :func:`os.fork` function now re-initializes the import lock in
+ the child process; this fixes problems on Solaris when :func:`~os.fork`
+ is called from a thread. (Fixed by Zsolt Cserna; :issue:`7242`.)
+
+* In the :mod:`os.path` module, the :func:`~os.path.normpath` and
+ :func:`~os.path.abspath` functions now preserve Unicode; if their input path
+ is a Unicode string, the return value is also a Unicode string.
+ (:meth:`~os.path.normpath` fixed by Matt Giuca in :issue:`5827`;
+ :meth:`~os.path.abspath` fixed by Ezio Melotti in :issue:`3426`.)
+
+* The :mod:`pydoc` module now has help for the various symbols that Python
+ uses. You can now do ``help('<<')`` or ``help('@')``, for example.
+ (Contributed by David Laban; :issue:`4739`.)
+
+* The :mod:`re` module's :func:`~re.split`, :func:`~re.sub`, and :func:`~re.subn`
+ now accept an optional *flags* argument, for consistency with the
+ other functions in the module. (Added by Gregory P. Smith.)
+
+* New function: :func:`~runpy.run_path` in the :mod:`runpy` module
+ will execute the code at a provided *path* argument. *path* can be
+ the path of a Python source file (:file:`example.py`), a compiled
+ bytecode file (:file:`example.pyc`), a directory
+ (:file:`./package/`), or a zip archive (:file:`example.zip`). If a
+ directory or zip path is provided, it will be added to the front of
+ ``sys.path`` and the module :mod:`__main__` will be imported. It's
+ expected that the directory or zip contains a :file:`__main__.py`;
+ if it doesn't, some other :file:`__main__.py` might be imported from
+ a location later in ``sys.path``. This makes more of the machinery
+ of :mod:`runpy` available to scripts that want to mimic the way
+ Python's command line processes an explicit path name.
+ (Added by Nick Coghlan; :issue:`6816`.)
+
+* New function: in the :mod:`shutil` module, :func:`~shutil.make_archive`
+ takes a filename, archive type (zip or tar-format), and a directory
+ path, and creates an archive containing the directory's contents.
+ (Added by Tarek Ziadé.)
+
+ :mod:`shutil`'s :func:`~shutil.copyfile` and :func:`~shutil.copytree`
+ functions now raise a :exc:`~shutil.SpecialFileError` exception when
+ asked to copy a named pipe. Previously the code would treat
+ named pipes like a regular file by opening them for reading, and
+ this would block indefinitely. (Fixed by Antoine Pitrou; :issue:`3002`.)
+
+* The :mod:`signal` module no longer re-installs the signal handler
+ unless this is truly necessary, which fixes a bug that could make it
+ impossible to catch the EINTR signal robustly. (Fixed by
+ Charles-Francois Natali; :issue:`8354`.)
+
+* New functions: in the :mod:`site` module, three new functions
+ return various site- and user-specific paths.
+ :func:`~site.getsitepackages` returns a list containing all
+ global site-packages directories,
+ :func:`~site.getusersitepackages` returns the path of the user's
+ site-packages directory, and
+ :func:`~site.getuserbase` returns the value of the :envvar:`USER_BASE`
+ environment variable, giving the path to a directory that can be used
+ to store data.
+ (Contributed by Tarek Ziadé; :issue:`6693`.)
+
+ The :mod:`site` module now reports exceptions occurring
+ when the :mod:`sitecustomize` module is imported, and will no longer
+ catch and swallow the :exc:`KeyboardInterrupt` exception. (Fixed by
+ Victor Stinner; :issue:`3137`.)
+
+* The :func:`~socket.create_connection` function
+ gained a *source_address* parameter, a ``(host, port)`` 2-tuple
+ giving the source address that will be used for the connection.
+ (Contributed by Eldon Ziegler; :issue:`3972`.)
+
+ The :meth:`~socket.socket.recv_into` and :meth:`~socket.socket.recvfrom_into`
+ methods will now write into objects that support the buffer API, most usefully
+ the :class:`bytearray` and :class:`memoryview` objects. (Implemented by
+ Antoine Pitrou; :issue:`8104`.)
+
+* The :mod:`SocketServer` module's :class:`~SocketServer.TCPServer` class now
+ supports socket timeouts and disabling the Nagle algorithm.
+ The :attr:`~SocketServer.TCPServer.disable_nagle_algorithm` class attribute
+ defaults to False; if overridden to be True,
+ new request connections will have the TCP_NODELAY option set to
+ prevent buffering many small sends into a single TCP packet.
+ The :attr:`~SocketServer.TCPServer.timeout` class attribute can hold
+ a timeout in seconds that will be applied to the request socket; if
+ no request is received within that time, :meth:`handle_timeout`
+ will be called and :meth:`handle_request` will return.
+ (Contributed by Kristján Valur Jónsson; :issue:`6192` and :issue:`6267`.)
+
+* Updated module: the :mod:`sqlite3` module has been updated to
+ version 2.6.0 of the `pysqlite package <http://code.google.com/p/pysqlite/>`__. Version 2.6.0 includes a number of bugfixes, and adds
+ the ability to load SQLite extensions from shared libraries.
+ Call the ``enable_load_extension(True)`` method to enable extensions,
+ and then call :meth:`~sqlite3.Connection.load_extension` to load a particular shared library.
+ (Updated by Gerhard Häring.)
+
+* The :mod:`ssl` module's :class:`ssl.SSLSocket` objects now support the
+ buffer API, which fixed a test suite failure (fix by Antoine Pitrou;
+ :issue:`7133`) and automatically set
+ OpenSSL's :c:macro:`SSL_MODE_AUTO_RETRY`, which will prevent an error
+ code being returned from :meth:`recv` operations that trigger an SSL
+ renegotiation (fix by Antoine Pitrou; :issue:`8222`).
+
+ The :func:`ssl.wrap_socket` constructor function now takes a
+ *ciphers* argument that's a string listing the encryption algorithms
+ to be allowed; the format of the string is described
+ `in the OpenSSL documentation
+ <http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`__.
+ (Added by Antoine Pitrou; :issue:`8322`.)
+
+ Another change makes the extension load all of OpenSSL's ciphers and
+ digest algorithms so that they're all available. Some SSL
+ certificates couldn't be verified, reporting an "unknown algorithm"
+ error. (Reported by Beda Kosata, and fixed by Antoine Pitrou;
+ :issue:`8484`.)
+
+ The version of OpenSSL being used is now available as the module
+ attributes :data:`ssl.OPENSSL_VERSION` (a string),
+ :data:`ssl.OPENSSL_VERSION_INFO` (a 5-tuple), and
+ :data:`ssl.OPENSSL_VERSION_NUMBER` (an integer). (Added by Antoine
+ Pitrou; :issue:`8321`.)
+
+* The :mod:`struct` module will no longer silently ignore overflow
+ errors when a value is too large for a particular integer format
+ code (one of ``bBhHiIlLqQ``); it now always raises a
+ :exc:`struct.error` exception. (Changed by Mark Dickinson;
+ :issue:`1523`.) The :func:`~struct.pack` function will also
+ attempt to use :meth:`__index__` to convert and pack non-integers
+ before trying the :meth:`__int__` method or reporting an error.
+ (Changed by Mark Dickinson; :issue:`8300`.)
+
+* New function: the :mod:`subprocess` module's
+ :func:`~subprocess.check_output` runs a command with a specified set of arguments
+ and returns the command's output as a string when the command runs without
+ error, or raises a :exc:`~subprocess.CalledProcessError` exception otherwise.
+
+ ::
+
+ >>> subprocess.check_output(['df', '-h', '.'])
+ 'Filesystem Size Used Avail Capacity Mounted on\n
+ /dev/disk0s2 52G 49G 3.0G 94% /\n'
+
+ >>> subprocess.check_output(['df', '-h', '/bogus'])
+ ...
+ subprocess.CalledProcessError: Command '['df', '-h', '/bogus']' returned non-zero exit status 1
+
+ (Contributed by Gregory P. Smith.)
+
+ The :mod:`subprocess` module will now retry its internal system calls
+ on receiving an :const:`EINTR` signal. (Reported by several people; final
+ patch by Gregory P. Smith in :issue:`1068268`.)
+
+* New function: :func:`~symtable.is_declared_global` in the :mod:`symtable` module
+ returns true for variables that are explicitly declared to be global,
+ false for ones that are implicitly global.
+ (Contributed by Jeremy Hylton.)
+
+* The :mod:`syslog` module will now use the value of ``sys.argv[0]`` as the
+ identifier instead of the previous default value of ``'python'``.
+ (Changed by Sean Reifschneider; :issue:`8451`.)
+
+* The ``sys.version_info`` value is now a named tuple, with attributes
+ named :attr:`major`, :attr:`minor`, :attr:`micro`,
+ :attr:`releaselevel`, and :attr:`serial`. (Contributed by Ross
+ Light; :issue:`4285`.)
+
+ :func:`sys.getwindowsversion` also returns a named tuple,
+ with attributes named :attr:`major`, :attr:`minor`, :attr:`build`,
+ :attr:`platform`, :attr:`service_pack`, :attr:`service_pack_major`,
+ :attr:`service_pack_minor`, :attr:`suite_mask`, and
+ :attr:`product_type`. (Contributed by Brian Curtin; :issue:`7766`.)
+
+* The :mod:`tarfile` module's default error handling has changed, to
+ no longer suppress fatal errors. The default error level was previously 0,
+ which meant that errors would only result in a message being written to the
+ debug log, but because the debug log is not activated by default,
+ these errors go unnoticed. The default error level is now 1,
+ which raises an exception if there's an error.
+ (Changed by Lars Gustäbel; :issue:`7357`.)
+
+ :mod:`tarfile` now supports filtering the :class:`~tarfile.TarInfo`
+ objects being added to a tar file. When you call :meth:`~tarfile.TarFile.add`,
+ you may supply an optional *filter* argument
+ that's a callable. The *filter* callable will be passed the
+ :class:`~tarfile.TarInfo` for every file being added, and can modify and return it.
+ If the callable returns ``None``, the file will be excluded from the
+ resulting archive. This is more powerful than the existing
+ *exclude* argument, which has therefore been deprecated.
+ (Added by Lars Gustäbel; :issue:`6856`.)
+ The :class:`~tarfile.TarFile` class also now supports the context manager protocol.
+ (Added by Lars Gustäbel; :issue:`7232`.)
+
+* The :meth:`~threading.Event.wait` method of the :class:`threading.Event` class
+ now returns the internal flag on exit. This means the method will usually
+ return true because :meth:`~threading.Event.wait` is supposed to block until the
+ internal flag becomes true. The return value will only be false if
+ a timeout was provided and the operation timed out.
+ (Contributed by Tim Lesher; :issue:`1674032`.)
+
+* The Unicode database provided by the :mod:`unicodedata` module is
+ now used internally to determine which characters are numeric,
+ whitespace, or represent line breaks. The database also
+ includes information from the :file:`Unihan.txt` data file (patch
+ by Anders Chrigström and Amaury Forgeot d'Arc; :issue:`1571184`)
+ and has been updated to version 5.2.0 (updated by
+ Florent Xicluna; :issue:`8024`).
+
+* The :mod:`urlparse` module's :func:`~urlparse.urlsplit` now handles
+ unknown URL schemes in a fashion compliant with :rfc:`3986`: if the
+ URL is of the form ``"<something>://..."``, the text before the
+ ``://`` is treated as the scheme, even if it's a made-up scheme that
+ the module doesn't know about. This change may break code that
+ worked around the old behaviour. For example, Python 2.6.4 or 2.5
+ will return the following:
+
+ >>> import urlparse
+ >>> urlparse.urlsplit('invented://host/filename?query')
+ ('invented', '', '//host/filename?query', '', '')
+
+ Python 2.7 (and Python 2.6.5) will return:
+
+ >>> import urlparse
+ >>> urlparse.urlsplit('invented://host/filename?query')
+ ('invented', 'host', '/filename?query', '', '')
+
+ (Python 2.7 actually produces slightly different output, since it
+ returns a named tuple instead of a standard tuple.)
+
+ The :mod:`urlparse` module also supports IPv6 literal addresses as defined by
+ :rfc:`2732` (contributed by Senthil Kumaran; :issue:`2987`). ::
+
+ >>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo')
+ ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]',
+ path='/foo', params='', query='', fragment='')
+
+* New class: the :class:`~weakref.WeakSet` class in the :mod:`weakref`
+ module is a set that only holds weak references to its elements; elements
+ will be removed once there are no references pointing to them.
+ (Originally implemented in Python 3.x by Raymond Hettinger, and backported
+ to 2.7 by Michael Foord.)
+
+* The ElementTree library, :mod:`xml.etree`, no longer escapes
+ ampersands and angle brackets when outputting an XML processing
+ instruction (which looks like ``<?xml-stylesheet href="#style1"?>``)
+ or comment (which looks like ``<!-- comment -->``).
+ (Patch by Neil Muller; :issue:`2746`.)
+
+* The XML-RPC client and server, provided by the :mod:`xmlrpclib` and
+ :mod:`SimpleXMLRPCServer` modules, have improved performance by
+ supporting HTTP/1.1 keep-alive and by optionally using gzip encoding
+ to compress the XML being exchanged. The gzip compression is
+ controlled by the :attr:`encode_threshold` attribute of
+ :class:`SimpleXMLRPCRequestHandler`, which contains a size in bytes;
+ responses larger than this will be compressed.
+ (Contributed by Kristján Valur Jónsson; :issue:`6267`.)
+
+* The :mod:`zipfile` module's :class:`~zipfile.ZipFile` now supports the context
+ management protocol, so you can write ``with zipfile.ZipFile(...) as f:``.
+ (Contributed by Brian Curtin; :issue:`5511`.)
+
+ :mod:`zipfile` now also supports archiving empty directories and
+ extracts them correctly. (Fixed by Kuba Wieczorek; :issue:`4710`.)
+ Reading files out of an archive is faster, and interleaving
+ :meth:`~zipfile.ZipFile.read` and :meth:`~zipfile.ZipFile.readline` now works correctly.
+ (Contributed by Nir Aides; :issue:`7610`.)
+
+ The :func:`~zipfile.is_zipfile` function now
+ accepts a file object, in addition to the path names accepted in earlier
+ versions. (Contributed by Gabriel Genellina; :issue:`4756`.)
+
+ The :meth:`~zipfile.ZipFile.writestr` method now has an optional *compress_type* parameter
+ that lets you override the default compression method specified in the
+ :class:`~zipfile.ZipFile` constructor. (Contributed by Ronald Oussoren;
+ :issue:`6003`.)
+
+
+.. ======================================================================
+.. whole new modules get described in subsections here
+
+
+.. _importlib-section:
+
+New module: importlib
+------------------------------
+
+Python 3.1 includes the :mod:`importlib` package, a re-implementation
+of the logic underlying Python's :keyword:`import` statement.
+:mod:`importlib` is useful for implementors of Python interpreters and
+to users who wish to write new importers that can participate in the
+import process. Python 2.7 doesn't contain the complete
+:mod:`importlib` package, but instead has a tiny subset that contains
+a single function, :func:`~importlib.import_module`.
+
+``import_module(name, package=None)`` imports a module. *name* is
+a string containing the module or package's name. It's possible to do
+relative imports by providing a string that begins with a ``.``
+character, such as ``..utils.errors``. For relative imports, the
+*package* argument must be provided and is the name of the package that
+will be used as the anchor for
+the relative import. :func:`~importlib.import_module` both inserts the imported
+module into ``sys.modules`` and returns the module object.
+
+Here are some examples::
+
+ >>> from importlib import import_module
+ >>> anydbm = import_module('anydbm') # Standard absolute import
+ >>> anydbm
+ <module 'anydbm' from '/p/python/Lib/anydbm.py'>
+ >>> # Relative import
+ >>> file_util = import_module('..file_util', 'distutils.command')
+ >>> file_util
+ <module 'distutils.file_util' from '/python/Lib/distutils/file_util.pyc'>
+
+:mod:`importlib` was implemented by Brett Cannon and introduced in
+Python 3.1.
+
+
+New module: sysconfig
+---------------------------------
+
+The :mod:`sysconfig` module has been pulled out of the Distutils
+package, becoming a new top-level module in its own right.
+:mod:`sysconfig` provides functions for getting information about
+Python's build process: compiler switches, installation paths, the
+platform name, and whether Python is running from its source
+directory.
+
+Some of the functions in the module are:
+
+* :func:`~sysconfig.get_config_var` returns variables from Python's
+ Makefile and the :file:`pyconfig.h` file.
+* :func:`~sysconfig.get_config_vars` returns a dictionary containing
+ all of the configuration variables.
+* :func:`~sysconfig.getpath` returns the configured path for
+ a particular type of module: the standard library,
+ site-specific modules, platform-specific modules, etc.
+* :func:`~sysconfig.is_python_build` returns true if you're running a
+ binary from a Python source tree, and false otherwise.
+
+Consult the :mod:`sysconfig` documentation for more details and for
+a complete list of functions.
+
+The Distutils package and :mod:`sysconfig` are now maintained by Tarek
+Ziadé, who has also started a Distutils2 package (source repository at
+http://hg.python.org/distutils2/) for developing a next-generation
+version of Distutils.
+
+
+ttk: Themed Widgets for Tk
+--------------------------
+
+Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk
+widgets but have a more customizable appearance and can therefore more
+closely resemble the native platform's widgets. This widget
+set was originally called Tile, but was renamed to Ttk (for "themed Tk")
+on being added to Tcl/Tck release 8.5.
+
+To learn more, read the :mod:`ttk` module documentation. You may also
+wish to read the Tcl/Tk manual page describing the
+Ttk theme engine, available at
+http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.htm. Some
+screenshots of the Python/Ttk code in use are at
+http://code.google.com/p/python-ttk/wiki/Screenshots.
+
+The :mod:`ttk` module was written by Guilherme Polo and added in
+:issue:`2983`. An alternate version called ``Tile.py``, written by
+Martin Franklin and maintained by Kevin Walzer, was proposed for
+inclusion in :issue:`2618`, but the authors argued that Guilherme
+Polo's work was more comprehensive.
+
+
+.. _unittest-section:
+
+Updated module: unittest
+---------------------------------
+
+The :mod:`unittest` module was greatly enhanced; many
+new features were added. Most of these features were implemented
+by Michael Foord, unless otherwise noted. The enhanced version of
+the module is downloadable separately for use with Python versions 2.4 to 2.6,
+packaged as the :mod:`unittest2` package, from
+http://pypi.python.org/pypi/unittest2.
+
+When used from the command line, the module can automatically discover
+tests. It's not as fancy as `py.test <http://pytest.org>`__ or
+`nose <http://code.google.com/p/python-nose/>`__, but provides a simple way
+to run tests kept within a set of package directories. For example,
+the following command will search the :file:`test/` subdirectory for
+any importable test files named ``test*.py``::
+
+ python -m unittest discover -s test
+
+Consult the :mod:`unittest` module documentation for more details.
+(Developed in :issue:`6001`.)
+
+The :func:`main` function supports some other new options:
+
+* :option:`-b` or :option:`--buffer` will buffer the standard output
+ and standard error streams during each test. If the test passes,
+ any resulting output will be discarded; on failure, the buffered
+ output will be displayed.
+
+* :option:`-c` or :option:`--catch` will cause the control-C interrupt
+ to be handled more gracefully. Instead of interrupting the test
+ process immediately, the currently running test will be completed
+ and then the partial results up to the interruption will be reported.
+ If you're impatient, a second press of control-C will cause an immediate
+ interruption.
+
+ This control-C handler tries to avoid causing problems when the code
+ being tested or the tests being run have defined a signal handler of
+ their own, by noticing that a signal handler was already set and
+ calling it. If this doesn't work for you, there's a
+ :func:`removeHandler` decorator that can be used to mark tests that
+ should have the control-C handling disabled.
+
+* :option:`-f` or :option:`--failfast` makes
+ test execution stop immediately when a test fails instead of
+ continuing to execute further tests. (Suggested by Cliff Dyer and
+ implemented by Michael Foord; :issue:`8074`.)
+
+The progress messages now show 'x' for expected failures
+and 'u' for unexpected successes when run in verbose mode.
+(Contributed by Benjamin Peterson.)
+
+Test cases can raise the :exc:`~unittest.SkipTest` exception to skip a
+test (:issue:`1034053`).
+
+The error messages for :meth:`~unittest.TestCase.assertEqual`,
+:meth:`~unittest.TestCase.assertTrue`, and :meth:`~unittest.TestCase.assertFalse`
+failures now provide more information. If you set the
+:attr:`~unittest.TestCase.longMessage` attribute of your :class:`~unittest.TestCase` classes to
+True, both the standard error message and any additional message you
+provide will be printed for failures. (Added by Michael Foord; :issue:`5663`.)
+
+The :meth:`~unittest.TestCase.assertRaises` method now
+returns a context handler when called without providing a callable
+object to run. For example, you can write this::
+
+ with self.assertRaises(KeyError):
+ {}['foo']
+
+(Implemented by Antoine Pitrou; :issue:`4444`.)
+
+.. rev 78774
+
+Module- and class-level setup and teardown fixtures are now supported.
+Modules can contain :func:`~unittest.setUpModule` and :func:`~unittest.tearDownModule`
+functions. Classes can have :meth:`~unittest.TestCase.setUpClass` and
+:meth:`~unittest.TestCase.tearDownClass` methods that must be defined as class methods
+(using ``@classmethod`` or equivalent). These functions and
+methods are invoked when the test runner switches to a test case in a
+different module or class.
+
+The methods :meth:`~unittest.TestCase.addCleanup` and
+:meth:`~unittest.TestCase.doCleanups` were added.
+:meth:`~unittest.TestCase.addCleanup` lets you add cleanup functions that
+will be called unconditionally (after :meth:`~unittest.TestCase.setUp` if
+:meth:`~unittest.TestCase.setUp` fails, otherwise after :meth:`~unittest.TestCase.tearDown`). This allows
+for much simpler resource allocation and deallocation during tests
+(:issue:`5679`).
+
+A number of new methods were added that provide more specialized
+tests. Many of these methods were written by Google engineers
+for use in their test suites; Gregory P. Smith, Michael Foord, and
+GvR worked on merging them into Python's version of :mod:`unittest`.
+
+* :meth:`~unittest.TestCase.assertIsNone` and :meth:`~unittest.TestCase.assertIsNotNone` take one
+ expression and verify that the result is or is not ``None``.
+
+* :meth:`~unittest.TestCase.assertIs` and :meth:`~unittest.TestCase.assertIsNot`
+ take two values and check whether the two values evaluate to the same object or not.
+ (Added by Michael Foord; :issue:`2578`.)
+
+* :meth:`~unittest.TestCase.assertIsInstance` and
+ :meth:`~unittest.TestCase.assertNotIsInstance` check whether
+ the resulting object is an instance of a particular class, or of
+ one of a tuple of classes. (Added by Georg Brandl; :issue:`7031`.)
+
+* :meth:`~unittest.TestCase.assertGreater`, :meth:`~unittest.TestCase.assertGreaterEqual`,
+ :meth:`~unittest.TestCase.assertLess`, and :meth:`~unittest.TestCase.assertLessEqual` compare
+ two quantities.
+
+* :meth:`~unittest.TestCase.assertMultiLineEqual` compares two strings, and if they're
+ not equal, displays a helpful comparison that highlights the
+ differences in the two strings. This comparison is now used by
+ default when Unicode strings are compared with :meth:`~unittest.TestCase.assertEqual`.
+
+* :meth:`~unittest.TestCase.assertRegexpMatches` and
+ :meth:`~unittest.TestCase.assertNotRegexpMatches` checks whether the
+ first argument is a string matching or not matching the regular
+ expression provided as the second argument (:issue:`8038`).
+
+* :meth:`~unittest.TestCase.assertRaisesRegexp` checks whether a particular exception
+ is raised, and then also checks that the string representation of
+ the exception matches the provided regular expression.
+
+* :meth:`~unittest.TestCase.assertIn` and :meth:`~unittest.TestCase.assertNotIn`
+ tests whether *first* is or is not in *second*.
+
+* :meth:`~unittest.TestCase.assertItemsEqual` tests whether two provided sequences
+ contain the same elements.
+
+* :meth:`~unittest.TestCase.assertSetEqual` compares whether two sets are equal, and
+ only reports the differences between the sets in case of error.
+
+* Similarly, :meth:`~unittest.TestCase.assertListEqual` and :meth:`~unittest.TestCase.assertTupleEqual`
+ compare the specified types and explain any differences without necessarily
+ printing their full values; these methods are now used by default
+ when comparing lists and tuples using :meth:`~unittest.TestCase.assertEqual`.
+ More generally, :meth:`~unittest.TestCase.assertSequenceEqual` compares two sequences
+ and can optionally check whether both sequences are of a
+ particular type.
+
+* :meth:`~unittest.TestCase.assertDictEqual` compares two dictionaries and reports the
+ differences; it's now used by default when you compare two dictionaries
+ using :meth:`~unittest.TestCase.assertEqual`. :meth:`~unittest.TestCase.assertDictContainsSubset` checks whether
+ all of the key/value pairs in *first* are found in *second*.
+
+* :meth:`~unittest.TestCase.assertAlmostEqual` and :meth:`~unittest.TestCase.assertNotAlmostEqual` test
+ whether *first* and *second* are approximately equal. This method
+ can either round their difference to an optionally-specified number
+ of *places* (the default is 7) and compare it to zero, or require
+ the difference to be smaller than a supplied *delta* value.
+
+* :meth:`~unittest.TestLoader.loadTestsFromName` properly honors the
+ :attr:`~unittest.TestLoader.suiteClass` attribute of
+ the :class:`~unittest.TestLoader`. (Fixed by Mark Roddy; :issue:`6866`.)
+
+* A new hook lets you extend the :meth:`~unittest.TestCase.assertEqual` method to handle
+ new data types. The :meth:`~unittest.TestCase.addTypeEqualityFunc` method takes a type
+ object and a function. The function will be used when both of the
+ objects being compared are of the specified type. This function
+ should compare the two objects and raise an exception if they don't
+ match; it's a good idea for the function to provide additional
+ information about why the two objects aren't matching, much as the new
+ sequence comparison methods do.
+
+:func:`unittest.main` now takes an optional ``exit`` argument. If
+False, :func:`~unittest.main` doesn't call :func:`sys.exit`, allowing
+:func:`main` to be used from the interactive interpreter.
+(Contributed by J. Pablo Fernández; :issue:`3379`.)
+
+:class:`~unittest.TestResult` has new :meth:`~unittest.TestResult.startTestRun` and
+:meth:`~unittest.TestResult.stopTestRun` methods that are called immediately before
+and after a test run. (Contributed by Robert Collins; :issue:`5728`.)
+
+With all these changes, the :file:`unittest.py` was becoming awkwardly
+large, so the module was turned into a package and the code split into
+several files (by Benjamin Peterson). This doesn't affect how the
+module is imported or used.
+
+.. seealso::
+
+ http://www.voidspace.org.uk/python/articles/unittest2.shtml
+ Describes the new features, how to use them, and the
+ rationale for various design decisions. (By Michael Foord.)
+
+.. _elementtree-section:
+
+Updated module: ElementTree 1.3
+---------------------------------
+
+The version of the ElementTree library included with Python was updated to
+version 1.3. Some of the new features are:
+
+* The various parsing functions now take a *parser* keyword argument
+ giving an :class:`XMLParser` instance that will
+ be used. This makes it possible to override the file's internal encoding::
+
+ p = ET.XMLParser(encoding='utf-8')
+ t = ET.XML("""<root/>""", parser=p)
+
+ Errors in parsing XML now raise a :exc:`ParseError` exception, whose
+ instances have a :attr:`position` attribute
+ containing a (*line*, *column*) tuple giving the location of the problem.
+
+* ElementTree's code for converting trees to a string has been
+ significantly reworked, making it roughly twice as fast in many
+ cases. The :class:`ElementTree` :meth:`write` and :class:`Element`
+ :meth:`write` methods now have a *method* parameter that can be
+ "xml" (the default), "html", or "text". HTML mode will output empty
+ elements as ``<empty></empty>`` instead of ``<empty/>``, and text
+ mode will skip over elements and only output the text chunks. If
+ you set the :attr:`tag` attribute of an element to ``None`` but
+ leave its children in place, the element will be omitted when the
+ tree is written out, so you don't need to do more extensive rearrangement
+ to remove a single element.
+
+ Namespace handling has also been improved. All ``xmlns:<whatever>``
+ declarations are now output on the root element, not scattered throughout
+ the resulting XML. You can set the default namespace for a tree
+ by setting the :attr:`default_namespace` attribute and can
+ register new prefixes with :meth:`register_namespace`. In XML mode,
+ you can use the true/false *xml_declaration* parameter to suppress the
+ XML declaration.
+
+* New :class:`Element` method: :meth:`extend` appends the items from a
+ sequence to the element's children. Elements themselves behave like
+ sequences, so it's easy to move children from one element to
+ another::
+
+ from xml.etree import ElementTree as ET
+
+ t = ET.XML("""<list>
+ <item>1</item> <item>2</item> <item>3</item>
+ </list>""")
+ new = ET.XML('<root/>')
+ new.extend(t)
+
+ # Outputs <root><item>1</item>...</root>
+ print ET.tostring(new)
+
+* New :class:`Element` method: :meth:`iter` yields the children of the
+ element as a generator. It's also possible to write ``for child in
+ elem:`` to loop over an element's children. The existing method
+ :meth:`getiterator` is now deprecated, as is :meth:`getchildren`
+ which constructs and returns a list of children.
+
+* New :class:`Element` method: :meth:`itertext` yields all chunks of
+ text that are descendants of the element. For example::
+
+ t = ET.XML("""<list>
+ <item>1</item> <item>2</item> <item>3</item>
+ </list>""")
+
+ # Outputs ['\n ', '1', ' ', '2', ' ', '3', '\n']
+ print list(t.itertext())
+
+* Deprecated: using an element as a Boolean (i.e., ``if elem:``) would
+ return true if the element had any children, or false if there were
+ no children. This behaviour is confusing -- ``None`` is false, but
+ so is a childless element? -- so it will now trigger a
+ :exc:`FutureWarning`. In your code, you should be explicit: write
+ ``len(elem) != 0`` if you're interested in the number of children,
+ or ``elem is not None``.
+
+Fredrik Lundh develops ElementTree and produced the 1.3 version;
+you can read his article describing 1.3 at
+http://effbot.org/zone/elementtree-13-intro.htm.
+Florent Xicluna updated the version included with
+Python, after discussions on python-dev and in :issue:`6472`.)
+
+.. ======================================================================
+
+
+Build and C API Changes
+=======================
+
+Changes to Python's build process and to the C API include:
+
+* The latest release of the GNU Debugger, GDB 7, can be `scripted
+ using Python
+ <http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html>`__.
+ When you begin debugging an executable program P, GDB will look for
+ a file named ``P-gdb.py`` and automatically read it. Dave Malcolm
+ contributed a :file:`python-gdb.py` that adds a number of
+ commands useful when debugging Python itself. For example,
+ ``py-up`` and ``py-down`` go up or down one Python stack frame,
+ which usually corresponds to several C stack frames. ``py-print``
+ prints the value of a Python variable, and ``py-bt`` prints the
+ Python stack trace. (Added as a result of :issue:`8032`.)
+
+* If you use the :file:`.gdbinit` file provided with Python,
+ the "pyo" macro in the 2.7 version now works correctly when the thread being
+ debugged doesn't hold the GIL; the macro now acquires it before printing.
+ (Contributed by Victor Stinner; :issue:`3632`.)
+
+* :c:func:`Py_AddPendingCall` is now thread-safe, letting any
+ worker thread submit notifications to the main Python thread. This
+ is particularly useful for asynchronous IO operations.
+ (Contributed by Kristján Valur Jónsson; :issue:`4293`.)
+
+* New function: :c:func:`PyCode_NewEmpty` creates an empty code object;
+ only the filename, function name, and first line number are required.
+ This is useful for extension modules that are attempting to
+ construct a more useful traceback stack. Previously such
+ extensions needed to call :c:func:`PyCode_New`, which had many
+ more arguments. (Added by Jeffrey Yasskin.)
+
+* New function: :c:func:`PyErr_NewExceptionWithDoc` creates a new
+ exception class, just as the existing :c:func:`PyErr_NewException` does,
+ but takes an extra ``char *`` argument containing the docstring for the
+ new exception class. (Added by 'lekma' on the Python bug tracker;
+ :issue:`7033`.)
+
+* New function: :c:func:`PyFrame_GetLineNumber` takes a frame object
+ and returns the line number that the frame is currently executing.
+ Previously code would need to get the index of the bytecode
+ instruction currently executing, and then look up the line number
+ corresponding to that address. (Added by Jeffrey Yasskin.)
+
+* New functions: :c:func:`PyLong_AsLongAndOverflow` and
+ :c:func:`PyLong_AsLongLongAndOverflow` approximates a Python long
+ integer as a C :c:type:`long` or :c:type:`long long`.
+ If the number is too large to fit into
+ the output type, an *overflow* flag is set and returned to the caller.
+ (Contributed by Case Van Horsen; :issue:`7528` and :issue:`7767`.)
+
+* New function: stemming from the rewrite of string-to-float conversion,
+ a new :c:func:`PyOS_string_to_double` function was added. The old
+ :c:func:`PyOS_ascii_strtod` and :c:func:`PyOS_ascii_atof` functions
+ are now deprecated.
+
+* New function: :c:func:`PySys_SetArgvEx` sets the value of
+ ``sys.argv`` and can optionally update ``sys.path`` to include the
+ directory containing the script named by ``sys.argv[0]`` depending
+ on the value of an *updatepath* parameter.
+
+ This function was added to close a security hole for applications
+ that embed Python. The old function, :c:func:`PySys_SetArgv`, would
+ always update ``sys.path``, and sometimes it would add the current
+ directory. This meant that, if you ran an application embedding
+ Python in a directory controlled by someone else, attackers could
+ put a Trojan-horse module in the directory (say, a file named
+ :file:`os.py`) that your application would then import and run.
+
+ If you maintain a C/C++ application that embeds Python, check
+ whether you're calling :c:func:`PySys_SetArgv` and carefully consider
+ whether the application should be using :c:func:`PySys_SetArgvEx`
+ with *updatepath* set to false.
+
+ Security issue reported as `CVE-2008-5983
+ <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_;
+ discussed in :issue:`5753`, and fixed by Antoine Pitrou.
+
+* New macros: the Python header files now define the following macros:
+ :c:macro:`Py_ISALNUM`,
+ :c:macro:`Py_ISALPHA`,
+ :c:macro:`Py_ISDIGIT`,
+ :c:macro:`Py_ISLOWER`,
+ :c:macro:`Py_ISSPACE`,
+ :c:macro:`Py_ISUPPER`,
+ :c:macro:`Py_ISXDIGIT`,
+ and :c:macro:`Py_TOLOWER`, :c:macro:`Py_TOUPPER`.
+ All of these functions are analogous to the C
+ standard macros for classifying characters, but ignore the current
+ locale setting, because in
+ several places Python needs to analyze characters in a
+ locale-independent way. (Added by Eric Smith;
+ :issue:`5793`.)
+
+ .. XXX these macros don't seem to be described in the c-api docs.
+
+* Removed function: :c:macro:`PyEval_CallObject` is now only available
+ as a macro. A function version was being kept around to preserve
+ ABI linking compatibility, but that was in 1997; it can certainly be
+ deleted by now. (Removed by Antoine Pitrou; :issue:`8276`.)
+
+* New format codes: the :c:func:`PyFormat_FromString`,
+ :c:func:`PyFormat_FromStringV`, and :c:func:`PyErr_Format` functions now
+ accept ``%lld`` and ``%llu`` format codes for displaying
+ C's :c:type:`long long` types.
+ (Contributed by Mark Dickinson; :issue:`7228`.)
+
+* The complicated interaction between threads and process forking has
+ been changed. Previously, the child process created by
+ :func:`os.fork` might fail because the child is created with only a
+ single thread running, the thread performing the :func:`os.fork`.
+ If other threads were holding a lock, such as Python's import lock,
+ when the fork was performed, the lock would still be marked as
+ "held" in the new process. But in the child process nothing would
+ ever release the lock, since the other threads weren't replicated,
+ and the child process would no longer be able to perform imports.
+
+ Python 2.7 acquires the import lock before performing an
+ :func:`os.fork`, and will also clean up any locks created using the
+ :mod:`threading` module. C extension modules that have internal
+ locks, or that call :c:func:`fork()` themselves, will not benefit
+ from this clean-up.
+
+ (Fixed by Thomas Wouters; :issue:`1590864`.)
+
+* The :c:func:`Py_Finalize` function now calls the internal
+ :func:`threading._shutdown` function; this prevents some exceptions from
+ being raised when an interpreter shuts down.
+ (Patch by Adam Olsen; :issue:`1722344`.)
+
+* When using the :c:type:`PyMemberDef` structure to define attributes
+ of a type, Python will no longer let you try to delete or set a
+ :const:`T_STRING_INPLACE` attribute.
+
+ .. rev 79644
+
+* Global symbols defined by the :mod:`ctypes` module are now prefixed
+ with ``Py``, or with ``_ctypes``. (Implemented by Thomas
+ Heller; :issue:`3102`.)
+
+* New configure option: the :option:`--with-system-expat` switch allows
+ building the :mod:`pyexpat` module to use the system Expat library.
+ (Contributed by Arfrever Frehtes Taifersar Arahesis; :issue:`7609`.)
+
+* New configure option: the
+ :option:`--with-valgrind` option will now disable the pymalloc
+ allocator, which is difficult for the Valgrind memory-error detector
+ to analyze correctly.
+ Valgrind will therefore be better at detecting memory leaks and
+ overruns. (Contributed by James Henstridge; :issue:`2422`.)
+
+* New configure option: you can now supply an empty string to
+ :option:`--with-dbmliborder=` in order to disable all of the various
+ DBM modules. (Added by Arfrever Frehtes Taifersar Arahesis;
+ :issue:`6491`.)
+
+* The :program:`configure` script now checks for floating-point rounding bugs
+ on certain 32-bit Intel chips and defines a :c:macro:`X87_DOUBLE_ROUNDING`
+ preprocessor definition. No code currently uses this definition,
+ but it's available if anyone wishes to use it.
+ (Added by Mark Dickinson; :issue:`2937`.)
+
+ :program:`configure` also now sets a :envvar:`LDCXXSHARED` Makefile
+ variable for supporting C++ linking. (Contributed by Arfrever
+ Frehtes Taifersar Arahesis; :issue:`1222585`.)
+
+* The build process now creates the necessary files for pkg-config
+ support. (Contributed by Clinton Roy; :issue:`3585`.)
+
+* The build process now supports Subversion 1.7. (Contributed by
+ Arfrever Frehtes Taifersar Arahesis; :issue:`6094`.)
+
+
+.. _whatsnew27-capsules:
+
+Capsules
+-------------------
+
+Python 3.1 adds a new C datatype, :c:type:`PyCapsule`, for providing a
+C API to an extension module. A capsule is essentially the holder of
+a C ``void *`` pointer, and is made available as a module attribute; for
+example, the :mod:`socket` module's API is exposed as ``socket.CAPI``,
+and :mod:`unicodedata` exposes ``ucnhash_CAPI``. Other extensions
+can import the module, access its dictionary to get the capsule
+object, and then get the ``void *`` pointer, which will usually point
+to an array of pointers to the module's various API functions.
+
+There is an existing data type already used for this,
+:c:type:`PyCObject`, but it doesn't provide type safety. Evil code
+written in pure Python could cause a segmentation fault by taking a
+:c:type:`PyCObject` from module A and somehow substituting it for the
+:c:type:`PyCObject` in module B. Capsules know their own name,
+and getting the pointer requires providing the name::
+
+ void *vtable;
+
+ if (!PyCapsule_IsValid(capsule, "mymodule.CAPI") {
+ PyErr_SetString(PyExc_ValueError, "argument type invalid");
+ return NULL;
+ }
+
+ vtable = PyCapsule_GetPointer(capsule, "mymodule.CAPI");
+
+You are assured that ``vtable`` points to whatever you're expecting.
+If a different capsule was passed in, :c:func:`PyCapsule_IsValid` would
+detect the mismatched name and return false. Refer to
+:ref:`using-capsules` for more information on using these objects.
+
+Python 2.7 now uses capsules internally to provide various
+extension-module APIs, but the :c:func:`PyCObject_AsVoidPtr` was
+modified to handle capsules, preserving compile-time compatibility
+with the :c:type:`CObject` interface. Use of
+:c:func:`PyCObject_AsVoidPtr` will signal a
+:exc:`PendingDeprecationWarning`, which is silent by default.
+
+Implemented in Python 3.1 and backported to 2.7 by Larry Hastings;
+discussed in :issue:`5630`.
+
+
+.. ======================================================================
+
+Port-Specific Changes: Windows
+-----------------------------------
+
+* The :mod:`msvcrt` module now contains some constants from
+ the :file:`crtassem.h` header file:
+ :data:`CRT_ASSEMBLY_VERSION`,
+ :data:`VC_ASSEMBLY_PUBLICKEYTOKEN`,
+ and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`.
+ (Contributed by David Cournapeau; :issue:`4365`.)
+
+* The :mod:`_winreg` module for accessing the registry now implements
+ the :func:`CreateKeyEx` and :func:`DeleteKeyEx` functions, extended
+ versions of previously-supported functions that take several extra
+ arguments. The :func:`DisableReflectionKey`,
+ :func:`EnableReflectionKey`, and :func:`QueryReflectionKey` were also
+ tested and documented.
+ (Implemented by Brian Curtin: :issue:`7347`.)
+
+* The new :c:func:`_beginthreadex` API is used to start threads, and
+ the native thread-local storage functions are now used.
+ (Contributed by Kristján Valur Jónsson; :issue:`3582`.)
+
+* The :func:`os.kill` function now works on Windows. The signal value
+ can be the constants :const:`CTRL_C_EVENT`,
+ :const:`CTRL_BREAK_EVENT`, or any integer. The first two constants
+ will send Control-C and Control-Break keystroke events to
+ subprocesses; any other value will use the :c:func:`TerminateProcess`
+ API. (Contributed by Miki Tebeka; :issue:`1220212`.)
+
+* The :func:`os.listdir` function now correctly fails
+ for an empty path. (Fixed by Hirokazu Yamamoto; :issue:`5913`.)
+
+* The :mod:`mimelib` module will now read the MIME database from
+ the Windows registry when initializing.
+ (Patch by Gabriel Genellina; :issue:`4969`.)
+
+.. ======================================================================
+
+Port-Specific Changes: Mac OS X
+-----------------------------------
+
+* The path ``/Library/Python/2.7/site-packages`` is now appended to
+ ``sys.path``, in order to share added packages between the system
+ installation and a user-installed copy of the same version.
+ (Changed by Ronald Oussoren; :issue:`4865`.)
+
+Port-Specific Changes: FreeBSD
+-----------------------------------
+
+* FreeBSD 7.1's :const:`SO_SETFIB` constant, used with
+ :func:`~socket.getsockopt`/:func:`~socket.setsockopt` to select an
+ alternate routing table, is now available in the :mod:`socket`
+ module. (Added by Kyle VanderBeek; :issue:`8235`.)
+
+Other Changes and Fixes
+=======================
+
+* Two benchmark scripts, :file:`iobench` and :file:`ccbench`, were
+ added to the :file:`Tools` directory. :file:`iobench` measures the
+ speed of the built-in file I/O objects returned by :func:`open`
+ while performing various operations, and :file:`ccbench` is a
+ concurrency benchmark that tries to measure computing throughput,
+ thread switching latency, and IO processing bandwidth when
+ performing several tasks using a varying number of threads.
+
+* The :file:`Tools/i18n/msgfmt.py` script now understands plural
+ forms in :file:`.po` files. (Fixed by Martin von Löwis;
+ :issue:`5464`.)
+
+* When importing a module from a :file:`.pyc` or :file:`.pyo` file
+ with an existing :file:`.py` counterpart, the :attr:`co_filename`
+ attributes of the resulting code objects are overwritten when the
+ original filename is obsolete. This can happen if the file has been
+ renamed, moved, or is accessed through different paths. (Patch by
+ Ziga Seilnacht and Jean-Paul Calderone; :issue:`1180193`.)
+
+* The :file:`regrtest.py` script now takes a :option:`--randseed=`
+ switch that takes an integer that will be used as the random seed
+ for the :option:`-r` option that executes tests in random order.
+ The :option:`-r` option also reports the seed that was used
+ (Added by Collin Winter.)
+
+* Another :file:`regrtest.py` switch is :option:`-j`, which
+ takes an integer specifying how many tests run in parallel. This
+ allows reducing the total runtime on multi-core machines.
+ This option is compatible with several other options, including the
+ :option:`-R` switch which is known to produce long runtimes.
+ (Added by Antoine Pitrou, :issue:`6152`.) This can also be used
+ with a new :option:`-F` switch that runs selected tests in a loop
+ until they fail. (Added by Antoine Pitrou; :issue:`7312`.)
+
+* When executed as a script, the :file:`py_compile.py` module now
+ accepts ``'-'`` as an argument, which will read standard input for
+ the list of filenames to be compiled. (Contributed by Piotr
+ Ożarowski; :issue:`8233`.)
+
+.. ======================================================================
+
+Porting to Python 2.7
+=====================
+
+This section lists previously described changes and other bugfixes
+that may require changes to your code:
+
+* The :func:`range` function processes its arguments more
+ consistently; it will now call :meth:`__int__` on non-float,
+ non-integer arguments that are supplied to it. (Fixed by Alexander
+ Belopolsky; :issue:`1533`.)
+
+* The string :meth:`format` method changed the default precision used
+ for floating-point and complex numbers from 6 decimal
+ places to 12, which matches the precision used by :func:`str`.
+ (Changed by Eric Smith; :issue:`5920`.)
+
+* Because of an optimization for the :keyword:`with` statement, the special
+ methods :meth:`__enter__` and :meth:`__exit__` must belong to the object's
+ type, and cannot be directly attached to the object's instance. This
+ affects new-style classes (derived from :class:`object`) and C extension
+ types. (:issue:`6101`.)
+
+* Due to a bug in Python 2.6, the *exc_value* parameter to
+ :meth:`__exit__` methods was often the string representation of the
+ exception, not an instance. This was fixed in 2.7, so *exc_value*
+ will be an instance as expected. (Fixed by Florent Xicluna;
+ :issue:`7853`.)
+
+* When a restricted set of attributes were set using ``__slots__``,
+ deleting an unset attribute would not raise :exc:`AttributeError`
+ as you would expect. Fixed by Benjamin Peterson; :issue:`7604`.)
+
+In the standard library:
+
+* Operations with :class:`datetime` instances that resulted in a year
+ falling outside the supported range didn't always raise
+ :exc:`OverflowError`. Such errors are now checked more carefully
+ and will now raise the exception. (Reported by Mark Leander, patch
+ by Anand B. Pillai and Alexander Belopolsky; :issue:`7150`.)
+
+* When using :class:`Decimal` instances with a string's
+ :meth:`format` method, the default alignment was previously
+ left-alignment. This has been changed to right-alignment, which might
+ change the output of your programs.
+ (Changed by Mark Dickinson; :issue:`6857`.)
+
+ Comparisons involving a signaling NaN value (or ``sNAN``) now signal
+ :const:`InvalidOperation` instead of silently returning a true or
+ false value depending on the comparison operator. Quiet NaN values
+ (or ``NaN``) are now hashable. (Fixed by Mark Dickinson;
+ :issue:`7279`.)
+
+* The ElementTree library, :mod:`xml.etree`, no longer escapes
+ ampersands and angle brackets when outputting an XML processing
+ instruction (which looks like `<?xml-stylesheet href="#style1"?>`)
+ or comment (which looks like `<!-- comment -->`).
+ (Patch by Neil Muller; :issue:`2746`.)
+
+* The :meth:`readline` method of :class:`StringIO` objects now does
+ nothing when a negative length is requested, as other file-like
+ objects do. (:issue:`7348`).
+
+* The :mod:`syslog` module will now use the value of ``sys.argv[0]`` as the
+ identifier instead of the previous default value of ``'python'``.
+ (Changed by Sean Reifschneider; :issue:`8451`.)
+
+* The :mod:`tarfile` module's default error handling has changed, to
+ no longer suppress fatal errors. The default error level was previously 0,
+ which meant that errors would only result in a message being written to the
+ debug log, but because the debug log is not activated by default,
+ these errors go unnoticed. The default error level is now 1,
+ which raises an exception if there's an error.
+ (Changed by Lars Gustäbel; :issue:`7357`.)
+
+* The :mod:`urlparse` module's :func:`~urlparse.urlsplit` now handles
+ unknown URL schemes in a fashion compliant with :rfc:`3986`: if the
+ URL is of the form ``"<something>://..."``, the text before the
+ ``://`` is treated as the scheme, even if it's a made-up scheme that
+ the module doesn't know about. This change may break code that
+ worked around the old behaviour. For example, Python 2.6.4 or 2.5
+ will return the following:
+
+ >>> import urlparse
+ >>> urlparse.urlsplit('invented://host/filename?query')
+ ('invented', '', '//host/filename?query', '', '')
+
+ Python 2.7 (and Python 2.6.5) will return:
+
+ >>> import urlparse
+ >>> urlparse.urlsplit('invented://host/filename?query')
+ ('invented', 'host', '/filename?query', '', '')
+
+ (Python 2.7 actually produces slightly different output, since it
+ returns a named tuple instead of a standard tuple.)
+
+For C extensions:
+
+* C extensions that use integer format codes with the ``PyArg_Parse*``
+ family of functions will now raise a :exc:`TypeError` exception
+ instead of triggering a :exc:`DeprecationWarning` (:issue:`5080`).
+
+* Use the new :c:func:`PyOS_string_to_double` function instead of the old
+ :c:func:`PyOS_ascii_strtod` and :c:func:`PyOS_ascii_atof` functions,
+ which are now deprecated.
+
+For applications that embed Python:
+
+* The :c:func:`PySys_SetArgvEx` function was added, letting
+ applications close a security hole when the existing
+ :c:func:`PySys_SetArgv` function was used. Check whether you're
+ calling :c:func:`PySys_SetArgv` and carefully consider whether the
+ application should be using :c:func:`PySys_SetArgvEx` with
+ *updatepath* set to false.
+
+.. ======================================================================
+
+
+.. _acks27:
+
+Acknowledgements
+================
+
+The author would like to thank the following people for offering
+suggestions, corrections and assistance with various drafts of this
+article: Nick Coghlan, Philip Jenvey, Ryan Lovett, R. David Murray,
+Hugh Secker-Walker.
+
diff --git a/Doc/whatsnew/3.0.rst b/Doc/whatsnew/3.0.rst
index 549f314e5c..852f811eac 100644
--- a/Doc/whatsnew/3.0.rst
+++ b/Doc/whatsnew/3.0.rst
@@ -96,9 +96,9 @@ up if you're used to Python 2.5.
Print Is A Function
-------------------
-The :keyword:`print` statement has been replaced with a :func:`print`
+The ``print`` statement has been replaced with a :func:`print`
function, with keyword arguments to replace most of the special syntax
-of the old :keyword:`print` statement (:pep:`3105`). Examples::
+of the old ``print`` statement (:pep:`3105`). Examples::
Old: print "The answer is", 2*2
New: print("The answer is", 2*2)
@@ -126,7 +126,7 @@ which produces::
Note:
* The :func:`print` function doesn't support the "softspace" feature of
- the old :keyword:`print` statement. For example, in Python 2.x,
+ the old ``print`` statement. For example, in Python 2.x,
``print "A\n", "B"`` would write ``"A\nB\n"``; but in Python 3.0,
``print("A\n", "B")`` writes ``"A\n B\n"``.
@@ -135,7 +135,7 @@ Note:
``print(x)`` instead!
* When using the ``2to3`` source-to-source conversion tool, all
- :keyword:`print` statements are automatically converted to
+ ``print`` statements are automatically converted to
:func:`print` function calls, so this is mostly a non-issue for
larger projects.
@@ -178,7 +178,7 @@ Python 3.0 has simplified the rules for ordering comparisons:
meaningful natural ordering. Thus, expressions like ``1 < ''``, ``0
> None`` or ``len <= len`` are no longer valid, and e.g. ``None <
None`` raises :exc:`TypeError` instead of returning
- :keyword:`False`. A corollary is that sorting a heterogeneous list
+ ``False``. A corollary is that sorting a heterogeneous list
no longer makes sense -- all the elements must be comparable to each
other. Note that this does not apply to the ``==`` and ``!=``
operators: objects of different incomparable types always compare
@@ -270,7 +270,7 @@ changed.
single "euro" character. (Of course, this change only affects raw
string literals; the euro character is ``'\u20ac'`` in Python 3.0.)
-* The builtin :class:`basestring` abstract type was removed. Use
+* The built-in :class:`basestring` abstract type was removed. Use
:class:`str` instead. The :class:`str` and :class:`bytes` types
don't have functionality enough in common to warrant a shared base
class. The ``2to3`` tool (see below) replaces every occurrence of
@@ -383,10 +383,10 @@ New Syntax
literals (``0720``) are gone.
* New binary literals, e.g. ``0b1010`` (already in 2.6), and
- there is a new corresponding builtin function, :func:`bin`.
+ there is a new corresponding built-in function, :func:`bin`.
* Bytes literals are introduced with a leading ``b`` or ``B``, and
- there is a new corresponding builtin function, :func:`bytes`.
+ there is a new corresponding built-in function, :func:`bytes`.
Changed Syntax
--------------
@@ -397,9 +397,8 @@ Changed Syntax
* :keyword:`as` and :keyword:`with` are now reserved words. (Since
2.6, actually.)
-* :keyword:`True`, :keyword:`False`, and :keyword:`None` are reserved
- words. (2.6 partially enforced the restrictions on :keyword:`None`
- already.)
+* ``True``, ``False``, and ``None`` are reserved words. (2.6 partially enforced
+ the restrictions on ``None`` already.)
* Change from :keyword:`except` *exc*, *var* to
:keyword:`except` *exc* :keyword:`as` *var*. See :pep:`3110`.
@@ -506,7 +505,7 @@ consulted for longer descriptions.
* :ref:`pep-3116`. The :mod:`io` module is now the standard way of
doing file I/O, and the initial values of :data:`sys.stdin`,
:data:`sys.stdout` and :data:`sys.stderr` are now instances of
- :class:`io.TextIOBase`. The builtin :func:`open` function is now an
+ :class:`io.TextIOBase`. The built-in :func:`open` function is now an
alias for :func:`io.open` and has additional keyword arguments
*encoding*, *errors*, *newline* and *closefd*. Also note that an
invalid *mode* argument now raises :exc:`ValueError`, not
@@ -521,7 +520,7 @@ consulted for longer descriptions.
* :ref:`pep-3119`. The :mod:`abc` module and the ABCs defined in the
:mod:`collections` module plays a somewhat more prominent role in
- the language now, and builtin collection types like :class:`dict`
+ the language now, and built-in collection types like :class:`dict`
and :class:`list` conform to the :class:`collections.MutableMapping`
and :class:`collections.MutableSequence` ABCs, respectively.
@@ -615,7 +614,7 @@ review:
Some other changes to standard library modules, not covered by
:pep:`3108`:
-* Killed :mod:`sets`. Use the builtin :func:`set` function.
+* Killed :mod:`sets`. Use the built-in :func:`set` class.
* Cleanup of the :mod:`sys` module: removed :func:`sys.exitfunc`,
:func:`sys.exc_clear`, :data:`sys.exc_type`, :data:`sys.exc_value`,
@@ -795,8 +794,8 @@ Builtins
It raises :exc:`EOFError` if the input is terminated prematurely.
To get the old behavior of :func:`input`, use ``eval(input())``.
-* A new builtin :func:`next` was added to call the :meth:`__next__`
- method on an object.
+* A new built-in function :func:`next` was added to call the
+ :meth:`__next__` method on an object.
* The :func:`round` function rounding strategy and return type have
changed. Exact halfway cases are now rounded to the nearest even
@@ -850,21 +849,21 @@ to the C API.
* :pep:`3121`: Extension Module Initialization & Finalization.
-* :pep:`3123`: Making :cmacro:`PyObject_HEAD` conform to standard C.
+* :pep:`3123`: Making :c:macro:`PyObject_HEAD` conform to standard C.
* No more C API support for restricted execution.
-* :cfunc:`PyNumber_Coerce`, :cfunc:`PyNumber_CoerceEx`,
- :cfunc:`PyMember_Get`, and :cfunc:`PyMember_Set` C APIs are removed.
+* :c:func:`PyNumber_Coerce`, :c:func:`PyNumber_CoerceEx`,
+ :c:func:`PyMember_Get`, and :c:func:`PyMember_Set` C APIs are removed.
-* New C API :cfunc:`PyImport_ImportModuleNoBlock`, works like
- :cfunc:`PyImport_ImportModule` but won't block on the import lock
+* New C API :c:func:`PyImport_ImportModuleNoBlock`, works like
+ :c:func:`PyImport_ImportModule` but won't block on the import lock
(returning an error instead).
* Renamed the boolean conversion C-level slot and method:
``nb_nonzero`` is now ``nb_bool``.
-* Removed :cmacro:`METH_OLDARGS` and :cmacro:`WITH_CYCLE_GC` from the C API.
+* Removed :c:macro:`METH_OLDARGS` and :c:macro:`WITH_CYCLE_GC` from the C API.
.. ======================================================================
@@ -906,7 +905,7 @@ best strategy is the following:
It is not recommended to try to write source code that runs unchanged
under both Python 2.6 and 3.0; you'd have to use a very contorted
-coding style, e.g. avoiding :keyword:`print` statements, metaclasses,
+coding style, e.g. avoiding ``print`` statements, metaclasses,
and much more. If you are maintaining a library that needs to support
both Python 2.6 and Python 3.0, the best approach is to modify step 3
above by editing the 2.6 version of the source code and running the
diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst
index 1b6b3ce11f..64ae1c1936 100644
--- a/Doc/whatsnew/3.1.rst
+++ b/Doc/whatsnew/3.1.rst
@@ -81,33 +81,11 @@ Support was also added for third-party tools like `PyYAML <http://pyyaml.org/>`_
PEP written by Armin Ronacher and Raymond Hettinger. Implementation
written by Raymond Hettinger.
-Since an ordered dictionary remembers its insertion order, it can be used
-in conjuction with sorting to make a sorted dictionary::
-
- >>> # regular unsorted dictionary
- >>> d = {'banana': 3, 'apple':4, 'pear': 1, 'orange': 2}
-
- >>> # dictionary sorted by key
- >>> OrderedDict(sorted(d.items(), key=lambda t: t[0]))
- OrderedDict([('apple', 4), ('banana', 3), ('orange', 2), ('pear', 1)])
-
- >>> # dictionary sorted by value
- >>> OrderedDict(sorted(d.items(), key=lambda t: t[1]))
- OrderedDict([('pear', 1), ('orange', 2), ('banana', 3), ('apple', 4)])
-
- >>> # dictionary sorted by length of the key string
- >>> OrderedDict(sorted(d.items(), key=lambda t: len(t[0])))
- OrderedDict([('pear', 1), ('apple', 4), ('orange', 2), ('banana', 3)])
-
-The new sorted dictionaries maintain their sort order when entries
-are deleted. But when new keys are added, the keys are appended
-to the end and the sort is not maintained.
-
PEP 378: Format Specifier for Thousands Separator
=================================================
-The builtin :func:`format` function and the :meth:`str.format` method use
+The built-in :func:`format` function and the :meth:`str.format` method use
a mini-language that now includes a simple, non-locale aware way to format
a number with a thousands separator. That provides a way to humanize a
program's output, improving its professional appearance and readability::
@@ -519,21 +497,21 @@ Changes to Python's build process and to the C API include:
(Contributed by Mark Dickinson; :issue:`4258`.)
-* The :cfunc:`PyLong_AsUnsignedLongLong()` function now handles a negative
+* The :c:func:`PyLong_AsUnsignedLongLong()` function now handles a negative
*pylong* by raising :exc:`OverflowError` instead of :exc:`TypeError`.
(Contributed by Mark Dickinson and Lisandro Dalcrin; :issue:`5175`.)
-* Deprecated :cfunc:`PyNumber_Int`. Use :cfunc:`PyNumber_Long` instead.
+* Deprecated :c:func:`PyNumber_Int`. Use :c:func:`PyNumber_Long` instead.
(Contributed by Mark Dickinson; :issue:`4910`.)
-* Added a new :cfunc:`PyOS_string_to_double` function to replace the
- deprecated functions :cfunc:`PyOS_ascii_strtod` and :cfunc:`PyOS_ascii_atof`.
+* Added a new :c:func:`PyOS_string_to_double` function to replace the
+ deprecated functions :c:func:`PyOS_ascii_strtod` and :c:func:`PyOS_ascii_atof`.
(Contributed by Mark Dickinson; :issue:`5914`.)
-* Added :ctype:`PyCapsule` as a replacement for the :ctype:`PyCObject` API.
+* Added :c:type:`PyCapsule` as a replacement for the :c:type:`PyCObject` API.
The principal difference is that the new type has a well defined interface
for passing typing safety information and a less complicated signature
for calling a destructor. The old type had a problematic API and is now
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst
new file mode 100644
index 0000000000..d411d85ee8
--- /dev/null
+++ b/Doc/whatsnew/3.2.rst
@@ -0,0 +1,2704 @@
+****************************
+ What's New In Python 3.2
+****************************
+
+:Author: Raymond Hettinger
+:Release: |release|
+:Date: |today|
+
+.. $Id$
+ Rules for maintenance:
+
+ * Anyone can add text to this document. Do not spend very much time
+ on the wording of your changes, because your text will probably
+ get rewritten. (Note, during release candidate phase or just before
+ a beta release, please use the tracker instead -- this helps avoid
+ merge conflicts. If you must add a suggested entry directly,
+ please put it in an XXX comment and the maintainer will take notice).
+
+ * The maintainer will go through Misc/NEWS periodically and add
+ changes; it's therefore more important to add your changes to
+ Misc/NEWS than to this file.
+
+ * This is not a complete list of every single change; completeness
+ is the purpose of Misc/NEWS. Some changes I consider too small
+ or esoteric to include. If such a change is added to the text,
+ I'll just remove it. (This is another reason you shouldn't spend
+ too much time on writing your addition.)
+
+ * If you want to draw your new text to the attention of the
+ maintainer, add 'XXX' to the beginning of the paragraph or
+ section.
+
+ * It's OK to just add a fragmentary note about a change. For
+ example: "XXX Describe the transmogrify() function added to the
+ socket module." The maintainer will research the change and
+ write the necessary text.
+
+ * You can comment out your additions if you like, but it's not
+ necessary (especially when a final release is some months away).
+
+ * Credit the author of a patch or bugfix. Just the name is
+ sufficient; the e-mail address isn't necessary. It's helpful to
+ add the issue number:
+
+ XXX Describe the transmogrify() function added to the socket
+ module.
+
+ (Contributed by P.Y. Developer; :issue:`12345`.)
+
+ This saves the maintainer the effort of going through the SVN log
+ when researching a change.
+
+This article explains the new features in Python 3.2 as compared to 3.1. It
+focuses on a few highlights and gives a few examples. For full details, see the
+:source:`Misc/NEWS <Misc/NEWS>` file.
+
+.. seealso::
+
+ :pep:`392` - Python 3.2 Release Schedule
+
+
+PEP 384: Defining a Stable ABI
+==============================
+
+In the past, extension modules built for one Python version were often
+not usable with other Python versions. Particularly on Windows, every
+feature release of Python required rebuilding all extension modules that
+one wanted to use. This requirement was the result of the free access to
+Python interpreter internals that extension modules could use.
+
+With Python 3.2, an alternative approach becomes available: extension
+modules which restrict themselves to a limited API (by defining
+Py_LIMITED_API) cannot use many of the internals, but are constrained
+to a set of API functions that are promised to be stable for several
+releases. As a consequence, extension modules built for 3.2 in that
+mode will also work with 3.3, 3.4, and so on. Extension modules that
+make use of details of memory structures can still be built, but will
+need to be recompiled for every feature release.
+
+.. seealso::
+
+ :pep:`384` - Defining a Stable ABI
+ PEP written by Martin von Löwis.
+
+
+PEP 389: Argparse Command Line Parsing Module
+=============================================
+
+A new module for command line parsing, :mod:`argparse`, was introduced to
+overcome the limitations of :mod:`optparse` which did not provide support for
+positional arguments (not just options), subcommands, required options and other
+common patterns of specifying and validating options.
+
+This module has already had widespread success in the community as a
+third-party module. Being more fully featured than its predecessor, the
+:mod:`argparse` module is now the preferred module for command-line processing.
+The older module is still being kept available because of the substantial amount
+of legacy code that depends on it.
+
+Here's an annotated example parser showing features like limiting results to a
+set of choices, specifying a *metavar* in the help screen, validating that one
+or more positional arguments is present, and making a required option::
+
+ import argparse
+ parser = argparse.ArgumentParser(
+ description = 'Manage servers', # main description for help
+ epilog = 'Tested on Solaris and Linux') # displayed after help
+ parser.add_argument('action', # argument name
+ choices = ['deploy', 'start', 'stop'], # three allowed values
+ help = 'action on each target') # help msg
+ parser.add_argument('targets',
+ metavar = 'HOSTNAME', # var name used in help msg
+ nargs = '+', # require one or more targets
+ help = 'url for target machines') # help msg explanation
+ parser.add_argument('-u', '--user', # -u or --user option
+ required = True, # make it a required argument
+ help = 'login as user')
+
+Example of calling the parser on a command string::
+
+ >>> cmd = 'deploy sneezy.example.com sleepy.example.com -u skycaptain'
+ >>> result = parser.parse_args(cmd.split())
+ >>> result.action
+ 'deploy'
+ >>> result.targets
+ ['sneezy.example.com', 'sleepy.example.com']
+ >>> result.user
+ 'skycaptain'
+
+Example of the parser's automatically generated help::
+
+ >>> parser.parse_args('-h'.split())
+
+ usage: manage_cloud.py [-h] -u USER
+ {deploy,start,stop} HOSTNAME [HOSTNAME ...]
+
+ Manage servers
+
+ positional arguments:
+ {deploy,start,stop} action on each target
+ HOSTNAME url for target machines
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -u USER, --user USER login as user
+
+ Tested on Solaris and Linux
+
+An especially nice :mod:`argparse` feature is the ability to define subparsers,
+each with their own argument patterns and help displays::
+
+ import argparse
+ parser = argparse.ArgumentParser(prog='HELM')
+ subparsers = parser.add_subparsers()
+
+ parser_l = subparsers.add_parser('launch', help='Launch Control') # first subgroup
+ parser_l.add_argument('-m', '--missiles', action='store_true')
+ parser_l.add_argument('-t', '--torpedos', action='store_true')
+
+ parser_m = subparsers.add_parser('move', help='Move Vessel', # second subgroup
+ aliases=('steer', 'turn')) # equivalent names
+ parser_m.add_argument('-c', '--course', type=int, required=True)
+ parser_m.add_argument('-s', '--speed', type=int, default=0)
+
+ $ ./helm.py --help # top level help (launch and move)
+ $ ./helm.py launch --help # help for launch options
+ $ ./helm.py launch --missiles # set missiles=True and torpedos=False
+ $ ./helm.py steer --course 180 --speed 5 # set movement parameters
+
+.. seealso::
+
+ :pep:`389` - New Command Line Parsing Module
+ PEP written by Steven Bethard.
+
+ :ref:`upgrading-optparse-code` for details on the differences from :mod:`optparse`.
+
+
+PEP 391: Dictionary Based Configuration for Logging
+====================================================
+
+The :mod:`logging` module provided two kinds of configuration, one style with
+function calls for each option or another style driven by an external file saved
+in a :mod:`ConfigParser` format. Those options did not provide the flexibility
+to create configurations from JSON or YAML files, nor did they support
+incremental configuration, which is needed for specifying logger options from a
+command line.
+
+To support a more flexible style, the module now offers
+:func:`logging.config.dictConfig` for specifying logging configuration with
+plain Python dictionaries. The configuration options include formatters,
+handlers, filters, and loggers. Here's a working example of a configuration
+dictionary::
+
+ {"version": 1,
+ "formatters": {"brief": {"format": "%(levelname)-8s: %(name)-15s: %(message)s"},
+ "full": {"format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s"}
+ },
+ "handlers": {"console": {
+ "class": "logging.StreamHandler",
+ "formatter": "brief",
+ "level": "INFO",
+ "stream": "ext://sys.stdout"},
+ "console_priority": {
+ "class": "logging.StreamHandler",
+ "formatter": "full",
+ "level": "ERROR",
+ "stream": "ext://sys.stderr"}
+ },
+ "root": {"level": "DEBUG", "handlers": ["console", "console_priority"]}}
+
+
+If that dictionary is stored in a file called :file:`conf.json`, it can be
+loaded and called with code like this::
+
+ >>> import json, logging.config
+ >>> with open('conf.json') as f:
+ conf = json.load(f)
+ >>> logging.config.dictConfig(conf)
+ >>> logging.info("Transaction completed normally")
+ INFO : root : Transaction completed normally
+ >>> logging.critical("Abnormal termination")
+ 2011-02-17 11:14:36,694 root CRITICAL Abnormal termination
+
+.. seealso::
+
+ :pep:`391` - Dictionary Based Configuration for Logging
+ PEP written by Vinay Sajip.
+
+
+PEP 3148: The ``concurrent.futures`` module
+============================================
+
+Code for creating and managing concurrency is being collected in a new top-level
+namespace, *concurrent*. Its first member is a *futures* package which provides
+a uniform high-level interface for managing threads and processes.
+
+The design for :mod:`concurrent.futures` was inspired by
+*java.util.concurrent.package*. In that model, a running call and its result
+are represented by a :class:`~concurrent.futures.Future` object that abstracts
+features common to threads, processes, and remote procedure calls. That object
+supports status checks (running or done), timeouts, cancellations, adding
+callbacks, and access to results or exceptions.
+
+The primary offering of the new module is a pair of executor classes for
+launching and managing calls. The goal of the executors is to make it easier to
+use existing tools for making parallel calls. They save the effort needed to
+setup a pool of resources, launch the calls, create a results queue, add
+time-out handling, and limit the total number of threads, processes, or remote
+procedure calls.
+
+Ideally, each application should share a single executor across multiple
+components so that process and thread limits can be centrally managed. This
+solves the design challenge that arises when each component has its own
+competing strategy for resource management.
+
+Both classes share a common interface with three methods:
+:meth:`~concurrent.futures.Executor.submit` for scheduling a callable and
+returning a :class:`~concurrent.futures.Future` object;
+:meth:`~concurrent.futures.Executor.map` for scheduling many asynchronous calls
+at a time, and :meth:`~concurrent.futures.Executor.shutdown` for freeing
+resources. The class is a :term:`context manager` and can be used in a
+:keyword:`with` statement to assure that resources are automatically released
+when currently pending futures are done executing.
+
+A simple of example of :class:`~concurrent.futures.ThreadPoolExecutor` is a
+launch of four parallel threads for copying files::
+
+ import concurrent.futures, shutil
+ with concurrent.futures.ThreadPoolExecutor(max_workers=4) as e:
+ e.submit(shutil.copy, 'src1.txt', 'dest1.txt')
+ e.submit(shutil.copy, 'src2.txt', 'dest2.txt')
+ e.submit(shutil.copy, 'src3.txt', 'dest3.txt')
+ e.submit(shutil.copy, 'src4.txt', 'dest4.txt')
+
+.. seealso::
+
+ :pep:`3148` - Futures -- Execute Computations Asynchronously
+ PEP written by Brian Quinlan.
+
+ :ref:`Code for Threaded Parallel URL reads<threadpoolexecutor-example>`, an
+ example using threads to fetch multiple web pages in parallel.
+
+ :ref:`Code for computing prime numbers in
+ parallel<processpoolexecutor-example>`, an example demonstrating
+ :class:`~concurrent.futures.ProcessPoolExecutor`.
+
+
+PEP 3147: PYC Repository Directories
+=====================================
+
+Python's scheme for caching bytecode in *.pyc* files did not work well in
+environments with multiple Python interpreters. If one interpreter encountered
+a cached file created by another interpreter, it would recompile the source and
+overwrite the cached file, thus losing the benefits of caching.
+
+The issue of "pyc fights" has become more pronounced as it has become
+commonplace for Linux distributions to ship with multiple versions of Python.
+These conflicts also arise with CPython alternatives such as Unladen Swallow.
+
+To solve this problem, Python's import machinery has been extended to use
+distinct filenames for each interpreter. Instead of Python 3.2 and Python 3.3 and
+Unladen Swallow each competing for a file called "mymodule.pyc", they will now
+look for "mymodule.cpython-32.pyc", "mymodule.cpython-33.pyc", and
+"mymodule.unladen10.pyc". And to prevent all of these new files from
+cluttering source directories, the *pyc* files are now collected in a
+"__pycache__" directory stored under the package directory.
+
+Aside from the filenames and target directories, the new scheme has a few
+aspects that are visible to the programmer:
+
+* Imported modules now have a :attr:`__cached__` attribute which stores the name
+ of the actual file that was imported:
+
+ >>> import collections
+ >>> collections.__cached__
+ 'c:/py32/lib/__pycache__/collections.cpython-32.pyc'
+
+* The tag that is unique to each interpreter is accessible from the :mod:`imp`
+ module:
+
+ >>> import imp
+ >>> imp.get_tag()
+ 'cpython-32'
+
+* Scripts that try to deduce source filename from the imported file now need to
+ be smarter. It is no longer sufficient to simply strip the "c" from a ".pyc"
+ filename. Instead, use the new functions in the :mod:`imp` module:
+
+ >>> imp.source_from_cache('c:/py32/lib/__pycache__/collections.cpython-32.pyc')
+ 'c:/py32/lib/collections.py'
+ >>> imp.cache_from_source('c:/py32/lib/collections.py')
+ 'c:/py32/lib/__pycache__/collections.cpython-32.pyc'
+
+* The :mod:`py_compile` and :mod:`compileall` modules have been updated to
+ reflect the new naming convention and target directory. The command-line
+ invocation of *compileall* has new options: ``-i`` for
+ specifying a list of files and directories to compile and ``-b`` which causes
+ bytecode files to be written to their legacy location rather than
+ *__pycache__*.
+
+* The :mod:`importlib.abc` module has been updated with new :term:`abstract base
+ classes <abstract base class>` for loading bytecode files. The obsolete
+ ABCs, :class:`~importlib.abc.PyLoader` and
+ :class:`~importlib.abc.PyPycLoader`, have been deprecated (instructions on how
+ to stay Python 3.1 compatible are included with the documentation).
+
+.. seealso::
+
+ :pep:`3147` - PYC Repository Directories
+ PEP written by Barry Warsaw.
+
+
+PEP 3149: ABI Version Tagged .so Files
+======================================
+
+The PYC repository directory allows multiple bytecode cache files to be
+co-located. This PEP implements a similar mechanism for shared object files by
+giving them a common directory and distinct names for each version.
+
+The common directory is "pyshared" and the file names are made distinct by
+identifying the Python implementation (such as CPython, PyPy, Jython, etc.), the
+major and minor version numbers, and optional build flags (such as "d" for
+debug, "m" for pymalloc, "u" for wide-unicode). For an arbitrary package "foo",
+you may see these files when the distribution package is installed::
+
+ /usr/share/pyshared/foo.cpython-32m.so
+ /usr/share/pyshared/foo.cpython-33md.so
+
+In Python itself, the tags are accessible from functions in the :mod:`sysconfig`
+module::
+
+ >>> import sysconfig
+ >>> sysconfig.get_config_var('SOABI') # find the version tag
+ 'cpython-32mu'
+ >>> sysconfig.get_config_var('SO') # find the full filename extension
+ '.cpython-32mu.so'
+
+.. seealso::
+
+ :pep:`3149` - ABI Version Tagged .so Files
+ PEP written by Barry Warsaw.
+
+
+PEP 3333: Python Web Server Gateway Interface v1.0.1
+=====================================================
+
+This informational PEP clarifies how bytes/text issues are to be handled by the
+WGSI protocol. The challenge is that string handling in Python 3 is most
+conveniently handled with the :class:`str` type even though the HTTP protocol
+is itself bytes oriented.
+
+The PEP differentiates so-called *native strings* that are used for
+request/response headers and metadata versus *byte strings* which are used for
+the bodies of requests and responses.
+
+The *native strings* are always of type :class:`str` but are restricted to code
+points between *U+0000* through *U+00FF* which are translatable to bytes using
+*Latin-1* encoding. These strings are used for the keys and values in the
+environment dictionary and for response headers and statuses in the
+:func:`start_response` function. They must follow :rfc:`2616` with respect to
+encoding. That is, they must either be *ISO-8859-1* characters or use
+:rfc:`2047` MIME encoding.
+
+For developers porting WSGI applications from Python 2, here are the salient
+points:
+
+* If the app already used strings for headers in Python 2, no change is needed.
+
+* If instead, the app encoded output headers or decoded input headers, then the
+ headers will need to be re-encoded to Latin-1. For example, an output header
+ encoded in utf-8 was using ``h.encode('utf-8')`` now needs to convert from
+ bytes to native strings using ``h.encode('utf-8').decode('latin-1')``.
+
+* Values yielded by an application or sent using the :meth:`write` method
+ must be byte strings. The :func:`start_response` function and environ
+ must use native strings. The two cannot be mixed.
+
+For server implementers writing CGI-to-WSGI pathways or other CGI-style
+protocols, the users must to be able access the environment using native strings
+even though the underlying platform may have a different convention. To bridge
+this gap, the :mod:`wsgiref` module has a new function,
+:func:`wsgiref.handlers.read_environ` for transcoding CGI variables from
+:attr:`os.environ` into native strings and returning a new dictionary.
+
+.. seealso::
+
+ :pep:`3333` - Python Web Server Gateway Interface v1.0.1
+ PEP written by Phillip Eby.
+
+
+Other Language Changes
+======================
+
+Some smaller changes made to the core Python language are:
+
+* String formatting for :func:`format` and :meth:`str.format` gained new
+ capabilities for the format character **#**. Previously, for integers in
+ binary, octal, or hexadecimal, it caused the output to be prefixed with '0b',
+ '0o', or '0x' respectively. Now it can also handle floats, complex, and
+ Decimal, causing the output to always have a decimal point even when no digits
+ follow it.
+
+ >>> format(20, '#o')
+ '0o24'
+ >>> format(12.34, '#5.0f')
+ ' 12.'
+
+ (Suggested by Mark Dickinson and implemented by Eric Smith in :issue:`7094`.)
+
+* There is also a new :meth:`str.format_map` method that extends the
+ capabilities of the existing :meth:`str.format` method by accepting arbitrary
+ :term:`mapping` objects. This new method makes it possible to use string
+ formatting with any of Python's many dictionary-like objects such as
+ :class:`~collections.defaultdict`, :class:`~shelve.Shelf`,
+ :class:`~configparser.ConfigParser`, or :mod:`dbm`. It is also useful with
+ custom :class:`dict` subclasses that normalize keys before look-up or that
+ supply a :meth:`__missing__` method for unknown keys::
+
+ >>> import shelve
+ >>> d = shelve.open('tmp.shl')
+ >>> 'The {project_name} status is {status} as of {date}'.format_map(d)
+ 'The testing project status is green as of February 15, 2011'
+
+ >>> class LowerCasedDict(dict):
+ def __getitem__(self, key):
+ return dict.__getitem__(self, key.lower())
+ >>> lcd = LowerCasedDict(part='widgets', quantity=10)
+ >>> 'There are {QUANTITY} {Part} in stock'.format_map(lcd)
+ 'There are 10 widgets in stock'
+
+ >>> class PlaceholderDict(dict):
+ def __missing__(self, key):
+ return '<{}>'.format(key)
+ >>> 'Hello {name}, welcome to {location}'.format_map(PlaceholderDict())
+ 'Hello <name>, welcome to <location>'
+
+ (Suggested by Raymond Hettinger and implemented by Eric Smith in
+ :issue:`6081`.)
+
+* The interpreter can now be started with a quiet option, ``-q``, to prevent
+ the copyright and version information from being displayed in the interactive
+ mode. The option can be introspected using the :attr:`sys.flags` attribute::
+
+ $ python -q
+ >>> sys.flags
+ sys.flags(debug=0, division_warning=0, inspect=0, interactive=0,
+ optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0,
+ ignore_environment=0, verbose=0, bytes_warning=0, quiet=1)
+
+ (Contributed by Marcin Wojdyr in :issue:`1772833`).
+
+* The :func:`hasattr` function works by calling :func:`getattr` and detecting
+ whether an exception is raised. This technique allows it to detect methods
+ created dynamically by :meth:`__getattr__` or :meth:`__getattribute__` which
+ would otherwise be absent from the class dictionary. Formerly, *hasattr*
+ would catch any exception, possibly masking genuine errors. Now, *hasattr*
+ has been tightened to only catch :exc:`AttributeError` and let other
+ exceptions pass through::
+
+ >>> class A:
+ @property
+ def f(self):
+ return 1 // 0
+
+ >>> a = A()
+ >>> hasattr(a, 'f')
+ Traceback (most recent call last):
+ ...
+ ZeroDivisionError: integer division or modulo by zero
+
+ (Discovered by Yury Selivanov and fixed by Benjamin Peterson; :issue:`9666`.)
+
+* The :func:`str` of a float or complex number is now the same as its
+ :func:`repr`. Previously, the :func:`str` form was shorter but that just
+ caused confusion and is no longer needed now that the shortest possible
+ :func:`repr` is displayed by default:
+
+ >>> import math
+ >>> repr(math.pi)
+ '3.141592653589793'
+ >>> str(math.pi)
+ '3.141592653589793'
+
+ (Proposed and implemented by Mark Dickinson; :issue:`9337`.)
+
+* :class:`memoryview` objects now have a :meth:`~memoryview.release()` method
+ and they also now support the context manager protocol. This allows timely
+ release of any resources that were acquired when requesting a buffer from the
+ original object.
+
+ >>> with memoryview(b'abcdefgh') as v:
+ print(v.tolist())
+ [97, 98, 99, 100, 101, 102, 103, 104]
+
+ (Added by Antoine Pitrou; :issue:`9757`.)
+
+* Previously it was illegal to delete a name from the local namespace if it
+ occurs as a free variable in a nested block::
+
+ def outer(x):
+ def inner():
+ return x
+ inner()
+ del x
+
+ This is now allowed. Remember that the target of an :keyword:`except` clause
+ is cleared, so this code which used to work with Python 2.6, raised a
+ :exc:`SyntaxError` with Python 3.1 and now works again::
+
+ def f():
+ def print_error():
+ print(e)
+ try:
+ something
+ except Exception as e:
+ print_error()
+ # implicit "del e" here
+
+ (See :issue:`4617`.)
+
+* The internal :c:type:`structsequence` tool now creates subclasses of tuple.
+ This means that C structures like those returned by :func:`os.stat`,
+ :func:`time.gmtime`, and :attr:`sys.version_info` now work like a
+ :term:`named tuple` and now work with functions and methods that
+ expect a tuple as an argument. This is a big step forward in making the C
+ structures as flexible as their pure Python counterparts:
+
+ >>> isinstance(sys.version_info, tuple)
+ True
+ >>> 'Version %d.%d.%d %s(%d)' % sys.version_info
+ 'Version 3.2.0 final(0)'
+
+ (Suggested by Arfrever Frehtes Taifersar Arahesis and implemented
+ by Benjamin Peterson in :issue:`8413`.)
+
+* Warnings are now easier to control using the :envvar:`PYTHONWARNINGS`
+ environment variable as an alternative to using ``-W`` at the command line::
+
+ $ export PYTHONWARNINGS='ignore::RuntimeWarning::,once::UnicodeWarning::'
+
+ (Suggested by Barry Warsaw and implemented by Philip Jenvey in :issue:`7301`.)
+
+* A new warning category, :exc:`ResourceWarning`, has been added. It is
+ emitted when potential issues with resource consumption or cleanup
+ are detected. It is silenced by default in normal release builds but
+ can be enabled through the means provided by the :mod:`warnings`
+ module, or on the command line.
+
+ A :exc:`ResourceWarning` is issued at interpreter shutdown if the
+ :data:`gc.garbage` list isn't empty, and if :attr:`gc.DEBUG_UNCOLLECTABLE` is
+ set, all uncollectable objects are printed. This is meant to make the
+ programmer aware that their code contains object finalization issues.
+
+ A :exc:`ResourceWarning` is also issued when a :term:`file object` is destroyed
+ without having been explicitly closed. While the deallocator for such
+ object ensures it closes the underlying operating system resource
+ (usually, a file descriptor), the delay in deallocating the object could
+ produce various issues, especially under Windows. Here is an example
+ of enabling the warning from the command line::
+
+ $ python -q -Wdefault
+ >>> f = open("foo", "wb")
+ >>> del f
+ __main__:1: ResourceWarning: unclosed file <_io.BufferedWriter name='foo'>
+
+ (Added by Antoine Pitrou and Georg Brandl in :issue:`10093` and :issue:`477863`.)
+
+* :class:`range` objects now support *index* and *count* methods. This is part
+ of an effort to make more objects fully implement the
+ :class:`collections.Sequence` :term:`abstract base class`. As a result, the
+ language will have a more uniform API. In addition, :class:`range` objects
+ now support slicing and negative indices, even with values larger than
+ :attr:`sys.maxsize`. This makes *range* more interoperable with lists::
+
+ >>> range(0, 100, 2).count(10)
+ 1
+ >>> range(0, 100, 2).index(10)
+ 5
+ >>> range(0, 100, 2)[5]
+ 10
+ >>> range(0, 100, 2)[0:5]
+ range(0, 10, 2)
+
+ (Contributed by Daniel Stutzbach in :issue:`9213`, by Alexander Belopolsky
+ in :issue:`2690`, and by Nick Coghlan in :issue:`10889`.)
+
+* The :func:`callable` builtin function from Py2.x was resurrected. It provides
+ a concise, readable alternative to using an :term:`abstract base class` in an
+ expression like ``isinstance(x, collections.Callable)``:
+
+ >>> callable(max)
+ True
+ >>> callable(20)
+ False
+
+ (See :issue:`10518`.)
+
+* Python's import mechanism can now load modules installed in directories with
+ non-ASCII characters in the path name. This solved an aggravating problem
+ with home directories for users with non-ASCII characters in their usernames.
+
+ (Required extensive work by Victor Stinner in :issue:`9425`.)
+
+
+New, Improved, and Deprecated Modules
+=====================================
+
+Python's standard library has undergone significant maintenance efforts and
+quality improvements.
+
+The biggest news for Python 3.2 is that the :mod:`email` package, :mod:`mailbox`
+module, and :mod:`nntplib` modules now work correctly with the bytes/text model
+in Python 3. For the first time, there is correct handling of messages with
+mixed encodings.
+
+Throughout the standard library, there has been more careful attention to
+encodings and text versus bytes issues. In particular, interactions with the
+operating system are now better able to exchange non-ASCII data using the
+Windows MBCS encoding, locale-aware encodings, or UTF-8.
+
+Another significant win is the addition of substantially better support for
+*SSL* connections and security certificates.
+
+In addition, more classes now implement a :term:`context manager` to support
+convenient and reliable resource clean-up using a :keyword:`with` statement.
+
+email
+-----
+
+The usability of the :mod:`email` package in Python 3 has been mostly fixed by
+the extensive efforts of R. David Murray. The problem was that emails are
+typically read and stored in the form of :class:`bytes` rather than :class:`str`
+text, and they may contain multiple encodings within a single email. So, the
+email package had to be extended to parse and generate email messages in bytes
+format.
+
+* New functions :func:`~email.message_from_bytes` and
+ :func:`~email.message_from_binary_file`, and new classes
+ :class:`~email.parser.BytesFeedParser` and :class:`~email.parser.BytesParser`
+ allow binary message data to be parsed into model objects.
+
+* Given bytes input to the model, :meth:`~email.message.Message.get_payload`
+ will by default decode a message body that has a
+ :mailheader:`Content-Transfer-Encoding` of *8bit* using the charset
+ specified in the MIME headers and return the resulting string.
+
+* Given bytes input to the model, :class:`~email.generator.Generator` will
+ convert message bodies that have a :mailheader:`Content-Transfer-Encoding` of
+ *8bit* to instead have a *7bit* :mailheader:`Content-Transfer-Encoding`.
+
+ Headers with unencoded non-ASCII bytes are deemed to be :rfc:`2047`\ -encoded
+ using the *unknown-8bit* character set.
+
+* A new class :class:`~email.generator.BytesGenerator` produces bytes as output,
+ preserving any unchanged non-ASCII data that was present in the input used to
+ build the model, including message bodies with a
+ :mailheader:`Content-Transfer-Encoding` of *8bit*.
+
+* The :mod:`smtplib` :class:`~smtplib.SMTP` class now accepts a byte string
+ for the *msg* argument to the :meth:`~smtplib.SMTP.sendmail` method,
+ and a new method, :meth:`~smtplib.SMTP.send_message` accepts a
+ :class:`~email.message.Message` object and can optionally obtain the
+ *from_addr* and *to_addrs* addresses directly from the object.
+
+(Proposed and implemented by R. David Murray, :issue:`4661` and :issue:`10321`.)
+
+elementtree
+-----------
+
+The :mod:`xml.etree.ElementTree` package and its :mod:`xml.etree.cElementTree`
+counterpart have been updated to version 1.3.
+
+Several new and useful functions and methods have been added:
+
+* :func:`xml.etree.ElementTree.fromstringlist` which builds an XML document
+ from a sequence of fragments
+* :func:`xml.etree.ElementTree.register_namespace` for registering a global
+ namespace prefix
+* :func:`xml.etree.ElementTree.tostringlist` for string representation
+ including all sublists
+* :meth:`xml.etree.ElementTree.Element.extend` for appending a sequence of zero
+ or more elements
+* :meth:`xml.etree.ElementTree.Element.iterfind` searches an element and
+ subelements
+* :meth:`xml.etree.ElementTree.Element.itertext` creates a text iterator over
+ an element and its subelements
+* :meth:`xml.etree.ElementTree.TreeBuilder.end` closes the current element
+* :meth:`xml.etree.ElementTree.TreeBuilder.doctype` handles a doctype
+ declaration
+
+Two methods have been deprecated:
+
+* :meth:`xml.etree.ElementTree.getchildren` use ``list(elem)`` instead.
+* :meth:`xml.etree.ElementTree.getiterator` use ``Element.iter`` instead.
+
+For details of the update, see `Introducing ElementTree
+<http://effbot.org/zone/elementtree-13-intro.htm>`_ on Fredrik Lundh's website.
+
+(Contributed by Florent Xicluna and Fredrik Lundh, :issue:`6472`.)
+
+functools
+---------
+
+* The :mod:`functools` module includes a new decorator for caching function
+ calls. :func:`functools.lru_cache` can save repeated queries to an external
+ resource whenever the results are expected to be the same.
+
+ For example, adding a caching decorator to a database query function can save
+ database accesses for popular searches:
+
+ >>> import functools
+ >>> @functools.lru_cache(maxsize=300)
+ >>> def get_phone_number(name):
+ c = conn.cursor()
+ c.execute('SELECT phonenumber FROM phonelist WHERE name=?', (name,))
+ return c.fetchone()[0]
+
+ >>> for name in user_requests:
+ get_phone_number(name) # cached lookup
+
+ To help with choosing an effective cache size, the wrapped function is
+ instrumented for tracking cache statistics:
+
+ >>> get_phone_number.cache_info()
+ CacheInfo(hits=4805, misses=980, maxsize=300, currsize=300)
+
+ If the phonelist table gets updated, the outdated contents of the cache can be
+ cleared with:
+
+ >>> get_phone_number.cache_clear()
+
+ (Contributed by Raymond Hettinger and incorporating design ideas from Jim
+ Baker, Miki Tebeka, and Nick Coghlan; see `recipe 498245
+ <http://code.activestate.com/recipes/498245>`_\, `recipe 577479
+ <http://code.activestate.com/recipes/577479>`_\, :issue:`10586`, and
+ :issue:`10593`.)
+
+* The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` attribute
+ pointing to the original callable function. This allows wrapped functions to
+ be introspected. It also copies :attr:`__annotations__` if defined. And now
+ it also gracefully skips over missing attributes such as :attr:`__doc__` which
+ might not be defined for the wrapped callable.
+
+ In the above example, the cache can be removed by recovering the original
+ function:
+
+ >>> get_phone_number = get_phone_number.__wrapped__ # uncached function
+
+ (By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and
+ :issue:`8814`.)
+
+* To help write classes with rich comparison methods, a new decorator
+ :func:`functools.total_ordering` will use a existing equality and inequality
+ methods to fill in the remaining methods.
+
+ For example, supplying *__eq__* and *__lt__* will enable
+ :func:`~functools.total_ordering` to fill-in *__le__*, *__gt__* and *__ge__*::
+
+ @total_ordering
+ class Student:
+ def __eq__(self, other):
+ return ((self.lastname.lower(), self.firstname.lower()) ==
+ (other.lastname.lower(), other.firstname.lower()))
+ def __lt__(self, other):
+ return ((self.lastname.lower(), self.firstname.lower()) <
+ (other.lastname.lower(), other.firstname.lower()))
+
+ With the *total_ordering* decorator, the remaining comparison methods
+ are filled in automatically.
+
+ (Contributed by Raymond Hettinger.)
+
+* To aid in porting programs from Python 2, the :func:`functools.cmp_to_key`
+ function converts an old-style comparison function to
+ modern :term:`key function`:
+
+ >>> # locale-aware sort order
+ >>> sorted(iterable, key=cmp_to_key(locale.strcoll))
+
+ For sorting examples and a brief sorting tutorial, see the `Sorting HowTo
+ <http://wiki.python.org/moin/HowTo/Sorting/>`_ tutorial.
+
+ (Contributed by Raymond Hettinger.)
+
+itertools
+---------
+
+* The :mod:`itertools` module has a new :func:`~itertools.accumulate` function
+ modeled on APL's *scan* operator and Numpy's *accumulate* function:
+
+ >>> from itertools import accumulate
+ >>> list(accumulate([8, 2, 50]))
+ [8, 10, 60]
+
+ >>> prob_dist = [0.1, 0.4, 0.2, 0.3]
+ >>> list(accumulate(prob_dist)) # cumulative probability distribution
+ [0.1, 0.5, 0.7, 1.0]
+
+ For an example using :func:`~itertools.accumulate`, see the :ref:`examples for
+ the random module <random-examples>`.
+
+ (Contributed by Raymond Hettinger and incorporating design suggestions
+ from Mark Dickinson.)
+
+collections
+-----------
+
+* The :class:`collections.Counter` class now has two forms of in-place
+ subtraction, the existing *-=* operator for `saturating subtraction
+ <http://en.wikipedia.org/wiki/Saturation_arithmetic>`_ and the new
+ :meth:`~collections.Counter.subtract` method for regular subtraction. The
+ former is suitable for `multisets <http://en.wikipedia.org/wiki/Multiset>`_
+ which only have positive counts, and the latter is more suitable for use cases
+ that allow negative counts:
+
+ >>> tally = Counter(dogs=5, cat=3)
+ >>> tally -= Counter(dogs=2, cats=8) # saturating subtraction
+ >>> tally
+ Counter({'dogs': 3})
+
+ >>> tally = Counter(dogs=5, cats=3)
+ >>> tally.subtract(dogs=2, cats=8) # regular subtraction
+ >>> tally
+ Counter({'dogs': 3, 'cats': -5})
+
+ (Contributed by Raymond Hettinger.)
+
+* The :class:`collections.OrderedDict` class has a new method
+ :meth:`~collections.OrderedDict.move_to_end` which takes an existing key and
+ moves it to either the first or last position in the ordered sequence.
+
+ The default is to move an item to the last position. This is equivalent of
+ renewing an entry with ``od[k] = od.pop(k)``.
+
+ A fast move-to-end operation is useful for resequencing entries. For example,
+ an ordered dictionary can be used to track order of access by aging entries
+ from the oldest to the most recently accessed.
+
+ >>> d = OrderedDict.fromkeys(['a', 'b', 'X', 'd', 'e'])
+ >>> list(d)
+ ['a', 'b', 'X', 'd', 'e']
+ >>> d.move_to_end('X')
+ >>> list(d)
+ ['a', 'b', 'd', 'e', 'X']
+
+ (Contributed by Raymond Hettinger.)
+
+* The :class:`collections.deque` class grew two new methods
+ :meth:`~collections.deque.count` and :meth:`~collections.deque.reverse` that
+ make them more substitutable for :class:`list` objects:
+
+ >>> d = deque('simsalabim')
+ >>> d.count('s')
+ 2
+ >>> d.reverse()
+ >>> d
+ deque(['m', 'i', 'b', 'a', 'l', 'a', 's', 'm', 'i', 's'])
+
+ (Contributed by Raymond Hettinger.)
+
+threading
+---------
+
+The :mod:`threading` module has a new :class:`~threading.Barrier`
+synchronization class for making multiple threads wait until all of them have
+reached a common barrier point. Barriers are useful for making sure that a task
+with multiple preconditions does not run until all of the predecessor tasks are
+complete.
+
+Barriers can work with an arbitrary number of threads. This is a generalization
+of a `Rendezvous <http://en.wikipedia.org/wiki/Synchronous_rendezvous>`_ which
+is defined for only two threads.
+
+Implemented as a two-phase cyclic barrier, :class:`~threading.Barrier` objects
+are suitable for use in loops. The separate *filling* and *draining* phases
+assure that all threads get released (drained) before any one of them can loop
+back and re-enter the barrier. The barrier fully resets after each cycle.
+
+Example of using barriers::
+
+ from threading import Barrier, Thread
+
+ def get_votes(site):
+ ballots = conduct_election(site)
+ all_polls_closed.wait() # do not count until all polls are closed
+ totals = summarize(ballots)
+ publish(site, totals)
+
+ all_polls_closed = Barrier(len(sites))
+ for site in sites:
+ Thread(target=get_votes, args=(site,)).start()
+
+In this example, the barrier enforces a rule that votes cannot be counted at any
+polling site until all polls are closed. Notice how a solution with a barrier
+is similar to one with :meth:`threading.Thread.join`, but the threads stay alive
+and continue to do work (summarizing ballots) after the barrier point is
+crossed.
+
+If any of the predecessor tasks can hang or be delayed, a barrier can be created
+with an optional *timeout* parameter. Then if the timeout period elapses before
+all the predecessor tasks reach the barrier point, all waiting threads are
+released and a :exc:`~threading.BrokenBarrierError` exception is raised::
+
+ def get_votes(site):
+ ballots = conduct_election(site)
+ try:
+ all_polls_closed.wait(timeout = midnight - time.now())
+ except BrokenBarrierError:
+ lockbox = seal_ballots(ballots)
+ queue.put(lockbox)
+ else:
+ totals = summarize(ballots)
+ publish(site, totals)
+
+In this example, the barrier enforces a more robust rule. If some election
+sites do not finish before midnight, the barrier times-out and the ballots are
+sealed and deposited in a queue for later handling.
+
+See `Barrier Synchronization Patterns
+<http://parlab.eecs.berkeley.edu/wiki/_media/patterns/paraplop_g1_3.pdf>`_ for
+more examples of how barriers can be used in parallel computing. Also, there is
+a simple but thorough explanation of barriers in `The Little Book of Semaphores
+<http://greenteapress.com/semaphores/downey08semaphores.pdf>`_, *section 3.6*.
+
+(Contributed by Kristján Valur Jónsson with an API review by Jeffrey Yasskin in
+:issue:`8777`.)
+
+datetime and time
+-----------------
+
+* The :mod:`datetime` module has a new type :class:`~datetime.timezone` that
+ implements the :class:`~datetime.tzinfo` interface by returning a fixed UTC
+ offset and timezone name. This makes it easier to create timezone-aware
+ datetime objects::
+
+ >>> from datetime import datetime, timezone
+
+ >>> datetime.now(timezone.utc)
+ datetime.datetime(2010, 12, 8, 21, 4, 2, 923754, tzinfo=datetime.timezone.utc)
+
+ >>> datetime.strptime("01/01/2000 12:00 +0000", "%m/%d/%Y %H:%M %z")
+ datetime.datetime(2000, 1, 1, 12, 0, tzinfo=datetime.timezone.utc)
+
+* Also, :class:`~datetime.timedelta` objects can now be multiplied by
+ :class:`float` and divided by :class:`float` and :class:`int` objects.
+ And :class:`~datetime.timedelta` objects can now divide one another.
+
+* The :meth:`datetime.date.strftime` method is no longer restricted to years
+ after 1900. The new supported year range is from 1000 to 9999 inclusive.
+
+* Whenever a two-digit year is used in a time tuple, the interpretation has been
+ governed by :attr:`time.accept2dyear`. The default is *True* which means that
+ for a two-digit year, the century is guessed according to the POSIX rules
+ governing the ``%y`` strptime format.
+
+ Starting with Py3.2, use of the century guessing heuristic will emit a
+ :exc:`DeprecationWarning`. Instead, it is recommended that
+ :attr:`time.accept2dyear` be set to *False* so that large date ranges
+ can be used without guesswork::
+
+ >>> import time, warnings
+ >>> warnings.resetwarnings() # remove the default warning filters
+
+ >>> time.accept2dyear = True # guess whether 11 means 11 or 2011
+ >>> time.asctime((11, 1, 1, 12, 34, 56, 4, 1, 0))
+ Warning (from warnings module):
+ ...
+ DeprecationWarning: Century info guessed for a 2-digit year.
+ 'Fri Jan 1 12:34:56 2011'
+
+ >>> time.accept2dyear = False # use the full range of allowable dates
+ >>> time.asctime((11, 1, 1, 12, 34, 56, 4, 1, 0))
+ 'Fri Jan 1 12:34:56 11'
+
+ Several functions now have significantly expanded date ranges. When
+ :attr:`time.accept2dyear` is false, the :func:`time.asctime` function will
+ accept any year that fits in a C int, while the :func:`time.mktime` and
+ :func:`time.strftime` functions will accept the full range supported by the
+ corresponding operating system functions.
+
+(Contributed by Alexander Belopolsky and Victor Stinner in :issue:`1289118`,
+:issue:`5094`, :issue:`6641`, :issue:`2706`, :issue:`1777412`, :issue:`8013`,
+and :issue:`10827`.)
+
+.. XXX http://bugs.python.org/issue?%40search_text=datetime&%40sort=-activity
+
+math
+----
+
+The :mod:`math` module has been updated with six new functions inspired by the
+C99 standard.
+
+The :func:`~math.isfinite` function provides a reliable and fast way to detect
+special values. It returns *True* for regular numbers and *False* for *Nan* or
+*Infinity*:
+
+>>> [isfinite(x) for x in (123, 4.56, float('Nan'), float('Inf'))]
+[True, True, False, False]
+
+The :func:`~math.expm1` function computes ``e**x-1`` for small values of *x*
+without incurring the loss of precision that usually accompanies the subtraction
+of nearly equal quantities:
+
+>>> expm1(0.013671875) # more accurate way to compute e**x-1 for a small x
+0.013765762467652909
+
+The :func:`~math.erf` function computes a probability integral or `Gaussian
+error function <http://en.wikipedia.org/wiki/Error_function>`_. The
+complementary error function, :func:`~math.erfc`, is ``1 - erf(x)``:
+
+>>> erf(1.0/sqrt(2.0)) # portion of normal distribution within 1 standard deviation
+0.682689492137086
+>>> erfc(1.0/sqrt(2.0)) # portion of normal distribution outside 1 standard deviation
+0.31731050786291404
+>>> erf(1.0/sqrt(2.0)) + erfc(1.0/sqrt(2.0))
+1.0
+
+The :func:`~math.gamma` function is a continuous extension of the factorial
+function. See http://en.wikipedia.org/wiki/Gamma_function for details. Because
+the function is related to factorials, it grows large even for small values of
+*x*, so there is also a :func:`~math.lgamma` function for computing the natural
+logarithm of the gamma function:
+
+>>> gamma(7.0) # six factorial
+720.0
+>>> lgamma(801.0) # log(800 factorial)
+4551.950730698041
+
+(Contributed by Mark Dickinson.)
+
+abc
+---
+
+The :mod:`abc` module now supports :func:`~abc.abstractclassmethod` and
+:func:`~abc.abstractstaticmethod`.
+
+These tools make it possible to define an :term:`abstract base class` that
+requires a particular :func:`classmethod` or :func:`staticmethod` to be
+implemented::
+
+ class Temperature(metaclass=abc.ABCMeta):
+ @abc.abstractclassmethod
+ def from_fahrenheit(cls, t):
+ ...
+ @abc.abstractclassmethod
+ def from_celsius(cls, t):
+ ...
+
+(Patch submitted by Daniel Urban; :issue:`5867`.)
+
+io
+--
+
+The :class:`io.BytesIO` has a new method, :meth:`~io.BytesIO.getbuffer`, which
+provides functionality similar to :func:`memoryview`. It creates an editable
+view of the data without making a copy. The buffer's random access and support
+for slice notation are well-suited to in-place editing::
+
+ >>> REC_LEN, LOC_START, LOC_LEN = 34, 7, 11
+
+ >>> def change_location(buffer, record_number, location):
+ start = record_number * REC_LEN + LOC_START
+ buffer[start: start+LOC_LEN] = location
+
+ >>> import io
+
+ >>> byte_stream = io.BytesIO(
+ b'G3805 storeroom Main chassis '
+ b'X7899 shipping Reserve cog '
+ b'L6988 receiving Primary sprocket'
+ )
+ >>> buffer = byte_stream.getbuffer()
+ >>> change_location(buffer, 1, b'warehouse ')
+ >>> change_location(buffer, 0, b'showroom ')
+ >>> print(byte_stream.getvalue())
+ b'G3805 showroom Main chassis '
+ b'X7899 warehouse Reserve cog '
+ b'L6988 receiving Primary sprocket'
+
+(Contributed by Antoine Pitrou in :issue:`5506`.)
+
+reprlib
+-------
+
+When writing a :meth:`__repr__` method for a custom container, it is easy to
+forget to handle the case where a member refers back to the container itself.
+Python's builtin objects such as :class:`list` and :class:`set` handle
+self-reference by displaying "..." in the recursive part of the representation
+string.
+
+To help write such :meth:`__repr__` methods, the :mod:`reprlib` module has a new
+decorator, :func:`~reprlib.recursive_repr`, for detecting recursive calls to
+:meth:`__repr__` and substituting a placeholder string instead::
+
+ >>> class MyList(list):
+ @recursive_repr()
+ def __repr__(self):
+ return '<' + '|'.join(map(repr, self)) + '>'
+
+ >>> m = MyList('abc')
+ >>> m.append(m)
+ >>> m.append('x')
+ >>> print(m)
+ <'a'|'b'|'c'|...|'x'>
+
+(Contributed by Raymond Hettinger in :issue:`9826` and :issue:`9840`.)
+
+logging
+-------
+
+In addition to dictionary-based configuration described above, the
+:mod:`logging` package has many other improvements.
+
+The logging documentation has been augmented by a :ref:`basic tutorial
+<logging-basic-tutorial>`\, an :ref:`advanced tutorial
+<logging-advanced-tutorial>`\, and a :ref:`cookbook <logging-cookbook>` of
+logging recipes. These documents are the fastest way to learn about logging.
+
+The :func:`logging.basicConfig` set-up function gained a *style* argument to
+support three different types of string formatting. It defaults to "%" for
+traditional %-formatting, can be set to "{" for the new :meth:`str.format` style, or
+can be set to "$" for the shell-style formatting provided by
+:class:`string.Template`. The following three configurations are equivalent::
+
+ >>> from logging import basicConfig
+ >>> basicConfig(style='%', format="%(name)s -> %(levelname)s: %(message)s")
+ >>> basicConfig(style='{', format="{name} -> {levelname} {message}")
+ >>> basicConfig(style='$', format="$name -> $levelname: $message")
+
+If no configuration is set-up before a logging event occurs, there is now a
+default configuration using a :class:`~logging.StreamHandler` directed to
+:attr:`sys.stderr` for events of ``WARNING`` level or higher. Formerly, an
+event occurring before a configuration was set-up would either raise an
+exception or silently drop the event depending on the value of
+:attr:`logging.raiseExceptions`. The new default handler is stored in
+:attr:`logging.lastResort`.
+
+The use of filters has been simplified. Instead of creating a
+:class:`~logging.Filter` object, the predicate can be any Python callable that
+returns *True* or *False*.
+
+There were a number of other improvements that add flexibility and simplify
+configuration. See the module documentation for a full listing of changes in
+Python 3.2.
+
+csv
+---
+
+The :mod:`csv` module now supports a new dialect, :class:`~csv.unix_dialect`,
+which applies quoting for all fields and a traditional Unix style with ``'\n'`` as
+the line terminator. The registered dialect name is ``unix``.
+
+The :class:`csv.DictWriter` has a new method,
+:meth:`~csv.DictWriter.writeheader` for writing-out an initial row to document
+the field names::
+
+ >>> import csv, sys
+ >>> w = csv.DictWriter(sys.stdout, ['name', 'dept'], dialect='unix')
+ >>> w.writeheader()
+ "name","dept"
+ >>> w.writerows([
+ {'name': 'tom', 'dept': 'accounting'},
+ {'name': 'susan', 'dept': 'Salesl'}])
+ "tom","accounting"
+ "susan","sales"
+
+(New dialect suggested by Jay Talbot in :issue:`5975`, and the new method
+suggested by Ed Abraham in :issue:`1537721`.)
+
+contextlib
+----------
+
+There is a new and slightly mind-blowing tool
+:class:`~contextlib.ContextDecorator` that is helpful for creating a
+:term:`context manager` that does double duty as a function decorator.
+
+As a convenience, this new functionality is used by
+:func:`~contextlib.contextmanager` so that no extra effort is needed to support
+both roles.
+
+The basic idea is that both context managers and function decorators can be used
+for pre-action and post-action wrappers. Context managers wrap a group of
+statements using a :keyword:`with` statement, and function decorators wrap a
+group of statements enclosed in a function. So, occasionally there is a need to
+write a pre-action or post-action wrapper that can be used in either role.
+
+For example, it is sometimes useful to wrap functions or groups of statements
+with a logger that can track the time of entry and time of exit. Rather than
+writing both a function decorator and a context manager for the task, the
+:func:`~contextlib.contextmanager` provides both capabilities in a single
+definition::
+
+ from contextlib import contextmanager
+ import logging
+
+ logging.basicConfig(level=logging.INFO)
+
+ @contextmanager
+ def track_entry_and_exit(name):
+ logging.info('Entering: {}'.format(name))
+ yield
+ logging.info('Exiting: {}'.format(name))
+
+Formerly, this would have only been usable as a context manager::
+
+ with track_entry_and_exit('widget loader'):
+ print('Some time consuming activity goes here')
+ load_widget()
+
+Now, it can be used as a decorator as well::
+
+ @track_entry_and_exit('widget loader')
+ def activity():
+ print('Some time consuming activity goes here')
+ load_widget()
+
+Trying to fulfill two roles at once places some limitations on the technique.
+Context managers normally have the flexibility to return an argument usable by
+a :keyword:`with` statement, but there is no parallel for function decorators.
+
+In the above example, there is not a clean way for the *track_entry_and_exit*
+context manager to return a logging instance for use in the body of enclosed
+statements.
+
+(Contributed by Michael Foord in :issue:`9110`.)
+
+decimal and fractions
+---------------------
+
+Mark Dickinson crafted an elegant and efficient scheme for assuring that
+different numeric datatypes will have the same hash value whenever their actual
+values are equal (:issue:`8188`)::
+
+ assert hash(Fraction(3, 2)) == hash(1.5) == \
+ hash(Decimal("1.5")) == hash(complex(1.5, 0))
+
+Some of the hashing details are exposed through a new attribute,
+:attr:`sys.hash_info`, which describes the bit width of the hash value, the
+prime modulus, the hash values for *infinity* and *nan*, and the multiplier
+used for the imaginary part of a number:
+
+>>> sys.hash_info
+sys.hash_info(width=64, modulus=2305843009213693951, inf=314159, nan=0, imag=1000003)
+
+An early decision to limit the inter-operability of various numeric types has
+been relaxed. It is still unsupported (and ill-advised) to have implicit
+mixing in arithmetic expressions such as ``Decimal('1.1') + float('1.1')``
+because the latter loses information in the process of constructing the binary
+float. However, since existing floating point value can be converted losslessly
+to either a decimal or rational representation, it makes sense to add them to
+the constructor and to support mixed-type comparisons.
+
+* The :class:`decimal.Decimal` constructor now accepts :class:`float` objects
+ directly so there in no longer a need to use the :meth:`~decimal.Decimal.from_float`
+ method (:issue:`8257`).
+
+* Mixed type comparisons are now fully supported so that
+ :class:`~decimal.Decimal` objects can be directly compared with :class:`float`
+ and :class:`fractions.Fraction` (:issue:`2531` and :issue:`8188`).
+
+Similar changes were made to :class:`fractions.Fraction` so that the
+:meth:`~fractions.Fraction.from_float()` and :meth:`~fractions.Fraction.from_decimal`
+methods are no longer needed (:issue:`8294`):
+
+>>> Decimal(1.1)
+Decimal('1.100000000000000088817841970012523233890533447265625')
+>>> Fraction(1.1)
+Fraction(2476979795053773, 2251799813685248)
+
+Another useful change for the :mod:`decimal` module is that the
+:attr:`Context.clamp` attribute is now public. This is useful in creating
+contexts that correspond to the decimal interchange formats specified in IEEE
+754 (see :issue:`8540`).
+
+(Contributed by Mark Dickinson and Raymond Hettinger.)
+
+ftp
+---
+
+The :class:`ftplib.FTP` class now supports the context manager protocol to
+unconditionally consume :exc:`socket.error` exceptions and to close the FTP
+connection when done::
+
+ >>> from ftplib import FTP
+ >>> with FTP("ftp1.at.proftpd.org") as ftp:
+ ftp.login()
+ ftp.dir()
+
+ '230 Anonymous login ok, restrictions apply.'
+ dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 .
+ dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 ..
+ dr-xr-xr-x 5 ftp ftp 4096 May 6 10:43 CentOS
+ dr-xr-xr-x 3 ftp ftp 18 Jul 10 2008 Fedora
+
+Other file-like objects such as :class:`mmap.mmap` and :func:`fileinput.input`
+also grew auto-closing context managers::
+
+ with fileinput.input(files=('log1.txt', 'log2.txt')) as f:
+ for line in f:
+ process(line)
+
+(Contributed by Tarek Ziadé and Giampaolo Rodolà in :issue:`4972`, and
+by Georg Brandl in :issue:`8046` and :issue:`1286`.)
+
+The :class:`~ftplib.FTP_TLS` class now accepts a *context* parameter, which is a
+:class:`ssl.SSLContext` object allowing bundling SSL configuration options,
+certificates and private keys into a single (potentially long-lived) structure.
+
+(Contributed by Giampaolo Rodolà; :issue:`8806`.)
+
+popen
+-----
+
+The :func:`os.popen` and :func:`subprocess.Popen` functions now support
+:keyword:`with` statements for auto-closing of the file descriptors.
+
+(Contributed by Antoine Pitrou and Brian Curtin in :issue:`7461` and
+:issue:`10554`.)
+
+select
+------
+
+The :mod:`select` module now exposes a new, constant attribute,
+:attr:`~select.PIPE_BUF`, which gives the minimum number of bytes which are
+guaranteed not to block when :func:`select.select` says a pipe is ready
+for writing.
+
+>>> import select
+>>> select.PIPE_BUF
+512
+
+(Available on Unix systems. Patch by Sébastien Sablé in :issue:`9862`)
+
+gzip and zipfile
+----------------
+
+:class:`gzip.GzipFile` now implements the :class:`io.BufferedIOBase`
+:term:`abstract base class` (except for ``truncate()``). It also has a
+:meth:`~gzip.GzipFile.peek` method and supports unseekable as well as
+zero-padded file objects.
+
+The :mod:`gzip` module also gains the :func:`~gzip.compress` and
+:func:`~gzip.decompress` functions for easier in-memory compression and
+decompression. Keep in mind that text needs to be encoded as :class:`bytes`
+before compressing and decompressing:
+
+>>> s = 'Three shall be the number thou shalt count, '
+>>> s += 'and the number of the counting shall be three'
+>>> b = s.encode() # convert to utf-8
+>>> len(b)
+89
+>>> c = gzip.compress(b)
+>>> len(c)
+77
+>>> gzip.decompress(c).decode()[:42] # decompress and convert to text
+'Three shall be the number thou shalt count,'
+
+(Contributed by Anand B. Pillai in :issue:`3488`; and by Antoine Pitrou, Nir
+Aides and Brian Curtin in :issue:`9962`, :issue:`1675951`, :issue:`7471` and
+:issue:`2846`.)
+
+Also, the :class:`zipfile.ZipExtFile` class was reworked internally to represent
+files stored inside an archive. The new implementation is significantly faster
+and can be wrapped in a :class:`io.BufferedReader` object for more speedups. It
+also solves an issue where interleaved calls to *read* and *readline* gave the
+wrong results.
+
+(Patch submitted by Nir Aides in :issue:`7610`.)
+
+tarfile
+-------
+
+The :class:`~tarfile.TarFile` class can now be used as a context manager. In
+addition, its :meth:`~tarfile.TarFile.add` method has a new option, *filter*,
+that controls which files are added to the archive and allows the file metadata
+to be edited.
+
+The new *filter* option replaces the older, less flexible *exclude* parameter
+which is now deprecated. If specified, the optional *filter* parameter needs to
+be a :term:`keyword argument`. The user-supplied filter function accepts a
+:class:`~tarfile.TarInfo` object and returns an updated
+:class:`~tarfile.TarInfo` object, or if it wants the file to be excluded, the
+function can return *None*::
+
+ >>> import tarfile, glob
+
+ >>> def myfilter(tarinfo):
+ if tarinfo.isfile(): # only save real files
+ tarinfo.uname = 'monty' # redact the user name
+ return tarinfo
+
+ >>> with tarfile.open(name='myarchive.tar.gz', mode='w:gz') as tf:
+ for filename in glob.glob('*.txt'):
+ tf.add(filename, filter=myfilter)
+ tf.list()
+ -rw-r--r-- monty/501 902 2011-01-26 17:59:11 annotations.txt
+ -rw-r--r-- monty/501 123 2011-01-26 17:59:11 general_questions.txt
+ -rw-r--r-- monty/501 3514 2011-01-26 17:59:11 prion.txt
+ -rw-r--r-- monty/501 124 2011-01-26 17:59:11 py_todo.txt
+ -rw-r--r-- monty/501 1399 2011-01-26 17:59:11 semaphore_notes.txt
+
+(Proposed by Tarek Ziadé and implemented by Lars Gustäbel in :issue:`6856`.)
+
+hashlib
+-------
+
+The :mod:`hashlib` module has two new constant attributes listing the hashing
+algorithms guaranteed to be present in all implementations and those available
+on the current implementation::
+
+ >>> import hashlib
+
+ >>> hashlib.algorithms_guaranteed
+ {'sha1', 'sha224', 'sha384', 'sha256', 'sha512', 'md5'}
+
+ >>> hashlib.algorithms_available
+ {'md2', 'SHA256', 'SHA512', 'dsaWithSHA', 'mdc2', 'SHA224', 'MD4', 'sha256',
+ 'sha512', 'ripemd160', 'SHA1', 'MDC2', 'SHA', 'SHA384', 'MD2',
+ 'ecdsa-with-SHA1','md4', 'md5', 'sha1', 'DSA-SHA', 'sha224',
+ 'dsaEncryption', 'DSA', 'RIPEMD160', 'sha', 'MD5', 'sha384'}
+
+(Suggested by Carl Chenet in :issue:`7418`.)
+
+ast
+---
+
+The :mod:`ast` module has a wonderful a general-purpose tool for safely
+evaluating expression strings using the Python literal
+syntax. The :func:`ast.literal_eval` function serves as a secure alternative to
+the builtin :func:`eval` function which is easily abused. Python 3.2 adds
+:class:`bytes` and :class:`set` literals to the list of supported types:
+strings, bytes, numbers, tuples, lists, dicts, sets, booleans, and None.
+
+::
+
+ >>> from ast import literal_eval
+
+ >>> request = "{'req': 3, 'func': 'pow', 'args': (2, 0.5)}"
+ >>> literal_eval(request)
+ {'args': (2, 0.5), 'req': 3, 'func': 'pow'}
+
+ >>> request = "os.system('do something harmful')"
+ >>> literal_eval(request)
+ Traceback (most recent call last):
+ ...
+ ValueError: malformed node or string: <_ast.Call object at 0x101739a10>
+
+(Implemented by Benjamin Peterson and Georg Brandl.)
+
+os
+--
+
+Different operating systems use various encodings for filenames and environment
+variables. The :mod:`os` module provides two new functions,
+:func:`~os.fsencode` and :func:`~os.fsdecode`, for encoding and decoding
+filenames:
+
+>>> filename = 'Sehenswürdigkeiten'
+>>> os.fsencode(filename)
+b'Sehensw\xc3\xbcrdigkeiten'
+
+Some operating systems allow direct access to encoded bytes in the
+environment. If so, the :attr:`os.supports_bytes_environ` constant will be
+true.
+
+For direct access to encoded environment variables (if available),
+use the new :func:`os.getenvb` function or use :data:`os.environb`
+which is a bytes version of :data:`os.environ`.
+
+(Contributed by Victor Stinner.)
+
+shutil
+------
+
+The :func:`shutil.copytree` function has two new options:
+
+* *ignore_dangling_symlinks*: when ``symlinks=False`` so that the function
+ copies a file pointed to by a symlink, not the symlink itself. This option
+ will silence the error raised if the file doesn't exist.
+
+* *copy_function*: is a callable that will be used to copy files.
+ :func:`shutil.copy2` is used by default.
+
+(Contributed by Tarek Ziadé.)
+
+In addition, the :mod:`shutil` module now supports :ref:`archiving operations
+<archiving-operations>` for zipfiles, uncompressed tarfiles, gzipped tarfiles,
+and bzipped tarfiles. And there are functions for registering additional
+archiving file formats (such as xz compressed tarfiles or custom formats).
+
+The principal functions are :func:`~shutil.make_archive` and
+:func:`~shutil.unpack_archive`. By default, both operate on the current
+directory (which can be set by :func:`os.chdir`) and on any sub-directories.
+The archive filename needs to be specified with a full pathname. The archiving
+step is non-destructive (the original files are left unchanged).
+
+::
+
+ >>> import shutil, pprint
+
+ >>> os.chdir('mydata') # change to the source directory
+ >>> f = shutil.make_archive('/var/backup/mydata',
+ 'zip') # archive the current directory
+ >>> f # show the name of archive
+ '/var/backup/mydata.zip'
+ >>> os.chdir('tmp') # change to an unpacking
+ >>> shutil.unpack_archive('/var/backup/mydata.zip') # recover the data
+
+ >>> pprint.pprint(shutil.get_archive_formats()) # display known formats
+ [('bztar', "bzip2'ed tar-file"),
+ ('gztar', "gzip'ed tar-file"),
+ ('tar', 'uncompressed tar file'),
+ ('zip', 'ZIP file')]
+
+ >>> shutil.register_archive_format( # register a new archive format
+ name = 'xz',
+ function = xz.compress, # callable archiving function
+ extra_args = [('level', 8)], # arguments to the function
+ description = 'xz compression'
+ )
+
+(Contributed by Tarek Ziadé.)
+
+sqlite3
+-------
+
+The :mod:`sqlite3` module was updated to pysqlite version 2.6.0. It has two new capabilities.
+
+* The :attr:`sqlite3.Connection.in_transit` attribute is true if there is an
+ active transaction for uncommitted changes.
+
+* The :meth:`sqlite3.Connection.enable_load_extension` and
+ :meth:`sqlite3.Connection.load_extension` methods allows you to load SQLite
+ extensions from ".so" files. One well-known extension is the fulltext-search
+ extension distributed with SQLite.
+
+(Contributed by R. David Murray and Shashwat Anand; :issue:`8845`.)
+
+html
+----
+
+A new :mod:`html` module was introduced with only a single function,
+:func:`~html.escape`, which is used for escaping reserved characters from HTML
+markup:
+
+>>> import html
+>>> html.escape('x > 2 && x < 7')
+'x &gt; 2 &amp;&amp; x &lt; 7'
+
+socket
+------
+
+The :mod:`socket` module has two new improvements.
+
+* Socket objects now have a :meth:`~socket.socket.detach()` method which puts
+ the socket into closed state without actually closing the underlying file
+ descriptor. The latter can then be reused for other purposes.
+ (Added by Antoine Pitrou; :issue:`8524`.)
+
+* :func:`socket.create_connection` now supports the context manager protocol
+ to unconditionally consume :exc:`socket.error` exceptions and to close the
+ socket when done.
+ (Contributed by Giampaolo Rodolà; :issue:`9794`.)
+
+ssl
+---
+
+The :mod:`ssl` module added a number of features to satisfy common requirements
+for secure (encrypted, authenticated) internet connections:
+
+* A new class, :class:`~ssl.SSLContext`, serves as a container for persistent
+ SSL data, such as protocol settings, certificates, private keys, and various
+ other options. It includes a :meth:`~ssl.SSLContext.wrap_socket` for creating
+ an SSL socket from an SSL context.
+
+* A new function, :func:`ssl.match_hostname`, supports server identity
+ verification for higher-level protocols by implementing the rules of HTTPS
+ (from :rfc:`2818`) which are also suitable for other protocols.
+
+* The :func:`ssl.wrap_socket` constructor function now takes a *ciphers*
+ argument. The *ciphers* string lists the allowed encryption algorithms using
+ the format described in the `OpenSSL documentation
+ <http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`__.
+
+* When linked against recent versions of OpenSSL, the :mod:`ssl` module now
+ supports the Server Name Indication extension to the TLS protocol, allowing
+ multiple "virtual hosts" using different certificates on a single IP port.
+ This extension is only supported in client mode, and is activated by passing
+ the *server_hostname* argument to :meth:`ssl.SSLContext.wrap_socket`.
+
+* Various options have been added to the :mod:`ssl` module, such as
+ :data:`~ssl.OP_NO_SSLv2` which disables the insecure and obsolete SSLv2
+ protocol.
+
+* The extension now loads all the OpenSSL ciphers and digest algorithms. If
+ some SSL certificates cannot be verified, they are reported as an "unknown
+ algorithm" error.
+
+* The version of OpenSSL being used is now accessible using the module
+ attributes :data:`ssl.OPENSSL_VERSION` (a string),
+ :data:`ssl.OPENSSL_VERSION_INFO` (a 5-tuple), and
+ :data:`ssl.OPENSSL_VERSION_NUMBER` (an integer).
+
+(Contributed by Antoine Pitrou in :issue:`8850`, :issue:`1589`, :issue:`8322`,
+:issue:`5639`, :issue:`4870`, :issue:`8484`, and :issue:`8321`.)
+
+nntp
+----
+
+The :mod:`nntplib` module has a revamped implementation with better bytes and
+text semantics as well as more practical APIs. These improvements break
+compatibility with the nntplib version in Python 3.1, which was partly
+dysfunctional in itself.
+
+Support for secure connections through both implicit (using
+:class:`nntplib.NNTP_SSL`) and explicit (using :meth:`nntplib.NNTP.starttls`)
+TLS has also been added.
+
+(Contributed by Antoine Pitrou in :issue:`9360` and Andrew Vant in :issue:`1926`.)
+
+certificates
+------------
+
+:class:`http.client.HTTPSConnection`, :class:`urllib.request.HTTPSHandler`
+and :func:`urllib.request.urlopen` now take optional arguments to allow for
+server certificate checking against a set of Certificate Authorities,
+as recommended in public uses of HTTPS.
+
+(Added by Antoine Pitrou, :issue:`9003`.)
+
+imaplib
+-------
+
+Support for explicit TLS on standard IMAP4 connections has been added through
+the new :mod:`imaplib.IMAP4.starttls` method.
+
+(Contributed by Lorenzo M. Catucci and Antoine Pitrou, :issue:`4471`.)
+
+http.client
+-----------
+
+There were a number of small API improvements in the :mod:`http.client` module.
+The old-style HTTP 0.9 simple responses are no longer supported and the *strict*
+parameter is deprecated in all classes.
+
+The :class:`~http.client.HTTPConnection` and
+:class:`~http.client.HTTPSConnection` classes now have a *source_address*
+parameter for a (host, port) tuple indicating where the HTTP connection is made
+from.
+
+Support for certificate checking and HTTPS virtual hosts were added to
+:class:`~http.client.HTTPSConnection`.
+
+The :meth:`~http.client.HTTPConnection.request` method on connection objects
+allowed an optional *body* argument so that a :term:`file object` could be used
+to supply the content of the request. Conveniently, the *body* argument now
+also accepts an :term:`iterable` object so long as it includes an explicit
+``Content-Length`` header. This extended interface is much more flexible than
+before.
+
+To establish an HTTPS connection through a proxy server, there is a new
+:meth:`~http.client.HTTPConnection.set_tunnel` method that sets the host and
+port for HTTP Connect tunneling.
+
+To match the behavior of :mod:`http.server`, the HTTP client library now also
+encodes headers with ISO-8859-1 (Latin-1) encoding. It was already doing that
+for incoming headers, so now the behavior is consistent for both incoming and
+outgoing traffic. (See work by Armin Ronacher in :issue:`10980`.)
+
+unittest
+--------
+
+The unittest module has a number of improvements supporting test discovery for
+packages, easier experimentation at the interactive prompt, new testcase
+methods, improved diagnostic messages for test failures, and better method
+names.
+
+* The command-line call ``python -m unittest`` can now accept file paths
+ instead of module names for running specific tests (:issue:`10620`). The new
+ test discovery can find tests within packages, locating any test importable
+ from the top-level directory. The top-level directory can be specified with
+ the `-t` option, a pattern for matching files with ``-p``, and a directory to
+ start discovery with ``-s``::
+
+ $ python -m unittest discover -s my_proj_dir -p _test.py
+
+ (Contributed by Michael Foord.)
+
+* Experimentation at the interactive prompt is now easier because the
+ :class:`unittest.case.TestCase` class can now be instantiated without
+ arguments:
+
+ >>> TestCase().assertEqual(pow(2, 3), 8)
+
+ (Contributed by Michael Foord.)
+
+* The :mod:`unittest` module has two new methods,
+ :meth:`~unittest.TestCase.assertWarns` and
+ :meth:`~unittest.TestCase.assertWarnsRegex` to verify that a given warning type
+ is triggered by the code under test::
+
+ with self.assertWarns(DeprecationWarning):
+ legacy_function('XYZ')
+
+ (Contributed by Antoine Pitrou, :issue:`9754`.)
+
+ Another new method, :meth:`~unittest.TestCase.assertCountEqual` is used to
+ compare two iterables to determine if their element counts are equal (whether
+ the same elements are present with the same number of occurrences regardless
+ of order)::
+
+ def test_anagram(self):
+ self.assertCountEqual('algorithm', 'logarithm')
+
+ (Contributed by Raymond Hettinger.)
+
+* A principal feature of the unittest module is an effort to produce meaningful
+ diagnostics when a test fails. When possible, the failure is recorded along
+ with a diff of the output. This is especially helpful for analyzing log files
+ of failed test runs. However, since diffs can sometime be voluminous, there is
+ a new :attr:`~unittest.TestCase.maxDiff` attribute that sets maximum length of
+ diffs displayed.
+
+* In addition, the method names in the module have undergone a number of clean-ups.
+
+ For example, :meth:`~unittest.TestCase.assertRegex` is the new name for
+ :meth:`~unittest.TestCase.assertRegexpMatches` which was misnamed because the
+ test uses :func:`re.search`, not :func:`re.match`. Other methods using
+ regular expressions are now named using short form "Regex" in preference to
+ "Regexp" -- this matches the names used in other unittest implementations,
+ matches Python's old name for the :mod:`re` module, and it has unambiguous
+ camel-casing.
+
+ (Contributed by Raymond Hettinger and implemented by Ezio Melotti.)
+
+* To improve consistency, some long-standing method aliases are being
+ deprecated in favor of the preferred names:
+
+ =============================== ==============================
+ Old Name Preferred Name
+ =============================== ==============================
+ :meth:`assert_` :meth:`.assertTrue`
+ :meth:`assertEquals` :meth:`.assertEqual`
+ :meth:`assertNotEquals` :meth:`.assertNotEqual`
+ :meth:`assertAlmostEquals` :meth:`.assertAlmostEqual`
+ :meth:`assertNotAlmostEquals` :meth:`.assertNotAlmostEqual`
+ =============================== ==============================
+
+ Likewise, the ``TestCase.fail*`` methods deprecated in Python 3.1 are expected
+ to be removed in Python 3.3. Also see the :ref:`deprecated-aliases` section in
+ the :mod:`unittest` documentation.
+
+ (Contributed by Ezio Melotti; :issue:`9424`.)
+
+* The :meth:`~unittest.TestCase.assertDictContainsSubset` method was deprecated
+ because it was misimplemented with the arguments in the wrong order. This
+ created hard-to-debug optical illusions where tests like
+ ``TestCase().assertDictContainsSubset({'a':1, 'b':2}, {'a':1})`` would fail.
+
+ (Contributed by Raymond Hettinger.)
+
+random
+------
+
+The integer methods in the :mod:`random` module now do a better job of producing
+uniform distributions. Previously, they computed selections with
+``int(n*random())`` which had a slight bias whenever *n* was not a power of two.
+Now, multiple selections are made from a range up to the next power of two and a
+selection is kept only when it falls within the range ``0 <= x < n``. The
+functions and methods affected are :func:`~random.randrange`,
+:func:`~random.randint`, :func:`~random.choice`, :func:`~random.shuffle` and
+:func:`~random.sample`.
+
+(Contributed by Raymond Hettinger; :issue:`9025`.)
+
+poplib
+------
+
+:class:`~poplib.POP3_SSL` class now accepts a *context* parameter, which is a
+:class:`ssl.SSLContext` object allowing bundling SSL configuration options,
+certificates and private keys into a single (potentially long-lived)
+structure.
+
+(Contributed by Giampaolo Rodolà; :issue:`8807`.)
+
+asyncore
+--------
+
+:class:`asyncore.dispatcher` now provides a
+:meth:`~asyncore.dispatcher.handle_accepted()` method
+returning a `(sock, addr)` pair which is called when a connection has actually
+been established with a new remote endpoint. This is supposed to be used as a
+replacement for old :meth:`~asyncore.dispatcher.handle_accept()` and avoids
+the user to call :meth:`~asyncore.dispatcher.accept()` directly.
+
+(Contributed by Giampaolo Rodolà; :issue:`6706`.)
+
+tempfile
+--------
+
+The :mod:`tempfile` module has a new context manager,
+:class:`~tempfile.TemporaryDirectory` which provides easy deterministic
+cleanup of temporary directories::
+
+ with tempfile.TemporaryDirectory() as tmpdirname:
+ print('created temporary dir:', tmpdirname)
+
+(Contributed by Neil Schemenauer and Nick Coghlan; :issue:`5178`.)
+
+inspect
+-------
+
+* The :mod:`inspect` module has a new function
+ :func:`~inspect.getgeneratorstate` to easily identify the current state of a
+ generator-iterator::
+
+ >>> from inspect import getgeneratorstate
+ >>> def gen():
+ yield 'demo'
+ >>> g = gen()
+ >>> getgeneratorstate(g)
+ 'GEN_CREATED'
+ >>> next(g)
+ 'demo'
+ >>> getgeneratorstate(g)
+ 'GEN_SUSPENDED'
+ >>> next(g, None)
+ >>> getgeneratorstate(g)
+ 'GEN_CLOSED'
+
+ (Contributed by Rodolpho Eckhardt and Nick Coghlan, :issue:`10220`.)
+
+* To support lookups without the possibility of activating a dynamic attribute,
+ the :mod:`inspect` module has a new function, :func:`~inspect.getattr_static`.
+ Unlike :func:`hasattr`, this is a true read-only search, guaranteed not to
+ change state while it is searching::
+
+ >>> class A:
+ @property
+ def f(self):
+ print('Running')
+ return 10
+
+ >>> a = A()
+ >>> getattr(a, 'f')
+ Running
+ 10
+ >>> inspect.getattr_static(a, 'f')
+ <property object at 0x1022bd788>
+
+ (Contributed by Michael Foord.)
+
+pydoc
+-----
+
+The :mod:`pydoc` module now provides a much-improved Web server interface, as
+well as a new command-line option ``-b`` to automatically open a browser window
+to display that server::
+
+ $ pydoc3.2 -b
+
+(Contributed by Ron Adam; :issue:`2001`.)
+
+dis
+---
+
+The :mod:`dis` module gained two new functions for inspecting code,
+:func:`~dis.code_info` and :func:`~dis.show_code`. Both provide detailed code
+object information for the supplied function, method, source code string or code
+object. The former returns a string and the latter prints it::
+
+ >>> import dis, random
+ >>> dis.show_code(random.choice)
+ Name: choice
+ Filename: /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/random.py
+ Argument count: 2
+ Kw-only arguments: 0
+ Number of locals: 3
+ Stack size: 11
+ Flags: OPTIMIZED, NEWLOCALS, NOFREE
+ Constants:
+ 0: 'Choose a random element from a non-empty sequence.'
+ 1: 'Cannot choose from an empty sequence'
+ Names:
+ 0: _randbelow
+ 1: len
+ 2: ValueError
+ 3: IndexError
+ Variable names:
+ 0: self
+ 1: seq
+ 2: i
+
+In addition, the :func:`~dis.dis` function now accepts string arguments
+so that the common idiom ``dis(compile(s, '', 'eval'))`` can be shortened
+to ``dis(s)``::
+
+ >>> dis('3*x+1 if x%2==1 else x//2')
+ 1 0 LOAD_NAME 0 (x)
+ 3 LOAD_CONST 0 (2)
+ 6 BINARY_MODULO
+ 7 LOAD_CONST 1 (1)
+ 10 COMPARE_OP 2 (==)
+ 13 POP_JUMP_IF_FALSE 28
+ 16 LOAD_CONST 2 (3)
+ 19 LOAD_NAME 0 (x)
+ 22 BINARY_MULTIPLY
+ 23 LOAD_CONST 1 (1)
+ 26 BINARY_ADD
+ 27 RETURN_VALUE
+ >> 28 LOAD_NAME 0 (x)
+ 31 LOAD_CONST 0 (2)
+ 34 BINARY_FLOOR_DIVIDE
+ 35 RETURN_VALUE
+
+Taken together, these improvements make it easier to explore how CPython is
+implemented and to see for yourself what the language syntax does
+under-the-hood.
+
+(Contributed by Nick Coghlan in :issue:`9147`.)
+
+dbm
+---
+
+All database modules now support the :meth:`get` and :meth:`setdefault` methods.
+
+(Suggested by Ray Allen in :issue:`9523`.)
+
+ctypes
+------
+
+A new type, :class:`ctypes.c_ssize_t` represents the C :c:type:`ssize_t` datatype.
+
+site
+----
+
+The :mod:`site` module has three new functions useful for reporting on the
+details of a given Python installation.
+
+* :func:`~site.getsitepackages` lists all global site-packages directories.
+
+* :func:`~site.getuserbase` reports on the user's base directory where data can
+ be stored.
+
+* :func:`~site.getusersitepackages` reveals the user-specific site-packages
+ directory path.
+
+::
+
+ >>> import site
+ >>> site.getsitepackages()
+ ['/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages',
+ '/Library/Frameworks/Python.framework/Versions/3.2/lib/site-python',
+ '/Library/Python/3.2/site-packages']
+ >>> site.getuserbase()
+ '/Users/raymondhettinger/Library/Python/3.2'
+ >>> site.getusersitepackages()
+ '/Users/raymondhettinger/Library/Python/3.2/lib/python/site-packages'
+
+Conveniently, some of site's functionality is accessible directly from the
+command-line::
+
+ $ python -m site --user-base
+ /Users/raymondhettinger/.local
+ $ python -m site --user-site
+ /Users/raymondhettinger/.local/lib/python3.2/site-packages
+
+(Contributed by Tarek Ziadé in :issue:`6693`.)
+
+sysconfig
+---------
+
+The new :mod:`sysconfig` module makes it straightforward to discover
+installation paths and configuration variables that vary across platforms and
+installations.
+
+The module offers access simple access functions for platform and version
+information:
+
+* :func:`~sysconfig.get_platform` returning values like *linux-i586* or
+ *macosx-10.6-ppc*.
+* :func:`~sysconfig.get_python_version` returns a Python version string
+ such as "3.2".
+
+It also provides access to the paths and variables corresponding to one of
+seven named schemes used by :mod:`distutils`. Those include *posix_prefix*,
+*posix_home*, *posix_user*, *nt*, *nt_user*, *os2*, *os2_home*:
+
+* :func:`~sysconfig.get_paths` makes a dictionary containing installation paths
+ for the current installation scheme.
+* :func:`~sysconfig.get_config_vars` returns a dictionary of platform specific
+ variables.
+
+There is also a convenient command-line interface::
+
+ C:\Python32>python -m sysconfig
+ Platform: "win32"
+ Python version: "3.2"
+ Current installation scheme: "nt"
+
+ Paths:
+ data = "C:\Python32"
+ include = "C:\Python32\Include"
+ platinclude = "C:\Python32\Include"
+ platlib = "C:\Python32\Lib\site-packages"
+ platstdlib = "C:\Python32\Lib"
+ purelib = "C:\Python32\Lib\site-packages"
+ scripts = "C:\Python32\Scripts"
+ stdlib = "C:\Python32\Lib"
+
+ Variables:
+ BINDIR = "C:\Python32"
+ BINLIBDEST = "C:\Python32\Lib"
+ EXE = ".exe"
+ INCLUDEPY = "C:\Python32\Include"
+ LIBDEST = "C:\Python32\Lib"
+ SO = ".pyd"
+ VERSION = "32"
+ abiflags = ""
+ base = "C:\Python32"
+ exec_prefix = "C:\Python32"
+ platbase = "C:\Python32"
+ prefix = "C:\Python32"
+ projectbase = "C:\Python32"
+ py_version = "3.2"
+ py_version_nodot = "32"
+ py_version_short = "3.2"
+ srcdir = "C:\Python32"
+ userbase = "C:\Documents and Settings\Raymond\Application Data\Python"
+
+(Moved out of Distutils by Tarek Ziadé.)
+
+pdb
+---
+
+The :mod:`pdb` debugger module gained a number of usability improvements:
+
+* :file:`pdb.py` now has a ``-c`` option that executes commands as given in a
+ :file:`.pdbrc` script file.
+* A :file:`.pdbrc` script file can contain ``continue`` and ``next`` commands
+ that continue debugging.
+* The :class:`Pdb` class constructor now accepts a *nosigint* argument.
+* New commands: ``l(list)``, ``ll(long list)`` and ``source`` for
+ listing source code.
+* New commands: ``display`` and ``undisplay`` for showing or hiding
+ the value of an expression if it has changed.
+* New command: ``interact`` for starting an interactive interpreter containing
+ the global and local names found in the current scope.
+* Breakpoints can be cleared by breakpoint number.
+
+(Contributed by Georg Brandl, Antonio Cuni and Ilya Sandler.)
+
+configparser
+------------
+
+The :mod:`configparser` module was modified to improve usability and
+predictability of the default parser and its supported INI syntax. The old
+:class:`ConfigParser` class was removed in favor of :class:`SafeConfigParser`
+which has in turn been renamed to :class:`~configparser.ConfigParser`. Support
+for inline comments is now turned off by default and section or option
+duplicates are not allowed in a single configuration source.
+
+Config parsers gained a new API based on the mapping protocol::
+
+ >>> parser = ConfigParser()
+ >>> parser.read_string("""
+ [DEFAULT]
+ location = upper left
+ visible = yes
+ editable = no
+ color = blue
+
+ [main]
+ title = Main Menu
+ color = green
+
+ [options]
+ title = Options
+ """)
+ >>> parser['main']['color']
+ 'green'
+ >>> parser['main']['editable']
+ 'no'
+ >>> section = parser['options']
+ >>> section['title']
+ 'Options'
+ >>> section['title'] = 'Options (editable: %(editable)s)'
+ >>> section['title']
+ 'Options (editable: no)'
+
+The new API is implemented on top of the classical API, so custom parser
+subclasses should be able to use it without modifications.
+
+The INI file structure accepted by config parsers can now be customized. Users
+can specify alternative option/value delimiters and comment prefixes, change the
+name of the *DEFAULT* section or switch the interpolation syntax.
+
+There is support for pluggable interpolation including an additional interpolation
+handler :class:`~configparser.ExtendedInterpolation`::
+
+ >>> parser = ConfigParser(interpolation=ExtendedInterpolation())
+ >>> parser.read_dict({'buildout': {'directory': '/home/ambv/zope9'},
+ 'custom': {'prefix': '/usr/local'}})
+ >>> parser.read_string("""
+ [buildout]
+ parts =
+ zope9
+ instance
+ find-links =
+ ${buildout:directory}/downloads/dist
+
+ [zope9]
+ recipe = plone.recipe.zope9install
+ location = /opt/zope
+
+ [instance]
+ recipe = plone.recipe.zope9instance
+ zope9-location = ${zope9:location}
+ zope-conf = ${custom:prefix}/etc/zope.conf
+ """)
+ >>> parser['buildout']['find-links']
+ '\n/home/ambv/zope9/downloads/dist'
+ >>> parser['instance']['zope-conf']
+ '/usr/local/etc/zope.conf'
+ >>> instance = parser['instance']
+ >>> instance['zope-conf']
+ '/usr/local/etc/zope.conf'
+ >>> instance['zope9-location']
+ '/opt/zope'
+
+A number of smaller features were also introduced, like support for specifying
+encoding in read operations, specifying fallback values for get-functions, or
+reading directly from dictionaries and strings.
+
+(All changes contributed by Åukasz Langa.)
+
+.. XXX consider showing a difflib example
+
+urllib.parse
+------------
+
+A number of usability improvements were made for the :mod:`urllib.parse` module.
+
+The :func:`~urllib.parse.urlparse` function now supports `IPv6
+<http://en.wikipedia.org/wiki/IPv6>`_ addresses as described in :rfc:`2732`:
+
+ >>> import urllib.parse
+ >>> urllib.parse.urlparse('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/')
+ ParseResult(scheme='http',
+ netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]',
+ path='/foo/',
+ params='',
+ query='',
+ fragment='')
+
+The :func:`~urllib.parse.urldefrag` function now returns a :term:`named tuple`::
+
+ >>> r = urllib.parse.urldefrag('http://python.org/about/#target')
+ >>> r
+ DefragResult(url='http://python.org/about/', fragment='target')
+ >>> r[0]
+ 'http://python.org/about/'
+ >>> r.fragment
+ 'target'
+
+And, the :func:`~urllib.parse.urlencode` function is now much more flexible,
+accepting either a string or bytes type for the *query* argument. If it is a
+string, then the *safe*, *encoding*, and *error* parameters are sent to
+:func:`~urllib.parse.quote_plus` for encoding::
+
+ >>> urllib.parse.urlencode([
+ ('type', 'telenovela'),
+ ('name', '¿Dónde Está Elisa?')],
+ encoding='latin-1')
+ 'type=telenovela&name=%BFD%F3nde+Est%E1+Elisa%3F'
+
+As detailed in :ref:`parsing-ascii-encoded-bytes`, all the :mod:`urllib.parse`
+functions now accept ASCII-encoded byte strings as input, so long as they are
+not mixed with regular strings. If ASCII-encoded byte strings are given as
+parameters, the return types will also be an ASCII-encoded byte strings:
+
+ >>> urllib.parse.urlparse(b'http://www.python.org:80/about/')
+ ParseResultBytes(scheme=b'http', netloc=b'www.python.org:80',
+ path=b'/about/', params=b'', query=b'', fragment=b'')
+
+(Work by Nick Coghlan, Dan Mahn, and Senthil Kumaran in :issue:`2987`,
+:issue:`5468`, and :issue:`9873`.)
+
+mailbox
+-------
+
+Thanks to a concerted effort by R. David Murray, the :mod:`mailbox` module has
+been fixed for Python 3.2. The challenge was that mailbox had been originally
+designed with a text interface, but email messages are best represented with
+:class:`bytes` because various parts of a message may have different encodings.
+
+The solution harnessed the :mod:`email` package's binary support for parsing
+arbitrary email messages. In addition, the solution required a number of API
+changes.
+
+As expected, the :meth:`~mailbox.Mailbox.add` method for
+:class:`mailbox.Mailbox` objects now accepts binary input.
+
+:class:`~io.StringIO` and text file input are deprecated. Also, string input
+will fail early if non-ASCII characters are used. Previously it would fail when
+the email was processed in a later step.
+
+There is also support for binary output. The :meth:`~mailbox.Mailbox.get_file`
+method now returns a file in the binary mode (where it used to incorrectly set
+the file to text-mode). There is also a new :meth:`~mailbox.Mailbox.get_bytes`
+method that returns a :class:`bytes` representation of a message corresponding
+to a given *key*.
+
+It is still possible to get non-binary output using the old API's
+:meth:`~mailbox.Mailbox.get_string` method, but that approach
+is not very useful. Instead, it is best to extract messages from
+a :class:`~mailbox.Message` object or to load them from binary input.
+
+(Contributed by R. David Murray, with efforts from Steffen Daode Nurpmeso and an
+initial patch by Victor Stinner in :issue:`9124`.)
+
+turtledemo
+----------
+
+The demonstration code for the :mod:`turtle` module was moved from the *Demo*
+directory to main library. It includes over a dozen sample scripts with
+lively displays. Being on :attr:`sys.path`, it can now be run directly
+from the command-line::
+
+ $ python -m turtledemo
+
+(Moved from the Demo directory by Alexander Belopolsky in :issue:`10199`.)
+
+Multi-threading
+===============
+
+* The mechanism for serializing execution of concurrently running Python threads
+ (generally known as the :term:`GIL` or :term:`Global Interpreter Lock`) has
+ been rewritten. Among the objectives were more predictable switching
+ intervals and reduced overhead due to lock contention and the number of
+ ensuing system calls. The notion of a "check interval" to allow thread
+ switches has been abandoned and replaced by an absolute duration expressed in
+ seconds. This parameter is tunable through :func:`sys.setswitchinterval()`.
+ It currently defaults to 5 milliseconds.
+
+ Additional details about the implementation can be read from a `python-dev
+ mailing-list message
+ <http://mail.python.org/pipermail/python-dev/2009-October/093321.html>`_
+ (however, "priority requests" as exposed in this message have not been kept
+ for inclusion).
+
+ (Contributed by Antoine Pitrou.)
+
+* Regular and recursive locks now accept an optional *timeout* argument to their
+ :meth:`~threading.Lock.acquire` method. (Contributed by Antoine Pitrou;
+ :issue:`7316`.)
+
+* Similarly, :meth:`threading.Semaphore.acquire` also gained a *timeout*
+ argument. (Contributed by Torsten Landschoff; :issue:`850728`.)
+
+* Regular and recursive lock acquisitions can now be interrupted by signals on
+ platforms using Pthreads. This means that Python programs that deadlock while
+ acquiring locks can be successfully killed by repeatedly sending SIGINT to the
+ process (by pressing :kbd:`Ctrl+C` in most shells).
+ (Contributed by Reid Kleckner; :issue:`8844`.)
+
+
+Optimizations
+=============
+
+A number of small performance enhancements have been added:
+
+* Python's peephole optimizer now recognizes patterns such ``x in {1, 2, 3}`` as
+ being a test for membership in a set of constants. The optimizer recasts the
+ :class:`set` as a :class:`frozenset` and stores the pre-built constant.
+
+ Now that the speed penalty is gone, it is practical to start writing
+ membership tests using set-notation. This style is both semantically clear
+ and operationally fast::
+
+ extension = name.rpartition('.')[2]
+ if extension in {'xml', 'html', 'xhtml', 'css'}:
+ handle(name)
+
+ (Patch and additional tests contributed by Dave Malcolm; :issue:`6690`).
+
+* Serializing and unserializing data using the :mod:`pickle` module is now
+ several times faster.
+
+ (Contributed by Alexandre Vassalotti, Antoine Pitrou
+ and the Unladen Swallow team in :issue:`9410` and :issue:`3873`.)
+
+* The `Timsort algorithm <http://en.wikipedia.org/wiki/Timsort>`_ used in
+ :meth:`list.sort` and :func:`sorted` now runs faster and uses less memory
+ when called with a :term:`key function`. Previously, every element of
+ a list was wrapped with a temporary object that remembered the key value
+ associated with each element. Now, two arrays of keys and values are
+ sorted in parallel. This saves the memory consumed by the sort wrappers,
+ and it saves time lost to delegating comparisons.
+
+ (Patch by Daniel Stutzbach in :issue:`9915`.)
+
+* JSON decoding performance is improved and memory consumption is reduced
+ whenever the same string is repeated for multiple keys. Also, JSON encoding
+ now uses the C speedups when the ``sort_keys`` argument is true.
+
+ (Contributed by Antoine Pitrou in :issue:`7451` and by Raymond Hettinger and
+ Antoine Pitrou in :issue:`10314`.)
+
+* Recursive locks (created with the :func:`threading.RLock` API) now benefit
+ from a C implementation which makes them as fast as regular locks, and between
+ 10x and 15x faster than their previous pure Python implementation.
+
+ (Contributed by Antoine Pitrou; :issue:`3001`.)
+
+* The fast-search algorithm in stringlib is now used by the :meth:`split`,
+ :meth:`splitlines` and :meth:`replace` methods on
+ :class:`bytes`, :class:`bytearray` and :class:`str` objects. Likewise, the
+ algorithm is also used by :meth:`rfind`, :meth:`rindex`, :meth:`rsplit` and
+ :meth:`rpartition`.
+
+ (Patch by Florent Xicluna in :issue:`7622` and :issue:`7462`.)
+
+
+* String to integer conversions now work two "digits" at a time, reducing the
+ number of division and modulo operations.
+
+ (:issue:`6713` by Gawain Bolton, Mark Dickinson, and Victor Stinner.)
+
+There were several other minor optimizations. Set differencing now runs faster
+when one operand is much larger than the other (patch by Andress Bennetts in
+:issue:`8685`). The :meth:`array.repeat` method has a faster implementation
+(:issue:`1569291` by Alexander Belopolsky). The :class:`BaseHTTPRequestHandler`
+has more efficient buffering (:issue:`3709` by Andrew Schaaf). The
+:func:`operator.attrgetter` function has been sped-up (:issue:`10160` by
+Christos Georgiou). And :class:`ConfigParser` loads multi-line arguments a bit
+faster (:issue:`7113` by Åukasz Langa).
+
+
+Unicode
+=======
+
+Python has been updated to `Unicode 6.0.0
+<http://unicode.org/versions/Unicode6.0.0/>`_. The update to the standard adds
+over 2,000 new characters including `emoji <http://en.wikipedia.org/wiki/Emoji>`_
+symbols which are important for mobile phones.
+
+In addition, the updated standard has altered the character properties for two
+Kannada characters (U+0CF1, U+0CF2) and one New Tai Lue numeric character
+(U+19DA), making the former eligible for use in identifiers while disqualifying
+the latter. For more information, see `Unicode Character Database Changes
+<http://www.unicode.org/versions/Unicode6.0.0/#Database_Changes>`_.
+
+
+Codecs
+======
+
+Support was added for *cp720* Arabic DOS encoding (:issue:`1616979`).
+
+MBCS encoding no longer ignores the error handler argument. In the default
+strict mode, it raises an :exc:`UnicodeDecodeError` when it encounters an
+undecodable byte sequence and an :exc:`UnicodeEncodeError` for an unencodable
+character.
+
+The MBCS codec supports ``'strict'`` and ``'ignore'`` error handlers for
+decoding, and ``'strict'`` and ``'replace'`` for encoding.
+
+To emulate Python3.1 MBCS encoding, select the ``'ignore'`` handler for decoding
+and the ``'replace'`` handler for encoding.
+
+On Mac OS X, Python decodes command line arguments with ``'utf-8'`` rather than
+the locale encoding.
+
+By default, :mod:`tarfile` uses ``'utf-8'`` encoding on Windows (instead of
+``'mbcs'``) and the ``'surrogateescape'`` error handler on all operating
+systems.
+
+
+Documentation
+=============
+
+The documentation continues to be improved.
+
+* A table of quick links has been added to the top of lengthy sections such as
+ :ref:`built-in-funcs`. In the case of :mod:`itertools`, the links are
+ accompanied by tables of cheatsheet-style summaries to provide an overview and
+ memory jog without having to read all of the docs.
+
+* In some cases, the pure Python source code can be a helpful adjunct to the
+ documentation, so now many modules now feature quick links to the latest
+ version of the source code. For example, the :mod:`functools` module
+ documentation has a quick link at the top labeled:
+
+ **Source code** :source:`Lib/functools.py`.
+
+ (Contributed by Raymond Hettinger; see
+ `rationale <http://rhettinger.wordpress.com/2011/01/28/open-your-source-more/>`_.)
+
+* The docs now contain more examples and recipes. In particular, :mod:`re`
+ module has an extensive section, :ref:`re-examples`. Likewise, the
+ :mod:`itertools` module continues to be updated with new
+ :ref:`itertools-recipes`.
+
+* The :mod:`datetime` module now has an auxiliary implementation in pure Python.
+ No functionality was changed. This just provides an easier-to-read alternate
+ implementation.
+
+ (Contributed by Alexander Belopolsky in :issue:`9528`.)
+
+* The unmaintained :file:`Demo` directory has been removed. Some demos were
+ integrated into the documentation, some were moved to the :file:`Tools/demo`
+ directory, and others were removed altogether.
+
+ (Contributed by Georg Brandl in :issue:`7962`.)
+
+
+IDLE
+====
+
+* The format menu now has an option to clean source files by stripping
+ trailing whitespace.
+
+ (Contributed by Raymond Hettinger; :issue:`5150`.)
+
+* IDLE on Mac OS X now works with both Carbon AquaTk and Cocoa AquaTk.
+
+ (Contributed by Kevin Walzer, Ned Deily, and Ronald Oussoren; :issue:`6075`.)
+
+Code Repository
+===============
+
+In addition to the existing Subversion code repository at http://svn.python.org
+there is now a `Mercurial <http://mercurial.selenic.com/>`_ repository at
+http://hg.python.org/\.
+
+After the 3.2 release, there are plans to switch to Mercurial as the primary
+repository. This distributed version control system should make it easier for
+members of the community to create and share external changesets. See
+:pep:`385` for details.
+
+To learn the new version control system, see the `tutorial by Joel
+Spolsky <http://hginit.com>`_ or the `Guide to Mercurial Workflows
+<http://mercurial.selenic.com/guide/>`_.
+
+
+Build and C API Changes
+=======================
+
+Changes to Python's build process and to the C API include:
+
+* The *idle*, *pydoc* and *2to3* scripts are now installed with a
+ version-specific suffix on ``make altinstall`` (:issue:`10679`).
+
+* The C functions that access the Unicode Database now accept and return
+ characters from the full Unicode range, even on narrow unicode builds
+ (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others). A visible difference
+ in Python is that :func:`unicodedata.numeric` now returns the correct value
+ for large code points, and :func:`repr` may consider more characters as
+ printable.
+
+ (Reported by Bupjoe Lee and fixed by Amaury Forgeot D'Arc; :issue:`5127`.)
+
+* Computed gotos are now enabled by default on supported compilers (which are
+ detected by the configure script). They can still be disabled selectively by
+ specifying ``--without-computed-gotos``.
+
+ (Contributed by Antoine Pitrou; :issue:`9203`.)
+
+* The option ``--with-wctype-functions`` was removed. The built-in unicode
+ database is now used for all functions.
+
+ (Contributed by Amaury Forgeot D'Arc; :issue:`9210`.)
+
+* Hash values are now values of a new type, :c:type:`Py_hash_t`, which is
+ defined to be the same size as a pointer. Previously they were of type long,
+ which on some 64-bit operating systems is still only 32 bits long. As a
+ result of this fix, :class:`set` and :class:`dict` can now hold more than
+ ``2**32`` entries on builds with 64-bit pointers (previously, they could grow
+ to that size but their performance degraded catastrophically).
+
+ (Suggested by Raymond Hettinger and implemented by Benjamin Peterson;
+ :issue:`9778`.)
+
+* A new macro :c:macro:`Py_VA_COPY` copies the state of the variable argument
+ list. It is equivalent to C99 *va_copy* but available on all Python platforms
+ (:issue:`2443`).
+
+* A new C API function :c:func:`PySys_SetArgvEx` allows an embedded interpreter
+ to set :attr:`sys.argv` without also modifying :attr:`sys.path`
+ (:issue:`5753`).
+
+* :c:macro:`PyEval_CallObject` is now only available in macro form. The
+ function declaration, which was kept for backwards compatibility reasons, is
+ now removed -- the macro was introduced in 1997 (:issue:`8276`).
+
+* There is a new function :c:func:`PyLong_AsLongLongAndOverflow` which
+ is analogous to :c:func:`PyLong_AsLongAndOverflow`. They both serve to
+ convert Python :class:`int` into a native fixed-width type while providing
+ detection of cases where the conversion won't fit (:issue:`7767`).
+
+* The :c:func:`PyUnicode_CompareWithASCIIString` function now returns *not
+ equal* if the Python string is *NUL* terminated.
+
+* There is a new function :c:func:`PyErr_NewExceptionWithDoc` that is
+ like :c:func:`PyErr_NewException` but allows a docstring to be specified.
+ This lets C exceptions have the same self-documenting capabilities as
+ their pure Python counterparts (:issue:`7033`).
+
+* When compiled with the ``--with-valgrind`` option, the pymalloc
+ allocator will be automatically disabled when running under Valgrind. This
+ gives improved memory leak detection when running under Valgrind, while taking
+ advantage of pymalloc at other times (:issue:`2422`).
+
+* Removed the ``O?`` format from the *PyArg_Parse* functions. The format is no
+ longer used and it had never been documented (:issue:`8837`).
+
+There were a number of other small changes to the C-API. See the
+:source:`Misc/NEWS` file for a complete list.
+
+Also, there were a number of updates to the Mac OS X build, see
+:source:`Mac/BuildScript/README.txt` for details. For users running a 32/64-bit
+build, there is a known problem with the default Tcl/Tk on Mac OS X 10.6.
+Accordingly, we recommend installing an updated alternative such as
+`ActiveState Tcl/Tk 8.5.9 <http://www.activestate.com/activetcl/downloads>`_\.
+See http://www.python.org/download/mac/tcltk/ for additional details.
+
+Porting to Python 3.2
+=====================
+
+This section lists previously described changes and other bugfixes that may
+require changes to your code:
+
+* The :mod:`configparser` module has a number of clean-ups. The major change is
+ to replace the old :class:`ConfigParser` class with long-standing preferred
+ alternative :class:`SafeConfigParser`. In addition there are a number of
+ smaller incompatibilities:
+
+ * The interpolation syntax is now validated on
+ :meth:`~configparser.ConfigParser.get` and
+ :meth:`~configparser.ConfigParser.set` operations. In the default
+ interpolation scheme, only two tokens with percent signs are valid: ``%(name)s``
+ and ``%%``, the latter being an escaped percent sign.
+
+ * The :meth:`~configparser.ConfigParser.set` and
+ :meth:`~configparser.ConfigParser.add_section` methods now verify that
+ values are actual strings. Formerly, unsupported types could be introduced
+ unintentionally.
+
+ * Duplicate sections or options from a single source now raise either
+ :exc:`~configparser.DuplicateSectionError` or
+ :exc:`~configparser.DuplicateOptionError`. Formerly, duplicates would
+ silently overwrite a previous entry.
+
+ * Inline comments are now disabled by default so now the **;** character
+ can be safely used in values.
+
+ * Comments now can be indented. Consequently, for **;** or **#** to appear at
+ the start of a line in multiline values, it has to be interpolated. This
+ keeps comment prefix characters in values from being mistaken as comments.
+
+ * ``""`` is now a valid value and is no longer automatically converted to an
+ empty string. For empty strings, use ``"option ="`` in a line.
+
+* The :mod:`nntplib` module was reworked extensively, meaning that its APIs
+ are often incompatible with the 3.1 APIs.
+
+* :class:`bytearray` objects can no longer be used as filenames; instead,
+ they should be converted to :class:`bytes`.
+
+* The :meth:`array.tostring` and :meth:`array.fromstring` have been renamed to
+ :meth:`array.tobytes` and :meth:`array.frombytes` for clarity. The old names
+ have been deprecated. (See :issue:`8990`.)
+
+* ``PyArg_Parse*()`` functions:
+
+ * "t#" format has been removed: use "s#" or "s*" instead
+ * "w" and "w#" formats has been removed: use "w*" instead
+
+* The :c:type:`PyCObject` type, deprecated in 3.1, has been removed. To wrap
+ opaque C pointers in Python objects, the :c:type:`PyCapsule` API should be used
+ instead; the new type has a well-defined interface for passing typing safety
+ information and a less complicated signature for calling a destructor.
+
+* The :func:`sys.setfilesystemencoding` function was removed because
+ it had a flawed design.
+
+* The :func:`random.seed` function and method now salt string seeds with an
+ sha512 hash function. To access the previous version of *seed* in order to
+ reproduce Python 3.1 sequences, set the *version* argument to *1*,
+ ``random.seed(s, version=1)``.
+
+* The previously deprecated :func:`string.maketrans` function has been removed
+ in favor of the static methods :meth:`bytes.maketrans` and
+ :meth:`bytearray.maketrans`. This change solves the confusion around which
+ types were supported by the :mod:`string` module. Now, :class:`str`,
+ :class:`bytes`, and :class:`bytearray` each have their own **maketrans** and
+ **translate** methods with intermediate translation tables of the appropriate
+ type.
+
+ (Contributed by Georg Brandl; :issue:`5675`.)
+
+* The previously deprecated :func:`contextlib.nested` function has been removed
+ in favor of a plain :keyword:`with` statement which can accept multiple
+ context managers. The latter technique is faster (because it is built-in),
+ and it does a better job finalizing multiple context managers when one of them
+ raises an exception::
+
+ with open('mylog.txt') as infile, open('a.out', 'w') as outfile:
+ for line in infile:
+ if '<critical>' in line:
+ outfile.write(line)
+
+ (Contributed by Georg Brandl and Mattias Brändström;
+ `appspot issue 53094 <http://codereview.appspot.com/53094>`_.)
+
+* :func:`struct.pack` now only allows bytes for the ``s`` string pack code.
+ Formerly, it would accept text arguments and implicitly encode them to bytes
+ using UTF-8. This was problematic because it made assumptions about the
+ correct encoding and because a variable-length encoding can fail when writing
+ to fixed length segment of a structure.
+
+ Code such as ``struct.pack('<6sHHBBB', 'GIF87a', x, y)`` should be rewritten
+ with to use bytes instead of text, ``struct.pack('<6sHHBBB', b'GIF87a', x, y)``.
+
+ (Discovered by David Beazley and fixed by Victor Stinner; :issue:`10783`.)
+
+* The :class:`xml.etree.ElementTree` class now raises an
+ :exc:`xml.etree.ElementTree.ParseError` when a parse fails. Previously it
+ raised a :exc:`xml.parsers.expat.ExpatError`.
+
+* The new, longer :func:`str` value on floats may break doctests which rely on
+ the old output format.
+
+* In :class:`subprocess.Popen`, the default value for *close_fds* is now
+ ``True`` under Unix; under Windows, it is ``True`` if the three standard
+ streams are set to ``None``, ``False`` otherwise. Previously, *close_fds*
+ was always ``False`` by default, which produced difficult to solve bugs
+ or race conditions when open file descriptors would leak into the child
+ process.
+
+* Support for legacy HTTP 0.9 has been removed from :mod:`urllib.request`
+ and :mod:`http.client`. Such support is still present on the server side
+ (in :mod:`http.server`).
+
+ (Contributed by Antoine Pitrou, :issue:`10711`.)
+
+* SSL sockets in timeout mode now raise :exc:`socket.timeout` when a timeout
+ occurs, rather than a generic :exc:`~ssl.SSLError`.
+
+ (Contributed by Antoine Pitrou, :issue:`10272`.)
+
+* The misleading functions :c:func:`PyEval_AcquireLock()` and
+ :c:func:`PyEval_ReleaseLock()` have been officially deprecated. The
+ thread-state aware APIs (such as :c:func:`PyEval_SaveThread()`
+ and :c:func:`PyEval_RestoreThread()`) should be used instead.
+
+* Due to security risks, :func:`asyncore.handle_accept` has been deprecated, and
+ a new function, :func:`asyncore.handle_accepted`, was added to replace it.
+
+ (Contributed by Giampaolo Rodola in :issue:`6706`.)
+
+* Due to the new :term:`GIL` implementation, :c:func:`PyEval_InitThreads()`
+ cannot be called before :c:func:`Py_Initialize()` anymore.
+
diff --git a/Doc/whatsnew/index.rst b/Doc/whatsnew/index.rst
index a1efe92993..8220bd28dd 100644
--- a/Doc/whatsnew/index.rst
+++ b/Doc/whatsnew/index.rst
@@ -11,8 +11,10 @@ anyone wishing to stay up-to-date after a new release.
.. toctree::
:maxdepth: 2
+ 3.2.rst
3.1.rst
3.0.rst
+ 2.7.rst
2.6.rst
2.5.rst
2.4.rst
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 1f226b80b1..89f4c3614e 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -11,9 +11,9 @@
# "How to Change Python's Grammar"
# Start symbols for the grammar:
-# single_input is a single interactive statement;
-# file_input is a module or sequence of commands read from an input file;
-# eval_input is the input for the eval() and input() functions.
+# single_input is a single interactive statement;
+# file_input is a module or sequence of commands read from an input file;
+# eval_input is the input for the eval() and input() functions.
# NB: compound_stmt in single_input is followed by extra NEWLINE!
single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
file_input: (NEWLINE | stmt)* ENDMARKER
@@ -24,21 +24,22 @@ decorators: decorator+
decorated: decorators (classdef | funcdef)
funcdef: 'def' NAME parameters ['->' test] ':' suite
parameters: '(' [typedargslist] ')'
-typedargslist: ((tfpdef ['=' test] ',')*
- ('*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef)
- | tfpdef ['=' test] (',' tfpdef ['=' test])* [','])
+typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [','
+ ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]]
+ | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef)
tfpdef: NAME [':' test]
-varargslist: ((vfpdef ['=' test] ',')*
- ('*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef)
- | vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
+varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [','
+ ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]]
+ | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef)
vfpdef: NAME
stmt: simple_stmt | compound_stmt
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt |
import_stmt | global_stmt | nonlocal_stmt | assert_stmt)
-expr_stmt: testlist (augassign (yield_expr|testlist) |
- ('=' (yield_expr|testlist))*)
+expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) |
+ ('=' (yield_expr|testlist_star_expr))*)
+testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [',']
augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' |
'<<=' | '>>=' | '**=' | '//=')
# For normal assignments, additional restrictions enforced by the interpreter
@@ -70,9 +71,9 @@ while_stmt: 'while' test ':' suite ['else' ':' suite]
for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]
try_stmt: ('try' ':' suite
((except_clause ':' suite)+
- ['else' ':' suite]
- ['finally' ':' suite] |
- 'finally' ':' suite))
+ ['else' ':' suite]
+ ['finally' ':' suite] |
+ 'finally' ':' suite))
with_stmt: 'with' with_item (',' with_item)* ':' suite
with_item: test ['as' expr]
# NB compile.c makes sure that the default except clause is last
@@ -86,9 +87,9 @@ lambdef_nocond: 'lambda' [varargslist] ':' test_nocond
or_test: and_test ('or' and_test)*
and_test: not_test ('and' not_test)*
not_test: 'not' not_test | comparison
-comparison: star_expr (comp_op star_expr)*
+comparison: expr (comp_op expr)*
comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not'
-star_expr: ['*'] expr
+star_expr: '*' expr
expr: xor_expr ('|' xor_expr)*
xor_expr: and_expr ('^' and_expr)*
and_expr: shift_expr ('&' shift_expr)*
@@ -101,12 +102,12 @@ atom: ('(' [yield_expr|testlist_comp] ')' |
'[' [testlist_comp] ']' |
'{' [dictorsetmaker] '}' |
NAME | NUMBER | STRING+ | '...' | 'None' | 'True' | 'False')
-testlist_comp: test ( comp_for | (',' test)* [','] )
+testlist_comp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] )
trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
subscriptlist: subscript (',' subscript)* [',']
subscript: test | [test] ':' [test] [sliceop]
sliceop: ':' [test]
-exprlist: star_expr (',' star_expr)* [',']
+exprlist: (expr|star_expr) (',' (expr|star_expr))* [',']
testlist: test (',' test)* [',']
dictorsetmaker: ( (test ':' test (comp_for | (',' test ':' test)* [','])) |
(test (comp_for | (',' test)* [','])) )
@@ -123,8 +124,6 @@ comp_iter: comp_for | comp_if
comp_for: 'for' exprlist 'in' or_test [comp_iter]
comp_if: 'if' test_nocond [comp_iter]
-testlist1: test (',' test)*
-
# not used in grammar, but may appear in "node" passed from Parser to Compiler
encoding_decl: NAME
diff --git a/Include/Python.h b/Include/Python.h
index 0d8a5f5753..db33a76cd4 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -49,6 +49,8 @@
#include "pyport.h"
+#include "pyatomic.h"
+
/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
* PYMALLOC_DEBUG is in error if pymalloc is not in use.
*/
@@ -59,10 +61,12 @@
#error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
#endif
#include "pymath.h"
+#include "pytime.h"
#include "pymem.h"
#include "object.h"
#include "objimpl.h"
+#include "typeslots.h"
#include "pydebug.h"
@@ -73,9 +77,7 @@
#include "longintrepr.h"
#include "boolobject.h"
#include "floatobject.h"
-#ifndef WITHOUT_COMPLEX
#include "complexobject.h"
-#endif
#include "rangeobject.h"
#include "memoryobject.h"
#include "tupleobject.h"
@@ -88,7 +90,6 @@
#include "funcobject.h"
#include "classobject.h"
#include "fileobject.h"
-#include "cobject.h"
#include "pycapsule.h"
#include "traceback.h"
#include "sliceobject.h"
@@ -98,6 +99,8 @@
#include "descrobject.h"
#include "warnings.h"
#include "weakrefobject.h"
+#include "structseq.h"
+
#include "codecs.h"
#include "pyerrors.h"
@@ -122,9 +125,20 @@
#include "pystrtod.h"
#include "pystrcmp.h"
#include "dtoa.h"
+#include "fileutils.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/* _Py_Mangle is defined in compile.c */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
/* Argument must be a char or an int in [-128, 127] or [0, 255]. */
#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
diff --git a/Include/abstract.h b/Include/abstract.h
index bbc00926d4..0fe0956b14 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -387,7 +387,9 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
PyAPI_FUNC(Py_ssize_t) PyObject_Length(PyObject *o);
#define PyObject_Length PyObject_Size
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyObject_LengthHint(PyObject *o, Py_ssize_t);
+#endif
/*
Guess the size of object o using len(o) or o.__length_hint__().
@@ -486,6 +488,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* new buffer API */
+#ifndef Py_LIMITED_API
#define PyObject_CheckBuffer(obj) \
(((obj)->ob_type->tp_as_buffer != NULL) && \
((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL))
@@ -573,6 +576,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* Releases a Py_buffer obtained from getbuffer ParseTuple's s*.
*/
+#endif /* Py_LIMITED_API */
PyAPI_FUNC(PyObject *) PyObject_Format(PyObject* obj,
PyObject *format_spec);
@@ -765,9 +769,11 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
that can accept a char* naming integral's type.
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyNumber_ConvertIntegralToInt(
PyObject *integral,
const char* error_format);
+#endif
/*
Returns the object converted to Py_ssize_t by going through
@@ -1057,11 +1063,13 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
Use __contains__ if possible, else _PySequence_IterSearch().
*/
+#ifndef Py_LIMITED_API
#define PY_ITERSEARCH_COUNT 1
#define PY_ITERSEARCH_INDEX 2
#define PY_ITERSEARCH_CONTAINS 3
PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq,
PyObject *obj, int operation);
+#endif
/*
Iterate over seq. Result depends on the operation:
PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
@@ -1228,10 +1236,15 @@ PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass);
/* issubclass(object, typeorclass) */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
+PyAPI_FUNC(char *const *) _PySequence_BytesToCharpArray(PyObject* self);
+
+PyAPI_FUNC(void) _Py_FreeCharPArray(char *const array[]);
+#endif
/* For internal use by buffer API functions */
PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
diff --git a/Include/ast.h b/Include/ast.h
index cc14b7fd76..a015336f03 100644
--- a/Include/ast.h
+++ b/Include/ast.h
@@ -4,8 +4,11 @@
extern "C" {
#endif
-PyAPI_FUNC(mod_ty) PyAST_FromNode(const node *, PyCompilerFlags *flags,
- const char *, PyArena *);
+PyAPI_FUNC(mod_ty) PyAST_FromNode(
+ const node *n,
+ PyCompilerFlags *flags,
+ const char *filename, /* decoded from the filesystem encoding */
+ PyArena *arena);
#ifdef __cplusplus
}
diff --git a/Include/bytearrayobject.h b/Include/bytearrayobject.h
index e1281a628c..eccd44c751 100644
--- a/Include/bytearrayobject.h
+++ b/Include/bytearrayobject.h
@@ -19,6 +19,7 @@ extern "C" {
*/
/* Object layout */
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_VAR_HEAD
/* XXX(nnorwitz): should ob_exports be Py_ssize_t? */
@@ -26,6 +27,7 @@ typedef struct {
Py_ssize_t ob_alloc; /* How many bytes allocated */
char *ob_bytes;
} PyByteArrayObject;
+#endif
/* Type object */
PyAPI_DATA(PyTypeObject) PyByteArray_Type;
@@ -44,12 +46,14 @@ PyAPI_FUNC(char *) PyByteArray_AsString(PyObject *);
PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);
/* Macros, trading safety for speed */
+#ifndef Py_LIMITED_API
#define PyByteArray_AS_STRING(self) \
(assert(PyByteArray_Check(self)), \
Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string)
#define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)),Py_SIZE(self))
PyAPI_DATA(char) _PyByteArray_empty_string[];
+#endif
#ifdef __cplusplus
}
diff --git a/Include/bytes_methods.h b/Include/bytes_methods.h
index 0938446e1f..1498b8f83c 100644
--- a/Include/bytes_methods.h
+++ b/Include/bytes_methods.h
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
#ifndef Py_BYTES_CTYPE_H
#define Py_BYTES_CTYPE_H
@@ -38,42 +39,8 @@ extern const char _Py_capitalize__doc__[];
extern const char _Py_swapcase__doc__[];
extern const char _Py_maketrans__doc__[];
-/* These are left in for backward compatibility and will be removed
- in 2.8/3.2 */
-#define ISLOWER(c) Py_ISLOWER(c)
-#define ISUPPER(c) Py_ISUPPER(c)
-#define ISALPHA(c) Py_ISALPHA(c)
-#define ISDIGIT(c) Py_ISDIGIT(c)
-#define ISXDIGIT(c) Py_ISXDIGIT(c)
-#define ISALNUM(c) Py_ISALNUM(c)
-#define ISSPACE(c) Py_ISSPACE(c)
-
-#undef islower
-#define islower(c) undefined_islower(c)
-#undef isupper
-#define isupper(c) undefined_isupper(c)
-#undef isalpha
-#define isalpha(c) undefined_isalpha(c)
-#undef isdigit
-#define isdigit(c) undefined_isdigit(c)
-#undef isxdigit
-#define isxdigit(c) undefined_isxdigit(c)
-#undef isalnum
-#define isalnum(c) undefined_isalnum(c)
-#undef isspace
-#define isspace(c) undefined_isspace(c)
-
-/* These are left in for backward compatibility and will be removed
- in 2.8/3.2 */
-#define TOLOWER(c) Py_TOLOWER(c)
-#define TOUPPER(c) Py_TOUPPER(c)
-
-#undef tolower
-#define tolower(c) undefined_tolower(c)
-#undef toupper
-#define toupper(c) undefined_toupper(c)
-
/* this is needed because some docs are shared from the .o, not static */
#define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str)
#endif /* !Py_BYTES_CTYPE_H */
+#endif /* !Py_LIMITED_API */
diff --git a/Include/bytesobject.h b/Include/bytesobject.h
index 916e3f7ce8..e1af89f9c9 100644
--- a/Include/bytesobject.h
+++ b/Include/bytesobject.h
@@ -27,9 +27,10 @@ functions should be applied to nil objects.
/* Caching the hash (ob_shash) saves recalculation of a string's hash value.
This significantly speeds up dict lookups. */
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_VAR_HEAD
- long ob_shash;
+ Py_hash_t ob_shash;
char ob_sval[1];
/* Invariants:
@@ -38,6 +39,7 @@ typedef struct {
* ob_shash is the hash of the string or -1 if not computed yet.
*/
} PyBytesObject;
+#endif
PyAPI_DATA(PyTypeObject) PyBytes_Type;
PyAPI_DATA(PyTypeObject) PyBytesIter_Type;
@@ -58,21 +60,27 @@ PyAPI_FUNC(char *) PyBytes_AsString(PyObject *);
PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int);
PyAPI_FUNC(void) PyBytes_Concat(PyObject **, PyObject *);
PyAPI_FUNC(void) PyBytes_ConcatAndDel(PyObject **, PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t);
PyAPI_FUNC(PyObject *) _PyBytes_FormatLong(PyObject*, int, int,
int, char**, int*);
+#endif
PyAPI_FUNC(PyObject *) PyBytes_DecodeEscape(const char *, Py_ssize_t,
const char *, Py_ssize_t,
const char *);
/* Macro, trading safety for speed */
+#ifndef Py_LIMITED_API
#define PyBytes_AS_STRING(op) (assert(PyBytes_Check(op)), \
(((PyBytesObject *)(op))->ob_sval))
#define PyBytes_GET_SIZE(op) (assert(PyBytes_Check(op)),Py_SIZE(op))
+#endif
/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*,
x must be an iterable object. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyBytes_Join(PyObject *sep, PyObject *x);
+#endif
/* Provides access to the internal data buffer and size of a string
object or the default encoded version of an Unicode object. Passing
@@ -90,7 +98,7 @@ PyAPI_FUNC(int) PyBytes_AsStringAndSize(
/* Using the current locale, insert the thousands grouping
into the string pointed to by buffer. For the argument descriptions,
see Objects/stringlib/localeutil.h */
-
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGroupingLocale(char *buffer,
Py_ssize_t n_buffer,
char *digits,
@@ -107,6 +115,7 @@ PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGrouping(char *buffer,
Py_ssize_t min_width,
const char *grouping,
const char *thousands_sep);
+#endif
/* Flags used by string formatting */
#define F_LJUST (1<<0)
diff --git a/Include/cellobject.h b/Include/cellobject.h
index c927ee5da1..a0aa4d947c 100644
--- a/Include/cellobject.h
+++ b/Include/cellobject.h
@@ -1,5 +1,5 @@
/* Cell object interface */
-
+#ifndef Py_LIMITED_API
#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
#ifdef __cplusplus
@@ -26,3 +26,4 @@ PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
}
#endif
#endif /* !Py_TUPLEOBJECT_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/ceval.h b/Include/ceval.h
index 6d240e5b68..6811367d76 100644
--- a/Include/ceval.h
+++ b/Include/ceval.h
@@ -10,10 +10,6 @@ extern "C" {
PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
PyObject *, PyObject *, PyObject *);
-/* DLL-level Backwards compatibility: */
-#undef PyEval_CallObject
-PyAPI_FUNC(PyObject *) PyEval_CallObject(PyObject *, PyObject *);
-
/* Inline this */
#define PyEval_CallObject(func,arg) \
PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)
@@ -24,8 +20,10 @@ PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
const char *methodname,
const char *format, ...);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
+#endif
struct _frame; /* Avoid including frameobject.h */
@@ -37,7 +35,9 @@ PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void);
/* Look at the current frame's (if any) code's co_flags, and turn on
the corresponding compiler flags in cf->cf_flags. Return 1 if any
flag was set, else return 0. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
+#endif
PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg);
PyAPI_FUNC(int) Py_MakePendingCalls(void);
@@ -112,10 +112,6 @@ PyAPI_FUNC(PyObject *) PyEval_GetCallStats(PyObject *);
PyAPI_FUNC(PyObject *) PyEval_EvalFrame(struct _frame *);
PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(struct _frame *f, int exc);
-/* this used to be handled on a per-thread basis - now just two globals */
-PyAPI_DATA(volatile int) _Py_Ticker;
-PyAPI_DATA(int) _Py_CheckInterval;
-
/* Interface for threads.
A module that plans to do a blocking system call (or something else
@@ -168,12 +164,18 @@ PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *);
PyAPI_FUNC(int) PyEval_ThreadsInitialized(void);
PyAPI_FUNC(void) PyEval_InitThreads(void);
+PyAPI_FUNC(void) _PyEval_FiniThreads(void);
PyAPI_FUNC(void) PyEval_AcquireLock(void);
PyAPI_FUNC(void) PyEval_ReleaseLock(void);
PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate);
PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
PyAPI_FUNC(void) PyEval_ReInitThreads(void);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds);
+PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void);
+#endif
+
#define Py_BEGIN_ALLOW_THREADS { \
PyThreadState *_save; \
_save = PyEval_SaveThread();
@@ -191,7 +193,10 @@ PyAPI_FUNC(void) PyEval_ReInitThreads(void);
#endif /* !WITH_THREAD */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
+PyAPI_FUNC(void) _PyEval_SignalAsyncExc(void);
+#endif
#ifdef __cplusplus
diff --git a/Include/classobject.h b/Include/classobject.h
index b7eebe5e95..eeeb3e95a8 100644
--- a/Include/classobject.h
+++ b/Include/classobject.h
@@ -2,6 +2,7 @@
/* Revealing some structures (not for general use) */
+#ifndef Py_LIMITED_API
#ifndef Py_CLASSOBJECT_H
#define Py_CLASSOBJECT_H
#ifdef __cplusplus
@@ -54,3 +55,4 @@ PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
}
#endif
#endif /* !Py_CLASSOBJECT_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/cobject.h b/Include/cobject.h
deleted file mode 100644
index 9efe4ce845..0000000000
--- a/Include/cobject.h
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/*
-
-The CObject module is now *deprecated* as of Python 3.1.
-Please use the Capsule API instead; see "pycapsule.h".
-
-*/
-
-#ifndef Py_COBJECT_H
-#define Py_COBJECT_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-PyAPI_DATA(PyTypeObject) PyCObject_Type;
-
-#define PyCObject_Check(op) (Py_TYPE(op) == &PyCObject_Type)
-
-/* Create a PyCObject from a pointer to a C object and an optional
- destructor function. If the second argument is non-null, then it
- will be called with the first argument if and when the PyCObject is
- destroyed.
-
-*/
-PyAPI_FUNC(PyObject *) PyCObject_FromVoidPtr(
- void *cobj, void (*destruct)(void*));
-
-
-/* Create a PyCObject from a pointer to a C object, a description object,
- and an optional destructor function. If the third argument is non-null,
- then it will be called with the first and second arguments if and when
- the PyCObject is destroyed.
-*/
-PyAPI_FUNC(PyObject *) PyCObject_FromVoidPtrAndDesc(
- void *cobj, void *desc, void (*destruct)(void*,void*));
-
-/* Retrieve a pointer to a C object from a PyCObject. */
-PyAPI_FUNC(void *) PyCObject_AsVoidPtr(PyObject *);
-
-/* Retrieve a pointer to a description object from a PyCObject. */
-PyAPI_FUNC(void *) PyCObject_GetDesc(PyObject *);
-
-/* Import a pointer to a C object from a module using a PyCObject. */
-PyAPI_FUNC(void *) PyCObject_Import(char *module_name, char *cobject_name);
-
-/* Modify a C object. Fails (==0) if object has a destructor. */
-PyAPI_FUNC(int) PyCObject_SetVoidPtr(PyObject *self, void *cobj);
-
-
-typedef struct {
- PyObject_HEAD
- void *cobject;
- void *desc;
- void (*destructor)(void *);
-} PyCObject;
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !Py_COBJECT_H */
diff --git a/Include/code.h b/Include/code.h
index efaf3c415b..e773b6a47c 100644
--- a/Include/code.h
+++ b/Include/code.h
@@ -1,5 +1,6 @@
/* Definitions for bytecode */
+#ifndef Py_LIMITED_API
#ifndef Py_CODE_H
#define Py_CODE_H
#ifdef __cplusplus
@@ -24,8 +25,10 @@ typedef struct {
PyObject *co_filename; /* unicode (where it was loaded from) */
PyObject *co_name; /* unicode (name, for reference) */
int co_firstlineno; /* first source line number */
- PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) */
+ PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See
+ Objects/lnotab_notes.txt for details. */
void *co_zombieframe; /* for optimization only (see frameobject.c) */
+ PyObject *co_weakreflist; /* to support weakrefs to code objects */
} PyCodeObject;
/* Masks for co_flags above */
@@ -70,8 +73,16 @@ PyAPI_DATA(PyTypeObject) PyCode_Type;
PyAPI_FUNC(PyCodeObject *) PyCode_New(
int, int, int, int, int, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *,
- PyObject *, PyObject *, int, PyObject *);
+ PyObject *, PyObject *, int, PyObject *);
/* same as struct above */
+
+/* Creates a new empty code object with the specified source location. */
+PyAPI_FUNC(PyCodeObject *)
+PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno);
+
+/* Return the line number associated with the specified bytecode index
+ in this code object. If you just need the line number of a frame,
+ use PyFrame_GetLineNumber() instead. */
PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
/* for internal use only */
@@ -80,15 +91,13 @@ typedef struct _addr_pair {
int ap_upper;
} PyAddrPair;
-/* Check whether lasti (an instruction offset) falls outside bounds
- and whether it is a line number that should be traced. Returns
- a line number if it should be traced or -1 if the line should not.
-
- If lasti is not within bounds, updates bounds.
+/* Update *bounds to describe the first and one-past-the-last instructions in the
+ same line as lasti. Return the number of that line.
*/
-
-PyAPI_FUNC(int) PyCode_CheckLineNumber(PyCodeObject* co,
- int lasti, PyAddrPair *bounds);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co,
+ int lasti, PyAddrPair *bounds);
+#endif
PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
PyObject *names, PyObject *lineno_obj);
@@ -97,3 +106,4 @@ PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
}
#endif
#endif /* !Py_CODE_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/codecs.h b/Include/codecs.h
index 4ea934e861..dff09e778b 100644
--- a/Include/codecs.h
+++ b/Include/codecs.h
@@ -45,9 +45,11 @@ PyAPI_FUNC(int) PyCodec_Register(
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyCodec_Lookup(
const char *encoding
);
+#endif
/* Codec registry encoding check API.
diff --git a/Include/compile.h b/Include/compile.h
index 7c329b3e6d..bc53b39239 100644
--- a/Include/compile.h
+++ b/Include/compile.h
@@ -1,4 +1,4 @@
-
+#ifndef Py_LIMITED_API
#ifndef Py_COMPILE_H
#define Py_COMPILE_H
@@ -29,8 +29,13 @@ typedef struct {
#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL"
struct _mod; /* Declare the existence of this type */
-PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *,
- PyCompilerFlags *, PyArena *);
+#define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar)
+PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx(
+ struct _mod *mod,
+ const char *filename, /* decoded from the filesystem encoding */
+ PyCompilerFlags *flags,
+ int optimize,
+ PyArena *arena);
PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
@@ -38,3 +43,4 @@ PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
}
#endif
#endif /* !Py_COMPILE_H */
+#endif /* !Py_LIMITED_API */
diff --git a/Include/complexobject.h b/Include/complexobject.h
index 8290a6dc4f..c379b08916 100644
--- a/Include/complexobject.h
+++ b/Include/complexobject.h
@@ -6,6 +6,7 @@
extern "C" {
#endif
+#ifndef Py_LIMITED_API
typedef struct {
double real;
double imag;
@@ -28,7 +29,7 @@ PyAPI_FUNC(Py_complex) c_prod(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex);
PyAPI_FUNC(double) c_abs(Py_complex);
-
+#endif
/* Complex object interface */
@@ -36,29 +37,36 @@ PyAPI_FUNC(double) c_abs(Py_complex);
PyComplexObject represents a complex number with double-precision
real and imaginary parts.
*/
-
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
Py_complex cval;
-} PyComplexObject;
+} PyComplexObject;
+#endif
PyAPI_DATA(PyTypeObject) PyComplex_Type;
#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
#define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type)
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
+#endif
PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
+#endif
/* Format the object based on the format_spec, as defined in PEP 3101
(Advanced String Formatting). */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj,
Py_UNICODE *format_spec,
Py_ssize_t format_spec_len);
+#endif
#ifdef __cplusplus
}
diff --git a/Include/datetime.h b/Include/datetime.h
index cb9679907f..db57a18e66 100644
--- a/Include/datetime.h
+++ b/Include/datetime.h
@@ -1,6 +1,6 @@
/* datetime.h
*/
-
+#ifndef Py_LIMITED_API
#ifndef DATETIME_H
#define DATETIME_H
#ifdef __cplusplus
@@ -34,7 +34,7 @@ extern "C" {
typedef struct
{
PyObject_HEAD
- long hashcode; /* -1 when unknown */
+ Py_hash_t hashcode; /* -1 when unknown */
int days; /* -MAX_DELTA_DAYS <= days <= MAX_DELTA_DAYS */
int seconds; /* 0 <= seconds < 24*3600 is invariant */
int microseconds; /* 0 <= microseconds < 1000000 is invariant */
@@ -51,7 +51,7 @@ typedef struct
*/
#define _PyTZINFO_HEAD \
PyObject_HEAD \
- long hashcode; \
+ Py_hash_t hashcode; \
char hastzinfo; /* boolean flag */
/* No _PyDateTime_BaseTZInfo is allocated; it's just to have something
@@ -182,7 +182,7 @@ typedef struct {
#else
/* Define global variable for the C API and a macro for setting it. */
-static PyDateTime_CAPI *PyDateTimeAPI;
+static PyDateTime_CAPI *PyDateTimeAPI = NULL;
#define PyDateTime_IMPORT \
PyDateTimeAPI = (PyDateTime_CAPI *)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0)
@@ -234,3 +234,4 @@ static PyDateTime_CAPI *PyDateTimeAPI;
}
#endif
#endif
+#endif /* !Py_LIMITED_API */
diff --git a/Include/descrobject.h b/Include/descrobject.h
index d2fe109199..f715fe1160 100644
--- a/Include/descrobject.h
+++ b/Include/descrobject.h
@@ -16,6 +16,7 @@ typedef struct PyGetSetDef {
void *closure;
} PyGetSetDef;
+#ifndef Py_LIMITED_API
typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
void *wrapped);
@@ -37,15 +38,17 @@ struct wrapperbase {
/* Various kinds of descriptor objects */
-#define PyDescr_COMMON \
- PyObject_HEAD \
- PyTypeObject *d_type; \
- PyObject *d_name
-
typedef struct {
- PyDescr_COMMON;
+ PyObject_HEAD
+ PyTypeObject *d_type;
+ PyObject *d_name;
} PyDescrObject;
+#define PyDescr_COMMON PyDescrObject d_common
+
+#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
+#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
+
typedef struct {
PyDescr_COMMON;
PyMethodDef *d_method;
@@ -66,6 +69,7 @@ typedef struct {
struct wrapperbase *d_base;
void *d_wrapped; /* This can be any function pointer */
} PyWrapperDescrObject;
+#endif /* Py_LIMITED_API */
PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type;
PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
@@ -76,13 +80,16 @@ PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
+struct PyMemberDef; /* forward declaration for following prototype */
PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *,
struct PyMemberDef *);
PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *,
struct PyGetSetDef *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
struct wrapperbase *, void *);
#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)
+#endif
PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);
diff --git a/Include/dictobject.h b/Include/dictobject.h
index d1b576c626..b026785919 100644
--- a/Include/dictobject.h
+++ b/Include/dictobject.h
@@ -45,14 +45,12 @@ meaning otherwise.
* majority of dicts (consisting mostly of usually-small instance dicts and
* usually-small dicts created to pass keyword arguments).
*/
+#ifndef Py_LIMITED_API
#define PyDict_MINSIZE 8
typedef struct {
- /* Cached hash code of me_key. Note that hash codes are C longs.
- * We have to use Py_ssize_t instead because dict_popitem() abuses
- * me_hash to hold a search finger.
- */
- Py_ssize_t me_hash;
+ /* Cached hash code of me_key. */
+ Py_hash_t me_hash;
PyObject *me_key;
PyObject *me_value;
} PyDictEntry;
@@ -84,9 +82,10 @@ struct _dictobject {
* setitem calls.
*/
PyDictEntry *ma_table;
- PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash);
+ PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, Py_hash_t hash);
PyDictEntry ma_smalltable[PyDict_MINSIZE];
};
+#endif /* Py_LIMITED_API */
PyAPI_DATA(PyTypeObject) PyDict_Type;
PyAPI_DATA(PyTypeObject) PyDictIterKey_Type;
@@ -115,17 +114,22 @@ PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key);
PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
PyAPI_FUNC(int) PyDict_Next(
PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyDict_Next(
- PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, long *hash);
+ PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash);
+#endif
PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp);
PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp);
PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key);
-PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, long hash);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, Py_hash_t hash);
PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused);
PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp);
+PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp);
+#endif
/* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */
PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other);
diff --git a/Include/dtoa.h b/Include/dtoa.h
index 9b434b77b6..819bd0f207 100644
--- a/Include/dtoa.h
+++ b/Include/dtoa.h
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
#ifndef PY_NO_SHORT_FLOAT_REPR
#ifdef __cplusplus
extern "C" {
@@ -13,3 +14,4 @@ PyAPI_FUNC(void) _Py_dg_freedtoa(char *s);
}
#endif
#endif
+#endif
diff --git a/Include/dynamic_annotations.h b/Include/dynamic_annotations.h
new file mode 100644
index 0000000000..2f33294c55
--- /dev/null
+++ b/Include/dynamic_annotations.h
@@ -0,0 +1,499 @@
+/* Copyright (c) 2008-2009, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ---
+ * Author: Kostya Serebryany
+ * Copied to CPython by Jeffrey Yasskin, with all macros renamed to
+ * start with _Py_ to avoid colliding with users embedding Python, and
+ * with deprecated macros removed.
+ */
+
+/* This file defines dynamic annotations for use with dynamic analysis
+ tool such as valgrind, PIN, etc.
+
+ Dynamic annotation is a source code annotation that affects
+ the generated code (that is, the annotation is not a comment).
+ Each such annotation is attached to a particular
+ instruction and/or to a particular object (address) in the program.
+
+ The annotations that should be used by users are macros in all upper-case
+ (e.g., _Py_ANNOTATE_NEW_MEMORY).
+
+ Actual implementation of these macros may differ depending on the
+ dynamic analysis tool being used.
+
+ See http://code.google.com/p/data-race-test/ for more information.
+
+ This file supports the following dynamic analysis tools:
+ - None (DYNAMIC_ANNOTATIONS_ENABLED is not defined or zero).
+ Macros are defined empty.
+ - ThreadSanitizer, Helgrind, DRD (DYNAMIC_ANNOTATIONS_ENABLED is 1).
+ Macros are defined as calls to non-inlinable empty functions
+ that are intercepted by Valgrind. */
+
+#ifndef __DYNAMIC_ANNOTATIONS_H__
+#define __DYNAMIC_ANNOTATIONS_H__
+
+#ifndef DYNAMIC_ANNOTATIONS_ENABLED
+# define DYNAMIC_ANNOTATIONS_ENABLED 0
+#endif
+
+#if DYNAMIC_ANNOTATIONS_ENABLED != 0
+
+ /* -------------------------------------------------------------
+ Annotations useful when implementing condition variables such as CondVar,
+ using conditional critical sections (Await/LockWhen) and when constructing
+ user-defined synchronization mechanisms.
+
+ The annotations _Py_ANNOTATE_HAPPENS_BEFORE() and
+ _Py_ANNOTATE_HAPPENS_AFTER() can be used to define happens-before arcs in
+ user-defined synchronization mechanisms: the race detector will infer an
+ arc from the former to the latter when they share the same argument
+ pointer.
+
+ Example 1 (reference counting):
+
+ void Unref() {
+ _Py_ANNOTATE_HAPPENS_BEFORE(&refcount_);
+ if (AtomicDecrementByOne(&refcount_) == 0) {
+ _Py_ANNOTATE_HAPPENS_AFTER(&refcount_);
+ delete this;
+ }
+ }
+
+ Example 2 (message queue):
+
+ void MyQueue::Put(Type *e) {
+ MutexLock lock(&mu_);
+ _Py_ANNOTATE_HAPPENS_BEFORE(e);
+ PutElementIntoMyQueue(e);
+ }
+
+ Type *MyQueue::Get() {
+ MutexLock lock(&mu_);
+ Type *e = GetElementFromMyQueue();
+ _Py_ANNOTATE_HAPPENS_AFTER(e);
+ return e;
+ }
+
+ Note: when possible, please use the existing reference counting and message
+ queue implementations instead of inventing new ones. */
+
+ /* Report that wait on the condition variable at address "cv" has succeeded
+ and the lock at address "lock" is held. */
+ #define _Py_ANNOTATE_CONDVAR_LOCK_WAIT(cv, lock) \
+ AnnotateCondVarWait(__FILE__, __LINE__, cv, lock)
+
+ /* Report that wait on the condition variable at "cv" has succeeded. Variant
+ w/o lock. */
+ #define _Py_ANNOTATE_CONDVAR_WAIT(cv) \
+ AnnotateCondVarWait(__FILE__, __LINE__, cv, NULL)
+
+ /* Report that we are about to signal on the condition variable at address
+ "cv". */
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL(cv) \
+ AnnotateCondVarSignal(__FILE__, __LINE__, cv)
+
+ /* Report that we are about to signal_all on the condition variable at "cv". */
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL_ALL(cv) \
+ AnnotateCondVarSignalAll(__FILE__, __LINE__, cv)
+
+ /* Annotations for user-defined synchronization mechanisms. */
+ #define _Py_ANNOTATE_HAPPENS_BEFORE(obj) _Py_ANNOTATE_CONDVAR_SIGNAL(obj)
+ #define _Py_ANNOTATE_HAPPENS_AFTER(obj) _Py_ANNOTATE_CONDVAR_WAIT(obj)
+
+ /* Report that the bytes in the range [pointer, pointer+size) are about
+ to be published safely. The race checker will create a happens-before
+ arc from the call _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) to
+ subsequent accesses to this memory.
+ Note: this annotation may not work properly if the race detector uses
+ sampling, i.e. does not observe all memory accesses.
+ */
+ #define _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) \
+ AnnotatePublishMemoryRange(__FILE__, __LINE__, pointer, size)
+
+ /* Instruct the tool to create a happens-before arc between mu->Unlock() and
+ mu->Lock(). This annotation may slow down the race detector and hide real
+ races. Normally it is used only when it would be difficult to annotate each
+ of the mutex's critical sections individually using the annotations above.
+ This annotation makes sense only for hybrid race detectors. For pure
+ happens-before detectors this is a no-op. For more details see
+ http://code.google.com/p/data-race-test/wiki/PureHappensBeforeVsHybrid . */
+ #define _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mu) \
+ AnnotateMutexIsUsedAsCondVar(__FILE__, __LINE__, mu)
+
+ /* -------------------------------------------------------------
+ Annotations useful when defining memory allocators, or when memory that
+ was protected in one way starts to be protected in another. */
+
+ /* Report that a new memory at "address" of size "size" has been allocated.
+ This might be used when the memory has been retrieved from a free list and
+ is about to be reused, or when a the locking discipline for a variable
+ changes. */
+ #define _Py_ANNOTATE_NEW_MEMORY(address, size) \
+ AnnotateNewMemory(__FILE__, __LINE__, address, size)
+
+ /* -------------------------------------------------------------
+ Annotations useful when defining FIFO queues that transfer data between
+ threads. */
+
+ /* Report that the producer-consumer queue (such as ProducerConsumerQueue) at
+ address "pcq" has been created. The _Py_ANNOTATE_PCQ_* annotations should
+ be used only for FIFO queues. For non-FIFO queues use
+ _Py_ANNOTATE_HAPPENS_BEFORE (for put) and _Py_ANNOTATE_HAPPENS_AFTER (for
+ get). */
+ #define _Py_ANNOTATE_PCQ_CREATE(pcq) \
+ AnnotatePCQCreate(__FILE__, __LINE__, pcq)
+
+ /* Report that the queue at address "pcq" is about to be destroyed. */
+ #define _Py_ANNOTATE_PCQ_DESTROY(pcq) \
+ AnnotatePCQDestroy(__FILE__, __LINE__, pcq)
+
+ /* Report that we are about to put an element into a FIFO queue at address
+ "pcq". */
+ #define _Py_ANNOTATE_PCQ_PUT(pcq) \
+ AnnotatePCQPut(__FILE__, __LINE__, pcq)
+
+ /* Report that we've just got an element from a FIFO queue at address "pcq". */
+ #define _Py_ANNOTATE_PCQ_GET(pcq) \
+ AnnotatePCQGet(__FILE__, __LINE__, pcq)
+
+ /* -------------------------------------------------------------
+ Annotations that suppress errors. It is usually better to express the
+ program's synchronization using the other annotations, but these can
+ be used when all else fails. */
+
+ /* Report that we may have a benign race at "pointer", with size
+ "sizeof(*(pointer))". "pointer" must be a non-void* pointer. Insert at the
+ point where "pointer" has been allocated, preferably close to the point
+ where the race happens. See also _Py_ANNOTATE_BENIGN_RACE_STATIC. */
+ #define _Py_ANNOTATE_BENIGN_RACE(pointer, description) \
+ AnnotateBenignRaceSized(__FILE__, __LINE__, pointer, \
+ sizeof(*(pointer)), description)
+
+ /* Same as _Py_ANNOTATE_BENIGN_RACE(address, description), but applies to
+ the memory range [address, address+size). */
+ #define _Py_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \
+ AnnotateBenignRaceSized(__FILE__, __LINE__, address, size, description)
+
+ /* Request the analysis tool to ignore all reads in the current thread
+ until _Py_ANNOTATE_IGNORE_READS_END is called.
+ Useful to ignore intentional racey reads, while still checking
+ other reads and all writes.
+ See also _Py_ANNOTATE_UNPROTECTED_READ. */
+ #define _Py_ANNOTATE_IGNORE_READS_BEGIN() \
+ AnnotateIgnoreReadsBegin(__FILE__, __LINE__)
+
+ /* Stop ignoring reads. */
+ #define _Py_ANNOTATE_IGNORE_READS_END() \
+ AnnotateIgnoreReadsEnd(__FILE__, __LINE__)
+
+ /* Similar to _Py_ANNOTATE_IGNORE_READS_BEGIN, but ignore writes. */
+ #define _Py_ANNOTATE_IGNORE_WRITES_BEGIN() \
+ AnnotateIgnoreWritesBegin(__FILE__, __LINE__)
+
+ /* Stop ignoring writes. */
+ #define _Py_ANNOTATE_IGNORE_WRITES_END() \
+ AnnotateIgnoreWritesEnd(__FILE__, __LINE__)
+
+ /* Start ignoring all memory accesses (reads and writes). */
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \
+ do {\
+ _Py_ANNOTATE_IGNORE_READS_BEGIN();\
+ _Py_ANNOTATE_IGNORE_WRITES_BEGIN();\
+ }while(0)\
+
+ /* Stop ignoring all memory accesses. */
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_END() \
+ do {\
+ _Py_ANNOTATE_IGNORE_WRITES_END();\
+ _Py_ANNOTATE_IGNORE_READS_END();\
+ }while(0)\
+
+ /* Similar to _Py_ANNOTATE_IGNORE_READS_BEGIN, but ignore synchronization events:
+ RWLOCK* and CONDVAR*. */
+ #define _Py_ANNOTATE_IGNORE_SYNC_BEGIN() \
+ AnnotateIgnoreSyncBegin(__FILE__, __LINE__)
+
+ /* Stop ignoring sync events. */
+ #define _Py_ANNOTATE_IGNORE_SYNC_END() \
+ AnnotateIgnoreSyncEnd(__FILE__, __LINE__)
+
+
+ /* Enable (enable!=0) or disable (enable==0) race detection for all threads.
+ This annotation could be useful if you want to skip expensive race analysis
+ during some period of program execution, e.g. during initialization. */
+ #define _Py_ANNOTATE_ENABLE_RACE_DETECTION(enable) \
+ AnnotateEnableRaceDetection(__FILE__, __LINE__, enable)
+
+ /* -------------------------------------------------------------
+ Annotations useful for debugging. */
+
+ /* Request to trace every access to "address". */
+ #define _Py_ANNOTATE_TRACE_MEMORY(address) \
+ AnnotateTraceMemory(__FILE__, __LINE__, address)
+
+ /* Report the current thread name to a race detector. */
+ #define _Py_ANNOTATE_THREAD_NAME(name) \
+ AnnotateThreadName(__FILE__, __LINE__, name)
+
+ /* -------------------------------------------------------------
+ Annotations useful when implementing locks. They are not
+ normally needed by modules that merely use locks.
+ The "lock" argument is a pointer to the lock object. */
+
+ /* Report that a lock has been created at address "lock". */
+ #define _Py_ANNOTATE_RWLOCK_CREATE(lock) \
+ AnnotateRWLockCreate(__FILE__, __LINE__, lock)
+
+ /* Report that the lock at address "lock" is about to be destroyed. */
+ #define _Py_ANNOTATE_RWLOCK_DESTROY(lock) \
+ AnnotateRWLockDestroy(__FILE__, __LINE__, lock)
+
+ /* Report that the lock at address "lock" has been acquired.
+ is_w=1 for writer lock, is_w=0 for reader lock. */
+ #define _Py_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \
+ AnnotateRWLockAcquired(__FILE__, __LINE__, lock, is_w)
+
+ /* Report that the lock at address "lock" is about to be released. */
+ #define _Py_ANNOTATE_RWLOCK_RELEASED(lock, is_w) \
+ AnnotateRWLockReleased(__FILE__, __LINE__, lock, is_w)
+
+ /* -------------------------------------------------------------
+ Annotations useful when implementing barriers. They are not
+ normally needed by modules that merely use barriers.
+ The "barrier" argument is a pointer to the barrier object. */
+
+ /* Report that the "barrier" has been initialized with initial "count".
+ If 'reinitialization_allowed' is true, initialization is allowed to happen
+ multiple times w/o calling barrier_destroy() */
+ #define _Py_ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) \
+ AnnotateBarrierInit(__FILE__, __LINE__, barrier, count, \
+ reinitialization_allowed)
+
+ /* Report that we are about to enter barrier_wait("barrier"). */
+ #define _Py_ANNOTATE_BARRIER_WAIT_BEFORE(barrier) \
+ AnnotateBarrierWaitBefore(__FILE__, __LINE__, barrier)
+
+ /* Report that we just exited barrier_wait("barrier"). */
+ #define _Py_ANNOTATE_BARRIER_WAIT_AFTER(barrier) \
+ AnnotateBarrierWaitAfter(__FILE__, __LINE__, barrier)
+
+ /* Report that the "barrier" has been destroyed. */
+ #define _Py_ANNOTATE_BARRIER_DESTROY(barrier) \
+ AnnotateBarrierDestroy(__FILE__, __LINE__, barrier)
+
+ /* -------------------------------------------------------------
+ Annotations useful for testing race detectors. */
+
+ /* Report that we expect a race on the variable at "address".
+ Use only in unit tests for a race detector. */
+ #define _Py_ANNOTATE_EXPECT_RACE(address, description) \
+ AnnotateExpectRace(__FILE__, __LINE__, address, description)
+
+ /* A no-op. Insert where you like to test the interceptors. */
+ #define _Py_ANNOTATE_NO_OP(arg) \
+ AnnotateNoOp(__FILE__, __LINE__, arg)
+
+ /* Force the race detector to flush its state. The actual effect depends on
+ * the implementation of the detector. */
+ #define _Py_ANNOTATE_FLUSH_STATE() \
+ AnnotateFlushState(__FILE__, __LINE__)
+
+
+#else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */
+
+ #define _Py_ANNOTATE_RWLOCK_CREATE(lock) /* empty */
+ #define _Py_ANNOTATE_RWLOCK_DESTROY(lock) /* empty */
+ #define _Py_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) /* empty */
+ #define _Py_ANNOTATE_RWLOCK_RELEASED(lock, is_w) /* empty */
+ #define _Py_ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) /* */
+ #define _Py_ANNOTATE_BARRIER_WAIT_BEFORE(barrier) /* empty */
+ #define _Py_ANNOTATE_BARRIER_WAIT_AFTER(barrier) /* empty */
+ #define _Py_ANNOTATE_BARRIER_DESTROY(barrier) /* empty */
+ #define _Py_ANNOTATE_CONDVAR_LOCK_WAIT(cv, lock) /* empty */
+ #define _Py_ANNOTATE_CONDVAR_WAIT(cv) /* empty */
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL(cv) /* empty */
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL_ALL(cv) /* empty */
+ #define _Py_ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
+ #define _Py_ANNOTATE_HAPPENS_AFTER(obj) /* empty */
+ #define _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(address, size) /* empty */
+ #define _Py_ANNOTATE_UNPUBLISH_MEMORY_RANGE(address, size) /* empty */
+ #define _Py_ANNOTATE_SWAP_MEMORY_RANGE(address, size) /* empty */
+ #define _Py_ANNOTATE_PCQ_CREATE(pcq) /* empty */
+ #define _Py_ANNOTATE_PCQ_DESTROY(pcq) /* empty */
+ #define _Py_ANNOTATE_PCQ_PUT(pcq) /* empty */
+ #define _Py_ANNOTATE_PCQ_GET(pcq) /* empty */
+ #define _Py_ANNOTATE_NEW_MEMORY(address, size) /* empty */
+ #define _Py_ANNOTATE_EXPECT_RACE(address, description) /* empty */
+ #define _Py_ANNOTATE_BENIGN_RACE(address, description) /* empty */
+ #define _Py_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) /* empty */
+ #define _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mu) /* empty */
+ #define _Py_ANNOTATE_MUTEX_IS_USED_AS_CONDVAR(mu) /* empty */
+ #define _Py_ANNOTATE_TRACE_MEMORY(arg) /* empty */
+ #define _Py_ANNOTATE_THREAD_NAME(name) /* empty */
+ #define _Py_ANNOTATE_IGNORE_READS_BEGIN() /* empty */
+ #define _Py_ANNOTATE_IGNORE_READS_END() /* empty */
+ #define _Py_ANNOTATE_IGNORE_WRITES_BEGIN() /* empty */
+ #define _Py_ANNOTATE_IGNORE_WRITES_END() /* empty */
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() /* empty */
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_END() /* empty */
+ #define _Py_ANNOTATE_IGNORE_SYNC_BEGIN() /* empty */
+ #define _Py_ANNOTATE_IGNORE_SYNC_END() /* empty */
+ #define _Py_ANNOTATE_ENABLE_RACE_DETECTION(enable) /* empty */
+ #define _Py_ANNOTATE_NO_OP(arg) /* empty */
+ #define _Py_ANNOTATE_FLUSH_STATE() /* empty */
+
+#endif /* DYNAMIC_ANNOTATIONS_ENABLED */
+
+/* Use the macros above rather than using these functions directly. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+void AnnotateRWLockCreate(const char *file, int line,
+ const volatile void *lock);
+void AnnotateRWLockDestroy(const char *file, int line,
+ const volatile void *lock);
+void AnnotateRWLockAcquired(const char *file, int line,
+ const volatile void *lock, long is_w);
+void AnnotateRWLockReleased(const char *file, int line,
+ const volatile void *lock, long is_w);
+void AnnotateBarrierInit(const char *file, int line,
+ const volatile void *barrier, long count,
+ long reinitialization_allowed);
+void AnnotateBarrierWaitBefore(const char *file, int line,
+ const volatile void *barrier);
+void AnnotateBarrierWaitAfter(const char *file, int line,
+ const volatile void *barrier);
+void AnnotateBarrierDestroy(const char *file, int line,
+ const volatile void *barrier);
+void AnnotateCondVarWait(const char *file, int line,
+ const volatile void *cv,
+ const volatile void *lock);
+void AnnotateCondVarSignal(const char *file, int line,
+ const volatile void *cv);
+void AnnotateCondVarSignalAll(const char *file, int line,
+ const volatile void *cv);
+void AnnotatePublishMemoryRange(const char *file, int line,
+ const volatile void *address,
+ long size);
+void AnnotateUnpublishMemoryRange(const char *file, int line,
+ const volatile void *address,
+ long size);
+void AnnotatePCQCreate(const char *file, int line,
+ const volatile void *pcq);
+void AnnotatePCQDestroy(const char *file, int line,
+ const volatile void *pcq);
+void AnnotatePCQPut(const char *file, int line,
+ const volatile void *pcq);
+void AnnotatePCQGet(const char *file, int line,
+ const volatile void *pcq);
+void AnnotateNewMemory(const char *file, int line,
+ const volatile void *address,
+ long size);
+void AnnotateExpectRace(const char *file, int line,
+ const volatile void *address,
+ const char *description);
+void AnnotateBenignRace(const char *file, int line,
+ const volatile void *address,
+ const char *description);
+void AnnotateBenignRaceSized(const char *file, int line,
+ const volatile void *address,
+ long size,
+ const char *description);
+void AnnotateMutexIsUsedAsCondVar(const char *file, int line,
+ const volatile void *mu);
+void AnnotateTraceMemory(const char *file, int line,
+ const volatile void *arg);
+void AnnotateThreadName(const char *file, int line,
+ const char *name);
+void AnnotateIgnoreReadsBegin(const char *file, int line);
+void AnnotateIgnoreReadsEnd(const char *file, int line);
+void AnnotateIgnoreWritesBegin(const char *file, int line);
+void AnnotateIgnoreWritesEnd(const char *file, int line);
+void AnnotateEnableRaceDetection(const char *file, int line, int enable);
+void AnnotateNoOp(const char *file, int line,
+ const volatile void *arg);
+void AnnotateFlushState(const char *file, int line);
+
+/* Return non-zero value if running under valgrind.
+
+ If "valgrind.h" is included into dynamic_annotations.c,
+ the regular valgrind mechanism will be used.
+ See http://valgrind.org/docs/manual/manual-core-adv.html about
+ RUNNING_ON_VALGRIND and other valgrind "client requests".
+ The file "valgrind.h" may be obtained by doing
+ svn co svn://svn.valgrind.org/valgrind/trunk/include
+
+ If for some reason you can't use "valgrind.h" or want to fake valgrind,
+ there are two ways to make this function return non-zero:
+ - Use environment variable: export RUNNING_ON_VALGRIND=1
+ - Make your tool intercept the function RunningOnValgrind() and
+ change its return value.
+ */
+int RunningOnValgrind(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#if DYNAMIC_ANNOTATIONS_ENABLED != 0 && defined(__cplusplus)
+
+ /* _Py_ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads.
+
+ Instead of doing
+ _Py_ANNOTATE_IGNORE_READS_BEGIN();
+ ... = x;
+ _Py_ANNOTATE_IGNORE_READS_END();
+ one can use
+ ... = _Py_ANNOTATE_UNPROTECTED_READ(x); */
+ template <class T>
+ inline T _Py_ANNOTATE_UNPROTECTED_READ(const volatile T &x) {
+ _Py_ANNOTATE_IGNORE_READS_BEGIN();
+ T res = x;
+ _Py_ANNOTATE_IGNORE_READS_END();
+ return res;
+ }
+ /* Apply _Py_ANNOTATE_BENIGN_RACE_SIZED to a static variable. */
+ #define _Py_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \
+ namespace { \
+ class static_var ## _annotator { \
+ public: \
+ static_var ## _annotator() { \
+ _Py_ANNOTATE_BENIGN_RACE_SIZED(&static_var, \
+ sizeof(static_var), \
+ # static_var ": " description); \
+ } \
+ }; \
+ static static_var ## _annotator the ## static_var ## _annotator;\
+ }
+#else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */
+
+ #define _Py_ANNOTATE_UNPROTECTED_READ(x) (x)
+ #define _Py_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) /* empty */
+
+#endif /* DYNAMIC_ANNOTATIONS_ENABLED */
+
+#endif /* __DYNAMIC_ANNOTATIONS_H__ */
diff --git a/Include/eval.h b/Include/eval.h
index 1d03c972f7..a1c6e817dd 100644
--- a/Include/eval.h
+++ b/Include/eval.h
@@ -7,9 +7,9 @@
extern "C" {
#endif
-PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *);
+PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *);
-PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co,
+PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co,
PyObject *globals,
PyObject *locals,
PyObject **args, int argc,
@@ -17,7 +17,9 @@ PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co,
PyObject **defs, int defc,
PyObject *kwdefs, PyObject *closure);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args);
+#endif
#ifdef __cplusplus
}
diff --git a/Include/fileobject.h b/Include/fileobject.h
index 6e0e55e3ee..c4a2a2bb15 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -14,19 +14,21 @@ PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
+#endif
/* The default encoding used by the platform file system APIs
If non-NULL, this is different than the default encoding for strings
*/
PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
-PyAPI_FUNC(int) _Py_SetFileSystemEncoding(PyObject *);
/* Internal API
The std printer acts as a preliminary sys.stderr until the new io
infrastructure is in place. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
@@ -40,6 +42,7 @@ int _PyVerify_fd(int fd);
#else
#define _PyVerify_fd(A) (1) /* dummy */
#endif
+#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
diff --git a/Include/fileutils.h b/Include/fileutils.h
new file mode 100644
index 0000000000..2fade9b95c
--- /dev/null
+++ b/Include/fileutils.h
@@ -0,0 +1,58 @@
+#ifndef Py_FILEUTILS_H
+#define Py_FILEUTILS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+PyAPI_FUNC(wchar_t *) _Py_char2wchar(
+ const char *arg,
+ size_t *size);
+
+PyAPI_FUNC(char*) _Py_wchar2char(
+ const wchar_t *text,
+ size_t *error_pos);
+
+#if defined(HAVE_STAT) && !defined(MS_WINDOWS)
+PyAPI_FUNC(int) _Py_wstat(
+ const wchar_t* path,
+ struct stat *buf);
+#endif
+
+#ifdef HAVE_STAT
+PyAPI_FUNC(int) _Py_stat(
+ PyObject *path,
+ struct stat *statbuf);
+#endif
+
+PyAPI_FUNC(FILE *) _Py_wfopen(
+ const wchar_t *path,
+ const wchar_t *mode);
+
+PyAPI_FUNC(FILE*) _Py_fopen(
+ PyObject *path,
+ const char *mode);
+
+#ifdef HAVE_READLINK
+PyAPI_FUNC(int) _Py_wreadlink(
+ const wchar_t *path,
+ wchar_t *buf,
+ size_t bufsiz);
+#endif
+
+#ifdef HAVE_REALPATH
+PyAPI_FUNC(wchar_t*) _Py_wrealpath(
+ const wchar_t *path,
+ wchar_t *resolved_path,
+ size_t resolved_path_size);
+#endif
+
+PyAPI_FUNC(wchar_t*) _Py_wgetcwd(
+ wchar_t *buf,
+ size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !Py_FILEUTILS_H */
diff --git a/Include/floatobject.h b/Include/floatobject.h
index 5b8d1a1b16..90f0a454aa 100644
--- a/Include/floatobject.h
+++ b/Include/floatobject.h
@@ -11,22 +11,18 @@ PyFloatObject represents a (double precision) floating point number.
extern "C" {
#endif
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
double ob_fval;
} PyFloatObject;
+#endif
PyAPI_DATA(PyTypeObject) PyFloat_Type;
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
#define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type)
-/* The str() precision PyFloat_STR_PRECISION is chosen so that in most cases,
- the rounding noise created by various operations is suppressed, while
- giving plenty of precision for practical use. */
-
-#define PyFloat_STR_PRECISION 12
-
#ifdef Py_NAN
#define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN)
#endif
@@ -51,8 +47,11 @@ PyAPI_FUNC(PyObject *) PyFloat_FromDouble(double);
/* Extract C double from Python float. The macro version trades safety for
speed. */
PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *);
+#ifndef Py_LIMITED_API
#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
+#endif
+#ifndef Py_LIMITED_API
/* _PyFloat_{Pack,Unpack}{4,8}
*
* The struct and pickle (at least) modules need an efficient platform-
@@ -116,6 +115,7 @@ PyAPI_FUNC(int) PyFloat_ClearFreeList(void);
PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj,
Py_UNICODE *format_spec,
Py_ssize_t format_spec_len);
+#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
diff --git a/Include/frameobject.h b/Include/frameobject.h
index 65ebd2ad52..1fb64bb268 100644
--- a/Include/frameobject.h
+++ b/Include/frameobject.h
@@ -1,6 +1,7 @@
/* Frame object interface */
+#ifndef Py_LIMITED_API
#ifndef Py_FRAMEOBJECT_H
#define Py_FRAMEOBJECT_H
#ifdef __cplusplus
@@ -38,8 +39,11 @@ typedef struct _frame {
PyThreadState *f_tstate;
int f_lasti; /* Last instruction if called */
- /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
- f_trace is set) -- at other times use PyCode_Addr2Line instead. */
+ /* Call PyFrame_GetLineNumber() instead of reading this field
+ directly. As of 2.3 f_lineno is only valid when tracing is
+ active (i.e. when f_trace is set). At other times we use
+ PyCode_Addr2Line to calculate the line from the current
+ bytecode index. */
int f_lineno; /* Current line number */
int f_iblock; /* index in f_blockstack */
PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
@@ -75,7 +79,11 @@ PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
PyAPI_FUNC(int) PyFrame_ClearFreeList(void);
+/* Return the line of code the frame is currently executing. */
+PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *);
+
#ifdef __cplusplus
}
#endif
#endif /* !Py_FRAMEOBJECT_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/funcobject.h b/Include/funcobject.h
index 058c6bff36..521d87bf9f 100644
--- a/Include/funcobject.h
+++ b/Include/funcobject.h
@@ -1,6 +1,6 @@
/* Function object interface */
-
+#ifndef Py_LIMITED_API
#ifndef Py_FUNCOBJECT_H
#define Py_FUNCOBJECT_H
#ifdef __cplusplus
@@ -84,3 +84,4 @@ PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *);
}
#endif
#endif /* !Py_FUNCOBJECT_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/genobject.h b/Include/genobject.h
index 135561b701..d29fb1ed1d 100644
--- a/Include/genobject.h
+++ b/Include/genobject.h
@@ -1,6 +1,7 @@
/* Generator object interface */
+#ifndef Py_LIMITED_API
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
@@ -38,3 +39,4 @@ PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *);
}
#endif
#endif /* !Py_GENOBJECT_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/graminit.h b/Include/graminit.h
index 04f9b9aa52..e0e27f98c3 100644
--- a/Include/graminit.h
+++ b/Include/graminit.h
@@ -16,68 +16,68 @@
#define simple_stmt 269
#define small_stmt 270
#define expr_stmt 271
-#define augassign 272
-#define del_stmt 273
-#define pass_stmt 274
-#define flow_stmt 275
-#define break_stmt 276
-#define continue_stmt 277
-#define return_stmt 278
-#define yield_stmt 279
-#define raise_stmt 280
-#define import_stmt 281
-#define import_name 282
-#define import_from 283
-#define import_as_name 284
-#define dotted_as_name 285
-#define import_as_names 286
-#define dotted_as_names 287
-#define dotted_name 288
-#define global_stmt 289
-#define nonlocal_stmt 290
-#define assert_stmt 291
-#define compound_stmt 292
-#define if_stmt 293
-#define while_stmt 294
-#define for_stmt 295
-#define try_stmt 296
-#define with_stmt 297
-#define with_item 298
-#define except_clause 299
-#define suite 300
-#define test 301
-#define test_nocond 302
-#define lambdef 303
-#define lambdef_nocond 304
-#define or_test 305
-#define and_test 306
-#define not_test 307
-#define comparison 308
-#define comp_op 309
-#define star_expr 310
-#define expr 311
-#define xor_expr 312
-#define and_expr 313
-#define shift_expr 314
-#define arith_expr 315
-#define term 316
-#define factor 317
-#define power 318
-#define atom 319
-#define testlist_comp 320
-#define trailer 321
-#define subscriptlist 322
-#define subscript 323
-#define sliceop 324
-#define exprlist 325
-#define testlist 326
-#define dictorsetmaker 327
-#define classdef 328
-#define arglist 329
-#define argument 330
-#define comp_iter 331
-#define comp_for 332
-#define comp_if 333
-#define testlist1 334
+#define testlist_star_expr 272
+#define augassign 273
+#define del_stmt 274
+#define pass_stmt 275
+#define flow_stmt 276
+#define break_stmt 277
+#define continue_stmt 278
+#define return_stmt 279
+#define yield_stmt 280
+#define raise_stmt 281
+#define import_stmt 282
+#define import_name 283
+#define import_from 284
+#define import_as_name 285
+#define dotted_as_name 286
+#define import_as_names 287
+#define dotted_as_names 288
+#define dotted_name 289
+#define global_stmt 290
+#define nonlocal_stmt 291
+#define assert_stmt 292
+#define compound_stmt 293
+#define if_stmt 294
+#define while_stmt 295
+#define for_stmt 296
+#define try_stmt 297
+#define with_stmt 298
+#define with_item 299
+#define except_clause 300
+#define suite 301
+#define test 302
+#define test_nocond 303
+#define lambdef 304
+#define lambdef_nocond 305
+#define or_test 306
+#define and_test 307
+#define not_test 308
+#define comparison 309
+#define comp_op 310
+#define star_expr 311
+#define expr 312
+#define xor_expr 313
+#define and_expr 314
+#define shift_expr 315
+#define arith_expr 316
+#define term 317
+#define factor 318
+#define power 319
+#define atom 320
+#define testlist_comp 321
+#define trailer 322
+#define subscriptlist 323
+#define subscript 324
+#define sliceop 325
+#define exprlist 326
+#define testlist 327
+#define dictorsetmaker 328
+#define classdef 329
+#define arglist 330
+#define argument 331
+#define comp_iter 332
+#define comp_for 333
+#define comp_if 334
#define encoding_decl 335
#define yield_expr 336
diff --git a/Include/import.h b/Include/import.h
index b8de2fd90b..400e97cefe 100644
--- a/Include/import.h
+++ b/Include/import.h
@@ -8,25 +8,52 @@ extern "C" {
#endif
PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
-PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co);
+PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
+PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(
+ char *name, /* UTF-8 encoded string */
+ PyObject *co
+ );
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
- char *name, PyObject *co, char *pathname);
+ char *name, /* UTF-8 encoded string */
+ PyObject *co,
+ char *pathname /* decoded from the filesystem encoding */
+ );
+PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames(
+ char *name, /* UTF-8 encoded string */
+ PyObject *co,
+ char *pathname, /* decoded from the filesystem encoding */
+ char *cpathname /* decoded from the filesystem encoding */
+ );
PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
-PyAPI_FUNC(PyObject *) PyImport_AddModule(const char *name);
-PyAPI_FUNC(PyObject *) PyImport_ImportModule(const char *name);
-PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(const char *);
-PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(char *name,
- PyObject *globals, PyObject *locals, PyObject *fromlist, int level);
+PyAPI_FUNC(PyObject *) PyImport_AddModule(
+ const char *name /* UTF-8 encoded string */
+ );
+PyAPI_FUNC(PyObject *) PyImport_ImportModule(
+ const char *name /* UTF-8 encoded string */
+ );
+PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(
+ const char *name /* UTF-8 encoded string */
+ );
+PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(
+ char *name, /* UTF-8 encoded string */
+ PyObject *globals,
+ PyObject *locals,
+ PyObject *fromlist,
+ int level
+ );
#define PyImport_ImportModuleEx(n, g, l, f) \
- PyImport_ImportModuleLevel(n, g, l, f, -1)
+ PyImport_ImportModuleLevel(n, g, l, f, -1)
PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path);
PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name);
PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m);
PyAPI_FUNC(void) PyImport_Cleanup(void);
-PyAPI_FUNC(int) PyImport_ImportFrozenModule(char *);
+PyAPI_FUNC(int) PyImport_ImportFrozenModule(
+ char *name /* UTF-8 encoded string */
+ );
+#ifndef Py_LIMITED_API
#ifdef WITH_THREAD
PyAPI_FUNC(void) _PyImport_AcquireLock(void);
PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
@@ -35,27 +62,36 @@ PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
#define _PyImport_ReleaseLock() 1
#endif
-PyAPI_FUNC(struct filedescr *) _PyImport_FindModule(
- const char *, PyObject *, char *, size_t, FILE **, PyObject **);
-PyAPI_FUNC(int) _PyImport_IsScript(struct filedescr *);
PyAPI_FUNC(void) _PyImport_ReInitLock(void);
-PyAPI_FUNC(PyObject *)_PyImport_FindExtension(char *, char *);
-PyAPI_FUNC(int)_PyImport_FixupExtension(PyObject*, char *, char *);
+PyAPI_FUNC(PyObject *)_PyImport_FindBuiltin(
+ char *name /* UTF-8 encoded string */
+ );
+PyAPI_FUNC(PyObject *)_PyImport_FindExtensionUnicode(char *, PyObject *);
+PyAPI_FUNC(int)_PyImport_FixupBuiltin(
+ PyObject *mod,
+ char *name /* UTF-8 encoded string */
+ );
+PyAPI_FUNC(int)_PyImport_FixupExtensionUnicode(PyObject*, char *, PyObject *);
struct _inittab {
char *name;
PyObject* (*initfunc)(void);
};
+PyAPI_DATA(struct _inittab *) PyImport_Inittab;
+PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
+#endif /* Py_LIMITED_API */
PyAPI_DATA(PyTypeObject) PyNullImporter_Type;
-PyAPI_DATA(struct _inittab *) PyImport_Inittab;
-PyAPI_FUNC(int) PyImport_AppendInittab(const char *name, PyObject* (*initfunc)(void));
-PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
+PyAPI_FUNC(int) PyImport_AppendInittab(
+ const char *name, /* ASCII encoded string */
+ PyObject* (*initfunc)(void)
+ );
+#ifndef Py_LIMITED_API
struct _frozen {
- char *name;
+ char *name; /* ASCII encoded string */
unsigned char *code;
int size;
};
@@ -64,6 +100,7 @@ struct _frozen {
collection of frozen modules: */
PyAPI_DATA(struct _frozen *) PyImport_FrozenModules;
+#endif
#ifdef __cplusplus
}
diff --git a/Include/listobject.h b/Include/listobject.h
index 755fbbea8f..949b1a3e31 100644
--- a/Include/listobject.h
+++ b/Include/listobject.h
@@ -19,6 +19,7 @@ returned item's reference count.
extern "C" {
#endif
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_VAR_HEAD
/* Vector of pointers to list elements. list[0] is ob_item[0], etc. */
@@ -37,6 +38,7 @@ typedef struct {
*/
Py_ssize_t allocated;
} PyListObject;
+#endif
PyAPI_DATA(PyTypeObject) PyList_Type;
PyAPI_DATA(PyTypeObject) PyListIter_Type;
@@ -58,12 +60,16 @@ PyAPI_FUNC(int) PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
PyAPI_FUNC(int) PyList_Sort(PyObject *);
PyAPI_FUNC(int) PyList_Reverse(PyObject *);
PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *);
+#endif
/* Macro, trading safety for speed */
+#ifndef Py_LIMITED_API
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
#define PyList_GET_SIZE(op) Py_SIZE(op)
+#endif
#ifdef __cplusplus
}
diff --git a/Include/longintrepr.h b/Include/longintrepr.h
index 7765172be9..b94f7b2e2c 100644
--- a/Include/longintrepr.h
+++ b/Include/longintrepr.h
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
#ifndef Py_LONGINTREPR_H
#define Py_LONGINTREPR_H
#ifdef __cplusplus
@@ -50,12 +51,16 @@ typedef PY_INT32_T sdigit; /* signed variant of digit */
typedef PY_UINT64_T twodigits;
typedef PY_INT64_T stwodigits; /* signed variant of twodigits */
#define PyLong_SHIFT 30
+#define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */
+#define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */
#elif PYLONG_BITS_IN_DIGIT == 15
typedef unsigned short digit;
typedef short sdigit; /* signed variant of digit */
typedef unsigned long twodigits;
typedef long stwodigits; /* signed variant of twodigits */
#define PyLong_SHIFT 15
+#define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */
+#define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */
#else
#error "PYLONG_BITS_IN_DIGIT should be 15 or 30"
#endif
@@ -95,3 +100,4 @@ PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src);
}
#endif
#endif /* !Py_LONGINTREPR_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/longobject.h b/Include/longobject.h
index 6e4e1a4e9b..c09565a117 100644
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -32,16 +32,37 @@ PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
cleanup to keep the extra information. [CH] */
#define PyLong_AS_LONG(op) PyLong_AsLong(op)
-/* For use by intobject.c only */
+/* Issue #1983: pid_t can be longer than a C long on some systems */
+#if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT
+#define _Py_PARSE_PID "i"
+#define PyLong_FromPid PyLong_FromLong
+#define PyLong_AsPid PyLong_AsLong
+#elif SIZEOF_PID_T == SIZEOF_LONG
+#define _Py_PARSE_PID "l"
+#define PyLong_FromPid PyLong_FromLong
+#define PyLong_AsPid PyLong_AsLong
+#elif defined(SIZEOF_LONG_LONG) && SIZEOF_PID_T == SIZEOF_LONG_LONG
+#define _Py_PARSE_PID "L"
+#define PyLong_FromPid PyLong_FromLongLong
+#define PyLong_AsPid PyLong_AsLongLong
+#else
+#error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)"
+#endif /* SIZEOF_PID_T */
+
+/* Used by Python/mystrtoul.c. */
+#ifndef Py_LIMITED_API
PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
+#endif
-/* _PyLong_AsScaledDouble returns a double x and an exponent e such that
- the true value is approximately equal to x * 2**(SHIFT*e). e is >= 0.
- x is 0.0 if and only if the input is 0 (in which case, e and x are both
- zeroes). Overflow is impossible. Note that the exponent returned must
- be multiplied by SHIFT! There may not be enough room in an int to store
- e*SHIFT directly. */
-PyAPI_FUNC(double) _PyLong_AsScaledDouble(PyObject *vv, int *e);
+/* _PyLong_Frexp returns a double x and an exponent e such that the
+ true value is approximately equal to x * 2**e. e is >= 0. x is
+ 0.0 if and only if the input is 0 (in which case, e and x are both
+ zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is
+ possible if the number of bits doesn't fit into a Py_ssize_t, sets
+ OverflowError and returns -1.0 for x, 0 for e. */
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e);
+#endif
PyAPI_FUNC(double) PyLong_AsDouble(PyObject *);
PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *);
@@ -53,11 +74,15 @@ PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG);
PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *);
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
+PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *);
#endif /* HAVE_LONG_LONG */
PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
+#endif
+#ifndef Py_LIMITED_API
/* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
v must not be NULL, and must be a normalized long.
There are no error cases.
@@ -74,6 +99,14 @@ PyAPI_FUNC(int) _PyLong_Sign(PyObject *v);
*/
PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v);
+/* _PyLong_DivmodNear. Given integers a and b, compute the nearest
+ integer q to the exact quotient a / b, rounding to the nearest even integer
+ in the case of a tie. Return (q, r), where r = a - q*b. The remainder r
+ will satisfy abs(r) <= abs(b)/2, with equality possible only if q is
+ even.
+*/
+PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
+
/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
base 256, and return a Python long with the same numeric value.
If n is 0, the integer is 0. Else:
@@ -124,6 +157,7 @@ PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *aa, int base);
PyAPI_FUNC(PyObject *) _PyLong_FormatAdvanced(PyObject *obj,
Py_UNICODE *format_spec,
Py_ssize_t format_spec_len);
+#endif /* Py_LIMITED_API */
/* These aren't really part of the long object, but they're handy. The
functions are in Python/mystrtoul.c.
diff --git a/Include/marshal.h b/Include/marshal.h
index 411fdca367..e96d062b18 100644
--- a/Include/marshal.h
+++ b/Include/marshal.h
@@ -13,10 +13,12 @@ PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int);
PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int);
PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *);
PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
+#endif
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t);
#ifdef __cplusplus
diff --git a/Include/memoryobject.h b/Include/memoryobject.h
index bf0b621ab9..62ecbd6449 100644
--- a/Include/memoryobject.h
+++ b/Include/memoryobject.h
@@ -10,10 +10,12 @@ PyAPI_DATA(PyTypeObject) PyMemoryView_Type;
#define PyMemoryView_Check(op) (Py_TYPE(op) == &PyMemoryView_Type)
+#ifndef Py_LIMITED_API
/* Get a pointer to the underlying Py_buffer of a memoryview object. */
#define PyMemoryView_GET_BUFFER(op) (&((PyMemoryViewObject *)(op))->view)
/* Get a pointer to the PyObject from which originates a memoryview object. */
#define PyMemoryView_GET_BASE(op) (((PyMemoryViewObject *)(op))->view.obj)
+#endif
PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base,
@@ -53,20 +55,22 @@ PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base,
PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info);
/* create new if bufptr is NULL
will be a new bytesobject in base */
+#endif
/* The struct is declared here so that macros can work, but it shouldn't
be considered public. Don't access those fields directly, use the macros
and functions instead! */
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
- PyObject *base;
Py_buffer view;
} PyMemoryViewObject;
-
+#endif
#ifdef __cplusplus
}
diff --git a/Include/methodobject.h b/Include/methodobject.h
index 81e84ceae4..7e67c0bf9a 100644
--- a/Include/methodobject.h
+++ b/Include/methodobject.h
@@ -26,12 +26,14 @@ PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *);
/* Macros for direct access to these values. Type checks are *not*
done, so use with care. */
+#ifndef Py_LIMITED_API
#define PyCFunction_GET_FUNCTION(func) \
(((PyCFunctionObject *)func) -> m_ml -> ml_meth)
#define PyCFunction_GET_SELF(func) \
(((PyCFunctionObject *)func) -> m_self)
#define PyCFunction_GET_FLAGS(func) \
(((PyCFunctionObject *)func) -> m_ml -> ml_flags)
+#endif
PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
struct PyMethodDef {
@@ -68,12 +70,14 @@ PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *,
#define METH_COEXIST 0x0040
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
PyMethodDef *m_ml; /* Description of the C function to call */
PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */
PyObject *m_module; /* The __module__ attribute, can be anything */
} PyCFunctionObject;
+#endif
PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
diff --git a/Include/modsupport.h b/Include/modsupport.h
index 23e8fa66a7..bf6478f4c2 100644
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -27,10 +27,13 @@ PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
const char *, char **, ...);
+PyAPI_FUNC(int) PyArg_ValidateKeywordArguments(PyObject *);
PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);
PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
+#endif
PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
@@ -91,6 +94,12 @@ PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char
9-Jan-1995 GvR Initial version (incompatible with older API)
*/
+/* The PYTHON_ABI_VERSION is introduced in PEP 384. For the lifetime of
+ Python 3, it will stay at the value of 3; changes to the limited API
+ must be performed in a strictly backwards-compatible manner. */
+#define PYTHON_ABI_VERSION 3
+#define PYTHON_ABI_STRING "3"
+
#ifdef Py_TRACE_REFS
/* When we are tracing reference counts, rename PyModule_Create2 so
modules compiled with incompatible settings will generate a
@@ -101,10 +110,17 @@ PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char
PyAPI_FUNC(PyObject *) PyModule_Create2(struct PyModuleDef*,
int apiver);
+#ifdef Py_LIMITED_API
+#define PyModule_Create(module) \
+ PyModule_Create2(module, PYTHON_ABI_VERSION)
+#else
#define PyModule_Create(module) \
PyModule_Create2(module, PYTHON_API_VERSION)
+#endif
+#ifndef Py_LIMITED_API
PyAPI_DATA(char *) _Py_PackageContext;
+#endif
#ifdef __cplusplus
}
diff --git a/Include/moduleobject.h b/Include/moduleobject.h
index 42eac82e95..7b2bf1c144 100644
--- a/Include/moduleobject.h
+++ b/Include/moduleobject.h
@@ -12,11 +12,16 @@ PyAPI_DATA(PyTypeObject) PyModule_Type;
#define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type)
#define PyModule_CheckExact(op) (Py_TYPE(op) == &PyModule_Type)
-PyAPI_FUNC(PyObject *) PyModule_New(const char *);
+PyAPI_FUNC(PyObject *) PyModule_New(
+ const char *name /* UTF-8 encoded string */
+ );
PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);
PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
+PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
+#endif
PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
@@ -27,7 +32,12 @@ typedef struct PyModuleDef_Base {
PyObject* m_copy;
} PyModuleDef_Base;
-#define PyModuleDef_HEAD_INIT {PyObject_HEAD_INIT(NULL)}
+#define PyModuleDef_HEAD_INIT { \
+ PyObject_HEAD_INIT(NULL) \
+ NULL, /* m_init */ \
+ 0, /* m_index */ \
+ NULL, /* m_copy */ \
+ }
typedef struct PyModuleDef{
PyModuleDef_Base m_base;
diff --git a/Include/object.h b/Include/object.h
index ef73a213d1..3753785966 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -61,6 +61,10 @@ whose size is determined when the object is allocated.
#define Py_REF_DEBUG
#endif
+#if defined(Py_LIMITED_API) && defined(Py_REF_DEBUG)
+#error Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, and Py_REF_DEBUG
+#endif
+
#ifdef Py_TRACE_REFS
/* Define pointers to support a doubly-linked list of all live heap objects. */
#define _PyObject_HEAD_EXTRA \
@@ -139,7 +143,7 @@ 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 *);
-
+#ifndef Py_LIMITED_API
/* buffer interface */
typedef struct bufferinfo {
void *buf;
@@ -189,14 +193,15 @@ typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#define PyBUF_READ 0x100
#define PyBUF_WRITE 0x200
-#define PyBUF_SHADOW 0x400
/* End buffer interface */
+#endif /* Py_LIMITED_API */
typedef int (*objobjproc)(PyObject *, PyObject *);
typedef int (*visitproc)(PyObject *, void *);
typedef int (*traverseproc)(PyObject *, visitproc, void *);
+#ifndef Py_LIMITED_API
typedef struct {
/* Number implementations must check *both*
arguments for proper type and implement the necessary conversions
@@ -266,16 +271,23 @@ typedef struct {
getbufferproc bf_getbuffer;
releasebufferproc bf_releasebuffer;
} PyBufferProcs;
+#endif /* Py_LIMITED_API */
typedef void (*freefunc)(void *);
typedef void (*destructor)(PyObject *);
+#ifndef Py_LIMITED_API
+/* We can't provide a full compile-time check that limited-API
+ users won't implement tp_print. However, not defining printfunc
+ and making tp_print of a different function pointer type
+ should at least cause a warning in most cases. */
typedef int (*printfunc)(PyObject *, FILE *, int);
+#endif
typedef PyObject *(*getattrfunc)(PyObject *, char *);
typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);
typedef PyObject *(*reprfunc)(PyObject *);
-typedef long (*hashfunc)(PyObject *);
+typedef Py_hash_t (*hashfunc)(PyObject *);
typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int);
typedef PyObject *(*getiterfunc) (PyObject *);
typedef PyObject *(*iternextfunc) (PyObject *);
@@ -285,6 +297,9 @@ typedef int (*initproc)(PyObject *, PyObject *, PyObject *);
typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *);
typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t);
+#ifdef Py_LIMITED_API
+typedef struct _typeobject PyTypeObject; /* opaque */
+#else
typedef struct _typeobject {
PyObject_VAR_HEAD
const char *tp_name; /* For printing, in format "<module>.<name>" */
@@ -372,8 +387,24 @@ typedef struct _typeobject {
struct _typeobject *tp_next;
#endif
} PyTypeObject;
+#endif
+typedef struct{
+ int slot; /* slot id, see below */
+ void *pfunc; /* function pointer */
+} PyType_Slot;
+typedef struct{
+ const char* name;
+ int basicsize;
+ int itemsize;
+ int flags;
+ PyType_Slot *slots; /* terminated by slot==0. */
+} PyType_Spec;
+
+PyAPI_FUNC(PyObject*) PyType_FromSpec(PyType_Spec*);
+
+#ifndef Py_LIMITED_API
/* The *real* layout of a type object when allocated on the heap */
typedef struct _heaptypeobject {
/* Note: there's a dependency on the order of these members
@@ -394,7 +425,7 @@ typedef struct _heaptypeobject {
/* access macro to the members which are floating "behind" the object */
#define PyHeapType_GET_MEMBERS(etype) \
((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize))
-
+#endif
/* Generic type check */
PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);
@@ -405,6 +436,8 @@ PyAPI_DATA(PyTypeObject) PyType_Type; /* built-in 'type' */
PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */
PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */
+PyAPI_FUNC(long) PyType_GetFlags(PyTypeObject*);
+
#define PyType_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS)
#define PyType_CheckExact(op) (Py_TYPE(op) == &PyType_Type)
@@ -413,15 +446,19 @@ PyAPI_FUNC(int) PyType_Ready(PyTypeObject *);
PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t);
PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *,
PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, char *, PyObject **);
+#endif
PyAPI_FUNC(unsigned int) PyType_ClearCache(void);
PyAPI_FUNC(void) PyType_Modified(PyTypeObject *);
/* Generic operations on objects */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
PyAPI_FUNC(void) _Py_BreakPoint(void);
PyAPI_FUNC(void) _PyObject_Dump(PyObject *);
+#endif
PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_ASCII(PyObject *);
@@ -434,14 +471,18 @@ PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *);
PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
+#endif
PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *);
+#endif
PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *,
PyObject *, PyObject *);
-PyAPI_FUNC(long) PyObject_Hash(PyObject *);
-PyAPI_FUNC(long) PyObject_HashNotImplemented(PyObject *);
+PyAPI_FUNC(Py_hash_t) PyObject_Hash(PyObject *);
+PyAPI_FUNC(Py_hash_t) PyObject_HashNotImplemented(PyObject *);
PyAPI_FUNC(int) PyObject_IsTrue(PyObject *);
PyAPI_FUNC(int) PyObject_Not(PyObject *);
PyAPI_FUNC(int) PyCallable_Check(PyObject *);
@@ -470,8 +511,10 @@ PyAPI_FUNC(int) Py_ReprEnter(PyObject *);
PyAPI_FUNC(void) Py_ReprLeave(PyObject *);
/* Helpers for hash functions */
-PyAPI_FUNC(long) _Py_HashDouble(double);
-PyAPI_FUNC(long) _Py_HashPointer(void*);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double);
+PyAPI_FUNC(Py_hash_t) _Py_HashPointer(void*);
+#endif
/* Helper for passing objects to printf and the like */
#define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj))
@@ -547,7 +590,11 @@ given type object has a specified feature.
Py_TPFLAGS_HAVE_VERSION_TAG | \
0)
+#ifdef Py_LIMITED_API
+#define PyType_HasFeature(t,f) ((PyType_GetFlags(t) & (f)) != 0)
+#else
#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
+#endif
#define PyType_FastSubclass(t,f) PyType_HasFeature(t,f)
@@ -650,9 +697,13 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force);
#define _Py_ForgetReference(op) _Py_INC_TPFREES(op)
+#ifdef Py_LIMITED_API
+PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
+#else
#define _Py_Dealloc(op) ( \
_Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA \
(*Py_TYPE(op)->tp_dealloc)((PyObject *)(op)))
+#endif
#endif /* !Py_TRACE_REFS */
#define Py_INCREF(op) ( \
diff --git a/Include/objimpl.h b/Include/objimpl.h
index 6d5a0c477d..8fc3fc1e9a 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -108,6 +108,13 @@ PyAPI_FUNC(void) _PyObject_DebugFree(void *p);
PyAPI_FUNC(void) _PyObject_DebugDumpAddress(const void *p);
PyAPI_FUNC(void) _PyObject_DebugCheckAddress(const void *p);
PyAPI_FUNC(void) _PyObject_DebugMallocStats(void);
+PyAPI_FUNC(void *) _PyObject_DebugMallocApi(char api, size_t nbytes);
+PyAPI_FUNC(void *) _PyObject_DebugReallocApi(char api, void *p, size_t nbytes);
+PyAPI_FUNC(void) _PyObject_DebugFreeApi(char api, void *p);
+PyAPI_FUNC(void) _PyObject_DebugCheckAddressApi(char api, const void *p);
+PyAPI_FUNC(void *) _PyMem_DebugMalloc(size_t nbytes);
+PyAPI_FUNC(void *) _PyMem_DebugRealloc(void *p, size_t nbytes);
+PyAPI_FUNC(void) _PyMem_DebugFree(void *p);
#define PyObject_MALLOC _PyObject_DebugMalloc
#define PyObject_Malloc _PyObject_DebugMalloc
#define PyObject_REALLOC _PyObject_DebugRealloc
@@ -235,10 +242,8 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
#define PyObject_GC_Resize(type, op, n) \
( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) )
-/* for source compatibility with 2.2 */
-#define _PyObject_GC_Del PyObject_GC_Del
-
/* GC information is stored BEFORE the object structure. */
+#ifndef Py_LIMITED_API
typedef union _gc_head {
struct {
union _gc_head *gc_next;
@@ -291,7 +296,7 @@ extern PyGC_Head *_PyGC_generation0;
#define _PyObject_GC_MAY_BE_TRACKED(obj) \
(PyObject_IS_GC(obj) && \
(!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj)))
-
+#endif /* Py_LIMITED_API */
PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t);
PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *);
@@ -320,15 +325,6 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *);
} \
} while (0)
-/* This is here for the sake of backwards compatibility. Extensions that
- * use the old GC API will still compile but the objects will not be
- * tracked by the GC. */
-#define PyGC_HEAD_SIZE 0
-#define PyObject_GC_Init(op)
-#define PyObject_GC_Fini(op)
-#define PyObject_AS_GC(op) (op)
-#define PyObject_FROM_GC(op) (op)
-
/* Test if a type supports weak references */
#define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0)
diff --git a/Include/opcode.h b/Include/opcode.h
index 2b1c59da9a..6b1094449e 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -12,7 +12,7 @@ extern "C" {
#define ROT_TWO 2
#define ROT_THREE 3
#define DUP_TOP 4
-#define ROT_FOUR 5
+#define DUP_TOP_TWO 5
#define NOP 9
#define UNARY_POSITIVE 10
@@ -83,7 +83,7 @@ extern "C" {
#define DELETE_ATTR 96 /* "" */
#define STORE_GLOBAL 97 /* "" */
#define DELETE_GLOBAL 98 /* "" */
-#define DUP_TOPX 99 /* number of items to duplicate */
+
#define LOAD_CONST 100 /* Index in const list */
#define LOAD_NAME 101 /* Index in name list */
#define BUILD_TUPLE 102 /* Number of tuple items */
@@ -123,6 +123,7 @@ extern "C" {
#define LOAD_CLOSURE 135 /* Load free variable from closure */
#define LOAD_DEREF 136 /* Load and dereference from closure cell */
#define STORE_DEREF 137 /* Store into cell */
+#define DELETE_DEREF 138 /* Delete closure cell */
/* The next 3 opcodes must be contiguous and satisfy
(CALL_FUNCTION_VAR - CALL_FUNCTION) & 3 == 1 */
@@ -130,8 +131,10 @@ extern "C" {
#define CALL_FUNCTION_KW 141 /* #args + (#kwargs<<8) */
#define CALL_FUNCTION_VAR_KW 142 /* #args + (#kwargs<<8) */
+#define SETUP_WITH 143
+
/* Support for opargs more than 16 bits long */
-#define EXTENDED_ARG 143
+#define EXTENDED_ARG 144
#define LIST_APPEND 145
#define SET_ADD 146
diff --git a/Include/parsetok.h b/Include/parsetok.h
index af805705db..4b7694f90f 100644
--- a/Include/parsetok.h
+++ b/Include/parsetok.h
@@ -1,6 +1,6 @@
/* Parser-tokenizer link interface */
-
+#ifndef Py_LIMITED_API
#ifndef Py_PARSETOK_H
#define Py_PARSETOK_H
#ifdef __cplusplus
@@ -9,10 +9,10 @@ extern "C" {
typedef struct {
int error;
- const char *filename;
+ const char *filename; /* decoded from the filesystem encoding */
int lineno;
int offset;
- char *text;
+ char *text; /* UTF-8-encoded string */
int token;
int expected;
} perrdetail;
@@ -39,23 +39,32 @@ PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
perrdetail *, int);
-PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *,
+PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *,
const char*, grammar *,
int, char *, char *,
perrdetail *, int);
-PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(FILE *, const char *,
- const char*, grammar *,
- int, char *, char *,
- perrdetail *, int *);
+PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(
+ FILE *fp,
+ const char *filename, /* decoded from the filesystem encoding */
+ const char *enc,
+ grammar *g,
+ int start,
+ char *ps1,
+ char *ps2,
+ perrdetail *err_ret,
+ int *flags);
PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
const char *,
grammar *, int,
perrdetail *, int);
-PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(const char *,
- const char *,
- grammar *, int,
- perrdetail *, int *);
+PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(
+ const char *s,
+ const char *filename, /* decoded from the filesystem encoding */
+ grammar *g,
+ int start,
+ perrdetail *err_ret,
+ int *flags);
/* Note that he following function is defined in pythonrun.c not parsetok.c. */
PyAPI_FUNC(void) PyParser_SetError(perrdetail *);
@@ -64,3 +73,4 @@ PyAPI_FUNC(void) PyParser_SetError(perrdetail *);
}
#endif
#endif /* !Py_PARSETOK_H */
+#endif /* !Py_LIMITED_API */
diff --git a/Include/patchlevel.h b/Include/patchlevel.h
index 58a79fef7f..e6a4902697 100644
--- a/Include/patchlevel.h
+++ b/Include/patchlevel.h
@@ -17,13 +17,13 @@
/* Version parsed out into numeric values */
/*--start constants--*/
#define PY_MAJOR_VERSION 3
-#define PY_MINOR_VERSION 1
-#define PY_MICRO_VERSION 3
+#define PY_MINOR_VERSION 2
+#define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
#define PY_RELEASE_SERIAL 0
/* Version as a string */
-#define PY_VERSION "3.1.3+"
+#define PY_VERSION "3.2.1a0"
/*--end constants--*/
/* Subversion Revision number of this file (not of the repository). Empty
diff --git a/Include/pyarena.h b/Include/pyarena.h
index 5f193fecee..db3ad0188f 100644
--- a/Include/pyarena.h
+++ b/Include/pyarena.h
@@ -1,6 +1,7 @@
/* An arena-like memory interface for the compiler.
*/
+#ifndef Py_LIMITED_API
#ifndef Py_PYARENA_H
#define Py_PYARENA_H
@@ -60,3 +61,4 @@ extern "C" {
#endif
#endif /* !Py_PYARENA_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/pyatomic.h b/Include/pyatomic.h
new file mode 100644
index 0000000000..b0028fd92f
--- /dev/null
+++ b/Include/pyatomic.h
@@ -0,0 +1,181 @@
+#ifndef Py_LIMITED_API
+#ifndef Py_ATOMIC_H
+#define Py_ATOMIC_H
+/* XXX: When compilers start offering a stdatomic.h with lock-free
+ atomic_int and atomic_address types, include that here and rewrite
+ the atomic operations in terms of it. */
+
+#include "dynamic_annotations.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This is modeled after the atomics interface from C1x, according to
+ * the draft at
+ * http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1425.pdf.
+ * Operations and types are named the same except with a _Py_ prefix
+ * and have the same semantics.
+ *
+ * Beware, the implementations here are deep magic.
+ */
+
+typedef enum _Py_memory_order {
+ _Py_memory_order_relaxed,
+ _Py_memory_order_acquire,
+ _Py_memory_order_release,
+ _Py_memory_order_acq_rel,
+ _Py_memory_order_seq_cst
+} _Py_memory_order;
+
+typedef struct _Py_atomic_address {
+ void *_value;
+} _Py_atomic_address;
+
+typedef struct _Py_atomic_int {
+ int _value;
+} _Py_atomic_int;
+
+/* Only support GCC (for expression statements) and x86 (for simple
+ * atomic semantics) for now */
+#if defined(__GNUC__) && (defined(__i386__) || defined(__amd64))
+
+static __inline__ void
+_Py_atomic_signal_fence(_Py_memory_order order)
+{
+ if (order != _Py_memory_order_relaxed)
+ __asm__ volatile("":::"memory");
+}
+
+static __inline__ void
+_Py_atomic_thread_fence(_Py_memory_order order)
+{
+ if (order != _Py_memory_order_relaxed)
+ __asm__ volatile("mfence":::"memory");
+}
+
+/* Tell the race checker about this operation's effects. */
+static __inline__ void
+_Py_ANNOTATE_MEMORY_ORDER(const volatile void *address, _Py_memory_order order)
+{
+ switch(order) {
+ case _Py_memory_order_release:
+ case _Py_memory_order_acq_rel:
+ case _Py_memory_order_seq_cst:
+ _Py_ANNOTATE_HAPPENS_BEFORE(address);
+ break;
+ default:
+ break;
+ }
+ switch(order) {
+ case _Py_memory_order_acquire:
+ case _Py_memory_order_acq_rel:
+ case _Py_memory_order_seq_cst:
+ _Py_ANNOTATE_HAPPENS_AFTER(address);
+ break;
+ default:
+ break;
+ }
+}
+
+#define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \
+ __extension__ ({ \
+ __typeof__(ATOMIC_VAL) atomic_val = ATOMIC_VAL; \
+ __typeof__(atomic_val->_value) new_val = NEW_VAL;\
+ volatile __typeof__(new_val) *volatile_data = &atomic_val->_value; \
+ _Py_memory_order order = ORDER; \
+ _Py_ANNOTATE_MEMORY_ORDER(atomic_val, order); \
+ \
+ /* Perform the operation. */ \
+ _Py_ANNOTATE_IGNORE_WRITES_BEGIN(); \
+ switch(order) { \
+ case _Py_memory_order_release: \
+ _Py_atomic_signal_fence(_Py_memory_order_release); \
+ /* fallthrough */ \
+ case _Py_memory_order_relaxed: \
+ *volatile_data = new_val; \
+ break; \
+ \
+ case _Py_memory_order_acquire: \
+ case _Py_memory_order_acq_rel: \
+ case _Py_memory_order_seq_cst: \
+ __asm__ volatile("xchg %0, %1" \
+ : "+r"(new_val) \
+ : "m"(atomic_val->_value) \
+ : "memory"); \
+ break; \
+ } \
+ _Py_ANNOTATE_IGNORE_WRITES_END(); \
+ })
+
+#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \
+ __extension__ ({ \
+ __typeof__(ATOMIC_VAL) atomic_val = ATOMIC_VAL; \
+ __typeof__(atomic_val->_value) result; \
+ volatile __typeof__(result) *volatile_data = &atomic_val->_value; \
+ _Py_memory_order order = ORDER; \
+ _Py_ANNOTATE_MEMORY_ORDER(atomic_val, order); \
+ \
+ /* Perform the operation. */ \
+ _Py_ANNOTATE_IGNORE_READS_BEGIN(); \
+ switch(order) { \
+ case _Py_memory_order_release: \
+ case _Py_memory_order_acq_rel: \
+ case _Py_memory_order_seq_cst: \
+ /* Loads on x86 are not releases by default, so need a */ \
+ /* thread fence. */ \
+ _Py_atomic_thread_fence(_Py_memory_order_release); \
+ break; \
+ default: \
+ /* No fence */ \
+ break; \
+ } \
+ result = *volatile_data; \
+ switch(order) { \
+ case _Py_memory_order_acquire: \
+ case _Py_memory_order_acq_rel: \
+ case _Py_memory_order_seq_cst: \
+ /* Loads on x86 are automatically acquire operations so */ \
+ /* can get by with just a compiler fence. */ \
+ _Py_atomic_signal_fence(_Py_memory_order_acquire); \
+ break; \
+ default: \
+ /* No fence */ \
+ break; \
+ } \
+ _Py_ANNOTATE_IGNORE_READS_END(); \
+ result; \
+ })
+
+#else /* !gcc x86 */
+/* Fall back to other compilers and processors by assuming that simple
+ volatile accesses are atomic. This is false, so people should port
+ this. */
+#define _Py_atomic_signal_fence(/*memory_order*/ ORDER) ((void)0)
+#define _Py_atomic_thread_fence(/*memory_order*/ ORDER) ((void)0)
+#define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \
+ ((ATOMIC_VAL)->_value = NEW_VAL)
+#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \
+ ((ATOMIC_VAL)->_value)
+
+#endif /* !gcc x86 */
+
+/* Standardized shortcuts. */
+#define _Py_atomic_store(ATOMIC_VAL, NEW_VAL) \
+ _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, _Py_memory_order_seq_cst)
+#define _Py_atomic_load(ATOMIC_VAL) \
+ _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_seq_cst)
+
+/* Python-local extensions */
+
+#define _Py_atomic_store_relaxed(ATOMIC_VAL, NEW_VAL) \
+ _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, _Py_memory_order_relaxed)
+#define _Py_atomic_load_relaxed(ATOMIC_VAL) \
+ _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Py_ATOMIC_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/pycapsule.h b/Include/pycapsule.h
index eba82ee0b2..d9ecda7a4b 100644
--- a/Include/pycapsule.h
+++ b/Include/pycapsule.h
@@ -48,7 +48,9 @@ PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name);
PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
-PyAPI_FUNC(void *) PyCapsule_Import(const char *name, int no_block);
+PyAPI_FUNC(void *) PyCapsule_Import(
+ const char *name, /* UTF-8 encoded string */
+ int no_block);
#ifdef __cplusplus
diff --git a/Include/pyctype.h b/Include/pyctype.h
index c5cc61431d..787c1b9a11 100644
--- a/Include/pyctype.h
+++ b/Include/pyctype.h
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
#ifndef PYCTYPE_H
#define PYCTYPE_H
@@ -29,3 +30,4 @@ extern const unsigned char _Py_ctype_toupper[256];
#define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)])
#endif /* !PYCTYPE_H */
+#endif /* !Py_LIMITED_API */
diff --git a/Include/pydebug.h b/Include/pydebug.h
index 0a31f5ba01..70c88f67a1 100644
--- a/Include/pydebug.h
+++ b/Include/pydebug.h
@@ -1,4 +1,4 @@
-
+#ifndef Py_LIMITED_API
#ifndef Py_PYDEBUG_H
#define Py_PYDEBUG_H
#ifdef __cplusplus
@@ -7,6 +7,7 @@ extern "C" {
PyAPI_DATA(int) Py_DebugFlag;
PyAPI_DATA(int) Py_VerboseFlag;
+PyAPI_DATA(int) Py_QuietFlag;
PyAPI_DATA(int) Py_InteractiveFlag;
PyAPI_DATA(int) Py_InspectFlag;
PyAPI_DATA(int) Py_OptimizeFlag;
@@ -31,3 +32,4 @@ PyAPI_FUNC(void) Py_FatalError(const char *message);
}
#endif
#endif /* !Py_PYDEBUG_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 3c3afab3ff..4bb3c01443 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -6,6 +6,7 @@ extern "C" {
/* Error objects */
+#ifndef Py_LIMITED_API
/* PyException_HEAD defines the initial segment of every exception class. */
#define PyException_HEAD PyObject_HEAD PyObject *dict;\
PyObject *args; PyObject *traceback;\
@@ -55,18 +56,23 @@ typedef struct {
PyObject *winerror;
} PyWindowsErrorObject;
#endif
+#endif
/* Error handling definitions */
PyAPI_FUNC(void) PyErr_SetNone(PyObject *);
PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *);
-PyAPI_FUNC(void) PyErr_SetString(PyObject *, const char *);
+PyAPI_FUNC(void) PyErr_SetString(
+ PyObject *exception,
+ const char *string /* decoded from utf-8 */
+ );
PyAPI_FUNC(PyObject *) PyErr_Occurred(void);
PyAPI_FUNC(void) PyErr_Clear(void);
PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
+PyAPI_FUNC(void) Py_FatalError(const char *message);
-#ifdef Py_DEBUG
+#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
#define _PyErr_OCCURRED() PyErr_Occurred()
#else
#define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type)
@@ -166,6 +172,7 @@ PyAPI_DATA(PyObject *) PyExc_FutureWarning;
PyAPI_DATA(PyObject *) PyExc_ImportWarning;
PyAPI_DATA(PyObject *) PyExc_UnicodeWarning;
PyAPI_DATA(PyObject *) PyExc_BytesWarning;
+PyAPI_DATA(PyObject *) PyExc_ResourceWarning;
/* Convenience functions */
@@ -175,28 +182,45 @@ PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
PyObject *, PyObject *);
-PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, const char *);
-#ifdef MS_WINDOWS
+PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(
+ PyObject *exc,
+ const char *filename /* decoded from the filesystem encoding */
+ );
+#if defined(MS_WINDOWS) && !defined(Py_LIMITED_API)
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
PyObject *, const Py_UNICODE *);
#endif /* MS_WINDOWS */
-PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...);
+PyAPI_FUNC(PyObject *) PyErr_Format(
+ PyObject *exception,
+ const char *format, /* ASCII-encoded string */
+ ...
+ );
#ifdef MS_WINDOWS
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject(
int, const char *);
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
- int, const char *);
+ int ierr,
+ const char *filename /* decoded from the filesystem encoding */
+ );
+#ifndef Py_LIMITED_API
+/* XXX redeclare to use WSTRING */
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
int, const Py_UNICODE *);
+#endif
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
PyObject *,int, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
- PyObject *,int, const char *);
+ PyObject *exc,
+ int ierr,
+ const char *filename /* decoded from the filesystem encoding */
+ );
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *,int, const Py_UNICODE *);
+#endif
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
#endif /* MS_WINDOWS */
@@ -208,8 +232,10 @@ PyAPI_FUNC(void) _PyErr_BadInternalCall(const char *filename, int lineno);
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
/* Function to create a new exception */
-PyAPI_FUNC(PyObject *) PyErr_NewException(const char *name, PyObject *base,
- PyObject *dict);
+PyAPI_FUNC(PyObject *) PyErr_NewException(
+ const char *name, PyObject *base, PyObject *dict);
+PyAPI_FUNC(PyObject *) PyErr_NewExceptionWithDoc(
+ const char *name, const char *doc, PyObject *base, PyObject *dict);
PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *);
/* In sigcheck.c or signalmodule.c */
@@ -217,26 +243,57 @@ PyAPI_FUNC(int) PyErr_CheckSignals(void);
PyAPI_FUNC(void) PyErr_SetInterrupt(void);
/* In signalmodule.c */
+#ifndef Py_LIMITED_API
int PySignal_SetWakeupFd(int fd);
+#endif
/* Support for adding program text to SyntaxErrors */
-PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int);
-PyAPI_FUNC(PyObject *) PyErr_ProgramText(const char *, int);
+PyAPI_FUNC(void) PyErr_SyntaxLocation(
+ const char *filename, /* decoded from the filesystem encoding */
+ int lineno);
+PyAPI_FUNC(void) PyErr_SyntaxLocationEx(
+ const char *filename, /* decoded from the filesystem encoding */
+ int lineno,
+ int col_offset);
+PyAPI_FUNC(PyObject *) PyErr_ProgramText(
+ const char *filename, /* decoded from the filesystem encoding */
+ int lineno);
/* The following functions are used to create and modify unicode
exceptions from C */
/* create a UnicodeDecodeError object */
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create(
- const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
+ const char *encoding, /* UTF-8 encoded string */
+ const char *object,
+ Py_ssize_t length,
+ Py_ssize_t start,
+ Py_ssize_t end,
+ const char *reason /* UTF-8 encoded string */
+ );
/* create a UnicodeEncodeError object */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
- const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
+ const char *encoding, /* UTF-8 encoded string */
+ const Py_UNICODE *object,
+ Py_ssize_t length,
+ Py_ssize_t start,
+ Py_ssize_t end,
+ const char *reason /* UTF-8 encoded string */
+ );
+#endif
/* create a UnicodeTranslateError object */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
- const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
+ const Py_UNICODE *object,
+ Py_ssize_t length,
+ Py_ssize_t start,
+ Py_ssize_t end,
+ const char *reason /* UTF-8 encoded string */
+ );
+#endif
/* get the encoding attribute */
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *);
@@ -279,11 +336,17 @@ PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetReason(PyObject *);
/* assign a new value to the reason attribute
return 0 on success, -1 on failure */
PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason(
- PyObject *, const char *);
+ PyObject *exc,
+ const char *reason /* UTF-8 encoded string */
+ );
PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason(
- PyObject *, const char *);
+ PyObject *exc,
+ const char *reason /* UTF-8 encoded string */
+ );
PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason(
- PyObject *, const char *);
+ PyObject *exc,
+ const char *reason /* UTF-8 encoded string */
+ );
/* These APIs aren't really part of the error implementation, but
diff --git a/Include/pygetopt.h b/Include/pygetopt.h
index 19e3fd1d30..4de8c0045d 100644
--- a/Include/pygetopt.h
+++ b/Include/pygetopt.h
@@ -5,9 +5,11 @@
extern "C" {
#endif
+#ifndef Py_LIMITED_API
PyAPI_DATA(int) _PyOS_opterr;
PyAPI_DATA(int) _PyOS_optind;
PyAPI_DATA(wchar_t *) _PyOS_optarg;
+#endif
PyAPI_FUNC(int) _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring);
diff --git a/Include/pymacconfig.h b/Include/pymacconfig.h
index 9dd9317713..24e7b8dac6 100644
--- a/Include/pymacconfig.h
+++ b/Include/pymacconfig.h
@@ -16,6 +16,8 @@
# undef SIZEOF_TIME_T
# undef SIZEOF_VOID_P
# undef SIZEOF__BOOL
+# undef SIZEOF_UINTPTR_T
+# undef SIZEOF_PTHREAD_T
# undef WORDS_BIGENDIAN
# undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
# undef DOUBLE_IS_BIG_ENDIAN_IEEE754
@@ -41,6 +43,8 @@
# define SIZEOF_SIZE_T 8
# define SIZEOF_TIME_T 8
# define SIZEOF_VOID_P 8
+# define SIZEOF_UINTPTR_T 8
+# define SIZEOF_PTHREAD_T 8
# else
# ifdef __ppc__
# define SIZEOF__BOOL 4
@@ -52,6 +56,8 @@
# define SIZEOF_SIZE_T 4
# define SIZEOF_TIME_T 4
# define SIZEOF_VOID_P 4
+# define SIZEOF_UINTPTR_T 4
+# define SIZEOF_PTHREAD_T 4
# endif
# if defined(__LP64__)
diff --git a/Include/pymath.h b/Include/pymath.h
index dc2c427944..b4eda66e6e 100644
--- a/Include/pymath.h
+++ b/Include/pymath.h
@@ -8,9 +8,9 @@ Symbols and macros to supply platform-independent interfaces to mathematical
functions and constants
**************************************************************************/
-/* Python provides implementations for copysign, acosh, asinh, atanh,
- * log1p and hypot in Python/pymath.c just in case your math library doesn't
- * provide the functions.
+/* Python provides implementations for copysign, round and hypot in
+ * Python/pymath.c just in case your math library doesn't provide the
+ * functions.
*
*Note: PC/pyconfig.h defines copysign as _copysign
*/
@@ -22,22 +22,6 @@ extern double copysign(double, double);
extern double round(double);
#endif
-#ifndef HAVE_ACOSH
-extern double acosh(double);
-#endif
-
-#ifndef HAVE_ASINH
-extern double asinh(double);
-#endif
-
-#ifndef HAVE_ATANH
-extern double atanh(double);
-#endif
-
-#ifndef HAVE_LOG1P
-extern double log1p(double);
-#endif
-
#ifndef HAVE_HYPOT
extern double hypot(double, double);
#endif
@@ -83,6 +67,7 @@ extern double copysign(double, double);
nothing. */
/* we take double rounding as evidence of x87 usage */
+#ifndef Py_LIMITED_API
#ifndef Py_FORCE_DOUBLE
# ifdef X87_DOUBLE_ROUNDING
PyAPI_FUNC(double) _Py_force_double(double);
@@ -91,11 +76,14 @@ PyAPI_FUNC(double) _Py_force_double(double);
# define Py_FORCE_DOUBLE(X) (X)
# endif
#endif
+#endif
+#ifndef Py_LIMITED_API
#ifdef HAVE_GCC_ASM_FOR_X87
PyAPI_FUNC(unsigned short) _Py_get_387controlword(void);
PyAPI_FUNC(void) _Py_set_387controlword(unsigned short);
#endif
+#endif
/* Py_IS_NAN(X)
* Return 1 if float or double arg is a NaN, else 0.
diff --git a/Include/pymem.h b/Include/pymem.h
index c8801bbf05..10b5bea5eb 100644
--- a/Include/pymem.h
+++ b/Include/pymem.h
@@ -59,9 +59,9 @@ PyAPI_FUNC(void) PyMem_Free(void *);
/* Macros. */
#ifdef PYMALLOC_DEBUG
/* Redirect all memory operations to Python's debugging allocator. */
-#define PyMem_MALLOC PyObject_MALLOC
-#define PyMem_REALLOC PyObject_REALLOC
-#define PyMem_FREE PyObject_FREE
+#define PyMem_MALLOC _PyMem_DebugMalloc
+#define PyMem_REALLOC _PyMem_DebugRealloc
+#define PyMem_FREE _PyMem_DebugFree
#else /* ! PYMALLOC_DEBUG */
@@ -71,9 +71,9 @@ PyAPI_FUNC(void) PyMem_Free(void *);
pymalloc. To solve these problems, allocate an extra byte. */
/* Returns NULL to indicate error if a negative size or size larger than
Py_ssize_t can represent is supplied. Helps prevents security holes. */
-#define PyMem_MALLOC(n) (((n) < 0 || (n) > PY_SSIZE_T_MAX) ? NULL \
+#define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
: malloc((n) ? (n) : 1))
-#define PyMem_REALLOC(p, n) (((n) < 0 || (n) > PY_SSIZE_T_MAX) ? NULL \
+#define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
: realloc((p), (n) ? (n) : 1))
#define PyMem_FREE free
diff --git a/Include/pyport.h b/Include/pyport.h
index 17a537992f..62aa53ae21 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -62,15 +62,20 @@ Used in: PY_LONG_LONG
#define PY_LLONG_MAX LLONG_MAX
#define PY_ULLONG_MAX ULLONG_MAX
#elif defined(__LONG_LONG_MAX__)
-/* Otherwise, if GCC has a builtin define, use that. */
+/* Otherwise, if GCC has a builtin define, use that. (Definition of
+ * PY_LLONG_MIN assumes two's complement with no trap representation.) */
#define PY_LLONG_MAX __LONG_LONG_MAX__
-#define PY_LLONG_MIN (-PY_LLONG_MAX-1)
-#define PY_ULLONG_MAX (__LONG_LONG_MAX__*2ULL + 1ULL)
-#else
-/* Otherwise, rely on two's complement. */
-#define PY_ULLONG_MAX (~0ULL)
-#define PY_LLONG_MAX ((long long)(PY_ULLONG_MAX>>1))
-#define PY_LLONG_MIN (-PY_LLONG_MAX-1)
+#define PY_LLONG_MIN (-PY_LLONG_MAX - 1)
+#define PY_ULLONG_MAX (PY_LLONG_MAX * Py_ULL(2) + 1)
+#elif defined(SIZEOF_LONG_LONG)
+/* Otherwise compute from SIZEOF_LONG_LONG, assuming two's complement, no
+ padding bits, and no trap representation. Note: PY_ULLONG_MAX was
+ previously #defined as (~0ULL) here; but that'll give the wrong value in a
+ preprocessor expression on systems where long long != intmax_t. */
+#define PY_LLONG_MAX \
+ (1 + 2 * ((Py_LL(1) << (CHAR_BIT * SIZEOF_LONG_LONG - 2)) - 1))
+#define PY_LLONG_MIN (-PY_LLONG_MAX - 1)
+#define PY_ULLONG_MAX (PY_LLONG_MAX * Py_ULL(2) + 1)
#endif /* LLONG_MAX */
#endif
#endif /* HAVE_LONG_LONG */
@@ -126,6 +131,20 @@ Used in: PY_LONG_LONG
#endif
#endif
+/* Parameters used for the numeric hash implementation. See notes for
+ _PyHash_Double in Objects/object.c. Numeric hashes are based on
+ reduction modulo the prime 2**_PyHASH_BITS - 1. */
+
+#if SIZEOF_VOID_P >= 8
+#define _PyHASH_BITS 61
+#else
+#define _PyHASH_BITS 31
+#endif
+#define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
+#define _PyHASH_INF 314159
+#define _PyHASH_NAN 0
+#define _PyHASH_IMAG 1000003UL
+
/* uintptr_t is the C9X name for an unsigned integral type such that a
* legitimate void* can be cast to uintptr_t and then back to void* again
* without loss of information. Similarly for intptr_t, wrt a signed
@@ -163,6 +182,11 @@ typedef Py_intptr_t Py_ssize_t;
# error "Python needs a typedef for Py_ssize_t in pyport.h."
#endif
+/* Py_hash_t is the same size as a pointer. */
+typedef Py_ssize_t Py_hash_t;
+/* Py_uhash_t is the unsigned equivalent needed to calculate numeric hash. */
+typedef size_t Py_uhash_t;
+
/* Largest possible value of size_t.
SIZE_MAX is part of C99, so it might be defined on some
platforms. If it is not defined, (size_t)-1 is a portable
@@ -219,6 +243,22 @@ typedef Py_intptr_t Py_ssize_t;
# endif
#endif
+/* PY_FORMAT_LONG_LONG is analogous to PY_FORMAT_SIZE_T above, but for
+ * the long long type instead of the size_t type. It's only available
+ * when HAVE_LONG_LONG is defined. The "high level" Python format
+ * functions listed above will interpret "lld" or "llu" correctly on
+ * all platforms.
+ */
+#ifdef HAVE_LONG_LONG
+# ifndef PY_FORMAT_LONG_LONG
+# if defined(MS_WIN64) || defined(MS_WINDOWS)
+# define PY_FORMAT_LONG_LONG "I64"
+# else
+# error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG"
+# endif
+# endif
+#endif
+
/* Py_LOCAL can be used instead of static to get the fastest possible calling
* convention for functions that are local to a given module.
*
@@ -236,8 +276,6 @@ typedef Py_intptr_t Py_ssize_t;
* should keep using static.
*/
-#undef USE_INLINE /* XXX - set via configure? */
-
#if defined(_MSC_VER)
#if defined(PY_LOCAL_AGGRESSIVE)
/* enable more aggressive optimization for visual studio */
@@ -793,4 +831,14 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
#define Py_ULL(x) Py_LL(x##U)
#endif
+#ifdef VA_LIST_IS_ARRAY
+#define Py_VA_COPY(x, y) Py_MEMCPY((x), (y), sizeof(va_list))
+#else
+#ifdef __va_copy
+#define Py_VA_COPY __va_copy
+#else
+#define Py_VA_COPY(x, y) (x) = (y)
+#endif
+#endif
+
#endif /* Py_PYPORT_H */
diff --git a/Include/pystate.h b/Include/pystate.h
index 81de569112..5d2ee633fd 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -13,6 +13,9 @@ extern "C" {
struct _ts; /* Forward */
struct _is; /* Forward */
+#ifdef Py_LIMITED_API
+typedef struct _is PyInterpreterState;
+#else
typedef struct _is {
struct _is *next;
@@ -28,6 +31,7 @@ typedef struct _is {
PyObject *codec_search_cache;
PyObject *codec_error_registry;
int codecs_initialized;
+ int fscodec_initialized;
#ifdef HAVE_DLOPEN
int dlopenflags;
@@ -37,12 +41,14 @@ typedef struct _is {
#endif
} PyInterpreterState;
+#endif
/* State unique per thread */
struct _frame; /* Avoid including frameobject.h */
+#ifndef Py_LIMITED_API
/* Py_tracefunc return -1 when raising an exception, or 0 for success. */
typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
@@ -54,7 +60,11 @@ typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
#define PyTrace_C_CALL 4
#define PyTrace_C_EXCEPTION 5
#define PyTrace_C_RETURN 6
+#endif
+#ifdef Py_LIMITED_API
+typedef struct _ts PyThreadState;
+#else
typedef struct _ts {
/* See Python/ceval.c for comments explaining most fields */
@@ -88,6 +98,8 @@ typedef struct _ts {
PyObject *dict; /* Stores per-thread state */
+ /* XXX doesn't mean anything anymore (the comment below is obsolete)
+ => deprecate or remove? */
/* tick_counter is incremented whenever the check_interval ticker
* reaches zero. The purpose is to give a useful measure of the number
* of interpreted bytecode instructions in a given thread. This
@@ -104,6 +116,7 @@ typedef struct _ts {
/* XXX signal handlers should also be here */
} PyThreadState;
+#endif
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
@@ -119,6 +132,7 @@ PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *);
PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *);
#ifdef WITH_THREAD
PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void);
+PyAPI_FUNC(void) _PyGILState_Reinit(void);
#endif
PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void);
@@ -129,12 +143,17 @@ PyAPI_FUNC(int) PyThreadState_SetAsyncExc(long, PyObject *);
/* Variable and macro for in-line access to current thread state */
-PyAPI_DATA(PyThreadState *) _PyThreadState_Current;
+/* Assuming the current thread holds the GIL, this is the
+ PyThreadState for the current thread. */
+#ifndef Py_LIMITED_API
+PyAPI_DATA(_Py_atomic_address) _PyThreadState_Current;
+#endif
-#ifdef Py_DEBUG
+#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
#define PyThreadState_GET() PyThreadState_Get()
#else
-#define PyThreadState_GET() (_PyThreadState_Current)
+#define PyThreadState_GET() \
+ ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current))
#endif
typedef
@@ -185,19 +204,25 @@ PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);
/* The implementation of sys._current_frames() Returns a dict mapping
thread id to that thread's current frame.
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void);
+#endif
/* Routines for advanced debuggers, requested by David Beazley.
Don't use unless you know what you are doing! */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_);
+#endif
/* hook for PyEval_GetFrame(), requested for Psyco */
+#ifndef Py_LIMITED_API
PyAPI_DATA(PyThreadFrameGetter) _PyThreadState_GetFrame;
+#endif
#ifdef __cplusplus
}
diff --git a/Include/pystrtod.h b/Include/pystrtod.h
index b1d8786e50..23fd1c6255 100644
--- a/Include/pystrtod.h
+++ b/Include/pystrtod.h
@@ -6,9 +6,6 @@ extern "C" {
#endif
-PyAPI_FUNC(double) PyOS_ascii_strtod(const char *str, char **ptr);
-PyAPI_FUNC(double) PyOS_ascii_atof(const char *str);
-PyAPI_FUNC(char *) PyOS_ascii_formatd(char *buffer, size_t buf_len, const char *format, double d);
PyAPI_FUNC(double) PyOS_string_to_double(const char *str,
char **endptr,
PyObject *overflow_exception);
@@ -21,7 +18,9 @@ PyAPI_FUNC(char *) PyOS_double_to_string(double val,
int flags,
int *type);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr);
+#endif
/* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index 96a0e232f9..00b4972c8c 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -16,9 +16,11 @@ extern "C" {
#define PyCF_ONLY_AST 0x0400
#define PyCF_IGNORE_COOKIE 0x0800
+#ifndef Py_LIMITED_API
typedef struct {
int cf_flags; /* bitmask of CO_xxx flags relevant to future */
} PyCompilerFlags;
+#endif
PyAPI_FUNC(void) Py_SetProgramName(wchar_t *);
PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
@@ -33,41 +35,87 @@ PyAPI_FUNC(int) Py_IsInitialized(void);
PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
-PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
-PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
-PyAPI_FUNC(int) PyRun_SimpleFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
-PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *, const char *, PyCompilerFlags *);
-PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *, const char *, PyCompilerFlags *);
-
-PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(const char *, const char *,
- int, PyCompilerFlags *flags,
- PyArena *);
-PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(FILE *, const char *,
- const char*, int,
- char *, char *,
- PyCompilerFlags *, int *,
- PyArena *);
+PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
+PyAPI_FUNC(int) PyRun_AnyFileExFlags(
+ FILE *fp,
+ const char *filename, /* decoded from the filesystem encoding */
+ int closeit,
+ PyCompilerFlags *flags);
+PyAPI_FUNC(int) PyRun_SimpleFileExFlags(
+ FILE *fp,
+ const char *filename, /* decoded from the filesystem encoding */
+ int closeit,
+ PyCompilerFlags *flags);
+PyAPI_FUNC(int) PyRun_InteractiveOneFlags(
+ FILE *fp,
+ const char *filename, /* decoded from the filesystem encoding */
+ PyCompilerFlags *flags);
+PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(
+ FILE *fp,
+ const char *filename, /* decoded from the filesystem encoding */
+ PyCompilerFlags *flags);
+
+PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(
+ const char *s,
+ const char *filename, /* decoded from the filesystem encoding */
+ int start,
+ PyCompilerFlags *flags,
+ PyArena *arena);
+PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(
+ FILE *fp,
+ const char *filename, /* decoded from the filesystem encoding */
+ const char* enc,
+ int start,
+ char *ps1,
+ char *ps2,
+ PyCompilerFlags *flags,
+ int *errcode,
+ PyArena *arena);
+#endif
+
+#ifndef PyParser_SimpleParseString
#define PyParser_SimpleParseString(S, B) \
PyParser_SimpleParseStringFlags(S, B, 0)
#define PyParser_SimpleParseFile(FP, S, B) \
PyParser_SimpleParseFileFlags(FP, S, B, 0)
+#endif
PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int,
int);
PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *,
int, int);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,
PyObject *, PyCompilerFlags *);
-PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, const char *, int,
- PyObject *, PyObject *, int,
- PyCompilerFlags *);
+PyAPI_FUNC(PyObject *) PyRun_FileExFlags(
+ FILE *fp,
+ const char *filename, /* decoded from the filesystem encoding */
+ int start,
+ PyObject *globals,
+ PyObject *locals,
+ int closeit,
+ PyCompilerFlags *flags);
+#endif
-#define Py_CompileString(str, p, s) Py_CompileStringFlags(str, p, s, NULL)
-PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int,
- PyCompilerFlags *);
-PyAPI_FUNC(struct symtable *) Py_SymtableString(const char *, const char *, int);
+#ifdef Py_LIMITED_API
+PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
+#else
+#define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1)
+#define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, f, -1)
+PyAPI_FUNC(PyObject *) Py_CompileStringExFlags(
+ const char *str,
+ const char *filename, /* decoded from the filesystem encoding */
+ int start,
+ PyCompilerFlags *flags,
+ int optimize);
+#endif
+PyAPI_FUNC(struct symtable *) Py_SymtableString(
+ const char *str,
+ const char *filename, /* decoded from the filesystem encoding */
+ int start);
PyAPI_FUNC(void) PyErr_Print(void);
PyAPI_FUNC(void) PyErr_PrintEx(int);
@@ -76,16 +124,24 @@ PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
/* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
* exit functions.
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(void));
+#endif
PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
PyAPI_FUNC(void) Py_Exit(int);
+/* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(void) _Py_RestoreSignals(void);
+
PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
+#endif
/* Bootstrap */
PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
+#ifndef Py_LIMITED_API
/* Use macros for a bunch of old variants */
#define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL)
#define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL)
@@ -104,12 +160,17 @@ PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
PyRun_FileExFlags(fp, p, s, g, l, c, NULL)
#define PyRun_FileFlags(fp, p, s, g, l, flags) \
PyRun_FileExFlags(fp, p, s, g, l, 0, flags)
+#endif
/* In getpath.c */
PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
PyAPI_FUNC(wchar_t *) Py_GetPrefix(void);
PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
PyAPI_FUNC(wchar_t *) Py_GetPath(void);
+PyAPI_FUNC(void) Py_SetPath(const wchar_t *);
+#ifdef MS_WINDOWS
+int _Py_CheckPython3();
+#endif
/* In their own files */
PyAPI_FUNC(const char *) Py_GetVersion(void);
@@ -117,13 +178,16 @@ PyAPI_FUNC(const char *) Py_GetPlatform(void);
PyAPI_FUNC(const char *) Py_GetCopyright(void);
PyAPI_FUNC(const char *) Py_GetCompiler(void);
PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(const char *) _Py_svnversion(void);
PyAPI_FUNC(const char *) Py_SubversionRevision(void);
PyAPI_FUNC(const char *) Py_SubversionShortBranch(void);
PyAPI_FUNC(const char *) _Py_hgidentifier(void);
PyAPI_FUNC(const char *) _Py_hgversion(void);
+#endif
/* Internal -- various one-time initializations */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void);
PyAPI_FUNC(PyObject *) _PySys_Init(void);
PyAPI_FUNC(void) _PyImport_Init(void);
@@ -132,8 +196,10 @@ PyAPI_FUNC(void) _PyImportHooks_Init(void);
PyAPI_FUNC(int) _PyFrame_Init(void);
PyAPI_FUNC(void) _PyFloat_Init(void);
PyAPI_FUNC(int) PyByteArray_Init(void);
+#endif
/* Various internal finalizers */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyExc_Fini(void);
PyAPI_FUNC(void) _PyImport_Fini(void);
PyAPI_FUNC(void) PyMethod_Fini(void);
@@ -147,12 +213,20 @@ PyAPI_FUNC(void) PyBytes_Fini(void);
PyAPI_FUNC(void) PyByteArray_Fini(void);
PyAPI_FUNC(void) PyFloat_Fini(void);
PyAPI_FUNC(void) PyOS_FiniInterrupts(void);
+PyAPI_FUNC(void) _PyGC_Fini(void);
+
+PyAPI_DATA(PyThreadState *) _Py_Finalizing;
+#endif
/* Stuff with no proper home (yet) */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *);
+#endif
PyAPI_DATA(int) (*PyOS_InputHook)(void);
PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);
+#ifndef Py_LIMITED_API
PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
+#endif
/* Stack size, in "pointers" (so we get extra safety margins
on 64-bit platforms). On a 32-bit platform, this translates
diff --git a/Include/pythread.h b/Include/pythread.h
index b5a6ec38a6..9806c61159 100644
--- a/Include/pythread.h
+++ b/Include/pythread.h
@@ -2,9 +2,6 @@
#ifndef Py_PYTHREAD_H
#define Py_PYTHREAD_H
-#define NO_EXIT_PROG /* don't define PyThread_exit_prog() */
- /* (the result is no use of signals on SGI) */
-
typedef void *PyThread_type_lock;
typedef void *PyThread_type_sema;
@@ -12,10 +9,17 @@ typedef void *PyThread_type_sema;
extern "C" {
#endif
+/* Return status codes for Python lock acquisition. Chosen for maximum
+ * backwards compatibility, ie failure -> 0, success -> 1. */
+typedef enum PyLockStatus {
+ PY_LOCK_FAILURE = 0,
+ PY_LOCK_ACQUIRED = 1,
+ PY_LOCK_INTR
+} PyLockStatus;
+
PyAPI_FUNC(void) PyThread_init_thread(void);
PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *);
PyAPI_FUNC(void) PyThread_exit_thread(void);
-PyAPI_FUNC(void) PyThread__PyThread_exit_thread(void);
PyAPI_FUNC(long) PyThread_get_thread_ident(void);
PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void);
@@ -23,16 +27,53 @@ PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock);
PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int);
#define WAIT_LOCK 1
#define NOWAIT_LOCK 0
+
+/* PY_TIMEOUT_T is the integral type used to specify timeouts when waiting
+ on a lock (see PyThread_acquire_lock_timed() below).
+ PY_TIMEOUT_MAX is the highest usable value (in microseconds) of that
+ type, and depends on the system threading API.
+
+ NOTE: this isn't the same value as `_thread.TIMEOUT_MAX`. The _thread
+ module exposes a higher-level API, with timeouts expressed in seconds
+ and floating-point numbers allowed.
+*/
+#if defined(HAVE_LONG_LONG)
+#define PY_TIMEOUT_T PY_LONG_LONG
+#define PY_TIMEOUT_MAX PY_LLONG_MAX
+#else
+#define PY_TIMEOUT_T long
+#define PY_TIMEOUT_MAX LONG_MAX
+#endif
+
+/* In the NT API, the timeout is a DWORD and is expressed in milliseconds */
+#if defined (NT_THREADS)
+#if (Py_LL(0xFFFFFFFF) * 1000 < PY_TIMEOUT_MAX)
+#undef PY_TIMEOUT_MAX
+#define PY_TIMEOUT_MAX (Py_LL(0xFFFFFFFF) * 1000)
+#endif
+#endif
+
+/* If microseconds == 0, the call is non-blocking: it returns immediately
+ even when the lock can't be acquired.
+ If microseconds > 0, the call waits up to the specified duration.
+ If microseconds < 0, the call waits until success (or abnormal failure)
+
+ microseconds must be less than PY_TIMEOUT_MAX. Behaviour otherwise is
+ undefined.
+
+ If intr_flag is true and the acquire is interrupted by a signal, then the
+ call will return PY_LOCK_INTR. The caller may reattempt to acquire the
+ lock.
+*/
+PyAPI_FUNC(PyLockStatus) PyThread_acquire_lock_timed(PyThread_type_lock,
+ PY_TIMEOUT_T microseconds,
+ int intr_flag);
+
PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
PyAPI_FUNC(size_t) PyThread_get_stacksize(void);
PyAPI_FUNC(int) PyThread_set_stacksize(size_t);
-#ifndef NO_EXIT_PROG
-PyAPI_FUNC(void) PyThread_exit_prog(int);
-PyAPI_FUNC(void) PyThread__PyThread_exit_prog(int);
-#endif
-
/* Thread Local Storage (TLS) API */
PyAPI_FUNC(int) PyThread_create_key(void);
PyAPI_FUNC(void) PyThread_delete_key(int);
diff --git a/Include/pytime.h b/Include/pytime.h
new file mode 100644
index 0000000000..d707bdb9a8
--- /dev/null
+++ b/Include/pytime.h
@@ -0,0 +1,48 @@
+#ifndef Py_LIMITED_API
+#ifndef Py_PYTIME_H
+#define Py_PYTIME_H
+
+#include "pyconfig.h" /* include for defines */
+
+/**************************************************************************
+Symbols and macros to supply platform-independent interfaces to time related
+functions and constants
+**************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_GETTIMEOFDAY
+typedef struct timeval _PyTime_timeval;
+#else
+typedef struct {
+ time_t tv_sec; /* seconds since Jan. 1, 1970 */
+ long tv_usec; /* and microseconds */
+} _PyTime_timeval;
+#endif
+
+/* Similar to POSIX gettimeofday but cannot fail. If system gettimeofday
+ * fails or is not available, fall back to lower resolution clocks.
+ */
+PyAPI_FUNC(void) _PyTime_gettimeofday(_PyTime_timeval *tp);
+
+#define _PyTime_ADD_SECONDS(tv, interval) \
+do { \
+ tv.tv_usec += (long) (((long) interval - interval) * 1000000); \
+ tv.tv_sec += (time_t) interval + (time_t) (tv.tv_usec / 1000000); \
+ tv.tv_usec %= 1000000; \
+} while (0)
+
+#define _PyTime_INTERVAL(tv_start, tv_end) \
+ ((tv_end.tv_sec - tv_start.tv_sec) + \
+ (tv_end.tv_usec - tv_start.tv_usec) * 0.000001)
+
+/* Dummy to force linking. */
+PyAPI_FUNC(void) _PyTime_Init(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Py_PYTIME_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/setobject.h b/Include/setobject.h
index 574caf7380..623411101d 100644
--- a/Include/setobject.h
+++ b/Include/setobject.h
@@ -18,15 +18,12 @@ Note: .pop() abuses the hash field of an Unused or Dummy slot to
hold a search finger. The hash field of Unused or Dummy slots has
no meaning otherwise.
*/
-
+#ifndef Py_LIMITED_API
#define PySet_MINSIZE 8
typedef struct {
- /* Cached hash code of the key. Note that hash codes are C longs.
- * We have to use Py_ssize_t instead because set_pop() abuses
- * the hash field to hold a search finger.
- */
- Py_ssize_t hash;
+ /* Cached hash code of the key. */
+ Py_hash_t hash;
PyObject *key;
} setentry;
@@ -53,12 +50,13 @@ struct _setobject {
* saves repeated runtime null-tests.
*/
setentry *table;
- setentry *(*lookup)(PySetObject *so, PyObject *key, long hash);
+ setentry *(*lookup)(PySetObject *so, PyObject *key, Py_hash_t hash);
setentry smalltable[PySet_MINSIZE];
- long hash; /* only used by frozenset objects */
+ Py_hash_t hash; /* only used by frozenset objects */
PyObject *weakreflist; /* List of weak references */
};
+#endif /* Py_LIMITED_API */
PyAPI_DATA(PyTypeObject) PySet_Type;
PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
@@ -88,14 +86,20 @@ PyAPI_DATA(PyTypeObject) PySetIter_Type;
PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);
PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset);
+#ifndef Py_LIMITED_API
#define PySet_GET_SIZE(so) (((PySetObject *)(so))->used)
+#endif
PyAPI_FUNC(int) PySet_Clear(PyObject *set);
PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key);
PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
-PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
+#endif
PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
+#endif
#ifdef __cplusplus
}
diff --git a/Include/sliceobject.h b/Include/sliceobject.h
index 8ab62dd4f8..8bec17909d 100644
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -18,11 +18,12 @@ A slice object containing start, stop, and step data members (the
names are from range). After much talk with Guido, it was decided to
let these be any arbitrary python type. Py_None stands for omitted values.
*/
-
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
PyObject *start, *stop, *step; /* not NULL */
} PySliceObject;
+#endif
PyAPI_DATA(PyTypeObject) PySlice_Type;
PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
@@ -31,10 +32,12 @@ PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
PyObject* step);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
-PyAPI_FUNC(int) PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
+#endif
+PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
-PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
+PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop,
Py_ssize_t *step, Py_ssize_t *slicelength);
diff --git a/Include/structseq.h b/Include/structseq.h
index 0b8d387937..30c52aca9b 100644
--- a/Include/structseq.h
+++ b/Include/structseq.h
@@ -1,5 +1,5 @@
-/* Tuple object interface */
+/* Named tuple object interface */
#ifndef Py_STRUCTSEQ_H
#define Py_STRUCTSEQ_H
@@ -21,23 +21,25 @@ typedef struct PyStructSequence_Desc {
extern char* PyStructSequence_UnnamedField;
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
PyStructSequence_Desc *desc);
+#endif
+PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
-typedef struct {
- PyObject_VAR_HEAD
- PyObject *ob_item[1];
-} PyStructSequence;
+#ifndef Py_LIMITED_API
+typedef PyTupleObject PyStructSequence;
/* Macro, *only* to be used to fill in brand new objects */
-#define PyStructSequence_SET_ITEM(op, i, v) \
- (((PyStructSequence *)(op))->ob_item[i] = v)
+#define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
-#define PyStructSequence_GET_ITEM(op, i) \
- (((PyStructSequence *)(op))->ob_item[i])
+#define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i)
+#endif
+PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
+PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
#ifdef __cplusplus
}
diff --git a/Include/symtable.h b/Include/symtable.h
index 9abc5b2455..fd7de049b6 100644
--- a/Include/symtable.h
+++ b/Include/symtable.h
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
#ifndef Py_SYMTABLE_H
#define Py_SYMTABLE_H
@@ -15,7 +16,8 @@ typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock }
struct _symtable_entry;
struct symtable {
- const char *st_filename; /* name of file being compiled */
+ const char *st_filename; /* name of file being compiled,
+ decoded from the filesystem encoding */
struct _symtable_entry *st_cur; /* current symbol table entry */
struct _symtable_entry *st_top; /* symbol table entry for module */
PyObject *st_blocks; /* dict: map AST node addresses
@@ -46,7 +48,9 @@ typedef struct _symtable_entry {
unsigned ste_returns_value : 1; /* true if namespace uses return with
an argument */
int ste_lineno; /* first line of block */
+ int ste_col_offset; /* offset of first line of block */
int ste_opt_lineno; /* lineno of last exec or import * */
+ int ste_opt_col_offset; /* offset of last exec or import * */
int ste_tmpname; /* counter for listcomp temp vars */
struct symtable *ste_table;
} PySTEntryObject;
@@ -57,8 +61,10 @@ PyAPI_DATA(PyTypeObject) PySTEntry_Type;
PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *);
-PyAPI_FUNC(struct symtable *) PySymtable_Build(mod_ty, const char *,
- PyFutureFeatures *);
+PyAPI_FUNC(struct symtable *) PySymtable_Build(
+ mod_ty mod,
+ const char *filename, /* decoded from the filesystem encoding */
+ PyFutureFeatures *future);
PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *);
PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
@@ -70,13 +76,9 @@ PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
#define DEF_PARAM 2<<1 /* formal parameter */
#define DEF_NONLOCAL 2<<2 /* nonlocal stmt */
#define USE 2<<3 /* name is used */
-#define DEF_STAR 2<<4 /* parameter is star arg */
-#define DEF_DOUBLESTAR 2<<5 /* parameter is star-star arg */
-#define DEF_INTUPLE 2<<6 /* name defined in tuple in parameters */
-#define DEF_FREE 2<<7 /* name used but not defined in nested block */
-#define DEF_FREE_GLOBAL 2<<8 /* free variable is actually implicit global */
-#define DEF_FREE_CLASS 2<<9 /* free variable from class's method */
-#define DEF_IMPORT 2<<10 /* assignment occurred via import */
+#define DEF_FREE 2<<4 /* name used but not defined in nested block */
+#define DEF_FREE_CLASS 2<<5 /* free variable from class's method */
+#define DEF_IMPORT 2<<6 /* assignment occurred via import */
#define DEF_BOUND (DEF_LOCAL | DEF_PARAM | DEF_IMPORT)
@@ -104,3 +106,4 @@ PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
}
#endif
#endif /* !Py_SYMTABLE_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/sysmodule.h b/Include/sysmodule.h
index 2268f3ab2b..010e6e080a 100644
--- a/Include/sysmodule.h
+++ b/Include/sysmodule.h
@@ -14,17 +14,24 @@ PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
PyAPI_FUNC(void) PySys_SetPath(const wchar_t *);
PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
- Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
+ Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
- Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
+ Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
+PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
+PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
+#ifndef Py_LIMITED_API
PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
-PyAPI_DATA(int) _PySys_CheckInterval;
+#endif
PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *);
+PyAPI_FUNC(void) PySys_AddWarnOptionUnicode(PyObject *);
PyAPI_FUNC(int) PySys_HasWarnOptions(void);
+PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
+PyAPI_FUNC(PyObject *) PySys_GetXOptions(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/Include/timefuncs.h b/Include/timefuncs.h
index 553142dba0..3c4357505a 100644
--- a/Include/timefuncs.h
+++ b/Include/timefuncs.h
@@ -14,7 +14,9 @@ extern "C" {
* to fit in a time_t. ValueError is set on return iff the return
* value is (time_t)-1 and PyErr_Occurred().
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x);
+#endif
#ifdef __cplusplus
diff --git a/Include/token.h b/Include/token.h
index 9c19f5ce9d..a462c64db9 100644
--- a/Include/token.h
+++ b/Include/token.h
@@ -1,6 +1,6 @@
/* Token types */
-
+#ifndef Py_LIMITED_API
#ifndef Py_TOKEN_H
#define Py_TOKEN_H
#ifdef __cplusplus
@@ -85,3 +85,4 @@ PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int);
}
#endif
#endif /* !Py_TOKEN_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/traceback.h b/Include/traceback.h
index fc0c586b89..69e3d05453 100644
--- a/Include/traceback.h
+++ b/Include/traceback.h
@@ -8,7 +8,7 @@ extern "C" {
struct _frame;
/* Traceback interface */
-
+#ifndef Py_LIMITED_API
typedef struct _traceback {
PyObject_HEAD
struct _traceback *tb_next;
@@ -16,10 +16,13 @@ typedef struct _traceback {
int tb_lasti;
int tb_lineno;
} PyTracebackObject;
+#endif
PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *);
PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int);
+#endif
/* Reveal traceback type so we can typecheck traceback objects */
PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
diff --git a/Include/tupleobject.h b/Include/tupleobject.h
index 19fe7a53a5..f17b7882be 100644
--- a/Include/tupleobject.h
+++ b/Include/tupleobject.h
@@ -21,6 +21,7 @@ inserted in the tuple. Similarly, PyTuple_GetItem does not increment the
returned item's reference count.
*/
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_VAR_HEAD
PyObject *ob_item[1];
@@ -30,6 +31,7 @@ typedef struct {
* the tuple is not yet visible outside the function that builds it.
*/
} PyTupleObject;
+#endif
PyAPI_DATA(PyTypeObject) PyTuple_Type;
PyAPI_DATA(PyTypeObject) PyTupleIter_Type;
@@ -43,16 +45,22 @@ PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *);
PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t);
PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *);
PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t);
+#endif
PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
+#endif
/* Macro, trading safety for speed */
+#ifndef Py_LIMITED_API
#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
#define PyTuple_GET_SIZE(op) Py_SIZE(op)
/* Macro, *only* to be used to fill in brand new tuples */
#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
+#endif
PyAPI_FUNC(int) PyTuple_ClearFreeList(void);
diff --git a/Include/typeslots.h b/Include/typeslots.h
new file mode 100644
index 0000000000..ad3cdfb19a
--- /dev/null
+++ b/Include/typeslots.h
@@ -0,0 +1,76 @@
+/* Do not renumber the file; these numbers are part of the stable ABI. */
+/* Disabled, see #10181 */
+#undef Py_bf_getbuffer
+#undef Py_bf_releasebuffer
+#define Py_mp_ass_subscript 3
+#define Py_mp_length 4
+#define Py_mp_subscript 5
+#define Py_nb_absolute 6
+#define Py_nb_add 7
+#define Py_nb_and 8
+#define Py_nb_bool 9
+#define Py_nb_divmod 10
+#define Py_nb_float 11
+#define Py_nb_floor_divide 12
+#define Py_nb_index 13
+#define Py_nb_inplace_add 14
+#define Py_nb_inplace_and 15
+#define Py_nb_inplace_floor_divide 16
+#define Py_nb_inplace_lshift 17
+#define Py_nb_inplace_multiply 18
+#define Py_nb_inplace_or 19
+#define Py_nb_inplace_power 20
+#define Py_nb_inplace_remainder 21
+#define Py_nb_inplace_rshift 22
+#define Py_nb_inplace_subtract 23
+#define Py_nb_inplace_true_divide 24
+#define Py_nb_inplace_xor 25
+#define Py_nb_int 26
+#define Py_nb_invert 27
+#define Py_nb_lshift 28
+#define Py_nb_multiply 29
+#define Py_nb_negative 30
+#define Py_nb_or 31
+#define Py_nb_positive 32
+#define Py_nb_power 33
+#define Py_nb_remainder 34
+#define Py_nb_rshift 35
+#define Py_nb_subtract 36
+#define Py_nb_true_divide 37
+#define Py_nb_xor 38
+#define Py_sq_ass_item 39
+#define Py_sq_concat 40
+#define Py_sq_contains 41
+#define Py_sq_inplace_concat 42
+#define Py_sq_inplace_repeat 43
+#define Py_sq_item 44
+#define Py_sq_length 45
+#define Py_sq_repeat 46
+#define Py_tp_alloc 47
+#define Py_tp_base 48
+#define Py_tp_bases 49
+#define Py_tp_call 50
+#define Py_tp_clear 51
+#define Py_tp_dealloc 52
+#define Py_tp_del 53
+#define Py_tp_descr_get 54
+#define Py_tp_descr_set 55
+#define Py_tp_doc 56
+#define Py_tp_getattr 57
+#define Py_tp_getattro 58
+#define Py_tp_hash 59
+#define Py_tp_init 60
+#define Py_tp_is_gc 61
+#define Py_tp_iter 62
+#define Py_tp_iternext 63
+#define Py_tp_methods 64
+#define Py_tp_new 65
+#define Py_tp_repr 66
+#define Py_tp_richcompare 67
+#define Py_tp_setattr 68
+#define Py_tp_setattro 69
+#define Py_tp_str 70
+#define Py_tp_traverse 71
+#define Py_tp_members 72
+#define Py_tp_getset 73
+#define Py_tp_free 74
diff --git a/Include/ucnhash.h b/Include/ucnhash.h
index 69b7774a97..70fdf13069 100644
--- a/Include/ucnhash.h
+++ b/Include/ucnhash.h
@@ -1,5 +1,5 @@
/* Unicode name database interface */
-
+#ifndef Py_LIMITED_API
#ifndef Py_UCNHASH_H
#define Py_UCNHASH_H
#ifdef __cplusplus
@@ -31,3 +31,4 @@ typedef struct {
}
#endif
#endif /* !Py_UCNHASH_H */
+#endif /* !Py_LIMITED_API */
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 64f30e5373..4d2a8e4d63 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -79,7 +79,7 @@ Copyright (c) Corporation for National Research Initiatives.
#define Py_UNICODE_WIDE
#endif
-/* Set these flags if the platform has "wchar.h", "wctype.h" and the
+/* Set these flags if the platform has "wchar.h" and the
wchar_t type is a 16-bit unsigned type */
/* #define HAVE_WCHAR_H */
/* #define HAVE_USABLE_WCHAR_T */
@@ -100,8 +100,8 @@ Copyright (c) Corporation for National Research Initiatives.
#endif
/* If the compiler provides a wchar_t type we try to support it
- through the interface functions PyUnicode_FromWideChar() and
- PyUnicode_AsWideChar(). */
+ through the interface functions PyUnicode_FromWideChar(),
+ PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). */
#ifdef HAVE_USABLE_WCHAR_T
# ifndef HAVE_WCHAR_H
@@ -131,7 +131,9 @@ typedef unsigned long Py_UCS4;
Python and represents a single Unicode element in the Unicode
type. */
+#ifndef Py_LIMITED_API
typedef PY_UNICODE_TYPE Py_UNICODE;
+#endif
/* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */
@@ -157,8 +159,10 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_AsUnicode PyUnicodeUCS2_AsUnicode
# define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS2_AsUnicodeEscapeString
# define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar
+# define PyUnicode_AsWideCharString PyUnicodeUCS2_AsWideCharString
# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist
# define PyUnicode_Compare PyUnicodeUCS2_Compare
+# define PyUnicode_CompareWithASCIIString PyUnicodeUCS2_CompareWithASCIIString
# define PyUnicode_Concat PyUnicodeUCS2_Concat
# define PyUnicode_Append PyUnicodeUCS2_Append
# define PyUnicode_AppendAndDel PyUnicodeUCS2_AppendAndDel
@@ -200,6 +204,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode
# define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar
# define PyUnicode_FSConverter PyUnicodeUCS2_FSConverter
+# define PyUnicode_FSDecoder PyUnicodeUCS2_FSDecoder
# define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding
# define PyUnicode_GetMax PyUnicodeUCS2_GetMax
# define PyUnicode_GetSize PyUnicodeUCS2_GetSize
@@ -211,7 +216,6 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_Replace PyUnicodeUCS2_Replace
# define PyUnicode_Resize PyUnicodeUCS2_Resize
# define PyUnicode_RichCompare PyUnicodeUCS2_RichCompare
-# define PyUnicode_SetDefaultEncoding PyUnicodeUCS2_SetDefaultEncoding
# define PyUnicode_Split PyUnicodeUCS2_Split
# define PyUnicode_Splitlines PyUnicodeUCS2_Splitlines
# define PyUnicode_Tailmatch PyUnicodeUCS2_Tailmatch
@@ -220,24 +224,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString
# define _PyUnicode_Fini _PyUnicodeUCS2_Fini
# define _PyUnicode_Init _PyUnicodeUCS2_Init
-# define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha
-# define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit
-# define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit
-# define _PyUnicode_IsLinebreak _PyUnicodeUCS2_IsLinebreak
-# define _PyUnicode_IsLowercase _PyUnicodeUCS2_IsLowercase
-# define _PyUnicode_IsNumeric _PyUnicodeUCS2_IsNumeric
-# define _PyUnicode_IsPrintable _PyUnicodeUCS2_IsPrintable
-# define _PyUnicode_IsTitlecase _PyUnicodeUCS2_IsTitlecase
-# define _PyUnicode_IsXidStart _PyUnicodeUCS2_IsXidStart
-# define _PyUnicode_IsXidContinue _PyUnicodeUCS2_IsXidContinue
-# define _PyUnicode_IsUppercase _PyUnicodeUCS2_IsUppercase
-# define _PyUnicode_IsWhitespace _PyUnicodeUCS2_IsWhitespace
-# define _PyUnicode_ToDecimalDigit _PyUnicodeUCS2_ToDecimalDigit
-# define _PyUnicode_ToDigit _PyUnicodeUCS2_ToDigit
-# define _PyUnicode_ToLowercase _PyUnicodeUCS2_ToLowercase
-# define _PyUnicode_ToNumeric _PyUnicodeUCS2_ToNumeric
-# define _PyUnicode_ToTitlecase _PyUnicodeUCS2_ToTitlecase
-# define _PyUnicode_ToUppercase _PyUnicodeUCS2_ToUppercase
+# define PyUnicode_strdup PyUnicodeUCS2_strdup
#else
@@ -256,8 +243,10 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_AsUnicode PyUnicodeUCS4_AsUnicode
# define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS4_AsUnicodeEscapeString
# define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar
+# define PyUnicode_AsWideCharString PyUnicodeUCS4_AsWideCharString
# define PyUnicode_ClearFreeList PyUnicodeUCS4_ClearFreelist
# define PyUnicode_Compare PyUnicodeUCS4_Compare
+# define PyUnicode_CompareWithASCIIString PyUnicodeUCS4_CompareWithASCIIString
# define PyUnicode_Concat PyUnicodeUCS4_Concat
# define PyUnicode_Append PyUnicodeUCS4_Append
# define PyUnicode_AppendAndDel PyUnicodeUCS4_AppendAndDel
@@ -299,6 +288,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode
# define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar
# define PyUnicode_FSConverter PyUnicodeUCS4_FSConverter
+# define PyUnicode_FSDecoder PyUnicodeUCS4_FSDecoder
# define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding
# define PyUnicode_GetMax PyUnicodeUCS4_GetMax
# define PyUnicode_GetSize PyUnicodeUCS4_GetSize
@@ -310,7 +300,6 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_Replace PyUnicodeUCS4_Replace
# define PyUnicode_Resize PyUnicodeUCS4_Resize
# define PyUnicode_RichCompare PyUnicodeUCS4_RichCompare
-# define PyUnicode_SetDefaultEncoding PyUnicodeUCS4_SetDefaultEncoding
# define PyUnicode_Split PyUnicodeUCS4_Split
# define PyUnicode_Splitlines PyUnicodeUCS4_Splitlines
# define PyUnicode_Tailmatch PyUnicodeUCS4_Tailmatch
@@ -319,69 +308,19 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString
# define _PyUnicode_Fini _PyUnicodeUCS4_Fini
# define _PyUnicode_Init _PyUnicodeUCS4_Init
-# define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha
-# define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit
-# define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit
-# define _PyUnicode_IsLinebreak _PyUnicodeUCS4_IsLinebreak
-# define _PyUnicode_IsLowercase _PyUnicodeUCS4_IsLowercase
-# define _PyUnicode_IsNumeric _PyUnicodeUCS4_IsNumeric
-# define _PyUnicode_IsPrintable _PyUnicodeUCS4_IsPrintable
-# define _PyUnicode_IsTitlecase _PyUnicodeUCS4_IsTitlecase
-# define _PyUnicode_IsXidStart _PyUnicodeUCS4_IsXidStart
-# define _PyUnicode_IsXidContinue _PyUnicodeUCS4_IsXidContinue
-# define _PyUnicode_IsUppercase _PyUnicodeUCS4_IsUppercase
-# define _PyUnicode_IsWhitespace _PyUnicodeUCS4_IsWhitespace
-# define _PyUnicode_ToDecimalDigit _PyUnicodeUCS4_ToDecimalDigit
-# define _PyUnicode_ToDigit _PyUnicodeUCS4_ToDigit
-# define _PyUnicode_ToLowercase _PyUnicodeUCS4_ToLowercase
-# define _PyUnicode_ToNumeric _PyUnicodeUCS4_ToNumeric
-# define _PyUnicode_ToTitlecase _PyUnicodeUCS4_ToTitlecase
-# define _PyUnicode_ToUppercase _PyUnicodeUCS4_ToUppercase
-
+# define PyUnicode_strdup PyUnicodeUCS4_strdup
#endif
/* --- Internal Unicode Operations ---------------------------------------- */
-/* If you want Python to use the compiler's wctype.h functions instead
- of the ones supplied with Python, define WANT_WCTYPE_FUNCTIONS or
- configure Python using --with-wctype-functions. This reduces the
- interpreter's code size. */
-
-#if defined(HAVE_USABLE_WCHAR_T) && defined(WANT_WCTYPE_FUNCTIONS)
-
-#include <wctype.h>
-
-#define Py_UNICODE_ISSPACE(ch) iswspace(ch)
-
-#define Py_UNICODE_ISLOWER(ch) iswlower(ch)
-#define Py_UNICODE_ISUPPER(ch) iswupper(ch)
-#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch)
-#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch)
-
-#define Py_UNICODE_TOLOWER(ch) towlower(ch)
-#define Py_UNICODE_TOUPPER(ch) towupper(ch)
-#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch)
-
-#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch)
-#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch)
-#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch)
-#define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch)
-
-#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch)
-#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
-#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch)
-
-#define Py_UNICODE_ISALPHA(ch) iswalpha(ch)
-
-#else
-
/* Since splitting on whitespace is an important use case, and
whitespace in most situations is solely ASCII whitespace, we
optimize for the common case by using a quick look-up table
_Py_ascii_whitespace (see below) with an inlined check.
*/
+#ifndef Py_LIMITED_API
#define Py_UNICODE_ISSPACE(ch) \
((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
@@ -405,8 +344,6 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
#define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch)
-#endif
-
#define Py_UNICODE_ISALNUM(ch) \
(Py_UNICODE_ISALPHA(ch) || \
Py_UNICODE_ISDECIMAL(ch) || \
@@ -428,6 +365,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
((*((string)->str + (offset)) == *((substring)->str)) && \
((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \
!memcmp((string)->str + (offset), (substring)->str, (substring)->length*sizeof(Py_UNICODE)))
+#endif /* Py_LIMITED_API */
#ifdef __cplusplus
extern "C" {
@@ -435,11 +373,12 @@ extern "C" {
/* --- Unicode Type ------------------------------------------------------- */
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
Py_ssize_t length; /* Length of raw Unicode data in buffer */
Py_UNICODE *str; /* Raw Unicode buffer */
- long hash; /* Hash value; -1 if not set */
+ Py_hash_t hash; /* Hash value; -1 if not set */
int state; /* != 0 if interned. In this case the two
* references from the dictionary to this object
* are *not* counted in ob_refcnt. */
@@ -447,6 +386,7 @@ typedef struct {
string, or NULL; this is used for
implementing the buffer protocol */
} PyUnicodeObject;
+#endif
PyAPI_DATA(PyTypeObject) PyUnicode_Type;
PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
@@ -460,6 +400,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
#define PyUnicode_CheckExact(op) (Py_TYPE(op) == &PyUnicode_Type)
/* Fast access macros */
+#ifndef Py_LIMITED_API
#define PyUnicode_GET_SIZE(op) \
(assert(PyUnicode_Check(op)),(((PyUnicodeObject *)(op))->length))
#define PyUnicode_GET_DATA_SIZE(op) \
@@ -468,6 +409,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
(assert(PyUnicode_Check(op)),(((PyUnicodeObject *)(op))->str))
#define PyUnicode_AS_DATA(op) \
(assert(PyUnicode_Check(op)),((const char *)((PyUnicodeObject *)(op))->str))
+#endif
/* --- Constants ---------------------------------------------------------- */
@@ -492,29 +434,33 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
The buffer is copied into the new object. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
const Py_UNICODE *u, /* Unicode buffer */
Py_ssize_t size /* size of buffer */
);
+#endif
/* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */
PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize(
- const char *u, /* char buffer */
- Py_ssize_t size /* size of buffer */
+ const char *u, /* UTF-8 encoded string */
+ Py_ssize_t size /* size of buffer */
);
/* Similar to PyUnicode_FromUnicode(), but u points to null-terminated
UTF-8 encoded bytes */
PyAPI_FUNC(PyObject*) PyUnicode_FromString(
- const char *u /* string */
+ const char *u /* UTF-8 encoded string */
);
/* Return a read-only pointer to the Unicode object's internal
Py_UNICODE buffer. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
PyObject *unicode /* Unicode object */
);
+#endif
/* Get the length of the Unicode object. */
@@ -522,8 +468,10 @@ PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
/* Get the maximum ordinal for a Unicode character. */
PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void);
+#endif
/* Resize an already allocated Unicode object to the new size length.
@@ -584,19 +532,31 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromObject(
register PyObject *obj /* Object */
);
-PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV(const char*, va_list);
-PyAPI_FUNC(PyObject *) PyUnicode_FromFormat(const char*, ...);
+PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV(
+ const char *format, /* ASCII-encoded string */
+ va_list vargs
+ );
+PyAPI_FUNC(PyObject *) PyUnicode_FromFormat(
+ const char *format, /* ASCII-encoded string */
+ ...
+ );
+#ifndef Py_LIMITED_API
/* Format the object based on the format_spec, as defined in PEP 3101
(Advanced String Formatting). */
PyAPI_FUNC(PyObject *) _PyUnicode_FormatAdvanced(PyObject *obj,
Py_UNICODE *format_spec,
Py_ssize_t format_spec_len);
+#endif
PyAPI_FUNC(void) PyUnicode_InternInPlace(PyObject **);
PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
-PyAPI_FUNC(PyObject *) PyUnicode_InternFromString(const char *);
+PyAPI_FUNC(PyObject *) PyUnicode_InternFromString(
+ const char *u /* UTF-8 encoded string */
+ );
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _Py_ReleaseInternedUnicodeStrings(void);
+#endif
/* Use only if you know it's a string */
#define PyUnicode_CHECK_INTERNED(op) (((PyUnicodeObject *)(op))->state)
@@ -628,11 +588,24 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar(
error. */
PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
- PyUnicodeObject *unicode, /* Unicode object */
+ PyObject *unicode, /* Unicode object */
register wchar_t *w, /* wchar_t buffer */
Py_ssize_t size /* size of buffer */
);
+/* Convert the Unicode object to a wide character string. The output string
+ always ends with a nul character. If size is not NULL, write the number of
+ wide characters (including the nul character) into *size.
+
+ Returns a buffer allocated by PyMem_Alloc() (use PyMem_Free() to free it)
+ on success. On error, returns NULL, *size is undefined and raises a
+ MemoryError. */
+
+PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString(
+ PyObject *unicode, /* Unicode object */
+ Py_ssize_t *size /* number of characters of the result */
+ );
+
#endif
/* --- Unicode ordinals --------------------------------------------------- */
@@ -693,9 +666,11 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString(
PyObject *unicode,
const char *errors);
+#endif
/* Returns a pointer to the default encoding (UTF-8) of the
Unicode object unicode and the size of the encoded representation
@@ -711,9 +686,11 @@ PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString(
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(char *) _PyUnicode_AsStringAndSize(
PyObject *unicode,
Py_ssize_t *size);
+#endif
/* Returns a pointer to the default encoding (UTF-8) of the
Unicode object unicode.
@@ -729,22 +706,14 @@ PyAPI_FUNC(char *) _PyUnicode_AsStringAndSize(
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(char *) _PyUnicode_AsString(PyObject *unicode);
+#endif
/* Returns "utf-8". */
PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void);
-/* Sets the currently active default encoding.
-
- Returns 0 on success, -1 in case of an error.
-
- */
-
-PyAPI_FUNC(int) PyUnicode_SetDefaultEncoding(
- const char *encoding /* Encoding name in standard form */
- );
-
/* --- Generic Codecs ----------------------------------------------------- */
/* Create a Unicode object by decoding the encoded string s of the
@@ -778,12 +747,14 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedUnicode(
/* Encodes a Py_UNICODE buffer of the given size and returns a
Python string object. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_Encode(
const Py_UNICODE *s, /* Unicode char buffer */
Py_ssize_t size, /* number of Py_UNICODE chars to encode */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
+#endif
/* Encodes a Unicode object and returns the result as Python
object. */
@@ -833,6 +804,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7Stateful(
Py_ssize_t *consumed /* bytes consumed */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
@@ -840,6 +812,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7(
int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */
const char *errors /* error handling */
);
+#endif
/* --- UTF-8 Codecs ------------------------------------------------------- */
@@ -860,11 +833,13 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String(
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors /* error handling */
);
+#endif
/* --- UTF-32 Codecs ------------------------------------------------------ */
@@ -933,12 +908,14 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF32String(
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors, /* error handling */
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
);
+#endif
/* --- UTF-16 Codecs ------------------------------------------------------ */
@@ -1011,12 +988,14 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF16String(
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors, /* error handling */
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
);
+#endif
/* --- Unicode-Escape Codecs ---------------------------------------------- */
@@ -1030,10 +1009,12 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length /* Number of Py_UNICODE chars to encode */
);
+#endif
/* --- Raw-Unicode-Escape Codecs ------------------------------------------ */
@@ -1047,20 +1028,24 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString(
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeRawUnicodeEscape(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length /* Number of Py_UNICODE chars to encode */
);
+#endif
/* --- Unicode Internal Codec ---------------------------------------------
Only for internal use in _codecsmodule.c */
+#ifndef Py_LIMITED_API
PyObject *_PyUnicode_DecodeUnicodeInternal(
const char *string,
Py_ssize_t length,
const char *errors
);
+#endif
/* --- Latin-1 Codecs -----------------------------------------------------
@@ -1078,11 +1063,13 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsLatin1String(
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
const char *errors /* error handling */
);
+#endif
/* --- ASCII Codecs -------------------------------------------------------
@@ -1100,11 +1087,13 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsASCIIString(
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
const char *errors /* error handling */
);
+#endif
/* --- Character Map Codecs -----------------------------------------------
@@ -1142,6 +1131,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsCharmapString(
(unicode ordinal -> char ordinal) */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
@@ -1149,6 +1139,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap(
(unicode ordinal -> char ordinal) */
const char *errors /* error handling */
);
+#endif
/* Translate a Py_UNICODE buffer of the given length by applying a
character mapping table to it and return the resulting Unicode
@@ -1163,12 +1154,14 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap(
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
PyObject *table, /* Translate table */
const char *errors /* error handling */
);
+#endif
#ifdef MS_WIN32
@@ -1191,11 +1184,13 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString(
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
const char *errors /* error handling */
);
+#endif
#endif /* MS_WIN32 */
@@ -1223,27 +1218,47 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
Py_UNICODE *s, /* Unicode buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
char *output, /* Output buffer; must have size >= length */
const char *errors /* error handling */
);
+#endif
+
+/* Transforms code points that have decimal digit property to the
+ corresponding ASCII digit code points.
+
+ Returns a new Unicode string on success, NULL on failure.
+*/
+
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII(
+ Py_UNICODE *s, /* Unicode buffer */
+ Py_ssize_t length /* Number of Py_UNICODE chars to transform */
+ );
+#endif
/* --- File system encoding ---------------------------------------------- */
-/* ParseTuple converter which converts a Unicode object into the file
- system encoding as a bytes object, using the "surrogateescape" error
- handler; bytes objects are output as-is. */
+/* ParseTuple converter: encode str objects to bytes using
+ PyUnicode_EncodeFSDefault(); bytes objects are output as-is. */
PyAPI_FUNC(int) PyUnicode_FSConverter(PyObject*, void*);
+/* ParseTuple converter: decode bytes objects to unicode using
+ PyUnicode_DecodeFSDefaultAndSize(); str objects are output as-is. */
+
+PyAPI_FUNC(int) PyUnicode_FSDecoder(PyObject*, void*);
+
/* Decode a null-terminated string using Py_FileSystemDefaultEncoding
and the "surrogateescape" error handler.
- If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
+ encoding.
- Use PyUnicode_DecodeFSDefaultAndSize() if you have the string length.
+ Use PyUnicode_DecodeFSDefaultAndSize() if the string length is known.
*/
PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault(
@@ -1253,7 +1268,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault(
/* Decode a string using Py_FileSystemDefaultEncoding
and the "surrogateescape" error handler.
- If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
+ encoding.
*/
PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
@@ -1261,6 +1277,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
Py_ssize_t size /* size */
);
+/* Encode a Unicode object to Py_FileSystemDefaultEncoding with the
+ "surrogateescape" error handler, and return bytes.
+
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
+ encoding.
+*/
+
+PyAPI_FUNC(PyObject*) PyUnicode_EncodeFSDefault(
+ PyObject *unicode
+ );
+
/* --- Methods & Slots ----------------------------------------------------
These are capable of handling Unicode objects and strings on input
@@ -1430,7 +1457,7 @@ PyAPI_FUNC(int) PyUnicode_Compare(
PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
PyObject *left,
- const char *right
+ const char *right /* ASCII-encoded string */
);
/* Rich compare two strings and return one of the following:
@@ -1478,26 +1505,31 @@ PyAPI_FUNC(int) PyUnicode_Contains(
PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);
+#ifndef Py_LIMITED_API
/* Externally visible for str.strip(unicode) */
PyAPI_FUNC(PyObject *) _PyUnicode_XStrip(
PyUnicodeObject *self,
int striptype,
PyObject *sepobj
);
+#endif
/* Using the current locale, insert the thousands grouping
into the string pointed to by buffer. For the argument descriptions,
see Objects/stringlib/localeutil.h */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGroupingLocale(Py_UNICODE *buffer,
Py_ssize_t n_buffer,
Py_UNICODE *digits,
Py_ssize_t n_digits,
Py_ssize_t min_width);
+#endif
/* Using explicit passed-in values, insert the thousands grouping
into the string pointed to by buffer. For the argument descriptions,
see Objects/stringlib/localeutil.h */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping(Py_UNICODE *buffer,
Py_ssize_t n_buffer,
Py_UNICODE *digits,
@@ -1505,10 +1537,12 @@ PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping(Py_UNICODE *buffer,
Py_ssize_t min_width,
const char *grouping,
const char *thousands_sep);
+#endif
/* === Characters Type APIs =============================================== */
/* Helper array used by Py_UNICODE_ISSPACE(). */
+#ifndef Py_LIMITED_API
PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
/* These should not be used directly. Use the Py_UNICODE_IS* and
@@ -1519,91 +1553,122 @@ PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
*/
PyAPI_FUNC(int) _PyUnicode_IsLowercase(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsUppercase(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsTitlecase(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsXidStart(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsXidContinue(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsWhitespace(
- const Py_UNICODE ch /* Unicode character */
+ const Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsLinebreak(
- const Py_UNICODE ch /* Unicode character */
+ const Py_UCS4 ch /* Unicode character */
);
-PyAPI_FUNC(Py_UNICODE) _PyUnicode_ToLowercase(
- Py_UNICODE ch /* Unicode character */
+PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase(
+ Py_UCS4 ch /* Unicode character */
);
-PyAPI_FUNC(Py_UNICODE) _PyUnicode_ToUppercase(
- Py_UNICODE ch /* Unicode character */
+PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase(
+ Py_UCS4 ch /* Unicode character */
);
-PyAPI_FUNC(Py_UNICODE) _PyUnicode_ToTitlecase(
- Py_UNICODE ch /* Unicode character */
+PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase(
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_ToDigit(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(double) _PyUnicode_ToNumeric(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsDigit(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsNumeric(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsPrintable(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsAlpha(
- Py_UNICODE ch /* Unicode character */
+ Py_UCS4 ch /* Unicode character */
);
-PyAPI_FUNC(size_t) Py_UNICODE_strlen(const Py_UNICODE *u);
+PyAPI_FUNC(size_t) Py_UNICODE_strlen(
+ const Py_UNICODE *u
+ );
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy(
+ Py_UNICODE *s1,
+ const Py_UNICODE *s2);
+
+PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcat(
Py_UNICODE *s1, const Py_UNICODE *s2);
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strncpy(
- Py_UNICODE *s1, const Py_UNICODE *s2, size_t n);
+ Py_UNICODE *s1,
+ const Py_UNICODE *s2,
+ size_t n);
PyAPI_FUNC(int) Py_UNICODE_strcmp(
- const Py_UNICODE *s1, const Py_UNICODE *s2);
+ const Py_UNICODE *s1,
+ const Py_UNICODE *s2
+ );
+
+PyAPI_FUNC(int) Py_UNICODE_strncmp(
+ const Py_UNICODE *s1,
+ const Py_UNICODE *s2,
+ size_t n
+ );
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strchr(
- const Py_UNICODE *s, Py_UNICODE c
+ const Py_UNICODE *s,
+ Py_UNICODE c
+ );
+
+PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strrchr(
+ const Py_UNICODE *s,
+ Py_UNICODE c
+ );
+
+/* Create a copy of a unicode string ending with a nul character. Return NULL
+ and raise a MemoryError exception on memory allocation failure, otherwise
+ return a new allocated buffer (use PyMem_Free() to free the buffer). */
+
+PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy(
+ PyObject *unicode
);
+#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
diff --git a/Include/warnings.h b/Include/warnings.h
index f54eabd245..b7db681cc4 100644
--- a/Include/warnings.h
+++ b/Include/warnings.h
@@ -4,14 +4,31 @@
extern "C" {
#endif
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) _PyWarnings_Init(void);
+#endif
-PyAPI_FUNC(int) PyErr_WarnEx(PyObject *, const char *, Py_ssize_t);
-PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, const char *, int,
- const char *, PyObject *);
+PyAPI_FUNC(int) PyErr_WarnEx(
+ PyObject *category,
+ const char *message, /* UTF-8 encoded string */
+ Py_ssize_t stack_level);
+PyAPI_FUNC(int) PyErr_WarnFormat(
+ PyObject *category,
+ Py_ssize_t stack_level,
+ const char *format, /* ASCII-encoded string */
+ ...);
+PyAPI_FUNC(int) PyErr_WarnExplicit(
+ PyObject *category,
+ const char *message, /* UTF-8 encoded string */
+ const char *filename, /* decoded from the filesystem encoding */
+ int lineno,
+ const char *module, /* UTF-8 encoded string */
+ PyObject *registry);
/* DEPRECATED: Use PyErr_WarnEx() instead. */
+#ifndef Py_LIMITED_API
#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
+#endif
#ifdef __cplusplus
}
diff --git a/Include/weakrefobject.h b/Include/weakrefobject.h
index f15c9d9c12..725838726d 100644
--- a/Include/weakrefobject.h
+++ b/Include/weakrefobject.h
@@ -12,6 +12,7 @@ typedef struct _PyWeakReference PyWeakReference;
/* PyWeakReference is the base struct for the Python ReferenceType, ProxyType,
* and CallableProxyType.
*/
+#ifndef Py_LIMITED_API
struct _PyWeakReference {
PyObject_HEAD
@@ -27,7 +28,7 @@ struct _PyWeakReference {
/* A cache for wr_object's hash code. As usual for hashes, this is -1
* if the hash code isn't known yet.
*/
- long hash;
+ Py_hash_t hash;
/* If wr_object is weakly referenced, wr_object has a doubly-linked NULL-
* terminated list of weak references to it. These are the list pointers.
@@ -37,6 +38,7 @@ struct _PyWeakReference {
PyWeakReference *wr_prev;
PyWeakReference *wr_next;
};
+#endif
PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
@@ -62,9 +64,11 @@ PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
PyObject *callback);
PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
+#endif
#define PyWeakref_GET_OBJECT(ref) (((PyWeakReference *)(ref))->wr_object)
diff --git a/LICENSE b/LICENSE
index 88e089ae0c..341de15829 100644
--- a/LICENSE
+++ b/LICENSE
@@ -62,11 +62,13 @@ the various releases.
2.6.2 2.6.1 2009 PSF yes
2.6.3 2.6.2 2009 PSF yes
2.6.4 2.6.3 2009 PSF yes
+ 2.6.5 2.6.4 2010 PSF yes
3.0 2.6 2008 PSF yes
3.0.1 3.0 2009 PSF yes
3.1 3.0.1 2009 PSF yes
3.1.1 3.1 2009 PSF yes
3.1.2 3.1 2010 PSF yes
+ 3.2 3.1 2011 PSF yes
Footnotes:
@@ -101,9 +103,9 @@ grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
-i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-Python Software Foundation; All Rights Reserved" are retained in Python alone or
-in any derivative version prepared by Licensee.
+i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+2011 Python Software Foundation; All Rights Reserved" are retained in Python
+alone or in any derivative version prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
diff --git a/Lib/_dummy_thread.py b/Lib/_dummy_thread.py
index 7aa6579efe..ed50520ab3 100644
--- a/Lib/_dummy_thread.py
+++ b/Lib/_dummy_thread.py
@@ -16,7 +16,13 @@ Suggested usage is::
__all__ = ['error', 'start_new_thread', 'exit', 'get_ident', 'allocate_lock',
'interrupt_main', 'LockType']
-import traceback as _traceback
+# A dummy value
+TIMEOUT_MAX = 2**31
+
+# NOTE: this module can be imported early in the extension building process,
+# and so top level imports of other modules should be avoided. Instead, all
+# imports are done when needed on a function-by-function basis. Since threads
+# are disabled, the import lock should not be an issue anyway (??).
class error(Exception):
"""Dummy implementation of _thread.error."""
@@ -48,7 +54,8 @@ def start_new_thread(function, args, kwargs={}):
except SystemExit:
pass
except:
- _traceback.print_exc()
+ import traceback
+ traceback.print_exc()
_main = True
global _interrupt
if _interrupt:
@@ -92,7 +99,7 @@ class LockType(object):
def __init__(self):
self.locked_status = False
- def acquire(self, waitflag=None):
+ def acquire(self, waitflag=None, timeout=-1):
"""Dummy implementation of acquire().
For blocking calls, self.locked_status is automatically set to
@@ -111,6 +118,9 @@ class LockType(object):
self.locked_status = True
return True
else:
+ if timeout > 0:
+ import time
+ time.sleep(timeout)
return False
__enter__ = acquire
diff --git a/Lib/_markupbase.py b/Lib/_markupbase.py
index adf6ba2f53..98b9037aff 100644
--- a/Lib/_markupbase.py
+++ b/Lib/_markupbase.py
@@ -122,7 +122,7 @@ class ParserBase:
# this could be handled in a separate doctype parser
if decltype == "doctype":
j = self._parse_doctype_subset(j + 1, i)
- elif decltype in ("attlist", "linktype", "link", "element"):
+ elif decltype in {"attlist", "linktype", "link", "element"}:
# must tolerate []'d groups in a content model in an element declaration
# also in data attribute specifications of attlist declaration
# also link type declaration subsets in linktype declarations
@@ -145,10 +145,10 @@ class ParserBase:
sectName, j = self._scan_name( i+3, i )
if j < 0:
return j
- if sectName in ("temp", "cdata", "ignore", "include", "rcdata"):
+ if sectName in {"temp", "cdata", "ignore", "include", "rcdata"}:
# look for standard ]]> ending
match= _markedsectionclose.search(rawdata, i+3)
- elif sectName in ("if", "else", "endif"):
+ elif sectName in {"if", "else", "endif"}:
# look for MS Office ]> ending
match= _msmarkedsectionclose.search(rawdata, i+3)
else:
@@ -203,7 +203,7 @@ class ParserBase:
name, j = self._scan_name(j + 2, declstartpos)
if j == -1:
return -1
- if name not in ("attlist", "element", "entity", "notation"):
+ if name not in {"attlist", "element", "entity", "notation"}:
self.updatepos(declstartpos, j + 2)
self.error(
"unknown declaration %r in internal subset" % name)
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index fa00eb4fb3..35dea411e7 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -13,8 +13,8 @@ except ImportError:
from _dummy_thread import allocate_lock as Lock
import io
-from io import __all__
-from io import SEEK_SET, SEEK_CUR, SEEK_END
+from io import (__all__, SEEK_SET, SEEK_CUR, SEEK_END)
+from errno import EINTR
# open() uses st_blksize whenever we can
DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes
@@ -35,9 +35,8 @@ class BlockingIOError(IOError):
self.characters_written = characters_written
-def open(file, mode = "r", buffering = None,
- encoding = None, errors = None,
- newline = None, closefd = True) -> "IOBase":
+def open(file, mode="r", buffering=-1, encoding=None, errors=None,
+ newline=None, closefd=True):
r"""Open file and return a stream. Raise IOError upon failure.
@@ -97,7 +96,7 @@ def open(file, mode = "r", buffering = None,
use line buffering. Other text files use the policy described above
for binary files.
- encoding is the name of the encoding used to decode or encode the
+ encoding is the str name of the encoding used to decode or encode the
file. This should only be used in text mode. The default encoding is
platform dependent, but any encoding supported by Python can be
passed. See the codecs module for the list of supported encodings.
@@ -110,9 +109,9 @@ def open(file, mode = "r", buffering = None,
See the documentation for codecs.register for a list of the permitted
encoding error strings.
- newline controls how universal newlines works (it only applies to text
- mode). It can be None, '', '\n', '\r', and '\r\n'. It works as
- follows:
+ newline is a string controlling how universal newlines works (it only
+ applies to text mode). It can be None, '', '\n', '\r', and '\r\n'. It works
+ as follows:
* On input, if newline is None, universal newlines mode is
enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
@@ -128,9 +127,9 @@ def open(file, mode = "r", buffering = None,
other legal values, any '\n' characters written are translated to
the given string.
- If closefd is False, the underlying file descriptor will be kept open
- when the file is closed. This does not work when a file name is given
- and must be True in that case.
+ closedfd is a bool. If closefd is False, the underlying file descriptor will
+ be kept open when the file is closed. This does not work when a file name is
+ given and must be True in that case.
open() returns a file object whose type depends on the mode, and
through which the standard file operations such as reading and writing
@@ -150,7 +149,7 @@ def open(file, mode = "r", buffering = None,
raise TypeError("invalid file: %r" % file)
if not isinstance(mode, str):
raise TypeError("invalid mode: %r" % mode)
- if buffering is not None and not isinstance(buffering, int):
+ if not isinstance(buffering, int):
raise TypeError("invalid buffering: %r" % buffering)
if encoding is not None and not isinstance(encoding, str):
raise TypeError("invalid encoding: %r" % encoding)
@@ -187,8 +186,6 @@ def open(file, mode = "r", buffering = None,
(appending and "a" or "") +
(updating and "+" or ""),
closefd)
- if buffering is None:
- buffering = -1
line_buffering = False
if buffering == 1 or buffering < 0 and raw.isatty():
buffering = -1
@@ -228,7 +225,7 @@ class DocDescriptor:
"""
def __get__(self, obj, typ):
return (
- "open(file, mode='r', buffering=None, encoding=None, "
+ "open(file, mode='r', buffering=-1, encoding=None, "
"errors=None, newline=None, closefd=True)\n\n" +
open.__doc__)
@@ -246,8 +243,13 @@ class OpenWrapper:
return open(*args, **kwargs)
-class UnsupportedOperation(ValueError, IOError):
- pass
+# In normal operation, both `UnsupportedOperation`s should be bound to the
+# same object.
+try:
+ UnsupportedOperation = io.UnsupportedOperation
+except AttributeError:
+ class UnsupportedOperation(ValueError, IOError):
+ pass
class IOBase(metaclass=abc.ABCMeta):
@@ -262,7 +264,8 @@ class IOBase(metaclass=abc.ABCMeta):
Even though IOBase does not declare read, readinto, or write because
their signatures will vary, implementations and clients should
consider those methods part of the interface. Also, implementations
- may raise a IOError when operations they do not support are called.
+ may raise UnsupportedOperation when operations they do not support are
+ called.
The basic type used for binary data read from or written to a file is
bytes. bytearrays are accepted too, and in some cases (such as
@@ -285,32 +288,32 @@ class IOBase(metaclass=abc.ABCMeta):
### Internal ###
def _unsupported(self, name):
- """Internal: raise an exception for unsupported operations."""
+ """Internal: raise an IOError exception for unsupported operations."""
raise UnsupportedOperation("%s.%s() not supported" %
(self.__class__.__name__, name))
### Positioning ###
- def seek(self, pos, whence = 0):
+ def seek(self, pos, whence=0):
"""Change stream position.
Change the stream position to byte offset offset. offset is
interpreted relative to the position indicated by whence. Values
- for whence are:
+ for whence are ints:
* 0 -- start of stream (the default); offset should be zero or positive
* 1 -- current stream position; offset may be negative
* 2 -- end of stream; offset is usually negative
- Return the new absolute position.
+ Return an int indicating the new absolute position.
"""
self._unsupported("seek")
def tell(self):
- """Return current stream position."""
+ """Return an int indicating the current stream position."""
return self.seek(0, 1)
- def truncate(self, pos = None):
+ def truncate(self, pos=None):
"""Truncate file to size bytes.
Size defaults to the current IO position as reported by tell(). Return
@@ -354,49 +357,47 @@ class IOBase(metaclass=abc.ABCMeta):
### Inquiries ###
def seekable(self):
- """Return whether object supports random access.
+ """Return a bool indicating whether object supports random access.
- If False, seek(), tell() and truncate() will raise IOError.
+ If False, seek(), tell() and truncate() will raise UnsupportedOperation.
This method may need to do a test seek().
"""
return False
def _checkSeekable(self, msg=None):
- """Internal: raise an IOError if file is not seekable
+ """Internal: raise UnsupportedOperation if file is not seekable
"""
if not self.seekable():
- raise IOError("File or stream is not seekable."
- if msg is None else msg)
-
+ raise UnsupportedOperation("File or stream is not seekable."
+ if msg is None else msg)
def readable(self):
+ """Return a bool indicating whether object was opened for reading.
- """Return whether object was opened for reading.
-
- If False, read() will raise IOError.
+ If False, read() will raise UnsupportedOperation.
"""
return False
def _checkReadable(self, msg=None):
- """Internal: raise an IOError if file is not readable
+ """Internal: raise UnsupportedOperation if file is not readable
"""
if not self.readable():
- raise IOError("File or stream is not readable."
- if msg is None else msg)
+ raise UnsupportedOperation("File or stream is not readable."
+ if msg is None else msg)
def writable(self):
- """Return whether object was opened for writing.
+ """Return a bool indicating whether object was opened for writing.
- If False, write() and truncate() will raise IOError.
+ If False, write() and truncate() will raise UnsupportedOperation.
"""
return False
def _checkWritable(self, msg=None):
- """Internal: raise an IOError if file is not writable
+ """Internal: raise UnsupportedOperation if file is not writable
"""
if not self.writable():
- raise IOError("File or stream is not writable."
- if msg is None else msg)
+ raise UnsupportedOperation("File or stream is not writable."
+ if msg is None else msg)
@property
def closed(self):
@@ -416,7 +417,7 @@ class IOBase(metaclass=abc.ABCMeta):
### Context manager ###
def __enter__(self): # That's a forward reference
- """Context management protocol. Returns self."""
+ """Context management protocol. Returns self (an instance of IOBase)."""
self._checkClosed()
return self
@@ -429,14 +430,14 @@ class IOBase(metaclass=abc.ABCMeta):
# XXX Should these be present even if unimplemented?
def fileno(self):
- """Returns underlying file descriptor if one exists.
+ """Returns underlying file descriptor (an int) if one exists.
An IOError is raised if the IO object does not use a file descriptor.
"""
self._unsupported("fileno")
def isatty(self):
- """Return whether this is an 'interactive' stream.
+ """Return a bool indicating whether this is an 'interactive' stream.
Return False if it can't be determined.
"""
@@ -445,10 +446,11 @@ class IOBase(metaclass=abc.ABCMeta):
### Readline[s] and writelines ###
- def readline(self, limit = -1):
- r"""Read and return a line from the stream.
+ def readline(self, limit=-1):
+ r"""Read and return a line of bytes from the stream.
If limit is specified, at most limit bytes will be read.
+ Limit should be an int.
The line terminator is always b'\n' for binary files; for text
files, the newlines argument to open can be used to select the line
@@ -531,8 +533,8 @@ class RawIOBase(IOBase):
# primitive operation, but that would lead to nasty recursion in case
# a subclass doesn't implement either.)
- def read(self, n = -1):
- """Read and return up to n bytes.
+ def read(self, n=-1):
+ """Read and return up to n bytes, where n is an int.
Returns an empty bytes object on EOF, or None if the object is
set not to block and has no data to read.
@@ -559,10 +561,10 @@ class RawIOBase(IOBase):
return bytes(res)
def readinto(self, b):
- """Read up to len(b) bytes into b.
+ """Read up to len(b) bytes into bytearray b.
- Returns number of bytes read (0 for EOF), or None if the object
- is set not to block and has no data to read.
+ Returns an int representing the number of bytes read (0 for EOF), or
+ None if the object is set not to block and has no data to read.
"""
self._unsupported("readinto")
@@ -595,8 +597,8 @@ class BufferedIOBase(IOBase):
implementation, but wrap one.
"""
- def read(self, n = None):
- """Read and return up to n bytes.
+ def read(self, n=None):
+ """Read and return up to n bytes, where n is an int.
If the argument is omitted, None, or negative, reads and
returns all data until EOF.
@@ -615,17 +617,19 @@ class BufferedIOBase(IOBase):
"""
self._unsupported("read")
- def read1(self, n = None):
- """Read up to n bytes with at most one read() system call."""
+ def read1(self, n=None):
+ """Read up to n bytes with at most one read() system call,
+ where n is an int.
+ """
self._unsupported("read1")
def readinto(self, b):
- """Read up to len(b) bytes into b.
+ """Read up to len(b) bytes into bytearray b.
Like read(), this may issue multiple reads to the underlying raw
stream, unless the latter is 'interactive'.
- Returns the number of bytes read (0 for EOF).
+ Returns an int representing the number of bytes read (0 for EOF).
Raises BlockingIOError if the underlying raw stream has no
data at the moment.
@@ -643,7 +647,7 @@ class BufferedIOBase(IOBase):
return n
def write(self, b):
- """Write the given buffer to the IO stream.
+ """Write the given bytes buffer to the IO stream.
Return the number of bytes written, which is never less than
len(b).
@@ -750,6 +754,10 @@ class _BufferedIOMixin(BufferedIOBase):
def mode(self):
return self.raw.mode
+ def __getstate__(self):
+ raise TypeError("can not serialize a '{0}' object"
+ .format(self.__class__.__name__))
+
def __repr__(self):
clsname = self.__class__.__name__
try:
@@ -779,6 +787,11 @@ class BytesIO(BufferedIOBase):
self._buffer = buf
self._pos = 0
+ def __getstate__(self):
+ if self.closed:
+ raise ValueError("__getstate__ on closed file")
+ return self.__dict__.copy()
+
def getvalue(self):
"""Return the bytes value (contents) of the buffer
"""
@@ -786,6 +799,11 @@ class BytesIO(BufferedIOBase):
raise ValueError("getvalue on closed file")
return bytes(self._buffer)
+ def getbuffer(self):
+ """Return a readable and writable view of the buffer.
+ """
+ return memoryview(self._buffer)
+
def read(self, n=None):
if self.closed:
raise ValueError("read from closed file")
@@ -827,7 +845,7 @@ class BytesIO(BufferedIOBase):
if self.closed:
raise ValueError("seek on closed file")
try:
- pos = pos.__index__()
+ pos.__index__
except AttributeError as err:
raise TypeError("an integer is required") from err
if whence == 0:
@@ -852,8 +870,13 @@ class BytesIO(BufferedIOBase):
raise ValueError("truncate on closed file")
if pos is None:
pos = self._pos
- elif pos < 0:
- raise ValueError("negative truncate position %r" % (pos,))
+ else:
+ try:
+ pos.__index__
+ except AttributeError as err:
+ raise TypeError("an integer is required") from err
+ if pos < 0:
+ raise ValueError("negative truncate position %r" % (pos,))
del self._buffer[pos:]
return pos
@@ -921,7 +944,12 @@ class BufferedReader(_BufferedIOMixin):
current_size = 0
while True:
# Read until EOF or until read() would block.
- chunk = self.raw.read()
+ try:
+ chunk = self.raw.read()
+ except IOError as e:
+ if e.errno != EINTR:
+ raise
+ continue
if chunk in empty_values:
nodata_val = chunk
break
@@ -940,7 +968,12 @@ class BufferedReader(_BufferedIOMixin):
chunks = [buf[pos:]]
wanted = max(self.buffer_size, n)
while avail < n:
- chunk = self.raw.read(wanted)
+ try:
+ chunk = self.raw.read(wanted)
+ except IOError as e:
+ if e.errno != EINTR:
+ raise
+ continue
if chunk in empty_values:
nodata_val = chunk
break
@@ -969,7 +1002,14 @@ class BufferedReader(_BufferedIOMixin):
have = len(self._read_buf) - self._read_pos
if have < want or have <= 0:
to_read = self.buffer_size - have
- current = self.raw.read(to_read)
+ while True:
+ try:
+ current = self.raw.read(to_read)
+ except IOError as e:
+ if e.errno != EINTR:
+ raise
+ continue
+ break
if current:
self._read_buf = self._read_buf[self._read_pos:] + current
self._read_pos = 0
@@ -1076,7 +1116,12 @@ class BufferedWriter(_BufferedIOMixin):
written = 0
try:
while self._write_buf:
- n = self.raw.write(self._write_buf)
+ try:
+ n = self.raw.write(self._write_buf)
+ except IOError as e:
+ if e.errno != EINTR:
+ raise
+ continue
if n > len(self._write_buf) or n < 0:
raise IOError("write() returned incorrect number of bytes")
del self._write_buf[:n]
@@ -1252,20 +1297,22 @@ class TextIOBase(IOBase):
are immutable. There is no public constructor.
"""
- def read(self, n = -1):
- """Read at most n characters from stream.
+ def read(self, n=-1):
+ """Read at most n characters from stream, where n is an int.
Read from underlying buffer until we have n characters or we hit EOF.
If n is negative or omitted, read until EOF.
+
+ Returns a string.
"""
self._unsupported("read")
def write(self, s):
- """Write string s to stream."""
+ """Write string s to stream and returning an int."""
self._unsupported("write")
- def truncate(self, pos = None):
- """Truncate size to pos."""
+ def truncate(self, pos=None):
+ """Truncate size to pos, where pos is an int."""
self._unsupported("truncate")
def readline(self):
@@ -1484,13 +1531,20 @@ class TextIOWrapper(TextIOBase):
# - "chars_..." for integer variables that count decoded characters
def __repr__(self):
+ result = "<_pyio.TextIOWrapper"
try:
name = self.name
except AttributeError:
- return "<_pyio.TextIOWrapper encoding={0!r}>".format(self.encoding)
+ pass
else:
- return "<_pyio.TextIOWrapper name={0!r} encoding={1!r}>".format(
- name, self.encoding)
+ result += " name={0!r}".format(name)
+ try:
+ mode = self.mode
+ except AttributeError:
+ pass
+ else:
+ result += " mode={0!r}".format(mode)
+ return result + " encoding={0!r}>".format(self.encoding)
@property
def encoding(self):
@@ -1540,7 +1594,8 @@ class TextIOWrapper(TextIOBase):
def isatty(self):
return self.buffer.isatty()
- def write(self, s: str):
+ def write(self, s):
+ 'Write data, where s is a str'
if self.closed:
raise ValueError("write to closed file")
if not isinstance(s, str):
@@ -1651,7 +1706,7 @@ class TextIOWrapper(TextIOBase):
def tell(self):
if not self._seekable:
- raise IOError("underlying stream is not seekable")
+ raise UnsupportedOperation("underlying stream is not seekable")
if not self._telling:
raise IOError("telling position disabled by next() call")
self.flush()
@@ -1730,17 +1785,17 @@ class TextIOWrapper(TextIOBase):
if self.closed:
raise ValueError("tell on closed file")
if not self._seekable:
- raise IOError("underlying stream is not seekable")
+ raise UnsupportedOperation("underlying stream is not seekable")
if whence == 1: # seek relative to current position
if cookie != 0:
- raise IOError("can't do nonzero cur-relative seeks")
+ raise UnsupportedOperation("can't do nonzero cur-relative seeks")
# Seeking to the current position should attempt to
# sync the underlying buffer with the current position.
whence = 0
cookie = self.tell()
if whence == 2: # seek relative to end of file
if cookie != 0:
- raise IOError("can't do nonzero end-relative seeks")
+ raise UnsupportedOperation("can't do nonzero end-relative seeks")
self.flush()
position = self.buffer.seek(0, 2)
self._set_decoded_chars('')
@@ -1803,6 +1858,10 @@ class TextIOWrapper(TextIOBase):
if n is None:
n = -1
decoder = self._decoder or self._get_decoder()
+ try:
+ n.__index__
+ except AttributeError as err:
+ raise TypeError("an integer is required") from err
if n < 0:
# Read everything.
result = (self._get_decoded_chars() +
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index ee30b4216c..0ea4c43111 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -16,7 +16,9 @@ import calendar
from re import compile as re_compile
from re import IGNORECASE, ASCII
from re import escape as re_escape
-from datetime import date as datetime_date
+from datetime import (date as datetime_date,
+ timedelta as datetime_timedelta,
+ timezone as datetime_timezone)
try:
from _thread import allocate_lock as _thread_allocate_lock
except:
@@ -204,6 +206,7 @@ class TimeRE(dict):
#XXX: Does 'Y' need to worry about having less or more than
# 4 digits?
'Y': r"(?P<Y>\d\d\d\d)",
+ 'z': r"(?P<z>[+-]\d\d[0-5]\d)",
'A': self.__seqToRE(self.locale_time.f_weekday, 'A'),
'a': self.__seqToRE(self.locale_time.a_weekday, 'a'),
'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'),
@@ -293,7 +296,9 @@ def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon):
def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
- """Return a time struct based on the input string and the format string."""
+ """Return a 2-tuple consisting of a time struct and an int containing
+ the number of microseconds based on the input string and the
+ format string."""
for index, arg in enumerate([data_string, format]):
if not isinstance(arg, str):
@@ -333,10 +338,12 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
if len(data_string) != found.end():
raise ValueError("unconverted data remains: %s" %
data_string[found.end():])
+
year = 1900
month = day = 1
hour = minute = second = fraction = 0
tz = -1
+ tzoffset = None
# Default to -1 to signify that values not known; not critical to have,
# though
week_of_year = -1
@@ -417,6 +424,11 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
else:
# W starts week on Monday.
week_of_year_start = 0
+ elif group_key == 'z':
+ z = found_dict['z']
+ tzoffset = int(z[1:3]) * 60 + int(z[3:5])
+ if z.startswith("-"):
+ tzoffset = -tzoffset
elif group_key == 'Z':
# Since -1 is default value only need to worry about setting tz if
# it can be something other than -1.
@@ -453,9 +465,35 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
day = datetime_result.day
if weekday == -1:
weekday = datetime_date(year, month, day).weekday()
- return (time.struct_time((year, month, day,
- hour, minute, second,
- weekday, julian, tz)), fraction)
+ # Add timezone info
+ tzname = found_dict.get("Z")
+ if tzoffset is not None:
+ gmtoff = tzoffset * 60
+ else:
+ gmtoff = None
+
+ return (year, month, day,
+ hour, minute, second,
+ weekday, julian, tz, gmtoff, tzname), fraction
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
- return _strptime(data_string, format)[0]
+ """Return a time struct based on the input string and the
+ format string."""
+ tt = _strptime(data_string, format)[0]
+ return time.struct_time(tt[:9])
+
+def _strptime_datetime(cls, data_string, format="%a %b %d %H:%M:%S %Y"):
+ """Return a class cls instance based on the input string and the
+ format string."""
+ tt, fraction = _strptime(data_string, format)
+ gmtoff, tzname = tt[-2:]
+ args = tt[:6] + (fraction,)
+ if gmtoff is not None:
+ tzdelta = datetime_timedelta(seconds=gmtoff)
+ if tzname:
+ tz = datetime_timezone(tzdelta, tzname)
+ else:
+ tz = datetime_timezone(tzdelta)
+ args += (tz,)
+
+ return cls(*args)
diff --git a/Lib/_threading_local.py b/Lib/_threading_local.py
index afdd6eabca..4ec4828144 100644
--- a/Lib/_threading_local.py
+++ b/Lib/_threading_local.py
@@ -132,6 +132,9 @@ affects what we see:
>>> del mydata
"""
+from weakref import ref
+from contextlib import contextmanager
+
__all__ = ["local"]
# We need to use objects from the threading module, but the threading
@@ -139,112 +142,105 @@ __all__ = ["local"]
# isn't compiled in to the `thread` module. This creates potential problems
# with circular imports. For that reason, we don't import `threading`
# until the bottom of this file (a hack sufficient to worm around the
-# potential problems). Note that almost all platforms do have support for
-# locals in the `thread` module, and there is no circular import problem
+# potential problems). Note that all platforms on CPython do have support
+# for locals in the `thread` module, and there is no circular import problem
# then, so problems introduced by fiddling the order of imports here won't
-# manifest on most boxes.
+# manifest.
+
+class _localimpl:
+ """A class managing thread-local dicts"""
+ __slots__ = 'key', 'dicts', 'localargs', 'locallock', '__weakref__'
+
+ def __init__(self):
+ # The key used in the Thread objects' attribute dicts.
+ # We keep it a string for speed but make it unlikely to clash with
+ # a "real" attribute.
+ self.key = '_threading_local._localimpl.' + str(id(self))
+ # { id(Thread) -> (ref(Thread), thread-local dict) }
+ self.dicts = {}
+
+ def get_dict(self):
+ """Return the dict for the current thread. Raises KeyError if none
+ defined."""
+ thread = current_thread()
+ return self.dicts[id(thread)][1]
+
+ def create_dict(self):
+ """Create a new dict for the current thread, and return it."""
+ localdict = {}
+ key = self.key
+ thread = current_thread()
+ idt = id(thread)
+ def local_deleted(_, key=key):
+ # When the localimpl is deleted, remove the thread attribute.
+ thread = wrthread()
+ if thread is not None:
+ del thread.__dict__[key]
+ def thread_deleted(_, idt=idt):
+ # When the thread is deleted, remove the local dict.
+ # Note that this is suboptimal if the thread object gets
+ # caught in a reference loop. We would like to be called
+ # as soon as the OS-level thread ends instead.
+ local = wrlocal()
+ if local is not None:
+ dct = local.dicts.pop(idt)
+ wrlocal = ref(self, local_deleted)
+ wrthread = ref(thread, thread_deleted)
+ thread.__dict__[key] = wrlocal
+ self.dicts[idt] = wrthread, localdict
+ return localdict
+
+
+@contextmanager
+def _patch(self):
+ impl = object.__getattribute__(self, '_local__impl')
+ try:
+ dct = impl.get_dict()
+ except KeyError:
+ dct = impl.create_dict()
+ args, kw = impl.localargs
+ self.__init__(*args, **kw)
+ with impl.locallock:
+ object.__setattr__(self, '__dict__', dct)
+ yield
-class _localbase(object):
- __slots__ = '_local__key', '_local__args', '_local__lock'
- def __new__(cls, *args, **kw):
- self = object.__new__(cls)
- key = '_local__key', 'thread.local.' + str(id(self))
- object.__setattr__(self, '_local__key', key)
- object.__setattr__(self, '_local__args', (args, kw))
- object.__setattr__(self, '_local__lock', RLock())
+class local:
+ __slots__ = '_local__impl', '__dict__'
- if args or kw and (cls.__init__ is object.__init__):
+ def __new__(cls, *args, **kw):
+ if (args or kw) and (cls.__init__ is object.__init__):
raise TypeError("Initialization arguments are not supported")
-
+ self = object.__new__(cls)
+ impl = _localimpl()
+ impl.localargs = (args, kw)
+ impl.locallock = RLock()
+ object.__setattr__(self, '_local__impl', impl)
# We need to create the thread dict in anticipation of
# __init__ being called, to make sure we don't call it
# again ourselves.
- dict = object.__getattribute__(self, '__dict__')
- current_thread().__dict__[key] = dict
-
+ impl.create_dict()
return self
-def _patch(self):
- key = object.__getattribute__(self, '_local__key')
- d = current_thread().__dict__.get(key)
- if d is None:
- d = {}
- current_thread().__dict__[key] = d
- object.__setattr__(self, '__dict__', d)
-
- # we have a new instance dict, so call out __init__ if we have
- # one
- cls = type(self)
- if cls.__init__ is not object.__init__:
- args, kw = object.__getattribute__(self, '_local__args')
- cls.__init__(self, *args, **kw)
- else:
- object.__setattr__(self, '__dict__', d)
-
-class local(_localbase):
-
def __getattribute__(self, name):
- lock = object.__getattribute__(self, '_local__lock')
- lock.acquire()
- try:
- _patch(self)
+ with _patch(self):
return object.__getattribute__(self, name)
- finally:
- lock.release()
def __setattr__(self, name, value):
if name == '__dict__':
raise AttributeError(
"%r object attribute '__dict__' is read-only"
% self.__class__.__name__)
- lock = object.__getattribute__(self, '_local__lock')
- lock.acquire()
- try:
- _patch(self)
+ with _patch(self):
return object.__setattr__(self, name, value)
- finally:
- lock.release()
def __delattr__(self, name):
if name == '__dict__':
raise AttributeError(
"%r object attribute '__dict__' is read-only"
% self.__class__.__name__)
- lock = object.__getattribute__(self, '_local__lock')
- lock.acquire()
- try:
- _patch(self)
+ with _patch(self):
return object.__delattr__(self, name)
- finally:
- lock.release()
-
- def __del__(self):
- import threading
-
- key = object.__getattribute__(self, '_local__key')
-
- try:
- # We use the non-locking API since we might already hold the lock
- # (__del__ can be called at any point by the cyclic GC).
- threads = threading._enumerate()
- except:
- # If enumerating the current threads fails, as it seems to do
- # during shutdown, we'll skip cleanup under the assumption
- # that there is nothing to clean up.
- return
-
- for thread in threads:
- try:
- __dict__ = thread.__dict__
- except AttributeError:
- # Thread is dying, rest in peace.
- continue
-
- if key in __dict__:
- try:
- del __dict__[key]
- except KeyError:
- pass # didn't have anything in this thread
+
from threading import current_thread, RLock
diff --git a/Lib/abc.py b/Lib/abc.py
index 0f98036304..a6c2dc4877 100644
--- a/Lib/abc.py
+++ b/Lib/abc.py
@@ -25,6 +25,46 @@ def abstractmethod(funcobj):
return funcobj
+class abstractclassmethod(classmethod):
+ """A decorator indicating abstract classmethods.
+
+ Similar to abstractmethod.
+
+ Usage:
+
+ class C(metaclass=ABCMeta):
+ @abstractclassmethod
+ def my_abstract_classmethod(cls, ...):
+ ...
+ """
+
+ __isabstractmethod__ = True
+
+ def __init__(self, callable):
+ callable.__isabstractmethod__ = True
+ super().__init__(callable)
+
+
+class abstractstaticmethod(staticmethod):
+ """A decorator indicating abstract staticmethods.
+
+ Similar to abstractmethod.
+
+ Usage:
+
+ class C(metaclass=ABCMeta):
+ @abstractstaticmethod
+ def my_abstract_staticmethod(...):
+ ...
+ """
+
+ __isabstractmethod__ = True
+
+ def __init__(self, callable):
+ callable.__isabstractmethod__ = True
+ super().__init__(callable)
+
+
class abstractproperty(property):
"""A decorator indicating abstract properties.
diff --git a/Lib/argparse.py b/Lib/argparse.py
new file mode 100644
index 0000000000..63561f7cb1
--- /dev/null
+++ b/Lib/argparse.py
@@ -0,0 +1,2366 @@
+# Author: Steven J. Bethard <steven.bethard@gmail.com>.
+
+"""Command-line parsing library
+
+This module is an optparse-inspired command-line parsing library that:
+
+ - handles both optional and positional arguments
+ - produces highly informative usage messages
+ - supports parsers that dispatch to sub-parsers
+
+The following is a simple usage example that sums integers from the
+command-line and writes the result to a file::
+
+ parser = argparse.ArgumentParser(
+ description='sum the integers at the command line')
+ parser.add_argument(
+ 'integers', metavar='int', nargs='+', type=int,
+ help='an integer to be summed')
+ parser.add_argument(
+ '--log', default=sys.stdout, type=argparse.FileType('w'),
+ help='the file where the sum should be written')
+ args = parser.parse_args()
+ args.log.write('%s' % sum(args.integers))
+ args.log.close()
+
+The module contains the following public classes:
+
+ - ArgumentParser -- The main entry point for command-line parsing. As the
+ example above shows, the add_argument() method is used to populate
+ the parser with actions for optional and positional arguments. Then
+ the parse_args() method is invoked to convert the args at the
+ command-line into an object with attributes.
+
+ - ArgumentError -- The exception raised by ArgumentParser objects when
+ there are errors with the parser's actions. Errors raised while
+ parsing the command-line are caught by ArgumentParser and emitted
+ as command-line messages.
+
+ - FileType -- A factory for defining types of files to be created. As the
+ example above shows, instances of FileType are typically passed as
+ the type= argument of add_argument() calls.
+
+ - Action -- The base class for parser actions. Typically actions are
+ selected by passing strings like 'store_true' or 'append_const' to
+ the action= argument of add_argument(). However, for greater
+ customization of ArgumentParser actions, subclasses of Action may
+ be defined and passed as the action= argument.
+
+ - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
+ ArgumentDefaultsHelpFormatter -- Formatter classes which
+ may be passed as the formatter_class= argument to the
+ ArgumentParser constructor. HelpFormatter is the default,
+ RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
+ not to change the formatting for help text, and
+ ArgumentDefaultsHelpFormatter adds information about argument defaults
+ to the help.
+
+All other classes in this module are considered implementation details.
+(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
+considered public as object names -- the API of the formatter objects is
+still considered an implementation detail.)
+"""
+
+__version__ = '1.1'
+__all__ = [
+ 'ArgumentParser',
+ 'ArgumentError',
+ 'ArgumentTypeError',
+ 'FileType',
+ 'HelpFormatter',
+ 'ArgumentDefaultsHelpFormatter',
+ 'RawDescriptionHelpFormatter',
+ 'RawTextHelpFormatter',
+ 'Namespace',
+ 'Action',
+ 'ONE_OR_MORE',
+ 'OPTIONAL',
+ 'PARSER',
+ 'REMAINDER',
+ 'SUPPRESS',
+ 'ZERO_OR_MORE',
+]
+
+
+import collections as _collections
+import copy as _copy
+import os as _os
+import re as _re
+import sys as _sys
+import textwrap as _textwrap
+
+from gettext import gettext as _, ngettext
+
+
+def _callable(obj):
+ return hasattr(obj, '__call__') or hasattr(obj, '__bases__')
+
+
+SUPPRESS = '==SUPPRESS=='
+
+OPTIONAL = '?'
+ZERO_OR_MORE = '*'
+ONE_OR_MORE = '+'
+PARSER = 'A...'
+REMAINDER = '...'
+_UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'
+
+# =============================
+# Utility functions and classes
+# =============================
+
+class _AttributeHolder(object):
+ """Abstract base class that provides __repr__.
+
+ The __repr__ method returns a string in the format::
+ ClassName(attr=name, attr=name, ...)
+ The attributes are determined either by a class-level attribute,
+ '_kwarg_names', or by inspecting the instance __dict__.
+ """
+
+ def __repr__(self):
+ type_name = type(self).__name__
+ arg_strings = []
+ for arg in self._get_args():
+ arg_strings.append(repr(arg))
+ for name, value in self._get_kwargs():
+ arg_strings.append('%s=%r' % (name, value))
+ return '%s(%s)' % (type_name, ', '.join(arg_strings))
+
+ def _get_kwargs(self):
+ return sorted(self.__dict__.items())
+
+ def _get_args(self):
+ return []
+
+
+def _ensure_value(namespace, name, value):
+ if getattr(namespace, name, None) is None:
+ setattr(namespace, name, value)
+ return getattr(namespace, name)
+
+
+# ===============
+# Formatting Help
+# ===============
+
+class HelpFormatter(object):
+ """Formatter for generating usage messages and argument help strings.
+
+ Only the name of this class is considered a public API. All the methods
+ provided by the class are considered an implementation detail.
+ """
+
+ def __init__(self,
+ prog,
+ indent_increment=2,
+ max_help_position=24,
+ width=None):
+
+ # default setting for width
+ if width is None:
+ try:
+ width = int(_os.environ['COLUMNS'])
+ except (KeyError, ValueError):
+ width = 80
+ width -= 2
+
+ self._prog = prog
+ self._indent_increment = indent_increment
+ self._max_help_position = max_help_position
+ self._width = width
+
+ self._current_indent = 0
+ self._level = 0
+ self._action_max_length = 0
+
+ self._root_section = self._Section(self, None)
+ self._current_section = self._root_section
+
+ self._whitespace_matcher = _re.compile(r'\s+')
+ self._long_break_matcher = _re.compile(r'\n\n\n+')
+
+ # ===============================
+ # Section and indentation methods
+ # ===============================
+ def _indent(self):
+ self._current_indent += self._indent_increment
+ self._level += 1
+
+ def _dedent(self):
+ self._current_indent -= self._indent_increment
+ assert self._current_indent >= 0, 'Indent decreased below 0.'
+ self._level -= 1
+
+ class _Section(object):
+
+ def __init__(self, formatter, parent, heading=None):
+ self.formatter = formatter
+ self.parent = parent
+ self.heading = heading
+ self.items = []
+
+ def format_help(self):
+ # format the indented section
+ if self.parent is not None:
+ self.formatter._indent()
+ join = self.formatter._join_parts
+ for func, args in self.items:
+ func(*args)
+ item_help = join([func(*args) for func, args in self.items])
+ if self.parent is not None:
+ self.formatter._dedent()
+
+ # return nothing if the section was empty
+ if not item_help:
+ return ''
+
+ # add the heading if the section was non-empty
+ if self.heading is not SUPPRESS and self.heading is not None:
+ current_indent = self.formatter._current_indent
+ heading = '%*s%s:\n' % (current_indent, '', self.heading)
+ else:
+ heading = ''
+
+ # join the section-initial newline, the heading and the help
+ return join(['\n', heading, item_help, '\n'])
+
+ def _add_item(self, func, args):
+ self._current_section.items.append((func, args))
+
+ # ========================
+ # Message building methods
+ # ========================
+ def start_section(self, heading):
+ self._indent()
+ section = self._Section(self, self._current_section, heading)
+ self._add_item(section.format_help, [])
+ self._current_section = section
+
+ def end_section(self):
+ self._current_section = self._current_section.parent
+ self._dedent()
+
+ def add_text(self, text):
+ if text is not SUPPRESS and text is not None:
+ self._add_item(self._format_text, [text])
+
+ def add_usage(self, usage, actions, groups, prefix=None):
+ if usage is not SUPPRESS:
+ args = usage, actions, groups, prefix
+ self._add_item(self._format_usage, args)
+
+ def add_argument(self, action):
+ if action.help is not SUPPRESS:
+
+ # find all invocations
+ get_invocation = self._format_action_invocation
+ invocations = [get_invocation(action)]
+ for subaction in self._iter_indented_subactions(action):
+ invocations.append(get_invocation(subaction))
+
+ # update the maximum item length
+ invocation_length = max([len(s) for s in invocations])
+ action_length = invocation_length + self._current_indent
+ self._action_max_length = max(self._action_max_length,
+ action_length)
+
+ # add the item to the list
+ self._add_item(self._format_action, [action])
+
+ def add_arguments(self, actions):
+ for action in actions:
+ self.add_argument(action)
+
+ # =======================
+ # Help-formatting methods
+ # =======================
+ def format_help(self):
+ help = self._root_section.format_help()
+ if help:
+ help = self._long_break_matcher.sub('\n\n', help)
+ help = help.strip('\n') + '\n'
+ return help
+
+ def _join_parts(self, part_strings):
+ return ''.join([part
+ for part in part_strings
+ if part and part is not SUPPRESS])
+
+ def _format_usage(self, usage, actions, groups, prefix):
+ if prefix is None:
+ prefix = _('usage: ')
+
+ # if usage is specified, use that
+ if usage is not None:
+ usage = usage % dict(prog=self._prog)
+
+ # if no optionals or positionals are available, usage is just prog
+ elif usage is None and not actions:
+ usage = '%(prog)s' % dict(prog=self._prog)
+
+ # if optionals and positionals are available, calculate usage
+ elif usage is None:
+ prog = '%(prog)s' % dict(prog=self._prog)
+
+ # split optionals from positionals
+ optionals = []
+ positionals = []
+ for action in actions:
+ if action.option_strings:
+ optionals.append(action)
+ else:
+ positionals.append(action)
+
+ # build full usage string
+ format = self._format_actions_usage
+ action_usage = format(optionals + positionals, groups)
+ usage = ' '.join([s for s in [prog, action_usage] if s])
+
+ # wrap the usage parts if it's too long
+ text_width = self._width - self._current_indent
+ if len(prefix) + len(usage) > text_width:
+
+ # break usage into wrappable parts
+ part_regexp = r'\(.*?\)+|\[.*?\]+|\S+'
+ opt_usage = format(optionals, groups)
+ pos_usage = format(positionals, groups)
+ opt_parts = _re.findall(part_regexp, opt_usage)
+ pos_parts = _re.findall(part_regexp, pos_usage)
+ assert ' '.join(opt_parts) == opt_usage
+ assert ' '.join(pos_parts) == pos_usage
+
+ # helper for wrapping lines
+ def get_lines(parts, indent, prefix=None):
+ lines = []
+ line = []
+ if prefix is not None:
+ line_len = len(prefix) - 1
+ else:
+ line_len = len(indent) - 1
+ for part in parts:
+ if line_len + 1 + len(part) > text_width:
+ lines.append(indent + ' '.join(line))
+ line = []
+ line_len = len(indent) - 1
+ line.append(part)
+ line_len += len(part) + 1
+ if line:
+ lines.append(indent + ' '.join(line))
+ if prefix is not None:
+ lines[0] = lines[0][len(indent):]
+ return lines
+
+ # if prog is short, follow it with optionals or positionals
+ if len(prefix) + len(prog) <= 0.75 * text_width:
+ indent = ' ' * (len(prefix) + len(prog) + 1)
+ if opt_parts:
+ lines = get_lines([prog] + opt_parts, indent, prefix)
+ lines.extend(get_lines(pos_parts, indent))
+ elif pos_parts:
+ lines = get_lines([prog] + pos_parts, indent, prefix)
+ else:
+ lines = [prog]
+
+ # if prog is long, put it on its own line
+ else:
+ indent = ' ' * len(prefix)
+ parts = opt_parts + pos_parts
+ lines = get_lines(parts, indent)
+ if len(lines) > 1:
+ lines = []
+ lines.extend(get_lines(opt_parts, indent))
+ lines.extend(get_lines(pos_parts, indent))
+ lines = [prog] + lines
+
+ # join lines into usage
+ usage = '\n'.join(lines)
+
+ # prefix with 'usage:'
+ return '%s%s\n\n' % (prefix, usage)
+
+ def _format_actions_usage(self, actions, groups):
+ # find group indices and identify actions in groups
+ group_actions = set()
+ inserts = {}
+ for group in groups:
+ try:
+ start = actions.index(group._group_actions[0])
+ except ValueError:
+ continue
+ else:
+ end = start + len(group._group_actions)
+ if actions[start:end] == group._group_actions:
+ for action in group._group_actions:
+ group_actions.add(action)
+ if not group.required:
+ if start in inserts:
+ inserts[start] += ' ['
+ else:
+ inserts[start] = '['
+ inserts[end] = ']'
+ else:
+ if start in inserts:
+ inserts[start] += ' ('
+ else:
+ inserts[start] = '('
+ inserts[end] = ')'
+ for i in range(start + 1, end):
+ inserts[i] = '|'
+
+ # collect all actions format strings
+ parts = []
+ for i, action in enumerate(actions):
+
+ # suppressed arguments are marked with None
+ # remove | separators for suppressed arguments
+ if action.help is SUPPRESS:
+ parts.append(None)
+ if inserts.get(i) == '|':
+ inserts.pop(i)
+ elif inserts.get(i + 1) == '|':
+ inserts.pop(i + 1)
+
+ # produce all arg strings
+ elif not action.option_strings:
+ part = self._format_args(action, action.dest)
+
+ # if it's in a group, strip the outer []
+ if action in group_actions:
+ if part[0] == '[' and part[-1] == ']':
+ part = part[1:-1]
+
+ # add the action string to the list
+ parts.append(part)
+
+ # produce the first way to invoke the option in brackets
+ else:
+ option_string = action.option_strings[0]
+
+ # if the Optional doesn't take a value, format is:
+ # -s or --long
+ if action.nargs == 0:
+ part = '%s' % option_string
+
+ # if the Optional takes a value, format is:
+ # -s ARGS or --long ARGS
+ else:
+ default = action.dest.upper()
+ args_string = self._format_args(action, default)
+ part = '%s %s' % (option_string, args_string)
+
+ # make it look optional if it's not required or in a group
+ if not action.required and action not in group_actions:
+ part = '[%s]' % part
+
+ # add the action string to the list
+ parts.append(part)
+
+ # insert things at the necessary indices
+ for i in sorted(inserts, reverse=True):
+ parts[i:i] = [inserts[i]]
+
+ # join all the action items with spaces
+ text = ' '.join([item for item in parts if item is not None])
+
+ # clean up separators for mutually exclusive groups
+ open = r'[\[(]'
+ close = r'[\])]'
+ text = _re.sub(r'(%s) ' % open, r'\1', text)
+ text = _re.sub(r' (%s)' % close, r'\1', text)
+ text = _re.sub(r'%s *%s' % (open, close), r'', text)
+ text = _re.sub(r'\(([^|]*)\)', r'\1', text)
+ text = text.strip()
+
+ # return the text
+ return text
+
+ def _format_text(self, text):
+ if '%(prog)' in text:
+ text = text % dict(prog=self._prog)
+ text_width = self._width - self._current_indent
+ indent = ' ' * self._current_indent
+ return self._fill_text(text, text_width, indent) + '\n\n'
+
+ def _format_action(self, action):
+ # determine the required width and the entry label
+ help_position = min(self._action_max_length + 2,
+ self._max_help_position)
+ help_width = self._width - help_position
+ action_width = help_position - self._current_indent - 2
+ action_header = self._format_action_invocation(action)
+
+ # ho nelp; start on same line and add a final newline
+ if not action.help:
+ tup = self._current_indent, '', action_header
+ action_header = '%*s%s\n' % tup
+
+ # short action name; start on the same line and pad two spaces
+ elif len(action_header) <= action_width:
+ tup = self._current_indent, '', action_width, action_header
+ action_header = '%*s%-*s ' % tup
+ indent_first = 0
+
+ # long action name; start on the next line
+ else:
+ tup = self._current_indent, '', action_header
+ action_header = '%*s%s\n' % tup
+ indent_first = help_position
+
+ # collect the pieces of the action help
+ parts = [action_header]
+
+ # if there was help for the action, add lines of help text
+ if action.help:
+ help_text = self._expand_help(action)
+ help_lines = self._split_lines(help_text, help_width)
+ parts.append('%*s%s\n' % (indent_first, '', help_lines[0]))
+ for line in help_lines[1:]:
+ parts.append('%*s%s\n' % (help_position, '', line))
+
+ # or add a newline if the description doesn't end with one
+ elif not action_header.endswith('\n'):
+ parts.append('\n')
+
+ # if there are any sub-actions, add their help as well
+ for subaction in self._iter_indented_subactions(action):
+ parts.append(self._format_action(subaction))
+
+ # return a single string
+ return self._join_parts(parts)
+
+ def _format_action_invocation(self, action):
+ if not action.option_strings:
+ metavar, = self._metavar_formatter(action, action.dest)(1)
+ return metavar
+
+ else:
+ parts = []
+
+ # if the Optional doesn't take a value, format is:
+ # -s, --long
+ if action.nargs == 0:
+ parts.extend(action.option_strings)
+
+ # if the Optional takes a value, format is:
+ # -s ARGS, --long ARGS
+ else:
+ default = action.dest.upper()
+ args_string = self._format_args(action, default)
+ for option_string in action.option_strings:
+ parts.append('%s %s' % (option_string, args_string))
+
+ return ', '.join(parts)
+
+ def _metavar_formatter(self, action, default_metavar):
+ if action.metavar is not None:
+ result = action.metavar
+ elif action.choices is not None:
+ choice_strs = [str(choice) for choice in action.choices]
+ result = '{%s}' % ','.join(choice_strs)
+ else:
+ result = default_metavar
+
+ def format(tuple_size):
+ if isinstance(result, tuple):
+ return result
+ else:
+ return (result, ) * tuple_size
+ return format
+
+ def _format_args(self, action, default_metavar):
+ get_metavar = self._metavar_formatter(action, default_metavar)
+ if action.nargs is None:
+ result = '%s' % get_metavar(1)
+ elif action.nargs == OPTIONAL:
+ result = '[%s]' % get_metavar(1)
+ elif action.nargs == ZERO_OR_MORE:
+ result = '[%s [%s ...]]' % get_metavar(2)
+ elif action.nargs == ONE_OR_MORE:
+ result = '%s [%s ...]' % get_metavar(2)
+ elif action.nargs == REMAINDER:
+ result = '...'
+ elif action.nargs == PARSER:
+ result = '%s ...' % get_metavar(1)
+ else:
+ formats = ['%s' for _ in range(action.nargs)]
+ result = ' '.join(formats) % get_metavar(action.nargs)
+ return result
+
+ def _expand_help(self, action):
+ params = dict(vars(action), prog=self._prog)
+ for name in list(params):
+ if params[name] is SUPPRESS:
+ del params[name]
+ for name in list(params):
+ if hasattr(params[name], '__name__'):
+ params[name] = params[name].__name__
+ if params.get('choices') is not None:
+ choices_str = ', '.join([str(c) for c in params['choices']])
+ params['choices'] = choices_str
+ return self._get_help_string(action) % params
+
+ def _iter_indented_subactions(self, action):
+ try:
+ get_subactions = action._get_subactions
+ except AttributeError:
+ pass
+ else:
+ self._indent()
+ for subaction in get_subactions():
+ yield subaction
+ self._dedent()
+
+ def _split_lines(self, text, width):
+ text = self._whitespace_matcher.sub(' ', text).strip()
+ return _textwrap.wrap(text, width)
+
+ def _fill_text(self, text, width, indent):
+ text = self._whitespace_matcher.sub(' ', text).strip()
+ return _textwrap.fill(text, width, initial_indent=indent,
+ subsequent_indent=indent)
+
+ def _get_help_string(self, action):
+ return action.help
+
+
+class RawDescriptionHelpFormatter(HelpFormatter):
+ """Help message formatter which retains any formatting in descriptions.
+
+ Only the name of this class is considered a public API. All the methods
+ provided by the class are considered an implementation detail.
+ """
+
+ def _fill_text(self, text, width, indent):
+ return ''.join([indent + line for line in text.splitlines(True)])
+
+
+class RawTextHelpFormatter(RawDescriptionHelpFormatter):
+ """Help message formatter which retains formatting of all help text.
+
+ Only the name of this class is considered a public API. All the methods
+ provided by the class are considered an implementation detail.
+ """
+
+ def _split_lines(self, text, width):
+ return text.splitlines()
+
+
+class ArgumentDefaultsHelpFormatter(HelpFormatter):
+ """Help message formatter which adds default values to argument help.
+
+ Only the name of this class is considered a public API. All the methods
+ provided by the class are considered an implementation detail.
+ """
+
+ def _get_help_string(self, action):
+ help = action.help
+ if '%(default)' not in action.help:
+ if action.default is not SUPPRESS:
+ defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
+ if action.option_strings or action.nargs in defaulting_nargs:
+ help += ' (default: %(default)s)'
+ return help
+
+
+# =====================
+# Options and Arguments
+# =====================
+
+def _get_action_name(argument):
+ if argument is None:
+ return None
+ elif argument.option_strings:
+ return '/'.join(argument.option_strings)
+ elif argument.metavar not in (None, SUPPRESS):
+ return argument.metavar
+ elif argument.dest not in (None, SUPPRESS):
+ return argument.dest
+ else:
+ return None
+
+
+class ArgumentError(Exception):
+ """An error from creating or using an argument (optional or positional).
+
+ The string value of this exception is the message, augmented with
+ information about the argument that caused it.
+ """
+
+ def __init__(self, argument, message):
+ self.argument_name = _get_action_name(argument)
+ self.message = message
+
+ def __str__(self):
+ if self.argument_name is None:
+ format = '%(message)s'
+ else:
+ format = 'argument %(argument_name)s: %(message)s'
+ return format % dict(message=self.message,
+ argument_name=self.argument_name)
+
+
+class ArgumentTypeError(Exception):
+ """An error from trying to convert a command line string to a type."""
+ pass
+
+
+# ==============
+# Action classes
+# ==============
+
+class Action(_AttributeHolder):
+ """Information about how to convert command line strings to Python objects.
+
+ Action objects are used by an ArgumentParser to represent the information
+ needed to parse a single argument from one or more strings from the
+ command line. The keyword arguments to the Action constructor are also
+ all attributes of Action instances.
+
+ Keyword Arguments:
+
+ - option_strings -- A list of command-line option strings which
+ should be associated with this action.
+
+ - dest -- The name of the attribute to hold the created object(s)
+
+ - nargs -- The number of command-line arguments that should be
+ consumed. By default, one argument will be consumed and a single
+ value will be produced. Other values include:
+ - N (an integer) consumes N arguments (and produces a list)
+ - '?' consumes zero or one arguments
+ - '*' consumes zero or more arguments (and produces a list)
+ - '+' consumes one or more arguments (and produces a list)
+ Note that the difference between the default and nargs=1 is that
+ with the default, a single value will be produced, while with
+ nargs=1, a list containing a single value will be produced.
+
+ - const -- The value to be produced if the option is specified and the
+ option uses an action that takes no values.
+
+ - default -- The value to be produced if the option is not specified.
+
+ - type -- The type which the command-line arguments should be converted
+ to, should be one of 'string', 'int', 'float', 'complex' or a
+ callable object that accepts a single string argument. If None,
+ 'string' is assumed.
+
+ - choices -- A container of values that should be allowed. If not None,
+ after a command-line argument has been converted to the appropriate
+ type, an exception will be raised if it is not a member of this
+ collection.
+
+ - required -- True if the action must always be specified at the
+ command line. This is only meaningful for optional command-line
+ arguments.
+
+ - help -- The help string describing the argument.
+
+ - metavar -- The name to be used for the option's argument with the
+ help string. If None, the 'dest' value will be used as the name.
+ """
+
+ def __init__(self,
+ option_strings,
+ dest,
+ nargs=None,
+ const=None,
+ default=None,
+ type=None,
+ choices=None,
+ required=False,
+ help=None,
+ metavar=None):
+ self.option_strings = option_strings
+ self.dest = dest
+ self.nargs = nargs
+ self.const = const
+ self.default = default
+ self.type = type
+ self.choices = choices
+ self.required = required
+ self.help = help
+ self.metavar = metavar
+
+ def _get_kwargs(self):
+ names = [
+ 'option_strings',
+ 'dest',
+ 'nargs',
+ 'const',
+ 'default',
+ 'type',
+ 'choices',
+ 'help',
+ 'metavar',
+ ]
+ return [(name, getattr(self, name)) for name in names]
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ raise NotImplementedError(_('.__call__() not defined'))
+
+
+class _StoreAction(Action):
+
+ def __init__(self,
+ option_strings,
+ dest,
+ nargs=None,
+ const=None,
+ default=None,
+ type=None,
+ choices=None,
+ required=False,
+ help=None,
+ metavar=None):
+ if nargs == 0:
+ raise ValueError('nargs for store actions must be > 0; if you '
+ 'have nothing to store, actions such as store '
+ 'true or store const may be more appropriate')
+ if const is not None and nargs != OPTIONAL:
+ raise ValueError('nargs must be %r to supply const' % OPTIONAL)
+ super(_StoreAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ nargs=nargs,
+ const=const,
+ default=default,
+ type=type,
+ choices=choices,
+ required=required,
+ help=help,
+ metavar=metavar)
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ setattr(namespace, self.dest, values)
+
+
+class _StoreConstAction(Action):
+
+ def __init__(self,
+ option_strings,
+ dest,
+ const,
+ default=None,
+ required=False,
+ help=None,
+ metavar=None):
+ super(_StoreConstAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ nargs=0,
+ const=const,
+ default=default,
+ required=required,
+ help=help)
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ setattr(namespace, self.dest, self.const)
+
+
+class _StoreTrueAction(_StoreConstAction):
+
+ def __init__(self,
+ option_strings,
+ dest,
+ default=False,
+ required=False,
+ help=None):
+ super(_StoreTrueAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ const=True,
+ default=default,
+ required=required,
+ help=help)
+
+
+class _StoreFalseAction(_StoreConstAction):
+
+ def __init__(self,
+ option_strings,
+ dest,
+ default=True,
+ required=False,
+ help=None):
+ super(_StoreFalseAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ const=False,
+ default=default,
+ required=required,
+ help=help)
+
+
+class _AppendAction(Action):
+
+ def __init__(self,
+ option_strings,
+ dest,
+ nargs=None,
+ const=None,
+ default=None,
+ type=None,
+ choices=None,
+ required=False,
+ help=None,
+ metavar=None):
+ if nargs == 0:
+ raise ValueError('nargs for append actions must be > 0; if arg '
+ 'strings are not supplying the value to append, '
+ 'the append const action may be more appropriate')
+ if const is not None and nargs != OPTIONAL:
+ raise ValueError('nargs must be %r to supply const' % OPTIONAL)
+ super(_AppendAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ nargs=nargs,
+ const=const,
+ default=default,
+ type=type,
+ choices=choices,
+ required=required,
+ help=help,
+ metavar=metavar)
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ items = _copy.copy(_ensure_value(namespace, self.dest, []))
+ items.append(values)
+ setattr(namespace, self.dest, items)
+
+
+class _AppendConstAction(Action):
+
+ def __init__(self,
+ option_strings,
+ dest,
+ const,
+ default=None,
+ required=False,
+ help=None,
+ metavar=None):
+ super(_AppendConstAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ nargs=0,
+ const=const,
+ default=default,
+ required=required,
+ help=help,
+ metavar=metavar)
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ items = _copy.copy(_ensure_value(namespace, self.dest, []))
+ items.append(self.const)
+ setattr(namespace, self.dest, items)
+
+
+class _CountAction(Action):
+
+ def __init__(self,
+ option_strings,
+ dest,
+ default=None,
+ required=False,
+ help=None):
+ super(_CountAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ nargs=0,
+ default=default,
+ required=required,
+ help=help)
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ new_count = _ensure_value(namespace, self.dest, 0) + 1
+ setattr(namespace, self.dest, new_count)
+
+
+class _HelpAction(Action):
+
+ def __init__(self,
+ option_strings,
+ dest=SUPPRESS,
+ default=SUPPRESS,
+ help=None):
+ super(_HelpAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ default=default,
+ nargs=0,
+ help=help)
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ parser.print_help()
+ parser.exit()
+
+
+class _VersionAction(Action):
+
+ def __init__(self,
+ option_strings,
+ version=None,
+ dest=SUPPRESS,
+ default=SUPPRESS,
+ help="show program's version number and exit"):
+ super(_VersionAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ default=default,
+ nargs=0,
+ help=help)
+ self.version = version
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ version = self.version
+ if version is None:
+ version = parser.version
+ formatter = parser._get_formatter()
+ formatter.add_text(version)
+ parser.exit(message=formatter.format_help())
+
+
+class _SubParsersAction(Action):
+
+ class _ChoicesPseudoAction(Action):
+
+ def __init__(self, name, aliases, help):
+ metavar = dest = name
+ if aliases:
+ metavar += ' (%s)' % ', '.join(aliases)
+ sup = super(_SubParsersAction._ChoicesPseudoAction, self)
+ sup.__init__(option_strings=[], dest=dest, help=help,
+ metavar=metavar)
+
+ def __init__(self,
+ option_strings,
+ prog,
+ parser_class,
+ dest=SUPPRESS,
+ help=None,
+ metavar=None):
+
+ self._prog_prefix = prog
+ self._parser_class = parser_class
+ self._name_parser_map = _collections.OrderedDict()
+ self._choices_actions = []
+
+ super(_SubParsersAction, self).__init__(
+ option_strings=option_strings,
+ dest=dest,
+ nargs=PARSER,
+ choices=self._name_parser_map,
+ help=help,
+ metavar=metavar)
+
+ def add_parser(self, name, **kwargs):
+ # set prog from the existing prefix
+ if kwargs.get('prog') is None:
+ kwargs['prog'] = '%s %s' % (self._prog_prefix, name)
+
+ aliases = kwargs.pop('aliases', ())
+
+ # create a pseudo-action to hold the choice help
+ if 'help' in kwargs:
+ help = kwargs.pop('help')
+ choice_action = self._ChoicesPseudoAction(name, aliases, help)
+ self._choices_actions.append(choice_action)
+
+ # create the parser and add it to the map
+ parser = self._parser_class(**kwargs)
+ self._name_parser_map[name] = parser
+
+ # make parser available under aliases also
+ for alias in aliases:
+ self._name_parser_map[alias] = parser
+
+ return parser
+
+ def _get_subactions(self):
+ return self._choices_actions
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ parser_name = values[0]
+ arg_strings = values[1:]
+
+ # set the parser name if requested
+ if self.dest is not SUPPRESS:
+ setattr(namespace, self.dest, parser_name)
+
+ # select the parser
+ try:
+ parser = self._name_parser_map[parser_name]
+ except KeyError:
+ args = {'parser_name': parser_name,
+ 'choices': ', '.join(self._name_parser_map)}
+ msg = _('unknown parser %(parser_name)r (choices: %(choices)s)') % args
+ raise ArgumentError(self, msg)
+
+ # parse all the remaining options into the namespace
+ # store any unrecognized options on the object, so that the top
+ # level parser can decide what to do with them
+ namespace, arg_strings = parser.parse_known_args(arg_strings, namespace)
+ if arg_strings:
+ vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, [])
+ getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings)
+
+
+# ==============
+# Type classes
+# ==============
+
+class FileType(object):
+ """Factory for creating file object types
+
+ Instances of FileType are typically passed as type= arguments to the
+ ArgumentParser add_argument() method.
+
+ Keyword Arguments:
+ - mode -- A string indicating how the file is to be opened. Accepts the
+ same values as the builtin open() function.
+ - bufsize -- The file's desired buffer size. Accepts the same values as
+ the builtin open() function.
+ """
+
+ def __init__(self, mode='r', bufsize=-1):
+ self._mode = mode
+ self._bufsize = bufsize
+
+ def __call__(self, string):
+ # the special argument "-" means sys.std{in,out}
+ if string == '-':
+ if 'r' in self._mode:
+ return _sys.stdin
+ elif 'w' in self._mode:
+ return _sys.stdout
+ else:
+ msg = _('argument "-" with mode %r') % self._mode
+ raise ValueError(msg)
+
+ # all other arguments are used as file names
+ try:
+ return open(string, self._mode, self._bufsize)
+ except IOError as e:
+ message = _("can't open '%s': %s")
+ raise ArgumentTypeError(message % (string, e))
+
+ def __repr__(self):
+ args = self._mode, self._bufsize
+ args_str = ', '.join(repr(arg) for arg in args if arg != -1)
+ return '%s(%s)' % (type(self).__name__, args_str)
+
+# ===========================
+# Optional and Positional Parsing
+# ===========================
+
+class Namespace(_AttributeHolder):
+ """Simple object for storing attributes.
+
+ Implements equality by attribute names and values, and provides a simple
+ string representation.
+ """
+
+ def __init__(self, **kwargs):
+ for name in kwargs:
+ setattr(self, name, kwargs[name])
+
+ def __eq__(self, other):
+ return vars(self) == vars(other)
+
+ def __ne__(self, other):
+ return not (self == other)
+
+ def __contains__(self, key):
+ return key in self.__dict__
+
+
+class _ActionsContainer(object):
+
+ def __init__(self,
+ description,
+ prefix_chars,
+ argument_default,
+ conflict_handler):
+ super(_ActionsContainer, self).__init__()
+
+ self.description = description
+ self.argument_default = argument_default
+ self.prefix_chars = prefix_chars
+ self.conflict_handler = conflict_handler
+
+ # set up registries
+ self._registries = {}
+
+ # register actions
+ self.register('action', None, _StoreAction)
+ self.register('action', 'store', _StoreAction)
+ self.register('action', 'store_const', _StoreConstAction)
+ self.register('action', 'store_true', _StoreTrueAction)
+ self.register('action', 'store_false', _StoreFalseAction)
+ self.register('action', 'append', _AppendAction)
+ self.register('action', 'append_const', _AppendConstAction)
+ self.register('action', 'count', _CountAction)
+ self.register('action', 'help', _HelpAction)
+ self.register('action', 'version', _VersionAction)
+ self.register('action', 'parsers', _SubParsersAction)
+
+ # raise an exception if the conflict handler is invalid
+ self._get_handler()
+
+ # action storage
+ self._actions = []
+ self._option_string_actions = {}
+
+ # groups
+ self._action_groups = []
+ self._mutually_exclusive_groups = []
+
+ # defaults storage
+ self._defaults = {}
+
+ # determines whether an "option" looks like a negative number
+ self._negative_number_matcher = _re.compile(r'^-\d+$|^-\d*\.\d+$')
+
+ # whether or not there are any optionals that look like negative
+ # numbers -- uses a list so it can be shared and edited
+ self._has_negative_number_optionals = []
+
+ # ====================
+ # Registration methods
+ # ====================
+ def register(self, registry_name, value, object):
+ registry = self._registries.setdefault(registry_name, {})
+ registry[value] = object
+
+ def _registry_get(self, registry_name, value, default=None):
+ return self._registries[registry_name].get(value, default)
+
+ # ==================================
+ # Namespace default accessor methods
+ # ==================================
+ def set_defaults(self, **kwargs):
+ self._defaults.update(kwargs)
+
+ # if these defaults match any existing arguments, replace
+ # the previous default on the object with the new one
+ for action in self._actions:
+ if action.dest in kwargs:
+ action.default = kwargs[action.dest]
+
+ def get_default(self, dest):
+ for action in self._actions:
+ if action.dest == dest and action.default is not None:
+ return action.default
+ return self._defaults.get(dest, None)
+
+
+ # =======================
+ # Adding argument actions
+ # =======================
+ def add_argument(self, *args, **kwargs):
+ """
+ add_argument(dest, ..., name=value, ...)
+ add_argument(option_string, option_string, ..., name=value, ...)
+ """
+
+ # if no positional args are supplied or only one is supplied and
+ # it doesn't look like an option string, parse a positional
+ # argument
+ chars = self.prefix_chars
+ if not args or len(args) == 1 and args[0][0] not in chars:
+ if args and 'dest' in kwargs:
+ raise ValueError('dest supplied twice for positional argument')
+ kwargs = self._get_positional_kwargs(*args, **kwargs)
+
+ # otherwise, we're adding an optional argument
+ else:
+ kwargs = self._get_optional_kwargs(*args, **kwargs)
+
+ # if no default was supplied, use the parser-level default
+ if 'default' not in kwargs:
+ dest = kwargs['dest']
+ if dest in self._defaults:
+ kwargs['default'] = self._defaults[dest]
+ elif self.argument_default is not None:
+ kwargs['default'] = self.argument_default
+
+ # create the action object, and add it to the parser
+ action_class = self._pop_action_class(kwargs)
+ if not _callable(action_class):
+ raise ValueError('unknown action "%s"' % (action_class,))
+ action = action_class(**kwargs)
+
+ # raise an error if the action type is not callable
+ type_func = self._registry_get('type', action.type, action.type)
+ if not _callable(type_func):
+ raise ValueError('%r is not callable' % (type_func,))
+
+ # raise an error if the metavar does not match the type
+ if hasattr(self, "_get_formatter"):
+ try:
+ self._get_formatter()._format_args(action, None)
+ except TypeError:
+ raise ValueError("length of metavar tuple does not match nargs")
+
+ return self._add_action(action)
+
+ def add_argument_group(self, *args, **kwargs):
+ group = _ArgumentGroup(self, *args, **kwargs)
+ self._action_groups.append(group)
+ return group
+
+ def add_mutually_exclusive_group(self, **kwargs):
+ group = _MutuallyExclusiveGroup(self, **kwargs)
+ self._mutually_exclusive_groups.append(group)
+ return group
+
+ def _add_action(self, action):
+ # resolve any conflicts
+ self._check_conflict(action)
+
+ # add to actions list
+ self._actions.append(action)
+ action.container = self
+
+ # index the action by any option strings it has
+ for option_string in action.option_strings:
+ self._option_string_actions[option_string] = action
+
+ # set the flag if any option strings look like negative numbers
+ for option_string in action.option_strings:
+ if self._negative_number_matcher.match(option_string):
+ if not self._has_negative_number_optionals:
+ self._has_negative_number_optionals.append(True)
+
+ # return the created action
+ return action
+
+ def _remove_action(self, action):
+ self._actions.remove(action)
+
+ def _add_container_actions(self, container):
+ # collect groups by titles
+ title_group_map = {}
+ for group in self._action_groups:
+ if group.title in title_group_map:
+ msg = _('cannot merge actions - two groups are named %r')
+ raise ValueError(msg % (group.title))
+ title_group_map[group.title] = group
+
+ # map each action to its group
+ group_map = {}
+ for group in container._action_groups:
+
+ # if a group with the title exists, use that, otherwise
+ # create a new group matching the container's group
+ if group.title not in title_group_map:
+ title_group_map[group.title] = self.add_argument_group(
+ title=group.title,
+ description=group.description,
+ conflict_handler=group.conflict_handler)
+
+ # map the actions to their new group
+ for action in group._group_actions:
+ group_map[action] = title_group_map[group.title]
+
+ # add container's mutually exclusive groups
+ # NOTE: if add_mutually_exclusive_group ever gains title= and
+ # description= then this code will need to be expanded as above
+ for group in container._mutually_exclusive_groups:
+ mutex_group = self.add_mutually_exclusive_group(
+ required=group.required)
+
+ # map the actions to their new mutex group
+ for action in group._group_actions:
+ group_map[action] = mutex_group
+
+ # add all actions to this container or their group
+ for action in container._actions:
+ group_map.get(action, self)._add_action(action)
+
+ def _get_positional_kwargs(self, dest, **kwargs):
+ # make sure required is not specified
+ if 'required' in kwargs:
+ msg = _("'required' is an invalid argument for positionals")
+ raise TypeError(msg)
+
+ # mark positional arguments as required if at least one is
+ # always required
+ if kwargs.get('nargs') not in [OPTIONAL, ZERO_OR_MORE]:
+ kwargs['required'] = True
+ if kwargs.get('nargs') == ZERO_OR_MORE and 'default' not in kwargs:
+ kwargs['required'] = True
+
+ # return the keyword arguments with no option strings
+ return dict(kwargs, dest=dest, option_strings=[])
+
+ def _get_optional_kwargs(self, *args, **kwargs):
+ # determine short and long option strings
+ option_strings = []
+ long_option_strings = []
+ for option_string in args:
+ # error on strings that don't start with an appropriate prefix
+ if not option_string[0] in self.prefix_chars:
+ args = {'option': option_string,
+ 'prefix_chars': self.prefix_chars}
+ msg = _('invalid option string %(option)r: '
+ 'must start with a character %(prefix_chars)r')
+ raise ValueError(msg % args)
+
+ # strings starting with two prefix characters are long options
+ option_strings.append(option_string)
+ if option_string[0] in self.prefix_chars:
+ if len(option_string) > 1:
+ if option_string[1] in self.prefix_chars:
+ long_option_strings.append(option_string)
+
+ # infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
+ dest = kwargs.pop('dest', None)
+ if dest is None:
+ if long_option_strings:
+ dest_option_string = long_option_strings[0]
+ else:
+ dest_option_string = option_strings[0]
+ dest = dest_option_string.lstrip(self.prefix_chars)
+ if not dest:
+ msg = _('dest= is required for options like %r')
+ raise ValueError(msg % option_string)
+ dest = dest.replace('-', '_')
+
+ # return the updated keyword arguments
+ return dict(kwargs, dest=dest, option_strings=option_strings)
+
+ def _pop_action_class(self, kwargs, default=None):
+ action = kwargs.pop('action', default)
+ return self._registry_get('action', action, action)
+
+ def _get_handler(self):
+ # determine function from conflict handler string
+ handler_func_name = '_handle_conflict_%s' % self.conflict_handler
+ try:
+ return getattr(self, handler_func_name)
+ except AttributeError:
+ msg = _('invalid conflict_resolution value: %r')
+ raise ValueError(msg % self.conflict_handler)
+
+ def _check_conflict(self, action):
+
+ # find all options that conflict with this option
+ confl_optionals = []
+ for option_string in action.option_strings:
+ if option_string in self._option_string_actions:
+ confl_optional = self._option_string_actions[option_string]
+ confl_optionals.append((option_string, confl_optional))
+
+ # resolve any conflicts
+ if confl_optionals:
+ conflict_handler = self._get_handler()
+ conflict_handler(action, confl_optionals)
+
+ def _handle_conflict_error(self, action, conflicting_actions):
+ message = ngettext('conflicting option string: %s',
+ 'conflicting option strings: %s',
+ len(conflicting_actions))
+ conflict_string = ', '.join([option_string
+ for option_string, action
+ in conflicting_actions])
+ raise ArgumentError(action, message % conflict_string)
+
+ def _handle_conflict_resolve(self, action, conflicting_actions):
+
+ # remove all conflicting options
+ for option_string, action in conflicting_actions:
+
+ # remove the conflicting option
+ action.option_strings.remove(option_string)
+ self._option_string_actions.pop(option_string, None)
+
+ # if the option now has no option string, remove it from the
+ # container holding it
+ if not action.option_strings:
+ action.container._remove_action(action)
+
+
+class _ArgumentGroup(_ActionsContainer):
+
+ def __init__(self, container, title=None, description=None, **kwargs):
+ # add any missing keyword arguments by checking the container
+ update = kwargs.setdefault
+ update('conflict_handler', container.conflict_handler)
+ update('prefix_chars', container.prefix_chars)
+ update('argument_default', container.argument_default)
+ super_init = super(_ArgumentGroup, self).__init__
+ super_init(description=description, **kwargs)
+
+ # group attributes
+ self.title = title
+ self._group_actions = []
+
+ # share most attributes with the container
+ self._registries = container._registries
+ self._actions = container._actions
+ self._option_string_actions = container._option_string_actions
+ self._defaults = container._defaults
+ self._has_negative_number_optionals = \
+ container._has_negative_number_optionals
+ self._mutually_exclusive_groups = container._mutually_exclusive_groups
+
+ def _add_action(self, action):
+ action = super(_ArgumentGroup, self)._add_action(action)
+ self._group_actions.append(action)
+ return action
+
+ def _remove_action(self, action):
+ super(_ArgumentGroup, self)._remove_action(action)
+ self._group_actions.remove(action)
+
+
+class _MutuallyExclusiveGroup(_ArgumentGroup):
+
+ def __init__(self, container, required=False):
+ super(_MutuallyExclusiveGroup, self).__init__(container)
+ self.required = required
+ self._container = container
+
+ def _add_action(self, action):
+ if action.required:
+ msg = _('mutually exclusive arguments must be optional')
+ raise ValueError(msg)
+ action = self._container._add_action(action)
+ self._group_actions.append(action)
+ return action
+
+ def _remove_action(self, action):
+ self._container._remove_action(action)
+ self._group_actions.remove(action)
+
+
+class ArgumentParser(_AttributeHolder, _ActionsContainer):
+ """Object for parsing command line strings into Python objects.
+
+ Keyword Arguments:
+ - prog -- The name of the program (default: sys.argv[0])
+ - usage -- A usage message (default: auto-generated from arguments)
+ - description -- A description of what the program does
+ - epilog -- Text following the argument descriptions
+ - parents -- Parsers whose arguments should be copied into this one
+ - formatter_class -- HelpFormatter class for printing help messages
+ - prefix_chars -- Characters that prefix optional arguments
+ - fromfile_prefix_chars -- Characters that prefix files containing
+ additional arguments
+ - argument_default -- The default value for all arguments
+ - conflict_handler -- String indicating how to handle conflicts
+ - add_help -- Add a -h/-help option
+ """
+
+ def __init__(self,
+ prog=None,
+ usage=None,
+ description=None,
+ epilog=None,
+ version=None,
+ parents=[],
+ formatter_class=HelpFormatter,
+ prefix_chars='-',
+ fromfile_prefix_chars=None,
+ argument_default=None,
+ conflict_handler='error',
+ add_help=True):
+
+ if version is not None:
+ import warnings
+ warnings.warn(
+ """The "version" argument to ArgumentParser is deprecated. """
+ """Please use """
+ """"add_argument(..., action='version', version="N", ...)" """
+ """instead""", DeprecationWarning)
+
+ superinit = super(ArgumentParser, self).__init__
+ superinit(description=description,
+ prefix_chars=prefix_chars,
+ argument_default=argument_default,
+ conflict_handler=conflict_handler)
+
+ # default setting for prog
+ if prog is None:
+ prog = _os.path.basename(_sys.argv[0])
+
+ self.prog = prog
+ self.usage = usage
+ self.epilog = epilog
+ self.version = version
+ self.formatter_class = formatter_class
+ self.fromfile_prefix_chars = fromfile_prefix_chars
+ self.add_help = add_help
+
+ add_group = self.add_argument_group
+ self._positionals = add_group(_('positional arguments'))
+ self._optionals = add_group(_('optional arguments'))
+ self._subparsers = None
+
+ # register types
+ def identity(string):
+ return string
+ self.register('type', None, identity)
+
+ # add help and version arguments if necessary
+ # (using explicit default to override global argument_default)
+ default_prefix = '-' if '-' in prefix_chars else prefix_chars[0]
+ if self.add_help:
+ self.add_argument(
+ default_prefix+'h', default_prefix*2+'help',
+ action='help', default=SUPPRESS,
+ help=_('show this help message and exit'))
+ if self.version:
+ self.add_argument(
+ default_prefix+'v', default_prefix*2+'version',
+ action='version', default=SUPPRESS,
+ version=self.version,
+ help=_("show program's version number and exit"))
+
+ # add parent arguments and defaults
+ for parent in parents:
+ self._add_container_actions(parent)
+ try:
+ defaults = parent._defaults
+ except AttributeError:
+ pass
+ else:
+ self._defaults.update(defaults)
+
+ # =======================
+ # Pretty __repr__ methods
+ # =======================
+ def _get_kwargs(self):
+ names = [
+ 'prog',
+ 'usage',
+ 'description',
+ 'version',
+ 'formatter_class',
+ 'conflict_handler',
+ 'add_help',
+ ]
+ return [(name, getattr(self, name)) for name in names]
+
+ # ==================================
+ # Optional/Positional adding methods
+ # ==================================
+ def add_subparsers(self, **kwargs):
+ if self._subparsers is not None:
+ self.error(_('cannot have multiple subparser arguments'))
+
+ # add the parser class to the arguments if it's not present
+ kwargs.setdefault('parser_class', type(self))
+
+ if 'title' in kwargs or 'description' in kwargs:
+ title = _(kwargs.pop('title', 'subcommands'))
+ description = _(kwargs.pop('description', None))
+ self._subparsers = self.add_argument_group(title, description)
+ else:
+ self._subparsers = self._positionals
+
+ # prog defaults to the usage message of this parser, skipping
+ # optional arguments and with no "usage:" prefix
+ if kwargs.get('prog') is None:
+ formatter = self._get_formatter()
+ positionals = self._get_positional_actions()
+ groups = self._mutually_exclusive_groups
+ formatter.add_usage(self.usage, positionals, groups, '')
+ kwargs['prog'] = formatter.format_help().strip()
+
+ # create the parsers action and add it to the positionals list
+ parsers_class = self._pop_action_class(kwargs, 'parsers')
+ action = parsers_class(option_strings=[], **kwargs)
+ self._subparsers._add_action(action)
+
+ # return the created parsers action
+ return action
+
+ def _add_action(self, action):
+ if action.option_strings:
+ self._optionals._add_action(action)
+ else:
+ self._positionals._add_action(action)
+ return action
+
+ def _get_optional_actions(self):
+ return [action
+ for action in self._actions
+ if action.option_strings]
+
+ def _get_positional_actions(self):
+ return [action
+ for action in self._actions
+ if not action.option_strings]
+
+ # =====================================
+ # Command line argument parsing methods
+ # =====================================
+ def parse_args(self, args=None, namespace=None):
+ args, argv = self.parse_known_args(args, namespace)
+ if argv:
+ msg = _('unrecognized arguments: %s')
+ self.error(msg % ' '.join(argv))
+ return args
+
+ def parse_known_args(self, args=None, namespace=None):
+ # args default to the system args
+ if args is None:
+ args = _sys.argv[1:]
+
+ # default Namespace built from parser defaults
+ if namespace is None:
+ namespace = Namespace()
+
+ # add any action defaults that aren't present
+ for action in self._actions:
+ if action.dest is not SUPPRESS:
+ if not hasattr(namespace, action.dest):
+ if action.default is not SUPPRESS:
+ default = action.default
+ if isinstance(action.default, str):
+ default = self._get_value(action, default)
+ setattr(namespace, action.dest, default)
+
+ # add any parser defaults that aren't present
+ for dest in self._defaults:
+ if not hasattr(namespace, dest):
+ setattr(namespace, dest, self._defaults[dest])
+
+ # parse the arguments and exit if there are any errors
+ try:
+ namespace, args = self._parse_known_args(args, namespace)
+ if hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR):
+ args.extend(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR))
+ delattr(namespace, _UNRECOGNIZED_ARGS_ATTR)
+ return namespace, args
+ except ArgumentError:
+ err = _sys.exc_info()[1]
+ self.error(str(err))
+
+ def _parse_known_args(self, arg_strings, namespace):
+ # replace arg strings that are file references
+ if self.fromfile_prefix_chars is not None:
+ arg_strings = self._read_args_from_files(arg_strings)
+
+ # map all mutually exclusive arguments to the other arguments
+ # they can't occur with
+ action_conflicts = {}
+ for mutex_group in self._mutually_exclusive_groups:
+ group_actions = mutex_group._group_actions
+ for i, mutex_action in enumerate(mutex_group._group_actions):
+ conflicts = action_conflicts.setdefault(mutex_action, [])
+ conflicts.extend(group_actions[:i])
+ conflicts.extend(group_actions[i + 1:])
+
+ # find all option indices, and determine the arg_string_pattern
+ # which has an 'O' if there is an option at an index,
+ # an 'A' if there is an argument, or a '-' if there is a '--'
+ option_string_indices = {}
+ arg_string_pattern_parts = []
+ arg_strings_iter = iter(arg_strings)
+ for i, arg_string in enumerate(arg_strings_iter):
+
+ # all args after -- are non-options
+ if arg_string == '--':
+ arg_string_pattern_parts.append('-')
+ for arg_string in arg_strings_iter:
+ arg_string_pattern_parts.append('A')
+
+ # otherwise, add the arg to the arg strings
+ # and note the index if it was an option
+ else:
+ option_tuple = self._parse_optional(arg_string)
+ if option_tuple is None:
+ pattern = 'A'
+ else:
+ option_string_indices[i] = option_tuple
+ pattern = 'O'
+ arg_string_pattern_parts.append(pattern)
+
+ # join the pieces together to form the pattern
+ arg_strings_pattern = ''.join(arg_string_pattern_parts)
+
+ # converts arg strings to the appropriate and then takes the action
+ seen_actions = set()
+ seen_non_default_actions = set()
+
+ def take_action(action, argument_strings, option_string=None):
+ seen_actions.add(action)
+ argument_values = self._get_values(action, argument_strings)
+
+ # error if this argument is not allowed with other previously
+ # seen arguments, assuming that actions that use the default
+ # value don't really count as "present"
+ if argument_values is not action.default:
+ seen_non_default_actions.add(action)
+ for conflict_action in action_conflicts.get(action, []):
+ if conflict_action in seen_non_default_actions:
+ msg = _('not allowed with argument %s')
+ action_name = _get_action_name(conflict_action)
+ raise ArgumentError(action, msg % action_name)
+
+ # take the action if we didn't receive a SUPPRESS value
+ # (e.g. from a default)
+ if argument_values is not SUPPRESS:
+ action(self, namespace, argument_values, option_string)
+
+ # function to convert arg_strings into an optional action
+ def consume_optional(start_index):
+
+ # get the optional identified at this index
+ option_tuple = option_string_indices[start_index]
+ action, option_string, explicit_arg = option_tuple
+
+ # identify additional optionals in the same arg string
+ # (e.g. -xyz is the same as -x -y -z if no args are required)
+ match_argument = self._match_argument
+ action_tuples = []
+ while True:
+
+ # if we found no optional action, skip it
+ if action is None:
+ extras.append(arg_strings[start_index])
+ return start_index + 1
+
+ # if there is an explicit argument, try to match the
+ # optional's string arguments to only this
+ if explicit_arg is not None:
+ arg_count = match_argument(action, 'A')
+
+ # if the action is a single-dash option and takes no
+ # arguments, try to parse more single-dash options out
+ # of the tail of the option string
+ chars = self.prefix_chars
+ if arg_count == 0 and option_string[1] not in chars:
+ action_tuples.append((action, [], option_string))
+ char = option_string[0]
+ option_string = char + explicit_arg[0]
+ new_explicit_arg = explicit_arg[1:] or None
+ optionals_map = self._option_string_actions
+ if option_string in optionals_map:
+ action = optionals_map[option_string]
+ explicit_arg = new_explicit_arg
+ else:
+ msg = _('ignored explicit argument %r')
+ raise ArgumentError(action, msg % explicit_arg)
+
+ # if the action expect exactly one argument, we've
+ # successfully matched the option; exit the loop
+ elif arg_count == 1:
+ stop = start_index + 1
+ args = [explicit_arg]
+ action_tuples.append((action, args, option_string))
+ break
+
+ # error if a double-dash option did not use the
+ # explicit argument
+ else:
+ msg = _('ignored explicit argument %r')
+ raise ArgumentError(action, msg % explicit_arg)
+
+ # if there is no explicit argument, try to match the
+ # optional's string arguments with the following strings
+ # if successful, exit the loop
+ else:
+ start = start_index + 1
+ selected_patterns = arg_strings_pattern[start:]
+ arg_count = match_argument(action, selected_patterns)
+ stop = start + arg_count
+ args = arg_strings[start:stop]
+ action_tuples.append((action, args, option_string))
+ break
+
+ # add the Optional to the list and return the index at which
+ # the Optional's string args stopped
+ assert action_tuples
+ for action, args, option_string in action_tuples:
+ take_action(action, args, option_string)
+ return stop
+
+ # the list of Positionals left to be parsed; this is modified
+ # by consume_positionals()
+ positionals = self._get_positional_actions()
+
+ # function to convert arg_strings into positional actions
+ def consume_positionals(start_index):
+ # match as many Positionals as possible
+ match_partial = self._match_arguments_partial
+ selected_pattern = arg_strings_pattern[start_index:]
+ arg_counts = match_partial(positionals, selected_pattern)
+
+ # slice off the appropriate arg strings for each Positional
+ # and add the Positional and its args to the list
+ for action, arg_count in zip(positionals, arg_counts):
+ args = arg_strings[start_index: start_index + arg_count]
+ start_index += arg_count
+ take_action(action, args)
+
+ # slice off the Positionals that we just parsed and return the
+ # index at which the Positionals' string args stopped
+ positionals[:] = positionals[len(arg_counts):]
+ return start_index
+
+ # consume Positionals and Optionals alternately, until we have
+ # passed the last option string
+ extras = []
+ start_index = 0
+ if option_string_indices:
+ max_option_string_index = max(option_string_indices)
+ else:
+ max_option_string_index = -1
+ while start_index <= max_option_string_index:
+
+ # consume any Positionals preceding the next option
+ next_option_string_index = min([
+ index
+ for index in option_string_indices
+ if index >= start_index])
+ if start_index != next_option_string_index:
+ positionals_end_index = consume_positionals(start_index)
+
+ # only try to parse the next optional if we didn't consume
+ # the option string during the positionals parsing
+ if positionals_end_index > start_index:
+ start_index = positionals_end_index
+ continue
+ else:
+ start_index = positionals_end_index
+
+ # if we consumed all the positionals we could and we're not
+ # at the index of an option string, there were extra arguments
+ if start_index not in option_string_indices:
+ strings = arg_strings[start_index:next_option_string_index]
+ extras.extend(strings)
+ start_index = next_option_string_index
+
+ # consume the next optional and any arguments for it
+ start_index = consume_optional(start_index)
+
+ # consume any positionals following the last Optional
+ stop_index = consume_positionals(start_index)
+
+ # if we didn't consume all the argument strings, there were extras
+ extras.extend(arg_strings[stop_index:])
+
+ # if we didn't use all the Positional objects, there were too few
+ # arg strings supplied.
+ if positionals:
+ self.error(_('too few arguments'))
+
+ # make sure all required actions were present
+ for action in self._actions:
+ if action.required:
+ if action not in seen_actions:
+ name = _get_action_name(action)
+ self.error(_('argument %s is required') % name)
+
+ # make sure all required groups had one option present
+ for group in self._mutually_exclusive_groups:
+ if group.required:
+ for action in group._group_actions:
+ if action in seen_non_default_actions:
+ break
+
+ # if no actions were used, report the error
+ else:
+ names = [_get_action_name(action)
+ for action in group._group_actions
+ if action.help is not SUPPRESS]
+ msg = _('one of the arguments %s is required')
+ self.error(msg % ' '.join(names))
+
+ # return the updated namespace and the extra arguments
+ return namespace, extras
+
+ def _read_args_from_files(self, arg_strings):
+ # expand arguments referencing files
+ new_arg_strings = []
+ for arg_string in arg_strings:
+
+ # for regular arguments, just add them back into the list
+ if arg_string[0] not in self.fromfile_prefix_chars:
+ new_arg_strings.append(arg_string)
+
+ # replace arguments referencing files with the file content
+ else:
+ try:
+ args_file = open(arg_string[1:])
+ try:
+ arg_strings = []
+ for arg_line in args_file.read().splitlines():
+ for arg in self.convert_arg_line_to_args(arg_line):
+ arg_strings.append(arg)
+ arg_strings = self._read_args_from_files(arg_strings)
+ new_arg_strings.extend(arg_strings)
+ finally:
+ args_file.close()
+ except IOError:
+ err = _sys.exc_info()[1]
+ self.error(str(err))
+
+ # return the modified argument list
+ return new_arg_strings
+
+ def convert_arg_line_to_args(self, arg_line):
+ return [arg_line]
+
+ def _match_argument(self, action, arg_strings_pattern):
+ # match the pattern for this action to the arg strings
+ nargs_pattern = self._get_nargs_pattern(action)
+ match = _re.match(nargs_pattern, arg_strings_pattern)
+
+ # raise an exception if we weren't able to find a match
+ if match is None:
+ nargs_errors = {
+ None: _('expected one argument'),
+ OPTIONAL: _('expected at most one argument'),
+ ONE_OR_MORE: _('expected at least one argument'),
+ }
+ default = ngettext('expected %s argument',
+ 'expected %s arguments',
+ action.nargs) % action.nargs
+ msg = nargs_errors.get(action.nargs, default)
+ raise ArgumentError(action, msg)
+
+ # return the number of arguments matched
+ return len(match.group(1))
+
+ def _match_arguments_partial(self, actions, arg_strings_pattern):
+ # progressively shorten the actions list by slicing off the
+ # final actions until we find a match
+ result = []
+ for i in range(len(actions), 0, -1):
+ actions_slice = actions[:i]
+ pattern = ''.join([self._get_nargs_pattern(action)
+ for action in actions_slice])
+ match = _re.match(pattern, arg_strings_pattern)
+ if match is not None:
+ result.extend([len(string) for string in match.groups()])
+ break
+
+ # return the list of arg string counts
+ return result
+
+ def _parse_optional(self, arg_string):
+ # if it's an empty string, it was meant to be a positional
+ if not arg_string:
+ return None
+
+ # if it doesn't start with a prefix, it was meant to be positional
+ if not arg_string[0] in self.prefix_chars:
+ return None
+
+ # if the option string is present in the parser, return the action
+ if arg_string in self._option_string_actions:
+ action = self._option_string_actions[arg_string]
+ return action, arg_string, None
+
+ # if it's just a single character, it was meant to be positional
+ if len(arg_string) == 1:
+ return None
+
+ # if the option string before the "=" is present, return the action
+ if '=' in arg_string:
+ option_string, explicit_arg = arg_string.split('=', 1)
+ if option_string in self._option_string_actions:
+ action = self._option_string_actions[option_string]
+ return action, option_string, explicit_arg
+
+ # search through all possible prefixes of the option string
+ # and all actions in the parser for possible interpretations
+ option_tuples = self._get_option_tuples(arg_string)
+
+ # if multiple actions match, the option string was ambiguous
+ if len(option_tuples) > 1:
+ options = ', '.join([option_string
+ for action, option_string, explicit_arg in option_tuples])
+ args = {'option': arg_string, 'matches': options}
+ msg = _('ambiguous option: %(option)s could match %(matches)s')
+ self.error(msg % args)
+
+ # if exactly one action matched, this segmentation is good,
+ # so return the parsed action
+ elif len(option_tuples) == 1:
+ option_tuple, = option_tuples
+ return option_tuple
+
+ # if it was not found as an option, but it looks like a negative
+ # number, it was meant to be positional
+ # unless there are negative-number-like options
+ if self._negative_number_matcher.match(arg_string):
+ if not self._has_negative_number_optionals:
+ return None
+
+ # if it contains a space, it was meant to be a positional
+ if ' ' in arg_string:
+ return None
+
+ # it was meant to be an optional but there is no such option
+ # in this parser (though it might be a valid option in a subparser)
+ return None, arg_string, None
+
+ def _get_option_tuples(self, option_string):
+ result = []
+
+ # option strings starting with two prefix characters are only
+ # split at the '='
+ chars = self.prefix_chars
+ if option_string[0] in chars and option_string[1] in chars:
+ if '=' in option_string:
+ option_prefix, explicit_arg = option_string.split('=', 1)
+ else:
+ option_prefix = option_string
+ explicit_arg = None
+ for option_string in self._option_string_actions:
+ if option_string.startswith(option_prefix):
+ action = self._option_string_actions[option_string]
+ tup = action, option_string, explicit_arg
+ result.append(tup)
+
+ # single character options can be concatenated with their arguments
+ # but multiple character options always have to have their argument
+ # separate
+ elif option_string[0] in chars and option_string[1] not in chars:
+ option_prefix = option_string
+ explicit_arg = None
+ short_option_prefix = option_string[:2]
+ short_explicit_arg = option_string[2:]
+
+ for option_string in self._option_string_actions:
+ if option_string == short_option_prefix:
+ action = self._option_string_actions[option_string]
+ tup = action, option_string, short_explicit_arg
+ result.append(tup)
+ elif option_string.startswith(option_prefix):
+ action = self._option_string_actions[option_string]
+ tup = action, option_string, explicit_arg
+ result.append(tup)
+
+ # shouldn't ever get here
+ else:
+ self.error(_('unexpected option string: %s') % option_string)
+
+ # return the collected option tuples
+ return result
+
+ def _get_nargs_pattern(self, action):
+ # in all examples below, we have to allow for '--' args
+ # which are represented as '-' in the pattern
+ nargs = action.nargs
+
+ # the default (None) is assumed to be a single argument
+ if nargs is None:
+ nargs_pattern = '(-*A-*)'
+
+ # allow zero or one arguments
+ elif nargs == OPTIONAL:
+ nargs_pattern = '(-*A?-*)'
+
+ # allow zero or more arguments
+ elif nargs == ZERO_OR_MORE:
+ nargs_pattern = '(-*[A-]*)'
+
+ # allow one or more arguments
+ elif nargs == ONE_OR_MORE:
+ nargs_pattern = '(-*A[A-]*)'
+
+ # allow any number of options or arguments
+ elif nargs == REMAINDER:
+ nargs_pattern = '([-AO]*)'
+
+ # allow one argument followed by any number of options or arguments
+ elif nargs == PARSER:
+ nargs_pattern = '(-*A[-AO]*)'
+
+ # all others should be integers
+ else:
+ nargs_pattern = '(-*%s-*)' % '-*'.join('A' * nargs)
+
+ # if this is an optional action, -- is not allowed
+ if action.option_strings:
+ nargs_pattern = nargs_pattern.replace('-*', '')
+ nargs_pattern = nargs_pattern.replace('-', '')
+
+ # return the pattern
+ return nargs_pattern
+
+ # ========================
+ # Value conversion methods
+ # ========================
+ def _get_values(self, action, arg_strings):
+ # for everything but PARSER args, strip out '--'
+ if action.nargs not in [PARSER, REMAINDER]:
+ arg_strings = [s for s in arg_strings if s != '--']
+
+ # optional argument produces a default when not present
+ if not arg_strings and action.nargs == OPTIONAL:
+ if action.option_strings:
+ value = action.const
+ else:
+ value = action.default
+ if isinstance(value, str):
+ value = self._get_value(action, value)
+ self._check_value(action, value)
+
+ # when nargs='*' on a positional, if there were no command-line
+ # args, use the default if it is anything other than None
+ elif (not arg_strings and action.nargs == ZERO_OR_MORE and
+ not action.option_strings):
+ if action.default is not None:
+ value = action.default
+ else:
+ value = arg_strings
+ self._check_value(action, value)
+
+ # single argument or optional argument produces a single value
+ elif len(arg_strings) == 1 and action.nargs in [None, OPTIONAL]:
+ arg_string, = arg_strings
+ value = self._get_value(action, arg_string)
+ self._check_value(action, value)
+
+ # REMAINDER arguments convert all values, checking none
+ elif action.nargs == REMAINDER:
+ value = [self._get_value(action, v) for v in arg_strings]
+
+ # PARSER arguments convert all values, but check only the first
+ elif action.nargs == PARSER:
+ value = [self._get_value(action, v) for v in arg_strings]
+ self._check_value(action, value[0])
+
+ # all other types of nargs produce a list
+ else:
+ value = [self._get_value(action, v) for v in arg_strings]
+ for v in value:
+ self._check_value(action, v)
+
+ # return the converted value
+ return value
+
+ def _get_value(self, action, arg_string):
+ type_func = self._registry_get('type', action.type, action.type)
+ if not _callable(type_func):
+ msg = _('%r is not callable')
+ raise ArgumentError(action, msg % type_func)
+
+ # convert the value to the appropriate type
+ try:
+ result = type_func(arg_string)
+
+ # ArgumentTypeErrors indicate errors
+ except ArgumentTypeError:
+ name = getattr(action.type, '__name__', repr(action.type))
+ msg = str(_sys.exc_info()[1])
+ raise ArgumentError(action, msg)
+
+ # TypeErrors or ValueErrors also indicate errors
+ except (TypeError, ValueError):
+ name = getattr(action.type, '__name__', repr(action.type))
+ args = {'type': name, 'value': arg_string}
+ msg = _('invalid %(type)s value: %(value)r')
+ raise ArgumentError(action, msg % args)
+
+ # return the converted value
+ return result
+
+ def _check_value(self, action, value):
+ # converted value must be one of the choices (if specified)
+ if action.choices is not None and value not in action.choices:
+ args = {'value': value,
+ 'choices': ', '.join(map(repr, action.choices))}
+ msg = _('invalid choice: %(value)r (choose from %(choices)s)')
+ raise ArgumentError(action, msg % args)
+
+ # =======================
+ # Help-formatting methods
+ # =======================
+ def format_usage(self):
+ formatter = self._get_formatter()
+ formatter.add_usage(self.usage, self._actions,
+ self._mutually_exclusive_groups)
+ return formatter.format_help()
+
+ def format_help(self):
+ formatter = self._get_formatter()
+
+ # usage
+ formatter.add_usage(self.usage, self._actions,
+ self._mutually_exclusive_groups)
+
+ # description
+ formatter.add_text(self.description)
+
+ # positionals, optionals and user-defined groups
+ for action_group in self._action_groups:
+ formatter.start_section(action_group.title)
+ formatter.add_text(action_group.description)
+ formatter.add_arguments(action_group._group_actions)
+ formatter.end_section()
+
+ # epilog
+ formatter.add_text(self.epilog)
+
+ # determine help from format above
+ return formatter.format_help()
+
+ def format_version(self):
+ import warnings
+ warnings.warn(
+ 'The format_version method is deprecated -- the "version" '
+ 'argument to ArgumentParser is no longer supported.',
+ DeprecationWarning)
+ formatter = self._get_formatter()
+ formatter.add_text(self.version)
+ return formatter.format_help()
+
+ def _get_formatter(self):
+ return self.formatter_class(prog=self.prog)
+
+ # =====================
+ # Help-printing methods
+ # =====================
+ def print_usage(self, file=None):
+ if file is None:
+ file = _sys.stdout
+ self._print_message(self.format_usage(), file)
+
+ def print_help(self, file=None):
+ if file is None:
+ file = _sys.stdout
+ self._print_message(self.format_help(), file)
+
+ def print_version(self, file=None):
+ import warnings
+ warnings.warn(
+ 'The print_version method is deprecated -- the "version" '
+ 'argument to ArgumentParser is no longer supported.',
+ DeprecationWarning)
+ self._print_message(self.format_version(), file)
+
+ def _print_message(self, message, file=None):
+ if message:
+ if file is None:
+ file = _sys.stderr
+ file.write(message)
+
+ # ===============
+ # Exiting methods
+ # ===============
+ def exit(self, status=0, message=None):
+ if message:
+ self._print_message(message, _sys.stderr)
+ _sys.exit(status)
+
+ def error(self, message):
+ """error(message: string)
+
+ Prints a usage message incorporating the message to stderr and
+ exits.
+
+ If you override this in a subclass, it should not return -- it
+ should either exit or raise an exception.
+ """
+ self.print_usage(_sys.stderr)
+ args = {'prog': self.prog, 'message': message}
+ self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
diff --git a/Lib/ast.py b/Lib/ast.py
index 112c9701f1..fb5adac8fd 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
ast
~~~
@@ -41,8 +40,8 @@ def literal_eval(node_or_string):
"""
Safely evaluate an expression node or a string containing a Python
expression. The string or node provided may only consist of the following
- Python literal structures: strings, numbers, tuples, lists, dicts, booleans,
- and None.
+ Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
+ sets, booleans, and None.
"""
_safe_names = {'None': None, 'True': True, 'False': False}
if isinstance(node_or_string, str):
@@ -50,7 +49,7 @@ def literal_eval(node_or_string):
if isinstance(node_or_string, Expression):
node_or_string = node_or_string.body
def _convert(node):
- if isinstance(node, Str):
+ if isinstance(node, (Str, Bytes)):
return node.s
elif isinstance(node, Num):
return node.n
@@ -58,25 +57,33 @@ def literal_eval(node_or_string):
return tuple(map(_convert, node.elts))
elif isinstance(node, List):
return list(map(_convert, node.elts))
+ elif isinstance(node, Set):
+ return set(map(_convert, node.elts))
elif isinstance(node, Dict):
return dict((_convert(k), _convert(v)) for k, v
in zip(node.keys, node.values))
elif isinstance(node, Name):
if node.id in _safe_names:
return _safe_names[node.id]
+ elif isinstance(node, UnaryOp) and \
+ isinstance(node.op, (UAdd, USub)) and \
+ isinstance(node.operand, (Num, UnaryOp, BinOp)):
+ operand = _convert(node.operand)
+ if isinstance(node.op, UAdd):
+ return + operand
+ else:
+ return - operand
elif isinstance(node, BinOp) and \
isinstance(node.op, (Add, Sub)) and \
- isinstance(node.right, Num) and \
- isinstance(node.right.n, complex) and \
- isinstance(node.left, Num) and \
- isinstance(node.left.n, (int, float)):
- left = node.left.n
- right = node.right.n
+ isinstance(node.right, (Num, UnaryOp, BinOp)) and \
+ isinstance(node.left, (Num, UnaryOp, BinOp)):
+ left = _convert(node.left)
+ right = _convert(node.right)
if isinstance(node.op, Add):
return left + right
else:
return left - right
- raise ValueError('malformed string')
+ raise ValueError('malformed node or string: ' + repr(node))
return _convert(node_or_string)
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index 00464a9427..5d7bddaf84 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -50,10 +50,12 @@ import select
import socket
import sys
import time
+import warnings
+
import os
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
- ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, EPIPE, \
- EAGAIN, errorcode
+ ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, EPIPE, EAGAIN, \
+ errorcode
_DISCONNECTED = frozenset((ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE,
EBADF))
@@ -270,6 +272,8 @@ class dispatcher:
status.append(repr(self.addr))
return '<%s at %#x>' % (' '.join(status), id(self))
+ __str__ = __repr__
+
def add_channel(self, map=None):
#self.log_info('adding channel %s' % self)
if map is None:
@@ -367,7 +371,7 @@ class dispatcher:
except socket.error as why:
if why.args[0] == EWOULDBLOCK:
return 0
- elif why.args[0] in (ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED):
+ elif why.args[0] in _DISCONNECTED:
self.handle_close()
return 0
else:
@@ -385,7 +389,7 @@ class dispatcher:
return data
except socket.error as why:
# winsock sometimes throws ENOTCONN
- if why.args[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED]:
+ if why.args[0] in _DISCONNECTED:
self.handle_close()
return b''
else:
@@ -405,10 +409,15 @@ class dispatcher:
# references to the underlying socket object.
def __getattr__(self, attr):
try:
- return getattr(self.socket, attr)
+ retattr = getattr(self.socket, attr)
except AttributeError:
raise AttributeError("%s instance has no attribute '%s'"
%(self.__class__.__name__, attr))
+ else:
+ msg = "%(me)s.%(attr)s is deprecated; use %(me)s.socket.%(attr)s " \
+ "instead" % {'me' : self.__class__.__name__, 'attr' : attr}
+ warnings.warn(msg, DeprecationWarning, stacklevel=2)
+ return retattr
# log and log_info may be overridden to provide more sophisticated
# logging and warning methods. In general, log is for 'hit' logging
@@ -502,7 +511,13 @@ class dispatcher:
self.log_info('unhandled connect event', 'warning')
def handle_accept(self):
- self.log_info('unhandled accept event', 'warning')
+ pair = self.accept()
+ if pair is not None:
+ self.handle_accepted(*pair)
+
+ def handle_accepted(self, sock, addr):
+ sock.close()
+ self.log_info('unhandled accepted event', 'warning')
def handle_close(self):
self.log_info('unhandled close event', 'warning')
diff --git a/Lib/base64.py b/Lib/base64.py
index f93b3a4f81..895d813f7e 100755
--- a/Lib/base64.py
+++ b/Lib/base64.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
@@ -65,16 +65,19 @@ def b64encode(s, altchars=None):
return encoded
-def b64decode(s, altchars=None):
+def b64decode(s, altchars=None, validate=False):
"""Decode a Base64 encoded byte string.
s is the byte string to decode. Optional altchars must be a
string of length 2 which specifies the alternative alphabet used
instead of the '+' and '/' characters.
- The decoded byte string is returned. binascii.Error is raised if
- s were incorrectly padded or if there are non-alphabet characters
- present in the string.
+ The decoded string is returned. A binascii.Error is raised if s is
+ incorrectly padded.
+
+ If validate is False (the default), non-base64-alphabet characters are
+ discarded prior to the padding check. If validate is True,
+ non-base64-alphabet characters in the input result in a binascii.Error.
"""
if not isinstance(s, bytes_types):
raise TypeError("expected bytes, not %s" % s.__class__.__name__)
@@ -84,6 +87,8 @@ def b64decode(s, altchars=None):
% altchars.__class__.__name__)
assert len(altchars) == 2, repr(altchars)
s = _translate(s, {chr(altchars[0]): b'+', chr(altchars[1]): b'/'})
+ if validate and not re.match(b'^[A-Za-z0-9+/]*={0,2}$', s):
+ raise binascii.Error('Non-base64 digit found')
return binascii.a2b_base64(s)
@@ -241,7 +246,7 @@ def b32decode(s, casefold=False, map01=None):
acc += _b32rev[c] << shift
shift -= 5
if shift < 0:
- parts.append(binascii.unhexlify('%010x' % acc))
+ parts.append(binascii.unhexlify(bytes('%010x' % acc, "ascii")))
acc = 0
shift = 35
# Process the last, partial quanta
diff --git a/Lib/bdb.py b/Lib/bdb.py
index 3ed25fe101..f711004483 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -3,16 +3,14 @@
import fnmatch
import sys
import os
-import types
-__all__ = ["BdbQuit","Bdb","Breakpoint"]
+__all__ = ["BdbQuit", "Bdb", "Breakpoint"]
class BdbQuit(Exception):
- """Exception to give up completely"""
+ """Exception to give up completely."""
class Bdb:
-
"""Generic Python debugger base class.
This class takes care of details of the trace facility;
@@ -120,14 +118,14 @@ class Bdb:
def break_here(self, frame):
filename = self.canonic(frame.f_code.co_filename)
- if not filename in self.breaks:
+ if filename not in self.breaks:
return False
lineno = frame.f_lineno
- if not lineno in self.breaks[filename]:
+ if lineno not in self.breaks[filename]:
# The line itself has no breakpoint, but maybe the line is the
# first line of a function with breakpoint set by function name.
lineno = frame.f_code.co_firstlineno
- if not lineno in self.breaks[filename]:
+ if lineno not in self.breaks[filename]:
return False
# flag says ok to delete temp. bp
@@ -170,7 +168,7 @@ class Bdb:
def _set_stopinfo(self, stopframe, returnframe, stoplineno=0):
self.stopframe = stopframe
self.returnframe = returnframe
- self.quitting = 0
+ self.quitting = False
# stoplineno >= 0 means: stop at line >= the stoplineno
# stoplineno -1 means: don't stop at all
self.stoplineno = stoplineno
@@ -178,10 +176,13 @@ class Bdb:
# Derived classes and clients can call the following methods
# to affect the stepping state.
- def set_until(self, frame): #the name "until" is borrowed from gdb
+ def set_until(self, frame, lineno=None):
"""Stop when the line with the line no greater than the current one is
reached or when returning from current frame"""
- self._set_stopinfo(frame, frame, frame.f_lineno+1)
+ # the name "until" is borrowed from gdb
+ if lineno is None:
+ lineno = frame.f_lineno + 1
+ self._set_stopinfo(frame, frame, lineno)
def set_step(self):
"""Stop after one line of code."""
@@ -224,7 +225,7 @@ class Bdb:
def set_quit(self):
self.stopframe = self.botframe
self.returnframe = None
- self.quitting = 1
+ self.quitting = True
sys.settrace(None)
# Derived classes and clients can call the following methods
@@ -234,18 +235,15 @@ class Bdb:
# Call self.get_*break*() to see the breakpoints or better
# for bp in Breakpoint.bpbynumber: if bp: bp.bpprint().
- def set_break(self, filename, lineno, temporary=0, cond = None,
+ def set_break(self, filename, lineno, temporary=False, cond=None,
funcname=None):
filename = self.canonic(filename)
import linecache # Import as late as possible
line = linecache.getline(filename, lineno)
if not line:
- return 'Line %s:%d does not exist' % (filename,
- lineno)
- if not filename in self.breaks:
- self.breaks[filename] = []
- list = self.breaks[filename]
- if not lineno in list:
+ return 'Line %s:%d does not exist' % (filename, lineno)
+ list = self.breaks.setdefault(filename, [])
+ if lineno not in list:
list.append(lineno)
bp = Breakpoint(filename, lineno, temporary, cond, funcname)
@@ -257,11 +255,10 @@ class Bdb:
def clear_break(self, filename, lineno):
filename = self.canonic(filename)
- if not filename in self.breaks:
+ if filename not in self.breaks:
return 'There are no breakpoints in %s' % filename
if lineno not in self.breaks[filename]:
- return 'There is no breakpoint at %s:%d' % (filename,
- lineno)
+ return 'There is no breakpoint at %s:%d' % (filename, lineno)
# If there's only one bp in the list for that file,line
# pair, then remove the breaks entry
for bp in Breakpoint.bplist[filename, lineno][:]:
@@ -270,21 +267,15 @@ class Bdb:
def clear_bpbynumber(self, arg):
try:
- number = int(arg)
- except:
- return 'Non-numeric breakpoint number (%s)' % arg
- try:
- bp = Breakpoint.bpbynumber[number]
- except IndexError:
- return 'Breakpoint number (%d) out of range' % number
- if not bp:
- return 'Breakpoint (%d) already deleted' % number
+ bp = self.get_bpbynumber(arg)
+ except ValueError as err:
+ return str(err)
bp.deleteMe()
self._prune_breaks(bp.file, bp.line)
def clear_all_file_breaks(self, filename):
filename = self.canonic(filename)
- if not filename in self.breaks:
+ if filename not in self.breaks:
return 'There are no breakpoints in %s' % filename
for line in self.breaks[filename]:
blist = Breakpoint.bplist[filename, line]
@@ -300,6 +291,21 @@ class Bdb:
bp.deleteMe()
self.breaks = {}
+ def get_bpbynumber(self, arg):
+ if not arg:
+ raise ValueError('Breakpoint number expected')
+ try:
+ number = int(arg)
+ except ValueError:
+ raise ValueError('Non-numeric breakpoint number %s' % arg)
+ try:
+ bp = Breakpoint.bpbynumber[number]
+ except IndexError:
+ raise ValueError('Breakpoint number %d out of range' % number)
+ if bp is None:
+ raise ValueError('Breakpoint %d already deleted' % number)
+ return bp
+
def get_break(self, filename, lineno):
filename = self.canonic(filename)
return filename in self.breaks and \
@@ -342,35 +348,35 @@ class Bdb:
i = max(0, len(stack) - 1)
return stack, i
- #
-
def format_stack_entry(self, frame_lineno, lprefix=': '):
import linecache, reprlib
frame, lineno = frame_lineno
filename = self.canonic(frame.f_code.co_filename)
s = '%s(%r)' % (filename, lineno)
if frame.f_code.co_name:
- s = s + frame.f_code.co_name
+ s += frame.f_code.co_name
else:
- s = s + "<lambda>"
+ s += "<lambda>"
if '__args__' in frame.f_locals:
args = frame.f_locals['__args__']
else:
args = None
if args:
- s = s + reprlib.repr(args)
+ s += reprlib.repr(args)
else:
- s = s + '()'
+ s += '()'
if '__return__' in frame.f_locals:
rv = frame.f_locals['__return__']
- s = s + '->'
- s = s + reprlib.repr(rv)
+ s += '->'
+ s += reprlib.repr(rv)
line = linecache.getline(filename, lineno, frame.f_globals)
- if line: s = s + lprefix + line.strip()
+ if line:
+ s += lprefix + line.strip()
return s
- # The following two methods can be called by clients to use
- # a debugger to debug a statement, given as a string.
+ # The following methods can be called by clients to use
+ # a debugger to debug a statement or an expression.
+ # Both can be given as a string, or a code object.
def run(self, cmd, globals=None, locals=None):
if globals is None:
@@ -379,15 +385,15 @@ class Bdb:
if locals is None:
locals = globals
self.reset()
+ if isinstance(cmd, str):
+ cmd = compile(cmd, "<string>", "exec")
sys.settrace(self.trace_dispatch)
- if not isinstance(cmd, types.CodeType):
- cmd = cmd+'\n'
try:
exec(cmd, globals, locals)
except BdbQuit:
pass
finally:
- self.quitting = 1
+ self.quitting = True
sys.settrace(None)
def runeval(self, expr, globals=None, locals=None):
@@ -398,14 +404,12 @@ class Bdb:
locals = globals
self.reset()
sys.settrace(self.trace_dispatch)
- if not isinstance(expr, types.CodeType):
- expr = expr+'\n'
try:
return eval(expr, globals, locals)
except BdbQuit:
pass
finally:
- self.quitting = 1
+ self.quitting = True
sys.settrace(None)
def runctx(self, cmd, globals, locals):
@@ -423,7 +427,7 @@ class Bdb:
except BdbQuit:
pass
finally:
- self.quitting = 1
+ self.quitting = True
sys.settrace(None)
return res
@@ -433,8 +437,7 @@ def set_trace():
class Breakpoint:
-
- """Breakpoint class
+ """Breakpoint class.
Implements temporary breakpoints, ignore counts, disabling and
(re)-enabling, and conditionals.
@@ -456,7 +459,7 @@ class Breakpoint:
# index 0 is unused, except for marking an
# effective break .... see effective()
- def __init__(self, file, line, temporary=0, cond=None, funcname=None):
+ def __init__(self, file, line, temporary=False, cond=None, funcname=None):
self.funcname = funcname
# Needed if funcname is not None.
self.func_first_executable_line = None
@@ -464,11 +467,11 @@ class Breakpoint:
self.line = line
self.temporary = temporary
self.cond = cond
- self.enabled = 1
+ self.enabled = True
self.ignore = 0
self.hits = 0
self.number = Breakpoint.next
- Breakpoint.next = Breakpoint.next + 1
+ Breakpoint.next += 1
# Build the two lists
self.bpbynumber.append(self)
if (file, line) in self.bplist:
@@ -476,7 +479,6 @@ class Breakpoint:
else:
self.bplist[file, line] = [self]
-
def deleteMe(self):
index = (self.file, self.line)
self.bpbynumber[self.number] = None # No longer in list
@@ -486,14 +488,17 @@ class Breakpoint:
del self.bplist[index]
def enable(self):
- self.enabled = 1
+ self.enabled = True
def disable(self):
- self.enabled = 0
+ self.enabled = False
def bpprint(self, out=None):
if out is None:
out = sys.stdout
+ print(self.bpformat(), file=out)
+
+ def bpformat(self):
if self.temporary:
disp = 'del '
else:
@@ -502,17 +507,22 @@ class Breakpoint:
disp = disp + 'yes '
else:
disp = disp + 'no '
- print('%-4dbreakpoint %s at %s:%d' % (self.number, disp,
- self.file, self.line), file=out)
+ ret = '%-4dbreakpoint %s at %s:%d' % (self.number, disp,
+ self.file, self.line)
if self.cond:
- print('\tstop only if %s' % (self.cond,), file=out)
+ ret += '\n\tstop only if %s' % (self.cond,)
if self.ignore:
- print('\tignore next %d hits' % (self.ignore), file=out)
- if (self.hits):
- if (self.hits > 1): ss = 's'
- else: ss = ''
- print(('\tbreakpoint already hit %d time%s' %
- (self.hits, ss)), file=out)
+ ret += '\n\tignore next %d hits' % (self.ignore,)
+ if self.hits:
+ if self.hits > 1:
+ ss = 's'
+ else:
+ ss = ''
+ ret += '\n\tbreakpoint already hit %d time%s' % (self.hits, ss)
+ return ret
+
+ def __str__(self):
+ return 'breakpoint %s at %s:%s' % (self.number, self.file, self.line)
# -----------end of Breakpoint class----------
@@ -552,49 +562,44 @@ def effective(file, line, frame):
that indicates if it is ok to delete a temporary bp.
"""
- possibles = Breakpoint.bplist[file,line]
- for i in range(0, len(possibles)):
- b = possibles[i]
- if b.enabled == 0:
+ possibles = Breakpoint.bplist[file, line]
+ for b in possibles:
+ if not b.enabled:
continue
if not checkfuncname(b, frame):
continue
# Count every hit when bp is enabled
- b.hits = b.hits + 1
+ b.hits += 1
if not b.cond:
- # If unconditional, and ignoring,
- # go on to next, else break
+ # If unconditional, and ignoring go on to next, else break
if b.ignore > 0:
- b.ignore = b.ignore -1
+ b.ignore -= 1
continue
else:
- # breakpoint and marker that's ok
- # to delete if temporary
- return (b,1)
+ # breakpoint and marker that it's ok to delete if temporary
+ return (b, True)
else:
# Conditional bp.
# Ignore count applies only to those bpt hits where the
# condition evaluates to true.
try:
- val = eval(b.cond, frame.f_globals,
- frame.f_locals)
+ val = eval(b.cond, frame.f_globals, frame.f_locals)
if val:
if b.ignore > 0:
- b.ignore = b.ignore -1
+ b.ignore -= 1
# continue
else:
- return (b,1)
+ return (b, True)
# else:
# continue
except:
- # if eval fails, most conservative
- # thing is to stop on breakpoint
- # regardless of ignore count.
- # Don't delete temporary,
- # as another hint to user.
- return (b,0)
+ # if eval fails, most conservative thing is to stop on
+ # breakpoint regardless of ignore count. Don't delete
+ # temporary, as another hint to user.
+ return (b, False)
return (None, None)
+
# -------------------- testing --------------------
class Tdb(Bdb):
@@ -627,5 +632,3 @@ def bar(a):
def test():
t = Tdb()
t.run('import bdb; bdb.foo(10)')
-
-# end
diff --git a/Lib/binhex.py b/Lib/binhex.py
index 4b7997a710..999a675513 100644
--- a/Lib/binhex.py
+++ b/Lib/binhex.py
@@ -52,14 +52,13 @@ class FInfo:
def getfileinfo(name):
finfo = FInfo()
- fp = io.open(name, 'rb')
- # Quick check for textfile
- data = fp.read(512)
- if 0 not in data:
- finfo.Type = 'TEXT'
- fp.seek(0, 2)
- dsize = fp.tell()
- fp.close()
+ with io.open(name, 'rb') as fp:
+ # Quick check for textfile
+ data = fp.read(512)
+ if 0 not in data:
+ finfo.Type = 'TEXT'
+ fp.seek(0, 2)
+ dsize = fp.tell()
dir, file = os.path.split(name)
file = file.replace(':', '-', 1)
return file, finfo, dsize, 0
@@ -140,19 +139,26 @@ class _Rlecoderengine:
class BinHex:
def __init__(self, name_finfo_dlen_rlen, ofp):
name, finfo, dlen, rlen = name_finfo_dlen_rlen
+ close_on_error = False
if isinstance(ofp, str):
ofname = ofp
ofp = io.open(ofname, 'wb')
- ofp.write(b'(This file must be converted with BinHex 4.0)\r\r:')
- hqxer = _Hqxcoderengine(ofp)
- self.ofp = _Rlecoderengine(hqxer)
- self.crc = 0
- if finfo is None:
- finfo = FInfo()
- self.dlen = dlen
- self.rlen = rlen
- self._writeinfo(name, finfo)
- self.state = _DID_HEADER
+ close_on_error = True
+ try:
+ ofp.write(b'(This file must be converted with BinHex 4.0)\r\r:')
+ hqxer = _Hqxcoderengine(ofp)
+ self.ofp = _Rlecoderengine(hqxer)
+ self.crc = 0
+ if finfo is None:
+ finfo = FInfo()
+ self.dlen = dlen
+ self.rlen = rlen
+ self._writeinfo(name, finfo)
+ self.state = _DID_HEADER
+ except:
+ if close_on_error:
+ ofp.close()
+ raise
def _writeinfo(self, name, finfo):
nl = len(name)
diff --git a/Lib/cProfile.py b/Lib/cProfile.py
index 3e924ba28a..c24d45bab4 100755
--- a/Lib/cProfile.py
+++ b/Lib/cProfile.py
@@ -1,10 +1,10 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Python interface for the 'lsprof' profiler.
Compatible with the 'profile' module.
"""
-__all__ = ["run", "runctx", "help", "Profile"]
+__all__ = ["run", "runctx", "Profile"]
import _lsprof
@@ -56,11 +56,6 @@ def runctx(statement, globals, locals, filename=None, sort=-1):
result = prof.print_stats(sort)
return result
-# Backwards compatibility.
-def help():
- print("Documentation for the profile/cProfile modules can be found ")
- print("in the Python Library Reference, section 'The Python Profiler'.")
-
# ____________________________________________________________
class Profile(_lsprof.Profiler):
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 7da2b23f6e..e198ed8653 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -31,13 +31,15 @@ __version__ = "2.6"
# Imports
# =======
-from operator import attrgetter
-from io import StringIO
+from io import StringIO, BytesIO, TextIOWrapper
import sys
import os
import urllib.parse
-import email.parser
+from email.parser import FeedParser
from warnings import warn
+import html
+import locale
+import tempfile
__all__ = ["MiniFieldStorage", "FieldStorage",
"parse", "parse_qs", "parse_qsl", "parse_multipart",
@@ -109,7 +111,7 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
Arguments, all optional:
- fp : file pointer; default: sys.stdin
+ fp : file pointer; default: sys.stdin.buffer
environ : environment dictionary; default: os.environ
@@ -126,6 +128,18 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
"""
if fp is None:
fp = sys.stdin
+
+ # field keys and values (except for files) are returned as strings
+ # an encoding is required to decode the bytes read from self.fp
+ if hasattr(fp,'encoding'):
+ encoding = fp.encoding
+ else:
+ encoding = 'latin-1'
+
+ # fp.read() must return bytes
+ if isinstance(fp, TextIOWrapper):
+ fp = fp.buffer
+
if not 'REQUEST_METHOD' in environ:
environ['REQUEST_METHOD'] = 'GET' # For testing stand-alone
if environ['REQUEST_METHOD'] == 'POST':
@@ -136,7 +150,7 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
clength = int(environ['CONTENT_LENGTH'])
if maxlen and clength > maxlen:
raise ValueError('Maximum content length exceeded')
- qs = fp.read(clength)
+ qs = fp.read(clength).decode(encoding)
else:
qs = '' # Unknown content-type
if 'QUERY_STRING' in environ:
@@ -154,7 +168,8 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
else:
qs = ""
environ['QUERY_STRING'] = qs # XXX Shouldn't, really
- return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing)
+ return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing,
+ encoding=encoding)
# parse query string function called from urlparse,
@@ -236,8 +251,8 @@ def parse_multipart(fp, pdict):
if not line:
terminator = lastpart # End outer loop
break
- if line[:2] == "--":
- terminator = line.strip()
+ if line.startswith("--"):
+ terminator = line.rstrip()
if terminator in (nextpart, lastpart):
break
lines.append(line)
@@ -352,9 +367,10 @@ class FieldStorage:
value: the value as a *string*; for file uploads, this
transparently reads the file every time you request the value
+ and returns *bytes*
- file: the file(-like) object from which you can read the data;
- None if the data is stored a simple string
+ file: the file(-like) object from which you can read the data *as
+ bytes* ; None if the data is stored a simple string
type: the content-type, or None if not specified
@@ -375,15 +391,18 @@ class FieldStorage:
directory and unlinking them as soon as they have been opened.
"""
-
- def __init__(self, fp=None, headers=None, outerboundary="",
- environ=os.environ, keep_blank_values=0, strict_parsing=0):
+ def __init__(self, fp=None, headers=None, outerboundary=b'',
+ environ=os.environ, keep_blank_values=0, strict_parsing=0,
+ limit=None, encoding='utf-8', errors='replace'):
"""Constructor. Read multipart/* until last part.
Arguments, all optional:
- fp : file pointer; default: sys.stdin
+ fp : file pointer; default: sys.stdin.buffer
(not used when the request method is GET)
+ Can be :
+ 1. a TextIOWrapper object
+ 2. an object whose read() and readline() methods return bytes
headers : header dictionary-like object; default:
taken from environ as per CGI spec
@@ -404,6 +423,16 @@ class FieldStorage:
If false (the default), errors are silently ignored.
If true, errors raise a ValueError exception.
+ limit : used internally to read parts of multipart/form-data forms,
+ to exit from the reading loop when reached. It is the difference
+ between the form content-length and the number of bytes already
+ read
+
+ encoding, errors : the encoding and error handler used to decode the
+ binary stream to strings. Must be the same as the charset defined
+ for the page sending the form (content-type : meta http-equiv or
+ header)
+
"""
method = 'GET'
self.keep_blank_values = keep_blank_values
@@ -418,7 +447,8 @@ class FieldStorage:
qs = sys.argv[1]
else:
qs = ""
- fp = StringIO(qs)
+ qs = qs.encode(locale.getpreferredencoding(), 'surrogateescape')
+ fp = BytesIO(qs)
if headers is None:
headers = {'content-type':
"application/x-www-form-urlencoded"}
@@ -433,10 +463,26 @@ class FieldStorage:
self.qs_on_post = environ['QUERY_STRING']
if 'CONTENT_LENGTH' in environ:
headers['content-length'] = environ['CONTENT_LENGTH']
- self.fp = fp or sys.stdin
+ if fp is None:
+ self.fp = sys.stdin.buffer
+ # self.fp.read() must return bytes
+ elif isinstance(fp, TextIOWrapper):
+ self.fp = fp.buffer
+ else:
+ self.fp = fp
+
+ self.encoding = encoding
+ self.errors = errors
+
self.headers = headers
+ if not isinstance(outerboundary, bytes):
+ raise TypeError('outerboundary must be bytes, not %s'
+ % type(outerboundary).__name__)
self.outerboundary = outerboundary
+ self.bytes_read = 0
+ self.limit = limit
+
# Process content-disposition header
cdisp, pdict = "", {}
if 'content-disposition' in self.headers:
@@ -449,6 +495,7 @@ class FieldStorage:
self.filename = None
if 'filename' in pdict:
self.filename = pdict['filename']
+ self._binary_file = self.filename is not None
# Process content-type header
#
@@ -470,9 +517,11 @@ class FieldStorage:
ctype, pdict = 'application/x-www-form-urlencoded', {}
self.type = ctype
self.type_options = pdict
- self.innerboundary = ""
if 'boundary' in pdict:
- self.innerboundary = pdict['boundary']
+ self.innerboundary = pdict['boundary'].encode(self.encoding)
+ else:
+ self.innerboundary = b""
+
clen = -1
if 'content-length' in self.headers:
try:
@@ -482,6 +531,8 @@ class FieldStorage:
if maxlen and clen > maxlen:
raise ValueError('Maximum content length exceeded')
self.length = clen
+ if self.limit is None and clen:
+ self.limit = clen
self.list = self.file = None
self.done = 0
@@ -531,7 +582,7 @@ class FieldStorage:
"""Dictionary style get() method, including 'value' lookup."""
if key in self:
value = self[key]
- if type(value) is type([]):
+ if isinstance(value, list):
return [x.value for x in value]
else:
return value.value
@@ -542,7 +593,7 @@ class FieldStorage:
""" Return the first value received."""
if key in self:
value = self[key]
- if type(value) is type([]):
+ if isinstance(value, list):
return value[0].value
else:
return value.value
@@ -553,7 +604,7 @@ class FieldStorage:
""" Return list of received values."""
if key in self:
value = self[key]
- if type(value) is type([]):
+ if isinstance(value, list):
return [x.value for x in value]
else:
return [value.value]
@@ -582,12 +633,18 @@ class FieldStorage:
def read_urlencoded(self):
"""Internal: read data in query string format."""
qs = self.fp.read(self.length)
+ if not isinstance(qs, bytes):
+ raise ValueError("%s should return bytes, got %s" \
+ % (self.fp, type(qs).__name__))
+ qs = qs.decode(self.encoding, self.errors)
if self.qs_on_post:
qs += '&' + self.qs_on_post
- self.list = list = []
- for key, value in urllib.parse.parse_qsl(qs, self.keep_blank_values,
- self.strict_parsing):
- list.append(MiniFieldStorage(key, value))
+ self.list = []
+ query = urllib.parse.parse_qsl(
+ qs, self.keep_blank_values, self.strict_parsing,
+ encoding=self.encoding, errors=self.errors)
+ for key, value in query:
+ self.list.append(MiniFieldStorage(key, value))
self.skip_lines()
FieldStorageClass = None
@@ -599,24 +656,42 @@ class FieldStorage:
raise ValueError('Invalid boundary in multipart form: %r' % (ib,))
self.list = []
if self.qs_on_post:
- for key, value in urllib.parse.parse_qsl(self.qs_on_post,
- self.keep_blank_values, self.strict_parsing):
+ query = urllib.parse.parse_qsl(
+ self.qs_on_post, self.keep_blank_values, self.strict_parsing,
+ encoding=self.encoding, errors=self.errors)
+ for key, value in query:
self.list.append(MiniFieldStorage(key, value))
FieldStorageClass = None
klass = self.FieldStorageClass or self.__class__
- parser = email.parser.FeedParser()
- # Create bogus content-type header for proper multipart parsing
- parser.feed('Content-Type: %s; boundary=%s\r\n\r\n' % (self.type, ib))
- parser.feed(self.fp.read())
- full_msg = parser.close()
- # Get subparts
- msgs = full_msg.get_payload()
- for msg in msgs:
- fp = StringIO(msg.get_payload())
- part = klass(fp, msg, ib, environ, keep_blank_values,
- strict_parsing)
+ first_line = self.fp.readline() # bytes
+ if not isinstance(first_line, bytes):
+ raise ValueError("%s should return bytes, got %s" \
+ % (self.fp, type(first_line).__name__))
+ self.bytes_read += len(first_line)
+ # first line holds boundary ; ignore it, or check that
+ # b"--" + ib == first_line.strip() ?
+ while True:
+ parser = FeedParser()
+ hdr_text = b""
+ while True:
+ data = self.fp.readline()
+ hdr_text += data
+ if not data.strip():
+ break
+ if not hdr_text:
+ break
+ # parser takes strings, not bytes
+ self.bytes_read += len(hdr_text)
+ parser.feed(hdr_text.decode(self.encoding, self.errors))
+ headers = parser.close()
+ part = klass(self.fp, headers, ib, environ, keep_blank_values,
+ strict_parsing,self.limit-self.bytes_read,
+ self.encoding, self.errors)
+ self.bytes_read += part.bytes_read
self.list.append(part)
+ if self.bytes_read >= self.length:
+ break
self.skip_lines()
def read_single(self):
@@ -636,7 +711,11 @@ class FieldStorage:
todo = self.length
if todo >= 0:
while todo > 0:
- data = self.fp.read(min(todo, self.bufsize))
+ data = self.fp.read(min(todo, self.bufsize)) # bytes
+ if not isinstance(data, bytes):
+ raise ValueError("%s should return bytes, got %s"
+ % (self.fp, type(data).__name__))
+ self.bytes_read += len(data)
if not data:
self.done = -1
break
@@ -645,59 +724,77 @@ class FieldStorage:
def read_lines(self):
"""Internal: read lines until EOF or outerboundary."""
- self.file = self.__file = StringIO()
+ if self._binary_file:
+ self.file = self.__file = BytesIO() # store data as bytes for files
+ else:
+ self.file = self.__file = StringIO() # as strings for other fields
if self.outerboundary:
self.read_lines_to_outerboundary()
else:
self.read_lines_to_eof()
def __write(self, line):
+ """line is always bytes, not string"""
if self.__file is not None:
if self.__file.tell() + len(line) > 1000:
self.file = self.make_file()
data = self.__file.getvalue()
self.file.write(data)
self.__file = None
- self.file.write(line)
+ if self._binary_file:
+ # keep bytes
+ self.file.write(line)
+ else:
+ # decode to string
+ self.file.write(line.decode(self.encoding, self.errors))
def read_lines_to_eof(self):
"""Internal: read lines until EOF."""
while 1:
- line = self.fp.readline(1<<16)
+ line = self.fp.readline(1<<16) # bytes
+ self.bytes_read += len(line)
if not line:
self.done = -1
break
self.__write(line)
def read_lines_to_outerboundary(self):
- """Internal: read lines until outerboundary."""
- next = "--" + self.outerboundary
- last = next + "--"
- delim = ""
+ """Internal: read lines until outerboundary.
+ Data is read as bytes: boundaries and line ends must be converted
+ to bytes for comparisons.
+ """
+ next_boundary = b"--" + self.outerboundary
+ last_boundary = next_boundary + b"--"
+ delim = b""
last_line_lfend = True
+ _read = 0
while 1:
- line = self.fp.readline(1<<16)
+ if _read >= self.limit:
+ break
+ line = self.fp.readline(1<<16) # bytes
+ self.bytes_read += len(line)
+ _read += len(line)
if not line:
self.done = -1
break
- if line[:2] == "--" and last_line_lfend:
- strippedline = line.strip()
- if strippedline == next:
+ if line.startswith(b"--") and last_line_lfend:
+ strippedline = line.rstrip()
+ if strippedline == next_boundary:
break
- if strippedline == last:
+ if strippedline == last_boundary:
self.done = 1
break
odelim = delim
- if line[-2:] == "\r\n":
- delim = "\r\n"
+ if line.endswith(b"\r\n"):
+ delim = b"\r\n"
line = line[:-2]
last_line_lfend = True
- elif line[-1] == "\n":
- delim = "\n"
+ elif line.endswith(b"\n"):
+ delim = b"\n"
line = line[:-1]
last_line_lfend = True
else:
- delim = ""
+ delim = b""
last_line_lfend = False
self.__write(odelim + line)
@@ -705,22 +802,23 @@ class FieldStorage:
"""Internal: skip lines until outer boundary if defined."""
if not self.outerboundary or self.done:
return
- next = "--" + self.outerboundary
- last = next + "--"
+ next_boundary = b"--" + self.outerboundary
+ last_boundary = next_boundary + b"--"
last_line_lfend = True
- while 1:
+ while True:
line = self.fp.readline(1<<16)
+ self.bytes_read += len(line)
if not line:
self.done = -1
break
- if line[:2] == "--" and last_line_lfend:
+ if line.endswith(b"--") and last_line_lfend:
strippedline = line.strip()
- if strippedline == next:
+ if strippedline == next_boundary:
break
- if strippedline == last:
+ if strippedline == last_boundary:
self.done = 1
break
- last_line_lfend = line.endswith('\n')
+ last_line_lfend = line.endswith(b'\n')
def make_file(self):
"""Overridable: return a readable & writable file.
@@ -730,7 +828,8 @@ class FieldStorage:
- seek(0)
- data is read from it
- The file is always opened in text mode.
+ The file is opened in binary mode for files, in text mode
+ for other fields
This version opens a temporary file for reading and writing,
and immediately deletes (unlinks) it. The trick (on Unix!) is
@@ -745,8 +844,11 @@ class FieldStorage:
which unlinks the temporary files you have created.
"""
- import tempfile
- return tempfile.TemporaryFile("w+", encoding="utf-8", newline="\n")
+ if self._binary_file:
+ return tempfile.TemporaryFile("wb+")
+ else:
+ return tempfile.TemporaryFile("w+",
+ encoding=self.encoding, newline = '\n')
# Test/debug code
@@ -800,8 +902,8 @@ def print_exception(type=None, value=None, tb=None, limit=None):
list = traceback.format_tb(tb, limit) + \
traceback.format_exception_only(type, value)
print("<PRE>%s<B>%s</B></PRE>" % (
- escape("".join(list[:-1])),
- escape(list[-1]),
+ html.escape("".join(list[:-1])),
+ html.escape(list[-1]),
))
del tb
@@ -812,7 +914,7 @@ def print_environ(environ=os.environ):
print("<H3>Shell Environment:</H3>")
print("<DL>")
for key in keys:
- print("<DT>", escape(key), "<DD>", escape(environ[key]))
+ print("<DT>", html.escape(key), "<DD>", html.escape(environ[key]))
print("</DL>")
print()
@@ -825,10 +927,10 @@ def print_form(form):
print("<P>No form fields.")
print("<DL>")
for key in keys:
- print("<DT>" + escape(key) + ":", end=' ')
+ print("<DT>" + html.escape(key) + ":", end=' ')
value = form[key]
- print("<i>" + escape(repr(type(value))) + "</i>")
- print("<DD>" + escape(repr(value)))
+ print("<i>" + html.escape(repr(type(value))) + "</i>")
+ print("<DD>" + html.escape(repr(value)))
print("</DL>")
print()
@@ -839,9 +941,9 @@ def print_directory():
try:
pwd = os.getcwd()
except os.error as msg:
- print("os.error:", escape(str(msg)))
+ print("os.error:", html.escape(str(msg)))
else:
- print(escape(pwd))
+ print(html.escape(pwd))
print()
def print_arguments():
@@ -899,9 +1001,9 @@ environment as well. Here are some common variable names:
# =========
def escape(s, quote=None):
- '''Replace special characters "&", "<" and ">" to HTML-safe sequences.
- If the optional flag quote is true, the quotation mark character (")
- is also translated.'''
+ """Deprecated API."""
+ warn("cgi.escape is deprecated, use html.escape instead",
+ PendingDeprecationWarning, stacklevel=2)
s = s.replace("&", "&amp;") # Must be done first!
s = s.replace("<", "&lt;")
s = s.replace(">", "&gt;")
@@ -909,8 +1011,13 @@ def escape(s, quote=None):
s = s.replace('"', "&quot;")
return s
-def valid_boundary(s, _vb_pattern="^[ -~]{0,200}[!-~]$"):
+
+def valid_boundary(s, _vb_pattern=None):
import re
+ if isinstance(s, bytes):
+ _vb_pattern = b"^[ -~]{0,200}[!-~]$"
+ else:
+ _vb_pattern = "^[ -~]{0,200}[!-~]$"
return re.match(_vb_pattern, s)
# Invoke mainline
diff --git a/Lib/cmd.py b/Lib/cmd.py
index 10aa5acf4b..8fa7d019b5 100644
--- a/Lib/cmd.py
+++ b/Lib/cmd.py
@@ -84,7 +84,6 @@ class Cmd:
sys.stdin and sys.stdout are used.
"""
- import sys
if stdin is not None:
self.stdin = stdin
else:
@@ -278,21 +277,18 @@ class Cmd:
return None
def get_names(self):
- # Inheritance says we have to look in class and
- # base classes; order is not important.
- names = []
- classes = [self.__class__]
- while classes:
- aclass = classes.pop(0)
- if aclass.__bases__:
- classes = classes + list(aclass.__bases__)
- names = names + dir(aclass)
- return names
+ # This method used to pull in base class attributes
+ # at a time dir() didn't do it yet.
+ return dir(self.__class__)
def complete_help(self, *args):
- return self.completenames(*args)
+ commands = set(self.completenames(*args))
+ topics = set(a[5:] for a in self.get_names()
+ if a.startswith('help_' + args[0]))
+ return list(commands | topics)
def do_help(self, arg):
+ 'List available commands with "help" or detailed help with "help cmd".'
if arg:
# XXX check arg syntax
try:
diff --git a/Lib/code.py b/Lib/code.py
index 8962927d71..605aede5ef 100644
--- a/Lib/code.py
+++ b/Lib/code.py
@@ -287,6 +287,5 @@ def interact(banner=None, readfunc=None, local=None):
console.interact(banner)
-if __name__ == '__main__':
- import pdb
- pdb.run("interact()\n")
+if __name__ == "__main__":
+ interact()
diff --git a/Lib/codecs.py b/Lib/codecs.py
index f6c2448168..b150d64d53 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -396,6 +396,8 @@ class StreamWriter(Codec):
class StreamReader(Codec):
+ charbuffertype = str
+
def __init__(self, stream, errors='strict'):
""" Creates a StreamReader instance.
@@ -417,9 +419,8 @@ class StreamReader(Codec):
self.stream = stream
self.errors = errors
self.bytebuffer = b""
- # For str->str decoding this will stay a str
- # For str->unicode decoding the first read will promote it to unicode
- self.charbuffer = ""
+ self._empty_charbuffer = self.charbuffertype()
+ self.charbuffer = self._empty_charbuffer
self.linebuffer = None
def decode(self, input, errors='strict'):
@@ -455,7 +456,7 @@ class StreamReader(Codec):
"""
# If we have lines cached, first merge them back into characters
if self.linebuffer:
- self.charbuffer = "".join(self.linebuffer)
+ self.charbuffer = self._empty_charbuffer.join(self.linebuffer)
self.linebuffer = None
# read until we get the required number of characters (if available)
@@ -498,7 +499,7 @@ class StreamReader(Codec):
if chars < 0:
# Return everything we've got
result = self.charbuffer
- self.charbuffer = ""
+ self.charbuffer = self._empty_charbuffer
else:
# Return the first chars characters
result = self.charbuffer[:chars]
@@ -529,7 +530,7 @@ class StreamReader(Codec):
return line
readsize = size or 72
- line = ""
+ line = self._empty_charbuffer
# If size is given, we call read() only once
while True:
data = self.read(readsize, firstline=True)
@@ -537,7 +538,8 @@ class StreamReader(Codec):
# If we're at a "\r" read one extra character (which might
# be a "\n") to get a proper line ending. If the stream is
# temporarily exhausted we return the wrong line ending.
- if data.endswith("\r"):
+ if (isinstance(data, str) and data.endswith("\r")) or \
+ (isinstance(data, bytes) and data.endswith(b"\r")):
data += self.read(size=1, chars=1)
line += data
@@ -563,7 +565,8 @@ class StreamReader(Codec):
line0withoutend = lines[0].splitlines(False)[0]
if line0withend != line0withoutend: # We really have a line end
# Put the rest back together and keep it until the next call
- self.charbuffer = "".join(lines[1:]) + self.charbuffer
+ self.charbuffer = self._empty_charbuffer.join(lines[1:]) + \
+ self.charbuffer
if keepends:
line = line0withend
else:
@@ -574,7 +577,7 @@ class StreamReader(Codec):
if line and not keepends:
line = line.splitlines(False)[0]
break
- if readsize<8000:
+ if readsize < 8000:
readsize *= 2
return line
@@ -603,7 +606,7 @@ class StreamReader(Codec):
"""
self.bytebuffer = b""
- self.charbuffer = ""
+ self.charbuffer = self._empty_charbuffer
self.linebuffer = None
def seek(self, offset, whence=0):
diff --git a/Lib/collections.py b/Lib/collections.py
index b2a590bd77..b904980555 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -13,6 +13,7 @@ import sys as _sys
import heapq as _heapq
from weakref import proxy as _proxy
from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
+from reprlib import recursive_repr as _recursive_repr
################################################################################
### OrderedDict
@@ -26,59 +27,57 @@ class OrderedDict(dict):
# An inherited dict maps keys to values.
# The inherited dict provides __getitem__, __len__, __contains__, and get.
# The remaining methods are order-aware.
- # Big-O running times for all methods are the same as for regular dictionaries.
+ # Big-O running times for all methods are the same as regular dictionaries.
- # The internal self.__map dictionary maps keys to links in a doubly linked list.
+ # The internal self.__map dict maps keys to links in a doubly linked list.
# The circular doubly linked list starts and ends with a sentinel element.
# The sentinel element never gets deleted (this simplifies the algorithm).
+ # The sentinel is in self.__hardroot with a weakref proxy in self.__root.
# The prev/next links are weakref proxies (to prevent circular references).
# Individual links are kept alive by the hard reference in self.__map.
# Those hard references disappear when a key is deleted from an OrderedDict.
def __init__(self, *args, **kwds):
- '''Initialize an ordered dictionary. Signature is the same as for
- regular dictionaries, but keyword arguments are not recommended
- because their insertion order is arbitrary.
+ '''Initialize an ordered dictionary. The signature is the same as
+ regular dictionaries, but keyword arguments are not recommended because
+ their insertion order is arbitrary.
'''
if len(args) > 1:
raise TypeError('expected at most 1 arguments, got %d' % len(args))
- self.__in_repr = False # detects recursive repr
try:
self.__root
except AttributeError:
- self.__root = root = _Link() # sentinel node for the doubly linked list
+ self.__hardroot = _Link()
+ self.__root = root = _proxy(self.__hardroot)
root.prev = root.next = root
self.__map = {}
self.__update(*args, **kwds)
- def clear(self):
- 'od.clear() -> None. Remove all items from od.'
- root = self.__root
- root.prev = root.next = root
- self.__map.clear()
- dict.clear(self)
-
- def __setitem__(self, key, value):
+ def __setitem__(self, key, value,
+ dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link):
'od.__setitem__(i, y) <==> od[i]=y'
- # Setting a new item creates a new link which goes at the end of the linked
- # list, and the inherited dictionary is updated with the new key/value pair.
+ # Setting a new item creates a new link at the end of the linked list,
+ # and the inherited dictionary is updated with the new key/value pair.
if key not in self:
- self.__map[key] = link = _Link()
+ self.__map[key] = link = Link()
root = self.__root
last = root.prev
link.prev, link.next, link.key = last, root, key
- last.next = root.prev = _proxy(link)
- dict.__setitem__(self, key, value)
+ last.next = link
+ root.prev = proxy(link)
+ dict_setitem(self, key, value)
- def __delitem__(self, key):
+ def __delitem__(self, key, dict_delitem=dict.__delitem__):
'od.__delitem__(y) <==> del od[y]'
- # Deleting an existing item uses self.__map to find the link which is
- # then removed by updating the links in the predecessor and successor nodes.
- dict.__delitem__(self, key)
+ # Deleting an existing item uses self.__map to find the link which gets
+ # removed by updating the links in the predecessor and successor nodes.
+ dict_delitem(self, key)
link = self.__map.pop(key)
- link.prev.next = link.next
- link.next.prev = link.prev
+ link_prev = link.prev
+ link_next = link.next
+ link_prev.next = link_next
+ link_next.prev = link_prev
def __iter__(self):
'od.__iter__() <==> iter(od)'
@@ -98,6 +97,69 @@ class OrderedDict(dict):
yield curr.key
curr = curr.prev
+ def clear(self):
+ 'od.clear() -> None. Remove all items from od.'
+ root = self.__root
+ root.prev = root.next = root
+ self.__map.clear()
+ dict.clear(self)
+
+ def popitem(self, last=True):
+ '''od.popitem() -> (k, v), return and remove a (key, value) pair.
+ Pairs are returned in LIFO order if last is true or FIFO order if false.
+
+ '''
+ if not self:
+ raise KeyError('dictionary is empty')
+ root = self.__root
+ if last:
+ link = root.prev
+ link_prev = link.prev
+ link_prev.next = root
+ root.prev = link_prev
+ else:
+ link = root.next
+ link_next = link.next
+ root.next = link_next
+ link_next.prev = root
+ key = link.key
+ del self.__map[key]
+ value = dict.pop(self, key)
+ return key, value
+
+ def move_to_end(self, key, last=True):
+ '''Move an existing element to the end (or beginning if last==False).
+
+ Raises KeyError if the element does not exist.
+ When last=True, acts like a fast version of self[key]=self.pop(key).
+
+ '''
+ link = self.__map[key]
+ link_prev = link.prev
+ link_next = link.next
+ link_prev.next = link_next
+ link_next.prev = link_prev
+ root = self.__root
+ if last:
+ last = root.prev
+ link.prev = last
+ link.next = root
+ last.next = root.prev = link
+ else:
+ first = root.next
+ link.prev = root
+ link.next = first
+ root.next = first.prev = link
+
+ def __sizeof__(self):
+ sizeof = _sys.getsizeof
+ n = len(self) + 1 # number of links including root
+ size = sizeof(self.__dict__) # instance dictionary
+ size += sizeof(self.__map) * 2 # internal dict and inherited dict
+ size += sizeof(self.__hardroot) * n # link objects
+ size += sizeof(self.__root) * n # proxy objects
+ return size
+
update = __update = MutableMapping.update
keys = MutableMapping.keys
values = MutableMapping.values
@@ -107,6 +169,11 @@ class OrderedDict(dict):
__marker = object()
def pop(self, key, default=__marker):
+ '''od.pop(k[,d]) -> v, remove specified key and return the corresponding
+ value. If key is not found, d is returned if given, otherwise KeyError
+ is raised.
+
+ '''
if key in self:
result = self[key]
del self[key]
@@ -122,29 +189,12 @@ class OrderedDict(dict):
self[key] = default
return default
- def popitem(self, last=True):
- '''od.popitem() -> (k, v), return and remove a (key, value) pair.
- Pairs are returned in LIFO order if last is true or FIFO order if false.
-
- '''
- if not self:
- raise KeyError('dictionary is empty')
- key = next(reversed(self) if last else iter(self))
- value = self.pop(key)
- return key, value
-
+ @_recursive_repr()
def __repr__(self):
'od.__repr__() <==> repr(od)'
- if self.__in_repr:
- return '...'
if not self:
return '%s()' % (self.__class__.__name__,)
- self.__in_repr = True
- try:
- result = '%s(%r)' % (self.__class__.__name__, list(self.items()))
- finally:
- self.__in_repr = False
- return result
+ return '%s(%r)' % (self.__class__.__name__, list(self.items()))
def __reduce__(self):
'Return state information for pickling'
@@ -162,14 +212,14 @@ class OrderedDict(dict):
@classmethod
def fromkeys(cls, iterable, value=None):
- '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S
- and values equal to v (which defaults to None).
+ '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
+ If not specified, the value defaults to None.
'''
- d = cls()
+ self = cls()
for key in iterable:
- d[key] = value
- return d
+ self[key] = value
+ return self
def __eq__(self, other):
'''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive
@@ -181,23 +231,67 @@ class OrderedDict(dict):
all(p==q for p, q in zip(self.items(), other.items()))
return dict.__eq__(self, other)
- def __ne__(self, other):
- '''od.__ne__(y) <==> od!=y. Comparison to another OD is order-sensitive
- while comparison to a regular mapping is order-insensitive.
-
- '''
- return not self == other
-
-
################################################################################
### namedtuple
################################################################################
+_class_template = '''\
+from builtins import property as _property, tuple as _tuple
+from operator import itemgetter as _itemgetter
+from collections import OrderedDict
+
+class {typename}(tuple):
+ '{typename}({arg_list})'
+
+ __slots__ = ()
+
+ _fields = {field_names!r}
+
+ def __new__(_cls, {arg_list}):
+ 'Create new instance of {typename}({arg_list})'
+ return _tuple.__new__(_cls, ({arg_list}))
+
+ @classmethod
+ def _make(cls, iterable, new=tuple.__new__, len=len):
+ 'Make a new {typename} object from a sequence or iterable'
+ result = new(cls, iterable)
+ if len(result) != {num_fields:d}:
+ raise TypeError('Expected {num_fields:d} arguments, got %d' % len(result))
+ return result
+
+ def __repr__(self):
+ 'Return a nicely formatted representation string'
+ return self.__class__.__name__ + '({repr_fmt})' % self
+
+ def _asdict(self):
+ 'Return a new OrderedDict which maps field names to their values'
+ return OrderedDict(zip(self._fields, self))
+
+ def _replace(_self, **kwds):
+ 'Return a new {typename} object replacing specified fields with new values'
+ result = _self._make(map(kwds.pop, {field_names!r}, _self))
+ if kwds:
+ raise ValueError('Got unexpected field names: %r' % list(kwds))
+ return result
+
+ def __getnewargs__(self):
+ 'Return self as a plain tuple. Used by copy and pickle.'
+ return tuple(self)
+
+{field_defs}
+'''
+
+_repr_template = '{name}=%r'
+
+_field_template = '''\
+ {name} = _property(_itemgetter({index:d}), doc='Alias for field number {index:d}')
+'''
+
def namedtuple(typename, field_names, verbose=False, rename=False):
"""Returns a new subclass of tuple with named fields.
- >>> Point = namedtuple('Point', 'x y')
+ >>> Point = namedtuple('Point', ['x', 'y'])
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
@@ -222,76 +316,54 @@ def namedtuple(typename, field_names, verbose=False, rename=False):
# generating informative error messages and preventing template injection attacks.
if isinstance(field_names, str):
field_names = field_names.replace(',', ' ').split() # names separated by whitespace and/or commas
- field_names = tuple(map(str, field_names))
+ field_names = list(map(str, field_names))
if rename:
- names = list(field_names)
seen = set()
- for i, name in enumerate(names):
- if (not all(c.isalnum() or c=='_' for c in name) or _iskeyword(name)
- or not name or name[0].isdigit() or name.startswith('_')
+ for index, name in enumerate(field_names):
+ if (not all(c.isalnum() or c=='_' for c in name)
+ or _iskeyword(name)
+ or not name
+ or name[0].isdigit()
+ or name.startswith('_')
or name in seen):
- names[i] = '_%d' % i
+ field_names[index] = '_%d' % index
seen.add(name)
- field_names = tuple(names)
- for name in (typename,) + field_names:
+ for name in [typename] + field_names:
if not all(c.isalnum() or c=='_' for c in name):
raise ValueError('Type names and field names can only contain alphanumeric characters and underscores: %r' % name)
if _iskeyword(name):
raise ValueError('Type names and field names cannot be a keyword: %r' % name)
if name[0].isdigit():
raise ValueError('Type names and field names cannot start with a number: %r' % name)
- seen_names = set()
+ seen = set()
for name in field_names:
if name.startswith('_') and not rename:
raise ValueError('Field names cannot start with an underscore: %r' % name)
- if name in seen_names:
+ if name in seen:
raise ValueError('Encountered duplicate field name: %r' % name)
- seen_names.add(name)
-
- # Create and fill-in the class template
- numfields = len(field_names)
- argtxt = repr(field_names).replace("'", "")[1:-1] # tuple repr without parens or quotes
- reprtxt = ', '.join('%s=%%r' % name for name in field_names)
- template = '''class %(typename)s(tuple):
- '%(typename)s(%(argtxt)s)' \n
- __slots__ = () \n
- _fields = %(field_names)r \n
- def __new__(_cls, %(argtxt)s):
- return _tuple.__new__(_cls, (%(argtxt)s)) \n
- @classmethod
- def _make(cls, iterable, new=tuple.__new__, len=len):
- 'Make a new %(typename)s object from a sequence or iterable'
- result = new(cls, iterable)
- if len(result) != %(numfields)d:
- raise TypeError('Expected %(numfields)d arguments, got %%d' %% len(result))
- return result \n
- def __repr__(self):
- return '%(typename)s(%(reprtxt)s)' %% self \n
- def _asdict(self):
- 'Return a new OrderedDict which maps field names to their values'
- return OrderedDict(zip(self._fields, self)) \n
- def _replace(_self, **kwds):
- 'Return a new %(typename)s object replacing specified fields with new values'
- result = _self._make(map(kwds.pop, %(field_names)r, _self))
- if kwds:
- raise ValueError('Got unexpected field names: %%r' %% kwds.keys())
- return result \n
- def __getnewargs__(self):
- return tuple(self) \n\n''' % locals()
- for i, name in enumerate(field_names):
- template += ' %s = _property(_itemgetter(%d))\n' % (name, i)
- if verbose:
- print(template)
+ seen.add(name)
+
+ # Fill-in the class template
+ class_definition = _class_template.format(
+ typename = typename,
+ field_names = tuple(field_names),
+ num_fields = len(field_names),
+ arg_list = repr(tuple(field_names)).replace("'", "")[1:-1],
+ repr_fmt = ', '.join(_repr_template.format(name=name) for name in field_names),
+ field_defs = '\n'.join(_field_template.format(index=index, name=name)
+ for index, name in enumerate(field_names))
+ )
# Execute the template string in a temporary namespace and
# support tracing utilities by setting a value for frame.f_globals['__name__']
- namespace = dict(_itemgetter=_itemgetter, __name__='namedtuple_%s' % typename,
- OrderedDict=OrderedDict, _property=property, _tuple=tuple)
+ namespace = dict(__name__='namedtuple_%s' % typename)
try:
- exec(template, namespace)
+ exec(class_definition, namespace)
except SyntaxError as e:
- raise SyntaxError(e.msg + ':\n' + template) from e
+ raise SyntaxError(e.msg + ':\n\n' + class_definition)
result = namespace[typename]
+ if verbose:
+ print(class_definition)
# For pickling to work, the __module__ variable needs to be set to the frame
# where the named tuple is created. Bypass this step in enviroments where
@@ -309,6 +381,17 @@ def namedtuple(typename, field_names, verbose=False, rename=False):
### Counter
########################################################################
+def _count_elements(mapping, iterable):
+ 'Tally elements from the iterable.'
+ mapping_get = mapping.get
+ for elem in iterable:
+ mapping[elem] = mapping_get(elem, 0) + 1
+
+try: # Load C helper function if available
+ from _collections import _count_elements
+except ImportError:
+ pass
+
class Counter(dict):
'''Dict subclass for counting hashable items. Sometimes called a bag
or multiset. Elements are stored as dictionary keys and their counts
@@ -452,12 +535,37 @@ class Counter(dict):
else:
super().update(iterable) # fast path when counter is empty
else:
- self_get = self.get
- for elem in iterable:
- self[elem] = 1 + self_get(elem, 0)
+ _count_elements(self, iterable)
if kwds:
self.update(kwds)
+ def subtract(self, iterable=None, **kwds):
+ '''Like dict.update() but subtracts counts instead of replacing them.
+ Counts can be reduced below zero. Both the inputs and outputs are
+ allowed to contain zero and negative counts.
+
+ Source can be an iterable, a dictionary, or another Counter instance.
+
+ >>> c = Counter('which')
+ >>> c.subtract('witch') # subtract elements from another iterable
+ >>> c.subtract(Counter('watch')) # subtract elements from another counter
+ >>> c['h'] # 2 in which, minus 1 in witch, minus 1 in watch
+ 0
+ >>> c['w'] # 1 in which, minus 1 in witch, minus 1 in watch
+ -1
+
+ '''
+ if iterable is not None:
+ self_get = self.get
+ if isinstance(iterable, Mapping):
+ for elem, count in iterable.items():
+ self[elem] = self_get(elem, 0) - count
+ else:
+ for elem in iterable:
+ self[elem] = self_get(elem, 0) - 1
+ if kwds:
+ self.subtract(kwds)
+
def copy(self):
'Return a shallow copy.'
return self.__class__(self)
@@ -561,6 +669,109 @@ class Counter(dict):
return result
+########################################################################
+### ChainMap (helper for configparser)
+########################################################################
+
+class _ChainMap(MutableMapping):
+ ''' A ChainMap groups multiple dicts (or other mappings) together
+ to create a single, updateable view.
+
+ The underlying mappings are stored in a list. That list is public and can
+ accessed or updated using the *maps* attribute. There is no other state.
+
+ Lookups search the underlying mappings successively until a key is found.
+ In contrast, writes, updates, and deletions only operate on the first
+ mapping.
+
+ '''
+
+ def __init__(self, *maps):
+ '''Initialize a ChainMap by setting *maps* to the given mappings.
+ If no mappings are provided, a single empty dictionary is used.
+
+ '''
+ self.maps = list(maps) or [{}] # always at least one map
+
+ def __missing__(self, key):
+ raise KeyError(key)
+
+ def __getitem__(self, key):
+ for mapping in self.maps:
+ try:
+ return mapping[key] # can't use 'key in mapping' with defaultdict
+ except KeyError:
+ pass
+ return self.__missing__(key) # support subclasses that define __missing__
+
+ def get(self, key, default=None):
+ return self[key] if key in self else default
+
+ def __len__(self):
+ return len(set().union(*self.maps)) # reuses stored hash values if possible
+
+ def __iter__(self):
+ return iter(set().union(*self.maps))
+
+ def __contains__(self, key):
+ return any(key in m for m in self.maps)
+
+ def __bool__(self):
+ return any(self.maps)
+
+ @_recursive_repr()
+ def __repr__(self):
+ return '{0.__class__.__name__}({1})'.format(
+ self, ', '.join(map(repr, self.maps)))
+
+ @classmethod
+ def fromkeys(cls, iterable, *args):
+ 'Create a ChainMap with a single dict created from the iterable.'
+ return cls(dict.fromkeys(iterable, *args))
+
+ def copy(self):
+ 'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]'
+ return self.__class__(self.maps[0].copy(), *self.maps[1:])
+
+ __copy__ = copy
+
+ def new_child(self): # like Django's Context.push()
+ 'New ChainMap with a new dict followed by all previous maps.'
+ return self.__class__({}, *self.maps)
+
+ @property
+ def parents(self): # like Django's Context.pop()
+ 'New ChainMap from maps[1:].'
+ return self.__class__(*self.maps[1:])
+
+ def __setitem__(self, key, value):
+ self.maps[0][key] = value
+
+ def __delitem__(self, key):
+ try:
+ del self.maps[0][key]
+ except KeyError:
+ raise KeyError('Key not found in the first mapping: {!r}'.format(key))
+
+ def popitem(self):
+ 'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
+ try:
+ return self.maps[0].popitem()
+ except KeyError:
+ raise KeyError('No keys found in the first mapping.')
+
+ def pop(self, key, *args):
+ 'Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].'
+ try:
+ return self.maps[0].pop(key, *args)
+ except KeyError:
+ raise KeyError('Key not found in the first mapping: {!r}'.format(key))
+
+ def clear(self):
+ 'Clear maps[0], leaving maps[1:] intact.'
+ self.maps[0].clear()
+
+
################################################################################
### UserDict
################################################################################
@@ -802,6 +1013,8 @@ class UserString(Sequence):
new = new.data
return self.__class__(self.data.replace(old, new, maxsplit))
def rfind(self, sub, start=0, end=_sys.maxsize):
+ if isinstance(sub, UserString):
+ sub = sub.data
return self.data.rfind(sub, start, end)
def rindex(self, sub, start=0, end=_sys.maxsize):
return self.data.rindex(sub, start, end)
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 2432842db5..d79a1bb9a0 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -1,4 +1,4 @@
-"""Module/script to "compile" all .py files to .pyc (or .pyo) file.
+"""Module/script to byte-compile all .py files to .pyc (or .pyo) files.
When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
@@ -9,29 +9,30 @@ recursing into subdirectories. (Even though it should do so for
packages -- for now, you'll have to deal with packages separately.)
See module py_compile for details of the actual byte-compilation.
-
"""
import os
import sys
+import errno
+import imp
import py_compile
import struct
-import imp
-__all__ = ["compile_dir","compile_path"]
+__all__ = ["compile_dir","compile_file","compile_path"]
-def compile_dir(dir, maxlevels=10, ddir=None,
- force=0, rx=None, quiet=0):
+def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
+ quiet=False, legacy=False, optimize=-1):
"""Byte-compile all modules in the given directory tree.
Arguments (only dir is required):
dir: the directory to byte-compile
maxlevels: maximum recursion level (default 10)
- ddir: if given, purported directory name (this is the
- directory name that will show up in error messages)
- force: if 1, force compilation, even if timestamps are up-to-date
- quiet: if 1, be quiet during compilation
-
+ ddir: the directory that will be prepended to the path to the
+ file as it is compiled into each byte-code file.
+ force: if True, force compilation, even if timestamps are up-to-date
+ quiet: if True, be quiet during compilation
+ legacy: if True, produce legacy pyc paths instead of PEP 3147 paths
+ optimize: optimization level or -1 for level of the interpreter
"""
if not quiet:
print('Listing', dir, '...')
@@ -43,74 +44,110 @@ def compile_dir(dir, maxlevels=10, ddir=None,
names.sort()
success = 1
for name in names:
+ if name == '__pycache__':
+ continue
fullname = os.path.join(dir, name)
if ddir is not None:
dfile = os.path.join(ddir, name)
else:
dfile = None
- if rx is not None:
- mo = rx.search(fullname)
- if mo:
- continue
- if os.path.isfile(fullname):
- head, tail = name[:-3], name[-3:]
- if tail == '.py':
- if not force:
- try:
- mtime = int(os.stat(fullname).st_mtime)
- expect = struct.pack('<4sl', imp.get_magic(), mtime)
- cfile = fullname + (__debug__ and 'c' or 'o')
- with open(cfile, 'rb') as chandle:
- actual = chandle.read(8)
- if expect == actual:
- continue
- except IOError:
- pass
- if not quiet:
- print('Compiling', fullname, '...')
+ if not os.path.isdir(fullname):
+ if not compile_file(fullname, ddir, force, rx, quiet,
+ legacy, optimize):
+ success = 0
+ elif (maxlevels > 0 and name != os.curdir and name != os.pardir and
+ os.path.isdir(fullname) and not os.path.islink(fullname)):
+ if not compile_dir(fullname, maxlevels - 1, dfile, force, rx,
+ quiet, legacy, optimize):
+ success = 0
+ return success
+
+def compile_file(fullname, ddir=None, force=False, rx=None, quiet=False,
+ legacy=False, optimize=-1):
+ """Byte-compile one file.
+
+ Arguments (only fullname is required):
+
+ fullname: the file to byte-compile
+ ddir: if given, the directory name compiled in to the
+ byte-code file.
+ force: if True, force compilation, even if timestamps are up-to-date
+ quiet: if True, be quiet during compilation
+ legacy: if True, produce legacy pyc paths instead of PEP 3147 paths
+ optimize: optimization level or -1 for level of the interpreter
+ """
+ success = 1
+ name = os.path.basename(fullname)
+ if ddir is not None:
+ dfile = os.path.join(ddir, name)
+ else:
+ dfile = None
+ if rx is not None:
+ mo = rx.search(fullname)
+ if mo:
+ return success
+ if os.path.isfile(fullname):
+ if legacy:
+ cfile = fullname + ('c' if __debug__ else 'o')
+ else:
+ if optimize >= 0:
+ cfile = imp.cache_from_source(fullname,
+ debug_override=not optimize)
+ else:
+ cfile = imp.cache_from_source(fullname)
+ cache_dir = os.path.dirname(cfile)
+ head, tail = name[:-3], name[-3:]
+ if tail == '.py':
+ if not force:
try:
- ok = py_compile.compile(fullname, None, dfile, True)
- except KeyboardInterrupt:
- raise KeyboardInterrupt
- except py_compile.PyCompileError as err:
- if quiet:
- print('*** Error compiling', fullname, '...')
- else:
- print('*** ', end='')
- # escape non-printable characters in msg
- msg = err.msg.encode(sys.stdout.encoding, 'backslashreplace')
- msg = msg.decode(sys.stdout.encoding)
- print(msg)
- success = 0
- except (SyntaxError, UnicodeError, IOError) as e:
- if quiet:
- print('*** Error compiling', fullname, '...')
- else:
- print('*** ', end='')
- print(e.__class__.__name__ + ':', e)
- success = 0
+ mtime = int(os.stat(fullname).st_mtime)
+ expect = struct.pack('<4sl', imp.get_magic(), mtime)
+ with open(cfile, 'rb') as chandle:
+ actual = chandle.read(8)
+ if expect == actual:
+ return success
+ except IOError:
+ pass
+ if not quiet:
+ print('Compiling', fullname, '...')
+ try:
+ ok = py_compile.compile(fullname, cfile, dfile, True,
+ optimize=optimize)
+ except py_compile.PyCompileError as err:
+ if quiet:
+ print('*** Error compiling', fullname, '...')
else:
- if ok == 0:
- success = 0
- elif maxlevels > 0 and \
- name != os.curdir and name != os.pardir and \
- os.path.isdir(fullname) and \
- not os.path.islink(fullname):
- if not compile_dir(fullname, maxlevels - 1, dfile, force, rx,
- quiet):
+ print('*** ', end='')
+ # escape non-printable characters in msg
+ msg = err.msg.encode(sys.stdout.encoding,
+ errors='backslashreplace')
+ msg = msg.decode(sys.stdout.encoding)
+ print(msg)
success = 0
+ except (SyntaxError, UnicodeError, IOError) as e:
+ if quiet:
+ print('*** Error compiling', fullname, '...')
+ else:
+ print('*** ', end='')
+ print(e.__class__.__name__ + ':', e)
+ success = 0
+ else:
+ if ok == 0:
+ success = 0
return success
-def compile_path(skip_curdir=1, maxlevels=0, force=0, quiet=0):
+def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=False,
+ legacy=False, optimize=-1):
"""Byte-compile all module on sys.path.
Arguments (all optional):
skip_curdir: if true, skip current directory (default true)
maxlevels: max recursion level (default 0)
- force: as for compile_dir() (default 0)
- quiet: as for compile_dir() (default 0)
-
+ force: as for compile_dir() (default False)
+ quiet: as for compile_dir() (default False)
+ legacy: as for compile_dir() (default False)
+ optimize: as for compile_dir() (default -1)
"""
success = 1
for dir in sys.path:
@@ -118,56 +155,85 @@ def compile_path(skip_curdir=1, maxlevels=0, force=0, quiet=0):
print('Skipping current directory')
else:
success = success and compile_dir(dir, maxlevels, None,
- force, quiet=quiet)
+ force, quiet=quiet,
+ legacy=legacy, optimize=optimize)
return success
+
def main():
"""Script main program."""
- import getopt
- try:
- opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:')
- except getopt.error as msg:
- print(msg)
- print("usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \
- "[-x regexp] [directory ...]")
- print("-l: don't recurse down")
- print("-f: force rebuild even if timestamps are up-to-date")
- print("-q: quiet operation")
- print("-d destdir: purported directory name for error messages")
- print(" if no directory arguments, -l sys.path is assumed")
- print("-x regexp: skip files matching the regular expression regexp")
- print(" the regexp is searched for in the full path of the file")
- sys.exit(2)
- maxlevels = 10
- ddir = None
- force = 0
- quiet = 0
- rx = None
- for o, a in opts:
- if o == '-l': maxlevels = 0
- if o == '-d': ddir = a
- if o == '-f': force = 1
- if o == '-q': quiet = 1
- if o == '-x':
- import re
- rx = re.compile(a)
- if ddir:
- if len(args) != 1:
- print("-d destdir require exactly one directory argument")
- sys.exit(2)
- success = 1
+ import argparse
+
+ parser = argparse.ArgumentParser(
+ description='Utilities to support installing Python libraries.')
+ parser.add_argument('-l', action='store_const', const=0,
+ default=10, dest='maxlevels',
+ help="don't recurse into subdirectories")
+ parser.add_argument('-f', action='store_true', dest='force',
+ help='force rebuild even if timestamps are up to date')
+ parser.add_argument('-q', action='store_true', dest='quiet',
+ help='output only error messages')
+ parser.add_argument('-b', action='store_true', dest='legacy',
+ help='use legacy (pre-PEP3147) compiled file locations')
+ parser.add_argument('-d', metavar='DESTDIR', dest='ddir', default=None,
+ help=('directory to prepend to file paths for use in '
+ 'compile time tracebacks and in runtime '
+ 'tracebacks in cases where the source file is '
+ 'unavailable'))
+ parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
+ help=('skip files matching the regular expression. '
+ 'The regexp is searched for in the full path '
+ 'to each file considered for compilation.'))
+ parser.add_argument('-i', metavar='FILE', dest='flist',
+ help=('add all the files and directories listed in '
+ 'FILE to the list considered for compilation. '
+ 'If "-", names are read from stdin.'))
+ parser.add_argument('compile_dest', metavar='FILE|DIR', nargs='*',
+ help=('zero or more file and directory names '
+ 'to compile; if no arguments given, defaults '
+ 'to the equivalent of -l sys.path'))
+ args = parser.parse_args()
+
+ compile_dests = args.compile_dest
+
+ if (args.ddir and (len(compile_dests) != 1
+ or not os.path.isdir(compile_dests[0]))):
+ parser.exit('-d destdir requires exactly one directory argument')
+ if args.rx:
+ import re
+ args.rx = re.compile(args.rx)
+
+ # if flist is provided then load it
+ if args.flist:
+ try:
+ with (sys.stdin if args.flist=='-' else open(args.flist)) as f:
+ for line in f:
+ compile_dests.append(line.strip())
+ except EnvironmentError:
+ print("Error reading file list {}".format(args.flist))
+ return False
+
+ success = True
try:
- if args:
- for dir in args:
- if not compile_dir(dir, maxlevels, ddir,
- force, rx, quiet):
- success = 0
+ if compile_dests:
+ for dest in compile_dests:
+ if os.path.isfile(dest):
+ if not compile_file(dest, args.ddir, args.force, args.rx,
+ args.quiet, args.legacy):
+ success = False
+ else:
+ if not compile_dir(dest, args.maxlevels, args.ddir,
+ args.force, args.rx, args.quiet,
+ args.legacy):
+ success = False
+ return success
else:
- success = compile_path()
+ return compile_path(legacy=args.legacy)
except KeyboardInterrupt:
- print("\n[interrupt]")
- success = 0
- return success
+ print("\n[interrupted]")
+ return False
+ return True
+
if __name__ == '__main__':
exit_status = int(not main())
diff --git a/Lib/concurrent/__init__.py b/Lib/concurrent/__init__.py
new file mode 100644
index 0000000000..196d378857
--- /dev/null
+++ b/Lib/concurrent/__init__.py
@@ -0,0 +1 @@
+# This directory is a Python package.
diff --git a/Lib/concurrent/futures/__init__.py b/Lib/concurrent/futures/__init__.py
new file mode 100644
index 0000000000..b5231f8aab
--- /dev/null
+++ b/Lib/concurrent/futures/__init__.py
@@ -0,0 +1,18 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Execute computations asynchronously using threads or processes."""
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+from concurrent.futures._base import (FIRST_COMPLETED,
+ FIRST_EXCEPTION,
+ ALL_COMPLETED,
+ CancelledError,
+ TimeoutError,
+ Future,
+ Executor,
+ wait,
+ as_completed)
+from concurrent.futures.process import ProcessPoolExecutor
+from concurrent.futures.thread import ThreadPoolExecutor
diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py
new file mode 100644
index 0000000000..79b91d495f
--- /dev/null
+++ b/Lib/concurrent/futures/_base.py
@@ -0,0 +1,567 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+import collections
+import functools
+import logging
+import threading
+import time
+
+FIRST_COMPLETED = 'FIRST_COMPLETED'
+FIRST_EXCEPTION = 'FIRST_EXCEPTION'
+ALL_COMPLETED = 'ALL_COMPLETED'
+_AS_COMPLETED = '_AS_COMPLETED'
+
+# Possible future states (for internal use by the futures package).
+PENDING = 'PENDING'
+RUNNING = 'RUNNING'
+# The future was cancelled by the user...
+CANCELLED = 'CANCELLED'
+# ...and _Waiter.add_cancelled() was called by a worker.
+CANCELLED_AND_NOTIFIED = 'CANCELLED_AND_NOTIFIED'
+FINISHED = 'FINISHED'
+
+_FUTURE_STATES = [
+ PENDING,
+ RUNNING,
+ CANCELLED,
+ CANCELLED_AND_NOTIFIED,
+ FINISHED
+]
+
+_STATE_TO_DESCRIPTION_MAP = {
+ PENDING: "pending",
+ RUNNING: "running",
+ CANCELLED: "cancelled",
+ CANCELLED_AND_NOTIFIED: "cancelled",
+ FINISHED: "finished"
+}
+
+# Logger for internal use by the futures package.
+LOGGER = logging.getLogger("concurrent.futures")
+
+class Error(Exception):
+ """Base class for all future-related exceptions."""
+ pass
+
+class CancelledError(Error):
+ """The Future was cancelled."""
+ pass
+
+class TimeoutError(Error):
+ """The operation exceeded the given deadline."""
+ pass
+
+class _Waiter(object):
+ """Provides the event that wait() and as_completed() block on."""
+ def __init__(self):
+ self.event = threading.Event()
+ self.finished_futures = []
+
+ def add_result(self, future):
+ self.finished_futures.append(future)
+
+ def add_exception(self, future):
+ self.finished_futures.append(future)
+
+ def add_cancelled(self, future):
+ self.finished_futures.append(future)
+
+class _AsCompletedWaiter(_Waiter):
+ """Used by as_completed()."""
+
+ def __init__(self):
+ super(_AsCompletedWaiter, self).__init__()
+ self.lock = threading.Lock()
+
+ def add_result(self, future):
+ with self.lock:
+ super(_AsCompletedWaiter, self).add_result(future)
+ self.event.set()
+
+ def add_exception(self, future):
+ with self.lock:
+ super(_AsCompletedWaiter, self).add_exception(future)
+ self.event.set()
+
+ def add_cancelled(self, future):
+ with self.lock:
+ super(_AsCompletedWaiter, self).add_cancelled(future)
+ self.event.set()
+
+class _FirstCompletedWaiter(_Waiter):
+ """Used by wait(return_when=FIRST_COMPLETED)."""
+
+ def add_result(self, future):
+ super().add_result(future)
+ self.event.set()
+
+ def add_exception(self, future):
+ super().add_exception(future)
+ self.event.set()
+
+ def add_cancelled(self, future):
+ super().add_cancelled(future)
+ self.event.set()
+
+class _AllCompletedWaiter(_Waiter):
+ """Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED)."""
+
+ def __init__(self, num_pending_calls, stop_on_exception):
+ self.num_pending_calls = num_pending_calls
+ self.stop_on_exception = stop_on_exception
+ super().__init__()
+
+ def _decrement_pending_calls(self):
+ self.num_pending_calls -= 1
+ if not self.num_pending_calls:
+ self.event.set()
+
+ def add_result(self, future):
+ super().add_result(future)
+ self._decrement_pending_calls()
+
+ def add_exception(self, future):
+ super().add_exception(future)
+ if self.stop_on_exception:
+ self.event.set()
+ else:
+ self._decrement_pending_calls()
+
+ def add_cancelled(self, future):
+ super().add_cancelled(future)
+ self._decrement_pending_calls()
+
+class _AcquireFutures(object):
+ """A context manager that does an ordered acquire of Future conditions."""
+
+ def __init__(self, futures):
+ self.futures = sorted(futures, key=id)
+
+ def __enter__(self):
+ for future in self.futures:
+ future._condition.acquire()
+
+ def __exit__(self, *args):
+ for future in self.futures:
+ future._condition.release()
+
+def _create_and_install_waiters(fs, return_when):
+ if return_when == _AS_COMPLETED:
+ waiter = _AsCompletedWaiter()
+ elif return_when == FIRST_COMPLETED:
+ waiter = _FirstCompletedWaiter()
+ else:
+ pending_count = sum(
+ f._state not in [CANCELLED_AND_NOTIFIED, FINISHED] for f in fs)
+
+ if return_when == FIRST_EXCEPTION:
+ waiter = _AllCompletedWaiter(pending_count, stop_on_exception=True)
+ elif return_when == ALL_COMPLETED:
+ waiter = _AllCompletedWaiter(pending_count, stop_on_exception=False)
+ else:
+ raise ValueError("Invalid return condition: %r" % return_when)
+
+ for f in fs:
+ f._waiters.append(waiter)
+
+ return waiter
+
+def as_completed(fs, timeout=None):
+ """An iterator over the given futures that yields each as it completes.
+
+ Args:
+ fs: The sequence of Futures (possibly created by different Executors) to
+ iterate over.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+
+ Returns:
+ An iterator that yields the given Futures as they complete (finished or
+ cancelled).
+
+ Raises:
+ TimeoutError: If the entire result iterator could not be generated
+ before the given timeout.
+ """
+ if timeout is not None:
+ end_time = timeout + time.time()
+
+ with _AcquireFutures(fs):
+ finished = set(
+ f for f in fs
+ if f._state in [CANCELLED_AND_NOTIFIED, FINISHED])
+ pending = set(fs) - finished
+ waiter = _create_and_install_waiters(fs, _AS_COMPLETED)
+
+ try:
+ for future in finished:
+ yield future
+
+ while pending:
+ if timeout is None:
+ wait_timeout = None
+ else:
+ wait_timeout = end_time - time.time()
+ if wait_timeout < 0:
+ raise TimeoutError(
+ '%d (of %d) futures unfinished' % (
+ len(pending), len(fs)))
+
+ waiter.event.wait(wait_timeout)
+
+ with waiter.lock:
+ finished = waiter.finished_futures
+ waiter.finished_futures = []
+ waiter.event.clear()
+
+ for future in finished:
+ yield future
+ pending.remove(future)
+
+ finally:
+ for f in fs:
+ f._waiters.remove(waiter)
+
+DoneAndNotDoneFutures = collections.namedtuple(
+ 'DoneAndNotDoneFutures', 'done not_done')
+def wait(fs, timeout=None, return_when=ALL_COMPLETED):
+ """Wait for the futures in the given sequence to complete.
+
+ Args:
+ fs: The sequence of Futures (possibly created by different Executors) to
+ wait upon.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+ return_when: Indicates when this function should return. The options
+ are:
+
+ FIRST_COMPLETED - Return when any future finishes or is
+ cancelled.
+ FIRST_EXCEPTION - Return when any future finishes by raising an
+ exception. If no future raises an exception
+ then it is equivalent to ALL_COMPLETED.
+ ALL_COMPLETED - Return when all futures finish or are cancelled.
+
+ Returns:
+ A named 2-tuple of sets. The first set, named 'done', contains the
+ futures that completed (is finished or cancelled) before the wait
+ completed. The second set, named 'not_done', contains uncompleted
+ futures.
+ """
+ with _AcquireFutures(fs):
+ done = set(f for f in fs
+ if f._state in [CANCELLED_AND_NOTIFIED, FINISHED])
+ not_done = set(fs) - done
+
+ if (return_when == FIRST_COMPLETED) and done:
+ return DoneAndNotDoneFutures(done, not_done)
+ elif (return_when == FIRST_EXCEPTION) and done:
+ if any(f for f in done
+ if not f.cancelled() and f.exception() is not None):
+ return DoneAndNotDoneFutures(done, not_done)
+
+ if len(done) == len(fs):
+ return DoneAndNotDoneFutures(done, not_done)
+
+ waiter = _create_and_install_waiters(fs, return_when)
+
+ waiter.event.wait(timeout)
+ for f in fs:
+ f._waiters.remove(waiter)
+
+ done.update(waiter.finished_futures)
+ return DoneAndNotDoneFutures(done, set(fs) - done)
+
+class Future(object):
+ """Represents the result of an asynchronous computation."""
+
+ def __init__(self):
+ """Initializes the future. Should not be called by clients."""
+ self._condition = threading.Condition()
+ self._state = PENDING
+ self._result = None
+ self._exception = None
+ self._waiters = []
+ self._done_callbacks = []
+
+ def _invoke_callbacks(self):
+ for callback in self._done_callbacks:
+ try:
+ callback(self)
+ except Exception:
+ LOGGER.exception('exception calling callback for %r', self)
+
+ def __repr__(self):
+ with self._condition:
+ if self._state == FINISHED:
+ if self._exception:
+ return '<Future at %s state=%s raised %s>' % (
+ hex(id(self)),
+ _STATE_TO_DESCRIPTION_MAP[self._state],
+ self._exception.__class__.__name__)
+ else:
+ return '<Future at %s state=%s returned %s>' % (
+ hex(id(self)),
+ _STATE_TO_DESCRIPTION_MAP[self._state],
+ self._result.__class__.__name__)
+ return '<Future at %s state=%s>' % (
+ hex(id(self)),
+ _STATE_TO_DESCRIPTION_MAP[self._state])
+
+ def cancel(self):
+ """Cancel the future if possible.
+
+ Returns True if the future was cancelled, False otherwise. A future
+ cannot be cancelled if it is running or has already completed.
+ """
+ with self._condition:
+ if self._state in [RUNNING, FINISHED]:
+ return False
+
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ return True
+
+ self._state = CANCELLED
+ self._condition.notify_all()
+
+ self._invoke_callbacks()
+ return True
+
+ def cancelled(self):
+ """Return True if the future has cancelled."""
+ with self._condition:
+ return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]
+
+ def running(self):
+ """Return True if the future is currently executing."""
+ with self._condition:
+ return self._state == RUNNING
+
+ def done(self):
+ """Return True of the future was cancelled or finished executing."""
+ with self._condition:
+ return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]
+
+ def __get_result(self):
+ if self._exception:
+ raise self._exception
+ else:
+ return self._result
+
+ def add_done_callback(self, fn):
+ """Attaches a callable that will be called when the future finishes.
+
+ Args:
+ fn: A callable that will be called with this future as its only
+ argument when the future completes or is cancelled. The callable
+ will always be called by a thread in the same process in which
+ it was added. If the future has already completed or been
+ cancelled then the callable will be called immediately. These
+ callables are called in the order that they were added.
+ """
+ with self._condition:
+ if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]:
+ self._done_callbacks.append(fn)
+ return
+ fn(self)
+
+ def result(self, timeout=None):
+ """Return the result of the call that the future represents.
+
+ Args:
+ timeout: The number of seconds to wait for the result if the future
+ isn't done. If None, then there is no limit on the wait time.
+
+ Returns:
+ The result of the call that the future represents.
+
+ Raises:
+ CancelledError: If the future was cancelled.
+ TimeoutError: If the future didn't finish executing before the given
+ timeout.
+ Exception: If the call raised then that exception will be raised.
+ """
+ with self._condition:
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self.__get_result()
+
+ self._condition.wait(timeout)
+
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self.__get_result()
+ else:
+ raise TimeoutError()
+
+ def exception(self, timeout=None):
+ """Return the exception raised by the call that the future represents.
+
+ Args:
+ timeout: The number of seconds to wait for the exception if the
+ future isn't done. If None, then there is no limit on the wait
+ time.
+
+ Returns:
+ The exception raised by the call that the future represents or None
+ if the call completed without raising.
+
+ Raises:
+ CancelledError: If the future was cancelled.
+ TimeoutError: If the future didn't finish executing before the given
+ timeout.
+ """
+
+ with self._condition:
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self._exception
+
+ self._condition.wait(timeout)
+
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self._exception
+ else:
+ raise TimeoutError()
+
+ # The following methods should only be used by Executors and in tests.
+ def set_running_or_notify_cancel(self):
+ """Mark the future as running or process any cancel notifications.
+
+ Should only be used by Executor implementations and unit tests.
+
+ If the future has been cancelled (cancel() was called and returned
+ True) then any threads waiting on the future completing (though calls
+ to as_completed() or wait()) are notified and False is returned.
+
+ If the future was not cancelled then it is put in the running state
+ (future calls to running() will return True) and True is returned.
+
+ This method should be called by Executor implementations before
+ executing the work associated with this future. If this method returns
+ False then the work should not be executed.
+
+ Returns:
+ False if the Future was cancelled, True otherwise.
+
+ Raises:
+ RuntimeError: if this method was already called or if set_result()
+ or set_exception() was called.
+ """
+ with self._condition:
+ if self._state == CANCELLED:
+ self._state = CANCELLED_AND_NOTIFIED
+ for waiter in self._waiters:
+ waiter.add_cancelled(self)
+ # self._condition.notify_all() is not necessary because
+ # self.cancel() triggers a notification.
+ return False
+ elif self._state == PENDING:
+ self._state = RUNNING
+ return True
+ else:
+ LOGGER.critical('Future %s in unexpected state: %s',
+ id(self.future),
+ self.future._state)
+ raise RuntimeError('Future in unexpected state')
+
+ def set_result(self, result):
+ """Sets the return value of work associated with the future.
+
+ Should only be used by Executor implementations and unit tests.
+ """
+ with self._condition:
+ self._result = result
+ self._state = FINISHED
+ for waiter in self._waiters:
+ waiter.add_result(self)
+ self._condition.notify_all()
+ self._invoke_callbacks()
+
+ def set_exception(self, exception):
+ """Sets the result of the future as being the given exception.
+
+ Should only be used by Executor implementations and unit tests.
+ """
+ with self._condition:
+ self._exception = exception
+ self._state = FINISHED
+ for waiter in self._waiters:
+ waiter.add_exception(self)
+ self._condition.notify_all()
+ self._invoke_callbacks()
+
+class Executor(object):
+ """This is an abstract base class for concrete asynchronous executors."""
+
+ def submit(self, fn, *args, **kwargs):
+ """Submits a callable to be executed with the given arguments.
+
+ Schedules the callable to be executed as fn(*args, **kwargs) and returns
+ a Future instance representing the execution of the callable.
+
+ Returns:
+ A Future representing the given call.
+ """
+ raise NotImplementedError()
+
+ def map(self, fn, *iterables, timeout=None):
+ """Returns a iterator equivalent to map(fn, iter).
+
+ Args:
+ fn: A callable that will take take as many arguments as there are
+ passed iterables.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+
+ Returns:
+ An iterator equivalent to: map(func, *iterables) but the calls may
+ be evaluated out-of-order.
+
+ Raises:
+ TimeoutError: If the entire result iterator could not be generated
+ before the given timeout.
+ Exception: If fn(*args) raises for any values.
+ """
+ if timeout is not None:
+ end_time = timeout + time.time()
+
+ fs = [self.submit(fn, *args) for args in zip(*iterables)]
+
+ try:
+ for future in fs:
+ if timeout is None:
+ yield future.result()
+ else:
+ yield future.result(end_time - time.time())
+ finally:
+ for future in fs:
+ future.cancel()
+
+ def shutdown(self, wait=True):
+ """Clean-up the resources associated with the Executor.
+
+ It is safe to call this method several times. Otherwise, no other
+ methods can be called after this one.
+
+ Args:
+ wait: If True then shutdown will not return until all running
+ futures have finished executing and the resources used by the
+ executor have been reclaimed.
+ """
+ pass
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.shutdown(wait=True)
+ return False
diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py
new file mode 100644
index 0000000000..ff566d3eb3
--- /dev/null
+++ b/Lib/concurrent/futures/process.py
@@ -0,0 +1,360 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Implements ProcessPoolExecutor.
+
+The follow diagram and text describe the data-flow through the system:
+
+|======================= In-process =====================|== Out-of-process ==|
+
++----------+ +----------+ +--------+ +-----------+ +---------+
+| | => | Work Ids | => | | => | Call Q | => | |
+| | +----------+ | | +-----------+ | |
+| | | ... | | | | ... | | |
+| | | 6 | | | | 5, call() | | |
+| | | 7 | | | | ... | | |
+| Process | | ... | | Local | +-----------+ | Process |
+| Pool | +----------+ | Worker | | #1..n |
+| Executor | | Thread | | |
+| | +----------- + | | +-----------+ | |
+| | <=> | Work Items | <=> | | <= | Result Q | <= | |
+| | +------------+ | | +-----------+ | |
+| | | 6: call() | | | | ... | | |
+| | | future | | | | 4, result | | |
+| | | ... | | | | 3, except | | |
++----------+ +------------+ +--------+ +-----------+ +---------+
+
+Executor.submit() called:
+- creates a uniquely numbered _WorkItem and adds it to the "Work Items" dict
+- adds the id of the _WorkItem to the "Work Ids" queue
+
+Local worker thread:
+- reads work ids from the "Work Ids" queue and looks up the corresponding
+ WorkItem from the "Work Items" dict: if the work item has been cancelled then
+ it is simply removed from the dict, otherwise it is repackaged as a
+ _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q"
+ until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because
+ calls placed in the "Call Q" can no longer be cancelled with Future.cancel().
+- reads _ResultItems from "Result Q", updates the future stored in the
+ "Work Items" dict and deletes the dict entry
+
+Process #1..n:
+- reads _CallItems from "Call Q", executes the calls, and puts the resulting
+ _ResultItems in "Request Q"
+"""
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+import atexit
+from concurrent.futures import _base
+import queue
+import multiprocessing
+import threading
+import weakref
+
+# Workers are created as daemon threads and processes. This is done to allow the
+# interpreter to exit when there are still idle processes in a
+# ProcessPoolExecutor's process pool (i.e. shutdown() was not called). However,
+# allowing workers to die with the interpreter has two undesirable properties:
+# - The workers would still be running during interpretor shutdown,
+# meaning that they would fail in unpredictable ways.
+# - The workers could be killed while evaluating a work item, which could
+# be bad if the callable being evaluated has external side-effects e.g.
+# writing to a file.
+#
+# To work around this problem, an exit handler is installed which tells the
+# workers to exit when their work queues are empty and then waits until the
+# threads/processes finish.
+
+_threads_queues = weakref.WeakKeyDictionary()
+_shutdown = False
+
+def _python_exit():
+ global _shutdown
+ _shutdown = True
+ items = list(_threads_queues.items())
+ for t, q in items:
+ q.put(None)
+ for t, q in items:
+ t.join()
+
+# Controls how many more calls than processes will be queued in the call queue.
+# A smaller number will mean that processes spend more time idle waiting for
+# work while a larger number will make Future.cancel() succeed less frequently
+# (Futures in the call queue cannot be cancelled).
+EXTRA_QUEUED_CALLS = 1
+
+class _WorkItem(object):
+ def __init__(self, future, fn, args, kwargs):
+ self.future = future
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+class _ResultItem(object):
+ def __init__(self, work_id, exception=None, result=None):
+ self.work_id = work_id
+ self.exception = exception
+ self.result = result
+
+class _CallItem(object):
+ def __init__(self, work_id, fn, args, kwargs):
+ self.work_id = work_id
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+def _process_worker(call_queue, result_queue):
+ """Evaluates calls from call_queue and places the results in result_queue.
+
+ This worker is run in a separate process.
+
+ Args:
+ call_queue: A multiprocessing.Queue of _CallItems that will be read and
+ evaluated by the worker.
+ result_queue: A multiprocessing.Queue of _ResultItems that will written
+ to by the worker.
+ shutdown: A multiprocessing.Event that will be set as a signal to the
+ worker that it should exit when call_queue is empty.
+ """
+ while True:
+ call_item = call_queue.get(block=True)
+ if call_item is None:
+ # Wake up queue management thread
+ result_queue.put(None)
+ return
+ try:
+ r = call_item.fn(*call_item.args, **call_item.kwargs)
+ except BaseException as e:
+ result_queue.put(_ResultItem(call_item.work_id,
+ exception=e))
+ else:
+ result_queue.put(_ResultItem(call_item.work_id,
+ result=r))
+
+def _add_call_item_to_queue(pending_work_items,
+ work_ids,
+ call_queue):
+ """Fills call_queue with _WorkItems from pending_work_items.
+
+ This function never blocks.
+
+ Args:
+ pending_work_items: A dict mapping work ids to _WorkItems e.g.
+ {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
+ work_ids: A queue.Queue of work ids e.g. Queue([5, 6, ...]). Work ids
+ are consumed and the corresponding _WorkItems from
+ pending_work_items are transformed into _CallItems and put in
+ call_queue.
+ call_queue: A multiprocessing.Queue that will be filled with _CallItems
+ derived from _WorkItems.
+ """
+ while True:
+ if call_queue.full():
+ return
+ try:
+ work_id = work_ids.get(block=False)
+ except queue.Empty:
+ return
+ else:
+ work_item = pending_work_items[work_id]
+
+ if work_item.future.set_running_or_notify_cancel():
+ call_queue.put(_CallItem(work_id,
+ work_item.fn,
+ work_item.args,
+ work_item.kwargs),
+ block=True)
+ else:
+ del pending_work_items[work_id]
+ continue
+
+def _queue_management_worker(executor_reference,
+ processes,
+ pending_work_items,
+ work_ids_queue,
+ call_queue,
+ result_queue):
+ """Manages the communication between this process and the worker processes.
+
+ This function is run in a local thread.
+
+ Args:
+ executor_reference: A weakref.ref to the ProcessPoolExecutor that owns
+ this thread. Used to determine if the ProcessPoolExecutor has been
+ garbage collected and that this function can exit.
+ process: A list of the multiprocessing.Process instances used as
+ workers.
+ pending_work_items: A dict mapping work ids to _WorkItems e.g.
+ {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
+ work_ids_queue: A queue.Queue of work ids e.g. Queue([5, 6, ...]).
+ call_queue: A multiprocessing.Queue that will be filled with _CallItems
+ derived from _WorkItems for processing by the process workers.
+ result_queue: A multiprocessing.Queue of _ResultItems generated by the
+ process workers.
+ """
+ nb_shutdown_processes = 0
+ def shutdown_one_process():
+ """Tell a worker to terminate, which will in turn wake us again"""
+ nonlocal nb_shutdown_processes
+ call_queue.put(None)
+ nb_shutdown_processes += 1
+ while True:
+ _add_call_item_to_queue(pending_work_items,
+ work_ids_queue,
+ call_queue)
+
+ result_item = result_queue.get(block=True)
+ if result_item is not None:
+ work_item = pending_work_items[result_item.work_id]
+ del pending_work_items[result_item.work_id]
+
+ if result_item.exception:
+ work_item.future.set_exception(result_item.exception)
+ else:
+ work_item.future.set_result(result_item.result)
+ continue
+ # If we come here, we either got a timeout or were explicitly woken up.
+ # In either case, check whether we should start shutting down.
+ executor = executor_reference()
+ # No more work items can be added if:
+ # - The interpreter is shutting down OR
+ # - The executor that owns this worker has been collected OR
+ # - The executor that owns this worker has been shutdown.
+ if _shutdown or executor is None or executor._shutdown_thread:
+ # Since no new work items can be added, it is safe to shutdown
+ # this thread if there are no pending work items.
+ if not pending_work_items:
+ while nb_shutdown_processes < len(processes):
+ shutdown_one_process()
+ # If .join() is not called on the created processes then
+ # some multiprocessing.Queue methods may deadlock on Mac OS
+ # X.
+ for p in processes:
+ p.join()
+ return
+ else:
+ # Start shutting down by telling a process it can exit.
+ shutdown_one_process()
+ del executor
+
+_system_limits_checked = False
+_system_limited = None
+def _check_system_limits():
+ global _system_limits_checked, _system_limited
+ if _system_limits_checked:
+ if _system_limited:
+ raise NotImplementedError(_system_limited)
+ _system_limits_checked = True
+ try:
+ import os
+ nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
+ except (AttributeError, ValueError):
+ # sysconf not available or setting not available
+ return
+ if nsems_max == -1:
+ # indetermine limit, assume that limit is determined
+ # by available memory only
+ return
+ if nsems_max >= 256:
+ # minimum number of semaphores available
+ # according to POSIX
+ return
+ _system_limited = "system provides too few semaphores (%d available, 256 necessary)" % nsems_max
+ raise NotImplementedError(_system_limited)
+
+class ProcessPoolExecutor(_base.Executor):
+ def __init__(self, max_workers=None):
+ """Initializes a new ProcessPoolExecutor instance.
+
+ Args:
+ max_workers: The maximum number of processes that can be used to
+ execute the given calls. If None or not given then as many
+ worker processes will be created as the machine has processors.
+ """
+ _check_system_limits()
+
+ if max_workers is None:
+ self._max_workers = multiprocessing.cpu_count()
+ else:
+ self._max_workers = max_workers
+
+ # Make the call queue slightly larger than the number of processes to
+ # prevent the worker processes from idling. But don't make it too big
+ # because futures in the call queue cannot be cancelled.
+ self._call_queue = multiprocessing.Queue(self._max_workers +
+ EXTRA_QUEUED_CALLS)
+ self._result_queue = multiprocessing.Queue()
+ self._work_ids = queue.Queue()
+ self._queue_management_thread = None
+ self._processes = set()
+
+ # Shutdown is a two-step process.
+ self._shutdown_thread = False
+ self._shutdown_lock = threading.Lock()
+ self._queue_count = 0
+ self._pending_work_items = {}
+
+ def _start_queue_management_thread(self):
+ # When the executor gets lost, the weakref callback will wake up
+ # the queue management thread.
+ def weakref_cb(_, q=self._result_queue):
+ q.put(None)
+ if self._queue_management_thread is None:
+ self._queue_management_thread = threading.Thread(
+ target=_queue_management_worker,
+ args=(weakref.ref(self, weakref_cb),
+ self._processes,
+ self._pending_work_items,
+ self._work_ids,
+ self._call_queue,
+ self._result_queue))
+ self._queue_management_thread.daemon = True
+ self._queue_management_thread.start()
+ _threads_queues[self._queue_management_thread] = self._result_queue
+
+ def _adjust_process_count(self):
+ for _ in range(len(self._processes), self._max_workers):
+ p = multiprocessing.Process(
+ target=_process_worker,
+ args=(self._call_queue,
+ self._result_queue))
+ p.start()
+ self._processes.add(p)
+
+ def submit(self, fn, *args, **kwargs):
+ with self._shutdown_lock:
+ if self._shutdown_thread:
+ raise RuntimeError('cannot schedule new futures after shutdown')
+
+ f = _base.Future()
+ w = _WorkItem(f, fn, args, kwargs)
+
+ self._pending_work_items[self._queue_count] = w
+ self._work_ids.put(self._queue_count)
+ self._queue_count += 1
+ # Wake up queue management thread
+ self._result_queue.put(None)
+
+ self._start_queue_management_thread()
+ self._adjust_process_count()
+ return f
+ submit.__doc__ = _base.Executor.submit.__doc__
+
+ def shutdown(self, wait=True):
+ with self._shutdown_lock:
+ self._shutdown_thread = True
+ if self._queue_management_thread:
+ # Wake up queue management thread
+ self._result_queue.put(None)
+ if wait:
+ self._queue_management_thread.join()
+ # To reduce the risk of openning too many files, remove references to
+ # objects that use file descriptors.
+ self._queue_management_thread = None
+ self._call_queue = None
+ self._result_queue = None
+ self._processes = None
+ shutdown.__doc__ = _base.Executor.shutdown.__doc__
+
+atexit.register(_python_exit)
diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py
new file mode 100644
index 0000000000..fbac0887a5
--- /dev/null
+++ b/Lib/concurrent/futures/thread.py
@@ -0,0 +1,130 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Implements ThreadPoolExecutor."""
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+import atexit
+from concurrent.futures import _base
+import queue
+import threading
+import weakref
+
+# Workers are created as daemon threads. This is done to allow the interpreter
+# to exit when there are still idle threads in a ThreadPoolExecutor's thread
+# pool (i.e. shutdown() was not called). However, allowing workers to die with
+# the interpreter has two undesirable properties:
+# - The workers would still be running during interpretor shutdown,
+# meaning that they would fail in unpredictable ways.
+# - The workers could be killed while evaluating a work item, which could
+# be bad if the callable being evaluated has external side-effects e.g.
+# writing to a file.
+#
+# To work around this problem, an exit handler is installed which tells the
+# workers to exit when their work queues are empty and then waits until the
+# threads finish.
+
+_threads_queues = weakref.WeakKeyDictionary()
+_shutdown = False
+
+def _python_exit():
+ global _shutdown
+ _shutdown = True
+ items = list(_threads_queues.items())
+ for t, q in items:
+ q.put(None)
+ for t, q in items:
+ t.join()
+
+atexit.register(_python_exit)
+
+class _WorkItem(object):
+ def __init__(self, future, fn, args, kwargs):
+ self.future = future
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+ def run(self):
+ if not self.future.set_running_or_notify_cancel():
+ return
+
+ try:
+ result = self.fn(*self.args, **self.kwargs)
+ except BaseException as e:
+ self.future.set_exception(e)
+ else:
+ self.future.set_result(result)
+
+def _worker(executor_reference, work_queue):
+ try:
+ while True:
+ work_item = work_queue.get(block=True)
+ if work_item is not None:
+ work_item.run()
+ continue
+ executor = executor_reference()
+ # Exit if:
+ # - The interpreter is shutting down OR
+ # - The executor that owns the worker has been collected OR
+ # - The executor that owns the worker has been shutdown.
+ if _shutdown or executor is None or executor._shutdown:
+ # Notice other workers
+ work_queue.put(None)
+ return
+ del executor
+ except BaseException as e:
+ _base.LOGGER.critical('Exception in worker', exc_info=True)
+
+class ThreadPoolExecutor(_base.Executor):
+ def __init__(self, max_workers):
+ """Initializes a new ThreadPoolExecutor instance.
+
+ Args:
+ max_workers: The maximum number of threads that can be used to
+ execute the given calls.
+ """
+ self._max_workers = max_workers
+ self._work_queue = queue.Queue()
+ self._threads = set()
+ self._shutdown = False
+ self._shutdown_lock = threading.Lock()
+
+ def submit(self, fn, *args, **kwargs):
+ with self._shutdown_lock:
+ if self._shutdown:
+ raise RuntimeError('cannot schedule new futures after shutdown')
+
+ f = _base.Future()
+ w = _WorkItem(f, fn, args, kwargs)
+
+ self._work_queue.put(w)
+ self._adjust_thread_count()
+ return f
+ submit.__doc__ = _base.Executor.submit.__doc__
+
+ def _adjust_thread_count(self):
+ # When the executor gets lost, the weakref callback will wake up
+ # the worker threads.
+ def weakref_cb(_, q=self._work_queue):
+ q.put(None)
+ # TODO(bquinlan): Should avoid creating new threads if there are more
+ # idle threads than items in the work queue.
+ if len(self._threads) < self._max_workers:
+ t = threading.Thread(target=_worker,
+ args=(weakref.ref(self, weakref_cb),
+ self._work_queue))
+ t.daemon = True
+ t.start()
+ self._threads.add(t)
+ _threads_queues[t] = self._work_queue
+
+ def shutdown(self, wait=True):
+ with self._shutdown_lock:
+ self._shutdown = True
+ self._work_queue.put(None)
+ if wait:
+ for t in self._threads:
+ t.join()
+ shutdown.__doc__ = _base.Executor.shutdown.__doc__
diff --git a/Lib/configparser.py b/Lib/configparser.py
index c7ae270759..12ba5ad81c 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -1,102 +1,134 @@
"""Configuration file parser.
-A setup file consists of sections, lead by a "[section]" header,
+A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
-The option values can contain format strings which refer to other values in
-the same section, or values in a special [DEFAULT] section.
-
-For example:
-
- something: %(dir)s/whatever
-
-would resolve the "%(dir)s" to the value of dir. All reference
-expansions are done late, on demand.
-
Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.
class:
ConfigParser -- responsible for parsing a list of
- configuration files, and managing the parsed database.
+ configuration files, and managing the parsed database.
methods:
- __init__(defaults=None)
- create the parser and specify a dictionary of intrinsic defaults. The
- keys must be strings, the values must be appropriate for %()s string
- interpolation. Note that `__name__' is always an intrinsic default;
- its value is the section's name.
+ __init__(defaults=None, dict_type=_default_dict, allow_no_value=False,
+ delimiters=('=', ':'), comment_prefixes=('#', ';'),
+ inline_comment_prefixes=None, strict=True,
+ empty_lines_in_values=True):
+ Create the parser. When `defaults' is given, it is initialized into the
+ dictionary or intrinsic defaults. The keys must be strings, the values
+ must be appropriate for %()s string interpolation.
+
+ When `dict_type' is given, it will be used to create the dictionary
+ objects for the list of sections, for the options within a section, and
+ for the default values.
+
+ When `delimiters' is given, it will be used as the set of substrings
+ that divide keys from values.
+
+ When `comment_prefixes' is given, it will be used as the set of
+ substrings that prefix comments in empty lines. Comments can be
+ indented.
+
+ When `inline_comment_prefixes' is given, it will be used as the set of
+ substrings that prefix comments in non-empty lines.
+
+ When `strict` is True, the parser won't allow for any section or option
+ duplicates while reading from a single source (file, string or
+ dictionary). Default is True.
+
+ When `empty_lines_in_values' is False (default: True), each empty line
+ marks the end of an option. Otherwise, internal empty lines of
+ a multiline option are kept as part of the value.
+
+ When `allow_no_value' is True (default: False), options without
+ values are accepted; the value presented for these is None.
sections()
- return all the configuration section names, sans DEFAULT
+ Return all the configuration section names, sans DEFAULT.
has_section(section)
- return whether the given section exists
+ Return whether the given section exists.
has_option(section, option)
- return whether the given option exists in the given section
+ Return whether the given option exists in the given section.
options(section)
- return list of configuration options for the named section
+ Return list of configuration options for the named section.
- read(filenames)
- read and parse the list of named configuration files, given by
+ read(filenames, encoding=None)
+ Read and parse the list of named configuration files, given by
name. A single filename is also allowed. Non-existing files
are ignored. Return list of successfully read files.
- readfp(fp, filename=None)
- read and parse one configuration file, given as a file object.
- The filename defaults to fp.name; it is only used in error
- messages (if fp has no `name' attribute, the string `<???>' is used).
+ read_file(f, filename=None)
+ Read and parse one configuration file, given as a file object.
+ The filename defaults to f.name; it is only used in error
+ messages (if f has no `name' attribute, the string `<???>' is used).
+
+ read_string(string)
+ Read configuration from a given string.
- get(section, option, raw=False, vars=None)
- return a string value for the named option. All % interpolations are
+ read_dict(dictionary)
+ Read configuration from a dictionary. Keys are section names,
+ values are dictionaries with keys and values that should be present
+ in the section. If the used dictionary type preserves order, sections
+ and their keys will be added in order. Values are automatically
+ converted to strings.
+
+ get(section, option, raw=False, vars=None, fallback=_UNSET)
+ Return a string value for the named option. All % interpolations are
expanded in the return values, based on the defaults passed into the
constructor and the DEFAULT section. Additional substitutions may be
provided using the `vars' argument, which must be a dictionary whose
- contents override any pre-existing defaults.
+ contents override any pre-existing defaults. If `option' is a key in
+ `vars', the value from `vars' is used.
- getint(section, options)
- like get(), but convert value to an integer
+ getint(section, options, raw=False, vars=None, fallback=_UNSET)
+ Like get(), but convert value to an integer.
- getfloat(section, options)
- like get(), but convert value to a float
+ getfloat(section, options, raw=False, vars=None, fallback=_UNSET)
+ Like get(), but convert value to a float.
- getboolean(section, options)
- like get(), but convert value to a boolean (currently case
+ getboolean(section, options, raw=False, vars=None, fallback=_UNSET)
+ Like get(), but convert value to a boolean (currently case
insensitively defined as 0, false, no, off for False, and 1, true,
yes, on for True). Returns False or True.
- items(section, raw=False, vars=None)
+ items(section=_UNSET, raw=False, vars=None)
+ If section is given, return a list of tuples with (section_name,
+ section_proxy) for each section, including DEFAULTSECT. Otherwise,
return a list of tuples with (name, value) for each option
in the section.
remove_section(section)
- remove the given file section and all its options
+ Remove the given file section and all its options.
remove_option(section, option)
- remove the given option from the given section
+ Remove the given option from the given section.
set(section, option, value)
- set the given option
+ Set the given option.
- write(fp)
- write the configuration state in .ini format
+ write(fp, space_around_delimiters=True)
+ Write the configuration state in .ini format. If
+ `space_around_delimiters' is True (the default), delimiters
+ between keys and values are surrounded by spaces.
"""
-try:
- from collections import OrderedDict as _default_dict
-except ImportError:
- # fallback for setup.py which hasn't yet built _collections
- _default_dict = dict
-
+from collections import MutableMapping, OrderedDict as _default_dict, _ChainMap
+import functools
+import io
+import itertools
import re
+import sys
+import warnings
-__all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError",
- "InterpolationError", "InterpolationDepthError",
+__all__ = ["NoSectionError", "DuplicateOptionError", "DuplicateSectionError",
+ "NoOptionError", "InterpolationError", "InterpolationDepthError",
"InterpolationSyntaxError", "ParsingError",
"MissingSectionHeaderError",
"ConfigParser", "SafeConfigParser", "RawConfigParser",
@@ -114,12 +146,14 @@ class Error(Exception):
def _get_message(self):
"""Getter for 'message'; needed only to override deprecation in
- BaseException."""
+ BaseException.
+ """
return self.__message
def _set_message(self, value):
"""Setter for 'message'; needed only to override deprecation in
- BaseException."""
+ BaseException.
+ """
self.__message = value
# BaseException.message has been deprecated since Python 2.6. To prevent
@@ -136,19 +170,68 @@ class Error(Exception):
__str__ = __repr__
+
class NoSectionError(Error):
"""Raised when no section matches a requested option."""
def __init__(self, section):
Error.__init__(self, 'No section: %r' % (section,))
self.section = section
+ self.args = (section, )
+
class DuplicateSectionError(Error):
- """Raised when a section is multiply-created."""
+ """Raised when a section is repeated in an input source.
- def __init__(self, section):
- Error.__init__(self, "Section %r already exists" % section)
+ Possible repetitions that raise this exception are: multiple creation
+ using the API or in strict parsers when a section is found more than once
+ in a single input file, string or dictionary.
+ """
+
+ def __init__(self, section, source=None, lineno=None):
+ msg = [repr(section), " already exists"]
+ if source is not None:
+ message = ["While reading from ", source]
+ if lineno is not None:
+ message.append(" [line {0:2d}]".format(lineno))
+ message.append(": section ")
+ message.extend(msg)
+ msg = message
+ else:
+ msg.insert(0, "Section ")
+ Error.__init__(self, "".join(msg))
self.section = section
+ self.source = source
+ self.lineno = lineno
+ self.args = (section, source, lineno)
+
+
+class DuplicateOptionError(Error):
+ """Raised by strict parsers when an option is repeated in an input source.
+
+ Current implementation raises this exception only when an option is found
+ more than once in a single file, string or dictionary.
+ """
+
+ def __init__(self, section, option, source=None, lineno=None):
+ msg = [repr(option), " in section ", repr(section),
+ " already exists"]
+ if source is not None:
+ message = ["While reading from ", source]
+ if lineno is not None:
+ message.append(" [line {0:2d}]".format(lineno))
+ message.append(": option ")
+ message.extend(msg)
+ msg = message
+ else:
+ msg.insert(0, "Option ")
+ Error.__init__(self, "".join(msg))
+ self.section = section
+ self.option = option
+ self.source = source
+ self.lineno = lineno
+ self.args = (section, option, source, lineno)
+
class NoOptionError(Error):
"""A requested option was not found."""
@@ -158,6 +241,8 @@ class NoOptionError(Error):
(option, section))
self.option = option
self.section = section
+ self.args = (option, section)
+
class InterpolationError(Error):
"""Base class for interpolation-related exceptions."""
@@ -166,6 +251,8 @@ class InterpolationError(Error):
Error.__init__(self, msg)
self.option = option
self.section = section
+ self.args = (option, section, msg)
+
class InterpolationMissingOptionError(InterpolationError):
"""A string substitution required a setting which was not available."""
@@ -179,10 +266,16 @@ class InterpolationMissingOptionError(InterpolationError):
% (section, option, reference, rawval))
InterpolationError.__init__(self, option, section, msg)
self.reference = reference
+ self.args = (option, section, rawval, reference)
+
class InterpolationSyntaxError(InterpolationError):
- """Raised when the source text into which substitutions are made
- does not conform to the required syntax."""
+ """Raised when the source text contains invalid syntax.
+
+ Current implementation raises this exception when the source text into
+ which substitutions are made does not conform to the required syntax.
+ """
+
class InterpolationDepthError(InterpolationError):
"""Raised when substitutions are nested too deeply."""
@@ -194,19 +287,52 @@ class InterpolationDepthError(InterpolationError):
"\trawval : %s\n"
% (section, option, rawval))
InterpolationError.__init__(self, option, section, msg)
+ self.args = (option, section, rawval)
+
class ParsingError(Error):
"""Raised when a configuration file does not follow legal syntax."""
- def __init__(self, filename):
- Error.__init__(self, 'File contains parsing errors: %s' % filename)
- self.filename = filename
+ def __init__(self, source=None, filename=None):
+ # Exactly one of `source'/`filename' arguments has to be given.
+ # `filename' kept for compatibility.
+ if filename and source:
+ raise ValueError("Cannot specify both `filename' and `source'. "
+ "Use `source'.")
+ elif not filename and not source:
+ raise ValueError("Required argument `source' not given.")
+ elif filename:
+ source = filename
+ Error.__init__(self, 'Source contains parsing errors: %s' % source)
+ self.source = source
self.errors = []
+ self.args = (source, )
+
+ @property
+ def filename(self):
+ """Deprecated, use `source'."""
+ warnings.warn(
+ "The 'filename' attribute will be removed in future versions. "
+ "Use 'source' instead.",
+ DeprecationWarning, stacklevel=2
+ )
+ return self.source
+
+ @filename.setter
+ def filename(self, value):
+ """Deprecated, user `source'."""
+ warnings.warn(
+ "The 'filename' attribute will be removed in future versions. "
+ "Use 'source' instead.",
+ DeprecationWarning, stacklevel=2
+ )
+ self.source = value
def append(self, lineno, line):
self.errors.append((lineno, line))
self.message += '\n\t[line %2d]: %s' % (lineno, line)
+
class MissingSectionHeaderError(ParsingError):
"""Raised when a key-value pair is found before any section header."""
@@ -215,19 +341,294 @@ class MissingSectionHeaderError(ParsingError):
self,
'File contains no section headers.\nfile: %s, line: %d\n%r' %
(filename, lineno, line))
- self.filename = filename
+ self.source = filename
self.lineno = lineno
self.line = line
+ self.args = (filename, lineno, line)
+
+
+# Used in parser getters to indicate the default behaviour when a specific
+# option is not found it to raise an exception. Created to enable `None' as
+# a valid fallback value.
+_UNSET = object()
+
+
+class Interpolation:
+ """Dummy interpolation that passes the value through with no changes."""
+
+ def before_get(self, parser, section, option, value, defaults):
+ return value
+
+ def before_set(self, parser, section, option, value):
+ return value
+
+ def before_read(self, parser, section, option, value):
+ return value
+
+ def before_write(self, parser, section, option, value):
+ return value
+
+
+class BasicInterpolation(Interpolation):
+ """Interpolation as implemented in the classic ConfigParser.
+
+ The option values can contain format strings which refer to other values in
+ the same section, or values in the special default section.
+
+ For example:
+
+ something: %(dir)s/whatever
+
+ would resolve the "%(dir)s" to the value of dir. All reference
+ expansions are done late, on demand. If a user needs to use a bare % in
+ a configuration file, she can escape it by writing %%. Other other % usage
+ is considered a user error and raises `InterpolationSyntaxError'."""
+
+ _KEYCRE = re.compile(r"%\(([^)]+)\)s")
+
+ def before_get(self, parser, section, option, value, defaults):
+ L = []
+ self._interpolate_some(parser, option, L, value, section, defaults, 1)
+ return ''.join(L)
+
+ def before_set(self, parser, section, option, value):
+ tmp_value = value.replace('%%', '') # escaped percent signs
+ tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
+ if '%' in tmp_value:
+ raise ValueError("invalid interpolation syntax in %r at "
+ "position %d" % (value, tmp_value.find('%')))
+ return value
+
+ def _interpolate_some(self, parser, option, accum, rest, section, map,
+ depth):
+ if depth > MAX_INTERPOLATION_DEPTH:
+ raise InterpolationDepthError(option, section, rest)
+ while rest:
+ p = rest.find("%")
+ if p < 0:
+ accum.append(rest)
+ return
+ if p > 0:
+ accum.append(rest[:p])
+ rest = rest[p:]
+ # p is no longer used
+ c = rest[1:2]
+ if c == "%":
+ accum.append("%")
+ rest = rest[2:]
+ elif c == "(":
+ m = self._KEYCRE.match(rest)
+ if m is None:
+ raise InterpolationSyntaxError(option, section,
+ "bad interpolation variable reference %r" % rest)
+ var = parser.optionxform(m.group(1))
+ rest = rest[m.end():]
+ try:
+ v = map[var]
+ except KeyError:
+ raise InterpolationMissingOptionError(
+ option, section, rest, var)
+ if "%" in v:
+ self._interpolate_some(parser, option, accum, v,
+ section, map, depth + 1)
+ else:
+ accum.append(v)
+ else:
+ raise InterpolationSyntaxError(
+ option, section,
+ "'%%' must be followed by '%%' or '(', "
+ "found: %r" % (rest,))
+
+
+class ExtendedInterpolation(Interpolation):
+ """Advanced variant of interpolation, supports the syntax used by
+ `zc.buildout'. Enables interpolation between sections."""
+
+ _KEYCRE = re.compile(r"\$\{([^}]+)\}")
+
+ def before_get(self, parser, section, option, value, defaults):
+ L = []
+ self._interpolate_some(parser, option, L, value, section, defaults, 1)
+ return ''.join(L)
+ def before_set(self, parser, section, option, value):
+ tmp_value = value.replace('$$', '') # escaped dollar signs
+ tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
+ if '$' in tmp_value:
+ raise ValueError("invalid interpolation syntax in %r at "
+ "position %d" % (value, tmp_value.find('%')))
+ return value
+
+ def _interpolate_some(self, parser, option, accum, rest, section, map,
+ depth):
+ if depth > MAX_INTERPOLATION_DEPTH:
+ raise InterpolationDepthError(option, section, rest)
+ while rest:
+ p = rest.find("$")
+ if p < 0:
+ accum.append(rest)
+ return
+ if p > 0:
+ accum.append(rest[:p])
+ rest = rest[p:]
+ # p is no longer used
+ c = rest[1:2]
+ if c == "$":
+ accum.append("$")
+ rest = rest[2:]
+ elif c == "{":
+ m = self._KEYCRE.match(rest)
+ if m is None:
+ raise InterpolationSyntaxError(option, section,
+ "bad interpolation variable reference %r" % rest)
+ path = m.group(1).split(':')
+ rest = rest[m.end():]
+ sect = section
+ opt = option
+ try:
+ if len(path) == 1:
+ opt = parser.optionxform(path[0])
+ v = map[opt]
+ elif len(path) == 2:
+ sect = path[0]
+ opt = parser.optionxform(path[1])
+ v = parser.get(sect, opt, raw=True)
+ else:
+ raise InterpolationSyntaxError(
+ option, section,
+ "More than one ':' found: %r" % (rest,))
+ except (KeyError, NoSectionError, NoOptionError):
+ raise InterpolationMissingOptionError(
+ option, section, rest, ":".join(path))
+ if "$" in v:
+ self._interpolate_some(parser, opt, accum, v, sect,
+ dict(parser.items(sect, raw=True)),
+ depth + 1)
+ else:
+ accum.append(v)
+ else:
+ raise InterpolationSyntaxError(
+ option, section,
+ "'$' must be followed by '$' or '{', "
+ "found: %r" % (rest,))
+
+
+class LegacyInterpolation(Interpolation):
+ """Deprecated interpolation used in old versions of ConfigParser.
+ Use BasicInterpolation or ExtendedInterpolation instead."""
+
+ _KEYCRE = re.compile(r"%\(([^)]*)\)s|.")
+
+ def before_get(self, parser, section, option, value, vars):
+ rawval = value
+ depth = MAX_INTERPOLATION_DEPTH
+ while depth: # Loop through this until it's done
+ depth -= 1
+ if value and "%(" in value:
+ replace = functools.partial(self._interpolation_replace,
+ parser=parser)
+ value = self._KEYCRE.sub(replace, value)
+ try:
+ value = value % vars
+ except KeyError as e:
+ raise InterpolationMissingOptionError(
+ option, section, rawval, e.args[0])
+ else:
+ break
+ if value and "%(" in value:
+ raise InterpolationDepthError(option, section, rawval)
+ return value
+
+ def before_set(self, parser, section, option, value):
+ return value
+
+ @staticmethod
+ def _interpolation_replace(match, parser):
+ s = match.group(1)
+ if s is None:
+ return match.group()
+ else:
+ return "%%(%s)s" % parser.optionxform(s)
+
+
+class RawConfigParser(MutableMapping):
+ """ConfigParser that does not do interpolation."""
+
+ # Regular expressions for parsing section headers and options
+ _SECT_TMPL = r"""
+ \[ # [
+ (?P<header>[^]]+) # very permissive!
+ \] # ]
+ """
+ _OPT_TMPL = r"""
+ (?P<option>.*?) # very permissive!
+ \s*(?P<vi>{delim})\s* # any number of space/tab,
+ # followed by any of the
+ # allowed delimiters,
+ # followed by any space/tab
+ (?P<value>.*)$ # everything up to eol
+ """
+ _OPT_NV_TMPL = r"""
+ (?P<option>.*?) # very permissive!
+ \s*(?: # any number of space/tab,
+ (?P<vi>{delim})\s* # optionally followed by
+ # any of the allowed
+ # delimiters, followed by any
+ # space/tab
+ (?P<value>.*))?$ # everything up to eol
+ """
+ # Interpolation algorithm to be used if the user does not specify another
+ _DEFAULT_INTERPOLATION = Interpolation()
+ # Compiled regular expression for matching sections
+ SECTCRE = re.compile(_SECT_TMPL, re.VERBOSE)
+ # Compiled regular expression for matching options with typical separators
+ OPTCRE = re.compile(_OPT_TMPL.format(delim="=|:"), re.VERBOSE)
+ # Compiled regular expression for matching options with optional values
+ # delimited using typical separators
+ OPTCRE_NV = re.compile(_OPT_NV_TMPL.format(delim="=|:"), re.VERBOSE)
+ # Compiled regular expression for matching leading whitespace in a line
+ NONSPACECRE = re.compile(r"\S")
+ # Possible boolean values in the configuration.
+ BOOLEAN_STATES = {'1': True, 'yes': True, 'true': True, 'on': True,
+ '0': False, 'no': False, 'false': False, 'off': False}
+
+ def __init__(self, defaults=None, dict_type=_default_dict,
+ allow_no_value=False, *, delimiters=('=', ':'),
+ comment_prefixes=('#', ';'), inline_comment_prefixes=None,
+ strict=True, empty_lines_in_values=True,
+ default_section=DEFAULTSECT,
+ interpolation=_UNSET):
-class RawConfigParser:
- def __init__(self, defaults=None, dict_type=_default_dict):
self._dict = dict_type
self._sections = self._dict()
self._defaults = self._dict()
+ self._proxies = self._dict()
+ self._proxies[default_section] = SectionProxy(self, default_section)
if defaults:
for key, value in defaults.items():
self._defaults[self.optionxform(key)] = value
+ self._delimiters = tuple(delimiters)
+ if delimiters == ('=', ':'):
+ self._optcre = self.OPTCRE_NV if allow_no_value else self.OPTCRE
+ else:
+ d = "|".join(re.escape(d) for d in delimiters)
+ if allow_no_value:
+ self._optcre = re.compile(self._OPT_NV_TMPL.format(delim=d),
+ re.VERBOSE)
+ else:
+ self._optcre = re.compile(self._OPT_TMPL.format(delim=d),
+ re.VERBOSE)
+ self._comment_prefixes = tuple(comment_prefixes or ())
+ self._inline_comment_prefixes = tuple(inline_comment_prefixes or ())
+ self._strict = strict
+ self._allow_no_value = allow_no_value
+ self._empty_lines_in_values = empty_lines_in_values
+ self.default_section=default_section
+ self._interpolation = interpolation
+ if self._interpolation is _UNSET:
+ self._interpolation = self._DEFAULT_INTERPOLATION
+ if self._interpolation is None:
+ self._interpolation = Interpolation()
def defaults(self):
return self._defaults
@@ -241,15 +642,15 @@ class RawConfigParser:
"""Create a new section in the configuration.
Raise DuplicateSectionError if a section by the specified name
- already exists. Raise ValueError if name is DEFAULT or any of it's
- case-insensitive variants.
+ already exists. Raise ValueError if name is DEFAULT.
"""
- if section.lower() == "default":
- raise ValueError('Invalid section name: %s' % section)
+ if section == self.default_section:
+ raise ValueError('Invalid section name: %r' % section)
if section in self._sections:
raise DuplicateSectionError(section)
self._sections[section] = self._dict()
+ self._proxies[section] = SectionProxy(self, section)
def has_section(self, section):
"""Indicate whether the named section is present in the configuration.
@@ -265,11 +666,9 @@ class RawConfigParser:
except KeyError:
raise NoSectionError(section)
opts.update(self._defaults)
- if '__name__' in opts:
- del opts['__name__']
return list(opts.keys())
- def read(self, filenames):
+ def read(self, filenames, encoding=None):
"""Read and parse a filename or a list of filenames.
Files that cannot be opened are silently ignored; this is
@@ -286,83 +685,181 @@ class RawConfigParser:
read_ok = []
for filename in filenames:
try:
- fp = open(filename)
+ with open(filename, encoding=encoding) as fp:
+ self._read(fp, filename)
except IOError:
continue
- self._read(fp, filename)
- fp.close()
read_ok.append(filename)
return read_ok
- def readfp(self, fp, filename=None):
+ def read_file(self, f, source=None):
"""Like read() but the argument must be a file-like object.
- The `fp' argument must have a `readline' method. Optional
- second argument is the `filename', which if not given, is
- taken from fp.name. If fp has no `name' attribute, `<???>' is
- used.
-
+ The `f' argument must be iterable, returning one line at a time.
+ Optional second argument is the `source' specifying the name of the
+ file being read. If not given, it is taken from f.name. If `f' has no
+ `name' attribute, `<???>' is used.
"""
- if filename is None:
+ if source is None:
try:
- filename = fp.name
+ source = f.name
except AttributeError:
- filename = '<???>'
- self._read(fp, filename)
+ source = '<???>'
+ self._read(f, source)
- def get(self, section, option):
- opt = self.optionxform(option)
- if section not in self._sections:
- if section != DEFAULTSECT:
- raise NoSectionError(section)
- if opt in self._defaults:
- return self._defaults[opt]
+ def read_string(self, string, source='<string>'):
+ """Read configuration from a given string."""
+ sfile = io.StringIO(string)
+ self.read_file(sfile, source)
+
+ def read_dict(self, dictionary, source='<dict>'):
+ """Read configuration from a dictionary.
+
+ Keys are section names, values are dictionaries with keys and values
+ that should be present in the section. If the used dictionary type
+ preserves order, sections and their keys will be added in order.
+
+ All types held in the dictionary are converted to strings during
+ reading, including section names, option names and keys.
+
+ Optional second argument is the `source' specifying the name of the
+ dictionary being read.
+ """
+ elements_added = set()
+ for section, keys in dictionary.items():
+ section = str(section)
+ try:
+ self.add_section(section)
+ except (DuplicateSectionError, ValueError):
+ if self._strict and section in elements_added:
+ raise
+ elements_added.add(section)
+ for key, value in keys.items():
+ key = self.optionxform(str(key))
+ if value is not None:
+ value = str(value)
+ if self._strict and (section, key) in elements_added:
+ raise DuplicateOptionError(section, key, source)
+ elements_added.add((section, key))
+ self.set(section, key, value)
+
+ def readfp(self, fp, filename=None):
+ """Deprecated, use read_file instead."""
+ warnings.warn(
+ "This method will be removed in future versions. "
+ "Use 'parser.read_file()' instead.",
+ DeprecationWarning, stacklevel=2
+ )
+ self.read_file(fp, source=filename)
+
+ def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
+ """Get an option value for a given section.
+
+ If `vars' is provided, it must be a dictionary. The option is looked up
+ in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
+ If the key is not found and `fallback' is provided, it is used as
+ a fallback value. `None' can be provided as a `fallback' value.
+
+ If interpolation is enabled and the optional argument `raw' is False,
+ all interpolations are expanded in the return values.
+
+ Arguments `raw', `vars', and `fallback' are keyword only.
+
+ The section DEFAULT is special.
+ """
+ try:
+ d = self._unify_values(section, vars)
+ except NoSectionError:
+ if fallback is _UNSET:
+ raise
else:
+ return fallback
+ option = self.optionxform(option)
+ try:
+ value = d[option]
+ except KeyError:
+ if fallback is _UNSET:
raise NoOptionError(option, section)
- elif opt in self._sections[section]:
- return self._sections[section][opt]
- elif opt in self._defaults:
- return self._defaults[opt]
+ else:
+ return fallback
+
+ if raw or value is None:
+ return value
else:
- raise NoOptionError(option, section)
+ return self._interpolation.before_get(self, section, option, value,
+ d)
- def items(self, section):
+ def _get(self, section, conv, option, **kwargs):
+ return conv(self.get(section, option, **kwargs))
+
+ def getint(self, section, option, *, raw=False, vars=None,
+ fallback=_UNSET):
try:
- d2 = self._sections[section]
- except KeyError:
- if section != DEFAULTSECT:
- raise NoSectionError(section)
- d2 = self._dict()
- d = self._defaults.copy()
- d.update(d2)
- if "__name__" in d:
- del d["__name__"]
- return d.items()
+ return self._get(section, int, option, raw=raw, vars=vars)
+ except (NoSectionError, NoOptionError):
+ if fallback is _UNSET:
+ raise
+ else:
+ return fallback
- def _get(self, section, conv, option):
- return conv(self.get(section, option))
+ def getfloat(self, section, option, *, raw=False, vars=None,
+ fallback=_UNSET):
+ try:
+ return self._get(section, float, option, raw=raw, vars=vars)
+ except (NoSectionError, NoOptionError):
+ if fallback is _UNSET:
+ raise
+ else:
+ return fallback
- def getint(self, section, option):
- return self._get(section, int, option)
+ def getboolean(self, section, option, *, raw=False, vars=None,
+ fallback=_UNSET):
+ try:
+ return self._get(section, self._convert_to_boolean, option,
+ raw=raw, vars=vars)
+ except (NoSectionError, NoOptionError):
+ if fallback is _UNSET:
+ raise
+ else:
+ return fallback
- def getfloat(self, section, option):
- return self._get(section, float, option)
+ def items(self, section=_UNSET, raw=False, vars=None):
+ """Return a list of (name, value) tuples for each option in a section.
- _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True,
- '0': False, 'no': False, 'false': False, 'off': False}
+ All % interpolations are expanded in the return values, based on the
+ defaults passed into the constructor, unless the optional argument
+ `raw' is true. Additional substitutions may be provided using the
+ `vars' argument, which must be a dictionary whose contents overrides
+ any pre-existing defaults.
- def getboolean(self, section, option):
- v = self.get(section, option)
- if v.lower() not in self._boolean_states:
- raise ValueError('Not a boolean: %s' % v)
- return self._boolean_states[v.lower()]
+ The section DEFAULT is special.
+ """
+ if section is _UNSET:
+ return super().items()
+ d = self._defaults.copy()
+ try:
+ d.update(self._sections[section])
+ except KeyError:
+ if section != self.default_section:
+ raise NoSectionError(section)
+ # Update with the entry specific variables
+ if vars:
+ for key, value in vars.items():
+ d[self.optionxform(key)] = value
+ value_getter = lambda option: self._interpolation.before_get(self,
+ section, option, d[option], d)
+ if raw:
+ value_getter = lambda option: d[option]
+ return [(option, value_getter(option)) for option in d.keys()]
def optionxform(self, optionstr):
return optionstr.lower()
def has_option(self, section, option):
- """Check for the existence of a given option in a given section."""
- if not section or section == DEFAULTSECT:
+ """Check for the existence of a given option in a given section.
+ If the specified `section' is None or an empty string, DEFAULT is
+ assumed. If the specified `section' does not exist, returns False."""
+ if not section or section == self.default_section:
option = self.optionxform(option)
return option in self._defaults
elif section not in self._sections:
@@ -372,9 +869,12 @@ class RawConfigParser:
return (option in self._sections[section]
or option in self._defaults)
- def set(self, section, option, value):
+ def set(self, section, option, value=None):
"""Set an option."""
- if not section or section == DEFAULTSECT:
+ if value:
+ value = self._interpolation.before_set(self, section, option,
+ value)
+ if not section or section == self.default_section:
sectdict = self._defaults
else:
try:
@@ -383,24 +883,39 @@ class RawConfigParser:
raise NoSectionError(section)
sectdict[self.optionxform(option)] = value
- def write(self, fp):
- """Write an .ini-format representation of the configuration state."""
+ def write(self, fp, space_around_delimiters=True):
+ """Write an .ini-format representation of the configuration state.
+
+ If `space_around_delimiters' is True (the default), delimiters
+ between keys and values are surrounded by spaces.
+ """
+ if space_around_delimiters:
+ d = " {} ".format(self._delimiters[0])
+ else:
+ d = self._delimiters[0]
if self._defaults:
- fp.write("[%s]\n" % DEFAULTSECT)
- for (key, value) in self._defaults.items():
- fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
- fp.write("\n")
+ self._write_section(fp, self.default_section,
+ self._defaults.items(), d)
for section in self._sections:
- fp.write("[%s]\n" % section)
- for (key, value) in self._sections[section].items():
- if key != "__name__":
- fp.write("%s = %s\n" %
- (key, str(value).replace('\n', '\n\t')))
- fp.write("\n")
+ self._write_section(fp, section,
+ self._sections[section].items(), d)
+
+ def _write_section(self, fp, section_name, section_items, delimiter):
+ """Write a single section to the specified `fp'."""
+ fp.write("[{}]\n".format(section_name))
+ for key, value in section_items:
+ value = self._interpolation.before_write(self, section_name, key,
+ value)
+ if value is not None or not self._allow_no_value:
+ value = delimiter + str(value).replace('\n', '\n\t')
+ else:
+ value = ""
+ fp.write("{}{}\n".format(key, value))
+ fp.write("\n")
def remove_option(self, section, option):
"""Remove an option."""
- if not section or section == DEFAULTSECT:
+ if not section or section == self.default_section:
sectdict = self._defaults
else:
try:
@@ -418,69 +933,117 @@ class RawConfigParser:
existed = section in self._sections
if existed:
del self._sections[section]
+ del self._proxies[section]
return existed
- #
- # Regular expressions for parsing section headers and options.
- #
- SECTCRE = re.compile(
- r'\[' # [
- r'(?P<header>[^]]+)' # very permissive!
- r'\]' # ]
- )
- OPTCRE = re.compile(
- r'(?P<option>[^:=\s][^:=]*)' # very permissive!
- r'\s*(?P<vi>[:=])\s*' # any number of space/tab,
- # followed by separator
- # (either : or =), followed
- # by any # space/tab
- r'(?P<value>.*)$' # everything up to eol
- )
+ def __getitem__(self, key):
+ if key != self.default_section and not self.has_section(key):
+ raise KeyError(key)
+ return self._proxies[key]
+
+ def __setitem__(self, key, value):
+ # To conform with the mapping protocol, overwrites existing values in
+ # the section.
+
+ # XXX this is not atomic if read_dict fails at any point. Then again,
+ # no update method in configparser is atomic in this implementation.
+ self.remove_section(key)
+ self.read_dict({key: value})
+
+ def __delitem__(self, key):
+ if key == self.default_section:
+ raise ValueError("Cannot remove the default section.")
+ if not self.has_section(key):
+ raise KeyError(key)
+ self.remove_section(key)
+
+ def __contains__(self, key):
+ return key == self.default_section or self.has_section(key)
+
+ def __len__(self):
+ return len(self._sections) + 1 # the default section
+
+ def __iter__(self):
+ # XXX does it break when underlying container state changed?
+ return itertools.chain((self.default_section,), self._sections.keys())
def _read(self, fp, fpname):
- """Parse a sectioned setup file.
-
- The sections in setup file contains a title line at the top,
- indicated by a name in square brackets (`[]'), plus key/value
- options lines, indicated by `name: value' format lines.
- Continuations are represented by an embedded newline then
- leading whitespace. Blank lines, lines beginning with a '#',
- and just about everything else are ignored.
+ """Parse a sectioned configuration file.
+
+ Each section in a configuration file contains a header, indicated by
+ a name in square brackets (`[]'), plus key/value options, indicated by
+ `name' and `value' delimited with a specific substring (`=' or `:' by
+ default).
+
+ Values can span multiple lines, as long as they are indented deeper
+ than the first line of the value. Depending on the parser's mode, blank
+ lines may be treated as parts of multiline values or ignored.
+
+ Configuration files may include comments, prefixed by specific
+ characters (`#' and `;' by default). Comments may appear on their own
+ in an otherwise empty line or may be entered in lines holding values or
+ section names.
"""
- cursect = None # None, or a dictionary
+ elements_added = set()
+ cursect = None # None, or a dictionary
+ sectname = None
optname = None
lineno = 0
- e = None # None, or an exception
- while True:
- line = fp.readline()
- if not line:
- break
- lineno = lineno + 1
- # comment or blank line?
- if line.strip() == '' or line[0] in '#;':
- continue
- if line.split(None, 1)[0].lower() == 'rem' and line[0] in "rR":
- # no leading whitespace
+ indent_level = 0
+ e = None # None, or an exception
+ for lineno, line in enumerate(fp, start=1):
+ comment_start = None
+ # strip inline comments
+ for prefix in self._inline_comment_prefixes:
+ index = line.find(prefix)
+ if index == 0 or (index > 0 and line[index-1].isspace()):
+ comment_start = index
+ break
+ # strip full line comments
+ for prefix in self._comment_prefixes:
+ if line.strip().startswith(prefix):
+ comment_start = 0
+ break
+ value = line[:comment_start].strip()
+ if not value:
+ if self._empty_lines_in_values:
+ # add empty line to the value, but only if there was no
+ # comment on the line
+ if (comment_start is None and
+ cursect is not None and
+ optname and
+ cursect[optname] is not None):
+ cursect[optname].append('') # newlines added at join
+ else:
+ # empty line marks end of value
+ indent_level = sys.maxsize
continue
# continuation line?
- if line[0].isspace() and cursect is not None and optname:
- value = line.strip()
- if value:
- cursect[optname] = "%s\n%s" % (cursect[optname], value)
+ first_nonspace = self.NONSPACECRE.search(line)
+ cur_indent_level = first_nonspace.start() if first_nonspace else 0
+ if (cursect is not None and optname and
+ cur_indent_level > indent_level):
+ cursect[optname].append(value)
# a section header or option header?
else:
+ indent_level = cur_indent_level
# is it a section header?
- mo = self.SECTCRE.match(line)
+ mo = self.SECTCRE.match(value)
if mo:
sectname = mo.group('header')
if sectname in self._sections:
+ if self._strict and sectname in elements_added:
+ raise DuplicateSectionError(sectname, fpname,
+ lineno)
cursect = self._sections[sectname]
- elif sectname == DEFAULTSECT:
+ elements_added.add(sectname)
+ elif sectname == self.default_section:
cursect = self._defaults
else:
cursect = self._dict()
- cursect['__name__'] = sectname
self._sections[sectname] = cursect
+ self._proxies[sectname] = SectionProxy(self, sectname)
+ elements_added.add(sectname)
# So sections can't start with a continuation line
optname = None
# no section header in the file?
@@ -488,253 +1051,197 @@ class RawConfigParser:
raise MissingSectionHeaderError(fpname, lineno, line)
# an option line?
else:
- mo = self.OPTCRE.match(line)
+ mo = self._optcre.match(value)
if mo:
optname, vi, optval = mo.group('option', 'vi', 'value')
- if vi in ('=', ':') and ';' in optval:
- # ';' is a comment delimiter only if it follows
- # a spacing character
- pos = optval.find(';')
- if pos != -1 and optval[pos-1].isspace():
- optval = optval[:pos]
- optval = optval.strip()
- # allow empty values
- if optval == '""':
- optval = ''
+ if not optname:
+ e = self._handle_error(e, fpname, lineno, line)
optname = self.optionxform(optname.rstrip())
- cursect[optname] = optval
+ if (self._strict and
+ (sectname, optname) in elements_added):
+ raise DuplicateOptionError(sectname, optname,
+ fpname, lineno)
+ elements_added.add((sectname, optname))
+ # This check is fine because the OPTCRE cannot
+ # match if it would set optval to None
+ if optval is not None:
+ optval = optval.strip()
+ cursect[optname] = [optval]
+ else:
+ # valueless option handling
+ cursect[optname] = None
else:
- # a non-fatal parsing error occurred. set up the
+ # a non-fatal parsing error occurred. set up the
# exception but keep going. the exception will be
# raised at the end of the file and will contain a
# list of all bogus lines
- if not e:
- e = ParsingError(fpname)
- e.append(lineno, repr(line))
+ e = self._handle_error(e, fpname, lineno, line)
# if any parsing errors occurred, raise an exception
if e:
raise e
+ self._join_multiline_values()
+
+ def _join_multiline_values(self):
+ defaults = self.default_section, self._defaults
+ all_sections = itertools.chain((defaults,),
+ self._sections.items())
+ for section, options in all_sections:
+ for name, val in options.items():
+ if isinstance(val, list):
+ val = '\n'.join(val).rstrip()
+ options[name] = self._interpolation.before_read(self,
+ section,
+ name, val)
+
+ def _handle_error(self, exc, fpname, lineno, line):
+ if not exc:
+ exc = ParsingError(fpname)
+ exc.append(lineno, repr(line))
+ return exc
+
+ def _unify_values(self, section, vars):
+ """Create a sequence of lookups with 'vars' taking priority over
+ the 'section' which takes priority over the DEFAULTSECT.
-class _Chainmap:
- """Combine multiple mappings for successive lookups.
-
- For example, to emulate Python's normal lookup sequence:
-
- import __builtin__
- pylookup = _Chainmap(locals(), globals(), vars(__builtin__))
- """
-
- def __init__(self, *maps):
- self.maps = maps
-
- def __getitem__(self, key):
- for mapping in self.maps:
- try:
- return mapping[key]
- except KeyError:
- pass
- raise KeyError(key)
-
- def __iter__(self):
- seen = set()
- for mapping in self.maps:
- s = set(mapping) - seen
- for elem in s:
- yield elem
- seen.update(s)
-
- def __len__(self):
- s = set()
- s.update(*self.maps)
- return len(s)
-
- def get(self, key, default=None):
+ """
+ sectiondict = {}
try:
- return self[key]
+ sectiondict = self._sections[section]
except KeyError:
- return default
+ if section != self.default_section:
+ raise NoSectionError(section)
+ # Update with the entry specific variables
+ vardict = {}
+ if vars:
+ for key, value in vars.items():
+ if value is not None:
+ value = str(value)
+ vardict[self.optionxform(key)] = value
+ return _ChainMap(vardict, sectiondict, self._defaults)
- def __contains__(self, key):
- try:
- self[key]
- except KeyError:
- return False
- else:
- return True
+ def _convert_to_boolean(self, value):
+ """Return a boolean value translating from other types if necessary.
+ """
+ if value.lower() not in self.BOOLEAN_STATES:
+ raise ValueError('Not a boolean: %s' % value)
+ return self.BOOLEAN_STATES[value.lower()]
+
+ def _validate_value_types(self, *, section="", option="", value=""):
+ """Raises a TypeError for non-string values.
+
+ The only legal non-string value if we allow valueless
+ options is None, so we need to check if the value is a
+ string if:
+ - we do not allow valueless options, or
+ - we allow valueless options but the value is not None
+
+ For compatibility reasons this method is not used in classic set()
+ for RawConfigParsers. It is invoked in every case for mapping protocol
+ access and in ConfigParser.set().
+ """
+ if not isinstance(section, str):
+ raise TypeError("section names must be strings")
+ if not isinstance(option, str):
+ raise TypeError("option keys must be strings")
+ if not self._allow_no_value or value:
+ if not isinstance(value, str):
+ raise TypeError("option values must be strings")
- def keys(self):
- return list(self)
- def items(self):
- return [(k, self[k]) for k in self]
+class ConfigParser(RawConfigParser):
+ """ConfigParser implementing interpolation."""
- def values(self):
- return [self[k] for k in self]
+ _DEFAULT_INTERPOLATION = BasicInterpolation()
- def __eq__(self, other):
- return dict(self.items()) == dict(other.items())
+ def set(self, section, option, value=None):
+ """Set an option. Extends RawConfigParser.set by validating type and
+ interpolation syntax on the value."""
+ self._validate_value_types(option=option, value=value)
+ super().set(section, option, value)
- def __ne__(self, other):
- return not (self == other)
+ def add_section(self, section):
+ """Create a new section in the configuration. Extends
+ RawConfigParser.add_section by validating if the section name is
+ a string."""
+ self._validate_value_types(section=section)
+ super().add_section(section)
-class ConfigParser(RawConfigParser):
+class SafeConfigParser(ConfigParser):
+ """ConfigParser alias for backwards compatibility purposes."""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ warnings.warn(
+ "The SafeConfigParser class has been renamed to ConfigParser "
+ "in Python 3.2. This alias will be removed in future versions."
+ " Use ConfigParser directly instead.",
+ DeprecationWarning, stacklevel=2
+ )
- def get(self, section, option, raw=False, vars=None):
- """Get an option value for a given section.
- If `vars' is provided, it must be a dictionary. The option is looked up
- in `vars' (if provided), `section', and in `defaults' in that order.
+class SectionProxy(MutableMapping):
+ """A proxy for a single section from a parser."""
- All % interpolations are expanded in the return values, unless the
- optional argument `raw' is true. Values for interpolation keys are
- looked up in the same manner as the option.
+ def __init__(self, parser, name):
+ """Creates a view on a section of the specified `name` in `parser`."""
+ self._parser = parser
+ self._name = name
- The section DEFAULT is special.
- """
- sectiondict = {}
- try:
- sectiondict = self._sections[section]
- except KeyError:
- if section != DEFAULTSECT:
- raise NoSectionError(section)
- # Update with the entry specific variables
- vardict = {}
- if vars:
- for key, value in vars.items():
- vardict[self.optionxform(key)] = value
- d = _Chainmap(vardict, sectiondict, self._defaults)
- option = self.optionxform(option)
- try:
- value = d[option]
- except KeyError:
- raise NoOptionError(option, section)
+ def __repr__(self):
+ return '<Section: {}>'.format(self._name)
- if raw:
- return value
- else:
- return self._interpolate(section, option, value, d)
+ def __getitem__(self, key):
+ if not self._parser.has_option(self._name, key):
+ raise KeyError(key)
+ return self._parser.get(self._name, key)
- def items(self, section, raw=False, vars=None):
- """Return a list of tuples with (name, value) for each option
- in the section.
+ def __setitem__(self, key, value):
+ self._parser._validate_value_types(option=key, value=value)
+ return self._parser.set(self._name, key, value)
- All % interpolations are expanded in the return values, based on the
- defaults passed into the constructor, unless the optional argument
- `raw' is true. Additional substitutions may be provided using the
- `vars' argument, which must be a dictionary whose contents overrides
- any pre-existing defaults.
+ def __delitem__(self, key):
+ if not (self._parser.has_option(self._name, key) and
+ self._parser.remove_option(self._name, key)):
+ raise KeyError(key)
- The section DEFAULT is special.
- """
- d = self._defaults.copy()
- try:
- d.update(self._sections[section])
- except KeyError:
- if section != DEFAULTSECT:
- raise NoSectionError(section)
- # Update with the entry specific variables
- if vars:
- for key, value in vars.items():
- d[self.optionxform(key)] = value
- options = list(d.keys())
- if "__name__" in options:
- options.remove("__name__")
- if raw:
- return [(option, d[option])
- for option in options]
- else:
- return [(option, self._interpolate(section, option, d[option], d))
- for option in options]
+ def __contains__(self, key):
+ return self._parser.has_option(self._name, key)
- def _interpolate(self, section, option, rawval, vars):
- # do the string interpolation
- value = rawval
- depth = MAX_INTERPOLATION_DEPTH
- while depth: # Loop through this until it's done
- depth -= 1
- if "%(" in value:
- value = self._KEYCRE.sub(self._interpolation_replace, value)
- try:
- value = value % vars
- except KeyError as e:
- raise InterpolationMissingOptionError(
- option, section, rawval, e.args[0])
- else:
- break
- if "%(" in value:
- raise InterpolationDepthError(option, section, rawval)
- return value
+ def __len__(self):
+ return len(self._options())
- _KEYCRE = re.compile(r"%\(([^)]*)\)s|.")
+ def __iter__(self):
+ return self._options().__iter__()
- def _interpolation_replace(self, match):
- s = match.group(1)
- if s is None:
- return match.group()
+ def _options(self):
+ if self._name != self._parser.default_section:
+ return self._parser.options(self._name)
else:
- return "%%(%s)s" % self.optionxform(s)
+ return self._parser.defaults()
+ def get(self, option, fallback=None, *, raw=False, vars=None):
+ return self._parser.get(self._name, option, raw=raw, vars=vars,
+ fallback=fallback)
-class SafeConfigParser(ConfigParser):
+ def getint(self, option, fallback=None, *, raw=False, vars=None):
+ return self._parser.getint(self._name, option, raw=raw, vars=vars,
+ fallback=fallback)
- def _interpolate(self, section, option, rawval, vars):
- # do the string interpolation
- L = []
- self._interpolate_some(option, L, rawval, section, vars, 1)
- return ''.join(L)
+ def getfloat(self, option, fallback=None, *, raw=False, vars=None):
+ return self._parser.getfloat(self._name, option, raw=raw, vars=vars,
+ fallback=fallback)
- _interpvar_re = re.compile(r"%\(([^)]+)\)s")
+ def getboolean(self, option, fallback=None, *, raw=False, vars=None):
+ return self._parser.getboolean(self._name, option, raw=raw, vars=vars,
+ fallback=fallback)
- def _interpolate_some(self, option, accum, rest, section, map, depth):
- if depth > MAX_INTERPOLATION_DEPTH:
- raise InterpolationDepthError(option, section, rest)
- while rest:
- p = rest.find("%")
- if p < 0:
- accum.append(rest)
- return
- if p > 0:
- accum.append(rest[:p])
- rest = rest[p:]
- # p is no longer used
- c = rest[1:2]
- if c == "%":
- accum.append("%")
- rest = rest[2:]
- elif c == "(":
- m = self._interpvar_re.match(rest)
- if m is None:
- raise InterpolationSyntaxError(option, section,
- "bad interpolation variable reference %r" % rest)
- var = self.optionxform(m.group(1))
- rest = rest[m.end():]
- try:
- v = map[var]
- except KeyError:
- raise InterpolationMissingOptionError(
- option, section, rest, var)
- if "%" in v:
- self._interpolate_some(option, accum, v,
- section, map, depth + 1)
- else:
- accum.append(v)
- else:
- raise InterpolationSyntaxError(
- option, section,
- "'%%' must be followed by '%%' or '(', found: %r" % (rest,))
-
- def set(self, section, option, value):
- """Set an option. Extend ConfigParser.set: check for string values."""
- if not isinstance(value, str):
- raise TypeError("option values must be strings")
- # check for bad percent signs:
- # first, replace all "good" interpolations
- tmp_value = value.replace('%%', '')
- tmp_value = self._interpvar_re.sub('', tmp_value)
- # then, check if there's a lone percent sign left
- percent_index = tmp_value.find('%')
- if percent_index != -1:
- raise ValueError("invalid interpolation syntax in %r at "
- "position %d" % (value, percent_index))
- ConfigParser.set(self, section, option, value)
+ @property
+ def parser(self):
+ # The parser object of the proxy is read-only.
+ return self._parser
+
+ @property
+ def name(self):
+ # The name of the section on a proxy is read-only.
+ return self._name
diff --git a/Lib/contextlib.py b/Lib/contextlib.py
index bffa0c4902..5ebbbc6583 100644
--- a/Lib/contextlib.py
+++ b/Lib/contextlib.py
@@ -4,13 +4,44 @@ import sys
from functools import wraps
from warnings import warn
-__all__ = ["contextmanager", "nested", "closing"]
+__all__ = ["contextmanager", "closing", "ContextDecorator"]
-class GeneratorContextManager(object):
+
+class ContextDecorator(object):
+ "A base class or mixin that enables context managers to work as decorators."
+
+ def _recreate_cm(self):
+ """Return a recreated instance of self.
+
+ Allows otherwise one-shot context managers like
+ _GeneratorContextManager to support use as
+ decorators via implicit recreation.
+
+ Note: this is a private interface just for _GCM in 3.2 but will be
+ renamed and documented for third party use in 3.3
+ """
+ return self
+
+ def __call__(self, func):
+ @wraps(func)
+ def inner(*args, **kwds):
+ with self._recreate_cm():
+ return func(*args, **kwds)
+ return inner
+
+
+class _GeneratorContextManager(ContextDecorator):
"""Helper for @contextmanager decorator."""
- def __init__(self, gen):
- self.gen = gen
+ def __init__(self, func, *args, **kwds):
+ self.gen = func(*args, **kwds)
+ self.func, self.args, self.kwds = func, args, kwds
+
+ def _recreate_cm(self):
+ # _GCM instances are one-shot context managers, so the
+ # CM must be recreated each time a decorated function is
+ # called
+ return self.__class__(self.func, *self.args, **self.kwds)
def __enter__(self):
try:
@@ -81,55 +112,10 @@ def contextmanager(func):
"""
@wraps(func)
def helper(*args, **kwds):
- return GeneratorContextManager(func(*args, **kwds))
+ return _GeneratorContextManager(func, *args, **kwds)
return helper
-@contextmanager
-def nested(*managers):
- """Combine multiple context managers into a single nested context manager.
-
- This function has been deprecated in favour of the multiple manager form
- of the with statement.
-
- The one advantage of this function over the multiple manager form of the
- with statement is that argument unpacking allows it to be
- used with a variable number of context managers as follows:
-
- with nested(*managers):
- do_something()
-
- """
- warn("With-statements now directly support multiple context managers",
- DeprecationWarning, 3)
- exits = []
- vars = []
- exc = (None, None, None)
- try:
- for mgr in managers:
- exit = mgr.__exit__
- enter = mgr.__enter__
- vars.append(enter())
- exits.append(exit)
- yield vars
- except:
- exc = sys.exc_info()
- finally:
- while exits:
- exit = exits.pop()
- try:
- if exit(*exc):
- exc = (None, None, None)
- except:
- exc = sys.exc_info()
- if exc != (None, None, None):
- # Don't rely on sys.exc_info() still containing
- # the right information. Another exception may
- # have been raised and caught by an exit method
- # exc[1] already has the __traceback__ attribute populated
- raise exc[1]
-
-
class closing(object):
"""Context to automatically close something at the end of a block.
diff --git a/Lib/copy.py b/Lib/copy.py
index 4b755112d7..089d101c7c 100644
--- a/Lib/copy.py
+++ b/Lib/copy.py
@@ -239,6 +239,10 @@ d[dict] = _deepcopy_dict
if PyStringMap is not None:
d[PyStringMap] = _deepcopy_dict
+def _deepcopy_method(x, memo): # Copy instance methods
+ return type(x)(x.__func__, deepcopy(x.__self__, memo))
+_deepcopy_dispatch[types.MethodType] = _deepcopy_method
+
def _keep_alive(x, memo):
"""Keeps a reference to the object x in the memo.
diff --git a/Lib/csv.py b/Lib/csv.py
index dbe6db7ead..8dfc77e310 100644
--- a/Lib/csv.py
+++ b/Lib/csv.py
@@ -20,7 +20,7 @@ __all__ = [ "QUOTE_MINIMAL", "QUOTE_ALL", "QUOTE_NONNUMERIC", "QUOTE_NONE",
"unregister_dialect", "__version__", "DictReader", "DictWriter" ]
class Dialect:
- """Describe an Excel dialect.
+ """Describe a CSV dialect.
This must be subclassed (see csv.excel). Valid attributes are:
delimiter, quotechar, escapechar, doublequote, skipinitialspace,
@@ -65,6 +65,16 @@ class excel_tab(excel):
delimiter = '\t'
register_dialect("excel-tab", excel_tab)
+class unix_dialect(Dialect):
+ """Describe the usual properties of Unix-generated CSV files."""
+ delimiter = ','
+ quotechar = '"'
+ doublequote = True
+ skipinitialspace = False
+ lineterminator = '\n'
+ quoting = QUOTE_ALL
+register_dialect("unix", unix_dialect)
+
class DictReader:
def __init__(self, f, fieldnames=None, restkey=None, restval=None,
@@ -127,6 +137,10 @@ class DictWriter:
self.extrasaction = extrasaction
self.writer = writer(f, dialect, *args, **kwds)
+ def writeheader(self):
+ header = dict(zip(self.fieldnames, self.fieldnames))
+ self.writerow(header)
+
def _dict_to_list(self, rowdict):
if self.extrasaction == "raise":
wrong_fields = [k for k in rowdict if k not in self.fieldnames]
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
index 1283f28a6d..71686e7a1b 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -259,41 +259,31 @@ class c_bool(_SimpleCData):
from _ctypes import POINTER, pointer, _pointer_type_cache
-try:
- from _ctypes import set_conversion_mode
-except ImportError:
- pass
-else:
- if _os.name in ("nt", "ce"):
- set_conversion_mode("mbcs", "ignore")
- else:
- set_conversion_mode("ascii", "strict")
+class c_wchar_p(_SimpleCData):
+ _type_ = "Z"
- class c_wchar_p(_SimpleCData):
- _type_ = "Z"
+class c_wchar(_SimpleCData):
+ _type_ = "u"
- class c_wchar(_SimpleCData):
- _type_ = "u"
+POINTER(c_wchar).from_param = c_wchar_p.from_param #_SimpleCData.c_wchar_p_from_param
- POINTER(c_wchar).from_param = c_wchar_p.from_param #_SimpleCData.c_wchar_p_from_param
-
- def create_unicode_buffer(init, size=None):
- """create_unicode_buffer(aString) -> character array
- create_unicode_buffer(anInteger) -> character array
- create_unicode_buffer(aString, anInteger) -> character array
- """
- if isinstance(init, (str, bytes)):
- if size is None:
- size = len(init)+1
- buftype = c_wchar * size
- buf = buftype()
- buf.value = init
- return buf
- elif isinstance(init, int):
- buftype = c_wchar * init
- buf = buftype()
- return buf
- raise TypeError(init)
+def create_unicode_buffer(init, size=None):
+ """create_unicode_buffer(aString) -> character array
+ create_unicode_buffer(anInteger) -> character array
+ create_unicode_buffer(aString, anInteger) -> character array
+ """
+ if isinstance(init, (str, bytes)):
+ if size is None:
+ size = len(init)+1
+ buftype = c_wchar * size
+ buf = buftype()
+ buf.value = init
+ return buf
+ elif isinstance(init, int):
+ buftype = c_wchar * init
+ buf = buftype()
+ return buf
+ raise TypeError(init)
POINTER(c_char).from_param = c_char_p.from_param #_SimpleCData.c_char_p_from_param
@@ -459,10 +449,13 @@ _pointer_type_cache[None] = c_void_p
if sizeof(c_uint) == sizeof(c_void_p):
c_size_t = c_uint
+ c_ssize_t = c_int
elif sizeof(c_ulong) == sizeof(c_void_p):
c_size_t = c_ulong
+ c_ssize_t = c_long
elif sizeof(c_ulonglong) == sizeof(c_void_p):
c_size_t = c_ulonglong
+ c_ssize_t = c_longlong
# functions
diff --git a/Lib/ctypes/test/test_arrays.py b/Lib/ctypes/test/test_arrays.py
index d11de28722..f2a9f078c9 100644
--- a/Lib/ctypes/test/test_arrays.py
+++ b/Lib/ctypes/test/test_arrays.py
@@ -42,7 +42,7 @@ class ArrayTestCase(unittest.TestCase):
CharArray = ARRAY(c_char, 3)
- ca = CharArray("a", "b", "c")
+ ca = CharArray(b"a", b"b", b"c")
# Should this work? It doesn't:
# CharArray("abc")
@@ -89,7 +89,7 @@ class ArrayTestCase(unittest.TestCase):
def test_from_address(self):
# Failed with 0.9.8, reported by JUrner
- p = create_string_buffer("foo")
+ p = create_string_buffer(b"foo")
sz = (c_char * 3).from_address(addressof(p))
self.assertEqual(sz[:], b"foo")
self.assertEqual(sz[::], b"foo")
diff --git a/Lib/ctypes/test/test_bitfields.py b/Lib/ctypes/test/test_bitfields.py
index 4eb9571f65..9e0825c7ca 100644
--- a/Lib/ctypes/test/test_bitfields.py
+++ b/Lib/ctypes/test/test_bitfields.py
@@ -37,14 +37,14 @@ class C_Test(unittest.TestCase):
for name in "ABCDEFGHI":
b = BITS()
setattr(b, name, i)
- self.assertEqual((name, i, getattr(b, name)), (name, i, func(byref(b), name)))
+ self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii')))
def test_shorts(self):
for i in range(256):
for name in "MNOPQRS":
b = BITS()
setattr(b, name, i)
- self.assertEqual((name, i, getattr(b, name)), (name, i, func(byref(b), name)))
+ self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii')))
signed_int_types = (c_byte, c_short, c_int, c_long, c_longlong)
unsigned_int_types = (c_ubyte, c_ushort, c_uint, c_ulong, c_ulonglong)
diff --git a/Lib/ctypes/test/test_buffers.py b/Lib/ctypes/test/test_buffers.py
index 3f8a587090..c19c05a300 100644
--- a/Lib/ctypes/test/test_buffers.py
+++ b/Lib/ctypes/test/test_buffers.py
@@ -9,19 +9,7 @@ class StringBufferTestCase(unittest.TestCase):
self.assertEqual(sizeof(b), 32 * sizeof(c_char))
self.assertTrue(type(b[0]) is bytes)
- b = create_string_buffer("abc")
- self.assertEqual(len(b), 4) # trailing nul char
- self.assertEqual(sizeof(b), 4 * sizeof(c_char))
- self.assertTrue(type(b[0]) is bytes)
- self.assertEqual(b[0], b"a")
- self.assertEqual(b[:], b"abc\0")
- self.assertEqual(b[::], b"abc\0")
- self.assertEqual(b[::-1], b"\0cba")
- self.assertEqual(b[::2], b"ac")
- self.assertEqual(b[::5], b"a")
-
- def test_string_conversion(self):
- b = create_string_buffer("abc")
+ b = create_string_buffer(b"abc")
self.assertEqual(len(b), 4) # trailing nul char
self.assertEqual(sizeof(b), 4 * sizeof(c_char))
self.assertTrue(type(b[0]) is bytes)
diff --git a/Lib/ctypes/test/test_bytes.py b/Lib/ctypes/test/test_bytes.py
index 374b2d7751..ee49c456e8 100644
--- a/Lib/ctypes/test/test_bytes.py
+++ b/Lib/ctypes/test/test_bytes.py
@@ -11,34 +11,30 @@ class BytesTest(unittest.TestCase):
(c_char * 3)(b"a", b"b", b"c")
def test_c_wchar(self):
- x = c_wchar(b"x")
- x.value = b"y"
- c_wchar.from_param(b"x")
- (c_wchar * 3)(b"a", b"b", b"c")
+ x = c_wchar("x")
+ x.value = "y"
+ c_wchar.from_param("x")
+ (c_wchar * 3)("a", "b", "c")
def test_c_char_p(self):
- c_char_p("foo bar")
c_char_p(b"foo bar")
def test_c_wchar_p(self):
c_wchar_p("foo bar")
- c_wchar_p(b"foo bar")
def test_struct(self):
class X(Structure):
_fields_ = [("a", c_char * 3)]
- X("abc")
x = X(b"abc")
- self.assertEqual(x.a, "abc")
- self.assertEqual(type(x.a), str)
+ self.assertEqual(x.a, b"abc")
+ self.assertEqual(type(x.a), bytes)
def test_struct_W(self):
class X(Structure):
_fields_ = [("a", c_wchar * 3)]
- X("abc")
- x = X(b"abc")
+ x = X("abc")
self.assertEqual(x.a, "abc")
self.assertEqual(type(x.a), str)
@@ -49,7 +45,6 @@ class BytesTest(unittest.TestCase):
_type_ = "X"
BSTR("abc")
- BSTR(b"abc")
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
index dabcde65c8..8801ccd106 100644
--- a/Lib/ctypes/test/test_callbacks.py
+++ b/Lib/ctypes/test/test_callbacks.py
@@ -166,6 +166,40 @@ class SampleCallbacksTestCase(unittest.TestCase):
self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
+ def test_issue_8959_a(self):
+ from ctypes.util import find_library
+ libc_path = find_library("c")
+ if not libc_path:
+ return # cannot test
+ libc = CDLL(libc_path)
+
+ @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))
+ def cmp_func(a, b):
+ return a[0] - b[0]
+
+ array = (c_int * 5)(5, 1, 99, 7, 33)
+
+ libc.qsort(array, len(array), sizeof(c_int), cmp_func)
+ self.assertEqual(array[:], [1, 5, 7, 33, 99])
+
+ try:
+ WINFUNCTYPE
+ except NameError:
+ pass
+ else:
+ def test_issue_8959_b(self):
+ from ctypes.wintypes import BOOL, HWND, LPARAM
+ global windowCount
+ windowCount = 0
+
+ @WINFUNCTYPE(BOOL, HWND, LPARAM)
+ def EnumWindowsCallbackFunc(hwnd, lParam):
+ global windowCount
+ windowCount += 1
+ return True #Allow windows to keep enumerating
+
+ windll.user32.EnumWindows(EnumWindowsCallbackFunc, 0)
+
def test_callback_register_int(self):
# Issue #8275: buggy handling of callback args under Win64
# NOTE: should be run on release builds as well
diff --git a/Lib/ctypes/test/test_cast.py b/Lib/ctypes/test/test_cast.py
index 4c4a2e8545..702de3cffa 100644
--- a/Lib/ctypes/test/test_cast.py
+++ b/Lib/ctypes/test/test_cast.py
@@ -33,17 +33,17 @@ class Test(unittest.TestCase):
def test_p2a_objects(self):
array = (c_char_p * 5)()
self.assertEqual(array._objects, None)
- array[0] = "foo bar"
+ array[0] = b"foo bar"
self.assertEqual(array._objects, {'0': b"foo bar"})
p = cast(array, POINTER(c_char_p))
# array and p share a common _objects attribute
self.assertTrue(p._objects is array._objects)
self.assertEqual(array._objects, {'0': b"foo bar", id(array): array})
- p[0] = "spam spam"
+ p[0] = b"spam spam"
self.assertEqual(p._objects, {'0': b"spam spam", id(array): array})
self.assertTrue(array._objects is p._objects)
- p[1] = "foo bar"
+ p[1] = b"foo bar"
self.assertEqual(p._objects, {'1': b'foo bar', '0': b"spam spam", id(array): array})
self.assertTrue(array._objects is p._objects)
@@ -71,7 +71,7 @@ class Test(unittest.TestCase):
def test_char_p(self):
# This didn't work: bad argument to internal function
- s = c_char_p("hiho")
+ s = c_char_p(b"hiho")
self.assertEqual(cast(cast(s, c_void_p), c_char_p).value,
b"hiho")
diff --git a/Lib/ctypes/test/test_cfuncs.py b/Lib/ctypes/test/test_cfuncs.py
index 493cbe979c..f4bd3b16c3 100644
--- a/Lib/ctypes/test/test_cfuncs.py
+++ b/Lib/ctypes/test/test_cfuncs.py
@@ -107,7 +107,7 @@ class CFunctions(unittest.TestCase):
def test_ulong_plus(self):
self._dll.tf_bL.restype = c_ulong
self._dll.tf_bL.argtypes = (c_char, c_ulong)
- self.assertEqual(self._dll.tf_bL(' ', 4294967295), 1431655765)
+ self.assertEqual(self._dll.tf_bL(b' ', 4294967295), 1431655765)
self.assertEqual(self.U(), 4294967295)
def test_longlong(self):
diff --git a/Lib/ctypes/test/test_errno.py b/Lib/ctypes/test/test_errno.py
index 0254c3bcda..4690a0d871 100644
--- a/Lib/ctypes/test/test_errno.py
+++ b/Lib/ctypes/test/test_errno.py
@@ -1,27 +1,31 @@
import unittest, os, errno
from ctypes import *
from ctypes.util import find_library
-import threading
+try:
+ import threading
+except ImportError:
+ threading = None
class Test(unittest.TestCase):
def test_open(self):
libc_name = find_library("c")
- if libc_name is not None:
- libc = CDLL(libc_name, use_errno=True)
- if os.name == "nt":
- libc_open = libc._open
- else:
- libc_open = libc.open
+ if libc_name is None:
+ raise unittest.SkipTest("Unable to find C library")
+ libc = CDLL(libc_name, use_errno=True)
+ if os.name == "nt":
+ libc_open = libc._open
+ else:
+ libc_open = libc.open
- libc_open.argtypes = c_char_p, c_int
+ libc_open.argtypes = c_char_p, c_int
- self.assertEqual(libc_open("", 0), -1)
- self.assertEqual(get_errno(), errno.ENOENT)
-
- self.assertEqual(set_errno(32), errno.ENOENT)
- self.assertEqual(get_errno(), 32)
+ self.assertEqual(libc_open(b"", 0), -1)
+ self.assertEqual(get_errno(), errno.ENOENT)
+ self.assertEqual(set_errno(32), errno.ENOENT)
+ self.assertEqual(get_errno(), 32)
+ if threading:
def _worker():
set_errno(0)
@@ -31,7 +35,7 @@ class Test(unittest.TestCase):
else:
libc_open = libc.open
libc_open.argtypes = c_char_p, c_int
- self.assertEqual(libc_open("", 0), -1)
+ self.assertEqual(libc_open(b"", 0), -1)
self.assertEqual(get_errno(), 0)
t = threading.Thread(target=_worker)
@@ -41,36 +45,35 @@ class Test(unittest.TestCase):
self.assertEqual(get_errno(), 32)
set_errno(0)
- if os.name == "nt":
-
- def test_GetLastError(self):
- dll = WinDLL("kernel32", use_last_error=True)
- GetModuleHandle = dll.GetModuleHandleA
- GetModuleHandle.argtypes = [c_wchar_p]
+ @unittest.skipUnless(os.name == "nt", 'Test specific to Windows')
+ def test_GetLastError(self):
+ dll = WinDLL("kernel32", use_last_error=True)
+ GetModuleHandle = dll.GetModuleHandleA
+ GetModuleHandle.argtypes = [c_wchar_p]
- self.assertEqual(0, GetModuleHandle("foo"))
- self.assertEqual(get_last_error(), 126)
+ self.assertEqual(0, GetModuleHandle("foo"))
+ self.assertEqual(get_last_error(), 126)
- self.assertEqual(set_last_error(32), 126)
- self.assertEqual(get_last_error(), 32)
+ self.assertEqual(set_last_error(32), 126)
+ self.assertEqual(get_last_error(), 32)
- def _worker():
- set_last_error(0)
+ def _worker():
+ set_last_error(0)
- dll = WinDLL("kernel32", use_last_error=False)
- GetModuleHandle = dll.GetModuleHandleW
- GetModuleHandle.argtypes = [c_wchar_p]
- GetModuleHandle("bar")
+ dll = WinDLL("kernel32", use_last_error=False)
+ GetModuleHandle = dll.GetModuleHandleW
+ GetModuleHandle.argtypes = [c_wchar_p]
+ GetModuleHandle("bar")
- self.assertEqual(get_last_error(), 0)
+ self.assertEqual(get_last_error(), 0)
- t = threading.Thread(target=_worker)
- t.start()
- t.join()
+ t = threading.Thread(target=_worker)
+ t.start()
+ t.join()
- self.assertEqual(get_last_error(), 32)
+ self.assertEqual(get_last_error(), 32)
- set_last_error(0)
+ set_last_error(0)
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/ctypes/test/test_internals.py b/Lib/ctypes/test/test_internals.py
index 03d820ec7e..cbf2e0589a 100644
--- a/Lib/ctypes/test/test_internals.py
+++ b/Lib/ctypes/test/test_internals.py
@@ -23,16 +23,16 @@ class ObjectsTestCase(unittest.TestCase):
def test_ints(self):
i = 42000123
- rc = grc(i)
+ refcnt = grc(i)
ci = c_int(i)
- self.assertEqual(rc, grc(i))
+ self.assertEqual(refcnt, grc(i))
self.assertEqual(ci._objects, None)
def test_c_char_p(self):
s = b"Hello, World"
- rc = grc(s)
+ refcnt = grc(s)
cs = c_char_p(s)
- self.assertEqual(rc + 1, grc(s))
+ self.assertEqual(refcnt + 1, grc(s))
self.assertSame(cs._objects, s)
def test_simple_struct(self):
@@ -70,19 +70,17 @@ class ObjectsTestCase(unittest.TestCase):
class Y(Structure):
_fields_ = [("x", X), ("y", X)]
- s1 = "Hello, World"
- s2 = "Hallo, Welt"
+ s1 = b"Hello, World"
+ s2 = b"Hallo, Welt"
x = X()
x.a = s1
x.b = s2
- self.assertEqual(x._objects, {"0": bytes(s1, "ascii"),
- "1": bytes(s2, "ascii")})
+ self.assertEqual(x._objects, {"0": s1, "1": s2})
y = Y()
y.x = x
- self.assertEqual(y._objects, {"0": {"0": bytes(s1, "ascii"),
- "1": bytes(s2, "ascii")}})
+ self.assertEqual(y._objects, {"0": {"0": s1, "1": s2}})
## x = y.x
## del y
## print x._b_base_._objects
diff --git a/Lib/ctypes/test/test_keeprefs.py b/Lib/ctypes/test/test_keeprefs.py
index fafef65d2c..db8adfb4ca 100644
--- a/Lib/ctypes/test/test_keeprefs.py
+++ b/Lib/ctypes/test/test_keeprefs.py
@@ -13,9 +13,9 @@ class SimpleTestCase(unittest.TestCase):
def test_ccharp(self):
x = c_char_p()
self.assertEqual(x._objects, None)
- x.value = "abc"
+ x.value = b"abc"
self.assertEqual(x._objects, b"abc")
- x = c_char_p("spam")
+ x = c_char_p(b"spam")
self.assertEqual(x._objects, b"spam")
class StructureTestCase(unittest.TestCase):
@@ -37,8 +37,8 @@ class StructureTestCase(unittest.TestCase):
x = X()
self.assertEqual(x._objects, None)
- x.a = "spam"
- x.b = "foo"
+ x.a = b"spam"
+ x.b = b"foo"
self.assertEqual(x._objects, {"0": b"spam", "1": b"foo"})
def test_struct_struct(self):
diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
index cce409fa1b..56285b5ff8 100644
--- a/Lib/ctypes/test/test_libc.py
+++ b/Lib/ctypes/test/test_libc.py
@@ -25,7 +25,7 @@ class LibTest(unittest.TestCase):
def sort(a, b):
return three_way_cmp(a[0], b[0])
- chars = create_string_buffer("spam, spam, and spam")
+ chars = create_string_buffer(b"spam, spam, and spam")
lib.my_qsort(chars, len(chars)-1, sizeof(c_char), comparefunc(sort))
self.assertEqual(chars.raw, b" ,,aaaadmmmnpppsss\x00")
diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py
index 07b69ec201..4029b463bc 100644
--- a/Lib/ctypes/test/test_loading.py
+++ b/Lib/ctypes/test/test_loading.py
@@ -97,7 +97,7 @@ class LoaderTest(unittest.TestCase):
self.assertEqual(0, advapi32.CloseEventLog(None))
windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p
windll.kernel32.GetProcAddress.restype = c_void_p
- proc = windll.kernel32.GetProcAddress(advapi32._handle, "CloseEventLog")
+ proc = windll.kernel32.GetProcAddress(advapi32._handle, b"CloseEventLog")
self.assertTrue(proc)
# This is the real test: call the function via 'call_function'
self.assertEqual(0, call_function(proc, (None,)))
diff --git a/Lib/ctypes/test/test_objects.py b/Lib/ctypes/test/test_objects.py
index 750d9045ce..f075c20893 100644
--- a/Lib/ctypes/test/test_objects.py
+++ b/Lib/ctypes/test/test_objects.py
@@ -20,7 +20,7 @@ None
The memory block stores pointers to strings, and the strings itself
assigned from Python must be kept.
->>> array[4] = 'foo bar'
+>>> array[4] = b'foo bar'
>>> array._objects
{'4': b'foo bar'}
>>> array[4]
@@ -45,7 +45,7 @@ of 'x' ('_b_base_' is either None, or the root object owning the memory block):
<ctypes.test.test_objects.X object at 0x...>
>>>
->>> x.array[0] = 'spam spam spam'
+>>> x.array[0] = b'spam spam spam'
>>> x._objects
{'0:2': b'spam spam spam'}
>>> x.array._b_base_._objects
diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py
index 6a3f33d19c..e83fd9a6fc 100644
--- a/Lib/ctypes/test/test_parameters.py
+++ b/Lib/ctypes/test/test_parameters.py
@@ -19,7 +19,6 @@ class SimpleTypesTestCase(unittest.TestCase):
else:
set_conversion_mode(*self.prev_conv_mode)
-
def test_subclasses(self):
from ctypes import c_void_p, c_char_p
# ctypes 0.9.5 and before did overwrite from_param in SimpleType_new
@@ -58,14 +57,13 @@ class SimpleTypesTestCase(unittest.TestCase):
self.assertTrue(c_char_p.from_param(s)._obj is s)
# new in 0.9.1: convert (encode) unicode to ascii
- self.assertEqual(c_char_p.from_param("123")._obj, b"123")
- self.assertRaises(UnicodeEncodeError, c_char_p.from_param, "123\377")
-
+ self.assertEqual(c_char_p.from_param(b"123")._obj, b"123")
+ self.assertRaises(TypeError, c_char_p.from_param, "123\377")
self.assertRaises(TypeError, c_char_p.from_param, 42)
# calling c_char_p.from_param with a c_char_p instance
# returns the argument itself:
- a = c_char_p("123")
+ a = c_char_p(b"123")
self.assertTrue(c_char_p.from_param(a) is a)
def test_cw_strings(self):
@@ -82,7 +80,7 @@ class SimpleTypesTestCase(unittest.TestCase):
# new in 0.9.1: convert (decode) ascii to unicode
self.assertEqual(c_wchar_p.from_param("123")._obj, "123")
- self.assertRaises(UnicodeDecodeError, c_wchar_p.from_param, b"123\377")
+ self.assertRaises(TypeError, c_wchar_p.from_param, b"123\377")
pa = c_wchar_p.from_param(c_wchar_p("123"))
self.assertEqual(type(pa), c_wchar_p)
diff --git a/Lib/ctypes/test/test_prototypes.py b/Lib/ctypes/test/test_prototypes.py
index d2e4c0b19d..6ef1b1bcaf 100644
--- a/Lib/ctypes/test/test_prototypes.py
+++ b/Lib/ctypes/test/test_prototypes.py
@@ -127,7 +127,7 @@ class CharPointersTestCase(unittest.TestCase):
self.assertEqual(None, func(c_char_p(None)))
self.assertEqual(b"123", func(c_buffer(b"123")))
- ca = c_char("a")
+ ca = c_char(b"a")
self.assertEqual(ord(b"a"), func(pointer(ca))[0])
self.assertEqual(ord(b"a"), func(byref(ca))[0])
diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/ctypes/test/test_python_api.py
index b74767a4f3..1f4c6039dc 100644
--- a/Lib/ctypes/test/test_python_api.py
+++ b/Lib/ctypes/test/test_python_api.py
@@ -72,10 +72,10 @@ class PythonAPITestCase(unittest.TestCase):
PyOS_snprintf.argtypes = POINTER(c_char), c_size_t, c_char_p
buf = c_buffer(256)
- PyOS_snprintf(buf, sizeof(buf), "Hello from %s", b"ctypes")
+ PyOS_snprintf(buf, sizeof(buf), b"Hello from %s", b"ctypes")
self.assertEqual(buf.value, b"Hello from ctypes")
- PyOS_snprintf(buf, sizeof(buf), "Hello from %s (%d, %d, %d)", b"ctypes", 1, 2, 3)
+ PyOS_snprintf(buf, sizeof(buf), b"Hello from %s (%d, %d, %d)", b"ctypes", 1, 2, 3)
self.assertEqual(buf.value, b"Hello from ctypes (1, 2, 3)")
# not enough arguments
diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/ctypes/test/test_random_things.py
index 7bb9db8049..515acf509a 100644
--- a/Lib/ctypes/test/test_random_things.py
+++ b/Lib/ctypes/test/test_random_things.py
@@ -18,7 +18,7 @@ if sys.platform == "win32":
windll.kernel32.GetProcAddress.restype = c_void_p
hdll = windll.kernel32.LoadLibraryA(b"kernel32")
- funcaddr = windll.kernel32.GetProcAddress(hdll, "GetModuleHandleA")
+ funcaddr = windll.kernel32.GetProcAddress(hdll, b"GetModuleHandleA")
self.assertEqual(call_function(funcaddr, (None,)),
windll.kernel32.GetModuleHandleA(None))
@@ -66,7 +66,7 @@ class CallbackTracbackTestCase(unittest.TestCase):
def test_TypeErrorDivisionError(self):
cb = CFUNCTYPE(c_int, c_char_p)(callback_func)
- out = self.capture_stderr(cb, "spam")
+ out = self.capture_stderr(cb, b"spam")
self.assertEqual(out.splitlines()[-1],
"TypeError: "
"unsupported operand type(s) for /: 'int' and 'bytes'")
diff --git a/Lib/ctypes/test/test_repr.py b/Lib/ctypes/test/test_repr.py
index 9a1e2386e6..60a2c80345 100644
--- a/Lib/ctypes/test/test_repr.py
+++ b/Lib/ctypes/test/test_repr.py
@@ -22,8 +22,8 @@ class ReprTest(unittest.TestCase):
self.assertEqual("<X object at", repr(typ(42))[:12])
def test_char(self):
- self.assertEqual("c_char(b'x')", repr(c_char('x')))
- self.assertEqual("<X object at", repr(X('x'))[:12])
+ self.assertEqual("c_char(b'x')", repr(c_char(b'x')))
+ self.assertEqual("<X object at", repr(X(b'x'))[:12])
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/ctypes/test/test_returnfuncptrs.py b/Lib/ctypes/test/test_returnfuncptrs.py
index 11da07b66a..af1caddaab 100644
--- a/Lib/ctypes/test/test_returnfuncptrs.py
+++ b/Lib/ctypes/test/test_returnfuncptrs.py
@@ -28,10 +28,10 @@ class ReturnFuncPtrTestCase(unittest.TestCase):
# _CFuncPtr instances are now callable with an integer argument
# which denotes a function address:
strchr = CFUNCTYPE(c_char_p, c_char_p, c_char)(addr)
- self.assertTrue(strchr("abcdef", "b"), "bcdef")
- self.assertEqual(strchr("abcdef", "x"), None)
- self.assertRaises(ArgumentError, strchr, "abcdef", 3.0)
- self.assertRaises(TypeError, strchr, "abcdef")
+ self.assertTrue(strchr(b"abcdef", b"b"), "bcdef")
+ self.assertEqual(strchr(b"abcdef", b"x"), None)
+ self.assertRaises(ArgumentError, strchr, b"abcdef", 3.0)
+ self.assertRaises(TypeError, strchr, b"abcdef")
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/ctypes/test/test_sizes.py b/Lib/ctypes/test/test_sizes.py
index 0509cbb680..f9b5e97260 100644
--- a/Lib/ctypes/test/test_sizes.py
+++ b/Lib/ctypes/test/test_sizes.py
@@ -1,8 +1,11 @@
# Test specifically-sized containers.
-import unittest
from ctypes import *
+import sys
+import unittest
+
+
class SizesTestCase(unittest.TestCase):
def test_8(self):
self.assertEqual(1, sizeof(c_int8))
@@ -23,5 +26,9 @@ class SizesTestCase(unittest.TestCase):
def test_size_t(self):
self.assertEqual(sizeof(c_void_p), sizeof(c_size_t))
+ def test_ssize_t(self):
+ self.assertEqual(sizeof(c_void_p), sizeof(c_ssize_t))
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/ctypes/test/test_stringptr.py b/Lib/ctypes/test/test_stringptr.py
index 8b16dcbe75..3d25fa5360 100644
--- a/Lib/ctypes/test/test_stringptr.py
+++ b/Lib/ctypes/test/test_stringptr.py
@@ -14,7 +14,7 @@ class StringPtrTestCase(unittest.TestCase):
# NULL pointer access
self.assertRaises(ValueError, getattr, x.str, "contents")
- b = c_buffer("Hello, World")
+ b = c_buffer(b"Hello, World")
from sys import getrefcount as grc
self.assertEqual(grc(b), 2)
x.str = b
@@ -63,8 +63,8 @@ class StringPtrTestCase(unittest.TestCase):
# So we must keep a reference to buf separately
strchr.restype = POINTER(c_char)
- buf = c_buffer("abcdef")
- r = strchr(buf, "c")
+ buf = c_buffer(b"abcdef")
+ r = strchr(buf, b"c")
x = r[0], r[1], r[2], r[3], r[4]
self.assertEqual(x, (b"c", b"d", b"e", b"f", b"\000"))
del buf
diff --git a/Lib/ctypes/test/test_strings.py b/Lib/ctypes/test/test_strings.py
index 3cd1f84006..1a9bdbc5c0 100644
--- a/Lib/ctypes/test/test_strings.py
+++ b/Lib/ctypes/test/test_strings.py
@@ -5,23 +5,23 @@ class StringArrayTestCase(unittest.TestCase):
def test(self):
BUF = c_char * 4
- buf = BUF("a", "b", "c")
+ buf = BUF(b"a", b"b", b"c")
self.assertEqual(buf.value, b"abc")
self.assertEqual(buf.raw, b"abc\000")
- buf.value = "ABCD"
+ buf.value = b"ABCD"
self.assertEqual(buf.value, b"ABCD")
self.assertEqual(buf.raw, b"ABCD")
- buf.value = "x"
+ buf.value = b"x"
self.assertEqual(buf.value, b"x")
self.assertEqual(buf.raw, b"x\000CD")
- buf[1] = "Z"
+ buf[1] = b"Z"
self.assertEqual(buf.value, b"xZCD")
self.assertEqual(buf.raw, b"xZCD")
- self.assertRaises(ValueError, setattr, buf, "value", "aaaaaaaa")
+ self.assertRaises(ValueError, setattr, buf, "value", b"aaaaaaaa")
self.assertRaises(TypeError, setattr, buf, "value", 42)
def test_c_buffer_value(self):
@@ -74,6 +74,13 @@ else:
buf[1] = "Z"
self.assertEqual(buf.value, "xZCD")
+ @unittest.skipIf(sizeof(c_wchar) < 4,
+ "sizeof(wchar_t) is smaller than 4 bytes")
+ def test_nonbmp(self):
+ u = chr(0x10ffff)
+ w = c_wchar(u)
+ self.assertEqual(w.value, u)
+
class StringTestCase(unittest.TestCase):
def XX_test_basic_strings(self):
cs = c_string("abcdef")
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py
index c58d94989c..536ea50cd8 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/ctypes/test/test_structures.py
@@ -205,15 +205,15 @@ class StructureTestCase(unittest.TestCase):
("age", c_int)]
self.assertRaises(TypeError, Person, 42)
- self.assertRaises(ValueError, Person, "asldkjaslkdjaslkdj")
+ self.assertRaises(ValueError, Person, b"asldkjaslkdjaslkdj")
self.assertRaises(TypeError, Person, "Name", "HI")
# short enough
- self.assertEqual(Person("12345", 5).name, "12345")
+ self.assertEqual(Person(b"12345", 5).name, b"12345")
# exact fit
- self.assertEqual(Person("123456", 5).name, "123456")
+ self.assertEqual(Person(b"123456", 5).name, b"123456")
# too long
- self.assertRaises(ValueError, Person, "1234567", 5)
+ self.assertRaises(ValueError, Person, b"1234567", 5)
def test_conflicting_initializers(self):
class POINT(Structure):
@@ -267,11 +267,11 @@ class StructureTestCase(unittest.TestCase):
("phone", Phone),
("age", c_int)]
- p = Person("Someone", ("1234", "5678"), 5)
+ p = Person(b"Someone", (b"1234", b"5678"), 5)
- self.assertEqual(p.name, "Someone")
- self.assertEqual(p.phone.areacode, "1234")
- self.assertEqual(p.phone.number, "5678")
+ self.assertEqual(p.name, b"Someone")
+ self.assertEqual(p.phone.areacode, b"1234")
+ self.assertEqual(p.phone.number, b"5678")
self.assertEqual(p.age, 5)
def test_structures_with_wchar(self):
@@ -284,8 +284,8 @@ class StructureTestCase(unittest.TestCase):
_fields_ = [("name", c_wchar * 12),
("age", c_int)]
- p = PersonW("Someone")
- self.assertEqual(p.name, "Someone")
+ p = PersonW("Someone \xe9")
+ self.assertEqual(p.name, "Someone \xe9")
self.assertEqual(PersonW("1234567890").name, "1234567890")
self.assertEqual(PersonW("12345678901").name, "12345678901")
@@ -304,13 +304,13 @@ class StructureTestCase(unittest.TestCase):
("phone", Phone),
("age", c_int)]
- cls, msg = self.get_except(Person, "Someone", (1, 2))
+ cls, msg = self.get_except(Person, b"Someone", (1, 2))
self.assertEqual(cls, RuntimeError)
self.assertEqual(msg,
"(Phone) <class 'TypeError'>: "
"expected string, int found")
- cls, msg = self.get_except(Person, "Someone", ("a", "b", "c"))
+ cls, msg = self.get_except(Person, b"Someone", (b"a", b"b", b"c"))
self.assertEqual(cls, RuntimeError)
if issubclass(Exception, object):
self.assertEqual(msg,
diff --git a/Lib/ctypes/test/test_unicode.py b/Lib/ctypes/test/test_unicode.py
index b4d3df3d77..c3b2d48771 100644
--- a/Lib/ctypes/test/test_unicode.py
+++ b/Lib/ctypes/test/test_unicode.py
@@ -7,122 +7,53 @@ except AttributeError:
pass
else:
import _ctypes_test
- dll = ctypes.CDLL(_ctypes_test.__file__)
- wcslen = dll.my_wcslen
- wcslen.argtypes = [ctypes.c_wchar_p]
-
class UnicodeTestCase(unittest.TestCase):
- def setUp(self):
- self.prev_conv_mode = ctypes.set_conversion_mode("ascii", "strict")
-
- def tearDown(self):
- ctypes.set_conversion_mode(*self.prev_conv_mode)
+ def test_wcslen(self):
+ dll = ctypes.CDLL(_ctypes_test.__file__)
+ wcslen = dll.my_wcslen
+ wcslen.argtypes = [ctypes.c_wchar_p]
- def test_ascii_strict(self):
- ctypes.set_conversion_mode("ascii", "strict")
- # no conversions take place with unicode arguments
self.assertEqual(wcslen("abc"), 3)
self.assertEqual(wcslen("ab\u2070"), 3)
- # string args are converted
- self.assertEqual(wcslen("abc"), 3)
self.assertRaises(ctypes.ArgumentError, wcslen, b"ab\xe4")
- def test_ascii_replace(self):
- ctypes.set_conversion_mode("ascii", "replace")
- self.assertEqual(wcslen("abc"), 3)
- self.assertEqual(wcslen("ab\u2070"), 3)
- self.assertEqual(wcslen("abc"), 3)
- self.assertEqual(wcslen("ab\xe4"), 3)
-
- def test_ascii_ignore(self):
- ctypes.set_conversion_mode("ascii", "ignore")
- self.assertEqual(wcslen("abc"), 3)
- self.assertEqual(wcslen("ab\u2070"), 3)
- # ignore error mode skips non-ascii characters
- self.assertEqual(wcslen("abc"), 3)
- self.assertEqual(wcslen(b"\xe4\xf6\xfc\xdf"), 0)
-
- def test_latin1_strict(self):
- ctypes.set_conversion_mode("latin-1", "strict")
- self.assertEqual(wcslen("abc"), 3)
- self.assertEqual(wcslen("ab\u2070"), 3)
- self.assertEqual(wcslen("abc"), 3)
- self.assertEqual(wcslen("\xe4\xf6\xfc\xdf"), 4)
-
def test_buffers(self):
- ctypes.set_conversion_mode("ascii", "strict")
buf = ctypes.create_unicode_buffer("abc")
self.assertEqual(len(buf), 3+1)
- ctypes.set_conversion_mode("ascii", "replace")
- buf = ctypes.create_unicode_buffer(b"ab\xe4\xf6\xfc")
- self.assertEqual(buf[:], "ab\uFFFD\uFFFD\uFFFD\0")
- self.assertEqual(buf[::], "ab\uFFFD\uFFFD\uFFFD\0")
- self.assertEqual(buf[::-1], "\0\uFFFD\uFFFD\uFFFDba")
- self.assertEqual(buf[::2], "a\uFFFD\uFFFD")
+ buf = ctypes.create_unicode_buffer("ab\xe4\xf6\xfc")
+ self.assertEqual(buf[:], "ab\xe4\xf6\xfc\0")
+ self.assertEqual(buf[::], "ab\xe4\xf6\xfc\0")
+ self.assertEqual(buf[::-1], '\x00\xfc\xf6\xe4ba')
+ self.assertEqual(buf[::2], 'a\xe4\xfc')
self.assertEqual(buf[6:5:-1], "")
- ctypes.set_conversion_mode("ascii", "ignore")
- buf = ctypes.create_unicode_buffer(b"ab\xe4\xf6\xfc")
- # is that correct? not sure. But with 'ignore', you get what you pay for..
- self.assertEqual(buf[:], "ab\0\0\0\0")
- self.assertEqual(buf[::], "ab\0\0\0\0")
- self.assertEqual(buf[::-1], "\0\0\0\0ba")
- self.assertEqual(buf[::2], "a\0\0")
- self.assertEqual(buf[6:5:-1], "")
-
- import _ctypes_test
func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p
class StringTestCase(UnicodeTestCase):
def setUp(self):
- self.prev_conv_mode = ctypes.set_conversion_mode("ascii", "strict")
func.argtypes = [ctypes.c_char_p]
func.restype = ctypes.c_char_p
def tearDown(self):
- ctypes.set_conversion_mode(*self.prev_conv_mode)
func.argtypes = None
func.restype = ctypes.c_int
- def test_ascii_replace(self):
- ctypes.set_conversion_mode("ascii", "strict")
- self.assertEqual(func("abc"), "abc")
- self.assertEqual(func("abc"), "abc")
- self.assertRaises(ctypes.ArgumentError, func, "ab\xe4")
-
- def test_ascii_ignore(self):
- ctypes.set_conversion_mode("ascii", "ignore")
- self.assertEqual(func("abc"), b"abc")
- self.assertEqual(func("abc"), b"abc")
- self.assertEqual(func("\xe4\xf6\xfc\xdf"), b"")
-
- def test_ascii_replace(self):
- ctypes.set_conversion_mode("ascii", "replace")
- self.assertEqual(func("abc"), b"abc")
- self.assertEqual(func("abc"), b"abc")
- self.assertEqual(func("\xe4\xf6\xfc\xdf"), b"????")
+ def test_func(self):
+ self.assertEqual(func(b"abc\xe4"), b"abc\xe4")
def test_buffers(self):
- ctypes.set_conversion_mode("ascii", "strict")
- buf = ctypes.create_string_buffer("abc")
+ buf = ctypes.create_string_buffer(b"abc")
self.assertEqual(len(buf), 3+1)
- ctypes.set_conversion_mode("ascii", "replace")
- buf = ctypes.create_string_buffer("ab\xe4\xf6\xfc")
- self.assertEqual(buf[:], b"ab???\0")
- self.assertEqual(buf[::], b"ab???\0")
- self.assertEqual(buf[::-1], b"\0???ba")
- self.assertEqual(buf[::2], b"a??")
+ buf = ctypes.create_string_buffer(b"ab\xe4\xf6\xfc")
+ self.assertEqual(buf[:], b"ab\xe4\xf6\xfc\0")
+ self.assertEqual(buf[::], b"ab\xe4\xf6\xfc\0")
+ self.assertEqual(buf[::-1], b'\x00\xfc\xf6\xe4ba')
+ self.assertEqual(buf[::2], b'a\xe4\xfc')
self.assertEqual(buf[6:5:-1], b"")
- ctypes.set_conversion_mode("ascii", "ignore")
- buf = ctypes.create_string_buffer("ab\xe4\xf6\xfc")
- # is that correct? not sure. But with 'ignore', you get what you pay for..
- self.assertEqual(buf[:], b"ab\0\0\0\0")
- self.assertEqual(buf[::], b"ab\0\0\0\0")
- self.assertEqual(buf[::-1], b"\0\0\0\0ba")
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 52bc29614c..1881e89688 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -1,4 +1,5 @@
import sys, os
+import contextlib
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":
@@ -117,11 +118,8 @@ elif os.name == "posix":
if not f:
return None
cmd = "/usr/ccs/bin/dump -Lpv 2>/dev/null " + f
- f = os.popen(cmd)
- try:
+ with contextlib.closing(os.popen(cmd)) as f:
data = f.read()
- finally:
- f.close()
res = re.search(r'\[.*\]\sSONAME\s+([^\s]+)', data)
if not res:
return None
@@ -138,11 +136,8 @@ elif os.name == "posix":
rv = f.close()
if rv == 10:
raise OSError('objdump command not found')
- f = os.popen(cmd)
- try:
+ with contextlib.closing(os.popen(cmd)) as f:
data = f.read()
- finally:
- f.close()
res = re.search(r'\sSONAME\s+([^\s]+)', data)
if not res:
return None
@@ -166,11 +161,8 @@ elif os.name == "posix":
def find_library(name):
ename = re.escape(name)
expr = r':-l%s\.\S+ => \S*/(lib%s\.\S+)' % (ename, ename)
- f = os.popen('/sbin/ldconfig -r 2>/dev/null')
- try:
+ with contextlib.closing(os.popen('/sbin/ldconfig -r 2>/dev/null')) as f:
data = f.read()
- finally:
- f.close()
res = re.findall(expr, data)
if not res:
return _get_soname(_findLib_gcc(name))
@@ -182,20 +174,14 @@ elif os.name == "posix":
def _findLib_ldconfig(name):
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'/[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
- f = os.popen('/sbin/ldconfig -p 2>/dev/null')
- try:
+ with contextlib.closing(os.popen('/sbin/ldconfig -p 2>/dev/null')) as f:
data = f.read()
- finally:
- f.close()
res = re.search(expr, data)
if not res:
# Hm, this works only for libs needed by the python executable.
cmd = 'ldd %s 2>/dev/null' % sys.executable
- f = os.popen(cmd)
- try:
+ with contextlib.closing(os.popen(cmd)) as f:
data = f.read()
- finally:
- f.close()
res = re.search(expr, data)
if not res:
return None
@@ -219,11 +205,8 @@ elif os.name == "posix":
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \
% (abi_type, re.escape(name))
- f = os.popen('LC_ALL=C LANG=C /sbin/ldconfig -p 2>/dev/null')
- try:
+ with contextlib.closing(os.popen('LC_ALL=C LANG=C /sbin/ldconfig -p 2>/dev/null')) as f:
data = f.read()
- finally:
- f.close()
res = re.search(expr, data)
if not res:
return None
diff --git a/Lib/ctypes/wintypes.py b/Lib/ctypes/wintypes.py
index e7f569c9b6..c619d27596 100644
--- a/Lib/ctypes/wintypes.py
+++ b/Lib/ctypes/wintypes.py
@@ -1,49 +1,50 @@
# The most useful windows datatypes
-from ctypes import *
+import ctypes
-BYTE = c_byte
-WORD = c_ushort
-DWORD = c_ulong
+BYTE = ctypes.c_byte
+WORD = ctypes.c_ushort
+DWORD = ctypes.c_ulong
-WCHAR = c_wchar
-UINT = c_uint
-INT = c_int
+#UCHAR = ctypes.c_uchar
+CHAR = ctypes.c_char
+WCHAR = ctypes.c_wchar
+UINT = ctypes.c_uint
+INT = ctypes.c_int
-DOUBLE = c_double
-FLOAT = c_float
+DOUBLE = ctypes.c_double
+FLOAT = ctypes.c_float
BOOLEAN = BYTE
-BOOL = c_long
+BOOL = ctypes.c_long
-from ctypes import _SimpleCData
-class VARIANT_BOOL(_SimpleCData):
+class VARIANT_BOOL(ctypes._SimpleCData):
_type_ = "v"
def __repr__(self):
return "%s(%r)" % (self.__class__.__name__, self.value)
-ULONG = c_ulong
-LONG = c_long
+ULONG = ctypes.c_ulong
+LONG = ctypes.c_long
-USHORT = c_ushort
-SHORT = c_short
+USHORT = ctypes.c_ushort
+SHORT = ctypes.c_short
# in the windows header files, these are structures.
-_LARGE_INTEGER = LARGE_INTEGER = c_longlong
-_ULARGE_INTEGER = ULARGE_INTEGER = c_ulonglong
+_LARGE_INTEGER = LARGE_INTEGER = ctypes.c_longlong
+_ULARGE_INTEGER = ULARGE_INTEGER = ctypes.c_ulonglong
-LPCOLESTR = LPOLESTR = OLESTR = c_wchar_p
-LPCWSTR = LPWSTR = c_wchar_p
-LPCSTR = LPSTR = c_char_p
-LPCVOID = LPVOID = c_void_p
+LPCOLESTR = LPOLESTR = OLESTR = ctypes.c_wchar_p
+LPCWSTR = LPWSTR = ctypes.c_wchar_p
+LPCSTR = LPSTR = ctypes.c_char_p
+LPCVOID = LPVOID = ctypes.c_void_p
# WPARAM is defined as UINT_PTR (unsigned type)
# LPARAM is defined as LONG_PTR (signed type)
-if sizeof(c_long) == sizeof(c_void_p):
- WPARAM = c_ulong
- LPARAM = c_long
-elif sizeof(c_longlong) == sizeof(c_void_p):
- WPARAM = c_ulonglong
- LPARAM = c_longlong
+if ctypes.sizeof(ctypes.c_long) == ctypes.sizeof(ctypes.c_void_p):
+ WPARAM = ctypes.c_ulong
+ LPARAM = ctypes.c_long
+elif ctypes.sizeof(ctypes.c_longlong) == ctypes.sizeof(ctypes.c_void_p):
+ WPARAM = ctypes.c_ulonglong
+ LPARAM = ctypes.c_longlong
ATOM = WORD
LANGID = WORD
@@ -56,7 +57,7 @@ LCID = DWORD
################################################################
# HANDLE types
-HANDLE = c_void_p # in the header files: void *
+HANDLE = ctypes.c_void_p # in the header files: void *
HACCEL = HANDLE
HBITMAP = HANDLE
@@ -93,45 +94,45 @@ SERVICE_STATUS_HANDLE = HANDLE
################################################################
# Some important structure definitions
-class RECT(Structure):
- _fields_ = [("left", c_long),
- ("top", c_long),
- ("right", c_long),
- ("bottom", c_long)]
+class RECT(ctypes.Structure):
+ _fields_ = [("left", LONG),
+ ("top", LONG),
+ ("right", LONG),
+ ("bottom", LONG)]
tagRECT = _RECTL = RECTL = RECT
-class _SMALL_RECT(Structure):
- _fields_ = [('Left', c_short),
- ('Top', c_short),
- ('Right', c_short),
- ('Bottom', c_short)]
+class _SMALL_RECT(ctypes.Structure):
+ _fields_ = [('Left', SHORT),
+ ('Top', SHORT),
+ ('Right', SHORT),
+ ('Bottom', SHORT)]
SMALL_RECT = _SMALL_RECT
-class _COORD(Structure):
- _fields_ = [('X', c_short),
- ('Y', c_short)]
+class _COORD(ctypes.Structure):
+ _fields_ = [('X', SHORT),
+ ('Y', SHORT)]
-class POINT(Structure):
- _fields_ = [("x", c_long),
- ("y", c_long)]
+class POINT(ctypes.Structure):
+ _fields_ = [("x", LONG),
+ ("y", LONG)]
tagPOINT = _POINTL = POINTL = POINT
-class SIZE(Structure):
- _fields_ = [("cx", c_long),
- ("cy", c_long)]
+class SIZE(ctypes.Structure):
+ _fields_ = [("cx", LONG),
+ ("cy", LONG)]
tagSIZE = SIZEL = SIZE
def RGB(red, green, blue):
return red + (green << 8) + (blue << 16)
-class FILETIME(Structure):
+class FILETIME(ctypes.Structure):
_fields_ = [("dwLowDateTime", DWORD),
("dwHighDateTime", DWORD)]
_FILETIME = FILETIME
-class MSG(Structure):
+class MSG(ctypes.Structure):
_fields_ = [("hWnd", HWND),
- ("message", c_uint),
+ ("message", UINT),
("wParam", WPARAM),
("lParam", LPARAM),
("time", DWORD),
@@ -139,7 +140,7 @@ class MSG(Structure):
tagMSG = MSG
MAX_PATH = 260
-class WIN32_FIND_DATAA(Structure):
+class WIN32_FIND_DATAA(ctypes.Structure):
_fields_ = [("dwFileAttributes", DWORD),
("ftCreationTime", FILETIME),
("ftLastAccessTime", FILETIME),
@@ -148,10 +149,10 @@ class WIN32_FIND_DATAA(Structure):
("nFileSizeLow", DWORD),
("dwReserved0", DWORD),
("dwReserved1", DWORD),
- ("cFileName", c_char * MAX_PATH),
- ("cAlternateFileName", c_char * 14)]
+ ("cFileName", CHAR * MAX_PATH),
+ ("cAlternateFileName", CHAR * 14)]
-class WIN32_FIND_DATAW(Structure):
+class WIN32_FIND_DATAW(ctypes.Structure):
_fields_ = [("dwFileAttributes", DWORD),
("ftCreationTime", FILETIME),
("ftLastAccessTime", FILETIME),
@@ -160,22 +161,42 @@ class WIN32_FIND_DATAW(Structure):
("nFileSizeLow", DWORD),
("dwReserved0", DWORD),
("dwReserved1", DWORD),
- ("cFileName", c_wchar * MAX_PATH),
- ("cAlternateFileName", c_wchar * 14)]
-
-__all__ = ['ATOM', 'BOOL', 'BOOLEAN', 'BYTE', 'COLORREF', 'DOUBLE', 'DWORD',
- 'FILETIME', 'FLOAT', 'HACCEL', 'HANDLE', 'HBITMAP', 'HBRUSH',
- 'HCOLORSPACE', 'HDC', 'HDESK', 'HDWP', 'HENHMETAFILE', 'HFONT',
- 'HGDIOBJ', 'HGLOBAL', 'HHOOK', 'HICON', 'HINSTANCE', 'HKEY',
- 'HKL', 'HLOCAL', 'HMENU', 'HMETAFILE', 'HMODULE', 'HMONITOR',
- 'HPALETTE', 'HPEN', 'HRGN', 'HRSRC', 'HSTR', 'HTASK', 'HWINSTA',
- 'HWND', 'INT', 'LANGID', 'LARGE_INTEGER', 'LCID', 'LCTYPE',
- 'LGRPID', 'LONG', 'LPARAM', 'LPCOLESTR', 'LPCSTR', 'LPCVOID',
- 'LPCWSTR', 'LPOLESTR', 'LPSTR', 'LPVOID', 'LPWSTR', 'MAX_PATH',
- 'MSG', 'OLESTR', 'POINT', 'POINTL', 'RECT', 'RECTL', 'RGB',
- 'SC_HANDLE', 'SERVICE_STATUS_HANDLE', 'SHORT', 'SIZE', 'SIZEL',
- 'SMALL_RECT', 'UINT', 'ULARGE_INTEGER', 'ULONG', 'USHORT',
- 'VARIANT_BOOL', 'WCHAR', 'WIN32_FIND_DATAA', 'WIN32_FIND_DATAW',
- 'WORD', 'WPARAM', '_COORD', '_FILETIME', '_LARGE_INTEGER',
- '_POINTL', '_RECTL', '_SMALL_RECT', '_ULARGE_INTEGER', 'tagMSG',
- 'tagPOINT', 'tagRECT', 'tagSIZE']
+ ("cFileName", WCHAR * MAX_PATH),
+ ("cAlternateFileName", WCHAR * 14)]
+
+################################################################
+# Pointer types
+
+LPBOOL = PBOOL = ctypes.POINTER(BOOL)
+PBOOLEAN = ctypes.POINTER(BOOLEAN)
+LPBYTE = PBYTE = ctypes.POINTER(BYTE)
+PCHAR = ctypes.POINTER(CHAR)
+LPCOLORREF = ctypes.POINTER(COLORREF)
+LPDWORD = PDWORD = ctypes.POINTER(DWORD)
+LPFILETIME = PFILETIME = ctypes.POINTER(FILETIME)
+PFLOAT = ctypes.POINTER(FLOAT)
+LPHANDLE = PHANDLE = ctypes.POINTER(HANDLE)
+PHKEY = ctypes.POINTER(HKEY)
+LPHKL = ctypes.POINTER(HKL)
+LPINT = PINT = ctypes.POINTER(INT)
+PLARGE_INTEGER = ctypes.POINTER(LARGE_INTEGER)
+PLCID = ctypes.POINTER(LCID)
+LPLONG = PLONG = ctypes.POINTER(LONG)
+LPMSG = PMSG = ctypes.POINTER(MSG)
+LPPOINT = PPOINT = ctypes.POINTER(POINT)
+PPOINTL = ctypes.POINTER(POINTL)
+LPRECT = PRECT = ctypes.POINTER(RECT)
+LPRECTL = PRECTL = ctypes.POINTER(RECTL)
+LPSC_HANDLE = ctypes.POINTER(SC_HANDLE)
+PSHORT = ctypes.POINTER(SHORT)
+LPSIZE = PSIZE = ctypes.POINTER(SIZE)
+LPSIZEL = PSIZEL = ctypes.POINTER(SIZEL)
+PSMALL_RECT = ctypes.POINTER(SMALL_RECT)
+LPUINT = PUINT = ctypes.POINTER(UINT)
+PULARGE_INTEGER = ctypes.POINTER(ULARGE_INTEGER)
+PULONG = ctypes.POINTER(ULONG)
+PUSHORT = ctypes.POINTER(USHORT)
+PWCHAR = ctypes.POINTER(WCHAR)
+LPWIN32_FIND_DATAA = PWIN32_FIND_DATAA = ctypes.POINTER(WIN32_FIND_DATAA)
+LPWIN32_FIND_DATAW = PWIN32_FIND_DATAW = ctypes.POINTER(WIN32_FIND_DATAW)
+LPWORD = PWORD = ctypes.POINTER(WORD)
diff --git a/Lib/datetime.py b/Lib/datetime.py
new file mode 100644
index 0000000000..1ae7cb5305
--- /dev/null
+++ b/Lib/datetime.py
@@ -0,0 +1,2112 @@
+"""Concrete date/time and related types -- prototype implemented in Python.
+
+See http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
+
+See also http://dir.yahoo.com/Reference/calendars/
+
+For a primer on DST, including many current DST rules, see
+http://webexhibits.org/daylightsaving/
+
+For more about DST than you ever wanted to know, see
+ftp://elsie.nci.nih.gov/pub/
+
+Sources for time zone and DST data: http://www.twinsun.com/tz/tz-link.htm
+
+This was originally copied from the sandbox of the CPython CVS repository.
+Thanks to Tim Peters for suggesting using it.
+"""
+
+import time as _time
+import math as _math
+
+def _cmp(x, y):
+ return 0 if x == y else 1 if x > y else -1
+
+MINYEAR = 1
+MAXYEAR = 9999
+_MAXORDINAL = 3652059 # date.max.toordinal()
+
+# Utility functions, adapted from Python's Demo/classes/Dates.py, which
+# also assumes the current Gregorian calendar indefinitely extended in
+# both directions. Difference: Dates.py calls January 1 of year 0 day
+# number 1. The code here calls January 1 of year 1 day number 1. This is
+# to match the definition of the "proleptic Gregorian" calendar in Dershowitz
+# and Reingold's "Calendrical Calculations", where it's the base calendar
+# for all computations. See the book for algorithms for converting between
+# proleptic Gregorian ordinals and many other calendar systems.
+
+_DAYS_IN_MONTH = [None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+
+_DAYS_BEFORE_MONTH = [None]
+dbm = 0
+for dim in _DAYS_IN_MONTH[1:]:
+ _DAYS_BEFORE_MONTH.append(dbm)
+ dbm += dim
+del dbm, dim
+
+def _is_leap(year):
+ "year -> 1 if leap year, else 0."
+ return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
+
+def _days_before_year(year):
+ "year -> number of days before January 1st of year."
+ y = year - 1
+ return y*365 + y//4 - y//100 + y//400
+
+def _days_in_month(year, month):
+ "year, month -> number of days in that month in that year."
+ assert 1 <= month <= 12, month
+ if month == 2 and _is_leap(year):
+ return 29
+ return _DAYS_IN_MONTH[month]
+
+def _days_before_month(year, month):
+ "year, month -> number of days in year preceeding first day of month."
+ assert 1 <= month <= 12, 'month must be in 1..12'
+ return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))
+
+def _ymd2ord(year, month, day):
+ "year, month, day -> ordinal, considering 01-Jan-0001 as day 1."
+ assert 1 <= month <= 12, 'month must be in 1..12'
+ dim = _days_in_month(year, month)
+ assert 1 <= day <= dim, ('day must be in 1..%d' % dim)
+ return (_days_before_year(year) +
+ _days_before_month(year, month) +
+ day)
+
+_DI400Y = _days_before_year(401) # number of days in 400 years
+_DI100Y = _days_before_year(101) # " " " " 100 "
+_DI4Y = _days_before_year(5) # " " " " 4 "
+
+# A 4-year cycle has an extra leap day over what we'd get from pasting
+# together 4 single years.
+assert _DI4Y == 4 * 365 + 1
+
+# Similarly, a 400-year cycle has an extra leap day over what we'd get from
+# pasting together 4 100-year cycles.
+assert _DI400Y == 4 * _DI100Y + 1
+
+# OTOH, a 100-year cycle has one fewer leap day than we'd get from
+# pasting together 25 4-year cycles.
+assert _DI100Y == 25 * _DI4Y - 1
+
+def _ord2ymd(n):
+ "ordinal -> (year, month, day), considering 01-Jan-0001 as day 1."
+
+ # n is a 1-based index, starting at 1-Jan-1. The pattern of leap years
+ # repeats exactly every 400 years. The basic strategy is to find the
+ # closest 400-year boundary at or before n, then work with the offset
+ # from that boundary to n. Life is much clearer if we subtract 1 from
+ # n first -- then the values of n at 400-year boundaries are exactly
+ # those divisible by _DI400Y:
+ #
+ # D M Y n n-1
+ # -- --- ---- ---------- ----------------
+ # 31 Dec -400 -_DI400Y -_DI400Y -1
+ # 1 Jan -399 -_DI400Y +1 -_DI400Y 400-year boundary
+ # ...
+ # 30 Dec 000 -1 -2
+ # 31 Dec 000 0 -1
+ # 1 Jan 001 1 0 400-year boundary
+ # 2 Jan 001 2 1
+ # 3 Jan 001 3 2
+ # ...
+ # 31 Dec 400 _DI400Y _DI400Y -1
+ # 1 Jan 401 _DI400Y +1 _DI400Y 400-year boundary
+ n -= 1
+ n400, n = divmod(n, _DI400Y)
+ year = n400 * 400 + 1 # ..., -399, 1, 401, ...
+
+ # Now n is the (non-negative) offset, in days, from January 1 of year, to
+ # the desired date. Now compute how many 100-year cycles precede n.
+ # Note that it's possible for n100 to equal 4! In that case 4 full
+ # 100-year cycles precede the desired day, which implies the desired
+ # day is December 31 at the end of a 400-year cycle.
+ n100, n = divmod(n, _DI100Y)
+
+ # Now compute how many 4-year cycles precede it.
+ n4, n = divmod(n, _DI4Y)
+
+ # And now how many single years. Again n1 can be 4, and again meaning
+ # that the desired day is December 31 at the end of the 4-year cycle.
+ n1, n = divmod(n, 365)
+
+ year += n100 * 100 + n4 * 4 + n1
+ if n1 == 4 or n100 == 4:
+ assert n == 0
+ return year-1, 12, 31
+
+ # Now the year is correct, and n is the offset from January 1. We find
+ # the month via an estimate that's either exact or one too large.
+ leapyear = n1 == 3 and (n4 != 24 or n100 == 3)
+ assert leapyear == _is_leap(year)
+ month = (n + 50) >> 5
+ preceding = _DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)
+ if preceding > n: # estimate is too large
+ month -= 1
+ preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear)
+ n -= preceding
+ assert 0 <= n < _days_in_month(year, month)
+
+ # Now the year and month are correct, and n is the offset from the
+ # start of that month: we're done!
+ return year, month, n+1
+
+# Month and day names. For localized versions, see the calendar module.
+_MONTHNAMES = [None, "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+_DAYNAMES = [None, "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
+
+
+def _build_struct_time(y, m, d, hh, mm, ss, dstflag):
+ wday = (_ymd2ord(y, m, d) + 6) % 7
+ dnum = _days_before_month(y, m) + d
+ return _time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))
+
+def _format_time(hh, mm, ss, us):
+ # Skip trailing microseconds when us==0.
+ result = "%02d:%02d:%02d" % (hh, mm, ss)
+ if us:
+ result += ".%06d" % us
+ return result
+
+# Correctly substitute for %z and %Z escapes in strftime formats.
+def _wrap_strftime(object, format, timetuple):
+ year = timetuple[0]
+ if year < 1000:
+ raise ValueError("year=%d is before 1000; the datetime strftime() "
+ "methods require year >= 1000" % year)
+ # Don't call utcoffset() or tzname() unless actually needed.
+ freplace = None # the string to use for %f
+ zreplace = None # the string to use for %z
+ Zreplace = None # the string to use for %Z
+
+ # Scan format for %z and %Z escapes, replacing as needed.
+ newformat = []
+ push = newformat.append
+ i, n = 0, len(format)
+ while i < n:
+ ch = format[i]
+ i += 1
+ if ch == '%':
+ if i < n:
+ ch = format[i]
+ i += 1
+ if ch == 'f':
+ if freplace is None:
+ freplace = '%06d' % getattr(object,
+ 'microsecond', 0)
+ newformat.append(freplace)
+ elif ch == 'z':
+ if zreplace is None:
+ zreplace = ""
+ if hasattr(object, "utcoffset"):
+ offset = object.utcoffset()
+ if offset is not None:
+ sign = '+'
+ if offset.days < 0:
+ offset = -offset
+ sign = '-'
+ h, m = divmod(offset, timedelta(hours=1))
+ assert not m % timedelta(minutes=1), "whole minute"
+ m //= timedelta(minutes=1)
+ zreplace = '%c%02d%02d' % (sign, h, m)
+ assert '%' not in zreplace
+ newformat.append(zreplace)
+ elif ch == 'Z':
+ if Zreplace is None:
+ Zreplace = ""
+ if hasattr(object, "tzname"):
+ s = object.tzname()
+ if s is not None:
+ # strftime is going to have at this: escape %
+ Zreplace = s.replace('%', '%%')
+ newformat.append(Zreplace)
+ else:
+ push('%')
+ push(ch)
+ else:
+ push('%')
+ else:
+ push(ch)
+ newformat = "".join(newformat)
+ return _time.strftime(newformat, timetuple)
+
+def _call_tzinfo_method(tzinfo, methname, tzinfoarg):
+ if tzinfo is None:
+ return None
+ return getattr(tzinfo, methname)(tzinfoarg)
+
+# Just raise TypeError if the arg isn't None or a string.
+def _check_tzname(name):
+ if name is not None and not isinstance(name, str):
+ raise TypeError("tzinfo.tzname() must return None or string, "
+ "not '%s'" % type(name))
+
+# name is the offset-producing method, "utcoffset" or "dst".
+# offset is what it returned.
+# If offset isn't None or timedelta, raises TypeError.
+# If offset is None, returns None.
+# Else offset is checked for being in range, and a whole # of minutes.
+# If it is, its integer value is returned. Else ValueError is raised.
+def _check_utc_offset(name, offset):
+ assert name in ("utcoffset", "dst")
+ if offset is None:
+ return
+ if not isinstance(offset, timedelta):
+ raise TypeError("tzinfo.%s() must return None "
+ "or timedelta, not '%s'" % (name, type(offset)))
+ if offset % timedelta(minutes=1) or offset.microseconds:
+ raise ValueError("tzinfo.%s() must return a whole number "
+ "of minutes, got %s" % (name, offset))
+ if not -timedelta(1) < offset < timedelta(1):
+ raise ValueError("%s()=%s, must be must be strictly between"
+ " -timedelta(hours=24) and timedelta(hours=24)"
+ % (name, offset))
+
+def _check_date_fields(year, month, day):
+ if not isinstance(year, int):
+ raise TypeError('int expected')
+ if not MINYEAR <= year <= MAXYEAR:
+ raise ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)
+ if not 1 <= month <= 12:
+ raise ValueError('month must be in 1..12', month)
+ dim = _days_in_month(year, month)
+ if not 1 <= day <= dim:
+ raise ValueError('day must be in 1..%d' % dim, day)
+
+def _check_time_fields(hour, minute, second, microsecond):
+ if not isinstance(hour, int):
+ raise TypeError('int expected')
+ if not 0 <= hour <= 23:
+ raise ValueError('hour must be in 0..23', hour)
+ if not 0 <= minute <= 59:
+ raise ValueError('minute must be in 0..59', minute)
+ if not 0 <= second <= 59:
+ raise ValueError('second must be in 0..59', second)
+ if not 0 <= microsecond <= 999999:
+ raise ValueError('microsecond must be in 0..999999', microsecond)
+
+def _check_tzinfo_arg(tz):
+ if tz is not None and not isinstance(tz, tzinfo):
+ raise TypeError("tzinfo argument must be None or of a tzinfo subclass")
+
+def _cmperror(x, y):
+ raise TypeError("can't compare '%s' to '%s'" % (
+ type(x).__name__, type(y).__name__))
+
+class timedelta:
+ """Represent the difference between two datetime objects.
+
+ Supported operators:
+
+ - add, subtract timedelta
+ - unary plus, minus, abs
+ - compare to timedelta
+ - multiply, divide by int/long
+
+ In addition, datetime supports subtraction of two datetime objects
+ returning a timedelta, and addition or subtraction of a datetime
+ and a timedelta giving a datetime.
+
+ Representation: (days, seconds, microseconds). Why? Because I
+ felt like it.
+ """
+ __slots__ = '_days', '_seconds', '_microseconds'
+
+ def __new__(cls, days=0, seconds=0, microseconds=0,
+ milliseconds=0, minutes=0, hours=0, weeks=0):
+ # Doing this efficiently and accurately in C is going to be difficult
+ # and error-prone, due to ubiquitous overflow possibilities, and that
+ # C double doesn't have enough bits of precision to represent
+ # microseconds over 10K years faithfully. The code here tries to make
+ # explicit where go-fast assumptions can be relied on, in order to
+ # guide the C implementation; it's way more convoluted than speed-
+ # ignoring auto-overflow-to-long idiomatic Python could be.
+
+ # XXX Check that all inputs are ints or floats.
+
+ # Final values, all integer.
+ # s and us fit in 32-bit signed ints; d isn't bounded.
+ d = s = us = 0
+
+ # Normalize everything to days, seconds, microseconds.
+ days += weeks*7
+ seconds += minutes*60 + hours*3600
+ microseconds += milliseconds*1000
+
+ # Get rid of all fractions, and normalize s and us.
+ # Take a deep breath <wink>.
+ if isinstance(days, float):
+ dayfrac, days = _math.modf(days)
+ daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))
+ assert daysecondswhole == int(daysecondswhole) # can't overflow
+ s = int(daysecondswhole)
+ assert days == int(days)
+ d = int(days)
+ else:
+ daysecondsfrac = 0.0
+ d = days
+ assert isinstance(daysecondsfrac, float)
+ assert abs(daysecondsfrac) <= 1.0
+ assert isinstance(d, int)
+ assert abs(s) <= 24 * 3600
+ # days isn't referenced again before redefinition
+
+ if isinstance(seconds, float):
+ secondsfrac, seconds = _math.modf(seconds)
+ assert seconds == int(seconds)
+ seconds = int(seconds)
+ secondsfrac += daysecondsfrac
+ assert abs(secondsfrac) <= 2.0
+ else:
+ secondsfrac = daysecondsfrac
+ # daysecondsfrac isn't referenced again
+ assert isinstance(secondsfrac, float)
+ assert abs(secondsfrac) <= 2.0
+
+ assert isinstance(seconds, int)
+ days, seconds = divmod(seconds, 24*3600)
+ d += days
+ s += int(seconds) # can't overflow
+ assert isinstance(s, int)
+ assert abs(s) <= 2 * 24 * 3600
+ # seconds isn't referenced again before redefinition
+
+ usdouble = secondsfrac * 1e6
+ assert abs(usdouble) < 2.1e6 # exact value not critical
+ # secondsfrac isn't referenced again
+
+ if isinstance(microseconds, float):
+ microseconds += usdouble
+ microseconds = round(microseconds, 0)
+ seconds, microseconds = divmod(microseconds, 1e6)
+ assert microseconds == int(microseconds)
+ assert seconds == int(seconds)
+ days, seconds = divmod(seconds, 24.*3600.)
+ assert days == int(days)
+ assert seconds == int(seconds)
+ d += int(days)
+ s += int(seconds) # can't overflow
+ assert isinstance(s, int)
+ assert abs(s) <= 3 * 24 * 3600
+ else:
+ seconds, microseconds = divmod(microseconds, 1000000)
+ days, seconds = divmod(seconds, 24*3600)
+ d += days
+ s += int(seconds) # can't overflow
+ assert isinstance(s, int)
+ assert abs(s) <= 3 * 24 * 3600
+ microseconds = float(microseconds)
+ microseconds += usdouble
+ microseconds = round(microseconds, 0)
+ assert abs(s) <= 3 * 24 * 3600
+ assert abs(microseconds) < 3.1e6
+
+ # Just a little bit of carrying possible for microseconds and seconds.
+ assert isinstance(microseconds, float)
+ assert int(microseconds) == microseconds
+ us = int(microseconds)
+ seconds, us = divmod(us, 1000000)
+ s += seconds # cant't overflow
+ assert isinstance(s, int)
+ days, s = divmod(s, 24*3600)
+ d += days
+
+ assert isinstance(d, int)
+ assert isinstance(s, int) and 0 <= s < 24*3600
+ assert isinstance(us, int) and 0 <= us < 1000000
+
+ self = object.__new__(cls)
+
+ self._days = d
+ self._seconds = s
+ self._microseconds = us
+ if abs(d) > 999999999:
+ raise OverflowError("timedelta # of days is too large: %d" % d)
+
+ return self
+
+ def __repr__(self):
+ if self._microseconds:
+ return "%s(%d, %d, %d)" % ('datetime.' + self.__class__.__name__,
+ self._days,
+ self._seconds,
+ self._microseconds)
+ if self._seconds:
+ return "%s(%d, %d)" % ('datetime.' + self.__class__.__name__,
+ self._days,
+ self._seconds)
+ return "%s(%d)" % ('datetime.' + self.__class__.__name__, self._days)
+
+ def __str__(self):
+ mm, ss = divmod(self._seconds, 60)
+ hh, mm = divmod(mm, 60)
+ s = "%d:%02d:%02d" % (hh, mm, ss)
+ if self._days:
+ def plural(n):
+ return n, abs(n) != 1 and "s" or ""
+ s = ("%d day%s, " % plural(self._days)) + s
+ if self._microseconds:
+ s = s + ".%06d" % self._microseconds
+ return s
+
+ def total_seconds(self):
+ """Total seconds in the duration."""
+ return ((self.days * 86400 + self.seconds)*10**6 +
+ self.microseconds) / 10**6
+
+ # Read-only field accessors
+ @property
+ def days(self):
+ """days"""
+ return self._days
+
+ @property
+ def seconds(self):
+ """seconds"""
+ return self._seconds
+
+ @property
+ def microseconds(self):
+ """microseconds"""
+ return self._microseconds
+
+ def __add__(self, other):
+ if isinstance(other, timedelta):
+ # for CPython compatibility, we cannot use
+ # our __class__ here, but need a real timedelta
+ return timedelta(self._days + other._days,
+ self._seconds + other._seconds,
+ self._microseconds + other._microseconds)
+ return NotImplemented
+
+ __radd__ = __add__
+
+ def __sub__(self, other):
+ if isinstance(other, timedelta):
+ # for CPython compatibility, we cannot use
+ # our __class__ here, but need a real timedelta
+ return timedelta(self._days - other._days,
+ self._seconds - other._seconds,
+ self._microseconds - other._microseconds)
+ return NotImplemented
+
+ def __rsub__(self, other):
+ if isinstance(other, timedelta):
+ return -self + other
+ return NotImplemented
+
+ def __neg__(self):
+ # for CPython compatibility, we cannot use
+ # our __class__ here, but need a real timedelta
+ return timedelta(-self._days,
+ -self._seconds,
+ -self._microseconds)
+
+ def __pos__(self):
+ return self
+
+ def __abs__(self):
+ if self._days < 0:
+ return -self
+ else:
+ return self
+
+ def __mul__(self, other):
+ if isinstance(other, int):
+ # for CPython compatibility, we cannot use
+ # our __class__ here, but need a real timedelta
+ return timedelta(self._days * other,
+ self._seconds * other,
+ self._microseconds * other)
+ if isinstance(other, float):
+ a, b = other.as_integer_ratio()
+ return self * a / b
+ return NotImplemented
+
+ __rmul__ = __mul__
+
+ def _to_microseconds(self):
+ return ((self._days * (24*3600) + self._seconds) * 1000000 +
+ self._microseconds)
+
+ def __floordiv__(self, other):
+ if not isinstance(other, (int, timedelta)):
+ return NotImplemented
+ usec = self._to_microseconds()
+ if isinstance(other, timedelta):
+ return usec // other._to_microseconds()
+ if isinstance(other, int):
+ return timedelta(0, 0, usec // other)
+
+ def __truediv__(self, other):
+ if not isinstance(other, (int, float, timedelta)):
+ return NotImplemented
+ usec = self._to_microseconds()
+ if isinstance(other, timedelta):
+ return usec / other._to_microseconds()
+ if isinstance(other, int):
+ return timedelta(0, 0, usec / other)
+ if isinstance(other, float):
+ a, b = other.as_integer_ratio()
+ return timedelta(0, 0, b * usec / a)
+
+ def __mod__(self, other):
+ if isinstance(other, timedelta):
+ r = self._to_microseconds() % other._to_microseconds()
+ return timedelta(0, 0, r)
+ return NotImplemented
+
+ def __divmod__(self, other):
+ if isinstance(other, timedelta):
+ q, r = divmod(self._to_microseconds(),
+ other._to_microseconds())
+ return q, timedelta(0, 0, r)
+ return NotImplemented
+
+ # Comparisons of timedelta objects with other.
+
+ def __eq__(self, other):
+ if isinstance(other, timedelta):
+ return self._cmp(other) == 0
+ else:
+ return False
+
+ def __ne__(self, other):
+ if isinstance(other, timedelta):
+ return self._cmp(other) != 0
+ else:
+ return True
+
+ def __le__(self, other):
+ if isinstance(other, timedelta):
+ return self._cmp(other) <= 0
+ else:
+ _cmperror(self, other)
+
+ def __lt__(self, other):
+ if isinstance(other, timedelta):
+ return self._cmp(other) < 0
+ else:
+ _cmperror(self, other)
+
+ def __ge__(self, other):
+ if isinstance(other, timedelta):
+ return self._cmp(other) >= 0
+ else:
+ _cmperror(self, other)
+
+ def __gt__(self, other):
+ if isinstance(other, timedelta):
+ return self._cmp(other) > 0
+ else:
+ _cmperror(self, other)
+
+ def _cmp(self, other):
+ assert isinstance(other, timedelta)
+ return _cmp(self._getstate(), other._getstate())
+
+ def __hash__(self):
+ return hash(self._getstate())
+
+ def __bool__(self):
+ return (self._days != 0 or
+ self._seconds != 0 or
+ self._microseconds != 0)
+
+ # Pickle support.
+
+ def _getstate(self):
+ return (self._days, self._seconds, self._microseconds)
+
+ def __reduce__(self):
+ return (self.__class__, self._getstate())
+
+timedelta.min = timedelta(-999999999)
+timedelta.max = timedelta(days=999999999, hours=23, minutes=59, seconds=59,
+ microseconds=999999)
+timedelta.resolution = timedelta(microseconds=1)
+
+class date:
+ """Concrete date type.
+
+ Constructors:
+
+ __new__()
+ fromtimestamp()
+ today()
+ fromordinal()
+
+ Operators:
+
+ __repr__, __str__
+ __cmp__, __hash__
+ __add__, __radd__, __sub__ (add/radd only with timedelta arg)
+
+ Methods:
+
+ timetuple()
+ toordinal()
+ weekday()
+ isoweekday(), isocalendar(), isoformat()
+ ctime()
+ strftime()
+
+ Properties (readonly):
+ year, month, day
+ """
+ __slots__ = '_year', '_month', '_day'
+
+ def __new__(cls, year, month=None, day=None):
+ """Constructor.
+
+ Arguments:
+
+ year, month, day (required, base 1)
+ """
+ if (isinstance(year, bytes) and len(year) == 4 and
+ 1 <= year[2] <= 12 and month is None): # Month is sane
+ # Pickle support
+ self = object.__new__(cls)
+ self.__setstate(year)
+ return self
+ _check_date_fields(year, month, day)
+ self = object.__new__(cls)
+ self._year = year
+ self._month = month
+ self._day = day
+ return self
+
+ # Additional constructors
+
+ @classmethod
+ def fromtimestamp(cls, t):
+ "Construct a date from a POSIX timestamp (like time.time())."
+ y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)
+ return cls(y, m, d)
+
+ @classmethod
+ def today(cls):
+ "Construct a date from time.time()."
+ t = _time.time()
+ return cls.fromtimestamp(t)
+
+ @classmethod
+ def fromordinal(cls, n):
+ """Contruct a date from a proleptic Gregorian ordinal.
+
+ January 1 of year 1 is day 1. Only the year, month and day are
+ non-zero in the result.
+ """
+ y, m, d = _ord2ymd(n)
+ return cls(y, m, d)
+
+ # Conversions to string
+
+ def __repr__(self):
+ """Convert to formal string, for repr().
+
+ >>> dt = datetime(2010, 1, 1)
+ >>> repr(dt)
+ 'datetime.datetime(2010, 1, 1, 0, 0)'
+
+ >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
+ >>> repr(dt)
+ 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
+ """
+ return "%s(%d, %d, %d)" % ('datetime.' + self.__class__.__name__,
+ self._year,
+ self._month,
+ self._day)
+ # XXX These shouldn't depend on time.localtime(), because that
+ # clips the usable dates to [1970 .. 2038). At least ctime() is
+ # easily done without using strftime() -- that's better too because
+ # strftime("%c", ...) is locale specific.
+
+
+ def ctime(self):
+ "Return ctime() style string."
+ weekday = self.toordinal() % 7 or 7
+ return "%s %s %2d 00:00:00 %04d" % (
+ _DAYNAMES[weekday],
+ _MONTHNAMES[self._month],
+ self._day, self._year)
+
+ def strftime(self, fmt):
+ "Format using strftime()."
+ return _wrap_strftime(self, fmt, self.timetuple())
+
+ def __format__(self, fmt):
+ if len(fmt) != 0:
+ return self.strftime(fmt)
+ return str(self)
+
+ def isoformat(self):
+ """Return the date formatted according to ISO.
+
+ This is 'YYYY-MM-DD'.
+
+ References:
+ - http://www.w3.org/TR/NOTE-datetime
+ - http://www.cl.cam.ac.uk/~mgk25/iso-time.html
+ """
+ return "%04d-%02d-%02d" % (self._year, self._month, self._day)
+
+ __str__ = isoformat
+
+ # Read-only field accessors
+ @property
+ def year(self):
+ """year (1-9999)"""
+ return self._year
+
+ @property
+ def month(self):
+ """month (1-12)"""
+ return self._month
+
+ @property
+ def day(self):
+ """day (1-31)"""
+ return self._day
+
+ # Standard conversions, __cmp__, __hash__ (and helpers)
+
+ def timetuple(self):
+ "Return local time tuple compatible with time.localtime()."
+ return _build_struct_time(self._year, self._month, self._day,
+ 0, 0, 0, -1)
+
+ def toordinal(self):
+ """Return proleptic Gregorian ordinal for the year, month and day.
+
+ January 1 of year 1 is day 1. Only the year, month and day values
+ contribute to the result.
+ """
+ return _ymd2ord(self._year, self._month, self._day)
+
+ def replace(self, year=None, month=None, day=None):
+ """Return a new date with new values for the specified fields."""
+ if year is None:
+ year = self._year
+ if month is None:
+ month = self._month
+ if day is None:
+ day = self._day
+ _check_date_fields(year, month, day)
+ return date(year, month, day)
+
+ # Comparisons of date objects with other.
+
+ def __eq__(self, other):
+ if isinstance(other, date):
+ return self._cmp(other) == 0
+ return NotImplemented
+
+ def __ne__(self, other):
+ if isinstance(other, date):
+ return self._cmp(other) != 0
+ return NotImplemented
+
+ def __le__(self, other):
+ if isinstance(other, date):
+ return self._cmp(other) <= 0
+ return NotImplemented
+
+ def __lt__(self, other):
+ if isinstance(other, date):
+ return self._cmp(other) < 0
+ return NotImplemented
+
+ def __ge__(self, other):
+ if isinstance(other, date):
+ return self._cmp(other) >= 0
+ return NotImplemented
+
+ def __gt__(self, other):
+ if isinstance(other, date):
+ return self._cmp(other) > 0
+ return NotImplemented
+
+ def _cmp(self, other):
+ assert isinstance(other, date)
+ y, m, d = self._year, self._month, self._day
+ y2, m2, d2 = other._year, other._month, other._day
+ return _cmp((y, m, d), (y2, m2, d2))
+
+ def __hash__(self):
+ "Hash."
+ return hash(self._getstate())
+
+ # Computations
+
+ def __add__(self, other):
+ "Add a date to a timedelta."
+ if isinstance(other, timedelta):
+ o = self.toordinal() + other.days
+ if 0 < o <= _MAXORDINAL:
+ return date.fromordinal(o)
+ raise OverflowError("result out of range")
+ return NotImplemented
+
+ __radd__ = __add__
+
+ def __sub__(self, other):
+ """Subtract two dates, or a date and a timedelta."""
+ if isinstance(other, timedelta):
+ return self + timedelta(-other.days)
+ if isinstance(other, date):
+ days1 = self.toordinal()
+ days2 = other.toordinal()
+ return timedelta(days1 - days2)
+ return NotImplemented
+
+ def weekday(self):
+ "Return day of the week, where Monday == 0 ... Sunday == 6."
+ return (self.toordinal() + 6) % 7
+
+ # Day-of-the-week and week-of-the-year, according to ISO
+
+ def isoweekday(self):
+ "Return day of the week, where Monday == 1 ... Sunday == 7."
+ # 1-Jan-0001 is a Monday
+ return self.toordinal() % 7 or 7
+
+ def isocalendar(self):
+ """Return a 3-tuple containing ISO year, week number, and weekday.
+
+ The first ISO week of the year is the (Mon-Sun) week
+ containing the year's first Thursday; everything else derives
+ from that.
+
+ The first week is 1; Monday is 1 ... Sunday is 7.
+
+ ISO calendar algorithm taken from
+ http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
+ """
+ year = self._year
+ week1monday = _isoweek1monday(year)
+ today = _ymd2ord(self._year, self._month, self._day)
+ # Internally, week and day have origin 0
+ week, day = divmod(today - week1monday, 7)
+ if week < 0:
+ year -= 1
+ week1monday = _isoweek1monday(year)
+ week, day = divmod(today - week1monday, 7)
+ elif week >= 52:
+ if today >= _isoweek1monday(year+1):
+ year += 1
+ week = 0
+ return year, week+1, day+1
+
+ # Pickle support.
+
+ def _getstate(self):
+ yhi, ylo = divmod(self._year, 256)
+ return bytes([yhi, ylo, self._month, self._day]),
+
+ def __setstate(self, string):
+ if len(string) != 4 or not (1 <= string[2] <= 12):
+ raise TypeError("not enough arguments")
+ yhi, ylo, self._month, self._day = string
+ self._year = yhi * 256 + ylo
+
+ def __reduce__(self):
+ return (self.__class__, self._getstate())
+
+_date_class = date # so functions w/ args named "date" can get at the class
+
+date.min = date(1, 1, 1)
+date.max = date(9999, 12, 31)
+date.resolution = timedelta(days=1)
+
+class tzinfo:
+ """Abstract base class for time zone info classes.
+
+ Subclasses must override the name(), utcoffset() and dst() methods.
+ """
+ __slots__ = ()
+ def tzname(self, dt):
+ "datetime -> string name of time zone."
+ raise NotImplementedError("tzinfo subclass must override tzname()")
+
+ def utcoffset(self, dt):
+ "datetime -> minutes east of UTC (negative for west of UTC)"
+ raise NotImplementedError("tzinfo subclass must override utcoffset()")
+
+ def dst(self, dt):
+ """datetime -> DST offset in minutes east of UTC.
+
+ Return 0 if DST not in effect. utcoffset() must include the DST
+ offset.
+ """
+ raise NotImplementedError("tzinfo subclass must override dst()")
+
+ def fromutc(self, dt):
+ "datetime in UTC -> datetime in local time."
+
+ if not isinstance(dt, datetime):
+ raise TypeError("fromutc() requires a datetime argument")
+ if dt.tzinfo is not self:
+ raise ValueError("dt.tzinfo is not self")
+
+ dtoff = dt.utcoffset()
+ if dtoff is None:
+ raise ValueError("fromutc() requires a non-None utcoffset() "
+ "result")
+
+ # See the long comment block at the end of this file for an
+ # explanation of this algorithm.
+ dtdst = dt.dst()
+ if dtdst is None:
+ raise ValueError("fromutc() requires a non-None dst() result")
+ delta = dtoff - dtdst
+ if delta:
+ dt += delta
+ dtdst = dt.dst()
+ if dtdst is None:
+ raise ValueError("fromutc(): dt.dst gave inconsistent "
+ "results; cannot convert")
+ return dt + dtdst
+
+ # Pickle support.
+
+ def __reduce__(self):
+ getinitargs = getattr(self, "__getinitargs__", None)
+ if getinitargs:
+ args = getinitargs()
+ else:
+ args = ()
+ getstate = getattr(self, "__getstate__", None)
+ if getstate:
+ state = getstate()
+ else:
+ state = getattr(self, "__dict__", None) or None
+ if state is None:
+ return (self.__class__, args)
+ else:
+ return (self.__class__, args, state)
+
+_tzinfo_class = tzinfo
+
+class time:
+ """Time with time zone.
+
+ Constructors:
+
+ __new__()
+
+ Operators:
+
+ __repr__, __str__
+ __cmp__, __hash__
+
+ Methods:
+
+ strftime()
+ isoformat()
+ utcoffset()
+ tzname()
+ dst()
+
+ Properties (readonly):
+ hour, minute, second, microsecond, tzinfo
+ """
+
+ def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None):
+ """Constructor.
+
+ Arguments:
+
+ hour, minute (required)
+ second, microsecond (default to zero)
+ tzinfo (default to None)
+ """
+ self = object.__new__(cls)
+ if isinstance(hour, bytes) and len(hour) == 6:
+ # Pickle support
+ self.__setstate(hour, minute or None)
+ return self
+ _check_tzinfo_arg(tzinfo)
+ _check_time_fields(hour, minute, second, microsecond)
+ self._hour = hour
+ self._minute = minute
+ self._second = second
+ self._microsecond = microsecond
+ self._tzinfo = tzinfo
+ return self
+
+ # Read-only field accessors
+ @property
+ def hour(self):
+ """hour (0-23)"""
+ return self._hour
+
+ @property
+ def minute(self):
+ """minute (0-59)"""
+ return self._minute
+
+ @property
+ def second(self):
+ """second (0-59)"""
+ return self._second
+
+ @property
+ def microsecond(self):
+ """microsecond (0-999999)"""
+ return self._microsecond
+
+ @property
+ def tzinfo(self):
+ """timezone info object"""
+ return self._tzinfo
+
+ # Standard conversions, __hash__ (and helpers)
+
+ # Comparisons of time objects with other.
+
+ def __eq__(self, other):
+ if isinstance(other, time):
+ return self._cmp(other) == 0
+ else:
+ return False
+
+ def __ne__(self, other):
+ if isinstance(other, time):
+ return self._cmp(other) != 0
+ else:
+ return True
+
+ def __le__(self, other):
+ if isinstance(other, time):
+ return self._cmp(other) <= 0
+ else:
+ _cmperror(self, other)
+
+ def __lt__(self, other):
+ if isinstance(other, time):
+ return self._cmp(other) < 0
+ else:
+ _cmperror(self, other)
+
+ def __ge__(self, other):
+ if isinstance(other, time):
+ return self._cmp(other) >= 0
+ else:
+ _cmperror(self, other)
+
+ def __gt__(self, other):
+ if isinstance(other, time):
+ return self._cmp(other) > 0
+ else:
+ _cmperror(self, other)
+
+ def _cmp(self, other):
+ assert isinstance(other, time)
+ mytz = self._tzinfo
+ ottz = other._tzinfo
+ myoff = otoff = None
+
+ if mytz is ottz:
+ base_compare = True
+ else:
+ myoff = self.utcoffset()
+ otoff = other.utcoffset()
+ base_compare = myoff == otoff
+
+ if base_compare:
+ return _cmp((self._hour, self._minute, self._second,
+ self._microsecond),
+ (other._hour, other._minute, other._second,
+ other._microsecond))
+ if myoff is None or otoff is None:
+ raise TypeError("cannot compare naive and aware times")
+ myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)
+ othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)
+ return _cmp((myhhmm, self._second, self._microsecond),
+ (othhmm, other._second, other._microsecond))
+
+ def __hash__(self):
+ """Hash."""
+ tzoff = self.utcoffset()
+ if not tzoff: # zero or None
+ return hash(self._getstate()[0])
+ h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,
+ timedelta(hours=1))
+ assert not m % timedelta(minutes=1), "whole minute"
+ m //= timedelta(minutes=1)
+ if 0 <= h < 24:
+ return hash(time(h, m, self.second, self.microsecond))
+ return hash((h, m, self.second, self.microsecond))
+
+ # Conversion to string
+
+ def _tzstr(self, sep=":"):
+ """Return formatted timezone offset (+xx:xx) or None."""
+ off = self.utcoffset()
+ if off is not None:
+ if off.days < 0:
+ sign = "-"
+ off = -off
+ else:
+ sign = "+"
+ hh, mm = divmod(off, timedelta(hours=1))
+ assert not mm % timedelta(minutes=1), "whole minute"
+ mm //= timedelta(minutes=1)
+ assert 0 <= hh < 24
+ off = "%s%02d%s%02d" % (sign, hh, sep, mm)
+ return off
+
+ def __repr__(self):
+ """Convert to formal string, for repr()."""
+ if self._microsecond != 0:
+ s = ", %d, %d" % (self._second, self._microsecond)
+ elif self._second != 0:
+ s = ", %d" % self._second
+ else:
+ s = ""
+ s= "%s(%d, %d%s)" % ('datetime.' + self.__class__.__name__,
+ self._hour, self._minute, s)
+ if self._tzinfo is not None:
+ assert s[-1:] == ")"
+ s = s[:-1] + ", tzinfo=%r" % self._tzinfo + ")"
+ return s
+
+ def isoformat(self):
+ """Return the time formatted according to ISO.
+
+ This is 'HH:MM:SS.mmmmmm+zz:zz', or 'HH:MM:SS+zz:zz' if
+ self.microsecond == 0.
+ """
+ s = _format_time(self._hour, self._minute, self._second,
+ self._microsecond)
+ tz = self._tzstr()
+ if tz:
+ s += tz
+ return s
+
+ __str__ = isoformat
+
+ def strftime(self, fmt):
+ """Format using strftime(). The date part of the timestamp passed
+ to underlying strftime should not be used.
+ """
+ # The year must be >= 1000 else Python's strftime implementation
+ # can raise a bogus exception.
+ timetuple = (1900, 1, 1,
+ self._hour, self._minute, self._second,
+ 0, 1, -1)
+ return _wrap_strftime(self, fmt, timetuple)
+
+ def __format__(self, fmt):
+ if len(fmt) != 0:
+ return self.strftime(fmt)
+ return str(self)
+
+ # Timezone functions
+
+ def utcoffset(self):
+ """Return the timezone offset in minutes east of UTC (negative west of
+ UTC)."""
+ if self._tzinfo is None:
+ return None
+ offset = self._tzinfo.utcoffset(None)
+ _check_utc_offset("utcoffset", offset)
+ return offset
+
+ def tzname(self):
+ """Return the timezone name.
+
+ Note that the name is 100% informational -- there's no requirement that
+ it mean anything in particular. For example, "GMT", "UTC", "-500",
+ "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
+ """
+ if self._tzinfo is None:
+ return None
+ name = self._tzinfo.tzname(None)
+ _check_tzname(name)
+ return name
+
+ def dst(self):
+ """Return 0 if DST is not in effect, or the DST offset (in minutes
+ eastward) if DST is in effect.
+
+ This is purely informational; the DST offset has already been added to
+ the UTC offset returned by utcoffset() if applicable, so there's no
+ need to consult dst() unless you're interested in displaying the DST
+ info.
+ """
+ if self._tzinfo is None:
+ return None
+ offset = self._tzinfo.dst(None)
+ _check_utc_offset("dst", offset)
+ return offset
+
+ def replace(self, hour=None, minute=None, second=None, microsecond=None,
+ tzinfo=True):
+ """Return a new time with new values for the specified fields."""
+ if hour is None:
+ hour = self.hour
+ if minute is None:
+ minute = self.minute
+ if second is None:
+ second = self.second
+ if microsecond is None:
+ microsecond = self.microsecond
+ if tzinfo is True:
+ tzinfo = self.tzinfo
+ _check_time_fields(hour, minute, second, microsecond)
+ _check_tzinfo_arg(tzinfo)
+ return time(hour, minute, second, microsecond, tzinfo)
+
+ def __bool__(self):
+ if self.second or self.microsecond:
+ return True
+ offset = self.utcoffset() or timedelta(0)
+ return timedelta(hours=self.hour, minutes=self.minute) != offset
+
+ # Pickle support.
+
+ def _getstate(self):
+ us2, us3 = divmod(self._microsecond, 256)
+ us1, us2 = divmod(us2, 256)
+ basestate = bytes([self._hour, self._minute, self._second,
+ us1, us2, us3])
+ if self._tzinfo is None:
+ return (basestate,)
+ else:
+ return (basestate, self._tzinfo)
+
+ def __setstate(self, string, tzinfo):
+ if len(string) != 6 or string[0] >= 24:
+ raise TypeError("an integer is required")
+ (self._hour, self._minute, self._second,
+ us1, us2, us3) = string
+ self._microsecond = (((us1 << 8) | us2) << 8) | us3
+ if tzinfo is None or isinstance(tzinfo, _tzinfo_class):
+ self._tzinfo = tzinfo
+ else:
+ raise TypeError("bad tzinfo state arg %r" % tzinfo)
+
+ def __reduce__(self):
+ return (time, self._getstate())
+
+_time_class = time # so functions w/ args named "time" can get at the class
+
+time.min = time(0, 0, 0)
+time.max = time(23, 59, 59, 999999)
+time.resolution = timedelta(microseconds=1)
+
+class datetime(date):
+ """datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])
+
+ The year, month and day arguments are required. tzinfo may be None, or an
+ instance of a tzinfo subclass. The remaining arguments may be ints or longs.
+ """
+
+ __slots__ = date.__slots__ + (
+ '_hour', '_minute', '_second',
+ '_microsecond', '_tzinfo')
+ def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,
+ microsecond=0, tzinfo=None):
+ if isinstance(year, bytes) and len(year) == 10:
+ # Pickle support
+ self = date.__new__(cls, year[:4])
+ self.__setstate(year, month)
+ return self
+ _check_tzinfo_arg(tzinfo)
+ _check_time_fields(hour, minute, second, microsecond)
+ self = date.__new__(cls, year, month, day)
+ self._hour = hour
+ self._minute = minute
+ self._second = second
+ self._microsecond = microsecond
+ self._tzinfo = tzinfo
+ return self
+
+ # Read-only field accessors
+ @property
+ def hour(self):
+ """hour (0-23)"""
+ return self._hour
+
+ @property
+ def minute(self):
+ """minute (0-59)"""
+ return self._minute
+
+ @property
+ def second(self):
+ """second (0-59)"""
+ return self._second
+
+ @property
+ def microsecond(self):
+ """microsecond (0-999999)"""
+ return self._microsecond
+
+ @property
+ def tzinfo(self):
+ """timezone info object"""
+ return self._tzinfo
+
+ @classmethod
+ def fromtimestamp(cls, t, tz=None):
+ """Construct a datetime from a POSIX timestamp (like time.time()).
+
+ A timezone info object may be passed in as well.
+ """
+
+ _check_tzinfo_arg(tz)
+
+ converter = _time.localtime if tz is None else _time.gmtime
+
+ t, frac = divmod(t, 1.0)
+ us = round(frac * 1e6)
+
+ # If timestamp is less than one microsecond smaller than a
+ # full second, us can be rounded up to 1000000. In this case,
+ # roll over to seconds, otherwise, ValueError is raised
+ # by the constructor.
+ if us == 1000000:
+ t += 1
+ us = 0
+ y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)
+ ss = min(ss, 59) # clamp out leap seconds if the platform has them
+ result = cls(y, m, d, hh, mm, ss, us, tz)
+ if tz is not None:
+ result = tz.fromutc(result)
+ return result
+
+ @classmethod
+ def utcfromtimestamp(cls, t):
+ "Construct a UTC datetime from a POSIX timestamp (like time.time())."
+ t, frac = divmod(t, 1.0)
+ us = round(frac * 1e6)
+
+ # If timestamp is less than one microsecond smaller than a
+ # full second, us can be rounded up to 1000000. In this case,
+ # roll over to seconds, otherwise, ValueError is raised
+ # by the constructor.
+ if us == 1000000:
+ t += 1
+ us = 0
+ y, m, d, hh, mm, ss, weekday, jday, dst = _time.gmtime(t)
+ ss = min(ss, 59) # clamp out leap seconds if the platform has them
+ return cls(y, m, d, hh, mm, ss, us)
+
+ # XXX This is supposed to do better than we *can* do by using time.time(),
+ # XXX if the platform supports a more accurate way. The C implementation
+ # XXX uses gettimeofday on platforms that have it, but that isn't
+ # XXX available from Python. So now() may return different results
+ # XXX across the implementations.
+ @classmethod
+ def now(cls, tz=None):
+ "Construct a datetime from time.time() and optional time zone info."
+ t = _time.time()
+ return cls.fromtimestamp(t, tz)
+
+ @classmethod
+ def utcnow(cls):
+ "Construct a UTC datetime from time.time()."
+ t = _time.time()
+ return cls.utcfromtimestamp(t)
+
+ @classmethod
+ def combine(cls, date, time):
+ "Construct a datetime from a given date and a given time."
+ if not isinstance(date, _date_class):
+ raise TypeError("date argument must be a date instance")
+ if not isinstance(time, _time_class):
+ raise TypeError("time argument must be a time instance")
+ return cls(date.year, date.month, date.day,
+ time.hour, time.minute, time.second, time.microsecond,
+ time.tzinfo)
+
+ def timetuple(self):
+ "Return local time tuple compatible with time.localtime()."
+ dst = self.dst()
+ if dst is None:
+ dst = -1
+ elif dst:
+ dst = 1
+ else:
+ dst = 0
+ return _build_struct_time(self.year, self.month, self.day,
+ self.hour, self.minute, self.second,
+ dst)
+
+ def utctimetuple(self):
+ "Return UTC time tuple compatible with time.gmtime()."
+ offset = self.utcoffset()
+ if offset:
+ self -= offset
+ y, m, d = self.year, self.month, self.day
+ hh, mm, ss = self.hour, self.minute, self.second
+ return _build_struct_time(y, m, d, hh, mm, ss, 0)
+
+ def date(self):
+ "Return the date part."
+ return date(self._year, self._month, self._day)
+
+ def time(self):
+ "Return the time part, with tzinfo None."
+ return time(self.hour, self.minute, self.second, self.microsecond)
+
+ def timetz(self):
+ "Return the time part, with same tzinfo."
+ return time(self.hour, self.minute, self.second, self.microsecond,
+ self._tzinfo)
+
+ def replace(self, year=None, month=None, day=None, hour=None,
+ minute=None, second=None, microsecond=None, tzinfo=True):
+ """Return a new datetime with new values for the specified fields."""
+ if year is None:
+ year = self.year
+ if month is None:
+ month = self.month
+ if day is None:
+ day = self.day
+ if hour is None:
+ hour = self.hour
+ if minute is None:
+ minute = self.minute
+ if second is None:
+ second = self.second
+ if microsecond is None:
+ microsecond = self.microsecond
+ if tzinfo is True:
+ tzinfo = self.tzinfo
+ _check_date_fields(year, month, day)
+ _check_time_fields(hour, minute, second, microsecond)
+ _check_tzinfo_arg(tzinfo)
+ return datetime(year, month, day, hour, minute, second,
+ microsecond, tzinfo)
+
+ def astimezone(self, tz):
+ if not isinstance(tz, tzinfo):
+ raise TypeError("tz argument must be an instance of tzinfo")
+
+ mytz = self.tzinfo
+ if mytz is None:
+ raise ValueError("astimezone() requires an aware datetime")
+
+ if tz is mytz:
+ return self
+
+ # Convert self to UTC, and attach the new time zone object.
+ myoffset = self.utcoffset()
+ if myoffset is None:
+ raise ValueError("astimezone() requires an aware datetime")
+ utc = (self - myoffset).replace(tzinfo=tz)
+
+ # Convert from UTC to tz's local time.
+ return tz.fromutc(utc)
+
+ # Ways to produce a string.
+
+ def ctime(self):
+ "Return ctime() style string."
+ weekday = self.toordinal() % 7 or 7
+ return "%s %s %2d %02d:%02d:%02d %04d" % (
+ _DAYNAMES[weekday],
+ _MONTHNAMES[self._month],
+ self._day,
+ self._hour, self._minute, self._second,
+ self._year)
+
+ def isoformat(self, sep='T'):
+ """Return the time formatted according to ISO.
+
+ This is 'YYYY-MM-DD HH:MM:SS.mmmmmm', or 'YYYY-MM-DD HH:MM:SS' if
+ self.microsecond == 0.
+
+ If self.tzinfo is not None, the UTC offset is also attached, giving
+ 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM' or 'YYYY-MM-DD HH:MM:SS+HH:MM'.
+
+ Optional argument sep specifies the separator between date and
+ time, default 'T'.
+ """
+ s = ("%04d-%02d-%02d%c" % (self._year, self._month, self._day,
+ sep) +
+ _format_time(self._hour, self._minute, self._second,
+ self._microsecond))
+ off = self.utcoffset()
+ if off is not None:
+ if off.days < 0:
+ sign = "-"
+ off = -off
+ else:
+ sign = "+"
+ hh, mm = divmod(off, timedelta(hours=1))
+ assert not mm % timedelta(minutes=1), "whole minute"
+ mm //= timedelta(minutes=1)
+ s += "%s%02d:%02d" % (sign, hh, mm)
+ return s
+
+ def __repr__(self):
+ """Convert to formal string, for repr()."""
+ L = [self._year, self._month, self._day, # These are never zero
+ self._hour, self._minute, self._second, self._microsecond]
+ if L[-1] == 0:
+ del L[-1]
+ if L[-1] == 0:
+ del L[-1]
+ s = ", ".join(map(str, L))
+ s = "%s(%s)" % ('datetime.' + self.__class__.__name__, s)
+ if self._tzinfo is not None:
+ assert s[-1:] == ")"
+ s = s[:-1] + ", tzinfo=%r" % self._tzinfo + ")"
+ return s
+
+ def __str__(self):
+ "Convert to string, for str()."
+ return self.isoformat(sep=' ')
+
+ @classmethod
+ def strptime(cls, date_string, format):
+ 'string, format -> new datetime parsed from a string (like time.strptime()).'
+ import _strptime
+ return _strptime._strptime_datetime(cls, date_string, format)
+
+ def utcoffset(self):
+ """Return the timezone offset in minutes east of UTC (negative west of
+ UTC)."""
+ if self._tzinfo is None:
+ return None
+ offset = self._tzinfo.utcoffset(self)
+ _check_utc_offset("utcoffset", offset)
+ return offset
+
+ def tzname(self):
+ """Return the timezone name.
+
+ Note that the name is 100% informational -- there's no requirement that
+ it mean anything in particular. For example, "GMT", "UTC", "-500",
+ "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
+ """
+ name = _call_tzinfo_method(self._tzinfo, "tzname", self)
+ _check_tzname(name)
+ return name
+
+ def dst(self):
+ """Return 0 if DST is not in effect, or the DST offset (in minutes
+ eastward) if DST is in effect.
+
+ This is purely informational; the DST offset has already been added to
+ the UTC offset returned by utcoffset() if applicable, so there's no
+ need to consult dst() unless you're interested in displaying the DST
+ info.
+ """
+ if self._tzinfo is None:
+ return None
+ offset = self._tzinfo.dst(self)
+ _check_utc_offset("dst", offset)
+ return offset
+
+ # Comparisons of datetime objects with other.
+
+ def __eq__(self, other):
+ if isinstance(other, datetime):
+ return self._cmp(other) == 0
+ elif not isinstance(other, date):
+ return NotImplemented
+ else:
+ return False
+
+ def __ne__(self, other):
+ if isinstance(other, datetime):
+ return self._cmp(other) != 0
+ elif not isinstance(other, date):
+ return NotImplemented
+ else:
+ return True
+
+ def __le__(self, other):
+ if isinstance(other, datetime):
+ return self._cmp(other) <= 0
+ elif not isinstance(other, date):
+ return NotImplemented
+ else:
+ _cmperror(self, other)
+
+ def __lt__(self, other):
+ if isinstance(other, datetime):
+ return self._cmp(other) < 0
+ elif not isinstance(other, date):
+ return NotImplemented
+ else:
+ _cmperror(self, other)
+
+ def __ge__(self, other):
+ if isinstance(other, datetime):
+ return self._cmp(other) >= 0
+ elif not isinstance(other, date):
+ return NotImplemented
+ else:
+ _cmperror(self, other)
+
+ def __gt__(self, other):
+ if isinstance(other, datetime):
+ return self._cmp(other) > 0
+ elif not isinstance(other, date):
+ return NotImplemented
+ else:
+ _cmperror(self, other)
+
+ def _cmp(self, other):
+ assert isinstance(other, datetime)
+ mytz = self._tzinfo
+ ottz = other._tzinfo
+ myoff = otoff = None
+
+ if mytz is ottz:
+ base_compare = True
+ else:
+ if mytz is not None:
+ myoff = self.utcoffset()
+ if ottz is not None:
+ otoff = other.utcoffset()
+ base_compare = myoff == otoff
+
+ if base_compare:
+ return _cmp((self._year, self._month, self._day,
+ self._hour, self._minute, self._second,
+ self._microsecond),
+ (other._year, other._month, other._day,
+ other._hour, other._minute, other._second,
+ other._microsecond))
+ if myoff is None or otoff is None:
+ raise TypeError("cannot compare naive and aware datetimes")
+ # XXX What follows could be done more efficiently...
+ diff = self - other # this will take offsets into account
+ if diff.days < 0:
+ return -1
+ return diff and 1 or 0
+
+ def __add__(self, other):
+ "Add a datetime and a timedelta."
+ if not isinstance(other, timedelta):
+ return NotImplemented
+ delta = timedelta(self.toordinal(),
+ hours=self._hour,
+ minutes=self._minute,
+ seconds=self._second,
+ microseconds=self._microsecond)
+ delta += other
+ hour, rem = divmod(delta.seconds, 3600)
+ minute, second = divmod(rem, 60)
+ if 0 < delta.days <= _MAXORDINAL:
+ return datetime.combine(date.fromordinal(delta.days),
+ time(hour, minute, second,
+ delta.microseconds,
+ tzinfo=self._tzinfo))
+ raise OverflowError("result out of range")
+
+ __radd__ = __add__
+
+ def __sub__(self, other):
+ "Subtract two datetimes, or a datetime and a timedelta."
+ if not isinstance(other, datetime):
+ if isinstance(other, timedelta):
+ return self + -other
+ return NotImplemented
+
+ days1 = self.toordinal()
+ days2 = other.toordinal()
+ secs1 = self._second + self._minute * 60 + self._hour * 3600
+ secs2 = other._second + other._minute * 60 + other._hour * 3600
+ base = timedelta(days1 - days2,
+ secs1 - secs2,
+ self._microsecond - other._microsecond)
+ if self._tzinfo is other._tzinfo:
+ return base
+ myoff = self.utcoffset()
+ otoff = other.utcoffset()
+ if myoff == otoff:
+ return base
+ if myoff is None or otoff is None:
+ raise TypeError("cannot mix naive and timezone-aware time")
+ return base + otoff - myoff
+
+ def __hash__(self):
+ tzoff = self.utcoffset()
+ if tzoff is None:
+ return hash(self._getstate()[0])
+ days = _ymd2ord(self.year, self.month, self.day)
+ seconds = self.hour * 3600 + self.minute * 60 + self.second
+ return hash(timedelta(days, seconds, self.microsecond) - tzoff)
+
+ # Pickle support.
+
+ def _getstate(self):
+ yhi, ylo = divmod(self._year, 256)
+ us2, us3 = divmod(self._microsecond, 256)
+ us1, us2 = divmod(us2, 256)
+ basestate = bytes([yhi, ylo, self._month, self._day,
+ self._hour, self._minute, self._second,
+ us1, us2, us3])
+ if self._tzinfo is None:
+ return (basestate,)
+ else:
+ return (basestate, self._tzinfo)
+
+ def __setstate(self, string, tzinfo):
+ (yhi, ylo, self._month, self._day, self._hour,
+ self._minute, self._second, us1, us2, us3) = string
+ self._year = yhi * 256 + ylo
+ self._microsecond = (((us1 << 8) | us2) << 8) | us3
+ if tzinfo is None or isinstance(tzinfo, _tzinfo_class):
+ self._tzinfo = tzinfo
+ else:
+ raise TypeError("bad tzinfo state arg %r" % tzinfo)
+
+ def __reduce__(self):
+ return (self.__class__, self._getstate())
+
+
+datetime.min = datetime(1, 1, 1)
+datetime.max = datetime(9999, 12, 31, 23, 59, 59, 999999)
+datetime.resolution = timedelta(microseconds=1)
+
+
+def _isoweek1monday(year):
+ # Helper to calculate the day number of the Monday starting week 1
+ # XXX This could be done more efficiently
+ THURSDAY = 3
+ firstday = _ymd2ord(year, 1, 1)
+ firstweekday = (firstday + 6) % 7 # See weekday() above
+ week1monday = firstday - firstweekday
+ if firstweekday > THURSDAY:
+ week1monday += 7
+ return week1monday
+
+class timezone(tzinfo):
+ __slots__ = '_offset', '_name'
+
+ # Sentinel value to disallow None
+ _Omitted = object()
+ def __new__(cls, offset, name=_Omitted):
+ if not isinstance(offset, timedelta):
+ raise TypeError("offset must be a timedelta")
+ if name is cls._Omitted:
+ if not offset:
+ return cls.utc
+ name = None
+ elif not isinstance(name, str):
+ raise TypeError("name must be a string")
+ if not cls._minoffset <= offset <= cls._maxoffset:
+ raise ValueError("offset must be a timedelta"
+ " strictly between -timedelta(hours=24) and"
+ " timedelta(hours=24).")
+ if (offset.microseconds != 0 or
+ offset.seconds % 60 != 0):
+ raise ValueError("offset must be a timedelta"
+ " representing a whole number of minutes")
+ return cls._create(offset, name)
+
+ @classmethod
+ def _create(cls, offset, name=None):
+ self = tzinfo.__new__(cls)
+ self._offset = offset
+ self._name = name
+ return self
+
+ def __getinitargs__(self):
+ """pickle support"""
+ if self._name is None:
+ return (self._offset,)
+ return (self._offset, self._name)
+
+ def __eq__(self, other):
+ return self._offset == other._offset
+
+ def __hash__(self):
+ return hash(self._offset)
+
+ def __repr__(self):
+ """Convert to formal string, for repr().
+
+ >>> tz = timezone.utc
+ >>> repr(tz)
+ 'datetime.timezone.utc'
+ >>> tz = timezone(timedelta(hours=-5), 'EST')
+ >>> repr(tz)
+ "datetime.timezone(datetime.timedelta(-1, 68400), 'EST')"
+ """
+ if self is self.utc:
+ return 'datetime.timezone.utc'
+ if self._name is None:
+ return "%s(%r)" % ('datetime.' + self.__class__.__name__,
+ self._offset)
+ return "%s(%r, %r)" % ('datetime.' + self.__class__.__name__,
+ self._offset, self._name)
+
+ def __str__(self):
+ return self.tzname(None)
+
+ def utcoffset(self, dt):
+ if isinstance(dt, datetime) or dt is None:
+ return self._offset
+ raise TypeError("utcoffset() argument must be a datetime instance"
+ " or None")
+
+ def tzname(self, dt):
+ if isinstance(dt, datetime) or dt is None:
+ if self._name is None:
+ return self._name_from_offset(self._offset)
+ return self._name
+ raise TypeError("tzname() argument must be a datetime instance"
+ " or None")
+
+ def dst(self, dt):
+ if isinstance(dt, datetime) or dt is None:
+ return None
+ raise TypeError("dst() argument must be a datetime instance"
+ " or None")
+
+ def fromutc(self, dt):
+ if isinstance(dt, datetime):
+ if dt.tzinfo is not self:
+ raise ValueError("fromutc: dt.tzinfo "
+ "is not self")
+ return dt + self._offset
+ raise TypeError("fromutc() argument must be a datetime instance"
+ " or None")
+
+ _maxoffset = timedelta(hours=23, minutes=59)
+ _minoffset = -_maxoffset
+
+ @staticmethod
+ def _name_from_offset(delta):
+ if delta < timedelta(0):
+ sign = '-'
+ delta = -delta
+ else:
+ sign = '+'
+ hours, rest = divmod(delta, timedelta(hours=1))
+ minutes = rest // timedelta(minutes=1)
+ return 'UTC{}{:02d}:{:02d}'.format(sign, hours, minutes)
+
+timezone.utc = timezone._create(timedelta(0))
+timezone.min = timezone._create(timezone._minoffset)
+timezone.max = timezone._create(timezone._maxoffset)
+
+"""
+Some time zone algebra. For a datetime x, let
+ x.n = x stripped of its timezone -- its naive time.
+ x.o = x.utcoffset(), and assuming that doesn't raise an exception or
+ return None
+ x.d = x.dst(), and assuming that doesn't raise an exception or
+ return None
+ x.s = x's standard offset, x.o - x.d
+
+Now some derived rules, where k is a duration (timedelta).
+
+1. x.o = x.s + x.d
+ This follows from the definition of x.s.
+
+2. If x and y have the same tzinfo member, x.s = y.s.
+ This is actually a requirement, an assumption we need to make about
+ sane tzinfo classes.
+
+3. The naive UTC time corresponding to x is x.n - x.o.
+ This is again a requirement for a sane tzinfo class.
+
+4. (x+k).s = x.s
+ This follows from #2, and that datimetimetz+timedelta preserves tzinfo.
+
+5. (x+k).n = x.n + k
+ Again follows from how arithmetic is defined.
+
+Now we can explain tz.fromutc(x). Let's assume it's an interesting case
+(meaning that the various tzinfo methods exist, and don't blow up or return
+None when called).
+
+The function wants to return a datetime y with timezone tz, equivalent to x.
+x is already in UTC.
+
+By #3, we want
+
+ y.n - y.o = x.n [1]
+
+The algorithm starts by attaching tz to x.n, and calling that y. So
+x.n = y.n at the start. Then it wants to add a duration k to y, so that [1]
+becomes true; in effect, we want to solve [2] for k:
+
+ (y+k).n - (y+k).o = x.n [2]
+
+By #1, this is the same as
+
+ (y+k).n - ((y+k).s + (y+k).d) = x.n [3]
+
+By #5, (y+k).n = y.n + k, which equals x.n + k because x.n=y.n at the start.
+Substituting that into [3],
+
+ x.n + k - (y+k).s - (y+k).d = x.n; the x.n terms cancel, leaving
+ k - (y+k).s - (y+k).d = 0; rearranging,
+ k = (y+k).s - (y+k).d; by #4, (y+k).s == y.s, so
+ k = y.s - (y+k).d
+
+On the RHS, (y+k).d can't be computed directly, but y.s can be, and we
+approximate k by ignoring the (y+k).d term at first. Note that k can't be
+very large, since all offset-returning methods return a duration of magnitude
+less than 24 hours. For that reason, if y is firmly in std time, (y+k).d must
+be 0, so ignoring it has no consequence then.
+
+In any case, the new value is
+
+ z = y + y.s [4]
+
+It's helpful to step back at look at [4] from a higher level: it's simply
+mapping from UTC to tz's standard time.
+
+At this point, if
+
+ z.n - z.o = x.n [5]
+
+we have an equivalent time, and are almost done. The insecurity here is
+at the start of daylight time. Picture US Eastern for concreteness. The wall
+time jumps from 1:59 to 3:00, and wall hours of the form 2:MM don't make good
+sense then. The docs ask that an Eastern tzinfo class consider such a time to
+be EDT (because it's "after 2"), which is a redundant spelling of 1:MM EST
+on the day DST starts. We want to return the 1:MM EST spelling because that's
+the only spelling that makes sense on the local wall clock.
+
+In fact, if [5] holds at this point, we do have the standard-time spelling,
+but that takes a bit of proof. We first prove a stronger result. What's the
+difference between the LHS and RHS of [5]? Let
+
+ diff = x.n - (z.n - z.o) [6]
+
+Now
+ z.n = by [4]
+ (y + y.s).n = by #5
+ y.n + y.s = since y.n = x.n
+ x.n + y.s = since z and y are have the same tzinfo member,
+ y.s = z.s by #2
+ x.n + z.s
+
+Plugging that back into [6] gives
+
+ diff =
+ x.n - ((x.n + z.s) - z.o) = expanding
+ x.n - x.n - z.s + z.o = cancelling
+ - z.s + z.o = by #2
+ z.d
+
+So diff = z.d.
+
+If [5] is true now, diff = 0, so z.d = 0 too, and we have the standard-time
+spelling we wanted in the endcase described above. We're done. Contrarily,
+if z.d = 0, then we have a UTC equivalent, and are also done.
+
+If [5] is not true now, diff = z.d != 0, and z.d is the offset we need to
+add to z (in effect, z is in tz's standard time, and we need to shift the
+local clock into tz's daylight time).
+
+Let
+
+ z' = z + z.d = z + diff [7]
+
+and we can again ask whether
+
+ z'.n - z'.o = x.n [8]
+
+If so, we're done. If not, the tzinfo class is insane, according to the
+assumptions we've made. This also requires a bit of proof. As before, let's
+compute the difference between the LHS and RHS of [8] (and skipping some of
+the justifications for the kinds of substitutions we've done several times
+already):
+
+ diff' = x.n - (z'.n - z'.o) = replacing z'.n via [7]
+ x.n - (z.n + diff - z'.o) = replacing diff via [6]
+ x.n - (z.n + x.n - (z.n - z.o) - z'.o) =
+ x.n - z.n - x.n + z.n - z.o + z'.o = cancel x.n
+ - z.n + z.n - z.o + z'.o = cancel z.n
+ - z.o + z'.o = #1 twice
+ -z.s - z.d + z'.s + z'.d = z and z' have same tzinfo
+ z'.d - z.d
+
+So z' is UTC-equivalent to x iff z'.d = z.d at this point. If they are equal,
+we've found the UTC-equivalent so are done. In fact, we stop with [7] and
+return z', not bothering to compute z'.d.
+
+How could z.d and z'd differ? z' = z + z.d [7], so merely moving z' by
+a dst() offset, and starting *from* a time already in DST (we know z.d != 0),
+would have to change the result dst() returns: we start in DST, and moving
+a little further into it takes us out of DST.
+
+There isn't a sane case where this can happen. The closest it gets is at
+the end of DST, where there's an hour in UTC with no spelling in a hybrid
+tzinfo class. In US Eastern, that's 5:MM UTC = 0:MM EST = 1:MM EDT. During
+that hour, on an Eastern clock 1:MM is taken as being in standard time (6:MM
+UTC) because the docs insist on that, but 0:MM is taken as being in daylight
+time (4:MM UTC). There is no local time mapping to 5:MM UTC. The local
+clock jumps from 1:59 back to 1:00 again, and repeats the 1:MM hour in
+standard time. Since that's what the local clock *does*, we want to map both
+UTC hours 5:MM and 6:MM to 1:MM Eastern. The result is ambiguous
+in local time, but so it goes -- it's the way the local clock works.
+
+When x = 5:MM UTC is the input to this algorithm, x.o=0, y.o=-5 and y.d=0,
+so z=0:MM. z.d=60 (minutes) then, so [5] doesn't hold and we keep going.
+z' = z + z.d = 1:MM then, and z'.d=0, and z'.d - z.d = -60 != 0 so [8]
+(correctly) concludes that z' is not UTC-equivalent to x.
+
+Because we know z.d said z was in daylight time (else [5] would have held and
+we would have stopped then), and we know z.d != z'.d (else [8] would have held
+and we we have stopped then), and there are only 2 possible values dst() can
+return in Eastern, it follows that z'.d must be 0 (which it is in the example,
+but the reasoning doesn't depend on the example -- it depends on there being
+two possible dst() outcomes, one zero and the other non-zero). Therefore
+z' must be in standard time, and is the spelling we want in this case.
+
+Note again that z' is not UTC-equivalent as far as the hybrid tzinfo class is
+concerned (because it takes z' as being in standard time rather than the
+daylight time we intend here), but returning it gives the real-life "local
+clock repeats an hour" behavior when mapping the "unspellable" UTC hour into
+tz.
+
+When the input is 6:MM, z=1:MM and z.d=0, and we stop at once, again with
+the 1:MM standard time spelling we want.
+
+So how can this break? One of the assumptions must be violated. Two
+possibilities:
+
+1) [2] effectively says that y.s is invariant across all y belong to a given
+ time zone. This isn't true if, for political reasons or continental drift,
+ a region decides to change its base offset from UTC.
+
+2) There may be versions of "double daylight" time where the tail end of
+ the analysis gives up a step too early. I haven't thought about that
+ enough to say.
+
+In any case, it's clear that the default fromutc() is strong enough to handle
+"almost all" time zones: so long as the standard offset is invariant, it
+doesn't matter if daylight time transition points change from year to year, or
+if daylight time is skipped in some years; it doesn't matter how large or
+small dst() may get within its bounds; and it doesn't even matter if some
+perverse time zone returns a negative dst()). So a breaking case must be
+pretty bizarre, and a tzinfo subclass can override fromutc() if it is.
+"""
+try:
+ from _datetime import *
+except ImportError:
+ pass
+else:
+ # Clean up unused names
+ del (_DAYNAMES, _DAYS_BEFORE_MONTH, _DAYS_IN_MONTH,
+ _DI100Y, _DI400Y, _DI4Y, _MAXORDINAL, _MONTHNAMES,
+ _build_struct_time, _call_tzinfo_method, _check_date_fields,
+ _check_time_fields, _check_tzinfo_arg, _check_tzname,
+ _check_utc_offset, _cmp, _cmperror, _date_class, _days_before_month,
+ _days_before_year, _days_in_month, _format_time, _is_leap,
+ _isoweek1monday, _math, _ord2ymd, _time, _time_class, _tzinfo_class,
+ _wrap_strftime, _ymd2ord)
+ # XXX Since import * above excludes names that start with _,
+ # docstring does not get overwritten. In the future, it may be
+ # appropriate to maintain a single module level docstring and
+ # remove the following line.
+ from _datetime import __doc__
diff --git a/Lib/dbm/__init__.py b/Lib/dbm/__init__.py
index 57be17b408..76a43c43f3 100644
--- a/Lib/dbm/__init__.py
+++ b/Lib/dbm/__init__.py
@@ -5,12 +5,11 @@ Use
import dbm
d = dbm.open(file, 'w', 0o666)
-The returned object is a dbm.bsd, dbm.gnu, dbm.ndbm or dbm.dumb
-object, dependent on the type of database being opened (determined by
-the whichdb function) in the case of an existing dbm. If the dbm does
-not exist and the create or new flag ('c' or 'n') was specified, the
-dbm type will be determined by the availability of the modules (tested
-in the above order).
+The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the
+type of database being opened (determined by the whichdb function) in the case
+of an existing dbm. If the dbm does not exist and the create or new flag ('c'
+or 'n') was specified, the dbm type will be determined by the availability of
+the modules (tested in the above order).
It has the following interface (key and data are strings):
@@ -28,7 +27,7 @@ tested for existence, and add interfaces to other dbm-like
implementations.
"""
-__all__ = ['open', 'whichdb', 'error', 'error']
+__all__ = ['open', 'whichdb', 'error']
import io
import os
@@ -39,7 +38,7 @@ import sys
class error(Exception):
pass
-_names = ['dbm.bsd', 'dbm.gnu', 'dbm.ndbm', 'dbm.dumb']
+_names = ['dbm.gnu', 'dbm.ndbm', 'dbm.dumb']
_defaultmod = None
_modules = {}
@@ -170,10 +169,6 @@ def whichdb(filename):
if magic == 0x13579ace:
return "dbm.gnu"
- ## Check for old Berkeley db hash file format v2
- #if magic in (0x00061561, 0x61150600):
- # return "bsddb185" # not supported anymore
-
# Later versions of Berkeley db hash file have a 12-byte pad in
# front of the file type
try:
@@ -181,10 +176,6 @@ def whichdb(filename):
except struct.error:
return ""
- ## Check for BSD hash
- #if magic in (0x00061561, 0x61150600):
- # return "dbm.bsd"
-
# Unknown
return ""
diff --git a/Lib/dbm/dumb.py b/Lib/dbm/dumb.py
index 4d804daa0f..cfb912371c 100644
--- a/Lib/dbm/dumb.py
+++ b/Lib/dbm/dumb.py
@@ -203,7 +203,7 @@ class _Database(collections.MutableMapping):
# The blocks used by the associated value are lost.
del self._index[key]
# XXX It's unclear why we do a _commit() here (the code always
- # XXX has, so I'm not changing it). _setitem__ doesn't try to
+ # XXX has, so I'm not changing it). __setitem__ doesn't try to
# XXX keep the directory file in synch. Why should we? Or
# XXX why shouldn't __setitem__?
self._commit()
@@ -232,7 +232,7 @@ class _Database(collections.MutableMapping):
__del__ = close
- def _chmod (self, file):
+ def _chmod(self, file):
if hasattr(self._os, 'chmod'):
self._os.chmod(file, self._mode)
diff --git a/Lib/decimal.py b/Lib/decimal.py
index 5d517ed627..f5277c597c 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -31,7 +31,8 @@ issues associated with binary floating point. The package is especially
useful for financial applications or for contexts where users have
expectations that are at odds with binary floating point (for instance,
in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead
-of the expected Decimal('0.00') returned by decimal floating point).
+of 0.0; Decimal('1.00') % Decimal('0.1') returns the expected
+Decimal('0.00')).
Here are some examples of using the decimal module:
@@ -131,6 +132,7 @@ __all__ = [
]
__version__ = '1.70' # Highest version of the spec this complies with
+ # See http://speleotrove.com/decimal/
import copy as _copy
import math as _math
@@ -648,8 +650,12 @@ class Decimal(object):
return self
if isinstance(value, float):
- raise TypeError("Cannot convert float in Decimal constructor. "
- "Use from_float class method.")
+ value = Decimal.from_float(value)
+ self._exp = value._exp
+ self._sign = value._sign
+ self._int = value._int
+ self._is_special = value._is_special
+ return self
raise TypeError("Cannot convert %r to Decimal" % value)
@@ -845,8 +851,11 @@ class Decimal(object):
# subject of what should happen for a comparison involving a NaN.
# We take the following approach:
#
- # == comparisons involving a NaN always return False
- # != comparisons involving a NaN always return True
+ # == comparisons involving a quiet NaN always return False
+ # != comparisons involving a quiet NaN always return True
+ # == or != comparisons involving a signaling NaN signal
+ # InvalidOperation, and return False or True as above if the
+ # InvalidOperation is not trapped.
# <, >, <= and >= comparisons involving a (quiet or signaling)
# NaN signal InvalidOperation, and return False if the
# InvalidOperation is not trapped.
@@ -854,25 +863,25 @@ class Decimal(object):
# This behavior is designed to conform as closely as possible to
# that specified by IEEE 754.
- def __eq__(self, other):
- other = _convert_other(other)
+ def __eq__(self, other, context=None):
+ self, other = _convert_for_comparison(self, other, equality_op=True)
if other is NotImplemented:
return other
- if self.is_nan() or other.is_nan():
+ if self._check_nans(other, context):
return False
return self._cmp(other) == 0
- def __ne__(self, other):
- other = _convert_other(other)
+ def __ne__(self, other, context=None):
+ self, other = _convert_for_comparison(self, other, equality_op=True)
if other is NotImplemented:
return other
- if self.is_nan() or other.is_nan():
+ if self._check_nans(other, context):
return True
return self._cmp(other) != 0
def __lt__(self, other, context=None):
- other = _convert_other(other)
+ self, other = _convert_for_comparison(self, other)
if other is NotImplemented:
return other
ans = self._compare_check_nans(other, context)
@@ -881,7 +890,7 @@ class Decimal(object):
return self._cmp(other) < 0
def __le__(self, other, context=None):
- other = _convert_other(other)
+ self, other = _convert_for_comparison(self, other)
if other is NotImplemented:
return other
ans = self._compare_check_nans(other, context)
@@ -890,7 +899,7 @@ class Decimal(object):
return self._cmp(other) <= 0
def __gt__(self, other, context=None):
- other = _convert_other(other)
+ self, other = _convert_for_comparison(self, other)
if other is NotImplemented:
return other
ans = self._compare_check_nans(other, context)
@@ -899,7 +908,7 @@ class Decimal(object):
return self._cmp(other) > 0
def __ge__(self, other, context=None):
- other = _convert_other(other)
+ self, other = _convert_for_comparison(self, other)
if other is NotImplemented:
return other
ans = self._compare_check_nans(other, context)
@@ -928,33 +937,29 @@ class Decimal(object):
def __hash__(self):
"""x.__hash__() <==> hash(x)"""
- # Decimal integers must hash the same as the ints
- #
- # The hash of a nonspecial noninteger Decimal must depend only
- # on the value of that Decimal, and not on its representation.
- # For example: hash(Decimal('100E-1')) == hash(Decimal('10')).
+
+ # In order to make sure that the hash of a Decimal instance
+ # agrees with the hash of a numerically equal integer, float
+ # or Fraction, we follow the rules for numeric hashes outlined
+ # in the documentation. (See library docs, 'Built-in Types').
if self._is_special:
- if self._isnan():
- raise TypeError('Cannot hash a NaN value.')
- return hash(str(self))
- if not self:
- return 0
- if self._isinteger():
- op = _WorkRep(self.to_integral_value())
- # to make computation feasible for Decimals with large
- # exponent, we use the fact that hash(n) == hash(m) for
- # any two nonzero integers n and m such that (i) n and m
- # have the same sign, and (ii) n is congruent to m modulo
- # 2**64-1. So we can replace hash((-1)**s*c*10**e) with
- # hash((-1)**s*c*pow(10, e, 2**64-1).
- return hash((-1)**op.sign*op.int*pow(10, op.exp, 2**64-1))
- # The value of a nonzero nonspecial Decimal instance is
- # faithfully represented by the triple consisting of its sign,
- # its adjusted exponent, and its coefficient with trailing
- # zeros removed.
- return hash((self._sign,
- self._exp+len(self._int),
- self._int.rstrip('0')))
+ if self.is_snan():
+ raise TypeError('Cannot hash a signaling NaN value.')
+ elif self.is_nan():
+ return _PyHASH_NAN
+ else:
+ if self._sign:
+ return -_PyHASH_INF
+ else:
+ return _PyHASH_INF
+
+ if self._exp >= 0:
+ exp_hash = pow(10, self._exp, _PyHASH_MODULUS)
+ else:
+ exp_hash = pow(_PyHASH_10INV, -self._exp, _PyHASH_MODULUS)
+ hash_ = int(self._int) * exp_hash % _PyHASH_MODULUS
+ ans = hash_ if self >= 0 else -hash_
+ return -2 if ans == -1 else ans
def as_tuple(self):
"""Represents the number as a triple tuple.
@@ -1585,9 +1590,9 @@ class Decimal(object):
"""Decapitate the payload of a NaN to fit the context"""
payload = self._int
- # maximum length of payload is precision if _clamp=0,
- # precision-1 if _clamp=1.
- max_payload_len = context.prec - context._clamp
+ # maximum length of payload is precision if clamp=0,
+ # precision-1 if clamp=1.
+ max_payload_len = context.prec - context.clamp
if len(payload) > max_payload_len:
payload = payload[len(payload)-max_payload_len:].lstrip('0')
return _dec_from_triple(self._sign, payload, self._exp, True)
@@ -1612,11 +1617,11 @@ class Decimal(object):
return Decimal(self)
# if self is zero then exponent should be between Etiny and
- # Emax if _clamp==0, and between Etiny and Etop if _clamp==1.
+ # Emax if clamp==0, and between Etiny and Etop if clamp==1.
Etiny = context.Etiny()
Etop = context.Etop()
if not self:
- exp_max = [context.Emax, Etop][context._clamp]
+ exp_max = [context.Emax, Etop][context.clamp]
new_exp = min(max(self._exp, Etiny), exp_max)
if new_exp != self._exp:
context._raise_error(Clamped)
@@ -1645,7 +1650,7 @@ class Decimal(object):
self = _dec_from_triple(self._sign, '1', exp_min-1)
digits = 0
rounding_method = self._pick_rounding_function[context.rounding]
- changed = getattr(self, rounding_method)(digits)
+ changed = rounding_method(self, digits)
coeff = self._int[:digits] or '0'
if changed > 0:
coeff = str(int(coeff)+1)
@@ -1676,8 +1681,8 @@ class Decimal(object):
if self_is_subnormal:
context._raise_error(Subnormal)
- # fold down if _clamp == 1 and self has too few digits
- if context._clamp == 1 and self._exp > Etop:
+ # fold down if clamp == 1 and self has too few digits
+ if context.clamp == 1 and self._exp > Etop:
context._raise_error(Clamped)
self_padded = self._int + '0'*(self._exp - Etop)
return _dec_from_triple(self._sign, self_padded, Etop)
@@ -1685,8 +1690,6 @@ class Decimal(object):
# here self was representable to begin with; return unchanged
return Decimal(self)
- _pick_rounding_function = {}
-
# for each of the rounding functions below:
# self is a finite, nonzero Decimal
# prec is an integer satisfying 0 <= prec < len(self._int)
@@ -1753,6 +1756,17 @@ class Decimal(object):
else:
return -self._round_down(prec)
+ _pick_rounding_function = dict(
+ ROUND_DOWN = _round_down,
+ ROUND_UP = _round_up,
+ ROUND_HALF_UP = _round_half_up,
+ ROUND_HALF_DOWN = _round_half_down,
+ ROUND_HALF_EVEN = _round_half_even,
+ ROUND_CEILING = _round_ceiling,
+ ROUND_FLOOR = _round_floor,
+ ROUND_05UP = _round_05up,
+ )
+
def __round__(self, n=None):
"""Round self to the nearest integer, or to a given precision.
@@ -2428,7 +2442,7 @@ class Decimal(object):
if not dup:
return _dec_from_triple(dup._sign, '0', 0)
- exp_max = [context.Emax, context.Etop()][context._clamp]
+ exp_max = [context.Emax, context.Etop()][context.clamp]
end = len(dup._int)
exp = dup._exp
while dup._int[end-1] == '0' and exp < exp_max:
@@ -2549,8 +2563,8 @@ class Decimal(object):
if digits < 0:
self = _dec_from_triple(self._sign, '1', exp-1)
digits = 0
- this_function = getattr(self, self._pick_rounding_function[rounding])
- changed = this_function(digits)
+ this_function = self._pick_rounding_function[rounding]
+ changed = this_function(self, digits)
coeff = self._int[:digits] or '0'
if changed == 1:
coeff = str(int(coeff)+1)
@@ -2942,6 +2956,7 @@ class Decimal(object):
def copy_sign(self, other):
"""Returns self with the sign of other."""
+ other = _convert_other(other, raiseit=True)
return _dec_from_triple(other._sign, self._int,
self._exp, self._is_special)
@@ -3646,12 +3661,12 @@ class Decimal(object):
return (self.__class__, (str(self),))
def __copy__(self):
- if type(self) == Decimal:
+ if type(self) is Decimal:
return self # I'm immutable; therefore I am my own clone
return self.__class__(str(self))
def __deepcopy__(self, memo):
- if type(self) == Decimal:
+ if type(self) is Decimal:
return self # My components are also immutable
return self.__class__(str(self))
@@ -3761,18 +3776,6 @@ _numbers.Number.register(Decimal)
##### Context class #######################################################
-
-# get rounding method function:
-rounding_functions = [name for name in Decimal.__dict__.keys()
- if name.startswith('_round_')]
-for name in rounding_functions:
- # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value.
- globalname = name[1:].upper()
- val = globals()[globalname]
- Decimal._pick_rounding_function[val] = name
-
-del name, val, globalname, rounding_functions
-
class _ContextManager(object):
"""Context manager class to support localcontext().
@@ -3804,13 +3807,13 @@ class Context(object):
Emax - Maximum exponent
capitals - If 1, 1*10^1 is printed as 1E+1.
If 0, printed as 1e1
- _clamp - If 1, change exponents if too high (Default 0)
+ clamp - If 1, change exponents if too high (Default 0)
"""
def __init__(self, prec=None, rounding=None,
traps=None, flags=None,
Emin=None, Emax=None,
- capitals=None, _clamp=0,
+ capitals=None, clamp=None,
_ignored_flags=None):
# Set defaults; for everything except flags and _ignored_flags,
# inherit from DefaultContext.
@@ -3824,7 +3827,7 @@ class Context(object):
self.Emin = Emin if Emin is not None else dc.Emin
self.Emax = Emax if Emax is not None else dc.Emax
self.capitals = capitals if capitals is not None else dc.capitals
- self._clamp = _clamp if _clamp is not None else dc._clamp
+ self.clamp = clamp if clamp is not None else dc.clamp
if _ignored_flags is None:
self._ignored_flags = []
@@ -3849,7 +3852,8 @@ class Context(object):
"""Show the current context."""
s = []
s.append('Context(prec=%(prec)d, rounding=%(rounding)s, '
- 'Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d'
+ 'Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, '
+ 'clamp=%(clamp)d'
% vars(self))
names = [f.__name__ for f, v in self.flags.items() if v]
s.append('flags=[' + ', '.join(names) + ']')
@@ -3866,17 +3870,39 @@ class Context(object):
"""Returns a shallow copy from self."""
nc = Context(self.prec, self.rounding, self.traps,
self.flags, self.Emin, self.Emax,
- self.capitals, self._clamp, self._ignored_flags)
+ self.capitals, self.clamp, self._ignored_flags)
return nc
def copy(self):
"""Returns a deep copy from self."""
nc = Context(self.prec, self.rounding, self.traps.copy(),
self.flags.copy(), self.Emin, self.Emax,
- self.capitals, self._clamp, self._ignored_flags)
+ self.capitals, self.clamp, self._ignored_flags)
return nc
__copy__ = copy
+ # _clamp is provided for backwards compatibility with third-party
+ # code. May be removed in Python >= 3.3.
+ def _get_clamp(self):
+ "_clamp mirrors the clamp attribute. Its use is deprecated."
+ import warnings
+ warnings.warn('Use of the _clamp attribute is deprecated. '
+ 'Please use clamp instead.',
+ DeprecationWarning)
+ return self.clamp
+
+ def _set_clamp(self, clamp):
+ "_clamp mirrors the clamp attribute. Its use is deprecated."
+ import warnings
+ warnings.warn('Use of the _clamp attribute is deprecated. '
+ 'Please use clamp instead.',
+ DeprecationWarning)
+ self.clamp = clamp
+
+ # don't bother with _del_clamp; no sane 3rd party code should
+ # be deleting the _clamp attribute
+ _clamp = property(_get_clamp, _set_clamp)
+
def _raise_error(self, condition, explanation = None, *args):
"""Handles an error
@@ -3959,7 +3985,7 @@ class Context(object):
"permitted.")
d = Decimal(num, context=self)
- if d._isnan() and len(d._int) > self.prec - self._clamp:
+ if d._isnan() and len(d._int) > self.prec - self.clamp:
return self._raise_error(ConversionSyntax,
"diagnostic info too long in NaN")
return d._fix(self)
@@ -3997,7 +4023,10 @@ class Context(object):
Decimal('101.5')
>>> ExtendedContext.abs(Decimal('-101.5'))
Decimal('101.5')
+ >>> ExtendedContext.abs(-1)
+ Decimal('1')
"""
+ a = _convert_other(a, raiseit=True)
return a.__abs__(context=self)
def add(self, a, b):
@@ -4007,8 +4036,19 @@ class Context(object):
Decimal('19.00')
>>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4'))
Decimal('1.02E+4')
+ >>> ExtendedContext.add(1, Decimal(2))
+ Decimal('3')
+ >>> ExtendedContext.add(Decimal(8), 5)
+ Decimal('13')
+ >>> ExtendedContext.add(5, 5)
+ Decimal('10')
"""
- return a.__add__(b, context=self)
+ a = _convert_other(a, raiseit=True)
+ r = a.__add__(b, context=self)
+ if r is NotImplemented:
+ raise TypeError("Unable to convert %s to Decimal" % b)
+ else:
+ return r
def _apply(self, a):
return str(a._fix(self))
@@ -4050,7 +4090,14 @@ class Context(object):
Decimal('1')
>>> ExtendedContext.compare(Decimal('-3'), Decimal('2.1'))
Decimal('-1')
+ >>> ExtendedContext.compare(1, 2)
+ Decimal('-1')
+ >>> ExtendedContext.compare(Decimal(1), 2)
+ Decimal('-1')
+ >>> ExtendedContext.compare(1, Decimal(2))
+ Decimal('-1')
"""
+ a = _convert_other(a, raiseit=True)
return a.compare(b, context=self)
def compare_signal(self, a, b):
@@ -4078,7 +4125,14 @@ class Context(object):
Decimal('NaN')
>>> print(c.flags[InvalidOperation])
1
+ >>> c.compare_signal(-1, 2)
+ Decimal('-1')
+ >>> c.compare_signal(Decimal(-1), 2)
+ Decimal('-1')
+ >>> c.compare_signal(-1, Decimal(2))
+ Decimal('-1')
"""
+ a = _convert_other(a, raiseit=True)
return a.compare_signal(b, context=self)
def compare_total(self, a, b):
@@ -4100,7 +4154,14 @@ class Context(object):
Decimal('1')
>>> ExtendedContext.compare_total(Decimal('12.3'), Decimal('NaN'))
Decimal('-1')
+ >>> ExtendedContext.compare_total(1, 2)
+ Decimal('-1')
+ >>> ExtendedContext.compare_total(Decimal(1), 2)
+ Decimal('-1')
+ >>> ExtendedContext.compare_total(1, Decimal(2))
+ Decimal('-1')
"""
+ a = _convert_other(a, raiseit=True)
return a.compare_total(b)
def compare_total_mag(self, a, b):
@@ -4108,6 +4169,7 @@ class Context(object):
Like compare_total, but with operand's sign ignored and assumed to be 0.
"""
+ a = _convert_other(a, raiseit=True)
return a.compare_total_mag(b)
def copy_abs(self, a):
@@ -4117,17 +4179,23 @@ class Context(object):
Decimal('2.1')
>>> ExtendedContext.copy_abs(Decimal('-100'))
Decimal('100')
+ >>> ExtendedContext.copy_abs(-1)
+ Decimal('1')
"""
+ a = _convert_other(a, raiseit=True)
return a.copy_abs()
def copy_decimal(self, a):
- """Returns a copy of the decimal objet.
+ """Returns a copy of the decimal object.
>>> ExtendedContext.copy_decimal(Decimal('2.1'))
Decimal('2.1')
>>> ExtendedContext.copy_decimal(Decimal('-1.00'))
Decimal('-1.00')
+ >>> ExtendedContext.copy_decimal(1)
+ Decimal('1')
"""
+ a = _convert_other(a, raiseit=True)
return Decimal(a)
def copy_negate(self, a):
@@ -4137,7 +4205,10 @@ class Context(object):
Decimal('-101.5')
>>> ExtendedContext.copy_negate(Decimal('-101.5'))
Decimal('101.5')
+ >>> ExtendedContext.copy_negate(1)
+ Decimal('-1')
"""
+ a = _convert_other(a, raiseit=True)
return a.copy_negate()
def copy_sign(self, a, b):
@@ -4154,7 +4225,14 @@ class Context(object):
Decimal('-1.50')
>>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33'))
Decimal('-1.50')
+ >>> ExtendedContext.copy_sign(1, -2)
+ Decimal('-1')
+ >>> ExtendedContext.copy_sign(Decimal(1), -2)
+ Decimal('-1')
+ >>> ExtendedContext.copy_sign(1, Decimal(-2))
+ Decimal('-1')
"""
+ a = _convert_other(a, raiseit=True)
return a.copy_sign(b)
def divide(self, a, b):
@@ -4180,8 +4258,19 @@ class Context(object):
Decimal('1000')
>>> ExtendedContext.divide(Decimal('2.40E+6'), Decimal('2'))
Decimal('1.20E+6')
+ >>> ExtendedContext.divide(5, 5)
+ Decimal('1')
+ >>> ExtendedContext.divide(Decimal(5), 5)
+ Decimal('1')
+ >>> ExtendedContext.divide(5, Decimal(5))
+ Decimal('1')
"""
- return a.__truediv__(b, context=self)
+ a = _convert_other(a, raiseit=True)
+ r = a.__truediv__(b, context=self)
+ if r is NotImplemented:
+ raise TypeError("Unable to convert %s to Decimal" % b)
+ else:
+ return r
def divide_int(self, a, b):
"""Divides two numbers and returns the integer part of the result.
@@ -4192,18 +4281,40 @@ class Context(object):
Decimal('3')
>>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3'))
Decimal('3')
+ >>> ExtendedContext.divide_int(10, 3)
+ Decimal('3')
+ >>> ExtendedContext.divide_int(Decimal(10), 3)
+ Decimal('3')
+ >>> ExtendedContext.divide_int(10, Decimal(3))
+ Decimal('3')
"""
- return a.__floordiv__(b, context=self)
+ a = _convert_other(a, raiseit=True)
+ r = a.__floordiv__(b, context=self)
+ if r is NotImplemented:
+ raise TypeError("Unable to convert %s to Decimal" % b)
+ else:
+ return r
def divmod(self, a, b):
- """Return (a // b, a % b)
+ """Return (a // b, a % b).
>>> ExtendedContext.divmod(Decimal(8), Decimal(3))
(Decimal('2'), Decimal('2'))
>>> ExtendedContext.divmod(Decimal(8), Decimal(4))
(Decimal('2'), Decimal('0'))
+ >>> ExtendedContext.divmod(8, 4)
+ (Decimal('2'), Decimal('0'))
+ >>> ExtendedContext.divmod(Decimal(8), 4)
+ (Decimal('2'), Decimal('0'))
+ >>> ExtendedContext.divmod(8, Decimal(4))
+ (Decimal('2'), Decimal('0'))
"""
- return a.__divmod__(b, context=self)
+ a = _convert_other(a, raiseit=True)
+ r = a.__divmod__(b, context=self)
+ if r is NotImplemented:
+ raise TypeError("Unable to convert %s to Decimal" % b)
+ else:
+ return r
def exp(self, a):
"""Returns e ** a.
@@ -4223,7 +4334,10 @@ class Context(object):
Decimal('2.00000000')
>>> c.exp(Decimal('+Infinity'))
Decimal('Infinity')
+ >>> c.exp(10)
+ Decimal('22026.4658')
"""
+ a =_convert_other(a, raiseit=True)
return a.exp(context=self)
def fma(self, a, b, c):
@@ -4239,7 +4353,14 @@ class Context(object):
Decimal('-8')
>>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578'))
Decimal('1.38435736E+12')
+ >>> ExtendedContext.fma(1, 3, 4)
+ Decimal('7')
+ >>> ExtendedContext.fma(1, Decimal(3), 4)
+ Decimal('7')
+ >>> ExtendedContext.fma(1, 3, Decimal(4))
+ Decimal('7')
"""
+ a = _convert_other(a, raiseit=True)
return a.fma(b, c, context=self)
def is_canonical(self, a):
@@ -4269,7 +4390,10 @@ class Context(object):
False
>>> ExtendedContext.is_finite(Decimal('NaN'))
False
+ >>> ExtendedContext.is_finite(1)
+ True
"""
+ a = _convert_other(a, raiseit=True)
return a.is_finite()
def is_infinite(self, a):
@@ -4281,7 +4405,10 @@ class Context(object):
True
>>> ExtendedContext.is_infinite(Decimal('NaN'))
False
+ >>> ExtendedContext.is_infinite(1)
+ False
"""
+ a = _convert_other(a, raiseit=True)
return a.is_infinite()
def is_nan(self, a):
@@ -4294,7 +4421,10 @@ class Context(object):
True
>>> ExtendedContext.is_nan(Decimal('-sNaN'))
True
+ >>> ExtendedContext.is_nan(1)
+ False
"""
+ a = _convert_other(a, raiseit=True)
return a.is_nan()
def is_normal(self, a):
@@ -4314,7 +4444,10 @@ class Context(object):
False
>>> c.is_normal(Decimal('NaN'))
False
+ >>> c.is_normal(1)
+ True
"""
+ a = _convert_other(a, raiseit=True)
return a.is_normal(context=self)
def is_qnan(self, a):
@@ -4326,7 +4459,10 @@ class Context(object):
True
>>> ExtendedContext.is_qnan(Decimal('sNaN'))
False
+ >>> ExtendedContext.is_qnan(1)
+ False
"""
+ a = _convert_other(a, raiseit=True)
return a.is_qnan()
def is_signed(self, a):
@@ -4338,7 +4474,12 @@ class Context(object):
True
>>> ExtendedContext.is_signed(Decimal('-0'))
True
+ >>> ExtendedContext.is_signed(8)
+ False
+ >>> ExtendedContext.is_signed(-8)
+ True
"""
+ a = _convert_other(a, raiseit=True)
return a.is_signed()
def is_snan(self, a):
@@ -4351,7 +4492,10 @@ class Context(object):
False
>>> ExtendedContext.is_snan(Decimal('sNaN'))
True
+ >>> ExtendedContext.is_snan(1)
+ False
"""
+ a = _convert_other(a, raiseit=True)
return a.is_snan()
def is_subnormal(self, a):
@@ -4370,7 +4514,10 @@ class Context(object):
False
>>> c.is_subnormal(Decimal('NaN'))
False
+ >>> c.is_subnormal(1)
+ False
"""
+ a = _convert_other(a, raiseit=True)
return a.is_subnormal(context=self)
def is_zero(self, a):
@@ -4382,7 +4529,12 @@ class Context(object):
False
>>> ExtendedContext.is_zero(Decimal('-0E+2'))
True
+ >>> ExtendedContext.is_zero(1)
+ False
+ >>> ExtendedContext.is_zero(0)
+ True
"""
+ a = _convert_other(a, raiseit=True)
return a.is_zero()
def ln(self, a):
@@ -4401,7 +4553,10 @@ class Context(object):
Decimal('2.30258509')
>>> c.ln(Decimal('+Infinity'))
Decimal('Infinity')
+ >>> c.ln(1)
+ Decimal('0')
"""
+ a = _convert_other(a, raiseit=True)
return a.ln(context=self)
def log10(self, a):
@@ -4424,7 +4579,12 @@ class Context(object):
Decimal('1.84509804')
>>> c.log10(Decimal('+Infinity'))
Decimal('Infinity')
+ >>> c.log10(0)
+ Decimal('-Infinity')
+ >>> c.log10(1)
+ Decimal('0')
"""
+ a = _convert_other(a, raiseit=True)
return a.log10(context=self)
def logb(self, a):
@@ -4443,7 +4603,14 @@ class Context(object):
Decimal('-2')
>>> ExtendedContext.logb(Decimal('0'))
Decimal('-Infinity')
+ >>> ExtendedContext.logb(1)
+ Decimal('0')
+ >>> ExtendedContext.logb(10)
+ Decimal('1')
+ >>> ExtendedContext.logb(100)
+ Decimal('2')
"""
+ a = _convert_other(a, raiseit=True)
return a.logb(context=self)
def logical_and(self, a, b):
@@ -4463,7 +4630,14 @@ class Context(object):
Decimal('1000')
>>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))
Decimal('10')
+ >>> ExtendedContext.logical_and(110, 1101)
+ Decimal('100')
+ >>> ExtendedContext.logical_and(Decimal(110), 1101)
+ Decimal('100')
+ >>> ExtendedContext.logical_and(110, Decimal(1101))
+ Decimal('100')
"""
+ a = _convert_other(a, raiseit=True)
return a.logical_and(b, context=self)
def logical_invert(self, a):
@@ -4479,7 +4653,10 @@ class Context(object):
Decimal('0')
>>> ExtendedContext.logical_invert(Decimal('101010101'))
Decimal('10101010')
+ >>> ExtendedContext.logical_invert(1101)
+ Decimal('111110010')
"""
+ a = _convert_other(a, raiseit=True)
return a.logical_invert(context=self)
def logical_or(self, a, b):
@@ -4499,7 +4676,14 @@ class Context(object):
Decimal('1110')
>>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
Decimal('1110')
+ >>> ExtendedContext.logical_or(110, 1101)
+ Decimal('1111')
+ >>> ExtendedContext.logical_or(Decimal(110), 1101)
+ Decimal('1111')
+ >>> ExtendedContext.logical_or(110, Decimal(1101))
+ Decimal('1111')
"""
+ a = _convert_other(a, raiseit=True)
return a.logical_or(b, context=self)
def logical_xor(self, a, b):
@@ -4519,10 +4703,17 @@ class Context(object):
Decimal('110')
>>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
Decimal('1101')
+ >>> ExtendedContext.logical_xor(110, 1101)
+ Decimal('1011')
+ >>> ExtendedContext.logical_xor(Decimal(110), 1101)
+ Decimal('1011')
+ >>> ExtendedContext.logical_xor(110, Decimal(1101))
+ Decimal('1011')
"""
+ a = _convert_other(a, raiseit=True)
return a.logical_xor(b, context=self)
- def max(self, a,b):
+ def max(self, a, b):
"""max compares two values numerically and returns the maximum.
If either operand is a NaN then the general rules apply.
@@ -4539,14 +4730,34 @@ class Context(object):
Decimal('1')
>>> ExtendedContext.max(Decimal('7'), Decimal('NaN'))
Decimal('7')
+ >>> ExtendedContext.max(1, 2)
+ Decimal('2')
+ >>> ExtendedContext.max(Decimal(1), 2)
+ Decimal('2')
+ >>> ExtendedContext.max(1, Decimal(2))
+ Decimal('2')
"""
+ a = _convert_other(a, raiseit=True)
return a.max(b, context=self)
def max_mag(self, a, b):
- """Compares the values numerically with their sign ignored."""
+ """Compares the values numerically with their sign ignored.
+
+ >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
+ Decimal('7')
+ >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
+ Decimal('-10')
+ >>> ExtendedContext.max_mag(1, -2)
+ Decimal('-2')
+ >>> ExtendedContext.max_mag(Decimal(1), -2)
+ Decimal('-2')
+ >>> ExtendedContext.max_mag(1, Decimal(-2))
+ Decimal('-2')
+ """
+ a = _convert_other(a, raiseit=True)
return a.max_mag(b, context=self)
- def min(self, a,b):
+ def min(self, a, b):
"""min compares two values numerically and returns the minimum.
If either operand is a NaN then the general rules apply.
@@ -4563,11 +4774,31 @@ class Context(object):
Decimal('1.0')
>>> ExtendedContext.min(Decimal('7'), Decimal('NaN'))
Decimal('7')
+ >>> ExtendedContext.min(1, 2)
+ Decimal('1')
+ >>> ExtendedContext.min(Decimal(1), 2)
+ Decimal('1')
+ >>> ExtendedContext.min(1, Decimal(29))
+ Decimal('1')
"""
+ a = _convert_other(a, raiseit=True)
return a.min(b, context=self)
def min_mag(self, a, b):
- """Compares the values numerically with their sign ignored."""
+ """Compares the values numerically with their sign ignored.
+
+ >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
+ Decimal('-2')
+ >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
+ Decimal('-3')
+ >>> ExtendedContext.min_mag(1, -2)
+ Decimal('1')
+ >>> ExtendedContext.min_mag(Decimal(1), -2)
+ Decimal('1')
+ >>> ExtendedContext.min_mag(1, Decimal(-2))
+ Decimal('1')
+ """
+ a = _convert_other(a, raiseit=True)
return a.min_mag(b, context=self)
def minus(self, a):
@@ -4581,16 +4812,19 @@ class Context(object):
Decimal('-1.3')
>>> ExtendedContext.minus(Decimal('-1.3'))
Decimal('1.3')
+ >>> ExtendedContext.minus(1)
+ Decimal('-1')
"""
+ a = _convert_other(a, raiseit=True)
return a.__neg__(context=self)
def multiply(self, a, b):
"""multiply multiplies two operands.
If either operand is a special value then the general rules apply.
- Otherwise, the operands are multiplied together ('long multiplication'),
- resulting in a number which may be as long as the sum of the lengths
- of the two operands.
+ Otherwise, the operands are multiplied together
+ ('long multiplication'), resulting in a number which may be as long as
+ the sum of the lengths of the two operands.
>>> ExtendedContext.multiply(Decimal('1.20'), Decimal('3'))
Decimal('3.60')
@@ -4602,8 +4836,19 @@ class Context(object):
Decimal('-0.0')
>>> ExtendedContext.multiply(Decimal('654321'), Decimal('654321'))
Decimal('4.28135971E+11')
+ >>> ExtendedContext.multiply(7, 7)
+ Decimal('49')
+ >>> ExtendedContext.multiply(Decimal(7), 7)
+ Decimal('49')
+ >>> ExtendedContext.multiply(7, Decimal(7))
+ Decimal('49')
"""
- return a.__mul__(b, context=self)
+ a = _convert_other(a, raiseit=True)
+ r = a.__mul__(b, context=self)
+ if r is NotImplemented:
+ raise TypeError("Unable to convert %s to Decimal" % b)
+ else:
+ return r
def next_minus(self, a):
"""Returns the largest representable number smaller than a.
@@ -4619,7 +4864,10 @@ class Context(object):
Decimal('-1.00000004')
>>> c.next_minus(Decimal('Infinity'))
Decimal('9.99999999E+999')
+ >>> c.next_minus(1)
+ Decimal('0.999999999')
"""
+ a = _convert_other(a, raiseit=True)
return a.next_minus(context=self)
def next_plus(self, a):
@@ -4636,7 +4884,10 @@ class Context(object):
Decimal('-1.00000002')
>>> c.next_plus(Decimal('-Infinity'))
Decimal('-9.99999999E+999')
+ >>> c.next_plus(1)
+ Decimal('1.00000001')
"""
+ a = _convert_other(a, raiseit=True)
return a.next_plus(context=self)
def next_toward(self, a, b):
@@ -4664,7 +4915,14 @@ class Context(object):
Decimal('-1.00000004')
>>> c.next_toward(Decimal('0.00'), Decimal('-0.0000'))
Decimal('-0.00')
+ >>> c.next_toward(0, 1)
+ Decimal('1E-1007')
+ >>> c.next_toward(Decimal(0), 1)
+ Decimal('1E-1007')
+ >>> c.next_toward(0, Decimal(1))
+ Decimal('1E-1007')
"""
+ a = _convert_other(a, raiseit=True)
return a.next_toward(b, context=self)
def normalize(self, a):
@@ -4685,7 +4943,10 @@ class Context(object):
Decimal('1.2E+2')
>>> ExtendedContext.normalize(Decimal('0.00'))
Decimal('0')
+ >>> ExtendedContext.normalize(6)
+ Decimal('6')
"""
+ a = _convert_other(a, raiseit=True)
return a.normalize(context=self)
def number_class(self, a):
@@ -4732,7 +4993,10 @@ class Context(object):
'NaN'
>>> c.number_class(Decimal('sNaN'))
'sNaN'
+ >>> c.number_class(123)
+ '+Normal'
"""
+ a = _convert_other(a, raiseit=True)
return a.number_class(context=self)
def plus(self, a):
@@ -4746,7 +5010,10 @@ class Context(object):
Decimal('1.3')
>>> ExtendedContext.plus(Decimal('-1.3'))
Decimal('-1.3')
+ >>> ExtendedContext.plus(-1)
+ Decimal('-1')
"""
+ a = _convert_other(a, raiseit=True)
return a.__pos__(context=self)
def power(self, a, b, modulo=None):
@@ -4815,8 +5082,19 @@ class Context(object):
Decimal('-0')
>>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537'))
Decimal('1')
+ >>> ExtendedContext.power(7, 7)
+ Decimal('823543')
+ >>> ExtendedContext.power(Decimal(7), 7)
+ Decimal('823543')
+ >>> ExtendedContext.power(7, Decimal(7), 2)
+ Decimal('1')
"""
- return a.__pow__(b, modulo, context=self)
+ a = _convert_other(a, raiseit=True)
+ r = a.__pow__(b, modulo, context=self)
+ if r is NotImplemented:
+ raise TypeError("Unable to convert %s to Decimal" % b)
+ else:
+ return r
def quantize(self, a, b):
"""Returns a value equal to 'a' (rounded), having the exponent of 'b'.
@@ -4866,7 +5144,14 @@ class Context(object):
Decimal('2.2E+2')
>>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+2'))
Decimal('2E+2')
+ >>> ExtendedContext.quantize(1, 2)
+ Decimal('1')
+ >>> ExtendedContext.quantize(Decimal(1), 2)
+ Decimal('1')
+ >>> ExtendedContext.quantize(1, Decimal(2))
+ Decimal('1')
"""
+ a = _convert_other(a, raiseit=True)
return a.quantize(b, context=self)
def radix(self):
@@ -4901,8 +5186,19 @@ class Context(object):
Decimal('0.1')
>>> ExtendedContext.remainder(Decimal('3.6'), Decimal('1.3'))
Decimal('1.0')
+ >>> ExtendedContext.remainder(22, 6)
+ Decimal('4')
+ >>> ExtendedContext.remainder(Decimal(22), 6)
+ Decimal('4')
+ >>> ExtendedContext.remainder(22, Decimal(6))
+ Decimal('4')
"""
- return a.__mod__(b, context=self)
+ a = _convert_other(a, raiseit=True)
+ r = a.__mod__(b, context=self)
+ if r is NotImplemented:
+ raise TypeError("Unable to convert %s to Decimal" % b)
+ else:
+ return r
def remainder_near(self, a, b):
"""Returns to be "a - b * n", where n is the integer nearest the exact
@@ -4928,7 +5224,14 @@ class Context(object):
Decimal('0.1')
>>> ExtendedContext.remainder_near(Decimal('3.6'), Decimal('1.3'))
Decimal('-0.3')
+ >>> ExtendedContext.remainder_near(3, 11)
+ Decimal('3')
+ >>> ExtendedContext.remainder_near(Decimal(3), 11)
+ Decimal('3')
+ >>> ExtendedContext.remainder_near(3, Decimal(11))
+ Decimal('3')
"""
+ a = _convert_other(a, raiseit=True)
return a.remainder_near(b, context=self)
def rotate(self, a, b):
@@ -4950,7 +5253,14 @@ class Context(object):
Decimal('123456789')
>>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2'))
Decimal('345678912')
+ >>> ExtendedContext.rotate(1333333, 1)
+ Decimal('13333330')
+ >>> ExtendedContext.rotate(Decimal(1333333), 1)
+ Decimal('13333330')
+ >>> ExtendedContext.rotate(1333333, Decimal(1))
+ Decimal('13333330')
"""
+ a = _convert_other(a, raiseit=True)
return a.rotate(b, context=self)
def same_quantum(self, a, b):
@@ -4967,7 +5277,14 @@ class Context(object):
False
>>> ExtendedContext.same_quantum(Decimal('Inf'), Decimal('-Inf'))
True
+ >>> ExtendedContext.same_quantum(10000, -1)
+ True
+ >>> ExtendedContext.same_quantum(Decimal(10000), -1)
+ True
+ >>> ExtendedContext.same_quantum(10000, Decimal(-1))
+ True
"""
+ a = _convert_other(a, raiseit=True)
return a.same_quantum(b)
def scaleb (self, a, b):
@@ -4979,8 +5296,15 @@ class Context(object):
Decimal('7.50')
>>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3'))
Decimal('7.50E+3')
+ >>> ExtendedContext.scaleb(1, 4)
+ Decimal('1E+4')
+ >>> ExtendedContext.scaleb(Decimal(1), 4)
+ Decimal('1E+4')
+ >>> ExtendedContext.scaleb(1, Decimal(4))
+ Decimal('1E+4')
"""
- return a.scaleb (b, context=self)
+ a = _convert_other(a, raiseit=True)
+ return a.scaleb(b, context=self)
def shift(self, a, b):
"""Returns a shifted copy of a, b times.
@@ -5002,7 +5326,14 @@ class Context(object):
Decimal('123456789')
>>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
Decimal('345678900')
+ >>> ExtendedContext.shift(88888888, 2)
+ Decimal('888888800')
+ >>> ExtendedContext.shift(Decimal(88888888), 2)
+ Decimal('888888800')
+ >>> ExtendedContext.shift(88888888, Decimal(2))
+ Decimal('888888800')
"""
+ a = _convert_other(a, raiseit=True)
return a.shift(b, context=self)
def sqrt(self, a):
@@ -5029,9 +5360,12 @@ class Context(object):
Decimal('2.64575131')
>>> ExtendedContext.sqrt(Decimal('10'))
Decimal('3.16227766')
+ >>> ExtendedContext.sqrt(2)
+ Decimal('1.41421356')
>>> ExtendedContext.prec
9
"""
+ a = _convert_other(a, raiseit=True)
return a.sqrt(context=self)
def subtract(self, a, b):
@@ -5043,14 +5377,26 @@ class Context(object):
Decimal('0.00')
>>> ExtendedContext.subtract(Decimal('1.3'), Decimal('2.07'))
Decimal('-0.77')
+ >>> ExtendedContext.subtract(8, 5)
+ Decimal('3')
+ >>> ExtendedContext.subtract(Decimal(8), 5)
+ Decimal('3')
+ >>> ExtendedContext.subtract(8, Decimal(5))
+ Decimal('3')
"""
- return a.__sub__(b, context=self)
+ a = _convert_other(a, raiseit=True)
+ r = a.__sub__(b, context=self)
+ if r is NotImplemented:
+ raise TypeError("Unable to convert %s to Decimal" % b)
+ else:
+ return r
def to_eng_string(self, a):
"""Converts a number to a string, using scientific notation.
The operation is not affected by the context.
"""
+ a = _convert_other(a, raiseit=True)
return a.to_eng_string(context=self)
def to_sci_string(self, a):
@@ -5058,6 +5404,7 @@ class Context(object):
The operation is not affected by the context.
"""
+ a = _convert_other(a, raiseit=True)
return a.__str__(context=self)
def to_integral_exact(self, a):
@@ -5087,6 +5434,7 @@ class Context(object):
>>> ExtendedContext.to_integral_exact(Decimal('-Inf'))
Decimal('-Infinity')
"""
+ a = _convert_other(a, raiseit=True)
return a.to_integral_exact(context=self)
def to_integral_value(self, a):
@@ -5115,6 +5463,7 @@ class Context(object):
>>> ExtendedContext.to_integral_value(Decimal('-Inf'))
Decimal('-Infinity')
"""
+ a = _convert_other(a, raiseit=True)
return a.to_integral_value(context=self)
# the method name changed, but we provide also the old one, for compatibility
@@ -5178,23 +5527,7 @@ def _normalize(op1, op2, prec = 0):
##### Integer arithmetic functions used by ln, log10, exp and __pow__ #####
-# This function from Tim Peters was taken from here:
-# http://mail.python.org/pipermail/python-list/1999-July/007758.html
-# The correction being in the function definition is for speed, and
-# the whole function is not resolved with math.log because of avoiding
-# the use of floats.
-def _nbits(n, correction = {
- '0': 4, '1': 3, '2': 2, '3': 2,
- '4': 1, '5': 1, '6': 1, '7': 1,
- '8': 0, '9': 0, 'a': 0, 'b': 0,
- 'c': 0, 'd': 0, 'e': 0, 'f': 0}):
- """Number of bits in binary representation of the positive integer n,
- or 0 if n == 0.
- """
- if n < 0:
- raise ValueError("The argument to _nbits should be nonnegative.")
- hex_n = "%x" % n
- return 4*len(hex_n) - correction[hex_n[0]]
+_nbits = int.bit_length
def _sqrt_nearest(n, a):
"""Closest integer to the square root of the positive integer n. a is
@@ -5516,19 +5849,56 @@ def _log10_lb(c, correction = {
##### Helper Functions ####################################################
-def _convert_other(other, raiseit=False):
+def _convert_other(other, raiseit=False, allow_float=False):
"""Convert other to Decimal.
Verifies that it's ok to use in an implicit construction.
+ If allow_float is true, allow conversion from float; this
+ is used in the comparison methods (__eq__ and friends).
+
"""
if isinstance(other, Decimal):
return other
if isinstance(other, int):
return Decimal(other)
+ if allow_float and isinstance(other, float):
+ return Decimal.from_float(other)
+
if raiseit:
raise TypeError("Unable to convert %s to Decimal" % other)
return NotImplemented
+def _convert_for_comparison(self, other, equality_op=False):
+ """Given a Decimal instance self and a Python object other, return
+ a pair (s, o) of Decimal instances such that "s op o" is
+ equivalent to "self op other" for any of the 6 comparison
+ operators "op".
+
+ """
+ if isinstance(other, Decimal):
+ return self, other
+
+ # Comparison with a Rational instance (also includes integers):
+ # self op n/d <=> self*d op n (for n and d integers, d positive).
+ # A NaN or infinity can be left unchanged without affecting the
+ # comparison result.
+ if isinstance(other, _numbers.Rational):
+ if not self._is_special:
+ self = _dec_from_triple(self._sign,
+ str(int(self._int) * other.denominator),
+ self._exp)
+ return self, Decimal(other.numerator)
+
+ # Comparisons with float and complex types. == and != comparisons
+ # with complex numbers should succeed, returning either True or False
+ # as appropriate. Other comparisons return NotImplemented.
+ if equality_op and isinstance(other, _numbers.Complex) and other.imag == 0:
+ other = other.real
+ if isinstance(other, float):
+ return self, Decimal.from_float(other)
+ return NotImplemented, NotImplemented
+
+
##### Setup Specific Contexts ############################################
# The default context prototype used by Context()
@@ -5540,7 +5910,8 @@ DefaultContext = Context(
flags=[],
Emax=999999999,
Emin=-999999999,
- capitals=1
+ capitals=1,
+ clamp=0
)
# Pre-made alternate contexts offered by the specification
@@ -5605,7 +5976,7 @@ _exact_half = re.compile('50*$').match
#
# A format specifier for Decimal looks like:
#
-# [[fill]align][sign][0][minimumwidth][,][.precision][type]
+# [[fill]align][sign][#][0][minimumwidth][,][.precision][type]
_parse_format_specifier_regex = re.compile(r"""\A
(?:
@@ -5613,6 +5984,7 @@ _parse_format_specifier_regex = re.compile(r"""\A
(?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
+(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>(?!0)\d+)?
(?P<thousands_sep>,)?
@@ -5670,7 +6042,10 @@ def _parse_format_specifier(format_spec, _localeconv=None):
raise ValueError("Alignment conflicts with '0' in "
"format specifier: " + format_spec)
format_dict['fill'] = fill or ' '
- format_dict['align'] = align or '<'
+ # PEP 3101 originally specified that the default alignment should
+ # be left; it was later agreed that right-aligned makes more sense
+ # for numeric types. See http://bugs.python.org/issue6857.
+ format_dict['align'] = align or '>'
# default sign handling: '-' for negative, '' for positive
if format_dict['sign'] is None:
@@ -5825,7 +6200,7 @@ def _format_number(is_negative, intpart, fracpart, exp, spec):
sign = _format_sign(is_negative, spec)
- if fracpart:
+ if fracpart or spec['alt']:
fracpart = spec['decimal_point'] + fracpart
if exp != 0 or spec['type'] in 'eE':
@@ -5856,8 +6231,19 @@ _NegativeOne = Decimal(-1)
# _SignedInfinity[sign] is infinity w/ that sign
_SignedInfinity = (_Infinity, _NegativeInfinity)
+# Constants related to the hash implementation; hash(x) is based
+# on the reduction of x modulo _PyHASH_MODULUS
+import sys
+_PyHASH_MODULUS = sys.hash_info.modulus
+# hash values to use for positive and negative infinities, and nans
+_PyHASH_INF = sys.hash_info.inf
+_PyHASH_NAN = sys.hash_info.nan
+del sys
+
+# _PyHASH_10INV is the inverse of 10 modulo the prime _PyHASH_MODULUS
+_PyHASH_10INV = pow(10, _PyHASH_MODULUS - 2, _PyHASH_MODULUS)
if __name__ == '__main__':
- import doctest, sys
- doctest.testmod(sys.modules[__name__])
+ import doctest, decimal
+ doctest.testmod(decimal)
diff --git a/Lib/difflib.py b/Lib/difflib.py
index 873fc02728..e6cc6ee442 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""
Module difflib -- helpers for computing deltas between objects.
@@ -32,6 +32,7 @@ __all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher',
'Differ','IS_CHARACTER_JUNK', 'IS_LINE_JUNK', 'context_diff',
'unified_diff', 'HtmlDiff', 'Match']
+import warnings
import heapq
from collections import namedtuple as _namedtuple
@@ -150,7 +151,7 @@ class SequenceMatcher:
Return an upper bound on ratio() very quickly.
"""
- def __init__(self, isjunk=None, a='', b=''):
+ def __init__(self, isjunk=None, a='', b='', autojunk=True):
"""Construct a SequenceMatcher.
Optional arg isjunk is None (the default), or a one-argument
@@ -168,6 +169,10 @@ class SequenceMatcher:
Optional arg b is the second of two sequences to be compared. By
default, an empty string. The elements of b must be hashable. See
also .set_seqs() and .set_seq2().
+
+ Optional arg autojunk should be set to False to disable the
+ "automatic junk heuristic" that treats popular elements as junk
+ (see module documentation for more information).
"""
# Members:
@@ -178,7 +183,7 @@ class SequenceMatcher:
# we need to do to 'a' to change it into 'b'?"
# b2j
# for x in b, b2j[x] is a list of the indices (into b)
- # at which x appears; junk elements do not appear
+ # at which x appears; junk and popular elements do not appear
# fullbcount
# for x in b, fullbcount[x] == the number of times x
# appears in b; only materialized if really needed (used
@@ -200,17 +205,14 @@ class SequenceMatcher:
# subtle but helpful effects on the algorithm, which I'll
# get around to writing up someday <0.9 wink>.
# DON'T USE! Only __chain_b uses this. Use isbjunk.
- # isbjunk
- # for x in b, isbjunk(x) == isjunk(x) but much faster;
- # it's really the __contains__ method of a hidden dict.
- # DOES NOT WORK for x in a!
- # isbpopular
- # for x in b, isbpopular(x) is true iff b is reasonably long
- # (at least 200 elements) and x accounts for more than 1% of
- # its elements. DOES NOT WORK for x in a!
+ # bjunk
+ # the items in b for which isjunk is True.
+ # bpopular
+ # nonjunk items in b treated as junk by the heuristic (if used).
self.isjunk = isjunk
self.a = self.b = None
+ self.autojunk = autojunk
self.set_seqs(a, b)
def set_seqs(self, a, b):
@@ -287,7 +289,7 @@ class SequenceMatcher:
# from starting any matching block at a junk element ...
# also creates the fast isbjunk function ...
# b2j also does not contain entries for "popular" elements, meaning
- # elements that account for more than 1% of the total elements, and
+ # elements that account for more than 1 + 1% of the total elements, and
# when the sequence is reasonably large (>= 200 elements); this can
# be viewed as an adaptive notion of semi-junk, and yields an enormous
# speedup when, e.g., comparing program files with hundreds of
@@ -308,44 +310,46 @@ class SequenceMatcher:
# out the junk later is much cheaper than building b2j "right"
# from the start.
b = self.b
- n = len(b)
self.b2j = b2j = {}
- populardict = {}
- for i, elt in enumerate(b):
- if elt in b2j:
- indices = b2j[elt]
- if n >= 200 and len(indices) * 100 > n:
- populardict[elt] = 1
- del indices[:]
- else:
- indices.append(i)
- else:
- b2j[elt] = [i]
- # Purge leftover indices for popular elements.
- for elt in populardict:
- del b2j[elt]
+ for i, elt in enumerate(b):
+ indices = b2j.setdefault(elt, [])
+ indices.append(i)
- # Now b2j.keys() contains elements uniquely, and especially when
- # the sequence is a string, that's usually a good deal smaller
- # than len(string). The difference is the number of isjunk calls
- # saved.
+ # Purge junk elements
+ self.bjunk = junk = set()
isjunk = self.isjunk
- junkdict = {}
if isjunk:
- for d in populardict, b2j:
- for elt in list(d.keys()):
- if isjunk(elt):
- junkdict[elt] = 1
- del d[elt]
-
- # Now for x in b, isjunk(x) == x in junkdict, but the
- # latter is much faster. Note too that while there may be a
- # lot of junk in the sequence, the number of *unique* junk
- # elements is probably small. So the memory burden of keeping
- # this dict alive is likely trivial compared to the size of b2j.
- self.isbjunk = junkdict.__contains__
- self.isbpopular = populardict.__contains__
+ for elt in b2j.keys():
+ if isjunk(elt):
+ junk.add(elt)
+ for elt in junk: # separate loop avoids separate list of keys
+ del b2j[elt]
+
+ # Purge popular elements that are not junk
+ self.bpopular = popular = set()
+ n = len(b)
+ if self.autojunk and n >= 200:
+ ntest = n // 100 + 1
+ for elt, idxs in b2j.items():
+ if len(idxs) > ntest:
+ popular.add(elt)
+ for elt in popular: # ditto; as fast for 1% deletion
+ del b2j[elt]
+
+ def isbjunk(self, item):
+ "Deprecated; use 'item in SequenceMatcher().bjunk'."
+ warnings.warn("'SequenceMatcher().isbjunk(item)' is deprecated;\n"
+ "use 'item in SMinstance.bjunk' instead.",
+ DeprecationWarning, 2)
+ return item in self.bjunk
+
+ def isbpopular(self, item):
+ "Deprecated; use 'item in SequenceMatcher().bpopular'."
+ warnings.warn("'SequenceMatcher().isbpopular(item)' is deprecated;\n"
+ "use 'item in SMinstance.bpopular' instead.",
+ DeprecationWarning, 2)
+ return item in self.bpopular
def find_longest_match(self, alo, ahi, blo, bhi):
"""Find longest matching block in a[alo:ahi] and b[blo:bhi].
@@ -403,7 +407,7 @@ class SequenceMatcher:
# Windiff ends up at the same place as diff, but by pairing up
# the unique 'b's and then matching the first two 'a's.
- a, b, b2j, isbjunk = self.a, self.b, self.b2j, self.isbjunk
+ a, b, b2j, isbjunk = self.a, self.b, self.b2j, self.bjunk.__contains__
besti, bestj, bestsize = alo, blo, 0
# find longest junk-free match
# during an iteration of the loop, j2len[j] = length of longest
diff --git a/Lib/dis.py b/Lib/dis.py
index 2b400dc88f..f64bae66fb 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -6,10 +6,25 @@ import types
from opcode import *
from opcode import __all__ as _opcodes_all
-__all__ = ["dis", "disassemble", "distb", "disco",
- "findlinestarts", "findlabels"] + _opcodes_all
+__all__ = ["code_info", "dis", "disassemble", "distb", "disco",
+ "findlinestarts", "findlabels", "show_code"] + _opcodes_all
del _opcodes_all
+_have_code = (types.MethodType, types.FunctionType, types.CodeType, type)
+
+def _try_compile(source, name):
+ """Attempts to compile the given source, first as an expression and
+ then as a statement if the first approach fails.
+
+ Utility function to accept strings in functions that otherwise
+ expect code objects
+ """
+ try:
+ c = compile(source, name, 'eval')
+ except SyntaxError:
+ c = compile(source, name, 'exec')
+ return c
+
def dis(x=None):
"""Disassemble classes, methods, functions, or code.
@@ -19,25 +34,26 @@ def dis(x=None):
if x is None:
distb()
return
- if hasattr(x, '__func__'):
+ if hasattr(x, '__func__'): # Method
x = x.__func__
- if hasattr(x, '__code__'):
+ if hasattr(x, '__code__'): # Function
x = x.__code__
- if hasattr(x, '__dict__'):
+ if hasattr(x, '__dict__'): # Class or module
items = sorted(x.__dict__.items())
for name, x1 in items:
- if isinstance(x1, (types.MethodType, types.FunctionType,
- types.CodeType, type)):
+ if isinstance(x1, _have_code):
print("Disassembly of %s:" % name)
try:
dis(x1)
except TypeError as msg:
print("Sorry:", msg)
print()
- elif hasattr(x, 'co_code'):
+ elif hasattr(x, 'co_code'): # Code object
disassemble(x)
- elif isinstance(x, (bytes, bytearray)):
- disassemble_string(x)
+ elif isinstance(x, (bytes, bytearray)): # Raw bytecode
+ _disassemble_bytes(x)
+ elif isinstance(x, str): # Source code
+ _disassemble_str(x)
else:
raise TypeError("don't know how to disassemble %s objects" %
type(x).__name__)
@@ -52,9 +68,10 @@ def distb(tb=None):
while tb.tb_next: tb = tb.tb_next
disassemble(tb.tb_frame.f_code, tb.tb_lasti)
-# XXX This duplicates information from code.h, also duplicated in inspect.py.
-# XXX Maybe this ought to be put in a central location, like opcode.py?
-flag2name = {
+# The inspect module interrogates this dictionary to build its
+# list of CO_* constants. It is also used by pretty_flags to
+# turn the co_flags field into a human readable list.
+COMPILER_FLAG_NAMES = {
1: "OPTIMIZED",
2: "NEWLOCALS",
4: "VARARGS",
@@ -70,7 +87,7 @@ def pretty_flags(flags):
for i in range(32):
flag = 1<<i
if flags & flag:
- names.append(flag2name.get(flag, hex(flag)))
+ names.append(COMPILER_FLAG_NAMES.get(flag, hex(flag)))
flags ^= flag
if not flags:
break
@@ -78,35 +95,54 @@ def pretty_flags(flags):
names.append(hex(flags))
return ", ".join(names)
-def show_code(co):
- """Show details about a code object."""
- print("Name: ", co.co_name)
- print("Filename: ", co.co_filename)
- print("Argument count: ", co.co_argcount)
- print("Kw-only arguments:", co.co_kwonlyargcount)
- print("Number of locals: ", co.co_nlocals)
- print("Stack size: ", co.co_stacksize)
- print("Flags: ", pretty_flags(co.co_flags))
+def code_info(x):
+ """Formatted details of methods, functions, or code."""
+ if hasattr(x, '__func__'): # Method
+ x = x.__func__
+ if hasattr(x, '__code__'): # Function
+ x = x.__code__
+ if isinstance(x, str): # Source code
+ x = _try_compile(x, "<code_info>")
+ if hasattr(x, 'co_code'): # Code object
+ return _format_code_info(x)
+ else:
+ raise TypeError("don't know how to disassemble %s objects" %
+ type(x).__name__)
+
+def _format_code_info(co):
+ lines = []
+ lines.append("Name: %s" % co.co_name)
+ lines.append("Filename: %s" % co.co_filename)
+ lines.append("Argument count: %s" % co.co_argcount)
+ lines.append("Kw-only arguments: %s" % co.co_kwonlyargcount)
+ lines.append("Number of locals: %s" % co.co_nlocals)
+ lines.append("Stack size: %s" % co.co_stacksize)
+ lines.append("Flags: %s" % pretty_flags(co.co_flags))
if co.co_consts:
- print("Constants:")
+ lines.append("Constants:")
for i_c in enumerate(co.co_consts):
- print("%4d: %r" % i_c)
+ lines.append("%4d: %r" % i_c)
if co.co_names:
- print("Names:")
+ lines.append("Names:")
for i_n in enumerate(co.co_names):
- print("%4d: %s" % i_n)
+ lines.append("%4d: %s" % i_n)
if co.co_varnames:
- print("Variable names:")
+ lines.append("Variable names:")
for i_n in enumerate(co.co_varnames):
- print("%4d: %s" % i_n)
+ lines.append("%4d: %s" % i_n)
if co.co_freevars:
- print("Free variables:")
+ lines.append("Free variables:")
for i_n in enumerate(co.co_freevars):
- print("%4d: %s" % i_n)
+ lines.append("%4d: %s" % i_n)
if co.co_cellvars:
- print("Cell variables:")
+ lines.append("Cell variables:")
for i_n in enumerate(co.co_cellvars):
- print("%4d: %s" % i_n)
+ lines.append("%4d: %s" % i_n)
+ return "\n".join(lines)
+
+def show_code(co):
+ """Print details of methods, functions, or code to stdout."""
+ print(code_info(co))
def disassemble(co, lasti=-1):
"""Disassemble a code object."""
@@ -156,7 +192,7 @@ def disassemble(co, lasti=-1):
print('(' + free[oparg] + ')', end=' ')
print()
-def disassemble_string(code, lasti=-1, varnames=None, names=None,
+def _disassemble_bytes(code, lasti=-1, varnames=None, names=None,
constants=None):
labels = findlabels(code)
n = len(code)
@@ -195,6 +231,10 @@ def disassemble_string(code, lasti=-1, varnames=None, names=None,
print('(' + cmp_op[oparg] + ')', end=' ')
print()
+def _disassemble_str(source):
+ """Compile the source string, then disassemble the code object."""
+ disassemble(_try_compile(source, '<dis>'))
+
disco = disassemble # XXX For backwards compatibility
def findlabels(code):
diff --git a/Lib/distutils/__init__.py b/Lib/distutils/__init__.py
index 6f55f016a2..49b6d517f6 100644
--- a/Lib/distutils/__init__.py
+++ b/Lib/distutils/__init__.py
@@ -15,5 +15,5 @@ __revision__ = "$Id$"
# Updated automatically by the Python release process.
#
#--start constants--
-__version__ = "3.1.3"
+__version__ = "3.2"
#--end constants--
diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py
index 8a458d8536..b11957a7dc 100644
--- a/Lib/distutils/command/bdist_msi.py
+++ b/Lib/distutils/command/bdist_msi.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2005, 2006 Martin von Löwis
# Licensed to PSF under a Contributor Agreement.
# The bdist_wininst command proper
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index 502b39a82f..fb31648951 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -754,9 +754,9 @@ class build_ext(Command):
else:
from distutils import sysconfig
if sysconfig.get_config_var('Py_ENABLE_SHARED'):
- template = "python%d.%d"
- pythonlib = (template %
- (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
+ pythonlib = 'python{}.{}{}'.format(
+ sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff,
+ sys.abiflags)
return ext.libraries + [pythonlib]
else:
return ext.libraries
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 2a905d92f8..bdc3a09b22 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -48,7 +48,7 @@ INSTALL_SCHEMES = {
'unix_prefix': {
'purelib': '$base/lib/python$py_version_short/site-packages',
'platlib': '$platbase/lib/python$py_version_short/site-packages',
- 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
'scripts': '$base/bin',
'data' : '$base',
},
@@ -60,14 +60,6 @@ INSTALL_SCHEMES = {
'data' : '$base',
},
'nt': WINDOWS_SCHEME,
- 'mac': {
- 'purelib': '$base/Lib/site-packages',
- 'platlib': '$base/Lib/site-packages',
- 'headers': '$base/Include/$dist_name',
- 'scripts': '$base/Scripts',
- 'data' : '$base',
- },
-
'os2': {
'purelib': '$base/Lib/site-packages',
'platlib': '$base/Lib/site-packages',
@@ -90,15 +82,8 @@ if HAS_USER_SITE:
INSTALL_SCHEMES['unix_user'] = {
'purelib': '$usersite',
'platlib': '$usersite',
- 'headers': '$userbase/include/python$py_version_short/$dist_name',
- 'scripts': '$userbase/bin',
- 'data' : '$userbase',
- }
-
- INSTALL_SCHEMES['mac_user'] = {
- 'purelib': '$usersite',
- 'platlib': '$usersite',
- 'headers': '$userbase/$py_version_short/include/$dist_name',
+ 'headers':
+ '$userbase/include/python$py_version_short$abiflags/$dist_name',
'scripts': '$userbase/bin',
'data' : '$userbase',
}
@@ -328,6 +313,11 @@ class install(Command):
py_version = sys.version.split()[0]
(prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
+ try:
+ abiflags = sys.abiflags
+ except AttributeError:
+ # sys.abiflags may not be defined on all platforms.
+ abiflags = ''
self.config_vars = {'dist_name': self.distribution.get_name(),
'dist_version': self.distribution.get_version(),
'dist_fullname': self.distribution.get_fullname(),
@@ -338,6 +328,7 @@ class install(Command):
'prefix': prefix,
'sys_exec_prefix': exec_prefix,
'exec_prefix': exec_prefix,
+ 'abiflags': abiflags,
}
if HAS_USER_SITE:
diff --git a/Lib/distutils/file_util.py b/Lib/distutils/file_util.py
index c36e7128d0..e1eb932926 100644
--- a/Lib/distutils/file_util.py
+++ b/Lib/distutils/file_util.py
@@ -130,15 +130,6 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,
if dry_run:
return (dst, 1)
- # On Mac OS, use the native file copy routine
- if os.name == 'mac':
- import macostools
- try:
- macostools.copy(src, dst, 0, preserve_times)
- except os.error as exc:
- raise DistutilsFileError(
- "could not copy '%s' to '%s': %s" % (src, dst, exc.args[-1]))
-
# If linking (hard or symbolic), use the appropriate system call
# (Unix only, of course, but that's the caller's responsibility)
elif link == 'hard':
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 9842d26c47..897b7d63d6 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -11,7 +11,6 @@ Email: <fdrake@acm.org>
__revision__ = "$Id$"
-import io
import os
import re
import sys
@@ -25,7 +24,7 @@ EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
# Path to the base directory of the project. On Windows the binary may
# live in project/PCBuild9. If we're dealing with an x64 Windows build,
# it'll live in project/PCbuild/amd64.
-project_base = os.path.dirname(os.path.realpath(sys.executable))
+project_base = os.path.dirname(os.path.abspath(sys.executable))
if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
# PC/VS7.1
@@ -49,6 +48,18 @@ def _python_build():
return False
python_build = _python_build()
+# Calculate the build qualifier flags if they are defined. Adding the flags
+# to the include and lib directories only makes sense for an installation, not
+# an in-source build.
+build_flags = ''
+try:
+ if not python_build:
+ build_flags = sys.abiflags
+except AttributeError:
+ # It's not a configure-based build, so the sys module doesn't have
+ # this attribute, which is fine.
+ pass
+
def get_python_version():
"""Return a string containing the major and minor Python version,
leaving off the patchlevel. Sample return values could be '1.5'
@@ -77,20 +88,16 @@ def get_python_inc(plat_specific=0, prefix=None):
# the build directory may not be the source directory, we
# must use "srcdir" from the makefile to find the "Include"
# directory.
- base = os.path.dirname(os.path.realpath(sys.executable))
+ base = os.path.dirname(os.path.abspath(sys.executable))
if plat_specific:
return base
else:
incdir = os.path.join(get_config_var('srcdir'), 'Include')
return os.path.normpath(incdir)
- return os.path.join(prefix, "include", "python" + get_python_version())
+ python_dir = 'python' + get_python_version() + build_flags
+ return os.path.join(prefix, "include", python_dir)
elif os.name == "nt":
return os.path.join(prefix, "include")
- elif os.name == "mac":
- if plat_specific:
- return os.path.join(prefix, "Mac", "Include")
- else:
- return os.path.join(prefix, "Include")
elif os.name == "os2":
return os.path.join(prefix, "Include")
else:
@@ -131,17 +138,6 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
return prefix
else:
return os.path.join(prefix, "Lib", "site-packages")
- elif os.name == "mac":
- if plat_specific:
- if standard_lib:
- return os.path.join(prefix, "Lib", "lib-dynload")
- else:
- return os.path.join(prefix, "Lib", "site-packages")
- else:
- if standard_lib:
- return os.path.join(prefix, "Lib")
- else:
- return os.path.join(prefix, "Lib", "site-packages")
elif os.name == "os2":
if standard_lib:
return os.path.join(prefix, "Lib")
@@ -223,10 +219,10 @@ def get_config_h_filename():
def get_makefile_filename():
"""Return full pathname of installed Makefile from the Python build."""
if python_build:
- return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
- "Makefile")
+ return os.path.join(os.path.dirname(sys.executable), "Makefile")
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
- return os.path.join(lib_dir, "config", "Makefile")
+ config_file = 'config-{}{}'.format(get_python_version(), build_flags)
+ return os.path.join(lib_dir, config_file, 'Makefile')
def parse_config_h(fp, g=None):
@@ -272,7 +268,7 @@ def parse_makefile(fn, g=None):
used instead of a new dictionary.
"""
from distutils.text_file import TextFile
- fp = TextFile(fn, strip_comments=1, skip_blanks=1, join_lines=1)
+ fp = TextFile(fn, strip_comments=1, skip_blanks=1, join_lines=1, errors="surrogateescape")
if g is None:
g = {}
@@ -301,6 +297,12 @@ def parse_makefile(fn, g=None):
else:
done[n] = v
+ # Variables with a 'PY_' prefix in the makefile. These need to
+ # be made available without that prefix through sysconfig.
+ # Special care is needed to ensure that variable expansion works, even
+ # if the expansion uses the name without a prefix.
+ renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS')
+
# do variable interpolation here
while notdone:
for name in list(notdone):
@@ -317,6 +319,16 @@ def parse_makefile(fn, g=None):
elif n in os.environ:
# do it like make: fall back to environment
item = os.environ[n]
+
+ elif n in renamed_variables:
+ if name.startswith('PY_') and name[3:] in renamed_variables:
+ item = ""
+
+ elif 'PY_' + n in notdone:
+ found = False
+
+ else:
+ item = str(done['PY_' + n])
else:
done[n] = item = ""
if found:
@@ -331,12 +343,24 @@ def parse_makefile(fn, g=None):
else:
done[name] = value
del notdone[name]
+
+ if name.startswith('PY_') \
+ and name[3:] in renamed_variables:
+
+ name = name[3:]
+ if name not in done:
+ done[name] = value
else:
# bogus variable reference; just drop it since we can't deal
del notdone[name]
fp.close()
+ # strip spurious spaces
+ for k, v in done.items():
+ if isinstance(v, str):
+ done[k] = v.strip()
+
# save the results in the global dictionary
g.update(done)
return g
@@ -386,7 +410,8 @@ def _init_posix():
# load the installed pyconfig.h:
try:
filename = get_config_h_filename()
- parse_config_h(io.open(filename), g)
+ with open(filename) as file:
+ parse_config_h(file, g)
except IOError as msg:
my_msg = "invalid Python installation: unable to open %s" % filename
if hasattr(msg, "strerror"):
@@ -443,34 +468,8 @@ def _init_nt():
g['SO'] = '.pyd'
g['EXE'] = ".exe"
g['VERSION'] = get_python_version().replace(".", "")
- g['BINDIR'] = os.path.dirname(os.path.realpath(sys.executable))
-
- global _config_vars
- _config_vars = g
-
-
-def _init_mac():
- """Initialize the module as appropriate for Macintosh systems"""
- g = {}
- # set basic install directories
- g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1)
- g['BINLIBDEST'] = get_python_lib(plat_specific=1, standard_lib=1)
-
- # XXX hmmm.. a normal install puts include files here
- g['INCLUDEPY'] = get_python_inc(plat_specific=0)
-
- import MacOS
- if not hasattr(MacOS, 'runtimemodel'):
- g['SO'] = '.ppc.slb'
- else:
- g['SO'] = '.%s.slb' % MacOS.runtimemodel
-
- # XXX are these used anywhere?
- g['install_lib'] = os.path.join(EXEC_PREFIX, "Lib")
- g['install_platlib'] = os.path.join(EXEC_PREFIX, "Mac", "Lib")
+ g['BINDIR'] = os.path.dirname(os.path.abspath(sys.executable))
- # These are used by the extension module build
- g['srcdir'] = ':'
global _config_vars
_config_vars = g
diff --git a/Lib/distutils/tests/test_bdist_msi.py b/Lib/distutils/tests/test_bdist_msi.py
new file mode 100644
index 0000000000..9308c79d91
--- /dev/null
+++ b/Lib/distutils/tests/test_bdist_msi.py
@@ -0,0 +1,25 @@
+"""Tests for distutils.command.bdist_msi."""
+import unittest
+import sys
+
+from test.support import run_unittest
+
+from distutils.tests import support
+
+@unittest.skipUnless(sys.platform=="win32", "These tests are only for win32")
+class BDistMSITestCase(support.TempdirManager,
+ support.LoggingSilencer,
+ unittest.TestCase):
+
+ def test_minimal(self):
+ # minimal test XXX need more tests
+ from distutils.command.bdist_msi import bdist_msi
+ pkg_pth, dist = self.create_dist()
+ cmd = bdist_msi(dist)
+ cmd.ensure_finalized()
+
+def test_suite():
+ return unittest.makeSuite(BDistMSITestCase)
+
+if __name__ == '__main__':
+ run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_build.py b/Lib/distutils/tests/test_build.py
new file mode 100644
index 0000000000..3391f36d4b
--- /dev/null
+++ b/Lib/distutils/tests/test_build.py
@@ -0,0 +1,55 @@
+"""Tests for distutils.command.build."""
+import unittest
+import os
+import sys
+from test.support import run_unittest
+
+from distutils.command.build import build
+from distutils.tests import support
+from sysconfig import get_platform
+
+class BuildTestCase(support.TempdirManager,
+ support.LoggingSilencer,
+ unittest.TestCase):
+
+ def test_finalize_options(self):
+ pkg_dir, dist = self.create_dist()
+ cmd = build(dist)
+ cmd.finalize_options()
+
+ # if not specified, plat_name gets the current platform
+ self.assertEqual(cmd.plat_name, get_platform())
+
+ # build_purelib is build + lib
+ wanted = os.path.join(cmd.build_base, 'lib')
+ self.assertEqual(cmd.build_purelib, wanted)
+
+ # build_platlib is 'build/lib.platform-x.x[-pydebug]'
+ # examples:
+ # build/lib.macosx-10.3-i386-2.7
+ plat_spec = '.%s-%s' % (cmd.plat_name, sys.version[0:3])
+ if hasattr(sys, 'gettotalrefcount'):
+ self.assertTrue(cmd.build_platlib.endswith('-pydebug'))
+ plat_spec += '-pydebug'
+ wanted = os.path.join(cmd.build_base, 'lib' + plat_spec)
+ self.assertEqual(cmd.build_platlib, wanted)
+
+ # by default, build_lib = build_purelib
+ self.assertEqual(cmd.build_lib, cmd.build_purelib)
+
+ # build_temp is build/temp.<plat>
+ wanted = os.path.join(cmd.build_base, 'temp' + plat_spec)
+ self.assertEqual(cmd.build_temp, wanted)
+
+ # build_scripts is build/scripts-x.x
+ wanted = os.path.join(cmd.build_base, 'scripts-' + sys.version[0:3])
+ self.assertEqual(cmd.build_scripts, wanted)
+
+ # executable is os.path.normpath(sys.executable)
+ self.assertEqual(cmd.executable, os.path.normpath(sys.executable))
+
+def test_suite():
+ return unittest.makeSuite(BuildTestCase)
+
+if __name__ == "__main__":
+ run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index 11844d66d3..dcba75f703 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -1,17 +1,16 @@
import sys
import os
-import tempfile
import shutil
from io import StringIO
-from distutils.core import Extension, Distribution
+from distutils.core import Distribution
from distutils.command.build_ext import build_ext
from distutils import sysconfig
from distutils.tests.support import TempdirManager
from distutils.tests.support import LoggingSilencer
from distutils.extension import Extension
-from distutils.errors import (UnknownFileError, DistutilsSetupError,
- CompileError)
+from distutils.errors import (
+ CompileError, DistutilsSetupError, UnknownFileError)
import unittest
from test import support
@@ -256,7 +255,8 @@ class BuildExtTestCase(TempdirManager,
cmd.finalize_options()
#'extensions' option must be a list of Extension instances
- self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, 'foo')
+ self.assertRaises(DistutilsSetupError,
+ cmd.check_extensions_list, 'foo')
# each element of 'ext_modules' option must be an
# Extension instance or 2-tuple
@@ -318,7 +318,7 @@ class BuildExtTestCase(TempdirManager,
def test_get_outputs(self):
tmp_dir = self.mkdtemp()
c_file = os.path.join(tmp_dir, 'foo.c')
- self.write_file(c_file, 'void PyInit_foo(void) {};\n')
+ self.write_file(c_file, 'void PyInit_foo(void) {}\n')
ext = Extension('foo', [c_file], optional=False)
dist = Distribution({'name': 'xx',
'ext_modules': [ext]})
@@ -345,8 +345,8 @@ class BuildExtTestCase(TempdirManager,
finally:
os.chdir(old_wd)
self.assertTrue(os.path.exists(so_file))
- self.assertEqual(os.path.splitext(so_file)[-1],
- sysconfig.get_config_var('SO'))
+ so_ext = sysconfig.get_config_var('SO')
+ self.assertTrue(so_file.endswith(so_ext))
so_dir = os.path.dirname(so_file)
self.assertEqual(so_dir, other_tmp_dir)
@@ -355,8 +355,7 @@ class BuildExtTestCase(TempdirManager,
cmd.run()
so_file = cmd.get_outputs()[0]
self.assertTrue(os.path.exists(so_file))
- self.assertEqual(os.path.splitext(so_file)[-1],
- sysconfig.get_config_var('SO'))
+ self.assertTrue(so_file.endswith(so_ext))
so_dir = os.path.dirname(so_file)
self.assertEqual(so_dir, cmd.build_lib)
diff --git a/Lib/distutils/tests/test_dep_util.py b/Lib/distutils/tests/test_dep_util.py
new file mode 100644
index 0000000000..3e1c366892
--- /dev/null
+++ b/Lib/distutils/tests/test_dep_util.py
@@ -0,0 +1,81 @@
+"""Tests for distutils.dep_util."""
+import unittest
+import os
+import time
+
+from distutils.dep_util import newer, newer_pairwise, newer_group
+from distutils.errors import DistutilsFileError
+from distutils.tests import support
+from test.support import run_unittest
+
+class DepUtilTestCase(support.TempdirManager, unittest.TestCase):
+
+ def test_newer(self):
+
+ tmpdir = self.mkdtemp()
+ new_file = os.path.join(tmpdir, 'new')
+ old_file = os.path.abspath(__file__)
+
+ # Raise DistutilsFileError if 'new_file' does not exist.
+ self.assertRaises(DistutilsFileError, newer, new_file, old_file)
+
+ # Return true if 'new_file' exists and is more recently modified than
+ # 'old_file', or if 'new_file' exists and 'old_file' doesn't.
+ self.write_file(new_file)
+ self.assertTrue(newer(new_file, 'I_dont_exist'))
+ self.assertTrue(newer(new_file, old_file))
+
+ # Return false if both exist and 'old_file' is the same age or younger
+ # than 'new_file'.
+ self.assertFalse(newer(old_file, new_file))
+
+ def test_newer_pairwise(self):
+ tmpdir = self.mkdtemp()
+ sources = os.path.join(tmpdir, 'sources')
+ targets = os.path.join(tmpdir, 'targets')
+ os.mkdir(sources)
+ os.mkdir(targets)
+ one = os.path.join(sources, 'one')
+ two = os.path.join(sources, 'two')
+ three = os.path.abspath(__file__) # I am the old file
+ four = os.path.join(targets, 'four')
+ self.write_file(one)
+ self.write_file(two)
+ self.write_file(four)
+
+ self.assertEqual(newer_pairwise([one, two], [three, four]),
+ ([one],[three]))
+
+ def test_newer_group(self):
+ tmpdir = self.mkdtemp()
+ sources = os.path.join(tmpdir, 'sources')
+ os.mkdir(sources)
+ one = os.path.join(sources, 'one')
+ two = os.path.join(sources, 'two')
+ three = os.path.join(sources, 'three')
+ old_file = os.path.abspath(__file__)
+
+ # return true if 'old_file' is out-of-date with respect to any file
+ # listed in 'sources'.
+ self.write_file(one)
+ self.write_file(two)
+ self.write_file(three)
+ self.assertTrue(newer_group([one, two, three], old_file))
+ self.assertFalse(newer_group([one, two, old_file], three))
+
+ # missing handling
+ os.remove(one)
+ self.assertRaises(OSError, newer_group, [one, two, old_file], three)
+
+ self.assertFalse(newer_group([one, two, old_file], three,
+ missing='ignore'))
+
+ self.assertTrue(newer_group([one, two, old_file], three,
+ missing='newer'))
+
+
+def test_suite():
+ return unittest.makeSuite(DepUtilTestCase)
+
+if __name__ == "__main__":
+ run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py
index 1624f00e53..a20d6c8ffc 100644
--- a/Lib/distutils/tests/test_dist.py
+++ b/Lib/distutils/tests/test_dist.py
@@ -1,4 +1,3 @@
-# -*- coding: utf8 -*-
"""Tests for distutils.dist."""
import os
import io
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py
index 41414bb52e..fbe26bf65d 100644
--- a/Lib/distutils/tests/test_sysconfig.py
+++ b/Lib/distutils/tests/test_sysconfig.py
@@ -83,7 +83,7 @@ class SysconfigTestCase(support.EnvironGuard,
fd.close()
d = sysconfig.parse_makefile(self.makefile)
self.assertEqual(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'",
- 'OTHER': 'foo'})
+ 'OTHER': 'foo'})
def test_parse_makefile_literal_dollar(self):
self.makefile = TESTFN
@@ -98,6 +98,15 @@ class SysconfigTestCase(support.EnvironGuard,
'OTHER': 'foo'})
+ def test_sysconfig_module(self):
+ import sysconfig as global_sysconfig
+ self.assertEqual(global_sysconfig.get_config_var('CFLAGS'), sysconfig.get_config_var('CFLAGS'))
+ self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'), sysconfig.get_config_var('LDFLAGS'))
+ self.assertEqual(global_sysconfig.get_config_var('LDSHARED'),sysconfig.get_config_var('LDSHARED'))
+ self.assertEqual(global_sysconfig.get_config_var('CC'), sysconfig.get_config_var('CC'))
+
+
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(SysconfigTestCase))
diff --git a/Lib/distutils/text_file.py b/Lib/distutils/text_file.py
index 97459fbf73..454725c626 100644
--- a/Lib/distutils/text_file.py
+++ b/Lib/distutils/text_file.py
@@ -58,6 +58,8 @@ class TextFile:
collapse_join [default: false]
strip leading whitespace from lines that are joined to their
predecessor; only matters if (join_lines and not lstrip_ws)
+ errors [default: 'strict']
+ error handler used to decode the file content
Note that since 'rstrip_ws' can strip the trailing newline, the
semantics of 'readline()' must differ from those of the builtin file
@@ -72,6 +74,7 @@ class TextFile:
'rstrip_ws': 1,
'join_lines': 0,
'collapse_join': 0,
+ 'errors': 'strict',
}
def __init__(self, filename=None, file=None, **options):
@@ -111,7 +114,7 @@ class TextFile:
"""Open a new file named 'filename'. This overrides both the
'filename' and 'file' arguments to the constructor."""
self.filename = filename
- self.file = io.open(self.filename, 'r')
+ self.file = io.open(self.filename, 'r', errors=self.errors)
self.current_line = 0
def close(self):
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index 3081245b62..ce3cd6ca33 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -235,15 +235,6 @@ def change_root (new_root, pathname):
path = path[1:]
return os.path.join(new_root, path)
- elif os.name == 'mac':
- if not os.path.isabs(pathname):
- return os.path.join(new_root, pathname)
- else:
- # Chop off volume name from start of path
- elements = pathname.split(":", 1)
- pathname = ":" + elements[1]
- return os.path.join(new_root, pathname)
-
else:
raise DistutilsPlatformError("nothing known about platform '%s'" % os.name)
diff --git a/Lib/doctest.py b/Lib/doctest.py
index fae333e4f6..9eba4e0b50 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -318,7 +318,8 @@ class _OutputRedirectingPdb(pdb.Pdb):
def __init__(self, out):
self.__out = out
self.__debugger_used = False
- pdb.Pdb.__init__(self, stdout=out)
+ # do not play signal games in the pdb
+ pdb.Pdb.__init__(self, stdout=out, nosigint=True)
# still use input() to get user input
self.use_rawinput = 1
@@ -1280,9 +1281,9 @@ class DocTestRunner:
# Another chance if they didn't care about the detail.
elif self.optionflags & IGNORE_EXCEPTION_DETAIL:
- m1 = re.match(r'[^:]*:', example.exc_msg)
- m2 = re.match(r'[^:]*:', exc_msg)
- if m1 and m2 and check(m1.group(0), m2.group(0),
+ m1 = re.match(r'(?:[^:]*\.)?([^:]*:)', example.exc_msg)
+ m2 = re.match(r'(?:[^:]*\.)?([^:]*:)', exc_msg)
+ if m1 and m2 and check(m1.group(1), m2.group(1),
self.optionflags):
outcome = SUCCESS
@@ -1320,7 +1321,7 @@ class DocTestRunner:
self.tries += t
__LINECACHE_FILENAME_RE = re.compile(r'<doctest '
- r'(?P<name>[\w\.]+)'
+ r'(?P<name>.+)'
r'\[(?P<examplenum>\d+)\]>$')
def __patched_linecache_getlines(self, filename, module_globals=None):
m = self.__LINECACHE_FILENAME_RE.match(filename)
@@ -2207,6 +2208,19 @@ class DocTestCase(unittest.TestCase):
def shortDescription(self):
return "Doctest: " + self._dt_test.name
+class SkipDocTestCase(DocTestCase):
+ def __init__(self):
+ DocTestCase.__init__(self, None)
+
+ def setUp(self):
+ self.skipTest("DocTestSuite will not work with -O2 and above")
+
+ def test_skip(self):
+ pass
+
+ def shortDescription(self):
+ return "Skipping tests from %s" % module.__name__
+
def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
**options):
"""
@@ -2249,13 +2263,20 @@ def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
module = _normalize_module(module)
tests = test_finder.find(module, globs=globs, extraglobs=extraglobs)
- if not tests:
+
+ if not tests and sys.flags.optimize >=2:
+ # Skip doctests when running with -O2
+ suite = unittest.TestSuite()
+ suite.addTest(SkipDocTestCase())
+ return suite
+ elif not tests:
# Why do we want to do this? Because it reveals a bug that might
# otherwise be hidden.
raise ValueError(module, "has no tests")
tests.sort()
suite = unittest.TestSuite()
+
for test in tests:
if len(test.examples) == 0:
continue
@@ -2508,14 +2529,16 @@ def debug_script(src, pm=False, globs=None):
exec(f.read(), globs, globs)
except:
print(sys.exc_info()[1])
- pdb.post_mortem(sys.exc_info()[2])
+ p = pdb.Pdb(nosigint=True)
+ p.reset()
+ p.interaction(None, sys.exc_info()[2])
else:
fp = open(srcfilename)
try:
script = fp.read()
finally:
fp.close()
- pdb.run("exec(%r)" % script, globs, globs)
+ pdb.Pdb(nosigint=True).run("exec(%r)" % script, globs, globs)
finally:
os.remove(srcfilename)
diff --git a/Lib/email/__init__.py b/Lib/email/__init__.py
index 8702212080..bd316fdaf3 100644
--- a/Lib/email/__init__.py
+++ b/Lib/email/__init__.py
@@ -4,7 +4,7 @@
"""A package for parsing, handling, and generating email messages."""
-__version__ = '5.0.0'
+__version__ = '5.1.0'
__all__ = [
'base64mime',
@@ -16,7 +16,9 @@ __all__ = [
'iterators',
'message',
'message_from_file',
+ 'message_from_binary_file',
'message_from_string',
+ 'message_from_bytes',
'mime',
'parser',
'quoprimime',
@@ -36,6 +38,13 @@ def message_from_string(s, *args, **kws):
from email.parser import Parser
return Parser(*args, **kws).parsestr(s)
+def message_from_bytes(s, *args, **kws):
+ """Parse a bytes string into a Message object model.
+
+ Optional _class and strict are passed to the Parser constructor.
+ """
+ from email.parser import BytesParser
+ return BytesParser(*args, **kws).parsebytes(s)
def message_from_file(fp, *args, **kws):
"""Read a file and parse its contents into a Message object model.
@@ -44,3 +53,11 @@ def message_from_file(fp, *args, **kws):
"""
from email.parser import Parser
return Parser(*args, **kws).parse(fp)
+
+def message_from_binary_file(fp, *args, **kws):
+ """Read a binary file and parse its contents into a Message object model.
+
+ Optional _class and strict are passed to the Parser constructor.
+ """
+ from email.parser import BytesParser
+ return BytesParser(*args, **kws).parse(fp)
diff --git a/Lib/email/_parseaddr.py b/Lib/email/_parseaddr.py
index 3bd4ba4403..41694f9b1a 100644
--- a/Lib/email/_parseaddr.py
+++ b/Lib/email/_parseaddr.py
@@ -64,8 +64,10 @@ def parsedate_tz(data):
if len(data) == 4:
s = data[3]
i = s.find('+')
+ if i == -1:
+ i = s.find('-')
if i > 0:
- data[3:] = [s[:i], s[i+1:]]
+ data[3:] = [s[:i], s[i:]]
else:
data.append('') # Dummy tz
if len(data) < 5:
@@ -199,14 +201,18 @@ class AddrlistClass:
self.commentlist = []
def gotonext(self):
- """Parse up to the start of the next address."""
+ """Skip white space and extract comments."""
+ wslist = []
while self.pos < len(self.field):
if self.field[self.pos] in self.LWS + '\n\r':
+ if self.field[self.pos] not in '\n\r':
+ wslist.append(self.field[self.pos])
self.pos += 1
elif self.field[self.pos] == '(':
self.commentlist.append(self.getcomment())
else:
break
+ return EMPTYSTRING.join(wslist)
def getaddrlist(self):
"""Parse all addresses.
@@ -319,16 +325,24 @@ class AddrlistClass:
self.gotonext()
while self.pos < len(self.field):
+ preserve_ws = True
if self.field[self.pos] == '.':
+ if aslist and not aslist[-1].strip():
+ aslist.pop()
aslist.append('.')
self.pos += 1
+ preserve_ws = False
elif self.field[self.pos] == '"':
aslist.append('"%s"' % quote(self.getquote()))
elif self.field[self.pos] in self.atomends:
+ if aslist and not aslist[-1].strip():
+ aslist.pop()
break
else:
aslist.append(self.getatom())
- self.gotonext()
+ ws = self.gotonext()
+ if preserve_ws and ws:
+ aslist.append(ws)
if self.pos >= len(self.field) or self.field[self.pos] != '@':
return EMPTYSTRING.join(aslist)
diff --git a/Lib/email/base64mime.py b/Lib/email/base64mime.py
index 28e2542520..f3bbac1caf 100644
--- a/Lib/email/base64mime.py
+++ b/Lib/email/base64mime.py
@@ -20,7 +20,7 @@ in To:, From:, Cc:, etc. fields, as well as Subject: lines.
This module does not do the line wrapping or end-of-line character conversion
necessary for proper internationalized headers; it only does dumb encoding and
-decoding. To deal with the various line wrapping issues, use the email.Header
+decoding. To deal with the various line wrapping issues, use the email.header
module.
"""
@@ -74,12 +74,12 @@ def header_encode(header_bytes, charset='iso-8859-1'):
def body_encode(s, maxlinelen=76, eol=NL):
- """Encode a string with base64.
+ r"""Encode a string with base64.
Each line will be wrapped at, at most, maxlinelen characters (defaults to
76 characters).
- Each line of encoded text will end with eol, which defaults to "\\n". Set
+ Each line of encoded text will end with eol, which defaults to "\n". Set
this to "\r\n" if you will be using the result of this function directly
in an email.
"""
@@ -104,7 +104,7 @@ def decode(string):
This function does not parse a full MIME header value encoded with
base64 (like =?iso-8895-1?b?bmloISBuaWgh?=) -- please use the high
- level email.Header class for that functionality.
+ level email.header class for that functionality.
"""
if not string:
return bytes()
diff --git a/Lib/email/charset.py b/Lib/email/charset.py
index 898beedb00..f22be2c52c 100644
--- a/Lib/email/charset.py
+++ b/Lib/email/charset.py
@@ -28,6 +28,7 @@ SHORTEST = 3 # the shorter of QP and base64, but only for headers
RFC2047_CHROME_LEN = 7
DEFAULT_CHARSET = 'us-ascii'
+UNKNOWN8BIT = 'unknown-8bit'
EMPTYSTRING = ''
@@ -153,6 +154,16 @@ def add_codec(charset, codecname):
+# Convenience function for encoding strings, taking into account
+# that they might be unknown-8bit (ie: have surrogate-escaped bytes)
+def _encode(string, codec):
+ if codec == UNKNOWN8BIT:
+ return string.encode('ascii', 'surrogateescape')
+ else:
+ return string.encode(codec)
+
+
+
class Charset:
"""Map character sets to their email properties.
@@ -252,7 +263,7 @@ class Charset:
Returns "quoted-printable" if self.body_encoding is QP.
Returns "base64" if self.body_encoding is BASE64.
- Returns "7bit" otherwise.
+ Returns conversion function otherwise.
"""
assert self.body_encoding != SHORTEST
if self.body_encoding == QP:
@@ -282,8 +293,7 @@ class Charset:
:return: The encoded string, with RFC 2047 chrome.
"""
codec = self.output_codec or 'us-ascii'
- charset = self.get_output_charset()
- header_bytes = string.encode(codec)
+ header_bytes = _encode(string, codec)
# 7bit/8bit encodings return the string unchanged (modulo conversions)
encoder_module = self._get_encoder(header_bytes)
if encoder_module is None:
@@ -309,9 +319,9 @@ class Charset:
"""
# See which encoding we should use.
codec = self.output_codec or 'us-ascii'
- header_bytes = string.encode(codec)
+ header_bytes = _encode(string, codec)
encoder_module = self._get_encoder(header_bytes)
- encoder = partial(encoder_module.header_encode, charset=str(self))
+ encoder = partial(encoder_module.header_encode, charset=codec)
# Calculate the number of characters that the RFC 2047 chrome will
# contribute to each line.
charset = self.get_output_charset()
@@ -333,7 +343,7 @@ class Charset:
for character in string:
current_line.append(character)
this_line = EMPTYSTRING.join(current_line)
- length = encoder_module.header_length(this_line.encode(charset))
+ length = encoder_module.header_length(_encode(this_line, charset))
if length > maxlen:
# This last character doesn't fit so pop it off.
current_line.pop()
@@ -343,12 +353,12 @@ class Charset:
else:
separator = (' ' if lines else '')
joined_line = EMPTYSTRING.join(current_line)
- header_bytes = joined_line.encode(codec)
+ header_bytes = _encode(joined_line, codec)
lines.append(encoder(header_bytes))
current_line = [character]
maxlen = next(maxlengths) - extra
joined_line = EMPTYSTRING.join(current_line)
- header_bytes = joined_line.encode(codec)
+ header_bytes = _encode(joined_line, codec)
lines.append(encoder(header_bytes))
return lines
@@ -371,7 +381,10 @@ class Charset:
"""Body-encode a string by converting it first to bytes.
The type of encoding (base64 or quoted-printable) will be based on
- self.body_encoding.
+ self.body_encoding. If body_encoding is None, we assume the
+ output charset is a 7bit encoding, so re-encoding the decoded
+ string using the ascii codec produces the correct string version
+ of the content.
"""
# 7bit/8bit encodings return the string unchanged (module conversions)
if self.body_encoding is BASE64:
@@ -381,4 +394,6 @@ class Charset:
elif self.body_encoding is QP:
return email.quoprimime.body_encode(string)
else:
+ if isinstance(string, str):
+ string = string.encode(self.output_charset).decode('ascii')
return string
diff --git a/Lib/email/encoders.py b/Lib/email/encoders.py
index dfaac58204..e5c099f35a 100644
--- a/Lib/email/encoders.py
+++ b/Lib/email/encoders.py
@@ -54,10 +54,13 @@ def encode_7or8bit(msg):
# There's no payload. For backwards compatibility we use 7bit
msg['Content-Transfer-Encoding'] = '7bit'
return
- # We play a trick to make this go fast. If encoding to ASCII succeeds, we
- # know the data must be 7bit, otherwise treat it as 8bit.
+ # We play a trick to make this go fast. If encoding/decode to ASCII
+ # succeeds, we know the data must be 7bit, otherwise treat it as 8bit.
try:
- orig.encode('ascii')
+ if isinstance(orig, str):
+ orig.encode('ascii')
+ else:
+ orig.decode('ascii')
except UnicodeError:
# iso-2022-* is non-ASCII but still 7-bit
charset = msg.get_charset()
diff --git a/Lib/email/feedparser.py b/Lib/email/feedparser.py
index 8db70b3c36..60a83255c0 100644
--- a/Lib/email/feedparser.py
+++ b/Lib/email/feedparser.py
@@ -368,12 +368,12 @@ class FeedParser:
end = len(mo.group(0))
self._last.epilogue = epilogue[:-end]
else:
- payload = self._last.get_payload()
+ payload = self._last._payload
if isinstance(payload, str):
mo = NLCRE_eol.search(payload)
if mo:
payload = payload[:-len(mo.group(0))]
- self._last.set_payload(payload)
+ self._last._payload = payload
self._input.pop_eof_matcher()
self._pop_message()
# Set the multipart up for newline cleansing, which will
@@ -482,3 +482,10 @@ class FeedParser:
if lastheader:
# XXX reconsider the joining of folded lines
self._cur[lastheader] = EMPTYSTRING.join(lastvalue).rstrip('\r\n')
+
+
+class BytesFeedParser(FeedParser):
+ """Like FeedParser, but feed accepts bytes."""
+
+ def feed(self, data):
+ super().feed(data.decode('ascii', 'surrogateescape'))
diff --git a/Lib/email/generator.py b/Lib/email/generator.py
index cc30affad9..f0e7a95477 100644
--- a/Lib/email/generator.py
+++ b/Lib/email/generator.py
@@ -12,11 +12,12 @@ import time
import random
import warnings
-from io import StringIO
+from io import StringIO, BytesIO
from email.header import Header
+from email.message import _has_surrogates
UNDERSCORE = '_'
-NL = '\n'
+NL = '\n' # XXX: no longer used by the code below.
fcre = re.compile(r'^From ', re.MULTILINE)
@@ -57,8 +58,8 @@ class Generator:
# Just delegate to the file object
self._fp.write(s)
- def flatten(self, msg, unixfrom=False):
- """Print the message object tree rooted at msg to the output file
+ def flatten(self, msg, unixfrom=False, linesep='\n'):
+ r"""Print the message object tree rooted at msg to the output file
specified when the Generator instance was created.
unixfrom is a flag that forces the printing of a Unix From_ delimiter
@@ -67,12 +68,26 @@ class Generator:
is False to inhibit the printing of any From_ delimiter.
Note that for subobjects, no From_ line is printed.
+
+ linesep specifies the characters used to indicate a new line in
+ the output. The default value is the most useful for typical
+ Python applications, but it can be set to \r\n to produce RFC-compliant
+ line separators when needed.
+
"""
+ # We use the _XXX constants for operating on data that comes directly
+ # from the msg, and _encoded_XXX constants for operating on data that
+ # has already been converted (to bytes in the BytesGenerator) and
+ # inserted into a temporary buffer.
+ self._NL = linesep
+ self._encoded_NL = self._encode(linesep)
+ self._EMPTY = ''
+ self._encoded_EMTPY = self._encode('')
if unixfrom:
ufrom = msg.get_unixfrom()
if not ufrom:
ufrom = 'From nobody ' + time.ctime(time.time())
- print(ufrom, file=self._fp)
+ self.write(ufrom + self._NL)
self._write(msg)
def clone(self, fp):
@@ -83,6 +98,27 @@ class Generator:
# Protected interface - undocumented ;/
#
+ # Note that we use 'self.write' when what we are writing is coming from
+ # the source, and self._fp.write when what we are writing is coming from a
+ # buffer (because the Bytes subclass has already had a chance to transform
+ # the data in its write method in that case). This is an entirely
+ # pragmatic split determined by experiment; we could be more general by
+ # always using write and having the Bytes subclass write method detect when
+ # it has already transformed the input; but, since this whole thing is a
+ # hack anyway this seems good enough.
+
+ # Similarly, we have _XXX and _encoded_XXX attributes that are used on
+ # source and buffer data, respectively.
+ _encoded_EMPTY = ''
+
+ def _new_buffer(self):
+ # BytesGenerator overrides this to return BytesIO.
+ return StringIO()
+
+ def _encode(self, s):
+ # BytesGenerator overrides this to encode strings to bytes.
+ return s
+
def _write(self, msg):
# We can't write the headers yet because of the following scenario:
# say a multipart message includes the boundary string somewhere in
@@ -91,13 +127,13 @@ class Generator:
# parameter.
#
# The way we do this, so as to make the _handle_*() methods simpler,
- # is to cache any subpart writes into a StringIO. The we write the
- # headers and the StringIO contents. That way, subpart handlers can
+ # is to cache any subpart writes into a buffer. The we write the
+ # headers and the buffer contents. That way, subpart handlers can
# Do The Right Thing, and can still modify the Content-Type: header if
# necessary.
oldfp = self._fp
try:
- self._fp = sfp = StringIO()
+ self._fp = sfp = self._new_buffer()
self._dispatch(msg)
finally:
self._fp = oldfp
@@ -132,16 +168,17 @@ class Generator:
def _write_headers(self, msg):
for h, v in msg.items():
- print('%s:' % h, end=' ', file=self._fp)
+ self.write('%s: ' % h)
if isinstance(v, Header):
- print(v.encode(maxlinelen=self._maxheaderlen), file=self._fp)
+ self.write(v.encode(
+ maxlinelen=self._maxheaderlen, linesep=self._NL)+self._NL)
else:
# Header's got lots of smarts, so use it.
header = Header(v, maxlinelen=self._maxheaderlen,
header_name=h)
- print(header.encode(), file=self._fp)
+ self.write(header.encode(linesep=self._NL)+self._NL)
# A blank line always separates headers from body
- print(file=self._fp)
+ self.write(self._NL)
#
# Handlers for writing types and subtypes
@@ -153,9 +190,15 @@ class Generator:
return
if not isinstance(payload, str):
raise TypeError('string payload expected: %s' % type(payload))
+ if _has_surrogates(msg._payload):
+ charset = msg.get_param('charset')
+ if charset is not None:
+ del msg['content-transfer-encoding']
+ msg.set_payload(payload, charset)
+ payload = msg.get_payload()
if self._mangle_from_:
payload = fcre.sub('>From ', payload)
- self._fp.write(payload)
+ self.write(payload)
# Default body handler
_writeBody = _handle_text
@@ -170,29 +213,29 @@ class Generator:
subparts = []
elif isinstance(subparts, str):
# e.g. a non-strict parse of a message with no starting boundary.
- self._fp.write(subparts)
+ self.write(subparts)
return
elif not isinstance(subparts, list):
# Scalar payload
subparts = [subparts]
for part in subparts:
- s = StringIO()
+ s = self._new_buffer()
g = self.clone(s)
- g.flatten(part, unixfrom=False)
+ g.flatten(part, unixfrom=False, linesep=self._NL)
msgtexts.append(s.getvalue())
# BAW: What about boundaries that are wrapped in double-quotes?
boundary = msg.get_boundary()
if not boundary:
# Create a boundary that doesn't appear in any of the
# message texts.
- alltext = NL.join(msgtexts)
- boundary = _make_boundary(alltext)
+ alltext = self._encoded_NL.join(msgtexts)
+ boundary = self._make_boundary(alltext)
msg.set_boundary(boundary)
# If there's a preamble, write it out, with a trailing CRLF
if msg.preamble is not None:
- print(msg.preamble, file=self._fp)
+ self.write(msg.preamble + self._NL)
# dash-boundary transport-padding CRLF
- print('--' + boundary, file=self._fp)
+ self.write('--' + boundary + self._NL)
# body-part
if msgtexts:
self._fp.write(msgtexts.pop(0))
@@ -201,14 +244,14 @@ class Generator:
# --> CRLF body-part
for body_part in msgtexts:
# delimiter transport-padding CRLF
- print('\n--' + boundary, file=self._fp)
+ self.write(self._NL + '--' + boundary + self._NL)
# body-part
self._fp.write(body_part)
# close-delimiter transport-padding
- self._fp.write('\n--' + boundary + '--')
+ self.write(self._NL + '--' + boundary + '--')
if msg.epilogue is not None:
- print(file=self._fp)
- self._fp.write(msg.epilogue)
+ self.write(self._NL)
+ self.write(msg.epilogue)
def _handle_multipart_signed(self, msg):
# The contents of signed parts has to stay unmodified in order to keep
@@ -227,23 +270,23 @@ class Generator:
# block and the boundary. Sigh.
blocks = []
for part in msg.get_payload():
- s = StringIO()
+ s = self._new_buffer()
g = self.clone(s)
- g.flatten(part, unixfrom=False)
+ g.flatten(part, unixfrom=False, linesep=self._NL)
text = s.getvalue()
- lines = text.split('\n')
+ lines = text.split(self._encoded_NL)
# Strip off the unnecessary trailing empty line
- if lines and lines[-1] == '':
- blocks.append(NL.join(lines[:-1]))
+ if lines and lines[-1] == self._encoded_EMPTY:
+ blocks.append(self._encoded_NL.join(lines[:-1]))
else:
blocks.append(text)
# Now join all the blocks with an empty line. This has the lovely
# effect of separating each block with an empty line, but not adding
# an extra one after the last one.
- self._fp.write(NL.join(blocks))
+ self._fp.write(self._encoded_NL.join(blocks))
def _handle_message(self, msg):
- s = StringIO()
+ s = self._new_buffer()
g = self.clone(s)
# The payload of a message/rfc822 part should be a multipart sequence
# of length 1. The zeroth element of the list should be the Message
@@ -256,10 +299,98 @@ class Generator:
# in that case we just emit the string body.
payload = msg.get_payload()
if isinstance(payload, list):
- g.flatten(msg.get_payload(0), unixfrom=False)
+ g.flatten(msg.get_payload(0), unixfrom=False, linesep=self._NL)
payload = s.getvalue()
self._fp.write(payload)
+ # This used to be a module level function; we use a classmethod for this
+ # and _compile_re so we can continue to provide the module level function
+ # for backward compatibility by doing
+ # _make_boudary = Generator._make_boundary
+ # at the end of the module. It *is* internal, so we could drop that...
+ @classmethod
+ def _make_boundary(cls, text=None):
+ # Craft a random boundary. If text is given, ensure that the chosen
+ # boundary doesn't appear in the text.
+ token = random.randrange(sys.maxsize)
+ boundary = ('=' * 15) + (_fmt % token) + '=='
+ if text is None:
+ return boundary
+ b = boundary
+ counter = 0
+ while True:
+ cre = cls._compile_re('^--' + re.escape(b) + '(--)?$', re.MULTILINE)
+ if not cre.search(text):
+ break
+ b = boundary + '.' + str(counter)
+ counter += 1
+ return b
+
+ @classmethod
+ def _compile_re(cls, s, flags):
+ return re.compile(s, flags)
+
+
+class BytesGenerator(Generator):
+ """Generates a bytes version of a Message object tree.
+
+ Functionally identical to the base Generator except that the output is
+ bytes and not string. When surrogates were used in the input to encode
+ bytes, these are decoded back to bytes for output.
+
+ The outfp object must accept bytes in its write method.
+ """
+
+ # Bytes versions of this constant for use in manipulating data from
+ # the BytesIO buffer.
+ _encoded_EMPTY = b''
+
+ def write(self, s):
+ self._fp.write(s.encode('ascii', 'surrogateescape'))
+
+ def _new_buffer(self):
+ return BytesIO()
+
+ def _encode(self, s):
+ return s.encode('ascii')
+
+ def _write_headers(self, msg):
+ # This is almost the same as the string version, except for handling
+ # strings with 8bit bytes.
+ for h, v in msg._headers:
+ self.write('%s: ' % h)
+ if isinstance(v, Header):
+ self.write(v.encode(maxlinelen=self._maxheaderlen)+NL)
+ elif _has_surrogates(v):
+ # If we have raw 8bit data in a byte string, we have no idea
+ # what the encoding is. There is no safe way to split this
+ # string. If it's ascii-subset, then we could do a normal
+ # ascii split, but if it's multibyte then we could break the
+ # string. There's no way to know so the least harm seems to
+ # be to not split the string and risk it being too long.
+ self.write(v+NL)
+ else:
+ # Header's got lots of smarts and this string is safe...
+ header = Header(v, maxlinelen=self._maxheaderlen,
+ header_name=h)
+ self.write(header.encode(linesep=self._NL)+self._NL)
+ # A blank line always separates headers from body
+ self.write(self._NL)
+
+ def _handle_text(self, msg):
+ # If the string has surrogates the original source was bytes, so
+ # just write it back out.
+ if msg._payload is None:
+ return
+ if _has_surrogates(msg._payload):
+ self.write(msg._payload)
+ else:
+ super(BytesGenerator,self)._handle_text(msg)
+
+ @classmethod
+ def _compile_re(cls, s, flags):
+ return re.compile(s.encode('ascii'), flags)
+
_FMT = '[Non-text (%(type)s) part of message omitted, filename %(filename)s]'
@@ -320,23 +451,9 @@ class DecodedGenerator(Generator):
-# Helper
+# Helper used by Generator._make_boundary
_width = len(repr(sys.maxsize-1))
_fmt = '%%0%dd' % _width
-def _make_boundary(text=None):
- # Craft a random boundary. If text is given, ensure that the chosen
- # boundary doesn't appear in the text.
- token = random.randrange(sys.maxsize)
- boundary = ('=' * 15) + (_fmt % token) + '=='
- if text is None:
- return boundary
- b = boundary
- counter = 0
- while True:
- cre = re.compile('^--' + re.escape(b) + '(--)?$', re.MULTILINE)
- if not cre.search(text):
- break
- b = boundary + '.' + str(counter)
- counter += 1
- return b
+# Backward compatibility
+_make_boundary = Generator._make_boundary
diff --git a/Lib/email/header.py b/Lib/email/header.py
index d1fd9a0138..0a66df54ae 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -17,7 +17,8 @@ import email.quoprimime
import email.base64mime
from email.errors import HeaderParseError
-from email.charset import Charset
+from email import charset as _charset
+Charset = _charset.Charset
NL = '\n'
SPACE = ' '
@@ -25,6 +26,7 @@ BSPACE = b' '
SPACE8 = ' ' * 8
EMPTYSTRING = ''
MAXLINELEN = 78
+FWS = ' \t'
USASCII = Charset('us-ascii')
UTF8 = Charset('utf-8')
@@ -65,9 +67,15 @@ def decode_header(header):
otherwise a lower-case string containing the name of the character set
specified in the encoded string.
- An email.Errors.HeaderParseError may be raised when certain decoding error
+ header may be a string that may or may not contain RFC2047 encoded words,
+ or it may be a Header object.
+
+ An email.errors.HeaderParseError may be raised when certain decoding error
occurs (e.g. a base64 decoding exception).
"""
+ # If it is a Header object, we can just return the chunks.
+ if hasattr(header, '_chunks'):
+ return list(header._chunks)
# If no encoding, just return the header with no charset.
if not ecre.search(header):
return [(header, None)]
@@ -214,6 +222,9 @@ class Header:
# from a charset to None/us-ascii, or from None/us-ascii to a
# charset. Only do this for the second and subsequent chunks.
nextcs = charset
+ if nextcs == _charset.UNKNOWN8BIT:
+ original_bytes = string.encode('ascii', 'surrogateescape')
+ string = original_bytes.decode('ascii', 'replace')
if uchunks:
if lastcs not in (None, 'us-ascii'):
if nextcs in (None, 'us-ascii'):
@@ -267,11 +278,12 @@ class Header:
# Ensure that the bytes we're storing can be decoded to the output
# character set, otherwise an early error is thrown.
output_charset = charset.output_codec or 'us-ascii'
- s.encode(output_charset, errors)
+ if output_charset != _charset.UNKNOWN8BIT:
+ s.encode(output_charset, errors)
self._chunks.append((s, charset))
- def encode(self, splitchars=';, \t', maxlinelen=None):
- """Encode a message header into an RFC-compliant format.
+ def encode(self, splitchars=';, \t', maxlinelen=None, linesep='\n'):
+ r"""Encode a message header into an RFC-compliant format.
There are many issues involved in converting a given string for use in
an email header. Only certain character sets are readable in most
@@ -288,9 +300,20 @@ class Header:
name was specified at Header construction time. The default value for
maxlinelen is determined at header construction time.
- Optional splitchars is a string containing characters to split long
- ASCII lines on, in rough support of RFC 2822's `highest level
- syntactic breaks'. This doesn't affect RFC 2047 encoded lines.
+ Optional splitchars is a string containing characters which should be
+ given extra weight by the splitting algorithm during normal header
+ wrapping. This is in very rough support of RFC 2822's `higher level
+ syntactic breaks': split points preceded by a splitchar are preferred
+ during line splitting, with the characters preferred in the order in
+ which they appear in the string. Space and tab may be included in the
+ string to indicate whether preference should be given to one over the
+ other as a split point when other split chars do not appear in the line
+ being split. Splitchars does not affect RFC 2047 encoded lines.
+
+ Optional linesep is a string to be used to separate the lines of
+ the value. The default value is the most useful for typical
+ Python applications, but it can be set to \r\n to produce RFC-compliant
+ line separators when needed.
"""
self._normalize()
if maxlinelen is None:
@@ -304,17 +327,23 @@ class Header:
self._continuation_ws, splitchars)
for string, charset in self._chunks:
lines = string.splitlines()
- formatter.feed(lines[0] if lines else '', charset)
+ if lines:
+ formatter.feed('', lines[0], charset)
+ else:
+ formatter.feed('', '', charset)
for line in lines[1:]:
formatter.newline()
if charset.header_encoding is not None:
- formatter.feed(self._continuation_ws, USASCII)
- line = ' ' + line.lstrip()
- formatter.feed(line, charset)
+ formatter.feed(self._continuation_ws, ' ' + line.lstrip(),
+ charset)
+ else:
+ sline = line.lstrip()
+ fws = line[:len(line)-len(sline)]
+ formatter.feed(fws, sline, charset)
if len(lines) > 1:
formatter.newline()
formatter.add_transition()
- value = str(formatter)
+ value = formatter._str(linesep)
if _embeded_header.search(value):
raise HeaderParseError("header value appears to contain "
"an embedded header: {!r}".format(value))
@@ -344,54 +373,40 @@ class _ValueFormatter:
def __init__(self, headerlen, maxlen, continuation_ws, splitchars):
self._maxlen = maxlen
self._continuation_ws = continuation_ws
- self._continuation_ws_len = len(continuation_ws.replace('\t', SPACE8))
+ self._continuation_ws_len = len(continuation_ws)
self._splitchars = splitchars
self._lines = []
self._current_line = _Accumulator(headerlen)
- def __str__(self):
+ def _str(self, linesep):
self.newline()
- return NL.join(self._lines)
+ return linesep.join(self._lines)
+
+ def __str__(self):
+ return self._str(NL)
def newline(self):
end_of_line = self._current_line.pop()
- if end_of_line is not None:
- self._current_line.push(end_of_line)
+ if end_of_line != (' ', ''):
+ self._current_line.push(*end_of_line)
if len(self._current_line) > 0:
- self._lines.append(str(self._current_line))
+ if self._current_line.is_onlyws():
+ self._lines[-1] += str(self._current_line)
+ else:
+ self._lines.append(str(self._current_line))
self._current_line.reset()
def add_transition(self):
- self._current_line.push(None)
-
- def feed(self, string, charset):
- # If the string itself fits on the current line in its encoded format,
- # then add it now and be done with it.
- encoded_string = charset.header_encode(string)
- if len(encoded_string) + len(self._current_line) <= self._maxlen:
- self._current_line.push(encoded_string)
- return
+ self._current_line.push(' ', '')
+
+ def feed(self, fws, string, charset):
# If the charset has no header encoding (i.e. it is an ASCII encoding)
# then we must split the header at the "highest level syntactic break"
# possible. Note that we don't have a lot of smarts about field
# syntax; we just try to break on semi-colons, then commas, then
# whitespace. Eventually, this should be pluggable.
if charset.header_encoding is None:
- for ch in self._splitchars:
- if ch in string:
- break
- else:
- ch = None
- # If there's no available split character then regardless of
- # whether the string fits on the line, we have to put it on a line
- # by itself.
- if ch is None:
- if not self._current_line.is_onlyws():
- self._lines.append(str(self._current_line))
- self._current_line.reset(self._continuation_ws)
- self._current_line.push(encoded_string)
- else:
- self._ascii_split(string, ch)
+ self._ascii_split(fws, string, self._splitchars)
return
# Otherwise, we're doing either a Base64 or a quoted-printable
# encoding which means we don't need to split the line on syntactic
@@ -409,15 +424,14 @@ class _ValueFormatter:
# There are no encoded lines, so we're done.
return
if first_line is not None:
- self._current_line.push(first_line)
- self._lines.append(str(self._current_line))
- self._current_line.reset(self._continuation_ws)
+ self._append_chunk(fws, first_line)
try:
last_line = encoded_lines.pop()
except IndexError:
# There was only one line.
return
- self._current_line.push(last_line)
+ self.newline()
+ self._current_line.push(self._continuation_ws, last_line)
# Everything else are full lines in themselves.
for line in encoded_lines:
self._lines.append(self._continuation_ws + line)
@@ -428,162 +442,96 @@ class _ValueFormatter:
while True:
yield self._maxlen - self._continuation_ws_len
- def _ascii_split(self, string, ch):
- holding = _Accumulator()
- # Split the line on the split character, preserving it. If the split
- # character is whitespace RFC 2822 $2.2.3 requires us to fold on the
- # whitespace, so that the line leads with the original whitespace we
- # split on. However, if a higher syntactic break is used instead
- # (e.g. comma or semicolon), the folding should happen after the split
- # character. But then in that case, we need to add our own
- # continuation whitespace -- although won't that break unfolding?
- for part, splitpart, nextpart in _spliterator(ch, string):
- if not splitpart:
- # No splitpart means this is the last chunk. Put this part
- # either on the current line or the next line depending on
- # whether it fits.
- holding.push(part)
- if len(holding) + len(self._current_line) <= self._maxlen:
- # It fits, but we're done.
- self._current_line.push(str(holding))
- else:
- # It doesn't fit, but we're done. Before pushing a new
- # line, watch out for the current line containing only
- # whitespace.
- holding.pop()
- if self._current_line.is_onlyws() and holding.is_onlyws():
- # Don't start a new line.
- holding.push(part)
- part = None
- self._current_line.push(str(holding))
- self._lines.append(str(self._current_line))
- if part is None:
- self._current_line.reset()
- else:
- holding.reset(part)
- self._current_line.reset(str(holding))
- return
- elif not nextpart:
- # There must be some trailing or duplicated split characters
- # because we
- # found a split character but no next part. In this case we
- # must treat the thing to fit as the part + splitpart because
- # if splitpart is whitespace it's not allowed to be the only
- # thing on the line, and if it's not whitespace we must split
- # after the syntactic break.
- holding_prelen = len(holding)
- holding.push(part + splitpart)
- if len(holding) + len(self._current_line) <= self._maxlen:
- self._current_line.push(str(holding))
- elif holding_prelen == 0:
- # This is the only chunk left so it has to go on the
- # current line.
- self._current_line.push(str(holding))
- else:
- save_part = holding.pop()
- self._current_line.push(str(holding))
- self._lines.append(str(self._current_line))
- holding.reset(save_part)
- self._current_line.reset(str(holding))
- holding.reset()
- elif not part:
- # We're leading with a split character. See if the splitpart
- # and nextpart fits on the current line.
- holding.push(splitpart + nextpart)
- holding_len = len(holding)
- # We know we're not leaving the nextpart on the stack.
- holding.pop()
- if holding_len + len(self._current_line) <= self._maxlen:
- holding.push(splitpart)
+ def _ascii_split(self, fws, string, splitchars):
+ # The RFC 2822 header folding algorithm is simple in principle but
+ # complex in practice. Lines may be folded any place where "folding
+ # white space" appears by inserting a linesep character in front of the
+ # FWS. The complication is that not all spaces or tabs qualify as FWS,
+ # and we are also supposed to prefer to break at "higher level
+ # syntactic breaks". We can't do either of these without intimate
+ # knowledge of the structure of structured headers, which we don't have
+ # here. So the best we can do here is prefer to break at the specified
+ # splitchars, and hope that we don't choose any spaces or tabs that
+ # aren't legal FWS. (This is at least better than the old algorithm,
+ # where we would sometimes *introduce* FWS after a splitchar, or the
+ # algorithm before that, where we would turn all white space runs into
+ # single spaces or tabs.)
+ parts = re.split("(["+FWS+"]+)", fws+string)
+ if parts[0]:
+ parts[:0] = ['']
+ else:
+ parts.pop(0)
+ for fws, part in zip(*[iter(parts)]*2):
+ self._append_chunk(fws, part)
+
+ def _append_chunk(self, fws, string):
+ self._current_line.push(fws, string)
+ if len(self._current_line) > self._maxlen:
+ # Find the best split point, working backward from the end.
+ # There might be none, on a long first line.
+ for ch in self._splitchars:
+ for i in range(self._current_line.part_count()-1, 0, -1):
+ if ch.isspace():
+ fws = self._current_line[i][0]
+ if fws and fws[0]==ch:
+ break
+ prevpart = self._current_line[i-1][1]
+ if prevpart and prevpart[-1]==ch:
+ break
else:
- # It doesn't fit. Since there's no current part really
- # the best we can do is start a new line and push the
- # split part onto it.
- self._current_line.push(str(holding))
- holding.reset()
- if len(self._current_line) > 0 and self._lines:
- self._lines.append(str(self._current_line))
- self._current_line.reset()
- holding.push(splitpart)
+ continue
+ break
else:
- # All three parts are present. First let's see if all three
- # parts will fit on the current line. If so, we don't need to
- # split it.
- holding.push(part + splitpart + nextpart)
- holding_len = len(holding)
- # Pop the part because we'll push nextpart on the next
- # iteration through the loop.
- holding.pop()
- if holding_len + len(self._current_line) <= self._maxlen:
- holding.push(part + splitpart)
- else:
- # The entire thing doesn't fit. See if we need to split
- # before or after the split characters.
- if splitpart.isspace():
- # Split before whitespace. Remember that the
- # whitespace becomes the continuation whitespace of
- # the next line so it goes to current_line not holding.
- holding.push(part)
- self._current_line.push(str(holding))
- holding.reset()
- self._lines.append(str(self._current_line))
- self._current_line.reset(splitpart)
- else:
- # Split after non-whitespace. The continuation
- # whitespace comes from the instance variable.
- holding.push(part + splitpart)
- self._current_line.push(str(holding))
- holding.reset()
- self._lines.append(str(self._current_line))
- if nextpart[0].isspace():
- self._current_line.reset()
- else:
- self._current_line.reset(self._continuation_ws)
- # Get the last of the holding part
- self._current_line.push(str(holding))
+ fws, part = self._current_line.pop()
+ if self._current_line._initial_size > 0:
+ # There will be a header, so leave it on a line by itself.
+ self.newline()
+ if not fws:
+ # We don't use continuation_ws here because the whitespace
+ # after a header should always be a space.
+ fws = ' '
+ self._current_line.push(fws, part)
+ return
+ remainder = self._current_line.pop_from(i)
+ self._lines.append(str(self._current_line))
+ self._current_line.reset(remainder)
-
-def _spliterator(character, string):
- parts = list(reversed(re.split('(%s)' % character, string)))
- while parts:
- part = parts.pop()
- splitparts = (parts.pop() if parts else None)
- nextpart = (parts.pop() if parts else None)
- yield (part, splitparts, nextpart)
- if nextpart is not None:
- parts.append(nextpart)
-
-
-class _Accumulator:
+class _Accumulator(list):
+
def __init__(self, initial_size=0):
self._initial_size = initial_size
- self._current = []
+ super().__init__()
+
+ def push(self, fws, string):
+ self.append((fws, string))
- def push(self, string):
- self._current.append(string)
+ def pop_from(self, i=0):
+ popped = self[i:]
+ self[i:] = []
+ return popped
def pop(self):
- if not self._current:
- return None
- return self._current.pop()
+ if self.part_count()==0:
+ return ('', '')
+ return super().pop()
def __len__(self):
- return sum(((1 if string is None else len(string))
- for string in self._current),
+ return sum((len(fws)+len(part) for fws, part in self),
self._initial_size)
def __str__(self):
- if self._current and self._current[-1] is None:
- self._current.pop()
- return EMPTYSTRING.join((' ' if string is None else string)
- for string in self._current)
+ return EMPTYSTRING.join((EMPTYSTRING.join((fws, part))
+ for fws, part in self))
- def reset(self, string=None):
- self._current = []
+ def reset(self, startval=None):
+ if startval is None:
+ startval = []
+ self[:] = startval
self._initial_size = 0
- if string is not None:
- self.push(string)
def is_onlyws(self):
- return len(self) == 0 or str(self).isspace()
+ return self._initial_size==0 and (not self or str(self).isspace())
+
+ def part_count(self):
+ return super().__len__()
diff --git a/Lib/email/message.py b/Lib/email/message.py
index d30f109a5b..922617adbb 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -16,7 +16,9 @@ from io import BytesIO, StringIO
# Intrapackage imports
from email import utils
from email import errors
-from email.charset import Charset
+from email import header
+from email import charset as _charset
+Charset = _charset.Charset
SEMISPACE = '; '
@@ -24,14 +26,31 @@ SEMISPACE = '; '
# existence of which force quoting of the parameter value.
tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]')
+# How to figure out if we are processing strings that come from a byte
+# source with undecodable characters.
+_has_surrogates = re.compile(
+ '([^\ud800-\udbff]|\A)[\udc00-\udfff]([^\udc00-\udfff]|\Z)').search
+
# Helper functions
+def _sanitize_header(name, value):
+ # If the header value contains surrogates, return a Header using
+ # the unknown-8bit charset to encode the bytes as encoded words.
+ if not isinstance(value, str):
+ # Assume it is already a header object
+ return value
+ if _has_surrogates(value):
+ return header.Header(value, charset=_charset.UNKNOWN8BIT,
+ header_name=name)
+ else:
+ return value
+
def _splitparam(param):
# Split header parameters. BAW: this may be too simple. It isn't
# strictly RFC 2045 (section 5.1) compliant, but it catches most headers
- # found in the wild. We may eventually need a full fledged parser
- # eventually.
- a, sep, b = param.partition(';')
+ # found in the wild. We may eventually need a full fledged parser.
+ # RDM: we might have a Header here; for now just stringify it.
+ a, sep, b = str(param).partition(';')
if not sep:
return a.strip(), None
return a.strip(), b.strip()
@@ -48,17 +67,19 @@ def _formatparam(param, value=None, quote=True):
if value is not None and len(value) > 0:
# A tuple is used for RFC 2231 encoded parameter values where items
# are (charset, language, value). charset is a string, not a Charset
- # instance.
+ # instance. RFC 2231 encoded values are never quoted, per RFC.
if isinstance(value, tuple):
# Encode as per RFC 2231
param += '*'
value = utils.encode_rfc2231(value[2], value[0], value[1])
+ return '%s=%s' % (param, value)
else:
try:
value.encode('ascii')
except UnicodeEncodeError:
param += '*'
value = utils.encode_rfc2231(value, 'utf-8', '')
+ return '%s=%s' % (param, value)
# BAW: Please check this. I think that if quote is set it should
# force quoting even if not necessary.
if quote or tspecials.search(value):
@@ -69,6 +90,8 @@ def _formatparam(param, value=None, quote=True):
return param
def _parseparam(s):
+ # RDM This might be a Header, so for now stringify it.
+ s = ';' + str(s)
plist = []
while s[:1] == ';':
s = s[1:]
@@ -193,43 +216,73 @@ class Message:
If the message is a multipart and the decode flag is True, then None
is returned.
"""
- if i is None:
- payload = self._payload
- elif not isinstance(self._payload, list):
+ # Here is the logic table for this code, based on the email5.0.0 code:
+ # i decode is_multipart result
+ # ------ ------ ------------ ------------------------------
+ # None True True None
+ # i True True None
+ # None False True _payload (a list)
+ # i False True _payload element i (a Message)
+ # i False False error (not a list)
+ # i True False error (not a list)
+ # None False False _payload
+ # None True False _payload decoded (bytes)
+ # Note that Barry planned to factor out the 'decode' case, but that
+ # isn't so easy now that we handle the 8 bit data, which needs to be
+ # converted in both the decode and non-decode path.
+ if self.is_multipart():
+ if decode:
+ return None
+ if i is None:
+ return self._payload
+ else:
+ return self._payload[i]
+ # For backward compatibility, Use isinstance and this error message
+ # instead of the more logical is_multipart test.
+ if i is not None and not isinstance(self._payload, list):
raise TypeError('Expected list, got %s' % type(self._payload))
- else:
- payload = self._payload[i]
+ payload = self._payload
+ # cte might be a Header, so for now stringify it.
+ cte = str(self.get('content-transfer-encoding', '')).lower()
+ # payload may be bytes here.
+ if isinstance(payload, str):
+ if _has_surrogates(payload):
+ bpayload = payload.encode('ascii', 'surrogateescape')
+ if not decode:
+ try:
+ payload = bpayload.decode(self.get_param('charset', 'ascii'), 'replace')
+ except LookupError:
+ payload = bpayload.decode('ascii', 'replace')
+ elif decode:
+ try:
+ bpayload = payload.encode('ascii')
+ except UnicodeError:
+ # This won't happen for RFC compliant messages (messages
+ # containing only ASCII codepoints in the unicode input).
+ # If it does happen, turn the string into bytes in a way
+ # guaranteed not to fail.
+ bpayload = payload.encode('raw-unicode-escape')
if not decode:
return payload
- # Decoded payloads always return bytes. XXX split this part out into
- # a new method called .get_decoded_payload().
- if self.is_multipart():
- return None
- cte = self.get('content-transfer-encoding', '').lower()
if cte == 'quoted-printable':
- return utils._qdecode(payload)
+ return utils._qdecode(bpayload)
elif cte == 'base64':
try:
- if isinstance(payload, str):
- payload = payload.encode('raw-unicode-escape')
- return base64.b64decode(payload)
- #return utils._bdecode(payload)
+ return base64.b64decode(bpayload)
except binascii.Error:
# Incorrect padding
- pass
+ return bpayload
elif cte in ('x-uuencode', 'uuencode', 'uue', 'x-uue'):
- in_file = BytesIO(payload.encode('raw-unicode-escape'))
+ in_file = BytesIO(bpayload)
out_file = BytesIO()
try:
uu.decode(in_file, out_file, quiet=True)
return out_file.getvalue()
except uu.Error:
# Some decoding problem
- pass
- # Is there a better way to do this? We can't use the bytes
- # constructor.
+ return bpayload
if isinstance(payload, str):
- return payload.encode('raw-unicode-escape')
+ return bpayload
return payload
def set_payload(self, payload, charset=None):
@@ -348,7 +401,7 @@ class Message:
Any fields deleted and re-inserted are always appended to the header
list.
"""
- return [v for k, v in self._headers]
+ return [_sanitize_header(k, v) for k, v in self._headers]
def items(self):
"""Get all the message's header fields and values.
@@ -358,7 +411,7 @@ class Message:
Any fields deleted and re-inserted are always appended to the header
list.
"""
- return self._headers[:]
+ return [(k, _sanitize_header(k, v)) for k, v in self._headers]
def get(self, name, failobj=None):
"""Get a header value.
@@ -369,7 +422,7 @@ class Message:
name = name.lower()
for k, v in self._headers:
if k.lower() == name:
- return v
+ return _sanitize_header(k, v)
return failobj
#
@@ -389,7 +442,7 @@ class Message:
name = name.lower()
for k, v in self._headers:
if k.lower() == name:
- values.append(v)
+ values.append(_sanitize_header(k, v))
if not values:
return failobj
return values
@@ -511,7 +564,7 @@ class Message:
if value is missing:
return failobj
params = []
- for p in _parseparam(';' + value):
+ for p in _parseparam(value):
try:
name, val = p.split('=', 1)
name = name.strip()
diff --git a/Lib/email/parser.py b/Lib/email/parser.py
index 06014e2b2e..6caaff53ad 100644
--- a/Lib/email/parser.py
+++ b/Lib/email/parser.py
@@ -7,7 +7,7 @@
__all__ = ['Parser', 'HeaderParser']
import warnings
-from io import StringIO
+from io import StringIO, TextIOWrapper
from email.feedparser import FeedParser
from email.message import Message
@@ -89,3 +89,48 @@ class HeaderParser(Parser):
def parsestr(self, text, headersonly=True):
return Parser.parsestr(self, text, True)
+
+
+class BytesParser:
+
+ def __init__(self, *args, **kw):
+ """Parser of binary RFC 2822 and MIME email messages.
+
+ Creates an in-memory object tree representing the email message, which
+ can then be manipulated and turned over to a Generator to return the
+ textual representation of the message.
+
+ The input must be formatted as a block of RFC 2822 headers and header
+ continuation lines, optionally preceeded by a `Unix-from' header. The
+ header block is terminated either by the end of the input or by a
+ blank line.
+
+ _class is the class to instantiate for new message objects when they
+ must be created. This class must have a constructor that can take
+ zero arguments. Default is Message.Message.
+ """
+ self.parser = Parser(*args, **kw)
+
+ def parse(self, fp, headersonly=False):
+ """Create a message structure from the data in a binary file.
+
+ Reads all the data from the file and returns the root of the message
+ structure. Optional headersonly is a flag specifying whether to stop
+ parsing after reading the headers or not. The default is False,
+ meaning it parses the entire contents of the file.
+ """
+ fp = TextIOWrapper(fp, encoding='ascii', errors='surrogateescape')
+ with fp:
+ return self.parser.parse(fp, headersonly)
+
+
+ def parsebytes(self, text, headersonly=False):
+ """Create a message structure from a byte string.
+
+ Returns the root of the message structure. Optional headersonly is a
+ flag specifying whether to stop parsing after reading the headers or
+ not. The default is False, meaning it parses the entire contents of
+ the file.
+ """
+ text = text.decode('ASCII', errors='surrogateescape')
+ return self.parser.parsestr(text, headersonly)
diff --git a/Lib/email/quoprimime.py b/Lib/email/quoprimime.py
index f88115e36f..78638d5904 100644
--- a/Lib/email/quoprimime.py
+++ b/Lib/email/quoprimime.py
@@ -11,7 +11,7 @@ character set, but that includes some 8-bit characters that are normally not
allowed in email bodies or headers.
Quoted-printable is very space-inefficient for encoding binary files; use the
-email.base64MIME module for that instead.
+email.base64mime module for that instead.
This module provides an interface to encode and decode both headers and bodies
with quoted-printable encoding.
@@ -23,7 +23,7 @@ in To:/From:/Cc: etc. fields, as well as Subject: lines.
This module does not do the line wrapping or end-of-line character
conversion necessary for proper internationalized headers; it only
does dumb encoding and decoding. To deal with the various line
-wrapping issues, use the email.Header module.
+wrapping issues, use the email.header module.
"""
__all__ = [
@@ -316,7 +316,7 @@ def header_decode(s):
This function does not parse a full MIME header value encoded with
quoted-printable (like =?iso-8895-1?q?Hello_World?=) -- please use
- the high level email.Header class for that functionality.
+ the high level email.header class for that functionality.
"""
s = s.replace('_', ' ')
return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, re.ASCII)
diff --git a/Lib/email/test/data/msg_10.txt b/Lib/email/test/data/msg_10.txt
index bd30d13ad1..07903960f9 100644
--- a/Lib/email/test/data/msg_10.txt
+++ b/Lib/email/test/data/msg_10.txt
@@ -26,6 +26,13 @@ VGhpcyBpcyBhIEJhc2U2NCBlbmNvZGVkIG1lc3NhZ2Uu
--BOUNDARY
Content-Type: text/plain; charset="iso-8859-1"
+Content-Transfer-Encoding: Base64
+
+VGhpcyBpcyBhIEJhc2U2NCBlbmNvZGVkIG1lc3NhZ2UuCg==
+
+
+--BOUNDARY
+Content-Type: text/plain; charset="iso-8859-1"
This has no Content-Transfer-Encoding: header.
diff --git a/Lib/email/test/data/msg_26.txt b/Lib/email/test/data/msg_26.txt
index 6c71bced9a..58efaa9c9a 100644
--- a/Lib/email/test/data/msg_26.txt
+++ b/Lib/email/test/data/msg_26.txt
@@ -24,7 +24,8 @@ Simple email with attachment.
--1618492860--2051301190--113853680
-Content-Type: application/riscos; name="clock.bmp,69c"; type=BMP; load=&fff69c4b; exec=&355dd4d1; access=&03
+Content-Type: application/riscos; name="clock.bmp,69c"; type=BMP;
+ load=&fff69c4b; exec=&355dd4d1; access=&03
Content-Disposition: attachment; filename="clock.bmp"
Content-Transfer-Encoding: base64
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py
index e06c4611a5..281a65a6da 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -3,6 +3,7 @@
# email package unit tests
import os
+import re
import sys
import time
import base64
@@ -11,7 +12,7 @@ import unittest
import warnings
import textwrap
-from io import StringIO
+from io import StringIO, BytesIO
from itertools import chain
import email
@@ -35,7 +36,7 @@ from email import iterators
from email import base64mime
from email import quoprimime
-from test.support import findfile, run_unittest
+from test.support import findfile, run_unittest, unlink
from email.test import __file__ as landmark
@@ -193,8 +194,8 @@ class TestMessageAPI(TestEmailBase):
def test_message_rfc822_only(self):
# Issue 7970: message/rfc822 not in multipart parsed by
# HeaderParser caused an exception when flattened.
- fp = openfile(findfile('msg_46.txt'))
- msgdata = fp.read()
+ with openfile(findfile('msg_46.txt')) as fp:
+ msgdata = fp.read()
parser = HeaderParser()
msg = parser.parsestr(msgdata)
out = StringIO()
@@ -216,8 +217,12 @@ class TestMessageAPI(TestEmailBase):
# Subpart 3 is base64
eq(msg.get_payload(2).get_payload(decode=True),
b'This is a Base64 encoded message.')
- # Subpart 4 has no Content-Transfer-Encoding: header.
+ # Subpart 4 is base64 with a trailing newline, which
+ # used to be stripped (issue 7143).
eq(msg.get_payload(3).get_payload(decode=True),
+ b'This is a Base64 encoded message.\n')
+ # Subpart 5 has no Content-Transfer-Encoding: header.
+ eq(msg.get_payload(4).get_payload(decode=True),
b'This has no Content-Transfer-Encoding: header.\n')
def test_get_decoded_uu_payload(self):
@@ -231,6 +236,10 @@ class TestMessageAPI(TestEmailBase):
msg.set_payload('foo')
eq(msg.get_payload(decode=True), b'foo')
+ def test_get_payload_n_raises_on_non_multipart(self):
+ msg = Message()
+ self.assertRaises(TypeError, msg.get_payload, 1)
+
def test_decoded_generator(self):
eq = self.assertEqual
msg = self._msgobj('msg_07.txt')
@@ -386,6 +395,17 @@ class TestMessageAPI(TestEmailBase):
msg.del_param('filename', 'content-disposition')
self.assertEqual(msg['content-disposition'], 'attachment')
+ def test_del_param_on_nonexistent_header(self):
+ msg = Message()
+ msg.del_param('filename', 'content-disposition')
+
+ def test_del_nonexistent_param(self):
+ msg = Message()
+ msg.add_header('Content-Type', 'text/plain', charset='utf-8')
+ existing_header = msg['Content-Type']
+ msg.del_param('foobar', header='Content-Type')
+ self.assertEqual(msg['Content-Type'], 'text/plain; charset="utf-8"')
+
def test_set_type(self):
eq = self.assertEqual
msg = Message()
@@ -516,6 +536,27 @@ class TestMessageAPI(TestEmailBase):
self.assertEqual(msg.get_payload(decode=True),
bytes(x, 'raw-unicode-escape'))
+ def test_broken_unicode_payload(self):
+ # This test improves coverage but is not a compliance test.
+ # The behavior in this situation is currently undefined by the API.
+ x = 'this is a br\xf6ken thing to do'
+ msg = Message()
+ msg['content-type'] = 'text/plain'
+ msg['content-transfer-encoding'] = '8bit'
+ msg.set_payload(x)
+ self.assertEqual(msg.get_payload(decode=True),
+ bytes(x, 'raw-unicode-escape'))
+
+ def test_questionable_bytes_payload(self):
+ # This test improves coverage but is not a compliance test,
+ # since it involves poking inside the black box.
+ x = 'this is a quéstionable thing to do'.encode('utf-8')
+ msg = Message()
+ msg['content-type'] = 'text/plain; charset="utf-8"'
+ msg['content-transfer-encoding'] = '8bit'
+ msg._payload = x
+ self.assertEqual(msg.get_payload(decode=True), x)
+
# Issue 1078919
def test_ascii_add_header(self):
msg = Message()
@@ -529,7 +570,7 @@ class TestMessageAPI(TestEmailBase):
msg.add_header('Content-Disposition', 'attachment',
filename="Fußballer.ppt")
self.assertEqual(
- 'attachment; filename*="utf-8\'\'Fu%C3%9Fballer.ppt"',
+ 'attachment; filename*=utf-8\'\'Fu%C3%9Fballer.ppt',
msg['Content-Disposition'])
def test_nonascii_add_header_via_triple(self):
@@ -537,9 +578,34 @@ class TestMessageAPI(TestEmailBase):
msg.add_header('Content-Disposition', 'attachment',
filename=('iso-8859-1', '', 'Fußballer.ppt'))
self.assertEqual(
- 'attachment; filename*="iso-8859-1\'\'Fu%DFballer.ppt"',
+ 'attachment; filename*=iso-8859-1\'\'Fu%DFballer.ppt',
msg['Content-Disposition'])
+ def test_ascii_add_header_with_tspecial(self):
+ msg = Message()
+ msg.add_header('Content-Disposition', 'attachment',
+ filename="windows [filename].ppt")
+ self.assertEqual(
+ 'attachment; filename="windows [filename].ppt"',
+ msg['Content-Disposition'])
+
+ def test_nonascii_add_header_with_tspecial(self):
+ msg = Message()
+ msg.add_header('Content-Disposition', 'attachment',
+ filename="Fußballer [filename].ppt")
+ self.assertEqual(
+ "attachment; filename*=utf-8''Fu%C3%9Fballer%20%5Bfilename%5D.ppt",
+ msg['Content-Disposition'])
+
+ def test_add_header_with_name_only_param(self):
+ msg = Message()
+ msg.add_header('Content-Disposition', 'inline', foo_bar=None)
+ self.assertEqual("inline; foo-bar", msg['Content-Disposition'])
+
+ def test_add_header_with_no_value(self):
+ msg = Message()
+ msg.add_header('X-Status', None)
+ self.assertEqual('', msg['X-Status'])
# Issue 5871: reject an attempt to embed a header inside a header value
# (header injection attack).
@@ -594,6 +660,9 @@ class TestEncoders(unittest.TestCase):
# Test long header wrapping
class TestLongHeaders(TestEmailBase):
+
+ maxDiff = None
+
def test_split_long_continuation(self):
eq = self.ndiffAssertEqual
msg = email.message_from_string("""\
@@ -714,6 +783,20 @@ wasnipoop; giraffes="very-long-necked-animals";
wasnipoop; giraffes="very-long-necked-animals";
\tspooge="yummy"; hippos="gargantuan"; marshmallows="gooey"''')
+ def test_header_encode_with_different_output_charset(self):
+ h = Header('æ–‡', 'euc-jp')
+ self.assertEqual(h.encode(), "=?iso-2022-jp?b?GyRCSjgbKEI=?=")
+
+ def test_long_header_encode_with_different_output_charset(self):
+ h = Header(b'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4'
+ b'\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4'
+ b'\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4'
+ b'\xa4\xa4\xde\xa4\xb9'.decode('euc-jp'), 'euc-jp')
+ res = """\
+=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKMnE8VCROPjUbKEI=?=
+ =?iso-2022-jp?b?GyRCRyckckJUJEMkRiQkJF4kORsoQg==?="""
+ self.assertEqual(h.encode(), res)
+
def test_header_splitter(self):
eq = self.ndiffAssertEqual
msg = MIMEText('')
@@ -788,14 +871,12 @@ Subject: the first part of this is short,
eq = self.ndiffAssertEqual
h = Header('; '
'this_part_does_not_fit_within_maxlinelen_and_thus_should_'
- 'be_on_a_line_all_by_itself;')
+ 'be_on_a_line_all_by_itself; ')
eq(h.encode(), """\
;
- this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself;""")
+ this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself; """)
def test_long_header_with_multiple_sequential_split_chars(self):
- # Issue 11492
-
eq = self.ndiffAssertEqual
h = Header('This is a long line that has two whitespaces in a row. '
'This used to cause truncation of the header when folded')
@@ -803,6 +884,105 @@ Subject: the first part of this is short,
This is a long line that has two whitespaces in a row. This used to cause
truncation of the header when folded""")
+ def test_splitter_split_on_punctuation_only_if_fws(self):
+ eq = self.ndiffAssertEqual
+ h = Header('thisverylongheaderhas;semicolons;and,commas,but'
+ 'they;arenotlegal;fold,points')
+ eq(h.encode(), "thisverylongheaderhas;semicolons;and,commas,butthey;"
+ "arenotlegal;fold,points")
+
+ def test_leading_splittable_in_the_middle_just_before_overlong_last_part(self):
+ eq = self.ndiffAssertEqual
+ h = Header('this is a test where we need to have more than one line '
+ 'before; our final line that is just too big to fit;; '
+ 'this_part_does_not_fit_within_maxlinelen_and_thus_should_'
+ 'be_on_a_line_all_by_itself;')
+ eq(h.encode(), """\
+this is a test where we need to have more than one line before;
+ our final line that is just too big to fit;;
+ this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself;""")
+
+ def test_overlong_last_part_followed_by_split_point(self):
+ eq = self.ndiffAssertEqual
+ h = Header('this_part_does_not_fit_within_maxlinelen_and_thus_should_'
+ 'be_on_a_line_all_by_itself ')
+ eq(h.encode(), "this_part_does_not_fit_within_maxlinelen_and_thus_"
+ "should_be_on_a_line_all_by_itself ")
+
+ def test_multiline_with_overlong_parts_separated_by_two_split_points(self):
+ eq = self.ndiffAssertEqual
+ h = Header('this_is_a__test_where_we_need_to_have_more_than_one_line_'
+ 'before_our_final_line_; ; '
+ 'this_part_does_not_fit_within_maxlinelen_and_thus_should_'
+ 'be_on_a_line_all_by_itself; ')
+ eq(h.encode(), """\
+this_is_a__test_where_we_need_to_have_more_than_one_line_before_our_final_line_;
+ ;
+ this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself; """)
+
+ def test_multiline_with_overlong_last_part_followed_by_split_point(self):
+ eq = self.ndiffAssertEqual
+ h = Header('this is a test where we need to have more than one line '
+ 'before our final line; ; '
+ 'this_part_does_not_fit_within_maxlinelen_and_thus_should_'
+ 'be_on_a_line_all_by_itself; ')
+ eq(h.encode(), """\
+this is a test where we need to have more than one line before our final line;
+ ;
+ this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself; """)
+
+ def test_long_header_with_whitespace_runs(self):
+ eq = self.ndiffAssertEqual
+ msg = Message()
+ msg['From'] = 'test@dom.ain'
+ msg['References'] = SPACE.join(['<foo@dom.ain> '] * 10)
+ msg.set_payload('Test')
+ sfp = StringIO()
+ g = Generator(sfp)
+ g.flatten(msg)
+ eq(sfp.getvalue(), """\
+From: test@dom.ain
+References: <foo@dom.ain> <foo@dom.ain> <foo@dom.ain> <foo@dom.ain>
+ <foo@dom.ain> <foo@dom.ain> <foo@dom.ain> <foo@dom.ain>
+ <foo@dom.ain> <foo@dom.ain>\x20\x20
+
+Test""")
+
+ def test_long_run_with_semi_header_splitter(self):
+ eq = self.ndiffAssertEqual
+ msg = Message()
+ msg['From'] = 'test@dom.ain'
+ msg['References'] = SPACE.join(['<foo@dom.ain>'] * 10) + '; abc'
+ msg.set_payload('Test')
+ sfp = StringIO()
+ g = Generator(sfp)
+ g.flatten(msg)
+ eq(sfp.getvalue(), """\
+From: test@dom.ain
+References: <foo@dom.ain> <foo@dom.ain> <foo@dom.ain> <foo@dom.ain>
+ <foo@dom.ain> <foo@dom.ain> <foo@dom.ain> <foo@dom.ain> <foo@dom.ain>
+ <foo@dom.ain>; abc
+
+Test""")
+
+ def test_splitter_split_on_punctuation_only_if_fws(self):
+ eq = self.ndiffAssertEqual
+ msg = Message()
+ msg['From'] = 'test@dom.ain'
+ msg['References'] = ('thisverylongheaderhas;semicolons;and,commas,but'
+ 'they;arenotlegal;fold,points')
+ msg.set_payload('Test')
+ sfp = StringIO()
+ g = Generator(sfp)
+ g.flatten(msg)
+ # XXX the space after the header should not be there.
+ eq(sfp.getvalue(), """\
+From: test@dom.ain
+References:\x20
+ thisverylongheaderhas;semicolons;and,commas,butthey;arenotlegal;fold,points
+
+Test""")
+
def test_no_split_long_header(self):
eq = self.ndiffAssertEqual
hstr = 'References: ' + 'x' * 80
@@ -893,7 +1073,7 @@ Reply-To: =?utf-8?q?Britische_Regierung_gibt_gr=C3=BCnes_Licht_f=C3=BCr_Offs?=
def test_long_to_header(self):
eq = self.ndiffAssertEqual
to = ('"Someone Test #A" <someone@eecs.umich.edu>,'
- '<someone@eecs.umich.edu>,'
+ '<someone@eecs.umich.edu>, '
'"Someone Test #B" <someone@umich.edu>, '
'"Someone Test #C" <someone@eecs.umich.edu>, '
'"Someone Test #D" <someone@eecs.umich.edu>')
@@ -948,9 +1128,11 @@ This is an example of string which has almost the limit of header length.
msg['Received-2'] = h
# This should be splitting on spaces not semicolons.
self.ndiffAssertEqual(msg.as_string(maxheaderlen=78), """\
-Received-1: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP;
+Received-1: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by
+ hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP;
Wed, 05 Mar 2003 18:10:18 -0700
-Received-2: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP;
+Received-2: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by
+ hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP;
Wed, 05 Mar 2003 18:10:18 -0700
""")
@@ -963,12 +1145,14 @@ Received-2: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by hrothgar.la.m
msg['Received-1'] = Header(h, header_name='Received-1',
continuation_ws='\t')
msg['Received-2'] = h
- # XXX This should be splitting on spaces not commas.
+ # XXX The space after the ':' should not be there.
self.ndiffAssertEqual(msg.as_string(maxheaderlen=78), """\
-Received-1: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David Bremner's message of \"Thu,
- 6 Mar 2003 13:58:21 +0100\")
-Received-2: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David Bremner's message of \"Thu,
- 6 Mar 2003 13:58:21 +0100\")
+Received-1:\x20
+ <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David
+ Bremner's message of \"Thu, 6 Mar 2003 13:58:21 +0100\")
+Received-2:\x20
+ <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David
+ Bremner's message of \"Thu, 6 Mar 2003 13:58:21 +0100\")
""")
@@ -980,8 +1164,9 @@ iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp"""
msg['Face-1'] = t
msg['Face-2'] = Header(t, header_name='Face-2')
+ msg['Face-3'] = ' ' + t
# XXX This splitting is all wrong. It the first value line should be
- # snug against the field name.
+ # snug against the field name or the space after the header not there.
eq(msg.as_string(maxheaderlen=78), """\
Face-1:\x20
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
@@ -989,6 +1174,9 @@ Face-1:\x20
Face-2:\x20
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp
+Face-3:\x20
+ iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
+ locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp
""")
@@ -1000,8 +1188,8 @@ Face-2:\x20
'Wed, 16 Oct 2002 07:41:11 -0700')
msg = email.message_from_string(m)
eq(msg.as_string(maxheaderlen=78), '''\
-Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with Microsoft SMTPSVC(5.0.2195.4905);
- Wed, 16 Oct 2002 07:41:11 -0700
+Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with
+ Microsoft SMTPSVC(5.0.2195.4905); Wed, 16 Oct 2002 07:41:11 -0700
''')
@@ -1015,9 +1203,11 @@ Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with Microsof
msg['List'] = h
msg['List'] = Header(h, header_name='List')
eq(msg.as_string(maxheaderlen=78), """\
-List: List-Unsubscribe: <http://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,
+List: List-Unsubscribe:
+ <http://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,
<mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe>
-List: List-Unsubscribe: <http://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,
+List: List-Unsubscribe:
+ <http://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,
<mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe>
""")
@@ -2093,17 +2283,20 @@ message 2
# should be identical. Note: that we ignore the Unix-From since that may
# contain a changed date.
class TestIdempotent(TestEmailBase):
+
+ linesep = '\n'
+
def _msgobj(self, filename):
with openfile(filename) as fp:
data = fp.read()
msg = email.message_from_string(data)
return msg, data
- def _idempotent(self, msg, text):
+ def _idempotent(self, msg, text, unixfrom=False):
eq = self.ndiffAssertEqual
s = StringIO()
g = Generator(s, maxheaderlen=0)
- g.flatten(msg)
+ g.flatten(msg, unixfrom=unixfrom)
eq(text, s.getvalue())
def test_parse_text_message(self):
@@ -2190,6 +2383,14 @@ class TestIdempotent(TestEmailBase):
msg, text = self._msgobj('msg_36.txt')
self._idempotent(msg, text)
+ def test_message_delivery_status(self):
+ msg, text = self._msgobj('msg_43.txt')
+ self._idempotent(msg, text, unixfrom=True)
+
+ def test_message_signed_idempotent(self):
+ msg, text = self._msgobj('msg_45.txt')
+ self._idempotent(msg, text)
+
def test_content_type(self):
eq = self.assertEqual
unless = self.assertTrue
@@ -2202,16 +2403,16 @@ class TestIdempotent(TestEmailBase):
params[pk] = pv
eq(params['report-type'], 'delivery-status')
eq(params['boundary'], 'D1690A7AC1.996856090/mail.example.com')
- eq(msg.preamble, 'This is a MIME-encapsulated message.\n')
- eq(msg.epilogue, '\n')
+ eq(msg.preamble, 'This is a MIME-encapsulated message.' + self.linesep)
+ eq(msg.epilogue, self.linesep)
eq(len(msg.get_payload()), 3)
# Make sure the subparts are what we expect
msg1 = msg.get_payload(0)
eq(msg1.get_content_type(), 'text/plain')
- eq(msg1.get_payload(), 'Yadda yadda yadda\n')
+ eq(msg1.get_payload(), 'Yadda yadda yadda' + self.linesep)
msg2 = msg.get_payload(1)
eq(msg2.get_content_type(), 'text/plain')
- eq(msg2.get_payload(), 'Yadda yadda yadda\n')
+ eq(msg2.get_payload(), 'Yadda yadda yadda' + self.linesep)
msg3 = msg.get_payload(2)
eq(msg3.get_content_type(), 'message/rfc822')
self.assertTrue(isinstance(msg3, Message))
@@ -2220,7 +2421,7 @@ class TestIdempotent(TestEmailBase):
eq(len(payload), 1)
msg4 = payload[0]
unless(isinstance(msg4, Message))
- eq(msg4.get_payload(), 'Yadda yadda yadda\n')
+ eq(msg4.get_payload(), 'Yadda yadda yadda' + self.linesep)
def test_parser(self):
eq = self.assertEqual
@@ -2237,7 +2438,7 @@ class TestIdempotent(TestEmailBase):
self.assertTrue(isinstance(msg1, Message))
eq(msg1.get_content_type(), 'text/plain')
self.assertTrue(isinstance(msg1.get_payload(), str))
- eq(msg1.get_payload(), '\n')
+ eq(msg1.get_payload(), self.linesep)
@@ -2306,7 +2507,8 @@ class TestMiscellaneous(TestEmailBase):
all.sort()
self.assertEqual(all, [
'base64mime', 'charset', 'encoders', 'errors', 'generator',
- 'header', 'iterators', 'message', 'message_from_file',
+ 'header', 'iterators', 'message', 'message_from_binary_file',
+ 'message_from_bytes', 'message_from_file',
'message_from_string', 'mime', 'parser',
'quoprimime', 'utils',
])
@@ -2349,6 +2551,16 @@ class TestMiscellaneous(TestEmailBase):
eq(utils.parsedate_tz('5 Feb 2003 13:47:26 -0800'),
(2003, 2, 5, 13, 47, 26, 0, 1, -1, -28800))
+ def test_parsedate_no_space_before_positive_offset(self):
+ self.assertEqual(utils.parsedate_tz('Wed, 3 Apr 2002 14:58:26+0800'),
+ (2002, 4, 3, 14, 58, 26, 0, 1, -1, 28800))
+
+ def test_parsedate_no_space_before_negative_offset(self):
+ # Issue 1155362: we already handled '+' for this case.
+ self.assertEqual(utils.parsedate_tz('Wed, 3 Apr 2002 14:58:26-0800'),
+ (2002, 4, 3, 14, 58, 26, 0, 1, -1, -28800))
+
+
def test_parsedate_acceptable_to_time_functions(self):
eq = self.assertEqual
timetup = utils.parsedate('5 Feb 2003 13:47:26 -0800')
@@ -2425,6 +2637,24 @@ class TestMiscellaneous(TestEmailBase):
eq(utils.parseaddr('"\\\\"example\\\\" example"@example.com'),
('', '"\\\\"example\\\\" example"@example.com'))
+ def test_parseaddr_preserves_spaces_in_local_part(self):
+ # issue 9286. A normal RFC5322 local part should not contain any
+ # folding white space, but legacy local parts can (they are a sequence
+ # of atoms, not dotatoms). On the other hand we strip whitespace from
+ # before the @ and around dots, on the assumption that the whitespace
+ # around the punctuation is a mistake in what would otherwise be
+ # an RFC5322 local part. Leading whitespace is, usual, stripped as well.
+ self.assertEqual(('', "merwok wok@xample.com"),
+ utils.parseaddr("merwok wok@xample.com"))
+ self.assertEqual(('', "merwok wok@xample.com"),
+ utils.parseaddr("merwok wok@xample.com"))
+ self.assertEqual(('', "merwok wok@xample.com"),
+ utils.parseaddr(" merwok wok @xample.com"))
+ self.assertEqual(('', 'merwok"wok" wok@xample.com'),
+ utils.parseaddr('merwok"wok" wok@xample.com'))
+ self.assertEqual(('', 'merwok.wok.wok@xample.com'),
+ utils.parseaddr('merwok. wok . wok@xample.com'))
+
def test_multiline_from_comment(self):
x = """\
Foo
@@ -2563,6 +2793,10 @@ multipart/report
text/rfc822-headers
""")
+ def test_make_msgid_domain(self):
+ self.assertEqual(
+ email.utils.make_msgid(domain='testdomain-string')[-19:],
+ '@testdomain-string>')
# Test the iterator/generators
@@ -2714,6 +2948,18 @@ Here's the message body
part2 = msg.get_payload(1)
eq(part2.get_content_type(), 'application/riscos')
+ def test_crlf_flatten(self):
+ # Using newline='\n' preserves the crlfs in this input file.
+ with openfile('msg_26.txt', newline='\n') as fp:
+ text = fp.read()
+ msg = email.message_from_string(text)
+ s = StringIO()
+ g = Generator(s)
+ g.flatten(msg, linesep='\r\n')
+ self.assertEqual(s.getvalue(), text)
+
+ maxDiff = None
+
def test_multipart_digest_with_extra_mime_headers(self):
eq = self.assertEqual
neq = self.ndiffAssertEqual
@@ -2807,6 +3053,417 @@ Here's the message body
self.assertTrue(msg.get_payload(0).get_payload().endswith('\r\n'))
+class Test8BitBytesHandling(unittest.TestCase):
+ # In Python3 all input is string, but that doesn't work if the actual input
+ # uses an 8bit transfer encoding. To hack around that, in email 5.1 we
+ # decode byte streams using the surrogateescape error handler, and
+ # reconvert to binary at appropriate places if we detect surrogates. This
+ # doesn't allow us to transform headers with 8bit bytes (they get munged),
+ # but it does allow us to parse and preserve them, and to decode body
+ # parts that use an 8bit CTE.
+
+ bodytest_msg = textwrap.dedent("""\
+ From: foo@bar.com
+ To: baz
+ Mime-Version: 1.0
+ Content-Type: text/plain; charset={charset}
+ Content-Transfer-Encoding: {cte}
+
+ {bodyline}
+ """)
+
+ def test_known_8bit_CTE(self):
+ m = self.bodytest_msg.format(charset='utf-8',
+ cte='8bit',
+ bodyline='pöstal').encode('utf-8')
+ msg = email.message_from_bytes(m)
+ self.assertEqual(msg.get_payload(), "pöstal\n")
+ self.assertEqual(msg.get_payload(decode=True),
+ "pöstal\n".encode('utf-8'))
+
+ def test_unknown_8bit_CTE(self):
+ m = self.bodytest_msg.format(charset='notavalidcharset',
+ cte='8bit',
+ bodyline='pöstal').encode('utf-8')
+ msg = email.message_from_bytes(m)
+ self.assertEqual(msg.get_payload(), "p\uFFFD\uFFFDstal\n")
+ self.assertEqual(msg.get_payload(decode=True),
+ "pöstal\n".encode('utf-8'))
+
+ def test_8bit_in_quopri_body(self):
+ # This is non-RFC compliant data...without 'decode' the library code
+ # decodes the body using the charset from the headers, and because the
+ # source byte really is utf-8 this works. This is likely to fail
+ # against real dirty data (ie: produce mojibake), but the data is
+ # invalid anyway so it is as good a guess as any. But this means that
+ # this test just confirms the current behavior; that behavior is not
+ # necessarily the best possible behavior. With 'decode' it is
+ # returning the raw bytes, so that test should be of correct behavior,
+ # or at least produce the same result that email4 did.
+ m = self.bodytest_msg.format(charset='utf-8',
+ cte='quoted-printable',
+ bodyline='p=C3=B6stál').encode('utf-8')
+ msg = email.message_from_bytes(m)
+ self.assertEqual(msg.get_payload(), 'p=C3=B6stál\n')
+ self.assertEqual(msg.get_payload(decode=True),
+ 'pöstál\n'.encode('utf-8'))
+
+ def test_invalid_8bit_in_non_8bit_cte_uses_replace(self):
+ # This is similar to the previous test, but proves that if the 8bit
+ # byte is undecodeable in the specified charset, it gets replaced
+ # by the unicode 'unknown' character. Again, this may or may not
+ # be the ideal behavior. Note that if decode=False none of the
+ # decoders will get involved, so this is the only test we need
+ # for this behavior.
+ m = self.bodytest_msg.format(charset='ascii',
+ cte='quoted-printable',
+ bodyline='p=C3=B6stál').encode('utf-8')
+ msg = email.message_from_bytes(m)
+ self.assertEqual(msg.get_payload(), 'p=C3=B6st\uFFFD\uFFFDl\n')
+ self.assertEqual(msg.get_payload(decode=True),
+ 'pöstál\n'.encode('utf-8'))
+
+ def test_8bit_in_base64_body(self):
+ # Sticking an 8bit byte in a base64 block makes it undecodable by
+ # normal means, so the block is returned undecoded, but as bytes.
+ m = self.bodytest_msg.format(charset='utf-8',
+ cte='base64',
+ bodyline='cMO2c3RhbAá=').encode('utf-8')
+ msg = email.message_from_bytes(m)
+ self.assertEqual(msg.get_payload(decode=True),
+ 'cMO2c3RhbAá=\n'.encode('utf-8'))
+
+ def test_8bit_in_uuencode_body(self):
+ # Sticking an 8bit byte in a uuencode block makes it undecodable by
+ # normal means, so the block is returned undecoded, but as bytes.
+ m = self.bodytest_msg.format(charset='utf-8',
+ cte='uuencode',
+ bodyline='<,.V<W1A; á ').encode('utf-8')
+ msg = email.message_from_bytes(m)
+ self.assertEqual(msg.get_payload(decode=True),
+ '<,.V<W1A; á \n'.encode('utf-8'))
+
+
+ headertest_headers = (
+ ('From: foo@bar.com', ('From', 'foo@bar.com')),
+ ('To: báz', ('To', '=?unknown-8bit?q?b=C3=A1z?=')),
+ ('Subject: Maintenant je vous présente mon collègue, le pouf célèbre\n'
+ '\tJean de Baddie',
+ ('Subject', '=?unknown-8bit?q?Maintenant_je_vous_pr=C3=A9sente_mon_'
+ 'coll=C3=A8gue=2C_le_pouf_c=C3=A9l=C3=A8bre?=\n'
+ ' =?unknown-8bit?q?_Jean_de_Baddie?=')),
+ ('From: göst', ('From', '=?unknown-8bit?b?Z8O2c3Q=?=')),
+ )
+ headertest_msg = ('\n'.join([src for (src, _) in headertest_headers]) +
+ '\nYes, they are flying.\n').encode('utf-8')
+
+ def test_get_8bit_header(self):
+ msg = email.message_from_bytes(self.headertest_msg)
+ self.assertEqual(str(msg.get('to')), 'b\uFFFD\uFFFDz')
+ self.assertEqual(str(msg['to']), 'b\uFFFD\uFFFDz')
+
+ def test_print_8bit_headers(self):
+ msg = email.message_from_bytes(self.headertest_msg)
+ self.assertEqual(str(msg),
+ textwrap.dedent("""\
+ From: {}
+ To: {}
+ Subject: {}
+ From: {}
+
+ Yes, they are flying.
+ """).format(*[expected[1] for (_, expected) in
+ self.headertest_headers]))
+
+ def test_values_with_8bit_headers(self):
+ msg = email.message_from_bytes(self.headertest_msg)
+ self.assertListEqual([str(x) for x in msg.values()],
+ ['foo@bar.com',
+ 'b\uFFFD\uFFFDz',
+ 'Maintenant je vous pr\uFFFD\uFFFDsente mon '
+ 'coll\uFFFD\uFFFDgue, le pouf '
+ 'c\uFFFD\uFFFDl\uFFFD\uFFFDbre\n'
+ '\tJean de Baddie',
+ "g\uFFFD\uFFFDst"])
+
+ def test_items_with_8bit_headers(self):
+ msg = email.message_from_bytes(self.headertest_msg)
+ self.assertListEqual([(str(x), str(y)) for (x, y) in msg.items()],
+ [('From', 'foo@bar.com'),
+ ('To', 'b\uFFFD\uFFFDz'),
+ ('Subject', 'Maintenant je vous '
+ 'pr\uFFFD\uFFFDsente '
+ 'mon coll\uFFFD\uFFFDgue, le pouf '
+ 'c\uFFFD\uFFFDl\uFFFD\uFFFDbre\n'
+ '\tJean de Baddie'),
+ ('From', 'g\uFFFD\uFFFDst')])
+
+ def test_get_all_with_8bit_headers(self):
+ msg = email.message_from_bytes(self.headertest_msg)
+ self.assertListEqual([str(x) for x in msg.get_all('from')],
+ ['foo@bar.com',
+ 'g\uFFFD\uFFFDst'])
+
+ def test_get_content_type_with_8bit(self):
+ msg = email.message_from_bytes(textwrap.dedent("""\
+ Content-Type: text/pl\xA7in; charset=utf-8
+ """).encode('latin-1'))
+ self.assertEqual(msg.get_content_type(), "text/pl\uFFFDin")
+ self.assertEqual(msg.get_content_maintype(), "text")
+ self.assertEqual(msg.get_content_subtype(), "pl\uFFFDin")
+
+ def test_get_params_with_8bit(self):
+ msg = email.message_from_bytes(
+ 'X-Header: foo=\xa7ne; b\xa7r=two; baz=three\n'.encode('latin-1'))
+ self.assertEqual(msg.get_params(header='x-header'),
+ [('foo', '\uFFFDne'), ('b\uFFFDr', 'two'), ('baz', 'three')])
+ self.assertEqual(msg.get_param('Foo', header='x-header'), '\uFFFdne')
+ # XXX: someday you might be able to get 'b\xa7r', for now you can't.
+ self.assertEqual(msg.get_param('b\xa7r', header='x-header'), None)
+
+ def test_get_rfc2231_params_with_8bit(self):
+ msg = email.message_from_bytes(textwrap.dedent("""\
+ Content-Type: text/plain; charset=us-ascii;
+ title*=us-ascii'en'This%20is%20not%20f\xa7n"""
+ ).encode('latin-1'))
+ self.assertEqual(msg.get_param('title'),
+ ('us-ascii', 'en', 'This is not f\uFFFDn'))
+
+ def test_set_rfc2231_params_with_8bit(self):
+ msg = email.message_from_bytes(textwrap.dedent("""\
+ Content-Type: text/plain; charset=us-ascii;
+ title*=us-ascii'en'This%20is%20not%20f\xa7n"""
+ ).encode('latin-1'))
+ msg.set_param('title', 'test')
+ self.assertEqual(msg.get_param('title'), 'test')
+
+ def test_del_rfc2231_params_with_8bit(self):
+ msg = email.message_from_bytes(textwrap.dedent("""\
+ Content-Type: text/plain; charset=us-ascii;
+ title*=us-ascii'en'This%20is%20not%20f\xa7n"""
+ ).encode('latin-1'))
+ msg.del_param('title')
+ self.assertEqual(msg.get_param('title'), None)
+ self.assertEqual(msg.get_content_maintype(), 'text')
+
+ def test_get_payload_with_8bit_cte_header(self):
+ msg = email.message_from_bytes(textwrap.dedent("""\
+ Content-Transfer-Encoding: b\xa7se64
+ Content-Type: text/plain; charset=latin-1
+
+ payload
+ """).encode('latin-1'))
+ self.assertEqual(msg.get_payload(), 'payload\n')
+ self.assertEqual(msg.get_payload(decode=True), b'payload\n')
+
+ non_latin_bin_msg = textwrap.dedent("""\
+ From: foo@bar.com
+ To: báz
+ Subject: Maintenant je vous présente mon collègue, le pouf célèbre
+ \tJean de Baddie
+ Mime-Version: 1.0
+ Content-Type: text/plain; charset="utf-8"
+ Content-Transfer-Encoding: 8bit
+
+ Да, они летÑÑ‚.
+ """).encode('utf-8')
+
+ def test_bytes_generator(self):
+ msg = email.message_from_bytes(self.non_latin_bin_msg)
+ out = BytesIO()
+ email.generator.BytesGenerator(out).flatten(msg)
+ self.assertEqual(out.getvalue(), self.non_latin_bin_msg)
+
+ def test_bytes_generator_handles_None_body(self):
+ #Issue 11019
+ msg = email.message.Message()
+ out = BytesIO()
+ email.generator.BytesGenerator(out).flatten(msg)
+ self.assertEqual(out.getvalue(), b"\n")
+
+ non_latin_bin_msg_as7bit_wrapped = textwrap.dedent("""\
+ From: foo@bar.com
+ To: =?unknown-8bit?q?b=C3=A1z?=
+ Subject: =?unknown-8bit?q?Maintenant_je_vous_pr=C3=A9sente_mon_coll=C3=A8gue?=
+ =?unknown-8bit?q?=2C_le_pouf_c=C3=A9l=C3=A8bre?=
+ =?unknown-8bit?q?_Jean_de_Baddie?=
+ Mime-Version: 1.0
+ Content-Type: text/plain; charset="utf-8"
+ Content-Transfer-Encoding: base64
+
+ 0JTQsCwg0L7QvdC4INC70LXRgtGP0YIuCg==
+ """)
+
+ def test_generator_handles_8bit(self):
+ msg = email.message_from_bytes(self.non_latin_bin_msg)
+ out = StringIO()
+ email.generator.Generator(out).flatten(msg)
+ self.assertEqual(out.getvalue(), self.non_latin_bin_msg_as7bit_wrapped)
+
+ def test_bytes_generator_with_unix_from(self):
+ # The unixfrom contains a current date, so we can't check it
+ # literally. Just make sure the first word is 'From' and the
+ # rest of the message matches the input.
+ msg = email.message_from_bytes(self.non_latin_bin_msg)
+ out = BytesIO()
+ email.generator.BytesGenerator(out).flatten(msg, unixfrom=True)
+ lines = out.getvalue().split(b'\n')
+ self.assertEqual(lines[0].split()[0], b'From')
+ self.assertEqual(b'\n'.join(lines[1:]), self.non_latin_bin_msg)
+
+ non_latin_bin_msg_as7bit = non_latin_bin_msg_as7bit_wrapped.split('\n')
+ non_latin_bin_msg_as7bit[2:4] = [
+ 'Subject: =?unknown-8bit?q?Maintenant_je_vous_pr=C3=A9sente_mon_'
+ 'coll=C3=A8gue=2C_le_pouf_c=C3=A9l=C3=A8bre?=']
+ non_latin_bin_msg_as7bit = '\n'.join(non_latin_bin_msg_as7bit)
+
+ def test_message_from_binary_file(self):
+ fn = 'test.msg'
+ self.addCleanup(unlink, fn)
+ with open(fn, 'wb') as testfile:
+ testfile.write(self.non_latin_bin_msg)
+ with open(fn, 'rb') as testfile:
+ m = email.parser.BytesParser().parse(testfile)
+ self.assertEqual(str(m), self.non_latin_bin_msg_as7bit)
+
+ latin_bin_msg = textwrap.dedent("""\
+ From: foo@bar.com
+ To: Dinsdale
+ Subject: Nudge nudge, wink, wink
+ Mime-Version: 1.0
+ Content-Type: text/plain; charset="latin-1"
+ Content-Transfer-Encoding: 8bit
+
+ oh là là, know what I mean, know what I mean?
+ """).encode('latin-1')
+
+ latin_bin_msg_as7bit = textwrap.dedent("""\
+ From: foo@bar.com
+ To: Dinsdale
+ Subject: Nudge nudge, wink, wink
+ Mime-Version: 1.0
+ Content-Type: text/plain; charset="iso-8859-1"
+ Content-Transfer-Encoding: quoted-printable
+
+ oh l=E0 l=E0, know what I mean, know what I mean?
+ """)
+
+ def test_string_generator_reencodes_to_quopri_when_appropriate(self):
+ m = email.message_from_bytes(self.latin_bin_msg)
+ self.assertEqual(str(m), self.latin_bin_msg_as7bit)
+
+ def test_decoded_generator_emits_unicode_body(self):
+ m = email.message_from_bytes(self.latin_bin_msg)
+ out = StringIO()
+ email.generator.DecodedGenerator(out).flatten(m)
+ #DecodedHeader output contains an extra blank line compared
+ #to the input message. RDM: not sure if this is a bug or not,
+ #but it is not specific to the 8bit->7bit conversion.
+ self.assertEqual(out.getvalue(),
+ self.latin_bin_msg.decode('latin-1')+'\n')
+
+ def test_bytes_feedparser(self):
+ bfp = email.feedparser.BytesFeedParser()
+ for i in range(0, len(self.latin_bin_msg), 10):
+ bfp.feed(self.latin_bin_msg[i:i+10])
+ m = bfp.close()
+ self.assertEqual(str(m), self.latin_bin_msg_as7bit)
+
+ def test_crlf_flatten(self):
+ with openfile('msg_26.txt', 'rb') as fp:
+ text = fp.read()
+ msg = email.message_from_bytes(text)
+ s = BytesIO()
+ g = email.generator.BytesGenerator(s)
+ g.flatten(msg, linesep='\r\n')
+ self.assertEqual(s.getvalue(), text)
+
+ def test_8bit_multipart(self):
+ # Issue 11605
+ source = textwrap.dedent("""\
+ Date: Fri, 18 Mar 2011 17:15:43 +0100
+ To: foo@example.com
+ From: foodwatch-Newsletter <bar@example.com>
+ Subject: Aktuelles zu Japan, Klonfleisch und Smiley-System
+ Message-ID: <76a486bee62b0d200f33dc2ca08220ad@localhost.localdomain>
+ MIME-Version: 1.0
+ Content-Type: multipart/alternative;
+ boundary="b1_76a486bee62b0d200f33dc2ca08220ad"
+
+ --b1_76a486bee62b0d200f33dc2ca08220ad
+ Content-Type: text/plain; charset="utf-8"
+ Content-Transfer-Encoding: 8bit
+
+ Guten Tag, ,
+
+ mit großer Betroffenheit verfolgen auch wir im foodwatch-Team die
+ Nachrichten aus Japan.
+
+
+ --b1_76a486bee62b0d200f33dc2ca08220ad
+ Content-Type: text/html; charset="utf-8"
+ Content-Transfer-Encoding: 8bit
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+ <html lang="de">
+ <head>
+ <title>foodwatch - Newsletter</title>
+ </head>
+ <body>
+ <p>mit gro&szlig;er Betroffenheit verfolgen auch wir im foodwatch-Team
+ die Nachrichten aus Japan.</p>
+ </body>
+ </html>
+ --b1_76a486bee62b0d200f33dc2ca08220ad--
+
+ """).encode('utf-8')
+ msg = email.message_from_bytes(source)
+ s = BytesIO()
+ g = email.generator.BytesGenerator(s)
+ g.flatten(msg)
+ self.assertEqual(s.getvalue(), source)
+
+ maxDiff = None
+
+
+class BaseTestBytesGeneratorIdempotent:
+
+ maxDiff = None
+
+ def _msgobj(self, filename):
+ with openfile(filename, 'rb') as fp:
+ data = fp.read()
+ data = self.normalize_linesep_regex.sub(self.blinesep, data)
+ msg = email.message_from_bytes(data)
+ return msg, data
+
+ def _idempotent(self, msg, data, unixfrom=False):
+ b = BytesIO()
+ g = email.generator.BytesGenerator(b, maxheaderlen=0)
+ g.flatten(msg, unixfrom=unixfrom, linesep=self.linesep)
+ self.assertByteStringsEqual(data, b.getvalue())
+
+ def assertByteStringsEqual(self, str1, str2):
+ # Not using self.blinesep here is intentional. This way the output
+ # is more useful when the failure results in mixed line endings.
+ self.assertListEqual(str1.split(b'\n'), str2.split(b'\n'))
+
+
+class TestBytesGeneratorIdempotentNL(BaseTestBytesGeneratorIdempotent,
+ TestIdempotent):
+ linesep = '\n'
+ blinesep = b'\n'
+ normalize_linesep_regex = re.compile(br'\r\n')
+
+
+class TestBytesGeneratorIdempotentCRLF(BaseTestBytesGeneratorIdempotent,
+ TestIdempotent):
+ linesep = '\r\n'
+ blinesep = b'\r\n'
+ normalize_linesep_regex = re.compile(br'(?<!\r)\n')
+
+
class TestBase64(unittest.TestCase):
def test_len(self):
eq = self.assertEqual
@@ -3222,9 +3879,9 @@ class TestCharset(unittest.TestCase):
# built-in encodings where the header encoding is QP but the body
# encoding is not.
from email import charset as CharsetModule
- CharsetModule.add_charset('fake', CharsetModule.QP, None)
+ CharsetModule.add_charset('fake', CharsetModule.QP, None, 'utf-8')
c = Charset('fake')
- eq('hello w\xf6rld', c.body_encode('hello w\xf6rld'))
+ eq('hello world', c.body_encode('hello world'))
def test_unicode_charset_name(self):
charset = Charset('us-ascii')
@@ -3517,6 +4174,20 @@ A very long line that must get split to something other than at the
h.append(x, errors='replace')
eq(str(h), e)
+ def test_escaped_8bit_header(self):
+ x = b'Ynwp4dUEbay Auction Semiar- No Charge \x96 Earn Big'
+ x = x.decode('ascii', 'surrogateescape')
+ h = Header(x, charset=email.charset.UNKNOWN8BIT)
+ self.assertEqual(str(h),
+ 'Ynwp4dUEbay Auction Semiar- No Charge \uFFFD Earn Big')
+ self.assertEqual(email.header.decode_header(h), [(x, 'unknown-8bit')])
+
+ def test_modify_returned_list_does_not_change_header(self):
+ h = Header('test')
+ chunks = email.header.decode_header(h)
+ chunks.append(('ascii', 'test2'))
+ self.assertEqual(str(h), 'test')
+
def test_encoded_adjacent_nonencoded(self):
eq = self.assertEqual
h = Header()
@@ -3552,6 +4223,11 @@ A very long line that must get split to something other than at the
msg = email.message_from_string("EmptyHeader:")
self.assertEqual(str(msg), "EmptyHeader: \n\n")
+ def test_encode_preserves_leading_ws_on_value(self):
+ msg = Message()
+ msg['SomeHeader'] = ' value with leading ws'
+ self.assertEqual(str(msg), "SomeHeader: value with leading ws\n\n")
+
# Test RFC 2231 header parameters (en/de)coding
@@ -3591,7 +4267,7 @@ To: bbb@zzz.org
Subject: This is a test message
Date: Fri, 4 May 2001 14:05:44 -0400
Content-Type: text/plain; charset=us-ascii;
- title*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21"
+ title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21
Hi,
@@ -3601,6 +4277,16 @@ Do you like this message?
-Me
""")
+ def test_set_param_requote(self):
+ msg = Message()
+ msg.set_param('title', 'foo')
+ self.assertEqual(msg['content-type'], 'text/plain; title="foo"')
+ msg.set_param('title', 'bar', requote=False)
+ self.assertEqual(msg['content-type'], 'text/plain; title=bar')
+ # tspecial is still quoted.
+ msg.set_param('title', "(bar)bell", requote=False)
+ self.assertEqual(msg['content-type'], 'text/plain; title="(bar)bell"')
+
def test_del_param(self):
eq = self.ndiffAssertEqual
msg = self._msgobj('msg_01.txt')
@@ -3621,7 +4307,7 @@ To: bbb@zzz.org
Subject: This is a test message
Date: Fri, 4 May 2001 14:05:44 -0400
Content-Type: text/plain; charset="us-ascii";
- title*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21"
+ title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21
Hi,
@@ -3636,6 +4322,32 @@ Do you like this message?
msg = self._msgobj('msg_32.txt')
eq(msg.get_content_charset(), 'us-ascii')
+ def test_rfc2231_parse_rfc_quoting(self):
+ m = textwrap.dedent('''\
+ Content-Disposition: inline;
+ \tfilename*0*=''This%20is%20even%20more%20;
+ \tfilename*1*=%2A%2A%2Afun%2A%2A%2A%20;
+ \tfilename*2="is it not.pdf"
+
+ ''')
+ msg = email.message_from_string(m)
+ self.assertEqual(msg.get_filename(),
+ 'This is even more ***fun*** is it not.pdf')
+ self.assertEqual(m, msg.as_string())
+
+ def test_rfc2231_parse_extra_quoting(self):
+ m = textwrap.dedent('''\
+ Content-Disposition: inline;
+ \tfilename*0*="''This%20is%20even%20more%20";
+ \tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20";
+ \tfilename*2="is it not.pdf"
+
+ ''')
+ msg = email.message_from_string(m)
+ self.assertEqual(msg.get_filename(),
+ 'This is even more ***fun*** is it not.pdf')
+ self.assertEqual(m, msg.as_string())
+
def test_rfc2231_no_language_or_charset(self):
m = '''\
Content-Transfer-Encoding: 8bit
diff --git a/Lib/email/test/test_email_codecs.py b/Lib/email/test/test_email_codecs.py
index acc19c30f9..ca85f5731e 100644
--- a/Lib/email/test/test_email_codecs.py
+++ b/Lib/email/test/test_email_codecs.py
@@ -13,7 +13,7 @@ from email.message import Message
# We're compatible with Python 2.3, but it doesn't have the built-in Asian
# codecs, so we have to skip all these tests.
try:
- str('foo', 'euc-jp')
+ str(b'foo', 'euc-jp')
except LookupError:
raise unittest.SkipTest
@@ -22,11 +22,14 @@ except LookupError:
class TestEmailAsianCodecs(TestEmailBase):
def test_japanese_codecs(self):
eq = self.ndiffAssertEqual
- j = Charset("euc-jp")
- g = Charset("iso-8859-1")
+ jcode = "euc-jp"
+ gcode = "iso-8859-1"
+ j = Charset(jcode)
+ g = Charset(gcode)
h = Header("Hello World!")
- jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa'
- ghello = 'Gr\xfc\xdf Gott!'
+ jhello = str(b'\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc'
+ b'\xa5\xeb\xa5\xc9\xa1\xaa', jcode)
+ ghello = str(b'Gr\xfc\xdf Gott!', gcode)
h.append(jhello, j)
h.append(ghello, g)
# BAW: This used to -- and maybe should -- fold the two iso-8859-1
@@ -36,13 +39,17 @@ class TestEmailAsianCodecs(TestEmailBase):
# encoded word.
eq(h.encode(), """\
Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=
- =?iso-8859-1?q?Gr=FC=DF?= =?iso-8859-1?q?_Gott!?=""")
+ =?iso-8859-1?q?Gr=FC=DF_Gott!?=""")
eq(decode_header(h.encode()),
- [('Hello World!', None),
- ('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'),
- ('Gr\xfc\xdf Gott!', 'iso-8859-1')])
- int = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9'
- h = Header(int, j, header_name="Subject")
+ [(b'Hello World!', None),
+ (b'\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'),
+ (b'Gr\xfc\xdf Gott!', gcode)])
+ subject_bytes = (b'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5'
+ b'\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2'
+ b'\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3'
+ b'\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9')
+ subject = str(subject_bytes, jcode)
+ h = Header(subject, j, header_name="Subject")
# test a very long header
enc = h.encode()
# TK: splitting point may differ by codec design and/or Header encoding
@@ -50,15 +57,24 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=
=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?=
=?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?=""")
# TK: full decode comparison
- eq(h.__unicode__().encode('euc-jp'), int)
+ eq(str(h).encode(jcode), subject_bytes)
+
+ def test_payload_encoding_utf8(self):
+ jhello = str(b'\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc'
+ b'\xa5\xeb\xa5\xc9\xa1\xaa', 'euc-jp')
+ msg = Message()
+ msg.set_payload(jhello, 'utf-8')
+ ustr = msg.get_payload(decode=True).decode(msg.get_content_charset())
+ self.assertEqual(jhello, ustr)
def test_payload_encoding(self):
- jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa'
jcode = 'euc-jp'
+ jhello = str(b'\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc'
+ b'\xa5\xeb\xa5\xc9\xa1\xaa', jcode)
msg = Message()
msg.set_payload(jhello, jcode)
- ustr = str(msg.get_payload(), msg.get_content_charset())
- self.assertEqual(jhello, ustr.encode(jcode))
+ ustr = msg.get_payload(decode=True).decode(msg.get_content_charset())
+ self.assertEqual(jhello, ustr)
diff --git a/Lib/email/test/test_email_torture.py b/Lib/email/test/test_email_torture.py
index 57233bfdbb..544b1bbb39 100644
--- a/Lib/email/test/test_email_torture.py
+++ b/Lib/email/test/test_email_torture.py
@@ -13,11 +13,11 @@ from io import StringIO
from types import ListType
from email.test.test_email import TestEmailBase
-from test.support import TestSkipped
+from test.support import TestSkipped, run_unittest
import email
from email import __file__ as testfile
-from email.Iterators import _structure
+from email.iterators import _structure
def openfile(filename):
from os.path import join, dirname, abspath
@@ -128,7 +128,7 @@ def suite():
def test_main():
for testclass in _testclasses():
- support.run_unittest(testclass)
+ run_unittest(testclass)
diff --git a/Lib/email/utils.py b/Lib/email/utils.py
index 5f40bac174..ac4da3705f 100644
--- a/Lib/email/utils.py
+++ b/Lib/email/utils.py
@@ -148,13 +148,15 @@ def formatdate(timeval=None, localtime=False, usegmt=False):
-def make_msgid(idstring=None):
+def make_msgid(idstring=None, domain=None):
"""Returns a string suitable for RFC 2822 compliant Message-ID, e.g:
<20020201195627.33539.96671@nightshade.la.mastaler.com>
Optional idstring if given is a string used to strengthen the
- uniqueness of the message id.
+ uniqueness of the message id. Optional domain if given provides the
+ portion of the message id after the '@'. It defaults to the locally
+ defined hostname.
"""
timeval = time.time()
utcdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(timeval))
@@ -164,8 +166,9 @@ def make_msgid(idstring=None):
idstring = ''
else:
idstring = '.' + idstring
- idhost = socket.getfqdn()
- msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, idhost)
+ if domain is None:
+ domain = socket.getfqdn()
+ msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, domain)
return msgid
diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py
index d72eae9328..b189bd9793 100644
--- a/Lib/encodings/__init__.py
+++ b/Lib/encodings/__init__.py
@@ -10,7 +10,7 @@
Each codec module must export the following interface:
* getregentry() -> codecs.CodecInfo object
- The getregentry() API must a CodecInfo object with encoder, decoder,
+ The getregentry() API must return a CodecInfo object with encoder, decoder,
incrementalencoder, incrementaldecoder, streamwriter and streamreader
atttributes which adhere to the Python Codec Interface Standard.
diff --git a/Lib/encodings/aliases.py b/Lib/encodings/aliases.py
index 4c35588c88..235deb5c30 100644
--- a/Lib/encodings/aliases.py
+++ b/Lib/encodings/aliases.py
@@ -146,6 +146,11 @@ aliases = {
'csibm857' : 'cp857',
'ibm857' : 'cp857',
+ # cp858 codec
+ '858' : 'cp858',
+ 'csibm858' : 'cp858',
+ 'ibm858' : 'cp858',
+
# cp860 codec
'860' : 'cp860',
'csibm860' : 'cp860',
@@ -430,6 +435,7 @@ aliases = {
'maclatin2' : 'mac_latin2',
# mac_roman codec
+ 'macintosh' : 'mac_roman',
'macroman' : 'mac_roman',
# mac_turkish codec
@@ -442,7 +448,7 @@ aliases = {
'csptcp154' : 'ptcp154',
'pt154' : 'ptcp154',
'cp154' : 'ptcp154',
- 'cyrillic-asian' : 'ptcp154',
+ 'cyrillic_asian' : 'ptcp154',
## quopri_codec codec
#'quopri' : 'quopri_codec',
diff --git a/Lib/encodings/base64_codec.py b/Lib/encodings/base64_codec.py
new file mode 100644
index 0000000000..321a961782
--- /dev/null
+++ b/Lib/encodings/base64_codec.py
@@ -0,0 +1,55 @@
+"""Python 'base64_codec' Codec - base64 content transfer encoding.
+
+This codec de/encodes from bytes to bytes and is therefore usable with
+bytes.transform() and bytes.untransform().
+
+Written by Marc-Andre Lemburg (mal@lemburg.com).
+"""
+
+import codecs
+import base64
+
+### Codec APIs
+
+def base64_encode(input, errors='strict'):
+ assert errors == 'strict'
+ return (base64.encodebytes(input), len(input))
+
+def base64_decode(input, errors='strict'):
+ assert errors == 'strict'
+ return (base64.decodebytes(input), len(input))
+
+class Codec(codecs.Codec):
+ def encode(self, input, errors='strict'):
+ return base64_encode(input, errors)
+ def decode(self, input, errors='strict'):
+ return base64_decode(input, errors)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+ def encode(self, input, final=False):
+ assert self.errors == 'strict'
+ return base64.encodebytes(input)
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+ def decode(self, input, final=False):
+ assert self.errors == 'strict'
+ return base64.decodebytes(input)
+
+class StreamWriter(Codec, codecs.StreamWriter):
+ charbuffertype = bytes
+
+class StreamReader(Codec, codecs.StreamReader):
+ charbuffertype = bytes
+
+### encodings module API
+
+def getregentry():
+ return codecs.CodecInfo(
+ name='base64',
+ encode=base64_encode,
+ decode=base64_decode,
+ incrementalencoder=IncrementalEncoder,
+ incrementaldecoder=IncrementalDecoder,
+ streamwriter=StreamWriter,
+ streamreader=StreamReader,
+ )
diff --git a/Lib/encodings/bz2_codec.py b/Lib/encodings/bz2_codec.py
new file mode 100644
index 0000000000..e65d226bfd
--- /dev/null
+++ b/Lib/encodings/bz2_codec.py
@@ -0,0 +1,77 @@
+"""Python 'bz2_codec' Codec - bz2 compression encoding.
+
+This codec de/encodes from bytes to bytes and is therefore usable with
+bytes.transform() and bytes.untransform().
+
+Adapted by Raymond Hettinger from zlib_codec.py which was written
+by Marc-Andre Lemburg (mal@lemburg.com).
+"""
+
+import codecs
+import bz2 # this codec needs the optional bz2 module !
+
+### Codec APIs
+
+def bz2_encode(input, errors='strict'):
+ assert errors == 'strict'
+ return (bz2.compress(input), len(input))
+
+def bz2_decode(input, errors='strict'):
+ assert errors == 'strict'
+ return (bz2.decompress(input), len(input))
+
+class Codec(codecs.Codec):
+ def encode(self, input, errors='strict'):
+ return bz2_encode(input, errors)
+ def decode(self, input, errors='strict'):
+ return bz2_decode(input, errors)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+ def __init__(self, errors='strict'):
+ assert errors == 'strict'
+ self.errors = errors
+ self.compressobj = bz2.BZ2Compressor()
+
+ def encode(self, input, final=False):
+ if final:
+ c = self.compressobj.compress(input)
+ return c + self.compressobj.flush()
+ else:
+ return self.compressobj.compress(input)
+
+ def reset(self):
+ self.compressobj = bz2.BZ2Compressor()
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+ def __init__(self, errors='strict'):
+ assert errors == 'strict'
+ self.errors = errors
+ self.decompressobj = bz2.BZ2Decompressor()
+
+ def decode(self, input, final=False):
+ try:
+ return self.decompressobj.decompress(input)
+ except EOFError:
+ return ''
+
+ def reset(self):
+ self.decompressobj = bz2.BZ2Decompressor()
+
+class StreamWriter(Codec, codecs.StreamWriter):
+ charbuffertype = bytes
+
+class StreamReader(Codec, codecs.StreamReader):
+ charbuffertype = bytes
+
+### encodings module API
+
+def getregentry():
+ return codecs.CodecInfo(
+ name="bz2",
+ encode=bz2_encode,
+ decode=bz2_decode,
+ incrementalencoder=IncrementalEncoder,
+ incrementaldecoder=IncrementalDecoder,
+ streamwriter=StreamWriter,
+ streamreader=StreamReader,
+ )
diff --git a/Lib/encodings/cp720.py b/Lib/encodings/cp720.py
new file mode 100644
index 0000000000..96d609616c
--- /dev/null
+++ b/Lib/encodings/cp720.py
@@ -0,0 +1,309 @@
+"""Python Character Mapping Codec cp720 generated on Windows:
+Vista 6.0.6002 SP2 Multiprocessor Free with the command:
+ python Tools/unicode/genwincodec.py 720
+"""#"
+
+
+import codecs
+
+### Codec APIs
+
+class Codec(codecs.Codec):
+
+ def encode(self,input,errors='strict'):
+ return codecs.charmap_encode(input,errors,encoding_table)
+
+ def decode(self,input,errors='strict'):
+ return codecs.charmap_decode(input,errors,decoding_table)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+ def encode(self, input, final=False):
+ return codecs.charmap_encode(input,self.errors,encoding_table)[0]
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+ def decode(self, input, final=False):
+ return codecs.charmap_decode(input,self.errors,decoding_table)[0]
+
+class StreamWriter(Codec,codecs.StreamWriter):
+ pass
+
+class StreamReader(Codec,codecs.StreamReader):
+ pass
+
+### encodings module API
+
+def getregentry():
+ return codecs.CodecInfo(
+ name='cp720',
+ encode=Codec().encode,
+ decode=Codec().decode,
+ incrementalencoder=IncrementalEncoder,
+ incrementaldecoder=IncrementalDecoder,
+ streamreader=StreamReader,
+ streamwriter=StreamWriter,
+ )
+
+
+### Decoding Table
+
+decoding_table = (
+ '\x00' # 0x00 -> CONTROL CHARACTER
+ '\x01' # 0x01 -> CONTROL CHARACTER
+ '\x02' # 0x02 -> CONTROL CHARACTER
+ '\x03' # 0x03 -> CONTROL CHARACTER
+ '\x04' # 0x04 -> CONTROL CHARACTER
+ '\x05' # 0x05 -> CONTROL CHARACTER
+ '\x06' # 0x06 -> CONTROL CHARACTER
+ '\x07' # 0x07 -> CONTROL CHARACTER
+ '\x08' # 0x08 -> CONTROL CHARACTER
+ '\t' # 0x09 -> CONTROL CHARACTER
+ '\n' # 0x0A -> CONTROL CHARACTER
+ '\x0b' # 0x0B -> CONTROL CHARACTER
+ '\x0c' # 0x0C -> CONTROL CHARACTER
+ '\r' # 0x0D -> CONTROL CHARACTER
+ '\x0e' # 0x0E -> CONTROL CHARACTER
+ '\x0f' # 0x0F -> CONTROL CHARACTER
+ '\x10' # 0x10 -> CONTROL CHARACTER
+ '\x11' # 0x11 -> CONTROL CHARACTER
+ '\x12' # 0x12 -> CONTROL CHARACTER
+ '\x13' # 0x13 -> CONTROL CHARACTER
+ '\x14' # 0x14 -> CONTROL CHARACTER
+ '\x15' # 0x15 -> CONTROL CHARACTER
+ '\x16' # 0x16 -> CONTROL CHARACTER
+ '\x17' # 0x17 -> CONTROL CHARACTER
+ '\x18' # 0x18 -> CONTROL CHARACTER
+ '\x19' # 0x19 -> CONTROL CHARACTER
+ '\x1a' # 0x1A -> CONTROL CHARACTER
+ '\x1b' # 0x1B -> CONTROL CHARACTER
+ '\x1c' # 0x1C -> CONTROL CHARACTER
+ '\x1d' # 0x1D -> CONTROL CHARACTER
+ '\x1e' # 0x1E -> CONTROL CHARACTER
+ '\x1f' # 0x1F -> CONTROL CHARACTER
+ ' ' # 0x20 -> SPACE
+ '!' # 0x21 -> EXCLAMATION MARK
+ '"' # 0x22 -> QUOTATION MARK
+ '#' # 0x23 -> NUMBER SIGN
+ '$' # 0x24 -> DOLLAR SIGN
+ '%' # 0x25 -> PERCENT SIGN
+ '&' # 0x26 -> AMPERSAND
+ "'" # 0x27 -> APOSTROPHE
+ '(' # 0x28 -> LEFT PARENTHESIS
+ ')' # 0x29 -> RIGHT PARENTHESIS
+ '*' # 0x2A -> ASTERISK
+ '+' # 0x2B -> PLUS SIGN
+ ',' # 0x2C -> COMMA
+ '-' # 0x2D -> HYPHEN-MINUS
+ '.' # 0x2E -> FULL STOP
+ '/' # 0x2F -> SOLIDUS
+ '0' # 0x30 -> DIGIT ZERO
+ '1' # 0x31 -> DIGIT ONE
+ '2' # 0x32 -> DIGIT TWO
+ '3' # 0x33 -> DIGIT THREE
+ '4' # 0x34 -> DIGIT FOUR
+ '5' # 0x35 -> DIGIT FIVE
+ '6' # 0x36 -> DIGIT SIX
+ '7' # 0x37 -> DIGIT SEVEN
+ '8' # 0x38 -> DIGIT EIGHT
+ '9' # 0x39 -> DIGIT NINE
+ ':' # 0x3A -> COLON
+ ';' # 0x3B -> SEMICOLON
+ '<' # 0x3C -> LESS-THAN SIGN
+ '=' # 0x3D -> EQUALS SIGN
+ '>' # 0x3E -> GREATER-THAN SIGN
+ '?' # 0x3F -> QUESTION MARK
+ '@' # 0x40 -> COMMERCIAL AT
+ 'A' # 0x41 -> LATIN CAPITAL LETTER A
+ 'B' # 0x42 -> LATIN CAPITAL LETTER B
+ 'C' # 0x43 -> LATIN CAPITAL LETTER C
+ 'D' # 0x44 -> LATIN CAPITAL LETTER D
+ 'E' # 0x45 -> LATIN CAPITAL LETTER E
+ 'F' # 0x46 -> LATIN CAPITAL LETTER F
+ 'G' # 0x47 -> LATIN CAPITAL LETTER G
+ 'H' # 0x48 -> LATIN CAPITAL LETTER H
+ 'I' # 0x49 -> LATIN CAPITAL LETTER I
+ 'J' # 0x4A -> LATIN CAPITAL LETTER J
+ 'K' # 0x4B -> LATIN CAPITAL LETTER K
+ 'L' # 0x4C -> LATIN CAPITAL LETTER L
+ 'M' # 0x4D -> LATIN CAPITAL LETTER M
+ 'N' # 0x4E -> LATIN CAPITAL LETTER N
+ 'O' # 0x4F -> LATIN CAPITAL LETTER O
+ 'P' # 0x50 -> LATIN CAPITAL LETTER P
+ 'Q' # 0x51 -> LATIN CAPITAL LETTER Q
+ 'R' # 0x52 -> LATIN CAPITAL LETTER R
+ 'S' # 0x53 -> LATIN CAPITAL LETTER S
+ 'T' # 0x54 -> LATIN CAPITAL LETTER T
+ 'U' # 0x55 -> LATIN CAPITAL LETTER U
+ 'V' # 0x56 -> LATIN CAPITAL LETTER V
+ 'W' # 0x57 -> LATIN CAPITAL LETTER W
+ 'X' # 0x58 -> LATIN CAPITAL LETTER X
+ 'Y' # 0x59 -> LATIN CAPITAL LETTER Y
+ 'Z' # 0x5A -> LATIN CAPITAL LETTER Z
+ '[' # 0x5B -> LEFT SQUARE BRACKET
+ '\\' # 0x5C -> REVERSE SOLIDUS
+ ']' # 0x5D -> RIGHT SQUARE BRACKET
+ '^' # 0x5E -> CIRCUMFLEX ACCENT
+ '_' # 0x5F -> LOW LINE
+ '`' # 0x60 -> GRAVE ACCENT
+ 'a' # 0x61 -> LATIN SMALL LETTER A
+ 'b' # 0x62 -> LATIN SMALL LETTER B
+ 'c' # 0x63 -> LATIN SMALL LETTER C
+ 'd' # 0x64 -> LATIN SMALL LETTER D
+ 'e' # 0x65 -> LATIN SMALL LETTER E
+ 'f' # 0x66 -> LATIN SMALL LETTER F
+ 'g' # 0x67 -> LATIN SMALL LETTER G
+ 'h' # 0x68 -> LATIN SMALL LETTER H
+ 'i' # 0x69 -> LATIN SMALL LETTER I
+ 'j' # 0x6A -> LATIN SMALL LETTER J
+ 'k' # 0x6B -> LATIN SMALL LETTER K
+ 'l' # 0x6C -> LATIN SMALL LETTER L
+ 'm' # 0x6D -> LATIN SMALL LETTER M
+ 'n' # 0x6E -> LATIN SMALL LETTER N
+ 'o' # 0x6F -> LATIN SMALL LETTER O
+ 'p' # 0x70 -> LATIN SMALL LETTER P
+ 'q' # 0x71 -> LATIN SMALL LETTER Q
+ 'r' # 0x72 -> LATIN SMALL LETTER R
+ 's' # 0x73 -> LATIN SMALL LETTER S
+ 't' # 0x74 -> LATIN SMALL LETTER T
+ 'u' # 0x75 -> LATIN SMALL LETTER U
+ 'v' # 0x76 -> LATIN SMALL LETTER V
+ 'w' # 0x77 -> LATIN SMALL LETTER W
+ 'x' # 0x78 -> LATIN SMALL LETTER X
+ 'y' # 0x79 -> LATIN SMALL LETTER Y
+ 'z' # 0x7A -> LATIN SMALL LETTER Z
+ '{' # 0x7B -> LEFT CURLY BRACKET
+ '|' # 0x7C -> VERTICAL LINE
+ '}' # 0x7D -> RIGHT CURLY BRACKET
+ '~' # 0x7E -> TILDE
+ '\x7f' # 0x7F -> CONTROL CHARACTER
+ '\x80'
+ '\x81'
+ '\xe9' # 0x82 -> LATIN SMALL LETTER E WITH ACUTE
+ '\xe2' # 0x83 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
+ '\x84'
+ '\xe0' # 0x85 -> LATIN SMALL LETTER A WITH GRAVE
+ '\x86'
+ '\xe7' # 0x87 -> LATIN SMALL LETTER C WITH CEDILLA
+ '\xea' # 0x88 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
+ '\xeb' # 0x89 -> LATIN SMALL LETTER E WITH DIAERESIS
+ '\xe8' # 0x8A -> LATIN SMALL LETTER E WITH GRAVE
+ '\xef' # 0x8B -> LATIN SMALL LETTER I WITH DIAERESIS
+ '\xee' # 0x8C -> LATIN SMALL LETTER I WITH CIRCUMFLEX
+ '\x8d'
+ '\x8e'
+ '\x8f'
+ '\x90'
+ '\u0651' # 0x91 -> ARABIC SHADDA
+ '\u0652' # 0x92 -> ARABIC SUKUN
+ '\xf4' # 0x93 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
+ '\xa4' # 0x94 -> CURRENCY SIGN
+ '\u0640' # 0x95 -> ARABIC TATWEEL
+ '\xfb' # 0x96 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
+ '\xf9' # 0x97 -> LATIN SMALL LETTER U WITH GRAVE
+ '\u0621' # 0x98 -> ARABIC LETTER HAMZA
+ '\u0622' # 0x99 -> ARABIC LETTER ALEF WITH MADDA ABOVE
+ '\u0623' # 0x9A -> ARABIC LETTER ALEF WITH HAMZA ABOVE
+ '\u0624' # 0x9B -> ARABIC LETTER WAW WITH HAMZA ABOVE
+ '\xa3' # 0x9C -> POUND SIGN
+ '\u0625' # 0x9D -> ARABIC LETTER ALEF WITH HAMZA BELOW
+ '\u0626' # 0x9E -> ARABIC LETTER YEH WITH HAMZA ABOVE
+ '\u0627' # 0x9F -> ARABIC LETTER ALEF
+ '\u0628' # 0xA0 -> ARABIC LETTER BEH
+ '\u0629' # 0xA1 -> ARABIC LETTER TEH MARBUTA
+ '\u062a' # 0xA2 -> ARABIC LETTER TEH
+ '\u062b' # 0xA3 -> ARABIC LETTER THEH
+ '\u062c' # 0xA4 -> ARABIC LETTER JEEM
+ '\u062d' # 0xA5 -> ARABIC LETTER HAH
+ '\u062e' # 0xA6 -> ARABIC LETTER KHAH
+ '\u062f' # 0xA7 -> ARABIC LETTER DAL
+ '\u0630' # 0xA8 -> ARABIC LETTER THAL
+ '\u0631' # 0xA9 -> ARABIC LETTER REH
+ '\u0632' # 0xAA -> ARABIC LETTER ZAIN
+ '\u0633' # 0xAB -> ARABIC LETTER SEEN
+ '\u0634' # 0xAC -> ARABIC LETTER SHEEN
+ '\u0635' # 0xAD -> ARABIC LETTER SAD
+ '\xab' # 0xAE -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ '\xbb' # 0xAF -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ '\u2591' # 0xB0 -> LIGHT SHADE
+ '\u2592' # 0xB1 -> MEDIUM SHADE
+ '\u2593' # 0xB2 -> DARK SHADE
+ '\u2502' # 0xB3 -> BOX DRAWINGS LIGHT VERTICAL
+ '\u2524' # 0xB4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
+ '\u2561' # 0xB5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+ '\u2562' # 0xB6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+ '\u2556' # 0xB7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+ '\u2555' # 0xB8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+ '\u2563' # 0xB9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+ '\u2551' # 0xBA -> BOX DRAWINGS DOUBLE VERTICAL
+ '\u2557' # 0xBB -> BOX DRAWINGS DOUBLE DOWN AND LEFT
+ '\u255d' # 0xBC -> BOX DRAWINGS DOUBLE UP AND LEFT
+ '\u255c' # 0xBD -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+ '\u255b' # 0xBE -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+ '\u2510' # 0xBF -> BOX DRAWINGS LIGHT DOWN AND LEFT
+ '\u2514' # 0xC0 -> BOX DRAWINGS LIGHT UP AND RIGHT
+ '\u2534' # 0xC1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
+ '\u252c' # 0xC2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+ '\u251c' # 0xC3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+ '\u2500' # 0xC4 -> BOX DRAWINGS LIGHT HORIZONTAL
+ '\u253c' # 0xC5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+ '\u255e' # 0xC6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+ '\u255f' # 0xC7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+ '\u255a' # 0xC8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
+ '\u2554' # 0xC9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
+ '\u2569' # 0xCA -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+ '\u2566' # 0xCB -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+ '\u2560' # 0xCC -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+ '\u2550' # 0xCD -> BOX DRAWINGS DOUBLE HORIZONTAL
+ '\u256c' # 0xCE -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+ '\u2567' # 0xCF -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+ '\u2568' # 0xD0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+ '\u2564' # 0xD1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+ '\u2565' # 0xD2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+ '\u2559' # 0xD3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+ '\u2558' # 0xD4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+ '\u2552' # 0xD5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+ '\u2553' # 0xD6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+ '\u256b' # 0xD7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+ '\u256a' # 0xD8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+ '\u2518' # 0xD9 -> BOX DRAWINGS LIGHT UP AND LEFT
+ '\u250c' # 0xDA -> BOX DRAWINGS LIGHT DOWN AND RIGHT
+ '\u2588' # 0xDB -> FULL BLOCK
+ '\u2584' # 0xDC -> LOWER HALF BLOCK
+ '\u258c' # 0xDD -> LEFT HALF BLOCK
+ '\u2590' # 0xDE -> RIGHT HALF BLOCK
+ '\u2580' # 0xDF -> UPPER HALF BLOCK
+ '\u0636' # 0xE0 -> ARABIC LETTER DAD
+ '\u0637' # 0xE1 -> ARABIC LETTER TAH
+ '\u0638' # 0xE2 -> ARABIC LETTER ZAH
+ '\u0639' # 0xE3 -> ARABIC LETTER AIN
+ '\u063a' # 0xE4 -> ARABIC LETTER GHAIN
+ '\u0641' # 0xE5 -> ARABIC LETTER FEH
+ '\xb5' # 0xE6 -> MICRO SIGN
+ '\u0642' # 0xE7 -> ARABIC LETTER QAF
+ '\u0643' # 0xE8 -> ARABIC LETTER KAF
+ '\u0644' # 0xE9 -> ARABIC LETTER LAM
+ '\u0645' # 0xEA -> ARABIC LETTER MEEM
+ '\u0646' # 0xEB -> ARABIC LETTER NOON
+ '\u0647' # 0xEC -> ARABIC LETTER HEH
+ '\u0648' # 0xED -> ARABIC LETTER WAW
+ '\u0649' # 0xEE -> ARABIC LETTER ALEF MAKSURA
+ '\u064a' # 0xEF -> ARABIC LETTER YEH
+ '\u2261' # 0xF0 -> IDENTICAL TO
+ '\u064b' # 0xF1 -> ARABIC FATHATAN
+ '\u064c' # 0xF2 -> ARABIC DAMMATAN
+ '\u064d' # 0xF3 -> ARABIC KASRATAN
+ '\u064e' # 0xF4 -> ARABIC FATHA
+ '\u064f' # 0xF5 -> ARABIC DAMMA
+ '\u0650' # 0xF6 -> ARABIC KASRA
+ '\u2248' # 0xF7 -> ALMOST EQUAL TO
+ '\xb0' # 0xF8 -> DEGREE SIGN
+ '\u2219' # 0xF9 -> BULLET OPERATOR
+ '\xb7' # 0xFA -> MIDDLE DOT
+ '\u221a' # 0xFB -> SQUARE ROOT
+ '\u207f' # 0xFC -> SUPERSCRIPT LATIN SMALL LETTER N
+ '\xb2' # 0xFD -> SUPERSCRIPT TWO
+ '\u25a0' # 0xFE -> BLACK SQUARE
+ '\xa0' # 0xFF -> NO-BREAK SPACE
+)
+
+### Encoding table
+encoding_table=codecs.charmap_build(decoding_table)
diff --git a/Lib/encodings/cp858.py b/Lib/encodings/cp858.py
new file mode 100644
index 0000000000..7579f52538
--- /dev/null
+++ b/Lib/encodings/cp858.py
@@ -0,0 +1,698 @@
+""" Python Character Mapping Codec for CP858, modified from cp850.
+
+"""
+
+import codecs
+
+### Codec APIs
+
+class Codec(codecs.Codec):
+
+ def encode(self,input,errors='strict'):
+ return codecs.charmap_encode(input,errors,encoding_map)
+
+ def decode(self,input,errors='strict'):
+ return codecs.charmap_decode(input,errors,decoding_table)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+ def encode(self, input, final=False):
+ return codecs.charmap_encode(input,self.errors,encoding_map)[0]
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+ def decode(self, input, final=False):
+ return codecs.charmap_decode(input,self.errors,decoding_table)[0]
+
+class StreamWriter(Codec,codecs.StreamWriter):
+ pass
+
+class StreamReader(Codec,codecs.StreamReader):
+ pass
+
+### encodings module API
+
+def getregentry():
+ return codecs.CodecInfo(
+ name='cp858',
+ encode=Codec().encode,
+ decode=Codec().decode,
+ incrementalencoder=IncrementalEncoder,
+ incrementaldecoder=IncrementalDecoder,
+ streamreader=StreamReader,
+ streamwriter=StreamWriter,
+ )
+
+### Decoding Map
+
+decoding_map = codecs.make_identity_dict(range(256))
+decoding_map.update({
+ 0x0080: 0x00c7, # LATIN CAPITAL LETTER C WITH CEDILLA
+ 0x0081: 0x00fc, # LATIN SMALL LETTER U WITH DIAERESIS
+ 0x0082: 0x00e9, # LATIN SMALL LETTER E WITH ACUTE
+ 0x0083: 0x00e2, # LATIN SMALL LETTER A WITH CIRCUMFLEX
+ 0x0084: 0x00e4, # LATIN SMALL LETTER A WITH DIAERESIS
+ 0x0085: 0x00e0, # LATIN SMALL LETTER A WITH GRAVE
+ 0x0086: 0x00e5, # LATIN SMALL LETTER A WITH RING ABOVE
+ 0x0087: 0x00e7, # LATIN SMALL LETTER C WITH CEDILLA
+ 0x0088: 0x00ea, # LATIN SMALL LETTER E WITH CIRCUMFLEX
+ 0x0089: 0x00eb, # LATIN SMALL LETTER E WITH DIAERESIS
+ 0x008a: 0x00e8, # LATIN SMALL LETTER E WITH GRAVE
+ 0x008b: 0x00ef, # LATIN SMALL LETTER I WITH DIAERESIS
+ 0x008c: 0x00ee, # LATIN SMALL LETTER I WITH CIRCUMFLEX
+ 0x008d: 0x00ec, # LATIN SMALL LETTER I WITH GRAVE
+ 0x008e: 0x00c4, # LATIN CAPITAL LETTER A WITH DIAERESIS
+ 0x008f: 0x00c5, # LATIN CAPITAL LETTER A WITH RING ABOVE
+ 0x0090: 0x00c9, # LATIN CAPITAL LETTER E WITH ACUTE
+ 0x0091: 0x00e6, # LATIN SMALL LIGATURE AE
+ 0x0092: 0x00c6, # LATIN CAPITAL LIGATURE AE
+ 0x0093: 0x00f4, # LATIN SMALL LETTER O WITH CIRCUMFLEX
+ 0x0094: 0x00f6, # LATIN SMALL LETTER O WITH DIAERESIS
+ 0x0095: 0x00f2, # LATIN SMALL LETTER O WITH GRAVE
+ 0x0096: 0x00fb, # LATIN SMALL LETTER U WITH CIRCUMFLEX
+ 0x0097: 0x00f9, # LATIN SMALL LETTER U WITH GRAVE
+ 0x0098: 0x00ff, # LATIN SMALL LETTER Y WITH DIAERESIS
+ 0x0099: 0x00d6, # LATIN CAPITAL LETTER O WITH DIAERESIS
+ 0x009a: 0x00dc, # LATIN CAPITAL LETTER U WITH DIAERESIS
+ 0x009b: 0x00f8, # LATIN SMALL LETTER O WITH STROKE
+ 0x009c: 0x00a3, # POUND SIGN
+ 0x009d: 0x00d8, # LATIN CAPITAL LETTER O WITH STROKE
+ 0x009e: 0x00d7, # MULTIPLICATION SIGN
+ 0x009f: 0x0192, # LATIN SMALL LETTER F WITH HOOK
+ 0x00a0: 0x00e1, # LATIN SMALL LETTER A WITH ACUTE
+ 0x00a1: 0x00ed, # LATIN SMALL LETTER I WITH ACUTE
+ 0x00a2: 0x00f3, # LATIN SMALL LETTER O WITH ACUTE
+ 0x00a3: 0x00fa, # LATIN SMALL LETTER U WITH ACUTE
+ 0x00a4: 0x00f1, # LATIN SMALL LETTER N WITH TILDE
+ 0x00a5: 0x00d1, # LATIN CAPITAL LETTER N WITH TILDE
+ 0x00a6: 0x00aa, # FEMININE ORDINAL INDICATOR
+ 0x00a7: 0x00ba, # MASCULINE ORDINAL INDICATOR
+ 0x00a8: 0x00bf, # INVERTED QUESTION MARK
+ 0x00a9: 0x00ae, # REGISTERED SIGN
+ 0x00aa: 0x00ac, # NOT SIGN
+ 0x00ab: 0x00bd, # VULGAR FRACTION ONE HALF
+ 0x00ac: 0x00bc, # VULGAR FRACTION ONE QUARTER
+ 0x00ad: 0x00a1, # INVERTED EXCLAMATION MARK
+ 0x00ae: 0x00ab, # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ 0x00af: 0x00bb, # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ 0x00b0: 0x2591, # LIGHT SHADE
+ 0x00b1: 0x2592, # MEDIUM SHADE
+ 0x00b2: 0x2593, # DARK SHADE
+ 0x00b3: 0x2502, # BOX DRAWINGS LIGHT VERTICAL
+ 0x00b4: 0x2524, # BOX DRAWINGS LIGHT VERTICAL AND LEFT
+ 0x00b5: 0x00c1, # LATIN CAPITAL LETTER A WITH ACUTE
+ 0x00b6: 0x00c2, # LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+ 0x00b7: 0x00c0, # LATIN CAPITAL LETTER A WITH GRAVE
+ 0x00b8: 0x00a9, # COPYRIGHT SIGN
+ 0x00b9: 0x2563, # BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+ 0x00ba: 0x2551, # BOX DRAWINGS DOUBLE VERTICAL
+ 0x00bb: 0x2557, # BOX DRAWINGS DOUBLE DOWN AND LEFT
+ 0x00bc: 0x255d, # BOX DRAWINGS DOUBLE UP AND LEFT
+ 0x00bd: 0x00a2, # CENT SIGN
+ 0x00be: 0x00a5, # YEN SIGN
+ 0x00bf: 0x2510, # BOX DRAWINGS LIGHT DOWN AND LEFT
+ 0x00c0: 0x2514, # BOX DRAWINGS LIGHT UP AND RIGHT
+ 0x00c1: 0x2534, # BOX DRAWINGS LIGHT UP AND HORIZONTAL
+ 0x00c2: 0x252c, # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+ 0x00c3: 0x251c, # BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+ 0x00c4: 0x2500, # BOX DRAWINGS LIGHT HORIZONTAL
+ 0x00c5: 0x253c, # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+ 0x00c6: 0x00e3, # LATIN SMALL LETTER A WITH TILDE
+ 0x00c7: 0x00c3, # LATIN CAPITAL LETTER A WITH TILDE
+ 0x00c8: 0x255a, # BOX DRAWINGS DOUBLE UP AND RIGHT
+ 0x00c9: 0x2554, # BOX DRAWINGS DOUBLE DOWN AND RIGHT
+ 0x00ca: 0x2569, # BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+ 0x00cb: 0x2566, # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+ 0x00cc: 0x2560, # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+ 0x00cd: 0x2550, # BOX DRAWINGS DOUBLE HORIZONTAL
+ 0x00ce: 0x256c, # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+ 0x00cf: 0x00a4, # CURRENCY SIGN
+ 0x00d0: 0x00f0, # LATIN SMALL LETTER ETH
+ 0x00d1: 0x00d0, # LATIN CAPITAL LETTER ETH
+ 0x00d2: 0x00ca, # LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+ 0x00d3: 0x00cb, # LATIN CAPITAL LETTER E WITH DIAERESIS
+ 0x00d4: 0x00c8, # LATIN CAPITAL LETTER E WITH GRAVE
+ 0x00d5: 0x20ac, # EURO SIGN
+ 0x00d6: 0x00cd, # LATIN CAPITAL LETTER I WITH ACUTE
+ 0x00d7: 0x00ce, # LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+ 0x00d8: 0x00cf, # LATIN CAPITAL LETTER I WITH DIAERESIS
+ 0x00d9: 0x2518, # BOX DRAWINGS LIGHT UP AND LEFT
+ 0x00da: 0x250c, # BOX DRAWINGS LIGHT DOWN AND RIGHT
+ 0x00db: 0x2588, # FULL BLOCK
+ 0x00dc: 0x2584, # LOWER HALF BLOCK
+ 0x00dd: 0x00a6, # BROKEN BAR
+ 0x00de: 0x00cc, # LATIN CAPITAL LETTER I WITH GRAVE
+ 0x00df: 0x2580, # UPPER HALF BLOCK
+ 0x00e0: 0x00d3, # LATIN CAPITAL LETTER O WITH ACUTE
+ 0x00e1: 0x00df, # LATIN SMALL LETTER SHARP S
+ 0x00e2: 0x00d4, # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+ 0x00e3: 0x00d2, # LATIN CAPITAL LETTER O WITH GRAVE
+ 0x00e4: 0x00f5, # LATIN SMALL LETTER O WITH TILDE
+ 0x00e5: 0x00d5, # LATIN CAPITAL LETTER O WITH TILDE
+ 0x00e6: 0x00b5, # MICRO SIGN
+ 0x00e7: 0x00fe, # LATIN SMALL LETTER THORN
+ 0x00e8: 0x00de, # LATIN CAPITAL LETTER THORN
+ 0x00e9: 0x00da, # LATIN CAPITAL LETTER U WITH ACUTE
+ 0x00ea: 0x00db, # LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+ 0x00eb: 0x00d9, # LATIN CAPITAL LETTER U WITH GRAVE
+ 0x00ec: 0x00fd, # LATIN SMALL LETTER Y WITH ACUTE
+ 0x00ed: 0x00dd, # LATIN CAPITAL LETTER Y WITH ACUTE
+ 0x00ee: 0x00af, # MACRON
+ 0x00ef: 0x00b4, # ACUTE ACCENT
+ 0x00f0: 0x00ad, # SOFT HYPHEN
+ 0x00f1: 0x00b1, # PLUS-MINUS SIGN
+ 0x00f2: 0x2017, # DOUBLE LOW LINE
+ 0x00f3: 0x00be, # VULGAR FRACTION THREE QUARTERS
+ 0x00f4: 0x00b6, # PILCROW SIGN
+ 0x00f5: 0x00a7, # SECTION SIGN
+ 0x00f6: 0x00f7, # DIVISION SIGN
+ 0x00f7: 0x00b8, # CEDILLA
+ 0x00f8: 0x00b0, # DEGREE SIGN
+ 0x00f9: 0x00a8, # DIAERESIS
+ 0x00fa: 0x00b7, # MIDDLE DOT
+ 0x00fb: 0x00b9, # SUPERSCRIPT ONE
+ 0x00fc: 0x00b3, # SUPERSCRIPT THREE
+ 0x00fd: 0x00b2, # SUPERSCRIPT TWO
+ 0x00fe: 0x25a0, # BLACK SQUARE
+ 0x00ff: 0x00a0, # NO-BREAK SPACE
+})
+
+### Decoding Table
+
+decoding_table = (
+ '\x00' # 0x0000 -> NULL
+ '\x01' # 0x0001 -> START OF HEADING
+ '\x02' # 0x0002 -> START OF TEXT
+ '\x03' # 0x0003 -> END OF TEXT
+ '\x04' # 0x0004 -> END OF TRANSMISSION
+ '\x05' # 0x0005 -> ENQUIRY
+ '\x06' # 0x0006 -> ACKNOWLEDGE
+ '\x07' # 0x0007 -> BELL
+ '\x08' # 0x0008 -> BACKSPACE
+ '\t' # 0x0009 -> HORIZONTAL TABULATION
+ '\n' # 0x000a -> LINE FEED
+ '\x0b' # 0x000b -> VERTICAL TABULATION
+ '\x0c' # 0x000c -> FORM FEED
+ '\r' # 0x000d -> CARRIAGE RETURN
+ '\x0e' # 0x000e -> SHIFT OUT
+ '\x0f' # 0x000f -> SHIFT IN
+ '\x10' # 0x0010 -> DATA LINK ESCAPE
+ '\x11' # 0x0011 -> DEVICE CONTROL ONE
+ '\x12' # 0x0012 -> DEVICE CONTROL TWO
+ '\x13' # 0x0013 -> DEVICE CONTROL THREE
+ '\x14' # 0x0014 -> DEVICE CONTROL FOUR
+ '\x15' # 0x0015 -> NEGATIVE ACKNOWLEDGE
+ '\x16' # 0x0016 -> SYNCHRONOUS IDLE
+ '\x17' # 0x0017 -> END OF TRANSMISSION BLOCK
+ '\x18' # 0x0018 -> CANCEL
+ '\x19' # 0x0019 -> END OF MEDIUM
+ '\x1a' # 0x001a -> SUBSTITUTE
+ '\x1b' # 0x001b -> ESCAPE
+ '\x1c' # 0x001c -> FILE SEPARATOR
+ '\x1d' # 0x001d -> GROUP SEPARATOR
+ '\x1e' # 0x001e -> RECORD SEPARATOR
+ '\x1f' # 0x001f -> UNIT SEPARATOR
+ ' ' # 0x0020 -> SPACE
+ '!' # 0x0021 -> EXCLAMATION MARK
+ '"' # 0x0022 -> QUOTATION MARK
+ '#' # 0x0023 -> NUMBER SIGN
+ '$' # 0x0024 -> DOLLAR SIGN
+ '%' # 0x0025 -> PERCENT SIGN
+ '&' # 0x0026 -> AMPERSAND
+ "'" # 0x0027 -> APOSTROPHE
+ '(' # 0x0028 -> LEFT PARENTHESIS
+ ')' # 0x0029 -> RIGHT PARENTHESIS
+ '*' # 0x002a -> ASTERISK
+ '+' # 0x002b -> PLUS SIGN
+ ',' # 0x002c -> COMMA
+ '-' # 0x002d -> HYPHEN-MINUS
+ '.' # 0x002e -> FULL STOP
+ '/' # 0x002f -> SOLIDUS
+ '0' # 0x0030 -> DIGIT ZERO
+ '1' # 0x0031 -> DIGIT ONE
+ '2' # 0x0032 -> DIGIT TWO
+ '3' # 0x0033 -> DIGIT THREE
+ '4' # 0x0034 -> DIGIT FOUR
+ '5' # 0x0035 -> DIGIT FIVE
+ '6' # 0x0036 -> DIGIT SIX
+ '7' # 0x0037 -> DIGIT SEVEN
+ '8' # 0x0038 -> DIGIT EIGHT
+ '9' # 0x0039 -> DIGIT NINE
+ ':' # 0x003a -> COLON
+ ';' # 0x003b -> SEMICOLON
+ '<' # 0x003c -> LESS-THAN SIGN
+ '=' # 0x003d -> EQUALS SIGN
+ '>' # 0x003e -> GREATER-THAN SIGN
+ '?' # 0x003f -> QUESTION MARK
+ '@' # 0x0040 -> COMMERCIAL AT
+ 'A' # 0x0041 -> LATIN CAPITAL LETTER A
+ 'B' # 0x0042 -> LATIN CAPITAL LETTER B
+ 'C' # 0x0043 -> LATIN CAPITAL LETTER C
+ 'D' # 0x0044 -> LATIN CAPITAL LETTER D
+ 'E' # 0x0045 -> LATIN CAPITAL LETTER E
+ 'F' # 0x0046 -> LATIN CAPITAL LETTER F
+ 'G' # 0x0047 -> LATIN CAPITAL LETTER G
+ 'H' # 0x0048 -> LATIN CAPITAL LETTER H
+ 'I' # 0x0049 -> LATIN CAPITAL LETTER I
+ 'J' # 0x004a -> LATIN CAPITAL LETTER J
+ 'K' # 0x004b -> LATIN CAPITAL LETTER K
+ 'L' # 0x004c -> LATIN CAPITAL LETTER L
+ 'M' # 0x004d -> LATIN CAPITAL LETTER M
+ 'N' # 0x004e -> LATIN CAPITAL LETTER N
+ 'O' # 0x004f -> LATIN CAPITAL LETTER O
+ 'P' # 0x0050 -> LATIN CAPITAL LETTER P
+ 'Q' # 0x0051 -> LATIN CAPITAL LETTER Q
+ 'R' # 0x0052 -> LATIN CAPITAL LETTER R
+ 'S' # 0x0053 -> LATIN CAPITAL LETTER S
+ 'T' # 0x0054 -> LATIN CAPITAL LETTER T
+ 'U' # 0x0055 -> LATIN CAPITAL LETTER U
+ 'V' # 0x0056 -> LATIN CAPITAL LETTER V
+ 'W' # 0x0057 -> LATIN CAPITAL LETTER W
+ 'X' # 0x0058 -> LATIN CAPITAL LETTER X
+ 'Y' # 0x0059 -> LATIN CAPITAL LETTER Y
+ 'Z' # 0x005a -> LATIN CAPITAL LETTER Z
+ '[' # 0x005b -> LEFT SQUARE BRACKET
+ '\\' # 0x005c -> REVERSE SOLIDUS
+ ']' # 0x005d -> RIGHT SQUARE BRACKET
+ '^' # 0x005e -> CIRCUMFLEX ACCENT
+ '_' # 0x005f -> LOW LINE
+ '`' # 0x0060 -> GRAVE ACCENT
+ 'a' # 0x0061 -> LATIN SMALL LETTER A
+ 'b' # 0x0062 -> LATIN SMALL LETTER B
+ 'c' # 0x0063 -> LATIN SMALL LETTER C
+ 'd' # 0x0064 -> LATIN SMALL LETTER D
+ 'e' # 0x0065 -> LATIN SMALL LETTER E
+ 'f' # 0x0066 -> LATIN SMALL LETTER F
+ 'g' # 0x0067 -> LATIN SMALL LETTER G
+ 'h' # 0x0068 -> LATIN SMALL LETTER H
+ 'i' # 0x0069 -> LATIN SMALL LETTER I
+ 'j' # 0x006a -> LATIN SMALL LETTER J
+ 'k' # 0x006b -> LATIN SMALL LETTER K
+ 'l' # 0x006c -> LATIN SMALL LETTER L
+ 'm' # 0x006d -> LATIN SMALL LETTER M
+ 'n' # 0x006e -> LATIN SMALL LETTER N
+ 'o' # 0x006f -> LATIN SMALL LETTER O
+ 'p' # 0x0070 -> LATIN SMALL LETTER P
+ 'q' # 0x0071 -> LATIN SMALL LETTER Q
+ 'r' # 0x0072 -> LATIN SMALL LETTER R
+ 's' # 0x0073 -> LATIN SMALL LETTER S
+ 't' # 0x0074 -> LATIN SMALL LETTER T
+ 'u' # 0x0075 -> LATIN SMALL LETTER U
+ 'v' # 0x0076 -> LATIN SMALL LETTER V
+ 'w' # 0x0077 -> LATIN SMALL LETTER W
+ 'x' # 0x0078 -> LATIN SMALL LETTER X
+ 'y' # 0x0079 -> LATIN SMALL LETTER Y
+ 'z' # 0x007a -> LATIN SMALL LETTER Z
+ '{' # 0x007b -> LEFT CURLY BRACKET
+ '|' # 0x007c -> VERTICAL LINE
+ '}' # 0x007d -> RIGHT CURLY BRACKET
+ '~' # 0x007e -> TILDE
+ '\x7f' # 0x007f -> DELETE
+ '\xc7' # 0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
+ '\xfc' # 0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
+ '\xe9' # 0x0082 -> LATIN SMALL LETTER E WITH ACUTE
+ '\xe2' # 0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
+ '\xe4' # 0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS
+ '\xe0' # 0x0085 -> LATIN SMALL LETTER A WITH GRAVE
+ '\xe5' # 0x0086 -> LATIN SMALL LETTER A WITH RING ABOVE
+ '\xe7' # 0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
+ '\xea' # 0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
+ '\xeb' # 0x0089 -> LATIN SMALL LETTER E WITH DIAERESIS
+ '\xe8' # 0x008a -> LATIN SMALL LETTER E WITH GRAVE
+ '\xef' # 0x008b -> LATIN SMALL LETTER I WITH DIAERESIS
+ '\xee' # 0x008c -> LATIN SMALL LETTER I WITH CIRCUMFLEX
+ '\xec' # 0x008d -> LATIN SMALL LETTER I WITH GRAVE
+ '\xc4' # 0x008e -> LATIN CAPITAL LETTER A WITH DIAERESIS
+ '\xc5' # 0x008f -> LATIN CAPITAL LETTER A WITH RING ABOVE
+ '\xc9' # 0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
+ '\xe6' # 0x0091 -> LATIN SMALL LIGATURE AE
+ '\xc6' # 0x0092 -> LATIN CAPITAL LIGATURE AE
+ '\xf4' # 0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
+ '\xf6' # 0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
+ '\xf2' # 0x0095 -> LATIN SMALL LETTER O WITH GRAVE
+ '\xfb' # 0x0096 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
+ '\xf9' # 0x0097 -> LATIN SMALL LETTER U WITH GRAVE
+ '\xff' # 0x0098 -> LATIN SMALL LETTER Y WITH DIAERESIS
+ '\xd6' # 0x0099 -> LATIN CAPITAL LETTER O WITH DIAERESIS
+ '\xdc' # 0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
+ '\xf8' # 0x009b -> LATIN SMALL LETTER O WITH STROKE
+ '\xa3' # 0x009c -> POUND SIGN
+ '\xd8' # 0x009d -> LATIN CAPITAL LETTER O WITH STROKE
+ '\xd7' # 0x009e -> MULTIPLICATION SIGN
+ '\u0192' # 0x009f -> LATIN SMALL LETTER F WITH HOOK
+ '\xe1' # 0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
+ '\xed' # 0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
+ '\xf3' # 0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
+ '\xfa' # 0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
+ '\xf1' # 0x00a4 -> LATIN SMALL LETTER N WITH TILDE
+ '\xd1' # 0x00a5 -> LATIN CAPITAL LETTER N WITH TILDE
+ '\xaa' # 0x00a6 -> FEMININE ORDINAL INDICATOR
+ '\xba' # 0x00a7 -> MASCULINE ORDINAL INDICATOR
+ '\xbf' # 0x00a8 -> INVERTED QUESTION MARK
+ '\xae' # 0x00a9 -> REGISTERED SIGN
+ '\xac' # 0x00aa -> NOT SIGN
+ '\xbd' # 0x00ab -> VULGAR FRACTION ONE HALF
+ '\xbc' # 0x00ac -> VULGAR FRACTION ONE QUARTER
+ '\xa1' # 0x00ad -> INVERTED EXCLAMATION MARK
+ '\xab' # 0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ '\xbb' # 0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ '\u2591' # 0x00b0 -> LIGHT SHADE
+ '\u2592' # 0x00b1 -> MEDIUM SHADE
+ '\u2593' # 0x00b2 -> DARK SHADE
+ '\u2502' # 0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
+ '\u2524' # 0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
+ '\xc1' # 0x00b5 -> LATIN CAPITAL LETTER A WITH ACUTE
+ '\xc2' # 0x00b6 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+ '\xc0' # 0x00b7 -> LATIN CAPITAL LETTER A WITH GRAVE
+ '\xa9' # 0x00b8 -> COPYRIGHT SIGN
+ '\u2563' # 0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+ '\u2551' # 0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
+ '\u2557' # 0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
+ '\u255d' # 0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
+ '\xa2' # 0x00bd -> CENT SIGN
+ '\xa5' # 0x00be -> YEN SIGN
+ '\u2510' # 0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
+ '\u2514' # 0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
+ '\u2534' # 0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
+ '\u252c' # 0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+ '\u251c' # 0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+ '\u2500' # 0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
+ '\u253c' # 0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+ '\xe3' # 0x00c6 -> LATIN SMALL LETTER A WITH TILDE
+ '\xc3' # 0x00c7 -> LATIN CAPITAL LETTER A WITH TILDE
+ '\u255a' # 0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
+ '\u2554' # 0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
+ '\u2569' # 0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+ '\u2566' # 0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+ '\u2560' # 0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+ '\u2550' # 0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
+ '\u256c' # 0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+ '\xa4' # 0x00cf -> CURRENCY SIGN
+ '\xf0' # 0x00d0 -> LATIN SMALL LETTER ETH
+ '\xd0' # 0x00d1 -> LATIN CAPITAL LETTER ETH
+ '\xca' # 0x00d2 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+ '\xcb' # 0x00d3 -> LATIN CAPITAL LETTER E WITH DIAERESIS
+ '\xc8' # 0x00d4 -> LATIN CAPITAL LETTER E WITH GRAVE
+ '\u20ac' # 0x00d5 -> EURO SIGN
+ '\xcd' # 0x00d6 -> LATIN CAPITAL LETTER I WITH ACUTE
+ '\xce' # 0x00d7 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+ '\xcf' # 0x00d8 -> LATIN CAPITAL LETTER I WITH DIAERESIS
+ '\u2518' # 0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
+ '\u250c' # 0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
+ '\u2588' # 0x00db -> FULL BLOCK
+ '\u2584' # 0x00dc -> LOWER HALF BLOCK
+ '\xa6' # 0x00dd -> BROKEN BAR
+ '\xcc' # 0x00de -> LATIN CAPITAL LETTER I WITH GRAVE
+ '\u2580' # 0x00df -> UPPER HALF BLOCK
+ '\xd3' # 0x00e0 -> LATIN CAPITAL LETTER O WITH ACUTE
+ '\xdf' # 0x00e1 -> LATIN SMALL LETTER SHARP S
+ '\xd4' # 0x00e2 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+ '\xd2' # 0x00e3 -> LATIN CAPITAL LETTER O WITH GRAVE
+ '\xf5' # 0x00e4 -> LATIN SMALL LETTER O WITH TILDE
+ '\xd5' # 0x00e5 -> LATIN CAPITAL LETTER O WITH TILDE
+ '\xb5' # 0x00e6 -> MICRO SIGN
+ '\xfe' # 0x00e7 -> LATIN SMALL LETTER THORN
+ '\xde' # 0x00e8 -> LATIN CAPITAL LETTER THORN
+ '\xda' # 0x00e9 -> LATIN CAPITAL LETTER U WITH ACUTE
+ '\xdb' # 0x00ea -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+ '\xd9' # 0x00eb -> LATIN CAPITAL LETTER U WITH GRAVE
+ '\xfd' # 0x00ec -> LATIN SMALL LETTER Y WITH ACUTE
+ '\xdd' # 0x00ed -> LATIN CAPITAL LETTER Y WITH ACUTE
+ '\xaf' # 0x00ee -> MACRON
+ '\xb4' # 0x00ef -> ACUTE ACCENT
+ '\xad' # 0x00f0 -> SOFT HYPHEN
+ '\xb1' # 0x00f1 -> PLUS-MINUS SIGN
+ '\u2017' # 0x00f2 -> DOUBLE LOW LINE
+ '\xbe' # 0x00f3 -> VULGAR FRACTION THREE QUARTERS
+ '\xb6' # 0x00f4 -> PILCROW SIGN
+ '\xa7' # 0x00f5 -> SECTION SIGN
+ '\xf7' # 0x00f6 -> DIVISION SIGN
+ '\xb8' # 0x00f7 -> CEDILLA
+ '\xb0' # 0x00f8 -> DEGREE SIGN
+ '\xa8' # 0x00f9 -> DIAERESIS
+ '\xb7' # 0x00fa -> MIDDLE DOT
+ '\xb9' # 0x00fb -> SUPERSCRIPT ONE
+ '\xb3' # 0x00fc -> SUPERSCRIPT THREE
+ '\xb2' # 0x00fd -> SUPERSCRIPT TWO
+ '\u25a0' # 0x00fe -> BLACK SQUARE
+ '\xa0' # 0x00ff -> NO-BREAK SPACE
+)
+
+### Encoding Map
+
+encoding_map = {
+ 0x0000: 0x0000, # NULL
+ 0x0001: 0x0001, # START OF HEADING
+ 0x0002: 0x0002, # START OF TEXT
+ 0x0003: 0x0003, # END OF TEXT
+ 0x0004: 0x0004, # END OF TRANSMISSION
+ 0x0005: 0x0005, # ENQUIRY
+ 0x0006: 0x0006, # ACKNOWLEDGE
+ 0x0007: 0x0007, # BELL
+ 0x0008: 0x0008, # BACKSPACE
+ 0x0009: 0x0009, # HORIZONTAL TABULATION
+ 0x000a: 0x000a, # LINE FEED
+ 0x000b: 0x000b, # VERTICAL TABULATION
+ 0x000c: 0x000c, # FORM FEED
+ 0x000d: 0x000d, # CARRIAGE RETURN
+ 0x000e: 0x000e, # SHIFT OUT
+ 0x000f: 0x000f, # SHIFT IN
+ 0x0010: 0x0010, # DATA LINK ESCAPE
+ 0x0011: 0x0011, # DEVICE CONTROL ONE
+ 0x0012: 0x0012, # DEVICE CONTROL TWO
+ 0x0013: 0x0013, # DEVICE CONTROL THREE
+ 0x0014: 0x0014, # DEVICE CONTROL FOUR
+ 0x0015: 0x0015, # NEGATIVE ACKNOWLEDGE
+ 0x0016: 0x0016, # SYNCHRONOUS IDLE
+ 0x0017: 0x0017, # END OF TRANSMISSION BLOCK
+ 0x0018: 0x0018, # CANCEL
+ 0x0019: 0x0019, # END OF MEDIUM
+ 0x001a: 0x001a, # SUBSTITUTE
+ 0x001b: 0x001b, # ESCAPE
+ 0x001c: 0x001c, # FILE SEPARATOR
+ 0x001d: 0x001d, # GROUP SEPARATOR
+ 0x001e: 0x001e, # RECORD SEPARATOR
+ 0x001f: 0x001f, # UNIT SEPARATOR
+ 0x0020: 0x0020, # SPACE
+ 0x0021: 0x0021, # EXCLAMATION MARK
+ 0x0022: 0x0022, # QUOTATION MARK
+ 0x0023: 0x0023, # NUMBER SIGN
+ 0x0024: 0x0024, # DOLLAR SIGN
+ 0x0025: 0x0025, # PERCENT SIGN
+ 0x0026: 0x0026, # AMPERSAND
+ 0x0027: 0x0027, # APOSTROPHE
+ 0x0028: 0x0028, # LEFT PARENTHESIS
+ 0x0029: 0x0029, # RIGHT PARENTHESIS
+ 0x002a: 0x002a, # ASTERISK
+ 0x002b: 0x002b, # PLUS SIGN
+ 0x002c: 0x002c, # COMMA
+ 0x002d: 0x002d, # HYPHEN-MINUS
+ 0x002e: 0x002e, # FULL STOP
+ 0x002f: 0x002f, # SOLIDUS
+ 0x0030: 0x0030, # DIGIT ZERO
+ 0x0031: 0x0031, # DIGIT ONE
+ 0x0032: 0x0032, # DIGIT TWO
+ 0x0033: 0x0033, # DIGIT THREE
+ 0x0034: 0x0034, # DIGIT FOUR
+ 0x0035: 0x0035, # DIGIT FIVE
+ 0x0036: 0x0036, # DIGIT SIX
+ 0x0037: 0x0037, # DIGIT SEVEN
+ 0x0038: 0x0038, # DIGIT EIGHT
+ 0x0039: 0x0039, # DIGIT NINE
+ 0x003a: 0x003a, # COLON
+ 0x003b: 0x003b, # SEMICOLON
+ 0x003c: 0x003c, # LESS-THAN SIGN
+ 0x003d: 0x003d, # EQUALS SIGN
+ 0x003e: 0x003e, # GREATER-THAN SIGN
+ 0x003f: 0x003f, # QUESTION MARK
+ 0x0040: 0x0040, # COMMERCIAL AT
+ 0x0041: 0x0041, # LATIN CAPITAL LETTER A
+ 0x0042: 0x0042, # LATIN CAPITAL LETTER B
+ 0x0043: 0x0043, # LATIN CAPITAL LETTER C
+ 0x0044: 0x0044, # LATIN CAPITAL LETTER D
+ 0x0045: 0x0045, # LATIN CAPITAL LETTER E
+ 0x0046: 0x0046, # LATIN CAPITAL LETTER F
+ 0x0047: 0x0047, # LATIN CAPITAL LETTER G
+ 0x0048: 0x0048, # LATIN CAPITAL LETTER H
+ 0x0049: 0x0049, # LATIN CAPITAL LETTER I
+ 0x004a: 0x004a, # LATIN CAPITAL LETTER J
+ 0x004b: 0x004b, # LATIN CAPITAL LETTER K
+ 0x004c: 0x004c, # LATIN CAPITAL LETTER L
+ 0x004d: 0x004d, # LATIN CAPITAL LETTER M
+ 0x004e: 0x004e, # LATIN CAPITAL LETTER N
+ 0x004f: 0x004f, # LATIN CAPITAL LETTER O
+ 0x0050: 0x0050, # LATIN CAPITAL LETTER P
+ 0x0051: 0x0051, # LATIN CAPITAL LETTER Q
+ 0x0052: 0x0052, # LATIN CAPITAL LETTER R
+ 0x0053: 0x0053, # LATIN CAPITAL LETTER S
+ 0x0054: 0x0054, # LATIN CAPITAL LETTER T
+ 0x0055: 0x0055, # LATIN CAPITAL LETTER U
+ 0x0056: 0x0056, # LATIN CAPITAL LETTER V
+ 0x0057: 0x0057, # LATIN CAPITAL LETTER W
+ 0x0058: 0x0058, # LATIN CAPITAL LETTER X
+ 0x0059: 0x0059, # LATIN CAPITAL LETTER Y
+ 0x005a: 0x005a, # LATIN CAPITAL LETTER Z
+ 0x005b: 0x005b, # LEFT SQUARE BRACKET
+ 0x005c: 0x005c, # REVERSE SOLIDUS
+ 0x005d: 0x005d, # RIGHT SQUARE BRACKET
+ 0x005e: 0x005e, # CIRCUMFLEX ACCENT
+ 0x005f: 0x005f, # LOW LINE
+ 0x0060: 0x0060, # GRAVE ACCENT
+ 0x0061: 0x0061, # LATIN SMALL LETTER A
+ 0x0062: 0x0062, # LATIN SMALL LETTER B
+ 0x0063: 0x0063, # LATIN SMALL LETTER C
+ 0x0064: 0x0064, # LATIN SMALL LETTER D
+ 0x0065: 0x0065, # LATIN SMALL LETTER E
+ 0x0066: 0x0066, # LATIN SMALL LETTER F
+ 0x0067: 0x0067, # LATIN SMALL LETTER G
+ 0x0068: 0x0068, # LATIN SMALL LETTER H
+ 0x0069: 0x0069, # LATIN SMALL LETTER I
+ 0x006a: 0x006a, # LATIN SMALL LETTER J
+ 0x006b: 0x006b, # LATIN SMALL LETTER K
+ 0x006c: 0x006c, # LATIN SMALL LETTER L
+ 0x006d: 0x006d, # LATIN SMALL LETTER M
+ 0x006e: 0x006e, # LATIN SMALL LETTER N
+ 0x006f: 0x006f, # LATIN SMALL LETTER O
+ 0x0070: 0x0070, # LATIN SMALL LETTER P
+ 0x0071: 0x0071, # LATIN SMALL LETTER Q
+ 0x0072: 0x0072, # LATIN SMALL LETTER R
+ 0x0073: 0x0073, # LATIN SMALL LETTER S
+ 0x0074: 0x0074, # LATIN SMALL LETTER T
+ 0x0075: 0x0075, # LATIN SMALL LETTER U
+ 0x0076: 0x0076, # LATIN SMALL LETTER V
+ 0x0077: 0x0077, # LATIN SMALL LETTER W
+ 0x0078: 0x0078, # LATIN SMALL LETTER X
+ 0x0079: 0x0079, # LATIN SMALL LETTER Y
+ 0x007a: 0x007a, # LATIN SMALL LETTER Z
+ 0x007b: 0x007b, # LEFT CURLY BRACKET
+ 0x007c: 0x007c, # VERTICAL LINE
+ 0x007d: 0x007d, # RIGHT CURLY BRACKET
+ 0x007e: 0x007e, # TILDE
+ 0x007f: 0x007f, # DELETE
+ 0x00a0: 0x00ff, # NO-BREAK SPACE
+ 0x00a1: 0x00ad, # INVERTED EXCLAMATION MARK
+ 0x00a2: 0x00bd, # CENT SIGN
+ 0x00a3: 0x009c, # POUND SIGN
+ 0x00a4: 0x00cf, # CURRENCY SIGN
+ 0x00a5: 0x00be, # YEN SIGN
+ 0x00a6: 0x00dd, # BROKEN BAR
+ 0x00a7: 0x00f5, # SECTION SIGN
+ 0x00a8: 0x00f9, # DIAERESIS
+ 0x00a9: 0x00b8, # COPYRIGHT SIGN
+ 0x00aa: 0x00a6, # FEMININE ORDINAL INDICATOR
+ 0x00ab: 0x00ae, # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ 0x00ac: 0x00aa, # NOT SIGN
+ 0x00ad: 0x00f0, # SOFT HYPHEN
+ 0x00ae: 0x00a9, # REGISTERED SIGN
+ 0x00af: 0x00ee, # MACRON
+ 0x00b0: 0x00f8, # DEGREE SIGN
+ 0x00b1: 0x00f1, # PLUS-MINUS SIGN
+ 0x00b2: 0x00fd, # SUPERSCRIPT TWO
+ 0x00b3: 0x00fc, # SUPERSCRIPT THREE
+ 0x00b4: 0x00ef, # ACUTE ACCENT
+ 0x00b5: 0x00e6, # MICRO SIGN
+ 0x00b6: 0x00f4, # PILCROW SIGN
+ 0x00b7: 0x00fa, # MIDDLE DOT
+ 0x00b8: 0x00f7, # CEDILLA
+ 0x00b9: 0x00fb, # SUPERSCRIPT ONE
+ 0x00ba: 0x00a7, # MASCULINE ORDINAL INDICATOR
+ 0x00bb: 0x00af, # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ 0x00bc: 0x00ac, # VULGAR FRACTION ONE QUARTER
+ 0x00bd: 0x00ab, # VULGAR FRACTION ONE HALF
+ 0x00be: 0x00f3, # VULGAR FRACTION THREE QUARTERS
+ 0x00bf: 0x00a8, # INVERTED QUESTION MARK
+ 0x00c0: 0x00b7, # LATIN CAPITAL LETTER A WITH GRAVE
+ 0x00c1: 0x00b5, # LATIN CAPITAL LETTER A WITH ACUTE
+ 0x00c2: 0x00b6, # LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+ 0x00c3: 0x00c7, # LATIN CAPITAL LETTER A WITH TILDE
+ 0x00c4: 0x008e, # LATIN CAPITAL LETTER A WITH DIAERESIS
+ 0x00c5: 0x008f, # LATIN CAPITAL LETTER A WITH RING ABOVE
+ 0x00c6: 0x0092, # LATIN CAPITAL LIGATURE AE
+ 0x00c7: 0x0080, # LATIN CAPITAL LETTER C WITH CEDILLA
+ 0x00c8: 0x00d4, # LATIN CAPITAL LETTER E WITH GRAVE
+ 0x00c9: 0x0090, # LATIN CAPITAL LETTER E WITH ACUTE
+ 0x00ca: 0x00d2, # LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+ 0x00cb: 0x00d3, # LATIN CAPITAL LETTER E WITH DIAERESIS
+ 0x00cc: 0x00de, # LATIN CAPITAL LETTER I WITH GRAVE
+ 0x00cd: 0x00d6, # LATIN CAPITAL LETTER I WITH ACUTE
+ 0x00ce: 0x00d7, # LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+ 0x00cf: 0x00d8, # LATIN CAPITAL LETTER I WITH DIAERESIS
+ 0x00d0: 0x00d1, # LATIN CAPITAL LETTER ETH
+ 0x00d1: 0x00a5, # LATIN CAPITAL LETTER N WITH TILDE
+ 0x00d2: 0x00e3, # LATIN CAPITAL LETTER O WITH GRAVE
+ 0x00d3: 0x00e0, # LATIN CAPITAL LETTER O WITH ACUTE
+ 0x00d4: 0x00e2, # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+ 0x00d5: 0x00e5, # LATIN CAPITAL LETTER O WITH TILDE
+ 0x00d6: 0x0099, # LATIN CAPITAL LETTER O WITH DIAERESIS
+ 0x00d7: 0x009e, # MULTIPLICATION SIGN
+ 0x00d8: 0x009d, # LATIN CAPITAL LETTER O WITH STROKE
+ 0x00d9: 0x00eb, # LATIN CAPITAL LETTER U WITH GRAVE
+ 0x00da: 0x00e9, # LATIN CAPITAL LETTER U WITH ACUTE
+ 0x00db: 0x00ea, # LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+ 0x00dc: 0x009a, # LATIN CAPITAL LETTER U WITH DIAERESIS
+ 0x00dd: 0x00ed, # LATIN CAPITAL LETTER Y WITH ACUTE
+ 0x00de: 0x00e8, # LATIN CAPITAL LETTER THORN
+ 0x00df: 0x00e1, # LATIN SMALL LETTER SHARP S
+ 0x00e0: 0x0085, # LATIN SMALL LETTER A WITH GRAVE
+ 0x00e1: 0x00a0, # LATIN SMALL LETTER A WITH ACUTE
+ 0x00e2: 0x0083, # LATIN SMALL LETTER A WITH CIRCUMFLEX
+ 0x00e3: 0x00c6, # LATIN SMALL LETTER A WITH TILDE
+ 0x00e4: 0x0084, # LATIN SMALL LETTER A WITH DIAERESIS
+ 0x00e5: 0x0086, # LATIN SMALL LETTER A WITH RING ABOVE
+ 0x00e6: 0x0091, # LATIN SMALL LIGATURE AE
+ 0x00e7: 0x0087, # LATIN SMALL LETTER C WITH CEDILLA
+ 0x00e8: 0x008a, # LATIN SMALL LETTER E WITH GRAVE
+ 0x00e9: 0x0082, # LATIN SMALL LETTER E WITH ACUTE
+ 0x00ea: 0x0088, # LATIN SMALL LETTER E WITH CIRCUMFLEX
+ 0x00eb: 0x0089, # LATIN SMALL LETTER E WITH DIAERESIS
+ 0x00ec: 0x008d, # LATIN SMALL LETTER I WITH GRAVE
+ 0x00ed: 0x00a1, # LATIN SMALL LETTER I WITH ACUTE
+ 0x00ee: 0x008c, # LATIN SMALL LETTER I WITH CIRCUMFLEX
+ 0x00ef: 0x008b, # LATIN SMALL LETTER I WITH DIAERESIS
+ 0x00f0: 0x00d0, # LATIN SMALL LETTER ETH
+ 0x00f1: 0x00a4, # LATIN SMALL LETTER N WITH TILDE
+ 0x00f2: 0x0095, # LATIN SMALL LETTER O WITH GRAVE
+ 0x00f3: 0x00a2, # LATIN SMALL LETTER O WITH ACUTE
+ 0x00f4: 0x0093, # LATIN SMALL LETTER O WITH CIRCUMFLEX
+ 0x00f5: 0x00e4, # LATIN SMALL LETTER O WITH TILDE
+ 0x00f6: 0x0094, # LATIN SMALL LETTER O WITH DIAERESIS
+ 0x00f7: 0x00f6, # DIVISION SIGN
+ 0x00f8: 0x009b, # LATIN SMALL LETTER O WITH STROKE
+ 0x00f9: 0x0097, # LATIN SMALL LETTER U WITH GRAVE
+ 0x00fa: 0x00a3, # LATIN SMALL LETTER U WITH ACUTE
+ 0x00fb: 0x0096, # LATIN SMALL LETTER U WITH CIRCUMFLEX
+ 0x00fc: 0x0081, # LATIN SMALL LETTER U WITH DIAERESIS
+ 0x00fd: 0x00ec, # LATIN SMALL LETTER Y WITH ACUTE
+ 0x00fe: 0x00e7, # LATIN SMALL LETTER THORN
+ 0x00ff: 0x0098, # LATIN SMALL LETTER Y WITH DIAERESIS
+ 0x20ac: 0x00d5, # EURO SIGN
+ 0x0192: 0x009f, # LATIN SMALL LETTER F WITH HOOK
+ 0x2017: 0x00f2, # DOUBLE LOW LINE
+ 0x2500: 0x00c4, # BOX DRAWINGS LIGHT HORIZONTAL
+ 0x2502: 0x00b3, # BOX DRAWINGS LIGHT VERTICAL
+ 0x250c: 0x00da, # BOX DRAWINGS LIGHT DOWN AND RIGHT
+ 0x2510: 0x00bf, # BOX DRAWINGS LIGHT DOWN AND LEFT
+ 0x2514: 0x00c0, # BOX DRAWINGS LIGHT UP AND RIGHT
+ 0x2518: 0x00d9, # BOX DRAWINGS LIGHT UP AND LEFT
+ 0x251c: 0x00c3, # BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+ 0x2524: 0x00b4, # BOX DRAWINGS LIGHT VERTICAL AND LEFT
+ 0x252c: 0x00c2, # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+ 0x2534: 0x00c1, # BOX DRAWINGS LIGHT UP AND HORIZONTAL
+ 0x253c: 0x00c5, # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+ 0x2550: 0x00cd, # BOX DRAWINGS DOUBLE HORIZONTAL
+ 0x2551: 0x00ba, # BOX DRAWINGS DOUBLE VERTICAL
+ 0x2554: 0x00c9, # BOX DRAWINGS DOUBLE DOWN AND RIGHT
+ 0x2557: 0x00bb, # BOX DRAWINGS DOUBLE DOWN AND LEFT
+ 0x255a: 0x00c8, # BOX DRAWINGS DOUBLE UP AND RIGHT
+ 0x255d: 0x00bc, # BOX DRAWINGS DOUBLE UP AND LEFT
+ 0x2560: 0x00cc, # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+ 0x2563: 0x00b9, # BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+ 0x2566: 0x00cb, # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+ 0x2569: 0x00ca, # BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+ 0x256c: 0x00ce, # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+ 0x2580: 0x00df, # UPPER HALF BLOCK
+ 0x2584: 0x00dc, # LOWER HALF BLOCK
+ 0x2588: 0x00db, # FULL BLOCK
+ 0x2591: 0x00b0, # LIGHT SHADE
+ 0x2592: 0x00b1, # MEDIUM SHADE
+ 0x2593: 0x00b2, # DARK SHADE
+ 0x25a0: 0x00fe, # BLACK SQUARE
+}
diff --git a/Lib/encodings/hex_codec.py b/Lib/encodings/hex_codec.py
new file mode 100644
index 0000000000..e003fc3ff9
--- /dev/null
+++ b/Lib/encodings/hex_codec.py
@@ -0,0 +1,55 @@
+"""Python 'hex_codec' Codec - 2-digit hex content transfer encoding.
+
+This codec de/encodes from bytes to bytes and is therefore usable with
+bytes.transform() and bytes.untransform().
+
+Written by Marc-Andre Lemburg (mal@lemburg.com).
+"""
+
+import codecs
+import binascii
+
+### Codec APIs
+
+def hex_encode(input, errors='strict'):
+ assert errors == 'strict'
+ return (binascii.b2a_hex(input), len(input))
+
+def hex_decode(input, errors='strict'):
+ assert errors == 'strict'
+ return (binascii.a2b_hex(input), len(input))
+
+class Codec(codecs.Codec):
+ def encode(self, input, errors='strict'):
+ return hex_encode(input, errors)
+ def decode(self, input, errors='strict'):
+ return hex_decode(input, errors)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+ def encode(self, input, final=False):
+ assert self.errors == 'strict'
+ return binascii.b2a_hex(input)
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+ def decode(self, input, final=False):
+ assert self.errors == 'strict'
+ return binascii.a2b_hex(input)
+
+class StreamWriter(Codec, codecs.StreamWriter):
+ charbuffertype = bytes
+
+class StreamReader(Codec, codecs.StreamReader):
+ charbuffertype = bytes
+
+### encodings module API
+
+def getregentry():
+ return codecs.CodecInfo(
+ name='hex',
+ encode=hex_encode,
+ decode=hex_decode,
+ incrementalencoder=IncrementalEncoder,
+ incrementaldecoder=IncrementalDecoder,
+ streamwriter=StreamWriter,
+ streamreader=StreamReader,
+ )
diff --git a/Lib/encodings/punycode.py b/Lib/encodings/punycode.py
index 8129af2543..66c51013ea 100644
--- a/Lib/encodings/punycode.py
+++ b/Lib/encodings/punycode.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
""" Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
diff --git a/Lib/encodings/quopri_codec.py b/Lib/encodings/quopri_codec.py
new file mode 100644
index 0000000000..9243fc443b
--- /dev/null
+++ b/Lib/encodings/quopri_codec.py
@@ -0,0 +1,56 @@
+"""Codec for quoted-printable encoding.
+
+This codec de/encodes from bytes to bytes and is therefore usable with
+bytes.transform() and bytes.untransform().
+"""
+
+import codecs
+import quopri
+from io import BytesIO
+
+def quopri_encode(input, errors='strict'):
+ assert errors == 'strict'
+ f = BytesIO(input)
+ g = BytesIO()
+ quopri.encode(f, g, 1)
+ return (g.getvalue(), len(input))
+
+def quopri_decode(input, errors='strict'):
+ assert errors == 'strict'
+ f = BytesIO(input)
+ g = BytesIO()
+ quopri.decode(f, g)
+ return (g.getvalue(), len(input))
+
+class Codec(codecs.Codec):
+ def encode(self, input, errors='strict'):
+ return quopri_encode(input, errors)
+ def decode(self, input, errors='strict'):
+ return quopri_decode(input, errors)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+ def encode(self, input, final=False):
+ return quopri_encode(input, self.errors)[0]
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+ def decode(self, input, final=False):
+ return quopri_decode(input, self.errors)[0]
+
+class StreamWriter(Codec, codecs.StreamWriter):
+ charbuffertype = bytes
+
+class StreamReader(Codec, codecs.StreamReader):
+ charbuffertype = bytes
+
+# encodings module API
+
+def getregentry():
+ return codecs.CodecInfo(
+ name='quopri',
+ encode=quopri_encode,
+ decode=quopri_decode,
+ incrementalencoder=IncrementalEncoder,
+ incrementaldecoder=IncrementalDecoder,
+ streamwriter=StreamWriter,
+ streamreader=StreamReader,
+ )
diff --git a/Lib/encodings/rot_13.py b/Lib/encodings/rot_13.py
new file mode 100755
index 0000000000..3140c1432d
--- /dev/null
+++ b/Lib/encodings/rot_13.py
@@ -0,0 +1,113 @@
+#!/usr/bin/env python
+""" Python Character Mapping Codec for ROT13.
+
+This codec de/encodes from str to str and is therefore usable with
+str.transform() and str.untransform().
+
+Written by Marc-Andre Lemburg (mal@lemburg.com).
+"""
+
+import codecs
+
+### Codec APIs
+
+class Codec(codecs.Codec):
+ def encode(self, input, errors='strict'):
+ return (input.translate(rot13_map), len(input))
+
+ def decode(self, input, errors='strict'):
+ return (input.translate(rot13_map), len(input))
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+ def encode(self, input, final=False):
+ return input.translate(rot13_map)
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+ def decode(self, input, final=False):
+ return input.translate(rot13_map)
+
+class StreamWriter(Codec,codecs.StreamWriter):
+ pass
+
+class StreamReader(Codec,codecs.StreamReader):
+ pass
+
+### encodings module API
+
+def getregentry():
+ return codecs.CodecInfo(
+ name='rot-13',
+ encode=Codec().encode,
+ decode=Codec().decode,
+ incrementalencoder=IncrementalEncoder,
+ incrementaldecoder=IncrementalDecoder,
+ streamwriter=StreamWriter,
+ streamreader=StreamReader,
+ )
+
+### Map
+
+rot13_map = codecs.make_identity_dict(range(256))
+rot13_map.update({
+ 0x0041: 0x004e,
+ 0x0042: 0x004f,
+ 0x0043: 0x0050,
+ 0x0044: 0x0051,
+ 0x0045: 0x0052,
+ 0x0046: 0x0053,
+ 0x0047: 0x0054,
+ 0x0048: 0x0055,
+ 0x0049: 0x0056,
+ 0x004a: 0x0057,
+ 0x004b: 0x0058,
+ 0x004c: 0x0059,
+ 0x004d: 0x005a,
+ 0x004e: 0x0041,
+ 0x004f: 0x0042,
+ 0x0050: 0x0043,
+ 0x0051: 0x0044,
+ 0x0052: 0x0045,
+ 0x0053: 0x0046,
+ 0x0054: 0x0047,
+ 0x0055: 0x0048,
+ 0x0056: 0x0049,
+ 0x0057: 0x004a,
+ 0x0058: 0x004b,
+ 0x0059: 0x004c,
+ 0x005a: 0x004d,
+ 0x0061: 0x006e,
+ 0x0062: 0x006f,
+ 0x0063: 0x0070,
+ 0x0064: 0x0071,
+ 0x0065: 0x0072,
+ 0x0066: 0x0073,
+ 0x0067: 0x0074,
+ 0x0068: 0x0075,
+ 0x0069: 0x0076,
+ 0x006a: 0x0077,
+ 0x006b: 0x0078,
+ 0x006c: 0x0079,
+ 0x006d: 0x007a,
+ 0x006e: 0x0061,
+ 0x006f: 0x0062,
+ 0x0070: 0x0063,
+ 0x0071: 0x0064,
+ 0x0072: 0x0065,
+ 0x0073: 0x0066,
+ 0x0074: 0x0067,
+ 0x0075: 0x0068,
+ 0x0076: 0x0069,
+ 0x0077: 0x006a,
+ 0x0078: 0x006b,
+ 0x0079: 0x006c,
+ 0x007a: 0x006d,
+})
+
+### Filter API
+
+def rot13(infile, outfile):
+ outfile.write(infile.read().encode('rot-13'))
+
+if __name__ == '__main__':
+ import sys
+ rot13(sys.stdin, sys.stdout)
diff --git a/Lib/encodings/uu_codec.py b/Lib/encodings/uu_codec.py
new file mode 100644
index 0000000000..69c6f17c7f
--- /dev/null
+++ b/Lib/encodings/uu_codec.py
@@ -0,0 +1,99 @@
+"""Python 'uu_codec' Codec - UU content transfer encoding.
+
+This codec de/encodes from bytes to bytes and is therefore usable with
+bytes.transform() and bytes.untransform().
+
+Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
+adapted from uu.py which was written by Lance Ellinghouse and
+modified by Jack Jansen and Fredrik Lundh.
+"""
+
+import codecs
+import binascii
+from io import BytesIO
+
+### Codec APIs
+
+def uu_encode(input, errors='strict', filename='<data>', mode=0o666):
+ assert errors == 'strict'
+ infile = BytesIO(input)
+ outfile = BytesIO()
+ read = infile.read
+ write = outfile.write
+
+ # Encode
+ write(('begin %o %s\n' % (mode & 0o777, filename)).encode('ascii'))
+ chunk = read(45)
+ while chunk:
+ write(binascii.b2a_uu(chunk))
+ chunk = read(45)
+ write(b' \nend\n')
+
+ return (outfile.getvalue(), len(input))
+
+def uu_decode(input, errors='strict'):
+ assert errors == 'strict'
+ infile = BytesIO(input)
+ outfile = BytesIO()
+ readline = infile.readline
+ write = outfile.write
+
+ # Find start of encoded data
+ while 1:
+ s = readline()
+ if not s:
+ raise ValueError('Missing "begin" line in input data')
+ if s[:5] == b'begin':
+ break
+
+ # Decode
+ while True:
+ s = readline()
+ if not s or s == b'end\n':
+ break
+ try:
+ data = binascii.a2b_uu(s)
+ except binascii.Error as v:
+ # Workaround for broken uuencoders by /Fredrik Lundh
+ nbytes = (((ord(s[0])-32) & 63) * 4 + 5) / 3
+ data = binascii.a2b_uu(s[:nbytes])
+ #sys.stderr.write("Warning: %s\n" % str(v))
+ write(data)
+ if not s:
+ raise ValueError('Truncated input data')
+
+ return (outfile.getvalue(), len(input))
+
+class Codec(codecs.Codec):
+ def encode(self, input, errors='strict'):
+ return uu_encode(input, errors)
+
+ def decode(self, input, errors='strict'):
+ return uu_decode(input, errors)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+ def encode(self, input, final=False):
+ return uu_encode(input, self.errors)[0]
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+ def decode(self, input, final=False):
+ return uu_decode(input, self.errors)[0]
+
+class StreamWriter(Codec, codecs.StreamWriter):
+ charbuffertype = bytes
+
+class StreamReader(Codec, codecs.StreamReader):
+ charbuffertype = bytes
+
+### encodings module API
+
+def getregentry():
+ return codecs.CodecInfo(
+ name='uu',
+ encode=uu_encode,
+ decode=uu_decode,
+ incrementalencoder=IncrementalEncoder,
+ incrementaldecoder=IncrementalDecoder,
+ streamreader=StreamReader,
+ streamwriter=StreamWriter,
+ )
diff --git a/Lib/encodings/zlib_codec.py b/Lib/encodings/zlib_codec.py
new file mode 100644
index 0000000000..e0b9cdadbc
--- /dev/null
+++ b/Lib/encodings/zlib_codec.py
@@ -0,0 +1,77 @@
+"""Python 'zlib_codec' Codec - zlib compression encoding.
+
+This codec de/encodes from bytes to bytes and is therefore usable with
+bytes.transform() and bytes.untransform().
+
+Written by Marc-Andre Lemburg (mal@lemburg.com).
+"""
+
+import codecs
+import zlib # this codec needs the optional zlib module !
+
+### Codec APIs
+
+def zlib_encode(input, errors='strict'):
+ assert errors == 'strict'
+ return (zlib.compress(input), len(input))
+
+def zlib_decode(input, errors='strict'):
+ assert errors == 'strict'
+ return (zlib.decompress(input), len(input))
+
+class Codec(codecs.Codec):
+ def encode(self, input, errors='strict'):
+ return zlib_encode(input, errors)
+ def decode(self, input, errors='strict'):
+ return zlib_decode(input, errors)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+ def __init__(self, errors='strict'):
+ assert errors == 'strict'
+ self.errors = errors
+ self.compressobj = zlib.compressobj()
+
+ def encode(self, input, final=False):
+ if final:
+ c = self.compressobj.compress(input)
+ return c + self.compressobj.flush()
+ else:
+ return self.compressobj.compress(input)
+
+ def reset(self):
+ self.compressobj = zlib.compressobj()
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+ def __init__(self, errors='strict'):
+ assert errors == 'strict'
+ self.errors = errors
+ self.decompressobj = zlib.decompressobj()
+
+ def decode(self, input, final=False):
+ if final:
+ c = self.decompressobj.decompress(input)
+ return c + self.decompressobj.flush()
+ else:
+ return self.decompressobj.decompress(input)
+
+ def reset(self):
+ self.decompressobj = zlib.decompressobj()
+
+class StreamWriter(Codec, codecs.StreamWriter):
+ charbuffertype = bytes
+
+class StreamReader(Codec, codecs.StreamReader):
+ charbuffertype = bytes
+
+### encodings module API
+
+def getregentry():
+ return codecs.CodecInfo(
+ name='zlib',
+ encode=zlib_encode,
+ decode=zlib_decode,
+ incrementalencoder=IncrementalEncoder,
+ incrementaldecoder=IncrementalDecoder,
+ streamreader=StreamReader,
+ streamwriter=StreamWriter,
+ )
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index 90a600bf11..a25a021eb3 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -238,6 +238,12 @@ class FileInput:
self.nextfile()
self._files = ()
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, traceback):
+ self.close()
+
def __iter__(self):
return self
diff --git a/Lib/fnmatch.py b/Lib/fnmatch.py
index be1fd1d16c..726fbe556e 100644
--- a/Lib/fnmatch.py
+++ b/Lib/fnmatch.py
@@ -9,20 +9,13 @@ expression. They cache the compiled regular expressions for speed.
The function translate(PATTERN) returns a regular expression
corresponding to PATTERN. (It does not compile it.)
"""
-
+import os
+import posixpath
import re
+import functools
__all__ = ["filter", "fnmatch", "fnmatchcase", "translate"]
-_cache = {} # Maps text patterns to compiled regexen.
-_cacheb = {} # Ditto for bytes patterns.
-_MAXCACHE = 100 # Maximum size of caches
-
-def _purge():
- """Clear the pattern cache"""
- _cache.clear()
- _cacheb.clear()
-
def fnmatch(name, pat):
"""Test whether FILENAME matches PATTERN.
@@ -38,33 +31,25 @@ def fnmatch(name, pat):
if the operating system requires it.
If you don't want this, use fnmatchcase(FILENAME, PATTERN).
"""
-
- import os
name = os.path.normcase(name)
pat = os.path.normcase(pat)
return fnmatchcase(name, pat)
-def _compile_pattern(pat):
- cache = _cacheb if isinstance(pat, bytes) else _cache
- regex = cache.get(pat)
- if regex is None:
- if isinstance(pat, bytes):
- pat_str = str(pat, 'ISO-8859-1')
- res_str = translate(pat_str)
- res = bytes(res_str, 'ISO-8859-1')
- else:
- res = translate(pat)
- if len(cache) >= _MAXCACHE:
- cache.clear()
- cache[pat] = regex = re.compile(res)
- return regex.match
+@functools.lru_cache(maxsize=250)
+def _compile_pattern(pat, is_bytes=False):
+ if is_bytes:
+ pat_str = str(pat, 'ISO-8859-1')
+ res_str = translate(pat_str)
+ res = bytes(res_str, 'ISO-8859-1')
+ else:
+ res = translate(pat)
+ return re.compile(res).match
def filter(names, pat):
- """Return the subset of the list NAMES that match PAT"""
- import os,posixpath
+ """Return the subset of the list NAMES that match PAT."""
result = []
pat = os.path.normcase(pat)
- match = _compile_pattern(pat)
+ match = _compile_pattern(pat, isinstance(pat, bytes))
if os.path is posixpath:
# normcase on posix is NOP. Optimize it away from the loop.
for name in names:
@@ -82,10 +67,10 @@ def fnmatchcase(name, pat):
This is a version of fnmatch() which doesn't case-normalize
its arguments.
"""
-
- match = _compile_pattern(pat)
+ match = _compile_pattern(pat, isinstance(pat, bytes))
return match(name) is not None
+
def translate(pat):
"""Translate a shell PATTERN to a regular expression.
diff --git a/Lib/fractions.py b/Lib/fractions.py
index 27b27f40ff..8be52d2db8 100644
--- a/Lib/fractions.py
+++ b/Lib/fractions.py
@@ -3,10 +3,12 @@
"""Fraction, infinite-precision, real numbers."""
+from decimal import Decimal
import math
import numbers
import operator
import re
+import sys
__all__ = ['Fraction', 'gcd']
@@ -22,6 +24,12 @@ def gcd(a, b):
a, b = b, a%b
return a
+# Constants related to the hash implementation; hash(x) is based
+# on the reduction of x modulo the prime _PyHASH_MODULUS.
+_PyHASH_MODULUS = sys.hash_info.modulus
+# Value to be used for rationals that reduce to infinity modulo
+# _PyHASH_MODULUS.
+_PyHASH_INF = sys.hash_info.inf
_RATIONAL_FORMAT = re.compile(r"""
\A\s* # optional whitespace at the start, then
@@ -41,13 +49,21 @@ _RATIONAL_FORMAT = re.compile(r"""
class Fraction(numbers.Rational):
"""This class implements rational numbers.
- Fraction(8, 6) will produce a rational number equivalent to
- 4/3. Both arguments must be Integral. The numerator defaults to 0
- and the denominator defaults to 1 so that Fraction(3) == 3 and
- Fraction() == 0.
+ In the two-argument form of the constructor, Fraction(8, 6) will
+ produce a rational number equivalent to 4/3. Both arguments must
+ be Rational. The numerator defaults to 0 and the denominator
+ defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.
- Fraction can also be constructed from strings of the form
- '[-+]?[0-9]+((/|.)[0-9]+)?', optionally surrounded by spaces.
+ Fractions can also be constructed from:
+
+ - numeric strings similar to those accepted by the
+ float constructor (for example, '-2.3' or '1e10')
+
+ - strings of the form '123/456'
+
+ - float and Decimal instances
+
+ - other Rational instances (including integers)
"""
@@ -57,8 +73,32 @@ class Fraction(numbers.Rational):
def __new__(cls, numerator=0, denominator=None):
"""Constructs a Rational.
- Takes a string like '3/2' or '1.5', another Rational, or a
- numerator/denominator pair.
+ Takes a string like '3/2' or '1.5', another Rational instance, a
+ numerator/denominator pair, or a float.
+
+ Examples
+ --------
+
+ >>> Fraction(10, -8)
+ Fraction(-5, 4)
+ >>> Fraction(Fraction(1, 7), 5)
+ Fraction(1, 35)
+ >>> Fraction(Fraction(1, 7), Fraction(2, 3))
+ Fraction(3, 14)
+ >>> Fraction('314')
+ Fraction(314, 1)
+ >>> Fraction('-35/4')
+ Fraction(-35, 4)
+ >>> Fraction('3.1415') # conversion from numeric string
+ Fraction(6283, 2000)
+ >>> Fraction('-47e-2') # string may include a decimal exponent
+ Fraction(-47, 100)
+ >>> Fraction(1.47) # direct construction from float (exact conversion)
+ Fraction(6620291452234629, 4503599627370496)
+ >>> Fraction(2.25)
+ Fraction(9, 4)
+ >>> Fraction(Decimal('1.47'))
+ Fraction(147, 100)
"""
self = super(Fraction, cls).__new__(cls)
@@ -69,6 +109,19 @@ class Fraction(numbers.Rational):
self._denominator = numerator.denominator
return self
+ elif isinstance(numerator, float):
+ # Exact conversion from float
+ value = Fraction.from_float(numerator)
+ self._numerator = value._numerator
+ self._denominator = value._denominator
+ return self
+
+ elif isinstance(numerator, Decimal):
+ value = Fraction.from_decimal(numerator)
+ self._numerator = value._numerator
+ self._denominator = value._denominator
+ return self
+
elif isinstance(numerator, str):
# Handle construction from strings.
m = _RATIONAL_FORMAT.match(numerator)
@@ -475,23 +528,26 @@ class Fraction(numbers.Rational):
return Fraction(round(self / shift) * shift)
def __hash__(self):
- """hash(self)
-
- Tricky because values that are exactly representable as a
- float must have the same hash as that float.
+ """hash(self)"""
- """
# XXX since this method is expensive, consider caching the result
- if self._denominator == 1:
- # Get integers right.
- return hash(self._numerator)
- # Expensive check, but definitely correct.
- if self == float(self):
- return hash(float(self))
+
+ # In order to make sure that the hash of a Fraction agrees
+ # with the hash of a numerically equal integer, float or
+ # Decimal instance, we follow the rules for numeric hashes
+ # outlined in the documentation. (See library docs, 'Built-in
+ # Types').
+
+ # dinv is the inverse of self._denominator modulo the prime
+ # _PyHASH_MODULUS, or 0 if self._denominator is divisible by
+ # _PyHASH_MODULUS.
+ dinv = pow(self._denominator, _PyHASH_MODULUS - 2, _PyHASH_MODULUS)
+ if not dinv:
+ hash_ = _PyHASH_INF
else:
- # Use tuple's hash to avoid a high collision rate on
- # simple fractions.
- return hash((self._numerator, self._denominator))
+ hash_ = abs(self._numerator) * dinv % _PyHASH_MODULUS
+ result = hash_ if self >= 0 else -hash_
+ return -2 if result == -1 else result
def __eq__(a, b):
"""a == b"""
@@ -526,8 +582,6 @@ class Fraction(numbers.Rational):
if isinstance(other, numbers.Rational):
return op(self._numerator * other.denominator,
self._denominator * other.numerator)
- if isinstance(other, numbers.Complex) and other.imag == 0:
- other = other.real
if isinstance(other, float):
if math.isnan(other) or math.isinf(other):
return op(0.0, other)
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index ea91c1707c..7c398879bc 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -33,17 +33,12 @@ python ftplib.py -d localhost -l -p -l
# Modified by Jack to work on the mac.
# Modified by Siebren to support docstrings and PASV.
# Modified by Phil Schwartz to add storbinary and storlines callbacks.
+# Modified by Giampaolo Rodola' to add TLS support.
#
import os
import sys
-
-# Import SOCKS module if it exists, else standard socket module socket
-try:
- import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket
- from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn
-except ImportError:
- import socket
+import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT
__all__ = ["FTP","Netrc"]
@@ -119,6 +114,20 @@ class FTP:
if user:
self.login(user, passwd, acct)
+ def __enter__(self):
+ return self
+
+ # Context management protocol: try to quit() if active
+ def __exit__(self, *args):
+ if self.sock is not None:
+ try:
+ self.quit()
+ except (socket.error, EOFError):
+ pass
+ finally:
+ if self.sock is not None:
+ self.close()
+
def connect(self, host='', port=0, timeout=-999):
'''Connect to host. Arguments are:
- host: hostname to connect to (string, default previous host)
@@ -162,7 +171,7 @@ class FTP:
def sanitize(self, s):
if s[:5] == 'pass ' or s[:5] == 'PASS ':
i = len(s)
- while i > 5 and s[i-1] in '\r\n':
+ while i > 5 and s[i-1] in {'\r', '\n'}:
i = i-1
s = s[:5] + '*'*(i-5) + s[i:]
return repr(s)
@@ -212,7 +221,7 @@ class FTP:
if self.debugging: print('*resp*', self.sanitize(resp))
self.lastresp = resp[:3]
c = resp[:1]
- if c in ('1', '2', '3'):
+ if c in {'1', '2', '3'}:
return resp
if c == '4':
raise error_temp(resp)
@@ -236,7 +245,7 @@ class FTP:
if self.debugging > 1: print('*put urgent*', self.sanitize(line))
self.sock.sendall(line, MSG_OOB)
resp = self.getmultiline()
- if resp[:3] not in ('426', '225', '226'):
+ if resp[:3] not in {'426', '225', '226'}:
raise error_proto(resp)
def sendcmd(self, cmd):
@@ -352,6 +361,7 @@ class FTP:
conn, sockaddr = sock.accept()
if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
conn.settimeout(self.timeout)
+ sock.close()
if resp[:3] == '150':
# this is conditional in case we received a 125
size = parse150(resp)
@@ -366,7 +376,7 @@ class FTP:
if not user: user = 'anonymous'
if not passwd: passwd = ''
if not acct: acct = ''
- if user == 'anonymous' and passwd in ('', '-'):
+ if user == 'anonymous' and passwd in {'', '-'}:
# If there is no anonymous ftp password specified
# then we'll just use anonymous@
# We don't send any other thing because:
@@ -397,13 +407,12 @@ class FTP:
The response code.
"""
self.voidcmd('TYPE I')
- conn = self.transfercmd(cmd, rest)
- while 1:
- data = conn.recv(blocksize)
- if not data:
- break
- callback(data)
- conn.close()
+ with self.transfercmd(cmd, rest) as conn:
+ while 1:
+ data = conn.recv(blocksize)
+ if not data:
+ break
+ callback(data)
return self.voidresp()
def retrlines(self, cmd, callback = None):
@@ -420,23 +429,21 @@ class FTP:
"""
if callback is None: callback = print_line
resp = self.sendcmd('TYPE A')
- conn = self.transfercmd(cmd)
- fp = conn.makefile('r', encoding=self.encoding)
- while 1:
- line = fp.readline()
- if self.debugging > 2: print('*retr*', repr(line))
- if not line:
- break
- if line[-2:] == CRLF:
- line = line[:-2]
- elif line[-1:] == '\n':
- line = line[:-1]
- callback(line)
- fp.close()
- conn.close()
+ with self.transfercmd(cmd) as conn, \
+ conn.makefile('r', encoding=self.encoding) as fp:
+ while 1:
+ line = fp.readline()
+ if self.debugging > 2: print('*retr*', repr(line))
+ if not line:
+ break
+ if line[-2:] == CRLF:
+ line = line[:-2]
+ elif line[-1:] == '\n':
+ line = line[:-1]
+ callback(line)
return self.voidresp()
- def storbinary(self, cmd, fp, blocksize=8192, callback=None):
+ def storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None):
"""Store a file in binary mode. A new port is created for you.
Args:
@@ -446,18 +453,18 @@ class FTP:
the connection at once. [default: 8192]
callback: An optional single parameter callable that is called on
on each block of data after it is sent. [default: None]
+ rest: Passed to transfercmd(). [default: None]
Returns:
The response code.
"""
self.voidcmd('TYPE I')
- conn = self.transfercmd(cmd)
- while 1:
- buf = fp.read(blocksize)
- if not buf: break
- conn.sendall(buf)
- if callback: callback(buf)
- conn.close()
+ with self.transfercmd(cmd, rest) as conn:
+ while 1:
+ buf = fp.read(blocksize)
+ if not buf: break
+ conn.sendall(buf)
+ if callback: callback(buf)
return self.voidresp()
def storlines(self, cmd, fp, callback=None):
@@ -473,16 +480,15 @@ class FTP:
The response code.
"""
self.voidcmd('TYPE A')
- conn = self.transfercmd(cmd)
- while 1:
- buf = fp.readline()
- if not buf: break
- if buf[-2:] != B_CRLF:
- if buf[-1] in B_CRLF: buf = buf[:-1]
- buf = buf + B_CRLF
- conn.sendall(buf)
- if callback: callback(buf)
- conn.close()
+ with self.transfercmd(cmd) as conn:
+ while 1:
+ buf = fp.readline()
+ if not buf: break
+ if buf[-2:] != B_CRLF:
+ if buf[-1] in B_CRLF: buf = buf[:-1]
+ buf = buf + B_CRLF
+ conn.sendall(buf)
+ if callback: callback(buf)
return self.voidresp()
def acct(self, password):
@@ -524,7 +530,7 @@ class FTP:
def delete(self, filename):
'''Delete a file.'''
resp = self.sendcmd('DELE ' + filename)
- if resp[:3] in ('250', '200'):
+ if resp[:3] in {'250', '200'}:
return resp
else:
raise error_reply(resp)
@@ -555,7 +561,11 @@ class FTP:
def mkd(self, dirname):
'''Make a directory, return its full pathname.'''
- resp = self.sendcmd('MKD ' + dirname)
+ resp = self.voidcmd('MKD ' + dirname)
+ # fix around non-compliant implementations such as IIS shipped
+ # with Windows server 2003
+ if not resp.startswith('257'):
+ return ''
return parse257(resp)
def rmd(self, dirname):
@@ -564,7 +574,11 @@ class FTP:
def pwd(self):
'''Return current working directory.'''
- resp = self.sendcmd('PWD')
+ resp = self.voidcmd('PWD')
+ # fix around non-compliant implementations such as IIS shipped
+ # with Windows server 2003
+ if not resp.startswith('257'):
+ return ''
return parse257(resp)
def quit(self):
@@ -581,6 +595,196 @@ class FTP:
self.file = self.sock = None
+try:
+ import ssl
+except ImportError:
+ pass
+else:
+ class FTP_TLS(FTP):
+ '''A FTP subclass which adds TLS support to FTP as described
+ in RFC-4217.
+
+ Connect as usual to port 21 implicitly securing the FTP control
+ connection before authenticating.
+
+ Securing the data connection requires user to explicitly ask
+ for it by calling prot_p() method.
+
+ Usage example:
+ >>> from ftplib import FTP_TLS
+ >>> ftps = FTP_TLS('ftp.python.org')
+ >>> ftps.login() # login anonymously previously securing control channel
+ '230 Guest login ok, access restrictions apply.'
+ >>> ftps.prot_p() # switch to secure data connection
+ '200 Protection level set to P'
+ >>> ftps.retrlines('LIST') # list directory content securely
+ total 9
+ drwxr-xr-x 8 root wheel 1024 Jan 3 1994 .
+ drwxr-xr-x 8 root wheel 1024 Jan 3 1994 ..
+ drwxr-xr-x 2 root wheel 1024 Jan 3 1994 bin
+ drwxr-xr-x 2 root wheel 1024 Jan 3 1994 etc
+ d-wxrwxr-x 2 ftp wheel 1024 Sep 5 13:43 incoming
+ drwxr-xr-x 2 root wheel 1024 Nov 17 1993 lib
+ drwxr-xr-x 6 1094 wheel 1024 Sep 13 19:07 pub
+ drwxr-xr-x 3 root wheel 1024 Jan 3 1994 usr
+ -rw-r--r-- 1 root root 312 Aug 1 1994 welcome.msg
+ '226 Transfer complete.'
+ >>> ftps.quit()
+ '221 Goodbye.'
+ >>>
+ '''
+ ssl_version = ssl.PROTOCOL_TLSv1
+
+ def __init__(self, host='', user='', passwd='', acct='', keyfile=None,
+ certfile=None, context=None,
+ timeout=_GLOBAL_DEFAULT_TIMEOUT):
+ if context is not None and keyfile is not None:
+ raise ValueError("context and keyfile arguments are mutually "
+ "exclusive")
+ if context is not None and certfile is not None:
+ raise ValueError("context and certfile arguments are mutually "
+ "exclusive")
+ self.keyfile = keyfile
+ self.certfile = certfile
+ self.context = context
+ self._prot_p = False
+ FTP.__init__(self, host, user, passwd, acct, timeout)
+
+ def login(self, user='', passwd='', acct='', secure=True):
+ if secure and not isinstance(self.sock, ssl.SSLSocket):
+ self.auth()
+ return FTP.login(self, user, passwd, acct)
+
+ def auth(self):
+ '''Set up secure control connection by using TLS/SSL.'''
+ if isinstance(self.sock, ssl.SSLSocket):
+ raise ValueError("Already using TLS")
+ if self.ssl_version == ssl.PROTOCOL_TLSv1:
+ resp = self.voidcmd('AUTH TLS')
+ else:
+ resp = self.voidcmd('AUTH SSL')
+ if self.context is not None:
+ self.sock = self.context.wrap_socket(self.sock)
+ else:
+ self.sock = ssl.wrap_socket(self.sock, self.keyfile,
+ self.certfile,
+ ssl_version=self.ssl_version)
+ self.file = self.sock.makefile(mode='r', encoding=self.encoding)
+ return resp
+
+ def prot_p(self):
+ '''Set up secure data connection.'''
+ # PROT defines whether or not the data channel is to be protected.
+ # Though RFC-2228 defines four possible protection levels,
+ # RFC-4217 only recommends two, Clear and Private.
+ # Clear (PROT C) means that no security is to be used on the
+ # data-channel, Private (PROT P) means that the data-channel
+ # should be protected by TLS.
+ # PBSZ command MUST still be issued, but must have a parameter of
+ # '0' to indicate that no buffering is taking place and the data
+ # connection should not be encapsulated.
+ self.voidcmd('PBSZ 0')
+ resp = self.voidcmd('PROT P')
+ self._prot_p = True
+ return resp
+
+ def prot_c(self):
+ '''Set up clear text data connection.'''
+ resp = self.voidcmd('PROT C')
+ self._prot_p = False
+ return resp
+
+ # --- Overridden FTP methods
+
+ def ntransfercmd(self, cmd, rest=None):
+ conn, size = FTP.ntransfercmd(self, cmd, rest)
+ if self._prot_p:
+ if self.context is not None:
+ conn = self.context.wrap_socket(conn)
+ else:
+ conn = ssl.wrap_socket(conn, self.keyfile, self.certfile,
+ ssl_version=self.ssl_version)
+ return conn, size
+
+ def retrbinary(self, cmd, callback, blocksize=8192, rest=None):
+ self.voidcmd('TYPE I')
+ conn = self.transfercmd(cmd, rest)
+ try:
+ while 1:
+ data = conn.recv(blocksize)
+ if not data:
+ break
+ callback(data)
+ # shutdown ssl layer
+ if isinstance(conn, ssl.SSLSocket):
+ conn.unwrap()
+ finally:
+ conn.close()
+ return self.voidresp()
+
+ def retrlines(self, cmd, callback = None):
+ if callback is None: callback = print_line
+ resp = self.sendcmd('TYPE A')
+ conn = self.transfercmd(cmd)
+ fp = conn.makefile('r', encoding=self.encoding)
+ try:
+ while 1:
+ line = fp.readline()
+ if self.debugging > 2: print('*retr*', repr(line))
+ if not line:
+ break
+ if line[-2:] == CRLF:
+ line = line[:-2]
+ elif line[-1:] == '\n':
+ line = line[:-1]
+ callback(line)
+ # shutdown ssl layer
+ if isinstance(conn, ssl.SSLSocket):
+ conn.unwrap()
+ finally:
+ fp.close()
+ conn.close()
+ return self.voidresp()
+
+ def storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None):
+ self.voidcmd('TYPE I')
+ conn = self.transfercmd(cmd, rest)
+ try:
+ while 1:
+ buf = fp.read(blocksize)
+ if not buf: break
+ conn.sendall(buf)
+ if callback: callback(buf)
+ # shutdown ssl layer
+ if isinstance(conn, ssl.SSLSocket):
+ conn.unwrap()
+ finally:
+ conn.close()
+ return self.voidresp()
+
+ def storlines(self, cmd, fp, callback=None):
+ self.voidcmd('TYPE A')
+ conn = self.transfercmd(cmd)
+ try:
+ while 1:
+ buf = fp.readline()
+ if not buf: break
+ if buf[-2:] != B_CRLF:
+ if buf[-1] in B_CRLF: buf = buf[:-1]
+ buf = buf + B_CRLF
+ conn.sendall(buf)
+ if callback: callback(buf)
+ # shutdown ssl layer
+ if isinstance(conn, ssl.SSLSocket):
+ conn.unwrap()
+ finally:
+ conn.close()
+ return self.voidresp()
+
+ __all__.append('FTP_TLS')
+ all_errors = (Error, IOError, EOFError, ssl.SSLError)
+
+
_150_re = None
def parse150(resp):
@@ -689,9 +893,9 @@ def ftpcp(source, sourcename, target, targetname = '', type = 'I'):
# transfer request.
# So: STOR before RETR, because here the target is a "user".
treply = target.sendcmd('STOR ' + targetname)
- if treply[:3] not in ('125', '150'): raise error_proto # RFC 959
+ if treply[:3] not in {'125', '150'}: raise error_proto # RFC 959
sreply = source.sendcmd('RETR ' + sourcename)
- if sreply[:3] not in ('125', '150'): raise error_proto # RFC 959
+ if sreply[:3] not in {'125', '150'}: raise error_proto # RFC 959
source.voidresp()
target.voidresp()
diff --git a/Lib/functools.py b/Lib/functools.py
index 103dd426e3..03bcb1e69f 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -4,10 +4,19 @@
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>
-# Copyright (C) 2006 Python Software Foundation.
+# and Raymond Hettinger <python at rcn.com>
+# Copyright (C) 2006-2010 Python Software Foundation.
# See C source code for _functools credits/copyright
+__all__ = ['update_wrapper', 'wraps', 'WRAPPER_ASSIGNMENTS', 'WRAPPER_UPDATES',
+ 'total_ordering', 'cmp_to_key', 'lru_cache', 'reduce', 'partial']
+
from _functools import partial, reduce
+from collections import OrderedDict, namedtuple
+try:
+ from _thread import allocate_lock as Lock
+except:
+ from _dummy_thread import allocate_lock as Lock
# update_wrapper() and wraps() are tools to help write
# wrapper functions that can handle naive introspection
@@ -29,9 +38,14 @@ def update_wrapper(wrapper,
are updated with the corresponding attribute from the wrapped
function (defaults to functools.WRAPPER_UPDATES)
"""
+ wrapper.__wrapped__ = wrapped
for attr in assigned:
- if hasattr(wrapped, attr):
- setattr(wrapper, attr, getattr(wrapped, attr))
+ try:
+ value = getattr(wrapped, attr)
+ except AttributeError:
+ pass
+ else:
+ setattr(wrapper, attr, value)
for attr in updated:
getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
# Return the wrapper so this can be used as a decorator via partial()
@@ -50,3 +64,141 @@ def wraps(wrapped,
"""
return partial(update_wrapper, wrapped=wrapped,
assigned=assigned, updated=updated)
+
+def total_ordering(cls):
+ """Class decorator that fills in missing ordering methods"""
+ convert = {
+ '__lt__': [('__gt__', lambda self, other: not (self < other or self == other)),
+ ('__le__', lambda self, other: self < other or self == other),
+ ('__ge__', lambda self, other: not self < other)],
+ '__le__': [('__ge__', lambda self, other: not self <= other or self == other),
+ ('__lt__', lambda self, other: self <= other and not self == other),
+ ('__gt__', lambda self, other: not self <= other)],
+ '__gt__': [('__lt__', lambda self, other: not (self > other or self == other)),
+ ('__ge__', lambda self, other: self > other or self == other),
+ ('__le__', lambda self, other: not self > other)],
+ '__ge__': [('__le__', lambda self, other: (not self >= other) or self == other),
+ ('__gt__', lambda self, other: self >= other and not self == other),
+ ('__lt__', lambda self, other: not self >= other)]
+ }
+ # Find user-defined comparisons (not those inherited from object).
+ roots = [op for op in convert if getattr(cls, op, None) is not getattr(object, op, None)]
+ if not roots:
+ raise ValueError('must define at least one ordering operation: < > <= >=')
+ root = max(roots) # prefer __lt__ to __le__ to __gt__ to __ge__
+ for opname, opfunc in convert[root]:
+ if opname not in roots:
+ opfunc.__name__ = opname
+ opfunc.__doc__ = getattr(int, opname).__doc__
+ setattr(cls, opname, opfunc)
+ return cls
+
+def cmp_to_key(mycmp):
+ """Convert a cmp= function into a key= function"""
+ class K(object):
+ __slots__ = ['obj']
+ def __init__(self, obj):
+ self.obj = obj
+ def __lt__(self, other):
+ return mycmp(self.obj, other.obj) < 0
+ def __gt__(self, other):
+ return mycmp(self.obj, other.obj) > 0
+ def __eq__(self, other):
+ return mycmp(self.obj, other.obj) == 0
+ def __le__(self, other):
+ return mycmp(self.obj, other.obj) <= 0
+ def __ge__(self, other):
+ return mycmp(self.obj, other.obj) >= 0
+ def __ne__(self, other):
+ return mycmp(self.obj, other.obj) != 0
+ __hash__ = None
+ return K
+
+_CacheInfo = namedtuple("CacheInfo", "hits misses maxsize currsize")
+
+def lru_cache(maxsize=100):
+ """Least-recently-used cache decorator.
+
+ If *maxsize* is set to None, the LRU features are disabled and the cache
+ can grow without bound.
+
+ Arguments to the cached function must be hashable.
+
+ View the cache statistics named tuple (hits, misses, maxsize, currsize) with
+ f.cache_info(). Clear the cache and statistics with f.cache_clear().
+ Access the underlying function with f.__wrapped__.
+
+ See: http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used
+
+ """
+ # Users should only access the lru_cache through its public API:
+ # cache_info, cache_clear, and f.__wrapped__
+ # The internals of the lru_cache are encapsulated for thread safety and
+ # to allow the implementation to change (including a possible C version).
+
+ def decorating_function(user_function,
+ tuple=tuple, sorted=sorted, len=len, KeyError=KeyError):
+
+ hits = misses = 0
+ kwd_mark = (object(),) # separates positional and keyword args
+ lock = Lock() # needed because ordereddicts aren't threadsafe
+
+ if maxsize is None:
+ cache = dict() # simple cache without ordering or size limit
+
+ @wraps(user_function)
+ def wrapper(*args, **kwds):
+ nonlocal hits, misses
+ key = args
+ if kwds:
+ key += kwd_mark + tuple(sorted(kwds.items()))
+ try:
+ result = cache[key]
+ hits += 1
+ except KeyError:
+ result = user_function(*args, **kwds)
+ cache[key] = result
+ misses += 1
+ return result
+ else:
+ cache = OrderedDict() # ordered least recent to most recent
+ cache_popitem = cache.popitem
+ cache_renew = cache.move_to_end
+
+ @wraps(user_function)
+ def wrapper(*args, **kwds):
+ nonlocal hits, misses
+ key = args
+ if kwds:
+ key += kwd_mark + tuple(sorted(kwds.items()))
+ try:
+ with lock:
+ result = cache[key]
+ cache_renew(key) # record recent use of this key
+ hits += 1
+ except KeyError:
+ result = user_function(*args, **kwds)
+ with lock:
+ cache[key] = result # record recent use of this key
+ misses += 1
+ if len(cache) > maxsize:
+ cache_popitem(0) # purge least recently used cache entry
+ return result
+
+ def cache_info():
+ """Report cache statistics"""
+ with lock:
+ return _CacheInfo(hits, misses, maxsize, len(cache))
+
+ def cache_clear():
+ """Clear the cache and cache statistics"""
+ nonlocal hits, misses
+ with lock:
+ cache.clear()
+ hits = misses = 0
+
+ wrapper.cache_info = cache_info
+ wrapper.cache_clear = cache_clear
+ return wrapper
+
+ return decorating_function
diff --git a/Lib/genericpath.py b/Lib/genericpath.py
index 41ad234829..2174187a03 100644
--- a/Lib/genericpath.py
+++ b/Lib/genericpath.py
@@ -15,7 +15,7 @@ __all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
def exists(path):
"""Test whether a path exists. Returns False for broken symbolic links"""
try:
- st = os.stat(path)
+ os.stat(path)
except os.error:
return False
return True
diff --git a/Lib/getopt.py b/Lib/getopt.py
index ac77126acf..980861d251 100644
--- a/Lib/getopt.py
+++ b/Lib/getopt.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""Parser for command line options.
This module helps scripts to parse the command line arguments in
diff --git a/Lib/gettext.py b/Lib/gettext.py
index d5321b8451..256e331eba 100644
--- a/Lib/gettext.py
+++ b/Lib/gettext.py
@@ -46,7 +46,7 @@ internationalized, to the local language and cultural habits.
# find this format documented anywhere.
-import locale, copy, os, re, struct, sys
+import locale, copy, io, os, re, struct, sys
from errno import ENOENT
@@ -58,28 +58,13 @@ __all__ = ['NullTranslations', 'GNUTranslations', 'Catalog',
_default_localedir = os.path.join(sys.prefix, 'share', 'locale')
-def test(condition, true, false):
- """
- Implements the C expression:
-
- condition ? true : false
-
- Required to correctly interpret plural forms.
- """
- if condition:
- return true
- else:
- return false
-
-
def c2py(plural):
"""Gets a C expression as used in PO files for plural forms and returns a
Python lambda function that implements an equivalent expression.
"""
# Security check, allow only the "n" identifier
- from io import StringIO
import token, tokenize
- tokens = tokenize.generate_tokens(StringIO(plural).readline)
+ tokens = tokenize.generate_tokens(io.StringIO(plural).readline)
try:
danger = [x for x in tokens if x[0] == token.NAME and x[1] != 'n']
except tokenize.TokenError:
@@ -96,11 +81,11 @@ def c2py(plural):
plural = expr.sub(' not \\1', plural)
# Regular expression and replacement function used to transform
- # "a?b:c" to "test(a,b,c)".
+ # "a?b:c" to "b if a else c".
expr = re.compile(r'(.*?)\?(.*?):(.*)')
def repl(x):
- return "test(%s, %s, %s)" % (x.group(1), x.group(2),
- expr.sub(repl, x.group(3)))
+ return "(%s if %s else %s)" % (x.group(2), x.group(1),
+ expr.sub(repl, x.group(3)))
# Code to transform the plural expression, taking care of parentheses
stack = ['']
@@ -123,36 +108,35 @@ def c2py(plural):
-def _expand_lang(locale):
- from locale import normalize
- locale = normalize(locale)
+def _expand_lang(loc):
+ loc = locale.normalize(loc)
COMPONENT_CODESET = 1 << 0
COMPONENT_TERRITORY = 1 << 1
COMPONENT_MODIFIER = 1 << 2
# split up the locale into its base components
mask = 0
- pos = locale.find('@')
+ pos = loc.find('@')
if pos >= 0:
- modifier = locale[pos:]
- locale = locale[:pos]
+ modifier = loc[pos:]
+ loc = loc[:pos]
mask |= COMPONENT_MODIFIER
else:
modifier = ''
- pos = locale.find('.')
+ pos = loc.find('.')
if pos >= 0:
- codeset = locale[pos:]
- locale = locale[:pos]
+ codeset = loc[pos:]
+ loc = loc[:pos]
mask |= COMPONENT_CODESET
else:
codeset = ''
- pos = locale.find('_')
+ pos = loc.find('_')
if pos >= 0:
- territory = locale[pos:]
- locale = locale[:pos]
+ territory = loc[pos:]
+ loc = loc[:pos]
mask |= COMPONENT_TERRITORY
else:
territory = ''
- language = locale
+ language = loc
ret = []
for i in range(mask+1):
if not (i & ~mask): # if all components for this combo exist ...
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 8a2a7184df..ba2149ebf9 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -5,11 +5,12 @@ but random access is not allowed."""
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
-import struct, sys, time
+import struct, sys, time, os
import zlib
import builtins
+import io
-__all__ = ["GzipFile","open"]
+__all__ = ["GzipFile", "open", "compress", "decompress"]
FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16
@@ -44,7 +45,63 @@ def open(filename, mode="rb", compresslevel=9):
"""
return GzipFile(filename, mode, compresslevel)
-class GzipFile:
+class _PaddedFile:
+ """Minimal read-only file object that prepends a string to the contents
+ of an actual file. Shouldn't be used outside of gzip.py, as it lacks
+ essential functionality."""
+
+ def __init__(self, f, prepend=b''):
+ self._buffer = prepend
+ self._length = len(prepend)
+ self.file = f
+ self._read = 0
+
+ def read(self, size):
+ if self._read is None:
+ return self.file.read(size)
+ if self._read + size <= self._length:
+ read = self._read
+ self._read += size
+ return self._buffer[read:self._read]
+ else:
+ read = self._read
+ self._read = None
+ return self._buffer[read:] + \
+ self.file.read(size-self._length+read)
+
+ def prepend(self, prepend=b'', readprevious=False):
+ if self._read is None:
+ self._buffer = prepend
+ elif readprevious and len(prepend) <= self._read:
+ self._read -= len(prepend)
+ return
+ else:
+ self._buffer = self._buffer[read:] + prepend
+ self._length = len(self._buffer)
+ self._read = 0
+
+ def unused(self):
+ if self._read is None:
+ return b''
+ return self._buffer[self._read:]
+
+ def seek(self, offset, whence=0):
+ # This is only ever called with offset=whence=0
+ if whence == 1 and self._read is not None:
+ if 0 <= offset + self._read <= self._length:
+ self._read += offset
+ return
+ else:
+ offset += self._length - self._read
+ self._read = None
+ self._buffer = None
+ return self.file.seek(offset, whence)
+
+ def __getattr__(self, name):
+ return getattr(self.file, name)
+
+
+class GzipFile(io.BufferedIOBase):
"""The GzipFile class simulates most of the methods of a file object with
the exception of the readinto() and truncate() methods.
@@ -109,11 +166,16 @@ class GzipFile:
self.mode = READ
# Set flag indicating start of a new member
self._new_member = True
+ # Buffer data read from gzip file. extrastart is offset in
+ # stream where buffer starts. extrasize is number of
+ # bytes remaining in buffer from current stream position.
self.extrabuf = b""
self.extrasize = 0
+ self.extrastart = 0
self.name = filename
# Starts small, scales exponentially
self.min_readsize = 100
+ fileobj = _PaddedFile(fileobj)
elif mode[0:1] == 'w' or mode[0:1] == 'a':
self.mode = WRITE
@@ -129,7 +191,6 @@ class GzipFile:
self.fileobj = fileobj
self.offset = 0
self.mtime = mtime
- self.closed = False
if self.mode == WRITE:
self._write_gzip_header()
@@ -143,7 +204,10 @@ class GzipFile:
return self.name
def __repr__(self):
- s = repr(self.fileobj)
+ fileobj = self.fileobj
+ if isinstance(fileobj, _PaddedFile):
+ fileobj = fileobj.file
+ s = repr(fileobj)
return '<gzip ' + s[1:-1] + ' ' + hex(id(self)) + '>'
def _check_closed(self):
@@ -166,7 +230,8 @@ class GzipFile:
try:
# RFC 1952 requires the FNAME field to be Latin-1. Do not
# include filenames that cannot be represented that way.
- fname = self.name.encode('latin-1')
+ fname = os.path.basename(self.name)
+ fname = fname.encode('latin-1')
if fname.endswith(b'.gz'):
fname = fname[:-3]
except UnicodeEncodeError:
@@ -190,6 +255,9 @@ class GzipFile:
def _read_gzip_header(self):
magic = self.fileobj.read(2)
+ if magic == b'':
+ raise EOFError("Reached EOF")
+
if magic != b'\037\213':
raise IOError('Not a gzipped file')
method = ord( self.fileobj.read(1) )
@@ -221,6 +289,10 @@ class GzipFile:
if flag & FHCRC:
self.fileobj.read(2) # Read & discard the 16-bit header CRC
+ unused = self.fileobj.unused()
+ if unused:
+ uncompress = self.decompress.decompress(unused)
+ self._add_read_data(uncompress)
def write(self,data):
self._check_closed()
@@ -230,12 +302,19 @@ class GzipFile:
if self.fileobj is None:
raise ValueError("write() on closed GzipFile object")
+
+ # Convert data type if called by io.BufferedWriter.
+ if isinstance(data, memoryview):
+ data = data.tobytes()
+
if len(data) > 0:
self.size = self.size + len(data)
self.crc = zlib.crc32(data, self.crc) & 0xffffffff
self.fileobj.write( self.compress.compress(data) )
self.offset += len(data)
+ return len(data)
+
def read(self, size=-1):
self._check_closed()
if self.mode != READ:
@@ -262,15 +341,36 @@ class GzipFile:
if size > self.extrasize:
size = self.extrasize
- chunk = self.extrabuf[:size]
- self.extrabuf = self.extrabuf[size:]
+ offset = self.offset - self.extrastart
+ chunk = self.extrabuf[offset: offset + size]
self.extrasize = self.extrasize - size
self.offset += size
return chunk
+ def peek(self, n):
+ if self.mode != READ:
+ import errno
+ raise IOError(errno.EBADF, "peek() on write-only GzipFile object")
+
+ # Do not return ridiculously small buffers, for one common idiom
+ # is to call peek(1) and expect more bytes in return.
+ if n < 100:
+ n = 100
+ if self.extrasize == 0:
+ if self.fileobj is None:
+ return b''
+ try:
+ # 1024 is the same buffering heuristic used in read()
+ self._read(max(n, 1024))
+ except EOFError:
+ pass
+ offset = self.offset - self.extrastart
+ remaining = self.extrasize
+ assert remaining == len(self.extrabuf) - offset
+ return self.extrabuf[offset:offset + n]
+
def _unread(self, buf):
- self.extrabuf = buf + self.extrabuf
self.extrasize = len(buf) + self.extrasize
self.offset -= len(buf)
@@ -281,16 +381,6 @@ class GzipFile:
if self._new_member:
# If the _new_member flag is set, we have to
# jump to the next member, if there is one.
- #
- # First, check if we're at the end of the file;
- # if so, it's time to stop; no more members to read.
- pos = self.fileobj.tell() # Save current position
- self.fileobj.seek(0, 2) # Seek to end of file
- if pos == self.fileobj.tell():
- raise EOFError("Reached EOF")
- else:
- self.fileobj.seek( pos ) # Return to original position
-
self._init_read()
self._read_gzip_header()
self.decompress = zlib.decompressobj(-zlib.MAX_WBITS)
@@ -304,6 +394,9 @@ class GzipFile:
if buf == b"":
uncompress = self.decompress.flush()
+ # Prepend the already read bytes to the fileobj to they can be
+ # seen by _read_eof()
+ self.fileobj.prepend(self.decompress.unused_data, True)
self._read_eof()
self._add_read_data( uncompress )
raise EOFError('Reached EOF')
@@ -315,10 +408,9 @@ class GzipFile:
# Ending case: we've come to the end of a member in the file,
# so seek back to the start of the unused data, finish up
# this member, and read a new gzip header.
- # (The number of bytes to seek back is the length of the unused
- # data, minus 8 because _read_eof() will rewind a further 8 bytes)
- self.fileobj.seek( -len(self.decompress.unused_data)+8, 1)
-
+ # Prepend the already read bytes to the fileobj to they can be
+ # seen by _read_eof() and _read_gzip_header()
+ self.fileobj.prepend(self.decompress.unused_data, True)
# Check the CRC and file size, and set the flag so we read
# a new member on the next call
self._read_eof()
@@ -326,17 +418,17 @@ class GzipFile:
def _add_read_data(self, data):
self.crc = zlib.crc32(data, self.crc) & 0xffffffff
- self.extrabuf = self.extrabuf + data
+ offset = self.offset - self.extrastart
+ self.extrabuf = self.extrabuf[offset:] + data
self.extrasize = self.extrasize + len(data)
+ self.extrastart = self.offset
self.size = self.size + len(data)
def _read_eof(self):
- # We've read to the end of the file, so we have to rewind in order
- # to reread the 8 bytes containing the CRC and the file size.
+ # We've read to the end of the file
# We check the that the computed CRC and size of the
# uncompressed data matches the stored values. Note that the size
# stored is the true file size mod 2**32.
- self.fileobj.seek(-8, 1)
crc32 = read32(self.fileobj)
isize = read32(self.fileobj) # may exceed 2GB
if crc32 != self.crc:
@@ -345,6 +437,19 @@ class GzipFile:
elif isize != (self.size & 0xffffffff):
raise IOError("Incorrect length of data produced")
+ # Gzip files can be padded with zeroes and still have archives.
+ # Consume all zero bytes and set the file position to the first
+ # non-zero byte. See http://www.gzip.org/#faq8
+ c = b"\x00"
+ while c == b"\x00":
+ c = self.fileobj.read(1)
+ if c:
+ self.fileobj.prepend(c, True)
+
+ @property
+ def closed(self):
+ return self.fileobj is None
+
def close(self):
if self.fileobj is None:
return
@@ -359,16 +464,6 @@ class GzipFile:
if self.myfileobj:
self.myfileobj.close()
self.myfileobj = None
- self.closed = True
-
- def __del__(self):
- try:
- if (self.myfileobj is None and
- self.fileobj is None):
- return
- except AttributeError:
- return
- self.close()
def flush(self,zlib_mode=zlib.Z_SYNC_FLUSH):
self._check_closed()
@@ -385,13 +480,6 @@ class GzipFile:
"""
return self.fileobj.fileno()
- def isatty(self):
- return False
-
- def tell(self):
- self._check_closed()
- return self.offset
-
def rewind(self):
'''Return the uncompressed stream file position indicator to the
beginning of the file'''
@@ -401,8 +489,18 @@ class GzipFile:
self._new_member = True
self.extrabuf = b""
self.extrasize = 0
+ self.extrastart = 0
self.offset = 0
+ def readable(self):
+ return self.mode == READ
+
+ def writable(self):
+ return self.mode == WRITE
+
+ def seekable(self):
+ return True
+
def seek(self, offset, whence=0):
if whence:
if whence == 1:
@@ -426,8 +524,18 @@ class GzipFile:
self.read(1024)
self.read(count % 1024)
+ return self.offset
+
def readline(self, size=-1):
if size < 0:
+ # Shortcut common case - newline found in buffer.
+ offset = self.offset - self.extrastart
+ i = self.extrabuf.find(b'\n', offset) + 1
+ if i > 0:
+ self.extrasize -= i - offset
+ self.offset += i - offset
+ return self.extrabuf[offset: i]
+
size = sys.maxsize
readsize = self.min_readsize
else:
@@ -457,41 +565,22 @@ class GzipFile:
self.min_readsize = min(readsize, self.min_readsize * 2, 512)
return b''.join(bufs) # Return resulting line
- def readlines(self, sizehint=0):
- # Negative numbers result in reading all the lines
- if sizehint <= 0:
- sizehint = sys.maxsize
- L = []
- while sizehint > 0:
- line = self.readline()
- if line == b"":
- break
- L.append(line)
- sizehint = sizehint - len(line)
-
- return L
-
- def writelines(self, L):
- for line in L:
- self.write(line)
-
- def __iter__(self):
- return self
- def __next__(self):
- line = self.readline()
- if line:
- return line
- else:
- raise StopIteration
-
- def __enter__(self):
- if self.fileobj is None:
- raise ValueError("I/O operation on closed GzipFile object")
- return self
-
- def __exit__(self, *args):
- self.close()
+def compress(data, compresslevel=9):
+ """Compress data in one shot and return the compressed string.
+ Optional argument is the compression level, in range of 1-9.
+ """
+ buf = io.BytesIO()
+ with GzipFile(fileobj=buf, mode='wb', compresslevel=compresslevel) as f:
+ f.write(data)
+ return buf.getvalue()
+
+def decompress(data):
+ """Decompress a gzip compressed string in one shot.
+ Return the decompressed string.
+ """
+ with GzipFile(fileobj=io.BytesIO(data)) as f:
+ return f.read()
def _test():
diff --git a/Lib/hashlib.py b/Lib/hashlib.py
index 34ed195cd0..0d7e3250d5 100644
--- a/Lib/hashlib.py
+++ b/Lib/hashlib.py
@@ -1,6 +1,4 @@
-# $Id$
-#
-# Copyright (C) 2005-2007 Gregory P. Smith (greg@krypto.org)
+# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
@@ -15,8 +13,9 @@ than using new(name):
md5(), sha1(), sha224(), sha256(), sha384(), and sha512()
-More algorithms may be available on your platform but the above are
-guaranteed to exist.
+More algorithms may be available on your platform but the above are guaranteed
+to exist. See the algorithms_guaranteed and algorithms_available attributes
+to find out what algorithm names can be passed to new().
NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.
@@ -53,6 +52,16 @@ More condensed:
"""
+# This tuple and __get_builtin_constructor() must be modified if a new
+# always available algorithm is added.
+__always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')
+
+algorithms_guaranteed = set(__always_supported)
+algorithms_available = set(__always_supported)
+
+__all__ = __always_supported + ('new', 'algorithms_guaranteed',
+ 'algorithms_available')
+
def __get_builtin_constructor(name):
if name in ('SHA1', 'sha1'):
@@ -76,7 +85,19 @@ def __get_builtin_constructor(name):
elif bs == '384':
return _sha512.sha384
- raise ValueError("unsupported hash type")
+ raise ValueError('unsupported hash type %s' % name)
+
+
+def __get_openssl_constructor(name):
+ try:
+ f = getattr(_hashlib, 'openssl_' + name)
+ # Allow the C module to raise ValueError. The function will be
+ # defined but the hash not actually available thanks to OpenSSL.
+ f()
+ # Use the C function directly (very fast)
+ return f
+ except (AttributeError, ValueError):
+ return __get_builtin_constructor(name)
def __py_new(name, data=b''):
@@ -102,39 +123,23 @@ def __hash_new(name, data=b''):
try:
import _hashlib
- # use the wrapper of the C implementation
new = __hash_new
-
- for opensslFuncName in filter(lambda n: n.startswith('openssl_'), dir(_hashlib)):
- funcName = opensslFuncName[len('openssl_'):]
- try:
- # try them all, some may not work due to the OpenSSL
- # version not supporting that algorithm.
- f = getattr(_hashlib, opensslFuncName)
- f()
- # Use the C function directly (very fast)
- exec(funcName + ' = f')
- except ValueError:
- try:
- # Use the builtin implementation directly (fast)
- exec(funcName + ' = __get_builtin_constructor(funcName)')
- except ValueError:
- # this one has no builtin implementation, don't define it
- pass
- # clean up our locals
- del f
- del opensslFuncName
- del funcName
-
+ __get_hash = __get_openssl_constructor
+ algorithms_available = algorithms_available.union(
+ _hashlib.openssl_md_meth_names)
except ImportError:
- # We don't have the _hashlib OpenSSL module?
- # use the built in legacy interfaces via a wrapper function
new = __py_new
+ __get_hash = __get_builtin_constructor
+
+for __func_name in __always_supported:
+ # try them all, some may not work due to the OpenSSL
+ # version not supporting that algorithm.
+ try:
+ globals()[__func_name] = __get_hash(__func_name)
+ except ValueError:
+ import logging
+ logging.exception('code for hash %s was not found.', __func_name)
- # lookup the C function to use directly for the named constructors
- md5 = __get_builtin_constructor('md5')
- sha1 = __get_builtin_constructor('sha1')
- sha224 = __get_builtin_constructor('sha224')
- sha256 = __get_builtin_constructor('sha256')
- sha384 = __get_builtin_constructor('sha384')
- sha512 = __get_builtin_constructor('sha512')
+# Cleanup locals()
+del __always_supported, __func_name, __get_hash
+del __py_new, __hash_new, __get_openssl_constructor
diff --git a/Lib/heapq.py b/Lib/heapq.py
index cc61294cc8..f756035810 100644
--- a/Lib/heapq.py
+++ b/Lib/heapq.py
@@ -1,5 +1,3 @@
-# -*- coding: latin-1 -*-
-
"""Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
@@ -34,7 +32,7 @@ maintains the heap invariant!
__about__ = """Heap queues
-[explanation by François Pinard]
+[explanation by François Pinard]
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
@@ -214,11 +212,10 @@ def nsmallest(n, iterable):
pop = result.pop
los = result[-1] # los --> Largest of the nsmallest
for elem in it:
- if los <= elem:
- continue
- insort(result, elem)
- pop()
- los = result[-1]
+ if elem < los:
+ insort(result, elem)
+ pop()
+ los = result[-1]
return result
# An alternative approach manifests the whole iterable in memory but
# saves comparisons by heapifying all at once. Also, saves time
diff --git a/Lib/hmac.py b/Lib/hmac.py
index 0f59fd4847..e878e1a809 100644
--- a/Lib/hmac.py
+++ b/Lib/hmac.py
@@ -12,10 +12,6 @@ trans_36 = bytes((x ^ 0x36) for x in range(256))
# hashing module used. Use digest_size from the instance of HMAC instead.
digest_size = None
-# A unique object passed by HMAC.copy() to the HMAC constructor, in order
-# that the latter return very quickly. HMAC("") in contrast is quite
-# expensive.
-_secret_backdoor_key = []
class HMAC:
"""RFC 2104 HMAC class. Also complies with RFC 4231.
@@ -36,9 +32,6 @@ class HMAC:
Note: key and msg must be bytes objects.
"""
- if key is _secret_backdoor_key: # cheap
- return
-
if not isinstance(key, bytes):
raise TypeError("expected bytes, but got %r" % type(key).__name__)
@@ -58,8 +51,6 @@ class HMAC:
if hasattr(self.inner, 'block_size'):
blocksize = self.inner.block_size
if blocksize < 16:
- # Very low blocksize, most likely a legacy value like
- # Lib/sha.py and Lib/md5.py have.
_warnings.warn('block_size of %d seems too small; using our '
'default of %d.' % (blocksize, self.blocksize),
RuntimeWarning, 2)
@@ -79,9 +70,6 @@ class HMAC:
if msg is not None:
self.update(msg)
-## def clear(self):
-## raise NotImplementedError, "clear() method not available in HMAC."
-
def update(self, msg):
"""Update this hashing object with the string msg.
"""
@@ -94,7 +82,8 @@ class HMAC:
An update to this copy won't affect the original object.
"""
- other = self.__class__(_secret_backdoor_key)
+ # Call __new__ directly to avoid the expensive __init__.
+ other = self.__class__.__new__(self.__class__)
other.digest_cons = self.digest_cons
other.digest_size = self.digest_size
other.inner = self.inner.copy()
diff --git a/Lib/html/__init__.py b/Lib/html/__init__.py
index 196d378857..335d214828 100644
--- a/Lib/html/__init__.py
+++ b/Lib/html/__init__.py
@@ -1 +1,20 @@
-# This directory is a Python package.
+"""
+General functions for HTML manipulation.
+"""
+
+
+_escape_map = {ord('&'): '&amp;', ord('<'): '&lt;', ord('>'): '&gt;'}
+_escape_map_full = {ord('&'): '&amp;', ord('<'): '&lt;', ord('>'): '&gt;',
+ ord('"'): '&quot;', ord('\''): '&#x27;'}
+
+# NB: this is a candidate for a bytes/string polymorphic interface
+
+def escape(s, quote=True):
+ """
+ Replace special characters "&", "<" and ">" to HTML-safe sequences.
+ If the optional flag quote is true (the default), the quotation mark
+ character (") is also translated.
+ """
+ if quote:
+ return s.translate(_escape_map_full)
+ return s.translate(_escape_map)
diff --git a/Lib/html/parser.py b/Lib/html/parser.py
index 3f68e189c4..a3586ebf51 100644
--- a/Lib/html/parser.py
+++ b/Lib/html/parser.py
@@ -24,10 +24,14 @@ starttagopen = re.compile('<[a-zA-Z]')
piclose = re.compile('>')
commentclose = re.compile(r'--\s*>')
tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9:_]*')
+# Note, the strict one of this pair isn't really strict, but we can't
+# make it correctly strict without breaking backward compatibility.
attrfind = re.compile(
r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*'
- r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~@]*))?')
-
+ r'(\'[^\']*\'|"[^"]*"|[^\s"\'=<>`]*))?')
+attrfind_tolerant = re.compile(
+ r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*'
+ r'(\'[^\']*\'|"[^"]*"|[^>\s]*))?')
locatestarttagend = re.compile(r"""
<[a-zA-Z][-.a-zA-Z0-9:_]* # tag name
(?:\s+ # whitespace before attribute name
@@ -42,6 +46,21 @@ locatestarttagend = re.compile(r"""
)*
\s* # trailing whitespace
""", re.VERBOSE)
+locatestarttagend_tolerant = re.compile(r"""
+ <[a-zA-Z][-.a-zA-Z0-9:_]* # tag name
+ (?:\s* # optional whitespace before attribute name
+ (?:[a-zA-Z_][-.:a-zA-Z0-9_]* # attribute name
+ (?:\s*=\s* # value indicator
+ (?:'[^']*' # LITA-enclosed value
+ |\"[^\"]*\" # LIT-enclosed value
+ |[^'\">\s]+ # bare value
+ )
+ (?:\s*,)* # possibly followed by a comma
+ )?
+ )
+ )*
+ \s* # trailing whitespace
+""", re.VERBOSE)
endendtag = re.compile('>')
endtagfind = re.compile('</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>')
@@ -86,9 +105,15 @@ class HTMLParser(_markupbase.ParserBase):
CDATA_CONTENT_ELEMENTS = ("script", "style")
+ def __init__(self, strict=True):
+ """Initialize and reset this instance.
- def __init__(self):
- """Initialize and reset this instance."""
+ If strict is set to True (the default), errors are raised when invalid
+ HTML is encountered. If set to False, an attempt is instead made to
+ continue parsing, making "best guesses" about the intended meaning, in
+ a fashion similar to what browsers typically do.
+ """
+ self.strict = strict
self.reset()
def reset(self):
@@ -160,9 +185,18 @@ class HTMLParser(_markupbase.ParserBase):
else:
break
if k < 0:
- if end:
+ if not end:
+ break
+ if self.strict:
self.error("EOF in middle of construct")
- break
+ k = rawdata.find('>', i + 1)
+ if k < 0:
+ k = rawdata.find('<', i + 1)
+ if k < 0:
+ k = i + 1
+ else:
+ k += 1
+ self.handle_data(rawdata[i:k])
i = self.updatepos(i, k)
elif startswith("&#", i):
match = charref.match(rawdata, i)
@@ -193,7 +227,12 @@ class HTMLParser(_markupbase.ParserBase):
if match:
# match.group() will contain at least 2 chars
if end and match.group() == rawdata[i:]:
- self.error("EOF in middle of entity or char ref")
+ if self.strict:
+ self.error("EOF in middle of entity or char ref")
+ else:
+ if k <= i:
+ k = n
+ i = self.updatepos(i, i + 1)
# incomplete
break
elif (i + 1) < n:
@@ -240,7 +279,10 @@ class HTMLParser(_markupbase.ParserBase):
self.lasttag = tag = rawdata[i+1:k].lower()
while k < endpos:
- m = attrfind.match(rawdata, k)
+ if self.strict:
+ m = attrfind.match(rawdata, k)
+ else:
+ m = attrfind_tolerant.search(rawdata, k)
if not m:
break
attrname, rest, attrvalue = m.group(1, 2, 3)
@@ -262,8 +304,11 @@ class HTMLParser(_markupbase.ParserBase):
- self.__starttag_text.rfind("\n")
else:
offset = offset + len(self.__starttag_text)
- self.error("junk characters in start tag: %r"
- % (rawdata[k:endpos][:20],))
+ if self.strict:
+ self.error("junk characters in start tag: %r"
+ % (rawdata[k:endpos][:20],))
+ self.handle_data(rawdata[i:endpos])
+ return endpos
if end.endswith('/>'):
# XHTML-style empty tag: <span attr="value" />
self.handle_startendtag(tag, attrs)
@@ -277,7 +322,10 @@ class HTMLParser(_markupbase.ParserBase):
# or -1 if incomplete.
def check_for_whole_start_tag(self, i):
rawdata = self.rawdata
- m = locatestarttagend.match(rawdata, i)
+ if self.strict:
+ m = locatestarttagend.match(rawdata, i)
+ else:
+ m = locatestarttagend_tolerant.match(rawdata, i)
if m:
j = m.end()
next = rawdata[j:j+1]
@@ -290,8 +338,13 @@ class HTMLParser(_markupbase.ParserBase):
# buffer boundary
return -1
# else bogus input
- self.updatepos(i, j + 1)
- self.error("malformed empty start tag")
+ if self.strict:
+ self.updatepos(i, j + 1)
+ self.error("malformed empty start tag")
+ if j > i:
+ return j
+ else:
+ return i + 1
if next == "":
# end of input
return -1
@@ -300,8 +353,13 @@ class HTMLParser(_markupbase.ParserBase):
# end of input in or before attribute value, or we have the
# '/' from a '/>' ending
return -1
- self.updatepos(i, j)
- self.error("malformed start tag")
+ if self.strict:
+ self.updatepos(i, j)
+ self.error("malformed start tag")
+ if j > i:
+ return j
+ else:
+ return i + 1
raise AssertionError("we should not get here!")
# Internal -- parse endtag, return end or -1 if incomplete
@@ -314,7 +372,15 @@ class HTMLParser(_markupbase.ParserBase):
j = match.end()
match = endtagfind.match(rawdata, i) # </ + tag + >
if not match:
- self.error("bad end tag: %r" % (rawdata[i:j],))
+ if self.strict:
+ self.error("bad end tag: %r" % (rawdata[i:j],))
+ k = rawdata.find('<', i + 1, j)
+ if k > i:
+ j = k
+ if j <= i:
+ j = i + 1
+ self.handle_data(rawdata[i:j])
+ return j
tag = match.group(1)
self.handle_endtag(tag.lower())
self.clear_cdata_mode()
@@ -358,7 +424,8 @@ class HTMLParser(_markupbase.ParserBase):
pass
def unknown_decl(self, data):
- self.error("unknown declaration: %r" % (data,))
+ if self.strict:
+ self.error("unknown declaration: %r" % (data,))
# Internal -- helper to remove special character quoting
entitydefs = None
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 4a65125712..604577cd7b 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -71,6 +71,7 @@ import email.message
import io
import os
import socket
+import collections
from urllib.parse import urlsplit
import warnings
@@ -257,13 +258,10 @@ def parse_headers(fp, _class=HTTPMessage):
hstring = b''.join(headers).decode('iso-8859-1')
return email.parser.Parser(_class=_class).parsestr(hstring)
-class HTTPResponse(io.RawIOBase):
- # strict: If true, raise BadStatusLine if the status line can't be
- # parsed as a valid HTTP/1.0 or 1.1 status line. By default it is
- # false because it prevents clients from talking to HTTP/0.9
- # servers. Note that a response with a sufficiently corrupted
- # status line will look like an HTTP/0.9 response.
+_strict_sentinel = object()
+
+class HTTPResponse(io.RawIOBase):
# See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details.
@@ -272,7 +270,7 @@ class HTTPResponse(io.RawIOBase):
# text following RFC 2047. The basic status line parsing only
# accepts iso-8859-1.
- def __init__(self, sock, debuglevel=0, strict=0, method=None, url=None):
+ def __init__(self, sock, debuglevel=0, strict=_strict_sentinel, method=None, url=None):
# If the response includes a content-length header, we need to
# make sure that the client doesn't read more than the
# specified number of bytes. If it does, it will block until
@@ -282,7 +280,10 @@ class HTTPResponse(io.RawIOBase):
# clients unless they know what they are doing.
self.fp = sock.makefile("rb")
self.debuglevel = debuglevel
- self.strict = strict
+ if strict is not _strict_sentinel:
+ warnings.warn("the 'strict' argument isn't supported anymore; "
+ "http.client now always assumes HTTP/1.x compliant servers.",
+ DeprecationWarning, 2)
self._method = method
# The HTTPResponse object is returned via urllib. The clients
@@ -304,8 +305,9 @@ class HTTPResponse(io.RawIOBase):
self.will_close = _UNKNOWN # conn will close at end of response
def _read_status(self):
- # Initialize with Simple-Response defaults.
- line = str(self.fp.readline(), "iso-8859-1")
+ line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
+ if len(line) > _MAXLINE:
+ raise LineTooLong("status line")
if self.debuglevel > 0:
print("reply:", repr(line))
if not line:
@@ -313,25 +315,17 @@ class HTTPResponse(io.RawIOBase):
# sending a valid response.
raise BadStatusLine(line)
try:
- [version, status, reason] = line.split(None, 2)
+ version, status, reason = line.split(None, 2)
except ValueError:
try:
- [version, status] = line.split(None, 1)
+ version, status = line.split(None, 1)
reason = ""
except ValueError:
- # empty version will cause next test to fail and status
- # will be treated as 0.9 response.
+ # empty version will cause next test to fail.
version = ""
if not version.startswith("HTTP/"):
- if self.strict:
- self.close()
- raise BadStatusLine(line)
- else:
- # Assume it's a Simple-Response from an 0.9 server.
- # We have to convert the first line back to raw bytes
- # because self.fp.readline() needs to return bytes.
- self.fp = LineAndFileWrapper(bytes(line, "ascii"), self.fp)
- return "HTTP/0.9", 200, ""
+ self.close()
+ raise BadStatusLine(line)
# The status code is a three-digit number
try:
@@ -365,22 +359,14 @@ class HTTPResponse(io.RawIOBase):
self.code = self.status = status
self.reason = reason.strip()
- if version == "HTTP/1.0":
+ if version in ("HTTP/1.0", "HTTP/0.9"):
+ # Some servers might still return "0.9", treat it as 1.0 anyway
self.version = 10
elif version.startswith("HTTP/1."):
self.version = 11 # use HTTP/1.1 code for HTTP/1.x where x>=1
- elif version == "HTTP/0.9":
- self.version = 9
else:
raise UnknownProtocol(version)
- if self.version == 9:
- self.length = None
- self.chunked = False
- self.will_close = True
- self.headers = self.msg = email.message_from_string('')
- return
-
self.headers = self.msg = parse_headers(self.fp)
if self.debuglevel > 0:
@@ -651,11 +637,15 @@ class HTTPConnection:
default_port = HTTP_PORT
auto_open = 1
debuglevel = 0
- strict = 0
- def __init__(self, host, port=None, strict=None,
- timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
+ def __init__(self, host, port=None, strict=_strict_sentinel,
+ timeout=socket._GLOBAL_DEFAULT_TIMEOUT, source_address=None):
+ if strict is not _strict_sentinel:
+ warnings.warn("the 'strict' argument isn't supported anymore; "
+ "http.client now always assumes HTTP/1.x compliant servers.",
+ DeprecationWarning, 2)
self.timeout = timeout
+ self.source_address = source_address
self.sock = None
self._buffer = []
self.__response = None
@@ -666,10 +656,13 @@ class HTTPConnection:
self._tunnel_headers = {}
self._set_hostport(host, port)
- if strict is not None:
- self.strict = strict
- def _set_tunnel(self, host, port=None, headers=None):
+ def set_tunnel(self, host, port=None, headers=None):
+ """ Sets up the host and the port for the HTTP CONNECT Tunnelling.
+
+ The headers argument should be a mapping of extra HTTP headers
+ to send with the CONNECT request.
+ """
self._tunnel_host = host
self._tunnel_port = port
if headers:
@@ -704,12 +697,11 @@ class HTTPConnection:
self.send(connect_bytes)
for header, value in self._tunnel_headers.items():
header_str = "%s: %s\r\n" % (header, value)
- header_bytes = header_str.encode("ascii")
+ header_bytes = header_str.encode("latin1")
self.send(header_bytes)
self.send(b'\r\n')
- response = self.response_class(self.sock, strict = self.strict,
- method = self._method)
+ response = self.response_class(self.sock, method=self._method)
(version, code, message) = response._read_status()
if code != 200:
@@ -726,7 +718,7 @@ class HTTPConnection:
def connect(self):
"""Connect to the host and port specified in __init__."""
self.sock = socket.create_connection((self.host,self.port),
- self.timeout)
+ self.timeout, self.source_address)
if self._tunnel_host:
self._tunnel()
@@ -741,18 +733,17 @@ class HTTPConnection:
self.__state = _CS_IDLE
def send(self, data):
- """Send `data' to the server."""
+ """Send `data' to the server.
+ ``data`` can be a string object, a bytes object, an array object, a
+ file-like object that supports a .read() method, or an iterable object.
+ """
+
if self.sock is None:
if self.auto_open:
self.connect()
else:
raise NotConnected()
- # send the data to the server. if we get a broken pipe, then close
- # the socket. we want to reconnect when somebody tries to send again.
- #
- # NOTE: we DO propagate the error, though, because we cannot simply
- # ignore the error... the caller will know if they can retry.
if self.debuglevel > 0:
print("send:", repr(data))
blocksize = 8192
@@ -778,8 +769,16 @@ class HTTPConnection:
if encode:
datablock = datablock.encode("iso-8859-1")
self.sock.sendall(datablock)
- else:
+
+ try:
self.sock.sendall(data)
+ except TypeError:
+ if isinstance(data, collections.Iterable):
+ for d in data:
+ self.sock.sendall(d)
+ else:
+ raise TypeError("data should be a bytes-like object\
+ or an iterable, got %r " % type(it))
def _output(self, s):
"""Add a line of output to the current request buffer.
@@ -938,7 +937,7 @@ class HTTPConnection:
values = list(values)
for i, one_value in enumerate(values):
if hasattr(one_value, 'encode'):
- values[i] = one_value.encode('ascii')
+ values[i] = one_value.encode('latin1')
elif isinstance(one_value, int):
values[i] = str(one_value).encode('ascii')
value = b'\r\n\t'.join(values)
@@ -1040,11 +1039,9 @@ class HTTPConnection:
if self.debuglevel > 0:
response = self.response_class(self.sock, self.debuglevel,
- strict=self.strict,
method=self._method)
else:
- response = self.response_class(self.sock, strict=self.strict,
- method=self._method)
+ response = self.response_class(self.sock, method=self._method)
response.begin()
assert response.will_close != _UNKNOWN
@@ -1069,30 +1066,50 @@ else:
default_port = HTTPS_PORT
+ # XXX Should key_file and cert_file be deprecated in favour of context?
+
def __init__(self, host, port=None, key_file=None, cert_file=None,
- strict=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
- HTTPConnection.__init__(self, host, port, strict, timeout)
+ strict=_strict_sentinel, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
+ source_address=None, *, context=None, check_hostname=None):
+ super(HTTPSConnection, self).__init__(host, port, strict, timeout,
+ source_address)
self.key_file = key_file
self.cert_file = cert_file
+ if context is None:
+ # Some reasonable defaults
+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ context.options |= ssl.OP_NO_SSLv2
+ will_verify = context.verify_mode != ssl.CERT_NONE
+ if check_hostname is None:
+ check_hostname = will_verify
+ elif check_hostname and not will_verify:
+ raise ValueError("check_hostname needs a SSL context with "
+ "either CERT_OPTIONAL or CERT_REQUIRED")
+ if key_file or cert_file:
+ context.load_cert_chain(cert_file, key_file)
+ self._context = context
+ self._check_hostname = check_hostname
def connect(self):
"Connect to a host on a given (SSL) port."
sock = socket.create_connection((self.host, self.port),
- self.timeout)
+ self.timeout, self.source_address)
if self._tunnel_host:
self.sock = sock
self._tunnel()
- self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
-
-
- def FakeSocket (sock, sslobj):
- warnings.warn("FakeSocket is deprecated, and won't be in 3.x. " +
- "Use the result of ssl.wrap_socket() directly instead.",
- DeprecationWarning, stacklevel=2)
- return sslobj
+ server_hostname = self.host if ssl.HAS_SNI else None
+ self.sock = self._context.wrap_socket(sock,
+ server_hostname=server_hostname)
+ try:
+ if self._check_hostname:
+ ssl.match_hostname(self.sock.getpeercert(), self.host)
+ except Exception:
+ self.sock.shutdown(socket.SHUT_RDWR)
+ self.sock.close()
+ raise
__all__.append("HTTPSConnection")
@@ -1146,6 +1163,8 @@ class ResponseNotReady(ImproperConnectionState):
class BadStatusLine(HTTPException):
def __init__(self, line):
+ if not line:
+ line = repr(line)
self.args = line,
self.line = line
@@ -1156,71 +1175,3 @@ class LineTooLong(HTTPException):
# for backwards compatibility
error = HTTPException
-
-class LineAndFileWrapper:
- """A limited file-like object for HTTP/0.9 responses."""
-
- # The status-line parsing code calls readline(), which normally
- # get the HTTP status line. For a 0.9 response, however, this is
- # actually the first line of the body! Clients need to get a
- # readable file object that contains that line.
-
- def __init__(self, line, file):
- self._line = line
- self._file = file
- self._line_consumed = 0
- self._line_offset = 0
- self._line_left = len(line)
-
- def __getattr__(self, attr):
- return getattr(self._file, attr)
-
- def _done(self):
- # called when the last byte is read from the line. After the
- # call, all read methods are delegated to the underlying file
- # object.
- self._line_consumed = 1
- self.read = self._file.read
- self.readline = self._file.readline
- self.readlines = self._file.readlines
-
- def read(self, amt=None):
- if self._line_consumed:
- return self._file.read(amt)
- assert self._line_left
- if amt is None or amt > self._line_left:
- s = self._line[self._line_offset:]
- self._done()
- if amt is None:
- return s + self._file.read()
- else:
- return s + self._file.read(amt - len(s))
- else:
- assert amt <= self._line_left
- i = self._line_offset
- j = i + amt
- s = self._line[i:j]
- self._line_offset = j
- self._line_left -= amt
- if self._line_left == 0:
- self._done()
- return s
-
- def readline(self):
- if self._line_consumed:
- return self._file.readline()
- assert self._line_left
- s = self._line[self._line_offset:]
- self._done()
- return s
-
- def readlines(self, size=None):
- if self._line_consumed:
- return self._file.readlines(size)
- assert self._line_left
- L = [self._line[self._line_offset:]]
- self._done()
- if size is None:
- return L + self._file.readlines()
- else:
- return L + self._file.readlines(size)
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py
index e7f0b4b321..9d798e8127 100644
--- a/Lib/http/cookiejar.py
+++ b/Lib/http/cookiejar.py
@@ -442,6 +442,13 @@ def join_header_words(lists):
if attr: headers.append("; ".join(attr))
return ", ".join(headers)
+def strip_quotes(text):
+ if text.startswith('"'):
+ text = text[1:]
+ if text.endswith('"'):
+ text = text[:-1]
+ return text
+
def parse_ns_headers(ns_headers):
"""Ad-hoc parser for Netscape protocol cookie-attributes.
@@ -459,7 +466,7 @@ def parse_ns_headers(ns_headers):
"""
known_attrs = ("expires", "domain", "path", "secure",
# RFC 2109 attrs (may turn up in Netscape cookies, too)
- "port", "max-age")
+ "version", "port", "max-age")
result = []
for ns_header in ns_headers:
@@ -479,12 +486,11 @@ def parse_ns_headers(ns_headers):
k = lc
if k == "version":
# This is an RFC 2109 cookie.
+ v = strip_quotes(v)
version_set = True
if k == "expires":
# convert expires date to seconds since epoch
- if v.startswith('"'): v = v[1:]
- if v.endswith('"'): v = v[:-1]
- v = http2time(v) # None if invalid
+ v = http2time(strip_quotes(v)) # None if invalid
pairs.append((k, v))
if pairs:
@@ -1449,7 +1455,11 @@ class CookieJar:
# set the easy defaults
version = standard.get("version", None)
- if version is not None: version = int(version)
+ if version is not None:
+ try:
+ version = int(version)
+ except ValueError:
+ return None # invalid version, ignore cookie
secure = standard.get("secure", False)
# (discard is also set if expires is Absent)
discard = standard.get("discard", False)
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
index 0d9e6d0e3a..93da62791d 100644
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
####
@@ -46,7 +46,7 @@ At the moment, this is the only documentation.
The Basics
----------
-Importing is easy..
+Importing is easy...
>>> from http import cookies
@@ -127,19 +127,14 @@ the value to a string, when the values are set dictionary-style.
'Set-Cookie: number=7\r\nSet-Cookie: string=seven'
Finis.
-""" #"
-# ^
-# |----helps out font-lock
+"""
#
# Import our required modules
#
+import re
import string
-from pickle import dumps, loads
-
-import re, warnings
-
__all__ = ["CookieError", "BaseCookie", "SimpleCookie"]
_nulljoin = ''.join
@@ -231,17 +226,16 @@ _Translator = {
}
def _quote(str, LegalChars=_LegalChars):
- #
- # If the string does not need to be double-quoted,
- # then just return the string. Otherwise, surround
- # the string in doublequotes and precede quote (with a \)
- # special characters.
- #
+ r"""Quote a string for use in a cookie header.
+
+ If the string does not need to be double-quoted, then just return the
+ string. Otherwise, surround the string in doublequotes and quote
+ (with a \) special characters.
+ """
if all(c in LegalChars for c in str):
return str
else:
- return '"' + _nulljoin( map(_Translator.get, str, str) ) + '"'
-# end _quote
+ return '"' + _nulljoin(_Translator.get(s, s) for s in str) + '"'
_OctalPatt = re.compile(r"\\[0-3][0-7][0-7]")
@@ -250,7 +244,7 @@ _QuotePatt = re.compile(r"[\\].")
def _unquote(str):
# If there aren't any doublequotes,
# then there can't be any special characters. See RFC 2109.
- if len(str) < 2:
+ if len(str) < 2:
return str
if str[0] != '"' or str[-1] != '"':
return str
@@ -269,32 +263,32 @@ def _unquote(str):
n = len(str)
res = []
while 0 <= i < n:
- Omatch = _OctalPatt.search(str, i)
- Qmatch = _QuotePatt.search(str, i)
- if not Omatch and not Qmatch: # Neither matched
+ o_match = _OctalPatt.search(str, i)
+ q_match = _QuotePatt.search(str, i)
+ if not o_match and not q_match: # Neither matched
res.append(str[i:])
break
# else:
j = k = -1
- if Omatch: j = Omatch.start(0)
- if Qmatch: k = Qmatch.start(0)
- if Qmatch and ( not Omatch or k < j ): # QuotePatt matched
+ if o_match:
+ j = o_match.start(0)
+ if q_match:
+ k = q_match.start(0)
+ if q_match and (not o_match or k < j): # QuotePatt matched
res.append(str[i:k])
res.append(str[k+1])
- i = k+2
+ i = k + 2
else: # OctalPatt matched
res.append(str[i:j])
- res.append( chr( int(str[j+1:j+4], 8) ) )
- i = j+4
+ res.append(chr(int(str[j+1:j+4], 8)))
+ i = j + 4
return _nulljoin(res)
-# end _unquote
-
-# The _getdate() routine is used to set the expiration time in
-# the cookie's HTTP header. By default, _getdate() returns the
-# current time in the appropriate "expires" format for a
-# Set-Cookie header. The one optional argument is an offset from
-# now, in seconds. For example, an offset of -3600 means "one hour ago".
-# The offset may be a floating point number.
+
+# The _getdate() routine is used to set the expiration time in the cookie's HTTP
+# header. By default, _getdate() returns the current time in the appropriate
+# "expires" format for a Set-Cookie header. The one optional argument is an
+# offset from now, in seconds. For example, an offset of -3600 means "one hour
+# ago". The offset may be a floating point number.
#
_weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
@@ -311,18 +305,15 @@ def _getdate(future=0, weekdayname=_weekdayname, monthname=_monthname):
(weekdayname[wd], day, monthname[month], year, hh, mm, ss)
-#
-# A class to hold ONE key,value pair.
-# In a cookie, each such pair may have several attributes.
-# so this class is used to keep the attributes associated
-# with the appropriate key,value pair.
-# This class also includes a coded_value attribute, which
-# is used to hold the network representation of the
-# value. This is most useful when Python objects are
-# pickled for network transit.
-#
-
class Morsel(dict):
+ """A class to hold ONE (key, value) pair.
+
+ In a cookie, each such pair may have several attributes, so this class is
+ used to keep the attributes associated with the appropriate key,value pair.
+ This class also includes a coded_value attribute, which is used to hold
+ the network representation of the value. This is most useful when Python
+ objects are pickled for network transit.
+ """
# RFC 2109 lists these attributes as reserved:
# path comment domain
# max-age secure version
@@ -336,35 +327,33 @@ class Morsel(dict):
# This dictionary provides a mapping from the lowercase
# variant on the left to the appropriate traditional
# formatting on the right.
- _reserved = { "expires" : "expires",
- "path" : "Path",
- "comment" : "Comment",
- "domain" : "Domain",
- "max-age" : "Max-Age",
- "secure" : "secure",
- "httponly" : "httponly",
- "version" : "Version",
- }
+ _reserved = {
+ "expires" : "expires",
+ "path" : "Path",
+ "comment" : "Comment",
+ "domain" : "Domain",
+ "max-age" : "Max-Age",
+ "secure" : "secure",
+ "httponly" : "httponly",
+ "version" : "Version",
+ }
def __init__(self):
# Set defaults
self.key = self.value = self.coded_value = None
# Set default attributes
- for K in self._reserved:
- dict.__setitem__(self, K, "")
- # end __init__
+ for key in self._reserved:
+ dict.__setitem__(self, key, "")
def __setitem__(self, K, V):
K = K.lower()
if not K in self._reserved:
raise CookieError("Invalid Attribute %s" % K)
dict.__setitem__(self, K, V)
- # end __setitem__
def isReservedKey(self, K):
return K.lower() in self._reserved
- # end isReservedKey
def set(self, key, val, coded_val, LegalChars=_LegalChars):
# First we verify that the key isn't a reserved word
@@ -375,19 +364,18 @@ class Morsel(dict):
raise CookieError("Illegal key value: %s" % key)
# It's a good key, so save it.
- self.key = key
- self.value = val
- self.coded_value = coded_val
- # end set
+ self.key = key
+ self.value = val
+ self.coded_value = coded_val
- def output(self, attrs=None, header = "Set-Cookie:"):
- return "%s %s" % ( header, self.OutputString(attrs) )
+ def output(self, attrs=None, header="Set-Cookie:"):
+ return "%s %s" % (header, self.OutputString(attrs))
__str__ = output
def __repr__(self):
return '<%s: %s=%s>' % (self.__class__.__name__,
- self.key, repr(self.value) )
+ self.key, repr(self.value))
def js_output(self, attrs=None):
# Print javascript
@@ -397,41 +385,39 @@ class Morsel(dict):
document.cookie = \"%s\";
// end hiding -->
</script>
- """ % ( self.OutputString(attrs).replace('"',r'\"'))
- # end js_output()
+ """ % (self.OutputString(attrs).replace('"', r'\"'))
def OutputString(self, attrs=None):
# Build up our result
#
result = []
- RA = result.append
+ append = result.append
# First, the key=value pair
- RA("%s=%s" % (self.key, self.coded_value))
+ append("%s=%s" % (self.key, self.coded_value))
# Now add any defined attributes
if attrs is None:
attrs = self._reserved
items = sorted(self.items())
- for K,V in items:
- if V == "": continue
- if K not in attrs: continue
- if K == "expires" and type(V) == type(1):
- RA("%s=%s" % (self._reserved[K], _getdate(V)))
- elif K == "max-age" and type(V) == type(1):
- RA("%s=%d" % (self._reserved[K], V))
- elif K == "secure":
- RA(str(self._reserved[K]))
- elif K == "httponly":
- RA(str(self._reserved[K]))
+ for key, value in items:
+ if value == "":
+ continue
+ if key not in attrs:
+ continue
+ if key == "expires" and isinstance(value, int):
+ append("%s=%s" % (self._reserved[key], _getdate(value)))
+ elif key == "max-age" and isinstance(value, int):
+ append("%s=%d" % (self._reserved[key], value))
+ elif key == "secure":
+ append(str(self._reserved[key]))
+ elif key == "httponly":
+ append(str(self._reserved[key]))
else:
- RA("%s=%s" % (self._reserved[K], V))
+ append("%s=%s" % (self._reserved[key], value))
# Return the result
return _semispacejoin(result)
- # end OutputString
-# end Morsel class
-
#
@@ -461,13 +447,11 @@ _CookiePattern = re.compile(r"""
""", re.ASCII) # May be removed if safe.
-# At long last, here is the cookie class.
-# Using this class is almost just like using a dictionary.
-# See this module's docstring for example usage.
+# At long last, here is the cookie class. Using this class is almost just like
+# using a dictionary. See this module's docstring for example usage.
#
class BaseCookie(dict):
- # A container class for a set of Morsels
- #
+ """A container class for a set of Morsels."""
def value_decode(self, val):
"""real_value, coded_value = value_decode(STRING)
@@ -477,7 +461,6 @@ class BaseCookie(dict):
Override this function to modify the behavior of cookies.
"""
return val, val
- # end value_encode
def value_encode(self, val):
"""real_value, coded_value = value_encode(VALUE)
@@ -487,51 +470,46 @@ class BaseCookie(dict):
"""
strval = str(val)
return strval, strval
- # end value_encode
def __init__(self, input=None):
- if input: self.load(input)
- # end __init__
+ if input:
+ self.load(input)
def __set(self, key, real_value, coded_value):
"""Private method for setting a cookie's value"""
M = self.get(key, Morsel())
M.set(key, real_value, coded_value)
dict.__setitem__(self, key, M)
- # end __set
def __setitem__(self, key, value):
"""Dictionary style assignment."""
rval, cval = self.value_encode(value)
self.__set(key, rval, cval)
- # end __setitem__
def output(self, attrs=None, header="Set-Cookie:", sep="\015\012"):
"""Return a string suitable for HTTP."""
result = []
items = sorted(self.items())
- for K,V in items:
- result.append( V.output(attrs, header) )
+ for key, value in items:
+ result.append(value.output(attrs, header))
return sep.join(result)
- # end output
__str__ = output
def __repr__(self):
- L = []
+ l = []
items = sorted(self.items())
- for K,V in items:
- L.append( '%s=%s' % (K,repr(V.value) ) )
- return '<%s: %s>' % (self.__class__.__name__, _spacejoin(L))
+ for key, value in items:
+ l.append('%s=%s' % (key, repr(value.value)))
+ return '<%s: %s>' % (self.__class__.__name__, _spacejoin(l))
def js_output(self, attrs=None):
"""Return a string suitable for JavaScript."""
result = []
items = sorted(self.items())
- for K,V in items:
- result.append( V.js_output(attrs) )
+ for key, value in items:
+ result.append(value.js_output(attrs))
return _nulljoin(result)
- # end js_output
def load(self, rawdata):
"""Load cookies from a string (presumably HTTP_COOKIE) or
@@ -539,16 +517,15 @@ class BaseCookie(dict):
is equivalent to calling:
map(Cookie.__setitem__, d.keys(), d.values())
"""
- if type(rawdata) == type(""):
- self.__ParseString(rawdata)
+ if isinstance(rawdata, str):
+ self.__parse_string(rawdata)
else:
# self.update() wouldn't call our custom __setitem__
- for k, v in rawdata.items():
- self[k] = v
+ for key, value in rawdata.items():
+ self[key] = value
return
- # end load()
- def __ParseString(self, str, patt=_CookiePattern):
+ def __parse_string(self, str, patt=_CookiePattern):
i = 0 # Our starting point
n = len(str) # Length of string
M = None # current morsel
@@ -556,48 +533,39 @@ class BaseCookie(dict):
while 0 <= i < n:
# Start looking for a cookie
match = patt.search(str, i)
- if not match: break # No more cookies
+ if not match:
+ # No more cookies
+ break
- K,V = match.group("key"), match.group("val")
+ key, value = match.group("key"), match.group("val")
i = match.end(0)
# Parse the key, value in case it's metainfo
- if K[0] == "$":
+ if key[0] == "$":
# We ignore attributes which pertain to the cookie
# mechanism as a whole. See RFC 2109.
# (Does anyone care?)
if M:
- M[ K[1:] ] = V
- elif K.lower() in Morsel._reserved:
+ M[key[1:]] = value
+ elif key.lower() in Morsel._reserved:
if M:
- M[ K ] = _unquote(V)
+ M[key] = _unquote(value)
else:
- rval, cval = self.value_decode(V)
- self.__set(K, rval, cval)
- M = self[K]
- # end __ParseString
-# end BaseCookie class
+ rval, cval = self.value_decode(value)
+ self.__set(key, rval, cval)
+ M = self[key]
+
class SimpleCookie(BaseCookie):
- """SimpleCookie
+ """
SimpleCookie supports strings as cookie values. When setting
the value using the dictionary assignment notation, SimpleCookie
calls the builtin str() to convert the value to a string. Values
received from HTTP are kept as strings.
"""
def value_decode(self, val):
- return _unquote( val ), val
+ return _unquote(val), val
+
def value_encode(self, val):
strval = str(val)
- return strval, _quote( strval )
-# end SimpleCookie
-
-#
-###########################################################
-
-def _test():
- import doctest, http.cookies
- return doctest.testmod(http.cookies)
-
-if __name__ == "__main__":
- _test()
+ return strval, _quote(strval)
diff --git a/Lib/http/server.py b/Lib/http/server.py
index fccdc4c92e..86fa37fd5a 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -84,7 +84,7 @@ __version__ = "0.6"
__all__ = ["HTTPServer", "BaseHTTPRequestHandler"]
-import cgi
+import html
import email.message
import email.parser
import http.client
@@ -331,6 +331,30 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
elif (conntype.lower() == 'keep-alive' and
self.protocol_version >= "HTTP/1.1"):
self.close_connection = 0
+ # Examine the headers and look for an Expect directive
+ expect = self.headers.get('Expect', "")
+ if (expect.lower() == "100-continue" and
+ self.protocol_version >= "HTTP/1.1" and
+ self.request_version >= "HTTP/1.1"):
+ if not self.handle_expect_100():
+ return False
+ return True
+
+ def handle_expect_100(self):
+ """Decide what to do with an "Expect: 100-continue" header.
+
+ If the client is expecting a 100 Continue response, we must
+ respond with either a 100 Continue or a final response before
+ waiting for the request body. The default is to always respond
+ with a 100 Continue. You can behave differently (for example,
+ reject unauthorized requests) by overriding this method.
+
+ This method should either return True (possibly after sending
+ a 100 Continue response) or send an error response and return
+ False.
+
+ """
+ self.send_response_only(100)
return True
def handle_one_request(self):
@@ -341,24 +365,32 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
commands such as GET and POST.
"""
- self.raw_requestline = self.rfile.readline(65537)
- if len(self.raw_requestline) > 65536:
- self.requestline = ''
- self.request_version = ''
- self.command = ''
- self.send_error(414)
- return
- if not self.raw_requestline:
+ try:
+ self.raw_requestline = self.rfile.readline(65537)
+ if len(self.raw_requestline) > 65536:
+ self.requestline = ''
+ self.request_version = ''
+ self.command = ''
+ self.send_error(414)
+ return
+ if not self.raw_requestline:
+ self.close_connection = 1
+ return
+ if not self.parse_request():
+ # An error code has been sent, just exit
+ return
+ mname = 'do_' + self.command
+ if not hasattr(self, mname):
+ self.send_error(501, "Unsupported method (%r)" % self.command)
+ return
+ method = getattr(self, mname)
+ method()
+ self.wfile.flush() #actually send the response if not already done.
+ except socket.timeout as e:
+ #a read or a write timed out. Discard this connection
+ self.log_error("Request timed out: %r", e)
self.close_connection = 1
return
- if not self.parse_request(): # An error code has been sent, just exit
- return
- mname = 'do_' + self.command
- if not hasattr(self, mname):
- self.send_error(501, "Unsupported method (%r)" % self.command)
- return
- method = getattr(self, mname)
- method()
def handle(self):
"""Handle multiple requests if necessary."""
@@ -407,6 +439,12 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
"""
self.log_request(code)
+ self.send_response_only(code, message)
+ self.send_header('Server', self.version_string())
+ self.send_header('Date', self.date_time_string())
+
+ def send_response_only(self, code, message=None):
+ """Send the response header only."""
if message is None:
if code in self.responses:
message = self.responses[code][0]
@@ -414,15 +452,15 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
message = ''
if self.request_version != 'HTTP/0.9':
self.wfile.write(("%s %d %s\r\n" %
- (self.protocol_version, code, message)).encode('ASCII', 'strict'))
- # print (self.protocol_version, code, message)
- self.send_header('Server', self.version_string())
- self.send_header('Date', self.date_time_string())
+ (self.protocol_version, code, message)).encode('latin1', 'strict'))
def send_header(self, keyword, value):
"""Send a MIME header."""
if self.request_version != 'HTTP/0.9':
- self.wfile.write(("%s: %s\r\n" % (keyword, value)).encode('ASCII', 'strict'))
+ if not hasattr(self, '_headers_buffer'):
+ self._headers_buffer = []
+ self._headers_buffer.append(
+ ("%s: %s\r\n" % (keyword, value)).encode('latin1', 'strict'))
if keyword.lower() == 'connection':
if value.lower() == 'close':
@@ -433,7 +471,9 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
def end_headers(self):
"""Send the blank line ending the MIME headers."""
if self.request_version != 'HTTP/0.9':
- self.wfile.write(b"\r\n")
+ self._headers_buffer.append(b"\r\n")
+ self.wfile.write(b"".join(self._headers_buffer))
+ self._headers_buffer = []
def log_request(self, code='-', size='-'):
"""Log an accepted request.
@@ -684,7 +724,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
return None
list.sort(key=lambda a: a.lower())
r = []
- displaypath = cgi.escape(urllib.parse.unquote(self.path))
+ displaypath = html.escape(urllib.parse.unquote(self.path))
r.append('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">')
r.append("<html>\n<title>Directory listing for %s</title>\n" % displaypath)
r.append("<body>\n<h2>Directory listing for %s</h2>\n" % displaypath)
@@ -700,7 +740,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
displayname = name + "@"
# Note: a link to a directory displays with @ and links with /
r.append('<li><a href="%s">%s</a>\n'
- % (urllib.parse.quote(linkname), cgi.escape(displayname)))
+ % (urllib.parse.quote(linkname), html.escape(displayname)))
r.append("</ul>\n<hr>\n</body>\n</html>\n")
enc = sys.getfilesystemencoding()
encoded = ''.join(r).encode(enc)
@@ -842,7 +882,7 @@ def nobody_uid():
try:
nobody = pwd.getpwnam('nobody')[2]
except KeyError:
- nobody = 1 + max(map(lambda x: x[2], pwd.getpwall()))
+ nobody = 1 + max(x[2] for x in pwd.getpwall())
return nobody
diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/Bindings.py
index 74a93d3b14..ec2720b0d0 100644
--- a/Lib/idlelib/Bindings.py
+++ b/Lib/idlelib/Bindings.py
@@ -98,14 +98,6 @@ if macosxSupport.runningAsOSXApp():
# menu
del menudefs[-1][1][0:2]
- menudefs.insert(0,
- ('application', [
- ('About IDLE', '<<about-idle>>'),
- None,
- ('_Preferences....', '<<open-config-dialog>>'),
- ]))
-
-
default_keydefs = idleConf.GetCurrentKeySet()
del sys
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 98ec02bf7d..d77f0a42ee 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -3,7 +3,6 @@ import os
import re
import string
import imp
-from itertools import count
from tkinter import *
import tkinter.simpledialog as tkSimpleDialog
import tkinter.messagebox as tkMessageBox
@@ -51,6 +50,17 @@ def _find_module(fullname, path=None):
path = module.__path__
except AttributeError:
raise ImportError('No source for module ' + module.__name__)
+ if descr[2] != imp.PY_SOURCE:
+ # If all of the above fails and didn't raise an exception,fallback
+ # to a straight import which can find __init__.py in a package.
+ m = __import__(fullname)
+ try:
+ filename = m.__file__
+ except AttributeError:
+ pass
+ else:
+ file = None
+ descr = os.path.splitext(filename)[1], None, imp.PY_SOURCE
return file, filename, descr
class EditorWindow(object):
@@ -385,7 +395,7 @@ class EditorWindow(object):
underline, label = prepstr(label)
menudict[name] = menu = Menu(mbar, name=name)
mbar.add_cascade(label=label, menu=menu, underline=underline)
- if macosxSupport.runningAsOSXApp():
+ if macosxSupport.isCarbonAquaTk(self.root):
# Insert the application menu
menudict['application'] = menu = Menu(mbar, name='apple')
mbar.add_cascade(label='IDLE', menu=menu)
@@ -799,8 +809,8 @@ class EditorWindow(object):
for instance in self.top.instance_dict:
menu = instance.recent_files_menu
menu.delete(1, END) # clear, and rebuild:
- for i, file in zip(count(), rf_list):
- file_name = file[0:-1] # zap \n
+ for i, file_name in enumerate(rf_list):
+ file_name = file_name.rstrip() # zap \n
# make unicode string to display non-ASCII chars correctly
ufile_name = self._filename_to_unicode(file_name)
callback = instance.__recent_file_callback(file_name)
@@ -1544,7 +1554,12 @@ keynames = {
def get_accelerator(keydefs, eventname):
keylist = keydefs.get(eventname)
- if not keylist:
+ # issue10940: temporary workaround to prevent hang with OS X Cocoa Tk 8.5
+ # if not keylist:
+ if (not keylist) or (macosxSupport.runningAsOSXApp() and eventname in {
+ "<<open-module>>",
+ "<<goto-line>>",
+ "<<change-indentwidth>>"}):
return ""
s = keylist[0]
s = re.sub(r"-[a-z]\b", lambda m: m.group().upper(), s)
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 6a031e1496..deeb4a6a84 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -12,7 +12,7 @@ What's New in IDLE 3.1.4?
What's New in IDLE 3.1b1?
=========================
-*Release date: XX-XXX-09*
+*Release date: 27-Jun-09*
- Use of 'filter' in keybindingDialog.py was causing custom key assignment to
fail. Patch 5707 amaury.forgeotdarc.
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 0fa3d765aa..06c8bba4d6 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
import os
import os.path
@@ -55,20 +55,21 @@ except ImportError:
else:
def idle_showwarning(message, category, filename, lineno,
file=None, line=None):
- file = warning_stream
+ if file is None:
+ file = warning_stream
try:
- file.write(warnings.formatwarning(message, category, filename,\
+ file.write(warnings.formatwarning(message, category, filename,
lineno, file=file, line=line))
except IOError:
pass ## file (probably __stderr__) is invalid, warning dropped.
warnings.showwarning = idle_showwarning
- def idle_formatwarning(message, category, filename, lineno,
- file=None, line=None):
+ def idle_formatwarning(message, category, filename, lineno, line=None):
"""Format warnings the IDLE way"""
s = "\nWarning (from warnings module):\n"
s += ' File \"%s\", line %s\n' % (filename, lineno)
- line = linecache.getline(filename, lineno).strip() \
- if line is None else line
+ if line is None:
+ line = linecache.getline(filename, lineno)
+ line = line.strip()
if line:
s += " %s\n" % line
s += "%s: %s\n>>> " % (category.__name__, message)
@@ -81,18 +82,17 @@ def extended_linecache_checkcache(filename=None,
Rather than repeating the linecache code, patch it to save the
<pyshell#...> entries, call the original linecache.checkcache()
- (which destroys them), and then restore the saved entries.
+ (skipping them), and then restore the saved entries.
orig_checkcache is bound at definition time to the original
method, allowing it to be patched.
-
"""
cache = linecache.cache
save = {}
- for filename in cache:
- if filename[:1] + filename[-1:] == '<>':
- save[filename] = cache[filename]
- orig_checkcache()
+ for key in list(cache):
+ if key[:1] + key[-1:] == '<>':
+ save[key] = cache.pop(key)
+ orig_checkcache(filename)
cache.update(save)
# Patch linecache.checkcache():
@@ -1417,6 +1417,13 @@ def main():
shell.interp.prepend_syspath(script)
shell.interp.execfile(script)
+ # Check for problematic OS X Tk versions and print a warning message
+ # in the IDLE shell window; this is less intrusive than always opening
+ # a separate window.
+ tkversionwarning = macosxSupport.tkVersionWarning(root)
+ if tkversionwarning:
+ shell.interp.runcommand(''.join(("print('", tkversionwarning, "')")))
+
root.mainloop()
root.destroy()
diff --git a/Lib/idlelib/idlever.py b/Lib/idlelib/idlever.py
index 8ee61a2cd3..5b0907e1e1 100644
--- a/Lib/idlelib/idlever.py
+++ b/Lib/idlelib/idlever.py
@@ -1 +1 @@
-IDLE_VERSION = "3.1.3"
+IDLE_VERSION = "3.2"
diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosxSupport.py
index da519f7a0f..f93ef118db 100644
--- a/Lib/idlelib/macosxSupport.py
+++ b/Lib/idlelib/macosxSupport.py
@@ -4,6 +4,10 @@ GUI application (as opposed to an X11 application).
"""
import sys
import tkinter
+from os import path
+
+
+_appbundle = None
def runningAsOSXApp():
"""
@@ -11,7 +15,41 @@ def runningAsOSXApp():
If so, assume that Python was built with Aqua Tcl/Tk rather than
X11 Tcl/Tk.
"""
- return (sys.platform == 'darwin' and '.app' in sys.executable)
+ global _appbundle
+ if _appbundle is None:
+ _appbundle = (sys.platform == 'darwin' and '.app' in sys.executable)
+ return _appbundle
+
+_carbonaquatk = None
+
+def isCarbonAquaTk(root):
+ """
+ Returns True if IDLE is using a Carbon Aqua Tk (instead of the
+ newer Cocoa Aqua Tk).
+ """
+ global _carbonaquatk
+ if _carbonaquatk is None:
+ _carbonaquatk = (runningAsOSXApp() and
+ 'aqua' in root.tk.call('tk', 'windowingsystem') and
+ 'AppKit' not in root.tk.call('winfo', 'server', '.'))
+ return _carbonaquatk
+
+def tkVersionWarning(root):
+ """
+ Returns a string warning message if the Tk version in use appears to
+ be one known to cause problems with IDLE. The Apple Cocoa-based Tk 8.5
+ that was shipped with Mac OS X 10.6.
+ """
+
+ if (runningAsOSXApp() and
+ ('AppKit' in root.tk.call('winfo', 'server', '.')) and
+ (root.tk.call('info', 'patchlevel') == '8.5.7') ):
+ return (r"WARNING: The version of Tcl/Tk (8.5.7) in use may"
+ r" be unstable.\n"
+ r"Visit http://www.python.org/download/mac/tcltk/"
+ r" for current information.")
+ else:
+ return False
def addOpenEventSupport(root, flist):
"""
@@ -73,9 +111,6 @@ def overrideRootMenu(root, flist):
WindowList.add_windows_to_menu(menu)
WindowList.register_callback(postwindowsmenu)
- menudict['application'] = menu = Menu(menubar, name='apple')
- menubar.add_cascade(label='IDLE', menu=menu)
-
def about_dialog(event=None):
from idlelib import aboutDialog
aboutDialog.AboutDialog(root, 'About IDLE')
@@ -91,9 +126,14 @@ def overrideRootMenu(root, flist):
root.instance_dict = flist.inversedict
configDialog.ConfigDialog(root, 'Settings')
+ def help_dialog(event=None):
+ from idlelib import textView
+ fn = path.join(path.abspath(path.dirname(__file__)), 'help.txt')
+ textView.view_file(root, 'Help', fn)
root.bind('<<about-idle>>', about_dialog)
root.bind('<<open-config-dialog>>', config_dialog)
+ root.createcommand('::tk::mac::ShowPreferences', config_dialog)
if flist:
root.bind('<<close-all-windows>>', flist.close_all_callback)
@@ -102,35 +142,29 @@ def overrideRootMenu(root, flist):
# right thing for now.
root.createcommand('exit', flist.close_all_callback)
-
- ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding
- tkversion = root.tk.eval('info patchlevel')
- # Note: we cannot check if the string tkversion >= '8.4.14', because
- # the string '8.4.7' is greater than the string '8.4.14'.
- if tuple(map(int, tkversion.split('.'))) >= (8, 4, 14):
- Bindings.menudefs[0] = ('application', [
+ if isCarbonAquaTk(root):
+ # for Carbon AquaTk, replace the default Tk apple menu
+ menudict['application'] = menu = Menu(menubar, name='apple')
+ menubar.add_cascade(label='IDLE', menu=menu)
+ Bindings.menudefs.insert(0,
+ ('application', [
('About IDLE', '<<about-idle>>'),
- None,
- ])
- root.createcommand('::tk::mac::ShowPreferences', config_dialog)
+ None,
+ ]))
+ tkversion = root.tk.eval('info patchlevel')
+ if tuple(map(int, tkversion.split('.'))) < (8, 4, 14):
+ # for earlier AquaTk versions, supply a Preferences menu item
+ Bindings.menudefs[0][1].append(
+ ('_Preferences....', '<<open-config-dialog>>'),
+ )
else:
- for mname, entrylist in Bindings.menudefs:
- menu = menudict.get(mname)
- if not menu:
- continue
- else:
- for entry in entrylist:
- if not entry:
- menu.add_separator()
- else:
- label, eventname = entry
- underline, label = prepstr(label)
- accelerator = get_accelerator(Bindings.default_keydefs,
- eventname)
- def command(text=root, eventname=eventname):
- text.event_generate(eventname)
- menu.add_command(label=label, underline=underline,
- command=command, accelerator=accelerator)
+ # assume Cocoa AquaTk
+ # replace default About dialog with About IDLE one
+ root.createcommand('tkAboutDialog', about_dialog)
+ # replace default "Help" item in Help menu
+ root.createcommand('::tk::mac::ShowHelp', help_dialog)
+ # remove redundant "IDLE Help" from menu
+ del Bindings.menudefs[-1][1][0]
def setupApp(root, flist):
"""
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index fd2cc09042..25338ffaa6 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -25,12 +25,13 @@ except ImportError:
pass
else:
def idle_formatwarning_subproc(message, category, filename, lineno,
- file=None, line=None):
+ line=None):
"""Format warnings the IDLE way"""
s = "\nWarning (from warnings module):\n"
s += ' File \"%s\", line %s\n' % (filename, lineno)
- line = linecache.getline(filename, lineno).strip() \
- if line is None else line
+ if line is None:
+ line = linecache.getline(filename, lineno)
+ line = line.strip()
if line:
s += " %s\n" % line
s += "%s: %s\n" % (category.__name__, message)
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index fc1e20a27d..1022e77c4f 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -24,6 +24,12 @@ __version__ = "2.58"
import binascii, errno, random, re, socket, subprocess, sys, time
+try:
+ import ssl
+ HAVE_SSL = True
+except ImportError:
+ HAVE_SSL = False
+
__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple",
"Int2AP", "ParseFlags", "Time2Internaldate"]
@@ -71,6 +77,7 @@ Commands = {
'SETANNOTATION':('AUTH', 'SELECTED'),
'SETQUOTA': ('AUTH', 'SELECTED'),
'SORT': ('SELECTED',),
+ 'STARTTLS': ('NONAUTH',),
'STATUS': ('AUTH', 'SELECTED'),
'STORE': ('SELECTED',),
'SUBSCRIBE': ('AUTH', 'SELECTED'),
@@ -156,11 +163,23 @@ class IMAP4:
self.continuation_response = '' # Last continuation response
self.is_readonly = False # READ-ONLY desired state
self.tagnum = 0
+ self._tls_established = False
# Open socket to server.
self.open(host, port)
+ try:
+ self._connect()
+ except Exception:
+ try:
+ self.shutdown()
+ except socket.error:
+ pass
+ raise
+
+
+ def _connect(self):
# Create unique tag for this session,
# and compile tagged response matcher.
@@ -188,13 +207,7 @@ class IMAP4:
else:
raise self.error(self.welcome)
- typ, dat = self.capability()
- if dat == [None]:
- raise self.error('no CAPABILITY response from server')
- dat = str(dat[-1], "ASCII")
- dat = dat.upper()
- self.capabilities = tuple(dat.split())
-
+ self._get_capabilities()
if __debug__:
if self.debug >= 3:
self._mesg('CAPABILITIES: %r' % (self.capabilities,))
@@ -711,6 +724,30 @@ class IMAP4:
return self._untagged_response(typ, dat, name)
+ def starttls(self, ssl_context=None):
+ name = 'STARTTLS'
+ if not HAVE_SSL:
+ raise self.error('SSL support missing')
+ if self._tls_established:
+ raise self.abort('TLS session already established')
+ if name not in self.capabilities:
+ raise self.abort('TLS not supported by server')
+ # Generate a default SSL context if none was passed.
+ if ssl_context is None:
+ ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ # SSLv2 considered harmful.
+ ssl_context.options |= ssl.OP_NO_SSLv2
+ typ, dat = self._simple_command(name)
+ if typ == 'OK':
+ self.sock = ssl_context.wrap_socket(self.sock)
+ self.file = self.sock.makefile('rb')
+ self._tls_established = True
+ self._get_capabilities()
+ else:
+ raise self.error("Couldn't establish TLS session")
+ return self._untagged_response(typ, dat, name)
+
+
def status(self, mailbox, names):
"""Request named status conditions for mailbox.
@@ -921,6 +958,15 @@ class IMAP4:
return typ, data
+ def _get_capabilities(self):
+ typ, dat = self.capability()
+ if dat == [None]:
+ raise self.error('no CAPABILITY response from server')
+ dat = str(dat[-1], "ASCII")
+ dat = dat.upper()
+ self.capabilities = tuple(dat.split())
+
+
def _get_response(self):
# Read response and store.
@@ -1125,12 +1171,8 @@ class IMAP4:
n -= 1
+if HAVE_SSL:
-try:
- import ssl
-except ImportError:
- pass
-else:
class IMAP4_SSL(IMAP4):
"""IMAP4 client class over SSL connection
@@ -1270,9 +1312,10 @@ Mon2num = {b'Jan': 1, b'Feb': 2, b'Mar': 3, b'Apr': 4, b'May': 5, b'Jun': 6,
b'Jul': 7, b'Aug': 8, b'Sep': 9, b'Oct': 10, b'Nov': 11, b'Dec': 12}
def Internaldate2tuple(resp):
- """Convert IMAP4 INTERNALDATE to UT.
+ """Parse an IMAP4 INTERNALDATE string.
- Returns Python time module tuple.
+ Return corresponding local time. The return value is a
+ time.struct_time tuple or None if the string has wrong format.
"""
mo = InternalDate.match(resp)
@@ -1339,9 +1382,14 @@ def ParseFlags(resp):
def Time2Internaldate(date_time):
- """Convert 'date_time' to IMAP4 INTERNALDATE representation.
+ """Convert date_time to IMAP4 INTERNALDATE representation.
- Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'
+ Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'. The
+ date_time argument can be a number (int or float) represening
+ seconds since epoch (as returned by time.time()), a 9-tuple
+ representing local time (as returned by time.localtime()), or a
+ double-quoted string. In the last case, it is assumed to already
+ be in the correct format.
"""
if isinstance(date_time, (int, float)):
diff --git a/Lib/importlib/__init__.py b/Lib/importlib/__init__.py
index 37577ff41d..2baaf93732 100644
--- a/Lib/importlib/__init__.py
+++ b/Lib/importlib/__init__.py
@@ -36,7 +36,7 @@ def _case_ok(directory, check):
"""
if 'PYTHONCASEOK' in os.environ:
return True
- elif check in os.listdir(directory):
+ elif check in os.listdir(directory if directory else os.getcwd()):
return True
return False
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 6f60843d36..425b8bf8c7 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -22,7 +22,7 @@ work. One should use importlib as the public-facing version of this module.
def _path_join(*args):
"""Replacement for os.path.join."""
return path_sep.join(x[:-len(path_sep)] if x.endswith(path_sep) else x
- for x in args)
+ for x in args if x)
def _path_exists(path):
@@ -53,6 +53,8 @@ def _path_isfile(path):
# XXX Could also expose Modules/getpath.c:isdir()
def _path_isdir(path):
"""Replacement for os.path.isdir."""
+ if not path:
+ path = _os.getcwd()
return _path_is_mode_type(path, 0o040000)
@@ -78,20 +80,6 @@ def _path_absolute(path):
return _path_join(_os.getcwd(), path)
-class _closing:
-
- """Simple replacement for contextlib.closing."""
-
- def __init__(self, obj):
- self.obj = obj
-
- def __enter__(self):
- return self.obj
-
- def __exit__(self, *args):
- self.obj.close()
-
-
def _wrap(new, old):
"""Simple substitute for functools.wraps."""
for replace in ['__module__', '__name__', '__doc__']:
@@ -99,6 +87,8 @@ def _wrap(new, old):
new.__dict__.update(old.__dict__)
+code_type = type(_wrap.__code__)
+
# Finder/loader utility code ##################################################
def set_package(fxn):
@@ -138,7 +128,7 @@ def module_for_loader(fxn):
the second argument.
"""
- def decorated(self, fullname):
+ def decorated(self, fullname, *args, **kwargs):
module = sys.modules.get(fullname)
is_reload = bool(module)
if not is_reload:
@@ -148,7 +138,7 @@ def module_for_loader(fxn):
module = imp.new_module(fullname)
sys.modules[fullname] = module
try:
- return fxn(self, module)
+ return fxn(self, module, *args, **kwargs)
except:
if not is_reload:
del sys.modules[fullname]
@@ -301,242 +291,238 @@ class FrozenImporter:
return imp.is_frozen_package(fullname)
-class PyLoader:
+class _LoaderBasics:
- """Loader base class for Python source code.
+ """Base class of common code needed by both SourceLoader and
+ _SourcelessFileLoader."""
- Subclasses need to implement the methods:
+ def is_package(self, fullname):
+ """Concrete implementation of InspectLoader.is_package by checking if
+ the path returned by get_filename has a filename of '__init__.py'."""
+ filename = self.get_filename(fullname).rpartition(path_sep)[2]
+ return filename.rsplit('.', 1)[0] == '__init__'
- - source_path
- - get_data
- - is_package
+ def _bytes_from_bytecode(self, fullname, data, source_mtime):
+ """Return the marshalled bytes from bytecode, verifying the magic
+ number and timestamp along the way.
- """
+ If source_mtime is None then skip the timestamp check.
- @module_for_loader
- def load_module(self, module):
- """Load a source module."""
- return self._load_module(module)
+ """
+ magic = data[:4]
+ raw_timestamp = data[4:8]
+ if len(magic) != 4 or magic != imp.get_magic():
+ raise ImportError("bad magic number in {}".format(fullname))
+ elif len(raw_timestamp) != 4:
+ raise EOFError("bad timestamp in {}".format(fullname))
+ elif source_mtime is not None:
+ if marshal._r_long(raw_timestamp) != source_mtime:
+ raise ImportError("bytecode is stale for {}".format(fullname))
+ # Can't return the code object as errors from marshal loading need to
+ # propagate even when source is available.
+ return data[8:]
- def _load_module(self, module):
- """Initialize a module from source."""
+ @module_for_loader
+ def _load_module(self, module, *, sourceless=False):
+ """Helper for load_module able to handle either source or sourceless
+ loading."""
name = module.__name__
- code_object = self.get_code(module.__name__)
- # __file__ may have been set by the caller, e.g. bytecode path.
- if not hasattr(module, '__file__'):
- module.__file__ = self.source_path(name)
+ code_object = self.get_code(name)
+ module.__file__ = self.get_filename(name)
+ if not sourceless:
+ module.__cached__ = imp.cache_from_source(module.__file__)
+ else:
+ module.__cached__ = module.__file__
+ module.__package__ = name
if self.is_package(name):
- module.__path__ = [module.__file__.rsplit(path_sep, 1)[0]]
- module.__package__ = module.__name__
- if not hasattr(module, '__path__'):
+ module.__path__ = [module.__file__.rsplit(path_sep, 1)[0]]
+ else:
module.__package__ = module.__package__.rpartition('.')[0]
module.__loader__ = self
exec(code_object, module.__dict__)
return module
- def get_code(self, fullname):
- """Get a code object from source."""
- source_path = self.source_path(fullname)
- if source_path is None:
- message = "a source path must exist to load {0}".format(fullname)
- raise ImportError(message)
- source = self.get_data(source_path)
- # Convert to universal newlines.
- line_endings = b'\n'
- for index, c in enumerate(source):
- if c == ord(b'\n'):
- break
- elif c == ord(b'\r'):
- line_endings = b'\r'
- try:
- if source[index+1] == ord(b'\n'):
- line_endings += b'\n'
- except IndexError:
- pass
- break
- if line_endings != b'\n':
- source = source.replace(line_endings, b'\n')
- return compile(source, source_path, 'exec', dont_inherit=True)
- # Never use in implementing import! Imports code within the method.
- def get_source(self, fullname):
- """Return the source code for a module.
+class SourceLoader(_LoaderBasics):
- self.source_path() and self.get_data() are used to implement this
- method.
+ def path_mtime(self, path):
+ """Optional method that returns the modification time (an int) for the
+ specified path, where path is a str.
- """
- path = self.source_path(fullname)
- if path is None:
- return None
- try:
- source_bytes = self.get_data(path)
- except IOError:
- return ImportError("source not available through get_data()")
- import io
- import tokenize
- encoding = tokenize.detect_encoding(io.BytesIO(source_bytes).readline)
- return source_bytes.decode(encoding[0])
+ Implementing this method allows the loader to read bytecode files.
+ """
+ raise NotImplementedError
-class PyPycLoader(PyLoader):
+ def set_data(self, path, data):
+ """Optional method which writes data (bytes) to a file path (a str).
- """Loader base class for Python source and bytecode.
+ Implementing this method allows for the writing of bytecode files.
- Requires implementing the methods needed for PyLoader as well as
- source_mtime, bytecode_path, and write_bytecode.
+ """
+ raise NotImplementedError
- """
- @module_for_loader
- def load_module(self, module):
- """Load a module from source or bytecode."""
- name = module.__name__
- source_path = self.source_path(name)
- bytecode_path = self.bytecode_path(name)
- # get_code can worry about no viable paths existing.
- module.__file__ = source_path or bytecode_path
- return self._load_module(module)
+ def get_source(self, fullname):
+ """Concrete implementation of InspectLoader.get_source."""
+ import tokenize
+ path = self.get_filename(fullname)
+ try:
+ source_bytes = self.get_data(path)
+ except IOError:
+ raise ImportError("source not available through get_data()")
+ encoding = tokenize.detect_encoding(_io.BytesIO(source_bytes).readline)
+ newline_decoder = _io.IncrementalNewlineDecoder(None, True)
+ return newline_decoder.decode(source_bytes.decode(encoding[0]))
def get_code(self, fullname):
- """Get a code object from source or bytecode."""
- # XXX Care enough to make sure this call does not happen if the magic
- # number is bad?
- source_timestamp = self.source_mtime(fullname)
- # Try to use bytecode if it is available.
- bytecode_path = self.bytecode_path(fullname)
- if bytecode_path:
- data = self.get_data(bytecode_path)
+ """Concrete implementation of InspectLoader.get_code.
+
+ Reading of bytecode requires path_mtime to be implemented. To write
+ bytecode, set_data must also be implemented.
+
+ """
+ source_path = self.get_filename(fullname)
+ bytecode_path = imp.cache_from_source(source_path)
+ source_mtime = None
+ if bytecode_path is not None:
try:
- magic = data[:4]
- if len(magic) < 4:
- raise ImportError("bad magic number in {}".format(fullname))
- raw_timestamp = data[4:8]
- if len(raw_timestamp) < 4:
- raise EOFError("bad timestamp in {}".format(fullname))
- pyc_timestamp = marshal._r_long(raw_timestamp)
- bytecode = data[8:]
- # Verify that the magic number is valid.
- if imp.get_magic() != magic:
- raise ImportError("bad magic number in {}".format(fullname))
- # Verify that the bytecode is not stale (only matters when
- # there is source to fall back on.
- if source_timestamp:
- if pyc_timestamp < source_timestamp:
- raise ImportError("bytecode is stale")
- except (ImportError, EOFError):
- # If source is available give it a shot.
- if source_timestamp is not None:
+ source_mtime = self.path_mtime(source_path)
+ except NotImplementedError:
+ pass
+ else:
+ try:
+ data = self.get_data(bytecode_path)
+ except IOError:
pass
else:
- raise
- else:
- # Bytecode seems fine, so try to use it.
- # XXX If the bytecode is ill-formed, would it be beneficial to
- # try for using source if available and issue a warning?
- return marshal.loads(bytecode)
- elif source_timestamp is None:
- raise ImportError("no source or bytecode available to create code "
- "object for {0!r}".format(fullname))
- # Use the source.
- code_object = super().get_code(fullname)
- # Generate bytecode and write it out.
- if not sys.dont_write_bytecode:
+ try:
+ bytes_data = self._bytes_from_bytecode(fullname, data,
+ source_mtime)
+ except (ImportError, EOFError):
+ pass
+ else:
+ found = marshal.loads(bytes_data)
+ if isinstance(found, code_type):
+ return found
+ else:
+ msg = "Non-code object in {}"
+ raise ImportError(msg.format(bytecode_path))
+ source_bytes = self.get_data(source_path)
+ code_object = compile(source_bytes, source_path, 'exec',
+ dont_inherit=True)
+ if (not sys.dont_write_bytecode and bytecode_path is not None and
+ source_mtime is not None):
+ # If e.g. Jython ever implements imp.cache_from_source to have
+ # their own cached file format, this block of code will most likely
+ # throw an exception.
data = bytearray(imp.get_magic())
- data.extend(marshal._w_long(source_timestamp))
+ data.extend(marshal._w_long(source_mtime))
data.extend(marshal.dumps(code_object))
- self.write_bytecode(fullname, data)
+ try:
+ self.set_data(bytecode_path, data)
+ except NotImplementedError:
+ pass
return code_object
+ def load_module(self, fullname):
+ """Concrete implementation of Loader.load_module.
-class _PyFileLoader(PyLoader):
+ Requires ExecutionLoader.get_filename and ResourceLoader.get_data to be
+ implemented to load source code. Use of bytecode is dictated by whether
+ get_code uses/writes bytecode.
- """Load a Python source file."""
+ """
+ return self._load_module(fullname)
- def __init__(self, name, path, is_pkg):
- self._name = name
- self._is_pkg = is_pkg
- # Figure out the base path based on whether it was source or bytecode
- # that was found.
- try:
- self._base_path = _path_without_ext(path, imp.PY_SOURCE)
- except ValueError:
- self._base_path = _path_without_ext(path, imp.PY_COMPILED)
-
- def _find_path(self, ext_type):
- """Find a path from the base path and the specified extension type that
- exists, returning None if one is not found."""
- for suffix in _suffix_list(ext_type):
- path = self._base_path + suffix
- if _path_exists(path):
- return path
- else:
- return None
+
+class _FileLoader:
+
+ """Base file loader class which implements the loader protocol methods that
+ require file system usage."""
+
+ def __init__(self, fullname, path):
+ """Cache the module name and the path to the file found by the
+ finder."""
+ self._name = fullname
+ self._path = path
@_check_name
- def source_path(self, fullname):
- """Return the path to an existing source file for the module, or None
- if one cannot be found."""
- # Not a property so that it is easy to override.
- return self._find_path(imp.PY_SOURCE)
+ def get_filename(self, fullname):
+ """Return the path to the source file as found by the finder."""
+ return self._path
def get_data(self, path):
"""Return the data from path as raw bytes."""
- return _io.FileIO(path, 'r').read() # Assuming bytes.
+ with _io.FileIO(path, 'r') as file:
+ return file.read()
- @_check_name
- def is_package(self, fullname):
- """Return a boolean based on whether the module is a package.
- Raises ImportError (like get_source) if the loader cannot handle the
- package.
+class _SourceFileLoader(_FileLoader, SourceLoader):
- """
- return self._is_pkg
+ """Concrete implementation of SourceLoader using the file system."""
+ def path_mtime(self, path):
+ """Return the modification time for the path."""
+ return int(_os.stat(path).st_mtime)
-class _PyPycFileLoader(PyPycLoader, _PyFileLoader):
+ def set_data(self, path, data):
+ """Write bytes data to a file."""
+ parent, _, filename = path.rpartition(path_sep)
+ path_parts = []
+ # Figure out what directories are missing.
+ while parent and not _path_isdir(parent):
+ parent, _, part = parent.rpartition(path_sep)
+ path_parts.append(part)
+ # Create needed directories.
+ for part in reversed(path_parts):
+ parent = _path_join(parent, part)
+ try:
+ _os.mkdir(parent)
+ except OSError as exc:
+ # Probably another Python process already created the dir.
+ if exc.errno == errno.EEXIST:
+ continue
+ else:
+ raise
+ except IOError as exc:
+ # If can't get proper access, then just forget about writing
+ # the data.
+ if exc.errno == errno.EACCES:
+ return
+ else:
+ raise
+ try:
+ with _io.FileIO(path, 'wb') as file:
+ file.write(data)
+ except IOError as exc:
+ # Don't worry if you can't write bytecode.
+ if exc.errno == errno.EACCES:
+ return
+ else:
+ raise
- """Load a module from a source or bytecode file."""
- @_check_name
- def source_mtime(self, name):
- """Return the modification time of the source for the specified
- module."""
- source_path = self.source_path(name)
- if not source_path:
- return None
- return int(_os.stat(source_path).st_mtime)
+class _SourcelessFileLoader(_FileLoader, _LoaderBasics):
- @_check_name
- def bytecode_path(self, fullname):
- """Return the path to a bytecode file, or None if one does not
- exist."""
- # Not a property for easy overriding.
- return self._find_path(imp.PY_COMPILED)
+ """Loader which handles sourceless file imports."""
- @_check_name
- def write_bytecode(self, name, data):
- """Write out 'data' for the specified module, returning a boolean
- signifying if the write-out actually occurred.
+ def load_module(self, fullname):
+ return self._load_module(fullname, sourceless=True)
- Raises ImportError (just like get_source) if the specified module
- cannot be handled by the loader.
+ def get_code(self, fullname):
+ path = self.get_filename(fullname)
+ data = self.get_data(path)
+ bytes_data = self._bytes_from_bytecode(fullname, data, None)
+ found = marshal.loads(bytes_data)
+ if isinstance(found, code_type):
+ return found
+ else:
+ raise ImportError("Non-code object in {}".format(path))
- """
- bytecode_path = self.bytecode_path(name)
- if not bytecode_path:
- bytecode_path = self._base_path + _suffix_list(imp.PY_COMPILED)[0]
- try:
- # Assuming bytes.
- with _closing(_io.FileIO(bytecode_path, 'w')) as bytecode_file:
- bytecode_file.write(data)
- return True
- except IOError as exc:
- if exc.errno == errno.EACCES:
- return False
- else:
- raise
+ def get_source(self, fullname):
+ """Return None as there is no source code."""
+ return None
class _ExtensionFileLoader:
@@ -547,7 +533,7 @@ class _ExtensionFileLoader:
"""
- def __init__(self, name, path, is_pkg):
+ def __init__(self, name, path):
"""Initialize the loader.
If is_pkg is True then an exception is raised as extension modules
@@ -556,8 +542,6 @@ class _ExtensionFileLoader:
"""
self._name = name
self._path = path
- if is_pkg:
- raise ValueError("extension modules cannot be packages")
@_check_name
@set_package
@@ -655,147 +639,88 @@ class PathFinder:
return None
-class _ChainedFinder:
-
- """Finder that sequentially calls other finders."""
-
- def __init__(self, *finders):
- self._finders = finders
-
- def find_module(self, fullname, path=None):
- for finder in self._finders:
- result = finder.find_module(fullname, path)
- if result:
- return result
- else:
- return None
-
-
class _FileFinder:
- """Base class for file finders.
-
- Subclasses are expected to define the following attributes:
-
- * _suffixes
- Sequence of file suffixes whose order will be followed.
-
- * _possible_package
- True if importer should check for packages.
+ """File-based finder.
- * _loader
- A callable that takes the module name, a file path, and whether
- the path points to a package and returns a loader for the module
- found at that path.
+ Constructor takes a list of objects detailing what file extensions their
+ loader supports along with whether it can be used for a package.
"""
- def __init__(self, path_entry):
- """Initialize an importer for the passed-in sys.path entry (which is
- assumed to have already been verified as an existing directory).
-
- Can be used as an entry on sys.path_hook.
-
- """
- absolute_path = _path_absolute(path_entry)
- if not _path_isdir(absolute_path):
- raise ImportError("only directories are supported")
- self._path_entry = absolute_path
-
- def find_module(self, fullname, path=None):
+ def __init__(self, path, *details):
+ """Initialize with finder details."""
+ packages = []
+ modules = []
+ for detail in details:
+ modules.extend((suffix, detail.loader) for suffix in detail.suffixes)
+ if detail.supports_packages:
+ packages.extend((suffix, detail.loader)
+ for suffix in detail.suffixes)
+ self.packages = packages
+ self.modules = modules
+ self.path = path
+
+ def find_module(self, fullname):
+ """Try to find a loader for the specified module."""
tail_module = fullname.rpartition('.')[2]
- package_directory = None
- if self._possible_package:
- for ext in self._suffixes:
- package_directory = _path_join(self._path_entry, tail_module)
- init_filename = '__init__' + ext
- package_init = _path_join(package_directory, init_filename)
- if (_path_isfile(package_init) and
- _case_ok(self._path_entry, tail_module) and
- _case_ok(package_directory, init_filename)):
- return self._loader(fullname, package_init, True)
- for ext in self._suffixes:
- file_name = tail_module + ext
- file_path = _path_join(self._path_entry, file_name)
- if (_path_isfile(file_path) and
- _case_ok(self._path_entry, file_name)):
- return self._loader(fullname, file_path, False)
- else:
- # Raise a warning if it matches a directory w/o an __init__ file.
- if (package_directory is not None and
- _path_isdir(package_directory) and
- _case_ok(self._path_entry, tail_module)):
- _warnings.warn("Not importing directory %s: missing __init__"
- % package_directory, ImportWarning)
- return None
-
-
-class _PyFileFinder(_FileFinder):
-
- """Importer for source/bytecode files."""
-
- _possible_package = True
- _loader = _PyFileLoader
-
- def __init__(self, path_entry):
- # Lack of imp during class creation means _suffixes is set here.
- # Make sure that Python source files are listed first! Needed for an
- # optimization by the loader.
- self._suffixes = _suffix_list(imp.PY_SOURCE)
- super().__init__(path_entry)
-
-
-class _PyPycFileFinder(_PyFileFinder):
+ base_path = _path_join(self.path, tail_module)
+ if _path_isdir(base_path) and _case_ok(self.path, tail_module):
+ for suffix, loader in self.packages:
+ init_filename = '__init__' + suffix
+ full_path = _path_join(base_path, init_filename)
+ if (_path_isfile(full_path) and
+ _case_ok(base_path, init_filename)):
+ return loader(fullname, full_path)
+ else:
+ msg = "Not importing directory {}: missing __init__"
+ _warnings.warn(msg.format(base_path), ImportWarning)
+ for suffix, loader in self.modules:
+ mod_filename = tail_module + suffix
+ full_path = _path_join(self.path, mod_filename)
+ if _path_isfile(full_path) and _case_ok(self.path, mod_filename):
+ return loader(fullname, full_path)
+ return None
- """Finder for source and bytecode files."""
+class _SourceFinderDetails:
- _loader = _PyPycFileLoader
+ loader = _SourceFileLoader
+ supports_packages = True
- def __init__(self, path_entry):
- super().__init__(path_entry)
- self._suffixes += _suffix_list(imp.PY_COMPILED)
+ def __init__(self):
+ self.suffixes = _suffix_list(imp.PY_SOURCE)
+class _SourcelessFinderDetails:
+ loader = _SourcelessFileLoader
+ supports_packages = True
+ def __init__(self):
+ self.suffixes = _suffix_list(imp.PY_COMPILED)
-class _ExtensionFileFinder(_FileFinder):
- """Importer for extension files."""
+class _ExtensionFinderDetails:
- _possible_package = False
- _loader = _ExtensionFileLoader
+ loader = _ExtensionFileLoader
+ supports_packages = False
- def __init__(self, path_entry):
- # Assigning to _suffixes here instead of at the class level because
- # imp is not imported at the time of class creation.
- self._suffixes = _suffix_list(imp.C_EXTENSION)
- super().__init__(path_entry)
+ def __init__(self):
+ self.suffixes = _suffix_list(imp.C_EXTENSION)
# Import itself ###############################################################
-def _chained_path_hook(*path_hooks):
- """Create a closure which sequentially checks path hooks to see which ones
- (if any) can work with a path."""
- def path_hook(entry):
- """Check to see if 'entry' matches any of the enclosed path hooks."""
- finders = []
- for hook in path_hooks:
- try:
- finder = hook(entry)
- except ImportError:
- continue
- else:
- finders.append(finder)
- if not finders:
- raise ImportError("no finder found")
- else:
- return _ChainedFinder(*finders)
-
- return path_hook
+def _file_path_hook(path):
+ """If the path is a directory, return a file-based finder."""
+ if _path_isdir(path):
+ return _FileFinder(path, _ExtensionFinderDetails(),
+ _SourceFinderDetails(),
+ _SourcelessFinderDetails())
+ else:
+ raise ImportError("only directories are supported")
-_DEFAULT_PATH_HOOK = _chained_path_hook(_ExtensionFileFinder, _PyPycFileFinder)
+_DEFAULT_PATH_HOOK = _file_path_hook
class _DefaultPathFinder(PathFinder):
@@ -833,6 +758,8 @@ class _ImportLockContext:
_IMPLICIT_META_PATH = [BuiltinImporter, FrozenImporter, _DefaultPathFinder]
+_ERR_MSG = 'No module named {}'
+
def _gcd_import(name, package=None, level=0):
"""Import and return the module based on its name, the package the call is
being made from, and the level adjustment.
@@ -880,7 +807,11 @@ def _gcd_import(name, package=None, level=0):
_gcd_import(parent)
# Backwards-compatibility; be nicer to skip the dict lookup.
parent_module = sys.modules[parent]
- path = parent_module.__path__
+ try:
+ path = parent_module.__path__
+ except AttributeError:
+ msg = (_ERR_MSG + '; {} is not a package').format(name, parent)
+ raise ImportError(msg)
meta_path = sys.meta_path + _IMPLICIT_META_PATH
for finder in meta_path:
loader = finder.find_module(name, path)
@@ -888,7 +819,7 @@ def _gcd_import(name, package=None, level=0):
loader.load_module(name)
break
else:
- raise ImportError("No module named {0}".format(name))
+ raise ImportError(_ERR_MSG.format(name))
# Backwards-compatibility; be nicer to skip the dict lookup.
module = sys.modules[name]
if parent:
@@ -918,13 +849,15 @@ def __import__(name, globals={}, locals={}, fromlist=[], level=0):
import (e.g. ``from ..pkg import mod`` would have a 'level' of 2).
"""
+ if not hasattr(name, 'rpartition'):
+ raise TypeError("module name must be str, not {}".format(type(name)))
if level == 0:
module = _gcd_import(name)
else:
- # __package__ is not guaranteed to be defined.
- try:
- package = globals['__package__']
- except KeyError:
+ # __package__ is not guaranteed to be defined or could be set to None
+ # to represent that it's proper value is unknown
+ package = globals.get('__package__')
+ if package is None:
package = globals['__name__']
if '__path__' not in globals:
package = package.rpartition('.')[0]
@@ -944,6 +877,7 @@ def __import__(name, globals={}, locals={}, fromlist=[], level=0):
# If a package was imported, try to import stuff from fromlist.
if hasattr(module, '__path__'):
if '*' in fromlist and hasattr(module, '__all__'):
+ fromlist = list(fromlist)
fromlist.remove('*')
fromlist.extend(module.__all__)
for x in (y for y in fromlist if not hasattr(module,y)):
diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py
index 7b89d0b4c9..fa343f85a4 100644
--- a/Lib/importlib/abc.py
+++ b/Lib/importlib/abc.py
@@ -1,8 +1,16 @@
"""Abstract base classes related to import."""
from . import _bootstrap
from . import machinery
+from . import util
import abc
+import imp
+import io
+import marshal
+import os.path
+import sys
+import tokenize
import types
+import warnings
class Loader(metaclass=abc.ABCMeta):
@@ -10,8 +18,9 @@ class Loader(metaclass=abc.ABCMeta):
"""Abstract base class for import loaders."""
@abc.abstractmethod
- def load_module(self, fullname:str) -> types.ModuleType:
- """Abstract method which when implemented should load a module."""
+ def load_module(self, fullname):
+ """Abstract method which when implemented should load a module.
+ The fullname is a str."""
raise NotImplementedError
@@ -20,8 +29,11 @@ class Finder(metaclass=abc.ABCMeta):
"""Abstract base class for import finders."""
@abc.abstractmethod
- def find_module(self, fullname:str, path:[str]=None) -> Loader:
- """Abstract method which when implemented should find a module."""
+ def find_module(self, fullname, path=None):
+ """Abstract method which when implemented should find a module.
+ The fullname is a str and the optional path is a str or None.
+ Returns a Loader object.
+ """
raise NotImplementedError
Finder.register(machinery.BuiltinImporter)
@@ -39,9 +51,9 @@ class ResourceLoader(Loader):
"""
@abc.abstractmethod
- def get_data(self, path:str) -> bytes:
+ def get_data(self, path):
"""Abstract method which when implemented should return the bytes for
- the specified path."""
+ the specified path. The path must be a str."""
raise NotImplementedError
@@ -55,68 +67,238 @@ class InspectLoader(Loader):
"""
@abc.abstractmethod
- def is_package(self, fullname:str) -> bool:
+ def is_package(self, fullname):
"""Abstract method which when implemented should return whether the
- module is a package."""
- return NotImplementedError
+ module is a package. The fullname is a str. Returns a bool."""
+ raise NotImplementedError
@abc.abstractmethod
- def get_code(self, fullname:str) -> types.CodeType:
+ def get_code(self, fullname):
"""Abstract method which when implemented should return the code object
- for the module"""
- return NotImplementedError
+ for the module. The fullname is a str. Returns a types.CodeType."""
+ raise NotImplementedError
@abc.abstractmethod
- def get_source(self, fullname:str) -> str:
+ def get_source(self, fullname):
"""Abstract method which should return the source code for the
- module."""
- return NotImplementedError
+ module. The fullname is a str. Returns a str."""
+ raise NotImplementedError
InspectLoader.register(machinery.BuiltinImporter)
InspectLoader.register(machinery.FrozenImporter)
-class PyLoader(_bootstrap.PyLoader, ResourceLoader, InspectLoader):
+class ExecutionLoader(InspectLoader):
- """Abstract base class to assist in loading source code by requiring only
- back-end storage methods to be implemented.
+ """Abstract base class for loaders that wish to support the execution of
+ modules as scripts.
- The methods get_code, get_source, and load_module are implemented for the
- user.
+ This ABC represents one of the optional protocols specified in PEP 302.
+
+ """
+
+ @abc.abstractmethod
+ def get_filename(self, fullname):
+ """Abstract method which should return the value that __file__ is to be
+ set to."""
+ raise NotImplementedError
+
+
+class SourceLoader(_bootstrap.SourceLoader, ResourceLoader, ExecutionLoader):
+
+ """Abstract base class for loading source code (and optionally any
+ corresponding bytecode).
+
+ To support loading from source code, the abstractmethods inherited from
+ ResourceLoader and ExecutionLoader need to be implemented. To also support
+ loading from bytecode, the optional methods specified directly by this ABC
+ is required.
+
+ Inherited abstractmethods not implemented in this ABC:
+
+ * ResourceLoader.get_data
+ * ExecutionLoader.get_filename
+
+ """
+
+ def path_mtime(self, path):
+ """Return the (int) modification time for the path (str)."""
+ raise NotImplementedError
+
+ def set_data(self, path, data):
+ """Write the bytes to the path (if possible).
+
+ Accepts a str path and data as bytes.
+
+ Any needed intermediary directories are to be created. If for some
+ reason the file cannot be written because of permissions, fail
+ silently.
+
+ """
+ raise NotImplementedError
+
+
+class PyLoader(SourceLoader):
+
+ """Implement the deprecated PyLoader ABC in terms of SourceLoader.
+
+ This class has been deprecated! It is slated for removal in Python 3.4.
+ If compatibility with Python 3.1 is not needed then implement the
+ SourceLoader ABC instead of this class. If Python 3.1 compatibility is
+ needed, then use the following idiom to have a single class that is
+ compatible with Python 3.1 onwards::
+
+ try:
+ from importlib.abc import SourceLoader
+ except ImportError:
+ from importlib.abc import PyLoader as SourceLoader
+
+
+ class CustomLoader(SourceLoader):
+ def get_filename(self, fullname):
+ # Implement ...
+
+ def source_path(self, fullname):
+ '''Implement source_path in terms of get_filename.'''
+ try:
+ return self.get_filename(fullname)
+ except ImportError:
+ return None
+
+ def is_package(self, fullname):
+ filename = os.path.basename(self.get_filename(fullname))
+ return os.path.splitext(filename)[0] == '__init__'
"""
@abc.abstractmethod
- def source_path(self, fullname:str) -> object:
- """Abstract method which when implemented should return the path to the
- sourced code for the module."""
+ def is_package(self, fullname):
+ raise NotImplementedError
+
+ @abc.abstractmethod
+ def source_path(self, fullname):
+ """Abstract method. Accepts a str module name and returns the path to
+ the source code for the module."""
raise NotImplementedError
+ def get_filename(self, fullname):
+ """Implement get_filename in terms of source_path.
-class PyPycLoader(_bootstrap.PyPycLoader, PyLoader):
+ As get_filename should only return a source file path there is no
+ chance of the path not existing but loading still being possible, so
+ ImportError should propagate instead of being turned into returning
+ None.
+
+ """
+ warnings.warn("importlib.abc.PyLoader is deprecated and is "
+ "slated for removal in Python 3.4; "
+ "use SourceLoader instead. "
+ "See the importlib documentation on how to be "
+ "compatible with Python 3.1 onwards.",
+ PendingDeprecationWarning)
+ path = self.source_path(fullname)
+ if path is None:
+ raise ImportError
+ else:
+ return path
+
+
+class PyPycLoader(PyLoader):
"""Abstract base class to assist in loading source and bytecode by
requiring only back-end storage methods to be implemented.
+ This class has been deprecated! Removal is slated for Python 3.4. Implement
+ the SourceLoader ABC instead. If Python 3.1 compatibility is needed, see
+ PyLoader.
+
The methods get_code, get_source, and load_module are implemented for the
user.
"""
+ def get_filename(self, fullname):
+ """Return the source or bytecode file path."""
+ path = self.source_path(fullname)
+ if path is not None:
+ return path
+ path = self.bytecode_path(fullname)
+ if path is not None:
+ return path
+ raise ImportError("no source or bytecode path available for "
+ "{0!r}".format(fullname))
+
+ def get_code(self, fullname):
+ """Get a code object from source or bytecode."""
+ warnings.warn("importlib.abc.PyPycLoader is deprecated and slated for "
+ "removal in Python 3.4; use SourceLoader instead. "
+ "If Python 3.1 compatibility is required, see the "
+ "latest documentation for PyLoader.",
+ PendingDeprecationWarning)
+ source_timestamp = self.source_mtime(fullname)
+ # Try to use bytecode if it is available.
+ bytecode_path = self.bytecode_path(fullname)
+ if bytecode_path:
+ data = self.get_data(bytecode_path)
+ try:
+ magic = data[:4]
+ if len(magic) < 4:
+ raise ImportError("bad magic number in {}".format(fullname))
+ raw_timestamp = data[4:8]
+ if len(raw_timestamp) < 4:
+ raise EOFError("bad timestamp in {}".format(fullname))
+ pyc_timestamp = marshal._r_long(raw_timestamp)
+ bytecode = data[8:]
+ # Verify that the magic number is valid.
+ if imp.get_magic() != magic:
+ raise ImportError("bad magic number in {}".format(fullname))
+ # Verify that the bytecode is not stale (only matters when
+ # there is source to fall back on.
+ if source_timestamp:
+ if pyc_timestamp < source_timestamp:
+ raise ImportError("bytecode is stale")
+ except (ImportError, EOFError):
+ # If source is available give it a shot.
+ if source_timestamp is not None:
+ pass
+ else:
+ raise
+ else:
+ # Bytecode seems fine, so try to use it.
+ return marshal.loads(bytecode)
+ elif source_timestamp is None:
+ raise ImportError("no source or bytecode available to create code "
+ "object for {0!r}".format(fullname))
+ # Use the source.
+ source_path = self.source_path(fullname)
+ if source_path is None:
+ message = "a source path must exist to load {0}".format(fullname)
+ raise ImportError(message)
+ source = self.get_data(source_path)
+ code_object = compile(source, source_path, 'exec', dont_inherit=True)
+ # Generate bytecode and write it out.
+ if not sys.dont_write_bytecode:
+ data = bytearray(imp.get_magic())
+ data.extend(marshal._w_long(source_timestamp))
+ data.extend(marshal.dumps(code_object))
+ self.write_bytecode(fullname, data)
+ return code_object
+
@abc.abstractmethod
- def source_mtime(self, fullname:str) -> int:
- """Abstract method which when implemented should return the
+ def source_mtime(self, fullname):
+ """Abstract method. Accepts a str filename and returns an int
modification time for the source of the module."""
raise NotImplementedError
@abc.abstractmethod
- def bytecode_path(self, fullname:str) -> object:
- """Abstract method which when implemented should return the path to the
- bytecode for the module."""
+ def bytecode_path(self, fullname):
+ """Abstract method. Accepts a str filename and returns the str pathname
+ to the bytecode for the module."""
raise NotImplementedError
@abc.abstractmethod
- def write_bytecode(self, fullname:str, bytecode:bytes):
- """Abstract method which when implemented should attempt to write the
- bytecode for the module."""
+ def write_bytecode(self, fullname, bytecode):
+ """Abstract method. Accepts a str filename and bytes object
+ representing the bytecode for the module. Returns a boolean
+ representing whether the bytecode was written or not."""
raise NotImplementedError
diff --git a/Lib/importlib/test/__init__.py b/Lib/importlib/test/__init__.py
index bda33e69fe..e69de29bb2 100644
--- a/Lib/importlib/test/__init__.py
+++ b/Lib/importlib/test/__init__.py
@@ -1,31 +0,0 @@
-import os.path
-import sys
-import unittest
-
-
-def test_suite(package=__package__, directory=os.path.dirname(__file__)):
- suite = unittest.TestSuite()
- for name in os.listdir(directory):
- if name.startswith('.'):
- continue
- path = os.path.join(directory, name)
- if (os.path.isfile(path) and name.startswith('test_') and
- name.endswith('.py')):
- submodule_name = os.path.splitext(name)[0]
- module_name = "{0}.{1}".format(package, submodule_name)
- __import__(module_name, level=0)
- module_tests = unittest.findTestCases(sys.modules[module_name])
- suite.addTest(module_tests)
- elif os.path.isdir(path):
- package_name = "{0}.{1}".format(package, name)
- __import__(package_name, level=0)
- package_tests = getattr(sys.modules[package_name], 'test_suite')()
- suite.addTest(package_tests)
- else:
- continue
- return suite
-
-
-if __name__ == '__main__':
- from test.support import run_unittest
- run_unittest(test_suite('importlib.test'))
diff --git a/Lib/importlib/test/__main__.py b/Lib/importlib/test/__main__.py
new file mode 100644
index 0000000000..decc53d8c5
--- /dev/null
+++ b/Lib/importlib/test/__main__.py
@@ -0,0 +1,29 @@
+"""Run importlib's test suite.
+
+Specifying the ``--builtin`` flag will run tests, where applicable, with
+builtins.__import__ instead of importlib.__import__.
+
+"""
+import importlib
+from importlib.test.import_ import util
+import os.path
+from test.support import run_unittest
+import sys
+import unittest
+
+
+def test_main():
+ if '__pycache__' in __file__:
+ parts = __file__.split(os.path.sep)
+ start_dir = sep.join(parts[:-2])
+ else:
+ start_dir = os.path.dirname(__file__)
+ top_dir = os.path.dirname(os.path.dirname(start_dir))
+ test_loader = unittest.TestLoader()
+ if '--builtin' in sys.argv:
+ util.using___import__ = True
+ run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir))
+
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/importlib/test/benchmark.py b/Lib/importlib/test/benchmark.py
index f709a3cce9..b5de6c6b01 100644
--- a/Lib/importlib/test/benchmark.py
+++ b/Lib/importlib/test/benchmark.py
@@ -1,69 +1,159 @@
+"""Benchmark some basic import use-cases.
+
+The assumption is made that this benchmark is run in a fresh interpreter and
+thus has no external changes made to import-related attributes in sys.
+
+"""
from . import util
from .source import util as source_util
-import gc
import decimal
import imp
import importlib
+import os
+import py_compile
import sys
import timeit
-def bench_cache(import_, repeat, number):
- """Measure the time it takes to pull from sys.modules."""
+def bench(name, cleanup=lambda: None, *, seconds=1, repeat=3):
+ """Bench the given statement as many times as necessary until total
+ executions take one second."""
+ stmt = "__import__({!r})".format(name)
+ timer = timeit.Timer(stmt)
+ for x in range(repeat):
+ total_time = 0
+ count = 0
+ while total_time < seconds:
+ try:
+ total_time += timer.timeit(1)
+ finally:
+ cleanup()
+ count += 1
+ else:
+ # One execution too far
+ if total_time > seconds:
+ count -= 1
+ yield count // seconds
+
+def from_cache(seconds, repeat):
+ """sys.modules"""
name = '<benchmark import>'
+ module = imp.new_module(name)
+ module.__file__ = '<test>'
+ module.__package__ = ''
with util.uncache(name):
- module = imp.new_module(name)
sys.modules[name] = module
- runs = []
- for x in range(repeat):
- start_time = timeit.default_timer()
- for y in range(number):
- import_(name)
- end_time = timeit.default_timer()
- runs.append(end_time - start_time)
- return min(runs)
+ for result in bench(name, repeat=repeat, seconds=seconds):
+ yield result
-def bench_importing_source(import_, repeat, number, loc=100000):
- """Measure importing source from disk.
+def builtin_mod(seconds, repeat):
+ """Built-in module"""
+ name = 'errno'
+ if name in sys.modules:
+ del sys.modules[name]
+ # Relying on built-in importer being implicit.
+ for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
+ seconds=seconds):
+ yield result
- For worst-case scenario, the line endings are \\r\\n and thus require
- universal newline translation.
- """
- name = '__benchmark'
- with source_util.create_modules(name) as mapping:
- with open(mapping[name], 'w') as file:
- for x in range(loc):
- file.write("{0}\r\n".format(x))
- with util.import_state(path=[mapping['.root']]):
- runs = []
- for x in range(repeat):
- start_time = timeit.default_timer()
- for y in range(number):
- try:
- import_(name)
- finally:
- del sys.modules[name]
- end_time = timeit.default_timer()
- runs.append(end_time - start_time)
- return min(runs)
+def source_wo_bytecode(seconds, repeat):
+ """Source w/o bytecode: simple"""
+ sys.dont_write_bytecode = True
+ try:
+ name = '__importlib_test_benchmark__'
+ # Clears out sys.modules and puts an entry at the front of sys.path.
+ with source_util.create_modules(name) as mapping:
+ assert not os.path.exists(imp.cache_from_source(mapping[name]))
+ for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
+ seconds=seconds):
+ yield result
+ finally:
+ sys.dont_write_bytecode = False
-def main(import_):
- args = [('sys.modules', bench_cache, 5, 500000),
- ('source', bench_importing_source, 5, 10000)]
- test_msg = "{test}, {number} times (best of {repeat}):"
- result_msg = "{result:.2f} secs"
- gc.disable()
+def decimal_wo_bytecode(seconds, repeat):
+ """Source w/o bytecode: decimal"""
+ name = 'decimal'
+ decimal_bytecode = imp.cache_from_source(decimal.__file__)
+ if os.path.exists(decimal_bytecode):
+ os.unlink(decimal_bytecode)
+ sys.dont_write_bytecode = True
try:
- for name, meth, repeat, number in args:
- result = meth(import_, repeat, number)
- print(test_msg.format(test=name, repeat=repeat,
- number=number).ljust(40),
- result_msg.format(result=result).rjust(10))
+ for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
+ seconds=seconds):
+ yield result
finally:
- gc.enable()
+ sys.dont_write_bytecode = False
+
+
+def source_writing_bytecode(seconds, repeat):
+ """Source writing bytecode: simple"""
+ assert not sys.dont_write_bytecode
+ name = '__importlib_test_benchmark__'
+ with source_util.create_modules(name) as mapping:
+ def cleanup():
+ sys.modules.pop(name)
+ os.unlink(imp.cache_from_source(mapping[name]))
+ for result in bench(name, cleanup, repeat=repeat, seconds=seconds):
+ assert not os.path.exists(imp.cache_from_source(mapping[name]))
+ yield result
+
+
+def decimal_writing_bytecode(seconds, repeat):
+ """Source writing bytecode: decimal"""
+ assert not sys.dont_write_bytecode
+ name = 'decimal'
+ def cleanup():
+ sys.modules.pop(name)
+ os.unlink(imp.cache_from_source(decimal.__file__))
+ for result in bench(name, cleanup, repeat=repeat, seconds=seconds):
+ yield result
+
+
+def source_using_bytecode(seconds, repeat):
+ """Bytecode w/ source: simple"""
+ name = '__importlib_test_benchmark__'
+ with source_util.create_modules(name) as mapping:
+ py_compile.compile(mapping[name])
+ assert os.path.exists(imp.cache_from_source(mapping[name]))
+ for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
+ seconds=seconds):
+ yield result
+
+
+def decimal_using_bytecode(seconds, repeat):
+ """Bytecode w/ source: decimal"""
+ name = 'decimal'
+ py_compile.compile(decimal.__file__)
+ for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
+ seconds=seconds):
+ yield result
+
+
+def main(import_):
+ __builtins__.__import__ = import_
+ benchmarks = (from_cache, builtin_mod,
+ source_using_bytecode, source_wo_bytecode,
+ source_writing_bytecode,
+ decimal_using_bytecode, decimal_writing_bytecode,
+ decimal_wo_bytecode,)
+ seconds = 1
+ seconds_plural = 's' if seconds > 1 else ''
+ repeat = 3
+ header = "Measuring imports/second over {} second{}, best out of {}\n"
+ print(header.format(seconds, seconds_plural, repeat))
+ for benchmark in benchmarks:
+ print(benchmark.__doc__, "[", end=' ')
+ sys.stdout.flush()
+ results = []
+ for result in benchmark(seconds=seconds, repeat=repeat):
+ results.append(result)
+ print(result, end=' ')
+ sys.stdout.flush()
+ assert not sys.dont_write_bytecode
+ print("]", "best is", format(max(results), ',d'))
if __name__ == '__main__':
@@ -74,7 +164,7 @@ if __name__ == '__main__':
default=False, help="use the built-in __import__")
options, args = parser.parse_args()
if args:
- raise RuntimeError("unrecognized args: {0}".format(args))
+ raise RuntimeError("unrecognized args: {}".format(args))
import_ = __import__
if not options.builtin:
import_ = importlib.__import__
diff --git a/Lib/importlib/test/builtin/test_loader.py b/Lib/importlib/test/builtin/test_loader.py
index dff00ce4bd..1a8539b1e8 100644
--- a/Lib/importlib/test/builtin/test_loader.py
+++ b/Lib/importlib/test/builtin/test_loader.py
@@ -54,13 +54,15 @@ class LoaderTests(abc.LoaderTests):
def test_unloadable(self):
name = 'dssdsdfff'
assert name not in sys.builtin_module_names
- self.assertRaises(ImportError, self.load_module, name)
+ with self.assertRaises(ImportError):
+ self.load_module(name)
def test_already_imported(self):
# Using the name of a module already imported but not a built-in should
# still fail.
assert hasattr(importlib, '__file__') # Not a built-in.
- self.assertRaises(ImportError, self.load_module, 'importlib')
+ with self.assertRaises(ImportError):
+ self.load_module('importlib')
class InspectLoaderTests(unittest.TestCase):
@@ -86,7 +88,8 @@ class InspectLoaderTests(unittest.TestCase):
# Modules not built-in should raise ImportError.
for meth_name in ('get_code', 'get_source', 'is_package'):
method = getattr(machinery.BuiltinImporter, meth_name)
- self.assertRaises(ImportError, method, builtin_util.BAD_NAME)
+ with self.assertRaises(ImportError):
+ method(builtin_util.BAD_NAME)
diff --git a/Lib/importlib/test/extension/test_case_sensitivity.py b/Lib/importlib/test/extension/test_case_sensitivity.py
index 3865539b60..e062fb6597 100644
--- a/Lib/importlib/test/extension/test_case_sensitivity.py
+++ b/Lib/importlib/test/extension/test_case_sensitivity.py
@@ -13,7 +13,8 @@ class ExtensionModuleCaseSensitivityTest(unittest.TestCase):
good_name = ext_util.NAME
bad_name = good_name.upper()
assert good_name != bad_name
- finder = _bootstrap._ExtensionFileFinder(ext_util.PATH)
+ finder = _bootstrap._FileFinder(ext_util.PATH,
+ _bootstrap._ExtensionFinderDetails())
return finder.find_module(bad_name)
def test_case_sensitive(self):
diff --git a/Lib/importlib/test/extension/test_finder.py b/Lib/importlib/test/extension/test_finder.py
index 546a1760e1..ea97483317 100644
--- a/Lib/importlib/test/extension/test_finder.py
+++ b/Lib/importlib/test/extension/test_finder.py
@@ -9,7 +9,8 @@ class FinderTests(abc.FinderTests):
"""Test the finder for extension modules."""
def find_module(self, fullname):
- importer = _bootstrap._ExtensionFileFinder(util.PATH)
+ importer = _bootstrap._FileFinder(util.PATH,
+ _bootstrap._ExtensionFinderDetails())
return importer.find_module(fullname)
def test_module(self):
diff --git a/Lib/importlib/test/extension/test_loader.py b/Lib/importlib/test/extension/test_loader.py
index 71841c64ac..4a783db8a5 100644
--- a/Lib/importlib/test/extension/test_loader.py
+++ b/Lib/importlib/test/extension/test_loader.py
@@ -13,7 +13,7 @@ class LoaderTests(abc.LoaderTests):
def load_module(self, fullname):
loader = _bootstrap._ExtensionFileLoader(ext_util.NAME,
- ext_util.FILEPATH, False)
+ ext_util.FILEPATH)
return loader.load_module(fullname)
def test_module(self):
@@ -46,7 +46,8 @@ class LoaderTests(abc.LoaderTests):
pass
def test_unloadable(self):
- self.assertRaises(ImportError, self.load_module, 'asdfjkl;')
+ with self.assertRaises(ImportError):
+ self.load_module('asdfjkl;')
def test_main():
diff --git a/Lib/importlib/test/extension/test_path_hook.py b/Lib/importlib/test/extension/test_path_hook.py
index bf2f411484..4610420d29 100644
--- a/Lib/importlib/test/extension/test_path_hook.py
+++ b/Lib/importlib/test/extension/test_path_hook.py
@@ -14,7 +14,7 @@ class PathHookTests(unittest.TestCase):
# XXX Should it only work for directories containing an extension module?
def hook(self, entry):
- return _bootstrap._ExtensionFileFinder(entry)
+ return _bootstrap._file_path_hook(entry)
def test_success(self):
# Path hook should handle a directory where a known extension module
diff --git a/Lib/importlib/test/frozen/test_loader.py b/Lib/importlib/test/frozen/test_loader.py
index fa64f30d30..c05e22ce1b 100644
--- a/Lib/importlib/test/frozen/test_loader.py
+++ b/Lib/importlib/test/frozen/test_loader.py
@@ -51,8 +51,8 @@ class LoaderTests(abc.LoaderTests):
def test_unloadable(self):
assert machinery.FrozenImporter.find_module('_not_real') is None
- self.assertRaises(ImportError, machinery.FrozenImporter.load_module,
- '_not_real')
+ with self.assertRaises(ImportError):
+ machinery.FrozenImporter.load_module('_not_real')
class InspectLoaderTests(unittest.TestCase):
@@ -84,7 +84,8 @@ class InspectLoaderTests(unittest.TestCase):
# Raise ImportError for modules that are not frozen.
for meth_name in ('get_code', 'get_source', 'is_package'):
method = getattr(machinery.FrozenImporter, meth_name)
- self.assertRaises(ImportError, method, 'importlib')
+ with self.assertRaises(ImportError):
+ method('importlib')
def test_main():
diff --git a/Lib/importlib/test/import_/test___package__.py b/Lib/importlib/test/import_/test___package__.py
index 4dc6901bdb..5056ae59cc 100644
--- a/Lib/importlib/test/import_/test___package__.py
+++ b/Lib/importlib/test/import_/test___package__.py
@@ -19,8 +19,9 @@ class Using__package__(unittest.TestCase):
base = package.rsplit('.', level)[0]
return '{0}.{1}'.format(base, name)
- But since there is no guarantee that __package__ has been set, there has to
- be a way to calculate the attribute's value [__name__]::
+ But since there is no guarantee that __package__ has been set (or not been
+ set to None [None]), there has to be a way to calculate the attribute's value
+ [__name__]::
def calc_package(caller_name, has___path__):
if has__path__:
@@ -43,28 +44,34 @@ class Using__package__(unittest.TestCase):
fromlist=['attr'], level=2)
self.assertEqual(module.__name__, 'pkg')
- def test_using___name__(self):
+ def test_using___name__(self, package_as_None=False):
# [__name__]
+ globals_ = {'__name__': 'pkg.fake', '__path__': []}
+ if package_as_None:
+ globals_['__package__'] = None
with util.mock_modules('pkg.__init__', 'pkg.fake') as importer:
with util.import_state(meta_path=[importer]):
import_util.import_('pkg.fake')
- module = import_util.import_('',
- globals={'__name__': 'pkg.fake',
- '__path__': []},
- fromlist=['attr'], level=2)
+ module = import_util.import_('', globals= globals_,
+ fromlist=['attr'], level=2)
self.assertEqual(module.__name__, 'pkg')
+ def test_None_as___package__(self):
+ # [None]
+ self.test_using___name__(package_as_None=True)
+
def test_bad__package__(self):
globals = {'__package__': '<not real>'}
- self.assertRaises(SystemError, import_util.import_,'', globals, {},
- ['relimport'], 1)
+ with self.assertRaises(SystemError):
+ import_util.import_('', globals, {}, ['relimport'], 1)
def test_bunk__package__(self):
globals = {'__package__': 42}
- self.assertRaises(ValueError, import_util.import_, '', globals, {},
- ['relimport'], 1)
+ with self.assertRaises(ValueError):
+ import_util.import_('', globals, {}, ['relimport'], 1)
+@import_util.importlib_only
class Setting__package__(unittest.TestCase):
"""Because __package__ is a new feature, it is not always set by a loader.
diff --git a/Lib/importlib/test/import_/test_api.py b/Lib/importlib/test/import_/test_api.py
new file mode 100644
index 0000000000..9075d42759
--- /dev/null
+++ b/Lib/importlib/test/import_/test_api.py
@@ -0,0 +1,22 @@
+from . import util
+import unittest
+
+
+class APITest(unittest.TestCase):
+
+ """Test API-specific details for __import__ (e.g. raising the right
+ exception when passing in an int for the module name)."""
+
+ def test_name_requires_rparition(self):
+ # Raise TypeError if a non-string is passed in for the module name.
+ with self.assertRaises(TypeError):
+ util.import_(42)
+
+
+def test_main():
+ from test.support import run_unittest
+ run_unittest(APITest)
+
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/importlib/test/import_/test_fromlist.py b/Lib/importlib/test/import_/test_fromlist.py
index ddd355ef30..b903e8e611 100644
--- a/Lib/importlib/test/import_/test_fromlist.py
+++ b/Lib/importlib/test/import_/test_fromlist.py
@@ -84,16 +84,23 @@ class HandlingFromlist(unittest.TestCase):
module = import_util.import_('pkg.mod', fromlist=[''])
self.assertEqual(module.__name__, 'pkg.mod')
- def test_using_star(self):
+ def basic_star_test(self, fromlist=['*']):
# [using *]
with util.mock_modules('pkg.__init__', 'pkg.module') as mock:
with util.import_state(meta_path=[mock]):
mock['pkg'].__all__ = ['module']
- module = import_util.import_('pkg', fromlist=['*'])
+ module = import_util.import_('pkg', fromlist=fromlist)
self.assertEqual(module.__name__, 'pkg')
self.assertTrue(hasattr(module, 'module'))
self.assertEqual(module.module.__name__, 'pkg.module')
+ def test_using_star(self):
+ # [using *]
+ self.basic_star_test()
+
+ def test_fromlist_as_tuple(self):
+ self.basic_star_test(('*',))
+
def test_star_with_others(self):
# [using * with others]
context = util.mock_modules('pkg.__init__', 'pkg.module1', 'pkg.module2')
diff --git a/Lib/importlib/test/import_/test_packages.py b/Lib/importlib/test/import_/test_packages.py
index b41c36f5b5..faadc32172 100644
--- a/Lib/importlib/test/import_/test_packages.py
+++ b/Lib/importlib/test/import_/test_packages.py
@@ -18,8 +18,14 @@ class ParentModuleTests(unittest.TestCase):
def test_bad_parent(self):
with util.mock_modules('pkg.module') as mock:
with util.import_state(meta_path=[mock]):
- self.assertRaises(ImportError,
- import_util.import_, 'pkg.module')
+ with self.assertRaises(ImportError):
+ import_util.import_('pkg.module')
+
+ def test_module_not_package(self):
+ # Try to import a submodule from a non-package should raise ImportError.
+ assert not hasattr(sys, '__path__')
+ with self.assertRaises(ImportError):
+ import_util.import_('sys.no_submodules_here')
def test_main():
diff --git a/Lib/importlib/test/import_/test_path.py b/Lib/importlib/test/import_/test_path.py
index 0e055b1352..2faa23174b 100644
--- a/Lib/importlib/test/import_/test_path.py
+++ b/Lib/importlib/test/import_/test_path.py
@@ -2,10 +2,10 @@ from importlib import _bootstrap
from importlib import machinery
from .. import util
from . import util as import_util
-from contextlib import nested
import imp
import os
import sys
+import tempfile
from test import support
from types import MethodType
import unittest
@@ -81,23 +81,28 @@ class DefaultPathFinderTests(unittest.TestCase):
def test_implicit_hooks(self):
# Test that the implicit path hooks are used.
- existing_path = os.path.dirname(support.TESTFN)
bad_path = '<path>'
module = '<module>'
assert not os.path.exists(bad_path)
- with util.import_state():
- nothing = _bootstrap._DefaultPathFinder.find_module(module,
- path=[existing_path])
- self.assertTrue(nothing is None)
- self.assertTrue(existing_path in sys.path_importer_cache)
- self.assertTrue(not isinstance(sys.path_importer_cache[existing_path],
- imp.NullImporter))
- nothing = _bootstrap._DefaultPathFinder.find_module(module,
- path=[bad_path])
- self.assertTrue(nothing is None)
- self.assertTrue(bad_path in sys.path_importer_cache)
- self.assertTrue(isinstance(sys.path_importer_cache[bad_path],
- imp.NullImporter))
+ existing_path = tempfile.mkdtemp()
+ try:
+ with util.import_state():
+ nothing = _bootstrap._DefaultPathFinder.find_module(module,
+ path=[existing_path])
+ self.assertTrue(nothing is None)
+ self.assertTrue(existing_path in sys.path_importer_cache)
+ result = isinstance(sys.path_importer_cache[existing_path],
+ imp.NullImporter)
+ self.assertFalse(result)
+ nothing = _bootstrap._DefaultPathFinder.find_module(module,
+ path=[bad_path])
+ self.assertTrue(nothing is None)
+ self.assertTrue(bad_path in sys.path_importer_cache)
+ self.assertTrue(isinstance(sys.path_importer_cache[bad_path],
+ imp.NullImporter))
+ finally:
+ os.rmdir(existing_path)
+
def test_path_importer_cache_has_None(self):
# Test that the default hook is used when sys.path_importer_cache
diff --git a/Lib/importlib/test/import_/test_relative_imports.py b/Lib/importlib/test/import_/test_relative_imports.py
index 5547d4c6ff..a0f6b2d827 100644
--- a/Lib/importlib/test/import_/test_relative_imports.py
+++ b/Lib/importlib/test/import_/test_relative_imports.py
@@ -154,8 +154,9 @@ class RelativeImports(unittest.TestCase):
{'__name__': 'pkg', '__path__': ['blah']})
def callback(global_):
import_util.import_('pkg')
- self.assertRaises(ValueError, import_util.import_, '', global_,
- fromlist=['top_level'], level=2)
+ with self.assertRaises(ValueError):
+ import_util.import_('', global_, fromlist=['top_level'],
+ level=2)
self.relative_import_test(create, globals_, callback)
def test_too_high_from_module(self):
@@ -164,13 +165,15 @@ class RelativeImports(unittest.TestCase):
globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'}
def callback(global_):
import_util.import_('pkg')
- self.assertRaises(ValueError, import_util.import_, '', global_,
- fromlist=['top_level'], level=2)
+ with self.assertRaises(ValueError):
+ import_util.import_('', global_, fromlist=['top_level'],
+ level=2)
self.relative_import_test(create, globals_, callback)
def test_empty_name_w_level_0(self):
# [empty name]
- self.assertRaises(ValueError, import_util.import_, '')
+ with self.assertRaises(ValueError):
+ import_util.import_('')
def test_import_from_different_package(self):
# Test importing from a different package than the caller.
diff --git a/Lib/importlib/test/import_/util.py b/Lib/importlib/test/import_/util.py
index 5a1b72788d..649c5ed27c 100644
--- a/Lib/importlib/test/import_/util.py
+++ b/Lib/importlib/test/import_/util.py
@@ -1,5 +1,7 @@
import functools
+import importlib
import importlib._bootstrap
+import unittest
using___import__ = False
@@ -10,19 +12,12 @@ def import_(*args, **kwargs):
if using___import__:
return __import__(*args, **kwargs)
else:
- return importlib._bootstrap.__import__(*args, **kwargs)
+ return importlib.__import__(*args, **kwargs)
def importlib_only(fxn):
- """Decorator to mark which tests are not supported by the current
- implementation of __import__()."""
- def inner(*args, **kwargs):
- if using___import__:
- return
- else:
- return fxn(*args, **kwargs)
- functools.update_wrapper(inner, fxn)
- return inner
+ """Decorator to skip a test if using __builtins__.__import__."""
+ return unittest.skipIf(using___import__, "importlib-specific test")(fxn)
def mock_path_hook(*entries, importer):
diff --git a/Lib/importlib/test/regrtest.py b/Lib/importlib/test/regrtest.py
new file mode 100644
index 0000000000..b103ae7d0e
--- /dev/null
+++ b/Lib/importlib/test/regrtest.py
@@ -0,0 +1,35 @@
+"""Run Python's standard test suite using importlib.__import__.
+
+Tests known to fail because of assumptions that importlib (properly)
+invalidates are automatically skipped if the entire test suite is run.
+Otherwise all command-line options valid for test.regrtest are also valid for
+this script.
+
+XXX FAILING
+ * test_import
+ - test_incorrect_code_name
+ file name differing between __file__ and co_filename (r68360 on trunk)
+ - test_import_by_filename
+ exception for trying to import by file name does not match
+
+"""
+import importlib
+import sys
+from test import regrtest
+
+if __name__ == '__main__':
+ __builtins__.__import__ = importlib.__import__
+
+ exclude = ['--exclude',
+ 'test_frozen', # Does not expect __loader__ attribute
+ 'test_pkg', # Does not expect __loader__ attribute
+ 'test_pydoc', # Does not expect __loader__ attribute
+ ]
+
+ # Switching on --exclude implies running all test but the ones listed, so
+ # only use it when one is not running an explicit test
+ if len(sys.argv) == 1:
+ # No programmatic way to specify tests to exclude
+ sys.argv.extend(exclude)
+
+ regrtest.main(quiet=True, verbose2=True)
diff --git a/Lib/importlib/test/source/test_abc_loader.py b/Lib/importlib/test/source/test_abc_loader.py
index 1ce83fb8c3..32459074a0 100644
--- a/Lib/importlib/test/source/test_abc_loader.py
+++ b/Lib/importlib/test/source/test_abc_loader.py
@@ -1,14 +1,68 @@
import importlib
from importlib import abc
+
from .. import abc as testing_abc
from .. import util
from . import util as source_util
+
import imp
+import inspect
+import io
import marshal
import os
import sys
import types
import unittest
+import warnings
+
+
+class SourceOnlyLoaderMock(abc.SourceLoader):
+
+ # Globals that should be defined for all modules.
+ source = (b"_ = '::'.join([__name__, __file__, __cached__, __package__, "
+ b"repr(__loader__)])")
+
+ def __init__(self, path):
+ self.path = path
+
+ def get_data(self, path):
+ assert self.path == path
+ return self.source
+
+ def get_filename(self, fullname):
+ return self.path
+
+
+class SourceLoaderMock(SourceOnlyLoaderMock):
+
+ source_mtime = 1
+
+ def __init__(self, path, magic=imp.get_magic()):
+ super().__init__(path)
+ self.bytecode_path = imp.cache_from_source(self.path)
+ data = bytearray(magic)
+ data.extend(marshal._w_long(self.source_mtime))
+ code_object = compile(self.source, self.path, 'exec',
+ dont_inherit=True)
+ data.extend(marshal.dumps(code_object))
+ self.bytecode = bytes(data)
+ self.written = {}
+
+ def get_data(self, path):
+ if path == self.path:
+ return super().get_data(path)
+ elif path == self.bytecode_path:
+ return self.bytecode
+ else:
+ raise IOError
+
+ def path_mtime(self, path):
+ assert path == self.path
+ return self.source_mtime
+
+ def set_data(self, path, data):
+ self.written[path] = bytes(data)
+ return path == self.bytecode_path
class PyLoaderMock(abc.PyLoader):
@@ -33,17 +87,42 @@ class PyLoaderMock(abc.PyLoader):
return self.source
def is_package(self, name):
+ filename = os.path.basename(self.get_filename(name))
+ return os.path.splitext(filename)[0] == '__init__'
+
+ def source_path(self, name):
try:
- return '__init__' in self.module_paths[name]
+ return self.module_paths[name]
except KeyError:
raise ImportError
- def source_path(self, name):
+ def get_filename(self, name):
+ """Silence deprecation warning."""
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always")
+ path = super().get_filename(name)
+ assert len(w) == 1
+ assert issubclass(w[0].category, PendingDeprecationWarning)
+ return path
+
+
+class PyLoaderCompatMock(PyLoaderMock):
+
+ """Mock that matches what is suggested to have a loader that is compatible
+ from Python 3.1 onwards."""
+
+ def get_filename(self, fullname):
try:
- return self.module_paths[name]
+ return self.module_paths[fullname]
except KeyError:
raise ImportError
+ def source_path(self, fullname):
+ try:
+ return self.get_filename(fullname)
+ except ImportError:
+ return None
+
class PyPycLoaderMock(abc.PyPycLoader, PyLoaderMock):
@@ -114,6 +193,13 @@ class PyPycLoaderMock(abc.PyPycLoader, PyLoaderMock):
except TypeError:
return '__init__' in self.bytecode_to_path[name]
+ def get_code(self, name):
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always")
+ code_object = super().get_code(name)
+ assert len(w) == 1
+ assert issubclass(w[0].category, PendingDeprecationWarning)
+ return code_object
class PyLoaderTests(testing_abc.LoaderTests):
@@ -183,7 +269,8 @@ class PyLoaderTests(testing_abc.LoaderTests):
mock.source = b"1/0"
with util.uncache(name):
sys.modules[name] = module
- self.assertRaises(ZeroDivisionError, mock.load_module, name)
+ with self.assertRaises(ZeroDivisionError):
+ mock.load_module(name)
self.assertTrue(sys.modules[name] is module)
self.assertTrue(hasattr(module, 'blah'))
return mock
@@ -193,11 +280,20 @@ class PyLoaderTests(testing_abc.LoaderTests):
mock = self.mocker({name: os.path.join('path', 'to', 'mod')})
mock.source = b"1/0"
with util.uncache(name):
- self.assertRaises(ZeroDivisionError, mock.load_module, name)
+ with self.assertRaises(ZeroDivisionError):
+ mock.load_module(name)
self.assertTrue(name not in sys.modules)
return mock
+class PyLoaderCompatTests(PyLoaderTests):
+
+ """Test that the suggested code to make a loader that is compatible from
+ Python 3.1 forward works."""
+
+ mocker = PyLoaderCompatMock
+
+
class PyLoaderInterfaceTests(unittest.TestCase):
"""Tests for importlib.abc.PyLoader to make sure that when source_path()
@@ -207,38 +303,29 @@ class PyLoaderInterfaceTests(unittest.TestCase):
# No source path should lead to ImportError.
name = 'mod'
mock = PyLoaderMock({})
- with util.uncache(name):
- self.assertRaises(ImportError, mock.load_module, name)
+ with util.uncache(name), self.assertRaises(ImportError):
+ mock.load_module(name)
def test_source_path_is_None(self):
name = 'mod'
mock = PyLoaderMock({name: None})
- with util.uncache(name):
- self.assertRaises(ImportError, mock.load_module, name)
-
-
-class PyLoaderGetSourceTests(unittest.TestCase):
-
- """Tests for importlib.abc.PyLoader.get_source()."""
+ with util.uncache(name), self.assertRaises(ImportError):
+ mock.load_module(name)
- def test_default_encoding(self):
- # Should have no problems with UTF-8 text.
+ def test_get_filename_with_source_path(self):
+ # get_filename() should return what source_path() returns.
name = 'mod'
- mock = PyLoaderMock({name: os.path.join('path', 'to', 'mod')})
- source = 'x = "ü"'
- mock.source = source.encode('utf-8')
- returned_source = mock.get_source(name)
- self.assertEqual(returned_source, source)
+ path = os.path.join('path', 'to', 'source')
+ mock = PyLoaderMock({name: path})
+ with util.uncache(name):
+ self.assertEqual(mock.get_filename(name), path)
- def test_decoded_source(self):
- # Decoding should work.
+ def test_get_filename_no_source_path(self):
+ # get_filename() should raise ImportError if source_path returns None.
name = 'mod'
- mock = PyLoaderMock({name: os.path.join('path', 'to', 'mod')})
- source = "# coding: Latin-1\nx='ü'"
- assert source.encode('latin-1') != source.encode('utf-8')
- mock.source = source.encode('latin-1')
- returned_source = mock.get_source(name)
- self.assertEqual(returned_source, source)
+ mock = PyLoaderMock({name: None})
+ with util.uncache(name), self.assertRaises(ImportError):
+ mock.get_filename(name)
class PyPycLoaderTests(PyLoaderTests):
@@ -281,6 +368,38 @@ class PyPycLoaderTests(PyLoaderTests):
super().test_unloadable()
+class PyPycLoaderInterfaceTests(unittest.TestCase):
+
+ """Test for the interface of importlib.abc.PyPycLoader."""
+
+ def get_filename_check(self, src_path, bc_path, expect):
+ name = 'mod'
+ mock = PyPycLoaderMock({name: src_path}, {name: {'path': bc_path}})
+ with util.uncache(name):
+ assert mock.source_path(name) == src_path
+ assert mock.bytecode_path(name) == bc_path
+ self.assertEqual(mock.get_filename(name), expect)
+
+ def test_filename_with_source_bc(self):
+ # When source and bytecode paths present, return the source path.
+ self.get_filename_check('source_path', 'bc_path', 'source_path')
+
+ def test_filename_with_source_no_bc(self):
+ # With source but no bc, return source path.
+ self.get_filename_check('source_path', None, 'source_path')
+
+ def test_filename_with_no_source_bc(self):
+ # With not source but bc, return the bc path.
+ self.get_filename_check(None, 'bc_path', 'bc_path')
+
+ def test_filename_with_no_source_or_bc(self):
+ # With no source or bc, raise ImportError.
+ name = 'mod'
+ mock = PyPycLoaderMock({name: None}, {name: {'path': None}})
+ with util.uncache(name), self.assertRaises(ImportError):
+ mock.get_filename(name)
+
+
class SkipWritingBytecodeTests(unittest.TestCase):
"""Test that bytecode is properly handled based on
@@ -346,20 +465,28 @@ class BadBytecodeFailureTests(unittest.TestCase):
# A bad magic number should lead to an ImportError.
name = 'mod'
bad_magic = b'\x00\x00\x00\x00'
- mock = PyPycLoaderMock({name: None},
- {name: {'path': os.path.join('path', 'to', 'mod'),
- 'magic': bad_magic}})
- with util.uncache(name):
- self.assertRaises(ImportError, mock.load_module, name)
+ bc = {name:
+ {'path': os.path.join('path', 'to', 'mod'),
+ 'magic': bad_magic}}
+ mock = PyPycLoaderMock({name: None}, bc)
+ with util.uncache(name), self.assertRaises(ImportError):
+ mock.load_module(name)
+
+ def test_no_bytecode(self):
+ # Missing code object bytecode should lead to an EOFError.
+ name = 'mod'
+ bc = {name: {'path': os.path.join('path', 'to', 'mod'), 'bc': b''}}
+ mock = PyPycLoaderMock({name: None}, bc)
+ with util.uncache(name), self.assertRaises(EOFError):
+ mock.load_module(name)
def test_bad_bytecode(self):
- # Bad code object bytecode should lead to an ImportError.
+ # Malformed code object bytecode should lead to a ValueError.
name = 'mod'
- mock = PyPycLoaderMock({name: None},
- {name: {'path': os.path.join('path', 'to', 'mod'),
- 'bc': b''}})
- with util.uncache(name):
- self.assertRaises(EOFError, mock.load_module, name)
+ bc = {name: {'path': os.path.join('path', 'to', 'mod'), 'bc': b'1234'}}
+ mock = PyPycLoaderMock({name: None}, bc)
+ with util.uncache(name), self.assertRaises(ValueError):
+ mock.load_module(name)
def raise_ImportError(*args, **kwargs):
@@ -387,16 +514,16 @@ class MissingPathsTests(unittest.TestCase):
# If all *_path methods return None, raise ImportError.
name = 'mod'
mock = PyPycLoaderMock({name: None})
- with util.uncache(name):
- self.assertRaises(ImportError, mock.load_module, name)
+ with util.uncache(name), self.assertRaises(ImportError):
+ mock.load_module(name)
def test_source_path_ImportError(self):
# An ImportError from source_path should trigger an ImportError.
name = 'mod'
mock = PyPycLoaderMock({}, {name: {'path': os.path.join('path', 'to',
'mod')}})
- with util.uncache(name):
- self.assertRaises(ImportError, mock.load_module, name)
+ with util.uncache(name), self.assertRaises(ImportError):
+ mock.load_module(name)
def test_bytecode_path_ImportError(self):
# An ImportError from bytecode_path should trigger an ImportError.
@@ -404,16 +531,345 @@ class MissingPathsTests(unittest.TestCase):
mock = PyPycLoaderMock({name: os.path.join('path', 'to', 'mod')})
bad_meth = types.MethodType(raise_ImportError, mock)
mock.bytecode_path = bad_meth
- with util.uncache(name):
- self.assertRaises(ImportError, mock.load_module, name)
+ with util.uncache(name), self.assertRaises(ImportError):
+ mock.load_module(name)
+
+
+class SourceLoaderTestHarness(unittest.TestCase):
+
+ def setUp(self, *, is_package=True, **kwargs):
+ self.package = 'pkg'
+ if is_package:
+ self.path = os.path.join(self.package, '__init__.py')
+ self.name = self.package
+ else:
+ module_name = 'mod'
+ self.path = os.path.join(self.package, '.'.join(['mod', 'py']))
+ self.name = '.'.join([self.package, module_name])
+ self.cached = imp.cache_from_source(self.path)
+ self.loader = self.loader_mock(self.path, **kwargs)
+
+ def verify_module(self, module):
+ self.assertEqual(module.__name__, self.name)
+ self.assertEqual(module.__file__, self.path)
+ self.assertEqual(module.__cached__, self.cached)
+ self.assertEqual(module.__package__, self.package)
+ self.assertEqual(module.__loader__, self.loader)
+ values = module._.split('::')
+ self.assertEqual(values[0], self.name)
+ self.assertEqual(values[1], self.path)
+ self.assertEqual(values[2], self.cached)
+ self.assertEqual(values[3], self.package)
+ self.assertEqual(values[4], repr(self.loader))
+
+ def verify_code(self, code_object):
+ module = imp.new_module(self.name)
+ module.__file__ = self.path
+ module.__cached__ = self.cached
+ module.__package__ = self.package
+ module.__loader__ = self.loader
+ module.__path__ = []
+ exec(code_object, module.__dict__)
+ self.verify_module(module)
+
+
+class SourceOnlyLoaderTests(SourceLoaderTestHarness):
+
+ """Test importlib.abc.SourceLoader for source-only loading.
+
+ Reload testing is subsumed by the tests for
+ importlib.util.module_for_loader.
+
+ """
+
+ loader_mock = SourceOnlyLoaderMock
+
+ def test_get_source(self):
+ # Verify the source code is returned as a string.
+ # If an IOError is raised by get_data then raise ImportError.
+ expected_source = self.loader.source.decode('utf-8')
+ self.assertEqual(self.loader.get_source(self.name), expected_source)
+ def raise_IOError(path):
+ raise IOError
+ self.loader.get_data = raise_IOError
+ with self.assertRaises(ImportError):
+ self.loader.get_source(self.name)
+
+ def test_is_package(self):
+ # Properly detect when loading a package.
+ self.setUp(is_package=True)
+ self.assertTrue(self.loader.is_package(self.name))
+ self.setUp(is_package=False)
+ self.assertFalse(self.loader.is_package(self.name))
+
+ def test_get_code(self):
+ # Verify the code object is created.
+ code_object = self.loader.get_code(self.name)
+ self.verify_code(code_object)
+
+ def test_load_module(self):
+ # Loading a module should set __name__, __loader__, __package__,
+ # __path__ (for packages), __file__, and __cached__.
+ # The module should also be put into sys.modules.
+ with util.uncache(self.name):
+ module = self.loader.load_module(self.name)
+ self.verify_module(module)
+ self.assertEqual(module.__path__, [os.path.dirname(self.path)])
+ self.assertTrue(self.name in sys.modules)
+
+ def test_package_settings(self):
+ # __package__ needs to be set, while __path__ is set on if the module
+ # is a package.
+ # Testing the values for a package are covered by test_load_module.
+ self.setUp(is_package=False)
+ with util.uncache(self.name):
+ module = self.loader.load_module(self.name)
+ self.verify_module(module)
+ self.assertTrue(not hasattr(module, '__path__'))
+
+ def test_get_source_encoding(self):
+ # Source is considered encoded in UTF-8 by default unless otherwise
+ # specified by an encoding line.
+ source = "_ = 'ü'"
+ self.loader.source = source.encode('utf-8')
+ returned_source = self.loader.get_source(self.name)
+ self.assertEqual(returned_source, source)
+ source = "# coding: latin-1\n_ = ü"
+ self.loader.source = source.encode('latin-1')
+ returned_source = self.loader.get_source(self.name)
+ self.assertEqual(returned_source, source)
+
+
+@unittest.skipIf(sys.dont_write_bytecode, "sys.dont_write_bytecode is true")
+class SourceLoaderBytecodeTests(SourceLoaderTestHarness):
+
+ """Test importlib.abc.SourceLoader's use of bytecode.
+
+ Source-only testing handled by SourceOnlyLoaderTests.
+
+ """
+
+ loader_mock = SourceLoaderMock
+
+ def verify_code(self, code_object, *, bytecode_written=False):
+ super().verify_code(code_object)
+ if bytecode_written:
+ self.assertIn(self.cached, self.loader.written)
+ data = bytearray(imp.get_magic())
+ data.extend(marshal._w_long(self.loader.source_mtime))
+ data.extend(marshal.dumps(code_object))
+ self.assertEqual(self.loader.written[self.cached], bytes(data))
+
+ def test_code_with_everything(self):
+ # When everything should work.
+ code_object = self.loader.get_code(self.name)
+ self.verify_code(code_object)
+
+ def test_no_bytecode(self):
+ # If no bytecode exists then move on to the source.
+ self.loader.bytecode_path = "<does not exist>"
+ # Sanity check
+ with self.assertRaises(IOError):
+ bytecode_path = imp.cache_from_source(self.path)
+ self.loader.get_data(bytecode_path)
+ code_object = self.loader.get_code(self.name)
+ self.verify_code(code_object, bytecode_written=True)
+
+ def test_code_bad_timestamp(self):
+ # Bytecode is only used when the timestamp matches the source EXACTLY.
+ for source_mtime in (0, 2):
+ assert source_mtime != self.loader.source_mtime
+ original = self.loader.source_mtime
+ self.loader.source_mtime = source_mtime
+ # If bytecode is used then EOFError would be raised by marshal.
+ self.loader.bytecode = self.loader.bytecode[8:]
+ code_object = self.loader.get_code(self.name)
+ self.verify_code(code_object, bytecode_written=True)
+ self.loader.source_mtime = original
+
+ def test_code_bad_magic(self):
+ # Skip over bytecode with a bad magic number.
+ self.setUp(magic=b'0000')
+ # If bytecode is used then EOFError would be raised by marshal.
+ self.loader.bytecode = self.loader.bytecode[8:]
+ code_object = self.loader.get_code(self.name)
+ self.verify_code(code_object, bytecode_written=True)
+
+ def test_dont_write_bytecode(self):
+ # Bytecode is not written if sys.dont_write_bytecode is true.
+ # Can assume it is false already thanks to the skipIf class decorator.
+ try:
+ sys.dont_write_bytecode = True
+ self.loader.bytecode_path = "<does not exist>"
+ code_object = self.loader.get_code(self.name)
+ self.assertNotIn(self.cached, self.loader.written)
+ finally:
+ sys.dont_write_bytecode = False
+
+ def test_no_set_data(self):
+ # If set_data is not defined, one can still read bytecode.
+ self.setUp(magic=b'0000')
+ original_set_data = self.loader.__class__.set_data
+ try:
+ del self.loader.__class__.set_data
+ code_object = self.loader.get_code(self.name)
+ self.verify_code(code_object)
+ finally:
+ self.loader.__class__.set_data = original_set_data
+
+ def test_set_data_raises_exceptions(self):
+ # Raising NotImplementedError or IOError is okay for set_data.
+ def raise_exception(exc):
+ def closure(*args, **kwargs):
+ raise exc
+ return closure
+
+ self.setUp(magic=b'0000')
+ self.loader.set_data = raise_exception(NotImplementedError)
+ code_object = self.loader.get_code(self.name)
+ self.verify_code(code_object)
+
+
+class SourceLoaderGetSourceTests(unittest.TestCase):
+
+ """Tests for importlib.abc.SourceLoader.get_source()."""
+
+ def test_default_encoding(self):
+ # Should have no problems with UTF-8 text.
+ name = 'mod'
+ mock = SourceOnlyLoaderMock('mod.file')
+ source = 'x = "ü"'
+ mock.source = source.encode('utf-8')
+ returned_source = mock.get_source(name)
+ self.assertEqual(returned_source, source)
+
+ def test_decoded_source(self):
+ # Decoding should work.
+ name = 'mod'
+ mock = SourceOnlyLoaderMock("mod.file")
+ source = "# coding: Latin-1\nx='ü'"
+ assert source.encode('latin-1') != source.encode('utf-8')
+ mock.source = source.encode('latin-1')
+ returned_source = mock.get_source(name)
+ self.assertEqual(returned_source, source)
+
+ def test_universal_newlines(self):
+ # PEP 302 says universal newlines should be used.
+ name = 'mod'
+ mock = SourceOnlyLoaderMock('mod.file')
+ source = "x = 42\r\ny = -13\r\n"
+ mock.source = source.encode('utf-8')
+ expect = io.IncrementalNewlineDecoder(None, True).decode(source)
+ self.assertEqual(mock.get_source(name), expect)
+
+class AbstractMethodImplTests(unittest.TestCase):
+
+ """Test the concrete abstractmethod implementations."""
+
+ class Loader(abc.Loader):
+ def load_module(self, fullname):
+ super().load_module(fullname)
+
+ class Finder(abc.Finder):
+ def find_module(self, _):
+ super().find_module(_)
+
+ class ResourceLoader(Loader, abc.ResourceLoader):
+ def get_data(self, _):
+ super().get_data(_)
+
+ class InspectLoader(Loader, abc.InspectLoader):
+ def is_package(self, _):
+ super().is_package(_)
+
+ def get_code(self, _):
+ super().get_code(_)
+
+ def get_source(self, _):
+ super().get_source(_)
+
+ class ExecutionLoader(InspectLoader, abc.ExecutionLoader):
+ def get_filename(self, _):
+ super().get_filename(_)
+
+ class SourceLoader(ResourceLoader, ExecutionLoader, abc.SourceLoader):
+ pass
+
+ class PyLoader(ResourceLoader, InspectLoader, abc.PyLoader):
+ def source_path(self, _):
+ super().source_path(_)
+
+ class PyPycLoader(PyLoader, abc.PyPycLoader):
+ def bytecode_path(self, _):
+ super().bytecode_path(_)
+
+ def source_mtime(self, _):
+ super().source_mtime(_)
+
+ def write_bytecode(self, _, _2):
+ super().write_bytecode(_, _2)
+
+ def raises_NotImplementedError(self, ins, *args):
+ for method_name in args:
+ method = getattr(ins, method_name)
+ arg_count = len(inspect.getfullargspec(method)[0]) - 1
+ args = [''] * arg_count
+ try:
+ method(*args)
+ except NotImplementedError:
+ pass
+ else:
+ msg = "{}.{} did not raise NotImplementedError"
+ self.fail(msg.format(ins.__class__.__name__, method_name))
+
+ def test_Loader(self):
+ self.raises_NotImplementedError(self.Loader(), 'load_module')
+
+ # XXX misplaced; should be somewhere else
+ def test_Finder(self):
+ self.raises_NotImplementedError(self.Finder(), 'find_module')
+
+ def test_ResourceLoader(self):
+ self.raises_NotImplementedError(self.ResourceLoader(), 'load_module',
+ 'get_data')
+
+ def test_InspectLoader(self):
+ self.raises_NotImplementedError(self.InspectLoader(), 'load_module',
+ 'is_package', 'get_code', 'get_source')
+
+ def test_ExecutionLoader(self):
+ self.raises_NotImplementedError(self.ExecutionLoader(), 'load_module',
+ 'is_package', 'get_code', 'get_source',
+ 'get_filename')
+
+ def test_SourceLoader(self):
+ ins = self.SourceLoader()
+ # Required abstractmethods.
+ self.raises_NotImplementedError(ins, 'get_filename', 'get_data')
+ # Optional abstractmethods.
+ self.raises_NotImplementedError(ins,'path_mtime', 'set_data')
+
+ def test_PyLoader(self):
+ self.raises_NotImplementedError(self.PyLoader(), 'source_path',
+ 'get_data', 'is_package')
+
+ def test_PyPycLoader(self):
+ self.raises_NotImplementedError(self.PyPycLoader(), 'source_path',
+ 'source_mtime', 'bytecode_path',
+ 'write_bytecode')
def test_main():
from test.support import run_unittest
- run_unittest(PyLoaderTests, PyLoaderInterfaceTests, PyLoaderGetSourceTests,
- PyPycLoaderTests, SkipWritingBytecodeTests,
- RegeneratedBytecodeTests, BadBytecodeFailureTests,
- MissingPathsTests)
+ run_unittest(PyLoaderTests, PyLoaderCompatTests,
+ PyLoaderInterfaceTests,
+ PyPycLoaderTests, PyPycLoaderInterfaceTests,
+ SkipWritingBytecodeTests, RegeneratedBytecodeTests,
+ BadBytecodeFailureTests, MissingPathsTests,
+ SourceOnlyLoaderTests,
+ SourceLoaderBytecodeTests,
+ SourceLoaderGetSourceTests,
+ AbstractMethodImplTests)
if __name__ == '__main__':
diff --git a/Lib/importlib/test/source/test_case_sensitivity.py b/Lib/importlib/test/source/test_case_sensitivity.py
index 6fad881846..73777de4ba 100644
--- a/Lib/importlib/test/source/test_case_sensitivity.py
+++ b/Lib/importlib/test/source/test_case_sensitivity.py
@@ -19,7 +19,9 @@ class CaseSensitivityTest(unittest.TestCase):
assert name != name.lower()
def find(self, path):
- finder = _bootstrap._PyPycFileFinder(path)
+ finder = _bootstrap._FileFinder(path,
+ _bootstrap._SourceFinderDetails(),
+ _bootstrap._SourcelessFinderDetails())
return finder.find_module(self.name)
def sensitivity_test(self):
@@ -27,7 +29,7 @@ class CaseSensitivityTest(unittest.TestCase):
sensitive_pkg = 'sensitive.{0}'.format(self.name)
insensitive_pkg = 'insensitive.{0}'.format(self.name.lower())
context = source_util.create_modules(insensitive_pkg, sensitive_pkg)
- with context as mapping:
+ with context as mapping:
sensitive_path = os.path.join(mapping['.root'], 'sensitive')
insensitive_path = os.path.join(mapping['.root'], 'insensitive')
return self.find(sensitive_path), self.find(insensitive_path)
@@ -37,7 +39,7 @@ class CaseSensitivityTest(unittest.TestCase):
env.unset('PYTHONCASEOK')
sensitive, insensitive = self.sensitivity_test()
self.assertTrue(hasattr(sensitive, 'load_module'))
- self.assertIn(self.name, sensitive._base_path)
+ self.assertIn(self.name, sensitive.get_filename(self.name))
self.assertIsNone(insensitive)
def test_insensitive(self):
@@ -45,9 +47,9 @@ class CaseSensitivityTest(unittest.TestCase):
env.set('PYTHONCASEOK', '1')
sensitive, insensitive = self.sensitivity_test()
self.assertTrue(hasattr(sensitive, 'load_module'))
- self.assertIn(self.name, sensitive._base_path)
+ self.assertIn(self.name, sensitive.get_filename(self.name))
self.assertTrue(hasattr(insensitive, 'load_module'))
- self.assertIn(self.name, insensitive._base_path)
+ self.assertIn(self.name, insensitive.get_filename(self.name))
def test_main():
diff --git a/Lib/importlib/test/source/test_file_loader.py b/Lib/importlib/test/source/test_file_loader.py
index 145d07607b..0ffe78dfa1 100644
--- a/Lib/importlib/test/source/test_file_loader.py
+++ b/Lib/importlib/test/source/test_file_loader.py
@@ -1,15 +1,20 @@
import importlib
from importlib import _bootstrap
from .. import abc
+from .. import util
from . import util as source_util
import imp
+import marshal
import os
import py_compile
+import shutil
import stat
import sys
import unittest
+from test.support import make_legacy_pyc
+
class SimpleTest(unittest.TestCase):
@@ -21,8 +26,7 @@ class SimpleTest(unittest.TestCase):
# [basic]
def test_module(self):
with source_util.create_modules('_temp') as mapping:
- loader = _bootstrap._PyPycFileLoader('_temp', mapping['_temp'],
- False)
+ loader = _bootstrap._SourceFileLoader('_temp', mapping['_temp'])
module = loader.load_module('_temp')
self.assertTrue('_temp' in sys.modules)
check = {'__name__': '_temp', '__file__': mapping['_temp'],
@@ -32,9 +36,8 @@ class SimpleTest(unittest.TestCase):
def test_package(self):
with source_util.create_modules('_pkg.__init__') as mapping:
- loader = _bootstrap._PyPycFileLoader('_pkg',
- mapping['_pkg.__init__'],
- True)
+ loader = _bootstrap._SourceFileLoader('_pkg',
+ mapping['_pkg.__init__'])
module = loader.load_module('_pkg')
self.assertTrue('_pkg' in sys.modules)
check = {'__name__': '_pkg', '__file__': mapping['_pkg.__init__'],
@@ -46,8 +49,8 @@ class SimpleTest(unittest.TestCase):
def test_lacking_parent(self):
with source_util.create_modules('_pkg.__init__', '_pkg.mod')as mapping:
- loader = _bootstrap._PyPycFileLoader('_pkg.mod',
- mapping['_pkg.mod'], False)
+ loader = _bootstrap._SourceFileLoader('_pkg.mod',
+ mapping['_pkg.mod'])
module = loader.load_module('_pkg.mod')
self.assertTrue('_pkg.mod' in sys.modules)
check = {'__name__': '_pkg.mod', '__file__': mapping['_pkg.mod'],
@@ -61,8 +64,7 @@ class SimpleTest(unittest.TestCase):
def test_module_reuse(self):
with source_util.create_modules('_temp') as mapping:
- loader = _bootstrap._PyPycFileLoader('_temp', mapping['_temp'],
- False)
+ loader = _bootstrap._SourceFileLoader('_temp', mapping['_temp'])
module = loader.load_module('_temp')
module_id = id(module)
module_dict_id = id(module.__dict__)
@@ -72,7 +74,7 @@ class SimpleTest(unittest.TestCase):
# everything that has happened above can be too fast;
# force an mtime on the source that is guaranteed to be different
# than the original mtime.
- loader.source_mtime = self.fake_mtime(loader.source_mtime)
+ loader.path_mtime = self.fake_mtime(loader.path_mtime)
module = loader.load_module('_temp')
self.assertTrue('testing_var' in module.__dict__,
"'testing_var' not in "
@@ -92,9 +94,9 @@ class SimpleTest(unittest.TestCase):
setattr(orig_module, attr, value)
with open(mapping[name], 'w') as file:
file.write('+++ bad syntax +++')
- loader = _bootstrap._PyPycFileLoader('_temp', mapping['_temp'],
- False)
- self.assertRaises(SyntaxError, loader.load_module, name)
+ loader = _bootstrap._SourceFileLoader('_temp', mapping['_temp'])
+ with self.assertRaises(SyntaxError):
+ loader.load_module(name)
for attr in attributes:
self.assertEqual(getattr(orig_module, attr), value)
@@ -103,16 +105,34 @@ class SimpleTest(unittest.TestCase):
with source_util.create_modules('_temp') as mapping:
with open(mapping['_temp'], 'w') as file:
file.write('=')
- loader = _bootstrap._PyPycFileLoader('_temp', mapping['_temp'],
- False)
- self.assertRaises(SyntaxError, loader.load_module, '_temp')
+ loader = _bootstrap._SourceFileLoader('_temp', mapping['_temp'])
+ with self.assertRaises(SyntaxError):
+ loader.load_module('_temp')
self.assertTrue('_temp' not in sys.modules)
+ def test_file_from_empty_string_dir(self):
+ # Loading a module found from an empty string entry on sys.path should
+ # not only work, but keep all attributes relative.
+ file_path = '_temp.py'
+ with open(file_path, 'w') as file:
+ file.write("# test file for importlib")
+ try:
+ with util.uncache('_temp'):
+ loader = _bootstrap._SourceFileLoader('_temp', file_path)
+ mod = loader.load_module('_temp')
+ self.assertEqual(file_path, mod.__file__)
+ self.assertEqual(imp.cache_from_source(file_path),
+ mod.__cached__)
+ finally:
+ os.unlink(file_path)
+ pycache = os.path.dirname(imp.cache_from_source(file_path))
+ shutil.rmtree(pycache)
+
class BadBytecodeTest(unittest.TestCase):
def import_(self, file, module_name):
- loader = _bootstrap._PyPycFileLoader(module_name, file, False)
+ loader = self.loader(module_name, file)
module = loader.load_module(module_name)
self.assertTrue(module_name in sys.modules)
@@ -125,106 +145,162 @@ class BadBytecodeTest(unittest.TestCase):
except KeyError:
pass
py_compile.compile(mapping[name])
- bytecode_path = source_util.bytecode_path(mapping[name])
- with open(bytecode_path, 'rb') as file:
- bc = file.read()
- new_bc = manipulator(bc)
- with open(bytecode_path, 'wb') as file:
- if new_bc:
- file.write(new_bc)
- if del_source:
+ if not del_source:
+ bytecode_path = imp.cache_from_source(mapping[name])
+ else:
os.unlink(mapping[name])
+ bytecode_path = make_legacy_pyc(mapping[name])
+ if manipulator:
+ with open(bytecode_path, 'rb') as file:
+ bc = file.read()
+ new_bc = manipulator(bc)
+ with open(bytecode_path, 'wb') as file:
+ if new_bc is not None:
+ file.write(new_bc)
return bytecode_path
- @source_util.writes_bytecode_files
- def test_empty_file(self):
- # When a .pyc is empty, regenerate it if possible, else raise
- # ImportError.
+ def _test_empty_file(self, test, *, del_source=False):
with source_util.create_modules('_temp') as mapping:
bc_path = self.manipulate_bytecode('_temp', mapping,
- lambda bc: None)
- self.import_(mapping['_temp'], '_temp')
- with open(bc_path, 'rb') as file:
- self.assertGreater(len(file.read()), 8)
- self.manipulate_bytecode('_temp', mapping, lambda bc: None,
- del_source=True)
- with self.assertRaises(ImportError):
- self.import_(mapping['_temp'], '_temp')
+ lambda bc: b'',
+ del_source=del_source)
+ test('_temp', mapping, bc_path)
@source_util.writes_bytecode_files
- def test_partial_magic(self):
+ def _test_partial_magic(self, test, *, del_source=False):
# When their are less than 4 bytes to a .pyc, regenerate it if
# possible, else raise ImportError.
with source_util.create_modules('_temp') as mapping:
bc_path = self.manipulate_bytecode('_temp', mapping,
- lambda bc: bc[:3])
- self.import_(mapping['_temp'], '_temp')
- with open(bc_path, 'rb') as file:
- self.assertGreater(len(file.read()), 8)
- self.manipulate_bytecode('_temp', mapping, lambda bc: bc[:3],
- del_source=True)
+ lambda bc: bc[:3],
+ del_source=del_source)
+ test('_temp', mapping, bc_path)
+
+ def _test_magic_only(self, test, *, del_source=False):
+ with source_util.create_modules('_temp') as mapping:
+ bc_path = self.manipulate_bytecode('_temp', mapping,
+ lambda bc: bc[:4],
+ del_source=del_source)
+ test('_temp', mapping, bc_path)
+
+ def _test_partial_timestamp(self, test, *, del_source=False):
+ with source_util.create_modules('_temp') as mapping:
+ bc_path = self.manipulate_bytecode('_temp', mapping,
+ lambda bc: bc[:7],
+ del_source=del_source)
+ test('_temp', mapping, bc_path)
+
+ def _test_no_marshal(self, *, del_source=False):
+ with source_util.create_modules('_temp') as mapping:
+ bc_path = self.manipulate_bytecode('_temp', mapping,
+ lambda bc: bc[:8],
+ del_source=del_source)
+ file_path = mapping['_temp'] if not del_source else bc_path
+ with self.assertRaises(EOFError):
+ self.import_(file_path, '_temp')
+
+ def _test_non_code_marshal(self, *, del_source=False):
+ with source_util.create_modules('_temp') as mapping:
+ bytecode_path = self.manipulate_bytecode('_temp', mapping,
+ lambda bc: bc[:8] + marshal.dumps(b'abcd'),
+ del_source=del_source)
+ file_path = mapping['_temp'] if not del_source else bytecode_path
with self.assertRaises(ImportError):
- self.import_(mapping['_temp'], '_temp')
+ self.import_(file_path, '_temp')
+
+ def _test_bad_marshal(self, *, del_source=False):
+ with source_util.create_modules('_temp') as mapping:
+ bytecode_path = self.manipulate_bytecode('_temp', mapping,
+ lambda bc: bc[:8] + b'<test>',
+ del_source=del_source)
+ file_path = mapping['_temp'] if not del_source else bytecode_path
+ with self.assertRaises(ValueError):
+ self.import_(file_path, '_temp')
+
+ def _test_bad_magic(self, test, *, del_source=False):
+ with source_util.create_modules('_temp') as mapping:
+ bc_path = self.manipulate_bytecode('_temp', mapping,
+ lambda bc: b'\x00\x00\x00\x00' + bc[4:])
+ test('_temp', mapping, bc_path)
+
+
+class SourceLoaderBadBytecodeTest(BadBytecodeTest):
+
+ loader = _bootstrap._SourceFileLoader
+
+ @source_util.writes_bytecode_files
+ def test_empty_file(self):
+ # When a .pyc is empty, regenerate it if possible, else raise
+ # ImportError.
+ def test(name, mapping, bytecode_path):
+ self.import_(mapping[name], name)
+ with open(bytecode_path, 'rb') as file:
+ self.assertGreater(len(file.read()), 8)
+
+ self._test_empty_file(test)
+
+ def test_partial_magic(self):
+ def test(name, mapping, bytecode_path):
+ self.import_(mapping[name], name)
+ with open(bytecode_path, 'rb') as file:
+ self.assertGreater(len(file.read()), 8)
+
+ self._test_partial_magic(test)
@source_util.writes_bytecode_files
def test_magic_only(self):
# When there is only the magic number, regenerate the .pyc if possible,
# else raise EOFError.
- with source_util.create_modules('_temp') as mapping:
- bc_path = self.manipulate_bytecode('_temp', mapping,
- lambda bc: bc[:4])
- self.import_(mapping['_temp'], '_temp')
- with open(bc_path, 'rb') as file:
+ def test(name, mapping, bytecode_path):
+ self.import_(mapping[name], name)
+ with open(bytecode_path, 'rb') as file:
self.assertGreater(len(file.read()), 8)
- self.manipulate_bytecode('_temp', mapping, lambda bc: bc[:4],
- del_source=True)
- with self.assertRaises(EOFError):
- self.import_(mapping['_temp'], '_temp')
+
+ @source_util.writes_bytecode_files
+ def test_bad_magic(self):
+ # When the magic number is different, the bytecode should be
+ # regenerated.
+ def test(name, mapping, bytecode_path):
+ self.import_(mapping[name], name)
+ with open(bytecode_path, 'rb') as bytecode_file:
+ self.assertEqual(bytecode_file.read(4), imp.get_magic())
+
+ self._test_bad_magic(test)
@source_util.writes_bytecode_files
def test_partial_timestamp(self):
# When the timestamp is partial, regenerate the .pyc, else
# raise EOFError.
- with source_util.create_modules('_temp') as mapping:
- bc_path = self.manipulate_bytecode('_temp', mapping,
- lambda bc: bc[:7])
- self.import_(mapping['_temp'], '_temp')
+ def test(name, mapping, bc_path):
+ self.import_(mapping[name], name)
with open(bc_path, 'rb') as file:
self.assertGreater(len(file.read()), 8)
- self.manipulate_bytecode('_temp', mapping, lambda bc: bc[:7],
- del_source=True)
- with self.assertRaises(EOFError):
- self.import_(mapping['_temp'], '_temp')
@source_util.writes_bytecode_files
def test_no_marshal(self):
# When there is only the magic number and timestamp, raise EOFError.
- with source_util.create_modules('_temp') as mapping:
- bc_path = self.manipulate_bytecode('_temp', mapping,
- lambda bc: bc[:8])
- with self.assertRaises(EOFError):
- self.import_(mapping['_temp'], '_temp')
+ self._test_no_marshal()
@source_util.writes_bytecode_files
- def test_bad_magic(self):
- # When the magic number is different, the bytecode should be
- # regenerated.
- with source_util.create_modules('_temp') as mapping:
- bc_path = self.manipulate_bytecode('_temp', mapping,
- lambda bc: b'\x00\x00\x00\x00' + bc[4:])
- self.import_(mapping['_temp'], '_temp')
- with open(bc_path, 'rb') as bytecode_file:
- self.assertEqual(bytecode_file.read(4), imp.get_magic())
+ def test_non_code_marshal(self):
+ self._test_non_code_marshal()
+ # XXX ImportError when sourceless
+
+ # [bad marshal]
+ @source_util.writes_bytecode_files
+ def test_bad_marshal(self):
+ # Bad marshal data should raise a ValueError.
+ self._test_bad_marshal()
# [bad timestamp]
@source_util.writes_bytecode_files
- def test_bad_bytecode(self):
+ def test_old_timestamp(self):
# When the timestamp is older than the source, bytecode should be
# regenerated.
zeros = b'\x00\x00\x00\x00'
with source_util.create_modules('_temp') as mapping:
py_compile.compile(mapping['_temp'])
- bytecode_path = source_util.bytecode_path(mapping['_temp'])
+ bytecode_path = imp.cache_from_source(mapping['_temp'])
with open(bytecode_path, 'r+b') as bytecode_file:
bytecode_file.seek(4)
bytecode_file.write(zeros)
@@ -235,22 +311,6 @@ class BadBytecodeTest(unittest.TestCase):
bytecode_file.seek(4)
self.assertEqual(bytecode_file.read(4), source_timestamp)
- # [bad marshal]
- @source_util.writes_bytecode_files
- def test_bad_marshal(self):
- # Bad marshal data should raise a ValueError.
- with source_util.create_modules('_temp') as mapping:
- bytecode_path = source_util.bytecode_path(mapping['_temp'])
- source_mtime = os.path.getmtime(mapping['_temp'])
- source_timestamp = importlib._w_long(source_mtime)
- with open(bytecode_path, 'wb') as bytecode_file:
- bytecode_file.write(imp.get_magic())
- bytecode_file.write(source_timestamp)
- bytecode_file.write(b'AAAA')
- self.assertRaises(ValueError, self.import_, mapping['_temp'],
- '_temp')
- self.assertTrue('_temp' not in sys.modules)
-
# [bytecode read-only]
@source_util.writes_bytecode_files
def test_read_only_bytecode(self):
@@ -258,7 +318,7 @@ class BadBytecodeTest(unittest.TestCase):
with source_util.create_modules('_temp') as mapping:
# Create bytecode that will need to be re-created.
py_compile.compile(mapping['_temp'])
- bytecode_path = source_util.bytecode_path(mapping['_temp'])
+ bytecode_path = imp.cache_from_source(mapping['_temp'])
with open(bytecode_path, 'r+b') as bytecode_file:
bytecode_file.seek(0)
bytecode_file.write(b'\x00\x00\x00\x00')
@@ -273,9 +333,57 @@ class BadBytecodeTest(unittest.TestCase):
os.chmod(bytecode_path, stat.S_IWUSR)
+class SourcelessLoaderBadBytecodeTest(BadBytecodeTest):
+
+ loader = _bootstrap._SourcelessFileLoader
+
+ def test_empty_file(self):
+ def test(name, mapping, bytecode_path):
+ with self.assertRaises(ImportError):
+ self.import_(bytecode_path, name)
+
+ self._test_empty_file(test, del_source=True)
+
+ def test_partial_magic(self):
+ def test(name, mapping, bytecode_path):
+ with self.assertRaises(ImportError):
+ self.import_(bytecode_path, name)
+ self._test_partial_magic(test, del_source=True)
+
+ def test_magic_only(self):
+ def test(name, mapping, bytecode_path):
+ with self.assertRaises(EOFError):
+ self.import_(bytecode_path, name)
+
+ self._test_magic_only(test, del_source=True)
+
+ def test_bad_magic(self):
+ def test(name, mapping, bytecode_path):
+ with self.assertRaises(ImportError):
+ self.import_(bytecode_path, name)
+
+ self._test_bad_magic(test, del_source=True)
+
+ def test_partial_timestamp(self):
+ def test(name, mapping, bytecode_path):
+ with self.assertRaises(EOFError):
+ self.import_(bytecode_path, name)
+
+ self._test_partial_timestamp(test, del_source=True)
+
+ def test_no_marshal(self):
+ self._test_no_marshal(del_source=True)
+
+ def test_non_code_marshal(self):
+ self._test_non_code_marshal(del_source=True)
+
+
def test_main():
from test.support import run_unittest
- run_unittest(SimpleTest, BadBytecodeTest)
+ run_unittest(SimpleTest,
+ SourceLoaderBadBytecodeTest,
+ SourcelessLoaderBadBytecodeTest
+ )
if __name__ == '__main__':
diff --git a/Lib/importlib/test/source/test_finder.py b/Lib/importlib/test/source/test_finder.py
index c495c5a90a..7b9088da0c 100644
--- a/Lib/importlib/test/source/test_finder.py
+++ b/Lib/importlib/test/source/test_finder.py
@@ -1,7 +1,9 @@
from importlib import _bootstrap
from .. import abc
from . import util as source_util
+from test.support import make_legacy_pyc
import os
+import errno
import py_compile
import unittest
import warnings
@@ -32,7 +34,9 @@ class FinderTests(abc.FinderTests):
"""
def import_(self, root, module):
- finder = _bootstrap._PyPycFileFinder(root)
+ finder = _bootstrap._FileFinder(root,
+ _bootstrap._SourceFinderDetails(),
+ _bootstrap._SourcelessFinderDetails())
return finder.find_module(module)
def run_test(self, test, create=None, *, compile_=None, unlink=None):
@@ -52,6 +56,14 @@ class FinderTests(abc.FinderTests):
if unlink:
for name in unlink:
os.unlink(mapping[name])
+ try:
+ make_legacy_pyc(mapping[name])
+ except OSError as error:
+ # Some tests do not set compile_=True so the source
+ # module will not get compiled and there will be no
+ # PEP 3147 pyc file to rename.
+ if error.errno != errno.ENOENT:
+ raise
loader = self.import_(mapping['.root'], test)
self.assertTrue(hasattr(loader, 'load_module'))
return loader
@@ -60,7 +72,8 @@ class FinderTests(abc.FinderTests):
# [top-level source]
self.run_test('top_level')
# [top-level bc]
- self.run_test('top_level', compile_={'top_level'}, unlink={'top_level'})
+ self.run_test('top_level', compile_={'top_level'},
+ unlink={'top_level'})
# [top-level both]
self.run_test('top_level', compile_={'top_level'})
@@ -97,15 +110,14 @@ class FinderTests(abc.FinderTests):
with context as mapping:
os.unlink(mapping['pkg.sub.__init__'])
pkg_dir = os.path.dirname(mapping['pkg.__init__'])
- self.assertRaises(ImportWarning, self.import_, pkg_dir,
- 'pkg.sub')
+ with self.assertRaises(ImportWarning):
+ self.import_(pkg_dir, 'pkg.sub')
# [package over modules]
def test_package_over_module(self):
- # XXX This is not a blackbox test!
name = '_temp'
loader = self.run_test(name, {'{0}.__init__'.format(name), name})
- self.assertTrue('__init__' in loader._base_path)
+ self.assertTrue('__init__' in loader.get_filename(name))
def test_failure(self):
@@ -117,8 +129,19 @@ class FinderTests(abc.FinderTests):
def test_empty_dir(self):
with warnings.catch_warnings():
warnings.simplefilter("error", ImportWarning)
- self.assertRaises(ImportWarning, self.run_test, 'pkg',
- {'pkg.__init__'}, unlink={'pkg.__init__'})
+ with self.assertRaises(ImportWarning):
+ self.run_test('pkg', {'pkg.__init__'}, unlink={'pkg.__init__'})
+
+ def test_empty_string_for_dir(self):
+ # The empty string from sys.path means to search in the cwd.
+ finder = _bootstrap._FileFinder('', _bootstrap._SourceFinderDetails())
+ with open('mod.py', 'w') as file:
+ file.write("# test file for importlib")
+ try:
+ loader = finder.find_module('mod')
+ self.assertTrue(hasattr(loader, 'load_module'))
+ finally:
+ os.unlink('mod.py')
def test_main():
diff --git a/Lib/importlib/test/source/test_path_hook.py b/Lib/importlib/test/source/test_path_hook.py
index 3efb3bea10..374f7b6ad3 100644
--- a/Lib/importlib/test/source/test_path_hook.py
+++ b/Lib/importlib/test/source/test_path_hook.py
@@ -8,11 +8,14 @@ class PathHookTest(unittest.TestCase):
"""Test the path hook for source."""
def test_success(self):
- # XXX Only work on existing directories?
with source_util.create_modules('dummy') as mapping:
- self.assertTrue(hasattr(_bootstrap._FileFinder(mapping['.root']),
+ self.assertTrue(hasattr(_bootstrap._file_path_hook(mapping['.root']),
'find_module'))
+ def test_empty_string(self):
+ # The empty string represents the cwd.
+ self.assertTrue(hasattr(_bootstrap._file_path_hook(''), 'find_module'))
+
def test_main():
from test.support import run_unittest
diff --git a/Lib/importlib/test/source/test_source_encoding.py b/Lib/importlib/test/source/test_source_encoding.py
index 373471284c..794a3df246 100644
--- a/Lib/importlib/test/source/test_source_encoding.py
+++ b/Lib/importlib/test/source/test_source_encoding.py
@@ -33,10 +33,10 @@ class EncodingTest(unittest.TestCase):
def run_test(self, source):
with source_util.create_modules(self.module_name) as mapping:
- with open(mapping[self.module_name], 'wb')as file:
+ with open(mapping[self.module_name], 'wb') as file:
file.write(source)
- loader = _bootstrap._PyPycFileLoader(self.module_name,
- mapping[self.module_name], False)
+ loader = _bootstrap._SourceFileLoader(self.module_name,
+ mapping[self.module_name])
return loader.load_module(self.module_name)
def create_source(self, encoding):
@@ -81,7 +81,8 @@ class EncodingTest(unittest.TestCase):
# [BOM conflict]
def test_bom_conflict(self):
source = codecs.BOM_UTF8 + self.create_source('latin-1')
- self.assertRaises(SyntaxError, self.run_test, source)
+ with self.assertRaises(SyntaxError):
+ self.run_test(source)
class LineEndingTest(unittest.TestCase):
@@ -96,8 +97,8 @@ class LineEndingTest(unittest.TestCase):
with source_util.create_modules(module_name) as mapping:
with open(mapping[module_name], 'wb') as file:
file.write(source)
- loader = _bootstrap._PyPycFileLoader(module_name,
- mapping[module_name], False)
+ loader = _bootstrap._SourceFileLoader(module_name,
+ mapping[module_name])
return loader.load_module(module_name)
# [cr]
diff --git a/Lib/importlib/test/source/util.py b/Lib/importlib/test/source/util.py
index 2b945c5936..ae65663a67 100644
--- a/Lib/importlib/test/source/util.py
+++ b/Lib/importlib/test/source/util.py
@@ -1,5 +1,6 @@
from .. import util
import contextlib
+import errno
import functools
import imp
import os
@@ -26,14 +27,16 @@ def writes_bytecode_files(fxn):
return wrapper
-def bytecode_path(source_path):
- for suffix, _, type_ in imp.get_suffixes():
- if type_ == imp.PY_COMPILED:
- bc_suffix = suffix
- break
- else:
- raise ValueError("no bytecode suffix is defined")
- return os.path.splitext(source_path)[0] + bc_suffix
+def ensure_bytecode_path(bytecode_path):
+ """Ensure that the __pycache__ directory for PEP 3147 pyc file exists.
+
+ :param bytecode_path: File system path to PEP 3147 pyc file.
+ """
+ try:
+ os.mkdir(os.path.dirname(bytecode_path))
+ except OSError as error:
+ if error.errno != errno.EEXIST:
+ raise
@contextlib.contextmanager
diff --git a/Lib/importlib/test/test_abc.py b/Lib/importlib/test/test_abc.py
index 6e09534d8c..0ecbe390ad 100644
--- a/Lib/importlib/test/test_abc.py
+++ b/Lib/importlib/test/test_abc.py
@@ -53,9 +53,20 @@ class InspectLoader(InheritanceTests, unittest.TestCase):
machinery.FrozenImporter]
+class ExecutionLoader(InheritanceTests, unittest.TestCase):
+
+ superclasses = [abc.InspectLoader]
+ subclasses = [abc.PyLoader]
+
+
+class SourceLoader(InheritanceTests, unittest.TestCase):
+
+ superclasses = [abc.ResourceLoader, abc.ExecutionLoader]
+
+
class PyLoader(InheritanceTests, unittest.TestCase):
- superclasses = [abc.Loader, abc.ResourceLoader, abc.InspectLoader]
+ superclasses = [abc.Loader, abc.ResourceLoader, abc.ExecutionLoader]
class PyPycLoader(InheritanceTests, unittest.TestCase):
diff --git a/Lib/importlib/test/test_api.py b/Lib/importlib/test/test_api.py
index 65f8d04797..0ffa3c4d80 100644
--- a/Lib/importlib/test/test_api.py
+++ b/Lib/importlib/test/test_api.py
@@ -27,7 +27,7 @@ class ImportModuleTests(unittest.TestCase):
self.assertEqual(module.__name__, name)
def test_shallow_relative_package_import(self):
- # Test importing a module from a package through a relatve import.
+ # Test importing a module from a package through a relative import.
pkg_name = 'pkg'
pkg_long_name = '{0}.__init__'.format(pkg_name)
module_name = 'mod'
@@ -63,7 +63,8 @@ class ImportModuleTests(unittest.TestCase):
def test_relative_import_wo_package(self):
# Relative imports cannot happen without the 'package' argument being
# set.
- self.assertRaises(TypeError, importlib.import_module, '.support')
+ with self.assertRaises(TypeError):
+ importlib.import_module('.support')
def test_main():
diff --git a/Lib/importlib/test/test_util.py b/Lib/importlib/test/test_util.py
index 406477dd42..602447f09e 100644
--- a/Lib/importlib/test/test_util.py
+++ b/Lib/importlib/test/test_util.py
@@ -40,7 +40,7 @@ class ModuleForLoaderTests(unittest.TestCase):
with test_util.uncache(name):
sys.modules[name] = module
returned_module = self.return_module(name)
- self.assertTrue(sys.modules[name] is returned_module)
+ self.assertIs(returned_module, sys.modules[name])
def test_new_module_failure(self):
# Test that a module is removed from sys.modules if added but an
@@ -57,7 +57,7 @@ class ModuleForLoaderTests(unittest.TestCase):
with test_util.uncache(name):
sys.modules[name] = module
self.raise_exception(name)
- self.assertTrue(sys.modules[name] is module)
+ self.assertIs(module, sys.modules[name])
class SetPackageTests(unittest.TestCase):
diff --git a/Lib/importlib/test/util.py b/Lib/importlib/test/util.py
index 845e380bee..0c0c84c310 100644
--- a/Lib/importlib/test/util.py
+++ b/Lib/importlib/test/util.py
@@ -6,21 +6,22 @@ import unittest
import sys
-def case_insensitive_tests(class_):
+CASE_INSENSITIVE_FS = True
+# Windows is the only OS that is *always* case-insensitive
+# (OS X *can* be case-sensitive).
+if sys.platform not in ('win32', 'cygwin'):
+ changed_name = __file__.upper()
+ if changed_name == __file__:
+ changed_name = __file__.lower()
+ if not os.path.exists(changed_name):
+ CASE_INSENSITIVE_FS = False
+
+
+def case_insensitive_tests(test):
"""Class decorator that nullifies tests requiring a case-insensitive
file system."""
- # Windows is the only OS that is *always* case-insensitive
- # (OS X *can* be case-sensitive).
- if sys.platform not in ('win32', 'cygwin'):
- changed_name = __file__.upper()
- if changed_name == __file__:
- changed_name = __file__.lower()
- if os.path.exists(changed_name):
- return class_
- else:
- return unittest.TestCase
- else:
- return class_
+ return unittest.skipIf(not CASE_INSENSITIVE_FS,
+ "requires a case-insensitive filesystem")(test)
@contextmanager
diff --git a/Lib/importlib/util.py b/Lib/importlib/util.py
index 3abc6a957b..7b44fa1344 100644
--- a/Lib/importlib/util.py
+++ b/Lib/importlib/util.py
@@ -1,4 +1,5 @@
"""Utility code for constructing importers, etc."""
+
from ._bootstrap import module_for_loader
from ._bootstrap import set_loader
from ._bootstrap import set_package
diff --git a/Lib/inspect.py b/Lib/inspect.py
index ffe05b7a2c..4899cbf9f0 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1,4 +1,3 @@
-# -*- coding: iso-8859-1 -*-
"""Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
@@ -17,7 +16,7 @@ Here are some of the useful functions provided by this module:
getmodule() - determine the module that an object came from
getclasstree() - arrange classes so as to represent their hierarchy
- getargspec(), getargvalues() - get info about function arguments
+ getargspec(), getargvalues(), getcallargs() - get info about function arguments
getfullargspec() - same, with support for Python-3000 features
formatargspec(), formatargvalues() - format an argument spec
getouterframes(), getinnerframes() - get info about frames
@@ -33,17 +32,28 @@ __date__ = '1 Jan 2001'
import sys
import os
import types
+import itertools
import string
import re
-import dis
import imp
import tokenize
import linecache
from operator import attrgetter
from collections import namedtuple
-# These constants are from Include/code.h.
-CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, CO_VARKEYWORDS = 0x1, 0x2, 0x4, 0x8
-CO_NESTED, CO_GENERATOR, CO_NOFREE = 0x10, 0x20, 0x40
+
+# Create constants for the compiler flags in Include/code.h
+# We try to get them from dis to avoid duplication, but fall
+# back to hardcording so the dependency is optional
+try:
+ from dis import COMPILER_FLAG_NAMES as _flag_names
+except ImportError:
+ CO_OPTIMIZED, CO_NEWLOCALS = 0x1, 0x2
+ CO_VARARGS, CO_VARKEYWORDS = 0x4, 0x8
+ CO_NESTED, CO_GENERATOR, CO_NOFREE = 0x10, 0x20, 0x40
+else:
+ mod_dict = globals()
+ for k, v in _flag_names.items():
+ mod_dict["CO_" + v] = k
# See Include/object.h
TPFLAGS_IS_ABSTRACT = 1 << 20
@@ -53,6 +63,7 @@ def ismodule(object):
"""Return true if the object is a module.
Module objects provide these attributes:
+ __cached__ pathname to byte compiled file
__doc__ documentation string
__file__ filename (missing for built-in modules)"""
return isinstance(object, types.ModuleType)
@@ -327,22 +338,10 @@ def classify_class_attrs(cls):
return result
# ----------------------------------------------------------- class helpers
-def _searchbases(cls, accum):
- # Simulate the "classic class" search order.
- if cls in accum:
- return
- accum.append(cls)
- for base in cls.__bases__:
- _searchbases(base, accum)
def getmro(cls):
"Return tuple of base classes (including cls) in method resolution order."
- if hasattr(cls, "__mro__"):
- return cls.__mro__
- else:
- result = []
- _searchbases(cls, result)
- return tuple(result)
+ return cls.__mro__
# -------------------------------------------------- source code extraction
def indentsize(line):
@@ -915,6 +914,77 @@ def formatargvalues(args, varargs, varkw, locals,
specs.append(formatvarkw(varkw) + formatvalue(locals[varkw]))
return '(' + ', '.join(specs) + ')'
+def getcallargs(func, *positional, **named):
+ """Get the mapping of arguments to values.
+
+ A dict is returned, with keys the function argument names (including the
+ names of the * and ** arguments, if any), and values the respective bound
+ values from 'positional' and 'named'."""
+ spec = getfullargspec(func)
+ args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = spec
+ f_name = func.__name__
+ arg2value = {}
+
+ if ismethod(func) and func.__self__ is not None:
+ # implicit 'self' (or 'cls' for classmethods) argument
+ positional = (func.__self__,) + positional
+ num_pos = len(positional)
+ num_total = num_pos + len(named)
+ num_args = len(args)
+ num_defaults = len(defaults) if defaults else 0
+ for arg, value in zip(args, positional):
+ arg2value[arg] = value
+ if varargs:
+ if num_pos > num_args:
+ arg2value[varargs] = positional[-(num_pos-num_args):]
+ else:
+ arg2value[varargs] = ()
+ elif 0 < num_args < num_pos:
+ raise TypeError('%s() takes %s %d positional %s (%d given)' % (
+ f_name, 'at most' if defaults else 'exactly', num_args,
+ 'arguments' if num_args > 1 else 'argument', num_total))
+ elif num_args == 0 and num_total:
+ if varkw or kwonlyargs:
+ if num_pos:
+ # XXX: We should use num_pos, but Python also uses num_total:
+ raise TypeError('%s() takes exactly 0 positional arguments '
+ '(%d given)' % (f_name, num_total))
+ else:
+ raise TypeError('%s() takes no arguments (%d given)' %
+ (f_name, num_total))
+
+ for arg in itertools.chain(args, kwonlyargs):
+ if arg in named:
+ if arg in arg2value:
+ raise TypeError("%s() got multiple values for keyword "
+ "argument '%s'" % (f_name, arg))
+ else:
+ arg2value[arg] = named.pop(arg)
+ for kwonlyarg in kwonlyargs:
+ if kwonlyarg not in arg2value:
+ try:
+ arg2value[kwonlyarg] = kwonlydefaults[kwonlyarg]
+ except KeyError:
+ raise TypeError("%s() needs keyword-only argument %s" %
+ (f_name, kwonlyarg))
+ if defaults: # fill in any missing values with the defaults
+ for arg, value in zip(args[-num_defaults:], defaults):
+ if arg not in arg2value:
+ arg2value[arg] = value
+ if varkw:
+ arg2value[varkw] = named
+ elif named:
+ unexpected = next(iter(named))
+ raise TypeError("%s() got an unexpected keyword argument '%s'" %
+ (f_name, unexpected))
+ unassigned = num_args - len([arg for arg in args if arg in arg2value])
+ if unassigned:
+ num_required = num_args - num_defaults
+ raise TypeError('%s() takes %s %d %s (%d given)' % (
+ f_name, 'at least' if defaults else 'exactly', num_required,
+ 'arguments' if num_required > 1 else 'argument', num_total))
+ return arg2value
+
# -------------------------------------------------- stack frame extraction
Traceback = namedtuple('Traceback', 'filename lineno function code_context index')
@@ -979,10 +1049,9 @@ def getinnerframes(tb, context=1):
tb = tb.tb_next
return framelist
-if hasattr(sys, '_getframe'):
- currentframe = sys._getframe
-else:
- currentframe = lambda _=None: None
+def currentframe():
+ """Return the frame of the caller or None if this is not possible."""
+ return sys._getframe(1) if hasattr(sys, "_getframe") else None
def stack(context=1):
"""Return a list of records for the stack above the caller's frame."""
@@ -991,3 +1060,115 @@ def stack(context=1):
def trace(context=1):
"""Return a list of records for the stack below the current exception."""
return getinnerframes(sys.exc_info()[2], context)
+
+
+# ------------------------------------------------ static version of getattr
+
+_sentinel = object()
+
+def _static_getmro(klass):
+ return type.__dict__['__mro__'].__get__(klass)
+
+def _check_instance(obj, attr):
+ instance_dict = {}
+ try:
+ instance_dict = object.__getattribute__(obj, "__dict__")
+ except AttributeError:
+ pass
+ return dict.get(instance_dict, attr, _sentinel)
+
+
+def _check_class(klass, attr):
+ for entry in _static_getmro(klass):
+ if not _shadowed_dict(type(entry)):
+ try:
+ return entry.__dict__[attr]
+ except KeyError:
+ pass
+ return _sentinel
+
+def _is_type(obj):
+ try:
+ _static_getmro(obj)
+ except TypeError:
+ return False
+ return True
+
+def _shadowed_dict(klass):
+ dict_attr = type.__dict__["__dict__"]
+ for entry in _static_getmro(klass):
+ try:
+ class_dict = dict_attr.__get__(entry)["__dict__"]
+ except KeyError:
+ pass
+ else:
+ if not (type(class_dict) is types.GetSetDescriptorType and
+ class_dict.__name__ == "__dict__" and
+ class_dict.__objclass__ is entry):
+ return True
+ return False
+
+def getattr_static(obj, attr, default=_sentinel):
+ """Retrieve attributes without triggering dynamic lookup via the
+ descriptor protocol, __getattr__ or __getattribute__.
+
+ Note: this function may not be able to retrieve all attributes
+ that getattr can fetch (like dynamically created attributes)
+ and may find attributes that getattr can't (like descriptors
+ that raise AttributeError). It can also return descriptor objects
+ instead of instance members in some cases. See the
+ documentation for details.
+ """
+ instance_result = _sentinel
+ if not _is_type(obj):
+ klass = type(obj)
+ if not _shadowed_dict(klass):
+ instance_result = _check_instance(obj, attr)
+ else:
+ klass = obj
+
+ klass_result = _check_class(klass, attr)
+
+ if instance_result is not _sentinel and klass_result is not _sentinel:
+ if (_check_class(type(klass_result), '__get__') is not _sentinel and
+ _check_class(type(klass_result), '__set__') is not _sentinel):
+ return klass_result
+
+ if instance_result is not _sentinel:
+ return instance_result
+ if klass_result is not _sentinel:
+ return klass_result
+
+ if obj is klass:
+ # for types we check the metaclass too
+ for entry in _static_getmro(type(klass)):
+ try:
+ return entry.__dict__[attr]
+ except KeyError:
+ pass
+ if default is not _sentinel:
+ return default
+ raise AttributeError(attr)
+
+
+GEN_CREATED = 'GEN_CREATED'
+GEN_RUNNING = 'GEN_RUNNING'
+GEN_SUSPENDED = 'GEN_SUSPENDED'
+GEN_CLOSED = 'GEN_CLOSED'
+
+def getgeneratorstate(generator):
+ """Get current state of a generator-iterator.
+
+ Possible states are:
+ GEN_CREATED: Waiting to start execution.
+ GEN_RUNNING: Currently being executed by the interpreter.
+ GEN_SUSPENDED: Currently suspended at a yield expression.
+ GEN_CLOSED: Execution has completed.
+ """
+ if generator.gi_running:
+ return GEN_RUNNING
+ if generator.gi_frame is None:
+ return GEN_CLOSED
+ if generator.gi_frame.f_lasti == -1:
+ return GEN_CREATED
+ return GEN_SUSPENDED
diff --git a/Lib/json/decoder.py b/Lib/json/decoder.py
index 12fa81542b..a19cf0f18c 100644
--- a/Lib/json/decoder.py
+++ b/Lib/json/decoder.py
@@ -147,10 +147,14 @@ WHITESPACE_STR = ' \t\n\r'
def JSONObject(s_and_end, strict, scan_once, object_hook, object_pairs_hook,
- _w=WHITESPACE.match, _ws=WHITESPACE_STR):
+ memo=None, _w=WHITESPACE.match, _ws=WHITESPACE_STR):
s, end = s_and_end
pairs = []
pairs_append = pairs.append
+ # Backwards compatibility
+ if memo is None:
+ memo = {}
+ memo_get = memo.setdefault
# Use a slice to prevent IndexError from being raised, the following
# check will raise a more specific ValueError if the string is empty
nextchar = s[end:end + 1]
@@ -173,6 +177,7 @@ def JSONObject(s_and_end, strict, scan_once, object_hook, object_pairs_hook,
end += 1
while True:
key, end = scanstring(s, end, strict)
+ key = memo_get(key, key)
# To skip some function call overhead we optimize the fast paths where
# the JSON key separator is ": " or just ":".
if s[end:end + 1] != ':':
@@ -334,6 +339,7 @@ class JSONDecoder(object):
self.parse_object = JSONObject
self.parse_array = JSONArray
self.parse_string = scanstring
+ self.memo = {}
self.scan_once = make_scanner(self)
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py
index accbde0bd5..4b214eb60e 100644
--- a/Lib/json/encoder.py
+++ b/Lib/json/encoder.py
@@ -259,6 +259,9 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
tuple=tuple,
):
+ if _indent is not None and not isinstance(_indent, str):
+ _indent = ' ' * _indent
+
def _iterencode_list(lst, _current_indent_level):
if not lst:
yield '[]'
@@ -271,7 +274,7 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
buf = '['
if _indent is not None:
_current_indent_level += 1
- newline_indent = '\n' + (' ' * (_indent * _current_indent_level))
+ newline_indent = '\n' + _indent * _current_indent_level
separator = _item_separator + newline_indent
buf += newline_indent
else:
@@ -307,7 +310,7 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
yield chunk
if newline_indent is not None:
_current_indent_level -= 1
- yield '\n' + (' ' * (_indent * _current_indent_level))
+ yield '\n' + _indent * _current_indent_level
yield ']'
if markers is not None:
del markers[markerid]
@@ -324,7 +327,7 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
yield '{'
if _indent is not None:
_current_indent_level += 1
- newline_indent = '\n' + (' ' * (_indent * _current_indent_level))
+ newline_indent = '\n' + _indent * _current_indent_level
item_separator = _item_separator + newline_indent
yield newline_indent
else:
@@ -383,7 +386,7 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
yield chunk
if newline_indent is not None:
_current_indent_level -= 1
- yield '\n' + (' ' * (_indent * _current_indent_level))
+ yield '\n' + _indent * _current_indent_level
yield '}'
if markers is not None:
del markers[markerid]
diff --git a/Lib/json/scanner.py b/Lib/json/scanner.py
index f94d236149..23eef61b94 100644
--- a/Lib/json/scanner.py
+++ b/Lib/json/scanner.py
@@ -23,6 +23,7 @@ def py_make_scanner(context):
parse_constant = context.parse_constant
object_hook = context.object_hook
object_pairs_hook = context.object_pairs_hook
+ memo = context.memo
def _scan_once(string, idx):
try:
@@ -34,7 +35,7 @@ def py_make_scanner(context):
return parse_string(string, idx + 1, strict)
elif nextchar == '{':
return parse_object((string, idx + 1), strict,
- _scan_once, object_hook, object_pairs_hook)
+ _scan_once, object_hook, object_pairs_hook, memo)
elif nextchar == '[':
return parse_array((string, idx + 1), _scan_once)
elif nextchar == 'n' and string[idx:idx + 4] == 'null':
@@ -61,6 +62,12 @@ def py_make_scanner(context):
else:
raise StopIteration
+ def scan_once(string, idx):
+ try:
+ return _scan_once(string, idx)
+ finally:
+ memo.clear()
+
return _scan_once
make_scanner = c_make_scanner or py_make_scanner
diff --git a/Lib/keyword.py b/Lib/keyword.py
index a7abe2b419..a3788a6b0b 100755
--- a/Lib/keyword.py
+++ b/Lib/keyword.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Keywords (from "graminit.c")
@@ -61,21 +61,19 @@ def main():
else: optfile = "Lib/keyword.py"
# scan the source file for keywords
- fp = open(iptfile)
- strprog = re.compile('"([^"]+)"')
- lines = []
- for line in fp:
- if '{1, "' in line:
- match = strprog.search(line)
- if match:
- lines.append(" '" + match.group(1) + "',\n")
- fp.close()
+ with open(iptfile) as fp:
+ strprog = re.compile('"([^"]+)"')
+ lines = []
+ for line in fp:
+ if '{1, "' in line:
+ match = strprog.search(line)
+ if match:
+ lines.append(" '" + match.group(1) + "',\n")
lines.sort()
# load the output skeleton from the target
- fp = open(optfile)
- format = fp.readlines()
- fp.close()
+ with open(optfile) as fp:
+ format = fp.readlines()
# insert the lines of keywords
try:
diff --git a/Lib/lib2to3/pgen2/token.py b/Lib/lib2to3/pgen2/token.py
index 1c810651eb..6a6d0b6b65 100755
--- a/Lib/lib2to3/pgen2/token.py
+++ b/Lib/lib2to3/pgen2/token.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Token constants (from "token.h")."""
diff --git a/Lib/lib2to3/tests/pytree_idempotency.py b/Lib/lib2to3/tests/pytree_idempotency.py
index 414eb4d99e..a02bbfe201 100755
--- a/Lib/lib2to3/tests/pytree_idempotency.py
+++ b/Lib/lib2to3/tests/pytree_idempotency.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
diff --git a/Lib/linecache.py b/Lib/linecache.py
index 974b1d965a..c3f2c3fdca 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -123,9 +123,7 @@ def updatecache(filename, module_globals=None):
else:
return []
try:
- with open(fullname, 'rb') as fp:
- coding, line = tokenize.detect_encoding(fp.readline)
- with open(fullname, 'r', encoding=coding) as fp:
+ with tokenize.open(fullname) as fp:
lines = fp.readlines()
except IOError:
return []
diff --git a/Lib/locale.py b/Lib/locale.py
index 8c44625e05..7b987bed06 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -121,12 +121,15 @@ def localeconv():
# Iterate over grouping intervals
def _grouping_intervals(grouping):
+ last_interval = None
for interval in grouping:
# if grouping is -1, we are done
if interval == CHAR_MAX:
return
# 0: re-use last group ad infinitum
if interval == 0:
+ if last_interval is None:
+ raise ValueError("invalid grouping")
while True:
yield last_interval
yield interval
@@ -715,6 +718,28 @@ locale_encoding_alias = {
# updated 'sr_yu.microsoftcp1251@cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251'
# updated 'sr_yu.utf8@cyrillic' -> 'sr_YU.UTF-8' to 'sr_CS.UTF-8'
# updated 'sr_yu@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
+#
+# AP 2010-04-12:
+# Updated alias mapping to most recent locale.alias file
+# from X.org distribution using makelocalealias.py.
+#
+# These are the differences compared to the old mapping (Python 2.6.5
+# and older):
+#
+# updated 'ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
+# updated 'ru_ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
+# updated 'serbocroatian' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
+# updated 'sh' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
+# updated 'sh_yu' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
+# updated 'sr' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
+# updated 'sr@cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
+# updated 'sr@latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
+# updated 'sr_cs.utf8@latn' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8@latin'
+# updated 'sr_cs@latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
+# updated 'sr_yu' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8@latin'
+# updated 'sr_yu.utf8@cyrillic' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8'
+# updated 'sr_yu@cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
+#
locale_alias = {
'a3': 'a3_AZ.KOI8-C',
@@ -766,13 +791,17 @@ locale_alias = {
'ar_ye.iso88596': 'ar_YE.ISO8859-6',
'arabic': 'ar_AA.ISO8859-6',
'arabic.iso88596': 'ar_AA.ISO8859-6',
+ 'as': 'as_IN.UTF-8',
'az': 'az_AZ.ISO8859-9E',
'az_az': 'az_AZ.ISO8859-9E',
'az_az.iso88599e': 'az_AZ.ISO8859-9E',
'be': 'be_BY.CP1251',
+ 'be@latin': 'be_BY.UTF-8@latin',
'be_by': 'be_BY.CP1251',
'be_by.cp1251': 'be_BY.CP1251',
'be_by.microsoftcp1251': 'be_BY.CP1251',
+ 'be_by.utf8@latin': 'be_BY.UTF-8@latin',
+ 'be_by@latin': 'be_BY.UTF-8@latin',
'bg': 'bg_BG.CP1251',
'bg_bg': 'bg_BG.CP1251',
'bg_bg.cp1251': 'bg_BG.CP1251',
@@ -802,12 +831,30 @@ locale_alias = {
'c_c': 'C',
'c_c.c': 'C',
'ca': 'ca_ES.ISO8859-1',
+ 'ca_ad': 'ca_AD.ISO8859-1',
+ 'ca_ad.iso88591': 'ca_AD.ISO8859-1',
+ 'ca_ad.iso885915': 'ca_AD.ISO8859-15',
+ 'ca_ad.iso885915@euro': 'ca_AD.ISO8859-15',
+ 'ca_ad.utf8@euro': 'ca_AD.UTF-8',
+ 'ca_ad@euro': 'ca_AD.ISO8859-15',
'ca_es': 'ca_ES.ISO8859-1',
'ca_es.iso88591': 'ca_ES.ISO8859-1',
'ca_es.iso885915': 'ca_ES.ISO8859-15',
'ca_es.iso885915@euro': 'ca_ES.ISO8859-15',
'ca_es.utf8@euro': 'ca_ES.UTF-8',
'ca_es@euro': 'ca_ES.ISO8859-15',
+ 'ca_fr': 'ca_FR.ISO8859-1',
+ 'ca_fr.iso88591': 'ca_FR.ISO8859-1',
+ 'ca_fr.iso885915': 'ca_FR.ISO8859-15',
+ 'ca_fr.iso885915@euro': 'ca_FR.ISO8859-15',
+ 'ca_fr.utf8@euro': 'ca_FR.UTF-8',
+ 'ca_fr@euro': 'ca_FR.ISO8859-15',
+ 'ca_it': 'ca_IT.ISO8859-1',
+ 'ca_it.iso88591': 'ca_IT.ISO8859-1',
+ 'ca_it.iso885915': 'ca_IT.ISO8859-15',
+ 'ca_it.iso885915@euro': 'ca_IT.ISO8859-15',
+ 'ca_it.utf8@euro': 'ca_IT.UTF-8',
+ 'ca_it@euro': 'ca_IT.ISO8859-15',
'catalan': 'ca_ES.ISO8859-1',
'cextend': 'en_US.ISO8859-1',
'cextend.en': 'en_US.ISO8859-1',
@@ -829,6 +876,7 @@ locale_alias = {
'cz_cz': 'cs_CZ.ISO8859-2',
'czech': 'cs_CZ.ISO8859-2',
'da': 'da_DK.ISO8859-1',
+ 'da.iso885915': 'da_DK.ISO8859-15',
'da_dk': 'da_DK.ISO8859-1',
'da_dk.88591': 'da_DK.ISO8859-1',
'da_dk.885915': 'da_DK.ISO8859-15',
@@ -839,6 +887,7 @@ locale_alias = {
'danish.iso88591': 'da_DK.ISO8859-1',
'dansk': 'da_DK.ISO8859-1',
'de': 'de_DE.ISO8859-1',
+ 'de.iso885915': 'de_DE.ISO8859-15',
'de_at': 'de_AT.ISO8859-1',
'de_at.iso88591': 'de_AT.ISO8859-1',
'de_at.iso885915': 'de_AT.ISO8859-15',
@@ -1020,6 +1069,7 @@ locale_alias = {
'fa_ir': 'fa_IR.UTF-8',
'fa_ir.isiri3342': 'fa_IR.ISIRI-3342',
'fi': 'fi_FI.ISO8859-15',
+ 'fi.iso885915': 'fi_FI.ISO8859-15',
'fi_fi': 'fi_FI.ISO8859-15',
'fi_fi.88591': 'fi_FI.ISO8859-1',
'fi_fi.iso88591': 'fi_FI.ISO8859-1',
@@ -1035,6 +1085,7 @@ locale_alias = {
'fo_fo.iso885915': 'fo_FO.ISO8859-15',
'fo_fo@euro': 'fo_FO.ISO8859-15',
'fr': 'fr_FR.ISO8859-1',
+ 'fr.iso885915': 'fr_FR.ISO8859-15',
'fr_be': 'fr_BE.ISO8859-1',
'fr_be.88591': 'fr_BE.ISO8859-1',
'fr_be.iso88591': 'fr_BE.ISO8859-1',
@@ -1121,6 +1172,7 @@ locale_alias = {
'hi': 'hi_IN.ISCII-DEV',
'hi_in': 'hi_IN.ISCII-DEV',
'hi_in.isciidev': 'hi_IN.ISCII-DEV',
+ 'hne': 'hne_IN.UTF-8',
'hr': 'hr_HR.ISO8859-2',
'hr_hr': 'hr_HR.ISO8859-2',
'hr_hr.iso88592': 'hr_HR.ISO8859-2',
@@ -1147,6 +1199,7 @@ locale_alias = {
'iso_8859_1': 'en_US.ISO8859-1',
'iso_8859_15': 'en_US.ISO8859-15',
'it': 'it_IT.ISO8859-1',
+ 'it.iso885915': 'it_IT.ISO8859-15',
'it_ch': 'it_CH.ISO8859-1',
'it_ch.iso88591': 'it_CH.ISO8859-1',
'it_ch.iso885915': 'it_CH.ISO8859-15',
@@ -1178,6 +1231,7 @@ locale_alias = {
'ja_jp.jis': 'ja_JP.JIS7',
'ja_jp.jis7': 'ja_JP.JIS7',
'ja_jp.mscode': 'ja_JP.SJIS',
+ 'ja_jp.pck': 'ja_JP.SJIS',
'ja_jp.sjis': 'ja_JP.SJIS',
'ja_jp.ujis': 'ja_JP.eucJP',
'japan': 'ja_JP.eucJP',
@@ -1197,6 +1251,7 @@ locale_alias = {
'kl_gl.iso885915': 'kl_GL.ISO8859-15',
'kl_gl@euro': 'kl_GL.ISO8859-15',
'km_kh': 'km_KH.UTF-8',
+ 'kn': 'kn_IN.UTF-8',
'kn_in': 'kn_IN.UTF-8',
'ko': 'ko_KR.eucKR',
'ko_kr': 'ko_KR.eucKR',
@@ -1204,6 +1259,8 @@ locale_alias = {
'ko_kr.euckr': 'ko_KR.eucKR',
'korean': 'ko_KR.eucKR',
'korean.euc': 'ko_KR.eucKR',
+ 'ks': 'ks_IN.UTF-8',
+ 'ks_in@devanagari': 'ks_IN@devanagari.UTF-8',
'kw': 'kw_GB.ISO8859-1',
'kw_gb': 'kw_GB.ISO8859-1',
'kw_gb.iso88591': 'kw_GB.ISO8859-1',
@@ -1226,6 +1283,7 @@ locale_alias = {
'lv_lv': 'lv_LV.ISO8859-13',
'lv_lv.iso885913': 'lv_LV.ISO8859-13',
'lv_lv.iso88594': 'lv_LV.ISO8859-4',
+ 'mai': 'mai_IN.UTF-8',
'mi': 'mi_NZ.ISO8859-1',
'mi_nz': 'mi_NZ.ISO8859-1',
'mi_nz.iso88591': 'mi_NZ.ISO8859-1',
@@ -1234,6 +1292,8 @@ locale_alias = {
'mk_mk.cp1251': 'mk_MK.CP1251',
'mk_mk.iso88595': 'mk_MK.ISO8859-5',
'mk_mk.microsoftcp1251': 'mk_MK.CP1251',
+ 'ml': 'ml_IN.UTF-8',
+ 'mr': 'mr_IN.UTF-8',
'mr_in': 'mr_IN.UTF-8',
'ms': 'ms_MY.ISO8859-1',
'ms_my': 'ms_MY.ISO8859-1',
@@ -1248,6 +1308,7 @@ locale_alias = {
'nb_no.iso885915': 'nb_NO.ISO8859-15',
'nb_no@euro': 'nb_NO.ISO8859-15',
'nl': 'nl_NL.ISO8859-1',
+ 'nl.iso885915': 'nl_NL.ISO8859-15',
'nl_be': 'nl_BE.ISO8859-1',
'nl_be.88591': 'nl_BE.ISO8859-1',
'nl_be.iso88591': 'nl_BE.ISO8859-1',
@@ -1274,6 +1335,8 @@ locale_alias = {
'no_no.88591': 'no_NO.ISO8859-1',
'no_no.iso88591': 'no_NO.ISO8859-1',
'no_no.iso885915': 'no_NO.ISO8859-15',
+ 'no_no.iso88591@bokmal': 'no_NO.ISO8859-1',
+ 'no_no.iso88591@nynorsk': 'no_NO.ISO8859-1',
'no_no@euro': 'no_NO.ISO8859-15',
'norwegian': 'no_NO.ISO8859-1',
'norwegian.iso88591': 'no_NO.ISO8859-1',
@@ -1295,6 +1358,8 @@ locale_alias = {
'oc_fr.iso88591': 'oc_FR.ISO8859-1',
'oc_fr.iso885915': 'oc_FR.ISO8859-15',
'oc_fr@euro': 'oc_FR.ISO8859-15',
+ 'or': 'or_IN.UTF-8',
+ 'pa': 'pa_IN.UTF-8',
'pa_in': 'pa_IN.UTF-8',
'pd': 'pd_US.ISO8859-1',
'pd_de': 'pd_DE.ISO8859-1',
@@ -1322,6 +1387,7 @@ locale_alias = {
'pp_an': 'pp_AN.ISO8859-1',
'pp_an.iso88591': 'pp_AN.ISO8859-1',
'pt': 'pt_PT.ISO8859-1',
+ 'pt.iso885915': 'pt_PT.ISO8859-15',
'pt_br': 'pt_BR.ISO8859-1',
'pt_br.88591': 'pt_BR.ISO8859-1',
'pt_br.iso88591': 'pt_BR.ISO8859-1',
@@ -1338,8 +1404,9 @@ locale_alias = {
'ro_ro': 'ro_RO.ISO8859-2',
'ro_ro.iso88592': 'ro_RO.ISO8859-2',
'romanian': 'ro_RO.ISO8859-2',
- 'ru': 'ru_RU.ISO8859-5',
- 'ru_ru': 'ru_RU.ISO8859-5',
+ 'ru': 'ru_RU.UTF-8',
+ 'ru.koi8r': 'ru_RU.KOI8-R',
+ 'ru_ru': 'ru_RU.UTF-8',
'ru_ru.cp1251': 'ru_RU.CP1251',
'ru_ru.iso88595': 'ru_RU.ISO8859-5',
'ru_ru.koi8r': 'ru_RU.KOI8-R',
@@ -1353,13 +1420,15 @@ locale_alias = {
'rw': 'rw_RW.ISO8859-1',
'rw_rw': 'rw_RW.ISO8859-1',
'rw_rw.iso88591': 'rw_RW.ISO8859-1',
+ 'sd': 'sd_IN@devanagari.UTF-8',
'se_no': 'se_NO.UTF-8',
- 'serbocroatian': 'sr_CS.ISO8859-2',
- 'sh': 'sr_CS.ISO8859-2',
+ 'serbocroatian': 'sr_RS.UTF-8@latin',
+ 'sh': 'sr_RS.UTF-8@latin',
+ 'sh_ba.iso88592@bosnia': 'sr_CS.ISO8859-2',
'sh_hr': 'sh_HR.ISO8859-2',
'sh_hr.iso88592': 'hr_HR.ISO8859-2',
'sh_sp': 'sr_CS.ISO8859-2',
- 'sh_yu': 'sr_CS.ISO8859-2',
+ 'sh_yu': 'sr_RS.UTF-8@latin',
'si': 'si_LK.UTF-8',
'si_lk': 'si_LK.UTF-8',
'sinhala': 'si_LK.UTF-8',
@@ -1382,23 +1451,30 @@ locale_alias = {
'sq': 'sq_AL.ISO8859-2',
'sq_al': 'sq_AL.ISO8859-2',
'sq_al.iso88592': 'sq_AL.ISO8859-2',
- 'sr': 'sr_CS.ISO8859-5',
- 'sr@cyrillic': 'sr_CS.ISO8859-5',
- 'sr@latn': 'sr_CS.ISO8859-2',
+ 'sr': 'sr_RS.UTF-8',
+ 'sr@cyrillic': 'sr_RS.UTF-8',
+ 'sr@latin': 'sr_RS.UTF-8@latin',
+ 'sr@latn': 'sr_RS.UTF-8@latin',
+ 'sr_cs': 'sr_RS.UTF-8',
'sr_cs.iso88592': 'sr_CS.ISO8859-2',
'sr_cs.iso88592@latn': 'sr_CS.ISO8859-2',
'sr_cs.iso88595': 'sr_CS.ISO8859-5',
- 'sr_cs.utf8@latn': 'sr_CS.UTF-8',
- 'sr_cs@latn': 'sr_CS.ISO8859-2',
+ 'sr_cs.utf8@latn': 'sr_RS.UTF-8@latin',
+ 'sr_cs@latn': 'sr_RS.UTF-8@latin',
+ 'sr_me': 'sr_ME.UTF-8',
+ 'sr_rs': 'sr_RS.UTF-8',
+ 'sr_rs.utf8@latn': 'sr_RS.UTF-8@latin',
+ 'sr_rs@latin': 'sr_RS.UTF-8@latin',
+ 'sr_rs@latn': 'sr_RS.UTF-8@latin',
'sr_sp': 'sr_CS.ISO8859-2',
- 'sr_yu': 'sr_CS.ISO8859-5',
+ 'sr_yu': 'sr_RS.UTF-8@latin',
'sr_yu.cp1251@cyrillic': 'sr_CS.CP1251',
'sr_yu.iso88592': 'sr_CS.ISO8859-2',
'sr_yu.iso88595': 'sr_CS.ISO8859-5',
'sr_yu.iso88595@cyrillic': 'sr_CS.ISO8859-5',
'sr_yu.microsoftcp1251@cyrillic': 'sr_CS.CP1251',
- 'sr_yu.utf8@cyrillic': 'sr_CS.UTF-8',
- 'sr_yu@cyrillic': 'sr_CS.ISO8859-5',
+ 'sr_yu.utf8@cyrillic': 'sr_RS.UTF-8',
+ 'sr_yu@cyrillic': 'sr_RS.UTF-8',
'ss': 'ss_ZA.ISO8859-1',
'ss_za': 'ss_ZA.ISO8859-1',
'ss_za.iso88591': 'ss_ZA.ISO8859-1',
@@ -1406,6 +1482,7 @@ locale_alias = {
'st_za': 'st_ZA.ISO8859-1',
'st_za.iso88591': 'st_ZA.ISO8859-1',
'sv': 'sv_SE.ISO8859-1',
+ 'sv.iso885915': 'sv_SE.ISO8859-15',
'sv_fi': 'sv_FI.ISO8859-1',
'sv_fi.iso88591': 'sv_FI.ISO8859-1',
'sv_fi.iso885915': 'sv_FI.ISO8859-15',
@@ -1423,6 +1500,7 @@ locale_alias = {
'ta_in': 'ta_IN.TSCII-0',
'ta_in.tscii': 'ta_IN.TSCII-0',
'ta_in.tscii0': 'ta_IN.TSCII-0',
+ 'te': 'te_IN.UTF-8',
'tg': 'tg_TJ.KOI8-C',
'tg_tj': 'tg_TJ.KOI8-C',
'tg_tj.koi8c': 'tg_TJ.KOI8-C',
@@ -1498,6 +1576,7 @@ locale_alias = {
'zh_cn.gbk': 'zh_CN.gbk',
'zh_hk': 'zh_HK.big5hkscs',
'zh_hk.big5': 'zh_HK.big5',
+ 'zh_hk.big5hk': 'zh_HK.big5hkscs',
'zh_hk.big5hkscs': 'zh_HK.big5hkscs',
'zh_tw': 'zh_TW.big5',
'zh_tw.big5': 'zh_TW.big5',
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 685efeb4a8..e4b34a1af7 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
@@ -23,7 +23,8 @@ Copyright (C) 2001-2010 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
-import sys, os, time, io, traceback, warnings
+import sys, os, time, io, traceback, warnings, weakref
+from string import Template
__all__ = ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR',
'FATAL', 'FileHandler', 'Filter', 'Formatter', 'Handler', 'INFO',
@@ -31,7 +32,8 @@ __all__ = ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR',
'StreamHandler', 'WARN', 'WARNING', 'addLevelName', 'basicConfig',
'captureWarnings', 'critical', 'debug', 'disable', 'error',
'exception', 'fatal', 'getLevelName', 'getLogger', 'getLoggerClass',
- 'info', 'log', 'makeLogRecord', 'setLoggerClass', 'warn', 'warning']
+ 'info', 'log', 'makeLogRecord', 'setLoggerClass', 'warn', 'warning',
+ 'getLogRecordFactory', 'setLogRecordFactory', 'lastResort']
try:
import codecs
@@ -46,15 +48,13 @@ except ImportError:
__author__ = "Vinay Sajip <vinay_sajip@red-dove.com>"
__status__ = "production"
-__version__ = "0.5.0.7"
-__date__ = "20 January 2009"
+__version__ = "0.5.1.2"
+__date__ = "07 February 2010"
#---------------------------------------------------------------------------
# Miscellaneous module data
#---------------------------------------------------------------------------
-_unicode = 'unicode' in dir(__builtins__)
-
#
# _srcfile is used when walking the stack to check when we've got the first
# caller stack frame.
@@ -176,19 +176,34 @@ def addLevelName(level, levelName):
finally:
_releaseLock()
+def _checkLevel(level):
+ if isinstance(level, int):
+ rv = level
+ elif str(level) == level:
+ if level not in _levelNames:
+ raise ValueError("Unknown level: %r" % level)
+ rv = _levelNames[level]
+ else:
+ raise TypeError("Level not an integer or a valid string: %r" % level)
+ return rv
+
#---------------------------------------------------------------------------
# Thread-related stuff
#---------------------------------------------------------------------------
#
#_lock is used to serialize access to shared data structures in this module.
-#This needs to be an RLock because fileConfig() creates Handlers and so
-#might arbitrary user threads. Since Handler.__init__() updates the shared
-#dictionary _handlers, it needs to acquire the lock. But if configuring,
+#This needs to be an RLock because fileConfig() creates and configures
+#Handlers, and so might arbitrary user threads. Since Handler code updates the
+#shared dictionary _handlers, it needs to acquire the lock. But if configuring,
#the lock would already have been acquired - so we need an RLock.
#The same argument applies to Loggers and Manager.loggerDict.
#
-_lock = None
+if thread:
+ _lock = threading.RLock()
+else:
+ _lock = None
+
def _acquireLock():
"""
@@ -196,9 +211,6 @@ def _acquireLock():
This should be released with _releaseLock().
"""
- global _lock
- if (not _lock) and thread:
- _lock = threading.RLock()
if _lock:
_lock.acquire()
@@ -213,7 +225,7 @@ def _releaseLock():
# The logging record
#---------------------------------------------------------------------------
-class LogRecord:
+class LogRecord(object):
"""
A LogRecord instance represents an event being logged.
@@ -226,7 +238,7 @@ class LogRecord:
information to be logged.
"""
def __init__(self, name, level, pathname, lineno,
- msg, args, exc_info, func=None):
+ msg, args, exc_info, func=None, sinfo=None, **kwargs):
"""
Initialize a logging record with interesting information.
"""
@@ -260,6 +272,7 @@ class LogRecord:
self.module = "Unknown module"
self.exc_info = exc_info
self.exc_text = None # used to cache the traceback text
+ self.stack_info = sinfo
self.lineno = lineno
self.funcName = func
self.created = ct
@@ -274,11 +287,17 @@ class LogRecord:
if not logMultiprocessing:
self.processName = None
else:
- try:
- from multiprocessing import current_process
- self.processName = current_process().name
- except ImportError:
- self.processName = None
+ self.processName = 'MainProcess'
+ mp = sys.modules.get('multiprocessing')
+ if mp is not None:
+ # Errors may occur if multiprocessing has not finished loading
+ # yet - e.g. if a custom import hook causes third-party code
+ # to run when multiprocessing calls import. See issue 8200
+ # for an example
+ try:
+ self.processName = mp.current_process().name
+ except StandardError:
+ pass
if logProcesses and hasattr(os, 'getpid'):
self.process = os.getpid()
else:
@@ -295,19 +314,33 @@ class LogRecord:
Return the message for this LogRecord after merging any user-supplied
arguments with the message.
"""
- if not _unicode: #if no unicode support...
- msg = str(self.msg)
- else:
- msg = self.msg
- if not isinstance(msg, str):
- try:
- msg = str(self.msg)
- except UnicodeError:
- msg = self.msg #Defer encoding till later
+ msg = str(self.msg)
if self.args:
msg = msg % self.args
return msg
+#
+# Determine which class to use when instantiating log records.
+#
+_logRecordFactory = LogRecord
+
+def setLogRecordFactory(factory):
+ """
+ Set the factory to be used when instantiating a log record.
+
+ :param factory: A callable which will be called to instantiate
+ a log record.
+ """
+ global _logRecordFactory
+ _logRecordFactory = factory
+
+def getLogRecordFactory():
+ """
+ Return the factory to be used when instantiating a log record.
+ """
+
+ return _logRecordFactory
+
def makeLogRecord(dict):
"""
Make a LogRecord whose attributes are defined by the specified dictionary,
@@ -315,7 +348,7 @@ def makeLogRecord(dict):
a socket connection (which is sent as a dictionary) into a LogRecord
instance.
"""
- rv = LogRecord(None, None, "", 0, "", (), None, None)
+ rv = _logRecordFactory(None, None, "", 0, "", (), None, None)
rv.__dict__.update(dict)
return rv
@@ -323,7 +356,53 @@ def makeLogRecord(dict):
# Formatter classes and functions
#---------------------------------------------------------------------------
-class Formatter:
+class PercentStyle(object):
+
+ default_format = '%(message)s'
+ asctime_format = '%(asctime)s'
+ asctime_search = '%(asctime)'
+
+ def __init__(self, fmt):
+ self._fmt = fmt or self.default_format
+
+ def usesTime(self):
+ return self._fmt.find(self.asctime_search) >= 0
+
+ def format(self, record):
+ return self._fmt % record.__dict__
+
+class StrFormatStyle(PercentStyle):
+ default_format = '{message}'
+ asctime_format = '{asctime}'
+ asctime_search = '{asctime'
+
+ def format(self, record):
+ return self._fmt.format(**record.__dict__)
+
+
+class StringTemplateStyle(PercentStyle):
+ default_format = '${message}'
+ asctime_format = '${asctime}'
+ asctime_search = '${asctime}'
+
+ def __init__(self, fmt):
+ self._fmt = fmt or self.default_format
+ self._tpl = Template(self._fmt)
+
+ def usesTime(self):
+ fmt = self._fmt
+ return fmt.find('$asctime') >= 0 or fmt.find(self.asctime_format) >= 0
+
+ def format(self, record):
+ return self._tpl.substitute(**record.__dict__)
+
+_STYLES = {
+ '%': PercentStyle,
+ '{': StrFormatStyle,
+ '$': StringTemplateStyle
+}
+
+class Formatter(object):
"""
Formatter instances are used to convert a LogRecord to text.
@@ -331,7 +410,7 @@ class Formatter:
responsible for converting a LogRecord to (usually) a string which can
be interpreted by either a human or an external system. The base Formatter
allows a formatting string to be specified. If none is supplied, the
- default value of "%s(message)\\n" is used.
+ default value of "%s(message)" is used.
The Formatter can be initialized with a format string which makes use of
knowledge of the LogRecord attributes - e.g. the default value mentioned
@@ -367,18 +446,26 @@ class Formatter:
converter = time.localtime
- def __init__(self, fmt=None, datefmt=None):
+ def __init__(self, fmt=None, datefmt=None, style='%'):
"""
Initialize the formatter with specified format strings.
Initialize the formatter either with the specified format string, or a
default as described above. Allow for specialized date formatting with
the optional datefmt argument (if omitted, you get the ISO8601 format).
+
+ Use a style parameter of '%', '{' or '$' to specify that you want to
+ use one of %-formatting, :meth:`str.format` (``{}``) formatting or
+ :class:`string.Template` formatting in your format string.
+
+ .. versionchanged: 3.2
+ Added the ``style`` parameter.
"""
- if fmt:
- self._fmt = fmt
- else:
- self._fmt = "%(message)s"
+ if style not in _STYLES:
+ raise ValueError('Style must be one of: %s' % ','.join(
+ _STYLES.keys()))
+ self._style = _STYLES[style](fmt)
+ self._fmt = self._style._fmt
self.datefmt = datefmt
def formatTime(self, record, datefmt=None):
@@ -404,7 +491,7 @@ class Formatter:
s = time.strftime(datefmt, ct)
else:
t = time.strftime("%Y-%m-%d %H:%M:%S", ct)
- s = "%s,%03d" % (t, record.msecs)
+ s = "%s,%03d" % (t, record.msecs) # the use of % here is internal
return s
def formatException(self, ei):
@@ -415,13 +502,39 @@ class Formatter:
traceback.print_exception()
"""
sio = io.StringIO()
- traceback.print_exception(ei[0], ei[1], ei[2], None, sio)
+ tb = ei[2]
+ # See issues #9427, #1553375. Commented out for now.
+ #if getattr(self, 'fullstack', False):
+ # traceback.print_stack(tb.tb_frame.f_back, file=sio)
+ traceback.print_exception(ei[0], ei[1], tb, None, sio)
s = sio.getvalue()
sio.close()
if s[-1:] == "\n":
s = s[:-1]
return s
+ def usesTime(self):
+ """
+ Check if the format uses the creation time of the record.
+ """
+ return self._style.usesTime()
+
+ def formatMessage(self, record):
+ return self._style.format(record)
+
+ def formatStack(self, stack_info):
+ """
+ This method is provided as an extension point for specialized
+ formatting of stack information.
+
+ The input data is a string as returned from a call to
+ :func:`traceback.print_stack`, but with the last trailing newline
+ removed.
+
+ The base implementation just returns the value passed in.
+ """
+ return stack_info
+
def format(self, record):
"""
Format the specified record as text.
@@ -430,15 +543,15 @@ class Formatter:
string formatting operation which yields the returned string.
Before formatting the dictionary, a couple of preparatory steps
are carried out. The message attribute of the record is computed
- using LogRecord.getMessage(). If the formatting string contains
- "%(asctime)", formatTime() is called to format the event time.
- If there is exception information, it is formatted using
- formatException() and appended to the message.
+ using LogRecord.getMessage(). If the formatting string uses the
+ time (as determined by a call to usesTime(), formatTime() is
+ called to format the event time. If there is exception information,
+ it is formatted using formatException() and appended to the message.
"""
record.message = record.getMessage()
- if self._fmt.find("%(asctime)") >= 0:
+ if self.usesTime():
record.asctime = self.formatTime(record, self.datefmt)
- s = self._fmt % record.__dict__
+ s = self.formatMessage(record)
if record.exc_info:
# Cache the traceback text to avoid converting it multiple times
# (it's constant anyway)
@@ -448,6 +561,10 @@ class Formatter:
if s[-1:] != "\n":
s = s + "\n"
s = s + record.exc_text
+ if record.stack_info:
+ if s[-1:] != "\n":
+ s = s + "\n"
+ s = s + self.formatStack(record.stack_info)
return s
#
@@ -455,7 +572,7 @@ class Formatter:
#
_defaultFormatter = Formatter()
-class BufferingFormatter:
+class BufferingFormatter(object):
"""
A formatter suitable for formatting a number of records.
"""
@@ -497,7 +614,7 @@ class BufferingFormatter:
# Filter classes and functions
#---------------------------------------------------------------------------
-class Filter:
+class Filter(object):
"""
Filter instances are used to perform arbitrary filtering of LogRecords.
@@ -534,7 +651,7 @@ class Filter:
return 0
return (record.name[self.nlen] == ".")
-class Filterer:
+class Filterer(object):
"""
A base class for loggers and handlers which allows them to share
common code.
@@ -566,10 +683,18 @@ class Filterer:
The default is to allow the record to be logged; any filter can veto
this and the record is then dropped. Returns a zero value if a record
is to be dropped, else non-zero.
+
+ .. versionchanged: 3.2
+
+ Allow filters to be just callables.
"""
rv = 1
for f in self.filters:
- if not f.filter(record):
+ if hasattr(f, 'filter'):
+ result = f.filter(record)
+ else:
+ result = f(record) # assume callable - will raise if not
+ if not result:
rv = 0
break
return rv
@@ -578,9 +703,34 @@ class Filterer:
# Handler classes and functions
#---------------------------------------------------------------------------
-_handlers = {} #repository of handlers (for flushing when shutdown called)
+_handlers = weakref.WeakValueDictionary() #map of handler names to handlers
_handlerList = [] # added to allow handlers to be removed in reverse of order initialized
+def _removeHandlerRef(wr):
+ """
+ Remove a handler reference from the internal cleanup list.
+ """
+ # This function can be called during module teardown, when globals are
+ # set to None. If _acquireLock is None, assume this is the case and do
+ # nothing.
+ if _acquireLock is not None:
+ _acquireLock()
+ try:
+ if wr in _handlerList:
+ _handlerList.remove(wr)
+ finally:
+ _releaseLock()
+
+def _addHandlerRef(handler):
+ """
+ Add a handler to the internal cleanup list using a weak reference.
+ """
+ _acquireLock()
+ try:
+ _handlerList.append(weakref.ref(handler, _removeHandlerRef))
+ finally:
+ _releaseLock()
+
class Handler(Filterer):
"""
Handler instances dispatch logging events to specific destinations.
@@ -596,16 +746,28 @@ class Handler(Filterer):
and the filter list to empty.
"""
Filterer.__init__(self)
- self.level = level
+ self._name = None
+ self.level = _checkLevel(level)
self.formatter = None
- #get the module data lock, as we're updating a shared structure.
+ # Add the handler to the global _handlerList (for cleanup on shutdown)
+ _addHandlerRef(self)
+ self.createLock()
+
+ def get_name(self):
+ return self._name
+
+ def set_name(self, name):
_acquireLock()
- try: #unlikely to raise an exception, but you never know...
- _handlers[self] = 1
- _handlerList.insert(0, self)
+ try:
+ if self._name in _handlers:
+ del _handlers[self._name]
+ self._name = name
+ if name:
+ _handlers[name] = self
finally:
_releaseLock()
- self.createLock()
+
+ name = property(get_name, set_name)
def createLock(self):
"""
@@ -634,7 +796,7 @@ class Handler(Filterer):
"""
Set the logging level of this handler.
"""
- self.level = level
+ self.level = _checkLevel(level)
def format(self, record):
"""
@@ -696,16 +858,16 @@ class Handler(Filterer):
"""
Tidy up any resources used by the handler.
- This version does removes the handler from an internal list
- of handlers which is closed when shutdown() is called. Subclasses
+ This version removes the handler from an internal map of handlers,
+ _handlers, which is used for handler lookup by name. Subclasses
should ensure that this gets called from overridden close()
methods.
"""
#get the module data lock, as we're updating a shared structure.
_acquireLock()
try: #unlikely to raise an exception, but you never know...
- del _handlers[self]
- _handlerList.remove(self)
+ if self._name and self._name in _handlers:
+ del _handlers[self._name]
finally:
_releaseLock()
@@ -724,7 +886,10 @@ class Handler(Filterer):
if raiseExceptions:
ei = sys.exc_info()
try:
- traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr)
+ traceback.print_exception(ei[0], ei[1], ei[2],
+ None, sys.stderr)
+ sys.stderr.write('Logged from file %s, line %s\n' % (
+ record.filename, record.lineno))
except IOError:
pass # see issue 5971
finally:
@@ -737,6 +902,8 @@ class StreamHandler(Handler):
sys.stdout or sys.stderr may be used.
"""
+ terminator = '\n'
+
def __init__(self, stream=None):
"""
Initialize the handler.
@@ -769,28 +936,8 @@ class StreamHandler(Handler):
try:
msg = self.format(record)
stream = self.stream
- fs = "%s\n"
- if not _unicode: #if no unicode support...
- stream.write(fs % msg)
- else:
- try:
- if (isinstance(msg, unicode) and
- getattr(stream, 'encoding', None)):
- fs = fs.decode(stream.encoding)
- try:
- stream.write(fs % msg)
- except UnicodeEncodeError:
- #Printing to terminals sometimes fails. For example,
- #with an encoding of 'cp1251', the above write will
- #work if written to a stream opened or wrapped by
- #the codecs module, but fail when writing to a
- #terminal even when the codepage is set to cp1251.
- #An extra encoding step seems to be needed.
- stream.write((fs % msg).encode(stream.encoding))
- else:
- stream.write(fs % msg)
- except UnicodeError:
- stream.write(fs % msg.encode("UTF-8"))
+ stream.write(msg)
+ stream.write(self.terminator)
self.flush()
except (KeyboardInterrupt, SystemExit):
raise
@@ -853,11 +1000,31 @@ class FileHandler(StreamHandler):
self.stream = self._open()
StreamHandler.emit(self, record)
+class _StderrHandler(StreamHandler):
+ """
+ This class is like a StreamHandler using sys.stderr, but always uses
+ whatever sys.stderr is currently set to rather than the value of
+ sys.stderr at handler construction time.
+ """
+ def __init__(self, level=NOTSET):
+ """
+ Initialize the handler.
+ """
+ Handler.__init__(self, level)
+
+ @property
+ def stream(self):
+ return sys.stderr
+
+
+_defaultLastResort = _StderrHandler(WARNING)
+lastResort = _defaultLastResort
+
#---------------------------------------------------------------------------
# Manager classes and functions
#---------------------------------------------------------------------------
-class PlaceHolder:
+class PlaceHolder(object):
"""
PlaceHolder instances are used in the Manager logger hierarchy to take
the place of nodes for which no loggers have been defined. This class is
@@ -867,16 +1034,13 @@ class PlaceHolder:
"""
Initialize with the specified logger being a child of this placeholder.
"""
- #self.loggers = [alogger]
self.loggerMap = { alogger : None }
def append(self, alogger):
"""
Add the specified logger as a child of this placeholder.
"""
- #if alogger not in self.loggers:
if alogger not in self.loggerMap:
- #self.loggers.append(alogger)
self.loggerMap[alogger] = None
#
@@ -904,7 +1068,7 @@ def getLoggerClass():
return _loggerClass
-class Manager:
+class Manager(object):
"""
There is [under normal circumstances] just one Manager instance, which
holds the hierarchy of loggers.
@@ -915,8 +1079,10 @@ class Manager:
"""
self.root = rootnode
self.disable = 0
- self.emittedNoHandlerWarning = 0
+ self.emittedNoHandlerWarning = False
self.loggerDict = {}
+ self.loggerClass = None
+ self.logRecordFactory = None
def getLogger(self, name):
"""
@@ -936,13 +1102,13 @@ class Manager:
rv = self.loggerDict[name]
if isinstance(rv, PlaceHolder):
ph = rv
- rv = _loggerClass(name)
+ rv = (self.loggerClass or _loggerClass)(name)
rv.manager = self
self.loggerDict[name] = rv
self._fixupChildren(ph, rv)
self._fixupParents(rv)
else:
- rv = _loggerClass(name)
+ rv = (self.loggerClass or _loggerClass)(name)
rv.manager = self
self.loggerDict[name] = rv
self._fixupParents(rv)
@@ -950,6 +1116,23 @@ class Manager:
_releaseLock()
return rv
+ def setLoggerClass(self, klass):
+ """
+ Set the class to be used when instantiating a logger with this Manager.
+ """
+ if klass != Logger:
+ if not issubclass(klass, Logger):
+ raise TypeError("logger not derived from logging.Logger: "
+ + klass.__name__)
+ self.loggerClass = klass
+
+ def setLogRecordFactory(self, factory):
+ """
+ Set the factory to be used when instantiating a log record with this
+ Manager.
+ """
+ self.logRecordFactory = factory
+
def _fixupParents(self, alogger):
"""
Ensure that there are either loggers or placeholders all the way
@@ -1012,7 +1195,7 @@ class Logger(Filterer):
"""
Filterer.__init__(self)
self.name = name
- self.level = level
+ self.level = _checkLevel(level)
self.parent = None
self.propagate = 1
self.handlers = []
@@ -1022,7 +1205,7 @@ class Logger(Filterer):
"""
Set the logging level of this logger.
"""
- self.level = level
+ self.level = _checkLevel(level)
def debug(self, msg, *args, **kwargs):
"""
@@ -1074,11 +1257,12 @@ class Logger(Filterer):
if self.isEnabledFor(ERROR):
self._log(ERROR, msg, args, **kwargs)
- def exception(self, msg, *args):
+ def exception(self, msg, *args, **kwargs):
"""
Convenience method for logging an ERROR with exception information.
"""
- self.error(msg, exc_info=1, *args)
+ kwargs['exc_info'] = True
+ self.error(msg, *args, **kwargs)
def critical(self, msg, *args, **kwargs):
"""
@@ -1111,7 +1295,7 @@ class Logger(Filterer):
if self.isEnabledFor(level):
self._log(level, msg, args, **kwargs)
- def findCaller(self):
+ def findCaller(self, stack_info=False):
"""
Find the stack frame of the caller so that we can note the source
file name, line number and function name.
@@ -1121,23 +1305,34 @@ class Logger(Filterer):
#IronPython isn't run with -X:Frames.
if f is not None:
f = f.f_back
- rv = "(unknown file)", 0, "(unknown function)"
+ rv = "(unknown file)", 0, "(unknown function)", None
while hasattr(f, "f_code"):
co = f.f_code
filename = os.path.normcase(co.co_filename)
if filename == _srcfile:
f = f.f_back
continue
- rv = (filename, f.f_lineno, co.co_name)
+ sinfo = None
+ if stack_info:
+ sio = io.StringIO()
+ sio.write('Stack (most recent call last):\n')
+ traceback.print_stack(f, file=sio)
+ sinfo = sio.getvalue()
+ if sinfo[-1] == '\n':
+ sinfo = sinfo[:-1]
+ sio.close()
+ rv = (co.co_filename, f.f_lineno, co.co_name, sinfo)
break
return rv
- def makeRecord(self, name, level, fn, lno, msg, args, exc_info, func=None, extra=None):
+ def makeRecord(self, name, level, fn, lno, msg, args, exc_info,
+ func=None, extra=None, sinfo=None):
"""
A factory method which can be overridden in subclasses to create
specialized LogRecords.
"""
- rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
+ rv = _logRecordFactory(name, level, fn, lno, msg, args, exc_info, func,
+ sinfo)
if extra is not None:
for key in extra:
if (key in ["message", "asctime"]) or (key in rv.__dict__):
@@ -1145,17 +1340,18 @@ class Logger(Filterer):
rv.__dict__[key] = extra[key]
return rv
- def _log(self, level, msg, args, exc_info=None, extra=None):
+ def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False):
"""
Low-level logging routine which creates a LogRecord and then calls
all the handlers of this logger to handle the record.
"""
+ sinfo = None
if _srcfile:
#IronPython doesn't track Python frames, so findCaller throws an
#exception on some versions of IronPython. We trap it here so that
#IronPython can use logging.
try:
- fn, lno, func = self.findCaller()
+ fn, lno, func, sinfo = self.findCaller(stack_info)
except ValueError:
fn, lno, func = "(unknown file)", 0, "(unknown function)"
else:
@@ -1163,7 +1359,8 @@ class Logger(Filterer):
if exc_info:
if not isinstance(exc_info, tuple):
exc_info = sys.exc_info()
- record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
+ record = self.makeRecord(self.name, level, fn, lno, msg, args,
+ exc_info, func, extra, sinfo)
self.handle(record)
def handle(self, record):
@@ -1198,6 +1395,28 @@ class Logger(Filterer):
finally:
_releaseLock()
+ def hasHandlers(self):
+ """
+ See if this logger has any handlers configured.
+
+ Loop through all handlers for this logger and its parents in the
+ logger hierarchy. Return True if a handler was found, else False.
+ Stop searching up the hierarchy whenever a logger with the "propagate"
+ attribute set to zero is found - that will be the last logger which
+ is checked for the existence of handlers.
+ """
+ c = self
+ rv = False
+ while c:
+ if c.handlers:
+ rv = True
+ break
+ if not c.propagate:
+ break
+ else:
+ c = c.parent
+ return rv
+
def callHandlers(self, record):
"""
Pass a record to all relevant handlers.
@@ -1219,10 +1438,13 @@ class Logger(Filterer):
c = None #break out
else:
c = c.parent
- if (found == 0) and raiseExceptions and not self.manager.emittedNoHandlerWarning:
- sys.stderr.write("No handlers could be found for logger"
- " \"%s\"\n" % self.name)
- self.manager.emittedNoHandlerWarning = 1
+ if (found == 0):
+ if lastResort:
+ lastResort.handle(record)
+ elif raiseExceptions and not self.manager.emittedNoHandlerWarning:
+ sys.stderr.write("No handlers could be found for logger"
+ " \"%s\"\n" % self.name)
+ self.manager.emittedNoHandlerWarning = True
def getEffectiveLevel(self):
"""
@@ -1246,6 +1468,25 @@ class Logger(Filterer):
return 0
return level >= self.getEffectiveLevel()
+ def getChild(self, suffix):
+ """
+ Get a logger which is a descendant to this one.
+
+ This is a convenience method, such that
+
+ logging.getLogger('abc').getChild('def.ghi')
+
+ is the same as
+
+ logging.getLogger('abc.def.ghi')
+
+ It's useful, for example, when the parent logger is named using
+ __name__ rather than a literal string.
+ """
+ if self.root is not self:
+ suffix = '.'.join((self.name, suffix))
+ return self.manager.getLogger(suffix)
+
class RootLogger(Logger):
"""
A root logger is not that different to any other logger, except that
@@ -1260,7 +1501,7 @@ class RootLogger(Logger):
_loggerClass = Logger
-class LoggerAdapter:
+class LoggerAdapter(object):
"""
An adapter for loggers which makes it easier to specify contextual
information in logging output.
@@ -1293,62 +1534,82 @@ class LoggerAdapter:
kwargs["extra"] = self.extra
return msg, kwargs
+ #
+ # Boilerplate convenience methods
+ #
def debug(self, msg, *args, **kwargs):
"""
- Delegate a debug call to the underlying logger, after adding
- contextual information from this adapter instance.
+ Delegate a debug call to the underlying logger.
"""
- msg, kwargs = self.process(msg, kwargs)
- self.logger.debug(msg, *args, **kwargs)
+ self.log(DEBUG, msg, *args, **kwargs)
def info(self, msg, *args, **kwargs):
"""
- Delegate an info call to the underlying logger, after adding
- contextual information from this adapter instance.
+ Delegate an info call to the underlying logger.
"""
- msg, kwargs = self.process(msg, kwargs)
- self.logger.info(msg, *args, **kwargs)
+ self.log(INFO, msg, *args, **kwargs)
def warning(self, msg, *args, **kwargs):
"""
- Delegate a warning call to the underlying logger, after adding
- contextual information from this adapter instance.
+ Delegate a warning call to the underlying logger.
"""
- msg, kwargs = self.process(msg, kwargs)
- self.logger.warning(msg, *args, **kwargs)
+ self.log(WARNING, msg, *args, **kwargs)
+
+ warn = warning
def error(self, msg, *args, **kwargs):
"""
- Delegate an error call to the underlying logger, after adding
- contextual information from this adapter instance.
+ Delegate an error call to the underlying logger.
"""
- msg, kwargs = self.process(msg, kwargs)
- self.logger.error(msg, *args, **kwargs)
+ self.log(ERROR, msg, *args, **kwargs)
def exception(self, msg, *args, **kwargs):
"""
- Delegate an exception call to the underlying logger, after adding
- contextual information from this adapter instance.
+ Delegate an exception call to the underlying logger.
"""
- msg, kwargs = self.process(msg, kwargs)
kwargs["exc_info"] = 1
- self.logger.error(msg, *args, **kwargs)
+ self.log(ERROR, msg, *args, **kwargs)
def critical(self, msg, *args, **kwargs):
"""
- Delegate a critical call to the underlying logger, after adding
- contextual information from this adapter instance.
+ Delegate a critical call to the underlying logger.
"""
- msg, kwargs = self.process(msg, kwargs)
- self.logger.critical(msg, *args, **kwargs)
+ self.log(CRITICAL, msg, *args, **kwargs)
def log(self, level, msg, *args, **kwargs):
"""
Delegate a log call to the underlying logger, after adding
contextual information from this adapter instance.
"""
- msg, kwargs = self.process(msg, kwargs)
- self.logger.log(level, msg, *args, **kwargs)
+ if self.isEnabledFor(level):
+ msg, kwargs = self.process(msg, kwargs)
+ self.logger._log(level, msg, args, **kwargs)
+
+ def isEnabledFor(self, level):
+ """
+ Is this logger enabled for level 'level'?
+ """
+ if self.logger.manager.disable >= level:
+ return False
+ return level >= self.getEffectiveLevel()
+
+ def setLevel(self, level):
+ """
+ Set the specified level on the underlying logger.
+ """
+ self.logger.setLevel(level)
+
+ def getEffectiveLevel(self):
+ """
+ Get the effective level for the underlying logger.
+ """
+ return self.logger.getEffectiveLevel()
+
+ def hasHandlers(self):
+ """
+ See if the underlying logger has any handlers.
+ """
+ return self.logger.hasHandlers()
root = RootLogger(WARNING)
Logger.root = root
@@ -1381,6 +1642,10 @@ def basicConfig(**kwargs):
(if filemode is unspecified, it defaults to 'a').
format Use the specified format string for the handler.
datefmt Use the specified date/time format.
+ style If a format string is specified, use this to specify the
+ type of format string (possible values '%', '{', '$', for
+ %-formatting, :meth:`str.format` and :class:`string.Template`
+ - defaults to '%').
level Set the root logger level to the specified level.
stream Use the specified stream to initialize the StreamHandler. Note
that this argument is incompatible with 'filename' - if both
@@ -1391,6 +1656,9 @@ def basicConfig(**kwargs):
remembered that StreamHandler does not close its stream (since it may be
using sys.stdout or sys.stderr), whereas FileHandler closes its stream
when the handler is closed.
+
+ .. versionchanged: 3.2
+ Added the ``style`` parameter.
"""
# Add thread safety in case someone mistakenly calls
# basicConfig() from multiple threads
@@ -1406,7 +1674,8 @@ def basicConfig(**kwargs):
hdlr = StreamHandler(stream)
fs = kwargs.get("format", BASIC_FORMAT)
dfs = kwargs.get("datefmt", None)
- fmt = Formatter(fs, dfs)
+ style = kwargs.get("style", '%')
+ fmt = Formatter(fs, dfs, style)
hdlr.setFormatter(fmt)
root.addHandler(hdlr)
level = kwargs.get("level")
@@ -1433,7 +1702,9 @@ def getLogger(name=None):
def critical(msg, *args, **kwargs):
"""
- Log a message with severity 'CRITICAL' on the root logger.
+ Log a message with severity 'CRITICAL' on the root logger. If the logger
+ has no handlers, call basicConfig() to add a console handler with a
+ pre-defined format.
"""
if len(root.handlers) == 0:
basicConfig()
@@ -1443,22 +1714,28 @@ fatal = critical
def error(msg, *args, **kwargs):
"""
- Log a message with severity 'ERROR' on the root logger.
+ Log a message with severity 'ERROR' on the root logger. If the logger has
+ no handlers, call basicConfig() to add a console handler with a pre-defined
+ format.
"""
if len(root.handlers) == 0:
basicConfig()
root.error(msg, *args, **kwargs)
-def exception(msg, *args):
+def exception(msg, *args, **kwargs):
"""
- Log a message with severity 'ERROR' on the root logger,
- with exception information.
+ Log a message with severity 'ERROR' on the root logger, with exception
+ information. If the logger has no handlers, basicConfig() is called to add
+ a console handler with a pre-defined format.
"""
- error(msg, exc_info=1, *args)
+ kwargs['exc_info'] = True
+ error(msg, *args, **kwargs)
def warning(msg, *args, **kwargs):
"""
- Log a message with severity 'WARNING' on the root logger.
+ Log a message with severity 'WARNING' on the root logger. If the logger has
+ no handlers, call basicConfig() to add a console handler with a pre-defined
+ format.
"""
if len(root.handlers) == 0:
basicConfig()
@@ -1468,7 +1745,9 @@ warn = warning
def info(msg, *args, **kwargs):
"""
- Log a message with severity 'INFO' on the root logger.
+ Log a message with severity 'INFO' on the root logger. If the logger has
+ no handlers, call basicConfig() to add a console handler with a pre-defined
+ format.
"""
if len(root.handlers) == 0:
basicConfig()
@@ -1476,7 +1755,9 @@ def info(msg, *args, **kwargs):
def debug(msg, *args, **kwargs):
"""
- Log a message with severity 'DEBUG' on the root logger.
+ Log a message with severity 'DEBUG' on the root logger. If the logger has
+ no handlers, call basicConfig() to add a console handler with a pre-defined
+ format.
"""
if len(root.handlers) == 0:
basicConfig()
@@ -1484,7 +1765,9 @@ def debug(msg, *args, **kwargs):
def log(level, msg, *args, **kwargs):
"""
- Log 'msg % args' with the integer severity 'level' on the root logger.
+ Log 'msg % args' with the integer severity 'level' on the root logger. If
+ the logger has no handlers, call basicConfig() to add a console handler
+ with a pre-defined format.
"""
if len(root.handlers) == 0:
basicConfig()
@@ -1492,7 +1775,7 @@ def log(level, msg, *args, **kwargs):
def disable(level):
"""
- Disable all logging calls less severe than 'level'.
+ Disable all logging calls of severity 'level' and below.
"""
root.manager.disable = level
@@ -1503,32 +1786,32 @@ def shutdown(handlerList=_handlerList):
Should be called at application exit.
"""
- for h in handlerList[:]:
+ for wr in reversed(handlerList[:]):
#errors might occur, for example, if files are locked
#we just ignore them if raiseExceptions is not set
try:
- h.acquire()
- h.flush()
- h.close()
+ h = wr()
+ if h:
+ try:
+ h.acquire()
+ h.flush()
+ h.close()
+ except (IOError, ValueError):
+ # Ignore errors which might be caused
+ # because handlers have been closed but
+ # references to them are still around at
+ # application exit.
+ pass
+ finally:
+ h.release()
except:
if raiseExceptions:
raise
#else, swallow
- finally:
- h.release()
#Let's try and shutdown automatically on application exit...
-try:
- import atexit
- atexit.register(shutdown)
-except ImportError: # for Python versions < 2.0
- def exithook(status, old_exit=sys.exit):
- try:
- shutdown()
- finally:
- old_exit(status)
-
- sys.exit = exithook
+import atexit
+atexit.register(shutdown)
# Null handler
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index 25f34ecd24..c7359cabe9 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2007 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
@@ -24,7 +24,8 @@ Copyright (C) 2001-2010 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
-import sys, logging, logging.handlers, socket, struct, os, traceback
+import sys, logging, logging.handlers, socket, struct, os, traceback, re
+import types, io
try:
import _thread as thread
@@ -57,16 +58,12 @@ def fileConfig(fname, defaults=None, disable_existing_loggers=True):
the ability to select from various pre-canned configurations (if the
developer provides a mechanism to present the choices and load the chosen
configuration).
- In versions of ConfigParser which have the readfp method [typically
- shipped in 2.x versions of Python], you can pass in a file-like object
- rather than a filename, in which case the file-like object will be read
- using readfp.
"""
import configparser
cp = configparser.ConfigParser(defaults)
- if hasattr(cp, 'readfp') and hasattr(fname, 'readline'):
- cp.readfp(fname)
+ if hasattr(fname, 'readline'):
+ cp.read_file(fname)
else:
cp.read(fname)
@@ -101,9 +98,12 @@ def _resolve(name):
def _strip_spaces(alist):
return map(lambda x: x.strip(), alist)
+def _encoded(s):
+ return s if isinstance(s, str) else s.encode('utf-8')
+
def _create_formatters(cp):
"""Create and return formatters"""
- flist = cp.get("formatters", "keys")
+ flist = cp["formatters"]["keys"]
if not len(flist):
return {}
flist = flist.split(",")
@@ -111,20 +111,12 @@ def _create_formatters(cp):
formatters = {}
for form in flist:
sectname = "formatter_%s" % form
- opts = cp.options(sectname)
- if "format" in opts:
- fs = cp.get(sectname, "format", 1)
- else:
- fs = None
- if "datefmt" in opts:
- dfs = cp.get(sectname, "datefmt", 1)
- else:
- dfs = None
+ fs = cp.get(sectname, "format", raw=True, fallback=None)
+ dfs = cp.get(sectname, "datefmt", raw=True, fallback=None)
c = logging.Formatter
- if "class" in opts:
- class_name = cp.get(sectname, "class")
- if class_name:
- c = _resolve(class_name)
+ class_name = cp[sectname].get("class")
+ if class_name:
+ c = _resolve(class_name)
f = c(fs, dfs)
formatters[form] = f
return formatters
@@ -132,7 +124,7 @@ def _create_formatters(cp):
def _install_handlers(cp, formatters):
"""Install and return handlers"""
- hlist = cp.get("handlers", "keys")
+ hlist = cp["handlers"]["keys"]
if not len(hlist):
return {}
hlist = hlist.split(",")
@@ -140,30 +132,23 @@ def _install_handlers(cp, formatters):
handlers = {}
fixups = [] #for inter-handler references
for hand in hlist:
- sectname = "handler_%s" % hand
- klass = cp.get(sectname, "class")
- opts = cp.options(sectname)
- if "formatter" in opts:
- fmt = cp.get(sectname, "formatter")
- else:
- fmt = ""
+ section = cp["handler_%s" % hand]
+ klass = section["class"]
+ fmt = section.get("formatter", "")
try:
klass = eval(klass, vars(logging))
except (AttributeError, NameError):
klass = _resolve(klass)
- args = cp.get(sectname, "args")
+ args = section["args"]
args = eval(args, vars(logging))
h = klass(*args)
- if "level" in opts:
- level = cp.get(sectname, "level")
+ if "level" in section:
+ level = section["level"]
h.setLevel(logging._levelNames[level])
if len(fmt):
h.setFormatter(formatters[fmt])
if issubclass(klass, logging.handlers.MemoryHandler):
- if "target" in opts:
- target = cp.get(sectname,"target")
- else:
- target = ""
+ target = section.get("target", "")
if len(target): #the target handler may not be loaded yet, so keep for later...
fixups.append((h, target))
handlers[hand] = h
@@ -172,25 +157,44 @@ def _install_handlers(cp, formatters):
h.setTarget(handlers[t])
return handlers
+def _handle_existing_loggers(existing, child_loggers, disable_existing):
+ """
+ When (re)configuring logging, handle loggers which were in the previous
+ configuration but are not in the new configuration. There's no point
+ deleting them as other threads may continue to hold references to them;
+ and by disabling them, you stop them doing any logging.
+
+ However, don't disable children of named loggers, as that's probably not
+ what was intended by the user. Also, allow existing loggers to NOT be
+ disabled if disable_existing is false.
+ """
+ root = logging.root
+ for log in existing:
+ logger = root.manager.loggerDict[log]
+ if log in child_loggers:
+ logger.level = logging.NOTSET
+ logger.handlers = []
+ logger.propagate = True
+ elif disable_existing:
+ logger.disabled = True
-def _install_loggers(cp, handlers, disable_existing_loggers):
+def _install_loggers(cp, handlers, disable_existing):
"""Create and install loggers"""
# configure the root first
- llist = cp.get("loggers", "keys")
+ llist = cp["loggers"]["keys"]
llist = llist.split(",")
llist = list(map(lambda x: x.strip(), llist))
llist.remove("root")
- sectname = "logger_root"
+ section = cp["logger_root"]
root = logging.root
log = root
- opts = cp.options(sectname)
- if "level" in opts:
- level = cp.get(sectname, "level")
+ if "level" in section:
+ level = section["level"]
log.setLevel(logging._levelNames[level])
for h in root.handlers[:]:
root.removeHandler(h)
- hlist = cp.get(sectname, "handlers")
+ hlist = section["handlers"]
if len(hlist):
hlist = hlist.split(",")
hlist = _strip_spaces(hlist)
@@ -211,19 +215,15 @@ def _install_loggers(cp, handlers, disable_existing_loggers):
#avoid disabling child loggers of explicitly
#named loggers. With a sorted list it is easier
#to find the child loggers.
- existing.sort()
+ existing.sort(key=_encoded)
#We'll keep the list of existing loggers
#which are children of named loggers here...
child_loggers = []
#now set up the new ones...
for log in llist:
- sectname = "logger_%s" % log
- qn = cp.get(sectname, "qualname")
- opts = cp.options(sectname)
- if "propagate" in opts:
- propagate = cp.getint(sectname, "propagate")
- else:
- propagate = 1
+ section = cp["logger_%s" % log]
+ qn = section["qualname"]
+ propagate = section.getint("propagate", fallback=1)
logger = logging.getLogger(qn)
if qn in existing:
i = existing.index(qn) + 1 # start with the entry after qn
@@ -235,14 +235,14 @@ def _install_loggers(cp, handlers, disable_existing_loggers):
child_loggers.append(existing[i])
i += 1
existing.remove(qn)
- if "level" in opts:
- level = cp.get(sectname, "level")
+ if "level" in section:
+ level = section["level"]
logger.setLevel(logging._levelNames[level])
for h in logger.handlers[:]:
logger.removeHandler(h)
logger.propagate = propagate
logger.disabled = 0
- hlist = cp.get(sectname, "handlers")
+ hlist = section["handlers"]
if len(hlist):
hlist = hlist.split(",")
hlist = _strip_spaces(hlist)
@@ -254,14 +254,526 @@ def _install_loggers(cp, handlers, disable_existing_loggers):
#and by disabling them, you stop them doing any logging.
#However, don't disable children of named loggers, as that's
#probably not what was intended by the user.
- for log in existing:
- logger = root.manager.loggerDict[log]
- if log in child_loggers:
- logger.level = logging.NOTSET
- logger.handlers = []
- logger.propagate = 1
- elif disable_existing_loggers:
- logger.disabled = 1
+ #for log in existing:
+ # logger = root.manager.loggerDict[log]
+ # if log in child_loggers:
+ # logger.level = logging.NOTSET
+ # logger.handlers = []
+ # logger.propagate = 1
+ # elif disable_existing_loggers:
+ # logger.disabled = 1
+ _handle_existing_loggers(existing, child_loggers, disable_existing)
+
+IDENTIFIER = re.compile('^[a-z_][a-z0-9_]*$', re.I)
+
+
+def valid_ident(s):
+ m = IDENTIFIER.match(s)
+ if not m:
+ raise ValueError('Not a valid Python identifier: %r' % s)
+ return True
+
+
+# The ConvertingXXX classes are wrappers around standard Python containers,
+# and they serve to convert any suitable values in the container. The
+# conversion converts base dicts, lists and tuples to their wrapped
+# equivalents, whereas strings which match a conversion format are converted
+# appropriately.
+#
+# Each wrapper should have a configurator attribute holding the actual
+# configurator to use for conversion.
+
+class ConvertingDict(dict):
+ """A converting dictionary wrapper."""
+
+ def __getitem__(self, key):
+ value = dict.__getitem__(self, key)
+ result = self.configurator.convert(value)
+ #If the converted value is different, save for next time
+ if value is not result:
+ self[key] = result
+ if type(result) in (ConvertingDict, ConvertingList,
+ ConvertingTuple):
+ result.parent = self
+ result.key = key
+ return result
+
+ def get(self, key, default=None):
+ value = dict.get(self, key, default)
+ result = self.configurator.convert(value)
+ #If the converted value is different, save for next time
+ if value is not result:
+ self[key] = result
+ if type(result) in (ConvertingDict, ConvertingList,
+ ConvertingTuple):
+ result.parent = self
+ result.key = key
+ return result
+
+ def pop(self, key, default=None):
+ value = dict.pop(self, key, default)
+ result = self.configurator.convert(value)
+ if value is not result:
+ if type(result) in (ConvertingDict, ConvertingList,
+ ConvertingTuple):
+ result.parent = self
+ result.key = key
+ return result
+
+class ConvertingList(list):
+ """A converting list wrapper."""
+ def __getitem__(self, key):
+ value = list.__getitem__(self, key)
+ result = self.configurator.convert(value)
+ #If the converted value is different, save for next time
+ if value is not result:
+ self[key] = result
+ if type(result) in (ConvertingDict, ConvertingList,
+ ConvertingTuple):
+ result.parent = self
+ result.key = key
+ return result
+
+ def pop(self, idx=-1):
+ value = list.pop(self, idx)
+ result = self.configurator.convert(value)
+ if value is not result:
+ if type(result) in (ConvertingDict, ConvertingList,
+ ConvertingTuple):
+ result.parent = self
+ return result
+
+class ConvertingTuple(tuple):
+ """A converting tuple wrapper."""
+ def __getitem__(self, key):
+ value = tuple.__getitem__(self, key)
+ result = self.configurator.convert(value)
+ if value is not result:
+ if type(result) in (ConvertingDict, ConvertingList,
+ ConvertingTuple):
+ result.parent = self
+ result.key = key
+ return result
+
+class BaseConfigurator(object):
+ """
+ The configurator base class which defines some useful defaults.
+ """
+
+ CONVERT_PATTERN = re.compile(r'^(?P<prefix>[a-z]+)://(?P<suffix>.*)$')
+
+ WORD_PATTERN = re.compile(r'^\s*(\w+)\s*')
+ DOT_PATTERN = re.compile(r'^\.\s*(\w+)\s*')
+ INDEX_PATTERN = re.compile(r'^\[\s*(\w+)\s*\]\s*')
+ DIGIT_PATTERN = re.compile(r'^\d+$')
+
+ value_converters = {
+ 'ext' : 'ext_convert',
+ 'cfg' : 'cfg_convert',
+ }
+
+ # We might want to use a different one, e.g. importlib
+ importer = staticmethod(__import__)
+
+ def __init__(self, config):
+ self.config = ConvertingDict(config)
+ self.config.configurator = self
+
+ def resolve(self, s):
+ """
+ Resolve strings to objects using standard import and attribute
+ syntax.
+ """
+ name = s.split('.')
+ used = name.pop(0)
+ try:
+ found = self.importer(used)
+ for frag in name:
+ used += '.' + frag
+ try:
+ found = getattr(found, frag)
+ except AttributeError:
+ self.importer(used)
+ found = getattr(found, frag)
+ return found
+ except ImportError:
+ e, tb = sys.exc_info()[1:]
+ v = ValueError('Cannot resolve %r: %s' % (s, e))
+ v.__cause__, v.__traceback__ = e, tb
+ raise v
+
+ def ext_convert(self, value):
+ """Default converter for the ext:// protocol."""
+ return self.resolve(value)
+
+ def cfg_convert(self, value):
+ """Default converter for the cfg:// protocol."""
+ rest = value
+ m = self.WORD_PATTERN.match(rest)
+ if m is None:
+ raise ValueError("Unable to convert %r" % value)
+ else:
+ rest = rest[m.end():]
+ d = self.config[m.groups()[0]]
+ #print d, rest
+ while rest:
+ m = self.DOT_PATTERN.match(rest)
+ if m:
+ d = d[m.groups()[0]]
+ else:
+ m = self.INDEX_PATTERN.match(rest)
+ if m:
+ idx = m.groups()[0]
+ if not self.DIGIT_PATTERN.match(idx):
+ d = d[idx]
+ else:
+ try:
+ n = int(idx) # try as number first (most likely)
+ d = d[n]
+ except TypeError:
+ d = d[idx]
+ if m:
+ rest = rest[m.end():]
+ else:
+ raise ValueError('Unable to convert '
+ '%r at %r' % (value, rest))
+ #rest should be empty
+ return d
+
+ def convert(self, value):
+ """
+ Convert values to an appropriate type. dicts, lists and tuples are
+ replaced by their converting alternatives. Strings are checked to
+ see if they have a conversion format and are converted if they do.
+ """
+ if not isinstance(value, ConvertingDict) and isinstance(value, dict):
+ value = ConvertingDict(value)
+ value.configurator = self
+ elif not isinstance(value, ConvertingList) and isinstance(value, list):
+ value = ConvertingList(value)
+ value.configurator = self
+ elif not isinstance(value, ConvertingTuple) and\
+ isinstance(value, tuple):
+ value = ConvertingTuple(value)
+ value.configurator = self
+ elif isinstance(value, str): # str for py3k
+ m = self.CONVERT_PATTERN.match(value)
+ if m:
+ d = m.groupdict()
+ prefix = d['prefix']
+ converter = self.value_converters.get(prefix, None)
+ if converter:
+ suffix = d['suffix']
+ converter = getattr(self, converter)
+ value = converter(suffix)
+ return value
+
+ def configure_custom(self, config):
+ """Configure an object with a user-supplied factory."""
+ c = config.pop('()')
+ if not hasattr(c, '__call__'):
+ c = self.resolve(c)
+ props = config.pop('.', None)
+ # Check for valid identifiers
+ kwargs = dict([(k, config[k]) for k in config if valid_ident(k)])
+ result = c(**kwargs)
+ if props:
+ for name, value in props.items():
+ setattr(result, name, value)
+ return result
+
+ def as_tuple(self, value):
+ """Utility function which converts lists to tuples."""
+ if isinstance(value, list):
+ value = tuple(value)
+ return value
+
+class DictConfigurator(BaseConfigurator):
+ """
+ Configure logging using a dictionary-like object to describe the
+ configuration.
+ """
+
+ def configure(self):
+ """Do the configuration."""
+
+ config = self.config
+ if 'version' not in config:
+ raise ValueError("dictionary doesn't specify a version")
+ if config['version'] != 1:
+ raise ValueError("Unsupported version: %s" % config['version'])
+ incremental = config.pop('incremental', False)
+ EMPTY_DICT = {}
+ logging._acquireLock()
+ try:
+ if incremental:
+ handlers = config.get('handlers', EMPTY_DICT)
+ for name in handlers:
+ if name not in logging._handlers:
+ raise ValueError('No handler found with '
+ 'name %r' % name)
+ else:
+ try:
+ handler = logging._handlers[name]
+ handler_config = handlers[name]
+ level = handler_config.get('level', None)
+ if level:
+ handler.setLevel(logging._checkLevel(level))
+ except Exception as e:
+ raise ValueError('Unable to configure handler '
+ '%r: %s' % (name, e))
+ loggers = config.get('loggers', EMPTY_DICT)
+ for name in loggers:
+ try:
+ self.configure_logger(name, loggers[name], True)
+ except Exception as e:
+ raise ValueError('Unable to configure logger '
+ '%r: %s' % (name, e))
+ root = config.get('root', None)
+ if root:
+ try:
+ self.configure_root(root, True)
+ except Exception as e:
+ raise ValueError('Unable to configure root '
+ 'logger: %s' % e)
+ else:
+ disable_existing = config.pop('disable_existing_loggers', True)
+
+ logging._handlers.clear()
+ del logging._handlerList[:]
+
+ # Do formatters first - they don't refer to anything else
+ formatters = config.get('formatters', EMPTY_DICT)
+ for name in formatters:
+ try:
+ formatters[name] = self.configure_formatter(
+ formatters[name])
+ except Exception as e:
+ raise ValueError('Unable to configure '
+ 'formatter %r: %s' % (name, e))
+ # Next, do filters - they don't refer to anything else, either
+ filters = config.get('filters', EMPTY_DICT)
+ for name in filters:
+ try:
+ filters[name] = self.configure_filter(filters[name])
+ except Exception as e:
+ raise ValueError('Unable to configure '
+ 'filter %r: %s' % (name, e))
+
+ # Next, do handlers - they refer to formatters and filters
+ # As handlers can refer to other handlers, sort the keys
+ # to allow a deterministic order of configuration
+ handlers = config.get('handlers', EMPTY_DICT)
+ for name in sorted(handlers):
+ try:
+ handler = self.configure_handler(handlers[name])
+ handler.name = name
+ handlers[name] = handler
+ except Exception as e:
+ raise ValueError('Unable to configure handler '
+ '%r: %s' % (name, e))
+ # Next, do loggers - they refer to handlers and filters
+
+ #we don't want to lose the existing loggers,
+ #since other threads may have pointers to them.
+ #existing is set to contain all existing loggers,
+ #and as we go through the new configuration we
+ #remove any which are configured. At the end,
+ #what's left in existing is the set of loggers
+ #which were in the previous configuration but
+ #which are not in the new configuration.
+ root = logging.root
+ existing = list(root.manager.loggerDict.keys())
+ #The list needs to be sorted so that we can
+ #avoid disabling child loggers of explicitly
+ #named loggers. With a sorted list it is easier
+ #to find the child loggers.
+ existing.sort(key=_encoded)
+ #We'll keep the list of existing loggers
+ #which are children of named loggers here...
+ child_loggers = []
+ #now set up the new ones...
+ loggers = config.get('loggers', EMPTY_DICT)
+ for name in loggers:
+ if name in existing:
+ i = existing.index(name) + 1 # look after name
+ prefixed = name + "."
+ pflen = len(prefixed)
+ num_existing = len(existing)
+ while i < num_existing:
+ if existing[i][:pflen] == prefixed:
+ child_loggers.append(existing[i])
+ i += 1
+ existing.remove(name)
+ try:
+ self.configure_logger(name, loggers[name])
+ except Exception as e:
+ raise ValueError('Unable to configure logger '
+ '%r: %s' % (name, e))
+
+ #Disable any old loggers. There's no point deleting
+ #them as other threads may continue to hold references
+ #and by disabling them, you stop them doing any logging.
+ #However, don't disable children of named loggers, as that's
+ #probably not what was intended by the user.
+ #for log in existing:
+ # logger = root.manager.loggerDict[log]
+ # if log in child_loggers:
+ # logger.level = logging.NOTSET
+ # logger.handlers = []
+ # logger.propagate = True
+ # elif disable_existing:
+ # logger.disabled = True
+ _handle_existing_loggers(existing, child_loggers,
+ disable_existing)
+
+ # And finally, do the root logger
+ root = config.get('root', None)
+ if root:
+ try:
+ self.configure_root(root)
+ except Exception as e:
+ raise ValueError('Unable to configure root '
+ 'logger: %s' % e)
+ finally:
+ logging._releaseLock()
+
+ def configure_formatter(self, config):
+ """Configure a formatter from a dictionary."""
+ if '()' in config:
+ factory = config['()'] # for use in exception handler
+ try:
+ result = self.configure_custom(config)
+ except TypeError as te:
+ if "'format'" not in str(te):
+ raise
+ #Name of parameter changed from fmt to format.
+ #Retry with old name.
+ #This is so that code can be used with older Python versions
+ #(e.g. by Django)
+ config['fmt'] = config.pop('format')
+ config['()'] = factory
+ result = self.configure_custom(config)
+ else:
+ fmt = config.get('format', None)
+ dfmt = config.get('datefmt', None)
+ result = logging.Formatter(fmt, dfmt)
+ return result
+
+ def configure_filter(self, config):
+ """Configure a filter from a dictionary."""
+ if '()' in config:
+ result = self.configure_custom(config)
+ else:
+ name = config.get('name', '')
+ result = logging.Filter(name)
+ return result
+
+ def add_filters(self, filterer, filters):
+ """Add filters to a filterer from a list of names."""
+ for f in filters:
+ try:
+ filterer.addFilter(self.config['filters'][f])
+ except Exception as e:
+ raise ValueError('Unable to add filter %r: %s' % (f, e))
+
+ def configure_handler(self, config):
+ """Configure a handler from a dictionary."""
+ formatter = config.pop('formatter', None)
+ if formatter:
+ try:
+ formatter = self.config['formatters'][formatter]
+ except Exception as e:
+ raise ValueError('Unable to set formatter '
+ '%r: %s' % (formatter, e))
+ level = config.pop('level', None)
+ filters = config.pop('filters', None)
+ if '()' in config:
+ c = config.pop('()')
+ if not hasattr(c, '__call__') and hasattr(types, 'ClassType') and type(c) != types.ClassType:
+ c = self.resolve(c)
+ factory = c
+ else:
+ klass = self.resolve(config.pop('class'))
+ #Special case for handler which refers to another handler
+ if issubclass(klass, logging.handlers.MemoryHandler) and\
+ 'target' in config:
+ try:
+ config['target'] = self.config['handlers'][config['target']]
+ except Exception as e:
+ raise ValueError('Unable to set target handler '
+ '%r: %s' % (config['target'], e))
+ elif issubclass(klass, logging.handlers.SMTPHandler) and\
+ 'mailhost' in config:
+ config['mailhost'] = self.as_tuple(config['mailhost'])
+ elif issubclass(klass, logging.handlers.SysLogHandler) and\
+ 'address' in config:
+ config['address'] = self.as_tuple(config['address'])
+ factory = klass
+ kwargs = dict([(k, config[k]) for k in config if valid_ident(k)])
+ try:
+ result = factory(**kwargs)
+ except TypeError as te:
+ if "'stream'" not in str(te):
+ raise
+ #The argument name changed from strm to stream
+ #Retry with old name.
+ #This is so that code can be used with older Python versions
+ #(e.g. by Django)
+ kwargs['strm'] = kwargs.pop('stream')
+ result = factory(**kwargs)
+ if formatter:
+ result.setFormatter(formatter)
+ if level is not None:
+ result.setLevel(logging._checkLevel(level))
+ if filters:
+ self.add_filters(result, filters)
+ return result
+
+ def add_handlers(self, logger, handlers):
+ """Add handlers to a logger from a list of names."""
+ for h in handlers:
+ try:
+ logger.addHandler(self.config['handlers'][h])
+ except Exception as e:
+ raise ValueError('Unable to add handler %r: %s' % (h, e))
+
+ def common_logger_config(self, logger, config, incremental=False):
+ """
+ Perform configuration which is common to root and non-root loggers.
+ """
+ level = config.get('level', None)
+ if level is not None:
+ logger.setLevel(logging._checkLevel(level))
+ if not incremental:
+ #Remove any existing handlers
+ for h in logger.handlers[:]:
+ logger.removeHandler(h)
+ handlers = config.get('handlers', None)
+ if handlers:
+ self.add_handlers(logger, handlers)
+ filters = config.get('filters', None)
+ if filters:
+ self.add_filters(logger, filters)
+
+ def configure_logger(self, name, config, incremental=False):
+ """Configure a non-root logger from a dictionary."""
+ logger = logging.getLogger(name)
+ self.common_logger_config(logger, config, incremental)
+ propagate = config.get('propagate', None)
+ if propagate is not None:
+ logger.propagate = propagate
+
+ def configure_root(self, config, incremental=False):
+ """Configure a root logger from a dictionary."""
+ root = logging.getLogger()
+ self.common_logger_config(root, config, incremental)
+
+dictConfigClass = DictConfigurator
+
+def dictConfig(config):
+ """Configure logging using a dictionary."""
+ dictConfigClass(config).configure()
def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
@@ -301,24 +813,26 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
chunk = self.connection.recv(slen)
while len(chunk) < slen:
chunk = chunk + conn.recv(slen - len(chunk))
- #Apply new configuration. We'd like to be able to
- #create a StringIO and pass that in, but unfortunately
- #1.5.2 ConfigParser does not support reading file
- #objects, only actual files. So we create a temporary
- #file and remove it later.
- file = tempfile.mktemp(".ini")
- f = open(file, "w")
- f.write(chunk)
- f.close()
+ chunk = chunk.decode("utf-8")
try:
- fileConfig(file)
- except (KeyboardInterrupt, SystemExit):
- raise
+ import json
+ d =json.loads(chunk)
+ assert isinstance(d, dict)
+ dictConfig(d)
except:
- traceback.print_exc()
- os.remove(file)
+ #Apply new configuration.
+
+ file = io.StringIO(chunk)
+ try:
+ fileConfig(file)
+ except (KeyboardInterrupt, SystemExit):
+ raise
+ except:
+ traceback.print_exc()
+ if self.server.ready:
+ self.server.ready.set()
except socket.error as e:
- if not isinstancetype(e.args, tuple):
+ if not isinstance(e.args, tuple):
raise
else:
errcode = e.args[0]
@@ -333,12 +847,13 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
allow_reuse_address = 1
def __init__(self, host='localhost', port=DEFAULT_LOGGING_CONFIG_PORT,
- handler=None):
+ handler=None, ready=None):
ThreadingTCPServer.__init__(self, (host, port), handler)
logging._acquireLock()
self.abort = 0
logging._releaseLock()
self.timeout = 1
+ self.ready = ready
def serve_until_stopped(self):
import select
@@ -354,17 +869,28 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
logging._releaseLock()
self.socket.close()
- def serve(rcvr, hdlr, port):
- server = rcvr(port=port, handler=hdlr)
- global _listener
- logging._acquireLock()
- _listener = server
- logging._releaseLock()
- server.serve_until_stopped()
+ class Server(threading.Thread):
+
+ def __init__(self, rcvr, hdlr, port):
+ super(Server, self).__init__()
+ self.rcvr = rcvr
+ self.hdlr = hdlr
+ self.port = port
+ self.ready = threading.Event()
+
+ def run(self):
+ server = self.rcvr(port=self.port, handler=self.hdlr,
+ ready=self.ready)
+ if self.port == 0:
+ self.port = server.server_address[1]
+ self.ready.set()
+ global _listener
+ logging._acquireLock()
+ _listener = server
+ logging._releaseLock()
+ server.serve_until_stopped()
- return threading.Thread(target=serve,
- args=(ConfigSocketReceiver,
- ConfigStreamHandler, port))
+ return Server(ConfigSocketReceiver, ConfigStreamHandler, port)
def stopListening():
"""
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index e9dac43f61..306cf86698 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2007 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
@@ -19,13 +19,18 @@ Additional handlers for the logging package for Python. The core package is
based on PEP 282 and comments thereto in comp.lang.python, and influenced by
Apache's log4j system.
-Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2010 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging.handlers' and log away!
"""
import logging, socket, os, pickle, struct, time, re
from stat import ST_DEV, ST_INO, ST_MTIME
+import queue
+try:
+ import threading
+except ImportError:
+ threading = None
try:
import codecs
@@ -41,6 +46,7 @@ DEFAULT_UDP_LOGGING_PORT = 9021
DEFAULT_HTTP_LOGGING_PORT = 9022
DEFAULT_SOAP_LOGGING_PORT = 9023
SYSLOG_UDP_PORT = 514
+SYSLOG_TCP_PORT = 514
_MIDNIGHT = 24 * 60 * 60 # number of seconds in a day
@@ -102,8 +108,13 @@ class RotatingFileHandler(BaseRotatingHandler):
If maxBytes is zero, rollover never occurs.
"""
+ # If rotation/rollover is wanted, it doesn't make sense to use another
+ # mode. If for example 'w' were specified, then if there were multiple
+ # runs of the calling application, the logs from previous runs would be
+ # lost if the 'w' is respected, because the log file would be truncated
+ # on each run.
if maxBytes > 0:
- mode = 'a' # doesn't make sense otherwise!
+ mode = 'a'
BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
self.maxBytes = maxBytes
self.backupCount = backupCount
@@ -120,7 +131,6 @@ class RotatingFileHandler(BaseRotatingHandler):
sfn = "%s.%d" % (self.baseFilename, i)
dfn = "%s.%d" % (self.baseFilename, i + 1)
if os.path.exists(sfn):
- #print "%s -> %s" % (sfn, dfn)
if os.path.exists(dfn):
os.remove(dfn)
os.rename(sfn, dfn)
@@ -128,7 +138,6 @@ class RotatingFileHandler(BaseRotatingHandler):
if os.path.exists(dfn):
os.remove(dfn)
os.rename(self.baseFilename, dfn)
- #print "%s -> %s" % (self.baseFilename, dfn)
self.mode = 'w'
self.stream = self._open()
@@ -156,7 +165,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
If backupCount is > 0, when rollover is done, no more than backupCount
files are kept - the oldest ones are deleted.
"""
- def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=0, utc=False):
+ def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False):
BaseRotatingHandler.__init__(self, filename, 'a', encoding, delay)
self.when = when.upper()
self.backupCount = backupCount
@@ -278,7 +287,6 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
t = int(time.time())
if t >= self.rolloverAt:
return 1
- #print "No need to rollover: %d, %d" % (t, self.rolloverAt)
return 0
def getFilesToDelete(self):
@@ -326,14 +334,8 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
os.remove(dfn)
os.rename(self.baseFilename, dfn)
if self.backupCount > 0:
- # find the oldest log file and delete it
- #s = glob.glob(self.baseFilename + ".20*")
- #if len(s) > self.backupCount:
- # s.sort()
- # os.remove(s[0])
for s in self.getFilesToDelete():
os.remove(s)
- #print "%s -> %s" % (self.baseFilename, dfn)
self.mode = 'w'
self.stream = self._open()
currentTime = int(time.time())
@@ -634,7 +636,8 @@ class SysLogHandler(logging.Handler):
LOG_NEWS = 7 # network news subsystem
LOG_UUCP = 8 # UUCP subsystem
LOG_CRON = 9 # clock daemon
- LOG_AUTHPRIV = 10 # security/authorization messages (private)
+ LOG_AUTHPRIV = 10 # security/authorization messages (private)
+ LOG_FTP = 11 # FTP daemon
# other codes through 15 reserved for system use
LOG_LOCAL0 = 16 # reserved for local use
@@ -666,6 +669,7 @@ class SysLogHandler(logging.Handler):
"authpriv": LOG_AUTHPRIV,
"cron": LOG_CRON,
"daemon": LOG_DAEMON,
+ "ftp": LOG_FTP,
"kern": LOG_KERN,
"lpr": LOG_LPR,
"mail": LOG_MAIL,
@@ -696,7 +700,8 @@ class SysLogHandler(logging.Handler):
"CRITICAL" : "critical"
}
- def __init__(self, address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER):
+ def __init__(self, address=('localhost', SYSLOG_UDP_PORT),
+ facility=LOG_USER, socktype=socket.SOCK_DGRAM):
"""
Initialize a handler.
@@ -708,13 +713,16 @@ class SysLogHandler(logging.Handler):
self.address = address
self.facility = facility
+ self.socktype = socktype
+
if isinstance(address, str):
self.unixsocket = 1
self._connect_unixsocket(address)
else:
self.unixsocket = 0
- self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-
+ self.socket = socket.socket(socket.AF_INET, socktype)
+ if socktype == socket.SOCK_STREAM:
+ self.socket.connect(address)
self.formatter = None
def _connect_unixsocket(self, address):
@@ -727,12 +735,6 @@ class SysLogHandler(logging.Handler):
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.socket.connect(address)
- # curious: when talking to the unix-domain '/dev/log' socket, a
- # zero-terminator seems to be required. this string is placed
- # into a class variable so that it can be overridden if
- # necessary.
- log_format_string = '<%d>%s\000'
-
def encodePriority(self, facility, priority):
"""
Encode the facility and priority. You can pass in strings or
@@ -771,18 +773,19 @@ class SysLogHandler(logging.Handler):
The record is formatted, and then sent to the syslog server. If
exception information is present, it is NOT sent to the server.
"""
- msg = self.format(record)
+ msg = self.format(record) + '\000'
"""
We need to convert record level to lowercase, maybe this will
change in the future.
"""
- msg = self.log_format_string % (
- self.encodePriority(self.facility,
- self.mapPriority(record.levelname)),
- msg)
+ prio = '<%d>' % self.encodePriority(self.facility,
+ self.mapPriority(record.levelname))
+ prio = prio.encode('utf-8')
+ # Message is a string. Convert to bytes as required by RFC 5424
msg = msg.encode('utf-8')
if codecs:
msg = codecs.BOM_UTF8 + msg
+ msg = prio + msg
try:
if self.unixsocket:
try:
@@ -790,8 +793,10 @@ class SysLogHandler(logging.Handler):
except socket.error:
self._connect_unixsocket(self.address)
self.socket.send(msg)
- else:
+ elif self.socktype == socket.SOCK_DGRAM:
self.socket.sendto(msg, self.address)
+ else:
+ self.socket.sendall(msg)
except (KeyboardInterrupt, SystemExit):
raise
except:
@@ -801,7 +806,8 @@ class SMTPHandler(logging.Handler):
"""
A handler class which sends an SMTP email for each logging event.
"""
- def __init__(self, mailhost, fromaddr, toaddrs, subject, credentials=None):
+ def __init__(self, mailhost, fromaddr, toaddrs, subject,
+ credentials=None, secure=None):
"""
Initialize the handler.
@@ -809,7 +815,12 @@ class SMTPHandler(logging.Handler):
line of the email. To specify a non-standard SMTP port, use the
(host, port) tuple format for the mailhost argument. To specify
authentication credentials, supply a (username, password) tuple
- for the credentials argument.
+ for the credentials argument. To specify the use of a secure
+ protocol (TLS), pass in a tuple for the secure argument. This will
+ only be used when authentication credentials are supplied. The tuple
+ will be either an empty tuple, or a single-value tuple with the name
+ of a keyfile, or a 2-value tuple with the names of the keyfile and
+ certificate file. (This tuple is passed to the `starttls` method).
"""
logging.Handler.__init__(self)
if isinstance(mailhost, tuple):
@@ -825,6 +836,7 @@ class SMTPHandler(logging.Handler):
toaddrs = [toaddrs]
self.toaddrs = toaddrs
self.subject = subject
+ self.secure = secure
def getSubject(self, record):
"""
@@ -835,24 +847,6 @@ class SMTPHandler(logging.Handler):
"""
return self.subject
- weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
-
- monthname = [None,
- 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
-
- def date_time(self):
- """
- Return the current date and time formatted for a MIME header.
- Needed for Python 1.5.2 (no email package available)
- """
- year, month, day, hh, mm, ss, wd, y, z = time.gmtime(time.time())
- s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
- self.weekdayname[wd],
- day, self.monthname[month], year,
- hh, mm, ss)
- return s
-
def emit(self, record):
"""
Emit a record.
@@ -861,10 +855,7 @@ class SMTPHandler(logging.Handler):
"""
try:
import smtplib
- try:
- from email.utils import formatdate
- except ImportError:
- formatdate = self.date_time
+ from email.utils import formatdate
port = self.mailport
if not port:
port = smtplib.SMTP_PORT
@@ -876,6 +867,10 @@ class SMTPHandler(logging.Handler):
self.getSubject(record),
formatdate(), msg)
if self.username:
+ if self.secure is not None:
+ smtp.ehlo()
+ smtp.starttls(*self.secure)
+ smtp.ehlo()
smtp.login(self.username, self.password)
smtp.sendmail(self.fromaddr, self.toaddrs, msg)
smtp.quit()
@@ -989,7 +984,7 @@ class HTTPHandler(logging.Handler):
A class which sends records to a Web server, using either GET or
POST semantics.
"""
- def __init__(self, host, url, method="GET"):
+ def __init__(self, host, url, method="GET", secure=False, credentials=None):
"""
Initialize the instance with the host, the request URL, and the method
("GET" or "POST")
@@ -1001,12 +996,14 @@ class HTTPHandler(logging.Handler):
self.host = host
self.url = url
self.method = method
+ self.secure = secure
+ self.credentials = credentials
def mapLogRecord(self, record):
"""
Default implementation of mapping the log record into a dict
that is sent as the CGI data. Overwrite in your class.
- Contributed by Franz Glasner.
+ Contributed by Franz Glasner.
"""
return record.__dict__
@@ -1019,7 +1016,10 @@ class HTTPHandler(logging.Handler):
try:
import http.client, urllib.parse
host = self.host
- h = http.client.HTTP(host)
+ if self.secure:
+ h = http.client.HTTPSConnection(host)
+ else:
+ h = http.client.HTTPConnection(host)
url = self.url
data = urllib.parse.urlencode(self.mapLogRecord(record))
if self.method == "GET":
@@ -1039,8 +1039,13 @@ class HTTPHandler(logging.Handler):
h.putheader("Content-type",
"application/x-www-form-urlencoded")
h.putheader("Content-length", str(len(data)))
+ if self.credentials:
+ import base64
+ s = ('u%s:%s' % self.credentials).encode('utf-8')
+ s = 'Basic ' + base64.b64encode(s).strip()
+ h.putheader('Authorization', s)
h.endheaders(data if self.method == "POST" else None)
- h.getreply() #can't do anything with the result
+ h.getresponse() #can't do anything with the result
except (KeyboardInterrupt, SystemExit):
raise
except:
@@ -1133,6 +1138,8 @@ class MemoryHandler(BufferingHandler):
For a MemoryHandler, flushing means just sending the buffered
records to the target, if there is one. Override if you want
different behaviour.
+
+ The record buffer is also cleared by this operation.
"""
if self.target:
for record in self.buffer:
@@ -1146,3 +1153,175 @@ class MemoryHandler(BufferingHandler):
self.flush()
self.target = None
BufferingHandler.close(self)
+
+
+class QueueHandler(logging.Handler):
+ """
+ This handler sends events to a queue. Typically, it would be used together
+ with a multiprocessing Queue to centralise logging to file in one process
+ (in a multi-process application), so as to avoid file write contention
+ between processes.
+
+ This code is new in Python 3.2, but this class can be copy pasted into
+ user code for use with earlier Python versions.
+ """
+
+ def __init__(self, queue):
+ """
+ Initialise an instance, using the passed queue.
+ """
+ logging.Handler.__init__(self)
+ self.queue = queue
+
+ def enqueue(self, record):
+ """
+ Enqueue a record.
+
+ The base implementation uses put_nowait. You may want to override
+ this method if you want to use blocking, timeouts or custom queue
+ implementations.
+ """
+ self.queue.put_nowait(record)
+
+ def prepare(self, record):
+ """
+ Prepares a record for queuing. The object returned by this method is
+ enqueued.
+
+ The base implementation formats the record to merge the message
+ and arguments, and removes unpickleable items from the record
+ in-place.
+
+ You might want to override this method if you want to convert
+ the record to a dict or JSON string, or send a modified copy
+ of the record while leaving the original intact.
+ """
+ # The format operation gets traceback text into record.exc_text
+ # (if there's exception data), and also puts the message into
+ # record.message. We can then use this to replace the original
+ # msg + args, as these might be unpickleable. We also zap the
+ # exc_info attribute, as it's no longer needed and, if not None,
+ # will typically not be pickleable.
+ self.format(record)
+ record.msg = record.message
+ record.args = None
+ record.exc_info = None
+ return record
+
+ def emit(self, record):
+ """
+ Emit a record.
+
+ Writes the LogRecord to the queue, preparing it for pickling first.
+ """
+ try:
+ self.enqueue(self.prepare(record))
+ except (KeyboardInterrupt, SystemExit):
+ raise
+ except:
+ self.handleError(record)
+
+if threading:
+ class QueueListener(object):
+ """
+ This class implements an internal threaded listener which watches for
+ LogRecords being added to a queue, removes them and passes them to a
+ list of handlers for processing.
+ """
+ _sentinel = None
+
+ def __init__(self, queue, *handlers):
+ """
+ Initialise an instance with the specified queue and
+ handlers.
+ """
+ self.queue = queue
+ self.handlers = handlers
+ self._stop = threading.Event()
+ self._thread = None
+
+ def dequeue(self, block):
+ """
+ Dequeue a record and return it, optionally blocking.
+
+ The base implementation uses get. You may want to override this method
+ if you want to use timeouts or work with custom queue implementations.
+ """
+ return self.queue.get(block)
+
+ def start(self):
+ """
+ Start the listener.
+
+ This starts up a background thread to monitor the queue for
+ LogRecords to process.
+ """
+ self._thread = t = threading.Thread(target=self._monitor)
+ t.setDaemon(True)
+ t.start()
+
+ def prepare(self , record):
+ """
+ Prepare a record for handling.
+
+ This method just returns the passed-in record. You may want to
+ override this method if you need to do any custom marshalling or
+ manipulation of the record before passing it to the handlers.
+ """
+ return record
+
+ def handle(self, record):
+ """
+ Handle a record.
+
+ This just loops through the handlers offering them the record
+ to handle.
+ """
+ record = self.prepare(record)
+ for handler in self.handlers:
+ handler.handle(record)
+
+ def _monitor(self):
+ """
+ Monitor the queue for records, and ask the handler
+ to deal with them.
+
+ This method runs on a separate, internal thread.
+ The thread will terminate if it sees a sentinel object in the queue.
+ """
+ q = self.queue
+ has_task_done = hasattr(q, 'task_done')
+ while not self._stop.isSet():
+ try:
+ record = self.dequeue(True)
+ if record is self._sentinel:
+ break
+ self.handle(record)
+ if has_task_done:
+ q.task_done()
+ except queue.Empty:
+ pass
+ # There might still be records in the queue.
+ while True:
+ try:
+ record = self.dequeue(False)
+ if record is self._sentinel:
+ break
+ self.handle(record)
+ if has_task_done:
+ q.task_done()
+ except queue.Empty:
+ break
+
+ def stop(self):
+ """
+ Stop the listener.
+
+ This asks the thread to terminate, and then waits for it to do so.
+ Note that if you don't call this before your application exits, there
+ may be some records still left on the queue, which won't be processed.
+ """
+ self._stop.set()
+ self.queue.put_nowait(self._sentinel)
+ self._thread.join()
+ self._thread = None
diff --git a/Lib/macpath.py b/Lib/macpath.py
index 3b3e4ff071..1615d9122a 100644
--- a/Lib/macpath.py
+++ b/Lib/macpath.py
@@ -32,6 +32,9 @@ def _get_colon(path):
# Normalize the case of a pathname. Dummy in Posix, but <s>.lower() here.
def normcase(path):
+ if not isinstance(path, (bytes, str)):
+ raise TypeError("normcase() argument must be str or bytes, "
+ "not '{}'".format(path.__class__.__name__))
return path.lower()
@@ -199,4 +202,4 @@ def realpath(path):
pass
return path
-supports_unicode_filenames = False
+supports_unicode_filenames = True
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
index 71a8e9915c..0e4f99bcaf 100644
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
@@ -15,6 +15,7 @@ import calendar
import socket
import errno
import copy
+import warnings
import email
import email.message
import email.generator
@@ -31,6 +32,8 @@ __all__ = [ 'Mailbox', 'Maildir', 'mbox', 'MH', 'Babyl', 'MMDF',
'Message', 'MaildirMessage', 'mboxMessage', 'MHMessage',
'BabylMessage', 'MMDFMessage']
+linesep = os.linesep.encode('ascii')
+
class Mailbox:
"""A group of messages in a particular place."""
@@ -80,7 +83,14 @@ class Mailbox:
raise NotImplementedError('Method must be implemented by subclass')
def get_string(self, key):
- """Return a string representation or raise a KeyError."""
+ """Return a string representation or raise a KeyError.
+
+ Uses email.message.Message to create a 7bit clean string
+ representation of the message."""
+ return email.message_from_bytes(self.get_bytes(key)).as_string()
+
+ def get_bytes(self, key):
+ """Return a byte string representation or raise a KeyError."""
raise NotImplementedError('Method must be implemented by subclass')
def get_file(self, key):
@@ -186,31 +196,55 @@ class Mailbox:
"""Flush and close the mailbox."""
raise NotImplementedError('Method must be implemented by subclass')
+ def _string_to_bytes(self, message):
+ # If a message is not 7bit clean, we refuse to handle it since it
+ # likely came from reading invalid messages in text mode, and that way
+ # lies mojibake.
+ try:
+ return message.encode('ascii')
+ except UnicodeError:
+ raise ValueError("String input must be ASCII-only; "
+ "use bytes or a Message instead")
+
def _dump_message(self, message, target, mangle_from_=False):
- # This assumes the target file is open in *text* mode with the
- # desired encoding and newline setting.
+ # This assumes the target file is open in binary mode.
"""Dump message contents to target file."""
if isinstance(message, email.message.Message):
- buffer = io.StringIO()
- gen = email.generator.Generator(buffer, mangle_from_, 0)
+ buffer = io.BytesIO()
+ gen = email.generator.BytesGenerator(buffer, mangle_from_, 0)
gen.flatten(message)
buffer.seek(0)
data = buffer.read()
- ##data = data.replace('\n', os.linesep)
+ data = data.replace(b'\n', linesep)
target.write(data)
- elif isinstance(message, str):
+ elif isinstance(message, (str, bytes, io.StringIO)):
+ if isinstance(message, io.StringIO):
+ warnings.warn("Use of StringIO input is deprecated, "
+ "use BytesIO instead", DeprecationWarning, 3)
+ message = message.getvalue()
+ if isinstance(message, str):
+ message = self._string_to_bytes(message)
if mangle_from_:
- message = message.replace('\nFrom ', '\n>From ')
- ##message = message.replace('\n', os.linesep)
+ message = message.replace(b'\nFrom ', b'\n>From ')
+ message = message.replace(b'\n', linesep)
target.write(message)
elif hasattr(message, 'read'):
+ if hasattr(message, 'buffer'):
+ warnings.warn("Use of text mode files is deprecated, "
+ "use a binary mode file instead", DeprecationWarning, 3)
+ message = message.buffer
while True:
line = message.readline()
+ # Universal newline support.
+ if line.endswith(b'\r\n'):
+ line = line[:-2] + b'\n'
+ elif line.endswith(b'\r'):
+ line = line[:-1] + b'\n'
if not line:
break
- if mangle_from_ and line.startswith('From '):
- line = '>From ' + line[5:]
- ##line = line.replace('\n', os.linesep)
+ if mangle_from_ and line.startswith(b'From '):
+ line = b'>From ' + line[5:]
+ line = line.replace(b'\n', linesep)
target.write(line)
else:
raise TypeError('Invalid message type: %s' % type(message))
@@ -248,8 +282,11 @@ class Maildir(Mailbox):
tmp_file = self._create_tmp()
try:
self._dump_message(message, tmp_file)
- finally:
- _sync_close(tmp_file)
+ except BaseException:
+ tmp_file.close()
+ os.remove(tmp_file.name)
+ raise
+ _sync_close(tmp_file)
if isinstance(message, MaildirMessage):
subdir = message.get_subdir()
suffix = self.colon + message.get_info()
@@ -318,7 +355,7 @@ class Maildir(Mailbox):
def get_message(self, key):
"""Return a Message representation or raise a KeyError."""
subpath = self._lookup(key)
- f = open(os.path.join(self._path, subpath), 'r', newline='')
+ f = open(os.path.join(self._path, subpath), 'rb')
try:
if self._factory:
msg = self._factory(f)
@@ -333,17 +370,17 @@ class Maildir(Mailbox):
msg.set_date(os.path.getmtime(os.path.join(self._path, subpath)))
return msg
- def get_string(self, key):
- """Return a string representation or raise a KeyError."""
- f = open(os.path.join(self._path, self._lookup(key)), 'r', newline='')
+ def get_bytes(self, key):
+ """Return a bytes representation or raise a KeyError."""
+ f = open(os.path.join(self._path, self._lookup(key)), 'rb')
try:
- return f.read()
+ return f.read().replace(linesep, b'\n')
finally:
f.close()
def get_file(self, key):
"""Return a file-like representation or raise a KeyError."""
- f = open(os.path.join(self._path, self._lookup(key)), 'r', newline='')
+ f = open(os.path.join(self._path, self._lookup(key)), 'rb')
return _ProxyFile(f)
def iterkeys(self):
@@ -536,15 +573,15 @@ class _singlefileMailbox(Mailbox):
"""Initialize a single-file mailbox."""
Mailbox.__init__(self, path, factory, create)
try:
- f = open(self._path, 'r+', newline='')
+ f = open(self._path, 'rb+')
except IOError as e:
if e.errno == errno.ENOENT:
if create:
- f = open(self._path, 'w+', newline='')
+ f = open(self._path, 'wb+')
else:
raise NoSuchMailboxError(self._path)
- elif e.errno == errno.EACCES:
- f = open(self._path, 'r', newline='')
+ elif e.errno in (errno.EACCES, errno.EROFS):
+ f = open(self._path, 'rb')
else:
raise
self._file = f
@@ -692,9 +729,14 @@ class _singlefileMailbox(Mailbox):
def _append_message(self, message):
"""Append message to mailbox and return (start, stop) offsets."""
self._file.seek(0, 2)
- self._pre_message_hook(self._file)
- offsets = self._install_message(message)
- self._post_message_hook(self._file)
+ before = self._file.tell()
+ try:
+ self._pre_message_hook(self._file)
+ offsets = self._install_message(message)
+ self._post_message_hook(self._file)
+ except BaseException:
+ self._file.truncate(before)
+ raise
self._file.flush()
self._file_length = self._file.tell() # Record current length of mailbox
return offsets
@@ -710,20 +752,25 @@ class _mboxMMDF(_singlefileMailbox):
"""Return a Message representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
- from_line = self._file.readline().replace(os.linesep, '')
+ from_line = self._file.readline().replace(linesep, b'')
string = self._file.read(stop - self._file.tell())
- msg = self._message_factory(string.replace(os.linesep, '\n'))
- msg.set_from(from_line[5:])
+ msg = self._message_factory(string.replace(linesep, b'\n'))
+ msg.set_from(from_line[5:].decode('ascii'))
return msg
def get_string(self, key, from_=False):
"""Return a string representation or raise a KeyError."""
+ return email.message_from_bytes(
+ self.get_bytes(key)).as_string(unixfrom=from_)
+
+ def get_bytes(self, key, from_=False):
+ """Return a string representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
if not from_:
self._file.readline()
string = self._file.read(stop - self._file.tell())
- return string.replace(os.linesep, '\n')
+ return string.replace(linesep, b'\n')
def get_file(self, key, from_=False):
"""Return a file-like representation or raise a KeyError."""
@@ -736,22 +783,27 @@ class _mboxMMDF(_singlefileMailbox):
def _install_message(self, message):
"""Format a message and blindly write to self._file."""
from_line = None
- if isinstance(message, str) and message.startswith('From '):
- newline = message.find('\n')
+ if isinstance(message, str):
+ message = self._string_to_bytes(message)
+ if isinstance(message, bytes) and message.startswith(b'From '):
+ newline = message.find(b'\n')
if newline != -1:
from_line = message[:newline]
message = message[newline + 1:]
else:
from_line = message
- message = ''
+ message = b''
elif isinstance(message, _mboxMMDFMessage):
- from_line = 'From ' + message.get_from()
+ author = message.get_from().encode('ascii')
+ from_line = b'From ' + author
elif isinstance(message, email.message.Message):
from_line = message.get_unixfrom() # May be None.
+ if from_line is not None:
+ from_line = from_line.encode('ascii')
if from_line is None:
- from_line = 'From MAILER-DAEMON %s' % time.asctime(time.gmtime())
+ from_line = b'From MAILER-DAEMON ' + time.asctime(time.gmtime()).encode()
start = self._file.tell()
- self._file.write(from_line + os.linesep)
+ self._file.write(from_line + linesep)
self._dump_message(message, self._file, self._mangle_from_)
stop = self._file.tell()
return (start, stop)
@@ -770,7 +822,7 @@ class mbox(_mboxMMDF):
def _pre_message_hook(self, f):
"""Called before writing each message to file f."""
if f.tell() != 0:
- f.write(os.linesep)
+ f.write(linesep)
def _generate_toc(self):
"""Generate key-to-(start, stop) table of contents."""
@@ -779,9 +831,9 @@ class mbox(_mboxMMDF):
while True:
line_pos = self._file.tell()
line = self._file.readline()
- if line.startswith('From '):
+ if line.startswith(b'From '):
if len(stops) < len(starts):
- stops.append(line_pos - len(os.linesep))
+ stops.append(line_pos - len(linesep))
starts.append(line_pos)
elif not line:
stops.append(line_pos)
@@ -801,11 +853,11 @@ class MMDF(_mboxMMDF):
def _pre_message_hook(self, f):
"""Called before writing each message to file f."""
- f.write('\001\001\001\001' + os.linesep)
+ f.write(b'\001\001\001\001' + linesep)
def _post_message_hook(self, f):
"""Called after writing each message to file f."""
- f.write(os.linesep + '\001\001\001\001' + os.linesep)
+ f.write(linesep + b'\001\001\001\001' + linesep)
def _generate_toc(self):
"""Generate key-to-(start, stop) table of contents."""
@@ -816,14 +868,14 @@ class MMDF(_mboxMMDF):
line_pos = next_pos
line = self._file.readline()
next_pos = self._file.tell()
- if line.startswith('\001\001\001\001' + os.linesep):
+ if line.startswith(b'\001\001\001\001' + linesep):
starts.append(next_pos)
while True:
line_pos = next_pos
line = self._file.readline()
next_pos = self._file.tell()
- if line == '\001\001\001\001' + os.linesep:
- stops.append(line_pos - len(os.linesep))
+ if line == b'\001\001\001\001' + linesep:
+ stops.append(line_pos - len(linesep))
break
elif not line:
stops.append(line_pos)
@@ -860,18 +912,29 @@ class MH(Mailbox):
new_key = max(keys) + 1
new_path = os.path.join(self._path, str(new_key))
f = _create_carefully(new_path)
+ closed = False
try:
if self._locked:
_lock_file(f)
try:
- self._dump_message(message, f)
+ try:
+ self._dump_message(message, f)
+ except BaseException:
+ # Unlock and close so it can be deleted on Windows
+ if self._locked:
+ _unlock_file(f)
+ _sync_close(f)
+ closed = True
+ os.remove(new_path)
+ raise
if isinstance(message, MHMessage):
self._dump_sequences(message, new_key)
finally:
if self._locked:
_unlock_file(f)
finally:
- _sync_close(f)
+ if not closed:
+ _sync_close(f)
return new_key
def remove(self, key):
@@ -884,23 +947,15 @@ class MH(Mailbox):
raise KeyError('No message with key: %s' % key)
else:
raise
- try:
- if self._locked:
- _lock_file(f)
- try:
- f.close()
- os.remove(os.path.join(self._path, str(key)))
- finally:
- if self._locked:
- _unlock_file(f)
- finally:
+ else:
f.close()
+ os.remove(path)
def __setitem__(self, key, message):
"""Replace the keyed message; raise KeyError if it doesn't exist."""
path = os.path.join(self._path, str(key))
try:
- f = open(path, 'r+', newline='')
+ f = open(path, 'rb+')
except IOError as e:
if e.errno == errno.ENOENT:
raise KeyError('No message with key: %s' % key)
@@ -924,9 +979,9 @@ class MH(Mailbox):
"""Return a Message representation or raise a KeyError."""
try:
if self._locked:
- f = open(os.path.join(self._path, str(key)), 'r+', newline='')
+ f = open(os.path.join(self._path, str(key)), 'rb+')
else:
- f = open(os.path.join(self._path, str(key)), 'r', newline='')
+ f = open(os.path.join(self._path, str(key)), 'rb')
except IOError as e:
if e.errno == errno.ENOENT:
raise KeyError('No message with key: %s' % key)
@@ -947,13 +1002,13 @@ class MH(Mailbox):
msg.add_sequence(name)
return msg
- def get_string(self, key):
- """Return a string representation or raise a KeyError."""
+ def get_bytes(self, key):
+ """Return a bytes representation or raise a KeyError."""
try:
if self._locked:
- f = open(os.path.join(self._path, str(key)), 'r+', newline='')
+ f = open(os.path.join(self._path, str(key)), 'rb+')
else:
- f = open(os.path.join(self._path, str(key)), 'r', newline='')
+ f = open(os.path.join(self._path, str(key)), 'rb')
except IOError as e:
if e.errno == errno.ENOENT:
raise KeyError('No message with key: %s' % key)
@@ -963,7 +1018,7 @@ class MH(Mailbox):
if self._locked:
_lock_file(f)
try:
- return f.read()
+ return f.read().replace(linesep, b'\n')
finally:
if self._locked:
_unlock_file(f)
@@ -973,7 +1028,7 @@ class MH(Mailbox):
def get_file(self, key):
"""Return a file-like representation or raise a KeyError."""
try:
- f = open(os.path.join(self._path, str(key)), 'r', newline='')
+ f = open(os.path.join(self._path, str(key)), 'rb')
except IOError as e:
if e.errno == errno.ENOENT:
raise KeyError('No message with key: %s' % key)
@@ -1051,7 +1106,7 @@ class MH(Mailbox):
def get_sequences(self):
"""Return a name-to-key-list dictionary to define each sequence."""
results = {}
- f = open(os.path.join(self._path, '.mh_sequences'), 'r', newline='')
+ f = open(os.path.join(self._path, '.mh_sequences'), 'r')
try:
all_keys = set(self.keys())
for line in f:
@@ -1077,13 +1132,13 @@ class MH(Mailbox):
def set_sequences(self, sequences):
"""Set sequences using the given name-to-key-list dictionary."""
- f = open(os.path.join(self._path, '.mh_sequences'), 'r+', newline='')
+ f = open(os.path.join(self._path, '.mh_sequences'), 'r+')
try:
os.close(os.open(f.name, os.O_WRONLY | os.O_TRUNC))
for name, keys in sequences.items():
if len(keys) == 0:
continue
- f.write('%s:' % name)
+ f.write(name + ':')
prev = None
completing = False
for key in sorted(set(keys)):
@@ -1178,50 +1233,55 @@ class Babyl(_singlefileMailbox):
"""Return a Message representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
- self._file.readline() # Skip '1,' line specifying labels.
- original_headers = io.StringIO()
+ self._file.readline() # Skip b'1,' line specifying labels.
+ original_headers = io.BytesIO()
while True:
line = self._file.readline()
- if line == '*** EOOH ***' + os.linesep or not line:
+ if line == b'*** EOOH ***' + linesep or not line:
break
- original_headers.write(line.replace(os.linesep, '\n'))
- visible_headers = io.StringIO()
+ original_headers.write(line.replace(linesep, b'\n'))
+ visible_headers = io.BytesIO()
while True:
line = self._file.readline()
- if line == os.linesep or not line:
+ if line == linesep or not line:
break
- visible_headers.write(line.replace(os.linesep, '\n'))
- body = self._file.read(stop - self._file.tell()).replace(os.linesep,
- '\n')
+ visible_headers.write(line.replace(linesep, b'\n'))
+ # Read up to the stop, or to the end
+ n = stop - self._file.tell()
+ assert n >= 0
+ body = self._file.read(n)
+ body = body.replace(linesep, b'\n')
msg = BabylMessage(original_headers.getvalue() + body)
msg.set_visible(visible_headers.getvalue())
if key in self._labels:
msg.set_labels(self._labels[key])
return msg
- def get_string(self, key):
+ def get_bytes(self, key):
"""Return a string representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
- self._file.readline() # Skip '1,' line specifying labels.
- original_headers = io.StringIO()
+ self._file.readline() # Skip b'1,' line specifying labels.
+ original_headers = io.BytesIO()
while True:
line = self._file.readline()
- if line == '*** EOOH ***' + os.linesep or not line:
+ if line == b'*** EOOH ***' + linesep or not line:
break
- original_headers.write(line.replace(os.linesep, '\n'))
+ original_headers.write(line.replace(linesep, b'\n'))
while True:
line = self._file.readline()
- if line == os.linesep or not line:
+ if line == linesep or not line:
break
- return original_headers.getvalue() + \
- self._file.read(stop - self._file.tell()).replace(os.linesep,
- '\n')
+ headers = original_headers.getvalue()
+ n = stop - self._file.tell()
+ assert n >= 0
+ data = self._file.read(n)
+ data = data.replace(linesep, b'\n')
+ return headers + data
def get_file(self, key):
"""Return a file-like representation or raise a KeyError."""
- return io.StringIO(self.get_string(key).replace('\n',
- os.linesep))
+ return io.BytesIO(self.get_bytes(key).replace(b'\n', linesep))
def get_labels(self):
"""Return a list of user-defined labels in the mailbox."""
@@ -1242,19 +1302,19 @@ class Babyl(_singlefileMailbox):
line_pos = next_pos
line = self._file.readline()
next_pos = self._file.tell()
- if line == '\037\014' + os.linesep:
+ if line == b'\037\014' + linesep:
if len(stops) < len(starts):
- stops.append(line_pos - len(os.linesep))
+ stops.append(line_pos - len(linesep))
starts.append(next_pos)
labels = [label.strip() for label
- in self._file.readline()[1:].split(',')
+ in self._file.readline()[1:].split(b',')
if label.strip()]
label_lists.append(labels)
- elif line == '\037' or line == '\037' + os.linesep:
+ elif line == b'\037' or line == b'\037' + linesep:
if len(stops) < len(starts):
- stops.append(line_pos - len(os.linesep))
+ stops.append(line_pos - len(linesep))
elif not line:
- stops.append(line_pos - len(os.linesep))
+ stops.append(line_pos - len(linesep))
break
self._toc = dict(enumerate(zip(starts, stops)))
self._labels = dict(enumerate(label_lists))
@@ -1264,17 +1324,21 @@ class Babyl(_singlefileMailbox):
def _pre_mailbox_hook(self, f):
"""Called before writing the mailbox to file f."""
- f.write('BABYL OPTIONS:%sVersion: 5%sLabels:%s%s\037' %
- (os.linesep, os.linesep, ','.join(self.get_labels()),
- os.linesep))
+ babyl = b'BABYL OPTIONS:' + linesep
+ babyl += b'Version: 5' + linesep
+ labels = self.get_labels()
+ labels = (label.encode() for label in labels)
+ babyl += b'Labels:' + b','.join(labels) + linesep
+ babyl += b'\037'
+ f.write(babyl)
def _pre_message_hook(self, f):
"""Called before writing each message to file f."""
- f.write('\014' + os.linesep)
+ f.write(b'\014' + linesep)
def _post_message_hook(self, f):
"""Called after writing each message to file f."""
- f.write(os.linesep + '\037')
+ f.write(linesep + b'\037')
def _install_message(self, message):
"""Write message contents and return (start, stop)."""
@@ -1287,68 +1351,80 @@ class Babyl(_singlefileMailbox):
special_labels.append(label)
else:
labels.append(label)
- self._file.write('1')
+ self._file.write(b'1')
for label in special_labels:
- self._file.write(', ' + label)
- self._file.write(',,')
+ self._file.write(b', ' + label.encode())
+ self._file.write(b',,')
for label in labels:
- self._file.write(' ' + label + ',')
- self._file.write(os.linesep)
+ self._file.write(b' ' + label.encode() + b',')
+ self._file.write(linesep)
else:
- self._file.write('1,,' + os.linesep)
+ self._file.write(b'1,,' + linesep)
if isinstance(message, email.message.Message):
- orig_buffer = io.StringIO()
- orig_generator = email.generator.Generator(orig_buffer, False, 0)
+ orig_buffer = io.BytesIO()
+ orig_generator = email.generator.BytesGenerator(orig_buffer, False, 0)
orig_generator.flatten(message)
orig_buffer.seek(0)
while True:
line = orig_buffer.readline()
- self._file.write(line.replace('\n', os.linesep))
- if line == '\n' or not line:
+ self._file.write(line.replace(b'\n', linesep))
+ if line == b'\n' or not line:
break
- self._file.write('*** EOOH ***' + os.linesep)
+ self._file.write(b'*** EOOH ***' + linesep)
if isinstance(message, BabylMessage):
- vis_buffer = io.StringIO()
- vis_generator = email.generator.Generator(vis_buffer, False, 0)
+ vis_buffer = io.BytesIO()
+ vis_generator = email.generator.BytesGenerator(vis_buffer, False, 0)
vis_generator.flatten(message.get_visible())
while True:
line = vis_buffer.readline()
- self._file.write(line.replace('\n', os.linesep))
- if line == '\n' or not line:
+ self._file.write(line.replace(b'\n', linesep))
+ if line == b'\n' or not line:
break
else:
orig_buffer.seek(0)
while True:
line = orig_buffer.readline()
- self._file.write(line.replace('\n', os.linesep))
- if line == '\n' or not line:
+ self._file.write(line.replace(b'\n', linesep))
+ if line == b'\n' or not line:
break
while True:
buffer = orig_buffer.read(4096) # Buffer size is arbitrary.
if not buffer:
break
- self._file.write(buffer.replace('\n', os.linesep))
- elif isinstance(message, str):
- body_start = message.find('\n\n') + 2
+ self._file.write(buffer.replace(b'\n', linesep))
+ elif isinstance(message, (bytes, str, io.StringIO)):
+ if isinstance(message, io.StringIO):
+ warnings.warn("Use of StringIO input is deprecated, "
+ "use BytesIO instead", DeprecationWarning, 3)
+ message = message.getvalue()
+ if isinstance(message, str):
+ message = self._string_to_bytes(message)
+ body_start = message.find(b'\n\n') + 2
if body_start - 2 != -1:
- self._file.write(message[:body_start].replace('\n',
- os.linesep))
- self._file.write('*** EOOH ***' + os.linesep)
- self._file.write(message[:body_start].replace('\n',
- os.linesep))
- self._file.write(message[body_start:].replace('\n',
- os.linesep))
+ self._file.write(message[:body_start].replace(b'\n', linesep))
+ self._file.write(b'*** EOOH ***' + linesep)
+ self._file.write(message[:body_start].replace(b'\n', linesep))
+ self._file.write(message[body_start:].replace(b'\n', linesep))
else:
- self._file.write('*** EOOH ***' + os.linesep + os.linesep)
- self._file.write(message.replace('\n', os.linesep))
+ self._file.write(b'*** EOOH ***' + linesep + linesep)
+ self._file.write(message.replace(b'\n', linesep))
elif hasattr(message, 'readline'):
+ if hasattr(message, 'buffer'):
+ warnings.warn("Use of text mode files is deprecated, "
+ "use a binary mode file instead", DeprecationWarning, 3)
+ message = message.buffer
original_pos = message.tell()
first_pass = True
while True:
line = message.readline()
- self._file.write(line.replace('\n', os.linesep))
- if line == '\n' or not line:
- self._file.write('*** EOOH ***' + os.linesep)
+ # Universal newline support.
+ if line.endswith(b'\r\n'):
+ line = line[:-2] + b'\n'
+ elif line.endswith(b'\r'):
+ line = line[:-1] + b'\n'
+ self._file.write(line.replace(b'\n', linesep))
+ if line == b'\n' or not line:
+ self._file.write(b'*** EOOH ***' + linesep)
if first_pass:
first_pass = False
message.seek(original_pos)
@@ -1358,7 +1434,7 @@ class Babyl(_singlefileMailbox):
buffer = message.read(4096) # Buffer size is arbitrary.
if not buffer:
break
- self._file.write(buffer.replace('\n', os.linesep))
+ self._file.write(buffer.replace(b'\n', linesep))
else:
raise TypeError('Invalid message type: %s' % type(message))
stop = self._file.tell()
@@ -1374,10 +1450,14 @@ class Message(email.message.Message):
self._become_message(copy.deepcopy(message))
if isinstance(message, Message):
message._explain_to(self)
+ elif isinstance(message, bytes):
+ self._become_message(email.message_from_bytes(message))
elif isinstance(message, str):
self._become_message(email.message_from_string(message))
- elif hasattr(message, "read"):
+ elif isinstance(message, io.TextIOWrapper):
self._become_message(email.message_from_file(message))
+ elif hasattr(message, "read"):
+ self._become_message(email.message_from_binary_file(message))
elif message is None:
email.message.Message.__init__(self)
else:
@@ -1641,7 +1721,7 @@ class MHMessage(Message):
if not sequence in self._sequences:
self._sequences.append(sequence)
else:
- raise TypeError('sequence must be a string: %s' % type(sequence))
+ raise TypeError('sequence type must be str: %s' % type(sequence))
def remove_sequence(self, sequence):
"""Remove sequence from the list of sequences including the message."""
@@ -1801,6 +1881,10 @@ class _ProxyFile:
"""Read bytes."""
return self._read(size, self._file.read)
+ def read1(self, size=None):
+ """Read bytes."""
+ return self._read(size, self._file.read1)
+
def readline(self, size=None):
"""Read a line."""
return self._read(size, self._file.readline)
@@ -1837,6 +1921,8 @@ class _ProxyFile:
def close(self):
"""Close the file."""
+ if hasattr(self._file, 'close'):
+ self._file.close()
del self._file
def _read(self, size, read_method):
@@ -1848,6 +1934,29 @@ class _ProxyFile:
self._pos = self._file.tell()
return result
+ def __enter__(self):
+ """Context manager protocol support."""
+ return self
+
+ def __exit__(self, *exc):
+ self.close()
+
+ def readable(self):
+ return self._file.readable()
+
+ def writable(self):
+ return self._file.writable()
+
+ def seekable(self):
+ return self._file.seekable()
+
+ def flush(self):
+ return self._file.flush()
+
+ @property
+ def closed(self):
+ return self._file.closed
+
class _PartialFile(_ProxyFile):
"""A read-only wrapper of part of a file."""
@@ -1876,11 +1985,16 @@ class _PartialFile(_ProxyFile):
"""Read size bytes using read_method, honoring start and stop."""
remaining = self._stop - self._pos
if remaining <= 0:
- return ''
+ return b''
if size is None or size < 0 or size > remaining:
size = remaining
return _ProxyFile._read(self, size, read_method)
+ def close(self):
+ # do *not* close the underlying file object for partial files,
+ # since it's global to the mailbox object
+ del self._file
+
def _lock_file(f, dotlock=True):
"""Lock file f using lockf and dot locking."""
@@ -1890,7 +2004,7 @@ def _lock_file(f, dotlock=True):
try:
fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError as e:
- if e.errno in (errno.EAGAIN, errno.EACCES):
+ if e.errno in (errno.EAGAIN, errno.EACCES, errno.EROFS):
raise ExternalClashError('lockf: lock unavailable: %s' %
f.name)
else:
@@ -1900,7 +2014,7 @@ def _lock_file(f, dotlock=True):
pre_lock = _create_temporary(f.name + '.lock')
pre_lock.close()
except IOError as e:
- if e.errno == errno.EACCES:
+ if e.errno in (errno.EACCES, errno.EROFS):
return # Without write access, just skip dotlocking.
else:
raise
@@ -1938,7 +2052,7 @@ def _create_carefully(path):
"""Create a file if it doesn't exist and open for reading and writing."""
fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0o666)
try:
- return open(path, 'r+', newline='')
+ return open(path, 'rb+')
finally:
os.close(fd)
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
index 874037e871..2ef71f9482 100644
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -18,13 +18,19 @@ types_map -- dictionary mapping suffixes to types
Functions:
-init([files]) -- parse a list of files, default knownfiles
+init([files]) -- parse a list of files, default knownfiles (on Windows, the
+ default values are taken from the registry)
read_mime_types(file) -- parse one file, return a dictionary or None
"""
import os
+import sys
import posixpath
import urllib.parse
+try:
+ import winreg as _winreg
+except ImportError:
+ _winreg = None
__all__ = [
"guess_type","guess_extension","guess_all_extensions",
@@ -219,6 +225,45 @@ class MimeTypes:
for suff in suffixes:
self.add_type(type, '.' + suff, strict)
+ def read_windows_registry(self, strict=True):
+ """
+ Load the MIME types database from Windows registry.
+
+ If strict is true, information will be added to
+ list of standard types, else to the list of non-standard
+ types.
+ """
+
+ # Windows only
+ if not _winreg:
+ return
+
+ def enum_types(mimedb):
+ i = 0
+ while True:
+ try:
+ ctype = _winreg.EnumKey(mimedb, i)
+ except EnvironmentError:
+ break
+ else:
+ yield ctype
+ i += 1
+
+ default_encoding = sys.getdefaultencoding()
+ with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,
+ r'MIME\Database\Content Type') as mimedb:
+ for ctype in enum_types(mimedb):
+ try:
+ with _winreg.OpenKey(mimedb, ctype) as key:
+ suffix, datatype = _winreg.QueryValueEx(key,
+ 'Extension')
+ except EnvironmentError:
+ continue
+ if datatype != _winreg.REG_SZ:
+ continue
+ self.add_type(ctype, suffix, strict)
+
+
def guess_type(url, strict=True):
"""Guess the type of a file based on its URL.
@@ -298,6 +343,8 @@ def init(files=None):
inited = True # so that MimeTypes.__init__() doesn't call us again
db = MimeTypes()
if files is None:
+ if _winreg:
+ db.read_windows_registry()
files = knownfiles
for file in files:
if os.path.isfile(file):
@@ -327,6 +374,7 @@ def _default_mime_types():
global common_types
suffix_map = {
+ '.svgz': '.svg.gz',
'.tgz': '.tar.gz',
'.taz': '.tar.gz',
'.tz': '.tar.gz',
@@ -340,7 +388,7 @@ def _default_mime_types():
}
# Before adding new types, make sure they are either registered with IANA,
- # at http://www.isi.edu/in-notes/iana/assignments/media-types
+ # at http://www.iana.org/assignments/media-types
# or extensions, i.e. using the x- prefix
# If you add to these, please keep them sorted!
@@ -441,6 +489,7 @@ def _default_mime_types():
'.src' : 'application/x-wais-source',
'.sv4cpio': 'application/x-sv4cpio',
'.sv4crc' : 'application/x-sv4crc',
+ '.svg' : 'image/svg+xml',
'.swf' : 'application/x-shockwave-flash',
'.t' : 'application/x-troff',
'.tar' : 'application/x-tar',
@@ -491,7 +540,6 @@ _default_mime_types()
if __name__ == '__main__':
- import sys
import getopt
USAGE = """\
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py
index 478c74912d..646a7852ba 100644
--- a/Lib/modulefinder.py
+++ b/Lib/modulefinder.py
@@ -105,16 +105,16 @@ class ModuleFinder:
def run_script(self, pathname):
self.msg(2, "run_script", pathname)
- fp = open(pathname, READ_MODE)
- stuff = ("", "r", imp.PY_SOURCE)
- self.load_module('__main__', fp, pathname, stuff)
+ with open(pathname, READ_MODE) as fp:
+ stuff = ("", "r", imp.PY_SOURCE)
+ self.load_module('__main__', fp, pathname, stuff)
def load_file(self, pathname):
dir, name = os.path.split(pathname)
name, ext = os.path.splitext(name)
- fp = open(pathname, READ_MODE)
- stuff = (ext, "r", imp.PY_SOURCE)
- self.load_module(name, fp, pathname, stuff)
+ with open(pathname, READ_MODE) as fp:
+ stuff = (ext, "r", imp.PY_SOURCE)
+ self.load_module(name, fp, pathname, stuff)
def import_hook(self, name, caller=None, fromlist=None, level=-1):
self.msg(3, "import_hook", name, caller, fromlist, level)
@@ -451,9 +451,13 @@ class ModuleFinder:
m.__path__ = m.__path__ + packagePathMap.get(fqname, [])
fp, buf, stuff = self.find_module("__init__", m.__path__)
- self.load_module(fqname, fp, buf, stuff)
- self.msgout(2, "load_package ->", m)
- return m
+ try:
+ self.load_module(fqname, fp, buf, stuff)
+ self.msgout(2, "load_package ->", m)
+ return m
+ finally:
+ if fp:
+ fp.close()
def add_module(self, fqname):
if fqname in self.modules:
diff --git a/Lib/msilib/__init__.py b/Lib/msilib/__init__.py
index dbdb32527d..6eff89c54b 100644
--- a/Lib/msilib/__init__.py
+++ b/Lib/msilib/__init__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2005 Martin v. Löwis
# Licensed to PSF under a Contributor Agreement.
from _msi import *
diff --git a/Lib/multiprocessing/__init__.py b/Lib/multiprocessing/__init__.py
index fdd012ea4e..deb031c367 100644
--- a/Lib/multiprocessing/__init__.py
+++ b/Lib/multiprocessing/__init__.py
@@ -223,12 +223,12 @@ def JoinableQueue(maxsize=0):
from multiprocessing.queues import JoinableQueue
return JoinableQueue(maxsize)
-def Pool(processes=None, initializer=None, initargs=()):
+def Pool(processes=None, initializer=None, initargs=(), maxtasksperchild=None):
'''
Returns a process pool object
'''
from multiprocessing.pool import Pool
- return Pool(processes, initializer, initargs)
+ return Pool(processes, initializer, initargs, maxtasksperchild)
def RawValue(typecode_or_type, *args):
'''
diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py
index 846d3964d6..d6c23fb0ec 100644
--- a/Lib/multiprocessing/connection.py
+++ b/Lib/multiprocessing/connection.py
@@ -281,25 +281,24 @@ def SocketClient(address):
Return a connection object connected to the socket given by `address`
'''
family = address_type(address)
- s = socket.socket( getattr(socket, family) )
- t = _init_timeout()
+ with socket.socket( getattr(socket, family) ) as s:
+ t = _init_timeout()
- while 1:
- try:
- s.connect(address)
- except socket.error as e:
- if e.args[0] != errno.ECONNREFUSED or _check_timeout(t):
- debug('failed to connect to address %s', address)
- raise
- time.sleep(0.01)
+ while 1:
+ try:
+ s.connect(address)
+ except socket.error as e:
+ if e.args[0] != errno.ECONNREFUSED or _check_timeout(t):
+ debug('failed to connect to address %s', address)
+ raise
+ time.sleep(0.01)
+ else:
+ break
else:
- break
- else:
- raise
+ raise
- fd = duplicate(s.fileno())
+ fd = duplicate(s.fileno())
conn = _multiprocessing.Connection(fd)
- s.close()
return conn
#
diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py
index 0300a4b8c2..cc7c326c07 100644
--- a/Lib/multiprocessing/forking.py
+++ b/Lib/multiprocessing/forking.py
@@ -460,12 +460,20 @@ def prepare(data):
process.ORIGINAL_DIR = data['orig_dir']
if 'main_path' in data:
+ # XXX (ncoghlan): The following code makes several bogus
+ # assumptions regarding the relationship between __file__
+ # and a module's real name. See PEP 302 and issue #10845
main_path = data['main_path']
main_name = os.path.splitext(os.path.basename(main_path))[0]
if main_name == '__init__':
main_name = os.path.basename(os.path.dirname(main_path))
- if main_name != 'ipython':
+ if main_name == '__main__':
+ main_module = sys.modules['__main__']
+ main_module.__file__ = main_path
+ elif main_name != 'ipython':
+ # Main modules not actually called __main__.py may
+ # contain additional code that should still be executed
import imp
if main_path is None:
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index b77c693806..388bfe3c87 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -58,7 +58,7 @@ from multiprocessing.util import Finalize, info
#
def reduce_array(a):
- return array.array, (a.typecode, a.tostring())
+ return array.array, (a.typecode, a.tobytes())
ForkingPickler.register(array.array, reduce_array)
view_types = [type(getattr({}, name)()) for name in ('items','keys','values')]
diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index fc03a0a66c..92170f2ee8 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -68,7 +68,25 @@ def mapstar(args):
# Code run by worker processes
#
-def worker(inqueue, outqueue, initializer=None, initargs=()):
+class MaybeEncodingError(Exception):
+ """Wraps possible unpickleable errors, so they can be
+ safely sent through the socket."""
+
+ def __init__(self, exc, value):
+ self.exc = repr(exc)
+ self.value = repr(value)
+ super(MaybeEncodingError, self).__init__(self.exc, self.value)
+
+ def __str__(self):
+ return "Error sending result: '%s'. Reason: '%s'" % (self.value,
+ self.exc)
+
+ def __repr__(self):
+ return "<MaybeEncodingError: %s>" % str(self)
+
+
+def worker(inqueue, outqueue, initializer=None, initargs=(), maxtasks=None):
+ assert maxtasks is None or (type(maxtasks) == int and maxtasks > 0)
put = outqueue.put
get = inqueue.get
if hasattr(inqueue, '_writer'):
@@ -78,7 +96,8 @@ def worker(inqueue, outqueue, initializer=None, initargs=()):
if initializer is not None:
initializer(*initargs)
- while 1:
+ completed = 0
+ while maxtasks is None or (maxtasks and completed < maxtasks):
try:
task = get()
except (EOFError, IOError):
@@ -94,7 +113,15 @@ def worker(inqueue, outqueue, initializer=None, initargs=()):
result = (True, func(*args, **kwds))
except Exception as e:
result = (False, e)
- put((job, i, result))
+ try:
+ put((job, i, result))
+ except Exception as e:
+ wrapped = MaybeEncodingError(e, result[1])
+ debug("Possible encoding error while sending result: %s" % (
+ wrapped))
+ put((job, i, (False, wrapped)))
+ completed += 1
+ debug('worker exiting after %d tasks' % completed)
#
# Class representing a process pool
@@ -106,11 +133,15 @@ class Pool(object):
'''
Process = Process
- def __init__(self, processes=None, initializer=None, initargs=()):
+ def __init__(self, processes=None, initializer=None, initargs=(),
+ maxtasksperchild=None):
self._setup_queues()
self._taskqueue = queue.Queue()
self._cache = {}
self._state = RUN
+ self._maxtasksperchild = maxtasksperchild
+ self._initializer = initializer
+ self._initargs = initargs
if processes is None:
try:
@@ -121,16 +152,18 @@ class Pool(object):
if initializer is not None and not hasattr(initializer, '__call__'):
raise TypeError('initializer must be a callable')
+ self._processes = processes
self._pool = []
- for i in range(processes):
- w = self.Process(
- target=worker,
- args=(self._inqueue, self._outqueue, initializer, initargs)
- )
- self._pool.append(w)
- w.name = w.name.replace('Process', 'PoolWorker')
- w.daemon = True
- w.start()
+ self._repopulate_pool()
+
+ self._worker_handler = threading.Thread(
+ target=Pool._handle_workers,
+ args=(self, )
+ )
+ self._worker_handler.daemon = True
+ self._worker_handler._state = RUN
+ self._worker_handler.start()
+
self._task_handler = threading.Thread(
target=Pool._handle_tasks,
@@ -151,10 +184,48 @@ class Pool(object):
self._terminate = Finalize(
self, self._terminate_pool,
args=(self._taskqueue, self._inqueue, self._outqueue, self._pool,
- self._task_handler, self._result_handler, self._cache),
+ self._worker_handler, self._task_handler,
+ self._result_handler, self._cache),
exitpriority=15
)
+ def _join_exited_workers(self):
+ """Cleanup after any worker processes which have exited due to reaching
+ their specified lifetime. Returns True if any workers were cleaned up.
+ """
+ cleaned = False
+ for i in reversed(range(len(self._pool))):
+ worker = self._pool[i]
+ if worker.exitcode is not None:
+ # worker exited
+ debug('cleaning up worker %d' % i)
+ worker.join()
+ cleaned = True
+ del self._pool[i]
+ return cleaned
+
+ def _repopulate_pool(self):
+ """Bring the number of pool processes up to the specified number,
+ for use after reaping workers which have exited.
+ """
+ for i in range(self._processes - len(self._pool)):
+ w = self.Process(target=worker,
+ args=(self._inqueue, self._outqueue,
+ self._initializer,
+ self._initargs, self._maxtasksperchild)
+ )
+ self._pool.append(w)
+ w.name = w.name.replace('Process', 'PoolWorker')
+ w.daemon = True
+ w.start()
+ debug('added worker')
+
+ def _maintain_pool(self):
+ """Clean up any exited workers and start replacements for them.
+ """
+ if self._join_exited_workers():
+ self._repopulate_pool()
+
def _setup_queues(self):
from .queues import SimpleQueue
self._inqueue = SimpleQueue()
@@ -213,16 +284,18 @@ class Pool(object):
for i, x in enumerate(task_batches)), result._set_length))
return (item for chunk in result for item in chunk)
- def apply_async(self, func, args=(), kwds={}, callback=None):
+ def apply_async(self, func, args=(), kwds={}, callback=None,
+ error_callback=None):
'''
Asynchronous version of `apply()` method.
'''
assert self._state == RUN
- result = ApplyResult(self._cache, callback)
+ result = ApplyResult(self._cache, callback, error_callback)
self._taskqueue.put(([(result._job, None, func, args, kwds)], None))
return result
- def map_async(self, func, iterable, chunksize=None, callback=None):
+ def map_async(self, func, iterable, chunksize=None, callback=None,
+ error_callback=None):
'''
Asynchronous version of `map()` method.
'''
@@ -238,12 +311,22 @@ class Pool(object):
chunksize = 0
task_batches = Pool._get_tasks(func, iterable, chunksize)
- result = MapResult(self._cache, chunksize, len(iterable), callback)
+ result = MapResult(self._cache, chunksize, len(iterable), callback,
+ error_callback=error_callback)
self._taskqueue.put((((result._job, i, mapstar, (x,), {})
for i, x in enumerate(task_batches)), None))
return result
@staticmethod
+ def _handle_workers(pool):
+ while pool._worker_handler._state == RUN and pool._state == RUN:
+ pool._maintain_pool()
+ time.sleep(0.1)
+ # send sentinel to stop workers
+ pool._taskqueue.put(None)
+ debug('worker handler exiting')
+
+ @staticmethod
def _handle_tasks(taskqueue, put, outqueue, pool):
thread = threading.current_thread()
@@ -358,16 +441,18 @@ class Pool(object):
debug('closing pool')
if self._state == RUN:
self._state = CLOSE
- self._taskqueue.put(None)
+ self._worker_handler._state = CLOSE
def terminate(self):
debug('terminating pool')
self._state = TERMINATE
+ self._worker_handler._state = TERMINATE
self._terminate()
def join(self):
debug('joining pool')
assert self._state in (CLOSE, TERMINATE)
+ self._worker_handler.join()
self._task_handler.join()
self._result_handler.join()
for p in self._pool:
@@ -384,12 +469,12 @@ class Pool(object):
@classmethod
def _terminate_pool(cls, taskqueue, inqueue, outqueue, pool,
- task_handler, result_handler, cache):
+ worker_handler, task_handler, result_handler, cache):
# this is guaranteed to only be called once
debug('finalizing pool')
+ worker_handler._state = TERMINATE
task_handler._state = TERMINATE
- taskqueue.put(None) # sentinel
debug('helping task handler/workers to finish')
cls._help_stuff_finish(inqueue, task_handler, len(pool))
@@ -399,16 +484,23 @@ class Pool(object):
result_handler._state = TERMINATE
outqueue.put(None) # sentinel
+ # We must wait for the worker handler to exit before terminating
+ # workers because we don't want workers to be restarted behind our back.
+ debug('joining worker handler')
+ worker_handler.join()
+
+ # Terminate workers which haven't already finished.
if pool and hasattr(pool[0], 'terminate'):
debug('terminating workers')
for p in pool:
- p.terminate()
+ if p.exitcode is None:
+ p.terminate()
debug('joining task handler')
- task_handler.join(1e100)
+ task_handler.join()
debug('joining result handler')
- result_handler.join(1e100)
+ result_handler.join()
if pool and hasattr(pool[0], 'terminate'):
debug('joining pool workers')
@@ -424,12 +516,13 @@ class Pool(object):
class ApplyResult(object):
- def __init__(self, cache, callback):
+ def __init__(self, cache, callback, error_callback):
self._cond = threading.Condition(threading.Lock())
self._job = next(job_counter)
self._cache = cache
self._ready = False
self._callback = callback
+ self._error_callback = error_callback
cache[self._job] = self
def ready(self):
@@ -460,6 +553,8 @@ class ApplyResult(object):
self._success, self._value = obj
if self._callback and self._success:
self._callback(self._value)
+ if self._error_callback and not self._success:
+ self._error_callback(self._value)
self._cond.acquire()
try:
self._ready = True
@@ -474,8 +569,9 @@ class ApplyResult(object):
class MapResult(ApplyResult):
- def __init__(self, cache, chunksize, length, callback):
- ApplyResult.__init__(self, cache, callback)
+ def __init__(self, cache, chunksize, length, callback, error_callback):
+ ApplyResult.__init__(self, cache, callback,
+ error_callback=error_callback)
self._success = True
self._value = [None] * length
self._chunksize = chunksize
@@ -500,10 +596,11 @@ class MapResult(ApplyResult):
self._cond.notify()
finally:
self._cond.release()
-
else:
self._success = False
self._value = result
+ if self._error_callback:
+ self._error_callback(self._value)
del self._cache[self._job]
self._cond.acquire()
try:
diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py
index 617d0b6868..70ae82569c 100644
--- a/Lib/multiprocessing/synchronize.py
+++ b/Lib/multiprocessing/synchronize.py
@@ -243,7 +243,7 @@ class Condition(object):
try:
# wait for notification or timeout
- self._wait_semaphore.acquire(True, timeout)
+ ret = self._wait_semaphore.acquire(True, timeout)
finally:
# indicate that this thread has woken
self._woken_count.release()
@@ -251,6 +251,7 @@ class Condition(object):
# reacquire lock
for i in range(count):
self._lock.acquire()
+ return ret
def notify(self):
assert self._lock._semlock._is_mine(), 'lock is not owned'
diff --git a/Lib/nntplib.py b/Lib/nntplib.py
index 326c62df47..bf66734a52 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -1,4 +1,7 @@
-"""An NNTP client class based on RFC 977: Network News Transfer Protocol.
+"""An NNTP client class based on:
+- RFC 977: Network News Transfer Protocol
+- RFC 2980: Common NNTP Extensions
+- RFC 3977: Network News Transfer Protocol (version 2)
Example:
@@ -27,15 +30,60 @@ are strings, not numbers, since they are rarely used for calculations.
# RFC 977 by Brian Kantor and Phil Lapsley.
# xover, xgtitle, xpath, date methods by Kevan Heydon
+# Incompatible changes from the 2.x nntplib:
+# - all commands are encoded as UTF-8 data (using the "surrogateescape"
+# error handler), except for raw message data (POST, IHAVE)
+# - all responses are decoded as UTF-8 data (using the "surrogateescape"
+# error handler), except for raw message data (ARTICLE, HEAD, BODY)
+# - the `file` argument to various methods is keyword-only
+#
+# - NNTP.date() returns a datetime object
+# - NNTP.newgroups() and NNTP.newnews() take a datetime (or date) object,
+# rather than a pair of (date, time) strings.
+# - NNTP.newgroups() and NNTP.list() return a list of GroupInfo named tuples
+# - NNTP.descriptions() returns a dict mapping group names to descriptions
+# - NNTP.xover() returns a list of dicts mapping field names (header or metadata)
+# to field values; each dict representing a message overview.
+# - NNTP.article(), NNTP.head() and NNTP.body() return a (response, ArticleInfo)
+# tuple.
+# - the "internal" methods have been marked private (they now start with
+# an underscore)
+
+# Other changes from the 2.x/3.1 nntplib:
+# - automatic querying of capabilities at connect
+# - New method NNTP.getcapabilities()
+# - New method NNTP.over()
+# - New helper function decode_header()
+# - NNTP.post() and NNTP.ihave() accept file objects, bytes-like objects and
+# arbitrary iterables yielding lines.
+# - An extensive test suite :-)
+
+# TODO:
+# - return structured data (GroupInfo etc.) everywhere
+# - support HDR
# Imports
import re
import socket
-
-__all__ = ["NNTP","NNTPReplyError","NNTPTemporaryError",
- "NNTPPermanentError","NNTPProtocolError","NNTPDataError",
- "error_reply","error_temp","error_perm","error_proto",
- "error_data",]
+import collections
+import datetime
+import warnings
+
+try:
+ import ssl
+except ImportError:
+ _have_ssl = False
+else:
+ _have_ssl = True
+
+from email.header import decode_header as _email_decode_header
+from socket import _GLOBAL_DEFAULT_TIMEOUT
+
+__all__ = ["NNTP",
+ "NNTPReplyError", "NNTPTemporaryError", "NNTPPermanentError",
+ "NNTPProtocolError", "NNTPDataError",
+ "decode_header",
+ ]
# Exceptions raised when an error or invalid response is received
class NNTPError(Exception):
@@ -67,39 +115,203 @@ class NNTPDataError(NNTPError):
"""Error in response data"""
pass
-# for backwards compatibility
-error_reply = NNTPReplyError
-error_temp = NNTPTemporaryError
-error_perm = NNTPPermanentError
-error_proto = NNTPProtocolError
-error_data = NNTPDataError
-
-
# Standard port used by NNTP servers
NNTP_PORT = 119
-
+NNTP_SSL_PORT = 563
# Response numbers that are followed by additional text (e.g. article)
-LONGRESP = [b'100', b'215', b'220', b'221', b'222', b'224', b'230', b'231', b'282']
-
+_LONGRESP = {
+ '100', # HELP
+ '101', # CAPABILITIES
+ '211', # LISTGROUP (also not multi-line with GROUP)
+ '215', # LIST
+ '220', # ARTICLE
+ '221', # HEAD, XHDR
+ '222', # BODY
+ '224', # OVER, XOVER
+ '225', # HDR
+ '230', # NEWNEWS
+ '231', # NEWGROUPS
+ '282', # XGTITLE
+}
+
+# Default decoded value for LIST OVERVIEW.FMT if not supported
+_DEFAULT_OVERVIEW_FMT = [
+ "subject", "from", "date", "message-id", "references", ":bytes", ":lines"]
+
+# Alternative names allowed in LIST OVERVIEW.FMT response
+_OVERVIEW_FMT_ALTERNATIVES = {
+ 'bytes': ':bytes',
+ 'lines': ':lines',
+}
# Line terminators (we always output CRLF, but accept any of CRLF, CR, LF)
-CRLF = b'\r\n'
+_CRLF = b'\r\n'
+GroupInfo = collections.namedtuple('GroupInfo',
+ ['group', 'last', 'first', 'flag'])
+ArticleInfo = collections.namedtuple('ArticleInfo',
+ ['number', 'message_id', 'lines'])
-# The class itself
-class NNTP:
- def __init__(self, host, port=NNTP_PORT, user=None, password=None,
- readermode=None, usenetrc=True):
+
+# Helper function(s)
+def decode_header(header_str):
+ """Takes an unicode string representing a munged header value
+ and decodes it as a (possibly non-ASCII) readable value."""
+ parts = []
+ for v, enc in _email_decode_header(header_str):
+ if isinstance(v, bytes):
+ parts.append(v.decode(enc or 'ascii'))
+ else:
+ parts.append(v)
+ return ' '.join(parts)
+
+def _parse_overview_fmt(lines):
+ """Parse a list of string representing the response to LIST OVERVIEW.FMT
+ and return a list of header/metadata names.
+ Raises NNTPDataError if the response is not compliant
+ (cf. RFC 3977, section 8.4)."""
+ fmt = []
+ for line in lines:
+ if line[0] == ':':
+ # Metadata name (e.g. ":bytes")
+ name, _, suffix = line[1:].partition(':')
+ name = ':' + name
+ else:
+ # Header name (e.g. "Subject:" or "Xref:full")
+ name, _, suffix = line.partition(':')
+ name = name.lower()
+ name = _OVERVIEW_FMT_ALTERNATIVES.get(name, name)
+ # Should we do something with the suffix?
+ fmt.append(name)
+ defaults = _DEFAULT_OVERVIEW_FMT
+ if len(fmt) < len(defaults):
+ raise NNTPDataError("LIST OVERVIEW.FMT response too short")
+ if fmt[:len(defaults)] != defaults:
+ raise NNTPDataError("LIST OVERVIEW.FMT redefines default fields")
+ return fmt
+
+def _parse_overview(lines, fmt, data_process_func=None):
+ """Parse the response to a OVER or XOVER command according to the
+ overview format `fmt`."""
+ n_defaults = len(_DEFAULT_OVERVIEW_FMT)
+ overview = []
+ for line in lines:
+ fields = {}
+ article_number, *tokens = line.split('\t')
+ article_number = int(article_number)
+ for i, token in enumerate(tokens):
+ if i >= len(fmt):
+ # XXX should we raise an error? Some servers might not
+ # support LIST OVERVIEW.FMT and still return additional
+ # headers.
+ continue
+ field_name = fmt[i]
+ is_metadata = field_name.startswith(':')
+ if i >= n_defaults and not is_metadata:
+ # Non-default header names are included in full in the response
+ # (unless the field is totally empty)
+ h = field_name + ": "
+ if token and token[:len(h)].lower() != h:
+ raise NNTPDataError("OVER/XOVER response doesn't include "
+ "names of additional headers")
+ token = token[len(h):] if token else None
+ fields[fmt[i]] = token
+ overview.append((article_number, fields))
+ return overview
+
+def _parse_datetime(date_str, time_str=None):
+ """Parse a pair of (date, time) strings, and return a datetime object.
+ If only the date is given, it is assumed to be date and time
+ concatenated together (e.g. response to the DATE command).
+ """
+ if time_str is None:
+ time_str = date_str[-6:]
+ date_str = date_str[:-6]
+ hours = int(time_str[:2])
+ minutes = int(time_str[2:4])
+ seconds = int(time_str[4:])
+ year = int(date_str[:-4])
+ month = int(date_str[-4:-2])
+ day = int(date_str[-2:])
+ # RFC 3977 doesn't say how to interpret 2-char years. Assume that
+ # there are no dates before 1970 on Usenet.
+ if year < 70:
+ year += 2000
+ elif year < 100:
+ year += 1900
+ return datetime.datetime(year, month, day, hours, minutes, seconds)
+
+def _unparse_datetime(dt, legacy=False):
+ """Format a date or datetime object as a pair of (date, time) strings
+ in the format required by the NEWNEWS and NEWGROUPS commands. If a
+ date object is passed, the time is assumed to be midnight (00h00).
+
+ The returned representation depends on the legacy flag:
+ * if legacy is False (the default):
+ date has the YYYYMMDD format and time the HHMMSS format
+ * if legacy is True:
+ date has the YYMMDD format and time the HHMMSS format.
+ RFC 3977 compliant servers should understand both formats; therefore,
+ legacy is only needed when talking to old servers.
+ """
+ if not isinstance(dt, datetime.datetime):
+ time_str = "000000"
+ else:
+ time_str = "{0.hour:02d}{0.minute:02d}{0.second:02d}".format(dt)
+ y = dt.year
+ if legacy:
+ y = y % 100
+ date_str = "{0:02d}{1.month:02d}{1.day:02d}".format(y, dt)
+ else:
+ date_str = "{0:04d}{1.month:02d}{1.day:02d}".format(y, dt)
+ return date_str, time_str
+
+
+if _have_ssl:
+
+ def _encrypt_on(sock, context):
+ """Wrap a socket in SSL/TLS. Arguments:
+ - sock: Socket to wrap
+ - context: SSL context to use for the encrypted connection
+ Returns:
+ - sock: New, encrypted socket.
+ """
+ # Generate a default SSL context if none was passed.
+ if context is None:
+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ # SSLv2 considered harmful.
+ context.options |= ssl.OP_NO_SSLv2
+ return context.wrap_socket(sock)
+
+
+# The classes themselves
+class _NNTPBase:
+ # UTF-8 is the character set for all NNTP commands and responses: they
+ # are automatically encoded (when sending) and decoded (and receiving)
+ # by this class.
+ # However, some multi-line data blocks can contain arbitrary bytes (for
+ # example, latin-1 or utf-16 data in the body of a message). Commands
+ # taking (POST, IHAVE) or returning (HEAD, BODY, ARTICLE) raw message
+ # data will therefore only accept and produce bytes objects.
+ # Furthermore, since there could be non-compliant servers out there,
+ # we use 'surrogateescape' as the error handler for fault tolerance
+ # and easy round-tripping. This could be useful for some applications
+ # (e.g. NNTP gateways).
+
+ encoding = 'utf-8'
+ errors = 'surrogateescape'
+
+ def __init__(self, file, host,
+ readermode=None, timeout=_GLOBAL_DEFAULT_TIMEOUT):
"""Initialize an instance. Arguments:
- - host: hostname to connect to
- - port: port to connect to (default the standard NNTP port)
- - user: username to authenticate with
- - password: password to use with username
+ - file: file-like object (open for read/write in binary mode)
+ - host: hostname of the server
- readermode: if true, send 'mode reader' command after
connecting.
+ - timeout: timeout (in seconds) used for socket connections
readermode is sometimes necessary if you are connecting to an
NNTP server on the local machine and intend to call
@@ -108,65 +320,31 @@ class NNTP:
readermode.
"""
self.host = host
- self.port = port
- self.sock = socket.create_connection((host, port))
- self.file = self.sock.makefile('rb')
+ self.file = file
self.debugging = 0
- self.welcome = self.getresp()
-
- # 'mode reader' is sometimes necessary to enable 'reader' mode.
- # However, the order in which 'mode reader' and 'authinfo' need to
- # arrive differs between some NNTP servers. Try to send
- # 'mode reader', and if it fails with an authorization failed
- # error, try again after sending authinfo.
- readermode_afterauth = 0
+ self.welcome = self._getresp()
+
+ # 'MODE READER' is sometimes necessary to enable 'reader' mode.
+ # However, the order in which 'MODE READER' and 'AUTHINFO' need to
+ # arrive differs between some NNTP servers. If _setreadermode() fails
+ # with an authorization failed error, it will set this to True;
+ # the login() routine will interpret that as a request to try again
+ # after performing its normal function.
+ self.readermode_afterauth = False
if readermode:
- try:
- self.welcome = self.shortcmd('mode reader')
- except NNTPPermanentError:
- # error 500, probably 'not implemented'
- pass
- except NNTPTemporaryError as e:
- if user and e.response.startswith(b'480'):
- # Need authorization before 'mode reader'
- readermode_afterauth = 1
- else:
- raise
- # If no login/password was specified, try to get them from ~/.netrc
- # Presume that if .netc has an entry, NNRP authentication is required.
- try:
- if usenetrc and not user:
- import netrc
- credentials = netrc.netrc()
- auth = credentials.authenticators(host)
- if auth:
- user = auth[0]
- password = auth[2]
- except IOError:
- pass
- # Perform NNRP authentication if needed.
- if user:
- resp = self.shortcmd('authinfo user '+user)
- if resp.startswith(b'381'):
- if not password:
- raise NNTPReplyError(resp)
- else:
- resp = self.shortcmd(
- 'authinfo pass '+password)
- if not resp.startswith(b'281'):
- raise NNTPPermanentError(resp)
- if readermode_afterauth:
- try:
- self.welcome = self.shortcmd('mode reader')
- except NNTPPermanentError:
- # error 500, probably 'not implemented'
- pass
-
-
- # Get the welcome message from the server
- # (this is read and squirreled away by __init__()).
- # If the response code is 200, posting is allowed;
- # if it 201, posting is not allowed
+ self._setreadermode()
+
+ # RFC 4642 2.2.2: Both the client and the server MUST know if there is
+ # a TLS session active. A client MUST NOT attempt to start a TLS
+ # session if a TLS session is already active.
+ self.tls_on = False
+
+ # Inquire about capabilities (RFC 3977).
+ self._caps = None
+ self.getcapabilities()
+
+ # Log in and encryption setup order is left to subclasses.
+ self.authenticated = False
def getwelcome(self):
"""Get the welcome message from the server
@@ -177,6 +355,28 @@ class NNTP:
if self.debugging: print('*welcome*', repr(self.welcome))
return self.welcome
+ def getcapabilities(self):
+ """Get the server capabilities, as read by __init__().
+ If the CAPABILITIES command is not supported, an empty dict is
+ returned."""
+ if self._caps is None:
+ self.nntp_version = 1
+ self.nntp_implementation = None
+ try:
+ resp, caps = self.capabilities()
+ except NNTPPermanentError:
+ # Server doesn't support capabilities
+ self._caps = {}
+ else:
+ self._caps = caps
+ if 'VERSION' in caps:
+ # The server can advertise several supported versions,
+ # choose the highest.
+ self.nntp_version = max(map(int, caps['VERSION']))
+ if 'IMPLEMENTATION' in caps:
+ self.nntp_implementation = ' '.join(caps['IMPLEMENTATION'])
+ return self._caps
+
def set_debuglevel(self, level):
"""Set the debugging level. Argument 'level' means:
0: no debugging output (default)
@@ -186,121 +386,226 @@ class NNTP:
self.debugging = level
debug = set_debuglevel
- def putline(self, line):
- """Internal: send one line to the server, appending CRLF."""
- line = line + CRLF
+ def _putline(self, line):
+ """Internal: send one line to the server, appending CRLF.
+ The `line` must be a bytes-like object."""
+ line = line + _CRLF
if self.debugging > 1: print('*put*', repr(line))
- self.sock.sendall(line)
+ self.file.write(line)
+ self.file.flush()
- def putcmd(self, line):
- """Internal: send one command to the server (through putline())."""
+ def _putcmd(self, line):
+ """Internal: send one command to the server (through _putline()).
+ The `line` must be an unicode string."""
if self.debugging: print('*cmd*', repr(line))
- line = bytes(line, "ASCII")
- self.putline(line)
+ line = line.encode(self.encoding, self.errors)
+ self._putline(line)
- def getline(self):
- """Internal: return one line from the server, stripping CRLF.
- Raise EOFError if the connection is closed."""
+ def _getline(self, strip_crlf=True):
+ """Internal: return one line from the server, stripping _CRLF.
+ Raise EOFError if the connection is closed.
+ Returns a bytes object."""
line = self.file.readline()
if self.debugging > 1:
print('*get*', repr(line))
if not line: raise EOFError
- if line[-2:] == CRLF:
- line = line[:-2]
- elif line[-1:] in CRLF:
- line = line[:-1]
+ if strip_crlf:
+ if line[-2:] == _CRLF:
+ line = line[:-2]
+ elif line[-1:] in _CRLF:
+ line = line[:-1]
return line
- def getresp(self):
+ def _getresp(self):
"""Internal: get a response from the server.
- Raise various errors if the response indicates an error."""
- resp = self.getline()
+ Raise various errors if the response indicates an error.
+ Returns an unicode string."""
+ resp = self._getline()
if self.debugging: print('*resp*', repr(resp))
+ resp = resp.decode(self.encoding, self.errors)
c = resp[:1]
- if c == b'4':
+ if c == '4':
raise NNTPTemporaryError(resp)
- if c == b'5':
+ if c == '5':
raise NNTPPermanentError(resp)
- if c not in b'123':
+ if c not in '123':
raise NNTPProtocolError(resp)
return resp
- def getlongresp(self, file=None):
+ def _getlongresp(self, file=None):
"""Internal: get a response plus following text from the server.
- Raise various errors if the response indicates an error."""
+ Raise various errors if the response indicates an error.
+
+ Returns a (response, lines) tuple where `response` is an unicode
+ string and `lines` is a list of bytes objects.
+ If `file` is a file-like object, it must be open in binary mode.
+ """
openedFile = None
try:
# If a string was passed then open a file with that name
- if isinstance(file, str):
- openedFile = file = open(file, "w")
+ if isinstance(file, (str, bytes)):
+ openedFile = file = open(file, "wb")
- resp = self.getresp()
- if resp[:3] not in LONGRESP:
+ resp = self._getresp()
+ if resp[:3] not in _LONGRESP:
raise NNTPReplyError(resp)
- list = []
- while 1:
- line = self.getline()
- if line == b'.':
- break
- if line.startswith(b'..'):
- line = line[1:]
- if file:
- file.write(line + b'\n')
- else:
- list.append(line)
+
+ lines = []
+ if file is not None:
+ # XXX lines = None instead?
+ terminators = (b'.' + _CRLF, b'.\n')
+ while 1:
+ line = self._getline(False)
+ if line in terminators:
+ break
+ if line.startswith(b'..'):
+ line = line[1:]
+ file.write(line)
+ else:
+ terminator = b'.'
+ while 1:
+ line = self._getline()
+ if line == terminator:
+ break
+ if line.startswith(b'..'):
+ line = line[1:]
+ lines.append(line)
finally:
# If this method created the file, then it must close it
if openedFile:
openedFile.close()
- return resp, list
+ return resp, lines
- def shortcmd(self, line):
- """Internal: send a command and get the response."""
- self.putcmd(line)
- return self.getresp()
+ def _shortcmd(self, line):
+ """Internal: send a command and get the response.
+ Same return value as _getresp()."""
+ self._putcmd(line)
+ return self._getresp()
+
+ def _longcmd(self, line, file=None):
+ """Internal: send a command and get the response plus following text.
+ Same return value as _getlongresp()."""
+ self._putcmd(line)
+ return self._getlongresp(file)
+
+ def _longcmdstring(self, line, file=None):
+ """Internal: send a command and get the response plus following text.
+ Same as _longcmd() and _getlongresp(), except that the returned `lines`
+ are unicode strings rather than bytes objects.
+ """
+ self._putcmd(line)
+ resp, list = self._getlongresp(file)
+ return resp, [line.decode(self.encoding, self.errors)
+ for line in list]
+
+ def _getoverviewfmt(self):
+ """Internal: get the overview format. Queries the server if not
+ already done, else returns the cached value."""
+ try:
+ return self._cachedoverviewfmt
+ except AttributeError:
+ pass
+ try:
+ resp, lines = self._longcmdstring("LIST OVERVIEW.FMT")
+ except NNTPPermanentError:
+ # Not supported by server?
+ fmt = _DEFAULT_OVERVIEW_FMT[:]
+ else:
+ fmt = _parse_overview_fmt(lines)
+ self._cachedoverviewfmt = fmt
+ return fmt
- def longcmd(self, line, file=None):
- """Internal: send a command and get the response plus following text."""
- self.putcmd(line)
- return self.getlongresp(file)
+ def _grouplist(self, lines):
+ # Parse lines into "group last first flag"
+ return [GroupInfo(*line.split()) for line in lines]
- def newgroups(self, date, time, file=None):
- """Process a NEWGROUPS command. Arguments:
- - date: string 'yymmdd' indicating the date
- - time: string 'hhmmss' indicating the time
+ def capabilities(self):
+ """Process a CAPABILITIES command. Not supported by all servers.
Return:
- resp: server response if successful
- - list: list of newsgroup names"""
-
- return self.longcmd('NEWGROUPS ' + date + ' ' + time, file)
+ - caps: a dictionary mapping capability names to lists of tokens
+ (for example {'VERSION': ['2'], 'OVER': [], LIST: ['ACTIVE', 'HEADERS'] })
+ """
+ caps = {}
+ resp, lines = self._longcmdstring("CAPABILITIES")
+ for line in lines:
+ name, *tokens = line.split()
+ caps[name] = tokens
+ return resp, caps
- def newnews(self, group, date, time, file=None):
+ def newgroups(self, date, *, file=None):
+ """Process a NEWGROUPS command. Arguments:
+ - date: a date or datetime object
+ Return:
+ - resp: server response if successful
+ - list: list of newsgroup names
+ """
+ if not isinstance(date, (datetime.date, datetime.date)):
+ raise TypeError(
+ "the date parameter must be a date or datetime object, "
+ "not '{:40}'".format(date.__class__.__name__))
+ date_str, time_str = _unparse_datetime(date, self.nntp_version < 2)
+ cmd = 'NEWGROUPS {0} {1}'.format(date_str, time_str)
+ resp, lines = self._longcmdstring(cmd, file)
+ return resp, self._grouplist(lines)
+
+ def newnews(self, group, date, *, file=None):
"""Process a NEWNEWS command. Arguments:
- group: group name or '*'
- - date: string 'yymmdd' indicating the date
- - time: string 'hhmmss' indicating the time
+ - date: a date or datetime object
Return:
- resp: server response if successful
- - list: list of message ids"""
-
- cmd = 'NEWNEWS ' + group + ' ' + date + ' ' + time
- return self.longcmd(cmd, file)
-
- def list(self, file=None):
- """Process a LIST command. Return:
+ - list: list of message ids
+ """
+ if not isinstance(date, (datetime.date, datetime.date)):
+ raise TypeError(
+ "the date parameter must be a date or datetime object, "
+ "not '{:40}'".format(date.__class__.__name__))
+ date_str, time_str = _unparse_datetime(date, self.nntp_version < 2)
+ cmd = 'NEWNEWS {0} {1} {2}'.format(group, date_str, time_str)
+ return self._longcmdstring(cmd, file)
+
+ def list(self, group_pattern=None, *, file=None):
+ """Process a LIST or LIST ACTIVE command. Arguments:
+ - group_pattern: a pattern indicating which groups to query
+ - file: Filename string or file object to store the result in
+ Returns:
- resp: server response if successful
- - list: list of (group, last, first, flag) (strings)"""
+ - list: list of (group, last, first, flag) (strings)
+ """
+ if group_pattern is not None:
+ command = 'LIST ACTIVE ' + group_pattern
+ else:
+ command = 'LIST'
+ resp, lines = self._longcmdstring(command, file)
+ return resp, self._grouplist(lines)
- resp, list = self.longcmd('LIST', file)
- for i in range(len(list)):
- # Parse lines into "group last first flag"
- list[i] = tuple(list[i].split())
- return resp, list
+ def _getdescriptions(self, group_pattern, return_all):
+ line_pat = re.compile('^(?P<group>[^ \t]+)[ \t]+(.*)$')
+ # Try the more std (acc. to RFC2980) LIST NEWSGROUPS first
+ resp, lines = self._longcmdstring('LIST NEWSGROUPS ' + group_pattern)
+ if not resp.startswith('215'):
+ # Now the deprecated XGTITLE. This either raises an error
+ # or succeeds with the same output structure as LIST
+ # NEWSGROUPS.
+ resp, lines = self._longcmdstring('XGTITLE ' + group_pattern)
+ groups = {}
+ for raw_line in lines:
+ match = line_pat.search(raw_line.strip())
+ if match:
+ name, desc = match.group(1, 2)
+ if not return_all:
+ return desc
+ groups[name] = desc
+ if return_all:
+ return resp, groups
+ else:
+ # Nothing found
+ return ''
def description(self, group):
-
"""Get a description for a single group. If more than one
group matches ('group' is a pattern), return the first. If no
group matches, return an empty string.
@@ -311,42 +616,24 @@ class NNTP:
NOTE: This neither checks for a wildcard in 'group' nor does
it check whether the group actually exists."""
-
- resp, lines = self.descriptions(group)
- if len(lines) == 0:
- return b''
- else:
- return lines[0][1]
+ return self._getdescriptions(group, False)
def descriptions(self, group_pattern):
"""Get descriptions for a range of groups."""
- line_pat = re.compile(b'^(?P<group>[^ \t]+)[ \t]+(.*)$')
- # Try the more std (acc. to RFC2980) LIST NEWSGROUPS first
- resp, raw_lines = self.longcmd('LIST NEWSGROUPS ' + group_pattern)
- if not resp.startswith(b'215'):
- # Now the deprecated XGTITLE. This either raises an error
- # or succeeds with the same output structure as LIST
- # NEWSGROUPS.
- resp, raw_lines = self.longcmd('XGTITLE ' + group_pattern)
- lines = []
- for raw_line in raw_lines:
- match = line_pat.search(raw_line.strip())
- if match:
- lines.append(match.group(1, 2))
- return resp, lines
+ return self._getdescriptions(group_pattern, True)
def group(self, name):
"""Process a GROUP command. Argument:
- group: the group name
Returns:
- resp: server response if successful
- - count: number of articles (string)
- - first: first article number (string)
- - last: last article number (string)
- - name: the group name"""
-
- resp = self.shortcmd('GROUP ' + name)
- if not resp.startswith(b'211'):
+ - count: number of articles
+ - first: first article number
+ - last: last article number
+ - name: the group name
+ """
+ resp = self._shortcmd('GROUP ' + name)
+ if not resp.startswith('211'):
raise NNTPReplyError(resp)
words = resp.split()
count = first = last = 0
@@ -359,151 +646,177 @@ class NNTP:
last = words[3]
if n > 4:
name = words[4].lower()
- return resp, count, first, last, name
+ return resp, int(count), int(first), int(last), name
- def help(self, file=None):
- """Process a HELP command. Returns:
+ def help(self, *, file=None):
+ """Process a HELP command. Argument:
+ - file: Filename string or file object to store the result in
+ Returns:
- resp: server response if successful
- - list: list of strings"""
-
- return self.longcmd('HELP',file)
+ - list: list of strings returned by the server in response to the
+ HELP command
+ """
+ return self._longcmdstring('HELP', file)
- def statparse(self, resp):
- """Internal: parse the response of a STAT, NEXT or LAST command."""
- if not resp.startswith(b'22'):
+ def _statparse(self, resp):
+ """Internal: parse the response line of a STAT, NEXT, LAST,
+ ARTICLE, HEAD or BODY command."""
+ if not resp.startswith('22'):
raise NNTPReplyError(resp)
words = resp.split()
- nr = 0
- id = b''
- n = len(words)
- if n > 1:
- nr = words[1]
- if n > 2:
- id = words[2]
- return resp, nr, id
+ art_num = int(words[1])
+ message_id = words[2]
+ return resp, art_num, message_id
- def statcmd(self, line):
+ def _statcmd(self, line):
"""Internal: process a STAT, NEXT or LAST command."""
- resp = self.shortcmd(line)
- return self.statparse(resp)
+ resp = self._shortcmd(line)
+ return self._statparse(resp)
- def stat(self, id):
+ def stat(self, message_spec=None):
"""Process a STAT command. Argument:
- - id: article number or message id
+ - message_spec: article number or message id (if not specified,
+ the current article is selected)
Returns:
- resp: server response if successful
- - nr: the article number
- - id: the message id"""
-
- return self.statcmd('STAT {0}'.format(id))
+ - art_num: the article number
+ - message_id: the message id
+ """
+ if message_spec:
+ return self._statcmd('STAT {0}'.format(message_spec))
+ else:
+ return self._statcmd('STAT')
def next(self):
"""Process a NEXT command. No arguments. Return as for STAT."""
- return self.statcmd('NEXT')
+ return self._statcmd('NEXT')
def last(self):
"""Process a LAST command. No arguments. Return as for STAT."""
- return self.statcmd('LAST')
+ return self._statcmd('LAST')
- def artcmd(self, line, file=None):
+ def _artcmd(self, line, file=None):
"""Internal: process a HEAD, BODY or ARTICLE command."""
- resp, list = self.longcmd(line, file)
- resp, nr, id = self.statparse(resp)
- return resp, nr, id, list
+ resp, lines = self._longcmd(line, file)
+ resp, art_num, message_id = self._statparse(resp)
+ return resp, ArticleInfo(art_num, message_id, lines)
- def head(self, id):
+ def head(self, message_spec=None, *, file=None):
"""Process a HEAD command. Argument:
- - id: article number or message id
+ - message_spec: article number or message id
+ - file: filename string or file object to store the headers in
Returns:
- resp: server response if successful
- - nr: article number
- - id: message id
- - list: the lines of the article's header"""
-
- return self.artcmd('HEAD {0}'.format(id))
+ - ArticleInfo: (article number, message id, list of header lines)
+ """
+ if message_spec is not None:
+ cmd = 'HEAD {0}'.format(message_spec)
+ else:
+ cmd = 'HEAD'
+ return self._artcmd(cmd, file)
- def body(self, id, file=None):
+ def body(self, message_spec=None, *, file=None):
"""Process a BODY command. Argument:
- - id: article number or message id
- - file: Filename string or file object to store the article in
+ - message_spec: article number or message id
+ - file: filename string or file object to store the body in
Returns:
- resp: server response if successful
- - nr: article number
- - id: message id
- - list: the lines of the article's body or an empty list
- if file was used"""
-
- return self.artcmd('BODY {0}'.format(id), file)
+ - ArticleInfo: (article number, message id, list of body lines)
+ """
+ if message_spec is not None:
+ cmd = 'BODY {0}'.format(message_spec)
+ else:
+ cmd = 'BODY'
+ return self._artcmd(cmd, file)
- def article(self, id):
+ def article(self, message_spec=None, *, file=None):
"""Process an ARTICLE command. Argument:
- - id: article number or message id
+ - message_spec: article number or message id
+ - file: filename string or file object to store the article in
Returns:
- resp: server response if successful
- - nr: article number
- - id: message id
- - list: the lines of the article"""
-
- return self.artcmd('ARTICLE {0}'.format(id))
+ - ArticleInfo: (article number, message id, list of article lines)
+ """
+ if message_spec is not None:
+ cmd = 'ARTICLE {0}'.format(message_spec)
+ else:
+ cmd = 'ARTICLE'
+ return self._artcmd(cmd, file)
def slave(self):
"""Process a SLAVE command. Returns:
- - resp: server response if successful"""
-
- return self.shortcmd('SLAVE')
+ - resp: server response if successful
+ """
+ return self._shortcmd('SLAVE')
- def xhdr(self, hdr, str, file=None):
+ def xhdr(self, hdr, str, *, file=None):
"""Process an XHDR command (optional server extension). Arguments:
- hdr: the header type (e.g. 'subject')
- str: an article nr, a message id, or a range nr1-nr2
+ - file: Filename string or file object to store the result in
Returns:
- resp: server response if successful
- - list: list of (nr, value) strings"""
-
- pat = re.compile(b'^([0-9]+) ?(.*)\n?')
- resp, lines = self.longcmd('XHDR {0} {1}'.format(hdr, str), file)
- for i in range(len(lines)):
- line = lines[i]
+ - list: list of (nr, value) strings
+ """
+ pat = re.compile('^([0-9]+) ?(.*)\n?')
+ resp, lines = self._longcmdstring('XHDR {0} {1}'.format(hdr, str), file)
+ def remove_number(line):
m = pat.match(line)
- if m:
- lines[i] = m.group(1, 2)
- return resp, lines
+ return m.group(1, 2) if m else line
+ return resp, [remove_number(line) for line in lines]
- def xover(self, start, end, file=None):
+ def xover(self, start, end, *, file=None):
"""Process an XOVER command (optional server extension) Arguments:
- start: start of range
- end: end of range
+ - file: Filename string or file object to store the result in
Returns:
- resp: server response if successful
- - list: list of (art-nr, subject, poster, date,
- id, references, size, lines)"""
+ - list: list of dicts containing the response fields
+ """
+ resp, lines = self._longcmdstring('XOVER {0}-{1}'.format(start, end),
+ file)
+ fmt = self._getoverviewfmt()
+ return resp, _parse_overview(lines, fmt)
+
+ def over(self, message_spec, *, file=None):
+ """Process an OVER command. If the command isn't supported, fall
+ back to XOVER. Arguments:
+ - message_spec:
+ - either a message id, indicating the article to fetch
+ information about
+ - or a (start, end) tuple, indicating a range of article numbers;
+ if end is None, information up to the newest message will be
+ retrieved
+ - or None, indicating the current article number must be used
+ - file: Filename string or file object to store the result in
+ Returns:
+ - resp: server response if successful
+ - list: list of dicts containing the response fields
- resp, lines = self.longcmd('XOVER {0}-{1}'.format(start, end), file)
- xover_lines = []
- for line in lines:
- elem = line.split(b'\t')
- try:
- xover_lines.append((elem[0],
- elem[1],
- elem[2],
- elem[3],
- elem[4],
- elem[5].split(),
- elem[6],
- elem[7]))
- except IndexError:
- raise NNTPDataError(line)
- return resp,xover_lines
-
- def xgtitle(self, group, file=None):
+ NOTE: the "message id" form isn't supported by XOVER
+ """
+ cmd = 'OVER' if 'OVER' in self._caps else 'XOVER'
+ if isinstance(message_spec, (tuple, list)):
+ start, end = message_spec
+ cmd += ' {0}-{1}'.format(start, end or '')
+ elif message_spec is not None:
+ cmd = cmd + ' ' + message_spec
+ resp, lines = self._longcmdstring(cmd, file)
+ fmt = self._getoverviewfmt()
+ return resp, _parse_overview(lines, fmt)
+
+ def xgtitle(self, group, *, file=None):
"""Process an XGTITLE command (optional server extension) Arguments:
- group: group name wildcard (i.e. news.*)
Returns:
- resp: server response if successful
- list: list of (name,title) strings"""
-
- line_pat = re.compile(b'^([^ \t]+)[ \t]+(.*)$')
- resp, raw_lines = self.longcmd('XGTITLE ' + group, file)
+ warnings.warn("The XGTITLE extension is not actively used, "
+ "use descriptions() instead",
+ PendingDeprecationWarning, 2)
+ line_pat = re.compile('^([^ \t]+)[ \t]+(.*)$')
+ resp, raw_lines = self._longcmdstring('XGTITLE ' + group, file)
lines = []
for raw_line in raw_lines:
match = line_pat.search(raw_line.strip())
@@ -511,15 +824,18 @@ class NNTP:
lines.append(match.group(1, 2))
return resp, lines
- def xpath(self,id):
+ def xpath(self, id):
"""Process an XPATH command (optional server extension) Arguments:
- id: Message id of article
Returns:
resp: server response if successful
- path: directory path to article"""
+ path: directory path to article
+ """
+ warnings.warn("The XPATH extension is not actively used",
+ PendingDeprecationWarning, 2)
- resp = self.shortcmd('XPATH {0}'.format(id))
- if not resp.startswith(b'223'):
+ resp = self._shortcmd('XPATH {0}'.format(id))
+ if not resp.startswith('223'):
raise NNTPReplyError(resp)
try:
[resp_num, path] = resp.split()
@@ -528,89 +844,258 @@ class NNTP:
else:
return resp, path
- def date (self):
- """Process the DATE command. Arguments:
- None
+ def date(self):
+ """Process the DATE command.
Returns:
- resp: server response if successful
- date: Date suitable for newnews/newgroups commands etc.
- time: Time suitable for newnews/newgroups commands etc."""
-
- resp = self.shortcmd("DATE")
- if not resp.startswith(b'111'):
+ - resp: server response if successful
+ - date: datetime object
+ """
+ resp = self._shortcmd("DATE")
+ if not resp.startswith('111'):
raise NNTPReplyError(resp)
elem = resp.split()
if len(elem) != 2:
raise NNTPDataError(resp)
- date = elem[1][2:8]
- time = elem[1][-6:]
- if len(date) != 6 or len(time) != 6:
+ date = elem[1]
+ if len(date) != 14:
raise NNTPDataError(resp)
- return resp, date, time
+ return resp, _parse_datetime(date, None)
def _post(self, command, f):
- resp = self.shortcmd(command)
- # Raises error_??? if posting is not allowed
- if not resp.startswith(b'3'):
+ resp = self._shortcmd(command)
+ # Raises a specific exception if posting is not allowed
+ if not resp.startswith('3'):
raise NNTPReplyError(resp)
- while 1:
- line = f.readline()
- if not line:
- break
- if line.endswith(b'\n'):
- line = line[:-1]
+ if isinstance(f, (bytes, bytearray)):
+ f = f.splitlines()
+ # We don't use _putline() because:
+ # - we don't want additional CRLF if the file or iterable is already
+ # in the right format
+ # - we don't want a spurious flush() after each line is written
+ for line in f:
+ if not line.endswith(_CRLF):
+ line = line.rstrip(b"\r\n") + _CRLF
if line.startswith(b'.'):
line = b'.' + line
- self.putline(line)
- self.putline(b'.')
- return self.getresp()
+ self.file.write(line)
+ self.file.write(b".\r\n")
+ self.file.flush()
+ return self._getresp()
- def post(self, f):
+ def post(self, data):
"""Process a POST command. Arguments:
- - f: file containing the article
+ - data: bytes object, iterable or file containing the article
Returns:
- resp: server response if successful"""
- return self._post('POST', f)
+ return self._post('POST', data)
- def ihave(self, id, f):
+ def ihave(self, message_id, data):
"""Process an IHAVE command. Arguments:
- - id: message-id of the article
- - f: file containing the article
+ - message_id: message-id of the article
+ - data: file containing the article
Returns:
- resp: server response if successful
Note that if the server refuses the article an exception is raised."""
- return self._post('IHAVE {0}'.format(id), f)
+ return self._post('IHAVE {0}'.format(message_id), data)
+
+ def _close(self):
+ self.file.close()
+ del self.file
def quit(self):
"""Process a QUIT command and close the socket. Returns:
- resp: server response if successful"""
-
- resp = self.shortcmd('QUIT')
- self.file.close()
- self.sock.close()
- del self.file, self.sock
+ try:
+ resp = self._shortcmd('QUIT')
+ finally:
+ self._close()
return resp
+ def login(self, user=None, password=None, usenetrc=True):
+ if self.authenticated:
+ raise ValueError("Already logged in.")
+ if not user and not usenetrc:
+ raise ValueError(
+ "At least one of `user` and `usenetrc` must be specified")
+ # If no login/password was specified but netrc was requested,
+ # try to get them from ~/.netrc
+ # Presume that if .netrc has an entry, NNRP authentication is required.
+ try:
+ if usenetrc and not user:
+ import netrc
+ credentials = netrc.netrc()
+ auth = credentials.authenticators(self.host)
+ if auth:
+ user = auth[0]
+ password = auth[2]
+ except IOError:
+ pass
+ # Perform NNTP authentication if needed.
+ if not user:
+ return
+ resp = self._shortcmd('authinfo user ' + user)
+ if resp.startswith('381'):
+ if not password:
+ raise NNTPReplyError(resp)
+ else:
+ resp = self._shortcmd('authinfo pass ' + password)
+ if not resp.startswith('281'):
+ raise NNTPPermanentError(resp)
+ # Attempt to send mode reader if it was requested after login.
+ if self.readermode_afterauth:
+ self._setreadermode()
+
+ def _setreadermode(self):
+ try:
+ self.welcome = self._shortcmd('mode reader')
+ except NNTPPermanentError:
+ # Error 5xx, probably 'not implemented'
+ pass
+ except NNTPTemporaryError as e:
+ if e.response.startswith('480'):
+ # Need authorization before 'mode reader'
+ self.readermode_afterauth = True
+ else:
+ raise
+
+ if _have_ssl:
+ def starttls(self, context=None):
+ """Process a STARTTLS command. Arguments:
+ - context: SSL context to use for the encrypted connection
+ """
+ # Per RFC 4642, STARTTLS MUST NOT be sent after authentication or if
+ # a TLS session already exists.
+ if self.tls_on:
+ raise ValueError("TLS is already enabled.")
+ if self.authenticated:
+ raise ValueError("TLS cannot be started after authentication.")
+ resp = self._shortcmd('STARTTLS')
+ if resp.startswith('382'):
+ self.file.close()
+ self.sock = _encrypt_on(self.sock, context)
+ self.file = self.sock.makefile("rwb")
+ self.tls_on = True
+ # Capabilities may change after TLS starts up, so ask for them
+ # again.
+ self._caps = None
+ self.getcapabilities()
+ else:
+ raise NNTPError("TLS failed to start.")
+
+
+class NNTP(_NNTPBase):
+
+ def __init__(self, host, port=NNTP_PORT, user=None, password=None,
+ readermode=None, usenetrc=False,
+ timeout=_GLOBAL_DEFAULT_TIMEOUT):
+ """Initialize an instance. Arguments:
+ - host: hostname to connect to
+ - port: port to connect to (default the standard NNTP port)
+ - user: username to authenticate with
+ - password: password to use with username
+ - readermode: if true, send 'mode reader' command after
+ connecting.
+ - usenetrc: allow loading username and password from ~/.netrc file
+ if not specified explicitly
+ - timeout: timeout (in seconds) used for socket connections
+
+ readermode is sometimes necessary if you are connecting to an
+ NNTP server on the local machine and intend to call
+ reader-specific commands, such as `group'. If you get
+ unexpected NNTPPermanentErrors, you might need to set
+ readermode.
+ """
+ self.host = host
+ self.port = port
+ self.sock = socket.create_connection((host, port), timeout)
+ file = self.sock.makefile("rwb")
+ _NNTPBase.__init__(self, file, host,
+ readermode, timeout)
+ if user or usenetrc:
+ self.login(user, password, usenetrc)
+
+ def _close(self):
+ try:
+ _NNTPBase._close(self)
+ finally:
+ self.sock.close()
+
+
+if _have_ssl:
+ class NNTP_SSL(_NNTPBase):
+
+ def __init__(self, host, port=NNTP_SSL_PORT,
+ user=None, password=None, ssl_context=None,
+ readermode=None, usenetrc=False,
+ timeout=_GLOBAL_DEFAULT_TIMEOUT):
+ """This works identically to NNTP.__init__, except for the change
+ in default port and the `ssl_context` argument for SSL connections.
+ """
+ self.sock = socket.create_connection((host, port), timeout)
+ self.sock = _encrypt_on(self.sock, ssl_context)
+ file = self.sock.makefile("rwb")
+ _NNTPBase.__init__(self, file, host,
+ readermode=readermode, timeout=timeout)
+ if user or usenetrc:
+ self.login(user, password, usenetrc)
+
+ def _close(self):
+ try:
+ _NNTPBase._close(self)
+ finally:
+ self.sock.close()
+
+ __all__.append("NNTP_SSL")
+
# Test retrieval when run as a script.
-# Assumption: if there's a local news server, it's called 'news'.
-# Assumption: if user queries a remote news server, it's named
-# in the environment variable NNTPSERVER (used by slrn and kin)
-# and we want readermode off.
if __name__ == '__main__':
- import os
- newshost = 'news' and os.environ["NNTPSERVER"]
- if newshost.find('.') == -1:
- mode = 'readermode'
+ import argparse
+ from email.utils import parsedate
+
+ parser = argparse.ArgumentParser(description="""\
+ nntplib built-in demo - display the latest articles in a newsgroup""")
+ parser.add_argument('-g', '--group', default='gmane.comp.python.general',
+ help='group to fetch messages from (default: %(default)s)')
+ parser.add_argument('-s', '--server', default='news.gmane.org',
+ help='NNTP server hostname (default: %(default)s)')
+ parser.add_argument('-p', '--port', default=-1, type=int,
+ help='NNTP port number (default: %s / %s)' % (NNTP_PORT, NNTP_SSL_PORT))
+ parser.add_argument('-n', '--nb-articles', default=10, type=int,
+ help='number of articles to fetch (default: %(default)s)')
+ parser.add_argument('-S', '--ssl', action='store_true', default=False,
+ help='use NNTP over SSL')
+ args = parser.parse_args()
+
+ port = args.port
+ if not args.ssl:
+ if port == -1:
+ port = NNTP_PORT
+ s = NNTP(host=args.server, port=port)
else:
- mode = None
- s = NNTP(newshost, readermode=mode)
- resp, count, first, last, name = s.group('comp.lang.python')
- print(resp)
+ if port == -1:
+ port = NNTP_SSL_PORT
+ s = NNTP_SSL(host=args.server, port=port)
+
+ caps = s.getcapabilities()
+ if 'STARTTLS' in caps:
+ s.starttls()
+ resp, count, first, last, name = s.group(args.group)
print('Group', name, 'has', count, 'articles, range', first, 'to', last)
- resp, subs = s.xhdr('subject', '{0}-{1}'.format(first, last))
- print(resp)
- for item in subs:
- print("%7s %s" % item)
- resp = s.quit()
- print(resp)
+
+ def cut(s, lim):
+ if len(s) > lim:
+ s = s[:lim - 4] + "..."
+ return s
+
+ first = str(int(last) - args.nb_articles + 1)
+ resp, overviews = s.xover(first, last)
+ for artnum, over in overviews:
+ author = decode_header(over['from']).split('<', 1)[0]
+ subject = decode_header(over['subject'])
+ lines = int(over[':lines'])
+ print("{:7} {:20} {:42} ({})".format(
+ artnum, cut(author, 20), cut(subject, 42), lines)
+ )
+
+ s.quit()
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index ae9dcf2eaf..ec8a7ab237 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -16,7 +16,8 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"getatime","getctime", "islink","exists","lexists","isdir","isfile",
"ismount", "expanduser","expandvars","normpath","abspath",
"splitunc","curdir","pardir","sep","pathsep","defpath","altsep",
- "extsep","devnull","realpath","supports_unicode_filenames","relpath"]
+ "extsep","devnull","realpath","supports_unicode_filenames","relpath",
+ "samefile", "sameopenfile",]
# strings representing various path-related bits and pieces
# These are primarily for export; internally, they are hardcoded.
@@ -84,6 +85,9 @@ def normcase(s):
"""Normalize case of pathname.
Makes all characters lowercase and all slashes into backslashes."""
+ if not isinstance(s, (bytes, str)):
+ raise TypeError("normcase() argument must be str or bytes, "
+ "not '{}'".format(s.__class__.__name__))
return s.replace(_get_altsep(s), _get_sep(s)).lower()
@@ -239,7 +243,7 @@ def splitunc(p):
"""
import warnings
warnings.warn("ntpath.splitunc is deprecated, use ntpath.splitdrive instead",
- PendingDeprecationWarning)
+ DeprecationWarning)
sep = _get_sep(p)
if not p[1:2]:
return p[:0], p # Drive letter present
@@ -312,16 +316,28 @@ def dirname(p):
return split(p)[0]
# Is a path a symbolic link?
-# This will always return false on systems where posix.lstat doesn't exist.
+# This will always return false on systems where os.lstat doesn't exist.
def islink(path):
- """Test for symbolic link.
- On WindowsNT/95 and OS/2 always returns false
+ """Test whether a path is a symbolic link.
+ This will always return false for Windows prior to 6.0
+ and for OS/2.
"""
- return False
-
-# alias exists to lexists
-lexists = exists
+ try:
+ st = os.lstat(path)
+ except (os.error, AttributeError):
+ return False
+ return stat.S_ISLNK(st.st_mode)
+
+# Being true for dangling symbolic links is also useful.
+
+def lexists(path):
+ """Test whether a path exists. Returns True for broken symbolic links"""
+ try:
+ st = os.lstat(path)
+ except (os.error, WindowsError):
+ return False
+ return True
# Is a path a mount point? Either a root (with or without drive letter)
# or an UNC path with at most a / or \ after the mount point.
@@ -622,3 +638,37 @@ def relpath(path, start=curdir):
if not rel_list:
return _get_dot(path)
return join(*rel_list)
+
+
+# determine if two files are in fact the same file
+try:
+ # GetFinalPathNameByHandle is available starting with Windows 6.0.
+ # Windows XP and non-Windows OS'es will mock _getfinalpathname.
+ if sys.getwindowsversion()[:2] >= (6, 0):
+ from nt import _getfinalpathname
+ else:
+ raise ImportError
+except (AttributeError, ImportError):
+ # On Windows XP and earlier, two files are the same if their absolute
+ # pathnames are the same.
+ # Non-Windows operating systems fake this method with an XP
+ # approximation.
+ def _getfinalpathname(f):
+ return normcase(abspath(f))
+
+def samefile(f1, f2):
+ "Test whether two pathnames reference the same actual file"
+ return _getfinalpathname(f1) == _getfinalpathname(f2)
+
+
+try:
+ from nt import _getfileinformation
+except ImportError:
+ # On other operating systems, just return the fd and see that
+ # it compares equal in sameopenfile.
+ def _getfileinformation(fd):
+ return fd
+
+def sameopenfile(f1, f2):
+ """Test whether two file objects reference the same file"""
+ return _getfileinformation(f1) == _getfileinformation(f2)
diff --git a/Lib/numbers.py b/Lib/numbers.py
index 201dc3cc2b..f35704dd39 100644
--- a/Lib/numbers.py
+++ b/Lib/numbers.py
@@ -303,7 +303,7 @@ class Integral(Rational):
raise NotImplementedError
def __index__(self):
- """index(self)"""
+ """someobject[self]"""
return int(self)
@abstractmethod
diff --git a/Lib/opcode.py b/Lib/opcode.py
index 86ebc5c564..8e15d13e98 100644
--- a/Lib/opcode.py
+++ b/Lib/opcode.py
@@ -48,7 +48,7 @@ def_op('POP_TOP', 1)
def_op('ROT_TWO', 2)
def_op('ROT_THREE', 3)
def_op('DUP_TOP', 4)
-def_op('ROT_FOUR', 5)
+def_op('DUP_TOP_TWO', 5)
def_op('NOP', 9)
def_op('UNARY_POSITIVE', 10)
@@ -116,7 +116,6 @@ name_op('STORE_ATTR', 95) # Index in name list
name_op('DELETE_ATTR', 96) # ""
name_op('STORE_GLOBAL', 97) # ""
name_op('DELETE_GLOBAL', 98) # ""
-def_op('DUP_TOPX', 99) # number of items to duplicate
def_op('LOAD_CONST', 100) # Index in const list
hasconst.append(100)
name_op('LOAD_NAME', 101) # Index in name list
@@ -162,16 +161,20 @@ def_op('LOAD_DEREF', 136)
hasfree.append(136)
def_op('STORE_DEREF', 137)
hasfree.append(137)
+def_op('DELETE_DEREF', 138)
+hasfree.append(138)
def_op('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8)
def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8)
def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8)
-def_op('EXTENDED_ARG', 143)
-EXTENDED_ARG = 143
+
+jrel_op('SETUP_WITH', 143)
def_op('LIST_APPEND', 145)
def_op('SET_ADD', 146)
def_op('MAP_ADD', 147)
+def_op('EXTENDED_ARG', 144)
+EXTENDED_ARG = 144
del def_op, name_op, jrel_op, jabs_op
diff --git a/Lib/os.py b/Lib/os.py
index b46c02f580..a894ee0f2c 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -114,18 +114,26 @@ SEEK_SET = 0
SEEK_CUR = 1
SEEK_END = 2
+
+def _get_masked_mode(mode):
+ mask = umask(0)
+ umask(mask)
+ return mode & ~mask
+
#'
# Super directory utilities.
# (Inspired by Eric Raymond; the doc strings are mostly his)
-def makedirs(name, mode=0o777):
- """makedirs(path [, mode=0o777])
+def makedirs(name, mode=0o777, exist_ok=False):
+ """makedirs(path [, mode=0o777][, exist_ok=False])
Super-mkdir; create a leaf directory and all intermediate ones.
Works like mkdir, except that any intermediate path segment (not
- just the rightmost) will be created if it does not exist. This is
- recursive.
+ just the rightmost) will be created if it does not exist. If the
+ target directory with the same mode as we specified already exists,
+ raises an OSError if exist_ok is False, otherwise no exception is
+ raised. This is recursive.
"""
head, tail = path.split(name)
@@ -133,14 +141,20 @@ def makedirs(name, mode=0o777):
head, tail = path.split(head)
if head and tail and not path.exists(head):
try:
- makedirs(head, mode)
+ makedirs(head, mode, exist_ok)
except OSError as e:
# be happy if someone already created the path
if e.errno != errno.EEXIST:
raise
if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
return
- mkdir(name, mode)
+ try:
+ mkdir(name, mode)
+ except OSError as e:
+ import stat as st
+ if not (e.errno == errno.EEXIST and exist_ok and path.isdir(name) and
+ st.S_IMODE(lstat(name).st_mode) == _get_masked_mode(mode)):
+ raise
def removedirs(name):
"""removedirs(path)
@@ -249,7 +263,7 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
dirs.remove('CVS') # don't visit CVS directories
"""
- from os.path import join, isdir, islink
+ islink, join, isdir = path.islink, path.join, path.isdir
# We may not have read permission for top, in which case we can't
# get a list of the files the directory contains. os.walk
@@ -275,9 +289,9 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
if topdown:
yield top, dirs, nondirs
for name in dirs:
- path = join(top, name)
- if followlinks or not islink(path):
- for x in walk(path, topdown, onerror, followlinks):
+ new_path = join(top, name)
+ if followlinks or not islink(new_path):
+ for x in walk(new_path, topdown, onerror, followlinks):
yield x
if not topdown:
yield top, dirs, nondirs
@@ -342,28 +356,27 @@ __all__.extend(["execl","execle","execlp","execlpe","execvp","execvpe"])
def _execvpe(file, args, env=None):
if env is not None:
- func = execve
+ exec_func = execve
argrest = (args, env)
else:
- func = execv
+ exec_func = execv
argrest = (args,)
env = environ
head, tail = path.split(file)
if head:
- func(file, *argrest)
+ exec_func(file, *argrest)
return
- if 'PATH' in env:
- envpath = env['PATH']
- else:
- envpath = defpath
- PATH = envpath.split(pathsep)
last_exc = saved_exc = None
saved_tb = None
- for dir in PATH:
+ path_list = get_exec_path(env)
+ if name != 'nt':
+ file = fsencode(file)
+ path_list = map(fsencode, path_list)
+ for dir in path_list:
fullname = path.join(dir, file)
try:
- func(fullname, *argrest)
+ exec_func(fullname, *argrest)
except error as e:
last_exc = e
tb = sys.exc_info()[2]
@@ -376,39 +389,89 @@ def _execvpe(file, args, env=None):
raise last_exc.with_traceback(tb)
+def get_exec_path(env=None):
+ """Returns the sequence of directories that will be searched for the
+ named executable (similar to a shell) when launching a process.
+
+ *env* must be an environment variable dict or None. If *env* is None,
+ os.environ will be used.
+ """
+ # Use a local import instead of a global import to limit the number of
+ # modules loaded at startup: the os module is always loaded at startup by
+ # Python. It may also avoid a bootstrap issue.
+ import warnings
+
+ if env is None:
+ env = environ
+
+ # {b'PATH': ...}.get('PATH') and {'PATH': ...}.get(b'PATH') emit a
+ # BytesWarning when using python -b or python -bb: ignore the warning
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", BytesWarning)
+
+ try:
+ path_list = env.get('PATH')
+ except TypeError:
+ path_list = None
+
+ if supports_bytes_environ:
+ try:
+ path_listb = env[b'PATH']
+ except (KeyError, TypeError):
+ pass
+ else:
+ if path_list is not None:
+ raise ValueError(
+ "env cannot contain 'PATH' and b'PATH' keys")
+ path_list = path_listb
+
+ if path_list is not None and isinstance(path_list, bytes):
+ path_list = fsdecode(path_list)
+
+ if path_list is None:
+ path_list = defpath
+ return path_list.split(pathsep)
+
+
# Change environ to automatically call putenv(), unsetenv if they exist.
from _abcoll import MutableMapping # Can't use collections (bootstrap)
class _Environ(MutableMapping):
- def __init__(self, environ, keymap, putenv, unsetenv):
- self.keymap = keymap
+ def __init__(self, data, encodekey, decodekey, encodevalue, decodevalue, putenv, unsetenv):
+ self.encodekey = encodekey
+ self.decodekey = decodekey
+ self.encodevalue = encodevalue
+ self.decodevalue = decodevalue
self.putenv = putenv
self.unsetenv = unsetenv
- self.data = data = {}
- for key, value in environ.items():
- data[keymap(key)] = str(value)
+ self._data = data
def __getitem__(self, key):
- return self.data[self.keymap(key)]
+ value = self._data[self.encodekey(key)]
+ return self.decodevalue(value)
def __setitem__(self, key, value):
- value = str(value)
+ key = self.encodekey(key)
+ value = self.encodevalue(value)
self.putenv(key, value)
- self.data[self.keymap(key)] = value
+ self._data[key] = value
def __delitem__(self, key):
+ key = self.encodekey(key)
self.unsetenv(key)
- del self.data[self.keymap(key)]
+ del self._data[key]
def __iter__(self):
- for key in self.data:
- yield key
+ for key in self._data:
+ yield self.decodekey(key)
def __len__(self):
- return len(self.data)
+ return len(self._data)
def __repr__(self):
- return 'environ({!r})'.format(self.data)
+ return 'environ({{{}}})'.format(', '.join(
+ ('{!r}: {!r}'.format(self.decodekey(key), self.decodevalue(value))
+ for key, value in self._data.items())))
def copy(self):
return dict(self)
@@ -432,21 +495,108 @@ except NameError:
else:
__all__.append("unsetenv")
-if name in ('os2', 'nt'): # Where Env Var Names Must Be UPPERCASE
- _keymap = lambda key: str(key.upper())
-else: # Where Env Var Names Can Be Mixed Case
- _keymap = lambda key: str(key)
-
-environ = _Environ(environ, _keymap, _putenv, _unsetenv)
+def _createenviron():
+ if name in ('os2', 'nt'):
+ # Where Env Var Names Must Be UPPERCASE
+ def check_str(value):
+ if not isinstance(value, str):
+ raise TypeError("str expected, not %s" % type(value).__name__)
+ return value
+ encode = check_str
+ decode = str
+ def encodekey(key):
+ return encode(key).upper()
+ data = {}
+ for key, value in environ.items():
+ data[encodekey(key)] = value
+ else:
+ # Where Env Var Names Can Be Mixed Case
+ encoding = sys.getfilesystemencoding()
+ def encode(value):
+ if not isinstance(value, str):
+ raise TypeError("str expected, not %s" % type(value).__name__)
+ return value.encode(encoding, 'surrogateescape')
+ def decode(value):
+ return value.decode(encoding, 'surrogateescape')
+ encodekey = encode
+ data = environ
+ return _Environ(data,
+ encodekey, decode,
+ encode, decode,
+ _putenv, _unsetenv)
+
+# unicode environ
+environ = _createenviron()
+del _createenviron
def getenv(key, default=None):
"""Get an environment variable, return None if it doesn't exist.
- The optional second argument can specify an alternate default."""
- if isinstance(key, bytes):
- key = key.decode(sys.getfilesystemencoding(), "surrogateescape")
+ The optional second argument can specify an alternate default.
+ key, default and the result are str."""
return environ.get(key, default)
-__all__.append("getenv")
+
+supports_bytes_environ = name not in ('os2', 'nt')
+__all__.extend(("getenv", "supports_bytes_environ"))
+
+if supports_bytes_environ:
+ def _check_bytes(value):
+ if not isinstance(value, bytes):
+ raise TypeError("bytes expected, not %s" % type(value).__name__)
+ return value
+
+ # bytes environ
+ environb = _Environ(environ._data,
+ _check_bytes, bytes,
+ _check_bytes, bytes,
+ _putenv, _unsetenv)
+ del _check_bytes
+
+ def getenvb(key, default=None):
+ """Get an environment variable, return None if it doesn't exist.
+ The optional second argument can specify an alternate default.
+ key, default and the result are bytes."""
+ return environb.get(key, default)
+
+ __all__.extend(("environb", "getenvb"))
+
+def _fscodec():
+ encoding = sys.getfilesystemencoding()
+ if encoding == 'mbcs':
+ errors = 'strict'
+ else:
+ errors = 'surrogateescape'
+
+ def fsencode(filename):
+ """
+ Encode filename to the filesystem encoding with 'surrogateescape' error
+ handler, return bytes unchanged. On Windows, use 'strict' error handler if
+ the file system encoding is 'mbcs' (which is the default encoding).
+ """
+ if isinstance(filename, bytes):
+ return filename
+ elif isinstance(filename, str):
+ return filename.encode(encoding, errors)
+ else:
+ raise TypeError("expect bytes or str, not %s" % type(filename).__name__)
+
+ def fsdecode(filename):
+ """
+ Decode filename from the filesystem encoding with 'surrogateescape' error
+ handler, return str unchanged. On Windows, use 'strict' error handler if
+ the file system encoding is 'mbcs' (which is the default encoding).
+ """
+ if isinstance(filename, str):
+ return filename
+ elif isinstance(filename, bytes):
+ return filename.decode(encoding, errors)
+ else:
+ raise TypeError("expect bytes or str, not %s" % type(filename).__name__)
+
+ return fsencode, fsdecode
+
+fsencode, fsdecode = _fscodec()
+del _fscodec
def _exists(name):
return name in globals()
diff --git a/Lib/os2emxpath.py b/Lib/os2emxpath.py
index 184c9b169a..0ccbf8ae7b 100644
--- a/Lib/os2emxpath.py
+++ b/Lib/os2emxpath.py
@@ -36,6 +36,9 @@ def normcase(s):
"""Normalize case of pathname.
Makes all characters lowercase and all altseps into seps."""
+ if not isinstance(s, (bytes, str)):
+ raise TypeError("normcase() argument must be str or bytes, "
+ "not '{}'".format(s.__class__.__name__))
return s.replace('\\', '/').lower()
diff --git a/Lib/pdb.doc b/Lib/pdb.doc
deleted file mode 100644
index 0d32800ff6..0000000000
--- a/Lib/pdb.doc
+++ /dev/null
@@ -1,202 +0,0 @@
-The Python Debugger Pdb
-=======================
-
-To use the debugger in its simplest form:
-
- >>> import pdb
- >>> pdb.run('<a statement>')
-
-The debugger's prompt is '(Pdb) '. This will stop in the first
-function call in <a statement>.
-
-Alternatively, if a statement terminated with an unhandled exception,
-you can use pdb's post-mortem facility to inspect the contents of the
-traceback:
-
- >>> <a statement>
- <exception traceback>
- >>> import pdb
- >>> pdb.pm()
-
-The commands recognized by the debugger are listed in the next
-section. Most can be abbreviated as indicated; e.g., h(elp) means
-that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel',
-nor as 'H' or 'Help' or 'HELP'). Optional arguments are enclosed in
-square brackets.
-
-A blank line repeats the previous command literally, except for
-'list', where it lists the next 11 lines.
-
-Commands that the debugger doesn't recognize are assumed to be Python
-statements and are executed in the context of the program being
-debugged. Python statements can also be prefixed with an exclamation
-point ('!'). This is a powerful way to inspect the program being
-debugged; it is even possible to change variables. When an exception
-occurs in such a statement, the exception name is printed but the
-debugger's state is not changed.
-
-The debugger supports aliases, which can save typing. And aliases can
-have parameters (see the alias help entry) which allows one a certain
-level of adaptability to the context under examination.
-
-Multiple commands may be entered on a single line, separated by the
-pair ';;'. No intelligence is applied to separating the commands; the
-input is split at the first ';;', even if it is in the middle of a
-quoted string.
-
-If a file ".pdbrc" exists in your home directory or in the current
-directory, it is read in and executed as if it had been typed at the
-debugger prompt. This is particularly useful for aliases. If both
-files exist, the one in the home directory is read first and aliases
-defined there can be overriden by the local file.
-
-Aside from aliases, the debugger is not directly programmable; but it
-is implemented as a class from which you can derive your own debugger
-class, which you can make as fancy as you like.
-
-
-Debugger commands
-=================
-
-h(elp)
- Without argument, print the list of available commands. With
- a command name as argument, print help about that command
- (this is currently not implemented).
-
-w(here)
- Print a stack trace, with the most recent frame at the bottom.
- An arrow indicates the "current frame", which determines the
- context of most commands.
-
-d(own)
- Move the current frame one level down in the stack trace
- (to a newer frame).
-
-u(p)
- Move the current frame one level up in the stack trace
- (to an older frame).
-
-b(reak) [ ([filename:]lineno | function) [, condition] ]
- With a filename:line number argument, set a break there. If
- filename is omitted, use the current file. With a function
- name, set a break at the first executable line of that
- function. Without argument, list all breaks. Each breakpoint
- is assigned a number to which all the other breakpoint
- commands refer.
-
- The condition argument, if present, is a string which must
- evaluate to true in order for the breakpoint to be honored.
-
-tbreak [ ([filename:]lineno | function) [, condition] ]
- Temporary breakpoint, which is removed automatically when it
- is first hit. The arguments are the same as break.
-
-cl(ear) [bpnumber [bpnumber ...] ]
- With a space separated list of breakpoint numbers, clear those
- breakpoints. Without argument, clear all breaks (but first
- ask confirmation).
-
-disable bpnumber [bpnumber ...]
- Disables the breakpoints given as a space separated list of
- breakpoint numbers. Disabling a breakpoint means it cannot
- cause the program to stop execution, but unlike clearing a
- breakpoint, it remains in the list of breakpoints and can be
- (re-)enabled.
-
-enable bpnumber [bpnumber ...]
- Enables the breakpoints specified.
-
-ignore bpnumber count
- Sets the ignore count for the given breakpoint number. If
- count is omitted, the ignore count is set to 0. A breakpoint
- becomes active when the ignore count is zero. When non-zero,
- the count is decremented each time the breakpoint is reached
- and the breakpoint is not disabled and any associated
- condition evaluates to true.
-
-condition bpnumber condition
- condition is an expression which must evaluate to true before
- the breakpoint is honored. If condition is absent, any
- existing condition is removed; i.e., the breakpoint is made
- unconditional.
-
-s(tep)
- Execute the current line, stop at the first possible occasion
- (either in a function that is called or in the current function).
-
-n(ext)
- Continue execution until the next line in the current function
- is reached or it returns.
-
-unt(il)
- Continue execution until the line with a number greater than the
- current one is reached or until the current frame returns.
-
-r(eturn)
- Continue execution until the current function returns.
-
-run [args...]
- Restart the debugged python program. If a string is supplied it is
- splitted with "shlex", and the result is used as the new sys.argv.
- History, breakpoints, actions and debugger options are preserved.
- "restart" is an alias for "run".
-
-c(ont(inue))
- Continue execution, only stop when a breakpoint is encountered.
-
-l(ist) [first [,last]]
- List source code for the current file.
- Without arguments, list 11 lines around the current line
- or continue the previous listing.
- With one argument, list 11 lines starting at that line.
- With two arguments, list the given range;
- if the second argument is less than the first, it is a count.
-
-a(rgs)
- Print the argument list of the current function.
-
-p expression
- Print the value of the expression.
-
-(!) statement
- Execute the (one-line) statement in the context of the current
- stack frame. The exclamation point can be omitted unless the
- first word of the statement resembles a debugger command. To
- assign to a global variable you must always prefix the command
- with a 'global' command, e.g.:
- (Pdb) global list_options; list_options = ['-l']
- (Pdb)
-
-
-whatis arg
- Prints the type of the argument.
-
-alias [name [command]]
- Creates an alias called 'name' that executes 'command'. The
- command must *not* be enclosed in quotes. Replaceable
- parameters can be indicated by %1, %2, and so on, while %* is
- replaced by all the parameters. If no command is given, the
- current alias for name is shown. If no name is given, all
- aliases are listed.
-
- Aliases may be nested and can contain anything that can be
- legally typed at the pdb prompt. Note! You *can* override
- internal pdb commands with aliases! Those internal commands
- are then hidden until the alias is removed. Aliasing is
- recursively applied to the first word of the command line; all
- other words in the line are left alone.
-
- As an example, here are two useful aliases (especially when
- placed in the .pdbrc file):
-
- #Print instance variables (usage "pi classInst")
- alias pi for k in %1.__dict__.keys(): print "%1.",k,"=",%1.__dict__[k]
- #Print instance variables in self
- alias ps pi self
-
-unalias name
- Deletes the specified alias.
-
-q(uit)
- Quit from the debugger.
- The program being executed is aborted.
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 1fb5174e0f..6776a3f4cf 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1,30 +1,89 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
-"""A Python debugger."""
+"""
+The Python Debugger Pdb
+=======================
-# (See pdb.doc for documentation.)
+To use the debugger in its simplest form:
+ >>> import pdb
+ >>> pdb.run('<a statement>')
+
+The debugger's prompt is '(Pdb) '. This will stop in the first
+function call in <a statement>.
+
+Alternatively, if a statement terminated with an unhandled exception,
+you can use pdb's post-mortem facility to inspect the contents of the
+traceback:
+
+ >>> <a statement>
+ <exception traceback>
+ >>> import pdb
+ >>> pdb.pm()
+
+The commands recognized by the debugger are listed in the next
+section. Most can be abbreviated as indicated; e.g., h(elp) means
+that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel',
+nor as 'H' or 'Help' or 'HELP'). Optional arguments are enclosed in
+square brackets. Alternatives in the command syntax are separated
+by a vertical bar (|).
+
+A blank line repeats the previous command literally, except for
+'list', where it lists the next 11 lines.
+
+Commands that the debugger doesn't recognize are assumed to be Python
+statements and are executed in the context of the program being
+debugged. Python statements can also be prefixed with an exclamation
+point ('!'). This is a powerful way to inspect the program being
+debugged; it is even possible to change variables or call functions.
+When an exception occurs in such a statement, the exception name is
+printed but the debugger's state is not changed.
+
+The debugger supports aliases, which can save typing. And aliases can
+have parameters (see the alias help entry) which allows one a certain
+level of adaptability to the context under examination.
+
+Multiple commands may be entered on a single line, separated by the
+pair ';;'. No intelligence is applied to separating the commands; the
+input is split at the first ';;', even if it is in the middle of a
+quoted string.
+
+If a file ".pdbrc" exists in your home directory or in the current
+directory, it is read in and executed as if it had been typed at the
+debugger prompt. This is particularly useful for aliases. If both
+files exist, the one in the home directory is read first and aliases
+defined there can be overriden by the local file.
+
+Aside from aliases, the debugger is not directly programmable; but it
+is implemented as a class from which you can derive your own debugger
+class, which you can make as fancy as you like.
+
+
+Debugger commands
+=================
+
+"""
+# NOTE: the actual command documentation is collected from docstrings of the
+# commands and is appended to __doc__ after the class has been defined.
+
+import os
+import re
import sys
-import linecache
import cmd
import bdb
-from reprlib import Repr
-import os
-import re
+import dis
+import code
import pprint
+import signal
+import inspect
import traceback
+import linecache
class Restart(Exception):
"""Causes a debugger to be restarted for the debugged python program."""
pass
-# Create a custom safe Repr instance and increase its maxstring.
-# The default of 30 truncates error messages too easily.
-_repr = Repr()
-_repr.maxstring = 200
-_saferepr = _repr.repr
-
__all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace",
"post_mortem", "help"]
@@ -37,17 +96,40 @@ def find_function(funcname, filename):
# consumer of this info expects the first line to be 1
lineno = 1
answer = None
- while 1:
+ while True:
line = fp.readline()
if line == '':
break
if cre.match(line):
answer = funcname, filename, lineno
break
- lineno = lineno + 1
+ lineno += 1
fp.close()
return answer
+def getsourcelines(obj):
+ lines, lineno = inspect.findsource(obj)
+ if inspect.isframe(obj) and obj.f_globals is obj.f_locals:
+ # must be a module frame: do not try to cut a block out of it
+ return lines, 1
+ elif inspect.ismodule(obj):
+ return lines, 1
+ return inspect.getblock(lines[lineno:]), lineno+1
+
+def lasti2lineno(code, lasti):
+ linestarts = list(dis.findlinestarts(code))
+ linestarts.reverse()
+ for i, lineno in linestarts:
+ if lasti >= i:
+ return lineno
+ return 0
+
+
+class _rstr(str):
+ """String that doesn't quote its repr."""
+ def __repr__(self):
+ return self
+
# Interaction prompt line will separate file and call info from code
# text using value of line_prefix string. A newline and arrow may
@@ -58,41 +140,40 @@ line_prefix = '\n-> ' # Probably a better default
class Pdb(bdb.Bdb, cmd.Cmd):
- def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None):
+ def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None,
+ nosigint=False):
bdb.Bdb.__init__(self, skip=skip)
cmd.Cmd.__init__(self, completekey, stdin, stdout)
if stdout:
self.use_rawinput = 0
self.prompt = '(Pdb) '
self.aliases = {}
+ self.displaying = {}
self.mainpyfile = ''
- self._wait_for_mainpyfile = 0
+ self._wait_for_mainpyfile = False
+ self.tb_lineno = {}
# Try to load readline if it exists
try:
import readline
except ImportError:
pass
+ self.allow_kbdint = False
+ self.nosigint = nosigint
# Read $HOME/.pdbrc and ./.pdbrc
self.rcLines = []
if 'HOME' in os.environ:
envHome = os.environ['HOME']
try:
- rcFile = open(os.path.join(envHome, ".pdbrc"))
+ with open(os.path.join(envHome, ".pdbrc")) as rcFile:
+ self.rcLines.extend(rcFile)
except IOError:
pass
- else:
- for line in rcFile.readlines():
- self.rcLines.append(line)
- rcFile.close()
try:
- rcFile = open(".pdbrc")
+ with open(".pdbrc") as rcFile:
+ self.rcLines.extend(rcFile)
except IOError:
pass
- else:
- for line in rcFile.readlines():
- self.rcLines.append(line)
- rcFile.close()
self.commands = {} # associates a command list to breakpoint numbers
self.commands_doprompt = {} # for each bp num, tells if the prompt
@@ -104,6 +185,15 @@ class Pdb(bdb.Bdb, cmd.Cmd):
self.commands_bnum = None # The breakpoint number for which we are
# defining a list
+ def sigint_handler(self, signum, frame):
+ if self.allow_kbdint:
+ raise KeyboardInterrupt
+ self.message("\nProgram interrupted. (Use 'cont' to resume).")
+ self.set_step()
+ self.set_trace(frame)
+ # restore previous signal handler
+ signal.signal(signal.SIGINT, self._previous_sigint_handler)
+
def reset(self):
bdb.Bdb.reset(self)
self.forget()
@@ -113,28 +203,43 @@ class Pdb(bdb.Bdb, cmd.Cmd):
self.stack = []
self.curindex = 0
self.curframe = None
+ self.tb_lineno.clear()
- def setup(self, f, t):
+ def setup(self, f, tb):
self.forget()
- self.stack, self.curindex = self.get_stack(f, t)
+ self.stack, self.curindex = self.get_stack(f, tb)
+ while tb:
+ # when setting up post-mortem debugging with a traceback, save all
+ # the original line numbers to be displayed along the current line
+ # numbers (which can be different, e.g. due to finally clauses)
+ lineno = lasti2lineno(tb.tb_frame.f_code, tb.tb_lasti)
+ self.tb_lineno[tb.tb_frame] = lineno
+ tb = tb.tb_next
self.curframe = self.stack[self.curindex][0]
# The f_locals dictionary is updated from the actual frame
# locals whenever the .f_locals accessor is called, so we
# cache it here to ensure that modifications are not overwritten.
self.curframe_locals = self.curframe.f_locals
- self.execRcLines()
+ return self.execRcLines()
# Can be executed earlier than 'setup' if desired
def execRcLines(self):
- if self.rcLines:
- # Make local copy because of recursion
- rcLines = self.rcLines
- # executed only once
- self.rcLines = []
- for line in rcLines:
- line = line[:-1]
- if len(line) > 0 and line[0] != '#':
- self.onecmd(line)
+ if not self.rcLines:
+ return
+ # local copy because of recursion
+ rcLines = self.rcLines
+ rcLines.reverse()
+ # execute every line only once
+ self.rcLines = []
+ while rcLines:
+ line = rcLines.pop().strip()
+ if line and line[0] != '#':
+ if self.onecmd(line):
+ # if onecmd returns True, the command wants to exit
+ # from the interaction, save leftover rc lines
+ # to execute before next interaction
+ self.rcLines += reversed(rcLines)
+ return True
# Override Bdb methods
@@ -144,20 +249,20 @@ class Pdb(bdb.Bdb, cmd.Cmd):
if self._wait_for_mainpyfile:
return
if self.stop_here(frame):
- print('--Call--', file=self.stdout)
+ self.message('--Call--')
self.interaction(frame, None)
def user_line(self, frame):
"""This function is called when we stop or break at this line."""
if self._wait_for_mainpyfile:
if (self.mainpyfile != self.canonic(frame.f_code.co_filename)
- or frame.f_lineno<= 0):
+ or frame.f_lineno <= 0):
return
- self._wait_for_mainpyfile = 0
+ self._wait_for_mainpyfile = False
if self.bp_commands(frame):
self.interaction(frame, None)
- def bp_commands(self,frame):
+ def bp_commands(self, frame):
"""Call every command that was set for the current active breakpoint
(if there is one).
@@ -176,7 +281,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
if not self.commands_silent[currentbp]:
self.print_stack_entry(self.stack[self.curindex])
if self.commands_doprompt[currentbp]:
- self.cmdloop()
+ self._cmdloop()
self.forget()
return
return 1
@@ -186,7 +291,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
if self._wait_for_mainpyfile:
return
frame.f_locals['__return__'] = return_value
- print('--Return--', file=self.stdout)
+ self.message('--Return--')
self.interaction(frame, None)
def user_exception(self, frame, exc_info):
@@ -196,16 +301,45 @@ class Pdb(bdb.Bdb, cmd.Cmd):
return
exc_type, exc_value, exc_traceback = exc_info
frame.f_locals['__exception__'] = exc_type, exc_value
- exc_type_name = exc_type.__name__
- print(exc_type_name + ':', _saferepr(exc_value), file=self.stdout)
+ self.message(traceback.format_exception_only(exc_type,
+ exc_value)[-1].strip())
self.interaction(frame, exc_traceback)
# General interaction function
+ def _cmdloop(self):
+ while True:
+ try:
+ # keyboard interrupts allow for an easy way to cancel
+ # the current command, so allow them during interactive input
+ self.allow_kbdint = True
+ self.cmdloop()
+ self.allow_kbdint = False
+ break
+ except KeyboardInterrupt:
+ self.message('--KeyboardInterrupt--')
+
+ # Called before loop, handles display expressions
+ def preloop(self):
+ displaying = self.displaying.get(self.curframe)
+ if displaying:
+ for expr, oldvalue in displaying.items():
+ newvalue = self._getval_except(expr)
+ # check for identity first; this prevents custom __eq__ to
+ # be called at every loop, and also prevents instances whose
+ # fields are changed to be displayed
+ if newvalue is not oldvalue and newvalue != oldvalue:
+ displaying[expr] = newvalue
+ self.message('display %s: %r [old: %r]' %
+ (expr, newvalue, oldvalue))
def interaction(self, frame, traceback):
- self.setup(frame, traceback)
+ if self.setup(frame, traceback):
+ # no interaction desired at this time (happens if .pdbrc contains
+ # a command like "continue")
+ self.forget()
+ return
self.print_stack_entry(self.stack[self.curindex])
- self.cmdloop()
+ self._cmdloop()
self.forget()
def displayhook(self, obj):
@@ -214,7 +348,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
"""
# reproduce the behavior of the standard displayhook, not printing None
if obj is not None:
- print(repr(obj))
+ self.message(repr(obj))
def default(self, line):
if line[:1] == '!': line = line[1:]
@@ -235,11 +369,8 @@ class Pdb(bdb.Bdb, cmd.Cmd):
sys.stdin = save_stdin
sys.displayhook = save_displayhook
except:
- t, v = sys.exc_info()[:2]
- if type(t) == type(''):
- exc_type_name = t
- else: exc_type_name = t.__name__
- print('***', exc_type_name + ':', v, file=self.stdout)
+ exc_info = sys.exc_info()[:2]
+ self.error(traceback.format_exception_only(*exc_info)[-1].strip())
def precmd(self, line):
"""Handle alias expansion and ';;' separator."""
@@ -252,7 +383,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
for tmpArg in args[1:]:
line = line.replace("%" + str(ii),
tmpArg)
- ii = ii + 1
+ ii += 1
line = line.replace("%*", ' '.join(args[1:]))
args = line.split()
# split into ';;' separated commands
@@ -278,7 +409,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
else:
return self.handle_command_def(line)
- def handle_command_def(self,line):
+ def handle_command_def(self, line):
"""Handles one command line during command list definition."""
cmd, arg, line = self.parseline(line)
if not cmd:
@@ -306,47 +437,116 @@ class Pdb(bdb.Bdb, cmd.Cmd):
return 1
return
+ # interface abstraction functions
+
+ def message(self, msg):
+ print(msg, file=self.stdout)
+
+ def error(self, msg):
+ print('***', msg, file=self.stdout)
+
# Command definitions, called by cmdloop()
# The argument is the remaining string on the command line
# Return true to exit from the command loop
- do_h = cmd.Cmd.do_help
-
def do_commands(self, arg):
- """Defines a list of commands associated to a breakpoint.
-
- Those commands will be executed whenever the breakpoint causes
- the program to stop execution."""
+ """commands [bpnumber]
+ (com) ...
+ (com) end
+ (Pdb)
+
+ Specify a list of commands for breakpoint number bpnumber.
+ The commands themselves are entered on the following lines.
+ Type a line containing just 'end' to terminate the commands.
+ The commands are executed when the breakpoint is hit.
+
+ To remove all commands from a breakpoint, type commands and
+ follow it immediately with end; that is, give no commands.
+
+ With no bpnumber argument, commands refers to the last
+ breakpoint set.
+
+ You can use breakpoint commands to start your program up
+ again. Simply use the continue command, or step, or any other
+ command that resumes execution.
+
+ Specifying any command resuming execution (currently continue,
+ step, next, return, jump, quit and their abbreviations)
+ terminates the command list (as if that command was
+ immediately followed by end). This is because any time you
+ resume execution (even with a simple next or step), you may
+ encounter another breakpoint -- which could have its own
+ command list, leading to ambiguities about which list to
+ execute.
+
+ If you use the 'silent' command in the command list, the usual
+ message about stopping at a breakpoint is not printed. This
+ may be desirable for breakpoints that are to print a specific
+ message and then continue. If none of the other commands
+ print anything, you will see no sign that the breakpoint was
+ reached.
+ """
if not arg:
- bnum = len(bdb.Breakpoint.bpbynumber)-1
+ bnum = len(bdb.Breakpoint.bpbynumber) - 1
else:
try:
bnum = int(arg)
except:
- print("Usage : commands [bnum]\n ...\n end",
- file=self.stdout)
+ self.error("Usage: commands [bnum]\n ...\n end")
return
self.commands_bnum = bnum
+ # Save old definitions for the case of a keyboard interrupt.
+ if bnum in self.commands:
+ old_command_defs = (self.commands[bnum],
+ self.commands_doprompt[bnum],
+ self.commands_silent[bnum])
+ else:
+ old_command_defs = None
self.commands[bnum] = []
self.commands_doprompt[bnum] = True
self.commands_silent[bnum] = False
+
prompt_back = self.prompt
self.prompt = '(com) '
self.commands_defining = True
try:
self.cmdloop()
+ except KeyboardInterrupt:
+ # Restore old definitions.
+ if old_command_defs:
+ self.commands[bnum] = old_command_defs[0]
+ self.commands_doprompt[bnum] = old_command_defs[1]
+ self.commands_silent[bnum] = old_command_defs[2]
+ else:
+ del self.commands[bnum]
+ del self.commands_doprompt[bnum]
+ del self.commands_silent[bnum]
+ self.error('command definition aborted, old commands restored')
finally:
self.commands_defining = False
self.prompt = prompt_back
def do_break(self, arg, temporary = 0):
- # break [ ([filename:]lineno | function) [, "condition"] ]
+ """b(reak) [ ([filename:]lineno | function) [, condition] ]
+ Without argument, list all breaks.
+
+ With a line number argument, set a break at this line in the
+ current file. With a function name, set a break at the first
+ executable line of that function. If a second argument is
+ present, it is a string specifying an expression which must
+ evaluate to true before the breakpoint is honored.
+
+ The line number may be prefixed with a filename and a colon,
+ to specify a breakpoint in another file (probably one that
+ hasn't been loaded yet). The file is searched for on
+ sys.path; the .py suffix may be omitted.
+ """
if not arg:
if self.breaks: # There's at least one
- print("Num Type Disp Enb Where", file=self.stdout)
+ self.message("Num Type Disp Enb Where")
for bp in bdb.Breakpoint.bpbynumber:
if bp:
- bp.bpprint(self.stdout)
+ self.message(bp.bpformat())
return
# parse arguments; comma has lowest precedence
# and cannot occur in filename
@@ -365,16 +565,15 @@ class Pdb(bdb.Bdb, cmd.Cmd):
filename = arg[:colon].rstrip()
f = self.lookupmodule(filename)
if not f:
- print('*** ', repr(filename), end=' ', file=self.stdout)
- print('not found from sys.path', file=self.stdout)
+ self.error('%r not found from sys.path' % filename)
return
else:
filename = f
arg = arg[colon+1:].lstrip()
try:
lineno = int(arg)
- except ValueError as msg:
- print('*** Bad lineno:', arg, file=self.stdout)
+ except ValueError:
+ self.error('Bad lineno: %s' % arg)
return
else:
# no colon; can be lineno or function
@@ -400,10 +599,8 @@ class Pdb(bdb.Bdb, cmd.Cmd):
# last thing to try
(ok, filename, ln) = self.lineinfo(arg)
if not ok:
- print('*** The specified object', end=' ', file=self.stdout)
- print(repr(arg), end=' ', file=self.stdout)
- print('is not a function', file=self.stdout)
- print('or was not found along sys.path.', file=self.stdout)
+ self.error('The specified object %r is not a function '
+ 'or was not found along sys.path.' % arg)
return
funcname = ok # ok contains a function name
lineno = int(ln)
@@ -414,12 +611,12 @@ class Pdb(bdb.Bdb, cmd.Cmd):
if line:
# now set the break point
err = self.set_break(filename, line, temporary, cond, funcname)
- if err: print('***', err, file=self.stdout)
+ if err:
+ self.error(err, file=self.stdout)
else:
bp = self.get_breaks(filename, line)[-1]
- print("Breakpoint %d at %s:%d" % (bp.number,
- bp.file,
- bp.line), file=self.stdout)
+ self.message("Breakpoint %d at %s:%d" %
+ (bp.number, bp.file, bp.line))
# To be overridden in derived debuggers
def defaultFile(self):
@@ -432,6 +629,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
do_b = do_break
def do_tbreak(self, arg):
+ """tbreak [ ([filename:]lineno | function) [, condition] ]
+ Same arguments as break, but sets a temporary breakpoint: it
+ is automatically deleted when first hit.
+ """
self.do_break(arg, 1)
def lineinfo(self, identifier):
@@ -478,112 +679,110 @@ class Pdb(bdb.Bdb, cmd.Cmd):
globs = self.curframe.f_globals if hasattr(self, 'curframe') else None
line = linecache.getline(filename, lineno, globs)
if not line:
- print('End of file', file=self.stdout)
+ self.message('End of file')
return 0
line = line.strip()
# Don't allow setting breakpoint at a blank line
if (not line or (line[0] == '#') or
(line[:3] == '"""') or line[:3] == "'''"):
- print('*** Blank or comment', file=self.stdout)
+ self.error('Blank or comment')
return 0
return lineno
def do_enable(self, arg):
+ """enable bpnumber [bpnumber ...]
+ Enables the breakpoints given as a space separated list of
+ breakpoint numbers.
+ """
args = arg.split()
for i in args:
try:
- i = int(i)
- except ValueError:
- print('Breakpoint index %r is not a number' % i, file=self.stdout)
- continue
-
- if not (0 <= i < len(bdb.Breakpoint.bpbynumber)):
- print('No breakpoint numbered', i, file=self.stdout)
- continue
-
- bp = bdb.Breakpoint.bpbynumber[i]
- if bp:
+ bp = self.get_bpbynumber(i)
+ except ValueError as err:
+ self.error(err)
+ else:
bp.enable()
+ self.message('Enabled %s' % bp)
def do_disable(self, arg):
+ """disable bpnumber [bpnumber ...]
+ Disables the breakpoints given as a space separated list of
+ breakpoint numbers. Disabling a breakpoint means it cannot
+ cause the program to stop execution, but unlike clearing a
+ breakpoint, it remains in the list of breakpoints and can be
+ (re-)enabled.
+ """
args = arg.split()
for i in args:
try:
- i = int(i)
- except ValueError:
- print('Breakpoint index %r is not a number' % i, file=self.stdout)
- continue
-
- if not (0 <= i < len(bdb.Breakpoint.bpbynumber)):
- print('No breakpoint numbered', i, file=self.stdout)
- continue
-
- bp = bdb.Breakpoint.bpbynumber[i]
- if bp:
+ bp = self.get_bpbynumber(i)
+ except ValueError as err:
+ self.error(err)
+ else:
bp.disable()
+ self.message('Disabled %s' % bp)
def do_condition(self, arg):
- # arg is breakpoint number and condition
+ """condition bpnumber [condition]
+ Set a new condition for the breakpoint, an expression which
+ must evaluate to true before the breakpoint is honored. If
+ condition is absent, any existing condition is removed; i.e.,
+ the breakpoint is made unconditional.
+ """
args = arg.split(' ', 1)
try:
- bpnum = int(args[0].strip())
- except ValueError:
- # something went wrong
- print('Breakpoint index %r is not a number' % args[0], file=self.stdout)
- return
- try:
cond = args[1]
- except:
+ except IndexError:
cond = None
try:
- bp = bdb.Breakpoint.bpbynumber[bpnum]
- except IndexError:
- print('Breakpoint index %r is not valid' % args[0],
- file=self.stdout)
- return
- if bp:
+ bp = self.get_bpbynumber(args[0].strip())
+ except ValueError as err:
+ self.error(err)
+ else:
bp.cond = cond
if not cond:
- print('Breakpoint', bpnum, end=' ', file=self.stdout)
- print('is now unconditional.', file=self.stdout)
-
- def do_ignore(self,arg):
- """arg is bp number followed by ignore count."""
+ self.message('Breakpoint %d is now unconditional.' % bp.number)
+ else:
+ self.message('New condition set for breakpoint %d.' % bp.number)
+
+ def do_ignore(self, arg):
+ """ignore bpnumber [count]
+ Set the ignore count for the given breakpoint number. If
+ count is omitted, the ignore count is set to 0. A breakpoint
+ becomes active when the ignore count is zero. When non-zero,
+ the count is decremented each time the breakpoint is reached
+ and the breakpoint is not disabled and any associated
+ condition evaluates to true.
+ """
args = arg.split()
try:
- bpnum = int(args[0].strip())
- except ValueError:
- # something went wrong
- print('Breakpoint index %r is not a number' % args[0], file=self.stdout)
- return
- try:
count = int(args[1].strip())
except:
count = 0
try:
- bp = bdb.Breakpoint.bpbynumber[bpnum]
- except IndexError:
- print('Breakpoint index %r is not valid' % args[0],
- file=self.stdout)
- return
- if bp:
+ bp = self.get_bpbynumber(args[0].strip())
+ except ValueError as err:
+ self.error(err)
+ else:
bp.ignore = count
if count > 0:
- reply = 'Will ignore next '
if count > 1:
- reply = reply + '%d crossings' % count
+ countstr = '%d crossings' % count
else:
- reply = reply + '1 crossing'
- print(reply + ' of breakpoint %d.' % bpnum, file=self.stdout)
+ countstr = '1 crossing'
+ self.message('Will ignore next %s of breakpoint %d.' %
+ (countstr, bp.number))
else:
- print('Will stop next time breakpoint', end=' ', file=self.stdout)
- print(bpnum, 'is reached.', file=self.stdout)
+ self.message('Will stop next time breakpoint %d is reached.'
+ % bp.number)
def do_clear(self, arg):
- """Three possibilities, tried in this order:
- clear -> clear all breaks, ask for confirmation
- clear file:lineno -> clear all breaks at file:lineno
- clear bpno bpno ... -> clear breakpoints by number"""
+ """cl(ear) filename:lineno\ncl(ear) [bpnumber [bpnumber...]]
+ With a space separated list of breakpoint numbers, clear
+ those breakpoints. Without argument, clear all breaks (but
+ first ask confirmation). With a filename:lineno argument,
+ clear all breaks at that line in that file.
+ """
if not arg:
try:
reply = input('Clear all breaks? ')
@@ -591,7 +790,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
reply = 'no'
reply = reply.strip().lower()
if reply in ('y', 'yes'):
+ bplist = [bp for bp in bdb.Breakpoint.bpbynumber if bp]
self.clear_all_breaks()
+ for bp in bplist:
+ self.message('Deleted %s' % bp)
return
if ':' in arg:
# Make sure it works for "clear C:\foo\bar.py:12"
@@ -603,99 +805,180 @@ class Pdb(bdb.Bdb, cmd.Cmd):
except ValueError:
err = "Invalid line number (%s)" % arg
else:
+ bplist = self.get_breaks(filename, lineno)
err = self.clear_break(filename, lineno)
- if err: print('***', err, file=self.stdout)
+ if err:
+ self.error(err)
+ else:
+ for bp in bplist:
+ self.message('Deleted %s' % bp)
return
numberlist = arg.split()
for i in numberlist:
try:
- i = int(i)
- except ValueError:
- print('Breakpoint index %r is not a number' % i, file=self.stdout)
- continue
-
- if not (0 <= i < len(bdb.Breakpoint.bpbynumber)):
- print('No breakpoint numbered', i, file=self.stdout)
- continue
- err = self.clear_bpbynumber(i)
- if err:
- print('***', err, file=self.stdout)
+ bp = self.get_bpbynumber(i)
+ except ValueError as err:
+ self.error(err)
else:
- print('Deleted breakpoint', i, file=self.stdout)
+ self.clear_bpbynumber(i)
+ self.message('Deleted %s' % bp)
do_cl = do_clear # 'c' is already an abbreviation for 'continue'
def do_where(self, arg):
+ """w(here)
+ Print a stack trace, with the most recent frame at the bottom.
+ An arrow indicates the "current frame", which determines the
+ context of most commands. 'bt' is an alias for this command.
+ """
self.print_stack_trace()
do_w = do_where
do_bt = do_where
+ def _select_frame(self, number):
+ assert 0 <= number < len(self.stack)
+ self.curindex = number
+ self.curframe = self.stack[self.curindex][0]
+ self.curframe_locals = self.curframe.f_locals
+ self.print_stack_entry(self.stack[self.curindex])
+ self.lineno = None
+
def do_up(self, arg):
+ """u(p) [count]
+ Move the current frame count (default one) levels up in the
+ stack trace (to an older frame).
+ """
if self.curindex == 0:
- print('*** Oldest frame', file=self.stdout)
+ self.error('Oldest frame')
+ return
+ try:
+ count = int(arg or 1)
+ except ValueError:
+ self.error('Invalid frame count (%s)' % arg)
+ return
+ if count < 0:
+ newframe = 0
else:
- self.curindex = self.curindex - 1
- self.curframe = self.stack[self.curindex][0]
- self.curframe_locals = self.curframe.f_locals
- self.print_stack_entry(self.stack[self.curindex])
- self.lineno = None
+ newframe = max(0, self.curindex - count)
+ self._select_frame(newframe)
do_u = do_up
def do_down(self, arg):
+ """d(own) [count]
+ Move the current frame count (default one) levels down in the
+ stack trace (to a newer frame).
+ """
if self.curindex + 1 == len(self.stack):
- print('*** Newest frame', file=self.stdout)
+ self.error('Newest frame')
+ return
+ try:
+ count = int(arg or 1)
+ except ValueError:
+ self.error('Invalid frame count (%s)' % arg)
+ return
+ if count < 0:
+ newframe = len(self.stack) - 1
else:
- self.curindex = self.curindex + 1
- self.curframe = self.stack[self.curindex][0]
- self.curframe_locals = self.curframe.f_locals
- self.print_stack_entry(self.stack[self.curindex])
- self.lineno = None
+ newframe = min(len(self.stack) - 1, self.curindex + count)
+ self._select_frame(newframe)
do_d = do_down
def do_until(self, arg):
- self.set_until(self.curframe)
+ """unt(il) [lineno]
+ Without argument, continue execution until the line with a
+ number greater than the current one is reached. With a line
+ number, continue execution until a line with a number greater
+ or equal to that is reached. In both cases, also stop when
+ the current frame returns.
+ """
+ if arg:
+ try:
+ lineno = int(arg)
+ except ValueError:
+ self.error('Error in argument: %r' % arg)
+ return
+ if lineno <= self.curframe.f_lineno:
+ self.error('"until" line number is smaller than current '
+ 'line number')
+ return
+ else:
+ lineno = None
+ self.set_until(self.curframe, lineno)
return 1
do_unt = do_until
def do_step(self, arg):
+ """s(tep)
+ Execute the current line, stop at the first possible occasion
+ (either in a function that is called or in the current
+ function).
+ """
self.set_step()
return 1
do_s = do_step
def do_next(self, arg):
+ """n(ext)
+ Continue execution until the next line in the current function
+ is reached or it returns.
+ """
self.set_next(self.curframe)
return 1
do_n = do_next
def do_run(self, arg):
- """Restart program by raising an exception to be caught in the main
- debugger loop. If arguments were given, set them in sys.argv."""
+ """run [args...]
+ Restart the debugged python program. If a string is supplied
+ it is splitted with "shlex", and the result is used as the new
+ sys.argv. History, breakpoints, actions and debugger options
+ are preserved. "restart" is an alias for "run".
+ """
if arg:
import shlex
argv0 = sys.argv[0:1]
sys.argv = shlex.split(arg)
sys.argv[:0] = argv0
+ # this is caught in the main debugger loop
raise Restart
do_restart = do_run
def do_return(self, arg):
+ """r(eturn)
+ Continue execution until the current function returns.
+ """
self.set_return(self.curframe)
return 1
do_r = do_return
def do_continue(self, arg):
+ """c(ont(inue))
+ Continue execution, only stop when a breakpoint is encountered.
+ """
+ if not self.nosigint:
+ self._previous_sigint_handler = \
+ signal.signal(signal.SIGINT, self.sigint_handler)
self.set_continue()
return 1
do_c = do_cont = do_continue
def do_jump(self, arg):
+ """j(ump) lineno
+ Set the next line that will be executed. Only available in
+ the bottom-most frame. This lets you jump back and execute
+ code again, or jump forward to skip code that you don't want
+ to run.
+
+ It should be noted that not all jumps are allowed -- for
+ instance it is not possible to jump into the middle of a
+ for loop or out of a finally clause.
+ """
if self.curindex + 1 != len(self.stack):
- print("*** You can only jump within the bottom frame", file=self.stdout)
+ self.error('You can only jump within the bottom frame')
return
try:
arg = int(arg)
except ValueError:
- print("*** The 'jump' command requires a line number.", file=self.stdout)
+ self.error("The 'jump' command requires a line number")
else:
try:
# Do the jump, fix up our copy of the stack, and display the
@@ -704,23 +987,31 @@ class Pdb(bdb.Bdb, cmd.Cmd):
self.stack[self.curindex] = self.stack[self.curindex][0], arg
self.print_stack_entry(self.stack[self.curindex])
except ValueError as e:
- print('*** Jump failed:', e, file=self.stdout)
+ self.error('Jump failed: %s' % e)
do_j = do_jump
def do_debug(self, arg):
+ """debug code
+ Enter a recursive debugger that steps through the code
+ argument (which is an arbitrary expression or statement to be
+ executed in the current environment).
+ """
sys.settrace(None)
globals = self.curframe.f_globals
locals = self.curframe_locals
p = Pdb(self.completekey, self.stdin, self.stdout)
p.prompt = "(%s) " % self.prompt.strip()
- print("ENTERING RECURSIVE DEBUGGER", file=self.stdout)
+ self.message("ENTERING RECURSIVE DEBUGGER")
sys.call_tracing(p.run, (arg, globals, locals))
- print("LEAVING RECURSIVE DEBUGGER", file=self.stdout)
+ self.message("LEAVING RECURSIVE DEBUGGER")
sys.settrace(self.trace_dispatch)
self.lastcmd = p.lastcmd
def do_quit(self, arg):
- self._user_requested_quit = 1
+ """q(uit)\nexit
+ Quit from the debugger. The program being executed is aborted.
+ """
+ self._user_requested_quit = True
self.set_quit()
return 1
@@ -728,12 +1019,18 @@ class Pdb(bdb.Bdb, cmd.Cmd):
do_exit = do_quit
def do_EOF(self, arg):
- print(file=self.stdout)
- self._user_requested_quit = 1
+ """EOF
+ Handles the receipt of EOF as a command.
+ """
+ self.message('')
+ self._user_requested_quit = True
self.set_quit()
return 1
def do_args(self, arg):
+ """a(rgs)
+ Print the argument list of the current function.
+ """
co = self.curframe.f_code
dict = self.curframe_locals
n = co.co_argcount
@@ -741,62 +1038,94 @@ class Pdb(bdb.Bdb, cmd.Cmd):
if co.co_flags & 8: n = n+1
for i in range(n):
name = co.co_varnames[i]
- print(name, '=', end=' ', file=self.stdout)
- if name in dict: print(dict[name], file=self.stdout)
- else: print("*** undefined ***", file=self.stdout)
+ if name in dict:
+ self.message('%s = %r' % (name, dict[name]))
+ else:
+ self.message('%s = *** undefined ***' % (name,))
do_a = do_args
def do_retval(self, arg):
+ """retval
+ Print the return value for the last return of a function.
+ """
if '__return__' in self.curframe_locals:
- print(self.curframe_locals['__return__'], file=self.stdout)
+ self.message(repr(self.curframe_locals['__return__']))
else:
- print('*** Not yet returned!', file=self.stdout)
+ self.error('Not yet returned!')
do_rv = do_retval
def _getval(self, arg):
try:
return eval(arg, self.curframe.f_globals, self.curframe_locals)
except:
- t, v = sys.exc_info()[:2]
- if isinstance(t, str):
- exc_type_name = t
- else: exc_type_name = t.__name__
- print('***', exc_type_name + ':', repr(v), file=self.stdout)
+ exc_info = sys.exc_info()[:2]
+ self.error(traceback.format_exception_only(*exc_info)[-1].strip())
raise
+ def _getval_except(self, arg, frame=None):
+ try:
+ if frame is None:
+ return eval(arg, self.curframe.f_globals, self.curframe_locals)
+ else:
+ return eval(arg, frame.f_globals, frame.f_locals)
+ except:
+ exc_info = sys.exc_info()[:2]
+ err = traceback.format_exception_only(*exc_info)[-1].strip()
+ return _rstr('** raised %s **' % err)
+
def do_p(self, arg):
+ """p(rint) expression
+ Print the value of the expression.
+ """
try:
- print(repr(self._getval(arg)), file=self.stdout)
+ self.message(repr(self._getval(arg)))
except:
pass
# make "print" an alias of "p" since print isn't a Python statement anymore
do_print = do_p
def do_pp(self, arg):
+ """pp expression
+ Pretty-print the value of the expression.
+ """
try:
- pprint.pprint(self._getval(arg), self.stdout)
+ self.message(pprint.pformat(self._getval(arg)))
except:
pass
def do_list(self, arg):
+ """l(ist) [first [,last] | .]
+
+ List source code for the current file. Without arguments,
+ list 11 lines around the current line or continue the previous
+ listing. With . as argument, list 11 lines around the current
+ line. With one argument, list 11 lines starting at that line.
+ With two arguments, list the given range; if the second
+ argument is less than the first, it is a count.
+
+ The current line in the current frame is indicated by "->".
+ If an exception is being debugged, the line where the
+ exception was originally raised or propagated is indicated by
+ ">>", if it differs from the current line.
+ """
self.lastcmd = 'list'
last = None
- if arg:
+ if arg and arg != '.':
try:
- x = eval(arg, {}, {})
- if type(x) == type(()):
- first, last = x
- first = int(first)
- last = int(last)
+ if ',' in arg:
+ first, last = arg.split(',')
+ first = int(first.strip())
+ last = int(last.strip())
if last < first:
- # Assume it's a count
+ # assume it's a count
last = first + last
else:
- first = max(1, int(x) - 5)
- except:
- print('*** Error in argument:', repr(arg), file=self.stdout)
+ first = int(arg.strip())
+ first = max(1, first - 5)
+ except ValueError:
+ self.error('Error in argument: %r' % arg)
return
- elif self.lineno is None:
+ elif self.lineno is None or arg == '.':
first = max(1, self.curframe.f_lineno - 5)
else:
first = self.lineno + 1
@@ -805,71 +1134,186 @@ class Pdb(bdb.Bdb, cmd.Cmd):
filename = self.curframe.f_code.co_filename
breaklist = self.get_file_breaks(filename)
try:
- for lineno in range(first, last+1):
- line = linecache.getline(filename, lineno,
- self.curframe.f_globals)
- if not line:
- print('[EOF]', file=self.stdout)
- break
- else:
- s = repr(lineno).rjust(3)
- if len(s) < 4: s = s + ' '
- if lineno in breaklist: s = s + 'B'
- else: s = s + ' '
- if lineno == self.curframe.f_lineno:
- s = s + '->'
- print(s + '\t' + line, end='', file=self.stdout)
- self.lineno = lineno
+ lines = linecache.getlines(filename, self.curframe.f_globals)
+ self._print_lines(lines[first-1:last], first, breaklist,
+ self.curframe)
+ self.lineno = min(last, len(lines))
+ if len(lines) < last:
+ self.message('[EOF]')
except KeyboardInterrupt:
pass
do_l = do_list
+ def do_longlist(self, arg):
+ """longlist | ll
+ List the whole source code for the current function or frame.
+ """
+ filename = self.curframe.f_code.co_filename
+ breaklist = self.get_file_breaks(filename)
+ try:
+ lines, lineno = getsourcelines(self.curframe)
+ except IOError as err:
+ self.error(err)
+ return
+ self._print_lines(lines, lineno, breaklist, self.curframe)
+ do_ll = do_longlist
+
+ def do_source(self, arg):
+ """source expression
+ Try to get source code for the given object and display it.
+ """
+ try:
+ obj = self._getval(arg)
+ except:
+ return
+ try:
+ lines, lineno = getsourcelines(obj)
+ except (IOError, TypeError) as err:
+ self.error(err)
+ return
+ self._print_lines(lines, lineno)
+
+ def _print_lines(self, lines, start, breaks=(), frame=None):
+ """Print a range of lines."""
+ if frame:
+ current_lineno = frame.f_lineno
+ exc_lineno = self.tb_lineno.get(frame, -1)
+ else:
+ current_lineno = exc_lineno = -1
+ for lineno, line in enumerate(lines, start):
+ s = str(lineno).rjust(3)
+ if len(s) < 4:
+ s += ' '
+ if lineno in breaks:
+ s += 'B'
+ else:
+ s += ' '
+ if lineno == current_lineno:
+ s += '->'
+ elif lineno == exc_lineno:
+ s += '>>'
+ self.message(s + '\t' + line.rstrip())
+
def do_whatis(self, arg):
+ """whatis arg
+ Print the type of the argument.
+ """
try:
- value = eval(arg, self.curframe.f_globals,
- self.curframe_locals)
+ value = self._getval(arg)
except:
- t, v = sys.exc_info()[:2]
- if type(t) == type(''):
- exc_type_name = t
- else: exc_type_name = t.__name__
- print('***', exc_type_name + ':', repr(v), file=self.stdout)
+ # _getval() already printed the error
return
code = None
# Is it a function?
- try: code = value.__code__
- except: pass
+ try:
+ code = value.__code__
+ except Exception:
+ pass
if code:
- print('Function', code.co_name, file=self.stdout)
+ self.message('Function %s' % code.co_name)
return
# Is it an instance method?
- try: code = value.__func__.__code__
- except: pass
+ try:
+ code = value.__func__.__code__
+ except Exception:
+ pass
if code:
- print('Method', code.co_name, file=self.stdout)
+ self.message('Method %s' % code.co_name)
+ return
+ # Is it a class?
+ if value.__class__ is type:
+ self.message('Class %s.%s' % (value.__module__, value.__name__))
return
# None of the above...
- print(type(value), file=self.stdout)
+ self.message(type(value))
+
+ def do_display(self, arg):
+ """display [expression]
+
+ Display the value of the expression if it changed, each time execution
+ stops in the current frame.
+
+ Without expression, list all display expressions for the current frame.
+ """
+ if not arg:
+ self.message('Currently displaying:')
+ for item in self.displaying.get(self.curframe, {}).items():
+ self.message('%s: %r' % item)
+ else:
+ val = self._getval_except(arg)
+ self.displaying.setdefault(self.curframe, {})[arg] = val
+ self.message('display %s: %r' % (arg, val))
+
+ def do_undisplay(self, arg):
+ """undisplay [expression]
+
+ Do not display the expression any more in the current frame.
+
+ Without expression, clear all display expressions for the current frame.
+ """
+ if arg:
+ try:
+ del self.displaying.get(self.curframe, {})[arg]
+ except KeyError:
+ self.error('not displaying %s' % arg)
+ else:
+ self.displaying.pop(self.curframe, None)
+
+ def do_interact(self, arg):
+ """interact
+
+ Start an interative interpreter whose global namespace
+ contains all the (global and local) names found in the current scope.
+ """
+ ns = self.curframe.f_globals.copy()
+ ns.update(self.curframe_locals)
+ code.interact("*interactive*", local=ns)
def do_alias(self, arg):
+ """alias [name [command [parameter parameter ...] ]]
+ Create an alias called 'name' that executes 'command'. The
+ command must *not* be enclosed in quotes. Replaceable
+ parameters can be indicated by %1, %2, and so on, while %* is
+ replaced by all the parameters. If no command is given, the
+ current alias for name is shown. If no name is given, all
+ aliases are listed.
+
+ Aliases may be nested and can contain anything that can be
+ legally typed at the pdb prompt. Note! You *can* override
+ internal pdb commands with aliases! Those internal commands
+ are then hidden until the alias is removed. Aliasing is
+ recursively applied to the first word of the command line; all
+ other words in the line are left alone.
+
+ As an example, here are two useful aliases (especially when
+ placed in the .pdbrc file):
+
+ # Print instance variables (usage "pi classInst")
+ alias pi for k in %1.__dict__.keys(): print "%1.",k,"=",%1.__dict__[k]
+ # Print instance variables in self
+ alias ps pi self
+ """
args = arg.split()
if len(args) == 0:
keys = sorted(self.aliases.keys())
for alias in keys:
- print("%s = %s" % (alias, self.aliases[alias]), file=self.stdout)
+ self.message("%s = %s" % (alias, self.aliases[alias]))
return
if args[0] in self.aliases and len(args) == 1:
- print("%s = %s" % (args[0], self.aliases[args[0]]), file=self.stdout)
+ self.message("%s = %s" % (args[0], self.aliases[args[0]]))
else:
self.aliases[args[0]] = ' '.join(args[1:])
def do_unalias(self, arg):
+ """unalias name
+ Delete the specified alias.
+ """
args = arg.split()
if len(args) == 0: return
if args[0] in self.aliases:
del self.aliases[args[0]]
- #list of all the commands making the program resume execution.
+ # List of all the commands making the program resume execution.
commands_resuming = ['do_continue', 'do_step', 'do_next', 'do_return',
'do_quit', 'do_jump']
@@ -891,292 +1335,57 @@ class Pdb(bdb.Bdb, cmd.Cmd):
def print_stack_entry(self, frame_lineno, prompt_prefix=line_prefix):
frame, lineno = frame_lineno
if frame is self.curframe:
- print('>', end=' ', file=self.stdout)
+ prefix = '> '
else:
- print(' ', end=' ', file=self.stdout)
- print(self.format_stack_entry(frame_lineno,
- prompt_prefix), file=self.stdout)
-
-
- # Help methods (derived from pdb.doc)
-
- def help_help(self):
- self.help_h()
-
- def help_h(self):
- print("""h(elp)
-Without argument, print the list of available commands.
-With a command name as argument, print help about that command
-"help pdb" pipes the full documentation file to the $PAGER
-"help exec" gives help on the ! command""", file=self.stdout)
-
- def help_where(self):
- self.help_w()
-
- def help_w(self):
- print("""w(here)
-Print a stack trace, with the most recent frame at the bottom.
-An arrow indicates the "current frame", which determines the
-context of most commands. 'bt' is an alias for this command.""", file=self.stdout)
-
- help_bt = help_w
-
- def help_down(self):
- self.help_d()
-
- def help_d(self):
- print("""d(own)
-Move the current frame one level down in the stack trace
-(to a newer frame).""", file=self.stdout)
-
- def help_up(self):
- self.help_u()
-
- def help_u(self):
- print("""u(p)
-Move the current frame one level up in the stack trace
-(to an older frame).""", file=self.stdout)
-
- def help_break(self):
- self.help_b()
-
- def help_b(self):
- print("""b(reak) ([file:]lineno | function) [, condition]
-With a line number argument, set a break there in the current
-file. With a function name, set a break at first executable line
-of that function. Without argument, list all breaks. If a second
-argument is present, it is a string specifying an expression
-which must evaluate to true before the breakpoint is honored.
-
-The line number may be prefixed with a filename and a colon,
-to specify a breakpoint in another file (probably one that
-hasn't been loaded yet). The file is searched for on sys.path;
-the .py suffix may be omitted.""", file=self.stdout)
-
- def help_clear(self):
- self.help_cl()
-
- def help_cl(self):
- print("cl(ear) filename:lineno", file=self.stdout)
- print("""cl(ear) [bpnumber [bpnumber...]]
-With a space separated list of breakpoint numbers, clear
-those breakpoints. Without argument, clear all breaks (but
-first ask confirmation). With a filename:lineno argument,
-clear all breaks at that line in that file.""", file=self.stdout)
-
- def help_tbreak(self):
- print("""tbreak same arguments as break, but breakpoint is
-removed when first hit.""", file=self.stdout)
-
- def help_enable(self):
- print("""enable bpnumber [bpnumber ...]
-Enables the breakpoints given as a space separated list of
-bp numbers.""", file=self.stdout)
-
- def help_disable(self):
- print("""disable bpnumber [bpnumber ...]
-Disables the breakpoints given as a space separated list of
-bp numbers.""", file=self.stdout)
-
- def help_ignore(self):
- print("""ignore bpnumber count
-Sets the ignore count for the given breakpoint number. A breakpoint
-becomes active when the ignore count is zero. When non-zero, the
-count is decremented each time the breakpoint is reached and the
-breakpoint is not disabled and any associated condition evaluates
-to true.""", file=self.stdout)
-
- def help_condition(self):
- print("""condition bpnumber str_condition
-str_condition is a string specifying an expression which
-must evaluate to true before the breakpoint is honored.
-If str_condition is absent, any existing condition is removed;
-i.e., the breakpoint is made unconditional.""", file=self.stdout)
-
- def help_step(self):
- self.help_s()
-
- def help_s(self):
- print("""s(tep)
-Execute the current line, stop at the first possible occasion
-(either in a function that is called or in the current function).""", file=self.stdout)
-
- def help_until(self):
- self.help_unt()
-
- def help_unt(self):
- print("""unt(il)
-Continue execution until the line with a number greater than the current
-one is reached or until the current frame returns""")
-
- def help_next(self):
- self.help_n()
-
- def help_n(self):
- print("""n(ext)
-Continue execution until the next line in the current function
-is reached or it returns.""", file=self.stdout)
-
- def help_return(self):
- self.help_r()
-
- def help_r(self):
- print("""r(eturn)
-Continue execution until the current function returns.""", file=self.stdout)
-
- def help_continue(self):
- self.help_c()
-
- def help_cont(self):
- self.help_c()
-
- def help_c(self):
- print("""c(ont(inue))
-Continue execution, only stop when a breakpoint is encountered.""", file=self.stdout)
-
- def help_jump(self):
- self.help_j()
-
- def help_j(self):
- print("""j(ump) lineno
-Set the next line that will be executed.""", file=self.stdout)
-
- def help_debug(self):
- print("""debug code
-Enter a recursive debugger that steps through the code argument
-(which is an arbitrary expression or statement to be executed
-in the current environment).""", file=self.stdout)
-
- def help_list(self):
- self.help_l()
-
- def help_l(self):
- print("""l(ist) [first [,last]]
-List source code for the current file.
-Without arguments, list 11 lines around the current line
-or continue the previous listing.
-With one argument, list 11 lines starting at that line.
-With two arguments, list the given range;
-if the second argument is less than the first, it is a count.""", file=self.stdout)
-
- def help_args(self):
- self.help_a()
-
- def help_a(self):
- print("""a(rgs)
-Print the arguments of the current function.""", file=self.stdout)
-
- def help_p(self):
- print("""p(rint) expression
-Print the value of the expression.""", file=self.stdout)
-
- def help_pp(self):
- print("""pp expression
-Pretty-print the value of the expression.""", file=self.stdout)
+ prefix = ' '
+ self.message(prefix +
+ self.format_stack_entry(frame_lineno, prompt_prefix))
+
+ # Provide help
+
+ def do_help(self, arg):
+ """h(elp)
+ Without argument, print the list of available commands.
+ With a command name as argument, print help about that command.
+ "help pdb" shows the full pdb documentation.
+ "help exec" gives help on the ! command.
+ """
+ if not arg:
+ return cmd.Cmd.do_help(self, arg)
+ try:
+ try:
+ topic = getattr(self, 'help_' + arg)
+ return topic()
+ except AttributeError:
+ command = getattr(self, 'do_' + arg)
+ except AttributeError:
+ self.error('No help for %r' % arg)
+ else:
+ if sys.flags.optimize >= 2:
+ self.error('No help for %r; please do not run Python with -OO '
+ 'if you need command help' % arg)
+ return
+ self.message(command.__doc__.rstrip())
+
+ do_h = do_help
def help_exec(self):
- print("""(!) statement
-Execute the (one-line) statement in the context of
-the current stack frame.
-The exclamation point can be omitted unless the first word
-of the statement resembles a debugger command.
-To assign to a global variable you must always prefix the
-command with a 'global' command, e.g.:
-(Pdb) global list_options; list_options = ['-l']
-(Pdb)""", file=self.stdout)
-
- def help_run(self):
- print("""run [args...]
-Restart the debugged python program. If a string is supplied, it is
-splitted with "shlex" and the result is used as the new sys.argv.
-History, breakpoints, actions and debugger options are preserved.
-"restart" is an alias for "run".""")
-
- help_restart = help_run
-
- def help_quit(self):
- self.help_q()
-
- def help_q(self):
- print("""q(uit) or exit - Quit from the debugger.
-The program being executed is aborted.""", file=self.stdout)
-
- help_exit = help_q
-
- def help_whatis(self):
- print("""whatis arg
-Prints the type of the argument.""", file=self.stdout)
-
- def help_EOF(self):
- print("""EOF
-Handles the receipt of EOF as a command.""", file=self.stdout)
-
- def help_alias(self):
- print("""alias [name [command [parameter parameter ...] ]]
-Creates an alias called 'name' the executes 'command'. The command
-must *not* be enclosed in quotes. Replaceable parameters are
-indicated by %1, %2, and so on, while %* is replaced by all the
-parameters. If no command is given, the current alias for name
-is shown. If no name is given, all aliases are listed.
-
-Aliases may be nested and can contain anything that can be
-legally typed at the pdb prompt. Note! You *can* override
-internal pdb commands with aliases! Those internal commands
-are then hidden until the alias is removed. Aliasing is recursively
-applied to the first word of the command line; all other words
-in the line are left alone.
-
-Some useful aliases (especially when placed in the .pdbrc file) are:
-
-#Print instance variables (usage "pi classInst")
-alias pi for k in %1.__dict__.keys(): print "%1.",k,"=",%1.__dict__[k]
-
-#Print instance variables in self
-alias ps pi self
-""", file=self.stdout)
-
- def help_unalias(self):
- print("""unalias name
-Deletes the specified alias.""", file=self.stdout)
-
- def help_commands(self):
- print("""commands [bpnumber]
-(com) ...
-(com) end
-(Pdb)
-
-Specify a list of commands for breakpoint number bpnumber. The
-commands themselves appear on the following lines. Type a line
-containing just 'end' to terminate the commands.
-
-To remove all commands from a breakpoint, type commands and
-follow it immediately with end; that is, give no commands.
-
-With no bpnumber argument, commands refers to the last
-breakpoint set.
-
-You can use breakpoint commands to start your program up again.
-Simply use the continue command, or step, or any other
-command that resumes execution.
-
-Specifying any command resuming execution (currently continue,
-step, next, return, jump, quit and their abbreviations) terminates
-the command list (as if that command was immediately followed by end).
-This is because any time you resume execution
-(even with a simple next or step), you may encounter
-another breakpoint--which could have its own command list, leading to
-ambiguities about which list to execute.
-
- If you use the 'silent' command in the command list, the
-usual message about stopping at a breakpoint is not printed. This may
-be desirable for breakpoints that are to print a specific message and
-then continue. If none of the other commands print anything, you
-see no sign that the breakpoint was reached.
-""", file=self.stdout)
+ """(!) statement
+ Execute the (one-line) statement in the context of the current
+ stack frame. The exclamation point can be omitted unless the
+ first word of the statement resembles a debugger command. To
+ assign to a global variable you must always prefix the command
+ with a 'global' command, e.g.:
+ (Pdb) global list_options; list_options = ['-l']
+ (Pdb)
+ """
+ self.message((self.help_exec.__doc__ or '').strip())
def help_pdb(self):
help()
+ # other helper functions
+
def lookupmodule(self, filename):
"""Helper function for break/clear parsing -- may be overridden.
@@ -1219,14 +1428,33 @@ see no sign that the breakpoint was reached.
# events depends on python version). So we take special measures to
# avoid stopping before we reach the main script (see user_line and
# user_call for details).
- self._wait_for_mainpyfile = 1
+ self._wait_for_mainpyfile = True
self.mainpyfile = self.canonic(filename)
- self._user_requested_quit = 0
+ self._user_requested_quit = False
with open(filename, "rb") as fp:
statement = "exec(compile(%r, %r, 'exec'))" % \
(fp.read(), self.mainpyfile)
self.run(statement)
+# Collect all command help into docstring, if not run with -OO
+
+if __doc__ is not None:
+ # unfortunately we can't guess this order from the class definition
+ _help_order = [
+ 'help', 'where', 'down', 'up', 'break', 'tbreak', 'clear', 'disable',
+ 'enable', 'ignore', 'condition', 'commands', 'step', 'next', 'until',
+ 'jump', 'return', 'retval', 'run', 'continue', 'list', 'longlist',
+ 'args', 'print', 'pp', 'whatis', 'source', 'display', 'undisplay',
+ 'interact', 'alias', 'unalias', 'debug', 'quit',
+ ]
+
+ for _command in _help_order:
+ __doc__ += getattr(Pdb, 'do_' + _command).__doc__.strip() + '\n\n'
+ __doc__ += Pdb.help_exec.__doc__
+
+ del _help_order, _command
+
+
# Simplified interface
def run(statement, globals=None, locals=None):
@@ -1253,9 +1481,9 @@ def post_mortem(t=None):
# sys.exc_info() returns (type, value, traceback) if an exception is
# being handled, otherwise it returns None
t = sys.exc_info()[2]
- if t is None:
- raise ValueError("A valid traceback must be passed if no "
- "exception is being handled")
+ if t is None:
+ raise ValueError("A valid traceback must be passed if no "
+ "exception is being handled")
p = Pdb()
p.reset()
@@ -1274,27 +1502,45 @@ def test():
# print help
def help():
- for dirname in sys.path:
- fullname = os.path.join(dirname, 'pdb.doc')
- if os.path.exists(fullname):
- sts = os.system('${PAGER-more} '+fullname)
- if sts: print('*** Pager exit status:', sts)
- break
- else:
- print('Sorry, can\'t find the help file "pdb.doc"', end=' ')
- print('along the Python search path')
+ import pydoc
+ pydoc.pager(__doc__)
+
+_usage = """\
+usage: pdb.py [-c command] ... pyfile [arg] ...
+
+Debug the Python program given by pyfile.
+
+Initial commands are read from .pdbrc files in your home directory
+and in the current directory, if they exist. Commands supplied with
+-c are executed after commands from .pdbrc files.
+
+To let the script run until an exception occurs, use "-c continue".
+To let the script run up to a given line X in the debugged file, use
+"-c 'until X'"."""
def main():
- if not sys.argv[1:] or sys.argv[1] in ("--help", "-h"):
- print("usage: pdb.py scriptfile [arg] ...")
+ import getopt
+
+ opts, args = getopt.getopt(sys.argv[1:], 'hc:', ['--help', '--command='])
+
+ if not args:
+ print(_usage)
sys.exit(2)
- mainpyfile = sys.argv[1] # Get script filename
+ commands = []
+ for opt, optarg in opts:
+ if opt in ['-h', '--help']:
+ print(_usage)
+ sys.exit()
+ elif opt in ['-c', '--command']:
+ commands.append(optarg)
+
+ mainpyfile = args[0] # Get script filename
if not os.path.exists(mainpyfile):
print('Error:', mainpyfile, 'does not exist')
sys.exit(1)
- del sys.argv[0] # Hide "pdb.py" from argument list
+ sys.argv[:] = args # Hide "pdb.py" and pdb options from argument list
# Replace pdb's dir with script's dir in front of module search path.
sys.path[0] = os.path.dirname(mainpyfile)
@@ -1304,6 +1550,7 @@ def main():
# changed by the user from the command line. There is a "restart" command
# which allows explicit specification of command line arguments.
pdb = Pdb()
+ pdb.rcLines.extend(commands)
while True:
try:
pdb._runscript(mainpyfile)
@@ -1312,10 +1559,10 @@ def main():
print("The program finished and will be restarted")
except Restart:
print("Restarting", mainpyfile, "with arguments:")
- print("\t" + " ".join(sys.argv[1:]))
+ print("\t" + " ".join(args))
except SystemExit:
# In most cases SystemExit does not warrant a post-mortem session.
- print("The program exited via sys.exit(). Exit status: ", end=' ')
+ print("The program exited via sys.exit(). Exit status:", end=' ')
print(sys.exc_info()[1])
except:
traceback.print_exc()
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 5275991662..aca8fd183c 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -1235,9 +1235,7 @@ class _Unpickler:
raise _Stop(value)
dispatch[STOP[0]] = load_stop
-# Encode/decode longs in linear time.
-
-import binascii as _binascii
+# Encode/decode longs.
def encode_long(x):
r"""Encode a long to a two's complement little-endian binary string.
@@ -1260,50 +1258,14 @@ def encode_long(x):
b'\x7f'
>>>
"""
-
if x == 0:
return b''
- if x > 0:
- ashex = hex(x)
- assert ashex.startswith("0x")
- njunkchars = 2 + ashex.endswith('L')
- nibbles = len(ashex) - njunkchars
- if nibbles & 1:
- # need an even # of nibbles for unhexlify
- ashex = "0x0" + ashex[2:]
- elif int(ashex[2], 16) >= 8:
- # "looks negative", so need a byte of sign bits
- ashex = "0x00" + ashex[2:]
- else:
- # Build the 256's-complement: (1L << nbytes) + x. The trick is
- # to find the number of bytes in linear time (although that should
- # really be a constant-time task).
- ashex = hex(-x)
- assert ashex.startswith("0x")
- njunkchars = 2 + ashex.endswith('L')
- nibbles = len(ashex) - njunkchars
- if nibbles & 1:
- # Extend to a full byte.
- nibbles += 1
- nbits = nibbles * 4
- x += 1 << nbits
- assert x > 0
- ashex = hex(x)
- njunkchars = 2 + ashex.endswith('L')
- newnibbles = len(ashex) - njunkchars
- if newnibbles < nibbles:
- ashex = "0x" + "0" * (nibbles - newnibbles) + ashex[2:]
- if int(ashex[2], 16) < 8:
- # "looks positive", so need a byte of sign bits
- ashex = "0xff" + ashex[2:]
-
- if ashex.endswith('L'):
- ashex = ashex[2:-1]
- else:
- ashex = ashex[2:]
- assert len(ashex) & 1 == 0, (x, ashex)
- binary = _binascii.unhexlify(ashex)
- return bytes(binary[::-1])
+ nbytes = (x.bit_length() >> 3) + 1
+ result = x.to_bytes(nbytes, byteorder='little', signed=True)
+ if x < 0 and nbytes > 1:
+ if result[-1] == 0xff and (result[-2] & 0x80) != 0:
+ result = result[:-1]
+ return result
def decode_long(data):
r"""Decode a long from a two's complement little-endian binary string.
@@ -1323,21 +1285,7 @@ def decode_long(data):
>>> decode_long(b"\x7f")
127
"""
-
- nbytes = len(data)
- if nbytes == 0:
- return 0
- ashex = _binascii.hexlify(data[::-1])
- n = int(ashex, 16) # quadratic time before Python 2.3; linear now
- if data[-1] >= 0x80:
- n -= 1 << (nbytes * 8)
- return n
-
-# Use the faster _pickle if possible
-try:
- from _pickle import *
-except ImportError:
- Pickler, Unpickler = _Pickler, _Unpickler
+ return int.from_bytes(data, byteorder='little', signed=True)
# Shorthands
@@ -1362,10 +1310,38 @@ def loads(s, *, fix_imports=True, encoding="ASCII", errors="strict"):
return Unpickler(file, fix_imports=fix_imports,
encoding=encoding, errors=errors).load()
+# Use the faster _pickle if possible
+try:
+ from _pickle import *
+except ImportError:
+ Pickler, Unpickler = _Pickler, _Unpickler
+
# Doctest
def _test():
import doctest
return doctest.testmod()
if __name__ == "__main__":
- _test()
+ import sys, argparse
+ parser = argparse.ArgumentParser(
+ description='display contents of the pickle files')
+ parser.add_argument(
+ 'pickle_file', type=argparse.FileType('br'),
+ nargs='*', help='the pickle file')
+ parser.add_argument(
+ '-t', '--test', action='store_true',
+ help='run self-test suite')
+ parser.add_argument(
+ '-v', action='store_true',
+ help='run verbosely; only affects self-test run')
+ args = parser.parse_args()
+ if args.test:
+ _test()
+ else:
+ if not args.pickle_file:
+ parser.print_help()
+ else:
+ import pprint
+ for f in args.pickle_file:
+ obj = load(f)
+ pprint.pprint(obj)
diff --git a/Lib/pickletools.py b/Lib/pickletools.py
index 0af2fdba13..3061675c22 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -1907,7 +1907,7 @@ def optimize(p):
##############################################################################
# A symbolic pickle disassembler.
-def dis(pickle, out=None, memo=None, indentlevel=4):
+def dis(pickle, out=None, memo=None, indentlevel=4, annotate=0):
"""Produce a symbolic disassembly of a pickle.
'pickle' is a file-like object, or string, containing a (at least one)
@@ -1923,9 +1923,15 @@ def dis(pickle, out=None, memo=None, indentlevel=4):
to proceed across multiple pickles that were all created by the same
pickler with the same memo. Ordinarily you don't need to worry about this.
- Optional arg indentlevel is the number of blanks by which to indent
+ Optional arg 'indentlevel' is the number of blanks by which to indent
a new MARK level. It defaults to 4.
+ Optional arg 'annotate' if nonzero instructs dis() to add short
+ description of the opcode on each line of disassembled output.
+ The value given to 'annotate' must be an integer and is used as a
+ hint for the column where annotation should start. The default
+ value is 0, meaning no annotations.
+
In addition to printing the disassembly, some sanity checks are made:
+ All embedded opcode arguments "make sense".
@@ -1953,6 +1959,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4):
markstack = [] # bytecode positions of MARK opcodes
indentchunk = ' ' * indentlevel
errormsg = None
+ annocol = annotate # columnt hint for annotations
for opcode, arg, pos in genops(pickle):
if pos is not None:
print("%5d:" % pos, end=' ', file=out)
@@ -2020,6 +2027,13 @@ def dis(pickle, out=None, memo=None, indentlevel=4):
line += ' ' + repr(arg)
if markmsg:
line += ' ' + markmsg
+ if annotate:
+ line += ' ' * (annocol - len(line))
+ # make a mild effort to align annotations
+ annocol = len(line)
+ if annocol > 50:
+ annocol = annotate
+ line += ' ' + opcode.doc.split('\n', 1)[0]
print(line, file=out)
if errormsg:
@@ -2293,6 +2307,22 @@ highest protocol among opcodes = 2
12: h BINGET 1
14: . STOP
highest protocol among opcodes = 2
+
+Try protocol 3 with annotations:
+
+>>> dis(pickle.dumps(T, 3), annotate=1)
+ 0: \x80 PROTO 3 Protocol version indicator.
+ 2: ] EMPTY_LIST Push an empty list.
+ 3: q BINPUT 0 Store the stack top into the memo. The stack is not popped.
+ 5: h BINGET 0 Read an object from the memo and push it on the stack.
+ 7: \x85 TUPLE1 Build a one-tuple out of the topmost item on the stack.
+ 8: q BINPUT 1 Store the stack top into the memo. The stack is not popped.
+ 10: a APPEND Append an object to a list.
+ 11: 0 POP Discard the top stack item, shrinking the stack by one item.
+ 12: h BINGET 1 Read an object from the memo and push it on the stack.
+ 14: . STOP Stop the unpickling machine.
+highest protocol among opcodes = 2
+
"""
_memo_test = r"""
@@ -2333,4 +2363,47 @@ def _test():
return doctest.testmod()
if __name__ == "__main__":
- _test()
+ import sys, argparse
+ parser = argparse.ArgumentParser(
+ description='disassemble one or more pickle files')
+ parser.add_argument(
+ 'pickle_file', type=argparse.FileType('br'),
+ nargs='*', help='the pickle file')
+ parser.add_argument(
+ '-o', '--output', default=sys.stdout, type=argparse.FileType('w'),
+ help='the file where the output should be written')
+ parser.add_argument(
+ '-m', '--memo', action='store_true',
+ help='preserve memo between disassemblies')
+ parser.add_argument(
+ '-l', '--indentlevel', default=4, type=int,
+ help='the number of blanks by which to indent a new MARK level')
+ parser.add_argument(
+ '-a', '--annotate', action='store_true',
+ help='annotate each line with a short opcode description')
+ parser.add_argument(
+ '-p', '--preamble', default="==> {name} <==",
+ help='if more than one pickle file is specified, print this before'
+ ' each disassembly')
+ parser.add_argument(
+ '-t', '--test', action='store_true',
+ help='run self-test suite')
+ parser.add_argument(
+ '-v', action='store_true',
+ help='run verbosely; only affects self-test run')
+ args = parser.parse_args()
+ if args.test:
+ _test()
+ else:
+ annotate = 30 if args.annotate else 0
+ if not args.pickle_file:
+ parser.print_help()
+ elif len(args.pickle_file) == 1:
+ dis(args.pickle_file[0], args.output, None,
+ args.indentlevel, annotate)
+ else:
+ memo = {} if args.memo else None
+ for f in args.pickle_file:
+ preamble = args.preamble.format(name=f.name)
+ args.output.write(preamble + '\n')
+ dis(f, args.output, memo, args.indentlevel, annotate)
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index 0ec6ec5265..b48627565c 100644
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -241,7 +241,8 @@ class ImpLoader:
return mod
def get_data(self, pathname):
- return open(pathname, "rb").read()
+ with open(pathname, "rb") as file:
+ return file.read()
def _reopen(self):
if self.file and self.file.closed:
diff --git a/Lib/plat-atheos/IN.py b/Lib/plat-atheos/IN.py
deleted file mode 100644
index 9e77efc75c..0000000000
--- a/Lib/plat-atheos/IN.py
+++ /dev/null
@@ -1,944 +0,0 @@
-# Generated by h2py from /include/netinet/in.h
-_NETINET_IN_H = 1
-
-# Included from features.h
-_FEATURES_H = 1
-__USE_ANSI = 1
-__FAVOR_BSD = 1
-_ISOC9X_SOURCE = 1
-_POSIX_SOURCE = 1
-_POSIX_C_SOURCE = 199506
-_XOPEN_SOURCE = 500
-_XOPEN_SOURCE_EXTENDED = 1
-_LARGEFILE64_SOURCE = 1
-_BSD_SOURCE = 1
-_SVID_SOURCE = 1
-_BSD_SOURCE = 1
-_SVID_SOURCE = 1
-__USE_ISOC9X = 1
-_POSIX_SOURCE = 1
-_POSIX_C_SOURCE = 2
-_POSIX_C_SOURCE = 199506
-__USE_POSIX = 1
-__USE_POSIX2 = 1
-__USE_POSIX199309 = 1
-__USE_POSIX199506 = 1
-__USE_XOPEN = 1
-__USE_XOPEN_EXTENDED = 1
-__USE_UNIX98 = 1
-_LARGEFILE_SOURCE = 1
-__USE_XOPEN_EXTENDED = 1
-__USE_LARGEFILE = 1
-__USE_LARGEFILE64 = 1
-__USE_FILE_OFFSET64 = 1
-__USE_MISC = 1
-__USE_BSD = 1
-__USE_SVID = 1
-__USE_GNU = 1
-__USE_REENTRANT = 1
-__STDC_IEC_559__ = 1
-__STDC_IEC_559_COMPLEX__ = 1
-__GNU_LIBRARY__ = 6
-__GLIBC__ = 2
-__GLIBC_MINOR__ = 1
-
-# Included from sys/cdefs.h
-_SYS_CDEFS_H = 1
-def __PMT(args): return args
-
-def __P(args): return args
-
-def __PMT(args): return args
-
-def __P(args): return ()
-
-def __PMT(args): return ()
-
-def __STRING(x): return #x
-
-def __STRING(x): return "x"
-
-def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
-
-def __attribute__(xyz): return
-
-__USE_EXTERN_INLINES = 1
-
-# Included from gnu/stubs.h
-
-# Included from limits.h
-_LIBC_LIMITS_H_ = 1
-
-# Included from bits/posix1_lim.h
-_BITS_POSIX1_LIM_H = 1
-_POSIX_AIO_LISTIO_MAX = 2
-_POSIX_AIO_MAX = 1
-_POSIX_ARG_MAX = 4096
-_POSIX_CHILD_MAX = 6
-_POSIX_DELAYTIMER_MAX = 32
-_POSIX_LINK_MAX = 8
-_POSIX_MAX_CANON = 255
-_POSIX_MAX_INPUT = 255
-_POSIX_MQ_OPEN_MAX = 8
-_POSIX_MQ_PRIO_MAX = 32
-_POSIX_NGROUPS_MAX = 0
-_POSIX_OPEN_MAX = 16
-_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX
-_POSIX_NAME_MAX = 14
-_POSIX_PATH_MAX = 255
-_POSIX_PIPE_BUF = 512
-_POSIX_RTSIG_MAX = 8
-_POSIX_SEM_NSEMS_MAX = 256
-_POSIX_SEM_VALUE_MAX = 32767
-_POSIX_SIGQUEUE_MAX = 32
-_POSIX_SSIZE_MAX = 32767
-_POSIX_STREAM_MAX = 8
-_POSIX_TZNAME_MAX = 3
-_POSIX_QLIMIT = 1
-_POSIX_HIWAT = _POSIX_PIPE_BUF
-_POSIX_UIO_MAXIOV = 16
-_POSIX_TTY_NAME_MAX = 9
-_POSIX_TIMER_MAX = 32
-_POSIX_LOGIN_NAME_MAX = 9
-_POSIX_CLOCKRES_MIN = 20000000
-
-# Included from bits/local_lim.h
-
-# Included from posix/limits.h
-CHAR_BIT = 8
-CHAR_MAX = 127
-CHAR_MIN = (-128)
-INT_MAX = 2147483647
-INT_MIN = (-2147483647-1)
-LONG_MAX = 2147483647
-LONG_MIN = (-2147483647-1)
-SCHAR_MAX = 127
-SCHAR_MIN = (-128)
-SHRT_MAX = 32767
-SHRT_MIN = (-32768)
-UCHAR_MAX = 255
-USHRT_MAX = 65535
-_POSIX_ARG_MAX = 131072
-_POSIX_CHILD_MAX = 4096
-_POSIX_LINK_MAX = 1
-_POSIX_MAX_CANON = 126
-_POSIX_MAX_INPUT = 126
-_POSIX_NAME_MAX = 256
-_POSIX_NGROUPS_MAX = 32
-_POSIX_OPEN_MAX = 256
-_POSIX_PATH_MAX = 255
-_POSIX_PIPE_BUF = 512
-_POSIX_SSIZE_MAX = 2147483647
-_POSIX_STREAM_MAX = 256
-_POSIX_TZNAME_MAX = 5
-NGROUPS_MAX = 32
-ARG_MAX = 131072
-CHILD_MAX = 4096
-OPEN_MAX = 256
-LINK_MAX = 1
-MAX_CANON = 126
-MAX_INPUT = 126
-NAME_MAX = 255
-PATH_MAX = 4096
-PIPE_BUF = 4096
-SSIZE_MAX = 2147483647
-MAXSYMLINKS = 16
-AIO_PRIO_DELTA_MAX = 20
-SSIZE_MAX = INT_MAX
-NGROUPS_MAX = _POSIX_NGROUPS_MAX
-
-# Included from bits/posix2_lim.h
-_BITS_POSIX2_LIM_H = 1
-_POSIX2_BC_BASE_MAX = 99
-_POSIX2_BC_DIM_MAX = 2048
-_POSIX2_BC_SCALE_MAX = 99
-_POSIX2_BC_STRING_MAX = 1000
-_POSIX2_COLL_WEIGHTS_MAX = 255
-_POSIX2_EQUIV_CLASS_MAX = 255
-_POSIX2_EXPR_NEST_MAX = 32
-_POSIX2_LINE_MAX = 2048
-_POSIX2_RE_DUP_MAX = 255
-_POSIX2_CHARCLASS_NAME_MAX = 2048
-BC_BASE_MAX = _POSIX2_BC_BASE_MAX
-BC_DIM_MAX = _POSIX2_BC_DIM_MAX
-BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX
-BC_STRING_MAX = _POSIX2_BC_STRING_MAX
-COLL_WEIGHTS_MAX = _POSIX2_COLL_WEIGHTS_MAX
-EQUIV_CLASS_MAX = _POSIX2_EQUIV_CLASS_MAX
-EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX
-LINE_MAX = _POSIX2_LINE_MAX
-RE_DUP_MAX = _POSIX2_RE_DUP_MAX
-CHARCLASS_NAME_MAX = _POSIX2_CHARCLASS_NAME_MAX
-
-# Included from bits/xopen_lim.h
-_XOPEN_LIM_H = 1
-
-# Included from bits/stdio_lim.h
-L_tmpnam = 20
-TMP_MAX = 238328
-FILENAME_MAX = 4096
-L_ctermid = 9
-L_cuserid = 9
-FOPEN_MAX = 256
-STREAM_MAX = FOPEN_MAX
-TZNAME_MAX = _POSIX_TZNAME_MAX
-_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV
-NL_ARGMAX = _POSIX_ARG_MAX
-NL_LANGMAX = _POSIX2_LINE_MAX
-NL_MSGMAX = INT_MAX
-NL_NMAX = INT_MAX
-NL_SETMAX = INT_MAX
-NL_TEXTMAX = INT_MAX
-NZERO = 20
-MB_LEN_MAX = 6
-_LIMITS_H = 1
-CHAR_BIT = 8
-SCHAR_MIN = (-128)
-SCHAR_MAX = 127
-UCHAR_MAX = 255
-CHAR_MIN = 0
-CHAR_MAX = UCHAR_MAX
-CHAR_MIN = SCHAR_MIN
-CHAR_MAX = SCHAR_MAX
-SHRT_MIN = (-32768)
-SHRT_MAX = 32767
-USHRT_MAX = 65535
-INT_MIN = (-INT_MAX - 1)
-INT_MAX = 2147483647
-UINT_MAX = 4294967295
-LONG_MAX = 9223372036854775807
-LONG_MAX = 2147483647
-LONG_MIN = (-LONG_MAX - 1)
-ULONG_MAX = 4294967295
-
-# Included from stdint.h
-_STDINT_H = 1
-
-# Included from bits/wordsize.h
-__WORDSIZE = 32
-def __INT64_C(c): return c ## L
-
-def __UINT64_C(c): return c ## UL
-
-def __INT64_C(c): return c ## LL
-
-def __UINT64_C(c): return c ## ULL
-
-INT8_MIN = (-128)
-INT16_MIN = (-32767-1)
-INT32_MIN = (-2147483647-1)
-INT64_MIN = (-__INT64_C(9223372036854775807)-1)
-INT8_MAX = (127)
-INT16_MAX = (32767)
-INT32_MAX = (2147483647)
-INT64_MAX = (__INT64_C(9223372036854775807))
-UINT64_MAX = (__UINT64_C(18446744073709551615))
-INT_LEAST8_MIN = (-128)
-INT_LEAST16_MIN = (-32767-1)
-INT_LEAST32_MIN = (-2147483647-1)
-INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1)
-INT_LEAST8_MAX = (127)
-INT_LEAST16_MAX = (32767)
-INT_LEAST32_MAX = (2147483647)
-INT_LEAST64_MAX = (__INT64_C(9223372036854775807))
-UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615))
-INT_FAST8_MIN = (-128)
-INT_FAST16_MIN = (-9223372036854775807-1)
-INT_FAST32_MIN = (-9223372036854775807-1)
-INT_FAST16_MIN = (-2147483647-1)
-INT_FAST32_MIN = (-2147483647-1)
-INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1)
-INT_FAST8_MAX = (127)
-INT_FAST16_MAX = (9223372036854775807)
-INT_FAST32_MAX = (9223372036854775807)
-INT_FAST16_MAX = (2147483647)
-INT_FAST32_MAX = (2147483647)
-INT_FAST64_MAX = (__INT64_C(9223372036854775807))
-UINT_FAST64_MAX = (__UINT64_C(18446744073709551615))
-INTPTR_MIN = (-9223372036854775807-1)
-INTPTR_MAX = (9223372036854775807)
-INTPTR_MIN = (-2147483647-1)
-INTPTR_MAX = (2147483647)
-INTMAX_MIN = (-__INT64_C(9223372036854775807)-1)
-INTMAX_MAX = (__INT64_C(9223372036854775807))
-UINTMAX_MAX = (__UINT64_C(18446744073709551615))
-PTRDIFF_MIN = (-9223372036854775807-1)
-PTRDIFF_MAX = (9223372036854775807)
-PTRDIFF_MIN = (-2147483647-1)
-PTRDIFF_MAX = (2147483647)
-SIG_ATOMIC_MIN = (-2147483647-1)
-SIG_ATOMIC_MAX = (2147483647)
-WCHAR_MIN = (-2147483647-1)
-WCHAR_MAX = (2147483647)
-WINT_MIN = (0)
-def INT8_C(c): return c
-
-def INT16_C(c): return c
-
-def INT32_C(c): return c
-
-def INT64_C(c): return c ## L
-
-def INT64_C(c): return c ## LL
-
-def UINT8_C(c): return c ## U
-
-def UINT16_C(c): return c ## U
-
-def UINT32_C(c): return c ## U
-
-def UINT64_C(c): return c ## UL
-
-def UINT64_C(c): return c ## ULL
-
-def INTMAX_C(c): return c ## L
-
-def UINTMAX_C(c): return c ## UL
-
-def INTMAX_C(c): return c ## LL
-
-def UINTMAX_C(c): return c ## ULL
-
-
-# Included from sys/types.h
-_SYS_TYPES_H = 1
-
-# Included from bits/types.h
-_BITS_TYPES_H = 1
-__FD_SETSIZE = 1024
-def __FDELT(d): return ((d) / __NFDBITS)
-
-
-# Included from bits/pthreadtypes.h
-
-# Included from time.h
-_TIME_H = 1
-
-# Included from bits/time.h
-
-# Included from posix/time.h
-
-# Included from posix/types.h
-MAXHOSTNAMELEN = 64
-FD_SETSIZE = 1024
-CLOCKS_PER_SEC = 1000000
-_BITS_TIME_H = 1
-CLOCKS_PER_SEC = 1000000
-CLK_TCK = 100
-_STRUCT_TIMEVAL = 1
-CLK_TCK = CLOCKS_PER_SEC
-__clock_t_defined = 1
-__time_t_defined = 1
-__timespec_defined = 1
-def __isleap(year): return \
-
-__BIT_TYPES_DEFINED__ = 1
-
-# Included from endian.h
-_ENDIAN_H = 1
-__LITTLE_ENDIAN = 1234
-__BIG_ENDIAN = 4321
-__PDP_ENDIAN = 3412
-
-# Included from bits/endian.h
-__BYTE_ORDER = __LITTLE_ENDIAN
-__FLOAT_WORD_ORDER = __BYTE_ORDER
-LITTLE_ENDIAN = __LITTLE_ENDIAN
-BIG_ENDIAN = __BIG_ENDIAN
-PDP_ENDIAN = __PDP_ENDIAN
-BYTE_ORDER = __BYTE_ORDER
-
-# Included from sys/select.h
-_SYS_SELECT_H = 1
-
-# Included from bits/select.h
-def __FD_ZERO(fdsp): return \
-
-def __FD_ZERO(set): return \
-
-
-# Included from bits/sigset.h
-_SIGSET_H_types = 1
-_SIGSET_H_fns = 1
-def __sigmask(sig): return \
-
-def __sigemptyset(set): return \
-
-def __sigfillset(set): return \
-
-def __sigisemptyset(set): return \
-
-FD_SETSIZE = __FD_SETSIZE
-def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp)
-
-
-# Included from sys/sysmacros.h
-_SYS_SYSMACROS_H = 1
-def major(dev): return ( (( (dev) >> 8) & 0xff))
-
-def minor(dev): return ( ((dev) & 0xff))
-
-
-# Included from bits/socket.h
-PF_UNSPEC = 0
-PF_LOCAL = 1
-PF_UNIX = PF_LOCAL
-PF_FILE = PF_LOCAL
-PF_INET = 2
-PF_AX25 = 3
-PF_IPX = 4
-PF_APPLETALK = 5
-PF_NETROM = 6
-PF_BRIDGE = 7
-PF_ATMPVC = 8
-PF_X25 = 9
-PF_INET6 = 10
-PF_ROSE = 11
-PF_DECnet = 12
-PF_NETBEUI = 13
-PF_SECURITY = 14
-PF_KEY = 15
-PF_NETLINK = 16
-PF_ROUTE = PF_NETLINK
-PF_PACKET = 17
-PF_ASH = 18
-PF_ECONET = 19
-PF_ATMSVC = 20
-PF_SNA = 22
-PF_IRDA = 23
-PF_MAX = 32
-AF_UNSPEC = PF_UNSPEC
-AF_LOCAL = PF_LOCAL
-AF_UNIX = PF_UNIX
-AF_FILE = PF_FILE
-AF_INET = PF_INET
-AF_AX25 = PF_AX25
-AF_IPX = PF_IPX
-AF_APPLETALK = PF_APPLETALK
-AF_NETROM = PF_NETROM
-AF_BRIDGE = PF_BRIDGE
-AF_ATMPVC = PF_ATMPVC
-AF_X25 = PF_X25
-AF_INET6 = PF_INET6
-AF_ROSE = PF_ROSE
-AF_DECnet = PF_DECnet
-AF_NETBEUI = PF_NETBEUI
-AF_SECURITY = PF_SECURITY
-AF_KEY = PF_KEY
-AF_NETLINK = PF_NETLINK
-AF_ROUTE = PF_ROUTE
-AF_PACKET = PF_PACKET
-AF_ASH = PF_ASH
-AF_ECONET = PF_ECONET
-AF_ATMSVC = PF_ATMSVC
-AF_SNA = PF_SNA
-AF_IRDA = PF_IRDA
-AF_MAX = PF_MAX
-SOL_RAW = 255
-SOL_DECNET = 261
-SOL_X25 = 262
-SOL_PACKET = 263
-SOL_ATM = 264
-SOL_AAL = 265
-SOL_IRDA = 266
-SOMAXCONN = 128
-
-# Included from bits/sockaddr.h
-_BITS_SOCKADDR_H = 1
-def __SOCKADDR_COMMON(sa_prefix): return \
-
-_SS_SIZE = 128
-def CMSG_FIRSTHDR(mhdr): return \
-
-
-# Included from atheos/socket.h
-
-# Included from atheos/types.h
-OS_NAME_LENGTH = 64
-TRUE = 1
-FALSE = 0
-
-# Included from atheos/filesystem.h
-
-# Included from atheos/atomic.h
-
-# Included from atheos/typedefs.h
-
-# Included from atheos/fs_attribs.h
-
-# Included from atheos/kernel.h
-
-# Included from atheos/kdebug.h
-
-# Included from atheos/threads.h
-TF_DEADLOCK = 0x0001
-DB_PACKET_SIZE = 128
-DB_PORT_COUNT = 16
-DBP_PRINTK = 0
-DBP_DEBUGGER = 2
-
-# Included from atheos/stdlib.h
-
-# Included from atheos/string.h
-def COMMON(x): return \
-
-def COMMON(x): return \
-
-
-# Included from atheos/schedule.h
-
-# Included from atheos/timer.h
-
-# Included from posix/resource.h
-RUSAGE_SELF = 0
-RUSAGE_CHILDREN = -1
-RLIMIT_CPU = 0
-RLIMIT_FSIZE = 1
-RLIMIT_DATA = 2
-RLIMIT_STACK = 3
-RLIMIT_CORE = 4
-RLIMIT_RSS = 5
-RLIMIT_MEMLOCK = 6
-RLIMIT_NPROC = 7
-RLIMIT_NOFILE = 8
-RLIMIT_AS = 9
-RLIM_NLIMITS = 10
-
-# Included from atheos/v86.h
-
-# Included from atheos/areas.h
-MEMF_REAL = 0x00000002
-MEMF_USER = 0x00000004
-MEMF_BUFFER = 0x00000008
-MEMF_KERNEL = 0x00000010
-MEMF_OKTOFAILHACK = 0x00000020
-MEMF_PRI_MASK = 0x000000ff
-MEMF_NOBLOCK = 0x00000100
-MEMF_CLEAR = 0x00010000
-MEMF_LOCKED = 0x10000000
-PAGE_SHIFT = 12
-PGDIR_SHIFT = 22
-def PAGE_ALIGN(addr): return (((addr)+PAGE_SIZE-1)&PAGE_MASK)
-
-AREA_NO_LOCK = 0
-AREA_LAZY_LOCK = 1
-AREA_FULL_LOCK = 2
-AREA_CONTIGUOUS = 3
-AREA_READ = 0x00000001
-AREA_WRITE = 0x00000002
-AREA_EXEC = 0x00000004
-AREA_FULL_ACCESS = (AREA_READ | AREA_WRITE | AREA_EXEC)
-AREA_KERNEL = 0x00000008
-AREA_UNMAP_PHYS = 0x00000010
-AREA_ANY_ADDRESS = 0x00000000
-AREA_EXACT_ADDRESS = 0x00000100
-AREA_BASE_ADDRESS = 0x00000200
-AREA_CLONE_ADDRESS = 0x00000300
-AREA_ADDR_SPEC_MASK = 0x00000f00
-AREA_TOP_DOWN = 0x00001000
-AREA_REMAPPED = 0x0020
-AREA_SHARED = 0x0040
-AREA_GROWSDOWN = 0x0080
-AREA_FIRST_KERNEL_ADDRESS = 0x00100000
-AREA_LAST_KERNEL_ADDRESS = 0x7fffffff
-AREA_FIRST_USER_ADDRESS = 0x80000000
-AREA_LAST_USER_ADDRESS = 0xffffffff
-MAX_CPU_COUNT = 16
-def kfree(p): return kassertw( __kfree(p) == 0 )
-
-
-# Included from posix/dirent.h
-MAXNAMLEN = NAME_MAX
-MAXNAMLEN = 255
-
-# Included from dirent.h
-_DIRENT_H = 1
-
-# Included from bits/dirent.h
-def _D_ALLOC_NAMLEN(d): return (_D_EXACT_NAMLEN (d) + 1)
-
-def IFTODT(mode): return (((mode) & 0o170000) >> 12)
-
-def DTTOIF(dirtype): return ((dirtype) << 12)
-
-def dirfd(dirp): return _DIR_dirfd (dirp)
-
-MAXNAMLEN = NAME_MAX
-MAXNAMLEN = 255
-
-# Included from posix/stat.h
-S_IFMT = 0o0170000
-S_IFSOCK = 0o140000
-S_IFLNK = 0o120000
-S_IFREG = 0o100000
-S_IFBLK = 0o060000
-S_IFDIR = 0o040000
-S_IFCHR = 0o020000
-S_IFIFO = 0o010000
-S_ISUID = 0o004000
-S_ISGID = 0o002000
-S_ISVTX = 0o001000
-def S_ISLNK(m): return (((m) & S_IFMT) == S_IFLNK)
-
-def S_ISREG(m): return (((m) & S_IFMT) == S_IFREG)
-
-def S_ISDIR(m): return (((m) & S_IFMT) == S_IFDIR)
-
-def S_ISCHR(m): return (((m) & S_IFMT) == S_IFCHR)
-
-def S_ISBLK(m): return (((m) & S_IFMT) == S_IFBLK)
-
-def S_ISFIFO(m): return (((m) & S_IFMT) == S_IFIFO)
-
-def S_ISSOCK(m): return (((m) & S_IFMT) == S_IFSOCK)
-
-S_IRWXU = 0o0700
-S_IRUSR = 0o0400
-S_IWUSR = 0o0200
-S_IXUSR = 0o0100
-S_IRWXG = 0o0070
-S_IRGRP = 0o0040
-S_IWGRP = 0o0020
-S_IXGRP = 0o0010
-S_IRWXO = 0o0007
-S_IROTH = 0o0004
-S_IWOTH = 0o0002
-S_IXOTH = 0o0001
-S_IRWXUGO = (S_IRWXU|S_IRWXG|S_IRWXO)
-S_IALLUGO = (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
-S_IRUGO = (S_IRUSR|S_IRGRP|S_IROTH)
-S_IWUGO = (S_IWUSR|S_IWGRP|S_IWOTH)
-S_IXUGO = (S_IXUSR|S_IXGRP|S_IXOTH)
-_STAT_VER_KERNEL = 0
-
-# Included from posix/fcntl.h
-O_ACCMODE = 0o003
-O_RWMASK = O_ACCMODE
-O_RDONLY = 00
-O_WRONLY = 0o1
-O_RDWR = 0o2
-O_CREAT = 0o100
-O_EXCL = 0o200
-O_NOCTTY = 0o400
-O_TRUNC = 0o1000
-O_APPEND = 0o2000
-O_NONBLOCK = 0o4000
-O_NDELAY = O_NONBLOCK
-O_SYNC = 0o10000
-O_FSYNC = O_SYNC
-O_ASYNC = 0o20000
-FASYNC = O_ASYNC
-O_DIRECTORY = 0o40000
-O_NOTRAVERSE = 0o100000
-O_NOFOLLOW = O_NOTRAVERSE
-F_DUPFD = 0
-F_GETFD = 1
-F_SETFD = 2
-F_GETFL = 3
-F_SETFL = 4
-F_GETLK = 5
-F_SETLK = 6
-F_SETLKW = 7
-F_SETOWN = 8
-F_GETOWN = 9
-F_SETSIG = 10
-F_GETSIG = 11
-F_COPYFD = 12
-FD_CLOEXEC = 1
-F_RDLCK = 0
-F_WRLCK = 1
-F_UNLCK = 2
-F_EXLCK = 4
-F_SHLCK = 8
-LOCK_SH = 1
-LOCK_EX = 2
-LOCK_NB = 4
-LOCK_UN = 8
-
-# Included from posix/uio.h
-UIO_FASTIOV = 8
-UIO_MAXIOV = 1024
-MNTF_READONLY = 0x0001
-FS_IS_READONLY = 0x00000001
-FS_IS_REMOVABLE = 0x00000002
-FS_IS_PERSISTENT = 0x00000004
-FS_IS_SHARED = 0x00000008
-FS_IS_BLOCKBASED = 0x00000010
-FS_CAN_MOUNT = 0x00000020
-FS_HAS_MIME = 0x00010000
-FS_HAS_ATTR = 0x00020000
-FS_HAS_QUERY = 0x00040000
-FSINFO_VERSION = 1
-WSTAT_MODE = 0x0001
-WSTAT_UID = 0x0002
-WSTAT_GID = 0x0004
-WSTAT_SIZE = 0x0008
-WSTAT_ATIME = 0x0010
-WSTAT_MTIME = 0x0020
-WSTAT_CTIME = 0x0040
-WFSSTAT_NAME = 0x0001
-FSDRIVER_API_VERSION = 1
-
-# Included from net/nettypes.h
-IP_ADR_LEN = 4
-INADDR_ANY = 0x00000000
-INADDR_BROADCAST = 0xffffffff
-INADDR_LOOPBACK = 0x7f000001
-def CMSG_ALIGN(len): return ( ((len)+sizeof(int)-1) & ~(sizeof(int)-1) )
-
-PROT_SOCK = 1024
-SHUTDOWN_MASK = 3
-RCV_SHUTDOWN = 1
-SEND_SHUTDOWN = 2
-SOCK_STREAM = 1
-SOCK_DGRAM = 2
-SOCK_RAW = 3
-SOCK_RDM = 4
-SOCK_SEQPACKET = 5
-SOCK_PACKET = 10
-PF_UNSPEC = 0
-PF_LOCAL = 1
-PF_UNIX = PF_LOCAL
-PF_FILE = PF_LOCAL
-PF_INET = 2
-PF_AX25 = 3
-PF_IPX = 4
-PF_APPLETALK = 5
-PF_NETROM = 6
-PF_BRIDGE = 7
-PF_ATMPVC = 8
-PF_X25 = 9
-PF_INET6 = 10
-PF_ROSE = 11
-PF_DECnet = 12
-PF_NETBEUI = 13
-PF_SECURITY = 14
-PF_KEY = 15
-PF_NETLINK = 16
-PF_ROUTE = PF_NETLINK
-PF_PACKET = 17
-PF_ASH = 18
-PF_ECONET = 19
-PF_ATMSVC = 20
-PF_SNA = 22
-PF_IRDA = 23
-PF_MAX = 32
-AF_UNSPEC = PF_UNSPEC
-AF_LOCAL = PF_LOCAL
-AF_UNIX = PF_UNIX
-AF_FILE = PF_FILE
-AF_INET = PF_INET
-AF_AX25 = PF_AX25
-AF_IPX = PF_IPX
-AF_APPLETALK = PF_APPLETALK
-AF_NETROM = PF_NETROM
-AF_BRIDGE = PF_BRIDGE
-AF_ATMPVC = PF_ATMPVC
-AF_X25 = PF_X25
-AF_INET6 = PF_INET6
-AF_ROSE = PF_ROSE
-AF_DECnet = PF_DECnet
-AF_NETBEUI = PF_NETBEUI
-AF_SECURITY = PF_SECURITY
-AF_KEY = PF_KEY
-AF_NETLINK = PF_NETLINK
-AF_ROUTE = PF_ROUTE
-AF_PACKET = PF_PACKET
-AF_ASH = PF_ASH
-AF_ECONET = PF_ECONET
-AF_ATMSVC = PF_ATMSVC
-AF_SNA = PF_SNA
-AF_IRDA = PF_IRDA
-AF_MAX = PF_MAX
-PF_UNIX = 1
-AF_UNIX = PF_UNIX
-PF_INET = 2
-AF_INET = PF_INET
-SOMAXCONN = 128
-MSG_OOB = 1
-MSG_PEEK = 2
-MSG_DONTROUTE = 4
-MSG_PROXY = 16
-SOL_SOCKET = 1
-SO_DEBUG = 1
-SO_REUSEADDR = 2
-SO_TYPE = 3
-SO_ERROR = 4
-SO_DONTROUTE = 5
-SO_BROADCAST = 6
-SO_SNDBUF = 7
-SO_RCVBUF = 8
-SO_KEEPALIVE = 9
-SO_OOBINLINE = 10
-SO_NO_CHECK = 11
-SO_PRIORITY = 12
-SO_LINGER = 13
-SO_BSDCOMPAT = 14
-SOL_IP = 0
-SOL_IPX = 256
-SOL_AX25 = 257
-SOL_ATALK = 258
-SOL_NETROM = 259
-SOL_TCP = 6
-SOL_UDP = 17
-IP_TOS = 1
-IPTOS_LOWDELAY = 0x10
-IPTOS_THROUGHPUT = 0x08
-IPTOS_RELIABILITY = 0x04
-IPTOS_MINCOST = 0x02
-IP_TTL = 2
-IP_HDRINCL = 3
-IP_OPTIONS = 4
-IP_MULTICAST_IF = 32
-IP_MULTICAST_TTL = 33
-IP_MULTICAST_LOOP = 34
-IP_ADD_MEMBERSHIP = 35
-IP_DROP_MEMBERSHIP = 36
-TCP_NODELAY = 0x01
-TCP_MAXSEG = 0x02
-def IN_CLASSA(a): return ((( (a)) & 0x80000000) == 0)
-
-IN_CLASSA_NET = 0xff000000
-IN_CLASSA_NSHIFT = 24
-IN_CLASSA_HOST = (0xffffffff & ~IN_CLASSA_NET)
-IN_CLASSA_MAX = 128
-def IN_CLASSB(a): return ((( (a)) & 0xc0000000) == 0x80000000)
-
-IN_CLASSB_NET = 0xffff0000
-IN_CLASSB_NSHIFT = 16
-IN_CLASSB_HOST = (0xffffffff & ~IN_CLASSB_NET)
-IN_CLASSB_MAX = 65536
-def IN_CLASSC(a): return ((( (a)) & 0xe0000000) == 0xc0000000)
-
-IN_CLASSC_NET = 0xffffff00
-IN_CLASSC_NSHIFT = 8
-IN_CLASSC_HOST = (0xffffffff & ~IN_CLASSC_NET)
-def IN_CLASSD(a): return ((( (a)) & 0xf0000000) == 0xe0000000)
-
-def IN_MULTICAST(a): return IN_CLASSD(a)
-
-def IN_EXPERIMENTAL(a): return ((( (a)) & 0xe0000000) == 0xe0000000)
-
-def IN_BADCLASS(a): return ((( (a)) & 0xf0000000) == 0xf0000000)
-
-INADDR_ANY = ( 0x00000000)
-INADDR_BROADCAST = ( 0xffffffff)
-INADDR_NONE = ( 0xffffffff)
-IN_LOOPBACKNET = 127
-INADDR_LOOPBACK = ( 0x7f000001)
-INADDR_UNSPEC_GROUP = ( 0xe0000000)
-INADDR_ALLHOSTS_GROUP = ( 0xe0000001)
-INADDR_ALLRTRS_GROUP = ( 0xe0000002)
-INADDR_MAX_LOCAL_GROUP = ( 0xe00000ff)
-INET_ADDRSTRLEN = 16
-INET6_ADDRSTRLEN = 46
-
-# Included from bits/in.h
-IP_TOS = 1
-IP_TTL = 2
-IP_HDRINCL = 3
-IP_OPTIONS = 4
-IP_ROUTER_ALERT = 5
-IP_RECVOPTS = 6
-IP_RETOPTS = 7
-IP_PKTINFO = 8
-IP_PKTOPTIONS = 9
-IP_PMTUDISC = 10
-IP_MTU_DISCOVER = 10
-IP_RECVERR = 11
-IP_RECVTTL = 12
-IP_RECVTOS = 13
-IP_MULTICAST_IF = 32
-IP_MULTICAST_TTL = 33
-IP_MULTICAST_LOOP = 34
-IP_ADD_MEMBERSHIP = 35
-IP_DROP_MEMBERSHIP = 36
-IP_RECVRETOPTS = IP_RETOPTS
-IP_PMTUDISC_DONT = 0
-IP_PMTUDISC_WANT = 1
-IP_PMTUDISC_DO = 2
-SOL_IP = 0
-SOL_SOCKET = 1
-IP_DEFAULT_MULTICAST_TTL = 1
-IP_DEFAULT_MULTICAST_LOOP = 1
-IP_MAX_MEMBERSHIPS = 20
-IPV6_ADDRFORM = 1
-IPV6_PKTINFO = 2
-IPV6_HOPOPTS = 3
-IPV6_DSTOPTS = 4
-IPV6_RXSRCRT = 5
-IPV6_PKTOPTIONS = 6
-IPV6_CHECKSUM = 7
-IPV6_HOPLIMIT = 8
-IPV6_NEXTHOP = 9
-IPV6_AUTHHDR = 10
-IPV6_UNICAST_HOPS = 16
-IPV6_MULTICAST_IF = 17
-IPV6_MULTICAST_HOPS = 18
-IPV6_MULTICAST_LOOP = 19
-IPV6_ADD_MEMBERSHIP = 20
-IPV6_DROP_MEMBERSHIP = 21
-IPV6_ROUTER_ALERT = 22
-SCM_SRCRT = IPV6_RXSRCRT
-IPV6_RXHOPOPTS = IPV6_HOPOPTS
-IPV6_RXDSTOPTS = IPV6_DSTOPTS
-IPV6_PMTUDISC_DONT = 0
-IPV6_PMTUDISC_WANT = 1
-IPV6_PMTUDISC_DO = 2
-SOL_IPV6 = 41
-SOL_ICMPV6 = 58
-
-# Included from bits/byteswap.h
-def __bswap_constant_16(x): return \
-
-def __bswap_16(x): return \
-
-def __bswap_16(x): return __bswap_constant_16 (x)
-
-def __bswap_constant_32(x): return \
-
-def __bswap_32(x): return \
-
-def __bswap_32(x): return \
-
-def __bswap_32(x): return __bswap_constant_32 (x)
-
-def __bswap_64(x): return \
-
-def ntohl(x): return (x)
-
-def ntohs(x): return (x)
-
-def htonl(x): return (x)
-
-def htons(x): return (x)
-
-def ntohl(x): return __bswap_32 (x)
-
-def ntohs(x): return __bswap_16 (x)
-
-def htonl(x): return __bswap_32 (x)
-
-def htons(x): return __bswap_16 (x)
-
-def IN6_IS_ADDR_UNSPECIFIED(a): return \
-
-def IN6_IS_ADDR_LOOPBACK(a): return \
-
-def IN6_IS_ADDR_LINKLOCAL(a): return \
-
-def IN6_IS_ADDR_SITELOCAL(a): return \
-
-def IN6_IS_ADDR_V4MAPPED(a): return \
-
-def IN6_IS_ADDR_V4COMPAT(a): return \
-
-def IN6_IS_ADDR_MC_NODELOCAL(a): return \
-
-def IN6_IS_ADDR_MC_LINKLOCAL(a): return \
-
-def IN6_IS_ADDR_MC_SITELOCAL(a): return \
-
-def IN6_IS_ADDR_MC_ORGLOCAL(a): return \
-
-def IN6_IS_ADDR_MC_GLOBAL(a): return
diff --git a/Lib/plat-atheos/TYPES.py b/Lib/plat-atheos/TYPES.py
deleted file mode 100644
index 9d0be35d29..0000000000
--- a/Lib/plat-atheos/TYPES.py
+++ /dev/null
@@ -1,142 +0,0 @@
-# Generated by h2py from /include/sys/types.h
-_SYS_TYPES_H = 1
-
-# Included from features.h
-_FEATURES_H = 1
-__USE_ANSI = 1
-__FAVOR_BSD = 1
-_ISOC9X_SOURCE = 1
-_POSIX_SOURCE = 1
-_POSIX_C_SOURCE = 199506
-_XOPEN_SOURCE = 500
-_XOPEN_SOURCE_EXTENDED = 1
-_LARGEFILE64_SOURCE = 1
-_BSD_SOURCE = 1
-_SVID_SOURCE = 1
-_BSD_SOURCE = 1
-_SVID_SOURCE = 1
-__USE_ISOC9X = 1
-_POSIX_SOURCE = 1
-_POSIX_C_SOURCE = 2
-_POSIX_C_SOURCE = 199506
-__USE_POSIX = 1
-__USE_POSIX2 = 1
-__USE_POSIX199309 = 1
-__USE_POSIX199506 = 1
-__USE_XOPEN = 1
-__USE_XOPEN_EXTENDED = 1
-__USE_UNIX98 = 1
-_LARGEFILE_SOURCE = 1
-__USE_XOPEN_EXTENDED = 1
-__USE_LARGEFILE = 1
-__USE_LARGEFILE64 = 1
-__USE_FILE_OFFSET64 = 1
-__USE_MISC = 1
-__USE_BSD = 1
-__USE_SVID = 1
-__USE_GNU = 1
-__USE_REENTRANT = 1
-__STDC_IEC_559__ = 1
-__STDC_IEC_559_COMPLEX__ = 1
-__GNU_LIBRARY__ = 6
-__GLIBC__ = 2
-__GLIBC_MINOR__ = 1
-
-# Included from sys/cdefs.h
-_SYS_CDEFS_H = 1
-def __PMT(args): return args
-
-def __P(args): return args
-
-def __PMT(args): return args
-
-def __P(args): return ()
-
-def __PMT(args): return ()
-
-def __STRING(x): return #x
-
-def __STRING(x): return "x"
-
-def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
-
-def __attribute__(xyz): return
-
-__USE_EXTERN_INLINES = 1
-
-# Included from gnu/stubs.h
-
-# Included from bits/types.h
-_BITS_TYPES_H = 1
-__FD_SETSIZE = 1024
-def __FDELT(d): return ((d) / __NFDBITS)
-
-
-# Included from bits/pthreadtypes.h
-
-# Included from time.h
-_TIME_H = 1
-
-# Included from bits/time.h
-
-# Included from posix/time.h
-
-# Included from posix/types.h
-MAXHOSTNAMELEN = 64
-FD_SETSIZE = 1024
-CLOCKS_PER_SEC = 1000000
-_BITS_TIME_H = 1
-CLOCKS_PER_SEC = 1000000
-CLK_TCK = 100
-_STRUCT_TIMEVAL = 1
-CLK_TCK = CLOCKS_PER_SEC
-__clock_t_defined = 1
-__time_t_defined = 1
-__timespec_defined = 1
-def __isleap(year): return \
-
-__BIT_TYPES_DEFINED__ = 1
-
-# Included from endian.h
-_ENDIAN_H = 1
-__LITTLE_ENDIAN = 1234
-__BIG_ENDIAN = 4321
-__PDP_ENDIAN = 3412
-
-# Included from bits/endian.h
-__BYTE_ORDER = __LITTLE_ENDIAN
-__FLOAT_WORD_ORDER = __BYTE_ORDER
-LITTLE_ENDIAN = __LITTLE_ENDIAN
-BIG_ENDIAN = __BIG_ENDIAN
-PDP_ENDIAN = __PDP_ENDIAN
-BYTE_ORDER = __BYTE_ORDER
-
-# Included from sys/select.h
-_SYS_SELECT_H = 1
-
-# Included from bits/select.h
-def __FD_ZERO(fdsp): return \
-
-def __FD_ZERO(set): return \
-
-
-# Included from bits/sigset.h
-_SIGSET_H_types = 1
-_SIGSET_H_fns = 1
-def __sigmask(sig): return \
-
-def __sigemptyset(set): return \
-
-def __sigfillset(set): return \
-
-def __sigisemptyset(set): return \
-
-FD_SETSIZE = __FD_SETSIZE
-def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp)
-
-
-# Included from sys/sysmacros.h
-_SYS_SYSMACROS_H = 1
-def major(dev): return ( (( (dev) >> 8) & 0xff))
-
-def minor(dev): return ( ((dev) & 0xff))
diff --git a/Lib/plat-atheos/regen b/Lib/plat-atheos/regen
deleted file mode 100644
index 7c002c3674..0000000000
--- a/Lib/plat-atheos/regen
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-set -v
-python$EXE ../../Tools/scripts/h2py.py -i '\(u_long\)' -i '\(uint32_t\)' -i '\(int\)' -i '\(unsigned int\)' /include/netinet/in.h /include/sys/types.h
diff --git a/Lib/platform.py b/Lib/platform.py
index 5ad1012fba..967491a827 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
""" This module tries to retrieve as much platform-identifying data as
possible. It makes this information available via function APIs.
@@ -32,6 +32,7 @@
#
# <see CVS and SVN checkin messages for history>
#
+# 1.0.7 - added DEV_NULL
# 1.0.6 - added linux_distribution()
# 1.0.5 - fixed Java support to allow running the module on Jython
# 1.0.4 - added IronPython support
@@ -108,10 +109,25 @@ __copyright__ = """
"""
-__version__ = '1.0.6'
+__version__ = '1.0.7'
import sys, os, re
+### Globals & Constants
+
+# Determine the platform's /dev/null device
+try:
+ DEV_NULL = os.devnull
+except AttributeError:
+ # os.devnull was added in Python 2.4, so emulate it for earlier
+ # Python versions
+ if sys.platform in ('dos','win32','win16','os2'):
+ # Use the old CP/M NUL as device name
+ DEV_NULL = 'NUL'
+ else:
+ # Standard Unix uses /dev/null
+ DEV_NULL = '/dev/null'
+
### Platform specific APIs
_libc_search = re.compile(r'(__libc_init)'
@@ -184,9 +200,8 @@ def _dist_try_harder(distname,version,id):
"""
if os.path.exists('/var/adm/inst-log/info'):
# SuSE Linux stores distribution information in that file
- info = open('/var/adm/inst-log/info').readlines()
distname = 'SuSE'
- for line in info:
+ for line in open('/var/adm/inst-log/info'):
tv = line.split()
if len(tv) == 2:
tag,value = tv
@@ -201,8 +216,7 @@ def _dist_try_harder(distname,version,id):
if os.path.exists('/etc/.installed'):
# Caldera OpenLinux has some infos in that file (thanks to Colin Kong)
- info = open('/etc/.installed').readlines()
- for line in info:
+ for line in open('/etc/.installed'):
pkg = line.split('-')
if len(pkg) >= 2 and pkg[0] == 'OpenLinux':
# XXX does Caldera support non Intel platforms ? If yes,
@@ -311,9 +325,8 @@ def linux_distribution(distname='', version='', id='',
return _dist_try_harder(distname,version,id)
# Read the first line
- f = open('/etc/'+file, 'r')
- firstline = f.readline()
- f.close()
+ with open('/etc/'+file, 'r') as f:
+ firstline = f.readline()
_distname, _version, _id = _parse_release_file(firstline)
if _distname and full_distribution_name:
@@ -450,7 +463,16 @@ def _norm_version(version, build=''):
_ver_output = re.compile(r'(?:([\w ]+) ([\w.]+) '
'.*'
- 'Version ([\d.]+))', re.ASCII)
+ '\[.* ([\d.]+)\])')
+
+# Examples of VER command output:
+#
+# Windows 2000: Microsoft Windows 2000 [Version 5.00.2195]
+# Windows XP: Microsoft Windows XP [Version 5.1.2600]
+# Windows Vista: Microsoft Windows [Version 6.0.6002]
+#
+# Note that the "Version" string gets localized on different
+# Windows versions.
def _syscmd_ver(system='', release='', version='',
@@ -589,6 +611,7 @@ def win32_ver(release='',version='',csd='',ptype=''):
else:
if csd[:13] == 'Service Pack ':
csd = 'SP' + csd[13:]
+
if plat == VER_PLATFORM_WIN32_WINDOWS:
regkey = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion'
# Try to guess the release name
@@ -603,6 +626,7 @@ def win32_ver(release='',version='',csd='',ptype=''):
release = 'postMe'
elif maj == 5:
release = '2000'
+
elif plat == VER_PLATFORM_WIN32_NT:
regkey = 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'
if maj <= 4:
@@ -646,6 +670,7 @@ def win32_ver(release='',version='',csd='',ptype=''):
release = '2008ServerR2'
else:
release = 'post2008Server'
+
else:
if not release:
# E.g. Win3.1 with win32s
@@ -947,7 +972,7 @@ def _syscmd_uname(option,default=''):
# XXX Others too ?
return default
try:
- f = os.popen('uname %s 2> /dev/null' % option)
+ f = os.popen('uname %s 2> %s' % (option, DEV_NULL))
except (AttributeError,os.error):
return default
output = f.read().strip()
@@ -962,17 +987,16 @@ def _syscmd_file(target,default=''):
""" Interface to the system's file command.
The function uses the -b option of the file command to have it
- ommit the filename in its output and if possible the -L option
- to have the command follow symlinks. It returns default in
- case the command should fail.
+ omit the filename in its output. Follow the symlinks. It returns
+ default in case the command should fail.
"""
if sys.platform in ('dos','win32','win16','os2'):
# XXX Others too ?
return default
- target = _follow_symlinks(target)
+ target = _follow_symlinks(target).replace('"', '\\"')
try:
- f = os.popen('file "%s" 2> /dev/null' % target)
+ f = os.popen('file -b "%s" 2> %s' % (target, DEV_NULL))
except (AttributeError,os.error):
return default
output = f.read().strip()
@@ -992,8 +1016,6 @@ _default_architecture = {
'dos': ('','MSDOS'),
}
-_architecture_split = re.compile(r'[\s,]').split
-
def architecture(executable=sys.executable,bits='',linkage=''):
""" Queries the given executable (defaults to the Python interpreter
@@ -1028,11 +1050,11 @@ def architecture(executable=sys.executable,bits='',linkage=''):
# Get data from the 'file' system command
if executable:
- output = _syscmd_file(executable, '')
+ fileout = _syscmd_file(executable, '')
else:
- output = ''
+ fileout = ''
- if not output and \
+ if not fileout and \
executable == sys.executable:
# "file" command did not return anything; we'll try to provide
# some sensible defaults then...
@@ -1044,9 +1066,6 @@ def architecture(executable=sys.executable,bits='',linkage=''):
linkage = l
return bits,linkage
- # Split the output into a list of strings omitting the filename
- fileout = _architecture_split(output)[1:]
-
if 'executable' not in fileout:
# Format not supported
return bits,linkage
@@ -1131,7 +1150,11 @@ def uname():
# http://support.microsoft.com/kb/888731 and
# http://www.geocities.com/rick_lively/MANUALS/ENV/MSWIN/PROCESSI.HTM
if not machine:
- machine = os.environ.get('PROCESSOR_ARCHITECTURE', '')
+ # WOW64 processes mask the native architecture
+ if "PROCESSOR_ARCHITEW6432" in os.environ:
+ machine = os.environ.get("PROCESSOR_ARCHITEW6432", '')
+ else:
+ machine = os.environ.get('PROCESSOR_ARCHITECTURE', '')
if not processor:
processor = os.environ.get('PROCESSOR_IDENTIFIER', machine)
@@ -1171,10 +1194,6 @@ def uname():
if not version:
version = vendor
- elif os.name == 'mac':
- release,(version,stage,nonrel),machine = mac_ver()
- system = 'MacOS'
-
# System specific extensions
if system == 'OpenVMS':
# OpenVMS seems to have release and version mixed up
diff --git a/Lib/plistlib.py b/Lib/plistlib.py
index fbba791ce5..82d456aec0 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -186,7 +186,7 @@ def _escape(text):
PLISTHEADER = b"""\
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
"""
class PlistWriter(DumbXMLWriter):
diff --git a/Lib/poplib.py b/Lib/poplib.py
index 1a529d0a13..84ea88de46 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -331,16 +331,26 @@ else:
See the methods of the parent class POP3 for more documentation.
"""
- def __init__(self, host, port=POP3_SSL_PORT,
- keyfile=None, certfile=None,
- timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
+ def __init__(self, host, port=POP3_SSL_PORT, keyfile=None, certfile=None,
+ timeout=socket._GLOBAL_DEFAULT_TIMEOUT, context=None):
+ if context is not None and keyfile is not None:
+ raise ValueError("context and keyfile arguments are mutually "
+ "exclusive")
+ if context is not None and certfile is not None:
+ raise ValueError("context and certfile arguments are mutually "
+ "exclusive")
self.keyfile = keyfile
self.certfile = certfile
+ self.context = context
POP3.__init__(self, host, port, timeout)
def _create_socket(self, timeout):
sock = POP3._create_socket(self, timeout)
- return ssl.wrap_socket(sock, self.keyfile, self.certfile)
+ if self.context is not None:
+ sock = self.context.wrap_socket(sock)
+ else:
+ sock = ssl.wrap_socket(sock, self.keyfile, self.certfile)
+ return sock
__all__.append("POP3_SSL")
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 64fe9dfc5d..c9829e18d0 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -49,6 +49,9 @@ def _get_sep(path):
def normcase(s):
"""Normalize case of pathname. Has no effect under Posix"""
# TODO: on Mac OS X, this should really return s.lower().
+ if not isinstance(s, (bytes, str)):
+ raise TypeError("normcase() argument must be str or bytes, "
+ "not '{}'".format(s.__class__.__name__))
return s
@@ -158,7 +161,7 @@ def islink(path):
def lexists(path):
"""Test whether a path exists. Returns True for broken symbolic links"""
try:
- st = os.lstat(path)
+ os.lstat(path)
except os.error:
return False
return True
@@ -259,7 +262,7 @@ def expanduser(path):
return path
userhome = pwent.pw_dir
if isinstance(path, bytes):
- userhome = userhome.encode(sys.getfilesystemencoding())
+ userhome = os.fsencode(userhome)
root = b'/'
else:
root = '/'
@@ -424,7 +427,7 @@ def _resolve_link(path):
path = normpath(resolved)
return path
-supports_unicode_filenames = False
+supports_unicode_filenames = (sys.platform == 'darwin')
def relpath(path, start=None):
"""Return a relative version of a path"""
diff --git a/Lib/pprint.py b/Lib/pprint.py
index b3a644649e..b8417f5922 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -35,7 +35,7 @@ saferepr()
"""
import sys as _sys
-
+from collections import OrderedDict as _OrderedDict
from io import StringIO as _StringIO
__all__ = ["pprint","pformat","isreadable","isrecursive","saferepr",
@@ -163,7 +163,7 @@ class PrettyPrinter:
if sepLines:
r = getattr(typ, "__repr__", None)
- if issubclass(typ, dict) and r is dict.__repr__:
+ if issubclass(typ, dict):
write('{')
if self._indent_per_level > 1:
write((self._indent_per_level - 1) * ' ')
@@ -171,7 +171,10 @@ class PrettyPrinter:
if length:
context[objid] = 1
indent = indent + self._indent_per_level
- items = sorted(object.items(), key=_safe_tuple)
+ if issubclass(typ, _OrderedDict):
+ items = list(object.items())
+ else:
+ items = sorted(object.items(), key=_safe_tuple)
key, ent = items[0]
rep = self._repr(key, context, level)
write(rep)
diff --git a/Lib/profile.py b/Lib/profile.py
index 3b239d14bf..d6511b7124 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
#
# Class for profiling python code. rev 1.0 6/2/94
#
@@ -39,7 +39,7 @@ import time
import marshal
from optparse import OptionParser
-__all__ = ["run", "runctx", "help", "Profile"]
+__all__ = ["run", "runctx", "Profile"]
# Sample timer for use with
#i_count = 0
@@ -92,16 +92,6 @@ def runctx(statement, globals, locals, filename=None, sort=-1):
else:
return prof.print_stats(sort)
-# Backwards compatibility.
-def help():
- print("Documentation for the profile module can be found ")
- print("in the Python Library Reference, section 'The Python Profiler'.")
-
-if os.name == "mac":
- import MacOS
- def _get_time_mac(timer=MacOS.GetTicks):
- return timer() / 60.0
-
if hasattr(os, "times"):
def _get_time_times(timer=os.times):
t = timer()
@@ -178,10 +168,6 @@ class Profile:
self.timer = resgetrusage
self.dispatcher = self.trace_dispatch
self.get_time = _get_time_resource
- elif os.name == 'mac':
- self.timer = MacOS.GetTicks
- self.dispatcher = self.trace_dispatch_mac
- self.get_time = _get_time_mac
elif hasattr(time, 'clock'):
self.timer = self.get_time = time.clock
self.dispatcher = self.trace_dispatch_i
@@ -588,8 +574,6 @@ class Profile:
return mean
#****************************************************************************
-def Stats(*args):
- print('Report generating functions are in the "pstats" module\a')
def main():
usage = "profile.py [-o output_file_path] [-s sort] scriptfile [arg] ..."
diff --git a/Lib/pstats.py b/Lib/pstats.py
index 566272dcae..f5c592b81b 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -37,6 +37,7 @@ import os
import time
import marshal
import re
+from functools import cmp_to_key
__all__ = ["Stats"]
@@ -70,20 +71,8 @@ class Stats:
print_stats(5).print_callers(5)
"""
- def __init__(self, *args, **kwds):
- # I can't figure out how to explicitly specify a stream keyword arg
- # with *args:
- # def __init__(self, *args, stream=sys.stdout): ...
- # so I use **kwds and sqauwk if something unexpected is passed in.
- self.stream = sys.stdout
- if "stream" in kwds:
- self.stream = kwds["stream"]
- del kwds["stream"]
- if kwds:
- keys = kwds.keys()
- keys.sort()
- extras = ", ".join(["%s=%s" % (k, kwds[k]) for k in keys])
- raise ValueError("unrecognized keyword args: %s" % extras)
+ def __init__(self, *args, stream=None):
+ self.stream = stream or sys.stdout
if not len(args):
arg = None
else:
@@ -100,22 +89,21 @@ class Stats:
self.total_calls = 0
self.prim_calls = 0
self.max_name_len = 0
- self.top_level = {}
+ self.top_level = set()
self.stats = {}
self.sort_arg_dict = {}
self.load_stats(arg)
- trouble = 1
try:
self.get_top_level_stats()
- trouble = 0
- finally:
- if trouble:
- print("Invalid timing data", end=' ', file=self.stream)
- if self.files: print(self.files[-1], end=' ', file=self.stream)
- print(file=self.stream)
+ except Exception:
+ print("Invalid timing data %s" %
+ (self.files[-1] if self.files else ''), file=self.stream)
+ raise
def load_stats(self, arg):
- if not arg: self.stats = {}
+ if arg is None:
+ self.stats = {}
+ return
elif isinstance(arg, str):
f = open(arg, 'rb')
self.stats = marshal.load(f)
@@ -125,13 +113,13 @@ class Stats:
arg = time.ctime(file_stats.st_mtime) + " " + arg
except: # in case this is not unix
pass
- self.files = [ arg ]
+ self.files = [arg]
elif hasattr(arg, 'create_stats'):
arg.create_stats()
self.stats = arg.stats
arg.stats = {}
if not self.stats:
- raise TypeError("Cannot create or construct a %r object from '%r''"
+ raise TypeError("Cannot create or construct a %r object from %r"
% (self.__class__, arg))
return
@@ -141,34 +129,34 @@ class Stats:
self.prim_calls += cc
self.total_tt += tt
if ("jprofile", 0, "profiler") in callers:
- self.top_level[func] = None
+ self.top_level.add(func)
if len(func_std_string(func)) > self.max_name_len:
self.max_name_len = len(func_std_string(func))
def add(self, *arg_list):
- if not arg_list: return self
- if len(arg_list) > 1: self.add(*arg_list[1:])
- other = arg_list[0]
- if type(self) != type(other):
- other = Stats(other)
- self.files += other.files
- self.total_calls += other.total_calls
- self.prim_calls += other.prim_calls
- self.total_tt += other.total_tt
- for func in other.top_level:
- self.top_level[func] = None
-
- if self.max_name_len < other.max_name_len:
- self.max_name_len = other.max_name_len
-
- self.fcn_list = None
-
- for func, stat in other.stats.items():
- if func in self.stats:
- old_func_stat = self.stats[func]
- else:
- old_func_stat = (0, 0, 0, 0, {},)
- self.stats[func] = add_func_stats(old_func_stat, stat)
+ if not arg_list:
+ return self
+ for item in reversed(arg_list):
+ if type(self) != type(item):
+ item = Stats(item)
+ self.files += item.files
+ self.total_calls += item.total_calls
+ self.prim_calls += item.prim_calls
+ self.total_tt += item.total_tt
+ for func in item.top_level:
+ self.top_level.add(func)
+
+ if self.max_name_len < item.max_name_len:
+ self.max_name_len = item.max_name_len
+
+ self.fcn_list = None
+
+ for func, stat in item.stats.items():
+ if func in self.stats:
+ old_func_stat = self.stats[func]
+ else:
+ old_func_stat = (0, 0, 0, 0, {},)
+ self.stats[func] = add_func_stats(old_func_stat, stat)
return self
def dump_stats(self, filename):
@@ -238,7 +226,7 @@ class Stats:
stats_list.append((cc, nc, tt, ct) + func +
(func_std_string(func), func))
- stats_list.sort(key=CmpToKey(TupleComp(sort_tuple).compare))
+ stats_list.sort(key=cmp_to_key(TupleComp(sort_tuple).compare))
self.fcn_list = fcn_list = []
for tuple in stats_list:
@@ -269,9 +257,9 @@ class Stats:
else:
newstats[newfunc] = (cc, nc, tt, ct, newcallers)
old_top = self.top_level
- self.top_level = new_top = {}
+ self.top_level = new_top = set()
for func in old_top:
- new_top[func_strip_path(func)] = None
+ new_top.add(func_strip_path(func))
self.max_name_len = max_name_len
@@ -280,7 +268,8 @@ class Stats:
return self
def calc_callees(self):
- if self.all_callees: return
+ if self.all_callees:
+ return
self.all_callees = all_callees = {}
for func, (cc, nc, tt, ct, callers) in self.stats.items():
if not func in all_callees:
@@ -350,7 +339,8 @@ class Stats:
def print_stats(self, *amount):
for filename in self.files:
print(filename, file=self.stream)
- if self.files: print(file=self.stream)
+ if self.files:
+ print(file=self.stream)
indent = ' ' * 8
for func in self.top_level:
print(indent, func_get_function_name(func), file=self.stream)
@@ -436,7 +426,7 @@ class Stats:
print(' ncalls tottime percall cumtime percall', end=' ', file=self.stream)
print('filename:lineno(function)', file=self.stream)
- def print_line(self, func): # hack : should print percentages
+ def print_line(self, func): # hack: should print percentages
cc, nc, tt, ct, callers = self.stats[func]
c = str(nc)
if nc != cc:
@@ -475,15 +465,6 @@ class TupleComp:
return direction
return 0
-def CmpToKey(mycmp):
- 'Convert a cmp= function into a key= function'
- class K(object):
- def __init__(self, obj):
- self.obj = obj
- def __lt__(self, other):
- return mycmp(self.obj, other.obj) == -1
- return K
-
#**************************************************************************
# func_name is a triple (file:string, line:int, name:string)
@@ -670,7 +651,7 @@ if __name__ == '__main__':
print("No statistics object is loaded.", file=self.stream)
return
abbrevs = self.stats.get_sort_arg_defs()
- if line and not filter(lambda x,a=abbrevs: x not in a,line.split()):
+ if line and all((x in abbrevs) for x in line.split()):
self.stats.sort_stats(*line.split())
else:
print("Valid sort keys (unique prefixes are accepted):", file=self.stream)
diff --git a/Lib/py_compile.py b/Lib/py_compile.py
index cce5ac145a..e0f98cb741 100644
--- a/Lib/py_compile.py
+++ b/Lib/py_compile.py
@@ -4,11 +4,12 @@ This module has intimate knowledge of the format of .pyc files.
"""
import builtins
+import errno
import imp
import marshal
import os
-import re
import sys
+import tokenize
import traceback
MAGIC = imp.get_magic()
@@ -37,16 +38,18 @@ class PyCompileError(Exception):
can be accesses as class variable 'file'
msg: string message to be written as error message
- If no value is given, a default exception message will be given,
- consistent with 'standard' py_compile output.
- message (or default) can be accesses as class variable 'msg'
+ If no value is given, a default exception message will be
+ given, consistent with 'standard' py_compile output.
+ message (or default) can be accesses as class variable
+ 'msg'
"""
def __init__(self, exc_type, exc_value, file, msg=''):
exc_type_name = exc_type.__name__
if exc_type is SyntaxError:
- tbtext = ''.join(traceback.format_exception_only(exc_type, exc_value))
+ tbtext = ''.join(traceback.format_exception_only(
+ exc_type, exc_value))
errmsg = tbtext.replace('File "<string>"', 'File "%s"' % file)
else:
errmsg = "Sorry: %s: %s" % (exc_type_name,exc_value)
@@ -62,54 +65,32 @@ class PyCompileError(Exception):
return self.msg
-# Define an internal helper according to the platform
-if os.name == "mac":
- import MacOS
- def set_creator_type(file):
- MacOS.SetCreatorAndType(file, 'Pyth', 'PYC ')
-else:
- def set_creator_type(file):
- pass
-
def wr_long(f, x):
"""Internal; write a 32-bit int to a file in little-endian order."""
- f.write(bytes([x & 0xff,
+ f.write(bytes([x & 0xff,
(x >> 8) & 0xff,
(x >> 16) & 0xff,
(x >> 24) & 0xff]))
-def read_encoding(file, default):
- """Read the first two lines of the file looking for coding: xyzzy."""
- f = open(file, "rb")
- try:
- for i in range(2):
- line = f.readline()
- if not line:
- break
- m = re.match(br".*\bcoding:\s*(\S+)\b", line)
- if m:
- return m.group(1).decode("ascii")
- return default
- finally:
- f.close()
-
-def compile(file, cfile=None, dfile=None, doraise=False):
+def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1):
"""Byte-compile one Python source file to Python bytecode.
- Arguments:
-
- file: source filename
- cfile: target filename; defaults to source with 'c' or 'o' appended
- ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo)
- dfile: purported filename; defaults to source (this is the filename
- that will show up in error messages)
- doraise: flag indicating whether or not an exception should be
- raised when a compile error is found. If an exception
- occurs and this flag is set to False, a string
- indicating the nature of the exception will be printed,
- and the function will return to the caller. If an
- exception occurs and this flag is set to True, a
- PyCompileError exception will be raised.
+ :param file: The source file name.
+ :param cfile: The target byte compiled file name. When not given, this
+ defaults to the PEP 3147 location.
+ :param dfile: Purported file name, i.e. the file name that shows up in
+ error messages. Defaults to the source file name.
+ :param doraise: Flag indicating whether or not an exception should be
+ raised when a compile error is found. If an exception occurs and this
+ flag is set to False, a string indicating the nature of the exception
+ will be printed, and the function will return to the caller. If an
+ exception occurs and this flag is set to True, a PyCompileError
+ exception will be raised.
+ :param optimize: The optimization level for the compiler. Valid values
+ are -1, 0, 1 and 2. A value of -1 means to use the optimization
+ level of the current interpreter, as given by -O command line options.
+
+ :return: Path to the resulting byte compiled file.
Note that it isn't necessary to byte-compile Python modules for
execution efficiency -- Python itself byte-compiles a module when
@@ -126,20 +107,16 @@ def compile(file, cfile=None, dfile=None, doraise=False):
See compileall.py for a script/module that uses this module to
byte-compile all installed files (or all files in selected
directories).
-
"""
- encoding = read_encoding(file, "utf-8")
- f = open(file, 'U', encoding=encoding)
- try:
- timestamp = int(os.fstat(f.fileno()).st_mtime)
- except AttributeError:
- timestamp = int(os.stat(file).st_mtime)
- codestring = f.read()
- f.close()
- if codestring and codestring[-1] != '\n':
- codestring = codestring + '\n'
+ with tokenize.open(file) as f:
+ try:
+ timestamp = int(os.fstat(f.fileno()).st_mtime)
+ except AttributeError:
+ timestamp = int(os.stat(file).st_mtime)
+ codestring = f.read()
try:
- codeobject = builtins.compile(codestring, dfile or file,'exec')
+ codeobject = builtins.compile(codestring, dfile or file, 'exec',
+ optimize=optimize)
except Exception as err:
py_exc = PyCompileError(err.__class__, err, dfile or file)
if doraise:
@@ -148,16 +125,23 @@ def compile(file, cfile=None, dfile=None, doraise=False):
sys.stderr.write(py_exc.msg + '\n')
return
if cfile is None:
- cfile = file + (__debug__ and 'c' or 'o')
- fc = open(cfile, 'wb')
- fc.write(b'\0\0\0\0')
- wr_long(fc, timestamp)
- marshal.dump(codeobject, fc)
- fc.flush()
- fc.seek(0, 0)
- fc.write(MAGIC)
- fc.close()
- set_creator_type(cfile)
+ if optimize >= 0:
+ cfile = imp.cache_from_source(file, debug_override=not optimize)
+ else:
+ cfile = imp.cache_from_source(file)
+ try:
+ os.makedirs(os.path.dirname(cfile))
+ except OSError as error:
+ if error.errno != errno.EEXIST:
+ raise
+ with open(cfile, 'wb') as fc:
+ fc.write(b'\0\0\0\0')
+ wr_long(fc, timestamp)
+ marshal.dump(codeobject, fc)
+ fc.flush()
+ fc.seek(0, 0)
+ fc.write(MAGIC)
+ return cfile
def main(args=None):
"""Compile several source files.
@@ -166,19 +150,35 @@ def main(args=None):
not specified) are compiled and the resulting bytecode is cached
in the normal manner. This function does not search a directory
structure to locate source files; it only compiles files named
- explicitly.
+ explicitly. If '-' is the only parameter in args, the list of
+ files is taken from standard input.
"""
if args is None:
args = sys.argv[1:]
rv = 0
- for filename in args:
- try:
- compile(filename, doraise=True)
- except PyCompileError as err:
- # return value to indicate at least one failure
- rv = 1
- sys.stderr.write(err.msg)
+ if args == ['-']:
+ while True:
+ filename = sys.stdin.readline()
+ if not filename:
+ break
+ filename = filename.rstrip('\n')
+ try:
+ compile(filename, doraise=True)
+ except PyCompileError as error:
+ rv = 1
+ sys.stderr.write("%s\n" % error.msg)
+ except IOError as error:
+ rv = 1
+ sys.stderr.write("%s\n" % error)
+ else:
+ for filename in args:
+ try:
+ compile(filename, doraise=True)
+ except PyCompileError as error:
+ # return value to indicate at least one failure
+ rv = 1
+ sys.stderr.write(error.msg)
return rv
if __name__ == "__main__":
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 8cc1abd26a..2391013ed6 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1,5 +1,4 @@
-#!/usr/bin/env python
-# -*- coding: latin-1 -*-
+#!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
@@ -16,11 +15,17 @@ backslash on Windows) it is treated as the path to a Python source file.
Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.
-Run "pydoc -p <port>" to start an HTTP server on a given port on the
-local machine to generate documentation web pages.
+Run "pydoc -p <port>" to start an HTTP server on the given port on the
+local machine. Port number 0 can be used to get an arbitrary unused port.
+
+Run "pydoc -b" to start an HTTP server on an arbitrary unused port and
+open a Web browser to interactively browse documentation. The -p option
+can be used with the -b option to explicitly specify the server port.
For platforms without a command line, "pydoc -g" starts the HTTP server
-and also pops up a little window for controlling it.
+and also pops up a little window for controlling it. This option is
+deprecated, since the server can now be controlled directly from HTTP
+clients.
Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".
@@ -52,10 +57,22 @@ Richard Chamberlain, for the first implementation of textdoc.
# the current directory is changed with os.chdir(), an incorrect
# path will be displayed.
-import sys, imp, os, re, inspect, builtins, pkgutil
-from reprlib import Repr
-from traceback import extract_tb as _extract_tb
+import os
+import sys
+import builtins
+import imp
+import io
+import inspect
+import pkgutil
+import platform
+import re
+import time
+import warnings
from collections import deque
+from reprlib import Repr
+from traceback import extract_tb, format_exception_only
+
+
# --------------------------------------------------------- common routines
def pathdirs():
@@ -148,15 +165,19 @@ def _split_list(s, predicate):
no.append(x)
return yes, no
-def visiblename(name, all=None):
+def visiblename(name, all=None, obj=None):
"""Decide whether to show documentation on a variable."""
# Certain special names are redundant.
_hidden_names = ('__builtins__', '__doc__', '__file__', '__path__',
'__module__', '__name__', '__slots__', '__package__',
- '__author__', '__credits__', '__date__', '__version__')
+ '__cached__', '__author__', '__credits__', '__date__',
+ '__version__')
if name in _hidden_names: return 0
# Private names are hidden, but special names are displayed.
if name.startswith('__') and name.endswith('__'): return 1
+ # Namedtuples have public fields and methods with a single leading underscore
+ if name.startswith('_') and hasattr(obj, '_fields'):
+ return True
if all is not None:
# only document that which the programmer exported in __all__
return name in all
@@ -285,7 +306,7 @@ def safeimport(path, forceload=0, cache={}):
elif exc is SyntaxError:
# A SyntaxError occurred before we could execute the module.
raise ErrorDuringImport(value.filename, info)
- elif exc is ImportError and _extract_tb(tb)[-1][2]=='safeimport':
+ elif exc is ImportError and extract_tb(tb)[-1][2]=='safeimport':
# The import error occurred directly in this function,
# which means there is no such module in the path.
return None
@@ -513,6 +534,10 @@ class HTMLDoc(Doc):
text = name
return '<a href="%s">%s</a>' % (url, text)
+ def filelink(self, url, path):
+ """Make a link to source file."""
+ return '<a href="file:%s">%s</a>' % (url, path)
+
def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
"""Mark up some plain text, given a context of symbols to look for.
Each context dictionary maps object names to anchor names."""
@@ -591,7 +616,7 @@ class HTMLDoc(Doc):
if sys.platform == 'win32':
import nturl2path
url = nturl2path.pathname2url(path)
- filelink = '<a href="file:%s">%s</a>' % (url, path)
+ filelink = self.filelink(url, path)
except TypeError:
filelink = '(built-in)'
info = []
@@ -620,7 +645,7 @@ class HTMLDoc(Doc):
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None or
(inspect.getmodule(value) or object) is object):
- if visiblename(key, all):
+ if visiblename(key, all, object):
classes.append((key, value))
cdict[key] = cdict[value] = '#' + key
for key, value in classes:
@@ -636,13 +661,13 @@ class HTMLDoc(Doc):
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None or
inspect.isbuiltin(value) or inspect.getmodule(value) is object):
- if visiblename(key, all):
+ if visiblename(key, all, object):
funcs.append((key, value))
fdict[key] = '#-' + key
if inspect.isfunction(value): fdict[value] = fdict[key]
data = []
for key, value in inspect.getmembers(object, isdata):
- if visiblename(key, all):
+ if visiblename(key, all, object):
data.append((key, value))
doc = self.markup(getdoc(object), self.preformat, fdict, cdict)
@@ -767,7 +792,7 @@ class HTMLDoc(Doc):
attrs = [(name, kind, cls, value)
for name, kind, cls, value in classify_class_attrs(object)
- if visiblename(name)]
+ if visiblename(name, obj=object)]
mdict = {}
for key, kind, homecls, value in attrs:
@@ -978,7 +1003,7 @@ class TextDoc(Doc):
def bold(self, text):
"""Format a string in bold by overstriking."""
- return ''.join(map(lambda ch: ch + '\b' + ch, text))
+ return ''.join(ch + '\b' + ch for ch in text)
def indent(self, text, prefix=' '):
"""Indent text by prepending a given prefix to each line."""
@@ -1002,7 +1027,7 @@ class TextDoc(Doc):
c, bases = entry
result = result + prefix + classname(c, modname)
if bases and bases != (parent,):
- parents = map(lambda c, m=modname: classname(c, m), bases)
+ parents = (classname(c, modname) for c in bases)
result = result + '(%s)' % ', '.join(parents)
result = result + '\n'
elif type(entry) is type([]):
@@ -1034,18 +1059,18 @@ doubt, consult the module reference at the location listed above.
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None
or (inspect.getmodule(value) or object) is object):
- if visiblename(key, all):
+ if visiblename(key, all, object):
classes.append((key, value))
funcs = []
for key, value in inspect.getmembers(object, inspect.isroutine):
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None or
inspect.isbuiltin(value) or inspect.getmodule(value) is object):
- if visiblename(key, all):
+ if visiblename(key, all, object):
funcs.append((key, value))
data = []
for key, value in inspect.getmembers(object, isdata):
- if visiblename(key, all):
+ if visiblename(key, all, object):
data.append((key, value))
modpkgs = []
@@ -1184,7 +1209,7 @@ doubt, consult the module reference at the location listed above.
attrs = [(name, kind, cls, value)
for name, kind, cls, value in classify_class_attrs(object)
- if visiblename(name)]
+ if visiblename(name, obj=object)]
while attrs:
if mro:
@@ -1310,6 +1335,11 @@ doubt, consult the module reference at the location listed above.
line += '\n' + self.indent(str(doc))
return line
+class _PlainTextDoc(TextDoc):
+ """Subclass of TextDoc which overrides string styling"""
+ def bold(self, text):
+ return text
+
# --------------------------------------------------------- user interfaces
def pager(text):
@@ -1464,6 +1494,7 @@ def locate(path, forceload=0):
# --------------------------------------- interactive interpreter interface
text = TextDoc()
+plaintext = _PlainTextDoc()
html = HTMLDoc()
def resolve(thing, forceload=0):
@@ -1476,8 +1507,11 @@ def resolve(thing, forceload=0):
else:
return thing, getattr(thing, '__name__', None)
-def render_doc(thing, title='Python Library Documentation: %s', forceload=0):
+def render_doc(thing, title='Python Library Documentation: %s', forceload=0,
+ renderer=None):
"""Render text documentation, given an object or a path to an object."""
+ if renderer is None:
+ renderer = text
object, name = resolve(thing, forceload)
desc = describe(object)
module = inspect.getmodule(object)
@@ -1496,12 +1530,16 @@ def render_doc(thing, title='Python Library Documentation: %s', forceload=0):
# document its available methods instead of its value.
object = type(object)
desc += ' object'
- return title % desc + '\n\n' + text.document(object, name)
+ return title % desc + '\n\n' + renderer.document(object, name)
-def doc(thing, title='Python Library Documentation: %s', forceload=0):
+def doc(thing, title='Python Library Documentation: %s', forceload=0,
+ output=None):
"""Display text documentation, given an object or a path to an object."""
try:
- pager(render_doc(thing, title, forceload))
+ if output is None:
+ pager(render_doc(thing, title, forceload))
+ else:
+ output.write(render_doc(thing, title, forceload, plaintext))
except (ImportError, ErrorDuringImport) as value:
print(value)
@@ -1761,9 +1799,9 @@ has the same effect as typing a particular string at the help> prompt.
doc(eval(request), 'Help on %s:')
elif request in self.keywords: self.showtopic(request)
elif request in self.topics: self.showtopic(request)
- elif request: doc(request, 'Help on %s:')
+ elif request: doc(request, 'Help on %s:', output=self._output)
elif isinstance(request, Helper): self()
- else: doc(request, 'Help on %s:')
+ else: doc(request, 'Help on %s:', output=self._output)
self.output.write('\n')
def intro(self):
@@ -1844,12 +1882,39 @@ module "pydoc_data.topics" could not be found.
if more_xrefs:
xrefs = (xrefs or '') + ' ' + more_xrefs
if xrefs:
- import io, formatter
+ import formatter
buffer = io.StringIO()
formatter.DumbWriter(buffer).send_flowing_data(
'Related help topics: ' + ', '.join(xrefs.split()) + '\n')
self.output.write('\n%s\n' % buffer.getvalue())
+ def _gettopic(self, topic, more_xrefs=''):
+ """Return unbuffered tuple of (topic, xrefs).
+
+ If an error occurs here, the exception is caught and displayed by
+ the url handler.
+
+ This function duplicates the showtopic method but returns its
+ result directly so it can be formatted for display in an html page.
+ """
+ try:
+ import pydoc_data.topics
+ except ImportError:
+ return('''
+Sorry, topic and keyword documentation is not available because the
+module "pydoc_data.topics" could not be found.
+''' , '')
+ target = self.topics.get(topic, self.keywords.get(topic))
+ if not target:
+ raise ValueError('could not find topic')
+ if isinstance(target, str):
+ return self._gettopic(target, more_xrefs)
+ label, xrefs = target
+ doc = pydoc_data.topics.topics[label]
+ if more_xrefs:
+ xrefs = (xrefs or '') + ' ' + more_xrefs
+ return doc, xrefs
+
def showsymbol(self, symbol):
target = self.symbols[symbol]
topic, _, xrefs = target.partition(' ')
@@ -1931,6 +1996,15 @@ class ModuleScanner:
for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
if self.quit:
break
+
+ # XXX Skipping this file is a workaround for a bug
+ # that causes python to crash with a segfault.
+ # http://bugs.python.org/issue9319
+ #
+ # TODO Remove this once the bug is fixed.
+ if modname in {'test.badsyntax_pep3120', 'badsyntax_pep3120'}:
+ continue
+
if key is None:
callback(None, modname, '')
else:
@@ -1946,7 +2020,6 @@ class ModuleScanner:
if onerror:
onerror(modname)
continue
- import io
desc = source_synopsis(io.StringIO(source)) or ''
if hasattr(loader, 'get_filename'):
path = loader.get_filename(modname)
@@ -1976,16 +2049,18 @@ def apropos(key):
print(modname, desc and '- ' + desc)
def onerror(modname):
pass
- try: import warnings
- except ImportError: pass
- else: warnings.filterwarnings('ignore') # ignore problems during import
- ModuleScanner().run(callback, key, onerror=onerror)
+ with warnings.catch_warnings():
+ warnings.filterwarnings('ignore') # ignore problems during import
+ ModuleScanner().run(callback, key, onerror=onerror)
-# --------------------------------------------------- web browser interface
+# --------------------------------------------------- Web browser interface
def serve(port, callback=None, completer=None):
import http.server, email.message, select
+ msg = 'the pydoc.serve() function is deprecated'
+ warnings.warn(msg, DeprecationWarning, stacklevel=2)
+
class DocHandler(http.server.BaseHTTPRequestHandler):
def send_document(self, title, contents):
try:
@@ -2033,8 +2108,8 @@ pydoc</strong> by Ka-Ping Yee &lt;ping@lfw.org&gt;</font>'''
class DocServer(http.server.HTTPServer):
def __init__(self, port, callback):
- host = (sys.platform == 'mac') and '127.0.0.1' or 'localhost'
- self.address = ('', port)
+ host = 'localhost'
+ self.address = (host, port)
self.url = 'http://%s:%d/' % (host, port)
self.callback = callback
self.base.__init__(self, self.address, self.handler)
@@ -2045,6 +2120,7 @@ pydoc</strong> by Ka-Ping Yee &lt;ping@lfw.org&gt;</font>'''
while not self.quit:
rd, wr, ex = select.select([self.socket.fileno()], [], [], 1)
if rd: self.handle_request()
+ self.server_close()
def server_activate(self):
self.base.server_activate(self)
@@ -2064,7 +2140,12 @@ pydoc</strong> by Ka-Ping Yee &lt;ping@lfw.org&gt;</font>'''
# ----------------------------------------------------- graphical interface
def gui():
- """Graphical interface (starts web server and pops up a control window)."""
+ """Graphical interface (starts Web server and pops up a control window)."""
+
+ msg = ('the pydoc.gui() function and "pydoc -g" option are deprecated\n',
+ 'use "pydoc.browse() function and "pydoc -b" option instead.')
+ warnings.warn(msg, DeprecationWarning, stacklevel=2)
+
class GUI:
def __init__(self, window, port=7464):
self.window = window
@@ -2144,19 +2225,8 @@ def gui():
def open(self, event=None, url=None):
url = url or self.server.url
- try:
- import webbrowser
- webbrowser.open(url)
- except ImportError: # pre-webbrowser.py compatibility
- if sys.platform == 'win32':
- os.system('start "%s"' % url)
- elif sys.platform == 'mac':
- try: import ic
- except ImportError: pass
- else: ic.launchurl(url)
- else:
- rc = os.system('netscape -remote "openURL(%s)" &' % url)
- if rc: os.system('netscape "%s" &' % url)
+ import webbrowser
+ webbrowser.open(url)
def quit(self, event=None):
if self.server:
@@ -2248,6 +2318,444 @@ def gui():
except KeyboardInterrupt:
pass
+
+# --------------------------------------- enhanced Web browser interface
+
+def _start_server(urlhandler, port):
+ """Start an HTTP server thread on a specific port.
+
+ Start an HTML/text server thread, so HTML or text documents can be
+ browsed dynamically and interactively with a Web browser. Example use:
+
+ >>> import time
+ >>> import pydoc
+
+ Define a URL handler. To determine what the client is asking
+ for, check the URL and content_type.
+
+ Then get or generate some text or HTML code and return it.
+
+ >>> def my_url_handler(url, content_type):
+ ... text = 'the URL sent was: (%s, %s)' % (url, content_type)
+ ... return text
+
+ Start server thread on port 0.
+ If you use port 0, the server will pick a random port number.
+ You can then use serverthread.port to get the port number.
+
+ >>> port = 0
+ >>> serverthread = pydoc._start_server(my_url_handler, port)
+
+ Check that the server is really started. If it is, open browser
+ and get first page. Use serverthread.url as the starting page.
+
+ >>> if serverthread.serving:
+ ... import webbrowser
+
+ The next two lines are commented out so a browser doesn't open if
+ doctest is run on this module.
+
+ #... webbrowser.open(serverthread.url)
+ #True
+
+ Let the server do its thing. We just need to monitor its status.
+ Use time.sleep so the loop doesn't hog the CPU.
+
+ >>> starttime = time.time()
+ >>> timeout = 1 #seconds
+
+ This is a short timeout for testing purposes.
+
+ >>> while serverthread.serving:
+ ... time.sleep(.01)
+ ... if serverthread.serving and time.time() - starttime > timeout:
+ ... serverthread.stop()
+ ... break
+
+ Print any errors that may have occurred.
+
+ >>> print(serverthread.error)
+ None
+ """
+ import http.server
+ import email.message
+ import select
+ import threading
+
+ class DocHandler(http.server.BaseHTTPRequestHandler):
+
+ def do_GET(self):
+ """Process a request from an HTML browser.
+
+ The URL received is in self.path.
+ Get an HTML page from self.urlhandler and send it.
+ """
+ if self.path.endswith('.css'):
+ content_type = 'text/css'
+ else:
+ content_type = 'text/html'
+ self.send_response(200)
+ self.send_header('Content-Type', '%s; charset=UTF-8' % content_type)
+ self.end_headers()
+ self.wfile.write(self.urlhandler(
+ self.path, content_type).encode('utf-8'))
+
+ def log_message(self, *args):
+ # Don't log messages.
+ pass
+
+ class DocServer(http.server.HTTPServer):
+
+ def __init__(self, port, callback):
+ self.host = (sys.platform == 'mac') and '127.0.0.1' or 'localhost'
+ self.address = ('', port)
+ self.callback = callback
+ self.base.__init__(self, self.address, self.handler)
+ self.quit = False
+
+ def serve_until_quit(self):
+ while not self.quit:
+ rd, wr, ex = select.select([self.socket.fileno()], [], [], 1)
+ if rd:
+ self.handle_request()
+ self.server_close()
+
+ def server_activate(self):
+ self.base.server_activate(self)
+ if self.callback:
+ self.callback(self)
+
+ class ServerThread(threading.Thread):
+
+ def __init__(self, urlhandler, port):
+ self.urlhandler = urlhandler
+ self.port = int(port)
+ threading.Thread.__init__(self)
+ self.serving = False
+ self.error = None
+
+ def run(self):
+ """Start the server."""
+ try:
+ DocServer.base = http.server.HTTPServer
+ DocServer.handler = DocHandler
+ DocHandler.MessageClass = email.message.Message
+ DocHandler.urlhandler = staticmethod(self.urlhandler)
+ docsvr = DocServer(self.port, self.ready)
+ self.docserver = docsvr
+ docsvr.serve_until_quit()
+ except Exception as e:
+ self.error = e
+
+ def ready(self, server):
+ self.serving = True
+ self.host = server.host
+ self.port = server.server_port
+ self.url = 'http://%s:%d/' % (self.host, self.port)
+
+ def stop(self):
+ """Stop the server and this thread nicely"""
+ self.docserver.quit = True
+ self.serving = False
+ self.url = None
+
+ thread = ServerThread(urlhandler, port)
+ thread.start()
+ # Wait until thread.serving is True to make sure we are
+ # really up before returning.
+ while not thread.error and not thread.serving:
+ time.sleep(.01)
+ return thread
+
+
+def _url_handler(url, content_type="text/html"):
+ """The pydoc url handler for use with the pydoc server.
+
+ If the content_type is 'text/css', the _pydoc.css style
+ sheet is read and returned if it exits.
+
+ If the content_type is 'text/html', then the result of
+ get_html_page(url) is returned.
+ """
+ class _HTMLDoc(HTMLDoc):
+
+ def page(self, title, contents):
+ """Format an HTML page."""
+ css_path = "pydoc_data/_pydoc.css"
+ css_link = (
+ '<link rel="stylesheet" type="text/css" href="%s">' %
+ css_path)
+ return '''\
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Pydoc: %s</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+%s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div>
+</body></html>''' % (title, css_link, html_navbar(), contents)
+
+ def filelink(self, url, path):
+ return '<a href="getfile?key=%s">%s</a>' % (url, path)
+
+
+ html = _HTMLDoc()
+
+ def html_navbar():
+ version = html.escape("%s [%s, %s]" % (platform.python_version(),
+ platform.python_build()[0],
+ platform.python_compiler()))
+ return """
+ <div style='float:left'>
+ Python %s<br>%s
+ </div>
+ <div style='float:right'>
+ <div style='text-align:center'>
+ <a href="index.html">Module Index</a>
+ : <a href="topics.html">Topics</a>
+ : <a href="keywords.html">Keywords</a>
+ </div>
+ <div>
+ <form action="get" style='display:inline;'>
+ <input type=text name=key size=15>
+ <input type=submit value="Get">
+ </form>&nbsp;
+ <form action="search" style='display:inline;'>
+ <input type=text name=key size=15>
+ <input type=submit value="Search">
+ </form>
+ </div>
+ </div>
+ """ % (version, html.escape(platform.platform(terse=True)))
+
+ def html_index():
+ """Module Index page."""
+
+ def bltinlink(name):
+ return '<a href="%s.html">%s</a>' % (name, name)
+
+ heading = html.heading(
+ '<big><big><strong>Index of Modules</strong></big></big>',
+ '#ffffff', '#7799ee')
+ names = [name for name in sys.builtin_module_names
+ if name != '__main__']
+ contents = html.multicolumn(names, bltinlink)
+ contents = [heading, '<p>' + html.bigsection(
+ 'Built-in Modules', '#ffffff', '#ee77aa', contents)]
+
+ seen = {}
+ for dir in sys.path:
+ contents.append(html.index(dir, seen))
+
+ contents.append(
+ '<p align=right><font color="#909090" face="helvetica,'
+ 'arial"><strong>pydoc</strong> by Ka-Ping Yee'
+ '&lt;ping@lfw.org&gt;</font>')
+ return 'Index of Modules', ''.join(contents)
+
+ def html_search(key):
+ """Search results page."""
+ # scan for modules
+ search_result = []
+
+ def callback(path, modname, desc):
+ if modname[-9:] == '.__init__':
+ modname = modname[:-9] + ' (package)'
+ search_result.append((modname, desc and '- ' + desc))
+
+ with warnings.catch_warnings():
+ warnings.filterwarnings('ignore') # ignore problems during import
+ ModuleScanner().run(callback, key)
+
+ # format page
+ def bltinlink(name):
+ return '<a href="%s.html">%s</a>' % (name, name)
+
+ results = []
+ heading = html.heading(
+ '<big><big><strong>Search Results</strong></big></big>',
+ '#ffffff', '#7799ee')
+ for name, desc in search_result:
+ results.append(bltinlink(name) + desc)
+ contents = heading + html.bigsection(
+ 'key = %s' % key, '#ffffff', '#ee77aa', '<br>'.join(results))
+ return 'Search Results', contents
+
+ def html_getfile(path):
+ """Get and display a source file listing safely."""
+ path = path.replace('%20', ' ')
+ with open(path, 'r') as fp:
+ lines = html.escape(fp.read())
+ body = '<pre>%s</pre>' % lines
+ heading = html.heading(
+ '<big><big><strong>File Listing</strong></big></big>',
+ '#ffffff', '#7799ee')
+ contents = heading + html.bigsection(
+ 'File: %s' % path, '#ffffff', '#ee77aa', body)
+ return 'getfile %s' % path, contents
+
+ def html_topics():
+ """Index of topic texts available."""
+
+ def bltinlink(name):
+ return '<a href="topic?key=%s">%s</a>' % (name, name)
+
+ heading = html.heading(
+ '<big><big><strong>INDEX</strong></big></big>',
+ '#ffffff', '#7799ee')
+ names = sorted(Helper.topics.keys())
+
+ contents = html.multicolumn(names, bltinlink)
+ contents = heading + html.bigsection(
+ 'Topics', '#ffffff', '#ee77aa', contents)
+ return 'Topics', contents
+
+ def html_keywords():
+ """Index of keywords."""
+ heading = html.heading(
+ '<big><big><strong>INDEX</strong></big></big>',
+ '#ffffff', '#7799ee')
+ names = sorted(Helper.keywords.keys())
+
+ def bltinlink(name):
+ return '<a href="topic?key=%s">%s</a>' % (name, name)
+
+ contents = html.multicolumn(names, bltinlink)
+ contents = heading + html.bigsection(
+ 'Keywords', '#ffffff', '#ee77aa', contents)
+ return 'Keywords', contents
+
+ def html_topicpage(topic):
+ """Topic or keyword help page."""
+ buf = io.StringIO()
+ htmlhelp = Helper(buf, buf)
+ contents, xrefs = htmlhelp._gettopic(topic)
+ if topic in htmlhelp.keywords:
+ title = 'KEYWORD'
+ else:
+ title = 'TOPIC'
+ heading = html.heading(
+ '<big><big><strong>%s</strong></big></big>' % title,
+ '#ffffff', '#7799ee')
+ contents = '<pre>%s</pre>' % html.markup(contents)
+ contents = html.bigsection(topic , '#ffffff','#ee77aa', contents)
+ if xrefs:
+ xrefs = sorted(xrefs.split())
+
+ def bltinlink(name):
+ return '<a href="topic?key=%s">%s</a>' % (name, name)
+
+ xrefs = html.multicolumn(xrefs, bltinlink)
+ xrefs = html.section('Related help topics: ',
+ '#ffffff', '#ee77aa', xrefs)
+ return ('%s %s' % (title, topic),
+ ''.join((heading, contents, xrefs)))
+
+ def html_getobj(url):
+ obj = locate(url, forceload=1)
+ if obj is None and url != 'None':
+ raise ValueError('could not find object')
+ title = describe(obj)
+ content = html.document(obj, url)
+ return title, content
+
+ def html_error(url, exc):
+ heading = html.heading(
+ '<big><big><strong>Error</strong></big></big>',
+ '#ffffff', '#7799ee')
+ contents = '<br>'.join(html.escape(line) for line in
+ format_exception_only(type(exc), exc))
+ contents = heading + html.bigsection(url, '#ffffff', '#bb0000',
+ contents)
+ return "Error - %s" % url, contents
+
+ def get_html_page(url):
+ """Generate an HTML page for url."""
+ complete_url = url
+ if url.endswith('.html'):
+ url = url[:-5]
+ try:
+ if url in ("", "index"):
+ title, content = html_index()
+ elif url == "topics":
+ title, content = html_topics()
+ elif url == "keywords":
+ title, content = html_keywords()
+ elif '=' in url:
+ op, _, url = url.partition('=')
+ if op == "search?key":
+ title, content = html_search(url)
+ elif op == "getfile?key":
+ title, content = html_getfile(url)
+ elif op == "topic?key":
+ # try topics first, then objects.
+ try:
+ title, content = html_topicpage(url)
+ except ValueError:
+ title, content = html_getobj(url)
+ elif op == "get?key":
+ # try objects first, then topics.
+ if url in ("", "index"):
+ title, content = html_index()
+ else:
+ try:
+ title, content = html_getobj(url)
+ except ValueError:
+ title, content = html_topicpage(url)
+ else:
+ raise ValueError('bad pydoc url')
+ else:
+ title, content = html_getobj(url)
+ except Exception as exc:
+ # Catch any errors and display them in an error page.
+ title, content = html_error(complete_url, exc)
+ return html.page(title, content)
+
+ if url.startswith('/'):
+ url = url[1:]
+ if content_type == 'text/css':
+ path_here = os.path.dirname(os.path.realpath(__file__))
+ css_path = os.path.join(path_here, url)
+ with open(css_path) as fp:
+ return ''.join(fp.readlines())
+ elif content_type == 'text/html':
+ return get_html_page(url)
+ # Errors outside the url handler are caught by the server.
+ raise TypeError('unknown content type %r for url %s' % (content_type, url))
+
+
+def browse(port=0, *, open_browser=True):
+ """Start the enhanced pydoc Web server and open a Web browser.
+
+ Use port '0' to start the server on an arbitrary port.
+ Set open_browser to False to suppress opening a browser.
+ """
+ import webbrowser
+ serverthread = _start_server(_url_handler, port)
+ if serverthread.error:
+ print(serverthread.error)
+ return
+ if serverthread.serving:
+ server_help_msg = 'Server commands: [b]rowser, [q]uit'
+ if open_browser:
+ webbrowser.open(serverthread.url)
+ try:
+ print('Server ready at', serverthread.url)
+ print(server_help_msg)
+ while serverthread.serving:
+ cmd = input('server> ')
+ cmd = cmd.lower()
+ if cmd == 'q':
+ break
+ elif cmd == 'b':
+ webbrowser.open(serverthread.url)
+ else:
+ print(server_help_msg)
+ except (KeyboardInterrupt, EOFError):
+ print()
+ finally:
+ if serverthread.serving:
+ serverthread.stop()
+ print('Server stopped')
+
+
# -------------------------------------------------- command-line interface
def ispath(x):
@@ -2267,29 +2775,32 @@ def cli():
sys.path.insert(0, '.')
try:
- opts, args = getopt.getopt(sys.argv[1:], 'gk:p:w')
- writing = 0
-
+ opts, args = getopt.getopt(sys.argv[1:], 'bgk:p:w')
+ writing = False
+ start_server = False
+ open_browser = False
+ port = None
for opt, val in opts:
if opt == '-g':
gui()
return
+ if opt == '-b':
+ start_server = True
+ open_browser = True
if opt == '-k':
apropos(val)
return
if opt == '-p':
- try:
- port = int(val)
- except ValueError:
- raise BadUsage
- def ready(server):
- print('pydoc server ready at %s' % server.url)
- def stopped():
- print('pydoc server stopped')
- serve(port, ready, stopped)
- return
+ start_server = True
+ port = val
if opt == '-w':
- writing = 1
+ writing = True
+
+ if start_server == True:
+ if port == None:
+ port = 0
+ browse(port, open_browser=open_browser)
+ return
if not args: raise BadUsage
for arg in args:
@@ -2310,30 +2821,37 @@ def cli():
print(value)
except (getopt.error, BadUsage):
- cmd = os.path.basename(sys.argv[0])
+ cmd = os.path.splitext(os.path.basename(sys.argv[0]))[0]
print("""pydoc - the Python documentation tool
-%s <name> ...
+{cmd} <name> ...
Show text documentation on something. <name> may be the name of a
Python keyword, topic, function, module, or package, or a dotted
reference to a class or function within a module or module in a
- package. If <name> contains a '%s', it is used as the path to a
+ package. If <name> contains a '{sep}', it is used as the path to a
Python source file to document. If name is 'keywords', 'topics',
or 'modules', a listing of these things is displayed.
-%s -k <keyword>
+{cmd} -k <keyword>
Search for a keyword in the synopsis lines of all available modules.
-%s -p <port>
- Start an HTTP server on the given port on the local machine.
+{cmd} -p <port>
+ Start an HTTP server on the given port on the local machine. Port
+ number 0 can be used to get an arbitrary unused port.
+
+{cmd} -b
+ Start an HTTP server on an arbitrary unused port and open a Web browser
+ to interactively browse documentation. The -p option can be used with
+ the -b option to explicitly specify the server port.
-%s -g
- Pop up a graphical interface for finding and serving documentation.
+{cmd} -g
+ Deprecated.
-%s -w <name> ...
+{cmd} -w <name> ...
Write out the HTML documentation for a module to a file in the current
- directory. If <name> contains a '%s', it is treated as a filename; if
+ directory. If <name> contains a '{sep}', it is treated as a filename; if
it names a directory, documentation is written for all the contents.
-""" % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep))
+""".format(cmd=cmd, sep=os.sep))
-if __name__ == '__main__': cli()
+if __name__ == '__main__':
+ cli()
diff --git a/Lib/pydoc_data/_pydoc.css b/Lib/pydoc_data/_pydoc.css
new file mode 100644
index 0000000000..f036ef37a5
--- /dev/null
+++ b/Lib/pydoc_data/_pydoc.css
@@ -0,0 +1,6 @@
+/*
+ CSS file for pydoc.
+
+ Contents of this file are subject to change without notice.
+
+*/
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index 78cea8c240..226ae28df3 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,4 +1,4 @@
-# Autogenerated by Sphinx on Thu Apr 28 07:37:19 2011
+# Autogenerated by Sphinx on Thu Apr 28 07:47:47 2011
topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``, is equivalent to\n\n if __debug__:\n if not expression: raise AssertionError\n\nThe extended form, ``assert expression1, expression2``, is equivalent\nto\n\n if __debug__:\n if not expression1: raise AssertionError(expression2)\n\nThese equivalences assume that ``__debug__`` and ``AssertionError``\nrefer to the built-in variables with those names. In the current\nimplementation, the built-in variable ``__debug__`` is ``True`` under\nnormal circumstances, ``False`` when optimization is requested\n(command line option -O). The current code generator emits no code\nfor an assert statement when optimization is requested at compile\ntime. Note that it is unnecessary to include the source code for the\nexpression that failed in the error message; it will be displayed as\npart of the stack trace.\n\nAssignments to ``__debug__`` are illegal. The value for the built-in\nvariable is determined when the interpreter starts.\n',
'assignment': '\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n | "*" target\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list, optionally enclosed in\nparentheses or square brackets, is recursively defined as follows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be an iterable with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets.\n\n * If the target list contains one target prefixed with an asterisk,\n called a "starred" target: The object must be a sequence with at\n least as many items as there are targets in the target list, minus\n one. The first items of the sequence are assigned, from left to\n right, to the targets before the starred target. The final items\n of the sequence are assigned to the targets after the starred\n target. A list of the remaining items in the sequence is then\n assigned to the starred target (the list can be empty).\n\n * Else: The object must be a sequence with the same number of items\n as there are targets in the target list, and the items are\n assigned, from left to right, to the corresponding targets.\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` or ``nonlocal``\n statement in the current code block: the name is bound to the\n object in the current local namespace.\n\n * Otherwise: the name is bound to the object in the global namespace\n or the outer namespace determined by ``nonlocal``, respectively.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be an iterable with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n Note: If the object is a class instance and the attribute reference\n occurs on both sides of the assignment operator, the RHS expression,\n ``a.x`` can access either an instance attribute or (if no instance\n attribute exists) a class attribute. The LHS target ``a.x`` is\n always set as an instance attribute, creating it if necessary.\n Thus, the two occurrences of ``a.x`` do not necessarily refer to the\n same attribute: if the RHS expression refers to a class attribute,\n the LHS creates a new instance attribute as the target of the\n assignment:\n\n class Cls:\n x = 3 # class variable\n inst = Cls()\n inst.x = inst.x + 1 # writes inst.x as 4 leaving Cls.x as 3\n\n This description does not necessarily apply to descriptor\n attributes, such as properties created with ``property()``.\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield an integer. If it is negative, the sequence\'s\n length is added to it. The resulting value must be a nonnegative\n integer less than the sequence\'s length, and the sequence is asked\n to assign the assigned object to its item with that index. If the\n index is out of range, ``IndexError`` is raised (assignment to a\n subscripted sequence cannot add new items to a list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n For user-defined objects, the ``__setitem__()`` method is called\n with appropriate arguments.\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to integers. If either bound is\n negative, the sequence\'s length is added to it. The resulting\n bounds are clipped to lie between zero and the sequence\'s length,\n inclusive. Finally, the sequence object is asked to replace the\n slice with the items of the assigned sequence. The length of the\n slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n**CPython implementation detail:** In the current implementation, the\nsyntax for targets is taken to be the same as for expressions, and\ninvalid syntax is rejected during the code generation phase, causing\nless detailed error messages.\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print(x)\n\nSee also:\n\n **PEP 3132** - Extended Iterable Unpacking\n The specification for the ``*target`` feature.\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n augtarget ::= identifier | attributeref | subscription | slicing\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the same *caveat about\nclass and instance attributes* applies as for regular assignments.\n',
'atom-identifiers': '\nIdentifiers (Names)\n*******************\n\nAn identifier occurring as an atom is a name. See section\n*Identifiers and keywords* for lexical definition and section *Naming\nand binding* for documentation of naming and binding.\n\nWhen the name is bound to an object, evaluation of the atom yields\nthat object. When a name is not bound, an attempt to evaluate it\nraises a ``NameError`` exception.\n\n**Private name mangling:** When an identifier that textually occurs in\na class definition begins with two or more underscore characters and\ndoes not end in two or more underscores, it is considered a *private\nname* of that class. Private names are transformed to a longer form\nbefore code is generated for them. The transformation inserts the\nclass name in front of the name, with leading underscores removed, and\na single underscore inserted in front of the class name. For example,\nthe identifier ``__spam`` occurring in a class named ``Ham`` will be\ntransformed to ``_Ham__spam``. This transformation is independent of\nthe syntactical context in which the identifier is used. If the\ntransformed name is extremely long (longer than 255 characters),\nimplementation defined truncation may happen. If the class name\nconsists only of underscores, no transformation is done.\n',
@@ -18,61 +18,61 @@ topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAss
'calls': '\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","] | comprehension] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression] ["," keyword_arguments]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," keyword_arguments] ["," "**" expression]\n | "*" expression ["," keyword_arguments] ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and all objects having a\n``__call__()`` method are callable). All argument expressions are\nevaluated before the call is attempted. Please refer to section\n*Function definitions* for the syntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\n**CPython implementation detail:** An implementation may provide\nbuilt-in functions whose positional parameters do not have names, even\nif they are \'named\' for the purpose of documentation, and which\ntherefore cannot be supplied by keyword. In CPython, this is the case\nfor functions implemented in C that use ``PyArg_ParseTuple()`` to\nparse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,..., *xN*, and ``expression``\nevaluates to a sequence *y1*, ..., *yM*, this is equivalent to a call\nwith M+N positional arguments *x1*, ..., *xN*, *y1*, ..., *yM*.\n\nA consequence of this is that although the ``*expression`` syntax may\nappear *after* some keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print(a, b)\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "<stdin>", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n',
'class': '\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= [decorators] "class" classname [inheritance] ":" suite\n inheritance ::= "(" [argument_list [","] | comprehension] ")"\n classname ::= identifier\n\nA class definition is an executable statement. The inheritance list\nusually gives a list of base classes (see *Customizing class creation*\nfor more advanced uses), so each item in the list should evaluate to a\nclass object which allows subclassing. Classes without an inheritance\nlist inherit, by default, from the base class ``object``; hence,\n\n class Foo:\n pass\n\nis equivalent to\n\n class Foo(object):\n pass\n\nThe class\'s suite is then executed in a new execution frame (see\n*Naming and binding*), using a newly created local namespace and the\noriginal global namespace. (Usually, the suite contains mostly\nfunction definitions.) When the class\'s suite finishes execution, its\nexecution frame is discarded but its local namespace is saved. [4] A\nclass object is then created using the inheritance list for the base\nclasses and the saved local namespace for the attribute dictionary.\nThe class name is bound to this class object in the original local\nnamespace.\n\nClass creation can be customized heavily using *metaclasses*.\n\nClasses can also be decorated: just like when decorating functions,\n\n @f1(arg)\n @f2\n class Foo: pass\n\nis equivalent to\n\n class Foo: pass\n Foo = f1(arg)(f2(Foo))\n\nThe evaluation rules for the decorator expressions are the same as for\nfunction decorators. The result must be a class object, which is then\nbound to the class name.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass attributes; they are shared by instances. Instance attributes\ncan be set in a method with ``self.name = value``. Both class and\ninstance attributes are accessible through the notation\n"``self.name``", and an instance attribute hides a class attribute\nwith the same name when accessed in this way. Class attributes can be\nused as defaults for instance attributes, but using mutable values\nthere can lead to unexpected results. *Descriptors* can be used to\ncreate instance variables with different implementation details.\n\nSee also:\n\n **PEP 3115** - Metaclasses in Python 3 **PEP 3129** - Class\n Decorators\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n',
'comparisons': '\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nthe ``==`` and ``!=`` operators *always* consider objects of different\ntypes to be unequal, while the ``<``, ``>``, ``>=`` and ``<=``\noperators raise a ``TypeError`` when comparing objects of different\ntypes that do not implement these operators for the given pair of\ntypes. You can control comparison behavior of objects of non-built-in\ntypes by defining rich comparison methods like ``__gt__()``, described\nin section *Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values ``float(\'NaN\')`` and ``Decimal(\'NaN\')`` are special. The\n are identical to themselves, ``x is x`` but are not equal to\n themselves, ``x != x``. Additionally, comparing any value to a\n not-a-number value will return ``False``. For example, both ``3 <\n float(\'NaN\')`` and ``float(\'NaN\') < 3`` will return ``False``.\n\n* Bytes objects are compared lexicographically using the numeric\n values of their elements.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n [3] String and bytes object can\'t be compared!\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``[1,2,x] <= [1,2,y]`` has the\n same value as ``x <= y``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if they have the\n same ``(key, value)`` pairs. Order comparisons ``(\'<\', \'<=\', \'>=\',\n \'>\')`` raise ``TypeError``.\n\n* Sets and frozensets define comparison operators to mean subset and\n superset tests. Those relations do not define total orderings (the\n two sets ``{1,2}`` and {2,3} are not equal, nor subsets of one\n another, nor supersets of one another). Accordingly, sets are not\n appropriate arguments for functions which depend on total ordering.\n For example, ``min()``, ``max()``, and ``sorted()`` produce\n undefined results given a list of sets as inputs.\n\n* Most other objects of built-in types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison. Most\nnumeric types can be compared with one another, but comparisons of\n``float`` and ``Decimal`` are not supported to avoid the inevitable\nconfusion arising from representation issues such as ``float(\'1.1\')``\nbeing inexactly represented and therefore not exactly equal to\n``Decimal(\'1.1\')`` which is. When cross-type comparison is not\nsupported, the comparison method returns ``NotImplemented``. This can\ncreate the illusion of non-transitivity between supported cross-type\ncomparisons and unsupported comparisons. For example, ``Decimal(2) ==\n2`` and ``2 == float(2)`` but ``Decimal(2) != float(2)``.\n\nThe operators ``in`` and ``not in`` test for membership. ``x in s``\nevaluates to true if *x* is a member of *s*, and false otherwise. ``x\nnot in s`` returns the negation of ``x in s``. All built-in sequences\nand set types support this as well as dictionary, for which ``in``\ntests whether a the dictionary has a given key. For container types\nsuch as list, tuple, set, frozenset, dict, or collections.deque, the\nexpression ``x in y`` is equivalent to ``any(x is e or x == e for e in\ny)``.\n\nFor the string and bytes types, ``x in y`` is true if and only if *x*\nis a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nEmpty strings are always considered to be a substring of any other\nstring, so ``"" in "abc"`` will return ``True``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` but do\ndefine ``__iter__()``, ``x in y`` is true if some value ``z`` with ``x\n== z`` is produced while iterating over ``y``. If an exception is\nraised during the iteration, it is as if ``in`` raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n``__getitem__()``, ``x in y`` is true if and only if there is a non-\nnegative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [4]\n',
- 'compound': '\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements, while the ``with`` statement\nallows the execution of initialization and finalization code around a\nblock of code. Function and class definitions are also syntactically\ncompound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print(x)\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print()`` calls are executed:\n\n if x < y < z: print(x); print(y); print(z)\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted. When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a ``StopIteration``\nexception), the suite in the ``else`` clause, if present, is executed,\nand the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop. Hint: the built-in function ``range()`` returns an\niterator of integers suitable to emulate the effect of Pascal\'s ``for\ni := a to b do``; e.g., ``list(range(3))`` returns the list ``[0, 1,\n2]``.\n\nNote: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An\n internal counter is used to keep track of which item is used next,\n and this is incremented on each iteration. When this counter has\n reached the length of the sequence the loop terminates. This means\n that if the suite deletes the current (or a previous) item from the\n sequence, the next item will be skipped (since it gets the index of\n the current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["as" target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object or a tuple containing an item compatible with the\nexception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the ``as`` keyword in that except clause,\nif present, and the except clause\'s suite is executed. All except\nclauses must have an executable block. When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using ``as target``, it is cleared\nat the end of the except clause. This is as if\n\n except E as N:\n foo\n\nwas translated to\n\n except E as N:\n try:\n foo\n finally:\n del N\n\nThis means the exception must be assigned to a different name to be\nable to refer to it after the except clause. Exceptions are cleared\nbecause with the traceback attached to them, they form a reference\ncycle with the stack frame, keeping all locals in that frame alive\nuntil the next garbage collection occurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the ``sys`` module and can be access via\n``sys.exc_info()``. ``sys.exc_info()`` returns a 3-tuple consisting of\nthe exception class, the exception instance and a traceback object\n(see section *The standard type hierarchy*) identifying the point in\nthe program where the exception occurred. ``sys.exc_info()`` values\nare restored to their previous values (before the call) when returning\nfrom a function that handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" with_item ("," with_item)* ":" suite\n with_item ::= expression ["as" target]\n\nThe execution of the ``with`` statement with one "item" proceeds as\nfollows:\n\n1. The context expression (the expression given in the **with_item**)\n is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple ``with`` statements were nested:\n\n with A() as a, B() as b:\n suite\n\nis equivalent to\n\n with A() as a:\n with B() as b:\n suite\n\nChanged in version 3.1: Support for multiple context expressions.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n funcdef ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" [parameter] ("," defparameter)*\n [, "**" parameter]\n | "**" parameter\n | defparameter [","] )\n parameter ::= identifier [":" expression]\n defparameter ::= parameter ["=" expression]\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters up until the "``*``" must also have a default value ---\nthis is a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after "``*``" or "``*identifier``" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "``: expression``"\nfollowing the parameter name. Any parameter may have an annotation\neven those of the form ``*identifier`` or ``**identifier``. Functions\nmay have "return" annotation of the form "``-> expression``" after the\nparameter list. These annotations can be any valid Python expression\nand are evaluated when the function definition is executed.\nAnnotations may be evaluated in a different order than they appear in\nthe source code. The presence of annotations does not change the\nsemantics of a function. The annotation values are available as\nvalues of a dictionary keyed by the parameters\' names in the\n``__annotations__`` attribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Lambdas*. Note that the lambda form is merely a\nshorthand for a simplified function definition; a function defined in\na "``def``" statement can be passed around or assigned to another name\njust like a function defined by a lambda form. The "``def``" form is\nactually more powerful since it allows the execution of multiple\nstatements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= [decorators] "class" classname [inheritance] ":" suite\n inheritance ::= "(" [argument_list [","] | comprehension] ")"\n classname ::= identifier\n\nA class definition is an executable statement. The inheritance list\nusually gives a list of base classes (see *Customizing class creation*\nfor more advanced uses), so each item in the list should evaluate to a\nclass object which allows subclassing. Classes without an inheritance\nlist inherit, by default, from the base class ``object``; hence,\n\n class Foo:\n pass\n\nis equivalent to\n\n class Foo(object):\n pass\n\nThe class\'s suite is then executed in a new execution frame (see\n*Naming and binding*), using a newly created local namespace and the\noriginal global namespace. (Usually, the suite contains mostly\nfunction definitions.) When the class\'s suite finishes execution, its\nexecution frame is discarded but its local namespace is saved. [4] A\nclass object is then created using the inheritance list for the base\nclasses and the saved local namespace for the attribute dictionary.\nThe class name is bound to this class object in the original local\nnamespace.\n\nClass creation can be customized heavily using *metaclasses*.\n\nClasses can also be decorated: just like when decorating functions,\n\n @f1(arg)\n @f2\n class Foo: pass\n\nis equivalent to\n\n class Foo: pass\n Foo = f1(arg)(f2(Foo))\n\nThe evaluation rules for the decorator expressions are the same as for\nfunction decorators. The result must be a class object, which is then\nbound to the class name.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass attributes; they are shared by instances. Instance attributes\ncan be set in a method with ``self.name = value``. Both class and\ninstance attributes are accessible through the notation\n"``self.name``", and an instance attribute hides a class attribute\nwith the same name when accessed in this way. Class attributes can be\nused as defaults for instance attributes, but using mutable values\nthere can lead to unexpected results. *Descriptors* can be used to\ncreate instance variables with different implementation details.\n\nSee also:\n\n **PEP 3115** - Metaclasses in Python 3 **PEP 3129** - Class\n Decorators\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n',
+ 'compound': '\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements, while the ``with`` statement\nallows the execution of initialization and finalization code around a\nblock of code. Function and class definitions are also syntactically\ncompound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print(x)\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print()`` calls are executed:\n\n if x < y < z: print(x); print(y); print(z)\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted. When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a ``StopIteration``\nexception), the suite in the ``else`` clause, if present, is executed,\nand the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop. Hint: the built-in function ``range()`` returns an\niterator of integers suitable to emulate the effect of Pascal\'s ``for\ni := a to b do``; e.g., ``list(range(3))`` returns the list ``[0, 1,\n2]``.\n\nNote: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An\n internal counter is used to keep track of which item is used next,\n and this is incremented on each iteration. When this counter has\n reached the length of the sequence the loop terminates. This means\n that if the suite deletes the current (or a previous) item from the\n sequence, the next item will be skipped (since it gets the index of\n the current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["as" target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object or a tuple containing an item compatible with the\nexception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the ``as`` keyword in that except clause,\nif present, and the except clause\'s suite is executed. All except\nclauses must have an executable block. When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using ``as target``, it is cleared\nat the end of the except clause. This is as if\n\n except E as N:\n foo\n\nwas translated to\n\n except E as N:\n try:\n foo\n finally:\n del N\n\nThis means the exception must be assigned to a different name to be\nable to refer to it after the except clause. Exceptions are cleared\nbecause with the traceback attached to them, they form a reference\ncycle with the stack frame, keeping all locals in that frame alive\nuntil the next garbage collection occurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the ``sys`` module and can be access via\n``sys.exc_info()``. ``sys.exc_info()`` returns a 3-tuple consisting of\nthe exception class, the exception instance and a traceback object\n(see section *The standard type hierarchy*) identifying the point in\nthe program where the exception occurred. ``sys.exc_info()`` values\nare restored to their previous values (before the call) when returning\nfrom a function that handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" with_item ("," with_item)* ":" suite\n with_item ::= expression ["as" target]\n\nThe execution of the ``with`` statement with one "item" proceeds as\nfollows:\n\n1. The context expression (the expression given in the ``with_item``)\n is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__exit__()`` is loaded for later use.\n\n3. The context manager\'s ``__enter__()`` method is invoked.\n\n4. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 6 below.\n\n5. The suite is executed.\n\n6. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple ``with`` statements were nested:\n\n with A() as a, B() as b:\n suite\n\nis equivalent to\n\n with A() as a:\n with B() as b:\n suite\n\nChanged in version 3.1: Support for multiple context expressions.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n funcdef ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" [parameter] ("," defparameter)*\n [, "**" parameter]\n | "**" parameter\n | defparameter [","] )\n parameter ::= identifier [":" expression]\n defparameter ::= parameter ["=" expression]\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters up until the "``*``" must also have a default value ---\nthis is a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after "``*``" or "``*identifier``" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "``: expression``"\nfollowing the parameter name. Any parameter may have an annotation\neven those of the form ``*identifier`` or ``**identifier``. Functions\nmay have "return" annotation of the form "``-> expression``" after the\nparameter list. These annotations can be any valid Python expression\nand are evaluated when the function definition is executed.\nAnnotations may be evaluated in a different order than they appear in\nthe source code. The presence of annotations does not change the\nsemantics of a function. The annotation values are available as\nvalues of a dictionary keyed by the parameters\' names in the\n``__annotations__`` attribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Lambdas*. Note that the lambda form is merely a\nshorthand for a simplified function definition; a function defined in\na "``def``" statement can be passed around or assigned to another name\njust like a function defined by a lambda form. The "``def``" form is\nactually more powerful since it allows the execution of multiple\nstatements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= [decorators] "class" classname [inheritance] ":" suite\n inheritance ::= "(" [argument_list [","] | comprehension] ")"\n classname ::= identifier\n\nA class definition is an executable statement. The inheritance list\nusually gives a list of base classes (see *Customizing class creation*\nfor more advanced uses), so each item in the list should evaluate to a\nclass object which allows subclassing. Classes without an inheritance\nlist inherit, by default, from the base class ``object``; hence,\n\n class Foo:\n pass\n\nis equivalent to\n\n class Foo(object):\n pass\n\nThe class\'s suite is then executed in a new execution frame (see\n*Naming and binding*), using a newly created local namespace and the\noriginal global namespace. (Usually, the suite contains mostly\nfunction definitions.) When the class\'s suite finishes execution, its\nexecution frame is discarded but its local namespace is saved. [4] A\nclass object is then created using the inheritance list for the base\nclasses and the saved local namespace for the attribute dictionary.\nThe class name is bound to this class object in the original local\nnamespace.\n\nClass creation can be customized heavily using *metaclasses*.\n\nClasses can also be decorated: just like when decorating functions,\n\n @f1(arg)\n @f2\n class Foo: pass\n\nis equivalent to\n\n class Foo: pass\n Foo = f1(arg)(f2(Foo))\n\nThe evaluation rules for the decorator expressions are the same as for\nfunction decorators. The result must be a class object, which is then\nbound to the class name.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass attributes; they are shared by instances. Instance attributes\ncan be set in a method with ``self.name = value``. Both class and\ninstance attributes are accessible through the notation\n"``self.name``", and an instance attribute hides a class attribute\nwith the same name when accessed in this way. Class attributes can be\nused as defaults for instance attributes, but using mutable values\nthere can lead to unexpected results. *Descriptors* can be used to\ncreate instance variables with different implementation details.\n\nSee also:\n\n **PEP 3115** - Metaclasses in Python 3 **PEP 3129** - Class\n Decorators\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n',
'context-managers': '\nWith Statement Context Managers\n*******************************\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n',
'continue': '\nThe ``continue`` statement\n**************************\n\n continue_stmt ::= "continue"\n\n``continue`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition or\n``finally`` clause within that loop. It continues with the next cycle\nof the nearest enclosing loop.\n\nWhen ``continue`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nstarting the next loop cycle.\n',
'conversions': '\nArithmetic conversions\n**********************\n\nWhen a description of an arithmetic operator below uses the phrase\n"the numeric arguments are converted to a common type," this means\nthat the operator implementation for built-in types works that way:\n\n* If either argument is a complex number, the other is converted to\n complex;\n\n* otherwise, if either argument is a floating point number, the other\n is converted to floating point;\n\n* otherwise, both must be integers and no conversion is necessary.\n\nSome additional rules apply for certain operators (e.g., a string left\nargument to the \'%\' operator). Extensions must define their own\nconversion behavior.\n',
- 'customization': '\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_info()[2]`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.last_traceback``. Circular references which are garbage are\n detected when the option cycle detector is enabled (it\'s on by\n default), but can only be cleaned up if there are no Python-\n level ``__del__()`` methods involved. Refer to the documentation\n for the ``gc`` module for more information about how\n ``__del__()`` methods are handled by the cycle detector,\n particularly the description of the ``garbage`` value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted or in the process of being torn down (e.g. the\n import machinery shutting down). For this reason, ``__del__()``\n methods should do the absolute minimum needed to maintain\n external invariants. Starting with version 1.5, Python\n guarantees that globals whose name begins with a single\n underscore are deleted from their module before other globals are\n deleted; if no other references to such globals exist, this may\n help in assuring that imported modules are still available at the\n time when the ``__del__()`` method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function to compute the\n "official" string representation of an object. If at all possible,\n this should look like a valid Python expression that could be used\n to recreate an object with the same value (given an appropriate\n environment). If this is not possible, a string of the form\n ``<...some useful description...>`` should be returned. The return\n value must be a string object. If a class defines ``__repr__()``\n but not ``__str__()``, then ``__repr__()`` is also used when an\n "informal" string representation of instances of that class is\n required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print()``\n function to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__format__(self, format_spec)\n\n Called by the ``format()`` built-in function (and by extension, the\n ``format()`` method of class ``str``) to produce a "formatted"\n string representation of an object. The ``format_spec`` argument is\n a string that contains a description of the formatting options\n desired. The interpretation of the ``format_spec`` argument is up\n to the type implementing ``__format__()``, however most classes\n will either delegate formatting to one of the built-in types, or\n use a similar formatting option syntax.\n\n See *Format Specification Mini-Language* for a description of the\n standard formatting syntax.\n\n The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n These are the so-called "rich comparison" methods. The\n correspondence between operator symbols and method names is as\n follows: ``x<y`` calls ``x.__lt__(y)``, ``x<=y`` calls\n ``x.__le__(y)``, ``x==y`` calls ``x.__eq__(y)``, ``x!=y`` calls\n ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and ``x>=y`` calls\n ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\n To automatically generate ordering operations from a single root\n operation, see the Total Ordering recipe in the ASPN cookbook.\n\nobject.__hash__(self)\n\n Called by built-in function ``hash()`` and for operations on\n members of hashed collections including ``set``, ``frozenset``, and\n ``dict``. ``__hash__()`` should return an integer. The only\n required property is that objects which compare equal have the same\n hash value; it is advised to somehow mix together (e.g. using\n exclusive or) the hash values for the components of the object that\n also play a part in comparison of objects.\n\n If a class does not define an ``__eq__()`` method it should not\n define a ``__hash__()`` operation either; if it defines\n ``__eq__()`` but not ``__hash__()``, its instances will not be\n usable as items in hashable collections. If a class defines\n mutable objects and implements an ``__eq__()`` method, it should\n not implement ``__hash__()``, since the implementation of hashable\n collections requires that a key\'s hash value is immutable (if the\n object\'s hash value changes, it will be in the wrong hash bucket).\n\n User-defined classes have ``__eq__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__eq__()`` such that the hash value\n returned is no longer appropriate (e.g. by switching to a value-\n based concept of equality instead of the default identity based\n equality) can explicitly flag themselves as being unhashable by\n setting ``__hash__ = None`` in the class definition. Doing so means\n that not only will instances of the class raise an appropriate\n ``TypeError`` when a program attempts to retrieve their hash value,\n but they will also be correctly identified as unhashable when\n checking ``isinstance(obj, collections.Hashable)`` (unlike classes\n which define their own ``__hash__()`` to explicitly raise\n ``TypeError``).\n\n If a class that overrides ``__eq__()`` needs to retain the\n implementation of ``__hash__()`` from a parent class, the\n interpreter must be told this explicitly by setting ``__hash__ =\n <ParentClass>.__hash__``. Otherwise the inheritance of\n ``__hash__()`` will be blocked, just as if ``__hash__`` had been\n explicitly set to ``None``.\n\nobject.__bool__(self)\n\n Called to implement truth value testing and the built-in operation\n ``bool()``; should return ``False`` or ``True``. When this method\n is not defined, ``__len__()`` is called, if it is defined, and the\n object is considered true if its result is nonzero. If a class\n defines neither ``__len__()`` nor ``__bool__()``, all its instances\n are considered true.\n',
- 'debugger': '\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > <string>(0)?()\n (Pdb) continue\n > <string>(1)?()\n (Pdb) continue\n NameError: \'spam\'\n > <string>(1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python3 -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nThe typical usage to break into the debugger from a running program is\nto insert\n\n import pdb; pdb.set_trace()\n\nat the location you want to break into the debugger. You can then\nstep through the code following this statement, and continue running\nwithout the debugger using the ``c`` command.\n\nThe typical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "<stdin>", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print(spam)\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print(spam)\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the built-in ``exec()`` or ``eval()`` functions.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n\nThe ``run*`` functions and ``set_trace()`` are aliases for\ninstantiating the ``Pdb`` class and calling the method of the same\nname. If you want to access further features, you have to do this\nyourself:\n\nclass class pdb.Pdb(completekey=\'tab\', stdin=None, stdout=None, skip=None)\n\n ``Pdb`` is the debugger class.\n\n The *completekey*, *stdin* and *stdout* arguments are passed to the\n underlying ``cmd.Cmd`` class; see the description there.\n\n The *skip* argument, if given, must be an iterable of glob-style\n module name patterns. The debugger will not step into frames that\n originate in a module that matches one of these patterns. [1]\n\n Example call to enable tracing with *skip*:\n\n import pdb; pdb.Pdb(skip=[\'django.*\']).set_trace()\n\n New in version 3.1: The *skip* argument.\n\n run(statement[, globals[, locals]])\n runeval(expression[, globals[, locals]])\n runcall(function[, argument, ...])\n set_trace()\n\n See the documentation for the functions explained above.\n\n\nDebugger Commands\n=================\n\nThe debugger recognizes the following commands. Most commands can be\nabbreviated to one or two letters; e.g. ``h(elp)`` means that either\n``h`` or ``help`` can be used to enter the help command (but not\n``he`` or ``hel``, nor ``H`` or ``Help`` or ``HELP``). Arguments to\ncommands must be separated by whitespace (spaces or tabs). Optional\narguments are enclosed in square brackets (``[]``) in the command\nsyntax; the square brackets must not be typed. Alternatives in the\ncommand syntax are separated by a vertical bar (``|``).\n\nEntering a blank line repeats the last command entered. Exception: if\nthe last command was a ``list`` command, the next 11 lines are listed.\n\nCommands that the debugger doesn\'t recognize are assumed to be Python\nstatements and are executed in the context of the program being\ndebugged. Python statements can also be prefixed with an exclamation\npoint (``!``). This is a powerful way to inspect the program being\ndebugged; it is even possible to change a variable or call a function.\nWhen an exception occurs in such a statement, the exception name is\nprinted but the debugger\'s state is not changed.\n\nMultiple commands may be entered on a single line, separated by\n``;;``. (A single ``;`` is not used as it is the separator for\nmultiple commands in a line that is passed to the Python parser.) No\nintelligence is applied to separating the commands; the input is split\nat the first ``;;`` pair, even if it is in the middle of a quoted\nstring.\n\nThe debugger supports aliases. Aliases can have parameters which\nallows one a certain level of adaptability to the context under\nexamination.\n\nIf a file ``.pdbrc`` exists in the user\'s home directory or in the\ncurrent directory, it is read in and executed as if it had been typed\nat the debugger prompt. This is particularly useful for aliases. If\nboth files exist, the one in the home directory is read first and\naliases defined there can be overridden by the local file.\n\nh(elp) [*command*]\n Without argument, print the list of available commands. With a\n *command* as argument, print help about that command. ``help pdb``\n displays the full documentation file; if the environment variable\n **PAGER** is defined, the file is piped through that command\n instead. Since the *command* argument must be an identifier,\n ``help exec`` must be entered to get help on the ``!`` command.\n\nw(here)\n Print a stack trace, with the most recent frame at the bottom. An\n arrow indicates the current frame, which determines the context of\n most commands.\n\nd(own)\n Move the current frame one level down in the stack trace (to a\n newer frame).\n\nu(p)\n Move the current frame one level up in the stack trace (to an older\n frame).\n\nb(reak) [[*filename*:]*lineno* | *function*[, *condition*]]\n With a *lineno* argument, set a break there in the current file.\n With a *function* argument, set a break at the first executable\n statement within that function. The line number may be prefixed\n with a filename and a colon, to specify a breakpoint in another\n file (probably one that hasn\'t been loaded yet). The file is\n searched on ``sys.path``. Note that each breakpoint is assigned a\n number to which all the other breakpoint commands refer.\n\n If a second argument is present, it is an expression which must\n evaluate to true before the breakpoint is honored.\n\n Without argument, list all breaks, including for each breakpoint,\n the number of times that breakpoint has been hit, the current\n ignore count, and the associated condition if any.\n\ntbreak [[*filename*:]*lineno* | *function*[, *condition*]]\n Temporary breakpoint, which is removed automatically when it is\n first hit. The arguments are the same as break.\n\ncl(ear) [*filename:lineno* | *bpnumber* [*bpnumber ...*]]\n With a *filename:lineno* argument, clear all the breakpoints at\n this line. With a space separated list of breakpoint numbers, clear\n those breakpoints. Without argument, clear all breaks (but first\n ask confirmation).\n\ndisable [*bpnumber* [*bpnumber ...*]]\n Disables the breakpoints given as a space separated list of\n breakpoint numbers. Disabling a breakpoint means it cannot cause\n the program to stop execution, but unlike clearing a breakpoint, it\n remains in the list of breakpoints and can be (re-)enabled.\n\nenable [*bpnumber* [*bpnumber ...*]]\n Enables the breakpoints specified.\n\nignore *bpnumber* [*count*]\n Sets the ignore count for the given breakpoint number. If count is\n omitted, the ignore count is set to 0. A breakpoint becomes active\n when the ignore count is zero. When non-zero, the count is\n decremented each time the breakpoint is reached and the breakpoint\n is not disabled and any associated condition evaluates to true.\n\ncondition *bpnumber* [*condition*]\n Condition is an expression which must evaluate to true before the\n breakpoint is honored. If condition is absent, any existing\n condition is removed; i.e., the breakpoint is made unconditional.\n\ncommands [*bpnumber*]\n Specify a list of commands for breakpoint number *bpnumber*. The\n commands themselves appear on the following lines. Type a line\n containing just \'end\' to terminate the commands. An example:\n\n (Pdb) commands 1\n (com) print some_variable\n (com) end\n (Pdb)\n\n To remove all commands from a breakpoint, type commands and follow\n it immediately with end; that is, give no commands.\n\n With no *bpnumber* argument, commands refers to the last breakpoint\n set.\n\n You can use breakpoint commands to start your program up again.\n Simply use the continue command, or step, or any other command that\n resumes execution.\n\n Specifying any command resuming execution (currently continue,\n step, next, return, jump, quit and their abbreviations) terminates\n the command list (as if that command was immediately followed by\n end). This is because any time you resume execution (even with a\n simple next or step), you may encounter another breakpoint--which\n could have its own command list, leading to ambiguities about which\n list to execute.\n\n If you use the \'silent\' command in the command list, the usual\n message about stopping at a breakpoint is not printed. This may be\n desirable for breakpoints that are to print a specific message and\n then continue. If none of the other commands print anything, you\n see no sign that the breakpoint was reached.\n\ns(tep)\n Execute the current line, stop at the first possible occasion\n (either in a function that is called or on the next line in the\n current function).\n\nn(ext)\n Continue execution until the next line in the current function is\n reached or it returns. (The difference between ``next`` and\n ``step`` is that ``step`` stops inside a called function, while\n ``next`` executes called functions at (nearly) full speed, only\n stopping at the next line in the current function.)\n\nunt(il)\n Continue execution until the line with the line number greater than\n the current one is reached or when returning from current frame.\n\nr(eturn)\n Continue execution until the current function returns.\n\nc(ont(inue))\n Continue execution, only stop when a breakpoint is encountered.\n\nj(ump) *lineno*\n Set the next line that will be executed. Only available in the\n bottom-most frame. This lets you jump back and execute code again,\n or jump forward to skip code that you don\'t want to run.\n\n It should be noted that not all jumps are allowed --- for instance\n it is not possible to jump into the middle of a ``for`` loop or out\n of a ``finally`` clause.\n\nl(ist) [*first*[, *last*]]\n List source code for the current file. Without arguments, list 11\n lines around the current line or continue the previous listing.\n With one argument, list 11 lines around at that line. With two\n arguments, list the given range; if the second argument is less\n than the first, it is interpreted as a count.\n\na(rgs)\n Print the argument list of the current function.\n\np(rint) *expression*\n Evaluate the *expression* in the current context and print its\n value.\n\npp *expression*\n Like the ``p`` command, except the value of the expression is\n pretty-printed using the ``pprint`` module.\n\nalias [*name* [command]]\n Creates an alias called *name* that executes *command*. The\n command must *not* be enclosed in quotes. Replaceable parameters\n can be indicated by ``%1``, ``%2``, and so on, while ``%*`` is\n replaced by all the parameters. If no command is given, the\n current alias for *name* is shown. If no arguments are given, all\n aliases are listed.\n\n Aliases may be nested and can contain anything that can be legally\n typed at the pdb prompt. Note that internal pdb commands *can* be\n overridden by aliases. Such a command is then hidden until the\n alias is removed. Aliasing is recursively applied to the first\n word of the command line; all other words in the line are left\n alone.\n\n As an example, here are two useful aliases (especially when placed\n in the ``.pdbrc`` file):\n\n #Print instance variables (usage "pi classInst")\n alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])\n #Print instance variables in self\n alias ps pi self\n\nunalias *name*\n Deletes the specified alias.\n\n[!]*statement*\n Execute the (one-line) *statement* in the context of the current\n stack frame. The exclamation point can be omitted unless the first\n word of the statement resembles a debugger command. To set a global\n variable, you can prefix the assignment command with a ``global``\n command on the same line, e.g.:\n\n (Pdb) global list_options; list_options = [\'-l\']\n (Pdb)\n\nrun [*args* ...]\n Restart the debugged Python program. If an argument is supplied, it\n is split with "shlex" and the result is used as the new sys.argv.\n History, breakpoints, actions and debugger options are preserved.\n "restart" is an alias for "run".\n\nq(uit)\n Quit from the debugger. The program being executed is aborted.\n\n-[ Footnotes ]-\n\n[1] Whether a frame is considered to originate in a certain module is\n determined by the ``__name__`` in the frame globals.\n',
- 'del': '\nThe ``del`` statement\n*********************\n\n del_stmt ::= "del" target_list\n\nDeletion is recursively defined very similar to the way assignment is\ndefined. Rather that spelling it out in full details, here are some\nhints.\n\nDeletion of a target list recursively deletes each target, from left\nto right.\n\nDeletion of a name removes the binding of that name from the local or\nglobal namespace, depending on whether the name occurs in a ``global``\nstatement in the same code block. If the name is unbound, a\n``NameError`` exception will be raised.\n\nIt is illegal to delete a name from the local namespace if it occurs\nas a free variable in a nested block.\n\nDeletion of attribute references, subscriptions and slicings is passed\nto the primary object involved; deletion of a slicing is in general\nequivalent to assignment of an empty slice of the right type (but even\nthis is determined by the sliced object).\n',
+ 'customization': '\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_info()[2]`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.last_traceback``. Circular references which are garbage are\n detected when the option cycle detector is enabled (it\'s on by\n default), but can only be cleaned up if there are no Python-\n level ``__del__()`` methods involved. Refer to the documentation\n for the ``gc`` module for more information about how\n ``__del__()`` methods are handled by the cycle detector,\n particularly the description of the ``garbage`` value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted or in the process of being torn down (e.g. the\n import machinery shutting down). For this reason, ``__del__()``\n methods should do the absolute minimum needed to maintain\n external invariants. Starting with version 1.5, Python\n guarantees that globals whose name begins with a single\n underscore are deleted from their module before other globals are\n deleted; if no other references to such globals exist, this may\n help in assuring that imported modules are still available at the\n time when the ``__del__()`` method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function to compute the\n "official" string representation of an object. If at all possible,\n this should look like a valid Python expression that could be used\n to recreate an object with the same value (given an appropriate\n environment). If this is not possible, a string of the form\n ``<...some useful description...>`` should be returned. The return\n value must be a string object. If a class defines ``__repr__()``\n but not ``__str__()``, then ``__repr__()`` is also used when an\n "informal" string representation of instances of that class is\n required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print()``\n function to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__format__(self, format_spec)\n\n Called by the ``format()`` built-in function (and by extension, the\n ``format()`` method of class ``str``) to produce a "formatted"\n string representation of an object. The ``format_spec`` argument is\n a string that contains a description of the formatting options\n desired. The interpretation of the ``format_spec`` argument is up\n to the type implementing ``__format__()``, however most classes\n will either delegate formatting to one of the built-in types, or\n use a similar formatting option syntax.\n\n See *Format Specification Mini-Language* for a description of the\n standard formatting syntax.\n\n The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n These are the so-called "rich comparison" methods. The\n correspondence between operator symbols and method names is as\n follows: ``x<y`` calls ``x.__lt__(y)``, ``x<=y`` calls\n ``x.__le__(y)``, ``x==y`` calls ``x.__eq__(y)``, ``x!=y`` calls\n ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and ``x>=y`` calls\n ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\n To automatically generate ordering operations from a single root\n operation, see ``functools.total_ordering()``.\n\nobject.__hash__(self)\n\n Called by built-in function ``hash()`` and for operations on\n members of hashed collections including ``set``, ``frozenset``, and\n ``dict``. ``__hash__()`` should return an integer. The only\n required property is that objects which compare equal have the same\n hash value; it is advised to somehow mix together (e.g. using\n exclusive or) the hash values for the components of the object that\n also play a part in comparison of objects.\n\n If a class does not define an ``__eq__()`` method it should not\n define a ``__hash__()`` operation either; if it defines\n ``__eq__()`` but not ``__hash__()``, its instances will not be\n usable as items in hashable collections. If a class defines\n mutable objects and implements an ``__eq__()`` method, it should\n not implement ``__hash__()``, since the implementation of hashable\n collections requires that a key\'s hash value is immutable (if the\n object\'s hash value changes, it will be in the wrong hash bucket).\n\n User-defined classes have ``__eq__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__eq__()`` such that the hash value\n returned is no longer appropriate (e.g. by switching to a value-\n based concept of equality instead of the default identity based\n equality) can explicitly flag themselves as being unhashable by\n setting ``__hash__ = None`` in the class definition. Doing so means\n that not only will instances of the class raise an appropriate\n ``TypeError`` when a program attempts to retrieve their hash value,\n but they will also be correctly identified as unhashable when\n checking ``isinstance(obj, collections.Hashable)`` (unlike classes\n which define their own ``__hash__()`` to explicitly raise\n ``TypeError``).\n\n If a class that overrides ``__eq__()`` needs to retain the\n implementation of ``__hash__()`` from a parent class, the\n interpreter must be told this explicitly by setting ``__hash__ =\n <ParentClass>.__hash__``. Otherwise the inheritance of\n ``__hash__()`` will be blocked, just as if ``__hash__`` had been\n explicitly set to ``None``.\n\nobject.__bool__(self)\n\n Called to implement truth value testing and the built-in operation\n ``bool()``; should return ``False`` or ``True``. When this method\n is not defined, ``__len__()`` is called, if it is defined, and the\n object is considered true if its result is nonzero. If a class\n defines neither ``__len__()`` nor ``__bool__()``, all its instances\n are considered true.\n',
+ 'debugger': '\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible -- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\nand ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > <string>(0)?()\n (Pdb) continue\n > <string>(1)?()\n (Pdb) continue\n NameError: \'spam\'\n > <string>(1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python3 -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nNew in version 3.2: ``pdb.py`` now accepts a ``-c`` option that\nexecutes commands as if given in a ``.pdbrc`` file, see *Debugger\nCommands*.\n\nThe typical usage to break into the debugger from a running program is\nto insert\n\n import pdb; pdb.set_trace()\n\nat the location you want to break into the debugger. You can then\nstep through the code following this statement, and continue running\nwithout the debugger using the ``continue`` command.\n\nThe typical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "<stdin>", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print(spam)\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print(spam)\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement, globals=None, locals=None)\n\n Execute the *statement* (given as a string or a code object) under\n debugger control. The debugger prompt appears before any code is\n executed; you can set breakpoints and type ``continue``, or you can\n step through the statement using ``step`` or ``next`` (all these\n commands are explained below). The optional *globals* and *locals*\n arguments specify the environment in which the code is executed; by\n default the dictionary of the module ``__main__`` is used. (See\n the explanation of the built-in ``exec()`` or ``eval()``\n functions.)\n\npdb.runeval(expression, globals=None, locals=None)\n\n Evaluate the *expression* (given as a string or a code object)\n under debugger control. When ``runeval()`` returns, it returns the\n value of the expression. Otherwise this function is similar to\n ``run()``.\n\npdb.runcall(function, *args, **kwds)\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem(traceback=None)\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n\nThe ``run*`` functions and ``set_trace()`` are aliases for\ninstantiating the ``Pdb`` class and calling the method of the same\nname. If you want to access further features, you have to do this\nyourself:\n\nclass class pdb.Pdb(completekey=\'tab\', stdin=None, stdout=None, skip=None, nosigint=False)\n\n ``Pdb`` is the debugger class.\n\n The *completekey*, *stdin* and *stdout* arguments are passed to the\n underlying ``cmd.Cmd`` class; see the description there.\n\n The *skip* argument, if given, must be an iterable of glob-style\n module name patterns. The debugger will not step into frames that\n originate in a module that matches one of these patterns. [1]\n\n By default, Pdb sets a handler for the SIGINT signal (which is sent\n when the user presses Ctrl-C on the console) when you give a\n ``continue`` command. This allows you to break into the debugger\n again by pressing Ctrl-C. If you want Pdb not to touch the SIGINT\n handler, set *nosigint* tot true.\n\n Example call to enable tracing with *skip*:\n\n import pdb; pdb.Pdb(skip=[\'django.*\']).set_trace()\n\n New in version 3.1: The *skip* argument.\n\n New in version 3.2: The *nosigint* argument. Previously, a SIGINT\n handler was never set by Pdb.\n\n run(statement, globals=None, locals=None)\n runeval(expression, globals=None, locals=None)\n runcall(function, *args, **kwds)\n set_trace()\n\n See the documentation for the functions explained above.\n\n\nDebugger Commands\n=================\n\nThe commands recognized by the debugger are listed below. Most\ncommands can be abbreviated to one or two letters as indicated; e.g.\n``h(elp)`` means that either ``h`` or ``help`` can be used to enter\nthe help command (but not ``he`` or ``hel``, nor ``H`` or ``Help`` or\n``HELP``). Arguments to commands must be separated by whitespace\n(spaces or tabs). Optional arguments are enclosed in square brackets\n(``[]``) in the command syntax; the square brackets must not be typed.\nAlternatives in the command syntax are separated by a vertical bar\n(``|``).\n\nEntering a blank line repeats the last command entered. Exception: if\nthe last command was a ``list`` command, the next 11 lines are listed.\n\nCommands that the debugger doesn\'t recognize are assumed to be Python\nstatements and are executed in the context of the program being\ndebugged. Python statements can also be prefixed with an exclamation\npoint (``!``). This is a powerful way to inspect the program being\ndebugged; it is even possible to change a variable or call a function.\nWhen an exception occurs in such a statement, the exception name is\nprinted but the debugger\'s state is not changed.\n\nThe debugger supports *aliases*. Aliases can have parameters which\nallows one a certain level of adaptability to the context under\nexamination.\n\nMultiple commands may be entered on a single line, separated by\n``;;``. (A single ``;`` is not used as it is the separator for\nmultiple commands in a line that is passed to the Python parser.) No\nintelligence is applied to separating the commands; the input is split\nat the first ``;;`` pair, even if it is in the middle of a quoted\nstring.\n\nIf a file ``.pdbrc`` exists in the user\'s home directory or in the\ncurrent directory, it is read in and executed as if it had been typed\nat the debugger prompt. This is particularly useful for aliases. If\nboth files exist, the one in the home directory is read first and\naliases defined there can be overridden by the local file.\n\nChanged in version 3.2: ``.pdbrc`` can now contain commands that\ncontinue debugging, such as ``continue`` or ``next``. Previously,\nthese commands had no effect.\n\nh(elp) [command]\n\n Without argument, print the list of available commands. With a\n *command* as argument, print help about that command. ``help pdb``\n displays the full documentation (the docstring of the ``pdb``\n module). Since the *command* argument must be an identifier,\n ``help exec`` must be entered to get help on the ``!`` command.\n\nw(here)\n\n Print a stack trace, with the most recent frame at the bottom. An\n arrow indicates the current frame, which determines the context of\n most commands.\n\nd(own) [count]\n\n Move the current frame *count* (default one) levels down in the\n stack trace (to a newer frame).\n\nu(p) [count]\n\n Move the current frame *count* (default one) levels up in the stack\n trace (to an older frame).\n\nb(reak) [([filename:]lineno | function) [, condition]]\n\n With a *lineno* argument, set a break there in the current file.\n With a *function* argument, set a break at the first executable\n statement within that function. The line number may be prefixed\n with a filename and a colon, to specify a breakpoint in another\n file (probably one that hasn\'t been loaded yet). The file is\n searched on ``sys.path``. Note that each breakpoint is assigned a\n number to which all the other breakpoint commands refer.\n\n If a second argument is present, it is an expression which must\n evaluate to true before the breakpoint is honored.\n\n Without argument, list all breaks, including for each breakpoint,\n the number of times that breakpoint has been hit, the current\n ignore count, and the associated condition if any.\n\ntbreak [([filename:]lineno | function) [, condition]]\n\n Temporary breakpoint, which is removed automatically when it is\n first hit. The arguments are the same as for ``break``.\n\ncl(ear) [filename:lineno | bpnumber [bpnumber ...]]\n\n With a *filename:lineno* argument, clear all the breakpoints at\n this line. With a space separated list of breakpoint numbers, clear\n those breakpoints. Without argument, clear all breaks (but first\n ask confirmation).\n\ndisable [bpnumber [bpnumber ...]]\n\n Disable the breakpoints given as a space separated list of\n breakpoint numbers. Disabling a breakpoint means it cannot cause\n the program to stop execution, but unlike clearing a breakpoint, it\n remains in the list of breakpoints and can be (re-)enabled.\n\nenable [bpnumber [bpnumber ...]]\n\n Enable the breakpoints specified.\n\nignore bpnumber [count]\n\n Set the ignore count for the given breakpoint number. If count is\n omitted, the ignore count is set to 0. A breakpoint becomes active\n when the ignore count is zero. When non-zero, the count is\n decremented each time the breakpoint is reached and the breakpoint\n is not disabled and any associated condition evaluates to true.\n\ncondition bpnumber [condition]\n\n Set a new *condition* for the breakpoint, an expression which must\n evaluate to true before the breakpoint is honored. If *condition*\n is absent, any existing condition is removed; i.e., the breakpoint\n is made unconditional.\n\ncommands [bpnumber]\n\n Specify a list of commands for breakpoint number *bpnumber*. The\n commands themselves appear on the following lines. Type a line\n containing just ``end`` to terminate the commands. An example:\n\n (Pdb) commands 1\n (com) print some_variable\n (com) end\n (Pdb)\n\n To remove all commands from a breakpoint, type commands and follow\n it immediately with ``end``; that is, give no commands.\n\n With no *bpnumber* argument, commands refers to the last breakpoint\n set.\n\n You can use breakpoint commands to start your program up again.\n Simply use the continue command, or step, or any other command that\n resumes execution.\n\n Specifying any command resuming execution (currently continue,\n step, next, return, jump, quit and their abbreviations) terminates\n the command list (as if that command was immediately followed by\n end). This is because any time you resume execution (even with a\n simple next or step), you may encounter another breakpoint--which\n could have its own command list, leading to ambiguities about which\n list to execute.\n\n If you use the \'silent\' command in the command list, the usual\n message about stopping at a breakpoint is not printed. This may be\n desirable for breakpoints that are to print a specific message and\n then continue. If none of the other commands print anything, you\n see no sign that the breakpoint was reached.\n\ns(tep)\n\n Execute the current line, stop at the first possible occasion\n (either in a function that is called or on the next line in the\n current function).\n\nn(ext)\n\n Continue execution until the next line in the current function is\n reached or it returns. (The difference between ``next`` and\n ``step`` is that ``step`` stops inside a called function, while\n ``next`` executes called functions at (nearly) full speed, only\n stopping at the next line in the current function.)\n\nunt(il) [lineno]\n\n Without argument, continue execution until the line with a number\n greater than the current one is reached.\n\n With a line number, continue execution until a line with a number\n greater or equal to that is reached. In both cases, also stop when\n the current frame returns.\n\n Changed in version 3.2: Allow giving an explicit line number.\n\nr(eturn)\n\n Continue execution until the current function returns.\n\nc(ont(inue))\n\n Continue execution, only stop when a breakpoint is encountered.\n\nj(ump) lineno\n\n Set the next line that will be executed. Only available in the\n bottom-most frame. This lets you jump back and execute code again,\n or jump forward to skip code that you don\'t want to run.\n\n It should be noted that not all jumps are allowed -- for instance\n it is not possible to jump into the middle of a ``for`` loop or out\n of a ``finally`` clause.\n\nl(ist) [first[, last]]\n\n List source code for the current file. Without arguments, list 11\n lines around the current line or continue the previous listing.\n With ``.`` as argument, list 11 lines around the current line.\n With one argument, list 11 lines around at that line. With two\n arguments, list the given range; if the second argument is less\n than the first, it is interpreted as a count.\n\n The current line in the current frame is indicated by ``->``. If\n an exception is being debugged, the line where the exception was\n originally raised or propagated is indicated by ``>>``, if it\n differs from the current line.\n\n New in version 3.2: The ``>>`` marker.\n\nll | longlist\n\n List all source code for the current function or frame.\n Interesting lines are marked as for ``list``.\n\n New in version 3.2.\n\na(rgs)\n\n Print the argument list of the current function.\n\np(rint) expression\n\n Evaluate the *expression* in the current context and print its\n value.\n\npp expression\n\n Like the ``print`` command, except the value of the expression is\n pretty-printed using the ``pprint`` module.\n\nwhatis expression\n\n Print the type of the *expression*.\n\nsource expression\n\n Try to get source code for the given object and display it.\n\n New in version 3.2.\n\ndisplay [expression]\n\n Display the value of the expression if it changed, each time\n execution stops in the current frame.\n\n Without expression, list all display expressions for the current\n frame.\n\n New in version 3.2.\n\nundisplay [expression]\n\n Do not display the expression any more in the current frame.\n Without expression, clear all display expressions for the current\n frame.\n\n New in version 3.2.\n\ninteract\n\n Start an interative interpreter (using the ``code`` module) whose\n global namespace contains all the (global and local) names found in\n the current scope.\n\n New in version 3.2.\n\nalias [name [command]]\n\n Create an alias called *name* that executes *command*. The command\n must *not* be enclosed in quotes. Replaceable parameters can be\n indicated by ``%1``, ``%2``, and so on, while ``%*`` is replaced by\n all the parameters. If no command is given, the current alias for\n *name* is shown. If no arguments are given, all aliases are listed.\n\n Aliases may be nested and can contain anything that can be legally\n typed at the pdb prompt. Note that internal pdb commands *can* be\n overridden by aliases. Such a command is then hidden until the\n alias is removed. Aliasing is recursively applied to the first\n word of the command line; all other words in the line are left\n alone.\n\n As an example, here are two useful aliases (especially when placed\n in the ``.pdbrc`` file):\n\n # Print instance variables (usage "pi classInst")\n alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])\n # Print instance variables in self\n alias ps pi self\n\nunalias name\n\n Delete the specified alias.\n\n! statement\n\n Execute the (one-line) *statement* in the context of the current\n stack frame. The exclamation point can be omitted unless the first\n word of the statement resembles a debugger command. To set a\n global variable, you can prefix the assignment command with a\n ``global`` statement on the same line, e.g.:\n\n (Pdb) global list_options; list_options = [\'-l\']\n (Pdb)\n\nrun [args ...]\nrestart [args ...]\n\n Restart the debugged Python program. If an argument is supplied,\n it is split with ``shlex`` and the result is used as the new\n ``sys.argv``. History, breakpoints, actions and debugger options\n are preserved. ``restart`` is an alias for ``run``.\n\nq(uit)\n\n Quit from the debugger. The program being executed is aborted.\n\n-[ Footnotes ]-\n\n[1] Whether a frame is considered to originate in a certain module is\n determined by the ``__name__`` in the frame globals.\n',
+ 'del': '\nThe ``del`` statement\n*********************\n\n del_stmt ::= "del" target_list\n\nDeletion is recursively defined very similar to the way assignment is\ndefined. Rather that spelling it out in full details, here are some\nhints.\n\nDeletion of a target list recursively deletes each target, from left\nto right.\n\nDeletion of a name removes the binding of that name from the local or\nglobal namespace, depending on whether the name occurs in a ``global``\nstatement in the same code block. If the name is unbound, a\n``NameError`` exception will be raised.\n\nDeletion of attribute references, subscriptions and slicings is passed\nto the primary object involved; deletion of a slicing is in general\nequivalent to assignment of an empty slice of the right type (but even\nthis is determined by the sliced object).\n\nChanged in version 3.2.\n',
'dict': '\nDictionary displays\n*******************\n\nA dictionary display is a possibly empty series of key/datum pairs\nenclosed in curly braces:\n\n dict_display ::= "{" [key_datum_list | dict_comprehension] "}"\n key_datum_list ::= key_datum ("," key_datum)* [","]\n key_datum ::= expression ":" expression\n dict_comprehension ::= expression ":" expression comp_for\n\nA dictionary display yields a new dictionary object.\n\nIf a comma-separated sequence of key/datum pairs is given, they are\nevaluated from left to right to define the entries of the dictionary:\neach key object is used as a key into the dictionary to store the\ncorresponding datum. This means that you can specify the same key\nmultiple times in the key/datum list, and the final dictionary\'s value\nfor that key will be the last one given.\n\nA dict comprehension, in contrast to list and set comprehensions,\nneeds two expressions separated with a colon followed by the usual\n"for" and "if" clauses. When the comprehension is run, the resulting\nkey and value elements are inserted in the new dictionary in the order\nthey are produced.\n\nRestrictions on the types of the key values are listed earlier in\nsection *The standard type hierarchy*. (To summarize, the key type\nshould be *hashable*, which excludes all mutable objects.) Clashes\nbetween duplicate keys are not detected; the last datum (textually\nrightmost in the display) stored for a given key value prevails.\n',
'dynamic-features': '\nInteraction with dynamic features\n*********************************\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nThe ``eval()`` and ``exec()`` functions do not have access to the full\nenvironment for resolving names. Names may be resolved in the local\nand global namespaces of the caller. Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace. [1]\nThe ``exec()`` and ``eval()`` functions have optional arguments to\noverride the global and local namespace. If only one namespace is\nspecified, it is used for both.\n',
'else': '\nThe ``if`` statement\n********************\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n',
'exceptions': '\nExceptions\n**********\n\nExceptions are a means of breaking out of the normal flow of control\nof a code block in order to handle errors or other exceptional\nconditions. An exception is *raised* at the point where the error is\ndetected; it may be *handled* by the surrounding code block or by any\ncode block that directly or indirectly invoked the code block where\nthe error occurred.\n\nThe Python interpreter raises an exception when it detects a run-time\nerror (such as division by zero). A Python program can also\nexplicitly raise an exception with the ``raise`` statement. Exception\nhandlers are specified with the ``try`` ... ``except`` statement. The\n``finally`` clause of such a statement can be used to specify cleanup\ncode which does not handle the exception, but is executed whether an\nexception occurred or not in the preceding code.\n\nPython uses the "termination" model of error handling: an exception\nhandler can find out what happened and continue execution at an outer\nlevel, but it cannot repair the cause of the error and retry the\nfailing operation (except by re-entering the offending piece of code\nfrom the top).\n\nWhen an exception is not handled at all, the interpreter terminates\nexecution of the program, or returns to its interactive main loop. In\neither case, it prints a stack backtrace, except when the exception is\n``SystemExit``.\n\nExceptions are identified by class instances. The ``except`` clause\nis selected depending on the class of the instance: it must reference\nthe class of the instance or a base class thereof. The instance can\nbe received by the handler and can carry additional information about\nthe exceptional condition.\n\nNote: Exception messages are not part of the Python API. Their contents\n may change from one version of Python to the next without warning\n and should not be relied on by code which will run under multiple\n versions of the interpreter.\n\nSee also the description of the ``try`` statement in section *The try\nstatement* and ``raise`` statement in section *The raise statement*.\n\n-[ Footnotes ]-\n\n[1] This limitation occurs because the code that is executed by these\n operations is not available at the time the module is compiled.\n',
- 'execmodel': '\nExecution model\n***************\n\n\nNaming and binding\n==================\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block. The string argument passed\nto the built-in functions ``eval()`` and ``exec()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes comprehensions and generator\nexpressions since they are implemented using a function scope. This\nmeans that the following will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block,\nunless declared as ``nonlocal``. If a name is bound at the module\nlevel, it is a global variable. (The variables of the module code\nblock are local and global.) If a variable is used in a code block\nbut not defined there, it is a *free variable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, or\nafter ``as`` in a ``with`` statement or ``except`` clause. The\n``import`` statement of the form ``from ... import *`` binds all names\ndefined in the imported module, except those beginning with an\nunderscore. This form may only be used at the module level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name). It\nis illegal to unbind a name that is referenced by an enclosing scope;\nthe compiler will report a ``SyntaxError``.\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the ``global`` statement occurs within a block, all uses of the\nname specified in the statement refer to the binding of that name in\nthe top-level namespace. Names are resolved in the top-level\nnamespace by searching the global namespace, i.e. the namespace of the\nmodule containing the code block, and the builtins namespace, the\nnamespace of the module ``builtins``. The global namespace is\nsearched first. If the name is not found there, the builtins\nnamespace is searched. The global statement must precede all uses of\nthe name.\n\nThe builtins namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module\'s dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``builtins``; when in any other module, ``__builtins__`` is an alias\nfor the dictionary of the ``builtins`` module itself.\n``__builtins__`` can be set to a user-created dictionary to create a\nweak form of restricted execution.\n\n**CPython implementation detail:** Users should not touch\n``__builtins__``; it is strictly an implementation detail. Users\nwanting to override values in the builtins namespace should ``import``\nthe ``builtins`` module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe ``global`` statement has the same scope as a name binding\noperation in the same block. If the nearest enclosing scope for a\nfree variable contains a global statement, the free variable is\ntreated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n---------------------------------\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nThe ``eval()`` and ``exec()`` functions do not have access to the full\nenvironment for resolving names. Names may be resolved in the local\nand global namespaces of the caller. Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace. [1]\nThe ``exec()`` and ``eval()`` functions have optional arguments to\noverride the global and local namespace. If only one namespace is\nspecified, it is used for both.\n\n\nExceptions\n==========\n\nExceptions are a means of breaking out of the normal flow of control\nof a code block in order to handle errors or other exceptional\nconditions. An exception is *raised* at the point where the error is\ndetected; it may be *handled* by the surrounding code block or by any\ncode block that directly or indirectly invoked the code block where\nthe error occurred.\n\nThe Python interpreter raises an exception when it detects a run-time\nerror (such as division by zero). A Python program can also\nexplicitly raise an exception with the ``raise`` statement. Exception\nhandlers are specified with the ``try`` ... ``except`` statement. The\n``finally`` clause of such a statement can be used to specify cleanup\ncode which does not handle the exception, but is executed whether an\nexception occurred or not in the preceding code.\n\nPython uses the "termination" model of error handling: an exception\nhandler can find out what happened and continue execution at an outer\nlevel, but it cannot repair the cause of the error and retry the\nfailing operation (except by re-entering the offending piece of code\nfrom the top).\n\nWhen an exception is not handled at all, the interpreter terminates\nexecution of the program, or returns to its interactive main loop. In\neither case, it prints a stack backtrace, except when the exception is\n``SystemExit``.\n\nExceptions are identified by class instances. The ``except`` clause\nis selected depending on the class of the instance: it must reference\nthe class of the instance or a base class thereof. The instance can\nbe received by the handler and can carry additional information about\nthe exceptional condition.\n\nNote: Exception messages are not part of the Python API. Their contents\n may change from one version of Python to the next without warning\n and should not be relied on by code which will run under multiple\n versions of the interpreter.\n\nSee also the description of the ``try`` statement in section *The try\nstatement* and ``raise`` statement in section *The raise statement*.\n\n-[ Footnotes ]-\n\n[1] This limitation occurs because the code that is executed by these\n operations is not available at the time the module is compiled.\n',
+ 'execmodel': '\nExecution model\n***************\n\n\nNaming and binding\n==================\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block. The string argument passed\nto the built-in functions ``eval()`` and ``exec()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes comprehensions and generator\nexpressions since they are implemented using a function scope. This\nmeans that the following will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block,\nunless declared as ``nonlocal``. If a name is bound at the module\nlevel, it is a global variable. (The variables of the module code\nblock are local and global.) If a variable is used in a code block\nbut not defined there, it is a *free variable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, or\nafter ``as`` in a ``with`` statement or ``except`` clause. The\n``import`` statement of the form ``from ... import *`` binds all names\ndefined in the imported module, except those beginning with an\nunderscore. This form may only be used at the module level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name).\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the ``global`` statement occurs within a block, all uses of the\nname specified in the statement refer to the binding of that name in\nthe top-level namespace. Names are resolved in the top-level\nnamespace by searching the global namespace, i.e. the namespace of the\nmodule containing the code block, and the builtins namespace, the\nnamespace of the module ``builtins``. The global namespace is\nsearched first. If the name is not found there, the builtins\nnamespace is searched. The global statement must precede all uses of\nthe name.\n\nThe builtins namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module\'s dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``builtins``; when in any other module, ``__builtins__`` is an alias\nfor the dictionary of the ``builtins`` module itself.\n``__builtins__`` can be set to a user-created dictionary to create a\nweak form of restricted execution.\n\n**CPython implementation detail:** Users should not touch\n``__builtins__``; it is strictly an implementation detail. Users\nwanting to override values in the builtins namespace should ``import``\nthe ``builtins`` module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe ``global`` statement has the same scope as a name binding\noperation in the same block. If the nearest enclosing scope for a\nfree variable contains a global statement, the free variable is\ntreated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n---------------------------------\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nThe ``eval()`` and ``exec()`` functions do not have access to the full\nenvironment for resolving names. Names may be resolved in the local\nand global namespaces of the caller. Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace. [1]\nThe ``exec()`` and ``eval()`` functions have optional arguments to\noverride the global and local namespace. If only one namespace is\nspecified, it is used for both.\n\n\nExceptions\n==========\n\nExceptions are a means of breaking out of the normal flow of control\nof a code block in order to handle errors or other exceptional\nconditions. An exception is *raised* at the point where the error is\ndetected; it may be *handled* by the surrounding code block or by any\ncode block that directly or indirectly invoked the code block where\nthe error occurred.\n\nThe Python interpreter raises an exception when it detects a run-time\nerror (such as division by zero). A Python program can also\nexplicitly raise an exception with the ``raise`` statement. Exception\nhandlers are specified with the ``try`` ... ``except`` statement. The\n``finally`` clause of such a statement can be used to specify cleanup\ncode which does not handle the exception, but is executed whether an\nexception occurred or not in the preceding code.\n\nPython uses the "termination" model of error handling: an exception\nhandler can find out what happened and continue execution at an outer\nlevel, but it cannot repair the cause of the error and retry the\nfailing operation (except by re-entering the offending piece of code\nfrom the top).\n\nWhen an exception is not handled at all, the interpreter terminates\nexecution of the program, or returns to its interactive main loop. In\neither case, it prints a stack backtrace, except when the exception is\n``SystemExit``.\n\nExceptions are identified by class instances. The ``except`` clause\nis selected depending on the class of the instance: it must reference\nthe class of the instance or a base class thereof. The instance can\nbe received by the handler and can carry additional information about\nthe exceptional condition.\n\nNote: Exception messages are not part of the Python API. Their contents\n may change from one version of Python to the next without warning\n and should not be relied on by code which will run under multiple\n versions of the interpreter.\n\nSee also the description of the ``try`` statement in section *The try\nstatement* and ``raise`` statement in section *The raise statement*.\n\n-[ Footnotes ]-\n\n[1] This limitation occurs because the code that is executed by these\n operations is not available at the time the module is compiled.\n',
'exprlists': '\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n',
'floating': '\nFloating point literals\n***********************\n\nFloating point literals are described by the following lexical\ndefinitions:\n\n floatnumber ::= pointfloat | exponentfloat\n pointfloat ::= [intpart] fraction | intpart "."\n exponentfloat ::= (intpart | pointfloat) exponent\n intpart ::= digit+\n fraction ::= "." digit+\n exponent ::= ("e" | "E") ["+" | "-"] digit+\n\nNote that the integer and exponent parts are always interpreted using\nradix 10. For example, ``077e010`` is legal, and denotes the same\nnumber as ``77e10``. The allowed range of floating point literals is\nimplementation-dependent. Some examples of floating point literals:\n\n 3.14 10. .001 1e100 3.14e-10 0e0\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator ``-`` and the\nliteral ``1``.\n',
'for': '\nThe ``for`` statement\n*********************\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted. When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a ``StopIteration``\nexception), the suite in the ``else`` clause, if present, is executed,\nand the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop. Hint: the built-in function ``range()`` returns an\niterator of integers suitable to emulate the effect of Pascal\'s ``for\ni := a to b do``; e.g., ``list(range(3))`` returns the list ``[0, 1,\n2]``.\n\nNote: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An\n internal counter is used to keep track of which item is used next,\n and this is incremented on each iteration. When this counter has\n reached the length of the sequence the loop terminates. This means\n that if the suite deletes the current (or a previous) item from the\n sequence, the next item will be skipped (since it gets the index of\n the current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n',
- 'formatstrings': '\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax).\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"\n field_name ::= arg_name ("." attribute_name | "[" element_index "]")*\n arg_name ::= [identifier | integer]\n attribute_name ::= identifier\n element_index ::= integer | index_string\n index_string ::= <any source character except "]"> +\n conversion ::= "r" | "s" | "a"\n format_spec ::= <described in the next section>\n\nIn less formal terms, the replacement field can start with a\n*field_name* that specifies the object whose value is to be formatted\nand inserted into the output instead of the replacement field. The\n*field_name* is optionally followed by a *conversion* field, which is\npreceded by an exclamation point ``\'!\'``, and a *format_spec*, which\nis preceded by a colon ``\':\'``. These specify a non-default format\nfor the replacement value.\n\nSee also the *Format Specification Mini-Language* section.\n\nThe *field_name* itself begins with an *arg_name* that is either\neither a number or a keyword. If it\'s a number, it refers to a\npositional argument, and if it\'s a keyword, it refers to a named\nkeyword argument. If the numerical arg_names in a format string are\n0, 1, 2, ... in sequence, they can all be omitted (not just some) and\nthe numbers 0, 1, 2, ... will be automatically inserted in that order.\nThe *arg_name* can be followed by any number of index or attribute\nexpressions. An expression of the form ``\'.name\'`` selects the named\nattribute using ``getattr()``, while an expression of the form\n``\'[index]\'`` does an index lookup using ``__getitem__()``.\n\nChanged in version 3.1: The positional argument specifiers can be\nomitted, so ``\'{} {}\'`` is equivalent to ``\'{0} {1}\'``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "Bring me a {}" # Implicitly references the first positional argument\n "From {} to {}" # Same as "From {0} to {1}"\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nThree conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, ``\'!r\'`` which calls ``repr()`` and ``\'!a\'``\nwhich calls ``ascii()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n "More {!a}" # Calls ascii() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define its\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nSee the *Format examples* section for some examples.\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*). They can also be passed directly to the\nbuilt-in ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value. A non-\nempty format string typically modifies the result.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]\n fill ::= <a character other than \'}\'>\n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'{\' or \'}\'. The\npresence of a fill character is signaled by the character following\nit, which must be one of the alignment options. If the second\ncharacter of *format_spec* is not a valid alignment option, then it is\nassumed that both the fill character and the alignment option are\nabsent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (this is the default for most objects). |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space (this is the default for numbers). |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\nThe ``\',\'`` option signals the use of a comma for a thousands\nseparator. For a locale aware separator, use the ``\'n\'`` integer\npresentation type instead.\n\nChanged in version 3.1: Added the ``\',\'`` option (see also **PEP\n378**).\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is not allowed for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available string presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'s\'`` | String format. This is the default type for strings and |\n | | may be omitted. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'s\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nIn addition to the above presentation types, integers can be formatted\nwith the floating point presentation types listed below (except\n``\'n\'`` and None). When doing so, ``float()`` is used to convert the\ninteger to a floating point number before formatting.\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``, but converts ``nan`` to |\n | | ``NAN`` and ``inf`` to ``INF``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. For a given precision ``p >= 1``, this |\n | | rounds the number to ``p`` significant digits and then |\n | | formats the result in either fixed-point format or in |\n | | scientific notation, depending on its magnitude. The |\n | | precise rules are as follows: suppose that the result |\n | | formatted with presentation type ``\'e\'`` and precision |\n | | ``p-1`` would have exponent ``exp``. Then if ``-4 <= exp |\n | | < p``, the number is formatted with presentation type |\n | | ``\'f\'`` and precision ``p-1-exp``. Otherwise, the number |\n | | is formatted with presentation type ``\'e\'`` and precision |\n | | ``p-1``. In both cases insignificant trailing zeros are |\n | | removed from the significand, and the decimal point is |\n | | also removed if there are no remaining digits following |\n | | it. Positive and negative infinity, positive and negative |\n | | zero, and nans, are formatted as ``inf``, ``-inf``, ``0``, |\n | | ``-0`` and ``nan`` respectively, regardless of the |\n | | precision. A precision of ``0`` is treated as equivalent |\n | | to a precision of ``1``. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets too large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | Similar to ``\'g\'``, except with at least one digit past |\n | | the decimal point and a default precision of 12. This is |\n | | intended to match ``str()``, except you can add the other |\n | | format modifiers. |\n +-----------+------------------------------------------------------------+\n\n\nFormat examples\n===============\n\nThis section contains examples of the new format syntax and comparison\nwith the old ``%``-formatting.\n\nIn most of the cases the syntax is similar to the old\n``%``-formatting, with the addition of the ``{}`` and with ``:`` used\ninstead of ``%``. For example, ``\'%03.2f\'`` can be translated to\n``\'{:03.2f}\'``.\n\nThe new format syntax also supports new and different options, shown\nin the follow examples.\n\nAccessing arguments by position:\n\n >>> \'{0}, {1}, {2}\'.format(\'a\', \'b\', \'c\')\n \'a, b, c\'\n >>> \'{}, {}, {}\'.format(\'a\', \'b\', \'c\') # 3.1+ only\n \'a, b, c\'\n >>> \'{2}, {1}, {0}\'.format(\'a\', \'b\', \'c\')\n \'c, b, a\'\n >>> \'{2}, {1}, {0}\'.format(*\'abc\') # unpacking argument sequence\n \'c, b, a\'\n >>> \'{0}{1}{0}\'.format(\'abra\', \'cad\') # arguments\' indices can be repeated\n \'abracadabra\'\n\nAccessing arguments by name:\n\n >>> \'Coordinates: {latitude}, {longitude}\'.format(latitude=\'37.24N\', longitude=\'-115.81W\')\n \'Coordinates: 37.24N, -115.81W\'\n >>> coord = {\'latitude\': \'37.24N\', \'longitude\': \'-115.81W\'}\n >>> \'Coordinates: {latitude}, {longitude}\'.format(**coord)\n \'Coordinates: 37.24N, -115.81W\'\n\nAccessing arguments\' attributes:\n\n >>> c = 3-5j\n >>> (\'The complex number {0} is formed from the real part {0.real} \'\n ... \'and the imaginary part {0.imag}.\').format(c)\n \'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.\'\n >>> class Point:\n ... def __init__(self, x, y):\n ... self.x, self.y = x, y\n ... def __str__(self):\n ... return \'Point({self.x}, {self.y})\'.format(self=self)\n ...\n >>> str(Point(4, 2))\n \'Point(4, 2)\'\n\nAccessing arguments\' items:\n\n >>> coord = (3, 5)\n >>> \'X: {0[0]}; Y: {0[1]}\'.format(coord)\n \'X: 3; Y: 5\'\n\nReplacing ``%s`` and ``%r``:\n\n >>> "repr() shows quotes: {!r}; str() doesn\'t: {!s}".format(\'test1\', \'test2\')\n "repr() shows quotes: \'test1\'; str() doesn\'t: test2"\n\nAligning the text and specifying a width:\n\n >>> \'{:<30}\'.format(\'left aligned\')\n \'left aligned \'\n >>> \'{:>30}\'.format(\'right aligned\')\n \' right aligned\'\n >>> \'{:^30}\'.format(\'centered\')\n \' centered \'\n >>> \'{:*^30}\'.format(\'centered\') # use \'*\' as a fill char\n \'***********centered***********\'\n\nReplacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign:\n\n >>> \'{:+f}; {:+f}\'.format(3.14, -3.14) # show it always\n \'+3.140000; -3.140000\'\n >>> \'{: f}; {: f}\'.format(3.14, -3.14) # show a space for positive numbers\n \' 3.140000; -3.140000\'\n >>> \'{:-f}; {:-f}\'.format(3.14, -3.14) # show only the minus -- same as \'{:f}; {:f}\'\n \'3.140000; -3.140000\'\n\nReplacing ``%x`` and ``%o`` and converting the value to different\nbases:\n\n >>> # format also supports binary numbers\n >>> "int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}".format(42)\n \'int: 42; hex: 2a; oct: 52; bin: 101010\'\n >>> # with 0x, 0o, or 0b as prefix:\n >>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".format(42)\n \'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010\'\n\nUsing the comma as a thousands separator:\n\n >>> \'{:,}\'.format(1234567890)\n \'1,234,567,890\'\n\nExpressing a percentage:\n\n >>> points = 19\n >>> total = 22\n >>> \'Correct answers: {:.2%}.\'.format(points/total)\n \'Correct answers: 86.36%\'\n\nUsing type-specific formatting:\n\n >>> import datetime\n >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n >>> \'{:%Y-%m-%d %H:%M:%S}\'.format(d)\n \'2010-07-04 12:15:58\'\n\nNesting arguments and more complex examples:\n\n >>> for align, text in zip(\'<^>\', [\'left\', \'center\', \'right\']):\n ... \'{0:{fill}{align}16}\'.format(text, fill=align, align=align)\n ...\n \'left<<<<<<<<<<<<\'\n \'^^^^^center^^^^^\'\n \'>>>>>>>>>>>right\'\n >>>\n >>> octets = [192, 168, 0, 1]\n >>> \'{:02X}{:02X}{:02X}{:02X}\'.format(*octets)\n \'C0A80001\'\n >>> int(_, 16)\n 3232235521\n >>>\n >>> width = 5\n >>> for num in range(5,12):\n ... for base in \'dXob\':\n ... print(\'{0:{width}{base}}\'.format(num, base=base, width=width), end=\' \')\n ... print()\n ...\n 5 5 5 101\n 6 6 6 110\n 7 7 7 111\n 8 8 10 1000\n 9 9 11 1001\n 10 A 12 1010\n 11 B 13 1011\n',
+ 'formatstrings': '\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax).\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"\n field_name ::= arg_name ("." attribute_name | "[" element_index "]")*\n arg_name ::= [identifier | integer]\n attribute_name ::= identifier\n element_index ::= integer | index_string\n index_string ::= <any source character except "]"> +\n conversion ::= "r" | "s" | "a"\n format_spec ::= <described in the next section>\n\nIn less formal terms, the replacement field can start with a\n*field_name* that specifies the object whose value is to be formatted\nand inserted into the output instead of the replacement field. The\n*field_name* is optionally followed by a *conversion* field, which is\npreceded by an exclamation point ``\'!\'``, and a *format_spec*, which\nis preceded by a colon ``\':\'``. These specify a non-default format\nfor the replacement value.\n\nSee also the *Format Specification Mini-Language* section.\n\nThe *field_name* itself begins with an *arg_name* that is either\neither a number or a keyword. If it\'s a number, it refers to a\npositional argument, and if it\'s a keyword, it refers to a named\nkeyword argument. If the numerical arg_names in a format string are\n0, 1, 2, ... in sequence, they can all be omitted (not just some) and\nthe numbers 0, 1, 2, ... will be automatically inserted in that order.\nThe *arg_name* can be followed by any number of index or attribute\nexpressions. An expression of the form ``\'.name\'`` selects the named\nattribute using ``getattr()``, while an expression of the form\n``\'[index]\'`` does an index lookup using ``__getitem__()``.\n\nChanged in version 3.1: The positional argument specifiers can be\nomitted, so ``\'{} {}\'`` is equivalent to ``\'{0} {1}\'``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "Bring me a {}" # Implicitly references the first positional argument\n "From {} to {}" # Same as "From {0} to {1}"\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nThree conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, ``\'!r\'`` which calls ``repr()`` and ``\'!a\'``\nwhich calls ``ascii()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n "More {!a}" # Calls ascii() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define its\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nSee the *Format examples* section for some examples.\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*). They can also be passed directly to the\nbuilt-in ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value. A non-\nempty format string typically modifies the result.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]\n fill ::= <a character other than \'}\'>\n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'{\' or \'}\'. The\npresence of a fill character is signaled by the character following\nit, which must be one of the alignment options. If the second\ncharacter of *format_spec* is not a valid alignment option, then it is\nassumed that both the fill character and the alignment option are\nabsent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (this is the default for most objects). |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space (this is the default for numbers). |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option causes the "alternate form" to be used for the\nconversion. The alternate form is defined differently for different\ntypes. This option is only valid for integer, float, complex and\nDecimal types. For integers, when binary, octal, or hexadecimal output\nis used, this option adds the prefix respective ``\'0b\'``, ``\'0o\'``, or\n``\'0x\'`` to the output value. For floats, complex and Decimal the\nalternate form causes the result of the conversion to always contain a\ndecimal-point character, even if no digits follow it. Normally, a\ndecimal-point character appears in the result of these conversions\nonly if a digit follows it. In addition, for ``\'g\'`` and ``\'G\'``\nconversions, trailing zeros are not removed from the result.\n\nThe ``\',\'`` option signals the use of a comma for a thousands\nseparator. For a locale aware separator, use the ``\'n\'`` integer\npresentation type instead.\n\nChanged in version 3.1: Added the ``\',\'`` option (see also **PEP\n378**).\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is not allowed for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available string presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'s\'`` | String format. This is the default type for strings and |\n | | may be omitted. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'s\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nIn addition to the above presentation types, integers can be formatted\nwith the floating point presentation types listed below (except\n``\'n\'`` and None). When doing so, ``float()`` is used to convert the\ninteger to a floating point number before formatting.\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``, but converts ``nan`` to |\n | | ``NAN`` and ``inf`` to ``INF``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. For a given precision ``p >= 1``, this |\n | | rounds the number to ``p`` significant digits and then |\n | | formats the result in either fixed-point format or in |\n | | scientific notation, depending on its magnitude. The |\n | | precise rules are as follows: suppose that the result |\n | | formatted with presentation type ``\'e\'`` and precision |\n | | ``p-1`` would have exponent ``exp``. Then if ``-4 <= exp |\n | | < p``, the number is formatted with presentation type |\n | | ``\'f\'`` and precision ``p-1-exp``. Otherwise, the number |\n | | is formatted with presentation type ``\'e\'`` and precision |\n | | ``p-1``. In both cases insignificant trailing zeros are |\n | | removed from the significand, and the decimal point is |\n | | also removed if there are no remaining digits following |\n | | it. Positive and negative infinity, positive and negative |\n | | zero, and nans, are formatted as ``inf``, ``-inf``, ``0``, |\n | | ``-0`` and ``nan`` respectively, regardless of the |\n | | precision. A precision of ``0`` is treated as equivalent |\n | | to a precision of ``1``. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets too large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | Similar to ``\'g\'``, except with at least one digit past |\n | | the decimal point and a default precision of 12. This is |\n | | intended to match ``str()``, except you can add the other |\n | | format modifiers. |\n +-----------+------------------------------------------------------------+\n\n\nFormat examples\n===============\n\nThis section contains examples of the new format syntax and comparison\nwith the old ``%``-formatting.\n\nIn most of the cases the syntax is similar to the old\n``%``-formatting, with the addition of the ``{}`` and with ``:`` used\ninstead of ``%``. For example, ``\'%03.2f\'`` can be translated to\n``\'{:03.2f}\'``.\n\nThe new format syntax also supports new and different options, shown\nin the follow examples.\n\nAccessing arguments by position:\n\n >>> \'{0}, {1}, {2}\'.format(\'a\', \'b\', \'c\')\n \'a, b, c\'\n >>> \'{}, {}, {}\'.format(\'a\', \'b\', \'c\') # 3.1+ only\n \'a, b, c\'\n >>> \'{2}, {1}, {0}\'.format(\'a\', \'b\', \'c\')\n \'c, b, a\'\n >>> \'{2}, {1}, {0}\'.format(*\'abc\') # unpacking argument sequence\n \'c, b, a\'\n >>> \'{0}{1}{0}\'.format(\'abra\', \'cad\') # arguments\' indices can be repeated\n \'abracadabra\'\n\nAccessing arguments by name:\n\n >>> \'Coordinates: {latitude}, {longitude}\'.format(latitude=\'37.24N\', longitude=\'-115.81W\')\n \'Coordinates: 37.24N, -115.81W\'\n >>> coord = {\'latitude\': \'37.24N\', \'longitude\': \'-115.81W\'}\n >>> \'Coordinates: {latitude}, {longitude}\'.format(**coord)\n \'Coordinates: 37.24N, -115.81W\'\n\nAccessing arguments\' attributes:\n\n >>> c = 3-5j\n >>> (\'The complex number {0} is formed from the real part {0.real} \'\n ... \'and the imaginary part {0.imag}.\').format(c)\n \'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.\'\n >>> class Point:\n ... def __init__(self, x, y):\n ... self.x, self.y = x, y\n ... def __str__(self):\n ... return \'Point({self.x}, {self.y})\'.format(self=self)\n ...\n >>> str(Point(4, 2))\n \'Point(4, 2)\'\n\nAccessing arguments\' items:\n\n >>> coord = (3, 5)\n >>> \'X: {0[0]}; Y: {0[1]}\'.format(coord)\n \'X: 3; Y: 5\'\n\nReplacing ``%s`` and ``%r``:\n\n >>> "repr() shows quotes: {!r}; str() doesn\'t: {!s}".format(\'test1\', \'test2\')\n "repr() shows quotes: \'test1\'; str() doesn\'t: test2"\n\nAligning the text and specifying a width:\n\n >>> \'{:<30}\'.format(\'left aligned\')\n \'left aligned \'\n >>> \'{:>30}\'.format(\'right aligned\')\n \' right aligned\'\n >>> \'{:^30}\'.format(\'centered\')\n \' centered \'\n >>> \'{:*^30}\'.format(\'centered\') # use \'*\' as a fill char\n \'***********centered***********\'\n\nReplacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign:\n\n >>> \'{:+f}; {:+f}\'.format(3.14, -3.14) # show it always\n \'+3.140000; -3.140000\'\n >>> \'{: f}; {: f}\'.format(3.14, -3.14) # show a space for positive numbers\n \' 3.140000; -3.140000\'\n >>> \'{:-f}; {:-f}\'.format(3.14, -3.14) # show only the minus -- same as \'{:f}; {:f}\'\n \'3.140000; -3.140000\'\n\nReplacing ``%x`` and ``%o`` and converting the value to different\nbases:\n\n >>> # format also supports binary numbers\n >>> "int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}".format(42)\n \'int: 42; hex: 2a; oct: 52; bin: 101010\'\n >>> # with 0x, 0o, or 0b as prefix:\n >>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".format(42)\n \'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010\'\n\nUsing the comma as a thousands separator:\n\n >>> \'{:,}\'.format(1234567890)\n \'1,234,567,890\'\n\nExpressing a percentage:\n\n >>> points = 19\n >>> total = 22\n >>> \'Correct answers: {:.2%}.\'.format(points/total)\n \'Correct answers: 86.36%\'\n\nUsing type-specific formatting:\n\n >>> import datetime\n >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n >>> \'{:%Y-%m-%d %H:%M:%S}\'.format(d)\n \'2010-07-04 12:15:58\'\n\nNesting arguments and more complex examples:\n\n >>> for align, text in zip(\'<^>\', [\'left\', \'center\', \'right\']):\n ... \'{0:{fill}{align}16}\'.format(text, fill=align, align=align)\n ...\n \'left<<<<<<<<<<<<\'\n \'^^^^^center^^^^^\'\n \'>>>>>>>>>>>right\'\n >>>\n >>> octets = [192, 168, 0, 1]\n >>> \'{:02X}{:02X}{:02X}{:02X}\'.format(*octets)\n \'C0A80001\'\n >>> int(_, 16)\n 3232235521\n >>>\n >>> width = 5\n >>> for num in range(5,12):\n ... for base in \'dXob\':\n ... print(\'{0:{width}{base}}\'.format(num, base=base, width=width), end=\' \')\n ... print()\n ...\n 5 5 5 101\n 6 6 6 110\n 7 7 7 111\n 8 8 10 1000\n 9 9 11 1001\n 10 A 12 1010\n 11 B 13 1011\n',
'function': '\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n funcdef ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" [parameter] ("," defparameter)*\n [, "**" parameter]\n | "**" parameter\n | defparameter [","] )\n parameter ::= identifier [":" expression]\n defparameter ::= parameter ["=" expression]\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters up until the "``*``" must also have a default value ---\nthis is a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after "``*``" or "``*identifier``" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "``: expression``"\nfollowing the parameter name. Any parameter may have an annotation\neven those of the form ``*identifier`` or ``**identifier``. Functions\nmay have "return" annotation of the form "``-> expression``" after the\nparameter list. These annotations can be any valid Python expression\nand are evaluated when the function definition is executed.\nAnnotations may be evaluated in a different order than they appear in\nthe source code. The presence of annotations does not change the\nsemantics of a function. The annotation values are available as\nvalues of a dictionary keyed by the parameters\' names in the\n``__annotations__`` attribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Lambdas*. Note that the lambda form is merely a\nshorthand for a simplified function definition; a function defined in\na "``def``" statement can be passed around or assigned to another name\njust like a function defined by a lambda form. The "``def``" form is\nactually more powerful since it allows the execution of multiple\nstatements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n',
- 'global': '\nThe ``global`` statement\n************************\n\n global_stmt ::= "global" identifier ("," identifier)*\n\nThe ``global`` statement is a declaration which holds for the entire\ncurrent code block. It means that the listed identifiers are to be\ninterpreted as globals. It would be impossible to assign to a global\nvariable without ``global``, although free variables may refer to\nglobals without being declared global.\n\nNames listed in a ``global`` statement must not be used in the same\ncode block textually preceding that ``global`` statement.\n\nNames listed in a ``global`` statement must not be defined as formal\nparameters or in a ``for`` loop control target, ``class`` definition,\nfunction definition, or ``import`` statement.\n\n**CPython implementation detail:** The current implementation does not\nenforce the latter two restrictions, but programs should not abuse\nthis freedom, as future implementations may enforce them or silently\nchange the meaning of the program.\n\n**Programmer\'s note:** the ``global`` is a directive to the parser.\nIt applies only to code parsed at the same time as the ``global``\nstatement. In particular, a ``global`` statement contained in a string\nor code object supplied to the builtin ``exec()`` function does not\naffect the code block *containing* the function call, and code\ncontained in such a string is unaffected by ``global`` statements in\nthe code containing the function call. The same applies to the\n``eval()`` and ``compile()`` functions.\n',
+ 'global': '\nThe ``global`` statement\n************************\n\n global_stmt ::= "global" identifier ("," identifier)*\n\nThe ``global`` statement is a declaration which holds for the entire\ncurrent code block. It means that the listed identifiers are to be\ninterpreted as globals. It would be impossible to assign to a global\nvariable without ``global``, although free variables may refer to\nglobals without being declared global.\n\nNames listed in a ``global`` statement must not be used in the same\ncode block textually preceding that ``global`` statement.\n\nNames listed in a ``global`` statement must not be defined as formal\nparameters or in a ``for`` loop control target, ``class`` definition,\nfunction definition, or ``import`` statement.\n\n**CPython implementation detail:** The current implementation does not\nenforce the latter two restrictions, but programs should not abuse\nthis freedom, as future implementations may enforce them or silently\nchange the meaning of the program.\n\n**Programmer\'s note:** the ``global`` is a directive to the parser.\nIt applies only to code parsed at the same time as the ``global``\nstatement. In particular, a ``global`` statement contained in a string\nor code object supplied to the built-in ``exec()`` function does not\naffect the code block *containing* the function call, and code\ncontained in such a string is unaffected by ``global`` statements in\nthe code containing the function call. The same applies to the\n``eval()`` and ``compile()`` functions.\n',
'id-classes': '\nReserved classes of identifiers\n*******************************\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``builtins`` module. When\n not in interactive mode, ``_`` has no special meaning and is not\n defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library). Current\n system names are discussed in the *Special method names* section\n and elsewhere. More will likely be defined in future versions of\n Python. *Any* use of ``__*__`` names, in any context, that does\n not follow explicitly documented use, is subject to breakage\n without warning.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n',
'identifiers': '\nIdentifiers and keywords\n************************\n\nIdentifiers (also referred to as *names*) are described by the\nfollowing lexical definitions.\n\nThe syntax of identifiers in Python is based on the Unicode standard\nannex UAX-31, with elaboration and changes as defined below; see also\n**PEP 3131** for further details.\n\nWithin the ASCII range (U+0001..U+007F), the valid characters for\nidentifiers are the same as in Python 2.x: the uppercase and lowercase\nletters ``A`` through ``Z``, the underscore ``_`` and, except for the\nfirst character, the digits ``0`` through ``9``.\n\nPython 3.0 introduces additional characters from outside the ASCII\nrange (see **PEP 3131**). For these characters, the classification\nuses the version of the Unicode Character Database as included in the\n``unicodedata`` module.\n\nIdentifiers are unlimited in length. Case is significant.\n\n identifier ::= xid_start xid_continue*\n id_start ::= <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property>\n id_continue ::= <all characters in id_start, plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>\n xid_start ::= <all characters in id_start whose NFKC normalization is in "id_start xid_continue*">\n xid_continue ::= <all characters in id_continue whose NFKC normalization is in "id_continue*">\n\nThe Unicode category codes mentioned above stand for:\n\n* *Lu* - uppercase letters\n\n* *Ll* - lowercase letters\n\n* *Lt* - titlecase letters\n\n* *Lm* - modifier letters\n\n* *Lo* - other letters\n\n* *Nl* - letter numbers\n\n* *Mn* - nonspacing marks\n\n* *Mc* - spacing combining marks\n\n* *Nd* - decimal numbers\n\n* *Pc* - connector punctuations\n\n* *Other_ID_Start* - explicit list of characters in PropList.txt to\n support backwards compatibility\n\n* *Other_ID_Continue* - likewise\n\nAll identifiers are converted into the normal form NFKC while parsing;\ncomparison of identifiers is based on NFKC.\n\nA non-normative HTML file listing all valid identifier characters for\nUnicode 4.1 can be found at http://www.dcl.hpi.uni-\npotsdam.de/home/loewis/table-3131.html.\n\n\nKeywords\n========\n\nThe following identifiers are used as reserved words, or *keywords* of\nthe language, and cannot be used as ordinary identifiers. They must\nbe spelled exactly as written here:\n\n False class finally is return\n None continue for lambda try\n True def from nonlocal while\n and del global not with\n as elif if or yield\n assert else import pass\n break except in raise\n\n\nReserved classes of identifiers\n===============================\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``builtins`` module. When\n not in interactive mode, ``_`` has no special meaning and is not\n defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library). Current\n system names are discussed in the *Special method names* section\n and elsewhere. More will likely be defined in future versions of\n Python. *Any* use of ``__*__`` names, in any context, that does\n not follow explicitly documented use, is subject to breakage\n without warning.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n',
'if': '\nThe ``if`` statement\n********************\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n',
'imaginary': '\nImaginary literals\n******************\n\nImaginary literals are described by the following lexical definitions:\n\n imagnumber ::= (floatnumber | intpart) ("j" | "J")\n\nAn imaginary literal yields a complex number with a real part of 0.0.\nComplex numbers are represented as a pair of floating point numbers\nand have the same restrictions on their range. To create a complex\nnumber with a nonzero real part, add a floating point number to it,\ne.g., ``(3+4j)``. Some examples of imaginary literals:\n\n 3.14j 10.j 10j .001j 1e100j 3.14e-10j\n',
- 'import': '\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nstatement comes in two forms differing on whether it uses the ``from``\nkeyword. The first form (without ``from``) repeats these steps for\neach identifier in the list. The form with ``from`` performs step (1)\nonce, and then performs step (2) repeatedly. For a reference\nimplementation of step (1), see the ``importlib`` module.\n\nTo understand how step (1) occurs, one must first understand how\nPython handles hierarchical naming of modules. To help organize\nmodules and provide a hierarchy in naming, Python has a concept of\npackages. A package can contain other packages and modules while\nmodules cannot contain other modules or packages. From a file system\nperspective, packages are directories and modules are files. The\noriginal specification for packages is still available to read,\nalthough minor details have changed since the writing of that\ndocument.\n\nOnce the name of the module is known (unless otherwise specified, the\nterm "module" will refer to both packages and modules), searching for\nthe module or package can begin. The first place checked is\n``sys.modules``, the cache of all modules that have been imported\npreviously. If the module is found there then it is used in step (2)\nof import.\n\nIf the module is not found in the cache, then ``sys.meta_path`` is\nsearched (the specification for ``sys.meta_path`` can be found in\n**PEP 302**). The object is a list of *finder* objects which are\nqueried in order as to whether they know how to load the module by\ncalling their ``find_module()`` method with the name of the module. If\nthe module happens to be contained within a package (as denoted by the\nexistence of a dot in the name), then a second argument to\n``find_module()`` is given as the value of the ``__path__`` attribute\nfrom the parent package (everything up to the last dot in the name of\nthe module being imported). If a finder can find the module it returns\na *loader* (discussed later) or returns ``None``.\n\nIf none of the finders on ``sys.meta_path`` are able to find the\nmodule then some implicitly defined finders are queried.\nImplementations of Python vary in what implicit meta path finders are\ndefined. The one they all do define, though, is one that handles\n``sys.path_hooks``, ``sys.path_importer_cache``, and ``sys.path``.\n\nThe implicit finder searches for the requested module in the "paths"\nspecified in one of two places ("paths" do not have to be file system\npaths). If the module being imported is supposed to be contained\nwithin a package then the second argument passed to ``find_module()``,\n``__path__`` on the parent package, is used as the source of paths. If\nthe module is not contained in a package then ``sys.path`` is used as\nthe source of paths.\n\nOnce the source of paths is chosen it is iterated over to find a\nfinder that can handle that path. The dict at\n``sys.path_importer_cache`` caches finders for paths and is checked\nfor a finder. If the path does not have a finder cached then\n``sys.path_hooks`` is searched by calling each object in the list with\na single argument of the path, returning a finder or raises\n``ImportError``. If a finder is returned then it is cached in\n``sys.path_importer_cache`` and then used for that path entry. If no\nfinder can be found but the path exists then a value of ``None`` is\nstored in ``sys.path_importer_cache`` to signify that an implicit,\nfile-based finder that handles modules stored as individual files\nshould be used for that path. If the path does not exist then a finder\nwhich always returns ``None`` is placed in the cache for the path.\n\nIf no finder can find the module then ``ImportError`` is raised.\nOtherwise some finder returned a loader whose ``load_module()`` method\nis called with the name of the module to load (see **PEP 302** for the\noriginal definition of loaders). A loader has several responsibilities\nto perform on a module it loads. First, if the module already exists\nin ``sys.modules`` (a possibility if the loader is called outside of\nthe import machinery) then it is to use that module for initialization\nand not a new module. But if the module does not exist in\n``sys.modules`` then it is to be added to that dict before\ninitialization begins. If an error occurs during loading of the module\nand it was added to ``sys.modules`` it is to be removed from the dict.\nIf an error occurs but the module was already in ``sys.modules`` it is\nleft in the dict.\n\nThe loader must set several attributes on the module. ``__name__`` is\nto be set to the name of the module. ``__file__`` is to be the "path"\nto the file unless the module is built-in (and thus listed in\n``sys.builtin_module_names``) in which case the attribute is not set.\nIf what is being imported is a package then ``__path__`` is to be set\nto a list of paths to be searched when looking for modules and\npackages contained within the package being imported. ``__package__``\nis optional but should be set to the name of package that contains the\nmodule or package (the empty string is used for module not contained\nin a package). ``__loader__`` is also optional but should be set to\nthe loader object that is loading the module.\n\nIf an error occurs during loading then the loader raises\n``ImportError`` if some other exception is not already being\npropagated. Otherwise the loader returns the module that was loaded\nand initialized.\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. The\nwild card form of import --- ``import *`` --- is only allowed at the\nmodule level. Attempting to use it in class or function definitions\nwill raise a ``SyntaxError``.\n\nWhen specifying what module to import you do not have to specify the\nabsolute name of the module. When a module or package is contained\nwithin another package it is possible to make a relative import within\nthe same top package without having to mention the package name. By\nusing leading dots in the specified module or package after ``from``\nyou can specify how high to traverse up the current package hierarchy\nwithout specifying exact names. One leading dot means the current\npackage where the module making the import exists. Two dots means up\none package level. Three dots is up two levels, etc. So if you execute\n``from . import mod`` from a module in the ``pkg`` package then you\nwill end up importing ``pkg.mod``. If you execute ``from ..subpkg2\nimprt mod`` from within ``pkg.subpkg1`` you will import\n``pkg.subpkg2.mod``. The specification for relative imports is\ncontained within **PEP 328**.\n\n``importlib.import_module()`` is provided to support applications that\ndetermine which modules need to be loaded dynamically.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 3.0 are ``absolute_import``,\n``division``, ``generators``, ``unicode_literals``,\n``print_function``, ``nested_scopes`` and ``with_statement``. They\nare all redundant because they are always enabled, and only kept for\nbackwards compatibility.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by calls to the built-in functions ``exec()`` and\n``compile()`` that occur in a module ``M`` containing a future\nstatement will, by default, use the new syntax or semantics associated\nwith the future statement. This can be controlled by optional\narguments to ``compile()`` --- see the documentation of that function\nfor details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n\nSee also:\n\n **PEP 236** - Back to the __future__\n The original proposal for the __future__ mechanism.\n',
+ 'import': '\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nstatement comes in two forms differing on whether it uses the ``from``\nkeyword. The first form (without ``from``) repeats these steps for\neach identifier in the list. The form with ``from`` performs step (1)\nonce, and then performs step (2) repeatedly. For a reference\nimplementation of step (1), see the ``importlib`` module.\n\nTo understand how step (1) occurs, one must first understand how\nPython handles hierarchical naming of modules. To help organize\nmodules and provide a hierarchy in naming, Python has a concept of\npackages. A package can contain other packages and modules while\nmodules cannot contain other modules or packages. From a file system\nperspective, packages are directories and modules are files. The\noriginal specification for packages is still available to read,\nalthough minor details have changed since the writing of that\ndocument.\n\nOnce the name of the module is known (unless otherwise specified, the\nterm "module" will refer to both packages and modules), searching for\nthe module or package can begin. The first place checked is\n``sys.modules``, the cache of all modules that have been imported\npreviously. If the module is found there then it is used in step (2)\nof import unless ``None`` is found in ``sys.modules``, in which case\n``ImportError`` is raised.\n\nIf the module is not found in the cache, then ``sys.meta_path`` is\nsearched (the specification for ``sys.meta_path`` can be found in\n**PEP 302**). The object is a list of *finder* objects which are\nqueried in order as to whether they know how to load the module by\ncalling their ``find_module()`` method with the name of the module. If\nthe module happens to be contained within a package (as denoted by the\nexistence of a dot in the name), then a second argument to\n``find_module()`` is given as the value of the ``__path__`` attribute\nfrom the parent package (everything up to the last dot in the name of\nthe module being imported). If a finder can find the module it returns\na *loader* (discussed later) or returns ``None``.\n\nIf none of the finders on ``sys.meta_path`` are able to find the\nmodule then some implicitly defined finders are queried.\nImplementations of Python vary in what implicit meta path finders are\ndefined. The one they all do define, though, is one that handles\n``sys.path_hooks``, ``sys.path_importer_cache``, and ``sys.path``.\n\nThe implicit finder searches for the requested module in the "paths"\nspecified in one of two places ("paths" do not have to be file system\npaths). If the module being imported is supposed to be contained\nwithin a package then the second argument passed to ``find_module()``,\n``__path__`` on the parent package, is used as the source of paths. If\nthe module is not contained in a package then ``sys.path`` is used as\nthe source of paths.\n\nOnce the source of paths is chosen it is iterated over to find a\nfinder that can handle that path. The dict at\n``sys.path_importer_cache`` caches finders for paths and is checked\nfor a finder. If the path does not have a finder cached then\n``sys.path_hooks`` is searched by calling each object in the list with\na single argument of the path, returning a finder or raises\n``ImportError``. If a finder is returned then it is cached in\n``sys.path_importer_cache`` and then used for that path entry. If no\nfinder can be found but the path exists then a value of ``None`` is\nstored in ``sys.path_importer_cache`` to signify that an implicit,\nfile-based finder that handles modules stored as individual files\nshould be used for that path. If the path does not exist then a finder\nwhich always returns ``None`` is placed in the cache for the path.\n\nIf no finder can find the module then ``ImportError`` is raised.\nOtherwise some finder returned a loader whose ``load_module()`` method\nis called with the name of the module to load (see **PEP 302** for the\noriginal definition of loaders). A loader has several responsibilities\nto perform on a module it loads. First, if the module already exists\nin ``sys.modules`` (a possibility if the loader is called outside of\nthe import machinery) then it is to use that module for initialization\nand not a new module. But if the module does not exist in\n``sys.modules`` then it is to be added to that dict before\ninitialization begins. If an error occurs during loading of the module\nand it was added to ``sys.modules`` it is to be removed from the dict.\nIf an error occurs but the module was already in ``sys.modules`` it is\nleft in the dict.\n\nThe loader must set several attributes on the module. ``__name__`` is\nto be set to the name of the module. ``__file__`` is to be the "path"\nto the file unless the module is built-in (and thus listed in\n``sys.builtin_module_names``) in which case the attribute is not set.\nIf what is being imported is a package then ``__path__`` is to be set\nto a list of paths to be searched when looking for modules and\npackages contained within the package being imported. ``__package__``\nis optional but should be set to the name of package that contains the\nmodule or package (the empty string is used for module not contained\nin a package). ``__loader__`` is also optional but should be set to\nthe loader object that is loading the module.\n\nIf an error occurs during loading then the loader raises\n``ImportError`` if some other exception is not already being\npropagated. Otherwise the loader returns the module that was loaded\nand initialized.\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement.\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. The\nwild card form of import --- ``import *`` --- is only allowed at the\nmodule level. Attempting to use it in class or function definitions\nwill raise a ``SyntaxError``.\n\nWhen specifying what module to import you do not have to specify the\nabsolute name of the module. When a module or package is contained\nwithin another package it is possible to make a relative import within\nthe same top package without having to mention the package name. By\nusing leading dots in the specified module or package after ``from``\nyou can specify how high to traverse up the current package hierarchy\nwithout specifying exact names. One leading dot means the current\npackage where the module making the import exists. Two dots means up\none package level. Three dots is up two levels, etc. So if you execute\n``from . import mod`` from a module in the ``pkg`` package then you\nwill end up importing ``pkg.mod``. If you execute ``from ..subpkg2\nimport mod`` from within ``pkg.subpkg1`` you will import\n``pkg.subpkg2.mod``. The specification for relative imports is\ncontained within **PEP 328**.\n\n``importlib.import_module()`` is provided to support applications that\ndetermine which modules need to be loaded dynamically.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 3.0 are ``absolute_import``,\n``division``, ``generators``, ``unicode_literals``,\n``print_function``, ``nested_scopes`` and ``with_statement``. They\nare all redundant because they are always enabled, and only kept for\nbackwards compatibility.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by calls to the built-in functions ``exec()`` and\n``compile()`` that occur in a module ``M`` containing a future\nstatement will, by default, use the new syntax or semantics associated\nwith the future statement. This can be controlled by optional\narguments to ``compile()`` --- see the documentation of that function\nfor details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n\nSee also:\n\n **PEP 236** - Back to the __future__\n The original proposal for the __future__ mechanism.\n',
'in': '\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nthe ``==`` and ``!=`` operators *always* consider objects of different\ntypes to be unequal, while the ``<``, ``>``, ``>=`` and ``<=``\noperators raise a ``TypeError`` when comparing objects of different\ntypes that do not implement these operators for the given pair of\ntypes. You can control comparison behavior of objects of non-built-in\ntypes by defining rich comparison methods like ``__gt__()``, described\nin section *Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values ``float(\'NaN\')`` and ``Decimal(\'NaN\')`` are special. The\n are identical to themselves, ``x is x`` but are not equal to\n themselves, ``x != x``. Additionally, comparing any value to a\n not-a-number value will return ``False``. For example, both ``3 <\n float(\'NaN\')`` and ``float(\'NaN\') < 3`` will return ``False``.\n\n* Bytes objects are compared lexicographically using the numeric\n values of their elements.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n [3] String and bytes object can\'t be compared!\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``[1,2,x] <= [1,2,y]`` has the\n same value as ``x <= y``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if they have the\n same ``(key, value)`` pairs. Order comparisons ``(\'<\', \'<=\', \'>=\',\n \'>\')`` raise ``TypeError``.\n\n* Sets and frozensets define comparison operators to mean subset and\n superset tests. Those relations do not define total orderings (the\n two sets ``{1,2}`` and {2,3} are not equal, nor subsets of one\n another, nor supersets of one another). Accordingly, sets are not\n appropriate arguments for functions which depend on total ordering.\n For example, ``min()``, ``max()``, and ``sorted()`` produce\n undefined results given a list of sets as inputs.\n\n* Most other objects of built-in types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison. Most\nnumeric types can be compared with one another, but comparisons of\n``float`` and ``Decimal`` are not supported to avoid the inevitable\nconfusion arising from representation issues such as ``float(\'1.1\')``\nbeing inexactly represented and therefore not exactly equal to\n``Decimal(\'1.1\')`` which is. When cross-type comparison is not\nsupported, the comparison method returns ``NotImplemented``. This can\ncreate the illusion of non-transitivity between supported cross-type\ncomparisons and unsupported comparisons. For example, ``Decimal(2) ==\n2`` and ``2 == float(2)`` but ``Decimal(2) != float(2)``.\n\nThe operators ``in`` and ``not in`` test for membership. ``x in s``\nevaluates to true if *x* is a member of *s*, and false otherwise. ``x\nnot in s`` returns the negation of ``x in s``. All built-in sequences\nand set types support this as well as dictionary, for which ``in``\ntests whether a the dictionary has a given key. For container types\nsuch as list, tuple, set, frozenset, dict, or collections.deque, the\nexpression ``x in y`` is equivalent to ``any(x is e or x == e for e in\ny)``.\n\nFor the string and bytes types, ``x in y`` is true if and only if *x*\nis a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nEmpty strings are always considered to be a substring of any other\nstring, so ``"" in "abc"`` will return ``True``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` but do\ndefine ``__iter__()``, ``x in y`` is true if some value ``z`` with ``x\n== z`` is produced while iterating over ``y``. If an exception is\nraised during the iteration, it is as if ``in`` raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n``__getitem__()``, ``x in y`` is true if and only if there is a non-\nnegative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [4]\n',
'integers': '\nInteger literals\n****************\n\nInteger literals are described by the following lexical definitions:\n\n integer ::= decimalinteger | octinteger | hexinteger | bininteger\n decimalinteger ::= nonzerodigit digit* | "0"+\n nonzerodigit ::= "1"..."9"\n digit ::= "0"..."9"\n octinteger ::= "0" ("o" | "O") octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n bininteger ::= "0" ("b" | "B") bindigit+\n octdigit ::= "0"..."7"\n hexdigit ::= digit | "a"..."f" | "A"..."F"\n bindigit ::= "0" | "1"\n\nThere is no limit for the length of integer literals apart from what\ncan be stored in available memory.\n\nNote that leading zeros in a non-zero decimal number are not allowed.\nThis is for disambiguation with C-style octal literals, which Python\nused before version 3.0.\n\nSome examples of integer literals:\n\n 7 2147483647 0o177 0b100110111\n 3 79228162514264337593543950336 0o377 0x100000000\n 79228162514264337593543950336 0xdeadbeef\n',
'lambda': '\nLambdas\n*******\n\n lambda_form ::= "lambda" [parameter_list]: expression\n lambda_form_nocond ::= "lambda" [parameter_list]: expression_nocond\n\nLambda forms (lambda expressions) have the same syntactic position as\nexpressions. They are a shorthand to create anonymous functions; the\nexpression ``lambda arguments: expression`` yields a function object.\nThe unnamed object behaves like a function object defined with\n\n def <lambda>(arguments):\n return expression\n\nSee section *Function definitions* for the syntax of parameter lists.\nNote that functions created with lambda forms cannot contain\nstatements or annotations.\n',
'lists': '\nList displays\n*************\n\nA list display is a possibly empty series of expressions enclosed in\nsquare brackets:\n\n list_display ::= "[" [expression_list | comprehension] "]"\n\nA list display yields a new list object, the contents being specified\nby either a list of expressions or a comprehension. When a comma-\nseparated list of expressions is supplied, its elements are evaluated\nfrom left to right and placed into the list object in that order.\nWhen a comprehension is supplied, the list is constructed from the\nelements resulting from the comprehension.\n',
- 'naming': "\nNaming and binding\n******************\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the '**-c**' option) is a code block. The string argument passed\nto the built-in functions ``eval()`` and ``exec()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block's execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes comprehensions and generator\nexpressions since they are implemented using a function scope. This\nmeans that the following will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block's *environment*.\n\nIf a name is bound in a block, it is a local variable of that block,\nunless declared as ``nonlocal``. If a name is bound at the module\nlevel, it is a global variable. (The variables of the module code\nblock are local and global.) If a variable is used in a code block\nbut not defined there, it is a *free variable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, or\nafter ``as`` in a ``with`` statement or ``except`` clause. The\n``import`` statement of the form ``from ... import *`` binds all names\ndefined in the imported module, except those beginning with an\nunderscore. This form may only be used at the module level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name). It\nis illegal to unbind a name that is referenced by an enclosing scope;\nthe compiler will report a ``SyntaxError``.\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the ``global`` statement occurs within a block, all uses of the\nname specified in the statement refer to the binding of that name in\nthe top-level namespace. Names are resolved in the top-level\nnamespace by searching the global namespace, i.e. the namespace of the\nmodule containing the code block, and the builtins namespace, the\nnamespace of the module ``builtins``. The global namespace is\nsearched first. If the name is not found there, the builtins\nnamespace is searched. The global statement must precede all uses of\nthe name.\n\nThe builtins namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module's dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``builtins``; when in any other module, ``__builtins__`` is an alias\nfor the dictionary of the ``builtins`` module itself.\n``__builtins__`` can be set to a user-created dictionary to create a\nweak form of restricted execution.\n\n**CPython implementation detail:** Users should not touch\n``__builtins__``; it is strictly an implementation detail. Users\nwanting to override values in the builtins namespace should ``import``\nthe ``builtins`` module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe ``global`` statement has the same scope as a name binding\noperation in the same block. If the nearest enclosing scope for a\nfree variable contains a global statement, the free variable is\ntreated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n=================================\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nThe ``eval()`` and ``exec()`` functions do not have access to the full\nenvironment for resolving names. Names may be resolved in the local\nand global namespaces of the caller. Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace. [1]\nThe ``exec()`` and ``eval()`` functions have optional arguments to\noverride the global and local namespace. If only one namespace is\nspecified, it is used for both.\n",
+ 'naming': "\nNaming and binding\n******************\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the '**-c**' option) is a code block. The string argument passed\nto the built-in functions ``eval()`` and ``exec()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block's execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes comprehensions and generator\nexpressions since they are implemented using a function scope. This\nmeans that the following will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block's *environment*.\n\nIf a name is bound in a block, it is a local variable of that block,\nunless declared as ``nonlocal``. If a name is bound at the module\nlevel, it is a global variable. (The variables of the module code\nblock are local and global.) If a variable is used in a code block\nbut not defined there, it is a *free variable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, or\nafter ``as`` in a ``with`` statement or ``except`` clause. The\n``import`` statement of the form ``from ... import *`` binds all names\ndefined in the imported module, except those beginning with an\nunderscore. This form may only be used at the module level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name).\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the ``global`` statement occurs within a block, all uses of the\nname specified in the statement refer to the binding of that name in\nthe top-level namespace. Names are resolved in the top-level\nnamespace by searching the global namespace, i.e. the namespace of the\nmodule containing the code block, and the builtins namespace, the\nnamespace of the module ``builtins``. The global namespace is\nsearched first. If the name is not found there, the builtins\nnamespace is searched. The global statement must precede all uses of\nthe name.\n\nThe builtins namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module's dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``builtins``; when in any other module, ``__builtins__`` is an alias\nfor the dictionary of the ``builtins`` module itself.\n``__builtins__`` can be set to a user-created dictionary to create a\nweak form of restricted execution.\n\n**CPython implementation detail:** Users should not touch\n``__builtins__``; it is strictly an implementation detail. Users\nwanting to override values in the builtins namespace should ``import``\nthe ``builtins`` module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe ``global`` statement has the same scope as a name binding\noperation in the same block. If the nearest enclosing scope for a\nfree variable contains a global statement, the free variable is\ntreated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n=================================\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nThe ``eval()`` and ``exec()`` functions do not have access to the full\nenvironment for resolving names. Names may be resolved in the local\nand global namespaces of the caller. Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace. [1]\nThe ``exec()`` and ``eval()`` functions have optional arguments to\noverride the global and local namespace. If only one namespace is\nspecified, it is used for both.\n",
'nonlocal': '\nThe ``nonlocal`` statement\n**************************\n\n nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*\n\nThe ``nonlocal`` statement causes the listed identifiers to refer to\npreviously bound variables in the nearest enclosing scope. This is\nimportant because the default behavior for binding is to search the\nlocal namespace first. The statement allows encapsulated code to\nrebind variables outside of the local scope besides the global\n(module) scope.\n\nNames listed in a ``nonlocal`` statement, unlike to those listed in a\n``global`` statement, must refer to pre-existing bindings in an\nenclosing scope (the scope in which a new binding should be created\ncannot be determined unambiguously).\n\nNames listed in a ``nonlocal`` statement must not collide with pre-\nexisting bindings in the local scope.\n\nSee also:\n\n **PEP 3104** - Access to Names in Outer Scopes\n The specification for the ``nonlocal`` statement.\n',
'numbers': "\nNumeric literals\n****************\n\nThere are three types of numeric literals: integers, floating point\nnumbers, and imaginary numbers. There are no complex literals\n(complex numbers can be formed by adding a real number and an\nimaginary number).\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator '``-``' and\nthe literal ``1``.\n",
'numeric-types': "\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``). For instance, to evaluate the expression ``x + y``, where\n *x* is an instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()``. Note that\n ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``) with reflected (swapped) operands. These functions are only\n called if the left operand does not support the corresponding\n operation and the operands are of different types. [2] For\n instance, to evaluate the expression ``x - y``, where *y* is an\n instance of a class that has an ``__rsub__()`` method,\n ``y.__rsub__(x)`` is called if ``x.__sub__(y)`` returns\n *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand's type is a subclass of the left operand's\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand's\n non-reflected method. This behavior allows subclasses to\n override their ancestors' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n assignments (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n assignment falls back to the normal methods. For instance, to\n execute the statement ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``float()`` and ``round()``. Should return a value of\n the appropriate type.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing, or in the\n built-in ``bin()``, ``hex()`` and ``oct()`` functions). Must return\n an integer.\n",
'objects': '\nObjects, values and types\n*************************\n\n*Objects* are Python\'s abstraction for data. All data in a Python\nprogram is represented by objects or by relations between objects. (In\na sense, and in conformance to Von Neumann\'s model of a "stored\nprogram computer," code is also represented by objects.)\n\nEvery object has an identity, a type and a value. An object\'s\n*identity* never changes once it has been created; you may think of it\nas the object\'s address in memory. The \'``is``\' operator compares the\nidentity of two objects; the ``id()`` function returns an integer\nrepresenting its identity (currently implemented as its address). An\nobject\'s *type* is also unchangeable. [1] An object\'s type determines\nthe operations that the object supports (e.g., "does it have a\nlength?") and also defines the possible values for objects of that\ntype. The ``type()`` function returns an object\'s type (which is an\nobject itself). The *value* of some objects can change. Objects\nwhose value can change are said to be *mutable*; objects whose value\nis unchangeable once they are created are called *immutable*. (The\nvalue of an immutable container object that contains a reference to a\nmutable object can change when the latter\'s value is changed; however\nthe container is still considered immutable, because the collection of\nobjects it contains cannot be changed. So, immutability is not\nstrictly the same as having an unchangeable value, it is more subtle.)\nAn object\'s mutability is determined by its type; for instance,\nnumbers, strings and tuples are immutable, while dictionaries and\nlists are mutable.\n\nObjects are never explicitly destroyed; however, when they become\nunreachable they may be garbage-collected. An implementation is\nallowed to postpone garbage collection or omit it altogether --- it is\na matter of implementation quality how garbage collection is\nimplemented, as long as no objects are collected that are still\nreachable.\n\n**CPython implementation detail:** CPython currently uses a reference-\ncounting scheme with (optional) delayed detection of cyclically linked\ngarbage, which collects most objects as soon as they become\nunreachable, but is not guaranteed to collect garbage containing\ncircular references. See the documentation of the ``gc`` module for\ninformation on controlling the collection of cyclic garbage. Other\nimplementations act differently and CPython may change. Do not depend\non immediate finalization of objects when they become unreachable (ex:\nalways close files).\n\nNote that the use of the implementation\'s tracing or debugging\nfacilities may keep objects alive that would normally be collectable.\nAlso note that catching an exception with a \'``try``...``except``\'\nstatement may keep objects alive.\n\nSome objects contain references to "external" resources such as open\nfiles or windows. It is understood that these resources are freed\nwhen the object is garbage-collected, but since garbage collection is\nnot guaranteed to happen, such objects also provide an explicit way to\nrelease the external resource, usually a ``close()`` method. Programs\nare strongly recommended to explicitly close such objects. The\n\'``try``...``finally``\' statement and the \'``with``\' statement provide\nconvenient ways to do this.\n\nSome objects contain references to other objects; these are called\n*containers*. Examples of containers are tuples, lists and\ndictionaries. The references are part of a container\'s value. In\nmost cases, when we talk about the value of a container, we imply the\nvalues, not the identities of the contained objects; however, when we\ntalk about the mutability of a container, only the identities of the\nimmediately contained objects are implied. So, if an immutable\ncontainer (like a tuple) contains a reference to a mutable object, its\nvalue changes if that mutable object is changed.\n\nTypes affect almost all aspects of object behavior. Even the\nimportance of object identity is affected in some sense: for immutable\ntypes, operations that compute new values may actually return a\nreference to any existing object with the same type and value, while\nfor mutable objects this is not allowed. E.g., after ``a = 1; b =\n1``, ``a`` and ``b`` may or may not refer to the same object with the\nvalue one, depending on the implementation, but after ``c = []; d =\n[]``, ``c`` and ``d`` are guaranteed to refer to two different,\nunique, newly created empty lists. (Note that ``c = d = []`` assigns\nthe same object to both ``c`` and ``d``.)\n',
- 'operator-summary': '\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``if`` -- ``else`` | Conditional expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in``, ``is``, ``is not``, | Comparisons, including membership |\n| ``<``, ``<=``, ``>``, ``>=``, ``!=``, ``==`` | tests and identity tests, |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder |\n| | [5] |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x``, ``~x`` | Positive, negative, bitwise NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation [6] |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]``, ``x[index:index]``, | Subscription, slicing, call, |\n| ``x(arguments...)``, ``x.attribute`` | attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)``, ``[expressions...]``, | Binding or tuple display, list |\n| ``{key:datum...}``, | display, dictionary display, |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. The function\n ``math.fmod()`` returns a result whose sign matches the sign of\n the first argument instead, and so returns ``-1e-100`` in this\n case. Which approach is more appropriate depends on the\n application.\n\n[2] If x is very close to an exact integer multiple of y, it\'s\n possible for ``x//y`` to be one larger than ``(x-x%y)//y`` due to\n rounding. In such cases, Python returns the latter result, in\n order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[3] While comparisons between strings make sense at the byte level,\n they may be counter-intuitive to users. For example, the strings\n ``"\\u00C7"`` and ``"\\u0327\\u0043"`` compare differently, even\n though they both represent the same unicode character (LATIN\n CAPITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[4] Due to automatic garbage-collection, free lists, and the dynamic\n nature of descriptors, you may notice seemingly unusual behaviour\n in certain uses of the ``is`` operator, like those involving\n comparisons between instance methods, or constants. Check their\n documentation for more info.\n\n[5] The ``%`` operator is also used for string formatting; the same\n precedence applies.\n\n[6] The power operator ``**`` binds less tightly than an arithmetic or\n bitwise unary operator on its right, that is, ``2**-1`` is\n ``0.5``.\n',
+ 'operator-summary': '\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``if`` -- ``else`` | Conditional expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in``, ``is``, ``is not``, | Comparisons, including membership |\n| ``<``, ``<=``, ``>``, ``>=``, ``!=``, ``==`` | tests and identity tests, |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder |\n| | [5] |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x``, ``~x`` | Positive, negative, bitwise NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation [6] |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]``, ``x[index:index]``, | Subscription, slicing, call, |\n| ``x(arguments...)``, ``x.attribute`` | attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)``, ``[expressions...]``, | Binding or tuple display, list |\n| ``{key:datum...}``, ``{expressions...}`` | display, dictionary display, set |\n| | display |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. The function\n ``math.fmod()`` returns a result whose sign matches the sign of\n the first argument instead, and so returns ``-1e-100`` in this\n case. Which approach is more appropriate depends on the\n application.\n\n[2] If x is very close to an exact integer multiple of y, it\'s\n possible for ``x//y`` to be one larger than ``(x-x%y)//y`` due to\n rounding. In such cases, Python returns the latter result, in\n order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[3] While comparisons between strings make sense at the byte level,\n they may be counter-intuitive to users. For example, the strings\n ``"\\u00C7"`` and ``"\\u0327\\u0043"`` compare differently, even\n though they both represent the same unicode character (LATIN\n CAPITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[4] Due to automatic garbage-collection, free lists, and the dynamic\n nature of descriptors, you may notice seemingly unusual behaviour\n in certain uses of the ``is`` operator, like those involving\n comparisons between instance methods, or constants. Check their\n documentation for more info.\n\n[5] The ``%`` operator is also used for string formatting; the same\n precedence applies.\n\n[6] The power operator ``**`` binds less tightly than an arithmetic or\n bitwise unary operator on its right, that is, ``2**-1`` is\n ``0.5``.\n',
'pass': '\nThe ``pass`` statement\n**********************\n\n pass_stmt ::= "pass"\n\n``pass`` is a null operation --- when it is executed, nothing happens.\nIt is useful as a placeholder when a statement is required\nsyntactically, but no code needs to be executed, for example:\n\n def f(arg): pass # a function that does nothing (yet)\n\n class C: pass # a class with no methods (yet)\n',
'power': '\nThe power operator\n******************\n\nThe power operator binds more tightly than unary operators on its\nleft; it binds less tightly than unary operators on its right. The\nsyntax is:\n\n power ::= primary ["**" u_expr]\n\nThus, in an unparenthesized sequence of power and unary operators, the\noperators are evaluated from right to left (this does not constrain\nthe evaluation order for the operands): ``-1**2`` results in ``-1``.\n\nThe power operator has the same semantics as the built-in ``pow()``\nfunction, when called with two arguments: it yields its left argument\nraised to the power of its right argument. The numeric arguments are\nfirst converted to a common type, and the result is of that type.\n\nFor int operands, the result has the same type as the operands unless\nthe second argument is negative; in that case, all arguments are\nconverted to float and a float result is delivered. For example,\n``10**2`` returns ``100``, but ``10**-2`` returns ``0.01``.\n\nRaising ``0.0`` to a negative power results in a\n``ZeroDivisionError``. Raising a negative number to a fractional power\nresults in a ``complex`` number. (In earlier versions it raised a\n``ValueError``.)\n',
'raise': '\nThe ``raise`` statement\n***********************\n\n raise_stmt ::= "raise" [expression ["from" expression]]\n\nIf no expressions are present, ``raise`` re-raises the last exception\nthat was active in the current scope. If no exception is active in\nthe current scope, a ``TypeError`` exception is raised indicating that\nthis is an error (if running under IDLE, a ``queue.Empty`` exception\nis raised instead).\n\nOtherwise, ``raise`` evaluates the first expression as the exception\nobject. It must be either a subclass or an instance of\n``BaseException``. If it is a class, the exception instance will be\nobtained when needed by instantiating the class with no arguments.\n\nThe *type* of the exception is the exception instance\'s class, the\n*value* is the instance itself.\n\nA traceback object is normally created automatically when an exception\nis raised and attached to it as the ``__traceback__`` attribute, which\nis writable. You can create an exception and set your own traceback in\none step using the ``with_traceback()`` exception method (which\nreturns the same exception instance, with its traceback set to its\nargument), like so:\n\n raise Exception("foo occurred").with_traceback(tracebackobj)\n\nThe ``from`` clause is used for exception chaining: if given, the\nsecond *expression* must be another exception class or instance, which\nwill then be attached to the raised exception as the ``__cause__``\nattribute (which is writable). If the raised exception is not\nhandled, both exceptions will be printed:\n\n >>> try:\n ... print(1 / 0)\n ... except Exception as exc:\n ... raise RuntimeError("Something bad happened") from exc\n ...\n Traceback (most recent call last):\n File "<stdin>", line 2, in <module>\n ZeroDivisionError: int division or modulo by zero\n\n The above exception was the direct cause of the following exception:\n\n Traceback (most recent call last):\n File "<stdin>", line 4, in <module>\n RuntimeError: Something bad happened\n\nA similar mechanism works implicitly if an exception is raised inside\nan exception handler: the previous exception is then attached as the\nnew exception\'s ``__context__`` attribute:\n\n >>> try:\n ... print(1 / 0)\n ... except:\n ... raise RuntimeError("Something bad happened")\n ...\n Traceback (most recent call last):\n File "<stdin>", line 2, in <module>\n ZeroDivisionError: int division or modulo by zero\n\n During handling of the above exception, another exception occurred:\n\n Traceback (most recent call last):\n File "<stdin>", line 4, in <module>\n RuntimeError: Something bad happened\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information about handling exceptions is in section\n*The try statement*.\n',
- 'return': '\nThe ``return`` statement\n************************\n\n return_stmt ::= "return" [expression_list]\n\n``return`` may only occur syntactically nested in a function\ndefinition, not within a nested class definition.\n\nIf an expression list is present, it is evaluated, else ``None`` is\nsubstituted.\n\n``return`` leaves the current function call with the expression list\n(or ``None``) as return value.\n\nWhen ``return`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the function.\n\nIn a generator function, the ``return`` statement is not allowed to\ninclude an **expression_list**. In that context, a bare ``return``\nindicates that the generator is done and will cause ``StopIteration``\nto be raised.\n',
+ 'return': '\nThe ``return`` statement\n************************\n\n return_stmt ::= "return" [expression_list]\n\n``return`` may only occur syntactically nested in a function\ndefinition, not within a nested class definition.\n\nIf an expression list is present, it is evaluated, else ``None`` is\nsubstituted.\n\n``return`` leaves the current function call with the expression list\n(or ``None``) as return value.\n\nWhen ``return`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the function.\n\nIn a generator function, the ``return`` statement is not allowed to\ninclude an ``expression_list``. In that context, a bare ``return``\nindicates that the generator is done and will cause ``StopIteration``\nto be raised.\n',
'sequence-types': "\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``get()``,\n``clear()``, ``setdefault()``, ``pop()``, ``popitem()``, ``copy()``,\nand ``update()`` behaving similar to those for Python's standard\ndictionary objects. The ``collections`` module provides a\n``MutableMapping`` abstract base class to help create those methods\nfrom a base set of ``__getitem__()``, ``__setitem__()``,\n``__delitem__()``, and ``keys()``. Mutable sequences should provide\nmethods ``append()``, ``count()``, ``index()``, ``extend()``,\n``insert()``, ``pop()``, ``remove()``, ``reverse()`` and ``sort()``,\nlike Python standard list objects. Finally, sequence types should\nimplement addition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods ``__add__()``, ``__radd__()``,\n``__iadd__()``, ``__mul__()``, ``__rmul__()`` and ``__imul__()``\ndescribed below; they should not define other numerical operators. It\nis recommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should search the mapping's keys; for\nsequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``keys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__bool__()`` method and whose ``__len__()``\n method returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods. A\n call like\n\n a[1:2] = b\n\n is translated to\n\n a[slice(1, 2, None)] = b\n\n and so forth. Missing slice items are always filled in with\n ``None``.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``keys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` built-in to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` built-in will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects that\n support the sequence protocol should only provide\n ``__reversed__()`` if they can provide an implementation that is\n more efficient than the one provided by ``reversed()``.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n For objects that don't define ``__contains__()``, the membership\n test first tries iteration via ``__iter__()``, then the old\n sequence iteration protocol via ``__getitem__()``, see *this\n section in the language reference*.\n",
- 'shifting': '\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept integers as arguments. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by ``pow(2,n)``. A\nleft shift by *n* bits is defined as multiplication with ``pow(2,n)``.\n',
+ 'shifting': '\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept integers as arguments. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by ``pow(2,n)``. A\nleft shift by *n* bits is defined as multiplication with ``pow(2,n)``.\n\nNote: In the current implementation, the right-hand operand is required to\n be at most ``sys.maxsize``. If the right-hand operand is larger\n than ``sys.maxsize`` an ``OverflowError`` exception is raised.\n',
'slicings': '\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list). Slicings may be used as expressions or as\ntargets in assignment or ``del`` statements. The syntax for a\nslicing:\n\n slicing ::= primary "[" slice_list "]"\n slice_list ::= slice_item ("," slice_item)* [","]\n slice_item ::= expression | proper_slice\n proper_slice ::= [lower_bound] ":" [upper_bound] [ ":" [stride] ]\n lower_bound ::= expression\n upper_bound ::= expression\n stride ::= expression\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing. Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice).\n\nThe semantics for a slicing are as follows. The primary must evaluate\nto a mapping object, and it is indexed (using the same\n``__getitem__()`` method as normal subscription) with a key that is\nconstructed from the slice list, as follows. If the slice list\ncontains at least one comma, the key is a tuple containing the\nconversion of the slice items; otherwise, the conversion of the lone\nslice item is the key. The conversion of a slice item that is an\nexpression is that expression. The conversion of a proper slice is a\nslice object (see section *The standard type hierarchy*) whose\n``start``, ``stop`` and ``step`` attributes are the values of the\nexpressions given as lower bound, upper bound and stride,\nrespectively, substituting ``None`` for missing expressions.\n',
'specialattrs': "\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object.\n\nclass.__name__\n\n The name of the class or type.\n\nThe following attributes are only supported by *new-style class*es.\n\nclass.__mro__\n\n This attribute is a tuple of classes that are considered when\n looking for base classes during method resolution.\n\nclass.mro()\n\n This method can be overridden by a metaclass to customize the\n method resolution order for its instances. It is called at class\n instantiation, and its result is stored in ``__mro__``.\n\nclass.__subclasses__()\n\n Each new-style class keeps a list of weak references to its\n immediate subclasses. This method returns a list of all those\n references still alive. Example:\n\n >>> int.__subclasses__()\n [<type 'bool'>]\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n",
- 'specialnames': '\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is roughly equivalent to ``type(x).__getitem__(x,\ni)``. Except where mentioned, attempts to execute an operation raise\nan exception when no appropriate method is defined (typically\n``AttributeError`` or ``TypeError``).\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_info()[2]`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.last_traceback``. Circular references which are garbage are\n detected when the option cycle detector is enabled (it\'s on by\n default), but can only be cleaned up if there are no Python-\n level ``__del__()`` methods involved. Refer to the documentation\n for the ``gc`` module for more information about how\n ``__del__()`` methods are handled by the cycle detector,\n particularly the description of the ``garbage`` value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted or in the process of being torn down (e.g. the\n import machinery shutting down). For this reason, ``__del__()``\n methods should do the absolute minimum needed to maintain\n external invariants. Starting with version 1.5, Python\n guarantees that globals whose name begins with a single\n underscore are deleted from their module before other globals are\n deleted; if no other references to such globals exist, this may\n help in assuring that imported modules are still available at the\n time when the ``__del__()`` method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function to compute the\n "official" string representation of an object. If at all possible,\n this should look like a valid Python expression that could be used\n to recreate an object with the same value (given an appropriate\n environment). If this is not possible, a string of the form\n ``<...some useful description...>`` should be returned. The return\n value must be a string object. If a class defines ``__repr__()``\n but not ``__str__()``, then ``__repr__()`` is also used when an\n "informal" string representation of instances of that class is\n required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print()``\n function to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__format__(self, format_spec)\n\n Called by the ``format()`` built-in function (and by extension, the\n ``format()`` method of class ``str``) to produce a "formatted"\n string representation of an object. The ``format_spec`` argument is\n a string that contains a description of the formatting options\n desired. The interpretation of the ``format_spec`` argument is up\n to the type implementing ``__format__()``, however most classes\n will either delegate formatting to one of the built-in types, or\n use a similar formatting option syntax.\n\n See *Format Specification Mini-Language* for a description of the\n standard formatting syntax.\n\n The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n These are the so-called "rich comparison" methods. The\n correspondence between operator symbols and method names is as\n follows: ``x<y`` calls ``x.__lt__(y)``, ``x<=y`` calls\n ``x.__le__(y)``, ``x==y`` calls ``x.__eq__(y)``, ``x!=y`` calls\n ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and ``x>=y`` calls\n ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\n To automatically generate ordering operations from a single root\n operation, see the Total Ordering recipe in the ASPN cookbook.\n\nobject.__hash__(self)\n\n Called by built-in function ``hash()`` and for operations on\n members of hashed collections including ``set``, ``frozenset``, and\n ``dict``. ``__hash__()`` should return an integer. The only\n required property is that objects which compare equal have the same\n hash value; it is advised to somehow mix together (e.g. using\n exclusive or) the hash values for the components of the object that\n also play a part in comparison of objects.\n\n If a class does not define an ``__eq__()`` method it should not\n define a ``__hash__()`` operation either; if it defines\n ``__eq__()`` but not ``__hash__()``, its instances will not be\n usable as items in hashable collections. If a class defines\n mutable objects and implements an ``__eq__()`` method, it should\n not implement ``__hash__()``, since the implementation of hashable\n collections requires that a key\'s hash value is immutable (if the\n object\'s hash value changes, it will be in the wrong hash bucket).\n\n User-defined classes have ``__eq__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__eq__()`` such that the hash value\n returned is no longer appropriate (e.g. by switching to a value-\n based concept of equality instead of the default identity based\n equality) can explicitly flag themselves as being unhashable by\n setting ``__hash__ = None`` in the class definition. Doing so means\n that not only will instances of the class raise an appropriate\n ``TypeError`` when a program attempts to retrieve their hash value,\n but they will also be correctly identified as unhashable when\n checking ``isinstance(obj, collections.Hashable)`` (unlike classes\n which define their own ``__hash__()`` to explicitly raise\n ``TypeError``).\n\n If a class that overrides ``__eq__()`` needs to retain the\n implementation of ``__hash__()`` from a parent class, the\n interpreter must be told this explicitly by setting ``__hash__ =\n <ParentClass>.__hash__``. Otherwise the inheritance of\n ``__hash__()`` will be blocked, just as if ``__hash__`` had been\n explicitly set to ``None``.\n\nobject.__bool__(self)\n\n Called to implement truth value testing and the built-in operation\n ``bool()``; should return ``False`` or ``True``. When this method\n is not defined, ``__len__()`` is called, if it is defined, and the\n object is considered true if its result is nonzero. If a class\n defines neither ``__len__()`` nor ``__bool__()``, all its instances\n are considered true.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control over attribute access.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n built-in functions. See *Special method lookup*.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should call the base class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\nobject.__dir__(self)\n\n Called when ``dir()`` is called on the object. A list must be\n returned.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in an\n*owner* class (the descriptor must be in either the owner\'s class\ndictionary or in the class dictionary for one of its parents). In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' ``__dict__``.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called.\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to an object instance, ``a.x`` is transformed into the\n call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a class, ``A.x`` is transformed into the call:\n ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, obj.__class__)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. A descriptor can define\nany combination of ``__get__()``, ``__set__()`` and ``__delete__()``.\nIf it does not define ``__get__()``, then accessing the attribute will\nreturn the descriptor object itself unless there is a value in the\nobject\'s instance dictionary. If the descriptor defines ``__set__()``\nand/or ``__delete__()``, it is a data descriptor; if it defines\nneither, it is a non-data descriptor. Normally, data descriptors\ndefine both ``__get__()`` and ``__set__()``, while non-data\ndescriptors have just the ``__get__()`` method. Data descriptors with\n``__set__()`` and ``__get__()`` defined always override a redefinition\nin an instance dictionary. In contrast, non-data descriptors can be\noverridden by instances.\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of classes have a dictionary for attribute\nstorage. This wastes space for objects having very few instance\nvariables. The space consumption can become acute when creating large\nnumbers of instances.\n\nThe default can be overridden by defining *__slots__* in a class\ndefinition. The *__slots__* declaration takes a sequence of instance\nvariables and reserves just enough space in each instance to hold a\nvalue for each variable. Space is saved because *__dict__* is not\ncreated for each instance.\n\nobject.__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n class, *__slots__* reserves space for the declared variables and\n prevents the automatic creation of *__dict__* and *__weakref__* for\n each instance.\n\n\nNotes on using *__slots__*\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__* (which must only contain names\n of any *additional* slots).\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* Nonempty *__slots__* does not work for classes derived from\n "variable-length" built-in types such as ``int``, ``str`` and\n ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, classes are constructed using ``type()``. A class\ndefinition is read into a separate namespace and the value of class\nname is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if a callable ``metaclass`` keyword\nargument is passed after the bases in the class definition, the\ncallable given will be called instead of ``type()``. If other keyword\narguments are passed, they will also be passed to the metaclass. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\nIf the metaclass has a ``__prepare__()`` attribute (usually\nimplemented as a class or static method), it is called before the\nclass body is evaluated with the name of the class and a tuple of its\nbases for arguments. It should return an object that supports the\nmapping interface that will be used to store the namespace of the\nclass. The default is a plain dictionary. This could be used, for\nexample, to keep track of the order that class attributes are declared\nin by returning an ordered dictionary.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If the ``metaclass`` keyword argument is passed with the bases, it\n is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used.\n\n* Otherwise, the default metaclass (``type``) is used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\nHere is an example of a metaclass that uses an\n``collections.OrderedDict`` to remember the order that class members\nwere defined:\n\n class OrderedClass(type):\n\n @classmethod\n def __prepare__(metacls, name, bases, **kwds):\n return collections.OrderedDict()\n\n def __new__(cls, name, bases, classdict):\n result = type.__new__(cls, name, bases, dict(classdict))\n result.members = tuple(classdict)\n return result\n\n class A(metaclass=OrderedClass):\n def one(self): pass\n def two(self): pass\n def three(self): pass\n def four(self): pass\n\n >>> A.members\n (\'__module__\', \'one\', \'two\', \'three\', \'four\')\n\nWhen the class definition for *A* gets executed, the process begins\nwith calling the metaclass\'s ``__prepare__()`` method which returns an\nempty ``collections.OrderedDict``. That mapping records the methods\nand attributes of *A* as they are defined within the body of the class\nstatement. Once those definitions are executed, the ordered dictionary\nis fully populated and the metaclass\'s ``__new__()`` method gets\ninvoked. That method builds the new type and it saves the ordered\ndictionary keys in an attribute called *members*.\n\n\nCustomizing instance and subclass checks\n========================================\n\nThe following methods are used to override the default behavior of the\n``isinstance()`` and ``issubclass()`` built-in functions.\n\nIn particular, the metaclass ``abc.ABCMeta`` implements these methods\nin order to allow the addition of Abstract Base Classes (ABCs) as\n"virtual base classes" to any class or type (including built-in\ntypes), including other ABCs.\n\nclass.__instancecheck__(self, instance)\n\n Return true if *instance* should be considered a (direct or\n indirect) instance of *class*. If defined, called to implement\n ``isinstance(instance, class)``.\n\nclass.__subclasscheck__(self, subclass)\n\n Return true if *subclass* should be considered a (direct or\n indirect) subclass of *class*. If defined, called to implement\n ``issubclass(subclass, class)``.\n\nNote that these methods are looked up on the type (metaclass) of a\nclass. They cannot be defined as class methods in the actual class.\nThis is consistent with the lookup of special methods that are called\non instances, only in this case the instance is itself a class.\n\nSee also:\n\n **PEP 3119** - Introducing Abstract Base Classes\n Includes the specification for customizing ``isinstance()`` and\n ``issubclass()`` behavior through ``__instancecheck__()`` and\n ``__subclasscheck__()``, with motivation for this functionality\n in the context of adding Abstract Base Classes (see the ``abc``\n module) to the language.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``get()``,\n``clear()``, ``setdefault()``, ``pop()``, ``popitem()``, ``copy()``,\nand ``update()`` behaving similar to those for Python\'s standard\ndictionary objects. The ``collections`` module provides a\n``MutableMapping`` abstract base class to help create those methods\nfrom a base set of ``__getitem__()``, ``__setitem__()``,\n``__delitem__()``, and ``keys()``. Mutable sequences should provide\nmethods ``append()``, ``count()``, ``index()``, ``extend()``,\n``insert()``, ``pop()``, ``remove()``, ``reverse()`` and ``sort()``,\nlike Python standard list objects. Finally, sequence types should\nimplement addition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods ``__add__()``, ``__radd__()``,\n``__iadd__()``, ``__mul__()``, ``__rmul__()`` and ``__imul__()``\ndescribed below; they should not define other numerical operators. It\nis recommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should search the mapping\'s keys; for\nsequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``keys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__bool__()`` method and whose ``__len__()``\n method returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods. A\n call like\n\n a[1:2] = b\n\n is translated to\n\n a[slice(1, 2, None)] = b\n\n and so forth. Missing slice items are always filled in with\n ``None``.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``keys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` built-in to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` built-in will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects that\n support the sequence protocol should only provide\n ``__reversed__()`` if they can provide an implementation that is\n more efficient than the one provided by ``reversed()``.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n For objects that don\'t define ``__contains__()``, the membership\n test first tries iteration via ``__iter__()``, then the old\n sequence iteration protocol via ``__getitem__()``, see *this\n section in the language reference*.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``). For instance, to evaluate the expression ``x + y``, where\n *x* is an instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()``. Note that\n ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``) with reflected (swapped) operands. These functions are only\n called if the left operand does not support the corresponding\n operation and the operands are of different types. [2] For\n instance, to evaluate the expression ``x - y``, where *y* is an\n instance of a class that has an ``__rsub__()`` method,\n ``y.__rsub__(x)`` is called if ``x.__sub__(y)`` returns\n *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n assignments (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n assignment falls back to the normal methods. For instance, to\n execute the statement ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``float()`` and ``round()``. Should return a value of\n the appropriate type.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing, or in the\n built-in ``bin()``, ``hex()`` and ``oct()`` functions). Must return\n an integer.\n\n\nWith Statement Context Managers\n===============================\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nSpecial method lookup\n=====================\n\nFor custom classes, implicit invocations of special methods are only\nguaranteed to work correctly if defined on an object\'s type, not in\nthe object\'s instance dictionary. That behaviour is the reason why\nthe following code raises an exception:\n\n >>> class C:\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\n TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as ``__hash__()`` and ``__repr__()`` that are implemented\nby all objects, including type objects. If the implicit lookup of\nthese methods used the conventional lookup process, they would fail\nwhen invoked on the type object itself:\n\n >>> 1 .__hash__() == hash(1)\n True\n >>> int.__hash__() == hash(int)\n Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\n TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n >>> type(1).__hash__(1) == hash(1)\n True\n >>> type(int).__hash__(int) == hash(int)\n True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup generally also bypasses\nthe ``__getattribute__()`` method even of the object\'s metaclass:\n\n >>> class Meta(type):\n ... def __getattribute__(*args):\n ... print("Metaclass getattribute invoked")\n ... return type.__getattribute__(*args)\n ...\n >>> class C(object, metaclass=Meta):\n ... def __len__(self):\n ... return 10\n ... def __getattribute__(*args):\n ... print("Class getattribute invoked")\n ... return object.__getattribute__(*args)\n ...\n >>> c = C()\n >>> c.__len__() # Explicit lookup via instance\n Class getattribute invoked\n 10\n >>> type(c).__len__(c) # Explicit lookup via type\n Metaclass getattribute invoked\n 10\n >>> len(c) # Implicit lookup\n 10\n\nBypassing the ``__getattribute__()`` machinery in this fashion\nprovides significant scope for speed optimisations within the\ninterpreter, at the cost of some flexibility in the handling of\nspecial methods (the special method *must* be set on the class object\nitself in order to be consistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type, under\n certain controlled conditions. It generally isn\'t a good idea\n though, since it can lead to some very strange behaviour if it is\n handled incorrectly.\n\n[2] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n',
- 'string-methods': '\nString Methods\n**************\n\nString objects support the methods listed below. Note that none of\nthese methods take keyword arguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with its first character capitalized\n and the rest lowercased.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string as a bytes object. Default\n encoding is the current default string encoding. *errors* may be\n given to set a different error handling scheme. The default for\n *errors* is ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Changed in version 3.1: Support for keyword arguments added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the slice ``s[start:end]``.\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise. A character\n ``c`` is alphanumeric if one of the following returns ``True``:\n ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or\n ``c.isnumeric()``.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise. Alphabetic\n characters are those characters defined in the Unicode character\n database as "Letter", i.e., those with general category property\n being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is\n different from the "Alphabetic" property defined in the Unicode\n Standard.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters are those from general category "Nd". This category\n includes digit characters, and all characters that that can be used\n to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT\n ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise. Digits include decimal\n characters and digits that need special handling, such as the\n compatibility superscript digits. Formally, a digit is a character\n that has the property value Numeric_Type=Digit or\n Numeric_Type=Decimal.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise. Cased\n characters are those with general category property being one of\n "Lu", "Ll", or "Lt" and lowercase characters are those with general\n category property "Ll".\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH. Formally, numeric characters are those with the\n property value Numeric_Type=Digit, Numeric_Type=Decimal or\n Numeric_Type=Numeric.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise. Whitespace\n characters are those characters defined in the Unicode character\n database as "Other" or "Separator" and those with bidirectional\n property being one of "WS", "B", or "S".\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise. Cased\n characters are those with general category property being one of\n "Lu", "Ll", or "Lt" and uppercase characters are those with general\n category property "Lu".\n\nstr.join(iterable)\n\n Return a string which is the concatenation of the strings in the\n *iterable* *iterable*. A ``TypeError`` will be raised if there are\n any non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within ``s[start:end]``.\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string where words start with an\n uppercase character and the remaining characters are lowercase.\n\n The algorithm uses a simple language-independent definition of a\n word as groups of consecutive letters. The definition works in\n many contexts but it means that apostrophes in contractions and\n possessives form word boundaries, which may not be the desired\n result:\n\n >>> "they\'re bill\'s friends from the UK".title()\n "They\'Re Bill\'S Friends From The Uk"\n\n A workaround for apostrophes can be constructed using regular\n expressions:\n\n >>> import re\n >>> def titlecase(s):\n return re.sub(r"[A-Za-z]+(\'[A-Za-z]+)?",\n lambda mo: mo.group(0)[0].upper() +\n mo.group(0)[1:].lower(),\n s)\n\n >>> titlecase("they\'re bill\'s friends.")\n "They\'re Bill\'s Friends."\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n',
- 'strings': '\nString and Bytes literals\n*************************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "R"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= "\'\'\'" longstringitem* "\'\'\'" | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | stringescapeseq\n longstringitem ::= longstringchar | stringescapeseq\n shortstringchar ::= <any source character except "\\" or newline or the quote>\n longstringchar ::= <any source character except "\\">\n stringescapeseq ::= "\\" <any source character>\n\n bytesliteral ::= bytesprefix(shortbytes | longbytes)\n bytesprefix ::= "b" | "B" | "br" | "Br" | "bR" | "BR"\n shortbytes ::= "\'" shortbytesitem* "\'" | \'"\' shortbytesitem* \'"\'\n longbytes ::= "\'\'\'" longbytesitem* "\'\'\'" | \'"""\' longbytesitem* \'"""\'\n shortbytesitem ::= shortbyteschar | bytesescapeseq\n longbytesitem ::= longbyteschar | bytesescapeseq\n shortbyteschar ::= <any ASCII character except "\\" or newline or the quote>\n longbyteschar ::= <any ASCII character except "\\">\n bytesescapeseq ::= "\\" <any ASCII character>\n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** or\n**bytesprefix** and the rest of the literal. The source character set\nis defined by the encoding declaration; it is UTF-8 if no encoding\ndeclaration is given in the source file; see section *Encoding\ndeclarations*.\n\nIn plain English: Both types of literals can be enclosed in matching\nsingle quotes (``\'``) or double quotes (``"``). They can also be\nenclosed in matching groups of three single or double quotes (these\nare generally referred to as *triple-quoted strings*). The backslash\n(``\\``) character is used to escape characters that otherwise have a\nspecial meaning, such as newline, backslash itself, or the quote\ncharacter.\n\nBytes literals are always prefixed with ``\'b\'`` or ``\'B\'``; they\nproduce an instance of the ``bytes`` type instead of the ``str`` type.\nThey may only contain ASCII characters; bytes with a numeric value of\n128 or greater must be expressed with escapes.\n\nBoth string and bytes literals may optionally be prefixed with a\nletter ``\'r\'`` or ``\'R\'``; such strings are called *raw strings* and\ntreat backslashes as literal characters. As a result, in string\nliterals, ``\'\\U\'`` and ``\'\\u\'`` escapes in raw strings are not treated\nspecially.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Backslash and newline ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (1,3) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (2,3) |\n+-------------------+-----------------------------------+---------+\n\nEscape sequences only recognized in string literals are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (4) |\n| | *xxxx* | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (5) |\n| | *xxxxxxxx* | |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. As in Standard C, up to three octal digits are accepted.\n\n2. Unlike in Standard C, exactly two hex digits are required.\n\n3. In a bytes literal, hexadecimal and octal escapes denote the byte\n with the given value. In a string literal, these escapes denote a\n Unicode character with the given value.\n\n4. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence. Exactly four hex digits are\n required.\n\n5. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Exactly eight hex digits are required.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences only recognized in string\nliterals fall into the category of unrecognized escapes for bytes\nliterals.\n\nEven in a raw string, string quotes can be escaped with a backslash,\nbut the backslash remains in the string; for example, ``r"\\""`` is a\nvalid string literal consisting of two characters: a backslash and a\ndouble quote; ``r"\\"`` is not a valid string literal (even a raw\nstring cannot end in an odd number of backslashes). Specifically, *a\nraw string cannot end in a single backslash* (since the backslash\nwould escape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n',
+ 'specialnames': '\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is roughly equivalent to ``type(x).__getitem__(x,\ni)``. Except where mentioned, attempts to execute an operation raise\nan exception when no appropriate method is defined (typically\n``AttributeError`` or ``TypeError``).\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_info()[2]`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.last_traceback``. Circular references which are garbage are\n detected when the option cycle detector is enabled (it\'s on by\n default), but can only be cleaned up if there are no Python-\n level ``__del__()`` methods involved. Refer to the documentation\n for the ``gc`` module for more information about how\n ``__del__()`` methods are handled by the cycle detector,\n particularly the description of the ``garbage`` value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted or in the process of being torn down (e.g. the\n import machinery shutting down). For this reason, ``__del__()``\n methods should do the absolute minimum needed to maintain\n external invariants. Starting with version 1.5, Python\n guarantees that globals whose name begins with a single\n underscore are deleted from their module before other globals are\n deleted; if no other references to such globals exist, this may\n help in assuring that imported modules are still available at the\n time when the ``__del__()`` method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function to compute the\n "official" string representation of an object. If at all possible,\n this should look like a valid Python expression that could be used\n to recreate an object with the same value (given an appropriate\n environment). If this is not possible, a string of the form\n ``<...some useful description...>`` should be returned. The return\n value must be a string object. If a class defines ``__repr__()``\n but not ``__str__()``, then ``__repr__()`` is also used when an\n "informal" string representation of instances of that class is\n required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print()``\n function to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__format__(self, format_spec)\n\n Called by the ``format()`` built-in function (and by extension, the\n ``format()`` method of class ``str``) to produce a "formatted"\n string representation of an object. The ``format_spec`` argument is\n a string that contains a description of the formatting options\n desired. The interpretation of the ``format_spec`` argument is up\n to the type implementing ``__format__()``, however most classes\n will either delegate formatting to one of the built-in types, or\n use a similar formatting option syntax.\n\n See *Format Specification Mini-Language* for a description of the\n standard formatting syntax.\n\n The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n These are the so-called "rich comparison" methods. The\n correspondence between operator symbols and method names is as\n follows: ``x<y`` calls ``x.__lt__(y)``, ``x<=y`` calls\n ``x.__le__(y)``, ``x==y`` calls ``x.__eq__(y)``, ``x!=y`` calls\n ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and ``x>=y`` calls\n ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\n To automatically generate ordering operations from a single root\n operation, see ``functools.total_ordering()``.\n\nobject.__hash__(self)\n\n Called by built-in function ``hash()`` and for operations on\n members of hashed collections including ``set``, ``frozenset``, and\n ``dict``. ``__hash__()`` should return an integer. The only\n required property is that objects which compare equal have the same\n hash value; it is advised to somehow mix together (e.g. using\n exclusive or) the hash values for the components of the object that\n also play a part in comparison of objects.\n\n If a class does not define an ``__eq__()`` method it should not\n define a ``__hash__()`` operation either; if it defines\n ``__eq__()`` but not ``__hash__()``, its instances will not be\n usable as items in hashable collections. If a class defines\n mutable objects and implements an ``__eq__()`` method, it should\n not implement ``__hash__()``, since the implementation of hashable\n collections requires that a key\'s hash value is immutable (if the\n object\'s hash value changes, it will be in the wrong hash bucket).\n\n User-defined classes have ``__eq__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__eq__()`` such that the hash value\n returned is no longer appropriate (e.g. by switching to a value-\n based concept of equality instead of the default identity based\n equality) can explicitly flag themselves as being unhashable by\n setting ``__hash__ = None`` in the class definition. Doing so means\n that not only will instances of the class raise an appropriate\n ``TypeError`` when a program attempts to retrieve their hash value,\n but they will also be correctly identified as unhashable when\n checking ``isinstance(obj, collections.Hashable)`` (unlike classes\n which define their own ``__hash__()`` to explicitly raise\n ``TypeError``).\n\n If a class that overrides ``__eq__()`` needs to retain the\n implementation of ``__hash__()`` from a parent class, the\n interpreter must be told this explicitly by setting ``__hash__ =\n <ParentClass>.__hash__``. Otherwise the inheritance of\n ``__hash__()`` will be blocked, just as if ``__hash__`` had been\n explicitly set to ``None``.\n\nobject.__bool__(self)\n\n Called to implement truth value testing and the built-in operation\n ``bool()``; should return ``False`` or ``True``. When this method\n is not defined, ``__len__()`` is called, if it is defined, and the\n object is considered true if its result is nonzero. If a class\n defines neither ``__len__()`` nor ``__bool__()``, all its instances\n are considered true.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control over attribute access.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n built-in functions. See *Special method lookup*.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should call the base class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\nobject.__dir__(self)\n\n Called when ``dir()`` is called on the object. A list must be\n returned.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in an\n*owner* class (the descriptor must be in either the owner\'s class\ndictionary or in the class dictionary for one of its parents). In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' ``__dict__``.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called.\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to an object instance, ``a.x`` is transformed into the\n call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a class, ``A.x`` is transformed into the call:\n ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, obj.__class__)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. A descriptor can define\nany combination of ``__get__()``, ``__set__()`` and ``__delete__()``.\nIf it does not define ``__get__()``, then accessing the attribute will\nreturn the descriptor object itself unless there is a value in the\nobject\'s instance dictionary. If the descriptor defines ``__set__()``\nand/or ``__delete__()``, it is a data descriptor; if it defines\nneither, it is a non-data descriptor. Normally, data descriptors\ndefine both ``__get__()`` and ``__set__()``, while non-data\ndescriptors have just the ``__get__()`` method. Data descriptors with\n``__set__()`` and ``__get__()`` defined always override a redefinition\nin an instance dictionary. In contrast, non-data descriptors can be\noverridden by instances.\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of classes have a dictionary for attribute\nstorage. This wastes space for objects having very few instance\nvariables. The space consumption can become acute when creating large\nnumbers of instances.\n\nThe default can be overridden by defining *__slots__* in a class\ndefinition. The *__slots__* declaration takes a sequence of instance\nvariables and reserves just enough space in each instance to hold a\nvalue for each variable. Space is saved because *__dict__* is not\ncreated for each instance.\n\nobject.__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n class, *__slots__* reserves space for the declared variables and\n prevents the automatic creation of *__dict__* and *__weakref__* for\n each instance.\n\n\nNotes on using *__slots__*\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__* (which must only contain names\n of any *additional* slots).\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* Nonempty *__slots__* does not work for classes derived from\n "variable-length" built-in types such as ``int``, ``str`` and\n ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, classes are constructed using ``type()``. A class\ndefinition is read into a separate namespace and the value of class\nname is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if a callable ``metaclass`` keyword\nargument is passed after the bases in the class definition, the\ncallable given will be called instead of ``type()``. If other keyword\narguments are passed, they will also be passed to the metaclass. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\nIf the metaclass has a ``__prepare__()`` attribute (usually\nimplemented as a class or static method), it is called before the\nclass body is evaluated with the name of the class and a tuple of its\nbases for arguments. It should return an object that supports the\nmapping interface that will be used to store the namespace of the\nclass. The default is a plain dictionary. This could be used, for\nexample, to keep track of the order that class attributes are declared\nin by returning an ordered dictionary.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If the ``metaclass`` keyword argument is passed with the bases, it\n is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used.\n\n* Otherwise, the default metaclass (``type``) is used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\nHere is an example of a metaclass that uses an\n``collections.OrderedDict`` to remember the order that class members\nwere defined:\n\n class OrderedClass(type):\n\n @classmethod\n def __prepare__(metacls, name, bases, **kwds):\n return collections.OrderedDict()\n\n def __new__(cls, name, bases, classdict):\n result = type.__new__(cls, name, bases, dict(classdict))\n result.members = tuple(classdict)\n return result\n\n class A(metaclass=OrderedClass):\n def one(self): pass\n def two(self): pass\n def three(self): pass\n def four(self): pass\n\n >>> A.members\n (\'__module__\', \'one\', \'two\', \'three\', \'four\')\n\nWhen the class definition for *A* gets executed, the process begins\nwith calling the metaclass\'s ``__prepare__()`` method which returns an\nempty ``collections.OrderedDict``. That mapping records the methods\nand attributes of *A* as they are defined within the body of the class\nstatement. Once those definitions are executed, the ordered dictionary\nis fully populated and the metaclass\'s ``__new__()`` method gets\ninvoked. That method builds the new type and it saves the ordered\ndictionary keys in an attribute called ``members``.\n\n\nCustomizing instance and subclass checks\n========================================\n\nThe following methods are used to override the default behavior of the\n``isinstance()`` and ``issubclass()`` built-in functions.\n\nIn particular, the metaclass ``abc.ABCMeta`` implements these methods\nin order to allow the addition of Abstract Base Classes (ABCs) as\n"virtual base classes" to any class or type (including built-in\ntypes), including other ABCs.\n\nclass.__instancecheck__(self, instance)\n\n Return true if *instance* should be considered a (direct or\n indirect) instance of *class*. If defined, called to implement\n ``isinstance(instance, class)``.\n\nclass.__subclasscheck__(self, subclass)\n\n Return true if *subclass* should be considered a (direct or\n indirect) subclass of *class*. If defined, called to implement\n ``issubclass(subclass, class)``.\n\nNote that these methods are looked up on the type (metaclass) of a\nclass. They cannot be defined as class methods in the actual class.\nThis is consistent with the lookup of special methods that are called\non instances, only in this case the instance is itself a class.\n\nSee also:\n\n **PEP 3119** - Introducing Abstract Base Classes\n Includes the specification for customizing ``isinstance()`` and\n ``issubclass()`` behavior through ``__instancecheck__()`` and\n ``__subclasscheck__()``, with motivation for this functionality\n in the context of adding Abstract Base Classes (see the ``abc``\n module) to the language.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``get()``,\n``clear()``, ``setdefault()``, ``pop()``, ``popitem()``, ``copy()``,\nand ``update()`` behaving similar to those for Python\'s standard\ndictionary objects. The ``collections`` module provides a\n``MutableMapping`` abstract base class to help create those methods\nfrom a base set of ``__getitem__()``, ``__setitem__()``,\n``__delitem__()``, and ``keys()``. Mutable sequences should provide\nmethods ``append()``, ``count()``, ``index()``, ``extend()``,\n``insert()``, ``pop()``, ``remove()``, ``reverse()`` and ``sort()``,\nlike Python standard list objects. Finally, sequence types should\nimplement addition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods ``__add__()``, ``__radd__()``,\n``__iadd__()``, ``__mul__()``, ``__rmul__()`` and ``__imul__()``\ndescribed below; they should not define other numerical operators. It\nis recommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should search the mapping\'s keys; for\nsequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``keys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__bool__()`` method and whose ``__len__()``\n method returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods. A\n call like\n\n a[1:2] = b\n\n is translated to\n\n a[slice(1, 2, None)] = b\n\n and so forth. Missing slice items are always filled in with\n ``None``.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``keys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` built-in to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` built-in will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects that\n support the sequence protocol should only provide\n ``__reversed__()`` if they can provide an implementation that is\n more efficient than the one provided by ``reversed()``.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n For objects that don\'t define ``__contains__()``, the membership\n test first tries iteration via ``__iter__()``, then the old\n sequence iteration protocol via ``__getitem__()``, see *this\n section in the language reference*.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``). For instance, to evaluate the expression ``x + y``, where\n *x* is an instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()``. Note that\n ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``) with reflected (swapped) operands. These functions are only\n called if the left operand does not support the corresponding\n operation and the operands are of different types. [2] For\n instance, to evaluate the expression ``x - y``, where *y* is an\n instance of a class that has an ``__rsub__()`` method,\n ``y.__rsub__(x)`` is called if ``x.__sub__(y)`` returns\n *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n assignments (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n assignment falls back to the normal methods. For instance, to\n execute the statement ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``float()`` and ``round()``. Should return a value of\n the appropriate type.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing, or in the\n built-in ``bin()``, ``hex()`` and ``oct()`` functions). Must return\n an integer.\n\n\nWith Statement Context Managers\n===============================\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nSpecial method lookup\n=====================\n\nFor custom classes, implicit invocations of special methods are only\nguaranteed to work correctly if defined on an object\'s type, not in\nthe object\'s instance dictionary. That behaviour is the reason why\nthe following code raises an exception:\n\n >>> class C:\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\n TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as ``__hash__()`` and ``__repr__()`` that are implemented\nby all objects, including type objects. If the implicit lookup of\nthese methods used the conventional lookup process, they would fail\nwhen invoked on the type object itself:\n\n >>> 1 .__hash__() == hash(1)\n True\n >>> int.__hash__() == hash(int)\n Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\n TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n >>> type(1).__hash__(1) == hash(1)\n True\n >>> type(int).__hash__(int) == hash(int)\n True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup generally also bypasses\nthe ``__getattribute__()`` method even of the object\'s metaclass:\n\n >>> class Meta(type):\n ... def __getattribute__(*args):\n ... print("Metaclass getattribute invoked")\n ... return type.__getattribute__(*args)\n ...\n >>> class C(object, metaclass=Meta):\n ... def __len__(self):\n ... return 10\n ... def __getattribute__(*args):\n ... print("Class getattribute invoked")\n ... return object.__getattribute__(*args)\n ...\n >>> c = C()\n >>> c.__len__() # Explicit lookup via instance\n Class getattribute invoked\n 10\n >>> type(c).__len__(c) # Explicit lookup via type\n Metaclass getattribute invoked\n 10\n >>> len(c) # Implicit lookup\n 10\n\nBypassing the ``__getattribute__()`` machinery in this fashion\nprovides significant scope for speed optimisations within the\ninterpreter, at the cost of some flexibility in the handling of\nspecial methods (the special method *must* be set on the class object\nitself in order to be consistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type, under\n certain controlled conditions. It generally isn\'t a good idea\n though, since it can lead to some very strange behaviour if it is\n handled incorrectly.\n\n[2] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n',
+ 'string-methods': '\nString Methods\n**************\n\nString objects support the methods listed below.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with its first character capitalized\n and the rest lowercased.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode(encoding="utf-8", errors="strict")\n\n Return an encoded version of the string as a bytes object. Default\n encoding is ``\'utf-8\'``. *errors* may be given to set a different\n error handling scheme. The default for *errors* is ``\'strict\'``,\n meaning that encoding errors raise a ``UnicodeError``. Other\n possible values are ``\'ignore\'``, ``\'replace\'``,\n ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and any other name\n registered via ``codecs.register_error()``, see section *Codec Base\n Classes*. For a list of possible encodings, see section *Standard\n Encodings*.\n\n Changed in version 3.1: Support for keyword arguments added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the slice ``s[start:end]``.\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The string on which this\n method is called can contain literal text or replacement fields\n delimited by braces ``{}``. Each replacement field contains either\n the numeric index of a positional argument, or the name of a\n keyword argument. Returns a copy of the string where each\n replacement field is replaced with the string value of the\n corresponding argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.format_map(mapping)\n\n Similar to ``str.format(**mapping)``, except that ``mapping`` is\n used directly and not copied to a ``dict`` . This is useful if for\n example ``mapping`` is a dict subclass:\n\n >>> class Default(dict):\n ... def __missing__(self, key):\n ... return key\n ...\n >>> \'{name} was born in {country}\'.format_map(Default(name=\'Guido\'))\n \'Guido was born in country\'\n\n New in version 3.2.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise. A character\n ``c`` is alphanumeric if one of the following returns ``True``:\n ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or\n ``c.isnumeric()``.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise. Alphabetic\n characters are those characters defined in the Unicode character\n database as "Letter", i.e., those with general category property\n being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is\n different from the "Alphabetic" property defined in the Unicode\n Standard.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters are those from general category "Nd". This category\n includes digit characters, and all characters that that can be used\n to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT\n ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise. Digits include decimal\n characters and digits that need special handling, such as the\n compatibility superscript digits. Formally, a digit is a character\n that has the property value Numeric_Type=Digit or\n Numeric_Type=Decimal.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise. Cased\n characters are those with general category property being one of\n "Lu", "Ll", or "Lt" and lowercase characters are those with general\n category property "Ll".\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH. Formally, numeric characters are those with the\n property value Numeric_Type=Digit, Numeric_Type=Decimal or\n Numeric_Type=Numeric.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise. Whitespace\n characters are those characters defined in the Unicode character\n database as "Other" or "Separator" and those with bidirectional\n property being one of "WS", "B", or "S".\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise. Cased\n characters are those with general category property being one of\n "Lu", "Ll", or "Lt" and uppercase characters are those with general\n category property "Lu".\n\nstr.join(iterable)\n\n Return a string which is the concatenation of the strings in the\n *iterable* *iterable*. A ``TypeError`` will be raised if there are\n any non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within ``s[start:end]``.\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string where words start with an\n uppercase character and the remaining characters are lowercase.\n\n The algorithm uses a simple language-independent definition of a\n word as groups of consecutive letters. The definition works in\n many contexts but it means that apostrophes in contractions and\n possessives form word boundaries, which may not be the desired\n result:\n\n >>> "they\'re bill\'s friends from the UK".title()\n "They\'Re Bill\'S Friends From The Uk"\n\n A workaround for apostrophes can be constructed using regular\n expressions:\n\n >>> import re\n >>> def titlecase(s):\n return re.sub(r"[A-Za-z]+(\'[A-Za-z]+)?",\n lambda mo: mo.group(0)[0].upper() +\n mo.group(0)[1:].lower(),\n s)\n\n >>> titlecase("they\'re bill\'s friends.")\n "They\'re Bill\'s Friends."\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n',
+ 'strings': '\nString and Bytes literals\n*************************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "R"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= "\'\'\'" longstringitem* "\'\'\'" | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | stringescapeseq\n longstringitem ::= longstringchar | stringescapeseq\n shortstringchar ::= <any source character except "\\" or newline or the quote>\n longstringchar ::= <any source character except "\\">\n stringescapeseq ::= "\\" <any source character>\n\n bytesliteral ::= bytesprefix(shortbytes | longbytes)\n bytesprefix ::= "b" | "B" | "br" | "Br" | "bR" | "BR"\n shortbytes ::= "\'" shortbytesitem* "\'" | \'"\' shortbytesitem* \'"\'\n longbytes ::= "\'\'\'" longbytesitem* "\'\'\'" | \'"""\' longbytesitem* \'"""\'\n shortbytesitem ::= shortbyteschar | bytesescapeseq\n longbytesitem ::= longbyteschar | bytesescapeseq\n shortbyteschar ::= <any ASCII character except "\\" or newline or the quote>\n longbyteschar ::= <any ASCII character except "\\">\n bytesescapeseq ::= "\\" <any ASCII character>\n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the ``stringprefix`` or\n``bytesprefix`` and the rest of the literal. The source character set\nis defined by the encoding declaration; it is UTF-8 if no encoding\ndeclaration is given in the source file; see section *Encoding\ndeclarations*.\n\nIn plain English: Both types of literals can be enclosed in matching\nsingle quotes (``\'``) or double quotes (``"``). They can also be\nenclosed in matching groups of three single or double quotes (these\nare generally referred to as *triple-quoted strings*). The backslash\n(``\\``) character is used to escape characters that otherwise have a\nspecial meaning, such as newline, backslash itself, or the quote\ncharacter.\n\nBytes literals are always prefixed with ``\'b\'`` or ``\'B\'``; they\nproduce an instance of the ``bytes`` type instead of the ``str`` type.\nThey may only contain ASCII characters; bytes with a numeric value of\n128 or greater must be expressed with escapes.\n\nBoth string and bytes literals may optionally be prefixed with a\nletter ``\'r\'`` or ``\'R\'``; such strings are called *raw strings* and\ntreat backslashes as literal characters. As a result, in string\nliterals, ``\'\\U\'`` and ``\'\\u\'`` escapes in raw strings are not treated\nspecially.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Backslash and newline ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (1,3) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (2,3) |\n+-------------------+-----------------------------------+---------+\n\nEscape sequences only recognized in string literals are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (4) |\n| | *xxxx* | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (5) |\n| | *xxxxxxxx* | |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. As in Standard C, up to three octal digits are accepted.\n\n2. Unlike in Standard C, exactly two hex digits are required.\n\n3. In a bytes literal, hexadecimal and octal escapes denote the byte\n with the given value. In a string literal, these escapes denote a\n Unicode character with the given value.\n\n4. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence. Exactly four hex digits are\n required.\n\n5. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Exactly eight hex digits are required.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences only recognized in string\nliterals fall into the category of unrecognized escapes for bytes\nliterals.\n\nEven in a raw string, string quotes can be escaped with a backslash,\nbut the backslash remains in the string; for example, ``r"\\""`` is a\nvalid string literal consisting of two characters: a backslash and a\ndouble quote; ``r"\\"`` is not a valid string literal (even a raw\nstring cannot end in an odd number of backslashes). Specifically, *a\nraw string cannot end in a single backslash* (since the backslash\nwould escape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n',
'subscriptions': '\nSubscriptions\n*************\n\nA subscription selects an item of a sequence (string, tuple or list)\nor mapping (dictionary) object:\n\n subscription ::= primary "[" expression_list "]"\n\nThe primary must evaluate to an object that supports subscription,\ne.g. a list or dictionary. User-defined objects can support\nsubscription by defining a ``__getitem__()`` method.\n\nFor built-in objects, there are two types of objects that support\nsubscription:\n\nIf the primary is a mapping, the expression list must evaluate to an\nobject whose value is one of the keys of the mapping, and the\nsubscription selects the value in the mapping that corresponds to that\nkey. (The expression list is a tuple except if it has exactly one\nitem.)\n\nIf the primary is a sequence, the expression (list) must evaluate to\nan integer or a slice (as discussed in the following section).\n\nThe formal syntax makes no special provision for negative indices in\nsequences; however, built-in sequences all provide a ``__getitem__()``\nmethod that interprets negative indices by adding the length of the\nsequence to the index (so that ``x[-1]`` selects the last item of\n``x``). The resulting value must be a nonnegative integer less than\nthe number of items in the sequence, and the subscription selects the\nitem whose index is that value (counting from zero). Since the support\nfor negative indices and slicing occurs in the object\'s\n``__getitem__()`` method, subclasses overriding this method will need\nto explicitly add that support.\n\nA string\'s items are characters. A character is not a separate data\ntype but a string of exactly one character.\n',
'truth': "\nTruth Value Testing\n*******************\n\nAny object can be tested for truth value, for use in an ``if`` or\n``while`` condition or as operand of the Boolean operations below. The\nfollowing values are considered false:\n\n* ``None``\n\n* ``False``\n\n* zero of any numeric type, for example, ``0``, ``0.0``, ``0j``.\n\n* any empty sequence, for example, ``''``, ``()``, ``[]``.\n\n* any empty mapping, for example, ``{}``.\n\n* instances of user-defined classes, if the class defines a\n ``__bool__()`` or ``__len__()`` method, when that method returns the\n integer zero or ``bool`` value ``False``. [1]\n\nAll other values are considered true --- so objects of many types are\nalways true.\n\nOperations and built-in functions that have a Boolean result always\nreturn ``0`` or ``False`` for false and ``1`` or ``True`` for true,\nunless otherwise stated. (Important exception: the Boolean operations\n``or`` and ``and`` always return one of their operands.)\n",
'try': '\nThe ``try`` statement\n*********************\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["as" target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object or a tuple containing an item compatible with the\nexception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the ``as`` keyword in that except clause,\nif present, and the except clause\'s suite is executed. All except\nclauses must have an executable block. When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using ``as target``, it is cleared\nat the end of the except clause. This is as if\n\n except E as N:\n foo\n\nwas translated to\n\n except E as N:\n try:\n foo\n finally:\n del N\n\nThis means the exception must be assigned to a different name to be\nable to refer to it after the except clause. Exceptions are cleared\nbecause with the traceback attached to them, they form a reference\ncycle with the stack frame, keeping all locals in that frame alive\nuntil the next garbage collection occurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the ``sys`` module and can be access via\n``sys.exc_info()``. ``sys.exc_info()`` returns a 3-tuple consisting of\nthe exception class, the exception instance and a traceback object\n(see section *The standard type hierarchy*) identifying the point in\nthe program where the exception occurred. ``sys.exc_info()`` values\nare restored to their previous values (before the call) when returning\nfrom a function that handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n',
'types': '\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.), although such additions\nwill often be provided via the standard library instead.\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the literal ``...`` or the\n built-in name ``Ellipsis``. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are two types of integers:\n\n Integers (``int``)\n\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans (``bool``)\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of the integer\n type, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex`` (``complex``)\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string object are Unicode code units. A\n Unicode code unit is represented by a string object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``chr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the string method ``encode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Bytes\n A bytes object is an immutable array. The items are 8-bit\n bytes, represented by integers in the range 0 <= x < 256.\n Bytes literals (like ``b\'abc\'`` and the built-in function\n ``bytes()`` can be used to construct bytes objects. Also,\n bytes objects can be decoded to strings via the ``decode()``\n method.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There are currently two intrinsic mutable sequence types:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n Byte Arrays\n A bytearray object is a mutable array. They are created by\n the built-in ``bytearray()`` constructor. Aside from being\n mutable (and hence unhashable), byte arrays otherwise provide\n the same interface and functionality as immutable bytes\n objects.\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type, as does the ``collections`` module.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm.ndbm`` and ``dbm.gnu`` provide\n additional examples of mapping types, as does the\n ``collections`` module.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +---------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +===========================+=================================+=============+\n | ``__doc__`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +---------------------------+---------------------------------+-------------+\n | ``__name__`` | The function\'s name | Writable |\n +---------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +---------------------------+---------------------------------+-------------+\n | ``__defaults__`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +---------------------------+---------------------------------+-------------+\n | ``__code__`` | The code object representing | Writable |\n | | the compiled function body. | |\n +---------------------------+---------------------------------+-------------+\n | ``__globals__`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +---------------------------+---------------------------------+-------------+\n | ``__dict__`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +---------------------------+---------------------------------+-------------+\n | ``__closure__`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +---------------------------+---------------------------------+-------------+\n | ``__annotations__`` | A dict containing annotations | Writable |\n | | of parameters. The keys of the | |\n | | dict are the parameter names, | |\n | | or ``\'return\'`` for the return | |\n | | annotation, if provided. | |\n +---------------------------+---------------------------------+-------------+\n | ``__kwdefaults__`` | A dict containing defaults for | Writable |\n | | keyword-only parameters. | |\n +---------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n Instance methods\n An instance method object combines a class, a class instance and\n any callable object (normally a user-defined function).\n\n Special read-only attributes: ``__self__`` is the class instance\n object, ``__func__`` is the function object; ``__doc__`` is the\n method\'s documentation (same as ``__func__.__doc__``);\n ``__name__`` is the method name (same as ``__func__.__name__``);\n ``__module__`` is the name of the module the method was defined\n in, or ``None`` if unavailable.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object or a class\n method object.\n\n When an instance method object is created by retrieving a user-\n defined function object from a class via one of its instances,\n its ``__self__`` attribute is the instance, and the method\n object is said to be bound. The new method\'s ``__func__``\n attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``__func__``\n attribute of the new instance is not the original method object\n but its ``__func__`` attribute.\n\n When an instance method object is created by retrieving a class\n method object from a class or instance, its ``__self__``\n attribute is the class itself, and its ``__func__`` attribute is\n the function object underlying the class method.\n\n When an instance method object is called, the underlying\n function (``__func__``) is called, inserting the class instance\n (``__self__``) in front of the argument list. For instance,\n when ``C`` is a class which contains a definition for a function\n ``f()``, and ``x`` is an instance of ``C``, calling ``x.f(1)``\n is equivalent to calling ``C.f(x, 1)``.\n\n When an instance method object is derived from a class method\n object, the "class instance" stored in ``__self__`` will\n actually be the class itself, so that calling either ``x.f(1)``\n or ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to instance\n method object happens each time the attribute is retrieved from\n the instance. In some cases, a fruitful optimization is to\n assign the attribute to a local variable and call that local\n variable. Also notice that this transformation only happens for\n user-defined functions; other callable objects (and all non-\n callable objects) are retrieved without transformation. It is\n also important to note that user-defined functions which are\n attributes of a class instance are not converted to bound\n methods; this *only* happens when the function is an attribute\n of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``__next__()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *alist*.\n\n Classes\n Classes are callable. These objects normally act as factories\n for new instances of themselves, but variations are possible for\n class types that override ``__new__()``. The arguments of the\n call are passed to ``__new__()`` and, in the typical case, to\n ``__init__()`` to initialize the new instance.\n\n Class Instances\n Instances of arbitrary classes can be made callable by defining\n a ``__call__()`` method in their class.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n __globals__ attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n **CPython implementation detail:** Because of the way CPython\n clears module dictionaries, the module dictionary will be cleared\n when the module falls out of scope even if the dictionary still has\n live references. To avoid this, copy the dictionary or keep the\n module around while using its dictionary directly.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nCustom classes\n Custom class types are typically created by class definitions (see\n section *Class definitions*). A class has a namespace implemented\n by a dictionary object. Class attribute references are translated\n to lookups in this dictionary, e.g., ``C.x`` is translated to\n ``C.__dict__["x"]`` (although there are a number of hooks which\n allow for other means of locating attributes). When the attribute\n name is not found there, the attribute search continues in the base\n classes. This search of the base classes uses the C3 method\n resolution order which behaves correctly even in the presence of\n \'diamond\' inheritance structures where there are multiple\n inheritance paths leading back to a common ancestor. Additional\n details on the C3 MRO used by Python can be found in the\n documentation accompanying the 2.3 release at\n http://www.python.org/download/releases/2.3/mro/.\n\n When a class attribute reference (for class ``C``, say) would yield\n a class method object, it is transformed into an instance method\n object whose ``__self__`` attributes is ``C``. When it would yield\n a static method object, it is transformed into the object wrapped\n by the static method object. See section *Implementing Descriptors*\n for another way in which attributes retrieved from a class may\n differ from those actually contained in its ``__dict__``.\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object, it is transformed into an instance method object\n whose ``__self__`` attribute is the instance. Static method and\n class method objects are also transformed; see above under\n "Classes". See section *Implementing Descriptors* for another way\n in which attributes of a class retrieved via its instances may\n differ from the objects actually stored in the class\'s\n ``__dict__``. If no class attribute is found, and the object\'s\n class has a ``__getattr__()`` method, that is called to satisfy the\n lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nI/O objects (also known as file objects)\n A *file object* represents an open file. Various shortcuts are\n available to create file objects: the ``open()`` built-in function,\n and also ``os.popen()``, ``os.fdopen()``, and the ``makefile()``\n method of socket objects (and perhaps by other functions or methods\n provided by extension modules).\n\n The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are\n initialized to file objects corresponding to the interpreter\'s\n standard input, output and error streams; they are all open in text\n mode and therefore follow the interface defined by the\n ``io.TextIOBase`` abstract class.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_lasti`` gives the precise instruction (this is an index into\n the bytecode string of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_lineno`` is the current line number\n of the frame --- writing to this from within a trace function\n jumps to the given line (only for the bottom-most frame). A\n debugger can implement a Jump command (aka Set Next Statement)\n by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as the third item of the\n tuple returned by ``sys.exc_info()``. When the program contains\n no suitable handler, the stack trace is written (nicely\n formatted) to the standard error stream; if the interpreter is\n interactive, it is also made available to the user as\n ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices for ``__getitem__()``\n methods. They are also created by the built-in ``slice()``\n function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the slice that the slice object\n would describe if applied to a sequence of *length* items.\n It returns a tuple of three integers; respectively these are\n the *start* and *stop* indices and the *step* or stride\n length of the slice. Missing or out-of-bounds indices are\n handled in a manner consistent with regular slices.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n',
'typesfunctions': '\nFunctions\n*********\n\nFunction objects are created by function definitions. The only\noperation on a function object is to call it: ``func(argument-list)``.\n\nThere are really two flavors of function objects: built-in functions\nand user-defined functions. Both support the same operation (to call\nthe function), but the implementation is different, hence the\ndifferent object types.\n\nSee *Function definitions* for more information.\n',
- 'typesmapping': '\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass class dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key\n is specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 1, "two": 2}``:\n\n * ``dict(one=1, two=2)``\n\n * ``dict({\'one\': 1, \'two\': 2})``\n\n * ``dict(zip((\'one\', \'two\'), (1, 2)))``\n\n * ``dict([[\'two\', 2], [\'one\', 1]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n If a subclass of dict defines a method ``__missing__()``, if the\n key *key* is not present, the ``d[key]`` operation calls that\n method with the key *key* as argument. The ``d[key]`` operation\n then returns or raises whatever is returned or raised by the\n ``__missing__(key)`` call if the key is not present. No other\n operations or methods invoke ``__missing__()``. If\n ``__missing__()`` is not defined, ``KeyError`` is raised.\n ``__missing__()`` must be a method; it cannot be an instance\n variable. For an example, see ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n iter(d)\n\n Return an iterator over the keys of the dictionary. This is a\n shortcut for ``iter(d.keys())``.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n classmethod fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n items()\n\n Return a new view of the dictionary\'s items (``(key, value)``\n pairs). See below for documentation of view objects.\n\n keys()\n\n Return a new view of the dictionary\'s keys. See below for\n documentation of view objects.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as tuples or other iterables of\n length two). If keyword arguments are specified, the dictionary\n is then updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n values()\n\n Return a new view of the dictionary\'s values. See below for\n documentation of view objects.\n\n\nDictionary view objects\n=======================\n\nThe objects returned by ``dict.keys()``, ``dict.values()`` and\n``dict.items()`` are *view objects*. They provide a dynamic view on\nthe dictionary\'s entries, which means that when the dictionary\nchanges, the view reflects these changes.\n\nDictionary views can be iterated over to yield their respective data,\nand support membership tests:\n\nlen(dictview)\n\n Return the number of entries in the dictionary.\n\niter(dictview)\n\n Return an iterator over the keys, values or items (represented as\n tuples of ``(key, value)``) in the dictionary.\n\n Keys and values are iterated over in an arbitrary order which is\n non-random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If keys,\n values and items views are iterated over with no intervening\n modifications to the dictionary, the order of items will directly\n correspond. This allows the creation of ``(value, key)`` pairs\n using ``zip()``: ``pairs = zip(d.values(), d.keys())``. Another\n way to create the same list is ``pairs = [(v, k) for (k, v) in\n d.items()]``.\n\n Iterating views while adding or deleting entries in the dictionary\n may raise a ``RuntimeError`` or fail to iterate over all entries.\n\nx in dictview\n\n Return ``True`` if *x* is in the underlying dictionary\'s keys,\n values or items (in the latter case, *x* should be a ``(key,\n value)`` tuple).\n\nKeys views are set-like since their entries are unique and hashable.\nIf all values are hashable, so that ``(key, value)`` pairs are unique\nand hashable, then the items view is also set-like. (Values views are\nnot treated as set-like since the entries are generally not unique.)\nFor set-like views, all of the operations defined for the abstract\nbase class ``collections.Set`` are available (for example, ``==``,\n``<``, or ``^``).\n\nAn example of dictionary view usage:\n\n >>> dishes = {\'eggs\': 2, \'sausage\': 1, \'bacon\': 1, \'spam\': 500}\n >>> keys = dishes.keys()\n >>> values = dishes.values()\n\n >>> # iteration\n >>> n = 0\n >>> for val in values:\n ... n += val\n >>> print(n)\n 504\n\n >>> # keys and values are iterated over in the same order\n >>> list(keys)\n [\'eggs\', \'bacon\', \'sausage\', \'spam\']\n >>> list(values)\n [2, 1, 1, 500]\n\n >>> # view objects are dynamic and reflect dict changes\n >>> del dishes[\'eggs\']\n >>> del dishes[\'sausage\']\n >>> list(keys)\n [\'spam\', \'bacon\']\n\n >>> # set operations\n >>> keys & {\'eggs\', \'bacon\', \'salad\'}\n {\'bacon\'}\n >>> keys ^ {\'sausage\', \'juice\'}\n {\'juice\', \'eggs\', \'bacon\', \'spam\'}\n',
+ 'typesmapping': '\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass class dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key\n is specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 1, "two": 2}``:\n\n * ``dict(one=1, two=2)``\n\n * ``dict({\'one\': 1, \'two\': 2})``\n\n * ``dict(zip((\'one\', \'two\'), (1, 2)))``\n\n * ``dict([[\'two\', 2], [\'one\', 1]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n If a subclass of dict defines a method ``__missing__()``, if the\n key *key* is not present, the ``d[key]`` operation calls that\n method with the key *key* as argument. The ``d[key]`` operation\n then returns or raises whatever is returned or raised by the\n ``__missing__(key)`` call if the key is not present. No other\n operations or methods invoke ``__missing__()``. If\n ``__missing__()`` is not defined, ``KeyError`` is raised.\n ``__missing__()`` must be a method; it cannot be an instance\n variable:\n\n >>> class Counter(dict):\n ... def __missing__(self, key):\n ... return 0\n >>> c = Counter()\n >>> c[\'red\']\n 0\n >>> c[\'red\'] += 1\n >>> c[\'red\']\n 1\n\n See ``collections.Counter`` for a complete implementation\n including other methods helpful for accumulating and managing\n tallies.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n iter(d)\n\n Return an iterator over the keys of the dictionary. This is a\n shortcut for ``iter(d.keys())``.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n classmethod fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n items()\n\n Return a new view of the dictionary\'s items (``(key, value)``\n pairs). See below for documentation of view objects.\n\n keys()\n\n Return a new view of the dictionary\'s keys. See below for\n documentation of view objects.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as tuples or other iterables of\n length two). If keyword arguments are specified, the dictionary\n is then updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n values()\n\n Return a new view of the dictionary\'s values. See below for\n documentation of view objects.\n\n\nDictionary view objects\n=======================\n\nThe objects returned by ``dict.keys()``, ``dict.values()`` and\n``dict.items()`` are *view objects*. They provide a dynamic view on\nthe dictionary\'s entries, which means that when the dictionary\nchanges, the view reflects these changes.\n\nDictionary views can be iterated over to yield their respective data,\nand support membership tests:\n\nlen(dictview)\n\n Return the number of entries in the dictionary.\n\niter(dictview)\n\n Return an iterator over the keys, values or items (represented as\n tuples of ``(key, value)``) in the dictionary.\n\n Keys and values are iterated over in an arbitrary order which is\n non-random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If keys,\n values and items views are iterated over with no intervening\n modifications to the dictionary, the order of items will directly\n correspond. This allows the creation of ``(value, key)`` pairs\n using ``zip()``: ``pairs = zip(d.values(), d.keys())``. Another\n way to create the same list is ``pairs = [(v, k) for (k, v) in\n d.items()]``.\n\n Iterating views while adding or deleting entries in the dictionary\n may raise a ``RuntimeError`` or fail to iterate over all entries.\n\nx in dictview\n\n Return ``True`` if *x* is in the underlying dictionary\'s keys,\n values or items (in the latter case, *x* should be a ``(key,\n value)`` tuple).\n\nKeys views are set-like since their entries are unique and hashable.\nIf all values are hashable, so that ``(key, value)`` pairs are unique\nand hashable, then the items view is also set-like. (Values views are\nnot treated as set-like since the entries are generally not unique.)\nFor set-like views, all of the operations defined for the abstract\nbase class ``collections.Set`` are available (for example, ``==``,\n``<``, or ``^``).\n\nAn example of dictionary view usage:\n\n >>> dishes = {\'eggs\': 2, \'sausage\': 1, \'bacon\': 1, \'spam\': 500}\n >>> keys = dishes.keys()\n >>> values = dishes.values()\n\n >>> # iteration\n >>> n = 0\n >>> for val in values:\n ... n += val\n >>> print(n)\n 504\n\n >>> # keys and values are iterated over in the same order\n >>> list(keys)\n [\'eggs\', \'bacon\', \'sausage\', \'spam\']\n >>> list(values)\n [2, 1, 1, 500]\n\n >>> # view objects are dynamic and reflect dict changes\n >>> del dishes[\'eggs\']\n >>> del dishes[\'sausage\']\n >>> list(keys)\n [\'spam\', \'bacon\']\n\n >>> # set operations\n >>> keys & {\'eggs\', \'bacon\', \'salad\'}\n {\'bacon\'}\n >>> keys ^ {\'sausage\', \'juice\'}\n {\'juice\', \'eggs\', \'bacon\', \'spam\'}\n',
'typesmethods': "\nMethods\n*******\n\nMethods are functions that are called using the attribute notation.\nThere are two flavors: built-in methods (such as ``append()`` on\nlists) and class instance methods. Built-in methods are described\nwith the types that support them.\n\nIf you access a method (a function defined in a class namespace)\nthrough an instance, you get a special object: a *bound method* (also\ncalled *instance method*) object. When called, it will add the\n``self`` argument to the argument list. Bound methods have two\nspecial read-only attributes: ``m.__self__`` is the object on which\nthe method operates, and ``m.__func__`` is the function implementing\nthe method. Calling ``m(arg-1, arg-2, ..., arg-n)`` is completely\nequivalent to calling ``m.__func__(m.__self__, arg-1, arg-2, ...,\narg-n)``.\n\nLike function objects, bound method objects support getting arbitrary\nattributes. However, since method attributes are actually stored on\nthe underlying function object (``meth.__func__``), setting method\nattributes on bound methods is disallowed. Attempting to set a method\nattribute results in a ``TypeError`` being raised. In order to set a\nmethod attribute, you need to explicitly set it on the underlying\nfunction object:\n\n class C:\n def method(self):\n pass\n\n c = C()\n c.method.__func__.whoami = 'my name is c'\n\nSee *The standard type hierarchy* for more information.\n",
'typesmodules': "\nModules\n*******\n\nThe only special operation on a module is attribute access:\n``m.name``, where *m* is a module and *name* accesses a name defined\nin *m*'s symbol table. Module attributes can be assigned to. (Note\nthat the ``import`` statement is not, strictly speaking, an operation\non a module object; ``import foo`` does not require a module object\nnamed *foo* to exist, rather it requires an (external) *definition*\nfor a module named *foo* somewhere.)\n\nA special member of every module is ``__dict__``. This is the\ndictionary containing the module's symbol table. Modifying this\ndictionary will actually change the module's symbol table, but direct\nassignment to the ``__dict__`` attribute is not possible (you can\nwrite ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but\nyou can't write ``m.__dict__ = {}``). Modifying ``__dict__`` directly\nis not recommended.\n\nModules built into the interpreter are written like this: ``<module\n'sys' (built-in)>``. If loaded from a file, they are written as\n``<module 'os' from '/usr/local/lib/pythonX.Y/os.pyc'>``.\n",
- 'typesseq': '\nSequence Types --- ``str``, ``bytes``, ``bytearray``, ``list``, ``tuple``, ``range``\n************************************************************************************\n\nThere are six sequence types: strings, byte sequences (``bytes``\nobjects), byte arrays (``bytearray`` objects), lists, tuples, and\nrange objects. For other containers see the built in ``dict`` and\n``set`` classes, and the ``collections`` module.\n\nStrings contain Unicode characters. Their literals are written in\nsingle or double quotes: ``\'xyzzy\'``, ``"frobozz"``. See *String and\nBytes literals* for more about string literals. In addition to the\nfunctionality described here, there are also string-specific methods\ndescribed in the *String Methods* section.\n\nBytes and bytearray objects contain single bytes -- the former is\nimmutable while the latter is a mutable sequence. Bytes objects can\nbe constructed the constructor, ``bytes()``, and from literals; use a\n``b`` prefix with normal string syntax: ``b\'xyzzy\'``. To construct\nbyte arrays, use the ``bytearray()`` function.\n\nWarning: While string objects are sequences of characters (represented by\n strings of length 1), bytes and bytearray objects are sequences of\n *integers* (between 0 and 255), representing the ASCII value of\n single bytes. That means that for a bytes or bytearray object *b*,\n ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes or\n bytearray object of length 1. The representation of bytes objects\n uses the literal format (``b\'...\'``) since it is generally more\n useful than e.g. ``bytes([50, 19, 100])``. You can always convert a\n bytes object into a list of integers using ``list(b)``.Also, while\n in previous Python versions, byte strings and Unicode strings could\n be exchanged for each other rather freely (barring encoding issues),\n strings and bytes are now completely separate concepts. There\'s no\n implicit en-/decoding if you pass an object of the wrong type. A\n string always compares unequal to a bytes or bytearray object.\n\nLists are constructed with square brackets, separating items with\ncommas: ``[a, b, c]``. Tuples are constructed by the comma operator\n(not within square brackets), with or without enclosing parentheses,\nbut an empty tuple must have the enclosing parentheses, such as ``a,\nb, c`` or ``()``. A single item tuple must have a trailing comma,\nsuch as ``(d,)``.\n\nObjects of type range are created using the ``range()`` function.\nThey don\'t support slicing, concatenation or repetition, and using\n``in``, ``not in``, ``min()`` or ``max()`` on them is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``s.index(i)`` | index of the first occurence of | |\n| | *i* in *s* | |\n+--------------------+----------------------------------+------------+\n| ``s.count(i)`` | total number of occurences of | |\n| | *i* in *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must\ncompare equal and the two sequences must be of the same type and have\nthe same length. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string object, the ``in`` and ``not in`` operations\n act like a substring test.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. **CPython implementation detail:** If *s* and *t* are both strings,\n some Python implementations such as CPython can usually perform an\n in-place optimization for assignments of the form ``s = s + t`` or\n ``s += t``. When applicable, this optimization makes quadratic\n run-time much less likely. This optimization is both version and\n implementation dependent. For performance sensitive code, it is\n preferable to use the ``str.join()`` method which assures\n consistent linear concatenation performance across versions and\n implementations.\n\n\nString Methods\n==============\n\nString objects support the methods listed below. Note that none of\nthese methods take keyword arguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with its first character capitalized\n and the rest lowercased.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string as a bytes object. Default\n encoding is the current default string encoding. *errors* may be\n given to set a different error handling scheme. The default for\n *errors* is ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Changed in version 3.1: Support for keyword arguments added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the slice ``s[start:end]``.\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise. A character\n ``c`` is alphanumeric if one of the following returns ``True``:\n ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or\n ``c.isnumeric()``.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise. Alphabetic\n characters are those characters defined in the Unicode character\n database as "Letter", i.e., those with general category property\n being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is\n different from the "Alphabetic" property defined in the Unicode\n Standard.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters are those from general category "Nd". This category\n includes digit characters, and all characters that that can be used\n to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT\n ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise. Digits include decimal\n characters and digits that need special handling, such as the\n compatibility superscript digits. Formally, a digit is a character\n that has the property value Numeric_Type=Digit or\n Numeric_Type=Decimal.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise. Cased\n characters are those with general category property being one of\n "Lu", "Ll", or "Lt" and lowercase characters are those with general\n category property "Ll".\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH. Formally, numeric characters are those with the\n property value Numeric_Type=Digit, Numeric_Type=Decimal or\n Numeric_Type=Numeric.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise. Whitespace\n characters are those characters defined in the Unicode character\n database as "Other" or "Separator" and those with bidirectional\n property being one of "WS", "B", or "S".\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise. Cased\n characters are those with general category property being one of\n "Lu", "Ll", or "Lt" and uppercase characters are those with general\n category property "Lu".\n\nstr.join(iterable)\n\n Return a string which is the concatenation of the strings in the\n *iterable* *iterable*. A ``TypeError`` will be raised if there are\n any non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within ``s[start:end]``.\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string where words start with an\n uppercase character and the remaining characters are lowercase.\n\n The algorithm uses a simple language-independent definition of a\n word as groups of consecutive letters. The definition works in\n many contexts but it means that apostrophes in contractions and\n possessives form word boundaries, which may not be the desired\n result:\n\n >>> "they\'re bill\'s friends from the UK".title()\n "They\'Re Bill\'S Friends From The Uk"\n\n A workaround for apostrophes can be constructed using regular\n expressions:\n\n >>> import re\n >>> def titlecase(s):\n return re.sub(r"[A-Za-z]+(\'[A-Za-z]+)?",\n lambda mo: mo.group(0)[0].upper() +\n mo.group(0)[1:].lower(),\n s)\n\n >>> titlecase("they\'re bill\'s friends.")\n "They\'re Bill\'s Friends."\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n\nOld String Formatting Operations\n================================\n\nNote: The formatting operations described here are obsolete and may go\n away in future versions of Python. Use the new *String Formatting*\n in new code.\n\nString objects have one unique built-in operation: the ``%`` operator\n(modulo). This is also known as the string *formatting* or\n*interpolation* operator. Given ``format % values`` (where *format* is\na string), ``%`` conversion specifications in *format* are replaced\nwith zero or more elements of *values*. The effect is similar to the\nusing ``sprintf()`` in the C language.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print(\'%(language)s has %(number)03d quote types.\' %\n... {\'language\': "Python", "number": 2})\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obsolete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any Python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any Python object using ``str()``). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The precision determines the maximal number of characters used.\n\n1. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nChanged in version 3.1: ``%f`` conversions for numbers whose absolute\nvalue is over 1e50 are no longer replaced by ``%g`` conversions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nRange Type\n==========\n\nThe ``range`` type is an immutable sequence which is commonly used for\nlooping. The advantage of the ``range`` type is that an ``range``\nobject will always take the same amount of memory, no matter the size\nof the range it represents. There are no consistent performance\nadvantages.\n\nRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n **CPython implementation detail:** While a list is being sorted,\n the effect of attempting to mutate, or even inspect, the list is\n undefined. The C implementation of Python makes the list appear\n empty for the duration, and raises ``ValueError`` if it can detect\n that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n\n\nBytes and Byte Array Methods\n============================\n\nBytes and bytearray objects, being "strings of bytes", have all\nmethods found on strings, with the exception of ``encode()``,\n``format()`` and ``isidentifier()``, which do not make sense with\nthese types. For converting the objects to strings, they have a\n``decode()`` method.\n\nWherever one of these methods needs to interpret the bytes as\ncharacters (e.g. the ``is...()`` methods), the ASCII character set is\nassumed.\n\nNote: The methods on bytes and bytearray objects don\'t accept strings as\n their arguments, just as the methods on strings don\'t accept bytes\n as their arguments. For example, you have to write\n\n a = "abc"\n b = a.replace("a", "f")\n\n and\n\n a = b"abc"\n b = a.replace(b"a", b"f")\n\nbytes.decode([encoding[, errors]])\nbytearray.decode([encoding[, errors]])\n\n Return a string decoded from the given bytes. Default encoding is\n the current default string encoding. *errors* may be given to set\n a different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'`` and any other name registered via\n ``codecs.register_error()``, see section *Codec Base Classes*. For\n a list of possible encodings, see section *Standard Encodings*.\n\nThe bytes and bytearray types have an additional class method:\n\nclassmethod bytes.fromhex(string)\nclassmethod bytearray.fromhex(string)\n\n This ``bytes`` class method returns a bytes or bytearray object,\n decoding the given string object. The string must contain two\n hexadecimal digits per byte, spaces are ignored.\n\n >>> bytes.fromhex(\'f0 f1f2 \')\n b\'\\xf0\\xf1\\xf2\'\n\nThe maketrans and translate methods differ in semantics from the\nversions available on strings:\n\nbytes.translate(table[, delete])\nbytearray.translate(table[, delete])\n\n Return a copy of the bytes or bytearray object where all bytes\n occurring in the optional argument *delete* are removed, and the\n remaining bytes have been mapped through the given translation\n table, which must be a bytes object of length 256.\n\n You can use the ``bytes.maketrans()`` method to create a\n translation table.\n\n Set the *table* argument to ``None`` for translations that only\n delete characters:\n\n >>> b\'read this short text\'.translate(None, b\'aeiou\')\n b\'rd ths shrt txt\'\n\nstatic bytes.maketrans(from, to)\nstatic bytearray.maketrans(from, to)\n\n This static method returns a translation table usable for\n ``bytes.translate()`` that will map each character in *from* into\n the character at the same position in *to*; *from* and *to* must be\n bytes objects and have the same length.\n\n New in version 3.1.\n',
- 'typesseq-mutable': '\nMutable Sequence Types\n**********************\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n **CPython implementation detail:** While a list is being sorted,\n the effect of attempting to mutate, or even inspect, the list is\n undefined. The C implementation of Python makes the list appear\n empty for the duration, and raises ``ValueError`` if it can detect\n that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n',
+ 'typesseq': '\nSequence Types --- ``str``, ``bytes``, ``bytearray``, ``list``, ``tuple``, ``range``\n************************************************************************************\n\nThere are six sequence types: strings, byte sequences (``bytes``\nobjects), byte arrays (``bytearray`` objects), lists, tuples, and\nrange objects. For other containers see the built in ``dict`` and\n``set`` classes, and the ``collections`` module.\n\nStrings contain Unicode characters. Their literals are written in\nsingle or double quotes: ``\'xyzzy\'``, ``"frobozz"``. See *String and\nBytes literals* for more about string literals. In addition to the\nfunctionality described here, there are also string-specific methods\ndescribed in the *String Methods* section.\n\nBytes and bytearray objects contain single bytes -- the former is\nimmutable while the latter is a mutable sequence. Bytes objects can\nbe constructed the constructor, ``bytes()``, and from literals; use a\n``b`` prefix with normal string syntax: ``b\'xyzzy\'``. To construct\nbyte arrays, use the ``bytearray()`` function.\n\nWhile string objects are sequences of characters (represented by\nstrings of length 1), bytes and bytearray objects are sequences of\n*integers* (between 0 and 255), representing the ASCII value of single\nbytes. That means that for a bytes or bytearray object *b*, ``b[0]``\nwill be an integer, while ``b[0:1]`` will be a bytes or bytearray\nobject of length 1. The representation of bytes objects uses the\nliteral format (``b\'...\'``) since it is generally more useful than\ne.g. ``bytes([50, 19, 100])``. You can always convert a bytes object\ninto a list of integers using ``list(b)``.\n\nAlso, while in previous Python versions, byte strings and Unicode\nstrings could be exchanged for each other rather freely (barring\nencoding issues), strings and bytes are now completely separate\nconcepts. There\'s no implicit en-/decoding if you pass an object of\nthe wrong type. A string always compares unequal to a bytes or\nbytearray object.\n\nLists are constructed with square brackets, separating items with\ncommas: ``[a, b, c]``. Tuples are constructed by the comma operator\n(not within square brackets), with or without enclosing parentheses,\nbut an empty tuple must have the enclosing parentheses, such as ``a,\nb, c`` or ``()``. A single item tuple must have a trailing comma,\nsuch as ``(d,)``.\n\nObjects of type range are created using the ``range()`` function.\nThey don\'t support concatenation or repetition, and using ``min()`` or\n``max()`` on them is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i*, *j* and *k* are\nintegers.\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``s.index(i)`` | index of the first occurence of | |\n| | *i* in *s* | |\n+--------------------+----------------------------------+------------+\n| ``s.count(i)`` | total number of occurences of | |\n| | *i* in *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must\ncompare equal and the two sequences must be of the same type and have\nthe same length. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string object, the ``in`` and ``not in`` operations\n act like a substring test.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. **CPython implementation detail:** If *s* and *t* are both strings,\n some Python implementations such as CPython can usually perform an\n in-place optimization for assignments of the form ``s = s + t`` or\n ``s += t``. When applicable, this optimization makes quadratic\n run-time much less likely. This optimization is both version and\n implementation dependent. For performance sensitive code, it is\n preferable to use the ``str.join()`` method which assures\n consistent linear concatenation performance across versions and\n implementations.\n\n\nString Methods\n==============\n\nString objects support the methods listed below.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with its first character capitalized\n and the rest lowercased.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode(encoding="utf-8", errors="strict")\n\n Return an encoded version of the string as a bytes object. Default\n encoding is ``\'utf-8\'``. *errors* may be given to set a different\n error handling scheme. The default for *errors* is ``\'strict\'``,\n meaning that encoding errors raise a ``UnicodeError``. Other\n possible values are ``\'ignore\'``, ``\'replace\'``,\n ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and any other name\n registered via ``codecs.register_error()``, see section *Codec Base\n Classes*. For a list of possible encodings, see section *Standard\n Encodings*.\n\n Changed in version 3.1: Support for keyword arguments added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the slice ``s[start:end]``.\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The string on which this\n method is called can contain literal text or replacement fields\n delimited by braces ``{}``. Each replacement field contains either\n the numeric index of a positional argument, or the name of a\n keyword argument. Returns a copy of the string where each\n replacement field is replaced with the string value of the\n corresponding argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.format_map(mapping)\n\n Similar to ``str.format(**mapping)``, except that ``mapping`` is\n used directly and not copied to a ``dict`` . This is useful if for\n example ``mapping`` is a dict subclass:\n\n >>> class Default(dict):\n ... def __missing__(self, key):\n ... return key\n ...\n >>> \'{name} was born in {country}\'.format_map(Default(name=\'Guido\'))\n \'Guido was born in country\'\n\n New in version 3.2.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise. A character\n ``c`` is alphanumeric if one of the following returns ``True``:\n ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or\n ``c.isnumeric()``.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise. Alphabetic\n characters are those characters defined in the Unicode character\n database as "Letter", i.e., those with general category property\n being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is\n different from the "Alphabetic" property defined in the Unicode\n Standard.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters are those from general category "Nd". This category\n includes digit characters, and all characters that that can be used\n to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT\n ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise. Digits include decimal\n characters and digits that need special handling, such as the\n compatibility superscript digits. Formally, a digit is a character\n that has the property value Numeric_Type=Digit or\n Numeric_Type=Decimal.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise. Cased\n characters are those with general category property being one of\n "Lu", "Ll", or "Lt" and lowercase characters are those with general\n category property "Ll".\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH. Formally, numeric characters are those with the\n property value Numeric_Type=Digit, Numeric_Type=Decimal or\n Numeric_Type=Numeric.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise. Whitespace\n characters are those characters defined in the Unicode character\n database as "Other" or "Separator" and those with bidirectional\n property being one of "WS", "B", or "S".\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise. Cased\n characters are those with general category property being one of\n "Lu", "Ll", or "Lt" and uppercase characters are those with general\n category property "Lu".\n\nstr.join(iterable)\n\n Return a string which is the concatenation of the strings in the\n *iterable* *iterable*. A ``TypeError`` will be raised if there are\n any non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within ``s[start:end]``.\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string where words start with an\n uppercase character and the remaining characters are lowercase.\n\n The algorithm uses a simple language-independent definition of a\n word as groups of consecutive letters. The definition works in\n many contexts but it means that apostrophes in contractions and\n possessives form word boundaries, which may not be the desired\n result:\n\n >>> "they\'re bill\'s friends from the UK".title()\n "They\'Re Bill\'S Friends From The Uk"\n\n A workaround for apostrophes can be constructed using regular\n expressions:\n\n >>> import re\n >>> def titlecase(s):\n return re.sub(r"[A-Za-z]+(\'[A-Za-z]+)?",\n lambda mo: mo.group(0)[0].upper() +\n mo.group(0)[1:].lower(),\n s)\n\n >>> titlecase("they\'re bill\'s friends.")\n "They\'re Bill\'s Friends."\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n\nOld String Formatting Operations\n================================\n\nNote: The formatting operations described here are obsolete and may go\n away in future versions of Python. Use the new *String Formatting*\n in new code.\n\nString objects have one unique built-in operation: the ``%`` operator\n(modulo). This is also known as the string *formatting* or\n*interpolation* operator. Given ``format % values`` (where *format* is\na string), ``%`` conversion specifications in *format* are replaced\nwith zero or more elements of *values*. The effect is similar to the\nusing ``sprintf()`` in the C language.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print(\'%(language)s has %(number)03d quote types.\' %\n... {\'language\': "Python", "number": 2})\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obsolete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any Python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any Python object using ``str()``). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The precision determines the maximal number of characters used.\n\n1. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nChanged in version 3.1: ``%f`` conversions for numbers whose absolute\nvalue is over 1e50 are no longer replaced by ``%g`` conversions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nRange Type\n==========\n\nThe ``range`` type is an immutable sequence which is commonly used for\nlooping. The advantage of the ``range`` type is that an ``range``\nobject will always take the same amount of memory, no matter the size\nof the range it represents.\n\nRange objects have relatively little behavior: they support indexing,\ncontains, iteration, the ``len()`` function, and the following\nmethods:\n\nrange.count(x)\n\n Return the number of *i*\'s for which ``s[i] == x``.\n\n New in version 3.2.\n\nrange.index(x)\n\n Return the smallest *i* such that ``s[i] == x``. Raises\n ``ValueError`` when *x* is not in the range.\n\n New in version 3.2.\n\n\nMutable Sequence Types\n======================\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``. Use ``functools.cmp_to_key()`` to\n convert an old-style *cmp* function to a *key* function.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n **CPython implementation detail:** While a list is being sorted,\n the effect of attempting to mutate, or even inspect, the list is\n undefined. The C implementation of Python makes the list appear\n empty for the duration, and raises ``ValueError`` if it can detect\n that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n\n\nBytes and Byte Array Methods\n============================\n\nBytes and bytearray objects, being "strings of bytes", have all\nmethods found on strings, with the exception of ``encode()``,\n``format()`` and ``isidentifier()``, which do not make sense with\nthese types. For converting the objects to strings, they have a\n``decode()`` method.\n\nWherever one of these methods needs to interpret the bytes as\ncharacters (e.g. the ``is...()`` methods), the ASCII character set is\nassumed.\n\nNote: The methods on bytes and bytearray objects don\'t accept strings as\n their arguments, just as the methods on strings don\'t accept bytes\n as their arguments. For example, you have to write\n\n a = "abc"\n b = a.replace("a", "f")\n\n and\n\n a = b"abc"\n b = a.replace(b"a", b"f")\n\nbytes.decode(encoding="utf-8", errors="strict")\nbytearray.decode(encoding="utf-8", errors="strict")\n\n Return a string decoded from the given bytes. Default encoding is\n ``\'utf-8\'``. *errors* may be given to set a different error\n handling scheme. The default for *errors* is ``\'strict\'``, meaning\n that encoding errors raise a ``UnicodeError``. Other possible\n values are ``\'ignore\'``, ``\'replace\'`` and any other name\n registered via ``codecs.register_error()``, see section *Codec Base\n Classes*. For a list of possible encodings, see section *Standard\n Encodings*.\n\n Changed in version 3.1: Added support for keyword arguments.\n\nThe bytes and bytearray types have an additional class method:\n\nclassmethod bytes.fromhex(string)\nclassmethod bytearray.fromhex(string)\n\n This ``bytes`` class method returns a bytes or bytearray object,\n decoding the given string object. The string must contain two\n hexadecimal digits per byte, spaces are ignored.\n\n >>> bytes.fromhex(\'f0 f1f2 \')\n b\'\\xf0\\xf1\\xf2\'\n\nThe maketrans and translate methods differ in semantics from the\nversions available on strings:\n\nbytes.translate(table[, delete])\nbytearray.translate(table[, delete])\n\n Return a copy of the bytes or bytearray object where all bytes\n occurring in the optional argument *delete* are removed, and the\n remaining bytes have been mapped through the given translation\n table, which must be a bytes object of length 256.\n\n You can use the ``bytes.maketrans()`` method to create a\n translation table.\n\n Set the *table* argument to ``None`` for translations that only\n delete characters:\n\n >>> b\'read this short text\'.translate(None, b\'aeiou\')\n b\'rd ths shrt txt\'\n\nstatic bytes.maketrans(from, to)\nstatic bytearray.maketrans(from, to)\n\n This static method returns a translation table usable for\n ``bytes.translate()`` that will map each character in *from* into\n the character at the same position in *to*; *from* and *to* must be\n bytes objects and have the same length.\n\n New in version 3.1.\n',
+ 'typesseq-mutable': '\nMutable Sequence Types\n**********************\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``. Use ``functools.cmp_to_key()`` to\n convert an old-style *cmp* function to a *key* function.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n **CPython implementation detail:** While a list is being sorted,\n the effect of attempting to mutate, or even inspect, the list is\n undefined. The C implementation of Python makes the list appear\n empty for the duration, and raises ``ValueError`` if it can detect\n that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n',
'unary': '\nUnary arithmetic and bitwise operations\n***************************************\n\nAll unary arithmetic and bitwise operations have the same priority:\n\n u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n\nThe unary ``-`` (minus) operator yields the negation of its numeric\nargument.\n\nThe unary ``+`` (plus) operator yields its numeric argument unchanged.\n\nThe unary ``~`` (invert) operator yields the bitwise inversion of its\ninteger argument. The bitwise inversion of ``x`` is defined as\n``-(x+1)``. It only applies to integral numbers.\n\nIn all three cases, if the argument does not have the proper type, a\n``TypeError`` exception is raised.\n',
'while': '\nThe ``while`` statement\n***********************\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n',
- 'with': '\nThe ``with`` statement\n**********************\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" with_item ("," with_item)* ":" suite\n with_item ::= expression ["as" target]\n\nThe execution of the ``with`` statement with one "item" proceeds as\nfollows:\n\n1. The context expression (the expression given in the **with_item**)\n is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple ``with`` statements were nested:\n\n with A() as a, B() as b:\n suite\n\nis equivalent to\n\n with A() as a:\n with B() as b:\n suite\n\nChanged in version 3.1: Support for multiple context expressions.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n',
- 'yield': '\nThe ``yield`` statement\n***********************\n\n yield_stmt ::= yield_expression\n\nThe ``yield`` statement is only used when defining a generator\nfunction, and is only used in the body of the generator function.\nUsing a ``yield`` statement in a function definition is sufficient to\ncause that definition to create a generator function instead of a\nnormal function. When a generator function is called, it returns an\niterator known as a generator iterator, or more commonly, a generator.\nThe body of the generator function is executed by calling the\n``next()`` function on the generator repeatedly until it raises an\nexception.\n\nWhen a ``yield`` statement is executed, the state of the generator is\nfrozen and the value of **expression_list** is returned to\n``next()``\'s caller. By "frozen" we mean that all local state is\nretained, including the current bindings of local variables, the\ninstruction pointer, and the internal evaluation stack: enough\ninformation is saved so that the next time ``next()`` is invoked, the\nfunction can proceed exactly as if the ``yield`` statement were just\nanother external call.\n\nThe ``yield`` statement is allowed in the ``try`` clause of a ``try``\n... ``finally`` construct. If the generator is not resumed before it\nis finalized (by reaching a zero reference count or by being garbage\ncollected), the generator-iterator\'s ``close()`` method will be\ncalled, allowing any pending ``finally`` clauses to execute.\n\nSee also:\n\n **PEP 0255** - Simple Generators\n The proposal for adding generators and the ``yield`` statement\n to Python.\n\n **PEP 0342** - Coroutines via Enhanced Generators\n The proposal that, among other generator enhancements, proposed\n allowing ``yield`` to appear inside a ``try`` ... ``finally``\n block.\n'}
+ 'with': '\nThe ``with`` statement\n**********************\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" with_item ("," with_item)* ":" suite\n with_item ::= expression ["as" target]\n\nThe execution of the ``with`` statement with one "item" proceeds as\nfollows:\n\n1. The context expression (the expression given in the ``with_item``)\n is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__exit__()`` is loaded for later use.\n\n3. The context manager\'s ``__enter__()`` method is invoked.\n\n4. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 6 below.\n\n5. The suite is executed.\n\n6. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple ``with`` statements were nested:\n\n with A() as a, B() as b:\n suite\n\nis equivalent to\n\n with A() as a:\n with B() as b:\n suite\n\nChanged in version 3.1: Support for multiple context expressions.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n',
+ 'yield': '\nThe ``yield`` statement\n***********************\n\n yield_stmt ::= yield_expression\n\nThe ``yield`` statement is only used when defining a generator\nfunction, and is only used in the body of the generator function.\nUsing a ``yield`` statement in a function definition is sufficient to\ncause that definition to create a generator function instead of a\nnormal function. When a generator function is called, it returns an\niterator known as a generator iterator, or more commonly, a generator.\nThe body of the generator function is executed by calling the\n``next()`` function on the generator repeatedly until it raises an\nexception.\n\nWhen a ``yield`` statement is executed, the state of the generator is\nfrozen and the value of ``expression_list`` is returned to\n``next()``\'s caller. By "frozen" we mean that all local state is\nretained, including the current bindings of local variables, the\ninstruction pointer, and the internal evaluation stack: enough\ninformation is saved so that the next time ``next()`` is invoked, the\nfunction can proceed exactly as if the ``yield`` statement were just\nanother external call.\n\nThe ``yield`` statement is allowed in the ``try`` clause of a ``try``\n... ``finally`` construct. If the generator is not resumed before it\nis finalized (by reaching a zero reference count or by being garbage\ncollected), the generator-iterator\'s ``close()`` method will be\ncalled, allowing any pending ``finally`` clauses to execute.\n\nSee also:\n\n **PEP 0255** - Simple Generators\n The proposal for adding generators and the ``yield`` statement\n to Python.\n\n **PEP 0342** - Coroutines via Enhanced Generators\n The proposal that, among other generator enhancements, proposed\n allowing ``yield`` to appear inside a ``try`` ... ``finally``\n block.\n'}
diff --git a/Lib/queue.py b/Lib/queue.py
index f051f1c89f..bee7ed4086 100644
--- a/Lib/queue.py
+++ b/Lib/queue.py
@@ -110,14 +110,14 @@ class Queue:
def full(self):
"""Return True if the queue is full, False otherwise (not reliable!).
- This method is likely to be removed at some point. Use qsize() == n
+ This method is likely to be removed at some point. Use qsize() >= n
as a direct substitute, but be aware that either approach risks a race
condition where a queue can shrink before the result of full() or
qsize() can be used.
"""
self.mutex.acquire()
- n = 0 < self.maxsize == self._qsize()
+ n = 0 < self.maxsize <= self._qsize()
self.mutex.release()
return n
@@ -136,16 +136,16 @@ class Queue:
try:
if self.maxsize > 0:
if not block:
- if self._qsize() == self.maxsize:
+ if self._qsize() >= self.maxsize:
raise Full
elif timeout is None:
- while self._qsize() == self.maxsize:
+ while self._qsize() >= self.maxsize:
self.not_full.wait()
elif timeout < 0:
raise ValueError("'timeout' must be a positive number")
else:
endtime = _time() + timeout
- while self._qsize() == self.maxsize:
+ while self._qsize() >= self.maxsize:
remaining = endtime - _time()
if remaining <= 0.0:
raise Full
diff --git a/Lib/quopri.py b/Lib/quopri.py
index 6b3d13eca4..3d0f0ac078 100755
--- a/Lib/quopri.py
+++ b/Lib/quopri.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Conversions to/from quoted-printable transport encoding as per RFC 1521."""
@@ -41,7 +41,7 @@ def quote(c):
-def encode(input, output, quotetabs, header = 0):
+def encode(input, output, quotetabs, header=False):
"""Read 'input', apply quoted-printable encoding, and write to 'output'.
'input' and 'output' are files with readline() and write() methods.
@@ -54,7 +54,7 @@ def encode(input, output, quotetabs, header = 0):
if b2a_qp is not None:
data = input.read()
- odata = b2a_qp(data, quotetabs = quotetabs, header = header)
+ odata = b2a_qp(data, quotetabs=quotetabs, header=header)
output.write(odata)
return
@@ -105,9 +105,9 @@ def encode(input, output, quotetabs, header = 0):
if prevline is not None:
write(prevline, lineEnd=stripped)
-def encodestring(s, quotetabs = 0, header = 0):
+def encodestring(s, quotetabs=False, header=False):
if b2a_qp is not None:
- return b2a_qp(s, quotetabs = quotetabs, header = header)
+ return b2a_qp(s, quotetabs=quotetabs, header=header)
from io import BytesIO
infp = BytesIO(s)
outfp = BytesIO()
@@ -116,14 +116,14 @@ def encodestring(s, quotetabs = 0, header = 0):
-def decode(input, output, header = 0):
+def decode(input, output, header=False):
"""Read 'input', apply quoted-printable decoding, and write to 'output'.
'input' and 'output' are files with readline() and write() methods.
If 'header' is true, decode underscore as space (per RFC 1522)."""
if a2b_qp is not None:
data = input.read()
- odata = a2b_qp(data, header = header)
+ odata = a2b_qp(data, header=header)
output.write(odata)
return
@@ -159,13 +159,13 @@ def decode(input, output, header = 0):
if new:
output.write(new)
-def decodestring(s, header = 0):
+def decodestring(s, header=False):
if a2b_qp is not None:
- return a2b_qp(s, header = header)
+ return a2b_qp(s, header=header)
from io import BytesIO
infp = BytesIO(s)
outfp = BytesIO()
- decode(infp, outfp, header = header)
+ decode(infp, outfp, header=header)
return outfp.getvalue()
diff --git a/Lib/random.py b/Lib/random.py
index 904e7c6a62..59a40526f8 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -42,8 +42,8 @@ from types import MethodType as _MethodType, BuiltinMethodType as _BuiltinMethod
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin
from os import urandom as _urandom
-from binascii import hexlify as _hexlify
-import collections as _collections
+from collections import Set as _Set, Sequence as _Sequence
+from hashlib import sha512 as _sha512
__all__ = ["Random","seed","random","uniform","randint","choice","sample",
"randrange","shuffle","normalvariate","lognormvariate",
@@ -91,22 +91,33 @@ class Random(_random.Random):
self.seed(x)
self.gauss_next = None
- def seed(self, a=None):
+ def seed(self, a=None, version=2):
"""Initialize internal state from hashable object.
None or no argument seeds from current time or from an operating
system specific randomness source if available.
- If a is not None or an int, hash(a) is used instead.
+ For version 2 (the default), all of the bits are used if *a *is a str,
+ bytes, or bytearray. For version 1, the hash() of *a* is used instead.
+
+ If *a* is an int, all bits are used.
+
"""
if a is None:
try:
- a = int(_hexlify(_urandom(16)), 16)
+ a = int.from_bytes(_urandom(32), 'big')
except NotImplementedError:
import time
a = int(time.time() * 256) # use fractional seconds
+ if version == 2:
+ if isinstance(a, (str, bytes, bytearray)):
+ if isinstance(a, str):
+ a = a.encode()
+ a += _sha512(a).digest()
+ a = int.from_bytes(a, 'big')
+
super().seed(a)
self.gauss_next = None
@@ -127,10 +138,10 @@ class Random(_random.Random):
# really unsigned 32-bit ints, so we convert negative ints from
# version 2 to positive longs for version 3.
try:
- internalstate = tuple( x % (2**32) for x in internalstate )
+ internalstate = tuple(x % (2**32) for x in internalstate)
except ValueError as e:
raise TypeError from e
- super(Random, self).setstate(internalstate)
+ super().setstate(internalstate)
else:
raise ValueError("state with version %s passed to "
"Random.setstate() of version %s" %
@@ -152,13 +163,13 @@ class Random(_random.Random):
## -------------------- integer methods -------------------
- def randrange(self, start, stop=None, step=1, int=int, default=None,
- maxwidth=1<<BPF):
+ def randrange(self, start, stop=None, step=1, int=int):
"""Choose a random item from range(start, stop[, step]).
This fixes the problem with randint() which includes the
endpoint; in Python this is usually not what you want.
- Do not supply the 'int', 'default', and 'maxwidth' arguments.
+
+ Do not supply the 'int' argument.
"""
# This code is a bit messy to make it fast for the
@@ -166,11 +177,9 @@ class Random(_random.Random):
istart = int(start)
if istart != start:
raise ValueError("non-integer arg 1 for randrange()")
- if stop is default:
+ if stop is None:
if istart > 0:
- if istart >= maxwidth:
- return self._randbelow(istart)
- return int(self.random() * istart)
+ return self._randbelow(istart)
raise ValueError("empty range for randrange()")
# stop argument supplied.
@@ -179,22 +188,7 @@ class Random(_random.Random):
raise ValueError("non-integer stop for randrange()")
width = istop - istart
if step == 1 and width > 0:
- # Note that
- # int(istart + self.random()*width)
- # instead would be incorrect. For example, consider istart
- # = -2 and istop = 0. Then the guts would be in
- # -2.0 to 0.0 exclusive on both ends (ignoring that random()
- # might return 0.0), and because int() truncates toward 0, the
- # final result would be -1 or 0 (instead of -2 or -1).
- # istart + int(self.random()*width)
- # would also be incorrect, for a subtler reason: the RHS
- # can return a long, and then randrange() would also return
- # a long, but we're supposed to return an int (for backward
- # compatibility).
-
- if width >= maxwidth:
- return int(istart + self._randbelow(width))
- return int(istart + int(self.random()*width))
+ return istart + self._randbelow(width)
if step == 1:
raise ValueError("empty range for randrange() (%d,%d, %d)" % (istart, istop, width))
@@ -212,9 +206,7 @@ class Random(_random.Random):
if n <= 0:
raise ValueError("empty range for randrange()")
- if n >= maxwidth:
- return istart + istep*self._randbelow(n)
- return istart + istep*int(self.random() * n)
+ return istart + istep*self._randbelow(n)
def randint(self, a, b):
"""Return random integer in range [a, b], including both end points.
@@ -222,38 +214,43 @@ class Random(_random.Random):
return self.randrange(a, b+1)
- def _randbelow(self, n, _log=_log, int=int, _maxwidth=1<<BPF,
- _Method=_MethodType, _BuiltinMethod=_BuiltinMethodType):
- """Return a random int in the range [0,n)
-
- Handles the case where n has more bits than returned
- by a single call to the underlying generator.
- """
-
- try:
- getrandbits = self.getrandbits
- except AttributeError:
- pass
- else:
- # Only call self.getrandbits if the original random() builtin method
- # has not been overridden or if a new getrandbits() was supplied.
- # This assures that the two methods correspond.
- if type(self.random) is _BuiltinMethod or type(getrandbits) is _Method:
- k = int(1.00001 + _log(n-1, 2.0)) # 2**k > n-1 > 2**(k-2)
+ def _randbelow(self, n, int=int, maxsize=1<<BPF, type=type,
+ Method=_MethodType, BuiltinMethod=_BuiltinMethodType):
+ "Return a random int in the range [0,n). Raises ValueError if n==0."
+
+ getrandbits = self.getrandbits
+ # Only call self.getrandbits if the original random() builtin method
+ # has not been overridden or if a new getrandbits() was supplied.
+ if type(self.random) is BuiltinMethod or type(getrandbits) is Method:
+ k = n.bit_length() # don't use (n-1) here because n can be 1
+ r = getrandbits(k) # 0 <= r < 2**k
+ while r >= n:
r = getrandbits(k)
- while r >= n:
- r = getrandbits(k)
- return r
- if n >= _maxwidth:
+ return r
+ # There's an overriden random() method but no new getrandbits() method,
+ # so we can only use random() from here.
+ random = self.random
+ if n >= maxsize:
_warn("Underlying random() generator does not supply \n"
- "enough bits to choose from a population range this large")
- return int(self.random() * n)
+ "enough bits to choose from a population range this large.\n"
+ "To remove the range limitation, add a getrandbits() method.")
+ return int(random() * n)
+ rem = maxsize % n
+ limit = (maxsize - rem) / maxsize # int(limit * maxsize) % n == 0
+ r = random()
+ while r >= limit:
+ r = random()
+ return int(r*maxsize) % n
## -------------------- sequence methods -------------------
def choice(self, seq):
"""Choose a random element from a non-empty sequence."""
- return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
+ try:
+ i = self._randbelow(len(seq))
+ except ValueError:
+ raise IndexError('Cannot choose from an empty sequence')
+ return seq[i]
def shuffle(self, x, random=None, int=int):
"""x, random=random.random -> shuffle list x in place; return None.
@@ -262,11 +259,10 @@ class Random(_random.Random):
float in [0.0, 1.0); by default, the standard random.random.
"""
- if random is None:
- random = self.random
+ randbelow = self._randbelow
for i in reversed(range(1, len(x))):
# pick an element in x[:i+1] with which to exchange x[i]
- j = int(random() * (i+1))
+ j = randbelow(i+1) if random is None else int(random() * (i+1))
x[i], x[j] = x[j], x[i]
def sample(self, population, k):
@@ -297,15 +293,14 @@ class Random(_random.Random):
# preferred since the list takes less space than the
# set and it doesn't suffer from frequent reselections.
- if isinstance(population, _collections.Set):
+ if isinstance(population, _Set):
population = tuple(population)
- if not isinstance(population, _collections.Sequence):
- raise TypeError("Population must be a sequence or Set. For dicts, use list(d).")
- random = self.random
+ if not isinstance(population, _Sequence):
+ raise TypeError("Population must be a sequence or set. For dicts, use list(d).")
+ randbelow = self._randbelow
n = len(population)
if not 0 <= k <= n:
raise ValueError("Sample larger than population")
- _int = int
result = [None] * k
setsize = 21 # size of a small set minus size of an empty list
if k > 5:
@@ -314,16 +309,16 @@ class Random(_random.Random):
# An n-length list is smaller than a k-length set
pool = list(population)
for i in range(k): # invariant: non-selected at [0,n-i)
- j = _int(random() * (n-i))
+ j = randbelow(n-i)
result[i] = pool[j]
pool[j] = pool[n-i-1] # move non-selected item into vacancy
else:
selected = set()
selected_add = selected.add
for i in range(k):
- j = _int(random() * n)
+ j = randbelow(n)
while j in selected:
- j = _int(random() * n)
+ j = randbelow(n)
selected_add(j)
result[i] = population[j]
return result
@@ -613,7 +608,7 @@ class Random(_random.Random):
# Jain, pg. 495
u = 1.0 - self.random()
- return 1.0 / pow(u, 1.0/alpha)
+ return 1.0 / u ** (1.0/alpha)
## -------------------- Weibull --------------------
@@ -626,7 +621,7 @@ class Random(_random.Random):
# Jain, pg. 499; bug fix courtesy Bill Arms
u = 1.0 - self.random()
- return alpha * pow(-_log(u), 1.0/beta)
+ return alpha * (-_log(u)) ** (1.0/beta)
## --------------- Operating System Random Source ------------------
@@ -640,7 +635,7 @@ class SystemRandom(Random):
def random(self):
"""Get the next random number in the range [0.0, 1.0)."""
- return (int(_hexlify(_urandom(7)), 16) >> 3) * RECIP_BPF
+ return (int.from_bytes(_urandom(7), 'big') >> 3) * RECIP_BPF
def getrandbits(self, k):
"""getrandbits(k) -> x. Generates a long int with k random bits."""
@@ -648,9 +643,9 @@ class SystemRandom(Random):
raise ValueError('number of bits must be greater than zero')
if k != int(k):
raise TypeError('number of bits should be an integer')
- bytes = (k + 7) // 8 # bits / 8 and rounded up
- x = int(_hexlify(_urandom(bytes)), 16)
- return x >> (bytes * 8 - k) # trim excess bits
+ numbytes = (k + 7) // 8 # bits / 8 and rounded up
+ x = int.from_bytes(_urandom(numbytes), 'big')
+ return x >> (numbytes * 8 - k) # trim excess bits
def seed(self, *args, **kwds):
"Stub method. Not used for a system random number generator."
diff --git a/Lib/re.py b/Lib/re.py
index 309afef125..abd7ea27b3 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -118,6 +118,7 @@ This module also defines an exception 'error'.
import sys
import sre_compile
import sre_parse
+import functools
# public symbols
__all__ = [ "match", "search", "sub", "subn", "split", "findall",
@@ -205,9 +206,9 @@ def compile(pattern, flags=0):
return _compile(pattern, flags)
def purge():
- "Clear the regular expression cache"
- _cache.clear()
- _cache_repl.clear()
+ "Clear the regular expression caches"
+ _compile_typed.cache_clear()
+ _compile_repl.cache_clear()
def template(pattern, flags=0):
"Compile a template pattern, returning a pattern object"
@@ -248,20 +249,14 @@ def escape(pattern):
# --------------------------------------------------------------------
# internals
-_cache = {}
-_cache_repl = {}
-
_pattern_type = type(sre_compile.compile("", 0))
-_MAXCACHE = 100
+def _compile(pattern, flags):
+ return _compile_typed(type(pattern), pattern, flags)
-def _compile(*key):
+@functools.lru_cache(maxsize=500)
+def _compile_typed(text_bytes_type, pattern, flags):
# internal: compile pattern
- cachekey = (type(key[0]),) + key
- p = _cache.get(cachekey)
- if p is not None:
- return p
- pattern, flags = key
if isinstance(pattern, _pattern_type):
if flags:
raise ValueError(
@@ -269,23 +264,12 @@ def _compile(*key):
return pattern
if not sre_compile.isstring(pattern):
raise TypeError("first argument must be string or compiled pattern")
- p = sre_compile.compile(pattern, flags)
- if len(_cache) >= _MAXCACHE:
- _cache.clear()
- _cache[cachekey] = p
- return p
+ return sre_compile.compile(pattern, flags)
-def _compile_repl(*key):
+@functools.lru_cache(maxsize=500)
+def _compile_repl(repl, pattern):
# internal: compile replacement pattern
- p = _cache_repl.get(key)
- if p is not None:
- return p
- repl, pattern = key
- p = sre_parse.parse_template(repl, pattern)
- if len(_cache_repl) >= _MAXCACHE:
- _cache_repl.clear()
- _cache_repl[key] = p
- return p
+ return sre_parse.parse_template(repl, pattern)
def _expand(pattern, match, template):
# internal: match.expand implementation hook
diff --git a/Lib/reprlib.py b/Lib/reprlib.py
index 9893c71cb8..f8033604da 100644
--- a/Lib/reprlib.py
+++ b/Lib/reprlib.py
@@ -1,9 +1,39 @@
"""Redo the builtin repr() (representation) but with limits on most sizes."""
-__all__ = ["Repr","repr"]
+__all__ = ["Repr", "repr", "recursive_repr"]
import builtins
from itertools import islice
+try:
+ from _thread import get_ident
+except ImportError:
+ from _dummy_thread import get_ident
+
+def recursive_repr(fillvalue='...'):
+ 'Decorator to make a repr function return fillvalue for a recursive call'
+
+ def decorating_function(user_function):
+ repr_running = set()
+
+ def wrapper(self):
+ key = id(self), get_ident()
+ if key in repr_running:
+ return fillvalue
+ repr_running.add(key)
+ try:
+ result = user_function(self)
+ finally:
+ repr_running.discard(key)
+ return result
+
+ # Can't use functools.wraps() here because of bootstrap issues
+ wrapper.__module__ = getattr(user_function, '__module__')
+ wrapper.__doc__ = getattr(user_function, '__doc__')
+ wrapper.__name__ = getattr(user_function, '__name__')
+ wrapper.__annotations__ = getattr(user_function, '__annotations__', {})
+ return wrapper
+
+ return decorating_function
class Repr:
diff --git a/Lib/runpy.py b/Lib/runpy.py
index e0aabeb1f2..4738df307a 100644
--- a/Lib/runpy.py
+++ b/Lib/runpy.py
@@ -11,24 +11,63 @@ importers when locating support scripts as well as when importing modules.
import sys
import imp
+from pkgutil import read_code
try:
from imp import get_loader
except ImportError:
from pkgutil import get_loader
__all__ = [
- "run_module",
+ "run_module", "run_path",
]
+class _TempModule(object):
+ """Temporarily replace a module in sys.modules with an empty namespace"""
+ def __init__(self, mod_name):
+ self.mod_name = mod_name
+ self.module = imp.new_module(mod_name)
+ self._saved_module = []
+
+ def __enter__(self):
+ mod_name = self.mod_name
+ try:
+ self._saved_module.append(sys.modules[mod_name])
+ except KeyError:
+ pass
+ sys.modules[mod_name] = self.module
+ return self
+
+ def __exit__(self, *args):
+ if self._saved_module:
+ sys.modules[self.mod_name] = self._saved_module[0]
+ else:
+ del sys.modules[self.mod_name]
+ self._saved_module = []
+
+class _ModifiedArgv0(object):
+ def __init__(self, value):
+ self.value = value
+ self._saved_value = self._sentinel = object()
+
+ def __enter__(self):
+ if self._saved_value is not self._sentinel:
+ raise RuntimeError("Already preserving saved value")
+ self._saved_value = sys.argv[0]
+ sys.argv[0] = self.value
+
+ def __exit__(self, *args):
+ self.value = self._sentinel
+ sys.argv[0] = self._saved_value
def _run_code(code, run_globals, init_globals=None,
mod_name=None, mod_fname=None,
mod_loader=None, pkg_name=None):
- """Helper for _run_module_code"""
+ """Helper to run code in nominated namespace"""
if init_globals is not None:
run_globals.update(init_globals)
run_globals.update(__name__ = mod_name,
__file__ = mod_fname,
+ __cached__ = None,
__loader__ = mod_loader,
__package__ = pkg_name)
exec(code, run_globals)
@@ -37,27 +76,11 @@ def _run_code(code, run_globals, init_globals=None,
def _run_module_code(code, init_globals=None,
mod_name=None, mod_fname=None,
mod_loader=None, pkg_name=None):
- """Helper for run_module"""
- # Set up the top level namespace dictionary
- temp_module = imp.new_module(mod_name)
- mod_globals = temp_module.__dict__
- # Modify sys.argv[0] and sys.module[mod_name]
- saved_argv0 = sys.argv[0]
- restore_module = mod_name in sys.modules
- if restore_module:
- saved_module = sys.modules[mod_name]
- sys.argv[0] = mod_fname
- sys.modules[mod_name] = temp_module
- try:
+ """Helper to run code in new namespace with sys modified"""
+ with _TempModule(mod_name) as temp_module, _ModifiedArgv0(mod_fname):
+ mod_globals = temp_module.module.__dict__
_run_code(code, mod_globals, init_globals,
- mod_name, mod_fname,
- mod_loader, pkg_name)
- finally:
- sys.argv[0] = saved_argv0
- if restore_module:
- sys.modules[mod_name] = saved_module
- else:
- del sys.modules[mod_name]
+ mod_name, mod_fname, mod_loader, pkg_name)
# Copy the globals of the temporary module, as they
# may be cleared when the temporary module goes away
return mod_globals.copy()
@@ -81,7 +104,7 @@ def _get_module_details(mod_name):
raise ImportError("No module named %s" % mod_name)
if loader.is_package(mod_name):
if mod_name == "__main__" or mod_name.endswith(".__main__"):
- raise ImportError(("Cannot use package as __main__ module"))
+ raise ImportError("Cannot use package as __main__ module")
try:
pkg_main_name = mod_name + ".__main__"
return _get_module_details(pkg_main_name)
@@ -94,35 +117,44 @@ def _get_module_details(mod_name):
filename = _get_filename(loader, mod_name)
return mod_name, loader, code, filename
-
# XXX ncoghlan: Should this be documented and made public?
# (Current thoughts: don't repeat the mistake that lead to its
# creation when run_module() no longer met the needs of
# mainmodule.c, but couldn't be changed because it was public)
-def _run_module_as_main(mod_name, set_argv0=True):
+def _run_module_as_main(mod_name, alter_argv=True):
"""Runs the designated module in the __main__ namespace
- These __*__ magic variables will be overwritten:
+ Note that the executed module will have full access to the
+ __main__ namespace. If this is not desirable, the run_module()
+ function should be used to run the module code in a fresh namespace.
+
+ At the very least, these variables in __main__ will be overwritten:
+ __name__
__file__
+ __cached__
__loader__
+ __package__
"""
try:
- mod_name, loader, code, fname = _get_module_details(mod_name)
+ if alter_argv or mod_name != "__main__": # i.e. -m switch
+ mod_name, loader, code, fname = _get_module_details(mod_name)
+ else: # i.e. directory or zipfile execution
+ mod_name, loader, code, fname = _get_main_module_details()
except ImportError as exc:
# Try to provide a good error message
# for directories, zip files and the -m switch
- if set_argv0:
+ if alter_argv:
# For -m switch, just display the exception
info = str(exc)
else:
# For directories/zipfiles, let the user
# know what the code was looking for
- info = "can't find '__main__.py' in %r" % sys.argv[0]
+ info = "can't find '__main__' module in %r" % sys.argv[0]
msg = "%s: %s" % (sys.executable, info)
sys.exit(msg)
pkg_name = mod_name.rpartition('.')[0]
main_globals = sys.modules["__main__"].__dict__
- if set_argv0:
+ if alter_argv:
sys.argv[0] = fname
return _run_code(code, main_globals, None,
"__main__", fname, loader, pkg_name)
@@ -145,6 +177,107 @@ def run_module(mod_name, init_globals=None,
return _run_code(code, {}, init_globals, run_name,
fname, loader, pkg_name)
+def _get_main_module_details():
+ # Helper that gives a nicer error message when attempting to
+ # execute a zipfile or directory by invoking __main__.py
+ main_name = "__main__"
+ try:
+ return _get_module_details(main_name)
+ except ImportError as exc:
+ if main_name in str(exc):
+ raise ImportError("can't find %r module in %r" %
+ (main_name, sys.path[0]))
+ raise
+
+
+# XXX (ncoghlan): Perhaps expose the C API function
+# as imp.get_importer instead of reimplementing it in Python?
+def _get_importer(path_name):
+ """Python version of PyImport_GetImporter C API function"""
+ cache = sys.path_importer_cache
+ try:
+ importer = cache[path_name]
+ except KeyError:
+ # Not yet cached. Flag as using the
+ # standard machinery until we finish
+ # checking the hooks
+ cache[path_name] = None
+ for hook in sys.path_hooks:
+ try:
+ importer = hook(path_name)
+ break
+ except ImportError:
+ pass
+ else:
+ # The following check looks a bit odd. The trick is that
+ # NullImporter throws ImportError if the supplied path is a
+ # *valid* directory entry (and hence able to be handled
+ # by the standard import machinery)
+ try:
+ importer = imp.NullImporter(path_name)
+ except ImportError:
+ return None
+ cache[path_name] = importer
+ return importer
+
+def _get_code_from_file(fname):
+ # Check for a compiled file first
+ with open(fname, "rb") as f:
+ code = read_code(f)
+ if code is None:
+ # That didn't work, so try it as normal source code
+ with open(fname, "rU") as f:
+ code = compile(f.read(), fname, 'exec')
+ return code
+
+def run_path(path_name, init_globals=None, run_name=None):
+ """Execute code located at the specified filesystem location
+
+ Returns the resulting top level namespace dictionary
+
+ The file path may refer directly to a Python script (i.e.
+ one that could be directly executed with execfile) or else
+ it may refer to a zipfile or directory containing a top
+ level __main__.py script.
+ """
+ if run_name is None:
+ run_name = "<run_path>"
+ importer = _get_importer(path_name)
+ if isinstance(importer, imp.NullImporter):
+ # Not a valid sys.path entry, so run the code directly
+ # execfile() doesn't help as we want to allow compiled files
+ code = _get_code_from_file(path_name)
+ return _run_module_code(code, init_globals, run_name, path_name)
+ else:
+ # Importer is defined for path, so add it to
+ # the start of sys.path
+ sys.path.insert(0, path_name)
+ try:
+ # Here's where things are a little different from the run_module
+ # case. There, we only had to replace the module in sys while the
+ # code was running and doing so was somewhat optional. Here, we
+ # have no choice and we have to remove it even while we read the
+ # code. If we don't do this, a __loader__ attribute in the
+ # existing __main__ module may prevent location of the new module.
+ main_name = "__main__"
+ saved_main = sys.modules[main_name]
+ del sys.modules[main_name]
+ try:
+ mod_name, loader, code, fname = _get_main_module_details()
+ finally:
+ sys.modules[main_name] = saved_main
+ pkg_name = ""
+ with _TempModule(run_name) as temp_module, \
+ _ModifiedArgv0(path_name):
+ mod_globals = temp_module.module.__dict__
+ return _run_code(code, mod_globals, init_globals,
+ run_name, fname, loader, pkg_name).copy()
+ finally:
+ try:
+ sys.path.remove(path_name)
+ except ValueError:
+ pass
+
if __name__ == "__main__":
# Run the module specified as the next command line argument
diff --git a/Lib/shelve.py b/Lib/shelve.py
index 52e471ac86..cc1815e3eb 100644
--- a/Lib/shelve.py
+++ b/Lib/shelve.py
@@ -73,6 +73,7 @@ class _ClosedDict(collections.MutableMapping):
def __repr__(self):
return '<Closed Dictionary>'
+
class Shelf(collections.MutableMapping):
"""Base class for shelf implementations.
@@ -88,7 +89,7 @@ class Shelf(collections.MutableMapping):
self._protocol = protocol
self.writeback = writeback
self.cache = {}
- self.keyencoding = "utf-8"
+ self.keyencoding = keyencoding
def __iter__(self):
for k in self.dict.keys():
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 781840dbcd..d2e2dc52fc 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -1,4 +1,4 @@
-"""Utility functions for copying files and directory trees.
+"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
@@ -9,10 +9,32 @@ import sys
import stat
from os.path import abspath
import fnmatch
+import collections
import errno
+import tarfile
-__all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2",
- "copytree","move","rmtree","Error", "SpecialFileError"]
+try:
+ import bz2
+ _BZ2_SUPPORTED = True
+except ImportError:
+ _BZ2_SUPPORTED = False
+
+try:
+ from pwd import getpwnam
+except ImportError:
+ getpwnam = None
+
+try:
+ from grp import getgrnam
+except ImportError:
+ getgrnam = None
+
+__all__ = ["copyfileobj", "copyfile", "copymode", "copystat", "copy", "copy2",
+ "copytree", "move", "rmtree", "Error", "SpecialFileError",
+ "ExecError", "make_archive", "get_archive_formats",
+ "register_archive_format", "unregister_archive_format",
+ "get_unpack_formats", "register_unpack_format",
+ "unregister_unpack_format", "unpack_archive"]
class Error(EnvironmentError):
pass
@@ -21,6 +43,17 @@ class SpecialFileError(EnvironmentError):
"""Raised when trying to do a kind of operation (e.g. copying) which is
not supported on a special file (e.g. a named pipe)"""
+class ExecError(EnvironmentError):
+ """Raised when a command could not be executed"""
+
+class ReadError(EnvironmentError):
+ """Raised when an archive cannot be read"""
+
+class RegistryError(Exception):
+ """Raised when a registery operation with the archiving
+ and unpacking registeries fails"""
+
+
try:
WindowsError
except NameError:
@@ -36,7 +69,7 @@ def copyfileobj(fsrc, fdst, length=16*1024):
def _samefile(src, dst):
# Macintosh, Unix.
- if hasattr(os.path,'samefile'):
+ if hasattr(os.path, 'samefile'):
try:
return os.path.samefile(src, dst)
except OSError:
@@ -85,7 +118,8 @@ def copystat(src, dst):
try:
os.chflags(dst, st.st_flags)
except OSError as why:
- if not hasattr(errno, 'EOPNOTSUPP') or why.errno != errno.EOPNOTSUPP:
+ if (not hasattr(errno, 'EOPNOTSUPP') or
+ why.errno != errno.EOPNOTSUPP):
raise
def copy(src, dst):
@@ -122,8 +156,9 @@ def ignore_patterns(*patterns):
return set(ignored_names)
return _ignore_patterns
-def copytree(src, dst, symlinks=False, ignore=None):
- """Recursively copy a directory tree using copy2().
+def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2,
+ ignore_dangling_symlinks=False):
+ """Recursively copy a directory tree.
The destination directory must not already exist.
If exception(s) occur, an Error is raised with a list of reasons.
@@ -131,7 +166,13 @@ def copytree(src, dst, symlinks=False, ignore=None):
If the optional symlinks flag is true, symbolic links in the
source tree result in symbolic links in the destination tree; if
it is false, the contents of the files pointed to by symbolic
- links are copied.
+ links are copied. If the file pointed by the symlink doesn't
+ exist, an exception will be added in the list of errors raised in
+ an Error exception at the end of the copy process.
+
+ You can set the optional ignore_dangling_symlinks flag to true if you
+ want to silence this exception. Notice that this has no effect on
+ platforms that don't support os.symlink.
The optional ignore argument is a callable. If given, it
is called with the `src` parameter, which is the directory
@@ -145,7 +186,10 @@ def copytree(src, dst, symlinks=False, ignore=None):
list of names relative to the `src` directory that should
not be copied.
- XXX Consider this example code rather than the ultimate tool.
+ The optional copy_function argument is a callable that will be used
+ to copy each file. It will be called with the source path and the
+ destination path as arguments. By default, copy2() is used, but any
+ function that supports the same signature (like copy()) can be used.
"""
names = os.listdir(src)
@@ -162,14 +206,21 @@ def copytree(src, dst, symlinks=False, ignore=None):
srcname = os.path.join(src, name)
dstname = os.path.join(dst, name)
try:
- if symlinks and os.path.islink(srcname):
+ if os.path.islink(srcname):
linkto = os.readlink(srcname)
- os.symlink(linkto, dstname)
+ if symlinks:
+ os.symlink(linkto, dstname)
+ else:
+ # ignore dangling symlink if the flag is on
+ if not os.path.exists(linkto) and ignore_dangling_symlinks:
+ continue
+ # otherwise let the copy occurs. copy2 will raise an error
+ copy_function(srcname, dstname)
elif os.path.isdir(srcname):
- copytree(srcname, dstname, symlinks, ignore)
+ copytree(srcname, dstname, symlinks, ignore, copy_function)
else:
# Will raise a SpecialFileError for unsupported file types
- copy2(srcname, dstname)
+ copy_function(srcname, dstname)
# catch the Error from the recursive copytree so that we can
# continue with other files
except Error as err:
@@ -289,3 +340,417 @@ def _destinsrc(src, dst):
if not dst.endswith(os.path.sep):
dst += os.path.sep
return dst.startswith(src)
+
+def _get_gid(name):
+ """Returns a gid, given a group name."""
+ if getgrnam is None or name is None:
+ return None
+ try:
+ result = getgrnam(name)
+ except KeyError:
+ result = None
+ if result is not None:
+ return result[2]
+ return None
+
+def _get_uid(name):
+ """Returns an uid, given a user name."""
+ if getpwnam is None or name is None:
+ return None
+ try:
+ result = getpwnam(name)
+ except KeyError:
+ result = None
+ if result is not None:
+ return result[2]
+ return None
+
+def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
+ owner=None, group=None, logger=None):
+ """Create a (possibly compressed) tar file from all the files under
+ 'base_dir'.
+
+ 'compress' must be "gzip" (the default), "bzip2", or None.
+
+ 'owner' and 'group' can be used to define an owner and a group for the
+ archive that is being built. If not provided, the current owner and group
+ will be used.
+
+ The output tar file will be named 'base_name' + ".tar", possibly plus
+ the appropriate compression extension (".gz", or ".bz2").
+
+ Returns the output filename.
+ """
+ tar_compression = {'gzip': 'gz', None: ''}
+ compress_ext = {'gzip': '.gz'}
+
+ if _BZ2_SUPPORTED:
+ tar_compression['bzip2'] = 'bz2'
+ compress_ext['bzip2'] = '.bz2'
+
+ # flags for compression program, each element of list will be an argument
+ if compress is not None and compress not in compress_ext.keys():
+ raise ValueError("bad value for 'compress', or compression format not "
+ "supported : {0}".format(compress))
+
+ archive_name = base_name + '.tar' + compress_ext.get(compress, '')
+ archive_dir = os.path.dirname(archive_name)
+
+ if not os.path.exists(archive_dir):
+ if logger is not None:
+ logger.info("creating %s" % archive_dir)
+ if not dry_run:
+ os.makedirs(archive_dir)
+
+ # creating the tarball
+ if logger is not None:
+ logger.info('Creating tar archive')
+
+ uid = _get_uid(owner)
+ gid = _get_gid(group)
+
+ def _set_uid_gid(tarinfo):
+ if gid is not None:
+ tarinfo.gid = gid
+ tarinfo.gname = group
+ if uid is not None:
+ tarinfo.uid = uid
+ tarinfo.uname = owner
+ return tarinfo
+
+ if not dry_run:
+ tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
+ try:
+ tar.add(base_dir, filter=_set_uid_gid)
+ finally:
+ tar.close()
+
+ return archive_name
+
+def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False):
+ # XXX see if we want to keep an external call here
+ if verbose:
+ zipoptions = "-r"
+ else:
+ zipoptions = "-rq"
+ from distutils.errors import DistutilsExecError
+ from distutils.spawn import spawn
+ try:
+ spawn(["zip", zipoptions, zip_filename, base_dir], dry_run=dry_run)
+ except DistutilsExecError:
+ # XXX really should distinguish between "couldn't find
+ # external 'zip' command" and "zip failed".
+ raise ExecError("unable to create zip file '%s': "
+ "could neither import the 'zipfile' module nor "
+ "find a standalone zip utility") % zip_filename
+
+def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
+ """Create a zip file from all the files under 'base_dir'.
+
+ The output zip file will be named 'base_name' + ".zip". Uses either the
+ "zipfile" Python module (if available) or the InfoZIP "zip" utility
+ (if installed and found on the default search path). If neither tool is
+ available, raises ExecError. Returns the name of the output zip
+ file.
+ """
+ zip_filename = base_name + ".zip"
+ archive_dir = os.path.dirname(base_name)
+
+ if not os.path.exists(archive_dir):
+ if logger is not None:
+ logger.info("creating %s", archive_dir)
+ if not dry_run:
+ os.makedirs(archive_dir)
+
+ # If zipfile module is not available, try spawning an external 'zip'
+ # command.
+ try:
+ import zipfile
+ except ImportError:
+ zipfile = None
+
+ if zipfile is None:
+ _call_external_zip(base_dir, zip_filename, verbose, dry_run)
+ else:
+ if logger is not None:
+ logger.info("creating '%s' and adding '%s' to it",
+ zip_filename, base_dir)
+
+ if not dry_run:
+ zip = zipfile.ZipFile(zip_filename, "w",
+ compression=zipfile.ZIP_DEFLATED)
+
+ for dirpath, dirnames, filenames in os.walk(base_dir):
+ for name in filenames:
+ path = os.path.normpath(os.path.join(dirpath, name))
+ if os.path.isfile(path):
+ zip.write(path, path)
+ if logger is not None:
+ logger.info("adding '%s'", path)
+ zip.close()
+
+ return zip_filename
+
+_ARCHIVE_FORMATS = {
+ 'gztar': (_make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"),
+ 'bztar': (_make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"),
+ 'tar': (_make_tarball, [('compress', None)], "uncompressed tar file"),
+ 'zip': (_make_zipfile, [],"ZIP file")
+ }
+
+if _BZ2_SUPPORTED:
+ _ARCHIVE_FORMATS['bztar'] = (_make_tarball, [('compress', 'bzip2')],
+ "bzip2'ed tar-file")
+
+def get_archive_formats():
+ """Returns a list of supported formats for archiving and unarchiving.
+
+ Each element of the returned sequence is a tuple (name, description)
+ """
+ formats = [(name, registry[2]) for name, registry in
+ _ARCHIVE_FORMATS.items()]
+ formats.sort()
+ return formats
+
+def register_archive_format(name, function, extra_args=None, description=''):
+ """Registers an archive format.
+
+ name is the name of the format. function is the callable that will be
+ used to create archives. If provided, extra_args is a sequence of
+ (name, value) tuples that will be passed as arguments to the callable.
+ description can be provided to describe the format, and will be returned
+ by the get_archive_formats() function.
+ """
+ if extra_args is None:
+ extra_args = []
+ if not isinstance(function, collections.Callable):
+ raise TypeError('The %s object is not callable' % function)
+ if not isinstance(extra_args, (tuple, list)):
+ raise TypeError('extra_args needs to be a sequence')
+ for element in extra_args:
+ if not isinstance(element, (tuple, list)) or len(element) !=2 :
+ raise TypeError('extra_args elements are : (arg_name, value)')
+
+ _ARCHIVE_FORMATS[name] = (function, extra_args, description)
+
+def unregister_archive_format(name):
+ del _ARCHIVE_FORMATS[name]
+
+def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
+ dry_run=0, owner=None, group=None, logger=None):
+ """Create an archive file (eg. zip or tar).
+
+ 'base_name' is the name of the file to create, minus any format-specific
+ extension; 'format' is the archive format: one of "zip", "tar", "bztar"
+ or "gztar".
+
+ 'root_dir' is a directory that will be the root directory of the
+ archive; ie. we typically chdir into 'root_dir' before creating the
+ archive. 'base_dir' is the directory where we start archiving from;
+ ie. 'base_dir' will be the common prefix of all files and
+ directories in the archive. 'root_dir' and 'base_dir' both default
+ to the current directory. Returns the name of the archive file.
+
+ 'owner' and 'group' are used when creating a tar archive. By default,
+ uses the current owner and group.
+ """
+ save_cwd = os.getcwd()
+ if root_dir is not None:
+ if logger is not None:
+ logger.debug("changing into '%s'", root_dir)
+ base_name = os.path.abspath(base_name)
+ if not dry_run:
+ os.chdir(root_dir)
+
+ if base_dir is None:
+ base_dir = os.curdir
+
+ kwargs = {'dry_run': dry_run, 'logger': logger}
+
+ try:
+ format_info = _ARCHIVE_FORMATS[format]
+ except KeyError:
+ raise ValueError("unknown archive format '%s'" % format)
+
+ func = format_info[0]
+ for arg, val in format_info[1]:
+ kwargs[arg] = val
+
+ if format != 'zip':
+ kwargs['owner'] = owner
+ kwargs['group'] = group
+
+ try:
+ filename = func(base_name, base_dir, **kwargs)
+ finally:
+ if root_dir is not None:
+ if logger is not None:
+ logger.debug("changing back to '%s'", save_cwd)
+ os.chdir(save_cwd)
+
+ return filename
+
+
+def get_unpack_formats():
+ """Returns a list of supported formats for unpacking.
+
+ Each element of the returned sequence is a tuple
+ (name, extensions, description)
+ """
+ formats = [(name, info[0], info[3]) for name, info in
+ _UNPACK_FORMATS.items()]
+ formats.sort()
+ return formats
+
+def _check_unpack_options(extensions, function, extra_args):
+ """Checks what gets registered as an unpacker."""
+ # first make sure no other unpacker is registered for this extension
+ existing_extensions = {}
+ for name, info in _UNPACK_FORMATS.items():
+ for ext in info[0]:
+ existing_extensions[ext] = name
+
+ for extension in extensions:
+ if extension in existing_extensions:
+ msg = '%s is already registered for "%s"'
+ raise RegistryError(msg % (extension,
+ existing_extensions[extension]))
+
+ if not isinstance(function, collections.Callable):
+ raise TypeError('The registered function must be a callable')
+
+
+def register_unpack_format(name, extensions, function, extra_args=None,
+ description=''):
+ """Registers an unpack format.
+
+ `name` is the name of the format. `extensions` is a list of extensions
+ corresponding to the format.
+
+ `function` is the callable that will be
+ used to unpack archives. The callable will receive archives to unpack.
+ If it's unable to handle an archive, it needs to raise a ReadError
+ exception.
+
+ If provided, `extra_args` is a sequence of
+ (name, value) tuples that will be passed as arguments to the callable.
+ description can be provided to describe the format, and will be returned
+ by the get_unpack_formats() function.
+ """
+ if extra_args is None:
+ extra_args = []
+ _check_unpack_options(extensions, function, extra_args)
+ _UNPACK_FORMATS[name] = extensions, function, extra_args, description
+
+def unregister_unpack_format(name):
+ """Removes the pack format from the registery."""
+ del _UNPACK_FORMATS[name]
+
+def _ensure_directory(path):
+ """Ensure that the parent directory of `path` exists"""
+ dirname = os.path.dirname(path)
+ if not os.path.isdir(dirname):
+ os.makedirs(dirname)
+
+def _unpack_zipfile(filename, extract_dir):
+ """Unpack zip `filename` to `extract_dir`
+ """
+ try:
+ import zipfile
+ except ImportError:
+ raise ReadError('zlib not supported, cannot unpack this archive.')
+
+ if not zipfile.is_zipfile(filename):
+ raise ReadError("%s is not a zip file" % filename)
+
+ zip = zipfile.ZipFile(filename)
+ try:
+ for info in zip.infolist():
+ name = info.filename
+
+ # don't extract absolute paths or ones with .. in them
+ if name.startswith('/') or '..' in name:
+ continue
+
+ target = os.path.join(extract_dir, *name.split('/'))
+ if not target:
+ continue
+
+ _ensure_directory(target)
+ if not name.endswith('/'):
+ # file
+ data = zip.read(info.filename)
+ f = open(target,'wb')
+ try:
+ f.write(data)
+ finally:
+ f.close()
+ del data
+ finally:
+ zip.close()
+
+def _unpack_tarfile(filename, extract_dir):
+ """Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir`
+ """
+ try:
+ tarobj = tarfile.open(filename)
+ except tarfile.TarError:
+ raise ReadError(
+ "%s is not a compressed or uncompressed tar file" % filename)
+ try:
+ tarobj.extractall(extract_dir)
+ finally:
+ tarobj.close()
+
+_UNPACK_FORMATS = {
+ 'gztar': (['.tar.gz', '.tgz'], _unpack_tarfile, [], "gzip'ed tar-file"),
+ 'tar': (['.tar'], _unpack_tarfile, [], "uncompressed tar file"),
+ 'zip': (['.zip'], _unpack_zipfile, [], "ZIP file")
+ }
+
+if _BZ2_SUPPORTED:
+ _UNPACK_FORMATS['bztar'] = (['.bz2'], _unpack_tarfile, [],
+ "bzip2'ed tar-file")
+
+def _find_unpack_format(filename):
+ for name, info in _UNPACK_FORMATS.items():
+ for extension in info[0]:
+ if filename.endswith(extension):
+ return name
+ return None
+
+def unpack_archive(filename, extract_dir=None, format=None):
+ """Unpack an archive.
+
+ `filename` is the name of the archive.
+
+ `extract_dir` is the name of the target directory, where the archive
+ is unpacked. If not provided, the current working directory is used.
+
+ `format` is the archive format: one of "zip", "tar", or "gztar". Or any
+ other registered format. If not provided, unpack_archive will use the
+ filename extension and see if an unpacker was registered for that
+ extension.
+
+ In case none is found, a ValueError is raised.
+ """
+ if extract_dir is None:
+ extract_dir = os.getcwd()
+
+ if format is not None:
+ try:
+ format_info = _UNPACK_FORMATS[format]
+ except KeyError:
+ raise ValueError("Unknown unpack format '{0}'".format(format))
+
+ func = format_info[1]
+ func(filename, extract_dir, **dict(format_info[2]))
+ else:
+ # we need to look at the registered unpackers supported extensions
+ format = _find_unpack_format(filename)
+ if format is None:
+ raise ReadError("Unknown archive format '{0}'".format(filename))
+
+ func = _UNPACK_FORMATS[format][1]
+ kwargs = dict(_UNPACK_FORMATS[format][2])
+ func(filename, extract_dir, **kwargs)
diff --git a/Lib/site.py b/Lib/site.py
index a0489fa461..a2c0becbc1 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -62,7 +62,10 @@ PREFIXES = [sys.prefix, sys.exec_prefix]
# Enable per user site-packages directory
# set it to False to disable the feature or True to force the feature
ENABLE_USER_SITE = None
+
# for distutils.commands.install
+# These values are initialized by the getuserbase() and getusersitepackages()
+# functions, through the main() function when Python starts.
USER_SITE = None
USER_BASE = None
@@ -76,8 +79,8 @@ def makepath(*paths):
return dir, os.path.normcase(dir)
-def abs__file__():
- """Set all module' __file__ attribute to an absolute path"""
+def abs_paths():
+ """Set all module __file__ and __cached__ attributes to an absolute path"""
for m in set(sys.modules.values()):
if hasattr(m, '__loader__'):
continue # don't mess with a PEP 302-supplied __file__
@@ -85,6 +88,10 @@ def abs__file__():
m.__file__ = os.path.abspath(m.__file__)
except (AttributeError, OSError):
pass
+ try:
+ m.__cached__ = os.path.abspath(m.__cached__)
+ except (AttributeError, OSError):
+ pass
def removeduppaths():
@@ -105,18 +112,6 @@ def removeduppaths():
sys.path[:] = L
return known_paths
-# XXX This should not be part of site.py, since it is needed even when
-# using the -S option for Python. See http://www.python.org/sf/586680
-def addbuilddir():
- """Append ./build/lib.<platform> in case we're running in the build dir
- (especially for Guido :-)"""
- from distutils.util import get_platform
- s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
- if hasattr(sys, 'gettotalrefcount'):
- s += '-pydebug'
- s = os.path.join(os.path.dirname(sys.path[-1]), s)
- sys.path.append(s)
-
def _init_pathinfo():
"""Return a set containing all existing directory entries from sys.path"""
@@ -219,86 +214,103 @@ def check_enableusersite():
return True
+def getuserbase():
+ """Returns the `user base` directory path.
+
+ The `user base` directory can be used to store data. If the global
+ variable ``USER_BASE`` is not initialized yet, this function will also set
+ it.
+ """
+ global USER_BASE
+ if USER_BASE is not None:
+ return USER_BASE
+ from sysconfig import get_config_var
+ USER_BASE = get_config_var('userbase')
+ return USER_BASE
+
+def getusersitepackages():
+ """Returns the user-specific site-packages directory path.
+
+ If the global variable ``USER_SITE`` is not initialized yet, this
+ function will also set it.
+ """
+ global USER_SITE
+ user_base = getuserbase() # this will also set USER_BASE
+
+ if USER_SITE is not None:
+ return USER_SITE
+
+ from sysconfig import get_path
+ import os
+
+ if sys.platform == 'darwin':
+ from sysconfig import get_config_var
+ if get_config_var('PYTHONFRAMEWORK'):
+ USER_SITE = get_path('purelib', 'osx_framework_user')
+ return USER_SITE
+
+ USER_SITE = get_path('purelib', '%s_user' % os.name)
+ return USER_SITE
def addusersitepackages(known_paths):
"""Add a per user site-package to sys.path
Each user has its own python directory with site-packages in the
home directory.
-
- USER_BASE is the root directory for all Python versions
-
- USER_SITE is the user specific site-packages directory
-
- USER_SITE/.. can be used for data.
"""
- global USER_BASE, USER_SITE, ENABLE_USER_SITE
- env_base = os.environ.get("PYTHONUSERBASE", None)
-
- def joinuser(*args):
- return os.path.expanduser(os.path.join(*args))
-
- #if sys.platform in ('os2emx', 'riscos'):
- # # Don't know what to put here
- # USER_BASE = ''
- # USER_SITE = ''
- if os.name == "nt":
- base = os.environ.get("APPDATA") or "~"
- USER_BASE = env_base if env_base else joinuser(base, "Python")
- USER_SITE = os.path.join(USER_BASE,
- "Python" + sys.version[0] + sys.version[2],
- "site-packages")
- else:
- USER_BASE = env_base if env_base else joinuser("~", ".local")
- USER_SITE = os.path.join(USER_BASE, "lib",
- "python" + sys.version[:3],
- "site-packages")
+ # get the per user site-package path
+ # this call will also make sure USER_BASE and USER_SITE are set
+ user_site = getusersitepackages()
- if ENABLE_USER_SITE and os.path.isdir(USER_SITE):
- addsitedir(USER_SITE, known_paths)
+ if ENABLE_USER_SITE and os.path.isdir(user_site):
+ addsitedir(user_site, known_paths)
return known_paths
+def getsitepackages():
+ """Returns a list containing all global site-packages directories
+ (and possibly site-python).
-def addsitepackages(known_paths):
- """Add site-packages (and possibly site-python) to sys.path"""
- sitedirs = []
- seen = []
+ For each directory present in the global ``PREFIXES``, this function
+ will find its `site-packages` subdirectory depending on the system
+ environment, and will return a list of full paths.
+ """
+ sitepackages = []
+ seen = set()
for prefix in PREFIXES:
if not prefix or prefix in seen:
continue
- seen.append(prefix)
+ seen.add(prefix)
if sys.platform in ('os2emx', 'riscos'):
- sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
+ sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
elif os.sep == '/':
- sitedirs.append(os.path.join(prefix, "lib",
+ sitepackages.append(os.path.join(prefix, "lib",
"python" + sys.version[:3],
"site-packages"))
- sitedirs.append(os.path.join(prefix, "lib", "site-python"))
+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
else:
- sitedirs.append(prefix)
- sitedirs.append(os.path.join(prefix, "lib", "site-packages"))
-
+ sitepackages.append(prefix)
+ sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
if sys.platform == "darwin":
# for framework builds *only* we add the standard Apple
# locations.
- if 'Python.framework' in prefix:
- sitedirs.append(
- os.path.expanduser(
- os.path.join("~", "Library", "Python",
- sys.version[:3], "site-packages")))
- sitedirs.append(
- os.path.join("/Library", "Python",
+ from sysconfig import get_config_var
+ framework = get_config_var("PYTHONFRAMEWORK")
+ if framework:
+ sitepackages.append(
+ os.path.join("/Library", framework,
sys.version[:3], "site-packages"))
+ return sitepackages
- for sitedir in sitedirs:
+def addsitepackages(known_paths):
+ """Add site-packages (and possibly site-python) to sys.path"""
+ for sitedir in getsitepackages():
if os.path.isdir(sitedir):
addsitedir(sitedir, known_paths)
return known_paths
-
def setBEGINLIBPATH():
"""The OS/2 EMX port has optional extension modules that do double duty
as DLLs (and must use the .DLL file extension) for other extensions.
@@ -317,8 +329,10 @@ def setBEGINLIBPATH():
def setquit():
- """Define new built-ins 'quit' and 'exit'.
- These are simply strings that display a hint on how to exit.
+ """Define new builtins 'quit' and 'exit'.
+
+ These are objects which make the interpreter exit when called.
+ The repr of each object contains a hint at how it works.
"""
if os.sep == ':':
@@ -430,7 +444,7 @@ def setcopyright():
class _Helper(object):
- """Define the built-in 'help'.
+ """Define the builtin 'help'.
This is a wrapper around pydoc.help (with a twist).
"""
@@ -460,25 +474,6 @@ def aliasmbcs():
encodings._cache[enc] = encodings._unknown
encodings.aliases.aliases[enc] = 'mbcs'
-def setencoding():
- """Set the string encoding used by the Unicode implementation. The
- default is 'ascii', but if you're willing to experiment, you can
- change this."""
- encoding = "ascii" # Default value set by _PyUnicode_Init()
- if 0:
- # Enable to support locale aware default string encodings.
- import locale
- loc = locale.getdefaultlocale()
- if loc[1]:
- encoding = loc[1]
- if 0:
- # Enable to switch off string to Unicode coercion and implicit
- # Unicode to string conversion.
- encoding = "undefined"
- if encoding != "ascii":
- # On Non-Unicode builds this will raise an AttributeError...
- sys.setdefaultencoding(encoding) # Needs Python Unicode build !
-
def execsitecustomize():
"""Run custom site specific code, if available."""
@@ -515,11 +510,8 @@ def execusercustomize():
def main():
global ENABLE_USER_SITE
- abs__file__()
+ abs_paths()
known_paths = removeduppaths()
- if (os.name == "posix" and sys.path and
- os.path.basename(sys.path[-1]) == "Modules"):
- addbuilddir()
if ENABLE_USER_SITE is None:
ENABLE_USER_SITE = check_enableusersite()
known_paths = addusersitepackages(known_paths)
@@ -530,15 +522,9 @@ def main():
setcopyright()
sethelper()
aliasmbcs()
- setencoding()
execsitecustomize()
if ENABLE_USER_SITE:
execusercustomize()
- # Remove sys.setdefaultencoding() so that users cannot change the
- # encoding after initialization. The test for presence is needed when
- # this module is run as a script, because this code is executed twice.
- if hasattr(sys, "setdefaultencoding"):
- del sys.setdefaultencoding
main()
diff --git a/Lib/smtpd.py b/Lib/smtpd.py
index ab3e0e209b..599e79b7ed 100755
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""An RFC 2821 smtp proxy.
Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
@@ -59,7 +59,6 @@ and if remoteport is not given, then 25 is used.
# gets forwarded to a real backend smtpd, as with PureProxy. Again, errors
# are not handled correctly yet.
#
-# Please note that this script requires Python 2.0
#
# Author: Barry Warsaw <barry@python.org>
#
@@ -78,6 +77,7 @@ import time
import socket
import asyncore
import asynchat
+from warnings import warn
__all__ = ["SMTPServer","DebuggingServer","PureProxy","MailmanProxy"]
@@ -109,20 +109,24 @@ class SMTPChannel(asynchat.async_chat):
COMMAND = 0
DATA = 1
+ data_size_limit = 33554432
+ command_size_limit = 512
+
def __init__(self, server, conn, addr):
asynchat.async_chat.__init__(self, conn)
- self.__server = server
- self.__conn = conn
- self.__addr = addr
- self.__line = []
- self.__state = self.COMMAND
- self.__greeting = 0
- self.__mailfrom = None
- self.__rcpttos = []
- self.__data = ''
- self.__fqdn = socket.getfqdn()
+ self.smtp_server = server
+ self.conn = conn
+ self.addr = addr
+ self.received_lines = []
+ self.smtp_state = self.COMMAND
+ self.seen_greeting = ''
+ self.mailfrom = None
+ self.rcpttos = []
+ self.received_data = ''
+ self.fqdn = socket.getfqdn()
+ self.num_bytes = 0
try:
- self.__peer = conn.getpeername()
+ self.peer = conn.getpeername()
except socket.error as err:
# a race condition may occur if the other end is closing
# before we can get the peername
@@ -130,24 +134,160 @@ class SMTPChannel(asynchat.async_chat):
if err.args[0] != errno.ENOTCONN:
raise
return
- print('Peer:', repr(self.__peer), file=DEBUGSTREAM)
- self.push('220 %s %s' % (self.__fqdn, __version__))
+ print('Peer:', repr(self.peer), file=DEBUGSTREAM)
+ self.push('220 %s %s' % (self.fqdn, __version__))
self.set_terminator(b'\r\n')
+ # properties for backwards-compatibility
+ @property
+ def __server(self):
+ warn("Access to __server attribute on SMTPChannel is deprecated, "
+ "use 'smtp_server' instead", PendingDeprecationWarning, 2)
+ return self.smtp_server
+ @__server.setter
+ def __server(self, value):
+ warn("Setting __server attribute on SMTPChannel is deprecated, "
+ "set 'smtp_server' instead", PendingDeprecationWarning, 2)
+ self.smtp_server = value
+
+ @property
+ def __line(self):
+ warn("Access to __line attribute on SMTPChannel is deprecated, "
+ "use 'received_lines' instead", PendingDeprecationWarning, 2)
+ return self.received_lines
+ @__line.setter
+ def __line(self, value):
+ warn("Setting __line attribute on SMTPChannel is deprecated, "
+ "set 'received_lines' instead", PendingDeprecationWarning, 2)
+ self.received_lines = value
+
+ @property
+ def __state(self):
+ warn("Access to __state attribute on SMTPChannel is deprecated, "
+ "use 'smtp_state' instead", PendingDeprecationWarning, 2)
+ return self.smtp_state
+ @__state.setter
+ def __state(self, value):
+ warn("Setting __state attribute on SMTPChannel is deprecated, "
+ "set 'smtp_state' instead", PendingDeprecationWarning, 2)
+ self.smtp_state = value
+
+ @property
+ def __greeting(self):
+ warn("Access to __greeting attribute on SMTPChannel is deprecated, "
+ "use 'seen_greeting' instead", PendingDeprecationWarning, 2)
+ return self.seen_greeting
+ @__greeting.setter
+ def __greeting(self, value):
+ warn("Setting __greeting attribute on SMTPChannel is deprecated, "
+ "set 'seen_greeting' instead", PendingDeprecationWarning, 2)
+ self.seen_greeting = value
+
+ @property
+ def __mailfrom(self):
+ warn("Access to __mailfrom attribute on SMTPChannel is deprecated, "
+ "use 'mailfrom' instead", PendingDeprecationWarning, 2)
+ return self.mailfrom
+ @__mailfrom.setter
+ def __mailfrom(self, value):
+ warn("Setting __mailfrom attribute on SMTPChannel is deprecated, "
+ "set 'mailfrom' instead", PendingDeprecationWarning, 2)
+ self.mailfrom = value
+
+ @property
+ def __rcpttos(self):
+ warn("Access to __rcpttos attribute on SMTPChannel is deprecated, "
+ "use 'rcpttos' instead", PendingDeprecationWarning, 2)
+ return self.rcpttos
+ @__rcpttos.setter
+ def __rcpttos(self, value):
+ warn("Setting __rcpttos attribute on SMTPChannel is deprecated, "
+ "set 'rcpttos' instead", PendingDeprecationWarning, 2)
+ self.rcpttos = value
+
+ @property
+ def __data(self):
+ warn("Access to __data attribute on SMTPChannel is deprecated, "
+ "use 'received_data' instead", PendingDeprecationWarning, 2)
+ return self.received_data
+ @__data.setter
+ def __data(self, value):
+ warn("Setting __data attribute on SMTPChannel is deprecated, "
+ "set 'received_data' instead", PendingDeprecationWarning, 2)
+ self.received_data = value
+
+ @property
+ def __fqdn(self):
+ warn("Access to __fqdn attribute on SMTPChannel is deprecated, "
+ "use 'fqdn' instead", PendingDeprecationWarning, 2)
+ return self.fqdn
+ @__fqdn.setter
+ def __fqdn(self, value):
+ warn("Setting __fqdn attribute on SMTPChannel is deprecated, "
+ "set 'fqdn' instead", PendingDeprecationWarning, 2)
+ self.fqdn = value
+
+ @property
+ def __peer(self):
+ warn("Access to __peer attribute on SMTPChannel is deprecated, "
+ "use 'peer' instead", PendingDeprecationWarning, 2)
+ return self.peer
+ @__peer.setter
+ def __peer(self, value):
+ warn("Setting __peer attribute on SMTPChannel is deprecated, "
+ "set 'peer' instead", PendingDeprecationWarning, 2)
+ self.peer = value
+
+ @property
+ def __conn(self):
+ warn("Access to __conn attribute on SMTPChannel is deprecated, "
+ "use 'conn' instead", PendingDeprecationWarning, 2)
+ return self.conn
+ @__conn.setter
+ def __conn(self, value):
+ warn("Setting __conn attribute on SMTPChannel is deprecated, "
+ "set 'conn' instead", PendingDeprecationWarning, 2)
+ self.conn = value
+
+ @property
+ def __addr(self):
+ warn("Access to __addr attribute on SMTPChannel is deprecated, "
+ "use 'addr' instead", PendingDeprecationWarning, 2)
+ return self.addr
+ @__addr.setter
+ def __addr(self, value):
+ warn("Setting __addr attribute on SMTPChannel is deprecated, "
+ "set 'addr' instead", PendingDeprecationWarning, 2)
+ self.addr = value
+
# Overrides base class for convenience
def push(self, msg):
asynchat.async_chat.push(self, bytes(msg + '\r\n', 'ascii'))
# Implementation of base class abstract method
def collect_incoming_data(self, data):
- self.__line.append(str(data, "utf8"))
+ limit = None
+ if self.smtp_state == self.COMMAND:
+ limit = self.command_size_limit
+ elif self.smtp_state == self.DATA:
+ limit = self.data_size_limit
+ if limit and self.num_bytes > limit:
+ return
+ elif limit:
+ self.num_bytes += len(data)
+ self.received_lines.append(str(data, "utf8"))
# Implementation of base class abstract method
def found_terminator(self):
- line = EMPTYSTRING.join(self.__line)
+ line = EMPTYSTRING.join(self.received_lines)
print('Data:', repr(line), file=DEBUGSTREAM)
- self.__line = []
- if self.__state == self.COMMAND:
+ self.received_lines = []
+ if self.smtp_state == self.COMMAND:
+ if self.num_bytes > self.command_size_limit:
+ self.push('500 Error: line too long')
+ self.num_bytes = 0
+ return
+ self.num_bytes = 0
if not line:
self.push('500 Error: bad syntax')
return
@@ -166,8 +306,13 @@ class SMTPChannel(asynchat.async_chat):
method(arg)
return
else:
- if self.__state != self.DATA:
+ if self.smtp_state != self.DATA:
self.push('451 Internal confusion')
+ self.num_bytes = 0
+ return
+ if self.num_bytes > self.data_size_limit:
+ self.push('552 Error: Too much mail data')
+ self.num_bytes = 0
return
# Remove extraneous carriage returns and de-transparency according
# to RFC 821, Section 4.5.2.
@@ -177,14 +322,15 @@ class SMTPChannel(asynchat.async_chat):
data.append(text[1:])
else:
data.append(text)
- self.__data = NEWLINE.join(data)
- status = self.__server.process_message(self.__peer,
- self.__mailfrom,
- self.__rcpttos,
- self.__data)
- self.__rcpttos = []
- self.__mailfrom = None
- self.__state = self.COMMAND
+ self.received_data = NEWLINE.join(data)
+ status = self.smtp_server.process_message(self.peer,
+ self.mailfrom,
+ self.rcpttos,
+ self.received_data)
+ self.rcpttos = []
+ self.mailfrom = None
+ self.smtp_state = self.COMMAND
+ self.num_bytes = 0
self.set_terminator(b'\r\n')
if not status:
self.push('250 Ok')
@@ -196,11 +342,11 @@ class SMTPChannel(asynchat.async_chat):
if not arg:
self.push('501 Syntax: HELO hostname')
return
- if self.__greeting:
+ if self.seen_greeting:
self.push('503 Duplicate HELO/EHLO')
else:
- self.__greeting = arg
- self.push('250 %s' % self.__fqdn)
+ self.seen_greeting = arg
+ self.push('250 %s' % self.fqdn)
def smtp_NOOP(self, arg):
if arg:
@@ -233,24 +379,24 @@ class SMTPChannel(asynchat.async_chat):
if not address:
self.push('501 Syntax: MAIL FROM:<address>')
return
- if self.__mailfrom:
+ if self.mailfrom:
self.push('503 Error: nested MAIL command')
return
- self.__mailfrom = address
- print('sender:', self.__mailfrom, file=DEBUGSTREAM)
+ self.mailfrom = address
+ print('sender:', self.mailfrom, file=DEBUGSTREAM)
self.push('250 Ok')
def smtp_RCPT(self, arg):
print('===> RCPT', arg, file=DEBUGSTREAM)
- if not self.__mailfrom:
+ if not self.mailfrom:
self.push('503 Error: need MAIL command')
return
address = self.__getaddr('TO:', arg) if arg else None
if not address:
self.push('501 Syntax: RCPT TO: <address>')
return
- self.__rcpttos.append(address)
- print('recips:', self.__rcpttos, file=DEBUGSTREAM)
+ self.rcpttos.append(address)
+ print('recips:', self.rcpttos, file=DEBUGSTREAM)
self.push('250 Ok')
def smtp_RSET(self, arg):
@@ -258,26 +404,29 @@ class SMTPChannel(asynchat.async_chat):
self.push('501 Syntax: RSET')
return
# Resets the sender, recipients, and data, but not the greeting
- self.__mailfrom = None
- self.__rcpttos = []
- self.__data = ''
- self.__state = self.COMMAND
+ self.mailfrom = None
+ self.rcpttos = []
+ self.received_data = ''
+ self.smtp_state = self.COMMAND
self.push('250 Ok')
def smtp_DATA(self, arg):
- if not self.__rcpttos:
+ if not self.rcpttos:
self.push('503 Error: need RCPT command')
return
if arg:
self.push('501 Syntax: DATA')
return
- self.__state = self.DATA
+ self.smtp_state = self.DATA
self.set_terminator(b'\r\n.\r\n')
self.push('354 End data with <CR><LF>.<CR><LF>')
class SMTPServer(asyncore.dispatcher):
+ # SMTPChannel class to use for managing client connections
+ channel_class = SMTPChannel
+
def __init__(self, localaddr, remoteaddr):
self._localaddr = localaddr
self._remoteaddr = remoteaddr
@@ -296,12 +445,9 @@ class SMTPServer(asyncore.dispatcher):
self.__class__.__name__, time.ctime(time.time()),
localaddr, remoteaddr), file=DEBUGSTREAM)
- def handle_accept(self):
- pair = self.accept()
- if pair is not None:
- conn, addr = pair
- print('Incoming connection from %s' % repr(addr), file=DEBUGSTREAM)
- channel = SMTPChannel(self, conn, addr)
+ def handle_accepted(self, conn, addr):
+ print('Incoming connection from %s' % repr(addr), file=DEBUGSTREAM)
+ channel = self.channel_class(self, conn, addr)
# API for "doing something useful with the message"
def process_message(self, peer, mailfrom, rcpttos, data):
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index a01a184c9f..14e62504d3 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
'''SMTP/ESMTP client class.
@@ -42,21 +42,25 @@ Example:
# This was modified from the Python 1.5 library HTTP lib.
import socket
+import io
import re
import email.utils
+import email.message
+import email.generator
import base64
import hmac
from email.base64mime import body_encode as encode_base64
from sys import stderr
-__all__ = ["SMTPException","SMTPServerDisconnected","SMTPResponseException",
- "SMTPSenderRefused","SMTPRecipientsRefused","SMTPDataError",
- "SMTPConnectError","SMTPHeloError","SMTPAuthenticationError",
- "quoteaddr","quotedata","SMTP"]
+__all__ = ["SMTPException", "SMTPServerDisconnected", "SMTPResponseException",
+ "SMTPSenderRefused", "SMTPRecipientsRefused", "SMTPDataError",
+ "SMTPConnectError", "SMTPHeloError", "SMTPAuthenticationError",
+ "quoteaddr", "quotedata", "SMTP"]
SMTP_PORT = 25
SMTP_SSL_PORT = 465
-CRLF="\r\n"
+CRLF = "\r\n"
+bCRLF = b"\r\n"
OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I)
@@ -109,7 +113,7 @@ class SMTPRecipientsRefused(SMTPException):
def __init__(self, recipients):
self.recipients = recipients
- self.args = ( recipients,)
+ self.args = (recipients,)
class SMTPDataError(SMTPResponseException):
@@ -138,7 +142,7 @@ def quoteaddr(addr):
m = email.utils.parseaddr(addr)[1]
except AttributeError:
pass
- if m == (None, None): # Indicates parse failure or AttributeError
+ if m == (None, None): # Indicates parse failure or AttributeError
# something weird here.. punt -ddm
return "<%s>" % addr
elif m is None:
@@ -147,6 +151,7 @@ def quoteaddr(addr):
else:
return "<%s>" % m
+# Legacy method kept for backward compatibility.
def quotedata(data):
"""Quote data for email.
@@ -156,6 +161,12 @@ def quotedata(data):
return re.sub(r'(?m)^\.', '..',
re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
+def _quote_periods(bindata):
+ return re.sub(br'(?m)^\.', '..', bindata)
+
+def _fix_eols(data):
+ return re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)
+
try:
import ssl
except ImportError:
@@ -174,7 +185,8 @@ else:
chr = None
while chr != b"\n":
chr = self.sslobj.read(1)
- if not chr: break
+ if not chr:
+ break
str += chr
return str
@@ -269,10 +281,11 @@ class SMTP:
def _get_socket(self, host, port, timeout):
# This makes it simpler for SMTP_SSL to use the SMTP connect code
# and just alter the socket connection bit.
- if self.debuglevel > 0: print('connect:', (host, port), file=stderr)
+ if self.debuglevel > 0:
+ print('connect:', (host, port), file=stderr)
return socket.create_connection((host, port), timeout)
- def connect(self, host='localhost', port = 0):
+ def connect(self, host='localhost', port=0):
"""Connect to a host on a given port.
If the hostname ends with a colon (`:') followed by a number, and
@@ -286,20 +299,25 @@ class SMTP:
if not port and (host.find(':') == host.rfind(':')):
i = host.rfind(':')
if i >= 0:
- host, port = host[:i], host[i+1:]
- try: port = int(port)
+ host, port = host[:i], host[i + 1:]
+ try:
+ port = int(port)
except ValueError:
raise socket.error("nonnumeric port")
- if not port: port = self.default_port
- if self.debuglevel > 0: print('connect:', (host, port), file=stderr)
+ if not port:
+ port = self.default_port
+ if self.debuglevel > 0:
+ print('connect:', (host, port), file=stderr)
self.sock = self._get_socket(host, port, self.timeout)
(code, msg) = self.getreply()
- if self.debuglevel > 0: print("connect:", msg, file=stderr)
+ if self.debuglevel > 0:
+ print("connect:", msg, file=stderr)
return (code, msg)
def send(self, s):
"""Send `s' to the server."""
- if self.debuglevel > 0: print('send:', repr(s), file=stderr)
+ if self.debuglevel > 0:
+ print('send:', repr(s), file=stderr)
if hasattr(self, 'sock') and self.sock:
if isinstance(s, str):
s = s.encode("ascii")
@@ -332,7 +350,7 @@ class SMTP:
Raises SMTPServerDisconnected if end-of-file is reached.
"""
- resp=[]
+ resp = []
if self.file is None:
self.file = self.sock.makefile('rb')
while 1:
@@ -343,9 +361,10 @@ class SMTP:
if not line:
self.close()
raise SMTPServerDisconnected("Connection unexpectedly closed")
- if self.debuglevel > 0: print('reply:', repr(line), file=stderr)
+ if self.debuglevel > 0:
+ print('reply:', repr(line), file=stderr)
resp.append(line[4:].strip(b' \t\r\n'))
- code=line[:3]
+ code = line[:3]
# Check that the error code is syntactically correct.
# Don't attempt to read a continuation line if it is broken.
try:
@@ -359,12 +378,12 @@ class SMTP:
errmsg = b"\n".join(resp)
if self.debuglevel > 0:
- print('reply: retcode (%s); Msg: %s' % (errcode,errmsg), file=stderr)
+ print('reply: retcode (%s); Msg: %s' % (errcode, errmsg), file=stderr)
return errcode, errmsg
def docmd(self, cmd, args=""):
"""Send a command, and return its response code."""
- self.putcmd(cmd,args)
+ self.putcmd(cmd, args)
return self.getreply()
# std smtp commands
@@ -374,9 +393,9 @@ class SMTP:
host.
"""
self.putcmd("helo", name or self.local_hostname)
- (code,msg)=self.getreply()
- self.helo_resp=msg
- return (code,msg)
+ (code, msg) = self.getreply()
+ self.helo_resp = msg
+ return (code, msg)
def ehlo(self, name=''):
""" SMTP 'ehlo' command.
@@ -385,20 +404,20 @@ class SMTP:
"""
self.esmtp_features = {}
self.putcmd(self.ehlo_msg, name or self.local_hostname)
- (code,msg)=self.getreply()
+ (code, msg) = self.getreply()
# According to RFC1869 some (badly written)
# MTA's will disconnect on an ehlo. Toss an exception if
# that happens -ddm
if code == -1 and len(msg) == 0:
self.close()
raise SMTPServerDisconnected("Server not connected")
- self.ehlo_resp=msg
+ self.ehlo_resp = msg
if code != 250:
- return (code,msg)
- self.does_esmtp=1
+ return (code, msg)
+ self.does_esmtp = 1
#parse the ehlo response -ddm
assert isinstance(self.ehlo_resp, bytes), repr(self.ehlo_resp)
- resp=self.ehlo_resp.decode("latin-1").split('\n')
+ resp = self.ehlo_resp.decode("latin-1").split('\n')
del resp[0]
for each in resp:
# To be able to communicate with as many SMTP servers as possible,
@@ -418,16 +437,16 @@ class SMTP:
# It's actually stricter, in that only spaces are allowed between
# parameters, but were not going to check for that here. Note
# that the space isn't present if there are no parameters.
- m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?',each)
+ m = re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?', each)
if m:
- feature=m.group("feature").lower()
- params=m.string[m.end("feature"):].strip()
+ feature = m.group("feature").lower()
+ params = m.string[m.end("feature"):].strip()
if feature == "auth":
self.esmtp_features[feature] = self.esmtp_features.get(feature, "") \
+ " " + params
else:
- self.esmtp_features[feature]=params
- return (code,msg)
+ self.esmtp_features[feature] = params
+ return (code, msg)
def has_extn(self, opt):
"""Does the server support a given SMTP service extension?"""
@@ -447,51 +466,57 @@ class SMTP:
"""SMTP 'noop' command -- doesn't do anything :>"""
return self.docmd("noop")
- def mail(self,sender,options=[]):
+ def mail(self, sender, options=[]):
"""SMTP 'mail' command -- begins mail xfer session."""
optionlist = ''
if options and self.does_esmtp:
optionlist = ' ' + ' '.join(options)
- self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender) ,optionlist))
+ self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender), optionlist))
return self.getreply()
- def rcpt(self,recip,options=[]):
+ def rcpt(self, recip, options=[]):
"""SMTP 'rcpt' command -- indicates 1 recipient for this mail."""
optionlist = ''
if options and self.does_esmtp:
optionlist = ' ' + ' '.join(options)
- self.putcmd("rcpt","TO:%s%s" % (quoteaddr(recip),optionlist))
+ self.putcmd("rcpt", "TO:%s%s" % (quoteaddr(recip), optionlist))
return self.getreply()
- def data(self,msg):
+ def data(self, msg):
"""SMTP 'DATA' command -- sends message data to server.
Automatically quotes lines beginning with a period per rfc821.
Raises SMTPDataError if there is an unexpected reply to the
DATA command; the return value from this method is the final
- response code received when the all data is sent.
+ response code received when the all data is sent. If msg
+ is a string, lone '\r' and '\n' characters are converted to
+ '\r\n' characters. If msg is bytes, it is transmitted as is.
"""
self.putcmd("data")
- (code,repl)=self.getreply()
- if self.debuglevel >0 : print("data:", (code,repl), file=stderr)
+ (code, repl) = self.getreply()
+ if self.debuglevel > 0:
+ print("data:", (code, repl), file=stderr)
if code != 354:
- raise SMTPDataError(code,repl)
+ raise SMTPDataError(code, repl)
else:
- q = quotedata(msg)
- if q[-2:] != CRLF:
- q = q + CRLF
- q = q + "." + CRLF
+ if isinstance(msg, str):
+ msg = _fix_eols(msg).encode('ascii')
+ q = _quote_periods(msg)
+ if q[-2:] != bCRLF:
+ q = q + bCRLF
+ q = q + b"." + bCRLF
self.send(q)
- (code,msg)=self.getreply()
- if self.debuglevel >0 : print("data:", (code,msg), file=stderr)
- return (code,msg)
+ (code, msg) = self.getreply()
+ if self.debuglevel > 0:
+ print("data:", (code, msg), file=stderr)
+ return (code, msg)
def verify(self, address):
"""SMTP 'verify' command -- checks for address validity."""
self.putcmd("vrfy", quoteaddr(address))
return self.getreply()
# a.k.a.
- vrfy=verify
+ vrfy = verify
def expn(self, address):
"""SMTP 'expn' command -- expands a mailing list."""
@@ -549,7 +574,6 @@ class SMTP:
s = "\0%s\0%s" % (user, password)
return encode_base64(s.encode('ascii'), eol='')
-
AUTH_PLAIN = "PLAIN"
AUTH_CRAM_MD5 = "CRAM-MD5"
AUTH_LOGIN = "LOGIN"
@@ -559,45 +583,46 @@ class SMTP:
if not self.has_extn("auth"):
raise SMTPException("SMTP AUTH extension not supported by server.")
- # Authentication methods the server supports:
- authlist = self.esmtp_features["auth"].split()
+ # Authentication methods the server claims to support
+ advertised_authlist = self.esmtp_features["auth"].split()
# List of authentication methods we support: from preferred to
# less preferred methods. Except for the purpose of testing the weaker
# ones, we prefer stronger methods like CRAM-MD5:
preferred_auths = [AUTH_CRAM_MD5, AUTH_PLAIN, AUTH_LOGIN]
- # Determine the authentication method we'll use
- authmethod = None
- for method in preferred_auths:
- if method in authlist:
- authmethod = method
- break
-
- if authmethod == AUTH_CRAM_MD5:
- (code, resp) = self.docmd("AUTH", AUTH_CRAM_MD5)
- if code == 503:
- # 503 == 'Error: already authenticated'
- return (code, resp)
- (code, resp) = self.docmd(encode_cram_md5(resp, user, password))
- elif authmethod == AUTH_PLAIN:
- (code, resp) = self.docmd("AUTH",
- AUTH_PLAIN + " " + encode_plain(user, password))
- elif authmethod == AUTH_LOGIN:
- (code, resp) = self.docmd("AUTH",
- "%s %s" % (AUTH_LOGIN, encode_base64(user.encode('ascii'), eol='')))
- if code != 334:
- raise SMTPAuthenticationError(code, resp)
- (code, resp) = self.docmd(encode_base64(password.encode('ascii'), eol=''))
- elif authmethod is None:
+ # We try the authentication methods the server advertises, but only the
+ # ones *we* support. And in our preferred order.
+ authlist = [auth for auth in preferred_auths if auth in advertised_authlist]
+ if not authlist:
raise SMTPException("No suitable authentication method found.")
- if code not in (235, 503):
+
+ # Some servers advertise authentication methods they don't really
+ # support, so if authentication fails, we continue until we've tried
+ # all methods.
+ for authmethod in authlist:
+ if authmethod == AUTH_CRAM_MD5:
+ (code, resp) = self.docmd("AUTH", AUTH_CRAM_MD5)
+ if code == 334:
+ (code, resp) = self.docmd(encode_cram_md5(resp, user, password))
+ elif authmethod == AUTH_PLAIN:
+ (code, resp) = self.docmd("AUTH",
+ AUTH_PLAIN + " " + encode_plain(user, password))
+ elif authmethod == AUTH_LOGIN:
+ (code, resp) = self.docmd("AUTH",
+ "%s %s" % (AUTH_LOGIN, encode_base64(user.encode('ascii'), eol='')))
+ if code == 334:
+ (code, resp) = self.docmd(encode_base64(password.encode('ascii'), eol=''))
+
# 235 == 'Authentication successful'
# 503 == 'Error: already authenticated'
- raise SMTPAuthenticationError(code, resp)
- return (code, resp)
+ if code in (235, 503):
+ return (code, resp)
- def starttls(self, keyfile = None, certfile = None):
+ # We could not login sucessfully. Return result of last attempt.
+ raise SMTPAuthenticationError(code, resp)
+
+ def starttls(self, keyfile=None, certfile=None):
"""Puts the connection to the SMTP server into TLS mode.
If there has been no previous EHLO or HELO command this session, this
@@ -647,6 +672,10 @@ class SMTP:
- rcpt_options : List of ESMTP options (such as DSN commands) for
all the rcpt commands.
+ msg may be a string containing characters in the ASCII range, or a byte
+ string. A string is encoded to bytes using the ascii codec, and lone
+ \r and \n characters are converted to \r\n characters.
+
If there has been no previous EHLO or HELO command this session, this
method tries ESMTP EHLO first. If the server does ESMTP, message size
and each of the specified options will be passed to it. If EHLO
@@ -692,6 +721,8 @@ class SMTP:
"""
self.ehlo_or_helo_if_needed()
esmtp_opts = []
+ if isinstance(msg, str):
+ msg = _fix_eols(msg).encode('ascii')
if self.does_esmtp:
# Hmmm? what's this? -ddm
# self.esmtp_features['7bit']=""
@@ -699,29 +730,54 @@ class SMTP:
esmtp_opts.append("size=%d" % len(msg))
for option in mail_options:
esmtp_opts.append(option)
-
- (code,resp) = self.mail(from_addr, esmtp_opts)
+ (code, resp) = self.mail(from_addr, esmtp_opts)
if code != 250:
self.rset()
raise SMTPSenderRefused(code, resp, from_addr)
- senderrs={}
+ senderrs = {}
if isinstance(to_addrs, str):
to_addrs = [to_addrs]
for each in to_addrs:
- (code,resp)=self.rcpt(each, rcpt_options)
+ (code, resp) = self.rcpt(each, rcpt_options)
if (code != 250) and (code != 251):
- senderrs[each]=(code,resp)
- if len(senderrs)==len(to_addrs):
+ senderrs[each] = (code, resp)
+ if len(senderrs) == len(to_addrs):
# the server refused all our recipients
self.rset()
raise SMTPRecipientsRefused(senderrs)
- (code,resp) = self.data(msg)
+ (code, resp) = self.data(msg)
if code != 250:
self.rset()
raise SMTPDataError(code, resp)
#if we got here then somebody got our mail
return senderrs
+ def send_message(self, msg, from_addr=None, to_addrs=None,
+ mail_options=[], rcpt_options={}):
+ """Converts message to a bytestring and passes it to sendmail.
+
+ The arguments are as for sendmail, except that msg is an
+ email.message.Message object. If from_addr is None, the from_addr is
+ taken from the 'From' header of the Message. If to_addrs is None, its
+ value is composed from the addresses listed in the 'To', 'CC', and
+ 'Bcc' fields. Regardless of the values of from_addr and to_addr, any
+ Bcc field in the Message object is deleted. The Message object is then
+ serialized using email.generator.BytesGenerator and sendmail is called
+ to transmit the message.
+ """
+ if from_addr is None:
+ from_addr = msg['From']
+ if to_addrs is None:
+ addr_fields = [f for f in (msg['To'], msg['Bcc'], msg['CC'])
+ if f is not None]
+ to_addrs = [a[1] for a in email.utils.getaddresses(addr_fields)]
+ del msg['Bcc']
+ with io.BytesIO() as bytesmsg:
+ g = email.generator.BytesGenerator(bytesmsg)
+ g.flatten(msg, linesep='\r\n')
+ flatmsg = bytesmsg.getvalue()
+ return self.sendmail(from_addr, to_addrs, flatmsg, mail_options,
+ rcpt_options)
def close(self):
"""Close the connection to the SMTP server."""
@@ -732,7 +788,6 @@ class SMTP:
self.sock.close()
self.sock = None
-
def quit(self):
"""Terminate the SMTP session."""
res = self.docmd("quit")
@@ -758,7 +813,8 @@ if _have_ssl:
self.default_port = SMTP_SSL_PORT
def _get_socket(self, host, port, timeout):
- if self.debuglevel > 0: print('connect:', (host, port), file=stderr)
+ if self.debuglevel > 0:
+ print('connect:', (host, port), file=stderr)
new_socket = socket.create_connection((host, port), timeout)
new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile)
self.file = SSLFakeFile(new_socket)
@@ -786,11 +842,11 @@ class LMTP(SMTP):
ehlo_msg = "lhlo"
- def __init__(self, host = '', port = LMTP_PORT, local_hostname = None):
+ def __init__(self, host='', port=LMTP_PORT, local_hostname=None):
"""Initialize a new instance."""
SMTP.__init__(self, host, port, local_hostname)
- def connect(self, host = 'localhost', port = 0):
+ def connect(self, host='localhost', port=0):
"""Connect to the LMTP daemon, on either a Unix or a TCP socket."""
if host[0] != '/':
return SMTP.connect(self, host, port)
@@ -800,13 +856,15 @@ class LMTP(SMTP):
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.connect(host)
except socket.error as msg:
- if self.debuglevel > 0: print('connect fail:', host, file=stderr)
+ if self.debuglevel > 0:
+ print('connect fail:', host, file=stderr)
if self.sock:
self.sock.close()
self.sock = None
raise socket.error(msg)
(code, msg) = self.getreply()
- if self.debuglevel > 0: print('connect:', msg, file=stderr)
+ if self.debuglevel > 0:
+ print('connect:', msg, file=stderr)
return (code, msg)
@@ -820,7 +878,7 @@ if __name__ == '__main__':
return sys.stdin.readline().strip()
fromaddr = prompt("From")
- toaddrs = prompt("To").split(',')
+ toaddrs = prompt("To").split(',')
print("Enter message, end with ^D:")
msg = ''
while 1:
diff --git a/Lib/socket.py b/Lib/socket.py
index d0350617ae..1e285493c4 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -23,7 +23,8 @@ inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format
inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89)
socket.getdefaulttimeout() -- get the default timeout value
socket.setdefaulttimeout() -- set the default timeout value
-create_connection() -- connects to an address, with an optional timeout
+create_connection() -- connects to an address, with an optional timeout and
+ optional source address.
[*] not available on all platforms!
@@ -48,9 +49,13 @@ from _socket import *
import os, sys, io
try:
- from errno import EBADF
+ import errno
except ImportError:
- EBADF = 9
+ errno = None
+EBADF = getattr(errno, 'EBADF', 9)
+EINTR = getattr(errno, 'EINTR', 4)
+EAGAIN = getattr(errno, 'EAGAIN', 11)
+EWOULDBLOCK = getattr(errno, 'EWOULDBLOCK', 11)
__all__ = ["getfqdn", "create_connection"]
__all__.extend(os._get_exports_list(_socket))
@@ -90,13 +95,20 @@ class socket(_socket.socket):
self._io_refs = 0
self._closed = False
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ if not self._closed:
+ self.close()
+
def __repr__(self):
"""Wrap __repr__() to reveal the real class name."""
s = _socket.socket.__repr__(self)
if s.startswith("<socket object"):
s = "<%s.%s%s%s" % (self.__class__.__module__,
self.__class__.__name__,
- (self._closed and " [closed] ") or "",
+ getattr(self, '_closed', False) and " [closed] " or "",
s[7:])
return s
@@ -118,7 +130,13 @@ class socket(_socket.socket):
For IP sockets, the address info is a pair (hostaddr, port).
"""
fd, addr = self._accept()
- return socket(self.family, self.type, self.proto, fileno=fd), addr
+ sock = socket(self.family, self.type, self.proto, fileno=fd)
+ # Issue #7995: if no default timeout is set and the listening
+ # socket had a (non-zero) timeout, force the new socket in blocking
+ # mode to override platform-specific socket flags inheritance.
+ if getdefaulttimeout() is None and self.gettimeout():
+ sock.setblocking(True)
+ return sock, addr
def makefile(self, mode="r", buffering=None, *,
encoding=None, errors=None, newline=None):
@@ -169,10 +187,12 @@ class socket(_socket.socket):
if self._closed:
self.close()
- def _real_close(self):
- _socket.socket.close(self)
+ def _real_close(self, _ss=_socket.socket):
+ # This function should not reference any globals. See issue #808164.
+ _ss.close(self)
def close(self):
+ # This function should not reference any globals. See issue #808164.
self._closed = True
if self._io_refs <= 0:
self._real_close()
@@ -187,6 +207,29 @@ def fromfd(fd, family, type, proto=0):
return socket(family, type, proto, nfd)
+if hasattr(_socket, "socketpair"):
+
+ def socketpair(family=None, type=SOCK_STREAM, proto=0):
+ """socketpair([family[, type[, proto]]]) -> (socket object, socket object)
+
+ Create a pair of socket objects from the sockets returned by the platform
+ socketpair() function.
+ The arguments are the same as for socket() except the default family is
+ AF_UNIX if defined on the platform; otherwise, the default is AF_INET.
+ """
+ if family is None:
+ try:
+ family = AF_UNIX
+ except NameError:
+ family = AF_INET
+ a, b = _socket.socketpair(family, type, proto)
+ a = socket(family, type, proto, a.detach())
+ b = socket(family, type, proto, b.detach())
+ return a, b
+
+
+_blocking_errnos = { EAGAIN, EWOULDBLOCK }
+
class SocketIO(io.RawIOBase):
"""Raw I/O implementation for stream sockets.
@@ -214,6 +257,7 @@ class SocketIO(io.RawIOBase):
self._mode = mode
self._reading = "r" in mode
self._writing = "w" in mode
+ self._timeout_occurred = False
def readinto(self, b):
"""Read up to len(b) bytes into the writable buffer *b* and return
@@ -225,7 +269,21 @@ class SocketIO(io.RawIOBase):
"""
self._checkClosed()
self._checkReadable()
- return self._sock.recv_into(b)
+ if self._timeout_occurred:
+ raise IOError("cannot read from timed out object")
+ while True:
+ try:
+ return self._sock.recv_into(b)
+ except timeout:
+ self._timeout_occurred = True
+ raise
+ except error as e:
+ n = e.args[0]
+ if n == EINTR:
+ continue
+ if n in _blocking_errnos:
+ return None
+ raise
def write(self, b):
"""Write the given bytes or bytearray object *b* to the socket
@@ -235,7 +293,13 @@ class SocketIO(io.RawIOBase):
"""
self._checkClosed()
self._checkWritable()
- return self._sock.send(b)
+ try:
+ return self._sock.send(b)
+ except error as e:
+ # XXX what about EINTR?
+ if e.args[0] in _blocking_errnos:
+ return None
+ raise
def readable(self):
"""True if the SocketIO is open for reading.
@@ -255,7 +319,10 @@ class SocketIO(io.RawIOBase):
@property
def name(self):
- return self.fileno()
+ if not self.closed:
+ return self.fileno()
+ else:
+ return -1
@property
def mode(self):
@@ -271,10 +338,6 @@ class SocketIO(io.RawIOBase):
self._sock._decref_socketios()
self._sock = None
- def __del__(self):
- if not self.closed:
- self._sock._decref_socketios()
-
def getfqdn(name=''):
"""Get fully qualified domain name from name.
@@ -304,7 +367,8 @@ def getfqdn(name=''):
_GLOBAL_DEFAULT_TIMEOUT = object()
-def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT):
+def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
+ source_address=None):
"""Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
@@ -312,7 +376,9 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT):
*timeout* parameter will set the timeout on the socket instance
before attempting to connect. If no *timeout* is supplied, the
global default timeout setting returned by :func:`getdefaulttimeout`
- is used.
+ is used. If *source_address* is set it must be a tuple of (host, port)
+ for the socket to bind as a source address before making the connection.
+ An host of '' or port 0 tells the OS to use the default.
"""
host, port = address
@@ -324,6 +390,8 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT):
sock = socket(af, socktype, proto)
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
+ if source_address:
+ sock.bind(source_address)
sock.connect(sa)
return sock
diff --git a/Lib/socketserver.py b/Lib/socketserver.py
index 3d32c3ea19..089b3bac11 100644
--- a/Lib/socketserver.py
+++ b/Lib/socketserver.py
@@ -168,6 +168,7 @@ class BaseServer:
- verify_request(request, client_address)
- server_close()
- process_request(request, client_address)
+ - shutdown_request(request)
- close_request(request)
- handle_error()
@@ -283,7 +284,7 @@ class BaseServer:
self.process_request(request, client_address)
except:
self.handle_error(request, client_address)
- self.close_request(request)
+ self.shutdown_request(request)
def handle_timeout(self):
"""Called if no new request arrives within self.timeout.
@@ -307,7 +308,7 @@ class BaseServer:
"""
self.finish_request(request, client_address)
- self.close_request(request)
+ self.shutdown_request(request)
def server_close(self):
"""Called to clean-up the server.
@@ -321,6 +322,10 @@ class BaseServer:
"""Finish one request by instantiating RequestHandlerClass."""
self.RequestHandlerClass(request, client_address, self)
+ def shutdown_request(self, request):
+ """Called to shutdown and close an individual request."""
+ self.close_request(request)
+
def close_request(self, request):
"""Called to clean up an individual request."""
pass
@@ -361,6 +366,7 @@ class TCPServer(BaseServer):
- handle_timeout()
- verify_request(request, client_address)
- process_request(request, client_address)
+ - shutdown_request(request)
- close_request(request)
- handle_error()
@@ -445,6 +451,16 @@ class TCPServer(BaseServer):
"""
return self.socket.accept()
+ def shutdown_request(self, request):
+ """Called to shutdown and close an individual request."""
+ try:
+ #explicitly shutdown. socket.close() merely releases
+ #the socket and waits for GC to perform the actual close.
+ request.shutdown(socket.SHUT_WR)
+ except socket.error:
+ pass #some platforms may raise ENOTCONN here
+ self.close_request(request)
+
def close_request(self, request):
"""Called to clean up an individual request."""
request.close()
@@ -468,6 +484,10 @@ class UDPServer(TCPServer):
# No need to call listen() for UDP.
pass
+ def shutdown_request(self, request):
+ # No need to shutdown anything.
+ self.close_request(request)
+
def close_request(self, request):
# No need to close anything.
pass
@@ -535,10 +555,12 @@ class ForkingMixIn:
# This must never return, hence os._exit()!
try:
self.finish_request(request, client_address)
+ self.shutdown_request(request)
os._exit(0)
except:
try:
self.handle_error(request, client_address)
+ self.shutdown_request(request)
finally:
os._exit(1)
@@ -558,10 +580,10 @@ class ThreadingMixIn:
"""
try:
self.finish_request(request, client_address)
- self.close_request(request)
+ self.shutdown_request(request)
except:
self.handle_error(request, client_address)
- self.close_request(request)
+ self.shutdown_request(request)
def process_request(self, request, client_address):
"""Start a new thread to process the request."""
@@ -613,8 +635,10 @@ class BaseRequestHandler:
self.client_address = client_address
self.server = server
self.setup()
- self.handle()
- self.finish()
+ try:
+ self.handle()
+ finally:
+ self.finish()
def setup(self):
pass
@@ -648,8 +672,20 @@ class StreamRequestHandler(BaseRequestHandler):
rbufsize = -1
wbufsize = 0
+ # A timeout to apply to the request socket, if not None.
+ timeout = None
+
+ # Disable nagle algorithm for this socket, if True.
+ # Use only when wbufsize != 0, to avoid small packets.
+ disable_nagle_algorithm = False
+
def setup(self):
self.connection = self.request
+ if self.timeout is not None:
+ self.connection.settimeout(self.timeout)
+ if self.disable_nagle_algorithm:
+ self.connection.setsockopt(socket.IPPROTO_TCP,
+ socket.TCP_NODELAY, True)
self.rfile = self.connection.makefile('rb', self.rbufsize)
self.wfile = self.connection.makefile('wb', self.wbufsize)
diff --git a/Lib/sqlite3/__init__.py b/Lib/sqlite3/__init__.py
index 4b64833e93..6c91df27cc 100644
--- a/Lib/sqlite3/__init__.py
+++ b/Lib/sqlite3/__init__.py
@@ -1,7 +1,6 @@
-#-*- coding: ISO-8859-1 -*-
# pysqlite2/__init__.py: the pysqlite2 package.
#
-# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
diff --git a/Lib/sqlite3/dbapi2.py b/Lib/sqlite3/dbapi2.py
index d051f0432f..6c121a5c06 100644
--- a/Lib/sqlite3/dbapi2.py
+++ b/Lib/sqlite3/dbapi2.py
@@ -1,7 +1,6 @@
-#-*- coding: ISO-8859-1 -*-
# pysqlite2/dbapi2.py: the DB-API 2.0 interface
#
-# Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index fbf3072341..518b8ae410 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -1,7 +1,7 @@
#-*- coding: ISO-8859-1 -*-
# pysqlite2/test/dbapi.py: tests for DB-API compliance
#
-# Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
@@ -22,8 +22,11 @@
# 3. This notice may not be removed or altered from any source distribution.
import unittest
-import threading
import sqlite3 as sqlite
+try:
+ import threading
+except ImportError:
+ threading = None
class ModuleTests(unittest.TestCase):
def CheckAPILevel(self):
@@ -81,6 +84,7 @@ class ModuleTests(unittest.TestCase):
"NotSupportedError is not a subclass of DatabaseError")
class ConnectionTests(unittest.TestCase):
+
def setUp(self):
self.cx = sqlite.connect(":memory:")
cu = self.cx.cursor()
@@ -137,6 +141,28 @@ class ConnectionTests(unittest.TestCase):
self.assertEqual(self.cx.ProgrammingError, sqlite.ProgrammingError)
self.assertEqual(self.cx.NotSupportedError, sqlite.NotSupportedError)
+ def CheckInTransaction(self):
+ # Can't use db from setUp because we want to test initial state.
+ cx = sqlite.connect(":memory:")
+ cu = cx.cursor()
+ self.assertEqual(cx.in_transaction, False)
+ cu.execute("create table transactiontest(id integer primary key, name text)")
+ self.assertEqual(cx.in_transaction, False)
+ cu.execute("insert into transactiontest(name) values (?)", ("foo",))
+ self.assertEqual(cx.in_transaction, True)
+ cu.execute("select name from transactiontest where name=?", ["foo"])
+ row = cu.fetchone()
+ self.assertEqual(cx.in_transaction, True)
+ cx.commit()
+ self.assertEqual(cx.in_transaction, False)
+ cu.execute("select name from transactiontest where name=?", ["foo"])
+ row = cu.fetchone()
+ self.assertEqual(cx.in_transaction, False)
+
+ def CheckInTransactionRO(self):
+ with self.assertRaises(AttributeError):
+ self.cx.in_transaction = True
+
class CursorTests(unittest.TestCase):
def setUp(self):
self.cx = sqlite.connect(":memory:")
@@ -460,6 +486,7 @@ class CursorTests(unittest.TestCase):
except TypeError:
pass
+@unittest.skipUnless(threading, 'This test requires threading.')
class ThreadTests(unittest.TestCase):
def setUp(self):
self.con = sqlite.connect(":memory:")
@@ -653,13 +680,13 @@ class ExtensionTests(unittest.TestCase):
res = cur.fetchone()[0]
self.assertEqual(res, 5)
- def CheckScriptErrorIncomplete(self):
+ def CheckScriptSyntaxError(self):
con = sqlite.connect(":memory:")
cur = con.cursor()
raised = False
try:
- cur.executescript("create table test(sadfsadfdsa")
- except sqlite.ProgrammingError:
+ cur.executescript("create table test(x); asdf; create table test2(x)")
+ except sqlite.OperationalError:
raised = True
self.assertEqual(raised, True, "should have raised an exception")
@@ -692,7 +719,7 @@ class ExtensionTests(unittest.TestCase):
result = con.execute("select foo from test").fetchone()[0]
self.assertEqual(result, 5, "Basic test of Connection.executescript")
-class ClosedTests(unittest.TestCase):
+class ClosedConTests(unittest.TestCase):
def setUp(self):
pass
@@ -744,7 +771,6 @@ class ClosedTests(unittest.TestCase):
except:
self.fail("Should have raised a ProgrammingError")
-
def CheckClosedCreateFunction(self):
con = sqlite.connect(":memory:")
con.close()
@@ -811,6 +837,36 @@ class ClosedTests(unittest.TestCase):
except:
self.fail("Should have raised a ProgrammingError")
+class ClosedCurTests(unittest.TestCase):
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def CheckClosed(self):
+ con = sqlite.connect(":memory:")
+ cur = con.cursor()
+ cur.close()
+
+ for method_name in ("execute", "executemany", "executescript", "fetchall", "fetchmany", "fetchone"):
+ if method_name in ("execute", "executescript"):
+ params = ("select 4 union select 5",)
+ elif method_name == "executemany":
+ params = ("insert into foo(bar) values (?)", [(3,), (4,)])
+ else:
+ params = []
+
+ try:
+ method = getattr(cur, method_name)
+
+ method(*params)
+ self.fail("Should have raised a ProgrammingError: method " + method_name)
+ except sqlite.ProgrammingError:
+ pass
+ except:
+ self.fail("Should have raised a ProgrammingError: " + method_name)
+
def suite():
module_suite = unittest.makeSuite(ModuleTests, "Check")
connection_suite = unittest.makeSuite(ConnectionTests, "Check")
@@ -818,8 +874,9 @@ def suite():
thread_suite = unittest.makeSuite(ThreadTests, "Check")
constructor_suite = unittest.makeSuite(ConstructorTests, "Check")
ext_suite = unittest.makeSuite(ExtensionTests, "Check")
- closed_suite = unittest.makeSuite(ClosedTests, "Check")
- return unittest.TestSuite((module_suite, connection_suite, cursor_suite, thread_suite, constructor_suite, ext_suite, closed_suite))
+ closed_con_suite = unittest.makeSuite(ClosedConTests, "Check")
+ closed_cur_suite = unittest.makeSuite(ClosedCurTests, "Check")
+ return unittest.TestSuite((module_suite, connection_suite, cursor_suite, thread_suite, constructor_suite, ext_suite, closed_con_suite, closed_cur_suite))
def test():
runner = unittest.TextTestRunner()
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py
index 5e315fa0fb..7d0553d8f1 100644
--- a/Lib/sqlite3/test/regression.py
+++ b/Lib/sqlite3/test/regression.py
@@ -1,7 +1,7 @@
#-*- coding: ISO-8859-1 -*-
# pysqlite2/test/regression.py: pysqlite regression tests
#
-# Copyright (C) 2006 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2006-2010 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
@@ -70,16 +70,6 @@ class RegressionTests(unittest.TestCase):
cur.execute('select 1 as "foo baz"')
self.assertEqual(cur.description[0][0], "foo baz")
- def CheckStatementAvailable(self):
- # pysqlite up to 2.3.2 crashed on this, because the active statement handle was not checked
- # before trying to fetch data from it. close() destroys the active statement ...
- con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_DECLTYPES)
- cur = con.cursor()
- cur.execute("select 4 union select 5")
- cur.close()
- cur.fetchone()
- cur.fetchone()
-
def CheckStatementFinalizationOnCloseDb(self):
# pysqlite versions <= 2.3.3 only finalized statements in the statement
# cache when closing the database. statements that were still
@@ -169,6 +159,25 @@ class RegressionTests(unittest.TestCase):
con = sqlite.connect(":memory:")
setattr(con, "isolation_level", "\xe9")
+ def CheckCursorConstructorCallCheck(self):
+ """
+ Verifies that cursor methods check wether base class __init__ was called.
+ """
+ class Cursor(sqlite.Cursor):
+ def __init__(self, con):
+ pass
+
+ con = sqlite.connect(":memory:")
+ cur = Cursor(con)
+ try:
+ cur.execute("select 4+5").fetchall()
+ self.fail("should have raised ProgrammingError")
+ except sqlite.ProgrammingError:
+ pass
+ except:
+ self.fail("should have raised ProgrammingError")
+
+
def CheckStrSubclass(self):
"""
The Python 3.0 port of the module didn't cope with values of subclasses of str.
@@ -176,6 +185,88 @@ class RegressionTests(unittest.TestCase):
class MyStr(str): pass
self.con.execute("select ?", (MyStr("abc"),))
+ def CheckConnectionConstructorCallCheck(self):
+ """
+ Verifies that connection methods check wether base class __init__ was called.
+ """
+ class Connection(sqlite.Connection):
+ def __init__(self, name):
+ pass
+
+ con = Connection(":memory:")
+ try:
+ cur = con.cursor()
+ self.fail("should have raised ProgrammingError")
+ except sqlite.ProgrammingError:
+ pass
+ except:
+ self.fail("should have raised ProgrammingError")
+
+ def CheckCursorRegistration(self):
+ """
+ Verifies that subclassed cursor classes are correctly registered with
+ the connection object, too. (fetch-across-rollback problem)
+ """
+ class Connection(sqlite.Connection):
+ def cursor(self):
+ return Cursor(self)
+
+ class Cursor(sqlite.Cursor):
+ def __init__(self, con):
+ sqlite.Cursor.__init__(self, con)
+
+ con = Connection(":memory:")
+ cur = con.cursor()
+ cur.execute("create table foo(x)")
+ cur.executemany("insert into foo(x) values (?)", [(3,), (4,), (5,)])
+ cur.execute("select x from foo")
+ con.rollback()
+ try:
+ cur.fetchall()
+ self.fail("should have raised InterfaceError")
+ except sqlite.InterfaceError:
+ pass
+ except:
+ self.fail("should have raised InterfaceError")
+
+ def CheckAutoCommit(self):
+ """
+ Verifies that creating a connection in autocommit mode works.
+ 2.5.3 introduced a regression so that these could no longer
+ be created.
+ """
+ con = sqlite.connect(":memory:", isolation_level=None)
+
+ def CheckPragmaAutocommit(self):
+ """
+ Verifies that running a PRAGMA statement that does an autocommit does
+ work. This did not work in 2.5.3/2.5.4.
+ """
+ cur = self.con.cursor()
+ cur.execute("create table foo(bar)")
+ cur.execute("insert into foo(bar) values (5)")
+
+ cur.execute("pragma page_size")
+ row = cur.fetchone()
+
+ def CheckSetDict(self):
+ """
+ See http://bugs.python.org/issue7478
+
+ It was possible to successfully register callbacks that could not be
+ hashed. Return codes of PyDict_SetItem were not checked properly.
+ """
+ class NotHashable:
+ def __call__(self, *args, **kw):
+ pass
+ def __hash__(self):
+ raise TypeError()
+ var = NotHashable()
+ self.assertRaises(TypeError, self.con.create_function, var)
+ self.assertRaises(TypeError, self.con.create_aggregate, var)
+ self.assertRaises(TypeError, self.con.set_authorizer, var)
+ self.assertRaises(TypeError, self.con.set_progress_handler, var)
+
def CheckConnectionCall(self):
"""
Call a connection with a non-string SQL request: check error handling
diff --git a/Lib/sqlite3/test/transactions.py b/Lib/sqlite3/test/transactions.py
index c9f6125560..70e96a12ed 100644
--- a/Lib/sqlite3/test/transactions.py
+++ b/Lib/sqlite3/test/transactions.py
@@ -147,6 +147,26 @@ class TransactionTests(unittest.TestCase):
# NO self.con2.rollback() HERE!!!
self.con1.commit()
+ def CheckRollbackCursorConsistency(self):
+ """
+ Checks if cursors on the connection are set into a "reset" state
+ when a rollback is done on the connection.
+ """
+ con = sqlite.connect(":memory:")
+ cur = con.cursor()
+ cur.execute("create table test(x)")
+ cur.execute("insert into test(x) values (5)")
+ cur.execute("select 1 union select 2 union select 3")
+
+ con.rollback()
+ try:
+ cur.fetchall()
+ self.fail("InterfaceError should have been raised")
+ except sqlite.InterfaceError as e:
+ pass
+ except:
+ self.fail("InterfaceError should have been raised")
+
class SpecialCommandTests(unittest.TestCase):
def setUp(self):
self.con = sqlite.connect(":memory:")
diff --git a/Lib/sqlite3/test/types.py b/Lib/sqlite3/test/types.py
index 0940e9b28d..29413e14ec 100644
--- a/Lib/sqlite3/test/types.py
+++ b/Lib/sqlite3/test/types.py
@@ -21,9 +21,14 @@
# misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.
-import zlib, datetime
+import datetime
import unittest
import sqlite3 as sqlite
+try:
+ import zlib
+except ImportError:
+ zlib = None
+
class SqliteTypeTests(unittest.TestCase):
def setUp(self):
@@ -312,6 +317,7 @@ class ObjectAdaptationTests(unittest.TestCase):
val = self.cur.fetchone()[0]
self.assertEqual(type(val), float)
+@unittest.skipUnless(zlib, "requires zlib")
class BinaryConverterTests(unittest.TestCase):
def convert(s):
return zlib.decompress(s)
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 47e1701d2f..f52ea01459 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -343,7 +343,7 @@ def _optimize_unicode(charset, fixup):
else:
code = 'I'
# Convert block indices to byte array of 256 bytes
- mapping = array.array('b', mapping).tostring()
+ mapping = array.array('b', mapping).tobytes()
# Convert byte array to word array
mapping = array.array(code, mapping)
assert mapping.itemsize == _sre.CODESIZE
diff --git a/Lib/ssl.py b/Lib/ssl.py
index f98bd73428..e7c175f063 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -55,13 +55,16 @@ PROTOCOL_TLSv1
"""
import textwrap
+import re
import _ssl # if we can't import it, let the error propagate
-from _ssl import SSLError
+from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
+from _ssl import _SSLContext, SSLError
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
from _ssl import (PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23,
PROTOCOL_TLSv1)
+from _ssl import OP_ALL, OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_TLSv1
from _ssl import RAND_status, RAND_egd, RAND_add
from _ssl import (
SSL_ERROR_ZERO_RETURN,
@@ -74,17 +77,99 @@ from _ssl import (
SSL_ERROR_EOF,
SSL_ERROR_INVALID_ERROR_CODE,
)
+from _ssl import HAS_SNI
from socket import getnameinfo as _getnameinfo
from socket import error as socket_error
-from socket import dup as _dup
from socket import socket, AF_INET, SOCK_STREAM
import base64 # for DER-to-PEM translation
import traceback
import errno
-class SSLSocket(socket):
+class CertificateError(ValueError):
+ pass
+
+
+def _dnsname_to_pat(dn):
+ pats = []
+ for frag in dn.split(r'.'):
+ if frag == '*':
+ # When '*' is a fragment by itself, it matches a non-empty dotless
+ # fragment.
+ pats.append('[^.]+')
+ else:
+ # Otherwise, '*' matches any dotless fragment.
+ frag = re.escape(frag)
+ pats.append(frag.replace(r'\*', '[^.]*'))
+ return re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE)
+
+
+def match_hostname(cert, hostname):
+ """Verify that *cert* (in decoded format as returned by
+ SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 rules
+ are mostly followed, but IP addresses are not accepted for *hostname*.
+
+ CertificateError is raised on failure. On success, the function
+ returns nothing.
+ """
+ if not cert:
+ raise ValueError("empty or no certificate")
+ dnsnames = []
+ san = cert.get('subjectAltName', ())
+ for key, value in san:
+ if key == 'DNS':
+ if _dnsname_to_pat(value).match(hostname):
+ return
+ dnsnames.append(value)
+ if not dnsnames:
+ # The subject is only checked when there is no dNSName entry
+ # in subjectAltName
+ for sub in cert.get('subject', ()):
+ for key, value in sub:
+ # XXX according to RFC 2818, the most specific Common Name
+ # must be used.
+ if key == 'commonName':
+ if _dnsname_to_pat(value).match(hostname):
+ return
+ dnsnames.append(value)
+ if len(dnsnames) > 1:
+ raise CertificateError("hostname %r "
+ "doesn't match either of %s"
+ % (hostname, ', '.join(map(repr, dnsnames))))
+ elif len(dnsnames) == 1:
+ raise CertificateError("hostname %r "
+ "doesn't match %r"
+ % (hostname, dnsnames[0]))
+ else:
+ raise CertificateError("no appropriate commonName or "
+ "subjectAltName fields were found")
+
+
+class SSLContext(_SSLContext):
+ """An SSLContext holds various SSL-related configuration options and
+ data, such as certificates and possibly a private key."""
+
+ __slots__ = ('protocol',)
+
+ def __new__(cls, protocol, *args, **kwargs):
+ return _SSLContext.__new__(cls, protocol)
+
+ def __init__(self, protocol):
+ self.protocol = protocol
+
+ def wrap_socket(self, sock, server_side=False,
+ do_handshake_on_connect=True,
+ suppress_ragged_eofs=True,
+ server_hostname=None):
+ return SSLSocket(sock=sock, server_side=server_side,
+ do_handshake_on_connect=do_handshake_on_connect,
+ suppress_ragged_eofs=suppress_ragged_eofs,
+ server_hostname=server_hostname,
+ _context=self)
+
+
+class SSLSocket(socket):
"""This class implements a subtype of socket.socket that wraps
the underlying OS socket in an SSL context when necessary, and
provides read and write methods over that channel."""
@@ -94,15 +179,48 @@ class SSLSocket(socket):
ssl_version=PROTOCOL_SSLv23, ca_certs=None,
do_handshake_on_connect=True,
family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None,
- suppress_ragged_eofs=True):
+ suppress_ragged_eofs=True, ciphers=None,
+ server_hostname=None,
+ _context=None):
+ if _context:
+ self.context = _context
+ else:
+ if server_side and not certfile:
+ raise ValueError("certfile must be specified for server-side "
+ "operations")
+ if keyfile and not certfile:
+ raise ValueError("certfile must be specified")
+ if certfile and not keyfile:
+ keyfile = certfile
+ self.context = SSLContext(ssl_version)
+ self.context.verify_mode = cert_reqs
+ if ca_certs:
+ self.context.load_verify_locations(ca_certs)
+ if certfile:
+ self.context.load_cert_chain(certfile, keyfile)
+ if ciphers:
+ self.context.set_ciphers(ciphers)
+ self.keyfile = keyfile
+ self.certfile = certfile
+ self.cert_reqs = cert_reqs
+ self.ssl_version = ssl_version
+ self.ca_certs = ca_certs
+ self.ciphers = ciphers
+ if server_side and server_hostname:
+ raise ValueError("server_hostname can only be specified "
+ "in client mode")
+ self.server_side = server_side
+ self.server_hostname = server_hostname
+ self.do_handshake_on_connect = do_handshake_on_connect
+ self.suppress_ragged_eofs = suppress_ragged_eofs
connected = False
if sock is not None:
socket.__init__(self,
family=sock.family,
type=sock.type,
proto=sock.proto,
- fileno=_dup(sock.fileno()))
+ fileno=sock.fileno())
self.settimeout(sock.gettimeout())
# see if it's connected
try:
@@ -112,23 +230,20 @@ class SSLSocket(socket):
raise
else:
connected = True
- sock.close()
+ sock.detach()
elif fileno is not None:
socket.__init__(self, fileno=fileno)
else:
socket.__init__(self, family=family, type=type, proto=proto)
- if certfile and not keyfile:
- keyfile = certfile
-
self._closed = False
self._sslobj = None
+ self._connected = connected
if connected:
# create the SSL object
try:
- self._sslobj = _ssl.sslwrap(self, server_side,
- keyfile, certfile,
- cert_reqs, ssl_version, ca_certs)
+ self._sslobj = self.context._wrap_socket(self, server_side,
+ server_hostname)
if do_handshake_on_connect:
timeout = self.gettimeout()
if timeout == 0.0:
@@ -140,14 +255,6 @@ class SSLSocket(socket):
self.close()
raise x
- self.keyfile = keyfile
- self.certfile = certfile
- self.cert_reqs = cert_reqs
- self.ssl_version = ssl_version
- self.ca_certs = ca_certs
- self.do_handshake_on_connect = do_handshake_on_connect
- self.suppress_ragged_eofs = suppress_ragged_eofs
-
def dup(self):
raise NotImplemented("Can't dup() %s instances" %
self.__class__.__name__)
@@ -234,6 +341,10 @@ class SSLSocket(socket):
def sendall(self, data, flags=0):
self._checkClosed()
if self._sslobj:
+ if flags != 0:
+ raise ValueError(
+ "non-zero flags not allowed in calls to sendall() on %s" %
+ self.__class__)
amount = len(data)
count = 0
while (count < amount):
@@ -321,24 +432,36 @@ class SSLSocket(socket):
finally:
self.settimeout(timeout)
- def connect(self, addr):
- """Connects to remote ADDR, and then wraps the connection in
- an SSL channel."""
-
+ def _real_connect(self, addr, return_errno):
+ if self.server_side:
+ raise ValueError("can't connect in server-side mode")
# Here we assume that the socket is client-side, and not
# connected at the time of the call. We connect it, then wrap it.
- if self._sslobj:
+ if self._connected:
raise ValueError("attempt to connect already-connected SSLSocket!")
- socket.connect(self, addr)
- self._sslobj = _ssl.sslwrap(self, False, self.keyfile, self.certfile,
- self.cert_reqs, self.ssl_version,
- self.ca_certs)
+ self._sslobj = self.context._wrap_socket(self, False, self.server_hostname)
try:
+ socket.connect(self, addr)
if self.do_handshake_on_connect:
self.do_handshake()
- except:
- self._sslobj = None
- raise
+ except socket_error as e:
+ if return_errno:
+ return e.errno
+ else:
+ self._sslobj = None
+ raise e
+ self._connected = True
+ return 0
+
+ def connect(self, addr):
+ """Connects to remote ADDR, and then wraps the connection in
+ an SSL channel."""
+ self._real_connect(addr, False)
+
+ def connect_ex(self, addr):
+ """Connects to remote ADDR, and then wraps the connection in
+ an SSL channel."""
+ return self._real_connect(addr, True)
def accept(self):
"""Accepts a new connection from a remote client, and returns
@@ -352,6 +475,7 @@ class SSLSocket(socket):
cert_reqs=self.cert_reqs,
ssl_version=self.ssl_version,
ca_certs=self.ca_certs,
+ ciphers=self.ciphers,
do_handshake_on_connect=
self.do_handshake_on_connect),
addr)
@@ -365,13 +489,14 @@ def wrap_socket(sock, keyfile=None, certfile=None,
server_side=False, cert_reqs=CERT_NONE,
ssl_version=PROTOCOL_SSLv23, ca_certs=None,
do_handshake_on_connect=True,
- suppress_ragged_eofs=True):
+ suppress_ragged_eofs=True, ciphers=None):
return SSLSocket(sock=sock, keyfile=keyfile, certfile=certfile,
server_side=server_side, cert_reqs=cert_reqs,
ssl_version=ssl_version, ca_certs=ca_certs,
do_handshake_on_connect=do_handshake_on_connect,
- suppress_ragged_eofs=suppress_ragged_eofs)
+ suppress_ragged_eofs=suppress_ragged_eofs,
+ ciphers=ciphers)
# some utility functions
diff --git a/Lib/string.py b/Lib/string.py
index a9898e8a06..ef0334c472 100644
--- a/Lib/string.py
+++ b/Lib/string.py
@@ -14,6 +14,8 @@ printable -- a string containing all ASCII characters considered printable
"""
+import _string
+
# Some strings for ctype-style character classification
whitespace = ' \t\n\r\v\f'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
@@ -42,28 +44,6 @@ def capwords(s, sep=None):
return (sep or ' ').join(x.capitalize() for x in s.split(sep))
-# Construct a translation map for bytes.translate
-def maketrans(frm: bytes, to: bytes) -> bytes:
- """maketrans(frm, to) -> bytes
-
- Return a translation table (a bytes object of length 256)
- suitable for use in bytes.translate where each byte in frm is
- mapped to the byte at the same position in to.
- The strings frm and to must be of the same length.
- """
- import warnings
- warnings.warn("string.maketrans is deprecated, use bytes.maketrans instead",
- DeprecationWarning, 2)
- if len(frm) != len(to):
- raise ValueError("maketrans arguments must have same length")
- if not (isinstance(frm, bytes) and isinstance(to, bytes)):
- raise TypeError("maketrans arguments must be bytes objects")
- L = bytearray(range(256))
- for i, c in enumerate(frm):
- L[c] = to[i]
- return bytes(L)
-
-
####################################################################
import re as _re
@@ -103,7 +83,7 @@ class _TemplateMetaclass(type):
'delim' : _re.escape(cls.delimiter),
'id' : cls.idpattern,
}
- cls.pattern = _re.compile(pattern, _re.IGNORECASE | _re.VERBOSE)
+ cls.pattern = _re.compile(pattern, cls.flags | _re.VERBOSE)
class Template(metaclass=_TemplateMetaclass):
@@ -111,6 +91,7 @@ class Template(metaclass=_TemplateMetaclass):
delimiter = '$'
idpattern = r'[_a-z][_a-z0-9]*'
+ flags = _re.IGNORECASE
def __init__(self, template):
self.template = template
@@ -166,24 +147,18 @@ class Template(metaclass=_TemplateMetaclass):
mapping = args[0]
# Helper function for .sub()
def convert(mo):
- named = mo.group('named')
+ named = mo.group('named') or mo.group('braced')
if named is not None:
try:
# We use this idiom instead of str() because the latter
# will fail if val is a Unicode containing non-ASCII
return '%s' % (mapping[named],)
except KeyError:
- return self.delimiter + named
- braced = mo.group('braced')
- if braced is not None:
- try:
- return '%s' % (mapping[braced],)
- except KeyError:
- return self.delimiter + '{' + braced + '}'
+ return mo.group()
if mo.group('escaped') is not None:
return self.delimiter
if mo.group('invalid') is not None:
- return self.delimiter
+ return mo.group()
raise ValueError('Unrecognized named group in pattern',
self.pattern)
return self.pattern.sub(convert, self.template)
@@ -195,10 +170,10 @@ class Template(metaclass=_TemplateMetaclass):
# see PEP 3101 for details and purpose of this class
# The hard parts are reused from the C implementation. They're exposed as "_"
-# prefixed methods of str and unicode.
+# prefixed methods of str.
-# The overall parser is implemented in str._formatter_parser.
-# The field name parser is implemented in str._formatter_field_name_split
+# The overall parser is implemented in _string.formatter_parser.
+# The field name parser is implemented in _string.formatter_field_name_split
class Formatter:
def format(self, format_string, *args, **kwargs):
@@ -267,7 +242,7 @@ class Formatter:
return str(value)
elif conversion is None:
return value
- raise ValueError("Unknown converion specifier {0!s}".format(conversion))
+ raise ValueError("Unknown conversion specifier {0!s}".format(conversion))
# returns an iterable that contains tuples of the form:
@@ -278,7 +253,7 @@ class Formatter:
# if field_name is not None, it is looked up, formatted
# with format_spec and conversion and then used
def parse(self, format_string):
- return format_string._formatter_parser()
+ return _string.formatter_parser(format_string)
# given a field_name, find the object it references.
@@ -287,7 +262,7 @@ class Formatter:
# used_args: a set of which args have been used
# args, kwargs: as passed in to vformat
def get_field(self, field_name, args, kwargs):
- first, rest = field_name._formatter_field_name_split()
+ first, rest = _string.formatter_field_name_split(field_name)
obj = self.get_value(first, args, kwargs)
diff --git a/Lib/struct.py b/Lib/struct.py
index dca15e2ad3..9bfc23f8d5 100644
--- a/Lib/struct.py
+++ b/Lib/struct.py
@@ -1,6 +1,6 @@
__all__ = [
# Functions
- 'calcsize', 'pack', 'unpack', 'unpack', 'unpack_from',
+ 'calcsize', 'pack', 'pack_into', 'unpack', 'unpack_from',
# Classes
'Struct',
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 299f73e711..9856e6a333 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -27,9 +27,10 @@ This module defines one class called Popen:
class Popen(args, bufsize=0, executable=None,
stdin=None, stdout=None, stderr=None,
- preexec_fn=None, close_fds=False, shell=False,
+ preexec_fn=None, close_fds=True, shell=False,
cwd=None, env=None, universal_newlines=False,
- startupinfo=None, creationflags=0):
+ startupinfo=None, creationflags=0,
+ restore_signals=True, start_new_session=False, pass_fds=()):
Arguments are:
@@ -38,12 +39,12 @@ args should be a string, or a sequence of program arguments. The
program to execute is normally the first item in the args sequence or
string, but can be explicitly set by using the executable argument.
-On UNIX, with shell=False (default): In this case, the Popen class
+On POSIX, with shell=False (default): In this case, the Popen class
uses os.execvp() to execute the child program. args should normally
be a sequence. A string will be treated as a sequence with the string
as the only item (the program to execute).
-On UNIX, with shell=True: If args is a string, it specifies the
+On POSIX, with shell=True: If args is a string, it specifies the
command string to execute through the shell. If args is a sequence,
the first item specifies the command string, and any additional items
will be treated as additional shell arguments.
@@ -72,11 +73,19 @@ parent. Additionally, stderr can be STDOUT, which indicates that the
stderr data from the applications should be captured into the same
file handle as for stdout.
-If preexec_fn is set to a callable object, this object will be called
-in the child process just before the child is executed.
+On POSIX, if preexec_fn is set to a callable object, this object will be
+called in the child process just before the child is executed. The use
+of preexec_fn is not thread safe, using it in the presence of threads
+could lead to a deadlock in the child process before the new executable
+is executed.
If close_fds is true, all file descriptors except 0, 1 and 2 will be
-closed before the child process is executed.
+closed before the child process is executed. The default for close_fds
+varies by platform: Always true on POSIX. True when stdin/stdout/stderr
+are None on Windows, false otherwise.
+
+pass_fds is an optional sequence of file descriptors to keep open between the
+parent and child. Providing any pass_fds implicitly sets close_fds to true.
if shell is true, the specified command will be executed through the
shell.
@@ -84,12 +93,20 @@ shell.
If cwd is not None, the current directory will be changed to cwd
before the child is executed.
+On POSIX, if restore_signals is True all signals that Python sets to
+SIG_IGN are restored to SIG_DFL in the child process before the exec.
+Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. This
+parameter does nothing on Windows.
+
+On POSIX, if start_new_session is True, the setsid() system call will be made
+in the child process prior to executing the command.
+
If env is not None, it defines the environment variables for the new
process.
If universal_newlines is true, the file objects stdout and stderr are
opened as a text files, but lines may be terminated by any of '\n',
-the Unix end-of-line convention, '\r', the Macintosh convention or
+the Unix end-of-line convention, '\r', the old Macintosh convention or
'\r\n', the Windows convention. All of these external representations
are seen as '\n' by the Python program. Note: This feature is only
available if Python is built with universal newline support (the
@@ -110,7 +127,7 @@ call(*popenargs, **kwargs):
The arguments are the same as for the Popen constructor. Example:
- >>> retcode = call(["ls", "-l"])
+ >>> retcode = subprocess.call(["ls", "-l"])
check_call(*popenargs, **kwargs):
Run command with arguments. Wait for command to complete. If the
@@ -120,7 +137,7 @@ check_call(*popenargs, **kwargs):
The arguments are the same as for the Popen constructor. Example:
- >>> check_call(["ls", "-l"])
+ >>> subprocess.check_call(["ls", "-l"])
0
getstatusoutput(cmd):
@@ -230,7 +247,7 @@ pid
returncode
The child return code. A None value indicates that the process
hasn't terminated yet. A negative value -N indicates that the
- child was terminated by signal N (UNIX only).
+ child was terminated by signal N (POSIX only).
Replacing older functions with the subprocess module
@@ -326,6 +343,8 @@ import os
import traceback
import gc
import signal
+import builtins
+import warnings
import errno
# Exception classes used by this module.
@@ -361,22 +380,47 @@ else:
import fcntl
import pickle
+ try:
+ import _posixsubprocess
+ except ImportError:
+ _posixsubprocess = None
+ warnings.warn("The _posixsubprocess module is not being used. "
+ "Child process reliability may suffer if your "
+ "program uses threads.", RuntimeWarning)
+
# When select or poll has indicated that the file is writable,
# we can write up to _PIPE_BUF bytes without risk of blocking.
# POSIX defines PIPE_BUF as >= 512.
_PIPE_BUF = getattr(select, 'PIPE_BUF', 512)
+ _FD_CLOEXEC = getattr(fcntl, 'FD_CLOEXEC', 1)
+
+ def _set_cloexec(fd, cloexec):
+ old = fcntl.fcntl(fd, fcntl.F_GETFD)
+ if cloexec:
+ fcntl.fcntl(fd, fcntl.F_SETFD, old | _FD_CLOEXEC)
+ else:
+ fcntl.fcntl(fd, fcntl.F_SETFD, old & ~_FD_CLOEXEC)
+
+ if _posixsubprocess:
+ _create_pipe = _posixsubprocess.cloexec_pipe
+ else:
+ def _create_pipe():
+ fds = os.pipe()
+ _set_cloexec(fds[0], True)
+ _set_cloexec(fds[1], True)
+ return fds
__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "getstatusoutput",
"getoutput", "check_output", "CalledProcessError"]
if mswindows:
- from _subprocess import (CREATE_NEW_CONSOLE,
+ from _subprocess import (CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP,
STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
STD_ERROR_HANDLE, SW_HIDE,
STARTF_USESTDHANDLES, STARTF_USESHOWWINDOW)
- __all__.extend(["CREATE_NEW_CONSOLE",
+ __all__.extend(["CREATE_NEW_CONSOLE", "CREATE_NEW_PROCESS_GROUP",
"STD_INPUT_HANDLE", "STD_OUTPUT_HANDLE",
"STD_ERROR_HANDLE", "SW_HIDE",
"STARTF_USESTDHANDLES", "STARTF_USESHOWWINDOW"])
@@ -547,7 +591,7 @@ def list2cmdline(seq):
# Various tools for executing commands and looking at their output and status.
#
-# NB This only works (and is only relevant) for UNIX.
+# NB This only works (and is only relevant) for POSIX.
def getstatusoutput(cmd):
"""Return (status, output) of executing cmd in a shell.
@@ -587,12 +631,17 @@ def getoutput(cmd):
return getstatusoutput(cmd)[1]
+_PLATFORM_DEFAULT_CLOSE_FDS = object()
+
+
class Popen(object):
def __init__(self, args, bufsize=0, executable=None,
stdin=None, stdout=None, stderr=None,
- preexec_fn=None, close_fds=False, shell=False,
- cwd=None, env=None, universal_newlines=False,
- startupinfo=None, creationflags=0):
+ preexec_fn=None, close_fds=_PLATFORM_DEFAULT_CLOSE_FDS,
+ shell=False, cwd=None, env=None, universal_newlines=False,
+ startupinfo=None, creationflags=0,
+ restore_signals=True, start_new_session=False,
+ pass_fds=()):
"""Create new Popen instance."""
_cleanup()
@@ -606,12 +655,24 @@ class Popen(object):
if preexec_fn is not None:
raise ValueError("preexec_fn is not supported on Windows "
"platforms")
- if close_fds and (stdin is not None or stdout is not None or
- stderr is not None):
- raise ValueError("close_fds is not supported on Windows "
- "platforms if you redirect stdin/stdout/stderr")
+ any_stdio_set = (stdin is not None or stdout is not None or
+ stderr is not None)
+ if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS:
+ if any_stdio_set:
+ close_fds = False
+ else:
+ close_fds = True
+ elif close_fds and any_stdio_set:
+ raise ValueError(
+ "close_fds is not supported on Windows platforms"
+ " if you redirect stdin/stdout/stderr")
else:
# POSIX
+ if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS:
+ close_fds = True
+ if pass_fds and not close_fds:
+ warnings.warn("pass_fds overriding close_fds.", RuntimeWarning)
+ close_fds = True
if startupinfo is not None:
raise ValueError("startupinfo is only supported on Windows "
"platforms")
@@ -638,46 +699,71 @@ class Popen(object):
# On POSIX, the child objects are file descriptors. On
# Windows, these are Windows file handles. The parent objects
# are file descriptors on both platforms. The parent objects
- # are None when not using PIPEs. The child objects are None
+ # are -1 when not using PIPEs. The child objects are -1
# when not redirecting.
(p2cread, p2cwrite,
c2pread, c2pwrite,
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
- self._execute_child(args, executable, preexec_fn, close_fds,
- cwd, env, universal_newlines,
- startupinfo, creationflags, shell,
- p2cread, p2cwrite,
- c2pread, c2pwrite,
- errread, errwrite)
+ # We wrap OS handles *before* launching the child, otherwise a
+ # quickly terminating child could make our fds unwrappable
+ # (see #8458).
if mswindows:
- if p2cwrite is not None:
+ if p2cwrite != -1:
p2cwrite = msvcrt.open_osfhandle(p2cwrite.Detach(), 0)
- if c2pread is not None:
+ if c2pread != -1:
c2pread = msvcrt.open_osfhandle(c2pread.Detach(), 0)
- if errread is not None:
+ if errread != -1:
errread = msvcrt.open_osfhandle(errread.Detach(), 0)
- if p2cwrite is not None:
+ if p2cwrite != -1:
self.stdin = io.open(p2cwrite, 'wb', bufsize)
if self.universal_newlines:
self.stdin = io.TextIOWrapper(self.stdin)
- if c2pread is not None:
+ if c2pread != -1:
self.stdout = io.open(c2pread, 'rb', bufsize)
if universal_newlines:
self.stdout = io.TextIOWrapper(self.stdout)
- if errread is not None:
+ if errread != -1:
self.stderr = io.open(errread, 'rb', bufsize)
if universal_newlines:
self.stderr = io.TextIOWrapper(self.stderr)
+ try:
+ self._execute_child(args, executable, preexec_fn, close_fds,
+ pass_fds, cwd, env, universal_newlines,
+ startupinfo, creationflags, shell,
+ p2cread, p2cwrite,
+ c2pread, c2pwrite,
+ errread, errwrite,
+ restore_signals, start_new_session)
+ except:
+ # Cleanup if the child failed starting
+ for f in filter(None, [self.stdin, self.stdout, self.stderr]):
+ try:
+ f.close()
+ except EnvironmentError:
+ # Ignore EBADF or other errors
+ pass
+ raise
+
def _translate_newlines(self, data, encoding):
data = data.replace(b"\r\n", b"\n").replace(b"\r", b"\n")
return data.decode(encoding)
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, traceback):
+ if self.stdout:
+ self.stdout.close()
+ if self.stderr:
+ self.stderr.close()
+ if self.stdin:
+ self.stdin.close()
def __del__(self, _maxsize=sys.maxsize, _active=_active):
if not self._child_created:
@@ -737,11 +823,11 @@ class Popen(object):
p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
"""
if stdin is None and stdout is None and stderr is None:
- return (None, None, None, None, None, None)
+ return (-1, -1, -1, -1, -1, -1)
- p2cread, p2cwrite = None, None
- c2pread, c2pwrite = None, None
- errread, errwrite = None, None
+ p2cread, p2cwrite = -1, -1
+ c2pread, c2pwrite = -1, -1
+ errread, errwrite = -1, -1
if stdin is None:
p2cread = _subprocess.GetStdHandle(_subprocess.STD_INPUT_HANDLE)
@@ -814,20 +900,23 @@ class Popen(object):
def _execute_child(self, args, executable, preexec_fn, close_fds,
- cwd, env, universal_newlines,
+ pass_fds, cwd, env, universal_newlines,
startupinfo, creationflags, shell,
p2cread, p2cwrite,
c2pread, c2pwrite,
- errread, errwrite):
+ errread, errwrite,
+ unused_restore_signals, unused_start_new_session):
"""Execute program (MS Windows version)"""
+ assert not pass_fds, "pass_fds not supported on Windows."
+
if not isinstance(args, str):
args = list2cmdline(args)
# Process startup details
if startupinfo is None:
startupinfo = STARTUPINFO()
- if None not in (p2cread, c2pwrite, errwrite):
+ if -1 not in (p2cread, c2pwrite, errwrite):
startupinfo.dwFlags |= _subprocess.STARTF_USESTDHANDLES
startupinfo.hStdInput = p2cread
startupinfo.hStdOutput = c2pwrite
@@ -877,11 +966,11 @@ class Popen(object):
# output pipe are maintained in this process or else the
# pipe will not close when the child process exits and the
# ReadFile will hang.
- if p2cread is not None:
+ if p2cread != -1:
p2cread.Close()
- if c2pwrite is not None:
+ if c2pwrite != -1:
c2pwrite.Close()
- if errwrite is not None:
+ if errwrite != -1:
errwrite.Close()
# Retain the process handle, but close the thread handle
@@ -919,6 +1008,7 @@ class Popen(object):
def _readerthread(self, fh, buffer):
buffer.append(fh.read())
+ fh.close()
def _communicate(self, input):
@@ -966,8 +1056,12 @@ class Popen(object):
"""
if sig == signal.SIGTERM:
self.terminate()
+ elif sig == signal.CTRL_C_EVENT:
+ os.kill(self.pid, signal.CTRL_C_EVENT)
+ elif sig == signal.CTRL_BREAK_EVENT:
+ os.kill(self.pid, signal.CTRL_BREAK_EVENT)
else:
- raise ValueError("Only SIGTERM is supported on Windows")
+ raise ValueError("Unsupported signal: {}".format(sig))
def terminate(self):
"""Terminates the process
@@ -984,14 +1078,14 @@ class Popen(object):
"""Construct and return tuple with IO objects:
p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
"""
- p2cread, p2cwrite = None, None
- c2pread, c2pwrite = None, None
- errread, errwrite = None, None
+ p2cread, p2cwrite = -1, -1
+ c2pread, c2pwrite = -1, -1
+ errread, errwrite = -1, -1
if stdin is None:
pass
elif stdin == PIPE:
- p2cread, p2cwrite = os.pipe()
+ p2cread, p2cwrite = _create_pipe()
elif isinstance(stdin, int):
p2cread = stdin
else:
@@ -1001,7 +1095,7 @@ class Popen(object):
if stdout is None:
pass
elif stdout == PIPE:
- c2pread, c2pwrite = os.pipe()
+ c2pread, c2pwrite = _create_pipe()
elif isinstance(stdout, int):
c2pwrite = stdout
else:
@@ -1011,7 +1105,7 @@ class Popen(object):
if stderr is None:
pass
elif stderr == PIPE:
- errread, errwrite = os.pipe()
+ errread, errwrite = _create_pipe()
elif stderr == STDOUT:
errwrite = c2pwrite
elif isinstance(stderr, int):
@@ -1025,30 +1119,23 @@ class Popen(object):
errread, errwrite)
- def _set_cloexec_flag(self, fd, cloexec=True):
- try:
- cloexec_flag = fcntl.FD_CLOEXEC
- except AttributeError:
- cloexec_flag = 1
-
- old = fcntl.fcntl(fd, fcntl.F_GETFD)
- if cloexec:
- fcntl.fcntl(fd, fcntl.F_SETFD, old | cloexec_flag)
- else:
- fcntl.fcntl(fd, fcntl.F_SETFD, old & ~cloexec_flag)
-
-
- def _close_fds(self, but):
- os.closerange(3, but)
- os.closerange(but + 1, MAXFD)
+ def _close_fds(self, fds_to_keep):
+ start_fd = 3
+ for fd in sorted(fds_to_keep):
+ if fd >= start_fd:
+ os.closerange(start_fd, fd)
+ start_fd = fd + 1
+ if start_fd <= MAXFD:
+ os.closerange(start_fd, MAXFD)
def _execute_child(self, args, executable, preexec_fn, close_fds,
- cwd, env, universal_newlines,
+ pass_fds, cwd, env, universal_newlines,
startupinfo, creationflags, shell,
p2cread, p2cwrite,
c2pread, c2pwrite,
- errread, errwrite):
+ errread, errwrite,
+ restore_signals, start_new_session):
"""Execute program (POSIX version)"""
if isinstance(args, str):
@@ -1064,104 +1151,165 @@ class Popen(object):
if executable is None:
executable = args[0]
- # For transferring possible exec failure from child to parent
- # The first char specifies the exception type: 0 means
- # OSError, 1 means some other error.
- errpipe_read, errpipe_write = os.pipe()
+ # For transferring possible exec failure from child to parent.
+ # Data format: "exception name:hex errno:description"
+ # Pickle is not used; it is complex and involves memory allocation.
+ errpipe_read, errpipe_write = _create_pipe()
try:
try:
- self._set_cloexec_flag(errpipe_write)
- gc_was_enabled = gc.isenabled()
- # Disable gc to avoid bug where gc -> file_dealloc ->
- # write to stderr -> hang. http://bugs.python.org/issue1336
- gc.disable()
- try:
- self.pid = os.fork()
- except:
- if gc_was_enabled:
- gc.enable()
- raise
- self._child_created = True
- if self.pid == 0:
- # Child
- try:
- # Close parent's pipe ends
- if p2cwrite is not None:
- os.close(p2cwrite)
- if c2pread is not None:
- os.close(c2pread)
- if errread is not None:
- os.close(errread)
- os.close(errpipe_read)
-
- # Dup fds for child
- def _dup2(a, b):
- # dup2() removes the CLOEXEC flag but
- # we must do it ourselves if dup2()
- # would be a no-op (issue #10806).
- if a == b:
- self._set_cloexec_flag(a, False)
- elif a is not None:
- os.dup2(a, b)
- _dup2(p2cread, 0)
- _dup2(c2pwrite, 1)
- _dup2(errwrite, 2)
-
- # Close pipe fds. Make sure we don't close the
- # same fd more than once, or standard fds.
- closed = { None }
- for fd in [p2cread, c2pwrite, errwrite]:
- if fd not in closed and fd > 2:
- os.close(fd)
- closed.add(fd)
-
- # Close all other fds, if asked for
- if close_fds:
- self._close_fds(but=errpipe_write)
-
- if cwd is not None:
- os.chdir(cwd)
-
- if preexec_fn:
- preexec_fn()
-
- if env is None:
- os.execvp(executable, args)
- else:
- os.execvpe(executable, args, env)
+ if _posixsubprocess:
+ # We must avoid complex work that could involve
+ # malloc or free in the child process to avoid
+ # potential deadlocks, thus we do all this here.
+ # and pass it to fork_exec()
+ if env:
+ env_list = [os.fsencode(k) + b'=' + os.fsencode(v)
+ for k, v in env.items()]
+ else:
+ env_list = None # Use execv instead of execve.
+ executable = os.fsencode(executable)
+ if os.path.dirname(executable):
+ executable_list = (executable,)
+ else:
+ # This matches the behavior of os._execvpe().
+ executable_list = tuple(
+ os.path.join(os.fsencode(dir), executable)
+ for dir in os.get_exec_path(env))
+ fds_to_keep = set(pass_fds)
+ fds_to_keep.add(errpipe_write)
+ self.pid = _posixsubprocess.fork_exec(
+ args, executable_list,
+ close_fds, sorted(fds_to_keep), cwd, env_list,
+ p2cread, p2cwrite, c2pread, c2pwrite,
+ errread, errwrite,
+ errpipe_read, errpipe_write,
+ restore_signals, start_new_session, preexec_fn)
+ else:
+ # Pure Python implementation: It is not thread safe.
+ # This implementation may deadlock in the child if your
+ # parent process has any other threads running.
+
+ gc_was_enabled = gc.isenabled()
+ # Disable gc to avoid bug where gc -> file_dealloc ->
+ # write to stderr -> hang. See issue1336
+ gc.disable()
+ try:
+ self.pid = os.fork()
except:
- exc_type, exc_value, tb = sys.exc_info()
- # Save the traceback and attach it to the exception
- # object
- exc_lines = traceback.format_exception(exc_type,
- exc_value,
- tb)
- exc_value.child_traceback = ''.join(exc_lines)
- os.write(errpipe_write, pickle.dumps(exc_value))
-
- # This exitcode won't be reported to applications, so
- # it really doesn't matter what we return.
- os._exit(255)
-
- # Parent
- if gc_was_enabled:
- gc.enable()
+ if gc_was_enabled:
+ gc.enable()
+ raise
+ self._child_created = True
+ if self.pid == 0:
+ # Child
+ try:
+ # Close parent's pipe ends
+ if p2cwrite != -1:
+ os.close(p2cwrite)
+ if c2pread != -1:
+ os.close(c2pread)
+ if errread != -1:
+ os.close(errread)
+ os.close(errpipe_read)
+
+ # Dup fds for child
+ def _dup2(a, b):
+ # dup2() removes the CLOEXEC flag but
+ # we must do it ourselves if dup2()
+ # would be a no-op (issue #10806).
+ if a == b:
+ _set_cloexec(a, False)
+ elif a != -1:
+ os.dup2(a, b)
+ _dup2(p2cread, 0)
+ _dup2(c2pwrite, 1)
+ _dup2(errwrite, 2)
+
+ # Close pipe fds. Make sure we don't close the
+ # same fd more than once, or standard fds.
+ closed = set()
+ for fd in [p2cread, c2pwrite, errwrite]:
+ if fd > 2 and fd not in closed:
+ os.close(fd)
+ closed.add(fd)
+
+ # Close all other fds, if asked for
+ if close_fds:
+ fds_to_keep = set(pass_fds)
+ fds_to_keep.add(errpipe_write)
+ self._close_fds(fds_to_keep)
+
+
+ if cwd is not None:
+ os.chdir(cwd)
+
+ # This is a copy of Python/pythonrun.c
+ # _Py_RestoreSignals(). If that were exposed
+ # as a sys._py_restoresignals func it would be
+ # better.. but this pure python implementation
+ # isn't likely to be used much anymore.
+ if restore_signals:
+ signals = ('SIGPIPE', 'SIGXFZ', 'SIGXFSZ')
+ for sig in signals:
+ if hasattr(signal, sig):
+ signal.signal(getattr(signal, sig),
+ signal.SIG_DFL)
+
+ if start_new_session and hasattr(os, 'setsid'):
+ os.setsid()
+
+ if preexec_fn:
+ preexec_fn()
+
+ if env is None:
+ os.execvp(executable, args)
+ else:
+ os.execvpe(executable, args, env)
+
+ except:
+ try:
+ exc_type, exc_value = sys.exc_info()[:2]
+ if isinstance(exc_value, OSError):
+ errno_num = exc_value.errno
+ else:
+ errno_num = 0
+ message = '%s:%x:%s' % (exc_type.__name__,
+ errno_num, exc_value)
+ message = message.encode(errors="surrogatepass")
+ os.write(errpipe_write, message)
+ except Exception:
+ # We MUST not allow anything odd happening
+ # above to prevent us from exiting below.
+ pass
+
+ # This exitcode won't be reported to applications
+ # so it really doesn't matter what we return.
+ os._exit(255)
+
+ # Parent
+ if gc_was_enabled:
+ gc.enable()
finally:
# be sure the FD is closed no matter what
os.close(errpipe_write)
- if p2cread is not None and p2cwrite is not None:
+ if p2cread != -1 and p2cwrite != -1:
os.close(p2cread)
- if c2pwrite is not None and c2pread is not None:
+ if c2pwrite != -1 and c2pread != -1:
os.close(c2pwrite)
- if errwrite is not None and errread is not None:
+ if errwrite != -1 and errread != -1:
os.close(errwrite)
# Wait for exec to fail or succeed; possibly raising an
- # exception (limited to 1 MB)
- data = _eintr_retry_call(os.read, errpipe_read, 1048576)
+ # exception (limited in size)
+ data = bytearray()
+ while True:
+ part = _eintr_retry_call(os.read, errpipe_read, 50000)
+ data += part
+ if not part or len(data) > 50000:
+ break
finally:
# be sure the FD is closed no matter what
os.close(errpipe_read)
@@ -1172,11 +1320,28 @@ class Popen(object):
except OSError as e:
if e.errno != errno.ECHILD:
raise
- child_exception = pickle.loads(data)
+ try:
+ exception_name, hex_errno, err_msg = data.split(b':', 2)
+ except ValueError:
+ print('Bad exception data:', repr(data))
+ exception_name = b'RuntimeError'
+ hex_errno = b'0'
+ err_msg = b'Unknown'
+ child_exception_type = getattr(
+ builtins, exception_name.decode('ascii'),
+ RuntimeError)
for fd in (p2cwrite, c2pread, errread):
- if fd is not None:
+ if fd != -1:
os.close(fd)
- raise child_exception
+ err_msg = err_msg.decode(errors="surrogatepass")
+ if issubclass(child_exception_type, OSError) and hex_errno:
+ errno_num = int(hex_errno, 16)
+ if errno_num != 0:
+ err_msg = os.strerror(errno_num)
+ if errno_num == errno.ENOENT:
+ err_msg += ': ' + repr(args[0])
+ raise child_exception_type(errno_num, err_msg)
+ raise child_exception_type(err_msg)
def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
diff --git a/Lib/sunau.py b/Lib/sunau.py
index 5f50e8fb9c..6775a53cf7 100644
--- a/Lib/sunau.py
+++ b/Lib/sunau.py
@@ -154,6 +154,9 @@ class Au_read:
if type(f) == type(''):
import builtins
f = builtins.open(f, 'rb')
+ self._opened = True
+ else:
+ self._opened = False
self.initfp(f)
def __del__(self):
@@ -275,6 +278,8 @@ class Au_read:
self._soundpos = pos
def close(self):
+ if self._opened and self._file:
+ self._file.close()
self._file = None
class Au_write:
@@ -283,11 +288,15 @@ class Au_write:
if type(f) == type(''):
import builtins
f = builtins.open(f, 'wb')
+ self._opened = True
+ else:
+ self._opened = False
self.initfp(f)
def __del__(self):
if self._file:
self.close()
+ self._file = None
def initfp(self, file):
self._file = file
@@ -401,6 +410,8 @@ class Au_write:
self._datalength != self._datawritten:
self._patchheader()
self._file.flush()
+ if self._opened and self._file:
+ self._file.close()
self._file = None
#
diff --git a/Lib/symbol.py b/Lib/symbol.py
index 4b4c219863..e3fff3422c 100755
--- a/Lib/symbol.py
+++ b/Lib/symbol.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Non-terminal symbols of Python grammar (from "graminit.h")."""
@@ -26,69 +26,69 @@ stmt = 268
simple_stmt = 269
small_stmt = 270
expr_stmt = 271
-augassign = 272
-del_stmt = 273
-pass_stmt = 274
-flow_stmt = 275
-break_stmt = 276
-continue_stmt = 277
-return_stmt = 278
-yield_stmt = 279
-raise_stmt = 280
-import_stmt = 281
-import_name = 282
-import_from = 283
-import_as_name = 284
-dotted_as_name = 285
-import_as_names = 286
-dotted_as_names = 287
-dotted_name = 288
-global_stmt = 289
-nonlocal_stmt = 290
-assert_stmt = 291
-compound_stmt = 292
-if_stmt = 293
-while_stmt = 294
-for_stmt = 295
-try_stmt = 296
-with_stmt = 297
-with_item = 298
-except_clause = 299
-suite = 300
-test = 301
-test_nocond = 302
-lambdef = 303
-lambdef_nocond = 304
-or_test = 305
-and_test = 306
-not_test = 307
-comparison = 308
-comp_op = 309
-star_expr = 310
-expr = 311
-xor_expr = 312
-and_expr = 313
-shift_expr = 314
-arith_expr = 315
-term = 316
-factor = 317
-power = 318
-atom = 319
-testlist_comp = 320
-trailer = 321
-subscriptlist = 322
-subscript = 323
-sliceop = 324
-exprlist = 325
-testlist = 326
-dictorsetmaker = 327
-classdef = 328
-arglist = 329
-argument = 330
-comp_iter = 331
-comp_for = 332
-comp_if = 333
-testlist1 = 334
+testlist_star_expr = 272
+augassign = 273
+del_stmt = 274
+pass_stmt = 275
+flow_stmt = 276
+break_stmt = 277
+continue_stmt = 278
+return_stmt = 279
+yield_stmt = 280
+raise_stmt = 281
+import_stmt = 282
+import_name = 283
+import_from = 284
+import_as_name = 285
+dotted_as_name = 286
+import_as_names = 287
+dotted_as_names = 288
+dotted_name = 289
+global_stmt = 290
+nonlocal_stmt = 291
+assert_stmt = 292
+compound_stmt = 293
+if_stmt = 294
+while_stmt = 295
+for_stmt = 296
+try_stmt = 297
+with_stmt = 298
+with_item = 299
+except_clause = 300
+suite = 301
+test = 302
+test_nocond = 303
+lambdef = 304
+lambdef_nocond = 305
+or_test = 306
+and_test = 307
+not_test = 308
+comparison = 309
+comp_op = 310
+star_expr = 311
+expr = 312
+xor_expr = 313
+and_expr = 314
+shift_expr = 315
+arith_expr = 316
+term = 317
+factor = 318
+power = 319
+atom = 320
+testlist_comp = 321
+trailer = 322
+subscriptlist = 323
+subscript = 324
+sliceop = 325
+exprlist = 326
+testlist = 327
+dictorsetmaker = 328
+classdef = 329
+arglist = 330
+argument = 331
+comp_iter = 332
+comp_for = 333
+comp_if = 334
encoding_decl = 335
yield_expr = 336
#--end constants--
diff --git a/Lib/symtable.py b/Lib/symtable.py
index 7548a7f359..39c1a8014f 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -2,9 +2,8 @@
import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM,
- DEF_FREE_GLOBAL, DEF_FREE_CLASS, DEF_IMPORT, DEF_BOUND,
- OPT_IMPORT_STAR, SCOPE_OFF, SCOPE_MASK, FREE,
- GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)
+ DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, SCOPE_OFF, SCOPE_MASK, FREE,
+ LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
import weakref
@@ -138,7 +137,9 @@ class Function(SymbolTable):
def get_locals(self):
if self.__locals is None:
- self.__locals = self.__idents_matching(lambda x:x & DEF_BOUND)
+ locs = (LOCAL, CELL)
+ test = lambda x: ((x >> SCOPE_OFF) & SCOPE_MASK) in locs
+ self.__locals = self.__idents_matching(test)
return self.__locals
def get_globals(self):
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
new file mode 100644
index 0000000000..3b0ca85fbb
--- /dev/null
+++ b/Lib/sysconfig.py
@@ -0,0 +1,778 @@
+"""Provide access to Python's configuration information.
+
+"""
+import sys
+import os
+from os.path import pardir, realpath
+
+__all__ = [
+ 'get_config_h_filename',
+ 'get_config_var',
+ 'get_config_vars',
+ 'get_makefile_filename',
+ 'get_path',
+ 'get_path_names',
+ 'get_paths',
+ 'get_platform',
+ 'get_python_version',
+ 'get_scheme_names',
+ 'parse_config_h',
+ ]
+
+_INSTALL_SCHEMES = {
+ 'posix_prefix': {
+ 'stdlib': '{base}/lib/python{py_version_short}',
+ 'platstdlib': '{platbase}/lib/python{py_version_short}',
+ 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
+ 'include':
+ '{base}/include/python{py_version_short}{abiflags}',
+ 'platinclude':
+ '{platbase}/include/python{py_version_short}{abiflags}',
+ 'scripts': '{base}/bin',
+ 'data': '{base}',
+ },
+ 'posix_home': {
+ 'stdlib': '{base}/lib/python',
+ 'platstdlib': '{base}/lib/python',
+ 'purelib': '{base}/lib/python',
+ 'platlib': '{base}/lib/python',
+ 'include': '{base}/include/python',
+ 'platinclude': '{base}/include/python',
+ 'scripts': '{base}/bin',
+ 'data' : '{base}',
+ },
+ 'nt': {
+ 'stdlib': '{base}/Lib',
+ 'platstdlib': '{base}/Lib',
+ 'purelib': '{base}/Lib/site-packages',
+ 'platlib': '{base}/Lib/site-packages',
+ 'include': '{base}/Include',
+ 'platinclude': '{base}/Include',
+ 'scripts': '{base}/Scripts',
+ 'data' : '{base}',
+ },
+ 'os2': {
+ 'stdlib': '{base}/Lib',
+ 'platstdlib': '{base}/Lib',
+ 'purelib': '{base}/Lib/site-packages',
+ 'platlib': '{base}/Lib/site-packages',
+ 'include': '{base}/Include',
+ 'platinclude': '{base}/Include',
+ 'scripts': '{base}/Scripts',
+ 'data' : '{base}',
+ },
+ 'os2_home': {
+ 'stdlib': '{userbase}/lib/python{py_version_short}',
+ 'platstdlib': '{userbase}/lib/python{py_version_short}',
+ 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data' : '{userbase}',
+ },
+ 'nt_user': {
+ 'stdlib': '{userbase}/Python{py_version_nodot}',
+ 'platstdlib': '{userbase}/Python{py_version_nodot}',
+ 'purelib': '{userbase}/Python{py_version_nodot}/site-packages',
+ 'platlib': '{userbase}/Python{py_version_nodot}/site-packages',
+ 'include': '{userbase}/Python{py_version_nodot}/Include',
+ 'scripts': '{userbase}/Scripts',
+ 'data' : '{userbase}',
+ },
+ 'posix_user': {
+ 'stdlib': '{userbase}/lib/python{py_version_short}',
+ 'platstdlib': '{userbase}/lib/python{py_version_short}',
+ 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data' : '{userbase}',
+ },
+ 'osx_framework_user': {
+ 'stdlib': '{userbase}/lib/python',
+ 'platstdlib': '{userbase}/lib/python',
+ 'purelib': '{userbase}/lib/python/site-packages',
+ 'platlib': '{userbase}/lib/python/site-packages',
+ 'include': '{userbase}/include',
+ 'scripts': '{userbase}/bin',
+ 'data' : '{userbase}',
+ },
+ }
+
+_SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include',
+ 'scripts', 'data')
+_PY_VERSION = sys.version.split()[0]
+_PY_VERSION_SHORT = sys.version[:3]
+_PY_VERSION_SHORT_NO_DOT = _PY_VERSION[0] + _PY_VERSION[2]
+_PREFIX = os.path.normpath(sys.prefix)
+_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+_CONFIG_VARS = None
+_USER_BASE = None
+
+def _safe_realpath(path):
+ try:
+ return realpath(path)
+ except OSError:
+ return path
+
+if sys.executable:
+ _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
+else:
+ # sys.executable can be empty if argv[0] has been changed and Python is
+ # unable to retrieve the real program name
+ _PROJECT_BASE = _safe_realpath(os.getcwd())
+
+if os.name == "nt" and "pcbuild" in _PROJECT_BASE[-8:].lower():
+ _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir))
+# PC/VS7.1
+if os.name == "nt" and "\\pc\\v" in _PROJECT_BASE[-10:].lower():
+ _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir))
+# PC/AMD64
+if os.name == "nt" and "\\pcbuild\\amd64" in _PROJECT_BASE[-14:].lower():
+ _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir))
+
+def is_python_build():
+ for fn in ("Setup.dist", "Setup.local"):
+ if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)):
+ return True
+ return False
+
+_PYTHON_BUILD = is_python_build()
+
+if _PYTHON_BUILD:
+ for scheme in ('posix_prefix', 'posix_home'):
+ _INSTALL_SCHEMES[scheme]['include'] = '{srcdir}/Include'
+ _INSTALL_SCHEMES[scheme]['platinclude'] = '{projectbase}/.'
+
+def _subst_vars(s, local_vars):
+ try:
+ return s.format(**local_vars)
+ except KeyError:
+ try:
+ return s.format(**os.environ)
+ except KeyError as var:
+ raise AttributeError('{%s}' % var)
+
+def _extend_dict(target_dict, other_dict):
+ target_keys = target_dict.keys()
+ for key, value in other_dict.items():
+ if key in target_keys:
+ continue
+ target_dict[key] = value
+
+def _expand_vars(scheme, vars):
+ res = {}
+ if vars is None:
+ vars = {}
+ _extend_dict(vars, get_config_vars())
+
+ for key, value in _INSTALL_SCHEMES[scheme].items():
+ if os.name in ('posix', 'nt'):
+ value = os.path.expanduser(value)
+ res[key] = os.path.normpath(_subst_vars(value, vars))
+ return res
+
+def _get_default_scheme():
+ if os.name == 'posix':
+ # the default scheme for posix is posix_prefix
+ return 'posix_prefix'
+ return os.name
+
+def _getuserbase():
+ env_base = os.environ.get("PYTHONUSERBASE", None)
+ def joinuser(*args):
+ return os.path.expanduser(os.path.join(*args))
+
+ # what about 'os2emx', 'riscos' ?
+ if os.name == "nt":
+ base = os.environ.get("APPDATA") or "~"
+ return env_base if env_base else joinuser(base, "Python")
+
+ if sys.platform == "darwin":
+ framework = get_config_var("PYTHONFRAMEWORK")
+ if framework:
+ return env_base if env_base else joinuser("~", "Library", framework, "%d.%d"%(
+ sys.version_info[:2]))
+
+ return env_base if env_base else joinuser("~", ".local")
+
+
+def _parse_makefile(filename, vars=None):
+ """Parse a Makefile-style file.
+
+ A dictionary containing name/value pairs is returned. If an
+ optional dictionary is passed in as the second argument, it is
+ used instead of a new dictionary.
+ """
+ import re
+ # Regexes needed for parsing Makefile (and similar syntaxes,
+ # like old-style Setup files).
+ _variable_rx = re.compile("([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)")
+ _findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)")
+ _findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}")
+
+ if vars is None:
+ vars = {}
+ done = {}
+ notdone = {}
+
+ with open(filename, errors="surrogateescape") as f:
+ lines = f.readlines()
+
+ for line in lines:
+ if line.startswith('#') or line.strip() == '':
+ continue
+ m = _variable_rx.match(line)
+ if m:
+ n, v = m.group(1, 2)
+ v = v.strip()
+ # `$$' is a literal `$' in make
+ tmpv = v.replace('$$', '')
+
+ if "$" in tmpv:
+ notdone[n] = v
+ else:
+ try:
+ v = int(v)
+ except ValueError:
+ # insert literal `$'
+ done[n] = v.replace('$$', '$')
+ else:
+ done[n] = v
+
+ # do variable interpolation here
+ variables = list(notdone.keys())
+
+ # Variables with a 'PY_' prefix in the makefile. These need to
+ # be made available without that prefix through sysconfig.
+ # Special care is needed to ensure that variable expansion works, even
+ # if the expansion uses the name without a prefix.
+ renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS')
+
+ while len(variables) > 0:
+ for name in tuple(variables):
+ value = notdone[name]
+ m = _findvar1_rx.search(value) or _findvar2_rx.search(value)
+ if m is not None:
+ n = m.group(1)
+ found = True
+ if n in done:
+ item = str(done[n])
+ elif n in notdone:
+ # get it on a subsequent round
+ found = False
+ elif n in os.environ:
+ # do it like make: fall back to environment
+ item = os.environ[n]
+
+ elif n in renamed_variables:
+ if name.startswith('PY_') and name[3:] in renamed_variables:
+ item = ""
+
+ elif 'PY_' + n in notdone:
+ found = False
+
+ else:
+ item = str(done['PY_' + n])
+
+ else:
+ done[n] = item = ""
+
+ if found:
+ after = value[m.end():]
+ value = value[:m.start()] + item + after
+ if "$" in after:
+ notdone[name] = value
+ else:
+ try:
+ value = int(value)
+ except ValueError:
+ done[name] = value.strip()
+ else:
+ done[name] = value
+ variables.remove(name)
+
+ if name.startswith('PY_') \
+ and name[3:] in renamed_variables:
+
+ name = name[3:]
+ if name not in done:
+ done[name] = value
+
+
+ else:
+ # bogus variable reference; just drop it since we can't deal
+ variables.remove(name)
+
+ # strip spurious spaces
+ for k, v in done.items():
+ if isinstance(v, str):
+ done[k] = v.strip()
+
+ # save the results in the global dictionary
+ vars.update(done)
+ return vars
+
+
+def get_makefile_filename():
+ """Return the path of the Makefile."""
+ if _PYTHON_BUILD:
+ return os.path.join(_PROJECT_BASE, "Makefile")
+ return os.path.join(get_path('stdlib'),
+ 'config-{}{}'.format(_PY_VERSION_SHORT, sys.abiflags),
+ 'Makefile')
+
+
+def _init_posix(vars):
+ """Initialize the module as appropriate for POSIX systems."""
+ # load the installed Makefile:
+ makefile = get_makefile_filename()
+ try:
+ _parse_makefile(makefile, vars)
+ except IOError as e:
+ msg = "invalid Python installation: unable to open %s" % makefile
+ if hasattr(e, "strerror"):
+ msg = msg + " (%s)" % e.strerror
+ raise IOError(msg)
+ # load the installed pyconfig.h:
+ config_h = get_config_h_filename()
+ try:
+ with open(config_h) as f:
+ parse_config_h(f, vars)
+ except IOError as e:
+ msg = "invalid Python installation: unable to open %s" % config_h
+ if hasattr(e, "strerror"):
+ msg = msg + " (%s)" % e.strerror
+ raise IOError(msg)
+ # On MacOSX we need to check the setting of the environment variable
+ # MACOSX_DEPLOYMENT_TARGET: configure bases some choices on it so
+ # it needs to be compatible.
+ # If it isn't set we set it to the configure-time value
+ if sys.platform == 'darwin' and 'MACOSX_DEPLOYMENT_TARGET' in vars:
+ cfg_target = vars['MACOSX_DEPLOYMENT_TARGET']
+ cur_target = os.getenv('MACOSX_DEPLOYMENT_TARGET', '')
+ if cur_target == '':
+ cur_target = cfg_target
+ os.putenv('MACOSX_DEPLOYMENT_TARGET', cfg_target)
+ elif (list(map(int, cfg_target.split('.'))) >
+ list(map(int, cur_target.split('.')))):
+ msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" '
+ 'during configure' % (cur_target, cfg_target))
+ raise IOError(msg)
+ # On AIX, there are wrong paths to the linker scripts in the Makefile
+ # -- these paths are relative to the Python source, but when installed
+ # the scripts are in another directory.
+ if _PYTHON_BUILD:
+ vars['LDSHARED'] = vars['BLDSHARED']
+
+def _init_non_posix(vars):
+ """Initialize the module as appropriate for NT"""
+ # set basic install directories
+ vars['LIBDEST'] = get_path('stdlib')
+ vars['BINLIBDEST'] = get_path('platstdlib')
+ vars['INCLUDEPY'] = get_path('include')
+ vars['SO'] = '.pyd'
+ vars['EXE'] = '.exe'
+ vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
+ vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
+
+#
+# public APIs
+#
+
+
+def parse_config_h(fp, vars=None):
+ """Parse a config.h-style file.
+
+ A dictionary containing name/value pairs is returned. If an
+ optional dictionary is passed in as the second argument, it is
+ used instead of a new dictionary.
+ """
+ import re
+ if vars is None:
+ vars = {}
+ define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
+ undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")
+
+ while True:
+ line = fp.readline()
+ if not line:
+ break
+ m = define_rx.match(line)
+ if m:
+ n, v = m.group(1, 2)
+ try: v = int(v)
+ except ValueError: pass
+ vars[n] = v
+ else:
+ m = undef_rx.match(line)
+ if m:
+ vars[m.group(1)] = 0
+ return vars
+
+def get_config_h_filename():
+ """Return the path of pyconfig.h."""
+ if _PYTHON_BUILD:
+ if os.name == "nt":
+ inc_dir = os.path.join(_PROJECT_BASE, "PC")
+ else:
+ inc_dir = _PROJECT_BASE
+ else:
+ inc_dir = get_path('platinclude')
+ return os.path.join(inc_dir, 'pyconfig.h')
+
+def get_scheme_names():
+ """Return a tuple containing the schemes names."""
+ schemes = list(_INSTALL_SCHEMES.keys())
+ schemes.sort()
+ return tuple(schemes)
+
+def get_path_names():
+ """Return a tuple containing the paths names."""
+ return _SCHEME_KEYS
+
+def get_paths(scheme=_get_default_scheme(), vars=None, expand=True):
+ """Return a mapping containing an install scheme.
+
+ ``scheme`` is the install scheme name. If not provided, it will
+ return the default scheme for the current platform.
+ """
+ if expand:
+ return _expand_vars(scheme, vars)
+ else:
+ return _INSTALL_SCHEMES[scheme]
+
+def get_path(name, scheme=_get_default_scheme(), vars=None, expand=True):
+ """Return a path corresponding to the scheme.
+
+ ``scheme`` is the install scheme name.
+ """
+ return get_paths(scheme, vars, expand)[name]
+
+def get_config_vars(*args):
+ """With no arguments, return a dictionary of all configuration
+ variables relevant for the current platform.
+
+ On Unix, this means every variable defined in Python's installed Makefile;
+ On Windows and Mac OS it's a much smaller set.
+
+ With arguments, return a list of values that result from looking up
+ each argument in the configuration variable dictionary.
+ """
+ import re
+ global _CONFIG_VARS
+ if _CONFIG_VARS is None:
+ _CONFIG_VARS = {}
+ # Normalized versions of prefix and exec_prefix are handy to have;
+ # in fact, these are the standard versions used most places in the
+ # Distutils.
+ _CONFIG_VARS['prefix'] = _PREFIX
+ _CONFIG_VARS['exec_prefix'] = _EXEC_PREFIX
+ _CONFIG_VARS['py_version'] = _PY_VERSION
+ _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT
+ _CONFIG_VARS['py_version_nodot'] = _PY_VERSION[0] + _PY_VERSION[2]
+ _CONFIG_VARS['base'] = _PREFIX
+ _CONFIG_VARS['platbase'] = _EXEC_PREFIX
+ _CONFIG_VARS['projectbase'] = _PROJECT_BASE
+ try:
+ _CONFIG_VARS['abiflags'] = sys.abiflags
+ except AttributeError:
+ # sys.abiflags may not be defined on all platforms.
+ _CONFIG_VARS['abiflags'] = ''
+
+ if os.name in ('nt', 'os2'):
+ _init_non_posix(_CONFIG_VARS)
+ if os.name == 'posix':
+ _init_posix(_CONFIG_VARS)
+ # Setting 'userbase' is done below the call to the
+ # init function to enable using 'get_config_var' in
+ # the init-function.
+ _CONFIG_VARS['userbase'] = _getuserbase()
+
+ if 'srcdir' not in _CONFIG_VARS:
+ _CONFIG_VARS['srcdir'] = _PROJECT_BASE
+ else:
+ _CONFIG_VARS['srcdir'] = _safe_realpath(_CONFIG_VARS['srcdir'])
+
+
+ # Convert srcdir into an absolute path if it appears necessary.
+ # Normally it is relative to the build directory. However, during
+ # testing, for example, we might be running a non-installed python
+ # from a different directory.
+ if _PYTHON_BUILD and os.name == "posix":
+ base = _PROJECT_BASE
+ try:
+ cwd = os.getcwd()
+ except OSError:
+ cwd = None
+ if (not os.path.isabs(_CONFIG_VARS['srcdir']) and
+ base != cwd):
+ # srcdir is relative and we are not in the same directory
+ # as the executable. Assume executable is in the build
+ # directory and make srcdir absolute.
+ srcdir = os.path.join(base, _CONFIG_VARS['srcdir'])
+ _CONFIG_VARS['srcdir'] = os.path.normpath(srcdir)
+
+ if sys.platform == 'darwin':
+ kernel_version = os.uname()[2] # Kernel version (8.4.3)
+ major_version = int(kernel_version.split('.')[0])
+
+ if major_version < 8:
+ # On Mac OS X before 10.4, check if -arch and -isysroot
+ # are in CFLAGS or LDFLAGS and remove them if they are.
+ # This is needed when building extensions on a 10.3 system
+ # using a universal build of python.
+ for key in ('LDFLAGS', 'BASECFLAGS',
+ # a number of derived variables. These need to be
+ # patched up as well.
+ 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
+ flags = _CONFIG_VARS[key]
+ flags = re.sub('-arch\s+\w+\s', ' ', flags)
+ flags = re.sub('-isysroot [^ \t]*', ' ', flags)
+ _CONFIG_VARS[key] = flags
+ else:
+ # Allow the user to override the architecture flags using
+ # an environment variable.
+ # NOTE: This name was introduced by Apple in OSX 10.5 and
+ # is used by several scripting languages distributed with
+ # that OS release.
+ if 'ARCHFLAGS' in os.environ:
+ arch = os.environ['ARCHFLAGS']
+ for key in ('LDFLAGS', 'BASECFLAGS',
+ # a number of derived variables. These need to be
+ # patched up as well.
+ 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
+
+ flags = _CONFIG_VARS[key]
+ flags = re.sub('-arch\s+\w+\s', ' ', flags)
+ flags = flags + ' ' + arch
+ _CONFIG_VARS[key] = flags
+
+ # If we're on OSX 10.5 or later and the user tries to
+ # compiles an extension using an SDK that is not present
+ # on the current machine it is better to not use an SDK
+ # than to fail.
+ #
+ # The major usecase for this is users using a Python.org
+ # binary installer on OSX 10.6: that installer uses
+ # the 10.4u SDK, but that SDK is not installed by default
+ # when you install Xcode.
+ #
+ CFLAGS = _CONFIG_VARS.get('CFLAGS', '')
+ m = re.search('-isysroot\s+(\S+)', CFLAGS)
+ if m is not None:
+ sdk = m.group(1)
+ if not os.path.exists(sdk):
+ for key in ('LDFLAGS', 'BASECFLAGS',
+ # a number of derived variables. These need to be
+ # patched up as well.
+ 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
+
+ flags = _CONFIG_VARS[key]
+ flags = re.sub('-isysroot\s+\S+(\s|$)', ' ', flags)
+ _CONFIG_VARS[key] = flags
+
+ if args:
+ vals = []
+ for name in args:
+ vals.append(_CONFIG_VARS.get(name))
+ return vals
+ else:
+ return _CONFIG_VARS
+
+def get_config_var(name):
+ """Return the value of a single variable using the dictionary returned by
+ 'get_config_vars()'.
+
+ Equivalent to get_config_vars().get(name)
+ """
+ return get_config_vars().get(name)
+
+def get_platform():
+ """Return a string that identifies the current platform.
+
+ This is used mainly to distinguish platform-specific build directories and
+ platform-specific built distributions. Typically includes the OS name
+ and version and the architecture (as supplied by 'os.uname()'),
+ although the exact information included depends on the OS; eg. for IRIX
+ the architecture isn't particularly important (IRIX only runs on SGI
+ hardware), but for Linux the kernel version isn't particularly
+ important.
+
+ Examples of returned values:
+ linux-i586
+ linux-alpha (?)
+ solaris-2.6-sun4u
+ irix-5.3
+ irix64-6.2
+
+ Windows will return one of:
+ win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
+ win-ia64 (64bit Windows on Itanium)
+ win32 (all others - specifically, sys.platform is returned)
+
+ For other non-POSIX platforms, currently just returns 'sys.platform'.
+ """
+ import re
+ if os.name == 'nt':
+ # sniff sys.version for architecture.
+ prefix = " bit ("
+ i = sys.version.find(prefix)
+ if i == -1:
+ return sys.platform
+ j = sys.version.find(")", i)
+ look = sys.version[i+len(prefix):j].lower()
+ if look == 'amd64':
+ return 'win-amd64'
+ if look == 'itanium':
+ return 'win-ia64'
+ return sys.platform
+
+ if os.name != "posix" or not hasattr(os, 'uname'):
+ # XXX what about the architecture? NT is Intel or Alpha,
+ # Mac OS is M68k or PPC, etc.
+ return sys.platform
+
+ # Try to distinguish various flavours of Unix
+ osname, host, release, version, machine = os.uname()
+
+ # Convert the OS name to lowercase, remove '/' characters
+ # (to accommodate BSD/OS), and translate spaces (for "Power Macintosh")
+ osname = osname.lower().replace('/', '')
+ machine = machine.replace(' ', '_')
+ machine = machine.replace('/', '-')
+
+ if osname[:5] == "linux":
+ # At least on Linux/Intel, 'machine' is the processor --
+ # i386, etc.
+ # XXX what about Alpha, SPARC, etc?
+ return "%s-%s" % (osname, machine)
+ elif osname[:5] == "sunos":
+ if release[0] >= "5": # SunOS 5 == Solaris 2
+ osname = "solaris"
+ release = "%d.%s" % (int(release[0]) - 3, release[2:])
+ # fall through to standard osname-release-machine representation
+ elif osname[:4] == "irix": # could be "irix64"!
+ return "%s-%s" % (osname, release)
+ elif osname[:3] == "aix":
+ return "%s-%s.%s" % (osname, version, release)
+ elif osname[:6] == "cygwin":
+ osname = "cygwin"
+ rel_re = re.compile (r'[\d.]+')
+ m = rel_re.match(release)
+ if m:
+ release = m.group()
+ elif osname[:6] == "darwin":
+ #
+ # For our purposes, we'll assume that the system version from
+ # distutils' perspective is what MACOSX_DEPLOYMENT_TARGET is set
+ # to. This makes the compatibility story a bit more sane because the
+ # machine is going to compile and link as if it were
+ # MACOSX_DEPLOYMENT_TARGET.
+ cfgvars = get_config_vars()
+ macver = os.environ.get('MACOSX_DEPLOYMENT_TARGET')
+ if not macver:
+ macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET')
+
+ if 1:
+ # Always calculate the release of the running machine,
+ # needed to determine if we can build fat binaries or not.
+
+ macrelease = macver
+ # Get the system version. Reading this plist is a documented
+ # way to get the system version (see the documentation for
+ # the Gestalt Manager)
+ try:
+ f = open('/System/Library/CoreServices/SystemVersion.plist')
+ except IOError:
+ # We're on a plain darwin box, fall back to the default
+ # behaviour.
+ pass
+ else:
+ try:
+ m = re.search(
+ r'<key>ProductUserVisibleVersion</key>\s*' +
+ r'<string>(.*?)</string>', f.read())
+ if m is not None:
+ macrelease = '.'.join(m.group(1).split('.')[:2])
+ # else: fall back to the default behaviour
+ finally:
+ f.close()
+
+ if not macver:
+ macver = macrelease
+
+ if macver:
+ release = macver
+ osname = "macosx"
+
+ if (macrelease + '.') >= '10.4.' and \
+ '-arch' in get_config_vars().get('CFLAGS', '').strip():
+ # The universal build will build fat binaries, but not on
+ # systems before 10.4
+ #
+ # Try to detect 4-way universal builds, those have machine-type
+ # 'universal' instead of 'fat'.
+
+ machine = 'fat'
+ cflags = get_config_vars().get('CFLAGS')
+
+ archs = re.findall('-arch\s+(\S+)', cflags)
+ archs = tuple(sorted(set(archs)))
+
+ if len(archs) == 1:
+ machine = archs[0]
+ elif archs == ('i386', 'ppc'):
+ machine = 'fat'
+ elif archs == ('i386', 'x86_64'):
+ machine = 'intel'
+ elif archs == ('i386', 'ppc', 'x86_64'):
+ machine = 'fat3'
+ elif archs == ('ppc64', 'x86_64'):
+ machine = 'fat64'
+ elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'):
+ machine = 'universal'
+ else:
+ raise ValueError(
+ "Don't know machine value for archs=%r"%(archs,))
+
+ elif machine == 'i386':
+ # On OSX the machine type returned by uname is always the
+ # 32-bit variant, even if the executable architecture is
+ # the 64-bit variant
+ if sys.maxsize >= 2**32:
+ machine = 'x86_64'
+
+ elif machine in ('PowerPC', 'Power_Macintosh'):
+ # Pick a sane name for the PPC architecture.
+ # See 'i386' case
+ if sys.maxsize >= 2**32:
+ machine = 'ppc64'
+ else:
+ machine = 'ppc'
+
+ return "%s-%s-%s" % (osname, release, machine)
+
+
+def get_python_version():
+ return _PY_VERSION_SHORT
+
+def _print_dict(title, data):
+ for index, (key, value) in enumerate(sorted(data.items())):
+ if index == 0:
+ print('{0}: '.format(title))
+ print('\t{0} = "{1}"'.format(key, value))
+
+def _main():
+ """Display all information sysconfig detains."""
+ print('Platform: "{0}"'.format(get_platform()))
+ print('Python version: "{0}"'.format(get_python_version()))
+ print('Current installation scheme: "{0}"'.format(_get_default_scheme()))
+ print('')
+ _print_dict('Paths', get_paths())
+ print('')
+ _print_dict('Variables', get_config_vars())
+
+if __name__ == '__main__':
+ _main()
diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py
index 3a8cd373be..46f8163e5f 100755
--- a/Lib/tabnanny.py
+++ b/Lib/tabnanny.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""The Tab Nanny despises ambiguous indentation. She knows no mercy.
@@ -93,11 +93,8 @@ def check(file):
check(fullname)
return
- with open(file, 'rb') as f:
- encoding, lines = tokenize.detect_encoding(f.readline)
-
try:
- f = open(file, encoding=encoding)
+ f = tokenize.open(file)
except IOError as msg:
errprint("%r: I/O Error: %s" % (file, msg))
return
@@ -267,7 +264,7 @@ class Whitespace:
return a
def format_witnesses(w):
- firsts = map(lambda tup: str(tup[0]), w)
+ firsts = (str(tup[0]) for tup in w)
prefix = "at tab size"
if len(w) > 1:
prefix = prefix + "s"
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index beb4135724..0f9d1dade1 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
@@ -50,18 +50,20 @@ import struct
import copy
import re
-if sys.platform == 'mac':
- # This module needs work for MacOS9, especially in the area of pathname
- # handling. In many places it is assumed a simple substitution of / by the
- # local os.path.sep is good enough to convert pathnames, but this does not
- # work with the mac rooted:path:name versus :nonrooted:path:name syntax
- raise ImportError("tarfile does not work for platform==mac")
-
try:
import grp, pwd
except ImportError:
grp = pwd = None
+# os.symlink on Windows prior to 6.0 raises NotImplementedError
+symlink_exception = (AttributeError, NotImplementedError)
+try:
+ # WindowsError (1314) will be raised if the caller does not hold the
+ # SeCreateSymbolicLinkPrivilege privilege
+ symlink_exception += (WindowsError,)
+except NameError:
+ pass
+
# from tarfile import *
__all__ = ["TarFile", "TarInfo", "is_tarfile", "TarError"]
@@ -125,6 +127,9 @@ GNU_TYPES = (GNUTYPE_LONGNAME, GNUTYPE_LONGLINK,
PAX_FIELDS = ("path", "linkpath", "size", "mtime",
"uid", "gid", "uname", "gname")
+# Fields from a pax header that are affected by hdrcharset.
+PAX_NAME_FIELDS = {"path", "linkpath", "uname", "gname"}
+
# Fields in a pax header that are numbers, all other fields
# are treated as strings.
PAX_NUMBER_FIELDS = {
@@ -163,9 +168,10 @@ TOEXEC = 0o001 # execute/search by other
#---------------------------------------------------------
# initialization
#---------------------------------------------------------
-ENCODING = sys.getfilesystemencoding()
-if ENCODING is None:
- ENCODING = "ascii"
+if os.name in ("nt", "ce"):
+ ENCODING = "utf-8"
+else:
+ ENCODING = sys.getfilesystemencoding()
#---------------------------------------------------------
# Some useful functions
@@ -194,7 +200,7 @@ def nti(s):
try:
n = int(nts(s, "ascii", "strict") or "0", 8)
except ValueError:
- raise HeaderError("invalid header")
+ raise InvalidHeaderError("invalid header")
else:
n = 0
for i in range(len(s) - 1):
@@ -309,11 +315,6 @@ def filemode(mode):
perm.append("-")
return "".join(perm)
-if os.sep != "/":
- normpath = lambda path: os.path.normpath(path).replace(os.sep, "/")
-else:
- normpath = os.path.normpath
-
class TarError(Exception):
"""Base exception."""
pass
@@ -330,8 +331,23 @@ class StreamError(TarError):
"""Exception for unsupported operations on stream-like TarFiles."""
pass
class HeaderError(TarError):
+ """Base exception for header errors."""
+ pass
+class EmptyHeaderError(HeaderError):
+ """Exception for empty headers."""
+ pass
+class TruncatedHeaderError(HeaderError):
+ """Exception for truncated headers."""
+ pass
+class EOFHeaderError(HeaderError):
+ """Exception for end of file headers."""
+ pass
+class InvalidHeaderError(HeaderError):
"""Exception for invalid headers."""
pass
+class SubsequentHeaderError(HeaderError):
+ """Exception for missing and invalid extended headers."""
+ pass
#---------------------------
# internal stream interface
@@ -394,28 +410,34 @@ class _Stream:
self.pos = 0
self.closed = False
- if comptype == "gz":
- try:
- import zlib
- except ImportError:
- raise CompressionError("zlib module is not available")
- self.zlib = zlib
- self.crc = zlib.crc32(b"")
- if mode == "r":
- self._init_read_gz()
- else:
- self._init_write_gz()
+ try:
+ if comptype == "gz":
+ try:
+ import zlib
+ except ImportError:
+ raise CompressionError("zlib module is not available")
+ self.zlib = zlib
+ self.crc = zlib.crc32(b"")
+ if mode == "r":
+ self._init_read_gz()
+ else:
+ self._init_write_gz()
- if comptype == "bz2":
- try:
- import bz2
- except ImportError:
- raise CompressionError("bz2 module is not available")
- if mode == "r":
- self.dbuf = b""
- self.cmp = bz2.BZ2Decompressor()
- else:
- self.cmp = bz2.BZ2Compressor()
+ if comptype == "bz2":
+ try:
+ import bz2
+ except ImportError:
+ raise CompressionError("bz2 module is not available")
+ if mode == "r":
+ self.dbuf = b""
+ self.cmp = bz2.BZ2Decompressor()
+ else:
+ self.cmp = bz2.BZ2Compressor()
+ except:
+ if not self._extfileobj:
+ self.fileobj.close()
+ self.closed = True
+ raise
def __del__(self):
if hasattr(self, "closed") and not self.closed:
@@ -679,13 +701,29 @@ class _FileInFile(object):
object.
"""
- def __init__(self, fileobj, offset, size, sparse=None):
+ def __init__(self, fileobj, offset, size, blockinfo=None):
self.fileobj = fileobj
self.offset = offset
self.size = size
- self.sparse = sparse
self.position = 0
+ if blockinfo is None:
+ blockinfo = [(0, size)]
+
+ # Construct a map with data and zero blocks.
+ self.map_index = 0
+ self.map = []
+ lastpos = 0
+ realpos = self.offset
+ for offset, size in blockinfo:
+ if offset > lastpos:
+ self.map.append((False, lastpos, offset, None))
+ self.map.append((True, offset, offset + size, realpos))
+ realpos += size
+ lastpos = offset + size
+ if lastpos < self.size:
+ self.map.append((False, lastpos, self.size, None))
+
def seekable(self):
if not hasattr(self.fileobj, "seekable"):
# XXX gzip.GzipFile and bz2.BZ2File
@@ -710,48 +748,25 @@ class _FileInFile(object):
else:
size = min(size, self.size - self.position)
- if self.sparse is None:
- return self.readnormal(size)
- else:
- return self.readsparse(size)
-
- def readnormal(self, size):
- """Read operation for regular files.
- """
- self.fileobj.seek(self.offset + self.position)
- self.position += size
- return self.fileobj.read(size)
-
- def readsparse(self, size):
- """Read operation for sparse files.
- """
- data = b""
+ buf = b""
while size > 0:
- buf = self.readsparsesection(size)
- if not buf:
- break
- size -= len(buf)
- data += buf
- return data
-
- def readsparsesection(self, size):
- """Read a single section of a sparse file.
- """
- section = self.sparse.find(self.position)
-
- if section is None:
- return b""
-
- size = min(size, section.offset + section.size - self.position)
-
- if isinstance(section, _data):
- realpos = section.realpos + self.position - section.offset
- self.fileobj.seek(self.offset + realpos)
- self.position += size
- return self.fileobj.read(size)
- else:
- self.position += size
- return NUL * size
+ while True:
+ data, start, stop, offset = self.map[self.map_index]
+ if start <= self.position < stop:
+ break
+ else:
+ self.map_index += 1
+ if self.map_index == len(self.map):
+ self.map_index = 0
+ length = min(size, stop - self.position)
+ if data:
+ self.fileobj.seek(offset + (self.position - start))
+ buf += self.fileobj.read(length)
+ else:
+ buf += NUL * length
+ size -= length
+ self.position += length
+ return buf
#class _FileInFile
@@ -955,7 +970,7 @@ class TarInfo(object):
"""Return the TarInfo's attributes as a dictionary.
"""
info = {
- "name": normpath(self.name),
+ "name": self.name,
"mode": self.mode & 0o7777,
"uid": self.uid,
"gid": self.gid,
@@ -963,7 +978,7 @@ class TarInfo(object):
"mtime": self.mtime,
"chksum": self.chksum,
"type": self.type,
- "linkname": normpath(self.linkname) if self.linkname else "",
+ "linkname": self.linkname,
"uname": self.uname,
"gname": self.gname,
"devmajor": self.devmajor,
@@ -975,7 +990,7 @@ class TarInfo(object):
return info
- def tobuf(self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="strict"):
+ def tobuf(self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape"):
"""Return a tar header as a string of 512 byte blocks.
"""
info = self.get_info()
@@ -985,7 +1000,7 @@ class TarInfo(object):
elif format == GNU_FORMAT:
return self.create_gnu_header(info, encoding, errors)
elif format == PAX_FORMAT:
- return self.create_pax_header(info)
+ return self.create_pax_header(info, encoding)
else:
raise ValueError("invalid format")
@@ -1016,7 +1031,7 @@ class TarInfo(object):
return buf + self._create_header(info, GNU_FORMAT, encoding, errors)
- def create_pax_header(self, info):
+ def create_pax_header(self, info, encoding):
"""Return the object as a ustar header block. If it cannot be
represented this way, prepend a pax extended header sequence
with supplement information.
@@ -1059,7 +1074,7 @@ class TarInfo(object):
# Create a pax extended header if necessary.
if pax_headers:
- buf = self._create_pax_generic_header(pax_headers, XHDTYPE)
+ buf = self._create_pax_generic_header(pax_headers, XHDTYPE, encoding)
else:
buf = b""
@@ -1069,7 +1084,7 @@ class TarInfo(object):
def create_pax_global_header(cls, pax_headers):
"""Return the object as a pax global header block sequence.
"""
- return cls._create_pax_generic_header(pax_headers, XGLTYPE)
+ return cls._create_pax_generic_header(pax_headers, XGLTYPE, "utf8")
def _posix_split_name(self, name):
"""Split a name longer than 100 chars into a prefix
@@ -1142,15 +1157,35 @@ class TarInfo(object):
cls._create_payload(name)
@classmethod
- def _create_pax_generic_header(cls, pax_headers, type):
- """Return a POSIX.1-2001 extended or global header sequence
+ def _create_pax_generic_header(cls, pax_headers, type, encoding):
+ """Return a POSIX.1-2008 extended or global header sequence
that contains a list of keyword, value pairs. The values
must be strings.
"""
+ # Check if one of the fields contains surrogate characters and thereby
+ # forces hdrcharset=BINARY, see _proc_pax() for more information.
+ binary = False
+ for keyword, value in pax_headers.items():
+ try:
+ value.encode("utf8", "strict")
+ except UnicodeEncodeError:
+ binary = True
+ break
+
records = b""
+ if binary:
+ # Put the hdrcharset field at the beginning of the header.
+ records += b"21 hdrcharset=BINARY\n"
+
for keyword, value in pax_headers.items():
keyword = keyword.encode("utf8")
- value = value.encode("utf8")
+ if binary:
+ # Try to restore the original byte representation of `value'.
+ # Needless to say, that the encoding must match the string.
+ value = value.encode(encoding, "surrogateescape")
+ else:
+ value = value.encode("utf8")
+
l = len(keyword) + len(value) + 3 # ' ' + '=' + '\n'
n = p = 0
while True:
@@ -1176,14 +1211,16 @@ class TarInfo(object):
def frombuf(cls, buf, encoding, errors):
"""Construct a TarInfo object from a 512 byte bytes object.
"""
+ if len(buf) == 0:
+ raise EmptyHeaderError("empty header")
if len(buf) != BLOCKSIZE:
- raise HeaderError("truncated header")
+ raise TruncatedHeaderError("truncated header")
if buf.count(NUL) == BLOCKSIZE:
- raise HeaderError("empty header")
+ raise EOFHeaderError("end of file header")
chksum = nti(buf[148:156])
if chksum not in calc_chksums(buf):
- raise HeaderError("bad checksum")
+ raise InvalidHeaderError("bad checksum")
obj = cls()
obj.name = nts(buf[0:100], encoding, errors)
@@ -1239,8 +1276,6 @@ class TarInfo(object):
tarfile.
"""
buf = tarfile.fileobj.read(BLOCKSIZE)
- if not buf:
- return
obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
obj.offset = tarfile.fileobj.tell() - BLOCKSIZE
return obj._proc_member(tarfile)
@@ -1293,9 +1328,10 @@ class TarInfo(object):
buf = tarfile.fileobj.read(self._block(self.size))
# Fetch the next header and process it.
- next = self.fromtarfile(tarfile)
- if next is None:
- raise HeaderError("missing subsequent header")
+ try:
+ next = self.fromtarfile(tarfile)
+ except HeaderError:
+ raise SubsequentHeaderError("missing or bad subsequent header")
# Patch the TarInfo object from the next header with
# the longname information.
@@ -1324,33 +1360,20 @@ class TarInfo(object):
numbytes = nti(buf[pos + 12:pos + 24])
except ValueError:
break
- structs.append((offset, numbytes))
+ if offset and numbytes:
+ structs.append((offset, numbytes))
pos += 24
isextended = bool(buf[504])
-
- # Transform the sparse structures to something we can use
- # in ExFileObject.
- self.sparse = _ringbuffer()
- lastpos = 0
- realpos = 0
- for offset, numbytes in structs:
- if offset > lastpos:
- self.sparse.append(_hole(lastpos, offset - lastpos))
- self.sparse.append(_data(offset, numbytes, realpos))
- realpos += numbytes
- lastpos = offset + numbytes
- if lastpos < origsize:
- self.sparse.append(_hole(lastpos, origsize - lastpos))
+ self.sparse = structs
self.offset_data = tarfile.fileobj.tell()
tarfile.offset = self.offset_data + self._block(self.size)
self.size = origsize
-
return self
def _proc_pax(self, tarfile):
"""Process an extended or global header as described in
- POSIX.1-2001.
+ POSIX.1-2008.
"""
# Read the header information.
buf = tarfile.fileobj.read(self._block(self.size))
@@ -1363,6 +1386,24 @@ class TarInfo(object):
else:
pax_headers = tarfile.pax_headers.copy()
+ # Check if the pax header contains a hdrcharset field. This tells us
+ # the encoding of the path, linkpath, uname and gname fields. Normally,
+ # these fields are UTF-8 encoded but since POSIX.1-2008 tar
+ # implementations are allowed to store them as raw binary strings if
+ # the translation to UTF-8 fails.
+ match = re.search(br"\d+ hdrcharset=([^\n]+)\n", buf)
+ if match is not None:
+ pax_headers["hdrcharset"] = match.group(1).decode("utf8")
+
+ # For the time being, we don't care about anything other than "BINARY".
+ # The only other value that is currently allowed by the standard is
+ # "ISO-IR 10646 2000 UTF-8" in other words UTF-8.
+ hdrcharset = pax_headers.get("hdrcharset")
+ if hdrcharset == "BINARY":
+ encoding = tarfile.encoding
+ else:
+ encoding = "utf8"
+
# Parse pax header information. A record looks like that:
# "%d %s=%s\n" % (length, keyword, value). length is the size
# of the complete record including the length field itself and
@@ -1378,19 +1419,45 @@ class TarInfo(object):
length = int(length)
value = buf[match.end(2) + 1:match.start(1) + length - 1]
- keyword = keyword.decode("utf8")
- value = value.decode("utf8")
+ # Normally, we could just use "utf8" as the encoding and "strict"
+ # as the error handler, but we better not take the risk. For
+ # example, GNU tar <= 1.23 is known to store filenames it cannot
+ # translate to UTF-8 as raw strings (unfortunately without a
+ # hdrcharset=BINARY header).
+ # We first try the strict standard encoding, and if that fails we
+ # fall back on the user's encoding and error handler.
+ keyword = self._decode_pax_field(keyword, "utf8", "utf8",
+ tarfile.errors)
+ if keyword in PAX_NAME_FIELDS:
+ value = self._decode_pax_field(value, encoding, tarfile.encoding,
+ tarfile.errors)
+ else:
+ value = self._decode_pax_field(value, "utf8", "utf8",
+ tarfile.errors)
pax_headers[keyword] = value
pos += length
# Fetch the next header.
- next = self.fromtarfile(tarfile)
+ try:
+ next = self.fromtarfile(tarfile)
+ except HeaderError:
+ raise SubsequentHeaderError("missing or bad subsequent header")
- if self.type in (XHDTYPE, SOLARIS_XHDTYPE):
- if next is None:
- raise HeaderError("missing subsequent header")
+ # Process GNU sparse information.
+ if "GNU.sparse.map" in pax_headers:
+ # GNU extended sparse format version 0.1.
+ self._proc_gnusparse_01(next, pax_headers)
+ elif "GNU.sparse.size" in pax_headers:
+ # GNU extended sparse format version 0.0.
+ self._proc_gnusparse_00(next, pax_headers, buf)
+
+ elif pax_headers.get("GNU.sparse.major") == "1" and pax_headers.get("GNU.sparse.minor") == "0":
+ # GNU extended sparse format version 1.0.
+ self._proc_gnusparse_10(next, pax_headers, tarfile)
+
+ if self.type in (XHDTYPE, SOLARIS_XHDTYPE):
# Patch the TarInfo object with the extended header info.
next._apply_pax_info(pax_headers, tarfile.encoding, tarfile.errors)
next.offset = self.offset
@@ -1406,27 +1473,70 @@ class TarInfo(object):
return next
+ def _proc_gnusparse_00(self, next, pax_headers, buf):
+ """Process a GNU tar extended sparse header, version 0.0.
+ """
+ offsets = []
+ for match in re.finditer(br"\d+ GNU.sparse.offset=(\d+)\n", buf):
+ offsets.append(int(match.group(1)))
+ numbytes = []
+ for match in re.finditer(br"\d+ GNU.sparse.numbytes=(\d+)\n", buf):
+ numbytes.append(int(match.group(1)))
+ next.sparse = list(zip(offsets, numbytes))
+
+ def _proc_gnusparse_01(self, next, pax_headers):
+ """Process a GNU tar extended sparse header, version 0.1.
+ """
+ sparse = [int(x) for x in pax_headers["GNU.sparse.map"].split(",")]
+ next.sparse = list(zip(sparse[::2], sparse[1::2]))
+
+ def _proc_gnusparse_10(self, next, pax_headers, tarfile):
+ """Process a GNU tar extended sparse header, version 1.0.
+ """
+ fields = None
+ sparse = []
+ buf = tarfile.fileobj.read(BLOCKSIZE)
+ fields, buf = buf.split(b"\n", 1)
+ fields = int(fields)
+ while len(sparse) < fields * 2:
+ if b"\n" not in buf:
+ buf += tarfile.fileobj.read(BLOCKSIZE)
+ number, buf = buf.split(b"\n", 1)
+ sparse.append(int(number))
+ next.offset_data = tarfile.fileobj.tell()
+ next.sparse = list(zip(sparse[::2], sparse[1::2]))
+
def _apply_pax_info(self, pax_headers, encoding, errors):
"""Replace fields with supplemental information from a previous
pax extended or global header.
"""
for keyword, value in pax_headers.items():
- if keyword not in PAX_FIELDS:
- continue
-
- if keyword == "path":
- value = value.rstrip("/")
-
- if keyword in PAX_NUMBER_FIELDS:
- try:
- value = PAX_NUMBER_FIELDS[keyword](value)
- except ValueError:
- value = 0
-
- setattr(self, keyword, value)
+ if keyword == "GNU.sparse.name":
+ setattr(self, "path", value)
+ elif keyword == "GNU.sparse.size":
+ setattr(self, "size", int(value))
+ elif keyword == "GNU.sparse.realsize":
+ setattr(self, "size", int(value))
+ elif keyword in PAX_FIELDS:
+ if keyword in PAX_NUMBER_FIELDS:
+ try:
+ value = PAX_NUMBER_FIELDS[keyword](value)
+ except ValueError:
+ value = 0
+ if keyword == "path":
+ value = value.rstrip("/")
+ setattr(self, keyword, value)
self.pax_headers = pax_headers.copy()
+ def _decode_pax_field(self, value, encoding, fallback_encoding, fallback_errors):
+ """Decode a single field from a pax record.
+ """
+ try:
+ return value.decode(encoding, "strict")
+ except UnicodeDecodeError:
+ return value.decode(fallback_encoding, fallback_errors)
+
def _block(self, count):
"""Round up a byte count by BLOCKSIZE and return it,
e.g. _block(834) => 1024.
@@ -1453,7 +1563,7 @@ class TarInfo(object):
def isfifo(self):
return self.type == FIFOTYPE
def issparse(self):
- return self.type == GNUTYPE_SPARSE
+ return self.sparse is not None
def isdev(self):
return self.type in (CHRTYPE, BLKTYPE, FIFOTYPE)
# class TarInfo
@@ -1470,7 +1580,7 @@ class TarFile(object):
ignore_zeros = False # If true, skips empty or invalid blocks and
# continues processing.
- errorlevel = 0 # If 0, fatal errors only appear in debug
+ errorlevel = 1 # If 0, fatal errors only appear in debug
# messages (if debug >= 0). If > 0, errors
# are passed to the caller as exceptions.
@@ -1486,7 +1596,7 @@ class TarFile(object):
def __init__(self, name=None, mode="r", fileobj=None, format=None,
tarinfo=None, dereference=None, ignore_zeros=None, encoding=None,
- errors=None, pax_headers=None, debug=None, errorlevel=None):
+ errors="surrogateescape", pax_headers=None, debug=None, errorlevel=None):
"""Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
read from an existing archive, 'a' to append data to an existing
file or 'w' to create a new file overwriting an existing one. `mode'
@@ -1527,13 +1637,7 @@ class TarFile(object):
self.ignore_zeros = ignore_zeros
if encoding is not None:
self.encoding = encoding
-
- if errors is not None:
- self.errors = errors
- elif mode == "r":
- self.errors = "replace"
- else:
- self.errors = "strict"
+ self.errors = errors
if pax_headers is not None and self.format == PAX_FORMAT:
self.pax_headers = pax_headers
@@ -1562,12 +1666,16 @@ class TarFile(object):
if self.mode == "a":
# Move to the end of the archive,
# before the first empty block.
- self.firstmember = None
while True:
- if self.next() is None:
- if self.offset > 0:
- self.fileobj.seek(self.fileobj.tell() - BLOCKSIZE)
+ self.fileobj.seek(self.offset)
+ try:
+ tarinfo = self.tarinfo.fromtarfile(self)
+ self.members.append(tarinfo)
+ except EOFHeaderError:
+ self.fileobj.seek(self.offset)
break
+ except HeaderError as e:
+ raise ReadError(str(e))
if self.mode in "aw":
self._loaded = True
@@ -1655,9 +1763,12 @@ class TarFile(object):
if filemode not in "rw":
raise ValueError("mode must be 'r' or 'w'")
- t = cls(name, filemode,
- _Stream(name, filemode, comptype, fileobj, bufsize),
- **kwargs)
+ stream = _Stream(name, filemode, comptype, fileobj, bufsize)
+ try:
+ t = cls(name, filemode, stream, **kwargs)
+ except:
+ stream.close()
+ raise
t._extfileobj = False
return t
@@ -1688,16 +1799,19 @@ class TarFile(object):
except (ImportError, AttributeError):
raise CompressionError("gzip module is not available")
- if fileobj is None:
- fileobj = bltn_open(name, mode + "b")
-
+ extfileobj = fileobj is not None
try:
- t = cls.taropen(name, mode,
- gzip.GzipFile(name, mode, compresslevel, fileobj),
- **kwargs)
+ fileobj = gzip.GzipFile(name, mode + "b", compresslevel, fileobj)
+ t = cls.taropen(name, mode, fileobj, **kwargs)
except IOError:
+ if not extfileobj:
+ fileobj.close()
raise ReadError("not a gzip file")
- t._extfileobj = False
+ except:
+ if not extfileobj:
+ fileobj.close()
+ raise
+ t._extfileobj = extfileobj
return t
@classmethod
@@ -1720,7 +1834,8 @@ class TarFile(object):
try:
t = cls.taropen(name, mode, fileobj, **kwargs)
- except IOError:
+ except (IOError, EOFError):
+ fileobj.close()
raise ReadError("not a bzip2 file")
t._extfileobj = False
return t
@@ -1801,10 +1916,9 @@ class TarFile(object):
# Absolute paths are turned to relative paths.
if arcname is None:
arcname = name
- arcname = normpath(arcname)
drv, arcname = os.path.splitdrive(arcname)
- while arcname[0:1] == "/":
- arcname = arcname[1:]
+ arcname = arcname.replace(os.sep, "/")
+ arcname = arcname.lstrip("/")
# Now, fill the TarInfo object with
# information specific for the file.
@@ -1910,13 +2024,16 @@ class TarFile(object):
print("link to", tarinfo.linkname, end=' ')
print()
- def add(self, name, arcname=None, recursive=True, exclude=None):
+ def add(self, name, arcname=None, recursive=True, exclude=None, *, filter=None):
"""Add the file `name' to the archive. `name' may be any type of file
(directory, fifo, symbolic link, etc.). If given, `arcname'
specifies an alternative name for the file in the archive.
Directories are added recursively by default. This can be avoided by
setting `recursive' to False. `exclude' is a function that should
- return True for each filename to be excluded.
+ return True for each filename to be excluded. `filter' is a function
+ that expects a TarInfo object argument and returns the changed
+ TarInfo object, if it returns None the TarInfo object will be
+ excluded from the archive.
"""
self._check("aw")
@@ -1924,25 +2041,19 @@ class TarFile(object):
arcname = name
# Exclude pathnames.
- if exclude is not None and exclude(name):
- self._dbg(2, "tarfile: Excluded %r" % name)
- return
+ if exclude is not None:
+ import warnings
+ warnings.warn("use the filter argument instead",
+ DeprecationWarning, 2)
+ if exclude(name):
+ self._dbg(2, "tarfile: Excluded %r" % name)
+ return
# Skip if somebody tries to archive the archive...
if self.name is not None and os.path.abspath(name) == self.name:
self._dbg(2, "tarfile: Skipped %r" % name)
return
- # Special case: The user wants to add the current
- # working directory.
- if name == ".":
- if recursive:
- if arcname == ".":
- arcname = ""
- for f in os.listdir(name):
- self.add(f, os.path.join(arcname, f), recursive, exclude)
- return
-
self._dbg(1, name)
# Create a TarInfo object from the file.
@@ -1952,6 +2063,13 @@ class TarFile(object):
self._dbg(1, "tarfile: Unsupported type %r" % name)
return
+ # Change or exclude the TarInfo object.
+ if filter is not None:
+ tarinfo = filter(tarinfo)
+ if tarinfo is None:
+ self._dbg(2, "tarfile: Excluded %r" % name)
+ return
+
# Append the tar header and data to the archive.
if tarinfo.isreg():
f = bltn_open(name, "rb")
@@ -1962,7 +2080,8 @@ class TarFile(object):
self.addfile(tarinfo)
if recursive:
for f in os.listdir(name):
- self.add(os.path.join(name, f), os.path.join(arcname, f), recursive, exclude)
+ self.add(os.path.join(name, f), os.path.join(arcname, f),
+ recursive, exclude, filter=filter)
else:
self.addfile(tarinfo)
@@ -2011,7 +2130,8 @@ class TarFile(object):
directories.append(tarinfo)
tarinfo = copy.copy(tarinfo)
tarinfo.mode = 0o700
- self.extract(tarinfo, path)
+ # Do not set_attrs directories, as we will do that further down
+ self.extract(tarinfo, path, set_attrs=not tarinfo.isdir())
# Reverse sort directories.
directories.sort(key=lambda a: a.name)
@@ -2030,11 +2150,12 @@ class TarFile(object):
else:
self._dbg(1, "tarfile: %s" % e)
- def extract(self, member, path=""):
+ def extract(self, member, path="", set_attrs=True):
"""Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a TarInfo object. You can
- specify a different directory using `path'.
+ specify a different directory using `path'. File attributes (owner,
+ mtime, mode) are set unless `set_attrs' is False.
"""
self._check("r")
@@ -2048,7 +2169,8 @@ class TarFile(object):
tarinfo._link_target = os.path.join(path, tarinfo.linkname)
try:
- self._extract_member(tarinfo, os.path.join(path, tarinfo.name))
+ self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
+ set_attrs=set_attrs)
except EnvironmentError as e:
if self.errorlevel > 0:
raise
@@ -2095,23 +2217,21 @@ class TarFile(object):
raise StreamError("cannot extract (sym)link as file object")
else:
# A (sym)link's file object is its target's file object.
- return self.extractfile(self._getmember(tarinfo.linkname,
- tarinfo))
+ return self.extractfile(self._find_link_target(tarinfo))
else:
# If there's no data associated with the member (directory, chrdev,
# blkdev, etc.), return None instead of a file object.
return None
- def _extract_member(self, tarinfo, targetpath):
+ def _extract_member(self, tarinfo, targetpath, set_attrs=True):
"""Extract the TarInfo object tarinfo to a physical
file called targetpath.
"""
# Fetch the TarInfo object for the given name
# and build the destination pathname, replacing
# forward slashes to platform specific separators.
- if targetpath[-1:] == "/":
- targetpath = targetpath[:-1]
- targetpath = os.path.normpath(targetpath)
+ targetpath = targetpath.rstrip("/")
+ targetpath = targetpath.replace("/", os.sep)
# Create all upper directories.
upperdirs = os.path.dirname(targetpath)
@@ -2140,10 +2260,11 @@ class TarFile(object):
else:
self.makefile(tarinfo, targetpath)
- self.chown(tarinfo, targetpath)
- if not tarinfo.issym():
- self.chmod(tarinfo, targetpath)
- self.utime(tarinfo, targetpath)
+ if set_attrs:
+ self.chown(tarinfo, targetpath)
+ if not tarinfo.issym():
+ self.chmod(tarinfo, targetpath)
+ self.utime(tarinfo, targetpath)
#--------------------------------------------------------------------------
# Below are the different file methods. They are called via
@@ -2164,10 +2285,17 @@ class TarFile(object):
def makefile(self, tarinfo, targetpath):
"""Make a file called targetpath.
"""
- source = self.extractfile(tarinfo)
+ source = self.fileobj
+ source.seek(tarinfo.offset_data)
target = bltn_open(targetpath, "wb")
- copyfileobj(source, target)
- source.close()
+ if tarinfo.sparse is not None:
+ for offset, size in tarinfo.sparse:
+ target.seek(offset)
+ copyfileobj(source, target, size)
+ else:
+ copyfileobj(source, target, tarinfo.size)
+ target.seek(tarinfo.size)
+ target.truncate()
target.close()
def makeunknown(self, tarinfo, targetpath):
@@ -2206,27 +2334,29 @@ class TarFile(object):
(platform limitation), we try to make a copy of the referenced file
instead of a link.
"""
- linkpath = tarinfo.linkname
try:
+ # For systems that support symbolic and hard links.
if tarinfo.issym():
- os.symlink(linkpath, targetpath)
+ os.symlink(tarinfo.linkname, targetpath)
else:
# See extract().
- os.link(tarinfo._link_target, targetpath)
- except AttributeError:
+ if os.path.exists(tarinfo._link_target):
+ os.link(tarinfo._link_target, targetpath)
+ else:
+ self._extract_member(self._find_link_target(tarinfo),
+ targetpath)
+ except symlink_exception:
if tarinfo.issym():
linkpath = os.path.join(os.path.dirname(tarinfo.name),
- linkpath)
- linkpath = normpath(linkpath)
-
+ tarinfo.linkname)
+ else:
+ linkpath = tarinfo.linkname
+ else:
try:
- self._extract_member(self.getmember(linkpath), targetpath)
- except (EnvironmentError, KeyError) as e:
- linkpath = os.path.normpath(linkpath)
- try:
- shutil.copy2(linkpath, targetpath)
- except EnvironmentError as e:
- raise IOError("link could not be created")
+ self._extract_member(self._find_link_target(tarinfo),
+ targetpath)
+ except KeyError:
+ raise ExtractError("unable to resolve link inside archive")
def chown(self, tarinfo, targetpath):
"""Set owner of targetpath according to tarinfo.
@@ -2289,44 +2419,64 @@ class TarFile(object):
# Read the next block.
self.fileobj.seek(self.offset)
+ tarinfo = None
while True:
try:
tarinfo = self.tarinfo.fromtarfile(self)
- if tarinfo is None:
- return
- self.members.append(tarinfo)
-
- except HeaderError as e:
+ except EOFHeaderError as e:
if self.ignore_zeros:
self._dbg(2, "0x%X: %s" % (self.offset, e))
self.offset += BLOCKSIZE
continue
- else:
- if self.offset == 0:
- raise ReadError(str(e))
- return None
+ except InvalidHeaderError as e:
+ if self.ignore_zeros:
+ self._dbg(2, "0x%X: %s" % (self.offset, e))
+ self.offset += BLOCKSIZE
+ continue
+ elif self.offset == 0:
+ raise ReadError(str(e))
+ except EmptyHeaderError:
+ if self.offset == 0:
+ raise ReadError("empty file")
+ except TruncatedHeaderError as e:
+ if self.offset == 0:
+ raise ReadError(str(e))
+ except SubsequentHeaderError as e:
+ raise ReadError(str(e))
break
+ if tarinfo is not None:
+ self.members.append(tarinfo)
+ else:
+ self._loaded = True
+
return tarinfo
#--------------------------------------------------------------------------
# Little helper methods:
- def _getmember(self, name, tarinfo=None):
+ def _getmember(self, name, tarinfo=None, normalize=False):
"""Find an archive member by name from bottom to top.
If tarinfo is given, it is used as the starting point.
"""
# Ensure that all members have been loaded.
members = self.getmembers()
- if tarinfo is None:
- end = len(members)
- else:
- end = members.index(tarinfo)
+ # Limit the member search list up to tarinfo.
+ if tarinfo is not None:
+ members = members[:members.index(tarinfo)]
- for i in range(end - 1, -1, -1):
- if name == members[i].name:
- return members[i]
+ if normalize:
+ name = os.path.normpath(name)
+
+ for member in reversed(members):
+ if normalize:
+ member_name = os.path.normpath(member.name)
+ else:
+ member_name = member.name
+
+ if name == member_name:
+ return member
def _load(self):
"""Read through the entire archive file and look for readable
@@ -2347,6 +2497,25 @@ class TarFile(object):
if mode is not None and self.mode not in mode:
raise IOError("bad operation for mode %r" % self.mode)
+ def _find_link_target(self, tarinfo):
+ """Find the target member of a symlink or hardlink member in the
+ archive.
+ """
+ if tarinfo.issym():
+ # Always search the entire archive.
+ linkname = os.path.dirname(tarinfo.name) + "/" + tarinfo.linkname
+ limit = None
+ else:
+ # Search the archive before the link, because a hard link is
+ # just a reference to an already archived file.
+ linkname = tarinfo.linkname
+ limit = tarinfo
+
+ member = self._getmember(linkname, tarinfo=limit, normalize=True)
+ if member is None:
+ raise KeyError("linkname %r not found" % linkname)
+ return member
+
def __iter__(self):
"""Provide an iterator object.
"""
@@ -2360,6 +2529,20 @@ class TarFile(object):
"""
if level <= self.debug:
print(msg, file=sys.stderr)
+
+ def __enter__(self):
+ self._check()
+ return self
+
+ def __exit__(self, type, value, traceback):
+ if type is None:
+ self.close()
+ else:
+ # An exception occurred. We must not call close() because
+ # it would try to write end-of-archive blocks and padding.
+ if not self._extfileobj:
+ self.fileobj.close()
+ self.closed = True
# class TarFile
class TarIter:
@@ -2398,49 +2581,6 @@ class TarIter:
self.index += 1
return tarinfo
-# Helper classes for sparse file support
-class _section:
- """Base class for _data and _hole.
- """
- def __init__(self, offset, size):
- self.offset = offset
- self.size = size
- def __contains__(self, offset):
- return self.offset <= offset < self.offset + self.size
-
-class _data(_section):
- """Represent a data section in a sparse file.
- """
- def __init__(self, offset, size, realpos):
- _section.__init__(self, offset, size)
- self.realpos = realpos
-
-class _hole(_section):
- """Represent a hole section in a sparse file.
- """
- pass
-
-class _ringbuffer(list):
- """Ringbuffer class which increases performance
- over a regular list.
- """
- def __init__(self):
- self.idx = 0
- def find(self, offset):
- idx = self.idx
- while True:
- item = self[idx]
- if offset in item:
- break
- idx += 1
- if idx == len(self):
- idx = 0
- if idx == self.idx:
- # End of File
- return None
- self.idx = idx
- return item
-
#--------------------
# exported functions
#--------------------
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 049cdaa2c2..b28d91f87e 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -19,7 +19,7 @@ This module also provides some data items to the user:
__all__ = [
"NamedTemporaryFile", "TemporaryFile", # high level safe interfaces
- "SpooledTemporaryFile",
+ "SpooledTemporaryFile", "TemporaryDirectory",
"mkstemp", "mkdtemp", # low level safe interfaces
"mktemp", # deprecated unsafe interface
"TMP_MAX", "gettempprefix", # constants
@@ -29,6 +29,8 @@ __all__ = [
# Imports.
+import warnings as _warnings
+import sys as _sys
import io as _io
import os as _os
import errno as _errno
@@ -108,30 +110,19 @@ class _RandomNameSequence:
_RandomNameSequence is an iterator."""
- characters = ("abcdefghijklmnopqrstuvwxyz" +
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
- "0123456789_")
+ characters = "abcdefghijklmnopqrstuvwxyz0123456789_"
def __init__(self):
- self.mutex = _allocate_lock()
self.rng = _Random()
- self.normcase = _os.path.normcase
def __iter__(self):
return self
def __next__(self):
- m = self.mutex
c = self.characters
choose = self.rng.choice
-
- m.acquire()
- try:
- letters = [choose(c) for dummy in "123456"]
- finally:
- m.release()
-
- return self.normcase(''.join(letters))
+ letters = [choose(c) for dummy in "123456"]
+ return ''.join(letters)
def _candidate_tempdir_list():
"""Generate a list of candidate temporary directories which
@@ -613,3 +604,85 @@ class SpooledTemporaryFile:
def xreadlines(self, *args):
return self._file.xreadlines(*args)
+
+
+class TemporaryDirectory(object):
+ """Create and return a temporary directory. This has the same
+ behavior as mkdtemp but can be used as a context manager. For
+ example:
+
+ with TemporaryDirectory() as tmpdir:
+ ...
+
+ Upon exiting the context, the directory and everthing contained
+ in it are removed.
+ """
+
+ def __init__(self, suffix="", prefix=template, dir=None):
+ self._closed = False
+ self.name = None # Handle mkdtemp throwing an exception
+ self.name = mkdtemp(suffix, prefix, dir)
+
+ def __repr__(self):
+ return "<{} {!r}>".format(self.__class__.__name__, self.name)
+
+ def __enter__(self):
+ return self.name
+
+ def cleanup(self, _warn=False):
+ if self.name and not self._closed:
+ try:
+ self._rmtree(self.name)
+ except (TypeError, AttributeError) as ex:
+ # Issue #10188: Emit a warning on stderr
+ # if the directory could not be cleaned
+ # up due to missing globals
+ if "None" not in str(ex):
+ raise
+ print("ERROR: {!r} while cleaning up {!r}".format(ex, self,),
+ file=_sys.stderr)
+ return
+ self._closed = True
+ if _warn:
+ self._warn("Implicitly cleaning up {!r}".format(self),
+ ResourceWarning)
+
+ def __exit__(self, exc, value, tb):
+ self.cleanup()
+
+ def __del__(self):
+ # Issue a ResourceWarning if implicit cleanup needed
+ self.cleanup(_warn=True)
+
+ # XXX (ncoghlan): The following code attempts to make
+ # this class tolerant of the module nulling out process
+ # that happens during CPython interpreter shutdown
+ # Alas, it doesn't actually manage it. See issue #10188
+ _listdir = staticmethod(_os.listdir)
+ _path_join = staticmethod(_os.path.join)
+ _isdir = staticmethod(_os.path.isdir)
+ _remove = staticmethod(_os.remove)
+ _rmdir = staticmethod(_os.rmdir)
+ _os_error = _os.error
+ _warn = _warnings.warn
+
+ def _rmtree(self, path):
+ # Essentially a stripped down version of shutil.rmtree. We can't
+ # use globals because they may be None'ed out at shutdown.
+ for name in self._listdir(path):
+ fullname = self._path_join(path, name)
+ try:
+ isdir = self._isdir(fullname)
+ except self._os_error:
+ isdir = False
+ if isdir:
+ self._rmtree(fullname)
+ else:
+ try:
+ self._remove(fullname)
+ except self._os_error:
+ pass
+ try:
+ self._rmdir(path)
+ except self._os_error:
+ pass
diff --git a/Lib/test/__main__.py b/Lib/test/__main__.py
new file mode 100644
index 0000000000..ce5615b889
--- /dev/null
+++ b/Lib/test/__main__.py
@@ -0,0 +1,13 @@
+from test import regrtest, support
+
+
+TEMPDIR, TESTCWD = regrtest._make_temp_dir_for_build(regrtest.TEMPDIR)
+regrtest.TEMPDIR = TEMPDIR
+regrtest.TESTCWD = TESTCWD
+
+# Run the tests in a context manager that temporary changes the CWD to a
+# temporary and writable directory. If it's not possible to create or
+# change the CWD, the original CWD will be used. The original CWD is
+# available from support.SAVEDCWD.
+with support.temp_cwd(TESTCWD, quiet=True):
+ regrtest.main()
diff --git a/Lib/test/badsyntax_nocaret.py b/Lib/test/badsyntax_nocaret.py
deleted file mode 100644
index 01ec9ea5f0..0000000000
--- a/Lib/test/badsyntax_nocaret.py
+++ /dev/null
@@ -1,2 +0,0 @@
-def f(x):
- [x for x in x] = x
diff --git a/Lib/test/capath/4e1295a3.0 b/Lib/test/capath/4e1295a3.0
new file mode 100644
index 0000000000..9d7ac238d8
--- /dev/null
+++ b/Lib/test/capath/4e1295a3.0
@@ -0,0 +1,14 @@
+-----BEGIN CERTIFICATE-----
+MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
+VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
+bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
+dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
+DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
+EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
+dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
+EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
+MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
+L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
+BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
+9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
+-----END CERTIFICATE-----
diff --git a/Lib/test/capath/5ed36f99.0 b/Lib/test/capath/5ed36f99.0
new file mode 100644
index 0000000000..e7dfc82947
--- /dev/null
+++ b/Lib/test/capath/5ed36f99.0
@@ -0,0 +1,41 @@
+-----BEGIN CERTIFICATE-----
+MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
+IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
+IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
+Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO
+BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi
+MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ
+ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
+CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ
+8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6
+zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y
+fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7
+w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc
+G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k
+epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q
+laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ
+QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU
+fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826
+YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w
+ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY
+gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe
+MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0
+IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy
+dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw
+czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0
+dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl
+aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC
+AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg
+b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB
+ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc
+nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg
+18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c
+gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl
+Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY
+sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T
+SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF
+CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum
+GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk
+zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
+omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
+-----END CERTIFICATE-----
diff --git a/Lib/test/capath/6e88d7b8.0 b/Lib/test/capath/6e88d7b8.0
new file mode 100644
index 0000000000..9d7ac238d8
--- /dev/null
+++ b/Lib/test/capath/6e88d7b8.0
@@ -0,0 +1,14 @@
+-----BEGIN CERTIFICATE-----
+MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
+VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
+bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
+dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
+DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
+EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
+dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
+EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
+MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
+L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
+BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
+9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
+-----END CERTIFICATE-----
diff --git a/Lib/test/capath/99d0fa06.0 b/Lib/test/capath/99d0fa06.0
new file mode 100644
index 0000000000..e7dfc82947
--- /dev/null
+++ b/Lib/test/capath/99d0fa06.0
@@ -0,0 +1,41 @@
+-----BEGIN CERTIFICATE-----
+MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
+IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
+IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
+Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO
+BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi
+MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ
+ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
+CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ
+8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6
+zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y
+fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7
+w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc
+G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k
+epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q
+laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ
+QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU
+fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826
+YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w
+ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY
+gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe
+MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0
+IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy
+dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw
+czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0
+dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl
+aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC
+AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg
+b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB
+ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc
+nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg
+18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c
+gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl
+Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY
+sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T
+SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF
+CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum
+GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk
+zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
+omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
+-----END CERTIFICATE-----
diff --git a/Lib/test/cfgparser.2 b/Lib/test/cfgparser.2
new file mode 100644
index 0000000000..19a420a9a5
--- /dev/null
+++ b/Lib/test/cfgparser.2
@@ -0,0 +1,537 @@
+# This is the main Samba configuration file. You should read the
+# smb.conf(5) manual page in order to understand the options listed
+# here. Samba has a huge number of configurable options (perhaps too
+# many!) most of which are not shown in this example
+#
+# Any line which starts with a ; (semi-colon) or a # (hash)
+# is a comment and is ignored. In this example we will use a #
+# for commentry and a ; for parts of the config file that you
+# may wish to enable
+#
+# NOTE: Whenever you modify this file you should run the command #"testparm" # to check that you have not made any basic syntactic #errors.
+#
+#======================= Global Settings =====================================
+[global]
+
+# 1. Server Naming Options:
+# workgroup = NT-Domain-Name or Workgroup-Name
+
+ workgroup = MDKGROUP
+
+# netbios name is the name you will see in "Network Neighbourhood",
+# but defaults to your hostname
+
+; netbios name = <name_of_this_server>
+
+# server string is the equivalent of the NT Description field
+
+ server string = Samba Server %v
+
+# Message command is run by samba when a "popup" message is sent to it.
+# The example below is for use with LinPopUp:
+; message command = /usr/bin/linpopup "%f" "%m" %s; rm %s
+
+# 2. Printing Options:
+# CHANGES TO ENABLE PRINTING ON ALL CUPS PRINTERS IN THE NETWORK
+# (as cups is now used in linux-mandrake 7.2 by default)
+# if you want to automatically load your printer list rather
+# than setting them up individually then you'll need this
+
+ printcap name = lpstat
+ load printers = yes
+
+# It should not be necessary to spell out the print system type unless
+# yours is non-standard. Currently supported print systems include:
+# bsd, sysv, plp, lprng, aix, hpux, qnx, cups
+
+ printing = cups
+
+# Samba 2.2 supports the Windows NT-style point-and-print feature. To
+# use this, you need to be able to upload print drivers to the samba
+# server. The printer admins (or root) may install drivers onto samba.
+# Note that this feature uses the print$ share, so you will need to
+# enable it below.
+# This parameter works like domain admin group:
+# printer admin = @<group> <user>
+; printer admin = @adm
+# This should work well for winbind:
+; printer admin = @"Domain Admins"
+
+# 3. Logging Options:
+# this tells Samba to use a separate log file for each machine
+# that connects
+
+ log file = /var/log/samba/log.%m
+
+# Put a capping on the size of the log files (in Kb).
+ max log size = 50
+
+# Set the log (verbosity) level (0 <= log level <= 10)
+; log level = 3
+
+# 4. Security and Domain Membership Options:
+# This option is important for security. It allows you to restrict
+# connections to machines which are on your local network. The
+# following example restricts access to two C class networks and
+# the "loopback" interface. For more examples of the syntax see
+# the smb.conf man page. Do not enable this if (tcp/ip) name resolution #does
+# not work for all the hosts in your network.
+; hosts allow = 192.168.1. 192.168.2. 127.
+
+ hosts allow = 127. //note this is only my private IP address
+
+# Uncomment this if you want a guest account, you must add this to
+# /etc/passwd
+# otherwise the user "nobody" is used
+; guest account = pcguest
+
+# Security mode. Most people will want user level security. See
+# security_level.txt for details.
+
+ security = user
+
+# Use password server option only with security = server or security = # domain
+# When using security = domain, you should use password server = *
+; password server =
+; password server = *
+
+# Password Level allows matching of _n_ characters of the password for
+# all combinations of upper and lower case.
+
+ password level = 8
+
+; username level = 8
+
+# You may wish to use password encryption. Please read
+# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
+# Do not enable this option unless you have read those documents
+# Encrypted passwords are required for any use of samba in a Windows NT #domain
+# The smbpasswd file is only required by a server doing authentication, #thus members of a domain do not need one.
+
+ encrypt passwords = yes
+ smb passwd file = /etc/samba/smbpasswd
+
+# The following are needed to allow password changing from Windows to
+# also update the Linux system password.
+# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
+# NOTE2: You do NOT need these to allow workstations to change only
+# the encrypted SMB passwords. They allow the Unix password
+# to be kept in sync with the SMB password.
+; unix password sync = Yes
+# You either need to setup a passwd program and passwd chat, or
+# enable pam password change
+; pam password change = yes
+; passwd program = /usr/bin/passwd %u
+; passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password*
+# %n\n
+;*passwd:*all*authentication*tokens*updated*successfully*
+
+# Unix users can map to different SMB User names
+; username map = /etc/samba/smbusers
+
+# Using the following line enables you to customise your configuration
+# on a per machine basis. The %m gets replaced with the netbios name
+# of the machine that is connecting
+; include = /etc/samba/smb.conf.%m
+
+# Options for using winbind. Winbind allows you to do all account and
+# authentication from a Windows or samba domain controller, creating
+# accounts on the fly, and maintaining a mapping of Windows RIDs to
+# unix uid's
+# and gid's. winbind uid and winbind gid are the only required
+# parameters.
+#
+# winbind uid is the range of uid's winbind can use when mapping RIDs #to uid's
+; winbind uid = 10000-20000
+#
+# winbind gid is the range of uid's winbind can use when mapping RIDs
+# to gid's
+; winbind gid = 10000-20000
+#
+# winbind separator is the character a user must use between their
+# domain name and username, defaults to "\"
+; winbind separator = +
+#
+# winbind use default domain allows you to have winbind return
+# usernames in the form user instead of DOMAIN+user for the domain
+# listed in the workgroup parameter.
+; winbind use default domain = yes
+#
+# template homedir determines the home directory for winbind users,
+# with %D expanding to their domain name and %U expanding to their
+# username:
+; template homedir = /home/%D/%U
+
+# When using winbind, you may want to have samba create home
+# directories on the fly for authenticated users. Ensure that
+# /etc/pam.d/samba is using 'service=system-auth-winbind' in pam_stack
+# modules, and then enable obedience of pam restrictions below:
+; obey pam restrictions = yes
+
+#
+# template shell determines the shell users authenticated by winbind #get
+; template shell = /bin/bash
+
+# 5. Browser Control and Networking Options:
+# Most people will find that this option gives better performance.
+# See speed.txt and the manual pages for details
+
+ socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
+
+# Configure Samba to use multiple interfaces
+# If you have multiple network interfaces then you must list them
+# here. See the man page for details.
+; interfaces = 192.168.12.2/24 192.168.13.2/24
+
+# Configure remote browse list synchronisation here
+# request announcement to, or browse list sync from:
+# a specific host or from / to a whole subnet (see below)
+; remote browse sync = 192.168.3.25 192.168.5.255
+# Cause this host to announce itself to local subnets here
+; remote announce = 192.168.1.255 192.168.2.44
+
+# set local master to no if you don't want Samba to become a master
+# browser on your network. Otherwise the normal election rules apply
+; local master = no
+
+# OS Level determines the precedence of this server in master browser
+# elections. The default value should be reasonable
+; os level = 33
+
+# Domain Master specifies Samba to be the Domain Master Browser. This
+# allows Samba to collate browse lists between subnets. Don't use this
+# if you already have a Windows NT domain controller doing this job
+; domain master = yes
+
+# Preferred Master causes Samba to force a local browser election on
+# startup and gives it a slightly higher chance of winning the election
+; preferred master = yes
+
+# 6. Domain Control Options:
+# Enable this if you want Samba to be a domain logon server for
+# Windows95 workstations or Primary Domain Controller for WinNT and
+# Win2k
+
+; domain logons = yes
+
+
+# if you enable domain logons then you may want a per-machine or
+# per user logon script
+# run a specific logon batch file per workstation (machine)
+; logon script = %m.bat
+# run a specific logon batch file per username
+; logon script = %U.bat
+
+# Where to store roaming profiles for WinNT and Win2k
+# %L substitutes for this servers netbios name, %U is username
+# You must uncomment the [Profiles] share below
+; logon path = \\%L\Profiles\%U
+
+# Where to store roaming profiles for Win9x. Be careful with this as it
+# also impacts where Win2k finds it's /HOME share
+; logon home = \\%L\%U\.profile
+
+# The add user script is used by a domain member to add local user
+# accounts that have been authenticated by the domain controller, or by
+# the domain controller to add local machine accounts when adding
+# machines to the domain.
+# The script must work from the command line when replacing the macros,
+# or the operation will fail. Check that groups exist if forcing a
+# group.
+# Script for domain controller for adding machines:
+; add user script = /usr/sbin/useradd -d /dev/null -g machines –c
+# 'Machine Account' -s /bin/false -M %u
+# Script for domain controller with LDAP backend for adding machines
+#(please
+# configure in /etc/samba/smbldap_conf.pm first):
+; add user script = /usr/share/samba/scripts/smbldap-useradd.pl -w –d
+# /dev/null -g machines -c 'Machine Account' -s /bin/false %u
+# Script for domain member for adding local accounts for authenticated
+# users:
+; add user script = /usr/sbin/useradd -s /bin/false %u
+
+# Domain groups:
+# domain admin group is a list of unix users or groups who are made
+# members
+# of the Domain Admin group
+; domain admin group = root @wheel
+#
+# domain guest groups is a list of unix users or groups who are made
+# members
+# of the Domain Guests group
+; domain guest group = nobody @guest
+
+# LDAP configuration for Domain Controlling:
+# The account (dn) that samba uses to access the LDAP server
+# This account needs to have write access to the LDAP tree
+# You will need to give samba the password for this dn, by
+# running 'smbpasswd -w mypassword'
+; ldap admin dn = cn=root,dc=mydomain,dc=com
+; ldap ssl = start_tls
+# start_tls should run on 389, but samba defaults incorrectly to 636
+; ldap port = 389
+; ldap suffix = dc=mydomain,dc=com
+; ldap server = ldap.mydomain.com
+
+
+# 7. Name Resolution Options:
+# All NetBIOS names must be resolved to IP Addresses
+# 'Name Resolve Order' allows the named resolution mechanism to be
+# specified the default order is "host lmhosts wins bcast". "host"
+# means use the unix system gethostbyname() function call that will use
+# either /etc/hosts OR DNS or NIS depending on the settings of
+# /etc/host.config, /etc/nsswitch.conf
+# and the /etc/resolv.conf file. "host" therefore is system
+# configuration dependant. This parameter is most often of use to
+# prevent DNS lookups
+# in order to resolve NetBIOS names to IP Addresses. Use with care!
+# The example below excludes use of name resolution for machines that
+# are NOT on the local network segment - OR - are not deliberately to
+# be known via lmhosts or via WINS.
+; name resolve order = wins lmhosts bcast
+
+# Windows Internet Name Serving Support Section:
+# WINS Support - Tells the NMBD component of Samba to enable it's WINS
+# Server
+; wins support = yes
+
+# WINS Server - Tells the NMBD components of Samba to be a WINS Client
+# Note: Samba can be either a WINS Server, or a WINS Client, but
+# NOT both
+; wins server = w.x.y.z
+
+# WINS Proxy - Tells Samba to answer name resolution queries on
+# behalf of a non WINS capable client, for this to work there must be
+# at least one WINS Server on the network. The default is NO.
+; wins proxy = yes
+
+# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS
+# names via DNS nslookups. The built-in default for versions 1.9.17 is
+# yes, this has been changed in version 1.9.18 to no.
+
+ dns proxy = no
+
+# 8. File Naming Options:
+# Case Preservation can be handy - system default is _no_
+# NOTE: These can be set on a per share basis
+; preserve case = no
+; short preserve case = no
+# Default case is normally upper case for all DOS files
+; default case = lower
+# Be very careful with case sensitivity - it can break things!
+; case sensitive = no
+
+# Enabling internationalization:
+# you can match a Windows code page with a UNIX character set.
+# Windows: 437 (US), 737 (GREEK), 850 (Latin1 - Western European),
+# 852 (Eastern Eu.), 861 (Icelandic), 932 (Cyrillic - Russian),
+# 936 (Japanese - Shift-JIS), 936 (Simpl. Chinese), 949 (Korean
+# Hangul),
+# 950 (Trad. Chin.).
+# UNIX: ISO8859-1 (Western European), ISO8859-2 (Eastern Eu.),
+# ISO8859-5 (Russian Cyrillic), KOI8-R (Alt-Russ. Cyril.)
+# This is an example for french users:
+; client code page = 850
+; character set = ISO8859-1
+
+#============================ Share Definitions ==============================
+
+[homes]
+ comment = Home Directories
+ browseable = no
+ writable = yes
+
+# You can enable VFS recycle bin on a per share basis:
+# Uncomment the next 2 lines (make sure you create a
+# .recycle folder in the base of the share and ensure
+# all users will have write access to it. See
+# examples/VFS/recycle/REAME in samba-doc for details
+; vfs object = /usr/lib/samba/vfs/recycle.so
+; vfs options= /etc/samba/recycle.conf
+
+# Un-comment the following and create the netlogon directory for Domain
+# Logons
+; [netlogon]
+; comment = Network Logon Service
+; path = /var/lib/samba/netlogon
+; guest ok = yes
+; writable = no
+
+#Uncomment the following 2 lines if you would like your login scripts
+# to be created dynamically by ntlogon (check that you have it in the
+# correct location (the default of the ntlogon rpm available in
+# contribs)
+
+;root preexec = /usr/bin/ntlogon -u %U -g %G -o %a -d /var/lib/samba/netlogon
+;root postexec = rm -f /var/lib/samba/netlogon/%U.bat
+
+# Un-comment the following to provide a specific roving profile share
+# the default is to use the user's home directory
+;[Profiles]
+; path = /var/lib/samba/profiles
+; browseable = no
+; guest ok = yes
+
+
+# NOTE: If you have a CUPS print system there is no need to
+# specifically define each individual printer.
+# You must configure the samba printers with the appropriate Windows
+# drivers on your Windows clients. On the Samba server no filtering is
+# done. If you wish that the server provides the driver and the clients
+# send PostScript ("Generic PostScript Printer" under Windows), you
+# have to swap the 'print command' line below with the commented one.
+
+[printers]
+ comment = All Printers
+ path = /var/spool/samba
+ browseable = no
+# to allow user 'guest account' to print.
+ guest ok = yes
+ writable = no
+ printable = yes
+ create mode = 0700
+
+# =====================================
+# print command: see above for details.
+# =====================================
+
+ print command = lpr-cups -P %p -o raw %s -r
+# using client side printer drivers.
+; print command = lpr-cups -P %p %s
+# using cups own drivers (use generic PostScript on clients).
+# The following two commands are the samba defaults for printing=cups
+# change them only if you need different options:
+; lpq command = lpq -P %p
+; lprm command = cancel %p-%j
+
+# This share is used for Windows NT-style point-and-print support.
+# To be able to install drivers, you need to be either root, or listed
+# in the printer admin parameter above. Note that you also need write
+# access to the directory and share definition to be able to upload the
+# drivers.
+# For more information on this, please see the Printing Support Section
+# of /usr/share/doc/samba-/docs/Samba-HOWTO-Collection.pdf
+
+[print$]
+ path = /var/lib/samba/printers
+ browseable = yes
+ read only = yes
+ write list = @adm root
+
+# A useful application of samba is to make a PDF-generation service
+# To streamline this, install windows postscript drivers (preferably
+# colour)on the samba server, so that clients can automatically install
+# them.
+
+[pdf-generator]
+ path = /var/tmp
+ guest ok = No
+ printable = Yes
+ comment = PDF Generator (only valid users)
+ #print command = /usr/share/samba/scripts/print-pdf file path win_path recipient IP &
+ print command = /usr/share/samba/scripts/print-pdf %s ~%u \\\\\\\\%L\\\\%u %m %I &
+
+# This one is useful for people to share files
+[tmp]
+ comment = Temporary file space
+ path = /tmp
+ read only = no
+ public = yes
+ echo command = cat %s; rm %s
+
+# A publicly accessible directory, but read only, except for people in
+# the "staff" group
+
+
+
+
+;[public]
+; comment = Public Stuff
+; path = /home/samba/public
+; public = yes
+; writable = no
+; write list = @staff
+# Audited directory through experimental VFS audit.so module:
+# Uncomment next line.
+; vfs object = /usr/lib/samba/vfs/audit.so
+
+# Other examples.
+#
+# A private printer, usable only by Fred. Spool data will be placed in
+# Fred's
+# home directory. Note that fred must have write access to the spool
+# directory,
+# wherever it is.
+;[fredsprn]
+; comment = Fred's Printer
+; valid users = fred
+; path = /homes/fred
+; printer = freds_printer
+; public = no
+; writable = no
+; printable = yes
+
+
+-----------------------------------------------------------
+# A private directory, usable only by Fred. Note that Fred requires
+# write access to the directory.
+
+;[fredsdir]
+
+ [Agustin]
+; comment = Fred's Service
+ comment = Agustin Private Files
+; path = /usr/somewhere/private
+ path = /home/agustin/Documents
+; valid users = fred
+ valid users = agustin
+; public = no
+; writable = yes
+ writable = yes
+; printable = no
+
+
+-----------------------------------------------------------
+
+# a service which has a different directory for each machine that
+# connects this allows you to tailor configurations to incoming
+# machines. You could also use the %u option to tailor it by user name.
+# The %m gets replaced with the machine name that is connecting.
+;[pchome]
+; comment = PC Directories
+; path = /usr/pc/%m
+; public = no
+; writable = yes
+
+
+-----------------------------------------------------------
+# A publicly accessible directory, read/write to all users. Note that
+# all files created in the directory by users will be owned by the
+# default user, so any user with access can delete any other user's
+# files. Obviously this directory must be writable by the default user.
+# Another user could of course be specified, in which case all files
+# would be owned by that user instead.
+
+;[public]
+; path = /usr/somewhere/else/public
+; public = yes
+; only guest = yes
+; writable = yes
+; printable = no
+
+-----------------------------------------------------------
+
+# The following two entries demonstrate how to share a directory so
+# that two users can place files there that will be owned by the
+# specific users. In this setup, the directory should be writable by
+# both users and should have the sticky bit set on it to prevent abuse.
+# Obviously this could be extended to as many users as required.
+
+;[myshare]
+; comment = Mary's and Fred's stuff
+; path = /usr/somewhere/shared
+; valid users = mary fred
+; public = no
+; writable = yes
+; printable = no
+; create mask = 0765
diff --git a/Lib/test/cfgparser.3 b/Lib/test/cfgparser.3
new file mode 100644
index 0000000000..c182cd739c
--- /dev/null
+++ b/Lib/test/cfgparser.3
@@ -0,0 +1,69 @@
+ # INI with as many tricky parts as possible
+ # Most of them could not be used before 3.2
+
+ # This will be parsed with the following options
+ # delimiters = {'='}
+ # comment_prefixes = {'#'}
+ # allow_no_value = True
+
+[DEFAULT]
+go = %(interpolate)s
+
+[strange]
+ values = that are indented # and end with hash comments
+ other = that do continue
+ in # and still have
+ other # comments mixed
+ lines # with the values
+
+
+
+
+
+[corruption]
+ value = that is
+
+
+ actually still here
+
+
+ and holds all these weird newlines
+
+
+ # but not for the lines that are comments
+ nor the indentation
+
+ another value = # empty string
+ yet another # None!
+
+ [yeah, sections can be indented as well]
+ and that does not mean = anything
+ are they subsections = False
+ if you want subsections = use XML
+ lets use some Unicode = 片仮å
+
+ [another one!]
+ even if values are indented like this = seriously
+yes, this still applies to = section "another one!"
+this too = are there people with configurations broken as this?
+ beware, this is going to be a continuation
+ of the value for
+ key "this too"
+ even if it has a = character
+ this is still the continuation
+ your editor probably highlights it wrong
+ but that's life
+# let's set this value so there is no error
+# when getting all items for this section:
+interpolate = anything will do
+
+[no values here]
+# but there's this `go` in DEFAULT
+
+ [tricky interpolation]
+ interpolate = do this
+ lets = %(go)s
+
+ [more interpolation]
+ interpolate = go shopping
+ lets = %(go)s
diff --git a/Lib/test/cmath_testcases.txt b/Lib/test/cmath_testcases.txt
index e159380507..9b0865302e 100644
--- a/Lib/test/cmath_testcases.txt
+++ b/Lib/test/cmath_testcases.txt
@@ -733,10 +733,11 @@ asinh1036 asinh -inf inf -> -inf 0.78539816339744828
---------------------------
-- zeros
-atan0000 atan 0.0 0.0 -> 0.0 0.0
-atan0001 atan 0.0 -0.0 -> 0.0 -0.0
-atan0002 atan -0.0 0.0 -> -0.0 0.0
-atan0003 atan -0.0 -0.0 -> -0.0 -0.0
+-- These are tested in testAtanSign in test_cmath.py
+-- atan0000 atan 0.0 0.0 -> 0.0 0.0
+-- atan0001 atan 0.0 -0.0 -> 0.0 -0.0
+-- atan0002 atan -0.0 0.0 -> -0.0 0.0
+-- atan0003 atan -0.0 -0.0 -> -0.0 -0.0
-- values along both sides of imaginary axis
atan0010 atan 0.0 -9.8813129168249309e-324 -> 0.0 -9.8813129168249309e-324
@@ -896,10 +897,11 @@ atan1040 atan -inf -inf -> -1.5707963267948966 -0.0
---------------------------------------
-- zeros
-atanh0000 atanh 0.0 0.0 -> 0.0 0.0
-atanh0001 atanh 0.0 -0.0 -> 0.0 -0.0
-atanh0002 atanh -0.0 0.0 -> -0.0 0.0
-atanh0003 atanh -0.0 -0.0 -> -0.0 -0.0
+-- These are tested in testAtanhSign in test_cmath.py
+-- atanh0000 atanh 0.0 0.0 -> 0.0 0.0
+-- atanh0001 atanh 0.0 -0.0 -> 0.0 -0.0
+-- atanh0002 atanh -0.0 0.0 -> -0.0 0.0
+-- atanh0003 atanh -0.0 -0.0 -> -0.0 -0.0
-- values along both sides of real axis
atanh0010 atanh -9.8813129168249309e-324 0.0 -> -9.8813129168249309e-324 0.0
@@ -1858,11 +1860,14 @@ sinh1052 sinh -inf inf -> inf nan invalid ignore-real-sign
-- tanh: Hyperbolic Tangent --
------------------------------
--- zeros
-tanh0000 tanh 0.0 0.0 -> 0.0 0.0
-tanh0001 tanh 0.0 -0.0 -> 0.0 -0.0
-tanh0002 tanh -0.0 0.0 -> -0.0 0.0
-tanh0003 tanh -0.0 -0.0 -> -0.0 -0.0
+-- Disabled test: replaced by test_math.testTanhSign()
+-- and test_cmath.testTanhSign()
+
+-- -- zeros
+-- tanh0000 tanh 0.0 0.0 -> 0.0 0.0
+-- tanh0001 tanh 0.0 -0.0 -> 0.0 -0.0
+-- tanh0002 tanh -0.0 0.0 -> -0.0 0.0
+-- tanh0003 tanh -0.0 -0.0 -> -0.0 -0.0
-- random inputs
tanh0004 tanh -21.200500450664993 -1.6970729480342996 -> -1.0 1.9241352344849399e-19
diff --git a/Lib/test/crashers/recursive_call.py b/Lib/test/crashers/recursive_call.py
index 31c8963303..2d160a7de5 100644
--- a/Lib/test/crashers/recursive_call.py
+++ b/Lib/test/crashers/recursive_call.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# No bug report AFAIK, mail on python-dev on 2006-01-10
diff --git a/Lib/test/crashers/underlying_dict.py b/Lib/test/crashers/underlying_dict.py
new file mode 100644
index 0000000000..a4b7993743
--- /dev/null
+++ b/Lib/test/crashers/underlying_dict.py
@@ -0,0 +1,20 @@
+import gc
+
+thingy = object()
+class A(object):
+ def f(self):
+ return 1
+ x = thingy
+
+r = gc.get_referrers(thingy)
+if "__module__" in r[0]:
+ dct = r[0]
+else:
+ dct = r[1]
+
+a = A()
+for i in range(10):
+ a.f()
+dct["f"] = lambda self: 2
+
+print(a.f()) # should print 1
diff --git a/Lib/test/curses_tests.py b/Lib/test/curses_tests.py
index 7dedbbc937..40e832dec2 100644
--- a/Lib/test/curses_tests.py
+++ b/Lib/test/curses_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $
#
diff --git a/Lib/test/data/README b/Lib/test/data/README
new file mode 100644
index 0000000000..8bf8c9b31e
--- /dev/null
+++ b/Lib/test/data/README
@@ -0,0 +1,2 @@
+This empty directory serves as destination for temporary files
+created by some tests.
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
new file mode 100644
index 0000000000..38f3b8f19b
--- /dev/null
+++ b/Lib/test/datetimetester.py
@@ -0,0 +1,3685 @@
+"""Test date/time type.
+
+See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
+"""
+
+import sys
+import pickle
+import unittest
+
+from operator import lt, le, gt, ge, eq, ne, truediv, floordiv, mod
+
+from test import support
+
+import datetime as datetime_module
+from datetime import MINYEAR, MAXYEAR
+from datetime import timedelta
+from datetime import tzinfo
+from datetime import time
+from datetime import timezone
+from datetime import date, datetime
+import time as _time
+
+# Needed by test_datetime
+import _strptime
+#
+
+
+pickle_choices = [(pickle, pickle, proto)
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1)]
+assert len(pickle_choices) == pickle.HIGHEST_PROTOCOL + 1
+
+# An arbitrary collection of objects of non-datetime types, for testing
+# mixed-type comparisons.
+OTHERSTUFF = (10, 34.5, "abc", {}, [], ())
+
+
+# XXX Copied from test_float.
+INF = float("inf")
+NAN = float("nan")
+
+
+#############################################################################
+# module tests
+
+class TestModule(unittest.TestCase):
+
+ def test_constants(self):
+ datetime = datetime_module
+ self.assertEqual(datetime.MINYEAR, 1)
+ self.assertEqual(datetime.MAXYEAR, 9999)
+
+#############################################################################
+# tzinfo tests
+
+class FixedOffset(tzinfo):
+
+ def __init__(self, offset, name, dstoffset=42):
+ if isinstance(offset, int):
+ offset = timedelta(minutes=offset)
+ if isinstance(dstoffset, int):
+ dstoffset = timedelta(minutes=dstoffset)
+ self.__offset = offset
+ self.__name = name
+ self.__dstoffset = dstoffset
+ def __repr__(self):
+ return self.__name.lower()
+ def utcoffset(self, dt):
+ return self.__offset
+ def tzname(self, dt):
+ return self.__name
+ def dst(self, dt):
+ return self.__dstoffset
+
+class PicklableFixedOffset(FixedOffset):
+
+ def __init__(self, offset=None, name=None, dstoffset=None):
+ FixedOffset.__init__(self, offset, name, dstoffset)
+
+class TestTZInfo(unittest.TestCase):
+
+ def test_non_abstractness(self):
+ # In order to allow subclasses to get pickled, the C implementation
+ # wasn't able to get away with having __init__ raise
+ # NotImplementedError.
+ useless = tzinfo()
+ dt = datetime.max
+ self.assertRaises(NotImplementedError, useless.tzname, dt)
+ self.assertRaises(NotImplementedError, useless.utcoffset, dt)
+ self.assertRaises(NotImplementedError, useless.dst, dt)
+
+ def test_subclass_must_override(self):
+ class NotEnough(tzinfo):
+ def __init__(self, offset, name):
+ self.__offset = offset
+ self.__name = name
+ self.assertTrue(issubclass(NotEnough, tzinfo))
+ ne = NotEnough(3, "NotByALongShot")
+ self.assertIsInstance(ne, tzinfo)
+
+ dt = datetime.now()
+ self.assertRaises(NotImplementedError, ne.tzname, dt)
+ self.assertRaises(NotImplementedError, ne.utcoffset, dt)
+ self.assertRaises(NotImplementedError, ne.dst, dt)
+
+ def test_normal(self):
+ fo = FixedOffset(3, "Three")
+ self.assertIsInstance(fo, tzinfo)
+ for dt in datetime.now(), None:
+ self.assertEqual(fo.utcoffset(dt), timedelta(minutes=3))
+ self.assertEqual(fo.tzname(dt), "Three")
+ self.assertEqual(fo.dst(dt), timedelta(minutes=42))
+
+ def test_pickling_base(self):
+ # There's no point to pickling tzinfo objects on their own (they
+ # carry no data), but they need to be picklable anyway else
+ # concrete subclasses can't be pickled.
+ orig = tzinfo.__new__(tzinfo)
+ self.assertTrue(type(orig) is tzinfo)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertTrue(type(derived) is tzinfo)
+
+ def test_pickling_subclass(self):
+ # Make sure we can pickle/unpickle an instance of a subclass.
+ offset = timedelta(minutes=-300)
+ for otype, args in [
+ (PicklableFixedOffset, (offset, 'cookie')),
+ (timezone, (offset,)),
+ (timezone, (offset, "EST"))]:
+ orig = otype(*args)
+ oname = orig.tzname(None)
+ self.assertIsInstance(orig, tzinfo)
+ self.assertIs(type(orig), otype)
+ self.assertEqual(orig.utcoffset(None), offset)
+ self.assertEqual(orig.tzname(None), oname)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertIsInstance(derived, tzinfo)
+ self.assertIs(type(derived), otype)
+ self.assertEqual(derived.utcoffset(None), offset)
+ self.assertEqual(derived.tzname(None), oname)
+
+class TestTimeZone(unittest.TestCase):
+
+ def setUp(self):
+ self.ACDT = timezone(timedelta(hours=9.5), 'ACDT')
+ self.EST = timezone(-timedelta(hours=5), 'EST')
+ self.DT = datetime(2010, 1, 1)
+
+ def test_str(self):
+ for tz in [self.ACDT, self.EST, timezone.utc,
+ timezone.min, timezone.max]:
+ self.assertEqual(str(tz), tz.tzname(None))
+
+ def test_repr(self):
+ datetime = datetime_module
+ for tz in [self.ACDT, self.EST, timezone.utc,
+ timezone.min, timezone.max]:
+ # test round-trip
+ tzrep = repr(tz)
+ self.assertEqual(tz, eval(tzrep))
+
+
+ def test_class_members(self):
+ limit = timedelta(hours=23, minutes=59)
+ self.assertEqual(timezone.utc.utcoffset(None), ZERO)
+ self.assertEqual(timezone.min.utcoffset(None), -limit)
+ self.assertEqual(timezone.max.utcoffset(None), limit)
+
+
+ def test_constructor(self):
+ self.assertIs(timezone.utc, timezone(timedelta(0)))
+ self.assertIsNot(timezone.utc, timezone(timedelta(0), 'UTC'))
+ self.assertEqual(timezone.utc, timezone(timedelta(0), 'UTC'))
+ # invalid offsets
+ for invalid in [timedelta(microseconds=1), timedelta(1, 1),
+ timedelta(seconds=1), timedelta(1), -timedelta(1)]:
+ self.assertRaises(ValueError, timezone, invalid)
+ self.assertRaises(ValueError, timezone, -invalid)
+
+ with self.assertRaises(TypeError): timezone(None)
+ with self.assertRaises(TypeError): timezone(42)
+ with self.assertRaises(TypeError): timezone(ZERO, None)
+ with self.assertRaises(TypeError): timezone(ZERO, 42)
+ with self.assertRaises(TypeError): timezone(ZERO, 'ABC', 'extra')
+
+ def test_inheritance(self):
+ self.assertIsInstance(timezone.utc, tzinfo)
+ self.assertIsInstance(self.EST, tzinfo)
+
+ def test_utcoffset(self):
+ dummy = self.DT
+ for h in [0, 1.5, 12]:
+ offset = h * HOUR
+ self.assertEqual(offset, timezone(offset).utcoffset(dummy))
+ self.assertEqual(-offset, timezone(-offset).utcoffset(dummy))
+
+ with self.assertRaises(TypeError): self.EST.utcoffset('')
+ with self.assertRaises(TypeError): self.EST.utcoffset(5)
+
+
+ def test_dst(self):
+ self.assertIsNone(timezone.utc.dst(self.DT))
+
+ with self.assertRaises(TypeError): self.EST.dst('')
+ with self.assertRaises(TypeError): self.EST.dst(5)
+
+ def test_tzname(self):
+ self.assertEqual('UTC+00:00', timezone(ZERO).tzname(None))
+ self.assertEqual('UTC-05:00', timezone(-5 * HOUR).tzname(None))
+ self.assertEqual('UTC+09:30', timezone(9.5 * HOUR).tzname(None))
+ self.assertEqual('UTC-00:01', timezone(timedelta(minutes=-1)).tzname(None))
+ self.assertEqual('XYZ', timezone(-5 * HOUR, 'XYZ').tzname(None))
+
+ with self.assertRaises(TypeError): self.EST.tzname('')
+ with self.assertRaises(TypeError): self.EST.tzname(5)
+
+ def test_fromutc(self):
+ with self.assertRaises(ValueError):
+ timezone.utc.fromutc(self.DT)
+ with self.assertRaises(TypeError):
+ timezone.utc.fromutc('not datetime')
+ for tz in [self.EST, self.ACDT, Eastern]:
+ utctime = self.DT.replace(tzinfo=tz)
+ local = tz.fromutc(utctime)
+ self.assertEqual(local - utctime, tz.utcoffset(local))
+ self.assertEqual(local,
+ self.DT.replace(tzinfo=timezone.utc))
+
+ def test_comparison(self):
+ self.assertNotEqual(timezone(ZERO), timezone(HOUR))
+ self.assertEqual(timezone(HOUR), timezone(HOUR))
+ self.assertEqual(timezone(-5 * HOUR), timezone(-5 * HOUR, 'EST'))
+ with self.assertRaises(TypeError): timezone(ZERO) < timezone(ZERO)
+ self.assertIn(timezone(ZERO), {timezone(ZERO)})
+
+ def test_aware_datetime(self):
+ # test that timezone instances can be used by datetime
+ t = datetime(1, 1, 1)
+ for tz in [timezone.min, timezone.max, timezone.utc]:
+ self.assertEqual(tz.tzname(t),
+ t.replace(tzinfo=tz).tzname())
+ self.assertEqual(tz.utcoffset(t),
+ t.replace(tzinfo=tz).utcoffset())
+ self.assertEqual(tz.dst(t),
+ t.replace(tzinfo=tz).dst())
+
+#############################################################################
+# Base clase for testing a particular aspect of timedelta, time, date and
+# datetime comparisons.
+
+class HarmlessMixedComparison:
+ # Test that __eq__ and __ne__ don't complain for mixed-type comparisons.
+
+ # Subclasses must define 'theclass', and theclass(1, 1, 1) must be a
+ # legit constructor.
+
+ def test_harmless_mixed_comparison(self):
+ me = self.theclass(1, 1, 1)
+
+ self.assertFalse(me == ())
+ self.assertTrue(me != ())
+ self.assertFalse(() == me)
+ self.assertTrue(() != me)
+
+ self.assertIn(me, [1, 20, [], me])
+ self.assertIn([], [me, 1, 20, []])
+
+ def test_harmful_mixed_comparison(self):
+ me = self.theclass(1, 1, 1)
+
+ self.assertRaises(TypeError, lambda: me < ())
+ self.assertRaises(TypeError, lambda: me <= ())
+ self.assertRaises(TypeError, lambda: me > ())
+ self.assertRaises(TypeError, lambda: me >= ())
+
+ self.assertRaises(TypeError, lambda: () < me)
+ self.assertRaises(TypeError, lambda: () <= me)
+ self.assertRaises(TypeError, lambda: () > me)
+ self.assertRaises(TypeError, lambda: () >= me)
+
+#############################################################################
+# timedelta tests
+
+class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
+
+ theclass = timedelta
+
+ def test_constructor(self):
+ eq = self.assertEqual
+ td = timedelta
+
+ # Check keyword args to constructor
+ eq(td(), td(weeks=0, days=0, hours=0, minutes=0, seconds=0,
+ milliseconds=0, microseconds=0))
+ eq(td(1), td(days=1))
+ eq(td(0, 1), td(seconds=1))
+ eq(td(0, 0, 1), td(microseconds=1))
+ eq(td(weeks=1), td(days=7))
+ eq(td(days=1), td(hours=24))
+ eq(td(hours=1), td(minutes=60))
+ eq(td(minutes=1), td(seconds=60))
+ eq(td(seconds=1), td(milliseconds=1000))
+ eq(td(milliseconds=1), td(microseconds=1000))
+
+ # Check float args to constructor
+ eq(td(weeks=1.0/7), td(days=1))
+ eq(td(days=1.0/24), td(hours=1))
+ eq(td(hours=1.0/60), td(minutes=1))
+ eq(td(minutes=1.0/60), td(seconds=1))
+ eq(td(seconds=0.001), td(milliseconds=1))
+ eq(td(milliseconds=0.001), td(microseconds=1))
+
+ def test_computations(self):
+ eq = self.assertEqual
+ td = timedelta
+
+ a = td(7) # One week
+ b = td(0, 60) # One minute
+ c = td(0, 0, 1000) # One millisecond
+ eq(a+b+c, td(7, 60, 1000))
+ eq(a-b, td(6, 24*3600 - 60))
+ eq(b.__rsub__(a), td(6, 24*3600 - 60))
+ eq(-a, td(-7))
+ eq(+a, td(7))
+ eq(-b, td(-1, 24*3600 - 60))
+ eq(-c, td(-1, 24*3600 - 1, 999000))
+ eq(abs(a), a)
+ eq(abs(-a), a)
+ eq(td(6, 24*3600), a)
+ eq(td(0, 0, 60*1000000), b)
+ eq(a*10, td(70))
+ eq(a*10, 10*a)
+ eq(a*10, 10*a)
+ eq(b*10, td(0, 600))
+ eq(10*b, td(0, 600))
+ eq(b*10, td(0, 600))
+ eq(c*10, td(0, 0, 10000))
+ eq(10*c, td(0, 0, 10000))
+ eq(c*10, td(0, 0, 10000))
+ eq(a*-1, -a)
+ eq(b*-2, -b-b)
+ eq(c*-2, -c+-c)
+ eq(b*(60*24), (b*60)*24)
+ eq(b*(60*24), (60*b)*24)
+ eq(c*1000, td(0, 1))
+ eq(1000*c, td(0, 1))
+ eq(a//7, td(1))
+ eq(b//10, td(0, 6))
+ eq(c//1000, td(0, 0, 1))
+ eq(a//10, td(0, 7*24*360))
+ eq(a//3600000, td(0, 0, 7*24*1000))
+ eq(a/0.5, td(14))
+ eq(b/0.5, td(0, 120))
+ eq(a/7, td(1))
+ eq(b/10, td(0, 6))
+ eq(c/1000, td(0, 0, 1))
+ eq(a/10, td(0, 7*24*360))
+ eq(a/3600000, td(0, 0, 7*24*1000))
+
+ # Multiplication by float
+ us = td(microseconds=1)
+ eq((3*us) * 0.5, 2*us)
+ eq((5*us) * 0.5, 2*us)
+ eq(0.5 * (3*us), 2*us)
+ eq(0.5 * (5*us), 2*us)
+ eq((-3*us) * 0.5, -2*us)
+ eq((-5*us) * 0.5, -2*us)
+
+ # Division by int and float
+ eq((3*us) / 2, 2*us)
+ eq((5*us) / 2, 2*us)
+ eq((-3*us) / 2.0, -2*us)
+ eq((-5*us) / 2.0, -2*us)
+ eq((3*us) / -2, -2*us)
+ eq((5*us) / -2, -2*us)
+ eq((3*us) / -2.0, -2*us)
+ eq((5*us) / -2.0, -2*us)
+ for i in range(-10, 10):
+ eq((i*us/3)//us, round(i/3))
+ for i in range(-10, 10):
+ eq((i*us/-3)//us, round(i/-3))
+
+ # Issue #11576
+ eq(td(999999999, 86399, 999999) - td(999999999, 86399, 999998),
+ td(0, 0, 1))
+ eq(td(999999999, 1, 1) - td(999999999, 1, 0),
+ td(0, 0, 1))
+
+ def test_disallowed_computations(self):
+ a = timedelta(42)
+
+ # Add/sub ints or floats should be illegal
+ for i in 1, 1.0:
+ self.assertRaises(TypeError, lambda: a+i)
+ self.assertRaises(TypeError, lambda: a-i)
+ self.assertRaises(TypeError, lambda: i+a)
+ self.assertRaises(TypeError, lambda: i-a)
+
+ # Division of int by timedelta doesn't make sense.
+ # Division by zero doesn't make sense.
+ zero = 0
+ self.assertRaises(TypeError, lambda: zero // a)
+ self.assertRaises(ZeroDivisionError, lambda: a // zero)
+ self.assertRaises(ZeroDivisionError, lambda: a / zero)
+ self.assertRaises(ZeroDivisionError, lambda: a / 0.0)
+ self.assertRaises(TypeError, lambda: a / '')
+
+ @support.requires_IEEE_754
+ def test_disallowed_special(self):
+ a = timedelta(42)
+ self.assertRaises(ValueError, a.__mul__, NAN)
+ self.assertRaises(ValueError, a.__truediv__, NAN)
+
+ def test_basic_attributes(self):
+ days, seconds, us = 1, 7, 31
+ td = timedelta(days, seconds, us)
+ self.assertEqual(td.days, days)
+ self.assertEqual(td.seconds, seconds)
+ self.assertEqual(td.microseconds, us)
+
+ def test_total_seconds(self):
+ td = timedelta(days=365)
+ self.assertEqual(td.total_seconds(), 31536000.0)
+ for total_seconds in [123456.789012, -123456.789012, 0.123456, 0, 1e6]:
+ td = timedelta(seconds=total_seconds)
+ self.assertEqual(td.total_seconds(), total_seconds)
+ # Issue8644: Test that td.total_seconds() has the same
+ # accuracy as td / timedelta(seconds=1).
+ for ms in [-1, -2, -123]:
+ td = timedelta(microseconds=ms)
+ self.assertEqual(td.total_seconds(), td / timedelta(seconds=1))
+
+ def test_carries(self):
+ t1 = timedelta(days=100,
+ weeks=-7,
+ hours=-24*(100-49),
+ minutes=-3,
+ seconds=12,
+ microseconds=(3*60 - 12) * 1e6 + 1)
+ t2 = timedelta(microseconds=1)
+ self.assertEqual(t1, t2)
+
+ def test_hash_equality(self):
+ t1 = timedelta(days=100,
+ weeks=-7,
+ hours=-24*(100-49),
+ minutes=-3,
+ seconds=12,
+ microseconds=(3*60 - 12) * 1000000)
+ t2 = timedelta()
+ self.assertEqual(hash(t1), hash(t2))
+
+ t1 += timedelta(weeks=7)
+ t2 += timedelta(days=7*7)
+ self.assertEqual(t1, t2)
+ self.assertEqual(hash(t1), hash(t2))
+
+ d = {t1: 1}
+ d[t2] = 2
+ self.assertEqual(len(d), 1)
+ self.assertEqual(d[t1], 2)
+
+ def test_pickling(self):
+ args = 12, 34, 56
+ orig = timedelta(*args)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+
+ def test_compare(self):
+ t1 = timedelta(2, 3, 4)
+ t2 = timedelta(2, 3, 4)
+ self.assertEqual(t1, t2)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t1 >= t2)
+ self.assertTrue(not t1 != t2)
+ self.assertTrue(not t1 < t2)
+ self.assertTrue(not t1 > t2)
+
+ for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
+ t2 = timedelta(*args) # this is larger than t1
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t2 > t1)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t2 >= t1)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 != t1)
+ self.assertTrue(not t1 == t2)
+ self.assertTrue(not t2 == t1)
+ self.assertTrue(not t1 > t2)
+ self.assertTrue(not t2 < t1)
+ self.assertTrue(not t1 >= t2)
+ self.assertTrue(not t2 <= t1)
+
+ for badarg in OTHERSTUFF:
+ self.assertEqual(t1 == badarg, False)
+ self.assertEqual(t1 != badarg, True)
+ self.assertEqual(badarg == t1, False)
+ self.assertEqual(badarg != t1, True)
+
+ self.assertRaises(TypeError, lambda: t1 <= badarg)
+ self.assertRaises(TypeError, lambda: t1 < badarg)
+ self.assertRaises(TypeError, lambda: t1 > badarg)
+ self.assertRaises(TypeError, lambda: t1 >= badarg)
+ self.assertRaises(TypeError, lambda: badarg <= t1)
+ self.assertRaises(TypeError, lambda: badarg < t1)
+ self.assertRaises(TypeError, lambda: badarg > t1)
+ self.assertRaises(TypeError, lambda: badarg >= t1)
+
+ def test_str(self):
+ td = timedelta
+ eq = self.assertEqual
+
+ eq(str(td(1)), "1 day, 0:00:00")
+ eq(str(td(-1)), "-1 day, 0:00:00")
+ eq(str(td(2)), "2 days, 0:00:00")
+ eq(str(td(-2)), "-2 days, 0:00:00")
+
+ eq(str(td(hours=12, minutes=58, seconds=59)), "12:58:59")
+ eq(str(td(hours=2, minutes=3, seconds=4)), "2:03:04")
+ eq(str(td(weeks=-30, hours=23, minutes=12, seconds=34)),
+ "-210 days, 23:12:34")
+
+ eq(str(td(milliseconds=1)), "0:00:00.001000")
+ eq(str(td(microseconds=3)), "0:00:00.000003")
+
+ eq(str(td(days=999999999, hours=23, minutes=59, seconds=59,
+ microseconds=999999)),
+ "999999999 days, 23:59:59.999999")
+
+ def test_repr(self):
+ name = 'datetime.' + self.theclass.__name__
+ self.assertEqual(repr(self.theclass(1)),
+ "%s(1)" % name)
+ self.assertEqual(repr(self.theclass(10, 2)),
+ "%s(10, 2)" % name)
+ self.assertEqual(repr(self.theclass(-10, 2, 400000)),
+ "%s(-10, 2, 400000)" % name)
+
+ def test_roundtrip(self):
+ for td in (timedelta(days=999999999, hours=23, minutes=59,
+ seconds=59, microseconds=999999),
+ timedelta(days=-999999999),
+ timedelta(days=-999999999, seconds=1),
+ timedelta(days=1, seconds=2, microseconds=3)):
+
+ # Verify td -> string -> td identity.
+ s = repr(td)
+ self.assertTrue(s.startswith('datetime.'))
+ s = s[9:]
+ td2 = eval(s)
+ self.assertEqual(td, td2)
+
+ # Verify identity via reconstructing from pieces.
+ td2 = timedelta(td.days, td.seconds, td.microseconds)
+ self.assertEqual(td, td2)
+
+ def test_resolution_info(self):
+ self.assertIsInstance(timedelta.min, timedelta)
+ self.assertIsInstance(timedelta.max, timedelta)
+ self.assertIsInstance(timedelta.resolution, timedelta)
+ self.assertTrue(timedelta.max > timedelta.min)
+ self.assertEqual(timedelta.min, timedelta(-999999999))
+ self.assertEqual(timedelta.max, timedelta(999999999, 24*3600-1, 1e6-1))
+ self.assertEqual(timedelta.resolution, timedelta(0, 0, 1))
+
+ def test_overflow(self):
+ tiny = timedelta.resolution
+
+ td = timedelta.min + tiny
+ td -= tiny # no problem
+ self.assertRaises(OverflowError, td.__sub__, tiny)
+ self.assertRaises(OverflowError, td.__add__, -tiny)
+
+ td = timedelta.max - tiny
+ td += tiny # no problem
+ self.assertRaises(OverflowError, td.__add__, tiny)
+ self.assertRaises(OverflowError, td.__sub__, -tiny)
+
+ self.assertRaises(OverflowError, lambda: -timedelta.max)
+
+ day = timedelta(1)
+ self.assertRaises(OverflowError, day.__mul__, 10**9)
+ self.assertRaises(OverflowError, day.__mul__, 1e9)
+ self.assertRaises(OverflowError, day.__truediv__, 1e-20)
+ self.assertRaises(OverflowError, day.__truediv__, 1e-10)
+ self.assertRaises(OverflowError, day.__truediv__, 9e-10)
+
+ @support.requires_IEEE_754
+ def _test_overflow_special(self):
+ day = timedelta(1)
+ self.assertRaises(OverflowError, day.__mul__, INF)
+ self.assertRaises(OverflowError, day.__mul__, -INF)
+
+ def test_microsecond_rounding(self):
+ td = timedelta
+ eq = self.assertEqual
+
+ # Single-field rounding.
+ eq(td(milliseconds=0.4/1000), td(0)) # rounds to 0
+ eq(td(milliseconds=-0.4/1000), td(0)) # rounds to 0
+ eq(td(milliseconds=0.6/1000), td(microseconds=1))
+ eq(td(milliseconds=-0.6/1000), td(microseconds=-1))
+
+ # Rounding due to contributions from more than one field.
+ us_per_hour = 3600e6
+ us_per_day = us_per_hour * 24
+ eq(td(days=.4/us_per_day), td(0))
+ eq(td(hours=.2/us_per_hour), td(0))
+ eq(td(days=.4/us_per_day, hours=.2/us_per_hour), td(microseconds=1))
+
+ eq(td(days=-.4/us_per_day), td(0))
+ eq(td(hours=-.2/us_per_hour), td(0))
+ eq(td(days=-.4/us_per_day, hours=-.2/us_per_hour), td(microseconds=-1))
+
+ def test_massive_normalization(self):
+ td = timedelta(microseconds=-1)
+ self.assertEqual((td.days, td.seconds, td.microseconds),
+ (-1, 24*3600-1, 999999))
+
+ def test_bool(self):
+ self.assertTrue(timedelta(1))
+ self.assertTrue(timedelta(0, 1))
+ self.assertTrue(timedelta(0, 0, 1))
+ self.assertTrue(timedelta(microseconds=1))
+ self.assertTrue(not timedelta(0))
+
+ def test_subclass_timedelta(self):
+
+ class T(timedelta):
+ @staticmethod
+ def from_td(td):
+ return T(td.days, td.seconds, td.microseconds)
+
+ def as_hours(self):
+ sum = (self.days * 24 +
+ self.seconds / 3600.0 +
+ self.microseconds / 3600e6)
+ return round(sum)
+
+ t1 = T(days=1)
+ self.assertTrue(type(t1) is T)
+ self.assertEqual(t1.as_hours(), 24)
+
+ t2 = T(days=-1, seconds=-3600)
+ self.assertTrue(type(t2) is T)
+ self.assertEqual(t2.as_hours(), -25)
+
+ t3 = t1 + t2
+ self.assertTrue(type(t3) is timedelta)
+ t4 = T.from_td(t3)
+ self.assertTrue(type(t4) is T)
+ self.assertEqual(t3.days, t4.days)
+ self.assertEqual(t3.seconds, t4.seconds)
+ self.assertEqual(t3.microseconds, t4.microseconds)
+ self.assertEqual(str(t3), str(t4))
+ self.assertEqual(t4.as_hours(), -1)
+
+ def test_division(self):
+ t = timedelta(hours=1, minutes=24, seconds=19)
+ second = timedelta(seconds=1)
+ self.assertEqual(t / second, 5059.0)
+ self.assertEqual(t // second, 5059)
+
+ t = timedelta(minutes=2, seconds=30)
+ minute = timedelta(minutes=1)
+ self.assertEqual(t / minute, 2.5)
+ self.assertEqual(t // minute, 2)
+
+ zerotd = timedelta(0)
+ self.assertRaises(ZeroDivisionError, truediv, t, zerotd)
+ self.assertRaises(ZeroDivisionError, floordiv, t, zerotd)
+
+ # self.assertRaises(TypeError, truediv, t, 2)
+ # note: floor division of a timedelta by an integer *is*
+ # currently permitted.
+
+ def test_remainder(self):
+ t = timedelta(minutes=2, seconds=30)
+ minute = timedelta(minutes=1)
+ r = t % minute
+ self.assertEqual(r, timedelta(seconds=30))
+
+ t = timedelta(minutes=-2, seconds=30)
+ r = t % minute
+ self.assertEqual(r, timedelta(seconds=30))
+
+ zerotd = timedelta(0)
+ self.assertRaises(ZeroDivisionError, mod, t, zerotd)
+
+ self.assertRaises(TypeError, mod, t, 10)
+
+ def test_divmod(self):
+ t = timedelta(minutes=2, seconds=30)
+ minute = timedelta(minutes=1)
+ q, r = divmod(t, minute)
+ self.assertEqual(q, 2)
+ self.assertEqual(r, timedelta(seconds=30))
+
+ t = timedelta(minutes=-2, seconds=30)
+ q, r = divmod(t, minute)
+ self.assertEqual(q, -2)
+ self.assertEqual(r, timedelta(seconds=30))
+
+ zerotd = timedelta(0)
+ self.assertRaises(ZeroDivisionError, divmod, t, zerotd)
+
+ self.assertRaises(TypeError, divmod, t, 10)
+
+
+#############################################################################
+# date tests
+
+class TestDateOnly(unittest.TestCase):
+ # Tests here won't pass if also run on datetime objects, so don't
+ # subclass this to test datetimes too.
+
+ def test_delta_non_days_ignored(self):
+ dt = date(2000, 1, 2)
+ delta = timedelta(days=1, hours=2, minutes=3, seconds=4,
+ microseconds=5)
+ days = timedelta(delta.days)
+ self.assertEqual(days, timedelta(1))
+
+ dt2 = dt + delta
+ self.assertEqual(dt2, dt + days)
+
+ dt2 = delta + dt
+ self.assertEqual(dt2, dt + days)
+
+ dt2 = dt - delta
+ self.assertEqual(dt2, dt - days)
+
+ delta = -delta
+ days = timedelta(delta.days)
+ self.assertEqual(days, timedelta(-2))
+
+ dt2 = dt + delta
+ self.assertEqual(dt2, dt + days)
+
+ dt2 = delta + dt
+ self.assertEqual(dt2, dt + days)
+
+ dt2 = dt - delta
+ self.assertEqual(dt2, dt - days)
+
+class SubclassDate(date):
+ sub_var = 1
+
+class TestDate(HarmlessMixedComparison, unittest.TestCase):
+ # Tests here should pass for both dates and datetimes, except for a
+ # few tests that TestDateTime overrides.
+
+ theclass = date
+
+ def test_basic_attributes(self):
+ dt = self.theclass(2002, 3, 1)
+ self.assertEqual(dt.year, 2002)
+ self.assertEqual(dt.month, 3)
+ self.assertEqual(dt.day, 1)
+
+ def test_roundtrip(self):
+ for dt in (self.theclass(1, 2, 3),
+ self.theclass.today()):
+ # Verify dt -> string -> date identity.
+ s = repr(dt)
+ self.assertTrue(s.startswith('datetime.'))
+ s = s[9:]
+ dt2 = eval(s)
+ self.assertEqual(dt, dt2)
+
+ # Verify identity via reconstructing from pieces.
+ dt2 = self.theclass(dt.year, dt.month, dt.day)
+ self.assertEqual(dt, dt2)
+
+ def test_ordinal_conversions(self):
+ # Check some fixed values.
+ for y, m, d, n in [(1, 1, 1, 1), # calendar origin
+ (1, 12, 31, 365),
+ (2, 1, 1, 366),
+ # first example from "Calendrical Calculations"
+ (1945, 11, 12, 710347)]:
+ d = self.theclass(y, m, d)
+ self.assertEqual(n, d.toordinal())
+ fromord = self.theclass.fromordinal(n)
+ self.assertEqual(d, fromord)
+ if hasattr(fromord, "hour"):
+ # if we're checking something fancier than a date, verify
+ # the extra fields have been zeroed out
+ self.assertEqual(fromord.hour, 0)
+ self.assertEqual(fromord.minute, 0)
+ self.assertEqual(fromord.second, 0)
+ self.assertEqual(fromord.microsecond, 0)
+
+ # Check first and last days of year spottily across the whole
+ # range of years supported.
+ for year in range(MINYEAR, MAXYEAR+1, 7):
+ # Verify (year, 1, 1) -> ordinal -> y, m, d is identity.
+ d = self.theclass(year, 1, 1)
+ n = d.toordinal()
+ d2 = self.theclass.fromordinal(n)
+ self.assertEqual(d, d2)
+ # Verify that moving back a day gets to the end of year-1.
+ if year > 1:
+ d = self.theclass.fromordinal(n-1)
+ d2 = self.theclass(year-1, 12, 31)
+ self.assertEqual(d, d2)
+ self.assertEqual(d2.toordinal(), n-1)
+
+ # Test every day in a leap-year and a non-leap year.
+ dim = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+ for year, isleap in (2000, True), (2002, False):
+ n = self.theclass(year, 1, 1).toordinal()
+ for month, maxday in zip(range(1, 13), dim):
+ if month == 2 and isleap:
+ maxday += 1
+ for day in range(1, maxday+1):
+ d = self.theclass(year, month, day)
+ self.assertEqual(d.toordinal(), n)
+ self.assertEqual(d, self.theclass.fromordinal(n))
+ n += 1
+
+ def test_extreme_ordinals(self):
+ a = self.theclass.min
+ a = self.theclass(a.year, a.month, a.day) # get rid of time parts
+ aord = a.toordinal()
+ b = a.fromordinal(aord)
+ self.assertEqual(a, b)
+
+ self.assertRaises(ValueError, lambda: a.fromordinal(aord - 1))
+
+ b = a + timedelta(days=1)
+ self.assertEqual(b.toordinal(), aord + 1)
+ self.assertEqual(b, self.theclass.fromordinal(aord + 1))
+
+ a = self.theclass.max
+ a = self.theclass(a.year, a.month, a.day) # get rid of time parts
+ aord = a.toordinal()
+ b = a.fromordinal(aord)
+ self.assertEqual(a, b)
+
+ self.assertRaises(ValueError, lambda: a.fromordinal(aord + 1))
+
+ b = a - timedelta(days=1)
+ self.assertEqual(b.toordinal(), aord - 1)
+ self.assertEqual(b, self.theclass.fromordinal(aord - 1))
+
+ def test_bad_constructor_arguments(self):
+ # bad years
+ self.theclass(MINYEAR, 1, 1) # no exception
+ self.theclass(MAXYEAR, 1, 1) # no exception
+ self.assertRaises(ValueError, self.theclass, MINYEAR-1, 1, 1)
+ self.assertRaises(ValueError, self.theclass, MAXYEAR+1, 1, 1)
+ # bad months
+ self.theclass(2000, 1, 1) # no exception
+ self.theclass(2000, 12, 1) # no exception
+ self.assertRaises(ValueError, self.theclass, 2000, 0, 1)
+ self.assertRaises(ValueError, self.theclass, 2000, 13, 1)
+ # bad days
+ self.theclass(2000, 2, 29) # no exception
+ self.theclass(2004, 2, 29) # no exception
+ self.theclass(2400, 2, 29) # no exception
+ self.assertRaises(ValueError, self.theclass, 2000, 2, 30)
+ self.assertRaises(ValueError, self.theclass, 2001, 2, 29)
+ self.assertRaises(ValueError, self.theclass, 2100, 2, 29)
+ self.assertRaises(ValueError, self.theclass, 1900, 2, 29)
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 0)
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 32)
+
+ def test_hash_equality(self):
+ d = self.theclass(2000, 12, 31)
+ # same thing
+ e = self.theclass(2000, 12, 31)
+ self.assertEqual(d, e)
+ self.assertEqual(hash(d), hash(e))
+
+ dic = {d: 1}
+ dic[e] = 2
+ self.assertEqual(len(dic), 1)
+ self.assertEqual(dic[d], 2)
+ self.assertEqual(dic[e], 2)
+
+ d = self.theclass(2001, 1, 1)
+ # same thing
+ e = self.theclass(2001, 1, 1)
+ self.assertEqual(d, e)
+ self.assertEqual(hash(d), hash(e))
+
+ dic = {d: 1}
+ dic[e] = 2
+ self.assertEqual(len(dic), 1)
+ self.assertEqual(dic[d], 2)
+ self.assertEqual(dic[e], 2)
+
+ def test_computations(self):
+ a = self.theclass(2002, 1, 31)
+ b = self.theclass(1956, 1, 31)
+ c = self.theclass(2001,2,1)
+
+ diff = a-b
+ self.assertEqual(diff.days, 46*365 + len(range(1956, 2002, 4)))
+ self.assertEqual(diff.seconds, 0)
+ self.assertEqual(diff.microseconds, 0)
+
+ day = timedelta(1)
+ week = timedelta(7)
+ a = self.theclass(2002, 3, 2)
+ self.assertEqual(a + day, self.theclass(2002, 3, 3))
+ self.assertEqual(day + a, self.theclass(2002, 3, 3))
+ self.assertEqual(a - day, self.theclass(2002, 3, 1))
+ self.assertEqual(-day + a, self.theclass(2002, 3, 1))
+ self.assertEqual(a + week, self.theclass(2002, 3, 9))
+ self.assertEqual(a - week, self.theclass(2002, 2, 23))
+ self.assertEqual(a + 52*week, self.theclass(2003, 3, 1))
+ self.assertEqual(a - 52*week, self.theclass(2001, 3, 3))
+ self.assertEqual((a + week) - a, week)
+ self.assertEqual((a + day) - a, day)
+ self.assertEqual((a - week) - a, -week)
+ self.assertEqual((a - day) - a, -day)
+ self.assertEqual(a - (a + week), -week)
+ self.assertEqual(a - (a + day), -day)
+ self.assertEqual(a - (a - week), week)
+ self.assertEqual(a - (a - day), day)
+ self.assertEqual(c - (c - day), day)
+
+ # Add/sub ints or floats should be illegal
+ for i in 1, 1.0:
+ self.assertRaises(TypeError, lambda: a+i)
+ self.assertRaises(TypeError, lambda: a-i)
+ self.assertRaises(TypeError, lambda: i+a)
+ self.assertRaises(TypeError, lambda: i-a)
+
+ # delta - date is senseless.
+ self.assertRaises(TypeError, lambda: day - a)
+ # mixing date and (delta or date) via * or // is senseless
+ self.assertRaises(TypeError, lambda: day * a)
+ self.assertRaises(TypeError, lambda: a * day)
+ self.assertRaises(TypeError, lambda: day // a)
+ self.assertRaises(TypeError, lambda: a // day)
+ self.assertRaises(TypeError, lambda: a * a)
+ self.assertRaises(TypeError, lambda: a // a)
+ # date + date is senseless
+ self.assertRaises(TypeError, lambda: a + a)
+
+ def test_overflow(self):
+ tiny = self.theclass.resolution
+
+ for delta in [tiny, timedelta(1), timedelta(2)]:
+ dt = self.theclass.min + delta
+ dt -= delta # no problem
+ self.assertRaises(OverflowError, dt.__sub__, delta)
+ self.assertRaises(OverflowError, dt.__add__, -delta)
+
+ dt = self.theclass.max - delta
+ dt += delta # no problem
+ self.assertRaises(OverflowError, dt.__add__, delta)
+ self.assertRaises(OverflowError, dt.__sub__, -delta)
+
+ def test_fromtimestamp(self):
+ import time
+
+ # Try an arbitrary fixed value.
+ year, month, day = 1999, 9, 19
+ ts = time.mktime((year, month, day, 0, 0, 0, 0, 0, -1))
+ d = self.theclass.fromtimestamp(ts)
+ self.assertEqual(d.year, year)
+ self.assertEqual(d.month, month)
+ self.assertEqual(d.day, day)
+
+ def test_insane_fromtimestamp(self):
+ # It's possible that some platform maps time_t to double,
+ # and that this test will fail there. This test should
+ # exempt such platforms (provided they return reasonable
+ # results!).
+ for insane in -1e200, 1e200:
+ self.assertRaises(ValueError, self.theclass.fromtimestamp,
+ insane)
+
+ def test_today(self):
+ import time
+
+ # We claim that today() is like fromtimestamp(time.time()), so
+ # prove it.
+ for dummy in range(3):
+ today = self.theclass.today()
+ ts = time.time()
+ todayagain = self.theclass.fromtimestamp(ts)
+ if today == todayagain:
+ break
+ # There are several legit reasons that could fail:
+ # 1. It recently became midnight, between the today() and the
+ # time() calls.
+ # 2. The platform time() has such fine resolution that we'll
+ # never get the same value twice.
+ # 3. The platform time() has poor resolution, and we just
+ # happened to call today() right before a resolution quantum
+ # boundary.
+ # 4. The system clock got fiddled between calls.
+ # In any case, wait a little while and try again.
+ time.sleep(0.1)
+
+ # It worked or it didn't. If it didn't, assume it's reason #2, and
+ # let the test pass if they're within half a second of each other.
+ self.assertTrue(today == todayagain or
+ abs(todayagain - today) < timedelta(seconds=0.5))
+
+ def test_weekday(self):
+ for i in range(7):
+ # March 4, 2002 is a Monday
+ self.assertEqual(self.theclass(2002, 3, 4+i).weekday(), i)
+ self.assertEqual(self.theclass(2002, 3, 4+i).isoweekday(), i+1)
+ # January 2, 1956 is a Monday
+ self.assertEqual(self.theclass(1956, 1, 2+i).weekday(), i)
+ self.assertEqual(self.theclass(1956, 1, 2+i).isoweekday(), i+1)
+
+ def test_isocalendar(self):
+ # Check examples from
+ # http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
+ for i in range(7):
+ d = self.theclass(2003, 12, 22+i)
+ self.assertEqual(d.isocalendar(), (2003, 52, i+1))
+ d = self.theclass(2003, 12, 29) + timedelta(i)
+ self.assertEqual(d.isocalendar(), (2004, 1, i+1))
+ d = self.theclass(2004, 1, 5+i)
+ self.assertEqual(d.isocalendar(), (2004, 2, i+1))
+ d = self.theclass(2009, 12, 21+i)
+ self.assertEqual(d.isocalendar(), (2009, 52, i+1))
+ d = self.theclass(2009, 12, 28) + timedelta(i)
+ self.assertEqual(d.isocalendar(), (2009, 53, i+1))
+ d = self.theclass(2010, 1, 4+i)
+ self.assertEqual(d.isocalendar(), (2010, 1, i+1))
+
+ def test_iso_long_years(self):
+ # Calculate long ISO years and compare to table from
+ # http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
+ ISO_LONG_YEARS_TABLE = """
+ 4 32 60 88
+ 9 37 65 93
+ 15 43 71 99
+ 20 48 76
+ 26 54 82
+
+ 105 133 161 189
+ 111 139 167 195
+ 116 144 172
+ 122 150 178
+ 128 156 184
+
+ 201 229 257 285
+ 207 235 263 291
+ 212 240 268 296
+ 218 246 274
+ 224 252 280
+
+ 303 331 359 387
+ 308 336 364 392
+ 314 342 370 398
+ 320 348 376
+ 325 353 381
+ """
+ iso_long_years = sorted(map(int, ISO_LONG_YEARS_TABLE.split()))
+ L = []
+ for i in range(400):
+ d = self.theclass(2000+i, 12, 31)
+ d1 = self.theclass(1600+i, 12, 31)
+ self.assertEqual(d.isocalendar()[1:], d1.isocalendar()[1:])
+ if d.isocalendar()[1] == 53:
+ L.append(i)
+ self.assertEqual(L, iso_long_years)
+
+ def test_isoformat(self):
+ t = self.theclass(2, 3, 2)
+ self.assertEqual(t.isoformat(), "0002-03-02")
+
+ def test_ctime(self):
+ t = self.theclass(2002, 3, 2)
+ self.assertEqual(t.ctime(), "Sat Mar 2 00:00:00 2002")
+
+ def test_strftime(self):
+ t = self.theclass(2005, 3, 2)
+ self.assertEqual(t.strftime("m:%m d:%d y:%y"), "m:03 d:02 y:05")
+ self.assertEqual(t.strftime(""), "") # SF bug #761337
+ self.assertEqual(t.strftime('x'*1000), 'x'*1000) # SF bug #1556784
+
+ self.assertRaises(TypeError, t.strftime) # needs an arg
+ self.assertRaises(TypeError, t.strftime, "one", "two") # too many args
+ self.assertRaises(TypeError, t.strftime, 42) # arg wrong type
+
+ # test that unicode input is allowed (issue 2782)
+ self.assertEqual(t.strftime("%m"), "03")
+
+ # A naive object replaces %z and %Z w/ empty strings.
+ self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
+
+ #make sure that invalid format specifiers are handled correctly
+ #self.assertRaises(ValueError, t.strftime, "%e")
+ #self.assertRaises(ValueError, t.strftime, "%")
+ #self.assertRaises(ValueError, t.strftime, "%#")
+
+ #oh well, some systems just ignore those invalid ones.
+ #at least, excercise them to make sure that no crashes
+ #are generated
+ for f in ["%e", "%", "%#"]:
+ try:
+ t.strftime(f)
+ except ValueError:
+ pass
+
+ #check that this standard extension works
+ t.strftime("%f")
+
+
+ def test_format(self):
+ dt = self.theclass(2007, 9, 10)
+ self.assertEqual(dt.__format__(''), str(dt))
+
+ # check that a derived class's __str__() gets called
+ class A(self.theclass):
+ def __str__(self):
+ return 'A'
+ a = A(2007, 9, 10)
+ self.assertEqual(a.__format__(''), 'A')
+
+ # check that a derived class's strftime gets called
+ class B(self.theclass):
+ def strftime(self, format_spec):
+ return 'B'
+ b = B(2007, 9, 10)
+ self.assertEqual(b.__format__(''), str(dt))
+
+ for fmt in ["m:%m d:%d y:%y",
+ "m:%m d:%d y:%y H:%H M:%M S:%S",
+ "%z %Z",
+ ]:
+ self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
+ self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
+ self.assertEqual(b.__format__(fmt), 'B')
+
+ def test_resolution_info(self):
+ # XXX: Should min and max respect subclassing?
+ if issubclass(self.theclass, datetime):
+ expected_class = datetime
+ else:
+ expected_class = date
+ self.assertIsInstance(self.theclass.min, expected_class)
+ self.assertIsInstance(self.theclass.max, expected_class)
+ self.assertIsInstance(self.theclass.resolution, timedelta)
+ self.assertTrue(self.theclass.max > self.theclass.min)
+
+ def test_extreme_timedelta(self):
+ big = self.theclass.max - self.theclass.min
+ # 3652058 days, 23 hours, 59 minutes, 59 seconds, 999999 microseconds
+ n = (big.days*24*3600 + big.seconds)*1000000 + big.microseconds
+ # n == 315537897599999999 ~= 2**58.13
+ justasbig = timedelta(0, 0, n)
+ self.assertEqual(big, justasbig)
+ self.assertEqual(self.theclass.min + big, self.theclass.max)
+ self.assertEqual(self.theclass.max - big, self.theclass.min)
+
+ def test_timetuple(self):
+ for i in range(7):
+ # January 2, 1956 is a Monday (0)
+ d = self.theclass(1956, 1, 2+i)
+ t = d.timetuple()
+ self.assertEqual(t, (1956, 1, 2+i, 0, 0, 0, i, 2+i, -1))
+ # February 1, 1956 is a Wednesday (2)
+ d = self.theclass(1956, 2, 1+i)
+ t = d.timetuple()
+ self.assertEqual(t, (1956, 2, 1+i, 0, 0, 0, (2+i)%7, 32+i, -1))
+ # March 1, 1956 is a Thursday (3), and is the 31+29+1 = 61st day
+ # of the year.
+ d = self.theclass(1956, 3, 1+i)
+ t = d.timetuple()
+ self.assertEqual(t, (1956, 3, 1+i, 0, 0, 0, (3+i)%7, 61+i, -1))
+ self.assertEqual(t.tm_year, 1956)
+ self.assertEqual(t.tm_mon, 3)
+ self.assertEqual(t.tm_mday, 1+i)
+ self.assertEqual(t.tm_hour, 0)
+ self.assertEqual(t.tm_min, 0)
+ self.assertEqual(t.tm_sec, 0)
+ self.assertEqual(t.tm_wday, (3+i)%7)
+ self.assertEqual(t.tm_yday, 61+i)
+ self.assertEqual(t.tm_isdst, -1)
+
+ def test_pickling(self):
+ args = 6, 7, 23
+ orig = self.theclass(*args)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+
+ def test_compare(self):
+ t1 = self.theclass(2, 3, 4)
+ t2 = self.theclass(2, 3, 4)
+ self.assertEqual(t1, t2)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t1 >= t2)
+ self.assertTrue(not t1 != t2)
+ self.assertTrue(not t1 < t2)
+ self.assertTrue(not t1 > t2)
+
+ for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
+ t2 = self.theclass(*args) # this is larger than t1
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t2 > t1)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t2 >= t1)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 != t1)
+ self.assertTrue(not t1 == t2)
+ self.assertTrue(not t2 == t1)
+ self.assertTrue(not t1 > t2)
+ self.assertTrue(not t2 < t1)
+ self.assertTrue(not t1 >= t2)
+ self.assertTrue(not t2 <= t1)
+
+ for badarg in OTHERSTUFF:
+ self.assertEqual(t1 == badarg, False)
+ self.assertEqual(t1 != badarg, True)
+ self.assertEqual(badarg == t1, False)
+ self.assertEqual(badarg != t1, True)
+
+ self.assertRaises(TypeError, lambda: t1 < badarg)
+ self.assertRaises(TypeError, lambda: t1 > badarg)
+ self.assertRaises(TypeError, lambda: t1 >= badarg)
+ self.assertRaises(TypeError, lambda: badarg <= t1)
+ self.assertRaises(TypeError, lambda: badarg < t1)
+ self.assertRaises(TypeError, lambda: badarg > t1)
+ self.assertRaises(TypeError, lambda: badarg >= t1)
+
+ def test_mixed_compare(self):
+ our = self.theclass(2000, 4, 5)
+
+ # Our class can be compared for equality to other classes
+ self.assertEqual(our == 1, False)
+ self.assertEqual(1 == our, False)
+ self.assertEqual(our != 1, True)
+ self.assertEqual(1 != our, True)
+
+ # But the ordering is undefined
+ self.assertRaises(TypeError, lambda: our < 1)
+ self.assertRaises(TypeError, lambda: 1 < our)
+
+ # Repeat those tests with a different class
+
+ class SomeClass:
+ pass
+
+ their = SomeClass()
+ self.assertEqual(our == their, False)
+ self.assertEqual(their == our, False)
+ self.assertEqual(our != their, True)
+ self.assertEqual(their != our, True)
+ self.assertRaises(TypeError, lambda: our < their)
+ self.assertRaises(TypeError, lambda: their < our)
+
+ # However, if the other class explicitly defines ordering
+ # relative to our class, it is allowed to do so
+
+ class LargerThanAnything:
+ def __lt__(self, other):
+ return False
+ def __le__(self, other):
+ return isinstance(other, LargerThanAnything)
+ def __eq__(self, other):
+ return isinstance(other, LargerThanAnything)
+ def __ne__(self, other):
+ return not isinstance(other, LargerThanAnything)
+ def __gt__(self, other):
+ return not isinstance(other, LargerThanAnything)
+ def __ge__(self, other):
+ return True
+
+ their = LargerThanAnything()
+ self.assertEqual(our == their, False)
+ self.assertEqual(their == our, False)
+ self.assertEqual(our != their, True)
+ self.assertEqual(their != our, True)
+ self.assertEqual(our < their, True)
+ self.assertEqual(their < our, False)
+
+ def test_bool(self):
+ # All dates are considered true.
+ self.assertTrue(self.theclass.min)
+ self.assertTrue(self.theclass.max)
+
+ def test_strftime_out_of_range(self):
+ # For nasty technical reasons, we can't handle years before 1000.
+ cls = self.theclass
+ self.assertEqual(cls(1000, 1, 1).strftime("%Y"), "1000")
+ for y in 1, 49, 51, 99, 100, 999:
+ self.assertRaises(ValueError, cls(y, 1, 1).strftime, "%Y")
+
+ def test_replace(self):
+ cls = self.theclass
+ args = [1, 2, 3]
+ base = cls(*args)
+ self.assertEqual(base, base.replace())
+
+ i = 0
+ for name, newval in (("year", 2),
+ ("month", 3),
+ ("day", 4)):
+ newargs = args[:]
+ newargs[i] = newval
+ expected = cls(*newargs)
+ got = base.replace(**{name: newval})
+ self.assertEqual(expected, got)
+ i += 1
+
+ # Out of bounds.
+ base = cls(2000, 2, 29)
+ self.assertRaises(ValueError, base.replace, year=2001)
+
+ def test_subclass_date(self):
+
+ class C(self.theclass):
+ theAnswer = 42
+
+ def __new__(cls, *args, **kws):
+ temp = kws.copy()
+ extra = temp.pop('extra')
+ result = self.theclass.__new__(cls, *args, **temp)
+ result.extra = extra
+ return result
+
+ def newmeth(self, start):
+ return start + self.year + self.month
+
+ args = 2003, 4, 14
+
+ dt1 = self.theclass(*args)
+ dt2 = C(*args, **{'extra': 7})
+
+ self.assertEqual(dt2.__class__, C)
+ self.assertEqual(dt2.theAnswer, 42)
+ self.assertEqual(dt2.extra, 7)
+ self.assertEqual(dt1.toordinal(), dt2.toordinal())
+ self.assertEqual(dt2.newmeth(-7), dt1.year + dt1.month - 7)
+
+ def test_pickling_subclass_date(self):
+
+ args = 6, 7, 23
+ orig = SubclassDate(*args)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+
+ def test_backdoor_resistance(self):
+ # For fast unpickling, the constructor accepts a pickle byte string.
+ # This is a low-overhead backdoor. A user can (by intent or
+ # mistake) pass a string directly, which (if it's the right length)
+ # will get treated like a pickle, and bypass the normal sanity
+ # checks in the constructor. This can create insane objects.
+ # The constructor doesn't want to burn the time to validate all
+ # fields, but does check the month field. This stops, e.g.,
+ # datetime.datetime('1995-03-25') from yielding an insane object.
+ base = b'1995-03-25'
+ if not issubclass(self.theclass, datetime):
+ base = base[:4]
+ for month_byte in b'9', b'\0', b'\r', b'\xff':
+ self.assertRaises(TypeError, self.theclass,
+ base[:2] + month_byte + base[3:])
+ # Good bytes, but bad tzinfo:
+ self.assertRaises(TypeError, self.theclass,
+ bytes([1] * len(base)), 'EST')
+
+ for ord_byte in range(1, 13):
+ # This shouldn't blow up because of the month byte alone. If
+ # the implementation changes to do more-careful checking, it may
+ # blow up because other fields are insane.
+ self.theclass(base[:2] + bytes([ord_byte]) + base[3:])
+
+#############################################################################
+# datetime tests
+
+class SubclassDatetime(datetime):
+ sub_var = 1
+
+class TestDateTime(TestDate):
+
+ theclass = datetime
+
+ def test_basic_attributes(self):
+ dt = self.theclass(2002, 3, 1, 12, 0)
+ self.assertEqual(dt.year, 2002)
+ self.assertEqual(dt.month, 3)
+ self.assertEqual(dt.day, 1)
+ self.assertEqual(dt.hour, 12)
+ self.assertEqual(dt.minute, 0)
+ self.assertEqual(dt.second, 0)
+ self.assertEqual(dt.microsecond, 0)
+
+ def test_basic_attributes_nonzero(self):
+ # Make sure all attributes are non-zero so bugs in
+ # bit-shifting access show up.
+ dt = self.theclass(2002, 3, 1, 12, 59, 59, 8000)
+ self.assertEqual(dt.year, 2002)
+ self.assertEqual(dt.month, 3)
+ self.assertEqual(dt.day, 1)
+ self.assertEqual(dt.hour, 12)
+ self.assertEqual(dt.minute, 59)
+ self.assertEqual(dt.second, 59)
+ self.assertEqual(dt.microsecond, 8000)
+
+ def test_roundtrip(self):
+ for dt in (self.theclass(1, 2, 3, 4, 5, 6, 7),
+ self.theclass.now()):
+ # Verify dt -> string -> datetime identity.
+ s = repr(dt)
+ self.assertTrue(s.startswith('datetime.'))
+ s = s[9:]
+ dt2 = eval(s)
+ self.assertEqual(dt, dt2)
+
+ # Verify identity via reconstructing from pieces.
+ dt2 = self.theclass(dt.year, dt.month, dt.day,
+ dt.hour, dt.minute, dt.second,
+ dt.microsecond)
+ self.assertEqual(dt, dt2)
+
+ def test_isoformat(self):
+ t = self.theclass(2, 3, 2, 4, 5, 1, 123)
+ self.assertEqual(t.isoformat(), "0002-03-02T04:05:01.000123")
+ self.assertEqual(t.isoformat('T'), "0002-03-02T04:05:01.000123")
+ self.assertEqual(t.isoformat(' '), "0002-03-02 04:05:01.000123")
+ self.assertEqual(t.isoformat('\x00'), "0002-03-02\x0004:05:01.000123")
+ # str is ISO format with the separator forced to a blank.
+ self.assertEqual(str(t), "0002-03-02 04:05:01.000123")
+
+ t = self.theclass(2, 3, 2)
+ self.assertEqual(t.isoformat(), "0002-03-02T00:00:00")
+ self.assertEqual(t.isoformat('T'), "0002-03-02T00:00:00")
+ self.assertEqual(t.isoformat(' '), "0002-03-02 00:00:00")
+ # str is ISO format with the separator forced to a blank.
+ self.assertEqual(str(t), "0002-03-02 00:00:00")
+
+ def test_format(self):
+ dt = self.theclass(2007, 9, 10, 4, 5, 1, 123)
+ self.assertEqual(dt.__format__(''), str(dt))
+
+ # check that a derived class's __str__() gets called
+ class A(self.theclass):
+ def __str__(self):
+ return 'A'
+ a = A(2007, 9, 10, 4, 5, 1, 123)
+ self.assertEqual(a.__format__(''), 'A')
+
+ # check that a derived class's strftime gets called
+ class B(self.theclass):
+ def strftime(self, format_spec):
+ return 'B'
+ b = B(2007, 9, 10, 4, 5, 1, 123)
+ self.assertEqual(b.__format__(''), str(dt))
+
+ for fmt in ["m:%m d:%d y:%y",
+ "m:%m d:%d y:%y H:%H M:%M S:%S",
+ "%z %Z",
+ ]:
+ self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
+ self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
+ self.assertEqual(b.__format__(fmt), 'B')
+
+ def test_more_ctime(self):
+ # Test fields that TestDate doesn't touch.
+ import time
+
+ t = self.theclass(2002, 3, 2, 18, 3, 5, 123)
+ self.assertEqual(t.ctime(), "Sat Mar 2 18:03:05 2002")
+ # Oops! The next line fails on Win2K under MSVC 6, so it's commented
+ # out. The difference is that t.ctime() produces " 2" for the day,
+ # but platform ctime() produces "02" for the day. According to
+ # C99, t.ctime() is correct here.
+ # self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
+
+ # So test a case where that difference doesn't matter.
+ t = self.theclass(2002, 3, 22, 18, 3, 5, 123)
+ self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
+
+ def test_tz_independent_comparing(self):
+ dt1 = self.theclass(2002, 3, 1, 9, 0, 0)
+ dt2 = self.theclass(2002, 3, 1, 10, 0, 0)
+ dt3 = self.theclass(2002, 3, 1, 9, 0, 0)
+ self.assertEqual(dt1, dt3)
+ self.assertTrue(dt2 > dt3)
+
+ # Make sure comparison doesn't forget microseconds, and isn't done
+ # via comparing a float timestamp (an IEEE double doesn't have enough
+ # precision to span microsecond resolution across years 1 thru 9999,
+ # so comparing via timestamp necessarily calls some distinct values
+ # equal).
+ dt1 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999998)
+ us = timedelta(microseconds=1)
+ dt2 = dt1 + us
+ self.assertEqual(dt2 - dt1, us)
+ self.assertTrue(dt1 < dt2)
+
+ def test_strftime_with_bad_tzname_replace(self):
+ # verify ok if tzinfo.tzname().replace() returns a non-string
+ class MyTzInfo(FixedOffset):
+ def tzname(self, dt):
+ class MyStr(str):
+ def replace(self, *args):
+ return None
+ return MyStr('name')
+ t = self.theclass(2005, 3, 2, 0, 0, 0, 0, MyTzInfo(3, 'name'))
+ self.assertRaises(TypeError, t.strftime, '%Z')
+
+ def test_bad_constructor_arguments(self):
+ # bad years
+ self.theclass(MINYEAR, 1, 1) # no exception
+ self.theclass(MAXYEAR, 1, 1) # no exception
+ self.assertRaises(ValueError, self.theclass, MINYEAR-1, 1, 1)
+ self.assertRaises(ValueError, self.theclass, MAXYEAR+1, 1, 1)
+ # bad months
+ self.theclass(2000, 1, 1) # no exception
+ self.theclass(2000, 12, 1) # no exception
+ self.assertRaises(ValueError, self.theclass, 2000, 0, 1)
+ self.assertRaises(ValueError, self.theclass, 2000, 13, 1)
+ # bad days
+ self.theclass(2000, 2, 29) # no exception
+ self.theclass(2004, 2, 29) # no exception
+ self.theclass(2400, 2, 29) # no exception
+ self.assertRaises(ValueError, self.theclass, 2000, 2, 30)
+ self.assertRaises(ValueError, self.theclass, 2001, 2, 29)
+ self.assertRaises(ValueError, self.theclass, 2100, 2, 29)
+ self.assertRaises(ValueError, self.theclass, 1900, 2, 29)
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 0)
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 32)
+ # bad hours
+ self.theclass(2000, 1, 31, 0) # no exception
+ self.theclass(2000, 1, 31, 23) # no exception
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 31, -1)
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 24)
+ # bad minutes
+ self.theclass(2000, 1, 31, 23, 0) # no exception
+ self.theclass(2000, 1, 31, 23, 59) # no exception
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, -1)
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 60)
+ # bad seconds
+ self.theclass(2000, 1, 31, 23, 59, 0) # no exception
+ self.theclass(2000, 1, 31, 23, 59, 59) # no exception
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 59, -1)
+ self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 59, 60)
+ # bad microseconds
+ self.theclass(2000, 1, 31, 23, 59, 59, 0) # no exception
+ self.theclass(2000, 1, 31, 23, 59, 59, 999999) # no exception
+ self.assertRaises(ValueError, self.theclass,
+ 2000, 1, 31, 23, 59, 59, -1)
+ self.assertRaises(ValueError, self.theclass,
+ 2000, 1, 31, 23, 59, 59,
+ 1000000)
+
+ def test_hash_equality(self):
+ d = self.theclass(2000, 12, 31, 23, 30, 17)
+ e = self.theclass(2000, 12, 31, 23, 30, 17)
+ self.assertEqual(d, e)
+ self.assertEqual(hash(d), hash(e))
+
+ dic = {d: 1}
+ dic[e] = 2
+ self.assertEqual(len(dic), 1)
+ self.assertEqual(dic[d], 2)
+ self.assertEqual(dic[e], 2)
+
+ d = self.theclass(2001, 1, 1, 0, 5, 17)
+ e = self.theclass(2001, 1, 1, 0, 5, 17)
+ self.assertEqual(d, e)
+ self.assertEqual(hash(d), hash(e))
+
+ dic = {d: 1}
+ dic[e] = 2
+ self.assertEqual(len(dic), 1)
+ self.assertEqual(dic[d], 2)
+ self.assertEqual(dic[e], 2)
+
+ def test_computations(self):
+ a = self.theclass(2002, 1, 31)
+ b = self.theclass(1956, 1, 31)
+ diff = a-b
+ self.assertEqual(diff.days, 46*365 + len(range(1956, 2002, 4)))
+ self.assertEqual(diff.seconds, 0)
+ self.assertEqual(diff.microseconds, 0)
+ a = self.theclass(2002, 3, 2, 17, 6)
+ millisec = timedelta(0, 0, 1000)
+ hour = timedelta(0, 3600)
+ day = timedelta(1)
+ week = timedelta(7)
+ self.assertEqual(a + hour, self.theclass(2002, 3, 2, 18, 6))
+ self.assertEqual(hour + a, self.theclass(2002, 3, 2, 18, 6))
+ self.assertEqual(a + 10*hour, self.theclass(2002, 3, 3, 3, 6))
+ self.assertEqual(a - hour, self.theclass(2002, 3, 2, 16, 6))
+ self.assertEqual(-hour + a, self.theclass(2002, 3, 2, 16, 6))
+ self.assertEqual(a - hour, a + -hour)
+ self.assertEqual(a - 20*hour, self.theclass(2002, 3, 1, 21, 6))
+ self.assertEqual(a + day, self.theclass(2002, 3, 3, 17, 6))
+ self.assertEqual(a - day, self.theclass(2002, 3, 1, 17, 6))
+ self.assertEqual(a + week, self.theclass(2002, 3, 9, 17, 6))
+ self.assertEqual(a - week, self.theclass(2002, 2, 23, 17, 6))
+ self.assertEqual(a + 52*week, self.theclass(2003, 3, 1, 17, 6))
+ self.assertEqual(a - 52*week, self.theclass(2001, 3, 3, 17, 6))
+ self.assertEqual((a + week) - a, week)
+ self.assertEqual((a + day) - a, day)
+ self.assertEqual((a + hour) - a, hour)
+ self.assertEqual((a + millisec) - a, millisec)
+ self.assertEqual((a - week) - a, -week)
+ self.assertEqual((a - day) - a, -day)
+ self.assertEqual((a - hour) - a, -hour)
+ self.assertEqual((a - millisec) - a, -millisec)
+ self.assertEqual(a - (a + week), -week)
+ self.assertEqual(a - (a + day), -day)
+ self.assertEqual(a - (a + hour), -hour)
+ self.assertEqual(a - (a + millisec), -millisec)
+ self.assertEqual(a - (a - week), week)
+ self.assertEqual(a - (a - day), day)
+ self.assertEqual(a - (a - hour), hour)
+ self.assertEqual(a - (a - millisec), millisec)
+ self.assertEqual(a + (week + day + hour + millisec),
+ self.theclass(2002, 3, 10, 18, 6, 0, 1000))
+ self.assertEqual(a + (week + day + hour + millisec),
+ (((a + week) + day) + hour) + millisec)
+ self.assertEqual(a - (week + day + hour + millisec),
+ self.theclass(2002, 2, 22, 16, 5, 59, 999000))
+ self.assertEqual(a - (week + day + hour + millisec),
+ (((a - week) - day) - hour) - millisec)
+ # Add/sub ints or floats should be illegal
+ for i in 1, 1.0:
+ self.assertRaises(TypeError, lambda: a+i)
+ self.assertRaises(TypeError, lambda: a-i)
+ self.assertRaises(TypeError, lambda: i+a)
+ self.assertRaises(TypeError, lambda: i-a)
+
+ # delta - datetime is senseless.
+ self.assertRaises(TypeError, lambda: day - a)
+ # mixing datetime and (delta or datetime) via * or // is senseless
+ self.assertRaises(TypeError, lambda: day * a)
+ self.assertRaises(TypeError, lambda: a * day)
+ self.assertRaises(TypeError, lambda: day // a)
+ self.assertRaises(TypeError, lambda: a // day)
+ self.assertRaises(TypeError, lambda: a * a)
+ self.assertRaises(TypeError, lambda: a // a)
+ # datetime + datetime is senseless
+ self.assertRaises(TypeError, lambda: a + a)
+
+ def test_pickling(self):
+ args = 6, 7, 23, 20, 59, 1, 64**2
+ orig = self.theclass(*args)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+
+ def test_more_pickling(self):
+ a = self.theclass(2003, 2, 7, 16, 48, 37, 444116)
+ s = pickle.dumps(a)
+ b = pickle.loads(s)
+ self.assertEqual(b.year, 2003)
+ self.assertEqual(b.month, 2)
+ self.assertEqual(b.day, 7)
+
+ def test_pickling_subclass_datetime(self):
+ args = 6, 7, 23, 20, 59, 1, 64**2
+ orig = SubclassDatetime(*args)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+
+ def test_more_compare(self):
+ # The test_compare() inherited from TestDate covers the error cases.
+ # We just want to test lexicographic ordering on the members datetime
+ # has that date lacks.
+ args = [2000, 11, 29, 20, 58, 16, 999998]
+ t1 = self.theclass(*args)
+ t2 = self.theclass(*args)
+ self.assertEqual(t1, t2)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t1 >= t2)
+ self.assertTrue(not t1 != t2)
+ self.assertTrue(not t1 < t2)
+ self.assertTrue(not t1 > t2)
+
+ for i in range(len(args)):
+ newargs = args[:]
+ newargs[i] = args[i] + 1
+ t2 = self.theclass(*newargs) # this is larger than t1
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t2 > t1)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t2 >= t1)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 != t1)
+ self.assertTrue(not t1 == t2)
+ self.assertTrue(not t2 == t1)
+ self.assertTrue(not t1 > t2)
+ self.assertTrue(not t2 < t1)
+ self.assertTrue(not t1 >= t2)
+ self.assertTrue(not t2 <= t1)
+
+
+ # A helper for timestamp constructor tests.
+ def verify_field_equality(self, expected, got):
+ self.assertEqual(expected.tm_year, got.year)
+ self.assertEqual(expected.tm_mon, got.month)
+ self.assertEqual(expected.tm_mday, got.day)
+ self.assertEqual(expected.tm_hour, got.hour)
+ self.assertEqual(expected.tm_min, got.minute)
+ self.assertEqual(expected.tm_sec, got.second)
+
+ def test_fromtimestamp(self):
+ import time
+
+ ts = time.time()
+ expected = time.localtime(ts)
+ got = self.theclass.fromtimestamp(ts)
+ self.verify_field_equality(expected, got)
+
+ def test_utcfromtimestamp(self):
+ import time
+
+ ts = time.time()
+ expected = time.gmtime(ts)
+ got = self.theclass.utcfromtimestamp(ts)
+ self.verify_field_equality(expected, got)
+
+ def test_microsecond_rounding(self):
+ # Test whether fromtimestamp "rounds up" floats that are less
+ # than 1/2 microsecond smaller than an integer.
+ for fts in [self.theclass.fromtimestamp,
+ self.theclass.utcfromtimestamp]:
+ self.assertEqual(fts(0.9999999), fts(1))
+ self.assertEqual(fts(0.99999949).microsecond, 999999)
+
+ def test_insane_fromtimestamp(self):
+ # It's possible that some platform maps time_t to double,
+ # and that this test will fail there. This test should
+ # exempt such platforms (provided they return reasonable
+ # results!).
+ for insane in -1e200, 1e200:
+ self.assertRaises(ValueError, self.theclass.fromtimestamp,
+ insane)
+
+ def test_insane_utcfromtimestamp(self):
+ # It's possible that some platform maps time_t to double,
+ # and that this test will fail there. This test should
+ # exempt such platforms (provided they return reasonable
+ # results!).
+ for insane in -1e200, 1e200:
+ self.assertRaises(ValueError, self.theclass.utcfromtimestamp,
+ insane)
+ @unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
+ def test_negative_float_fromtimestamp(self):
+ # The result is tz-dependent; at least test that this doesn't
+ # fail (like it did before bug 1646728 was fixed).
+ self.theclass.fromtimestamp(-1.05)
+
+ @unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
+ def test_negative_float_utcfromtimestamp(self):
+ d = self.theclass.utcfromtimestamp(-1.05)
+ self.assertEqual(d, self.theclass(1969, 12, 31, 23, 59, 58, 950000))
+
+ def test_utcnow(self):
+ import time
+
+ # Call it a success if utcnow() and utcfromtimestamp() are within
+ # a second of each other.
+ tolerance = timedelta(seconds=1)
+ for dummy in range(3):
+ from_now = self.theclass.utcnow()
+ from_timestamp = self.theclass.utcfromtimestamp(time.time())
+ if abs(from_timestamp - from_now) <= tolerance:
+ break
+ # Else try again a few times.
+ self.assertTrue(abs(from_timestamp - from_now) <= tolerance)
+
+ def test_strptime(self):
+ import _strptime
+
+ string = '2004-12-01 13:02:47.197'
+ format = '%Y-%m-%d %H:%M:%S.%f'
+ expected = _strptime._strptime_datetime(self.theclass, string, format)
+ got = self.theclass.strptime(string, format)
+ self.assertEqual(expected, got)
+ self.assertIs(type(expected), self.theclass)
+ self.assertIs(type(got), self.theclass)
+
+ strptime = self.theclass.strptime
+ self.assertEqual(strptime("+0002", "%z").utcoffset(), 2 * MINUTE)
+ self.assertEqual(strptime("-0002", "%z").utcoffset(), -2 * MINUTE)
+ # Only local timezone and UTC are supported
+ for tzseconds, tzname in ((0, 'UTC'), (0, 'GMT'),
+ (-_time.timezone, _time.tzname[0])):
+ if tzseconds < 0:
+ sign = '-'
+ seconds = -tzseconds
+ else:
+ sign ='+'
+ seconds = tzseconds
+ hours, minutes = divmod(seconds//60, 60)
+ dtstr = "{}{:02d}{:02d} {}".format(sign, hours, minutes, tzname)
+ dt = strptime(dtstr, "%z %Z")
+ self.assertEqual(dt.utcoffset(), timedelta(seconds=tzseconds))
+ self.assertEqual(dt.tzname(), tzname)
+ # Can produce inconsistent datetime
+ dtstr, fmt = "+1234 UTC", "%z %Z"
+ dt = strptime(dtstr, fmt)
+ self.assertEqual(dt.utcoffset(), 12 * HOUR + 34 * MINUTE)
+ self.assertEqual(dt.tzname(), 'UTC')
+ # yet will roundtrip
+ self.assertEqual(dt.strftime(fmt), dtstr)
+
+ # Produce naive datetime if no %z is provided
+ self.assertEqual(strptime("UTC", "%Z").tzinfo, None)
+
+ with self.assertRaises(ValueError): strptime("-2400", "%z")
+ with self.assertRaises(ValueError): strptime("-000", "%z")
+
+ def test_more_timetuple(self):
+ # This tests fields beyond those tested by the TestDate.test_timetuple.
+ t = self.theclass(2004, 12, 31, 6, 22, 33)
+ self.assertEqual(t.timetuple(), (2004, 12, 31, 6, 22, 33, 4, 366, -1))
+ self.assertEqual(t.timetuple(),
+ (t.year, t.month, t.day,
+ t.hour, t.minute, t.second,
+ t.weekday(),
+ t.toordinal() - date(t.year, 1, 1).toordinal() + 1,
+ -1))
+ tt = t.timetuple()
+ self.assertEqual(tt.tm_year, t.year)
+ self.assertEqual(tt.tm_mon, t.month)
+ self.assertEqual(tt.tm_mday, t.day)
+ self.assertEqual(tt.tm_hour, t.hour)
+ self.assertEqual(tt.tm_min, t.minute)
+ self.assertEqual(tt.tm_sec, t.second)
+ self.assertEqual(tt.tm_wday, t.weekday())
+ self.assertEqual(tt.tm_yday, t.toordinal() -
+ date(t.year, 1, 1).toordinal() + 1)
+ self.assertEqual(tt.tm_isdst, -1)
+
+ def test_more_strftime(self):
+ # This tests fields beyond those tested by the TestDate.test_strftime.
+ t = self.theclass(2004, 12, 31, 6, 22, 33, 47)
+ self.assertEqual(t.strftime("%m %d %y %f %S %M %H %j"),
+ "12 31 04 000047 33 22 06 366")
+
+ def test_extract(self):
+ dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234)
+ self.assertEqual(dt.date(), date(2002, 3, 4))
+ self.assertEqual(dt.time(), time(18, 45, 3, 1234))
+
+ def test_combine(self):
+ d = date(2002, 3, 4)
+ t = time(18, 45, 3, 1234)
+ expected = self.theclass(2002, 3, 4, 18, 45, 3, 1234)
+ combine = self.theclass.combine
+ dt = combine(d, t)
+ self.assertEqual(dt, expected)
+
+ dt = combine(time=t, date=d)
+ self.assertEqual(dt, expected)
+
+ self.assertEqual(d, dt.date())
+ self.assertEqual(t, dt.time())
+ self.assertEqual(dt, combine(dt.date(), dt.time()))
+
+ self.assertRaises(TypeError, combine) # need an arg
+ self.assertRaises(TypeError, combine, d) # need two args
+ self.assertRaises(TypeError, combine, t, d) # args reversed
+ self.assertRaises(TypeError, combine, d, t, 1) # too many args
+ self.assertRaises(TypeError, combine, "date", "time") # wrong types
+ self.assertRaises(TypeError, combine, d, "time") # wrong type
+ self.assertRaises(TypeError, combine, "date", t) # wrong type
+
+ def test_replace(self):
+ cls = self.theclass
+ args = [1, 2, 3, 4, 5, 6, 7]
+ base = cls(*args)
+ self.assertEqual(base, base.replace())
+
+ i = 0
+ for name, newval in (("year", 2),
+ ("month", 3),
+ ("day", 4),
+ ("hour", 5),
+ ("minute", 6),
+ ("second", 7),
+ ("microsecond", 8)):
+ newargs = args[:]
+ newargs[i] = newval
+ expected = cls(*newargs)
+ got = base.replace(**{name: newval})
+ self.assertEqual(expected, got)
+ i += 1
+
+ # Out of bounds.
+ base = cls(2000, 2, 29)
+ self.assertRaises(ValueError, base.replace, year=2001)
+
+ def test_astimezone(self):
+ # Pretty boring! The TZ test is more interesting here. astimezone()
+ # simply can't be applied to a naive object.
+ dt = self.theclass.now()
+ f = FixedOffset(44, "")
+ self.assertRaises(TypeError, dt.astimezone) # not enough args
+ self.assertRaises(TypeError, dt.astimezone, f, f) # too many args
+ self.assertRaises(TypeError, dt.astimezone, dt) # arg wrong type
+ self.assertRaises(ValueError, dt.astimezone, f) # naive
+ self.assertRaises(ValueError, dt.astimezone, tz=f) # naive
+
+ class Bogus(tzinfo):
+ def utcoffset(self, dt): return None
+ def dst(self, dt): return timedelta(0)
+ bog = Bogus()
+ self.assertRaises(ValueError, dt.astimezone, bog) # naive
+ self.assertRaises(ValueError,
+ dt.replace(tzinfo=bog).astimezone, f)
+
+ class AlsoBogus(tzinfo):
+ def utcoffset(self, dt): return timedelta(0)
+ def dst(self, dt): return None
+ alsobog = AlsoBogus()
+ self.assertRaises(ValueError, dt.astimezone, alsobog) # also naive
+
+ def test_subclass_datetime(self):
+
+ class C(self.theclass):
+ theAnswer = 42
+
+ def __new__(cls, *args, **kws):
+ temp = kws.copy()
+ extra = temp.pop('extra')
+ result = self.theclass.__new__(cls, *args, **temp)
+ result.extra = extra
+ return result
+
+ def newmeth(self, start):
+ return start + self.year + self.month + self.second
+
+ args = 2003, 4, 14, 12, 13, 41
+
+ dt1 = self.theclass(*args)
+ dt2 = C(*args, **{'extra': 7})
+
+ self.assertEqual(dt2.__class__, C)
+ self.assertEqual(dt2.theAnswer, 42)
+ self.assertEqual(dt2.extra, 7)
+ self.assertEqual(dt1.toordinal(), dt2.toordinal())
+ self.assertEqual(dt2.newmeth(-7), dt1.year + dt1.month +
+ dt1.second - 7)
+
+class TestSubclassDateTime(TestDateTime):
+ theclass = SubclassDatetime
+ # Override tests not designed for subclass
+ def test_roundtrip(self):
+ pass
+
+class SubclassTime(time):
+ sub_var = 1
+
+class TestTime(HarmlessMixedComparison, unittest.TestCase):
+
+ theclass = time
+
+ def test_basic_attributes(self):
+ t = self.theclass(12, 0)
+ self.assertEqual(t.hour, 12)
+ self.assertEqual(t.minute, 0)
+ self.assertEqual(t.second, 0)
+ self.assertEqual(t.microsecond, 0)
+
+ def test_basic_attributes_nonzero(self):
+ # Make sure all attributes are non-zero so bugs in
+ # bit-shifting access show up.
+ t = self.theclass(12, 59, 59, 8000)
+ self.assertEqual(t.hour, 12)
+ self.assertEqual(t.minute, 59)
+ self.assertEqual(t.second, 59)
+ self.assertEqual(t.microsecond, 8000)
+
+ def test_roundtrip(self):
+ t = self.theclass(1, 2, 3, 4)
+
+ # Verify t -> string -> time identity.
+ s = repr(t)
+ self.assertTrue(s.startswith('datetime.'))
+ s = s[9:]
+ t2 = eval(s)
+ self.assertEqual(t, t2)
+
+ # Verify identity via reconstructing from pieces.
+ t2 = self.theclass(t.hour, t.minute, t.second,
+ t.microsecond)
+ self.assertEqual(t, t2)
+
+ def test_comparing(self):
+ args = [1, 2, 3, 4]
+ t1 = self.theclass(*args)
+ t2 = self.theclass(*args)
+ self.assertEqual(t1, t2)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t1 >= t2)
+ self.assertTrue(not t1 != t2)
+ self.assertTrue(not t1 < t2)
+ self.assertTrue(not t1 > t2)
+
+ for i in range(len(args)):
+ newargs = args[:]
+ newargs[i] = args[i] + 1
+ t2 = self.theclass(*newargs) # this is larger than t1
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t2 > t1)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t2 >= t1)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 != t1)
+ self.assertTrue(not t1 == t2)
+ self.assertTrue(not t2 == t1)
+ self.assertTrue(not t1 > t2)
+ self.assertTrue(not t2 < t1)
+ self.assertTrue(not t1 >= t2)
+ self.assertTrue(not t2 <= t1)
+
+ for badarg in OTHERSTUFF:
+ self.assertEqual(t1 == badarg, False)
+ self.assertEqual(t1 != badarg, True)
+ self.assertEqual(badarg == t1, False)
+ self.assertEqual(badarg != t1, True)
+
+ self.assertRaises(TypeError, lambda: t1 <= badarg)
+ self.assertRaises(TypeError, lambda: t1 < badarg)
+ self.assertRaises(TypeError, lambda: t1 > badarg)
+ self.assertRaises(TypeError, lambda: t1 >= badarg)
+ self.assertRaises(TypeError, lambda: badarg <= t1)
+ self.assertRaises(TypeError, lambda: badarg < t1)
+ self.assertRaises(TypeError, lambda: badarg > t1)
+ self.assertRaises(TypeError, lambda: badarg >= t1)
+
+ def test_bad_constructor_arguments(self):
+ # bad hours
+ self.theclass(0, 0) # no exception
+ self.theclass(23, 0) # no exception
+ self.assertRaises(ValueError, self.theclass, -1, 0)
+ self.assertRaises(ValueError, self.theclass, 24, 0)
+ # bad minutes
+ self.theclass(23, 0) # no exception
+ self.theclass(23, 59) # no exception
+ self.assertRaises(ValueError, self.theclass, 23, -1)
+ self.assertRaises(ValueError, self.theclass, 23, 60)
+ # bad seconds
+ self.theclass(23, 59, 0) # no exception
+ self.theclass(23, 59, 59) # no exception
+ self.assertRaises(ValueError, self.theclass, 23, 59, -1)
+ self.assertRaises(ValueError, self.theclass, 23, 59, 60)
+ # bad microseconds
+ self.theclass(23, 59, 59, 0) # no exception
+ self.theclass(23, 59, 59, 999999) # no exception
+ self.assertRaises(ValueError, self.theclass, 23, 59, 59, -1)
+ self.assertRaises(ValueError, self.theclass, 23, 59, 59, 1000000)
+
+ def test_hash_equality(self):
+ d = self.theclass(23, 30, 17)
+ e = self.theclass(23, 30, 17)
+ self.assertEqual(d, e)
+ self.assertEqual(hash(d), hash(e))
+
+ dic = {d: 1}
+ dic[e] = 2
+ self.assertEqual(len(dic), 1)
+ self.assertEqual(dic[d], 2)
+ self.assertEqual(dic[e], 2)
+
+ d = self.theclass(0, 5, 17)
+ e = self.theclass(0, 5, 17)
+ self.assertEqual(d, e)
+ self.assertEqual(hash(d), hash(e))
+
+ dic = {d: 1}
+ dic[e] = 2
+ self.assertEqual(len(dic), 1)
+ self.assertEqual(dic[d], 2)
+ self.assertEqual(dic[e], 2)
+
+ def test_isoformat(self):
+ t = self.theclass(4, 5, 1, 123)
+ self.assertEqual(t.isoformat(), "04:05:01.000123")
+ self.assertEqual(t.isoformat(), str(t))
+
+ t = self.theclass()
+ self.assertEqual(t.isoformat(), "00:00:00")
+ self.assertEqual(t.isoformat(), str(t))
+
+ t = self.theclass(microsecond=1)
+ self.assertEqual(t.isoformat(), "00:00:00.000001")
+ self.assertEqual(t.isoformat(), str(t))
+
+ t = self.theclass(microsecond=10)
+ self.assertEqual(t.isoformat(), "00:00:00.000010")
+ self.assertEqual(t.isoformat(), str(t))
+
+ t = self.theclass(microsecond=100)
+ self.assertEqual(t.isoformat(), "00:00:00.000100")
+ self.assertEqual(t.isoformat(), str(t))
+
+ t = self.theclass(microsecond=1000)
+ self.assertEqual(t.isoformat(), "00:00:00.001000")
+ self.assertEqual(t.isoformat(), str(t))
+
+ t = self.theclass(microsecond=10000)
+ self.assertEqual(t.isoformat(), "00:00:00.010000")
+ self.assertEqual(t.isoformat(), str(t))
+
+ t = self.theclass(microsecond=100000)
+ self.assertEqual(t.isoformat(), "00:00:00.100000")
+ self.assertEqual(t.isoformat(), str(t))
+
+ def test_1653736(self):
+ # verify it doesn't accept extra keyword arguments
+ t = self.theclass(second=1)
+ self.assertRaises(TypeError, t.isoformat, foo=3)
+
+ def test_strftime(self):
+ t = self.theclass(1, 2, 3, 4)
+ self.assertEqual(t.strftime('%H %M %S %f'), "01 02 03 000004")
+ # A naive object replaces %z and %Z with empty strings.
+ self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
+
+ def test_format(self):
+ t = self.theclass(1, 2, 3, 4)
+ self.assertEqual(t.__format__(''), str(t))
+
+ # check that a derived class's __str__() gets called
+ class A(self.theclass):
+ def __str__(self):
+ return 'A'
+ a = A(1, 2, 3, 4)
+ self.assertEqual(a.__format__(''), 'A')
+
+ # check that a derived class's strftime gets called
+ class B(self.theclass):
+ def strftime(self, format_spec):
+ return 'B'
+ b = B(1, 2, 3, 4)
+ self.assertEqual(b.__format__(''), str(t))
+
+ for fmt in ['%H %M %S',
+ ]:
+ self.assertEqual(t.__format__(fmt), t.strftime(fmt))
+ self.assertEqual(a.__format__(fmt), t.strftime(fmt))
+ self.assertEqual(b.__format__(fmt), 'B')
+
+ def test_str(self):
+ self.assertEqual(str(self.theclass(1, 2, 3, 4)), "01:02:03.000004")
+ self.assertEqual(str(self.theclass(10, 2, 3, 4000)), "10:02:03.004000")
+ self.assertEqual(str(self.theclass(0, 2, 3, 400000)), "00:02:03.400000")
+ self.assertEqual(str(self.theclass(12, 2, 3, 0)), "12:02:03")
+ self.assertEqual(str(self.theclass(23, 15, 0, 0)), "23:15:00")
+
+ def test_repr(self):
+ name = 'datetime.' + self.theclass.__name__
+ self.assertEqual(repr(self.theclass(1, 2, 3, 4)),
+ "%s(1, 2, 3, 4)" % name)
+ self.assertEqual(repr(self.theclass(10, 2, 3, 4000)),
+ "%s(10, 2, 3, 4000)" % name)
+ self.assertEqual(repr(self.theclass(0, 2, 3, 400000)),
+ "%s(0, 2, 3, 400000)" % name)
+ self.assertEqual(repr(self.theclass(12, 2, 3, 0)),
+ "%s(12, 2, 3)" % name)
+ self.assertEqual(repr(self.theclass(23, 15, 0, 0)),
+ "%s(23, 15)" % name)
+
+ def test_resolution_info(self):
+ self.assertIsInstance(self.theclass.min, self.theclass)
+ self.assertIsInstance(self.theclass.max, self.theclass)
+ self.assertIsInstance(self.theclass.resolution, timedelta)
+ self.assertTrue(self.theclass.max > self.theclass.min)
+
+ def test_pickling(self):
+ args = 20, 59, 16, 64**2
+ orig = self.theclass(*args)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+
+ def test_pickling_subclass_time(self):
+ args = 20, 59, 16, 64**2
+ orig = SubclassTime(*args)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+
+ def test_bool(self):
+ cls = self.theclass
+ self.assertTrue(cls(1))
+ self.assertTrue(cls(0, 1))
+ self.assertTrue(cls(0, 0, 1))
+ self.assertTrue(cls(0, 0, 0, 1))
+ self.assertTrue(not cls(0))
+ self.assertTrue(not cls())
+
+ def test_replace(self):
+ cls = self.theclass
+ args = [1, 2, 3, 4]
+ base = cls(*args)
+ self.assertEqual(base, base.replace())
+
+ i = 0
+ for name, newval in (("hour", 5),
+ ("minute", 6),
+ ("second", 7),
+ ("microsecond", 8)):
+ newargs = args[:]
+ newargs[i] = newval
+ expected = cls(*newargs)
+ got = base.replace(**{name: newval})
+ self.assertEqual(expected, got)
+ i += 1
+
+ # Out of bounds.
+ base = cls(1)
+ self.assertRaises(ValueError, base.replace, hour=24)
+ self.assertRaises(ValueError, base.replace, minute=-1)
+ self.assertRaises(ValueError, base.replace, second=100)
+ self.assertRaises(ValueError, base.replace, microsecond=1000000)
+
+ def test_subclass_time(self):
+
+ class C(self.theclass):
+ theAnswer = 42
+
+ def __new__(cls, *args, **kws):
+ temp = kws.copy()
+ extra = temp.pop('extra')
+ result = self.theclass.__new__(cls, *args, **temp)
+ result.extra = extra
+ return result
+
+ def newmeth(self, start):
+ return start + self.hour + self.second
+
+ args = 4, 5, 6
+
+ dt1 = self.theclass(*args)
+ dt2 = C(*args, **{'extra': 7})
+
+ self.assertEqual(dt2.__class__, C)
+ self.assertEqual(dt2.theAnswer, 42)
+ self.assertEqual(dt2.extra, 7)
+ self.assertEqual(dt1.isoformat(), dt2.isoformat())
+ self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.second - 7)
+
+ def test_backdoor_resistance(self):
+ # see TestDate.test_backdoor_resistance().
+ base = '2:59.0'
+ for hour_byte in ' ', '9', chr(24), '\xff':
+ self.assertRaises(TypeError, self.theclass,
+ hour_byte + base[1:])
+
+# A mixin for classes with a tzinfo= argument. Subclasses must define
+# theclass as a class atribute, and theclass(1, 1, 1, tzinfo=whatever)
+# must be legit (which is true for time and datetime).
+class TZInfoBase:
+
+ def test_argument_passing(self):
+ cls = self.theclass
+ # A datetime passes itself on, a time passes None.
+ class introspective(tzinfo):
+ def tzname(self, dt): return dt and "real" or "none"
+ def utcoffset(self, dt):
+ return timedelta(minutes = dt and 42 or -42)
+ dst = utcoffset
+
+ obj = cls(1, 2, 3, tzinfo=introspective())
+
+ expected = cls is time and "none" or "real"
+ self.assertEqual(obj.tzname(), expected)
+
+ expected = timedelta(minutes=(cls is time and -42 or 42))
+ self.assertEqual(obj.utcoffset(), expected)
+ self.assertEqual(obj.dst(), expected)
+
+ def test_bad_tzinfo_classes(self):
+ cls = self.theclass
+ self.assertRaises(TypeError, cls, 1, 1, 1, tzinfo=12)
+
+ class NiceTry(object):
+ def __init__(self): pass
+ def utcoffset(self, dt): pass
+ self.assertRaises(TypeError, cls, 1, 1, 1, tzinfo=NiceTry)
+
+ class BetterTry(tzinfo):
+ def __init__(self): pass
+ def utcoffset(self, dt): pass
+ b = BetterTry()
+ t = cls(1, 1, 1, tzinfo=b)
+ self.assertTrue(t.tzinfo is b)
+
+ def test_utc_offset_out_of_bounds(self):
+ class Edgy(tzinfo):
+ def __init__(self, offset):
+ self.offset = timedelta(minutes=offset)
+ def utcoffset(self, dt):
+ return self.offset
+
+ cls = self.theclass
+ for offset, legit in ((-1440, False),
+ (-1439, True),
+ (1439, True),
+ (1440, False)):
+ if cls is time:
+ t = cls(1, 2, 3, tzinfo=Edgy(offset))
+ elif cls is datetime:
+ t = cls(6, 6, 6, 1, 2, 3, tzinfo=Edgy(offset))
+ else:
+ assert 0, "impossible"
+ if legit:
+ aofs = abs(offset)
+ h, m = divmod(aofs, 60)
+ tag = "%c%02d:%02d" % (offset < 0 and '-' or '+', h, m)
+ if isinstance(t, datetime):
+ t = t.timetz()
+ self.assertEqual(str(t), "01:02:03" + tag)
+ else:
+ self.assertRaises(ValueError, str, t)
+
+ def test_tzinfo_classes(self):
+ cls = self.theclass
+ class C1(tzinfo):
+ def utcoffset(self, dt): return None
+ def dst(self, dt): return None
+ def tzname(self, dt): return None
+ for t in (cls(1, 1, 1),
+ cls(1, 1, 1, tzinfo=None),
+ cls(1, 1, 1, tzinfo=C1())):
+ self.assertTrue(t.utcoffset() is None)
+ self.assertTrue(t.dst() is None)
+ self.assertTrue(t.tzname() is None)
+
+ class C3(tzinfo):
+ def utcoffset(self, dt): return timedelta(minutes=-1439)
+ def dst(self, dt): return timedelta(minutes=1439)
+ def tzname(self, dt): return "aname"
+ t = cls(1, 1, 1, tzinfo=C3())
+ self.assertEqual(t.utcoffset(), timedelta(minutes=-1439))
+ self.assertEqual(t.dst(), timedelta(minutes=1439))
+ self.assertEqual(t.tzname(), "aname")
+
+ # Wrong types.
+ class C4(tzinfo):
+ def utcoffset(self, dt): return "aname"
+ def dst(self, dt): return 7
+ def tzname(self, dt): return 0
+ t = cls(1, 1, 1, tzinfo=C4())
+ self.assertRaises(TypeError, t.utcoffset)
+ self.assertRaises(TypeError, t.dst)
+ self.assertRaises(TypeError, t.tzname)
+
+ # Offset out of range.
+ class C6(tzinfo):
+ def utcoffset(self, dt): return timedelta(hours=-24)
+ def dst(self, dt): return timedelta(hours=24)
+ t = cls(1, 1, 1, tzinfo=C6())
+ self.assertRaises(ValueError, t.utcoffset)
+ self.assertRaises(ValueError, t.dst)
+
+ # Not a whole number of minutes.
+ class C7(tzinfo):
+ def utcoffset(self, dt): return timedelta(seconds=61)
+ def dst(self, dt): return timedelta(microseconds=-81)
+ t = cls(1, 1, 1, tzinfo=C7())
+ self.assertRaises(ValueError, t.utcoffset)
+ self.assertRaises(ValueError, t.dst)
+
+ def test_aware_compare(self):
+ cls = self.theclass
+
+ # Ensure that utcoffset() gets ignored if the comparands have
+ # the same tzinfo member.
+ class OperandDependentOffset(tzinfo):
+ def utcoffset(self, t):
+ if t.minute < 10:
+ # d0 and d1 equal after adjustment
+ return timedelta(minutes=t.minute)
+ else:
+ # d2 off in the weeds
+ return timedelta(minutes=59)
+
+ base = cls(8, 9, 10, tzinfo=OperandDependentOffset())
+ d0 = base.replace(minute=3)
+ d1 = base.replace(minute=9)
+ d2 = base.replace(minute=11)
+ for x in d0, d1, d2:
+ for y in d0, d1, d2:
+ for op in lt, le, gt, ge, eq, ne:
+ got = op(x, y)
+ expected = op(x.minute, y.minute)
+ self.assertEqual(got, expected)
+
+ # However, if they're different members, uctoffset is not ignored.
+ # Note that a time can't actually have an operand-depedent offset,
+ # though (and time.utcoffset() passes None to tzinfo.utcoffset()),
+ # so skip this test for time.
+ if cls is not time:
+ d0 = base.replace(minute=3, tzinfo=OperandDependentOffset())
+ d1 = base.replace(minute=9, tzinfo=OperandDependentOffset())
+ d2 = base.replace(minute=11, tzinfo=OperandDependentOffset())
+ for x in d0, d1, d2:
+ for y in d0, d1, d2:
+ got = (x > y) - (x < y)
+ if (x is d0 or x is d1) and (y is d0 or y is d1):
+ expected = 0
+ elif x is y is d2:
+ expected = 0
+ elif x is d2:
+ expected = -1
+ else:
+ assert y is d2
+ expected = 1
+ self.assertEqual(got, expected)
+
+
+# Testing time objects with a non-None tzinfo.
+class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
+ theclass = time
+
+ def test_empty(self):
+ t = self.theclass()
+ self.assertEqual(t.hour, 0)
+ self.assertEqual(t.minute, 0)
+ self.assertEqual(t.second, 0)
+ self.assertEqual(t.microsecond, 0)
+ self.assertTrue(t.tzinfo is None)
+
+ def test_zones(self):
+ est = FixedOffset(-300, "EST", 1)
+ utc = FixedOffset(0, "UTC", -2)
+ met = FixedOffset(60, "MET", 3)
+ t1 = time( 7, 47, tzinfo=est)
+ t2 = time(12, 47, tzinfo=utc)
+ t3 = time(13, 47, tzinfo=met)
+ t4 = time(microsecond=40)
+ t5 = time(microsecond=40, tzinfo=utc)
+
+ self.assertEqual(t1.tzinfo, est)
+ self.assertEqual(t2.tzinfo, utc)
+ self.assertEqual(t3.tzinfo, met)
+ self.assertTrue(t4.tzinfo is None)
+ self.assertEqual(t5.tzinfo, utc)
+
+ self.assertEqual(t1.utcoffset(), timedelta(minutes=-300))
+ self.assertEqual(t2.utcoffset(), timedelta(minutes=0))
+ self.assertEqual(t3.utcoffset(), timedelta(minutes=60))
+ self.assertTrue(t4.utcoffset() is None)
+ self.assertRaises(TypeError, t1.utcoffset, "no args")
+
+ self.assertEqual(t1.tzname(), "EST")
+ self.assertEqual(t2.tzname(), "UTC")
+ self.assertEqual(t3.tzname(), "MET")
+ self.assertTrue(t4.tzname() is None)
+ self.assertRaises(TypeError, t1.tzname, "no args")
+
+ self.assertEqual(t1.dst(), timedelta(minutes=1))
+ self.assertEqual(t2.dst(), timedelta(minutes=-2))
+ self.assertEqual(t3.dst(), timedelta(minutes=3))
+ self.assertTrue(t4.dst() is None)
+ self.assertRaises(TypeError, t1.dst, "no args")
+
+ self.assertEqual(hash(t1), hash(t2))
+ self.assertEqual(hash(t1), hash(t3))
+ self.assertEqual(hash(t2), hash(t3))
+
+ self.assertEqual(t1, t2)
+ self.assertEqual(t1, t3)
+ self.assertEqual(t2, t3)
+ self.assertRaises(TypeError, lambda: t4 == t5) # mixed tz-aware & naive
+ self.assertRaises(TypeError, lambda: t4 < t5) # mixed tz-aware & naive
+ self.assertRaises(TypeError, lambda: t5 < t4) # mixed tz-aware & naive
+
+ self.assertEqual(str(t1), "07:47:00-05:00")
+ self.assertEqual(str(t2), "12:47:00+00:00")
+ self.assertEqual(str(t3), "13:47:00+01:00")
+ self.assertEqual(str(t4), "00:00:00.000040")
+ self.assertEqual(str(t5), "00:00:00.000040+00:00")
+
+ self.assertEqual(t1.isoformat(), "07:47:00-05:00")
+ self.assertEqual(t2.isoformat(), "12:47:00+00:00")
+ self.assertEqual(t3.isoformat(), "13:47:00+01:00")
+ self.assertEqual(t4.isoformat(), "00:00:00.000040")
+ self.assertEqual(t5.isoformat(), "00:00:00.000040+00:00")
+
+ d = 'datetime.time'
+ self.assertEqual(repr(t1), d + "(7, 47, tzinfo=est)")
+ self.assertEqual(repr(t2), d + "(12, 47, tzinfo=utc)")
+ self.assertEqual(repr(t3), d + "(13, 47, tzinfo=met)")
+ self.assertEqual(repr(t4), d + "(0, 0, 0, 40)")
+ self.assertEqual(repr(t5), d + "(0, 0, 0, 40, tzinfo=utc)")
+
+ self.assertEqual(t1.strftime("%H:%M:%S %%Z=%Z %%z=%z"),
+ "07:47:00 %Z=EST %z=-0500")
+ self.assertEqual(t2.strftime("%H:%M:%S %Z %z"), "12:47:00 UTC +0000")
+ self.assertEqual(t3.strftime("%H:%M:%S %Z %z"), "13:47:00 MET +0100")
+
+ yuck = FixedOffset(-1439, "%z %Z %%z%%Z")
+ t1 = time(23, 59, tzinfo=yuck)
+ self.assertEqual(t1.strftime("%H:%M %%Z='%Z' %%z='%z'"),
+ "23:59 %Z='%z %Z %%z%%Z' %z='-2359'")
+
+ # Check that an invalid tzname result raises an exception.
+ class Badtzname(tzinfo):
+ tz = 42
+ def tzname(self, dt): return self.tz
+ t = time(2, 3, 4, tzinfo=Badtzname())
+ self.assertEqual(t.strftime("%H:%M:%S"), "02:03:04")
+ self.assertRaises(TypeError, t.strftime, "%Z")
+
+ # Issue #6697:
+ if '_Fast' in str(type(self)):
+ Badtzname.tz = '\ud800'
+ self.assertRaises(ValueError, t.strftime, "%Z")
+
+ def test_hash_edge_cases(self):
+ # Offsets that overflow a basic time.
+ t1 = self.theclass(0, 1, 2, 3, tzinfo=FixedOffset(1439, ""))
+ t2 = self.theclass(0, 0, 2, 3, tzinfo=FixedOffset(1438, ""))
+ self.assertEqual(hash(t1), hash(t2))
+
+ t1 = self.theclass(23, 58, 6, 100, tzinfo=FixedOffset(-1000, ""))
+ t2 = self.theclass(23, 48, 6, 100, tzinfo=FixedOffset(-1010, ""))
+ self.assertEqual(hash(t1), hash(t2))
+
+ def test_pickling(self):
+ # Try one without a tzinfo.
+ args = 20, 59, 16, 64**2
+ orig = self.theclass(*args)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+
+ # Try one with a tzinfo.
+ tinfo = PicklableFixedOffset(-300, 'cookie')
+ orig = self.theclass(5, 6, 7, tzinfo=tinfo)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+ self.assertIsInstance(derived.tzinfo, PicklableFixedOffset)
+ self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
+ self.assertEqual(derived.tzname(), 'cookie')
+
+ def test_more_bool(self):
+ # Test cases with non-None tzinfo.
+ cls = self.theclass
+
+ t = cls(0, tzinfo=FixedOffset(-300, ""))
+ self.assertTrue(t)
+
+ t = cls(5, tzinfo=FixedOffset(-300, ""))
+ self.assertTrue(t)
+
+ t = cls(5, tzinfo=FixedOffset(300, ""))
+ self.assertTrue(not t)
+
+ t = cls(23, 59, tzinfo=FixedOffset(23*60 + 59, ""))
+ self.assertTrue(not t)
+
+ # Mostly ensuring this doesn't overflow internally.
+ t = cls(0, tzinfo=FixedOffset(23*60 + 59, ""))
+ self.assertTrue(t)
+
+ # But this should yield a value error -- the utcoffset is bogus.
+ t = cls(0, tzinfo=FixedOffset(24*60, ""))
+ self.assertRaises(ValueError, lambda: bool(t))
+
+ # Likewise.
+ t = cls(0, tzinfo=FixedOffset(-24*60, ""))
+ self.assertRaises(ValueError, lambda: bool(t))
+
+ def test_replace(self):
+ cls = self.theclass
+ z100 = FixedOffset(100, "+100")
+ zm200 = FixedOffset(timedelta(minutes=-200), "-200")
+ args = [1, 2, 3, 4, z100]
+ base = cls(*args)
+ self.assertEqual(base, base.replace())
+
+ i = 0
+ for name, newval in (("hour", 5),
+ ("minute", 6),
+ ("second", 7),
+ ("microsecond", 8),
+ ("tzinfo", zm200)):
+ newargs = args[:]
+ newargs[i] = newval
+ expected = cls(*newargs)
+ got = base.replace(**{name: newval})
+ self.assertEqual(expected, got)
+ i += 1
+
+ # Ensure we can get rid of a tzinfo.
+ self.assertEqual(base.tzname(), "+100")
+ base2 = base.replace(tzinfo=None)
+ self.assertTrue(base2.tzinfo is None)
+ self.assertTrue(base2.tzname() is None)
+
+ # Ensure we can add one.
+ base3 = base2.replace(tzinfo=z100)
+ self.assertEqual(base, base3)
+ self.assertTrue(base.tzinfo is base3.tzinfo)
+
+ # Out of bounds.
+ base = cls(1)
+ self.assertRaises(ValueError, base.replace, hour=24)
+ self.assertRaises(ValueError, base.replace, minute=-1)
+ self.assertRaises(ValueError, base.replace, second=100)
+ self.assertRaises(ValueError, base.replace, microsecond=1000000)
+
+ def test_mixed_compare(self):
+ t1 = time(1, 2, 3)
+ t2 = time(1, 2, 3)
+ self.assertEqual(t1, t2)
+ t2 = t2.replace(tzinfo=None)
+ self.assertEqual(t1, t2)
+ t2 = t2.replace(tzinfo=FixedOffset(None, ""))
+ self.assertEqual(t1, t2)
+ t2 = t2.replace(tzinfo=FixedOffset(0, ""))
+ self.assertRaises(TypeError, lambda: t1 == t2)
+
+ # In time w/ identical tzinfo objects, utcoffset is ignored.
+ class Varies(tzinfo):
+ def __init__(self):
+ self.offset = timedelta(minutes=22)
+ def utcoffset(self, t):
+ self.offset += timedelta(minutes=1)
+ return self.offset
+
+ v = Varies()
+ t1 = t2.replace(tzinfo=v)
+ t2 = t2.replace(tzinfo=v)
+ self.assertEqual(t1.utcoffset(), timedelta(minutes=23))
+ self.assertEqual(t2.utcoffset(), timedelta(minutes=24))
+ self.assertEqual(t1, t2)
+
+ # But if they're not identical, it isn't ignored.
+ t2 = t2.replace(tzinfo=Varies())
+ self.assertTrue(t1 < t2) # t1's offset counter still going up
+
+ def test_subclass_timetz(self):
+
+ class C(self.theclass):
+ theAnswer = 42
+
+ def __new__(cls, *args, **kws):
+ temp = kws.copy()
+ extra = temp.pop('extra')
+ result = self.theclass.__new__(cls, *args, **temp)
+ result.extra = extra
+ return result
+
+ def newmeth(self, start):
+ return start + self.hour + self.second
+
+ args = 4, 5, 6, 500, FixedOffset(-300, "EST", 1)
+
+ dt1 = self.theclass(*args)
+ dt2 = C(*args, **{'extra': 7})
+
+ self.assertEqual(dt2.__class__, C)
+ self.assertEqual(dt2.theAnswer, 42)
+ self.assertEqual(dt2.extra, 7)
+ self.assertEqual(dt1.utcoffset(), dt2.utcoffset())
+ self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.second - 7)
+
+
+# Testing datetime objects with a non-None tzinfo.
+
+class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
+ theclass = datetime
+
+ def test_trivial(self):
+ dt = self.theclass(1, 2, 3, 4, 5, 6, 7)
+ self.assertEqual(dt.year, 1)
+ self.assertEqual(dt.month, 2)
+ self.assertEqual(dt.day, 3)
+ self.assertEqual(dt.hour, 4)
+ self.assertEqual(dt.minute, 5)
+ self.assertEqual(dt.second, 6)
+ self.assertEqual(dt.microsecond, 7)
+ self.assertEqual(dt.tzinfo, None)
+
+ def test_even_more_compare(self):
+ # The test_compare() and test_more_compare() inherited from TestDate
+ # and TestDateTime covered non-tzinfo cases.
+
+ # Smallest possible after UTC adjustment.
+ t1 = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, ""))
+ # Largest possible after UTC adjustment.
+ t2 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
+ tzinfo=FixedOffset(-1439, ""))
+
+ # Make sure those compare correctly, and w/o overflow.
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 > t1)
+
+ self.assertEqual(t1, t1)
+ self.assertEqual(t2, t2)
+
+ # Equal afer adjustment.
+ t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""))
+ t2 = self.theclass(2, 1, 1, 3, 13, tzinfo=FixedOffset(3*60+13+2, ""))
+ self.assertEqual(t1, t2)
+
+ # Change t1 not to subtract a minute, and t1 should be larger.
+ t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(0, ""))
+ self.assertTrue(t1 > t2)
+
+ # Change t1 to subtract 2 minutes, and t1 should be smaller.
+ t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(2, ""))
+ self.assertTrue(t1 < t2)
+
+ # Back to the original t1, but make seconds resolve it.
+ t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
+ second=1)
+ self.assertTrue(t1 > t2)
+
+ # Likewise, but make microseconds resolve it.
+ t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
+ microsecond=1)
+ self.assertTrue(t1 > t2)
+
+ # Make t2 naive and it should fail.
+ t2 = self.theclass.min
+ self.assertRaises(TypeError, lambda: t1 == t2)
+ self.assertEqual(t2, t2)
+
+ # It's also naive if it has tzinfo but tzinfo.utcoffset() is None.
+ class Naive(tzinfo):
+ def utcoffset(self, dt): return None
+ t2 = self.theclass(5, 6, 7, tzinfo=Naive())
+ self.assertRaises(TypeError, lambda: t1 == t2)
+ self.assertEqual(t2, t2)
+
+ # OTOH, it's OK to compare two of these mixing the two ways of being
+ # naive.
+ t1 = self.theclass(5, 6, 7)
+ self.assertEqual(t1, t2)
+
+ # Try a bogus uctoffset.
+ class Bogus(tzinfo):
+ def utcoffset(self, dt):
+ return timedelta(minutes=1440) # out of bounds
+ t1 = self.theclass(2, 2, 2, tzinfo=Bogus())
+ t2 = self.theclass(2, 2, 2, tzinfo=FixedOffset(0, ""))
+ self.assertRaises(ValueError, lambda: t1 == t2)
+
+ def test_pickling(self):
+ # Try one without a tzinfo.
+ args = 6, 7, 23, 20, 59, 1, 64**2
+ orig = self.theclass(*args)
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+
+ # Try one with a tzinfo.
+ tinfo = PicklableFixedOffset(-300, 'cookie')
+ orig = self.theclass(*args, **{'tzinfo': tinfo})
+ derived = self.theclass(1, 1, 1, tzinfo=FixedOffset(0, "", 0))
+ for pickler, unpickler, proto in pickle_choices:
+ green = pickler.dumps(orig, proto)
+ derived = unpickler.loads(green)
+ self.assertEqual(orig, derived)
+ self.assertIsInstance(derived.tzinfo, PicklableFixedOffset)
+ self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
+ self.assertEqual(derived.tzname(), 'cookie')
+
+ def test_extreme_hashes(self):
+ # If an attempt is made to hash these via subtracting the offset
+ # then hashing a datetime object, OverflowError results. The
+ # Python implementation used to blow up here.
+ t = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, ""))
+ hash(t)
+ t = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
+ tzinfo=FixedOffset(-1439, ""))
+ hash(t)
+
+ # OTOH, an OOB offset should blow up.
+ t = self.theclass(5, 5, 5, tzinfo=FixedOffset(-1440, ""))
+ self.assertRaises(ValueError, hash, t)
+
+ def test_zones(self):
+ est = FixedOffset(-300, "EST")
+ utc = FixedOffset(0, "UTC")
+ met = FixedOffset(60, "MET")
+ t1 = datetime(2002, 3, 19, 7, 47, tzinfo=est)
+ t2 = datetime(2002, 3, 19, 12, 47, tzinfo=utc)
+ t3 = datetime(2002, 3, 19, 13, 47, tzinfo=met)
+ self.assertEqual(t1.tzinfo, est)
+ self.assertEqual(t2.tzinfo, utc)
+ self.assertEqual(t3.tzinfo, met)
+ self.assertEqual(t1.utcoffset(), timedelta(minutes=-300))
+ self.assertEqual(t2.utcoffset(), timedelta(minutes=0))
+ self.assertEqual(t3.utcoffset(), timedelta(minutes=60))
+ self.assertEqual(t1.tzname(), "EST")
+ self.assertEqual(t2.tzname(), "UTC")
+ self.assertEqual(t3.tzname(), "MET")
+ self.assertEqual(hash(t1), hash(t2))
+ self.assertEqual(hash(t1), hash(t3))
+ self.assertEqual(hash(t2), hash(t3))
+ self.assertEqual(t1, t2)
+ self.assertEqual(t1, t3)
+ self.assertEqual(t2, t3)
+ self.assertEqual(str(t1), "2002-03-19 07:47:00-05:00")
+ self.assertEqual(str(t2), "2002-03-19 12:47:00+00:00")
+ self.assertEqual(str(t3), "2002-03-19 13:47:00+01:00")
+ d = 'datetime.datetime(2002, 3, 19, '
+ self.assertEqual(repr(t1), d + "7, 47, tzinfo=est)")
+ self.assertEqual(repr(t2), d + "12, 47, tzinfo=utc)")
+ self.assertEqual(repr(t3), d + "13, 47, tzinfo=met)")
+
+ def test_combine(self):
+ met = FixedOffset(60, "MET")
+ d = date(2002, 3, 4)
+ tz = time(18, 45, 3, 1234, tzinfo=met)
+ dt = datetime.combine(d, tz)
+ self.assertEqual(dt, datetime(2002, 3, 4, 18, 45, 3, 1234,
+ tzinfo=met))
+
+ def test_extract(self):
+ met = FixedOffset(60, "MET")
+ dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234, tzinfo=met)
+ self.assertEqual(dt.date(), date(2002, 3, 4))
+ self.assertEqual(dt.time(), time(18, 45, 3, 1234))
+ self.assertEqual(dt.timetz(), time(18, 45, 3, 1234, tzinfo=met))
+
+ def test_tz_aware_arithmetic(self):
+ import random
+
+ now = self.theclass.now()
+ tz55 = FixedOffset(-330, "west 5:30")
+ timeaware = now.time().replace(tzinfo=tz55)
+ nowaware = self.theclass.combine(now.date(), timeaware)
+ self.assertTrue(nowaware.tzinfo is tz55)
+ self.assertEqual(nowaware.timetz(), timeaware)
+
+ # Can't mix aware and non-aware.
+ self.assertRaises(TypeError, lambda: now - nowaware)
+ self.assertRaises(TypeError, lambda: nowaware - now)
+
+ # And adding datetime's doesn't make sense, aware or not.
+ self.assertRaises(TypeError, lambda: now + nowaware)
+ self.assertRaises(TypeError, lambda: nowaware + now)
+ self.assertRaises(TypeError, lambda: nowaware + nowaware)
+
+ # Subtracting should yield 0.
+ self.assertEqual(now - now, timedelta(0))
+ self.assertEqual(nowaware - nowaware, timedelta(0))
+
+ # Adding a delta should preserve tzinfo.
+ delta = timedelta(weeks=1, minutes=12, microseconds=5678)
+ nowawareplus = nowaware + delta
+ self.assertTrue(nowaware.tzinfo is tz55)
+ nowawareplus2 = delta + nowaware
+ self.assertTrue(nowawareplus2.tzinfo is tz55)
+ self.assertEqual(nowawareplus, nowawareplus2)
+
+ # that - delta should be what we started with, and that - what we
+ # started with should be delta.
+ diff = nowawareplus - delta
+ self.assertTrue(diff.tzinfo is tz55)
+ self.assertEqual(nowaware, diff)
+ self.assertRaises(TypeError, lambda: delta - nowawareplus)
+ self.assertEqual(nowawareplus - nowaware, delta)
+
+ # Make up a random timezone.
+ tzr = FixedOffset(random.randrange(-1439, 1440), "randomtimezone")
+ # Attach it to nowawareplus.
+ nowawareplus = nowawareplus.replace(tzinfo=tzr)
+ self.assertTrue(nowawareplus.tzinfo is tzr)
+ # Make sure the difference takes the timezone adjustments into account.
+ got = nowaware - nowawareplus
+ # Expected: (nowaware base - nowaware offset) -
+ # (nowawareplus base - nowawareplus offset) =
+ # (nowaware base - nowawareplus base) +
+ # (nowawareplus offset - nowaware offset) =
+ # -delta + nowawareplus offset - nowaware offset
+ expected = nowawareplus.utcoffset() - nowaware.utcoffset() - delta
+ self.assertEqual(got, expected)
+
+ # Try max possible difference.
+ min = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, "min"))
+ max = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
+ tzinfo=FixedOffset(-1439, "max"))
+ maxdiff = max - min
+ self.assertEqual(maxdiff, self.theclass.max - self.theclass.min +
+ timedelta(minutes=2*1439))
+ # Different tzinfo, but the same offset
+ tza = timezone(HOUR, 'A')
+ tzb = timezone(HOUR, 'B')
+ delta = min.replace(tzinfo=tza) - max.replace(tzinfo=tzb)
+ self.assertEqual(delta, self.theclass.min - self.theclass.max)
+
+ def test_tzinfo_now(self):
+ meth = self.theclass.now
+ # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
+ base = meth()
+ # Try with and without naming the keyword.
+ off42 = FixedOffset(42, "42")
+ another = meth(off42)
+ again = meth(tz=off42)
+ self.assertTrue(another.tzinfo is again.tzinfo)
+ self.assertEqual(another.utcoffset(), timedelta(minutes=42))
+ # Bad argument with and w/o naming the keyword.
+ self.assertRaises(TypeError, meth, 16)
+ self.assertRaises(TypeError, meth, tzinfo=16)
+ # Bad keyword name.
+ self.assertRaises(TypeError, meth, tinfo=off42)
+ # Too many args.
+ self.assertRaises(TypeError, meth, off42, off42)
+
+ # We don't know which time zone we're in, and don't have a tzinfo
+ # class to represent it, so seeing whether a tz argument actually
+ # does a conversion is tricky.
+ utc = FixedOffset(0, "utc", 0)
+ for weirdtz in [FixedOffset(timedelta(hours=15, minutes=58), "weirdtz", 0),
+ timezone(timedelta(hours=15, minutes=58), "weirdtz"),]:
+ for dummy in range(3):
+ now = datetime.now(weirdtz)
+ self.assertTrue(now.tzinfo is weirdtz)
+ utcnow = datetime.utcnow().replace(tzinfo=utc)
+ now2 = utcnow.astimezone(weirdtz)
+ if abs(now - now2) < timedelta(seconds=30):
+ break
+ # Else the code is broken, or more than 30 seconds passed between
+ # calls; assuming the latter, just try again.
+ else:
+ # Three strikes and we're out.
+ self.fail("utcnow(), now(tz), or astimezone() may be broken")
+
+ def test_tzinfo_fromtimestamp(self):
+ import time
+ meth = self.theclass.fromtimestamp
+ ts = time.time()
+ # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
+ base = meth(ts)
+ # Try with and without naming the keyword.
+ off42 = FixedOffset(42, "42")
+ another = meth(ts, off42)
+ again = meth(ts, tz=off42)
+ self.assertTrue(another.tzinfo is again.tzinfo)
+ self.assertEqual(another.utcoffset(), timedelta(minutes=42))
+ # Bad argument with and w/o naming the keyword.
+ self.assertRaises(TypeError, meth, ts, 16)
+ self.assertRaises(TypeError, meth, ts, tzinfo=16)
+ # Bad keyword name.
+ self.assertRaises(TypeError, meth, ts, tinfo=off42)
+ # Too many args.
+ self.assertRaises(TypeError, meth, ts, off42, off42)
+ # Too few args.
+ self.assertRaises(TypeError, meth)
+
+ # Try to make sure tz= actually does some conversion.
+ timestamp = 1000000000
+ utcdatetime = datetime.utcfromtimestamp(timestamp)
+ # In POSIX (epoch 1970), that's 2001-09-09 01:46:40 UTC, give or take.
+ # But on some flavor of Mac, it's nowhere near that. So we can't have
+ # any idea here what time that actually is, we can only test that
+ # relative changes match.
+ utcoffset = timedelta(hours=-15, minutes=39) # arbitrary, but not zero
+ tz = FixedOffset(utcoffset, "tz", 0)
+ expected = utcdatetime + utcoffset
+ got = datetime.fromtimestamp(timestamp, tz)
+ self.assertEqual(expected, got.replace(tzinfo=None))
+
+ def test_tzinfo_utcnow(self):
+ meth = self.theclass.utcnow
+ # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
+ base = meth()
+ # Try with and without naming the keyword; for whatever reason,
+ # utcnow() doesn't accept a tzinfo argument.
+ off42 = FixedOffset(42, "42")
+ self.assertRaises(TypeError, meth, off42)
+ self.assertRaises(TypeError, meth, tzinfo=off42)
+
+ def test_tzinfo_utcfromtimestamp(self):
+ import time
+ meth = self.theclass.utcfromtimestamp
+ ts = time.time()
+ # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
+ base = meth(ts)
+ # Try with and without naming the keyword; for whatever reason,
+ # utcfromtimestamp() doesn't accept a tzinfo argument.
+ off42 = FixedOffset(42, "42")
+ self.assertRaises(TypeError, meth, ts, off42)
+ self.assertRaises(TypeError, meth, ts, tzinfo=off42)
+
+ def test_tzinfo_timetuple(self):
+ # TestDateTime tested most of this. datetime adds a twist to the
+ # DST flag.
+ class DST(tzinfo):
+ def __init__(self, dstvalue):
+ if isinstance(dstvalue, int):
+ dstvalue = timedelta(minutes=dstvalue)
+ self.dstvalue = dstvalue
+ def dst(self, dt):
+ return self.dstvalue
+
+ cls = self.theclass
+ for dstvalue, flag in (-33, 1), (33, 1), (0, 0), (None, -1):
+ d = cls(1, 1, 1, 10, 20, 30, 40, tzinfo=DST(dstvalue))
+ t = d.timetuple()
+ self.assertEqual(1, t.tm_year)
+ self.assertEqual(1, t.tm_mon)
+ self.assertEqual(1, t.tm_mday)
+ self.assertEqual(10, t.tm_hour)
+ self.assertEqual(20, t.tm_min)
+ self.assertEqual(30, t.tm_sec)
+ self.assertEqual(0, t.tm_wday)
+ self.assertEqual(1, t.tm_yday)
+ self.assertEqual(flag, t.tm_isdst)
+
+ # dst() returns wrong type.
+ self.assertRaises(TypeError, cls(1, 1, 1, tzinfo=DST("x")).timetuple)
+
+ # dst() at the edge.
+ self.assertEqual(cls(1,1,1, tzinfo=DST(1439)).timetuple().tm_isdst, 1)
+ self.assertEqual(cls(1,1,1, tzinfo=DST(-1439)).timetuple().tm_isdst, 1)
+
+ # dst() out of range.
+ self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(1440)).timetuple)
+ self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(-1440)).timetuple)
+
+ def test_utctimetuple(self):
+ class DST(tzinfo):
+ def __init__(self, dstvalue=0):
+ if isinstance(dstvalue, int):
+ dstvalue = timedelta(minutes=dstvalue)
+ self.dstvalue = dstvalue
+ def dst(self, dt):
+ return self.dstvalue
+
+ cls = self.theclass
+ # This can't work: DST didn't implement utcoffset.
+ self.assertRaises(NotImplementedError,
+ cls(1, 1, 1, tzinfo=DST(0)).utcoffset)
+
+ class UOFS(DST):
+ def __init__(self, uofs, dofs=None):
+ DST.__init__(self, dofs)
+ self.uofs = timedelta(minutes=uofs)
+ def utcoffset(self, dt):
+ return self.uofs
+
+ for dstvalue in -33, 33, 0, None:
+ d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=UOFS(-53, dstvalue))
+ t = d.utctimetuple()
+ self.assertEqual(d.year, t.tm_year)
+ self.assertEqual(d.month, t.tm_mon)
+ self.assertEqual(d.day, t.tm_mday)
+ self.assertEqual(11, t.tm_hour) # 20mm + 53mm = 1hn + 13mm
+ self.assertEqual(13, t.tm_min)
+ self.assertEqual(d.second, t.tm_sec)
+ self.assertEqual(d.weekday(), t.tm_wday)
+ self.assertEqual(d.toordinal() - date(1, 1, 1).toordinal() + 1,
+ t.tm_yday)
+ # Ensure tm_isdst is 0 regardless of what dst() says: DST
+ # is never in effect for a UTC time.
+ self.assertEqual(0, t.tm_isdst)
+
+ # For naive datetime, utctimetuple == timetuple except for isdst
+ d = cls(1, 2, 3, 10, 20, 30, 40)
+ t = d.utctimetuple()
+ self.assertEqual(t[:-1], d.timetuple()[:-1])
+ self.assertEqual(0, t.tm_isdst)
+ # Same if utcoffset is None
+ class NOFS(DST):
+ def utcoffset(self, dt):
+ return None
+ d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=NOFS())
+ t = d.utctimetuple()
+ self.assertEqual(t[:-1], d.timetuple()[:-1])
+ self.assertEqual(0, t.tm_isdst)
+ # Check that bad tzinfo is detected
+ class BOFS(DST):
+ def utcoffset(self, dt):
+ return "EST"
+ d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=BOFS())
+ self.assertRaises(TypeError, d.utctimetuple)
+
+ # Check that utctimetuple() is the same as
+ # astimezone(utc).timetuple()
+ d = cls(2010, 11, 13, 14, 15, 16, 171819)
+ for tz in [timezone.min, timezone.utc, timezone.max]:
+ dtz = d.replace(tzinfo=tz)
+ self.assertEqual(dtz.utctimetuple()[:-1],
+ dtz.astimezone(timezone.utc).timetuple()[:-1])
+ # At the edges, UTC adjustment can produce years out-of-range
+ # for a datetime object. Ensure that an OverflowError is
+ # raised.
+ tiny = cls(MINYEAR, 1, 1, 0, 0, 37, tzinfo=UOFS(1439))
+ # That goes back 1 minute less than a full day.
+ self.assertRaises(OverflowError, tiny.utctimetuple)
+
+ huge = cls(MAXYEAR, 12, 31, 23, 59, 37, 999999, tzinfo=UOFS(-1439))
+ # That goes forward 1 minute less than a full day.
+ self.assertRaises(OverflowError, huge.utctimetuple)
+ # More overflow cases
+ tiny = cls.min.replace(tzinfo=timezone(MINUTE))
+ self.assertRaises(OverflowError, tiny.utctimetuple)
+ huge = cls.max.replace(tzinfo=timezone(-MINUTE))
+ self.assertRaises(OverflowError, huge.utctimetuple)
+
+ def test_tzinfo_isoformat(self):
+ zero = FixedOffset(0, "+00:00")
+ plus = FixedOffset(220, "+03:40")
+ minus = FixedOffset(-231, "-03:51")
+ unknown = FixedOffset(None, "")
+
+ cls = self.theclass
+ datestr = '0001-02-03'
+ for ofs in None, zero, plus, minus, unknown:
+ for us in 0, 987001:
+ d = cls(1, 2, 3, 4, 5, 59, us, tzinfo=ofs)
+ timestr = '04:05:59' + (us and '.987001' or '')
+ ofsstr = ofs is not None and d.tzname() or ''
+ tailstr = timestr + ofsstr
+ iso = d.isoformat()
+ self.assertEqual(iso, datestr + 'T' + tailstr)
+ self.assertEqual(iso, d.isoformat('T'))
+ self.assertEqual(d.isoformat('k'), datestr + 'k' + tailstr)
+ self.assertEqual(d.isoformat('\u1234'), datestr + '\u1234' + tailstr)
+ self.assertEqual(str(d), datestr + ' ' + tailstr)
+
+ def test_replace(self):
+ cls = self.theclass
+ z100 = FixedOffset(100, "+100")
+ zm200 = FixedOffset(timedelta(minutes=-200), "-200")
+ args = [1, 2, 3, 4, 5, 6, 7, z100]
+ base = cls(*args)
+ self.assertEqual(base, base.replace())
+
+ i = 0
+ for name, newval in (("year", 2),
+ ("month", 3),
+ ("day", 4),
+ ("hour", 5),
+ ("minute", 6),
+ ("second", 7),
+ ("microsecond", 8),
+ ("tzinfo", zm200)):
+ newargs = args[:]
+ newargs[i] = newval
+ expected = cls(*newargs)
+ got = base.replace(**{name: newval})
+ self.assertEqual(expected, got)
+ i += 1
+
+ # Ensure we can get rid of a tzinfo.
+ self.assertEqual(base.tzname(), "+100")
+ base2 = base.replace(tzinfo=None)
+ self.assertTrue(base2.tzinfo is None)
+ self.assertTrue(base2.tzname() is None)
+
+ # Ensure we can add one.
+ base3 = base2.replace(tzinfo=z100)
+ self.assertEqual(base, base3)
+ self.assertTrue(base.tzinfo is base3.tzinfo)
+
+ # Out of bounds.
+ base = cls(2000, 2, 29)
+ self.assertRaises(ValueError, base.replace, year=2001)
+
+ def test_more_astimezone(self):
+ # The inherited test_astimezone covered some trivial and error cases.
+ fnone = FixedOffset(None, "None")
+ f44m = FixedOffset(44, "44")
+ fm5h = FixedOffset(-timedelta(hours=5), "m300")
+
+ dt = self.theclass.now(tz=f44m)
+ self.assertTrue(dt.tzinfo is f44m)
+ # Replacing with degenerate tzinfo raises an exception.
+ self.assertRaises(ValueError, dt.astimezone, fnone)
+ # Ditto with None tz.
+ self.assertRaises(TypeError, dt.astimezone, None)
+ # Replacing with same tzinfo makes no change.
+ x = dt.astimezone(dt.tzinfo)
+ self.assertTrue(x.tzinfo is f44m)
+ self.assertEqual(x.date(), dt.date())
+ self.assertEqual(x.time(), dt.time())
+
+ # Replacing with different tzinfo does adjust.
+ got = dt.astimezone(fm5h)
+ self.assertTrue(got.tzinfo is fm5h)
+ self.assertEqual(got.utcoffset(), timedelta(hours=-5))
+ expected = dt - dt.utcoffset() # in effect, convert to UTC
+ expected += fm5h.utcoffset(dt) # and from there to local time
+ expected = expected.replace(tzinfo=fm5h) # and attach new tzinfo
+ self.assertEqual(got.date(), expected.date())
+ self.assertEqual(got.time(), expected.time())
+ self.assertEqual(got.timetz(), expected.timetz())
+ self.assertTrue(got.tzinfo is expected.tzinfo)
+ self.assertEqual(got, expected)
+
+ def test_aware_subtract(self):
+ cls = self.theclass
+
+ # Ensure that utcoffset() is ignored when the operands have the
+ # same tzinfo member.
+ class OperandDependentOffset(tzinfo):
+ def utcoffset(self, t):
+ if t.minute < 10:
+ # d0 and d1 equal after adjustment
+ return timedelta(minutes=t.minute)
+ else:
+ # d2 off in the weeds
+ return timedelta(minutes=59)
+
+ base = cls(8, 9, 10, 11, 12, 13, 14, tzinfo=OperandDependentOffset())
+ d0 = base.replace(minute=3)
+ d1 = base.replace(minute=9)
+ d2 = base.replace(minute=11)
+ for x in d0, d1, d2:
+ for y in d0, d1, d2:
+ got = x - y
+ expected = timedelta(minutes=x.minute - y.minute)
+ self.assertEqual(got, expected)
+
+ # OTOH, if the tzinfo members are distinct, utcoffsets aren't
+ # ignored.
+ base = cls(8, 9, 10, 11, 12, 13, 14)
+ d0 = base.replace(minute=3, tzinfo=OperandDependentOffset())
+ d1 = base.replace(minute=9, tzinfo=OperandDependentOffset())
+ d2 = base.replace(minute=11, tzinfo=OperandDependentOffset())
+ for x in d0, d1, d2:
+ for y in d0, d1, d2:
+ got = x - y
+ if (x is d0 or x is d1) and (y is d0 or y is d1):
+ expected = timedelta(0)
+ elif x is y is d2:
+ expected = timedelta(0)
+ elif x is d2:
+ expected = timedelta(minutes=(11-59)-0)
+ else:
+ assert y is d2
+ expected = timedelta(minutes=0-(11-59))
+ self.assertEqual(got, expected)
+
+ def test_mixed_compare(self):
+ t1 = datetime(1, 2, 3, 4, 5, 6, 7)
+ t2 = datetime(1, 2, 3, 4, 5, 6, 7)
+ self.assertEqual(t1, t2)
+ t2 = t2.replace(tzinfo=None)
+ self.assertEqual(t1, t2)
+ t2 = t2.replace(tzinfo=FixedOffset(None, ""))
+ self.assertEqual(t1, t2)
+ t2 = t2.replace(tzinfo=FixedOffset(0, ""))
+ self.assertRaises(TypeError, lambda: t1 == t2)
+
+ # In datetime w/ identical tzinfo objects, utcoffset is ignored.
+ class Varies(tzinfo):
+ def __init__(self):
+ self.offset = timedelta(minutes=22)
+ def utcoffset(self, t):
+ self.offset += timedelta(minutes=1)
+ return self.offset
+
+ v = Varies()
+ t1 = t2.replace(tzinfo=v)
+ t2 = t2.replace(tzinfo=v)
+ self.assertEqual(t1.utcoffset(), timedelta(minutes=23))
+ self.assertEqual(t2.utcoffset(), timedelta(minutes=24))
+ self.assertEqual(t1, t2)
+
+ # But if they're not identical, it isn't ignored.
+ t2 = t2.replace(tzinfo=Varies())
+ self.assertTrue(t1 < t2) # t1's offset counter still going up
+
+ def test_subclass_datetimetz(self):
+
+ class C(self.theclass):
+ theAnswer = 42
+
+ def __new__(cls, *args, **kws):
+ temp = kws.copy()
+ extra = temp.pop('extra')
+ result = self.theclass.__new__(cls, *args, **temp)
+ result.extra = extra
+ return result
+
+ def newmeth(self, start):
+ return start + self.hour + self.year
+
+ args = 2002, 12, 31, 4, 5, 6, 500, FixedOffset(-300, "EST", 1)
+
+ dt1 = self.theclass(*args)
+ dt2 = C(*args, **{'extra': 7})
+
+ self.assertEqual(dt2.__class__, C)
+ self.assertEqual(dt2.theAnswer, 42)
+ self.assertEqual(dt2.extra, 7)
+ self.assertEqual(dt1.utcoffset(), dt2.utcoffset())
+ self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.year - 7)
+
+# Pain to set up DST-aware tzinfo classes.
+
+def first_sunday_on_or_after(dt):
+ days_to_go = 6 - dt.weekday()
+ if days_to_go:
+ dt += timedelta(days_to_go)
+ return dt
+
+ZERO = timedelta(0)
+MINUTE = timedelta(minutes=1)
+HOUR = timedelta(hours=1)
+DAY = timedelta(days=1)
+# In the US, DST starts at 2am (standard time) on the first Sunday in April.
+DSTSTART = datetime(1, 4, 1, 2)
+# and ends at 2am (DST time; 1am standard time) on the last Sunday of Oct,
+# which is the first Sunday on or after Oct 25. Because we view 1:MM as
+# being standard time on that day, there is no spelling in local time of
+# the last hour of DST (that's 1:MM DST, but 1:MM is taken as standard time).
+DSTEND = datetime(1, 10, 25, 1)
+
+class USTimeZone(tzinfo):
+
+ def __init__(self, hours, reprname, stdname, dstname):
+ self.stdoffset = timedelta(hours=hours)
+ self.reprname = reprname
+ self.stdname = stdname
+ self.dstname = dstname
+
+ def __repr__(self):
+ return self.reprname
+
+ def tzname(self, dt):
+ if self.dst(dt):
+ return self.dstname
+ else:
+ return self.stdname
+
+ def utcoffset(self, dt):
+ return self.stdoffset + self.dst(dt)
+
+ def dst(self, dt):
+ if dt is None or dt.tzinfo is None:
+ # An exception instead may be sensible here, in one or more of
+ # the cases.
+ return ZERO
+ assert dt.tzinfo is self
+
+ # Find first Sunday in April.
+ start = first_sunday_on_or_after(DSTSTART.replace(year=dt.year))
+ assert start.weekday() == 6 and start.month == 4 and start.day <= 7
+
+ # Find last Sunday in October.
+ end = first_sunday_on_or_after(DSTEND.replace(year=dt.year))
+ assert end.weekday() == 6 and end.month == 10 and end.day >= 25
+
+ # Can't compare naive to aware objects, so strip the timezone from
+ # dt first.
+ if start <= dt.replace(tzinfo=None) < end:
+ return HOUR
+ else:
+ return ZERO
+
+Eastern = USTimeZone(-5, "Eastern", "EST", "EDT")
+Central = USTimeZone(-6, "Central", "CST", "CDT")
+Mountain = USTimeZone(-7, "Mountain", "MST", "MDT")
+Pacific = USTimeZone(-8, "Pacific", "PST", "PDT")
+utc_real = FixedOffset(0, "UTC", 0)
+# For better test coverage, we want another flavor of UTC that's west of
+# the Eastern and Pacific timezones.
+utc_fake = FixedOffset(-12*60, "UTCfake", 0)
+
+class TestTimezoneConversions(unittest.TestCase):
+ # The DST switch times for 2002, in std time.
+ dston = datetime(2002, 4, 7, 2)
+ dstoff = datetime(2002, 10, 27, 1)
+
+ theclass = datetime
+
+ # Check a time that's inside DST.
+ def checkinside(self, dt, tz, utc, dston, dstoff):
+ self.assertEqual(dt.dst(), HOUR)
+
+ # Conversion to our own timezone is always an identity.
+ self.assertEqual(dt.astimezone(tz), dt)
+
+ asutc = dt.astimezone(utc)
+ there_and_back = asutc.astimezone(tz)
+
+ # Conversion to UTC and back isn't always an identity here,
+ # because there are redundant spellings (in local time) of
+ # UTC time when DST begins: the clock jumps from 1:59:59
+ # to 3:00:00, and a local time of 2:MM:SS doesn't really
+ # make sense then. The classes above treat 2:MM:SS as
+ # daylight time then (it's "after 2am"), really an alias
+ # for 1:MM:SS standard time. The latter form is what
+ # conversion back from UTC produces.
+ if dt.date() == dston.date() and dt.hour == 2:
+ # We're in the redundant hour, and coming back from
+ # UTC gives the 1:MM:SS standard-time spelling.
+ self.assertEqual(there_and_back + HOUR, dt)
+ # Although during was considered to be in daylight
+ # time, there_and_back is not.
+ self.assertEqual(there_and_back.dst(), ZERO)
+ # They're the same times in UTC.
+ self.assertEqual(there_and_back.astimezone(utc),
+ dt.astimezone(utc))
+ else:
+ # We're not in the redundant hour.
+ self.assertEqual(dt, there_and_back)
+
+ # Because we have a redundant spelling when DST begins, there is
+ # (unfortunately) an hour when DST ends that can't be spelled at all in
+ # local time. When DST ends, the clock jumps from 1:59 back to 1:00
+ # again. The hour 1:MM DST has no spelling then: 1:MM is taken to be
+ # standard time. 1:MM DST == 0:MM EST, but 0:MM is taken to be
+ # daylight time. The hour 1:MM daylight == 0:MM standard can't be
+ # expressed in local time. Nevertheless, we want conversion back
+ # from UTC to mimic the local clock's "repeat an hour" behavior.
+ nexthour_utc = asutc + HOUR
+ nexthour_tz = nexthour_utc.astimezone(tz)
+ if dt.date() == dstoff.date() and dt.hour == 0:
+ # We're in the hour before the last DST hour. The last DST hour
+ # is ineffable. We want the conversion back to repeat 1:MM.
+ self.assertEqual(nexthour_tz, dt.replace(hour=1))
+ nexthour_utc += HOUR
+ nexthour_tz = nexthour_utc.astimezone(tz)
+ self.assertEqual(nexthour_tz, dt.replace(hour=1))
+ else:
+ self.assertEqual(nexthour_tz - dt, HOUR)
+
+ # Check a time that's outside DST.
+ def checkoutside(self, dt, tz, utc):
+ self.assertEqual(dt.dst(), ZERO)
+
+ # Conversion to our own timezone is always an identity.
+ self.assertEqual(dt.astimezone(tz), dt)
+
+ # Converting to UTC and back is an identity too.
+ asutc = dt.astimezone(utc)
+ there_and_back = asutc.astimezone(tz)
+ self.assertEqual(dt, there_and_back)
+
+ def convert_between_tz_and_utc(self, tz, utc):
+ dston = self.dston.replace(tzinfo=tz)
+ # Because 1:MM on the day DST ends is taken as being standard time,
+ # there is no spelling in tz for the last hour of daylight time.
+ # For purposes of the test, the last hour of DST is 0:MM, which is
+ # taken as being daylight time (and 1:MM is taken as being standard
+ # time).
+ dstoff = self.dstoff.replace(tzinfo=tz)
+ for delta in (timedelta(weeks=13),
+ DAY,
+ HOUR,
+ timedelta(minutes=1),
+ timedelta(microseconds=1)):
+
+ self.checkinside(dston, tz, utc, dston, dstoff)
+ for during in dston + delta, dstoff - delta:
+ self.checkinside(during, tz, utc, dston, dstoff)
+
+ self.checkoutside(dstoff, tz, utc)
+ for outside in dston - delta, dstoff + delta:
+ self.checkoutside(outside, tz, utc)
+
+ def test_easy(self):
+ # Despite the name of this test, the endcases are excruciating.
+ self.convert_between_tz_and_utc(Eastern, utc_real)
+ self.convert_between_tz_and_utc(Pacific, utc_real)
+ self.convert_between_tz_and_utc(Eastern, utc_fake)
+ self.convert_between_tz_and_utc(Pacific, utc_fake)
+ # The next is really dancing near the edge. It works because
+ # Pacific and Eastern are far enough apart that their "problem
+ # hours" don't overlap.
+ self.convert_between_tz_and_utc(Eastern, Pacific)
+ self.convert_between_tz_and_utc(Pacific, Eastern)
+ # OTOH, these fail! Don't enable them. The difficulty is that
+ # the edge case tests assume that every hour is representable in
+ # the "utc" class. This is always true for a fixed-offset tzinfo
+ # class (lke utc_real and utc_fake), but not for Eastern or Central.
+ # For these adjacent DST-aware time zones, the range of time offsets
+ # tested ends up creating hours in the one that aren't representable
+ # in the other. For the same reason, we would see failures in the
+ # Eastern vs Pacific tests too if we added 3*HOUR to the list of
+ # offset deltas in convert_between_tz_and_utc().
+ #
+ # self.convert_between_tz_and_utc(Eastern, Central) # can't work
+ # self.convert_between_tz_and_utc(Central, Eastern) # can't work
+
+ def test_tricky(self):
+ # 22:00 on day before daylight starts.
+ fourback = self.dston - timedelta(hours=4)
+ ninewest = FixedOffset(-9*60, "-0900", 0)
+ fourback = fourback.replace(tzinfo=ninewest)
+ # 22:00-0900 is 7:00 UTC == 2:00 EST == 3:00 DST. Since it's "after
+ # 2", we should get the 3 spelling.
+ # If we plug 22:00 the day before into Eastern, it "looks like std
+ # time", so its offset is returned as -5, and -5 - -9 = 4. Adding 4
+ # to 22:00 lands on 2:00, which makes no sense in local time (the
+ # local clock jumps from 1 to 3). The point here is to make sure we
+ # get the 3 spelling.
+ expected = self.dston.replace(hour=3)
+ got = fourback.astimezone(Eastern).replace(tzinfo=None)
+ self.assertEqual(expected, got)
+
+ # Similar, but map to 6:00 UTC == 1:00 EST == 2:00 DST. In that
+ # case we want the 1:00 spelling.
+ sixutc = self.dston.replace(hour=6, tzinfo=utc_real)
+ # Now 6:00 "looks like daylight", so the offset wrt Eastern is -4,
+ # and adding -4-0 == -4 gives the 2:00 spelling. We want the 1:00 EST
+ # spelling.
+ expected = self.dston.replace(hour=1)
+ got = sixutc.astimezone(Eastern).replace(tzinfo=None)
+ self.assertEqual(expected, got)
+
+ # Now on the day DST ends, we want "repeat an hour" behavior.
+ # UTC 4:MM 5:MM 6:MM 7:MM checking these
+ # EST 23:MM 0:MM 1:MM 2:MM
+ # EDT 0:MM 1:MM 2:MM 3:MM
+ # wall 0:MM 1:MM 1:MM 2:MM against these
+ for utc in utc_real, utc_fake:
+ for tz in Eastern, Pacific:
+ first_std_hour = self.dstoff - timedelta(hours=2) # 23:MM
+ # Convert that to UTC.
+ first_std_hour -= tz.utcoffset(None)
+ # Adjust for possibly fake UTC.
+ asutc = first_std_hour + utc.utcoffset(None)
+ # First UTC hour to convert; this is 4:00 when utc=utc_real &
+ # tz=Eastern.
+ asutcbase = asutc.replace(tzinfo=utc)
+ for tzhour in (0, 1, 1, 2):
+ expectedbase = self.dstoff.replace(hour=tzhour)
+ for minute in 0, 30, 59:
+ expected = expectedbase.replace(minute=minute)
+ asutc = asutcbase.replace(minute=minute)
+ astz = asutc.astimezone(tz)
+ self.assertEqual(astz.replace(tzinfo=None), expected)
+ asutcbase += HOUR
+
+
+ def test_bogus_dst(self):
+ class ok(tzinfo):
+ def utcoffset(self, dt): return HOUR
+ def dst(self, dt): return HOUR
+
+ now = self.theclass.now().replace(tzinfo=utc_real)
+ # Doesn't blow up.
+ now.astimezone(ok())
+
+ # Does blow up.
+ class notok(ok):
+ def dst(self, dt): return None
+ self.assertRaises(ValueError, now.astimezone, notok())
+
+ # Sometimes blow up. In the following, tzinfo.dst()
+ # implementation may return None or not None depending on
+ # whether DST is assumed to be in effect. In this situation,
+ # a ValueError should be raised by astimezone().
+ class tricky_notok(ok):
+ def dst(self, dt):
+ if dt.year == 2000:
+ return None
+ else:
+ return 10*HOUR
+ dt = self.theclass(2001, 1, 1).replace(tzinfo=utc_real)
+ self.assertRaises(ValueError, dt.astimezone, tricky_notok())
+
+ def test_fromutc(self):
+ self.assertRaises(TypeError, Eastern.fromutc) # not enough args
+ now = datetime.utcnow().replace(tzinfo=utc_real)
+ self.assertRaises(ValueError, Eastern.fromutc, now) # wrong tzinfo
+ now = now.replace(tzinfo=Eastern) # insert correct tzinfo
+ enow = Eastern.fromutc(now) # doesn't blow up
+ self.assertEqual(enow.tzinfo, Eastern) # has right tzinfo member
+ self.assertRaises(TypeError, Eastern.fromutc, now, now) # too many args
+ self.assertRaises(TypeError, Eastern.fromutc, date.today()) # wrong type
+
+ # Always converts UTC to standard time.
+ class FauxUSTimeZone(USTimeZone):
+ def fromutc(self, dt):
+ return dt + self.stdoffset
+ FEastern = FauxUSTimeZone(-5, "FEastern", "FEST", "FEDT")
+
+ # UTC 4:MM 5:MM 6:MM 7:MM 8:MM 9:MM
+ # EST 23:MM 0:MM 1:MM 2:MM 3:MM 4:MM
+ # EDT 0:MM 1:MM 2:MM 3:MM 4:MM 5:MM
+
+ # Check around DST start.
+ start = self.dston.replace(hour=4, tzinfo=Eastern)
+ fstart = start.replace(tzinfo=FEastern)
+ for wall in 23, 0, 1, 3, 4, 5:
+ expected = start.replace(hour=wall)
+ if wall == 23:
+ expected -= timedelta(days=1)
+ got = Eastern.fromutc(start)
+ self.assertEqual(expected, got)
+
+ expected = fstart + FEastern.stdoffset
+ got = FEastern.fromutc(fstart)
+ self.assertEqual(expected, got)
+
+ # Ensure astimezone() calls fromutc() too.
+ got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
+ self.assertEqual(expected, got)
+
+ start += HOUR
+ fstart += HOUR
+
+ # Check around DST end.
+ start = self.dstoff.replace(hour=4, tzinfo=Eastern)
+ fstart = start.replace(tzinfo=FEastern)
+ for wall in 0, 1, 1, 2, 3, 4:
+ expected = start.replace(hour=wall)
+ got = Eastern.fromutc(start)
+ self.assertEqual(expected, got)
+
+ expected = fstart + FEastern.stdoffset
+ got = FEastern.fromutc(fstart)
+ self.assertEqual(expected, got)
+
+ # Ensure astimezone() calls fromutc() too.
+ got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
+ self.assertEqual(expected, got)
+
+ start += HOUR
+ fstart += HOUR
+
+
+#############################################################################
+# oddballs
+
+class Oddballs(unittest.TestCase):
+
+ def test_bug_1028306(self):
+ # Trying to compare a date to a datetime should act like a mixed-
+ # type comparison, despite that datetime is a subclass of date.
+ as_date = date.today()
+ as_datetime = datetime.combine(as_date, time())
+ self.assertTrue(as_date != as_datetime)
+ self.assertTrue(as_datetime != as_date)
+ self.assertTrue(not as_date == as_datetime)
+ self.assertTrue(not as_datetime == as_date)
+ self.assertRaises(TypeError, lambda: as_date < as_datetime)
+ self.assertRaises(TypeError, lambda: as_datetime < as_date)
+ self.assertRaises(TypeError, lambda: as_date <= as_datetime)
+ self.assertRaises(TypeError, lambda: as_datetime <= as_date)
+ self.assertRaises(TypeError, lambda: as_date > as_datetime)
+ self.assertRaises(TypeError, lambda: as_datetime > as_date)
+ self.assertRaises(TypeError, lambda: as_date >= as_datetime)
+ self.assertRaises(TypeError, lambda: as_datetime >= as_date)
+
+ # Neverthelss, comparison should work with the base-class (date)
+ # projection if use of a date method is forced.
+ self.assertEqual(as_date.__eq__(as_datetime), True)
+ different_day = (as_date.day + 1) % 20 + 1
+ as_different = as_datetime.replace(day= different_day)
+ self.assertEqual(as_date.__eq__(as_different), False)
+
+ # And date should compare with other subclasses of date. If a
+ # subclass wants to stop this, it's up to the subclass to do so.
+ date_sc = SubclassDate(as_date.year, as_date.month, as_date.day)
+ self.assertEqual(as_date, date_sc)
+ self.assertEqual(date_sc, as_date)
+
+ # Ditto for datetimes.
+ datetime_sc = SubclassDatetime(as_datetime.year, as_datetime.month,
+ as_date.day, 0, 0, 0)
+ self.assertEqual(as_datetime, datetime_sc)
+ self.assertEqual(datetime_sc, as_datetime)
+
+def test_main():
+ support.run_unittest(__name__)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/decimaltestdata/and.decTest b/Lib/test/decimaltestdata/and.decTest
index a0cc786516..e912394877 100644
--- a/Lib/test/decimaltestdata/and.decTest
+++ b/Lib/test/decimaltestdata/and.decTest
@@ -1,338 +1,338 @@
-------------------------------------------------------------------------
--- and.decTest -- digitwise logical AND --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check (truth table)
-andx001 and 0 0 -> 0
-andx002 and 0 1 -> 0
-andx003 and 1 0 -> 0
-andx004 and 1 1 -> 1
-andx005 and 1100 1010 -> 1000
-andx006 and 1111 10 -> 10
-andx007 and 1111 1010 -> 1010
-
--- and at msd and msd-1
-andx010 and 000000000 000000000 -> 0
-andx011 and 000000000 100000000 -> 0
-andx012 and 100000000 000000000 -> 0
-andx013 and 100000000 100000000 -> 100000000
-andx014 and 000000000 000000000 -> 0
-andx015 and 000000000 010000000 -> 0
-andx016 and 010000000 000000000 -> 0
-andx017 and 010000000 010000000 -> 10000000
-
--- Various lengths
--- 123456789 123456789 123456789
-andx021 and 111111111 111111111 -> 111111111
-andx022 and 111111111111 111111111 -> 111111111
-andx023 and 111111111111 11111111 -> 11111111
-andx024 and 111111111 11111111 -> 11111111
-andx025 and 111111111 1111111 -> 1111111
-andx026 and 111111111111 111111 -> 111111
-andx027 and 111111111111 11111 -> 11111
-andx028 and 111111111111 1111 -> 1111
-andx029 and 111111111111 111 -> 111
-andx031 and 111111111111 11 -> 11
-andx032 and 111111111111 1 -> 1
-andx033 and 111111111111 1111111111 -> 111111111
-andx034 and 11111111111 11111111111 -> 111111111
-andx035 and 1111111111 111111111111 -> 111111111
-andx036 and 111111111 1111111111111 -> 111111111
-
-andx040 and 111111111 111111111111 -> 111111111
-andx041 and 11111111 111111111111 -> 11111111
-andx042 and 11111111 111111111 -> 11111111
-andx043 and 1111111 111111111 -> 1111111
-andx044 and 111111 111111111 -> 111111
-andx045 and 11111 111111111 -> 11111
-andx046 and 1111 111111111 -> 1111
-andx047 and 111 111111111 -> 111
-andx048 and 11 111111111 -> 11
-andx049 and 1 111111111 -> 1
-
-andx050 and 1111111111 1 -> 1
-andx051 and 111111111 1 -> 1
-andx052 and 11111111 1 -> 1
-andx053 and 1111111 1 -> 1
-andx054 and 111111 1 -> 1
-andx055 and 11111 1 -> 1
-andx056 and 1111 1 -> 1
-andx057 and 111 1 -> 1
-andx058 and 11 1 -> 1
-andx059 and 1 1 -> 1
-
-andx060 and 1111111111 0 -> 0
-andx061 and 111111111 0 -> 0
-andx062 and 11111111 0 -> 0
-andx063 and 1111111 0 -> 0
-andx064 and 111111 0 -> 0
-andx065 and 11111 0 -> 0
-andx066 and 1111 0 -> 0
-andx067 and 111 0 -> 0
-andx068 and 11 0 -> 0
-andx069 and 1 0 -> 0
-
-andx070 and 1 1111111111 -> 1
-andx071 and 1 111111111 -> 1
-andx072 and 1 11111111 -> 1
-andx073 and 1 1111111 -> 1
-andx074 and 1 111111 -> 1
-andx075 and 1 11111 -> 1
-andx076 and 1 1111 -> 1
-andx077 and 1 111 -> 1
-andx078 and 1 11 -> 1
-andx079 and 1 1 -> 1
-
-andx080 and 0 1111111111 -> 0
-andx081 and 0 111111111 -> 0
-andx082 and 0 11111111 -> 0
-andx083 and 0 1111111 -> 0
-andx084 and 0 111111 -> 0
-andx085 and 0 11111 -> 0
-andx086 and 0 1111 -> 0
-andx087 and 0 111 -> 0
-andx088 and 0 11 -> 0
-andx089 and 0 1 -> 0
-
-andx090 and 011111111 111111111 -> 11111111
-andx091 and 101111111 111111111 -> 101111111
-andx092 and 110111111 111111111 -> 110111111
-andx093 and 111011111 111111111 -> 111011111
-andx094 and 111101111 111111111 -> 111101111
-andx095 and 111110111 111111111 -> 111110111
-andx096 and 111111011 111111111 -> 111111011
-andx097 and 111111101 111111111 -> 111111101
-andx098 and 111111110 111111111 -> 111111110
-
-andx100 and 111111111 011111111 -> 11111111
-andx101 and 111111111 101111111 -> 101111111
-andx102 and 111111111 110111111 -> 110111111
-andx103 and 111111111 111011111 -> 111011111
-andx104 and 111111111 111101111 -> 111101111
-andx105 and 111111111 111110111 -> 111110111
-andx106 and 111111111 111111011 -> 111111011
-andx107 and 111111111 111111101 -> 111111101
-andx108 and 111111111 111111110 -> 111111110
-
--- non-0/1 should not be accepted, nor should signs
-andx220 and 111111112 111111111 -> NaN Invalid_operation
-andx221 and 333333333 333333333 -> NaN Invalid_operation
-andx222 and 555555555 555555555 -> NaN Invalid_operation
-andx223 and 777777777 777777777 -> NaN Invalid_operation
-andx224 and 999999999 999999999 -> NaN Invalid_operation
-andx225 and 222222222 999999999 -> NaN Invalid_operation
-andx226 and 444444444 999999999 -> NaN Invalid_operation
-andx227 and 666666666 999999999 -> NaN Invalid_operation
-andx228 and 888888888 999999999 -> NaN Invalid_operation
-andx229 and 999999999 222222222 -> NaN Invalid_operation
-andx230 and 999999999 444444444 -> NaN Invalid_operation
-andx231 and 999999999 666666666 -> NaN Invalid_operation
-andx232 and 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-andx240 and 567468689 -934981942 -> NaN Invalid_operation
-andx241 and 567367689 934981942 -> NaN Invalid_operation
-andx242 and -631917772 -706014634 -> NaN Invalid_operation
-andx243 and -756253257 138579234 -> NaN Invalid_operation
-andx244 and 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-andx250 and 200000000 100000000 -> NaN Invalid_operation
-andx251 and 700000000 100000000 -> NaN Invalid_operation
-andx252 and 800000000 100000000 -> NaN Invalid_operation
-andx253 and 900000000 100000000 -> NaN Invalid_operation
-andx254 and 200000000 000000000 -> NaN Invalid_operation
-andx255 and 700000000 000000000 -> NaN Invalid_operation
-andx256 and 800000000 000000000 -> NaN Invalid_operation
-andx257 and 900000000 000000000 -> NaN Invalid_operation
-andx258 and 100000000 200000000 -> NaN Invalid_operation
-andx259 and 100000000 700000000 -> NaN Invalid_operation
-andx260 and 100000000 800000000 -> NaN Invalid_operation
-andx261 and 100000000 900000000 -> NaN Invalid_operation
-andx262 and 000000000 200000000 -> NaN Invalid_operation
-andx263 and 000000000 700000000 -> NaN Invalid_operation
-andx264 and 000000000 800000000 -> NaN Invalid_operation
-andx265 and 000000000 900000000 -> NaN Invalid_operation
--- test MSD-1
-andx270 and 020000000 100000000 -> NaN Invalid_operation
-andx271 and 070100000 100000000 -> NaN Invalid_operation
-andx272 and 080010000 100000001 -> NaN Invalid_operation
-andx273 and 090001000 100000010 -> NaN Invalid_operation
-andx274 and 100000100 020010100 -> NaN Invalid_operation
-andx275 and 100000000 070001000 -> NaN Invalid_operation
-andx276 and 100000010 080010100 -> NaN Invalid_operation
-andx277 and 100000000 090000010 -> NaN Invalid_operation
--- test LSD
-andx280 and 001000002 100000000 -> NaN Invalid_operation
-andx281 and 000000007 100000000 -> NaN Invalid_operation
-andx282 and 000000008 100000000 -> NaN Invalid_operation
-andx283 and 000000009 100000000 -> NaN Invalid_operation
-andx284 and 100000000 000100002 -> NaN Invalid_operation
-andx285 and 100100000 001000007 -> NaN Invalid_operation
-andx286 and 100010000 010000008 -> NaN Invalid_operation
-andx287 and 100001000 100000009 -> NaN Invalid_operation
--- test Middie
-andx288 and 001020000 100000000 -> NaN Invalid_operation
-andx289 and 000070001 100000000 -> NaN Invalid_operation
-andx290 and 000080000 100010000 -> NaN Invalid_operation
-andx291 and 000090000 100001000 -> NaN Invalid_operation
-andx292 and 100000010 000020100 -> NaN Invalid_operation
-andx293 and 100100000 000070010 -> NaN Invalid_operation
-andx294 and 100010100 000080001 -> NaN Invalid_operation
-andx295 and 100001000 000090000 -> NaN Invalid_operation
--- signs
-andx296 and -100001000 -000000000 -> NaN Invalid_operation
-andx297 and -100001000 000010000 -> NaN Invalid_operation
-andx298 and 100001000 -000000000 -> NaN Invalid_operation
-andx299 and 100001000 000011000 -> 1000
-
--- Nmax, Nmin, Ntiny
-andx331 and 2 9.99999999E+999 -> NaN Invalid_operation
-andx332 and 3 1E-999 -> NaN Invalid_operation
-andx333 and 4 1.00000000E-999 -> NaN Invalid_operation
-andx334 and 5 1E-1007 -> NaN Invalid_operation
-andx335 and 6 -1E-1007 -> NaN Invalid_operation
-andx336 and 7 -1.00000000E-999 -> NaN Invalid_operation
-andx337 and 8 -1E-999 -> NaN Invalid_operation
-andx338 and 9 -9.99999999E+999 -> NaN Invalid_operation
-andx341 and 9.99999999E+999 -18 -> NaN Invalid_operation
-andx342 and 1E-999 01 -> NaN Invalid_operation
-andx343 and 1.00000000E-999 -18 -> NaN Invalid_operation
-andx344 and 1E-1007 18 -> NaN Invalid_operation
-andx345 and -1E-1007 -10 -> NaN Invalid_operation
-andx346 and -1.00000000E-999 18 -> NaN Invalid_operation
-andx347 and -1E-999 10 -> NaN Invalid_operation
-andx348 and -9.99999999E+999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-andx361 and 1.0 1 -> NaN Invalid_operation
-andx362 and 1E+1 1 -> NaN Invalid_operation
-andx363 and 0.0 1 -> NaN Invalid_operation
-andx364 and 0E+1 1 -> NaN Invalid_operation
-andx365 and 9.9 1 -> NaN Invalid_operation
-andx366 and 9E+1 1 -> NaN Invalid_operation
-andx371 and 0 1.0 -> NaN Invalid_operation
-andx372 and 0 1E+1 -> NaN Invalid_operation
-andx373 and 0 0.0 -> NaN Invalid_operation
-andx374 and 0 0E+1 -> NaN Invalid_operation
-andx375 and 0 9.9 -> NaN Invalid_operation
-andx376 and 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-andx780 and -Inf -Inf -> NaN Invalid_operation
-andx781 and -Inf -1000 -> NaN Invalid_operation
-andx782 and -Inf -1 -> NaN Invalid_operation
-andx783 and -Inf -0 -> NaN Invalid_operation
-andx784 and -Inf 0 -> NaN Invalid_operation
-andx785 and -Inf 1 -> NaN Invalid_operation
-andx786 and -Inf 1000 -> NaN Invalid_operation
-andx787 and -1000 -Inf -> NaN Invalid_operation
-andx788 and -Inf -Inf -> NaN Invalid_operation
-andx789 and -1 -Inf -> NaN Invalid_operation
-andx790 and -0 -Inf -> NaN Invalid_operation
-andx791 and 0 -Inf -> NaN Invalid_operation
-andx792 and 1 -Inf -> NaN Invalid_operation
-andx793 and 1000 -Inf -> NaN Invalid_operation
-andx794 and Inf -Inf -> NaN Invalid_operation
-
-andx800 and Inf -Inf -> NaN Invalid_operation
-andx801 and Inf -1000 -> NaN Invalid_operation
-andx802 and Inf -1 -> NaN Invalid_operation
-andx803 and Inf -0 -> NaN Invalid_operation
-andx804 and Inf 0 -> NaN Invalid_operation
-andx805 and Inf 1 -> NaN Invalid_operation
-andx806 and Inf 1000 -> NaN Invalid_operation
-andx807 and Inf Inf -> NaN Invalid_operation
-andx808 and -1000 Inf -> NaN Invalid_operation
-andx809 and -Inf Inf -> NaN Invalid_operation
-andx810 and -1 Inf -> NaN Invalid_operation
-andx811 and -0 Inf -> NaN Invalid_operation
-andx812 and 0 Inf -> NaN Invalid_operation
-andx813 and 1 Inf -> NaN Invalid_operation
-andx814 and 1000 Inf -> NaN Invalid_operation
-andx815 and Inf Inf -> NaN Invalid_operation
-
-andx821 and NaN -Inf -> NaN Invalid_operation
-andx822 and NaN -1000 -> NaN Invalid_operation
-andx823 and NaN -1 -> NaN Invalid_operation
-andx824 and NaN -0 -> NaN Invalid_operation
-andx825 and NaN 0 -> NaN Invalid_operation
-andx826 and NaN 1 -> NaN Invalid_operation
-andx827 and NaN 1000 -> NaN Invalid_operation
-andx828 and NaN Inf -> NaN Invalid_operation
-andx829 and NaN NaN -> NaN Invalid_operation
-andx830 and -Inf NaN -> NaN Invalid_operation
-andx831 and -1000 NaN -> NaN Invalid_operation
-andx832 and -1 NaN -> NaN Invalid_operation
-andx833 and -0 NaN -> NaN Invalid_operation
-andx834 and 0 NaN -> NaN Invalid_operation
-andx835 and 1 NaN -> NaN Invalid_operation
-andx836 and 1000 NaN -> NaN Invalid_operation
-andx837 and Inf NaN -> NaN Invalid_operation
-
-andx841 and sNaN -Inf -> NaN Invalid_operation
-andx842 and sNaN -1000 -> NaN Invalid_operation
-andx843 and sNaN -1 -> NaN Invalid_operation
-andx844 and sNaN -0 -> NaN Invalid_operation
-andx845 and sNaN 0 -> NaN Invalid_operation
-andx846 and sNaN 1 -> NaN Invalid_operation
-andx847 and sNaN 1000 -> NaN Invalid_operation
-andx848 and sNaN NaN -> NaN Invalid_operation
-andx849 and sNaN sNaN -> NaN Invalid_operation
-andx850 and NaN sNaN -> NaN Invalid_operation
-andx851 and -Inf sNaN -> NaN Invalid_operation
-andx852 and -1000 sNaN -> NaN Invalid_operation
-andx853 and -1 sNaN -> NaN Invalid_operation
-andx854 and -0 sNaN -> NaN Invalid_operation
-andx855 and 0 sNaN -> NaN Invalid_operation
-andx856 and 1 sNaN -> NaN Invalid_operation
-andx857 and 1000 sNaN -> NaN Invalid_operation
-andx858 and Inf sNaN -> NaN Invalid_operation
-andx859 and NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-andx861 and NaN1 -Inf -> NaN Invalid_operation
-andx862 and +NaN2 -1000 -> NaN Invalid_operation
-andx863 and NaN3 1000 -> NaN Invalid_operation
-andx864 and NaN4 Inf -> NaN Invalid_operation
-andx865 and NaN5 +NaN6 -> NaN Invalid_operation
-andx866 and -Inf NaN7 -> NaN Invalid_operation
-andx867 and -1000 NaN8 -> NaN Invalid_operation
-andx868 and 1000 NaN9 -> NaN Invalid_operation
-andx869 and Inf +NaN10 -> NaN Invalid_operation
-andx871 and sNaN11 -Inf -> NaN Invalid_operation
-andx872 and sNaN12 -1000 -> NaN Invalid_operation
-andx873 and sNaN13 1000 -> NaN Invalid_operation
-andx874 and sNaN14 NaN17 -> NaN Invalid_operation
-andx875 and sNaN15 sNaN18 -> NaN Invalid_operation
-andx876 and NaN16 sNaN19 -> NaN Invalid_operation
-andx877 and -Inf +sNaN20 -> NaN Invalid_operation
-andx878 and -1000 sNaN21 -> NaN Invalid_operation
-andx879 and 1000 sNaN22 -> NaN Invalid_operation
-andx880 and Inf sNaN23 -> NaN Invalid_operation
-andx881 and +NaN25 +sNaN24 -> NaN Invalid_operation
-andx882 and -NaN26 NaN28 -> NaN Invalid_operation
-andx883 and -sNaN27 sNaN29 -> NaN Invalid_operation
-andx884 and 1000 -NaN30 -> NaN Invalid_operation
-andx885 and 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- and.decTest -- digitwise logical AND --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check (truth table)
+andx001 and 0 0 -> 0
+andx002 and 0 1 -> 0
+andx003 and 1 0 -> 0
+andx004 and 1 1 -> 1
+andx005 and 1100 1010 -> 1000
+andx006 and 1111 10 -> 10
+andx007 and 1111 1010 -> 1010
+
+-- and at msd and msd-1
+andx010 and 000000000 000000000 -> 0
+andx011 and 000000000 100000000 -> 0
+andx012 and 100000000 000000000 -> 0
+andx013 and 100000000 100000000 -> 100000000
+andx014 and 000000000 000000000 -> 0
+andx015 and 000000000 010000000 -> 0
+andx016 and 010000000 000000000 -> 0
+andx017 and 010000000 010000000 -> 10000000
+
+-- Various lengths
+-- 123456789 123456789 123456789
+andx021 and 111111111 111111111 -> 111111111
+andx022 and 111111111111 111111111 -> 111111111
+andx023 and 111111111111 11111111 -> 11111111
+andx024 and 111111111 11111111 -> 11111111
+andx025 and 111111111 1111111 -> 1111111
+andx026 and 111111111111 111111 -> 111111
+andx027 and 111111111111 11111 -> 11111
+andx028 and 111111111111 1111 -> 1111
+andx029 and 111111111111 111 -> 111
+andx031 and 111111111111 11 -> 11
+andx032 and 111111111111 1 -> 1
+andx033 and 111111111111 1111111111 -> 111111111
+andx034 and 11111111111 11111111111 -> 111111111
+andx035 and 1111111111 111111111111 -> 111111111
+andx036 and 111111111 1111111111111 -> 111111111
+
+andx040 and 111111111 111111111111 -> 111111111
+andx041 and 11111111 111111111111 -> 11111111
+andx042 and 11111111 111111111 -> 11111111
+andx043 and 1111111 111111111 -> 1111111
+andx044 and 111111 111111111 -> 111111
+andx045 and 11111 111111111 -> 11111
+andx046 and 1111 111111111 -> 1111
+andx047 and 111 111111111 -> 111
+andx048 and 11 111111111 -> 11
+andx049 and 1 111111111 -> 1
+
+andx050 and 1111111111 1 -> 1
+andx051 and 111111111 1 -> 1
+andx052 and 11111111 1 -> 1
+andx053 and 1111111 1 -> 1
+andx054 and 111111 1 -> 1
+andx055 and 11111 1 -> 1
+andx056 and 1111 1 -> 1
+andx057 and 111 1 -> 1
+andx058 and 11 1 -> 1
+andx059 and 1 1 -> 1
+
+andx060 and 1111111111 0 -> 0
+andx061 and 111111111 0 -> 0
+andx062 and 11111111 0 -> 0
+andx063 and 1111111 0 -> 0
+andx064 and 111111 0 -> 0
+andx065 and 11111 0 -> 0
+andx066 and 1111 0 -> 0
+andx067 and 111 0 -> 0
+andx068 and 11 0 -> 0
+andx069 and 1 0 -> 0
+
+andx070 and 1 1111111111 -> 1
+andx071 and 1 111111111 -> 1
+andx072 and 1 11111111 -> 1
+andx073 and 1 1111111 -> 1
+andx074 and 1 111111 -> 1
+andx075 and 1 11111 -> 1
+andx076 and 1 1111 -> 1
+andx077 and 1 111 -> 1
+andx078 and 1 11 -> 1
+andx079 and 1 1 -> 1
+
+andx080 and 0 1111111111 -> 0
+andx081 and 0 111111111 -> 0
+andx082 and 0 11111111 -> 0
+andx083 and 0 1111111 -> 0
+andx084 and 0 111111 -> 0
+andx085 and 0 11111 -> 0
+andx086 and 0 1111 -> 0
+andx087 and 0 111 -> 0
+andx088 and 0 11 -> 0
+andx089 and 0 1 -> 0
+
+andx090 and 011111111 111111111 -> 11111111
+andx091 and 101111111 111111111 -> 101111111
+andx092 and 110111111 111111111 -> 110111111
+andx093 and 111011111 111111111 -> 111011111
+andx094 and 111101111 111111111 -> 111101111
+andx095 and 111110111 111111111 -> 111110111
+andx096 and 111111011 111111111 -> 111111011
+andx097 and 111111101 111111111 -> 111111101
+andx098 and 111111110 111111111 -> 111111110
+
+andx100 and 111111111 011111111 -> 11111111
+andx101 and 111111111 101111111 -> 101111111
+andx102 and 111111111 110111111 -> 110111111
+andx103 and 111111111 111011111 -> 111011111
+andx104 and 111111111 111101111 -> 111101111
+andx105 and 111111111 111110111 -> 111110111
+andx106 and 111111111 111111011 -> 111111011
+andx107 and 111111111 111111101 -> 111111101
+andx108 and 111111111 111111110 -> 111111110
+
+-- non-0/1 should not be accepted, nor should signs
+andx220 and 111111112 111111111 -> NaN Invalid_operation
+andx221 and 333333333 333333333 -> NaN Invalid_operation
+andx222 and 555555555 555555555 -> NaN Invalid_operation
+andx223 and 777777777 777777777 -> NaN Invalid_operation
+andx224 and 999999999 999999999 -> NaN Invalid_operation
+andx225 and 222222222 999999999 -> NaN Invalid_operation
+andx226 and 444444444 999999999 -> NaN Invalid_operation
+andx227 and 666666666 999999999 -> NaN Invalid_operation
+andx228 and 888888888 999999999 -> NaN Invalid_operation
+andx229 and 999999999 222222222 -> NaN Invalid_operation
+andx230 and 999999999 444444444 -> NaN Invalid_operation
+andx231 and 999999999 666666666 -> NaN Invalid_operation
+andx232 and 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+andx240 and 567468689 -934981942 -> NaN Invalid_operation
+andx241 and 567367689 934981942 -> NaN Invalid_operation
+andx242 and -631917772 -706014634 -> NaN Invalid_operation
+andx243 and -756253257 138579234 -> NaN Invalid_operation
+andx244 and 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+andx250 and 200000000 100000000 -> NaN Invalid_operation
+andx251 and 700000000 100000000 -> NaN Invalid_operation
+andx252 and 800000000 100000000 -> NaN Invalid_operation
+andx253 and 900000000 100000000 -> NaN Invalid_operation
+andx254 and 200000000 000000000 -> NaN Invalid_operation
+andx255 and 700000000 000000000 -> NaN Invalid_operation
+andx256 and 800000000 000000000 -> NaN Invalid_operation
+andx257 and 900000000 000000000 -> NaN Invalid_operation
+andx258 and 100000000 200000000 -> NaN Invalid_operation
+andx259 and 100000000 700000000 -> NaN Invalid_operation
+andx260 and 100000000 800000000 -> NaN Invalid_operation
+andx261 and 100000000 900000000 -> NaN Invalid_operation
+andx262 and 000000000 200000000 -> NaN Invalid_operation
+andx263 and 000000000 700000000 -> NaN Invalid_operation
+andx264 and 000000000 800000000 -> NaN Invalid_operation
+andx265 and 000000000 900000000 -> NaN Invalid_operation
+-- test MSD-1
+andx270 and 020000000 100000000 -> NaN Invalid_operation
+andx271 and 070100000 100000000 -> NaN Invalid_operation
+andx272 and 080010000 100000001 -> NaN Invalid_operation
+andx273 and 090001000 100000010 -> NaN Invalid_operation
+andx274 and 100000100 020010100 -> NaN Invalid_operation
+andx275 and 100000000 070001000 -> NaN Invalid_operation
+andx276 and 100000010 080010100 -> NaN Invalid_operation
+andx277 and 100000000 090000010 -> NaN Invalid_operation
+-- test LSD
+andx280 and 001000002 100000000 -> NaN Invalid_operation
+andx281 and 000000007 100000000 -> NaN Invalid_operation
+andx282 and 000000008 100000000 -> NaN Invalid_operation
+andx283 and 000000009 100000000 -> NaN Invalid_operation
+andx284 and 100000000 000100002 -> NaN Invalid_operation
+andx285 and 100100000 001000007 -> NaN Invalid_operation
+andx286 and 100010000 010000008 -> NaN Invalid_operation
+andx287 and 100001000 100000009 -> NaN Invalid_operation
+-- test Middie
+andx288 and 001020000 100000000 -> NaN Invalid_operation
+andx289 and 000070001 100000000 -> NaN Invalid_operation
+andx290 and 000080000 100010000 -> NaN Invalid_operation
+andx291 and 000090000 100001000 -> NaN Invalid_operation
+andx292 and 100000010 000020100 -> NaN Invalid_operation
+andx293 and 100100000 000070010 -> NaN Invalid_operation
+andx294 and 100010100 000080001 -> NaN Invalid_operation
+andx295 and 100001000 000090000 -> NaN Invalid_operation
+-- signs
+andx296 and -100001000 -000000000 -> NaN Invalid_operation
+andx297 and -100001000 000010000 -> NaN Invalid_operation
+andx298 and 100001000 -000000000 -> NaN Invalid_operation
+andx299 and 100001000 000011000 -> 1000
+
+-- Nmax, Nmin, Ntiny
+andx331 and 2 9.99999999E+999 -> NaN Invalid_operation
+andx332 and 3 1E-999 -> NaN Invalid_operation
+andx333 and 4 1.00000000E-999 -> NaN Invalid_operation
+andx334 and 5 1E-1007 -> NaN Invalid_operation
+andx335 and 6 -1E-1007 -> NaN Invalid_operation
+andx336 and 7 -1.00000000E-999 -> NaN Invalid_operation
+andx337 and 8 -1E-999 -> NaN Invalid_operation
+andx338 and 9 -9.99999999E+999 -> NaN Invalid_operation
+andx341 and 9.99999999E+999 -18 -> NaN Invalid_operation
+andx342 and 1E-999 01 -> NaN Invalid_operation
+andx343 and 1.00000000E-999 -18 -> NaN Invalid_operation
+andx344 and 1E-1007 18 -> NaN Invalid_operation
+andx345 and -1E-1007 -10 -> NaN Invalid_operation
+andx346 and -1.00000000E-999 18 -> NaN Invalid_operation
+andx347 and -1E-999 10 -> NaN Invalid_operation
+andx348 and -9.99999999E+999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+andx361 and 1.0 1 -> NaN Invalid_operation
+andx362 and 1E+1 1 -> NaN Invalid_operation
+andx363 and 0.0 1 -> NaN Invalid_operation
+andx364 and 0E+1 1 -> NaN Invalid_operation
+andx365 and 9.9 1 -> NaN Invalid_operation
+andx366 and 9E+1 1 -> NaN Invalid_operation
+andx371 and 0 1.0 -> NaN Invalid_operation
+andx372 and 0 1E+1 -> NaN Invalid_operation
+andx373 and 0 0.0 -> NaN Invalid_operation
+andx374 and 0 0E+1 -> NaN Invalid_operation
+andx375 and 0 9.9 -> NaN Invalid_operation
+andx376 and 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+andx780 and -Inf -Inf -> NaN Invalid_operation
+andx781 and -Inf -1000 -> NaN Invalid_operation
+andx782 and -Inf -1 -> NaN Invalid_operation
+andx783 and -Inf -0 -> NaN Invalid_operation
+andx784 and -Inf 0 -> NaN Invalid_operation
+andx785 and -Inf 1 -> NaN Invalid_operation
+andx786 and -Inf 1000 -> NaN Invalid_operation
+andx787 and -1000 -Inf -> NaN Invalid_operation
+andx788 and -Inf -Inf -> NaN Invalid_operation
+andx789 and -1 -Inf -> NaN Invalid_operation
+andx790 and -0 -Inf -> NaN Invalid_operation
+andx791 and 0 -Inf -> NaN Invalid_operation
+andx792 and 1 -Inf -> NaN Invalid_operation
+andx793 and 1000 -Inf -> NaN Invalid_operation
+andx794 and Inf -Inf -> NaN Invalid_operation
+
+andx800 and Inf -Inf -> NaN Invalid_operation
+andx801 and Inf -1000 -> NaN Invalid_operation
+andx802 and Inf -1 -> NaN Invalid_operation
+andx803 and Inf -0 -> NaN Invalid_operation
+andx804 and Inf 0 -> NaN Invalid_operation
+andx805 and Inf 1 -> NaN Invalid_operation
+andx806 and Inf 1000 -> NaN Invalid_operation
+andx807 and Inf Inf -> NaN Invalid_operation
+andx808 and -1000 Inf -> NaN Invalid_operation
+andx809 and -Inf Inf -> NaN Invalid_operation
+andx810 and -1 Inf -> NaN Invalid_operation
+andx811 and -0 Inf -> NaN Invalid_operation
+andx812 and 0 Inf -> NaN Invalid_operation
+andx813 and 1 Inf -> NaN Invalid_operation
+andx814 and 1000 Inf -> NaN Invalid_operation
+andx815 and Inf Inf -> NaN Invalid_operation
+
+andx821 and NaN -Inf -> NaN Invalid_operation
+andx822 and NaN -1000 -> NaN Invalid_operation
+andx823 and NaN -1 -> NaN Invalid_operation
+andx824 and NaN -0 -> NaN Invalid_operation
+andx825 and NaN 0 -> NaN Invalid_operation
+andx826 and NaN 1 -> NaN Invalid_operation
+andx827 and NaN 1000 -> NaN Invalid_operation
+andx828 and NaN Inf -> NaN Invalid_operation
+andx829 and NaN NaN -> NaN Invalid_operation
+andx830 and -Inf NaN -> NaN Invalid_operation
+andx831 and -1000 NaN -> NaN Invalid_operation
+andx832 and -1 NaN -> NaN Invalid_operation
+andx833 and -0 NaN -> NaN Invalid_operation
+andx834 and 0 NaN -> NaN Invalid_operation
+andx835 and 1 NaN -> NaN Invalid_operation
+andx836 and 1000 NaN -> NaN Invalid_operation
+andx837 and Inf NaN -> NaN Invalid_operation
+
+andx841 and sNaN -Inf -> NaN Invalid_operation
+andx842 and sNaN -1000 -> NaN Invalid_operation
+andx843 and sNaN -1 -> NaN Invalid_operation
+andx844 and sNaN -0 -> NaN Invalid_operation
+andx845 and sNaN 0 -> NaN Invalid_operation
+andx846 and sNaN 1 -> NaN Invalid_operation
+andx847 and sNaN 1000 -> NaN Invalid_operation
+andx848 and sNaN NaN -> NaN Invalid_operation
+andx849 and sNaN sNaN -> NaN Invalid_operation
+andx850 and NaN sNaN -> NaN Invalid_operation
+andx851 and -Inf sNaN -> NaN Invalid_operation
+andx852 and -1000 sNaN -> NaN Invalid_operation
+andx853 and -1 sNaN -> NaN Invalid_operation
+andx854 and -0 sNaN -> NaN Invalid_operation
+andx855 and 0 sNaN -> NaN Invalid_operation
+andx856 and 1 sNaN -> NaN Invalid_operation
+andx857 and 1000 sNaN -> NaN Invalid_operation
+andx858 and Inf sNaN -> NaN Invalid_operation
+andx859 and NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+andx861 and NaN1 -Inf -> NaN Invalid_operation
+andx862 and +NaN2 -1000 -> NaN Invalid_operation
+andx863 and NaN3 1000 -> NaN Invalid_operation
+andx864 and NaN4 Inf -> NaN Invalid_operation
+andx865 and NaN5 +NaN6 -> NaN Invalid_operation
+andx866 and -Inf NaN7 -> NaN Invalid_operation
+andx867 and -1000 NaN8 -> NaN Invalid_operation
+andx868 and 1000 NaN9 -> NaN Invalid_operation
+andx869 and Inf +NaN10 -> NaN Invalid_operation
+andx871 and sNaN11 -Inf -> NaN Invalid_operation
+andx872 and sNaN12 -1000 -> NaN Invalid_operation
+andx873 and sNaN13 1000 -> NaN Invalid_operation
+andx874 and sNaN14 NaN17 -> NaN Invalid_operation
+andx875 and sNaN15 sNaN18 -> NaN Invalid_operation
+andx876 and NaN16 sNaN19 -> NaN Invalid_operation
+andx877 and -Inf +sNaN20 -> NaN Invalid_operation
+andx878 and -1000 sNaN21 -> NaN Invalid_operation
+andx879 and 1000 sNaN22 -> NaN Invalid_operation
+andx880 and Inf sNaN23 -> NaN Invalid_operation
+andx881 and +NaN25 +sNaN24 -> NaN Invalid_operation
+andx882 and -NaN26 NaN28 -> NaN Invalid_operation
+andx883 and -sNaN27 sNaN29 -> NaN Invalid_operation
+andx884 and 1000 -NaN30 -> NaN Invalid_operation
+andx885 and 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/class.decTest b/Lib/test/decimaltestdata/class.decTest
index fa5bc3a12f..62d2fa472f 100644
--- a/Lib/test/decimaltestdata/class.decTest
+++ b/Lib/test/decimaltestdata/class.decTest
@@ -1,131 +1,131 @@
-------------------------------------------------------------------------
--- class.decTest -- Class operations --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- [New 2006.11.27]
-
-precision: 9
-maxExponent: 999
-minExponent: -999
-extended: 1
-clamp: 1
-rounding: half_even
-
-clasx001 class 0 -> +Zero
-clasx002 class 0.00 -> +Zero
-clasx003 class 0E+5 -> +Zero
-clasx004 class 1E-1007 -> +Subnormal
-clasx005 class 0.1E-999 -> +Subnormal
-clasx006 class 0.99999999E-999 -> +Subnormal
-clasx007 class 1.00000000E-999 -> +Normal
-clasx008 class 1E-999 -> +Normal
-clasx009 class 1E-100 -> +Normal
-clasx010 class 1E-10 -> +Normal
-clasx012 class 1E-1 -> +Normal
-clasx013 class 1 -> +Normal
-clasx014 class 2.50 -> +Normal
-clasx015 class 100.100 -> +Normal
-clasx016 class 1E+30 -> +Normal
-clasx017 class 1E+999 -> +Normal
-clasx018 class 9.99999999E+999 -> +Normal
-clasx019 class Inf -> +Infinity
-
-clasx021 class -0 -> -Zero
-clasx022 class -0.00 -> -Zero
-clasx023 class -0E+5 -> -Zero
-clasx024 class -1E-1007 -> -Subnormal
-clasx025 class -0.1E-999 -> -Subnormal
-clasx026 class -0.99999999E-999 -> -Subnormal
-clasx027 class -1.00000000E-999 -> -Normal
-clasx028 class -1E-999 -> -Normal
-clasx029 class -1E-100 -> -Normal
-clasx030 class -1E-10 -> -Normal
-clasx032 class -1E-1 -> -Normal
-clasx033 class -1 -> -Normal
-clasx034 class -2.50 -> -Normal
-clasx035 class -100.100 -> -Normal
-clasx036 class -1E+30 -> -Normal
-clasx037 class -1E+999 -> -Normal
-clasx038 class -9.99999999E+999 -> -Normal
-clasx039 class -Inf -> -Infinity
-
-clasx041 class NaN -> NaN
-clasx042 class -NaN -> NaN
-clasx043 class +NaN12345 -> NaN
-clasx044 class sNaN -> sNaN
-clasx045 class -sNaN -> sNaN
-clasx046 class +sNaN12345 -> sNaN
-
-
--- decimal64 bounds
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-clamp: 1
-rounding: half_even
-
-clasx201 class 0 -> +Zero
-clasx202 class 0.00 -> +Zero
-clasx203 class 0E+5 -> +Zero
-clasx204 class 1E-396 -> +Subnormal
-clasx205 class 0.1E-383 -> +Subnormal
-clasx206 class 0.999999999999999E-383 -> +Subnormal
-clasx207 class 1.000000000000000E-383 -> +Normal
-clasx208 class 1E-383 -> +Normal
-clasx209 class 1E-100 -> +Normal
-clasx210 class 1E-10 -> +Normal
-clasx212 class 1E-1 -> +Normal
-clasx213 class 1 -> +Normal
-clasx214 class 2.50 -> +Normal
-clasx215 class 100.100 -> +Normal
-clasx216 class 1E+30 -> +Normal
-clasx217 class 1E+384 -> +Normal
-clasx218 class 9.999999999999999E+384 -> +Normal
-clasx219 class Inf -> +Infinity
-
-clasx221 class -0 -> -Zero
-clasx222 class -0.00 -> -Zero
-clasx223 class -0E+5 -> -Zero
-clasx224 class -1E-396 -> -Subnormal
-clasx225 class -0.1E-383 -> -Subnormal
-clasx226 class -0.999999999999999E-383 -> -Subnormal
-clasx227 class -1.000000000000000E-383 -> -Normal
-clasx228 class -1E-383 -> -Normal
-clasx229 class -1E-100 -> -Normal
-clasx230 class -1E-10 -> -Normal
-clasx232 class -1E-1 -> -Normal
-clasx233 class -1 -> -Normal
-clasx234 class -2.50 -> -Normal
-clasx235 class -100.100 -> -Normal
-clasx236 class -1E+30 -> -Normal
-clasx237 class -1E+384 -> -Normal
-clasx238 class -9.999999999999999E+384 -> -Normal
-clasx239 class -Inf -> -Infinity
-
-clasx241 class NaN -> NaN
-clasx242 class -NaN -> NaN
-clasx243 class +NaN12345 -> NaN
-clasx244 class sNaN -> sNaN
-clasx245 class -sNaN -> sNaN
-clasx246 class +sNaN12345 -> sNaN
-
-
-
+------------------------------------------------------------------------
+-- class.decTest -- Class operations --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- [New 2006.11.27]
+
+precision: 9
+maxExponent: 999
+minExponent: -999
+extended: 1
+clamp: 1
+rounding: half_even
+
+clasx001 class 0 -> +Zero
+clasx002 class 0.00 -> +Zero
+clasx003 class 0E+5 -> +Zero
+clasx004 class 1E-1007 -> +Subnormal
+clasx005 class 0.1E-999 -> +Subnormal
+clasx006 class 0.99999999E-999 -> +Subnormal
+clasx007 class 1.00000000E-999 -> +Normal
+clasx008 class 1E-999 -> +Normal
+clasx009 class 1E-100 -> +Normal
+clasx010 class 1E-10 -> +Normal
+clasx012 class 1E-1 -> +Normal
+clasx013 class 1 -> +Normal
+clasx014 class 2.50 -> +Normal
+clasx015 class 100.100 -> +Normal
+clasx016 class 1E+30 -> +Normal
+clasx017 class 1E+999 -> +Normal
+clasx018 class 9.99999999E+999 -> +Normal
+clasx019 class Inf -> +Infinity
+
+clasx021 class -0 -> -Zero
+clasx022 class -0.00 -> -Zero
+clasx023 class -0E+5 -> -Zero
+clasx024 class -1E-1007 -> -Subnormal
+clasx025 class -0.1E-999 -> -Subnormal
+clasx026 class -0.99999999E-999 -> -Subnormal
+clasx027 class -1.00000000E-999 -> -Normal
+clasx028 class -1E-999 -> -Normal
+clasx029 class -1E-100 -> -Normal
+clasx030 class -1E-10 -> -Normal
+clasx032 class -1E-1 -> -Normal
+clasx033 class -1 -> -Normal
+clasx034 class -2.50 -> -Normal
+clasx035 class -100.100 -> -Normal
+clasx036 class -1E+30 -> -Normal
+clasx037 class -1E+999 -> -Normal
+clasx038 class -9.99999999E+999 -> -Normal
+clasx039 class -Inf -> -Infinity
+
+clasx041 class NaN -> NaN
+clasx042 class -NaN -> NaN
+clasx043 class +NaN12345 -> NaN
+clasx044 class sNaN -> sNaN
+clasx045 class -sNaN -> sNaN
+clasx046 class +sNaN12345 -> sNaN
+
+
+-- decimal64 bounds
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+clamp: 1
+rounding: half_even
+
+clasx201 class 0 -> +Zero
+clasx202 class 0.00 -> +Zero
+clasx203 class 0E+5 -> +Zero
+clasx204 class 1E-396 -> +Subnormal
+clasx205 class 0.1E-383 -> +Subnormal
+clasx206 class 0.999999999999999E-383 -> +Subnormal
+clasx207 class 1.000000000000000E-383 -> +Normal
+clasx208 class 1E-383 -> +Normal
+clasx209 class 1E-100 -> +Normal
+clasx210 class 1E-10 -> +Normal
+clasx212 class 1E-1 -> +Normal
+clasx213 class 1 -> +Normal
+clasx214 class 2.50 -> +Normal
+clasx215 class 100.100 -> +Normal
+clasx216 class 1E+30 -> +Normal
+clasx217 class 1E+384 -> +Normal
+clasx218 class 9.999999999999999E+384 -> +Normal
+clasx219 class Inf -> +Infinity
+
+clasx221 class -0 -> -Zero
+clasx222 class -0.00 -> -Zero
+clasx223 class -0E+5 -> -Zero
+clasx224 class -1E-396 -> -Subnormal
+clasx225 class -0.1E-383 -> -Subnormal
+clasx226 class -0.999999999999999E-383 -> -Subnormal
+clasx227 class -1.000000000000000E-383 -> -Normal
+clasx228 class -1E-383 -> -Normal
+clasx229 class -1E-100 -> -Normal
+clasx230 class -1E-10 -> -Normal
+clasx232 class -1E-1 -> -Normal
+clasx233 class -1 -> -Normal
+clasx234 class -2.50 -> -Normal
+clasx235 class -100.100 -> -Normal
+clasx236 class -1E+30 -> -Normal
+clasx237 class -1E+384 -> -Normal
+clasx238 class -9.999999999999999E+384 -> -Normal
+clasx239 class -Inf -> -Infinity
+
+clasx241 class NaN -> NaN
+clasx242 class -NaN -> NaN
+clasx243 class +NaN12345 -> NaN
+clasx244 class sNaN -> sNaN
+clasx245 class -sNaN -> sNaN
+clasx246 class +sNaN12345 -> sNaN
+
+
+
diff --git a/Lib/test/decimaltestdata/comparetotal.decTest b/Lib/test/decimaltestdata/comparetotal.decTest
index 252c49fb61..ad87b4ce29 100644
--- a/Lib/test/decimaltestdata/comparetotal.decTest
+++ b/Lib/test/decimaltestdata/comparetotal.decTest
@@ -1,798 +1,798 @@
-------------------------------------------------------------------------
--- comparetotal.decTest -- decimal comparison using total ordering --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
-extended: 1
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
--- sanity checks
-cotx001 comparetotal -2 -2 -> 0
-cotx002 comparetotal -2 -1 -> -1
-cotx003 comparetotal -2 0 -> -1
-cotx004 comparetotal -2 1 -> -1
-cotx005 comparetotal -2 2 -> -1
-cotx006 comparetotal -1 -2 -> 1
-cotx007 comparetotal -1 -1 -> 0
-cotx008 comparetotal -1 0 -> -1
-cotx009 comparetotal -1 1 -> -1
-cotx010 comparetotal -1 2 -> -1
-cotx011 comparetotal 0 -2 -> 1
-cotx012 comparetotal 0 -1 -> 1
-cotx013 comparetotal 0 0 -> 0
-cotx014 comparetotal 0 1 -> -1
-cotx015 comparetotal 0 2 -> -1
-cotx016 comparetotal 1 -2 -> 1
-cotx017 comparetotal 1 -1 -> 1
-cotx018 comparetotal 1 0 -> 1
-cotx019 comparetotal 1 1 -> 0
-cotx020 comparetotal 1 2 -> -1
-cotx021 comparetotal 2 -2 -> 1
-cotx022 comparetotal 2 -1 -> 1
-cotx023 comparetotal 2 0 -> 1
-cotx025 comparetotal 2 1 -> 1
-cotx026 comparetotal 2 2 -> 0
-
-cotx031 comparetotal -20 -20 -> 0
-cotx032 comparetotal -20 -10 -> -1
-cotx033 comparetotal -20 00 -> -1
-cotx034 comparetotal -20 10 -> -1
-cotx035 comparetotal -20 20 -> -1
-cotx036 comparetotal -10 -20 -> 1
-cotx037 comparetotal -10 -10 -> 0
-cotx038 comparetotal -10 00 -> -1
-cotx039 comparetotal -10 10 -> -1
-cotx040 comparetotal -10 20 -> -1
-cotx041 comparetotal 00 -20 -> 1
-cotx042 comparetotal 00 -10 -> 1
-cotx043 comparetotal 00 00 -> 0
-cotx044 comparetotal 00 10 -> -1
-cotx045 comparetotal 00 20 -> -1
-cotx046 comparetotal 10 -20 -> 1
-cotx047 comparetotal 10 -10 -> 1
-cotx048 comparetotal 10 00 -> 1
-cotx049 comparetotal 10 10 -> 0
-cotx050 comparetotal 10 20 -> -1
-cotx051 comparetotal 20 -20 -> 1
-cotx052 comparetotal 20 -10 -> 1
-cotx053 comparetotal 20 00 -> 1
-cotx055 comparetotal 20 10 -> 1
-cotx056 comparetotal 20 20 -> 0
-
-cotx061 comparetotal -2.0 -2.0 -> 0
-cotx062 comparetotal -2.0 -1.0 -> -1
-cotx063 comparetotal -2.0 0.0 -> -1
-cotx064 comparetotal -2.0 1.0 -> -1
-cotx065 comparetotal -2.0 2.0 -> -1
-cotx066 comparetotal -1.0 -2.0 -> 1
-cotx067 comparetotal -1.0 -1.0 -> 0
-cotx068 comparetotal -1.0 0.0 -> -1
-cotx069 comparetotal -1.0 1.0 -> -1
-cotx070 comparetotal -1.0 2.0 -> -1
-cotx071 comparetotal 0.0 -2.0 -> 1
-cotx072 comparetotal 0.0 -1.0 -> 1
-cotx073 comparetotal 0.0 0.0 -> 0
-cotx074 comparetotal 0.0 1.0 -> -1
-cotx075 comparetotal 0.0 2.0 -> -1
-cotx076 comparetotal 1.0 -2.0 -> 1
-cotx077 comparetotal 1.0 -1.0 -> 1
-cotx078 comparetotal 1.0 0.0 -> 1
-cotx079 comparetotal 1.0 1.0 -> 0
-cotx080 comparetotal 1.0 2.0 -> -1
-cotx081 comparetotal 2.0 -2.0 -> 1
-cotx082 comparetotal 2.0 -1.0 -> 1
-cotx083 comparetotal 2.0 0.0 -> 1
-cotx085 comparetotal 2.0 1.0 -> 1
-cotx086 comparetotal 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-maxexponent: 999999999
-minexponent: -999999999
-cotx090 comparetotal 9.99999999E+999999999 9.99999999E+999999999 -> 0
-cotx091 comparetotal -9.99999999E+999999999 9.99999999E+999999999 -> -1
-cotx092 comparetotal 9.99999999E+999999999 -9.99999999E+999999999 -> 1
-cotx093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0
-
--- Examples
-cotx094 comparetotal 12.73 127.9 -> -1
-cotx095 comparetotal -127 12 -> -1
-cotx096 comparetotal 12.30 12.3 -> -1
-cotx097 comparetotal 12.30 12.30 -> 0
-cotx098 comparetotal 12.3 12.300 -> 1
-cotx099 comparetotal 12.3 NaN -> -1
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-cotx100 comparetotal 7.0 7.0 -> 0
-cotx101 comparetotal 7.0 7 -> -1
-cotx102 comparetotal 7 7.0 -> 1
-cotx103 comparetotal 7E+0 7.0 -> 1
-cotx104 comparetotal 70E-1 7.0 -> 0
-cotx105 comparetotal 0.7E+1 7 -> 0
-cotx106 comparetotal 70E-1 7 -> -1
-cotx107 comparetotal 7.0 7E+0 -> -1
-cotx108 comparetotal 7.0 70E-1 -> 0
-cotx109 comparetotal 7 0.7E+1 -> 0
-cotx110 comparetotal 7 70E-1 -> 1
-
-cotx120 comparetotal 8.0 7.0 -> 1
-cotx121 comparetotal 8.0 7 -> 1
-cotx122 comparetotal 8 7.0 -> 1
-cotx123 comparetotal 8E+0 7.0 -> 1
-cotx124 comparetotal 80E-1 7.0 -> 1
-cotx125 comparetotal 0.8E+1 7 -> 1
-cotx126 comparetotal 80E-1 7 -> 1
-cotx127 comparetotal 8.0 7E+0 -> 1
-cotx128 comparetotal 8.0 70E-1 -> 1
-cotx129 comparetotal 8 0.7E+1 -> 1
-cotx130 comparetotal 8 70E-1 -> 1
-
-cotx140 comparetotal 8.0 9.0 -> -1
-cotx141 comparetotal 8.0 9 -> -1
-cotx142 comparetotal 8 9.0 -> -1
-cotx143 comparetotal 8E+0 9.0 -> -1
-cotx144 comparetotal 80E-1 9.0 -> -1
-cotx145 comparetotal 0.8E+1 9 -> -1
-cotx146 comparetotal 80E-1 9 -> -1
-cotx147 comparetotal 8.0 9E+0 -> -1
-cotx148 comparetotal 8.0 90E-1 -> -1
-cotx149 comparetotal 8 0.9E+1 -> -1
-cotx150 comparetotal 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-cotx200 comparetotal -7.0 7.0 -> -1
-cotx201 comparetotal -7.0 7 -> -1
-cotx202 comparetotal -7 7.0 -> -1
-cotx203 comparetotal -7E+0 7.0 -> -1
-cotx204 comparetotal -70E-1 7.0 -> -1
-cotx205 comparetotal -0.7E+1 7 -> -1
-cotx206 comparetotal -70E-1 7 -> -1
-cotx207 comparetotal -7.0 7E+0 -> -1
-cotx208 comparetotal -7.0 70E-1 -> -1
-cotx209 comparetotal -7 0.7E+1 -> -1
-cotx210 comparetotal -7 70E-1 -> -1
-
-cotx220 comparetotal -8.0 7.0 -> -1
-cotx221 comparetotal -8.0 7 -> -1
-cotx222 comparetotal -8 7.0 -> -1
-cotx223 comparetotal -8E+0 7.0 -> -1
-cotx224 comparetotal -80E-1 7.0 -> -1
-cotx225 comparetotal -0.8E+1 7 -> -1
-cotx226 comparetotal -80E-1 7 -> -1
-cotx227 comparetotal -8.0 7E+0 -> -1
-cotx228 comparetotal -8.0 70E-1 -> -1
-cotx229 comparetotal -8 0.7E+1 -> -1
-cotx230 comparetotal -8 70E-1 -> -1
-
-cotx240 comparetotal -8.0 9.0 -> -1
-cotx241 comparetotal -8.0 9 -> -1
-cotx242 comparetotal -8 9.0 -> -1
-cotx243 comparetotal -8E+0 9.0 -> -1
-cotx244 comparetotal -80E-1 9.0 -> -1
-cotx245 comparetotal -0.8E+1 9 -> -1
-cotx246 comparetotal -80E-1 9 -> -1
-cotx247 comparetotal -8.0 9E+0 -> -1
-cotx248 comparetotal -8.0 90E-1 -> -1
-cotx249 comparetotal -8 0.9E+1 -> -1
-cotx250 comparetotal -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-cotx300 comparetotal 7.0 -7.0 -> 1
-cotx301 comparetotal 7.0 -7 -> 1
-cotx302 comparetotal 7 -7.0 -> 1
-cotx303 comparetotal 7E+0 -7.0 -> 1
-cotx304 comparetotal 70E-1 -7.0 -> 1
-cotx305 comparetotal .7E+1 -7 -> 1
-cotx306 comparetotal 70E-1 -7 -> 1
-cotx307 comparetotal 7.0 -7E+0 -> 1
-cotx308 comparetotal 7.0 -70E-1 -> 1
-cotx309 comparetotal 7 -.7E+1 -> 1
-cotx310 comparetotal 7 -70E-1 -> 1
-
-cotx320 comparetotal 8.0 -7.0 -> 1
-cotx321 comparetotal 8.0 -7 -> 1
-cotx322 comparetotal 8 -7.0 -> 1
-cotx323 comparetotal 8E+0 -7.0 -> 1
-cotx324 comparetotal 80E-1 -7.0 -> 1
-cotx325 comparetotal .8E+1 -7 -> 1
-cotx326 comparetotal 80E-1 -7 -> 1
-cotx327 comparetotal 8.0 -7E+0 -> 1
-cotx328 comparetotal 8.0 -70E-1 -> 1
-cotx329 comparetotal 8 -.7E+1 -> 1
-cotx330 comparetotal 8 -70E-1 -> 1
-
-cotx340 comparetotal 8.0 -9.0 -> 1
-cotx341 comparetotal 8.0 -9 -> 1
-cotx342 comparetotal 8 -9.0 -> 1
-cotx343 comparetotal 8E+0 -9.0 -> 1
-cotx344 comparetotal 80E-1 -9.0 -> 1
-cotx345 comparetotal .8E+1 -9 -> 1
-cotx346 comparetotal 80E-1 -9 -> 1
-cotx347 comparetotal 8.0 -9E+0 -> 1
-cotx348 comparetotal 8.0 -90E-1 -> 1
-cotx349 comparetotal 8 -.9E+1 -> 1
-cotx350 comparetotal 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-cotx400 comparetotal -7.0 -7.0 -> 0
-cotx401 comparetotal -7.0 -7 -> 1
-cotx402 comparetotal -7 -7.0 -> -1
-cotx403 comparetotal -7E+0 -7.0 -> -1
-cotx404 comparetotal -70E-1 -7.0 -> 0
-cotx405 comparetotal -.7E+1 -7 -> 0
-cotx406 comparetotal -70E-1 -7 -> 1
-cotx407 comparetotal -7.0 -7E+0 -> 1
-cotx408 comparetotal -7.0 -70E-1 -> 0
-cotx409 comparetotal -7 -.7E+1 -> 0
-cotx410 comparetotal -7 -70E-1 -> -1
-
-cotx420 comparetotal -8.0 -7.0 -> -1
-cotx421 comparetotal -8.0 -7 -> -1
-cotx422 comparetotal -8 -7.0 -> -1
-cotx423 comparetotal -8E+0 -7.0 -> -1
-cotx424 comparetotal -80E-1 -7.0 -> -1
-cotx425 comparetotal -.8E+1 -7 -> -1
-cotx426 comparetotal -80E-1 -7 -> -1
-cotx427 comparetotal -8.0 -7E+0 -> -1
-cotx428 comparetotal -8.0 -70E-1 -> -1
-cotx429 comparetotal -8 -.7E+1 -> -1
-cotx430 comparetotal -8 -70E-1 -> -1
-
-cotx440 comparetotal -8.0 -9.0 -> 1
-cotx441 comparetotal -8.0 -9 -> 1
-cotx442 comparetotal -8 -9.0 -> 1
-cotx443 comparetotal -8E+0 -9.0 -> 1
-cotx444 comparetotal -80E-1 -9.0 -> 1
-cotx445 comparetotal -.8E+1 -9 -> 1
-cotx446 comparetotal -80E-1 -9 -> 1
-cotx447 comparetotal -8.0 -9E+0 -> 1
-cotx448 comparetotal -8.0 -90E-1 -> 1
-cotx449 comparetotal -8 -.9E+1 -> 1
-cotx450 comparetotal -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-precision: 40
-cotx470 comparetotal 123.4560000000000000E789 123.456E789 -> -1
-cotx471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1
-cotx472 comparetotal 123.45600000000000E789 123.456E789 -> -1
-cotx473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
-cotx474 comparetotal 123.456000000000E789 123.456E789 -> -1
-cotx475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
-cotx476 comparetotal 123.4560000000E789 123.456E789 -> -1
-cotx477 comparetotal 123.456000000E-89 123.456E-89 -> -1
-cotx478 comparetotal 123.45600000E789 123.456E789 -> -1
-cotx479 comparetotal 123.4560000E-89 123.456E-89 -> -1
-cotx480 comparetotal 123.456000E789 123.456E789 -> -1
-cotx481 comparetotal 123.45600E-89 123.456E-89 -> -1
-cotx482 comparetotal 123.4560E789 123.456E789 -> -1
-cotx483 comparetotal 123.456E-89 123.456E-89 -> 0
-cotx484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1
-cotx485 comparetotal 123.456E789 123.456000000000000E789 -> 1
-cotx486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1
-cotx487 comparetotal 123.456E789 123.4560000000000E789 -> 1
-cotx488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
-cotx489 comparetotal 123.456E789 123.45600000000E789 -> 1
-cotx490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
-cotx491 comparetotal 123.456E789 123.456000000E789 -> 1
-cotx492 comparetotal 123.456E-89 123.45600000E-89 -> 1
-cotx493 comparetotal 123.456E789 123.4560000E789 -> 1
-cotx494 comparetotal 123.456E-89 123.456000E-89 -> 1
-cotx495 comparetotal 123.456E789 123.45600E789 -> 1
-cotx496 comparetotal 123.456E-89 123.4560E-89 -> 1
-cotx497 comparetotal 123.456E789 123.456E789 -> 0
-
--- wide-ranging, around precision; signs equal
-precision: 9
-cotx500 comparetotal 1 1E-15 -> 1
-cotx501 comparetotal 1 1E-14 -> 1
-cotx502 comparetotal 1 1E-13 -> 1
-cotx503 comparetotal 1 1E-12 -> 1
-cotx504 comparetotal 1 1E-11 -> 1
-cotx505 comparetotal 1 1E-10 -> 1
-cotx506 comparetotal 1 1E-9 -> 1
-cotx507 comparetotal 1 1E-8 -> 1
-cotx508 comparetotal 1 1E-7 -> 1
-cotx509 comparetotal 1 1E-6 -> 1
-cotx510 comparetotal 1 1E-5 -> 1
-cotx511 comparetotal 1 1E-4 -> 1
-cotx512 comparetotal 1 1E-3 -> 1
-cotx513 comparetotal 1 1E-2 -> 1
-cotx514 comparetotal 1 1E-1 -> 1
-cotx515 comparetotal 1 1E-0 -> 0
-cotx516 comparetotal 1 1E+1 -> -1
-cotx517 comparetotal 1 1E+2 -> -1
-cotx518 comparetotal 1 1E+3 -> -1
-cotx519 comparetotal 1 1E+4 -> -1
-cotx521 comparetotal 1 1E+5 -> -1
-cotx522 comparetotal 1 1E+6 -> -1
-cotx523 comparetotal 1 1E+7 -> -1
-cotx524 comparetotal 1 1E+8 -> -1
-cotx525 comparetotal 1 1E+9 -> -1
-cotx526 comparetotal 1 1E+10 -> -1
-cotx527 comparetotal 1 1E+11 -> -1
-cotx528 comparetotal 1 1E+12 -> -1
-cotx529 comparetotal 1 1E+13 -> -1
-cotx530 comparetotal 1 1E+14 -> -1
-cotx531 comparetotal 1 1E+15 -> -1
--- LR swap
-cotx540 comparetotal 1E-15 1 -> -1
-cotx541 comparetotal 1E-14 1 -> -1
-cotx542 comparetotal 1E-13 1 -> -1
-cotx543 comparetotal 1E-12 1 -> -1
-cotx544 comparetotal 1E-11 1 -> -1
-cotx545 comparetotal 1E-10 1 -> -1
-cotx546 comparetotal 1E-9 1 -> -1
-cotx547 comparetotal 1E-8 1 -> -1
-cotx548 comparetotal 1E-7 1 -> -1
-cotx549 comparetotal 1E-6 1 -> -1
-cotx550 comparetotal 1E-5 1 -> -1
-cotx551 comparetotal 1E-4 1 -> -1
-cotx552 comparetotal 1E-3 1 -> -1
-cotx553 comparetotal 1E-2 1 -> -1
-cotx554 comparetotal 1E-1 1 -> -1
-cotx555 comparetotal 1E-0 1 -> 0
-cotx556 comparetotal 1E+1 1 -> 1
-cotx557 comparetotal 1E+2 1 -> 1
-cotx558 comparetotal 1E+3 1 -> 1
-cotx559 comparetotal 1E+4 1 -> 1
-cotx561 comparetotal 1E+5 1 -> 1
-cotx562 comparetotal 1E+6 1 -> 1
-cotx563 comparetotal 1E+7 1 -> 1
-cotx564 comparetotal 1E+8 1 -> 1
-cotx565 comparetotal 1E+9 1 -> 1
-cotx566 comparetotal 1E+10 1 -> 1
-cotx567 comparetotal 1E+11 1 -> 1
-cotx568 comparetotal 1E+12 1 -> 1
-cotx569 comparetotal 1E+13 1 -> 1
-cotx570 comparetotal 1E+14 1 -> 1
-cotx571 comparetotal 1E+15 1 -> 1
--- similar with an useful coefficient, one side only
-cotx580 comparetotal 0.000000987654321 1E-15 -> 1
-cotx581 comparetotal 0.000000987654321 1E-14 -> 1
-cotx582 comparetotal 0.000000987654321 1E-13 -> 1
-cotx583 comparetotal 0.000000987654321 1E-12 -> 1
-cotx584 comparetotal 0.000000987654321 1E-11 -> 1
-cotx585 comparetotal 0.000000987654321 1E-10 -> 1
-cotx586 comparetotal 0.000000987654321 1E-9 -> 1
-cotx587 comparetotal 0.000000987654321 1E-8 -> 1
-cotx588 comparetotal 0.000000987654321 1E-7 -> 1
-cotx589 comparetotal 0.000000987654321 1E-6 -> -1
-cotx590 comparetotal 0.000000987654321 1E-5 -> -1
-cotx591 comparetotal 0.000000987654321 1E-4 -> -1
-cotx592 comparetotal 0.000000987654321 1E-3 -> -1
-cotx593 comparetotal 0.000000987654321 1E-2 -> -1
-cotx594 comparetotal 0.000000987654321 1E-1 -> -1
-cotx595 comparetotal 0.000000987654321 1E-0 -> -1
-cotx596 comparetotal 0.000000987654321 1E+1 -> -1
-cotx597 comparetotal 0.000000987654321 1E+2 -> -1
-cotx598 comparetotal 0.000000987654321 1E+3 -> -1
-cotx599 comparetotal 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-precision: 20
-cotx600 comparetotal 12 12.2345 -> -1
-cotx601 comparetotal 12.0 12.2345 -> -1
-cotx602 comparetotal 12.00 12.2345 -> -1
-cotx603 comparetotal 12.000 12.2345 -> -1
-cotx604 comparetotal 12.0000 12.2345 -> -1
-cotx605 comparetotal 12.00000 12.2345 -> -1
-cotx606 comparetotal 12.000000 12.2345 -> -1
-cotx607 comparetotal 12.0000000 12.2345 -> -1
-cotx608 comparetotal 12.00000000 12.2345 -> -1
-cotx609 comparetotal 12.000000000 12.2345 -> -1
-cotx610 comparetotal 12.1234 12 -> 1
-cotx611 comparetotal 12.1234 12.0 -> 1
-cotx612 comparetotal 12.1234 12.00 -> 1
-cotx613 comparetotal 12.1234 12.000 -> 1
-cotx614 comparetotal 12.1234 12.0000 -> 1
-cotx615 comparetotal 12.1234 12.00000 -> 1
-cotx616 comparetotal 12.1234 12.000000 -> 1
-cotx617 comparetotal 12.1234 12.0000000 -> 1
-cotx618 comparetotal 12.1234 12.00000000 -> 1
-cotx619 comparetotal 12.1234 12.000000000 -> 1
-cotx620 comparetotal -12 -12.2345 -> 1
-cotx621 comparetotal -12.0 -12.2345 -> 1
-cotx622 comparetotal -12.00 -12.2345 -> 1
-cotx623 comparetotal -12.000 -12.2345 -> 1
-cotx624 comparetotal -12.0000 -12.2345 -> 1
-cotx625 comparetotal -12.00000 -12.2345 -> 1
-cotx626 comparetotal -12.000000 -12.2345 -> 1
-cotx627 comparetotal -12.0000000 -12.2345 -> 1
-cotx628 comparetotal -12.00000000 -12.2345 -> 1
-cotx629 comparetotal -12.000000000 -12.2345 -> 1
-cotx630 comparetotal -12.1234 -12 -> -1
-cotx631 comparetotal -12.1234 -12.0 -> -1
-cotx632 comparetotal -12.1234 -12.00 -> -1
-cotx633 comparetotal -12.1234 -12.000 -> -1
-cotx634 comparetotal -12.1234 -12.0000 -> -1
-cotx635 comparetotal -12.1234 -12.00000 -> -1
-cotx636 comparetotal -12.1234 -12.000000 -> -1
-cotx637 comparetotal -12.1234 -12.0000000 -> -1
-cotx638 comparetotal -12.1234 -12.00000000 -> -1
-cotx639 comparetotal -12.1234 -12.000000000 -> -1
-precision: 9
-
--- extended zeros
-cotx640 comparetotal 0 0 -> 0
-cotx641 comparetotal 0 -0 -> 1
-cotx642 comparetotal 0 -0.0 -> 1
-cotx643 comparetotal 0 0.0 -> 1
-cotx644 comparetotal -0 0 -> -1
-cotx645 comparetotal -0 -0 -> 0
-cotx646 comparetotal -0 -0.0 -> -1
-cotx647 comparetotal -0 0.0 -> -1
-cotx648 comparetotal 0.0 0 -> -1
-cotx649 comparetotal 0.0 -0 -> 1
-cotx650 comparetotal 0.0 -0.0 -> 1
-cotx651 comparetotal 0.0 0.0 -> 0
-cotx652 comparetotal -0.0 0 -> -1
-cotx653 comparetotal -0.0 -0 -> 1
-cotx654 comparetotal -0.0 -0.0 -> 0
-cotx655 comparetotal -0.0 0.0 -> -1
-
-cotx656 comparetotal -0E1 0.0 -> -1
-cotx657 comparetotal -0E2 0.0 -> -1
-cotx658 comparetotal 0E1 0.0 -> 1
-cotx659 comparetotal 0E2 0.0 -> 1
-cotx660 comparetotal -0E1 0 -> -1
-cotx661 comparetotal -0E2 0 -> -1
-cotx662 comparetotal 0E1 0 -> 1
-cotx663 comparetotal 0E2 0 -> 1
-cotx664 comparetotal -0E1 -0E1 -> 0
-cotx665 comparetotal -0E2 -0E1 -> -1
-cotx666 comparetotal 0E1 -0E1 -> 1
-cotx667 comparetotal 0E2 -0E1 -> 1
-cotx668 comparetotal -0E1 -0E2 -> 1
-cotx669 comparetotal -0E2 -0E2 -> 0
-cotx670 comparetotal 0E1 -0E2 -> 1
-cotx671 comparetotal 0E2 -0E2 -> 1
-cotx672 comparetotal -0E1 0E1 -> -1
-cotx673 comparetotal -0E2 0E1 -> -1
-cotx674 comparetotal 0E1 0E1 -> 0
-cotx675 comparetotal 0E2 0E1 -> 1
-cotx676 comparetotal -0E1 0E2 -> -1
-cotx677 comparetotal -0E2 0E2 -> -1
-cotx678 comparetotal 0E1 0E2 -> -1
-cotx679 comparetotal 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-precision: 20
-cotx680 comparetotal 12 12 -> 0
-cotx681 comparetotal 12 12.0 -> 1
-cotx682 comparetotal 12 12.00 -> 1
-cotx683 comparetotal 12 12.000 -> 1
-cotx684 comparetotal 12 12.0000 -> 1
-cotx685 comparetotal 12 12.00000 -> 1
-cotx686 comparetotal 12 12.000000 -> 1
-cotx687 comparetotal 12 12.0000000 -> 1
-cotx688 comparetotal 12 12.00000000 -> 1
-cotx689 comparetotal 12 12.000000000 -> 1
-cotx690 comparetotal 12 12 -> 0
-cotx691 comparetotal 12.0 12 -> -1
-cotx692 comparetotal 12.00 12 -> -1
-cotx693 comparetotal 12.000 12 -> -1
-cotx694 comparetotal 12.0000 12 -> -1
-cotx695 comparetotal 12.00000 12 -> -1
-cotx696 comparetotal 12.000000 12 -> -1
-cotx697 comparetotal 12.0000000 12 -> -1
-cotx698 comparetotal 12.00000000 12 -> -1
-cotx699 comparetotal 12.000000000 12 -> -1
-
--- long operand checks
-maxexponent: 999
-minexponent: -999
-precision: 9
-cotx701 comparetotal 12345678000 1 -> 1
-cotx702 comparetotal 1 12345678000 -> -1
-cotx703 comparetotal 1234567800 1 -> 1
-cotx704 comparetotal 1 1234567800 -> -1
-cotx705 comparetotal 1234567890 1 -> 1
-cotx706 comparetotal 1 1234567890 -> -1
-cotx707 comparetotal 1234567891 1 -> 1
-cotx708 comparetotal 1 1234567891 -> -1
-cotx709 comparetotal 12345678901 1 -> 1
-cotx710 comparetotal 1 12345678901 -> -1
-cotx711 comparetotal 1234567896 1 -> 1
-cotx712 comparetotal 1 1234567896 -> -1
-cotx713 comparetotal -1234567891 1 -> -1
-cotx714 comparetotal 1 -1234567891 -> 1
-cotx715 comparetotal -12345678901 1 -> -1
-cotx716 comparetotal 1 -12345678901 -> 1
-cotx717 comparetotal -1234567896 1 -> -1
-cotx718 comparetotal 1 -1234567896 -> 1
-
-precision: 15
--- same with plenty of precision
-cotx721 comparetotal 12345678000 1 -> 1
-cotx722 comparetotal 1 12345678000 -> -1
-cotx723 comparetotal 1234567800 1 -> 1
-cotx724 comparetotal 1 1234567800 -> -1
-cotx725 comparetotal 1234567890 1 -> 1
-cotx726 comparetotal 1 1234567890 -> -1
-cotx727 comparetotal 1234567891 1 -> 1
-cotx728 comparetotal 1 1234567891 -> -1
-cotx729 comparetotal 12345678901 1 -> 1
-cotx730 comparetotal 1 12345678901 -> -1
-cotx731 comparetotal 1234567896 1 -> 1
-cotx732 comparetotal 1 1234567896 -> -1
-
--- residue cases
-precision: 5
-cotx740 comparetotal 1 0.9999999 -> 1
-cotx741 comparetotal 1 0.999999 -> 1
-cotx742 comparetotal 1 0.99999 -> 1
-cotx743 comparetotal 1 1.0000 -> 1
-cotx744 comparetotal 1 1.00001 -> -1
-cotx745 comparetotal 1 1.000001 -> -1
-cotx746 comparetotal 1 1.0000001 -> -1
-cotx750 comparetotal 0.9999999 1 -> -1
-cotx751 comparetotal 0.999999 1 -> -1
-cotx752 comparetotal 0.99999 1 -> -1
-cotx753 comparetotal 1.0000 1 -> -1
-cotx754 comparetotal 1.00001 1 -> 1
-cotx755 comparetotal 1.000001 1 -> 1
-cotx756 comparetotal 1.0000001 1 -> 1
-
--- a selection of longies
-cotx760 comparetotal -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1
-cotx761 comparetotal -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
-cotx762 comparetotal -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1
-cotx763 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
--- precisions above or below the difference should have no effect
-precision: 11
-cotx764 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 10
-cotx765 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 9
-cotx766 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 8
-cotx767 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 7
-cotx768 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 6
-cotx769 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 5
-cotx770 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 4
-cotx771 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 3
-cotx772 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 2
-cotx773 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 1
-cotx774 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-
--- Specials
-precision: 9
-cotx780 comparetotal Inf -Inf -> 1
-cotx781 comparetotal Inf -1000 -> 1
-cotx782 comparetotal Inf -1 -> 1
-cotx783 comparetotal Inf -0 -> 1
-cotx784 comparetotal Inf 0 -> 1
-cotx785 comparetotal Inf 1 -> 1
-cotx786 comparetotal Inf 1000 -> 1
-cotx787 comparetotal Inf Inf -> 0
-cotx788 comparetotal -1000 Inf -> -1
-cotx789 comparetotal -Inf Inf -> -1
-cotx790 comparetotal -1 Inf -> -1
-cotx791 comparetotal -0 Inf -> -1
-cotx792 comparetotal 0 Inf -> -1
-cotx793 comparetotal 1 Inf -> -1
-cotx794 comparetotal 1000 Inf -> -1
-cotx795 comparetotal Inf Inf -> 0
-
-cotx800 comparetotal -Inf -Inf -> 0
-cotx801 comparetotal -Inf -1000 -> -1
-cotx802 comparetotal -Inf -1 -> -1
-cotx803 comparetotal -Inf -0 -> -1
-cotx804 comparetotal -Inf 0 -> -1
-cotx805 comparetotal -Inf 1 -> -1
-cotx806 comparetotal -Inf 1000 -> -1
-cotx807 comparetotal -Inf Inf -> -1
-cotx808 comparetotal -Inf -Inf -> 0
-cotx809 comparetotal -1000 -Inf -> 1
-cotx810 comparetotal -1 -Inf -> 1
-cotx811 comparetotal -0 -Inf -> 1
-cotx812 comparetotal 0 -Inf -> 1
-cotx813 comparetotal 1 -Inf -> 1
-cotx814 comparetotal 1000 -Inf -> 1
-cotx815 comparetotal Inf -Inf -> 1
-
-cotx821 comparetotal NaN -Inf -> 1
-cotx822 comparetotal NaN -1000 -> 1
-cotx823 comparetotal NaN -1 -> 1
-cotx824 comparetotal NaN -0 -> 1
-cotx825 comparetotal NaN 0 -> 1
-cotx826 comparetotal NaN 1 -> 1
-cotx827 comparetotal NaN 1000 -> 1
-cotx828 comparetotal NaN Inf -> 1
-cotx829 comparetotal NaN NaN -> 0
-cotx830 comparetotal -Inf NaN -> -1
-cotx831 comparetotal -1000 NaN -> -1
-cotx832 comparetotal -1 NaN -> -1
-cotx833 comparetotal -0 NaN -> -1
-cotx834 comparetotal 0 NaN -> -1
-cotx835 comparetotal 1 NaN -> -1
-cotx836 comparetotal 1000 NaN -> -1
-cotx837 comparetotal Inf NaN -> -1
-cotx838 comparetotal -NaN -NaN -> 0
-cotx839 comparetotal +NaN -NaN -> 1
-cotx840 comparetotal -NaN +NaN -> -1
-
-cotx841 comparetotal sNaN -sNaN -> 1
-cotx842 comparetotal sNaN -NaN -> 1
-cotx843 comparetotal sNaN -Inf -> 1
-cotx844 comparetotal sNaN -1000 -> 1
-cotx845 comparetotal sNaN -1 -> 1
-cotx846 comparetotal sNaN -0 -> 1
-cotx847 comparetotal sNaN 0 -> 1
-cotx848 comparetotal sNaN 1 -> 1
-cotx849 comparetotal sNaN 1000 -> 1
-cotx850 comparetotal sNaN NaN -> -1
-cotx851 comparetotal sNaN sNaN -> 0
-
-cotx852 comparetotal -sNaN sNaN -> -1
-cotx853 comparetotal -NaN sNaN -> -1
-cotx854 comparetotal -Inf sNaN -> -1
-cotx855 comparetotal -1000 sNaN -> -1
-cotx856 comparetotal -1 sNaN -> -1
-cotx857 comparetotal -0 sNaN -> -1
-cotx858 comparetotal 0 sNaN -> -1
-cotx859 comparetotal 1 sNaN -> -1
-cotx860 comparetotal 1000 sNaN -> -1
-cotx861 comparetotal Inf sNaN -> -1
-cotx862 comparetotal NaN sNaN -> 1
-cotx863 comparetotal sNaN sNaN -> 0
-
-cotx871 comparetotal -sNaN -sNaN -> 0
-cotx872 comparetotal -sNaN -NaN -> 1
-cotx873 comparetotal -sNaN -Inf -> -1
-cotx874 comparetotal -sNaN -1000 -> -1
-cotx875 comparetotal -sNaN -1 -> -1
-cotx876 comparetotal -sNaN -0 -> -1
-cotx877 comparetotal -sNaN 0 -> -1
-cotx878 comparetotal -sNaN 1 -> -1
-cotx879 comparetotal -sNaN 1000 -> -1
-cotx880 comparetotal -sNaN NaN -> -1
-cotx881 comparetotal -sNaN sNaN -> -1
-
-cotx882 comparetotal -sNaN -sNaN -> 0
-cotx883 comparetotal -NaN -sNaN -> -1
-cotx884 comparetotal -Inf -sNaN -> 1
-cotx885 comparetotal -1000 -sNaN -> 1
-cotx886 comparetotal -1 -sNaN -> 1
-cotx887 comparetotal -0 -sNaN -> 1
-cotx888 comparetotal 0 -sNaN -> 1
-cotx889 comparetotal 1 -sNaN -> 1
-cotx890 comparetotal 1000 -sNaN -> 1
-cotx891 comparetotal Inf -sNaN -> 1
-cotx892 comparetotal NaN -sNaN -> 1
-cotx893 comparetotal sNaN -sNaN -> 1
-
--- NaNs with payload
-cotx960 comparetotal NaN9 -Inf -> 1
-cotx961 comparetotal NaN8 999 -> 1
-cotx962 comparetotal NaN77 Inf -> 1
-cotx963 comparetotal -NaN67 NaN5 -> -1
-cotx964 comparetotal -Inf -NaN4 -> 1
-cotx965 comparetotal -999 -NaN33 -> 1
-cotx966 comparetotal Inf NaN2 -> -1
-
-cotx970 comparetotal -NaN41 -NaN42 -> 1
-cotx971 comparetotal +NaN41 -NaN42 -> 1
-cotx972 comparetotal -NaN41 +NaN42 -> -1
-cotx973 comparetotal +NaN41 +NaN42 -> -1
-cotx974 comparetotal -NaN42 -NaN01 -> -1
-cotx975 comparetotal +NaN42 -NaN01 -> 1
-cotx976 comparetotal -NaN42 +NaN01 -> -1
-cotx977 comparetotal +NaN42 +NaN01 -> 1
-
-cotx980 comparetotal -sNaN771 -sNaN772 -> 1
-cotx981 comparetotal +sNaN771 -sNaN772 -> 1
-cotx982 comparetotal -sNaN771 +sNaN772 -> -1
-cotx983 comparetotal +sNaN771 +sNaN772 -> -1
-cotx984 comparetotal -sNaN772 -sNaN771 -> -1
-cotx985 comparetotal +sNaN772 -sNaN771 -> 1
-cotx986 comparetotal -sNaN772 +sNaN771 -> -1
-cotx987 comparetotal +sNaN772 +sNaN771 -> 1
-
-cotx991 comparetotal -sNaN99 -Inf -> -1
-cotx992 comparetotal sNaN98 -11 -> 1
-cotx993 comparetotal sNaN97 NaN -> -1
-cotx994 comparetotal sNaN16 sNaN94 -> -1
-cotx995 comparetotal NaN85 sNaN83 -> 1
-cotx996 comparetotal -Inf sNaN92 -> -1
-cotx997 comparetotal 088 sNaN81 -> -1
-cotx998 comparetotal Inf sNaN90 -> -1
-cotx999 comparetotal NaN -sNaN89 -> 1
-
--- overflow and underflow tests .. subnormal results now allowed
-maxExponent: 999999999
-minexponent: -999999999
-cotx1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1
-cotx1081 comparetotal 9E+999999999 +1.23456789012345E-0 -> 1
-cotx1082 comparetotal +0.100 9E-999999999 -> 1
-cotx1083 comparetotal 9E-999999999 +0.100 -> -1
-cotx1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1
-cotx1086 comparetotal 9E+999999999 -1.23456789012345E-0 -> 1
-cotx1087 comparetotal -0.100 9E-999999999 -> -1
-cotx1088 comparetotal 9E-999999999 -0.100 -> 1
-
-cotx1089 comparetotal 1e-599999999 1e-400000001 -> -1
-cotx1090 comparetotal 1e-599999999 1e-400000000 -> -1
-cotx1091 comparetotal 1e-600000000 1e-400000000 -> -1
-cotx1092 comparetotal 9e-999999998 0.01 -> -1
-cotx1093 comparetotal 9e-999999998 0.1 -> -1
-cotx1094 comparetotal 0.01 9e-999999998 -> 1
-cotx1095 comparetotal 1e599999999 1e400000001 -> 1
-cotx1096 comparetotal 1e599999999 1e400000000 -> 1
-cotx1097 comparetotal 1e600000000 1e400000000 -> 1
-cotx1098 comparetotal 9e999999998 100 -> 1
-cotx1099 comparetotal 9e999999998 10 -> 1
-cotx1100 comparetotal 100 9e999999998 -> -1
--- signs
-cotx1101 comparetotal 1e+777777777 1e+411111111 -> 1
-cotx1102 comparetotal 1e+777777777 -1e+411111111 -> 1
-cotx1103 comparetotal -1e+777777777 1e+411111111 -> -1
-cotx1104 comparetotal -1e+777777777 -1e+411111111 -> -1
-cotx1105 comparetotal 1e-777777777 1e-411111111 -> -1
-cotx1106 comparetotal 1e-777777777 -1e-411111111 -> 1
-cotx1107 comparetotal -1e-777777777 1e-411111111 -> -1
-cotx1108 comparetotal -1e-777777777 -1e-411111111 -> 1
-
--- spread zeros
-cotx1110 comparetotal 0E-383 0 -> -1
-cotx1111 comparetotal 0E-383 -0 -> 1
-cotx1112 comparetotal -0E-383 0 -> -1
-cotx1113 comparetotal -0E-383 -0 -> 1
-cotx1114 comparetotal 0E-383 0E+384 -> -1
-cotx1115 comparetotal 0E-383 -0E+384 -> 1
-cotx1116 comparetotal -0E-383 0E+384 -> -1
-cotx1117 comparetotal -0E-383 -0E+384 -> 1
-cotx1118 comparetotal 0 0E+384 -> -1
-cotx1119 comparetotal 0 -0E+384 -> 1
-cotx1120 comparetotal -0 0E+384 -> -1
-cotx1121 comparetotal -0 -0E+384 -> 1
-
-cotx1130 comparetotal 0E+384 0 -> 1
-cotx1131 comparetotal 0E+384 -0 -> 1
-cotx1132 comparetotal -0E+384 0 -> -1
-cotx1133 comparetotal -0E+384 -0 -> -1
-cotx1134 comparetotal 0E+384 0E-383 -> 1
-cotx1135 comparetotal 0E+384 -0E-383 -> 1
-cotx1136 comparetotal -0E+384 0E-383 -> -1
-cotx1137 comparetotal -0E+384 -0E-383 -> -1
-cotx1138 comparetotal 0 0E-383 -> 1
-cotx1139 comparetotal 0 -0E-383 -> 1
-cotx1140 comparetotal -0 0E-383 -> -1
-cotx1141 comparetotal -0 -0E-383 -> -1
-
--- Null tests
-cotx9990 comparetotal 10 # -> NaN Invalid_operation
-cotx9991 comparetotal # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- comparetotal.decTest -- decimal comparison using total ordering --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+extended: 1
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+-- sanity checks
+cotx001 comparetotal -2 -2 -> 0
+cotx002 comparetotal -2 -1 -> -1
+cotx003 comparetotal -2 0 -> -1
+cotx004 comparetotal -2 1 -> -1
+cotx005 comparetotal -2 2 -> -1
+cotx006 comparetotal -1 -2 -> 1
+cotx007 comparetotal -1 -1 -> 0
+cotx008 comparetotal -1 0 -> -1
+cotx009 comparetotal -1 1 -> -1
+cotx010 comparetotal -1 2 -> -1
+cotx011 comparetotal 0 -2 -> 1
+cotx012 comparetotal 0 -1 -> 1
+cotx013 comparetotal 0 0 -> 0
+cotx014 comparetotal 0 1 -> -1
+cotx015 comparetotal 0 2 -> -1
+cotx016 comparetotal 1 -2 -> 1
+cotx017 comparetotal 1 -1 -> 1
+cotx018 comparetotal 1 0 -> 1
+cotx019 comparetotal 1 1 -> 0
+cotx020 comparetotal 1 2 -> -1
+cotx021 comparetotal 2 -2 -> 1
+cotx022 comparetotal 2 -1 -> 1
+cotx023 comparetotal 2 0 -> 1
+cotx025 comparetotal 2 1 -> 1
+cotx026 comparetotal 2 2 -> 0
+
+cotx031 comparetotal -20 -20 -> 0
+cotx032 comparetotal -20 -10 -> -1
+cotx033 comparetotal -20 00 -> -1
+cotx034 comparetotal -20 10 -> -1
+cotx035 comparetotal -20 20 -> -1
+cotx036 comparetotal -10 -20 -> 1
+cotx037 comparetotal -10 -10 -> 0
+cotx038 comparetotal -10 00 -> -1
+cotx039 comparetotal -10 10 -> -1
+cotx040 comparetotal -10 20 -> -1
+cotx041 comparetotal 00 -20 -> 1
+cotx042 comparetotal 00 -10 -> 1
+cotx043 comparetotal 00 00 -> 0
+cotx044 comparetotal 00 10 -> -1
+cotx045 comparetotal 00 20 -> -1
+cotx046 comparetotal 10 -20 -> 1
+cotx047 comparetotal 10 -10 -> 1
+cotx048 comparetotal 10 00 -> 1
+cotx049 comparetotal 10 10 -> 0
+cotx050 comparetotal 10 20 -> -1
+cotx051 comparetotal 20 -20 -> 1
+cotx052 comparetotal 20 -10 -> 1
+cotx053 comparetotal 20 00 -> 1
+cotx055 comparetotal 20 10 -> 1
+cotx056 comparetotal 20 20 -> 0
+
+cotx061 comparetotal -2.0 -2.0 -> 0
+cotx062 comparetotal -2.0 -1.0 -> -1
+cotx063 comparetotal -2.0 0.0 -> -1
+cotx064 comparetotal -2.0 1.0 -> -1
+cotx065 comparetotal -2.0 2.0 -> -1
+cotx066 comparetotal -1.0 -2.0 -> 1
+cotx067 comparetotal -1.0 -1.0 -> 0
+cotx068 comparetotal -1.0 0.0 -> -1
+cotx069 comparetotal -1.0 1.0 -> -1
+cotx070 comparetotal -1.0 2.0 -> -1
+cotx071 comparetotal 0.0 -2.0 -> 1
+cotx072 comparetotal 0.0 -1.0 -> 1
+cotx073 comparetotal 0.0 0.0 -> 0
+cotx074 comparetotal 0.0 1.0 -> -1
+cotx075 comparetotal 0.0 2.0 -> -1
+cotx076 comparetotal 1.0 -2.0 -> 1
+cotx077 comparetotal 1.0 -1.0 -> 1
+cotx078 comparetotal 1.0 0.0 -> 1
+cotx079 comparetotal 1.0 1.0 -> 0
+cotx080 comparetotal 1.0 2.0 -> -1
+cotx081 comparetotal 2.0 -2.0 -> 1
+cotx082 comparetotal 2.0 -1.0 -> 1
+cotx083 comparetotal 2.0 0.0 -> 1
+cotx085 comparetotal 2.0 1.0 -> 1
+cotx086 comparetotal 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+maxexponent: 999999999
+minexponent: -999999999
+cotx090 comparetotal 9.99999999E+999999999 9.99999999E+999999999 -> 0
+cotx091 comparetotal -9.99999999E+999999999 9.99999999E+999999999 -> -1
+cotx092 comparetotal 9.99999999E+999999999 -9.99999999E+999999999 -> 1
+cotx093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0
+
+-- Examples
+cotx094 comparetotal 12.73 127.9 -> -1
+cotx095 comparetotal -127 12 -> -1
+cotx096 comparetotal 12.30 12.3 -> -1
+cotx097 comparetotal 12.30 12.30 -> 0
+cotx098 comparetotal 12.3 12.300 -> 1
+cotx099 comparetotal 12.3 NaN -> -1
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+cotx100 comparetotal 7.0 7.0 -> 0
+cotx101 comparetotal 7.0 7 -> -1
+cotx102 comparetotal 7 7.0 -> 1
+cotx103 comparetotal 7E+0 7.0 -> 1
+cotx104 comparetotal 70E-1 7.0 -> 0
+cotx105 comparetotal 0.7E+1 7 -> 0
+cotx106 comparetotal 70E-1 7 -> -1
+cotx107 comparetotal 7.0 7E+0 -> -1
+cotx108 comparetotal 7.0 70E-1 -> 0
+cotx109 comparetotal 7 0.7E+1 -> 0
+cotx110 comparetotal 7 70E-1 -> 1
+
+cotx120 comparetotal 8.0 7.0 -> 1
+cotx121 comparetotal 8.0 7 -> 1
+cotx122 comparetotal 8 7.0 -> 1
+cotx123 comparetotal 8E+0 7.0 -> 1
+cotx124 comparetotal 80E-1 7.0 -> 1
+cotx125 comparetotal 0.8E+1 7 -> 1
+cotx126 comparetotal 80E-1 7 -> 1
+cotx127 comparetotal 8.0 7E+0 -> 1
+cotx128 comparetotal 8.0 70E-1 -> 1
+cotx129 comparetotal 8 0.7E+1 -> 1
+cotx130 comparetotal 8 70E-1 -> 1
+
+cotx140 comparetotal 8.0 9.0 -> -1
+cotx141 comparetotal 8.0 9 -> -1
+cotx142 comparetotal 8 9.0 -> -1
+cotx143 comparetotal 8E+0 9.0 -> -1
+cotx144 comparetotal 80E-1 9.0 -> -1
+cotx145 comparetotal 0.8E+1 9 -> -1
+cotx146 comparetotal 80E-1 9 -> -1
+cotx147 comparetotal 8.0 9E+0 -> -1
+cotx148 comparetotal 8.0 90E-1 -> -1
+cotx149 comparetotal 8 0.9E+1 -> -1
+cotx150 comparetotal 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+cotx200 comparetotal -7.0 7.0 -> -1
+cotx201 comparetotal -7.0 7 -> -1
+cotx202 comparetotal -7 7.0 -> -1
+cotx203 comparetotal -7E+0 7.0 -> -1
+cotx204 comparetotal -70E-1 7.0 -> -1
+cotx205 comparetotal -0.7E+1 7 -> -1
+cotx206 comparetotal -70E-1 7 -> -1
+cotx207 comparetotal -7.0 7E+0 -> -1
+cotx208 comparetotal -7.0 70E-1 -> -1
+cotx209 comparetotal -7 0.7E+1 -> -1
+cotx210 comparetotal -7 70E-1 -> -1
+
+cotx220 comparetotal -8.0 7.0 -> -1
+cotx221 comparetotal -8.0 7 -> -1
+cotx222 comparetotal -8 7.0 -> -1
+cotx223 comparetotal -8E+0 7.0 -> -1
+cotx224 comparetotal -80E-1 7.0 -> -1
+cotx225 comparetotal -0.8E+1 7 -> -1
+cotx226 comparetotal -80E-1 7 -> -1
+cotx227 comparetotal -8.0 7E+0 -> -1
+cotx228 comparetotal -8.0 70E-1 -> -1
+cotx229 comparetotal -8 0.7E+1 -> -1
+cotx230 comparetotal -8 70E-1 -> -1
+
+cotx240 comparetotal -8.0 9.0 -> -1
+cotx241 comparetotal -8.0 9 -> -1
+cotx242 comparetotal -8 9.0 -> -1
+cotx243 comparetotal -8E+0 9.0 -> -1
+cotx244 comparetotal -80E-1 9.0 -> -1
+cotx245 comparetotal -0.8E+1 9 -> -1
+cotx246 comparetotal -80E-1 9 -> -1
+cotx247 comparetotal -8.0 9E+0 -> -1
+cotx248 comparetotal -8.0 90E-1 -> -1
+cotx249 comparetotal -8 0.9E+1 -> -1
+cotx250 comparetotal -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+cotx300 comparetotal 7.0 -7.0 -> 1
+cotx301 comparetotal 7.0 -7 -> 1
+cotx302 comparetotal 7 -7.0 -> 1
+cotx303 comparetotal 7E+0 -7.0 -> 1
+cotx304 comparetotal 70E-1 -7.0 -> 1
+cotx305 comparetotal .7E+1 -7 -> 1
+cotx306 comparetotal 70E-1 -7 -> 1
+cotx307 comparetotal 7.0 -7E+0 -> 1
+cotx308 comparetotal 7.0 -70E-1 -> 1
+cotx309 comparetotal 7 -.7E+1 -> 1
+cotx310 comparetotal 7 -70E-1 -> 1
+
+cotx320 comparetotal 8.0 -7.0 -> 1
+cotx321 comparetotal 8.0 -7 -> 1
+cotx322 comparetotal 8 -7.0 -> 1
+cotx323 comparetotal 8E+0 -7.0 -> 1
+cotx324 comparetotal 80E-1 -7.0 -> 1
+cotx325 comparetotal .8E+1 -7 -> 1
+cotx326 comparetotal 80E-1 -7 -> 1
+cotx327 comparetotal 8.0 -7E+0 -> 1
+cotx328 comparetotal 8.0 -70E-1 -> 1
+cotx329 comparetotal 8 -.7E+1 -> 1
+cotx330 comparetotal 8 -70E-1 -> 1
+
+cotx340 comparetotal 8.0 -9.0 -> 1
+cotx341 comparetotal 8.0 -9 -> 1
+cotx342 comparetotal 8 -9.0 -> 1
+cotx343 comparetotal 8E+0 -9.0 -> 1
+cotx344 comparetotal 80E-1 -9.0 -> 1
+cotx345 comparetotal .8E+1 -9 -> 1
+cotx346 comparetotal 80E-1 -9 -> 1
+cotx347 comparetotal 8.0 -9E+0 -> 1
+cotx348 comparetotal 8.0 -90E-1 -> 1
+cotx349 comparetotal 8 -.9E+1 -> 1
+cotx350 comparetotal 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+cotx400 comparetotal -7.0 -7.0 -> 0
+cotx401 comparetotal -7.0 -7 -> 1
+cotx402 comparetotal -7 -7.0 -> -1
+cotx403 comparetotal -7E+0 -7.0 -> -1
+cotx404 comparetotal -70E-1 -7.0 -> 0
+cotx405 comparetotal -.7E+1 -7 -> 0
+cotx406 comparetotal -70E-1 -7 -> 1
+cotx407 comparetotal -7.0 -7E+0 -> 1
+cotx408 comparetotal -7.0 -70E-1 -> 0
+cotx409 comparetotal -7 -.7E+1 -> 0
+cotx410 comparetotal -7 -70E-1 -> -1
+
+cotx420 comparetotal -8.0 -7.0 -> -1
+cotx421 comparetotal -8.0 -7 -> -1
+cotx422 comparetotal -8 -7.0 -> -1
+cotx423 comparetotal -8E+0 -7.0 -> -1
+cotx424 comparetotal -80E-1 -7.0 -> -1
+cotx425 comparetotal -.8E+1 -7 -> -1
+cotx426 comparetotal -80E-1 -7 -> -1
+cotx427 comparetotal -8.0 -7E+0 -> -1
+cotx428 comparetotal -8.0 -70E-1 -> -1
+cotx429 comparetotal -8 -.7E+1 -> -1
+cotx430 comparetotal -8 -70E-1 -> -1
+
+cotx440 comparetotal -8.0 -9.0 -> 1
+cotx441 comparetotal -8.0 -9 -> 1
+cotx442 comparetotal -8 -9.0 -> 1
+cotx443 comparetotal -8E+0 -9.0 -> 1
+cotx444 comparetotal -80E-1 -9.0 -> 1
+cotx445 comparetotal -.8E+1 -9 -> 1
+cotx446 comparetotal -80E-1 -9 -> 1
+cotx447 comparetotal -8.0 -9E+0 -> 1
+cotx448 comparetotal -8.0 -90E-1 -> 1
+cotx449 comparetotal -8 -.9E+1 -> 1
+cotx450 comparetotal -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+precision: 40
+cotx470 comparetotal 123.4560000000000000E789 123.456E789 -> -1
+cotx471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1
+cotx472 comparetotal 123.45600000000000E789 123.456E789 -> -1
+cotx473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
+cotx474 comparetotal 123.456000000000E789 123.456E789 -> -1
+cotx475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
+cotx476 comparetotal 123.4560000000E789 123.456E789 -> -1
+cotx477 comparetotal 123.456000000E-89 123.456E-89 -> -1
+cotx478 comparetotal 123.45600000E789 123.456E789 -> -1
+cotx479 comparetotal 123.4560000E-89 123.456E-89 -> -1
+cotx480 comparetotal 123.456000E789 123.456E789 -> -1
+cotx481 comparetotal 123.45600E-89 123.456E-89 -> -1
+cotx482 comparetotal 123.4560E789 123.456E789 -> -1
+cotx483 comparetotal 123.456E-89 123.456E-89 -> 0
+cotx484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1
+cotx485 comparetotal 123.456E789 123.456000000000000E789 -> 1
+cotx486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1
+cotx487 comparetotal 123.456E789 123.4560000000000E789 -> 1
+cotx488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
+cotx489 comparetotal 123.456E789 123.45600000000E789 -> 1
+cotx490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
+cotx491 comparetotal 123.456E789 123.456000000E789 -> 1
+cotx492 comparetotal 123.456E-89 123.45600000E-89 -> 1
+cotx493 comparetotal 123.456E789 123.4560000E789 -> 1
+cotx494 comparetotal 123.456E-89 123.456000E-89 -> 1
+cotx495 comparetotal 123.456E789 123.45600E789 -> 1
+cotx496 comparetotal 123.456E-89 123.4560E-89 -> 1
+cotx497 comparetotal 123.456E789 123.456E789 -> 0
+
+-- wide-ranging, around precision; signs equal
+precision: 9
+cotx500 comparetotal 1 1E-15 -> 1
+cotx501 comparetotal 1 1E-14 -> 1
+cotx502 comparetotal 1 1E-13 -> 1
+cotx503 comparetotal 1 1E-12 -> 1
+cotx504 comparetotal 1 1E-11 -> 1
+cotx505 comparetotal 1 1E-10 -> 1
+cotx506 comparetotal 1 1E-9 -> 1
+cotx507 comparetotal 1 1E-8 -> 1
+cotx508 comparetotal 1 1E-7 -> 1
+cotx509 comparetotal 1 1E-6 -> 1
+cotx510 comparetotal 1 1E-5 -> 1
+cotx511 comparetotal 1 1E-4 -> 1
+cotx512 comparetotal 1 1E-3 -> 1
+cotx513 comparetotal 1 1E-2 -> 1
+cotx514 comparetotal 1 1E-1 -> 1
+cotx515 comparetotal 1 1E-0 -> 0
+cotx516 comparetotal 1 1E+1 -> -1
+cotx517 comparetotal 1 1E+2 -> -1
+cotx518 comparetotal 1 1E+3 -> -1
+cotx519 comparetotal 1 1E+4 -> -1
+cotx521 comparetotal 1 1E+5 -> -1
+cotx522 comparetotal 1 1E+6 -> -1
+cotx523 comparetotal 1 1E+7 -> -1
+cotx524 comparetotal 1 1E+8 -> -1
+cotx525 comparetotal 1 1E+9 -> -1
+cotx526 comparetotal 1 1E+10 -> -1
+cotx527 comparetotal 1 1E+11 -> -1
+cotx528 comparetotal 1 1E+12 -> -1
+cotx529 comparetotal 1 1E+13 -> -1
+cotx530 comparetotal 1 1E+14 -> -1
+cotx531 comparetotal 1 1E+15 -> -1
+-- LR swap
+cotx540 comparetotal 1E-15 1 -> -1
+cotx541 comparetotal 1E-14 1 -> -1
+cotx542 comparetotal 1E-13 1 -> -1
+cotx543 comparetotal 1E-12 1 -> -1
+cotx544 comparetotal 1E-11 1 -> -1
+cotx545 comparetotal 1E-10 1 -> -1
+cotx546 comparetotal 1E-9 1 -> -1
+cotx547 comparetotal 1E-8 1 -> -1
+cotx548 comparetotal 1E-7 1 -> -1
+cotx549 comparetotal 1E-6 1 -> -1
+cotx550 comparetotal 1E-5 1 -> -1
+cotx551 comparetotal 1E-4 1 -> -1
+cotx552 comparetotal 1E-3 1 -> -1
+cotx553 comparetotal 1E-2 1 -> -1
+cotx554 comparetotal 1E-1 1 -> -1
+cotx555 comparetotal 1E-0 1 -> 0
+cotx556 comparetotal 1E+1 1 -> 1
+cotx557 comparetotal 1E+2 1 -> 1
+cotx558 comparetotal 1E+3 1 -> 1
+cotx559 comparetotal 1E+4 1 -> 1
+cotx561 comparetotal 1E+5 1 -> 1
+cotx562 comparetotal 1E+6 1 -> 1
+cotx563 comparetotal 1E+7 1 -> 1
+cotx564 comparetotal 1E+8 1 -> 1
+cotx565 comparetotal 1E+9 1 -> 1
+cotx566 comparetotal 1E+10 1 -> 1
+cotx567 comparetotal 1E+11 1 -> 1
+cotx568 comparetotal 1E+12 1 -> 1
+cotx569 comparetotal 1E+13 1 -> 1
+cotx570 comparetotal 1E+14 1 -> 1
+cotx571 comparetotal 1E+15 1 -> 1
+-- similar with an useful coefficient, one side only
+cotx580 comparetotal 0.000000987654321 1E-15 -> 1
+cotx581 comparetotal 0.000000987654321 1E-14 -> 1
+cotx582 comparetotal 0.000000987654321 1E-13 -> 1
+cotx583 comparetotal 0.000000987654321 1E-12 -> 1
+cotx584 comparetotal 0.000000987654321 1E-11 -> 1
+cotx585 comparetotal 0.000000987654321 1E-10 -> 1
+cotx586 comparetotal 0.000000987654321 1E-9 -> 1
+cotx587 comparetotal 0.000000987654321 1E-8 -> 1
+cotx588 comparetotal 0.000000987654321 1E-7 -> 1
+cotx589 comparetotal 0.000000987654321 1E-6 -> -1
+cotx590 comparetotal 0.000000987654321 1E-5 -> -1
+cotx591 comparetotal 0.000000987654321 1E-4 -> -1
+cotx592 comparetotal 0.000000987654321 1E-3 -> -1
+cotx593 comparetotal 0.000000987654321 1E-2 -> -1
+cotx594 comparetotal 0.000000987654321 1E-1 -> -1
+cotx595 comparetotal 0.000000987654321 1E-0 -> -1
+cotx596 comparetotal 0.000000987654321 1E+1 -> -1
+cotx597 comparetotal 0.000000987654321 1E+2 -> -1
+cotx598 comparetotal 0.000000987654321 1E+3 -> -1
+cotx599 comparetotal 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+precision: 20
+cotx600 comparetotal 12 12.2345 -> -1
+cotx601 comparetotal 12.0 12.2345 -> -1
+cotx602 comparetotal 12.00 12.2345 -> -1
+cotx603 comparetotal 12.000 12.2345 -> -1
+cotx604 comparetotal 12.0000 12.2345 -> -1
+cotx605 comparetotal 12.00000 12.2345 -> -1
+cotx606 comparetotal 12.000000 12.2345 -> -1
+cotx607 comparetotal 12.0000000 12.2345 -> -1
+cotx608 comparetotal 12.00000000 12.2345 -> -1
+cotx609 comparetotal 12.000000000 12.2345 -> -1
+cotx610 comparetotal 12.1234 12 -> 1
+cotx611 comparetotal 12.1234 12.0 -> 1
+cotx612 comparetotal 12.1234 12.00 -> 1
+cotx613 comparetotal 12.1234 12.000 -> 1
+cotx614 comparetotal 12.1234 12.0000 -> 1
+cotx615 comparetotal 12.1234 12.00000 -> 1
+cotx616 comparetotal 12.1234 12.000000 -> 1
+cotx617 comparetotal 12.1234 12.0000000 -> 1
+cotx618 comparetotal 12.1234 12.00000000 -> 1
+cotx619 comparetotal 12.1234 12.000000000 -> 1
+cotx620 comparetotal -12 -12.2345 -> 1
+cotx621 comparetotal -12.0 -12.2345 -> 1
+cotx622 comparetotal -12.00 -12.2345 -> 1
+cotx623 comparetotal -12.000 -12.2345 -> 1
+cotx624 comparetotal -12.0000 -12.2345 -> 1
+cotx625 comparetotal -12.00000 -12.2345 -> 1
+cotx626 comparetotal -12.000000 -12.2345 -> 1
+cotx627 comparetotal -12.0000000 -12.2345 -> 1
+cotx628 comparetotal -12.00000000 -12.2345 -> 1
+cotx629 comparetotal -12.000000000 -12.2345 -> 1
+cotx630 comparetotal -12.1234 -12 -> -1
+cotx631 comparetotal -12.1234 -12.0 -> -1
+cotx632 comparetotal -12.1234 -12.00 -> -1
+cotx633 comparetotal -12.1234 -12.000 -> -1
+cotx634 comparetotal -12.1234 -12.0000 -> -1
+cotx635 comparetotal -12.1234 -12.00000 -> -1
+cotx636 comparetotal -12.1234 -12.000000 -> -1
+cotx637 comparetotal -12.1234 -12.0000000 -> -1
+cotx638 comparetotal -12.1234 -12.00000000 -> -1
+cotx639 comparetotal -12.1234 -12.000000000 -> -1
+precision: 9
+
+-- extended zeros
+cotx640 comparetotal 0 0 -> 0
+cotx641 comparetotal 0 -0 -> 1
+cotx642 comparetotal 0 -0.0 -> 1
+cotx643 comparetotal 0 0.0 -> 1
+cotx644 comparetotal -0 0 -> -1
+cotx645 comparetotal -0 -0 -> 0
+cotx646 comparetotal -0 -0.0 -> -1
+cotx647 comparetotal -0 0.0 -> -1
+cotx648 comparetotal 0.0 0 -> -1
+cotx649 comparetotal 0.0 -0 -> 1
+cotx650 comparetotal 0.0 -0.0 -> 1
+cotx651 comparetotal 0.0 0.0 -> 0
+cotx652 comparetotal -0.0 0 -> -1
+cotx653 comparetotal -0.0 -0 -> 1
+cotx654 comparetotal -0.0 -0.0 -> 0
+cotx655 comparetotal -0.0 0.0 -> -1
+
+cotx656 comparetotal -0E1 0.0 -> -1
+cotx657 comparetotal -0E2 0.0 -> -1
+cotx658 comparetotal 0E1 0.0 -> 1
+cotx659 comparetotal 0E2 0.0 -> 1
+cotx660 comparetotal -0E1 0 -> -1
+cotx661 comparetotal -0E2 0 -> -1
+cotx662 comparetotal 0E1 0 -> 1
+cotx663 comparetotal 0E2 0 -> 1
+cotx664 comparetotal -0E1 -0E1 -> 0
+cotx665 comparetotal -0E2 -0E1 -> -1
+cotx666 comparetotal 0E1 -0E1 -> 1
+cotx667 comparetotal 0E2 -0E1 -> 1
+cotx668 comparetotal -0E1 -0E2 -> 1
+cotx669 comparetotal -0E2 -0E2 -> 0
+cotx670 comparetotal 0E1 -0E2 -> 1
+cotx671 comparetotal 0E2 -0E2 -> 1
+cotx672 comparetotal -0E1 0E1 -> -1
+cotx673 comparetotal -0E2 0E1 -> -1
+cotx674 comparetotal 0E1 0E1 -> 0
+cotx675 comparetotal 0E2 0E1 -> 1
+cotx676 comparetotal -0E1 0E2 -> -1
+cotx677 comparetotal -0E2 0E2 -> -1
+cotx678 comparetotal 0E1 0E2 -> -1
+cotx679 comparetotal 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+precision: 20
+cotx680 comparetotal 12 12 -> 0
+cotx681 comparetotal 12 12.0 -> 1
+cotx682 comparetotal 12 12.00 -> 1
+cotx683 comparetotal 12 12.000 -> 1
+cotx684 comparetotal 12 12.0000 -> 1
+cotx685 comparetotal 12 12.00000 -> 1
+cotx686 comparetotal 12 12.000000 -> 1
+cotx687 comparetotal 12 12.0000000 -> 1
+cotx688 comparetotal 12 12.00000000 -> 1
+cotx689 comparetotal 12 12.000000000 -> 1
+cotx690 comparetotal 12 12 -> 0
+cotx691 comparetotal 12.0 12 -> -1
+cotx692 comparetotal 12.00 12 -> -1
+cotx693 comparetotal 12.000 12 -> -1
+cotx694 comparetotal 12.0000 12 -> -1
+cotx695 comparetotal 12.00000 12 -> -1
+cotx696 comparetotal 12.000000 12 -> -1
+cotx697 comparetotal 12.0000000 12 -> -1
+cotx698 comparetotal 12.00000000 12 -> -1
+cotx699 comparetotal 12.000000000 12 -> -1
+
+-- long operand checks
+maxexponent: 999
+minexponent: -999
+precision: 9
+cotx701 comparetotal 12345678000 1 -> 1
+cotx702 comparetotal 1 12345678000 -> -1
+cotx703 comparetotal 1234567800 1 -> 1
+cotx704 comparetotal 1 1234567800 -> -1
+cotx705 comparetotal 1234567890 1 -> 1
+cotx706 comparetotal 1 1234567890 -> -1
+cotx707 comparetotal 1234567891 1 -> 1
+cotx708 comparetotal 1 1234567891 -> -1
+cotx709 comparetotal 12345678901 1 -> 1
+cotx710 comparetotal 1 12345678901 -> -1
+cotx711 comparetotal 1234567896 1 -> 1
+cotx712 comparetotal 1 1234567896 -> -1
+cotx713 comparetotal -1234567891 1 -> -1
+cotx714 comparetotal 1 -1234567891 -> 1
+cotx715 comparetotal -12345678901 1 -> -1
+cotx716 comparetotal 1 -12345678901 -> 1
+cotx717 comparetotal -1234567896 1 -> -1
+cotx718 comparetotal 1 -1234567896 -> 1
+
+precision: 15
+-- same with plenty of precision
+cotx721 comparetotal 12345678000 1 -> 1
+cotx722 comparetotal 1 12345678000 -> -1
+cotx723 comparetotal 1234567800 1 -> 1
+cotx724 comparetotal 1 1234567800 -> -1
+cotx725 comparetotal 1234567890 1 -> 1
+cotx726 comparetotal 1 1234567890 -> -1
+cotx727 comparetotal 1234567891 1 -> 1
+cotx728 comparetotal 1 1234567891 -> -1
+cotx729 comparetotal 12345678901 1 -> 1
+cotx730 comparetotal 1 12345678901 -> -1
+cotx731 comparetotal 1234567896 1 -> 1
+cotx732 comparetotal 1 1234567896 -> -1
+
+-- residue cases
+precision: 5
+cotx740 comparetotal 1 0.9999999 -> 1
+cotx741 comparetotal 1 0.999999 -> 1
+cotx742 comparetotal 1 0.99999 -> 1
+cotx743 comparetotal 1 1.0000 -> 1
+cotx744 comparetotal 1 1.00001 -> -1
+cotx745 comparetotal 1 1.000001 -> -1
+cotx746 comparetotal 1 1.0000001 -> -1
+cotx750 comparetotal 0.9999999 1 -> -1
+cotx751 comparetotal 0.999999 1 -> -1
+cotx752 comparetotal 0.99999 1 -> -1
+cotx753 comparetotal 1.0000 1 -> -1
+cotx754 comparetotal 1.00001 1 -> 1
+cotx755 comparetotal 1.000001 1 -> 1
+cotx756 comparetotal 1.0000001 1 -> 1
+
+-- a selection of longies
+cotx760 comparetotal -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1
+cotx761 comparetotal -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
+cotx762 comparetotal -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1
+cotx763 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+-- precisions above or below the difference should have no effect
+precision: 11
+cotx764 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 10
+cotx765 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 9
+cotx766 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 8
+cotx767 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 7
+cotx768 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 6
+cotx769 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 5
+cotx770 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 4
+cotx771 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 3
+cotx772 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 2
+cotx773 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 1
+cotx774 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+
+-- Specials
+precision: 9
+cotx780 comparetotal Inf -Inf -> 1
+cotx781 comparetotal Inf -1000 -> 1
+cotx782 comparetotal Inf -1 -> 1
+cotx783 comparetotal Inf -0 -> 1
+cotx784 comparetotal Inf 0 -> 1
+cotx785 comparetotal Inf 1 -> 1
+cotx786 comparetotal Inf 1000 -> 1
+cotx787 comparetotal Inf Inf -> 0
+cotx788 comparetotal -1000 Inf -> -1
+cotx789 comparetotal -Inf Inf -> -1
+cotx790 comparetotal -1 Inf -> -1
+cotx791 comparetotal -0 Inf -> -1
+cotx792 comparetotal 0 Inf -> -1
+cotx793 comparetotal 1 Inf -> -1
+cotx794 comparetotal 1000 Inf -> -1
+cotx795 comparetotal Inf Inf -> 0
+
+cotx800 comparetotal -Inf -Inf -> 0
+cotx801 comparetotal -Inf -1000 -> -1
+cotx802 comparetotal -Inf -1 -> -1
+cotx803 comparetotal -Inf -0 -> -1
+cotx804 comparetotal -Inf 0 -> -1
+cotx805 comparetotal -Inf 1 -> -1
+cotx806 comparetotal -Inf 1000 -> -1
+cotx807 comparetotal -Inf Inf -> -1
+cotx808 comparetotal -Inf -Inf -> 0
+cotx809 comparetotal -1000 -Inf -> 1
+cotx810 comparetotal -1 -Inf -> 1
+cotx811 comparetotal -0 -Inf -> 1
+cotx812 comparetotal 0 -Inf -> 1
+cotx813 comparetotal 1 -Inf -> 1
+cotx814 comparetotal 1000 -Inf -> 1
+cotx815 comparetotal Inf -Inf -> 1
+
+cotx821 comparetotal NaN -Inf -> 1
+cotx822 comparetotal NaN -1000 -> 1
+cotx823 comparetotal NaN -1 -> 1
+cotx824 comparetotal NaN -0 -> 1
+cotx825 comparetotal NaN 0 -> 1
+cotx826 comparetotal NaN 1 -> 1
+cotx827 comparetotal NaN 1000 -> 1
+cotx828 comparetotal NaN Inf -> 1
+cotx829 comparetotal NaN NaN -> 0
+cotx830 comparetotal -Inf NaN -> -1
+cotx831 comparetotal -1000 NaN -> -1
+cotx832 comparetotal -1 NaN -> -1
+cotx833 comparetotal -0 NaN -> -1
+cotx834 comparetotal 0 NaN -> -1
+cotx835 comparetotal 1 NaN -> -1
+cotx836 comparetotal 1000 NaN -> -1
+cotx837 comparetotal Inf NaN -> -1
+cotx838 comparetotal -NaN -NaN -> 0
+cotx839 comparetotal +NaN -NaN -> 1
+cotx840 comparetotal -NaN +NaN -> -1
+
+cotx841 comparetotal sNaN -sNaN -> 1
+cotx842 comparetotal sNaN -NaN -> 1
+cotx843 comparetotal sNaN -Inf -> 1
+cotx844 comparetotal sNaN -1000 -> 1
+cotx845 comparetotal sNaN -1 -> 1
+cotx846 comparetotal sNaN -0 -> 1
+cotx847 comparetotal sNaN 0 -> 1
+cotx848 comparetotal sNaN 1 -> 1
+cotx849 comparetotal sNaN 1000 -> 1
+cotx850 comparetotal sNaN NaN -> -1
+cotx851 comparetotal sNaN sNaN -> 0
+
+cotx852 comparetotal -sNaN sNaN -> -1
+cotx853 comparetotal -NaN sNaN -> -1
+cotx854 comparetotal -Inf sNaN -> -1
+cotx855 comparetotal -1000 sNaN -> -1
+cotx856 comparetotal -1 sNaN -> -1
+cotx857 comparetotal -0 sNaN -> -1
+cotx858 comparetotal 0 sNaN -> -1
+cotx859 comparetotal 1 sNaN -> -1
+cotx860 comparetotal 1000 sNaN -> -1
+cotx861 comparetotal Inf sNaN -> -1
+cotx862 comparetotal NaN sNaN -> 1
+cotx863 comparetotal sNaN sNaN -> 0
+
+cotx871 comparetotal -sNaN -sNaN -> 0
+cotx872 comparetotal -sNaN -NaN -> 1
+cotx873 comparetotal -sNaN -Inf -> -1
+cotx874 comparetotal -sNaN -1000 -> -1
+cotx875 comparetotal -sNaN -1 -> -1
+cotx876 comparetotal -sNaN -0 -> -1
+cotx877 comparetotal -sNaN 0 -> -1
+cotx878 comparetotal -sNaN 1 -> -1
+cotx879 comparetotal -sNaN 1000 -> -1
+cotx880 comparetotal -sNaN NaN -> -1
+cotx881 comparetotal -sNaN sNaN -> -1
+
+cotx882 comparetotal -sNaN -sNaN -> 0
+cotx883 comparetotal -NaN -sNaN -> -1
+cotx884 comparetotal -Inf -sNaN -> 1
+cotx885 comparetotal -1000 -sNaN -> 1
+cotx886 comparetotal -1 -sNaN -> 1
+cotx887 comparetotal -0 -sNaN -> 1
+cotx888 comparetotal 0 -sNaN -> 1
+cotx889 comparetotal 1 -sNaN -> 1
+cotx890 comparetotal 1000 -sNaN -> 1
+cotx891 comparetotal Inf -sNaN -> 1
+cotx892 comparetotal NaN -sNaN -> 1
+cotx893 comparetotal sNaN -sNaN -> 1
+
+-- NaNs with payload
+cotx960 comparetotal NaN9 -Inf -> 1
+cotx961 comparetotal NaN8 999 -> 1
+cotx962 comparetotal NaN77 Inf -> 1
+cotx963 comparetotal -NaN67 NaN5 -> -1
+cotx964 comparetotal -Inf -NaN4 -> 1
+cotx965 comparetotal -999 -NaN33 -> 1
+cotx966 comparetotal Inf NaN2 -> -1
+
+cotx970 comparetotal -NaN41 -NaN42 -> 1
+cotx971 comparetotal +NaN41 -NaN42 -> 1
+cotx972 comparetotal -NaN41 +NaN42 -> -1
+cotx973 comparetotal +NaN41 +NaN42 -> -1
+cotx974 comparetotal -NaN42 -NaN01 -> -1
+cotx975 comparetotal +NaN42 -NaN01 -> 1
+cotx976 comparetotal -NaN42 +NaN01 -> -1
+cotx977 comparetotal +NaN42 +NaN01 -> 1
+
+cotx980 comparetotal -sNaN771 -sNaN772 -> 1
+cotx981 comparetotal +sNaN771 -sNaN772 -> 1
+cotx982 comparetotal -sNaN771 +sNaN772 -> -1
+cotx983 comparetotal +sNaN771 +sNaN772 -> -1
+cotx984 comparetotal -sNaN772 -sNaN771 -> -1
+cotx985 comparetotal +sNaN772 -sNaN771 -> 1
+cotx986 comparetotal -sNaN772 +sNaN771 -> -1
+cotx987 comparetotal +sNaN772 +sNaN771 -> 1
+
+cotx991 comparetotal -sNaN99 -Inf -> -1
+cotx992 comparetotal sNaN98 -11 -> 1
+cotx993 comparetotal sNaN97 NaN -> -1
+cotx994 comparetotal sNaN16 sNaN94 -> -1
+cotx995 comparetotal NaN85 sNaN83 -> 1
+cotx996 comparetotal -Inf sNaN92 -> -1
+cotx997 comparetotal 088 sNaN81 -> -1
+cotx998 comparetotal Inf sNaN90 -> -1
+cotx999 comparetotal NaN -sNaN89 -> 1
+
+-- overflow and underflow tests .. subnormal results now allowed
+maxExponent: 999999999
+minexponent: -999999999
+cotx1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1
+cotx1081 comparetotal 9E+999999999 +1.23456789012345E-0 -> 1
+cotx1082 comparetotal +0.100 9E-999999999 -> 1
+cotx1083 comparetotal 9E-999999999 +0.100 -> -1
+cotx1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1
+cotx1086 comparetotal 9E+999999999 -1.23456789012345E-0 -> 1
+cotx1087 comparetotal -0.100 9E-999999999 -> -1
+cotx1088 comparetotal 9E-999999999 -0.100 -> 1
+
+cotx1089 comparetotal 1e-599999999 1e-400000001 -> -1
+cotx1090 comparetotal 1e-599999999 1e-400000000 -> -1
+cotx1091 comparetotal 1e-600000000 1e-400000000 -> -1
+cotx1092 comparetotal 9e-999999998 0.01 -> -1
+cotx1093 comparetotal 9e-999999998 0.1 -> -1
+cotx1094 comparetotal 0.01 9e-999999998 -> 1
+cotx1095 comparetotal 1e599999999 1e400000001 -> 1
+cotx1096 comparetotal 1e599999999 1e400000000 -> 1
+cotx1097 comparetotal 1e600000000 1e400000000 -> 1
+cotx1098 comparetotal 9e999999998 100 -> 1
+cotx1099 comparetotal 9e999999998 10 -> 1
+cotx1100 comparetotal 100 9e999999998 -> -1
+-- signs
+cotx1101 comparetotal 1e+777777777 1e+411111111 -> 1
+cotx1102 comparetotal 1e+777777777 -1e+411111111 -> 1
+cotx1103 comparetotal -1e+777777777 1e+411111111 -> -1
+cotx1104 comparetotal -1e+777777777 -1e+411111111 -> -1
+cotx1105 comparetotal 1e-777777777 1e-411111111 -> -1
+cotx1106 comparetotal 1e-777777777 -1e-411111111 -> 1
+cotx1107 comparetotal -1e-777777777 1e-411111111 -> -1
+cotx1108 comparetotal -1e-777777777 -1e-411111111 -> 1
+
+-- spread zeros
+cotx1110 comparetotal 0E-383 0 -> -1
+cotx1111 comparetotal 0E-383 -0 -> 1
+cotx1112 comparetotal -0E-383 0 -> -1
+cotx1113 comparetotal -0E-383 -0 -> 1
+cotx1114 comparetotal 0E-383 0E+384 -> -1
+cotx1115 comparetotal 0E-383 -0E+384 -> 1
+cotx1116 comparetotal -0E-383 0E+384 -> -1
+cotx1117 comparetotal -0E-383 -0E+384 -> 1
+cotx1118 comparetotal 0 0E+384 -> -1
+cotx1119 comparetotal 0 -0E+384 -> 1
+cotx1120 comparetotal -0 0E+384 -> -1
+cotx1121 comparetotal -0 -0E+384 -> 1
+
+cotx1130 comparetotal 0E+384 0 -> 1
+cotx1131 comparetotal 0E+384 -0 -> 1
+cotx1132 comparetotal -0E+384 0 -> -1
+cotx1133 comparetotal -0E+384 -0 -> -1
+cotx1134 comparetotal 0E+384 0E-383 -> 1
+cotx1135 comparetotal 0E+384 -0E-383 -> 1
+cotx1136 comparetotal -0E+384 0E-383 -> -1
+cotx1137 comparetotal -0E+384 -0E-383 -> -1
+cotx1138 comparetotal 0 0E-383 -> 1
+cotx1139 comparetotal 0 -0E-383 -> 1
+cotx1140 comparetotal -0 0E-383 -> -1
+cotx1141 comparetotal -0 -0E-383 -> -1
+
+-- Null tests
+cotx9990 comparetotal 10 # -> NaN Invalid_operation
+cotx9991 comparetotal # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/comparetotmag.decTest b/Lib/test/decimaltestdata/comparetotmag.decTest
index cedfdf8843..e87c9f2dbf 100644
--- a/Lib/test/decimaltestdata/comparetotmag.decTest
+++ b/Lib/test/decimaltestdata/comparetotmag.decTest
@@ -1,790 +1,790 @@
-------------------------------------------------------------------------
--- comparetotmag.decTest -- decimal comparison, abs. total ordering --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that it cannot be assumed that add/subtract tests cover paths
--- for this operation adequately, here, because the code might be
--- quite different (comparison cannot overflow or underflow, so
--- actual subtractions are not necessary). Similarly, comparetotal
--- will have some radically different paths than compare.
-
-extended: 1
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
--- sanity checks
-ctmx001 comparetotmag -2 -2 -> 0
-ctmx002 comparetotmag -2 -1 -> 1
-ctmx003 comparetotmag -2 0 -> 1
-ctmx004 comparetotmag -2 1 -> 1
-ctmx005 comparetotmag -2 2 -> 0
-ctmx006 comparetotmag -1 -2 -> -1
-ctmx007 comparetotmag -1 -1 -> 0
-ctmx008 comparetotmag -1 0 -> 1
-ctmx009 comparetotmag -1 1 -> 0
-ctmx010 comparetotmag -1 2 -> -1
-ctmx011 comparetotmag 0 -2 -> -1
-ctmx012 comparetotmag 0 -1 -> -1
-ctmx013 comparetotmag 0 0 -> 0
-ctmx014 comparetotmag 0 1 -> -1
-ctmx015 comparetotmag 0 2 -> -1
-ctmx016 comparetotmag 1 -2 -> -1
-ctmx017 comparetotmag 1 -1 -> 0
-ctmx018 comparetotmag 1 0 -> 1
-ctmx019 comparetotmag 1 1 -> 0
-ctmx020 comparetotmag 1 2 -> -1
-ctmx021 comparetotmag 2 -2 -> 0
-ctmx022 comparetotmag 2 -1 -> 1
-ctmx023 comparetotmag 2 0 -> 1
-ctmx025 comparetotmag 2 1 -> 1
-ctmx026 comparetotmag 2 2 -> 0
-
-ctmx031 comparetotmag -20 -20 -> 0
-ctmx032 comparetotmag -20 -10 -> 1
-ctmx033 comparetotmag -20 00 -> 1
-ctmx034 comparetotmag -20 10 -> 1
-ctmx035 comparetotmag -20 20 -> 0
-ctmx036 comparetotmag -10 -20 -> -1
-ctmx037 comparetotmag -10 -10 -> 0
-ctmx038 comparetotmag -10 00 -> 1
-ctmx039 comparetotmag -10 10 -> 0
-ctmx040 comparetotmag -10 20 -> -1
-ctmx041 comparetotmag 00 -20 -> -1
-ctmx042 comparetotmag 00 -10 -> -1
-ctmx043 comparetotmag 00 00 -> 0
-ctmx044 comparetotmag 00 10 -> -1
-ctmx045 comparetotmag 00 20 -> -1
-ctmx046 comparetotmag 10 -20 -> -1
-ctmx047 comparetotmag 10 -10 -> 0
-ctmx048 comparetotmag 10 00 -> 1
-ctmx049 comparetotmag 10 10 -> 0
-ctmx050 comparetotmag 10 20 -> -1
-ctmx051 comparetotmag 20 -20 -> 0
-ctmx052 comparetotmag 20 -10 -> 1
-ctmx053 comparetotmag 20 00 -> 1
-ctmx055 comparetotmag 20 10 -> 1
-ctmx056 comparetotmag 20 20 -> 0
-
-ctmx061 comparetotmag -2.0 -2.0 -> 0
-ctmx062 comparetotmag -2.0 -1.0 -> 1
-ctmx063 comparetotmag -2.0 0.0 -> 1
-ctmx064 comparetotmag -2.0 1.0 -> 1
-ctmx065 comparetotmag -2.0 2.0 -> 0
-ctmx066 comparetotmag -1.0 -2.0 -> -1
-ctmx067 comparetotmag -1.0 -1.0 -> 0
-ctmx068 comparetotmag -1.0 0.0 -> 1
-ctmx069 comparetotmag -1.0 1.0 -> 0
-ctmx070 comparetotmag -1.0 2.0 -> -1
-ctmx071 comparetotmag 0.0 -2.0 -> -1
-ctmx072 comparetotmag 0.0 -1.0 -> -1
-ctmx073 comparetotmag 0.0 0.0 -> 0
-ctmx074 comparetotmag 0.0 1.0 -> -1
-ctmx075 comparetotmag 0.0 2.0 -> -1
-ctmx076 comparetotmag 1.0 -2.0 -> -1
-ctmx077 comparetotmag 1.0 -1.0 -> 0
-ctmx078 comparetotmag 1.0 0.0 -> 1
-ctmx079 comparetotmag 1.0 1.0 -> 0
-ctmx080 comparetotmag 1.0 2.0 -> -1
-ctmx081 comparetotmag 2.0 -2.0 -> 0
-ctmx082 comparetotmag 2.0 -1.0 -> 1
-ctmx083 comparetotmag 2.0 0.0 -> 1
-ctmx085 comparetotmag 2.0 1.0 -> 1
-ctmx086 comparetotmag 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-maxexponent: 999999999
-minexponent: -999999999
-ctmx090 comparetotmag 9.99999999E+999999999 9.99999999E+999999999 -> 0
-ctmx091 comparetotmag -9.99999999E+999999999 9.99999999E+999999999 -> 0
-ctmx092 comparetotmag 9.99999999E+999999999 -9.99999999E+999999999 -> 0
-ctmx093 comparetotmag -9.99999999E+999999999 -9.99999999E+999999999 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-ctmx100 comparetotmag 7.0 7.0 -> 0
-ctmx101 comparetotmag 7.0 7 -> -1
-ctmx102 comparetotmag 7 7.0 -> 1
-ctmx103 comparetotmag 7E+0 7.0 -> 1
-ctmx104 comparetotmag 70E-1 7.0 -> 0
-ctmx105 comparetotmag 0.7E+1 7 -> 0
-ctmx106 comparetotmag 70E-1 7 -> -1
-ctmx107 comparetotmag 7.0 7E+0 -> -1
-ctmx108 comparetotmag 7.0 70E-1 -> 0
-ctmx109 comparetotmag 7 0.7E+1 -> 0
-ctmx110 comparetotmag 7 70E-1 -> 1
-
-ctmx120 comparetotmag 8.0 7.0 -> 1
-ctmx121 comparetotmag 8.0 7 -> 1
-ctmx122 comparetotmag 8 7.0 -> 1
-ctmx123 comparetotmag 8E+0 7.0 -> 1
-ctmx124 comparetotmag 80E-1 7.0 -> 1
-ctmx125 comparetotmag 0.8E+1 7 -> 1
-ctmx126 comparetotmag 80E-1 7 -> 1
-ctmx127 comparetotmag 8.0 7E+0 -> 1
-ctmx128 comparetotmag 8.0 70E-1 -> 1
-ctmx129 comparetotmag 8 0.7E+1 -> 1
-ctmx130 comparetotmag 8 70E-1 -> 1
-
-ctmx140 comparetotmag 8.0 9.0 -> -1
-ctmx141 comparetotmag 8.0 9 -> -1
-ctmx142 comparetotmag 8 9.0 -> -1
-ctmx143 comparetotmag 8E+0 9.0 -> -1
-ctmx144 comparetotmag 80E-1 9.0 -> -1
-ctmx145 comparetotmag 0.8E+1 9 -> -1
-ctmx146 comparetotmag 80E-1 9 -> -1
-ctmx147 comparetotmag 8.0 9E+0 -> -1
-ctmx148 comparetotmag 8.0 90E-1 -> -1
-ctmx149 comparetotmag 8 0.9E+1 -> -1
-ctmx150 comparetotmag 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ctmx200 comparetotmag -7.0 7.0 -> 0
-ctmx201 comparetotmag -7.0 7 -> -1
-ctmx202 comparetotmag -7 7.0 -> 1
-ctmx203 comparetotmag -7E+0 7.0 -> 1
-ctmx204 comparetotmag -70E-1 7.0 -> 0
-ctmx205 comparetotmag -0.7E+1 7 -> 0
-ctmx206 comparetotmag -70E-1 7 -> -1
-ctmx207 comparetotmag -7.0 7E+0 -> -1
-ctmx208 comparetotmag -7.0 70E-1 -> 0
-ctmx209 comparetotmag -7 0.7E+1 -> 0
-ctmx210 comparetotmag -7 70E-1 -> 1
-
-ctmx220 comparetotmag -8.0 7.0 -> 1
-ctmx221 comparetotmag -8.0 7 -> 1
-ctmx222 comparetotmag -8 7.0 -> 1
-ctmx223 comparetotmag -8E+0 7.0 -> 1
-ctmx224 comparetotmag -80E-1 7.0 -> 1
-ctmx225 comparetotmag -0.8E+1 7 -> 1
-ctmx226 comparetotmag -80E-1 7 -> 1
-ctmx227 comparetotmag -8.0 7E+0 -> 1
-ctmx228 comparetotmag -8.0 70E-1 -> 1
-ctmx229 comparetotmag -8 0.7E+1 -> 1
-ctmx230 comparetotmag -8 70E-1 -> 1
-
-ctmx240 comparetotmag -8.0 9.0 -> -1
-ctmx241 comparetotmag -8.0 9 -> -1
-ctmx242 comparetotmag -8 9.0 -> -1
-ctmx243 comparetotmag -8E+0 9.0 -> -1
-ctmx244 comparetotmag -80E-1 9.0 -> -1
-ctmx245 comparetotmag -0.8E+1 9 -> -1
-ctmx246 comparetotmag -80E-1 9 -> -1
-ctmx247 comparetotmag -8.0 9E+0 -> -1
-ctmx248 comparetotmag -8.0 90E-1 -> -1
-ctmx249 comparetotmag -8 0.9E+1 -> -1
-ctmx250 comparetotmag -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ctmx300 comparetotmag 7.0 -7.0 -> 0
-ctmx301 comparetotmag 7.0 -7 -> -1
-ctmx302 comparetotmag 7 -7.0 -> 1
-ctmx303 comparetotmag 7E+0 -7.0 -> 1
-ctmx304 comparetotmag 70E-1 -7.0 -> 0
-ctmx305 comparetotmag .7E+1 -7 -> 0
-ctmx306 comparetotmag 70E-1 -7 -> -1
-ctmx307 comparetotmag 7.0 -7E+0 -> -1
-ctmx308 comparetotmag 7.0 -70E-1 -> 0
-ctmx309 comparetotmag 7 -.7E+1 -> 0
-ctmx310 comparetotmag 7 -70E-1 -> 1
-
-ctmx320 comparetotmag 8.0 -7.0 -> 1
-ctmx321 comparetotmag 8.0 -7 -> 1
-ctmx322 comparetotmag 8 -7.0 -> 1
-ctmx323 comparetotmag 8E+0 -7.0 -> 1
-ctmx324 comparetotmag 80E-1 -7.0 -> 1
-ctmx325 comparetotmag .8E+1 -7 -> 1
-ctmx326 comparetotmag 80E-1 -7 -> 1
-ctmx327 comparetotmag 8.0 -7E+0 -> 1
-ctmx328 comparetotmag 8.0 -70E-1 -> 1
-ctmx329 comparetotmag 8 -.7E+1 -> 1
-ctmx330 comparetotmag 8 -70E-1 -> 1
-
-ctmx340 comparetotmag 8.0 -9.0 -> -1
-ctmx341 comparetotmag 8.0 -9 -> -1
-ctmx342 comparetotmag 8 -9.0 -> -1
-ctmx343 comparetotmag 8E+0 -9.0 -> -1
-ctmx344 comparetotmag 80E-1 -9.0 -> -1
-ctmx345 comparetotmag .8E+1 -9 -> -1
-ctmx346 comparetotmag 80E-1 -9 -> -1
-ctmx347 comparetotmag 8.0 -9E+0 -> -1
-ctmx348 comparetotmag 8.0 -90E-1 -> -1
-ctmx349 comparetotmag 8 -.9E+1 -> -1
-ctmx350 comparetotmag 8 -90E-1 -> -1
-
--- and again, with sign changes -- ..
-ctmx400 comparetotmag -7.0 -7.0 -> 0
-ctmx401 comparetotmag -7.0 -7 -> -1
-ctmx402 comparetotmag -7 -7.0 -> 1
-ctmx403 comparetotmag -7E+0 -7.0 -> 1
-ctmx404 comparetotmag -70E-1 -7.0 -> 0
-ctmx405 comparetotmag -.7E+1 -7 -> 0
-ctmx406 comparetotmag -70E-1 -7 -> -1
-ctmx407 comparetotmag -7.0 -7E+0 -> -1
-ctmx408 comparetotmag -7.0 -70E-1 -> 0
-ctmx409 comparetotmag -7 -.7E+1 -> 0
-ctmx410 comparetotmag -7 -70E-1 -> 1
-
-ctmx420 comparetotmag -8.0 -7.0 -> 1
-ctmx421 comparetotmag -8.0 -7 -> 1
-ctmx422 comparetotmag -8 -7.0 -> 1
-ctmx423 comparetotmag -8E+0 -7.0 -> 1
-ctmx424 comparetotmag -80E-1 -7.0 -> 1
-ctmx425 comparetotmag -.8E+1 -7 -> 1
-ctmx426 comparetotmag -80E-1 -7 -> 1
-ctmx427 comparetotmag -8.0 -7E+0 -> 1
-ctmx428 comparetotmag -8.0 -70E-1 -> 1
-ctmx429 comparetotmag -8 -.7E+1 -> 1
-ctmx430 comparetotmag -8 -70E-1 -> 1
-
-ctmx440 comparetotmag -8.0 -9.0 -> -1
-ctmx441 comparetotmag -8.0 -9 -> -1
-ctmx442 comparetotmag -8 -9.0 -> -1
-ctmx443 comparetotmag -8E+0 -9.0 -> -1
-ctmx444 comparetotmag -80E-1 -9.0 -> -1
-ctmx445 comparetotmag -.8E+1 -9 -> -1
-ctmx446 comparetotmag -80E-1 -9 -> -1
-ctmx447 comparetotmag -8.0 -9E+0 -> -1
-ctmx448 comparetotmag -8.0 -90E-1 -> -1
-ctmx449 comparetotmag -8 -.9E+1 -> -1
-ctmx450 comparetotmag -8 -90E-1 -> -1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-precision: 40
-ctmx470 comparetotmag 123.4560000000000000E789 123.456E789 -> -1
-ctmx471 comparetotmag 123.456000000000000E-89 123.456E-89 -> -1
-ctmx472 comparetotmag 123.45600000000000E789 123.456E789 -> -1
-ctmx473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
-ctmx474 comparetotmag 123.456000000000E789 123.456E789 -> -1
-ctmx475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
-ctmx476 comparetotmag 123.4560000000E789 123.456E789 -> -1
-ctmx477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
-ctmx478 comparetotmag 123.45600000E789 123.456E789 -> -1
-ctmx479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
-ctmx480 comparetotmag 123.456000E789 123.456E789 -> -1
-ctmx481 comparetotmag 123.45600E-89 123.456E-89 -> -1
-ctmx482 comparetotmag 123.4560E789 123.456E789 -> -1
-ctmx483 comparetotmag 123.456E-89 123.456E-89 -> 0
-ctmx484 comparetotmag 123.456E-89 123.4560000000000000E-89 -> 1
-ctmx485 comparetotmag 123.456E789 123.456000000000000E789 -> 1
-ctmx486 comparetotmag 123.456E-89 123.45600000000000E-89 -> 1
-ctmx487 comparetotmag 123.456E789 123.4560000000000E789 -> 1
-ctmx488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
-ctmx489 comparetotmag 123.456E789 123.45600000000E789 -> 1
-ctmx490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
-ctmx491 comparetotmag 123.456E789 123.456000000E789 -> 1
-ctmx492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
-ctmx493 comparetotmag 123.456E789 123.4560000E789 -> 1
-ctmx494 comparetotmag 123.456E-89 123.456000E-89 -> 1
-ctmx495 comparetotmag 123.456E789 123.45600E789 -> 1
-ctmx496 comparetotmag 123.456E-89 123.4560E-89 -> 1
-ctmx497 comparetotmag 123.456E789 123.456E789 -> 0
-
--- wide-ranging, around precision; signs equal
-precision: 9
-ctmx500 comparetotmag 1 1E-15 -> 1
-ctmx501 comparetotmag 1 1E-14 -> 1
-ctmx502 comparetotmag 1 1E-13 -> 1
-ctmx503 comparetotmag 1 1E-12 -> 1
-ctmx504 comparetotmag 1 1E-11 -> 1
-ctmx505 comparetotmag 1 1E-10 -> 1
-ctmx506 comparetotmag 1 1E-9 -> 1
-ctmx507 comparetotmag 1 1E-8 -> 1
-ctmx508 comparetotmag 1 1E-7 -> 1
-ctmx509 comparetotmag 1 1E-6 -> 1
-ctmx510 comparetotmag 1 1E-5 -> 1
-ctmx511 comparetotmag 1 1E-4 -> 1
-ctmx512 comparetotmag 1 1E-3 -> 1
-ctmx513 comparetotmag 1 1E-2 -> 1
-ctmx514 comparetotmag 1 1E-1 -> 1
-ctmx515 comparetotmag 1 1E-0 -> 0
-ctmx516 comparetotmag 1 1E+1 -> -1
-ctmx517 comparetotmag 1 1E+2 -> -1
-ctmx518 comparetotmag 1 1E+3 -> -1
-ctmx519 comparetotmag 1 1E+4 -> -1
-ctmx521 comparetotmag 1 1E+5 -> -1
-ctmx522 comparetotmag 1 1E+6 -> -1
-ctmx523 comparetotmag 1 1E+7 -> -1
-ctmx524 comparetotmag 1 1E+8 -> -1
-ctmx525 comparetotmag 1 1E+9 -> -1
-ctmx526 comparetotmag 1 1E+10 -> -1
-ctmx527 comparetotmag 1 1E+11 -> -1
-ctmx528 comparetotmag 1 1E+12 -> -1
-ctmx529 comparetotmag 1 1E+13 -> -1
-ctmx530 comparetotmag 1 1E+14 -> -1
-ctmx531 comparetotmag 1 1E+15 -> -1
--- LR swap
-ctmx540 comparetotmag 1E-15 1 -> -1
-ctmx541 comparetotmag 1E-14 1 -> -1
-ctmx542 comparetotmag 1E-13 1 -> -1
-ctmx543 comparetotmag 1E-12 1 -> -1
-ctmx544 comparetotmag 1E-11 1 -> -1
-ctmx545 comparetotmag 1E-10 1 -> -1
-ctmx546 comparetotmag 1E-9 1 -> -1
-ctmx547 comparetotmag 1E-8 1 -> -1
-ctmx548 comparetotmag 1E-7 1 -> -1
-ctmx549 comparetotmag 1E-6 1 -> -1
-ctmx550 comparetotmag 1E-5 1 -> -1
-ctmx551 comparetotmag 1E-4 1 -> -1
-ctmx552 comparetotmag 1E-3 1 -> -1
-ctmx553 comparetotmag 1E-2 1 -> -1
-ctmx554 comparetotmag 1E-1 1 -> -1
-ctmx555 comparetotmag 1E-0 1 -> 0
-ctmx556 comparetotmag 1E+1 1 -> 1
-ctmx557 comparetotmag 1E+2 1 -> 1
-ctmx558 comparetotmag 1E+3 1 -> 1
-ctmx559 comparetotmag 1E+4 1 -> 1
-ctmx561 comparetotmag 1E+5 1 -> 1
-ctmx562 comparetotmag 1E+6 1 -> 1
-ctmx563 comparetotmag 1E+7 1 -> 1
-ctmx564 comparetotmag 1E+8 1 -> 1
-ctmx565 comparetotmag 1E+9 1 -> 1
-ctmx566 comparetotmag 1E+10 1 -> 1
-ctmx567 comparetotmag 1E+11 1 -> 1
-ctmx568 comparetotmag 1E+12 1 -> 1
-ctmx569 comparetotmag 1E+13 1 -> 1
-ctmx570 comparetotmag 1E+14 1 -> 1
-ctmx571 comparetotmag 1E+15 1 -> 1
--- similar with an useful coefficient, one side only
-ctmx580 comparetotmag 0.000000987654321 1E-15 -> 1
-ctmx581 comparetotmag 0.000000987654321 1E-14 -> 1
-ctmx582 comparetotmag 0.000000987654321 1E-13 -> 1
-ctmx583 comparetotmag 0.000000987654321 1E-12 -> 1
-ctmx584 comparetotmag 0.000000987654321 1E-11 -> 1
-ctmx585 comparetotmag 0.000000987654321 1E-10 -> 1
-ctmx586 comparetotmag 0.000000987654321 1E-9 -> 1
-ctmx587 comparetotmag 0.000000987654321 1E-8 -> 1
-ctmx588 comparetotmag 0.000000987654321 1E-7 -> 1
-ctmx589 comparetotmag 0.000000987654321 1E-6 -> -1
-ctmx590 comparetotmag 0.000000987654321 1E-5 -> -1
-ctmx591 comparetotmag 0.000000987654321 1E-4 -> -1
-ctmx592 comparetotmag 0.000000987654321 1E-3 -> -1
-ctmx593 comparetotmag 0.000000987654321 1E-2 -> -1
-ctmx594 comparetotmag 0.000000987654321 1E-1 -> -1
-ctmx595 comparetotmag 0.000000987654321 1E-0 -> -1
-ctmx596 comparetotmag 0.000000987654321 1E+1 -> -1
-ctmx597 comparetotmag 0.000000987654321 1E+2 -> -1
-ctmx598 comparetotmag 0.000000987654321 1E+3 -> -1
-ctmx599 comparetotmag 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-precision: 20
-ctmx600 comparetotmag 12 12.2345 -> -1
-ctmx601 comparetotmag 12.0 12.2345 -> -1
-ctmx602 comparetotmag 12.00 12.2345 -> -1
-ctmx603 comparetotmag 12.000 12.2345 -> -1
-ctmx604 comparetotmag 12.0000 12.2345 -> -1
-ctmx605 comparetotmag 12.00000 12.2345 -> -1
-ctmx606 comparetotmag 12.000000 12.2345 -> -1
-ctmx607 comparetotmag 12.0000000 12.2345 -> -1
-ctmx608 comparetotmag 12.00000000 12.2345 -> -1
-ctmx609 comparetotmag 12.000000000 12.2345 -> -1
-ctmx610 comparetotmag 12.1234 12 -> 1
-ctmx611 comparetotmag 12.1234 12.0 -> 1
-ctmx612 comparetotmag 12.1234 12.00 -> 1
-ctmx613 comparetotmag 12.1234 12.000 -> 1
-ctmx614 comparetotmag 12.1234 12.0000 -> 1
-ctmx615 comparetotmag 12.1234 12.00000 -> 1
-ctmx616 comparetotmag 12.1234 12.000000 -> 1
-ctmx617 comparetotmag 12.1234 12.0000000 -> 1
-ctmx618 comparetotmag 12.1234 12.00000000 -> 1
-ctmx619 comparetotmag 12.1234 12.000000000 -> 1
-ctmx620 comparetotmag -12 -12.2345 -> -1
-ctmx621 comparetotmag -12.0 -12.2345 -> -1
-ctmx622 comparetotmag -12.00 -12.2345 -> -1
-ctmx623 comparetotmag -12.000 -12.2345 -> -1
-ctmx624 comparetotmag -12.0000 -12.2345 -> -1
-ctmx625 comparetotmag -12.00000 -12.2345 -> -1
-ctmx626 comparetotmag -12.000000 -12.2345 -> -1
-ctmx627 comparetotmag -12.0000000 -12.2345 -> -1
-ctmx628 comparetotmag -12.00000000 -12.2345 -> -1
-ctmx629 comparetotmag -12.000000000 -12.2345 -> -1
-ctmx630 comparetotmag -12.1234 -12 -> 1
-ctmx631 comparetotmag -12.1234 -12.0 -> 1
-ctmx632 comparetotmag -12.1234 -12.00 -> 1
-ctmx633 comparetotmag -12.1234 -12.000 -> 1
-ctmx634 comparetotmag -12.1234 -12.0000 -> 1
-ctmx635 comparetotmag -12.1234 -12.00000 -> 1
-ctmx636 comparetotmag -12.1234 -12.000000 -> 1
-ctmx637 comparetotmag -12.1234 -12.0000000 -> 1
-ctmx638 comparetotmag -12.1234 -12.00000000 -> 1
-ctmx639 comparetotmag -12.1234 -12.000000000 -> 1
-precision: 9
-
--- extended zeros
-ctmx640 comparetotmag 0 0 -> 0
-ctmx641 comparetotmag 0 -0 -> 0
-ctmx642 comparetotmag 0 -0.0 -> 1
-ctmx643 comparetotmag 0 0.0 -> 1
-ctmx644 comparetotmag -0 0 -> 0
-ctmx645 comparetotmag -0 -0 -> 0
-ctmx646 comparetotmag -0 -0.0 -> 1
-ctmx647 comparetotmag -0 0.0 -> 1
-ctmx648 comparetotmag 0.0 0 -> -1
-ctmx649 comparetotmag 0.0 -0 -> -1
-ctmx650 comparetotmag 0.0 -0.0 -> 0
-ctmx651 comparetotmag 0.0 0.0 -> 0
-ctmx652 comparetotmag -0.0 0 -> -1
-ctmx653 comparetotmag -0.0 -0 -> -1
-ctmx654 comparetotmag -0.0 -0.0 -> 0
-ctmx655 comparetotmag -0.0 0.0 -> 0
-
-ctmx656 comparetotmag -0E1 0.0 -> 1
-ctmx657 comparetotmag -0E2 0.0 -> 1
-ctmx658 comparetotmag 0E1 0.0 -> 1
-ctmx659 comparetotmag 0E2 0.0 -> 1
-ctmx660 comparetotmag -0E1 0 -> 1
-ctmx661 comparetotmag -0E2 0 -> 1
-ctmx662 comparetotmag 0E1 0 -> 1
-ctmx663 comparetotmag 0E2 0 -> 1
-ctmx664 comparetotmag -0E1 -0E1 -> 0
-ctmx665 comparetotmag -0E2 -0E1 -> 1
-ctmx666 comparetotmag 0E1 -0E1 -> 0
-ctmx667 comparetotmag 0E2 -0E1 -> 1
-ctmx668 comparetotmag -0E1 -0E2 -> -1
-ctmx669 comparetotmag -0E2 -0E2 -> 0
-ctmx670 comparetotmag 0E1 -0E2 -> -1
-ctmx671 comparetotmag 0E2 -0E2 -> 0
-ctmx672 comparetotmag -0E1 0E1 -> 0
-ctmx673 comparetotmag -0E2 0E1 -> 1
-ctmx674 comparetotmag 0E1 0E1 -> 0
-ctmx675 comparetotmag 0E2 0E1 -> 1
-ctmx676 comparetotmag -0E1 0E2 -> -1
-ctmx677 comparetotmag -0E2 0E2 -> 0
-ctmx678 comparetotmag 0E1 0E2 -> -1
-ctmx679 comparetotmag 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-precision: 20
-ctmx680 comparetotmag 12 12 -> 0
-ctmx681 comparetotmag 12 12.0 -> 1
-ctmx682 comparetotmag 12 12.00 -> 1
-ctmx683 comparetotmag 12 12.000 -> 1
-ctmx684 comparetotmag 12 12.0000 -> 1
-ctmx685 comparetotmag 12 12.00000 -> 1
-ctmx686 comparetotmag 12 12.000000 -> 1
-ctmx687 comparetotmag 12 12.0000000 -> 1
-ctmx688 comparetotmag 12 12.00000000 -> 1
-ctmx689 comparetotmag 12 12.000000000 -> 1
-ctmx690 comparetotmag 12 12 -> 0
-ctmx691 comparetotmag 12.0 12 -> -1
-ctmx692 comparetotmag 12.00 12 -> -1
-ctmx693 comparetotmag 12.000 12 -> -1
-ctmx694 comparetotmag 12.0000 12 -> -1
-ctmx695 comparetotmag 12.00000 12 -> -1
-ctmx696 comparetotmag 12.000000 12 -> -1
-ctmx697 comparetotmag 12.0000000 12 -> -1
-ctmx698 comparetotmag 12.00000000 12 -> -1
-ctmx699 comparetotmag 12.000000000 12 -> -1
-
--- long operand checks
-maxexponent: 999
-minexponent: -999
-precision: 9
-ctmx701 comparetotmag 12345678000 1 -> 1
-ctmx702 comparetotmag 1 12345678000 -> -1
-ctmx703 comparetotmag 1234567800 1 -> 1
-ctmx704 comparetotmag 1 1234567800 -> -1
-ctmx705 comparetotmag 1234567890 1 -> 1
-ctmx706 comparetotmag 1 1234567890 -> -1
-ctmx707 comparetotmag 1234567891 1 -> 1
-ctmx708 comparetotmag 1 1234567891 -> -1
-ctmx709 comparetotmag 12345678901 1 -> 1
-ctmx710 comparetotmag 1 12345678901 -> -1
-ctmx711 comparetotmag 1234567896 1 -> 1
-ctmx712 comparetotmag 1 1234567896 -> -1
-ctmx713 comparetotmag -1234567891 1 -> 1
-ctmx714 comparetotmag 1 -1234567891 -> -1
-ctmx715 comparetotmag -12345678901 1 -> 1
-ctmx716 comparetotmag 1 -12345678901 -> -1
-ctmx717 comparetotmag -1234567896 1 -> 1
-ctmx718 comparetotmag 1 -1234567896 -> -1
-
-precision: 15
--- same with plenty of precision
-ctmx721 comparetotmag 12345678000 1 -> 1
-ctmx722 comparetotmag 1 12345678000 -> -1
-ctmx723 comparetotmag 1234567800 1 -> 1
-ctmx724 comparetotmag 1 1234567800 -> -1
-ctmx725 comparetotmag 1234567890 1 -> 1
-ctmx726 comparetotmag 1 1234567890 -> -1
-ctmx727 comparetotmag 1234567891 1 -> 1
-ctmx728 comparetotmag 1 1234567891 -> -1
-ctmx729 comparetotmag 12345678901 1 -> 1
-ctmx730 comparetotmag 1 12345678901 -> -1
-ctmx731 comparetotmag 1234567896 1 -> 1
-ctmx732 comparetotmag 1 1234567896 -> -1
-
--- residue cases
-precision: 5
-ctmx740 comparetotmag 1 0.9999999 -> 1
-ctmx741 comparetotmag 1 0.999999 -> 1
-ctmx742 comparetotmag 1 0.99999 -> 1
-ctmx743 comparetotmag 1 1.0000 -> 1
-ctmx744 comparetotmag 1 1.00001 -> -1
-ctmx745 comparetotmag 1 1.000001 -> -1
-ctmx746 comparetotmag 1 1.0000001 -> -1
-ctmx750 comparetotmag 0.9999999 1 -> -1
-ctmx751 comparetotmag 0.999999 1 -> -1
-ctmx752 comparetotmag 0.99999 1 -> -1
-ctmx753 comparetotmag 1.0000 1 -> -1
-ctmx754 comparetotmag 1.00001 1 -> 1
-ctmx755 comparetotmag 1.000001 1 -> 1
-ctmx756 comparetotmag 1.0000001 1 -> 1
-
--- a selection of longies
-ctmx760 comparetotmag -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> 1
-ctmx761 comparetotmag -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
-ctmx762 comparetotmag -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> 1
-ctmx763 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
--- precisions above or below the difference should have no effect
-precision: 11
-ctmx764 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 10
-ctmx765 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 9
-ctmx766 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 8
-ctmx767 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 7
-ctmx768 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 6
-ctmx769 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 5
-ctmx770 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 4
-ctmx771 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 3
-ctmx772 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 2
-ctmx773 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 1
-ctmx774 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-
--- Specials
-precision: 9
-ctmx780 comparetotmag Inf -Inf -> 0
-ctmx781 comparetotmag Inf -1000 -> 1
-ctmx782 comparetotmag Inf -1 -> 1
-ctmx783 comparetotmag Inf -0 -> 1
-ctmx784 comparetotmag Inf 0 -> 1
-ctmx785 comparetotmag Inf 1 -> 1
-ctmx786 comparetotmag Inf 1000 -> 1
-ctmx787 comparetotmag Inf Inf -> 0
-ctmx788 comparetotmag -1000 Inf -> -1
-ctmx789 comparetotmag -Inf Inf -> 0
-ctmx790 comparetotmag -1 Inf -> -1
-ctmx791 comparetotmag -0 Inf -> -1
-ctmx792 comparetotmag 0 Inf -> -1
-ctmx793 comparetotmag 1 Inf -> -1
-ctmx794 comparetotmag 1000 Inf -> -1
-ctmx795 comparetotmag Inf Inf -> 0
-
-ctmx800 comparetotmag -Inf -Inf -> 0
-ctmx801 comparetotmag -Inf -1000 -> 1
-ctmx802 comparetotmag -Inf -1 -> 1
-ctmx803 comparetotmag -Inf -0 -> 1
-ctmx804 comparetotmag -Inf 0 -> 1
-ctmx805 comparetotmag -Inf 1 -> 1
-ctmx806 comparetotmag -Inf 1000 -> 1
-ctmx807 comparetotmag -Inf Inf -> 0
-ctmx808 comparetotmag -Inf -Inf -> 0
-ctmx809 comparetotmag -1000 -Inf -> -1
-ctmx810 comparetotmag -1 -Inf -> -1
-ctmx811 comparetotmag -0 -Inf -> -1
-ctmx812 comparetotmag 0 -Inf -> -1
-ctmx813 comparetotmag 1 -Inf -> -1
-ctmx814 comparetotmag 1000 -Inf -> -1
-ctmx815 comparetotmag Inf -Inf -> 0
-
-ctmx821 comparetotmag NaN -Inf -> 1
-ctmx822 comparetotmag NaN -1000 -> 1
-ctmx823 comparetotmag NaN -1 -> 1
-ctmx824 comparetotmag NaN -0 -> 1
-ctmx825 comparetotmag NaN 0 -> 1
-ctmx826 comparetotmag NaN 1 -> 1
-ctmx827 comparetotmag NaN 1000 -> 1
-ctmx828 comparetotmag NaN Inf -> 1
-ctmx829 comparetotmag NaN NaN -> 0
-ctmx830 comparetotmag -Inf NaN -> -1
-ctmx831 comparetotmag -1000 NaN -> -1
-ctmx832 comparetotmag -1 NaN -> -1
-ctmx833 comparetotmag -0 NaN -> -1
-ctmx834 comparetotmag 0 NaN -> -1
-ctmx835 comparetotmag 1 NaN -> -1
-ctmx836 comparetotmag 1000 NaN -> -1
-ctmx837 comparetotmag Inf NaN -> -1
-ctmx838 comparetotmag -NaN -NaN -> 0
-ctmx839 comparetotmag +NaN -NaN -> 0
-ctmx840 comparetotmag -NaN +NaN -> 0
-
-ctmx841 comparetotmag sNaN -sNaN -> 0
-ctmx842 comparetotmag sNaN -NaN -> -1
-ctmx843 comparetotmag sNaN -Inf -> 1
-ctmx844 comparetotmag sNaN -1000 -> 1
-ctmx845 comparetotmag sNaN -1 -> 1
-ctmx846 comparetotmag sNaN -0 -> 1
-ctmx847 comparetotmag sNaN 0 -> 1
-ctmx848 comparetotmag sNaN 1 -> 1
-ctmx849 comparetotmag sNaN 1000 -> 1
-ctmx850 comparetotmag sNaN NaN -> -1
-ctmx851 comparetotmag sNaN sNaN -> 0
-
-ctmx852 comparetotmag -sNaN sNaN -> 0
-ctmx853 comparetotmag -NaN sNaN -> 1
-ctmx854 comparetotmag -Inf sNaN -> -1
-ctmx855 comparetotmag -1000 sNaN -> -1
-ctmx856 comparetotmag -1 sNaN -> -1
-ctmx857 comparetotmag -0 sNaN -> -1
-ctmx858 comparetotmag 0 sNaN -> -1
-ctmx859 comparetotmag 1 sNaN -> -1
-ctmx860 comparetotmag 1000 sNaN -> -1
-ctmx861 comparetotmag Inf sNaN -> -1
-ctmx862 comparetotmag NaN sNaN -> 1
-ctmx863 comparetotmag sNaN sNaN -> 0
-
-ctmx871 comparetotmag -sNaN -sNaN -> 0
-ctmx872 comparetotmag -sNaN -NaN -> -1
-ctmx873 comparetotmag -sNaN -Inf -> 1
-ctmx874 comparetotmag -sNaN -1000 -> 1
-ctmx875 comparetotmag -sNaN -1 -> 1
-ctmx876 comparetotmag -sNaN -0 -> 1
-ctmx877 comparetotmag -sNaN 0 -> 1
-ctmx878 comparetotmag -sNaN 1 -> 1
-ctmx879 comparetotmag -sNaN 1000 -> 1
-ctmx880 comparetotmag -sNaN NaN -> -1
-ctmx881 comparetotmag -sNaN sNaN -> 0
-
-ctmx882 comparetotmag -sNaN -sNaN -> 0
-ctmx883 comparetotmag -NaN -sNaN -> 1
-ctmx884 comparetotmag -Inf -sNaN -> -1
-ctmx885 comparetotmag -1000 -sNaN -> -1
-ctmx886 comparetotmag -1 -sNaN -> -1
-ctmx887 comparetotmag -0 -sNaN -> -1
-ctmx888 comparetotmag 0 -sNaN -> -1
-ctmx889 comparetotmag 1 -sNaN -> -1
-ctmx890 comparetotmag 1000 -sNaN -> -1
-ctmx891 comparetotmag Inf -sNaN -> -1
-ctmx892 comparetotmag NaN -sNaN -> 1
-ctmx893 comparetotmag sNaN -sNaN -> 0
-
--- NaNs with payload
-ctmx960 comparetotmag NaN9 -Inf -> 1
-ctmx961 comparetotmag NaN8 999 -> 1
-ctmx962 comparetotmag NaN77 Inf -> 1
-ctmx963 comparetotmag -NaN67 NaN5 -> 1
-ctmx964 comparetotmag -Inf -NaN4 -> -1
-ctmx965 comparetotmag -999 -NaN33 -> -1
-ctmx966 comparetotmag Inf NaN2 -> -1
-
-ctmx970 comparetotmag -NaN41 -NaN42 -> -1
-ctmx971 comparetotmag +NaN41 -NaN42 -> -1
-ctmx972 comparetotmag -NaN41 +NaN42 -> -1
-ctmx973 comparetotmag +NaN41 +NaN42 -> -1
-ctmx974 comparetotmag -NaN42 -NaN01 -> 1
-ctmx975 comparetotmag +NaN42 -NaN01 -> 1
-ctmx976 comparetotmag -NaN42 +NaN01 -> 1
-ctmx977 comparetotmag +NaN42 +NaN01 -> 1
-
-ctmx980 comparetotmag -sNaN771 -sNaN772 -> -1
-ctmx981 comparetotmag +sNaN771 -sNaN772 -> -1
-ctmx982 comparetotmag -sNaN771 +sNaN772 -> -1
-ctmx983 comparetotmag +sNaN771 +sNaN772 -> -1
-ctmx984 comparetotmag -sNaN772 -sNaN771 -> 1
-ctmx985 comparetotmag +sNaN772 -sNaN771 -> 1
-ctmx986 comparetotmag -sNaN772 +sNaN771 -> 1
-ctmx987 comparetotmag +sNaN772 +sNaN771 -> 1
-
-ctmx991 comparetotmag -sNaN99 -Inf -> 1
-ctmx992 comparetotmag sNaN98 -11 -> 1
-ctmx993 comparetotmag sNaN97 NaN -> -1
-ctmx994 comparetotmag sNaN16 sNaN94 -> -1
-ctmx995 comparetotmag NaN85 sNaN83 -> 1
-ctmx996 comparetotmag -Inf sNaN92 -> -1
-ctmx997 comparetotmag 088 sNaN81 -> -1
-ctmx998 comparetotmag Inf sNaN90 -> -1
-ctmx999 comparetotmag NaN -sNaN89 -> 1
-
--- overflow and underflow tests .. subnormal results now allowed
-maxExponent: 999999999
-minexponent: -999999999
-ctmx1080 comparetotmag +1.23456789012345E-0 9E+999999999 -> -1
-ctmx1081 comparetotmag 9E+999999999 +1.23456789012345E-0 -> 1
-ctmx1082 comparetotmag +0.100 9E-999999999 -> 1
-ctmx1083 comparetotmag 9E-999999999 +0.100 -> -1
-ctmx1085 comparetotmag -1.23456789012345E-0 9E+999999999 -> -1
-ctmx1086 comparetotmag 9E+999999999 -1.23456789012345E-0 -> 1
-ctmx1087 comparetotmag -0.100 9E-999999999 -> 1
-ctmx1088 comparetotmag 9E-999999999 -0.100 -> -1
-
-ctmx1089 comparetotmag 1e-599999999 1e-400000001 -> -1
-ctmx1090 comparetotmag 1e-599999999 1e-400000000 -> -1
-ctmx1091 comparetotmag 1e-600000000 1e-400000000 -> -1
-ctmx1092 comparetotmag 9e-999999998 0.01 -> -1
-ctmx1093 comparetotmag 9e-999999998 0.1 -> -1
-ctmx1094 comparetotmag 0.01 9e-999999998 -> 1
-ctmx1095 comparetotmag 1e599999999 1e400000001 -> 1
-ctmx1096 comparetotmag 1e599999999 1e400000000 -> 1
-ctmx1097 comparetotmag 1e600000000 1e400000000 -> 1
-ctmx1098 comparetotmag 9e999999998 100 -> 1
-ctmx1099 comparetotmag 9e999999998 10 -> 1
-ctmx1100 comparetotmag 100 9e999999998 -> -1
--- signs
-ctmx1101 comparetotmag 1e+777777777 1e+411111111 -> 1
-ctmx1102 comparetotmag 1e+777777777 -1e+411111111 -> 1
-ctmx1103 comparetotmag -1e+777777777 1e+411111111 -> 1
-ctmx1104 comparetotmag -1e+777777777 -1e+411111111 -> 1
-ctmx1105 comparetotmag 1e-777777777 1e-411111111 -> -1
-ctmx1106 comparetotmag 1e-777777777 -1e-411111111 -> -1
-ctmx1107 comparetotmag -1e-777777777 1e-411111111 -> -1
-ctmx1108 comparetotmag -1e-777777777 -1e-411111111 -> -1
-
--- spread zeros
-ctmx1110 comparetotmag 0E-383 0 -> -1
-ctmx1111 comparetotmag 0E-383 -0 -> -1
-ctmx1112 comparetotmag -0E-383 0 -> -1
-ctmx1113 comparetotmag -0E-383 -0 -> -1
-ctmx1114 comparetotmag 0E-383 0E+384 -> -1
-ctmx1115 comparetotmag 0E-383 -0E+384 -> -1
-ctmx1116 comparetotmag -0E-383 0E+384 -> -1
-ctmx1117 comparetotmag -0E-383 -0E+384 -> -1
-ctmx1118 comparetotmag 0 0E+384 -> -1
-ctmx1119 comparetotmag 0 -0E+384 -> -1
-ctmx1120 comparetotmag -0 0E+384 -> -1
-ctmx1121 comparetotmag -0 -0E+384 -> -1
-
-ctmx1130 comparetotmag 0E+384 0 -> 1
-ctmx1131 comparetotmag 0E+384 -0 -> 1
-ctmx1132 comparetotmag -0E+384 0 -> 1
-ctmx1133 comparetotmag -0E+384 -0 -> 1
-ctmx1134 comparetotmag 0E+384 0E-383 -> 1
-ctmx1135 comparetotmag 0E+384 -0E-383 -> 1
-ctmx1136 comparetotmag -0E+384 0E-383 -> 1
-ctmx1137 comparetotmag -0E+384 -0E-383 -> 1
-ctmx1138 comparetotmag 0 0E-383 -> 1
-ctmx1139 comparetotmag 0 -0E-383 -> 1
-ctmx1140 comparetotmag -0 0E-383 -> 1
-ctmx1141 comparetotmag -0 -0E-383 -> 1
-
--- Null tests
-ctmx9990 comparetotmag 10 # -> NaN Invalid_operation
-ctmx9991 comparetotmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- comparetotmag.decTest -- decimal comparison, abs. total ordering --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that it cannot be assumed that add/subtract tests cover paths
+-- for this operation adequately, here, because the code might be
+-- quite different (comparison cannot overflow or underflow, so
+-- actual subtractions are not necessary). Similarly, comparetotal
+-- will have some radically different paths than compare.
+
+extended: 1
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+-- sanity checks
+ctmx001 comparetotmag -2 -2 -> 0
+ctmx002 comparetotmag -2 -1 -> 1
+ctmx003 comparetotmag -2 0 -> 1
+ctmx004 comparetotmag -2 1 -> 1
+ctmx005 comparetotmag -2 2 -> 0
+ctmx006 comparetotmag -1 -2 -> -1
+ctmx007 comparetotmag -1 -1 -> 0
+ctmx008 comparetotmag -1 0 -> 1
+ctmx009 comparetotmag -1 1 -> 0
+ctmx010 comparetotmag -1 2 -> -1
+ctmx011 comparetotmag 0 -2 -> -1
+ctmx012 comparetotmag 0 -1 -> -1
+ctmx013 comparetotmag 0 0 -> 0
+ctmx014 comparetotmag 0 1 -> -1
+ctmx015 comparetotmag 0 2 -> -1
+ctmx016 comparetotmag 1 -2 -> -1
+ctmx017 comparetotmag 1 -1 -> 0
+ctmx018 comparetotmag 1 0 -> 1
+ctmx019 comparetotmag 1 1 -> 0
+ctmx020 comparetotmag 1 2 -> -1
+ctmx021 comparetotmag 2 -2 -> 0
+ctmx022 comparetotmag 2 -1 -> 1
+ctmx023 comparetotmag 2 0 -> 1
+ctmx025 comparetotmag 2 1 -> 1
+ctmx026 comparetotmag 2 2 -> 0
+
+ctmx031 comparetotmag -20 -20 -> 0
+ctmx032 comparetotmag -20 -10 -> 1
+ctmx033 comparetotmag -20 00 -> 1
+ctmx034 comparetotmag -20 10 -> 1
+ctmx035 comparetotmag -20 20 -> 0
+ctmx036 comparetotmag -10 -20 -> -1
+ctmx037 comparetotmag -10 -10 -> 0
+ctmx038 comparetotmag -10 00 -> 1
+ctmx039 comparetotmag -10 10 -> 0
+ctmx040 comparetotmag -10 20 -> -1
+ctmx041 comparetotmag 00 -20 -> -1
+ctmx042 comparetotmag 00 -10 -> -1
+ctmx043 comparetotmag 00 00 -> 0
+ctmx044 comparetotmag 00 10 -> -1
+ctmx045 comparetotmag 00 20 -> -1
+ctmx046 comparetotmag 10 -20 -> -1
+ctmx047 comparetotmag 10 -10 -> 0
+ctmx048 comparetotmag 10 00 -> 1
+ctmx049 comparetotmag 10 10 -> 0
+ctmx050 comparetotmag 10 20 -> -1
+ctmx051 comparetotmag 20 -20 -> 0
+ctmx052 comparetotmag 20 -10 -> 1
+ctmx053 comparetotmag 20 00 -> 1
+ctmx055 comparetotmag 20 10 -> 1
+ctmx056 comparetotmag 20 20 -> 0
+
+ctmx061 comparetotmag -2.0 -2.0 -> 0
+ctmx062 comparetotmag -2.0 -1.0 -> 1
+ctmx063 comparetotmag -2.0 0.0 -> 1
+ctmx064 comparetotmag -2.0 1.0 -> 1
+ctmx065 comparetotmag -2.0 2.0 -> 0
+ctmx066 comparetotmag -1.0 -2.0 -> -1
+ctmx067 comparetotmag -1.0 -1.0 -> 0
+ctmx068 comparetotmag -1.0 0.0 -> 1
+ctmx069 comparetotmag -1.0 1.0 -> 0
+ctmx070 comparetotmag -1.0 2.0 -> -1
+ctmx071 comparetotmag 0.0 -2.0 -> -1
+ctmx072 comparetotmag 0.0 -1.0 -> -1
+ctmx073 comparetotmag 0.0 0.0 -> 0
+ctmx074 comparetotmag 0.0 1.0 -> -1
+ctmx075 comparetotmag 0.0 2.0 -> -1
+ctmx076 comparetotmag 1.0 -2.0 -> -1
+ctmx077 comparetotmag 1.0 -1.0 -> 0
+ctmx078 comparetotmag 1.0 0.0 -> 1
+ctmx079 comparetotmag 1.0 1.0 -> 0
+ctmx080 comparetotmag 1.0 2.0 -> -1
+ctmx081 comparetotmag 2.0 -2.0 -> 0
+ctmx082 comparetotmag 2.0 -1.0 -> 1
+ctmx083 comparetotmag 2.0 0.0 -> 1
+ctmx085 comparetotmag 2.0 1.0 -> 1
+ctmx086 comparetotmag 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+maxexponent: 999999999
+minexponent: -999999999
+ctmx090 comparetotmag 9.99999999E+999999999 9.99999999E+999999999 -> 0
+ctmx091 comparetotmag -9.99999999E+999999999 9.99999999E+999999999 -> 0
+ctmx092 comparetotmag 9.99999999E+999999999 -9.99999999E+999999999 -> 0
+ctmx093 comparetotmag -9.99999999E+999999999 -9.99999999E+999999999 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+ctmx100 comparetotmag 7.0 7.0 -> 0
+ctmx101 comparetotmag 7.0 7 -> -1
+ctmx102 comparetotmag 7 7.0 -> 1
+ctmx103 comparetotmag 7E+0 7.0 -> 1
+ctmx104 comparetotmag 70E-1 7.0 -> 0
+ctmx105 comparetotmag 0.7E+1 7 -> 0
+ctmx106 comparetotmag 70E-1 7 -> -1
+ctmx107 comparetotmag 7.0 7E+0 -> -1
+ctmx108 comparetotmag 7.0 70E-1 -> 0
+ctmx109 comparetotmag 7 0.7E+1 -> 0
+ctmx110 comparetotmag 7 70E-1 -> 1
+
+ctmx120 comparetotmag 8.0 7.0 -> 1
+ctmx121 comparetotmag 8.0 7 -> 1
+ctmx122 comparetotmag 8 7.0 -> 1
+ctmx123 comparetotmag 8E+0 7.0 -> 1
+ctmx124 comparetotmag 80E-1 7.0 -> 1
+ctmx125 comparetotmag 0.8E+1 7 -> 1
+ctmx126 comparetotmag 80E-1 7 -> 1
+ctmx127 comparetotmag 8.0 7E+0 -> 1
+ctmx128 comparetotmag 8.0 70E-1 -> 1
+ctmx129 comparetotmag 8 0.7E+1 -> 1
+ctmx130 comparetotmag 8 70E-1 -> 1
+
+ctmx140 comparetotmag 8.0 9.0 -> -1
+ctmx141 comparetotmag 8.0 9 -> -1
+ctmx142 comparetotmag 8 9.0 -> -1
+ctmx143 comparetotmag 8E+0 9.0 -> -1
+ctmx144 comparetotmag 80E-1 9.0 -> -1
+ctmx145 comparetotmag 0.8E+1 9 -> -1
+ctmx146 comparetotmag 80E-1 9 -> -1
+ctmx147 comparetotmag 8.0 9E+0 -> -1
+ctmx148 comparetotmag 8.0 90E-1 -> -1
+ctmx149 comparetotmag 8 0.9E+1 -> -1
+ctmx150 comparetotmag 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ctmx200 comparetotmag -7.0 7.0 -> 0
+ctmx201 comparetotmag -7.0 7 -> -1
+ctmx202 comparetotmag -7 7.0 -> 1
+ctmx203 comparetotmag -7E+0 7.0 -> 1
+ctmx204 comparetotmag -70E-1 7.0 -> 0
+ctmx205 comparetotmag -0.7E+1 7 -> 0
+ctmx206 comparetotmag -70E-1 7 -> -1
+ctmx207 comparetotmag -7.0 7E+0 -> -1
+ctmx208 comparetotmag -7.0 70E-1 -> 0
+ctmx209 comparetotmag -7 0.7E+1 -> 0
+ctmx210 comparetotmag -7 70E-1 -> 1
+
+ctmx220 comparetotmag -8.0 7.0 -> 1
+ctmx221 comparetotmag -8.0 7 -> 1
+ctmx222 comparetotmag -8 7.0 -> 1
+ctmx223 comparetotmag -8E+0 7.0 -> 1
+ctmx224 comparetotmag -80E-1 7.0 -> 1
+ctmx225 comparetotmag -0.8E+1 7 -> 1
+ctmx226 comparetotmag -80E-1 7 -> 1
+ctmx227 comparetotmag -8.0 7E+0 -> 1
+ctmx228 comparetotmag -8.0 70E-1 -> 1
+ctmx229 comparetotmag -8 0.7E+1 -> 1
+ctmx230 comparetotmag -8 70E-1 -> 1
+
+ctmx240 comparetotmag -8.0 9.0 -> -1
+ctmx241 comparetotmag -8.0 9 -> -1
+ctmx242 comparetotmag -8 9.0 -> -1
+ctmx243 comparetotmag -8E+0 9.0 -> -1
+ctmx244 comparetotmag -80E-1 9.0 -> -1
+ctmx245 comparetotmag -0.8E+1 9 -> -1
+ctmx246 comparetotmag -80E-1 9 -> -1
+ctmx247 comparetotmag -8.0 9E+0 -> -1
+ctmx248 comparetotmag -8.0 90E-1 -> -1
+ctmx249 comparetotmag -8 0.9E+1 -> -1
+ctmx250 comparetotmag -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ctmx300 comparetotmag 7.0 -7.0 -> 0
+ctmx301 comparetotmag 7.0 -7 -> -1
+ctmx302 comparetotmag 7 -7.0 -> 1
+ctmx303 comparetotmag 7E+0 -7.0 -> 1
+ctmx304 comparetotmag 70E-1 -7.0 -> 0
+ctmx305 comparetotmag .7E+1 -7 -> 0
+ctmx306 comparetotmag 70E-1 -7 -> -1
+ctmx307 comparetotmag 7.0 -7E+0 -> -1
+ctmx308 comparetotmag 7.0 -70E-1 -> 0
+ctmx309 comparetotmag 7 -.7E+1 -> 0
+ctmx310 comparetotmag 7 -70E-1 -> 1
+
+ctmx320 comparetotmag 8.0 -7.0 -> 1
+ctmx321 comparetotmag 8.0 -7 -> 1
+ctmx322 comparetotmag 8 -7.0 -> 1
+ctmx323 comparetotmag 8E+0 -7.0 -> 1
+ctmx324 comparetotmag 80E-1 -7.0 -> 1
+ctmx325 comparetotmag .8E+1 -7 -> 1
+ctmx326 comparetotmag 80E-1 -7 -> 1
+ctmx327 comparetotmag 8.0 -7E+0 -> 1
+ctmx328 comparetotmag 8.0 -70E-1 -> 1
+ctmx329 comparetotmag 8 -.7E+1 -> 1
+ctmx330 comparetotmag 8 -70E-1 -> 1
+
+ctmx340 comparetotmag 8.0 -9.0 -> -1
+ctmx341 comparetotmag 8.0 -9 -> -1
+ctmx342 comparetotmag 8 -9.0 -> -1
+ctmx343 comparetotmag 8E+0 -9.0 -> -1
+ctmx344 comparetotmag 80E-1 -9.0 -> -1
+ctmx345 comparetotmag .8E+1 -9 -> -1
+ctmx346 comparetotmag 80E-1 -9 -> -1
+ctmx347 comparetotmag 8.0 -9E+0 -> -1
+ctmx348 comparetotmag 8.0 -90E-1 -> -1
+ctmx349 comparetotmag 8 -.9E+1 -> -1
+ctmx350 comparetotmag 8 -90E-1 -> -1
+
+-- and again, with sign changes -- ..
+ctmx400 comparetotmag -7.0 -7.0 -> 0
+ctmx401 comparetotmag -7.0 -7 -> -1
+ctmx402 comparetotmag -7 -7.0 -> 1
+ctmx403 comparetotmag -7E+0 -7.0 -> 1
+ctmx404 comparetotmag -70E-1 -7.0 -> 0
+ctmx405 comparetotmag -.7E+1 -7 -> 0
+ctmx406 comparetotmag -70E-1 -7 -> -1
+ctmx407 comparetotmag -7.0 -7E+0 -> -1
+ctmx408 comparetotmag -7.0 -70E-1 -> 0
+ctmx409 comparetotmag -7 -.7E+1 -> 0
+ctmx410 comparetotmag -7 -70E-1 -> 1
+
+ctmx420 comparetotmag -8.0 -7.0 -> 1
+ctmx421 comparetotmag -8.0 -7 -> 1
+ctmx422 comparetotmag -8 -7.0 -> 1
+ctmx423 comparetotmag -8E+0 -7.0 -> 1
+ctmx424 comparetotmag -80E-1 -7.0 -> 1
+ctmx425 comparetotmag -.8E+1 -7 -> 1
+ctmx426 comparetotmag -80E-1 -7 -> 1
+ctmx427 comparetotmag -8.0 -7E+0 -> 1
+ctmx428 comparetotmag -8.0 -70E-1 -> 1
+ctmx429 comparetotmag -8 -.7E+1 -> 1
+ctmx430 comparetotmag -8 -70E-1 -> 1
+
+ctmx440 comparetotmag -8.0 -9.0 -> -1
+ctmx441 comparetotmag -8.0 -9 -> -1
+ctmx442 comparetotmag -8 -9.0 -> -1
+ctmx443 comparetotmag -8E+0 -9.0 -> -1
+ctmx444 comparetotmag -80E-1 -9.0 -> -1
+ctmx445 comparetotmag -.8E+1 -9 -> -1
+ctmx446 comparetotmag -80E-1 -9 -> -1
+ctmx447 comparetotmag -8.0 -9E+0 -> -1
+ctmx448 comparetotmag -8.0 -90E-1 -> -1
+ctmx449 comparetotmag -8 -.9E+1 -> -1
+ctmx450 comparetotmag -8 -90E-1 -> -1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+precision: 40
+ctmx470 comparetotmag 123.4560000000000000E789 123.456E789 -> -1
+ctmx471 comparetotmag 123.456000000000000E-89 123.456E-89 -> -1
+ctmx472 comparetotmag 123.45600000000000E789 123.456E789 -> -1
+ctmx473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
+ctmx474 comparetotmag 123.456000000000E789 123.456E789 -> -1
+ctmx475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
+ctmx476 comparetotmag 123.4560000000E789 123.456E789 -> -1
+ctmx477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
+ctmx478 comparetotmag 123.45600000E789 123.456E789 -> -1
+ctmx479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
+ctmx480 comparetotmag 123.456000E789 123.456E789 -> -1
+ctmx481 comparetotmag 123.45600E-89 123.456E-89 -> -1
+ctmx482 comparetotmag 123.4560E789 123.456E789 -> -1
+ctmx483 comparetotmag 123.456E-89 123.456E-89 -> 0
+ctmx484 comparetotmag 123.456E-89 123.4560000000000000E-89 -> 1
+ctmx485 comparetotmag 123.456E789 123.456000000000000E789 -> 1
+ctmx486 comparetotmag 123.456E-89 123.45600000000000E-89 -> 1
+ctmx487 comparetotmag 123.456E789 123.4560000000000E789 -> 1
+ctmx488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
+ctmx489 comparetotmag 123.456E789 123.45600000000E789 -> 1
+ctmx490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
+ctmx491 comparetotmag 123.456E789 123.456000000E789 -> 1
+ctmx492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
+ctmx493 comparetotmag 123.456E789 123.4560000E789 -> 1
+ctmx494 comparetotmag 123.456E-89 123.456000E-89 -> 1
+ctmx495 comparetotmag 123.456E789 123.45600E789 -> 1
+ctmx496 comparetotmag 123.456E-89 123.4560E-89 -> 1
+ctmx497 comparetotmag 123.456E789 123.456E789 -> 0
+
+-- wide-ranging, around precision; signs equal
+precision: 9
+ctmx500 comparetotmag 1 1E-15 -> 1
+ctmx501 comparetotmag 1 1E-14 -> 1
+ctmx502 comparetotmag 1 1E-13 -> 1
+ctmx503 comparetotmag 1 1E-12 -> 1
+ctmx504 comparetotmag 1 1E-11 -> 1
+ctmx505 comparetotmag 1 1E-10 -> 1
+ctmx506 comparetotmag 1 1E-9 -> 1
+ctmx507 comparetotmag 1 1E-8 -> 1
+ctmx508 comparetotmag 1 1E-7 -> 1
+ctmx509 comparetotmag 1 1E-6 -> 1
+ctmx510 comparetotmag 1 1E-5 -> 1
+ctmx511 comparetotmag 1 1E-4 -> 1
+ctmx512 comparetotmag 1 1E-3 -> 1
+ctmx513 comparetotmag 1 1E-2 -> 1
+ctmx514 comparetotmag 1 1E-1 -> 1
+ctmx515 comparetotmag 1 1E-0 -> 0
+ctmx516 comparetotmag 1 1E+1 -> -1
+ctmx517 comparetotmag 1 1E+2 -> -1
+ctmx518 comparetotmag 1 1E+3 -> -1
+ctmx519 comparetotmag 1 1E+4 -> -1
+ctmx521 comparetotmag 1 1E+5 -> -1
+ctmx522 comparetotmag 1 1E+6 -> -1
+ctmx523 comparetotmag 1 1E+7 -> -1
+ctmx524 comparetotmag 1 1E+8 -> -1
+ctmx525 comparetotmag 1 1E+9 -> -1
+ctmx526 comparetotmag 1 1E+10 -> -1
+ctmx527 comparetotmag 1 1E+11 -> -1
+ctmx528 comparetotmag 1 1E+12 -> -1
+ctmx529 comparetotmag 1 1E+13 -> -1
+ctmx530 comparetotmag 1 1E+14 -> -1
+ctmx531 comparetotmag 1 1E+15 -> -1
+-- LR swap
+ctmx540 comparetotmag 1E-15 1 -> -1
+ctmx541 comparetotmag 1E-14 1 -> -1
+ctmx542 comparetotmag 1E-13 1 -> -1
+ctmx543 comparetotmag 1E-12 1 -> -1
+ctmx544 comparetotmag 1E-11 1 -> -1
+ctmx545 comparetotmag 1E-10 1 -> -1
+ctmx546 comparetotmag 1E-9 1 -> -1
+ctmx547 comparetotmag 1E-8 1 -> -1
+ctmx548 comparetotmag 1E-7 1 -> -1
+ctmx549 comparetotmag 1E-6 1 -> -1
+ctmx550 comparetotmag 1E-5 1 -> -1
+ctmx551 comparetotmag 1E-4 1 -> -1
+ctmx552 comparetotmag 1E-3 1 -> -1
+ctmx553 comparetotmag 1E-2 1 -> -1
+ctmx554 comparetotmag 1E-1 1 -> -1
+ctmx555 comparetotmag 1E-0 1 -> 0
+ctmx556 comparetotmag 1E+1 1 -> 1
+ctmx557 comparetotmag 1E+2 1 -> 1
+ctmx558 comparetotmag 1E+3 1 -> 1
+ctmx559 comparetotmag 1E+4 1 -> 1
+ctmx561 comparetotmag 1E+5 1 -> 1
+ctmx562 comparetotmag 1E+6 1 -> 1
+ctmx563 comparetotmag 1E+7 1 -> 1
+ctmx564 comparetotmag 1E+8 1 -> 1
+ctmx565 comparetotmag 1E+9 1 -> 1
+ctmx566 comparetotmag 1E+10 1 -> 1
+ctmx567 comparetotmag 1E+11 1 -> 1
+ctmx568 comparetotmag 1E+12 1 -> 1
+ctmx569 comparetotmag 1E+13 1 -> 1
+ctmx570 comparetotmag 1E+14 1 -> 1
+ctmx571 comparetotmag 1E+15 1 -> 1
+-- similar with an useful coefficient, one side only
+ctmx580 comparetotmag 0.000000987654321 1E-15 -> 1
+ctmx581 comparetotmag 0.000000987654321 1E-14 -> 1
+ctmx582 comparetotmag 0.000000987654321 1E-13 -> 1
+ctmx583 comparetotmag 0.000000987654321 1E-12 -> 1
+ctmx584 comparetotmag 0.000000987654321 1E-11 -> 1
+ctmx585 comparetotmag 0.000000987654321 1E-10 -> 1
+ctmx586 comparetotmag 0.000000987654321 1E-9 -> 1
+ctmx587 comparetotmag 0.000000987654321 1E-8 -> 1
+ctmx588 comparetotmag 0.000000987654321 1E-7 -> 1
+ctmx589 comparetotmag 0.000000987654321 1E-6 -> -1
+ctmx590 comparetotmag 0.000000987654321 1E-5 -> -1
+ctmx591 comparetotmag 0.000000987654321 1E-4 -> -1
+ctmx592 comparetotmag 0.000000987654321 1E-3 -> -1
+ctmx593 comparetotmag 0.000000987654321 1E-2 -> -1
+ctmx594 comparetotmag 0.000000987654321 1E-1 -> -1
+ctmx595 comparetotmag 0.000000987654321 1E-0 -> -1
+ctmx596 comparetotmag 0.000000987654321 1E+1 -> -1
+ctmx597 comparetotmag 0.000000987654321 1E+2 -> -1
+ctmx598 comparetotmag 0.000000987654321 1E+3 -> -1
+ctmx599 comparetotmag 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+precision: 20
+ctmx600 comparetotmag 12 12.2345 -> -1
+ctmx601 comparetotmag 12.0 12.2345 -> -1
+ctmx602 comparetotmag 12.00 12.2345 -> -1
+ctmx603 comparetotmag 12.000 12.2345 -> -1
+ctmx604 comparetotmag 12.0000 12.2345 -> -1
+ctmx605 comparetotmag 12.00000 12.2345 -> -1
+ctmx606 comparetotmag 12.000000 12.2345 -> -1
+ctmx607 comparetotmag 12.0000000 12.2345 -> -1
+ctmx608 comparetotmag 12.00000000 12.2345 -> -1
+ctmx609 comparetotmag 12.000000000 12.2345 -> -1
+ctmx610 comparetotmag 12.1234 12 -> 1
+ctmx611 comparetotmag 12.1234 12.0 -> 1
+ctmx612 comparetotmag 12.1234 12.00 -> 1
+ctmx613 comparetotmag 12.1234 12.000 -> 1
+ctmx614 comparetotmag 12.1234 12.0000 -> 1
+ctmx615 comparetotmag 12.1234 12.00000 -> 1
+ctmx616 comparetotmag 12.1234 12.000000 -> 1
+ctmx617 comparetotmag 12.1234 12.0000000 -> 1
+ctmx618 comparetotmag 12.1234 12.00000000 -> 1
+ctmx619 comparetotmag 12.1234 12.000000000 -> 1
+ctmx620 comparetotmag -12 -12.2345 -> -1
+ctmx621 comparetotmag -12.0 -12.2345 -> -1
+ctmx622 comparetotmag -12.00 -12.2345 -> -1
+ctmx623 comparetotmag -12.000 -12.2345 -> -1
+ctmx624 comparetotmag -12.0000 -12.2345 -> -1
+ctmx625 comparetotmag -12.00000 -12.2345 -> -1
+ctmx626 comparetotmag -12.000000 -12.2345 -> -1
+ctmx627 comparetotmag -12.0000000 -12.2345 -> -1
+ctmx628 comparetotmag -12.00000000 -12.2345 -> -1
+ctmx629 comparetotmag -12.000000000 -12.2345 -> -1
+ctmx630 comparetotmag -12.1234 -12 -> 1
+ctmx631 comparetotmag -12.1234 -12.0 -> 1
+ctmx632 comparetotmag -12.1234 -12.00 -> 1
+ctmx633 comparetotmag -12.1234 -12.000 -> 1
+ctmx634 comparetotmag -12.1234 -12.0000 -> 1
+ctmx635 comparetotmag -12.1234 -12.00000 -> 1
+ctmx636 comparetotmag -12.1234 -12.000000 -> 1
+ctmx637 comparetotmag -12.1234 -12.0000000 -> 1
+ctmx638 comparetotmag -12.1234 -12.00000000 -> 1
+ctmx639 comparetotmag -12.1234 -12.000000000 -> 1
+precision: 9
+
+-- extended zeros
+ctmx640 comparetotmag 0 0 -> 0
+ctmx641 comparetotmag 0 -0 -> 0
+ctmx642 comparetotmag 0 -0.0 -> 1
+ctmx643 comparetotmag 0 0.0 -> 1
+ctmx644 comparetotmag -0 0 -> 0
+ctmx645 comparetotmag -0 -0 -> 0
+ctmx646 comparetotmag -0 -0.0 -> 1
+ctmx647 comparetotmag -0 0.0 -> 1
+ctmx648 comparetotmag 0.0 0 -> -1
+ctmx649 comparetotmag 0.0 -0 -> -1
+ctmx650 comparetotmag 0.0 -0.0 -> 0
+ctmx651 comparetotmag 0.0 0.0 -> 0
+ctmx652 comparetotmag -0.0 0 -> -1
+ctmx653 comparetotmag -0.0 -0 -> -1
+ctmx654 comparetotmag -0.0 -0.0 -> 0
+ctmx655 comparetotmag -0.0 0.0 -> 0
+
+ctmx656 comparetotmag -0E1 0.0 -> 1
+ctmx657 comparetotmag -0E2 0.0 -> 1
+ctmx658 comparetotmag 0E1 0.0 -> 1
+ctmx659 comparetotmag 0E2 0.0 -> 1
+ctmx660 comparetotmag -0E1 0 -> 1
+ctmx661 comparetotmag -0E2 0 -> 1
+ctmx662 comparetotmag 0E1 0 -> 1
+ctmx663 comparetotmag 0E2 0 -> 1
+ctmx664 comparetotmag -0E1 -0E1 -> 0
+ctmx665 comparetotmag -0E2 -0E1 -> 1
+ctmx666 comparetotmag 0E1 -0E1 -> 0
+ctmx667 comparetotmag 0E2 -0E1 -> 1
+ctmx668 comparetotmag -0E1 -0E2 -> -1
+ctmx669 comparetotmag -0E2 -0E2 -> 0
+ctmx670 comparetotmag 0E1 -0E2 -> -1
+ctmx671 comparetotmag 0E2 -0E2 -> 0
+ctmx672 comparetotmag -0E1 0E1 -> 0
+ctmx673 comparetotmag -0E2 0E1 -> 1
+ctmx674 comparetotmag 0E1 0E1 -> 0
+ctmx675 comparetotmag 0E2 0E1 -> 1
+ctmx676 comparetotmag -0E1 0E2 -> -1
+ctmx677 comparetotmag -0E2 0E2 -> 0
+ctmx678 comparetotmag 0E1 0E2 -> -1
+ctmx679 comparetotmag 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+precision: 20
+ctmx680 comparetotmag 12 12 -> 0
+ctmx681 comparetotmag 12 12.0 -> 1
+ctmx682 comparetotmag 12 12.00 -> 1
+ctmx683 comparetotmag 12 12.000 -> 1
+ctmx684 comparetotmag 12 12.0000 -> 1
+ctmx685 comparetotmag 12 12.00000 -> 1
+ctmx686 comparetotmag 12 12.000000 -> 1
+ctmx687 comparetotmag 12 12.0000000 -> 1
+ctmx688 comparetotmag 12 12.00000000 -> 1
+ctmx689 comparetotmag 12 12.000000000 -> 1
+ctmx690 comparetotmag 12 12 -> 0
+ctmx691 comparetotmag 12.0 12 -> -1
+ctmx692 comparetotmag 12.00 12 -> -1
+ctmx693 comparetotmag 12.000 12 -> -1
+ctmx694 comparetotmag 12.0000 12 -> -1
+ctmx695 comparetotmag 12.00000 12 -> -1
+ctmx696 comparetotmag 12.000000 12 -> -1
+ctmx697 comparetotmag 12.0000000 12 -> -1
+ctmx698 comparetotmag 12.00000000 12 -> -1
+ctmx699 comparetotmag 12.000000000 12 -> -1
+
+-- long operand checks
+maxexponent: 999
+minexponent: -999
+precision: 9
+ctmx701 comparetotmag 12345678000 1 -> 1
+ctmx702 comparetotmag 1 12345678000 -> -1
+ctmx703 comparetotmag 1234567800 1 -> 1
+ctmx704 comparetotmag 1 1234567800 -> -1
+ctmx705 comparetotmag 1234567890 1 -> 1
+ctmx706 comparetotmag 1 1234567890 -> -1
+ctmx707 comparetotmag 1234567891 1 -> 1
+ctmx708 comparetotmag 1 1234567891 -> -1
+ctmx709 comparetotmag 12345678901 1 -> 1
+ctmx710 comparetotmag 1 12345678901 -> -1
+ctmx711 comparetotmag 1234567896 1 -> 1
+ctmx712 comparetotmag 1 1234567896 -> -1
+ctmx713 comparetotmag -1234567891 1 -> 1
+ctmx714 comparetotmag 1 -1234567891 -> -1
+ctmx715 comparetotmag -12345678901 1 -> 1
+ctmx716 comparetotmag 1 -12345678901 -> -1
+ctmx717 comparetotmag -1234567896 1 -> 1
+ctmx718 comparetotmag 1 -1234567896 -> -1
+
+precision: 15
+-- same with plenty of precision
+ctmx721 comparetotmag 12345678000 1 -> 1
+ctmx722 comparetotmag 1 12345678000 -> -1
+ctmx723 comparetotmag 1234567800 1 -> 1
+ctmx724 comparetotmag 1 1234567800 -> -1
+ctmx725 comparetotmag 1234567890 1 -> 1
+ctmx726 comparetotmag 1 1234567890 -> -1
+ctmx727 comparetotmag 1234567891 1 -> 1
+ctmx728 comparetotmag 1 1234567891 -> -1
+ctmx729 comparetotmag 12345678901 1 -> 1
+ctmx730 comparetotmag 1 12345678901 -> -1
+ctmx731 comparetotmag 1234567896 1 -> 1
+ctmx732 comparetotmag 1 1234567896 -> -1
+
+-- residue cases
+precision: 5
+ctmx740 comparetotmag 1 0.9999999 -> 1
+ctmx741 comparetotmag 1 0.999999 -> 1
+ctmx742 comparetotmag 1 0.99999 -> 1
+ctmx743 comparetotmag 1 1.0000 -> 1
+ctmx744 comparetotmag 1 1.00001 -> -1
+ctmx745 comparetotmag 1 1.000001 -> -1
+ctmx746 comparetotmag 1 1.0000001 -> -1
+ctmx750 comparetotmag 0.9999999 1 -> -1
+ctmx751 comparetotmag 0.999999 1 -> -1
+ctmx752 comparetotmag 0.99999 1 -> -1
+ctmx753 comparetotmag 1.0000 1 -> -1
+ctmx754 comparetotmag 1.00001 1 -> 1
+ctmx755 comparetotmag 1.000001 1 -> 1
+ctmx756 comparetotmag 1.0000001 1 -> 1
+
+-- a selection of longies
+ctmx760 comparetotmag -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> 1
+ctmx761 comparetotmag -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
+ctmx762 comparetotmag -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> 1
+ctmx763 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+-- precisions above or below the difference should have no effect
+precision: 11
+ctmx764 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 10
+ctmx765 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 9
+ctmx766 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 8
+ctmx767 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 7
+ctmx768 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 6
+ctmx769 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 5
+ctmx770 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 4
+ctmx771 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 3
+ctmx772 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 2
+ctmx773 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 1
+ctmx774 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+
+-- Specials
+precision: 9
+ctmx780 comparetotmag Inf -Inf -> 0
+ctmx781 comparetotmag Inf -1000 -> 1
+ctmx782 comparetotmag Inf -1 -> 1
+ctmx783 comparetotmag Inf -0 -> 1
+ctmx784 comparetotmag Inf 0 -> 1
+ctmx785 comparetotmag Inf 1 -> 1
+ctmx786 comparetotmag Inf 1000 -> 1
+ctmx787 comparetotmag Inf Inf -> 0
+ctmx788 comparetotmag -1000 Inf -> -1
+ctmx789 comparetotmag -Inf Inf -> 0
+ctmx790 comparetotmag -1 Inf -> -1
+ctmx791 comparetotmag -0 Inf -> -1
+ctmx792 comparetotmag 0 Inf -> -1
+ctmx793 comparetotmag 1 Inf -> -1
+ctmx794 comparetotmag 1000 Inf -> -1
+ctmx795 comparetotmag Inf Inf -> 0
+
+ctmx800 comparetotmag -Inf -Inf -> 0
+ctmx801 comparetotmag -Inf -1000 -> 1
+ctmx802 comparetotmag -Inf -1 -> 1
+ctmx803 comparetotmag -Inf -0 -> 1
+ctmx804 comparetotmag -Inf 0 -> 1
+ctmx805 comparetotmag -Inf 1 -> 1
+ctmx806 comparetotmag -Inf 1000 -> 1
+ctmx807 comparetotmag -Inf Inf -> 0
+ctmx808 comparetotmag -Inf -Inf -> 0
+ctmx809 comparetotmag -1000 -Inf -> -1
+ctmx810 comparetotmag -1 -Inf -> -1
+ctmx811 comparetotmag -0 -Inf -> -1
+ctmx812 comparetotmag 0 -Inf -> -1
+ctmx813 comparetotmag 1 -Inf -> -1
+ctmx814 comparetotmag 1000 -Inf -> -1
+ctmx815 comparetotmag Inf -Inf -> 0
+
+ctmx821 comparetotmag NaN -Inf -> 1
+ctmx822 comparetotmag NaN -1000 -> 1
+ctmx823 comparetotmag NaN -1 -> 1
+ctmx824 comparetotmag NaN -0 -> 1
+ctmx825 comparetotmag NaN 0 -> 1
+ctmx826 comparetotmag NaN 1 -> 1
+ctmx827 comparetotmag NaN 1000 -> 1
+ctmx828 comparetotmag NaN Inf -> 1
+ctmx829 comparetotmag NaN NaN -> 0
+ctmx830 comparetotmag -Inf NaN -> -1
+ctmx831 comparetotmag -1000 NaN -> -1
+ctmx832 comparetotmag -1 NaN -> -1
+ctmx833 comparetotmag -0 NaN -> -1
+ctmx834 comparetotmag 0 NaN -> -1
+ctmx835 comparetotmag 1 NaN -> -1
+ctmx836 comparetotmag 1000 NaN -> -1
+ctmx837 comparetotmag Inf NaN -> -1
+ctmx838 comparetotmag -NaN -NaN -> 0
+ctmx839 comparetotmag +NaN -NaN -> 0
+ctmx840 comparetotmag -NaN +NaN -> 0
+
+ctmx841 comparetotmag sNaN -sNaN -> 0
+ctmx842 comparetotmag sNaN -NaN -> -1
+ctmx843 comparetotmag sNaN -Inf -> 1
+ctmx844 comparetotmag sNaN -1000 -> 1
+ctmx845 comparetotmag sNaN -1 -> 1
+ctmx846 comparetotmag sNaN -0 -> 1
+ctmx847 comparetotmag sNaN 0 -> 1
+ctmx848 comparetotmag sNaN 1 -> 1
+ctmx849 comparetotmag sNaN 1000 -> 1
+ctmx850 comparetotmag sNaN NaN -> -1
+ctmx851 comparetotmag sNaN sNaN -> 0
+
+ctmx852 comparetotmag -sNaN sNaN -> 0
+ctmx853 comparetotmag -NaN sNaN -> 1
+ctmx854 comparetotmag -Inf sNaN -> -1
+ctmx855 comparetotmag -1000 sNaN -> -1
+ctmx856 comparetotmag -1 sNaN -> -1
+ctmx857 comparetotmag -0 sNaN -> -1
+ctmx858 comparetotmag 0 sNaN -> -1
+ctmx859 comparetotmag 1 sNaN -> -1
+ctmx860 comparetotmag 1000 sNaN -> -1
+ctmx861 comparetotmag Inf sNaN -> -1
+ctmx862 comparetotmag NaN sNaN -> 1
+ctmx863 comparetotmag sNaN sNaN -> 0
+
+ctmx871 comparetotmag -sNaN -sNaN -> 0
+ctmx872 comparetotmag -sNaN -NaN -> -1
+ctmx873 comparetotmag -sNaN -Inf -> 1
+ctmx874 comparetotmag -sNaN -1000 -> 1
+ctmx875 comparetotmag -sNaN -1 -> 1
+ctmx876 comparetotmag -sNaN -0 -> 1
+ctmx877 comparetotmag -sNaN 0 -> 1
+ctmx878 comparetotmag -sNaN 1 -> 1
+ctmx879 comparetotmag -sNaN 1000 -> 1
+ctmx880 comparetotmag -sNaN NaN -> -1
+ctmx881 comparetotmag -sNaN sNaN -> 0
+
+ctmx882 comparetotmag -sNaN -sNaN -> 0
+ctmx883 comparetotmag -NaN -sNaN -> 1
+ctmx884 comparetotmag -Inf -sNaN -> -1
+ctmx885 comparetotmag -1000 -sNaN -> -1
+ctmx886 comparetotmag -1 -sNaN -> -1
+ctmx887 comparetotmag -0 -sNaN -> -1
+ctmx888 comparetotmag 0 -sNaN -> -1
+ctmx889 comparetotmag 1 -sNaN -> -1
+ctmx890 comparetotmag 1000 -sNaN -> -1
+ctmx891 comparetotmag Inf -sNaN -> -1
+ctmx892 comparetotmag NaN -sNaN -> 1
+ctmx893 comparetotmag sNaN -sNaN -> 0
+
+-- NaNs with payload
+ctmx960 comparetotmag NaN9 -Inf -> 1
+ctmx961 comparetotmag NaN8 999 -> 1
+ctmx962 comparetotmag NaN77 Inf -> 1
+ctmx963 comparetotmag -NaN67 NaN5 -> 1
+ctmx964 comparetotmag -Inf -NaN4 -> -1
+ctmx965 comparetotmag -999 -NaN33 -> -1
+ctmx966 comparetotmag Inf NaN2 -> -1
+
+ctmx970 comparetotmag -NaN41 -NaN42 -> -1
+ctmx971 comparetotmag +NaN41 -NaN42 -> -1
+ctmx972 comparetotmag -NaN41 +NaN42 -> -1
+ctmx973 comparetotmag +NaN41 +NaN42 -> -1
+ctmx974 comparetotmag -NaN42 -NaN01 -> 1
+ctmx975 comparetotmag +NaN42 -NaN01 -> 1
+ctmx976 comparetotmag -NaN42 +NaN01 -> 1
+ctmx977 comparetotmag +NaN42 +NaN01 -> 1
+
+ctmx980 comparetotmag -sNaN771 -sNaN772 -> -1
+ctmx981 comparetotmag +sNaN771 -sNaN772 -> -1
+ctmx982 comparetotmag -sNaN771 +sNaN772 -> -1
+ctmx983 comparetotmag +sNaN771 +sNaN772 -> -1
+ctmx984 comparetotmag -sNaN772 -sNaN771 -> 1
+ctmx985 comparetotmag +sNaN772 -sNaN771 -> 1
+ctmx986 comparetotmag -sNaN772 +sNaN771 -> 1
+ctmx987 comparetotmag +sNaN772 +sNaN771 -> 1
+
+ctmx991 comparetotmag -sNaN99 -Inf -> 1
+ctmx992 comparetotmag sNaN98 -11 -> 1
+ctmx993 comparetotmag sNaN97 NaN -> -1
+ctmx994 comparetotmag sNaN16 sNaN94 -> -1
+ctmx995 comparetotmag NaN85 sNaN83 -> 1
+ctmx996 comparetotmag -Inf sNaN92 -> -1
+ctmx997 comparetotmag 088 sNaN81 -> -1
+ctmx998 comparetotmag Inf sNaN90 -> -1
+ctmx999 comparetotmag NaN -sNaN89 -> 1
+
+-- overflow and underflow tests .. subnormal results now allowed
+maxExponent: 999999999
+minexponent: -999999999
+ctmx1080 comparetotmag +1.23456789012345E-0 9E+999999999 -> -1
+ctmx1081 comparetotmag 9E+999999999 +1.23456789012345E-0 -> 1
+ctmx1082 comparetotmag +0.100 9E-999999999 -> 1
+ctmx1083 comparetotmag 9E-999999999 +0.100 -> -1
+ctmx1085 comparetotmag -1.23456789012345E-0 9E+999999999 -> -1
+ctmx1086 comparetotmag 9E+999999999 -1.23456789012345E-0 -> 1
+ctmx1087 comparetotmag -0.100 9E-999999999 -> 1
+ctmx1088 comparetotmag 9E-999999999 -0.100 -> -1
+
+ctmx1089 comparetotmag 1e-599999999 1e-400000001 -> -1
+ctmx1090 comparetotmag 1e-599999999 1e-400000000 -> -1
+ctmx1091 comparetotmag 1e-600000000 1e-400000000 -> -1
+ctmx1092 comparetotmag 9e-999999998 0.01 -> -1
+ctmx1093 comparetotmag 9e-999999998 0.1 -> -1
+ctmx1094 comparetotmag 0.01 9e-999999998 -> 1
+ctmx1095 comparetotmag 1e599999999 1e400000001 -> 1
+ctmx1096 comparetotmag 1e599999999 1e400000000 -> 1
+ctmx1097 comparetotmag 1e600000000 1e400000000 -> 1
+ctmx1098 comparetotmag 9e999999998 100 -> 1
+ctmx1099 comparetotmag 9e999999998 10 -> 1
+ctmx1100 comparetotmag 100 9e999999998 -> -1
+-- signs
+ctmx1101 comparetotmag 1e+777777777 1e+411111111 -> 1
+ctmx1102 comparetotmag 1e+777777777 -1e+411111111 -> 1
+ctmx1103 comparetotmag -1e+777777777 1e+411111111 -> 1
+ctmx1104 comparetotmag -1e+777777777 -1e+411111111 -> 1
+ctmx1105 comparetotmag 1e-777777777 1e-411111111 -> -1
+ctmx1106 comparetotmag 1e-777777777 -1e-411111111 -> -1
+ctmx1107 comparetotmag -1e-777777777 1e-411111111 -> -1
+ctmx1108 comparetotmag -1e-777777777 -1e-411111111 -> -1
+
+-- spread zeros
+ctmx1110 comparetotmag 0E-383 0 -> -1
+ctmx1111 comparetotmag 0E-383 -0 -> -1
+ctmx1112 comparetotmag -0E-383 0 -> -1
+ctmx1113 comparetotmag -0E-383 -0 -> -1
+ctmx1114 comparetotmag 0E-383 0E+384 -> -1
+ctmx1115 comparetotmag 0E-383 -0E+384 -> -1
+ctmx1116 comparetotmag -0E-383 0E+384 -> -1
+ctmx1117 comparetotmag -0E-383 -0E+384 -> -1
+ctmx1118 comparetotmag 0 0E+384 -> -1
+ctmx1119 comparetotmag 0 -0E+384 -> -1
+ctmx1120 comparetotmag -0 0E+384 -> -1
+ctmx1121 comparetotmag -0 -0E+384 -> -1
+
+ctmx1130 comparetotmag 0E+384 0 -> 1
+ctmx1131 comparetotmag 0E+384 -0 -> 1
+ctmx1132 comparetotmag -0E+384 0 -> 1
+ctmx1133 comparetotmag -0E+384 -0 -> 1
+ctmx1134 comparetotmag 0E+384 0E-383 -> 1
+ctmx1135 comparetotmag 0E+384 -0E-383 -> 1
+ctmx1136 comparetotmag -0E+384 0E-383 -> 1
+ctmx1137 comparetotmag -0E+384 -0E-383 -> 1
+ctmx1138 comparetotmag 0 0E-383 -> 1
+ctmx1139 comparetotmag 0 -0E-383 -> 1
+ctmx1140 comparetotmag -0 0E-383 -> 1
+ctmx1141 comparetotmag -0 -0E-383 -> 1
+
+-- Null tests
+ctmx9990 comparetotmag 10 # -> NaN Invalid_operation
+ctmx9991 comparetotmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/copy.decTest b/Lib/test/decimaltestdata/copy.decTest
index d9f299e227..b47e499a7b 100644
--- a/Lib/test/decimaltestdata/copy.decTest
+++ b/Lib/test/decimaltestdata/copy.decTest
@@ -1,86 +1,86 @@
-------------------------------------------------------------------------
--- copy.decTest -- quiet copy --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-cpyx001 copy +7.50 -> 7.50
-
--- Infinities
-cpyx011 copy Infinity -> Infinity
-cpyx012 copy -Infinity -> -Infinity
-
--- NaNs, 0 payload
-cpyx021 copy NaN -> NaN
-cpyx022 copy -NaN -> -NaN
-cpyx023 copy sNaN -> sNaN
-cpyx024 copy -sNaN -> -sNaN
-
--- NaNs, non-0 payload
-cpyx031 copy NaN10 -> NaN10
-cpyx032 copy -NaN10 -> -NaN10
-cpyx033 copy sNaN10 -> sNaN10
-cpyx034 copy -sNaN10 -> -sNaN10
-cpyx035 copy NaN7 -> NaN7
-cpyx036 copy -NaN7 -> -NaN7
-cpyx037 copy sNaN101 -> sNaN101
-cpyx038 copy -sNaN101 -> -sNaN101
-
--- finites
-cpyx101 copy 7 -> 7
-cpyx102 copy -7 -> -7
-cpyx103 copy 75 -> 75
-cpyx104 copy -75 -> -75
-cpyx105 copy 7.50 -> 7.50
-cpyx106 copy -7.50 -> -7.50
-cpyx107 copy 7.500 -> 7.500
-cpyx108 copy -7.500 -> -7.500
-
--- zeros
-cpyx111 copy 0 -> 0
-cpyx112 copy -0 -> -0
-cpyx113 copy 0E+4 -> 0E+4
-cpyx114 copy -0E+4 -> -0E+4
-cpyx115 copy 0.0000 -> 0.0000
-cpyx116 copy -0.0000 -> -0.0000
-cpyx117 copy 0E-141 -> 0E-141
-cpyx118 copy -0E-141 -> -0E-141
-
--- full coefficients, alternating bits
-cpyx121 copy 268268268 -> 268268268
-cpyx122 copy -268268268 -> -268268268
-cpyx123 copy 134134134 -> 134134134
-cpyx124 copy -134134134 -> -134134134
-
--- Nmax, Nmin, Ntiny
-cpyx131 copy 9.99999999E+999 -> 9.99999999E+999
-cpyx132 copy 1E-999 -> 1E-999
-cpyx133 copy 1.00000000E-999 -> 1.00000000E-999
-cpyx134 copy 1E-1007 -> 1E-1007
-
-cpyx135 copy -1E-1007 -> -1E-1007
-cpyx136 copy -1.00000000E-999 -> -1.00000000E-999
-cpyx137 copy -1E-999 -> -1E-999
-cpyx138 copy -9.99999999E+999 -> -9.99999999E+999
+------------------------------------------------------------------------
+-- copy.decTest -- quiet copy --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+cpyx001 copy +7.50 -> 7.50
+
+-- Infinities
+cpyx011 copy Infinity -> Infinity
+cpyx012 copy -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+cpyx021 copy NaN -> NaN
+cpyx022 copy -NaN -> -NaN
+cpyx023 copy sNaN -> sNaN
+cpyx024 copy -sNaN -> -sNaN
+
+-- NaNs, non-0 payload
+cpyx031 copy NaN10 -> NaN10
+cpyx032 copy -NaN10 -> -NaN10
+cpyx033 copy sNaN10 -> sNaN10
+cpyx034 copy -sNaN10 -> -sNaN10
+cpyx035 copy NaN7 -> NaN7
+cpyx036 copy -NaN7 -> -NaN7
+cpyx037 copy sNaN101 -> sNaN101
+cpyx038 copy -sNaN101 -> -sNaN101
+
+-- finites
+cpyx101 copy 7 -> 7
+cpyx102 copy -7 -> -7
+cpyx103 copy 75 -> 75
+cpyx104 copy -75 -> -75
+cpyx105 copy 7.50 -> 7.50
+cpyx106 copy -7.50 -> -7.50
+cpyx107 copy 7.500 -> 7.500
+cpyx108 copy -7.500 -> -7.500
+
+-- zeros
+cpyx111 copy 0 -> 0
+cpyx112 copy -0 -> -0
+cpyx113 copy 0E+4 -> 0E+4
+cpyx114 copy -0E+4 -> -0E+4
+cpyx115 copy 0.0000 -> 0.0000
+cpyx116 copy -0.0000 -> -0.0000
+cpyx117 copy 0E-141 -> 0E-141
+cpyx118 copy -0E-141 -> -0E-141
+
+-- full coefficients, alternating bits
+cpyx121 copy 268268268 -> 268268268
+cpyx122 copy -268268268 -> -268268268
+cpyx123 copy 134134134 -> 134134134
+cpyx124 copy -134134134 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+cpyx131 copy 9.99999999E+999 -> 9.99999999E+999
+cpyx132 copy 1E-999 -> 1E-999
+cpyx133 copy 1.00000000E-999 -> 1.00000000E-999
+cpyx134 copy 1E-1007 -> 1E-1007
+
+cpyx135 copy -1E-1007 -> -1E-1007
+cpyx136 copy -1.00000000E-999 -> -1.00000000E-999
+cpyx137 copy -1E-999 -> -1E-999
+cpyx138 copy -9.99999999E+999 -> -9.99999999E+999
diff --git a/Lib/test/decimaltestdata/copyabs.decTest b/Lib/test/decimaltestdata/copyabs.decTest
index 52002dc431..f7d0f86458 100644
--- a/Lib/test/decimaltestdata/copyabs.decTest
+++ b/Lib/test/decimaltestdata/copyabs.decTest
@@ -1,86 +1,86 @@
-------------------------------------------------------------------------
--- copyAbs.decTest -- quiet copy and set sign to zero --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-cpax001 copyabs +7.50 -> 7.50
-
--- Infinities
-cpax011 copyabs Infinity -> Infinity
-cpax012 copyabs -Infinity -> Infinity
-
--- NaNs, 0 payload
-cpax021 copyabs NaN -> NaN
-cpax022 copyabs -NaN -> NaN
-cpax023 copyabs sNaN -> sNaN
-cpax024 copyabs -sNaN -> sNaN
-
--- NaNs, non-0 payload
-cpax031 copyabs NaN10 -> NaN10
-cpax032 copyabs -NaN15 -> NaN15
-cpax033 copyabs sNaN15 -> sNaN15
-cpax034 copyabs -sNaN10 -> sNaN10
-cpax035 copyabs NaN7 -> NaN7
-cpax036 copyabs -NaN7 -> NaN7
-cpax037 copyabs sNaN101 -> sNaN101
-cpax038 copyabs -sNaN101 -> sNaN101
-
--- finites
-cpax101 copyabs 7 -> 7
-cpax102 copyabs -7 -> 7
-cpax103 copyabs 75 -> 75
-cpax104 copyabs -75 -> 75
-cpax105 copyabs 7.10 -> 7.10
-cpax106 copyabs -7.10 -> 7.10
-cpax107 copyabs 7.500 -> 7.500
-cpax108 copyabs -7.500 -> 7.500
-
--- zeros
-cpax111 copyabs 0 -> 0
-cpax112 copyabs -0 -> 0
-cpax113 copyabs 0E+6 -> 0E+6
-cpax114 copyabs -0E+6 -> 0E+6
-cpax115 copyabs 0.0000 -> 0.0000
-cpax116 copyabs -0.0000 -> 0.0000
-cpax117 copyabs 0E-141 -> 0E-141
-cpax118 copyabs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-cpax121 copyabs 268268268 -> 268268268
-cpax122 copyabs -268268268 -> 268268268
-cpax123 copyabs 134134134 -> 134134134
-cpax124 copyabs -134134134 -> 134134134
-
--- Nmax, Nmin, Ntiny
-cpax131 copyabs 9.99999999E+999 -> 9.99999999E+999
-cpax132 copyabs 1E-999 -> 1E-999
-cpax133 copyabs 1.00000000E-999 -> 1.00000000E-999
-cpax134 copyabs 1E-1007 -> 1E-1007
-
-cpax135 copyabs -1E-1007 -> 1E-1007
-cpax136 copyabs -1.00000000E-999 -> 1.00000000E-999
-cpax137 copyabs -1E-999 -> 1E-999
-cpax199 copyabs -9.99999999E+999 -> 9.99999999E+999
+------------------------------------------------------------------------
+-- copyAbs.decTest -- quiet copy and set sign to zero --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+cpax001 copyabs +7.50 -> 7.50
+
+-- Infinities
+cpax011 copyabs Infinity -> Infinity
+cpax012 copyabs -Infinity -> Infinity
+
+-- NaNs, 0 payload
+cpax021 copyabs NaN -> NaN
+cpax022 copyabs -NaN -> NaN
+cpax023 copyabs sNaN -> sNaN
+cpax024 copyabs -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+cpax031 copyabs NaN10 -> NaN10
+cpax032 copyabs -NaN15 -> NaN15
+cpax033 copyabs sNaN15 -> sNaN15
+cpax034 copyabs -sNaN10 -> sNaN10
+cpax035 copyabs NaN7 -> NaN7
+cpax036 copyabs -NaN7 -> NaN7
+cpax037 copyabs sNaN101 -> sNaN101
+cpax038 copyabs -sNaN101 -> sNaN101
+
+-- finites
+cpax101 copyabs 7 -> 7
+cpax102 copyabs -7 -> 7
+cpax103 copyabs 75 -> 75
+cpax104 copyabs -75 -> 75
+cpax105 copyabs 7.10 -> 7.10
+cpax106 copyabs -7.10 -> 7.10
+cpax107 copyabs 7.500 -> 7.500
+cpax108 copyabs -7.500 -> 7.500
+
+-- zeros
+cpax111 copyabs 0 -> 0
+cpax112 copyabs -0 -> 0
+cpax113 copyabs 0E+6 -> 0E+6
+cpax114 copyabs -0E+6 -> 0E+6
+cpax115 copyabs 0.0000 -> 0.0000
+cpax116 copyabs -0.0000 -> 0.0000
+cpax117 copyabs 0E-141 -> 0E-141
+cpax118 copyabs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+cpax121 copyabs 268268268 -> 268268268
+cpax122 copyabs -268268268 -> 268268268
+cpax123 copyabs 134134134 -> 134134134
+cpax124 copyabs -134134134 -> 134134134
+
+-- Nmax, Nmin, Ntiny
+cpax131 copyabs 9.99999999E+999 -> 9.99999999E+999
+cpax132 copyabs 1E-999 -> 1E-999
+cpax133 copyabs 1.00000000E-999 -> 1.00000000E-999
+cpax134 copyabs 1E-1007 -> 1E-1007
+
+cpax135 copyabs -1E-1007 -> 1E-1007
+cpax136 copyabs -1.00000000E-999 -> 1.00000000E-999
+cpax137 copyabs -1E-999 -> 1E-999
+cpax199 copyabs -9.99999999E+999 -> 9.99999999E+999
diff --git a/Lib/test/decimaltestdata/copynegate.decTest b/Lib/test/decimaltestdata/copynegate.decTest
index 7f8de9d932..38235b60f9 100644
--- a/Lib/test/decimaltestdata/copynegate.decTest
+++ b/Lib/test/decimaltestdata/copynegate.decTest
@@ -1,86 +1,86 @@
-------------------------------------------------------------------------
--- copyNegate.decTest -- quiet copy and negate --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-cpnx001 copynegate +7.50 -> -7.50
-
--- Infinities
-cpnx011 copynegate Infinity -> -Infinity
-cpnx012 copynegate -Infinity -> Infinity
-
--- NaNs, 0 payload
-cpnx021 copynegate NaN -> -NaN
-cpnx022 copynegate -NaN -> NaN
-cpnx023 copynegate sNaN -> -sNaN
-cpnx024 copynegate -sNaN -> sNaN
-
--- NaNs, non-0 payload
-cpnx031 copynegate NaN13 -> -NaN13
-cpnx032 copynegate -NaN13 -> NaN13
-cpnx033 copynegate sNaN13 -> -sNaN13
-cpnx034 copynegate -sNaN13 -> sNaN13
-cpnx035 copynegate NaN70 -> -NaN70
-cpnx036 copynegate -NaN70 -> NaN70
-cpnx037 copynegate sNaN101 -> -sNaN101
-cpnx038 copynegate -sNaN101 -> sNaN101
-
--- finites
-cpnx101 copynegate 7 -> -7
-cpnx102 copynegate -7 -> 7
-cpnx103 copynegate 75 -> -75
-cpnx104 copynegate -75 -> 75
-cpnx105 copynegate 7.50 -> -7.50
-cpnx106 copynegate -7.50 -> 7.50
-cpnx107 copynegate 7.500 -> -7.500
-cpnx108 copynegate -7.500 -> 7.500
-
--- zeros
-cpnx111 copynegate 0 -> -0
-cpnx112 copynegate -0 -> 0
-cpnx113 copynegate 0E+4 -> -0E+4
-cpnx114 copynegate -0E+4 -> 0E+4
-cpnx115 copynegate 0.0000 -> -0.0000
-cpnx116 copynegate -0.0000 -> 0.0000
-cpnx117 copynegate 0E-141 -> -0E-141
-cpnx118 copynegate -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-cpnx121 copynegate 268268268 -> -268268268
-cpnx122 copynegate -268268268 -> 268268268
-cpnx123 copynegate 134134134 -> -134134134
-cpnx124 copynegate -134134134 -> 134134134
-
--- Nmax, Nmin, Ntiny
-cpnx131 copynegate 9.99999999E+999 -> -9.99999999E+999
-cpnx132 copynegate 1E-999 -> -1E-999
-cpnx133 copynegate 1.00000000E-999 -> -1.00000000E-999
-cpnx134 copynegate 1E-1007 -> -1E-1007
-
-cpnx135 copynegate -1E-1007 -> 1E-1007
-cpnx136 copynegate -1.00000000E-999 -> 1.00000000E-999
-cpnx137 copynegate -1E-999 -> 1E-999
-cpnx138 copynegate -9.99999999E+999 -> 9.99999999E+999
+------------------------------------------------------------------------
+-- copyNegate.decTest -- quiet copy and negate --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+cpnx001 copynegate +7.50 -> -7.50
+
+-- Infinities
+cpnx011 copynegate Infinity -> -Infinity
+cpnx012 copynegate -Infinity -> Infinity
+
+-- NaNs, 0 payload
+cpnx021 copynegate NaN -> -NaN
+cpnx022 copynegate -NaN -> NaN
+cpnx023 copynegate sNaN -> -sNaN
+cpnx024 copynegate -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+cpnx031 copynegate NaN13 -> -NaN13
+cpnx032 copynegate -NaN13 -> NaN13
+cpnx033 copynegate sNaN13 -> -sNaN13
+cpnx034 copynegate -sNaN13 -> sNaN13
+cpnx035 copynegate NaN70 -> -NaN70
+cpnx036 copynegate -NaN70 -> NaN70
+cpnx037 copynegate sNaN101 -> -sNaN101
+cpnx038 copynegate -sNaN101 -> sNaN101
+
+-- finites
+cpnx101 copynegate 7 -> -7
+cpnx102 copynegate -7 -> 7
+cpnx103 copynegate 75 -> -75
+cpnx104 copynegate -75 -> 75
+cpnx105 copynegate 7.50 -> -7.50
+cpnx106 copynegate -7.50 -> 7.50
+cpnx107 copynegate 7.500 -> -7.500
+cpnx108 copynegate -7.500 -> 7.500
+
+-- zeros
+cpnx111 copynegate 0 -> -0
+cpnx112 copynegate -0 -> 0
+cpnx113 copynegate 0E+4 -> -0E+4
+cpnx114 copynegate -0E+4 -> 0E+4
+cpnx115 copynegate 0.0000 -> -0.0000
+cpnx116 copynegate -0.0000 -> 0.0000
+cpnx117 copynegate 0E-141 -> -0E-141
+cpnx118 copynegate -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+cpnx121 copynegate 268268268 -> -268268268
+cpnx122 copynegate -268268268 -> 268268268
+cpnx123 copynegate 134134134 -> -134134134
+cpnx124 copynegate -134134134 -> 134134134
+
+-- Nmax, Nmin, Ntiny
+cpnx131 copynegate 9.99999999E+999 -> -9.99999999E+999
+cpnx132 copynegate 1E-999 -> -1E-999
+cpnx133 copynegate 1.00000000E-999 -> -1.00000000E-999
+cpnx134 copynegate 1E-1007 -> -1E-1007
+
+cpnx135 copynegate -1E-1007 -> 1E-1007
+cpnx136 copynegate -1.00000000E-999 -> 1.00000000E-999
+cpnx137 copynegate -1E-999 -> 1E-999
+cpnx138 copynegate -9.99999999E+999 -> 9.99999999E+999
diff --git a/Lib/test/decimaltestdata/copysign.decTest b/Lib/test/decimaltestdata/copysign.decTest
index afdd670d3c..8061a4219c 100644
--- a/Lib/test/decimaltestdata/copysign.decTest
+++ b/Lib/test/decimaltestdata/copysign.decTest
@@ -1,177 +1,177 @@
-------------------------------------------------------------------------
--- copysign.decTest -- quiet copy with sign from rhs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check, and examples from decArith
-cpsx001 copysign +7.50 11 -> 7.50
-cpsx002 copysign '1.50' '7.33' -> 1.50
-cpsx003 copysign '-1.50' '7.33' -> 1.50
-cpsx004 copysign '1.50' '-7.33' -> -1.50
-cpsx005 copysign '-1.50' '-7.33' -> -1.50
-
--- Infinities
-cpsx011 copysign Infinity 11 -> Infinity
-cpsx012 copysign -Infinity 11 -> Infinity
-
--- NaNs, 0 payload
-cpsx021 copysign NaN 11 -> NaN
-cpsx022 copysign -NaN 11 -> NaN
-cpsx023 copysign sNaN 11 -> sNaN
-cpsx024 copysign -sNaN 11 -> sNaN
-
--- NaNs, non-0 payload
-cpsx031 copysign NaN10 11 -> NaN10
-cpsx032 copysign -NaN10 11 -> NaN10
-cpsx033 copysign sNaN10 11 -> sNaN10
-cpsx034 copysign -sNaN10 11 -> sNaN10
-cpsx035 copysign NaN7 11 -> NaN7
-cpsx036 copysign -NaN7 11 -> NaN7
-cpsx037 copysign sNaN101 11 -> sNaN101
-cpsx038 copysign -sNaN101 11 -> sNaN101
-
--- finites
-cpsx101 copysign 7 11 -> 7
-cpsx102 copysign -7 11 -> 7
-cpsx103 copysign 75 11 -> 75
-cpsx104 copysign -75 11 -> 75
-cpsx105 copysign 7.50 11 -> 7.50
-cpsx106 copysign -7.50 11 -> 7.50
-cpsx107 copysign 7.500 11 -> 7.500
-cpsx108 copysign -7.500 11 -> 7.500
-
--- zeros
-cpsx111 copysign 0 11 -> 0
-cpsx112 copysign -0 11 -> 0
-cpsx113 copysign 0E+4 11 -> 0E+4
-cpsx114 copysign -0E+4 11 -> 0E+4
-cpsx115 copysign 0.0000 11 -> 0.0000
-cpsx116 copysign -0.0000 11 -> 0.0000
-cpsx117 copysign 0E-141 11 -> 0E-141
-cpsx118 copysign -0E-141 11 -> 0E-141
-
--- full coefficients, alternating bits
-cpsx121 copysign 268268268 11 -> 268268268
-cpsx122 copysign -268268268 11 -> 268268268
-cpsx123 copysign 134134134 11 -> 134134134
-cpsx124 copysign -134134134 11 -> 134134134
-
--- Nmax, Nmin, Ntiny
-cpsx131 copysign 9.99999999E+999 11 -> 9.99999999E+999
-cpsx132 copysign 1E-999 11 -> 1E-999
-cpsx133 copysign 1.00000000E-999 11 -> 1.00000000E-999
-cpsx134 copysign 1E-1007 11 -> 1E-1007
-
-cpsx135 copysign -1E-1007 11 -> 1E-1007
-cpsx136 copysign -1.00000000E-999 11 -> 1.00000000E-999
-cpsx137 copysign -1E-999 11 -> 1E-999
-cpsx138 copysign -9.99999999E+999 11 -> 9.99999999E+999
-
--- repeat with negative RHS
-
--- Infinities
-cpsx211 copysign Infinity -34 -> -Infinity
-cpsx212 copysign -Infinity -34 -> -Infinity
-
--- NaNs, 0 payload
-cpsx221 copysign NaN -34 -> -NaN
-cpsx222 copysign -NaN -34 -> -NaN
-cpsx223 copysign sNaN -34 -> -sNaN
-cpsx224 copysign -sNaN -34 -> -sNaN
-
--- NaNs, non-0 payload
-cpsx231 copysign NaN10 -34 -> -NaN10
-cpsx232 copysign -NaN10 -34 -> -NaN10
-cpsx233 copysign sNaN10 -34 -> -sNaN10
-cpsx234 copysign -sNaN10 -34 -> -sNaN10
-cpsx235 copysign NaN7 -34 -> -NaN7
-cpsx236 copysign -NaN7 -34 -> -NaN7
-cpsx237 copysign sNaN101 -34 -> -sNaN101
-cpsx238 copysign -sNaN101 -34 -> -sNaN101
-
--- finites
-cpsx301 copysign 7 -34 -> -7
-cpsx302 copysign -7 -34 -> -7
-cpsx303 copysign 75 -34 -> -75
-cpsx304 copysign -75 -34 -> -75
-cpsx305 copysign 7.50 -34 -> -7.50
-cpsx306 copysign -7.50 -34 -> -7.50
-cpsx307 copysign 7.500 -34 -> -7.500
-cpsx308 copysign -7.500 -34 -> -7.500
-
--- zeros
-cpsx311 copysign 0 -34 -> -0
-cpsx312 copysign -0 -34 -> -0
-cpsx313 copysign 0E+4 -34 -> -0E+4
-cpsx314 copysign -0E+4 -34 -> -0E+4
-cpsx315 copysign 0.0000 -34 -> -0.0000
-cpsx316 copysign -0.0000 -34 -> -0.0000
-cpsx317 copysign 0E-141 -34 -> -0E-141
-cpsx318 copysign -0E-141 -34 -> -0E-141
-
--- full coefficients, alternating bits
-cpsx321 copysign 268268268 -18 -> -268268268
-cpsx322 copysign -268268268 -18 -> -268268268
-cpsx323 copysign 134134134 -18 -> -134134134
-cpsx324 copysign -134134134 -18 -> -134134134
-
--- Nmax, Nmin, Ntiny
-cpsx331 copysign 9.99999999E+999 -18 -> -9.99999999E+999
-cpsx332 copysign 1E-999 -18 -> -1E-999
-cpsx333 copysign 1.00000000E-999 -18 -> -1.00000000E-999
-cpsx334 copysign 1E-1007 -18 -> -1E-1007
-
-cpsx335 copysign -1E-1007 -18 -> -1E-1007
-cpsx336 copysign -1.00000000E-999 -18 -> -1.00000000E-999
-cpsx337 copysign -1E-999 -18 -> -1E-999
-cpsx338 copysign -9.99999999E+999 -18 -> -9.99999999E+999
-
--- Other kinds of RHS
-cpsx401 copysign 701 -34 -> -701
-cpsx402 copysign -720 -34 -> -720
-cpsx403 copysign 701 -0 -> -701
-cpsx404 copysign -720 -0 -> -720
-cpsx405 copysign 701 +0 -> 701
-cpsx406 copysign -720 +0 -> 720
-cpsx407 copysign 701 +34 -> 701
-cpsx408 copysign -720 +34 -> 720
-
-cpsx413 copysign 701 -Inf -> -701
-cpsx414 copysign -720 -Inf -> -720
-cpsx415 copysign 701 +Inf -> 701
-cpsx416 copysign -720 +Inf -> 720
-
-cpsx420 copysign 701 -NaN -> -701
-cpsx421 copysign -720 -NaN -> -720
-cpsx422 copysign 701 +NaN -> 701
-cpsx423 copysign -720 +NaN -> 720
-cpsx425 copysign -720 +NaN8 -> 720
-
-cpsx426 copysign 701 -sNaN -> -701
-cpsx427 copysign -720 -sNaN -> -720
-cpsx428 copysign 701 +sNaN -> 701
-cpsx429 copysign -720 +sNaN -> 720
-cpsx430 copysign -720 +sNaN3 -> 720
-
+------------------------------------------------------------------------
+-- copysign.decTest -- quiet copy with sign from rhs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check, and examples from decArith
+cpsx001 copysign +7.50 11 -> 7.50
+cpsx002 copysign '1.50' '7.33' -> 1.50
+cpsx003 copysign '-1.50' '7.33' -> 1.50
+cpsx004 copysign '1.50' '-7.33' -> -1.50
+cpsx005 copysign '-1.50' '-7.33' -> -1.50
+
+-- Infinities
+cpsx011 copysign Infinity 11 -> Infinity
+cpsx012 copysign -Infinity 11 -> Infinity
+
+-- NaNs, 0 payload
+cpsx021 copysign NaN 11 -> NaN
+cpsx022 copysign -NaN 11 -> NaN
+cpsx023 copysign sNaN 11 -> sNaN
+cpsx024 copysign -sNaN 11 -> sNaN
+
+-- NaNs, non-0 payload
+cpsx031 copysign NaN10 11 -> NaN10
+cpsx032 copysign -NaN10 11 -> NaN10
+cpsx033 copysign sNaN10 11 -> sNaN10
+cpsx034 copysign -sNaN10 11 -> sNaN10
+cpsx035 copysign NaN7 11 -> NaN7
+cpsx036 copysign -NaN7 11 -> NaN7
+cpsx037 copysign sNaN101 11 -> sNaN101
+cpsx038 copysign -sNaN101 11 -> sNaN101
+
+-- finites
+cpsx101 copysign 7 11 -> 7
+cpsx102 copysign -7 11 -> 7
+cpsx103 copysign 75 11 -> 75
+cpsx104 copysign -75 11 -> 75
+cpsx105 copysign 7.50 11 -> 7.50
+cpsx106 copysign -7.50 11 -> 7.50
+cpsx107 copysign 7.500 11 -> 7.500
+cpsx108 copysign -7.500 11 -> 7.500
+
+-- zeros
+cpsx111 copysign 0 11 -> 0
+cpsx112 copysign -0 11 -> 0
+cpsx113 copysign 0E+4 11 -> 0E+4
+cpsx114 copysign -0E+4 11 -> 0E+4
+cpsx115 copysign 0.0000 11 -> 0.0000
+cpsx116 copysign -0.0000 11 -> 0.0000
+cpsx117 copysign 0E-141 11 -> 0E-141
+cpsx118 copysign -0E-141 11 -> 0E-141
+
+-- full coefficients, alternating bits
+cpsx121 copysign 268268268 11 -> 268268268
+cpsx122 copysign -268268268 11 -> 268268268
+cpsx123 copysign 134134134 11 -> 134134134
+cpsx124 copysign -134134134 11 -> 134134134
+
+-- Nmax, Nmin, Ntiny
+cpsx131 copysign 9.99999999E+999 11 -> 9.99999999E+999
+cpsx132 copysign 1E-999 11 -> 1E-999
+cpsx133 copysign 1.00000000E-999 11 -> 1.00000000E-999
+cpsx134 copysign 1E-1007 11 -> 1E-1007
+
+cpsx135 copysign -1E-1007 11 -> 1E-1007
+cpsx136 copysign -1.00000000E-999 11 -> 1.00000000E-999
+cpsx137 copysign -1E-999 11 -> 1E-999
+cpsx138 copysign -9.99999999E+999 11 -> 9.99999999E+999
+
+-- repeat with negative RHS
+
+-- Infinities
+cpsx211 copysign Infinity -34 -> -Infinity
+cpsx212 copysign -Infinity -34 -> -Infinity
+
+-- NaNs, 0 payload
+cpsx221 copysign NaN -34 -> -NaN
+cpsx222 copysign -NaN -34 -> -NaN
+cpsx223 copysign sNaN -34 -> -sNaN
+cpsx224 copysign -sNaN -34 -> -sNaN
+
+-- NaNs, non-0 payload
+cpsx231 copysign NaN10 -34 -> -NaN10
+cpsx232 copysign -NaN10 -34 -> -NaN10
+cpsx233 copysign sNaN10 -34 -> -sNaN10
+cpsx234 copysign -sNaN10 -34 -> -sNaN10
+cpsx235 copysign NaN7 -34 -> -NaN7
+cpsx236 copysign -NaN7 -34 -> -NaN7
+cpsx237 copysign sNaN101 -34 -> -sNaN101
+cpsx238 copysign -sNaN101 -34 -> -sNaN101
+
+-- finites
+cpsx301 copysign 7 -34 -> -7
+cpsx302 copysign -7 -34 -> -7
+cpsx303 copysign 75 -34 -> -75
+cpsx304 copysign -75 -34 -> -75
+cpsx305 copysign 7.50 -34 -> -7.50
+cpsx306 copysign -7.50 -34 -> -7.50
+cpsx307 copysign 7.500 -34 -> -7.500
+cpsx308 copysign -7.500 -34 -> -7.500
+
+-- zeros
+cpsx311 copysign 0 -34 -> -0
+cpsx312 copysign -0 -34 -> -0
+cpsx313 copysign 0E+4 -34 -> -0E+4
+cpsx314 copysign -0E+4 -34 -> -0E+4
+cpsx315 copysign 0.0000 -34 -> -0.0000
+cpsx316 copysign -0.0000 -34 -> -0.0000
+cpsx317 copysign 0E-141 -34 -> -0E-141
+cpsx318 copysign -0E-141 -34 -> -0E-141
+
+-- full coefficients, alternating bits
+cpsx321 copysign 268268268 -18 -> -268268268
+cpsx322 copysign -268268268 -18 -> -268268268
+cpsx323 copysign 134134134 -18 -> -134134134
+cpsx324 copysign -134134134 -18 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+cpsx331 copysign 9.99999999E+999 -18 -> -9.99999999E+999
+cpsx332 copysign 1E-999 -18 -> -1E-999
+cpsx333 copysign 1.00000000E-999 -18 -> -1.00000000E-999
+cpsx334 copysign 1E-1007 -18 -> -1E-1007
+
+cpsx335 copysign -1E-1007 -18 -> -1E-1007
+cpsx336 copysign -1.00000000E-999 -18 -> -1.00000000E-999
+cpsx337 copysign -1E-999 -18 -> -1E-999
+cpsx338 copysign -9.99999999E+999 -18 -> -9.99999999E+999
+
+-- Other kinds of RHS
+cpsx401 copysign 701 -34 -> -701
+cpsx402 copysign -720 -34 -> -720
+cpsx403 copysign 701 -0 -> -701
+cpsx404 copysign -720 -0 -> -720
+cpsx405 copysign 701 +0 -> 701
+cpsx406 copysign -720 +0 -> 720
+cpsx407 copysign 701 +34 -> 701
+cpsx408 copysign -720 +34 -> 720
+
+cpsx413 copysign 701 -Inf -> -701
+cpsx414 copysign -720 -Inf -> -720
+cpsx415 copysign 701 +Inf -> 701
+cpsx416 copysign -720 +Inf -> 720
+
+cpsx420 copysign 701 -NaN -> -701
+cpsx421 copysign -720 -NaN -> -720
+cpsx422 copysign 701 +NaN -> 701
+cpsx423 copysign -720 +NaN -> 720
+cpsx425 copysign -720 +NaN8 -> 720
+
+cpsx426 copysign 701 -sNaN -> -701
+cpsx427 copysign -720 -sNaN -> -720
+cpsx428 copysign 701 +sNaN -> 701
+cpsx429 copysign -720 +sNaN -> 720
+cpsx430 copysign -720 +sNaN3 -> 720
+
diff --git a/Lib/test/decimaltestdata/ddAbs.decTest b/Lib/test/decimaltestdata/ddAbs.decTest
index b98d64a11a..c6f5a7cda3 100644
--- a/Lib/test/decimaltestdata/ddAbs.decTest
+++ b/Lib/test/decimaltestdata/ddAbs.decTest
@@ -1,126 +1,126 @@
-------------------------------------------------------------------------
--- ddAbs.decTest -- decDouble absolute value, heeding sNaN --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddabs001 abs '1' -> '1'
-ddabs002 abs '-1' -> '1'
-ddabs003 abs '1.00' -> '1.00'
-ddabs004 abs '-1.00' -> '1.00'
-ddabs005 abs '0' -> '0'
-ddabs006 abs '0.00' -> '0.00'
-ddabs007 abs '00.0' -> '0.0'
-ddabs008 abs '00.00' -> '0.00'
-ddabs009 abs '00' -> '0'
-
-ddabs010 abs '-2' -> '2'
-ddabs011 abs '2' -> '2'
-ddabs012 abs '-2.00' -> '2.00'
-ddabs013 abs '2.00' -> '2.00'
-ddabs014 abs '-0' -> '0'
-ddabs015 abs '-0.00' -> '0.00'
-ddabs016 abs '-00.0' -> '0.0'
-ddabs017 abs '-00.00' -> '0.00'
-ddabs018 abs '-00' -> '0'
-
-ddabs020 abs '-2000000' -> '2000000'
-ddabs021 abs '2000000' -> '2000000'
-
-ddabs030 abs '+0.1' -> '0.1'
-ddabs031 abs '-0.1' -> '0.1'
-ddabs032 abs '+0.01' -> '0.01'
-ddabs033 abs '-0.01' -> '0.01'
-ddabs034 abs '+0.001' -> '0.001'
-ddabs035 abs '-0.001' -> '0.001'
-ddabs036 abs '+0.000001' -> '0.000001'
-ddabs037 abs '-0.000001' -> '0.000001'
-ddabs038 abs '+0.000000000001' -> '1E-12'
-ddabs039 abs '-0.000000000001' -> '1E-12'
-
--- examples from decArith
-ddabs040 abs '2.1' -> '2.1'
-ddabs041 abs '-100' -> '100'
-ddabs042 abs '101.5' -> '101.5'
-ddabs043 abs '-101.5' -> '101.5'
-
--- more fixed, potential LHS swaps/overlays if done by subtract 0
-ddabs060 abs '-56267E-10' -> '0.0000056267'
-ddabs061 abs '-56267E-5' -> '0.56267'
-ddabs062 abs '-56267E-2' -> '562.67'
-ddabs063 abs '-56267E-1' -> '5626.7'
-ddabs065 abs '-56267E-0' -> '56267'
-
--- subnormals and underflow
-
--- long operand tests
-ddabs321 abs 1234567890123456 -> 1234567890123456
-ddabs322 abs 12345678000 -> 12345678000
-ddabs323 abs 1234567800 -> 1234567800
-ddabs324 abs 1234567890 -> 1234567890
-ddabs325 abs 1234567891 -> 1234567891
-ddabs326 abs 12345678901 -> 12345678901
-ddabs327 abs 1234567896 -> 1234567896
-
--- zeros
-ddabs111 abs 0 -> 0
-ddabs112 abs -0 -> 0
-ddabs113 abs 0E+6 -> 0E+6
-ddabs114 abs -0E+6 -> 0E+6
-ddabs115 abs 0.0000 -> 0.0000
-ddabs116 abs -0.0000 -> 0.0000
-ddabs117 abs 0E-141 -> 0E-141
-ddabs118 abs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddabs121 abs 2682682682682682 -> 2682682682682682
-ddabs122 abs -2682682682682682 -> 2682682682682682
-ddabs123 abs 1341341341341341 -> 1341341341341341
-ddabs124 abs -1341341341341341 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddabs131 abs 9.999999999999999E+384 -> 9.999999999999999E+384
-ddabs132 abs 1E-383 -> 1E-383
-ddabs133 abs 1.000000000000000E-383 -> 1.000000000000000E-383
-ddabs134 abs 1E-398 -> 1E-398 Subnormal
-
-ddabs135 abs -1E-398 -> 1E-398 Subnormal
-ddabs136 abs -1.000000000000000E-383 -> 1.000000000000000E-383
-ddabs137 abs -1E-383 -> 1E-383
-ddabs138 abs -9.999999999999999E+384 -> 9.999999999999999E+384
-
--- specials
-ddabs520 abs 'Inf' -> 'Infinity'
-ddabs521 abs '-Inf' -> 'Infinity'
-ddabs522 abs NaN -> NaN
-ddabs523 abs sNaN -> NaN Invalid_operation
-ddabs524 abs NaN22 -> NaN22
-ddabs525 abs sNaN33 -> NaN33 Invalid_operation
-ddabs526 abs -NaN22 -> -NaN22
-ddabs527 abs -sNaN33 -> -NaN33 Invalid_operation
-
--- Null tests
-ddabs900 abs # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddAbs.decTest -- decDouble absolute value, heeding sNaN --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddabs001 abs '1' -> '1'
+ddabs002 abs '-1' -> '1'
+ddabs003 abs '1.00' -> '1.00'
+ddabs004 abs '-1.00' -> '1.00'
+ddabs005 abs '0' -> '0'
+ddabs006 abs '0.00' -> '0.00'
+ddabs007 abs '00.0' -> '0.0'
+ddabs008 abs '00.00' -> '0.00'
+ddabs009 abs '00' -> '0'
+
+ddabs010 abs '-2' -> '2'
+ddabs011 abs '2' -> '2'
+ddabs012 abs '-2.00' -> '2.00'
+ddabs013 abs '2.00' -> '2.00'
+ddabs014 abs '-0' -> '0'
+ddabs015 abs '-0.00' -> '0.00'
+ddabs016 abs '-00.0' -> '0.0'
+ddabs017 abs '-00.00' -> '0.00'
+ddabs018 abs '-00' -> '0'
+
+ddabs020 abs '-2000000' -> '2000000'
+ddabs021 abs '2000000' -> '2000000'
+
+ddabs030 abs '+0.1' -> '0.1'
+ddabs031 abs '-0.1' -> '0.1'
+ddabs032 abs '+0.01' -> '0.01'
+ddabs033 abs '-0.01' -> '0.01'
+ddabs034 abs '+0.001' -> '0.001'
+ddabs035 abs '-0.001' -> '0.001'
+ddabs036 abs '+0.000001' -> '0.000001'
+ddabs037 abs '-0.000001' -> '0.000001'
+ddabs038 abs '+0.000000000001' -> '1E-12'
+ddabs039 abs '-0.000000000001' -> '1E-12'
+
+-- examples from decArith
+ddabs040 abs '2.1' -> '2.1'
+ddabs041 abs '-100' -> '100'
+ddabs042 abs '101.5' -> '101.5'
+ddabs043 abs '-101.5' -> '101.5'
+
+-- more fixed, potential LHS swaps/overlays if done by subtract 0
+ddabs060 abs '-56267E-10' -> '0.0000056267'
+ddabs061 abs '-56267E-5' -> '0.56267'
+ddabs062 abs '-56267E-2' -> '562.67'
+ddabs063 abs '-56267E-1' -> '5626.7'
+ddabs065 abs '-56267E-0' -> '56267'
+
+-- subnormals and underflow
+
+-- long operand tests
+ddabs321 abs 1234567890123456 -> 1234567890123456
+ddabs322 abs 12345678000 -> 12345678000
+ddabs323 abs 1234567800 -> 1234567800
+ddabs324 abs 1234567890 -> 1234567890
+ddabs325 abs 1234567891 -> 1234567891
+ddabs326 abs 12345678901 -> 12345678901
+ddabs327 abs 1234567896 -> 1234567896
+
+-- zeros
+ddabs111 abs 0 -> 0
+ddabs112 abs -0 -> 0
+ddabs113 abs 0E+6 -> 0E+6
+ddabs114 abs -0E+6 -> 0E+6
+ddabs115 abs 0.0000 -> 0.0000
+ddabs116 abs -0.0000 -> 0.0000
+ddabs117 abs 0E-141 -> 0E-141
+ddabs118 abs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddabs121 abs 2682682682682682 -> 2682682682682682
+ddabs122 abs -2682682682682682 -> 2682682682682682
+ddabs123 abs 1341341341341341 -> 1341341341341341
+ddabs124 abs -1341341341341341 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddabs131 abs 9.999999999999999E+384 -> 9.999999999999999E+384
+ddabs132 abs 1E-383 -> 1E-383
+ddabs133 abs 1.000000000000000E-383 -> 1.000000000000000E-383
+ddabs134 abs 1E-398 -> 1E-398 Subnormal
+
+ddabs135 abs -1E-398 -> 1E-398 Subnormal
+ddabs136 abs -1.000000000000000E-383 -> 1.000000000000000E-383
+ddabs137 abs -1E-383 -> 1E-383
+ddabs138 abs -9.999999999999999E+384 -> 9.999999999999999E+384
+
+-- specials
+ddabs520 abs 'Inf' -> 'Infinity'
+ddabs521 abs '-Inf' -> 'Infinity'
+ddabs522 abs NaN -> NaN
+ddabs523 abs sNaN -> NaN Invalid_operation
+ddabs524 abs NaN22 -> NaN22
+ddabs525 abs sNaN33 -> NaN33 Invalid_operation
+ddabs526 abs -NaN22 -> -NaN22
+ddabs527 abs -sNaN33 -> -NaN33 Invalid_operation
+
+-- Null tests
+ddabs900 abs # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddAdd.decTest b/Lib/test/decimaltestdata/ddAdd.decTest
index 0f12ce4445..c0a25b3413 100644
--- a/Lib/test/decimaltestdata/ddAdd.decTest
+++ b/Lib/test/decimaltestdata/ddAdd.decTest
@@ -1,1328 +1,1328 @@
-------------------------------------------------------------------------
--- ddAdd.decTest -- decDouble addition --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decDoubles only; all arguments are
--- representable in a decDouble
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- [first group are 'quick confidence check']
-ddadd001 add 1 1 -> 2
-ddadd002 add 2 3 -> 5
-ddadd003 add '5.75' '3.3' -> 9.05
-ddadd004 add '5' '-3' -> 2
-ddadd005 add '-5' '-3' -> -8
-ddadd006 add '-7' '2.5' -> -4.5
-ddadd007 add '0.7' '0.3' -> 1.0
-ddadd008 add '1.25' '1.25' -> 2.50
-ddadd009 add '1.23456789' '1.00000000' -> '2.23456789'
-ddadd010 add '1.23456789' '1.00000011' -> '2.23456800'
-
--- 1234567890123456 1234567890123456
-ddadd011 add '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
-ddadd012 add '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded
-ddadd013 add '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
-ddadd014 add '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded
-ddadd015 add '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded
-ddadd016 add '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
-ddadd017 add '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
-ddadd018 add '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
-ddadd019 add '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded
-ddadd020 add '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded
-
-ddadd021 add 0 1 -> 1
-ddadd022 add 1 1 -> 2
-ddadd023 add 2 1 -> 3
-ddadd024 add 3 1 -> 4
-ddadd025 add 4 1 -> 5
-ddadd026 add 5 1 -> 6
-ddadd027 add 6 1 -> 7
-ddadd028 add 7 1 -> 8
-ddadd029 add 8 1 -> 9
-ddadd030 add 9 1 -> 10
-
--- some carrying effects
-ddadd031 add '0.9998' '0.0000' -> '0.9998'
-ddadd032 add '0.9998' '0.0001' -> '0.9999'
-ddadd033 add '0.9998' '0.0002' -> '1.0000'
-ddadd034 add '0.9998' '0.0003' -> '1.0001'
-
-ddadd035 add '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddadd036 add '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddadd037 add '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddadd038 add '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
-ddadd039 add '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
-
--- symmetry:
-ddadd040 add '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
-ddadd041 add '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
-ddadd042 add '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
-ddadd044 add '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
-ddadd045 add '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
-
--- same, without rounding
-ddadd046 add '10000e+9' '7' -> '10000000000007'
-ddadd047 add '10000e+9' '70' -> '10000000000070'
-ddadd048 add '10000e+9' '700' -> '10000000000700'
-ddadd049 add '10000e+9' '7000' -> '10000000007000'
-ddadd050 add '10000e+9' '70000' -> '10000000070000'
-ddadd051 add '10000e+9' '700000' -> '10000000700000'
-ddadd052 add '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-ddadd053 add '12' '7.00' -> '19.00'
-ddadd054 add '1.3' '-1.07' -> '0.23'
-ddadd055 add '1.3' '-1.30' -> '0.00'
-ddadd056 add '1.3' '-2.07' -> '-0.77'
-ddadd057 add '1E+2' '1E+4' -> '1.01E+4'
-
--- leading zero preservation
-ddadd061 add 1 '0.0001' -> '1.0001'
-ddadd062 add 1 '0.00001' -> '1.00001'
-ddadd063 add 1 '0.000001' -> '1.000001'
-ddadd064 add 1 '0.0000001' -> '1.0000001'
-ddadd065 add 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-ddadd070 add 1 0 -> 1
-ddadd071 add 1 0. -> 1
-ddadd072 add 1 .0 -> 1.0
-ddadd073 add 1 0.0 -> 1.0
-ddadd074 add 1 0.00 -> 1.00
-ddadd075 add 0 1 -> 1
-ddadd076 add 0. 1 -> 1
-ddadd077 add .0 1 -> 1.0
-ddadd078 add 0.0 1 -> 1.0
-ddadd079 add 0.00 1 -> 1.00
-
--- some carries
-ddadd080 add 999999998 1 -> 999999999
-ddadd081 add 999999999 1 -> 1000000000
-ddadd082 add 99999999 1 -> 100000000
-ddadd083 add 9999999 1 -> 10000000
-ddadd084 add 999999 1 -> 1000000
-ddadd085 add 99999 1 -> 100000
-ddadd086 add 9999 1 -> 10000
-ddadd087 add 999 1 -> 1000
-ddadd088 add 99 1 -> 100
-ddadd089 add 9 1 -> 10
-
-
--- more LHS swaps
-ddadd090 add '-56267E-10' 0 -> '-0.0000056267'
-ddadd091 add '-56267E-6' 0 -> '-0.056267'
-ddadd092 add '-56267E-5' 0 -> '-0.56267'
-ddadd093 add '-56267E-4' 0 -> '-5.6267'
-ddadd094 add '-56267E-3' 0 -> '-56.267'
-ddadd095 add '-56267E-2' 0 -> '-562.67'
-ddadd096 add '-56267E-1' 0 -> '-5626.7'
-ddadd097 add '-56267E-0' 0 -> '-56267'
-ddadd098 add '-5E-10' 0 -> '-5E-10'
-ddadd099 add '-5E-7' 0 -> '-5E-7'
-ddadd100 add '-5E-6' 0 -> '-0.000005'
-ddadd101 add '-5E-5' 0 -> '-0.00005'
-ddadd102 add '-5E-4' 0 -> '-0.0005'
-ddadd103 add '-5E-1' 0 -> '-0.5'
-ddadd104 add '-5E0' 0 -> '-5'
-ddadd105 add '-5E1' 0 -> '-50'
-ddadd106 add '-5E5' 0 -> '-500000'
-ddadd107 add '-5E15' 0 -> '-5000000000000000'
-ddadd108 add '-5E16' 0 -> '-5.000000000000000E+16' Rounded
-ddadd109 add '-5E17' 0 -> '-5.000000000000000E+17' Rounded
-ddadd110 add '-5E18' 0 -> '-5.000000000000000E+18' Rounded
-ddadd111 add '-5E100' 0 -> '-5.000000000000000E+100' Rounded
-
--- more RHS swaps
-ddadd113 add 0 '-56267E-10' -> '-0.0000056267'
-ddadd114 add 0 '-56267E-6' -> '-0.056267'
-ddadd116 add 0 '-56267E-5' -> '-0.56267'
-ddadd117 add 0 '-56267E-4' -> '-5.6267'
-ddadd119 add 0 '-56267E-3' -> '-56.267'
-ddadd120 add 0 '-56267E-2' -> '-562.67'
-ddadd121 add 0 '-56267E-1' -> '-5626.7'
-ddadd122 add 0 '-56267E-0' -> '-56267'
-ddadd123 add 0 '-5E-10' -> '-5E-10'
-ddadd124 add 0 '-5E-7' -> '-5E-7'
-ddadd125 add 0 '-5E-6' -> '-0.000005'
-ddadd126 add 0 '-5E-5' -> '-0.00005'
-ddadd127 add 0 '-5E-4' -> '-0.0005'
-ddadd128 add 0 '-5E-1' -> '-0.5'
-ddadd129 add 0 '-5E0' -> '-5'
-ddadd130 add 0 '-5E1' -> '-50'
-ddadd131 add 0 '-5E5' -> '-500000'
-ddadd132 add 0 '-5E15' -> '-5000000000000000'
-ddadd133 add 0 '-5E16' -> '-5.000000000000000E+16' Rounded
-ddadd134 add 0 '-5E17' -> '-5.000000000000000E+17' Rounded
-ddadd135 add 0 '-5E18' -> '-5.000000000000000E+18' Rounded
-ddadd136 add 0 '-5E100' -> '-5.000000000000000E+100' Rounded
-
--- related
-ddadd137 add 1 '0E-19' -> '1.000000000000000' Rounded
-ddadd138 add -1 '0E-19' -> '-1.000000000000000' Rounded
-ddadd139 add '0E-19' 1 -> '1.000000000000000' Rounded
-ddadd140 add '0E-19' -1 -> '-1.000000000000000' Rounded
-ddadd141 add 1E+11 0.0000 -> '100000000000.0000'
-ddadd142 add 1E+11 0.00000 -> '100000000000.0000' Rounded
-ddadd143 add 0.000 1E+12 -> '1000000000000.000'
-ddadd144 add 0.0000 1E+12 -> '1000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-ddadd146 add '00.0' 0 -> '0.0'
-ddadd147 add '0.00' 0 -> '0.00'
-ddadd148 add 0 '0.00' -> '0.00'
-ddadd149 add 0 '00.0' -> '0.0'
-ddadd150 add '00.0' '0.00' -> '0.00'
-ddadd151 add '0.00' '00.0' -> '0.00'
-ddadd152 add '3' '.3' -> '3.3'
-ddadd153 add '3.' '.3' -> '3.3'
-ddadd154 add '3.0' '.3' -> '3.3'
-ddadd155 add '3.00' '.3' -> '3.30'
-ddadd156 add '3' '3' -> '6'
-ddadd157 add '3' '+3' -> '6'
-ddadd158 add '3' '-3' -> '0'
-ddadd159 add '0.3' '-0.3' -> '0.0'
-ddadd160 add '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-ddadd161 add '1E+12' '-1' -> '999999999999'
-ddadd162 add '1E+12' '1.11' -> '1000000000001.11'
-ddadd163 add '1.11' '1E+12' -> '1000000000001.11'
-ddadd164 add '-1' '1E+12' -> '999999999999'
-ddadd165 add '7E+12' '-1' -> '6999999999999'
-ddadd166 add '7E+12' '1.11' -> '7000000000001.11'
-ddadd167 add '1.11' '7E+12' -> '7000000000001.11'
-ddadd168 add '-1' '7E+12' -> '6999999999999'
-
-rounding: half_up
--- 1.234567890123456 1234567890123456 1 234567890123456
-ddadd170 add '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
-ddadd171 add '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
-ddadd172 add '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
-ddadd173 add '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
-ddadd174 add '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
-ddadd175 add '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
-ddadd176 add '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
-ddadd177 add '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded
-ddadd178 add '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
-ddadd179 add '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
-ddadd180 add '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
-ddadd181 add '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
-ddadd182 add '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
-ddadd183 add '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-ddadd200 add '1234560123456789' 0 -> '1234560123456789'
-ddadd201 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddadd202 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddadd203 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddadd204 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddadd205 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddadd206 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddadd207 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddadd208 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
-ddadd209 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
-ddadd210 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
-ddadd211 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
-ddadd212 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
-ddadd213 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
-ddadd214 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
-ddadd215 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
-ddadd216 add '1234560123456789' 1 -> '1234560123456790'
-ddadd217 add '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded
-ddadd218 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddadd219 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
-
-rounding: half_even
-ddadd220 add '1234560123456789' 0 -> '1234560123456789'
-ddadd221 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddadd222 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddadd223 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddadd224 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddadd225 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddadd226 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddadd227 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddadd228 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
-ddadd229 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
-ddadd230 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
-ddadd231 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
-ddadd232 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
-ddadd233 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
-ddadd234 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
-ddadd235 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
-ddadd236 add '1234560123456789' 1 -> '1234560123456790'
-ddadd237 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
-ddadd238 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddadd239 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
--- critical few with even bottom digit...
-ddadd240 add '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded
-ddadd241 add '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded
-ddadd242 add '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded
-
-rounding: down
-ddadd250 add '1234560123456789' 0 -> '1234560123456789'
-ddadd251 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddadd252 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddadd253 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddadd254 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddadd255 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddadd256 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddadd257 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddadd258 add '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded
-ddadd259 add '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded
-ddadd260 add '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded
-ddadd261 add '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded
-ddadd262 add '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded
-ddadd263 add '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded
-ddadd264 add '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded
-ddadd265 add '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded
-ddadd266 add '1234560123456789' 1 -> '1234560123456790'
-ddadd267 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
-ddadd268 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddadd269 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-ddadd301 add -1 1 -> 0
-ddadd302 add 0 1 -> 1
-ddadd303 add 1 1 -> 2
-ddadd304 add 12 1 -> 13
-ddadd305 add 98 1 -> 99
-ddadd306 add 99 1 -> 100
-ddadd307 add 100 1 -> 101
-ddadd308 add 101 1 -> 102
-ddadd309 add -1 -1 -> -2
-ddadd310 add 0 -1 -> -1
-ddadd311 add 1 -1 -> 0
-ddadd312 add 12 -1 -> 11
-ddadd313 add 98 -1 -> 97
-ddadd314 add 99 -1 -> 98
-ddadd315 add 100 -1 -> 99
-ddadd316 add 101 -1 -> 100
-
-ddadd321 add -0.01 0.01 -> 0.00
-ddadd322 add 0.00 0.01 -> 0.01
-ddadd323 add 0.01 0.01 -> 0.02
-ddadd324 add 0.12 0.01 -> 0.13
-ddadd325 add 0.98 0.01 -> 0.99
-ddadd326 add 0.99 0.01 -> 1.00
-ddadd327 add 1.00 0.01 -> 1.01
-ddadd328 add 1.01 0.01 -> 1.02
-ddadd329 add -0.01 -0.01 -> -0.02
-ddadd330 add 0.00 -0.01 -> -0.01
-ddadd331 add 0.01 -0.01 -> 0.00
-ddadd332 add 0.12 -0.01 -> 0.11
-ddadd333 add 0.98 -0.01 -> 0.97
-ddadd334 add 0.99 -0.01 -> 0.98
-ddadd335 add 1.00 -0.01 -> 0.99
-ddadd336 add 1.01 -0.01 -> 1.00
-
--- some more cases where adding 0 affects the coefficient
-ddadd340 add 1E+3 0 -> 1000
-ddadd341 add 1E+15 0 -> 1000000000000000
-ddadd342 add 1E+16 0 -> 1.000000000000000E+16 Rounded
-ddadd343 add 1E+20 0 -> 1.000000000000000E+20 Rounded
--- which simply follow from these cases ...
-ddadd344 add 1E+3 1 -> 1001
-ddadd345 add 1E+15 1 -> 1000000000000001
-ddadd346 add 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
-ddadd347 add 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded
-ddadd348 add 1E+3 7 -> 1007
-ddadd349 add 1E+15 7 -> 1000000000000007
-ddadd350 add 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
-ddadd351 add 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded
-
--- tryzeros cases
-rounding: half_up
-ddadd360 add 0E+50 10000E+1 -> 1.0000E+5
-ddadd361 add 0E-50 10000E+1 -> 100000.0000000000 Rounded
-ddadd362 add 10000E+1 0E-50 -> 100000.0000000000 Rounded
-ddadd363 add 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
-ddadd364 add 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-ddadd370 add 999999999999999 815 -> 1000000000000814
-ddadd371 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-rounding: half_up
-ddadd372 add 999999999999999 815 -> 1000000000000814
-ddadd373 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-rounding: half_even
-ddadd374 add 999999999999999 815 -> 1000000000000814
-ddadd375 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-
--- operands folded
-ddadd380 add 1E+384 1E+384 -> 2.000000000000000E+384 Clamped
-ddadd381 add 1E+380 1E+380 -> 2.00000000000E+380 Clamped
-ddadd382 add 1E+376 1E+376 -> 2.0000000E+376 Clamped
-ddadd383 add 1E+372 1E+372 -> 2.000E+372 Clamped
-ddadd384 add 1E+370 1E+370 -> 2.0E+370 Clamped
-ddadd385 add 1E+369 1E+369 -> 2E+369
-ddadd386 add 1E+368 1E+368 -> 2E+368
-
--- ulp replacement tests
-ddadd400 add 1 77e-14 -> 1.00000000000077
-ddadd401 add 1 77e-15 -> 1.000000000000077
-ddadd402 add 1 77e-16 -> 1.000000000000008 Inexact Rounded
-ddadd403 add 1 77e-17 -> 1.000000000000001 Inexact Rounded
-ddadd404 add 1 77e-18 -> 1.000000000000000 Inexact Rounded
-ddadd405 add 1 77e-19 -> 1.000000000000000 Inexact Rounded
-ddadd406 add 1 77e-299 -> 1.000000000000000 Inexact Rounded
-
-ddadd410 add 10 77e-14 -> 10.00000000000077
-ddadd411 add 10 77e-15 -> 10.00000000000008 Inexact Rounded
-ddadd412 add 10 77e-16 -> 10.00000000000001 Inexact Rounded
-ddadd413 add 10 77e-17 -> 10.00000000000000 Inexact Rounded
-ddadd414 add 10 77e-18 -> 10.00000000000000 Inexact Rounded
-ddadd415 add 10 77e-19 -> 10.00000000000000 Inexact Rounded
-ddadd416 add 10 77e-299 -> 10.00000000000000 Inexact Rounded
-
-ddadd420 add 77e-14 1 -> 1.00000000000077
-ddadd421 add 77e-15 1 -> 1.000000000000077
-ddadd422 add 77e-16 1 -> 1.000000000000008 Inexact Rounded
-ddadd423 add 77e-17 1 -> 1.000000000000001 Inexact Rounded
-ddadd424 add 77e-18 1 -> 1.000000000000000 Inexact Rounded
-ddadd425 add 77e-19 1 -> 1.000000000000000 Inexact Rounded
-ddadd426 add 77e-299 1 -> 1.000000000000000 Inexact Rounded
-
-ddadd430 add 77e-14 10 -> 10.00000000000077
-ddadd431 add 77e-15 10 -> 10.00000000000008 Inexact Rounded
-ddadd432 add 77e-16 10 -> 10.00000000000001 Inexact Rounded
-ddadd433 add 77e-17 10 -> 10.00000000000000 Inexact Rounded
-ddadd434 add 77e-18 10 -> 10.00000000000000 Inexact Rounded
-ddadd435 add 77e-19 10 -> 10.00000000000000 Inexact Rounded
-ddadd436 add 77e-299 10 -> 10.00000000000000 Inexact Rounded
-
--- fastpath boundary (more in dqadd)
--- 1234567890123456
-ddadd539 add '4444444444444444' '3333333333333333' -> '7777777777777777'
-ddadd540 add '4444444444444444' '4444444444444444' -> '8888888888888888'
-ddadd541 add '4444444444444444' '5555555555555555' -> '9999999999999999'
-ddadd542 add '3333333333333333' '4444444444444444' -> '7777777777777777'
-ddadd543 add '4444444444444444' '4444444444444444' -> '8888888888888888'
-ddadd544 add '5555555555555555' '4444444444444444' -> '9999999999999999'
-ddadd545 add '3000004000000000' '3000000000000040' -> '6000004000000040'
-ddadd546 add '3000000400000000' '4000000000000400' -> '7000000400000400'
-ddadd547 add '3000000040000000' '5000000000004000' -> '8000000040004000'
-ddadd548 add '4000000004000000' '3000000000040000' -> '7000000004040000'
-ddadd549 add '4000000000400000' '4000000000400000' -> '8000000000800000'
-ddadd550 add '4000000000040000' '5000000004000000' -> '9000000004040000'
-ddadd551 add '5000000000004000' '3000000040000000' -> '8000000040004000'
-ddadd552 add '5000000000000400' '4000000400000000' -> '9000000400000400'
-ddadd553 add '5000000000000040' '5000004000000000' -> 1.000000400000004E+16 Rounded
--- check propagation
-ddadd554 add '8999999999999999' '0000000000000001' -> 9000000000000000
-ddadd555 add '0000000000000001' '8999999999999999' -> 9000000000000000
-ddadd556 add '0999999999999999' '0000000000000001' -> 1000000000000000
-ddadd557 add '0000000000000001' '0999999999999999' -> 1000000000000000
-ddadd558 add '4444444444444444' '4555555555555556' -> 9000000000000000
-ddadd559 add '4555555555555556' '4444444444444444' -> 9000000000000000
-
--- negative ulps
-ddadd6440 add 1 -77e-14 -> 0.99999999999923
-ddadd6441 add 1 -77e-15 -> 0.999999999999923
-ddadd6442 add 1 -77e-16 -> 0.9999999999999923
-ddadd6443 add 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
-ddadd6444 add 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
-ddadd6445 add 1 -77e-19 -> 1.000000000000000 Inexact Rounded
-ddadd6446 add 1 -77e-99 -> 1.000000000000000 Inexact Rounded
-
-ddadd6450 add 10 -77e-14 -> 9.99999999999923
-ddadd6451 add 10 -77e-15 -> 9.999999999999923
-ddadd6452 add 10 -77e-16 -> 9.999999999999992 Inexact Rounded
-ddadd6453 add 10 -77e-17 -> 9.999999999999999 Inexact Rounded
-ddadd6454 add 10 -77e-18 -> 10.00000000000000 Inexact Rounded
-ddadd6455 add 10 -77e-19 -> 10.00000000000000 Inexact Rounded
-ddadd6456 add 10 -77e-99 -> 10.00000000000000 Inexact Rounded
-
-ddadd6460 add -77e-14 1 -> 0.99999999999923
-ddadd6461 add -77e-15 1 -> 0.999999999999923
-ddadd6462 add -77e-16 1 -> 0.9999999999999923
-ddadd6463 add -77e-17 1 -> 0.9999999999999992 Inexact Rounded
-ddadd6464 add -77e-18 1 -> 0.9999999999999999 Inexact Rounded
-ddadd6465 add -77e-19 1 -> 1.000000000000000 Inexact Rounded
-ddadd6466 add -77e-99 1 -> 1.000000000000000 Inexact Rounded
-
-ddadd6470 add -77e-14 10 -> 9.99999999999923
-ddadd6471 add -77e-15 10 -> 9.999999999999923
-ddadd6472 add -77e-16 10 -> 9.999999999999992 Inexact Rounded
-ddadd6473 add -77e-17 10 -> 9.999999999999999 Inexact Rounded
-ddadd6474 add -77e-18 10 -> 10.00000000000000 Inexact Rounded
-ddadd6475 add -77e-19 10 -> 10.00000000000000 Inexact Rounded
-ddadd6476 add -77e-99 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-ddadd6480 add -1 77e-14 -> -0.99999999999923
-ddadd6481 add -1 77e-15 -> -0.999999999999923
-ddadd6482 add -1 77e-16 -> -0.9999999999999923
-ddadd6483 add -1 77e-17 -> -0.9999999999999992 Inexact Rounded
-ddadd6484 add -1 77e-18 -> -0.9999999999999999 Inexact Rounded
-ddadd6485 add -1 77e-19 -> -1.000000000000000 Inexact Rounded
-ddadd6486 add -1 77e-99 -> -1.000000000000000 Inexact Rounded
-
-ddadd6490 add -10 77e-14 -> -9.99999999999923
-ddadd6491 add -10 77e-15 -> -9.999999999999923
-ddadd6492 add -10 77e-16 -> -9.999999999999992 Inexact Rounded
-ddadd6493 add -10 77e-17 -> -9.999999999999999 Inexact Rounded
-ddadd6494 add -10 77e-18 -> -10.00000000000000 Inexact Rounded
-ddadd6495 add -10 77e-19 -> -10.00000000000000 Inexact Rounded
-ddadd6496 add -10 77e-99 -> -10.00000000000000 Inexact Rounded
-
-ddadd6500 add 77e-14 -1 -> -0.99999999999923
-ddadd6501 add 77e-15 -1 -> -0.999999999999923
-ddadd6502 add 77e-16 -1 -> -0.9999999999999923
-ddadd6503 add 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
-ddadd6504 add 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
-ddadd6505 add 77e-19 -1 -> -1.000000000000000 Inexact Rounded
-ddadd6506 add 77e-99 -1 -> -1.000000000000000 Inexact Rounded
-
-ddadd6510 add 77e-14 -10 -> -9.99999999999923
-ddadd6511 add 77e-15 -10 -> -9.999999999999923
-ddadd6512 add 77e-16 -10 -> -9.999999999999992 Inexact Rounded
-ddadd6513 add 77e-17 -10 -> -9.999999999999999 Inexact Rounded
-ddadd6514 add 77e-18 -10 -> -10.00000000000000 Inexact Rounded
-ddadd6515 add 77e-19 -10 -> -10.00000000000000 Inexact Rounded
-ddadd6516 add 77e-99 -10 -> -10.00000000000000 Inexact Rounded
-
--- and some more residue effects and different roundings
-rounding: half_up
-ddadd6540 add '6543210123456789' 0 -> '6543210123456789'
-ddadd6541 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddadd6542 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddadd6543 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddadd6544 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddadd6545 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddadd6546 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddadd6547 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddadd6548 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-ddadd6549 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-ddadd6550 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-ddadd6551 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-ddadd6552 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-ddadd6553 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-ddadd6554 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-ddadd6555 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
-ddadd6556 add '6543210123456789' 1 -> '6543210123456790'
-ddadd6557 add '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
-ddadd6558 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddadd6559 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
-rounding: half_even
-ddadd6560 add '6543210123456789' 0 -> '6543210123456789'
-ddadd6561 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddadd6562 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddadd6563 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddadd6564 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddadd6565 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddadd6566 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddadd6567 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddadd6568 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-ddadd6569 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-ddadd6570 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-ddadd6571 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-ddadd6572 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-ddadd6573 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-ddadd6574 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-ddadd6575 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
-ddadd6576 add '6543210123456789' 1 -> '6543210123456790'
-ddadd6577 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-ddadd6578 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddadd6579 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
--- critical few with even bottom digit...
-ddadd7540 add '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded
-ddadd7541 add '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
-ddadd7542 add '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
-
-rounding: down
-ddadd7550 add '6543210123456789' 0 -> '6543210123456789'
-ddadd7551 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddadd7552 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddadd7553 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddadd7554 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddadd7555 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddadd7556 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddadd7557 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddadd7558 add '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
-ddadd7559 add '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
-ddadd7560 add '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
-ddadd7561 add '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
-ddadd7562 add '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
-ddadd7563 add '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
-ddadd7564 add '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
-ddadd7565 add '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded
-ddadd7566 add '6543210123456789' 1 -> '6543210123456790'
-ddadd7567 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-ddadd7568 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddadd7569 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
--- verify a query
-rounding: down
-ddadd7661 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
-ddadd7662 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
-ddadd7663 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
-ddadd7664 add 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-ddadd7701 add 5.00 1.00E-3 -> 5.00100
-ddadd7702 add 00.00 0.000 -> 0.000
-ddadd7703 add 00.00 0E-3 -> 0.000
-ddadd7704 add 0E-3 00.00 -> 0.000
-
-ddadd7710 add 0E+3 00.00 -> 0.00
-ddadd7711 add 0E+3 00.0 -> 0.0
-ddadd7712 add 0E+3 00. -> 0
-ddadd7713 add 0E+3 00.E+1 -> 0E+1
-ddadd7714 add 0E+3 00.E+2 -> 0E+2
-ddadd7715 add 0E+3 00.E+3 -> 0E+3
-ddadd7716 add 0E+3 00.E+4 -> 0E+3
-ddadd7717 add 0E+3 00.E+5 -> 0E+3
-ddadd7718 add 0E+3 -00.0 -> 0.0
-ddadd7719 add 0E+3 -00. -> 0
-ddadd7731 add 0E+3 -00.E+1 -> 0E+1
-
-ddadd7720 add 00.00 0E+3 -> 0.00
-ddadd7721 add 00.0 0E+3 -> 0.0
-ddadd7722 add 00. 0E+3 -> 0
-ddadd7723 add 00.E+1 0E+3 -> 0E+1
-ddadd7724 add 00.E+2 0E+3 -> 0E+2
-ddadd7725 add 00.E+3 0E+3 -> 0E+3
-ddadd7726 add 00.E+4 0E+3 -> 0E+3
-ddadd7727 add 00.E+5 0E+3 -> 0E+3
-ddadd7728 add -00.00 0E+3 -> 0.00
-ddadd7729 add -00.0 0E+3 -> 0.0
-ddadd7730 add -00. 0E+3 -> 0
-
-ddadd7732 add 0 0 -> 0
-ddadd7733 add 0 -0 -> 0
-ddadd7734 add -0 0 -> 0
-ddadd7735 add -0 -0 -> -0 -- IEEE 854 special case
-
-ddadd7736 add 1 -1 -> 0
-ddadd7737 add -1 -1 -> -2
-ddadd7738 add 1 1 -> 2
-ddadd7739 add -1 1 -> 0
-
-ddadd7741 add 0 -1 -> -1
-ddadd7742 add -0 -1 -> -1
-ddadd7743 add 0 1 -> 1
-ddadd7744 add -0 1 -> 1
-ddadd7745 add -1 0 -> -1
-ddadd7746 add -1 -0 -> -1
-ddadd7747 add 1 0 -> 1
-ddadd7748 add 1 -0 -> 1
-
-ddadd7751 add 0.0 -1 -> -1.0
-ddadd7752 add -0.0 -1 -> -1.0
-ddadd7753 add 0.0 1 -> 1.0
-ddadd7754 add -0.0 1 -> 1.0
-ddadd7755 add -1.0 0 -> -1.0
-ddadd7756 add -1.0 -0 -> -1.0
-ddadd7757 add 1.0 0 -> 1.0
-ddadd7758 add 1.0 -0 -> 1.0
-
-ddadd7761 add 0 -1.0 -> -1.0
-ddadd7762 add -0 -1.0 -> -1.0
-ddadd7763 add 0 1.0 -> 1.0
-ddadd7764 add -0 1.0 -> 1.0
-ddadd7765 add -1 0.0 -> -1.0
-ddadd7766 add -1 -0.0 -> -1.0
-ddadd7767 add 1 0.0 -> 1.0
-ddadd7768 add 1 -0.0 -> 1.0
-
-ddadd7771 add 0.0 -1.0 -> -1.0
-ddadd7772 add -0.0 -1.0 -> -1.0
-ddadd7773 add 0.0 1.0 -> 1.0
-ddadd7774 add -0.0 1.0 -> 1.0
-ddadd7775 add -1.0 0.0 -> -1.0
-ddadd7776 add -1.0 -0.0 -> -1.0
-ddadd7777 add 1.0 0.0 -> 1.0
-ddadd7778 add 1.0 -0.0 -> 1.0
-
--- Specials
-ddadd7780 add -Inf -Inf -> -Infinity
-ddadd7781 add -Inf -1000 -> -Infinity
-ddadd7782 add -Inf -1 -> -Infinity
-ddadd7783 add -Inf -0 -> -Infinity
-ddadd7784 add -Inf 0 -> -Infinity
-ddadd7785 add -Inf 1 -> -Infinity
-ddadd7786 add -Inf 1000 -> -Infinity
-ddadd7787 add -1000 -Inf -> -Infinity
-ddadd7788 add -Inf -Inf -> -Infinity
-ddadd7789 add -1 -Inf -> -Infinity
-ddadd7790 add -0 -Inf -> -Infinity
-ddadd7791 add 0 -Inf -> -Infinity
-ddadd7792 add 1 -Inf -> -Infinity
-ddadd7793 add 1000 -Inf -> -Infinity
-ddadd7794 add Inf -Inf -> NaN Invalid_operation
-
-ddadd7800 add Inf -Inf -> NaN Invalid_operation
-ddadd7801 add Inf -1000 -> Infinity
-ddadd7802 add Inf -1 -> Infinity
-ddadd7803 add Inf -0 -> Infinity
-ddadd7804 add Inf 0 -> Infinity
-ddadd7805 add Inf 1 -> Infinity
-ddadd7806 add Inf 1000 -> Infinity
-ddadd7807 add Inf Inf -> Infinity
-ddadd7808 add -1000 Inf -> Infinity
-ddadd7809 add -Inf Inf -> NaN Invalid_operation
-ddadd7810 add -1 Inf -> Infinity
-ddadd7811 add -0 Inf -> Infinity
-ddadd7812 add 0 Inf -> Infinity
-ddadd7813 add 1 Inf -> Infinity
-ddadd7814 add 1000 Inf -> Infinity
-ddadd7815 add Inf Inf -> Infinity
-
-ddadd7821 add NaN -Inf -> NaN
-ddadd7822 add NaN -1000 -> NaN
-ddadd7823 add NaN -1 -> NaN
-ddadd7824 add NaN -0 -> NaN
-ddadd7825 add NaN 0 -> NaN
-ddadd7826 add NaN 1 -> NaN
-ddadd7827 add NaN 1000 -> NaN
-ddadd7828 add NaN Inf -> NaN
-ddadd7829 add NaN NaN -> NaN
-ddadd7830 add -Inf NaN -> NaN
-ddadd7831 add -1000 NaN -> NaN
-ddadd7832 add -1 NaN -> NaN
-ddadd7833 add -0 NaN -> NaN
-ddadd7834 add 0 NaN -> NaN
-ddadd7835 add 1 NaN -> NaN
-ddadd7836 add 1000 NaN -> NaN
-ddadd7837 add Inf NaN -> NaN
-
-ddadd7841 add sNaN -Inf -> NaN Invalid_operation
-ddadd7842 add sNaN -1000 -> NaN Invalid_operation
-ddadd7843 add sNaN -1 -> NaN Invalid_operation
-ddadd7844 add sNaN -0 -> NaN Invalid_operation
-ddadd7845 add sNaN 0 -> NaN Invalid_operation
-ddadd7846 add sNaN 1 -> NaN Invalid_operation
-ddadd7847 add sNaN 1000 -> NaN Invalid_operation
-ddadd7848 add sNaN NaN -> NaN Invalid_operation
-ddadd7849 add sNaN sNaN -> NaN Invalid_operation
-ddadd7850 add NaN sNaN -> NaN Invalid_operation
-ddadd7851 add -Inf sNaN -> NaN Invalid_operation
-ddadd7852 add -1000 sNaN -> NaN Invalid_operation
-ddadd7853 add -1 sNaN -> NaN Invalid_operation
-ddadd7854 add -0 sNaN -> NaN Invalid_operation
-ddadd7855 add 0 sNaN -> NaN Invalid_operation
-ddadd7856 add 1 sNaN -> NaN Invalid_operation
-ddadd7857 add 1000 sNaN -> NaN Invalid_operation
-ddadd7858 add Inf sNaN -> NaN Invalid_operation
-ddadd7859 add NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddadd7861 add NaN1 -Inf -> NaN1
-ddadd7862 add +NaN2 -1000 -> NaN2
-ddadd7863 add NaN3 1000 -> NaN3
-ddadd7864 add NaN4 Inf -> NaN4
-ddadd7865 add NaN5 +NaN6 -> NaN5
-ddadd7866 add -Inf NaN7 -> NaN7
-ddadd7867 add -1000 NaN8 -> NaN8
-ddadd7868 add 1000 NaN9 -> NaN9
-ddadd7869 add Inf +NaN10 -> NaN10
-ddadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation
-ddadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation
-ddadd7873 add sNaN13 1000 -> NaN13 Invalid_operation
-ddadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation
-ddadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation
-ddadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation
-ddadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation
-ddadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation
-ddadd7880 add Inf sNaN23 -> NaN23 Invalid_operation
-ddadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddadd7882 add -NaN26 NaN28 -> -NaN26
-ddadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddadd7884 add 1000 -NaN30 -> -NaN30
-ddadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Here we explore near the boundary of rounding a subnormal to Nmin
-ddadd7575 add 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal
-ddadd7576 add -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal
-
--- and another curious case
-ddadd7577 add 7.000000000000E-385 -1.00000E-391 -> 6.999999000000E-385 Subnormal
-
--- check overflow edge case
--- 1234567890123456
-ddadd7972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
-ddadd7973 add 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7974 add 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7975 add 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
-ddadd7976 add 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
-ddadd7977 add 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
-ddadd7978 add 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
-ddadd7979 add 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
-ddadd7980 add 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
-ddadd7981 add 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7982 add 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7983 add 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7984 add 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
-
-ddadd7985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
-ddadd7986 add -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7987 add -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7988 add -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
-ddadd7989 add -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7990 add -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7991 add -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7992 add -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7993 add -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7994 add -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7995 add -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7996 add -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7997 add -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-ddadd71100 add 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
-ddadd71101 add 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
-ddadd71103 add +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
-ddadd71104 add 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
-ddadd71105 add 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
-ddadd71106 add 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
-ddadd71107 add 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
-ddadd71108 add 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
-ddadd71109 add 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-ddadd71110 add -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
-ddadd71111 add -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
-ddadd71113 add -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
-ddadd71114 add -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
-ddadd71115 add -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
-ddadd71116 add -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
-ddadd71117 add -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
-ddadd71118 add -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
-ddadd71119 add -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-ddadd71300 add 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71310 add 1E16 -0.51 -> 9999999999999999 Inexact Rounded
-ddadd71311 add 1E16 -0.501 -> 9999999999999999 Inexact Rounded
-ddadd71312 add 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
-ddadd71313 add 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
-ddadd71314 add 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
-ddadd71315 add 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
-ddadd71316 add 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
-ddadd71317 add 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
-ddadd71318 add 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
-ddadd71319 add 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
-ddadd71320 add 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
-ddadd71321 add 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
-ddadd71322 add 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
-ddadd71323 add 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
-ddadd71324 add 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
-ddadd71325 add 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71326 add 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71327 add 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71328 add 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71329 add 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71330 add 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71331 add 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71332 add 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71333 add 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71334 add 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71335 add 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71336 add 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71337 add 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71338 add 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71339 add 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
-
-ddadd71340 add 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
-ddadd71341 add 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
-
-ddadd71349 add 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
-ddadd71350 add 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
-ddadd71351 add 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
-ddadd71352 add 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
-ddadd71353 add 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
-ddadd71354 add 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
-ddadd71355 add 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
-ddadd71356 add 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
-ddadd71357 add 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
-ddadd71358 add 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
-ddadd71359 add 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
-ddadd71360 add 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
-ddadd71361 add 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
-ddadd71362 add 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
-ddadd71363 add 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
-ddadd71364 add 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
-ddadd71365 add 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71367 add 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71368 add 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71369 add 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71370 add 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71371 add 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71372 add 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71373 add 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71374 add 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71375 add 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71376 add 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71377 add 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71378 add 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71379 add 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71380 add 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71381 add 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71382 add 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71383 add 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71384 add 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71385 add 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71386 add 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71387 add 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71388 add 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71389 add 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71390 add 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71391 add 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71392 add 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71393 add 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71394 add 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71395 add 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71396 add 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-ddadd71420 add 0 1.123456789012345 -> 1.123456789012345
-ddadd71421 add 0 1.123456789012345E-1 -> 0.1123456789012345
-ddadd71422 add 0 1.123456789012345E-2 -> 0.01123456789012345
-ddadd71423 add 0 1.123456789012345E-3 -> 0.001123456789012345
-ddadd71424 add 0 1.123456789012345E-4 -> 0.0001123456789012345
-ddadd71425 add 0 1.123456789012345E-5 -> 0.00001123456789012345
-ddadd71426 add 0 1.123456789012345E-6 -> 0.000001123456789012345
-ddadd71427 add 0 1.123456789012345E-7 -> 1.123456789012345E-7
-ddadd71428 add 0 1.123456789012345E-8 -> 1.123456789012345E-8
-ddadd71429 add 0 1.123456789012345E-9 -> 1.123456789012345E-9
-ddadd71430 add 0 1.123456789012345E-10 -> 1.123456789012345E-10
-ddadd71431 add 0 1.123456789012345E-11 -> 1.123456789012345E-11
-ddadd71432 add 0 1.123456789012345E-12 -> 1.123456789012345E-12
-ddadd71433 add 0 1.123456789012345E-13 -> 1.123456789012345E-13
-ddadd71434 add 0 1.123456789012345E-14 -> 1.123456789012345E-14
-ddadd71435 add 0 1.123456789012345E-15 -> 1.123456789012345E-15
-ddadd71436 add 0 1.123456789012345E-16 -> 1.123456789012345E-16
-ddadd71437 add 0 1.123456789012345E-17 -> 1.123456789012345E-17
-ddadd71438 add 0 1.123456789012345E-18 -> 1.123456789012345E-18
-ddadd71439 add 0 1.123456789012345E-19 -> 1.123456789012345E-19
-
--- same, reversed 0
-ddadd71440 add 1.123456789012345 0 -> 1.123456789012345
-ddadd71441 add 1.123456789012345E-1 0 -> 0.1123456789012345
-ddadd71442 add 1.123456789012345E-2 0 -> 0.01123456789012345
-ddadd71443 add 1.123456789012345E-3 0 -> 0.001123456789012345
-ddadd71444 add 1.123456789012345E-4 0 -> 0.0001123456789012345
-ddadd71445 add 1.123456789012345E-5 0 -> 0.00001123456789012345
-ddadd71446 add 1.123456789012345E-6 0 -> 0.000001123456789012345
-ddadd71447 add 1.123456789012345E-7 0 -> 1.123456789012345E-7
-ddadd71448 add 1.123456789012345E-8 0 -> 1.123456789012345E-8
-ddadd71449 add 1.123456789012345E-9 0 -> 1.123456789012345E-9
-ddadd71450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10
-ddadd71451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11
-ddadd71452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12
-ddadd71453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13
-ddadd71454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14
-ddadd71455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15
-ddadd71456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16
-ddadd71457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17
-ddadd71458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18
-ddadd71459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19
-
--- same, Es on the 0
-ddadd71460 add 1.123456789012345 0E-0 -> 1.123456789012345
-ddadd71461 add 1.123456789012345 0E-1 -> 1.123456789012345
-ddadd71462 add 1.123456789012345 0E-2 -> 1.123456789012345
-ddadd71463 add 1.123456789012345 0E-3 -> 1.123456789012345
-ddadd71464 add 1.123456789012345 0E-4 -> 1.123456789012345
-ddadd71465 add 1.123456789012345 0E-5 -> 1.123456789012345
-ddadd71466 add 1.123456789012345 0E-6 -> 1.123456789012345
-ddadd71467 add 1.123456789012345 0E-7 -> 1.123456789012345
-ddadd71468 add 1.123456789012345 0E-8 -> 1.123456789012345
-ddadd71469 add 1.123456789012345 0E-9 -> 1.123456789012345
-ddadd71470 add 1.123456789012345 0E-10 -> 1.123456789012345
-ddadd71471 add 1.123456789012345 0E-11 -> 1.123456789012345
-ddadd71472 add 1.123456789012345 0E-12 -> 1.123456789012345
-ddadd71473 add 1.123456789012345 0E-13 -> 1.123456789012345
-ddadd71474 add 1.123456789012345 0E-14 -> 1.123456789012345
-ddadd71475 add 1.123456789012345 0E-15 -> 1.123456789012345
--- next four flag Rounded because the 0 extends the result
-ddadd71476 add 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
-ddadd71477 add 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
-ddadd71478 add 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
-ddadd71479 add 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-ddadd71500 add 0 0E-19 -> 0E-19
-ddadd71501 add -0 0E-19 -> 0E-19
-ddadd71502 add 0 -0E-19 -> 0E-19
-ddadd71503 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71511 add -11 11 -> 0
-ddadd71512 add 11 -11 -> 0
-
-rounding: half_down
--- exact zeros from zeros
-ddadd71520 add 0 0E-19 -> 0E-19
-ddadd71521 add -0 0E-19 -> 0E-19
-ddadd71522 add 0 -0E-19 -> 0E-19
-ddadd71523 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71531 add -11 11 -> 0
-ddadd71532 add 11 -11 -> 0
-
-rounding: half_even
--- exact zeros from zeros
-ddadd71540 add 0 0E-19 -> 0E-19
-ddadd71541 add -0 0E-19 -> 0E-19
-ddadd71542 add 0 -0E-19 -> 0E-19
-ddadd71543 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71551 add -11 11 -> 0
-ddadd71552 add 11 -11 -> 0
-
-rounding: up
--- exact zeros from zeros
-ddadd71560 add 0 0E-19 -> 0E-19
-ddadd71561 add -0 0E-19 -> 0E-19
-ddadd71562 add 0 -0E-19 -> 0E-19
-ddadd71563 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71571 add -11 11 -> 0
-ddadd71572 add 11 -11 -> 0
-
-rounding: down
--- exact zeros from zeros
-ddadd71580 add 0 0E-19 -> 0E-19
-ddadd71581 add -0 0E-19 -> 0E-19
-ddadd71582 add 0 -0E-19 -> 0E-19
-ddadd71583 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71591 add -11 11 -> 0
-ddadd71592 add 11 -11 -> 0
-
-rounding: ceiling
--- exact zeros from zeros
-ddadd71600 add 0 0E-19 -> 0E-19
-ddadd71601 add -0 0E-19 -> 0E-19
-ddadd71602 add 0 -0E-19 -> 0E-19
-ddadd71603 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71611 add -11 11 -> 0
-ddadd71612 add 11 -11 -> 0
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-ddadd71620 add 0 0E-19 -> 0E-19
-ddadd71621 add -0 0E-19 -> -0E-19 -- *
-ddadd71622 add 0 -0E-19 -> -0E-19 -- *
-ddadd71623 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71631 add -11 11 -> -0 -- *
-ddadd71632 add 11 -11 -> -0 -- *
-
--- Examples from SQL proposal (Krishna Kulkarni)
-ddadd71701 add 130E-2 120E-2 -> 2.50
-ddadd71702 add 130E-2 12E-1 -> 2.50
-ddadd71703 add 130E-2 1E0 -> 2.30
-ddadd71704 add 1E2 1E4 -> 1.01E+4
-ddadd71705 add 130E-2 -120E-2 -> 0.10
-ddadd71706 add 130E-2 -12E-1 -> 0.10
-ddadd71707 add 130E-2 -1E0 -> 0.30
-ddadd71708 add 1E2 -1E4 -> -9.9E+3
-
--- query from Vincent Kulandaisamy
-rounding: ceiling
-ddadd71801 add 7.8822773805862E+277 -5.1757503820663E-21 -> 7.882277380586200E+277 Inexact Rounded
-ddadd71802 add 7.882277380586200E+277 12.341 -> 7.882277380586201E+277 Inexact Rounded
-ddadd71803 add 7.882277380586201E+277 2.7270545046613E-31 -> 7.882277380586202E+277 Inexact Rounded
-
-ddadd71811 add 12.341 -5.1757503820663E-21 -> 12.34100000000000 Inexact Rounded
-ddadd71812 add 12.34100000000000 2.7270545046613E-31 -> 12.34100000000001 Inexact Rounded
-ddadd71813 add 12.34100000000001 7.8822773805862E+277 -> 7.882277380586201E+277 Inexact Rounded
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-ddadd75001 add 1234567890123456 1 -> 1234567890123457
-ddadd75002 add 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
-ddadd75003 add 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
-ddadd75004 add 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
-ddadd75005 add 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
-ddadd75006 add 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
-ddadd75007 add 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
-ddadd75008 add 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
-ddadd75009 add 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
-ddadd75010 add 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
-ddadd75011 add 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
-ddadd75012 add 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
-ddadd75013 add 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
-ddadd75014 add 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
-ddadd75015 add 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
-ddadd75016 add 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
-ddadd75017 add 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
-ddadd75018 add 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
-ddadd75019 add 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
-ddadd75020 add 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
-ddadd75021 add 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
-
--- widening second argument at gap
-ddadd75030 add 12345678 1 -> 12345679
-ddadd75031 add 12345678 0.1 -> 12345678.1
-ddadd75032 add 12345678 0.12 -> 12345678.12
-ddadd75033 add 12345678 0.123 -> 12345678.123
-ddadd75034 add 12345678 0.1234 -> 12345678.1234
-ddadd75035 add 12345678 0.12345 -> 12345678.12345
-ddadd75036 add 12345678 0.123456 -> 12345678.123456
-ddadd75037 add 12345678 0.1234567 -> 12345678.1234567
-ddadd75038 add 12345678 0.12345678 -> 12345678.12345678
-ddadd75039 add 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
-ddadd75040 add 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
-ddadd75041 add 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
-ddadd75042 add 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
-ddadd75043 add 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
-ddadd75044 add 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
-ddadd75045 add 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
-ddadd75046 add 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
-ddadd75047 add 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
-ddadd75048 add 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
-ddadd75049 add 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-ddadd75050 add 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
-ddadd75051 add 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
-ddadd75052 add 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
-ddadd75053 add 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
-ddadd75054 add 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
-ddadd75055 add 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
-ddadd75056 add 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
-ddadd75057 add 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
-ddadd75060 add 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
-ddadd75061 add 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
-ddadd75062 add 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
-ddadd75063 add 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
-ddadd75064 add 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
-ddadd75065 add 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
-ddadd75066 add 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
-ddadd75067 add 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-ddadd75070 add 12345678 1E-8 -> 12345678.00000001
-ddadd75071 add 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
-ddadd75072 add 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
-ddadd75073 add 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
-ddadd75074 add 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
-ddadd75075 add 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
-ddadd75076 add 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
-ddadd75077 add 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
-ddadd75078 add 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
-ddadd75079 add 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
-ddadd75080 add 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
-ddadd75081 add 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
-ddadd75082 add 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
-ddadd75083 add 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
-ddadd75084 add 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
-ddadd75085 add 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
-ddadd75086 add 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
-ddadd75087 add 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
-ddadd75088 add 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
-ddadd75089 add 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
-
--- Punit's
-ddadd75100 add 1.000 -200.000 -> -199.000
-
--- Rounding swathe
-rounding: half_even
-ddadd81100 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81101 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81102 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81103 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81104 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81105 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81106 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81107 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81108 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81109 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81120 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81121 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: half_up
-ddadd81200 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81201 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81202 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81203 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81204 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81205 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81206 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81207 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81208 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81209 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81220 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81221 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: half_down
-ddadd81300 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81301 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81302 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81303 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81304 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81305 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81306 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81307 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81308 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81309 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81320 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81321 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: up
-ddadd81400 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81401 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81402 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81403 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81404 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81405 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81406 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81407 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81408 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81409 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81411 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
-ddadd81420 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81421 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: down
-ddadd81500 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81501 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81502 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81503 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81504 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81505 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81506 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81507 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81508 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81509 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81511 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded
-ddadd81520 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddadd81521 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
-
-rounding: ceiling
-ddadd81600 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81601 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81602 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81603 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81604 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81605 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81606 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81607 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81608 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81609 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81611 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded
-ddadd81620 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81621 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
-
-rounding: floor
-ddadd81700 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81701 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81702 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81703 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81704 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81705 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81706 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81707 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81708 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81709 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81711 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
-ddadd81720 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddadd81721 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: 05up
-ddadd81800 add .2000 12345678901234.00 -> 12345678901234.20 Rounded
-ddadd81801 add .2001 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81802 add .2010 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81803 add .2050 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81804 add .2051 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81807 add .2060 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81808 add .2070 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81809 add .2099 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81811 add -.2099 -12345678901234.00 -> -12345678901234.21 Inexact Rounded
-ddadd81820 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddadd81821 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
-
-ddadd81900 add .2100 12345678901234.00 -> 12345678901234.21 Rounded
-ddadd81901 add .2101 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81902 add .2110 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81903 add .2150 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81904 add .2151 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81907 add .2160 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81908 add .2170 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81909 add .2199 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81911 add -.2199 -12345678901234.00 -> -12345678901234.21 Inexact Rounded
-
-ddadd82000 add .2400 12345678901234.00 -> 12345678901234.24 Rounded
-ddadd82001 add .2401 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82002 add .2410 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82003 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82004 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82007 add .2460 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82008 add .2470 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82009 add .2499 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82011 add -.2499 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
-
-ddadd82100 add .2500 12345678901234.00 -> 12345678901234.25 Rounded
-ddadd82101 add .2501 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82102 add .2510 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82103 add .2550 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82104 add .2551 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82107 add .2560 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82108 add .2570 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82109 add .2599 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82111 add -.2599 -12345678901234.00 -> -12345678901234.26 Inexact Rounded
-
-ddadd82200 add .2600 12345678901234.00 -> 12345678901234.26 Rounded
-ddadd82201 add .2601 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82202 add .2610 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82203 add .2650 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82204 add .2651 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82207 add .2660 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82208 add .2670 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82209 add .2699 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82211 add -.2699 -12345678901234.00 -> -12345678901234.26 Inexact Rounded
-
-ddadd82300 add .2900 12345678901234.00 -> 12345678901234.29 Rounded
-ddadd82301 add .2901 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82302 add .2910 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82303 add .2950 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82304 add .2951 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82307 add .2960 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82308 add .2970 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82309 add .2999 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82311 add -.2999 -12345678901234.00 -> -12345678901234.29 Inexact Rounded
-
--- Null tests
-ddadd9990 add 10 # -> NaN Invalid_operation
-ddadd9991 add # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddAdd.decTest -- decDouble addition --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decDoubles only; all arguments are
+-- representable in a decDouble
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+ddadd001 add 1 1 -> 2
+ddadd002 add 2 3 -> 5
+ddadd003 add '5.75' '3.3' -> 9.05
+ddadd004 add '5' '-3' -> 2
+ddadd005 add '-5' '-3' -> -8
+ddadd006 add '-7' '2.5' -> -4.5
+ddadd007 add '0.7' '0.3' -> 1.0
+ddadd008 add '1.25' '1.25' -> 2.50
+ddadd009 add '1.23456789' '1.00000000' -> '2.23456789'
+ddadd010 add '1.23456789' '1.00000011' -> '2.23456800'
+
+-- 1234567890123456 1234567890123456
+ddadd011 add '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
+ddadd012 add '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded
+ddadd013 add '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
+ddadd014 add '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded
+ddadd015 add '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded
+ddadd016 add '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
+ddadd017 add '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
+ddadd018 add '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
+ddadd019 add '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded
+ddadd020 add '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded
+
+ddadd021 add 0 1 -> 1
+ddadd022 add 1 1 -> 2
+ddadd023 add 2 1 -> 3
+ddadd024 add 3 1 -> 4
+ddadd025 add 4 1 -> 5
+ddadd026 add 5 1 -> 6
+ddadd027 add 6 1 -> 7
+ddadd028 add 7 1 -> 8
+ddadd029 add 8 1 -> 9
+ddadd030 add 9 1 -> 10
+
+-- some carrying effects
+ddadd031 add '0.9998' '0.0000' -> '0.9998'
+ddadd032 add '0.9998' '0.0001' -> '0.9999'
+ddadd033 add '0.9998' '0.0002' -> '1.0000'
+ddadd034 add '0.9998' '0.0003' -> '1.0001'
+
+ddadd035 add '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddadd036 add '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddadd037 add '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddadd038 add '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
+ddadd039 add '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
+
+-- symmetry:
+ddadd040 add '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
+ddadd041 add '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
+ddadd042 add '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
+ddadd044 add '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
+ddadd045 add '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
+
+-- same, without rounding
+ddadd046 add '10000e+9' '7' -> '10000000000007'
+ddadd047 add '10000e+9' '70' -> '10000000000070'
+ddadd048 add '10000e+9' '700' -> '10000000000700'
+ddadd049 add '10000e+9' '7000' -> '10000000007000'
+ddadd050 add '10000e+9' '70000' -> '10000000070000'
+ddadd051 add '10000e+9' '700000' -> '10000000700000'
+ddadd052 add '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+ddadd053 add '12' '7.00' -> '19.00'
+ddadd054 add '1.3' '-1.07' -> '0.23'
+ddadd055 add '1.3' '-1.30' -> '0.00'
+ddadd056 add '1.3' '-2.07' -> '-0.77'
+ddadd057 add '1E+2' '1E+4' -> '1.01E+4'
+
+-- leading zero preservation
+ddadd061 add 1 '0.0001' -> '1.0001'
+ddadd062 add 1 '0.00001' -> '1.00001'
+ddadd063 add 1 '0.000001' -> '1.000001'
+ddadd064 add 1 '0.0000001' -> '1.0000001'
+ddadd065 add 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+ddadd070 add 1 0 -> 1
+ddadd071 add 1 0. -> 1
+ddadd072 add 1 .0 -> 1.0
+ddadd073 add 1 0.0 -> 1.0
+ddadd074 add 1 0.00 -> 1.00
+ddadd075 add 0 1 -> 1
+ddadd076 add 0. 1 -> 1
+ddadd077 add .0 1 -> 1.0
+ddadd078 add 0.0 1 -> 1.0
+ddadd079 add 0.00 1 -> 1.00
+
+-- some carries
+ddadd080 add 999999998 1 -> 999999999
+ddadd081 add 999999999 1 -> 1000000000
+ddadd082 add 99999999 1 -> 100000000
+ddadd083 add 9999999 1 -> 10000000
+ddadd084 add 999999 1 -> 1000000
+ddadd085 add 99999 1 -> 100000
+ddadd086 add 9999 1 -> 10000
+ddadd087 add 999 1 -> 1000
+ddadd088 add 99 1 -> 100
+ddadd089 add 9 1 -> 10
+
+
+-- more LHS swaps
+ddadd090 add '-56267E-10' 0 -> '-0.0000056267'
+ddadd091 add '-56267E-6' 0 -> '-0.056267'
+ddadd092 add '-56267E-5' 0 -> '-0.56267'
+ddadd093 add '-56267E-4' 0 -> '-5.6267'
+ddadd094 add '-56267E-3' 0 -> '-56.267'
+ddadd095 add '-56267E-2' 0 -> '-562.67'
+ddadd096 add '-56267E-1' 0 -> '-5626.7'
+ddadd097 add '-56267E-0' 0 -> '-56267'
+ddadd098 add '-5E-10' 0 -> '-5E-10'
+ddadd099 add '-5E-7' 0 -> '-5E-7'
+ddadd100 add '-5E-6' 0 -> '-0.000005'
+ddadd101 add '-5E-5' 0 -> '-0.00005'
+ddadd102 add '-5E-4' 0 -> '-0.0005'
+ddadd103 add '-5E-1' 0 -> '-0.5'
+ddadd104 add '-5E0' 0 -> '-5'
+ddadd105 add '-5E1' 0 -> '-50'
+ddadd106 add '-5E5' 0 -> '-500000'
+ddadd107 add '-5E15' 0 -> '-5000000000000000'
+ddadd108 add '-5E16' 0 -> '-5.000000000000000E+16' Rounded
+ddadd109 add '-5E17' 0 -> '-5.000000000000000E+17' Rounded
+ddadd110 add '-5E18' 0 -> '-5.000000000000000E+18' Rounded
+ddadd111 add '-5E100' 0 -> '-5.000000000000000E+100' Rounded
+
+-- more RHS swaps
+ddadd113 add 0 '-56267E-10' -> '-0.0000056267'
+ddadd114 add 0 '-56267E-6' -> '-0.056267'
+ddadd116 add 0 '-56267E-5' -> '-0.56267'
+ddadd117 add 0 '-56267E-4' -> '-5.6267'
+ddadd119 add 0 '-56267E-3' -> '-56.267'
+ddadd120 add 0 '-56267E-2' -> '-562.67'
+ddadd121 add 0 '-56267E-1' -> '-5626.7'
+ddadd122 add 0 '-56267E-0' -> '-56267'
+ddadd123 add 0 '-5E-10' -> '-5E-10'
+ddadd124 add 0 '-5E-7' -> '-5E-7'
+ddadd125 add 0 '-5E-6' -> '-0.000005'
+ddadd126 add 0 '-5E-5' -> '-0.00005'
+ddadd127 add 0 '-5E-4' -> '-0.0005'
+ddadd128 add 0 '-5E-1' -> '-0.5'
+ddadd129 add 0 '-5E0' -> '-5'
+ddadd130 add 0 '-5E1' -> '-50'
+ddadd131 add 0 '-5E5' -> '-500000'
+ddadd132 add 0 '-5E15' -> '-5000000000000000'
+ddadd133 add 0 '-5E16' -> '-5.000000000000000E+16' Rounded
+ddadd134 add 0 '-5E17' -> '-5.000000000000000E+17' Rounded
+ddadd135 add 0 '-5E18' -> '-5.000000000000000E+18' Rounded
+ddadd136 add 0 '-5E100' -> '-5.000000000000000E+100' Rounded
+
+-- related
+ddadd137 add 1 '0E-19' -> '1.000000000000000' Rounded
+ddadd138 add -1 '0E-19' -> '-1.000000000000000' Rounded
+ddadd139 add '0E-19' 1 -> '1.000000000000000' Rounded
+ddadd140 add '0E-19' -1 -> '-1.000000000000000' Rounded
+ddadd141 add 1E+11 0.0000 -> '100000000000.0000'
+ddadd142 add 1E+11 0.00000 -> '100000000000.0000' Rounded
+ddadd143 add 0.000 1E+12 -> '1000000000000.000'
+ddadd144 add 0.0000 1E+12 -> '1000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+ddadd146 add '00.0' 0 -> '0.0'
+ddadd147 add '0.00' 0 -> '0.00'
+ddadd148 add 0 '0.00' -> '0.00'
+ddadd149 add 0 '00.0' -> '0.0'
+ddadd150 add '00.0' '0.00' -> '0.00'
+ddadd151 add '0.00' '00.0' -> '0.00'
+ddadd152 add '3' '.3' -> '3.3'
+ddadd153 add '3.' '.3' -> '3.3'
+ddadd154 add '3.0' '.3' -> '3.3'
+ddadd155 add '3.00' '.3' -> '3.30'
+ddadd156 add '3' '3' -> '6'
+ddadd157 add '3' '+3' -> '6'
+ddadd158 add '3' '-3' -> '0'
+ddadd159 add '0.3' '-0.3' -> '0.0'
+ddadd160 add '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+ddadd161 add '1E+12' '-1' -> '999999999999'
+ddadd162 add '1E+12' '1.11' -> '1000000000001.11'
+ddadd163 add '1.11' '1E+12' -> '1000000000001.11'
+ddadd164 add '-1' '1E+12' -> '999999999999'
+ddadd165 add '7E+12' '-1' -> '6999999999999'
+ddadd166 add '7E+12' '1.11' -> '7000000000001.11'
+ddadd167 add '1.11' '7E+12' -> '7000000000001.11'
+ddadd168 add '-1' '7E+12' -> '6999999999999'
+
+rounding: half_up
+-- 1.234567890123456 1234567890123456 1 234567890123456
+ddadd170 add '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
+ddadd171 add '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
+ddadd172 add '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
+ddadd173 add '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
+ddadd174 add '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
+ddadd175 add '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
+ddadd176 add '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
+ddadd177 add '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded
+ddadd178 add '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
+ddadd179 add '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
+ddadd180 add '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
+ddadd181 add '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
+ddadd182 add '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
+ddadd183 add '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+ddadd200 add '1234560123456789' 0 -> '1234560123456789'
+ddadd201 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddadd202 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddadd203 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddadd204 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddadd205 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddadd206 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddadd207 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddadd208 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
+ddadd209 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
+ddadd210 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
+ddadd211 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
+ddadd212 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
+ddadd213 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
+ddadd214 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
+ddadd215 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
+ddadd216 add '1234560123456789' 1 -> '1234560123456790'
+ddadd217 add '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded
+ddadd218 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddadd219 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+
+rounding: half_even
+ddadd220 add '1234560123456789' 0 -> '1234560123456789'
+ddadd221 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddadd222 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddadd223 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddadd224 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddadd225 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddadd226 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddadd227 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddadd228 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
+ddadd229 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
+ddadd230 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
+ddadd231 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
+ddadd232 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
+ddadd233 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
+ddadd234 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
+ddadd235 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
+ddadd236 add '1234560123456789' 1 -> '1234560123456790'
+ddadd237 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
+ddadd238 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddadd239 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+-- critical few with even bottom digit...
+ddadd240 add '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded
+ddadd241 add '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded
+ddadd242 add '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded
+
+rounding: down
+ddadd250 add '1234560123456789' 0 -> '1234560123456789'
+ddadd251 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddadd252 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddadd253 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddadd254 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddadd255 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddadd256 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddadd257 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddadd258 add '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded
+ddadd259 add '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded
+ddadd260 add '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded
+ddadd261 add '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded
+ddadd262 add '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded
+ddadd263 add '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded
+ddadd264 add '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded
+ddadd265 add '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded
+ddadd266 add '1234560123456789' 1 -> '1234560123456790'
+ddadd267 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
+ddadd268 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddadd269 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+ddadd301 add -1 1 -> 0
+ddadd302 add 0 1 -> 1
+ddadd303 add 1 1 -> 2
+ddadd304 add 12 1 -> 13
+ddadd305 add 98 1 -> 99
+ddadd306 add 99 1 -> 100
+ddadd307 add 100 1 -> 101
+ddadd308 add 101 1 -> 102
+ddadd309 add -1 -1 -> -2
+ddadd310 add 0 -1 -> -1
+ddadd311 add 1 -1 -> 0
+ddadd312 add 12 -1 -> 11
+ddadd313 add 98 -1 -> 97
+ddadd314 add 99 -1 -> 98
+ddadd315 add 100 -1 -> 99
+ddadd316 add 101 -1 -> 100
+
+ddadd321 add -0.01 0.01 -> 0.00
+ddadd322 add 0.00 0.01 -> 0.01
+ddadd323 add 0.01 0.01 -> 0.02
+ddadd324 add 0.12 0.01 -> 0.13
+ddadd325 add 0.98 0.01 -> 0.99
+ddadd326 add 0.99 0.01 -> 1.00
+ddadd327 add 1.00 0.01 -> 1.01
+ddadd328 add 1.01 0.01 -> 1.02
+ddadd329 add -0.01 -0.01 -> -0.02
+ddadd330 add 0.00 -0.01 -> -0.01
+ddadd331 add 0.01 -0.01 -> 0.00
+ddadd332 add 0.12 -0.01 -> 0.11
+ddadd333 add 0.98 -0.01 -> 0.97
+ddadd334 add 0.99 -0.01 -> 0.98
+ddadd335 add 1.00 -0.01 -> 0.99
+ddadd336 add 1.01 -0.01 -> 1.00
+
+-- some more cases where adding 0 affects the coefficient
+ddadd340 add 1E+3 0 -> 1000
+ddadd341 add 1E+15 0 -> 1000000000000000
+ddadd342 add 1E+16 0 -> 1.000000000000000E+16 Rounded
+ddadd343 add 1E+20 0 -> 1.000000000000000E+20 Rounded
+-- which simply follow from these cases ...
+ddadd344 add 1E+3 1 -> 1001
+ddadd345 add 1E+15 1 -> 1000000000000001
+ddadd346 add 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
+ddadd347 add 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded
+ddadd348 add 1E+3 7 -> 1007
+ddadd349 add 1E+15 7 -> 1000000000000007
+ddadd350 add 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
+ddadd351 add 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded
+
+-- tryzeros cases
+rounding: half_up
+ddadd360 add 0E+50 10000E+1 -> 1.0000E+5
+ddadd361 add 0E-50 10000E+1 -> 100000.0000000000 Rounded
+ddadd362 add 10000E+1 0E-50 -> 100000.0000000000 Rounded
+ddadd363 add 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
+ddadd364 add 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+ddadd370 add 999999999999999 815 -> 1000000000000814
+ddadd371 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+rounding: half_up
+ddadd372 add 999999999999999 815 -> 1000000000000814
+ddadd373 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+rounding: half_even
+ddadd374 add 999999999999999 815 -> 1000000000000814
+ddadd375 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+
+-- operands folded
+ddadd380 add 1E+384 1E+384 -> 2.000000000000000E+384 Clamped
+ddadd381 add 1E+380 1E+380 -> 2.00000000000E+380 Clamped
+ddadd382 add 1E+376 1E+376 -> 2.0000000E+376 Clamped
+ddadd383 add 1E+372 1E+372 -> 2.000E+372 Clamped
+ddadd384 add 1E+370 1E+370 -> 2.0E+370 Clamped
+ddadd385 add 1E+369 1E+369 -> 2E+369
+ddadd386 add 1E+368 1E+368 -> 2E+368
+
+-- ulp replacement tests
+ddadd400 add 1 77e-14 -> 1.00000000000077
+ddadd401 add 1 77e-15 -> 1.000000000000077
+ddadd402 add 1 77e-16 -> 1.000000000000008 Inexact Rounded
+ddadd403 add 1 77e-17 -> 1.000000000000001 Inexact Rounded
+ddadd404 add 1 77e-18 -> 1.000000000000000 Inexact Rounded
+ddadd405 add 1 77e-19 -> 1.000000000000000 Inexact Rounded
+ddadd406 add 1 77e-299 -> 1.000000000000000 Inexact Rounded
+
+ddadd410 add 10 77e-14 -> 10.00000000000077
+ddadd411 add 10 77e-15 -> 10.00000000000008 Inexact Rounded
+ddadd412 add 10 77e-16 -> 10.00000000000001 Inexact Rounded
+ddadd413 add 10 77e-17 -> 10.00000000000000 Inexact Rounded
+ddadd414 add 10 77e-18 -> 10.00000000000000 Inexact Rounded
+ddadd415 add 10 77e-19 -> 10.00000000000000 Inexact Rounded
+ddadd416 add 10 77e-299 -> 10.00000000000000 Inexact Rounded
+
+ddadd420 add 77e-14 1 -> 1.00000000000077
+ddadd421 add 77e-15 1 -> 1.000000000000077
+ddadd422 add 77e-16 1 -> 1.000000000000008 Inexact Rounded
+ddadd423 add 77e-17 1 -> 1.000000000000001 Inexact Rounded
+ddadd424 add 77e-18 1 -> 1.000000000000000 Inexact Rounded
+ddadd425 add 77e-19 1 -> 1.000000000000000 Inexact Rounded
+ddadd426 add 77e-299 1 -> 1.000000000000000 Inexact Rounded
+
+ddadd430 add 77e-14 10 -> 10.00000000000077
+ddadd431 add 77e-15 10 -> 10.00000000000008 Inexact Rounded
+ddadd432 add 77e-16 10 -> 10.00000000000001 Inexact Rounded
+ddadd433 add 77e-17 10 -> 10.00000000000000 Inexact Rounded
+ddadd434 add 77e-18 10 -> 10.00000000000000 Inexact Rounded
+ddadd435 add 77e-19 10 -> 10.00000000000000 Inexact Rounded
+ddadd436 add 77e-299 10 -> 10.00000000000000 Inexact Rounded
+
+-- fastpath boundary (more in dqadd)
+-- 1234567890123456
+ddadd539 add '4444444444444444' '3333333333333333' -> '7777777777777777'
+ddadd540 add '4444444444444444' '4444444444444444' -> '8888888888888888'
+ddadd541 add '4444444444444444' '5555555555555555' -> '9999999999999999'
+ddadd542 add '3333333333333333' '4444444444444444' -> '7777777777777777'
+ddadd543 add '4444444444444444' '4444444444444444' -> '8888888888888888'
+ddadd544 add '5555555555555555' '4444444444444444' -> '9999999999999999'
+ddadd545 add '3000004000000000' '3000000000000040' -> '6000004000000040'
+ddadd546 add '3000000400000000' '4000000000000400' -> '7000000400000400'
+ddadd547 add '3000000040000000' '5000000000004000' -> '8000000040004000'
+ddadd548 add '4000000004000000' '3000000000040000' -> '7000000004040000'
+ddadd549 add '4000000000400000' '4000000000400000' -> '8000000000800000'
+ddadd550 add '4000000000040000' '5000000004000000' -> '9000000004040000'
+ddadd551 add '5000000000004000' '3000000040000000' -> '8000000040004000'
+ddadd552 add '5000000000000400' '4000000400000000' -> '9000000400000400'
+ddadd553 add '5000000000000040' '5000004000000000' -> 1.000000400000004E+16 Rounded
+-- check propagation
+ddadd554 add '8999999999999999' '0000000000000001' -> 9000000000000000
+ddadd555 add '0000000000000001' '8999999999999999' -> 9000000000000000
+ddadd556 add '0999999999999999' '0000000000000001' -> 1000000000000000
+ddadd557 add '0000000000000001' '0999999999999999' -> 1000000000000000
+ddadd558 add '4444444444444444' '4555555555555556' -> 9000000000000000
+ddadd559 add '4555555555555556' '4444444444444444' -> 9000000000000000
+
+-- negative ulps
+ddadd6440 add 1 -77e-14 -> 0.99999999999923
+ddadd6441 add 1 -77e-15 -> 0.999999999999923
+ddadd6442 add 1 -77e-16 -> 0.9999999999999923
+ddadd6443 add 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
+ddadd6444 add 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
+ddadd6445 add 1 -77e-19 -> 1.000000000000000 Inexact Rounded
+ddadd6446 add 1 -77e-99 -> 1.000000000000000 Inexact Rounded
+
+ddadd6450 add 10 -77e-14 -> 9.99999999999923
+ddadd6451 add 10 -77e-15 -> 9.999999999999923
+ddadd6452 add 10 -77e-16 -> 9.999999999999992 Inexact Rounded
+ddadd6453 add 10 -77e-17 -> 9.999999999999999 Inexact Rounded
+ddadd6454 add 10 -77e-18 -> 10.00000000000000 Inexact Rounded
+ddadd6455 add 10 -77e-19 -> 10.00000000000000 Inexact Rounded
+ddadd6456 add 10 -77e-99 -> 10.00000000000000 Inexact Rounded
+
+ddadd6460 add -77e-14 1 -> 0.99999999999923
+ddadd6461 add -77e-15 1 -> 0.999999999999923
+ddadd6462 add -77e-16 1 -> 0.9999999999999923
+ddadd6463 add -77e-17 1 -> 0.9999999999999992 Inexact Rounded
+ddadd6464 add -77e-18 1 -> 0.9999999999999999 Inexact Rounded
+ddadd6465 add -77e-19 1 -> 1.000000000000000 Inexact Rounded
+ddadd6466 add -77e-99 1 -> 1.000000000000000 Inexact Rounded
+
+ddadd6470 add -77e-14 10 -> 9.99999999999923
+ddadd6471 add -77e-15 10 -> 9.999999999999923
+ddadd6472 add -77e-16 10 -> 9.999999999999992 Inexact Rounded
+ddadd6473 add -77e-17 10 -> 9.999999999999999 Inexact Rounded
+ddadd6474 add -77e-18 10 -> 10.00000000000000 Inexact Rounded
+ddadd6475 add -77e-19 10 -> 10.00000000000000 Inexact Rounded
+ddadd6476 add -77e-99 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+ddadd6480 add -1 77e-14 -> -0.99999999999923
+ddadd6481 add -1 77e-15 -> -0.999999999999923
+ddadd6482 add -1 77e-16 -> -0.9999999999999923
+ddadd6483 add -1 77e-17 -> -0.9999999999999992 Inexact Rounded
+ddadd6484 add -1 77e-18 -> -0.9999999999999999 Inexact Rounded
+ddadd6485 add -1 77e-19 -> -1.000000000000000 Inexact Rounded
+ddadd6486 add -1 77e-99 -> -1.000000000000000 Inexact Rounded
+
+ddadd6490 add -10 77e-14 -> -9.99999999999923
+ddadd6491 add -10 77e-15 -> -9.999999999999923
+ddadd6492 add -10 77e-16 -> -9.999999999999992 Inexact Rounded
+ddadd6493 add -10 77e-17 -> -9.999999999999999 Inexact Rounded
+ddadd6494 add -10 77e-18 -> -10.00000000000000 Inexact Rounded
+ddadd6495 add -10 77e-19 -> -10.00000000000000 Inexact Rounded
+ddadd6496 add -10 77e-99 -> -10.00000000000000 Inexact Rounded
+
+ddadd6500 add 77e-14 -1 -> -0.99999999999923
+ddadd6501 add 77e-15 -1 -> -0.999999999999923
+ddadd6502 add 77e-16 -1 -> -0.9999999999999923
+ddadd6503 add 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
+ddadd6504 add 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
+ddadd6505 add 77e-19 -1 -> -1.000000000000000 Inexact Rounded
+ddadd6506 add 77e-99 -1 -> -1.000000000000000 Inexact Rounded
+
+ddadd6510 add 77e-14 -10 -> -9.99999999999923
+ddadd6511 add 77e-15 -10 -> -9.999999999999923
+ddadd6512 add 77e-16 -10 -> -9.999999999999992 Inexact Rounded
+ddadd6513 add 77e-17 -10 -> -9.999999999999999 Inexact Rounded
+ddadd6514 add 77e-18 -10 -> -10.00000000000000 Inexact Rounded
+ddadd6515 add 77e-19 -10 -> -10.00000000000000 Inexact Rounded
+ddadd6516 add 77e-99 -10 -> -10.00000000000000 Inexact Rounded
+
+-- and some more residue effects and different roundings
+rounding: half_up
+ddadd6540 add '6543210123456789' 0 -> '6543210123456789'
+ddadd6541 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddadd6542 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddadd6543 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddadd6544 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddadd6545 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddadd6546 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddadd6547 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddadd6548 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+ddadd6549 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+ddadd6550 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+ddadd6551 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+ddadd6552 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+ddadd6553 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+ddadd6554 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+ddadd6555 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
+ddadd6556 add '6543210123456789' 1 -> '6543210123456790'
+ddadd6557 add '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
+ddadd6558 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddadd6559 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+rounding: half_even
+ddadd6560 add '6543210123456789' 0 -> '6543210123456789'
+ddadd6561 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddadd6562 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddadd6563 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddadd6564 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddadd6565 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddadd6566 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddadd6567 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddadd6568 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+ddadd6569 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+ddadd6570 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+ddadd6571 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+ddadd6572 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+ddadd6573 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+ddadd6574 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+ddadd6575 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
+ddadd6576 add '6543210123456789' 1 -> '6543210123456790'
+ddadd6577 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+ddadd6578 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddadd6579 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+-- critical few with even bottom digit...
+ddadd7540 add '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded
+ddadd7541 add '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
+ddadd7542 add '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
+
+rounding: down
+ddadd7550 add '6543210123456789' 0 -> '6543210123456789'
+ddadd7551 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddadd7552 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddadd7553 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddadd7554 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddadd7555 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddadd7556 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddadd7557 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddadd7558 add '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
+ddadd7559 add '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
+ddadd7560 add '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
+ddadd7561 add '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
+ddadd7562 add '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
+ddadd7563 add '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
+ddadd7564 add '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
+ddadd7565 add '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded
+ddadd7566 add '6543210123456789' 1 -> '6543210123456790'
+ddadd7567 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+ddadd7568 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddadd7569 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+-- verify a query
+rounding: down
+ddadd7661 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
+ddadd7662 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
+ddadd7663 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
+ddadd7664 add 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+ddadd7701 add 5.00 1.00E-3 -> 5.00100
+ddadd7702 add 00.00 0.000 -> 0.000
+ddadd7703 add 00.00 0E-3 -> 0.000
+ddadd7704 add 0E-3 00.00 -> 0.000
+
+ddadd7710 add 0E+3 00.00 -> 0.00
+ddadd7711 add 0E+3 00.0 -> 0.0
+ddadd7712 add 0E+3 00. -> 0
+ddadd7713 add 0E+3 00.E+1 -> 0E+1
+ddadd7714 add 0E+3 00.E+2 -> 0E+2
+ddadd7715 add 0E+3 00.E+3 -> 0E+3
+ddadd7716 add 0E+3 00.E+4 -> 0E+3
+ddadd7717 add 0E+3 00.E+5 -> 0E+3
+ddadd7718 add 0E+3 -00.0 -> 0.0
+ddadd7719 add 0E+3 -00. -> 0
+ddadd7731 add 0E+3 -00.E+1 -> 0E+1
+
+ddadd7720 add 00.00 0E+3 -> 0.00
+ddadd7721 add 00.0 0E+3 -> 0.0
+ddadd7722 add 00. 0E+3 -> 0
+ddadd7723 add 00.E+1 0E+3 -> 0E+1
+ddadd7724 add 00.E+2 0E+3 -> 0E+2
+ddadd7725 add 00.E+3 0E+3 -> 0E+3
+ddadd7726 add 00.E+4 0E+3 -> 0E+3
+ddadd7727 add 00.E+5 0E+3 -> 0E+3
+ddadd7728 add -00.00 0E+3 -> 0.00
+ddadd7729 add -00.0 0E+3 -> 0.0
+ddadd7730 add -00. 0E+3 -> 0
+
+ddadd7732 add 0 0 -> 0
+ddadd7733 add 0 -0 -> 0
+ddadd7734 add -0 0 -> 0
+ddadd7735 add -0 -0 -> -0 -- IEEE 854 special case
+
+ddadd7736 add 1 -1 -> 0
+ddadd7737 add -1 -1 -> -2
+ddadd7738 add 1 1 -> 2
+ddadd7739 add -1 1 -> 0
+
+ddadd7741 add 0 -1 -> -1
+ddadd7742 add -0 -1 -> -1
+ddadd7743 add 0 1 -> 1
+ddadd7744 add -0 1 -> 1
+ddadd7745 add -1 0 -> -1
+ddadd7746 add -1 -0 -> -1
+ddadd7747 add 1 0 -> 1
+ddadd7748 add 1 -0 -> 1
+
+ddadd7751 add 0.0 -1 -> -1.0
+ddadd7752 add -0.0 -1 -> -1.0
+ddadd7753 add 0.0 1 -> 1.0
+ddadd7754 add -0.0 1 -> 1.0
+ddadd7755 add -1.0 0 -> -1.0
+ddadd7756 add -1.0 -0 -> -1.0
+ddadd7757 add 1.0 0 -> 1.0
+ddadd7758 add 1.0 -0 -> 1.0
+
+ddadd7761 add 0 -1.0 -> -1.0
+ddadd7762 add -0 -1.0 -> -1.0
+ddadd7763 add 0 1.0 -> 1.0
+ddadd7764 add -0 1.0 -> 1.0
+ddadd7765 add -1 0.0 -> -1.0
+ddadd7766 add -1 -0.0 -> -1.0
+ddadd7767 add 1 0.0 -> 1.0
+ddadd7768 add 1 -0.0 -> 1.0
+
+ddadd7771 add 0.0 -1.0 -> -1.0
+ddadd7772 add -0.0 -1.0 -> -1.0
+ddadd7773 add 0.0 1.0 -> 1.0
+ddadd7774 add -0.0 1.0 -> 1.0
+ddadd7775 add -1.0 0.0 -> -1.0
+ddadd7776 add -1.0 -0.0 -> -1.0
+ddadd7777 add 1.0 0.0 -> 1.0
+ddadd7778 add 1.0 -0.0 -> 1.0
+
+-- Specials
+ddadd7780 add -Inf -Inf -> -Infinity
+ddadd7781 add -Inf -1000 -> -Infinity
+ddadd7782 add -Inf -1 -> -Infinity
+ddadd7783 add -Inf -0 -> -Infinity
+ddadd7784 add -Inf 0 -> -Infinity
+ddadd7785 add -Inf 1 -> -Infinity
+ddadd7786 add -Inf 1000 -> -Infinity
+ddadd7787 add -1000 -Inf -> -Infinity
+ddadd7788 add -Inf -Inf -> -Infinity
+ddadd7789 add -1 -Inf -> -Infinity
+ddadd7790 add -0 -Inf -> -Infinity
+ddadd7791 add 0 -Inf -> -Infinity
+ddadd7792 add 1 -Inf -> -Infinity
+ddadd7793 add 1000 -Inf -> -Infinity
+ddadd7794 add Inf -Inf -> NaN Invalid_operation
+
+ddadd7800 add Inf -Inf -> NaN Invalid_operation
+ddadd7801 add Inf -1000 -> Infinity
+ddadd7802 add Inf -1 -> Infinity
+ddadd7803 add Inf -0 -> Infinity
+ddadd7804 add Inf 0 -> Infinity
+ddadd7805 add Inf 1 -> Infinity
+ddadd7806 add Inf 1000 -> Infinity
+ddadd7807 add Inf Inf -> Infinity
+ddadd7808 add -1000 Inf -> Infinity
+ddadd7809 add -Inf Inf -> NaN Invalid_operation
+ddadd7810 add -1 Inf -> Infinity
+ddadd7811 add -0 Inf -> Infinity
+ddadd7812 add 0 Inf -> Infinity
+ddadd7813 add 1 Inf -> Infinity
+ddadd7814 add 1000 Inf -> Infinity
+ddadd7815 add Inf Inf -> Infinity
+
+ddadd7821 add NaN -Inf -> NaN
+ddadd7822 add NaN -1000 -> NaN
+ddadd7823 add NaN -1 -> NaN
+ddadd7824 add NaN -0 -> NaN
+ddadd7825 add NaN 0 -> NaN
+ddadd7826 add NaN 1 -> NaN
+ddadd7827 add NaN 1000 -> NaN
+ddadd7828 add NaN Inf -> NaN
+ddadd7829 add NaN NaN -> NaN
+ddadd7830 add -Inf NaN -> NaN
+ddadd7831 add -1000 NaN -> NaN
+ddadd7832 add -1 NaN -> NaN
+ddadd7833 add -0 NaN -> NaN
+ddadd7834 add 0 NaN -> NaN
+ddadd7835 add 1 NaN -> NaN
+ddadd7836 add 1000 NaN -> NaN
+ddadd7837 add Inf NaN -> NaN
+
+ddadd7841 add sNaN -Inf -> NaN Invalid_operation
+ddadd7842 add sNaN -1000 -> NaN Invalid_operation
+ddadd7843 add sNaN -1 -> NaN Invalid_operation
+ddadd7844 add sNaN -0 -> NaN Invalid_operation
+ddadd7845 add sNaN 0 -> NaN Invalid_operation
+ddadd7846 add sNaN 1 -> NaN Invalid_operation
+ddadd7847 add sNaN 1000 -> NaN Invalid_operation
+ddadd7848 add sNaN NaN -> NaN Invalid_operation
+ddadd7849 add sNaN sNaN -> NaN Invalid_operation
+ddadd7850 add NaN sNaN -> NaN Invalid_operation
+ddadd7851 add -Inf sNaN -> NaN Invalid_operation
+ddadd7852 add -1000 sNaN -> NaN Invalid_operation
+ddadd7853 add -1 sNaN -> NaN Invalid_operation
+ddadd7854 add -0 sNaN -> NaN Invalid_operation
+ddadd7855 add 0 sNaN -> NaN Invalid_operation
+ddadd7856 add 1 sNaN -> NaN Invalid_operation
+ddadd7857 add 1000 sNaN -> NaN Invalid_operation
+ddadd7858 add Inf sNaN -> NaN Invalid_operation
+ddadd7859 add NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddadd7861 add NaN1 -Inf -> NaN1
+ddadd7862 add +NaN2 -1000 -> NaN2
+ddadd7863 add NaN3 1000 -> NaN3
+ddadd7864 add NaN4 Inf -> NaN4
+ddadd7865 add NaN5 +NaN6 -> NaN5
+ddadd7866 add -Inf NaN7 -> NaN7
+ddadd7867 add -1000 NaN8 -> NaN8
+ddadd7868 add 1000 NaN9 -> NaN9
+ddadd7869 add Inf +NaN10 -> NaN10
+ddadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation
+ddadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation
+ddadd7873 add sNaN13 1000 -> NaN13 Invalid_operation
+ddadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation
+ddadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation
+ddadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation
+ddadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation
+ddadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation
+ddadd7880 add Inf sNaN23 -> NaN23 Invalid_operation
+ddadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddadd7882 add -NaN26 NaN28 -> -NaN26
+ddadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddadd7884 add 1000 -NaN30 -> -NaN30
+ddadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Here we explore near the boundary of rounding a subnormal to Nmin
+ddadd7575 add 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal
+ddadd7576 add -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal
+
+-- and another curious case
+ddadd7577 add 7.000000000000E-385 -1.00000E-391 -> 6.999999000000E-385 Subnormal
+
+-- check overflow edge case
+-- 1234567890123456
+ddadd7972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
+ddadd7973 add 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7974 add 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7975 add 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
+ddadd7976 add 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
+ddadd7977 add 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
+ddadd7978 add 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
+ddadd7979 add 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
+ddadd7980 add 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
+ddadd7981 add 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7982 add 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7983 add 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7984 add 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
+
+ddadd7985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
+ddadd7986 add -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7987 add -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7988 add -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
+ddadd7989 add -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7990 add -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7991 add -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7992 add -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7993 add -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7994 add -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7995 add -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7996 add -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7997 add -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+ddadd71100 add 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
+ddadd71101 add 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
+ddadd71103 add +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
+ddadd71104 add 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
+ddadd71105 add 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
+ddadd71106 add 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
+ddadd71107 add 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
+ddadd71108 add 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
+ddadd71109 add 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+ddadd71110 add -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
+ddadd71111 add -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
+ddadd71113 add -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
+ddadd71114 add -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
+ddadd71115 add -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
+ddadd71116 add -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
+ddadd71117 add -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
+ddadd71118 add -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
+ddadd71119 add -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+ddadd71300 add 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71310 add 1E16 -0.51 -> 9999999999999999 Inexact Rounded
+ddadd71311 add 1E16 -0.501 -> 9999999999999999 Inexact Rounded
+ddadd71312 add 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
+ddadd71313 add 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
+ddadd71314 add 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
+ddadd71315 add 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
+ddadd71316 add 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
+ddadd71317 add 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
+ddadd71318 add 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
+ddadd71319 add 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
+ddadd71320 add 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
+ddadd71321 add 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
+ddadd71322 add 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
+ddadd71323 add 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
+ddadd71324 add 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
+ddadd71325 add 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71326 add 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71327 add 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71328 add 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71329 add 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71330 add 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71331 add 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71332 add 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71333 add 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71334 add 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71335 add 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71336 add 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71337 add 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71338 add 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71339 add 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
+
+ddadd71340 add 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
+ddadd71341 add 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
+
+ddadd71349 add 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
+ddadd71350 add 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
+ddadd71351 add 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
+ddadd71352 add 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
+ddadd71353 add 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
+ddadd71354 add 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
+ddadd71355 add 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
+ddadd71356 add 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
+ddadd71357 add 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
+ddadd71358 add 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
+ddadd71359 add 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
+ddadd71360 add 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
+ddadd71361 add 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
+ddadd71362 add 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
+ddadd71363 add 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
+ddadd71364 add 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
+ddadd71365 add 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71367 add 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71368 add 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71369 add 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71370 add 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71371 add 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71372 add 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71373 add 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71374 add 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71375 add 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71376 add 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71377 add 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71378 add 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71379 add 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71380 add 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71381 add 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71382 add 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71383 add 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71384 add 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71385 add 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71386 add 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71387 add 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71388 add 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71389 add 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71390 add 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71391 add 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71392 add 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71393 add 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71394 add 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71395 add 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71396 add 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+ddadd71420 add 0 1.123456789012345 -> 1.123456789012345
+ddadd71421 add 0 1.123456789012345E-1 -> 0.1123456789012345
+ddadd71422 add 0 1.123456789012345E-2 -> 0.01123456789012345
+ddadd71423 add 0 1.123456789012345E-3 -> 0.001123456789012345
+ddadd71424 add 0 1.123456789012345E-4 -> 0.0001123456789012345
+ddadd71425 add 0 1.123456789012345E-5 -> 0.00001123456789012345
+ddadd71426 add 0 1.123456789012345E-6 -> 0.000001123456789012345
+ddadd71427 add 0 1.123456789012345E-7 -> 1.123456789012345E-7
+ddadd71428 add 0 1.123456789012345E-8 -> 1.123456789012345E-8
+ddadd71429 add 0 1.123456789012345E-9 -> 1.123456789012345E-9
+ddadd71430 add 0 1.123456789012345E-10 -> 1.123456789012345E-10
+ddadd71431 add 0 1.123456789012345E-11 -> 1.123456789012345E-11
+ddadd71432 add 0 1.123456789012345E-12 -> 1.123456789012345E-12
+ddadd71433 add 0 1.123456789012345E-13 -> 1.123456789012345E-13
+ddadd71434 add 0 1.123456789012345E-14 -> 1.123456789012345E-14
+ddadd71435 add 0 1.123456789012345E-15 -> 1.123456789012345E-15
+ddadd71436 add 0 1.123456789012345E-16 -> 1.123456789012345E-16
+ddadd71437 add 0 1.123456789012345E-17 -> 1.123456789012345E-17
+ddadd71438 add 0 1.123456789012345E-18 -> 1.123456789012345E-18
+ddadd71439 add 0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+ddadd71440 add 1.123456789012345 0 -> 1.123456789012345
+ddadd71441 add 1.123456789012345E-1 0 -> 0.1123456789012345
+ddadd71442 add 1.123456789012345E-2 0 -> 0.01123456789012345
+ddadd71443 add 1.123456789012345E-3 0 -> 0.001123456789012345
+ddadd71444 add 1.123456789012345E-4 0 -> 0.0001123456789012345
+ddadd71445 add 1.123456789012345E-5 0 -> 0.00001123456789012345
+ddadd71446 add 1.123456789012345E-6 0 -> 0.000001123456789012345
+ddadd71447 add 1.123456789012345E-7 0 -> 1.123456789012345E-7
+ddadd71448 add 1.123456789012345E-8 0 -> 1.123456789012345E-8
+ddadd71449 add 1.123456789012345E-9 0 -> 1.123456789012345E-9
+ddadd71450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10
+ddadd71451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11
+ddadd71452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12
+ddadd71453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13
+ddadd71454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14
+ddadd71455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15
+ddadd71456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16
+ddadd71457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17
+ddadd71458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18
+ddadd71459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+ddadd71460 add 1.123456789012345 0E-0 -> 1.123456789012345
+ddadd71461 add 1.123456789012345 0E-1 -> 1.123456789012345
+ddadd71462 add 1.123456789012345 0E-2 -> 1.123456789012345
+ddadd71463 add 1.123456789012345 0E-3 -> 1.123456789012345
+ddadd71464 add 1.123456789012345 0E-4 -> 1.123456789012345
+ddadd71465 add 1.123456789012345 0E-5 -> 1.123456789012345
+ddadd71466 add 1.123456789012345 0E-6 -> 1.123456789012345
+ddadd71467 add 1.123456789012345 0E-7 -> 1.123456789012345
+ddadd71468 add 1.123456789012345 0E-8 -> 1.123456789012345
+ddadd71469 add 1.123456789012345 0E-9 -> 1.123456789012345
+ddadd71470 add 1.123456789012345 0E-10 -> 1.123456789012345
+ddadd71471 add 1.123456789012345 0E-11 -> 1.123456789012345
+ddadd71472 add 1.123456789012345 0E-12 -> 1.123456789012345
+ddadd71473 add 1.123456789012345 0E-13 -> 1.123456789012345
+ddadd71474 add 1.123456789012345 0E-14 -> 1.123456789012345
+ddadd71475 add 1.123456789012345 0E-15 -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+ddadd71476 add 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
+ddadd71477 add 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
+ddadd71478 add 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
+ddadd71479 add 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+ddadd71500 add 0 0E-19 -> 0E-19
+ddadd71501 add -0 0E-19 -> 0E-19
+ddadd71502 add 0 -0E-19 -> 0E-19
+ddadd71503 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71511 add -11 11 -> 0
+ddadd71512 add 11 -11 -> 0
+
+rounding: half_down
+-- exact zeros from zeros
+ddadd71520 add 0 0E-19 -> 0E-19
+ddadd71521 add -0 0E-19 -> 0E-19
+ddadd71522 add 0 -0E-19 -> 0E-19
+ddadd71523 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71531 add -11 11 -> 0
+ddadd71532 add 11 -11 -> 0
+
+rounding: half_even
+-- exact zeros from zeros
+ddadd71540 add 0 0E-19 -> 0E-19
+ddadd71541 add -0 0E-19 -> 0E-19
+ddadd71542 add 0 -0E-19 -> 0E-19
+ddadd71543 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71551 add -11 11 -> 0
+ddadd71552 add 11 -11 -> 0
+
+rounding: up
+-- exact zeros from zeros
+ddadd71560 add 0 0E-19 -> 0E-19
+ddadd71561 add -0 0E-19 -> 0E-19
+ddadd71562 add 0 -0E-19 -> 0E-19
+ddadd71563 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71571 add -11 11 -> 0
+ddadd71572 add 11 -11 -> 0
+
+rounding: down
+-- exact zeros from zeros
+ddadd71580 add 0 0E-19 -> 0E-19
+ddadd71581 add -0 0E-19 -> 0E-19
+ddadd71582 add 0 -0E-19 -> 0E-19
+ddadd71583 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71591 add -11 11 -> 0
+ddadd71592 add 11 -11 -> 0
+
+rounding: ceiling
+-- exact zeros from zeros
+ddadd71600 add 0 0E-19 -> 0E-19
+ddadd71601 add -0 0E-19 -> 0E-19
+ddadd71602 add 0 -0E-19 -> 0E-19
+ddadd71603 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71611 add -11 11 -> 0
+ddadd71612 add 11 -11 -> 0
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+ddadd71620 add 0 0E-19 -> 0E-19
+ddadd71621 add -0 0E-19 -> -0E-19 -- *
+ddadd71622 add 0 -0E-19 -> -0E-19 -- *
+ddadd71623 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71631 add -11 11 -> -0 -- *
+ddadd71632 add 11 -11 -> -0 -- *
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+ddadd71701 add 130E-2 120E-2 -> 2.50
+ddadd71702 add 130E-2 12E-1 -> 2.50
+ddadd71703 add 130E-2 1E0 -> 2.30
+ddadd71704 add 1E2 1E4 -> 1.01E+4
+ddadd71705 add 130E-2 -120E-2 -> 0.10
+ddadd71706 add 130E-2 -12E-1 -> 0.10
+ddadd71707 add 130E-2 -1E0 -> 0.30
+ddadd71708 add 1E2 -1E4 -> -9.9E+3
+
+-- query from Vincent Kulandaisamy
+rounding: ceiling
+ddadd71801 add 7.8822773805862E+277 -5.1757503820663E-21 -> 7.882277380586200E+277 Inexact Rounded
+ddadd71802 add 7.882277380586200E+277 12.341 -> 7.882277380586201E+277 Inexact Rounded
+ddadd71803 add 7.882277380586201E+277 2.7270545046613E-31 -> 7.882277380586202E+277 Inexact Rounded
+
+ddadd71811 add 12.341 -5.1757503820663E-21 -> 12.34100000000000 Inexact Rounded
+ddadd71812 add 12.34100000000000 2.7270545046613E-31 -> 12.34100000000001 Inexact Rounded
+ddadd71813 add 12.34100000000001 7.8822773805862E+277 -> 7.882277380586201E+277 Inexact Rounded
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+ddadd75001 add 1234567890123456 1 -> 1234567890123457
+ddadd75002 add 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
+ddadd75003 add 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
+ddadd75004 add 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
+ddadd75005 add 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
+ddadd75006 add 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
+ddadd75007 add 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
+ddadd75008 add 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
+ddadd75009 add 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
+ddadd75010 add 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
+ddadd75011 add 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
+ddadd75012 add 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
+ddadd75013 add 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
+ddadd75014 add 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
+ddadd75015 add 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
+ddadd75016 add 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
+ddadd75017 add 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
+ddadd75018 add 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
+ddadd75019 add 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
+ddadd75020 add 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
+ddadd75021 add 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
+
+-- widening second argument at gap
+ddadd75030 add 12345678 1 -> 12345679
+ddadd75031 add 12345678 0.1 -> 12345678.1
+ddadd75032 add 12345678 0.12 -> 12345678.12
+ddadd75033 add 12345678 0.123 -> 12345678.123
+ddadd75034 add 12345678 0.1234 -> 12345678.1234
+ddadd75035 add 12345678 0.12345 -> 12345678.12345
+ddadd75036 add 12345678 0.123456 -> 12345678.123456
+ddadd75037 add 12345678 0.1234567 -> 12345678.1234567
+ddadd75038 add 12345678 0.12345678 -> 12345678.12345678
+ddadd75039 add 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
+ddadd75040 add 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
+ddadd75041 add 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
+ddadd75042 add 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
+ddadd75043 add 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
+ddadd75044 add 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
+ddadd75045 add 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
+ddadd75046 add 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
+ddadd75047 add 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
+ddadd75048 add 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
+ddadd75049 add 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+ddadd75050 add 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
+ddadd75051 add 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
+ddadd75052 add 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
+ddadd75053 add 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
+ddadd75054 add 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
+ddadd75055 add 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
+ddadd75056 add 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
+ddadd75057 add 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
+ddadd75060 add 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
+ddadd75061 add 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
+ddadd75062 add 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
+ddadd75063 add 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
+ddadd75064 add 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
+ddadd75065 add 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
+ddadd75066 add 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
+ddadd75067 add 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+ddadd75070 add 12345678 1E-8 -> 12345678.00000001
+ddadd75071 add 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
+ddadd75072 add 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
+ddadd75073 add 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
+ddadd75074 add 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
+ddadd75075 add 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
+ddadd75076 add 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
+ddadd75077 add 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
+ddadd75078 add 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
+ddadd75079 add 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
+ddadd75080 add 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
+ddadd75081 add 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
+ddadd75082 add 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
+ddadd75083 add 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
+ddadd75084 add 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
+ddadd75085 add 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
+ddadd75086 add 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
+ddadd75087 add 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
+ddadd75088 add 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
+ddadd75089 add 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
+
+-- Punit's
+ddadd75100 add 1.000 -200.000 -> -199.000
+
+-- Rounding swathe
+rounding: half_even
+ddadd81100 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81101 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81102 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81103 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81104 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81105 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81106 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81107 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81108 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81109 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81120 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81121 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: half_up
+ddadd81200 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81201 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81202 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81203 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81204 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81205 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81206 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81207 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81208 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81209 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81220 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81221 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: half_down
+ddadd81300 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81301 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81302 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81303 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81304 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81305 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81306 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81307 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81308 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81309 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81320 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81321 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: up
+ddadd81400 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81401 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81402 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81403 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81404 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81405 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81406 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81407 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81408 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81409 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81411 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
+ddadd81420 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81421 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: down
+ddadd81500 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81501 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81502 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81503 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81504 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81505 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81506 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81507 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81508 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81509 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81511 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded
+ddadd81520 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddadd81521 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
+
+rounding: ceiling
+ddadd81600 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81601 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81602 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81603 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81604 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81605 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81606 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81607 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81608 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81609 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81611 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded
+ddadd81620 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81621 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
+
+rounding: floor
+ddadd81700 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81701 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81702 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81703 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81704 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81705 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81706 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81707 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81708 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81709 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81711 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
+ddadd81720 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddadd81721 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: 05up
+ddadd81800 add .2000 12345678901234.00 -> 12345678901234.20 Rounded
+ddadd81801 add .2001 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81802 add .2010 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81803 add .2050 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81804 add .2051 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81807 add .2060 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81808 add .2070 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81809 add .2099 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81811 add -.2099 -12345678901234.00 -> -12345678901234.21 Inexact Rounded
+ddadd81820 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddadd81821 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
+
+ddadd81900 add .2100 12345678901234.00 -> 12345678901234.21 Rounded
+ddadd81901 add .2101 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81902 add .2110 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81903 add .2150 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81904 add .2151 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81907 add .2160 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81908 add .2170 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81909 add .2199 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81911 add -.2199 -12345678901234.00 -> -12345678901234.21 Inexact Rounded
+
+ddadd82000 add .2400 12345678901234.00 -> 12345678901234.24 Rounded
+ddadd82001 add .2401 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82002 add .2410 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82003 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82004 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82007 add .2460 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82008 add .2470 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82009 add .2499 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82011 add -.2499 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
+
+ddadd82100 add .2500 12345678901234.00 -> 12345678901234.25 Rounded
+ddadd82101 add .2501 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82102 add .2510 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82103 add .2550 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82104 add .2551 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82107 add .2560 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82108 add .2570 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82109 add .2599 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82111 add -.2599 -12345678901234.00 -> -12345678901234.26 Inexact Rounded
+
+ddadd82200 add .2600 12345678901234.00 -> 12345678901234.26 Rounded
+ddadd82201 add .2601 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82202 add .2610 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82203 add .2650 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82204 add .2651 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82207 add .2660 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82208 add .2670 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82209 add .2699 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82211 add -.2699 -12345678901234.00 -> -12345678901234.26 Inexact Rounded
+
+ddadd82300 add .2900 12345678901234.00 -> 12345678901234.29 Rounded
+ddadd82301 add .2901 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82302 add .2910 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82303 add .2950 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82304 add .2951 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82307 add .2960 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82308 add .2970 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82309 add .2999 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82311 add -.2999 -12345678901234.00 -> -12345678901234.29 Inexact Rounded
+
+-- Null tests
+ddadd9990 add 10 # -> NaN Invalid_operation
+ddadd9991 add # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddAnd.decTest b/Lib/test/decimaltestdata/ddAnd.decTest
index 64a9f92df9..676517548c 100644
--- a/Lib/test/decimaltestdata/ddAnd.decTest
+++ b/Lib/test/decimaltestdata/ddAnd.decTest
@@ -1,347 +1,347 @@
-------------------------------------------------------------------------
--- ddAnd.decTest -- digitwise logical AND for decDoubles --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check (truth table)
-ddand001 and 0 0 -> 0
-ddand002 and 0 1 -> 0
-ddand003 and 1 0 -> 0
-ddand004 and 1 1 -> 1
-ddand005 and 1100 1010 -> 1000
--- and at msd and msd-1
--- 1234567890123456 1234567890123456 1234567890123456
-ddand006 and 0000000000000000 0000000000000000 -> 0
-ddand007 and 0000000000000000 1000000000000000 -> 0
-ddand008 and 1000000000000000 0000000000000000 -> 0
-ddand009 and 1000000000000000 1000000000000000 -> 1000000000000000
-ddand010 and 0000000000000000 0000000000000000 -> 0
-ddand011 and 0000000000000000 0100000000000000 -> 0
-ddand012 and 0100000000000000 0000000000000000 -> 0
-ddand013 and 0100000000000000 0100000000000000 -> 100000000000000
-
--- Various lengths
--- 1234567890123456 1234567890123456 1234567890123456
-ddand021 and 1111111111111111 1111111111111111 -> 1111111111111111
-ddand024 and 1111111111111111 111111111111111 -> 111111111111111
-ddand025 and 1111111111111111 11111111111111 -> 11111111111111
-ddand026 and 1111111111111111 1111111111111 -> 1111111111111
-ddand027 and 1111111111111111 111111111111 -> 111111111111
-ddand028 and 1111111111111111 11111111111 -> 11111111111
-ddand029 and 1111111111111111 1111111111 -> 1111111111
-ddand030 and 1111111111111111 111111111 -> 111111111
-ddand031 and 1111111111111111 11111111 -> 11111111
-ddand032 and 1111111111111111 1111111 -> 1111111
-ddand033 and 1111111111111111 111111 -> 111111
-ddand034 and 1111111111111111 11111 -> 11111
-ddand035 and 1111111111111111 1111 -> 1111
-ddand036 and 1111111111111111 111 -> 111
-ddand037 and 1111111111111111 11 -> 11
-ddand038 and 1111111111111111 1 -> 1
-ddand039 and 1111111111111111 0 -> 0
-
-ddand040 and 1111111111111111 1111111111111111 -> 1111111111111111
-ddand041 and 111111111111111 1111111111111111 -> 111111111111111
-ddand042 and 111111111111111 1111111111111111 -> 111111111111111
-ddand043 and 11111111111111 1111111111111111 -> 11111111111111
-ddand044 and 1111111111111 1111111111111111 -> 1111111111111
-ddand045 and 111111111111 1111111111111111 -> 111111111111
-ddand046 and 11111111111 1111111111111111 -> 11111111111
-ddand047 and 1111111111 1111111111111111 -> 1111111111
-ddand048 and 111111111 1111111111111111 -> 111111111
-ddand049 and 11111111 1111111111111111 -> 11111111
-ddand050 and 1111111 1111111111111111 -> 1111111
-ddand051 and 111111 1111111111111111 -> 111111
-ddand052 and 11111 1111111111111111 -> 11111
-ddand053 and 1111 1111111111111111 -> 1111
-ddand054 and 111 1111111111111111 -> 111
-ddand055 and 11 1111111111111111 -> 11
-ddand056 and 1 1111111111111111 -> 1
-ddand057 and 0 1111111111111111 -> 0
-
-ddand150 and 1111111111 1 -> 1
-ddand151 and 111111111 1 -> 1
-ddand152 and 11111111 1 -> 1
-ddand153 and 1111111 1 -> 1
-ddand154 and 111111 1 -> 1
-ddand155 and 11111 1 -> 1
-ddand156 and 1111 1 -> 1
-ddand157 and 111 1 -> 1
-ddand158 and 11 1 -> 1
-ddand159 and 1 1 -> 1
-
-ddand160 and 1111111111 0 -> 0
-ddand161 and 111111111 0 -> 0
-ddand162 and 11111111 0 -> 0
-ddand163 and 1111111 0 -> 0
-ddand164 and 111111 0 -> 0
-ddand165 and 11111 0 -> 0
-ddand166 and 1111 0 -> 0
-ddand167 and 111 0 -> 0
-ddand168 and 11 0 -> 0
-ddand169 and 1 0 -> 0
-
-ddand170 and 1 1111111111 -> 1
-ddand171 and 1 111111111 -> 1
-ddand172 and 1 11111111 -> 1
-ddand173 and 1 1111111 -> 1
-ddand174 and 1 111111 -> 1
-ddand175 and 1 11111 -> 1
-ddand176 and 1 1111 -> 1
-ddand177 and 1 111 -> 1
-ddand178 and 1 11 -> 1
-ddand179 and 1 1 -> 1
-
-ddand180 and 0 1111111111 -> 0
-ddand181 and 0 111111111 -> 0
-ddand182 and 0 11111111 -> 0
-ddand183 and 0 1111111 -> 0
-ddand184 and 0 111111 -> 0
-ddand185 and 0 11111 -> 0
-ddand186 and 0 1111 -> 0
-ddand187 and 0 111 -> 0
-ddand188 and 0 11 -> 0
-ddand189 and 0 1 -> 0
-
-ddand090 and 011111111 111111111 -> 11111111
-ddand091 and 101111111 111111111 -> 101111111
-ddand092 and 110111111 111111111 -> 110111111
-ddand093 and 111011111 111111111 -> 111011111
-ddand094 and 111101111 111111111 -> 111101111
-ddand095 and 111110111 111111111 -> 111110111
-ddand096 and 111111011 111111111 -> 111111011
-ddand097 and 111111101 111111111 -> 111111101
-ddand098 and 111111110 111111111 -> 111111110
-
-ddand100 and 111111111 011111111 -> 11111111
-ddand101 and 111111111 101111111 -> 101111111
-ddand102 and 111111111 110111111 -> 110111111
-ddand103 and 111111111 111011111 -> 111011111
-ddand104 and 111111111 111101111 -> 111101111
-ddand105 and 111111111 111110111 -> 111110111
-ddand106 and 111111111 111111011 -> 111111011
-ddand107 and 111111111 111111101 -> 111111101
-ddand108 and 111111111 111111110 -> 111111110
-
--- non-0/1 should not be accepted, nor should signs
-ddand220 and 111111112 111111111 -> NaN Invalid_operation
-ddand221 and 333333333 333333333 -> NaN Invalid_operation
-ddand222 and 555555555 555555555 -> NaN Invalid_operation
-ddand223 and 777777777 777777777 -> NaN Invalid_operation
-ddand224 and 999999999 999999999 -> NaN Invalid_operation
-ddand225 and 222222222 999999999 -> NaN Invalid_operation
-ddand226 and 444444444 999999999 -> NaN Invalid_operation
-ddand227 and 666666666 999999999 -> NaN Invalid_operation
-ddand228 and 888888888 999999999 -> NaN Invalid_operation
-ddand229 and 999999999 222222222 -> NaN Invalid_operation
-ddand230 and 999999999 444444444 -> NaN Invalid_operation
-ddand231 and 999999999 666666666 -> NaN Invalid_operation
-ddand232 and 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-ddand240 and 567468689 -934981942 -> NaN Invalid_operation
-ddand241 and 567367689 934981942 -> NaN Invalid_operation
-ddand242 and -631917772 -706014634 -> NaN Invalid_operation
-ddand243 and -756253257 138579234 -> NaN Invalid_operation
-ddand244 and 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-ddand250 and 2000000000000000 1000000000000000 -> NaN Invalid_operation
-ddand251 and 7000000000000000 1000000000000000 -> NaN Invalid_operation
-ddand252 and 8000000000000000 1000000000000000 -> NaN Invalid_operation
-ddand253 and 9000000000000000 1000000000000000 -> NaN Invalid_operation
-ddand254 and 2000000000000000 0000000000000000 -> NaN Invalid_operation
-ddand255 and 7000000000000000 0000000000000000 -> NaN Invalid_operation
-ddand256 and 8000000000000000 0000000000000000 -> NaN Invalid_operation
-ddand257 and 9000000000000000 0000000000000000 -> NaN Invalid_operation
-ddand258 and 1000000000000000 2000000000000000 -> NaN Invalid_operation
-ddand259 and 1000000000000000 7000000000000000 -> NaN Invalid_operation
-ddand260 and 1000000000000000 8000000000000000 -> NaN Invalid_operation
-ddand261 and 1000000000000000 9000000000000000 -> NaN Invalid_operation
-ddand262 and 0000000000000000 2000000000000000 -> NaN Invalid_operation
-ddand263 and 0000000000000000 7000000000000000 -> NaN Invalid_operation
-ddand264 and 0000000000000000 8000000000000000 -> NaN Invalid_operation
-ddand265 and 0000000000000000 9000000000000000 -> NaN Invalid_operation
--- test MSD-1
-ddand270 and 0200001000000000 1000100000000010 -> NaN Invalid_operation
-ddand271 and 0700000100000000 1000010000000100 -> NaN Invalid_operation
-ddand272 and 0800000010000000 1000001000001000 -> NaN Invalid_operation
-ddand273 and 0900000001000000 1000000100010000 -> NaN Invalid_operation
-ddand274 and 1000000000100000 0200000010100000 -> NaN Invalid_operation
-ddand275 and 1000000000010000 0700000001000000 -> NaN Invalid_operation
-ddand276 and 1000000000001000 0800000010100000 -> NaN Invalid_operation
-ddand277 and 1000000000000100 0900000000010000 -> NaN Invalid_operation
--- test LSD
-ddand280 and 0010000000000002 1000000100000001 -> NaN Invalid_operation
-ddand281 and 0001000000000007 1000001000000011 -> NaN Invalid_operation
-ddand282 and 0000100000000008 1000010000000001 -> NaN Invalid_operation
-ddand283 and 0000010000000009 1000100000000001 -> NaN Invalid_operation
-ddand284 and 1000001000000000 0001000000000002 -> NaN Invalid_operation
-ddand285 and 1000000100000000 0010000000000007 -> NaN Invalid_operation
-ddand286 and 1000000010000000 0100000000000008 -> NaN Invalid_operation
-ddand287 and 1000000001000000 1000000000000009 -> NaN Invalid_operation
--- test Middie
-ddand288 and 0010000020000000 1000001000000000 -> NaN Invalid_operation
-ddand289 and 0001000070000001 1000000100000000 -> NaN Invalid_operation
-ddand290 and 0000100080000010 1000000010000000 -> NaN Invalid_operation
-ddand291 and 0000010090000100 1000000001000000 -> NaN Invalid_operation
-ddand292 and 1000001000001000 0000000020100000 -> NaN Invalid_operation
-ddand293 and 1000000100010000 0000000070010000 -> NaN Invalid_operation
-ddand294 and 1000000010100000 0000000080001000 -> NaN Invalid_operation
-ddand295 and 1000000001000000 0000000090000100 -> NaN Invalid_operation
--- signs
-ddand296 and -1000000001000000 -0000010000000100 -> NaN Invalid_operation
-ddand297 and -1000000001000000 0000000010000100 -> NaN Invalid_operation
-ddand298 and 1000000001000000 -0000001000000100 -> NaN Invalid_operation
-ddand299 and 1000000001000000 0000000011000100 -> 1000000
-
--- Nmax, Nmin, Ntiny-like
-ddand331 and 2 9.99999999E+199 -> NaN Invalid_operation
-ddand332 and 3 1E-199 -> NaN Invalid_operation
-ddand333 and 4 1.00000000E-199 -> NaN Invalid_operation
-ddand334 and 5 1E-100 -> NaN Invalid_operation
-ddand335 and 6 -1E-100 -> NaN Invalid_operation
-ddand336 and 7 -1.00000000E-199 -> NaN Invalid_operation
-ddand337 and 8 -1E-199 -> NaN Invalid_operation
-ddand338 and 9 -9.99999999E+199 -> NaN Invalid_operation
-ddand341 and 9.99999999E+199 -18 -> NaN Invalid_operation
-ddand342 and 1E-199 01 -> NaN Invalid_operation
-ddand343 and 1.00000000E-199 -18 -> NaN Invalid_operation
-ddand344 and 1E-100 18 -> NaN Invalid_operation
-ddand345 and -1E-100 -10 -> NaN Invalid_operation
-ddand346 and -1.00000000E-199 18 -> NaN Invalid_operation
-ddand347 and -1E-199 10 -> NaN Invalid_operation
-ddand348 and -9.99999999E+199 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-ddand361 and 1.0 1 -> NaN Invalid_operation
-ddand362 and 1E+1 1 -> NaN Invalid_operation
-ddand363 and 0.0 1 -> NaN Invalid_operation
-ddand364 and 0E+1 1 -> NaN Invalid_operation
-ddand365 and 9.9 1 -> NaN Invalid_operation
-ddand366 and 9E+1 1 -> NaN Invalid_operation
-ddand371 and 0 1.0 -> NaN Invalid_operation
-ddand372 and 0 1E+1 -> NaN Invalid_operation
-ddand373 and 0 0.0 -> NaN Invalid_operation
-ddand374 and 0 0E+1 -> NaN Invalid_operation
-ddand375 and 0 9.9 -> NaN Invalid_operation
-ddand376 and 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-ddand780 and -Inf -Inf -> NaN Invalid_operation
-ddand781 and -Inf -1000 -> NaN Invalid_operation
-ddand782 and -Inf -1 -> NaN Invalid_operation
-ddand783 and -Inf -0 -> NaN Invalid_operation
-ddand784 and -Inf 0 -> NaN Invalid_operation
-ddand785 and -Inf 1 -> NaN Invalid_operation
-ddand786 and -Inf 1000 -> NaN Invalid_operation
-ddand787 and -1000 -Inf -> NaN Invalid_operation
-ddand788 and -Inf -Inf -> NaN Invalid_operation
-ddand789 and -1 -Inf -> NaN Invalid_operation
-ddand790 and -0 -Inf -> NaN Invalid_operation
-ddand791 and 0 -Inf -> NaN Invalid_operation
-ddand792 and 1 -Inf -> NaN Invalid_operation
-ddand793 and 1000 -Inf -> NaN Invalid_operation
-ddand794 and Inf -Inf -> NaN Invalid_operation
-
-ddand800 and Inf -Inf -> NaN Invalid_operation
-ddand801 and Inf -1000 -> NaN Invalid_operation
-ddand802 and Inf -1 -> NaN Invalid_operation
-ddand803 and Inf -0 -> NaN Invalid_operation
-ddand804 and Inf 0 -> NaN Invalid_operation
-ddand805 and Inf 1 -> NaN Invalid_operation
-ddand806 and Inf 1000 -> NaN Invalid_operation
-ddand807 and Inf Inf -> NaN Invalid_operation
-ddand808 and -1000 Inf -> NaN Invalid_operation
-ddand809 and -Inf Inf -> NaN Invalid_operation
-ddand810 and -1 Inf -> NaN Invalid_operation
-ddand811 and -0 Inf -> NaN Invalid_operation
-ddand812 and 0 Inf -> NaN Invalid_operation
-ddand813 and 1 Inf -> NaN Invalid_operation
-ddand814 and 1000 Inf -> NaN Invalid_operation
-ddand815 and Inf Inf -> NaN Invalid_operation
-
-ddand821 and NaN -Inf -> NaN Invalid_operation
-ddand822 and NaN -1000 -> NaN Invalid_operation
-ddand823 and NaN -1 -> NaN Invalid_operation
-ddand824 and NaN -0 -> NaN Invalid_operation
-ddand825 and NaN 0 -> NaN Invalid_operation
-ddand826 and NaN 1 -> NaN Invalid_operation
-ddand827 and NaN 1000 -> NaN Invalid_operation
-ddand828 and NaN Inf -> NaN Invalid_operation
-ddand829 and NaN NaN -> NaN Invalid_operation
-ddand830 and -Inf NaN -> NaN Invalid_operation
-ddand831 and -1000 NaN -> NaN Invalid_operation
-ddand832 and -1 NaN -> NaN Invalid_operation
-ddand833 and -0 NaN -> NaN Invalid_operation
-ddand834 and 0 NaN -> NaN Invalid_operation
-ddand835 and 1 NaN -> NaN Invalid_operation
-ddand836 and 1000 NaN -> NaN Invalid_operation
-ddand837 and Inf NaN -> NaN Invalid_operation
-
-ddand841 and sNaN -Inf -> NaN Invalid_operation
-ddand842 and sNaN -1000 -> NaN Invalid_operation
-ddand843 and sNaN -1 -> NaN Invalid_operation
-ddand844 and sNaN -0 -> NaN Invalid_operation
-ddand845 and sNaN 0 -> NaN Invalid_operation
-ddand846 and sNaN 1 -> NaN Invalid_operation
-ddand847 and sNaN 1000 -> NaN Invalid_operation
-ddand848 and sNaN NaN -> NaN Invalid_operation
-ddand849 and sNaN sNaN -> NaN Invalid_operation
-ddand850 and NaN sNaN -> NaN Invalid_operation
-ddand851 and -Inf sNaN -> NaN Invalid_operation
-ddand852 and -1000 sNaN -> NaN Invalid_operation
-ddand853 and -1 sNaN -> NaN Invalid_operation
-ddand854 and -0 sNaN -> NaN Invalid_operation
-ddand855 and 0 sNaN -> NaN Invalid_operation
-ddand856 and 1 sNaN -> NaN Invalid_operation
-ddand857 and 1000 sNaN -> NaN Invalid_operation
-ddand858 and Inf sNaN -> NaN Invalid_operation
-ddand859 and NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddand861 and NaN1 -Inf -> NaN Invalid_operation
-ddand862 and +NaN2 -1000 -> NaN Invalid_operation
-ddand863 and NaN3 1000 -> NaN Invalid_operation
-ddand864 and NaN4 Inf -> NaN Invalid_operation
-ddand865 and NaN5 +NaN6 -> NaN Invalid_operation
-ddand866 and -Inf NaN7 -> NaN Invalid_operation
-ddand867 and -1000 NaN8 -> NaN Invalid_operation
-ddand868 and 1000 NaN9 -> NaN Invalid_operation
-ddand869 and Inf +NaN10 -> NaN Invalid_operation
-ddand871 and sNaN11 -Inf -> NaN Invalid_operation
-ddand872 and sNaN12 -1000 -> NaN Invalid_operation
-ddand873 and sNaN13 1000 -> NaN Invalid_operation
-ddand874 and sNaN14 NaN17 -> NaN Invalid_operation
-ddand875 and sNaN15 sNaN18 -> NaN Invalid_operation
-ddand876 and NaN16 sNaN19 -> NaN Invalid_operation
-ddand877 and -Inf +sNaN20 -> NaN Invalid_operation
-ddand878 and -1000 sNaN21 -> NaN Invalid_operation
-ddand879 and 1000 sNaN22 -> NaN Invalid_operation
-ddand880 and Inf sNaN23 -> NaN Invalid_operation
-ddand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
-ddand882 and -NaN26 NaN28 -> NaN Invalid_operation
-ddand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
-ddand884 and 1000 -NaN30 -> NaN Invalid_operation
-ddand885 and 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddAnd.decTest -- digitwise logical AND for decDoubles --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check (truth table)
+ddand001 and 0 0 -> 0
+ddand002 and 0 1 -> 0
+ddand003 and 1 0 -> 0
+ddand004 and 1 1 -> 1
+ddand005 and 1100 1010 -> 1000
+-- and at msd and msd-1
+-- 1234567890123456 1234567890123456 1234567890123456
+ddand006 and 0000000000000000 0000000000000000 -> 0
+ddand007 and 0000000000000000 1000000000000000 -> 0
+ddand008 and 1000000000000000 0000000000000000 -> 0
+ddand009 and 1000000000000000 1000000000000000 -> 1000000000000000
+ddand010 and 0000000000000000 0000000000000000 -> 0
+ddand011 and 0000000000000000 0100000000000000 -> 0
+ddand012 and 0100000000000000 0000000000000000 -> 0
+ddand013 and 0100000000000000 0100000000000000 -> 100000000000000
+
+-- Various lengths
+-- 1234567890123456 1234567890123456 1234567890123456
+ddand021 and 1111111111111111 1111111111111111 -> 1111111111111111
+ddand024 and 1111111111111111 111111111111111 -> 111111111111111
+ddand025 and 1111111111111111 11111111111111 -> 11111111111111
+ddand026 and 1111111111111111 1111111111111 -> 1111111111111
+ddand027 and 1111111111111111 111111111111 -> 111111111111
+ddand028 and 1111111111111111 11111111111 -> 11111111111
+ddand029 and 1111111111111111 1111111111 -> 1111111111
+ddand030 and 1111111111111111 111111111 -> 111111111
+ddand031 and 1111111111111111 11111111 -> 11111111
+ddand032 and 1111111111111111 1111111 -> 1111111
+ddand033 and 1111111111111111 111111 -> 111111
+ddand034 and 1111111111111111 11111 -> 11111
+ddand035 and 1111111111111111 1111 -> 1111
+ddand036 and 1111111111111111 111 -> 111
+ddand037 and 1111111111111111 11 -> 11
+ddand038 and 1111111111111111 1 -> 1
+ddand039 and 1111111111111111 0 -> 0
+
+ddand040 and 1111111111111111 1111111111111111 -> 1111111111111111
+ddand041 and 111111111111111 1111111111111111 -> 111111111111111
+ddand042 and 111111111111111 1111111111111111 -> 111111111111111
+ddand043 and 11111111111111 1111111111111111 -> 11111111111111
+ddand044 and 1111111111111 1111111111111111 -> 1111111111111
+ddand045 and 111111111111 1111111111111111 -> 111111111111
+ddand046 and 11111111111 1111111111111111 -> 11111111111
+ddand047 and 1111111111 1111111111111111 -> 1111111111
+ddand048 and 111111111 1111111111111111 -> 111111111
+ddand049 and 11111111 1111111111111111 -> 11111111
+ddand050 and 1111111 1111111111111111 -> 1111111
+ddand051 and 111111 1111111111111111 -> 111111
+ddand052 and 11111 1111111111111111 -> 11111
+ddand053 and 1111 1111111111111111 -> 1111
+ddand054 and 111 1111111111111111 -> 111
+ddand055 and 11 1111111111111111 -> 11
+ddand056 and 1 1111111111111111 -> 1
+ddand057 and 0 1111111111111111 -> 0
+
+ddand150 and 1111111111 1 -> 1
+ddand151 and 111111111 1 -> 1
+ddand152 and 11111111 1 -> 1
+ddand153 and 1111111 1 -> 1
+ddand154 and 111111 1 -> 1
+ddand155 and 11111 1 -> 1
+ddand156 and 1111 1 -> 1
+ddand157 and 111 1 -> 1
+ddand158 and 11 1 -> 1
+ddand159 and 1 1 -> 1
+
+ddand160 and 1111111111 0 -> 0
+ddand161 and 111111111 0 -> 0
+ddand162 and 11111111 0 -> 0
+ddand163 and 1111111 0 -> 0
+ddand164 and 111111 0 -> 0
+ddand165 and 11111 0 -> 0
+ddand166 and 1111 0 -> 0
+ddand167 and 111 0 -> 0
+ddand168 and 11 0 -> 0
+ddand169 and 1 0 -> 0
+
+ddand170 and 1 1111111111 -> 1
+ddand171 and 1 111111111 -> 1
+ddand172 and 1 11111111 -> 1
+ddand173 and 1 1111111 -> 1
+ddand174 and 1 111111 -> 1
+ddand175 and 1 11111 -> 1
+ddand176 and 1 1111 -> 1
+ddand177 and 1 111 -> 1
+ddand178 and 1 11 -> 1
+ddand179 and 1 1 -> 1
+
+ddand180 and 0 1111111111 -> 0
+ddand181 and 0 111111111 -> 0
+ddand182 and 0 11111111 -> 0
+ddand183 and 0 1111111 -> 0
+ddand184 and 0 111111 -> 0
+ddand185 and 0 11111 -> 0
+ddand186 and 0 1111 -> 0
+ddand187 and 0 111 -> 0
+ddand188 and 0 11 -> 0
+ddand189 and 0 1 -> 0
+
+ddand090 and 011111111 111111111 -> 11111111
+ddand091 and 101111111 111111111 -> 101111111
+ddand092 and 110111111 111111111 -> 110111111
+ddand093 and 111011111 111111111 -> 111011111
+ddand094 and 111101111 111111111 -> 111101111
+ddand095 and 111110111 111111111 -> 111110111
+ddand096 and 111111011 111111111 -> 111111011
+ddand097 and 111111101 111111111 -> 111111101
+ddand098 and 111111110 111111111 -> 111111110
+
+ddand100 and 111111111 011111111 -> 11111111
+ddand101 and 111111111 101111111 -> 101111111
+ddand102 and 111111111 110111111 -> 110111111
+ddand103 and 111111111 111011111 -> 111011111
+ddand104 and 111111111 111101111 -> 111101111
+ddand105 and 111111111 111110111 -> 111110111
+ddand106 and 111111111 111111011 -> 111111011
+ddand107 and 111111111 111111101 -> 111111101
+ddand108 and 111111111 111111110 -> 111111110
+
+-- non-0/1 should not be accepted, nor should signs
+ddand220 and 111111112 111111111 -> NaN Invalid_operation
+ddand221 and 333333333 333333333 -> NaN Invalid_operation
+ddand222 and 555555555 555555555 -> NaN Invalid_operation
+ddand223 and 777777777 777777777 -> NaN Invalid_operation
+ddand224 and 999999999 999999999 -> NaN Invalid_operation
+ddand225 and 222222222 999999999 -> NaN Invalid_operation
+ddand226 and 444444444 999999999 -> NaN Invalid_operation
+ddand227 and 666666666 999999999 -> NaN Invalid_operation
+ddand228 and 888888888 999999999 -> NaN Invalid_operation
+ddand229 and 999999999 222222222 -> NaN Invalid_operation
+ddand230 and 999999999 444444444 -> NaN Invalid_operation
+ddand231 and 999999999 666666666 -> NaN Invalid_operation
+ddand232 and 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+ddand240 and 567468689 -934981942 -> NaN Invalid_operation
+ddand241 and 567367689 934981942 -> NaN Invalid_operation
+ddand242 and -631917772 -706014634 -> NaN Invalid_operation
+ddand243 and -756253257 138579234 -> NaN Invalid_operation
+ddand244 and 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+ddand250 and 2000000000000000 1000000000000000 -> NaN Invalid_operation
+ddand251 and 7000000000000000 1000000000000000 -> NaN Invalid_operation
+ddand252 and 8000000000000000 1000000000000000 -> NaN Invalid_operation
+ddand253 and 9000000000000000 1000000000000000 -> NaN Invalid_operation
+ddand254 and 2000000000000000 0000000000000000 -> NaN Invalid_operation
+ddand255 and 7000000000000000 0000000000000000 -> NaN Invalid_operation
+ddand256 and 8000000000000000 0000000000000000 -> NaN Invalid_operation
+ddand257 and 9000000000000000 0000000000000000 -> NaN Invalid_operation
+ddand258 and 1000000000000000 2000000000000000 -> NaN Invalid_operation
+ddand259 and 1000000000000000 7000000000000000 -> NaN Invalid_operation
+ddand260 and 1000000000000000 8000000000000000 -> NaN Invalid_operation
+ddand261 and 1000000000000000 9000000000000000 -> NaN Invalid_operation
+ddand262 and 0000000000000000 2000000000000000 -> NaN Invalid_operation
+ddand263 and 0000000000000000 7000000000000000 -> NaN Invalid_operation
+ddand264 and 0000000000000000 8000000000000000 -> NaN Invalid_operation
+ddand265 and 0000000000000000 9000000000000000 -> NaN Invalid_operation
+-- test MSD-1
+ddand270 and 0200001000000000 1000100000000010 -> NaN Invalid_operation
+ddand271 and 0700000100000000 1000010000000100 -> NaN Invalid_operation
+ddand272 and 0800000010000000 1000001000001000 -> NaN Invalid_operation
+ddand273 and 0900000001000000 1000000100010000 -> NaN Invalid_operation
+ddand274 and 1000000000100000 0200000010100000 -> NaN Invalid_operation
+ddand275 and 1000000000010000 0700000001000000 -> NaN Invalid_operation
+ddand276 and 1000000000001000 0800000010100000 -> NaN Invalid_operation
+ddand277 and 1000000000000100 0900000000010000 -> NaN Invalid_operation
+-- test LSD
+ddand280 and 0010000000000002 1000000100000001 -> NaN Invalid_operation
+ddand281 and 0001000000000007 1000001000000011 -> NaN Invalid_operation
+ddand282 and 0000100000000008 1000010000000001 -> NaN Invalid_operation
+ddand283 and 0000010000000009 1000100000000001 -> NaN Invalid_operation
+ddand284 and 1000001000000000 0001000000000002 -> NaN Invalid_operation
+ddand285 and 1000000100000000 0010000000000007 -> NaN Invalid_operation
+ddand286 and 1000000010000000 0100000000000008 -> NaN Invalid_operation
+ddand287 and 1000000001000000 1000000000000009 -> NaN Invalid_operation
+-- test Middie
+ddand288 and 0010000020000000 1000001000000000 -> NaN Invalid_operation
+ddand289 and 0001000070000001 1000000100000000 -> NaN Invalid_operation
+ddand290 and 0000100080000010 1000000010000000 -> NaN Invalid_operation
+ddand291 and 0000010090000100 1000000001000000 -> NaN Invalid_operation
+ddand292 and 1000001000001000 0000000020100000 -> NaN Invalid_operation
+ddand293 and 1000000100010000 0000000070010000 -> NaN Invalid_operation
+ddand294 and 1000000010100000 0000000080001000 -> NaN Invalid_operation
+ddand295 and 1000000001000000 0000000090000100 -> NaN Invalid_operation
+-- signs
+ddand296 and -1000000001000000 -0000010000000100 -> NaN Invalid_operation
+ddand297 and -1000000001000000 0000000010000100 -> NaN Invalid_operation
+ddand298 and 1000000001000000 -0000001000000100 -> NaN Invalid_operation
+ddand299 and 1000000001000000 0000000011000100 -> 1000000
+
+-- Nmax, Nmin, Ntiny-like
+ddand331 and 2 9.99999999E+199 -> NaN Invalid_operation
+ddand332 and 3 1E-199 -> NaN Invalid_operation
+ddand333 and 4 1.00000000E-199 -> NaN Invalid_operation
+ddand334 and 5 1E-100 -> NaN Invalid_operation
+ddand335 and 6 -1E-100 -> NaN Invalid_operation
+ddand336 and 7 -1.00000000E-199 -> NaN Invalid_operation
+ddand337 and 8 -1E-199 -> NaN Invalid_operation
+ddand338 and 9 -9.99999999E+199 -> NaN Invalid_operation
+ddand341 and 9.99999999E+199 -18 -> NaN Invalid_operation
+ddand342 and 1E-199 01 -> NaN Invalid_operation
+ddand343 and 1.00000000E-199 -18 -> NaN Invalid_operation
+ddand344 and 1E-100 18 -> NaN Invalid_operation
+ddand345 and -1E-100 -10 -> NaN Invalid_operation
+ddand346 and -1.00000000E-199 18 -> NaN Invalid_operation
+ddand347 and -1E-199 10 -> NaN Invalid_operation
+ddand348 and -9.99999999E+199 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+ddand361 and 1.0 1 -> NaN Invalid_operation
+ddand362 and 1E+1 1 -> NaN Invalid_operation
+ddand363 and 0.0 1 -> NaN Invalid_operation
+ddand364 and 0E+1 1 -> NaN Invalid_operation
+ddand365 and 9.9 1 -> NaN Invalid_operation
+ddand366 and 9E+1 1 -> NaN Invalid_operation
+ddand371 and 0 1.0 -> NaN Invalid_operation
+ddand372 and 0 1E+1 -> NaN Invalid_operation
+ddand373 and 0 0.0 -> NaN Invalid_operation
+ddand374 and 0 0E+1 -> NaN Invalid_operation
+ddand375 and 0 9.9 -> NaN Invalid_operation
+ddand376 and 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+ddand780 and -Inf -Inf -> NaN Invalid_operation
+ddand781 and -Inf -1000 -> NaN Invalid_operation
+ddand782 and -Inf -1 -> NaN Invalid_operation
+ddand783 and -Inf -0 -> NaN Invalid_operation
+ddand784 and -Inf 0 -> NaN Invalid_operation
+ddand785 and -Inf 1 -> NaN Invalid_operation
+ddand786 and -Inf 1000 -> NaN Invalid_operation
+ddand787 and -1000 -Inf -> NaN Invalid_operation
+ddand788 and -Inf -Inf -> NaN Invalid_operation
+ddand789 and -1 -Inf -> NaN Invalid_operation
+ddand790 and -0 -Inf -> NaN Invalid_operation
+ddand791 and 0 -Inf -> NaN Invalid_operation
+ddand792 and 1 -Inf -> NaN Invalid_operation
+ddand793 and 1000 -Inf -> NaN Invalid_operation
+ddand794 and Inf -Inf -> NaN Invalid_operation
+
+ddand800 and Inf -Inf -> NaN Invalid_operation
+ddand801 and Inf -1000 -> NaN Invalid_operation
+ddand802 and Inf -1 -> NaN Invalid_operation
+ddand803 and Inf -0 -> NaN Invalid_operation
+ddand804 and Inf 0 -> NaN Invalid_operation
+ddand805 and Inf 1 -> NaN Invalid_operation
+ddand806 and Inf 1000 -> NaN Invalid_operation
+ddand807 and Inf Inf -> NaN Invalid_operation
+ddand808 and -1000 Inf -> NaN Invalid_operation
+ddand809 and -Inf Inf -> NaN Invalid_operation
+ddand810 and -1 Inf -> NaN Invalid_operation
+ddand811 and -0 Inf -> NaN Invalid_operation
+ddand812 and 0 Inf -> NaN Invalid_operation
+ddand813 and 1 Inf -> NaN Invalid_operation
+ddand814 and 1000 Inf -> NaN Invalid_operation
+ddand815 and Inf Inf -> NaN Invalid_operation
+
+ddand821 and NaN -Inf -> NaN Invalid_operation
+ddand822 and NaN -1000 -> NaN Invalid_operation
+ddand823 and NaN -1 -> NaN Invalid_operation
+ddand824 and NaN -0 -> NaN Invalid_operation
+ddand825 and NaN 0 -> NaN Invalid_operation
+ddand826 and NaN 1 -> NaN Invalid_operation
+ddand827 and NaN 1000 -> NaN Invalid_operation
+ddand828 and NaN Inf -> NaN Invalid_operation
+ddand829 and NaN NaN -> NaN Invalid_operation
+ddand830 and -Inf NaN -> NaN Invalid_operation
+ddand831 and -1000 NaN -> NaN Invalid_operation
+ddand832 and -1 NaN -> NaN Invalid_operation
+ddand833 and -0 NaN -> NaN Invalid_operation
+ddand834 and 0 NaN -> NaN Invalid_operation
+ddand835 and 1 NaN -> NaN Invalid_operation
+ddand836 and 1000 NaN -> NaN Invalid_operation
+ddand837 and Inf NaN -> NaN Invalid_operation
+
+ddand841 and sNaN -Inf -> NaN Invalid_operation
+ddand842 and sNaN -1000 -> NaN Invalid_operation
+ddand843 and sNaN -1 -> NaN Invalid_operation
+ddand844 and sNaN -0 -> NaN Invalid_operation
+ddand845 and sNaN 0 -> NaN Invalid_operation
+ddand846 and sNaN 1 -> NaN Invalid_operation
+ddand847 and sNaN 1000 -> NaN Invalid_operation
+ddand848 and sNaN NaN -> NaN Invalid_operation
+ddand849 and sNaN sNaN -> NaN Invalid_operation
+ddand850 and NaN sNaN -> NaN Invalid_operation
+ddand851 and -Inf sNaN -> NaN Invalid_operation
+ddand852 and -1000 sNaN -> NaN Invalid_operation
+ddand853 and -1 sNaN -> NaN Invalid_operation
+ddand854 and -0 sNaN -> NaN Invalid_operation
+ddand855 and 0 sNaN -> NaN Invalid_operation
+ddand856 and 1 sNaN -> NaN Invalid_operation
+ddand857 and 1000 sNaN -> NaN Invalid_operation
+ddand858 and Inf sNaN -> NaN Invalid_operation
+ddand859 and NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddand861 and NaN1 -Inf -> NaN Invalid_operation
+ddand862 and +NaN2 -1000 -> NaN Invalid_operation
+ddand863 and NaN3 1000 -> NaN Invalid_operation
+ddand864 and NaN4 Inf -> NaN Invalid_operation
+ddand865 and NaN5 +NaN6 -> NaN Invalid_operation
+ddand866 and -Inf NaN7 -> NaN Invalid_operation
+ddand867 and -1000 NaN8 -> NaN Invalid_operation
+ddand868 and 1000 NaN9 -> NaN Invalid_operation
+ddand869 and Inf +NaN10 -> NaN Invalid_operation
+ddand871 and sNaN11 -Inf -> NaN Invalid_operation
+ddand872 and sNaN12 -1000 -> NaN Invalid_operation
+ddand873 and sNaN13 1000 -> NaN Invalid_operation
+ddand874 and sNaN14 NaN17 -> NaN Invalid_operation
+ddand875 and sNaN15 sNaN18 -> NaN Invalid_operation
+ddand876 and NaN16 sNaN19 -> NaN Invalid_operation
+ddand877 and -Inf +sNaN20 -> NaN Invalid_operation
+ddand878 and -1000 sNaN21 -> NaN Invalid_operation
+ddand879 and 1000 sNaN22 -> NaN Invalid_operation
+ddand880 and Inf sNaN23 -> NaN Invalid_operation
+ddand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
+ddand882 and -NaN26 NaN28 -> NaN Invalid_operation
+ddand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
+ddand884 and 1000 -NaN30 -> NaN Invalid_operation
+ddand885 and 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddBase.decTest b/Lib/test/decimaltestdata/ddBase.decTest
index 40febf86c5..fbd6ccd94d 100644
--- a/Lib/test/decimaltestdata/ddBase.decTest
+++ b/Lib/test/decimaltestdata/ddBase.decTest
@@ -1,1104 +1,1104 @@
-------------------------------------------------------------------------
--- ddBase.decTest -- base decDouble <--> string conversions --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests base conversions from string to a decimal number
--- and back to a string (in Scientific form)
-
--- Note that unlike other operations the operand is subject to rounding
--- to conform to emax and precision settings (that is, numbers will
--- conform to rules and exponent will be in permitted range). The
--- 'left hand side', therefore, may have numbers that cannot be
--- represented in a decDouble. Some testcases go to the limit of the
--- next-wider format, and hence these testcases may also be used to
--- test narrowing and widening operations.
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddbas001 toSci 0 -> 0
-ddbas002 toSci 1 -> 1
-ddbas003 toSci 1.0 -> 1.0
-ddbas004 toSci 1.00 -> 1.00
-ddbas005 toSci 10 -> 10
-ddbas006 toSci 1000 -> 1000
-ddbas007 toSci 10.0 -> 10.0
-ddbas008 toSci 10.1 -> 10.1
-ddbas009 toSci 10.4 -> 10.4
-ddbas010 toSci 10.5 -> 10.5
-ddbas011 toSci 10.6 -> 10.6
-ddbas012 toSci 10.9 -> 10.9
-ddbas013 toSci 11.0 -> 11.0
-ddbas014 toSci 1.234 -> 1.234
-ddbas015 toSci 0.123 -> 0.123
-ddbas016 toSci 0.012 -> 0.012
-ddbas017 toSci -0 -> -0
-ddbas018 toSci -0.0 -> -0.0
-ddbas019 toSci -00.00 -> -0.00
-
-ddbas021 toSci -1 -> -1
-ddbas022 toSci -1.0 -> -1.0
-ddbas023 toSci -0.1 -> -0.1
-ddbas024 toSci -9.1 -> -9.1
-ddbas025 toSci -9.11 -> -9.11
-ddbas026 toSci -9.119 -> -9.119
-ddbas027 toSci -9.999 -> -9.999
-
-ddbas030 toSci '123456789.123456' -> '123456789.123456'
-ddbas031 toSci '123456789.000000' -> '123456789.000000'
-ddbas032 toSci '123456789123456' -> '123456789123456'
-ddbas033 toSci '0.0000123456789' -> '0.0000123456789'
-ddbas034 toSci '0.00000123456789' -> '0.00000123456789'
-ddbas035 toSci '0.000000123456789' -> '1.23456789E-7'
-ddbas036 toSci '0.0000000123456789' -> '1.23456789E-8'
-
-ddbas037 toSci '0.123456789012344' -> '0.123456789012344'
-ddbas038 toSci '0.123456789012345' -> '0.123456789012345'
-
--- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
-ddbsn001 toSci -9.999999999999999E+384 -> -9.999999999999999E+384
-ddbsn002 toSci -1E-383 -> -1E-383
-ddbsn003 toSci -1E-398 -> -1E-398 Subnormal
-ddbsn004 toSci -0 -> -0
-ddbsn005 toSci +0 -> 0
-ddbsn006 toSci +1E-398 -> 1E-398 Subnormal
-ddbsn007 toSci +1E-383 -> 1E-383
-ddbsn008 toSci +9.999999999999999E+384 -> 9.999999999999999E+384
-
--- String [many more examples are implicitly tested elsewhere]
--- strings without E cannot generate E in result
-ddbas040 toSci "12" -> '12'
-ddbas041 toSci "-76" -> '-76'
-ddbas042 toSci "12.76" -> '12.76'
-ddbas043 toSci "+12.76" -> '12.76'
-ddbas044 toSci "012.76" -> '12.76'
-ddbas045 toSci "+0.003" -> '0.003'
-ddbas046 toSci "17." -> '17'
-ddbas047 toSci ".5" -> '0.5'
-ddbas048 toSci "044" -> '44'
-ddbas049 toSci "0044" -> '44'
-ddbas050 toSci "0.0005" -> '0.0005'
-ddbas051 toSci "00.00005" -> '0.00005'
-ddbas052 toSci "0.000005" -> '0.000005'
-ddbas053 toSci "0.0000050" -> '0.0000050'
-ddbas054 toSci "0.0000005" -> '5E-7'
-ddbas055 toSci "0.00000005" -> '5E-8'
-ddbas056 toSci "12345678.543210" -> '12345678.543210'
-ddbas057 toSci "2345678.543210" -> '2345678.543210'
-ddbas058 toSci "345678.543210" -> '345678.543210'
-ddbas059 toSci "0345678.54321" -> '345678.54321'
-ddbas060 toSci "345678.5432" -> '345678.5432'
-ddbas061 toSci "+345678.5432" -> '345678.5432'
-ddbas062 toSci "+0345678.5432" -> '345678.5432'
-ddbas063 toSci "+00345678.5432" -> '345678.5432'
-ddbas064 toSci "-345678.5432" -> '-345678.5432'
-ddbas065 toSci "-0345678.5432" -> '-345678.5432'
-ddbas066 toSci "-00345678.5432" -> '-345678.5432'
--- examples
-ddbas067 toSci "5E-6" -> '0.000005'
-ddbas068 toSci "50E-7" -> '0.0000050'
-ddbas069 toSci "5E-7" -> '5E-7'
-
--- [No exotics as no Unicode]
-
--- rounded with dots in all (including edge) places
-ddbas071 toSci .1234567890123456123 -> 0.1234567890123456 Inexact Rounded
-ddbas072 toSci 1.234567890123456123 -> 1.234567890123456 Inexact Rounded
-ddbas073 toSci 12.34567890123456123 -> 12.34567890123456 Inexact Rounded
-ddbas074 toSci 123.4567890123456123 -> 123.4567890123456 Inexact Rounded
-ddbas075 toSci 1234.567890123456123 -> 1234.567890123456 Inexact Rounded
-ddbas076 toSci 12345.67890123456123 -> 12345.67890123456 Inexact Rounded
-ddbas077 toSci 123456.7890123456123 -> 123456.7890123456 Inexact Rounded
-ddbas078 toSci 1234567.890123456123 -> 1234567.890123456 Inexact Rounded
-ddbas079 toSci 12345678.90123456123 -> 12345678.90123456 Inexact Rounded
-ddbas080 toSci 123456789.0123456123 -> 123456789.0123456 Inexact Rounded
-ddbas081 toSci 1234567890.123456123 -> 1234567890.123456 Inexact Rounded
-ddbas082 toSci 12345678901.23456123 -> 12345678901.23456 Inexact Rounded
-ddbas083 toSci 123456789012.3456123 -> 123456789012.3456 Inexact Rounded
-ddbas084 toSci 1234567890123.456123 -> 1234567890123.456 Inexact Rounded
-ddbas085 toSci 12345678901234.56123 -> 12345678901234.56 Inexact Rounded
-ddbas086 toSci 123456789012345.6123 -> 123456789012345.6 Inexact Rounded
-ddbas087 toSci 1234567890123456.123 -> 1234567890123456 Inexact Rounded
-ddbas088 toSci 12345678901234561.23 -> 1.234567890123456E+16 Inexact Rounded
-ddbas089 toSci 123456789012345612.3 -> 1.234567890123456E+17 Inexact Rounded
-ddbas090 toSci 1234567890123456123. -> 1.234567890123456E+18 Inexact Rounded
-
-
--- Numbers with E
-ddbas130 toSci "0.000E-1" -> '0.0000'
-ddbas131 toSci "0.000E-2" -> '0.00000'
-ddbas132 toSci "0.000E-3" -> '0.000000'
-ddbas133 toSci "0.000E-4" -> '0E-7'
-ddbas134 toSci "0.00E-2" -> '0.0000'
-ddbas135 toSci "0.00E-3" -> '0.00000'
-ddbas136 toSci "0.00E-4" -> '0.000000'
-ddbas137 toSci "0.00E-5" -> '0E-7'
-ddbas138 toSci "+0E+9" -> '0E+9'
-ddbas139 toSci "-0E+9" -> '-0E+9'
-ddbas140 toSci "1E+9" -> '1E+9'
-ddbas141 toSci "1e+09" -> '1E+9'
-ddbas142 toSci "1E+90" -> '1E+90'
-ddbas143 toSci "+1E+009" -> '1E+9'
-ddbas144 toSci "0E+9" -> '0E+9'
-ddbas145 toSci "1E+9" -> '1E+9'
-ddbas146 toSci "1E+09" -> '1E+9'
-ddbas147 toSci "1e+90" -> '1E+90'
-ddbas148 toSci "1E+009" -> '1E+9'
-ddbas149 toSci "000E+9" -> '0E+9'
-ddbas150 toSci "1E9" -> '1E+9'
-ddbas151 toSci "1e09" -> '1E+9'
-ddbas152 toSci "1E90" -> '1E+90'
-ddbas153 toSci "1E009" -> '1E+9'
-ddbas154 toSci "0E9" -> '0E+9'
-ddbas155 toSci "0.000e+0" -> '0.000'
-ddbas156 toSci "0.000E-1" -> '0.0000'
-ddbas157 toSci "4E+9" -> '4E+9'
-ddbas158 toSci "44E+9" -> '4.4E+10'
-ddbas159 toSci "0.73e-7" -> '7.3E-8'
-ddbas160 toSci "00E+9" -> '0E+9'
-ddbas161 toSci "00E-9" -> '0E-9'
-ddbas162 toSci "10E+9" -> '1.0E+10'
-ddbas163 toSci "10E+09" -> '1.0E+10'
-ddbas164 toSci "10e+90" -> '1.0E+91'
-ddbas165 toSci "10E+009" -> '1.0E+10'
-ddbas166 toSci "100e+9" -> '1.00E+11'
-ddbas167 toSci "100e+09" -> '1.00E+11'
-ddbas168 toSci "100E+90" -> '1.00E+92'
-ddbas169 toSci "100e+009" -> '1.00E+11'
-
-ddbas170 toSci "1.265" -> '1.265'
-ddbas171 toSci "1.265E-20" -> '1.265E-20'
-ddbas172 toSci "1.265E-8" -> '1.265E-8'
-ddbas173 toSci "1.265E-4" -> '0.0001265'
-ddbas174 toSci "1.265E-3" -> '0.001265'
-ddbas175 toSci "1.265E-2" -> '0.01265'
-ddbas176 toSci "1.265E-1" -> '0.1265'
-ddbas177 toSci "1.265E-0" -> '1.265'
-ddbas178 toSci "1.265E+1" -> '12.65'
-ddbas179 toSci "1.265E+2" -> '126.5'
-ddbas180 toSci "1.265E+3" -> '1265'
-ddbas181 toSci "1.265E+4" -> '1.265E+4'
-ddbas182 toSci "1.265E+8" -> '1.265E+8'
-ddbas183 toSci "1.265E+20" -> '1.265E+20'
-
-ddbas190 toSci "12.65" -> '12.65'
-ddbas191 toSci "12.65E-20" -> '1.265E-19'
-ddbas192 toSci "12.65E-8" -> '1.265E-7'
-ddbas193 toSci "12.65E-4" -> '0.001265'
-ddbas194 toSci "12.65E-3" -> '0.01265'
-ddbas195 toSci "12.65E-2" -> '0.1265'
-ddbas196 toSci "12.65E-1" -> '1.265'
-ddbas197 toSci "12.65E-0" -> '12.65'
-ddbas198 toSci "12.65E+1" -> '126.5'
-ddbas199 toSci "12.65E+2" -> '1265'
-ddbas200 toSci "12.65E+3" -> '1.265E+4'
-ddbas201 toSci "12.65E+4" -> '1.265E+5'
-ddbas202 toSci "12.65E+8" -> '1.265E+9'
-ddbas203 toSci "12.65E+20" -> '1.265E+21'
-
-ddbas210 toSci "126.5" -> '126.5'
-ddbas211 toSci "126.5E-20" -> '1.265E-18'
-ddbas212 toSci "126.5E-8" -> '0.000001265'
-ddbas213 toSci "126.5E-4" -> '0.01265'
-ddbas214 toSci "126.5E-3" -> '0.1265'
-ddbas215 toSci "126.5E-2" -> '1.265'
-ddbas216 toSci "126.5E-1" -> '12.65'
-ddbas217 toSci "126.5E-0" -> '126.5'
-ddbas218 toSci "126.5E+1" -> '1265'
-ddbas219 toSci "126.5E+2" -> '1.265E+4'
-ddbas220 toSci "126.5E+3" -> '1.265E+5'
-ddbas221 toSci "126.5E+4" -> '1.265E+6'
-ddbas222 toSci "126.5E+8" -> '1.265E+10'
-ddbas223 toSci "126.5E+20" -> '1.265E+22'
-
-ddbas230 toSci "1265" -> '1265'
-ddbas231 toSci "1265E-20" -> '1.265E-17'
-ddbas232 toSci "1265E-8" -> '0.00001265'
-ddbas233 toSci "1265E-4" -> '0.1265'
-ddbas234 toSci "1265E-3" -> '1.265'
-ddbas235 toSci "1265E-2" -> '12.65'
-ddbas236 toSci "1265E-1" -> '126.5'
-ddbas237 toSci "1265E-0" -> '1265'
-ddbas238 toSci "1265E+1" -> '1.265E+4'
-ddbas239 toSci "1265E+2" -> '1.265E+5'
-ddbas240 toSci "1265E+3" -> '1.265E+6'
-ddbas241 toSci "1265E+4" -> '1.265E+7'
-ddbas242 toSci "1265E+8" -> '1.265E+11'
-ddbas243 toSci "1265E+20" -> '1.265E+23'
-ddbas244 toSci "1265E-9" -> '0.000001265'
-ddbas245 toSci "1265E-10" -> '1.265E-7'
-ddbas246 toSci "1265E-11" -> '1.265E-8'
-ddbas247 toSci "1265E-12" -> '1.265E-9'
-
-ddbas250 toSci "0.1265" -> '0.1265'
-ddbas251 toSci "0.1265E-20" -> '1.265E-21'
-ddbas252 toSci "0.1265E-8" -> '1.265E-9'
-ddbas253 toSci "0.1265E-4" -> '0.00001265'
-ddbas254 toSci "0.1265E-3" -> '0.0001265'
-ddbas255 toSci "0.1265E-2" -> '0.001265'
-ddbas256 toSci "0.1265E-1" -> '0.01265'
-ddbas257 toSci "0.1265E-0" -> '0.1265'
-ddbas258 toSci "0.1265E+1" -> '1.265'
-ddbas259 toSci "0.1265E+2" -> '12.65'
-ddbas260 toSci "0.1265E+3" -> '126.5'
-ddbas261 toSci "0.1265E+4" -> '1265'
-ddbas262 toSci "0.1265E+8" -> '1.265E+7'
-ddbas263 toSci "0.1265E+20" -> '1.265E+19'
-
--- some more negative zeros [systematic tests below]
-ddbas290 toSci "-0.000E-1" -> '-0.0000'
-ddbas291 toSci "-0.000E-2" -> '-0.00000'
-ddbas292 toSci "-0.000E-3" -> '-0.000000'
-ddbas293 toSci "-0.000E-4" -> '-0E-7'
-ddbas294 toSci "-0.00E-2" -> '-0.0000'
-ddbas295 toSci "-0.00E-3" -> '-0.00000'
-ddbas296 toSci "-0.0E-2" -> '-0.000'
-ddbas297 toSci "-0.0E-3" -> '-0.0000'
-ddbas298 toSci "-0E-2" -> '-0.00'
-ddbas299 toSci "-0E-3" -> '-0.000'
-
--- Engineering notation tests
-ddbas301 toSci 10e12 -> 1.0E+13
-ddbas302 toEng 10e12 -> 10E+12
-ddbas303 toSci 10e11 -> 1.0E+12
-ddbas304 toEng 10e11 -> 1.0E+12
-ddbas305 toSci 10e10 -> 1.0E+11
-ddbas306 toEng 10e10 -> 100E+9
-ddbas307 toSci 10e9 -> 1.0E+10
-ddbas308 toEng 10e9 -> 10E+9
-ddbas309 toSci 10e8 -> 1.0E+9
-ddbas310 toEng 10e8 -> 1.0E+9
-ddbas311 toSci 10e7 -> 1.0E+8
-ddbas312 toEng 10e7 -> 100E+6
-ddbas313 toSci 10e6 -> 1.0E+7
-ddbas314 toEng 10e6 -> 10E+6
-ddbas315 toSci 10e5 -> 1.0E+6
-ddbas316 toEng 10e5 -> 1.0E+6
-ddbas317 toSci 10e4 -> 1.0E+5
-ddbas318 toEng 10e4 -> 100E+3
-ddbas319 toSci 10e3 -> 1.0E+4
-ddbas320 toEng 10e3 -> 10E+3
-ddbas321 toSci 10e2 -> 1.0E+3
-ddbas322 toEng 10e2 -> 1.0E+3
-ddbas323 toSci 10e1 -> 1.0E+2
-ddbas324 toEng 10e1 -> 100
-ddbas325 toSci 10e0 -> 10
-ddbas326 toEng 10e0 -> 10
-ddbas327 toSci 10e-1 -> 1.0
-ddbas328 toEng 10e-1 -> 1.0
-ddbas329 toSci 10e-2 -> 0.10
-ddbas330 toEng 10e-2 -> 0.10
-ddbas331 toSci 10e-3 -> 0.010
-ddbas332 toEng 10e-3 -> 0.010
-ddbas333 toSci 10e-4 -> 0.0010
-ddbas334 toEng 10e-4 -> 0.0010
-ddbas335 toSci 10e-5 -> 0.00010
-ddbas336 toEng 10e-5 -> 0.00010
-ddbas337 toSci 10e-6 -> 0.000010
-ddbas338 toEng 10e-6 -> 0.000010
-ddbas339 toSci 10e-7 -> 0.0000010
-ddbas340 toEng 10e-7 -> 0.0000010
-ddbas341 toSci 10e-8 -> 1.0E-7
-ddbas342 toEng 10e-8 -> 100E-9
-ddbas343 toSci 10e-9 -> 1.0E-8
-ddbas344 toEng 10e-9 -> 10E-9
-ddbas345 toSci 10e-10 -> 1.0E-9
-ddbas346 toEng 10e-10 -> 1.0E-9
-ddbas347 toSci 10e-11 -> 1.0E-10
-ddbas348 toEng 10e-11 -> 100E-12
-ddbas349 toSci 10e-12 -> 1.0E-11
-ddbas350 toEng 10e-12 -> 10E-12
-ddbas351 toSci 10e-13 -> 1.0E-12
-ddbas352 toEng 10e-13 -> 1.0E-12
-
-ddbas361 toSci 7E12 -> 7E+12
-ddbas362 toEng 7E12 -> 7E+12
-ddbas363 toSci 7E11 -> 7E+11
-ddbas364 toEng 7E11 -> 700E+9
-ddbas365 toSci 7E10 -> 7E+10
-ddbas366 toEng 7E10 -> 70E+9
-ddbas367 toSci 7E9 -> 7E+9
-ddbas368 toEng 7E9 -> 7E+9
-ddbas369 toSci 7E8 -> 7E+8
-ddbas370 toEng 7E8 -> 700E+6
-ddbas371 toSci 7E7 -> 7E+7
-ddbas372 toEng 7E7 -> 70E+6
-ddbas373 toSci 7E6 -> 7E+6
-ddbas374 toEng 7E6 -> 7E+6
-ddbas375 toSci 7E5 -> 7E+5
-ddbas376 toEng 7E5 -> 700E+3
-ddbas377 toSci 7E4 -> 7E+4
-ddbas378 toEng 7E4 -> 70E+3
-ddbas379 toSci 7E3 -> 7E+3
-ddbas380 toEng 7E3 -> 7E+3
-ddbas381 toSci 7E2 -> 7E+2
-ddbas382 toEng 7E2 -> 700
-ddbas383 toSci 7E1 -> 7E+1
-ddbas384 toEng 7E1 -> 70
-ddbas385 toSci 7E0 -> 7
-ddbas386 toEng 7E0 -> 7
-ddbas387 toSci 7E-1 -> 0.7
-ddbas388 toEng 7E-1 -> 0.7
-ddbas389 toSci 7E-2 -> 0.07
-ddbas390 toEng 7E-2 -> 0.07
-ddbas391 toSci 7E-3 -> 0.007
-ddbas392 toEng 7E-3 -> 0.007
-ddbas393 toSci 7E-4 -> 0.0007
-ddbas394 toEng 7E-4 -> 0.0007
-ddbas395 toSci 7E-5 -> 0.00007
-ddbas396 toEng 7E-5 -> 0.00007
-ddbas397 toSci 7E-6 -> 0.000007
-ddbas398 toEng 7E-6 -> 0.000007
-ddbas399 toSci 7E-7 -> 7E-7
-ddbas400 toEng 7E-7 -> 700E-9
-ddbas401 toSci 7E-8 -> 7E-8
-ddbas402 toEng 7E-8 -> 70E-9
-ddbas403 toSci 7E-9 -> 7E-9
-ddbas404 toEng 7E-9 -> 7E-9
-ddbas405 toSci 7E-10 -> 7E-10
-ddbas406 toEng 7E-10 -> 700E-12
-ddbas407 toSci 7E-11 -> 7E-11
-ddbas408 toEng 7E-11 -> 70E-12
-ddbas409 toSci 7E-12 -> 7E-12
-ddbas410 toEng 7E-12 -> 7E-12
-ddbas411 toSci 7E-13 -> 7E-13
-ddbas412 toEng 7E-13 -> 700E-15
-
--- Exacts remain exact up to precision ..
-rounding: half_up
-ddbas420 toSci 100 -> 100
-ddbas421 toEng 100 -> 100
-ddbas422 toSci 1000 -> 1000
-ddbas423 toEng 1000 -> 1000
-ddbas424 toSci 999.9 -> 999.9
-ddbas425 toEng 999.9 -> 999.9
-ddbas426 toSci 1000.0 -> 1000.0
-ddbas427 toEng 1000.0 -> 1000.0
-ddbas428 toSci 1000.1 -> 1000.1
-ddbas429 toEng 1000.1 -> 1000.1
-ddbas430 toSci 10000 -> 10000
-ddbas431 toEng 10000 -> 10000
-ddbas432 toSci 100000 -> 100000
-ddbas433 toEng 100000 -> 100000
-ddbas434 toSci 1000000 -> 1000000
-ddbas435 toEng 1000000 -> 1000000
-ddbas436 toSci 10000000 -> 10000000
-ddbas437 toEng 10000000 -> 10000000
-ddbas438 toSci 100000000 -> 100000000
-ddbas439 toEng 1000000000000000 -> 1000000000000000
-ddbas440 toSci 10000000000000000 -> 1.000000000000000E+16 Rounded
-ddbas441 toEng 10000000000000000 -> 10.00000000000000E+15 Rounded
-ddbas442 toSci 10000000000000001 -> 1.000000000000000E+16 Rounded Inexact
-ddbas443 toEng 10000000000000001 -> 10.00000000000000E+15 Rounded Inexact
-ddbas444 toSci 10000000000000003 -> 1.000000000000000E+16 Rounded Inexact
-ddbas445 toEng 10000000000000003 -> 10.00000000000000E+15 Rounded Inexact
-ddbas446 toSci 10000000000000005 -> 1.000000000000001E+16 Rounded Inexact
-ddbas447 toEng 10000000000000005 -> 10.00000000000001E+15 Rounded Inexact
-ddbas448 toSci 100000000000000050 -> 1.000000000000001E+17 Rounded Inexact
-ddbas449 toEng 100000000000000050 -> 100.0000000000001E+15 Rounded Inexact
-ddbas450 toSci 10000000000000009 -> 1.000000000000001E+16 Rounded Inexact
-ddbas451 toEng 10000000000000009 -> 10.00000000000001E+15 Rounded Inexact
-ddbas452 toSci 100000000000000000 -> 1.000000000000000E+17 Rounded
-ddbas453 toEng 100000000000000000 -> 100.0000000000000E+15 Rounded
-ddbas454 toSci 100000000000000003 -> 1.000000000000000E+17 Rounded Inexact
-ddbas455 toEng 100000000000000003 -> 100.0000000000000E+15 Rounded Inexact
-ddbas456 toSci 100000000000000005 -> 1.000000000000000E+17 Rounded Inexact
-ddbas457 toEng 100000000000000005 -> 100.0000000000000E+15 Rounded Inexact
-ddbas458 toSci 100000000000000009 -> 1.000000000000000E+17 Rounded Inexact
-ddbas459 toEng 100000000000000009 -> 100.0000000000000E+15 Rounded Inexact
-ddbas460 toSci 1000000000000000000 -> 1.000000000000000E+18 Rounded
-ddbas461 toEng 1000000000000000000 -> 1.000000000000000E+18 Rounded
-ddbas462 toSci 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact
-ddbas463 toEng 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact
-ddbas464 toSci 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact
-ddbas465 toEng 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact
-ddbas466 toSci 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact
-ddbas467 toEng 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact
-ddbas468 toSci 10000000000000000000 -> 1.000000000000000E+19 Rounded
-ddbas469 toEng 10000000000000000000 -> 10.00000000000000E+18 Rounded
-ddbas470 toSci 10000000000000003000 -> 1.000000000000000E+19 Rounded Inexact
-ddbas471 toEng 10000000000000003000 -> 10.00000000000000E+18 Rounded Inexact
-ddbas472 toSci 10000000000000005000 -> 1.000000000000001E+19 Rounded Inexact
-ddbas473 toEng 10000000000000005000 -> 10.00000000000001E+18 Rounded Inexact
-ddbas474 toSci 10000000000000009000 -> 1.000000000000001E+19 Rounded Inexact
-ddbas475 toEng 10000000000000009000 -> 10.00000000000001E+18 Rounded Inexact
-
--- check rounding modes heeded
-rounding: ceiling
-ddbsr401 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr402 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact
-ddbsr403 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
-ddbsr404 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
-rounding: up
-ddbsr405 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr406 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact
-ddbsr407 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
-ddbsr408 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
-rounding: floor
-ddbsr410 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr411 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr412 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
-ddbsr413 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact
-rounding: half_down
-ddbsr415 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr416 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr417 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
-ddbsr418 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact
-ddbsr419 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
-rounding: half_even
-ddbsr421 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr422 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr423 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
-ddbsr424 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact
-ddbsr425 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
-rounding: down
-ddbsr426 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr427 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr428 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
-ddbsr429 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact
-rounding: half_up
-ddbsr431 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr432 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr433 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
-ddbsr434 toSci 1.11111111111234650 -> 1.111111111112347 Rounded Inexact
-ddbsr435 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
--- negatives
-rounding: ceiling
-ddbsr501 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr502 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr503 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
-ddbsr504 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact
-rounding: up
-ddbsr505 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr506 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact
-ddbsr507 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
-ddbsr508 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-rounding: floor
-ddbsr510 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr511 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact
-ddbsr512 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
-ddbsr513 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-rounding: half_down
-ddbsr515 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr516 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr517 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
-ddbsr518 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact
-ddbsr519 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-rounding: half_even
-ddbsr521 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr522 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr523 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
-ddbsr524 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact
-ddbsr525 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-rounding: down
-ddbsr526 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr527 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr528 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
-ddbsr529 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact
-rounding: half_up
-ddbsr531 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr532 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr533 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
-ddbsr534 toSci -1.11111111111234650 -> -1.111111111112347 Rounded Inexact
-ddbsr535 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-
-rounding: half_even
-
--- The 'baddies' tests from DiagBigDecimal, plus some new ones
-ddbas500 toSci '1..2' -> NaN Conversion_syntax
-ddbas501 toSci '.' -> NaN Conversion_syntax
-ddbas502 toSci '..' -> NaN Conversion_syntax
-ddbas503 toSci '++1' -> NaN Conversion_syntax
-ddbas504 toSci '--1' -> NaN Conversion_syntax
-ddbas505 toSci '-+1' -> NaN Conversion_syntax
-ddbas506 toSci '+-1' -> NaN Conversion_syntax
-ddbas507 toSci '12e' -> NaN Conversion_syntax
-ddbas508 toSci '12e++' -> NaN Conversion_syntax
-ddbas509 toSci '12f4' -> NaN Conversion_syntax
-ddbas510 toSci ' +1' -> NaN Conversion_syntax
-ddbas511 toSci '+ 1' -> NaN Conversion_syntax
-ddbas512 toSci '12 ' -> NaN Conversion_syntax
-ddbas513 toSci ' + 1' -> NaN Conversion_syntax
-ddbas514 toSci ' - 1 ' -> NaN Conversion_syntax
-ddbas515 toSci 'x' -> NaN Conversion_syntax
-ddbas516 toSci '-1-' -> NaN Conversion_syntax
-ddbas517 toSci '12-' -> NaN Conversion_syntax
-ddbas518 toSci '3+' -> NaN Conversion_syntax
-ddbas519 toSci '' -> NaN Conversion_syntax
-ddbas520 toSci '1e-' -> NaN Conversion_syntax
-ddbas521 toSci '7e99999a' -> NaN Conversion_syntax
-ddbas522 toSci '7e123567890x' -> NaN Conversion_syntax
-ddbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
-ddbas524 toSci '' -> NaN Conversion_syntax
-ddbas525 toSci 'e100' -> NaN Conversion_syntax
-ddbas526 toSci '\u0e5a' -> NaN Conversion_syntax
-ddbas527 toSci '\u0b65' -> NaN Conversion_syntax
-ddbas528 toSci '123,65' -> NaN Conversion_syntax
-ddbas529 toSci '1.34.5' -> NaN Conversion_syntax
-ddbas530 toSci '.123.5' -> NaN Conversion_syntax
-ddbas531 toSci '01.35.' -> NaN Conversion_syntax
-ddbas532 toSci '01.35-' -> NaN Conversion_syntax
-ddbas533 toSci '0000..' -> NaN Conversion_syntax
-ddbas534 toSci '.0000.' -> NaN Conversion_syntax
-ddbas535 toSci '00..00' -> NaN Conversion_syntax
-ddbas536 toSci '111e*123' -> NaN Conversion_syntax
-ddbas537 toSci '111e123-' -> NaN Conversion_syntax
-ddbas538 toSci '111e+12+' -> NaN Conversion_syntax
-ddbas539 toSci '111e1-3-' -> NaN Conversion_syntax
-ddbas540 toSci '111e1*23' -> NaN Conversion_syntax
-ddbas541 toSci '111e1e+3' -> NaN Conversion_syntax
-ddbas542 toSci '1e1.0' -> NaN Conversion_syntax
-ddbas543 toSci '1e123e' -> NaN Conversion_syntax
-ddbas544 toSci 'ten' -> NaN Conversion_syntax
-ddbas545 toSci 'ONE' -> NaN Conversion_syntax
-ddbas546 toSci '1e.1' -> NaN Conversion_syntax
-ddbas547 toSci '1e1.' -> NaN Conversion_syntax
-ddbas548 toSci '1ee' -> NaN Conversion_syntax
-ddbas549 toSci 'e+1' -> NaN Conversion_syntax
-ddbas550 toSci '1.23.4' -> NaN Conversion_syntax
-ddbas551 toSci '1.2.1' -> NaN Conversion_syntax
-ddbas552 toSci '1E+1.2' -> NaN Conversion_syntax
-ddbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
-ddbas554 toSci '1E++1' -> NaN Conversion_syntax
-ddbas555 toSci '1E--1' -> NaN Conversion_syntax
-ddbas556 toSci '1E+-1' -> NaN Conversion_syntax
-ddbas557 toSci '1E-+1' -> NaN Conversion_syntax
-ddbas558 toSci '1E''1' -> NaN Conversion_syntax
-ddbas559 toSci "1E""1" -> NaN Conversion_syntax
-ddbas560 toSci "1E""""" -> NaN Conversion_syntax
--- Near-specials
-ddbas561 toSci "qNaN" -> NaN Conversion_syntax
-ddbas562 toSci "NaNq" -> NaN Conversion_syntax
-ddbas563 toSci "NaNs" -> NaN Conversion_syntax
-ddbas564 toSci "Infi" -> NaN Conversion_syntax
-ddbas565 toSci "Infin" -> NaN Conversion_syntax
-ddbas566 toSci "Infini" -> NaN Conversion_syntax
-ddbas567 toSci "Infinit" -> NaN Conversion_syntax
-ddbas568 toSci "-Infinit" -> NaN Conversion_syntax
-ddbas569 toSci "0Inf" -> NaN Conversion_syntax
-ddbas570 toSci "9Inf" -> NaN Conversion_syntax
-ddbas571 toSci "-0Inf" -> NaN Conversion_syntax
-ddbas572 toSci "-9Inf" -> NaN Conversion_syntax
-ddbas573 toSci "-sNa" -> NaN Conversion_syntax
-ddbas574 toSci "xNaN" -> NaN Conversion_syntax
-ddbas575 toSci "0sNaN" -> NaN Conversion_syntax
-
--- some baddies with dots and Es and dots and specials
-ddbas576 toSci 'e+1' -> NaN Conversion_syntax
-ddbas577 toSci '.e+1' -> NaN Conversion_syntax
-ddbas578 toSci '+.e+1' -> NaN Conversion_syntax
-ddbas579 toSci '-.e+' -> NaN Conversion_syntax
-ddbas580 toSci '-.e' -> NaN Conversion_syntax
-ddbas581 toSci 'E+1' -> NaN Conversion_syntax
-ddbas582 toSci '.E+1' -> NaN Conversion_syntax
-ddbas583 toSci '+.E+1' -> NaN Conversion_syntax
-ddbas584 toSci '-.E+' -> NaN Conversion_syntax
-ddbas585 toSci '-.E' -> NaN Conversion_syntax
-
-ddbas586 toSci '.NaN' -> NaN Conversion_syntax
-ddbas587 toSci '-.NaN' -> NaN Conversion_syntax
-ddbas588 toSci '+.sNaN' -> NaN Conversion_syntax
-ddbas589 toSci '+.Inf' -> NaN Conversion_syntax
-ddbas590 toSci '.Infinity' -> NaN Conversion_syntax
-
--- Zeros
-ddbas601 toSci 0.000000000 -> 0E-9
-ddbas602 toSci 0.00000000 -> 0E-8
-ddbas603 toSci 0.0000000 -> 0E-7
-ddbas604 toSci 0.000000 -> 0.000000
-ddbas605 toSci 0.00000 -> 0.00000
-ddbas606 toSci 0.0000 -> 0.0000
-ddbas607 toSci 0.000 -> 0.000
-ddbas608 toSci 0.00 -> 0.00
-ddbas609 toSci 0.0 -> 0.0
-ddbas610 toSci .0 -> 0.0
-ddbas611 toSci 0. -> 0
-ddbas612 toSci -.0 -> -0.0
-ddbas613 toSci -0. -> -0
-ddbas614 toSci -0.0 -> -0.0
-ddbas615 toSci -0.00 -> -0.00
-ddbas616 toSci -0.000 -> -0.000
-ddbas617 toSci -0.0000 -> -0.0000
-ddbas618 toSci -0.00000 -> -0.00000
-ddbas619 toSci -0.000000 -> -0.000000
-ddbas620 toSci -0.0000000 -> -0E-7
-ddbas621 toSci -0.00000000 -> -0E-8
-ddbas622 toSci -0.000000000 -> -0E-9
-
-ddbas630 toSci 0.00E+0 -> 0.00
-ddbas631 toSci 0.00E+1 -> 0.0
-ddbas632 toSci 0.00E+2 -> 0
-ddbas633 toSci 0.00E+3 -> 0E+1
-ddbas634 toSci 0.00E+4 -> 0E+2
-ddbas635 toSci 0.00E+5 -> 0E+3
-ddbas636 toSci 0.00E+6 -> 0E+4
-ddbas637 toSci 0.00E+7 -> 0E+5
-ddbas638 toSci 0.00E+8 -> 0E+6
-ddbas639 toSci 0.00E+9 -> 0E+7
-
-ddbas640 toSci 0.0E+0 -> 0.0
-ddbas641 toSci 0.0E+1 -> 0
-ddbas642 toSci 0.0E+2 -> 0E+1
-ddbas643 toSci 0.0E+3 -> 0E+2
-ddbas644 toSci 0.0E+4 -> 0E+3
-ddbas645 toSci 0.0E+5 -> 0E+4
-ddbas646 toSci 0.0E+6 -> 0E+5
-ddbas647 toSci 0.0E+7 -> 0E+6
-ddbas648 toSci 0.0E+8 -> 0E+7
-ddbas649 toSci 0.0E+9 -> 0E+8
-
-ddbas650 toSci 0E+0 -> 0
-ddbas651 toSci 0E+1 -> 0E+1
-ddbas652 toSci 0E+2 -> 0E+2
-ddbas653 toSci 0E+3 -> 0E+3
-ddbas654 toSci 0E+4 -> 0E+4
-ddbas655 toSci 0E+5 -> 0E+5
-ddbas656 toSci 0E+6 -> 0E+6
-ddbas657 toSci 0E+7 -> 0E+7
-ddbas658 toSci 0E+8 -> 0E+8
-ddbas659 toSci 0E+9 -> 0E+9
-
-ddbas660 toSci 0.0E-0 -> 0.0
-ddbas661 toSci 0.0E-1 -> 0.00
-ddbas662 toSci 0.0E-2 -> 0.000
-ddbas663 toSci 0.0E-3 -> 0.0000
-ddbas664 toSci 0.0E-4 -> 0.00000
-ddbas665 toSci 0.0E-5 -> 0.000000
-ddbas666 toSci 0.0E-6 -> 0E-7
-ddbas667 toSci 0.0E-7 -> 0E-8
-ddbas668 toSci 0.0E-8 -> 0E-9
-ddbas669 toSci 0.0E-9 -> 0E-10
-
-ddbas670 toSci 0.00E-0 -> 0.00
-ddbas671 toSci 0.00E-1 -> 0.000
-ddbas672 toSci 0.00E-2 -> 0.0000
-ddbas673 toSci 0.00E-3 -> 0.00000
-ddbas674 toSci 0.00E-4 -> 0.000000
-ddbas675 toSci 0.00E-5 -> 0E-7
-ddbas676 toSci 0.00E-6 -> 0E-8
-ddbas677 toSci 0.00E-7 -> 0E-9
-ddbas678 toSci 0.00E-8 -> 0E-10
-ddbas679 toSci 0.00E-9 -> 0E-11
-
-ddbas680 toSci 000000. -> 0
-ddbas681 toSci 00000. -> 0
-ddbas682 toSci 0000. -> 0
-ddbas683 toSci 000. -> 0
-ddbas684 toSci 00. -> 0
-ddbas685 toSci 0. -> 0
-ddbas686 toSci +00000. -> 0
-ddbas687 toSci -00000. -> -0
-ddbas688 toSci +0. -> 0
-ddbas689 toSci -0. -> -0
-
--- Specials
-ddbas700 toSci "NaN" -> NaN
-ddbas701 toSci "nan" -> NaN
-ddbas702 toSci "nAn" -> NaN
-ddbas703 toSci "NAN" -> NaN
-ddbas704 toSci "+NaN" -> NaN
-ddbas705 toSci "+nan" -> NaN
-ddbas706 toSci "+nAn" -> NaN
-ddbas707 toSci "+NAN" -> NaN
-ddbas708 toSci "-NaN" -> -NaN
-ddbas709 toSci "-nan" -> -NaN
-ddbas710 toSci "-nAn" -> -NaN
-ddbas711 toSci "-NAN" -> -NaN
-ddbas712 toSci 'NaN0' -> NaN
-ddbas713 toSci 'NaN1' -> NaN1
-ddbas714 toSci 'NaN12' -> NaN12
-ddbas715 toSci 'NaN123' -> NaN123
-ddbas716 toSci 'NaN1234' -> NaN1234
-ddbas717 toSci 'NaN01' -> NaN1
-ddbas718 toSci 'NaN012' -> NaN12
-ddbas719 toSci 'NaN0123' -> NaN123
-ddbas720 toSci 'NaN01234' -> NaN1234
-ddbas721 toSci 'NaN001' -> NaN1
-ddbas722 toSci 'NaN0012' -> NaN12
-ddbas723 toSci 'NaN00123' -> NaN123
-ddbas724 toSci 'NaN001234' -> NaN1234
-ddbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax
-ddbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
-ddbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
-ddbas728 toSci 'NaN-12' -> NaN Conversion_syntax
-ddbas729 toSci 'NaN+12' -> NaN Conversion_syntax
-
-ddbas730 toSci "sNaN" -> sNaN
-ddbas731 toSci "snan" -> sNaN
-ddbas732 toSci "SnAn" -> sNaN
-ddbas733 toSci "SNAN" -> sNaN
-ddbas734 toSci "+sNaN" -> sNaN
-ddbas735 toSci "+snan" -> sNaN
-ddbas736 toSci "+SnAn" -> sNaN
-ddbas737 toSci "+SNAN" -> sNaN
-ddbas738 toSci "-sNaN" -> -sNaN
-ddbas739 toSci "-snan" -> -sNaN
-ddbas740 toSci "-SnAn" -> -sNaN
-ddbas741 toSci "-SNAN" -> -sNaN
-ddbas742 toSci 'sNaN0000' -> sNaN
-ddbas743 toSci 'sNaN7' -> sNaN7
-ddbas744 toSci 'sNaN007234' -> sNaN7234
-ddbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax
-ddbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
-ddbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
-
-ddbas748 toSci "Inf" -> Infinity
-ddbas749 toSci "inf" -> Infinity
-ddbas750 toSci "iNf" -> Infinity
-ddbas751 toSci "INF" -> Infinity
-ddbas752 toSci "+Inf" -> Infinity
-ddbas753 toSci "+inf" -> Infinity
-ddbas754 toSci "+iNf" -> Infinity
-ddbas755 toSci "+INF" -> Infinity
-ddbas756 toSci "-Inf" -> -Infinity
-ddbas757 toSci "-inf" -> -Infinity
-ddbas758 toSci "-iNf" -> -Infinity
-ddbas759 toSci "-INF" -> -Infinity
-
-ddbas760 toSci "Infinity" -> Infinity
-ddbas761 toSci "infinity" -> Infinity
-ddbas762 toSci "iNfInItY" -> Infinity
-ddbas763 toSci "INFINITY" -> Infinity
-ddbas764 toSci "+Infinity" -> Infinity
-ddbas765 toSci "+infinity" -> Infinity
-ddbas766 toSci "+iNfInItY" -> Infinity
-ddbas767 toSci "+INFINITY" -> Infinity
-ddbas768 toSci "-Infinity" -> -Infinity
-ddbas769 toSci "-infinity" -> -Infinity
-ddbas770 toSci "-iNfInItY" -> -Infinity
-ddbas771 toSci "-INFINITY" -> -Infinity
-
--- Specials and zeros for toEng
-ddbast772 toEng "NaN" -> NaN
-ddbast773 toEng "-Infinity" -> -Infinity
-ddbast774 toEng "-sNaN" -> -sNaN
-ddbast775 toEng "-NaN" -> -NaN
-ddbast776 toEng "+Infinity" -> Infinity
-ddbast778 toEng "+sNaN" -> sNaN
-ddbast779 toEng "+NaN" -> NaN
-ddbast780 toEng "INFINITY" -> Infinity
-ddbast781 toEng "SNAN" -> sNaN
-ddbast782 toEng "NAN" -> NaN
-ddbast783 toEng "infinity" -> Infinity
-ddbast784 toEng "snan" -> sNaN
-ddbast785 toEng "nan" -> NaN
-ddbast786 toEng "InFINITY" -> Infinity
-ddbast787 toEng "SnAN" -> sNaN
-ddbast788 toEng "nAN" -> NaN
-ddbast789 toEng "iNfinity" -> Infinity
-ddbast790 toEng "sNan" -> sNaN
-ddbast791 toEng "Nan" -> NaN
-ddbast792 toEng "Infinity" -> Infinity
-ddbast793 toEng "sNaN" -> sNaN
-
--- Zero toEng, etc.
-ddbast800 toEng 0e+1 -> "0.00E+3" -- doc example
-
-ddbast801 toEng 0.000000000 -> 0E-9
-ddbast802 toEng 0.00000000 -> 0.00E-6
-ddbast803 toEng 0.0000000 -> 0.0E-6
-ddbast804 toEng 0.000000 -> 0.000000
-ddbast805 toEng 0.00000 -> 0.00000
-ddbast806 toEng 0.0000 -> 0.0000
-ddbast807 toEng 0.000 -> 0.000
-ddbast808 toEng 0.00 -> 0.00
-ddbast809 toEng 0.0 -> 0.0
-ddbast810 toEng .0 -> 0.0
-ddbast811 toEng 0. -> 0
-ddbast812 toEng -.0 -> -0.0
-ddbast813 toEng -0. -> -0
-ddbast814 toEng -0.0 -> -0.0
-ddbast815 toEng -0.00 -> -0.00
-ddbast816 toEng -0.000 -> -0.000
-ddbast817 toEng -0.0000 -> -0.0000
-ddbast818 toEng -0.00000 -> -0.00000
-ddbast819 toEng -0.000000 -> -0.000000
-ddbast820 toEng -0.0000000 -> -0.0E-6
-ddbast821 toEng -0.00000000 -> -0.00E-6
-ddbast822 toEng -0.000000000 -> -0E-9
-
-ddbast830 toEng 0.00E+0 -> 0.00
-ddbast831 toEng 0.00E+1 -> 0.0
-ddbast832 toEng 0.00E+2 -> 0
-ddbast833 toEng 0.00E+3 -> 0.00E+3
-ddbast834 toEng 0.00E+4 -> 0.0E+3
-ddbast835 toEng 0.00E+5 -> 0E+3
-ddbast836 toEng 0.00E+6 -> 0.00E+6
-ddbast837 toEng 0.00E+7 -> 0.0E+6
-ddbast838 toEng 0.00E+8 -> 0E+6
-ddbast839 toEng 0.00E+9 -> 0.00E+9
-
-ddbast840 toEng 0.0E+0 -> 0.0
-ddbast841 toEng 0.0E+1 -> 0
-ddbast842 toEng 0.0E+2 -> 0.00E+3
-ddbast843 toEng 0.0E+3 -> 0.0E+3
-ddbast844 toEng 0.0E+4 -> 0E+3
-ddbast845 toEng 0.0E+5 -> 0.00E+6
-ddbast846 toEng 0.0E+6 -> 0.0E+6
-ddbast847 toEng 0.0E+7 -> 0E+6
-ddbast848 toEng 0.0E+8 -> 0.00E+9
-ddbast849 toEng 0.0E+9 -> 0.0E+9
-
-ddbast850 toEng 0E+0 -> 0
-ddbast851 toEng 0E+1 -> 0.00E+3
-ddbast852 toEng 0E+2 -> 0.0E+3
-ddbast853 toEng 0E+3 -> 0E+3
-ddbast854 toEng 0E+4 -> 0.00E+6
-ddbast855 toEng 0E+5 -> 0.0E+6
-ddbast856 toEng 0E+6 -> 0E+6
-ddbast857 toEng 0E+7 -> 0.00E+9
-ddbast858 toEng 0E+8 -> 0.0E+9
-ddbast859 toEng 0E+9 -> 0E+9
-
-ddbast860 toEng 0.0E-0 -> 0.0
-ddbast861 toEng 0.0E-1 -> 0.00
-ddbast862 toEng 0.0E-2 -> 0.000
-ddbast863 toEng 0.0E-3 -> 0.0000
-ddbast864 toEng 0.0E-4 -> 0.00000
-ddbast865 toEng 0.0E-5 -> 0.000000
-ddbast866 toEng 0.0E-6 -> 0.0E-6
-ddbast867 toEng 0.0E-7 -> 0.00E-6
-ddbast868 toEng 0.0E-8 -> 0E-9
-ddbast869 toEng 0.0E-9 -> 0.0E-9
-
-ddbast870 toEng 0.00E-0 -> 0.00
-ddbast871 toEng 0.00E-1 -> 0.000
-ddbast872 toEng 0.00E-2 -> 0.0000
-ddbast873 toEng 0.00E-3 -> 0.00000
-ddbast874 toEng 0.00E-4 -> 0.000000
-ddbast875 toEng 0.00E-5 -> 0.0E-6
-ddbast876 toEng 0.00E-6 -> 0.00E-6
-ddbast877 toEng 0.00E-7 -> 0E-9
-ddbast878 toEng 0.00E-8 -> 0.0E-9
-ddbast879 toEng 0.00E-9 -> 0.00E-9
-
--- long input strings
-ddbas801 tosci '01234567890123456' -> 1234567890123456
-ddbas802 tosci '001234567890123456' -> 1234567890123456
-ddbas803 tosci '0001234567890123456' -> 1234567890123456
-ddbas804 tosci '00001234567890123456' -> 1234567890123456
-ddbas805 tosci '000001234567890123456' -> 1234567890123456
-ddbas806 tosci '0000001234567890123456' -> 1234567890123456
-ddbas807 tosci '00000001234567890123456' -> 1234567890123456
-ddbas808 tosci '000000001234567890123456' -> 1234567890123456
-ddbas809 tosci '0000000001234567890123456' -> 1234567890123456
-ddbas810 tosci '00000000001234567890123456' -> 1234567890123456
-
-ddbas811 tosci '0.1234567890123456' -> 0.1234567890123456
-ddbas812 tosci '0.01234567890123456' -> 0.01234567890123456
-ddbas813 tosci '0.001234567890123456' -> 0.001234567890123456
-ddbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456
-ddbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456
-ddbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456
-ddbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7
-ddbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8
-ddbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9
-ddbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10
-
-ddbas821 tosci '12345678901234567890' -> 1.234567890123457E+19 Inexact Rounded
-ddbas822 tosci '123456789012345678901' -> 1.234567890123457E+20 Inexact Rounded
-ddbas823 tosci '1234567890123456789012' -> 1.234567890123457E+21 Inexact Rounded
-ddbas824 tosci '12345678901234567890123' -> 1.234567890123457E+22 Inexact Rounded
-ddbas825 tosci '123456789012345678901234' -> 1.234567890123457E+23 Inexact Rounded
-ddbas826 tosci '1234567890123456789012345' -> 1.234567890123457E+24 Inexact Rounded
-ddbas827 tosci '12345678901234567890123456' -> 1.234567890123457E+25 Inexact Rounded
-ddbas828 tosci '123456789012345678901234567' -> 1.234567890123457E+26 Inexact Rounded
-ddbas829 tosci '1234567890123456789012345678' -> 1.234567890123457E+27 Inexact Rounded
-
--- subnormals and overflows
-ddbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
-ddbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
-ddbas908 toSci '0.9e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas909 toSci '0.09e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
-ddbas911 toSci '10e-1000000000' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
-ddbas913 toSci '99e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
-ddbas915 toSci '1111e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas916 toSci '1111e-99999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
--- negatives the same
-ddbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
-ddbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
-ddbas920 toSci '-0.9e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas921 toSci '-0.09e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
-ddbas923 toSci '-10e-1000000000' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
-ddbas925 toSci '-99e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
-ddbas927 toSci '-1111e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas928 toSci '-1111e-99999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
-
--- overflow results at different rounding modes
-rounding: ceiling
-ddbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas931 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded
-rounding: up
-ddbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: down
-ddbas934 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddbas935 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded
-rounding: floor
-ddbas936 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_up
-ddbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_even
-ddbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_down
-ddbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_even
-
--- Now check 854/754r some subnormals and underflow to 0
-ddbem400 toSci 1.0000E-383 -> 1.0000E-383
-ddbem401 toSci 0.1E-394 -> 1E-395 Subnormal
-ddbem402 toSci 0.1000E-394 -> 1.000E-395 Subnormal
-ddbem403 toSci 0.0100E-394 -> 1.00E-396 Subnormal
-ddbem404 toSci 0.0010E-394 -> 1.0E-397 Subnormal
-ddbem405 toSci 0.0001E-394 -> 1E-398 Subnormal
-ddbem406 toSci 0.00010E-394 -> 1E-398 Subnormal Rounded
-ddbem407 toSci 0.00013E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddbem408 toSci 0.00015E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem409 toSci 0.00017E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem410 toSci 0.00023E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem411 toSci 0.00025E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem412 toSci 0.00027E-394 -> 3E-398 Underflow Subnormal Inexact Rounded
-ddbem413 toSci 0.000149E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddbem414 toSci 0.000150E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem415 toSci 0.000151E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem416 toSci 0.000249E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem417 toSci 0.000250E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem418 toSci 0.000251E-394 -> 3E-398 Underflow Subnormal Inexact Rounded
-ddbem419 toSci 0.00009E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddbem420 toSci 0.00005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem421 toSci 0.00003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem422 toSci 0.000009E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem423 toSci 0.000005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem424 toSci 0.000003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-ddbem425 toSci 0.001049E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
-ddbem426 toSci 0.001050E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
-ddbem427 toSci 0.001051E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded
-ddbem428 toSci 0.001149E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded
-ddbem429 toSci 0.001150E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded
-ddbem430 toSci 0.001151E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded
-
-ddbem432 toSci 0.010049E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
-ddbem433 toSci 0.010050E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
-ddbem434 toSci 0.010051E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded
-ddbem435 toSci 0.010149E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded
-ddbem436 toSci 0.010150E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded
-ddbem437 toSci 0.010151E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded
-
-ddbem440 toSci 0.10103E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded
-ddbem441 toSci 0.10105E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded
-ddbem442 toSci 0.10107E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded
-ddbem443 toSci 0.10113E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded
-ddbem444 toSci 0.10115E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded
-ddbem445 toSci 0.10117E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded
-
-ddbem450 toSci 1.10730E-395 -> 1.107E-395 Underflow Subnormal Inexact Rounded
-ddbem451 toSci 1.10750E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
-ddbem452 toSci 1.10770E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
-ddbem453 toSci 1.10830E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
-ddbem454 toSci 1.10850E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
-ddbem455 toSci 1.10870E-395 -> 1.109E-395 Underflow Subnormal Inexact Rounded
-
--- make sure sign OK
-ddbem456 toSci -0.10103E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded
-ddbem457 toSci -0.10105E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded
-ddbem458 toSci -0.10107E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded
-ddbem459 toSci -0.10113E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded
-ddbem460 toSci -0.10115E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded
-ddbem461 toSci -0.10117E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded
-
--- '999s' cases
-ddbem464 toSci 999999E-395 -> 9.99999E-390 Subnormal
-ddbem465 toSci 99999.0E-394 -> 9.99990E-390 Subnormal
-ddbem466 toSci 99999.E-394 -> 9.9999E-390 Subnormal
-ddbem467 toSci 9999.9E-394 -> 9.9999E-391 Subnormal
-ddbem468 toSci 999.99E-394 -> 9.9999E-392 Subnormal
-ddbem469 toSci 99.999E-394 -> 9.9999E-393 Subnormal
-ddbem470 toSci 9.9999E-394 -> 9.9999E-394 Subnormal
-ddbem471 toSci 0.99999E-394 -> 1.0000E-394 Underflow Subnormal Inexact Rounded
-ddbem472 toSci 0.099999E-394 -> 1.000E-395 Underflow Subnormal Inexact Rounded
-ddbem473 toSci 0.0099999E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
-ddbem474 toSci 0.00099999E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
-ddbem475 toSci 0.000099999E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddbem476 toSci 0.0000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem477 toSci 0.00000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem478 toSci 0.000000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- Exponents with insignificant leading zeros
-ddbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
-ddbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
-ddbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
-ddbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
-ddbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
-ddbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
-ddbas1007 toSci 1e-999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1008 toSci 1e-0999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1009 toSci 1e-00999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1010 toSci 1e-000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1011 toSci 1e-000000000000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1012 toSci 1e-000000000001000000007 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- check for double-rounded subnormals
-ddbas1041 toSci 1.1111111111152444E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
-ddbas1042 toSci 1.1111111111152445E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
-ddbas1043 toSci 1.1111111111152446E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
-
--- clamped large normals
-ddbas1070 toSci 1E+369 -> 1E+369
-ddbas1071 toSci 1E+370 -> 1.0E+370 Clamped
-ddbas1072 toSci 1E+378 -> 1.000000000E+378 Clamped
-ddbas1073 toSci 1E+384 -> 1.000000000000000E+384 Clamped
-ddbas1074 toSci 1E+385 -> Infinity Overflow Inexact Rounded
-
-
--- clamped zeros [see also clamp.decTest]
-ddbas1075 toSci 0e+10000 -> 0E+369 Clamped
-ddbas1076 toSci 0e-10000 -> 0E-398 Clamped
-ddbas1077 toSci -0e+10000 -> -0E+369 Clamped
-ddbas1078 toSci -0e-10000 -> -0E-398 Clamped
-
--- extreme values from next-wider
-ddbas1101 toSci -9.99999999999999999999999999999999E+6144 -> -Infinity Overflow Inexact Rounded
-ddbas1102 toSci -1E-6143 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped
-ddbas1103 toSci -1E-6176 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped
-ddbas1104 toSci -0 -> -0
-ddbas1105 toSci +0 -> 0
-ddbas1106 toSci +1E-6176 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped
-ddbas1107 toSci +1E-6173 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped
-ddbas1108 toSci +9.99999999999999999999999999999999E+6144 -> Infinity Overflow Inexact Rounded
-
+------------------------------------------------------------------------
+-- ddBase.decTest -- base decDouble <--> string conversions --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests base conversions from string to a decimal number
+-- and back to a string (in Scientific form)
+
+-- Note that unlike other operations the operand is subject to rounding
+-- to conform to emax and precision settings (that is, numbers will
+-- conform to rules and exponent will be in permitted range). The
+-- 'left hand side', therefore, may have numbers that cannot be
+-- represented in a decDouble. Some testcases go to the limit of the
+-- next-wider format, and hence these testcases may also be used to
+-- test narrowing and widening operations.
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddbas001 toSci 0 -> 0
+ddbas002 toSci 1 -> 1
+ddbas003 toSci 1.0 -> 1.0
+ddbas004 toSci 1.00 -> 1.00
+ddbas005 toSci 10 -> 10
+ddbas006 toSci 1000 -> 1000
+ddbas007 toSci 10.0 -> 10.0
+ddbas008 toSci 10.1 -> 10.1
+ddbas009 toSci 10.4 -> 10.4
+ddbas010 toSci 10.5 -> 10.5
+ddbas011 toSci 10.6 -> 10.6
+ddbas012 toSci 10.9 -> 10.9
+ddbas013 toSci 11.0 -> 11.0
+ddbas014 toSci 1.234 -> 1.234
+ddbas015 toSci 0.123 -> 0.123
+ddbas016 toSci 0.012 -> 0.012
+ddbas017 toSci -0 -> -0
+ddbas018 toSci -0.0 -> -0.0
+ddbas019 toSci -00.00 -> -0.00
+
+ddbas021 toSci -1 -> -1
+ddbas022 toSci -1.0 -> -1.0
+ddbas023 toSci -0.1 -> -0.1
+ddbas024 toSci -9.1 -> -9.1
+ddbas025 toSci -9.11 -> -9.11
+ddbas026 toSci -9.119 -> -9.119
+ddbas027 toSci -9.999 -> -9.999
+
+ddbas030 toSci '123456789.123456' -> '123456789.123456'
+ddbas031 toSci '123456789.000000' -> '123456789.000000'
+ddbas032 toSci '123456789123456' -> '123456789123456'
+ddbas033 toSci '0.0000123456789' -> '0.0000123456789'
+ddbas034 toSci '0.00000123456789' -> '0.00000123456789'
+ddbas035 toSci '0.000000123456789' -> '1.23456789E-7'
+ddbas036 toSci '0.0000000123456789' -> '1.23456789E-8'
+
+ddbas037 toSci '0.123456789012344' -> '0.123456789012344'
+ddbas038 toSci '0.123456789012345' -> '0.123456789012345'
+
+-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
+ddbsn001 toSci -9.999999999999999E+384 -> -9.999999999999999E+384
+ddbsn002 toSci -1E-383 -> -1E-383
+ddbsn003 toSci -1E-398 -> -1E-398 Subnormal
+ddbsn004 toSci -0 -> -0
+ddbsn005 toSci +0 -> 0
+ddbsn006 toSci +1E-398 -> 1E-398 Subnormal
+ddbsn007 toSci +1E-383 -> 1E-383
+ddbsn008 toSci +9.999999999999999E+384 -> 9.999999999999999E+384
+
+-- String [many more examples are implicitly tested elsewhere]
+-- strings without E cannot generate E in result
+ddbas040 toSci "12" -> '12'
+ddbas041 toSci "-76" -> '-76'
+ddbas042 toSci "12.76" -> '12.76'
+ddbas043 toSci "+12.76" -> '12.76'
+ddbas044 toSci "012.76" -> '12.76'
+ddbas045 toSci "+0.003" -> '0.003'
+ddbas046 toSci "17." -> '17'
+ddbas047 toSci ".5" -> '0.5'
+ddbas048 toSci "044" -> '44'
+ddbas049 toSci "0044" -> '44'
+ddbas050 toSci "0.0005" -> '0.0005'
+ddbas051 toSci "00.00005" -> '0.00005'
+ddbas052 toSci "0.000005" -> '0.000005'
+ddbas053 toSci "0.0000050" -> '0.0000050'
+ddbas054 toSci "0.0000005" -> '5E-7'
+ddbas055 toSci "0.00000005" -> '5E-8'
+ddbas056 toSci "12345678.543210" -> '12345678.543210'
+ddbas057 toSci "2345678.543210" -> '2345678.543210'
+ddbas058 toSci "345678.543210" -> '345678.543210'
+ddbas059 toSci "0345678.54321" -> '345678.54321'
+ddbas060 toSci "345678.5432" -> '345678.5432'
+ddbas061 toSci "+345678.5432" -> '345678.5432'
+ddbas062 toSci "+0345678.5432" -> '345678.5432'
+ddbas063 toSci "+00345678.5432" -> '345678.5432'
+ddbas064 toSci "-345678.5432" -> '-345678.5432'
+ddbas065 toSci "-0345678.5432" -> '-345678.5432'
+ddbas066 toSci "-00345678.5432" -> '-345678.5432'
+-- examples
+ddbas067 toSci "5E-6" -> '0.000005'
+ddbas068 toSci "50E-7" -> '0.0000050'
+ddbas069 toSci "5E-7" -> '5E-7'
+
+-- [No exotics as no Unicode]
+
+-- rounded with dots in all (including edge) places
+ddbas071 toSci .1234567890123456123 -> 0.1234567890123456 Inexact Rounded
+ddbas072 toSci 1.234567890123456123 -> 1.234567890123456 Inexact Rounded
+ddbas073 toSci 12.34567890123456123 -> 12.34567890123456 Inexact Rounded
+ddbas074 toSci 123.4567890123456123 -> 123.4567890123456 Inexact Rounded
+ddbas075 toSci 1234.567890123456123 -> 1234.567890123456 Inexact Rounded
+ddbas076 toSci 12345.67890123456123 -> 12345.67890123456 Inexact Rounded
+ddbas077 toSci 123456.7890123456123 -> 123456.7890123456 Inexact Rounded
+ddbas078 toSci 1234567.890123456123 -> 1234567.890123456 Inexact Rounded
+ddbas079 toSci 12345678.90123456123 -> 12345678.90123456 Inexact Rounded
+ddbas080 toSci 123456789.0123456123 -> 123456789.0123456 Inexact Rounded
+ddbas081 toSci 1234567890.123456123 -> 1234567890.123456 Inexact Rounded
+ddbas082 toSci 12345678901.23456123 -> 12345678901.23456 Inexact Rounded
+ddbas083 toSci 123456789012.3456123 -> 123456789012.3456 Inexact Rounded
+ddbas084 toSci 1234567890123.456123 -> 1234567890123.456 Inexact Rounded
+ddbas085 toSci 12345678901234.56123 -> 12345678901234.56 Inexact Rounded
+ddbas086 toSci 123456789012345.6123 -> 123456789012345.6 Inexact Rounded
+ddbas087 toSci 1234567890123456.123 -> 1234567890123456 Inexact Rounded
+ddbas088 toSci 12345678901234561.23 -> 1.234567890123456E+16 Inexact Rounded
+ddbas089 toSci 123456789012345612.3 -> 1.234567890123456E+17 Inexact Rounded
+ddbas090 toSci 1234567890123456123. -> 1.234567890123456E+18 Inexact Rounded
+
+
+-- Numbers with E
+ddbas130 toSci "0.000E-1" -> '0.0000'
+ddbas131 toSci "0.000E-2" -> '0.00000'
+ddbas132 toSci "0.000E-3" -> '0.000000'
+ddbas133 toSci "0.000E-4" -> '0E-7'
+ddbas134 toSci "0.00E-2" -> '0.0000'
+ddbas135 toSci "0.00E-3" -> '0.00000'
+ddbas136 toSci "0.00E-4" -> '0.000000'
+ddbas137 toSci "0.00E-5" -> '0E-7'
+ddbas138 toSci "+0E+9" -> '0E+9'
+ddbas139 toSci "-0E+9" -> '-0E+9'
+ddbas140 toSci "1E+9" -> '1E+9'
+ddbas141 toSci "1e+09" -> '1E+9'
+ddbas142 toSci "1E+90" -> '1E+90'
+ddbas143 toSci "+1E+009" -> '1E+9'
+ddbas144 toSci "0E+9" -> '0E+9'
+ddbas145 toSci "1E+9" -> '1E+9'
+ddbas146 toSci "1E+09" -> '1E+9'
+ddbas147 toSci "1e+90" -> '1E+90'
+ddbas148 toSci "1E+009" -> '1E+9'
+ddbas149 toSci "000E+9" -> '0E+9'
+ddbas150 toSci "1E9" -> '1E+9'
+ddbas151 toSci "1e09" -> '1E+9'
+ddbas152 toSci "1E90" -> '1E+90'
+ddbas153 toSci "1E009" -> '1E+9'
+ddbas154 toSci "0E9" -> '0E+9'
+ddbas155 toSci "0.000e+0" -> '0.000'
+ddbas156 toSci "0.000E-1" -> '0.0000'
+ddbas157 toSci "4E+9" -> '4E+9'
+ddbas158 toSci "44E+9" -> '4.4E+10'
+ddbas159 toSci "0.73e-7" -> '7.3E-8'
+ddbas160 toSci "00E+9" -> '0E+9'
+ddbas161 toSci "00E-9" -> '0E-9'
+ddbas162 toSci "10E+9" -> '1.0E+10'
+ddbas163 toSci "10E+09" -> '1.0E+10'
+ddbas164 toSci "10e+90" -> '1.0E+91'
+ddbas165 toSci "10E+009" -> '1.0E+10'
+ddbas166 toSci "100e+9" -> '1.00E+11'
+ddbas167 toSci "100e+09" -> '1.00E+11'
+ddbas168 toSci "100E+90" -> '1.00E+92'
+ddbas169 toSci "100e+009" -> '1.00E+11'
+
+ddbas170 toSci "1.265" -> '1.265'
+ddbas171 toSci "1.265E-20" -> '1.265E-20'
+ddbas172 toSci "1.265E-8" -> '1.265E-8'
+ddbas173 toSci "1.265E-4" -> '0.0001265'
+ddbas174 toSci "1.265E-3" -> '0.001265'
+ddbas175 toSci "1.265E-2" -> '0.01265'
+ddbas176 toSci "1.265E-1" -> '0.1265'
+ddbas177 toSci "1.265E-0" -> '1.265'
+ddbas178 toSci "1.265E+1" -> '12.65'
+ddbas179 toSci "1.265E+2" -> '126.5'
+ddbas180 toSci "1.265E+3" -> '1265'
+ddbas181 toSci "1.265E+4" -> '1.265E+4'
+ddbas182 toSci "1.265E+8" -> '1.265E+8'
+ddbas183 toSci "1.265E+20" -> '1.265E+20'
+
+ddbas190 toSci "12.65" -> '12.65'
+ddbas191 toSci "12.65E-20" -> '1.265E-19'
+ddbas192 toSci "12.65E-8" -> '1.265E-7'
+ddbas193 toSci "12.65E-4" -> '0.001265'
+ddbas194 toSci "12.65E-3" -> '0.01265'
+ddbas195 toSci "12.65E-2" -> '0.1265'
+ddbas196 toSci "12.65E-1" -> '1.265'
+ddbas197 toSci "12.65E-0" -> '12.65'
+ddbas198 toSci "12.65E+1" -> '126.5'
+ddbas199 toSci "12.65E+2" -> '1265'
+ddbas200 toSci "12.65E+3" -> '1.265E+4'
+ddbas201 toSci "12.65E+4" -> '1.265E+5'
+ddbas202 toSci "12.65E+8" -> '1.265E+9'
+ddbas203 toSci "12.65E+20" -> '1.265E+21'
+
+ddbas210 toSci "126.5" -> '126.5'
+ddbas211 toSci "126.5E-20" -> '1.265E-18'
+ddbas212 toSci "126.5E-8" -> '0.000001265'
+ddbas213 toSci "126.5E-4" -> '0.01265'
+ddbas214 toSci "126.5E-3" -> '0.1265'
+ddbas215 toSci "126.5E-2" -> '1.265'
+ddbas216 toSci "126.5E-1" -> '12.65'
+ddbas217 toSci "126.5E-0" -> '126.5'
+ddbas218 toSci "126.5E+1" -> '1265'
+ddbas219 toSci "126.5E+2" -> '1.265E+4'
+ddbas220 toSci "126.5E+3" -> '1.265E+5'
+ddbas221 toSci "126.5E+4" -> '1.265E+6'
+ddbas222 toSci "126.5E+8" -> '1.265E+10'
+ddbas223 toSci "126.5E+20" -> '1.265E+22'
+
+ddbas230 toSci "1265" -> '1265'
+ddbas231 toSci "1265E-20" -> '1.265E-17'
+ddbas232 toSci "1265E-8" -> '0.00001265'
+ddbas233 toSci "1265E-4" -> '0.1265'
+ddbas234 toSci "1265E-3" -> '1.265'
+ddbas235 toSci "1265E-2" -> '12.65'
+ddbas236 toSci "1265E-1" -> '126.5'
+ddbas237 toSci "1265E-0" -> '1265'
+ddbas238 toSci "1265E+1" -> '1.265E+4'
+ddbas239 toSci "1265E+2" -> '1.265E+5'
+ddbas240 toSci "1265E+3" -> '1.265E+6'
+ddbas241 toSci "1265E+4" -> '1.265E+7'
+ddbas242 toSci "1265E+8" -> '1.265E+11'
+ddbas243 toSci "1265E+20" -> '1.265E+23'
+ddbas244 toSci "1265E-9" -> '0.000001265'
+ddbas245 toSci "1265E-10" -> '1.265E-7'
+ddbas246 toSci "1265E-11" -> '1.265E-8'
+ddbas247 toSci "1265E-12" -> '1.265E-9'
+
+ddbas250 toSci "0.1265" -> '0.1265'
+ddbas251 toSci "0.1265E-20" -> '1.265E-21'
+ddbas252 toSci "0.1265E-8" -> '1.265E-9'
+ddbas253 toSci "0.1265E-4" -> '0.00001265'
+ddbas254 toSci "0.1265E-3" -> '0.0001265'
+ddbas255 toSci "0.1265E-2" -> '0.001265'
+ddbas256 toSci "0.1265E-1" -> '0.01265'
+ddbas257 toSci "0.1265E-0" -> '0.1265'
+ddbas258 toSci "0.1265E+1" -> '1.265'
+ddbas259 toSci "0.1265E+2" -> '12.65'
+ddbas260 toSci "0.1265E+3" -> '126.5'
+ddbas261 toSci "0.1265E+4" -> '1265'
+ddbas262 toSci "0.1265E+8" -> '1.265E+7'
+ddbas263 toSci "0.1265E+20" -> '1.265E+19'
+
+-- some more negative zeros [systematic tests below]
+ddbas290 toSci "-0.000E-1" -> '-0.0000'
+ddbas291 toSci "-0.000E-2" -> '-0.00000'
+ddbas292 toSci "-0.000E-3" -> '-0.000000'
+ddbas293 toSci "-0.000E-4" -> '-0E-7'
+ddbas294 toSci "-0.00E-2" -> '-0.0000'
+ddbas295 toSci "-0.00E-3" -> '-0.00000'
+ddbas296 toSci "-0.0E-2" -> '-0.000'
+ddbas297 toSci "-0.0E-3" -> '-0.0000'
+ddbas298 toSci "-0E-2" -> '-0.00'
+ddbas299 toSci "-0E-3" -> '-0.000'
+
+-- Engineering notation tests
+ddbas301 toSci 10e12 -> 1.0E+13
+ddbas302 toEng 10e12 -> 10E+12
+ddbas303 toSci 10e11 -> 1.0E+12
+ddbas304 toEng 10e11 -> 1.0E+12
+ddbas305 toSci 10e10 -> 1.0E+11
+ddbas306 toEng 10e10 -> 100E+9
+ddbas307 toSci 10e9 -> 1.0E+10
+ddbas308 toEng 10e9 -> 10E+9
+ddbas309 toSci 10e8 -> 1.0E+9
+ddbas310 toEng 10e8 -> 1.0E+9
+ddbas311 toSci 10e7 -> 1.0E+8
+ddbas312 toEng 10e7 -> 100E+6
+ddbas313 toSci 10e6 -> 1.0E+7
+ddbas314 toEng 10e6 -> 10E+6
+ddbas315 toSci 10e5 -> 1.0E+6
+ddbas316 toEng 10e5 -> 1.0E+6
+ddbas317 toSci 10e4 -> 1.0E+5
+ddbas318 toEng 10e4 -> 100E+3
+ddbas319 toSci 10e3 -> 1.0E+4
+ddbas320 toEng 10e3 -> 10E+3
+ddbas321 toSci 10e2 -> 1.0E+3
+ddbas322 toEng 10e2 -> 1.0E+3
+ddbas323 toSci 10e1 -> 1.0E+2
+ddbas324 toEng 10e1 -> 100
+ddbas325 toSci 10e0 -> 10
+ddbas326 toEng 10e0 -> 10
+ddbas327 toSci 10e-1 -> 1.0
+ddbas328 toEng 10e-1 -> 1.0
+ddbas329 toSci 10e-2 -> 0.10
+ddbas330 toEng 10e-2 -> 0.10
+ddbas331 toSci 10e-3 -> 0.010
+ddbas332 toEng 10e-3 -> 0.010
+ddbas333 toSci 10e-4 -> 0.0010
+ddbas334 toEng 10e-4 -> 0.0010
+ddbas335 toSci 10e-5 -> 0.00010
+ddbas336 toEng 10e-5 -> 0.00010
+ddbas337 toSci 10e-6 -> 0.000010
+ddbas338 toEng 10e-6 -> 0.000010
+ddbas339 toSci 10e-7 -> 0.0000010
+ddbas340 toEng 10e-7 -> 0.0000010
+ddbas341 toSci 10e-8 -> 1.0E-7
+ddbas342 toEng 10e-8 -> 100E-9
+ddbas343 toSci 10e-9 -> 1.0E-8
+ddbas344 toEng 10e-9 -> 10E-9
+ddbas345 toSci 10e-10 -> 1.0E-9
+ddbas346 toEng 10e-10 -> 1.0E-9
+ddbas347 toSci 10e-11 -> 1.0E-10
+ddbas348 toEng 10e-11 -> 100E-12
+ddbas349 toSci 10e-12 -> 1.0E-11
+ddbas350 toEng 10e-12 -> 10E-12
+ddbas351 toSci 10e-13 -> 1.0E-12
+ddbas352 toEng 10e-13 -> 1.0E-12
+
+ddbas361 toSci 7E12 -> 7E+12
+ddbas362 toEng 7E12 -> 7E+12
+ddbas363 toSci 7E11 -> 7E+11
+ddbas364 toEng 7E11 -> 700E+9
+ddbas365 toSci 7E10 -> 7E+10
+ddbas366 toEng 7E10 -> 70E+9
+ddbas367 toSci 7E9 -> 7E+9
+ddbas368 toEng 7E9 -> 7E+9
+ddbas369 toSci 7E8 -> 7E+8
+ddbas370 toEng 7E8 -> 700E+6
+ddbas371 toSci 7E7 -> 7E+7
+ddbas372 toEng 7E7 -> 70E+6
+ddbas373 toSci 7E6 -> 7E+6
+ddbas374 toEng 7E6 -> 7E+6
+ddbas375 toSci 7E5 -> 7E+5
+ddbas376 toEng 7E5 -> 700E+3
+ddbas377 toSci 7E4 -> 7E+4
+ddbas378 toEng 7E4 -> 70E+3
+ddbas379 toSci 7E3 -> 7E+3
+ddbas380 toEng 7E3 -> 7E+3
+ddbas381 toSci 7E2 -> 7E+2
+ddbas382 toEng 7E2 -> 700
+ddbas383 toSci 7E1 -> 7E+1
+ddbas384 toEng 7E1 -> 70
+ddbas385 toSci 7E0 -> 7
+ddbas386 toEng 7E0 -> 7
+ddbas387 toSci 7E-1 -> 0.7
+ddbas388 toEng 7E-1 -> 0.7
+ddbas389 toSci 7E-2 -> 0.07
+ddbas390 toEng 7E-2 -> 0.07
+ddbas391 toSci 7E-3 -> 0.007
+ddbas392 toEng 7E-3 -> 0.007
+ddbas393 toSci 7E-4 -> 0.0007
+ddbas394 toEng 7E-4 -> 0.0007
+ddbas395 toSci 7E-5 -> 0.00007
+ddbas396 toEng 7E-5 -> 0.00007
+ddbas397 toSci 7E-6 -> 0.000007
+ddbas398 toEng 7E-6 -> 0.000007
+ddbas399 toSci 7E-7 -> 7E-7
+ddbas400 toEng 7E-7 -> 700E-9
+ddbas401 toSci 7E-8 -> 7E-8
+ddbas402 toEng 7E-8 -> 70E-9
+ddbas403 toSci 7E-9 -> 7E-9
+ddbas404 toEng 7E-9 -> 7E-9
+ddbas405 toSci 7E-10 -> 7E-10
+ddbas406 toEng 7E-10 -> 700E-12
+ddbas407 toSci 7E-11 -> 7E-11
+ddbas408 toEng 7E-11 -> 70E-12
+ddbas409 toSci 7E-12 -> 7E-12
+ddbas410 toEng 7E-12 -> 7E-12
+ddbas411 toSci 7E-13 -> 7E-13
+ddbas412 toEng 7E-13 -> 700E-15
+
+-- Exacts remain exact up to precision ..
+rounding: half_up
+ddbas420 toSci 100 -> 100
+ddbas421 toEng 100 -> 100
+ddbas422 toSci 1000 -> 1000
+ddbas423 toEng 1000 -> 1000
+ddbas424 toSci 999.9 -> 999.9
+ddbas425 toEng 999.9 -> 999.9
+ddbas426 toSci 1000.0 -> 1000.0
+ddbas427 toEng 1000.0 -> 1000.0
+ddbas428 toSci 1000.1 -> 1000.1
+ddbas429 toEng 1000.1 -> 1000.1
+ddbas430 toSci 10000 -> 10000
+ddbas431 toEng 10000 -> 10000
+ddbas432 toSci 100000 -> 100000
+ddbas433 toEng 100000 -> 100000
+ddbas434 toSci 1000000 -> 1000000
+ddbas435 toEng 1000000 -> 1000000
+ddbas436 toSci 10000000 -> 10000000
+ddbas437 toEng 10000000 -> 10000000
+ddbas438 toSci 100000000 -> 100000000
+ddbas439 toEng 1000000000000000 -> 1000000000000000
+ddbas440 toSci 10000000000000000 -> 1.000000000000000E+16 Rounded
+ddbas441 toEng 10000000000000000 -> 10.00000000000000E+15 Rounded
+ddbas442 toSci 10000000000000001 -> 1.000000000000000E+16 Rounded Inexact
+ddbas443 toEng 10000000000000001 -> 10.00000000000000E+15 Rounded Inexact
+ddbas444 toSci 10000000000000003 -> 1.000000000000000E+16 Rounded Inexact
+ddbas445 toEng 10000000000000003 -> 10.00000000000000E+15 Rounded Inexact
+ddbas446 toSci 10000000000000005 -> 1.000000000000001E+16 Rounded Inexact
+ddbas447 toEng 10000000000000005 -> 10.00000000000001E+15 Rounded Inexact
+ddbas448 toSci 100000000000000050 -> 1.000000000000001E+17 Rounded Inexact
+ddbas449 toEng 100000000000000050 -> 100.0000000000001E+15 Rounded Inexact
+ddbas450 toSci 10000000000000009 -> 1.000000000000001E+16 Rounded Inexact
+ddbas451 toEng 10000000000000009 -> 10.00000000000001E+15 Rounded Inexact
+ddbas452 toSci 100000000000000000 -> 1.000000000000000E+17 Rounded
+ddbas453 toEng 100000000000000000 -> 100.0000000000000E+15 Rounded
+ddbas454 toSci 100000000000000003 -> 1.000000000000000E+17 Rounded Inexact
+ddbas455 toEng 100000000000000003 -> 100.0000000000000E+15 Rounded Inexact
+ddbas456 toSci 100000000000000005 -> 1.000000000000000E+17 Rounded Inexact
+ddbas457 toEng 100000000000000005 -> 100.0000000000000E+15 Rounded Inexact
+ddbas458 toSci 100000000000000009 -> 1.000000000000000E+17 Rounded Inexact
+ddbas459 toEng 100000000000000009 -> 100.0000000000000E+15 Rounded Inexact
+ddbas460 toSci 1000000000000000000 -> 1.000000000000000E+18 Rounded
+ddbas461 toEng 1000000000000000000 -> 1.000000000000000E+18 Rounded
+ddbas462 toSci 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact
+ddbas463 toEng 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact
+ddbas464 toSci 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact
+ddbas465 toEng 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact
+ddbas466 toSci 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact
+ddbas467 toEng 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact
+ddbas468 toSci 10000000000000000000 -> 1.000000000000000E+19 Rounded
+ddbas469 toEng 10000000000000000000 -> 10.00000000000000E+18 Rounded
+ddbas470 toSci 10000000000000003000 -> 1.000000000000000E+19 Rounded Inexact
+ddbas471 toEng 10000000000000003000 -> 10.00000000000000E+18 Rounded Inexact
+ddbas472 toSci 10000000000000005000 -> 1.000000000000001E+19 Rounded Inexact
+ddbas473 toEng 10000000000000005000 -> 10.00000000000001E+18 Rounded Inexact
+ddbas474 toSci 10000000000000009000 -> 1.000000000000001E+19 Rounded Inexact
+ddbas475 toEng 10000000000000009000 -> 10.00000000000001E+18 Rounded Inexact
+
+-- check rounding modes heeded
+rounding: ceiling
+ddbsr401 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr402 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact
+ddbsr403 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
+ddbsr404 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+rounding: up
+ddbsr405 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr406 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact
+ddbsr407 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
+ddbsr408 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+rounding: floor
+ddbsr410 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr411 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr412 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
+ddbsr413 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact
+rounding: half_down
+ddbsr415 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr416 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr417 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
+ddbsr418 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact
+ddbsr419 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+rounding: half_even
+ddbsr421 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr422 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr423 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
+ddbsr424 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact
+ddbsr425 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+rounding: down
+ddbsr426 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr427 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr428 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
+ddbsr429 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact
+rounding: half_up
+ddbsr431 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr432 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr433 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
+ddbsr434 toSci 1.11111111111234650 -> 1.111111111112347 Rounded Inexact
+ddbsr435 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+-- negatives
+rounding: ceiling
+ddbsr501 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr502 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr503 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
+ddbsr504 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact
+rounding: up
+ddbsr505 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr506 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact
+ddbsr507 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
+ddbsr508 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+rounding: floor
+ddbsr510 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr511 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact
+ddbsr512 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
+ddbsr513 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+rounding: half_down
+ddbsr515 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr516 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr517 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
+ddbsr518 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact
+ddbsr519 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+rounding: half_even
+ddbsr521 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr522 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr523 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
+ddbsr524 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact
+ddbsr525 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+rounding: down
+ddbsr526 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr527 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr528 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
+ddbsr529 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact
+rounding: half_up
+ddbsr531 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr532 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr533 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
+ddbsr534 toSci -1.11111111111234650 -> -1.111111111112347 Rounded Inexact
+ddbsr535 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+
+rounding: half_even
+
+-- The 'baddies' tests from DiagBigDecimal, plus some new ones
+ddbas500 toSci '1..2' -> NaN Conversion_syntax
+ddbas501 toSci '.' -> NaN Conversion_syntax
+ddbas502 toSci '..' -> NaN Conversion_syntax
+ddbas503 toSci '++1' -> NaN Conversion_syntax
+ddbas504 toSci '--1' -> NaN Conversion_syntax
+ddbas505 toSci '-+1' -> NaN Conversion_syntax
+ddbas506 toSci '+-1' -> NaN Conversion_syntax
+ddbas507 toSci '12e' -> NaN Conversion_syntax
+ddbas508 toSci '12e++' -> NaN Conversion_syntax
+ddbas509 toSci '12f4' -> NaN Conversion_syntax
+ddbas510 toSci ' +1' -> NaN Conversion_syntax
+ddbas511 toSci '+ 1' -> NaN Conversion_syntax
+ddbas512 toSci '12 ' -> NaN Conversion_syntax
+ddbas513 toSci ' + 1' -> NaN Conversion_syntax
+ddbas514 toSci ' - 1 ' -> NaN Conversion_syntax
+ddbas515 toSci 'x' -> NaN Conversion_syntax
+ddbas516 toSci '-1-' -> NaN Conversion_syntax
+ddbas517 toSci '12-' -> NaN Conversion_syntax
+ddbas518 toSci '3+' -> NaN Conversion_syntax
+ddbas519 toSci '' -> NaN Conversion_syntax
+ddbas520 toSci '1e-' -> NaN Conversion_syntax
+ddbas521 toSci '7e99999a' -> NaN Conversion_syntax
+ddbas522 toSci '7e123567890x' -> NaN Conversion_syntax
+ddbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
+ddbas524 toSci '' -> NaN Conversion_syntax
+ddbas525 toSci 'e100' -> NaN Conversion_syntax
+ddbas526 toSci '\u0e5a' -> NaN Conversion_syntax
+ddbas527 toSci '\u0b65' -> NaN Conversion_syntax
+ddbas528 toSci '123,65' -> NaN Conversion_syntax
+ddbas529 toSci '1.34.5' -> NaN Conversion_syntax
+ddbas530 toSci '.123.5' -> NaN Conversion_syntax
+ddbas531 toSci '01.35.' -> NaN Conversion_syntax
+ddbas532 toSci '01.35-' -> NaN Conversion_syntax
+ddbas533 toSci '0000..' -> NaN Conversion_syntax
+ddbas534 toSci '.0000.' -> NaN Conversion_syntax
+ddbas535 toSci '00..00' -> NaN Conversion_syntax
+ddbas536 toSci '111e*123' -> NaN Conversion_syntax
+ddbas537 toSci '111e123-' -> NaN Conversion_syntax
+ddbas538 toSci '111e+12+' -> NaN Conversion_syntax
+ddbas539 toSci '111e1-3-' -> NaN Conversion_syntax
+ddbas540 toSci '111e1*23' -> NaN Conversion_syntax
+ddbas541 toSci '111e1e+3' -> NaN Conversion_syntax
+ddbas542 toSci '1e1.0' -> NaN Conversion_syntax
+ddbas543 toSci '1e123e' -> NaN Conversion_syntax
+ddbas544 toSci 'ten' -> NaN Conversion_syntax
+ddbas545 toSci 'ONE' -> NaN Conversion_syntax
+ddbas546 toSci '1e.1' -> NaN Conversion_syntax
+ddbas547 toSci '1e1.' -> NaN Conversion_syntax
+ddbas548 toSci '1ee' -> NaN Conversion_syntax
+ddbas549 toSci 'e+1' -> NaN Conversion_syntax
+ddbas550 toSci '1.23.4' -> NaN Conversion_syntax
+ddbas551 toSci '1.2.1' -> NaN Conversion_syntax
+ddbas552 toSci '1E+1.2' -> NaN Conversion_syntax
+ddbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
+ddbas554 toSci '1E++1' -> NaN Conversion_syntax
+ddbas555 toSci '1E--1' -> NaN Conversion_syntax
+ddbas556 toSci '1E+-1' -> NaN Conversion_syntax
+ddbas557 toSci '1E-+1' -> NaN Conversion_syntax
+ddbas558 toSci '1E''1' -> NaN Conversion_syntax
+ddbas559 toSci "1E""1" -> NaN Conversion_syntax
+ddbas560 toSci "1E""""" -> NaN Conversion_syntax
+-- Near-specials
+ddbas561 toSci "qNaN" -> NaN Conversion_syntax
+ddbas562 toSci "NaNq" -> NaN Conversion_syntax
+ddbas563 toSci "NaNs" -> NaN Conversion_syntax
+ddbas564 toSci "Infi" -> NaN Conversion_syntax
+ddbas565 toSci "Infin" -> NaN Conversion_syntax
+ddbas566 toSci "Infini" -> NaN Conversion_syntax
+ddbas567 toSci "Infinit" -> NaN Conversion_syntax
+ddbas568 toSci "-Infinit" -> NaN Conversion_syntax
+ddbas569 toSci "0Inf" -> NaN Conversion_syntax
+ddbas570 toSci "9Inf" -> NaN Conversion_syntax
+ddbas571 toSci "-0Inf" -> NaN Conversion_syntax
+ddbas572 toSci "-9Inf" -> NaN Conversion_syntax
+ddbas573 toSci "-sNa" -> NaN Conversion_syntax
+ddbas574 toSci "xNaN" -> NaN Conversion_syntax
+ddbas575 toSci "0sNaN" -> NaN Conversion_syntax
+
+-- some baddies with dots and Es and dots and specials
+ddbas576 toSci 'e+1' -> NaN Conversion_syntax
+ddbas577 toSci '.e+1' -> NaN Conversion_syntax
+ddbas578 toSci '+.e+1' -> NaN Conversion_syntax
+ddbas579 toSci '-.e+' -> NaN Conversion_syntax
+ddbas580 toSci '-.e' -> NaN Conversion_syntax
+ddbas581 toSci 'E+1' -> NaN Conversion_syntax
+ddbas582 toSci '.E+1' -> NaN Conversion_syntax
+ddbas583 toSci '+.E+1' -> NaN Conversion_syntax
+ddbas584 toSci '-.E+' -> NaN Conversion_syntax
+ddbas585 toSci '-.E' -> NaN Conversion_syntax
+
+ddbas586 toSci '.NaN' -> NaN Conversion_syntax
+ddbas587 toSci '-.NaN' -> NaN Conversion_syntax
+ddbas588 toSci '+.sNaN' -> NaN Conversion_syntax
+ddbas589 toSci '+.Inf' -> NaN Conversion_syntax
+ddbas590 toSci '.Infinity' -> NaN Conversion_syntax
+
+-- Zeros
+ddbas601 toSci 0.000000000 -> 0E-9
+ddbas602 toSci 0.00000000 -> 0E-8
+ddbas603 toSci 0.0000000 -> 0E-7
+ddbas604 toSci 0.000000 -> 0.000000
+ddbas605 toSci 0.00000 -> 0.00000
+ddbas606 toSci 0.0000 -> 0.0000
+ddbas607 toSci 0.000 -> 0.000
+ddbas608 toSci 0.00 -> 0.00
+ddbas609 toSci 0.0 -> 0.0
+ddbas610 toSci .0 -> 0.0
+ddbas611 toSci 0. -> 0
+ddbas612 toSci -.0 -> -0.0
+ddbas613 toSci -0. -> -0
+ddbas614 toSci -0.0 -> -0.0
+ddbas615 toSci -0.00 -> -0.00
+ddbas616 toSci -0.000 -> -0.000
+ddbas617 toSci -0.0000 -> -0.0000
+ddbas618 toSci -0.00000 -> -0.00000
+ddbas619 toSci -0.000000 -> -0.000000
+ddbas620 toSci -0.0000000 -> -0E-7
+ddbas621 toSci -0.00000000 -> -0E-8
+ddbas622 toSci -0.000000000 -> -0E-9
+
+ddbas630 toSci 0.00E+0 -> 0.00
+ddbas631 toSci 0.00E+1 -> 0.0
+ddbas632 toSci 0.00E+2 -> 0
+ddbas633 toSci 0.00E+3 -> 0E+1
+ddbas634 toSci 0.00E+4 -> 0E+2
+ddbas635 toSci 0.00E+5 -> 0E+3
+ddbas636 toSci 0.00E+6 -> 0E+4
+ddbas637 toSci 0.00E+7 -> 0E+5
+ddbas638 toSci 0.00E+8 -> 0E+6
+ddbas639 toSci 0.00E+9 -> 0E+7
+
+ddbas640 toSci 0.0E+0 -> 0.0
+ddbas641 toSci 0.0E+1 -> 0
+ddbas642 toSci 0.0E+2 -> 0E+1
+ddbas643 toSci 0.0E+3 -> 0E+2
+ddbas644 toSci 0.0E+4 -> 0E+3
+ddbas645 toSci 0.0E+5 -> 0E+4
+ddbas646 toSci 0.0E+6 -> 0E+5
+ddbas647 toSci 0.0E+7 -> 0E+6
+ddbas648 toSci 0.0E+8 -> 0E+7
+ddbas649 toSci 0.0E+9 -> 0E+8
+
+ddbas650 toSci 0E+0 -> 0
+ddbas651 toSci 0E+1 -> 0E+1
+ddbas652 toSci 0E+2 -> 0E+2
+ddbas653 toSci 0E+3 -> 0E+3
+ddbas654 toSci 0E+4 -> 0E+4
+ddbas655 toSci 0E+5 -> 0E+5
+ddbas656 toSci 0E+6 -> 0E+6
+ddbas657 toSci 0E+7 -> 0E+7
+ddbas658 toSci 0E+8 -> 0E+8
+ddbas659 toSci 0E+9 -> 0E+9
+
+ddbas660 toSci 0.0E-0 -> 0.0
+ddbas661 toSci 0.0E-1 -> 0.00
+ddbas662 toSci 0.0E-2 -> 0.000
+ddbas663 toSci 0.0E-3 -> 0.0000
+ddbas664 toSci 0.0E-4 -> 0.00000
+ddbas665 toSci 0.0E-5 -> 0.000000
+ddbas666 toSci 0.0E-6 -> 0E-7
+ddbas667 toSci 0.0E-7 -> 0E-8
+ddbas668 toSci 0.0E-8 -> 0E-9
+ddbas669 toSci 0.0E-9 -> 0E-10
+
+ddbas670 toSci 0.00E-0 -> 0.00
+ddbas671 toSci 0.00E-1 -> 0.000
+ddbas672 toSci 0.00E-2 -> 0.0000
+ddbas673 toSci 0.00E-3 -> 0.00000
+ddbas674 toSci 0.00E-4 -> 0.000000
+ddbas675 toSci 0.00E-5 -> 0E-7
+ddbas676 toSci 0.00E-6 -> 0E-8
+ddbas677 toSci 0.00E-7 -> 0E-9
+ddbas678 toSci 0.00E-8 -> 0E-10
+ddbas679 toSci 0.00E-9 -> 0E-11
+
+ddbas680 toSci 000000. -> 0
+ddbas681 toSci 00000. -> 0
+ddbas682 toSci 0000. -> 0
+ddbas683 toSci 000. -> 0
+ddbas684 toSci 00. -> 0
+ddbas685 toSci 0. -> 0
+ddbas686 toSci +00000. -> 0
+ddbas687 toSci -00000. -> -0
+ddbas688 toSci +0. -> 0
+ddbas689 toSci -0. -> -0
+
+-- Specials
+ddbas700 toSci "NaN" -> NaN
+ddbas701 toSci "nan" -> NaN
+ddbas702 toSci "nAn" -> NaN
+ddbas703 toSci "NAN" -> NaN
+ddbas704 toSci "+NaN" -> NaN
+ddbas705 toSci "+nan" -> NaN
+ddbas706 toSci "+nAn" -> NaN
+ddbas707 toSci "+NAN" -> NaN
+ddbas708 toSci "-NaN" -> -NaN
+ddbas709 toSci "-nan" -> -NaN
+ddbas710 toSci "-nAn" -> -NaN
+ddbas711 toSci "-NAN" -> -NaN
+ddbas712 toSci 'NaN0' -> NaN
+ddbas713 toSci 'NaN1' -> NaN1
+ddbas714 toSci 'NaN12' -> NaN12
+ddbas715 toSci 'NaN123' -> NaN123
+ddbas716 toSci 'NaN1234' -> NaN1234
+ddbas717 toSci 'NaN01' -> NaN1
+ddbas718 toSci 'NaN012' -> NaN12
+ddbas719 toSci 'NaN0123' -> NaN123
+ddbas720 toSci 'NaN01234' -> NaN1234
+ddbas721 toSci 'NaN001' -> NaN1
+ddbas722 toSci 'NaN0012' -> NaN12
+ddbas723 toSci 'NaN00123' -> NaN123
+ddbas724 toSci 'NaN001234' -> NaN1234
+ddbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax
+ddbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
+ddbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
+ddbas728 toSci 'NaN-12' -> NaN Conversion_syntax
+ddbas729 toSci 'NaN+12' -> NaN Conversion_syntax
+
+ddbas730 toSci "sNaN" -> sNaN
+ddbas731 toSci "snan" -> sNaN
+ddbas732 toSci "SnAn" -> sNaN
+ddbas733 toSci "SNAN" -> sNaN
+ddbas734 toSci "+sNaN" -> sNaN
+ddbas735 toSci "+snan" -> sNaN
+ddbas736 toSci "+SnAn" -> sNaN
+ddbas737 toSci "+SNAN" -> sNaN
+ddbas738 toSci "-sNaN" -> -sNaN
+ddbas739 toSci "-snan" -> -sNaN
+ddbas740 toSci "-SnAn" -> -sNaN
+ddbas741 toSci "-SNAN" -> -sNaN
+ddbas742 toSci 'sNaN0000' -> sNaN
+ddbas743 toSci 'sNaN7' -> sNaN7
+ddbas744 toSci 'sNaN007234' -> sNaN7234
+ddbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax
+ddbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
+ddbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
+
+ddbas748 toSci "Inf" -> Infinity
+ddbas749 toSci "inf" -> Infinity
+ddbas750 toSci "iNf" -> Infinity
+ddbas751 toSci "INF" -> Infinity
+ddbas752 toSci "+Inf" -> Infinity
+ddbas753 toSci "+inf" -> Infinity
+ddbas754 toSci "+iNf" -> Infinity
+ddbas755 toSci "+INF" -> Infinity
+ddbas756 toSci "-Inf" -> -Infinity
+ddbas757 toSci "-inf" -> -Infinity
+ddbas758 toSci "-iNf" -> -Infinity
+ddbas759 toSci "-INF" -> -Infinity
+
+ddbas760 toSci "Infinity" -> Infinity
+ddbas761 toSci "infinity" -> Infinity
+ddbas762 toSci "iNfInItY" -> Infinity
+ddbas763 toSci "INFINITY" -> Infinity
+ddbas764 toSci "+Infinity" -> Infinity
+ddbas765 toSci "+infinity" -> Infinity
+ddbas766 toSci "+iNfInItY" -> Infinity
+ddbas767 toSci "+INFINITY" -> Infinity
+ddbas768 toSci "-Infinity" -> -Infinity
+ddbas769 toSci "-infinity" -> -Infinity
+ddbas770 toSci "-iNfInItY" -> -Infinity
+ddbas771 toSci "-INFINITY" -> -Infinity
+
+-- Specials and zeros for toEng
+ddbast772 toEng "NaN" -> NaN
+ddbast773 toEng "-Infinity" -> -Infinity
+ddbast774 toEng "-sNaN" -> -sNaN
+ddbast775 toEng "-NaN" -> -NaN
+ddbast776 toEng "+Infinity" -> Infinity
+ddbast778 toEng "+sNaN" -> sNaN
+ddbast779 toEng "+NaN" -> NaN
+ddbast780 toEng "INFINITY" -> Infinity
+ddbast781 toEng "SNAN" -> sNaN
+ddbast782 toEng "NAN" -> NaN
+ddbast783 toEng "infinity" -> Infinity
+ddbast784 toEng "snan" -> sNaN
+ddbast785 toEng "nan" -> NaN
+ddbast786 toEng "InFINITY" -> Infinity
+ddbast787 toEng "SnAN" -> sNaN
+ddbast788 toEng "nAN" -> NaN
+ddbast789 toEng "iNfinity" -> Infinity
+ddbast790 toEng "sNan" -> sNaN
+ddbast791 toEng "Nan" -> NaN
+ddbast792 toEng "Infinity" -> Infinity
+ddbast793 toEng "sNaN" -> sNaN
+
+-- Zero toEng, etc.
+ddbast800 toEng 0e+1 -> "0.00E+3" -- doc example
+
+ddbast801 toEng 0.000000000 -> 0E-9
+ddbast802 toEng 0.00000000 -> 0.00E-6
+ddbast803 toEng 0.0000000 -> 0.0E-6
+ddbast804 toEng 0.000000 -> 0.000000
+ddbast805 toEng 0.00000 -> 0.00000
+ddbast806 toEng 0.0000 -> 0.0000
+ddbast807 toEng 0.000 -> 0.000
+ddbast808 toEng 0.00 -> 0.00
+ddbast809 toEng 0.0 -> 0.0
+ddbast810 toEng .0 -> 0.0
+ddbast811 toEng 0. -> 0
+ddbast812 toEng -.0 -> -0.0
+ddbast813 toEng -0. -> -0
+ddbast814 toEng -0.0 -> -0.0
+ddbast815 toEng -0.00 -> -0.00
+ddbast816 toEng -0.000 -> -0.000
+ddbast817 toEng -0.0000 -> -0.0000
+ddbast818 toEng -0.00000 -> -0.00000
+ddbast819 toEng -0.000000 -> -0.000000
+ddbast820 toEng -0.0000000 -> -0.0E-6
+ddbast821 toEng -0.00000000 -> -0.00E-6
+ddbast822 toEng -0.000000000 -> -0E-9
+
+ddbast830 toEng 0.00E+0 -> 0.00
+ddbast831 toEng 0.00E+1 -> 0.0
+ddbast832 toEng 0.00E+2 -> 0
+ddbast833 toEng 0.00E+3 -> 0.00E+3
+ddbast834 toEng 0.00E+4 -> 0.0E+3
+ddbast835 toEng 0.00E+5 -> 0E+3
+ddbast836 toEng 0.00E+6 -> 0.00E+6
+ddbast837 toEng 0.00E+7 -> 0.0E+6
+ddbast838 toEng 0.00E+8 -> 0E+6
+ddbast839 toEng 0.00E+9 -> 0.00E+9
+
+ddbast840 toEng 0.0E+0 -> 0.0
+ddbast841 toEng 0.0E+1 -> 0
+ddbast842 toEng 0.0E+2 -> 0.00E+3
+ddbast843 toEng 0.0E+3 -> 0.0E+3
+ddbast844 toEng 0.0E+4 -> 0E+3
+ddbast845 toEng 0.0E+5 -> 0.00E+6
+ddbast846 toEng 0.0E+6 -> 0.0E+6
+ddbast847 toEng 0.0E+7 -> 0E+6
+ddbast848 toEng 0.0E+8 -> 0.00E+9
+ddbast849 toEng 0.0E+9 -> 0.0E+9
+
+ddbast850 toEng 0E+0 -> 0
+ddbast851 toEng 0E+1 -> 0.00E+3
+ddbast852 toEng 0E+2 -> 0.0E+3
+ddbast853 toEng 0E+3 -> 0E+3
+ddbast854 toEng 0E+4 -> 0.00E+6
+ddbast855 toEng 0E+5 -> 0.0E+6
+ddbast856 toEng 0E+6 -> 0E+6
+ddbast857 toEng 0E+7 -> 0.00E+9
+ddbast858 toEng 0E+8 -> 0.0E+9
+ddbast859 toEng 0E+9 -> 0E+9
+
+ddbast860 toEng 0.0E-0 -> 0.0
+ddbast861 toEng 0.0E-1 -> 0.00
+ddbast862 toEng 0.0E-2 -> 0.000
+ddbast863 toEng 0.0E-3 -> 0.0000
+ddbast864 toEng 0.0E-4 -> 0.00000
+ddbast865 toEng 0.0E-5 -> 0.000000
+ddbast866 toEng 0.0E-6 -> 0.0E-6
+ddbast867 toEng 0.0E-7 -> 0.00E-6
+ddbast868 toEng 0.0E-8 -> 0E-9
+ddbast869 toEng 0.0E-9 -> 0.0E-9
+
+ddbast870 toEng 0.00E-0 -> 0.00
+ddbast871 toEng 0.00E-1 -> 0.000
+ddbast872 toEng 0.00E-2 -> 0.0000
+ddbast873 toEng 0.00E-3 -> 0.00000
+ddbast874 toEng 0.00E-4 -> 0.000000
+ddbast875 toEng 0.00E-5 -> 0.0E-6
+ddbast876 toEng 0.00E-6 -> 0.00E-6
+ddbast877 toEng 0.00E-7 -> 0E-9
+ddbast878 toEng 0.00E-8 -> 0.0E-9
+ddbast879 toEng 0.00E-9 -> 0.00E-9
+
+-- long input strings
+ddbas801 tosci '01234567890123456' -> 1234567890123456
+ddbas802 tosci '001234567890123456' -> 1234567890123456
+ddbas803 tosci '0001234567890123456' -> 1234567890123456
+ddbas804 tosci '00001234567890123456' -> 1234567890123456
+ddbas805 tosci '000001234567890123456' -> 1234567890123456
+ddbas806 tosci '0000001234567890123456' -> 1234567890123456
+ddbas807 tosci '00000001234567890123456' -> 1234567890123456
+ddbas808 tosci '000000001234567890123456' -> 1234567890123456
+ddbas809 tosci '0000000001234567890123456' -> 1234567890123456
+ddbas810 tosci '00000000001234567890123456' -> 1234567890123456
+
+ddbas811 tosci '0.1234567890123456' -> 0.1234567890123456
+ddbas812 tosci '0.01234567890123456' -> 0.01234567890123456
+ddbas813 tosci '0.001234567890123456' -> 0.001234567890123456
+ddbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456
+ddbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456
+ddbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456
+ddbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7
+ddbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8
+ddbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9
+ddbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10
+
+ddbas821 tosci '12345678901234567890' -> 1.234567890123457E+19 Inexact Rounded
+ddbas822 tosci '123456789012345678901' -> 1.234567890123457E+20 Inexact Rounded
+ddbas823 tosci '1234567890123456789012' -> 1.234567890123457E+21 Inexact Rounded
+ddbas824 tosci '12345678901234567890123' -> 1.234567890123457E+22 Inexact Rounded
+ddbas825 tosci '123456789012345678901234' -> 1.234567890123457E+23 Inexact Rounded
+ddbas826 tosci '1234567890123456789012345' -> 1.234567890123457E+24 Inexact Rounded
+ddbas827 tosci '12345678901234567890123456' -> 1.234567890123457E+25 Inexact Rounded
+ddbas828 tosci '123456789012345678901234567' -> 1.234567890123457E+26 Inexact Rounded
+ddbas829 tosci '1234567890123456789012345678' -> 1.234567890123457E+27 Inexact Rounded
+
+-- subnormals and overflows
+ddbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
+ddbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
+ddbas908 toSci '0.9e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas909 toSci '0.09e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
+ddbas911 toSci '10e-1000000000' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
+ddbas913 toSci '99e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
+ddbas915 toSci '1111e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas916 toSci '1111e-99999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
+-- negatives the same
+ddbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
+ddbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
+ddbas920 toSci '-0.9e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas921 toSci '-0.09e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
+ddbas923 toSci '-10e-1000000000' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
+ddbas925 toSci '-99e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
+ddbas927 toSci '-1111e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas928 toSci '-1111e-99999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
+
+-- overflow results at different rounding modes
+rounding: ceiling
+ddbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas931 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded
+rounding: up
+ddbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: down
+ddbas934 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddbas935 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded
+rounding: floor
+ddbas936 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_up
+ddbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_even
+ddbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_down
+ddbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_even
+
+-- Now check 854/754r some subnormals and underflow to 0
+ddbem400 toSci 1.0000E-383 -> 1.0000E-383
+ddbem401 toSci 0.1E-394 -> 1E-395 Subnormal
+ddbem402 toSci 0.1000E-394 -> 1.000E-395 Subnormal
+ddbem403 toSci 0.0100E-394 -> 1.00E-396 Subnormal
+ddbem404 toSci 0.0010E-394 -> 1.0E-397 Subnormal
+ddbem405 toSci 0.0001E-394 -> 1E-398 Subnormal
+ddbem406 toSci 0.00010E-394 -> 1E-398 Subnormal Rounded
+ddbem407 toSci 0.00013E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddbem408 toSci 0.00015E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem409 toSci 0.00017E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem410 toSci 0.00023E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem411 toSci 0.00025E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem412 toSci 0.00027E-394 -> 3E-398 Underflow Subnormal Inexact Rounded
+ddbem413 toSci 0.000149E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddbem414 toSci 0.000150E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem415 toSci 0.000151E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem416 toSci 0.000249E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem417 toSci 0.000250E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem418 toSci 0.000251E-394 -> 3E-398 Underflow Subnormal Inexact Rounded
+ddbem419 toSci 0.00009E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddbem420 toSci 0.00005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem421 toSci 0.00003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem422 toSci 0.000009E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem423 toSci 0.000005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem424 toSci 0.000003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+ddbem425 toSci 0.001049E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
+ddbem426 toSci 0.001050E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
+ddbem427 toSci 0.001051E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded
+ddbem428 toSci 0.001149E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded
+ddbem429 toSci 0.001150E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded
+ddbem430 toSci 0.001151E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded
+
+ddbem432 toSci 0.010049E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
+ddbem433 toSci 0.010050E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
+ddbem434 toSci 0.010051E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded
+ddbem435 toSci 0.010149E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded
+ddbem436 toSci 0.010150E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded
+ddbem437 toSci 0.010151E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded
+
+ddbem440 toSci 0.10103E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded
+ddbem441 toSci 0.10105E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded
+ddbem442 toSci 0.10107E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded
+ddbem443 toSci 0.10113E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded
+ddbem444 toSci 0.10115E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded
+ddbem445 toSci 0.10117E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded
+
+ddbem450 toSci 1.10730E-395 -> 1.107E-395 Underflow Subnormal Inexact Rounded
+ddbem451 toSci 1.10750E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
+ddbem452 toSci 1.10770E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
+ddbem453 toSci 1.10830E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
+ddbem454 toSci 1.10850E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
+ddbem455 toSci 1.10870E-395 -> 1.109E-395 Underflow Subnormal Inexact Rounded
+
+-- make sure sign OK
+ddbem456 toSci -0.10103E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded
+ddbem457 toSci -0.10105E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded
+ddbem458 toSci -0.10107E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded
+ddbem459 toSci -0.10113E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded
+ddbem460 toSci -0.10115E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded
+ddbem461 toSci -0.10117E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded
+
+-- '999s' cases
+ddbem464 toSci 999999E-395 -> 9.99999E-390 Subnormal
+ddbem465 toSci 99999.0E-394 -> 9.99990E-390 Subnormal
+ddbem466 toSci 99999.E-394 -> 9.9999E-390 Subnormal
+ddbem467 toSci 9999.9E-394 -> 9.9999E-391 Subnormal
+ddbem468 toSci 999.99E-394 -> 9.9999E-392 Subnormal
+ddbem469 toSci 99.999E-394 -> 9.9999E-393 Subnormal
+ddbem470 toSci 9.9999E-394 -> 9.9999E-394 Subnormal
+ddbem471 toSci 0.99999E-394 -> 1.0000E-394 Underflow Subnormal Inexact Rounded
+ddbem472 toSci 0.099999E-394 -> 1.000E-395 Underflow Subnormal Inexact Rounded
+ddbem473 toSci 0.0099999E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
+ddbem474 toSci 0.00099999E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
+ddbem475 toSci 0.000099999E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddbem476 toSci 0.0000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem477 toSci 0.00000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem478 toSci 0.000000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- Exponents with insignificant leading zeros
+ddbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
+ddbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
+ddbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
+ddbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
+ddbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
+ddbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
+ddbas1007 toSci 1e-999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1008 toSci 1e-0999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1009 toSci 1e-00999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1010 toSci 1e-000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1011 toSci 1e-000000000000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1012 toSci 1e-000000000001000000007 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- check for double-rounded subnormals
+ddbas1041 toSci 1.1111111111152444E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
+ddbas1042 toSci 1.1111111111152445E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
+ddbas1043 toSci 1.1111111111152446E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
+
+-- clamped large normals
+ddbas1070 toSci 1E+369 -> 1E+369
+ddbas1071 toSci 1E+370 -> 1.0E+370 Clamped
+ddbas1072 toSci 1E+378 -> 1.000000000E+378 Clamped
+ddbas1073 toSci 1E+384 -> 1.000000000000000E+384 Clamped
+ddbas1074 toSci 1E+385 -> Infinity Overflow Inexact Rounded
+
+
+-- clamped zeros [see also clamp.decTest]
+ddbas1075 toSci 0e+10000 -> 0E+369 Clamped
+ddbas1076 toSci 0e-10000 -> 0E-398 Clamped
+ddbas1077 toSci -0e+10000 -> -0E+369 Clamped
+ddbas1078 toSci -0e-10000 -> -0E-398 Clamped
+
+-- extreme values from next-wider
+ddbas1101 toSci -9.99999999999999999999999999999999E+6144 -> -Infinity Overflow Inexact Rounded
+ddbas1102 toSci -1E-6143 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped
+ddbas1103 toSci -1E-6176 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped
+ddbas1104 toSci -0 -> -0
+ddbas1105 toSci +0 -> 0
+ddbas1106 toSci +1E-6176 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped
+ddbas1107 toSci +1E-6173 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped
+ddbas1108 toSci +9.99999999999999999999999999999999E+6144 -> Infinity Overflow Inexact Rounded
+
diff --git a/Lib/test/decimaltestdata/ddCanonical.decTest b/Lib/test/decimaltestdata/ddCanonical.decTest
index b4f9e32c98..824de83aba 100644
--- a/Lib/test/decimaltestdata/ddCanonical.decTest
+++ b/Lib/test/decimaltestdata/ddCanonical.decTest
@@ -1,357 +1,357 @@
-------------------------------------------------------------------------
--- ddCanonical.decTest -- test decDouble canonical results --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests that copy operations leave uncanonical operands
--- unchanged, and vice versa
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Uncanonical declets are: abc, where:
--- a=1,2,3
--- b=6,7,e,f
--- c=e,f
-
--- assert some standard (canonical) values; this tests that FromString
--- produces canonical results (many more in decimalNN)
-ddcan001 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
-ddcan002 apply 0 -> #2238000000000000
-ddcan003 apply 1 -> #2238000000000001
-ddcan004 apply -1 -> #a238000000000001
-ddcan005 apply Infinity -> #7800000000000000
-ddcan006 apply -Infinity -> #f800000000000000
-ddcan007 apply -NaN -> #fc00000000000000
-ddcan008 apply -sNaN -> #fe00000000000000
-ddcan009 apply NaN999999999999999 -> #7c00ff3fcff3fcff
-ddcan010 apply sNaN999999999999999 -> #7e00ff3fcff3fcff
-decan011 apply 9999999999999999 -> #6e38ff3fcff3fcff
-ddcan012 apply 7.50 -> #22300000000003d0
-ddcan013 apply 9.99 -> #22300000000000ff
-
--- Base tests for canonical encodings (individual operator
--- propagation is tested later)
-
--- Finites: declets in coefficient
-ddcan021 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan022 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan023 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan024 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan025 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
-ddcan026 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
-ddcan027 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
-ddcan028 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
-ddcan030 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
-ddcan031 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
-ddcan032 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
-ddcan033 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
-ddcan035 canonical #77fcff3fdff3fcff -> #77fcff3fcff3fcff
-ddcan036 canonical #77fcff3feff3fcff -> #77fcff3fcff3fcff
-
--- NaN: declets in payload
-ddcan100 canonical NaN999999999999999 -> #7c00ff3fcff3fcff
-ddcan101 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan102 canonical #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan103 canonical #7c00ffffcff3fcff -> #7c00ff3fcff3fcff
-ddcan104 canonical #7c00ff3ffff3fcff -> #7c00ff3fcff3fcff
-ddcan105 canonical #7c00ff3fcffffcff -> #7c00ff3fcff3fcff
-ddcan106 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
-ddcan107 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-ddcan110 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan112 canonical #7d00ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan113 canonical #7c80ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan114 canonical #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan115 canonical #7c20ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan116 canonical #7c10ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan117 canonical #7c08ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan118 canonical #7c04ff3fcff3fcff -> #7c00ff3fcff3fcff
-
--- sNaN: declets in payload
-ddcan120 canonical sNaN999999999999999 -> #7e00ff3fcff3fcff
-ddcan121 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan122 canonical #7e03ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan123 canonical #7e00ffffcff3fcff -> #7e00ff3fcff3fcff
-ddcan124 canonical #7e00ff3ffff3fcff -> #7e00ff3fcff3fcff
-ddcan125 canonical #7e00ff3fcffffcff -> #7e00ff3fcff3fcff
-ddcan126 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
-ddcan127 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
--- sNaN: exponent continuation bits [excluding sNaN selector]
-ddcan130 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan132 canonical #7f00ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan133 canonical #7e80ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan134 canonical #7e40ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan135 canonical #7e20ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan136 canonical #7e10ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan137 canonical #7e08ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan138 canonical #7e04ff3fcff3fcff -> #7e00ff3fcff3fcff
-
--- Inf: exponent continuation bits
-ddcan140 canonical #7800000000000000 -> #7800000000000000
-ddcan141 canonical #7900000000000000 -> #7800000000000000
-ddcan142 canonical #7a00000000000000 -> #7800000000000000
-ddcan143 canonical #7880000000000000 -> #7800000000000000
-ddcan144 canonical #7840000000000000 -> #7800000000000000
-ddcan145 canonical #7820000000000000 -> #7800000000000000
-ddcan146 canonical #7810000000000000 -> #7800000000000000
-ddcan147 canonical #7808000000000000 -> #7800000000000000
-ddcan148 canonical #7804000000000000 -> #7800000000000000
-
--- Inf: coefficient continuation bits (first, last, and a few others)
-ddcan150 canonical #7800000000000000 -> #7800000000000000
-ddcan151 canonical #7802000000000000 -> #7800000000000000
-ddcan152 canonical #7800000000000001 -> #7800000000000000
-ddcan153 canonical #7801000000000000 -> #7800000000000000
-ddcan154 canonical #7800200000000000 -> #7800000000000000
-ddcan155 canonical #7800080000000000 -> #7800000000000000
-ddcan156 canonical #7800002000000000 -> #7800000000000000
-ddcan157 canonical #7800000400000000 -> #7800000000000000
-ddcan158 canonical #7800000040000000 -> #7800000000000000
-ddcan159 canonical #7800000008000000 -> #7800000000000000
-ddcan160 canonical #7800000000400000 -> #7800000000000000
-ddcan161 canonical #7800000000020000 -> #7800000000000000
-ddcan162 canonical #7800000000008000 -> #7800000000000000
-ddcan163 canonical #7800000000000200 -> #7800000000000000
-ddcan164 canonical #7800000000000040 -> #7800000000000000
-ddcan165 canonical #7800000000000008 -> #7800000000000000
-
-
--- Now the operators -- trying to check paths that might fail to
--- canonicalize propagated operands
-
------ Add:
--- Finites: neutral 0
-ddcan202 add 0E+384 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan203 add #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
--- tiny zero
-ddcan204 add 0E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Rounded
-ddcan205 add #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
--- tiny non zero
-ddcan206 add -1E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Inexact Rounded
-ddcan207 add #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
--- NaN: declets in payload
-ddcan211 add 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan212 add #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-ddcan213 add 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan214 add #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
--- sNaN: declets in payload
-ddcan215 add 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan216 add #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-ddcan217 add 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan218 add #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-ddcan220 add 0 #7880000000000000 -> #7800000000000000
-ddcan221 add #7880000000000000 0 -> #7800000000000000
--- Inf: coefficient continuation bits
-ddcan222 add 0 #7802000000000000 -> #7800000000000000
-ddcan223 add #7802000000000000 0 -> #7800000000000000
-ddcan224 add 0 #7800000000000001 -> #7800000000000000
-ddcan225 add #7800000000000001 0 -> #7800000000000000
-ddcan226 add 0 #7800002000000000 -> #7800000000000000
-ddcan227 add #7800002000000000 0 -> #7800000000000000
-
------ Class: [does not return encoded]
-
------ Compare:
-ddcan231 compare -Inf 1 -> #a238000000000001
-ddcan232 compare -Inf -Inf -> #2238000000000000
-ddcan233 compare 1 -Inf -> #2238000000000001
-ddcan234 compare #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff
-ddcan235 compare #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
-
------ CompareSig:
-ddcan241 comparesig -Inf 1 -> #a238000000000001
-ddcan242 comparesig -Inf -Inf -> #2238000000000000
-ddcan243 comparesig 1 -Inf -> #2238000000000001
-ddcan244 comparesig #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
-ddcan245 comparesig #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
-
------ Copy: [does not usually canonicalize]
--- finites
-ddcan250 copy #77ffff3fcff3fcff -> #77ffff3fcff3fcff
-ddcan251 copy #77fcff3fdff3fcff -> #77fcff3fdff3fcff
--- NaNs
-ddcan252 copy #7c03ff3fcff3fcff -> #7c03ff3fcff3fcff
-ddcan253 copy #7c00ff3fcff3ffff -> #7c00ff3fcff3ffff
-ddcan254 copy #7d00ff3fcff3fcff -> #7d00ff3fcff3fcff
-ddcan255 copy #7c04ff3fcff3fcff -> #7c04ff3fcff3fcff
--- sNaN
-ddcan256 copy #7e00ff3fcffffcff -> #7e00ff3fcffffcff
-ddcan257 copy #7e40ff3fcff3fcff -> #7e40ff3fcff3fcff
--- Inf
-ddcan258 copy #7a00000000000000 -> #7a00000000000000
-ddcan259 copy #7800200000000000 -> #7800200000000000
-
------ CopyAbs: [does not usually canonicalize]
--- finites
-ddcan260 copyabs #f7ffff3fcff3fcff -> #77ffff3fcff3fcff
-ddcan261 copyabs #f7fcff3fdff3fcff -> #77fcff3fdff3fcff
--- NaNs
-ddcan262 copyabs #fc03ff3fcff3fcff -> #7c03ff3fcff3fcff
-ddcan263 copyabs #fc00ff3fcff3ffff -> #7c00ff3fcff3ffff
-ddcan264 copyabs #fd00ff3fcff3fcff -> #7d00ff3fcff3fcff
-ddcan265 copyabs #fc04ff3fcff3fcff -> #7c04ff3fcff3fcff
--- sNaN
-ddcan266 copyabs #fe00ff3fcffffcff -> #7e00ff3fcffffcff
-ddcan267 copyabs #fe40ff3fcff3fcff -> #7e40ff3fcff3fcff
--- Inf
-ddcan268 copyabs #fa00000000000000 -> #7a00000000000000
-ddcan269 copyabs #f800200000000000 -> #7800200000000000
-
------ CopyNegate: [does not usually canonicalize]
--- finites
-ddcan270 copynegate #77ffff3fcff3fcff -> #f7ffff3fcff3fcff
-ddcan271 copynegate #77fcff3fdff3fcff -> #f7fcff3fdff3fcff
--- NaNs
-ddcan272 copynegate #7c03ff3fcff3fcff -> #fc03ff3fcff3fcff
-ddcan273 copynegate #7c00ff3fcff3ffff -> #fc00ff3fcff3ffff
-ddcan274 copynegate #7d00ff3fcff3fcff -> #fd00ff3fcff3fcff
-ddcan275 copynegate #7c04ff3fcff3fcff -> #fc04ff3fcff3fcff
--- sNaN
-ddcan276 copynegate #7e00ff3fcffffcff -> #fe00ff3fcffffcff
-ddcan277 copynegate #7e40ff3fcff3fcff -> #fe40ff3fcff3fcff
--- Inf
-ddcan278 copynegate #7a00000000000000 -> #fa00000000000000
-ddcan279 copynegate #7800200000000000 -> #f800200000000000
-
------ CopySign: [does not usually canonicalize]
--- finites
-ddcan280 copysign #77ffff3fcff3fcff -1 -> #f7ffff3fcff3fcff
-ddcan281 copysign #77fcff3fdff3fcff 1 -> #77fcff3fdff3fcff
--- NaNs
-ddcan282 copysign #7c03ff3fcff3fcff -1 -> #fc03ff3fcff3fcff
-ddcan283 copysign #7c00ff3fcff3ffff 1 -> #7c00ff3fcff3ffff
-ddcan284 copysign #7d00ff3fcff3fcff -1 -> #fd00ff3fcff3fcff
-ddcan285 copysign #7c04ff3fcff3fcff 1 -> #7c04ff3fcff3fcff
--- sNaN
-ddcan286 copysign #7e00ff3fcffffcff -1 -> #fe00ff3fcffffcff
-ddcan287 copysign #7e40ff3fcff3fcff 1 -> #7e40ff3fcff3fcff
--- Inf
-ddcan288 copysign #7a00000000000000 -1 -> #fa00000000000000
-ddcan289 copysign #7800200000000000 1 -> #7800200000000000
-
------ Multiply:
--- Finites: neutral 0
-ddcan302 multiply 1 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan303 multiply #77fcffffcff3fcff 1 -> #77fcff3fcff3fcff
--- negative
-ddcan306 multiply -1 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
-ddcan307 multiply #77fcffffcff3fcff -1 -> #f7fcff3fcff3fcff
--- NaN: declets in payload
-ddcan311 multiply 1 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan312 multiply #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-ddcan313 multiply 1 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan314 multiply #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
--- sNaN: declets in payload
-ddcan315 multiply 1 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan316 multiply #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-ddcan317 multiply 1 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan318 multiply #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-ddcan320 multiply 1 #7880000000000000 -> #7800000000000000
-ddcan321 multiply #7880000000000000 1 -> #7800000000000000
--- Inf: coefficient continuation bits
-ddcan322 multiply 1 #7802000000000000 -> #7800000000000000
-ddcan323 multiply #7802000000000000 1 -> #7800000000000000
-ddcan324 multiply 1 #7800000000000001 -> #7800000000000000
-ddcan325 multiply #7800000000000001 1 -> #7800000000000000
-ddcan326 multiply 1 #7800002000000000 -> #7800000000000000
-ddcan327 multiply #7800002000000000 1 -> #7800000000000000
-
------ Quantize:
-ddcan401 quantize #6e38ff3ffff3fcff 1 -> #6e38ff3fcff3fcff
-ddcan402 quantize #6e38ff3fcff3fdff 0 -> #6e38ff3fcff3fcff
-ddcan403 quantize #7880000000000000 Inf -> #7800000000000000
-ddcan404 quantize #7802000000000000 -Inf -> #7800000000000000
-ddcan410 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
-ddcan411 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
-ddcan412 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
-ddcan413 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
-ddcan414 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
-ddcan415 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
-ddcan416 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
-ddcan417 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
-
------ Subtract:
--- Finites: neutral 0
-ddcan502 subtract 0E+384 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
-ddcan503 subtract #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
--- tiny zero
-ddcan504 subtract 0E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Rounded
-ddcan505 subtract #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
--- tiny non zero
-ddcan506 subtract -1E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Inexact Rounded
-ddcan507 subtract #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
--- NaN: declets in payload
-ddcan511 subtract 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan512 subtract #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-ddcan513 subtract 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan514 subtract #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
--- sNaN: declets in payload
-ddcan515 subtract 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan516 subtract #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-ddcan517 subtract 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan518 subtract #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-ddcan520 subtract 0 #7880000000000000 -> #f800000000000000
-ddcan521 subtract #7880000000000000 0 -> #7800000000000000
--- Inf: coefficient continuation bits
-ddcan522 subtract 0 #7802000000000000 -> #f800000000000000
-ddcan523 subtract #7802000000000000 0 -> #7800000000000000
-ddcan524 subtract 0 #7800000000000001 -> #f800000000000000
-ddcan525 subtract #7800000000000001 0 -> #7800000000000000
-ddcan526 subtract 0 #7800002000000000 -> #f800000000000000
-ddcan527 subtract #7800002000000000 0 -> #7800000000000000
-
------ ToIntegral:
-ddcan601 tointegralx #6e38ff3ffff3fcff -> #6e38ff3fcff3fcff
-ddcan602 tointegralx #6e38ff3fcff3fdff -> #6e38ff3fcff3fcff
-ddcan603 tointegralx #7880000000000000 -> #7800000000000000
-ddcan604 tointegralx #7802000000000000 -> #7800000000000000
-ddcan610 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan611 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan612 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan613 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan614 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan615 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan616 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan617 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
--- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
-ddcan618 tointegralx #2238000000000fff -> #2238000000000cff
-ddcan619 tointegralx #2230000000000fff -> #2238000000000040 Inexact Rounded
-ddcan620 tointegralx #222c000000000fff -> #2238000000000004 Inexact Rounded
-ddcan621 tointegralx #2228000000000fff -> #2238000000000000 Inexact Rounded
-ddcan622 tointegralx #a238000000000fff -> #a238000000000cff
-ddcan623 tointegralx #a230000000000fff -> #a238000000000040 Inexact Rounded
-ddcan624 tointegralx #a22c000000000fff -> #a238000000000004 Inexact Rounded
-ddcan625 tointegralx #a228000000000fff -> #a238000000000000 Inexact Rounded
-
-
-
+------------------------------------------------------------------------
+-- ddCanonical.decTest -- test decDouble canonical results --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests that copy operations leave uncanonical operands
+-- unchanged, and vice versa
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Uncanonical declets are: abc, where:
+-- a=1,2,3
+-- b=6,7,e,f
+-- c=e,f
+
+-- assert some standard (canonical) values; this tests that FromString
+-- produces canonical results (many more in decimalNN)
+ddcan001 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
+ddcan002 apply 0 -> #2238000000000000
+ddcan003 apply 1 -> #2238000000000001
+ddcan004 apply -1 -> #a238000000000001
+ddcan005 apply Infinity -> #7800000000000000
+ddcan006 apply -Infinity -> #f800000000000000
+ddcan007 apply -NaN -> #fc00000000000000
+ddcan008 apply -sNaN -> #fe00000000000000
+ddcan009 apply NaN999999999999999 -> #7c00ff3fcff3fcff
+ddcan010 apply sNaN999999999999999 -> #7e00ff3fcff3fcff
+decan011 apply 9999999999999999 -> #6e38ff3fcff3fcff
+ddcan012 apply 7.50 -> #22300000000003d0
+ddcan013 apply 9.99 -> #22300000000000ff
+
+-- Base tests for canonical encodings (individual operator
+-- propagation is tested later)
+
+-- Finites: declets in coefficient
+ddcan021 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan022 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan023 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan024 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan025 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
+ddcan026 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
+ddcan027 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
+ddcan028 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
+ddcan030 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
+ddcan031 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
+ddcan032 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
+ddcan033 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
+ddcan035 canonical #77fcff3fdff3fcff -> #77fcff3fcff3fcff
+ddcan036 canonical #77fcff3feff3fcff -> #77fcff3fcff3fcff
+
+-- NaN: declets in payload
+ddcan100 canonical NaN999999999999999 -> #7c00ff3fcff3fcff
+ddcan101 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan102 canonical #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan103 canonical #7c00ffffcff3fcff -> #7c00ff3fcff3fcff
+ddcan104 canonical #7c00ff3ffff3fcff -> #7c00ff3fcff3fcff
+ddcan105 canonical #7c00ff3fcffffcff -> #7c00ff3fcff3fcff
+ddcan106 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
+ddcan107 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+ddcan110 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan112 canonical #7d00ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan113 canonical #7c80ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan114 canonical #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan115 canonical #7c20ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan116 canonical #7c10ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan117 canonical #7c08ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan118 canonical #7c04ff3fcff3fcff -> #7c00ff3fcff3fcff
+
+-- sNaN: declets in payload
+ddcan120 canonical sNaN999999999999999 -> #7e00ff3fcff3fcff
+ddcan121 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan122 canonical #7e03ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan123 canonical #7e00ffffcff3fcff -> #7e00ff3fcff3fcff
+ddcan124 canonical #7e00ff3ffff3fcff -> #7e00ff3fcff3fcff
+ddcan125 canonical #7e00ff3fcffffcff -> #7e00ff3fcff3fcff
+ddcan126 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
+ddcan127 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+ddcan130 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan132 canonical #7f00ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan133 canonical #7e80ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan134 canonical #7e40ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan135 canonical #7e20ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan136 canonical #7e10ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan137 canonical #7e08ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan138 canonical #7e04ff3fcff3fcff -> #7e00ff3fcff3fcff
+
+-- Inf: exponent continuation bits
+ddcan140 canonical #7800000000000000 -> #7800000000000000
+ddcan141 canonical #7900000000000000 -> #7800000000000000
+ddcan142 canonical #7a00000000000000 -> #7800000000000000
+ddcan143 canonical #7880000000000000 -> #7800000000000000
+ddcan144 canonical #7840000000000000 -> #7800000000000000
+ddcan145 canonical #7820000000000000 -> #7800000000000000
+ddcan146 canonical #7810000000000000 -> #7800000000000000
+ddcan147 canonical #7808000000000000 -> #7800000000000000
+ddcan148 canonical #7804000000000000 -> #7800000000000000
+
+-- Inf: coefficient continuation bits (first, last, and a few others)
+ddcan150 canonical #7800000000000000 -> #7800000000000000
+ddcan151 canonical #7802000000000000 -> #7800000000000000
+ddcan152 canonical #7800000000000001 -> #7800000000000000
+ddcan153 canonical #7801000000000000 -> #7800000000000000
+ddcan154 canonical #7800200000000000 -> #7800000000000000
+ddcan155 canonical #7800080000000000 -> #7800000000000000
+ddcan156 canonical #7800002000000000 -> #7800000000000000
+ddcan157 canonical #7800000400000000 -> #7800000000000000
+ddcan158 canonical #7800000040000000 -> #7800000000000000
+ddcan159 canonical #7800000008000000 -> #7800000000000000
+ddcan160 canonical #7800000000400000 -> #7800000000000000
+ddcan161 canonical #7800000000020000 -> #7800000000000000
+ddcan162 canonical #7800000000008000 -> #7800000000000000
+ddcan163 canonical #7800000000000200 -> #7800000000000000
+ddcan164 canonical #7800000000000040 -> #7800000000000000
+ddcan165 canonical #7800000000000008 -> #7800000000000000
+
+
+-- Now the operators -- trying to check paths that might fail to
+-- canonicalize propagated operands
+
+----- Add:
+-- Finites: neutral 0
+ddcan202 add 0E+384 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan203 add #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
+-- tiny zero
+ddcan204 add 0E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Rounded
+ddcan205 add #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
+-- tiny non zero
+ddcan206 add -1E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Inexact Rounded
+ddcan207 add #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
+-- NaN: declets in payload
+ddcan211 add 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan212 add #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+ddcan213 add 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan214 add #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
+-- sNaN: declets in payload
+ddcan215 add 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan216 add #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+ddcan217 add 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan218 add #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+ddcan220 add 0 #7880000000000000 -> #7800000000000000
+ddcan221 add #7880000000000000 0 -> #7800000000000000
+-- Inf: coefficient continuation bits
+ddcan222 add 0 #7802000000000000 -> #7800000000000000
+ddcan223 add #7802000000000000 0 -> #7800000000000000
+ddcan224 add 0 #7800000000000001 -> #7800000000000000
+ddcan225 add #7800000000000001 0 -> #7800000000000000
+ddcan226 add 0 #7800002000000000 -> #7800000000000000
+ddcan227 add #7800002000000000 0 -> #7800000000000000
+
+----- Class: [does not return encoded]
+
+----- Compare:
+ddcan231 compare -Inf 1 -> #a238000000000001
+ddcan232 compare -Inf -Inf -> #2238000000000000
+ddcan233 compare 1 -Inf -> #2238000000000001
+ddcan234 compare #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff
+ddcan235 compare #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
+
+----- CompareSig:
+ddcan241 comparesig -Inf 1 -> #a238000000000001
+ddcan242 comparesig -Inf -Inf -> #2238000000000000
+ddcan243 comparesig 1 -Inf -> #2238000000000001
+ddcan244 comparesig #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
+ddcan245 comparesig #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
+
+----- Copy: [does not usually canonicalize]
+-- finites
+ddcan250 copy #77ffff3fcff3fcff -> #77ffff3fcff3fcff
+ddcan251 copy #77fcff3fdff3fcff -> #77fcff3fdff3fcff
+-- NaNs
+ddcan252 copy #7c03ff3fcff3fcff -> #7c03ff3fcff3fcff
+ddcan253 copy #7c00ff3fcff3ffff -> #7c00ff3fcff3ffff
+ddcan254 copy #7d00ff3fcff3fcff -> #7d00ff3fcff3fcff
+ddcan255 copy #7c04ff3fcff3fcff -> #7c04ff3fcff3fcff
+-- sNaN
+ddcan256 copy #7e00ff3fcffffcff -> #7e00ff3fcffffcff
+ddcan257 copy #7e40ff3fcff3fcff -> #7e40ff3fcff3fcff
+-- Inf
+ddcan258 copy #7a00000000000000 -> #7a00000000000000
+ddcan259 copy #7800200000000000 -> #7800200000000000
+
+----- CopyAbs: [does not usually canonicalize]
+-- finites
+ddcan260 copyabs #f7ffff3fcff3fcff -> #77ffff3fcff3fcff
+ddcan261 copyabs #f7fcff3fdff3fcff -> #77fcff3fdff3fcff
+-- NaNs
+ddcan262 copyabs #fc03ff3fcff3fcff -> #7c03ff3fcff3fcff
+ddcan263 copyabs #fc00ff3fcff3ffff -> #7c00ff3fcff3ffff
+ddcan264 copyabs #fd00ff3fcff3fcff -> #7d00ff3fcff3fcff
+ddcan265 copyabs #fc04ff3fcff3fcff -> #7c04ff3fcff3fcff
+-- sNaN
+ddcan266 copyabs #fe00ff3fcffffcff -> #7e00ff3fcffffcff
+ddcan267 copyabs #fe40ff3fcff3fcff -> #7e40ff3fcff3fcff
+-- Inf
+ddcan268 copyabs #fa00000000000000 -> #7a00000000000000
+ddcan269 copyabs #f800200000000000 -> #7800200000000000
+
+----- CopyNegate: [does not usually canonicalize]
+-- finites
+ddcan270 copynegate #77ffff3fcff3fcff -> #f7ffff3fcff3fcff
+ddcan271 copynegate #77fcff3fdff3fcff -> #f7fcff3fdff3fcff
+-- NaNs
+ddcan272 copynegate #7c03ff3fcff3fcff -> #fc03ff3fcff3fcff
+ddcan273 copynegate #7c00ff3fcff3ffff -> #fc00ff3fcff3ffff
+ddcan274 copynegate #7d00ff3fcff3fcff -> #fd00ff3fcff3fcff
+ddcan275 copynegate #7c04ff3fcff3fcff -> #fc04ff3fcff3fcff
+-- sNaN
+ddcan276 copynegate #7e00ff3fcffffcff -> #fe00ff3fcffffcff
+ddcan277 copynegate #7e40ff3fcff3fcff -> #fe40ff3fcff3fcff
+-- Inf
+ddcan278 copynegate #7a00000000000000 -> #fa00000000000000
+ddcan279 copynegate #7800200000000000 -> #f800200000000000
+
+----- CopySign: [does not usually canonicalize]
+-- finites
+ddcan280 copysign #77ffff3fcff3fcff -1 -> #f7ffff3fcff3fcff
+ddcan281 copysign #77fcff3fdff3fcff 1 -> #77fcff3fdff3fcff
+-- NaNs
+ddcan282 copysign #7c03ff3fcff3fcff -1 -> #fc03ff3fcff3fcff
+ddcan283 copysign #7c00ff3fcff3ffff 1 -> #7c00ff3fcff3ffff
+ddcan284 copysign #7d00ff3fcff3fcff -1 -> #fd00ff3fcff3fcff
+ddcan285 copysign #7c04ff3fcff3fcff 1 -> #7c04ff3fcff3fcff
+-- sNaN
+ddcan286 copysign #7e00ff3fcffffcff -1 -> #fe00ff3fcffffcff
+ddcan287 copysign #7e40ff3fcff3fcff 1 -> #7e40ff3fcff3fcff
+-- Inf
+ddcan288 copysign #7a00000000000000 -1 -> #fa00000000000000
+ddcan289 copysign #7800200000000000 1 -> #7800200000000000
+
+----- Multiply:
+-- Finites: neutral 0
+ddcan302 multiply 1 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan303 multiply #77fcffffcff3fcff 1 -> #77fcff3fcff3fcff
+-- negative
+ddcan306 multiply -1 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
+ddcan307 multiply #77fcffffcff3fcff -1 -> #f7fcff3fcff3fcff
+-- NaN: declets in payload
+ddcan311 multiply 1 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan312 multiply #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+ddcan313 multiply 1 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan314 multiply #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+-- sNaN: declets in payload
+ddcan315 multiply 1 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan316 multiply #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+ddcan317 multiply 1 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan318 multiply #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+ddcan320 multiply 1 #7880000000000000 -> #7800000000000000
+ddcan321 multiply #7880000000000000 1 -> #7800000000000000
+-- Inf: coefficient continuation bits
+ddcan322 multiply 1 #7802000000000000 -> #7800000000000000
+ddcan323 multiply #7802000000000000 1 -> #7800000000000000
+ddcan324 multiply 1 #7800000000000001 -> #7800000000000000
+ddcan325 multiply #7800000000000001 1 -> #7800000000000000
+ddcan326 multiply 1 #7800002000000000 -> #7800000000000000
+ddcan327 multiply #7800002000000000 1 -> #7800000000000000
+
+----- Quantize:
+ddcan401 quantize #6e38ff3ffff3fcff 1 -> #6e38ff3fcff3fcff
+ddcan402 quantize #6e38ff3fcff3fdff 0 -> #6e38ff3fcff3fcff
+ddcan403 quantize #7880000000000000 Inf -> #7800000000000000
+ddcan404 quantize #7802000000000000 -Inf -> #7800000000000000
+ddcan410 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+ddcan411 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+ddcan412 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+ddcan413 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+ddcan414 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+ddcan415 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+ddcan416 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+ddcan417 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+
+----- Subtract:
+-- Finites: neutral 0
+ddcan502 subtract 0E+384 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
+ddcan503 subtract #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
+-- tiny zero
+ddcan504 subtract 0E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Rounded
+ddcan505 subtract #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
+-- tiny non zero
+ddcan506 subtract -1E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Inexact Rounded
+ddcan507 subtract #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
+-- NaN: declets in payload
+ddcan511 subtract 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan512 subtract #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+ddcan513 subtract 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan514 subtract #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
+-- sNaN: declets in payload
+ddcan515 subtract 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan516 subtract #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+ddcan517 subtract 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan518 subtract #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+ddcan520 subtract 0 #7880000000000000 -> #f800000000000000
+ddcan521 subtract #7880000000000000 0 -> #7800000000000000
+-- Inf: coefficient continuation bits
+ddcan522 subtract 0 #7802000000000000 -> #f800000000000000
+ddcan523 subtract #7802000000000000 0 -> #7800000000000000
+ddcan524 subtract 0 #7800000000000001 -> #f800000000000000
+ddcan525 subtract #7800000000000001 0 -> #7800000000000000
+ddcan526 subtract 0 #7800002000000000 -> #f800000000000000
+ddcan527 subtract #7800002000000000 0 -> #7800000000000000
+
+----- ToIntegral:
+ddcan601 tointegralx #6e38ff3ffff3fcff -> #6e38ff3fcff3fcff
+ddcan602 tointegralx #6e38ff3fcff3fdff -> #6e38ff3fcff3fcff
+ddcan603 tointegralx #7880000000000000 -> #7800000000000000
+ddcan604 tointegralx #7802000000000000 -> #7800000000000000
+ddcan610 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan611 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan612 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan613 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan614 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan615 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan616 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan617 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+-- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
+ddcan618 tointegralx #2238000000000fff -> #2238000000000cff
+ddcan619 tointegralx #2230000000000fff -> #2238000000000040 Inexact Rounded
+ddcan620 tointegralx #222c000000000fff -> #2238000000000004 Inexact Rounded
+ddcan621 tointegralx #2228000000000fff -> #2238000000000000 Inexact Rounded
+ddcan622 tointegralx #a238000000000fff -> #a238000000000cff
+ddcan623 tointegralx #a230000000000fff -> #a238000000000040 Inexact Rounded
+ddcan624 tointegralx #a22c000000000fff -> #a238000000000004 Inexact Rounded
+ddcan625 tointegralx #a228000000000fff -> #a238000000000000 Inexact Rounded
+
+
+
diff --git a/Lib/test/decimaltestdata/ddClass.decTest b/Lib/test/decimaltestdata/ddClass.decTest
index bb34c42d4a..a1d233b86d 100644
--- a/Lib/test/decimaltestdata/ddClass.decTest
+++ b/Lib/test/decimaltestdata/ddClass.decTest
@@ -1,76 +1,76 @@
-------------------------------------------------------------------------
--- ddClass.decTest -- decDouble Class operations --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- [New 2006.11.27]
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddcla001 class 0 -> +Zero
-ddcla002 class 0.00 -> +Zero
-ddcla003 class 0E+5 -> +Zero
-ddcla004 class 1E-396 -> +Subnormal
-ddcla005 class 0.1E-383 -> +Subnormal
-ddcla006 class 0.999999999999999E-383 -> +Subnormal
-ddcla007 class 1.000000000000000E-383 -> +Normal
-ddcla008 class 1E-383 -> +Normal
-ddcla009 class 1E-100 -> +Normal
-ddcla010 class 1E-10 -> +Normal
-ddcla012 class 1E-1 -> +Normal
-ddcla013 class 1 -> +Normal
-ddcla014 class 2.50 -> +Normal
-ddcla015 class 100.100 -> +Normal
-ddcla016 class 1E+30 -> +Normal
-ddcla017 class 1E+384 -> +Normal
-ddcla018 class 9.999999999999999E+384 -> +Normal
-ddcla019 class Inf -> +Infinity
-
-ddcla021 class -0 -> -Zero
-ddcla022 class -0.00 -> -Zero
-ddcla023 class -0E+5 -> -Zero
-ddcla024 class -1E-396 -> -Subnormal
-ddcla025 class -0.1E-383 -> -Subnormal
-ddcla026 class -0.999999999999999E-383 -> -Subnormal
-ddcla027 class -1.000000000000000E-383 -> -Normal
-ddcla028 class -1E-383 -> -Normal
-ddcla029 class -1E-100 -> -Normal
-ddcla030 class -1E-10 -> -Normal
-ddcla032 class -1E-1 -> -Normal
-ddcla033 class -1 -> -Normal
-ddcla034 class -2.50 -> -Normal
-ddcla035 class -100.100 -> -Normal
-ddcla036 class -1E+30 -> -Normal
-ddcla037 class -1E+384 -> -Normal
-ddcla038 class -9.999999999999999E+384 -> -Normal
-ddcla039 class -Inf -> -Infinity
-
-ddcla041 class NaN -> NaN
-ddcla042 class -NaN -> NaN
-ddcla043 class +NaN12345 -> NaN
-ddcla044 class sNaN -> sNaN
-ddcla045 class -sNaN -> sNaN
-ddcla046 class +sNaN12345 -> sNaN
-
-
-
+------------------------------------------------------------------------
+-- ddClass.decTest -- decDouble Class operations --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- [New 2006.11.27]
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddcla001 class 0 -> +Zero
+ddcla002 class 0.00 -> +Zero
+ddcla003 class 0E+5 -> +Zero
+ddcla004 class 1E-396 -> +Subnormal
+ddcla005 class 0.1E-383 -> +Subnormal
+ddcla006 class 0.999999999999999E-383 -> +Subnormal
+ddcla007 class 1.000000000000000E-383 -> +Normal
+ddcla008 class 1E-383 -> +Normal
+ddcla009 class 1E-100 -> +Normal
+ddcla010 class 1E-10 -> +Normal
+ddcla012 class 1E-1 -> +Normal
+ddcla013 class 1 -> +Normal
+ddcla014 class 2.50 -> +Normal
+ddcla015 class 100.100 -> +Normal
+ddcla016 class 1E+30 -> +Normal
+ddcla017 class 1E+384 -> +Normal
+ddcla018 class 9.999999999999999E+384 -> +Normal
+ddcla019 class Inf -> +Infinity
+
+ddcla021 class -0 -> -Zero
+ddcla022 class -0.00 -> -Zero
+ddcla023 class -0E+5 -> -Zero
+ddcla024 class -1E-396 -> -Subnormal
+ddcla025 class -0.1E-383 -> -Subnormal
+ddcla026 class -0.999999999999999E-383 -> -Subnormal
+ddcla027 class -1.000000000000000E-383 -> -Normal
+ddcla028 class -1E-383 -> -Normal
+ddcla029 class -1E-100 -> -Normal
+ddcla030 class -1E-10 -> -Normal
+ddcla032 class -1E-1 -> -Normal
+ddcla033 class -1 -> -Normal
+ddcla034 class -2.50 -> -Normal
+ddcla035 class -100.100 -> -Normal
+ddcla036 class -1E+30 -> -Normal
+ddcla037 class -1E+384 -> -Normal
+ddcla038 class -9.999999999999999E+384 -> -Normal
+ddcla039 class -Inf -> -Infinity
+
+ddcla041 class NaN -> NaN
+ddcla042 class -NaN -> NaN
+ddcla043 class +NaN12345 -> NaN
+ddcla044 class sNaN -> sNaN
+ddcla045 class -sNaN -> sNaN
+ddcla046 class +sNaN12345 -> sNaN
+
+
+
diff --git a/Lib/test/decimaltestdata/ddCompare.decTest b/Lib/test/decimaltestdata/ddCompare.decTest
index 6debfc7a13..a20ae210cc 100644
--- a/Lib/test/decimaltestdata/ddCompare.decTest
+++ b/Lib/test/decimaltestdata/ddCompare.decTest
@@ -1,744 +1,744 @@
-------------------------------------------------------------------------
--- ddCompare.decTest -- decDouble comparison that allows quiet NaNs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddcom001 compare -2 -2 -> 0
-ddcom002 compare -2 -1 -> -1
-ddcom003 compare -2 0 -> -1
-ddcom004 compare -2 1 -> -1
-ddcom005 compare -2 2 -> -1
-ddcom006 compare -1 -2 -> 1
-ddcom007 compare -1 -1 -> 0
-ddcom008 compare -1 0 -> -1
-ddcom009 compare -1 1 -> -1
-ddcom010 compare -1 2 -> -1
-ddcom011 compare 0 -2 -> 1
-ddcom012 compare 0 -1 -> 1
-ddcom013 compare 0 0 -> 0
-ddcom014 compare 0 1 -> -1
-ddcom015 compare 0 2 -> -1
-ddcom016 compare 1 -2 -> 1
-ddcom017 compare 1 -1 -> 1
-ddcom018 compare 1 0 -> 1
-ddcom019 compare 1 1 -> 0
-ddcom020 compare 1 2 -> -1
-ddcom021 compare 2 -2 -> 1
-ddcom022 compare 2 -1 -> 1
-ddcom023 compare 2 0 -> 1
-ddcom025 compare 2 1 -> 1
-ddcom026 compare 2 2 -> 0
-
-ddcom031 compare -20 -20 -> 0
-ddcom032 compare -20 -10 -> -1
-ddcom033 compare -20 00 -> -1
-ddcom034 compare -20 10 -> -1
-ddcom035 compare -20 20 -> -1
-ddcom036 compare -10 -20 -> 1
-ddcom037 compare -10 -10 -> 0
-ddcom038 compare -10 00 -> -1
-ddcom039 compare -10 10 -> -1
-ddcom040 compare -10 20 -> -1
-ddcom041 compare 00 -20 -> 1
-ddcom042 compare 00 -10 -> 1
-ddcom043 compare 00 00 -> 0
-ddcom044 compare 00 10 -> -1
-ddcom045 compare 00 20 -> -1
-ddcom046 compare 10 -20 -> 1
-ddcom047 compare 10 -10 -> 1
-ddcom048 compare 10 00 -> 1
-ddcom049 compare 10 10 -> 0
-ddcom050 compare 10 20 -> -1
-ddcom051 compare 20 -20 -> 1
-ddcom052 compare 20 -10 -> 1
-ddcom053 compare 20 00 -> 1
-ddcom055 compare 20 10 -> 1
-ddcom056 compare 20 20 -> 0
-
-ddcom061 compare -2.0 -2.0 -> 0
-ddcom062 compare -2.0 -1.0 -> -1
-ddcom063 compare -2.0 0.0 -> -1
-ddcom064 compare -2.0 1.0 -> -1
-ddcom065 compare -2.0 2.0 -> -1
-ddcom066 compare -1.0 -2.0 -> 1
-ddcom067 compare -1.0 -1.0 -> 0
-ddcom068 compare -1.0 0.0 -> -1
-ddcom069 compare -1.0 1.0 -> -1
-ddcom070 compare -1.0 2.0 -> -1
-ddcom071 compare 0.0 -2.0 -> 1
-ddcom072 compare 0.0 -1.0 -> 1
-ddcom073 compare 0.0 0.0 -> 0
-ddcom074 compare 0.0 1.0 -> -1
-ddcom075 compare 0.0 2.0 -> -1
-ddcom076 compare 1.0 -2.0 -> 1
-ddcom077 compare 1.0 -1.0 -> 1
-ddcom078 compare 1.0 0.0 -> 1
-ddcom079 compare 1.0 1.0 -> 0
-ddcom080 compare 1.0 2.0 -> -1
-ddcom081 compare 2.0 -2.0 -> 1
-ddcom082 compare 2.0 -1.0 -> 1
-ddcom083 compare 2.0 0.0 -> 1
-ddcom085 compare 2.0 1.0 -> 1
-ddcom086 compare 2.0 2.0 -> 0
-ddcom087 compare 1.0 0.1 -> 1
-ddcom088 compare 0.1 1.0 -> -1
-
--- now some cases which might overflow if subtract were used
-ddcom095 compare 9.999999999999999E+384 9.999999999999999E+384 -> 0
-ddcom096 compare -9.999999999999999E+384 9.999999999999999E+384 -> -1
-ddcom097 compare 9.999999999999999E+384 -9.999999999999999E+384 -> 1
-ddcom098 compare -9.999999999999999E+384 -9.999999999999999E+384 -> 0
-
--- some differing length/exponent cases
-ddcom100 compare 7.0 7.0 -> 0
-ddcom101 compare 7.0 7 -> 0
-ddcom102 compare 7 7.0 -> 0
-ddcom103 compare 7E+0 7.0 -> 0
-ddcom104 compare 70E-1 7.0 -> 0
-ddcom105 compare 0.7E+1 7 -> 0
-ddcom106 compare 70E-1 7 -> 0
-ddcom107 compare 7.0 7E+0 -> 0
-ddcom108 compare 7.0 70E-1 -> 0
-ddcom109 compare 7 0.7E+1 -> 0
-ddcom110 compare 7 70E-1 -> 0
-
-ddcom120 compare 8.0 7.0 -> 1
-ddcom121 compare 8.0 7 -> 1
-ddcom122 compare 8 7.0 -> 1
-ddcom123 compare 8E+0 7.0 -> 1
-ddcom124 compare 80E-1 7.0 -> 1
-ddcom125 compare 0.8E+1 7 -> 1
-ddcom126 compare 80E-1 7 -> 1
-ddcom127 compare 8.0 7E+0 -> 1
-ddcom128 compare 8.0 70E-1 -> 1
-ddcom129 compare 8 0.7E+1 -> 1
-ddcom130 compare 8 70E-1 -> 1
-
-ddcom140 compare 8.0 9.0 -> -1
-ddcom141 compare 8.0 9 -> -1
-ddcom142 compare 8 9.0 -> -1
-ddcom143 compare 8E+0 9.0 -> -1
-ddcom144 compare 80E-1 9.0 -> -1
-ddcom145 compare 0.8E+1 9 -> -1
-ddcom146 compare 80E-1 9 -> -1
-ddcom147 compare 8.0 9E+0 -> -1
-ddcom148 compare 8.0 90E-1 -> -1
-ddcom149 compare 8 0.9E+1 -> -1
-ddcom150 compare 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ddcom200 compare -7.0 7.0 -> -1
-ddcom201 compare -7.0 7 -> -1
-ddcom202 compare -7 7.0 -> -1
-ddcom203 compare -7E+0 7.0 -> -1
-ddcom204 compare -70E-1 7.0 -> -1
-ddcom205 compare -0.7E+1 7 -> -1
-ddcom206 compare -70E-1 7 -> -1
-ddcom207 compare -7.0 7E+0 -> -1
-ddcom208 compare -7.0 70E-1 -> -1
-ddcom209 compare -7 0.7E+1 -> -1
-ddcom210 compare -7 70E-1 -> -1
-
-ddcom220 compare -8.0 7.0 -> -1
-ddcom221 compare -8.0 7 -> -1
-ddcom222 compare -8 7.0 -> -1
-ddcom223 compare -8E+0 7.0 -> -1
-ddcom224 compare -80E-1 7.0 -> -1
-ddcom225 compare -0.8E+1 7 -> -1
-ddcom226 compare -80E-1 7 -> -1
-ddcom227 compare -8.0 7E+0 -> -1
-ddcom228 compare -8.0 70E-1 -> -1
-ddcom229 compare -8 0.7E+1 -> -1
-ddcom230 compare -8 70E-1 -> -1
-
-ddcom240 compare -8.0 9.0 -> -1
-ddcom241 compare -8.0 9 -> -1
-ddcom242 compare -8 9.0 -> -1
-ddcom243 compare -8E+0 9.0 -> -1
-ddcom244 compare -80E-1 9.0 -> -1
-ddcom245 compare -0.8E+1 9 -> -1
-ddcom246 compare -80E-1 9 -> -1
-ddcom247 compare -8.0 9E+0 -> -1
-ddcom248 compare -8.0 90E-1 -> -1
-ddcom249 compare -8 0.9E+1 -> -1
-ddcom250 compare -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ddcom300 compare 7.0 -7.0 -> 1
-ddcom301 compare 7.0 -7 -> 1
-ddcom302 compare 7 -7.0 -> 1
-ddcom303 compare 7E+0 -7.0 -> 1
-ddcom304 compare 70E-1 -7.0 -> 1
-ddcom305 compare .7E+1 -7 -> 1
-ddcom306 compare 70E-1 -7 -> 1
-ddcom307 compare 7.0 -7E+0 -> 1
-ddcom308 compare 7.0 -70E-1 -> 1
-ddcom309 compare 7 -.7E+1 -> 1
-ddcom310 compare 7 -70E-1 -> 1
-
-ddcom320 compare 8.0 -7.0 -> 1
-ddcom321 compare 8.0 -7 -> 1
-ddcom322 compare 8 -7.0 -> 1
-ddcom323 compare 8E+0 -7.0 -> 1
-ddcom324 compare 80E-1 -7.0 -> 1
-ddcom325 compare .8E+1 -7 -> 1
-ddcom326 compare 80E-1 -7 -> 1
-ddcom327 compare 8.0 -7E+0 -> 1
-ddcom328 compare 8.0 -70E-1 -> 1
-ddcom329 compare 8 -.7E+1 -> 1
-ddcom330 compare 8 -70E-1 -> 1
-
-ddcom340 compare 8.0 -9.0 -> 1
-ddcom341 compare 8.0 -9 -> 1
-ddcom342 compare 8 -9.0 -> 1
-ddcom343 compare 8E+0 -9.0 -> 1
-ddcom344 compare 80E-1 -9.0 -> 1
-ddcom345 compare .8E+1 -9 -> 1
-ddcom346 compare 80E-1 -9 -> 1
-ddcom347 compare 8.0 -9E+0 -> 1
-ddcom348 compare 8.0 -90E-1 -> 1
-ddcom349 compare 8 -.9E+1 -> 1
-ddcom350 compare 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-ddcom400 compare -7.0 -7.0 -> 0
-ddcom401 compare -7.0 -7 -> 0
-ddcom402 compare -7 -7.0 -> 0
-ddcom403 compare -7E+0 -7.0 -> 0
-ddcom404 compare -70E-1 -7.0 -> 0
-ddcom405 compare -.7E+1 -7 -> 0
-ddcom406 compare -70E-1 -7 -> 0
-ddcom407 compare -7.0 -7E+0 -> 0
-ddcom408 compare -7.0 -70E-1 -> 0
-ddcom409 compare -7 -.7E+1 -> 0
-ddcom410 compare -7 -70E-1 -> 0
-
-ddcom420 compare -8.0 -7.0 -> -1
-ddcom421 compare -8.0 -7 -> -1
-ddcom422 compare -8 -7.0 -> -1
-ddcom423 compare -8E+0 -7.0 -> -1
-ddcom424 compare -80E-1 -7.0 -> -1
-ddcom425 compare -.8E+1 -7 -> -1
-ddcom426 compare -80E-1 -7 -> -1
-ddcom427 compare -8.0 -7E+0 -> -1
-ddcom428 compare -8.0 -70E-1 -> -1
-ddcom429 compare -8 -.7E+1 -> -1
-ddcom430 compare -8 -70E-1 -> -1
-
-ddcom440 compare -8.0 -9.0 -> 1
-ddcom441 compare -8.0 -9 -> 1
-ddcom442 compare -8 -9.0 -> 1
-ddcom443 compare -8E+0 -9.0 -> 1
-ddcom444 compare -80E-1 -9.0 -> 1
-ddcom445 compare -.8E+1 -9 -> 1
-ddcom446 compare -80E-1 -9 -> 1
-ddcom447 compare -8.0 -9E+0 -> 1
-ddcom448 compare -8.0 -90E-1 -> 1
-ddcom449 compare -8 -.9E+1 -> 1
-ddcom450 compare -8 -90E-1 -> 1
-
--- misalignment traps for little-endian
-ddcom451 compare 1.0 0.1 -> 1
-ddcom452 compare 0.1 1.0 -> -1
-ddcom453 compare 10.0 0.1 -> 1
-ddcom454 compare 0.1 10.0 -> -1
-ddcom455 compare 100 1.0 -> 1
-ddcom456 compare 1.0 100 -> -1
-ddcom457 compare 1000 10.0 -> 1
-ddcom458 compare 10.0 1000 -> -1
-ddcom459 compare 10000 100.0 -> 1
-ddcom460 compare 100.0 10000 -> -1
-ddcom461 compare 100000 1000.0 -> 1
-ddcom462 compare 1000.0 100000 -> -1
-ddcom463 compare 1000000 10000.0 -> 1
-ddcom464 compare 10000.0 1000000 -> -1
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-ddcom473 compare 123.4560000000000E-89 123.456E-89 -> 0
-ddcom474 compare 123.456000000000E+89 123.456E+89 -> 0
-ddcom475 compare 123.45600000000E-89 123.456E-89 -> 0
-ddcom476 compare 123.4560000000E+89 123.456E+89 -> 0
-ddcom477 compare 123.456000000E-89 123.456E-89 -> 0
-ddcom478 compare 123.45600000E+89 123.456E+89 -> 0
-ddcom479 compare 123.4560000E-89 123.456E-89 -> 0
-ddcom480 compare 123.456000E+89 123.456E+89 -> 0
-ddcom481 compare 123.45600E-89 123.456E-89 -> 0
-ddcom482 compare 123.4560E+89 123.456E+89 -> 0
-ddcom483 compare 123.456E-89 123.456E-89 -> 0
-ddcom487 compare 123.456E+89 123.4560000000000E+89 -> 0
-ddcom488 compare 123.456E-89 123.456000000000E-89 -> 0
-ddcom489 compare 123.456E+89 123.45600000000E+89 -> 0
-ddcom490 compare 123.456E-89 123.4560000000E-89 -> 0
-ddcom491 compare 123.456E+89 123.456000000E+89 -> 0
-ddcom492 compare 123.456E-89 123.45600000E-89 -> 0
-ddcom493 compare 123.456E+89 123.4560000E+89 -> 0
-ddcom494 compare 123.456E-89 123.456000E-89 -> 0
-ddcom495 compare 123.456E+89 123.45600E+89 -> 0
-ddcom496 compare 123.456E-89 123.4560E-89 -> 0
-ddcom497 compare 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-ddcom500 compare 1 1E-15 -> 1
-ddcom501 compare 1 1E-14 -> 1
-ddcom502 compare 1 1E-13 -> 1
-ddcom503 compare 1 1E-12 -> 1
-ddcom504 compare 1 1E-11 -> 1
-ddcom505 compare 1 1E-10 -> 1
-ddcom506 compare 1 1E-9 -> 1
-ddcom507 compare 1 1E-8 -> 1
-ddcom508 compare 1 1E-7 -> 1
-ddcom509 compare 1 1E-6 -> 1
-ddcom510 compare 1 1E-5 -> 1
-ddcom511 compare 1 1E-4 -> 1
-ddcom512 compare 1 1E-3 -> 1
-ddcom513 compare 1 1E-2 -> 1
-ddcom514 compare 1 1E-1 -> 1
-ddcom515 compare 1 1E-0 -> 0
-ddcom516 compare 1 1E+1 -> -1
-ddcom517 compare 1 1E+2 -> -1
-ddcom518 compare 1 1E+3 -> -1
-ddcom519 compare 1 1E+4 -> -1
-ddcom521 compare 1 1E+5 -> -1
-ddcom522 compare 1 1E+6 -> -1
-ddcom523 compare 1 1E+7 -> -1
-ddcom524 compare 1 1E+8 -> -1
-ddcom525 compare 1 1E+9 -> -1
-ddcom526 compare 1 1E+10 -> -1
-ddcom527 compare 1 1E+11 -> -1
-ddcom528 compare 1 1E+12 -> -1
-ddcom529 compare 1 1E+13 -> -1
-ddcom530 compare 1 1E+14 -> -1
-ddcom531 compare 1 1E+15 -> -1
--- LR swap
-ddcom540 compare 1E-15 1 -> -1
-ddcom541 compare 1E-14 1 -> -1
-ddcom542 compare 1E-13 1 -> -1
-ddcom543 compare 1E-12 1 -> -1
-ddcom544 compare 1E-11 1 -> -1
-ddcom545 compare 1E-10 1 -> -1
-ddcom546 compare 1E-9 1 -> -1
-ddcom547 compare 1E-8 1 -> -1
-ddcom548 compare 1E-7 1 -> -1
-ddcom549 compare 1E-6 1 -> -1
-ddcom550 compare 1E-5 1 -> -1
-ddcom551 compare 1E-4 1 -> -1
-ddcom552 compare 1E-3 1 -> -1
-ddcom553 compare 1E-2 1 -> -1
-ddcom554 compare 1E-1 1 -> -1
-ddcom555 compare 1E-0 1 -> 0
-ddcom556 compare 1E+1 1 -> 1
-ddcom557 compare 1E+2 1 -> 1
-ddcom558 compare 1E+3 1 -> 1
-ddcom559 compare 1E+4 1 -> 1
-ddcom561 compare 1E+5 1 -> 1
-ddcom562 compare 1E+6 1 -> 1
-ddcom563 compare 1E+7 1 -> 1
-ddcom564 compare 1E+8 1 -> 1
-ddcom565 compare 1E+9 1 -> 1
-ddcom566 compare 1E+10 1 -> 1
-ddcom567 compare 1E+11 1 -> 1
-ddcom568 compare 1E+12 1 -> 1
-ddcom569 compare 1E+13 1 -> 1
-ddcom570 compare 1E+14 1 -> 1
-ddcom571 compare 1E+15 1 -> 1
--- similar with a useful coefficient, one side only
-ddcom580 compare 0.000000987654321 1E-15 -> 1
-ddcom581 compare 0.000000987654321 1E-14 -> 1
-ddcom582 compare 0.000000987654321 1E-13 -> 1
-ddcom583 compare 0.000000987654321 1E-12 -> 1
-ddcom584 compare 0.000000987654321 1E-11 -> 1
-ddcom585 compare 0.000000987654321 1E-10 -> 1
-ddcom586 compare 0.000000987654321 1E-9 -> 1
-ddcom587 compare 0.000000987654321 1E-8 -> 1
-ddcom588 compare 0.000000987654321 1E-7 -> 1
-ddcom589 compare 0.000000987654321 1E-6 -> -1
-ddcom590 compare 0.000000987654321 1E-5 -> -1
-ddcom591 compare 0.000000987654321 1E-4 -> -1
-ddcom592 compare 0.000000987654321 1E-3 -> -1
-ddcom593 compare 0.000000987654321 1E-2 -> -1
-ddcom594 compare 0.000000987654321 1E-1 -> -1
-ddcom595 compare 0.000000987654321 1E-0 -> -1
-ddcom596 compare 0.000000987654321 1E+1 -> -1
-ddcom597 compare 0.000000987654321 1E+2 -> -1
-ddcom598 compare 0.000000987654321 1E+3 -> -1
-ddcom599 compare 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-ddcom600 compare 12 12.2345 -> -1
-ddcom601 compare 12.0 12.2345 -> -1
-ddcom602 compare 12.00 12.2345 -> -1
-ddcom603 compare 12.000 12.2345 -> -1
-ddcom604 compare 12.0000 12.2345 -> -1
-ddcom605 compare 12.00000 12.2345 -> -1
-ddcom606 compare 12.000000 12.2345 -> -1
-ddcom607 compare 12.0000000 12.2345 -> -1
-ddcom608 compare 12.00000000 12.2345 -> -1
-ddcom609 compare 12.000000000 12.2345 -> -1
-ddcom610 compare 12.1234 12 -> 1
-ddcom611 compare 12.1234 12.0 -> 1
-ddcom612 compare 12.1234 12.00 -> 1
-ddcom613 compare 12.1234 12.000 -> 1
-ddcom614 compare 12.1234 12.0000 -> 1
-ddcom615 compare 12.1234 12.00000 -> 1
-ddcom616 compare 12.1234 12.000000 -> 1
-ddcom617 compare 12.1234 12.0000000 -> 1
-ddcom618 compare 12.1234 12.00000000 -> 1
-ddcom619 compare 12.1234 12.000000000 -> 1
-ddcom620 compare -12 -12.2345 -> 1
-ddcom621 compare -12.0 -12.2345 -> 1
-ddcom622 compare -12.00 -12.2345 -> 1
-ddcom623 compare -12.000 -12.2345 -> 1
-ddcom624 compare -12.0000 -12.2345 -> 1
-ddcom625 compare -12.00000 -12.2345 -> 1
-ddcom626 compare -12.000000 -12.2345 -> 1
-ddcom627 compare -12.0000000 -12.2345 -> 1
-ddcom628 compare -12.00000000 -12.2345 -> 1
-ddcom629 compare -12.000000000 -12.2345 -> 1
-ddcom630 compare -12.1234 -12 -> -1
-ddcom631 compare -12.1234 -12.0 -> -1
-ddcom632 compare -12.1234 -12.00 -> -1
-ddcom633 compare -12.1234 -12.000 -> -1
-ddcom634 compare -12.1234 -12.0000 -> -1
-ddcom635 compare -12.1234 -12.00000 -> -1
-ddcom636 compare -12.1234 -12.000000 -> -1
-ddcom637 compare -12.1234 -12.0000000 -> -1
-ddcom638 compare -12.1234 -12.00000000 -> -1
-ddcom639 compare -12.1234 -12.000000000 -> -1
-
--- extended zeros
-ddcom640 compare 0 0 -> 0
-ddcom641 compare 0 -0 -> 0
-ddcom642 compare 0 -0.0 -> 0
-ddcom643 compare 0 0.0 -> 0
-ddcom644 compare -0 0 -> 0
-ddcom645 compare -0 -0 -> 0
-ddcom646 compare -0 -0.0 -> 0
-ddcom647 compare -0 0.0 -> 0
-ddcom648 compare 0.0 0 -> 0
-ddcom649 compare 0.0 -0 -> 0
-ddcom650 compare 0.0 -0.0 -> 0
-ddcom651 compare 0.0 0.0 -> 0
-ddcom652 compare -0.0 0 -> 0
-ddcom653 compare -0.0 -0 -> 0
-ddcom654 compare -0.0 -0.0 -> 0
-ddcom655 compare -0.0 0.0 -> 0
-
-ddcom656 compare -0E1 0.0 -> 0
-ddcom657 compare -0E2 0.0 -> 0
-ddcom658 compare 0E1 0.0 -> 0
-ddcom659 compare 0E2 0.0 -> 0
-ddcom660 compare -0E1 0 -> 0
-ddcom661 compare -0E2 0 -> 0
-ddcom662 compare 0E1 0 -> 0
-ddcom663 compare 0E2 0 -> 0
-ddcom664 compare -0E1 -0E1 -> 0
-ddcom665 compare -0E2 -0E1 -> 0
-ddcom666 compare 0E1 -0E1 -> 0
-ddcom667 compare 0E2 -0E1 -> 0
-ddcom668 compare -0E1 -0E2 -> 0
-ddcom669 compare -0E2 -0E2 -> 0
-ddcom670 compare 0E1 -0E2 -> 0
-ddcom671 compare 0E2 -0E2 -> 0
-ddcom672 compare -0E1 0E1 -> 0
-ddcom673 compare -0E2 0E1 -> 0
-ddcom674 compare 0E1 0E1 -> 0
-ddcom675 compare 0E2 0E1 -> 0
-ddcom676 compare -0E1 0E2 -> 0
-ddcom677 compare -0E2 0E2 -> 0
-ddcom678 compare 0E1 0E2 -> 0
-ddcom679 compare 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-ddcom680 compare 12 12 -> 0
-ddcom681 compare 12 12.0 -> 0
-ddcom682 compare 12 12.00 -> 0
-ddcom683 compare 12 12.000 -> 0
-ddcom684 compare 12 12.0000 -> 0
-ddcom685 compare 12 12.00000 -> 0
-ddcom686 compare 12 12.000000 -> 0
-ddcom687 compare 12 12.0000000 -> 0
-ddcom688 compare 12 12.00000000 -> 0
-ddcom689 compare 12 12.000000000 -> 0
-ddcom690 compare 12 12 -> 0
-ddcom691 compare 12.0 12 -> 0
-ddcom692 compare 12.00 12 -> 0
-ddcom693 compare 12.000 12 -> 0
-ddcom694 compare 12.0000 12 -> 0
-ddcom695 compare 12.00000 12 -> 0
-ddcom696 compare 12.000000 12 -> 0
-ddcom697 compare 12.0000000 12 -> 0
-ddcom698 compare 12.00000000 12 -> 0
-ddcom699 compare 12.000000000 12 -> 0
-
--- first, second, & last digit
-ddcom700 compare 1234567890123456 1234567890123455 -> 1
-ddcom701 compare 1234567890123456 1234567890123456 -> 0
-ddcom702 compare 1234567890123456 1234567890123457 -> -1
-ddcom703 compare 1234567890123456 0234567890123456 -> 1
-ddcom704 compare 1234567890123456 1234567890123456 -> 0
-ddcom705 compare 1234567890123456 2234567890123456 -> -1
-ddcom706 compare 1134567890123456 1034567890123456 -> 1
-ddcom707 compare 1134567890123456 1134567890123456 -> 0
-ddcom708 compare 1134567890123456 1234567890123456 -> -1
-
--- miscellaneous
-ddcom721 compare 12345678000 1 -> 1
-ddcom722 compare 1 12345678000 -> -1
-ddcom723 compare 1234567800 1 -> 1
-ddcom724 compare 1 1234567800 -> -1
-ddcom725 compare 1234567890 1 -> 1
-ddcom726 compare 1 1234567890 -> -1
-ddcom727 compare 1234567891 1 -> 1
-ddcom728 compare 1 1234567891 -> -1
-ddcom729 compare 12345678901 1 -> 1
-ddcom730 compare 1 12345678901 -> -1
-ddcom731 compare 1234567896 1 -> 1
-ddcom732 compare 1 1234567896 -> -1
-
--- residue cases at lower precision
-ddcom740 compare 1 0.9999999 -> 1
-ddcom741 compare 1 0.999999 -> 1
-ddcom742 compare 1 0.99999 -> 1
-ddcom743 compare 1 1.0000 -> 0
-ddcom744 compare 1 1.00001 -> -1
-ddcom745 compare 1 1.000001 -> -1
-ddcom746 compare 1 1.0000001 -> -1
-ddcom750 compare 0.9999999 1 -> -1
-ddcom751 compare 0.999999 1 -> -1
-ddcom752 compare 0.99999 1 -> -1
-ddcom753 compare 1.0000 1 -> 0
-ddcom754 compare 1.00001 1 -> 1
-ddcom755 compare 1.000001 1 -> 1
-ddcom756 compare 1.0000001 1 -> 1
-
--- Specials
-ddcom780 compare Inf -Inf -> 1
-ddcom781 compare Inf -1000 -> 1
-ddcom782 compare Inf -1 -> 1
-ddcom783 compare Inf -0 -> 1
-ddcom784 compare Inf 0 -> 1
-ddcom785 compare Inf 1 -> 1
-ddcom786 compare Inf 1000 -> 1
-ddcom787 compare Inf Inf -> 0
-ddcom788 compare -1000 Inf -> -1
-ddcom789 compare -Inf Inf -> -1
-ddcom790 compare -1 Inf -> -1
-ddcom791 compare -0 Inf -> -1
-ddcom792 compare 0 Inf -> -1
-ddcom793 compare 1 Inf -> -1
-ddcom794 compare 1000 Inf -> -1
-ddcom795 compare Inf Inf -> 0
-
-ddcom800 compare -Inf -Inf -> 0
-ddcom801 compare -Inf -1000 -> -1
-ddcom802 compare -Inf -1 -> -1
-ddcom803 compare -Inf -0 -> -1
-ddcom804 compare -Inf 0 -> -1
-ddcom805 compare -Inf 1 -> -1
-ddcom806 compare -Inf 1000 -> -1
-ddcom807 compare -Inf Inf -> -1
-ddcom808 compare -Inf -Inf -> 0
-ddcom809 compare -1000 -Inf -> 1
-ddcom810 compare -1 -Inf -> 1
-ddcom811 compare -0 -Inf -> 1
-ddcom812 compare 0 -Inf -> 1
-ddcom813 compare 1 -Inf -> 1
-ddcom814 compare 1000 -Inf -> 1
-ddcom815 compare Inf -Inf -> 1
-
-ddcom821 compare NaN -Inf -> NaN
-ddcom822 compare NaN -1000 -> NaN
-ddcom823 compare NaN -1 -> NaN
-ddcom824 compare NaN -0 -> NaN
-ddcom825 compare NaN 0 -> NaN
-ddcom826 compare NaN 1 -> NaN
-ddcom827 compare NaN 1000 -> NaN
-ddcom828 compare NaN Inf -> NaN
-ddcom829 compare NaN NaN -> NaN
-ddcom830 compare -Inf NaN -> NaN
-ddcom831 compare -1000 NaN -> NaN
-ddcom832 compare -1 NaN -> NaN
-ddcom833 compare -0 NaN -> NaN
-ddcom834 compare 0 NaN -> NaN
-ddcom835 compare 1 NaN -> NaN
-ddcom836 compare 1000 NaN -> NaN
-ddcom837 compare Inf NaN -> NaN
-ddcom838 compare -NaN -NaN -> -NaN
-ddcom839 compare +NaN -NaN -> NaN
-ddcom840 compare -NaN +NaN -> -NaN
-
-ddcom841 compare sNaN -Inf -> NaN Invalid_operation
-ddcom842 compare sNaN -1000 -> NaN Invalid_operation
-ddcom843 compare sNaN -1 -> NaN Invalid_operation
-ddcom844 compare sNaN -0 -> NaN Invalid_operation
-ddcom845 compare sNaN 0 -> NaN Invalid_operation
-ddcom846 compare sNaN 1 -> NaN Invalid_operation
-ddcom847 compare sNaN 1000 -> NaN Invalid_operation
-ddcom848 compare sNaN NaN -> NaN Invalid_operation
-ddcom849 compare sNaN sNaN -> NaN Invalid_operation
-ddcom850 compare NaN sNaN -> NaN Invalid_operation
-ddcom851 compare -Inf sNaN -> NaN Invalid_operation
-ddcom852 compare -1000 sNaN -> NaN Invalid_operation
-ddcom853 compare -1 sNaN -> NaN Invalid_operation
-ddcom854 compare -0 sNaN -> NaN Invalid_operation
-ddcom855 compare 0 sNaN -> NaN Invalid_operation
-ddcom856 compare 1 sNaN -> NaN Invalid_operation
-ddcom857 compare 1000 sNaN -> NaN Invalid_operation
-ddcom858 compare Inf sNaN -> NaN Invalid_operation
-ddcom859 compare NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddcom860 compare NaN9 -Inf -> NaN9
-ddcom861 compare NaN8 999 -> NaN8
-ddcom862 compare NaN77 Inf -> NaN77
-ddcom863 compare -NaN67 NaN5 -> -NaN67
-ddcom864 compare -Inf -NaN4 -> -NaN4
-ddcom865 compare -999 -NaN33 -> -NaN33
-ddcom866 compare Inf NaN2 -> NaN2
-ddcom867 compare -NaN41 -NaN42 -> -NaN41
-ddcom868 compare +NaN41 -NaN42 -> NaN41
-ddcom869 compare -NaN41 +NaN42 -> -NaN41
-ddcom870 compare +NaN41 +NaN42 -> NaN41
-
-ddcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
-ddcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
-ddcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
-ddcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
-ddcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
-ddcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
-ddcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
-ddcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
-ddcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- wide range
-ddcom880 compare +1.23456789012345E-0 9E+384 -> -1
-ddcom881 compare 9E+384 +1.23456789012345E-0 -> 1
-ddcom882 compare +0.100 9E-383 -> 1
-ddcom883 compare 9E-383 +0.100 -> -1
-ddcom885 compare -1.23456789012345E-0 9E+384 -> -1
-ddcom886 compare 9E+384 -1.23456789012345E-0 -> 1
-ddcom887 compare -0.100 9E-383 -> -1
-ddcom888 compare 9E-383 -0.100 -> 1
-
--- spread zeros
-ddcom900 compare 0E-383 0 -> 0
-ddcom901 compare 0E-383 -0 -> 0
-ddcom902 compare -0E-383 0 -> 0
-ddcom903 compare -0E-383 -0 -> 0
-ddcom904 compare 0E-383 0E+384 -> 0
-ddcom905 compare 0E-383 -0E+384 -> 0
-ddcom906 compare -0E-383 0E+384 -> 0
-ddcom907 compare -0E-383 -0E+384 -> 0
-ddcom908 compare 0 0E+384 -> 0
-ddcom909 compare 0 -0E+384 -> 0
-ddcom910 compare -0 0E+384 -> 0
-ddcom911 compare -0 -0E+384 -> 0
-ddcom930 compare 0E+384 0 -> 0
-ddcom931 compare 0E+384 -0 -> 0
-ddcom932 compare -0E+384 0 -> 0
-ddcom933 compare -0E+384 -0 -> 0
-ddcom934 compare 0E+384 0E-383 -> 0
-ddcom935 compare 0E+384 -0E-383 -> 0
-ddcom936 compare -0E+384 0E-383 -> 0
-ddcom937 compare -0E+384 -0E-383 -> 0
-ddcom938 compare 0 0E-383 -> 0
-ddcom939 compare 0 -0E-383 -> 0
-ddcom940 compare -0 0E-383 -> 0
-ddcom941 compare -0 -0E-383 -> 0
-
--- signs
-ddcom961 compare 1e+77 1e+11 -> 1
-ddcom962 compare 1e+77 -1e+11 -> 1
-ddcom963 compare -1e+77 1e+11 -> -1
-ddcom964 compare -1e+77 -1e+11 -> -1
-ddcom965 compare 1e-77 1e-11 -> -1
-ddcom966 compare 1e-77 -1e-11 -> 1
-ddcom967 compare -1e-77 1e-11 -> -1
-ddcom968 compare -1e-77 -1e-11 -> 1
-
--- full alignment range, both ways
-ddcomp1001 compare 1 1.000000000000000 -> 0
-ddcomp1002 compare 1 1.00000000000000 -> 0
-ddcomp1003 compare 1 1.0000000000000 -> 0
-ddcomp1004 compare 1 1.000000000000 -> 0
-ddcomp1005 compare 1 1.00000000000 -> 0
-ddcomp1006 compare 1 1.0000000000 -> 0
-ddcomp1007 compare 1 1.000000000 -> 0
-ddcomp1008 compare 1 1.00000000 -> 0
-ddcomp1009 compare 1 1.0000000 -> 0
-ddcomp1010 compare 1 1.000000 -> 0
-ddcomp1011 compare 1 1.00000 -> 0
-ddcomp1012 compare 1 1.0000 -> 0
-ddcomp1013 compare 1 1.000 -> 0
-ddcomp1014 compare 1 1.00 -> 0
-ddcomp1015 compare 1 1.0 -> 0
-ddcomp1021 compare 1.000000000000000 1 -> 0
-ddcomp1022 compare 1.00000000000000 1 -> 0
-ddcomp1023 compare 1.0000000000000 1 -> 0
-ddcomp1024 compare 1.000000000000 1 -> 0
-ddcomp1025 compare 1.00000000000 1 -> 0
-ddcomp1026 compare 1.0000000000 1 -> 0
-ddcomp1027 compare 1.000000000 1 -> 0
-ddcomp1028 compare 1.00000000 1 -> 0
-ddcomp1029 compare 1.0000000 1 -> 0
-ddcomp1030 compare 1.000000 1 -> 0
-ddcomp1031 compare 1.00000 1 -> 0
-ddcomp1032 compare 1.0000 1 -> 0
-ddcomp1033 compare 1.000 1 -> 0
-ddcomp1034 compare 1.00 1 -> 0
-ddcomp1035 compare 1.0 1 -> 0
-
--- check MSD always detected non-zero
-ddcomp1040 compare 0 0.000000000000000 -> 0
-ddcomp1041 compare 0 1.000000000000000 -> -1
-ddcomp1042 compare 0 2.000000000000000 -> -1
-ddcomp1043 compare 0 3.000000000000000 -> -1
-ddcomp1044 compare 0 4.000000000000000 -> -1
-ddcomp1045 compare 0 5.000000000000000 -> -1
-ddcomp1046 compare 0 6.000000000000000 -> -1
-ddcomp1047 compare 0 7.000000000000000 -> -1
-ddcomp1048 compare 0 8.000000000000000 -> -1
-ddcomp1049 compare 0 9.000000000000000 -> -1
-ddcomp1050 compare 0.000000000000000 0 -> 0
-ddcomp1051 compare 1.000000000000000 0 -> 1
-ddcomp1052 compare 2.000000000000000 0 -> 1
-ddcomp1053 compare 3.000000000000000 0 -> 1
-ddcomp1054 compare 4.000000000000000 0 -> 1
-ddcomp1055 compare 5.000000000000000 0 -> 1
-ddcomp1056 compare 6.000000000000000 0 -> 1
-ddcomp1057 compare 7.000000000000000 0 -> 1
-ddcomp1058 compare 8.000000000000000 0 -> 1
-ddcomp1059 compare 9.000000000000000 0 -> 1
-
--- Null tests
-ddcom9990 compare 10 # -> NaN Invalid_operation
-ddcom9991 compare # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddCompare.decTest -- decDouble comparison that allows quiet NaNs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddcom001 compare -2 -2 -> 0
+ddcom002 compare -2 -1 -> -1
+ddcom003 compare -2 0 -> -1
+ddcom004 compare -2 1 -> -1
+ddcom005 compare -2 2 -> -1
+ddcom006 compare -1 -2 -> 1
+ddcom007 compare -1 -1 -> 0
+ddcom008 compare -1 0 -> -1
+ddcom009 compare -1 1 -> -1
+ddcom010 compare -1 2 -> -1
+ddcom011 compare 0 -2 -> 1
+ddcom012 compare 0 -1 -> 1
+ddcom013 compare 0 0 -> 0
+ddcom014 compare 0 1 -> -1
+ddcom015 compare 0 2 -> -1
+ddcom016 compare 1 -2 -> 1
+ddcom017 compare 1 -1 -> 1
+ddcom018 compare 1 0 -> 1
+ddcom019 compare 1 1 -> 0
+ddcom020 compare 1 2 -> -1
+ddcom021 compare 2 -2 -> 1
+ddcom022 compare 2 -1 -> 1
+ddcom023 compare 2 0 -> 1
+ddcom025 compare 2 1 -> 1
+ddcom026 compare 2 2 -> 0
+
+ddcom031 compare -20 -20 -> 0
+ddcom032 compare -20 -10 -> -1
+ddcom033 compare -20 00 -> -1
+ddcom034 compare -20 10 -> -1
+ddcom035 compare -20 20 -> -1
+ddcom036 compare -10 -20 -> 1
+ddcom037 compare -10 -10 -> 0
+ddcom038 compare -10 00 -> -1
+ddcom039 compare -10 10 -> -1
+ddcom040 compare -10 20 -> -1
+ddcom041 compare 00 -20 -> 1
+ddcom042 compare 00 -10 -> 1
+ddcom043 compare 00 00 -> 0
+ddcom044 compare 00 10 -> -1
+ddcom045 compare 00 20 -> -1
+ddcom046 compare 10 -20 -> 1
+ddcom047 compare 10 -10 -> 1
+ddcom048 compare 10 00 -> 1
+ddcom049 compare 10 10 -> 0
+ddcom050 compare 10 20 -> -1
+ddcom051 compare 20 -20 -> 1
+ddcom052 compare 20 -10 -> 1
+ddcom053 compare 20 00 -> 1
+ddcom055 compare 20 10 -> 1
+ddcom056 compare 20 20 -> 0
+
+ddcom061 compare -2.0 -2.0 -> 0
+ddcom062 compare -2.0 -1.0 -> -1
+ddcom063 compare -2.0 0.0 -> -1
+ddcom064 compare -2.0 1.0 -> -1
+ddcom065 compare -2.0 2.0 -> -1
+ddcom066 compare -1.0 -2.0 -> 1
+ddcom067 compare -1.0 -1.0 -> 0
+ddcom068 compare -1.0 0.0 -> -1
+ddcom069 compare -1.0 1.0 -> -1
+ddcom070 compare -1.0 2.0 -> -1
+ddcom071 compare 0.0 -2.0 -> 1
+ddcom072 compare 0.0 -1.0 -> 1
+ddcom073 compare 0.0 0.0 -> 0
+ddcom074 compare 0.0 1.0 -> -1
+ddcom075 compare 0.0 2.0 -> -1
+ddcom076 compare 1.0 -2.0 -> 1
+ddcom077 compare 1.0 -1.0 -> 1
+ddcom078 compare 1.0 0.0 -> 1
+ddcom079 compare 1.0 1.0 -> 0
+ddcom080 compare 1.0 2.0 -> -1
+ddcom081 compare 2.0 -2.0 -> 1
+ddcom082 compare 2.0 -1.0 -> 1
+ddcom083 compare 2.0 0.0 -> 1
+ddcom085 compare 2.0 1.0 -> 1
+ddcom086 compare 2.0 2.0 -> 0
+ddcom087 compare 1.0 0.1 -> 1
+ddcom088 compare 0.1 1.0 -> -1
+
+-- now some cases which might overflow if subtract were used
+ddcom095 compare 9.999999999999999E+384 9.999999999999999E+384 -> 0
+ddcom096 compare -9.999999999999999E+384 9.999999999999999E+384 -> -1
+ddcom097 compare 9.999999999999999E+384 -9.999999999999999E+384 -> 1
+ddcom098 compare -9.999999999999999E+384 -9.999999999999999E+384 -> 0
+
+-- some differing length/exponent cases
+ddcom100 compare 7.0 7.0 -> 0
+ddcom101 compare 7.0 7 -> 0
+ddcom102 compare 7 7.0 -> 0
+ddcom103 compare 7E+0 7.0 -> 0
+ddcom104 compare 70E-1 7.0 -> 0
+ddcom105 compare 0.7E+1 7 -> 0
+ddcom106 compare 70E-1 7 -> 0
+ddcom107 compare 7.0 7E+0 -> 0
+ddcom108 compare 7.0 70E-1 -> 0
+ddcom109 compare 7 0.7E+1 -> 0
+ddcom110 compare 7 70E-1 -> 0
+
+ddcom120 compare 8.0 7.0 -> 1
+ddcom121 compare 8.0 7 -> 1
+ddcom122 compare 8 7.0 -> 1
+ddcom123 compare 8E+0 7.0 -> 1
+ddcom124 compare 80E-1 7.0 -> 1
+ddcom125 compare 0.8E+1 7 -> 1
+ddcom126 compare 80E-1 7 -> 1
+ddcom127 compare 8.0 7E+0 -> 1
+ddcom128 compare 8.0 70E-1 -> 1
+ddcom129 compare 8 0.7E+1 -> 1
+ddcom130 compare 8 70E-1 -> 1
+
+ddcom140 compare 8.0 9.0 -> -1
+ddcom141 compare 8.0 9 -> -1
+ddcom142 compare 8 9.0 -> -1
+ddcom143 compare 8E+0 9.0 -> -1
+ddcom144 compare 80E-1 9.0 -> -1
+ddcom145 compare 0.8E+1 9 -> -1
+ddcom146 compare 80E-1 9 -> -1
+ddcom147 compare 8.0 9E+0 -> -1
+ddcom148 compare 8.0 90E-1 -> -1
+ddcom149 compare 8 0.9E+1 -> -1
+ddcom150 compare 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ddcom200 compare -7.0 7.0 -> -1
+ddcom201 compare -7.0 7 -> -1
+ddcom202 compare -7 7.0 -> -1
+ddcom203 compare -7E+0 7.0 -> -1
+ddcom204 compare -70E-1 7.0 -> -1
+ddcom205 compare -0.7E+1 7 -> -1
+ddcom206 compare -70E-1 7 -> -1
+ddcom207 compare -7.0 7E+0 -> -1
+ddcom208 compare -7.0 70E-1 -> -1
+ddcom209 compare -7 0.7E+1 -> -1
+ddcom210 compare -7 70E-1 -> -1
+
+ddcom220 compare -8.0 7.0 -> -1
+ddcom221 compare -8.0 7 -> -1
+ddcom222 compare -8 7.0 -> -1
+ddcom223 compare -8E+0 7.0 -> -1
+ddcom224 compare -80E-1 7.0 -> -1
+ddcom225 compare -0.8E+1 7 -> -1
+ddcom226 compare -80E-1 7 -> -1
+ddcom227 compare -8.0 7E+0 -> -1
+ddcom228 compare -8.0 70E-1 -> -1
+ddcom229 compare -8 0.7E+1 -> -1
+ddcom230 compare -8 70E-1 -> -1
+
+ddcom240 compare -8.0 9.0 -> -1
+ddcom241 compare -8.0 9 -> -1
+ddcom242 compare -8 9.0 -> -1
+ddcom243 compare -8E+0 9.0 -> -1
+ddcom244 compare -80E-1 9.0 -> -1
+ddcom245 compare -0.8E+1 9 -> -1
+ddcom246 compare -80E-1 9 -> -1
+ddcom247 compare -8.0 9E+0 -> -1
+ddcom248 compare -8.0 90E-1 -> -1
+ddcom249 compare -8 0.9E+1 -> -1
+ddcom250 compare -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ddcom300 compare 7.0 -7.0 -> 1
+ddcom301 compare 7.0 -7 -> 1
+ddcom302 compare 7 -7.0 -> 1
+ddcom303 compare 7E+0 -7.0 -> 1
+ddcom304 compare 70E-1 -7.0 -> 1
+ddcom305 compare .7E+1 -7 -> 1
+ddcom306 compare 70E-1 -7 -> 1
+ddcom307 compare 7.0 -7E+0 -> 1
+ddcom308 compare 7.0 -70E-1 -> 1
+ddcom309 compare 7 -.7E+1 -> 1
+ddcom310 compare 7 -70E-1 -> 1
+
+ddcom320 compare 8.0 -7.0 -> 1
+ddcom321 compare 8.0 -7 -> 1
+ddcom322 compare 8 -7.0 -> 1
+ddcom323 compare 8E+0 -7.0 -> 1
+ddcom324 compare 80E-1 -7.0 -> 1
+ddcom325 compare .8E+1 -7 -> 1
+ddcom326 compare 80E-1 -7 -> 1
+ddcom327 compare 8.0 -7E+0 -> 1
+ddcom328 compare 8.0 -70E-1 -> 1
+ddcom329 compare 8 -.7E+1 -> 1
+ddcom330 compare 8 -70E-1 -> 1
+
+ddcom340 compare 8.0 -9.0 -> 1
+ddcom341 compare 8.0 -9 -> 1
+ddcom342 compare 8 -9.0 -> 1
+ddcom343 compare 8E+0 -9.0 -> 1
+ddcom344 compare 80E-1 -9.0 -> 1
+ddcom345 compare .8E+1 -9 -> 1
+ddcom346 compare 80E-1 -9 -> 1
+ddcom347 compare 8.0 -9E+0 -> 1
+ddcom348 compare 8.0 -90E-1 -> 1
+ddcom349 compare 8 -.9E+1 -> 1
+ddcom350 compare 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+ddcom400 compare -7.0 -7.0 -> 0
+ddcom401 compare -7.0 -7 -> 0
+ddcom402 compare -7 -7.0 -> 0
+ddcom403 compare -7E+0 -7.0 -> 0
+ddcom404 compare -70E-1 -7.0 -> 0
+ddcom405 compare -.7E+1 -7 -> 0
+ddcom406 compare -70E-1 -7 -> 0
+ddcom407 compare -7.0 -7E+0 -> 0
+ddcom408 compare -7.0 -70E-1 -> 0
+ddcom409 compare -7 -.7E+1 -> 0
+ddcom410 compare -7 -70E-1 -> 0
+
+ddcom420 compare -8.0 -7.0 -> -1
+ddcom421 compare -8.0 -7 -> -1
+ddcom422 compare -8 -7.0 -> -1
+ddcom423 compare -8E+0 -7.0 -> -1
+ddcom424 compare -80E-1 -7.0 -> -1
+ddcom425 compare -.8E+1 -7 -> -1
+ddcom426 compare -80E-1 -7 -> -1
+ddcom427 compare -8.0 -7E+0 -> -1
+ddcom428 compare -8.0 -70E-1 -> -1
+ddcom429 compare -8 -.7E+1 -> -1
+ddcom430 compare -8 -70E-1 -> -1
+
+ddcom440 compare -8.0 -9.0 -> 1
+ddcom441 compare -8.0 -9 -> 1
+ddcom442 compare -8 -9.0 -> 1
+ddcom443 compare -8E+0 -9.0 -> 1
+ddcom444 compare -80E-1 -9.0 -> 1
+ddcom445 compare -.8E+1 -9 -> 1
+ddcom446 compare -80E-1 -9 -> 1
+ddcom447 compare -8.0 -9E+0 -> 1
+ddcom448 compare -8.0 -90E-1 -> 1
+ddcom449 compare -8 -.9E+1 -> 1
+ddcom450 compare -8 -90E-1 -> 1
+
+-- misalignment traps for little-endian
+ddcom451 compare 1.0 0.1 -> 1
+ddcom452 compare 0.1 1.0 -> -1
+ddcom453 compare 10.0 0.1 -> 1
+ddcom454 compare 0.1 10.0 -> -1
+ddcom455 compare 100 1.0 -> 1
+ddcom456 compare 1.0 100 -> -1
+ddcom457 compare 1000 10.0 -> 1
+ddcom458 compare 10.0 1000 -> -1
+ddcom459 compare 10000 100.0 -> 1
+ddcom460 compare 100.0 10000 -> -1
+ddcom461 compare 100000 1000.0 -> 1
+ddcom462 compare 1000.0 100000 -> -1
+ddcom463 compare 1000000 10000.0 -> 1
+ddcom464 compare 10000.0 1000000 -> -1
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+ddcom473 compare 123.4560000000000E-89 123.456E-89 -> 0
+ddcom474 compare 123.456000000000E+89 123.456E+89 -> 0
+ddcom475 compare 123.45600000000E-89 123.456E-89 -> 0
+ddcom476 compare 123.4560000000E+89 123.456E+89 -> 0
+ddcom477 compare 123.456000000E-89 123.456E-89 -> 0
+ddcom478 compare 123.45600000E+89 123.456E+89 -> 0
+ddcom479 compare 123.4560000E-89 123.456E-89 -> 0
+ddcom480 compare 123.456000E+89 123.456E+89 -> 0
+ddcom481 compare 123.45600E-89 123.456E-89 -> 0
+ddcom482 compare 123.4560E+89 123.456E+89 -> 0
+ddcom483 compare 123.456E-89 123.456E-89 -> 0
+ddcom487 compare 123.456E+89 123.4560000000000E+89 -> 0
+ddcom488 compare 123.456E-89 123.456000000000E-89 -> 0
+ddcom489 compare 123.456E+89 123.45600000000E+89 -> 0
+ddcom490 compare 123.456E-89 123.4560000000E-89 -> 0
+ddcom491 compare 123.456E+89 123.456000000E+89 -> 0
+ddcom492 compare 123.456E-89 123.45600000E-89 -> 0
+ddcom493 compare 123.456E+89 123.4560000E+89 -> 0
+ddcom494 compare 123.456E-89 123.456000E-89 -> 0
+ddcom495 compare 123.456E+89 123.45600E+89 -> 0
+ddcom496 compare 123.456E-89 123.4560E-89 -> 0
+ddcom497 compare 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+ddcom500 compare 1 1E-15 -> 1
+ddcom501 compare 1 1E-14 -> 1
+ddcom502 compare 1 1E-13 -> 1
+ddcom503 compare 1 1E-12 -> 1
+ddcom504 compare 1 1E-11 -> 1
+ddcom505 compare 1 1E-10 -> 1
+ddcom506 compare 1 1E-9 -> 1
+ddcom507 compare 1 1E-8 -> 1
+ddcom508 compare 1 1E-7 -> 1
+ddcom509 compare 1 1E-6 -> 1
+ddcom510 compare 1 1E-5 -> 1
+ddcom511 compare 1 1E-4 -> 1
+ddcom512 compare 1 1E-3 -> 1
+ddcom513 compare 1 1E-2 -> 1
+ddcom514 compare 1 1E-1 -> 1
+ddcom515 compare 1 1E-0 -> 0
+ddcom516 compare 1 1E+1 -> -1
+ddcom517 compare 1 1E+2 -> -1
+ddcom518 compare 1 1E+3 -> -1
+ddcom519 compare 1 1E+4 -> -1
+ddcom521 compare 1 1E+5 -> -1
+ddcom522 compare 1 1E+6 -> -1
+ddcom523 compare 1 1E+7 -> -1
+ddcom524 compare 1 1E+8 -> -1
+ddcom525 compare 1 1E+9 -> -1
+ddcom526 compare 1 1E+10 -> -1
+ddcom527 compare 1 1E+11 -> -1
+ddcom528 compare 1 1E+12 -> -1
+ddcom529 compare 1 1E+13 -> -1
+ddcom530 compare 1 1E+14 -> -1
+ddcom531 compare 1 1E+15 -> -1
+-- LR swap
+ddcom540 compare 1E-15 1 -> -1
+ddcom541 compare 1E-14 1 -> -1
+ddcom542 compare 1E-13 1 -> -1
+ddcom543 compare 1E-12 1 -> -1
+ddcom544 compare 1E-11 1 -> -1
+ddcom545 compare 1E-10 1 -> -1
+ddcom546 compare 1E-9 1 -> -1
+ddcom547 compare 1E-8 1 -> -1
+ddcom548 compare 1E-7 1 -> -1
+ddcom549 compare 1E-6 1 -> -1
+ddcom550 compare 1E-5 1 -> -1
+ddcom551 compare 1E-4 1 -> -1
+ddcom552 compare 1E-3 1 -> -1
+ddcom553 compare 1E-2 1 -> -1
+ddcom554 compare 1E-1 1 -> -1
+ddcom555 compare 1E-0 1 -> 0
+ddcom556 compare 1E+1 1 -> 1
+ddcom557 compare 1E+2 1 -> 1
+ddcom558 compare 1E+3 1 -> 1
+ddcom559 compare 1E+4 1 -> 1
+ddcom561 compare 1E+5 1 -> 1
+ddcom562 compare 1E+6 1 -> 1
+ddcom563 compare 1E+7 1 -> 1
+ddcom564 compare 1E+8 1 -> 1
+ddcom565 compare 1E+9 1 -> 1
+ddcom566 compare 1E+10 1 -> 1
+ddcom567 compare 1E+11 1 -> 1
+ddcom568 compare 1E+12 1 -> 1
+ddcom569 compare 1E+13 1 -> 1
+ddcom570 compare 1E+14 1 -> 1
+ddcom571 compare 1E+15 1 -> 1
+-- similar with a useful coefficient, one side only
+ddcom580 compare 0.000000987654321 1E-15 -> 1
+ddcom581 compare 0.000000987654321 1E-14 -> 1
+ddcom582 compare 0.000000987654321 1E-13 -> 1
+ddcom583 compare 0.000000987654321 1E-12 -> 1
+ddcom584 compare 0.000000987654321 1E-11 -> 1
+ddcom585 compare 0.000000987654321 1E-10 -> 1
+ddcom586 compare 0.000000987654321 1E-9 -> 1
+ddcom587 compare 0.000000987654321 1E-8 -> 1
+ddcom588 compare 0.000000987654321 1E-7 -> 1
+ddcom589 compare 0.000000987654321 1E-6 -> -1
+ddcom590 compare 0.000000987654321 1E-5 -> -1
+ddcom591 compare 0.000000987654321 1E-4 -> -1
+ddcom592 compare 0.000000987654321 1E-3 -> -1
+ddcom593 compare 0.000000987654321 1E-2 -> -1
+ddcom594 compare 0.000000987654321 1E-1 -> -1
+ddcom595 compare 0.000000987654321 1E-0 -> -1
+ddcom596 compare 0.000000987654321 1E+1 -> -1
+ddcom597 compare 0.000000987654321 1E+2 -> -1
+ddcom598 compare 0.000000987654321 1E+3 -> -1
+ddcom599 compare 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+ddcom600 compare 12 12.2345 -> -1
+ddcom601 compare 12.0 12.2345 -> -1
+ddcom602 compare 12.00 12.2345 -> -1
+ddcom603 compare 12.000 12.2345 -> -1
+ddcom604 compare 12.0000 12.2345 -> -1
+ddcom605 compare 12.00000 12.2345 -> -1
+ddcom606 compare 12.000000 12.2345 -> -1
+ddcom607 compare 12.0000000 12.2345 -> -1
+ddcom608 compare 12.00000000 12.2345 -> -1
+ddcom609 compare 12.000000000 12.2345 -> -1
+ddcom610 compare 12.1234 12 -> 1
+ddcom611 compare 12.1234 12.0 -> 1
+ddcom612 compare 12.1234 12.00 -> 1
+ddcom613 compare 12.1234 12.000 -> 1
+ddcom614 compare 12.1234 12.0000 -> 1
+ddcom615 compare 12.1234 12.00000 -> 1
+ddcom616 compare 12.1234 12.000000 -> 1
+ddcom617 compare 12.1234 12.0000000 -> 1
+ddcom618 compare 12.1234 12.00000000 -> 1
+ddcom619 compare 12.1234 12.000000000 -> 1
+ddcom620 compare -12 -12.2345 -> 1
+ddcom621 compare -12.0 -12.2345 -> 1
+ddcom622 compare -12.00 -12.2345 -> 1
+ddcom623 compare -12.000 -12.2345 -> 1
+ddcom624 compare -12.0000 -12.2345 -> 1
+ddcom625 compare -12.00000 -12.2345 -> 1
+ddcom626 compare -12.000000 -12.2345 -> 1
+ddcom627 compare -12.0000000 -12.2345 -> 1
+ddcom628 compare -12.00000000 -12.2345 -> 1
+ddcom629 compare -12.000000000 -12.2345 -> 1
+ddcom630 compare -12.1234 -12 -> -1
+ddcom631 compare -12.1234 -12.0 -> -1
+ddcom632 compare -12.1234 -12.00 -> -1
+ddcom633 compare -12.1234 -12.000 -> -1
+ddcom634 compare -12.1234 -12.0000 -> -1
+ddcom635 compare -12.1234 -12.00000 -> -1
+ddcom636 compare -12.1234 -12.000000 -> -1
+ddcom637 compare -12.1234 -12.0000000 -> -1
+ddcom638 compare -12.1234 -12.00000000 -> -1
+ddcom639 compare -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+ddcom640 compare 0 0 -> 0
+ddcom641 compare 0 -0 -> 0
+ddcom642 compare 0 -0.0 -> 0
+ddcom643 compare 0 0.0 -> 0
+ddcom644 compare -0 0 -> 0
+ddcom645 compare -0 -0 -> 0
+ddcom646 compare -0 -0.0 -> 0
+ddcom647 compare -0 0.0 -> 0
+ddcom648 compare 0.0 0 -> 0
+ddcom649 compare 0.0 -0 -> 0
+ddcom650 compare 0.0 -0.0 -> 0
+ddcom651 compare 0.0 0.0 -> 0
+ddcom652 compare -0.0 0 -> 0
+ddcom653 compare -0.0 -0 -> 0
+ddcom654 compare -0.0 -0.0 -> 0
+ddcom655 compare -0.0 0.0 -> 0
+
+ddcom656 compare -0E1 0.0 -> 0
+ddcom657 compare -0E2 0.0 -> 0
+ddcom658 compare 0E1 0.0 -> 0
+ddcom659 compare 0E2 0.0 -> 0
+ddcom660 compare -0E1 0 -> 0
+ddcom661 compare -0E2 0 -> 0
+ddcom662 compare 0E1 0 -> 0
+ddcom663 compare 0E2 0 -> 0
+ddcom664 compare -0E1 -0E1 -> 0
+ddcom665 compare -0E2 -0E1 -> 0
+ddcom666 compare 0E1 -0E1 -> 0
+ddcom667 compare 0E2 -0E1 -> 0
+ddcom668 compare -0E1 -0E2 -> 0
+ddcom669 compare -0E2 -0E2 -> 0
+ddcom670 compare 0E1 -0E2 -> 0
+ddcom671 compare 0E2 -0E2 -> 0
+ddcom672 compare -0E1 0E1 -> 0
+ddcom673 compare -0E2 0E1 -> 0
+ddcom674 compare 0E1 0E1 -> 0
+ddcom675 compare 0E2 0E1 -> 0
+ddcom676 compare -0E1 0E2 -> 0
+ddcom677 compare -0E2 0E2 -> 0
+ddcom678 compare 0E1 0E2 -> 0
+ddcom679 compare 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+ddcom680 compare 12 12 -> 0
+ddcom681 compare 12 12.0 -> 0
+ddcom682 compare 12 12.00 -> 0
+ddcom683 compare 12 12.000 -> 0
+ddcom684 compare 12 12.0000 -> 0
+ddcom685 compare 12 12.00000 -> 0
+ddcom686 compare 12 12.000000 -> 0
+ddcom687 compare 12 12.0000000 -> 0
+ddcom688 compare 12 12.00000000 -> 0
+ddcom689 compare 12 12.000000000 -> 0
+ddcom690 compare 12 12 -> 0
+ddcom691 compare 12.0 12 -> 0
+ddcom692 compare 12.00 12 -> 0
+ddcom693 compare 12.000 12 -> 0
+ddcom694 compare 12.0000 12 -> 0
+ddcom695 compare 12.00000 12 -> 0
+ddcom696 compare 12.000000 12 -> 0
+ddcom697 compare 12.0000000 12 -> 0
+ddcom698 compare 12.00000000 12 -> 0
+ddcom699 compare 12.000000000 12 -> 0
+
+-- first, second, & last digit
+ddcom700 compare 1234567890123456 1234567890123455 -> 1
+ddcom701 compare 1234567890123456 1234567890123456 -> 0
+ddcom702 compare 1234567890123456 1234567890123457 -> -1
+ddcom703 compare 1234567890123456 0234567890123456 -> 1
+ddcom704 compare 1234567890123456 1234567890123456 -> 0
+ddcom705 compare 1234567890123456 2234567890123456 -> -1
+ddcom706 compare 1134567890123456 1034567890123456 -> 1
+ddcom707 compare 1134567890123456 1134567890123456 -> 0
+ddcom708 compare 1134567890123456 1234567890123456 -> -1
+
+-- miscellaneous
+ddcom721 compare 12345678000 1 -> 1
+ddcom722 compare 1 12345678000 -> -1
+ddcom723 compare 1234567800 1 -> 1
+ddcom724 compare 1 1234567800 -> -1
+ddcom725 compare 1234567890 1 -> 1
+ddcom726 compare 1 1234567890 -> -1
+ddcom727 compare 1234567891 1 -> 1
+ddcom728 compare 1 1234567891 -> -1
+ddcom729 compare 12345678901 1 -> 1
+ddcom730 compare 1 12345678901 -> -1
+ddcom731 compare 1234567896 1 -> 1
+ddcom732 compare 1 1234567896 -> -1
+
+-- residue cases at lower precision
+ddcom740 compare 1 0.9999999 -> 1
+ddcom741 compare 1 0.999999 -> 1
+ddcom742 compare 1 0.99999 -> 1
+ddcom743 compare 1 1.0000 -> 0
+ddcom744 compare 1 1.00001 -> -1
+ddcom745 compare 1 1.000001 -> -1
+ddcom746 compare 1 1.0000001 -> -1
+ddcom750 compare 0.9999999 1 -> -1
+ddcom751 compare 0.999999 1 -> -1
+ddcom752 compare 0.99999 1 -> -1
+ddcom753 compare 1.0000 1 -> 0
+ddcom754 compare 1.00001 1 -> 1
+ddcom755 compare 1.000001 1 -> 1
+ddcom756 compare 1.0000001 1 -> 1
+
+-- Specials
+ddcom780 compare Inf -Inf -> 1
+ddcom781 compare Inf -1000 -> 1
+ddcom782 compare Inf -1 -> 1
+ddcom783 compare Inf -0 -> 1
+ddcom784 compare Inf 0 -> 1
+ddcom785 compare Inf 1 -> 1
+ddcom786 compare Inf 1000 -> 1
+ddcom787 compare Inf Inf -> 0
+ddcom788 compare -1000 Inf -> -1
+ddcom789 compare -Inf Inf -> -1
+ddcom790 compare -1 Inf -> -1
+ddcom791 compare -0 Inf -> -1
+ddcom792 compare 0 Inf -> -1
+ddcom793 compare 1 Inf -> -1
+ddcom794 compare 1000 Inf -> -1
+ddcom795 compare Inf Inf -> 0
+
+ddcom800 compare -Inf -Inf -> 0
+ddcom801 compare -Inf -1000 -> -1
+ddcom802 compare -Inf -1 -> -1
+ddcom803 compare -Inf -0 -> -1
+ddcom804 compare -Inf 0 -> -1
+ddcom805 compare -Inf 1 -> -1
+ddcom806 compare -Inf 1000 -> -1
+ddcom807 compare -Inf Inf -> -1
+ddcom808 compare -Inf -Inf -> 0
+ddcom809 compare -1000 -Inf -> 1
+ddcom810 compare -1 -Inf -> 1
+ddcom811 compare -0 -Inf -> 1
+ddcom812 compare 0 -Inf -> 1
+ddcom813 compare 1 -Inf -> 1
+ddcom814 compare 1000 -Inf -> 1
+ddcom815 compare Inf -Inf -> 1
+
+ddcom821 compare NaN -Inf -> NaN
+ddcom822 compare NaN -1000 -> NaN
+ddcom823 compare NaN -1 -> NaN
+ddcom824 compare NaN -0 -> NaN
+ddcom825 compare NaN 0 -> NaN
+ddcom826 compare NaN 1 -> NaN
+ddcom827 compare NaN 1000 -> NaN
+ddcom828 compare NaN Inf -> NaN
+ddcom829 compare NaN NaN -> NaN
+ddcom830 compare -Inf NaN -> NaN
+ddcom831 compare -1000 NaN -> NaN
+ddcom832 compare -1 NaN -> NaN
+ddcom833 compare -0 NaN -> NaN
+ddcom834 compare 0 NaN -> NaN
+ddcom835 compare 1 NaN -> NaN
+ddcom836 compare 1000 NaN -> NaN
+ddcom837 compare Inf NaN -> NaN
+ddcom838 compare -NaN -NaN -> -NaN
+ddcom839 compare +NaN -NaN -> NaN
+ddcom840 compare -NaN +NaN -> -NaN
+
+ddcom841 compare sNaN -Inf -> NaN Invalid_operation
+ddcom842 compare sNaN -1000 -> NaN Invalid_operation
+ddcom843 compare sNaN -1 -> NaN Invalid_operation
+ddcom844 compare sNaN -0 -> NaN Invalid_operation
+ddcom845 compare sNaN 0 -> NaN Invalid_operation
+ddcom846 compare sNaN 1 -> NaN Invalid_operation
+ddcom847 compare sNaN 1000 -> NaN Invalid_operation
+ddcom848 compare sNaN NaN -> NaN Invalid_operation
+ddcom849 compare sNaN sNaN -> NaN Invalid_operation
+ddcom850 compare NaN sNaN -> NaN Invalid_operation
+ddcom851 compare -Inf sNaN -> NaN Invalid_operation
+ddcom852 compare -1000 sNaN -> NaN Invalid_operation
+ddcom853 compare -1 sNaN -> NaN Invalid_operation
+ddcom854 compare -0 sNaN -> NaN Invalid_operation
+ddcom855 compare 0 sNaN -> NaN Invalid_operation
+ddcom856 compare 1 sNaN -> NaN Invalid_operation
+ddcom857 compare 1000 sNaN -> NaN Invalid_operation
+ddcom858 compare Inf sNaN -> NaN Invalid_operation
+ddcom859 compare NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddcom860 compare NaN9 -Inf -> NaN9
+ddcom861 compare NaN8 999 -> NaN8
+ddcom862 compare NaN77 Inf -> NaN77
+ddcom863 compare -NaN67 NaN5 -> -NaN67
+ddcom864 compare -Inf -NaN4 -> -NaN4
+ddcom865 compare -999 -NaN33 -> -NaN33
+ddcom866 compare Inf NaN2 -> NaN2
+ddcom867 compare -NaN41 -NaN42 -> -NaN41
+ddcom868 compare +NaN41 -NaN42 -> NaN41
+ddcom869 compare -NaN41 +NaN42 -> -NaN41
+ddcom870 compare +NaN41 +NaN42 -> NaN41
+
+ddcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
+ddcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
+ddcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
+ddcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
+ddcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
+ddcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
+ddcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
+ddcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
+ddcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- wide range
+ddcom880 compare +1.23456789012345E-0 9E+384 -> -1
+ddcom881 compare 9E+384 +1.23456789012345E-0 -> 1
+ddcom882 compare +0.100 9E-383 -> 1
+ddcom883 compare 9E-383 +0.100 -> -1
+ddcom885 compare -1.23456789012345E-0 9E+384 -> -1
+ddcom886 compare 9E+384 -1.23456789012345E-0 -> 1
+ddcom887 compare -0.100 9E-383 -> -1
+ddcom888 compare 9E-383 -0.100 -> 1
+
+-- spread zeros
+ddcom900 compare 0E-383 0 -> 0
+ddcom901 compare 0E-383 -0 -> 0
+ddcom902 compare -0E-383 0 -> 0
+ddcom903 compare -0E-383 -0 -> 0
+ddcom904 compare 0E-383 0E+384 -> 0
+ddcom905 compare 0E-383 -0E+384 -> 0
+ddcom906 compare -0E-383 0E+384 -> 0
+ddcom907 compare -0E-383 -0E+384 -> 0
+ddcom908 compare 0 0E+384 -> 0
+ddcom909 compare 0 -0E+384 -> 0
+ddcom910 compare -0 0E+384 -> 0
+ddcom911 compare -0 -0E+384 -> 0
+ddcom930 compare 0E+384 0 -> 0
+ddcom931 compare 0E+384 -0 -> 0
+ddcom932 compare -0E+384 0 -> 0
+ddcom933 compare -0E+384 -0 -> 0
+ddcom934 compare 0E+384 0E-383 -> 0
+ddcom935 compare 0E+384 -0E-383 -> 0
+ddcom936 compare -0E+384 0E-383 -> 0
+ddcom937 compare -0E+384 -0E-383 -> 0
+ddcom938 compare 0 0E-383 -> 0
+ddcom939 compare 0 -0E-383 -> 0
+ddcom940 compare -0 0E-383 -> 0
+ddcom941 compare -0 -0E-383 -> 0
+
+-- signs
+ddcom961 compare 1e+77 1e+11 -> 1
+ddcom962 compare 1e+77 -1e+11 -> 1
+ddcom963 compare -1e+77 1e+11 -> -1
+ddcom964 compare -1e+77 -1e+11 -> -1
+ddcom965 compare 1e-77 1e-11 -> -1
+ddcom966 compare 1e-77 -1e-11 -> 1
+ddcom967 compare -1e-77 1e-11 -> -1
+ddcom968 compare -1e-77 -1e-11 -> 1
+
+-- full alignment range, both ways
+ddcomp1001 compare 1 1.000000000000000 -> 0
+ddcomp1002 compare 1 1.00000000000000 -> 0
+ddcomp1003 compare 1 1.0000000000000 -> 0
+ddcomp1004 compare 1 1.000000000000 -> 0
+ddcomp1005 compare 1 1.00000000000 -> 0
+ddcomp1006 compare 1 1.0000000000 -> 0
+ddcomp1007 compare 1 1.000000000 -> 0
+ddcomp1008 compare 1 1.00000000 -> 0
+ddcomp1009 compare 1 1.0000000 -> 0
+ddcomp1010 compare 1 1.000000 -> 0
+ddcomp1011 compare 1 1.00000 -> 0
+ddcomp1012 compare 1 1.0000 -> 0
+ddcomp1013 compare 1 1.000 -> 0
+ddcomp1014 compare 1 1.00 -> 0
+ddcomp1015 compare 1 1.0 -> 0
+ddcomp1021 compare 1.000000000000000 1 -> 0
+ddcomp1022 compare 1.00000000000000 1 -> 0
+ddcomp1023 compare 1.0000000000000 1 -> 0
+ddcomp1024 compare 1.000000000000 1 -> 0
+ddcomp1025 compare 1.00000000000 1 -> 0
+ddcomp1026 compare 1.0000000000 1 -> 0
+ddcomp1027 compare 1.000000000 1 -> 0
+ddcomp1028 compare 1.00000000 1 -> 0
+ddcomp1029 compare 1.0000000 1 -> 0
+ddcomp1030 compare 1.000000 1 -> 0
+ddcomp1031 compare 1.00000 1 -> 0
+ddcomp1032 compare 1.0000 1 -> 0
+ddcomp1033 compare 1.000 1 -> 0
+ddcomp1034 compare 1.00 1 -> 0
+ddcomp1035 compare 1.0 1 -> 0
+
+-- check MSD always detected non-zero
+ddcomp1040 compare 0 0.000000000000000 -> 0
+ddcomp1041 compare 0 1.000000000000000 -> -1
+ddcomp1042 compare 0 2.000000000000000 -> -1
+ddcomp1043 compare 0 3.000000000000000 -> -1
+ddcomp1044 compare 0 4.000000000000000 -> -1
+ddcomp1045 compare 0 5.000000000000000 -> -1
+ddcomp1046 compare 0 6.000000000000000 -> -1
+ddcomp1047 compare 0 7.000000000000000 -> -1
+ddcomp1048 compare 0 8.000000000000000 -> -1
+ddcomp1049 compare 0 9.000000000000000 -> -1
+ddcomp1050 compare 0.000000000000000 0 -> 0
+ddcomp1051 compare 1.000000000000000 0 -> 1
+ddcomp1052 compare 2.000000000000000 0 -> 1
+ddcomp1053 compare 3.000000000000000 0 -> 1
+ddcomp1054 compare 4.000000000000000 0 -> 1
+ddcomp1055 compare 5.000000000000000 0 -> 1
+ddcomp1056 compare 6.000000000000000 0 -> 1
+ddcomp1057 compare 7.000000000000000 0 -> 1
+ddcomp1058 compare 8.000000000000000 0 -> 1
+ddcomp1059 compare 9.000000000000000 0 -> 1
+
+-- Null tests
+ddcom9990 compare 10 # -> NaN Invalid_operation
+ddcom9991 compare # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddCompareSig.decTest b/Lib/test/decimaltestdata/ddCompareSig.decTest
index c82ec45517..8d3fce08c7 100644
--- a/Lib/test/decimaltestdata/ddCompareSig.decTest
+++ b/Lib/test/decimaltestdata/ddCompareSig.decTest
@@ -1,647 +1,647 @@
-------------------------------------------------------------------------
--- ddCompareSig.decTest -- decDouble comparison; all NaNs signal --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddcms001 comparesig -2 -2 -> 0
-ddcms002 comparesig -2 -1 -> -1
-ddcms003 comparesig -2 0 -> -1
-ddcms004 comparesig -2 1 -> -1
-ddcms005 comparesig -2 2 -> -1
-ddcms006 comparesig -1 -2 -> 1
-ddcms007 comparesig -1 -1 -> 0
-ddcms008 comparesig -1 0 -> -1
-ddcms009 comparesig -1 1 -> -1
-ddcms010 comparesig -1 2 -> -1
-ddcms011 comparesig 0 -2 -> 1
-ddcms012 comparesig 0 -1 -> 1
-ddcms013 comparesig 0 0 -> 0
-ddcms014 comparesig 0 1 -> -1
-ddcms015 comparesig 0 2 -> -1
-ddcms016 comparesig 1 -2 -> 1
-ddcms017 comparesig 1 -1 -> 1
-ddcms018 comparesig 1 0 -> 1
-ddcms019 comparesig 1 1 -> 0
-ddcms020 comparesig 1 2 -> -1
-ddcms021 comparesig 2 -2 -> 1
-ddcms022 comparesig 2 -1 -> 1
-ddcms023 comparesig 2 0 -> 1
-ddcms025 comparesig 2 1 -> 1
-ddcms026 comparesig 2 2 -> 0
-
-ddcms031 comparesig -20 -20 -> 0
-ddcms032 comparesig -20 -10 -> -1
-ddcms033 comparesig -20 00 -> -1
-ddcms034 comparesig -20 10 -> -1
-ddcms035 comparesig -20 20 -> -1
-ddcms036 comparesig -10 -20 -> 1
-ddcms037 comparesig -10 -10 -> 0
-ddcms038 comparesig -10 00 -> -1
-ddcms039 comparesig -10 10 -> -1
-ddcms040 comparesig -10 20 -> -1
-ddcms041 comparesig 00 -20 -> 1
-ddcms042 comparesig 00 -10 -> 1
-ddcms043 comparesig 00 00 -> 0
-ddcms044 comparesig 00 10 -> -1
-ddcms045 comparesig 00 20 -> -1
-ddcms046 comparesig 10 -20 -> 1
-ddcms047 comparesig 10 -10 -> 1
-ddcms048 comparesig 10 00 -> 1
-ddcms049 comparesig 10 10 -> 0
-ddcms050 comparesig 10 20 -> -1
-ddcms051 comparesig 20 -20 -> 1
-ddcms052 comparesig 20 -10 -> 1
-ddcms053 comparesig 20 00 -> 1
-ddcms055 comparesig 20 10 -> 1
-ddcms056 comparesig 20 20 -> 0
-
-ddcms061 comparesig -2.0 -2.0 -> 0
-ddcms062 comparesig -2.0 -1.0 -> -1
-ddcms063 comparesig -2.0 0.0 -> -1
-ddcms064 comparesig -2.0 1.0 -> -1
-ddcms065 comparesig -2.0 2.0 -> -1
-ddcms066 comparesig -1.0 -2.0 -> 1
-ddcms067 comparesig -1.0 -1.0 -> 0
-ddcms068 comparesig -1.0 0.0 -> -1
-ddcms069 comparesig -1.0 1.0 -> -1
-ddcms070 comparesig -1.0 2.0 -> -1
-ddcms071 comparesig 0.0 -2.0 -> 1
-ddcms072 comparesig 0.0 -1.0 -> 1
-ddcms073 comparesig 0.0 0.0 -> 0
-ddcms074 comparesig 0.0 1.0 -> -1
-ddcms075 comparesig 0.0 2.0 -> -1
-ddcms076 comparesig 1.0 -2.0 -> 1
-ddcms077 comparesig 1.0 -1.0 -> 1
-ddcms078 comparesig 1.0 0.0 -> 1
-ddcms079 comparesig 1.0 1.0 -> 0
-ddcms080 comparesig 1.0 2.0 -> -1
-ddcms081 comparesig 2.0 -2.0 -> 1
-ddcms082 comparesig 2.0 -1.0 -> 1
-ddcms083 comparesig 2.0 0.0 -> 1
-ddcms085 comparesig 2.0 1.0 -> 1
-ddcms086 comparesig 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-ddcms090 comparesig 9.999999999999999E+384 9.999999999999999E+384 -> 0
-ddcms091 comparesig -9.999999999999999E+384 9.999999999999999E+384 -> -1
-ddcms092 comparesig 9.999999999999999E+384 -9.999999999999999E+384 -> 1
-ddcms093 comparesig -9.999999999999999E+384 -9.999999999999999E+384 -> 0
-
--- some differing length/exponent cases
-ddcms100 comparesig 7.0 7.0 -> 0
-ddcms101 comparesig 7.0 7 -> 0
-ddcms102 comparesig 7 7.0 -> 0
-ddcms103 comparesig 7E+0 7.0 -> 0
-ddcms104 comparesig 70E-1 7.0 -> 0
-ddcms105 comparesig 0.7E+1 7 -> 0
-ddcms106 comparesig 70E-1 7 -> 0
-ddcms107 comparesig 7.0 7E+0 -> 0
-ddcms108 comparesig 7.0 70E-1 -> 0
-ddcms109 comparesig 7 0.7E+1 -> 0
-ddcms110 comparesig 7 70E-1 -> 0
-
-ddcms120 comparesig 8.0 7.0 -> 1
-ddcms121 comparesig 8.0 7 -> 1
-ddcms122 comparesig 8 7.0 -> 1
-ddcms123 comparesig 8E+0 7.0 -> 1
-ddcms124 comparesig 80E-1 7.0 -> 1
-ddcms125 comparesig 0.8E+1 7 -> 1
-ddcms126 comparesig 80E-1 7 -> 1
-ddcms127 comparesig 8.0 7E+0 -> 1
-ddcms128 comparesig 8.0 70E-1 -> 1
-ddcms129 comparesig 8 0.7E+1 -> 1
-ddcms130 comparesig 8 70E-1 -> 1
-
-ddcms140 comparesig 8.0 9.0 -> -1
-ddcms141 comparesig 8.0 9 -> -1
-ddcms142 comparesig 8 9.0 -> -1
-ddcms143 comparesig 8E+0 9.0 -> -1
-ddcms144 comparesig 80E-1 9.0 -> -1
-ddcms145 comparesig 0.8E+1 9 -> -1
-ddcms146 comparesig 80E-1 9 -> -1
-ddcms147 comparesig 8.0 9E+0 -> -1
-ddcms148 comparesig 8.0 90E-1 -> -1
-ddcms149 comparesig 8 0.9E+1 -> -1
-ddcms150 comparesig 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ddcms200 comparesig -7.0 7.0 -> -1
-ddcms201 comparesig -7.0 7 -> -1
-ddcms202 comparesig -7 7.0 -> -1
-ddcms203 comparesig -7E+0 7.0 -> -1
-ddcms204 comparesig -70E-1 7.0 -> -1
-ddcms205 comparesig -0.7E+1 7 -> -1
-ddcms206 comparesig -70E-1 7 -> -1
-ddcms207 comparesig -7.0 7E+0 -> -1
-ddcms208 comparesig -7.0 70E-1 -> -1
-ddcms209 comparesig -7 0.7E+1 -> -1
-ddcms210 comparesig -7 70E-1 -> -1
-
-ddcms220 comparesig -8.0 7.0 -> -1
-ddcms221 comparesig -8.0 7 -> -1
-ddcms222 comparesig -8 7.0 -> -1
-ddcms223 comparesig -8E+0 7.0 -> -1
-ddcms224 comparesig -80E-1 7.0 -> -1
-ddcms225 comparesig -0.8E+1 7 -> -1
-ddcms226 comparesig -80E-1 7 -> -1
-ddcms227 comparesig -8.0 7E+0 -> -1
-ddcms228 comparesig -8.0 70E-1 -> -1
-ddcms229 comparesig -8 0.7E+1 -> -1
-ddcms230 comparesig -8 70E-1 -> -1
-
-ddcms240 comparesig -8.0 9.0 -> -1
-ddcms241 comparesig -8.0 9 -> -1
-ddcms242 comparesig -8 9.0 -> -1
-ddcms243 comparesig -8E+0 9.0 -> -1
-ddcms244 comparesig -80E-1 9.0 -> -1
-ddcms245 comparesig -0.8E+1 9 -> -1
-ddcms246 comparesig -80E-1 9 -> -1
-ddcms247 comparesig -8.0 9E+0 -> -1
-ddcms248 comparesig -8.0 90E-1 -> -1
-ddcms249 comparesig -8 0.9E+1 -> -1
-ddcms250 comparesig -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ddcms300 comparesig 7.0 -7.0 -> 1
-ddcms301 comparesig 7.0 -7 -> 1
-ddcms302 comparesig 7 -7.0 -> 1
-ddcms303 comparesig 7E+0 -7.0 -> 1
-ddcms304 comparesig 70E-1 -7.0 -> 1
-ddcms305 comparesig .7E+1 -7 -> 1
-ddcms306 comparesig 70E-1 -7 -> 1
-ddcms307 comparesig 7.0 -7E+0 -> 1
-ddcms308 comparesig 7.0 -70E-1 -> 1
-ddcms309 comparesig 7 -.7E+1 -> 1
-ddcms310 comparesig 7 -70E-1 -> 1
-
-ddcms320 comparesig 8.0 -7.0 -> 1
-ddcms321 comparesig 8.0 -7 -> 1
-ddcms322 comparesig 8 -7.0 -> 1
-ddcms323 comparesig 8E+0 -7.0 -> 1
-ddcms324 comparesig 80E-1 -7.0 -> 1
-ddcms325 comparesig .8E+1 -7 -> 1
-ddcms326 comparesig 80E-1 -7 -> 1
-ddcms327 comparesig 8.0 -7E+0 -> 1
-ddcms328 comparesig 8.0 -70E-1 -> 1
-ddcms329 comparesig 8 -.7E+1 -> 1
-ddcms330 comparesig 8 -70E-1 -> 1
-
-ddcms340 comparesig 8.0 -9.0 -> 1
-ddcms341 comparesig 8.0 -9 -> 1
-ddcms342 comparesig 8 -9.0 -> 1
-ddcms343 comparesig 8E+0 -9.0 -> 1
-ddcms344 comparesig 80E-1 -9.0 -> 1
-ddcms345 comparesig .8E+1 -9 -> 1
-ddcms346 comparesig 80E-1 -9 -> 1
-ddcms347 comparesig 8.0 -9E+0 -> 1
-ddcms348 comparesig 8.0 -90E-1 -> 1
-ddcms349 comparesig 8 -.9E+1 -> 1
-ddcms350 comparesig 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-ddcms400 comparesig -7.0 -7.0 -> 0
-ddcms401 comparesig -7.0 -7 -> 0
-ddcms402 comparesig -7 -7.0 -> 0
-ddcms403 comparesig -7E+0 -7.0 -> 0
-ddcms404 comparesig -70E-1 -7.0 -> 0
-ddcms405 comparesig -.7E+1 -7 -> 0
-ddcms406 comparesig -70E-1 -7 -> 0
-ddcms407 comparesig -7.0 -7E+0 -> 0
-ddcms408 comparesig -7.0 -70E-1 -> 0
-ddcms409 comparesig -7 -.7E+1 -> 0
-ddcms410 comparesig -7 -70E-1 -> 0
-
-ddcms420 comparesig -8.0 -7.0 -> -1
-ddcms421 comparesig -8.0 -7 -> -1
-ddcms422 comparesig -8 -7.0 -> -1
-ddcms423 comparesig -8E+0 -7.0 -> -1
-ddcms424 comparesig -80E-1 -7.0 -> -1
-ddcms425 comparesig -.8E+1 -7 -> -1
-ddcms426 comparesig -80E-1 -7 -> -1
-ddcms427 comparesig -8.0 -7E+0 -> -1
-ddcms428 comparesig -8.0 -70E-1 -> -1
-ddcms429 comparesig -8 -.7E+1 -> -1
-ddcms430 comparesig -8 -70E-1 -> -1
-
-ddcms440 comparesig -8.0 -9.0 -> 1
-ddcms441 comparesig -8.0 -9 -> 1
-ddcms442 comparesig -8 -9.0 -> 1
-ddcms443 comparesig -8E+0 -9.0 -> 1
-ddcms444 comparesig -80E-1 -9.0 -> 1
-ddcms445 comparesig -.8E+1 -9 -> 1
-ddcms446 comparesig -80E-1 -9 -> 1
-ddcms447 comparesig -8.0 -9E+0 -> 1
-ddcms448 comparesig -8.0 -90E-1 -> 1
-ddcms449 comparesig -8 -.9E+1 -> 1
-ddcms450 comparesig -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-ddcms473 comparesig 123.4560000000000E-89 123.456E-89 -> 0
-ddcms474 comparesig 123.456000000000E+89 123.456E+89 -> 0
-ddcms475 comparesig 123.45600000000E-89 123.456E-89 -> 0
-ddcms476 comparesig 123.4560000000E+89 123.456E+89 -> 0
-ddcms477 comparesig 123.456000000E-89 123.456E-89 -> 0
-ddcms478 comparesig 123.45600000E+89 123.456E+89 -> 0
-ddcms479 comparesig 123.4560000E-89 123.456E-89 -> 0
-ddcms480 comparesig 123.456000E+89 123.456E+89 -> 0
-ddcms481 comparesig 123.45600E-89 123.456E-89 -> 0
-ddcms482 comparesig 123.4560E+89 123.456E+89 -> 0
-ddcms483 comparesig 123.456E-89 123.456E-89 -> 0
-ddcms487 comparesig 123.456E+89 123.4560000000000E+89 -> 0
-ddcms488 comparesig 123.456E-89 123.456000000000E-89 -> 0
-ddcms489 comparesig 123.456E+89 123.45600000000E+89 -> 0
-ddcms490 comparesig 123.456E-89 123.4560000000E-89 -> 0
-ddcms491 comparesig 123.456E+89 123.456000000E+89 -> 0
-ddcms492 comparesig 123.456E-89 123.45600000E-89 -> 0
-ddcms493 comparesig 123.456E+89 123.4560000E+89 -> 0
-ddcms494 comparesig 123.456E-89 123.456000E-89 -> 0
-ddcms495 comparesig 123.456E+89 123.45600E+89 -> 0
-ddcms496 comparesig 123.456E-89 123.4560E-89 -> 0
-ddcms497 comparesig 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-ddcms500 comparesig 1 1E-15 -> 1
-ddcms501 comparesig 1 1E-14 -> 1
-ddcms502 comparesig 1 1E-13 -> 1
-ddcms503 comparesig 1 1E-12 -> 1
-ddcms504 comparesig 1 1E-11 -> 1
-ddcms505 comparesig 1 1E-10 -> 1
-ddcms506 comparesig 1 1E-9 -> 1
-ddcms507 comparesig 1 1E-8 -> 1
-ddcms508 comparesig 1 1E-7 -> 1
-ddcms509 comparesig 1 1E-6 -> 1
-ddcms510 comparesig 1 1E-5 -> 1
-ddcms511 comparesig 1 1E-4 -> 1
-ddcms512 comparesig 1 1E-3 -> 1
-ddcms513 comparesig 1 1E-2 -> 1
-ddcms514 comparesig 1 1E-1 -> 1
-ddcms515 comparesig 1 1E-0 -> 0
-ddcms516 comparesig 1 1E+1 -> -1
-ddcms517 comparesig 1 1E+2 -> -1
-ddcms518 comparesig 1 1E+3 -> -1
-ddcms519 comparesig 1 1E+4 -> -1
-ddcms521 comparesig 1 1E+5 -> -1
-ddcms522 comparesig 1 1E+6 -> -1
-ddcms523 comparesig 1 1E+7 -> -1
-ddcms524 comparesig 1 1E+8 -> -1
-ddcms525 comparesig 1 1E+9 -> -1
-ddcms526 comparesig 1 1E+10 -> -1
-ddcms527 comparesig 1 1E+11 -> -1
-ddcms528 comparesig 1 1E+12 -> -1
-ddcms529 comparesig 1 1E+13 -> -1
-ddcms530 comparesig 1 1E+14 -> -1
-ddcms531 comparesig 1 1E+15 -> -1
--- LR swap
-ddcms540 comparesig 1E-15 1 -> -1
-ddcms541 comparesig 1E-14 1 -> -1
-ddcms542 comparesig 1E-13 1 -> -1
-ddcms543 comparesig 1E-12 1 -> -1
-ddcms544 comparesig 1E-11 1 -> -1
-ddcms545 comparesig 1E-10 1 -> -1
-ddcms546 comparesig 1E-9 1 -> -1
-ddcms547 comparesig 1E-8 1 -> -1
-ddcms548 comparesig 1E-7 1 -> -1
-ddcms549 comparesig 1E-6 1 -> -1
-ddcms550 comparesig 1E-5 1 -> -1
-ddcms551 comparesig 1E-4 1 -> -1
-ddcms552 comparesig 1E-3 1 -> -1
-ddcms553 comparesig 1E-2 1 -> -1
-ddcms554 comparesig 1E-1 1 -> -1
-ddcms555 comparesig 1E-0 1 -> 0
-ddcms556 comparesig 1E+1 1 -> 1
-ddcms557 comparesig 1E+2 1 -> 1
-ddcms558 comparesig 1E+3 1 -> 1
-ddcms559 comparesig 1E+4 1 -> 1
-ddcms561 comparesig 1E+5 1 -> 1
-ddcms562 comparesig 1E+6 1 -> 1
-ddcms563 comparesig 1E+7 1 -> 1
-ddcms564 comparesig 1E+8 1 -> 1
-ddcms565 comparesig 1E+9 1 -> 1
-ddcms566 comparesig 1E+10 1 -> 1
-ddcms567 comparesig 1E+11 1 -> 1
-ddcms568 comparesig 1E+12 1 -> 1
-ddcms569 comparesig 1E+13 1 -> 1
-ddcms570 comparesig 1E+14 1 -> 1
-ddcms571 comparesig 1E+15 1 -> 1
--- similar with a useful coefficient, one side only
-ddcms580 comparesig 0.000000987654321 1E-15 -> 1
-ddcms581 comparesig 0.000000987654321 1E-14 -> 1
-ddcms582 comparesig 0.000000987654321 1E-13 -> 1
-ddcms583 comparesig 0.000000987654321 1E-12 -> 1
-ddcms584 comparesig 0.000000987654321 1E-11 -> 1
-ddcms585 comparesig 0.000000987654321 1E-10 -> 1
-ddcms586 comparesig 0.000000987654321 1E-9 -> 1
-ddcms587 comparesig 0.000000987654321 1E-8 -> 1
-ddcms588 comparesig 0.000000987654321 1E-7 -> 1
-ddcms589 comparesig 0.000000987654321 1E-6 -> -1
-ddcms590 comparesig 0.000000987654321 1E-5 -> -1
-ddcms591 comparesig 0.000000987654321 1E-4 -> -1
-ddcms592 comparesig 0.000000987654321 1E-3 -> -1
-ddcms593 comparesig 0.000000987654321 1E-2 -> -1
-ddcms594 comparesig 0.000000987654321 1E-1 -> -1
-ddcms595 comparesig 0.000000987654321 1E-0 -> -1
-ddcms596 comparesig 0.000000987654321 1E+1 -> -1
-ddcms597 comparesig 0.000000987654321 1E+2 -> -1
-ddcms598 comparesig 0.000000987654321 1E+3 -> -1
-ddcms599 comparesig 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-ddcms600 comparesig 12 12.2345 -> -1
-ddcms601 comparesig 12.0 12.2345 -> -1
-ddcms602 comparesig 12.00 12.2345 -> -1
-ddcms603 comparesig 12.000 12.2345 -> -1
-ddcms604 comparesig 12.0000 12.2345 -> -1
-ddcms605 comparesig 12.00000 12.2345 -> -1
-ddcms606 comparesig 12.000000 12.2345 -> -1
-ddcms607 comparesig 12.0000000 12.2345 -> -1
-ddcms608 comparesig 12.00000000 12.2345 -> -1
-ddcms609 comparesig 12.000000000 12.2345 -> -1
-ddcms610 comparesig 12.1234 12 -> 1
-ddcms611 comparesig 12.1234 12.0 -> 1
-ddcms612 comparesig 12.1234 12.00 -> 1
-ddcms613 comparesig 12.1234 12.000 -> 1
-ddcms614 comparesig 12.1234 12.0000 -> 1
-ddcms615 comparesig 12.1234 12.00000 -> 1
-ddcms616 comparesig 12.1234 12.000000 -> 1
-ddcms617 comparesig 12.1234 12.0000000 -> 1
-ddcms618 comparesig 12.1234 12.00000000 -> 1
-ddcms619 comparesig 12.1234 12.000000000 -> 1
-ddcms620 comparesig -12 -12.2345 -> 1
-ddcms621 comparesig -12.0 -12.2345 -> 1
-ddcms622 comparesig -12.00 -12.2345 -> 1
-ddcms623 comparesig -12.000 -12.2345 -> 1
-ddcms624 comparesig -12.0000 -12.2345 -> 1
-ddcms625 comparesig -12.00000 -12.2345 -> 1
-ddcms626 comparesig -12.000000 -12.2345 -> 1
-ddcms627 comparesig -12.0000000 -12.2345 -> 1
-ddcms628 comparesig -12.00000000 -12.2345 -> 1
-ddcms629 comparesig -12.000000000 -12.2345 -> 1
-ddcms630 comparesig -12.1234 -12 -> -1
-ddcms631 comparesig -12.1234 -12.0 -> -1
-ddcms632 comparesig -12.1234 -12.00 -> -1
-ddcms633 comparesig -12.1234 -12.000 -> -1
-ddcms634 comparesig -12.1234 -12.0000 -> -1
-ddcms635 comparesig -12.1234 -12.00000 -> -1
-ddcms636 comparesig -12.1234 -12.000000 -> -1
-ddcms637 comparesig -12.1234 -12.0000000 -> -1
-ddcms638 comparesig -12.1234 -12.00000000 -> -1
-ddcms639 comparesig -12.1234 -12.000000000 -> -1
-
--- extended zeros
-ddcms640 comparesig 0 0 -> 0
-ddcms641 comparesig 0 -0 -> 0
-ddcms642 comparesig 0 -0.0 -> 0
-ddcms643 comparesig 0 0.0 -> 0
-ddcms644 comparesig -0 0 -> 0
-ddcms645 comparesig -0 -0 -> 0
-ddcms646 comparesig -0 -0.0 -> 0
-ddcms647 comparesig -0 0.0 -> 0
-ddcms648 comparesig 0.0 0 -> 0
-ddcms649 comparesig 0.0 -0 -> 0
-ddcms650 comparesig 0.0 -0.0 -> 0
-ddcms651 comparesig 0.0 0.0 -> 0
-ddcms652 comparesig -0.0 0 -> 0
-ddcms653 comparesig -0.0 -0 -> 0
-ddcms654 comparesig -0.0 -0.0 -> 0
-ddcms655 comparesig -0.0 0.0 -> 0
-
-ddcms656 comparesig -0E1 0.0 -> 0
-ddcms657 comparesig -0E2 0.0 -> 0
-ddcms658 comparesig 0E1 0.0 -> 0
-ddcms659 comparesig 0E2 0.0 -> 0
-ddcms660 comparesig -0E1 0 -> 0
-ddcms661 comparesig -0E2 0 -> 0
-ddcms662 comparesig 0E1 0 -> 0
-ddcms663 comparesig 0E2 0 -> 0
-ddcms664 comparesig -0E1 -0E1 -> 0
-ddcms665 comparesig -0E2 -0E1 -> 0
-ddcms666 comparesig 0E1 -0E1 -> 0
-ddcms667 comparesig 0E2 -0E1 -> 0
-ddcms668 comparesig -0E1 -0E2 -> 0
-ddcms669 comparesig -0E2 -0E2 -> 0
-ddcms670 comparesig 0E1 -0E2 -> 0
-ddcms671 comparesig 0E2 -0E2 -> 0
-ddcms672 comparesig -0E1 0E1 -> 0
-ddcms673 comparesig -0E2 0E1 -> 0
-ddcms674 comparesig 0E1 0E1 -> 0
-ddcms675 comparesig 0E2 0E1 -> 0
-ddcms676 comparesig -0E1 0E2 -> 0
-ddcms677 comparesig -0E2 0E2 -> 0
-ddcms678 comparesig 0E1 0E2 -> 0
-ddcms679 comparesig 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-ddcms680 comparesig 12 12 -> 0
-ddcms681 comparesig 12 12.0 -> 0
-ddcms682 comparesig 12 12.00 -> 0
-ddcms683 comparesig 12 12.000 -> 0
-ddcms684 comparesig 12 12.0000 -> 0
-ddcms685 comparesig 12 12.00000 -> 0
-ddcms686 comparesig 12 12.000000 -> 0
-ddcms687 comparesig 12 12.0000000 -> 0
-ddcms688 comparesig 12 12.00000000 -> 0
-ddcms689 comparesig 12 12.000000000 -> 0
-ddcms690 comparesig 12 12 -> 0
-ddcms691 comparesig 12.0 12 -> 0
-ddcms692 comparesig 12.00 12 -> 0
-ddcms693 comparesig 12.000 12 -> 0
-ddcms694 comparesig 12.0000 12 -> 0
-ddcms695 comparesig 12.00000 12 -> 0
-ddcms696 comparesig 12.000000 12 -> 0
-ddcms697 comparesig 12.0000000 12 -> 0
-ddcms698 comparesig 12.00000000 12 -> 0
-ddcms699 comparesig 12.000000000 12 -> 0
-
--- first, second, & last digit
-ddcms700 comparesig 1234567890123456 1234567890123455 -> 1
-ddcms701 comparesig 1234567890123456 1234567890123456 -> 0
-ddcms702 comparesig 1234567890123456 1234567890123457 -> -1
-ddcms703 comparesig 1234567890123456 0234567890123456 -> 1
-ddcms704 comparesig 1234567890123456 1234567890123456 -> 0
-ddcms705 comparesig 1234567890123456 2234567890123456 -> -1
-ddcms706 comparesig 1134567890123456 1034567890123456 -> 1
-ddcms707 comparesig 1134567890123456 1134567890123456 -> 0
-ddcms708 comparesig 1134567890123456 1234567890123456 -> -1
-
--- miscellaneous
-ddcms721 comparesig 12345678000 1 -> 1
-ddcms722 comparesig 1 12345678000 -> -1
-ddcms723 comparesig 1234567800 1 -> 1
-ddcms724 comparesig 1 1234567800 -> -1
-ddcms725 comparesig 1234567890 1 -> 1
-ddcms726 comparesig 1 1234567890 -> -1
-ddcms727 comparesig 1234567891 1 -> 1
-ddcms728 comparesig 1 1234567891 -> -1
-ddcms729 comparesig 12345678901 1 -> 1
-ddcms730 comparesig 1 12345678901 -> -1
-ddcms731 comparesig 1234567896 1 -> 1
-ddcms732 comparesig 1 1234567896 -> -1
-
--- residue cases at lower precision
-ddcms740 comparesig 1 0.9999999 -> 1
-ddcms741 comparesig 1 0.999999 -> 1
-ddcms742 comparesig 1 0.99999 -> 1
-ddcms743 comparesig 1 1.0000 -> 0
-ddcms744 comparesig 1 1.00001 -> -1
-ddcms745 comparesig 1 1.000001 -> -1
-ddcms746 comparesig 1 1.0000001 -> -1
-ddcms750 comparesig 0.9999999 1 -> -1
-ddcms751 comparesig 0.999999 1 -> -1
-ddcms752 comparesig 0.99999 1 -> -1
-ddcms753 comparesig 1.0000 1 -> 0
-ddcms754 comparesig 1.00001 1 -> 1
-ddcms755 comparesig 1.000001 1 -> 1
-ddcms756 comparesig 1.0000001 1 -> 1
-
--- Specials
-ddcms780 comparesig Inf -Inf -> 1
-ddcms781 comparesig Inf -1000 -> 1
-ddcms782 comparesig Inf -1 -> 1
-ddcms783 comparesig Inf -0 -> 1
-ddcms784 comparesig Inf 0 -> 1
-ddcms785 comparesig Inf 1 -> 1
-ddcms786 comparesig Inf 1000 -> 1
-ddcms787 comparesig Inf Inf -> 0
-ddcms788 comparesig -1000 Inf -> -1
-ddcms789 comparesig -Inf Inf -> -1
-ddcms790 comparesig -1 Inf -> -1
-ddcms791 comparesig -0 Inf -> -1
-ddcms792 comparesig 0 Inf -> -1
-ddcms793 comparesig 1 Inf -> -1
-ddcms794 comparesig 1000 Inf -> -1
-ddcms795 comparesig Inf Inf -> 0
-
-ddcms800 comparesig -Inf -Inf -> 0
-ddcms801 comparesig -Inf -1000 -> -1
-ddcms802 comparesig -Inf -1 -> -1
-ddcms803 comparesig -Inf -0 -> -1
-ddcms804 comparesig -Inf 0 -> -1
-ddcms805 comparesig -Inf 1 -> -1
-ddcms806 comparesig -Inf 1000 -> -1
-ddcms807 comparesig -Inf Inf -> -1
-ddcms808 comparesig -Inf -Inf -> 0
-ddcms809 comparesig -1000 -Inf -> 1
-ddcms810 comparesig -1 -Inf -> 1
-ddcms811 comparesig -0 -Inf -> 1
-ddcms812 comparesig 0 -Inf -> 1
-ddcms813 comparesig 1 -Inf -> 1
-ddcms814 comparesig 1000 -Inf -> 1
-ddcms815 comparesig Inf -Inf -> 1
-
-ddcms821 comparesig NaN -Inf -> NaN Invalid_operation
-ddcms822 comparesig NaN -1000 -> NaN Invalid_operation
-ddcms823 comparesig NaN -1 -> NaN Invalid_operation
-ddcms824 comparesig NaN -0 -> NaN Invalid_operation
-ddcms825 comparesig NaN 0 -> NaN Invalid_operation
-ddcms826 comparesig NaN 1 -> NaN Invalid_operation
-ddcms827 comparesig NaN 1000 -> NaN Invalid_operation
-ddcms828 comparesig NaN Inf -> NaN Invalid_operation
-ddcms829 comparesig NaN NaN -> NaN Invalid_operation
-ddcms830 comparesig -Inf NaN -> NaN Invalid_operation
-ddcms831 comparesig -1000 NaN -> NaN Invalid_operation
-ddcms832 comparesig -1 NaN -> NaN Invalid_operation
-ddcms833 comparesig -0 NaN -> NaN Invalid_operation
-ddcms834 comparesig 0 NaN -> NaN Invalid_operation
-ddcms835 comparesig 1 NaN -> NaN Invalid_operation
-ddcms836 comparesig 1000 NaN -> NaN Invalid_operation
-ddcms837 comparesig Inf NaN -> NaN Invalid_operation
-ddcms838 comparesig -NaN -NaN -> -NaN Invalid_operation
-ddcms839 comparesig +NaN -NaN -> NaN Invalid_operation
-ddcms840 comparesig -NaN +NaN -> -NaN Invalid_operation
-
-ddcms841 comparesig sNaN -Inf -> NaN Invalid_operation
-ddcms842 comparesig sNaN -1000 -> NaN Invalid_operation
-ddcms843 comparesig sNaN -1 -> NaN Invalid_operation
-ddcms844 comparesig sNaN -0 -> NaN Invalid_operation
-ddcms845 comparesig sNaN 0 -> NaN Invalid_operation
-ddcms846 comparesig sNaN 1 -> NaN Invalid_operation
-ddcms847 comparesig sNaN 1000 -> NaN Invalid_operation
-ddcms848 comparesig sNaN NaN -> NaN Invalid_operation
-ddcms849 comparesig sNaN sNaN -> NaN Invalid_operation
-ddcms850 comparesig NaN sNaN -> NaN Invalid_operation
-ddcms851 comparesig -Inf sNaN -> NaN Invalid_operation
-ddcms852 comparesig -1000 sNaN -> NaN Invalid_operation
-ddcms853 comparesig -1 sNaN -> NaN Invalid_operation
-ddcms854 comparesig -0 sNaN -> NaN Invalid_operation
-ddcms855 comparesig 0 sNaN -> NaN Invalid_operation
-ddcms856 comparesig 1 sNaN -> NaN Invalid_operation
-ddcms857 comparesig 1000 sNaN -> NaN Invalid_operation
-ddcms858 comparesig Inf sNaN -> NaN Invalid_operation
-ddcms859 comparesig NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation
-ddcms861 comparesig NaN8 999 -> NaN8 Invalid_operation
-ddcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation
-ddcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation
-ddcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation
-ddcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation
-ddcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation
-ddcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation
-ddcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation
-ddcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation
-ddcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation
-
-ddcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation
-ddcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation
-ddcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation
-ddcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation
-ddcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation
-ddcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation
-ddcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation
-ddcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation
-ddcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- wide range
-ddcms880 comparesig +1.23456789012345E-0 9E+384 -> -1
-ddcms881 comparesig 9E+384 +1.23456789012345E-0 -> 1
-ddcms882 comparesig +0.100 9E-383 -> 1
-ddcms883 comparesig 9E-383 +0.100 -> -1
-ddcms885 comparesig -1.23456789012345E-0 9E+384 -> -1
-ddcms886 comparesig 9E+384 -1.23456789012345E-0 -> 1
-ddcms887 comparesig -0.100 9E-383 -> -1
-ddcms888 comparesig 9E-383 -0.100 -> 1
-
--- signs
-ddcms901 comparesig 1e+77 1e+11 -> 1
-ddcms902 comparesig 1e+77 -1e+11 -> 1
-ddcms903 comparesig -1e+77 1e+11 -> -1
-ddcms904 comparesig -1e+77 -1e+11 -> -1
-ddcms905 comparesig 1e-77 1e-11 -> -1
-ddcms906 comparesig 1e-77 -1e-11 -> 1
-ddcms907 comparesig -1e-77 1e-11 -> -1
-ddcms908 comparesig -1e-77 -1e-11 -> 1
-
--- Null tests
-ddcms990 comparesig 10 # -> NaN Invalid_operation
-ddcms991 comparesig # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddCompareSig.decTest -- decDouble comparison; all NaNs signal --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddcms001 comparesig -2 -2 -> 0
+ddcms002 comparesig -2 -1 -> -1
+ddcms003 comparesig -2 0 -> -1
+ddcms004 comparesig -2 1 -> -1
+ddcms005 comparesig -2 2 -> -1
+ddcms006 comparesig -1 -2 -> 1
+ddcms007 comparesig -1 -1 -> 0
+ddcms008 comparesig -1 0 -> -1
+ddcms009 comparesig -1 1 -> -1
+ddcms010 comparesig -1 2 -> -1
+ddcms011 comparesig 0 -2 -> 1
+ddcms012 comparesig 0 -1 -> 1
+ddcms013 comparesig 0 0 -> 0
+ddcms014 comparesig 0 1 -> -1
+ddcms015 comparesig 0 2 -> -1
+ddcms016 comparesig 1 -2 -> 1
+ddcms017 comparesig 1 -1 -> 1
+ddcms018 comparesig 1 0 -> 1
+ddcms019 comparesig 1 1 -> 0
+ddcms020 comparesig 1 2 -> -1
+ddcms021 comparesig 2 -2 -> 1
+ddcms022 comparesig 2 -1 -> 1
+ddcms023 comparesig 2 0 -> 1
+ddcms025 comparesig 2 1 -> 1
+ddcms026 comparesig 2 2 -> 0
+
+ddcms031 comparesig -20 -20 -> 0
+ddcms032 comparesig -20 -10 -> -1
+ddcms033 comparesig -20 00 -> -1
+ddcms034 comparesig -20 10 -> -1
+ddcms035 comparesig -20 20 -> -1
+ddcms036 comparesig -10 -20 -> 1
+ddcms037 comparesig -10 -10 -> 0
+ddcms038 comparesig -10 00 -> -1
+ddcms039 comparesig -10 10 -> -1
+ddcms040 comparesig -10 20 -> -1
+ddcms041 comparesig 00 -20 -> 1
+ddcms042 comparesig 00 -10 -> 1
+ddcms043 comparesig 00 00 -> 0
+ddcms044 comparesig 00 10 -> -1
+ddcms045 comparesig 00 20 -> -1
+ddcms046 comparesig 10 -20 -> 1
+ddcms047 comparesig 10 -10 -> 1
+ddcms048 comparesig 10 00 -> 1
+ddcms049 comparesig 10 10 -> 0
+ddcms050 comparesig 10 20 -> -1
+ddcms051 comparesig 20 -20 -> 1
+ddcms052 comparesig 20 -10 -> 1
+ddcms053 comparesig 20 00 -> 1
+ddcms055 comparesig 20 10 -> 1
+ddcms056 comparesig 20 20 -> 0
+
+ddcms061 comparesig -2.0 -2.0 -> 0
+ddcms062 comparesig -2.0 -1.0 -> -1
+ddcms063 comparesig -2.0 0.0 -> -1
+ddcms064 comparesig -2.0 1.0 -> -1
+ddcms065 comparesig -2.0 2.0 -> -1
+ddcms066 comparesig -1.0 -2.0 -> 1
+ddcms067 comparesig -1.0 -1.0 -> 0
+ddcms068 comparesig -1.0 0.0 -> -1
+ddcms069 comparesig -1.0 1.0 -> -1
+ddcms070 comparesig -1.0 2.0 -> -1
+ddcms071 comparesig 0.0 -2.0 -> 1
+ddcms072 comparesig 0.0 -1.0 -> 1
+ddcms073 comparesig 0.0 0.0 -> 0
+ddcms074 comparesig 0.0 1.0 -> -1
+ddcms075 comparesig 0.0 2.0 -> -1
+ddcms076 comparesig 1.0 -2.0 -> 1
+ddcms077 comparesig 1.0 -1.0 -> 1
+ddcms078 comparesig 1.0 0.0 -> 1
+ddcms079 comparesig 1.0 1.0 -> 0
+ddcms080 comparesig 1.0 2.0 -> -1
+ddcms081 comparesig 2.0 -2.0 -> 1
+ddcms082 comparesig 2.0 -1.0 -> 1
+ddcms083 comparesig 2.0 0.0 -> 1
+ddcms085 comparesig 2.0 1.0 -> 1
+ddcms086 comparesig 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+ddcms090 comparesig 9.999999999999999E+384 9.999999999999999E+384 -> 0
+ddcms091 comparesig -9.999999999999999E+384 9.999999999999999E+384 -> -1
+ddcms092 comparesig 9.999999999999999E+384 -9.999999999999999E+384 -> 1
+ddcms093 comparesig -9.999999999999999E+384 -9.999999999999999E+384 -> 0
+
+-- some differing length/exponent cases
+ddcms100 comparesig 7.0 7.0 -> 0
+ddcms101 comparesig 7.0 7 -> 0
+ddcms102 comparesig 7 7.0 -> 0
+ddcms103 comparesig 7E+0 7.0 -> 0
+ddcms104 comparesig 70E-1 7.0 -> 0
+ddcms105 comparesig 0.7E+1 7 -> 0
+ddcms106 comparesig 70E-1 7 -> 0
+ddcms107 comparesig 7.0 7E+0 -> 0
+ddcms108 comparesig 7.0 70E-1 -> 0
+ddcms109 comparesig 7 0.7E+1 -> 0
+ddcms110 comparesig 7 70E-1 -> 0
+
+ddcms120 comparesig 8.0 7.0 -> 1
+ddcms121 comparesig 8.0 7 -> 1
+ddcms122 comparesig 8 7.0 -> 1
+ddcms123 comparesig 8E+0 7.0 -> 1
+ddcms124 comparesig 80E-1 7.0 -> 1
+ddcms125 comparesig 0.8E+1 7 -> 1
+ddcms126 comparesig 80E-1 7 -> 1
+ddcms127 comparesig 8.0 7E+0 -> 1
+ddcms128 comparesig 8.0 70E-1 -> 1
+ddcms129 comparesig 8 0.7E+1 -> 1
+ddcms130 comparesig 8 70E-1 -> 1
+
+ddcms140 comparesig 8.0 9.0 -> -1
+ddcms141 comparesig 8.0 9 -> -1
+ddcms142 comparesig 8 9.0 -> -1
+ddcms143 comparesig 8E+0 9.0 -> -1
+ddcms144 comparesig 80E-1 9.0 -> -1
+ddcms145 comparesig 0.8E+1 9 -> -1
+ddcms146 comparesig 80E-1 9 -> -1
+ddcms147 comparesig 8.0 9E+0 -> -1
+ddcms148 comparesig 8.0 90E-1 -> -1
+ddcms149 comparesig 8 0.9E+1 -> -1
+ddcms150 comparesig 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ddcms200 comparesig -7.0 7.0 -> -1
+ddcms201 comparesig -7.0 7 -> -1
+ddcms202 comparesig -7 7.0 -> -1
+ddcms203 comparesig -7E+0 7.0 -> -1
+ddcms204 comparesig -70E-1 7.0 -> -1
+ddcms205 comparesig -0.7E+1 7 -> -1
+ddcms206 comparesig -70E-1 7 -> -1
+ddcms207 comparesig -7.0 7E+0 -> -1
+ddcms208 comparesig -7.0 70E-1 -> -1
+ddcms209 comparesig -7 0.7E+1 -> -1
+ddcms210 comparesig -7 70E-1 -> -1
+
+ddcms220 comparesig -8.0 7.0 -> -1
+ddcms221 comparesig -8.0 7 -> -1
+ddcms222 comparesig -8 7.0 -> -1
+ddcms223 comparesig -8E+0 7.0 -> -1
+ddcms224 comparesig -80E-1 7.0 -> -1
+ddcms225 comparesig -0.8E+1 7 -> -1
+ddcms226 comparesig -80E-1 7 -> -1
+ddcms227 comparesig -8.0 7E+0 -> -1
+ddcms228 comparesig -8.0 70E-1 -> -1
+ddcms229 comparesig -8 0.7E+1 -> -1
+ddcms230 comparesig -8 70E-1 -> -1
+
+ddcms240 comparesig -8.0 9.0 -> -1
+ddcms241 comparesig -8.0 9 -> -1
+ddcms242 comparesig -8 9.0 -> -1
+ddcms243 comparesig -8E+0 9.0 -> -1
+ddcms244 comparesig -80E-1 9.0 -> -1
+ddcms245 comparesig -0.8E+1 9 -> -1
+ddcms246 comparesig -80E-1 9 -> -1
+ddcms247 comparesig -8.0 9E+0 -> -1
+ddcms248 comparesig -8.0 90E-1 -> -1
+ddcms249 comparesig -8 0.9E+1 -> -1
+ddcms250 comparesig -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ddcms300 comparesig 7.0 -7.0 -> 1
+ddcms301 comparesig 7.0 -7 -> 1
+ddcms302 comparesig 7 -7.0 -> 1
+ddcms303 comparesig 7E+0 -7.0 -> 1
+ddcms304 comparesig 70E-1 -7.0 -> 1
+ddcms305 comparesig .7E+1 -7 -> 1
+ddcms306 comparesig 70E-1 -7 -> 1
+ddcms307 comparesig 7.0 -7E+0 -> 1
+ddcms308 comparesig 7.0 -70E-1 -> 1
+ddcms309 comparesig 7 -.7E+1 -> 1
+ddcms310 comparesig 7 -70E-1 -> 1
+
+ddcms320 comparesig 8.0 -7.0 -> 1
+ddcms321 comparesig 8.0 -7 -> 1
+ddcms322 comparesig 8 -7.0 -> 1
+ddcms323 comparesig 8E+0 -7.0 -> 1
+ddcms324 comparesig 80E-1 -7.0 -> 1
+ddcms325 comparesig .8E+1 -7 -> 1
+ddcms326 comparesig 80E-1 -7 -> 1
+ddcms327 comparesig 8.0 -7E+0 -> 1
+ddcms328 comparesig 8.0 -70E-1 -> 1
+ddcms329 comparesig 8 -.7E+1 -> 1
+ddcms330 comparesig 8 -70E-1 -> 1
+
+ddcms340 comparesig 8.0 -9.0 -> 1
+ddcms341 comparesig 8.0 -9 -> 1
+ddcms342 comparesig 8 -9.0 -> 1
+ddcms343 comparesig 8E+0 -9.0 -> 1
+ddcms344 comparesig 80E-1 -9.0 -> 1
+ddcms345 comparesig .8E+1 -9 -> 1
+ddcms346 comparesig 80E-1 -9 -> 1
+ddcms347 comparesig 8.0 -9E+0 -> 1
+ddcms348 comparesig 8.0 -90E-1 -> 1
+ddcms349 comparesig 8 -.9E+1 -> 1
+ddcms350 comparesig 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+ddcms400 comparesig -7.0 -7.0 -> 0
+ddcms401 comparesig -7.0 -7 -> 0
+ddcms402 comparesig -7 -7.0 -> 0
+ddcms403 comparesig -7E+0 -7.0 -> 0
+ddcms404 comparesig -70E-1 -7.0 -> 0
+ddcms405 comparesig -.7E+1 -7 -> 0
+ddcms406 comparesig -70E-1 -7 -> 0
+ddcms407 comparesig -7.0 -7E+0 -> 0
+ddcms408 comparesig -7.0 -70E-1 -> 0
+ddcms409 comparesig -7 -.7E+1 -> 0
+ddcms410 comparesig -7 -70E-1 -> 0
+
+ddcms420 comparesig -8.0 -7.0 -> -1
+ddcms421 comparesig -8.0 -7 -> -1
+ddcms422 comparesig -8 -7.0 -> -1
+ddcms423 comparesig -8E+0 -7.0 -> -1
+ddcms424 comparesig -80E-1 -7.0 -> -1
+ddcms425 comparesig -.8E+1 -7 -> -1
+ddcms426 comparesig -80E-1 -7 -> -1
+ddcms427 comparesig -8.0 -7E+0 -> -1
+ddcms428 comparesig -8.0 -70E-1 -> -1
+ddcms429 comparesig -8 -.7E+1 -> -1
+ddcms430 comparesig -8 -70E-1 -> -1
+
+ddcms440 comparesig -8.0 -9.0 -> 1
+ddcms441 comparesig -8.0 -9 -> 1
+ddcms442 comparesig -8 -9.0 -> 1
+ddcms443 comparesig -8E+0 -9.0 -> 1
+ddcms444 comparesig -80E-1 -9.0 -> 1
+ddcms445 comparesig -.8E+1 -9 -> 1
+ddcms446 comparesig -80E-1 -9 -> 1
+ddcms447 comparesig -8.0 -9E+0 -> 1
+ddcms448 comparesig -8.0 -90E-1 -> 1
+ddcms449 comparesig -8 -.9E+1 -> 1
+ddcms450 comparesig -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+ddcms473 comparesig 123.4560000000000E-89 123.456E-89 -> 0
+ddcms474 comparesig 123.456000000000E+89 123.456E+89 -> 0
+ddcms475 comparesig 123.45600000000E-89 123.456E-89 -> 0
+ddcms476 comparesig 123.4560000000E+89 123.456E+89 -> 0
+ddcms477 comparesig 123.456000000E-89 123.456E-89 -> 0
+ddcms478 comparesig 123.45600000E+89 123.456E+89 -> 0
+ddcms479 comparesig 123.4560000E-89 123.456E-89 -> 0
+ddcms480 comparesig 123.456000E+89 123.456E+89 -> 0
+ddcms481 comparesig 123.45600E-89 123.456E-89 -> 0
+ddcms482 comparesig 123.4560E+89 123.456E+89 -> 0
+ddcms483 comparesig 123.456E-89 123.456E-89 -> 0
+ddcms487 comparesig 123.456E+89 123.4560000000000E+89 -> 0
+ddcms488 comparesig 123.456E-89 123.456000000000E-89 -> 0
+ddcms489 comparesig 123.456E+89 123.45600000000E+89 -> 0
+ddcms490 comparesig 123.456E-89 123.4560000000E-89 -> 0
+ddcms491 comparesig 123.456E+89 123.456000000E+89 -> 0
+ddcms492 comparesig 123.456E-89 123.45600000E-89 -> 0
+ddcms493 comparesig 123.456E+89 123.4560000E+89 -> 0
+ddcms494 comparesig 123.456E-89 123.456000E-89 -> 0
+ddcms495 comparesig 123.456E+89 123.45600E+89 -> 0
+ddcms496 comparesig 123.456E-89 123.4560E-89 -> 0
+ddcms497 comparesig 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+ddcms500 comparesig 1 1E-15 -> 1
+ddcms501 comparesig 1 1E-14 -> 1
+ddcms502 comparesig 1 1E-13 -> 1
+ddcms503 comparesig 1 1E-12 -> 1
+ddcms504 comparesig 1 1E-11 -> 1
+ddcms505 comparesig 1 1E-10 -> 1
+ddcms506 comparesig 1 1E-9 -> 1
+ddcms507 comparesig 1 1E-8 -> 1
+ddcms508 comparesig 1 1E-7 -> 1
+ddcms509 comparesig 1 1E-6 -> 1
+ddcms510 comparesig 1 1E-5 -> 1
+ddcms511 comparesig 1 1E-4 -> 1
+ddcms512 comparesig 1 1E-3 -> 1
+ddcms513 comparesig 1 1E-2 -> 1
+ddcms514 comparesig 1 1E-1 -> 1
+ddcms515 comparesig 1 1E-0 -> 0
+ddcms516 comparesig 1 1E+1 -> -1
+ddcms517 comparesig 1 1E+2 -> -1
+ddcms518 comparesig 1 1E+3 -> -1
+ddcms519 comparesig 1 1E+4 -> -1
+ddcms521 comparesig 1 1E+5 -> -1
+ddcms522 comparesig 1 1E+6 -> -1
+ddcms523 comparesig 1 1E+7 -> -1
+ddcms524 comparesig 1 1E+8 -> -1
+ddcms525 comparesig 1 1E+9 -> -1
+ddcms526 comparesig 1 1E+10 -> -1
+ddcms527 comparesig 1 1E+11 -> -1
+ddcms528 comparesig 1 1E+12 -> -1
+ddcms529 comparesig 1 1E+13 -> -1
+ddcms530 comparesig 1 1E+14 -> -1
+ddcms531 comparesig 1 1E+15 -> -1
+-- LR swap
+ddcms540 comparesig 1E-15 1 -> -1
+ddcms541 comparesig 1E-14 1 -> -1
+ddcms542 comparesig 1E-13 1 -> -1
+ddcms543 comparesig 1E-12 1 -> -1
+ddcms544 comparesig 1E-11 1 -> -1
+ddcms545 comparesig 1E-10 1 -> -1
+ddcms546 comparesig 1E-9 1 -> -1
+ddcms547 comparesig 1E-8 1 -> -1
+ddcms548 comparesig 1E-7 1 -> -1
+ddcms549 comparesig 1E-6 1 -> -1
+ddcms550 comparesig 1E-5 1 -> -1
+ddcms551 comparesig 1E-4 1 -> -1
+ddcms552 comparesig 1E-3 1 -> -1
+ddcms553 comparesig 1E-2 1 -> -1
+ddcms554 comparesig 1E-1 1 -> -1
+ddcms555 comparesig 1E-0 1 -> 0
+ddcms556 comparesig 1E+1 1 -> 1
+ddcms557 comparesig 1E+2 1 -> 1
+ddcms558 comparesig 1E+3 1 -> 1
+ddcms559 comparesig 1E+4 1 -> 1
+ddcms561 comparesig 1E+5 1 -> 1
+ddcms562 comparesig 1E+6 1 -> 1
+ddcms563 comparesig 1E+7 1 -> 1
+ddcms564 comparesig 1E+8 1 -> 1
+ddcms565 comparesig 1E+9 1 -> 1
+ddcms566 comparesig 1E+10 1 -> 1
+ddcms567 comparesig 1E+11 1 -> 1
+ddcms568 comparesig 1E+12 1 -> 1
+ddcms569 comparesig 1E+13 1 -> 1
+ddcms570 comparesig 1E+14 1 -> 1
+ddcms571 comparesig 1E+15 1 -> 1
+-- similar with a useful coefficient, one side only
+ddcms580 comparesig 0.000000987654321 1E-15 -> 1
+ddcms581 comparesig 0.000000987654321 1E-14 -> 1
+ddcms582 comparesig 0.000000987654321 1E-13 -> 1
+ddcms583 comparesig 0.000000987654321 1E-12 -> 1
+ddcms584 comparesig 0.000000987654321 1E-11 -> 1
+ddcms585 comparesig 0.000000987654321 1E-10 -> 1
+ddcms586 comparesig 0.000000987654321 1E-9 -> 1
+ddcms587 comparesig 0.000000987654321 1E-8 -> 1
+ddcms588 comparesig 0.000000987654321 1E-7 -> 1
+ddcms589 comparesig 0.000000987654321 1E-6 -> -1
+ddcms590 comparesig 0.000000987654321 1E-5 -> -1
+ddcms591 comparesig 0.000000987654321 1E-4 -> -1
+ddcms592 comparesig 0.000000987654321 1E-3 -> -1
+ddcms593 comparesig 0.000000987654321 1E-2 -> -1
+ddcms594 comparesig 0.000000987654321 1E-1 -> -1
+ddcms595 comparesig 0.000000987654321 1E-0 -> -1
+ddcms596 comparesig 0.000000987654321 1E+1 -> -1
+ddcms597 comparesig 0.000000987654321 1E+2 -> -1
+ddcms598 comparesig 0.000000987654321 1E+3 -> -1
+ddcms599 comparesig 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+ddcms600 comparesig 12 12.2345 -> -1
+ddcms601 comparesig 12.0 12.2345 -> -1
+ddcms602 comparesig 12.00 12.2345 -> -1
+ddcms603 comparesig 12.000 12.2345 -> -1
+ddcms604 comparesig 12.0000 12.2345 -> -1
+ddcms605 comparesig 12.00000 12.2345 -> -1
+ddcms606 comparesig 12.000000 12.2345 -> -1
+ddcms607 comparesig 12.0000000 12.2345 -> -1
+ddcms608 comparesig 12.00000000 12.2345 -> -1
+ddcms609 comparesig 12.000000000 12.2345 -> -1
+ddcms610 comparesig 12.1234 12 -> 1
+ddcms611 comparesig 12.1234 12.0 -> 1
+ddcms612 comparesig 12.1234 12.00 -> 1
+ddcms613 comparesig 12.1234 12.000 -> 1
+ddcms614 comparesig 12.1234 12.0000 -> 1
+ddcms615 comparesig 12.1234 12.00000 -> 1
+ddcms616 comparesig 12.1234 12.000000 -> 1
+ddcms617 comparesig 12.1234 12.0000000 -> 1
+ddcms618 comparesig 12.1234 12.00000000 -> 1
+ddcms619 comparesig 12.1234 12.000000000 -> 1
+ddcms620 comparesig -12 -12.2345 -> 1
+ddcms621 comparesig -12.0 -12.2345 -> 1
+ddcms622 comparesig -12.00 -12.2345 -> 1
+ddcms623 comparesig -12.000 -12.2345 -> 1
+ddcms624 comparesig -12.0000 -12.2345 -> 1
+ddcms625 comparesig -12.00000 -12.2345 -> 1
+ddcms626 comparesig -12.000000 -12.2345 -> 1
+ddcms627 comparesig -12.0000000 -12.2345 -> 1
+ddcms628 comparesig -12.00000000 -12.2345 -> 1
+ddcms629 comparesig -12.000000000 -12.2345 -> 1
+ddcms630 comparesig -12.1234 -12 -> -1
+ddcms631 comparesig -12.1234 -12.0 -> -1
+ddcms632 comparesig -12.1234 -12.00 -> -1
+ddcms633 comparesig -12.1234 -12.000 -> -1
+ddcms634 comparesig -12.1234 -12.0000 -> -1
+ddcms635 comparesig -12.1234 -12.00000 -> -1
+ddcms636 comparesig -12.1234 -12.000000 -> -1
+ddcms637 comparesig -12.1234 -12.0000000 -> -1
+ddcms638 comparesig -12.1234 -12.00000000 -> -1
+ddcms639 comparesig -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+ddcms640 comparesig 0 0 -> 0
+ddcms641 comparesig 0 -0 -> 0
+ddcms642 comparesig 0 -0.0 -> 0
+ddcms643 comparesig 0 0.0 -> 0
+ddcms644 comparesig -0 0 -> 0
+ddcms645 comparesig -0 -0 -> 0
+ddcms646 comparesig -0 -0.0 -> 0
+ddcms647 comparesig -0 0.0 -> 0
+ddcms648 comparesig 0.0 0 -> 0
+ddcms649 comparesig 0.0 -0 -> 0
+ddcms650 comparesig 0.0 -0.0 -> 0
+ddcms651 comparesig 0.0 0.0 -> 0
+ddcms652 comparesig -0.0 0 -> 0
+ddcms653 comparesig -0.0 -0 -> 0
+ddcms654 comparesig -0.0 -0.0 -> 0
+ddcms655 comparesig -0.0 0.0 -> 0
+
+ddcms656 comparesig -0E1 0.0 -> 0
+ddcms657 comparesig -0E2 0.0 -> 0
+ddcms658 comparesig 0E1 0.0 -> 0
+ddcms659 comparesig 0E2 0.0 -> 0
+ddcms660 comparesig -0E1 0 -> 0
+ddcms661 comparesig -0E2 0 -> 0
+ddcms662 comparesig 0E1 0 -> 0
+ddcms663 comparesig 0E2 0 -> 0
+ddcms664 comparesig -0E1 -0E1 -> 0
+ddcms665 comparesig -0E2 -0E1 -> 0
+ddcms666 comparesig 0E1 -0E1 -> 0
+ddcms667 comparesig 0E2 -0E1 -> 0
+ddcms668 comparesig -0E1 -0E2 -> 0
+ddcms669 comparesig -0E2 -0E2 -> 0
+ddcms670 comparesig 0E1 -0E2 -> 0
+ddcms671 comparesig 0E2 -0E2 -> 0
+ddcms672 comparesig -0E1 0E1 -> 0
+ddcms673 comparesig -0E2 0E1 -> 0
+ddcms674 comparesig 0E1 0E1 -> 0
+ddcms675 comparesig 0E2 0E1 -> 0
+ddcms676 comparesig -0E1 0E2 -> 0
+ddcms677 comparesig -0E2 0E2 -> 0
+ddcms678 comparesig 0E1 0E2 -> 0
+ddcms679 comparesig 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+ddcms680 comparesig 12 12 -> 0
+ddcms681 comparesig 12 12.0 -> 0
+ddcms682 comparesig 12 12.00 -> 0
+ddcms683 comparesig 12 12.000 -> 0
+ddcms684 comparesig 12 12.0000 -> 0
+ddcms685 comparesig 12 12.00000 -> 0
+ddcms686 comparesig 12 12.000000 -> 0
+ddcms687 comparesig 12 12.0000000 -> 0
+ddcms688 comparesig 12 12.00000000 -> 0
+ddcms689 comparesig 12 12.000000000 -> 0
+ddcms690 comparesig 12 12 -> 0
+ddcms691 comparesig 12.0 12 -> 0
+ddcms692 comparesig 12.00 12 -> 0
+ddcms693 comparesig 12.000 12 -> 0
+ddcms694 comparesig 12.0000 12 -> 0
+ddcms695 comparesig 12.00000 12 -> 0
+ddcms696 comparesig 12.000000 12 -> 0
+ddcms697 comparesig 12.0000000 12 -> 0
+ddcms698 comparesig 12.00000000 12 -> 0
+ddcms699 comparesig 12.000000000 12 -> 0
+
+-- first, second, & last digit
+ddcms700 comparesig 1234567890123456 1234567890123455 -> 1
+ddcms701 comparesig 1234567890123456 1234567890123456 -> 0
+ddcms702 comparesig 1234567890123456 1234567890123457 -> -1
+ddcms703 comparesig 1234567890123456 0234567890123456 -> 1
+ddcms704 comparesig 1234567890123456 1234567890123456 -> 0
+ddcms705 comparesig 1234567890123456 2234567890123456 -> -1
+ddcms706 comparesig 1134567890123456 1034567890123456 -> 1
+ddcms707 comparesig 1134567890123456 1134567890123456 -> 0
+ddcms708 comparesig 1134567890123456 1234567890123456 -> -1
+
+-- miscellaneous
+ddcms721 comparesig 12345678000 1 -> 1
+ddcms722 comparesig 1 12345678000 -> -1
+ddcms723 comparesig 1234567800 1 -> 1
+ddcms724 comparesig 1 1234567800 -> -1
+ddcms725 comparesig 1234567890 1 -> 1
+ddcms726 comparesig 1 1234567890 -> -1
+ddcms727 comparesig 1234567891 1 -> 1
+ddcms728 comparesig 1 1234567891 -> -1
+ddcms729 comparesig 12345678901 1 -> 1
+ddcms730 comparesig 1 12345678901 -> -1
+ddcms731 comparesig 1234567896 1 -> 1
+ddcms732 comparesig 1 1234567896 -> -1
+
+-- residue cases at lower precision
+ddcms740 comparesig 1 0.9999999 -> 1
+ddcms741 comparesig 1 0.999999 -> 1
+ddcms742 comparesig 1 0.99999 -> 1
+ddcms743 comparesig 1 1.0000 -> 0
+ddcms744 comparesig 1 1.00001 -> -1
+ddcms745 comparesig 1 1.000001 -> -1
+ddcms746 comparesig 1 1.0000001 -> -1
+ddcms750 comparesig 0.9999999 1 -> -1
+ddcms751 comparesig 0.999999 1 -> -1
+ddcms752 comparesig 0.99999 1 -> -1
+ddcms753 comparesig 1.0000 1 -> 0
+ddcms754 comparesig 1.00001 1 -> 1
+ddcms755 comparesig 1.000001 1 -> 1
+ddcms756 comparesig 1.0000001 1 -> 1
+
+-- Specials
+ddcms780 comparesig Inf -Inf -> 1
+ddcms781 comparesig Inf -1000 -> 1
+ddcms782 comparesig Inf -1 -> 1
+ddcms783 comparesig Inf -0 -> 1
+ddcms784 comparesig Inf 0 -> 1
+ddcms785 comparesig Inf 1 -> 1
+ddcms786 comparesig Inf 1000 -> 1
+ddcms787 comparesig Inf Inf -> 0
+ddcms788 comparesig -1000 Inf -> -1
+ddcms789 comparesig -Inf Inf -> -1
+ddcms790 comparesig -1 Inf -> -1
+ddcms791 comparesig -0 Inf -> -1
+ddcms792 comparesig 0 Inf -> -1
+ddcms793 comparesig 1 Inf -> -1
+ddcms794 comparesig 1000 Inf -> -1
+ddcms795 comparesig Inf Inf -> 0
+
+ddcms800 comparesig -Inf -Inf -> 0
+ddcms801 comparesig -Inf -1000 -> -1
+ddcms802 comparesig -Inf -1 -> -1
+ddcms803 comparesig -Inf -0 -> -1
+ddcms804 comparesig -Inf 0 -> -1
+ddcms805 comparesig -Inf 1 -> -1
+ddcms806 comparesig -Inf 1000 -> -1
+ddcms807 comparesig -Inf Inf -> -1
+ddcms808 comparesig -Inf -Inf -> 0
+ddcms809 comparesig -1000 -Inf -> 1
+ddcms810 comparesig -1 -Inf -> 1
+ddcms811 comparesig -0 -Inf -> 1
+ddcms812 comparesig 0 -Inf -> 1
+ddcms813 comparesig 1 -Inf -> 1
+ddcms814 comparesig 1000 -Inf -> 1
+ddcms815 comparesig Inf -Inf -> 1
+
+ddcms821 comparesig NaN -Inf -> NaN Invalid_operation
+ddcms822 comparesig NaN -1000 -> NaN Invalid_operation
+ddcms823 comparesig NaN -1 -> NaN Invalid_operation
+ddcms824 comparesig NaN -0 -> NaN Invalid_operation
+ddcms825 comparesig NaN 0 -> NaN Invalid_operation
+ddcms826 comparesig NaN 1 -> NaN Invalid_operation
+ddcms827 comparesig NaN 1000 -> NaN Invalid_operation
+ddcms828 comparesig NaN Inf -> NaN Invalid_operation
+ddcms829 comparesig NaN NaN -> NaN Invalid_operation
+ddcms830 comparesig -Inf NaN -> NaN Invalid_operation
+ddcms831 comparesig -1000 NaN -> NaN Invalid_operation
+ddcms832 comparesig -1 NaN -> NaN Invalid_operation
+ddcms833 comparesig -0 NaN -> NaN Invalid_operation
+ddcms834 comparesig 0 NaN -> NaN Invalid_operation
+ddcms835 comparesig 1 NaN -> NaN Invalid_operation
+ddcms836 comparesig 1000 NaN -> NaN Invalid_operation
+ddcms837 comparesig Inf NaN -> NaN Invalid_operation
+ddcms838 comparesig -NaN -NaN -> -NaN Invalid_operation
+ddcms839 comparesig +NaN -NaN -> NaN Invalid_operation
+ddcms840 comparesig -NaN +NaN -> -NaN Invalid_operation
+
+ddcms841 comparesig sNaN -Inf -> NaN Invalid_operation
+ddcms842 comparesig sNaN -1000 -> NaN Invalid_operation
+ddcms843 comparesig sNaN -1 -> NaN Invalid_operation
+ddcms844 comparesig sNaN -0 -> NaN Invalid_operation
+ddcms845 comparesig sNaN 0 -> NaN Invalid_operation
+ddcms846 comparesig sNaN 1 -> NaN Invalid_operation
+ddcms847 comparesig sNaN 1000 -> NaN Invalid_operation
+ddcms848 comparesig sNaN NaN -> NaN Invalid_operation
+ddcms849 comparesig sNaN sNaN -> NaN Invalid_operation
+ddcms850 comparesig NaN sNaN -> NaN Invalid_operation
+ddcms851 comparesig -Inf sNaN -> NaN Invalid_operation
+ddcms852 comparesig -1000 sNaN -> NaN Invalid_operation
+ddcms853 comparesig -1 sNaN -> NaN Invalid_operation
+ddcms854 comparesig -0 sNaN -> NaN Invalid_operation
+ddcms855 comparesig 0 sNaN -> NaN Invalid_operation
+ddcms856 comparesig 1 sNaN -> NaN Invalid_operation
+ddcms857 comparesig 1000 sNaN -> NaN Invalid_operation
+ddcms858 comparesig Inf sNaN -> NaN Invalid_operation
+ddcms859 comparesig NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation
+ddcms861 comparesig NaN8 999 -> NaN8 Invalid_operation
+ddcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation
+ddcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation
+ddcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation
+ddcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation
+ddcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation
+ddcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation
+ddcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation
+ddcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation
+ddcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation
+
+ddcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation
+ddcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation
+ddcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation
+ddcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation
+ddcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation
+ddcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation
+ddcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation
+ddcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation
+ddcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- wide range
+ddcms880 comparesig +1.23456789012345E-0 9E+384 -> -1
+ddcms881 comparesig 9E+384 +1.23456789012345E-0 -> 1
+ddcms882 comparesig +0.100 9E-383 -> 1
+ddcms883 comparesig 9E-383 +0.100 -> -1
+ddcms885 comparesig -1.23456789012345E-0 9E+384 -> -1
+ddcms886 comparesig 9E+384 -1.23456789012345E-0 -> 1
+ddcms887 comparesig -0.100 9E-383 -> -1
+ddcms888 comparesig 9E-383 -0.100 -> 1
+
+-- signs
+ddcms901 comparesig 1e+77 1e+11 -> 1
+ddcms902 comparesig 1e+77 -1e+11 -> 1
+ddcms903 comparesig -1e+77 1e+11 -> -1
+ddcms904 comparesig -1e+77 -1e+11 -> -1
+ddcms905 comparesig 1e-77 1e-11 -> -1
+ddcms906 comparesig 1e-77 -1e-11 -> 1
+ddcms907 comparesig -1e-77 1e-11 -> -1
+ddcms908 comparesig -1e-77 -1e-11 -> 1
+
+-- Null tests
+ddcms990 comparesig 10 # -> NaN Invalid_operation
+ddcms991 comparesig # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddCompareTotal.decTest b/Lib/test/decimaltestdata/ddCompareTotal.decTest
index 10c984c7ff..76beed5681 100644
--- a/Lib/test/decimaltestdata/ddCompareTotal.decTest
+++ b/Lib/test/decimaltestdata/ddCompareTotal.decTest
@@ -1,706 +1,706 @@
-------------------------------------------------------------------------
--- ddCompareTotal.decTest -- decDouble comparison using total ordering--
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddcot001 comparetotal -2 -2 -> 0
-ddcot002 comparetotal -2 -1 -> -1
-ddcot003 comparetotal -2 0 -> -1
-ddcot004 comparetotal -2 1 -> -1
-ddcot005 comparetotal -2 2 -> -1
-ddcot006 comparetotal -1 -2 -> 1
-ddcot007 comparetotal -1 -1 -> 0
-ddcot008 comparetotal -1 0 -> -1
-ddcot009 comparetotal -1 1 -> -1
-ddcot010 comparetotal -1 2 -> -1
-ddcot011 comparetotal 0 -2 -> 1
-ddcot012 comparetotal 0 -1 -> 1
-ddcot013 comparetotal 0 0 -> 0
-ddcot014 comparetotal 0 1 -> -1
-ddcot015 comparetotal 0 2 -> -1
-ddcot016 comparetotal 1 -2 -> 1
-ddcot017 comparetotal 1 -1 -> 1
-ddcot018 comparetotal 1 0 -> 1
-ddcot019 comparetotal 1 1 -> 0
-ddcot020 comparetotal 1 2 -> -1
-ddcot021 comparetotal 2 -2 -> 1
-ddcot022 comparetotal 2 -1 -> 1
-ddcot023 comparetotal 2 0 -> 1
-ddcot025 comparetotal 2 1 -> 1
-ddcot026 comparetotal 2 2 -> 0
-
-ddcot031 comparetotal -20 -20 -> 0
-ddcot032 comparetotal -20 -10 -> -1
-ddcot033 comparetotal -20 00 -> -1
-ddcot034 comparetotal -20 10 -> -1
-ddcot035 comparetotal -20 20 -> -1
-ddcot036 comparetotal -10 -20 -> 1
-ddcot037 comparetotal -10 -10 -> 0
-ddcot038 comparetotal -10 00 -> -1
-ddcot039 comparetotal -10 10 -> -1
-ddcot040 comparetotal -10 20 -> -1
-ddcot041 comparetotal 00 -20 -> 1
-ddcot042 comparetotal 00 -10 -> 1
-ddcot043 comparetotal 00 00 -> 0
-ddcot044 comparetotal 00 10 -> -1
-ddcot045 comparetotal 00 20 -> -1
-ddcot046 comparetotal 10 -20 -> 1
-ddcot047 comparetotal 10 -10 -> 1
-ddcot048 comparetotal 10 00 -> 1
-ddcot049 comparetotal 10 10 -> 0
-ddcot050 comparetotal 10 20 -> -1
-ddcot051 comparetotal 20 -20 -> 1
-ddcot052 comparetotal 20 -10 -> 1
-ddcot053 comparetotal 20 00 -> 1
-ddcot055 comparetotal 20 10 -> 1
-ddcot056 comparetotal 20 20 -> 0
-
-ddcot061 comparetotal -2.0 -2.0 -> 0
-ddcot062 comparetotal -2.0 -1.0 -> -1
-ddcot063 comparetotal -2.0 0.0 -> -1
-ddcot064 comparetotal -2.0 1.0 -> -1
-ddcot065 comparetotal -2.0 2.0 -> -1
-ddcot066 comparetotal -1.0 -2.0 -> 1
-ddcot067 comparetotal -1.0 -1.0 -> 0
-ddcot068 comparetotal -1.0 0.0 -> -1
-ddcot069 comparetotal -1.0 1.0 -> -1
-ddcot070 comparetotal -1.0 2.0 -> -1
-ddcot071 comparetotal 0.0 -2.0 -> 1
-ddcot072 comparetotal 0.0 -1.0 -> 1
-ddcot073 comparetotal 0.0 0.0 -> 0
-ddcot074 comparetotal 0.0 1.0 -> -1
-ddcot075 comparetotal 0.0 2.0 -> -1
-ddcot076 comparetotal 1.0 -2.0 -> 1
-ddcot077 comparetotal 1.0 -1.0 -> 1
-ddcot078 comparetotal 1.0 0.0 -> 1
-ddcot079 comparetotal 1.0 1.0 -> 0
-ddcot080 comparetotal 1.0 2.0 -> -1
-ddcot081 comparetotal 2.0 -2.0 -> 1
-ddcot082 comparetotal 2.0 -1.0 -> 1
-ddcot083 comparetotal 2.0 0.0 -> 1
-ddcot085 comparetotal 2.0 1.0 -> 1
-ddcot086 comparetotal 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-ddcot090 comparetotal 9.99999999E+384 9.99999999E+384 -> 0
-ddcot091 comparetotal -9.99999999E+384 9.99999999E+384 -> -1
-ddcot092 comparetotal 9.99999999E+384 -9.99999999E+384 -> 1
-ddcot093 comparetotal -9.99999999E+384 -9.99999999E+384 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-ddcot100 comparetotal 7.0 7.0 -> 0
-ddcot101 comparetotal 7.0 7 -> -1
-ddcot102 comparetotal 7 7.0 -> 1
-ddcot103 comparetotal 7E+0 7.0 -> 1
-ddcot104 comparetotal 70E-1 7.0 -> 0
-ddcot105 comparetotal 0.7E+1 7 -> 0
-ddcot106 comparetotal 70E-1 7 -> -1
-ddcot107 comparetotal 7.0 7E+0 -> -1
-ddcot108 comparetotal 7.0 70E-1 -> 0
-ddcot109 comparetotal 7 0.7E+1 -> 0
-ddcot110 comparetotal 7 70E-1 -> 1
-
-ddcot120 comparetotal 8.0 7.0 -> 1
-ddcot121 comparetotal 8.0 7 -> 1
-ddcot122 comparetotal 8 7.0 -> 1
-ddcot123 comparetotal 8E+0 7.0 -> 1
-ddcot124 comparetotal 80E-1 7.0 -> 1
-ddcot125 comparetotal 0.8E+1 7 -> 1
-ddcot126 comparetotal 80E-1 7 -> 1
-ddcot127 comparetotal 8.0 7E+0 -> 1
-ddcot128 comparetotal 8.0 70E-1 -> 1
-ddcot129 comparetotal 8 0.7E+1 -> 1
-ddcot130 comparetotal 8 70E-1 -> 1
-
-ddcot140 comparetotal 8.0 9.0 -> -1
-ddcot141 comparetotal 8.0 9 -> -1
-ddcot142 comparetotal 8 9.0 -> -1
-ddcot143 comparetotal 8E+0 9.0 -> -1
-ddcot144 comparetotal 80E-1 9.0 -> -1
-ddcot145 comparetotal 0.8E+1 9 -> -1
-ddcot146 comparetotal 80E-1 9 -> -1
-ddcot147 comparetotal 8.0 9E+0 -> -1
-ddcot148 comparetotal 8.0 90E-1 -> -1
-ddcot149 comparetotal 8 0.9E+1 -> -1
-ddcot150 comparetotal 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ddcot200 comparetotal -7.0 7.0 -> -1
-ddcot201 comparetotal -7.0 7 -> -1
-ddcot202 comparetotal -7 7.0 -> -1
-ddcot203 comparetotal -7E+0 7.0 -> -1
-ddcot204 comparetotal -70E-1 7.0 -> -1
-ddcot205 comparetotal -0.7E+1 7 -> -1
-ddcot206 comparetotal -70E-1 7 -> -1
-ddcot207 comparetotal -7.0 7E+0 -> -1
-ddcot208 comparetotal -7.0 70E-1 -> -1
-ddcot209 comparetotal -7 0.7E+1 -> -1
-ddcot210 comparetotal -7 70E-1 -> -1
-
-ddcot220 comparetotal -8.0 7.0 -> -1
-ddcot221 comparetotal -8.0 7 -> -1
-ddcot222 comparetotal -8 7.0 -> -1
-ddcot223 comparetotal -8E+0 7.0 -> -1
-ddcot224 comparetotal -80E-1 7.0 -> -1
-ddcot225 comparetotal -0.8E+1 7 -> -1
-ddcot226 comparetotal -80E-1 7 -> -1
-ddcot227 comparetotal -8.0 7E+0 -> -1
-ddcot228 comparetotal -8.0 70E-1 -> -1
-ddcot229 comparetotal -8 0.7E+1 -> -1
-ddcot230 comparetotal -8 70E-1 -> -1
-
-ddcot240 comparetotal -8.0 9.0 -> -1
-ddcot241 comparetotal -8.0 9 -> -1
-ddcot242 comparetotal -8 9.0 -> -1
-ddcot243 comparetotal -8E+0 9.0 -> -1
-ddcot244 comparetotal -80E-1 9.0 -> -1
-ddcot245 comparetotal -0.8E+1 9 -> -1
-ddcot246 comparetotal -80E-1 9 -> -1
-ddcot247 comparetotal -8.0 9E+0 -> -1
-ddcot248 comparetotal -8.0 90E-1 -> -1
-ddcot249 comparetotal -8 0.9E+1 -> -1
-ddcot250 comparetotal -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ddcot300 comparetotal 7.0 -7.0 -> 1
-ddcot301 comparetotal 7.0 -7 -> 1
-ddcot302 comparetotal 7 -7.0 -> 1
-ddcot303 comparetotal 7E+0 -7.0 -> 1
-ddcot304 comparetotal 70E-1 -7.0 -> 1
-ddcot305 comparetotal .7E+1 -7 -> 1
-ddcot306 comparetotal 70E-1 -7 -> 1
-ddcot307 comparetotal 7.0 -7E+0 -> 1
-ddcot308 comparetotal 7.0 -70E-1 -> 1
-ddcot309 comparetotal 7 -.7E+1 -> 1
-ddcot310 comparetotal 7 -70E-1 -> 1
-
-ddcot320 comparetotal 8.0 -7.0 -> 1
-ddcot321 comparetotal 8.0 -7 -> 1
-ddcot322 comparetotal 8 -7.0 -> 1
-ddcot323 comparetotal 8E+0 -7.0 -> 1
-ddcot324 comparetotal 80E-1 -7.0 -> 1
-ddcot325 comparetotal .8E+1 -7 -> 1
-ddcot326 comparetotal 80E-1 -7 -> 1
-ddcot327 comparetotal 8.0 -7E+0 -> 1
-ddcot328 comparetotal 8.0 -70E-1 -> 1
-ddcot329 comparetotal 8 -.7E+1 -> 1
-ddcot330 comparetotal 8 -70E-1 -> 1
-
-ddcot340 comparetotal 8.0 -9.0 -> 1
-ddcot341 comparetotal 8.0 -9 -> 1
-ddcot342 comparetotal 8 -9.0 -> 1
-ddcot343 comparetotal 8E+0 -9.0 -> 1
-ddcot344 comparetotal 80E-1 -9.0 -> 1
-ddcot345 comparetotal .8E+1 -9 -> 1
-ddcot346 comparetotal 80E-1 -9 -> 1
-ddcot347 comparetotal 8.0 -9E+0 -> 1
-ddcot348 comparetotal 8.0 -90E-1 -> 1
-ddcot349 comparetotal 8 -.9E+1 -> 1
-ddcot350 comparetotal 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-ddcot400 comparetotal -7.0 -7.0 -> 0
-ddcot401 comparetotal -7.0 -7 -> 1
-ddcot402 comparetotal -7 -7.0 -> -1
-ddcot403 comparetotal -7E+0 -7.0 -> -1
-ddcot404 comparetotal -70E-1 -7.0 -> 0
-ddcot405 comparetotal -.7E+1 -7 -> 0
-ddcot406 comparetotal -70E-1 -7 -> 1
-ddcot407 comparetotal -7.0 -7E+0 -> 1
-ddcot408 comparetotal -7.0 -70E-1 -> 0
-ddcot409 comparetotal -7 -.7E+1 -> 0
-ddcot410 comparetotal -7 -70E-1 -> -1
-
-ddcot420 comparetotal -8.0 -7.0 -> -1
-ddcot421 comparetotal -8.0 -7 -> -1
-ddcot422 comparetotal -8 -7.0 -> -1
-ddcot423 comparetotal -8E+0 -7.0 -> -1
-ddcot424 comparetotal -80E-1 -7.0 -> -1
-ddcot425 comparetotal -.8E+1 -7 -> -1
-ddcot426 comparetotal -80E-1 -7 -> -1
-ddcot427 comparetotal -8.0 -7E+0 -> -1
-ddcot428 comparetotal -8.0 -70E-1 -> -1
-ddcot429 comparetotal -8 -.7E+1 -> -1
-ddcot430 comparetotal -8 -70E-1 -> -1
-
-ddcot440 comparetotal -8.0 -9.0 -> 1
-ddcot441 comparetotal -8.0 -9 -> 1
-ddcot442 comparetotal -8 -9.0 -> 1
-ddcot443 comparetotal -8E+0 -9.0 -> 1
-ddcot444 comparetotal -80E-1 -9.0 -> 1
-ddcot445 comparetotal -.8E+1 -9 -> 1
-ddcot446 comparetotal -80E-1 -9 -> 1
-ddcot447 comparetotal -8.0 -9E+0 -> 1
-ddcot448 comparetotal -8.0 -90E-1 -> 1
-ddcot449 comparetotal -8 -.9E+1 -> 1
-ddcot450 comparetotal -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-ddcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
-ddcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1
-ddcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
-ddcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1
-ddcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
-ddcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1
-ddcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
-ddcot480 comparetotal 123.456000E+89 123.456E+89 -> -1
-ddcot481 comparetotal 123.45600E-89 123.456E-89 -> -1
-ddcot482 comparetotal 123.4560E+89 123.456E+89 -> -1
-ddcot483 comparetotal 123.456E-89 123.456E-89 -> 0
-ddcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1
-ddcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
-ddcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1
-ddcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
-ddcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1
-ddcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
-ddcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1
-ddcot494 comparetotal 123.456E-89 123.456000E-89 -> 1
-ddcot495 comparetotal 123.456E+89 123.45600E+89 -> 1
-ddcot496 comparetotal 123.456E-89 123.4560E-89 -> 1
-ddcot497 comparetotal 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-ddcot498 comparetotal 1 1E-17 -> 1
-ddcot499 comparetotal 1 1E-16 -> 1
-ddcot500 comparetotal 1 1E-15 -> 1
-ddcot501 comparetotal 1 1E-14 -> 1
-ddcot502 comparetotal 1 1E-13 -> 1
-ddcot503 comparetotal 1 1E-12 -> 1
-ddcot504 comparetotal 1 1E-11 -> 1
-ddcot505 comparetotal 1 1E-10 -> 1
-ddcot506 comparetotal 1 1E-9 -> 1
-ddcot507 comparetotal 1 1E-8 -> 1
-ddcot508 comparetotal 1 1E-7 -> 1
-ddcot509 comparetotal 1 1E-6 -> 1
-ddcot510 comparetotal 1 1E-5 -> 1
-ddcot511 comparetotal 1 1E-4 -> 1
-ddcot512 comparetotal 1 1E-3 -> 1
-ddcot513 comparetotal 1 1E-2 -> 1
-ddcot514 comparetotal 1 1E-1 -> 1
-ddcot515 comparetotal 1 1E-0 -> 0
-ddcot516 comparetotal 1 1E+1 -> -1
-ddcot517 comparetotal 1 1E+2 -> -1
-ddcot518 comparetotal 1 1E+3 -> -1
-ddcot519 comparetotal 1 1E+4 -> -1
-ddcot521 comparetotal 1 1E+5 -> -1
-ddcot522 comparetotal 1 1E+6 -> -1
-ddcot523 comparetotal 1 1E+7 -> -1
-ddcot524 comparetotal 1 1E+8 -> -1
-ddcot525 comparetotal 1 1E+9 -> -1
-ddcot526 comparetotal 1 1E+10 -> -1
-ddcot527 comparetotal 1 1E+11 -> -1
-ddcot528 comparetotal 1 1E+12 -> -1
-ddcot529 comparetotal 1 1E+13 -> -1
-ddcot530 comparetotal 1 1E+14 -> -1
-ddcot531 comparetotal 1 1E+15 -> -1
-ddcot532 comparetotal 1 1E+16 -> -1
-ddcot533 comparetotal 1 1E+17 -> -1
--- LR swap
-ddcot538 comparetotal 1E-17 1 -> -1
-ddcot539 comparetotal 1E-16 1 -> -1
-ddcot540 comparetotal 1E-15 1 -> -1
-ddcot541 comparetotal 1E-14 1 -> -1
-ddcot542 comparetotal 1E-13 1 -> -1
-ddcot543 comparetotal 1E-12 1 -> -1
-ddcot544 comparetotal 1E-11 1 -> -1
-ddcot545 comparetotal 1E-10 1 -> -1
-ddcot546 comparetotal 1E-9 1 -> -1
-ddcot547 comparetotal 1E-8 1 -> -1
-ddcot548 comparetotal 1E-7 1 -> -1
-ddcot549 comparetotal 1E-6 1 -> -1
-ddcot550 comparetotal 1E-5 1 -> -1
-ddcot551 comparetotal 1E-4 1 -> -1
-ddcot552 comparetotal 1E-3 1 -> -1
-ddcot553 comparetotal 1E-2 1 -> -1
-ddcot554 comparetotal 1E-1 1 -> -1
-ddcot555 comparetotal 1E-0 1 -> 0
-ddcot556 comparetotal 1E+1 1 -> 1
-ddcot557 comparetotal 1E+2 1 -> 1
-ddcot558 comparetotal 1E+3 1 -> 1
-ddcot559 comparetotal 1E+4 1 -> 1
-ddcot561 comparetotal 1E+5 1 -> 1
-ddcot562 comparetotal 1E+6 1 -> 1
-ddcot563 comparetotal 1E+7 1 -> 1
-ddcot564 comparetotal 1E+8 1 -> 1
-ddcot565 comparetotal 1E+9 1 -> 1
-ddcot566 comparetotal 1E+10 1 -> 1
-ddcot567 comparetotal 1E+11 1 -> 1
-ddcot568 comparetotal 1E+12 1 -> 1
-ddcot569 comparetotal 1E+13 1 -> 1
-ddcot570 comparetotal 1E+14 1 -> 1
-ddcot571 comparetotal 1E+15 1 -> 1
-ddcot572 comparetotal 1E+16 1 -> 1
-ddcot573 comparetotal 1E+17 1 -> 1
--- similar with a useful coefficient, one side only
-ddcot578 comparetotal 0.000000987654321 1E-17 -> 1
-ddcot579 comparetotal 0.000000987654321 1E-16 -> 1
-ddcot580 comparetotal 0.000000987654321 1E-15 -> 1
-ddcot581 comparetotal 0.000000987654321 1E-14 -> 1
-ddcot582 comparetotal 0.000000987654321 1E-13 -> 1
-ddcot583 comparetotal 0.000000987654321 1E-12 -> 1
-ddcot584 comparetotal 0.000000987654321 1E-11 -> 1
-ddcot585 comparetotal 0.000000987654321 1E-10 -> 1
-ddcot586 comparetotal 0.000000987654321 1E-9 -> 1
-ddcot587 comparetotal 0.000000987654321 1E-8 -> 1
-ddcot588 comparetotal 0.000000987654321 1E-7 -> 1
-ddcot589 comparetotal 0.000000987654321 1E-6 -> -1
-ddcot590 comparetotal 0.000000987654321 1E-5 -> -1
-ddcot591 comparetotal 0.000000987654321 1E-4 -> -1
-ddcot592 comparetotal 0.000000987654321 1E-3 -> -1
-ddcot593 comparetotal 0.000000987654321 1E-2 -> -1
-ddcot594 comparetotal 0.000000987654321 1E-1 -> -1
-ddcot595 comparetotal 0.000000987654321 1E-0 -> -1
-ddcot596 comparetotal 0.000000987654321 1E+1 -> -1
-ddcot597 comparetotal 0.000000987654321 1E+2 -> -1
-ddcot598 comparetotal 0.000000987654321 1E+3 -> -1
-ddcot599 comparetotal 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-ddcot600 comparetotal 12 12.2345 -> -1
-ddcot601 comparetotal 12.0 12.2345 -> -1
-ddcot602 comparetotal 12.00 12.2345 -> -1
-ddcot603 comparetotal 12.000 12.2345 -> -1
-ddcot604 comparetotal 12.0000 12.2345 -> -1
-ddcot605 comparetotal 12.00000 12.2345 -> -1
-ddcot606 comparetotal 12.000000 12.2345 -> -1
-ddcot607 comparetotal 12.0000000 12.2345 -> -1
-ddcot608 comparetotal 12.00000000 12.2345 -> -1
-ddcot609 comparetotal 12.000000000 12.2345 -> -1
-ddcot610 comparetotal 12.1234 12 -> 1
-ddcot611 comparetotal 12.1234 12.0 -> 1
-ddcot612 comparetotal 12.1234 12.00 -> 1
-ddcot613 comparetotal 12.1234 12.000 -> 1
-ddcot614 comparetotal 12.1234 12.0000 -> 1
-ddcot615 comparetotal 12.1234 12.00000 -> 1
-ddcot616 comparetotal 12.1234 12.000000 -> 1
-ddcot617 comparetotal 12.1234 12.0000000 -> 1
-ddcot618 comparetotal 12.1234 12.00000000 -> 1
-ddcot619 comparetotal 12.1234 12.000000000 -> 1
-ddcot620 comparetotal -12 -12.2345 -> 1
-ddcot621 comparetotal -12.0 -12.2345 -> 1
-ddcot622 comparetotal -12.00 -12.2345 -> 1
-ddcot623 comparetotal -12.000 -12.2345 -> 1
-ddcot624 comparetotal -12.0000 -12.2345 -> 1
-ddcot625 comparetotal -12.00000 -12.2345 -> 1
-ddcot626 comparetotal -12.000000 -12.2345 -> 1
-ddcot627 comparetotal -12.0000000 -12.2345 -> 1
-ddcot628 comparetotal -12.00000000 -12.2345 -> 1
-ddcot629 comparetotal -12.000000000 -12.2345 -> 1
-ddcot630 comparetotal -12.1234 -12 -> -1
-ddcot631 comparetotal -12.1234 -12.0 -> -1
-ddcot632 comparetotal -12.1234 -12.00 -> -1
-ddcot633 comparetotal -12.1234 -12.000 -> -1
-ddcot634 comparetotal -12.1234 -12.0000 -> -1
-ddcot635 comparetotal -12.1234 -12.00000 -> -1
-ddcot636 comparetotal -12.1234 -12.000000 -> -1
-ddcot637 comparetotal -12.1234 -12.0000000 -> -1
-ddcot638 comparetotal -12.1234 -12.00000000 -> -1
-ddcot639 comparetotal -12.1234 -12.000000000 -> -1
-
--- extended zeros
-ddcot640 comparetotal 0 0 -> 0
-ddcot641 comparetotal 0 -0 -> 1
-ddcot642 comparetotal 0 -0.0 -> 1
-ddcot643 comparetotal 0 0.0 -> 1
-ddcot644 comparetotal -0 0 -> -1
-ddcot645 comparetotal -0 -0 -> 0
-ddcot646 comparetotal -0 -0.0 -> -1
-ddcot647 comparetotal -0 0.0 -> -1
-ddcot648 comparetotal 0.0 0 -> -1
-ddcot649 comparetotal 0.0 -0 -> 1
-ddcot650 comparetotal 0.0 -0.0 -> 1
-ddcot651 comparetotal 0.0 0.0 -> 0
-ddcot652 comparetotal -0.0 0 -> -1
-ddcot653 comparetotal -0.0 -0 -> 1
-ddcot654 comparetotal -0.0 -0.0 -> 0
-ddcot655 comparetotal -0.0 0.0 -> -1
-
-ddcot656 comparetotal -0E1 0.0 -> -1
-ddcot657 comparetotal -0E2 0.0 -> -1
-ddcot658 comparetotal 0E1 0.0 -> 1
-ddcot659 comparetotal 0E2 0.0 -> 1
-ddcot660 comparetotal -0E1 0 -> -1
-ddcot661 comparetotal -0E2 0 -> -1
-ddcot662 comparetotal 0E1 0 -> 1
-ddcot663 comparetotal 0E2 0 -> 1
-ddcot664 comparetotal -0E1 -0E1 -> 0
-ddcot665 comparetotal -0E2 -0E1 -> -1
-ddcot666 comparetotal 0E1 -0E1 -> 1
-ddcot667 comparetotal 0E2 -0E1 -> 1
-ddcot668 comparetotal -0E1 -0E2 -> 1
-ddcot669 comparetotal -0E2 -0E2 -> 0
-ddcot670 comparetotal 0E1 -0E2 -> 1
-ddcot671 comparetotal 0E2 -0E2 -> 1
-ddcot672 comparetotal -0E1 0E1 -> -1
-ddcot673 comparetotal -0E2 0E1 -> -1
-ddcot674 comparetotal 0E1 0E1 -> 0
-ddcot675 comparetotal 0E2 0E1 -> 1
-ddcot676 comparetotal -0E1 0E2 -> -1
-ddcot677 comparetotal -0E2 0E2 -> -1
-ddcot678 comparetotal 0E1 0E2 -> -1
-ddcot679 comparetotal 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-ddcot680 comparetotal 12 12 -> 0
-ddcot681 comparetotal 12 12.0 -> 1
-ddcot682 comparetotal 12 12.00 -> 1
-ddcot683 comparetotal 12 12.000 -> 1
-ddcot684 comparetotal 12 12.0000 -> 1
-ddcot685 comparetotal 12 12.00000 -> 1
-ddcot686 comparetotal 12 12.000000 -> 1
-ddcot687 comparetotal 12 12.0000000 -> 1
-ddcot688 comparetotal 12 12.00000000 -> 1
-ddcot689 comparetotal 12 12.000000000 -> 1
-ddcot690 comparetotal 12 12 -> 0
-ddcot691 comparetotal 12.0 12 -> -1
-ddcot692 comparetotal 12.00 12 -> -1
-ddcot693 comparetotal 12.000 12 -> -1
-ddcot694 comparetotal 12.0000 12 -> -1
-ddcot695 comparetotal 12.00000 12 -> -1
-ddcot696 comparetotal 12.000000 12 -> -1
-ddcot697 comparetotal 12.0000000 12 -> -1
-ddcot698 comparetotal 12.00000000 12 -> -1
-ddcot699 comparetotal 12.000000000 12 -> -1
-
--- old long operand checks
-ddcot701 comparetotal 12345678000 1 -> 1
-ddcot702 comparetotal 1 12345678000 -> -1
-ddcot703 comparetotal 1234567800 1 -> 1
-ddcot704 comparetotal 1 1234567800 -> -1
-ddcot705 comparetotal 1234567890 1 -> 1
-ddcot706 comparetotal 1 1234567890 -> -1
-ddcot707 comparetotal 1234567891 1 -> 1
-ddcot708 comparetotal 1 1234567891 -> -1
-ddcot709 comparetotal 12345678901 1 -> 1
-ddcot710 comparetotal 1 12345678901 -> -1
-ddcot711 comparetotal 1234567896 1 -> 1
-ddcot712 comparetotal 1 1234567896 -> -1
-ddcot713 comparetotal -1234567891 1 -> -1
-ddcot714 comparetotal 1 -1234567891 -> 1
-ddcot715 comparetotal -12345678901 1 -> -1
-ddcot716 comparetotal 1 -12345678901 -> 1
-ddcot717 comparetotal -1234567896 1 -> -1
-ddcot718 comparetotal 1 -1234567896 -> 1
-
--- old residue cases
-ddcot740 comparetotal 1 0.9999999 -> 1
-ddcot741 comparetotal 1 0.999999 -> 1
-ddcot742 comparetotal 1 0.99999 -> 1
-ddcot743 comparetotal 1 1.0000 -> 1
-ddcot744 comparetotal 1 1.00001 -> -1
-ddcot745 comparetotal 1 1.000001 -> -1
-ddcot746 comparetotal 1 1.0000001 -> -1
-ddcot750 comparetotal 0.9999999 1 -> -1
-ddcot751 comparetotal 0.999999 1 -> -1
-ddcot752 comparetotal 0.99999 1 -> -1
-ddcot753 comparetotal 1.0000 1 -> -1
-ddcot754 comparetotal 1.00001 1 -> 1
-ddcot755 comparetotal 1.000001 1 -> 1
-ddcot756 comparetotal 1.0000001 1 -> 1
-
--- Specials
-ddcot780 comparetotal Inf -Inf -> 1
-ddcot781 comparetotal Inf -1000 -> 1
-ddcot782 comparetotal Inf -1 -> 1
-ddcot783 comparetotal Inf -0 -> 1
-ddcot784 comparetotal Inf 0 -> 1
-ddcot785 comparetotal Inf 1 -> 1
-ddcot786 comparetotal Inf 1000 -> 1
-ddcot787 comparetotal Inf Inf -> 0
-ddcot788 comparetotal -1000 Inf -> -1
-ddcot789 comparetotal -Inf Inf -> -1
-ddcot790 comparetotal -1 Inf -> -1
-ddcot791 comparetotal -0 Inf -> -1
-ddcot792 comparetotal 0 Inf -> -1
-ddcot793 comparetotal 1 Inf -> -1
-ddcot794 comparetotal 1000 Inf -> -1
-ddcot795 comparetotal Inf Inf -> 0
-
-ddcot800 comparetotal -Inf -Inf -> 0
-ddcot801 comparetotal -Inf -1000 -> -1
-ddcot802 comparetotal -Inf -1 -> -1
-ddcot803 comparetotal -Inf -0 -> -1
-ddcot804 comparetotal -Inf 0 -> -1
-ddcot805 comparetotal -Inf 1 -> -1
-ddcot806 comparetotal -Inf 1000 -> -1
-ddcot807 comparetotal -Inf Inf -> -1
-ddcot808 comparetotal -Inf -Inf -> 0
-ddcot809 comparetotal -1000 -Inf -> 1
-ddcot810 comparetotal -1 -Inf -> 1
-ddcot811 comparetotal -0 -Inf -> 1
-ddcot812 comparetotal 0 -Inf -> 1
-ddcot813 comparetotal 1 -Inf -> 1
-ddcot814 comparetotal 1000 -Inf -> 1
-ddcot815 comparetotal Inf -Inf -> 1
-
-ddcot821 comparetotal NaN -Inf -> 1
-ddcot822 comparetotal NaN -1000 -> 1
-ddcot823 comparetotal NaN -1 -> 1
-ddcot824 comparetotal NaN -0 -> 1
-ddcot825 comparetotal NaN 0 -> 1
-ddcot826 comparetotal NaN 1 -> 1
-ddcot827 comparetotal NaN 1000 -> 1
-ddcot828 comparetotal NaN Inf -> 1
-ddcot829 comparetotal NaN NaN -> 0
-ddcot830 comparetotal -Inf NaN -> -1
-ddcot831 comparetotal -1000 NaN -> -1
-ddcot832 comparetotal -1 NaN -> -1
-ddcot833 comparetotal -0 NaN -> -1
-ddcot834 comparetotal 0 NaN -> -1
-ddcot835 comparetotal 1 NaN -> -1
-ddcot836 comparetotal 1000 NaN -> -1
-ddcot837 comparetotal Inf NaN -> -1
-ddcot838 comparetotal -NaN -NaN -> 0
-ddcot839 comparetotal +NaN -NaN -> 1
-ddcot840 comparetotal -NaN +NaN -> -1
-
-ddcot841 comparetotal sNaN -sNaN -> 1
-ddcot842 comparetotal sNaN -NaN -> 1
-ddcot843 comparetotal sNaN -Inf -> 1
-ddcot844 comparetotal sNaN -1000 -> 1
-ddcot845 comparetotal sNaN -1 -> 1
-ddcot846 comparetotal sNaN -0 -> 1
-ddcot847 comparetotal sNaN 0 -> 1
-ddcot848 comparetotal sNaN 1 -> 1
-ddcot849 comparetotal sNaN 1000 -> 1
-ddcot850 comparetotal sNaN NaN -> -1
-ddcot851 comparetotal sNaN sNaN -> 0
-
-ddcot852 comparetotal -sNaN sNaN -> -1
-ddcot853 comparetotal -NaN sNaN -> -1
-ddcot854 comparetotal -Inf sNaN -> -1
-ddcot855 comparetotal -1000 sNaN -> -1
-ddcot856 comparetotal -1 sNaN -> -1
-ddcot857 comparetotal -0 sNaN -> -1
-ddcot858 comparetotal 0 sNaN -> -1
-ddcot859 comparetotal 1 sNaN -> -1
-ddcot860 comparetotal 1000 sNaN -> -1
-ddcot861 comparetotal Inf sNaN -> -1
-ddcot862 comparetotal NaN sNaN -> 1
-ddcot863 comparetotal sNaN sNaN -> 0
-
-ddcot871 comparetotal -sNaN -sNaN -> 0
-ddcot872 comparetotal -sNaN -NaN -> 1
-ddcot873 comparetotal -sNaN -Inf -> -1
-ddcot874 comparetotal -sNaN -1000 -> -1
-ddcot875 comparetotal -sNaN -1 -> -1
-ddcot876 comparetotal -sNaN -0 -> -1
-ddcot877 comparetotal -sNaN 0 -> -1
-ddcot878 comparetotal -sNaN 1 -> -1
-ddcot879 comparetotal -sNaN 1000 -> -1
-ddcot880 comparetotal -sNaN NaN -> -1
-ddcot881 comparetotal -sNaN sNaN -> -1
-
-ddcot882 comparetotal -sNaN -sNaN -> 0
-ddcot883 comparetotal -NaN -sNaN -> -1
-ddcot884 comparetotal -Inf -sNaN -> 1
-ddcot885 comparetotal -1000 -sNaN -> 1
-ddcot886 comparetotal -1 -sNaN -> 1
-ddcot887 comparetotal -0 -sNaN -> 1
-ddcot888 comparetotal 0 -sNaN -> 1
-ddcot889 comparetotal 1 -sNaN -> 1
-ddcot890 comparetotal 1000 -sNaN -> 1
-ddcot891 comparetotal Inf -sNaN -> 1
-ddcot892 comparetotal NaN -sNaN -> 1
-ddcot893 comparetotal sNaN -sNaN -> 1
-
--- NaNs with payload
-ddcot960 comparetotal NaN9 -Inf -> 1
-ddcot961 comparetotal NaN8 999 -> 1
-ddcot962 comparetotal NaN77 Inf -> 1
-ddcot963 comparetotal -NaN67 NaN5 -> -1
-ddcot964 comparetotal -Inf -NaN4 -> 1
-ddcot965 comparetotal -999 -NaN33 -> 1
-ddcot966 comparetotal Inf NaN2 -> -1
-
-ddcot970 comparetotal -NaN41 -NaN42 -> 1
-ddcot971 comparetotal +NaN41 -NaN42 -> 1
-ddcot972 comparetotal -NaN41 +NaN42 -> -1
-ddcot973 comparetotal +NaN41 +NaN42 -> -1
-ddcot974 comparetotal -NaN42 -NaN01 -> -1
-ddcot975 comparetotal +NaN42 -NaN01 -> 1
-ddcot976 comparetotal -NaN42 +NaN01 -> -1
-ddcot977 comparetotal +NaN42 +NaN01 -> 1
-
-ddcot980 comparetotal -sNaN771 -sNaN772 -> 1
-ddcot981 comparetotal +sNaN771 -sNaN772 -> 1
-ddcot982 comparetotal -sNaN771 +sNaN772 -> -1
-ddcot983 comparetotal +sNaN771 +sNaN772 -> -1
-ddcot984 comparetotal -sNaN772 -sNaN771 -> -1
-ddcot985 comparetotal +sNaN772 -sNaN771 -> 1
-ddcot986 comparetotal -sNaN772 +sNaN771 -> -1
-ddcot987 comparetotal +sNaN772 +sNaN771 -> 1
-
-ddcot991 comparetotal -sNaN99 -Inf -> -1
-ddcot992 comparetotal sNaN98 -11 -> 1
-ddcot993 comparetotal sNaN97 NaN -> -1
-ddcot994 comparetotal sNaN16 sNaN94 -> -1
-ddcot995 comparetotal NaN85 sNaN83 -> 1
-ddcot996 comparetotal -Inf sNaN92 -> -1
-ddcot997 comparetotal 088 sNaN81 -> -1
-ddcot998 comparetotal Inf sNaN90 -> -1
-ddcot999 comparetotal NaN -sNaN89 -> 1
-
--- spread zeros
-ddcot1110 comparetotal 0E-383 0 -> -1
-ddcot1111 comparetotal 0E-383 -0 -> 1
-ddcot1112 comparetotal -0E-383 0 -> -1
-ddcot1113 comparetotal -0E-383 -0 -> 1
-ddcot1114 comparetotal 0E-383 0E+384 -> -1
-ddcot1115 comparetotal 0E-383 -0E+384 -> 1
-ddcot1116 comparetotal -0E-383 0E+384 -> -1
-ddcot1117 comparetotal -0E-383 -0E+384 -> 1
-ddcot1118 comparetotal 0 0E+384 -> -1
-ddcot1119 comparetotal 0 -0E+384 -> 1
-ddcot1120 comparetotal -0 0E+384 -> -1
-ddcot1121 comparetotal -0 -0E+384 -> 1
-
-ddcot1130 comparetotal 0E+384 0 -> 1
-ddcot1131 comparetotal 0E+384 -0 -> 1
-ddcot1132 comparetotal -0E+384 0 -> -1
-ddcot1133 comparetotal -0E+384 -0 -> -1
-ddcot1134 comparetotal 0E+384 0E-383 -> 1
-ddcot1135 comparetotal 0E+384 -0E-383 -> 1
-ddcot1136 comparetotal -0E+384 0E-383 -> -1
-ddcot1137 comparetotal -0E+384 -0E-383 -> -1
-ddcot1138 comparetotal 0 0E-383 -> 1
-ddcot1139 comparetotal 0 -0E-383 -> 1
-ddcot1140 comparetotal -0 0E-383 -> -1
-ddcot1141 comparetotal -0 -0E-383 -> -1
-
--- Null tests
-ddcot9990 comparetotal 10 # -> NaN Invalid_operation
-ddcot9991 comparetotal # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddCompareTotal.decTest -- decDouble comparison using total ordering--
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddcot001 comparetotal -2 -2 -> 0
+ddcot002 comparetotal -2 -1 -> -1
+ddcot003 comparetotal -2 0 -> -1
+ddcot004 comparetotal -2 1 -> -1
+ddcot005 comparetotal -2 2 -> -1
+ddcot006 comparetotal -1 -2 -> 1
+ddcot007 comparetotal -1 -1 -> 0
+ddcot008 comparetotal -1 0 -> -1
+ddcot009 comparetotal -1 1 -> -1
+ddcot010 comparetotal -1 2 -> -1
+ddcot011 comparetotal 0 -2 -> 1
+ddcot012 comparetotal 0 -1 -> 1
+ddcot013 comparetotal 0 0 -> 0
+ddcot014 comparetotal 0 1 -> -1
+ddcot015 comparetotal 0 2 -> -1
+ddcot016 comparetotal 1 -2 -> 1
+ddcot017 comparetotal 1 -1 -> 1
+ddcot018 comparetotal 1 0 -> 1
+ddcot019 comparetotal 1 1 -> 0
+ddcot020 comparetotal 1 2 -> -1
+ddcot021 comparetotal 2 -2 -> 1
+ddcot022 comparetotal 2 -1 -> 1
+ddcot023 comparetotal 2 0 -> 1
+ddcot025 comparetotal 2 1 -> 1
+ddcot026 comparetotal 2 2 -> 0
+
+ddcot031 comparetotal -20 -20 -> 0
+ddcot032 comparetotal -20 -10 -> -1
+ddcot033 comparetotal -20 00 -> -1
+ddcot034 comparetotal -20 10 -> -1
+ddcot035 comparetotal -20 20 -> -1
+ddcot036 comparetotal -10 -20 -> 1
+ddcot037 comparetotal -10 -10 -> 0
+ddcot038 comparetotal -10 00 -> -1
+ddcot039 comparetotal -10 10 -> -1
+ddcot040 comparetotal -10 20 -> -1
+ddcot041 comparetotal 00 -20 -> 1
+ddcot042 comparetotal 00 -10 -> 1
+ddcot043 comparetotal 00 00 -> 0
+ddcot044 comparetotal 00 10 -> -1
+ddcot045 comparetotal 00 20 -> -1
+ddcot046 comparetotal 10 -20 -> 1
+ddcot047 comparetotal 10 -10 -> 1
+ddcot048 comparetotal 10 00 -> 1
+ddcot049 comparetotal 10 10 -> 0
+ddcot050 comparetotal 10 20 -> -1
+ddcot051 comparetotal 20 -20 -> 1
+ddcot052 comparetotal 20 -10 -> 1
+ddcot053 comparetotal 20 00 -> 1
+ddcot055 comparetotal 20 10 -> 1
+ddcot056 comparetotal 20 20 -> 0
+
+ddcot061 comparetotal -2.0 -2.0 -> 0
+ddcot062 comparetotal -2.0 -1.0 -> -1
+ddcot063 comparetotal -2.0 0.0 -> -1
+ddcot064 comparetotal -2.0 1.0 -> -1
+ddcot065 comparetotal -2.0 2.0 -> -1
+ddcot066 comparetotal -1.0 -2.0 -> 1
+ddcot067 comparetotal -1.0 -1.0 -> 0
+ddcot068 comparetotal -1.0 0.0 -> -1
+ddcot069 comparetotal -1.0 1.0 -> -1
+ddcot070 comparetotal -1.0 2.0 -> -1
+ddcot071 comparetotal 0.0 -2.0 -> 1
+ddcot072 comparetotal 0.0 -1.0 -> 1
+ddcot073 comparetotal 0.0 0.0 -> 0
+ddcot074 comparetotal 0.0 1.0 -> -1
+ddcot075 comparetotal 0.0 2.0 -> -1
+ddcot076 comparetotal 1.0 -2.0 -> 1
+ddcot077 comparetotal 1.0 -1.0 -> 1
+ddcot078 comparetotal 1.0 0.0 -> 1
+ddcot079 comparetotal 1.0 1.0 -> 0
+ddcot080 comparetotal 1.0 2.0 -> -1
+ddcot081 comparetotal 2.0 -2.0 -> 1
+ddcot082 comparetotal 2.0 -1.0 -> 1
+ddcot083 comparetotal 2.0 0.0 -> 1
+ddcot085 comparetotal 2.0 1.0 -> 1
+ddcot086 comparetotal 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+ddcot090 comparetotal 9.99999999E+384 9.99999999E+384 -> 0
+ddcot091 comparetotal -9.99999999E+384 9.99999999E+384 -> -1
+ddcot092 comparetotal 9.99999999E+384 -9.99999999E+384 -> 1
+ddcot093 comparetotal -9.99999999E+384 -9.99999999E+384 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+ddcot100 comparetotal 7.0 7.0 -> 0
+ddcot101 comparetotal 7.0 7 -> -1
+ddcot102 comparetotal 7 7.0 -> 1
+ddcot103 comparetotal 7E+0 7.0 -> 1
+ddcot104 comparetotal 70E-1 7.0 -> 0
+ddcot105 comparetotal 0.7E+1 7 -> 0
+ddcot106 comparetotal 70E-1 7 -> -1
+ddcot107 comparetotal 7.0 7E+0 -> -1
+ddcot108 comparetotal 7.0 70E-1 -> 0
+ddcot109 comparetotal 7 0.7E+1 -> 0
+ddcot110 comparetotal 7 70E-1 -> 1
+
+ddcot120 comparetotal 8.0 7.0 -> 1
+ddcot121 comparetotal 8.0 7 -> 1
+ddcot122 comparetotal 8 7.0 -> 1
+ddcot123 comparetotal 8E+0 7.0 -> 1
+ddcot124 comparetotal 80E-1 7.0 -> 1
+ddcot125 comparetotal 0.8E+1 7 -> 1
+ddcot126 comparetotal 80E-1 7 -> 1
+ddcot127 comparetotal 8.0 7E+0 -> 1
+ddcot128 comparetotal 8.0 70E-1 -> 1
+ddcot129 comparetotal 8 0.7E+1 -> 1
+ddcot130 comparetotal 8 70E-1 -> 1
+
+ddcot140 comparetotal 8.0 9.0 -> -1
+ddcot141 comparetotal 8.0 9 -> -1
+ddcot142 comparetotal 8 9.0 -> -1
+ddcot143 comparetotal 8E+0 9.0 -> -1
+ddcot144 comparetotal 80E-1 9.0 -> -1
+ddcot145 comparetotal 0.8E+1 9 -> -1
+ddcot146 comparetotal 80E-1 9 -> -1
+ddcot147 comparetotal 8.0 9E+0 -> -1
+ddcot148 comparetotal 8.0 90E-1 -> -1
+ddcot149 comparetotal 8 0.9E+1 -> -1
+ddcot150 comparetotal 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ddcot200 comparetotal -7.0 7.0 -> -1
+ddcot201 comparetotal -7.0 7 -> -1
+ddcot202 comparetotal -7 7.0 -> -1
+ddcot203 comparetotal -7E+0 7.0 -> -1
+ddcot204 comparetotal -70E-1 7.0 -> -1
+ddcot205 comparetotal -0.7E+1 7 -> -1
+ddcot206 comparetotal -70E-1 7 -> -1
+ddcot207 comparetotal -7.0 7E+0 -> -1
+ddcot208 comparetotal -7.0 70E-1 -> -1
+ddcot209 comparetotal -7 0.7E+1 -> -1
+ddcot210 comparetotal -7 70E-1 -> -1
+
+ddcot220 comparetotal -8.0 7.0 -> -1
+ddcot221 comparetotal -8.0 7 -> -1
+ddcot222 comparetotal -8 7.0 -> -1
+ddcot223 comparetotal -8E+0 7.0 -> -1
+ddcot224 comparetotal -80E-1 7.0 -> -1
+ddcot225 comparetotal -0.8E+1 7 -> -1
+ddcot226 comparetotal -80E-1 7 -> -1
+ddcot227 comparetotal -8.0 7E+0 -> -1
+ddcot228 comparetotal -8.0 70E-1 -> -1
+ddcot229 comparetotal -8 0.7E+1 -> -1
+ddcot230 comparetotal -8 70E-1 -> -1
+
+ddcot240 comparetotal -8.0 9.0 -> -1
+ddcot241 comparetotal -8.0 9 -> -1
+ddcot242 comparetotal -8 9.0 -> -1
+ddcot243 comparetotal -8E+0 9.0 -> -1
+ddcot244 comparetotal -80E-1 9.0 -> -1
+ddcot245 comparetotal -0.8E+1 9 -> -1
+ddcot246 comparetotal -80E-1 9 -> -1
+ddcot247 comparetotal -8.0 9E+0 -> -1
+ddcot248 comparetotal -8.0 90E-1 -> -1
+ddcot249 comparetotal -8 0.9E+1 -> -1
+ddcot250 comparetotal -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ddcot300 comparetotal 7.0 -7.0 -> 1
+ddcot301 comparetotal 7.0 -7 -> 1
+ddcot302 comparetotal 7 -7.0 -> 1
+ddcot303 comparetotal 7E+0 -7.0 -> 1
+ddcot304 comparetotal 70E-1 -7.0 -> 1
+ddcot305 comparetotal .7E+1 -7 -> 1
+ddcot306 comparetotal 70E-1 -7 -> 1
+ddcot307 comparetotal 7.0 -7E+0 -> 1
+ddcot308 comparetotal 7.0 -70E-1 -> 1
+ddcot309 comparetotal 7 -.7E+1 -> 1
+ddcot310 comparetotal 7 -70E-1 -> 1
+
+ddcot320 comparetotal 8.0 -7.0 -> 1
+ddcot321 comparetotal 8.0 -7 -> 1
+ddcot322 comparetotal 8 -7.0 -> 1
+ddcot323 comparetotal 8E+0 -7.0 -> 1
+ddcot324 comparetotal 80E-1 -7.0 -> 1
+ddcot325 comparetotal .8E+1 -7 -> 1
+ddcot326 comparetotal 80E-1 -7 -> 1
+ddcot327 comparetotal 8.0 -7E+0 -> 1
+ddcot328 comparetotal 8.0 -70E-1 -> 1
+ddcot329 comparetotal 8 -.7E+1 -> 1
+ddcot330 comparetotal 8 -70E-1 -> 1
+
+ddcot340 comparetotal 8.0 -9.0 -> 1
+ddcot341 comparetotal 8.0 -9 -> 1
+ddcot342 comparetotal 8 -9.0 -> 1
+ddcot343 comparetotal 8E+0 -9.0 -> 1
+ddcot344 comparetotal 80E-1 -9.0 -> 1
+ddcot345 comparetotal .8E+1 -9 -> 1
+ddcot346 comparetotal 80E-1 -9 -> 1
+ddcot347 comparetotal 8.0 -9E+0 -> 1
+ddcot348 comparetotal 8.0 -90E-1 -> 1
+ddcot349 comparetotal 8 -.9E+1 -> 1
+ddcot350 comparetotal 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+ddcot400 comparetotal -7.0 -7.0 -> 0
+ddcot401 comparetotal -7.0 -7 -> 1
+ddcot402 comparetotal -7 -7.0 -> -1
+ddcot403 comparetotal -7E+0 -7.0 -> -1
+ddcot404 comparetotal -70E-1 -7.0 -> 0
+ddcot405 comparetotal -.7E+1 -7 -> 0
+ddcot406 comparetotal -70E-1 -7 -> 1
+ddcot407 comparetotal -7.0 -7E+0 -> 1
+ddcot408 comparetotal -7.0 -70E-1 -> 0
+ddcot409 comparetotal -7 -.7E+1 -> 0
+ddcot410 comparetotal -7 -70E-1 -> -1
+
+ddcot420 comparetotal -8.0 -7.0 -> -1
+ddcot421 comparetotal -8.0 -7 -> -1
+ddcot422 comparetotal -8 -7.0 -> -1
+ddcot423 comparetotal -8E+0 -7.0 -> -1
+ddcot424 comparetotal -80E-1 -7.0 -> -1
+ddcot425 comparetotal -.8E+1 -7 -> -1
+ddcot426 comparetotal -80E-1 -7 -> -1
+ddcot427 comparetotal -8.0 -7E+0 -> -1
+ddcot428 comparetotal -8.0 -70E-1 -> -1
+ddcot429 comparetotal -8 -.7E+1 -> -1
+ddcot430 comparetotal -8 -70E-1 -> -1
+
+ddcot440 comparetotal -8.0 -9.0 -> 1
+ddcot441 comparetotal -8.0 -9 -> 1
+ddcot442 comparetotal -8 -9.0 -> 1
+ddcot443 comparetotal -8E+0 -9.0 -> 1
+ddcot444 comparetotal -80E-1 -9.0 -> 1
+ddcot445 comparetotal -.8E+1 -9 -> 1
+ddcot446 comparetotal -80E-1 -9 -> 1
+ddcot447 comparetotal -8.0 -9E+0 -> 1
+ddcot448 comparetotal -8.0 -90E-1 -> 1
+ddcot449 comparetotal -8 -.9E+1 -> 1
+ddcot450 comparetotal -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+ddcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
+ddcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1
+ddcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
+ddcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1
+ddcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
+ddcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1
+ddcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
+ddcot480 comparetotal 123.456000E+89 123.456E+89 -> -1
+ddcot481 comparetotal 123.45600E-89 123.456E-89 -> -1
+ddcot482 comparetotal 123.4560E+89 123.456E+89 -> -1
+ddcot483 comparetotal 123.456E-89 123.456E-89 -> 0
+ddcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1
+ddcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
+ddcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1
+ddcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
+ddcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1
+ddcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
+ddcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1
+ddcot494 comparetotal 123.456E-89 123.456000E-89 -> 1
+ddcot495 comparetotal 123.456E+89 123.45600E+89 -> 1
+ddcot496 comparetotal 123.456E-89 123.4560E-89 -> 1
+ddcot497 comparetotal 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+ddcot498 comparetotal 1 1E-17 -> 1
+ddcot499 comparetotal 1 1E-16 -> 1
+ddcot500 comparetotal 1 1E-15 -> 1
+ddcot501 comparetotal 1 1E-14 -> 1
+ddcot502 comparetotal 1 1E-13 -> 1
+ddcot503 comparetotal 1 1E-12 -> 1
+ddcot504 comparetotal 1 1E-11 -> 1
+ddcot505 comparetotal 1 1E-10 -> 1
+ddcot506 comparetotal 1 1E-9 -> 1
+ddcot507 comparetotal 1 1E-8 -> 1
+ddcot508 comparetotal 1 1E-7 -> 1
+ddcot509 comparetotal 1 1E-6 -> 1
+ddcot510 comparetotal 1 1E-5 -> 1
+ddcot511 comparetotal 1 1E-4 -> 1
+ddcot512 comparetotal 1 1E-3 -> 1
+ddcot513 comparetotal 1 1E-2 -> 1
+ddcot514 comparetotal 1 1E-1 -> 1
+ddcot515 comparetotal 1 1E-0 -> 0
+ddcot516 comparetotal 1 1E+1 -> -1
+ddcot517 comparetotal 1 1E+2 -> -1
+ddcot518 comparetotal 1 1E+3 -> -1
+ddcot519 comparetotal 1 1E+4 -> -1
+ddcot521 comparetotal 1 1E+5 -> -1
+ddcot522 comparetotal 1 1E+6 -> -1
+ddcot523 comparetotal 1 1E+7 -> -1
+ddcot524 comparetotal 1 1E+8 -> -1
+ddcot525 comparetotal 1 1E+9 -> -1
+ddcot526 comparetotal 1 1E+10 -> -1
+ddcot527 comparetotal 1 1E+11 -> -1
+ddcot528 comparetotal 1 1E+12 -> -1
+ddcot529 comparetotal 1 1E+13 -> -1
+ddcot530 comparetotal 1 1E+14 -> -1
+ddcot531 comparetotal 1 1E+15 -> -1
+ddcot532 comparetotal 1 1E+16 -> -1
+ddcot533 comparetotal 1 1E+17 -> -1
+-- LR swap
+ddcot538 comparetotal 1E-17 1 -> -1
+ddcot539 comparetotal 1E-16 1 -> -1
+ddcot540 comparetotal 1E-15 1 -> -1
+ddcot541 comparetotal 1E-14 1 -> -1
+ddcot542 comparetotal 1E-13 1 -> -1
+ddcot543 comparetotal 1E-12 1 -> -1
+ddcot544 comparetotal 1E-11 1 -> -1
+ddcot545 comparetotal 1E-10 1 -> -1
+ddcot546 comparetotal 1E-9 1 -> -1
+ddcot547 comparetotal 1E-8 1 -> -1
+ddcot548 comparetotal 1E-7 1 -> -1
+ddcot549 comparetotal 1E-6 1 -> -1
+ddcot550 comparetotal 1E-5 1 -> -1
+ddcot551 comparetotal 1E-4 1 -> -1
+ddcot552 comparetotal 1E-3 1 -> -1
+ddcot553 comparetotal 1E-2 1 -> -1
+ddcot554 comparetotal 1E-1 1 -> -1
+ddcot555 comparetotal 1E-0 1 -> 0
+ddcot556 comparetotal 1E+1 1 -> 1
+ddcot557 comparetotal 1E+2 1 -> 1
+ddcot558 comparetotal 1E+3 1 -> 1
+ddcot559 comparetotal 1E+4 1 -> 1
+ddcot561 comparetotal 1E+5 1 -> 1
+ddcot562 comparetotal 1E+6 1 -> 1
+ddcot563 comparetotal 1E+7 1 -> 1
+ddcot564 comparetotal 1E+8 1 -> 1
+ddcot565 comparetotal 1E+9 1 -> 1
+ddcot566 comparetotal 1E+10 1 -> 1
+ddcot567 comparetotal 1E+11 1 -> 1
+ddcot568 comparetotal 1E+12 1 -> 1
+ddcot569 comparetotal 1E+13 1 -> 1
+ddcot570 comparetotal 1E+14 1 -> 1
+ddcot571 comparetotal 1E+15 1 -> 1
+ddcot572 comparetotal 1E+16 1 -> 1
+ddcot573 comparetotal 1E+17 1 -> 1
+-- similar with a useful coefficient, one side only
+ddcot578 comparetotal 0.000000987654321 1E-17 -> 1
+ddcot579 comparetotal 0.000000987654321 1E-16 -> 1
+ddcot580 comparetotal 0.000000987654321 1E-15 -> 1
+ddcot581 comparetotal 0.000000987654321 1E-14 -> 1
+ddcot582 comparetotal 0.000000987654321 1E-13 -> 1
+ddcot583 comparetotal 0.000000987654321 1E-12 -> 1
+ddcot584 comparetotal 0.000000987654321 1E-11 -> 1
+ddcot585 comparetotal 0.000000987654321 1E-10 -> 1
+ddcot586 comparetotal 0.000000987654321 1E-9 -> 1
+ddcot587 comparetotal 0.000000987654321 1E-8 -> 1
+ddcot588 comparetotal 0.000000987654321 1E-7 -> 1
+ddcot589 comparetotal 0.000000987654321 1E-6 -> -1
+ddcot590 comparetotal 0.000000987654321 1E-5 -> -1
+ddcot591 comparetotal 0.000000987654321 1E-4 -> -1
+ddcot592 comparetotal 0.000000987654321 1E-3 -> -1
+ddcot593 comparetotal 0.000000987654321 1E-2 -> -1
+ddcot594 comparetotal 0.000000987654321 1E-1 -> -1
+ddcot595 comparetotal 0.000000987654321 1E-0 -> -1
+ddcot596 comparetotal 0.000000987654321 1E+1 -> -1
+ddcot597 comparetotal 0.000000987654321 1E+2 -> -1
+ddcot598 comparetotal 0.000000987654321 1E+3 -> -1
+ddcot599 comparetotal 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+ddcot600 comparetotal 12 12.2345 -> -1
+ddcot601 comparetotal 12.0 12.2345 -> -1
+ddcot602 comparetotal 12.00 12.2345 -> -1
+ddcot603 comparetotal 12.000 12.2345 -> -1
+ddcot604 comparetotal 12.0000 12.2345 -> -1
+ddcot605 comparetotal 12.00000 12.2345 -> -1
+ddcot606 comparetotal 12.000000 12.2345 -> -1
+ddcot607 comparetotal 12.0000000 12.2345 -> -1
+ddcot608 comparetotal 12.00000000 12.2345 -> -1
+ddcot609 comparetotal 12.000000000 12.2345 -> -1
+ddcot610 comparetotal 12.1234 12 -> 1
+ddcot611 comparetotal 12.1234 12.0 -> 1
+ddcot612 comparetotal 12.1234 12.00 -> 1
+ddcot613 comparetotal 12.1234 12.000 -> 1
+ddcot614 comparetotal 12.1234 12.0000 -> 1
+ddcot615 comparetotal 12.1234 12.00000 -> 1
+ddcot616 comparetotal 12.1234 12.000000 -> 1
+ddcot617 comparetotal 12.1234 12.0000000 -> 1
+ddcot618 comparetotal 12.1234 12.00000000 -> 1
+ddcot619 comparetotal 12.1234 12.000000000 -> 1
+ddcot620 comparetotal -12 -12.2345 -> 1
+ddcot621 comparetotal -12.0 -12.2345 -> 1
+ddcot622 comparetotal -12.00 -12.2345 -> 1
+ddcot623 comparetotal -12.000 -12.2345 -> 1
+ddcot624 comparetotal -12.0000 -12.2345 -> 1
+ddcot625 comparetotal -12.00000 -12.2345 -> 1
+ddcot626 comparetotal -12.000000 -12.2345 -> 1
+ddcot627 comparetotal -12.0000000 -12.2345 -> 1
+ddcot628 comparetotal -12.00000000 -12.2345 -> 1
+ddcot629 comparetotal -12.000000000 -12.2345 -> 1
+ddcot630 comparetotal -12.1234 -12 -> -1
+ddcot631 comparetotal -12.1234 -12.0 -> -1
+ddcot632 comparetotal -12.1234 -12.00 -> -1
+ddcot633 comparetotal -12.1234 -12.000 -> -1
+ddcot634 comparetotal -12.1234 -12.0000 -> -1
+ddcot635 comparetotal -12.1234 -12.00000 -> -1
+ddcot636 comparetotal -12.1234 -12.000000 -> -1
+ddcot637 comparetotal -12.1234 -12.0000000 -> -1
+ddcot638 comparetotal -12.1234 -12.00000000 -> -1
+ddcot639 comparetotal -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+ddcot640 comparetotal 0 0 -> 0
+ddcot641 comparetotal 0 -0 -> 1
+ddcot642 comparetotal 0 -0.0 -> 1
+ddcot643 comparetotal 0 0.0 -> 1
+ddcot644 comparetotal -0 0 -> -1
+ddcot645 comparetotal -0 -0 -> 0
+ddcot646 comparetotal -0 -0.0 -> -1
+ddcot647 comparetotal -0 0.0 -> -1
+ddcot648 comparetotal 0.0 0 -> -1
+ddcot649 comparetotal 0.0 -0 -> 1
+ddcot650 comparetotal 0.0 -0.0 -> 1
+ddcot651 comparetotal 0.0 0.0 -> 0
+ddcot652 comparetotal -0.0 0 -> -1
+ddcot653 comparetotal -0.0 -0 -> 1
+ddcot654 comparetotal -0.0 -0.0 -> 0
+ddcot655 comparetotal -0.0 0.0 -> -1
+
+ddcot656 comparetotal -0E1 0.0 -> -1
+ddcot657 comparetotal -0E2 0.0 -> -1
+ddcot658 comparetotal 0E1 0.0 -> 1
+ddcot659 comparetotal 0E2 0.0 -> 1
+ddcot660 comparetotal -0E1 0 -> -1
+ddcot661 comparetotal -0E2 0 -> -1
+ddcot662 comparetotal 0E1 0 -> 1
+ddcot663 comparetotal 0E2 0 -> 1
+ddcot664 comparetotal -0E1 -0E1 -> 0
+ddcot665 comparetotal -0E2 -0E1 -> -1
+ddcot666 comparetotal 0E1 -0E1 -> 1
+ddcot667 comparetotal 0E2 -0E1 -> 1
+ddcot668 comparetotal -0E1 -0E2 -> 1
+ddcot669 comparetotal -0E2 -0E2 -> 0
+ddcot670 comparetotal 0E1 -0E2 -> 1
+ddcot671 comparetotal 0E2 -0E2 -> 1
+ddcot672 comparetotal -0E1 0E1 -> -1
+ddcot673 comparetotal -0E2 0E1 -> -1
+ddcot674 comparetotal 0E1 0E1 -> 0
+ddcot675 comparetotal 0E2 0E1 -> 1
+ddcot676 comparetotal -0E1 0E2 -> -1
+ddcot677 comparetotal -0E2 0E2 -> -1
+ddcot678 comparetotal 0E1 0E2 -> -1
+ddcot679 comparetotal 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+ddcot680 comparetotal 12 12 -> 0
+ddcot681 comparetotal 12 12.0 -> 1
+ddcot682 comparetotal 12 12.00 -> 1
+ddcot683 comparetotal 12 12.000 -> 1
+ddcot684 comparetotal 12 12.0000 -> 1
+ddcot685 comparetotal 12 12.00000 -> 1
+ddcot686 comparetotal 12 12.000000 -> 1
+ddcot687 comparetotal 12 12.0000000 -> 1
+ddcot688 comparetotal 12 12.00000000 -> 1
+ddcot689 comparetotal 12 12.000000000 -> 1
+ddcot690 comparetotal 12 12 -> 0
+ddcot691 comparetotal 12.0 12 -> -1
+ddcot692 comparetotal 12.00 12 -> -1
+ddcot693 comparetotal 12.000 12 -> -1
+ddcot694 comparetotal 12.0000 12 -> -1
+ddcot695 comparetotal 12.00000 12 -> -1
+ddcot696 comparetotal 12.000000 12 -> -1
+ddcot697 comparetotal 12.0000000 12 -> -1
+ddcot698 comparetotal 12.00000000 12 -> -1
+ddcot699 comparetotal 12.000000000 12 -> -1
+
+-- old long operand checks
+ddcot701 comparetotal 12345678000 1 -> 1
+ddcot702 comparetotal 1 12345678000 -> -1
+ddcot703 comparetotal 1234567800 1 -> 1
+ddcot704 comparetotal 1 1234567800 -> -1
+ddcot705 comparetotal 1234567890 1 -> 1
+ddcot706 comparetotal 1 1234567890 -> -1
+ddcot707 comparetotal 1234567891 1 -> 1
+ddcot708 comparetotal 1 1234567891 -> -1
+ddcot709 comparetotal 12345678901 1 -> 1
+ddcot710 comparetotal 1 12345678901 -> -1
+ddcot711 comparetotal 1234567896 1 -> 1
+ddcot712 comparetotal 1 1234567896 -> -1
+ddcot713 comparetotal -1234567891 1 -> -1
+ddcot714 comparetotal 1 -1234567891 -> 1
+ddcot715 comparetotal -12345678901 1 -> -1
+ddcot716 comparetotal 1 -12345678901 -> 1
+ddcot717 comparetotal -1234567896 1 -> -1
+ddcot718 comparetotal 1 -1234567896 -> 1
+
+-- old residue cases
+ddcot740 comparetotal 1 0.9999999 -> 1
+ddcot741 comparetotal 1 0.999999 -> 1
+ddcot742 comparetotal 1 0.99999 -> 1
+ddcot743 comparetotal 1 1.0000 -> 1
+ddcot744 comparetotal 1 1.00001 -> -1
+ddcot745 comparetotal 1 1.000001 -> -1
+ddcot746 comparetotal 1 1.0000001 -> -1
+ddcot750 comparetotal 0.9999999 1 -> -1
+ddcot751 comparetotal 0.999999 1 -> -1
+ddcot752 comparetotal 0.99999 1 -> -1
+ddcot753 comparetotal 1.0000 1 -> -1
+ddcot754 comparetotal 1.00001 1 -> 1
+ddcot755 comparetotal 1.000001 1 -> 1
+ddcot756 comparetotal 1.0000001 1 -> 1
+
+-- Specials
+ddcot780 comparetotal Inf -Inf -> 1
+ddcot781 comparetotal Inf -1000 -> 1
+ddcot782 comparetotal Inf -1 -> 1
+ddcot783 comparetotal Inf -0 -> 1
+ddcot784 comparetotal Inf 0 -> 1
+ddcot785 comparetotal Inf 1 -> 1
+ddcot786 comparetotal Inf 1000 -> 1
+ddcot787 comparetotal Inf Inf -> 0
+ddcot788 comparetotal -1000 Inf -> -1
+ddcot789 comparetotal -Inf Inf -> -1
+ddcot790 comparetotal -1 Inf -> -1
+ddcot791 comparetotal -0 Inf -> -1
+ddcot792 comparetotal 0 Inf -> -1
+ddcot793 comparetotal 1 Inf -> -1
+ddcot794 comparetotal 1000 Inf -> -1
+ddcot795 comparetotal Inf Inf -> 0
+
+ddcot800 comparetotal -Inf -Inf -> 0
+ddcot801 comparetotal -Inf -1000 -> -1
+ddcot802 comparetotal -Inf -1 -> -1
+ddcot803 comparetotal -Inf -0 -> -1
+ddcot804 comparetotal -Inf 0 -> -1
+ddcot805 comparetotal -Inf 1 -> -1
+ddcot806 comparetotal -Inf 1000 -> -1
+ddcot807 comparetotal -Inf Inf -> -1
+ddcot808 comparetotal -Inf -Inf -> 0
+ddcot809 comparetotal -1000 -Inf -> 1
+ddcot810 comparetotal -1 -Inf -> 1
+ddcot811 comparetotal -0 -Inf -> 1
+ddcot812 comparetotal 0 -Inf -> 1
+ddcot813 comparetotal 1 -Inf -> 1
+ddcot814 comparetotal 1000 -Inf -> 1
+ddcot815 comparetotal Inf -Inf -> 1
+
+ddcot821 comparetotal NaN -Inf -> 1
+ddcot822 comparetotal NaN -1000 -> 1
+ddcot823 comparetotal NaN -1 -> 1
+ddcot824 comparetotal NaN -0 -> 1
+ddcot825 comparetotal NaN 0 -> 1
+ddcot826 comparetotal NaN 1 -> 1
+ddcot827 comparetotal NaN 1000 -> 1
+ddcot828 comparetotal NaN Inf -> 1
+ddcot829 comparetotal NaN NaN -> 0
+ddcot830 comparetotal -Inf NaN -> -1
+ddcot831 comparetotal -1000 NaN -> -1
+ddcot832 comparetotal -1 NaN -> -1
+ddcot833 comparetotal -0 NaN -> -1
+ddcot834 comparetotal 0 NaN -> -1
+ddcot835 comparetotal 1 NaN -> -1
+ddcot836 comparetotal 1000 NaN -> -1
+ddcot837 comparetotal Inf NaN -> -1
+ddcot838 comparetotal -NaN -NaN -> 0
+ddcot839 comparetotal +NaN -NaN -> 1
+ddcot840 comparetotal -NaN +NaN -> -1
+
+ddcot841 comparetotal sNaN -sNaN -> 1
+ddcot842 comparetotal sNaN -NaN -> 1
+ddcot843 comparetotal sNaN -Inf -> 1
+ddcot844 comparetotal sNaN -1000 -> 1
+ddcot845 comparetotal sNaN -1 -> 1
+ddcot846 comparetotal sNaN -0 -> 1
+ddcot847 comparetotal sNaN 0 -> 1
+ddcot848 comparetotal sNaN 1 -> 1
+ddcot849 comparetotal sNaN 1000 -> 1
+ddcot850 comparetotal sNaN NaN -> -1
+ddcot851 comparetotal sNaN sNaN -> 0
+
+ddcot852 comparetotal -sNaN sNaN -> -1
+ddcot853 comparetotal -NaN sNaN -> -1
+ddcot854 comparetotal -Inf sNaN -> -1
+ddcot855 comparetotal -1000 sNaN -> -1
+ddcot856 comparetotal -1 sNaN -> -1
+ddcot857 comparetotal -0 sNaN -> -1
+ddcot858 comparetotal 0 sNaN -> -1
+ddcot859 comparetotal 1 sNaN -> -1
+ddcot860 comparetotal 1000 sNaN -> -1
+ddcot861 comparetotal Inf sNaN -> -1
+ddcot862 comparetotal NaN sNaN -> 1
+ddcot863 comparetotal sNaN sNaN -> 0
+
+ddcot871 comparetotal -sNaN -sNaN -> 0
+ddcot872 comparetotal -sNaN -NaN -> 1
+ddcot873 comparetotal -sNaN -Inf -> -1
+ddcot874 comparetotal -sNaN -1000 -> -1
+ddcot875 comparetotal -sNaN -1 -> -1
+ddcot876 comparetotal -sNaN -0 -> -1
+ddcot877 comparetotal -sNaN 0 -> -1
+ddcot878 comparetotal -sNaN 1 -> -1
+ddcot879 comparetotal -sNaN 1000 -> -1
+ddcot880 comparetotal -sNaN NaN -> -1
+ddcot881 comparetotal -sNaN sNaN -> -1
+
+ddcot882 comparetotal -sNaN -sNaN -> 0
+ddcot883 comparetotal -NaN -sNaN -> -1
+ddcot884 comparetotal -Inf -sNaN -> 1
+ddcot885 comparetotal -1000 -sNaN -> 1
+ddcot886 comparetotal -1 -sNaN -> 1
+ddcot887 comparetotal -0 -sNaN -> 1
+ddcot888 comparetotal 0 -sNaN -> 1
+ddcot889 comparetotal 1 -sNaN -> 1
+ddcot890 comparetotal 1000 -sNaN -> 1
+ddcot891 comparetotal Inf -sNaN -> 1
+ddcot892 comparetotal NaN -sNaN -> 1
+ddcot893 comparetotal sNaN -sNaN -> 1
+
+-- NaNs with payload
+ddcot960 comparetotal NaN9 -Inf -> 1
+ddcot961 comparetotal NaN8 999 -> 1
+ddcot962 comparetotal NaN77 Inf -> 1
+ddcot963 comparetotal -NaN67 NaN5 -> -1
+ddcot964 comparetotal -Inf -NaN4 -> 1
+ddcot965 comparetotal -999 -NaN33 -> 1
+ddcot966 comparetotal Inf NaN2 -> -1
+
+ddcot970 comparetotal -NaN41 -NaN42 -> 1
+ddcot971 comparetotal +NaN41 -NaN42 -> 1
+ddcot972 comparetotal -NaN41 +NaN42 -> -1
+ddcot973 comparetotal +NaN41 +NaN42 -> -1
+ddcot974 comparetotal -NaN42 -NaN01 -> -1
+ddcot975 comparetotal +NaN42 -NaN01 -> 1
+ddcot976 comparetotal -NaN42 +NaN01 -> -1
+ddcot977 comparetotal +NaN42 +NaN01 -> 1
+
+ddcot980 comparetotal -sNaN771 -sNaN772 -> 1
+ddcot981 comparetotal +sNaN771 -sNaN772 -> 1
+ddcot982 comparetotal -sNaN771 +sNaN772 -> -1
+ddcot983 comparetotal +sNaN771 +sNaN772 -> -1
+ddcot984 comparetotal -sNaN772 -sNaN771 -> -1
+ddcot985 comparetotal +sNaN772 -sNaN771 -> 1
+ddcot986 comparetotal -sNaN772 +sNaN771 -> -1
+ddcot987 comparetotal +sNaN772 +sNaN771 -> 1
+
+ddcot991 comparetotal -sNaN99 -Inf -> -1
+ddcot992 comparetotal sNaN98 -11 -> 1
+ddcot993 comparetotal sNaN97 NaN -> -1
+ddcot994 comparetotal sNaN16 sNaN94 -> -1
+ddcot995 comparetotal NaN85 sNaN83 -> 1
+ddcot996 comparetotal -Inf sNaN92 -> -1
+ddcot997 comparetotal 088 sNaN81 -> -1
+ddcot998 comparetotal Inf sNaN90 -> -1
+ddcot999 comparetotal NaN -sNaN89 -> 1
+
+-- spread zeros
+ddcot1110 comparetotal 0E-383 0 -> -1
+ddcot1111 comparetotal 0E-383 -0 -> 1
+ddcot1112 comparetotal -0E-383 0 -> -1
+ddcot1113 comparetotal -0E-383 -0 -> 1
+ddcot1114 comparetotal 0E-383 0E+384 -> -1
+ddcot1115 comparetotal 0E-383 -0E+384 -> 1
+ddcot1116 comparetotal -0E-383 0E+384 -> -1
+ddcot1117 comparetotal -0E-383 -0E+384 -> 1
+ddcot1118 comparetotal 0 0E+384 -> -1
+ddcot1119 comparetotal 0 -0E+384 -> 1
+ddcot1120 comparetotal -0 0E+384 -> -1
+ddcot1121 comparetotal -0 -0E+384 -> 1
+
+ddcot1130 comparetotal 0E+384 0 -> 1
+ddcot1131 comparetotal 0E+384 -0 -> 1
+ddcot1132 comparetotal -0E+384 0 -> -1
+ddcot1133 comparetotal -0E+384 -0 -> -1
+ddcot1134 comparetotal 0E+384 0E-383 -> 1
+ddcot1135 comparetotal 0E+384 -0E-383 -> 1
+ddcot1136 comparetotal -0E+384 0E-383 -> -1
+ddcot1137 comparetotal -0E+384 -0E-383 -> -1
+ddcot1138 comparetotal 0 0E-383 -> 1
+ddcot1139 comparetotal 0 -0E-383 -> 1
+ddcot1140 comparetotal -0 0E-383 -> -1
+ddcot1141 comparetotal -0 -0E-383 -> -1
+
+-- Null tests
+ddcot9990 comparetotal 10 # -> NaN Invalid_operation
+ddcot9991 comparetotal # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddCompareTotalMag.decTest b/Lib/test/decimaltestdata/ddCompareTotalMag.decTest
index 087a092f0b..f16537a35d 100644
--- a/Lib/test/decimaltestdata/ddCompareTotalMag.decTest
+++ b/Lib/test/decimaltestdata/ddCompareTotalMag.decTest
@@ -1,706 +1,706 @@
-------------------------------------------------------------------------
--- ddCompareTotalMag.decTest -- decDouble comparison; abs. total order--
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddctm001 comparetotmag -2 -2 -> 0
-ddctm002 comparetotmag -2 -1 -> 1
-ddctm003 comparetotmag -2 0 -> 1
-ddctm004 comparetotmag -2 1 -> 1
-ddctm005 comparetotmag -2 2 -> 0
-ddctm006 comparetotmag -1 -2 -> -1
-ddctm007 comparetotmag -1 -1 -> 0
-ddctm008 comparetotmag -1 0 -> 1
-ddctm009 comparetotmag -1 1 -> 0
-ddctm010 comparetotmag -1 2 -> -1
-ddctm011 comparetotmag 0 -2 -> -1
-ddctm012 comparetotmag 0 -1 -> -1
-ddctm013 comparetotmag 0 0 -> 0
-ddctm014 comparetotmag 0 1 -> -1
-ddctm015 comparetotmag 0 2 -> -1
-ddctm016 comparetotmag 1 -2 -> -1
-ddctm017 comparetotmag 1 -1 -> 0
-ddctm018 comparetotmag 1 0 -> 1
-ddctm019 comparetotmag 1 1 -> 0
-ddctm020 comparetotmag 1 2 -> -1
-ddctm021 comparetotmag 2 -2 -> 0
-ddctm022 comparetotmag 2 -1 -> 1
-ddctm023 comparetotmag 2 0 -> 1
-ddctm025 comparetotmag 2 1 -> 1
-ddctm026 comparetotmag 2 2 -> 0
-
-ddctm031 comparetotmag -20 -20 -> 0
-ddctm032 comparetotmag -20 -10 -> 1
-ddctm033 comparetotmag -20 00 -> 1
-ddctm034 comparetotmag -20 10 -> 1
-ddctm035 comparetotmag -20 20 -> 0
-ddctm036 comparetotmag -10 -20 -> -1
-ddctm037 comparetotmag -10 -10 -> 0
-ddctm038 comparetotmag -10 00 -> 1
-ddctm039 comparetotmag -10 10 -> 0
-ddctm040 comparetotmag -10 20 -> -1
-ddctm041 comparetotmag 00 -20 -> -1
-ddctm042 comparetotmag 00 -10 -> -1
-ddctm043 comparetotmag 00 00 -> 0
-ddctm044 comparetotmag 00 10 -> -1
-ddctm045 comparetotmag 00 20 -> -1
-ddctm046 comparetotmag 10 -20 -> -1
-ddctm047 comparetotmag 10 -10 -> 0
-ddctm048 comparetotmag 10 00 -> 1
-ddctm049 comparetotmag 10 10 -> 0
-ddctm050 comparetotmag 10 20 -> -1
-ddctm051 comparetotmag 20 -20 -> 0
-ddctm052 comparetotmag 20 -10 -> 1
-ddctm053 comparetotmag 20 00 -> 1
-ddctm055 comparetotmag 20 10 -> 1
-ddctm056 comparetotmag 20 20 -> 0
-
-ddctm061 comparetotmag -2.0 -2.0 -> 0
-ddctm062 comparetotmag -2.0 -1.0 -> 1
-ddctm063 comparetotmag -2.0 0.0 -> 1
-ddctm064 comparetotmag -2.0 1.0 -> 1
-ddctm065 comparetotmag -2.0 2.0 -> 0
-ddctm066 comparetotmag -1.0 -2.0 -> -1
-ddctm067 comparetotmag -1.0 -1.0 -> 0
-ddctm068 comparetotmag -1.0 0.0 -> 1
-ddctm069 comparetotmag -1.0 1.0 -> 0
-ddctm070 comparetotmag -1.0 2.0 -> -1
-ddctm071 comparetotmag 0.0 -2.0 -> -1
-ddctm072 comparetotmag 0.0 -1.0 -> -1
-ddctm073 comparetotmag 0.0 0.0 -> 0
-ddctm074 comparetotmag 0.0 1.0 -> -1
-ddctm075 comparetotmag 0.0 2.0 -> -1
-ddctm076 comparetotmag 1.0 -2.0 -> -1
-ddctm077 comparetotmag 1.0 -1.0 -> 0
-ddctm078 comparetotmag 1.0 0.0 -> 1
-ddctm079 comparetotmag 1.0 1.0 -> 0
-ddctm080 comparetotmag 1.0 2.0 -> -1
-ddctm081 comparetotmag 2.0 -2.0 -> 0
-ddctm082 comparetotmag 2.0 -1.0 -> 1
-ddctm083 comparetotmag 2.0 0.0 -> 1
-ddctm085 comparetotmag 2.0 1.0 -> 1
-ddctm086 comparetotmag 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-ddctm090 comparetotmag 9.99999999E+384 9.99999999E+384 -> 0
-ddctm091 comparetotmag -9.99999999E+384 9.99999999E+384 -> 0
-ddctm092 comparetotmag 9.99999999E+384 -9.99999999E+384 -> 0
-ddctm093 comparetotmag -9.99999999E+384 -9.99999999E+384 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-ddctm100 comparetotmag 7.0 7.0 -> 0
-ddctm101 comparetotmag 7.0 7 -> -1
-ddctm102 comparetotmag 7 7.0 -> 1
-ddctm103 comparetotmag 7E+0 7.0 -> 1
-ddctm104 comparetotmag 70E-1 7.0 -> 0
-ddctm105 comparetotmag 0.7E+1 7 -> 0
-ddctm106 comparetotmag 70E-1 7 -> -1
-ddctm107 comparetotmag 7.0 7E+0 -> -1
-ddctm108 comparetotmag 7.0 70E-1 -> 0
-ddctm109 comparetotmag 7 0.7E+1 -> 0
-ddctm110 comparetotmag 7 70E-1 -> 1
-
-ddctm120 comparetotmag 8.0 7.0 -> 1
-ddctm121 comparetotmag 8.0 7 -> 1
-ddctm122 comparetotmag 8 7.0 -> 1
-ddctm123 comparetotmag 8E+0 7.0 -> 1
-ddctm124 comparetotmag 80E-1 7.0 -> 1
-ddctm125 comparetotmag 0.8E+1 7 -> 1
-ddctm126 comparetotmag 80E-1 7 -> 1
-ddctm127 comparetotmag 8.0 7E+0 -> 1
-ddctm128 comparetotmag 8.0 70E-1 -> 1
-ddctm129 comparetotmag 8 0.7E+1 -> 1
-ddctm130 comparetotmag 8 70E-1 -> 1
-
-ddctm140 comparetotmag 8.0 9.0 -> -1
-ddctm141 comparetotmag 8.0 9 -> -1
-ddctm142 comparetotmag 8 9.0 -> -1
-ddctm143 comparetotmag 8E+0 9.0 -> -1
-ddctm144 comparetotmag 80E-1 9.0 -> -1
-ddctm145 comparetotmag 0.8E+1 9 -> -1
-ddctm146 comparetotmag 80E-1 9 -> -1
-ddctm147 comparetotmag 8.0 9E+0 -> -1
-ddctm148 comparetotmag 8.0 90E-1 -> -1
-ddctm149 comparetotmag 8 0.9E+1 -> -1
-ddctm150 comparetotmag 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ddctm200 comparetotmag -7.0 7.0 -> 0
-ddctm201 comparetotmag -7.0 7 -> -1
-ddctm202 comparetotmag -7 7.0 -> 1
-ddctm203 comparetotmag -7E+0 7.0 -> 1
-ddctm204 comparetotmag -70E-1 7.0 -> 0
-ddctm205 comparetotmag -0.7E+1 7 -> 0
-ddctm206 comparetotmag -70E-1 7 -> -1
-ddctm207 comparetotmag -7.0 7E+0 -> -1
-ddctm208 comparetotmag -7.0 70E-1 -> 0
-ddctm209 comparetotmag -7 0.7E+1 -> 0
-ddctm210 comparetotmag -7 70E-1 -> 1
-
-ddctm220 comparetotmag -8.0 7.0 -> 1
-ddctm221 comparetotmag -8.0 7 -> 1
-ddctm222 comparetotmag -8 7.0 -> 1
-ddctm223 comparetotmag -8E+0 7.0 -> 1
-ddctm224 comparetotmag -80E-1 7.0 -> 1
-ddctm225 comparetotmag -0.8E+1 7 -> 1
-ddctm226 comparetotmag -80E-1 7 -> 1
-ddctm227 comparetotmag -8.0 7E+0 -> 1
-ddctm228 comparetotmag -8.0 70E-1 -> 1
-ddctm229 comparetotmag -8 0.7E+1 -> 1
-ddctm230 comparetotmag -8 70E-1 -> 1
-
-ddctm240 comparetotmag -8.0 9.0 -> -1
-ddctm241 comparetotmag -8.0 9 -> -1
-ddctm242 comparetotmag -8 9.0 -> -1
-ddctm243 comparetotmag -8E+0 9.0 -> -1
-ddctm244 comparetotmag -80E-1 9.0 -> -1
-ddctm245 comparetotmag -0.8E+1 9 -> -1
-ddctm246 comparetotmag -80E-1 9 -> -1
-ddctm247 comparetotmag -8.0 9E+0 -> -1
-ddctm248 comparetotmag -8.0 90E-1 -> -1
-ddctm249 comparetotmag -8 0.9E+1 -> -1
-ddctm250 comparetotmag -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ddctm300 comparetotmag 7.0 -7.0 -> 0
-ddctm301 comparetotmag 7.0 -7 -> -1
-ddctm302 comparetotmag 7 -7.0 -> 1
-ddctm303 comparetotmag 7E+0 -7.0 -> 1
-ddctm304 comparetotmag 70E-1 -7.0 -> 0
-ddctm305 comparetotmag .7E+1 -7 -> 0
-ddctm306 comparetotmag 70E-1 -7 -> -1
-ddctm307 comparetotmag 7.0 -7E+0 -> -1
-ddctm308 comparetotmag 7.0 -70E-1 -> 0
-ddctm309 comparetotmag 7 -.7E+1 -> 0
-ddctm310 comparetotmag 7 -70E-1 -> 1
-
-ddctm320 comparetotmag 8.0 -7.0 -> 1
-ddctm321 comparetotmag 8.0 -7 -> 1
-ddctm322 comparetotmag 8 -7.0 -> 1
-ddctm323 comparetotmag 8E+0 -7.0 -> 1
-ddctm324 comparetotmag 80E-1 -7.0 -> 1
-ddctm325 comparetotmag .8E+1 -7 -> 1
-ddctm326 comparetotmag 80E-1 -7 -> 1
-ddctm327 comparetotmag 8.0 -7E+0 -> 1
-ddctm328 comparetotmag 8.0 -70E-1 -> 1
-ddctm329 comparetotmag 8 -.7E+1 -> 1
-ddctm330 comparetotmag 8 -70E-1 -> 1
-
-ddctm340 comparetotmag 8.0 -9.0 -> -1
-ddctm341 comparetotmag 8.0 -9 -> -1
-ddctm342 comparetotmag 8 -9.0 -> -1
-ddctm343 comparetotmag 8E+0 -9.0 -> -1
-ddctm344 comparetotmag 80E-1 -9.0 -> -1
-ddctm345 comparetotmag .8E+1 -9 -> -1
-ddctm346 comparetotmag 80E-1 -9 -> -1
-ddctm347 comparetotmag 8.0 -9E+0 -> -1
-ddctm348 comparetotmag 8.0 -90E-1 -> -1
-ddctm349 comparetotmag 8 -.9E+1 -> -1
-ddctm350 comparetotmag 8 -90E-1 -> -1
-
--- and again, with sign changes -- ..
-ddctm400 comparetotmag -7.0 -7.0 -> 0
-ddctm401 comparetotmag -7.0 -7 -> -1
-ddctm402 comparetotmag -7 -7.0 -> 1
-ddctm403 comparetotmag -7E+0 -7.0 -> 1
-ddctm404 comparetotmag -70E-1 -7.0 -> 0
-ddctm405 comparetotmag -.7E+1 -7 -> 0
-ddctm406 comparetotmag -70E-1 -7 -> -1
-ddctm407 comparetotmag -7.0 -7E+0 -> -1
-ddctm408 comparetotmag -7.0 -70E-1 -> 0
-ddctm409 comparetotmag -7 -.7E+1 -> 0
-ddctm410 comparetotmag -7 -70E-1 -> 1
-
-ddctm420 comparetotmag -8.0 -7.0 -> 1
-ddctm421 comparetotmag -8.0 -7 -> 1
-ddctm422 comparetotmag -8 -7.0 -> 1
-ddctm423 comparetotmag -8E+0 -7.0 -> 1
-ddctm424 comparetotmag -80E-1 -7.0 -> 1
-ddctm425 comparetotmag -.8E+1 -7 -> 1
-ddctm426 comparetotmag -80E-1 -7 -> 1
-ddctm427 comparetotmag -8.0 -7E+0 -> 1
-ddctm428 comparetotmag -8.0 -70E-1 -> 1
-ddctm429 comparetotmag -8 -.7E+1 -> 1
-ddctm430 comparetotmag -8 -70E-1 -> 1
-
-ddctm440 comparetotmag -8.0 -9.0 -> -1
-ddctm441 comparetotmag -8.0 -9 -> -1
-ddctm442 comparetotmag -8 -9.0 -> -1
-ddctm443 comparetotmag -8E+0 -9.0 -> -1
-ddctm444 comparetotmag -80E-1 -9.0 -> -1
-ddctm445 comparetotmag -.8E+1 -9 -> -1
-ddctm446 comparetotmag -80E-1 -9 -> -1
-ddctm447 comparetotmag -8.0 -9E+0 -> -1
-ddctm448 comparetotmag -8.0 -90E-1 -> -1
-ddctm449 comparetotmag -8 -.9E+1 -> -1
-ddctm450 comparetotmag -8 -90E-1 -> -1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-ddctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
-ddctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
-ddctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
-ddctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
-ddctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
-ddctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
-ddctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
-ddctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
-ddctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
-ddctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
-ddctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
-ddctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
-ddctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
-ddctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
-ddctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
-ddctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
-ddctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
-ddctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
-ddctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
-ddctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
-ddctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
-ddctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-ddctm498 comparetotmag 1 1E-17 -> 1
-ddctm499 comparetotmag 1 1E-16 -> 1
-ddctm500 comparetotmag 1 1E-15 -> 1
-ddctm501 comparetotmag 1 1E-14 -> 1
-ddctm502 comparetotmag 1 1E-13 -> 1
-ddctm503 comparetotmag 1 1E-12 -> 1
-ddctm504 comparetotmag 1 1E-11 -> 1
-ddctm505 comparetotmag 1 1E-10 -> 1
-ddctm506 comparetotmag 1 1E-9 -> 1
-ddctm507 comparetotmag 1 1E-8 -> 1
-ddctm508 comparetotmag 1 1E-7 -> 1
-ddctm509 comparetotmag 1 1E-6 -> 1
-ddctm510 comparetotmag 1 1E-5 -> 1
-ddctm511 comparetotmag 1 1E-4 -> 1
-ddctm512 comparetotmag 1 1E-3 -> 1
-ddctm513 comparetotmag 1 1E-2 -> 1
-ddctm514 comparetotmag 1 1E-1 -> 1
-ddctm515 comparetotmag 1 1E-0 -> 0
-ddctm516 comparetotmag 1 1E+1 -> -1
-ddctm517 comparetotmag 1 1E+2 -> -1
-ddctm518 comparetotmag 1 1E+3 -> -1
-ddctm519 comparetotmag 1 1E+4 -> -1
-ddctm521 comparetotmag 1 1E+5 -> -1
-ddctm522 comparetotmag 1 1E+6 -> -1
-ddctm523 comparetotmag 1 1E+7 -> -1
-ddctm524 comparetotmag 1 1E+8 -> -1
-ddctm525 comparetotmag 1 1E+9 -> -1
-ddctm526 comparetotmag 1 1E+10 -> -1
-ddctm527 comparetotmag 1 1E+11 -> -1
-ddctm528 comparetotmag 1 1E+12 -> -1
-ddctm529 comparetotmag 1 1E+13 -> -1
-ddctm530 comparetotmag 1 1E+14 -> -1
-ddctm531 comparetotmag 1 1E+15 -> -1
-ddctm532 comparetotmag 1 1E+16 -> -1
-ddctm533 comparetotmag 1 1E+17 -> -1
--- LR swap
-ddctm538 comparetotmag 1E-17 1 -> -1
-ddctm539 comparetotmag 1E-16 1 -> -1
-ddctm540 comparetotmag 1E-15 1 -> -1
-ddctm541 comparetotmag 1E-14 1 -> -1
-ddctm542 comparetotmag 1E-13 1 -> -1
-ddctm543 comparetotmag 1E-12 1 -> -1
-ddctm544 comparetotmag 1E-11 1 -> -1
-ddctm545 comparetotmag 1E-10 1 -> -1
-ddctm546 comparetotmag 1E-9 1 -> -1
-ddctm547 comparetotmag 1E-8 1 -> -1
-ddctm548 comparetotmag 1E-7 1 -> -1
-ddctm549 comparetotmag 1E-6 1 -> -1
-ddctm550 comparetotmag 1E-5 1 -> -1
-ddctm551 comparetotmag 1E-4 1 -> -1
-ddctm552 comparetotmag 1E-3 1 -> -1
-ddctm553 comparetotmag 1E-2 1 -> -1
-ddctm554 comparetotmag 1E-1 1 -> -1
-ddctm555 comparetotmag 1E-0 1 -> 0
-ddctm556 comparetotmag 1E+1 1 -> 1
-ddctm557 comparetotmag 1E+2 1 -> 1
-ddctm558 comparetotmag 1E+3 1 -> 1
-ddctm559 comparetotmag 1E+4 1 -> 1
-ddctm561 comparetotmag 1E+5 1 -> 1
-ddctm562 comparetotmag 1E+6 1 -> 1
-ddctm563 comparetotmag 1E+7 1 -> 1
-ddctm564 comparetotmag 1E+8 1 -> 1
-ddctm565 comparetotmag 1E+9 1 -> 1
-ddctm566 comparetotmag 1E+10 1 -> 1
-ddctm567 comparetotmag 1E+11 1 -> 1
-ddctm568 comparetotmag 1E+12 1 -> 1
-ddctm569 comparetotmag 1E+13 1 -> 1
-ddctm570 comparetotmag 1E+14 1 -> 1
-ddctm571 comparetotmag 1E+15 1 -> 1
-ddctm572 comparetotmag 1E+16 1 -> 1
-ddctm573 comparetotmag 1E+17 1 -> 1
--- similar with a useful coefficient, one side only
-ddctm578 comparetotmag 0.000000987654321 1E-17 -> 1
-ddctm579 comparetotmag 0.000000987654321 1E-16 -> 1
-ddctm580 comparetotmag 0.000000987654321 1E-15 -> 1
-ddctm581 comparetotmag 0.000000987654321 1E-14 -> 1
-ddctm582 comparetotmag 0.000000987654321 1E-13 -> 1
-ddctm583 comparetotmag 0.000000987654321 1E-12 -> 1
-ddctm584 comparetotmag 0.000000987654321 1E-11 -> 1
-ddctm585 comparetotmag 0.000000987654321 1E-10 -> 1
-ddctm586 comparetotmag 0.000000987654321 1E-9 -> 1
-ddctm587 comparetotmag 0.000000987654321 1E-8 -> 1
-ddctm588 comparetotmag 0.000000987654321 1E-7 -> 1
-ddctm589 comparetotmag 0.000000987654321 1E-6 -> -1
-ddctm590 comparetotmag 0.000000987654321 1E-5 -> -1
-ddctm591 comparetotmag 0.000000987654321 1E-4 -> -1
-ddctm592 comparetotmag 0.000000987654321 1E-3 -> -1
-ddctm593 comparetotmag 0.000000987654321 1E-2 -> -1
-ddctm594 comparetotmag 0.000000987654321 1E-1 -> -1
-ddctm595 comparetotmag 0.000000987654321 1E-0 -> -1
-ddctm596 comparetotmag 0.000000987654321 1E+1 -> -1
-ddctm597 comparetotmag 0.000000987654321 1E+2 -> -1
-ddctm598 comparetotmag 0.000000987654321 1E+3 -> -1
-ddctm599 comparetotmag 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-ddctm600 comparetotmag 12 12.2345 -> -1
-ddctm601 comparetotmag 12.0 12.2345 -> -1
-ddctm602 comparetotmag 12.00 12.2345 -> -1
-ddctm603 comparetotmag 12.000 12.2345 -> -1
-ddctm604 comparetotmag 12.0000 12.2345 -> -1
-ddctm605 comparetotmag 12.00000 12.2345 -> -1
-ddctm606 comparetotmag 12.000000 12.2345 -> -1
-ddctm607 comparetotmag 12.0000000 12.2345 -> -1
-ddctm608 comparetotmag 12.00000000 12.2345 -> -1
-ddctm609 comparetotmag 12.000000000 12.2345 -> -1
-ddctm610 comparetotmag 12.1234 12 -> 1
-ddctm611 comparetotmag 12.1234 12.0 -> 1
-ddctm612 comparetotmag 12.1234 12.00 -> 1
-ddctm613 comparetotmag 12.1234 12.000 -> 1
-ddctm614 comparetotmag 12.1234 12.0000 -> 1
-ddctm615 comparetotmag 12.1234 12.00000 -> 1
-ddctm616 comparetotmag 12.1234 12.000000 -> 1
-ddctm617 comparetotmag 12.1234 12.0000000 -> 1
-ddctm618 comparetotmag 12.1234 12.00000000 -> 1
-ddctm619 comparetotmag 12.1234 12.000000000 -> 1
-ddctm620 comparetotmag -12 -12.2345 -> -1
-ddctm621 comparetotmag -12.0 -12.2345 -> -1
-ddctm622 comparetotmag -12.00 -12.2345 -> -1
-ddctm623 comparetotmag -12.000 -12.2345 -> -1
-ddctm624 comparetotmag -12.0000 -12.2345 -> -1
-ddctm625 comparetotmag -12.00000 -12.2345 -> -1
-ddctm626 comparetotmag -12.000000 -12.2345 -> -1
-ddctm627 comparetotmag -12.0000000 -12.2345 -> -1
-ddctm628 comparetotmag -12.00000000 -12.2345 -> -1
-ddctm629 comparetotmag -12.000000000 -12.2345 -> -1
-ddctm630 comparetotmag -12.1234 -12 -> 1
-ddctm631 comparetotmag -12.1234 -12.0 -> 1
-ddctm632 comparetotmag -12.1234 -12.00 -> 1
-ddctm633 comparetotmag -12.1234 -12.000 -> 1
-ddctm634 comparetotmag -12.1234 -12.0000 -> 1
-ddctm635 comparetotmag -12.1234 -12.00000 -> 1
-ddctm636 comparetotmag -12.1234 -12.000000 -> 1
-ddctm637 comparetotmag -12.1234 -12.0000000 -> 1
-ddctm638 comparetotmag -12.1234 -12.00000000 -> 1
-ddctm639 comparetotmag -12.1234 -12.000000000 -> 1
-
--- extended zeros
-ddctm640 comparetotmag 0 0 -> 0
-ddctm641 comparetotmag 0 -0 -> 0
-ddctm642 comparetotmag 0 -0.0 -> 1
-ddctm643 comparetotmag 0 0.0 -> 1
-ddctm644 comparetotmag -0 0 -> 0
-ddctm645 comparetotmag -0 -0 -> 0
-ddctm646 comparetotmag -0 -0.0 -> 1
-ddctm647 comparetotmag -0 0.0 -> 1
-ddctm648 comparetotmag 0.0 0 -> -1
-ddctm649 comparetotmag 0.0 -0 -> -1
-ddctm650 comparetotmag 0.0 -0.0 -> 0
-ddctm651 comparetotmag 0.0 0.0 -> 0
-ddctm652 comparetotmag -0.0 0 -> -1
-ddctm653 comparetotmag -0.0 -0 -> -1
-ddctm654 comparetotmag -0.0 -0.0 -> 0
-ddctm655 comparetotmag -0.0 0.0 -> 0
-
-ddctm656 comparetotmag -0E1 0.0 -> 1
-ddctm657 comparetotmag -0E2 0.0 -> 1
-ddctm658 comparetotmag 0E1 0.0 -> 1
-ddctm659 comparetotmag 0E2 0.0 -> 1
-ddctm660 comparetotmag -0E1 0 -> 1
-ddctm661 comparetotmag -0E2 0 -> 1
-ddctm662 comparetotmag 0E1 0 -> 1
-ddctm663 comparetotmag 0E2 0 -> 1
-ddctm664 comparetotmag -0E1 -0E1 -> 0
-ddctm665 comparetotmag -0E2 -0E1 -> 1
-ddctm666 comparetotmag 0E1 -0E1 -> 0
-ddctm667 comparetotmag 0E2 -0E1 -> 1
-ddctm668 comparetotmag -0E1 -0E2 -> -1
-ddctm669 comparetotmag -0E2 -0E2 -> 0
-ddctm670 comparetotmag 0E1 -0E2 -> -1
-ddctm671 comparetotmag 0E2 -0E2 -> 0
-ddctm672 comparetotmag -0E1 0E1 -> 0
-ddctm673 comparetotmag -0E2 0E1 -> 1
-ddctm674 comparetotmag 0E1 0E1 -> 0
-ddctm675 comparetotmag 0E2 0E1 -> 1
-ddctm676 comparetotmag -0E1 0E2 -> -1
-ddctm677 comparetotmag -0E2 0E2 -> 0
-ddctm678 comparetotmag 0E1 0E2 -> -1
-ddctm679 comparetotmag 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-ddctm680 comparetotmag 12 12 -> 0
-ddctm681 comparetotmag 12 12.0 -> 1
-ddctm682 comparetotmag 12 12.00 -> 1
-ddctm683 comparetotmag 12 12.000 -> 1
-ddctm684 comparetotmag 12 12.0000 -> 1
-ddctm685 comparetotmag 12 12.00000 -> 1
-ddctm686 comparetotmag 12 12.000000 -> 1
-ddctm687 comparetotmag 12 12.0000000 -> 1
-ddctm688 comparetotmag 12 12.00000000 -> 1
-ddctm689 comparetotmag 12 12.000000000 -> 1
-ddctm690 comparetotmag 12 12 -> 0
-ddctm691 comparetotmag 12.0 12 -> -1
-ddctm692 comparetotmag 12.00 12 -> -1
-ddctm693 comparetotmag 12.000 12 -> -1
-ddctm694 comparetotmag 12.0000 12 -> -1
-ddctm695 comparetotmag 12.00000 12 -> -1
-ddctm696 comparetotmag 12.000000 12 -> -1
-ddctm697 comparetotmag 12.0000000 12 -> -1
-ddctm698 comparetotmag 12.00000000 12 -> -1
-ddctm699 comparetotmag 12.000000000 12 -> -1
-
--- old long operand checks
-ddctm701 comparetotmag 12345678000 1 -> 1
-ddctm702 comparetotmag 1 12345678000 -> -1
-ddctm703 comparetotmag 1234567800 1 -> 1
-ddctm704 comparetotmag 1 1234567800 -> -1
-ddctm705 comparetotmag 1234567890 1 -> 1
-ddctm706 comparetotmag 1 1234567890 -> -1
-ddctm707 comparetotmag 1234567891 1 -> 1
-ddctm708 comparetotmag 1 1234567891 -> -1
-ddctm709 comparetotmag 12345678901 1 -> 1
-ddctm710 comparetotmag 1 12345678901 -> -1
-ddctm711 comparetotmag 1234567896 1 -> 1
-ddctm712 comparetotmag 1 1234567896 -> -1
-ddctm713 comparetotmag -1234567891 1 -> 1
-ddctm714 comparetotmag 1 -1234567891 -> -1
-ddctm715 comparetotmag -12345678901 1 -> 1
-ddctm716 comparetotmag 1 -12345678901 -> -1
-ddctm717 comparetotmag -1234567896 1 -> 1
-ddctm718 comparetotmag 1 -1234567896 -> -1
-
--- old residue cases
-ddctm740 comparetotmag 1 0.9999999 -> 1
-ddctm741 comparetotmag 1 0.999999 -> 1
-ddctm742 comparetotmag 1 0.99999 -> 1
-ddctm743 comparetotmag 1 1.0000 -> 1
-ddctm744 comparetotmag 1 1.00001 -> -1
-ddctm745 comparetotmag 1 1.000001 -> -1
-ddctm746 comparetotmag 1 1.0000001 -> -1
-ddctm750 comparetotmag 0.9999999 1 -> -1
-ddctm751 comparetotmag 0.999999 1 -> -1
-ddctm752 comparetotmag 0.99999 1 -> -1
-ddctm753 comparetotmag 1.0000 1 -> -1
-ddctm754 comparetotmag 1.00001 1 -> 1
-ddctm755 comparetotmag 1.000001 1 -> 1
-ddctm756 comparetotmag 1.0000001 1 -> 1
-
--- Specials
-ddctm780 comparetotmag Inf -Inf -> 0
-ddctm781 comparetotmag Inf -1000 -> 1
-ddctm782 comparetotmag Inf -1 -> 1
-ddctm783 comparetotmag Inf -0 -> 1
-ddctm784 comparetotmag Inf 0 -> 1
-ddctm785 comparetotmag Inf 1 -> 1
-ddctm786 comparetotmag Inf 1000 -> 1
-ddctm787 comparetotmag Inf Inf -> 0
-ddctm788 comparetotmag -1000 Inf -> -1
-ddctm789 comparetotmag -Inf Inf -> 0
-ddctm790 comparetotmag -1 Inf -> -1
-ddctm791 comparetotmag -0 Inf -> -1
-ddctm792 comparetotmag 0 Inf -> -1
-ddctm793 comparetotmag 1 Inf -> -1
-ddctm794 comparetotmag 1000 Inf -> -1
-ddctm795 comparetotmag Inf Inf -> 0
-
-ddctm800 comparetotmag -Inf -Inf -> 0
-ddctm801 comparetotmag -Inf -1000 -> 1
-ddctm802 comparetotmag -Inf -1 -> 1
-ddctm803 comparetotmag -Inf -0 -> 1
-ddctm804 comparetotmag -Inf 0 -> 1
-ddctm805 comparetotmag -Inf 1 -> 1
-ddctm806 comparetotmag -Inf 1000 -> 1
-ddctm807 comparetotmag -Inf Inf -> 0
-ddctm808 comparetotmag -Inf -Inf -> 0
-ddctm809 comparetotmag -1000 -Inf -> -1
-ddctm810 comparetotmag -1 -Inf -> -1
-ddctm811 comparetotmag -0 -Inf -> -1
-ddctm812 comparetotmag 0 -Inf -> -1
-ddctm813 comparetotmag 1 -Inf -> -1
-ddctm814 comparetotmag 1000 -Inf -> -1
-ddctm815 comparetotmag Inf -Inf -> 0
-
-ddctm821 comparetotmag NaN -Inf -> 1
-ddctm822 comparetotmag NaN -1000 -> 1
-ddctm823 comparetotmag NaN -1 -> 1
-ddctm824 comparetotmag NaN -0 -> 1
-ddctm825 comparetotmag NaN 0 -> 1
-ddctm826 comparetotmag NaN 1 -> 1
-ddctm827 comparetotmag NaN 1000 -> 1
-ddctm828 comparetotmag NaN Inf -> 1
-ddctm829 comparetotmag NaN NaN -> 0
-ddctm830 comparetotmag -Inf NaN -> -1
-ddctm831 comparetotmag -1000 NaN -> -1
-ddctm832 comparetotmag -1 NaN -> -1
-ddctm833 comparetotmag -0 NaN -> -1
-ddctm834 comparetotmag 0 NaN -> -1
-ddctm835 comparetotmag 1 NaN -> -1
-ddctm836 comparetotmag 1000 NaN -> -1
-ddctm837 comparetotmag Inf NaN -> -1
-ddctm838 comparetotmag -NaN -NaN -> 0
-ddctm839 comparetotmag +NaN -NaN -> 0
-ddctm840 comparetotmag -NaN +NaN -> 0
-
-ddctm841 comparetotmag sNaN -sNaN -> 0
-ddctm842 comparetotmag sNaN -NaN -> -1
-ddctm843 comparetotmag sNaN -Inf -> 1
-ddctm844 comparetotmag sNaN -1000 -> 1
-ddctm845 comparetotmag sNaN -1 -> 1
-ddctm846 comparetotmag sNaN -0 -> 1
-ddctm847 comparetotmag sNaN 0 -> 1
-ddctm848 comparetotmag sNaN 1 -> 1
-ddctm849 comparetotmag sNaN 1000 -> 1
-ddctm850 comparetotmag sNaN NaN -> -1
-ddctm851 comparetotmag sNaN sNaN -> 0
-
-ddctm852 comparetotmag -sNaN sNaN -> 0
-ddctm853 comparetotmag -NaN sNaN -> 1
-ddctm854 comparetotmag -Inf sNaN -> -1
-ddctm855 comparetotmag -1000 sNaN -> -1
-ddctm856 comparetotmag -1 sNaN -> -1
-ddctm857 comparetotmag -0 sNaN -> -1
-ddctm858 comparetotmag 0 sNaN -> -1
-ddctm859 comparetotmag 1 sNaN -> -1
-ddctm860 comparetotmag 1000 sNaN -> -1
-ddctm861 comparetotmag Inf sNaN -> -1
-ddctm862 comparetotmag NaN sNaN -> 1
-ddctm863 comparetotmag sNaN sNaN -> 0
-
-ddctm871 comparetotmag -sNaN -sNaN -> 0
-ddctm872 comparetotmag -sNaN -NaN -> -1
-ddctm873 comparetotmag -sNaN -Inf -> 1
-ddctm874 comparetotmag -sNaN -1000 -> 1
-ddctm875 comparetotmag -sNaN -1 -> 1
-ddctm876 comparetotmag -sNaN -0 -> 1
-ddctm877 comparetotmag -sNaN 0 -> 1
-ddctm878 comparetotmag -sNaN 1 -> 1
-ddctm879 comparetotmag -sNaN 1000 -> 1
-ddctm880 comparetotmag -sNaN NaN -> -1
-ddctm881 comparetotmag -sNaN sNaN -> 0
-
-ddctm882 comparetotmag -sNaN -sNaN -> 0
-ddctm883 comparetotmag -NaN -sNaN -> 1
-ddctm884 comparetotmag -Inf -sNaN -> -1
-ddctm885 comparetotmag -1000 -sNaN -> -1
-ddctm886 comparetotmag -1 -sNaN -> -1
-ddctm887 comparetotmag -0 -sNaN -> -1
-ddctm888 comparetotmag 0 -sNaN -> -1
-ddctm889 comparetotmag 1 -sNaN -> -1
-ddctm890 comparetotmag 1000 -sNaN -> -1
-ddctm891 comparetotmag Inf -sNaN -> -1
-ddctm892 comparetotmag NaN -sNaN -> 1
-ddctm893 comparetotmag sNaN -sNaN -> 0
-
--- NaNs with payload
-ddctm960 comparetotmag NaN9 -Inf -> 1
-ddctm961 comparetotmag NaN8 999 -> 1
-ddctm962 comparetotmag NaN77 Inf -> 1
-ddctm963 comparetotmag -NaN67 NaN5 -> 1
-ddctm964 comparetotmag -Inf -NaN4 -> -1
-ddctm965 comparetotmag -999 -NaN33 -> -1
-ddctm966 comparetotmag Inf NaN2 -> -1
-
-ddctm970 comparetotmag -NaN41 -NaN42 -> -1
-ddctm971 comparetotmag +NaN41 -NaN42 -> -1
-ddctm972 comparetotmag -NaN41 +NaN42 -> -1
-ddctm973 comparetotmag +NaN41 +NaN42 -> -1
-ddctm974 comparetotmag -NaN42 -NaN01 -> 1
-ddctm975 comparetotmag +NaN42 -NaN01 -> 1
-ddctm976 comparetotmag -NaN42 +NaN01 -> 1
-ddctm977 comparetotmag +NaN42 +NaN01 -> 1
-
-ddctm980 comparetotmag -sNaN771 -sNaN772 -> -1
-ddctm981 comparetotmag +sNaN771 -sNaN772 -> -1
-ddctm982 comparetotmag -sNaN771 +sNaN772 -> -1
-ddctm983 comparetotmag +sNaN771 +sNaN772 -> -1
-ddctm984 comparetotmag -sNaN772 -sNaN771 -> 1
-ddctm985 comparetotmag +sNaN772 -sNaN771 -> 1
-ddctm986 comparetotmag -sNaN772 +sNaN771 -> 1
-ddctm987 comparetotmag +sNaN772 +sNaN771 -> 1
-
-ddctm991 comparetotmag -sNaN99 -Inf -> 1
-ddctm992 comparetotmag sNaN98 -11 -> 1
-ddctm993 comparetotmag sNaN97 NaN -> -1
-ddctm994 comparetotmag sNaN16 sNaN94 -> -1
-ddctm995 comparetotmag NaN85 sNaN83 -> 1
-ddctm996 comparetotmag -Inf sNaN92 -> -1
-ddctm997 comparetotmag 088 sNaN81 -> -1
-ddctm998 comparetotmag Inf sNaN90 -> -1
-ddctm999 comparetotmag NaN -sNaN89 -> 1
-
--- spread zeros
-ddctm1110 comparetotmag 0E-383 0 -> -1
-ddctm1111 comparetotmag 0E-383 -0 -> -1
-ddctm1112 comparetotmag -0E-383 0 -> -1
-ddctm1113 comparetotmag -0E-383 -0 -> -1
-ddctm1114 comparetotmag 0E-383 0E+384 -> -1
-ddctm1115 comparetotmag 0E-383 -0E+384 -> -1
-ddctm1116 comparetotmag -0E-383 0E+384 -> -1
-ddctm1117 comparetotmag -0E-383 -0E+384 -> -1
-ddctm1118 comparetotmag 0 0E+384 -> -1
-ddctm1119 comparetotmag 0 -0E+384 -> -1
-ddctm1120 comparetotmag -0 0E+384 -> -1
-ddctm1121 comparetotmag -0 -0E+384 -> -1
-
-ddctm1130 comparetotmag 0E+384 0 -> 1
-ddctm1131 comparetotmag 0E+384 -0 -> 1
-ddctm1132 comparetotmag -0E+384 0 -> 1
-ddctm1133 comparetotmag -0E+384 -0 -> 1
-ddctm1134 comparetotmag 0E+384 0E-383 -> 1
-ddctm1135 comparetotmag 0E+384 -0E-383 -> 1
-ddctm1136 comparetotmag -0E+384 0E-383 -> 1
-ddctm1137 comparetotmag -0E+384 -0E-383 -> 1
-ddctm1138 comparetotmag 0 0E-383 -> 1
-ddctm1139 comparetotmag 0 -0E-383 -> 1
-ddctm1140 comparetotmag -0 0E-383 -> 1
-ddctm1141 comparetotmag -0 -0E-383 -> 1
-
--- Null tests
-ddctm9990 comparetotmag 10 # -> NaN Invalid_operation
-ddctm9991 comparetotmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddCompareTotalMag.decTest -- decDouble comparison; abs. total order--
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddctm001 comparetotmag -2 -2 -> 0
+ddctm002 comparetotmag -2 -1 -> 1
+ddctm003 comparetotmag -2 0 -> 1
+ddctm004 comparetotmag -2 1 -> 1
+ddctm005 comparetotmag -2 2 -> 0
+ddctm006 comparetotmag -1 -2 -> -1
+ddctm007 comparetotmag -1 -1 -> 0
+ddctm008 comparetotmag -1 0 -> 1
+ddctm009 comparetotmag -1 1 -> 0
+ddctm010 comparetotmag -1 2 -> -1
+ddctm011 comparetotmag 0 -2 -> -1
+ddctm012 comparetotmag 0 -1 -> -1
+ddctm013 comparetotmag 0 0 -> 0
+ddctm014 comparetotmag 0 1 -> -1
+ddctm015 comparetotmag 0 2 -> -1
+ddctm016 comparetotmag 1 -2 -> -1
+ddctm017 comparetotmag 1 -1 -> 0
+ddctm018 comparetotmag 1 0 -> 1
+ddctm019 comparetotmag 1 1 -> 0
+ddctm020 comparetotmag 1 2 -> -1
+ddctm021 comparetotmag 2 -2 -> 0
+ddctm022 comparetotmag 2 -1 -> 1
+ddctm023 comparetotmag 2 0 -> 1
+ddctm025 comparetotmag 2 1 -> 1
+ddctm026 comparetotmag 2 2 -> 0
+
+ddctm031 comparetotmag -20 -20 -> 0
+ddctm032 comparetotmag -20 -10 -> 1
+ddctm033 comparetotmag -20 00 -> 1
+ddctm034 comparetotmag -20 10 -> 1
+ddctm035 comparetotmag -20 20 -> 0
+ddctm036 comparetotmag -10 -20 -> -1
+ddctm037 comparetotmag -10 -10 -> 0
+ddctm038 comparetotmag -10 00 -> 1
+ddctm039 comparetotmag -10 10 -> 0
+ddctm040 comparetotmag -10 20 -> -1
+ddctm041 comparetotmag 00 -20 -> -1
+ddctm042 comparetotmag 00 -10 -> -1
+ddctm043 comparetotmag 00 00 -> 0
+ddctm044 comparetotmag 00 10 -> -1
+ddctm045 comparetotmag 00 20 -> -1
+ddctm046 comparetotmag 10 -20 -> -1
+ddctm047 comparetotmag 10 -10 -> 0
+ddctm048 comparetotmag 10 00 -> 1
+ddctm049 comparetotmag 10 10 -> 0
+ddctm050 comparetotmag 10 20 -> -1
+ddctm051 comparetotmag 20 -20 -> 0
+ddctm052 comparetotmag 20 -10 -> 1
+ddctm053 comparetotmag 20 00 -> 1
+ddctm055 comparetotmag 20 10 -> 1
+ddctm056 comparetotmag 20 20 -> 0
+
+ddctm061 comparetotmag -2.0 -2.0 -> 0
+ddctm062 comparetotmag -2.0 -1.0 -> 1
+ddctm063 comparetotmag -2.0 0.0 -> 1
+ddctm064 comparetotmag -2.0 1.0 -> 1
+ddctm065 comparetotmag -2.0 2.0 -> 0
+ddctm066 comparetotmag -1.0 -2.0 -> -1
+ddctm067 comparetotmag -1.0 -1.0 -> 0
+ddctm068 comparetotmag -1.0 0.0 -> 1
+ddctm069 comparetotmag -1.0 1.0 -> 0
+ddctm070 comparetotmag -1.0 2.0 -> -1
+ddctm071 comparetotmag 0.0 -2.0 -> -1
+ddctm072 comparetotmag 0.0 -1.0 -> -1
+ddctm073 comparetotmag 0.0 0.0 -> 0
+ddctm074 comparetotmag 0.0 1.0 -> -1
+ddctm075 comparetotmag 0.0 2.0 -> -1
+ddctm076 comparetotmag 1.0 -2.0 -> -1
+ddctm077 comparetotmag 1.0 -1.0 -> 0
+ddctm078 comparetotmag 1.0 0.0 -> 1
+ddctm079 comparetotmag 1.0 1.0 -> 0
+ddctm080 comparetotmag 1.0 2.0 -> -1
+ddctm081 comparetotmag 2.0 -2.0 -> 0
+ddctm082 comparetotmag 2.0 -1.0 -> 1
+ddctm083 comparetotmag 2.0 0.0 -> 1
+ddctm085 comparetotmag 2.0 1.0 -> 1
+ddctm086 comparetotmag 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+ddctm090 comparetotmag 9.99999999E+384 9.99999999E+384 -> 0
+ddctm091 comparetotmag -9.99999999E+384 9.99999999E+384 -> 0
+ddctm092 comparetotmag 9.99999999E+384 -9.99999999E+384 -> 0
+ddctm093 comparetotmag -9.99999999E+384 -9.99999999E+384 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+ddctm100 comparetotmag 7.0 7.0 -> 0
+ddctm101 comparetotmag 7.0 7 -> -1
+ddctm102 comparetotmag 7 7.0 -> 1
+ddctm103 comparetotmag 7E+0 7.0 -> 1
+ddctm104 comparetotmag 70E-1 7.0 -> 0
+ddctm105 comparetotmag 0.7E+1 7 -> 0
+ddctm106 comparetotmag 70E-1 7 -> -1
+ddctm107 comparetotmag 7.0 7E+0 -> -1
+ddctm108 comparetotmag 7.0 70E-1 -> 0
+ddctm109 comparetotmag 7 0.7E+1 -> 0
+ddctm110 comparetotmag 7 70E-1 -> 1
+
+ddctm120 comparetotmag 8.0 7.0 -> 1
+ddctm121 comparetotmag 8.0 7 -> 1
+ddctm122 comparetotmag 8 7.0 -> 1
+ddctm123 comparetotmag 8E+0 7.0 -> 1
+ddctm124 comparetotmag 80E-1 7.0 -> 1
+ddctm125 comparetotmag 0.8E+1 7 -> 1
+ddctm126 comparetotmag 80E-1 7 -> 1
+ddctm127 comparetotmag 8.0 7E+0 -> 1
+ddctm128 comparetotmag 8.0 70E-1 -> 1
+ddctm129 comparetotmag 8 0.7E+1 -> 1
+ddctm130 comparetotmag 8 70E-1 -> 1
+
+ddctm140 comparetotmag 8.0 9.0 -> -1
+ddctm141 comparetotmag 8.0 9 -> -1
+ddctm142 comparetotmag 8 9.0 -> -1
+ddctm143 comparetotmag 8E+0 9.0 -> -1
+ddctm144 comparetotmag 80E-1 9.0 -> -1
+ddctm145 comparetotmag 0.8E+1 9 -> -1
+ddctm146 comparetotmag 80E-1 9 -> -1
+ddctm147 comparetotmag 8.0 9E+0 -> -1
+ddctm148 comparetotmag 8.0 90E-1 -> -1
+ddctm149 comparetotmag 8 0.9E+1 -> -1
+ddctm150 comparetotmag 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ddctm200 comparetotmag -7.0 7.0 -> 0
+ddctm201 comparetotmag -7.0 7 -> -1
+ddctm202 comparetotmag -7 7.0 -> 1
+ddctm203 comparetotmag -7E+0 7.0 -> 1
+ddctm204 comparetotmag -70E-1 7.0 -> 0
+ddctm205 comparetotmag -0.7E+1 7 -> 0
+ddctm206 comparetotmag -70E-1 7 -> -1
+ddctm207 comparetotmag -7.0 7E+0 -> -1
+ddctm208 comparetotmag -7.0 70E-1 -> 0
+ddctm209 comparetotmag -7 0.7E+1 -> 0
+ddctm210 comparetotmag -7 70E-1 -> 1
+
+ddctm220 comparetotmag -8.0 7.0 -> 1
+ddctm221 comparetotmag -8.0 7 -> 1
+ddctm222 comparetotmag -8 7.0 -> 1
+ddctm223 comparetotmag -8E+0 7.0 -> 1
+ddctm224 comparetotmag -80E-1 7.0 -> 1
+ddctm225 comparetotmag -0.8E+1 7 -> 1
+ddctm226 comparetotmag -80E-1 7 -> 1
+ddctm227 comparetotmag -8.0 7E+0 -> 1
+ddctm228 comparetotmag -8.0 70E-1 -> 1
+ddctm229 comparetotmag -8 0.7E+1 -> 1
+ddctm230 comparetotmag -8 70E-1 -> 1
+
+ddctm240 comparetotmag -8.0 9.0 -> -1
+ddctm241 comparetotmag -8.0 9 -> -1
+ddctm242 comparetotmag -8 9.0 -> -1
+ddctm243 comparetotmag -8E+0 9.0 -> -1
+ddctm244 comparetotmag -80E-1 9.0 -> -1
+ddctm245 comparetotmag -0.8E+1 9 -> -1
+ddctm246 comparetotmag -80E-1 9 -> -1
+ddctm247 comparetotmag -8.0 9E+0 -> -1
+ddctm248 comparetotmag -8.0 90E-1 -> -1
+ddctm249 comparetotmag -8 0.9E+1 -> -1
+ddctm250 comparetotmag -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ddctm300 comparetotmag 7.0 -7.0 -> 0
+ddctm301 comparetotmag 7.0 -7 -> -1
+ddctm302 comparetotmag 7 -7.0 -> 1
+ddctm303 comparetotmag 7E+0 -7.0 -> 1
+ddctm304 comparetotmag 70E-1 -7.0 -> 0
+ddctm305 comparetotmag .7E+1 -7 -> 0
+ddctm306 comparetotmag 70E-1 -7 -> -1
+ddctm307 comparetotmag 7.0 -7E+0 -> -1
+ddctm308 comparetotmag 7.0 -70E-1 -> 0
+ddctm309 comparetotmag 7 -.7E+1 -> 0
+ddctm310 comparetotmag 7 -70E-1 -> 1
+
+ddctm320 comparetotmag 8.0 -7.0 -> 1
+ddctm321 comparetotmag 8.0 -7 -> 1
+ddctm322 comparetotmag 8 -7.0 -> 1
+ddctm323 comparetotmag 8E+0 -7.0 -> 1
+ddctm324 comparetotmag 80E-1 -7.0 -> 1
+ddctm325 comparetotmag .8E+1 -7 -> 1
+ddctm326 comparetotmag 80E-1 -7 -> 1
+ddctm327 comparetotmag 8.0 -7E+0 -> 1
+ddctm328 comparetotmag 8.0 -70E-1 -> 1
+ddctm329 comparetotmag 8 -.7E+1 -> 1
+ddctm330 comparetotmag 8 -70E-1 -> 1
+
+ddctm340 comparetotmag 8.0 -9.0 -> -1
+ddctm341 comparetotmag 8.0 -9 -> -1
+ddctm342 comparetotmag 8 -9.0 -> -1
+ddctm343 comparetotmag 8E+0 -9.0 -> -1
+ddctm344 comparetotmag 80E-1 -9.0 -> -1
+ddctm345 comparetotmag .8E+1 -9 -> -1
+ddctm346 comparetotmag 80E-1 -9 -> -1
+ddctm347 comparetotmag 8.0 -9E+0 -> -1
+ddctm348 comparetotmag 8.0 -90E-1 -> -1
+ddctm349 comparetotmag 8 -.9E+1 -> -1
+ddctm350 comparetotmag 8 -90E-1 -> -1
+
+-- and again, with sign changes -- ..
+ddctm400 comparetotmag -7.0 -7.0 -> 0
+ddctm401 comparetotmag -7.0 -7 -> -1
+ddctm402 comparetotmag -7 -7.0 -> 1
+ddctm403 comparetotmag -7E+0 -7.0 -> 1
+ddctm404 comparetotmag -70E-1 -7.0 -> 0
+ddctm405 comparetotmag -.7E+1 -7 -> 0
+ddctm406 comparetotmag -70E-1 -7 -> -1
+ddctm407 comparetotmag -7.0 -7E+0 -> -1
+ddctm408 comparetotmag -7.0 -70E-1 -> 0
+ddctm409 comparetotmag -7 -.7E+1 -> 0
+ddctm410 comparetotmag -7 -70E-1 -> 1
+
+ddctm420 comparetotmag -8.0 -7.0 -> 1
+ddctm421 comparetotmag -8.0 -7 -> 1
+ddctm422 comparetotmag -8 -7.0 -> 1
+ddctm423 comparetotmag -8E+0 -7.0 -> 1
+ddctm424 comparetotmag -80E-1 -7.0 -> 1
+ddctm425 comparetotmag -.8E+1 -7 -> 1
+ddctm426 comparetotmag -80E-1 -7 -> 1
+ddctm427 comparetotmag -8.0 -7E+0 -> 1
+ddctm428 comparetotmag -8.0 -70E-1 -> 1
+ddctm429 comparetotmag -8 -.7E+1 -> 1
+ddctm430 comparetotmag -8 -70E-1 -> 1
+
+ddctm440 comparetotmag -8.0 -9.0 -> -1
+ddctm441 comparetotmag -8.0 -9 -> -1
+ddctm442 comparetotmag -8 -9.0 -> -1
+ddctm443 comparetotmag -8E+0 -9.0 -> -1
+ddctm444 comparetotmag -80E-1 -9.0 -> -1
+ddctm445 comparetotmag -.8E+1 -9 -> -1
+ddctm446 comparetotmag -80E-1 -9 -> -1
+ddctm447 comparetotmag -8.0 -9E+0 -> -1
+ddctm448 comparetotmag -8.0 -90E-1 -> -1
+ddctm449 comparetotmag -8 -.9E+1 -> -1
+ddctm450 comparetotmag -8 -90E-1 -> -1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+ddctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
+ddctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
+ddctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
+ddctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
+ddctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
+ddctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
+ddctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
+ddctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
+ddctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
+ddctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
+ddctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
+ddctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
+ddctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
+ddctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
+ddctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
+ddctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
+ddctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
+ddctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
+ddctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
+ddctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
+ddctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
+ddctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+ddctm498 comparetotmag 1 1E-17 -> 1
+ddctm499 comparetotmag 1 1E-16 -> 1
+ddctm500 comparetotmag 1 1E-15 -> 1
+ddctm501 comparetotmag 1 1E-14 -> 1
+ddctm502 comparetotmag 1 1E-13 -> 1
+ddctm503 comparetotmag 1 1E-12 -> 1
+ddctm504 comparetotmag 1 1E-11 -> 1
+ddctm505 comparetotmag 1 1E-10 -> 1
+ddctm506 comparetotmag 1 1E-9 -> 1
+ddctm507 comparetotmag 1 1E-8 -> 1
+ddctm508 comparetotmag 1 1E-7 -> 1
+ddctm509 comparetotmag 1 1E-6 -> 1
+ddctm510 comparetotmag 1 1E-5 -> 1
+ddctm511 comparetotmag 1 1E-4 -> 1
+ddctm512 comparetotmag 1 1E-3 -> 1
+ddctm513 comparetotmag 1 1E-2 -> 1
+ddctm514 comparetotmag 1 1E-1 -> 1
+ddctm515 comparetotmag 1 1E-0 -> 0
+ddctm516 comparetotmag 1 1E+1 -> -1
+ddctm517 comparetotmag 1 1E+2 -> -1
+ddctm518 comparetotmag 1 1E+3 -> -1
+ddctm519 comparetotmag 1 1E+4 -> -1
+ddctm521 comparetotmag 1 1E+5 -> -1
+ddctm522 comparetotmag 1 1E+6 -> -1
+ddctm523 comparetotmag 1 1E+7 -> -1
+ddctm524 comparetotmag 1 1E+8 -> -1
+ddctm525 comparetotmag 1 1E+9 -> -1
+ddctm526 comparetotmag 1 1E+10 -> -1
+ddctm527 comparetotmag 1 1E+11 -> -1
+ddctm528 comparetotmag 1 1E+12 -> -1
+ddctm529 comparetotmag 1 1E+13 -> -1
+ddctm530 comparetotmag 1 1E+14 -> -1
+ddctm531 comparetotmag 1 1E+15 -> -1
+ddctm532 comparetotmag 1 1E+16 -> -1
+ddctm533 comparetotmag 1 1E+17 -> -1
+-- LR swap
+ddctm538 comparetotmag 1E-17 1 -> -1
+ddctm539 comparetotmag 1E-16 1 -> -1
+ddctm540 comparetotmag 1E-15 1 -> -1
+ddctm541 comparetotmag 1E-14 1 -> -1
+ddctm542 comparetotmag 1E-13 1 -> -1
+ddctm543 comparetotmag 1E-12 1 -> -1
+ddctm544 comparetotmag 1E-11 1 -> -1
+ddctm545 comparetotmag 1E-10 1 -> -1
+ddctm546 comparetotmag 1E-9 1 -> -1
+ddctm547 comparetotmag 1E-8 1 -> -1
+ddctm548 comparetotmag 1E-7 1 -> -1
+ddctm549 comparetotmag 1E-6 1 -> -1
+ddctm550 comparetotmag 1E-5 1 -> -1
+ddctm551 comparetotmag 1E-4 1 -> -1
+ddctm552 comparetotmag 1E-3 1 -> -1
+ddctm553 comparetotmag 1E-2 1 -> -1
+ddctm554 comparetotmag 1E-1 1 -> -1
+ddctm555 comparetotmag 1E-0 1 -> 0
+ddctm556 comparetotmag 1E+1 1 -> 1
+ddctm557 comparetotmag 1E+2 1 -> 1
+ddctm558 comparetotmag 1E+3 1 -> 1
+ddctm559 comparetotmag 1E+4 1 -> 1
+ddctm561 comparetotmag 1E+5 1 -> 1
+ddctm562 comparetotmag 1E+6 1 -> 1
+ddctm563 comparetotmag 1E+7 1 -> 1
+ddctm564 comparetotmag 1E+8 1 -> 1
+ddctm565 comparetotmag 1E+9 1 -> 1
+ddctm566 comparetotmag 1E+10 1 -> 1
+ddctm567 comparetotmag 1E+11 1 -> 1
+ddctm568 comparetotmag 1E+12 1 -> 1
+ddctm569 comparetotmag 1E+13 1 -> 1
+ddctm570 comparetotmag 1E+14 1 -> 1
+ddctm571 comparetotmag 1E+15 1 -> 1
+ddctm572 comparetotmag 1E+16 1 -> 1
+ddctm573 comparetotmag 1E+17 1 -> 1
+-- similar with a useful coefficient, one side only
+ddctm578 comparetotmag 0.000000987654321 1E-17 -> 1
+ddctm579 comparetotmag 0.000000987654321 1E-16 -> 1
+ddctm580 comparetotmag 0.000000987654321 1E-15 -> 1
+ddctm581 comparetotmag 0.000000987654321 1E-14 -> 1
+ddctm582 comparetotmag 0.000000987654321 1E-13 -> 1
+ddctm583 comparetotmag 0.000000987654321 1E-12 -> 1
+ddctm584 comparetotmag 0.000000987654321 1E-11 -> 1
+ddctm585 comparetotmag 0.000000987654321 1E-10 -> 1
+ddctm586 comparetotmag 0.000000987654321 1E-9 -> 1
+ddctm587 comparetotmag 0.000000987654321 1E-8 -> 1
+ddctm588 comparetotmag 0.000000987654321 1E-7 -> 1
+ddctm589 comparetotmag 0.000000987654321 1E-6 -> -1
+ddctm590 comparetotmag 0.000000987654321 1E-5 -> -1
+ddctm591 comparetotmag 0.000000987654321 1E-4 -> -1
+ddctm592 comparetotmag 0.000000987654321 1E-3 -> -1
+ddctm593 comparetotmag 0.000000987654321 1E-2 -> -1
+ddctm594 comparetotmag 0.000000987654321 1E-1 -> -1
+ddctm595 comparetotmag 0.000000987654321 1E-0 -> -1
+ddctm596 comparetotmag 0.000000987654321 1E+1 -> -1
+ddctm597 comparetotmag 0.000000987654321 1E+2 -> -1
+ddctm598 comparetotmag 0.000000987654321 1E+3 -> -1
+ddctm599 comparetotmag 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+ddctm600 comparetotmag 12 12.2345 -> -1
+ddctm601 comparetotmag 12.0 12.2345 -> -1
+ddctm602 comparetotmag 12.00 12.2345 -> -1
+ddctm603 comparetotmag 12.000 12.2345 -> -1
+ddctm604 comparetotmag 12.0000 12.2345 -> -1
+ddctm605 comparetotmag 12.00000 12.2345 -> -1
+ddctm606 comparetotmag 12.000000 12.2345 -> -1
+ddctm607 comparetotmag 12.0000000 12.2345 -> -1
+ddctm608 comparetotmag 12.00000000 12.2345 -> -1
+ddctm609 comparetotmag 12.000000000 12.2345 -> -1
+ddctm610 comparetotmag 12.1234 12 -> 1
+ddctm611 comparetotmag 12.1234 12.0 -> 1
+ddctm612 comparetotmag 12.1234 12.00 -> 1
+ddctm613 comparetotmag 12.1234 12.000 -> 1
+ddctm614 comparetotmag 12.1234 12.0000 -> 1
+ddctm615 comparetotmag 12.1234 12.00000 -> 1
+ddctm616 comparetotmag 12.1234 12.000000 -> 1
+ddctm617 comparetotmag 12.1234 12.0000000 -> 1
+ddctm618 comparetotmag 12.1234 12.00000000 -> 1
+ddctm619 comparetotmag 12.1234 12.000000000 -> 1
+ddctm620 comparetotmag -12 -12.2345 -> -1
+ddctm621 comparetotmag -12.0 -12.2345 -> -1
+ddctm622 comparetotmag -12.00 -12.2345 -> -1
+ddctm623 comparetotmag -12.000 -12.2345 -> -1
+ddctm624 comparetotmag -12.0000 -12.2345 -> -1
+ddctm625 comparetotmag -12.00000 -12.2345 -> -1
+ddctm626 comparetotmag -12.000000 -12.2345 -> -1
+ddctm627 comparetotmag -12.0000000 -12.2345 -> -1
+ddctm628 comparetotmag -12.00000000 -12.2345 -> -1
+ddctm629 comparetotmag -12.000000000 -12.2345 -> -1
+ddctm630 comparetotmag -12.1234 -12 -> 1
+ddctm631 comparetotmag -12.1234 -12.0 -> 1
+ddctm632 comparetotmag -12.1234 -12.00 -> 1
+ddctm633 comparetotmag -12.1234 -12.000 -> 1
+ddctm634 comparetotmag -12.1234 -12.0000 -> 1
+ddctm635 comparetotmag -12.1234 -12.00000 -> 1
+ddctm636 comparetotmag -12.1234 -12.000000 -> 1
+ddctm637 comparetotmag -12.1234 -12.0000000 -> 1
+ddctm638 comparetotmag -12.1234 -12.00000000 -> 1
+ddctm639 comparetotmag -12.1234 -12.000000000 -> 1
+
+-- extended zeros
+ddctm640 comparetotmag 0 0 -> 0
+ddctm641 comparetotmag 0 -0 -> 0
+ddctm642 comparetotmag 0 -0.0 -> 1
+ddctm643 comparetotmag 0 0.0 -> 1
+ddctm644 comparetotmag -0 0 -> 0
+ddctm645 comparetotmag -0 -0 -> 0
+ddctm646 comparetotmag -0 -0.0 -> 1
+ddctm647 comparetotmag -0 0.0 -> 1
+ddctm648 comparetotmag 0.0 0 -> -1
+ddctm649 comparetotmag 0.0 -0 -> -1
+ddctm650 comparetotmag 0.0 -0.0 -> 0
+ddctm651 comparetotmag 0.0 0.0 -> 0
+ddctm652 comparetotmag -0.0 0 -> -1
+ddctm653 comparetotmag -0.0 -0 -> -1
+ddctm654 comparetotmag -0.0 -0.0 -> 0
+ddctm655 comparetotmag -0.0 0.0 -> 0
+
+ddctm656 comparetotmag -0E1 0.0 -> 1
+ddctm657 comparetotmag -0E2 0.0 -> 1
+ddctm658 comparetotmag 0E1 0.0 -> 1
+ddctm659 comparetotmag 0E2 0.0 -> 1
+ddctm660 comparetotmag -0E1 0 -> 1
+ddctm661 comparetotmag -0E2 0 -> 1
+ddctm662 comparetotmag 0E1 0 -> 1
+ddctm663 comparetotmag 0E2 0 -> 1
+ddctm664 comparetotmag -0E1 -0E1 -> 0
+ddctm665 comparetotmag -0E2 -0E1 -> 1
+ddctm666 comparetotmag 0E1 -0E1 -> 0
+ddctm667 comparetotmag 0E2 -0E1 -> 1
+ddctm668 comparetotmag -0E1 -0E2 -> -1
+ddctm669 comparetotmag -0E2 -0E2 -> 0
+ddctm670 comparetotmag 0E1 -0E2 -> -1
+ddctm671 comparetotmag 0E2 -0E2 -> 0
+ddctm672 comparetotmag -0E1 0E1 -> 0
+ddctm673 comparetotmag -0E2 0E1 -> 1
+ddctm674 comparetotmag 0E1 0E1 -> 0
+ddctm675 comparetotmag 0E2 0E1 -> 1
+ddctm676 comparetotmag -0E1 0E2 -> -1
+ddctm677 comparetotmag -0E2 0E2 -> 0
+ddctm678 comparetotmag 0E1 0E2 -> -1
+ddctm679 comparetotmag 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+ddctm680 comparetotmag 12 12 -> 0
+ddctm681 comparetotmag 12 12.0 -> 1
+ddctm682 comparetotmag 12 12.00 -> 1
+ddctm683 comparetotmag 12 12.000 -> 1
+ddctm684 comparetotmag 12 12.0000 -> 1
+ddctm685 comparetotmag 12 12.00000 -> 1
+ddctm686 comparetotmag 12 12.000000 -> 1
+ddctm687 comparetotmag 12 12.0000000 -> 1
+ddctm688 comparetotmag 12 12.00000000 -> 1
+ddctm689 comparetotmag 12 12.000000000 -> 1
+ddctm690 comparetotmag 12 12 -> 0
+ddctm691 comparetotmag 12.0 12 -> -1
+ddctm692 comparetotmag 12.00 12 -> -1
+ddctm693 comparetotmag 12.000 12 -> -1
+ddctm694 comparetotmag 12.0000 12 -> -1
+ddctm695 comparetotmag 12.00000 12 -> -1
+ddctm696 comparetotmag 12.000000 12 -> -1
+ddctm697 comparetotmag 12.0000000 12 -> -1
+ddctm698 comparetotmag 12.00000000 12 -> -1
+ddctm699 comparetotmag 12.000000000 12 -> -1
+
+-- old long operand checks
+ddctm701 comparetotmag 12345678000 1 -> 1
+ddctm702 comparetotmag 1 12345678000 -> -1
+ddctm703 comparetotmag 1234567800 1 -> 1
+ddctm704 comparetotmag 1 1234567800 -> -1
+ddctm705 comparetotmag 1234567890 1 -> 1
+ddctm706 comparetotmag 1 1234567890 -> -1
+ddctm707 comparetotmag 1234567891 1 -> 1
+ddctm708 comparetotmag 1 1234567891 -> -1
+ddctm709 comparetotmag 12345678901 1 -> 1
+ddctm710 comparetotmag 1 12345678901 -> -1
+ddctm711 comparetotmag 1234567896 1 -> 1
+ddctm712 comparetotmag 1 1234567896 -> -1
+ddctm713 comparetotmag -1234567891 1 -> 1
+ddctm714 comparetotmag 1 -1234567891 -> -1
+ddctm715 comparetotmag -12345678901 1 -> 1
+ddctm716 comparetotmag 1 -12345678901 -> -1
+ddctm717 comparetotmag -1234567896 1 -> 1
+ddctm718 comparetotmag 1 -1234567896 -> -1
+
+-- old residue cases
+ddctm740 comparetotmag 1 0.9999999 -> 1
+ddctm741 comparetotmag 1 0.999999 -> 1
+ddctm742 comparetotmag 1 0.99999 -> 1
+ddctm743 comparetotmag 1 1.0000 -> 1
+ddctm744 comparetotmag 1 1.00001 -> -1
+ddctm745 comparetotmag 1 1.000001 -> -1
+ddctm746 comparetotmag 1 1.0000001 -> -1
+ddctm750 comparetotmag 0.9999999 1 -> -1
+ddctm751 comparetotmag 0.999999 1 -> -1
+ddctm752 comparetotmag 0.99999 1 -> -1
+ddctm753 comparetotmag 1.0000 1 -> -1
+ddctm754 comparetotmag 1.00001 1 -> 1
+ddctm755 comparetotmag 1.000001 1 -> 1
+ddctm756 comparetotmag 1.0000001 1 -> 1
+
+-- Specials
+ddctm780 comparetotmag Inf -Inf -> 0
+ddctm781 comparetotmag Inf -1000 -> 1
+ddctm782 comparetotmag Inf -1 -> 1
+ddctm783 comparetotmag Inf -0 -> 1
+ddctm784 comparetotmag Inf 0 -> 1
+ddctm785 comparetotmag Inf 1 -> 1
+ddctm786 comparetotmag Inf 1000 -> 1
+ddctm787 comparetotmag Inf Inf -> 0
+ddctm788 comparetotmag -1000 Inf -> -1
+ddctm789 comparetotmag -Inf Inf -> 0
+ddctm790 comparetotmag -1 Inf -> -1
+ddctm791 comparetotmag -0 Inf -> -1
+ddctm792 comparetotmag 0 Inf -> -1
+ddctm793 comparetotmag 1 Inf -> -1
+ddctm794 comparetotmag 1000 Inf -> -1
+ddctm795 comparetotmag Inf Inf -> 0
+
+ddctm800 comparetotmag -Inf -Inf -> 0
+ddctm801 comparetotmag -Inf -1000 -> 1
+ddctm802 comparetotmag -Inf -1 -> 1
+ddctm803 comparetotmag -Inf -0 -> 1
+ddctm804 comparetotmag -Inf 0 -> 1
+ddctm805 comparetotmag -Inf 1 -> 1
+ddctm806 comparetotmag -Inf 1000 -> 1
+ddctm807 comparetotmag -Inf Inf -> 0
+ddctm808 comparetotmag -Inf -Inf -> 0
+ddctm809 comparetotmag -1000 -Inf -> -1
+ddctm810 comparetotmag -1 -Inf -> -1
+ddctm811 comparetotmag -0 -Inf -> -1
+ddctm812 comparetotmag 0 -Inf -> -1
+ddctm813 comparetotmag 1 -Inf -> -1
+ddctm814 comparetotmag 1000 -Inf -> -1
+ddctm815 comparetotmag Inf -Inf -> 0
+
+ddctm821 comparetotmag NaN -Inf -> 1
+ddctm822 comparetotmag NaN -1000 -> 1
+ddctm823 comparetotmag NaN -1 -> 1
+ddctm824 comparetotmag NaN -0 -> 1
+ddctm825 comparetotmag NaN 0 -> 1
+ddctm826 comparetotmag NaN 1 -> 1
+ddctm827 comparetotmag NaN 1000 -> 1
+ddctm828 comparetotmag NaN Inf -> 1
+ddctm829 comparetotmag NaN NaN -> 0
+ddctm830 comparetotmag -Inf NaN -> -1
+ddctm831 comparetotmag -1000 NaN -> -1
+ddctm832 comparetotmag -1 NaN -> -1
+ddctm833 comparetotmag -0 NaN -> -1
+ddctm834 comparetotmag 0 NaN -> -1
+ddctm835 comparetotmag 1 NaN -> -1
+ddctm836 comparetotmag 1000 NaN -> -1
+ddctm837 comparetotmag Inf NaN -> -1
+ddctm838 comparetotmag -NaN -NaN -> 0
+ddctm839 comparetotmag +NaN -NaN -> 0
+ddctm840 comparetotmag -NaN +NaN -> 0
+
+ddctm841 comparetotmag sNaN -sNaN -> 0
+ddctm842 comparetotmag sNaN -NaN -> -1
+ddctm843 comparetotmag sNaN -Inf -> 1
+ddctm844 comparetotmag sNaN -1000 -> 1
+ddctm845 comparetotmag sNaN -1 -> 1
+ddctm846 comparetotmag sNaN -0 -> 1
+ddctm847 comparetotmag sNaN 0 -> 1
+ddctm848 comparetotmag sNaN 1 -> 1
+ddctm849 comparetotmag sNaN 1000 -> 1
+ddctm850 comparetotmag sNaN NaN -> -1
+ddctm851 comparetotmag sNaN sNaN -> 0
+
+ddctm852 comparetotmag -sNaN sNaN -> 0
+ddctm853 comparetotmag -NaN sNaN -> 1
+ddctm854 comparetotmag -Inf sNaN -> -1
+ddctm855 comparetotmag -1000 sNaN -> -1
+ddctm856 comparetotmag -1 sNaN -> -1
+ddctm857 comparetotmag -0 sNaN -> -1
+ddctm858 comparetotmag 0 sNaN -> -1
+ddctm859 comparetotmag 1 sNaN -> -1
+ddctm860 comparetotmag 1000 sNaN -> -1
+ddctm861 comparetotmag Inf sNaN -> -1
+ddctm862 comparetotmag NaN sNaN -> 1
+ddctm863 comparetotmag sNaN sNaN -> 0
+
+ddctm871 comparetotmag -sNaN -sNaN -> 0
+ddctm872 comparetotmag -sNaN -NaN -> -1
+ddctm873 comparetotmag -sNaN -Inf -> 1
+ddctm874 comparetotmag -sNaN -1000 -> 1
+ddctm875 comparetotmag -sNaN -1 -> 1
+ddctm876 comparetotmag -sNaN -0 -> 1
+ddctm877 comparetotmag -sNaN 0 -> 1
+ddctm878 comparetotmag -sNaN 1 -> 1
+ddctm879 comparetotmag -sNaN 1000 -> 1
+ddctm880 comparetotmag -sNaN NaN -> -1
+ddctm881 comparetotmag -sNaN sNaN -> 0
+
+ddctm882 comparetotmag -sNaN -sNaN -> 0
+ddctm883 comparetotmag -NaN -sNaN -> 1
+ddctm884 comparetotmag -Inf -sNaN -> -1
+ddctm885 comparetotmag -1000 -sNaN -> -1
+ddctm886 comparetotmag -1 -sNaN -> -1
+ddctm887 comparetotmag -0 -sNaN -> -1
+ddctm888 comparetotmag 0 -sNaN -> -1
+ddctm889 comparetotmag 1 -sNaN -> -1
+ddctm890 comparetotmag 1000 -sNaN -> -1
+ddctm891 comparetotmag Inf -sNaN -> -1
+ddctm892 comparetotmag NaN -sNaN -> 1
+ddctm893 comparetotmag sNaN -sNaN -> 0
+
+-- NaNs with payload
+ddctm960 comparetotmag NaN9 -Inf -> 1
+ddctm961 comparetotmag NaN8 999 -> 1
+ddctm962 comparetotmag NaN77 Inf -> 1
+ddctm963 comparetotmag -NaN67 NaN5 -> 1
+ddctm964 comparetotmag -Inf -NaN4 -> -1
+ddctm965 comparetotmag -999 -NaN33 -> -1
+ddctm966 comparetotmag Inf NaN2 -> -1
+
+ddctm970 comparetotmag -NaN41 -NaN42 -> -1
+ddctm971 comparetotmag +NaN41 -NaN42 -> -1
+ddctm972 comparetotmag -NaN41 +NaN42 -> -1
+ddctm973 comparetotmag +NaN41 +NaN42 -> -1
+ddctm974 comparetotmag -NaN42 -NaN01 -> 1
+ddctm975 comparetotmag +NaN42 -NaN01 -> 1
+ddctm976 comparetotmag -NaN42 +NaN01 -> 1
+ddctm977 comparetotmag +NaN42 +NaN01 -> 1
+
+ddctm980 comparetotmag -sNaN771 -sNaN772 -> -1
+ddctm981 comparetotmag +sNaN771 -sNaN772 -> -1
+ddctm982 comparetotmag -sNaN771 +sNaN772 -> -1
+ddctm983 comparetotmag +sNaN771 +sNaN772 -> -1
+ddctm984 comparetotmag -sNaN772 -sNaN771 -> 1
+ddctm985 comparetotmag +sNaN772 -sNaN771 -> 1
+ddctm986 comparetotmag -sNaN772 +sNaN771 -> 1
+ddctm987 comparetotmag +sNaN772 +sNaN771 -> 1
+
+ddctm991 comparetotmag -sNaN99 -Inf -> 1
+ddctm992 comparetotmag sNaN98 -11 -> 1
+ddctm993 comparetotmag sNaN97 NaN -> -1
+ddctm994 comparetotmag sNaN16 sNaN94 -> -1
+ddctm995 comparetotmag NaN85 sNaN83 -> 1
+ddctm996 comparetotmag -Inf sNaN92 -> -1
+ddctm997 comparetotmag 088 sNaN81 -> -1
+ddctm998 comparetotmag Inf sNaN90 -> -1
+ddctm999 comparetotmag NaN -sNaN89 -> 1
+
+-- spread zeros
+ddctm1110 comparetotmag 0E-383 0 -> -1
+ddctm1111 comparetotmag 0E-383 -0 -> -1
+ddctm1112 comparetotmag -0E-383 0 -> -1
+ddctm1113 comparetotmag -0E-383 -0 -> -1
+ddctm1114 comparetotmag 0E-383 0E+384 -> -1
+ddctm1115 comparetotmag 0E-383 -0E+384 -> -1
+ddctm1116 comparetotmag -0E-383 0E+384 -> -1
+ddctm1117 comparetotmag -0E-383 -0E+384 -> -1
+ddctm1118 comparetotmag 0 0E+384 -> -1
+ddctm1119 comparetotmag 0 -0E+384 -> -1
+ddctm1120 comparetotmag -0 0E+384 -> -1
+ddctm1121 comparetotmag -0 -0E+384 -> -1
+
+ddctm1130 comparetotmag 0E+384 0 -> 1
+ddctm1131 comparetotmag 0E+384 -0 -> 1
+ddctm1132 comparetotmag -0E+384 0 -> 1
+ddctm1133 comparetotmag -0E+384 -0 -> 1
+ddctm1134 comparetotmag 0E+384 0E-383 -> 1
+ddctm1135 comparetotmag 0E+384 -0E-383 -> 1
+ddctm1136 comparetotmag -0E+384 0E-383 -> 1
+ddctm1137 comparetotmag -0E+384 -0E-383 -> 1
+ddctm1138 comparetotmag 0 0E-383 -> 1
+ddctm1139 comparetotmag 0 -0E-383 -> 1
+ddctm1140 comparetotmag -0 0E-383 -> 1
+ddctm1141 comparetotmag -0 -0E-383 -> 1
+
+-- Null tests
+ddctm9990 comparetotmag 10 # -> NaN Invalid_operation
+ddctm9991 comparetotmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddCopy.decTest b/Lib/test/decimaltestdata/ddCopy.decTest
index 9a175c5ea7..f99d86a426 100644
--- a/Lib/test/decimaltestdata/ddCopy.decTest
+++ b/Lib/test/decimaltestdata/ddCopy.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddCopy.decTest -- quiet decDouble copy --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddcpy001 copy +7.50 -> 7.50
-
--- Infinities
-ddcpy011 copy Infinity -> Infinity
-ddcpy012 copy -Infinity -> -Infinity
-
--- NaNs, 0 payload
-ddcpy021 copy NaN -> NaN
-ddcpy022 copy -NaN -> -NaN
-ddcpy023 copy sNaN -> sNaN
-ddcpy024 copy -sNaN -> -sNaN
-
--- NaNs, non-0 payload
-ddcpy031 copy NaN10 -> NaN10
-ddcpy032 copy -NaN10 -> -NaN10
-ddcpy033 copy sNaN10 -> sNaN10
-ddcpy034 copy -sNaN10 -> -sNaN10
-ddcpy035 copy NaN7 -> NaN7
-ddcpy036 copy -NaN7 -> -NaN7
-ddcpy037 copy sNaN101 -> sNaN101
-ddcpy038 copy -sNaN101 -> -sNaN101
-
--- finites
-ddcpy101 copy 7 -> 7
-ddcpy102 copy -7 -> -7
-ddcpy103 copy 75 -> 75
-ddcpy104 copy -75 -> -75
-ddcpy105 copy 7.50 -> 7.50
-ddcpy106 copy -7.50 -> -7.50
-ddcpy107 copy 7.500 -> 7.500
-ddcpy108 copy -7.500 -> -7.500
-
--- zeros
-ddcpy111 copy 0 -> 0
-ddcpy112 copy -0 -> -0
-ddcpy113 copy 0E+4 -> 0E+4
-ddcpy114 copy -0E+4 -> -0E+4
-ddcpy115 copy 0.0000 -> 0.0000
-ddcpy116 copy -0.0000 -> -0.0000
-ddcpy117 copy 0E-141 -> 0E-141
-ddcpy118 copy -0E-141 -> -0E-141
-
--- full coefficients, alternating bits
-ddcpy121 copy 2682682682682682 -> 2682682682682682
-ddcpy122 copy -2682682682682682 -> -2682682682682682
-ddcpy123 copy 1341341341341341 -> 1341341341341341
-ddcpy124 copy -1341341341341341 -> -1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcpy131 copy 9.999999999999999E+384 -> 9.999999999999999E+384
-ddcpy132 copy 1E-383 -> 1E-383
-ddcpy133 copy 1.000000000000000E-383 -> 1.000000000000000E-383
-ddcpy134 copy 1E-398 -> 1E-398
-
-ddcpy135 copy -1E-398 -> -1E-398
-ddcpy136 copy -1.000000000000000E-383 -> -1.000000000000000E-383
-ddcpy137 copy -1E-383 -> -1E-383
-ddcpy138 copy -9.999999999999999E+384 -> -9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddCopy.decTest -- quiet decDouble copy --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddcpy001 copy +7.50 -> 7.50
+
+-- Infinities
+ddcpy011 copy Infinity -> Infinity
+ddcpy012 copy -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+ddcpy021 copy NaN -> NaN
+ddcpy022 copy -NaN -> -NaN
+ddcpy023 copy sNaN -> sNaN
+ddcpy024 copy -sNaN -> -sNaN
+
+-- NaNs, non-0 payload
+ddcpy031 copy NaN10 -> NaN10
+ddcpy032 copy -NaN10 -> -NaN10
+ddcpy033 copy sNaN10 -> sNaN10
+ddcpy034 copy -sNaN10 -> -sNaN10
+ddcpy035 copy NaN7 -> NaN7
+ddcpy036 copy -NaN7 -> -NaN7
+ddcpy037 copy sNaN101 -> sNaN101
+ddcpy038 copy -sNaN101 -> -sNaN101
+
+-- finites
+ddcpy101 copy 7 -> 7
+ddcpy102 copy -7 -> -7
+ddcpy103 copy 75 -> 75
+ddcpy104 copy -75 -> -75
+ddcpy105 copy 7.50 -> 7.50
+ddcpy106 copy -7.50 -> -7.50
+ddcpy107 copy 7.500 -> 7.500
+ddcpy108 copy -7.500 -> -7.500
+
+-- zeros
+ddcpy111 copy 0 -> 0
+ddcpy112 copy -0 -> -0
+ddcpy113 copy 0E+4 -> 0E+4
+ddcpy114 copy -0E+4 -> -0E+4
+ddcpy115 copy 0.0000 -> 0.0000
+ddcpy116 copy -0.0000 -> -0.0000
+ddcpy117 copy 0E-141 -> 0E-141
+ddcpy118 copy -0E-141 -> -0E-141
+
+-- full coefficients, alternating bits
+ddcpy121 copy 2682682682682682 -> 2682682682682682
+ddcpy122 copy -2682682682682682 -> -2682682682682682
+ddcpy123 copy 1341341341341341 -> 1341341341341341
+ddcpy124 copy -1341341341341341 -> -1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcpy131 copy 9.999999999999999E+384 -> 9.999999999999999E+384
+ddcpy132 copy 1E-383 -> 1E-383
+ddcpy133 copy 1.000000000000000E-383 -> 1.000000000000000E-383
+ddcpy134 copy 1E-398 -> 1E-398
+
+ddcpy135 copy -1E-398 -> -1E-398
+ddcpy136 copy -1.000000000000000E-383 -> -1.000000000000000E-383
+ddcpy137 copy -1E-383 -> -1E-383
+ddcpy138 copy -9.999999999999999E+384 -> -9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddCopyAbs.decTest b/Lib/test/decimaltestdata/ddCopyAbs.decTest
index 4823cf2d77..d436a1940c 100644
--- a/Lib/test/decimaltestdata/ddCopyAbs.decTest
+++ b/Lib/test/decimaltestdata/ddCopyAbs.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddCopyAbs.decTest -- quiet decDouble copy and set sign to zero --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddcpa001 copyabs +7.50 -> 7.50
-
--- Infinities
-ddcpa011 copyabs Infinity -> Infinity
-ddcpa012 copyabs -Infinity -> Infinity
-
--- NaNs, 0 payload
-ddcpa021 copyabs NaN -> NaN
-ddcpa022 copyabs -NaN -> NaN
-ddcpa023 copyabs sNaN -> sNaN
-ddcpa024 copyabs -sNaN -> sNaN
-
--- NaNs, non-0 payload
-ddcpa031 copyabs NaN10 -> NaN10
-ddcpa032 copyabs -NaN15 -> NaN15
-ddcpa033 copyabs sNaN15 -> sNaN15
-ddcpa034 copyabs -sNaN10 -> sNaN10
-ddcpa035 copyabs NaN7 -> NaN7
-ddcpa036 copyabs -NaN7 -> NaN7
-ddcpa037 copyabs sNaN101 -> sNaN101
-ddcpa038 copyabs -sNaN101 -> sNaN101
-
--- finites
-ddcpa101 copyabs 7 -> 7
-ddcpa102 copyabs -7 -> 7
-ddcpa103 copyabs 75 -> 75
-ddcpa104 copyabs -75 -> 75
-ddcpa105 copyabs 7.10 -> 7.10
-ddcpa106 copyabs -7.10 -> 7.10
-ddcpa107 copyabs 7.500 -> 7.500
-ddcpa108 copyabs -7.500 -> 7.500
-
--- zeros
-ddcpa111 copyabs 0 -> 0
-ddcpa112 copyabs -0 -> 0
-ddcpa113 copyabs 0E+6 -> 0E+6
-ddcpa114 copyabs -0E+6 -> 0E+6
-ddcpa115 copyabs 0.0000 -> 0.0000
-ddcpa116 copyabs -0.0000 -> 0.0000
-ddcpa117 copyabs 0E-141 -> 0E-141
-ddcpa118 copyabs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddcpa121 copyabs 2682682682682682 -> 2682682682682682
-ddcpa122 copyabs -2682682682682682 -> 2682682682682682
-ddcpa123 copyabs 1341341341341341 -> 1341341341341341
-ddcpa124 copyabs -1341341341341341 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcpa131 copyabs 9.999999999999999E+384 -> 9.999999999999999E+384
-ddcpa132 copyabs 1E-383 -> 1E-383
-ddcpa133 copyabs 1.000000000000000E-383 -> 1.000000000000000E-383
-ddcpa134 copyabs 1E-398 -> 1E-398
-
-ddcpa135 copyabs -1E-398 -> 1E-398
-ddcpa136 copyabs -1.000000000000000E-383 -> 1.000000000000000E-383
-ddcpa137 copyabs -1E-383 -> 1E-383
-ddcpa138 copyabs -9.999999999999999E+384 -> 9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddCopyAbs.decTest -- quiet decDouble copy and set sign to zero --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddcpa001 copyabs +7.50 -> 7.50
+
+-- Infinities
+ddcpa011 copyabs Infinity -> Infinity
+ddcpa012 copyabs -Infinity -> Infinity
+
+-- NaNs, 0 payload
+ddcpa021 copyabs NaN -> NaN
+ddcpa022 copyabs -NaN -> NaN
+ddcpa023 copyabs sNaN -> sNaN
+ddcpa024 copyabs -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+ddcpa031 copyabs NaN10 -> NaN10
+ddcpa032 copyabs -NaN15 -> NaN15
+ddcpa033 copyabs sNaN15 -> sNaN15
+ddcpa034 copyabs -sNaN10 -> sNaN10
+ddcpa035 copyabs NaN7 -> NaN7
+ddcpa036 copyabs -NaN7 -> NaN7
+ddcpa037 copyabs sNaN101 -> sNaN101
+ddcpa038 copyabs -sNaN101 -> sNaN101
+
+-- finites
+ddcpa101 copyabs 7 -> 7
+ddcpa102 copyabs -7 -> 7
+ddcpa103 copyabs 75 -> 75
+ddcpa104 copyabs -75 -> 75
+ddcpa105 copyabs 7.10 -> 7.10
+ddcpa106 copyabs -7.10 -> 7.10
+ddcpa107 copyabs 7.500 -> 7.500
+ddcpa108 copyabs -7.500 -> 7.500
+
+-- zeros
+ddcpa111 copyabs 0 -> 0
+ddcpa112 copyabs -0 -> 0
+ddcpa113 copyabs 0E+6 -> 0E+6
+ddcpa114 copyabs -0E+6 -> 0E+6
+ddcpa115 copyabs 0.0000 -> 0.0000
+ddcpa116 copyabs -0.0000 -> 0.0000
+ddcpa117 copyabs 0E-141 -> 0E-141
+ddcpa118 copyabs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddcpa121 copyabs 2682682682682682 -> 2682682682682682
+ddcpa122 copyabs -2682682682682682 -> 2682682682682682
+ddcpa123 copyabs 1341341341341341 -> 1341341341341341
+ddcpa124 copyabs -1341341341341341 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcpa131 copyabs 9.999999999999999E+384 -> 9.999999999999999E+384
+ddcpa132 copyabs 1E-383 -> 1E-383
+ddcpa133 copyabs 1.000000000000000E-383 -> 1.000000000000000E-383
+ddcpa134 copyabs 1E-398 -> 1E-398
+
+ddcpa135 copyabs -1E-398 -> 1E-398
+ddcpa136 copyabs -1.000000000000000E-383 -> 1.000000000000000E-383
+ddcpa137 copyabs -1E-383 -> 1E-383
+ddcpa138 copyabs -9.999999999999999E+384 -> 9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddCopyNegate.decTest b/Lib/test/decimaltestdata/ddCopyNegate.decTest
index 121945c755..a4c4274372 100644
--- a/Lib/test/decimaltestdata/ddCopyNegate.decTest
+++ b/Lib/test/decimaltestdata/ddCopyNegate.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddCopyNegate.decTest -- quiet decDouble copy and negate --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddcpn001 copynegate +7.50 -> -7.50
-
--- Infinities
-ddcpn011 copynegate Infinity -> -Infinity
-ddcpn012 copynegate -Infinity -> Infinity
-
--- NaNs, 0 payload
-ddcpn021 copynegate NaN -> -NaN
-ddcpn022 copynegate -NaN -> NaN
-ddcpn023 copynegate sNaN -> -sNaN
-ddcpn024 copynegate -sNaN -> sNaN
-
--- NaNs, non-0 payload
-ddcpn031 copynegate NaN13 -> -NaN13
-ddcpn032 copynegate -NaN13 -> NaN13
-ddcpn033 copynegate sNaN13 -> -sNaN13
-ddcpn034 copynegate -sNaN13 -> sNaN13
-ddcpn035 copynegate NaN70 -> -NaN70
-ddcpn036 copynegate -NaN70 -> NaN70
-ddcpn037 copynegate sNaN101 -> -sNaN101
-ddcpn038 copynegate -sNaN101 -> sNaN101
-
--- finites
-ddcpn101 copynegate 7 -> -7
-ddcpn102 copynegate -7 -> 7
-ddcpn103 copynegate 75 -> -75
-ddcpn104 copynegate -75 -> 75
-ddcpn105 copynegate 7.50 -> -7.50
-ddcpn106 copynegate -7.50 -> 7.50
-ddcpn107 copynegate 7.500 -> -7.500
-ddcpn108 copynegate -7.500 -> 7.500
-
--- zeros
-ddcpn111 copynegate 0 -> -0
-ddcpn112 copynegate -0 -> 0
-ddcpn113 copynegate 0E+4 -> -0E+4
-ddcpn114 copynegate -0E+4 -> 0E+4
-ddcpn115 copynegate 0.0000 -> -0.0000
-ddcpn116 copynegate -0.0000 -> 0.0000
-ddcpn117 copynegate 0E-141 -> -0E-141
-ddcpn118 copynegate -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddcpn121 copynegate 2682682682682682 -> -2682682682682682
-ddcpn122 copynegate -2682682682682682 -> 2682682682682682
-ddcpn123 copynegate 1341341341341341 -> -1341341341341341
-ddcpn124 copynegate -1341341341341341 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcpn131 copynegate 9.999999999999999E+384 -> -9.999999999999999E+384
-ddcpn132 copynegate 1E-383 -> -1E-383
-ddcpn133 copynegate 1.000000000000000E-383 -> -1.000000000000000E-383
-ddcpn134 copynegate 1E-398 -> -1E-398
-
-ddcpn135 copynegate -1E-398 -> 1E-398
-ddcpn136 copynegate -1.000000000000000E-383 -> 1.000000000000000E-383
-ddcpn137 copynegate -1E-383 -> 1E-383
-ddcpn138 copynegate -9.999999999999999E+384 -> 9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddCopyNegate.decTest -- quiet decDouble copy and negate --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddcpn001 copynegate +7.50 -> -7.50
+
+-- Infinities
+ddcpn011 copynegate Infinity -> -Infinity
+ddcpn012 copynegate -Infinity -> Infinity
+
+-- NaNs, 0 payload
+ddcpn021 copynegate NaN -> -NaN
+ddcpn022 copynegate -NaN -> NaN
+ddcpn023 copynegate sNaN -> -sNaN
+ddcpn024 copynegate -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+ddcpn031 copynegate NaN13 -> -NaN13
+ddcpn032 copynegate -NaN13 -> NaN13
+ddcpn033 copynegate sNaN13 -> -sNaN13
+ddcpn034 copynegate -sNaN13 -> sNaN13
+ddcpn035 copynegate NaN70 -> -NaN70
+ddcpn036 copynegate -NaN70 -> NaN70
+ddcpn037 copynegate sNaN101 -> -sNaN101
+ddcpn038 copynegate -sNaN101 -> sNaN101
+
+-- finites
+ddcpn101 copynegate 7 -> -7
+ddcpn102 copynegate -7 -> 7
+ddcpn103 copynegate 75 -> -75
+ddcpn104 copynegate -75 -> 75
+ddcpn105 copynegate 7.50 -> -7.50
+ddcpn106 copynegate -7.50 -> 7.50
+ddcpn107 copynegate 7.500 -> -7.500
+ddcpn108 copynegate -7.500 -> 7.500
+
+-- zeros
+ddcpn111 copynegate 0 -> -0
+ddcpn112 copynegate -0 -> 0
+ddcpn113 copynegate 0E+4 -> -0E+4
+ddcpn114 copynegate -0E+4 -> 0E+4
+ddcpn115 copynegate 0.0000 -> -0.0000
+ddcpn116 copynegate -0.0000 -> 0.0000
+ddcpn117 copynegate 0E-141 -> -0E-141
+ddcpn118 copynegate -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddcpn121 copynegate 2682682682682682 -> -2682682682682682
+ddcpn122 copynegate -2682682682682682 -> 2682682682682682
+ddcpn123 copynegate 1341341341341341 -> -1341341341341341
+ddcpn124 copynegate -1341341341341341 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcpn131 copynegate 9.999999999999999E+384 -> -9.999999999999999E+384
+ddcpn132 copynegate 1E-383 -> -1E-383
+ddcpn133 copynegate 1.000000000000000E-383 -> -1.000000000000000E-383
+ddcpn134 copynegate 1E-398 -> -1E-398
+
+ddcpn135 copynegate -1E-398 -> 1E-398
+ddcpn136 copynegate -1.000000000000000E-383 -> 1.000000000000000E-383
+ddcpn137 copynegate -1E-383 -> 1E-383
+ddcpn138 copynegate -9.999999999999999E+384 -> 9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddCopySign.decTest b/Lib/test/decimaltestdata/ddCopySign.decTest
index c99544d9ab..6a78083ad5 100644
--- a/Lib/test/decimaltestdata/ddCopySign.decTest
+++ b/Lib/test/decimaltestdata/ddCopySign.decTest
@@ -1,175 +1,175 @@
-------------------------------------------------------------------------
--- ddCopySign.decTest -- quiet decDouble copy with sign from rhs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddcps001 copysign +7.50 11 -> 7.50
-
--- Infinities
-ddcps011 copysign Infinity 11 -> Infinity
-ddcps012 copysign -Infinity 11 -> Infinity
-
--- NaNs, 0 payload
-ddcps021 copysign NaN 11 -> NaN
-ddcps022 copysign -NaN 11 -> NaN
-ddcps023 copysign sNaN 11 -> sNaN
-ddcps024 copysign -sNaN 11 -> sNaN
-
--- NaNs, non-0 payload
-ddcps031 copysign NaN10 11 -> NaN10
-ddcps032 copysign -NaN10 11 -> NaN10
-ddcps033 copysign sNaN10 11 -> sNaN10
-ddcps034 copysign -sNaN10 11 -> sNaN10
-ddcps035 copysign NaN7 11 -> NaN7
-ddcps036 copysign -NaN7 11 -> NaN7
-ddcps037 copysign sNaN101 11 -> sNaN101
-ddcps038 copysign -sNaN101 11 -> sNaN101
-
--- finites
-ddcps101 copysign 7 11 -> 7
-ddcps102 copysign -7 11 -> 7
-ddcps103 copysign 75 11 -> 75
-ddcps104 copysign -75 11 -> 75
-ddcps105 copysign 7.50 11 -> 7.50
-ddcps106 copysign -7.50 11 -> 7.50
-ddcps107 copysign 7.500 11 -> 7.500
-ddcps108 copysign -7.500 11 -> 7.500
-
--- zeros
-ddcps111 copysign 0 11 -> 0
-ddcps112 copysign -0 11 -> 0
-ddcps113 copysign 0E+4 11 -> 0E+4
-ddcps114 copysign -0E+4 11 -> 0E+4
-ddcps115 copysign 0.0000 11 -> 0.0000
-ddcps116 copysign -0.0000 11 -> 0.0000
-ddcps117 copysign 0E-141 11 -> 0E-141
-ddcps118 copysign -0E-141 11 -> 0E-141
-
--- full coefficients, alternating bits
-ddcps121 copysign 2682682682682682 11 -> 2682682682682682
-ddcps122 copysign -2682682682682682 11 -> 2682682682682682
-ddcps123 copysign 1341341341341341 11 -> 1341341341341341
-ddcps124 copysign -1341341341341341 11 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcps131 copysign 9.999999999999999E+384 11 -> 9.999999999999999E+384
-ddcps132 copysign 1E-383 11 -> 1E-383
-ddcps133 copysign 1.000000000000000E-383 11 -> 1.000000000000000E-383
-ddcps134 copysign 1E-398 11 -> 1E-398
-
-ddcps135 copysign -1E-398 11 -> 1E-398
-ddcps136 copysign -1.000000000000000E-383 11 -> 1.000000000000000E-383
-ddcps137 copysign -1E-383 11 -> 1E-383
-ddcps138 copysign -9.999999999999999E+384 11 -> 9.999999999999999E+384
-
--- repeat with negative RHS
-
--- Infinities
-ddcps211 copysign Infinity -34 -> -Infinity
-ddcps212 copysign -Infinity -34 -> -Infinity
-
--- NaNs, 0 payload
-ddcps221 copysign NaN -34 -> -NaN
-ddcps222 copysign -NaN -34 -> -NaN
-ddcps223 copysign sNaN -34 -> -sNaN
-ddcps224 copysign -sNaN -34 -> -sNaN
-
--- NaNs, non-0 payload
-ddcps231 copysign NaN10 -34 -> -NaN10
-ddcps232 copysign -NaN10 -34 -> -NaN10
-ddcps233 copysign sNaN10 -34 -> -sNaN10
-ddcps234 copysign -sNaN10 -34 -> -sNaN10
-ddcps235 copysign NaN7 -34 -> -NaN7
-ddcps236 copysign -NaN7 -34 -> -NaN7
-ddcps237 copysign sNaN101 -34 -> -sNaN101
-ddcps238 copysign -sNaN101 -34 -> -sNaN101
-
--- finites
-ddcps301 copysign 7 -34 -> -7
-ddcps302 copysign -7 -34 -> -7
-ddcps303 copysign 75 -34 -> -75
-ddcps304 copysign -75 -34 -> -75
-ddcps305 copysign 7.50 -34 -> -7.50
-ddcps306 copysign -7.50 -34 -> -7.50
-ddcps307 copysign 7.500 -34 -> -7.500
-ddcps308 copysign -7.500 -34 -> -7.500
-
--- zeros
-ddcps311 copysign 0 -34 -> -0
-ddcps312 copysign -0 -34 -> -0
-ddcps313 copysign 0E+4 -34 -> -0E+4
-ddcps314 copysign -0E+4 -34 -> -0E+4
-ddcps315 copysign 0.0000 -34 -> -0.0000
-ddcps316 copysign -0.0000 -34 -> -0.0000
-ddcps317 copysign 0E-141 -34 -> -0E-141
-ddcps318 copysign -0E-141 -34 -> -0E-141
-
--- full coefficients, alternating bits
-ddcps321 copysign 2682682682682682 -34 -> -2682682682682682
-ddcps322 copysign -2682682682682682 -34 -> -2682682682682682
-ddcps323 copysign 1341341341341341 -34 -> -1341341341341341
-ddcps324 copysign -1341341341341341 -34 -> -1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcps331 copysign 9.999999999999999E+384 -34 -> -9.999999999999999E+384
-ddcps332 copysign 1E-383 -34 -> -1E-383
-ddcps333 copysign 1.000000000000000E-383 -34 -> -1.000000000000000E-383
-ddcps334 copysign 1E-398 -34 -> -1E-398
-
-ddcps335 copysign -1E-398 -34 -> -1E-398
-ddcps336 copysign -1.000000000000000E-383 -34 -> -1.000000000000000E-383
-ddcps337 copysign -1E-383 -34 -> -1E-383
-ddcps338 copysign -9.999999999999999E+384 -34 -> -9.999999999999999E+384
-
--- Other kinds of RHS
-ddcps401 copysign 701 -34 -> -701
-ddcps402 copysign -720 -34 -> -720
-ddcps403 copysign 701 -0 -> -701
-ddcps404 copysign -720 -0 -> -720
-ddcps405 copysign 701 +0 -> 701
-ddcps406 copysign -720 +0 -> 720
-ddcps407 copysign 701 +34 -> 701
-ddcps408 copysign -720 +34 -> 720
-
-ddcps413 copysign 701 -Inf -> -701
-ddcps414 copysign -720 -Inf -> -720
-ddcps415 copysign 701 +Inf -> 701
-ddcps416 copysign -720 +Inf -> 720
-
-ddcps420 copysign 701 -NaN -> -701
-ddcps421 copysign -720 -NaN -> -720
-ddcps422 copysign 701 +NaN -> 701
-ddcps423 copysign -720 +NaN -> 720
-ddcps425 copysign -720 +NaN8 -> 720
-
-ddcps426 copysign 701 -sNaN -> -701
-ddcps427 copysign -720 -sNaN -> -720
-ddcps428 copysign 701 +sNaN -> 701
-ddcps429 copysign -720 +sNaN -> 720
-ddcps430 copysign -720 +sNaN3 -> 720
-
+------------------------------------------------------------------------
+-- ddCopySign.decTest -- quiet decDouble copy with sign from rhs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddcps001 copysign +7.50 11 -> 7.50
+
+-- Infinities
+ddcps011 copysign Infinity 11 -> Infinity
+ddcps012 copysign -Infinity 11 -> Infinity
+
+-- NaNs, 0 payload
+ddcps021 copysign NaN 11 -> NaN
+ddcps022 copysign -NaN 11 -> NaN
+ddcps023 copysign sNaN 11 -> sNaN
+ddcps024 copysign -sNaN 11 -> sNaN
+
+-- NaNs, non-0 payload
+ddcps031 copysign NaN10 11 -> NaN10
+ddcps032 copysign -NaN10 11 -> NaN10
+ddcps033 copysign sNaN10 11 -> sNaN10
+ddcps034 copysign -sNaN10 11 -> sNaN10
+ddcps035 copysign NaN7 11 -> NaN7
+ddcps036 copysign -NaN7 11 -> NaN7
+ddcps037 copysign sNaN101 11 -> sNaN101
+ddcps038 copysign -sNaN101 11 -> sNaN101
+
+-- finites
+ddcps101 copysign 7 11 -> 7
+ddcps102 copysign -7 11 -> 7
+ddcps103 copysign 75 11 -> 75
+ddcps104 copysign -75 11 -> 75
+ddcps105 copysign 7.50 11 -> 7.50
+ddcps106 copysign -7.50 11 -> 7.50
+ddcps107 copysign 7.500 11 -> 7.500
+ddcps108 copysign -7.500 11 -> 7.500
+
+-- zeros
+ddcps111 copysign 0 11 -> 0
+ddcps112 copysign -0 11 -> 0
+ddcps113 copysign 0E+4 11 -> 0E+4
+ddcps114 copysign -0E+4 11 -> 0E+4
+ddcps115 copysign 0.0000 11 -> 0.0000
+ddcps116 copysign -0.0000 11 -> 0.0000
+ddcps117 copysign 0E-141 11 -> 0E-141
+ddcps118 copysign -0E-141 11 -> 0E-141
+
+-- full coefficients, alternating bits
+ddcps121 copysign 2682682682682682 11 -> 2682682682682682
+ddcps122 copysign -2682682682682682 11 -> 2682682682682682
+ddcps123 copysign 1341341341341341 11 -> 1341341341341341
+ddcps124 copysign -1341341341341341 11 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcps131 copysign 9.999999999999999E+384 11 -> 9.999999999999999E+384
+ddcps132 copysign 1E-383 11 -> 1E-383
+ddcps133 copysign 1.000000000000000E-383 11 -> 1.000000000000000E-383
+ddcps134 copysign 1E-398 11 -> 1E-398
+
+ddcps135 copysign -1E-398 11 -> 1E-398
+ddcps136 copysign -1.000000000000000E-383 11 -> 1.000000000000000E-383
+ddcps137 copysign -1E-383 11 -> 1E-383
+ddcps138 copysign -9.999999999999999E+384 11 -> 9.999999999999999E+384
+
+-- repeat with negative RHS
+
+-- Infinities
+ddcps211 copysign Infinity -34 -> -Infinity
+ddcps212 copysign -Infinity -34 -> -Infinity
+
+-- NaNs, 0 payload
+ddcps221 copysign NaN -34 -> -NaN
+ddcps222 copysign -NaN -34 -> -NaN
+ddcps223 copysign sNaN -34 -> -sNaN
+ddcps224 copysign -sNaN -34 -> -sNaN
+
+-- NaNs, non-0 payload
+ddcps231 copysign NaN10 -34 -> -NaN10
+ddcps232 copysign -NaN10 -34 -> -NaN10
+ddcps233 copysign sNaN10 -34 -> -sNaN10
+ddcps234 copysign -sNaN10 -34 -> -sNaN10
+ddcps235 copysign NaN7 -34 -> -NaN7
+ddcps236 copysign -NaN7 -34 -> -NaN7
+ddcps237 copysign sNaN101 -34 -> -sNaN101
+ddcps238 copysign -sNaN101 -34 -> -sNaN101
+
+-- finites
+ddcps301 copysign 7 -34 -> -7
+ddcps302 copysign -7 -34 -> -7
+ddcps303 copysign 75 -34 -> -75
+ddcps304 copysign -75 -34 -> -75
+ddcps305 copysign 7.50 -34 -> -7.50
+ddcps306 copysign -7.50 -34 -> -7.50
+ddcps307 copysign 7.500 -34 -> -7.500
+ddcps308 copysign -7.500 -34 -> -7.500
+
+-- zeros
+ddcps311 copysign 0 -34 -> -0
+ddcps312 copysign -0 -34 -> -0
+ddcps313 copysign 0E+4 -34 -> -0E+4
+ddcps314 copysign -0E+4 -34 -> -0E+4
+ddcps315 copysign 0.0000 -34 -> -0.0000
+ddcps316 copysign -0.0000 -34 -> -0.0000
+ddcps317 copysign 0E-141 -34 -> -0E-141
+ddcps318 copysign -0E-141 -34 -> -0E-141
+
+-- full coefficients, alternating bits
+ddcps321 copysign 2682682682682682 -34 -> -2682682682682682
+ddcps322 copysign -2682682682682682 -34 -> -2682682682682682
+ddcps323 copysign 1341341341341341 -34 -> -1341341341341341
+ddcps324 copysign -1341341341341341 -34 -> -1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcps331 copysign 9.999999999999999E+384 -34 -> -9.999999999999999E+384
+ddcps332 copysign 1E-383 -34 -> -1E-383
+ddcps333 copysign 1.000000000000000E-383 -34 -> -1.000000000000000E-383
+ddcps334 copysign 1E-398 -34 -> -1E-398
+
+ddcps335 copysign -1E-398 -34 -> -1E-398
+ddcps336 copysign -1.000000000000000E-383 -34 -> -1.000000000000000E-383
+ddcps337 copysign -1E-383 -34 -> -1E-383
+ddcps338 copysign -9.999999999999999E+384 -34 -> -9.999999999999999E+384
+
+-- Other kinds of RHS
+ddcps401 copysign 701 -34 -> -701
+ddcps402 copysign -720 -34 -> -720
+ddcps403 copysign 701 -0 -> -701
+ddcps404 copysign -720 -0 -> -720
+ddcps405 copysign 701 +0 -> 701
+ddcps406 copysign -720 +0 -> 720
+ddcps407 copysign 701 +34 -> 701
+ddcps408 copysign -720 +34 -> 720
+
+ddcps413 copysign 701 -Inf -> -701
+ddcps414 copysign -720 -Inf -> -720
+ddcps415 copysign 701 +Inf -> 701
+ddcps416 copysign -720 +Inf -> 720
+
+ddcps420 copysign 701 -NaN -> -701
+ddcps421 copysign -720 -NaN -> -720
+ddcps422 copysign 701 +NaN -> 701
+ddcps423 copysign -720 +NaN -> 720
+ddcps425 copysign -720 +NaN8 -> 720
+
+ddcps426 copysign 701 -sNaN -> -701
+ddcps427 copysign -720 -sNaN -> -720
+ddcps428 copysign 701 +sNaN -> 701
+ddcps429 copysign -720 +sNaN -> 720
+ddcps430 copysign -720 +sNaN3 -> 720
+
diff --git a/Lib/test/decimaltestdata/ddDivide.decTest b/Lib/test/decimaltestdata/ddDivide.decTest
index 019db228d4..5531d0e031 100644
--- a/Lib/test/decimaltestdata/ddDivide.decTest
+++ b/Lib/test/decimaltestdata/ddDivide.decTest
@@ -1,863 +1,863 @@
-------------------------------------------------------------------------
--- ddDivide.decTest -- decDouble division --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-dddiv001 divide 1 1 -> 1
-dddiv002 divide 2 1 -> 2
-dddiv003 divide 1 2 -> 0.5
-dddiv004 divide 2 2 -> 1
-dddiv005 divide 0 1 -> 0
-dddiv006 divide 0 2 -> 0
-dddiv007 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv008 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv009 divide 3 3 -> 1
-
-dddiv010 divide 2.4 1 -> 2.4
-dddiv011 divide 2.4 -1 -> -2.4
-dddiv012 divide -2.4 1 -> -2.4
-dddiv013 divide -2.4 -1 -> 2.4
-dddiv014 divide 2.40 1 -> 2.40
-dddiv015 divide 2.400 1 -> 2.400
-dddiv016 divide 2.4 2 -> 1.2
-dddiv017 divide 2.400 2 -> 1.200
-dddiv018 divide 2. 2 -> 1
-dddiv019 divide 20 20 -> 1
-
-dddiv020 divide 187 187 -> 1
-dddiv021 divide 5 2 -> 2.5
-dddiv022 divide 50 20 -> 2.5
-dddiv023 divide 500 200 -> 2.5
-dddiv024 divide 50.0 20.0 -> 2.5
-dddiv025 divide 5.00 2.00 -> 2.5
-dddiv026 divide 5 2.0 -> 2.5
-dddiv027 divide 5 2.000 -> 2.5
-dddiv028 divide 5 0.20 -> 25
-dddiv029 divide 5 0.200 -> 25
-dddiv030 divide 10 1 -> 10
-dddiv031 divide 100 1 -> 100
-dddiv032 divide 1000 1 -> 1000
-dddiv033 divide 1000 100 -> 10
-
-dddiv035 divide 1 2 -> 0.5
-dddiv036 divide 1 4 -> 0.25
-dddiv037 divide 1 8 -> 0.125
-dddiv038 divide 1 16 -> 0.0625
-dddiv039 divide 1 32 -> 0.03125
-dddiv040 divide 1 64 -> 0.015625
-dddiv041 divide 1 -2 -> -0.5
-dddiv042 divide 1 -4 -> -0.25
-dddiv043 divide 1 -8 -> -0.125
-dddiv044 divide 1 -16 -> -0.0625
-dddiv045 divide 1 -32 -> -0.03125
-dddiv046 divide 1 -64 -> -0.015625
-dddiv047 divide -1 2 -> -0.5
-dddiv048 divide -1 4 -> -0.25
-dddiv049 divide -1 8 -> -0.125
-dddiv050 divide -1 16 -> -0.0625
-dddiv051 divide -1 32 -> -0.03125
-dddiv052 divide -1 64 -> -0.015625
-dddiv053 divide -1 -2 -> 0.5
-dddiv054 divide -1 -4 -> 0.25
-dddiv055 divide -1 -8 -> 0.125
-dddiv056 divide -1 -16 -> 0.0625
-dddiv057 divide -1 -32 -> 0.03125
-dddiv058 divide -1 -64 -> 0.015625
-
--- bcdTime
-dddiv060 divide 1 7 -> 0.1428571428571429 Inexact Rounded
-dddiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717 Inexact Rounded
-
--- 1234567890123456
-dddiv071 divide 9999999999999999 1 -> 9999999999999999
-dddiv072 divide 999999999999999 1 -> 999999999999999
-dddiv073 divide 99999999999999 1 -> 99999999999999
-dddiv074 divide 9999999999999 1 -> 9999999999999
-dddiv075 divide 999999999999 1 -> 999999999999
-dddiv076 divide 99999999999 1 -> 99999999999
-dddiv077 divide 9999999999 1 -> 9999999999
-dddiv078 divide 999999999 1 -> 999999999
-dddiv079 divide 99999999 1 -> 99999999
-dddiv080 divide 9999999 1 -> 9999999
-dddiv081 divide 999999 1 -> 999999
-dddiv082 divide 99999 1 -> 99999
-dddiv083 divide 9999 1 -> 9999
-dddiv084 divide 999 1 -> 999
-dddiv085 divide 99 1 -> 99
-dddiv086 divide 9 1 -> 9
-
-dddiv090 divide 0. 1 -> 0
-dddiv091 divide .0 1 -> 0.0
-dddiv092 divide 0.00 1 -> 0.00
-dddiv093 divide 0.00E+9 1 -> 0E+7
-dddiv094 divide 0.0000E-50 1 -> 0E-54
-
-dddiv095 divide 1 1E-8 -> 1E+8
-dddiv096 divide 1 1E-9 -> 1E+9
-dddiv097 divide 1 1E-10 -> 1E+10
-dddiv098 divide 1 1E-11 -> 1E+11
-dddiv099 divide 1 1E-12 -> 1E+12
-
-dddiv100 divide 1 1 -> 1
-dddiv101 divide 1 2 -> 0.5
-dddiv102 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv103 divide 1 4 -> 0.25
-dddiv104 divide 1 5 -> 0.2
-dddiv105 divide 1 6 -> 0.1666666666666667 Inexact Rounded
-dddiv106 divide 1 7 -> 0.1428571428571429 Inexact Rounded
-dddiv107 divide 1 8 -> 0.125
-dddiv108 divide 1 9 -> 0.1111111111111111 Inexact Rounded
-dddiv109 divide 1 10 -> 0.1
-dddiv110 divide 1 1 -> 1
-dddiv111 divide 2 1 -> 2
-dddiv112 divide 3 1 -> 3
-dddiv113 divide 4 1 -> 4
-dddiv114 divide 5 1 -> 5
-dddiv115 divide 6 1 -> 6
-dddiv116 divide 7 1 -> 7
-dddiv117 divide 8 1 -> 8
-dddiv118 divide 9 1 -> 9
-dddiv119 divide 10 1 -> 10
-
-dddiv120 divide 3E+1 0.001 -> 3E+4
-dddiv121 divide 2.200 2 -> 1.100
-
-dddiv130 divide 12345 4.999 -> 2469.493898779756 Inexact Rounded
-dddiv131 divide 12345 4.99 -> 2473.947895791583 Inexact Rounded
-dddiv132 divide 12345 4.9 -> 2519.387755102041 Inexact Rounded
-dddiv133 divide 12345 5 -> 2469
-dddiv134 divide 12345 5.1 -> 2420.588235294118 Inexact Rounded
-dddiv135 divide 12345 5.01 -> 2464.071856287425 Inexact Rounded
-dddiv136 divide 12345 5.001 -> 2468.506298740252 Inexact Rounded
-
--- test possibly imprecise results
-dddiv220 divide 391 597 -> 0.6549413735343384 Inexact Rounded
-dddiv221 divide 391 -597 -> -0.6549413735343384 Inexact Rounded
-dddiv222 divide -391 597 -> -0.6549413735343384 Inexact Rounded
-dddiv223 divide -391 -597 -> 0.6549413735343384 Inexact Rounded
-
--- test some cases that are close to exponent overflow, some with coefficient padding
-dddiv270 divide 1 1e384 -> 1E-384 Subnormal
-dddiv271 divide 1 0.9e384 -> 1.11111111111111E-384 Rounded Inexact Subnormal Underflow
-dddiv272 divide 1 0.99e384 -> 1.01010101010101E-384 Rounded Inexact Subnormal Underflow
-dddiv273 divide 1 0.9999999999999999e384 -> 1.00000000000000E-384 Rounded Inexact Subnormal Underflow
-dddiv274 divide 9e384 1 -> 9.000000000000000E+384 Clamped
-dddiv275 divide 9.9e384 1 -> 9.900000000000000E+384 Clamped
-dddiv276 divide 9.99e384 1 -> 9.990000000000000E+384 Clamped
-dddiv277 divide 9.9999999999999e384 1 -> 9.999999999999900E+384 Clamped
-dddiv278 divide 9.99999999999999e384 1 -> 9.999999999999990E+384 Clamped
-dddiv279 divide 9.999999999999999e384 1 -> 9.999999999999999E+384
-
-dddiv285 divide 9.9e384 1.1 -> 9.000000000000000E+384 Clamped
-dddiv286 divide 9.99e384 1.1 -> 9.081818181818182E+384 Inexact Rounded
-dddiv287 divide 9.9999999999999e384 1.1 -> 9.090909090909000E+384 Clamped
-dddiv288 divide 9.99999999999999e384 1.1 -> 9.090909090909082E+384 Inexact Rounded
-dddiv289 divide 9.999999999999999e384 1.1 -> 9.090909090909090E+384 Clamped
-
-
--- Divide into 0 tests
-dddiv301 divide 0 7 -> 0
-dddiv302 divide 0 7E-5 -> 0E+5
-dddiv303 divide 0 7E-1 -> 0E+1
-dddiv304 divide 0 7E+1 -> 0.0
-dddiv305 divide 0 7E+5 -> 0.00000
-dddiv306 divide 0 7E+6 -> 0.000000
-dddiv307 divide 0 7E+7 -> 0E-7
-dddiv308 divide 0 70E-5 -> 0E+5
-dddiv309 divide 0 70E-1 -> 0E+1
-dddiv310 divide 0 70E+0 -> 0
-dddiv311 divide 0 70E+1 -> 0.0
-dddiv312 divide 0 70E+5 -> 0.00000
-dddiv313 divide 0 70E+6 -> 0.000000
-dddiv314 divide 0 70E+7 -> 0E-7
-dddiv315 divide 0 700E-5 -> 0E+5
-dddiv316 divide 0 700E-1 -> 0E+1
-dddiv317 divide 0 700E+0 -> 0
-dddiv318 divide 0 700E+1 -> 0.0
-dddiv319 divide 0 700E+5 -> 0.00000
-dddiv320 divide 0 700E+6 -> 0.000000
-dddiv321 divide 0 700E+7 -> 0E-7
-dddiv322 divide 0 700E+77 -> 0E-77
-
-dddiv331 divide 0E-3 7E-5 -> 0E+2
-dddiv332 divide 0E-3 7E-1 -> 0.00
-dddiv333 divide 0E-3 7E+1 -> 0.0000
-dddiv334 divide 0E-3 7E+5 -> 0E-8
-dddiv335 divide 0E-1 7E-5 -> 0E+4
-dddiv336 divide 0E-1 7E-1 -> 0
-dddiv337 divide 0E-1 7E+1 -> 0.00
-dddiv338 divide 0E-1 7E+5 -> 0.000000
-dddiv339 divide 0E+1 7E-5 -> 0E+6
-dddiv340 divide 0E+1 7E-1 -> 0E+2
-dddiv341 divide 0E+1 7E+1 -> 0
-dddiv342 divide 0E+1 7E+5 -> 0.0000
-dddiv343 divide 0E+3 7E-5 -> 0E+8
-dddiv344 divide 0E+3 7E-1 -> 0E+4
-dddiv345 divide 0E+3 7E+1 -> 0E+2
-dddiv346 divide 0E+3 7E+5 -> 0.00
-
--- These were 'input rounding'
-dddiv441 divide 12345678000 1 -> 12345678000
-dddiv442 divide 1 12345678000 -> 8.100000664200054E-11 Inexact Rounded
-dddiv443 divide 1234567800 1 -> 1234567800
-dddiv444 divide 1 1234567800 -> 8.100000664200054E-10 Inexact Rounded
-dddiv445 divide 1234567890 1 -> 1234567890
-dddiv446 divide 1 1234567890 -> 8.100000073710001E-10 Inexact Rounded
-dddiv447 divide 1234567891 1 -> 1234567891
-dddiv448 divide 1 1234567891 -> 8.100000067149001E-10 Inexact Rounded
-dddiv449 divide 12345678901 1 -> 12345678901
-dddiv450 divide 1 12345678901 -> 8.100000073053901E-11 Inexact Rounded
-dddiv451 divide 1234567896 1 -> 1234567896
-dddiv452 divide 1 1234567896 -> 8.100000034344000E-10 Inexact Rounded
-
--- high-lows
-dddiv453 divide 1e+1 1 -> 1E+1
-dddiv454 divide 1e+1 1.0 -> 1E+1
-dddiv455 divide 1e+1 1.00 -> 1E+1
-dddiv456 divide 1e+2 2 -> 5E+1
-dddiv457 divide 1e+2 2.0 -> 5E+1
-dddiv458 divide 1e+2 2.00 -> 5E+1
-
--- some from IEEE discussions
-dddiv460 divide 3e0 2e0 -> 1.5
-dddiv461 divide 30e-1 2e0 -> 1.5
-dddiv462 divide 300e-2 2e0 -> 1.50
-dddiv464 divide 3000e-3 2e0 -> 1.500
-dddiv465 divide 3e0 20e-1 -> 1.5
-dddiv466 divide 30e-1 20e-1 -> 1.5
-dddiv467 divide 300e-2 20e-1 -> 1.5
-dddiv468 divide 3000e-3 20e-1 -> 1.50
-dddiv469 divide 3e0 200e-2 -> 1.5
-dddiv470 divide 30e-1 200e-2 -> 1.5
-dddiv471 divide 300e-2 200e-2 -> 1.5
-dddiv472 divide 3000e-3 200e-2 -> 1.5
-dddiv473 divide 3e0 2000e-3 -> 1.5
-dddiv474 divide 30e-1 2000e-3 -> 1.5
-dddiv475 divide 300e-2 2000e-3 -> 1.5
-dddiv476 divide 3000e-3 2000e-3 -> 1.5
-
--- some reciprocals
-dddiv480 divide 1 1.0E+33 -> 1E-33
-dddiv481 divide 1 10E+33 -> 1E-34
-dddiv482 divide 1 1.0E-33 -> 1E+33
-dddiv483 divide 1 10E-33 -> 1E+32
-
--- RMS discussion table
-dddiv484 divide 0e5 1e3 -> 0E+2
-dddiv485 divide 0e5 2e3 -> 0E+2
-dddiv486 divide 0e5 10e2 -> 0E+3
-dddiv487 divide 0e5 20e2 -> 0E+3
-dddiv488 divide 0e5 100e1 -> 0E+4
-dddiv489 divide 0e5 200e1 -> 0E+4
-
-dddiv491 divide 1e5 1e3 -> 1E+2
-dddiv492 divide 1e5 2e3 -> 5E+1
-dddiv493 divide 1e5 10e2 -> 1E+2
-dddiv494 divide 1e5 20e2 -> 5E+1
-dddiv495 divide 1e5 100e1 -> 1E+2
-dddiv496 divide 1e5 200e1 -> 5E+1
-
--- tryzeros cases
-rounding: half_up
-dddiv497 divide 0E+380 1000E-13 -> 0E+369 Clamped
-dddiv498 divide 0E-390 1000E+13 -> 0E-398 Clamped
-
-rounding: half_up
-
--- focus on trailing zeros issues
-dddiv500 divide 1 9.9 -> 0.1010101010101010 Inexact Rounded
-dddiv501 divide 1 9.09 -> 0.1100110011001100 Inexact Rounded
-dddiv502 divide 1 9.009 -> 0.1110001110001110 Inexact Rounded
-
-dddiv511 divide 1 2 -> 0.5
-dddiv512 divide 1.0 2 -> 0.5
-dddiv513 divide 1.00 2 -> 0.50
-dddiv514 divide 1.000 2 -> 0.500
-dddiv515 divide 1.0000 2 -> 0.5000
-dddiv516 divide 1.00000 2 -> 0.50000
-dddiv517 divide 1.000000 2 -> 0.500000
-dddiv518 divide 1.0000000 2 -> 0.5000000
-dddiv519 divide 1.00 2.00 -> 0.5
-
-dddiv521 divide 2 1 -> 2
-dddiv522 divide 2 1.0 -> 2
-dddiv523 divide 2 1.00 -> 2
-dddiv524 divide 2 1.000 -> 2
-dddiv525 divide 2 1.0000 -> 2
-dddiv526 divide 2 1.00000 -> 2
-dddiv527 divide 2 1.000000 -> 2
-dddiv528 divide 2 1.0000000 -> 2
-dddiv529 divide 2.00 1.00 -> 2
-
-dddiv530 divide 2.40 2 -> 1.20
-dddiv531 divide 2.40 4 -> 0.60
-dddiv532 divide 2.40 10 -> 0.24
-dddiv533 divide 2.40 2.0 -> 1.2
-dddiv534 divide 2.40 4.0 -> 0.6
-dddiv535 divide 2.40 10.0 -> 0.24
-dddiv536 divide 2.40 2.00 -> 1.2
-dddiv537 divide 2.40 4.00 -> 0.6
-dddiv538 divide 2.40 10.00 -> 0.24
-dddiv539 divide 0.9 0.1 -> 9
-dddiv540 divide 0.9 0.01 -> 9E+1
-dddiv541 divide 0.9 0.001 -> 9E+2
-dddiv542 divide 5 2 -> 2.5
-dddiv543 divide 5 2.0 -> 2.5
-dddiv544 divide 5 2.00 -> 2.5
-dddiv545 divide 5 20 -> 0.25
-dddiv546 divide 5 20.0 -> 0.25
-dddiv547 divide 2.400 2 -> 1.200
-dddiv548 divide 2.400 2.0 -> 1.20
-dddiv549 divide 2.400 2.400 -> 1
-
-dddiv550 divide 240 1 -> 240
-dddiv551 divide 240 10 -> 24
-dddiv552 divide 240 100 -> 2.4
-dddiv553 divide 240 1000 -> 0.24
-dddiv554 divide 2400 1 -> 2400
-dddiv555 divide 2400 10 -> 240
-dddiv556 divide 2400 100 -> 24
-dddiv557 divide 2400 1000 -> 2.4
-
--- +ve exponent
-dddiv600 divide 2.4E+9 2 -> 1.2E+9
-dddiv601 divide 2.40E+9 2 -> 1.20E+9
-dddiv602 divide 2.400E+9 2 -> 1.200E+9
-dddiv603 divide 2.4000E+9 2 -> 1.2000E+9
-dddiv604 divide 24E+8 2 -> 1.2E+9
-dddiv605 divide 240E+7 2 -> 1.20E+9
-dddiv606 divide 2400E+6 2 -> 1.200E+9
-dddiv607 divide 24000E+5 2 -> 1.2000E+9
-
--- more zeros, etc.
-dddiv731 divide 5.00 1E-3 -> 5.00E+3
-dddiv732 divide 00.00 0.000 -> NaN Division_undefined
-dddiv733 divide 00.00 0E-3 -> NaN Division_undefined
-dddiv734 divide 0 -0 -> NaN Division_undefined
-dddiv735 divide -0 0 -> NaN Division_undefined
-dddiv736 divide -0 -0 -> NaN Division_undefined
-
-dddiv741 divide 0 -1 -> -0
-dddiv742 divide -0 -1 -> 0
-dddiv743 divide 0 1 -> 0
-dddiv744 divide -0 1 -> -0
-dddiv745 divide -1 0 -> -Infinity Division_by_zero
-dddiv746 divide -1 -0 -> Infinity Division_by_zero
-dddiv747 divide 1 0 -> Infinity Division_by_zero
-dddiv748 divide 1 -0 -> -Infinity Division_by_zero
-
-dddiv751 divide 0.0 -1 -> -0.0
-dddiv752 divide -0.0 -1 -> 0.0
-dddiv753 divide 0.0 1 -> 0.0
-dddiv754 divide -0.0 1 -> -0.0
-dddiv755 divide -1.0 0 -> -Infinity Division_by_zero
-dddiv756 divide -1.0 -0 -> Infinity Division_by_zero
-dddiv757 divide 1.0 0 -> Infinity Division_by_zero
-dddiv758 divide 1.0 -0 -> -Infinity Division_by_zero
-
-dddiv761 divide 0 -1.0 -> -0E+1
-dddiv762 divide -0 -1.0 -> 0E+1
-dddiv763 divide 0 1.0 -> 0E+1
-dddiv764 divide -0 1.0 -> -0E+1
-dddiv765 divide -1 0.0 -> -Infinity Division_by_zero
-dddiv766 divide -1 -0.0 -> Infinity Division_by_zero
-dddiv767 divide 1 0.0 -> Infinity Division_by_zero
-dddiv768 divide 1 -0.0 -> -Infinity Division_by_zero
-
-dddiv771 divide 0.0 -1.0 -> -0
-dddiv772 divide -0.0 -1.0 -> 0
-dddiv773 divide 0.0 1.0 -> 0
-dddiv774 divide -0.0 1.0 -> -0
-dddiv775 divide -1.0 0.0 -> -Infinity Division_by_zero
-dddiv776 divide -1.0 -0.0 -> Infinity Division_by_zero
-dddiv777 divide 1.0 0.0 -> Infinity Division_by_zero
-dddiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero
-
--- Specials
-dddiv780 divide Inf -Inf -> NaN Invalid_operation
-dddiv781 divide Inf -1000 -> -Infinity
-dddiv782 divide Inf -1 -> -Infinity
-dddiv783 divide Inf -0 -> -Infinity
-dddiv784 divide Inf 0 -> Infinity
-dddiv785 divide Inf 1 -> Infinity
-dddiv786 divide Inf 1000 -> Infinity
-dddiv787 divide Inf Inf -> NaN Invalid_operation
-dddiv788 divide -1000 Inf -> -0E-398 Clamped
-dddiv789 divide -Inf Inf -> NaN Invalid_operation
-dddiv790 divide -1 Inf -> -0E-398 Clamped
-dddiv791 divide -0 Inf -> -0E-398 Clamped
-dddiv792 divide 0 Inf -> 0E-398 Clamped
-dddiv793 divide 1 Inf -> 0E-398 Clamped
-dddiv794 divide 1000 Inf -> 0E-398 Clamped
-dddiv795 divide Inf Inf -> NaN Invalid_operation
-
-dddiv800 divide -Inf -Inf -> NaN Invalid_operation
-dddiv801 divide -Inf -1000 -> Infinity
-dddiv802 divide -Inf -1 -> Infinity
-dddiv803 divide -Inf -0 -> Infinity
-dddiv804 divide -Inf 0 -> -Infinity
-dddiv805 divide -Inf 1 -> -Infinity
-dddiv806 divide -Inf 1000 -> -Infinity
-dddiv807 divide -Inf Inf -> NaN Invalid_operation
-dddiv808 divide -1000 Inf -> -0E-398 Clamped
-dddiv809 divide -Inf -Inf -> NaN Invalid_operation
-dddiv810 divide -1 -Inf -> 0E-398 Clamped
-dddiv811 divide -0 -Inf -> 0E-398 Clamped
-dddiv812 divide 0 -Inf -> -0E-398 Clamped
-dddiv813 divide 1 -Inf -> -0E-398 Clamped
-dddiv814 divide 1000 -Inf -> -0E-398 Clamped
-dddiv815 divide Inf -Inf -> NaN Invalid_operation
-
-dddiv821 divide NaN -Inf -> NaN
-dddiv822 divide NaN -1000 -> NaN
-dddiv823 divide NaN -1 -> NaN
-dddiv824 divide NaN -0 -> NaN
-dddiv825 divide NaN 0 -> NaN
-dddiv826 divide NaN 1 -> NaN
-dddiv827 divide NaN 1000 -> NaN
-dddiv828 divide NaN Inf -> NaN
-dddiv829 divide NaN NaN -> NaN
-dddiv830 divide -Inf NaN -> NaN
-dddiv831 divide -1000 NaN -> NaN
-dddiv832 divide -1 NaN -> NaN
-dddiv833 divide -0 NaN -> NaN
-dddiv834 divide 0 NaN -> NaN
-dddiv835 divide 1 NaN -> NaN
-dddiv836 divide 1000 NaN -> NaN
-dddiv837 divide Inf NaN -> NaN
-
-dddiv841 divide sNaN -Inf -> NaN Invalid_operation
-dddiv842 divide sNaN -1000 -> NaN Invalid_operation
-dddiv843 divide sNaN -1 -> NaN Invalid_operation
-dddiv844 divide sNaN -0 -> NaN Invalid_operation
-dddiv845 divide sNaN 0 -> NaN Invalid_operation
-dddiv846 divide sNaN 1 -> NaN Invalid_operation
-dddiv847 divide sNaN 1000 -> NaN Invalid_operation
-dddiv848 divide sNaN NaN -> NaN Invalid_operation
-dddiv849 divide sNaN sNaN -> NaN Invalid_operation
-dddiv850 divide NaN sNaN -> NaN Invalid_operation
-dddiv851 divide -Inf sNaN -> NaN Invalid_operation
-dddiv852 divide -1000 sNaN -> NaN Invalid_operation
-dddiv853 divide -1 sNaN -> NaN Invalid_operation
-dddiv854 divide -0 sNaN -> NaN Invalid_operation
-dddiv855 divide 0 sNaN -> NaN Invalid_operation
-dddiv856 divide 1 sNaN -> NaN Invalid_operation
-dddiv857 divide 1000 sNaN -> NaN Invalid_operation
-dddiv858 divide Inf sNaN -> NaN Invalid_operation
-dddiv859 divide NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dddiv861 divide NaN9 -Inf -> NaN9
-dddiv862 divide NaN8 1000 -> NaN8
-dddiv863 divide NaN7 Inf -> NaN7
-dddiv864 divide NaN6 NaN5 -> NaN6
-dddiv865 divide -Inf NaN4 -> NaN4
-dddiv866 divide -1000 NaN3 -> NaN3
-dddiv867 divide Inf NaN2 -> NaN2
-
-dddiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation
-dddiv872 divide sNaN98 -1 -> NaN98 Invalid_operation
-dddiv873 divide sNaN97 NaN -> NaN97 Invalid_operation
-dddiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
-dddiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
-dddiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation
-dddiv877 divide 0 sNaN91 -> NaN91 Invalid_operation
-dddiv878 divide Inf sNaN90 -> NaN90 Invalid_operation
-dddiv879 divide NaN sNaN89 -> NaN89 Invalid_operation
-
-dddiv881 divide -NaN9 -Inf -> -NaN9
-dddiv882 divide -NaN8 1000 -> -NaN8
-dddiv883 divide -NaN7 Inf -> -NaN7
-dddiv884 divide -NaN6 -NaN5 -> -NaN6
-dddiv885 divide -Inf -NaN4 -> -NaN4
-dddiv886 divide -1000 -NaN3 -> -NaN3
-dddiv887 divide Inf -NaN2 -> -NaN2
-
-dddiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
-dddiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
-dddiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
-dddiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
-dddiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-dddiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
-dddiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
-dddiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
-dddiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- Various flavours of divide by 0
-dddiv901 divide 0 0 -> NaN Division_undefined
-dddiv902 divide 0.0E5 0 -> NaN Division_undefined
-dddiv903 divide 0.000 0 -> NaN Division_undefined
-dddiv904 divide 0.0001 0 -> Infinity Division_by_zero
-dddiv905 divide 0.01 0 -> Infinity Division_by_zero
-dddiv906 divide 0.1 0 -> Infinity Division_by_zero
-dddiv907 divide 1 0 -> Infinity Division_by_zero
-dddiv908 divide 1 0.0 -> Infinity Division_by_zero
-dddiv909 divide 10 0.0 -> Infinity Division_by_zero
-dddiv910 divide 1E+100 0.0 -> Infinity Division_by_zero
-dddiv911 divide 1E+100 0 -> Infinity Division_by_zero
-
-dddiv921 divide -0.0001 0 -> -Infinity Division_by_zero
-dddiv922 divide -0.01 0 -> -Infinity Division_by_zero
-dddiv923 divide -0.1 0 -> -Infinity Division_by_zero
-dddiv924 divide -1 0 -> -Infinity Division_by_zero
-dddiv925 divide -1 0.0 -> -Infinity Division_by_zero
-dddiv926 divide -10 0.0 -> -Infinity Division_by_zero
-dddiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero
-dddiv928 divide -1E+100 0 -> -Infinity Division_by_zero
-
-dddiv931 divide 0.0001 -0 -> -Infinity Division_by_zero
-dddiv932 divide 0.01 -0 -> -Infinity Division_by_zero
-dddiv933 divide 0.1 -0 -> -Infinity Division_by_zero
-dddiv934 divide 1 -0 -> -Infinity Division_by_zero
-dddiv935 divide 1 -0.0 -> -Infinity Division_by_zero
-dddiv936 divide 10 -0.0 -> -Infinity Division_by_zero
-dddiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
-dddiv938 divide 1E+100 -0 -> -Infinity Division_by_zero
-
-dddiv941 divide -0.0001 -0 -> Infinity Division_by_zero
-dddiv942 divide -0.01 -0 -> Infinity Division_by_zero
-dddiv943 divide -0.1 -0 -> Infinity Division_by_zero
-dddiv944 divide -1 -0 -> Infinity Division_by_zero
-dddiv945 divide -1 -0.0 -> Infinity Division_by_zero
-dddiv946 divide -10 -0.0 -> Infinity Division_by_zero
-dddiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero
-dddiv948 divide -1E+100 -0 -> Infinity Division_by_zero
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dddiv1021 divide 1E0 1E0 -> 1
-dddiv1022 divide 1E0 2E0 -> 0.5
-dddiv1023 divide 1E0 3E0 -> 0.3333333333333333 Inexact Rounded
-dddiv1024 divide 100E-2 1000E-3 -> 1
-dddiv1025 divide 24E-1 2E0 -> 1.2
-dddiv1026 divide 2400E-3 2E0 -> 1.200
-dddiv1027 divide 5E0 2E0 -> 2.5
-dddiv1028 divide 5E0 20E-1 -> 2.5
-dddiv1029 divide 5E0 2000E-3 -> 2.5
-dddiv1030 divide 5E0 2E-1 -> 25
-dddiv1031 divide 5E0 20E-2 -> 25
-dddiv1032 divide 480E-2 3E0 -> 1.60
-dddiv1033 divide 47E-1 2E0 -> 2.35
-
--- ECMAScript bad examples
-rounding: half_down
-dddiv1040 divide 5 9 -> 0.5555555555555556 Inexact Rounded
-rounding: half_even
-dddiv1041 divide 6 11 -> 0.5454545454545455 Inexact Rounded
-
--- overflow and underflow tests .. note subnormal results
--- signs
-dddiv1051 divide 1e+277 1e-311 -> Infinity Overflow Inexact Rounded
-dddiv1052 divide 1e+277 -1e-311 -> -Infinity Overflow Inexact Rounded
-dddiv1053 divide -1e+277 1e-311 -> -Infinity Overflow Inexact Rounded
-dddiv1054 divide -1e+277 -1e-311 -> Infinity Overflow Inexact Rounded
-dddiv1055 divide 1e-277 1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1056 divide 1e-277 -1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1057 divide -1e-277 1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1058 divide -1e-277 -1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dddiv1060 divide 1e-291 1e+101 -> 1E-392 Subnormal
-dddiv1061 divide 1e-291 1e+102 -> 1E-393 Subnormal
-dddiv1062 divide 1e-291 1e+103 -> 1E-394 Subnormal
-dddiv1063 divide 1e-291 1e+104 -> 1E-395 Subnormal
-dddiv1064 divide 1e-291 1e+105 -> 1E-396 Subnormal
-dddiv1065 divide 1e-291 1e+106 -> 1E-397 Subnormal
-dddiv1066 divide 1e-291 1e+107 -> 1E-398 Subnormal
-dddiv1067 divide 1e-291 1e+108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1068 divide 1e-291 1e+109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1069 divide 1e-291 1e+110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-dddiv1070 divide 1e+60 1e-321 -> 1.000000000000E+381 Clamped
-dddiv1071 divide 1e+60 1e-322 -> 1.0000000000000E+382 Clamped
-dddiv1072 divide 1e+60 1e-323 -> 1.00000000000000E+383 Clamped
-dddiv1073 divide 1e+60 1e-324 -> 1.000000000000000E+384 Clamped
-dddiv1074 divide 1e+60 1e-325 -> Infinity Overflow Inexact Rounded
-dddiv1075 divide 1e+60 1e-326 -> Infinity Overflow Inexact Rounded
-dddiv1076 divide 1e+60 1e-327 -> Infinity Overflow Inexact Rounded
-dddiv1077 divide 1e+60 1e-328 -> Infinity Overflow Inexact Rounded
-dddiv1078 divide 1e+60 1e-329 -> Infinity Overflow Inexact Rounded
-dddiv1079 divide 1e+60 1e-330 -> Infinity Overflow Inexact Rounded
-
-dddiv1101 divide 1.0000E-394 1 -> 1.0000E-394 Subnormal
-dddiv1102 divide 1.000E-394 1e+1 -> 1.000E-395 Subnormal
-dddiv1103 divide 1.00E-394 1e+2 -> 1.00E-396 Subnormal
-dddiv1104 divide 1.0E-394 1e+3 -> 1.0E-397 Subnormal
-dddiv1105 divide 1.0E-394 1e+4 -> 1E-398 Subnormal Rounded
-dddiv1106 divide 1.3E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
-dddiv1107 divide 1.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1108 divide 1.7E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1109 divide 2.3E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1110 divide 2.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1111 divide 2.7E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
-dddiv1112 divide 1.49E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
-dddiv1113 divide 1.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1114 divide 1.51E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1115 divide 2.49E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1116 divide 2.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1117 divide 2.51E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
-
-dddiv1118 divide 1E-394 1e+4 -> 1E-398 Subnormal
-dddiv1119 divide 3E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1120 divide 5E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1121 divide 7E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
-dddiv1122 divide 9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
-dddiv1123 divide 9.9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
-
-dddiv1124 divide 1E-394 -1e+4 -> -1E-398 Subnormal
-dddiv1125 divide 3E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1126 divide -5E-394 1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1127 divide 7E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
-dddiv1128 divide -9E-394 1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
-dddiv1129 divide 9.9E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
-dddiv1130 divide 3.0E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-dddiv1131 divide 1.0E-199 1e+200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1132 divide 1.0E-199 1e+199 -> 1E-398 Subnormal Rounded
-dddiv1133 divide 1.0E-199 1e+198 -> 1.0E-397 Subnormal
-dddiv1134 divide 2.0E-199 2e+198 -> 1.0E-397 Subnormal
-dddiv1135 divide 4.0E-199 4e+198 -> 1.0E-397 Subnormal
-dddiv1136 divide 10.0E-199 10e+198 -> 1.0E-397 Subnormal
-dddiv1137 divide 30.0E-199 30e+198 -> 1.0E-397 Subnormal
-
--- randoms
-dddiv2010 divide -3.303226714900711E-35 8.796578842713183E+73 -> -3.755126594058783E-109 Inexact Rounded
-dddiv2011 divide 933153327821073.6 68782181090246.25 -> 13.56678885475763 Inexact Rounded
-dddiv2012 divide 5.04752436057906E-72 -8.179481771238642E+64 -> -6.170958627632835E-137 Inexact Rounded
-dddiv2013 divide -3707613309582318 3394911196503.048 -> -1092.109070010836 Inexact Rounded
-dddiv2014 divide 99689.0555190461 -4.735208553891464 -> -21052.72753765411 Inexact Rounded
-dddiv2015 divide -1447915775613329 269750797.8184875 -> -5367605.164925653 Inexact Rounded
-dddiv2016 divide -9.394881304225258E-19 -830585.0252671636 -> 1.131116143251358E-24 Inexact Rounded
-dddiv2017 divide -1.056283432738934 88.58754555124013 -> -0.01192361100159352 Inexact Rounded
-dddiv2018 divide 5763220933343.081 689089567025052.1 -> 0.008363529516524456 Inexact Rounded
-dddiv2019 divide 873819.122103216 9.740612494523300E-49 -> 8.970884763093948E+53 Inexact Rounded
-dddiv2020 divide 8022914.838533576 6178.566801742713 -> 1298.507420243583 Inexact Rounded
-dddiv2021 divide 203982.7605650363 -2158.283639053435 -> -94.51156320422168 Inexact Rounded
-dddiv2022 divide 803.6310547013030 7101143795399.238 -> 1.131692411611166E-10 Inexact Rounded
-dddiv2023 divide 9.251697842123399E-82 -1.342350220606119E-7 -> -6.892163982321936E-75 Inexact Rounded
-dddiv2024 divide -1.980600645637992E-53 -5.474262753214457E+77 -> 3.618022617703168E-131 Inexact Rounded
-dddiv2025 divide -210.0322996351690 -8.580951835872843E+80 -> 2.447657365434971E-79 Inexact Rounded
-dddiv2026 divide -1.821980314020370E+85 -3.018915267138165 -> 6.035215144503042E+84 Inexact Rounded
-dddiv2027 divide -772264503601.1047 5.158258271408988E-86 -> -1.497141986630614E+97 Inexact Rounded
-dddiv2028 divide -767.0532415847106 2.700027228028939E-59 -> -2.840909282772941E+61 Inexact Rounded
-dddiv2029 divide 496724.8548250093 7.32700588163100E+66 -> 6.779370220929013E-62 Inexact Rounded
-dddiv2030 divide -304232651447703.9 -108.9730808657440 -> 2791814721862.565 Inexact Rounded
-dddiv2031 divide -7.233817192699405E+42 -5711302004.149411 -> 1.266579352211430E+33 Inexact Rounded
-dddiv2032 divide -9.999221444912745E+96 4010569406446197 -> -2.493217404202250E+81 Inexact Rounded
-dddiv2033 divide -1837272.061937622 8.356322838066762 -> -219866.0939196882 Inexact Rounded
-dddiv2034 divide 2168.517555606529 209.1910258615061 -> 10.36620737756784 Inexact Rounded
-dddiv2035 divide -1.884389790576371E+88 2.95181953870583E+20 -> -6.383824505079828E+67 Inexact Rounded
-dddiv2036 divide 732263.6037438196 961222.3634446889 -> 0.7618045850698269 Inexact Rounded
-dddiv2037 divide -813461419.0348336 5.376293753809143E+84 -> -1.513052404285927E-76 Inexact Rounded
-dddiv2038 divide -45562133508108.50 -9.776843494690107E+51 -> 4.660208945029519E-39 Inexact Rounded
-dddiv2039 divide -6.489393172441016E+80 -9101965.097852113 -> 7.129661674897421E+73 Inexact Rounded
-dddiv2040 divide 3.694576237117349E+93 6683512.012622003 -> 5.527896456443912E+86 Inexact Rounded
-dddiv2041 divide -2.252877726403272E+19 -7451913256.181367 -> 3023220546.125531 Inexact Rounded
-dddiv2042 divide 518303.1989111842 50.01587020474133 -> 10362.77479107123 Inexact Rounded
-dddiv2043 divide 2.902087881880103E+24 33.32400992305702 -> 8.708699488989578E+22 Inexact Rounded
-dddiv2044 divide 549619.4559510557 1660824845196338 -> 3.309316196351104E-10 Inexact Rounded
-dddiv2045 divide -6775670774684043 8292152023.077262 -> -817118.4941891062 Inexact Rounded
-dddiv2046 divide -77.50923921524079 -5.636882655425815E+74 -> 1.375037302588405E-73 Inexact Rounded
-dddiv2047 divide -2.984889459605149E-10 -88106156784122.99 -> 3.387833005721384E-24 Inexact Rounded
-dddiv2048 divide 0.949517293997085 44767115.96450998 -> 2.121015110175589E-8 Inexact Rounded
-dddiv2049 divide -2760937211.084521 -1087015876975408 -> 0.000002539923537057024 Inexact Rounded
-dddiv2050 divide 28438351.85030536 -4.209397904088624E-47 -> -6.755919135770688E+53 Inexact Rounded
-dddiv2051 divide -85562731.6820956 -7.166045442530185E+45 -> 1.194002080621542E-38 Inexact Rounded
-dddiv2052 divide 2533802852165.25 7154.119606235955 -> 354173957.3317501 Inexact Rounded
-dddiv2053 divide -8858831346851.474 97.59734208801716 -> -90769186509.83577 Inexact Rounded
-dddiv2054 divide 176783629801387.5 840073263.3109817 -> 210438.3480848206 Inexact Rounded
-dddiv2055 divide -493506471796175.6 79733894790822.03 -> -6.189418854940746 Inexact Rounded
-dddiv2056 divide 790.1682542103445 829.9449370367435 -> 0.9520731062371214 Inexact Rounded
-dddiv2057 divide -8920459838.583164 -4767.889187899214 -> 1870945.294035581 Inexact Rounded
-dddiv2058 divide 53536687164422.1 53137.5007032689 -> 1007512330.385698 Inexact Rounded
-dddiv2059 divide 4.051532311146561E-74 -2.343089768972261E+94 -> -1.729140882606332E-168 Inexact Rounded
-dddiv2060 divide -14847758778636.88 3.062543516383807E-43 -> -4.848178874587497E+55 Inexact Rounded
-
--- Division probably has pre-rounding, so need to test rounding
--- explicitly rather than assume included through other tests;
--- tests include simple rounding and also the tricky cases of sticky
--- bits following two zeros
---
--- 1/99999 gives 0.0000100001000010000100001000010000100001
--- 1234567890123456
---
--- 1/999999 gives 0.000001000001000001000001000001000001000001
--- 1234567890123456
-
-rounding: ceiling
-dddiv3001 divide 1 3 -> 0.3333333333333334 Inexact Rounded
-dddiv3002 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3003 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
-dddiv3004 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
-
-rounding: floor
-dddiv3011 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3012 divide 2 3 -> 0.6666666666666666 Inexact Rounded
-dddiv3013 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3014 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: up
-dddiv3021 divide 1 3 -> 0.3333333333333334 Inexact Rounded
-dddiv3022 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3023 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
-dddiv3024 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
-
-rounding: down
-dddiv3031 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3032 divide 2 3 -> 0.6666666666666666 Inexact Rounded
-dddiv3033 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3034 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: half_up
-dddiv3041 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3042 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3043 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3044 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: half_down
-dddiv3051 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3052 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3053 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3054 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: half_even
-dddiv3061 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3062 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3063 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3064 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: 05up
-dddiv3071 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3072 divide 2 3 -> 0.6666666666666666 Inexact Rounded
-dddiv3073 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3074 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
-
--- random divide tests with result near 1
-rounding: half_even
-dddiv4001 divide 3195385192916917 3195385192946695 -> 0.9999999999906809 Inexact Rounded
-dddiv4002 divide 1393723067526993 1393723067519475 -> 1.000000000005394 Inexact Rounded
-dddiv4003 divide 759985543702302 759985543674015 -> 1.000000000037220 Inexact Rounded
-dddiv4004 divide 9579158456027302 9579158456036864 -> 0.9999999999990018 Inexact Rounded
-dddiv4005 divide 7079398299143569 7079398299156904 -> 0.9999999999981164 Inexact Rounded
-dddiv4006 divide 6636169255366598 6636169255336386 -> 1.000000000004553 Inexact Rounded
-dddiv4007 divide 6964813971340090 6964813971321554 -> 1.000000000002661 Inexact Rounded
-dddiv4008 divide 4182275225480784 4182275225454009 -> 1.000000000006402 Inexact Rounded
-dddiv4009 divide 9228325124938029 9228325124918730 -> 1.000000000002091 Inexact Rounded
-dddiv4010 divide 3428346338630192 3428346338609843 -> 1.000000000005936 Inexact Rounded
-dddiv4011 divide 2143511550722893 2143511550751754 -> 0.9999999999865356 Inexact Rounded
-dddiv4012 divide 1672732924396785 1672732924401811 -> 0.9999999999969953 Inexact Rounded
-dddiv4013 divide 4190714611948216 4190714611948664 -> 0.9999999999998931 Inexact Rounded
-dddiv4014 divide 3942254800848877 3942254800814556 -> 1.000000000008706 Inexact Rounded
-dddiv4015 divide 2854459826952334 2854459826960762 -> 0.9999999999970474 Inexact Rounded
-dddiv4016 divide 2853258953664731 2853258953684471 -> 0.9999999999930816 Inexact Rounded
-dddiv4017 divide 9453512638125978 9453512638146425 -> 0.9999999999978371 Inexact Rounded
-dddiv4018 divide 339476633940369 339476633912887 -> 1.000000000080954 Inexact Rounded
-dddiv4019 divide 4542181492688467 4542181492697735 -> 0.9999999999979596 Inexact Rounded
-dddiv4020 divide 7312600192399197 7312600192395424 -> 1.000000000000516 Inexact Rounded
-dddiv4021 divide 1811674985570111 1811674985603935 -> 0.9999999999813300 Inexact Rounded
-dddiv4022 divide 1706462639003481 1706462639017740 -> 0.9999999999916441 Inexact Rounded
-dddiv4023 divide 6697052654940368 6697052654934110 -> 1.000000000000934 Inexact Rounded
-dddiv4024 divide 5015283664277539 5015283664310719 -> 0.9999999999933842 Inexact Rounded
-dddiv4025 divide 2359501561537464 2359501561502464 -> 1.000000000014834 Inexact Rounded
-dddiv4026 divide 2669850227909157 2669850227901548 -> 1.000000000002850 Inexact Rounded
-dddiv4027 divide 9329725546974648 9329725547002445 -> 0.9999999999970206 Inexact Rounded
-dddiv4028 divide 3228562867071248 3228562867106206 -> 0.9999999999891723 Inexact Rounded
-dddiv4029 divide 4862226644921175 4862226644909380 -> 1.000000000002426 Inexact Rounded
-dddiv4030 divide 1022267997054529 1022267997071329 -> 0.9999999999835660 Inexact Rounded
-dddiv4031 divide 1048777482023719 1048777482000948 -> 1.000000000021712 Inexact Rounded
-dddiv4032 divide 9980113777337098 9980113777330539 -> 1.000000000000657 Inexact Rounded
-dddiv4033 divide 7506839167963908 7506839167942901 -> 1.000000000002798 Inexact Rounded
-dddiv4034 divide 231119751977860 231119751962453 -> 1.000000000066662 Inexact Rounded
-dddiv4035 divide 4034903664762962 4034903664795526 -> 0.9999999999919294 Inexact Rounded
-dddiv4036 divide 5700122152274696 5700122152251386 -> 1.000000000004089 Inexact Rounded
-dddiv4037 divide 6869599590293110 6869599590293495 -> 0.9999999999999440 Inexact Rounded
-dddiv4038 divide 5576281960092797 5576281960105579 -> 0.9999999999977078 Inexact Rounded
-dddiv4039 divide 2304844888381318 2304844888353073 -> 1.000000000012255 Inexact Rounded
-dddiv4040 divide 3265933651656452 3265933651682779 -> 0.9999999999919389 Inexact Rounded
-dddiv4041 divide 5235714985079914 5235714985066131 -> 1.000000000002632 Inexact Rounded
-dddiv4042 divide 5578481572827551 5578481572822945 -> 1.000000000000826 Inexact Rounded
-dddiv4043 divide 4909616081396134 4909616081373076 -> 1.000000000004696 Inexact Rounded
-dddiv4044 divide 636447224349537 636447224338757 -> 1.000000000016938 Inexact Rounded
-dddiv4045 divide 1539373428396640 1539373428364727 -> 1.000000000020731 Inexact Rounded
-dddiv4046 divide 2028786707377893 2028786707378866 -> 0.9999999999995204 Inexact Rounded
-dddiv4047 divide 137643260486222 137643260487419 -> 0.9999999999913036 Inexact Rounded
-dddiv4048 divide 247451519746765 247451519752267 -> 0.9999999999777653 Inexact Rounded
-dddiv4049 divide 7877858475022054 7877858474999794 -> 1.000000000002826 Inexact Rounded
-dddiv4050 divide 7333242694766258 7333242694744628 -> 1.000000000002950 Inexact Rounded
-dddiv4051 divide 124051503698592 124051503699397 -> 0.9999999999935108 Inexact Rounded
-dddiv4052 divide 8944737432385188 8944737432406860 -> 0.9999999999975771 Inexact Rounded
-dddiv4053 divide 9883948923406874 9883948923424843 -> 0.9999999999981820 Inexact Rounded
-dddiv4054 divide 6829178741654284 6829178741671973 -> 0.9999999999974098 Inexact Rounded
-dddiv4055 divide 7342752479768122 7342752479793385 -> 0.9999999999965595 Inexact Rounded
-dddiv4056 divide 8066426579008783 8066426578977563 -> 1.000000000003870 Inexact Rounded
-dddiv4057 divide 8992775071383295 8992775071352712 -> 1.000000000003401 Inexact Rounded
-dddiv4058 divide 5485011755545641 5485011755543611 -> 1.000000000000370 Inexact Rounded
-dddiv4059 divide 5779983054353918 5779983054365300 -> 0.9999999999980308 Inexact Rounded
-dddiv4060 divide 9502265102713774 9502265102735208 -> 0.9999999999977443 Inexact Rounded
-dddiv4061 divide 2109558399130981 2109558399116281 -> 1.000000000006968 Inexact Rounded
-dddiv4062 divide 5296182636350471 5296182636351521 -> 0.9999999999998017 Inexact Rounded
-dddiv4063 divide 1440019225591883 1440019225601844 -> 0.9999999999930827 Inexact Rounded
-dddiv4064 divide 8182110791881341 8182110791847174 -> 1.000000000004176 Inexact Rounded
-dddiv4065 divide 489098235512060 489098235534516 -> 0.9999999999540869 Inexact Rounded
-dddiv4066 divide 6475687084782038 6475687084756089 -> 1.000000000004007 Inexact Rounded
-dddiv4067 divide 8094348555736948 8094348555759236 -> 0.9999999999972465 Inexact Rounded
-dddiv4068 divide 1982766816291543 1982766816309463 -> 0.9999999999909621 Inexact Rounded
-dddiv4069 divide 9277314300113251 9277314300084467 -> 1.000000000003103 Inexact Rounded
-dddiv4070 divide 4335532959318934 4335532959293167 -> 1.000000000005943 Inexact Rounded
-dddiv4071 divide 7767113032981348 7767113032968132 -> 1.000000000001702 Inexact Rounded
-dddiv4072 divide 1578548053342868 1578548053370448 -> 0.9999999999825282 Inexact Rounded
-dddiv4073 divide 3790420686666898 3790420686636315 -> 1.000000000008068 Inexact Rounded
-dddiv4074 divide 871682421955147 871682421976441 -> 0.9999999999755714 Inexact Rounded
-dddiv4075 divide 744141054479940 744141054512329 -> 0.9999999999564746 Inexact Rounded
-dddiv4076 divide 8956824183670735 8956824183641741 -> 1.000000000003237 Inexact Rounded
-dddiv4077 divide 8337291694485682 8337291694451193 -> 1.000000000004137 Inexact Rounded
-dddiv4078 divide 4107775944683669 4107775944657097 -> 1.000000000006469 Inexact Rounded
-dddiv4079 divide 8691900057964648 8691900057997555 -> 0.9999999999962141 Inexact Rounded
-dddiv4080 divide 2229528520536462 2229528520502337 -> 1.000000000015306 Inexact Rounded
-dddiv4081 divide 398442083774322 398442083746273 -> 1.000000000070397 Inexact Rounded
-dddiv4082 divide 5319819776808759 5319819776838313 -> 0.9999999999944445 Inexact Rounded
-dddiv4083 divide 7710491299066855 7710491299041858 -> 1.000000000003242 Inexact Rounded
-dddiv4084 divide 9083231296087266 9083231296058160 -> 1.000000000003204 Inexact Rounded
-dddiv4085 divide 3566873574904559 3566873574890328 -> 1.000000000003990 Inexact Rounded
-dddiv4086 divide 596343290550525 596343290555614 -> 0.9999999999914663 Inexact Rounded
-dddiv4087 divide 278227925093192 278227925068104 -> 1.000000000090171 Inexact Rounded
-dddiv4088 divide 3292902958490649 3292902958519881 -> 0.9999999999911227 Inexact Rounded
-dddiv4089 divide 5521871364245881 5521871364229536 -> 1.000000000002960 Inexact Rounded
-dddiv4090 divide 2406505602883617 2406505602857997 -> 1.000000000010646 Inexact Rounded
-dddiv4091 divide 7741146984869208 7741146984867255 -> 1.000000000000252 Inexact Rounded
-dddiv4092 divide 4576041832414909 4576041832405102 -> 1.000000000002143 Inexact Rounded
-dddiv4093 divide 9183756982878057 9183756982901934 -> 0.9999999999974001 Inexact Rounded
-dddiv4094 divide 6215736513855159 6215736513870342 -> 0.9999999999975573 Inexact Rounded
-dddiv4095 divide 248554968534533 248554968551417 -> 0.9999999999320714 Inexact Rounded
-dddiv4096 divide 376314165668645 376314165659755 -> 1.000000000023624 Inexact Rounded
-dddiv4097 divide 5513569249809718 5513569249808906 -> 1.000000000000147 Inexact Rounded
-dddiv4098 divide 3367992242167904 3367992242156228 -> 1.000000000003467 Inexact Rounded
-dddiv4099 divide 6134869538966967 6134869538985986 -> 0.9999999999968999 Inexact Rounded
-
--- Null tests
-dddiv9998 divide 10 # -> NaN Invalid_operation
-dddiv9999 divide # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddDivide.decTest -- decDouble division --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+dddiv001 divide 1 1 -> 1
+dddiv002 divide 2 1 -> 2
+dddiv003 divide 1 2 -> 0.5
+dddiv004 divide 2 2 -> 1
+dddiv005 divide 0 1 -> 0
+dddiv006 divide 0 2 -> 0
+dddiv007 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv008 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv009 divide 3 3 -> 1
+
+dddiv010 divide 2.4 1 -> 2.4
+dddiv011 divide 2.4 -1 -> -2.4
+dddiv012 divide -2.4 1 -> -2.4
+dddiv013 divide -2.4 -1 -> 2.4
+dddiv014 divide 2.40 1 -> 2.40
+dddiv015 divide 2.400 1 -> 2.400
+dddiv016 divide 2.4 2 -> 1.2
+dddiv017 divide 2.400 2 -> 1.200
+dddiv018 divide 2. 2 -> 1
+dddiv019 divide 20 20 -> 1
+
+dddiv020 divide 187 187 -> 1
+dddiv021 divide 5 2 -> 2.5
+dddiv022 divide 50 20 -> 2.5
+dddiv023 divide 500 200 -> 2.5
+dddiv024 divide 50.0 20.0 -> 2.5
+dddiv025 divide 5.00 2.00 -> 2.5
+dddiv026 divide 5 2.0 -> 2.5
+dddiv027 divide 5 2.000 -> 2.5
+dddiv028 divide 5 0.20 -> 25
+dddiv029 divide 5 0.200 -> 25
+dddiv030 divide 10 1 -> 10
+dddiv031 divide 100 1 -> 100
+dddiv032 divide 1000 1 -> 1000
+dddiv033 divide 1000 100 -> 10
+
+dddiv035 divide 1 2 -> 0.5
+dddiv036 divide 1 4 -> 0.25
+dddiv037 divide 1 8 -> 0.125
+dddiv038 divide 1 16 -> 0.0625
+dddiv039 divide 1 32 -> 0.03125
+dddiv040 divide 1 64 -> 0.015625
+dddiv041 divide 1 -2 -> -0.5
+dddiv042 divide 1 -4 -> -0.25
+dddiv043 divide 1 -8 -> -0.125
+dddiv044 divide 1 -16 -> -0.0625
+dddiv045 divide 1 -32 -> -0.03125
+dddiv046 divide 1 -64 -> -0.015625
+dddiv047 divide -1 2 -> -0.5
+dddiv048 divide -1 4 -> -0.25
+dddiv049 divide -1 8 -> -0.125
+dddiv050 divide -1 16 -> -0.0625
+dddiv051 divide -1 32 -> -0.03125
+dddiv052 divide -1 64 -> -0.015625
+dddiv053 divide -1 -2 -> 0.5
+dddiv054 divide -1 -4 -> 0.25
+dddiv055 divide -1 -8 -> 0.125
+dddiv056 divide -1 -16 -> 0.0625
+dddiv057 divide -1 -32 -> 0.03125
+dddiv058 divide -1 -64 -> 0.015625
+
+-- bcdTime
+dddiv060 divide 1 7 -> 0.1428571428571429 Inexact Rounded
+dddiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717 Inexact Rounded
+
+-- 1234567890123456
+dddiv071 divide 9999999999999999 1 -> 9999999999999999
+dddiv072 divide 999999999999999 1 -> 999999999999999
+dddiv073 divide 99999999999999 1 -> 99999999999999
+dddiv074 divide 9999999999999 1 -> 9999999999999
+dddiv075 divide 999999999999 1 -> 999999999999
+dddiv076 divide 99999999999 1 -> 99999999999
+dddiv077 divide 9999999999 1 -> 9999999999
+dddiv078 divide 999999999 1 -> 999999999
+dddiv079 divide 99999999 1 -> 99999999
+dddiv080 divide 9999999 1 -> 9999999
+dddiv081 divide 999999 1 -> 999999
+dddiv082 divide 99999 1 -> 99999
+dddiv083 divide 9999 1 -> 9999
+dddiv084 divide 999 1 -> 999
+dddiv085 divide 99 1 -> 99
+dddiv086 divide 9 1 -> 9
+
+dddiv090 divide 0. 1 -> 0
+dddiv091 divide .0 1 -> 0.0
+dddiv092 divide 0.00 1 -> 0.00
+dddiv093 divide 0.00E+9 1 -> 0E+7
+dddiv094 divide 0.0000E-50 1 -> 0E-54
+
+dddiv095 divide 1 1E-8 -> 1E+8
+dddiv096 divide 1 1E-9 -> 1E+9
+dddiv097 divide 1 1E-10 -> 1E+10
+dddiv098 divide 1 1E-11 -> 1E+11
+dddiv099 divide 1 1E-12 -> 1E+12
+
+dddiv100 divide 1 1 -> 1
+dddiv101 divide 1 2 -> 0.5
+dddiv102 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv103 divide 1 4 -> 0.25
+dddiv104 divide 1 5 -> 0.2
+dddiv105 divide 1 6 -> 0.1666666666666667 Inexact Rounded
+dddiv106 divide 1 7 -> 0.1428571428571429 Inexact Rounded
+dddiv107 divide 1 8 -> 0.125
+dddiv108 divide 1 9 -> 0.1111111111111111 Inexact Rounded
+dddiv109 divide 1 10 -> 0.1
+dddiv110 divide 1 1 -> 1
+dddiv111 divide 2 1 -> 2
+dddiv112 divide 3 1 -> 3
+dddiv113 divide 4 1 -> 4
+dddiv114 divide 5 1 -> 5
+dddiv115 divide 6 1 -> 6
+dddiv116 divide 7 1 -> 7
+dddiv117 divide 8 1 -> 8
+dddiv118 divide 9 1 -> 9
+dddiv119 divide 10 1 -> 10
+
+dddiv120 divide 3E+1 0.001 -> 3E+4
+dddiv121 divide 2.200 2 -> 1.100
+
+dddiv130 divide 12345 4.999 -> 2469.493898779756 Inexact Rounded
+dddiv131 divide 12345 4.99 -> 2473.947895791583 Inexact Rounded
+dddiv132 divide 12345 4.9 -> 2519.387755102041 Inexact Rounded
+dddiv133 divide 12345 5 -> 2469
+dddiv134 divide 12345 5.1 -> 2420.588235294118 Inexact Rounded
+dddiv135 divide 12345 5.01 -> 2464.071856287425 Inexact Rounded
+dddiv136 divide 12345 5.001 -> 2468.506298740252 Inexact Rounded
+
+-- test possibly imprecise results
+dddiv220 divide 391 597 -> 0.6549413735343384 Inexact Rounded
+dddiv221 divide 391 -597 -> -0.6549413735343384 Inexact Rounded
+dddiv222 divide -391 597 -> -0.6549413735343384 Inexact Rounded
+dddiv223 divide -391 -597 -> 0.6549413735343384 Inexact Rounded
+
+-- test some cases that are close to exponent overflow, some with coefficient padding
+dddiv270 divide 1 1e384 -> 1E-384 Subnormal
+dddiv271 divide 1 0.9e384 -> 1.11111111111111E-384 Rounded Inexact Subnormal Underflow
+dddiv272 divide 1 0.99e384 -> 1.01010101010101E-384 Rounded Inexact Subnormal Underflow
+dddiv273 divide 1 0.9999999999999999e384 -> 1.00000000000000E-384 Rounded Inexact Subnormal Underflow
+dddiv274 divide 9e384 1 -> 9.000000000000000E+384 Clamped
+dddiv275 divide 9.9e384 1 -> 9.900000000000000E+384 Clamped
+dddiv276 divide 9.99e384 1 -> 9.990000000000000E+384 Clamped
+dddiv277 divide 9.9999999999999e384 1 -> 9.999999999999900E+384 Clamped
+dddiv278 divide 9.99999999999999e384 1 -> 9.999999999999990E+384 Clamped
+dddiv279 divide 9.999999999999999e384 1 -> 9.999999999999999E+384
+
+dddiv285 divide 9.9e384 1.1 -> 9.000000000000000E+384 Clamped
+dddiv286 divide 9.99e384 1.1 -> 9.081818181818182E+384 Inexact Rounded
+dddiv287 divide 9.9999999999999e384 1.1 -> 9.090909090909000E+384 Clamped
+dddiv288 divide 9.99999999999999e384 1.1 -> 9.090909090909082E+384 Inexact Rounded
+dddiv289 divide 9.999999999999999e384 1.1 -> 9.090909090909090E+384 Clamped
+
+
+-- Divide into 0 tests
+dddiv301 divide 0 7 -> 0
+dddiv302 divide 0 7E-5 -> 0E+5
+dddiv303 divide 0 7E-1 -> 0E+1
+dddiv304 divide 0 7E+1 -> 0.0
+dddiv305 divide 0 7E+5 -> 0.00000
+dddiv306 divide 0 7E+6 -> 0.000000
+dddiv307 divide 0 7E+7 -> 0E-7
+dddiv308 divide 0 70E-5 -> 0E+5
+dddiv309 divide 0 70E-1 -> 0E+1
+dddiv310 divide 0 70E+0 -> 0
+dddiv311 divide 0 70E+1 -> 0.0
+dddiv312 divide 0 70E+5 -> 0.00000
+dddiv313 divide 0 70E+6 -> 0.000000
+dddiv314 divide 0 70E+7 -> 0E-7
+dddiv315 divide 0 700E-5 -> 0E+5
+dddiv316 divide 0 700E-1 -> 0E+1
+dddiv317 divide 0 700E+0 -> 0
+dddiv318 divide 0 700E+1 -> 0.0
+dddiv319 divide 0 700E+5 -> 0.00000
+dddiv320 divide 0 700E+6 -> 0.000000
+dddiv321 divide 0 700E+7 -> 0E-7
+dddiv322 divide 0 700E+77 -> 0E-77
+
+dddiv331 divide 0E-3 7E-5 -> 0E+2
+dddiv332 divide 0E-3 7E-1 -> 0.00
+dddiv333 divide 0E-3 7E+1 -> 0.0000
+dddiv334 divide 0E-3 7E+5 -> 0E-8
+dddiv335 divide 0E-1 7E-5 -> 0E+4
+dddiv336 divide 0E-1 7E-1 -> 0
+dddiv337 divide 0E-1 7E+1 -> 0.00
+dddiv338 divide 0E-1 7E+5 -> 0.000000
+dddiv339 divide 0E+1 7E-5 -> 0E+6
+dddiv340 divide 0E+1 7E-1 -> 0E+2
+dddiv341 divide 0E+1 7E+1 -> 0
+dddiv342 divide 0E+1 7E+5 -> 0.0000
+dddiv343 divide 0E+3 7E-5 -> 0E+8
+dddiv344 divide 0E+3 7E-1 -> 0E+4
+dddiv345 divide 0E+3 7E+1 -> 0E+2
+dddiv346 divide 0E+3 7E+5 -> 0.00
+
+-- These were 'input rounding'
+dddiv441 divide 12345678000 1 -> 12345678000
+dddiv442 divide 1 12345678000 -> 8.100000664200054E-11 Inexact Rounded
+dddiv443 divide 1234567800 1 -> 1234567800
+dddiv444 divide 1 1234567800 -> 8.100000664200054E-10 Inexact Rounded
+dddiv445 divide 1234567890 1 -> 1234567890
+dddiv446 divide 1 1234567890 -> 8.100000073710001E-10 Inexact Rounded
+dddiv447 divide 1234567891 1 -> 1234567891
+dddiv448 divide 1 1234567891 -> 8.100000067149001E-10 Inexact Rounded
+dddiv449 divide 12345678901 1 -> 12345678901
+dddiv450 divide 1 12345678901 -> 8.100000073053901E-11 Inexact Rounded
+dddiv451 divide 1234567896 1 -> 1234567896
+dddiv452 divide 1 1234567896 -> 8.100000034344000E-10 Inexact Rounded
+
+-- high-lows
+dddiv453 divide 1e+1 1 -> 1E+1
+dddiv454 divide 1e+1 1.0 -> 1E+1
+dddiv455 divide 1e+1 1.00 -> 1E+1
+dddiv456 divide 1e+2 2 -> 5E+1
+dddiv457 divide 1e+2 2.0 -> 5E+1
+dddiv458 divide 1e+2 2.00 -> 5E+1
+
+-- some from IEEE discussions
+dddiv460 divide 3e0 2e0 -> 1.5
+dddiv461 divide 30e-1 2e0 -> 1.5
+dddiv462 divide 300e-2 2e0 -> 1.50
+dddiv464 divide 3000e-3 2e0 -> 1.500
+dddiv465 divide 3e0 20e-1 -> 1.5
+dddiv466 divide 30e-1 20e-1 -> 1.5
+dddiv467 divide 300e-2 20e-1 -> 1.5
+dddiv468 divide 3000e-3 20e-1 -> 1.50
+dddiv469 divide 3e0 200e-2 -> 1.5
+dddiv470 divide 30e-1 200e-2 -> 1.5
+dddiv471 divide 300e-2 200e-2 -> 1.5
+dddiv472 divide 3000e-3 200e-2 -> 1.5
+dddiv473 divide 3e0 2000e-3 -> 1.5
+dddiv474 divide 30e-1 2000e-3 -> 1.5
+dddiv475 divide 300e-2 2000e-3 -> 1.5
+dddiv476 divide 3000e-3 2000e-3 -> 1.5
+
+-- some reciprocals
+dddiv480 divide 1 1.0E+33 -> 1E-33
+dddiv481 divide 1 10E+33 -> 1E-34
+dddiv482 divide 1 1.0E-33 -> 1E+33
+dddiv483 divide 1 10E-33 -> 1E+32
+
+-- RMS discussion table
+dddiv484 divide 0e5 1e3 -> 0E+2
+dddiv485 divide 0e5 2e3 -> 0E+2
+dddiv486 divide 0e5 10e2 -> 0E+3
+dddiv487 divide 0e5 20e2 -> 0E+3
+dddiv488 divide 0e5 100e1 -> 0E+4
+dddiv489 divide 0e5 200e1 -> 0E+4
+
+dddiv491 divide 1e5 1e3 -> 1E+2
+dddiv492 divide 1e5 2e3 -> 5E+1
+dddiv493 divide 1e5 10e2 -> 1E+2
+dddiv494 divide 1e5 20e2 -> 5E+1
+dddiv495 divide 1e5 100e1 -> 1E+2
+dddiv496 divide 1e5 200e1 -> 5E+1
+
+-- tryzeros cases
+rounding: half_up
+dddiv497 divide 0E+380 1000E-13 -> 0E+369 Clamped
+dddiv498 divide 0E-390 1000E+13 -> 0E-398 Clamped
+
+rounding: half_up
+
+-- focus on trailing zeros issues
+dddiv500 divide 1 9.9 -> 0.1010101010101010 Inexact Rounded
+dddiv501 divide 1 9.09 -> 0.1100110011001100 Inexact Rounded
+dddiv502 divide 1 9.009 -> 0.1110001110001110 Inexact Rounded
+
+dddiv511 divide 1 2 -> 0.5
+dddiv512 divide 1.0 2 -> 0.5
+dddiv513 divide 1.00 2 -> 0.50
+dddiv514 divide 1.000 2 -> 0.500
+dddiv515 divide 1.0000 2 -> 0.5000
+dddiv516 divide 1.00000 2 -> 0.50000
+dddiv517 divide 1.000000 2 -> 0.500000
+dddiv518 divide 1.0000000 2 -> 0.5000000
+dddiv519 divide 1.00 2.00 -> 0.5
+
+dddiv521 divide 2 1 -> 2
+dddiv522 divide 2 1.0 -> 2
+dddiv523 divide 2 1.00 -> 2
+dddiv524 divide 2 1.000 -> 2
+dddiv525 divide 2 1.0000 -> 2
+dddiv526 divide 2 1.00000 -> 2
+dddiv527 divide 2 1.000000 -> 2
+dddiv528 divide 2 1.0000000 -> 2
+dddiv529 divide 2.00 1.00 -> 2
+
+dddiv530 divide 2.40 2 -> 1.20
+dddiv531 divide 2.40 4 -> 0.60
+dddiv532 divide 2.40 10 -> 0.24
+dddiv533 divide 2.40 2.0 -> 1.2
+dddiv534 divide 2.40 4.0 -> 0.6
+dddiv535 divide 2.40 10.0 -> 0.24
+dddiv536 divide 2.40 2.00 -> 1.2
+dddiv537 divide 2.40 4.00 -> 0.6
+dddiv538 divide 2.40 10.00 -> 0.24
+dddiv539 divide 0.9 0.1 -> 9
+dddiv540 divide 0.9 0.01 -> 9E+1
+dddiv541 divide 0.9 0.001 -> 9E+2
+dddiv542 divide 5 2 -> 2.5
+dddiv543 divide 5 2.0 -> 2.5
+dddiv544 divide 5 2.00 -> 2.5
+dddiv545 divide 5 20 -> 0.25
+dddiv546 divide 5 20.0 -> 0.25
+dddiv547 divide 2.400 2 -> 1.200
+dddiv548 divide 2.400 2.0 -> 1.20
+dddiv549 divide 2.400 2.400 -> 1
+
+dddiv550 divide 240 1 -> 240
+dddiv551 divide 240 10 -> 24
+dddiv552 divide 240 100 -> 2.4
+dddiv553 divide 240 1000 -> 0.24
+dddiv554 divide 2400 1 -> 2400
+dddiv555 divide 2400 10 -> 240
+dddiv556 divide 2400 100 -> 24
+dddiv557 divide 2400 1000 -> 2.4
+
+-- +ve exponent
+dddiv600 divide 2.4E+9 2 -> 1.2E+9
+dddiv601 divide 2.40E+9 2 -> 1.20E+9
+dddiv602 divide 2.400E+9 2 -> 1.200E+9
+dddiv603 divide 2.4000E+9 2 -> 1.2000E+9
+dddiv604 divide 24E+8 2 -> 1.2E+9
+dddiv605 divide 240E+7 2 -> 1.20E+9
+dddiv606 divide 2400E+6 2 -> 1.200E+9
+dddiv607 divide 24000E+5 2 -> 1.2000E+9
+
+-- more zeros, etc.
+dddiv731 divide 5.00 1E-3 -> 5.00E+3
+dddiv732 divide 00.00 0.000 -> NaN Division_undefined
+dddiv733 divide 00.00 0E-3 -> NaN Division_undefined
+dddiv734 divide 0 -0 -> NaN Division_undefined
+dddiv735 divide -0 0 -> NaN Division_undefined
+dddiv736 divide -0 -0 -> NaN Division_undefined
+
+dddiv741 divide 0 -1 -> -0
+dddiv742 divide -0 -1 -> 0
+dddiv743 divide 0 1 -> 0
+dddiv744 divide -0 1 -> -0
+dddiv745 divide -1 0 -> -Infinity Division_by_zero
+dddiv746 divide -1 -0 -> Infinity Division_by_zero
+dddiv747 divide 1 0 -> Infinity Division_by_zero
+dddiv748 divide 1 -0 -> -Infinity Division_by_zero
+
+dddiv751 divide 0.0 -1 -> -0.0
+dddiv752 divide -0.0 -1 -> 0.0
+dddiv753 divide 0.0 1 -> 0.0
+dddiv754 divide -0.0 1 -> -0.0
+dddiv755 divide -1.0 0 -> -Infinity Division_by_zero
+dddiv756 divide -1.0 -0 -> Infinity Division_by_zero
+dddiv757 divide 1.0 0 -> Infinity Division_by_zero
+dddiv758 divide 1.0 -0 -> -Infinity Division_by_zero
+
+dddiv761 divide 0 -1.0 -> -0E+1
+dddiv762 divide -0 -1.0 -> 0E+1
+dddiv763 divide 0 1.0 -> 0E+1
+dddiv764 divide -0 1.0 -> -0E+1
+dddiv765 divide -1 0.0 -> -Infinity Division_by_zero
+dddiv766 divide -1 -0.0 -> Infinity Division_by_zero
+dddiv767 divide 1 0.0 -> Infinity Division_by_zero
+dddiv768 divide 1 -0.0 -> -Infinity Division_by_zero
+
+dddiv771 divide 0.0 -1.0 -> -0
+dddiv772 divide -0.0 -1.0 -> 0
+dddiv773 divide 0.0 1.0 -> 0
+dddiv774 divide -0.0 1.0 -> -0
+dddiv775 divide -1.0 0.0 -> -Infinity Division_by_zero
+dddiv776 divide -1.0 -0.0 -> Infinity Division_by_zero
+dddiv777 divide 1.0 0.0 -> Infinity Division_by_zero
+dddiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero
+
+-- Specials
+dddiv780 divide Inf -Inf -> NaN Invalid_operation
+dddiv781 divide Inf -1000 -> -Infinity
+dddiv782 divide Inf -1 -> -Infinity
+dddiv783 divide Inf -0 -> -Infinity
+dddiv784 divide Inf 0 -> Infinity
+dddiv785 divide Inf 1 -> Infinity
+dddiv786 divide Inf 1000 -> Infinity
+dddiv787 divide Inf Inf -> NaN Invalid_operation
+dddiv788 divide -1000 Inf -> -0E-398 Clamped
+dddiv789 divide -Inf Inf -> NaN Invalid_operation
+dddiv790 divide -1 Inf -> -0E-398 Clamped
+dddiv791 divide -0 Inf -> -0E-398 Clamped
+dddiv792 divide 0 Inf -> 0E-398 Clamped
+dddiv793 divide 1 Inf -> 0E-398 Clamped
+dddiv794 divide 1000 Inf -> 0E-398 Clamped
+dddiv795 divide Inf Inf -> NaN Invalid_operation
+
+dddiv800 divide -Inf -Inf -> NaN Invalid_operation
+dddiv801 divide -Inf -1000 -> Infinity
+dddiv802 divide -Inf -1 -> Infinity
+dddiv803 divide -Inf -0 -> Infinity
+dddiv804 divide -Inf 0 -> -Infinity
+dddiv805 divide -Inf 1 -> -Infinity
+dddiv806 divide -Inf 1000 -> -Infinity
+dddiv807 divide -Inf Inf -> NaN Invalid_operation
+dddiv808 divide -1000 Inf -> -0E-398 Clamped
+dddiv809 divide -Inf -Inf -> NaN Invalid_operation
+dddiv810 divide -1 -Inf -> 0E-398 Clamped
+dddiv811 divide -0 -Inf -> 0E-398 Clamped
+dddiv812 divide 0 -Inf -> -0E-398 Clamped
+dddiv813 divide 1 -Inf -> -0E-398 Clamped
+dddiv814 divide 1000 -Inf -> -0E-398 Clamped
+dddiv815 divide Inf -Inf -> NaN Invalid_operation
+
+dddiv821 divide NaN -Inf -> NaN
+dddiv822 divide NaN -1000 -> NaN
+dddiv823 divide NaN -1 -> NaN
+dddiv824 divide NaN -0 -> NaN
+dddiv825 divide NaN 0 -> NaN
+dddiv826 divide NaN 1 -> NaN
+dddiv827 divide NaN 1000 -> NaN
+dddiv828 divide NaN Inf -> NaN
+dddiv829 divide NaN NaN -> NaN
+dddiv830 divide -Inf NaN -> NaN
+dddiv831 divide -1000 NaN -> NaN
+dddiv832 divide -1 NaN -> NaN
+dddiv833 divide -0 NaN -> NaN
+dddiv834 divide 0 NaN -> NaN
+dddiv835 divide 1 NaN -> NaN
+dddiv836 divide 1000 NaN -> NaN
+dddiv837 divide Inf NaN -> NaN
+
+dddiv841 divide sNaN -Inf -> NaN Invalid_operation
+dddiv842 divide sNaN -1000 -> NaN Invalid_operation
+dddiv843 divide sNaN -1 -> NaN Invalid_operation
+dddiv844 divide sNaN -0 -> NaN Invalid_operation
+dddiv845 divide sNaN 0 -> NaN Invalid_operation
+dddiv846 divide sNaN 1 -> NaN Invalid_operation
+dddiv847 divide sNaN 1000 -> NaN Invalid_operation
+dddiv848 divide sNaN NaN -> NaN Invalid_operation
+dddiv849 divide sNaN sNaN -> NaN Invalid_operation
+dddiv850 divide NaN sNaN -> NaN Invalid_operation
+dddiv851 divide -Inf sNaN -> NaN Invalid_operation
+dddiv852 divide -1000 sNaN -> NaN Invalid_operation
+dddiv853 divide -1 sNaN -> NaN Invalid_operation
+dddiv854 divide -0 sNaN -> NaN Invalid_operation
+dddiv855 divide 0 sNaN -> NaN Invalid_operation
+dddiv856 divide 1 sNaN -> NaN Invalid_operation
+dddiv857 divide 1000 sNaN -> NaN Invalid_operation
+dddiv858 divide Inf sNaN -> NaN Invalid_operation
+dddiv859 divide NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dddiv861 divide NaN9 -Inf -> NaN9
+dddiv862 divide NaN8 1000 -> NaN8
+dddiv863 divide NaN7 Inf -> NaN7
+dddiv864 divide NaN6 NaN5 -> NaN6
+dddiv865 divide -Inf NaN4 -> NaN4
+dddiv866 divide -1000 NaN3 -> NaN3
+dddiv867 divide Inf NaN2 -> NaN2
+
+dddiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation
+dddiv872 divide sNaN98 -1 -> NaN98 Invalid_operation
+dddiv873 divide sNaN97 NaN -> NaN97 Invalid_operation
+dddiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
+dddiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
+dddiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation
+dddiv877 divide 0 sNaN91 -> NaN91 Invalid_operation
+dddiv878 divide Inf sNaN90 -> NaN90 Invalid_operation
+dddiv879 divide NaN sNaN89 -> NaN89 Invalid_operation
+
+dddiv881 divide -NaN9 -Inf -> -NaN9
+dddiv882 divide -NaN8 1000 -> -NaN8
+dddiv883 divide -NaN7 Inf -> -NaN7
+dddiv884 divide -NaN6 -NaN5 -> -NaN6
+dddiv885 divide -Inf -NaN4 -> -NaN4
+dddiv886 divide -1000 -NaN3 -> -NaN3
+dddiv887 divide Inf -NaN2 -> -NaN2
+
+dddiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
+dddiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
+dddiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
+dddiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
+dddiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+dddiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
+dddiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
+dddiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
+dddiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- Various flavours of divide by 0
+dddiv901 divide 0 0 -> NaN Division_undefined
+dddiv902 divide 0.0E5 0 -> NaN Division_undefined
+dddiv903 divide 0.000 0 -> NaN Division_undefined
+dddiv904 divide 0.0001 0 -> Infinity Division_by_zero
+dddiv905 divide 0.01 0 -> Infinity Division_by_zero
+dddiv906 divide 0.1 0 -> Infinity Division_by_zero
+dddiv907 divide 1 0 -> Infinity Division_by_zero
+dddiv908 divide 1 0.0 -> Infinity Division_by_zero
+dddiv909 divide 10 0.0 -> Infinity Division_by_zero
+dddiv910 divide 1E+100 0.0 -> Infinity Division_by_zero
+dddiv911 divide 1E+100 0 -> Infinity Division_by_zero
+
+dddiv921 divide -0.0001 0 -> -Infinity Division_by_zero
+dddiv922 divide -0.01 0 -> -Infinity Division_by_zero
+dddiv923 divide -0.1 0 -> -Infinity Division_by_zero
+dddiv924 divide -1 0 -> -Infinity Division_by_zero
+dddiv925 divide -1 0.0 -> -Infinity Division_by_zero
+dddiv926 divide -10 0.0 -> -Infinity Division_by_zero
+dddiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero
+dddiv928 divide -1E+100 0 -> -Infinity Division_by_zero
+
+dddiv931 divide 0.0001 -0 -> -Infinity Division_by_zero
+dddiv932 divide 0.01 -0 -> -Infinity Division_by_zero
+dddiv933 divide 0.1 -0 -> -Infinity Division_by_zero
+dddiv934 divide 1 -0 -> -Infinity Division_by_zero
+dddiv935 divide 1 -0.0 -> -Infinity Division_by_zero
+dddiv936 divide 10 -0.0 -> -Infinity Division_by_zero
+dddiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
+dddiv938 divide 1E+100 -0 -> -Infinity Division_by_zero
+
+dddiv941 divide -0.0001 -0 -> Infinity Division_by_zero
+dddiv942 divide -0.01 -0 -> Infinity Division_by_zero
+dddiv943 divide -0.1 -0 -> Infinity Division_by_zero
+dddiv944 divide -1 -0 -> Infinity Division_by_zero
+dddiv945 divide -1 -0.0 -> Infinity Division_by_zero
+dddiv946 divide -10 -0.0 -> Infinity Division_by_zero
+dddiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero
+dddiv948 divide -1E+100 -0 -> Infinity Division_by_zero
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dddiv1021 divide 1E0 1E0 -> 1
+dddiv1022 divide 1E0 2E0 -> 0.5
+dddiv1023 divide 1E0 3E0 -> 0.3333333333333333 Inexact Rounded
+dddiv1024 divide 100E-2 1000E-3 -> 1
+dddiv1025 divide 24E-1 2E0 -> 1.2
+dddiv1026 divide 2400E-3 2E0 -> 1.200
+dddiv1027 divide 5E0 2E0 -> 2.5
+dddiv1028 divide 5E0 20E-1 -> 2.5
+dddiv1029 divide 5E0 2000E-3 -> 2.5
+dddiv1030 divide 5E0 2E-1 -> 25
+dddiv1031 divide 5E0 20E-2 -> 25
+dddiv1032 divide 480E-2 3E0 -> 1.60
+dddiv1033 divide 47E-1 2E0 -> 2.35
+
+-- ECMAScript bad examples
+rounding: half_down
+dddiv1040 divide 5 9 -> 0.5555555555555556 Inexact Rounded
+rounding: half_even
+dddiv1041 divide 6 11 -> 0.5454545454545455 Inexact Rounded
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+dddiv1051 divide 1e+277 1e-311 -> Infinity Overflow Inexact Rounded
+dddiv1052 divide 1e+277 -1e-311 -> -Infinity Overflow Inexact Rounded
+dddiv1053 divide -1e+277 1e-311 -> -Infinity Overflow Inexact Rounded
+dddiv1054 divide -1e+277 -1e-311 -> Infinity Overflow Inexact Rounded
+dddiv1055 divide 1e-277 1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1056 divide 1e-277 -1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1057 divide -1e-277 1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1058 divide -1e-277 -1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dddiv1060 divide 1e-291 1e+101 -> 1E-392 Subnormal
+dddiv1061 divide 1e-291 1e+102 -> 1E-393 Subnormal
+dddiv1062 divide 1e-291 1e+103 -> 1E-394 Subnormal
+dddiv1063 divide 1e-291 1e+104 -> 1E-395 Subnormal
+dddiv1064 divide 1e-291 1e+105 -> 1E-396 Subnormal
+dddiv1065 divide 1e-291 1e+106 -> 1E-397 Subnormal
+dddiv1066 divide 1e-291 1e+107 -> 1E-398 Subnormal
+dddiv1067 divide 1e-291 1e+108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1068 divide 1e-291 1e+109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1069 divide 1e-291 1e+110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+dddiv1070 divide 1e+60 1e-321 -> 1.000000000000E+381 Clamped
+dddiv1071 divide 1e+60 1e-322 -> 1.0000000000000E+382 Clamped
+dddiv1072 divide 1e+60 1e-323 -> 1.00000000000000E+383 Clamped
+dddiv1073 divide 1e+60 1e-324 -> 1.000000000000000E+384 Clamped
+dddiv1074 divide 1e+60 1e-325 -> Infinity Overflow Inexact Rounded
+dddiv1075 divide 1e+60 1e-326 -> Infinity Overflow Inexact Rounded
+dddiv1076 divide 1e+60 1e-327 -> Infinity Overflow Inexact Rounded
+dddiv1077 divide 1e+60 1e-328 -> Infinity Overflow Inexact Rounded
+dddiv1078 divide 1e+60 1e-329 -> Infinity Overflow Inexact Rounded
+dddiv1079 divide 1e+60 1e-330 -> Infinity Overflow Inexact Rounded
+
+dddiv1101 divide 1.0000E-394 1 -> 1.0000E-394 Subnormal
+dddiv1102 divide 1.000E-394 1e+1 -> 1.000E-395 Subnormal
+dddiv1103 divide 1.00E-394 1e+2 -> 1.00E-396 Subnormal
+dddiv1104 divide 1.0E-394 1e+3 -> 1.0E-397 Subnormal
+dddiv1105 divide 1.0E-394 1e+4 -> 1E-398 Subnormal Rounded
+dddiv1106 divide 1.3E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
+dddiv1107 divide 1.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1108 divide 1.7E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1109 divide 2.3E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1110 divide 2.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1111 divide 2.7E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
+dddiv1112 divide 1.49E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
+dddiv1113 divide 1.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1114 divide 1.51E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1115 divide 2.49E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1116 divide 2.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1117 divide 2.51E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
+
+dddiv1118 divide 1E-394 1e+4 -> 1E-398 Subnormal
+dddiv1119 divide 3E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1120 divide 5E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1121 divide 7E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
+dddiv1122 divide 9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
+dddiv1123 divide 9.9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
+
+dddiv1124 divide 1E-394 -1e+4 -> -1E-398 Subnormal
+dddiv1125 divide 3E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1126 divide -5E-394 1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1127 divide 7E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
+dddiv1128 divide -9E-394 1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
+dddiv1129 divide 9.9E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
+dddiv1130 divide 3.0E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+dddiv1131 divide 1.0E-199 1e+200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1132 divide 1.0E-199 1e+199 -> 1E-398 Subnormal Rounded
+dddiv1133 divide 1.0E-199 1e+198 -> 1.0E-397 Subnormal
+dddiv1134 divide 2.0E-199 2e+198 -> 1.0E-397 Subnormal
+dddiv1135 divide 4.0E-199 4e+198 -> 1.0E-397 Subnormal
+dddiv1136 divide 10.0E-199 10e+198 -> 1.0E-397 Subnormal
+dddiv1137 divide 30.0E-199 30e+198 -> 1.0E-397 Subnormal
+
+-- randoms
+dddiv2010 divide -3.303226714900711E-35 8.796578842713183E+73 -> -3.755126594058783E-109 Inexact Rounded
+dddiv2011 divide 933153327821073.6 68782181090246.25 -> 13.56678885475763 Inexact Rounded
+dddiv2012 divide 5.04752436057906E-72 -8.179481771238642E+64 -> -6.170958627632835E-137 Inexact Rounded
+dddiv2013 divide -3707613309582318 3394911196503.048 -> -1092.109070010836 Inexact Rounded
+dddiv2014 divide 99689.0555190461 -4.735208553891464 -> -21052.72753765411 Inexact Rounded
+dddiv2015 divide -1447915775613329 269750797.8184875 -> -5367605.164925653 Inexact Rounded
+dddiv2016 divide -9.394881304225258E-19 -830585.0252671636 -> 1.131116143251358E-24 Inexact Rounded
+dddiv2017 divide -1.056283432738934 88.58754555124013 -> -0.01192361100159352 Inexact Rounded
+dddiv2018 divide 5763220933343.081 689089567025052.1 -> 0.008363529516524456 Inexact Rounded
+dddiv2019 divide 873819.122103216 9.740612494523300E-49 -> 8.970884763093948E+53 Inexact Rounded
+dddiv2020 divide 8022914.838533576 6178.566801742713 -> 1298.507420243583 Inexact Rounded
+dddiv2021 divide 203982.7605650363 -2158.283639053435 -> -94.51156320422168 Inexact Rounded
+dddiv2022 divide 803.6310547013030 7101143795399.238 -> 1.131692411611166E-10 Inexact Rounded
+dddiv2023 divide 9.251697842123399E-82 -1.342350220606119E-7 -> -6.892163982321936E-75 Inexact Rounded
+dddiv2024 divide -1.980600645637992E-53 -5.474262753214457E+77 -> 3.618022617703168E-131 Inexact Rounded
+dddiv2025 divide -210.0322996351690 -8.580951835872843E+80 -> 2.447657365434971E-79 Inexact Rounded
+dddiv2026 divide -1.821980314020370E+85 -3.018915267138165 -> 6.035215144503042E+84 Inexact Rounded
+dddiv2027 divide -772264503601.1047 5.158258271408988E-86 -> -1.497141986630614E+97 Inexact Rounded
+dddiv2028 divide -767.0532415847106 2.700027228028939E-59 -> -2.840909282772941E+61 Inexact Rounded
+dddiv2029 divide 496724.8548250093 7.32700588163100E+66 -> 6.779370220929013E-62 Inexact Rounded
+dddiv2030 divide -304232651447703.9 -108.9730808657440 -> 2791814721862.565 Inexact Rounded
+dddiv2031 divide -7.233817192699405E+42 -5711302004.149411 -> 1.266579352211430E+33 Inexact Rounded
+dddiv2032 divide -9.999221444912745E+96 4010569406446197 -> -2.493217404202250E+81 Inexact Rounded
+dddiv2033 divide -1837272.061937622 8.356322838066762 -> -219866.0939196882 Inexact Rounded
+dddiv2034 divide 2168.517555606529 209.1910258615061 -> 10.36620737756784 Inexact Rounded
+dddiv2035 divide -1.884389790576371E+88 2.95181953870583E+20 -> -6.383824505079828E+67 Inexact Rounded
+dddiv2036 divide 732263.6037438196 961222.3634446889 -> 0.7618045850698269 Inexact Rounded
+dddiv2037 divide -813461419.0348336 5.376293753809143E+84 -> -1.513052404285927E-76 Inexact Rounded
+dddiv2038 divide -45562133508108.50 -9.776843494690107E+51 -> 4.660208945029519E-39 Inexact Rounded
+dddiv2039 divide -6.489393172441016E+80 -9101965.097852113 -> 7.129661674897421E+73 Inexact Rounded
+dddiv2040 divide 3.694576237117349E+93 6683512.012622003 -> 5.527896456443912E+86 Inexact Rounded
+dddiv2041 divide -2.252877726403272E+19 -7451913256.181367 -> 3023220546.125531 Inexact Rounded
+dddiv2042 divide 518303.1989111842 50.01587020474133 -> 10362.77479107123 Inexact Rounded
+dddiv2043 divide 2.902087881880103E+24 33.32400992305702 -> 8.708699488989578E+22 Inexact Rounded
+dddiv2044 divide 549619.4559510557 1660824845196338 -> 3.309316196351104E-10 Inexact Rounded
+dddiv2045 divide -6775670774684043 8292152023.077262 -> -817118.4941891062 Inexact Rounded
+dddiv2046 divide -77.50923921524079 -5.636882655425815E+74 -> 1.375037302588405E-73 Inexact Rounded
+dddiv2047 divide -2.984889459605149E-10 -88106156784122.99 -> 3.387833005721384E-24 Inexact Rounded
+dddiv2048 divide 0.949517293997085 44767115.96450998 -> 2.121015110175589E-8 Inexact Rounded
+dddiv2049 divide -2760937211.084521 -1087015876975408 -> 0.000002539923537057024 Inexact Rounded
+dddiv2050 divide 28438351.85030536 -4.209397904088624E-47 -> -6.755919135770688E+53 Inexact Rounded
+dddiv2051 divide -85562731.6820956 -7.166045442530185E+45 -> 1.194002080621542E-38 Inexact Rounded
+dddiv2052 divide 2533802852165.25 7154.119606235955 -> 354173957.3317501 Inexact Rounded
+dddiv2053 divide -8858831346851.474 97.59734208801716 -> -90769186509.83577 Inexact Rounded
+dddiv2054 divide 176783629801387.5 840073263.3109817 -> 210438.3480848206 Inexact Rounded
+dddiv2055 divide -493506471796175.6 79733894790822.03 -> -6.189418854940746 Inexact Rounded
+dddiv2056 divide 790.1682542103445 829.9449370367435 -> 0.9520731062371214 Inexact Rounded
+dddiv2057 divide -8920459838.583164 -4767.889187899214 -> 1870945.294035581 Inexact Rounded
+dddiv2058 divide 53536687164422.1 53137.5007032689 -> 1007512330.385698 Inexact Rounded
+dddiv2059 divide 4.051532311146561E-74 -2.343089768972261E+94 -> -1.729140882606332E-168 Inexact Rounded
+dddiv2060 divide -14847758778636.88 3.062543516383807E-43 -> -4.848178874587497E+55 Inexact Rounded
+
+-- Division probably has pre-rounding, so need to test rounding
+-- explicitly rather than assume included through other tests;
+-- tests include simple rounding and also the tricky cases of sticky
+-- bits following two zeros
+--
+-- 1/99999 gives 0.0000100001000010000100001000010000100001
+-- 1234567890123456
+--
+-- 1/999999 gives 0.000001000001000001000001000001000001000001
+-- 1234567890123456
+
+rounding: ceiling
+dddiv3001 divide 1 3 -> 0.3333333333333334 Inexact Rounded
+dddiv3002 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3003 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
+dddiv3004 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
+
+rounding: floor
+dddiv3011 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3012 divide 2 3 -> 0.6666666666666666 Inexact Rounded
+dddiv3013 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3014 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: up
+dddiv3021 divide 1 3 -> 0.3333333333333334 Inexact Rounded
+dddiv3022 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3023 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
+dddiv3024 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
+
+rounding: down
+dddiv3031 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3032 divide 2 3 -> 0.6666666666666666 Inexact Rounded
+dddiv3033 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3034 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: half_up
+dddiv3041 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3042 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3043 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3044 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: half_down
+dddiv3051 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3052 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3053 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3054 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: half_even
+dddiv3061 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3062 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3063 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3064 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: 05up
+dddiv3071 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3072 divide 2 3 -> 0.6666666666666666 Inexact Rounded
+dddiv3073 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3074 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
+
+-- random divide tests with result near 1
+rounding: half_even
+dddiv4001 divide 3195385192916917 3195385192946695 -> 0.9999999999906809 Inexact Rounded
+dddiv4002 divide 1393723067526993 1393723067519475 -> 1.000000000005394 Inexact Rounded
+dddiv4003 divide 759985543702302 759985543674015 -> 1.000000000037220 Inexact Rounded
+dddiv4004 divide 9579158456027302 9579158456036864 -> 0.9999999999990018 Inexact Rounded
+dddiv4005 divide 7079398299143569 7079398299156904 -> 0.9999999999981164 Inexact Rounded
+dddiv4006 divide 6636169255366598 6636169255336386 -> 1.000000000004553 Inexact Rounded
+dddiv4007 divide 6964813971340090 6964813971321554 -> 1.000000000002661 Inexact Rounded
+dddiv4008 divide 4182275225480784 4182275225454009 -> 1.000000000006402 Inexact Rounded
+dddiv4009 divide 9228325124938029 9228325124918730 -> 1.000000000002091 Inexact Rounded
+dddiv4010 divide 3428346338630192 3428346338609843 -> 1.000000000005936 Inexact Rounded
+dddiv4011 divide 2143511550722893 2143511550751754 -> 0.9999999999865356 Inexact Rounded
+dddiv4012 divide 1672732924396785 1672732924401811 -> 0.9999999999969953 Inexact Rounded
+dddiv4013 divide 4190714611948216 4190714611948664 -> 0.9999999999998931 Inexact Rounded
+dddiv4014 divide 3942254800848877 3942254800814556 -> 1.000000000008706 Inexact Rounded
+dddiv4015 divide 2854459826952334 2854459826960762 -> 0.9999999999970474 Inexact Rounded
+dddiv4016 divide 2853258953664731 2853258953684471 -> 0.9999999999930816 Inexact Rounded
+dddiv4017 divide 9453512638125978 9453512638146425 -> 0.9999999999978371 Inexact Rounded
+dddiv4018 divide 339476633940369 339476633912887 -> 1.000000000080954 Inexact Rounded
+dddiv4019 divide 4542181492688467 4542181492697735 -> 0.9999999999979596 Inexact Rounded
+dddiv4020 divide 7312600192399197 7312600192395424 -> 1.000000000000516 Inexact Rounded
+dddiv4021 divide 1811674985570111 1811674985603935 -> 0.9999999999813300 Inexact Rounded
+dddiv4022 divide 1706462639003481 1706462639017740 -> 0.9999999999916441 Inexact Rounded
+dddiv4023 divide 6697052654940368 6697052654934110 -> 1.000000000000934 Inexact Rounded
+dddiv4024 divide 5015283664277539 5015283664310719 -> 0.9999999999933842 Inexact Rounded
+dddiv4025 divide 2359501561537464 2359501561502464 -> 1.000000000014834 Inexact Rounded
+dddiv4026 divide 2669850227909157 2669850227901548 -> 1.000000000002850 Inexact Rounded
+dddiv4027 divide 9329725546974648 9329725547002445 -> 0.9999999999970206 Inexact Rounded
+dddiv4028 divide 3228562867071248 3228562867106206 -> 0.9999999999891723 Inexact Rounded
+dddiv4029 divide 4862226644921175 4862226644909380 -> 1.000000000002426 Inexact Rounded
+dddiv4030 divide 1022267997054529 1022267997071329 -> 0.9999999999835660 Inexact Rounded
+dddiv4031 divide 1048777482023719 1048777482000948 -> 1.000000000021712 Inexact Rounded
+dddiv4032 divide 9980113777337098 9980113777330539 -> 1.000000000000657 Inexact Rounded
+dddiv4033 divide 7506839167963908 7506839167942901 -> 1.000000000002798 Inexact Rounded
+dddiv4034 divide 231119751977860 231119751962453 -> 1.000000000066662 Inexact Rounded
+dddiv4035 divide 4034903664762962 4034903664795526 -> 0.9999999999919294 Inexact Rounded
+dddiv4036 divide 5700122152274696 5700122152251386 -> 1.000000000004089 Inexact Rounded
+dddiv4037 divide 6869599590293110 6869599590293495 -> 0.9999999999999440 Inexact Rounded
+dddiv4038 divide 5576281960092797 5576281960105579 -> 0.9999999999977078 Inexact Rounded
+dddiv4039 divide 2304844888381318 2304844888353073 -> 1.000000000012255 Inexact Rounded
+dddiv4040 divide 3265933651656452 3265933651682779 -> 0.9999999999919389 Inexact Rounded
+dddiv4041 divide 5235714985079914 5235714985066131 -> 1.000000000002632 Inexact Rounded
+dddiv4042 divide 5578481572827551 5578481572822945 -> 1.000000000000826 Inexact Rounded
+dddiv4043 divide 4909616081396134 4909616081373076 -> 1.000000000004696 Inexact Rounded
+dddiv4044 divide 636447224349537 636447224338757 -> 1.000000000016938 Inexact Rounded
+dddiv4045 divide 1539373428396640 1539373428364727 -> 1.000000000020731 Inexact Rounded
+dddiv4046 divide 2028786707377893 2028786707378866 -> 0.9999999999995204 Inexact Rounded
+dddiv4047 divide 137643260486222 137643260487419 -> 0.9999999999913036 Inexact Rounded
+dddiv4048 divide 247451519746765 247451519752267 -> 0.9999999999777653 Inexact Rounded
+dddiv4049 divide 7877858475022054 7877858474999794 -> 1.000000000002826 Inexact Rounded
+dddiv4050 divide 7333242694766258 7333242694744628 -> 1.000000000002950 Inexact Rounded
+dddiv4051 divide 124051503698592 124051503699397 -> 0.9999999999935108 Inexact Rounded
+dddiv4052 divide 8944737432385188 8944737432406860 -> 0.9999999999975771 Inexact Rounded
+dddiv4053 divide 9883948923406874 9883948923424843 -> 0.9999999999981820 Inexact Rounded
+dddiv4054 divide 6829178741654284 6829178741671973 -> 0.9999999999974098 Inexact Rounded
+dddiv4055 divide 7342752479768122 7342752479793385 -> 0.9999999999965595 Inexact Rounded
+dddiv4056 divide 8066426579008783 8066426578977563 -> 1.000000000003870 Inexact Rounded
+dddiv4057 divide 8992775071383295 8992775071352712 -> 1.000000000003401 Inexact Rounded
+dddiv4058 divide 5485011755545641 5485011755543611 -> 1.000000000000370 Inexact Rounded
+dddiv4059 divide 5779983054353918 5779983054365300 -> 0.9999999999980308 Inexact Rounded
+dddiv4060 divide 9502265102713774 9502265102735208 -> 0.9999999999977443 Inexact Rounded
+dddiv4061 divide 2109558399130981 2109558399116281 -> 1.000000000006968 Inexact Rounded
+dddiv4062 divide 5296182636350471 5296182636351521 -> 0.9999999999998017 Inexact Rounded
+dddiv4063 divide 1440019225591883 1440019225601844 -> 0.9999999999930827 Inexact Rounded
+dddiv4064 divide 8182110791881341 8182110791847174 -> 1.000000000004176 Inexact Rounded
+dddiv4065 divide 489098235512060 489098235534516 -> 0.9999999999540869 Inexact Rounded
+dddiv4066 divide 6475687084782038 6475687084756089 -> 1.000000000004007 Inexact Rounded
+dddiv4067 divide 8094348555736948 8094348555759236 -> 0.9999999999972465 Inexact Rounded
+dddiv4068 divide 1982766816291543 1982766816309463 -> 0.9999999999909621 Inexact Rounded
+dddiv4069 divide 9277314300113251 9277314300084467 -> 1.000000000003103 Inexact Rounded
+dddiv4070 divide 4335532959318934 4335532959293167 -> 1.000000000005943 Inexact Rounded
+dddiv4071 divide 7767113032981348 7767113032968132 -> 1.000000000001702 Inexact Rounded
+dddiv4072 divide 1578548053342868 1578548053370448 -> 0.9999999999825282 Inexact Rounded
+dddiv4073 divide 3790420686666898 3790420686636315 -> 1.000000000008068 Inexact Rounded
+dddiv4074 divide 871682421955147 871682421976441 -> 0.9999999999755714 Inexact Rounded
+dddiv4075 divide 744141054479940 744141054512329 -> 0.9999999999564746 Inexact Rounded
+dddiv4076 divide 8956824183670735 8956824183641741 -> 1.000000000003237 Inexact Rounded
+dddiv4077 divide 8337291694485682 8337291694451193 -> 1.000000000004137 Inexact Rounded
+dddiv4078 divide 4107775944683669 4107775944657097 -> 1.000000000006469 Inexact Rounded
+dddiv4079 divide 8691900057964648 8691900057997555 -> 0.9999999999962141 Inexact Rounded
+dddiv4080 divide 2229528520536462 2229528520502337 -> 1.000000000015306 Inexact Rounded
+dddiv4081 divide 398442083774322 398442083746273 -> 1.000000000070397 Inexact Rounded
+dddiv4082 divide 5319819776808759 5319819776838313 -> 0.9999999999944445 Inexact Rounded
+dddiv4083 divide 7710491299066855 7710491299041858 -> 1.000000000003242 Inexact Rounded
+dddiv4084 divide 9083231296087266 9083231296058160 -> 1.000000000003204 Inexact Rounded
+dddiv4085 divide 3566873574904559 3566873574890328 -> 1.000000000003990 Inexact Rounded
+dddiv4086 divide 596343290550525 596343290555614 -> 0.9999999999914663 Inexact Rounded
+dddiv4087 divide 278227925093192 278227925068104 -> 1.000000000090171 Inexact Rounded
+dddiv4088 divide 3292902958490649 3292902958519881 -> 0.9999999999911227 Inexact Rounded
+dddiv4089 divide 5521871364245881 5521871364229536 -> 1.000000000002960 Inexact Rounded
+dddiv4090 divide 2406505602883617 2406505602857997 -> 1.000000000010646 Inexact Rounded
+dddiv4091 divide 7741146984869208 7741146984867255 -> 1.000000000000252 Inexact Rounded
+dddiv4092 divide 4576041832414909 4576041832405102 -> 1.000000000002143 Inexact Rounded
+dddiv4093 divide 9183756982878057 9183756982901934 -> 0.9999999999974001 Inexact Rounded
+dddiv4094 divide 6215736513855159 6215736513870342 -> 0.9999999999975573 Inexact Rounded
+dddiv4095 divide 248554968534533 248554968551417 -> 0.9999999999320714 Inexact Rounded
+dddiv4096 divide 376314165668645 376314165659755 -> 1.000000000023624 Inexact Rounded
+dddiv4097 divide 5513569249809718 5513569249808906 -> 1.000000000000147 Inexact Rounded
+dddiv4098 divide 3367992242167904 3367992242156228 -> 1.000000000003467 Inexact Rounded
+dddiv4099 divide 6134869538966967 6134869538985986 -> 0.9999999999968999 Inexact Rounded
+
+-- Null tests
+dddiv9998 divide 10 # -> NaN Invalid_operation
+dddiv9999 divide # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddDivideInt.decTest b/Lib/test/decimaltestdata/ddDivideInt.decTest
index bec567986f..1555b4217d 100644
--- a/Lib/test/decimaltestdata/ddDivideInt.decTest
+++ b/Lib/test/decimaltestdata/ddDivideInt.decTest
@@ -1,449 +1,449 @@
-------------------------------------------------------------------------
--- ddDivideInt.decTest -- decDouble integer division --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-dddvi001 divideint 1 1 -> 1
-dddvi002 divideint 2 1 -> 2
-dddvi003 divideint 1 2 -> 0
-dddvi004 divideint 2 2 -> 1
-dddvi005 divideint 0 1 -> 0
-dddvi006 divideint 0 2 -> 0
-dddvi007 divideint 1 3 -> 0
-dddvi008 divideint 2 3 -> 0
-dddvi009 divideint 3 3 -> 1
-
-dddvi010 divideint 2.4 1 -> 2
-dddvi011 divideint 2.4 -1 -> -2
-dddvi012 divideint -2.4 1 -> -2
-dddvi013 divideint -2.4 -1 -> 2
-dddvi014 divideint 2.40 1 -> 2
-dddvi015 divideint 2.400 1 -> 2
-dddvi016 divideint 2.4 2 -> 1
-dddvi017 divideint 2.400 2 -> 1
-dddvi018 divideint 2. 2 -> 1
-dddvi019 divideint 20 20 -> 1
-
-dddvi020 divideint 187 187 -> 1
-dddvi021 divideint 5 2 -> 2
-dddvi022 divideint 5 2.0 -> 2
-dddvi023 divideint 5 2.000 -> 2
-dddvi024 divideint 5 0.200 -> 25
-dddvi025 divideint 5 0.200 -> 25
-
-dddvi030 divideint 1 2 -> 0
-dddvi031 divideint 1 4 -> 0
-dddvi032 divideint 1 8 -> 0
-dddvi033 divideint 1 16 -> 0
-dddvi034 divideint 1 32 -> 0
-dddvi035 divideint 1 64 -> 0
-dddvi040 divideint 1 -2 -> -0
-dddvi041 divideint 1 -4 -> -0
-dddvi042 divideint 1 -8 -> -0
-dddvi043 divideint 1 -16 -> -0
-dddvi044 divideint 1 -32 -> -0
-dddvi045 divideint 1 -64 -> -0
-dddvi050 divideint -1 2 -> -0
-dddvi051 divideint -1 4 -> -0
-dddvi052 divideint -1 8 -> -0
-dddvi053 divideint -1 16 -> -0
-dddvi054 divideint -1 32 -> -0
-dddvi055 divideint -1 64 -> -0
-dddvi060 divideint -1 -2 -> 0
-dddvi061 divideint -1 -4 -> 0
-dddvi062 divideint -1 -8 -> 0
-dddvi063 divideint -1 -16 -> 0
-dddvi064 divideint -1 -32 -> 0
-dddvi065 divideint -1 -64 -> 0
-
--- similar with powers of ten
-dddvi160 divideint 1 1 -> 1
-dddvi161 divideint 1 10 -> 0
-dddvi162 divideint 1 100 -> 0
-dddvi163 divideint 1 1000 -> 0
-dddvi164 divideint 1 10000 -> 0
-dddvi165 divideint 1 100000 -> 0
-dddvi166 divideint 1 1000000 -> 0
-dddvi167 divideint 1 10000000 -> 0
-dddvi168 divideint 1 100000000 -> 0
-dddvi170 divideint 1 -1 -> -1
-dddvi171 divideint 1 -10 -> -0
-dddvi172 divideint 1 -100 -> -0
-dddvi173 divideint 1 -1000 -> -0
-dddvi174 divideint 1 -10000 -> -0
-dddvi175 divideint 1 -100000 -> -0
-dddvi176 divideint 1 -1000000 -> -0
-dddvi177 divideint 1 -10000000 -> -0
-dddvi178 divideint 1 -100000000 -> -0
-dddvi180 divideint -1 1 -> -1
-dddvi181 divideint -1 10 -> -0
-dddvi182 divideint -1 100 -> -0
-dddvi183 divideint -1 1000 -> -0
-dddvi184 divideint -1 10000 -> -0
-dddvi185 divideint -1 100000 -> -0
-dddvi186 divideint -1 1000000 -> -0
-dddvi187 divideint -1 10000000 -> -0
-dddvi188 divideint -1 100000000 -> -0
-dddvi190 divideint -1 -1 -> 1
-dddvi191 divideint -1 -10 -> 0
-dddvi192 divideint -1 -100 -> 0
-dddvi193 divideint -1 -1000 -> 0
-dddvi194 divideint -1 -10000 -> 0
-dddvi195 divideint -1 -100000 -> 0
-dddvi196 divideint -1 -1000000 -> 0
-dddvi197 divideint -1 -10000000 -> 0
-dddvi198 divideint -1 -100000000 -> 0
-
--- some long operand (at p=9) cases
-dddvi070 divideint 999999999 1 -> 999999999
-dddvi071 divideint 999999999.4 1 -> 999999999
-dddvi072 divideint 999999999.5 1 -> 999999999
-dddvi073 divideint 999999999.9 1 -> 999999999
-dddvi074 divideint 999999999.999 1 -> 999999999
-
-dddvi090 divideint 0. 1 -> 0
-dddvi091 divideint .0 1 -> 0
-dddvi092 divideint 0.00 1 -> 0
-dddvi093 divideint 0.00E+9 1 -> 0
-dddvi094 divideint 0.0000E-50 1 -> 0
-
-dddvi100 divideint 1 1 -> 1
-dddvi101 divideint 1 2 -> 0
-dddvi102 divideint 1 3 -> 0
-dddvi103 divideint 1 4 -> 0
-dddvi104 divideint 1 5 -> 0
-dddvi105 divideint 1 6 -> 0
-dddvi106 divideint 1 7 -> 0
-dddvi107 divideint 1 8 -> 0
-dddvi108 divideint 1 9 -> 0
-dddvi109 divideint 1 10 -> 0
-dddvi110 divideint 1 1 -> 1
-dddvi111 divideint 2 1 -> 2
-dddvi112 divideint 3 1 -> 3
-dddvi113 divideint 4 1 -> 4
-dddvi114 divideint 5 1 -> 5
-dddvi115 divideint 6 1 -> 6
-dddvi116 divideint 7 1 -> 7
-dddvi117 divideint 8 1 -> 8
-dddvi118 divideint 9 1 -> 9
-dddvi119 divideint 10 1 -> 10
-
--- from DiagBigDecimal
-dddvi131 divideint 101.3 1 -> 101
-dddvi132 divideint 101.0 1 -> 101
-dddvi133 divideint 101.3 3 -> 33
-dddvi134 divideint 101.0 3 -> 33
-dddvi135 divideint 2.4 1 -> 2
-dddvi136 divideint 2.400 1 -> 2
-dddvi137 divideint 18 18 -> 1
-dddvi138 divideint 1120 1000 -> 1
-dddvi139 divideint 2.4 2 -> 1
-dddvi140 divideint 2.400 2 -> 1
-dddvi141 divideint 0.5 2.000 -> 0
-dddvi142 divideint 8.005 7 -> 1
-dddvi143 divideint 5 2 -> 2
-dddvi144 divideint 0 2 -> 0
-dddvi145 divideint 0.00 2 -> 0
-
--- Others
-dddvi150 divideint 12345 4.999 -> 2469
-dddvi151 divideint 12345 4.99 -> 2473
-dddvi152 divideint 12345 4.9 -> 2519
-dddvi153 divideint 12345 5 -> 2469
-dddvi154 divideint 12345 5.1 -> 2420
-dddvi155 divideint 12345 5.01 -> 2464
-dddvi156 divideint 12345 5.001 -> 2468
-dddvi157 divideint 101 7.6 -> 13
-
--- Various flavours of divideint by 0
-dddvi201 divideint 0 0 -> NaN Division_undefined
-dddvi202 divideint 0.0E5 0 -> NaN Division_undefined
-dddvi203 divideint 0.000 0 -> NaN Division_undefined
-dddvi204 divideint 0.0001 0 -> Infinity Division_by_zero
-dddvi205 divideint 0.01 0 -> Infinity Division_by_zero
-dddvi206 divideint 0.1 0 -> Infinity Division_by_zero
-dddvi207 divideint 1 0 -> Infinity Division_by_zero
-dddvi208 divideint 1 0.0 -> Infinity Division_by_zero
-dddvi209 divideint 10 0.0 -> Infinity Division_by_zero
-dddvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero
-dddvi211 divideint 1E+380 0 -> Infinity Division_by_zero
-dddvi214 divideint -0.0001 0 -> -Infinity Division_by_zero
-dddvi215 divideint -0.01 0 -> -Infinity Division_by_zero
-dddvi216 divideint -0.1 0 -> -Infinity Division_by_zero
-dddvi217 divideint -1 0 -> -Infinity Division_by_zero
-dddvi218 divideint -1 0.0 -> -Infinity Division_by_zero
-dddvi219 divideint -10 0.0 -> -Infinity Division_by_zero
-dddvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero
-dddvi221 divideint -1E+380 0 -> -Infinity Division_by_zero
-
--- test some cases that are close to exponent overflow
-dddvi270 divideint 1 1e384 -> 0
-dddvi271 divideint 1 0.9e384 -> 0
-dddvi272 divideint 1 0.99e384 -> 0
-dddvi273 divideint 1 0.9999999999999999e384 -> 0
-dddvi274 divideint 9e384 1 -> NaN Division_impossible
-dddvi275 divideint 9.9e384 1 -> NaN Division_impossible
-dddvi276 divideint 9.99e384 1 -> NaN Division_impossible
-dddvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible
-
-dddvi280 divideint 0.1 9e-383 -> NaN Division_impossible
-dddvi281 divideint 0.1 99e-383 -> NaN Division_impossible
-dddvi282 divideint 0.1 999e-383 -> NaN Division_impossible
-dddvi283 divideint 0.1 9e-382 -> NaN Division_impossible
-dddvi284 divideint 0.1 99e-382 -> NaN Division_impossible
-
--- GD edge cases: lhs smaller than rhs but more digits
-dddvi301 divideint 0.9 2 -> 0
-dddvi302 divideint 0.9 2.0 -> 0
-dddvi303 divideint 0.9 2.1 -> 0
-dddvi304 divideint 0.9 2.00 -> 0
-dddvi305 divideint 0.9 2.01 -> 0
-dddvi306 divideint 0.12 1 -> 0
-dddvi307 divideint 0.12 1.0 -> 0
-dddvi308 divideint 0.12 1.00 -> 0
-dddvi309 divideint 0.12 1.0 -> 0
-dddvi310 divideint 0.12 1.00 -> 0
-dddvi311 divideint 0.12 2 -> 0
-dddvi312 divideint 0.12 2.0 -> 0
-dddvi313 divideint 0.12 2.1 -> 0
-dddvi314 divideint 0.12 2.00 -> 0
-dddvi315 divideint 0.12 2.01 -> 0
-
--- edge cases of impossible
-dddvi330 divideint 1234567890123456 10 -> 123456789012345
-dddvi331 divideint 1234567890123456 1 -> 1234567890123456
-dddvi332 divideint 1234567890123456 0.1 -> NaN Division_impossible
-dddvi333 divideint 1234567890123456 0.01 -> NaN Division_impossible
-
--- overflow and underflow tests [from divide]
-dddvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible
-dddvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible
-dddvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible
-dddvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible
-dddvi1055 divideint 1e-277 1e+311 -> 0
-dddvi1056 divideint 1e-277 -1e+311 -> -0
-dddvi1057 divideint -1e-277 1e+311 -> -0
-dddvi1058 divideint -1e-277 -1e+311 -> 0
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dddvi1060 divideint 1e-291 1e+101 -> 0
-dddvi1061 divideint 1e-291 1e+102 -> 0
-dddvi1062 divideint 1e-291 1e+103 -> 0
-dddvi1063 divideint 1e-291 1e+104 -> 0
-dddvi1064 divideint 1e-291 1e+105 -> 0
-dddvi1065 divideint 1e-291 1e+106 -> 0
-dddvi1066 divideint 1e-291 1e+107 -> 0
-dddvi1067 divideint 1e-291 1e+108 -> 0
-dddvi1068 divideint 1e-291 1e+109 -> 0
-dddvi1069 divideint 1e-291 1e+110 -> 0
-
-dddvi1101 divideint 1.0000E-394 1 -> 0
-dddvi1102 divideint 1.000E-394 1e+1 -> 0
-dddvi1103 divideint 1.00E-394 1e+2 -> 0
-
-dddvi1118 divideint 1E-394 1e+4 -> 0
-dddvi1119 divideint 3E-394 -1e+5 -> -0
-dddvi1120 divideint 5E-394 1e+5 -> 0
-
-dddvi1124 divideint 1E-394 -1e+4 -> -0
-dddvi1130 divideint 3.0E-394 -1e+5 -> -0
-
-dddvi1131 divideint 1.0E-199 1e+200 -> 0
-dddvi1132 divideint 1.0E-199 1e+199 -> 0
-dddvi1133 divideint 1.0E-199 1e+198 -> 0
-dddvi1134 divideint 2.0E-199 2e+198 -> 0
-dddvi1135 divideint 4.0E-199 4e+198 -> 0
-
--- long operand checks
-dddvi401 divideint 12345678000 100 -> 123456780
-dddvi402 divideint 1 12345678000 -> 0
-dddvi403 divideint 1234567800 10 -> 123456780
-dddvi404 divideint 1 1234567800 -> 0
-dddvi405 divideint 1234567890 10 -> 123456789
-dddvi406 divideint 1 1234567890 -> 0
-dddvi407 divideint 1234567891 10 -> 123456789
-dddvi408 divideint 1 1234567891 -> 0
-dddvi409 divideint 12345678901 100 -> 123456789
-dddvi410 divideint 1 12345678901 -> 0
-dddvi411 divideint 1234567896 10 -> 123456789
-dddvi412 divideint 1 1234567896 -> 0
-dddvi413 divideint 12345678948 100 -> 123456789
-dddvi414 divideint 12345678949 100 -> 123456789
-dddvi415 divideint 12345678950 100 -> 123456789
-dddvi416 divideint 12345678951 100 -> 123456789
-dddvi417 divideint 12345678999 100 -> 123456789
-dddvi441 divideint 12345678000 1 -> 12345678000
-dddvi442 divideint 1 12345678000 -> 0
-dddvi443 divideint 1234567800 1 -> 1234567800
-dddvi444 divideint 1 1234567800 -> 0
-dddvi445 divideint 1234567890 1 -> 1234567890
-dddvi446 divideint 1 1234567890 -> 0
-dddvi447 divideint 1234567891 1 -> 1234567891
-dddvi448 divideint 1 1234567891 -> 0
-dddvi449 divideint 12345678901 1 -> 12345678901
-dddvi450 divideint 1 12345678901 -> 0
-dddvi451 divideint 1234567896 1 -> 1234567896
-dddvi452 divideint 1 1234567896 -> 0
-
--- more zeros, etc.
-dddvi531 divideint 5.00 1E-3 -> 5000
-dddvi532 divideint 00.00 0.000 -> NaN Division_undefined
-dddvi533 divideint 00.00 0E-3 -> NaN Division_undefined
-dddvi534 divideint 0 -0 -> NaN Division_undefined
-dddvi535 divideint -0 0 -> NaN Division_undefined
-dddvi536 divideint -0 -0 -> NaN Division_undefined
-
-dddvi541 divideint 0 -1 -> -0
-dddvi542 divideint -0 -1 -> 0
-dddvi543 divideint 0 1 -> 0
-dddvi544 divideint -0 1 -> -0
-dddvi545 divideint -1 0 -> -Infinity Division_by_zero
-dddvi546 divideint -1 -0 -> Infinity Division_by_zero
-dddvi547 divideint 1 0 -> Infinity Division_by_zero
-dddvi548 divideint 1 -0 -> -Infinity Division_by_zero
-
-dddvi551 divideint 0.0 -1 -> -0
-dddvi552 divideint -0.0 -1 -> 0
-dddvi553 divideint 0.0 1 -> 0
-dddvi554 divideint -0.0 1 -> -0
-dddvi555 divideint -1.0 0 -> -Infinity Division_by_zero
-dddvi556 divideint -1.0 -0 -> Infinity Division_by_zero
-dddvi557 divideint 1.0 0 -> Infinity Division_by_zero
-dddvi558 divideint 1.0 -0 -> -Infinity Division_by_zero
-
-dddvi561 divideint 0 -1.0 -> -0
-dddvi562 divideint -0 -1.0 -> 0
-dddvi563 divideint 0 1.0 -> 0
-dddvi564 divideint -0 1.0 -> -0
-dddvi565 divideint -1 0.0 -> -Infinity Division_by_zero
-dddvi566 divideint -1 -0.0 -> Infinity Division_by_zero
-dddvi567 divideint 1 0.0 -> Infinity Division_by_zero
-dddvi568 divideint 1 -0.0 -> -Infinity Division_by_zero
-
-dddvi571 divideint 0.0 -1.0 -> -0
-dddvi572 divideint -0.0 -1.0 -> 0
-dddvi573 divideint 0.0 1.0 -> 0
-dddvi574 divideint -0.0 1.0 -> -0
-dddvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero
-dddvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero
-dddvi577 divideint 1.0 0.0 -> Infinity Division_by_zero
-dddvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero
-
--- Specials
-dddvi580 divideint Inf -Inf -> NaN Invalid_operation
-dddvi581 divideint Inf -1000 -> -Infinity
-dddvi582 divideint Inf -1 -> -Infinity
-dddvi583 divideint Inf -0 -> -Infinity
-dddvi584 divideint Inf 0 -> Infinity
-dddvi585 divideint Inf 1 -> Infinity
-dddvi586 divideint Inf 1000 -> Infinity
-dddvi587 divideint Inf Inf -> NaN Invalid_operation
-dddvi588 divideint -1000 Inf -> -0
-dddvi589 divideint -Inf Inf -> NaN Invalid_operation
-dddvi590 divideint -1 Inf -> -0
-dddvi591 divideint -0 Inf -> -0
-dddvi592 divideint 0 Inf -> 0
-dddvi593 divideint 1 Inf -> 0
-dddvi594 divideint 1000 Inf -> 0
-dddvi595 divideint Inf Inf -> NaN Invalid_operation
-
-dddvi600 divideint -Inf -Inf -> NaN Invalid_operation
-dddvi601 divideint -Inf -1000 -> Infinity
-dddvi602 divideint -Inf -1 -> Infinity
-dddvi603 divideint -Inf -0 -> Infinity
-dddvi604 divideint -Inf 0 -> -Infinity
-dddvi605 divideint -Inf 1 -> -Infinity
-dddvi606 divideint -Inf 1000 -> -Infinity
-dddvi607 divideint -Inf Inf -> NaN Invalid_operation
-dddvi608 divideint -1000 Inf -> -0
-dddvi609 divideint -Inf -Inf -> NaN Invalid_operation
-dddvi610 divideint -1 -Inf -> 0
-dddvi611 divideint -0 -Inf -> 0
-dddvi612 divideint 0 -Inf -> -0
-dddvi613 divideint 1 -Inf -> -0
-dddvi614 divideint 1000 -Inf -> -0
-dddvi615 divideint Inf -Inf -> NaN Invalid_operation
-
-dddvi621 divideint NaN -Inf -> NaN
-dddvi622 divideint NaN -1000 -> NaN
-dddvi623 divideint NaN -1 -> NaN
-dddvi624 divideint NaN -0 -> NaN
-dddvi625 divideint NaN 0 -> NaN
-dddvi626 divideint NaN 1 -> NaN
-dddvi627 divideint NaN 1000 -> NaN
-dddvi628 divideint NaN Inf -> NaN
-dddvi629 divideint NaN NaN -> NaN
-dddvi630 divideint -Inf NaN -> NaN
-dddvi631 divideint -1000 NaN -> NaN
-dddvi632 divideint -1 NaN -> NaN
-dddvi633 divideint -0 NaN -> NaN
-dddvi634 divideint 0 NaN -> NaN
-dddvi635 divideint 1 NaN -> NaN
-dddvi636 divideint 1000 NaN -> NaN
-dddvi637 divideint Inf NaN -> NaN
-
-dddvi641 divideint sNaN -Inf -> NaN Invalid_operation
-dddvi642 divideint sNaN -1000 -> NaN Invalid_operation
-dddvi643 divideint sNaN -1 -> NaN Invalid_operation
-dddvi644 divideint sNaN -0 -> NaN Invalid_operation
-dddvi645 divideint sNaN 0 -> NaN Invalid_operation
-dddvi646 divideint sNaN 1 -> NaN Invalid_operation
-dddvi647 divideint sNaN 1000 -> NaN Invalid_operation
-dddvi648 divideint sNaN NaN -> NaN Invalid_operation
-dddvi649 divideint sNaN sNaN -> NaN Invalid_operation
-dddvi650 divideint NaN sNaN -> NaN Invalid_operation
-dddvi651 divideint -Inf sNaN -> NaN Invalid_operation
-dddvi652 divideint -1000 sNaN -> NaN Invalid_operation
-dddvi653 divideint -1 sNaN -> NaN Invalid_operation
-dddvi654 divideint -0 sNaN -> NaN Invalid_operation
-dddvi655 divideint 0 sNaN -> NaN Invalid_operation
-dddvi656 divideint 1 sNaN -> NaN Invalid_operation
-dddvi657 divideint 1000 sNaN -> NaN Invalid_operation
-dddvi658 divideint Inf sNaN -> NaN Invalid_operation
-dddvi659 divideint NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dddvi661 divideint NaN9 -Inf -> NaN9
-dddvi662 divideint NaN8 1000 -> NaN8
-dddvi663 divideint NaN7 Inf -> NaN7
-dddvi664 divideint -NaN6 NaN5 -> -NaN6
-dddvi665 divideint -Inf NaN4 -> NaN4
-dddvi666 divideint -1000 NaN3 -> NaN3
-dddvi667 divideint Inf -NaN2 -> -NaN2
-
-dddvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
-dddvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation
-dddvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation
-dddvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
-dddvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
-dddvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
-dddvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation
-dddvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
-dddvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation
-
--- Null tests
-dddvi900 divideint 10 # -> NaN Invalid_operation
-dddvi901 divideint # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddDivideInt.decTest -- decDouble integer division --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+dddvi001 divideint 1 1 -> 1
+dddvi002 divideint 2 1 -> 2
+dddvi003 divideint 1 2 -> 0
+dddvi004 divideint 2 2 -> 1
+dddvi005 divideint 0 1 -> 0
+dddvi006 divideint 0 2 -> 0
+dddvi007 divideint 1 3 -> 0
+dddvi008 divideint 2 3 -> 0
+dddvi009 divideint 3 3 -> 1
+
+dddvi010 divideint 2.4 1 -> 2
+dddvi011 divideint 2.4 -1 -> -2
+dddvi012 divideint -2.4 1 -> -2
+dddvi013 divideint -2.4 -1 -> 2
+dddvi014 divideint 2.40 1 -> 2
+dddvi015 divideint 2.400 1 -> 2
+dddvi016 divideint 2.4 2 -> 1
+dddvi017 divideint 2.400 2 -> 1
+dddvi018 divideint 2. 2 -> 1
+dddvi019 divideint 20 20 -> 1
+
+dddvi020 divideint 187 187 -> 1
+dddvi021 divideint 5 2 -> 2
+dddvi022 divideint 5 2.0 -> 2
+dddvi023 divideint 5 2.000 -> 2
+dddvi024 divideint 5 0.200 -> 25
+dddvi025 divideint 5 0.200 -> 25
+
+dddvi030 divideint 1 2 -> 0
+dddvi031 divideint 1 4 -> 0
+dddvi032 divideint 1 8 -> 0
+dddvi033 divideint 1 16 -> 0
+dddvi034 divideint 1 32 -> 0
+dddvi035 divideint 1 64 -> 0
+dddvi040 divideint 1 -2 -> -0
+dddvi041 divideint 1 -4 -> -0
+dddvi042 divideint 1 -8 -> -0
+dddvi043 divideint 1 -16 -> -0
+dddvi044 divideint 1 -32 -> -0
+dddvi045 divideint 1 -64 -> -0
+dddvi050 divideint -1 2 -> -0
+dddvi051 divideint -1 4 -> -0
+dddvi052 divideint -1 8 -> -0
+dddvi053 divideint -1 16 -> -0
+dddvi054 divideint -1 32 -> -0
+dddvi055 divideint -1 64 -> -0
+dddvi060 divideint -1 -2 -> 0
+dddvi061 divideint -1 -4 -> 0
+dddvi062 divideint -1 -8 -> 0
+dddvi063 divideint -1 -16 -> 0
+dddvi064 divideint -1 -32 -> 0
+dddvi065 divideint -1 -64 -> 0
+
+-- similar with powers of ten
+dddvi160 divideint 1 1 -> 1
+dddvi161 divideint 1 10 -> 0
+dddvi162 divideint 1 100 -> 0
+dddvi163 divideint 1 1000 -> 0
+dddvi164 divideint 1 10000 -> 0
+dddvi165 divideint 1 100000 -> 0
+dddvi166 divideint 1 1000000 -> 0
+dddvi167 divideint 1 10000000 -> 0
+dddvi168 divideint 1 100000000 -> 0
+dddvi170 divideint 1 -1 -> -1
+dddvi171 divideint 1 -10 -> -0
+dddvi172 divideint 1 -100 -> -0
+dddvi173 divideint 1 -1000 -> -0
+dddvi174 divideint 1 -10000 -> -0
+dddvi175 divideint 1 -100000 -> -0
+dddvi176 divideint 1 -1000000 -> -0
+dddvi177 divideint 1 -10000000 -> -0
+dddvi178 divideint 1 -100000000 -> -0
+dddvi180 divideint -1 1 -> -1
+dddvi181 divideint -1 10 -> -0
+dddvi182 divideint -1 100 -> -0
+dddvi183 divideint -1 1000 -> -0
+dddvi184 divideint -1 10000 -> -0
+dddvi185 divideint -1 100000 -> -0
+dddvi186 divideint -1 1000000 -> -0
+dddvi187 divideint -1 10000000 -> -0
+dddvi188 divideint -1 100000000 -> -0
+dddvi190 divideint -1 -1 -> 1
+dddvi191 divideint -1 -10 -> 0
+dddvi192 divideint -1 -100 -> 0
+dddvi193 divideint -1 -1000 -> 0
+dddvi194 divideint -1 -10000 -> 0
+dddvi195 divideint -1 -100000 -> 0
+dddvi196 divideint -1 -1000000 -> 0
+dddvi197 divideint -1 -10000000 -> 0
+dddvi198 divideint -1 -100000000 -> 0
+
+-- some long operand (at p=9) cases
+dddvi070 divideint 999999999 1 -> 999999999
+dddvi071 divideint 999999999.4 1 -> 999999999
+dddvi072 divideint 999999999.5 1 -> 999999999
+dddvi073 divideint 999999999.9 1 -> 999999999
+dddvi074 divideint 999999999.999 1 -> 999999999
+
+dddvi090 divideint 0. 1 -> 0
+dddvi091 divideint .0 1 -> 0
+dddvi092 divideint 0.00 1 -> 0
+dddvi093 divideint 0.00E+9 1 -> 0
+dddvi094 divideint 0.0000E-50 1 -> 0
+
+dddvi100 divideint 1 1 -> 1
+dddvi101 divideint 1 2 -> 0
+dddvi102 divideint 1 3 -> 0
+dddvi103 divideint 1 4 -> 0
+dddvi104 divideint 1 5 -> 0
+dddvi105 divideint 1 6 -> 0
+dddvi106 divideint 1 7 -> 0
+dddvi107 divideint 1 8 -> 0
+dddvi108 divideint 1 9 -> 0
+dddvi109 divideint 1 10 -> 0
+dddvi110 divideint 1 1 -> 1
+dddvi111 divideint 2 1 -> 2
+dddvi112 divideint 3 1 -> 3
+dddvi113 divideint 4 1 -> 4
+dddvi114 divideint 5 1 -> 5
+dddvi115 divideint 6 1 -> 6
+dddvi116 divideint 7 1 -> 7
+dddvi117 divideint 8 1 -> 8
+dddvi118 divideint 9 1 -> 9
+dddvi119 divideint 10 1 -> 10
+
+-- from DiagBigDecimal
+dddvi131 divideint 101.3 1 -> 101
+dddvi132 divideint 101.0 1 -> 101
+dddvi133 divideint 101.3 3 -> 33
+dddvi134 divideint 101.0 3 -> 33
+dddvi135 divideint 2.4 1 -> 2
+dddvi136 divideint 2.400 1 -> 2
+dddvi137 divideint 18 18 -> 1
+dddvi138 divideint 1120 1000 -> 1
+dddvi139 divideint 2.4 2 -> 1
+dddvi140 divideint 2.400 2 -> 1
+dddvi141 divideint 0.5 2.000 -> 0
+dddvi142 divideint 8.005 7 -> 1
+dddvi143 divideint 5 2 -> 2
+dddvi144 divideint 0 2 -> 0
+dddvi145 divideint 0.00 2 -> 0
+
+-- Others
+dddvi150 divideint 12345 4.999 -> 2469
+dddvi151 divideint 12345 4.99 -> 2473
+dddvi152 divideint 12345 4.9 -> 2519
+dddvi153 divideint 12345 5 -> 2469
+dddvi154 divideint 12345 5.1 -> 2420
+dddvi155 divideint 12345 5.01 -> 2464
+dddvi156 divideint 12345 5.001 -> 2468
+dddvi157 divideint 101 7.6 -> 13
+
+-- Various flavours of divideint by 0
+dddvi201 divideint 0 0 -> NaN Division_undefined
+dddvi202 divideint 0.0E5 0 -> NaN Division_undefined
+dddvi203 divideint 0.000 0 -> NaN Division_undefined
+dddvi204 divideint 0.0001 0 -> Infinity Division_by_zero
+dddvi205 divideint 0.01 0 -> Infinity Division_by_zero
+dddvi206 divideint 0.1 0 -> Infinity Division_by_zero
+dddvi207 divideint 1 0 -> Infinity Division_by_zero
+dddvi208 divideint 1 0.0 -> Infinity Division_by_zero
+dddvi209 divideint 10 0.0 -> Infinity Division_by_zero
+dddvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero
+dddvi211 divideint 1E+380 0 -> Infinity Division_by_zero
+dddvi214 divideint -0.0001 0 -> -Infinity Division_by_zero
+dddvi215 divideint -0.01 0 -> -Infinity Division_by_zero
+dddvi216 divideint -0.1 0 -> -Infinity Division_by_zero
+dddvi217 divideint -1 0 -> -Infinity Division_by_zero
+dddvi218 divideint -1 0.0 -> -Infinity Division_by_zero
+dddvi219 divideint -10 0.0 -> -Infinity Division_by_zero
+dddvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero
+dddvi221 divideint -1E+380 0 -> -Infinity Division_by_zero
+
+-- test some cases that are close to exponent overflow
+dddvi270 divideint 1 1e384 -> 0
+dddvi271 divideint 1 0.9e384 -> 0
+dddvi272 divideint 1 0.99e384 -> 0
+dddvi273 divideint 1 0.9999999999999999e384 -> 0
+dddvi274 divideint 9e384 1 -> NaN Division_impossible
+dddvi275 divideint 9.9e384 1 -> NaN Division_impossible
+dddvi276 divideint 9.99e384 1 -> NaN Division_impossible
+dddvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible
+
+dddvi280 divideint 0.1 9e-383 -> NaN Division_impossible
+dddvi281 divideint 0.1 99e-383 -> NaN Division_impossible
+dddvi282 divideint 0.1 999e-383 -> NaN Division_impossible
+dddvi283 divideint 0.1 9e-382 -> NaN Division_impossible
+dddvi284 divideint 0.1 99e-382 -> NaN Division_impossible
+
+-- GD edge cases: lhs smaller than rhs but more digits
+dddvi301 divideint 0.9 2 -> 0
+dddvi302 divideint 0.9 2.0 -> 0
+dddvi303 divideint 0.9 2.1 -> 0
+dddvi304 divideint 0.9 2.00 -> 0
+dddvi305 divideint 0.9 2.01 -> 0
+dddvi306 divideint 0.12 1 -> 0
+dddvi307 divideint 0.12 1.0 -> 0
+dddvi308 divideint 0.12 1.00 -> 0
+dddvi309 divideint 0.12 1.0 -> 0
+dddvi310 divideint 0.12 1.00 -> 0
+dddvi311 divideint 0.12 2 -> 0
+dddvi312 divideint 0.12 2.0 -> 0
+dddvi313 divideint 0.12 2.1 -> 0
+dddvi314 divideint 0.12 2.00 -> 0
+dddvi315 divideint 0.12 2.01 -> 0
+
+-- edge cases of impossible
+dddvi330 divideint 1234567890123456 10 -> 123456789012345
+dddvi331 divideint 1234567890123456 1 -> 1234567890123456
+dddvi332 divideint 1234567890123456 0.1 -> NaN Division_impossible
+dddvi333 divideint 1234567890123456 0.01 -> NaN Division_impossible
+
+-- overflow and underflow tests [from divide]
+dddvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible
+dddvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible
+dddvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible
+dddvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible
+dddvi1055 divideint 1e-277 1e+311 -> 0
+dddvi1056 divideint 1e-277 -1e+311 -> -0
+dddvi1057 divideint -1e-277 1e+311 -> -0
+dddvi1058 divideint -1e-277 -1e+311 -> 0
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dddvi1060 divideint 1e-291 1e+101 -> 0
+dddvi1061 divideint 1e-291 1e+102 -> 0
+dddvi1062 divideint 1e-291 1e+103 -> 0
+dddvi1063 divideint 1e-291 1e+104 -> 0
+dddvi1064 divideint 1e-291 1e+105 -> 0
+dddvi1065 divideint 1e-291 1e+106 -> 0
+dddvi1066 divideint 1e-291 1e+107 -> 0
+dddvi1067 divideint 1e-291 1e+108 -> 0
+dddvi1068 divideint 1e-291 1e+109 -> 0
+dddvi1069 divideint 1e-291 1e+110 -> 0
+
+dddvi1101 divideint 1.0000E-394 1 -> 0
+dddvi1102 divideint 1.000E-394 1e+1 -> 0
+dddvi1103 divideint 1.00E-394 1e+2 -> 0
+
+dddvi1118 divideint 1E-394 1e+4 -> 0
+dddvi1119 divideint 3E-394 -1e+5 -> -0
+dddvi1120 divideint 5E-394 1e+5 -> 0
+
+dddvi1124 divideint 1E-394 -1e+4 -> -0
+dddvi1130 divideint 3.0E-394 -1e+5 -> -0
+
+dddvi1131 divideint 1.0E-199 1e+200 -> 0
+dddvi1132 divideint 1.0E-199 1e+199 -> 0
+dddvi1133 divideint 1.0E-199 1e+198 -> 0
+dddvi1134 divideint 2.0E-199 2e+198 -> 0
+dddvi1135 divideint 4.0E-199 4e+198 -> 0
+
+-- long operand checks
+dddvi401 divideint 12345678000 100 -> 123456780
+dddvi402 divideint 1 12345678000 -> 0
+dddvi403 divideint 1234567800 10 -> 123456780
+dddvi404 divideint 1 1234567800 -> 0
+dddvi405 divideint 1234567890 10 -> 123456789
+dddvi406 divideint 1 1234567890 -> 0
+dddvi407 divideint 1234567891 10 -> 123456789
+dddvi408 divideint 1 1234567891 -> 0
+dddvi409 divideint 12345678901 100 -> 123456789
+dddvi410 divideint 1 12345678901 -> 0
+dddvi411 divideint 1234567896 10 -> 123456789
+dddvi412 divideint 1 1234567896 -> 0
+dddvi413 divideint 12345678948 100 -> 123456789
+dddvi414 divideint 12345678949 100 -> 123456789
+dddvi415 divideint 12345678950 100 -> 123456789
+dddvi416 divideint 12345678951 100 -> 123456789
+dddvi417 divideint 12345678999 100 -> 123456789
+dddvi441 divideint 12345678000 1 -> 12345678000
+dddvi442 divideint 1 12345678000 -> 0
+dddvi443 divideint 1234567800 1 -> 1234567800
+dddvi444 divideint 1 1234567800 -> 0
+dddvi445 divideint 1234567890 1 -> 1234567890
+dddvi446 divideint 1 1234567890 -> 0
+dddvi447 divideint 1234567891 1 -> 1234567891
+dddvi448 divideint 1 1234567891 -> 0
+dddvi449 divideint 12345678901 1 -> 12345678901
+dddvi450 divideint 1 12345678901 -> 0
+dddvi451 divideint 1234567896 1 -> 1234567896
+dddvi452 divideint 1 1234567896 -> 0
+
+-- more zeros, etc.
+dddvi531 divideint 5.00 1E-3 -> 5000
+dddvi532 divideint 00.00 0.000 -> NaN Division_undefined
+dddvi533 divideint 00.00 0E-3 -> NaN Division_undefined
+dddvi534 divideint 0 -0 -> NaN Division_undefined
+dddvi535 divideint -0 0 -> NaN Division_undefined
+dddvi536 divideint -0 -0 -> NaN Division_undefined
+
+dddvi541 divideint 0 -1 -> -0
+dddvi542 divideint -0 -1 -> 0
+dddvi543 divideint 0 1 -> 0
+dddvi544 divideint -0 1 -> -0
+dddvi545 divideint -1 0 -> -Infinity Division_by_zero
+dddvi546 divideint -1 -0 -> Infinity Division_by_zero
+dddvi547 divideint 1 0 -> Infinity Division_by_zero
+dddvi548 divideint 1 -0 -> -Infinity Division_by_zero
+
+dddvi551 divideint 0.0 -1 -> -0
+dddvi552 divideint -0.0 -1 -> 0
+dddvi553 divideint 0.0 1 -> 0
+dddvi554 divideint -0.0 1 -> -0
+dddvi555 divideint -1.0 0 -> -Infinity Division_by_zero
+dddvi556 divideint -1.0 -0 -> Infinity Division_by_zero
+dddvi557 divideint 1.0 0 -> Infinity Division_by_zero
+dddvi558 divideint 1.0 -0 -> -Infinity Division_by_zero
+
+dddvi561 divideint 0 -1.0 -> -0
+dddvi562 divideint -0 -1.0 -> 0
+dddvi563 divideint 0 1.0 -> 0
+dddvi564 divideint -0 1.0 -> -0
+dddvi565 divideint -1 0.0 -> -Infinity Division_by_zero
+dddvi566 divideint -1 -0.0 -> Infinity Division_by_zero
+dddvi567 divideint 1 0.0 -> Infinity Division_by_zero
+dddvi568 divideint 1 -0.0 -> -Infinity Division_by_zero
+
+dddvi571 divideint 0.0 -1.0 -> -0
+dddvi572 divideint -0.0 -1.0 -> 0
+dddvi573 divideint 0.0 1.0 -> 0
+dddvi574 divideint -0.0 1.0 -> -0
+dddvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero
+dddvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero
+dddvi577 divideint 1.0 0.0 -> Infinity Division_by_zero
+dddvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero
+
+-- Specials
+dddvi580 divideint Inf -Inf -> NaN Invalid_operation
+dddvi581 divideint Inf -1000 -> -Infinity
+dddvi582 divideint Inf -1 -> -Infinity
+dddvi583 divideint Inf -0 -> -Infinity
+dddvi584 divideint Inf 0 -> Infinity
+dddvi585 divideint Inf 1 -> Infinity
+dddvi586 divideint Inf 1000 -> Infinity
+dddvi587 divideint Inf Inf -> NaN Invalid_operation
+dddvi588 divideint -1000 Inf -> -0
+dddvi589 divideint -Inf Inf -> NaN Invalid_operation
+dddvi590 divideint -1 Inf -> -0
+dddvi591 divideint -0 Inf -> -0
+dddvi592 divideint 0 Inf -> 0
+dddvi593 divideint 1 Inf -> 0
+dddvi594 divideint 1000 Inf -> 0
+dddvi595 divideint Inf Inf -> NaN Invalid_operation
+
+dddvi600 divideint -Inf -Inf -> NaN Invalid_operation
+dddvi601 divideint -Inf -1000 -> Infinity
+dddvi602 divideint -Inf -1 -> Infinity
+dddvi603 divideint -Inf -0 -> Infinity
+dddvi604 divideint -Inf 0 -> -Infinity
+dddvi605 divideint -Inf 1 -> -Infinity
+dddvi606 divideint -Inf 1000 -> -Infinity
+dddvi607 divideint -Inf Inf -> NaN Invalid_operation
+dddvi608 divideint -1000 Inf -> -0
+dddvi609 divideint -Inf -Inf -> NaN Invalid_operation
+dddvi610 divideint -1 -Inf -> 0
+dddvi611 divideint -0 -Inf -> 0
+dddvi612 divideint 0 -Inf -> -0
+dddvi613 divideint 1 -Inf -> -0
+dddvi614 divideint 1000 -Inf -> -0
+dddvi615 divideint Inf -Inf -> NaN Invalid_operation
+
+dddvi621 divideint NaN -Inf -> NaN
+dddvi622 divideint NaN -1000 -> NaN
+dddvi623 divideint NaN -1 -> NaN
+dddvi624 divideint NaN -0 -> NaN
+dddvi625 divideint NaN 0 -> NaN
+dddvi626 divideint NaN 1 -> NaN
+dddvi627 divideint NaN 1000 -> NaN
+dddvi628 divideint NaN Inf -> NaN
+dddvi629 divideint NaN NaN -> NaN
+dddvi630 divideint -Inf NaN -> NaN
+dddvi631 divideint -1000 NaN -> NaN
+dddvi632 divideint -1 NaN -> NaN
+dddvi633 divideint -0 NaN -> NaN
+dddvi634 divideint 0 NaN -> NaN
+dddvi635 divideint 1 NaN -> NaN
+dddvi636 divideint 1000 NaN -> NaN
+dddvi637 divideint Inf NaN -> NaN
+
+dddvi641 divideint sNaN -Inf -> NaN Invalid_operation
+dddvi642 divideint sNaN -1000 -> NaN Invalid_operation
+dddvi643 divideint sNaN -1 -> NaN Invalid_operation
+dddvi644 divideint sNaN -0 -> NaN Invalid_operation
+dddvi645 divideint sNaN 0 -> NaN Invalid_operation
+dddvi646 divideint sNaN 1 -> NaN Invalid_operation
+dddvi647 divideint sNaN 1000 -> NaN Invalid_operation
+dddvi648 divideint sNaN NaN -> NaN Invalid_operation
+dddvi649 divideint sNaN sNaN -> NaN Invalid_operation
+dddvi650 divideint NaN sNaN -> NaN Invalid_operation
+dddvi651 divideint -Inf sNaN -> NaN Invalid_operation
+dddvi652 divideint -1000 sNaN -> NaN Invalid_operation
+dddvi653 divideint -1 sNaN -> NaN Invalid_operation
+dddvi654 divideint -0 sNaN -> NaN Invalid_operation
+dddvi655 divideint 0 sNaN -> NaN Invalid_operation
+dddvi656 divideint 1 sNaN -> NaN Invalid_operation
+dddvi657 divideint 1000 sNaN -> NaN Invalid_operation
+dddvi658 divideint Inf sNaN -> NaN Invalid_operation
+dddvi659 divideint NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dddvi661 divideint NaN9 -Inf -> NaN9
+dddvi662 divideint NaN8 1000 -> NaN8
+dddvi663 divideint NaN7 Inf -> NaN7
+dddvi664 divideint -NaN6 NaN5 -> -NaN6
+dddvi665 divideint -Inf NaN4 -> NaN4
+dddvi666 divideint -1000 NaN3 -> NaN3
+dddvi667 divideint Inf -NaN2 -> -NaN2
+
+dddvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
+dddvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation
+dddvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation
+dddvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
+dddvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
+dddvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
+dddvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation
+dddvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
+dddvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation
+
+-- Null tests
+dddvi900 divideint 10 # -> NaN Invalid_operation
+dddvi901 divideint # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddEncode.decTest b/Lib/test/decimaltestdata/ddEncode.decTest
index de9d31c0a6..e91ec6143c 100644
--- a/Lib/test/decimaltestdata/ddEncode.decTest
+++ b/Lib/test/decimaltestdata/ddEncode.decTest
@@ -1,495 +1,495 @@
-------------------------------------------------------------------------
--- ddEncode.decTest -- decimal eight-byte format testcases --
--- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
--- [Previously called decimal64.decTest]
-version: 2.59
-
--- This set of tests is for the eight-byte concrete representation.
--- Its characteristics are:
---
--- 1 bit sign
--- 5 bits combination field
--- 8 bits exponent continuation
--- 50 bits coefficient continuation
---
--- Total exponent length 10 bits
--- Total coefficient length 54 bits (16 digits)
---
--- Elimit = 767 (maximum encoded exponent)
--- Emax = 384 (largest exponent value)
--- Emin = -383 (smallest exponent value)
--- bias = 398 (subtracted from encoded exponent) = -Etiny
-
--- The testcases here have only exactly representable data on the
--- 'left-hand-side'; rounding from strings is tested in 'base'
--- testcase groups.
-
-extended: 1
-clamp: 1
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
--- General testcases
--- (mostly derived from the Strawman 4 document and examples)
-dece001 apply #A2300000000003D0 -> -7.50
-dece002 apply -7.50 -> #A2300000000003D0
--- derivative canonical plain strings
-dece003 apply #A23c0000000003D0 -> -7.50E+3
-dece004 apply -7.50E+3 -> #A23c0000000003D0
-dece005 apply #A2380000000003D0 -> -750
-dece006 apply -750 -> #A2380000000003D0
-dece007 apply #A2340000000003D0 -> -75.0
-dece008 apply -75.0 -> #A2340000000003D0
-dece009 apply #A22c0000000003D0 -> -0.750
-dece010 apply -0.750 -> #A22c0000000003D0
-dece011 apply #A2280000000003D0 -> -0.0750
-dece012 apply -0.0750 -> #A2280000000003D0
-dece013 apply #A2200000000003D0 -> -0.000750
-dece014 apply -0.000750 -> #A2200000000003D0
-dece015 apply #A2180000000003D0 -> -0.00000750
-dece016 apply -0.00000750 -> #A2180000000003D0
-dece017 apply #A2140000000003D0 -> -7.50E-7
-dece018 apply -7.50E-7 -> #A2140000000003D0
-
--- Normality
-dece020 apply 1234567890123456 -> #263934b9c1e28e56
-dece021 apply -1234567890123456 -> #a63934b9c1e28e56
-dece022 apply 1234.567890123456 -> #260934b9c1e28e56
-dece023 apply #260934b9c1e28e56 -> 1234.567890123456
-dece024 apply 1111111111111111 -> #2638912449124491
-dece025 apply 9999999999999999 -> #6e38ff3fcff3fcff
-
--- Nmax and similar
-dece031 apply 9999999999999999E+369 -> #77fcff3fcff3fcff
-dece032 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
-dece033 apply #77fcff3fcff3fcff -> 9.999999999999999E+384
-dece034 apply 1.234567890123456E+384 -> #47fd34b9c1e28e56
-dece035 apply #47fd34b9c1e28e56 -> 1.234567890123456E+384
--- fold-downs (more below)
-dece036 apply 1.23E+384 -> #47fd300000000000 Clamped
-dece037 apply #47fd300000000000 -> 1.230000000000000E+384
-decd038 apply 1E+384 -> #47fc000000000000 Clamped
-decd039 apply #47fc000000000000 -> 1.000000000000000E+384
-
-decd051 apply 12345 -> #22380000000049c5
-decd052 apply #22380000000049c5 -> 12345
-decd053 apply 1234 -> #2238000000000534
-decd054 apply #2238000000000534 -> 1234
-decd055 apply 123 -> #22380000000000a3
-decd056 apply #22380000000000a3 -> 123
-decd057 apply 12 -> #2238000000000012
-decd058 apply #2238000000000012 -> 12
-decd059 apply 1 -> #2238000000000001
-decd060 apply #2238000000000001 -> 1
-decd061 apply 1.23 -> #22300000000000a3
-decd062 apply #22300000000000a3 -> 1.23
-decd063 apply 123.45 -> #22300000000049c5
-decd064 apply #22300000000049c5 -> 123.45
-
--- Nmin and below
-decd071 apply 1E-383 -> #003c000000000001
-decd072 apply #003c000000000001 -> 1E-383
-decd073 apply 1.000000000000000E-383 -> #0400000000000000
-decd074 apply #0400000000000000 -> 1.000000000000000E-383
-decd075 apply 1.000000000000001E-383 -> #0400000000000001
-decd076 apply #0400000000000001 -> 1.000000000000001E-383
-
-decd077 apply 0.100000000000000E-383 -> #0000800000000000 Subnormal
-decd078 apply #0000800000000000 -> 1.00000000000000E-384 Subnormal
-decd079 apply 0.000000000000010E-383 -> #0000000000000010 Subnormal
-decd080 apply #0000000000000010 -> 1.0E-397 Subnormal
-decd081 apply 0.00000000000001E-383 -> #0004000000000001 Subnormal
-decd082 apply #0004000000000001 -> 1E-397 Subnormal
-decd083 apply 0.000000000000001E-383 -> #0000000000000001 Subnormal
-decd084 apply #0000000000000001 -> 1E-398 Subnormal
--- next is smallest all-nines
-decd085 apply 9999999999999999E-398 -> #6400ff3fcff3fcff
-decd086 apply #6400ff3fcff3fcff -> 9.999999999999999E-383
--- and a problematic divide result
-decd088 apply 1.111111111111111E-383 -> #0400912449124491
-decd089 apply #0400912449124491 -> 1.111111111111111E-383
-
--- forties
-decd090 apply 40 -> #2238000000000040
-decd091 apply 39.99 -> #2230000000000cff
-
--- underflows cannot be tested as all LHS exact
-
--- Same again, negatives
--- Nmax and similar
-decd122 apply -9.999999999999999E+384 -> #f7fcff3fcff3fcff
-decd123 apply #f7fcff3fcff3fcff -> -9.999999999999999E+384
-decd124 apply -1.234567890123456E+384 -> #c7fd34b9c1e28e56
-decd125 apply #c7fd34b9c1e28e56 -> -1.234567890123456E+384
--- fold-downs (more below)
-decd130 apply -1.23E+384 -> #c7fd300000000000 Clamped
-decd131 apply #c7fd300000000000 -> -1.230000000000000E+384
-decd132 apply -1E+384 -> #c7fc000000000000 Clamped
-decd133 apply #c7fc000000000000 -> -1.000000000000000E+384
-
--- overflows
-decd151 apply -12345 -> #a2380000000049c5
-decd152 apply #a2380000000049c5 -> -12345
-decd153 apply -1234 -> #a238000000000534
-decd154 apply #a238000000000534 -> -1234
-decd155 apply -123 -> #a2380000000000a3
-decd156 apply #a2380000000000a3 -> -123
-decd157 apply -12 -> #a238000000000012
-decd158 apply #a238000000000012 -> -12
-decd159 apply -1 -> #a238000000000001
-decd160 apply #a238000000000001 -> -1
-decd161 apply -1.23 -> #a2300000000000a3
-decd162 apply #a2300000000000a3 -> -1.23
-decd163 apply -123.45 -> #a2300000000049c5
-decd164 apply #a2300000000049c5 -> -123.45
-
--- Nmin and below
-decd171 apply -1E-383 -> #803c000000000001
-decd172 apply #803c000000000001 -> -1E-383
-decd173 apply -1.000000000000000E-383 -> #8400000000000000
-decd174 apply #8400000000000000 -> -1.000000000000000E-383
-decd175 apply -1.000000000000001E-383 -> #8400000000000001
-decd176 apply #8400000000000001 -> -1.000000000000001E-383
-
-decd177 apply -0.100000000000000E-383 -> #8000800000000000 Subnormal
-decd178 apply #8000800000000000 -> -1.00000000000000E-384 Subnormal
-decd179 apply -0.000000000000010E-383 -> #8000000000000010 Subnormal
-decd180 apply #8000000000000010 -> -1.0E-397 Subnormal
-decd181 apply -0.00000000000001E-383 -> #8004000000000001 Subnormal
-decd182 apply #8004000000000001 -> -1E-397 Subnormal
-decd183 apply -0.000000000000001E-383 -> #8000000000000001 Subnormal
-decd184 apply #8000000000000001 -> -1E-398 Subnormal
--- next is smallest all-nines
-decd185 apply -9999999999999999E-398 -> #e400ff3fcff3fcff
-decd186 apply #e400ff3fcff3fcff -> -9.999999999999999E-383
--- and a tricky subnormal
-decd187 apply 1.11111111111524E-384 -> #00009124491246a4 Subnormal
-decd188 apply #00009124491246a4 -> 1.11111111111524E-384 Subnormal
-
--- near-underflows
-decd189 apply -1e-398 -> #8000000000000001 Subnormal
-decd190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded
-
--- zeros
-decd401 apply 0E-500 -> #0000000000000000 Clamped
-decd402 apply 0E-400 -> #0000000000000000 Clamped
-decd403 apply 0E-398 -> #0000000000000000
-decd404 apply #0000000000000000 -> 0E-398
-decd405 apply 0.000000000000000E-383 -> #0000000000000000
-decd406 apply #0000000000000000 -> 0E-398
-decd407 apply 0E-2 -> #2230000000000000
-decd408 apply #2230000000000000 -> 0.00
-decd409 apply 0 -> #2238000000000000
-decd410 apply #2238000000000000 -> 0
-decd411 apply 0E+3 -> #2244000000000000
-decd412 apply #2244000000000000 -> 0E+3
-decd413 apply 0E+369 -> #43fc000000000000
-decd414 apply #43fc000000000000 -> 0E+369
--- clamped zeros...
-decd415 apply 0E+370 -> #43fc000000000000 Clamped
-decd416 apply #43fc000000000000 -> 0E+369
-decd417 apply 0E+384 -> #43fc000000000000 Clamped
-decd418 apply #43fc000000000000 -> 0E+369
-decd419 apply 0E+400 -> #43fc000000000000 Clamped
-decd420 apply #43fc000000000000 -> 0E+369
-decd421 apply 0E+500 -> #43fc000000000000 Clamped
-decd422 apply #43fc000000000000 -> 0E+369
-
--- negative zeros
-decd431 apply -0E-400 -> #8000000000000000 Clamped
-decd432 apply -0E-400 -> #8000000000000000 Clamped
-decd433 apply -0E-398 -> #8000000000000000
-decd434 apply #8000000000000000 -> -0E-398
-decd435 apply -0.000000000000000E-383 -> #8000000000000000
-decd436 apply #8000000000000000 -> -0E-398
-decd437 apply -0E-2 -> #a230000000000000
-decd438 apply #a230000000000000 -> -0.00
-decd439 apply -0 -> #a238000000000000
-decd440 apply #a238000000000000 -> -0
-decd441 apply -0E+3 -> #a244000000000000
-decd442 apply #a244000000000000 -> -0E+3
-decd443 apply -0E+369 -> #c3fc000000000000
-decd444 apply #c3fc000000000000 -> -0E+369
--- clamped zeros...
-decd445 apply -0E+370 -> #c3fc000000000000 Clamped
-decd446 apply #c3fc000000000000 -> -0E+369
-decd447 apply -0E+384 -> #c3fc000000000000 Clamped
-decd448 apply #c3fc000000000000 -> -0E+369
-decd449 apply -0E+400 -> #c3fc000000000000 Clamped
-decd450 apply #c3fc000000000000 -> -0E+369
-decd451 apply -0E+500 -> #c3fc000000000000 Clamped
-decd452 apply #c3fc000000000000 -> -0E+369
-
--- exponents
-decd460 apply #225c000000000007 -> 7E+9
-decd461 apply 7E+9 -> #225c000000000007
-decd462 apply #23c4000000000007 -> 7E+99
-decd463 apply 7E+99 -> #23c4000000000007
-
--- Specials
-decd500 apply Infinity -> #7800000000000000
-decd501 apply #7878787878787878 -> #7800000000000000
-decd502 apply #7800000000000000 -> Infinity
-decd503 apply #7979797979797979 -> #7800000000000000
-decd504 apply #7900000000000000 -> Infinity
-decd505 apply #7a7a7a7a7a7a7a7a -> #7800000000000000
-decd506 apply #7a00000000000000 -> Infinity
-decd507 apply #7b7b7b7b7b7b7b7b -> #7800000000000000
-decd508 apply #7b00000000000000 -> Infinity
-
-decd509 apply NaN -> #7c00000000000000
-decd510 apply #7c7c7c7c7c7c7c7c -> #7c007c7c7c7c7c7c
-decd511 apply #7c00000000000000 -> NaN
-decd512 apply #7d7d7d7d7d7d7d7d -> #7c017d7d7d7d7d7d
-decd513 apply #7d00000000000000 -> NaN
-decd514 apply #7e7e7e7e7e7e7e7e -> #7e007e7e7e7e7c7e
-decd515 apply #7e00000000000000 -> sNaN
-decd516 apply #7f7f7f7f7f7f7f7f -> #7e007f7f7f7f7c7f
-decd517 apply #7f00000000000000 -> sNaN
-decd518 apply #7fffffffffffffff -> sNaN999999999999999
-decd519 apply #7fffffffffffffff -> #7e00ff3fcff3fcff
-
-decd520 apply -Infinity -> #f800000000000000
-decd521 apply #f878787878787878 -> #f800000000000000
-decd522 apply #f800000000000000 -> -Infinity
-decd523 apply #f979797979797979 -> #f800000000000000
-decd524 apply #f900000000000000 -> -Infinity
-decd525 apply #fa7a7a7a7a7a7a7a -> #f800000000000000
-decd526 apply #fa00000000000000 -> -Infinity
-decd527 apply #fb7b7b7b7b7b7b7b -> #f800000000000000
-decd528 apply #fb00000000000000 -> -Infinity
-
-decd529 apply -NaN -> #fc00000000000000
-decd530 apply #fc7c7c7c7c7c7c7c -> #fc007c7c7c7c7c7c
-decd531 apply #fc00000000000000 -> -NaN
-decd532 apply #fd7d7d7d7d7d7d7d -> #fc017d7d7d7d7d7d
-decd533 apply #fd00000000000000 -> -NaN
-decd534 apply #fe7e7e7e7e7e7e7e -> #fe007e7e7e7e7c7e
-decd535 apply #fe00000000000000 -> -sNaN
-decd536 apply #ff7f7f7f7f7f7f7f -> #fe007f7f7f7f7c7f
-decd537 apply #ff00000000000000 -> -sNaN
-decd538 apply #ffffffffffffffff -> -sNaN999999999999999
-decd539 apply #ffffffffffffffff -> #fe00ff3fcff3fcff
-
--- diagnostic NaNs
-decd540 apply NaN -> #7c00000000000000
-decd541 apply NaN0 -> #7c00000000000000
-decd542 apply NaN1 -> #7c00000000000001
-decd543 apply NaN12 -> #7c00000000000012
-decd544 apply NaN79 -> #7c00000000000079
-decd545 apply NaN12345 -> #7c000000000049c5
-decd546 apply NaN123456 -> #7c00000000028e56
-decd547 apply NaN799799 -> #7c000000000f7fdf
-decd548 apply NaN799799799799799 -> #7c03dff7fdff7fdf
-decd549 apply NaN999999999999999 -> #7c00ff3fcff3fcff
--- too many digits
-
--- fold-down full sequence
-decd601 apply 1E+384 -> #47fc000000000000 Clamped
-decd602 apply #47fc000000000000 -> 1.000000000000000E+384
-decd603 apply 1E+383 -> #43fc800000000000 Clamped
-decd604 apply #43fc800000000000 -> 1.00000000000000E+383
-decd605 apply 1E+382 -> #43fc100000000000 Clamped
-decd606 apply #43fc100000000000 -> 1.0000000000000E+382
-decd607 apply 1E+381 -> #43fc010000000000 Clamped
-decd608 apply #43fc010000000000 -> 1.000000000000E+381
-decd609 apply 1E+380 -> #43fc002000000000 Clamped
-decd610 apply #43fc002000000000 -> 1.00000000000E+380
-decd611 apply 1E+379 -> #43fc000400000000 Clamped
-decd612 apply #43fc000400000000 -> 1.0000000000E+379
-decd613 apply 1E+378 -> #43fc000040000000 Clamped
-decd614 apply #43fc000040000000 -> 1.000000000E+378
-decd615 apply 1E+377 -> #43fc000008000000 Clamped
-decd616 apply #43fc000008000000 -> 1.00000000E+377
-decd617 apply 1E+376 -> #43fc000001000000 Clamped
-decd618 apply #43fc000001000000 -> 1.0000000E+376
-decd619 apply 1E+375 -> #43fc000000100000 Clamped
-decd620 apply #43fc000000100000 -> 1.000000E+375
-decd621 apply 1E+374 -> #43fc000000020000 Clamped
-decd622 apply #43fc000000020000 -> 1.00000E+374
-decd623 apply 1E+373 -> #43fc000000004000 Clamped
-decd624 apply #43fc000000004000 -> 1.0000E+373
-decd625 apply 1E+372 -> #43fc000000000400 Clamped
-decd626 apply #43fc000000000400 -> 1.000E+372
-decd627 apply 1E+371 -> #43fc000000000080 Clamped
-decd628 apply #43fc000000000080 -> 1.00E+371
-decd629 apply 1E+370 -> #43fc000000000010 Clamped
-decd630 apply #43fc000000000010 -> 1.0E+370
-decd631 apply 1E+369 -> #43fc000000000001
-decd632 apply #43fc000000000001 -> 1E+369
-decd633 apply 1E+368 -> #43f8000000000001
-decd634 apply #43f8000000000001 -> 1E+368
--- same with 9s
-decd641 apply 9E+384 -> #77fc000000000000 Clamped
-decd642 apply #77fc000000000000 -> 9.000000000000000E+384
-decd643 apply 9E+383 -> #43fc8c0000000000 Clamped
-decd644 apply #43fc8c0000000000 -> 9.00000000000000E+383
-decd645 apply 9E+382 -> #43fc1a0000000000 Clamped
-decd646 apply #43fc1a0000000000 -> 9.0000000000000E+382
-decd647 apply 9E+381 -> #43fc090000000000 Clamped
-decd648 apply #43fc090000000000 -> 9.000000000000E+381
-decd649 apply 9E+380 -> #43fc002300000000 Clamped
-decd650 apply #43fc002300000000 -> 9.00000000000E+380
-decd651 apply 9E+379 -> #43fc000680000000 Clamped
-decd652 apply #43fc000680000000 -> 9.0000000000E+379
-decd653 apply 9E+378 -> #43fc000240000000 Clamped
-decd654 apply #43fc000240000000 -> 9.000000000E+378
-decd655 apply 9E+377 -> #43fc000008c00000 Clamped
-decd656 apply #43fc000008c00000 -> 9.00000000E+377
-decd657 apply 9E+376 -> #43fc000001a00000 Clamped
-decd658 apply #43fc000001a00000 -> 9.0000000E+376
-decd659 apply 9E+375 -> #43fc000000900000 Clamped
-decd660 apply #43fc000000900000 -> 9.000000E+375
-decd661 apply 9E+374 -> #43fc000000023000 Clamped
-decd662 apply #43fc000000023000 -> 9.00000E+374
-decd663 apply 9E+373 -> #43fc000000006800 Clamped
-decd664 apply #43fc000000006800 -> 9.0000E+373
-decd665 apply 9E+372 -> #43fc000000002400 Clamped
-decd666 apply #43fc000000002400 -> 9.000E+372
-decd667 apply 9E+371 -> #43fc00000000008c Clamped
-decd668 apply #43fc00000000008c -> 9.00E+371
-decd669 apply 9E+370 -> #43fc00000000001a Clamped
-decd670 apply #43fc00000000001a -> 9.0E+370
-decd671 apply 9E+369 -> #43fc000000000009
-decd672 apply #43fc000000000009 -> 9E+369
-decd673 apply 9E+368 -> #43f8000000000009
-decd674 apply #43f8000000000009 -> 9E+368
-
-
--- Selected DPD codes
-decd700 apply #2238000000000000 -> 0
-decd701 apply #2238000000000009 -> 9
-decd702 apply #2238000000000010 -> 10
-decd703 apply #2238000000000019 -> 19
-decd704 apply #2238000000000020 -> 20
-decd705 apply #2238000000000029 -> 29
-decd706 apply #2238000000000030 -> 30
-decd707 apply #2238000000000039 -> 39
-decd708 apply #2238000000000040 -> 40
-decd709 apply #2238000000000049 -> 49
-decd710 apply #2238000000000050 -> 50
-decd711 apply #2238000000000059 -> 59
-decd712 apply #2238000000000060 -> 60
-decd713 apply #2238000000000069 -> 69
-decd714 apply #2238000000000070 -> 70
-decd715 apply #2238000000000071 -> 71
-decd716 apply #2238000000000072 -> 72
-decd717 apply #2238000000000073 -> 73
-decd718 apply #2238000000000074 -> 74
-decd719 apply #2238000000000075 -> 75
-decd720 apply #2238000000000076 -> 76
-decd721 apply #2238000000000077 -> 77
-decd722 apply #2238000000000078 -> 78
-decd723 apply #2238000000000079 -> 79
-
-decd725 apply #223800000000029e -> 994
-decd726 apply #223800000000029f -> 995
-decd727 apply #22380000000002a0 -> 520
-decd728 apply #22380000000002a1 -> 521
--- from telco test data
-decd730 apply #2238000000000188 -> 308
-decd731 apply #22380000000001a3 -> 323
-decd732 apply #223800000000002a -> 82
-decd733 apply #22380000000001a9 -> 329
-decd734 apply #2238000000000081 -> 101
-decd735 apply #22380000000002a2 -> 522
-
--- DPD: one of each of the huffman groups
-decd740 apply #22380000000003f7 -> 777
-decd741 apply #22380000000003f8 -> 778
-decd742 apply #22380000000003eb -> 787
-decd743 apply #223800000000037d -> 877
-decd744 apply #223800000000039f -> 997
-decd745 apply #22380000000003bf -> 979
-decd746 apply #22380000000003df -> 799
-decd747 apply #223800000000006e -> 888
-
--- DPD all-highs cases (includes the 24 redundant codes)
-decd750 apply #223800000000006e -> 888
-decd751 apply #223800000000016e -> 888
-decd752 apply #223800000000026e -> 888
-decd753 apply #223800000000036e -> 888
-decd754 apply #223800000000006f -> 889
-decd755 apply #223800000000016f -> 889
-decd756 apply #223800000000026f -> 889
-decd757 apply #223800000000036f -> 889
-
-decd760 apply #223800000000007e -> 898
-decd761 apply #223800000000017e -> 898
-decd762 apply #223800000000027e -> 898
-decd763 apply #223800000000037e -> 898
-decd764 apply #223800000000007f -> 899
-decd765 apply #223800000000017f -> 899
-decd766 apply #223800000000027f -> 899
-decd767 apply #223800000000037f -> 899
-
-decd770 apply #22380000000000ee -> 988
-decd771 apply #22380000000001ee -> 988
-decd772 apply #22380000000002ee -> 988
-decd773 apply #22380000000003ee -> 988
-decd774 apply #22380000000000ef -> 989
-decd775 apply #22380000000001ef -> 989
-decd776 apply #22380000000002ef -> 989
-decd777 apply #22380000000003ef -> 989
-
-decd780 apply #22380000000000fe -> 998
-decd781 apply #22380000000001fe -> 998
-decd782 apply #22380000000002fe -> 998
-decd783 apply #22380000000003fe -> 998
-decd784 apply #22380000000000ff -> 999
-decd785 apply #22380000000001ff -> 999
-decd786 apply #22380000000002ff -> 999
-decd787 apply #22380000000003ff -> 999
-
--- values around [u]int32 edges (zeros done earlier)
-decd800 apply -2147483646 -> #a23800008c78af46
-decd801 apply -2147483647 -> #a23800008c78af47
-decd802 apply -2147483648 -> #a23800008c78af48
-decd803 apply -2147483649 -> #a23800008c78af49
-decd804 apply 2147483646 -> #223800008c78af46
-decd805 apply 2147483647 -> #223800008c78af47
-decd806 apply 2147483648 -> #223800008c78af48
-decd807 apply 2147483649 -> #223800008c78af49
-decd808 apply 4294967294 -> #2238000115afb55a
-decd809 apply 4294967295 -> #2238000115afb55b
-decd810 apply 4294967296 -> #2238000115afb57a
-decd811 apply 4294967297 -> #2238000115afb57b
-
-decd820 apply #a23800008c78af46 -> -2147483646
-decd821 apply #a23800008c78af47 -> -2147483647
-decd822 apply #a23800008c78af48 -> -2147483648
-decd823 apply #a23800008c78af49 -> -2147483649
-decd824 apply #223800008c78af46 -> 2147483646
-decd825 apply #223800008c78af47 -> 2147483647
-decd826 apply #223800008c78af48 -> 2147483648
-decd827 apply #223800008c78af49 -> 2147483649
-decd828 apply #2238000115afb55a -> 4294967294
-decd829 apply #2238000115afb55b -> 4294967295
-decd830 apply #2238000115afb57a -> 4294967296
-decd831 apply #2238000115afb57b -> 4294967297
-
--- for narrowing
-decd840 apply #2870000000000000 -> 2.000000000000000E-99
-
--- some miscellaneous
-decd850 apply #0004070000000000 -> 7.000000000000E-385 Subnormal
-decd851 apply #0008000000020000 -> 1.00000E-391 Subnormal
-
+------------------------------------------------------------------------
+-- ddEncode.decTest -- decimal eight-byte format testcases --
+-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+-- [Previously called decimal64.decTest]
+version: 2.59
+
+-- This set of tests is for the eight-byte concrete representation.
+-- Its characteristics are:
+--
+-- 1 bit sign
+-- 5 bits combination field
+-- 8 bits exponent continuation
+-- 50 bits coefficient continuation
+--
+-- Total exponent length 10 bits
+-- Total coefficient length 54 bits (16 digits)
+--
+-- Elimit = 767 (maximum encoded exponent)
+-- Emax = 384 (largest exponent value)
+-- Emin = -383 (smallest exponent value)
+-- bias = 398 (subtracted from encoded exponent) = -Etiny
+
+-- The testcases here have only exactly representable data on the
+-- 'left-hand-side'; rounding from strings is tested in 'base'
+-- testcase groups.
+
+extended: 1
+clamp: 1
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+-- General testcases
+-- (mostly derived from the Strawman 4 document and examples)
+dece001 apply #A2300000000003D0 -> -7.50
+dece002 apply -7.50 -> #A2300000000003D0
+-- derivative canonical plain strings
+dece003 apply #A23c0000000003D0 -> -7.50E+3
+dece004 apply -7.50E+3 -> #A23c0000000003D0
+dece005 apply #A2380000000003D0 -> -750
+dece006 apply -750 -> #A2380000000003D0
+dece007 apply #A2340000000003D0 -> -75.0
+dece008 apply -75.0 -> #A2340000000003D0
+dece009 apply #A22c0000000003D0 -> -0.750
+dece010 apply -0.750 -> #A22c0000000003D0
+dece011 apply #A2280000000003D0 -> -0.0750
+dece012 apply -0.0750 -> #A2280000000003D0
+dece013 apply #A2200000000003D0 -> -0.000750
+dece014 apply -0.000750 -> #A2200000000003D0
+dece015 apply #A2180000000003D0 -> -0.00000750
+dece016 apply -0.00000750 -> #A2180000000003D0
+dece017 apply #A2140000000003D0 -> -7.50E-7
+dece018 apply -7.50E-7 -> #A2140000000003D0
+
+-- Normality
+dece020 apply 1234567890123456 -> #263934b9c1e28e56
+dece021 apply -1234567890123456 -> #a63934b9c1e28e56
+dece022 apply 1234.567890123456 -> #260934b9c1e28e56
+dece023 apply #260934b9c1e28e56 -> 1234.567890123456
+dece024 apply 1111111111111111 -> #2638912449124491
+dece025 apply 9999999999999999 -> #6e38ff3fcff3fcff
+
+-- Nmax and similar
+dece031 apply 9999999999999999E+369 -> #77fcff3fcff3fcff
+dece032 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
+dece033 apply #77fcff3fcff3fcff -> 9.999999999999999E+384
+dece034 apply 1.234567890123456E+384 -> #47fd34b9c1e28e56
+dece035 apply #47fd34b9c1e28e56 -> 1.234567890123456E+384
+-- fold-downs (more below)
+dece036 apply 1.23E+384 -> #47fd300000000000 Clamped
+dece037 apply #47fd300000000000 -> 1.230000000000000E+384
+decd038 apply 1E+384 -> #47fc000000000000 Clamped
+decd039 apply #47fc000000000000 -> 1.000000000000000E+384
+
+decd051 apply 12345 -> #22380000000049c5
+decd052 apply #22380000000049c5 -> 12345
+decd053 apply 1234 -> #2238000000000534
+decd054 apply #2238000000000534 -> 1234
+decd055 apply 123 -> #22380000000000a3
+decd056 apply #22380000000000a3 -> 123
+decd057 apply 12 -> #2238000000000012
+decd058 apply #2238000000000012 -> 12
+decd059 apply 1 -> #2238000000000001
+decd060 apply #2238000000000001 -> 1
+decd061 apply 1.23 -> #22300000000000a3
+decd062 apply #22300000000000a3 -> 1.23
+decd063 apply 123.45 -> #22300000000049c5
+decd064 apply #22300000000049c5 -> 123.45
+
+-- Nmin and below
+decd071 apply 1E-383 -> #003c000000000001
+decd072 apply #003c000000000001 -> 1E-383
+decd073 apply 1.000000000000000E-383 -> #0400000000000000
+decd074 apply #0400000000000000 -> 1.000000000000000E-383
+decd075 apply 1.000000000000001E-383 -> #0400000000000001
+decd076 apply #0400000000000001 -> 1.000000000000001E-383
+
+decd077 apply 0.100000000000000E-383 -> #0000800000000000 Subnormal
+decd078 apply #0000800000000000 -> 1.00000000000000E-384 Subnormal
+decd079 apply 0.000000000000010E-383 -> #0000000000000010 Subnormal
+decd080 apply #0000000000000010 -> 1.0E-397 Subnormal
+decd081 apply 0.00000000000001E-383 -> #0004000000000001 Subnormal
+decd082 apply #0004000000000001 -> 1E-397 Subnormal
+decd083 apply 0.000000000000001E-383 -> #0000000000000001 Subnormal
+decd084 apply #0000000000000001 -> 1E-398 Subnormal
+-- next is smallest all-nines
+decd085 apply 9999999999999999E-398 -> #6400ff3fcff3fcff
+decd086 apply #6400ff3fcff3fcff -> 9.999999999999999E-383
+-- and a problematic divide result
+decd088 apply 1.111111111111111E-383 -> #0400912449124491
+decd089 apply #0400912449124491 -> 1.111111111111111E-383
+
+-- forties
+decd090 apply 40 -> #2238000000000040
+decd091 apply 39.99 -> #2230000000000cff
+
+-- underflows cannot be tested as all LHS exact
+
+-- Same again, negatives
+-- Nmax and similar
+decd122 apply -9.999999999999999E+384 -> #f7fcff3fcff3fcff
+decd123 apply #f7fcff3fcff3fcff -> -9.999999999999999E+384
+decd124 apply -1.234567890123456E+384 -> #c7fd34b9c1e28e56
+decd125 apply #c7fd34b9c1e28e56 -> -1.234567890123456E+384
+-- fold-downs (more below)
+decd130 apply -1.23E+384 -> #c7fd300000000000 Clamped
+decd131 apply #c7fd300000000000 -> -1.230000000000000E+384
+decd132 apply -1E+384 -> #c7fc000000000000 Clamped
+decd133 apply #c7fc000000000000 -> -1.000000000000000E+384
+
+-- overflows
+decd151 apply -12345 -> #a2380000000049c5
+decd152 apply #a2380000000049c5 -> -12345
+decd153 apply -1234 -> #a238000000000534
+decd154 apply #a238000000000534 -> -1234
+decd155 apply -123 -> #a2380000000000a3
+decd156 apply #a2380000000000a3 -> -123
+decd157 apply -12 -> #a238000000000012
+decd158 apply #a238000000000012 -> -12
+decd159 apply -1 -> #a238000000000001
+decd160 apply #a238000000000001 -> -1
+decd161 apply -1.23 -> #a2300000000000a3
+decd162 apply #a2300000000000a3 -> -1.23
+decd163 apply -123.45 -> #a2300000000049c5
+decd164 apply #a2300000000049c5 -> -123.45
+
+-- Nmin and below
+decd171 apply -1E-383 -> #803c000000000001
+decd172 apply #803c000000000001 -> -1E-383
+decd173 apply -1.000000000000000E-383 -> #8400000000000000
+decd174 apply #8400000000000000 -> -1.000000000000000E-383
+decd175 apply -1.000000000000001E-383 -> #8400000000000001
+decd176 apply #8400000000000001 -> -1.000000000000001E-383
+
+decd177 apply -0.100000000000000E-383 -> #8000800000000000 Subnormal
+decd178 apply #8000800000000000 -> -1.00000000000000E-384 Subnormal
+decd179 apply -0.000000000000010E-383 -> #8000000000000010 Subnormal
+decd180 apply #8000000000000010 -> -1.0E-397 Subnormal
+decd181 apply -0.00000000000001E-383 -> #8004000000000001 Subnormal
+decd182 apply #8004000000000001 -> -1E-397 Subnormal
+decd183 apply -0.000000000000001E-383 -> #8000000000000001 Subnormal
+decd184 apply #8000000000000001 -> -1E-398 Subnormal
+-- next is smallest all-nines
+decd185 apply -9999999999999999E-398 -> #e400ff3fcff3fcff
+decd186 apply #e400ff3fcff3fcff -> -9.999999999999999E-383
+-- and a tricky subnormal
+decd187 apply 1.11111111111524E-384 -> #00009124491246a4 Subnormal
+decd188 apply #00009124491246a4 -> 1.11111111111524E-384 Subnormal
+
+-- near-underflows
+decd189 apply -1e-398 -> #8000000000000001 Subnormal
+decd190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded
+
+-- zeros
+decd401 apply 0E-500 -> #0000000000000000 Clamped
+decd402 apply 0E-400 -> #0000000000000000 Clamped
+decd403 apply 0E-398 -> #0000000000000000
+decd404 apply #0000000000000000 -> 0E-398
+decd405 apply 0.000000000000000E-383 -> #0000000000000000
+decd406 apply #0000000000000000 -> 0E-398
+decd407 apply 0E-2 -> #2230000000000000
+decd408 apply #2230000000000000 -> 0.00
+decd409 apply 0 -> #2238000000000000
+decd410 apply #2238000000000000 -> 0
+decd411 apply 0E+3 -> #2244000000000000
+decd412 apply #2244000000000000 -> 0E+3
+decd413 apply 0E+369 -> #43fc000000000000
+decd414 apply #43fc000000000000 -> 0E+369
+-- clamped zeros...
+decd415 apply 0E+370 -> #43fc000000000000 Clamped
+decd416 apply #43fc000000000000 -> 0E+369
+decd417 apply 0E+384 -> #43fc000000000000 Clamped
+decd418 apply #43fc000000000000 -> 0E+369
+decd419 apply 0E+400 -> #43fc000000000000 Clamped
+decd420 apply #43fc000000000000 -> 0E+369
+decd421 apply 0E+500 -> #43fc000000000000 Clamped
+decd422 apply #43fc000000000000 -> 0E+369
+
+-- negative zeros
+decd431 apply -0E-400 -> #8000000000000000 Clamped
+decd432 apply -0E-400 -> #8000000000000000 Clamped
+decd433 apply -0E-398 -> #8000000000000000
+decd434 apply #8000000000000000 -> -0E-398
+decd435 apply -0.000000000000000E-383 -> #8000000000000000
+decd436 apply #8000000000000000 -> -0E-398
+decd437 apply -0E-2 -> #a230000000000000
+decd438 apply #a230000000000000 -> -0.00
+decd439 apply -0 -> #a238000000000000
+decd440 apply #a238000000000000 -> -0
+decd441 apply -0E+3 -> #a244000000000000
+decd442 apply #a244000000000000 -> -0E+3
+decd443 apply -0E+369 -> #c3fc000000000000
+decd444 apply #c3fc000000000000 -> -0E+369
+-- clamped zeros...
+decd445 apply -0E+370 -> #c3fc000000000000 Clamped
+decd446 apply #c3fc000000000000 -> -0E+369
+decd447 apply -0E+384 -> #c3fc000000000000 Clamped
+decd448 apply #c3fc000000000000 -> -0E+369
+decd449 apply -0E+400 -> #c3fc000000000000 Clamped
+decd450 apply #c3fc000000000000 -> -0E+369
+decd451 apply -0E+500 -> #c3fc000000000000 Clamped
+decd452 apply #c3fc000000000000 -> -0E+369
+
+-- exponents
+decd460 apply #225c000000000007 -> 7E+9
+decd461 apply 7E+9 -> #225c000000000007
+decd462 apply #23c4000000000007 -> 7E+99
+decd463 apply 7E+99 -> #23c4000000000007
+
+-- Specials
+decd500 apply Infinity -> #7800000000000000
+decd501 apply #7878787878787878 -> #7800000000000000
+decd502 apply #7800000000000000 -> Infinity
+decd503 apply #7979797979797979 -> #7800000000000000
+decd504 apply #7900000000000000 -> Infinity
+decd505 apply #7a7a7a7a7a7a7a7a -> #7800000000000000
+decd506 apply #7a00000000000000 -> Infinity
+decd507 apply #7b7b7b7b7b7b7b7b -> #7800000000000000
+decd508 apply #7b00000000000000 -> Infinity
+
+decd509 apply NaN -> #7c00000000000000
+decd510 apply #7c7c7c7c7c7c7c7c -> #7c007c7c7c7c7c7c
+decd511 apply #7c00000000000000 -> NaN
+decd512 apply #7d7d7d7d7d7d7d7d -> #7c017d7d7d7d7d7d
+decd513 apply #7d00000000000000 -> NaN
+decd514 apply #7e7e7e7e7e7e7e7e -> #7e007e7e7e7e7c7e
+decd515 apply #7e00000000000000 -> sNaN
+decd516 apply #7f7f7f7f7f7f7f7f -> #7e007f7f7f7f7c7f
+decd517 apply #7f00000000000000 -> sNaN
+decd518 apply #7fffffffffffffff -> sNaN999999999999999
+decd519 apply #7fffffffffffffff -> #7e00ff3fcff3fcff
+
+decd520 apply -Infinity -> #f800000000000000
+decd521 apply #f878787878787878 -> #f800000000000000
+decd522 apply #f800000000000000 -> -Infinity
+decd523 apply #f979797979797979 -> #f800000000000000
+decd524 apply #f900000000000000 -> -Infinity
+decd525 apply #fa7a7a7a7a7a7a7a -> #f800000000000000
+decd526 apply #fa00000000000000 -> -Infinity
+decd527 apply #fb7b7b7b7b7b7b7b -> #f800000000000000
+decd528 apply #fb00000000000000 -> -Infinity
+
+decd529 apply -NaN -> #fc00000000000000
+decd530 apply #fc7c7c7c7c7c7c7c -> #fc007c7c7c7c7c7c
+decd531 apply #fc00000000000000 -> -NaN
+decd532 apply #fd7d7d7d7d7d7d7d -> #fc017d7d7d7d7d7d
+decd533 apply #fd00000000000000 -> -NaN
+decd534 apply #fe7e7e7e7e7e7e7e -> #fe007e7e7e7e7c7e
+decd535 apply #fe00000000000000 -> -sNaN
+decd536 apply #ff7f7f7f7f7f7f7f -> #fe007f7f7f7f7c7f
+decd537 apply #ff00000000000000 -> -sNaN
+decd538 apply #ffffffffffffffff -> -sNaN999999999999999
+decd539 apply #ffffffffffffffff -> #fe00ff3fcff3fcff
+
+-- diagnostic NaNs
+decd540 apply NaN -> #7c00000000000000
+decd541 apply NaN0 -> #7c00000000000000
+decd542 apply NaN1 -> #7c00000000000001
+decd543 apply NaN12 -> #7c00000000000012
+decd544 apply NaN79 -> #7c00000000000079
+decd545 apply NaN12345 -> #7c000000000049c5
+decd546 apply NaN123456 -> #7c00000000028e56
+decd547 apply NaN799799 -> #7c000000000f7fdf
+decd548 apply NaN799799799799799 -> #7c03dff7fdff7fdf
+decd549 apply NaN999999999999999 -> #7c00ff3fcff3fcff
+-- too many digits
+
+-- fold-down full sequence
+decd601 apply 1E+384 -> #47fc000000000000 Clamped
+decd602 apply #47fc000000000000 -> 1.000000000000000E+384
+decd603 apply 1E+383 -> #43fc800000000000 Clamped
+decd604 apply #43fc800000000000 -> 1.00000000000000E+383
+decd605 apply 1E+382 -> #43fc100000000000 Clamped
+decd606 apply #43fc100000000000 -> 1.0000000000000E+382
+decd607 apply 1E+381 -> #43fc010000000000 Clamped
+decd608 apply #43fc010000000000 -> 1.000000000000E+381
+decd609 apply 1E+380 -> #43fc002000000000 Clamped
+decd610 apply #43fc002000000000 -> 1.00000000000E+380
+decd611 apply 1E+379 -> #43fc000400000000 Clamped
+decd612 apply #43fc000400000000 -> 1.0000000000E+379
+decd613 apply 1E+378 -> #43fc000040000000 Clamped
+decd614 apply #43fc000040000000 -> 1.000000000E+378
+decd615 apply 1E+377 -> #43fc000008000000 Clamped
+decd616 apply #43fc000008000000 -> 1.00000000E+377
+decd617 apply 1E+376 -> #43fc000001000000 Clamped
+decd618 apply #43fc000001000000 -> 1.0000000E+376
+decd619 apply 1E+375 -> #43fc000000100000 Clamped
+decd620 apply #43fc000000100000 -> 1.000000E+375
+decd621 apply 1E+374 -> #43fc000000020000 Clamped
+decd622 apply #43fc000000020000 -> 1.00000E+374
+decd623 apply 1E+373 -> #43fc000000004000 Clamped
+decd624 apply #43fc000000004000 -> 1.0000E+373
+decd625 apply 1E+372 -> #43fc000000000400 Clamped
+decd626 apply #43fc000000000400 -> 1.000E+372
+decd627 apply 1E+371 -> #43fc000000000080 Clamped
+decd628 apply #43fc000000000080 -> 1.00E+371
+decd629 apply 1E+370 -> #43fc000000000010 Clamped
+decd630 apply #43fc000000000010 -> 1.0E+370
+decd631 apply 1E+369 -> #43fc000000000001
+decd632 apply #43fc000000000001 -> 1E+369
+decd633 apply 1E+368 -> #43f8000000000001
+decd634 apply #43f8000000000001 -> 1E+368
+-- same with 9s
+decd641 apply 9E+384 -> #77fc000000000000 Clamped
+decd642 apply #77fc000000000000 -> 9.000000000000000E+384
+decd643 apply 9E+383 -> #43fc8c0000000000 Clamped
+decd644 apply #43fc8c0000000000 -> 9.00000000000000E+383
+decd645 apply 9E+382 -> #43fc1a0000000000 Clamped
+decd646 apply #43fc1a0000000000 -> 9.0000000000000E+382
+decd647 apply 9E+381 -> #43fc090000000000 Clamped
+decd648 apply #43fc090000000000 -> 9.000000000000E+381
+decd649 apply 9E+380 -> #43fc002300000000 Clamped
+decd650 apply #43fc002300000000 -> 9.00000000000E+380
+decd651 apply 9E+379 -> #43fc000680000000 Clamped
+decd652 apply #43fc000680000000 -> 9.0000000000E+379
+decd653 apply 9E+378 -> #43fc000240000000 Clamped
+decd654 apply #43fc000240000000 -> 9.000000000E+378
+decd655 apply 9E+377 -> #43fc000008c00000 Clamped
+decd656 apply #43fc000008c00000 -> 9.00000000E+377
+decd657 apply 9E+376 -> #43fc000001a00000 Clamped
+decd658 apply #43fc000001a00000 -> 9.0000000E+376
+decd659 apply 9E+375 -> #43fc000000900000 Clamped
+decd660 apply #43fc000000900000 -> 9.000000E+375
+decd661 apply 9E+374 -> #43fc000000023000 Clamped
+decd662 apply #43fc000000023000 -> 9.00000E+374
+decd663 apply 9E+373 -> #43fc000000006800 Clamped
+decd664 apply #43fc000000006800 -> 9.0000E+373
+decd665 apply 9E+372 -> #43fc000000002400 Clamped
+decd666 apply #43fc000000002400 -> 9.000E+372
+decd667 apply 9E+371 -> #43fc00000000008c Clamped
+decd668 apply #43fc00000000008c -> 9.00E+371
+decd669 apply 9E+370 -> #43fc00000000001a Clamped
+decd670 apply #43fc00000000001a -> 9.0E+370
+decd671 apply 9E+369 -> #43fc000000000009
+decd672 apply #43fc000000000009 -> 9E+369
+decd673 apply 9E+368 -> #43f8000000000009
+decd674 apply #43f8000000000009 -> 9E+368
+
+
+-- Selected DPD codes
+decd700 apply #2238000000000000 -> 0
+decd701 apply #2238000000000009 -> 9
+decd702 apply #2238000000000010 -> 10
+decd703 apply #2238000000000019 -> 19
+decd704 apply #2238000000000020 -> 20
+decd705 apply #2238000000000029 -> 29
+decd706 apply #2238000000000030 -> 30
+decd707 apply #2238000000000039 -> 39
+decd708 apply #2238000000000040 -> 40
+decd709 apply #2238000000000049 -> 49
+decd710 apply #2238000000000050 -> 50
+decd711 apply #2238000000000059 -> 59
+decd712 apply #2238000000000060 -> 60
+decd713 apply #2238000000000069 -> 69
+decd714 apply #2238000000000070 -> 70
+decd715 apply #2238000000000071 -> 71
+decd716 apply #2238000000000072 -> 72
+decd717 apply #2238000000000073 -> 73
+decd718 apply #2238000000000074 -> 74
+decd719 apply #2238000000000075 -> 75
+decd720 apply #2238000000000076 -> 76
+decd721 apply #2238000000000077 -> 77
+decd722 apply #2238000000000078 -> 78
+decd723 apply #2238000000000079 -> 79
+
+decd725 apply #223800000000029e -> 994
+decd726 apply #223800000000029f -> 995
+decd727 apply #22380000000002a0 -> 520
+decd728 apply #22380000000002a1 -> 521
+-- from telco test data
+decd730 apply #2238000000000188 -> 308
+decd731 apply #22380000000001a3 -> 323
+decd732 apply #223800000000002a -> 82
+decd733 apply #22380000000001a9 -> 329
+decd734 apply #2238000000000081 -> 101
+decd735 apply #22380000000002a2 -> 522
+
+-- DPD: one of each of the huffman groups
+decd740 apply #22380000000003f7 -> 777
+decd741 apply #22380000000003f8 -> 778
+decd742 apply #22380000000003eb -> 787
+decd743 apply #223800000000037d -> 877
+decd744 apply #223800000000039f -> 997
+decd745 apply #22380000000003bf -> 979
+decd746 apply #22380000000003df -> 799
+decd747 apply #223800000000006e -> 888
+
+-- DPD all-highs cases (includes the 24 redundant codes)
+decd750 apply #223800000000006e -> 888
+decd751 apply #223800000000016e -> 888
+decd752 apply #223800000000026e -> 888
+decd753 apply #223800000000036e -> 888
+decd754 apply #223800000000006f -> 889
+decd755 apply #223800000000016f -> 889
+decd756 apply #223800000000026f -> 889
+decd757 apply #223800000000036f -> 889
+
+decd760 apply #223800000000007e -> 898
+decd761 apply #223800000000017e -> 898
+decd762 apply #223800000000027e -> 898
+decd763 apply #223800000000037e -> 898
+decd764 apply #223800000000007f -> 899
+decd765 apply #223800000000017f -> 899
+decd766 apply #223800000000027f -> 899
+decd767 apply #223800000000037f -> 899
+
+decd770 apply #22380000000000ee -> 988
+decd771 apply #22380000000001ee -> 988
+decd772 apply #22380000000002ee -> 988
+decd773 apply #22380000000003ee -> 988
+decd774 apply #22380000000000ef -> 989
+decd775 apply #22380000000001ef -> 989
+decd776 apply #22380000000002ef -> 989
+decd777 apply #22380000000003ef -> 989
+
+decd780 apply #22380000000000fe -> 998
+decd781 apply #22380000000001fe -> 998
+decd782 apply #22380000000002fe -> 998
+decd783 apply #22380000000003fe -> 998
+decd784 apply #22380000000000ff -> 999
+decd785 apply #22380000000001ff -> 999
+decd786 apply #22380000000002ff -> 999
+decd787 apply #22380000000003ff -> 999
+
+-- values around [u]int32 edges (zeros done earlier)
+decd800 apply -2147483646 -> #a23800008c78af46
+decd801 apply -2147483647 -> #a23800008c78af47
+decd802 apply -2147483648 -> #a23800008c78af48
+decd803 apply -2147483649 -> #a23800008c78af49
+decd804 apply 2147483646 -> #223800008c78af46
+decd805 apply 2147483647 -> #223800008c78af47
+decd806 apply 2147483648 -> #223800008c78af48
+decd807 apply 2147483649 -> #223800008c78af49
+decd808 apply 4294967294 -> #2238000115afb55a
+decd809 apply 4294967295 -> #2238000115afb55b
+decd810 apply 4294967296 -> #2238000115afb57a
+decd811 apply 4294967297 -> #2238000115afb57b
+
+decd820 apply #a23800008c78af46 -> -2147483646
+decd821 apply #a23800008c78af47 -> -2147483647
+decd822 apply #a23800008c78af48 -> -2147483648
+decd823 apply #a23800008c78af49 -> -2147483649
+decd824 apply #223800008c78af46 -> 2147483646
+decd825 apply #223800008c78af47 -> 2147483647
+decd826 apply #223800008c78af48 -> 2147483648
+decd827 apply #223800008c78af49 -> 2147483649
+decd828 apply #2238000115afb55a -> 4294967294
+decd829 apply #2238000115afb55b -> 4294967295
+decd830 apply #2238000115afb57a -> 4294967296
+decd831 apply #2238000115afb57b -> 4294967297
+
+-- for narrowing
+decd840 apply #2870000000000000 -> 2.000000000000000E-99
+
+-- some miscellaneous
+decd850 apply #0004070000000000 -> 7.000000000000E-385 Subnormal
+decd851 apply #0008000000020000 -> 1.00000E-391 Subnormal
+
diff --git a/Lib/test/decimaltestdata/ddFMA.decTest b/Lib/test/decimaltestdata/ddFMA.decTest
index 8ae92a7f9a..f0acfc74d5 100644
--- a/Lib/test/decimaltestdata/ddFMA.decTest
+++ b/Lib/test/decimaltestdata/ddFMA.decTest
@@ -1,1698 +1,1698 @@
-------------------------------------------------------------------------
--- ddFMA.decTest -- decDouble Fused Multiply Add --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- These tests comprese three parts:
--- 1. Sanity checks and other three-operand tests (especially those
--- where the fused operation makes a difference)
--- 2. Multiply tests (third operand is neutral zero [0E+emax])
--- 3. Addition tests (first operand is 1)
--- The multiply and addition tests are extensive because FMA may have
--- its own dedicated multiplication or addition routine(s), and they
--- also inherently check the left-to-right properties.
-
--- Sanity checks
-ddfma0001 fma 1 1 1 -> 2
-ddfma0002 fma 1 1 2 -> 3
-ddfma0003 fma 2 2 3 -> 7
-ddfma0004 fma 9 9 9 -> 90
-ddfma0005 fma -1 1 1 -> 0
-ddfma0006 fma -1 1 2 -> 1
-ddfma0007 fma -2 2 3 -> -1
-ddfma0008 fma -9 9 9 -> -72
-ddfma0011 fma 1 -1 1 -> 0
-ddfma0012 fma 1 -1 2 -> 1
-ddfma0013 fma 2 -2 3 -> -1
-ddfma0014 fma 9 -9 9 -> -72
-ddfma0015 fma 1 1 -1 -> 0
-ddfma0016 fma 1 1 -2 -> -1
-ddfma0017 fma 2 2 -3 -> 1
-ddfma0018 fma 9 9 -9 -> 72
-
--- non-integer exacts
-ddfma0100 fma 25.2 63.6 -438 -> 1164.72
-ddfma0101 fma 0.301 0.380 334 -> 334.114380
-ddfma0102 fma 49.2 -4.8 23.3 -> -212.86
-ddfma0103 fma 4.22 0.079 -94.6 -> -94.26662
-ddfma0104 fma 903 0.797 0.887 -> 720.578
-ddfma0105 fma 6.13 -161 65.9 -> -921.03
-ddfma0106 fma 28.2 727 5.45 -> 20506.85
-ddfma0107 fma 4 605 688 -> 3108
-ddfma0108 fma 93.3 0.19 0.226 -> 17.953
-ddfma0109 fma 0.169 -341 5.61 -> -52.019
-ddfma0110 fma -72.2 30 -51.2 -> -2217.2
-ddfma0111 fma -0.409 13 20.4 -> 15.083
-ddfma0112 fma 317 77.0 19.0 -> 24428.0
-ddfma0113 fma 47 6.58 1.62 -> 310.88
-ddfma0114 fma 1.36 0.984 0.493 -> 1.83124
-ddfma0115 fma 72.7 274 1.56 -> 19921.36
-ddfma0116 fma 335 847 83 -> 283828
-ddfma0117 fma 666 0.247 25.4 -> 189.902
-ddfma0118 fma -3.87 3.06 78.0 -> 66.1578
-ddfma0119 fma 0.742 192 35.6 -> 178.064
-ddfma0120 fma -91.6 5.29 0.153 -> -484.411
-
--- cases where result is different from separate multiply + add; each
--- is preceded by the result of unfused multiply and add
--- [this is about 20% of all similar cases in general]
--- -> 7.123356429257969E+16
-ddfma0201 fma 27583489.6645 2582471078.04 2593183.42371 -> 7.123356429257970E+16 Inexact Rounded
--- -> 22813275328.80506
-ddfma0208 fma 24280.355566 939577.397653 2032.013252 -> 22813275328.80507 Inexact Rounded
--- -> -2.030397734278062E+16
-ddfma0209 fma 7848976432 -2586831.2281 137903.517909 -> -2.030397734278061E+16 Inexact Rounded
--- -> 2040774094814.077
-ddfma0217 fma 56890.388731 35872030.4255 339337.123410 -> 2040774094814.078 Inexact Rounded
--- -> 2.714469575205049E+18
-ddfma0220 fma 7533543.57445 360317763928 5073392.31638 -> 2.714469575205050E+18 Inexact Rounded
--- -> 1.011676297716716E+19
-ddfma0223 fma 739945255.563 13672312784.1 -994381.53572 -> 1.011676297716715E+19 Inexact Rounded
--- -> -2.914135721455315E+23
-ddfma0224 fma -413510957218 704729988550 9234162614.0 -> -2.914135721455314E+23 Inexact Rounded
--- -> 2.620119863365786E+17
-ddfma0226 fma 437484.00601 598906432790 894450638.442 -> 2.620119863365787E+17 Inexact Rounded
--- -> 1.272647995808178E+19
-ddfma0253 fma 73287556929 173651305.784 -358312568.389 -> 1.272647995808177E+19 Inexact Rounded
--- -> -1.753769320861851E+18
-ddfma0257 fma 203258304486 -8628278.8066 153127.446727 -> -1.753769320861850E+18 Inexact Rounded
--- -> -1.550737835263346E+17
-ddfma0260 fma 42560533.1774 -3643605282.86 178277.96377 -> -1.550737835263347E+17 Inexact Rounded
--- -> 2.897624620576005E+22
-ddfma0269 fma 142656587375 203118879670 604576103991 -> 2.897624620576004E+22 Inexact Rounded
-
--- Cases where multiply would overflow or underflow if separate
-fma0300 fma 9e+384 10 0 -> Infinity Overflow Inexact Rounded
-fma0301 fma 1e+384 10 0 -> Infinity Overflow Inexact Rounded
-fma0302 fma 1e+384 10 -1e+384 -> 9.000000000000000E+384 Clamped
-fma0303 fma 1e+384 10 -9e+384 -> 1.000000000000000E+384 Clamped
--- subnormal etc.
-fma0305 fma 1e-398 0.1 0 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-fma0306 fma 1e-398 0.1 1 -> 1.000000000000000 Inexact Rounded
-fma0307 fma 1e-398 0.1 1e-398 -> 1E-398 Underflow Subnormal Inexact Rounded
-
--- Infinite combinations
-ddfma0800 fma Inf Inf Inf -> Infinity
-ddfma0801 fma Inf Inf -Inf -> NaN Invalid_operation
-ddfma0802 fma Inf -Inf Inf -> NaN Invalid_operation
-ddfma0803 fma Inf -Inf -Inf -> -Infinity
-ddfma0804 fma -Inf Inf Inf -> NaN Invalid_operation
-ddfma0805 fma -Inf Inf -Inf -> -Infinity
-ddfma0806 fma -Inf -Inf Inf -> Infinity
-ddfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
-
--- Triple NaN propagation
-ddfma0900 fma NaN2 NaN3 NaN5 -> NaN2
-ddfma0901 fma 0 NaN3 NaN5 -> NaN3
-ddfma0902 fma 0 0 NaN5 -> NaN5
--- first sNaN wins (consider qNaN from earlier sNaN being
--- overridden by an sNaN in third operand)
-ddfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-ddfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
-ddfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
-ddfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-ddfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
-ddfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
-
--- MULTIPLICATION TESTS ------------------------------------------------
-
--- sanity checks
-ddfma2000 fma 2 2 0e+384 -> 4
-ddfma2001 fma 2 3 0e+384 -> 6
-ddfma2002 fma 5 1 0e+384 -> 5
-ddfma2003 fma 5 2 0e+384 -> 10
-ddfma2004 fma 1.20 2 0e+384 -> 2.40
-ddfma2005 fma 1.20 0 0e+384 -> 0.00
-ddfma2006 fma 1.20 -2 0e+384 -> -2.40
-ddfma2007 fma -1.20 2 0e+384 -> -2.40
-ddfma2008 fma -1.20 0 0e+384 -> 0.00
-ddfma2009 fma -1.20 -2 0e+384 -> 2.40
-ddfma2010 fma 5.09 7.1 0e+384 -> 36.139
-ddfma2011 fma 2.5 4 0e+384 -> 10.0
-ddfma2012 fma 2.50 4 0e+384 -> 10.00
-ddfma2013 fma 1.23456789 1.00000000 0e+384 -> 1.234567890000000 Rounded
-ddfma2015 fma 2.50 4 0e+384 -> 10.00
-ddfma2016 fma 9.999999999 9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded
-ddfma2017 fma 9.999999999 -9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded
-ddfma2018 fma -9.999999999 9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded
-ddfma2019 fma -9.999999999 -9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded
-
--- zeros, etc.
-ddfma2021 fma 0 0 0e+384 -> 0
-ddfma2022 fma 0 -0 0e+384 -> 0
-ddfma2023 fma -0 0 0e+384 -> 0
-ddfma2024 fma -0 -0 0e+384 -> 0
-ddfma2025 fma -0.0 -0.0 0e+384 -> 0.00
-ddfma2026 fma -0.0 -0.0 0e+384 -> 0.00
-ddfma2027 fma -0.0 -0.0 0e+384 -> 0.00
-ddfma2028 fma -0.0 -0.0 0e+384 -> 0.00
-ddfma2030 fma 5.00 1E-3 0e+384 -> 0.00500
-ddfma2031 fma 00.00 0.000 0e+384 -> 0.00000
-ddfma2032 fma 00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0
-ddfma2033 fma 0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0
-ddfma2034 fma -5.00 1E-3 0e+384 -> -0.00500
-ddfma2035 fma -00.00 0.000 0e+384 -> 0.00000
-ddfma2036 fma -00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0
-ddfma2037 fma -0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0
-ddfma2038 fma 5.00 -1E-3 0e+384 -> -0.00500
-ddfma2039 fma 00.00 -0.000 0e+384 -> 0.00000
-ddfma2040 fma 00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0
-ddfma2041 fma 0E-3 -00.00 0e+384 -> 0.00000 -- lhs is 0
-ddfma2042 fma -5.00 -1E-3 0e+384 -> 0.00500
-ddfma2043 fma -00.00 -0.000 0e+384 -> 0.00000
-ddfma2044 fma -00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0
-ddfma2045 fma -0E-3 -00.00 -0e+384 -> 0.00000 -- lhs is 0
-ddfma2046 fma -0E-3 00.00 -0e+384 -> -0.00000
-ddfma2047 fma 0E-3 -00.00 -0e+384 -> -0.00000
-ddfma2048 fma 0E-3 00.00 -0e+384 -> 0.00000
-
--- examples from decarith
-ddfma2050 fma 1.20 3 0e+384 -> 3.60
-ddfma2051 fma 7 3 0e+384 -> 21
-ddfma2052 fma 0.9 0.8 0e+384 -> 0.72
-ddfma2053 fma 0.9 -0 0e+384 -> 0.0
-ddfma2054 fma 654321 654321 0e+384 -> 428135971041
-
-ddfma2060 fma 123.45 1e7 0e+384 -> 1.2345E+9
-ddfma2061 fma 123.45 1e8 0e+384 -> 1.2345E+10
-ddfma2062 fma 123.45 1e+9 0e+384 -> 1.2345E+11
-ddfma2063 fma 123.45 1e10 0e+384 -> 1.2345E+12
-ddfma2064 fma 123.45 1e11 0e+384 -> 1.2345E+13
-ddfma2065 fma 123.45 1e12 0e+384 -> 1.2345E+14
-ddfma2066 fma 123.45 1e13 0e+384 -> 1.2345E+15
-
-
--- test some intermediate lengths
--- 1234567890123456
-ddfma2080 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9
-ddfma2084 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9
-ddfma2090 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9
-ddfma2094 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9
-
--- test some more edge cases and carries
-ddfma2101 fma 9 9 0e+384 -> 81
-ddfma2102 fma 9 90 0e+384 -> 810
-ddfma2103 fma 9 900 0e+384 -> 8100
-ddfma2104 fma 9 9000 0e+384 -> 81000
-ddfma2105 fma 9 90000 0e+384 -> 810000
-ddfma2106 fma 9 900000 0e+384 -> 8100000
-ddfma2107 fma 9 9000000 0e+384 -> 81000000
-ddfma2108 fma 9 90000000 0e+384 -> 810000000
-ddfma2109 fma 9 900000000 0e+384 -> 8100000000
-ddfma2110 fma 9 9000000000 0e+384 -> 81000000000
-ddfma2111 fma 9 90000000000 0e+384 -> 810000000000
-ddfma2112 fma 9 900000000000 0e+384 -> 8100000000000
-ddfma2113 fma 9 9000000000000 0e+384 -> 81000000000000
-ddfma2114 fma 9 90000000000000 0e+384 -> 810000000000000
-ddfma2115 fma 9 900000000000000 0e+384 -> 8100000000000000
---ddfma2116 fma 9 9000000000000000 0e+384 -> 81000000000000000
---ddfma2117 fma 9 90000000000000000 0e+384 -> 810000000000000000
---ddfma2118 fma 9 900000000000000000 0e+384 -> 8100000000000000000
---ddfma2119 fma 9 9000000000000000000 0e+384 -> 81000000000000000000
---ddfma2120 fma 9 90000000000000000000 0e+384 -> 810000000000000000000
---ddfma2121 fma 9 900000000000000000000 0e+384 -> 8100000000000000000000
---ddfma2122 fma 9 9000000000000000000000 0e+384 -> 81000000000000000000000
---ddfma2123 fma 9 90000000000000000000000 0e+384 -> 810000000000000000000000
--- test some more edge cases without carries
-ddfma2131 fma 3 3 0e+384 -> 9
-ddfma2132 fma 3 30 0e+384 -> 90
-ddfma2133 fma 3 300 0e+384 -> 900
-ddfma2134 fma 3 3000 0e+384 -> 9000
-ddfma2135 fma 3 30000 0e+384 -> 90000
-ddfma2136 fma 3 300000 0e+384 -> 900000
-ddfma2137 fma 3 3000000 0e+384 -> 9000000
-ddfma2138 fma 3 30000000 0e+384 -> 90000000
-ddfma2139 fma 3 300000000 0e+384 -> 900000000
-ddfma2140 fma 3 3000000000 0e+384 -> 9000000000
-ddfma2141 fma 3 30000000000 0e+384 -> 90000000000
-ddfma2142 fma 3 300000000000 0e+384 -> 900000000000
-ddfma2143 fma 3 3000000000000 0e+384 -> 9000000000000
-ddfma2144 fma 3 30000000000000 0e+384 -> 90000000000000
-ddfma2145 fma 3 300000000000000 0e+384 -> 900000000000000
-
--- test some edge cases with exact rounding
-ddfma2301 fma 9 9 0e+384 -> 81
-ddfma2302 fma 9 90 0e+384 -> 810
-ddfma2303 fma 9 900 0e+384 -> 8100
-ddfma2304 fma 9 9000 0e+384 -> 81000
-ddfma2305 fma 9 90000 0e+384 -> 810000
-ddfma2306 fma 9 900000 0e+384 -> 8100000
-ddfma2307 fma 9 9000000 0e+384 -> 81000000
-ddfma2308 fma 9 90000000 0e+384 -> 810000000
-ddfma2309 fma 9 900000000 0e+384 -> 8100000000
-ddfma2310 fma 9 9000000000 0e+384 -> 81000000000
-ddfma2311 fma 9 90000000000 0e+384 -> 810000000000
-ddfma2312 fma 9 900000000000 0e+384 -> 8100000000000
-ddfma2313 fma 9 9000000000000 0e+384 -> 81000000000000
-ddfma2314 fma 9 90000000000000 0e+384 -> 810000000000000
-ddfma2315 fma 9 900000000000000 0e+384 -> 8100000000000000
-ddfma2316 fma 9 9000000000000000 0e+384 -> 8.100000000000000E+16 Rounded
-ddfma2317 fma 90 9000000000000000 0e+384 -> 8.100000000000000E+17 Rounded
-ddfma2318 fma 900 9000000000000000 0e+384 -> 8.100000000000000E+18 Rounded
-ddfma2319 fma 9000 9000000000000000 0e+384 -> 8.100000000000000E+19 Rounded
-ddfma2320 fma 90000 9000000000000000 0e+384 -> 8.100000000000000E+20 Rounded
-ddfma2321 fma 900000 9000000000000000 0e+384 -> 8.100000000000000E+21 Rounded
-ddfma2322 fma 9000000 9000000000000000 0e+384 -> 8.100000000000000E+22 Rounded
-ddfma2323 fma 90000000 9000000000000000 0e+384 -> 8.100000000000000E+23 Rounded
-
--- tryzeros cases
-ddfma2504 fma 0E-260 1000E-260 0e+384 -> 0E-398 Clamped
-ddfma2505 fma 100E+260 0E+260 0e+384 -> 0E+369 Clamped
-
--- mixed with zeros
-ddfma2541 fma 0 -1 0e+384 -> 0
-ddfma2542 fma -0 -1 0e+384 -> 0
-ddfma2543 fma 0 1 0e+384 -> 0
-ddfma2544 fma -0 1 0e+384 -> 0
-ddfma2545 fma -1 0 0e+384 -> 0
-ddfma2546 fma -1 -0 0e+384 -> 0
-ddfma2547 fma 1 0 0e+384 -> 0
-ddfma2548 fma 1 -0 0e+384 -> 0
-
-ddfma2551 fma 0.0 -1 0e+384 -> 0.0
-ddfma2552 fma -0.0 -1 0e+384 -> 0.0
-ddfma2553 fma 0.0 1 0e+384 -> 0.0
-ddfma2554 fma -0.0 1 0e+384 -> 0.0
-ddfma2555 fma -1.0 0 0e+384 -> 0.0
-ddfma2556 fma -1.0 -0 0e+384 -> 0.0
-ddfma2557 fma 1.0 0 0e+384 -> 0.0
-ddfma2558 fma 1.0 -0 0e+384 -> 0.0
-
-ddfma2561 fma 0 -1.0 0e+384 -> 0.0
-ddfma2562 fma -0 -1.0 0e+384 -> 0.0
-ddfma2563 fma 0 1.0 0e+384 -> 0.0
-ddfma2564 fma -0 1.0 0e+384 -> 0.0
-ddfma2565 fma -1 0.0 0e+384 -> 0.0
-ddfma2566 fma -1 -0.0 0e+384 -> 0.0
-ddfma2567 fma 1 0.0 0e+384 -> 0.0
-ddfma2568 fma 1 -0.0 0e+384 -> 0.0
-
-ddfma2571 fma 0.0 -1.0 0e+384 -> 0.00
-ddfma2572 fma -0.0 -1.0 0e+384 -> 0.00
-ddfma2573 fma 0.0 1.0 0e+384 -> 0.00
-ddfma2574 fma -0.0 1.0 0e+384 -> 0.00
-ddfma2575 fma -1.0 0.0 0e+384 -> 0.00
-ddfma2576 fma -1.0 -0.0 0e+384 -> 0.00
-ddfma2577 fma 1.0 0.0 0e+384 -> 0.00
-ddfma2578 fma 1.0 -0.0 0e+384 -> 0.00
-
--- Specials
-ddfma2580 fma Inf -Inf 0e+384 -> -Infinity
-ddfma2581 fma Inf -1000 0e+384 -> -Infinity
-ddfma2582 fma Inf -1 0e+384 -> -Infinity
-ddfma2583 fma Inf -0 0e+384 -> NaN Invalid_operation
-ddfma2584 fma Inf 0 0e+384 -> NaN Invalid_operation
-ddfma2585 fma Inf 1 0e+384 -> Infinity
-ddfma2586 fma Inf 1000 0e+384 -> Infinity
-ddfma2587 fma Inf Inf 0e+384 -> Infinity
-ddfma2588 fma -1000 Inf 0e+384 -> -Infinity
-ddfma2589 fma -Inf Inf 0e+384 -> -Infinity
-ddfma2590 fma -1 Inf 0e+384 -> -Infinity
-ddfma2591 fma -0 Inf 0e+384 -> NaN Invalid_operation
-ddfma2592 fma 0 Inf 0e+384 -> NaN Invalid_operation
-ddfma2593 fma 1 Inf 0e+384 -> Infinity
-ddfma2594 fma 1000 Inf 0e+384 -> Infinity
-ddfma2595 fma Inf Inf 0e+384 -> Infinity
-
-ddfma2600 fma -Inf -Inf 0e+384 -> Infinity
-ddfma2601 fma -Inf -1000 0e+384 -> Infinity
-ddfma2602 fma -Inf -1 0e+384 -> Infinity
-ddfma2603 fma -Inf -0 0e+384 -> NaN Invalid_operation
-ddfma2604 fma -Inf 0 0e+384 -> NaN Invalid_operation
-ddfma2605 fma -Inf 1 0e+384 -> -Infinity
-ddfma2606 fma -Inf 1000 0e+384 -> -Infinity
-ddfma2607 fma -Inf Inf 0e+384 -> -Infinity
-ddfma2608 fma -1000 Inf 0e+384 -> -Infinity
-ddfma2609 fma -Inf -Inf 0e+384 -> Infinity
-ddfma2610 fma -1 -Inf 0e+384 -> Infinity
-ddfma2611 fma -0 -Inf 0e+384 -> NaN Invalid_operation
-ddfma2612 fma 0 -Inf 0e+384 -> NaN Invalid_operation
-ddfma2613 fma 1 -Inf 0e+384 -> -Infinity
-ddfma2614 fma 1000 -Inf 0e+384 -> -Infinity
-ddfma2615 fma Inf -Inf 0e+384 -> -Infinity
-
-ddfma2621 fma NaN -Inf 0e+384 -> NaN
-ddfma2622 fma NaN -1000 0e+384 -> NaN
-ddfma2623 fma NaN -1 0e+384 -> NaN
-ddfma2624 fma NaN -0 0e+384 -> NaN
-ddfma2625 fma NaN 0 0e+384 -> NaN
-ddfma2626 fma NaN 1 0e+384 -> NaN
-ddfma2627 fma NaN 1000 0e+384 -> NaN
-ddfma2628 fma NaN Inf 0e+384 -> NaN
-ddfma2629 fma NaN NaN 0e+384 -> NaN
-ddfma2630 fma -Inf NaN 0e+384 -> NaN
-ddfma2631 fma -1000 NaN 0e+384 -> NaN
-ddfma2632 fma -1 NaN 0e+384 -> NaN
-ddfma2633 fma -0 NaN 0e+384 -> NaN
-ddfma2634 fma 0 NaN 0e+384 -> NaN
-ddfma2635 fma 1 NaN 0e+384 -> NaN
-ddfma2636 fma 1000 NaN 0e+384 -> NaN
-ddfma2637 fma Inf NaN 0e+384 -> NaN
-
-ddfma2641 fma sNaN -Inf 0e+384 -> NaN Invalid_operation
-ddfma2642 fma sNaN -1000 0e+384 -> NaN Invalid_operation
-ddfma2643 fma sNaN -1 0e+384 -> NaN Invalid_operation
-ddfma2644 fma sNaN -0 0e+384 -> NaN Invalid_operation
-ddfma2645 fma sNaN 0 0e+384 -> NaN Invalid_operation
-ddfma2646 fma sNaN 1 0e+384 -> NaN Invalid_operation
-ddfma2647 fma sNaN 1000 0e+384 -> NaN Invalid_operation
-ddfma2648 fma sNaN NaN 0e+384 -> NaN Invalid_operation
-ddfma2649 fma sNaN sNaN 0e+384 -> NaN Invalid_operation
-ddfma2650 fma NaN sNaN 0e+384 -> NaN Invalid_operation
-ddfma2651 fma -Inf sNaN 0e+384 -> NaN Invalid_operation
-ddfma2652 fma -1000 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2653 fma -1 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2654 fma -0 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2655 fma 0 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2656 fma 1 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2657 fma 1000 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2658 fma Inf sNaN 0e+384 -> NaN Invalid_operation
-ddfma2659 fma NaN sNaN 0e+384 -> NaN Invalid_operation
-
--- propagating NaNs
-ddfma2661 fma NaN9 -Inf 0e+384 -> NaN9
-ddfma2662 fma NaN8 999 0e+384 -> NaN8
-ddfma2663 fma NaN71 Inf 0e+384 -> NaN71
-ddfma2664 fma NaN6 NaN5 0e+384 -> NaN6
-ddfma2665 fma -Inf NaN4 0e+384 -> NaN4
-ddfma2666 fma -999 NaN33 0e+384 -> NaN33
-ddfma2667 fma Inf NaN2 0e+384 -> NaN2
-
-ddfma2671 fma sNaN99 -Inf 0e+384 -> NaN99 Invalid_operation
-ddfma2672 fma sNaN98 -11 0e+384 -> NaN98 Invalid_operation
-ddfma2673 fma sNaN97 NaN 0e+384 -> NaN97 Invalid_operation
-ddfma2674 fma sNaN16 sNaN94 0e+384 -> NaN16 Invalid_operation
-ddfma2675 fma NaN95 sNaN93 0e+384 -> NaN93 Invalid_operation
-ddfma2676 fma -Inf sNaN92 0e+384 -> NaN92 Invalid_operation
-ddfma2677 fma 088 sNaN91 0e+384 -> NaN91 Invalid_operation
-ddfma2678 fma Inf sNaN90 0e+384 -> NaN90 Invalid_operation
-ddfma2679 fma NaN sNaN89 0e+384 -> NaN89 Invalid_operation
-
-ddfma2681 fma -NaN9 -Inf 0e+384 -> -NaN9
-ddfma2682 fma -NaN8 999 0e+384 -> -NaN8
-ddfma2683 fma -NaN71 Inf 0e+384 -> -NaN71
-ddfma2684 fma -NaN6 -NaN5 0e+384 -> -NaN6
-ddfma2685 fma -Inf -NaN4 0e+384 -> -NaN4
-ddfma2686 fma -999 -NaN33 0e+384 -> -NaN33
-ddfma2687 fma Inf -NaN2 0e+384 -> -NaN2
-
-ddfma2691 fma -sNaN99 -Inf 0e+384 -> -NaN99 Invalid_operation
-ddfma2692 fma -sNaN98 -11 0e+384 -> -NaN98 Invalid_operation
-ddfma2693 fma -sNaN97 NaN 0e+384 -> -NaN97 Invalid_operation
-ddfma2694 fma -sNaN16 -sNaN94 0e+384 -> -NaN16 Invalid_operation
-ddfma2695 fma -NaN95 -sNaN93 0e+384 -> -NaN93 Invalid_operation
-ddfma2696 fma -Inf -sNaN92 0e+384 -> -NaN92 Invalid_operation
-ddfma2697 fma 088 -sNaN91 0e+384 -> -NaN91 Invalid_operation
-ddfma2698 fma Inf -sNaN90 0e+384 -> -NaN90 Invalid_operation
-ddfma2699 fma -NaN -sNaN89 0e+384 -> -NaN89 Invalid_operation
-
-ddfma2701 fma -NaN -Inf 0e+384 -> -NaN
-ddfma2702 fma -NaN 999 0e+384 -> -NaN
-ddfma2703 fma -NaN Inf 0e+384 -> -NaN
-ddfma2704 fma -NaN -NaN 0e+384 -> -NaN
-ddfma2705 fma -Inf -NaN0 0e+384 -> -NaN
-ddfma2706 fma -999 -NaN 0e+384 -> -NaN
-ddfma2707 fma Inf -NaN 0e+384 -> -NaN
-
-ddfma2711 fma -sNaN -Inf 0e+384 -> -NaN Invalid_operation
-ddfma2712 fma -sNaN -11 0e+384 -> -NaN Invalid_operation
-ddfma2713 fma -sNaN00 NaN 0e+384 -> -NaN Invalid_operation
-ddfma2714 fma -sNaN -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2715 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2716 fma -Inf -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2717 fma 088 -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2718 fma Inf -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2719 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
--- signs
-ddfma2751 fma 1e+277 1e+311 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2752 fma 1e+277 -1e+311 0e+384 -> -Infinity Overflow Inexact Rounded
-ddfma2753 fma -1e+277 1e+311 0e+384 -> -Infinity Overflow Inexact Rounded
-ddfma2754 fma -1e+277 -1e+311 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2755 fma 1e-277 1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2756 fma 1e-277 -1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2757 fma -1e-277 1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2758 fma -1e-277 -1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-ddfma2760 fma 1e-291 1e-101 0e+384 -> 1E-392 Subnormal
-ddfma2761 fma 1e-291 1e-102 0e+384 -> 1E-393 Subnormal
-ddfma2762 fma 1e-291 1e-103 0e+384 -> 1E-394 Subnormal
-ddfma2763 fma 1e-291 1e-104 0e+384 -> 1E-395 Subnormal
-ddfma2764 fma 1e-291 1e-105 0e+384 -> 1E-396 Subnormal
-ddfma2765 fma 1e-291 1e-106 0e+384 -> 1E-397 Subnormal
-ddfma2766 fma 1e-291 1e-107 0e+384 -> 1E-398 Subnormal
-ddfma2767 fma 1e-291 1e-108 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2768 fma 1e-291 1e-109 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2769 fma 1e-291 1e-110 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-ddfma2770 fma 1e+60 1e+321 0e+384 -> 1.000000000000E+381 Clamped
-ddfma2771 fma 1e+60 1e+322 0e+384 -> 1.0000000000000E+382 Clamped
-ddfma2772 fma 1e+60 1e+323 0e+384 -> 1.00000000000000E+383 Clamped
-ddfma2773 fma 1e+60 1e+324 0e+384 -> 1.000000000000000E+384 Clamped
-ddfma2774 fma 1e+60 1e+325 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2775 fma 1e+60 1e+326 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2776 fma 1e+60 1e+327 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2777 fma 1e+60 1e+328 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2778 fma 1e+60 1e+329 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2779 fma 1e+60 1e+330 0e+384 -> Infinity Overflow Inexact Rounded
-
-ddfma2801 fma 1.0000E-394 1 0e+384 -> 1.0000E-394 Subnormal
-ddfma2802 fma 1.000E-394 1e-1 0e+384 -> 1.000E-395 Subnormal
-ddfma2803 fma 1.00E-394 1e-2 0e+384 -> 1.00E-396 Subnormal
-ddfma2804 fma 1.0E-394 1e-3 0e+384 -> 1.0E-397 Subnormal
-ddfma2805 fma 1.0E-394 1e-4 0e+384 -> 1E-398 Subnormal Rounded
-ddfma2806 fma 1.3E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddfma2807 fma 1.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2808 fma 1.7E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2809 fma 2.3E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2810 fma 2.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2811 fma 2.7E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded
-ddfma2812 fma 1.49E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddfma2813 fma 1.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2814 fma 1.51E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2815 fma 2.49E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2816 fma 2.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2817 fma 2.51E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded
-
-ddfma2818 fma 1E-394 1e-4 0e+384 -> 1E-398 Subnormal
-ddfma2819 fma 3E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2820 fma 5E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2821 fma 7E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddfma2822 fma 9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddfma2823 fma 9.9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-
-ddfma2824 fma 1E-394 -1e-4 0e+384 -> -1E-398 Subnormal
-ddfma2825 fma 3E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2826 fma -5E-394 1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2827 fma 7E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddfma2828 fma -9E-394 1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddfma2829 fma 9.9E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddfma2830 fma 3.0E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-ddfma2831 fma 1.0E-199 1e-200 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2832 fma 1.0E-199 1e-199 0e+384 -> 1E-398 Subnormal Rounded
-ddfma2833 fma 1.0E-199 1e-198 0e+384 -> 1.0E-397 Subnormal
-ddfma2834 fma 2.0E-199 2e-198 0e+384 -> 4.0E-397 Subnormal
-ddfma2835 fma 4.0E-199 4e-198 0e+384 -> 1.60E-396 Subnormal
-ddfma2836 fma 10.0E-199 10e-198 0e+384 -> 1.000E-395 Subnormal
-ddfma2837 fma 30.0E-199 30e-198 0e+384 -> 9.000E-395 Subnormal
-ddfma2838 fma 40.0E-199 40e-188 0e+384 -> 1.6000E-384 Subnormal
-ddfma2839 fma 40.0E-199 40e-187 0e+384 -> 1.6000E-383
-ddfma2840 fma 40.0E-199 40e-186 0e+384 -> 1.6000E-382
-
--- Long operand overflow may be a different path
-ddfma2870 fma 100 9.999E+383 0e+384 -> Infinity Inexact Overflow Rounded
-ddfma2871 fma 100 -9.999E+383 0e+384 -> -Infinity Inexact Overflow Rounded
-ddfma2872 fma 9.999E+383 100 0e+384 -> Infinity Inexact Overflow Rounded
-ddfma2873 fma -9.999E+383 100 0e+384 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-ddfma2881 fma 1.2347E-355 1.2347E-40 0e+384 -> 1.524E-395 Inexact Rounded Subnormal Underflow
-ddfma2882 fma 1.234E-355 1.234E-40 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddfma2883 fma 1.23E-355 1.23E-40 0e+384 -> 1.513E-395 Inexact Rounded Subnormal Underflow
-ddfma2884 fma 1.2E-355 1.2E-40 0e+384 -> 1.44E-395 Subnormal
-ddfma2885 fma 1.2E-355 1.2E-41 0e+384 -> 1.44E-396 Subnormal
-ddfma2886 fma 1.2E-355 1.2E-42 0e+384 -> 1.4E-397 Subnormal Inexact Rounded Underflow
-ddfma2887 fma 1.2E-355 1.3E-42 0e+384 -> 1.6E-397 Subnormal Inexact Rounded Underflow
-ddfma2888 fma 1.3E-355 1.3E-42 0e+384 -> 1.7E-397 Subnormal Inexact Rounded Underflow
-ddfma2889 fma 1.3E-355 1.3E-43 0e+384 -> 2E-398 Subnormal Inexact Rounded Underflow
-ddfma2890 fma 1.3E-356 1.3E-43 0e+384 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow
-
-ddfma2891 fma 1.2345E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
-ddfma2892 fma 1.23456E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
-ddfma2893 fma 1.2345E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddfma2894 fma 1.23456E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddfma2895 fma 1.2345E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow
-ddfma2896 fma 1.23456E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
-ddfma2900 fma 0.3000000000E-191 0.3000000000E-191 0e+384 -> 9.00000000000000E-384 Subnormal Rounded
-ddfma2901 fma 0.3000000001E-191 0.3000000001E-191 0e+384 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
-ddfma2902 fma 9.999999999999999E-383 0.0999999999999 0e+384 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
-ddfma2903 fma 9.999999999999999E-383 0.09999999999999 0e+384 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
-ddfma2904 fma 9.999999999999999E-383 0.099999999999999 0e+384 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
-ddfma2905 fma 9.999999999999999E-383 0.0999999999999999 0e+384 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
--- prove operands are exact
-ddfma2906 fma 9.999999999999999E-383 1 0e+384 -> 9.999999999999999E-383
-ddfma2907 fma 1 0.09999999999999999 0e+384 -> 0.09999999999999999
--- the next rounds to Nmin
-ddfma2908 fma 9.999999999999999E-383 0.09999999999999999 0e+384 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-
--- hugest
-ddfma2909 fma 9999999999999999 9999999999999999 0e+384 -> 9.999999999999998E+31 Inexact Rounded
-
--- Null tests
-ddfma2990 fma 10 # 0e+384 -> NaN Invalid_operation
-ddfma2991 fma # 10 0e+384 -> NaN Invalid_operation
-
-
--- ADDITION TESTS ------------------------------------------------------
-
--- [first group are 'quick confidence check']
-ddfma3001 fma 1 1 1 -> 2
-ddfma3002 fma 1 2 3 -> 5
-ddfma3003 fma 1 '5.75' '3.3' -> 9.05
-ddfma3004 fma 1 '5' '-3' -> 2
-ddfma3005 fma 1 '-5' '-3' -> -8
-ddfma3006 fma 1 '-7' '2.5' -> -4.5
-ddfma3007 fma 1 '0.7' '0.3' -> 1.0
-ddfma3008 fma 1 '1.25' '1.25' -> 2.50
-ddfma3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
-ddfma3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
-
--- 1234567890123456 1234567890123456
-ddfma3011 fma 1 '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
-ddfma3012 fma 1 '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded
-ddfma3013 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
-ddfma3014 fma 1 '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded
-ddfma3015 fma 1 '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded
-ddfma3016 fma 1 '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
-ddfma3017 fma 1 '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
-ddfma3018 fma 1 '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
-ddfma3019 fma 1 '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded
-ddfma3020 fma 1 '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded
-
-ddfma3021 fma 1 0 1 -> 1
-ddfma3022 fma 1 1 1 -> 2
-ddfma3023 fma 1 2 1 -> 3
-ddfma3024 fma 1 3 1 -> 4
-ddfma3025 fma 1 4 1 -> 5
-ddfma3026 fma 1 5 1 -> 6
-ddfma3027 fma 1 6 1 -> 7
-ddfma3028 fma 1 7 1 -> 8
-ddfma3029 fma 1 8 1 -> 9
-ddfma3030 fma 1 9 1 -> 10
-
--- some carrying effects
-ddfma3031 fma 1 '0.9998' '0.0000' -> '0.9998'
-ddfma3032 fma 1 '0.9998' '0.0001' -> '0.9999'
-ddfma3033 fma 1 '0.9998' '0.0002' -> '1.0000'
-ddfma3034 fma 1 '0.9998' '0.0003' -> '1.0001'
-
-ddfma3035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
-ddfma3039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
-
--- symmetry:
-ddfma3040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
-ddfma3045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
-
--- same, without rounding
-ddfma3046 fma 1 '10000e+9' '7' -> '10000000000007'
-ddfma3047 fma 1 '10000e+9' '70' -> '10000000000070'
-ddfma3048 fma 1 '10000e+9' '700' -> '10000000000700'
-ddfma3049 fma 1 '10000e+9' '7000' -> '10000000007000'
-ddfma3050 fma 1 '10000e+9' '70000' -> '10000000070000'
-ddfma3051 fma 1 '10000e+9' '700000' -> '10000000700000'
-ddfma3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-ddfma3053 fma 1 '12' '7.00' -> '19.00'
-ddfma3054 fma 1 '1.3' '-1.07' -> '0.23'
-ddfma3055 fma 1 '1.3' '-1.30' -> '0.00'
-ddfma3056 fma 1 '1.3' '-2.07' -> '-0.77'
-ddfma3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
-
--- leading zero preservation
-ddfma3061 fma 1 1 '0.0001' -> '1.0001'
-ddfma3062 fma 1 1 '0.00001' -> '1.00001'
-ddfma3063 fma 1 1 '0.000001' -> '1.000001'
-ddfma3064 fma 1 1 '0.0000001' -> '1.0000001'
-ddfma3065 fma 1 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-ddfma3070 fma 1 1 0 -> 1
-ddfma3071 fma 1 1 0. -> 1
-ddfma3072 fma 1 1 .0 -> 1.0
-ddfma3073 fma 1 1 0.0 -> 1.0
-ddfma3074 fma 1 1 0.00 -> 1.00
-ddfma3075 fma 1 0 1 -> 1
-ddfma3076 fma 1 0. 1 -> 1
-ddfma3077 fma 1 .0 1 -> 1.0
-ddfma3078 fma 1 0.0 1 -> 1.0
-ddfma3079 fma 1 0.00 1 -> 1.00
-
--- some carries
-ddfma3080 fma 1 999999998 1 -> 999999999
-ddfma3081 fma 1 999999999 1 -> 1000000000
-ddfma3082 fma 1 99999999 1 -> 100000000
-ddfma3083 fma 1 9999999 1 -> 10000000
-ddfma3084 fma 1 999999 1 -> 1000000
-ddfma3085 fma 1 99999 1 -> 100000
-ddfma3086 fma 1 9999 1 -> 10000
-ddfma3087 fma 1 999 1 -> 1000
-ddfma3088 fma 1 99 1 -> 100
-ddfma3089 fma 1 9 1 -> 10
-
-
--- more LHS swaps
-ddfma3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
-ddfma3091 fma 1 '-56267E-6' 0 -> '-0.056267'
-ddfma3092 fma 1 '-56267E-5' 0 -> '-0.56267'
-ddfma3093 fma 1 '-56267E-4' 0 -> '-5.6267'
-ddfma3094 fma 1 '-56267E-3' 0 -> '-56.267'
-ddfma3095 fma 1 '-56267E-2' 0 -> '-562.67'
-ddfma3096 fma 1 '-56267E-1' 0 -> '-5626.7'
-ddfma3097 fma 1 '-56267E-0' 0 -> '-56267'
-ddfma3098 fma 1 '-5E-10' 0 -> '-5E-10'
-ddfma3099 fma 1 '-5E-7' 0 -> '-5E-7'
-ddfma3100 fma 1 '-5E-6' 0 -> '-0.000005'
-ddfma3101 fma 1 '-5E-5' 0 -> '-0.00005'
-ddfma3102 fma 1 '-5E-4' 0 -> '-0.0005'
-ddfma3103 fma 1 '-5E-1' 0 -> '-0.5'
-ddfma3104 fma 1 '-5E0' 0 -> '-5'
-ddfma3105 fma 1 '-5E1' 0 -> '-50'
-ddfma3106 fma 1 '-5E5' 0 -> '-500000'
-ddfma3107 fma 1 '-5E15' 0 -> '-5000000000000000'
-ddfma3108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded
-ddfma3109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded
-ddfma3110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded
-ddfma3111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded
-
--- more RHS swaps
-ddfma3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
-ddfma3114 fma 1 0 '-56267E-6' -> '-0.056267'
-ddfma3116 fma 1 0 '-56267E-5' -> '-0.56267'
-ddfma3117 fma 1 0 '-56267E-4' -> '-5.6267'
-ddfma3119 fma 1 0 '-56267E-3' -> '-56.267'
-ddfma3120 fma 1 0 '-56267E-2' -> '-562.67'
-ddfma3121 fma 1 0 '-56267E-1' -> '-5626.7'
-ddfma3122 fma 1 0 '-56267E-0' -> '-56267'
-ddfma3123 fma 1 0 '-5E-10' -> '-5E-10'
-ddfma3124 fma 1 0 '-5E-7' -> '-5E-7'
-ddfma3125 fma 1 0 '-5E-6' -> '-0.000005'
-ddfma3126 fma 1 0 '-5E-5' -> '-0.00005'
-ddfma3127 fma 1 0 '-5E-4' -> '-0.0005'
-ddfma3128 fma 1 0 '-5E-1' -> '-0.5'
-ddfma3129 fma 1 0 '-5E0' -> '-5'
-ddfma3130 fma 1 0 '-5E1' -> '-50'
-ddfma3131 fma 1 0 '-5E5' -> '-500000'
-ddfma3132 fma 1 0 '-5E15' -> '-5000000000000000'
-ddfma3133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded
-ddfma3134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded
-ddfma3135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded
-ddfma3136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded
-
--- related
-ddfma3137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded
-ddfma3138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded
-ddfma3139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded
-ddfma3140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded
-ddfma3141 fma 1 1E+11 0.0000 -> '100000000000.0000'
-ddfma3142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded
-ddfma3143 fma 1 0.000 1E+12 -> '1000000000000.000'
-ddfma3144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-ddfma3146 fma 1 '00.0' 0 -> '0.0'
-ddfma3147 fma 1 '0.00' 0 -> '0.00'
-ddfma3148 fma 1 0 '0.00' -> '0.00'
-ddfma3149 fma 1 0 '00.0' -> '0.0'
-ddfma3150 fma 1 '00.0' '0.00' -> '0.00'
-ddfma3151 fma 1 '0.00' '00.0' -> '0.00'
-ddfma3152 fma 1 '3' '.3' -> '3.3'
-ddfma3153 fma 1 '3.' '.3' -> '3.3'
-ddfma3154 fma 1 '3.0' '.3' -> '3.3'
-ddfma3155 fma 1 '3.00' '.3' -> '3.30'
-ddfma3156 fma 1 '3' '3' -> '6'
-ddfma3157 fma 1 '3' '+3' -> '6'
-ddfma3158 fma 1 '3' '-3' -> '0'
-ddfma3159 fma 1 '0.3' '-0.3' -> '0.0'
-ddfma3160 fma 1 '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-ddfma3161 fma 1 '1E+12' '-1' -> '999999999999'
-ddfma3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
-ddfma3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
-ddfma3164 fma 1 '-1' '1E+12' -> '999999999999'
-ddfma3165 fma 1 '7E+12' '-1' -> '6999999999999'
-ddfma3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
-ddfma3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
-ddfma3168 fma 1 '-1' '7E+12' -> '6999999999999'
-
-rounding: half_up
--- 1.234567890123456 1234567890123456 1 234567890123456
-ddfma3170 fma 1 '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
-ddfma3171 fma 1 '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
-ddfma3172 fma 1 '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
-ddfma3173 fma 1 '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
-ddfma3174 fma 1 '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
-ddfma3175 fma 1 '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
-ddfma3176 fma 1 '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
-ddfma3177 fma 1 '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded
-ddfma3178 fma 1 '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
-ddfma3179 fma 1 '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
-ddfma3180 fma 1 '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
-ddfma3181 fma 1 '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
-ddfma3182 fma 1 '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
-ddfma3183 fma 1 '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-ddfma3200 fma 1 '1234560123456789' 0 -> '1234560123456789'
-ddfma3201 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddfma3202 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddfma3203 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddfma3204 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddfma3205 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddfma3206 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddfma3207 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddfma3208 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
-ddfma3209 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
-ddfma3210 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
-ddfma3211 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
-ddfma3212 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
-ddfma3213 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
-ddfma3214 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
-ddfma3215 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
-ddfma3216 fma 1 '1234560123456789' 1 -> '1234560123456790'
-ddfma3217 fma 1 '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded
-ddfma3218 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddfma3219 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
-
-rounding: half_even
-ddfma3220 fma 1 '1234560123456789' 0 -> '1234560123456789'
-ddfma3221 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddfma3222 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddfma3223 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddfma3224 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddfma3225 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddfma3226 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddfma3227 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddfma3228 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
-ddfma3229 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
-ddfma3230 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
-ddfma3231 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
-ddfma3232 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
-ddfma3233 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
-ddfma3234 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
-ddfma3235 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
-ddfma3236 fma 1 '1234560123456789' 1 -> '1234560123456790'
-ddfma3237 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
-ddfma3238 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddfma3239 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
--- critical few with even bottom digit...
-ddfma3240 fma 1 '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded
-ddfma3241 fma 1 '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded
-ddfma3242 fma 1 '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded
-
-rounding: down
-ddfma3250 fma 1 '1234560123456789' 0 -> '1234560123456789'
-ddfma3251 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddfma3252 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddfma3253 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddfma3254 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddfma3255 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddfma3256 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddfma3257 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddfma3258 fma 1 '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded
-ddfma3259 fma 1 '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded
-ddfma3260 fma 1 '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded
-ddfma3261 fma 1 '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded
-ddfma3262 fma 1 '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded
-ddfma3263 fma 1 '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded
-ddfma3264 fma 1 '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded
-ddfma3265 fma 1 '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded
-ddfma3266 fma 1 '1234560123456789' 1 -> '1234560123456790'
-ddfma3267 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
-ddfma3268 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddfma3269 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-ddfma3301 fma 1 -1 1 -> 0
-ddfma3302 fma 1 0 1 -> 1
-ddfma3303 fma 1 1 1 -> 2
-ddfma3304 fma 1 12 1 -> 13
-ddfma3305 fma 1 98 1 -> 99
-ddfma3306 fma 1 99 1 -> 100
-ddfma3307 fma 1 100 1 -> 101
-ddfma3308 fma 1 101 1 -> 102
-ddfma3309 fma 1 -1 -1 -> -2
-ddfma3310 fma 1 0 -1 -> -1
-ddfma3311 fma 1 1 -1 -> 0
-ddfma3312 fma 1 12 -1 -> 11
-ddfma3313 fma 1 98 -1 -> 97
-ddfma3314 fma 1 99 -1 -> 98
-ddfma3315 fma 1 100 -1 -> 99
-ddfma3316 fma 1 101 -1 -> 100
-
-ddfma3321 fma 1 -0.01 0.01 -> 0.00
-ddfma3322 fma 1 0.00 0.01 -> 0.01
-ddfma3323 fma 1 0.01 0.01 -> 0.02
-ddfma3324 fma 1 0.12 0.01 -> 0.13
-ddfma3325 fma 1 0.98 0.01 -> 0.99
-ddfma3326 fma 1 0.99 0.01 -> 1.00
-ddfma3327 fma 1 1.00 0.01 -> 1.01
-ddfma3328 fma 1 1.01 0.01 -> 1.02
-ddfma3329 fma 1 -0.01 -0.01 -> -0.02
-ddfma3330 fma 1 0.00 -0.01 -> -0.01
-ddfma3331 fma 1 0.01 -0.01 -> 0.00
-ddfma3332 fma 1 0.12 -0.01 -> 0.11
-ddfma3333 fma 1 0.98 -0.01 -> 0.97
-ddfma3334 fma 1 0.99 -0.01 -> 0.98
-ddfma3335 fma 1 1.00 -0.01 -> 0.99
-ddfma3336 fma 1 1.01 -0.01 -> 1.00
-
--- some more cases where adding 0 affects the coefficient
-ddfma3340 fma 1 1E+3 0 -> 1000
-ddfma3341 fma 1 1E+15 0 -> 1000000000000000
-ddfma3342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded
-ddfma3343 fma 1 1E+20 0 -> 1.000000000000000E+20 Rounded
--- which simply follow from these cases ...
-ddfma3344 fma 1 1E+3 1 -> 1001
-ddfma3345 fma 1 1E+15 1 -> 1000000000000001
-ddfma3346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
-ddfma3347 fma 1 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded
-ddfma3348 fma 1 1E+3 7 -> 1007
-ddfma3349 fma 1 1E+15 7 -> 1000000000000007
-ddfma3350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
-ddfma3351 fma 1 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded
-
--- tryzeros cases
-rounding: half_up
-ddfma3360 fma 1 0E+50 10000E+1 -> 1.0000E+5
-ddfma3361 fma 1 0E-50 10000E+1 -> 100000.0000000000 Rounded
-ddfma3362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded
-ddfma3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
-ddfma3364 fma 1 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-ddfma3370 fma 1 999999999999999 815 -> 1000000000000814
-ddfma3371 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-rounding: half_up
-ddfma3372 fma 1 999999999999999 815 -> 1000000000000814
-ddfma3373 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-rounding: half_even
-ddfma3374 fma 1 999999999999999 815 -> 1000000000000814
-ddfma3375 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-
--- ulp replacement tests
-ddfma3400 fma 1 1 77e-14 -> 1.00000000000077
-ddfma3401 fma 1 1 77e-15 -> 1.000000000000077
-ddfma3402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded
-ddfma3403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded
-ddfma3404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded
-ddfma3405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded
-ddfma3406 fma 1 1 77e-299 -> 1.000000000000000 Inexact Rounded
-
-ddfma3410 fma 1 10 77e-14 -> 10.00000000000077
-ddfma3411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded
-ddfma3412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded
-ddfma3413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded
-ddfma3414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded
-ddfma3415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded
-ddfma3416 fma 1 10 77e-299 -> 10.00000000000000 Inexact Rounded
-
-ddfma3420 fma 1 77e-14 1 -> 1.00000000000077
-ddfma3421 fma 1 77e-15 1 -> 1.000000000000077
-ddfma3422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded
-ddfma3423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded
-ddfma3424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded
-ddfma3425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded
-ddfma3426 fma 1 77e-299 1 -> 1.000000000000000 Inexact Rounded
-
-ddfma3430 fma 1 77e-14 10 -> 10.00000000000077
-ddfma3431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded
-ddfma3432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded
-ddfma3433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded
-ddfma3434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded
-ddfma3435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded
-ddfma3436 fma 1 77e-299 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-ddfma36440 fma 1 1 -77e-14 -> 0.99999999999923
-ddfma36441 fma 1 1 -77e-15 -> 0.999999999999923
-ddfma36442 fma 1 1 -77e-16 -> 0.9999999999999923
-ddfma36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
-ddfma36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
-ddfma36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded
-ddfma36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded
-
-ddfma36450 fma 1 10 -77e-14 -> 9.99999999999923
-ddfma36451 fma 1 10 -77e-15 -> 9.999999999999923
-ddfma36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded
-ddfma36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded
-ddfma36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded
-ddfma36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded
-ddfma36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded
-
-ddfma36460 fma 1 -77e-14 1 -> 0.99999999999923
-ddfma36461 fma 1 -77e-15 1 -> 0.999999999999923
-ddfma36462 fma 1 -77e-16 1 -> 0.9999999999999923
-ddfma36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded
-ddfma36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded
-ddfma36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded
-ddfma36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded
-
-ddfma36470 fma 1 -77e-14 10 -> 9.99999999999923
-ddfma36471 fma 1 -77e-15 10 -> 9.999999999999923
-ddfma36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded
-ddfma36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded
-ddfma36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded
-ddfma36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded
-ddfma36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-ddfma36480 fma 1 -1 77e-14 -> -0.99999999999923
-ddfma36481 fma 1 -1 77e-15 -> -0.999999999999923
-ddfma36482 fma 1 -1 77e-16 -> -0.9999999999999923
-ddfma36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded
-ddfma36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded
-ddfma36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded
-ddfma36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded
-
-ddfma36490 fma 1 -10 77e-14 -> -9.99999999999923
-ddfma36491 fma 1 -10 77e-15 -> -9.999999999999923
-ddfma36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded
-ddfma36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded
-ddfma36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded
-ddfma36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded
-ddfma36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded
-
-ddfma36500 fma 1 77e-14 -1 -> -0.99999999999923
-ddfma36501 fma 1 77e-15 -1 -> -0.999999999999923
-ddfma36502 fma 1 77e-16 -1 -> -0.9999999999999923
-ddfma36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
-ddfma36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
-ddfma36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded
-ddfma36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded
-
-ddfma36510 fma 1 77e-14 -10 -> -9.99999999999923
-ddfma36511 fma 1 77e-15 -10 -> -9.999999999999923
-ddfma36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded
-ddfma36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded
-ddfma36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded
-ddfma36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded
-ddfma36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded
-
--- and a couple more with longer RHS
-ddfma36520 fma 1 1 -7777e-16 -> 0.9999999999992223
-ddfma36521 fma 1 1 -7777e-17 -> 0.9999999999999222 Inexact Rounded
-ddfma36522 fma 1 1 -7777e-18 -> 0.9999999999999922 Inexact Rounded
-ddfma36523 fma 1 1 -7777e-19 -> 0.9999999999999992 Inexact Rounded
-ddfma36524 fma 1 1 -7777e-20 -> 0.9999999999999999 Inexact Rounded
-ddfma36525 fma 1 1 -7777e-21 -> 1.000000000000000 Inexact Rounded
-ddfma36526 fma 1 1 -7777e-22 -> 1.000000000000000 Inexact Rounded
-
-
--- and some more residue effects and different roundings
-rounding: half_up
-ddfma36540 fma 1 '6543210123456789' 0 -> '6543210123456789'
-ddfma36541 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddfma36542 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddfma36543 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddfma36544 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddfma36545 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddfma36546 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddfma36547 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddfma36548 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-ddfma36549 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-ddfma36550 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-ddfma36551 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-ddfma36552 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-ddfma36553 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-ddfma36554 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-ddfma36555 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
-ddfma36556 fma 1 '6543210123456789' 1 -> '6543210123456790'
-ddfma36557 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
-ddfma36558 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddfma36559 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
-rounding: half_even
-ddfma36560 fma 1 '6543210123456789' 0 -> '6543210123456789'
-ddfma36561 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddfma36562 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddfma36563 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddfma36564 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddfma36565 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddfma36566 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddfma36567 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddfma36568 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-ddfma36569 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-ddfma36570 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-ddfma36571 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-ddfma36572 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-ddfma36573 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-ddfma36574 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-ddfma36575 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
-ddfma36576 fma 1 '6543210123456789' 1 -> '6543210123456790'
-ddfma36577 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-ddfma36578 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddfma36579 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
--- critical few with even bottom digit...
-ddfma37540 fma 1 '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded
-ddfma37541 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
-ddfma37542 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
-
-rounding: down
-ddfma37550 fma 1 '6543210123456789' 0 -> '6543210123456789'
-ddfma37551 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddfma37552 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddfma37553 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddfma37554 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddfma37555 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddfma37556 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddfma37557 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddfma37558 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
-ddfma37559 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
-ddfma37560 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
-ddfma37561 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
-ddfma37562 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
-ddfma37563 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
-ddfma37564 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
-ddfma37565 fma 1 '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded
-ddfma37566 fma 1 '6543210123456789' 1 -> '6543210123456790'
-ddfma37567 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-ddfma37568 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddfma37569 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
-
--- verify a query
-rounding: down
-ddfma37661 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
-ddfma37662 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
-ddfma37663 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
-ddfma37664 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-ddfma37701 fma 1 5.00 1.00E-3 -> 5.00100
-ddfma37702 fma 1 00.00 0.000 -> 0.000
-ddfma37703 fma 1 00.00 0E-3 -> 0.000
-ddfma37704 fma 1 0E-3 00.00 -> 0.000
-
-ddfma37710 fma 1 0E+3 00.00 -> 0.00
-ddfma37711 fma 1 0E+3 00.0 -> 0.0
-ddfma37712 fma 1 0E+3 00. -> 0
-ddfma37713 fma 1 0E+3 00.E+1 -> 0E+1
-ddfma37714 fma 1 0E+3 00.E+2 -> 0E+2
-ddfma37715 fma 1 0E+3 00.E+3 -> 0E+3
-ddfma37716 fma 1 0E+3 00.E+4 -> 0E+3
-ddfma37717 fma 1 0E+3 00.E+5 -> 0E+3
-ddfma37718 fma 1 0E+3 -00.0 -> 0.0
-ddfma37719 fma 1 0E+3 -00. -> 0
-ddfma37731 fma 1 0E+3 -00.E+1 -> 0E+1
-
-ddfma37720 fma 1 00.00 0E+3 -> 0.00
-ddfma37721 fma 1 00.0 0E+3 -> 0.0
-ddfma37722 fma 1 00. 0E+3 -> 0
-ddfma37723 fma 1 00.E+1 0E+3 -> 0E+1
-ddfma37724 fma 1 00.E+2 0E+3 -> 0E+2
-ddfma37725 fma 1 00.E+3 0E+3 -> 0E+3
-ddfma37726 fma 1 00.E+4 0E+3 -> 0E+3
-ddfma37727 fma 1 00.E+5 0E+3 -> 0E+3
-ddfma37728 fma 1 -00.00 0E+3 -> 0.00
-ddfma37729 fma 1 -00.0 0E+3 -> 0.0
-ddfma37730 fma 1 -00. 0E+3 -> 0
-
-ddfma37732 fma 1 0 0 -> 0
-ddfma37733 fma 1 0 -0 -> 0
-ddfma37734 fma 1 -0 0 -> 0
-ddfma37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
-
-ddfma37736 fma 1 1 -1 -> 0
-ddfma37737 fma 1 -1 -1 -> -2
-ddfma37738 fma 1 1 1 -> 2
-ddfma37739 fma 1 -1 1 -> 0
-
-ddfma37741 fma 1 0 -1 -> -1
-ddfma37742 fma 1 -0 -1 -> -1
-ddfma37743 fma 1 0 1 -> 1
-ddfma37744 fma 1 -0 1 -> 1
-ddfma37745 fma 1 -1 0 -> -1
-ddfma37746 fma 1 -1 -0 -> -1
-ddfma37747 fma 1 1 0 -> 1
-ddfma37748 fma 1 1 -0 -> 1
-
-ddfma37751 fma 1 0.0 -1 -> -1.0
-ddfma37752 fma 1 -0.0 -1 -> -1.0
-ddfma37753 fma 1 0.0 1 -> 1.0
-ddfma37754 fma 1 -0.0 1 -> 1.0
-ddfma37755 fma 1 -1.0 0 -> -1.0
-ddfma37756 fma 1 -1.0 -0 -> -1.0
-ddfma37757 fma 1 1.0 0 -> 1.0
-ddfma37758 fma 1 1.0 -0 -> 1.0
-
-ddfma37761 fma 1 0 -1.0 -> -1.0
-ddfma37762 fma 1 -0 -1.0 -> -1.0
-ddfma37763 fma 1 0 1.0 -> 1.0
-ddfma37764 fma 1 -0 1.0 -> 1.0
-ddfma37765 fma 1 -1 0.0 -> -1.0
-ddfma37766 fma 1 -1 -0.0 -> -1.0
-ddfma37767 fma 1 1 0.0 -> 1.0
-ddfma37768 fma 1 1 -0.0 -> 1.0
-
-ddfma37771 fma 1 0.0 -1.0 -> -1.0
-ddfma37772 fma 1 -0.0 -1.0 -> -1.0
-ddfma37773 fma 1 0.0 1.0 -> 1.0
-ddfma37774 fma 1 -0.0 1.0 -> 1.0
-ddfma37775 fma 1 -1.0 0.0 -> -1.0
-ddfma37776 fma 1 -1.0 -0.0 -> -1.0
-ddfma37777 fma 1 1.0 0.0 -> 1.0
-ddfma37778 fma 1 1.0 -0.0 -> 1.0
-
--- Specials
-ddfma37780 fma 1 -Inf -Inf -> -Infinity
-ddfma37781 fma 1 -Inf -1000 -> -Infinity
-ddfma37782 fma 1 -Inf -1 -> -Infinity
-ddfma37783 fma 1 -Inf -0 -> -Infinity
-ddfma37784 fma 1 -Inf 0 -> -Infinity
-ddfma37785 fma 1 -Inf 1 -> -Infinity
-ddfma37786 fma 1 -Inf 1000 -> -Infinity
-ddfma37787 fma 1 -1000 -Inf -> -Infinity
-ddfma37788 fma 1 -Inf -Inf -> -Infinity
-ddfma37789 fma 1 -1 -Inf -> -Infinity
-ddfma37790 fma 1 -0 -Inf -> -Infinity
-ddfma37791 fma 1 0 -Inf -> -Infinity
-ddfma37792 fma 1 1 -Inf -> -Infinity
-ddfma37793 fma 1 1000 -Inf -> -Infinity
-ddfma37794 fma 1 Inf -Inf -> NaN Invalid_operation
-
-ddfma37800 fma 1 Inf -Inf -> NaN Invalid_operation
-ddfma37801 fma 1 Inf -1000 -> Infinity
-ddfma37802 fma 1 Inf -1 -> Infinity
-ddfma37803 fma 1 Inf -0 -> Infinity
-ddfma37804 fma 1 Inf 0 -> Infinity
-ddfma37805 fma 1 Inf 1 -> Infinity
-ddfma37806 fma 1 Inf 1000 -> Infinity
-ddfma37807 fma 1 Inf Inf -> Infinity
-ddfma37808 fma 1 -1000 Inf -> Infinity
-ddfma37809 fma 1 -Inf Inf -> NaN Invalid_operation
-ddfma37810 fma 1 -1 Inf -> Infinity
-ddfma37811 fma 1 -0 Inf -> Infinity
-ddfma37812 fma 1 0 Inf -> Infinity
-ddfma37813 fma 1 1 Inf -> Infinity
-ddfma37814 fma 1 1000 Inf -> Infinity
-ddfma37815 fma 1 Inf Inf -> Infinity
-
-ddfma37821 fma 1 NaN -Inf -> NaN
-ddfma37822 fma 1 NaN -1000 -> NaN
-ddfma37823 fma 1 NaN -1 -> NaN
-ddfma37824 fma 1 NaN -0 -> NaN
-ddfma37825 fma 1 NaN 0 -> NaN
-ddfma37826 fma 1 NaN 1 -> NaN
-ddfma37827 fma 1 NaN 1000 -> NaN
-ddfma37828 fma 1 NaN Inf -> NaN
-ddfma37829 fma 1 NaN NaN -> NaN
-ddfma37830 fma 1 -Inf NaN -> NaN
-ddfma37831 fma 1 -1000 NaN -> NaN
-ddfma37832 fma 1 -1 NaN -> NaN
-ddfma37833 fma 1 -0 NaN -> NaN
-ddfma37834 fma 1 0 NaN -> NaN
-ddfma37835 fma 1 1 NaN -> NaN
-ddfma37836 fma 1 1000 NaN -> NaN
-ddfma37837 fma 1 Inf NaN -> NaN
-
-ddfma37841 fma 1 sNaN -Inf -> NaN Invalid_operation
-ddfma37842 fma 1 sNaN -1000 -> NaN Invalid_operation
-ddfma37843 fma 1 sNaN -1 -> NaN Invalid_operation
-ddfma37844 fma 1 sNaN -0 -> NaN Invalid_operation
-ddfma37845 fma 1 sNaN 0 -> NaN Invalid_operation
-ddfma37846 fma 1 sNaN 1 -> NaN Invalid_operation
-ddfma37847 fma 1 sNaN 1000 -> NaN Invalid_operation
-ddfma37848 fma 1 sNaN NaN -> NaN Invalid_operation
-ddfma37849 fma 1 sNaN sNaN -> NaN Invalid_operation
-ddfma37850 fma 1 NaN sNaN -> NaN Invalid_operation
-ddfma37851 fma 1 -Inf sNaN -> NaN Invalid_operation
-ddfma37852 fma 1 -1000 sNaN -> NaN Invalid_operation
-ddfma37853 fma 1 -1 sNaN -> NaN Invalid_operation
-ddfma37854 fma 1 -0 sNaN -> NaN Invalid_operation
-ddfma37855 fma 1 0 sNaN -> NaN Invalid_operation
-ddfma37856 fma 1 1 sNaN -> NaN Invalid_operation
-ddfma37857 fma 1 1000 sNaN -> NaN Invalid_operation
-ddfma37858 fma 1 Inf sNaN -> NaN Invalid_operation
-ddfma37859 fma 1 NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddfma37861 fma 1 NaN1 -Inf -> NaN1
-ddfma37862 fma 1 +NaN2 -1000 -> NaN2
-ddfma37863 fma 1 NaN3 1000 -> NaN3
-ddfma37864 fma 1 NaN4 Inf -> NaN4
-ddfma37865 fma 1 NaN5 +NaN6 -> NaN5
-ddfma37866 fma 1 -Inf NaN7 -> NaN7
-ddfma37867 fma 1 -1000 NaN8 -> NaN8
-ddfma37868 fma 1 1000 NaN9 -> NaN9
-ddfma37869 fma 1 Inf +NaN10 -> NaN10
-ddfma37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
-ddfma37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
-ddfma37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
-ddfma37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
-ddfma37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddfma37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
-ddfma37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
-ddfma37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
-ddfma37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
-ddfma37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
-ddfma37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddfma37882 fma 1 -NaN26 NaN28 -> -NaN26
-ddfma37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddfma37884 fma 1 1000 -NaN30 -> -NaN30
-ddfma37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Here we explore near the boundary of rounding a subnormal to Nmin
-ddfma37575 fma 1 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal
-ddfma37576 fma 1 -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal
-
--- check overflow edge case
--- 1234567890123456
-ddfma37972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
-ddfma37973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
-ddfma37976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
-ddfma37977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
-ddfma37978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
-ddfma37979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
-ddfma37980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
-ddfma37981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
-
-ddfma37985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
-ddfma37986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
-ddfma37989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-ddfma371100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
-ddfma371101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
-ddfma371103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
-ddfma371104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
-ddfma371105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
-ddfma371106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
-ddfma371107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
-ddfma371108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
-ddfma371109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-ddfma371110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
-ddfma371111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
-ddfma371113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
-ddfma371114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
-ddfma371115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
-ddfma371116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
-ddfma371117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
-ddfma371118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
-ddfma371119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-ddfma371300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
-ddfma371311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
-ddfma371312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
-ddfma371313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
-ddfma371314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
-ddfma371315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
-ddfma371316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
-ddfma371317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
-ddfma371318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
-ddfma371319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
-ddfma371320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
-ddfma371321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
-ddfma371322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
-ddfma371323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
-ddfma371324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
-ddfma371325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
-
-ddfma371340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
-ddfma371341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
-
-ddfma371349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
-ddfma371350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
-ddfma371351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
-ddfma371352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
-ddfma371353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
-ddfma371354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
-ddfma371355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
-ddfma371356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
-ddfma371357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
-ddfma371358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
-ddfma371359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
-ddfma371360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
-ddfma371361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
-ddfma371362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
-ddfma371363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
-ddfma371364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
-ddfma371365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-ddfma371420 fma 1 0 1.123456789012345 -> 1.123456789012345
-ddfma371421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
-ddfma371422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
-ddfma371423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
-ddfma371424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
-ddfma371425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
-ddfma371426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
-ddfma371427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
-ddfma371428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
-ddfma371429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
-ddfma371430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
-ddfma371431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
-ddfma371432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
-ddfma371433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
-ddfma371434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
-ddfma371435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
-ddfma371436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
-ddfma371437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
-ddfma371438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
-ddfma371439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
-
--- same, reversed 0
-ddfma371440 fma 1 1.123456789012345 0 -> 1.123456789012345
-ddfma371441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
-ddfma371442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
-ddfma371443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
-ddfma371444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
-ddfma371445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
-ddfma371446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
-ddfma371447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
-ddfma371448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
-ddfma371449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
-ddfma371450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
-ddfma371451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
-ddfma371452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
-ddfma371453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
-ddfma371454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
-ddfma371455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
-ddfma371456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
-ddfma371457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
-ddfma371458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
-ddfma371459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
-
--- same, Es on the 0
-ddfma371460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
-ddfma371461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
-ddfma371462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
-ddfma371463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
-ddfma371464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
-ddfma371465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
-ddfma371466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
-ddfma371467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
-ddfma371468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
-ddfma371469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
-ddfma371470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
-ddfma371471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
-ddfma371472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
-ddfma371473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
-ddfma371474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
-ddfma371475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
--- next four flag Rounded because the 0 extends the result
-ddfma371476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
-ddfma371477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
-ddfma371478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
-ddfma371479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-ddfma371500 fma 1 0 0E-19 -> 0E-19
-ddfma371501 fma 1 -0 0E-19 -> 0E-19
-ddfma371502 fma 1 0 -0E-19 -> 0E-19
-ddfma371503 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371511 fma 1 -11 11 -> 0
-ddfma371512 fma 1 11 -11 -> 0
-
-rounding: half_down
--- exact zeros from zeros
-ddfma371520 fma 1 0 0E-19 -> 0E-19
-ddfma371521 fma 1 -0 0E-19 -> 0E-19
-ddfma371522 fma 1 0 -0E-19 -> 0E-19
-ddfma371523 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371531 fma 1 -11 11 -> 0
-ddfma371532 fma 1 11 -11 -> 0
-
-rounding: half_even
--- exact zeros from zeros
-ddfma371540 fma 1 0 0E-19 -> 0E-19
-ddfma371541 fma 1 -0 0E-19 -> 0E-19
-ddfma371542 fma 1 0 -0E-19 -> 0E-19
-ddfma371543 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371551 fma 1 -11 11 -> 0
-ddfma371552 fma 1 11 -11 -> 0
-
-rounding: up
--- exact zeros from zeros
-ddfma371560 fma 1 0 0E-19 -> 0E-19
-ddfma371561 fma 1 -0 0E-19 -> 0E-19
-ddfma371562 fma 1 0 -0E-19 -> 0E-19
-ddfma371563 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371571 fma 1 -11 11 -> 0
-ddfma371572 fma 1 11 -11 -> 0
-
-rounding: down
--- exact zeros from zeros
-ddfma371580 fma 1 0 0E-19 -> 0E-19
-ddfma371581 fma 1 -0 0E-19 -> 0E-19
-ddfma371582 fma 1 0 -0E-19 -> 0E-19
-ddfma371583 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371591 fma 1 -11 11 -> 0
-ddfma371592 fma 1 11 -11 -> 0
-
-rounding: ceiling
--- exact zeros from zeros
-ddfma371600 fma 1 0 0E-19 -> 0E-19
-ddfma371601 fma 1 -0 0E-19 -> 0E-19
-ddfma371602 fma 1 0 -0E-19 -> 0E-19
-ddfma371603 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371611 fma 1 -11 11 -> 0
-ddfma371612 fma 1 11 -11 -> 0
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-ddfma371620 fma 1 0 0E-19 -> 0E-19
-ddfma371621 fma 1 -0 0E-19 -> -0E-19 -- *
-ddfma371622 fma 1 0 -0E-19 -> -0E-19 -- *
-ddfma371623 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371631 fma 1 -11 11 -> -0 -- *
-ddfma371632 fma 1 11 -11 -> -0 -- *
-
--- Examples from SQL proposal (Krishna Kulkarni)
-ddfma371701 fma 1 130E-2 120E-2 -> 2.50
-ddfma371702 fma 1 130E-2 12E-1 -> 2.50
-ddfma371703 fma 1 130E-2 1E0 -> 2.30
-ddfma371704 fma 1 1E2 1E4 -> 1.01E+4
-ddfma371705 fma 1 130E-2 -120E-2 -> 0.10
-ddfma371706 fma 1 130E-2 -12E-1 -> 0.10
-ddfma371707 fma 1 130E-2 -1E0 -> 0.30
-ddfma371708 fma 1 1E2 -1E4 -> -9.9E+3
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-ddfma375001 fma 1 1234567890123456 1 -> 1234567890123457
-ddfma375002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
-ddfma375003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
-ddfma375004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
-ddfma375005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
-ddfma375006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
-ddfma375007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
-ddfma375008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
-ddfma375009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
-ddfma375010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
-ddfma375011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
-ddfma375012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
-ddfma375013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
-ddfma375014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
-ddfma375015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
-ddfma375016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
-ddfma375017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
-ddfma375018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
-ddfma375019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
-ddfma375020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
-ddfma375021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
-
--- widening second argument at gap
-ddfma375030 fma 1 12345678 1 -> 12345679
-ddfma375031 fma 1 12345678 0.1 -> 12345678.1
-ddfma375032 fma 1 12345678 0.12 -> 12345678.12
-ddfma375033 fma 1 12345678 0.123 -> 12345678.123
-ddfma375034 fma 1 12345678 0.1234 -> 12345678.1234
-ddfma375035 fma 1 12345678 0.12345 -> 12345678.12345
-ddfma375036 fma 1 12345678 0.123456 -> 12345678.123456
-ddfma375037 fma 1 12345678 0.1234567 -> 12345678.1234567
-ddfma375038 fma 1 12345678 0.12345678 -> 12345678.12345678
-ddfma375039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
-ddfma375040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
-ddfma375041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
-ddfma375042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
-ddfma375043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
-ddfma375044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
-ddfma375045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
-ddfma375046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
-ddfma375047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
-ddfma375048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
-ddfma375049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-ddfma375050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
-ddfma375051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
-ddfma375052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
-ddfma375053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
-ddfma375054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
-ddfma375055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
-ddfma375056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
-ddfma375057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
-ddfma375060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
-ddfma375061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
-ddfma375062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
-ddfma375063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
-ddfma375064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
-ddfma375065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
-ddfma375066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
-ddfma375067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-ddfma375070 fma 1 12345678 1E-8 -> 12345678.00000001
-ddfma375071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
-ddfma375072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
-ddfma375073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
-ddfma375074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
-ddfma375075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
-ddfma375076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
-ddfma375077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
-ddfma375078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
-ddfma375079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
-ddfma375080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
-ddfma375081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
-ddfma375082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
-ddfma375083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
-ddfma375084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
-ddfma375085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
-ddfma375086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
-ddfma375087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
-ddfma375088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
-ddfma375089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
-
--- desctructive subtraction (from remainder tests)
-
--- +++ some of these will be off-by-one remainder vs remainderNear
-
-ddfma4000 fma -1234567890123454 1.000000000000001 1234567890123456 -> 0.765432109876546
-ddfma4001 fma -1234567890123443 1.00000000000001 1234567890123456 -> 0.65432109876557
-ddfma4002 fma -1234567890123332 1.0000000000001 1234567890123456 -> 0.5432109876668
-ddfma4003 fma -308641972530863 4.000000000000001 1234567890123455 -> 2.691358027469137
-ddfma4004 fma -308641972530863 4.000000000000001 1234567890123456 -> 3.691358027469137
-ddfma4005 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696
-ddfma4006 fma -246913578024691 4.99999999999999 1234567890123456 -> 3.46913578024691
-ddfma4007 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691
-ddfma4008 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309
-ddfma4009 fma -246913578024690 5.00000000000001 1234567890123456 -> 3.53086421975310
-ddfma4010 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314
-ddfma4011 fma -1234567890123455 1.000000000000001 1234567890123456 -> -0.234567890123455
-ddfma4012 fma -1234567890123444 1.00000000000001 1234567890123456 -> -0.34567890123444
-ddfma4013 fma -1234567890123333 1.0000000000001 1234567890123456 -> -0.4567890123333
-ddfma4014 fma -308641972530864 4.000000000000001 1234567890123455 -> -1.308641972530864
-ddfma4015 fma -308641972530864 4.000000000000001 1234567890123456 -> -0.308641972530864
-ddfma4016 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696
-ddfma4017 fma -246913578024692 4.99999999999999 1234567890123456 -> -1.53086421975308
-ddfma4018 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691
-ddfma4019 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309
-ddfma4020 fma -246913578024691 5.00000000000001 1234567890123456 -> -1.46913578024691
-ddfma4021 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314
-
-
--- Null tests
-ddfma39990 fma 1 10 # -> NaN Invalid_operation
-ddfma39991 fma 1 # 10 -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- ddFMA.decTest -- decDouble Fused Multiply Add --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- These tests comprese three parts:
+-- 1. Sanity checks and other three-operand tests (especially those
+-- where the fused operation makes a difference)
+-- 2. Multiply tests (third operand is neutral zero [0E+emax])
+-- 3. Addition tests (first operand is 1)
+-- The multiply and addition tests are extensive because FMA may have
+-- its own dedicated multiplication or addition routine(s), and they
+-- also inherently check the left-to-right properties.
+
+-- Sanity checks
+ddfma0001 fma 1 1 1 -> 2
+ddfma0002 fma 1 1 2 -> 3
+ddfma0003 fma 2 2 3 -> 7
+ddfma0004 fma 9 9 9 -> 90
+ddfma0005 fma -1 1 1 -> 0
+ddfma0006 fma -1 1 2 -> 1
+ddfma0007 fma -2 2 3 -> -1
+ddfma0008 fma -9 9 9 -> -72
+ddfma0011 fma 1 -1 1 -> 0
+ddfma0012 fma 1 -1 2 -> 1
+ddfma0013 fma 2 -2 3 -> -1
+ddfma0014 fma 9 -9 9 -> -72
+ddfma0015 fma 1 1 -1 -> 0
+ddfma0016 fma 1 1 -2 -> -1
+ddfma0017 fma 2 2 -3 -> 1
+ddfma0018 fma 9 9 -9 -> 72
+
+-- non-integer exacts
+ddfma0100 fma 25.2 63.6 -438 -> 1164.72
+ddfma0101 fma 0.301 0.380 334 -> 334.114380
+ddfma0102 fma 49.2 -4.8 23.3 -> -212.86
+ddfma0103 fma 4.22 0.079 -94.6 -> -94.26662
+ddfma0104 fma 903 0.797 0.887 -> 720.578
+ddfma0105 fma 6.13 -161 65.9 -> -921.03
+ddfma0106 fma 28.2 727 5.45 -> 20506.85
+ddfma0107 fma 4 605 688 -> 3108
+ddfma0108 fma 93.3 0.19 0.226 -> 17.953
+ddfma0109 fma 0.169 -341 5.61 -> -52.019
+ddfma0110 fma -72.2 30 -51.2 -> -2217.2
+ddfma0111 fma -0.409 13 20.4 -> 15.083
+ddfma0112 fma 317 77.0 19.0 -> 24428.0
+ddfma0113 fma 47 6.58 1.62 -> 310.88
+ddfma0114 fma 1.36 0.984 0.493 -> 1.83124
+ddfma0115 fma 72.7 274 1.56 -> 19921.36
+ddfma0116 fma 335 847 83 -> 283828
+ddfma0117 fma 666 0.247 25.4 -> 189.902
+ddfma0118 fma -3.87 3.06 78.0 -> 66.1578
+ddfma0119 fma 0.742 192 35.6 -> 178.064
+ddfma0120 fma -91.6 5.29 0.153 -> -484.411
+
+-- cases where result is different from separate multiply + add; each
+-- is preceded by the result of unfused multiply and add
+-- [this is about 20% of all similar cases in general]
+-- -> 7.123356429257969E+16
+ddfma0201 fma 27583489.6645 2582471078.04 2593183.42371 -> 7.123356429257970E+16 Inexact Rounded
+-- -> 22813275328.80506
+ddfma0208 fma 24280.355566 939577.397653 2032.013252 -> 22813275328.80507 Inexact Rounded
+-- -> -2.030397734278062E+16
+ddfma0209 fma 7848976432 -2586831.2281 137903.517909 -> -2.030397734278061E+16 Inexact Rounded
+-- -> 2040774094814.077
+ddfma0217 fma 56890.388731 35872030.4255 339337.123410 -> 2040774094814.078 Inexact Rounded
+-- -> 2.714469575205049E+18
+ddfma0220 fma 7533543.57445 360317763928 5073392.31638 -> 2.714469575205050E+18 Inexact Rounded
+-- -> 1.011676297716716E+19
+ddfma0223 fma 739945255.563 13672312784.1 -994381.53572 -> 1.011676297716715E+19 Inexact Rounded
+-- -> -2.914135721455315E+23
+ddfma0224 fma -413510957218 704729988550 9234162614.0 -> -2.914135721455314E+23 Inexact Rounded
+-- -> 2.620119863365786E+17
+ddfma0226 fma 437484.00601 598906432790 894450638.442 -> 2.620119863365787E+17 Inexact Rounded
+-- -> 1.272647995808178E+19
+ddfma0253 fma 73287556929 173651305.784 -358312568.389 -> 1.272647995808177E+19 Inexact Rounded
+-- -> -1.753769320861851E+18
+ddfma0257 fma 203258304486 -8628278.8066 153127.446727 -> -1.753769320861850E+18 Inexact Rounded
+-- -> -1.550737835263346E+17
+ddfma0260 fma 42560533.1774 -3643605282.86 178277.96377 -> -1.550737835263347E+17 Inexact Rounded
+-- -> 2.897624620576005E+22
+ddfma0269 fma 142656587375 203118879670 604576103991 -> 2.897624620576004E+22 Inexact Rounded
+
+-- Cases where multiply would overflow or underflow if separate
+fma0300 fma 9e+384 10 0 -> Infinity Overflow Inexact Rounded
+fma0301 fma 1e+384 10 0 -> Infinity Overflow Inexact Rounded
+fma0302 fma 1e+384 10 -1e+384 -> 9.000000000000000E+384 Clamped
+fma0303 fma 1e+384 10 -9e+384 -> 1.000000000000000E+384 Clamped
+-- subnormal etc.
+fma0305 fma 1e-398 0.1 0 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+fma0306 fma 1e-398 0.1 1 -> 1.000000000000000 Inexact Rounded
+fma0307 fma 1e-398 0.1 1e-398 -> 1E-398 Underflow Subnormal Inexact Rounded
+
+-- Infinite combinations
+ddfma0800 fma Inf Inf Inf -> Infinity
+ddfma0801 fma Inf Inf -Inf -> NaN Invalid_operation
+ddfma0802 fma Inf -Inf Inf -> NaN Invalid_operation
+ddfma0803 fma Inf -Inf -Inf -> -Infinity
+ddfma0804 fma -Inf Inf Inf -> NaN Invalid_operation
+ddfma0805 fma -Inf Inf -Inf -> -Infinity
+ddfma0806 fma -Inf -Inf Inf -> Infinity
+ddfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
+
+-- Triple NaN propagation
+ddfma0900 fma NaN2 NaN3 NaN5 -> NaN2
+ddfma0901 fma 0 NaN3 NaN5 -> NaN3
+ddfma0902 fma 0 0 NaN5 -> NaN5
+-- first sNaN wins (consider qNaN from earlier sNaN being
+-- overridden by an sNaN in third operand)
+ddfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+ddfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
+ddfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
+ddfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+ddfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
+ddfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
+
+-- MULTIPLICATION TESTS ------------------------------------------------
+
+-- sanity checks
+ddfma2000 fma 2 2 0e+384 -> 4
+ddfma2001 fma 2 3 0e+384 -> 6
+ddfma2002 fma 5 1 0e+384 -> 5
+ddfma2003 fma 5 2 0e+384 -> 10
+ddfma2004 fma 1.20 2 0e+384 -> 2.40
+ddfma2005 fma 1.20 0 0e+384 -> 0.00
+ddfma2006 fma 1.20 -2 0e+384 -> -2.40
+ddfma2007 fma -1.20 2 0e+384 -> -2.40
+ddfma2008 fma -1.20 0 0e+384 -> 0.00
+ddfma2009 fma -1.20 -2 0e+384 -> 2.40
+ddfma2010 fma 5.09 7.1 0e+384 -> 36.139
+ddfma2011 fma 2.5 4 0e+384 -> 10.0
+ddfma2012 fma 2.50 4 0e+384 -> 10.00
+ddfma2013 fma 1.23456789 1.00000000 0e+384 -> 1.234567890000000 Rounded
+ddfma2015 fma 2.50 4 0e+384 -> 10.00
+ddfma2016 fma 9.999999999 9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded
+ddfma2017 fma 9.999999999 -9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded
+ddfma2018 fma -9.999999999 9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded
+ddfma2019 fma -9.999999999 -9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded
+
+-- zeros, etc.
+ddfma2021 fma 0 0 0e+384 -> 0
+ddfma2022 fma 0 -0 0e+384 -> 0
+ddfma2023 fma -0 0 0e+384 -> 0
+ddfma2024 fma -0 -0 0e+384 -> 0
+ddfma2025 fma -0.0 -0.0 0e+384 -> 0.00
+ddfma2026 fma -0.0 -0.0 0e+384 -> 0.00
+ddfma2027 fma -0.0 -0.0 0e+384 -> 0.00
+ddfma2028 fma -0.0 -0.0 0e+384 -> 0.00
+ddfma2030 fma 5.00 1E-3 0e+384 -> 0.00500
+ddfma2031 fma 00.00 0.000 0e+384 -> 0.00000
+ddfma2032 fma 00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0
+ddfma2033 fma 0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0
+ddfma2034 fma -5.00 1E-3 0e+384 -> -0.00500
+ddfma2035 fma -00.00 0.000 0e+384 -> 0.00000
+ddfma2036 fma -00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0
+ddfma2037 fma -0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0
+ddfma2038 fma 5.00 -1E-3 0e+384 -> -0.00500
+ddfma2039 fma 00.00 -0.000 0e+384 -> 0.00000
+ddfma2040 fma 00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0
+ddfma2041 fma 0E-3 -00.00 0e+384 -> 0.00000 -- lhs is 0
+ddfma2042 fma -5.00 -1E-3 0e+384 -> 0.00500
+ddfma2043 fma -00.00 -0.000 0e+384 -> 0.00000
+ddfma2044 fma -00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0
+ddfma2045 fma -0E-3 -00.00 -0e+384 -> 0.00000 -- lhs is 0
+ddfma2046 fma -0E-3 00.00 -0e+384 -> -0.00000
+ddfma2047 fma 0E-3 -00.00 -0e+384 -> -0.00000
+ddfma2048 fma 0E-3 00.00 -0e+384 -> 0.00000
+
+-- examples from decarith
+ddfma2050 fma 1.20 3 0e+384 -> 3.60
+ddfma2051 fma 7 3 0e+384 -> 21
+ddfma2052 fma 0.9 0.8 0e+384 -> 0.72
+ddfma2053 fma 0.9 -0 0e+384 -> 0.0
+ddfma2054 fma 654321 654321 0e+384 -> 428135971041
+
+ddfma2060 fma 123.45 1e7 0e+384 -> 1.2345E+9
+ddfma2061 fma 123.45 1e8 0e+384 -> 1.2345E+10
+ddfma2062 fma 123.45 1e+9 0e+384 -> 1.2345E+11
+ddfma2063 fma 123.45 1e10 0e+384 -> 1.2345E+12
+ddfma2064 fma 123.45 1e11 0e+384 -> 1.2345E+13
+ddfma2065 fma 123.45 1e12 0e+384 -> 1.2345E+14
+ddfma2066 fma 123.45 1e13 0e+384 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+-- 1234567890123456
+ddfma2080 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9
+ddfma2084 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9
+ddfma2090 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9
+ddfma2094 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9
+
+-- test some more edge cases and carries
+ddfma2101 fma 9 9 0e+384 -> 81
+ddfma2102 fma 9 90 0e+384 -> 810
+ddfma2103 fma 9 900 0e+384 -> 8100
+ddfma2104 fma 9 9000 0e+384 -> 81000
+ddfma2105 fma 9 90000 0e+384 -> 810000
+ddfma2106 fma 9 900000 0e+384 -> 8100000
+ddfma2107 fma 9 9000000 0e+384 -> 81000000
+ddfma2108 fma 9 90000000 0e+384 -> 810000000
+ddfma2109 fma 9 900000000 0e+384 -> 8100000000
+ddfma2110 fma 9 9000000000 0e+384 -> 81000000000
+ddfma2111 fma 9 90000000000 0e+384 -> 810000000000
+ddfma2112 fma 9 900000000000 0e+384 -> 8100000000000
+ddfma2113 fma 9 9000000000000 0e+384 -> 81000000000000
+ddfma2114 fma 9 90000000000000 0e+384 -> 810000000000000
+ddfma2115 fma 9 900000000000000 0e+384 -> 8100000000000000
+--ddfma2116 fma 9 9000000000000000 0e+384 -> 81000000000000000
+--ddfma2117 fma 9 90000000000000000 0e+384 -> 810000000000000000
+--ddfma2118 fma 9 900000000000000000 0e+384 -> 8100000000000000000
+--ddfma2119 fma 9 9000000000000000000 0e+384 -> 81000000000000000000
+--ddfma2120 fma 9 90000000000000000000 0e+384 -> 810000000000000000000
+--ddfma2121 fma 9 900000000000000000000 0e+384 -> 8100000000000000000000
+--ddfma2122 fma 9 9000000000000000000000 0e+384 -> 81000000000000000000000
+--ddfma2123 fma 9 90000000000000000000000 0e+384 -> 810000000000000000000000
+-- test some more edge cases without carries
+ddfma2131 fma 3 3 0e+384 -> 9
+ddfma2132 fma 3 30 0e+384 -> 90
+ddfma2133 fma 3 300 0e+384 -> 900
+ddfma2134 fma 3 3000 0e+384 -> 9000
+ddfma2135 fma 3 30000 0e+384 -> 90000
+ddfma2136 fma 3 300000 0e+384 -> 900000
+ddfma2137 fma 3 3000000 0e+384 -> 9000000
+ddfma2138 fma 3 30000000 0e+384 -> 90000000
+ddfma2139 fma 3 300000000 0e+384 -> 900000000
+ddfma2140 fma 3 3000000000 0e+384 -> 9000000000
+ddfma2141 fma 3 30000000000 0e+384 -> 90000000000
+ddfma2142 fma 3 300000000000 0e+384 -> 900000000000
+ddfma2143 fma 3 3000000000000 0e+384 -> 9000000000000
+ddfma2144 fma 3 30000000000000 0e+384 -> 90000000000000
+ddfma2145 fma 3 300000000000000 0e+384 -> 900000000000000
+
+-- test some edge cases with exact rounding
+ddfma2301 fma 9 9 0e+384 -> 81
+ddfma2302 fma 9 90 0e+384 -> 810
+ddfma2303 fma 9 900 0e+384 -> 8100
+ddfma2304 fma 9 9000 0e+384 -> 81000
+ddfma2305 fma 9 90000 0e+384 -> 810000
+ddfma2306 fma 9 900000 0e+384 -> 8100000
+ddfma2307 fma 9 9000000 0e+384 -> 81000000
+ddfma2308 fma 9 90000000 0e+384 -> 810000000
+ddfma2309 fma 9 900000000 0e+384 -> 8100000000
+ddfma2310 fma 9 9000000000 0e+384 -> 81000000000
+ddfma2311 fma 9 90000000000 0e+384 -> 810000000000
+ddfma2312 fma 9 900000000000 0e+384 -> 8100000000000
+ddfma2313 fma 9 9000000000000 0e+384 -> 81000000000000
+ddfma2314 fma 9 90000000000000 0e+384 -> 810000000000000
+ddfma2315 fma 9 900000000000000 0e+384 -> 8100000000000000
+ddfma2316 fma 9 9000000000000000 0e+384 -> 8.100000000000000E+16 Rounded
+ddfma2317 fma 90 9000000000000000 0e+384 -> 8.100000000000000E+17 Rounded
+ddfma2318 fma 900 9000000000000000 0e+384 -> 8.100000000000000E+18 Rounded
+ddfma2319 fma 9000 9000000000000000 0e+384 -> 8.100000000000000E+19 Rounded
+ddfma2320 fma 90000 9000000000000000 0e+384 -> 8.100000000000000E+20 Rounded
+ddfma2321 fma 900000 9000000000000000 0e+384 -> 8.100000000000000E+21 Rounded
+ddfma2322 fma 9000000 9000000000000000 0e+384 -> 8.100000000000000E+22 Rounded
+ddfma2323 fma 90000000 9000000000000000 0e+384 -> 8.100000000000000E+23 Rounded
+
+-- tryzeros cases
+ddfma2504 fma 0E-260 1000E-260 0e+384 -> 0E-398 Clamped
+ddfma2505 fma 100E+260 0E+260 0e+384 -> 0E+369 Clamped
+
+-- mixed with zeros
+ddfma2541 fma 0 -1 0e+384 -> 0
+ddfma2542 fma -0 -1 0e+384 -> 0
+ddfma2543 fma 0 1 0e+384 -> 0
+ddfma2544 fma -0 1 0e+384 -> 0
+ddfma2545 fma -1 0 0e+384 -> 0
+ddfma2546 fma -1 -0 0e+384 -> 0
+ddfma2547 fma 1 0 0e+384 -> 0
+ddfma2548 fma 1 -0 0e+384 -> 0
+
+ddfma2551 fma 0.0 -1 0e+384 -> 0.0
+ddfma2552 fma -0.0 -1 0e+384 -> 0.0
+ddfma2553 fma 0.0 1 0e+384 -> 0.0
+ddfma2554 fma -0.0 1 0e+384 -> 0.0
+ddfma2555 fma -1.0 0 0e+384 -> 0.0
+ddfma2556 fma -1.0 -0 0e+384 -> 0.0
+ddfma2557 fma 1.0 0 0e+384 -> 0.0
+ddfma2558 fma 1.0 -0 0e+384 -> 0.0
+
+ddfma2561 fma 0 -1.0 0e+384 -> 0.0
+ddfma2562 fma -0 -1.0 0e+384 -> 0.0
+ddfma2563 fma 0 1.0 0e+384 -> 0.0
+ddfma2564 fma -0 1.0 0e+384 -> 0.0
+ddfma2565 fma -1 0.0 0e+384 -> 0.0
+ddfma2566 fma -1 -0.0 0e+384 -> 0.0
+ddfma2567 fma 1 0.0 0e+384 -> 0.0
+ddfma2568 fma 1 -0.0 0e+384 -> 0.0
+
+ddfma2571 fma 0.0 -1.0 0e+384 -> 0.00
+ddfma2572 fma -0.0 -1.0 0e+384 -> 0.00
+ddfma2573 fma 0.0 1.0 0e+384 -> 0.00
+ddfma2574 fma -0.0 1.0 0e+384 -> 0.00
+ddfma2575 fma -1.0 0.0 0e+384 -> 0.00
+ddfma2576 fma -1.0 -0.0 0e+384 -> 0.00
+ddfma2577 fma 1.0 0.0 0e+384 -> 0.00
+ddfma2578 fma 1.0 -0.0 0e+384 -> 0.00
+
+-- Specials
+ddfma2580 fma Inf -Inf 0e+384 -> -Infinity
+ddfma2581 fma Inf -1000 0e+384 -> -Infinity
+ddfma2582 fma Inf -1 0e+384 -> -Infinity
+ddfma2583 fma Inf -0 0e+384 -> NaN Invalid_operation
+ddfma2584 fma Inf 0 0e+384 -> NaN Invalid_operation
+ddfma2585 fma Inf 1 0e+384 -> Infinity
+ddfma2586 fma Inf 1000 0e+384 -> Infinity
+ddfma2587 fma Inf Inf 0e+384 -> Infinity
+ddfma2588 fma -1000 Inf 0e+384 -> -Infinity
+ddfma2589 fma -Inf Inf 0e+384 -> -Infinity
+ddfma2590 fma -1 Inf 0e+384 -> -Infinity
+ddfma2591 fma -0 Inf 0e+384 -> NaN Invalid_operation
+ddfma2592 fma 0 Inf 0e+384 -> NaN Invalid_operation
+ddfma2593 fma 1 Inf 0e+384 -> Infinity
+ddfma2594 fma 1000 Inf 0e+384 -> Infinity
+ddfma2595 fma Inf Inf 0e+384 -> Infinity
+
+ddfma2600 fma -Inf -Inf 0e+384 -> Infinity
+ddfma2601 fma -Inf -1000 0e+384 -> Infinity
+ddfma2602 fma -Inf -1 0e+384 -> Infinity
+ddfma2603 fma -Inf -0 0e+384 -> NaN Invalid_operation
+ddfma2604 fma -Inf 0 0e+384 -> NaN Invalid_operation
+ddfma2605 fma -Inf 1 0e+384 -> -Infinity
+ddfma2606 fma -Inf 1000 0e+384 -> -Infinity
+ddfma2607 fma -Inf Inf 0e+384 -> -Infinity
+ddfma2608 fma -1000 Inf 0e+384 -> -Infinity
+ddfma2609 fma -Inf -Inf 0e+384 -> Infinity
+ddfma2610 fma -1 -Inf 0e+384 -> Infinity
+ddfma2611 fma -0 -Inf 0e+384 -> NaN Invalid_operation
+ddfma2612 fma 0 -Inf 0e+384 -> NaN Invalid_operation
+ddfma2613 fma 1 -Inf 0e+384 -> -Infinity
+ddfma2614 fma 1000 -Inf 0e+384 -> -Infinity
+ddfma2615 fma Inf -Inf 0e+384 -> -Infinity
+
+ddfma2621 fma NaN -Inf 0e+384 -> NaN
+ddfma2622 fma NaN -1000 0e+384 -> NaN
+ddfma2623 fma NaN -1 0e+384 -> NaN
+ddfma2624 fma NaN -0 0e+384 -> NaN
+ddfma2625 fma NaN 0 0e+384 -> NaN
+ddfma2626 fma NaN 1 0e+384 -> NaN
+ddfma2627 fma NaN 1000 0e+384 -> NaN
+ddfma2628 fma NaN Inf 0e+384 -> NaN
+ddfma2629 fma NaN NaN 0e+384 -> NaN
+ddfma2630 fma -Inf NaN 0e+384 -> NaN
+ddfma2631 fma -1000 NaN 0e+384 -> NaN
+ddfma2632 fma -1 NaN 0e+384 -> NaN
+ddfma2633 fma -0 NaN 0e+384 -> NaN
+ddfma2634 fma 0 NaN 0e+384 -> NaN
+ddfma2635 fma 1 NaN 0e+384 -> NaN
+ddfma2636 fma 1000 NaN 0e+384 -> NaN
+ddfma2637 fma Inf NaN 0e+384 -> NaN
+
+ddfma2641 fma sNaN -Inf 0e+384 -> NaN Invalid_operation
+ddfma2642 fma sNaN -1000 0e+384 -> NaN Invalid_operation
+ddfma2643 fma sNaN -1 0e+384 -> NaN Invalid_operation
+ddfma2644 fma sNaN -0 0e+384 -> NaN Invalid_operation
+ddfma2645 fma sNaN 0 0e+384 -> NaN Invalid_operation
+ddfma2646 fma sNaN 1 0e+384 -> NaN Invalid_operation
+ddfma2647 fma sNaN 1000 0e+384 -> NaN Invalid_operation
+ddfma2648 fma sNaN NaN 0e+384 -> NaN Invalid_operation
+ddfma2649 fma sNaN sNaN 0e+384 -> NaN Invalid_operation
+ddfma2650 fma NaN sNaN 0e+384 -> NaN Invalid_operation
+ddfma2651 fma -Inf sNaN 0e+384 -> NaN Invalid_operation
+ddfma2652 fma -1000 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2653 fma -1 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2654 fma -0 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2655 fma 0 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2656 fma 1 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2657 fma 1000 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2658 fma Inf sNaN 0e+384 -> NaN Invalid_operation
+ddfma2659 fma NaN sNaN 0e+384 -> NaN Invalid_operation
+
+-- propagating NaNs
+ddfma2661 fma NaN9 -Inf 0e+384 -> NaN9
+ddfma2662 fma NaN8 999 0e+384 -> NaN8
+ddfma2663 fma NaN71 Inf 0e+384 -> NaN71
+ddfma2664 fma NaN6 NaN5 0e+384 -> NaN6
+ddfma2665 fma -Inf NaN4 0e+384 -> NaN4
+ddfma2666 fma -999 NaN33 0e+384 -> NaN33
+ddfma2667 fma Inf NaN2 0e+384 -> NaN2
+
+ddfma2671 fma sNaN99 -Inf 0e+384 -> NaN99 Invalid_operation
+ddfma2672 fma sNaN98 -11 0e+384 -> NaN98 Invalid_operation
+ddfma2673 fma sNaN97 NaN 0e+384 -> NaN97 Invalid_operation
+ddfma2674 fma sNaN16 sNaN94 0e+384 -> NaN16 Invalid_operation
+ddfma2675 fma NaN95 sNaN93 0e+384 -> NaN93 Invalid_operation
+ddfma2676 fma -Inf sNaN92 0e+384 -> NaN92 Invalid_operation
+ddfma2677 fma 088 sNaN91 0e+384 -> NaN91 Invalid_operation
+ddfma2678 fma Inf sNaN90 0e+384 -> NaN90 Invalid_operation
+ddfma2679 fma NaN sNaN89 0e+384 -> NaN89 Invalid_operation
+
+ddfma2681 fma -NaN9 -Inf 0e+384 -> -NaN9
+ddfma2682 fma -NaN8 999 0e+384 -> -NaN8
+ddfma2683 fma -NaN71 Inf 0e+384 -> -NaN71
+ddfma2684 fma -NaN6 -NaN5 0e+384 -> -NaN6
+ddfma2685 fma -Inf -NaN4 0e+384 -> -NaN4
+ddfma2686 fma -999 -NaN33 0e+384 -> -NaN33
+ddfma2687 fma Inf -NaN2 0e+384 -> -NaN2
+
+ddfma2691 fma -sNaN99 -Inf 0e+384 -> -NaN99 Invalid_operation
+ddfma2692 fma -sNaN98 -11 0e+384 -> -NaN98 Invalid_operation
+ddfma2693 fma -sNaN97 NaN 0e+384 -> -NaN97 Invalid_operation
+ddfma2694 fma -sNaN16 -sNaN94 0e+384 -> -NaN16 Invalid_operation
+ddfma2695 fma -NaN95 -sNaN93 0e+384 -> -NaN93 Invalid_operation
+ddfma2696 fma -Inf -sNaN92 0e+384 -> -NaN92 Invalid_operation
+ddfma2697 fma 088 -sNaN91 0e+384 -> -NaN91 Invalid_operation
+ddfma2698 fma Inf -sNaN90 0e+384 -> -NaN90 Invalid_operation
+ddfma2699 fma -NaN -sNaN89 0e+384 -> -NaN89 Invalid_operation
+
+ddfma2701 fma -NaN -Inf 0e+384 -> -NaN
+ddfma2702 fma -NaN 999 0e+384 -> -NaN
+ddfma2703 fma -NaN Inf 0e+384 -> -NaN
+ddfma2704 fma -NaN -NaN 0e+384 -> -NaN
+ddfma2705 fma -Inf -NaN0 0e+384 -> -NaN
+ddfma2706 fma -999 -NaN 0e+384 -> -NaN
+ddfma2707 fma Inf -NaN 0e+384 -> -NaN
+
+ddfma2711 fma -sNaN -Inf 0e+384 -> -NaN Invalid_operation
+ddfma2712 fma -sNaN -11 0e+384 -> -NaN Invalid_operation
+ddfma2713 fma -sNaN00 NaN 0e+384 -> -NaN Invalid_operation
+ddfma2714 fma -sNaN -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2715 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2716 fma -Inf -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2717 fma 088 -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2718 fma Inf -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2719 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+ddfma2751 fma 1e+277 1e+311 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2752 fma 1e+277 -1e+311 0e+384 -> -Infinity Overflow Inexact Rounded
+ddfma2753 fma -1e+277 1e+311 0e+384 -> -Infinity Overflow Inexact Rounded
+ddfma2754 fma -1e+277 -1e+311 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2755 fma 1e-277 1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2756 fma 1e-277 -1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2757 fma -1e-277 1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2758 fma -1e-277 -1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+ddfma2760 fma 1e-291 1e-101 0e+384 -> 1E-392 Subnormal
+ddfma2761 fma 1e-291 1e-102 0e+384 -> 1E-393 Subnormal
+ddfma2762 fma 1e-291 1e-103 0e+384 -> 1E-394 Subnormal
+ddfma2763 fma 1e-291 1e-104 0e+384 -> 1E-395 Subnormal
+ddfma2764 fma 1e-291 1e-105 0e+384 -> 1E-396 Subnormal
+ddfma2765 fma 1e-291 1e-106 0e+384 -> 1E-397 Subnormal
+ddfma2766 fma 1e-291 1e-107 0e+384 -> 1E-398 Subnormal
+ddfma2767 fma 1e-291 1e-108 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2768 fma 1e-291 1e-109 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2769 fma 1e-291 1e-110 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+ddfma2770 fma 1e+60 1e+321 0e+384 -> 1.000000000000E+381 Clamped
+ddfma2771 fma 1e+60 1e+322 0e+384 -> 1.0000000000000E+382 Clamped
+ddfma2772 fma 1e+60 1e+323 0e+384 -> 1.00000000000000E+383 Clamped
+ddfma2773 fma 1e+60 1e+324 0e+384 -> 1.000000000000000E+384 Clamped
+ddfma2774 fma 1e+60 1e+325 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2775 fma 1e+60 1e+326 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2776 fma 1e+60 1e+327 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2777 fma 1e+60 1e+328 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2778 fma 1e+60 1e+329 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2779 fma 1e+60 1e+330 0e+384 -> Infinity Overflow Inexact Rounded
+
+ddfma2801 fma 1.0000E-394 1 0e+384 -> 1.0000E-394 Subnormal
+ddfma2802 fma 1.000E-394 1e-1 0e+384 -> 1.000E-395 Subnormal
+ddfma2803 fma 1.00E-394 1e-2 0e+384 -> 1.00E-396 Subnormal
+ddfma2804 fma 1.0E-394 1e-3 0e+384 -> 1.0E-397 Subnormal
+ddfma2805 fma 1.0E-394 1e-4 0e+384 -> 1E-398 Subnormal Rounded
+ddfma2806 fma 1.3E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddfma2807 fma 1.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2808 fma 1.7E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2809 fma 2.3E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2810 fma 2.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2811 fma 2.7E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded
+ddfma2812 fma 1.49E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddfma2813 fma 1.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2814 fma 1.51E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2815 fma 2.49E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2816 fma 2.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2817 fma 2.51E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded
+
+ddfma2818 fma 1E-394 1e-4 0e+384 -> 1E-398 Subnormal
+ddfma2819 fma 3E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2820 fma 5E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2821 fma 7E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddfma2822 fma 9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddfma2823 fma 9.9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+
+ddfma2824 fma 1E-394 -1e-4 0e+384 -> -1E-398 Subnormal
+ddfma2825 fma 3E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2826 fma -5E-394 1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2827 fma 7E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddfma2828 fma -9E-394 1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddfma2829 fma 9.9E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddfma2830 fma 3.0E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+ddfma2831 fma 1.0E-199 1e-200 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2832 fma 1.0E-199 1e-199 0e+384 -> 1E-398 Subnormal Rounded
+ddfma2833 fma 1.0E-199 1e-198 0e+384 -> 1.0E-397 Subnormal
+ddfma2834 fma 2.0E-199 2e-198 0e+384 -> 4.0E-397 Subnormal
+ddfma2835 fma 4.0E-199 4e-198 0e+384 -> 1.60E-396 Subnormal
+ddfma2836 fma 10.0E-199 10e-198 0e+384 -> 1.000E-395 Subnormal
+ddfma2837 fma 30.0E-199 30e-198 0e+384 -> 9.000E-395 Subnormal
+ddfma2838 fma 40.0E-199 40e-188 0e+384 -> 1.6000E-384 Subnormal
+ddfma2839 fma 40.0E-199 40e-187 0e+384 -> 1.6000E-383
+ddfma2840 fma 40.0E-199 40e-186 0e+384 -> 1.6000E-382
+
+-- Long operand overflow may be a different path
+ddfma2870 fma 100 9.999E+383 0e+384 -> Infinity Inexact Overflow Rounded
+ddfma2871 fma 100 -9.999E+383 0e+384 -> -Infinity Inexact Overflow Rounded
+ddfma2872 fma 9.999E+383 100 0e+384 -> Infinity Inexact Overflow Rounded
+ddfma2873 fma -9.999E+383 100 0e+384 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+ddfma2881 fma 1.2347E-355 1.2347E-40 0e+384 -> 1.524E-395 Inexact Rounded Subnormal Underflow
+ddfma2882 fma 1.234E-355 1.234E-40 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddfma2883 fma 1.23E-355 1.23E-40 0e+384 -> 1.513E-395 Inexact Rounded Subnormal Underflow
+ddfma2884 fma 1.2E-355 1.2E-40 0e+384 -> 1.44E-395 Subnormal
+ddfma2885 fma 1.2E-355 1.2E-41 0e+384 -> 1.44E-396 Subnormal
+ddfma2886 fma 1.2E-355 1.2E-42 0e+384 -> 1.4E-397 Subnormal Inexact Rounded Underflow
+ddfma2887 fma 1.2E-355 1.3E-42 0e+384 -> 1.6E-397 Subnormal Inexact Rounded Underflow
+ddfma2888 fma 1.3E-355 1.3E-42 0e+384 -> 1.7E-397 Subnormal Inexact Rounded Underflow
+ddfma2889 fma 1.3E-355 1.3E-43 0e+384 -> 2E-398 Subnormal Inexact Rounded Underflow
+ddfma2890 fma 1.3E-356 1.3E-43 0e+384 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow
+
+ddfma2891 fma 1.2345E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
+ddfma2892 fma 1.23456E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
+ddfma2893 fma 1.2345E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddfma2894 fma 1.23456E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddfma2895 fma 1.2345E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow
+ddfma2896 fma 1.23456E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+ddfma2900 fma 0.3000000000E-191 0.3000000000E-191 0e+384 -> 9.00000000000000E-384 Subnormal Rounded
+ddfma2901 fma 0.3000000001E-191 0.3000000001E-191 0e+384 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
+ddfma2902 fma 9.999999999999999E-383 0.0999999999999 0e+384 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
+ddfma2903 fma 9.999999999999999E-383 0.09999999999999 0e+384 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
+ddfma2904 fma 9.999999999999999E-383 0.099999999999999 0e+384 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
+ddfma2905 fma 9.999999999999999E-383 0.0999999999999999 0e+384 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
+-- prove operands are exact
+ddfma2906 fma 9.999999999999999E-383 1 0e+384 -> 9.999999999999999E-383
+ddfma2907 fma 1 0.09999999999999999 0e+384 -> 0.09999999999999999
+-- the next rounds to Nmin
+ddfma2908 fma 9.999999999999999E-383 0.09999999999999999 0e+384 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+-- hugest
+ddfma2909 fma 9999999999999999 9999999999999999 0e+384 -> 9.999999999999998E+31 Inexact Rounded
+
+-- Null tests
+ddfma2990 fma 10 # 0e+384 -> NaN Invalid_operation
+ddfma2991 fma # 10 0e+384 -> NaN Invalid_operation
+
+
+-- ADDITION TESTS ------------------------------------------------------
+
+-- [first group are 'quick confidence check']
+ddfma3001 fma 1 1 1 -> 2
+ddfma3002 fma 1 2 3 -> 5
+ddfma3003 fma 1 '5.75' '3.3' -> 9.05
+ddfma3004 fma 1 '5' '-3' -> 2
+ddfma3005 fma 1 '-5' '-3' -> -8
+ddfma3006 fma 1 '-7' '2.5' -> -4.5
+ddfma3007 fma 1 '0.7' '0.3' -> 1.0
+ddfma3008 fma 1 '1.25' '1.25' -> 2.50
+ddfma3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
+ddfma3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
+
+-- 1234567890123456 1234567890123456
+ddfma3011 fma 1 '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
+ddfma3012 fma 1 '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded
+ddfma3013 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
+ddfma3014 fma 1 '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded
+ddfma3015 fma 1 '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded
+ddfma3016 fma 1 '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
+ddfma3017 fma 1 '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
+ddfma3018 fma 1 '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
+ddfma3019 fma 1 '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded
+ddfma3020 fma 1 '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded
+
+ddfma3021 fma 1 0 1 -> 1
+ddfma3022 fma 1 1 1 -> 2
+ddfma3023 fma 1 2 1 -> 3
+ddfma3024 fma 1 3 1 -> 4
+ddfma3025 fma 1 4 1 -> 5
+ddfma3026 fma 1 5 1 -> 6
+ddfma3027 fma 1 6 1 -> 7
+ddfma3028 fma 1 7 1 -> 8
+ddfma3029 fma 1 8 1 -> 9
+ddfma3030 fma 1 9 1 -> 10
+
+-- some carrying effects
+ddfma3031 fma 1 '0.9998' '0.0000' -> '0.9998'
+ddfma3032 fma 1 '0.9998' '0.0001' -> '0.9999'
+ddfma3033 fma 1 '0.9998' '0.0002' -> '1.0000'
+ddfma3034 fma 1 '0.9998' '0.0003' -> '1.0001'
+
+ddfma3035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
+ddfma3039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
+
+-- symmetry:
+ddfma3040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
+ddfma3045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
+
+-- same, without rounding
+ddfma3046 fma 1 '10000e+9' '7' -> '10000000000007'
+ddfma3047 fma 1 '10000e+9' '70' -> '10000000000070'
+ddfma3048 fma 1 '10000e+9' '700' -> '10000000000700'
+ddfma3049 fma 1 '10000e+9' '7000' -> '10000000007000'
+ddfma3050 fma 1 '10000e+9' '70000' -> '10000000070000'
+ddfma3051 fma 1 '10000e+9' '700000' -> '10000000700000'
+ddfma3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+ddfma3053 fma 1 '12' '7.00' -> '19.00'
+ddfma3054 fma 1 '1.3' '-1.07' -> '0.23'
+ddfma3055 fma 1 '1.3' '-1.30' -> '0.00'
+ddfma3056 fma 1 '1.3' '-2.07' -> '-0.77'
+ddfma3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
+
+-- leading zero preservation
+ddfma3061 fma 1 1 '0.0001' -> '1.0001'
+ddfma3062 fma 1 1 '0.00001' -> '1.00001'
+ddfma3063 fma 1 1 '0.000001' -> '1.000001'
+ddfma3064 fma 1 1 '0.0000001' -> '1.0000001'
+ddfma3065 fma 1 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+ddfma3070 fma 1 1 0 -> 1
+ddfma3071 fma 1 1 0. -> 1
+ddfma3072 fma 1 1 .0 -> 1.0
+ddfma3073 fma 1 1 0.0 -> 1.0
+ddfma3074 fma 1 1 0.00 -> 1.00
+ddfma3075 fma 1 0 1 -> 1
+ddfma3076 fma 1 0. 1 -> 1
+ddfma3077 fma 1 .0 1 -> 1.0
+ddfma3078 fma 1 0.0 1 -> 1.0
+ddfma3079 fma 1 0.00 1 -> 1.00
+
+-- some carries
+ddfma3080 fma 1 999999998 1 -> 999999999
+ddfma3081 fma 1 999999999 1 -> 1000000000
+ddfma3082 fma 1 99999999 1 -> 100000000
+ddfma3083 fma 1 9999999 1 -> 10000000
+ddfma3084 fma 1 999999 1 -> 1000000
+ddfma3085 fma 1 99999 1 -> 100000
+ddfma3086 fma 1 9999 1 -> 10000
+ddfma3087 fma 1 999 1 -> 1000
+ddfma3088 fma 1 99 1 -> 100
+ddfma3089 fma 1 9 1 -> 10
+
+
+-- more LHS swaps
+ddfma3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
+ddfma3091 fma 1 '-56267E-6' 0 -> '-0.056267'
+ddfma3092 fma 1 '-56267E-5' 0 -> '-0.56267'
+ddfma3093 fma 1 '-56267E-4' 0 -> '-5.6267'
+ddfma3094 fma 1 '-56267E-3' 0 -> '-56.267'
+ddfma3095 fma 1 '-56267E-2' 0 -> '-562.67'
+ddfma3096 fma 1 '-56267E-1' 0 -> '-5626.7'
+ddfma3097 fma 1 '-56267E-0' 0 -> '-56267'
+ddfma3098 fma 1 '-5E-10' 0 -> '-5E-10'
+ddfma3099 fma 1 '-5E-7' 0 -> '-5E-7'
+ddfma3100 fma 1 '-5E-6' 0 -> '-0.000005'
+ddfma3101 fma 1 '-5E-5' 0 -> '-0.00005'
+ddfma3102 fma 1 '-5E-4' 0 -> '-0.0005'
+ddfma3103 fma 1 '-5E-1' 0 -> '-0.5'
+ddfma3104 fma 1 '-5E0' 0 -> '-5'
+ddfma3105 fma 1 '-5E1' 0 -> '-50'
+ddfma3106 fma 1 '-5E5' 0 -> '-500000'
+ddfma3107 fma 1 '-5E15' 0 -> '-5000000000000000'
+ddfma3108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded
+ddfma3109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded
+ddfma3110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded
+ddfma3111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded
+
+-- more RHS swaps
+ddfma3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
+ddfma3114 fma 1 0 '-56267E-6' -> '-0.056267'
+ddfma3116 fma 1 0 '-56267E-5' -> '-0.56267'
+ddfma3117 fma 1 0 '-56267E-4' -> '-5.6267'
+ddfma3119 fma 1 0 '-56267E-3' -> '-56.267'
+ddfma3120 fma 1 0 '-56267E-2' -> '-562.67'
+ddfma3121 fma 1 0 '-56267E-1' -> '-5626.7'
+ddfma3122 fma 1 0 '-56267E-0' -> '-56267'
+ddfma3123 fma 1 0 '-5E-10' -> '-5E-10'
+ddfma3124 fma 1 0 '-5E-7' -> '-5E-7'
+ddfma3125 fma 1 0 '-5E-6' -> '-0.000005'
+ddfma3126 fma 1 0 '-5E-5' -> '-0.00005'
+ddfma3127 fma 1 0 '-5E-4' -> '-0.0005'
+ddfma3128 fma 1 0 '-5E-1' -> '-0.5'
+ddfma3129 fma 1 0 '-5E0' -> '-5'
+ddfma3130 fma 1 0 '-5E1' -> '-50'
+ddfma3131 fma 1 0 '-5E5' -> '-500000'
+ddfma3132 fma 1 0 '-5E15' -> '-5000000000000000'
+ddfma3133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded
+ddfma3134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded
+ddfma3135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded
+ddfma3136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded
+
+-- related
+ddfma3137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded
+ddfma3138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded
+ddfma3139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded
+ddfma3140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded
+ddfma3141 fma 1 1E+11 0.0000 -> '100000000000.0000'
+ddfma3142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded
+ddfma3143 fma 1 0.000 1E+12 -> '1000000000000.000'
+ddfma3144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+ddfma3146 fma 1 '00.0' 0 -> '0.0'
+ddfma3147 fma 1 '0.00' 0 -> '0.00'
+ddfma3148 fma 1 0 '0.00' -> '0.00'
+ddfma3149 fma 1 0 '00.0' -> '0.0'
+ddfma3150 fma 1 '00.0' '0.00' -> '0.00'
+ddfma3151 fma 1 '0.00' '00.0' -> '0.00'
+ddfma3152 fma 1 '3' '.3' -> '3.3'
+ddfma3153 fma 1 '3.' '.3' -> '3.3'
+ddfma3154 fma 1 '3.0' '.3' -> '3.3'
+ddfma3155 fma 1 '3.00' '.3' -> '3.30'
+ddfma3156 fma 1 '3' '3' -> '6'
+ddfma3157 fma 1 '3' '+3' -> '6'
+ddfma3158 fma 1 '3' '-3' -> '0'
+ddfma3159 fma 1 '0.3' '-0.3' -> '0.0'
+ddfma3160 fma 1 '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+ddfma3161 fma 1 '1E+12' '-1' -> '999999999999'
+ddfma3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
+ddfma3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
+ddfma3164 fma 1 '-1' '1E+12' -> '999999999999'
+ddfma3165 fma 1 '7E+12' '-1' -> '6999999999999'
+ddfma3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
+ddfma3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
+ddfma3168 fma 1 '-1' '7E+12' -> '6999999999999'
+
+rounding: half_up
+-- 1.234567890123456 1234567890123456 1 234567890123456
+ddfma3170 fma 1 '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
+ddfma3171 fma 1 '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
+ddfma3172 fma 1 '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
+ddfma3173 fma 1 '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
+ddfma3174 fma 1 '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
+ddfma3175 fma 1 '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
+ddfma3176 fma 1 '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
+ddfma3177 fma 1 '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded
+ddfma3178 fma 1 '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
+ddfma3179 fma 1 '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
+ddfma3180 fma 1 '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
+ddfma3181 fma 1 '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
+ddfma3182 fma 1 '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
+ddfma3183 fma 1 '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+ddfma3200 fma 1 '1234560123456789' 0 -> '1234560123456789'
+ddfma3201 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddfma3202 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddfma3203 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddfma3204 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddfma3205 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddfma3206 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddfma3207 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddfma3208 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
+ddfma3209 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
+ddfma3210 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
+ddfma3211 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
+ddfma3212 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
+ddfma3213 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
+ddfma3214 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
+ddfma3215 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
+ddfma3216 fma 1 '1234560123456789' 1 -> '1234560123456790'
+ddfma3217 fma 1 '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded
+ddfma3218 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddfma3219 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+
+rounding: half_even
+ddfma3220 fma 1 '1234560123456789' 0 -> '1234560123456789'
+ddfma3221 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddfma3222 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddfma3223 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddfma3224 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddfma3225 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddfma3226 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddfma3227 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddfma3228 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
+ddfma3229 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
+ddfma3230 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
+ddfma3231 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
+ddfma3232 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
+ddfma3233 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
+ddfma3234 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
+ddfma3235 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
+ddfma3236 fma 1 '1234560123456789' 1 -> '1234560123456790'
+ddfma3237 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
+ddfma3238 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddfma3239 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+-- critical few with even bottom digit...
+ddfma3240 fma 1 '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded
+ddfma3241 fma 1 '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded
+ddfma3242 fma 1 '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded
+
+rounding: down
+ddfma3250 fma 1 '1234560123456789' 0 -> '1234560123456789'
+ddfma3251 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddfma3252 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddfma3253 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddfma3254 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddfma3255 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddfma3256 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddfma3257 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddfma3258 fma 1 '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded
+ddfma3259 fma 1 '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded
+ddfma3260 fma 1 '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded
+ddfma3261 fma 1 '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded
+ddfma3262 fma 1 '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded
+ddfma3263 fma 1 '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded
+ddfma3264 fma 1 '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded
+ddfma3265 fma 1 '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded
+ddfma3266 fma 1 '1234560123456789' 1 -> '1234560123456790'
+ddfma3267 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
+ddfma3268 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddfma3269 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+ddfma3301 fma 1 -1 1 -> 0
+ddfma3302 fma 1 0 1 -> 1
+ddfma3303 fma 1 1 1 -> 2
+ddfma3304 fma 1 12 1 -> 13
+ddfma3305 fma 1 98 1 -> 99
+ddfma3306 fma 1 99 1 -> 100
+ddfma3307 fma 1 100 1 -> 101
+ddfma3308 fma 1 101 1 -> 102
+ddfma3309 fma 1 -1 -1 -> -2
+ddfma3310 fma 1 0 -1 -> -1
+ddfma3311 fma 1 1 -1 -> 0
+ddfma3312 fma 1 12 -1 -> 11
+ddfma3313 fma 1 98 -1 -> 97
+ddfma3314 fma 1 99 -1 -> 98
+ddfma3315 fma 1 100 -1 -> 99
+ddfma3316 fma 1 101 -1 -> 100
+
+ddfma3321 fma 1 -0.01 0.01 -> 0.00
+ddfma3322 fma 1 0.00 0.01 -> 0.01
+ddfma3323 fma 1 0.01 0.01 -> 0.02
+ddfma3324 fma 1 0.12 0.01 -> 0.13
+ddfma3325 fma 1 0.98 0.01 -> 0.99
+ddfma3326 fma 1 0.99 0.01 -> 1.00
+ddfma3327 fma 1 1.00 0.01 -> 1.01
+ddfma3328 fma 1 1.01 0.01 -> 1.02
+ddfma3329 fma 1 -0.01 -0.01 -> -0.02
+ddfma3330 fma 1 0.00 -0.01 -> -0.01
+ddfma3331 fma 1 0.01 -0.01 -> 0.00
+ddfma3332 fma 1 0.12 -0.01 -> 0.11
+ddfma3333 fma 1 0.98 -0.01 -> 0.97
+ddfma3334 fma 1 0.99 -0.01 -> 0.98
+ddfma3335 fma 1 1.00 -0.01 -> 0.99
+ddfma3336 fma 1 1.01 -0.01 -> 1.00
+
+-- some more cases where adding 0 affects the coefficient
+ddfma3340 fma 1 1E+3 0 -> 1000
+ddfma3341 fma 1 1E+15 0 -> 1000000000000000
+ddfma3342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded
+ddfma3343 fma 1 1E+20 0 -> 1.000000000000000E+20 Rounded
+-- which simply follow from these cases ...
+ddfma3344 fma 1 1E+3 1 -> 1001
+ddfma3345 fma 1 1E+15 1 -> 1000000000000001
+ddfma3346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
+ddfma3347 fma 1 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded
+ddfma3348 fma 1 1E+3 7 -> 1007
+ddfma3349 fma 1 1E+15 7 -> 1000000000000007
+ddfma3350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
+ddfma3351 fma 1 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded
+
+-- tryzeros cases
+rounding: half_up
+ddfma3360 fma 1 0E+50 10000E+1 -> 1.0000E+5
+ddfma3361 fma 1 0E-50 10000E+1 -> 100000.0000000000 Rounded
+ddfma3362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded
+ddfma3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
+ddfma3364 fma 1 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+ddfma3370 fma 1 999999999999999 815 -> 1000000000000814
+ddfma3371 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+rounding: half_up
+ddfma3372 fma 1 999999999999999 815 -> 1000000000000814
+ddfma3373 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+rounding: half_even
+ddfma3374 fma 1 999999999999999 815 -> 1000000000000814
+ddfma3375 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+
+-- ulp replacement tests
+ddfma3400 fma 1 1 77e-14 -> 1.00000000000077
+ddfma3401 fma 1 1 77e-15 -> 1.000000000000077
+ddfma3402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded
+ddfma3403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded
+ddfma3404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded
+ddfma3405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded
+ddfma3406 fma 1 1 77e-299 -> 1.000000000000000 Inexact Rounded
+
+ddfma3410 fma 1 10 77e-14 -> 10.00000000000077
+ddfma3411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded
+ddfma3412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded
+ddfma3413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded
+ddfma3414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded
+ddfma3415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded
+ddfma3416 fma 1 10 77e-299 -> 10.00000000000000 Inexact Rounded
+
+ddfma3420 fma 1 77e-14 1 -> 1.00000000000077
+ddfma3421 fma 1 77e-15 1 -> 1.000000000000077
+ddfma3422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded
+ddfma3423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded
+ddfma3424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded
+ddfma3425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded
+ddfma3426 fma 1 77e-299 1 -> 1.000000000000000 Inexact Rounded
+
+ddfma3430 fma 1 77e-14 10 -> 10.00000000000077
+ddfma3431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded
+ddfma3432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded
+ddfma3433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded
+ddfma3434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded
+ddfma3435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded
+ddfma3436 fma 1 77e-299 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+ddfma36440 fma 1 1 -77e-14 -> 0.99999999999923
+ddfma36441 fma 1 1 -77e-15 -> 0.999999999999923
+ddfma36442 fma 1 1 -77e-16 -> 0.9999999999999923
+ddfma36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
+ddfma36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
+ddfma36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded
+ddfma36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded
+
+ddfma36450 fma 1 10 -77e-14 -> 9.99999999999923
+ddfma36451 fma 1 10 -77e-15 -> 9.999999999999923
+ddfma36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded
+ddfma36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded
+ddfma36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded
+ddfma36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded
+ddfma36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded
+
+ddfma36460 fma 1 -77e-14 1 -> 0.99999999999923
+ddfma36461 fma 1 -77e-15 1 -> 0.999999999999923
+ddfma36462 fma 1 -77e-16 1 -> 0.9999999999999923
+ddfma36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded
+ddfma36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded
+ddfma36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded
+ddfma36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded
+
+ddfma36470 fma 1 -77e-14 10 -> 9.99999999999923
+ddfma36471 fma 1 -77e-15 10 -> 9.999999999999923
+ddfma36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded
+ddfma36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded
+ddfma36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded
+ddfma36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded
+ddfma36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+ddfma36480 fma 1 -1 77e-14 -> -0.99999999999923
+ddfma36481 fma 1 -1 77e-15 -> -0.999999999999923
+ddfma36482 fma 1 -1 77e-16 -> -0.9999999999999923
+ddfma36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded
+ddfma36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded
+ddfma36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded
+ddfma36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded
+
+ddfma36490 fma 1 -10 77e-14 -> -9.99999999999923
+ddfma36491 fma 1 -10 77e-15 -> -9.999999999999923
+ddfma36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded
+ddfma36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded
+ddfma36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded
+ddfma36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded
+ddfma36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded
+
+ddfma36500 fma 1 77e-14 -1 -> -0.99999999999923
+ddfma36501 fma 1 77e-15 -1 -> -0.999999999999923
+ddfma36502 fma 1 77e-16 -1 -> -0.9999999999999923
+ddfma36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
+ddfma36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
+ddfma36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded
+ddfma36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded
+
+ddfma36510 fma 1 77e-14 -10 -> -9.99999999999923
+ddfma36511 fma 1 77e-15 -10 -> -9.999999999999923
+ddfma36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded
+ddfma36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded
+ddfma36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded
+ddfma36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded
+ddfma36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded
+
+-- and a couple more with longer RHS
+ddfma36520 fma 1 1 -7777e-16 -> 0.9999999999992223
+ddfma36521 fma 1 1 -7777e-17 -> 0.9999999999999222 Inexact Rounded
+ddfma36522 fma 1 1 -7777e-18 -> 0.9999999999999922 Inexact Rounded
+ddfma36523 fma 1 1 -7777e-19 -> 0.9999999999999992 Inexact Rounded
+ddfma36524 fma 1 1 -7777e-20 -> 0.9999999999999999 Inexact Rounded
+ddfma36525 fma 1 1 -7777e-21 -> 1.000000000000000 Inexact Rounded
+ddfma36526 fma 1 1 -7777e-22 -> 1.000000000000000 Inexact Rounded
+
+
+-- and some more residue effects and different roundings
+rounding: half_up
+ddfma36540 fma 1 '6543210123456789' 0 -> '6543210123456789'
+ddfma36541 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddfma36542 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddfma36543 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddfma36544 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddfma36545 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddfma36546 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddfma36547 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddfma36548 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+ddfma36549 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+ddfma36550 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+ddfma36551 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+ddfma36552 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+ddfma36553 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+ddfma36554 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+ddfma36555 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
+ddfma36556 fma 1 '6543210123456789' 1 -> '6543210123456790'
+ddfma36557 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
+ddfma36558 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddfma36559 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+rounding: half_even
+ddfma36560 fma 1 '6543210123456789' 0 -> '6543210123456789'
+ddfma36561 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddfma36562 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddfma36563 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddfma36564 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddfma36565 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddfma36566 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddfma36567 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddfma36568 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+ddfma36569 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+ddfma36570 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+ddfma36571 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+ddfma36572 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+ddfma36573 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+ddfma36574 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+ddfma36575 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
+ddfma36576 fma 1 '6543210123456789' 1 -> '6543210123456790'
+ddfma36577 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+ddfma36578 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddfma36579 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+-- critical few with even bottom digit...
+ddfma37540 fma 1 '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded
+ddfma37541 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
+ddfma37542 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
+
+rounding: down
+ddfma37550 fma 1 '6543210123456789' 0 -> '6543210123456789'
+ddfma37551 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddfma37552 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddfma37553 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddfma37554 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddfma37555 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddfma37556 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddfma37557 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddfma37558 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
+ddfma37559 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
+ddfma37560 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
+ddfma37561 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
+ddfma37562 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
+ddfma37563 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
+ddfma37564 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
+ddfma37565 fma 1 '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded
+ddfma37566 fma 1 '6543210123456789' 1 -> '6543210123456790'
+ddfma37567 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+ddfma37568 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddfma37569 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+
+-- verify a query
+rounding: down
+ddfma37661 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
+ddfma37662 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
+ddfma37663 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
+ddfma37664 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+ddfma37701 fma 1 5.00 1.00E-3 -> 5.00100
+ddfma37702 fma 1 00.00 0.000 -> 0.000
+ddfma37703 fma 1 00.00 0E-3 -> 0.000
+ddfma37704 fma 1 0E-3 00.00 -> 0.000
+
+ddfma37710 fma 1 0E+3 00.00 -> 0.00
+ddfma37711 fma 1 0E+3 00.0 -> 0.0
+ddfma37712 fma 1 0E+3 00. -> 0
+ddfma37713 fma 1 0E+3 00.E+1 -> 0E+1
+ddfma37714 fma 1 0E+3 00.E+2 -> 0E+2
+ddfma37715 fma 1 0E+3 00.E+3 -> 0E+3
+ddfma37716 fma 1 0E+3 00.E+4 -> 0E+3
+ddfma37717 fma 1 0E+3 00.E+5 -> 0E+3
+ddfma37718 fma 1 0E+3 -00.0 -> 0.0
+ddfma37719 fma 1 0E+3 -00. -> 0
+ddfma37731 fma 1 0E+3 -00.E+1 -> 0E+1
+
+ddfma37720 fma 1 00.00 0E+3 -> 0.00
+ddfma37721 fma 1 00.0 0E+3 -> 0.0
+ddfma37722 fma 1 00. 0E+3 -> 0
+ddfma37723 fma 1 00.E+1 0E+3 -> 0E+1
+ddfma37724 fma 1 00.E+2 0E+3 -> 0E+2
+ddfma37725 fma 1 00.E+3 0E+3 -> 0E+3
+ddfma37726 fma 1 00.E+4 0E+3 -> 0E+3
+ddfma37727 fma 1 00.E+5 0E+3 -> 0E+3
+ddfma37728 fma 1 -00.00 0E+3 -> 0.00
+ddfma37729 fma 1 -00.0 0E+3 -> 0.0
+ddfma37730 fma 1 -00. 0E+3 -> 0
+
+ddfma37732 fma 1 0 0 -> 0
+ddfma37733 fma 1 0 -0 -> 0
+ddfma37734 fma 1 -0 0 -> 0
+ddfma37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
+
+ddfma37736 fma 1 1 -1 -> 0
+ddfma37737 fma 1 -1 -1 -> -2
+ddfma37738 fma 1 1 1 -> 2
+ddfma37739 fma 1 -1 1 -> 0
+
+ddfma37741 fma 1 0 -1 -> -1
+ddfma37742 fma 1 -0 -1 -> -1
+ddfma37743 fma 1 0 1 -> 1
+ddfma37744 fma 1 -0 1 -> 1
+ddfma37745 fma 1 -1 0 -> -1
+ddfma37746 fma 1 -1 -0 -> -1
+ddfma37747 fma 1 1 0 -> 1
+ddfma37748 fma 1 1 -0 -> 1
+
+ddfma37751 fma 1 0.0 -1 -> -1.0
+ddfma37752 fma 1 -0.0 -1 -> -1.0
+ddfma37753 fma 1 0.0 1 -> 1.0
+ddfma37754 fma 1 -0.0 1 -> 1.0
+ddfma37755 fma 1 -1.0 0 -> -1.0
+ddfma37756 fma 1 -1.0 -0 -> -1.0
+ddfma37757 fma 1 1.0 0 -> 1.0
+ddfma37758 fma 1 1.0 -0 -> 1.0
+
+ddfma37761 fma 1 0 -1.0 -> -1.0
+ddfma37762 fma 1 -0 -1.0 -> -1.0
+ddfma37763 fma 1 0 1.0 -> 1.0
+ddfma37764 fma 1 -0 1.0 -> 1.0
+ddfma37765 fma 1 -1 0.0 -> -1.0
+ddfma37766 fma 1 -1 -0.0 -> -1.0
+ddfma37767 fma 1 1 0.0 -> 1.0
+ddfma37768 fma 1 1 -0.0 -> 1.0
+
+ddfma37771 fma 1 0.0 -1.0 -> -1.0
+ddfma37772 fma 1 -0.0 -1.0 -> -1.0
+ddfma37773 fma 1 0.0 1.0 -> 1.0
+ddfma37774 fma 1 -0.0 1.0 -> 1.0
+ddfma37775 fma 1 -1.0 0.0 -> -1.0
+ddfma37776 fma 1 -1.0 -0.0 -> -1.0
+ddfma37777 fma 1 1.0 0.0 -> 1.0
+ddfma37778 fma 1 1.0 -0.0 -> 1.0
+
+-- Specials
+ddfma37780 fma 1 -Inf -Inf -> -Infinity
+ddfma37781 fma 1 -Inf -1000 -> -Infinity
+ddfma37782 fma 1 -Inf -1 -> -Infinity
+ddfma37783 fma 1 -Inf -0 -> -Infinity
+ddfma37784 fma 1 -Inf 0 -> -Infinity
+ddfma37785 fma 1 -Inf 1 -> -Infinity
+ddfma37786 fma 1 -Inf 1000 -> -Infinity
+ddfma37787 fma 1 -1000 -Inf -> -Infinity
+ddfma37788 fma 1 -Inf -Inf -> -Infinity
+ddfma37789 fma 1 -1 -Inf -> -Infinity
+ddfma37790 fma 1 -0 -Inf -> -Infinity
+ddfma37791 fma 1 0 -Inf -> -Infinity
+ddfma37792 fma 1 1 -Inf -> -Infinity
+ddfma37793 fma 1 1000 -Inf -> -Infinity
+ddfma37794 fma 1 Inf -Inf -> NaN Invalid_operation
+
+ddfma37800 fma 1 Inf -Inf -> NaN Invalid_operation
+ddfma37801 fma 1 Inf -1000 -> Infinity
+ddfma37802 fma 1 Inf -1 -> Infinity
+ddfma37803 fma 1 Inf -0 -> Infinity
+ddfma37804 fma 1 Inf 0 -> Infinity
+ddfma37805 fma 1 Inf 1 -> Infinity
+ddfma37806 fma 1 Inf 1000 -> Infinity
+ddfma37807 fma 1 Inf Inf -> Infinity
+ddfma37808 fma 1 -1000 Inf -> Infinity
+ddfma37809 fma 1 -Inf Inf -> NaN Invalid_operation
+ddfma37810 fma 1 -1 Inf -> Infinity
+ddfma37811 fma 1 -0 Inf -> Infinity
+ddfma37812 fma 1 0 Inf -> Infinity
+ddfma37813 fma 1 1 Inf -> Infinity
+ddfma37814 fma 1 1000 Inf -> Infinity
+ddfma37815 fma 1 Inf Inf -> Infinity
+
+ddfma37821 fma 1 NaN -Inf -> NaN
+ddfma37822 fma 1 NaN -1000 -> NaN
+ddfma37823 fma 1 NaN -1 -> NaN
+ddfma37824 fma 1 NaN -0 -> NaN
+ddfma37825 fma 1 NaN 0 -> NaN
+ddfma37826 fma 1 NaN 1 -> NaN
+ddfma37827 fma 1 NaN 1000 -> NaN
+ddfma37828 fma 1 NaN Inf -> NaN
+ddfma37829 fma 1 NaN NaN -> NaN
+ddfma37830 fma 1 -Inf NaN -> NaN
+ddfma37831 fma 1 -1000 NaN -> NaN
+ddfma37832 fma 1 -1 NaN -> NaN
+ddfma37833 fma 1 -0 NaN -> NaN
+ddfma37834 fma 1 0 NaN -> NaN
+ddfma37835 fma 1 1 NaN -> NaN
+ddfma37836 fma 1 1000 NaN -> NaN
+ddfma37837 fma 1 Inf NaN -> NaN
+
+ddfma37841 fma 1 sNaN -Inf -> NaN Invalid_operation
+ddfma37842 fma 1 sNaN -1000 -> NaN Invalid_operation
+ddfma37843 fma 1 sNaN -1 -> NaN Invalid_operation
+ddfma37844 fma 1 sNaN -0 -> NaN Invalid_operation
+ddfma37845 fma 1 sNaN 0 -> NaN Invalid_operation
+ddfma37846 fma 1 sNaN 1 -> NaN Invalid_operation
+ddfma37847 fma 1 sNaN 1000 -> NaN Invalid_operation
+ddfma37848 fma 1 sNaN NaN -> NaN Invalid_operation
+ddfma37849 fma 1 sNaN sNaN -> NaN Invalid_operation
+ddfma37850 fma 1 NaN sNaN -> NaN Invalid_operation
+ddfma37851 fma 1 -Inf sNaN -> NaN Invalid_operation
+ddfma37852 fma 1 -1000 sNaN -> NaN Invalid_operation
+ddfma37853 fma 1 -1 sNaN -> NaN Invalid_operation
+ddfma37854 fma 1 -0 sNaN -> NaN Invalid_operation
+ddfma37855 fma 1 0 sNaN -> NaN Invalid_operation
+ddfma37856 fma 1 1 sNaN -> NaN Invalid_operation
+ddfma37857 fma 1 1000 sNaN -> NaN Invalid_operation
+ddfma37858 fma 1 Inf sNaN -> NaN Invalid_operation
+ddfma37859 fma 1 NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddfma37861 fma 1 NaN1 -Inf -> NaN1
+ddfma37862 fma 1 +NaN2 -1000 -> NaN2
+ddfma37863 fma 1 NaN3 1000 -> NaN3
+ddfma37864 fma 1 NaN4 Inf -> NaN4
+ddfma37865 fma 1 NaN5 +NaN6 -> NaN5
+ddfma37866 fma 1 -Inf NaN7 -> NaN7
+ddfma37867 fma 1 -1000 NaN8 -> NaN8
+ddfma37868 fma 1 1000 NaN9 -> NaN9
+ddfma37869 fma 1 Inf +NaN10 -> NaN10
+ddfma37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
+ddfma37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
+ddfma37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
+ddfma37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
+ddfma37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddfma37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
+ddfma37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
+ddfma37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
+ddfma37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
+ddfma37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
+ddfma37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddfma37882 fma 1 -NaN26 NaN28 -> -NaN26
+ddfma37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddfma37884 fma 1 1000 -NaN30 -> -NaN30
+ddfma37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Here we explore near the boundary of rounding a subnormal to Nmin
+ddfma37575 fma 1 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal
+ddfma37576 fma 1 -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal
+
+-- check overflow edge case
+-- 1234567890123456
+ddfma37972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
+ddfma37973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
+ddfma37976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
+ddfma37977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
+ddfma37978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
+ddfma37979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
+ddfma37980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
+ddfma37981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
+
+ddfma37985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
+ddfma37986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
+ddfma37989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+ddfma371100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
+ddfma371101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
+ddfma371103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
+ddfma371104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
+ddfma371105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
+ddfma371106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
+ddfma371107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
+ddfma371108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
+ddfma371109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+ddfma371110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
+ddfma371111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
+ddfma371113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
+ddfma371114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
+ddfma371115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
+ddfma371116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
+ddfma371117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
+ddfma371118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
+ddfma371119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+ddfma371300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
+ddfma371311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
+ddfma371312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
+ddfma371313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
+ddfma371314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
+ddfma371315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
+ddfma371316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
+ddfma371317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
+ddfma371318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
+ddfma371319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
+ddfma371320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
+ddfma371321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
+ddfma371322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
+ddfma371323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
+ddfma371324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
+ddfma371325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
+
+ddfma371340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
+ddfma371341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
+
+ddfma371349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
+ddfma371350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
+ddfma371351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
+ddfma371352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
+ddfma371353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
+ddfma371354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
+ddfma371355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
+ddfma371356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
+ddfma371357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
+ddfma371358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
+ddfma371359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
+ddfma371360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
+ddfma371361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
+ddfma371362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
+ddfma371363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
+ddfma371364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
+ddfma371365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+ddfma371420 fma 1 0 1.123456789012345 -> 1.123456789012345
+ddfma371421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
+ddfma371422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
+ddfma371423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
+ddfma371424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
+ddfma371425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
+ddfma371426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
+ddfma371427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
+ddfma371428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
+ddfma371429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
+ddfma371430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
+ddfma371431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
+ddfma371432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
+ddfma371433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
+ddfma371434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
+ddfma371435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
+ddfma371436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
+ddfma371437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
+ddfma371438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
+ddfma371439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+ddfma371440 fma 1 1.123456789012345 0 -> 1.123456789012345
+ddfma371441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
+ddfma371442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
+ddfma371443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
+ddfma371444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
+ddfma371445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
+ddfma371446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
+ddfma371447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
+ddfma371448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
+ddfma371449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
+ddfma371450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
+ddfma371451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
+ddfma371452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
+ddfma371453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
+ddfma371454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
+ddfma371455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
+ddfma371456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
+ddfma371457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
+ddfma371458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
+ddfma371459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+ddfma371460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
+ddfma371461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
+ddfma371462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
+ddfma371463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
+ddfma371464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
+ddfma371465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
+ddfma371466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
+ddfma371467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
+ddfma371468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
+ddfma371469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
+ddfma371470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
+ddfma371471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
+ddfma371472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
+ddfma371473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
+ddfma371474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
+ddfma371475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+ddfma371476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
+ddfma371477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
+ddfma371478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
+ddfma371479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+ddfma371500 fma 1 0 0E-19 -> 0E-19
+ddfma371501 fma 1 -0 0E-19 -> 0E-19
+ddfma371502 fma 1 0 -0E-19 -> 0E-19
+ddfma371503 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371511 fma 1 -11 11 -> 0
+ddfma371512 fma 1 11 -11 -> 0
+
+rounding: half_down
+-- exact zeros from zeros
+ddfma371520 fma 1 0 0E-19 -> 0E-19
+ddfma371521 fma 1 -0 0E-19 -> 0E-19
+ddfma371522 fma 1 0 -0E-19 -> 0E-19
+ddfma371523 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371531 fma 1 -11 11 -> 0
+ddfma371532 fma 1 11 -11 -> 0
+
+rounding: half_even
+-- exact zeros from zeros
+ddfma371540 fma 1 0 0E-19 -> 0E-19
+ddfma371541 fma 1 -0 0E-19 -> 0E-19
+ddfma371542 fma 1 0 -0E-19 -> 0E-19
+ddfma371543 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371551 fma 1 -11 11 -> 0
+ddfma371552 fma 1 11 -11 -> 0
+
+rounding: up
+-- exact zeros from zeros
+ddfma371560 fma 1 0 0E-19 -> 0E-19
+ddfma371561 fma 1 -0 0E-19 -> 0E-19
+ddfma371562 fma 1 0 -0E-19 -> 0E-19
+ddfma371563 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371571 fma 1 -11 11 -> 0
+ddfma371572 fma 1 11 -11 -> 0
+
+rounding: down
+-- exact zeros from zeros
+ddfma371580 fma 1 0 0E-19 -> 0E-19
+ddfma371581 fma 1 -0 0E-19 -> 0E-19
+ddfma371582 fma 1 0 -0E-19 -> 0E-19
+ddfma371583 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371591 fma 1 -11 11 -> 0
+ddfma371592 fma 1 11 -11 -> 0
+
+rounding: ceiling
+-- exact zeros from zeros
+ddfma371600 fma 1 0 0E-19 -> 0E-19
+ddfma371601 fma 1 -0 0E-19 -> 0E-19
+ddfma371602 fma 1 0 -0E-19 -> 0E-19
+ddfma371603 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371611 fma 1 -11 11 -> 0
+ddfma371612 fma 1 11 -11 -> 0
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+ddfma371620 fma 1 0 0E-19 -> 0E-19
+ddfma371621 fma 1 -0 0E-19 -> -0E-19 -- *
+ddfma371622 fma 1 0 -0E-19 -> -0E-19 -- *
+ddfma371623 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371631 fma 1 -11 11 -> -0 -- *
+ddfma371632 fma 1 11 -11 -> -0 -- *
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+ddfma371701 fma 1 130E-2 120E-2 -> 2.50
+ddfma371702 fma 1 130E-2 12E-1 -> 2.50
+ddfma371703 fma 1 130E-2 1E0 -> 2.30
+ddfma371704 fma 1 1E2 1E4 -> 1.01E+4
+ddfma371705 fma 1 130E-2 -120E-2 -> 0.10
+ddfma371706 fma 1 130E-2 -12E-1 -> 0.10
+ddfma371707 fma 1 130E-2 -1E0 -> 0.30
+ddfma371708 fma 1 1E2 -1E4 -> -9.9E+3
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+ddfma375001 fma 1 1234567890123456 1 -> 1234567890123457
+ddfma375002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
+ddfma375003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
+ddfma375004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
+ddfma375005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
+ddfma375006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
+ddfma375007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
+ddfma375008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
+ddfma375009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
+ddfma375010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
+ddfma375011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
+ddfma375012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
+ddfma375013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
+ddfma375014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
+ddfma375015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
+ddfma375016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
+ddfma375017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
+ddfma375018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
+ddfma375019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
+ddfma375020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
+ddfma375021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
+
+-- widening second argument at gap
+ddfma375030 fma 1 12345678 1 -> 12345679
+ddfma375031 fma 1 12345678 0.1 -> 12345678.1
+ddfma375032 fma 1 12345678 0.12 -> 12345678.12
+ddfma375033 fma 1 12345678 0.123 -> 12345678.123
+ddfma375034 fma 1 12345678 0.1234 -> 12345678.1234
+ddfma375035 fma 1 12345678 0.12345 -> 12345678.12345
+ddfma375036 fma 1 12345678 0.123456 -> 12345678.123456
+ddfma375037 fma 1 12345678 0.1234567 -> 12345678.1234567
+ddfma375038 fma 1 12345678 0.12345678 -> 12345678.12345678
+ddfma375039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
+ddfma375040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
+ddfma375041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
+ddfma375042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
+ddfma375043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
+ddfma375044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
+ddfma375045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
+ddfma375046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
+ddfma375047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
+ddfma375048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
+ddfma375049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+ddfma375050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
+ddfma375051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
+ddfma375052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
+ddfma375053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
+ddfma375054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
+ddfma375055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
+ddfma375056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
+ddfma375057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
+ddfma375060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
+ddfma375061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
+ddfma375062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
+ddfma375063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
+ddfma375064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
+ddfma375065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
+ddfma375066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
+ddfma375067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+ddfma375070 fma 1 12345678 1E-8 -> 12345678.00000001
+ddfma375071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
+ddfma375072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
+ddfma375073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
+ddfma375074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
+ddfma375075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
+ddfma375076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
+ddfma375077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
+ddfma375078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
+ddfma375079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
+ddfma375080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
+ddfma375081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
+ddfma375082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
+ddfma375083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
+ddfma375084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
+ddfma375085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
+ddfma375086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
+ddfma375087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
+ddfma375088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
+ddfma375089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
+
+-- desctructive subtraction (from remainder tests)
+
+-- +++ some of these will be off-by-one remainder vs remainderNear
+
+ddfma4000 fma -1234567890123454 1.000000000000001 1234567890123456 -> 0.765432109876546
+ddfma4001 fma -1234567890123443 1.00000000000001 1234567890123456 -> 0.65432109876557
+ddfma4002 fma -1234567890123332 1.0000000000001 1234567890123456 -> 0.5432109876668
+ddfma4003 fma -308641972530863 4.000000000000001 1234567890123455 -> 2.691358027469137
+ddfma4004 fma -308641972530863 4.000000000000001 1234567890123456 -> 3.691358027469137
+ddfma4005 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696
+ddfma4006 fma -246913578024691 4.99999999999999 1234567890123456 -> 3.46913578024691
+ddfma4007 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691
+ddfma4008 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309
+ddfma4009 fma -246913578024690 5.00000000000001 1234567890123456 -> 3.53086421975310
+ddfma4010 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314
+ddfma4011 fma -1234567890123455 1.000000000000001 1234567890123456 -> -0.234567890123455
+ddfma4012 fma -1234567890123444 1.00000000000001 1234567890123456 -> -0.34567890123444
+ddfma4013 fma -1234567890123333 1.0000000000001 1234567890123456 -> -0.4567890123333
+ddfma4014 fma -308641972530864 4.000000000000001 1234567890123455 -> -1.308641972530864
+ddfma4015 fma -308641972530864 4.000000000000001 1234567890123456 -> -0.308641972530864
+ddfma4016 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696
+ddfma4017 fma -246913578024692 4.99999999999999 1234567890123456 -> -1.53086421975308
+ddfma4018 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691
+ddfma4019 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309
+ddfma4020 fma -246913578024691 5.00000000000001 1234567890123456 -> -1.46913578024691
+ddfma4021 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314
+
+
+-- Null tests
+ddfma39990 fma 1 10 # -> NaN Invalid_operation
+ddfma39991 fma 1 # 10 -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/ddInvert.decTest b/Lib/test/decimaltestdata/ddInvert.decTest
index 5d19fba829..321e4e9ee9 100644
--- a/Lib/test/decimaltestdata/ddInvert.decTest
+++ b/Lib/test/decimaltestdata/ddInvert.decTest
@@ -1,202 +1,202 @@
-------------------------------------------------------------------------
--- ddInvert.decTest -- digitwise logical INVERT for decDoubles --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check (truth table)
-ddinv001 invert 0 -> 1111111111111111
-ddinv002 invert 1 -> 1111111111111110
-ddinv003 invert 10 -> 1111111111111101
-ddinv004 invert 111111111 -> 1111111000000000
-ddinv005 invert 000000000 -> 1111111111111111
--- and at msd and msd-1
-ddinv007 invert 0000000000000000 -> 1111111111111111
-ddinv008 invert 1000000000000000 -> 111111111111111
-ddinv009 invert 0000000000000000 -> 1111111111111111
-ddinv010 invert 0100000000000000 -> 1011111111111111
-ddinv011 invert 0111111111111111 -> 1000000000000000
-ddinv012 invert 1111111111111111 -> 0
-ddinv013 invert 0011111111111111 -> 1100000000000000
-ddinv014 invert 0111111111111111 -> 1000000000000000
-
--- Various lengths
--- 123456789 1234567890123456
-ddinv021 invert 111111111 -> 1111111000000000
-ddinv022 invert 111111111111 -> 1111000000000000
-ddinv023 invert 11111111 -> 1111111100000000
-ddinv025 invert 1111111 -> 1111111110000000
-ddinv026 invert 111111 -> 1111111111000000
-ddinv027 invert 11111 -> 1111111111100000
-ddinv028 invert 1111 -> 1111111111110000
-ddinv029 invert 111 -> 1111111111111000
-ddinv031 invert 11 -> 1111111111111100
-ddinv032 invert 1 -> 1111111111111110
-ddinv033 invert 111111111111 -> 1111000000000000
-ddinv034 invert 11111111111 -> 1111100000000000
-ddinv035 invert 1111111111 -> 1111110000000000
-ddinv036 invert 111111111 -> 1111111000000000
-
-ddinv040 invert 011111111 -> 1111111100000000
-ddinv041 invert 101111111 -> 1111111010000000
-ddinv042 invert 110111111 -> 1111111001000000
-ddinv043 invert 111011111 -> 1111111000100000
-ddinv044 invert 111101111 -> 1111111000010000
-ddinv045 invert 111110111 -> 1111111000001000
-ddinv046 invert 111111011 -> 1111111000000100
-ddinv047 invert 111111101 -> 1111111000000010
-ddinv048 invert 111111110 -> 1111111000000001
-ddinv049 invert 011111011 -> 1111111100000100
-ddinv050 invert 101111101 -> 1111111010000010
-ddinv051 invert 110111110 -> 1111111001000001
-ddinv052 invert 111011101 -> 1111111000100010
-ddinv053 invert 111101011 -> 1111111000010100
-ddinv054 invert 111110111 -> 1111111000001000
-ddinv055 invert 111101011 -> 1111111000010100
-ddinv056 invert 111011101 -> 1111111000100010
-ddinv057 invert 110111110 -> 1111111001000001
-ddinv058 invert 101111101 -> 1111111010000010
-ddinv059 invert 011111011 -> 1111111100000100
-
-ddinv080 invert 1000000011111111 -> 111111100000000
-ddinv081 invert 0100000101111111 -> 1011111010000000
-ddinv082 invert 0010000110111111 -> 1101111001000000
-ddinv083 invert 0001000111011111 -> 1110111000100000
-ddinv084 invert 0000100111101111 -> 1111011000010000
-ddinv085 invert 0000010111110111 -> 1111101000001000
-ddinv086 invert 0000001111111011 -> 1111110000000100
-ddinv087 invert 0000010111111101 -> 1111101000000010
-ddinv088 invert 0000100111111110 -> 1111011000000001
-ddinv089 invert 0001000011111011 -> 1110111100000100
-ddinv090 invert 0010000101111101 -> 1101111010000010
-ddinv091 invert 0100000110111110 -> 1011111001000001
-ddinv092 invert 1000000111011101 -> 111111000100010
-ddinv093 invert 0100000111101011 -> 1011111000010100
-ddinv094 invert 0010000111110111 -> 1101111000001000
-ddinv095 invert 0001000111101011 -> 1110111000010100
-ddinv096 invert 0000100111011101 -> 1111011000100010
-ddinv097 invert 0000010110111110 -> 1111101001000001
-ddinv098 invert 0000001101111101 -> 1111110010000010
-ddinv099 invert 0000010011111011 -> 1111101100000100
-
--- non-0/1 should not be accepted, nor should signs
-ddinv220 invert 111111112 -> NaN Invalid_operation
-ddinv221 invert 333333333 -> NaN Invalid_operation
-ddinv222 invert 555555555 -> NaN Invalid_operation
-ddinv223 invert 777777777 -> NaN Invalid_operation
-ddinv224 invert 999999999 -> NaN Invalid_operation
-ddinv225 invert 222222222 -> NaN Invalid_operation
-ddinv226 invert 444444444 -> NaN Invalid_operation
-ddinv227 invert 666666666 -> NaN Invalid_operation
-ddinv228 invert 888888888 -> NaN Invalid_operation
-ddinv229 invert 999999999 -> NaN Invalid_operation
-ddinv230 invert 999999999 -> NaN Invalid_operation
-ddinv231 invert 999999999 -> NaN Invalid_operation
-ddinv232 invert 999999999 -> NaN Invalid_operation
--- a few randoms
-ddinv240 invert 567468689 -> NaN Invalid_operation
-ddinv241 invert 567367689 -> NaN Invalid_operation
-ddinv242 invert -631917772 -> NaN Invalid_operation
-ddinv243 invert -756253257 -> NaN Invalid_operation
-ddinv244 invert 835590149 -> NaN Invalid_operation
--- test MSD
-ddinv250 invert 2000000000000000 -> NaN Invalid_operation
-ddinv251 invert 3000000000000000 -> NaN Invalid_operation
-ddinv252 invert 4000000000000000 -> NaN Invalid_operation
-ddinv253 invert 5000000000000000 -> NaN Invalid_operation
-ddinv254 invert 6000000000000000 -> NaN Invalid_operation
-ddinv255 invert 7000000000000000 -> NaN Invalid_operation
-ddinv256 invert 8000000000000000 -> NaN Invalid_operation
-ddinv257 invert 9000000000000000 -> NaN Invalid_operation
--- test MSD-1
-ddinv270 invert 0200001000000000 -> NaN Invalid_operation
-ddinv271 invert 0300000100000000 -> NaN Invalid_operation
-ddinv272 invert 0400000010000000 -> NaN Invalid_operation
-ddinv273 invert 0500000001000000 -> NaN Invalid_operation
-ddinv274 invert 1600000000100000 -> NaN Invalid_operation
-ddinv275 invert 1700000000010000 -> NaN Invalid_operation
-ddinv276 invert 1800000000001000 -> NaN Invalid_operation
-ddinv277 invert 1900000000000100 -> NaN Invalid_operation
--- test LSD
-ddinv280 invert 0010000000000002 -> NaN Invalid_operation
-ddinv281 invert 0001000000000003 -> NaN Invalid_operation
-ddinv282 invert 0000100000000004 -> NaN Invalid_operation
-ddinv283 invert 0000010000000005 -> NaN Invalid_operation
-ddinv284 invert 1000001000000006 -> NaN Invalid_operation
-ddinv285 invert 1000000100000007 -> NaN Invalid_operation
-ddinv286 invert 1000000010000008 -> NaN Invalid_operation
-ddinv287 invert 1000000001000009 -> NaN Invalid_operation
--- test Middie
-ddinv288 invert 0010000020000000 -> NaN Invalid_operation
-ddinv289 invert 0001000030000001 -> NaN Invalid_operation
-ddinv290 invert 0000100040000010 -> NaN Invalid_operation
-ddinv291 invert 0000010050000100 -> NaN Invalid_operation
-ddinv292 invert 1000001060001000 -> NaN Invalid_operation
-ddinv293 invert 1000000170010000 -> NaN Invalid_operation
-ddinv294 invert 1000000080100000 -> NaN Invalid_operation
-ddinv295 invert 1000000091000000 -> NaN Invalid_operation
--- sign
-ddinv296 invert -1000000001000000 -> NaN Invalid_operation
-ddinv299 invert 1000000001000000 -> 111111110111111
-
-
--- Nmax, Nmin, Ntiny-like
-ddinv341 invert 9.99999999E+299 -> NaN Invalid_operation
-ddinv342 invert 1E-299 -> NaN Invalid_operation
-ddinv343 invert 1.00000000E-299 -> NaN Invalid_operation
-ddinv344 invert 1E-207 -> NaN Invalid_operation
-ddinv345 invert -1E-207 -> NaN Invalid_operation
-ddinv346 invert -1.00000000E-299 -> NaN Invalid_operation
-ddinv347 invert -1E-299 -> NaN Invalid_operation
-ddinv348 invert -9.99999999E+299 -> NaN Invalid_operation
-
--- A few other non-integers
-ddinv361 invert 1.0 -> NaN Invalid_operation
-ddinv362 invert 1E+1 -> NaN Invalid_operation
-ddinv363 invert 0.0 -> NaN Invalid_operation
-ddinv364 invert 0E+1 -> NaN Invalid_operation
-ddinv365 invert 9.9 -> NaN Invalid_operation
-ddinv366 invert 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-ddinv788 invert -Inf -> NaN Invalid_operation
-ddinv794 invert Inf -> NaN Invalid_operation
-ddinv821 invert NaN -> NaN Invalid_operation
-ddinv841 invert sNaN -> NaN Invalid_operation
--- propagating NaNs
-ddinv861 invert NaN1 -> NaN Invalid_operation
-ddinv862 invert +NaN2 -> NaN Invalid_operation
-ddinv863 invert NaN3 -> NaN Invalid_operation
-ddinv864 invert NaN4 -> NaN Invalid_operation
-ddinv865 invert NaN5 -> NaN Invalid_operation
-ddinv871 invert sNaN11 -> NaN Invalid_operation
-ddinv872 invert sNaN12 -> NaN Invalid_operation
-ddinv873 invert sNaN13 -> NaN Invalid_operation
-ddinv874 invert sNaN14 -> NaN Invalid_operation
-ddinv875 invert sNaN15 -> NaN Invalid_operation
-ddinv876 invert NaN16 -> NaN Invalid_operation
-ddinv881 invert +NaN25 -> NaN Invalid_operation
-ddinv882 invert -NaN26 -> NaN Invalid_operation
-ddinv883 invert -sNaN27 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddInvert.decTest -- digitwise logical INVERT for decDoubles --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check (truth table)
+ddinv001 invert 0 -> 1111111111111111
+ddinv002 invert 1 -> 1111111111111110
+ddinv003 invert 10 -> 1111111111111101
+ddinv004 invert 111111111 -> 1111111000000000
+ddinv005 invert 000000000 -> 1111111111111111
+-- and at msd and msd-1
+ddinv007 invert 0000000000000000 -> 1111111111111111
+ddinv008 invert 1000000000000000 -> 111111111111111
+ddinv009 invert 0000000000000000 -> 1111111111111111
+ddinv010 invert 0100000000000000 -> 1011111111111111
+ddinv011 invert 0111111111111111 -> 1000000000000000
+ddinv012 invert 1111111111111111 -> 0
+ddinv013 invert 0011111111111111 -> 1100000000000000
+ddinv014 invert 0111111111111111 -> 1000000000000000
+
+-- Various lengths
+-- 123456789 1234567890123456
+ddinv021 invert 111111111 -> 1111111000000000
+ddinv022 invert 111111111111 -> 1111000000000000
+ddinv023 invert 11111111 -> 1111111100000000
+ddinv025 invert 1111111 -> 1111111110000000
+ddinv026 invert 111111 -> 1111111111000000
+ddinv027 invert 11111 -> 1111111111100000
+ddinv028 invert 1111 -> 1111111111110000
+ddinv029 invert 111 -> 1111111111111000
+ddinv031 invert 11 -> 1111111111111100
+ddinv032 invert 1 -> 1111111111111110
+ddinv033 invert 111111111111 -> 1111000000000000
+ddinv034 invert 11111111111 -> 1111100000000000
+ddinv035 invert 1111111111 -> 1111110000000000
+ddinv036 invert 111111111 -> 1111111000000000
+
+ddinv040 invert 011111111 -> 1111111100000000
+ddinv041 invert 101111111 -> 1111111010000000
+ddinv042 invert 110111111 -> 1111111001000000
+ddinv043 invert 111011111 -> 1111111000100000
+ddinv044 invert 111101111 -> 1111111000010000
+ddinv045 invert 111110111 -> 1111111000001000
+ddinv046 invert 111111011 -> 1111111000000100
+ddinv047 invert 111111101 -> 1111111000000010
+ddinv048 invert 111111110 -> 1111111000000001
+ddinv049 invert 011111011 -> 1111111100000100
+ddinv050 invert 101111101 -> 1111111010000010
+ddinv051 invert 110111110 -> 1111111001000001
+ddinv052 invert 111011101 -> 1111111000100010
+ddinv053 invert 111101011 -> 1111111000010100
+ddinv054 invert 111110111 -> 1111111000001000
+ddinv055 invert 111101011 -> 1111111000010100
+ddinv056 invert 111011101 -> 1111111000100010
+ddinv057 invert 110111110 -> 1111111001000001
+ddinv058 invert 101111101 -> 1111111010000010
+ddinv059 invert 011111011 -> 1111111100000100
+
+ddinv080 invert 1000000011111111 -> 111111100000000
+ddinv081 invert 0100000101111111 -> 1011111010000000
+ddinv082 invert 0010000110111111 -> 1101111001000000
+ddinv083 invert 0001000111011111 -> 1110111000100000
+ddinv084 invert 0000100111101111 -> 1111011000010000
+ddinv085 invert 0000010111110111 -> 1111101000001000
+ddinv086 invert 0000001111111011 -> 1111110000000100
+ddinv087 invert 0000010111111101 -> 1111101000000010
+ddinv088 invert 0000100111111110 -> 1111011000000001
+ddinv089 invert 0001000011111011 -> 1110111100000100
+ddinv090 invert 0010000101111101 -> 1101111010000010
+ddinv091 invert 0100000110111110 -> 1011111001000001
+ddinv092 invert 1000000111011101 -> 111111000100010
+ddinv093 invert 0100000111101011 -> 1011111000010100
+ddinv094 invert 0010000111110111 -> 1101111000001000
+ddinv095 invert 0001000111101011 -> 1110111000010100
+ddinv096 invert 0000100111011101 -> 1111011000100010
+ddinv097 invert 0000010110111110 -> 1111101001000001
+ddinv098 invert 0000001101111101 -> 1111110010000010
+ddinv099 invert 0000010011111011 -> 1111101100000100
+
+-- non-0/1 should not be accepted, nor should signs
+ddinv220 invert 111111112 -> NaN Invalid_operation
+ddinv221 invert 333333333 -> NaN Invalid_operation
+ddinv222 invert 555555555 -> NaN Invalid_operation
+ddinv223 invert 777777777 -> NaN Invalid_operation
+ddinv224 invert 999999999 -> NaN Invalid_operation
+ddinv225 invert 222222222 -> NaN Invalid_operation
+ddinv226 invert 444444444 -> NaN Invalid_operation
+ddinv227 invert 666666666 -> NaN Invalid_operation
+ddinv228 invert 888888888 -> NaN Invalid_operation
+ddinv229 invert 999999999 -> NaN Invalid_operation
+ddinv230 invert 999999999 -> NaN Invalid_operation
+ddinv231 invert 999999999 -> NaN Invalid_operation
+ddinv232 invert 999999999 -> NaN Invalid_operation
+-- a few randoms
+ddinv240 invert 567468689 -> NaN Invalid_operation
+ddinv241 invert 567367689 -> NaN Invalid_operation
+ddinv242 invert -631917772 -> NaN Invalid_operation
+ddinv243 invert -756253257 -> NaN Invalid_operation
+ddinv244 invert 835590149 -> NaN Invalid_operation
+-- test MSD
+ddinv250 invert 2000000000000000 -> NaN Invalid_operation
+ddinv251 invert 3000000000000000 -> NaN Invalid_operation
+ddinv252 invert 4000000000000000 -> NaN Invalid_operation
+ddinv253 invert 5000000000000000 -> NaN Invalid_operation
+ddinv254 invert 6000000000000000 -> NaN Invalid_operation
+ddinv255 invert 7000000000000000 -> NaN Invalid_operation
+ddinv256 invert 8000000000000000 -> NaN Invalid_operation
+ddinv257 invert 9000000000000000 -> NaN Invalid_operation
+-- test MSD-1
+ddinv270 invert 0200001000000000 -> NaN Invalid_operation
+ddinv271 invert 0300000100000000 -> NaN Invalid_operation
+ddinv272 invert 0400000010000000 -> NaN Invalid_operation
+ddinv273 invert 0500000001000000 -> NaN Invalid_operation
+ddinv274 invert 1600000000100000 -> NaN Invalid_operation
+ddinv275 invert 1700000000010000 -> NaN Invalid_operation
+ddinv276 invert 1800000000001000 -> NaN Invalid_operation
+ddinv277 invert 1900000000000100 -> NaN Invalid_operation
+-- test LSD
+ddinv280 invert 0010000000000002 -> NaN Invalid_operation
+ddinv281 invert 0001000000000003 -> NaN Invalid_operation
+ddinv282 invert 0000100000000004 -> NaN Invalid_operation
+ddinv283 invert 0000010000000005 -> NaN Invalid_operation
+ddinv284 invert 1000001000000006 -> NaN Invalid_operation
+ddinv285 invert 1000000100000007 -> NaN Invalid_operation
+ddinv286 invert 1000000010000008 -> NaN Invalid_operation
+ddinv287 invert 1000000001000009 -> NaN Invalid_operation
+-- test Middie
+ddinv288 invert 0010000020000000 -> NaN Invalid_operation
+ddinv289 invert 0001000030000001 -> NaN Invalid_operation
+ddinv290 invert 0000100040000010 -> NaN Invalid_operation
+ddinv291 invert 0000010050000100 -> NaN Invalid_operation
+ddinv292 invert 1000001060001000 -> NaN Invalid_operation
+ddinv293 invert 1000000170010000 -> NaN Invalid_operation
+ddinv294 invert 1000000080100000 -> NaN Invalid_operation
+ddinv295 invert 1000000091000000 -> NaN Invalid_operation
+-- sign
+ddinv296 invert -1000000001000000 -> NaN Invalid_operation
+ddinv299 invert 1000000001000000 -> 111111110111111
+
+
+-- Nmax, Nmin, Ntiny-like
+ddinv341 invert 9.99999999E+299 -> NaN Invalid_operation
+ddinv342 invert 1E-299 -> NaN Invalid_operation
+ddinv343 invert 1.00000000E-299 -> NaN Invalid_operation
+ddinv344 invert 1E-207 -> NaN Invalid_operation
+ddinv345 invert -1E-207 -> NaN Invalid_operation
+ddinv346 invert -1.00000000E-299 -> NaN Invalid_operation
+ddinv347 invert -1E-299 -> NaN Invalid_operation
+ddinv348 invert -9.99999999E+299 -> NaN Invalid_operation
+
+-- A few other non-integers
+ddinv361 invert 1.0 -> NaN Invalid_operation
+ddinv362 invert 1E+1 -> NaN Invalid_operation
+ddinv363 invert 0.0 -> NaN Invalid_operation
+ddinv364 invert 0E+1 -> NaN Invalid_operation
+ddinv365 invert 9.9 -> NaN Invalid_operation
+ddinv366 invert 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+ddinv788 invert -Inf -> NaN Invalid_operation
+ddinv794 invert Inf -> NaN Invalid_operation
+ddinv821 invert NaN -> NaN Invalid_operation
+ddinv841 invert sNaN -> NaN Invalid_operation
+-- propagating NaNs
+ddinv861 invert NaN1 -> NaN Invalid_operation
+ddinv862 invert +NaN2 -> NaN Invalid_operation
+ddinv863 invert NaN3 -> NaN Invalid_operation
+ddinv864 invert NaN4 -> NaN Invalid_operation
+ddinv865 invert NaN5 -> NaN Invalid_operation
+ddinv871 invert sNaN11 -> NaN Invalid_operation
+ddinv872 invert sNaN12 -> NaN Invalid_operation
+ddinv873 invert sNaN13 -> NaN Invalid_operation
+ddinv874 invert sNaN14 -> NaN Invalid_operation
+ddinv875 invert sNaN15 -> NaN Invalid_operation
+ddinv876 invert NaN16 -> NaN Invalid_operation
+ddinv881 invert +NaN25 -> NaN Invalid_operation
+ddinv882 invert -NaN26 -> NaN Invalid_operation
+ddinv883 invert -sNaN27 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddLogB.decTest b/Lib/test/decimaltestdata/ddLogB.decTest
index de728e5968..00589b60c3 100644
--- a/Lib/test/decimaltestdata/ddLogB.decTest
+++ b/Lib/test/decimaltestdata/ddLogB.decTest
@@ -1,159 +1,159 @@
-------------------------------------------------------------------------
--- ddLogB.decTest -- integral 754r adjusted exponent, for decDoubles --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- basics
-ddlogb000 logb 0 -> -Infinity Division_by_zero
-ddlogb001 logb 1E-398 -> -398
-ddlogb002 logb 1E-383 -> -383
-ddlogb003 logb 0.001 -> -3
-ddlogb004 logb 0.03 -> -2
-ddlogb005 logb 1 -> 0
-ddlogb006 logb 2 -> 0
-ddlogb007 logb 2.5 -> 0
-ddlogb008 logb 2.500 -> 0
-ddlogb009 logb 10 -> 1
-ddlogb010 logb 70 -> 1
-ddlogb011 logb 100 -> 2
-ddlogb012 logb 333 -> 2
-ddlogb013 logb 9E+384 -> 384
-ddlogb014 logb +Infinity -> Infinity
-
--- negatives appear to be treated as positives
-ddlogb021 logb -0 -> -Infinity Division_by_zero
-ddlogb022 logb -1E-398 -> -398
-ddlogb023 logb -9E-383 -> -383
-ddlogb024 logb -0.001 -> -3
-ddlogb025 logb -1 -> 0
-ddlogb026 logb -2 -> 0
-ddlogb027 logb -10 -> 1
-ddlogb028 logb -70 -> 1
-ddlogb029 logb -100 -> 2
-ddlogb030 logb -9E+384 -> 384
-ddlogb031 logb -Infinity -> Infinity
-
--- zeros
-ddlogb111 logb 0 -> -Infinity Division_by_zero
-ddlogb112 logb -0 -> -Infinity Division_by_zero
-ddlogb113 logb 0E+4 -> -Infinity Division_by_zero
-ddlogb114 logb -0E+4 -> -Infinity Division_by_zero
-ddlogb115 logb 0.0000 -> -Infinity Division_by_zero
-ddlogb116 logb -0.0000 -> -Infinity Division_by_zero
-ddlogb117 logb 0E-141 -> -Infinity Division_by_zero
-ddlogb118 logb -0E-141 -> -Infinity Division_by_zero
-
--- full coefficients, alternating bits
-ddlogb121 logb 268268268 -> 8
-ddlogb122 logb -268268268 -> 8
-ddlogb123 logb 134134134 -> 8
-ddlogb124 logb -134134134 -> 8
-
--- Nmax, Nmin, Ntiny
-ddlogb131 logb 9.999999999999999E+384 -> 384
-ddlogb132 logb 1E-383 -> -383
-ddlogb133 logb 1.000000000000000E-383 -> -383
-ddlogb134 logb 1E-398 -> -398
-
-ddlogb135 logb -1E-398 -> -398
-ddlogb136 logb -1.000000000000000E-383 -> -383
-ddlogb137 logb -1E-383 -> -383
-ddlogb138 logb -9.999999999999999E+384 -> 384
-
--- ones
-ddlogb0061 logb 1 -> 0
-ddlogb0062 logb 1.0 -> 0
-ddlogb0063 logb 1.000000000000000 -> 0
-
--- notable cases -- exact powers of 10
-ddlogb1100 logb 1 -> 0
-ddlogb1101 logb 10 -> 1
-ddlogb1102 logb 100 -> 2
-ddlogb1103 logb 1000 -> 3
-ddlogb1104 logb 10000 -> 4
-ddlogb1105 logb 100000 -> 5
-ddlogb1106 logb 1000000 -> 6
-ddlogb1107 logb 10000000 -> 7
-ddlogb1108 logb 100000000 -> 8
-ddlogb1109 logb 1000000000 -> 9
-ddlogb1110 logb 10000000000 -> 10
-ddlogb1111 logb 100000000000 -> 11
-ddlogb1112 logb 1000000000000 -> 12
-ddlogb1113 logb 0.00000000001 -> -11
-ddlogb1114 logb 0.0000000001 -> -10
-ddlogb1115 logb 0.000000001 -> -9
-ddlogb1116 logb 0.00000001 -> -8
-ddlogb1117 logb 0.0000001 -> -7
-ddlogb1118 logb 0.000001 -> -6
-ddlogb1119 logb 0.00001 -> -5
-ddlogb1120 logb 0.0001 -> -4
-ddlogb1121 logb 0.001 -> -3
-ddlogb1122 logb 0.01 -> -2
-ddlogb1123 logb 0.1 -> -1
-ddlogb1124 logb 1E-99 -> -99
-ddlogb1125 logb 1E-100 -> -100
-ddlogb1127 logb 1E-299 -> -299
-ddlogb1126 logb 1E-383 -> -383
-
--- suggestions from Ilan Nehama
-ddlogb1400 logb 10E-3 -> -2
-ddlogb1401 logb 10E-2 -> -1
-ddlogb1402 logb 100E-2 -> 0
-ddlogb1403 logb 1000E-2 -> 1
-ddlogb1404 logb 10000E-2 -> 2
-ddlogb1405 logb 10E-1 -> 0
-ddlogb1406 logb 100E-1 -> 1
-ddlogb1407 logb 1000E-1 -> 2
-ddlogb1408 logb 10000E-1 -> 3
-ddlogb1409 logb 10E0 -> 1
-ddlogb1410 logb 100E0 -> 2
-ddlogb1411 logb 1000E0 -> 3
-ddlogb1412 logb 10000E0 -> 4
-ddlogb1413 logb 10E1 -> 2
-ddlogb1414 logb 100E1 -> 3
-ddlogb1415 logb 1000E1 -> 4
-ddlogb1416 logb 10000E1 -> 5
-ddlogb1417 logb 10E2 -> 3
-ddlogb1418 logb 100E2 -> 4
-ddlogb1419 logb 1000E2 -> 5
-ddlogb1420 logb 10000E2 -> 6
-
--- special values
-ddlogb820 logb Infinity -> Infinity
-ddlogb821 logb 0 -> -Infinity Division_by_zero
-ddlogb822 logb NaN -> NaN
-ddlogb823 logb sNaN -> NaN Invalid_operation
--- propagating NaNs
-ddlogb824 logb sNaN123 -> NaN123 Invalid_operation
-ddlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
-ddlogb826 logb NaN456 -> NaN456
-ddlogb827 logb -NaN654 -> -NaN654
-ddlogb828 logb NaN1 -> NaN1
-
--- Null test
-ddlogb900 logb # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- ddLogB.decTest -- integral 754r adjusted exponent, for decDoubles --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- basics
+ddlogb000 logb 0 -> -Infinity Division_by_zero
+ddlogb001 logb 1E-398 -> -398
+ddlogb002 logb 1E-383 -> -383
+ddlogb003 logb 0.001 -> -3
+ddlogb004 logb 0.03 -> -2
+ddlogb005 logb 1 -> 0
+ddlogb006 logb 2 -> 0
+ddlogb007 logb 2.5 -> 0
+ddlogb008 logb 2.500 -> 0
+ddlogb009 logb 10 -> 1
+ddlogb010 logb 70 -> 1
+ddlogb011 logb 100 -> 2
+ddlogb012 logb 333 -> 2
+ddlogb013 logb 9E+384 -> 384
+ddlogb014 logb +Infinity -> Infinity
+
+-- negatives appear to be treated as positives
+ddlogb021 logb -0 -> -Infinity Division_by_zero
+ddlogb022 logb -1E-398 -> -398
+ddlogb023 logb -9E-383 -> -383
+ddlogb024 logb -0.001 -> -3
+ddlogb025 logb -1 -> 0
+ddlogb026 logb -2 -> 0
+ddlogb027 logb -10 -> 1
+ddlogb028 logb -70 -> 1
+ddlogb029 logb -100 -> 2
+ddlogb030 logb -9E+384 -> 384
+ddlogb031 logb -Infinity -> Infinity
+
+-- zeros
+ddlogb111 logb 0 -> -Infinity Division_by_zero
+ddlogb112 logb -0 -> -Infinity Division_by_zero
+ddlogb113 logb 0E+4 -> -Infinity Division_by_zero
+ddlogb114 logb -0E+4 -> -Infinity Division_by_zero
+ddlogb115 logb 0.0000 -> -Infinity Division_by_zero
+ddlogb116 logb -0.0000 -> -Infinity Division_by_zero
+ddlogb117 logb 0E-141 -> -Infinity Division_by_zero
+ddlogb118 logb -0E-141 -> -Infinity Division_by_zero
+
+-- full coefficients, alternating bits
+ddlogb121 logb 268268268 -> 8
+ddlogb122 logb -268268268 -> 8
+ddlogb123 logb 134134134 -> 8
+ddlogb124 logb -134134134 -> 8
+
+-- Nmax, Nmin, Ntiny
+ddlogb131 logb 9.999999999999999E+384 -> 384
+ddlogb132 logb 1E-383 -> -383
+ddlogb133 logb 1.000000000000000E-383 -> -383
+ddlogb134 logb 1E-398 -> -398
+
+ddlogb135 logb -1E-398 -> -398
+ddlogb136 logb -1.000000000000000E-383 -> -383
+ddlogb137 logb -1E-383 -> -383
+ddlogb138 logb -9.999999999999999E+384 -> 384
+
+-- ones
+ddlogb0061 logb 1 -> 0
+ddlogb0062 logb 1.0 -> 0
+ddlogb0063 logb 1.000000000000000 -> 0
+
+-- notable cases -- exact powers of 10
+ddlogb1100 logb 1 -> 0
+ddlogb1101 logb 10 -> 1
+ddlogb1102 logb 100 -> 2
+ddlogb1103 logb 1000 -> 3
+ddlogb1104 logb 10000 -> 4
+ddlogb1105 logb 100000 -> 5
+ddlogb1106 logb 1000000 -> 6
+ddlogb1107 logb 10000000 -> 7
+ddlogb1108 logb 100000000 -> 8
+ddlogb1109 logb 1000000000 -> 9
+ddlogb1110 logb 10000000000 -> 10
+ddlogb1111 logb 100000000000 -> 11
+ddlogb1112 logb 1000000000000 -> 12
+ddlogb1113 logb 0.00000000001 -> -11
+ddlogb1114 logb 0.0000000001 -> -10
+ddlogb1115 logb 0.000000001 -> -9
+ddlogb1116 logb 0.00000001 -> -8
+ddlogb1117 logb 0.0000001 -> -7
+ddlogb1118 logb 0.000001 -> -6
+ddlogb1119 logb 0.00001 -> -5
+ddlogb1120 logb 0.0001 -> -4
+ddlogb1121 logb 0.001 -> -3
+ddlogb1122 logb 0.01 -> -2
+ddlogb1123 logb 0.1 -> -1
+ddlogb1124 logb 1E-99 -> -99
+ddlogb1125 logb 1E-100 -> -100
+ddlogb1127 logb 1E-299 -> -299
+ddlogb1126 logb 1E-383 -> -383
+
+-- suggestions from Ilan Nehama
+ddlogb1400 logb 10E-3 -> -2
+ddlogb1401 logb 10E-2 -> -1
+ddlogb1402 logb 100E-2 -> 0
+ddlogb1403 logb 1000E-2 -> 1
+ddlogb1404 logb 10000E-2 -> 2
+ddlogb1405 logb 10E-1 -> 0
+ddlogb1406 logb 100E-1 -> 1
+ddlogb1407 logb 1000E-1 -> 2
+ddlogb1408 logb 10000E-1 -> 3
+ddlogb1409 logb 10E0 -> 1
+ddlogb1410 logb 100E0 -> 2
+ddlogb1411 logb 1000E0 -> 3
+ddlogb1412 logb 10000E0 -> 4
+ddlogb1413 logb 10E1 -> 2
+ddlogb1414 logb 100E1 -> 3
+ddlogb1415 logb 1000E1 -> 4
+ddlogb1416 logb 10000E1 -> 5
+ddlogb1417 logb 10E2 -> 3
+ddlogb1418 logb 100E2 -> 4
+ddlogb1419 logb 1000E2 -> 5
+ddlogb1420 logb 10000E2 -> 6
+
+-- special values
+ddlogb820 logb Infinity -> Infinity
+ddlogb821 logb 0 -> -Infinity Division_by_zero
+ddlogb822 logb NaN -> NaN
+ddlogb823 logb sNaN -> NaN Invalid_operation
+-- propagating NaNs
+ddlogb824 logb sNaN123 -> NaN123 Invalid_operation
+ddlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
+ddlogb826 logb NaN456 -> NaN456
+ddlogb827 logb -NaN654 -> -NaN654
+ddlogb828 logb NaN1 -> NaN1
+
+-- Null test
+ddlogb900 logb # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/ddMax.decTest b/Lib/test/decimaltestdata/ddMax.decTest
index 1ac63958b8..45ea9b4c93 100644
--- a/Lib/test/decimaltestdata/ddMax.decTest
+++ b/Lib/test/decimaltestdata/ddMax.decTest
@@ -1,322 +1,322 @@
-------------------------------------------------------------------------
--- ddMax.decTest -- decDouble maxnum --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmax001 max -2 -2 -> -2
-ddmax002 max -2 -1 -> -1
-ddmax003 max -2 0 -> 0
-ddmax004 max -2 1 -> 1
-ddmax005 max -2 2 -> 2
-ddmax006 max -1 -2 -> -1
-ddmax007 max -1 -1 -> -1
-ddmax008 max -1 0 -> 0
-ddmax009 max -1 1 -> 1
-ddmax010 max -1 2 -> 2
-ddmax011 max 0 -2 -> 0
-ddmax012 max 0 -1 -> 0
-ddmax013 max 0 0 -> 0
-ddmax014 max 0 1 -> 1
-ddmax015 max 0 2 -> 2
-ddmax016 max 1 -2 -> 1
-ddmax017 max 1 -1 -> 1
-ddmax018 max 1 0 -> 1
-ddmax019 max 1 1 -> 1
-ddmax020 max 1 2 -> 2
-ddmax021 max 2 -2 -> 2
-ddmax022 max 2 -1 -> 2
-ddmax023 max 2 0 -> 2
-ddmax025 max 2 1 -> 2
-ddmax026 max 2 2 -> 2
-
--- extended zeros
-ddmax030 max 0 0 -> 0
-ddmax031 max 0 -0 -> 0
-ddmax032 max 0 -0.0 -> 0
-ddmax033 max 0 0.0 -> 0
-ddmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-ddmax035 max -0 -0 -> -0
-ddmax036 max -0 -0.0 -> -0.0
-ddmax037 max -0 0.0 -> 0.0
-ddmax038 max 0.0 0 -> 0
-ddmax039 max 0.0 -0 -> 0.0
-ddmax040 max 0.0 -0.0 -> 0.0
-ddmax041 max 0.0 0.0 -> 0.0
-ddmax042 max -0.0 0 -> 0
-ddmax043 max -0.0 -0 -> -0.0
-ddmax044 max -0.0 -0.0 -> -0.0
-ddmax045 max -0.0 0.0 -> 0.0
-
-ddmax050 max -0E1 0E1 -> 0E+1
-ddmax051 max -0E2 0E2 -> 0E+2
-ddmax052 max -0E2 0E1 -> 0E+1
-ddmax053 max -0E1 0E2 -> 0E+2
-ddmax054 max 0E1 -0E1 -> 0E+1
-ddmax055 max 0E2 -0E2 -> 0E+2
-ddmax056 max 0E2 -0E1 -> 0E+2
-ddmax057 max 0E1 -0E2 -> 0E+1
-
-ddmax058 max 0E1 0E1 -> 0E+1
-ddmax059 max 0E2 0E2 -> 0E+2
-ddmax060 max 0E2 0E1 -> 0E+2
-ddmax061 max 0E1 0E2 -> 0E+2
-ddmax062 max -0E1 -0E1 -> -0E+1
-ddmax063 max -0E2 -0E2 -> -0E+2
-ddmax064 max -0E2 -0E1 -> -0E+1
-ddmax065 max -0E1 -0E2 -> -0E+1
-
--- Specials
-ddmax090 max Inf -Inf -> Infinity
-ddmax091 max Inf -1000 -> Infinity
-ddmax092 max Inf -1 -> Infinity
-ddmax093 max Inf -0 -> Infinity
-ddmax094 max Inf 0 -> Infinity
-ddmax095 max Inf 1 -> Infinity
-ddmax096 max Inf 1000 -> Infinity
-ddmax097 max Inf Inf -> Infinity
-ddmax098 max -1000 Inf -> Infinity
-ddmax099 max -Inf Inf -> Infinity
-ddmax100 max -1 Inf -> Infinity
-ddmax101 max -0 Inf -> Infinity
-ddmax102 max 0 Inf -> Infinity
-ddmax103 max 1 Inf -> Infinity
-ddmax104 max 1000 Inf -> Infinity
-ddmax105 max Inf Inf -> Infinity
-
-ddmax120 max -Inf -Inf -> -Infinity
-ddmax121 max -Inf -1000 -> -1000
-ddmax122 max -Inf -1 -> -1
-ddmax123 max -Inf -0 -> -0
-ddmax124 max -Inf 0 -> 0
-ddmax125 max -Inf 1 -> 1
-ddmax126 max -Inf 1000 -> 1000
-ddmax127 max -Inf Inf -> Infinity
-ddmax128 max -Inf -Inf -> -Infinity
-ddmax129 max -1000 -Inf -> -1000
-ddmax130 max -1 -Inf -> -1
-ddmax131 max -0 -Inf -> -0
-ddmax132 max 0 -Inf -> 0
-ddmax133 max 1 -Inf -> 1
-ddmax134 max 1000 -Inf -> 1000
-ddmax135 max Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-ddmax141 max NaN -Inf -> -Infinity
-ddmax142 max NaN -1000 -> -1000
-ddmax143 max NaN -1 -> -1
-ddmax144 max NaN -0 -> -0
-ddmax145 max NaN 0 -> 0
-ddmax146 max NaN 1 -> 1
-ddmax147 max NaN 1000 -> 1000
-ddmax148 max NaN Inf -> Infinity
-ddmax149 max NaN NaN -> NaN
-ddmax150 max -Inf NaN -> -Infinity
-ddmax151 max -1000 NaN -> -1000
-ddmax152 max -1 NaN -> -1
-ddmax153 max -0 NaN -> -0
-ddmax154 max 0 NaN -> 0
-ddmax155 max 1 NaN -> 1
-ddmax156 max 1000 NaN -> 1000
-ddmax157 max Inf NaN -> Infinity
-
-ddmax161 max sNaN -Inf -> NaN Invalid_operation
-ddmax162 max sNaN -1000 -> NaN Invalid_operation
-ddmax163 max sNaN -1 -> NaN Invalid_operation
-ddmax164 max sNaN -0 -> NaN Invalid_operation
-ddmax165 max sNaN 0 -> NaN Invalid_operation
-ddmax166 max sNaN 1 -> NaN Invalid_operation
-ddmax167 max sNaN 1000 -> NaN Invalid_operation
-ddmax168 max sNaN NaN -> NaN Invalid_operation
-ddmax169 max sNaN sNaN -> NaN Invalid_operation
-ddmax170 max NaN sNaN -> NaN Invalid_operation
-ddmax171 max -Inf sNaN -> NaN Invalid_operation
-ddmax172 max -1000 sNaN -> NaN Invalid_operation
-ddmax173 max -1 sNaN -> NaN Invalid_operation
-ddmax174 max -0 sNaN -> NaN Invalid_operation
-ddmax175 max 0 sNaN -> NaN Invalid_operation
-ddmax176 max 1 sNaN -> NaN Invalid_operation
-ddmax177 max 1000 sNaN -> NaN Invalid_operation
-ddmax178 max Inf sNaN -> NaN Invalid_operation
-ddmax179 max NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmax181 max NaN9 -Inf -> -Infinity
-ddmax182 max NaN8 9 -> 9
-ddmax183 max -NaN7 Inf -> Infinity
-
-ddmax184 max -NaN1 NaN11 -> -NaN1
-ddmax185 max NaN2 NaN12 -> NaN2
-ddmax186 max -NaN13 -NaN7 -> -NaN13
-ddmax187 max NaN14 -NaN5 -> NaN14
-
-ddmax188 max -Inf NaN4 -> -Infinity
-ddmax189 max -9 -NaN3 -> -9
-ddmax190 max Inf NaN2 -> Infinity
-
-ddmax191 max sNaN99 -Inf -> NaN99 Invalid_operation
-ddmax192 max sNaN98 -1 -> NaN98 Invalid_operation
-ddmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation
-ddmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
-ddmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmax196 max -Inf sNaN92 -> NaN92 Invalid_operation
-ddmax197 max 0 sNaN91 -> NaN91 Invalid_operation
-ddmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmax199 max NaN sNaN89 -> NaN89 Invalid_operation
-
--- old rounding checks
-ddmax221 max 12345678000 1 -> 12345678000
-ddmax222 max 1 12345678000 -> 12345678000
-ddmax223 max 1234567800 1 -> 1234567800
-ddmax224 max 1 1234567800 -> 1234567800
-ddmax225 max 1234567890 1 -> 1234567890
-ddmax226 max 1 1234567890 -> 1234567890
-ddmax227 max 1234567891 1 -> 1234567891
-ddmax228 max 1 1234567891 -> 1234567891
-ddmax229 max 12345678901 1 -> 12345678901
-ddmax230 max 1 12345678901 -> 12345678901
-ddmax231 max 1234567896 1 -> 1234567896
-ddmax232 max 1 1234567896 -> 1234567896
-ddmax233 max -1234567891 1 -> 1
-ddmax234 max 1 -1234567891 -> 1
-ddmax235 max -12345678901 1 -> 1
-ddmax236 max 1 -12345678901 -> 1
-ddmax237 max -1234567896 1 -> 1
-ddmax238 max 1 -1234567896 -> 1
-
--- from examples
-ddmax280 max '3' '2' -> '3'
-ddmax281 max '-10' '3' -> '3'
-ddmax282 max '1.0' '1' -> '1'
-ddmax283 max '1' '1.0' -> '1'
-ddmax284 max '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-ddmax401 max Inf 1.1 -> Infinity
-ddmax402 max 1.1 1 -> 1.1
-ddmax403 max 1 1.0 -> 1
-ddmax404 max 1.0 0.1 -> 1.0
-ddmax405 max 0.1 0.10 -> 0.1
-ddmax406 max 0.10 0.100 -> 0.10
-ddmax407 max 0.10 0 -> 0.10
-ddmax408 max 0 0.0 -> 0
-ddmax409 max 0.0 -0 -> 0.0
-ddmax410 max 0.0 -0.0 -> 0.0
-ddmax411 max 0.00 -0.0 -> 0.00
-ddmax412 max 0.0 -0.00 -> 0.0
-ddmax413 max 0 -0.0 -> 0
-ddmax414 max 0 -0 -> 0
-ddmax415 max -0.0 -0 -> -0.0
-ddmax416 max -0 -0.100 -> -0
-ddmax417 max -0.100 -0.10 -> -0.100
-ddmax418 max -0.10 -0.1 -> -0.10
-ddmax419 max -0.1 -1.0 -> -0.1
-ddmax420 max -1.0 -1 -> -1.0
-ddmax421 max -1 -1.1 -> -1
-ddmax423 max -1.1 -Inf -> -1.1
--- same with operands reversed
-ddmax431 max 1.1 Inf -> Infinity
-ddmax432 max 1 1.1 -> 1.1
-ddmax433 max 1.0 1 -> 1
-ddmax434 max 0.1 1.0 -> 1.0
-ddmax435 max 0.10 0.1 -> 0.1
-ddmax436 max 0.100 0.10 -> 0.10
-ddmax437 max 0 0.10 -> 0.10
-ddmax438 max 0.0 0 -> 0
-ddmax439 max -0 0.0 -> 0.0
-ddmax440 max -0.0 0.0 -> 0.0
-ddmax441 max -0.0 0.00 -> 0.00
-ddmax442 max -0.00 0.0 -> 0.0
-ddmax443 max -0.0 0 -> 0
-ddmax444 max -0 0 -> 0
-ddmax445 max -0 -0.0 -> -0.0
-ddmax446 max -0.100 -0 -> -0
-ddmax447 max -0.10 -0.100 -> -0.100
-ddmax448 max -0.1 -0.10 -> -0.10
-ddmax449 max -1.0 -0.1 -> -0.1
-ddmax450 max -1 -1.0 -> -1.0
-ddmax451 max -1.1 -1 -> -1
-ddmax453 max -Inf -1.1 -> -1.1
--- largies
-ddmax460 max 1000 1E+3 -> 1E+3
-ddmax461 max 1E+3 1000 -> 1E+3
-ddmax462 max 1000 -1E+3 -> 1000
-ddmax463 max 1E+3 -1000 -> 1E+3
-ddmax464 max -1000 1E+3 -> 1E+3
-ddmax465 max -1E+3 1000 -> 1000
-ddmax466 max -1000 -1E+3 -> -1000
-ddmax467 max -1E+3 -1000 -> -1000
-
--- misalignment traps for little-endian
-ddmax471 max 1.0 0.1 -> 1.0
-ddmax472 max 0.1 1.0 -> 1.0
-ddmax473 max 10.0 0.1 -> 10.0
-ddmax474 max 0.1 10.0 -> 10.0
-ddmax475 max 100 1.0 -> 100
-ddmax476 max 1.0 100 -> 100
-ddmax477 max 1000 10.0 -> 1000
-ddmax478 max 10.0 1000 -> 1000
-ddmax479 max 10000 100.0 -> 10000
-ddmax480 max 100.0 10000 -> 10000
-ddmax481 max 100000 1000.0 -> 100000
-ddmax482 max 1000.0 100000 -> 100000
-ddmax483 max 1000000 10000.0 -> 1000000
-ddmax484 max 10000.0 1000000 -> 1000000
-
--- subnormals
-ddmax510 max 1.00E-383 0 -> 1.00E-383
-ddmax511 max 0.1E-383 0 -> 1E-384 Subnormal
-ddmax512 max 0.10E-383 0 -> 1.0E-384 Subnormal
-ddmax513 max 0.100E-383 0 -> 1.00E-384 Subnormal
-ddmax514 max 0.01E-383 0 -> 1E-385 Subnormal
-ddmax515 max 0.999E-383 0 -> 9.99E-384 Subnormal
-ddmax516 max 0.099E-383 0 -> 9.9E-385 Subnormal
-ddmax517 max 0.009E-383 0 -> 9E-386 Subnormal
-ddmax518 max 0.001E-383 0 -> 1E-386 Subnormal
-ddmax519 max 0.0009E-383 0 -> 9E-387 Subnormal
-ddmax520 max 0.0001E-383 0 -> 1E-387 Subnormal
-
-ddmax530 max -1.00E-383 0 -> 0
-ddmax531 max -0.1E-383 0 -> 0
-ddmax532 max -0.10E-383 0 -> 0
-ddmax533 max -0.100E-383 0 -> 0
-ddmax534 max -0.01E-383 0 -> 0
-ddmax535 max -0.999E-383 0 -> 0
-ddmax536 max -0.099E-383 0 -> 0
-ddmax537 max -0.009E-383 0 -> 0
-ddmax538 max -0.001E-383 0 -> 0
-ddmax539 max -0.0009E-383 0 -> 0
-ddmax540 max -0.0001E-383 0 -> 0
-
--- Null tests
-ddmax900 max 10 # -> NaN Invalid_operation
-ddmax901 max # 10 -> NaN Invalid_operation
-
-
-
+------------------------------------------------------------------------
+-- ddMax.decTest -- decDouble maxnum --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmax001 max -2 -2 -> -2
+ddmax002 max -2 -1 -> -1
+ddmax003 max -2 0 -> 0
+ddmax004 max -2 1 -> 1
+ddmax005 max -2 2 -> 2
+ddmax006 max -1 -2 -> -1
+ddmax007 max -1 -1 -> -1
+ddmax008 max -1 0 -> 0
+ddmax009 max -1 1 -> 1
+ddmax010 max -1 2 -> 2
+ddmax011 max 0 -2 -> 0
+ddmax012 max 0 -1 -> 0
+ddmax013 max 0 0 -> 0
+ddmax014 max 0 1 -> 1
+ddmax015 max 0 2 -> 2
+ddmax016 max 1 -2 -> 1
+ddmax017 max 1 -1 -> 1
+ddmax018 max 1 0 -> 1
+ddmax019 max 1 1 -> 1
+ddmax020 max 1 2 -> 2
+ddmax021 max 2 -2 -> 2
+ddmax022 max 2 -1 -> 2
+ddmax023 max 2 0 -> 2
+ddmax025 max 2 1 -> 2
+ddmax026 max 2 2 -> 2
+
+-- extended zeros
+ddmax030 max 0 0 -> 0
+ddmax031 max 0 -0 -> 0
+ddmax032 max 0 -0.0 -> 0
+ddmax033 max 0 0.0 -> 0
+ddmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+ddmax035 max -0 -0 -> -0
+ddmax036 max -0 -0.0 -> -0.0
+ddmax037 max -0 0.0 -> 0.0
+ddmax038 max 0.0 0 -> 0
+ddmax039 max 0.0 -0 -> 0.0
+ddmax040 max 0.0 -0.0 -> 0.0
+ddmax041 max 0.0 0.0 -> 0.0
+ddmax042 max -0.0 0 -> 0
+ddmax043 max -0.0 -0 -> -0.0
+ddmax044 max -0.0 -0.0 -> -0.0
+ddmax045 max -0.0 0.0 -> 0.0
+
+ddmax050 max -0E1 0E1 -> 0E+1
+ddmax051 max -0E2 0E2 -> 0E+2
+ddmax052 max -0E2 0E1 -> 0E+1
+ddmax053 max -0E1 0E2 -> 0E+2
+ddmax054 max 0E1 -0E1 -> 0E+1
+ddmax055 max 0E2 -0E2 -> 0E+2
+ddmax056 max 0E2 -0E1 -> 0E+2
+ddmax057 max 0E1 -0E2 -> 0E+1
+
+ddmax058 max 0E1 0E1 -> 0E+1
+ddmax059 max 0E2 0E2 -> 0E+2
+ddmax060 max 0E2 0E1 -> 0E+2
+ddmax061 max 0E1 0E2 -> 0E+2
+ddmax062 max -0E1 -0E1 -> -0E+1
+ddmax063 max -0E2 -0E2 -> -0E+2
+ddmax064 max -0E2 -0E1 -> -0E+1
+ddmax065 max -0E1 -0E2 -> -0E+1
+
+-- Specials
+ddmax090 max Inf -Inf -> Infinity
+ddmax091 max Inf -1000 -> Infinity
+ddmax092 max Inf -1 -> Infinity
+ddmax093 max Inf -0 -> Infinity
+ddmax094 max Inf 0 -> Infinity
+ddmax095 max Inf 1 -> Infinity
+ddmax096 max Inf 1000 -> Infinity
+ddmax097 max Inf Inf -> Infinity
+ddmax098 max -1000 Inf -> Infinity
+ddmax099 max -Inf Inf -> Infinity
+ddmax100 max -1 Inf -> Infinity
+ddmax101 max -0 Inf -> Infinity
+ddmax102 max 0 Inf -> Infinity
+ddmax103 max 1 Inf -> Infinity
+ddmax104 max 1000 Inf -> Infinity
+ddmax105 max Inf Inf -> Infinity
+
+ddmax120 max -Inf -Inf -> -Infinity
+ddmax121 max -Inf -1000 -> -1000
+ddmax122 max -Inf -1 -> -1
+ddmax123 max -Inf -0 -> -0
+ddmax124 max -Inf 0 -> 0
+ddmax125 max -Inf 1 -> 1
+ddmax126 max -Inf 1000 -> 1000
+ddmax127 max -Inf Inf -> Infinity
+ddmax128 max -Inf -Inf -> -Infinity
+ddmax129 max -1000 -Inf -> -1000
+ddmax130 max -1 -Inf -> -1
+ddmax131 max -0 -Inf -> -0
+ddmax132 max 0 -Inf -> 0
+ddmax133 max 1 -Inf -> 1
+ddmax134 max 1000 -Inf -> 1000
+ddmax135 max Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+ddmax141 max NaN -Inf -> -Infinity
+ddmax142 max NaN -1000 -> -1000
+ddmax143 max NaN -1 -> -1
+ddmax144 max NaN -0 -> -0
+ddmax145 max NaN 0 -> 0
+ddmax146 max NaN 1 -> 1
+ddmax147 max NaN 1000 -> 1000
+ddmax148 max NaN Inf -> Infinity
+ddmax149 max NaN NaN -> NaN
+ddmax150 max -Inf NaN -> -Infinity
+ddmax151 max -1000 NaN -> -1000
+ddmax152 max -1 NaN -> -1
+ddmax153 max -0 NaN -> -0
+ddmax154 max 0 NaN -> 0
+ddmax155 max 1 NaN -> 1
+ddmax156 max 1000 NaN -> 1000
+ddmax157 max Inf NaN -> Infinity
+
+ddmax161 max sNaN -Inf -> NaN Invalid_operation
+ddmax162 max sNaN -1000 -> NaN Invalid_operation
+ddmax163 max sNaN -1 -> NaN Invalid_operation
+ddmax164 max sNaN -0 -> NaN Invalid_operation
+ddmax165 max sNaN 0 -> NaN Invalid_operation
+ddmax166 max sNaN 1 -> NaN Invalid_operation
+ddmax167 max sNaN 1000 -> NaN Invalid_operation
+ddmax168 max sNaN NaN -> NaN Invalid_operation
+ddmax169 max sNaN sNaN -> NaN Invalid_operation
+ddmax170 max NaN sNaN -> NaN Invalid_operation
+ddmax171 max -Inf sNaN -> NaN Invalid_operation
+ddmax172 max -1000 sNaN -> NaN Invalid_operation
+ddmax173 max -1 sNaN -> NaN Invalid_operation
+ddmax174 max -0 sNaN -> NaN Invalid_operation
+ddmax175 max 0 sNaN -> NaN Invalid_operation
+ddmax176 max 1 sNaN -> NaN Invalid_operation
+ddmax177 max 1000 sNaN -> NaN Invalid_operation
+ddmax178 max Inf sNaN -> NaN Invalid_operation
+ddmax179 max NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmax181 max NaN9 -Inf -> -Infinity
+ddmax182 max NaN8 9 -> 9
+ddmax183 max -NaN7 Inf -> Infinity
+
+ddmax184 max -NaN1 NaN11 -> -NaN1
+ddmax185 max NaN2 NaN12 -> NaN2
+ddmax186 max -NaN13 -NaN7 -> -NaN13
+ddmax187 max NaN14 -NaN5 -> NaN14
+
+ddmax188 max -Inf NaN4 -> -Infinity
+ddmax189 max -9 -NaN3 -> -9
+ddmax190 max Inf NaN2 -> Infinity
+
+ddmax191 max sNaN99 -Inf -> NaN99 Invalid_operation
+ddmax192 max sNaN98 -1 -> NaN98 Invalid_operation
+ddmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation
+ddmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
+ddmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmax196 max -Inf sNaN92 -> NaN92 Invalid_operation
+ddmax197 max 0 sNaN91 -> NaN91 Invalid_operation
+ddmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmax199 max NaN sNaN89 -> NaN89 Invalid_operation
+
+-- old rounding checks
+ddmax221 max 12345678000 1 -> 12345678000
+ddmax222 max 1 12345678000 -> 12345678000
+ddmax223 max 1234567800 1 -> 1234567800
+ddmax224 max 1 1234567800 -> 1234567800
+ddmax225 max 1234567890 1 -> 1234567890
+ddmax226 max 1 1234567890 -> 1234567890
+ddmax227 max 1234567891 1 -> 1234567891
+ddmax228 max 1 1234567891 -> 1234567891
+ddmax229 max 12345678901 1 -> 12345678901
+ddmax230 max 1 12345678901 -> 12345678901
+ddmax231 max 1234567896 1 -> 1234567896
+ddmax232 max 1 1234567896 -> 1234567896
+ddmax233 max -1234567891 1 -> 1
+ddmax234 max 1 -1234567891 -> 1
+ddmax235 max -12345678901 1 -> 1
+ddmax236 max 1 -12345678901 -> 1
+ddmax237 max -1234567896 1 -> 1
+ddmax238 max 1 -1234567896 -> 1
+
+-- from examples
+ddmax280 max '3' '2' -> '3'
+ddmax281 max '-10' '3' -> '3'
+ddmax282 max '1.0' '1' -> '1'
+ddmax283 max '1' '1.0' -> '1'
+ddmax284 max '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+ddmax401 max Inf 1.1 -> Infinity
+ddmax402 max 1.1 1 -> 1.1
+ddmax403 max 1 1.0 -> 1
+ddmax404 max 1.0 0.1 -> 1.0
+ddmax405 max 0.1 0.10 -> 0.1
+ddmax406 max 0.10 0.100 -> 0.10
+ddmax407 max 0.10 0 -> 0.10
+ddmax408 max 0 0.0 -> 0
+ddmax409 max 0.0 -0 -> 0.0
+ddmax410 max 0.0 -0.0 -> 0.0
+ddmax411 max 0.00 -0.0 -> 0.00
+ddmax412 max 0.0 -0.00 -> 0.0
+ddmax413 max 0 -0.0 -> 0
+ddmax414 max 0 -0 -> 0
+ddmax415 max -0.0 -0 -> -0.0
+ddmax416 max -0 -0.100 -> -0
+ddmax417 max -0.100 -0.10 -> -0.100
+ddmax418 max -0.10 -0.1 -> -0.10
+ddmax419 max -0.1 -1.0 -> -0.1
+ddmax420 max -1.0 -1 -> -1.0
+ddmax421 max -1 -1.1 -> -1
+ddmax423 max -1.1 -Inf -> -1.1
+-- same with operands reversed
+ddmax431 max 1.1 Inf -> Infinity
+ddmax432 max 1 1.1 -> 1.1
+ddmax433 max 1.0 1 -> 1
+ddmax434 max 0.1 1.0 -> 1.0
+ddmax435 max 0.10 0.1 -> 0.1
+ddmax436 max 0.100 0.10 -> 0.10
+ddmax437 max 0 0.10 -> 0.10
+ddmax438 max 0.0 0 -> 0
+ddmax439 max -0 0.0 -> 0.0
+ddmax440 max -0.0 0.0 -> 0.0
+ddmax441 max -0.0 0.00 -> 0.00
+ddmax442 max -0.00 0.0 -> 0.0
+ddmax443 max -0.0 0 -> 0
+ddmax444 max -0 0 -> 0
+ddmax445 max -0 -0.0 -> -0.0
+ddmax446 max -0.100 -0 -> -0
+ddmax447 max -0.10 -0.100 -> -0.100
+ddmax448 max -0.1 -0.10 -> -0.10
+ddmax449 max -1.0 -0.1 -> -0.1
+ddmax450 max -1 -1.0 -> -1.0
+ddmax451 max -1.1 -1 -> -1
+ddmax453 max -Inf -1.1 -> -1.1
+-- largies
+ddmax460 max 1000 1E+3 -> 1E+3
+ddmax461 max 1E+3 1000 -> 1E+3
+ddmax462 max 1000 -1E+3 -> 1000
+ddmax463 max 1E+3 -1000 -> 1E+3
+ddmax464 max -1000 1E+3 -> 1E+3
+ddmax465 max -1E+3 1000 -> 1000
+ddmax466 max -1000 -1E+3 -> -1000
+ddmax467 max -1E+3 -1000 -> -1000
+
+-- misalignment traps for little-endian
+ddmax471 max 1.0 0.1 -> 1.0
+ddmax472 max 0.1 1.0 -> 1.0
+ddmax473 max 10.0 0.1 -> 10.0
+ddmax474 max 0.1 10.0 -> 10.0
+ddmax475 max 100 1.0 -> 100
+ddmax476 max 1.0 100 -> 100
+ddmax477 max 1000 10.0 -> 1000
+ddmax478 max 10.0 1000 -> 1000
+ddmax479 max 10000 100.0 -> 10000
+ddmax480 max 100.0 10000 -> 10000
+ddmax481 max 100000 1000.0 -> 100000
+ddmax482 max 1000.0 100000 -> 100000
+ddmax483 max 1000000 10000.0 -> 1000000
+ddmax484 max 10000.0 1000000 -> 1000000
+
+-- subnormals
+ddmax510 max 1.00E-383 0 -> 1.00E-383
+ddmax511 max 0.1E-383 0 -> 1E-384 Subnormal
+ddmax512 max 0.10E-383 0 -> 1.0E-384 Subnormal
+ddmax513 max 0.100E-383 0 -> 1.00E-384 Subnormal
+ddmax514 max 0.01E-383 0 -> 1E-385 Subnormal
+ddmax515 max 0.999E-383 0 -> 9.99E-384 Subnormal
+ddmax516 max 0.099E-383 0 -> 9.9E-385 Subnormal
+ddmax517 max 0.009E-383 0 -> 9E-386 Subnormal
+ddmax518 max 0.001E-383 0 -> 1E-386 Subnormal
+ddmax519 max 0.0009E-383 0 -> 9E-387 Subnormal
+ddmax520 max 0.0001E-383 0 -> 1E-387 Subnormal
+
+ddmax530 max -1.00E-383 0 -> 0
+ddmax531 max -0.1E-383 0 -> 0
+ddmax532 max -0.10E-383 0 -> 0
+ddmax533 max -0.100E-383 0 -> 0
+ddmax534 max -0.01E-383 0 -> 0
+ddmax535 max -0.999E-383 0 -> 0
+ddmax536 max -0.099E-383 0 -> 0
+ddmax537 max -0.009E-383 0 -> 0
+ddmax538 max -0.001E-383 0 -> 0
+ddmax539 max -0.0009E-383 0 -> 0
+ddmax540 max -0.0001E-383 0 -> 0
+
+-- Null tests
+ddmax900 max 10 # -> NaN Invalid_operation
+ddmax901 max # 10 -> NaN Invalid_operation
+
+
+
diff --git a/Lib/test/decimaltestdata/ddMaxMag.decTest b/Lib/test/decimaltestdata/ddMaxMag.decTest
index 19c3e9085c..ec2b830541 100644
--- a/Lib/test/decimaltestdata/ddMaxMag.decTest
+++ b/Lib/test/decimaltestdata/ddMaxMag.decTest
@@ -1,304 +1,304 @@
-------------------------------------------------------------------------
--- ddMaxMag.decTest -- decDouble maxnummag --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmxg001 maxmag -2 -2 -> -2
-ddmxg002 maxmag -2 -1 -> -2
-ddmxg003 maxmag -2 0 -> -2
-ddmxg004 maxmag -2 1 -> -2
-ddmxg005 maxmag -2 2 -> 2
-ddmxg006 maxmag -1 -2 -> -2
-ddmxg007 maxmag -1 -1 -> -1
-ddmxg008 maxmag -1 0 -> -1
-ddmxg009 maxmag -1 1 -> 1
-ddmxg010 maxmag -1 2 -> 2
-ddmxg011 maxmag 0 -2 -> -2
-ddmxg012 maxmag 0 -1 -> -1
-ddmxg013 maxmag 0 0 -> 0
-ddmxg014 maxmag 0 1 -> 1
-ddmxg015 maxmag 0 2 -> 2
-ddmxg016 maxmag 1 -2 -> -2
-ddmxg017 maxmag 1 -1 -> 1
-ddmxg018 maxmag 1 0 -> 1
-ddmxg019 maxmag 1 1 -> 1
-ddmxg020 maxmag 1 2 -> 2
-ddmxg021 maxmag 2 -2 -> 2
-ddmxg022 maxmag 2 -1 -> 2
-ddmxg023 maxmag 2 0 -> 2
-ddmxg025 maxmag 2 1 -> 2
-ddmxg026 maxmag 2 2 -> 2
-
--- extended zeros
-ddmxg030 maxmag 0 0 -> 0
-ddmxg031 maxmag 0 -0 -> 0
-ddmxg032 maxmag 0 -0.0 -> 0
-ddmxg033 maxmag 0 0.0 -> 0
-ddmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-ddmxg035 maxmag -0 -0 -> -0
-ddmxg036 maxmag -0 -0.0 -> -0.0
-ddmxg037 maxmag -0 0.0 -> 0.0
-ddmxg038 maxmag 0.0 0 -> 0
-ddmxg039 maxmag 0.0 -0 -> 0.0
-ddmxg040 maxmag 0.0 -0.0 -> 0.0
-ddmxg041 maxmag 0.0 0.0 -> 0.0
-ddmxg042 maxmag -0.0 0 -> 0
-ddmxg043 maxmag -0.0 -0 -> -0.0
-ddmxg044 maxmag -0.0 -0.0 -> -0.0
-ddmxg045 maxmag -0.0 0.0 -> 0.0
-
-ddmxg050 maxmag -0E1 0E1 -> 0E+1
-ddmxg051 maxmag -0E2 0E2 -> 0E+2
-ddmxg052 maxmag -0E2 0E1 -> 0E+1
-ddmxg053 maxmag -0E1 0E2 -> 0E+2
-ddmxg054 maxmag 0E1 -0E1 -> 0E+1
-ddmxg055 maxmag 0E2 -0E2 -> 0E+2
-ddmxg056 maxmag 0E2 -0E1 -> 0E+2
-ddmxg057 maxmag 0E1 -0E2 -> 0E+1
-
-ddmxg058 maxmag 0E1 0E1 -> 0E+1
-ddmxg059 maxmag 0E2 0E2 -> 0E+2
-ddmxg060 maxmag 0E2 0E1 -> 0E+2
-ddmxg061 maxmag 0E1 0E2 -> 0E+2
-ddmxg062 maxmag -0E1 -0E1 -> -0E+1
-ddmxg063 maxmag -0E2 -0E2 -> -0E+2
-ddmxg064 maxmag -0E2 -0E1 -> -0E+1
-ddmxg065 maxmag -0E1 -0E2 -> -0E+1
-
--- Specials
-ddmxg090 maxmag Inf -Inf -> Infinity
-ddmxg091 maxmag Inf -1000 -> Infinity
-ddmxg092 maxmag Inf -1 -> Infinity
-ddmxg093 maxmag Inf -0 -> Infinity
-ddmxg094 maxmag Inf 0 -> Infinity
-ddmxg095 maxmag Inf 1 -> Infinity
-ddmxg096 maxmag Inf 1000 -> Infinity
-ddmxg097 maxmag Inf Inf -> Infinity
-ddmxg098 maxmag -1000 Inf -> Infinity
-ddmxg099 maxmag -Inf Inf -> Infinity
-ddmxg100 maxmag -1 Inf -> Infinity
-ddmxg101 maxmag -0 Inf -> Infinity
-ddmxg102 maxmag 0 Inf -> Infinity
-ddmxg103 maxmag 1 Inf -> Infinity
-ddmxg104 maxmag 1000 Inf -> Infinity
-ddmxg105 maxmag Inf Inf -> Infinity
-
-ddmxg120 maxmag -Inf -Inf -> -Infinity
-ddmxg121 maxmag -Inf -1000 -> -Infinity
-ddmxg122 maxmag -Inf -1 -> -Infinity
-ddmxg123 maxmag -Inf -0 -> -Infinity
-ddmxg124 maxmag -Inf 0 -> -Infinity
-ddmxg125 maxmag -Inf 1 -> -Infinity
-ddmxg126 maxmag -Inf 1000 -> -Infinity
-ddmxg127 maxmag -Inf Inf -> Infinity
-ddmxg128 maxmag -Inf -Inf -> -Infinity
-ddmxg129 maxmag -1000 -Inf -> -Infinity
-ddmxg130 maxmag -1 -Inf -> -Infinity
-ddmxg131 maxmag -0 -Inf -> -Infinity
-ddmxg132 maxmag 0 -Inf -> -Infinity
-ddmxg133 maxmag 1 -Inf -> -Infinity
-ddmxg134 maxmag 1000 -Inf -> -Infinity
-ddmxg135 maxmag Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-ddmxg141 maxmag NaN -Inf -> -Infinity
-ddmxg142 maxmag NaN -1000 -> -1000
-ddmxg143 maxmag NaN -1 -> -1
-ddmxg144 maxmag NaN -0 -> -0
-ddmxg145 maxmag NaN 0 -> 0
-ddmxg146 maxmag NaN 1 -> 1
-ddmxg147 maxmag NaN 1000 -> 1000
-ddmxg148 maxmag NaN Inf -> Infinity
-ddmxg149 maxmag NaN NaN -> NaN
-ddmxg150 maxmag -Inf NaN -> -Infinity
-ddmxg151 maxmag -1000 NaN -> -1000
-ddmxg152 maxmag -1 NaN -> -1
-ddmxg153 maxmag -0 NaN -> -0
-ddmxg154 maxmag 0 NaN -> 0
-ddmxg155 maxmag 1 NaN -> 1
-ddmxg156 maxmag 1000 NaN -> 1000
-ddmxg157 maxmag Inf NaN -> Infinity
-
-ddmxg161 maxmag sNaN -Inf -> NaN Invalid_operation
-ddmxg162 maxmag sNaN -1000 -> NaN Invalid_operation
-ddmxg163 maxmag sNaN -1 -> NaN Invalid_operation
-ddmxg164 maxmag sNaN -0 -> NaN Invalid_operation
-ddmxg165 maxmag sNaN 0 -> NaN Invalid_operation
-ddmxg166 maxmag sNaN 1 -> NaN Invalid_operation
-ddmxg167 maxmag sNaN 1000 -> NaN Invalid_operation
-ddmxg168 maxmag sNaN NaN -> NaN Invalid_operation
-ddmxg169 maxmag sNaN sNaN -> NaN Invalid_operation
-ddmxg170 maxmag NaN sNaN -> NaN Invalid_operation
-ddmxg171 maxmag -Inf sNaN -> NaN Invalid_operation
-ddmxg172 maxmag -1000 sNaN -> NaN Invalid_operation
-ddmxg173 maxmag -1 sNaN -> NaN Invalid_operation
-ddmxg174 maxmag -0 sNaN -> NaN Invalid_operation
-ddmxg175 maxmag 0 sNaN -> NaN Invalid_operation
-ddmxg176 maxmag 1 sNaN -> NaN Invalid_operation
-ddmxg177 maxmag 1000 sNaN -> NaN Invalid_operation
-ddmxg178 maxmag Inf sNaN -> NaN Invalid_operation
-ddmxg179 maxmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmxg181 maxmag NaN9 -Inf -> -Infinity
-ddmxg182 maxmag NaN8 9 -> 9
-ddmxg183 maxmag -NaN7 Inf -> Infinity
-
-ddmxg184 maxmag -NaN1 NaN11 -> -NaN1
-ddmxg185 maxmag NaN2 NaN12 -> NaN2
-ddmxg186 maxmag -NaN13 -NaN7 -> -NaN13
-ddmxg187 maxmag NaN14 -NaN5 -> NaN14
-
-ddmxg188 maxmag -Inf NaN4 -> -Infinity
-ddmxg189 maxmag -9 -NaN3 -> -9
-ddmxg190 maxmag Inf NaN2 -> Infinity
-
-ddmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
-ddmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
-ddmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
-ddmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
-ddmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
-ddmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
-ddmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
-
--- old rounding checks
-ddmxg221 maxmag 12345678000 1 -> 12345678000
-ddmxg222 maxmag 1 12345678000 -> 12345678000
-ddmxg223 maxmag 1234567800 1 -> 1234567800
-ddmxg224 maxmag 1 1234567800 -> 1234567800
-ddmxg225 maxmag 1234567890 1 -> 1234567890
-ddmxg226 maxmag 1 1234567890 -> 1234567890
-ddmxg227 maxmag 1234567891 1 -> 1234567891
-ddmxg228 maxmag 1 1234567891 -> 1234567891
-ddmxg229 maxmag 12345678901 1 -> 12345678901
-ddmxg230 maxmag 1 12345678901 -> 12345678901
-ddmxg231 maxmag 1234567896 1 -> 1234567896
-ddmxg232 maxmag 1 1234567896 -> 1234567896
-ddmxg233 maxmag -1234567891 1 -> -1234567891
-ddmxg234 maxmag 1 -1234567891 -> -1234567891
-ddmxg235 maxmag -12345678901 1 -> -12345678901
-ddmxg236 maxmag 1 -12345678901 -> -12345678901
-ddmxg237 maxmag -1234567896 1 -> -1234567896
-ddmxg238 maxmag 1 -1234567896 -> -1234567896
-
--- from examples
-ddmxg280 maxmag '3' '2' -> '3'
-ddmxg281 maxmag '-10' '3' -> '-10'
-ddmxg282 maxmag '1.0' '1' -> '1'
-ddmxg283 maxmag '1' '1.0' -> '1'
-ddmxg284 maxmag '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-ddmxg401 maxmag Inf 1.1 -> Infinity
-ddmxg402 maxmag 1.1 1 -> 1.1
-ddmxg403 maxmag 1 1.0 -> 1
-ddmxg404 maxmag 1.0 0.1 -> 1.0
-ddmxg405 maxmag 0.1 0.10 -> 0.1
-ddmxg406 maxmag 0.10 0.100 -> 0.10
-ddmxg407 maxmag 0.10 0 -> 0.10
-ddmxg408 maxmag 0 0.0 -> 0
-ddmxg409 maxmag 0.0 -0 -> 0.0
-ddmxg410 maxmag 0.0 -0.0 -> 0.0
-ddmxg411 maxmag 0.00 -0.0 -> 0.00
-ddmxg412 maxmag 0.0 -0.00 -> 0.0
-ddmxg413 maxmag 0 -0.0 -> 0
-ddmxg414 maxmag 0 -0 -> 0
-ddmxg415 maxmag -0.0 -0 -> -0.0
-ddmxg416 maxmag -0 -0.100 -> -0.100
-ddmxg417 maxmag -0.100 -0.10 -> -0.100
-ddmxg418 maxmag -0.10 -0.1 -> -0.10
-ddmxg419 maxmag -0.1 -1.0 -> -1.0
-ddmxg420 maxmag -1.0 -1 -> -1.0
-ddmxg421 maxmag -1 -1.1 -> -1.1
-ddmxg423 maxmag -1.1 -Inf -> -Infinity
--- same with operands reversed
-ddmxg431 maxmag 1.1 Inf -> Infinity
-ddmxg432 maxmag 1 1.1 -> 1.1
-ddmxg433 maxmag 1.0 1 -> 1
-ddmxg434 maxmag 0.1 1.0 -> 1.0
-ddmxg435 maxmag 0.10 0.1 -> 0.1
-ddmxg436 maxmag 0.100 0.10 -> 0.10
-ddmxg437 maxmag 0 0.10 -> 0.10
-ddmxg438 maxmag 0.0 0 -> 0
-ddmxg439 maxmag -0 0.0 -> 0.0
-ddmxg440 maxmag -0.0 0.0 -> 0.0
-ddmxg441 maxmag -0.0 0.00 -> 0.00
-ddmxg442 maxmag -0.00 0.0 -> 0.0
-ddmxg443 maxmag -0.0 0 -> 0
-ddmxg444 maxmag -0 0 -> 0
-ddmxg445 maxmag -0 -0.0 -> -0.0
-ddmxg446 maxmag -0.100 -0 -> -0.100
-ddmxg447 maxmag -0.10 -0.100 -> -0.100
-ddmxg448 maxmag -0.1 -0.10 -> -0.10
-ddmxg449 maxmag -1.0 -0.1 -> -1.0
-ddmxg450 maxmag -1 -1.0 -> -1.0
-ddmxg451 maxmag -1.1 -1 -> -1.1
-ddmxg453 maxmag -Inf -1.1 -> -Infinity
--- largies
-ddmxg460 maxmag 1000 1E+3 -> 1E+3
-ddmxg461 maxmag 1E+3 1000 -> 1E+3
-ddmxg462 maxmag 1000 -1E+3 -> 1000
-ddmxg463 maxmag 1E+3 -1000 -> 1E+3
-ddmxg464 maxmag -1000 1E+3 -> 1E+3
-ddmxg465 maxmag -1E+3 1000 -> 1000
-ddmxg466 maxmag -1000 -1E+3 -> -1000
-ddmxg467 maxmag -1E+3 -1000 -> -1000
-
--- subnormals
-ddmxg510 maxmag 1.00E-383 0 -> 1.00E-383
-ddmxg511 maxmag 0.1E-383 0 -> 1E-384 Subnormal
-ddmxg512 maxmag 0.10E-383 0 -> 1.0E-384 Subnormal
-ddmxg513 maxmag 0.100E-383 0 -> 1.00E-384 Subnormal
-ddmxg514 maxmag 0.01E-383 0 -> 1E-385 Subnormal
-ddmxg515 maxmag 0.999E-383 0 -> 9.99E-384 Subnormal
-ddmxg516 maxmag 0.099E-383 0 -> 9.9E-385 Subnormal
-ddmxg517 maxmag 0.009E-383 0 -> 9E-386 Subnormal
-ddmxg518 maxmag 0.001E-383 0 -> 1E-386 Subnormal
-ddmxg519 maxmag 0.0009E-383 0 -> 9E-387 Subnormal
-ddmxg520 maxmag 0.0001E-383 0 -> 1E-387 Subnormal
-
-ddmxg530 maxmag -1.00E-383 0 -> -1.00E-383
-ddmxg531 maxmag -0.1E-383 0 -> -1E-384 Subnormal
-ddmxg532 maxmag -0.10E-383 0 -> -1.0E-384 Subnormal
-ddmxg533 maxmag -0.100E-383 0 -> -1.00E-384 Subnormal
-ddmxg534 maxmag -0.01E-383 0 -> -1E-385 Subnormal
-ddmxg535 maxmag -0.999E-383 0 -> -9.99E-384 Subnormal
-ddmxg536 maxmag -0.099E-383 0 -> -9.9E-385 Subnormal
-ddmxg537 maxmag -0.009E-383 0 -> -9E-386 Subnormal
-ddmxg538 maxmag -0.001E-383 0 -> -1E-386 Subnormal
-ddmxg539 maxmag -0.0009E-383 0 -> -9E-387 Subnormal
-ddmxg540 maxmag -0.0001E-383 0 -> -1E-387 Subnormal
-
--- Null tests
-ddmxg900 maxmag 10 # -> NaN Invalid_operation
-ddmxg901 maxmag # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddMaxMag.decTest -- decDouble maxnummag --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmxg001 maxmag -2 -2 -> -2
+ddmxg002 maxmag -2 -1 -> -2
+ddmxg003 maxmag -2 0 -> -2
+ddmxg004 maxmag -2 1 -> -2
+ddmxg005 maxmag -2 2 -> 2
+ddmxg006 maxmag -1 -2 -> -2
+ddmxg007 maxmag -1 -1 -> -1
+ddmxg008 maxmag -1 0 -> -1
+ddmxg009 maxmag -1 1 -> 1
+ddmxg010 maxmag -1 2 -> 2
+ddmxg011 maxmag 0 -2 -> -2
+ddmxg012 maxmag 0 -1 -> -1
+ddmxg013 maxmag 0 0 -> 0
+ddmxg014 maxmag 0 1 -> 1
+ddmxg015 maxmag 0 2 -> 2
+ddmxg016 maxmag 1 -2 -> -2
+ddmxg017 maxmag 1 -1 -> 1
+ddmxg018 maxmag 1 0 -> 1
+ddmxg019 maxmag 1 1 -> 1
+ddmxg020 maxmag 1 2 -> 2
+ddmxg021 maxmag 2 -2 -> 2
+ddmxg022 maxmag 2 -1 -> 2
+ddmxg023 maxmag 2 0 -> 2
+ddmxg025 maxmag 2 1 -> 2
+ddmxg026 maxmag 2 2 -> 2
+
+-- extended zeros
+ddmxg030 maxmag 0 0 -> 0
+ddmxg031 maxmag 0 -0 -> 0
+ddmxg032 maxmag 0 -0.0 -> 0
+ddmxg033 maxmag 0 0.0 -> 0
+ddmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+ddmxg035 maxmag -0 -0 -> -0
+ddmxg036 maxmag -0 -0.0 -> -0.0
+ddmxg037 maxmag -0 0.0 -> 0.0
+ddmxg038 maxmag 0.0 0 -> 0
+ddmxg039 maxmag 0.0 -0 -> 0.0
+ddmxg040 maxmag 0.0 -0.0 -> 0.0
+ddmxg041 maxmag 0.0 0.0 -> 0.0
+ddmxg042 maxmag -0.0 0 -> 0
+ddmxg043 maxmag -0.0 -0 -> -0.0
+ddmxg044 maxmag -0.0 -0.0 -> -0.0
+ddmxg045 maxmag -0.0 0.0 -> 0.0
+
+ddmxg050 maxmag -0E1 0E1 -> 0E+1
+ddmxg051 maxmag -0E2 0E2 -> 0E+2
+ddmxg052 maxmag -0E2 0E1 -> 0E+1
+ddmxg053 maxmag -0E1 0E2 -> 0E+2
+ddmxg054 maxmag 0E1 -0E1 -> 0E+1
+ddmxg055 maxmag 0E2 -0E2 -> 0E+2
+ddmxg056 maxmag 0E2 -0E1 -> 0E+2
+ddmxg057 maxmag 0E1 -0E2 -> 0E+1
+
+ddmxg058 maxmag 0E1 0E1 -> 0E+1
+ddmxg059 maxmag 0E2 0E2 -> 0E+2
+ddmxg060 maxmag 0E2 0E1 -> 0E+2
+ddmxg061 maxmag 0E1 0E2 -> 0E+2
+ddmxg062 maxmag -0E1 -0E1 -> -0E+1
+ddmxg063 maxmag -0E2 -0E2 -> -0E+2
+ddmxg064 maxmag -0E2 -0E1 -> -0E+1
+ddmxg065 maxmag -0E1 -0E2 -> -0E+1
+
+-- Specials
+ddmxg090 maxmag Inf -Inf -> Infinity
+ddmxg091 maxmag Inf -1000 -> Infinity
+ddmxg092 maxmag Inf -1 -> Infinity
+ddmxg093 maxmag Inf -0 -> Infinity
+ddmxg094 maxmag Inf 0 -> Infinity
+ddmxg095 maxmag Inf 1 -> Infinity
+ddmxg096 maxmag Inf 1000 -> Infinity
+ddmxg097 maxmag Inf Inf -> Infinity
+ddmxg098 maxmag -1000 Inf -> Infinity
+ddmxg099 maxmag -Inf Inf -> Infinity
+ddmxg100 maxmag -1 Inf -> Infinity
+ddmxg101 maxmag -0 Inf -> Infinity
+ddmxg102 maxmag 0 Inf -> Infinity
+ddmxg103 maxmag 1 Inf -> Infinity
+ddmxg104 maxmag 1000 Inf -> Infinity
+ddmxg105 maxmag Inf Inf -> Infinity
+
+ddmxg120 maxmag -Inf -Inf -> -Infinity
+ddmxg121 maxmag -Inf -1000 -> -Infinity
+ddmxg122 maxmag -Inf -1 -> -Infinity
+ddmxg123 maxmag -Inf -0 -> -Infinity
+ddmxg124 maxmag -Inf 0 -> -Infinity
+ddmxg125 maxmag -Inf 1 -> -Infinity
+ddmxg126 maxmag -Inf 1000 -> -Infinity
+ddmxg127 maxmag -Inf Inf -> Infinity
+ddmxg128 maxmag -Inf -Inf -> -Infinity
+ddmxg129 maxmag -1000 -Inf -> -Infinity
+ddmxg130 maxmag -1 -Inf -> -Infinity
+ddmxg131 maxmag -0 -Inf -> -Infinity
+ddmxg132 maxmag 0 -Inf -> -Infinity
+ddmxg133 maxmag 1 -Inf -> -Infinity
+ddmxg134 maxmag 1000 -Inf -> -Infinity
+ddmxg135 maxmag Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+ddmxg141 maxmag NaN -Inf -> -Infinity
+ddmxg142 maxmag NaN -1000 -> -1000
+ddmxg143 maxmag NaN -1 -> -1
+ddmxg144 maxmag NaN -0 -> -0
+ddmxg145 maxmag NaN 0 -> 0
+ddmxg146 maxmag NaN 1 -> 1
+ddmxg147 maxmag NaN 1000 -> 1000
+ddmxg148 maxmag NaN Inf -> Infinity
+ddmxg149 maxmag NaN NaN -> NaN
+ddmxg150 maxmag -Inf NaN -> -Infinity
+ddmxg151 maxmag -1000 NaN -> -1000
+ddmxg152 maxmag -1 NaN -> -1
+ddmxg153 maxmag -0 NaN -> -0
+ddmxg154 maxmag 0 NaN -> 0
+ddmxg155 maxmag 1 NaN -> 1
+ddmxg156 maxmag 1000 NaN -> 1000
+ddmxg157 maxmag Inf NaN -> Infinity
+
+ddmxg161 maxmag sNaN -Inf -> NaN Invalid_operation
+ddmxg162 maxmag sNaN -1000 -> NaN Invalid_operation
+ddmxg163 maxmag sNaN -1 -> NaN Invalid_operation
+ddmxg164 maxmag sNaN -0 -> NaN Invalid_operation
+ddmxg165 maxmag sNaN 0 -> NaN Invalid_operation
+ddmxg166 maxmag sNaN 1 -> NaN Invalid_operation
+ddmxg167 maxmag sNaN 1000 -> NaN Invalid_operation
+ddmxg168 maxmag sNaN NaN -> NaN Invalid_operation
+ddmxg169 maxmag sNaN sNaN -> NaN Invalid_operation
+ddmxg170 maxmag NaN sNaN -> NaN Invalid_operation
+ddmxg171 maxmag -Inf sNaN -> NaN Invalid_operation
+ddmxg172 maxmag -1000 sNaN -> NaN Invalid_operation
+ddmxg173 maxmag -1 sNaN -> NaN Invalid_operation
+ddmxg174 maxmag -0 sNaN -> NaN Invalid_operation
+ddmxg175 maxmag 0 sNaN -> NaN Invalid_operation
+ddmxg176 maxmag 1 sNaN -> NaN Invalid_operation
+ddmxg177 maxmag 1000 sNaN -> NaN Invalid_operation
+ddmxg178 maxmag Inf sNaN -> NaN Invalid_operation
+ddmxg179 maxmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmxg181 maxmag NaN9 -Inf -> -Infinity
+ddmxg182 maxmag NaN8 9 -> 9
+ddmxg183 maxmag -NaN7 Inf -> Infinity
+
+ddmxg184 maxmag -NaN1 NaN11 -> -NaN1
+ddmxg185 maxmag NaN2 NaN12 -> NaN2
+ddmxg186 maxmag -NaN13 -NaN7 -> -NaN13
+ddmxg187 maxmag NaN14 -NaN5 -> NaN14
+
+ddmxg188 maxmag -Inf NaN4 -> -Infinity
+ddmxg189 maxmag -9 -NaN3 -> -9
+ddmxg190 maxmag Inf NaN2 -> Infinity
+
+ddmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
+ddmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
+ddmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
+ddmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
+ddmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
+ddmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
+ddmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
+
+-- old rounding checks
+ddmxg221 maxmag 12345678000 1 -> 12345678000
+ddmxg222 maxmag 1 12345678000 -> 12345678000
+ddmxg223 maxmag 1234567800 1 -> 1234567800
+ddmxg224 maxmag 1 1234567800 -> 1234567800
+ddmxg225 maxmag 1234567890 1 -> 1234567890
+ddmxg226 maxmag 1 1234567890 -> 1234567890
+ddmxg227 maxmag 1234567891 1 -> 1234567891
+ddmxg228 maxmag 1 1234567891 -> 1234567891
+ddmxg229 maxmag 12345678901 1 -> 12345678901
+ddmxg230 maxmag 1 12345678901 -> 12345678901
+ddmxg231 maxmag 1234567896 1 -> 1234567896
+ddmxg232 maxmag 1 1234567896 -> 1234567896
+ddmxg233 maxmag -1234567891 1 -> -1234567891
+ddmxg234 maxmag 1 -1234567891 -> -1234567891
+ddmxg235 maxmag -12345678901 1 -> -12345678901
+ddmxg236 maxmag 1 -12345678901 -> -12345678901
+ddmxg237 maxmag -1234567896 1 -> -1234567896
+ddmxg238 maxmag 1 -1234567896 -> -1234567896
+
+-- from examples
+ddmxg280 maxmag '3' '2' -> '3'
+ddmxg281 maxmag '-10' '3' -> '-10'
+ddmxg282 maxmag '1.0' '1' -> '1'
+ddmxg283 maxmag '1' '1.0' -> '1'
+ddmxg284 maxmag '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+ddmxg401 maxmag Inf 1.1 -> Infinity
+ddmxg402 maxmag 1.1 1 -> 1.1
+ddmxg403 maxmag 1 1.0 -> 1
+ddmxg404 maxmag 1.0 0.1 -> 1.0
+ddmxg405 maxmag 0.1 0.10 -> 0.1
+ddmxg406 maxmag 0.10 0.100 -> 0.10
+ddmxg407 maxmag 0.10 0 -> 0.10
+ddmxg408 maxmag 0 0.0 -> 0
+ddmxg409 maxmag 0.0 -0 -> 0.0
+ddmxg410 maxmag 0.0 -0.0 -> 0.0
+ddmxg411 maxmag 0.00 -0.0 -> 0.00
+ddmxg412 maxmag 0.0 -0.00 -> 0.0
+ddmxg413 maxmag 0 -0.0 -> 0
+ddmxg414 maxmag 0 -0 -> 0
+ddmxg415 maxmag -0.0 -0 -> -0.0
+ddmxg416 maxmag -0 -0.100 -> -0.100
+ddmxg417 maxmag -0.100 -0.10 -> -0.100
+ddmxg418 maxmag -0.10 -0.1 -> -0.10
+ddmxg419 maxmag -0.1 -1.0 -> -1.0
+ddmxg420 maxmag -1.0 -1 -> -1.0
+ddmxg421 maxmag -1 -1.1 -> -1.1
+ddmxg423 maxmag -1.1 -Inf -> -Infinity
+-- same with operands reversed
+ddmxg431 maxmag 1.1 Inf -> Infinity
+ddmxg432 maxmag 1 1.1 -> 1.1
+ddmxg433 maxmag 1.0 1 -> 1
+ddmxg434 maxmag 0.1 1.0 -> 1.0
+ddmxg435 maxmag 0.10 0.1 -> 0.1
+ddmxg436 maxmag 0.100 0.10 -> 0.10
+ddmxg437 maxmag 0 0.10 -> 0.10
+ddmxg438 maxmag 0.0 0 -> 0
+ddmxg439 maxmag -0 0.0 -> 0.0
+ddmxg440 maxmag -0.0 0.0 -> 0.0
+ddmxg441 maxmag -0.0 0.00 -> 0.00
+ddmxg442 maxmag -0.00 0.0 -> 0.0
+ddmxg443 maxmag -0.0 0 -> 0
+ddmxg444 maxmag -0 0 -> 0
+ddmxg445 maxmag -0 -0.0 -> -0.0
+ddmxg446 maxmag -0.100 -0 -> -0.100
+ddmxg447 maxmag -0.10 -0.100 -> -0.100
+ddmxg448 maxmag -0.1 -0.10 -> -0.10
+ddmxg449 maxmag -1.0 -0.1 -> -1.0
+ddmxg450 maxmag -1 -1.0 -> -1.0
+ddmxg451 maxmag -1.1 -1 -> -1.1
+ddmxg453 maxmag -Inf -1.1 -> -Infinity
+-- largies
+ddmxg460 maxmag 1000 1E+3 -> 1E+3
+ddmxg461 maxmag 1E+3 1000 -> 1E+3
+ddmxg462 maxmag 1000 -1E+3 -> 1000
+ddmxg463 maxmag 1E+3 -1000 -> 1E+3
+ddmxg464 maxmag -1000 1E+3 -> 1E+3
+ddmxg465 maxmag -1E+3 1000 -> 1000
+ddmxg466 maxmag -1000 -1E+3 -> -1000
+ddmxg467 maxmag -1E+3 -1000 -> -1000
+
+-- subnormals
+ddmxg510 maxmag 1.00E-383 0 -> 1.00E-383
+ddmxg511 maxmag 0.1E-383 0 -> 1E-384 Subnormal
+ddmxg512 maxmag 0.10E-383 0 -> 1.0E-384 Subnormal
+ddmxg513 maxmag 0.100E-383 0 -> 1.00E-384 Subnormal
+ddmxg514 maxmag 0.01E-383 0 -> 1E-385 Subnormal
+ddmxg515 maxmag 0.999E-383 0 -> 9.99E-384 Subnormal
+ddmxg516 maxmag 0.099E-383 0 -> 9.9E-385 Subnormal
+ddmxg517 maxmag 0.009E-383 0 -> 9E-386 Subnormal
+ddmxg518 maxmag 0.001E-383 0 -> 1E-386 Subnormal
+ddmxg519 maxmag 0.0009E-383 0 -> 9E-387 Subnormal
+ddmxg520 maxmag 0.0001E-383 0 -> 1E-387 Subnormal
+
+ddmxg530 maxmag -1.00E-383 0 -> -1.00E-383
+ddmxg531 maxmag -0.1E-383 0 -> -1E-384 Subnormal
+ddmxg532 maxmag -0.10E-383 0 -> -1.0E-384 Subnormal
+ddmxg533 maxmag -0.100E-383 0 -> -1.00E-384 Subnormal
+ddmxg534 maxmag -0.01E-383 0 -> -1E-385 Subnormal
+ddmxg535 maxmag -0.999E-383 0 -> -9.99E-384 Subnormal
+ddmxg536 maxmag -0.099E-383 0 -> -9.9E-385 Subnormal
+ddmxg537 maxmag -0.009E-383 0 -> -9E-386 Subnormal
+ddmxg538 maxmag -0.001E-383 0 -> -1E-386 Subnormal
+ddmxg539 maxmag -0.0009E-383 0 -> -9E-387 Subnormal
+ddmxg540 maxmag -0.0001E-383 0 -> -1E-387 Subnormal
+
+-- Null tests
+ddmxg900 maxmag 10 # -> NaN Invalid_operation
+ddmxg901 maxmag # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddMin.decTest b/Lib/test/decimaltestdata/ddMin.decTest
index eb942ff159..9ce4282463 100644
--- a/Lib/test/decimaltestdata/ddMin.decTest
+++ b/Lib/test/decimaltestdata/ddMin.decTest
@@ -1,309 +1,309 @@
-------------------------------------------------------------------------
--- ddMin.decTest -- decDouble minnum --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmin001 min -2 -2 -> -2
-ddmin002 min -2 -1 -> -2
-ddmin003 min -2 0 -> -2
-ddmin004 min -2 1 -> -2
-ddmin005 min -2 2 -> -2
-ddmin006 min -1 -2 -> -2
-ddmin007 min -1 -1 -> -1
-ddmin008 min -1 0 -> -1
-ddmin009 min -1 1 -> -1
-ddmin010 min -1 2 -> -1
-ddmin011 min 0 -2 -> -2
-ddmin012 min 0 -1 -> -1
-ddmin013 min 0 0 -> 0
-ddmin014 min 0 1 -> 0
-ddmin015 min 0 2 -> 0
-ddmin016 min 1 -2 -> -2
-ddmin017 min 1 -1 -> -1
-ddmin018 min 1 0 -> 0
-ddmin019 min 1 1 -> 1
-ddmin020 min 1 2 -> 1
-ddmin021 min 2 -2 -> -2
-ddmin022 min 2 -1 -> -1
-ddmin023 min 2 0 -> 0
-ddmin025 min 2 1 -> 1
-ddmin026 min 2 2 -> 2
-
--- extended zeros
-ddmin030 min 0 0 -> 0
-ddmin031 min 0 -0 -> -0
-ddmin032 min 0 -0.0 -> -0.0
-ddmin033 min 0 0.0 -> 0.0
-ddmin034 min -0 0 -> -0
-ddmin035 min -0 -0 -> -0
-ddmin036 min -0 -0.0 -> -0
-ddmin037 min -0 0.0 -> -0
-ddmin038 min 0.0 0 -> 0.0
-ddmin039 min 0.0 -0 -> -0
-ddmin040 min 0.0 -0.0 -> -0.0
-ddmin041 min 0.0 0.0 -> 0.0
-ddmin042 min -0.0 0 -> -0.0
-ddmin043 min -0.0 -0 -> -0
-ddmin044 min -0.0 -0.0 -> -0.0
-ddmin045 min -0.0 0.0 -> -0.0
-
-ddmin046 min 0E1 -0E1 -> -0E+1
-ddmin047 min -0E1 0E2 -> -0E+1
-ddmin048 min 0E2 0E1 -> 0E+1
-ddmin049 min 0E1 0E2 -> 0E+1
-ddmin050 min -0E3 -0E2 -> -0E+3
-ddmin051 min -0E2 -0E3 -> -0E+3
-
--- Specials
-ddmin090 min Inf -Inf -> -Infinity
-ddmin091 min Inf -1000 -> -1000
-ddmin092 min Inf -1 -> -1
-ddmin093 min Inf -0 -> -0
-ddmin094 min Inf 0 -> 0
-ddmin095 min Inf 1 -> 1
-ddmin096 min Inf 1000 -> 1000
-ddmin097 min Inf Inf -> Infinity
-ddmin098 min -1000 Inf -> -1000
-ddmin099 min -Inf Inf -> -Infinity
-ddmin100 min -1 Inf -> -1
-ddmin101 min -0 Inf -> -0
-ddmin102 min 0 Inf -> 0
-ddmin103 min 1 Inf -> 1
-ddmin104 min 1000 Inf -> 1000
-ddmin105 min Inf Inf -> Infinity
-
-ddmin120 min -Inf -Inf -> -Infinity
-ddmin121 min -Inf -1000 -> -Infinity
-ddmin122 min -Inf -1 -> -Infinity
-ddmin123 min -Inf -0 -> -Infinity
-ddmin124 min -Inf 0 -> -Infinity
-ddmin125 min -Inf 1 -> -Infinity
-ddmin126 min -Inf 1000 -> -Infinity
-ddmin127 min -Inf Inf -> -Infinity
-ddmin128 min -Inf -Inf -> -Infinity
-ddmin129 min -1000 -Inf -> -Infinity
-ddmin130 min -1 -Inf -> -Infinity
-ddmin131 min -0 -Inf -> -Infinity
-ddmin132 min 0 -Inf -> -Infinity
-ddmin133 min 1 -Inf -> -Infinity
-ddmin134 min 1000 -Inf -> -Infinity
-ddmin135 min Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-ddmin141 min NaN -Inf -> -Infinity
-ddmin142 min NaN -1000 -> -1000
-ddmin143 min NaN -1 -> -1
-ddmin144 min NaN -0 -> -0
-ddmin145 min NaN 0 -> 0
-ddmin146 min NaN 1 -> 1
-ddmin147 min NaN 1000 -> 1000
-ddmin148 min NaN Inf -> Infinity
-ddmin149 min NaN NaN -> NaN
-ddmin150 min -Inf NaN -> -Infinity
-ddmin151 min -1000 NaN -> -1000
-ddmin152 min -1 -NaN -> -1
-ddmin153 min -0 NaN -> -0
-ddmin154 min 0 -NaN -> 0
-ddmin155 min 1 NaN -> 1
-ddmin156 min 1000 NaN -> 1000
-ddmin157 min Inf NaN -> Infinity
-
-ddmin161 min sNaN -Inf -> NaN Invalid_operation
-ddmin162 min sNaN -1000 -> NaN Invalid_operation
-ddmin163 min sNaN -1 -> NaN Invalid_operation
-ddmin164 min sNaN -0 -> NaN Invalid_operation
-ddmin165 min -sNaN 0 -> -NaN Invalid_operation
-ddmin166 min -sNaN 1 -> -NaN Invalid_operation
-ddmin167 min sNaN 1000 -> NaN Invalid_operation
-ddmin168 min sNaN NaN -> NaN Invalid_operation
-ddmin169 min sNaN sNaN -> NaN Invalid_operation
-ddmin170 min NaN sNaN -> NaN Invalid_operation
-ddmin171 min -Inf sNaN -> NaN Invalid_operation
-ddmin172 min -1000 sNaN -> NaN Invalid_operation
-ddmin173 min -1 sNaN -> NaN Invalid_operation
-ddmin174 min -0 sNaN -> NaN Invalid_operation
-ddmin175 min 0 sNaN -> NaN Invalid_operation
-ddmin176 min 1 sNaN -> NaN Invalid_operation
-ddmin177 min 1000 sNaN -> NaN Invalid_operation
-ddmin178 min Inf sNaN -> NaN Invalid_operation
-ddmin179 min NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmin181 min NaN9 -Inf -> -Infinity
-ddmin182 min -NaN8 9990 -> 9990
-ddmin183 min NaN71 Inf -> Infinity
-
-ddmin184 min NaN1 NaN54 -> NaN1
-ddmin185 min NaN22 -NaN53 -> NaN22
-ddmin186 min -NaN3 NaN6 -> -NaN3
-ddmin187 min -NaN44 NaN7 -> -NaN44
-
-ddmin188 min -Inf NaN41 -> -Infinity
-ddmin189 min -9999 -NaN33 -> -9999
-ddmin190 min Inf NaN2 -> Infinity
-
-ddmin191 min sNaN99 -Inf -> NaN99 Invalid_operation
-ddmin192 min sNaN98 -11 -> NaN98 Invalid_operation
-ddmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation
-ddmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
-ddmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmin196 min -Inf sNaN92 -> NaN92 Invalid_operation
-ddmin197 min 088 sNaN91 -> NaN91 Invalid_operation
-ddmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmin199 min NaN sNaN86 -> NaN86 Invalid_operation
-
--- old rounding checks
-ddmin221 min -12345678000 1 -> -12345678000
-ddmin222 min 1 -12345678000 -> -12345678000
-ddmin223 min -1234567800 1 -> -1234567800
-ddmin224 min 1 -1234567800 -> -1234567800
-ddmin225 min -1234567890 1 -> -1234567890
-ddmin226 min 1 -1234567890 -> -1234567890
-ddmin227 min -1234567891 1 -> -1234567891
-ddmin228 min 1 -1234567891 -> -1234567891
-ddmin229 min -12345678901 1 -> -12345678901
-ddmin230 min 1 -12345678901 -> -12345678901
-ddmin231 min -1234567896 1 -> -1234567896
-ddmin232 min 1 -1234567896 -> -1234567896
-ddmin233 min 1234567891 1 -> 1
-ddmin234 min 1 1234567891 -> 1
-ddmin235 min 12345678901 1 -> 1
-ddmin236 min 1 12345678901 -> 1
-ddmin237 min 1234567896 1 -> 1
-ddmin238 min 1 1234567896 -> 1
-
--- from examples
-ddmin280 min '3' '2' -> '2'
-ddmin281 min '-10' '3' -> '-10'
-ddmin282 min '1.0' '1' -> '1.0'
-ddmin283 min '1' '1.0' -> '1.0'
-ddmin284 min '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-ddmin401 min Inf 1.1 -> 1.1
-ddmin402 min 1.1 1 -> 1
-ddmin403 min 1 1.0 -> 1.0
-ddmin404 min 1.0 0.1 -> 0.1
-ddmin405 min 0.1 0.10 -> 0.10
-ddmin406 min 0.10 0.100 -> 0.100
-ddmin407 min 0.10 0 -> 0
-ddmin408 min 0 0.0 -> 0.0
-ddmin409 min 0.0 -0 -> -0
-ddmin410 min 0.0 -0.0 -> -0.0
-ddmin411 min 0.00 -0.0 -> -0.0
-ddmin412 min 0.0 -0.00 -> -0.00
-ddmin413 min 0 -0.0 -> -0.0
-ddmin414 min 0 -0 -> -0
-ddmin415 min -0.0 -0 -> -0
-ddmin416 min -0 -0.100 -> -0.100
-ddmin417 min -0.100 -0.10 -> -0.10
-ddmin418 min -0.10 -0.1 -> -0.1
-ddmin419 min -0.1 -1.0 -> -1.0
-ddmin420 min -1.0 -1 -> -1
-ddmin421 min -1 -1.1 -> -1.1
-ddmin423 min -1.1 -Inf -> -Infinity
--- same with operands reversed
-ddmin431 min 1.1 Inf -> 1.1
-ddmin432 min 1 1.1 -> 1
-ddmin433 min 1.0 1 -> 1.0
-ddmin434 min 0.1 1.0 -> 0.1
-ddmin435 min 0.10 0.1 -> 0.10
-ddmin436 min 0.100 0.10 -> 0.100
-ddmin437 min 0 0.10 -> 0
-ddmin438 min 0.0 0 -> 0.0
-ddmin439 min -0 0.0 -> -0
-ddmin440 min -0.0 0.0 -> -0.0
-ddmin441 min -0.0 0.00 -> -0.0
-ddmin442 min -0.00 0.0 -> -0.00
-ddmin443 min -0.0 0 -> -0.0
-ddmin444 min -0 0 -> -0
-ddmin445 min -0 -0.0 -> -0
-ddmin446 min -0.100 -0 -> -0.100
-ddmin447 min -0.10 -0.100 -> -0.10
-ddmin448 min -0.1 -0.10 -> -0.1
-ddmin449 min -1.0 -0.1 -> -1.0
-ddmin450 min -1 -1.0 -> -1
-ddmin451 min -1.1 -1 -> -1.1
-ddmin453 min -Inf -1.1 -> -Infinity
--- largies
-ddmin460 min 1000 1E+3 -> 1000
-ddmin461 min 1E+3 1000 -> 1000
-ddmin462 min 1000 -1E+3 -> -1E+3
-ddmin463 min 1E+3 -384 -> -384
-ddmin464 min -384 1E+3 -> -384
-ddmin465 min -1E+3 1000 -> -1E+3
-ddmin466 min -384 -1E+3 -> -1E+3
-ddmin467 min -1E+3 -384 -> -1E+3
-
--- misalignment traps for little-endian
-ddmin471 min 1.0 0.1 -> 0.1
-ddmin472 min 0.1 1.0 -> 0.1
-ddmin473 min 10.0 0.1 -> 0.1
-ddmin474 min 0.1 10.0 -> 0.1
-ddmin475 min 100 1.0 -> 1.0
-ddmin476 min 1.0 100 -> 1.0
-ddmin477 min 1000 10.0 -> 10.0
-ddmin478 min 10.0 1000 -> 10.0
-ddmin479 min 10000 100.0 -> 100.0
-ddmin480 min 100.0 10000 -> 100.0
-ddmin481 min 100000 1000.0 -> 1000.0
-ddmin482 min 1000.0 100000 -> 1000.0
-ddmin483 min 1000000 10000.0 -> 10000.0
-ddmin484 min 10000.0 1000000 -> 10000.0
-
--- subnormals
-ddmin510 min 1.00E-383 0 -> 0
-ddmin511 min 0.1E-383 0 -> 0
-ddmin512 min 0.10E-383 0 -> 0
-ddmin513 min 0.100E-383 0 -> 0
-ddmin514 min 0.01E-383 0 -> 0
-ddmin515 min 0.999E-383 0 -> 0
-ddmin516 min 0.099E-383 0 -> 0
-ddmin517 min 0.009E-383 0 -> 0
-ddmin518 min 0.001E-383 0 -> 0
-ddmin519 min 0.0009E-383 0 -> 0
-ddmin520 min 0.0001E-383 0 -> 0
-
-ddmin530 min -1.00E-383 0 -> -1.00E-383
-ddmin531 min -0.1E-383 0 -> -1E-384 Subnormal
-ddmin532 min -0.10E-383 0 -> -1.0E-384 Subnormal
-ddmin533 min -0.100E-383 0 -> -1.00E-384 Subnormal
-ddmin534 min -0.01E-383 0 -> -1E-385 Subnormal
-ddmin535 min -0.999E-383 0 -> -9.99E-384 Subnormal
-ddmin536 min -0.099E-383 0 -> -9.9E-385 Subnormal
-ddmin537 min -0.009E-383 0 -> -9E-386 Subnormal
-ddmin538 min -0.001E-383 0 -> -1E-386 Subnormal
-ddmin539 min -0.0009E-383 0 -> -9E-387 Subnormal
-ddmin540 min -0.0001E-383 0 -> -1E-387 Subnormal
-
-
--- Null tests
-ddmin900 min 10 # -> NaN Invalid_operation
-ddmin901 min # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddMin.decTest -- decDouble minnum --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmin001 min -2 -2 -> -2
+ddmin002 min -2 -1 -> -2
+ddmin003 min -2 0 -> -2
+ddmin004 min -2 1 -> -2
+ddmin005 min -2 2 -> -2
+ddmin006 min -1 -2 -> -2
+ddmin007 min -1 -1 -> -1
+ddmin008 min -1 0 -> -1
+ddmin009 min -1 1 -> -1
+ddmin010 min -1 2 -> -1
+ddmin011 min 0 -2 -> -2
+ddmin012 min 0 -1 -> -1
+ddmin013 min 0 0 -> 0
+ddmin014 min 0 1 -> 0
+ddmin015 min 0 2 -> 0
+ddmin016 min 1 -2 -> -2
+ddmin017 min 1 -1 -> -1
+ddmin018 min 1 0 -> 0
+ddmin019 min 1 1 -> 1
+ddmin020 min 1 2 -> 1
+ddmin021 min 2 -2 -> -2
+ddmin022 min 2 -1 -> -1
+ddmin023 min 2 0 -> 0
+ddmin025 min 2 1 -> 1
+ddmin026 min 2 2 -> 2
+
+-- extended zeros
+ddmin030 min 0 0 -> 0
+ddmin031 min 0 -0 -> -0
+ddmin032 min 0 -0.0 -> -0.0
+ddmin033 min 0 0.0 -> 0.0
+ddmin034 min -0 0 -> -0
+ddmin035 min -0 -0 -> -0
+ddmin036 min -0 -0.0 -> -0
+ddmin037 min -0 0.0 -> -0
+ddmin038 min 0.0 0 -> 0.0
+ddmin039 min 0.0 -0 -> -0
+ddmin040 min 0.0 -0.0 -> -0.0
+ddmin041 min 0.0 0.0 -> 0.0
+ddmin042 min -0.0 0 -> -0.0
+ddmin043 min -0.0 -0 -> -0
+ddmin044 min -0.0 -0.0 -> -0.0
+ddmin045 min -0.0 0.0 -> -0.0
+
+ddmin046 min 0E1 -0E1 -> -0E+1
+ddmin047 min -0E1 0E2 -> -0E+1
+ddmin048 min 0E2 0E1 -> 0E+1
+ddmin049 min 0E1 0E2 -> 0E+1
+ddmin050 min -0E3 -0E2 -> -0E+3
+ddmin051 min -0E2 -0E3 -> -0E+3
+
+-- Specials
+ddmin090 min Inf -Inf -> -Infinity
+ddmin091 min Inf -1000 -> -1000
+ddmin092 min Inf -1 -> -1
+ddmin093 min Inf -0 -> -0
+ddmin094 min Inf 0 -> 0
+ddmin095 min Inf 1 -> 1
+ddmin096 min Inf 1000 -> 1000
+ddmin097 min Inf Inf -> Infinity
+ddmin098 min -1000 Inf -> -1000
+ddmin099 min -Inf Inf -> -Infinity
+ddmin100 min -1 Inf -> -1
+ddmin101 min -0 Inf -> -0
+ddmin102 min 0 Inf -> 0
+ddmin103 min 1 Inf -> 1
+ddmin104 min 1000 Inf -> 1000
+ddmin105 min Inf Inf -> Infinity
+
+ddmin120 min -Inf -Inf -> -Infinity
+ddmin121 min -Inf -1000 -> -Infinity
+ddmin122 min -Inf -1 -> -Infinity
+ddmin123 min -Inf -0 -> -Infinity
+ddmin124 min -Inf 0 -> -Infinity
+ddmin125 min -Inf 1 -> -Infinity
+ddmin126 min -Inf 1000 -> -Infinity
+ddmin127 min -Inf Inf -> -Infinity
+ddmin128 min -Inf -Inf -> -Infinity
+ddmin129 min -1000 -Inf -> -Infinity
+ddmin130 min -1 -Inf -> -Infinity
+ddmin131 min -0 -Inf -> -Infinity
+ddmin132 min 0 -Inf -> -Infinity
+ddmin133 min 1 -Inf -> -Infinity
+ddmin134 min 1000 -Inf -> -Infinity
+ddmin135 min Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+ddmin141 min NaN -Inf -> -Infinity
+ddmin142 min NaN -1000 -> -1000
+ddmin143 min NaN -1 -> -1
+ddmin144 min NaN -0 -> -0
+ddmin145 min NaN 0 -> 0
+ddmin146 min NaN 1 -> 1
+ddmin147 min NaN 1000 -> 1000
+ddmin148 min NaN Inf -> Infinity
+ddmin149 min NaN NaN -> NaN
+ddmin150 min -Inf NaN -> -Infinity
+ddmin151 min -1000 NaN -> -1000
+ddmin152 min -1 -NaN -> -1
+ddmin153 min -0 NaN -> -0
+ddmin154 min 0 -NaN -> 0
+ddmin155 min 1 NaN -> 1
+ddmin156 min 1000 NaN -> 1000
+ddmin157 min Inf NaN -> Infinity
+
+ddmin161 min sNaN -Inf -> NaN Invalid_operation
+ddmin162 min sNaN -1000 -> NaN Invalid_operation
+ddmin163 min sNaN -1 -> NaN Invalid_operation
+ddmin164 min sNaN -0 -> NaN Invalid_operation
+ddmin165 min -sNaN 0 -> -NaN Invalid_operation
+ddmin166 min -sNaN 1 -> -NaN Invalid_operation
+ddmin167 min sNaN 1000 -> NaN Invalid_operation
+ddmin168 min sNaN NaN -> NaN Invalid_operation
+ddmin169 min sNaN sNaN -> NaN Invalid_operation
+ddmin170 min NaN sNaN -> NaN Invalid_operation
+ddmin171 min -Inf sNaN -> NaN Invalid_operation
+ddmin172 min -1000 sNaN -> NaN Invalid_operation
+ddmin173 min -1 sNaN -> NaN Invalid_operation
+ddmin174 min -0 sNaN -> NaN Invalid_operation
+ddmin175 min 0 sNaN -> NaN Invalid_operation
+ddmin176 min 1 sNaN -> NaN Invalid_operation
+ddmin177 min 1000 sNaN -> NaN Invalid_operation
+ddmin178 min Inf sNaN -> NaN Invalid_operation
+ddmin179 min NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmin181 min NaN9 -Inf -> -Infinity
+ddmin182 min -NaN8 9990 -> 9990
+ddmin183 min NaN71 Inf -> Infinity
+
+ddmin184 min NaN1 NaN54 -> NaN1
+ddmin185 min NaN22 -NaN53 -> NaN22
+ddmin186 min -NaN3 NaN6 -> -NaN3
+ddmin187 min -NaN44 NaN7 -> -NaN44
+
+ddmin188 min -Inf NaN41 -> -Infinity
+ddmin189 min -9999 -NaN33 -> -9999
+ddmin190 min Inf NaN2 -> Infinity
+
+ddmin191 min sNaN99 -Inf -> NaN99 Invalid_operation
+ddmin192 min sNaN98 -11 -> NaN98 Invalid_operation
+ddmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation
+ddmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
+ddmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmin196 min -Inf sNaN92 -> NaN92 Invalid_operation
+ddmin197 min 088 sNaN91 -> NaN91 Invalid_operation
+ddmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmin199 min NaN sNaN86 -> NaN86 Invalid_operation
+
+-- old rounding checks
+ddmin221 min -12345678000 1 -> -12345678000
+ddmin222 min 1 -12345678000 -> -12345678000
+ddmin223 min -1234567800 1 -> -1234567800
+ddmin224 min 1 -1234567800 -> -1234567800
+ddmin225 min -1234567890 1 -> -1234567890
+ddmin226 min 1 -1234567890 -> -1234567890
+ddmin227 min -1234567891 1 -> -1234567891
+ddmin228 min 1 -1234567891 -> -1234567891
+ddmin229 min -12345678901 1 -> -12345678901
+ddmin230 min 1 -12345678901 -> -12345678901
+ddmin231 min -1234567896 1 -> -1234567896
+ddmin232 min 1 -1234567896 -> -1234567896
+ddmin233 min 1234567891 1 -> 1
+ddmin234 min 1 1234567891 -> 1
+ddmin235 min 12345678901 1 -> 1
+ddmin236 min 1 12345678901 -> 1
+ddmin237 min 1234567896 1 -> 1
+ddmin238 min 1 1234567896 -> 1
+
+-- from examples
+ddmin280 min '3' '2' -> '2'
+ddmin281 min '-10' '3' -> '-10'
+ddmin282 min '1.0' '1' -> '1.0'
+ddmin283 min '1' '1.0' -> '1.0'
+ddmin284 min '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+ddmin401 min Inf 1.1 -> 1.1
+ddmin402 min 1.1 1 -> 1
+ddmin403 min 1 1.0 -> 1.0
+ddmin404 min 1.0 0.1 -> 0.1
+ddmin405 min 0.1 0.10 -> 0.10
+ddmin406 min 0.10 0.100 -> 0.100
+ddmin407 min 0.10 0 -> 0
+ddmin408 min 0 0.0 -> 0.0
+ddmin409 min 0.0 -0 -> -0
+ddmin410 min 0.0 -0.0 -> -0.0
+ddmin411 min 0.00 -0.0 -> -0.0
+ddmin412 min 0.0 -0.00 -> -0.00
+ddmin413 min 0 -0.0 -> -0.0
+ddmin414 min 0 -0 -> -0
+ddmin415 min -0.0 -0 -> -0
+ddmin416 min -0 -0.100 -> -0.100
+ddmin417 min -0.100 -0.10 -> -0.10
+ddmin418 min -0.10 -0.1 -> -0.1
+ddmin419 min -0.1 -1.0 -> -1.0
+ddmin420 min -1.0 -1 -> -1
+ddmin421 min -1 -1.1 -> -1.1
+ddmin423 min -1.1 -Inf -> -Infinity
+-- same with operands reversed
+ddmin431 min 1.1 Inf -> 1.1
+ddmin432 min 1 1.1 -> 1
+ddmin433 min 1.0 1 -> 1.0
+ddmin434 min 0.1 1.0 -> 0.1
+ddmin435 min 0.10 0.1 -> 0.10
+ddmin436 min 0.100 0.10 -> 0.100
+ddmin437 min 0 0.10 -> 0
+ddmin438 min 0.0 0 -> 0.0
+ddmin439 min -0 0.0 -> -0
+ddmin440 min -0.0 0.0 -> -0.0
+ddmin441 min -0.0 0.00 -> -0.0
+ddmin442 min -0.00 0.0 -> -0.00
+ddmin443 min -0.0 0 -> -0.0
+ddmin444 min -0 0 -> -0
+ddmin445 min -0 -0.0 -> -0
+ddmin446 min -0.100 -0 -> -0.100
+ddmin447 min -0.10 -0.100 -> -0.10
+ddmin448 min -0.1 -0.10 -> -0.1
+ddmin449 min -1.0 -0.1 -> -1.0
+ddmin450 min -1 -1.0 -> -1
+ddmin451 min -1.1 -1 -> -1.1
+ddmin453 min -Inf -1.1 -> -Infinity
+-- largies
+ddmin460 min 1000 1E+3 -> 1000
+ddmin461 min 1E+3 1000 -> 1000
+ddmin462 min 1000 -1E+3 -> -1E+3
+ddmin463 min 1E+3 -384 -> -384
+ddmin464 min -384 1E+3 -> -384
+ddmin465 min -1E+3 1000 -> -1E+3
+ddmin466 min -384 -1E+3 -> -1E+3
+ddmin467 min -1E+3 -384 -> -1E+3
+
+-- misalignment traps for little-endian
+ddmin471 min 1.0 0.1 -> 0.1
+ddmin472 min 0.1 1.0 -> 0.1
+ddmin473 min 10.0 0.1 -> 0.1
+ddmin474 min 0.1 10.0 -> 0.1
+ddmin475 min 100 1.0 -> 1.0
+ddmin476 min 1.0 100 -> 1.0
+ddmin477 min 1000 10.0 -> 10.0
+ddmin478 min 10.0 1000 -> 10.0
+ddmin479 min 10000 100.0 -> 100.0
+ddmin480 min 100.0 10000 -> 100.0
+ddmin481 min 100000 1000.0 -> 1000.0
+ddmin482 min 1000.0 100000 -> 1000.0
+ddmin483 min 1000000 10000.0 -> 10000.0
+ddmin484 min 10000.0 1000000 -> 10000.0
+
+-- subnormals
+ddmin510 min 1.00E-383 0 -> 0
+ddmin511 min 0.1E-383 0 -> 0
+ddmin512 min 0.10E-383 0 -> 0
+ddmin513 min 0.100E-383 0 -> 0
+ddmin514 min 0.01E-383 0 -> 0
+ddmin515 min 0.999E-383 0 -> 0
+ddmin516 min 0.099E-383 0 -> 0
+ddmin517 min 0.009E-383 0 -> 0
+ddmin518 min 0.001E-383 0 -> 0
+ddmin519 min 0.0009E-383 0 -> 0
+ddmin520 min 0.0001E-383 0 -> 0
+
+ddmin530 min -1.00E-383 0 -> -1.00E-383
+ddmin531 min -0.1E-383 0 -> -1E-384 Subnormal
+ddmin532 min -0.10E-383 0 -> -1.0E-384 Subnormal
+ddmin533 min -0.100E-383 0 -> -1.00E-384 Subnormal
+ddmin534 min -0.01E-383 0 -> -1E-385 Subnormal
+ddmin535 min -0.999E-383 0 -> -9.99E-384 Subnormal
+ddmin536 min -0.099E-383 0 -> -9.9E-385 Subnormal
+ddmin537 min -0.009E-383 0 -> -9E-386 Subnormal
+ddmin538 min -0.001E-383 0 -> -1E-386 Subnormal
+ddmin539 min -0.0009E-383 0 -> -9E-387 Subnormal
+ddmin540 min -0.0001E-383 0 -> -1E-387 Subnormal
+
+
+-- Null tests
+ddmin900 min 10 # -> NaN Invalid_operation
+ddmin901 min # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddMinMag.decTest b/Lib/test/decimaltestdata/ddMinMag.decTest
index 1012f1ec81..5537cc8a7e 100644
--- a/Lib/test/decimaltestdata/ddMinMag.decTest
+++ b/Lib/test/decimaltestdata/ddMinMag.decTest
@@ -1,293 +1,293 @@
-------------------------------------------------------------------------
--- ddMinMag.decTest -- decDouble minnummag --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmng001 minmag -2 -2 -> -2
-ddmng002 minmag -2 -1 -> -1
-ddmng003 minmag -2 0 -> 0
-ddmng004 minmag -2 1 -> 1
-ddmng005 minmag -2 2 -> -2
-ddmng006 minmag -1 -2 -> -1
-ddmng007 minmag -1 -1 -> -1
-ddmng008 minmag -1 0 -> 0
-ddmng009 minmag -1 1 -> -1
-ddmng010 minmag -1 2 -> -1
-ddmng011 minmag 0 -2 -> 0
-ddmng012 minmag 0 -1 -> 0
-ddmng013 minmag 0 0 -> 0
-ddmng014 minmag 0 1 -> 0
-ddmng015 minmag 0 2 -> 0
-ddmng016 minmag 1 -2 -> 1
-ddmng017 minmag 1 -1 -> -1
-ddmng018 minmag 1 0 -> 0
-ddmng019 minmag 1 1 -> 1
-ddmng020 minmag 1 2 -> 1
-ddmng021 minmag 2 -2 -> -2
-ddmng022 minmag 2 -1 -> -1
-ddmng023 minmag 2 0 -> 0
-ddmng025 minmag 2 1 -> 1
-ddmng026 minmag 2 2 -> 2
-
--- extended zeros
-ddmng030 minmag 0 0 -> 0
-ddmng031 minmag 0 -0 -> -0
-ddmng032 minmag 0 -0.0 -> -0.0
-ddmng033 minmag 0 0.0 -> 0.0
-ddmng034 minmag -0 0 -> -0
-ddmng035 minmag -0 -0 -> -0
-ddmng036 minmag -0 -0.0 -> -0
-ddmng037 minmag -0 0.0 -> -0
-ddmng038 minmag 0.0 0 -> 0.0
-ddmng039 minmag 0.0 -0 -> -0
-ddmng040 minmag 0.0 -0.0 -> -0.0
-ddmng041 minmag 0.0 0.0 -> 0.0
-ddmng042 minmag -0.0 0 -> -0.0
-ddmng043 minmag -0.0 -0 -> -0
-ddmng044 minmag -0.0 -0.0 -> -0.0
-ddmng045 minmag -0.0 0.0 -> -0.0
-
-ddmng046 minmag 0E1 -0E1 -> -0E+1
-ddmng047 minmag -0E1 0E2 -> -0E+1
-ddmng048 minmag 0E2 0E1 -> 0E+1
-ddmng049 minmag 0E1 0E2 -> 0E+1
-ddmng050 minmag -0E3 -0E2 -> -0E+3
-ddmng051 minmag -0E2 -0E3 -> -0E+3
-
--- Specials
-ddmng090 minmag Inf -Inf -> -Infinity
-ddmng091 minmag Inf -1000 -> -1000
-ddmng092 minmag Inf -1 -> -1
-ddmng093 minmag Inf -0 -> -0
-ddmng094 minmag Inf 0 -> 0
-ddmng095 minmag Inf 1 -> 1
-ddmng096 minmag Inf 1000 -> 1000
-ddmng097 minmag Inf Inf -> Infinity
-ddmng098 minmag -1000 Inf -> -1000
-ddmng099 minmag -Inf Inf -> -Infinity
-ddmng100 minmag -1 Inf -> -1
-ddmng101 minmag -0 Inf -> -0
-ddmng102 minmag 0 Inf -> 0
-ddmng103 minmag 1 Inf -> 1
-ddmng104 minmag 1000 Inf -> 1000
-ddmng105 minmag Inf Inf -> Infinity
-
-ddmng120 minmag -Inf -Inf -> -Infinity
-ddmng121 minmag -Inf -1000 -> -1000
-ddmng122 minmag -Inf -1 -> -1
-ddmng123 minmag -Inf -0 -> -0
-ddmng124 minmag -Inf 0 -> 0
-ddmng125 minmag -Inf 1 -> 1
-ddmng126 minmag -Inf 1000 -> 1000
-ddmng127 minmag -Inf Inf -> -Infinity
-ddmng128 minmag -Inf -Inf -> -Infinity
-ddmng129 minmag -1000 -Inf -> -1000
-ddmng130 minmag -1 -Inf -> -1
-ddmng131 minmag -0 -Inf -> -0
-ddmng132 minmag 0 -Inf -> 0
-ddmng133 minmag 1 -Inf -> 1
-ddmng134 minmag 1000 -Inf -> 1000
-ddmng135 minmag Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-ddmng141 minmag NaN -Inf -> -Infinity
-ddmng142 minmag NaN -1000 -> -1000
-ddmng143 minmag NaN -1 -> -1
-ddmng144 minmag NaN -0 -> -0
-ddmng145 minmag NaN 0 -> 0
-ddmng146 minmag NaN 1 -> 1
-ddmng147 minmag NaN 1000 -> 1000
-ddmng148 minmag NaN Inf -> Infinity
-ddmng149 minmag NaN NaN -> NaN
-ddmng150 minmag -Inf NaN -> -Infinity
-ddmng151 minmag -1000 NaN -> -1000
-ddmng152 minmag -1 -NaN -> -1
-ddmng153 minmag -0 NaN -> -0
-ddmng154 minmag 0 -NaN -> 0
-ddmng155 minmag 1 NaN -> 1
-ddmng156 minmag 1000 NaN -> 1000
-ddmng157 minmag Inf NaN -> Infinity
-
-ddmng161 minmag sNaN -Inf -> NaN Invalid_operation
-ddmng162 minmag sNaN -1000 -> NaN Invalid_operation
-ddmng163 minmag sNaN -1 -> NaN Invalid_operation
-ddmng164 minmag sNaN -0 -> NaN Invalid_operation
-ddmng165 minmag -sNaN 0 -> -NaN Invalid_operation
-ddmng166 minmag -sNaN 1 -> -NaN Invalid_operation
-ddmng167 minmag sNaN 1000 -> NaN Invalid_operation
-ddmng168 minmag sNaN NaN -> NaN Invalid_operation
-ddmng169 minmag sNaN sNaN -> NaN Invalid_operation
-ddmng170 minmag NaN sNaN -> NaN Invalid_operation
-ddmng171 minmag -Inf sNaN -> NaN Invalid_operation
-ddmng172 minmag -1000 sNaN -> NaN Invalid_operation
-ddmng173 minmag -1 sNaN -> NaN Invalid_operation
-ddmng174 minmag -0 sNaN -> NaN Invalid_operation
-ddmng175 minmag 0 sNaN -> NaN Invalid_operation
-ddmng176 minmag 1 sNaN -> NaN Invalid_operation
-ddmng177 minmag 1000 sNaN -> NaN Invalid_operation
-ddmng178 minmag Inf sNaN -> NaN Invalid_operation
-ddmng179 minmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmng181 minmag NaN9 -Inf -> -Infinity
-ddmng182 minmag -NaN8 9990 -> 9990
-ddmng183 minmag NaN71 Inf -> Infinity
-
-ddmng184 minmag NaN1 NaN54 -> NaN1
-ddmng185 minmag NaN22 -NaN53 -> NaN22
-ddmng186 minmag -NaN3 NaN6 -> -NaN3
-ddmng187 minmag -NaN44 NaN7 -> -NaN44
-
-ddmng188 minmag -Inf NaN41 -> -Infinity
-ddmng189 minmag -9999 -NaN33 -> -9999
-ddmng190 minmag Inf NaN2 -> Infinity
-
-ddmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
-ddmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation
-ddmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
-ddmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
-ddmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
-ddmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation
-ddmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation
-
--- old rounding checks
-ddmng221 minmag -12345678000 1 -> 1
-ddmng222 minmag 1 -12345678000 -> 1
-ddmng223 minmag -1234567800 1 -> 1
-ddmng224 minmag 1 -1234567800 -> 1
-ddmng225 minmag -1234567890 1 -> 1
-ddmng226 minmag 1 -1234567890 -> 1
-ddmng227 minmag -1234567891 1 -> 1
-ddmng228 minmag 1 -1234567891 -> 1
-ddmng229 minmag -12345678901 1 -> 1
-ddmng230 minmag 1 -12345678901 -> 1
-ddmng231 minmag -1234567896 1 -> 1
-ddmng232 minmag 1 -1234567896 -> 1
-ddmng233 minmag 1234567891 1 -> 1
-ddmng234 minmag 1 1234567891 -> 1
-ddmng235 minmag 12345678901 1 -> 1
-ddmng236 minmag 1 12345678901 -> 1
-ddmng237 minmag 1234567896 1 -> 1
-ddmng238 minmag 1 1234567896 -> 1
-
--- from examples
-ddmng280 minmag '3' '2' -> '2'
-ddmng281 minmag '-10' '3' -> '3'
-ddmng282 minmag '1.0' '1' -> '1.0'
-ddmng283 minmag '1' '1.0' -> '1.0'
-ddmng284 minmag '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-ddmng401 minmag Inf 1.1 -> 1.1
-ddmng402 minmag 1.1 1 -> 1
-ddmng403 minmag 1 1.0 -> 1.0
-ddmng404 minmag 1.0 0.1 -> 0.1
-ddmng405 minmag 0.1 0.10 -> 0.10
-ddmng406 minmag 0.10 0.100 -> 0.100
-ddmng407 minmag 0.10 0 -> 0
-ddmng408 minmag 0 0.0 -> 0.0
-ddmng409 minmag 0.0 -0 -> -0
-ddmng410 minmag 0.0 -0.0 -> -0.0
-ddmng411 minmag 0.00 -0.0 -> -0.0
-ddmng412 minmag 0.0 -0.00 -> -0.00
-ddmng413 minmag 0 -0.0 -> -0.0
-ddmng414 minmag 0 -0 -> -0
-ddmng415 minmag -0.0 -0 -> -0
-ddmng416 minmag -0 -0.100 -> -0
-ddmng417 minmag -0.100 -0.10 -> -0.10
-ddmng418 minmag -0.10 -0.1 -> -0.1
-ddmng419 minmag -0.1 -1.0 -> -0.1
-ddmng420 minmag -1.0 -1 -> -1
-ddmng421 minmag -1 -1.1 -> -1
-ddmng423 minmag -1.1 -Inf -> -1.1
--- same with operands reversed
-ddmng431 minmag 1.1 Inf -> 1.1
-ddmng432 minmag 1 1.1 -> 1
-ddmng433 minmag 1.0 1 -> 1.0
-ddmng434 minmag 0.1 1.0 -> 0.1
-ddmng435 minmag 0.10 0.1 -> 0.10
-ddmng436 minmag 0.100 0.10 -> 0.100
-ddmng437 minmag 0 0.10 -> 0
-ddmng438 minmag 0.0 0 -> 0.0
-ddmng439 minmag -0 0.0 -> -0
-ddmng440 minmag -0.0 0.0 -> -0.0
-ddmng441 minmag -0.0 0.00 -> -0.0
-ddmng442 minmag -0.00 0.0 -> -0.00
-ddmng443 minmag -0.0 0 -> -0.0
-ddmng444 minmag -0 0 -> -0
-ddmng445 minmag -0 -0.0 -> -0
-ddmng446 minmag -0.100 -0 -> -0
-ddmng447 minmag -0.10 -0.100 -> -0.10
-ddmng448 minmag -0.1 -0.10 -> -0.1
-ddmng449 minmag -1.0 -0.1 -> -0.1
-ddmng450 minmag -1 -1.0 -> -1
-ddmng451 minmag -1.1 -1 -> -1
-ddmng453 minmag -Inf -1.1 -> -1.1
--- largies
-ddmng460 minmag 1000 1E+3 -> 1000
-ddmng461 minmag 1E+3 1000 -> 1000
-ddmng462 minmag 1000 -1E+3 -> -1E+3
-ddmng463 minmag 1E+3 -384 -> -384
-ddmng464 minmag -384 1E+3 -> -384
-ddmng465 minmag -1E+3 1000 -> -1E+3
-ddmng466 minmag -384 -1E+3 -> -384
-ddmng467 minmag -1E+3 -384 -> -384
-
--- subnormals
-ddmng510 minmag 1.00E-383 0 -> 0
-ddmng511 minmag 0.1E-383 0 -> 0
-ddmng512 minmag 0.10E-383 0 -> 0
-ddmng513 minmag 0.100E-383 0 -> 0
-ddmng514 minmag 0.01E-383 0 -> 0
-ddmng515 minmag 0.999E-383 0 -> 0
-ddmng516 minmag 0.099E-383 0 -> 0
-ddmng517 minmag 0.009E-383 0 -> 0
-ddmng518 minmag 0.001E-383 0 -> 0
-ddmng519 minmag 0.0009E-383 0 -> 0
-ddmng520 minmag 0.0001E-383 0 -> 0
-
-ddmng530 minmag -1.00E-383 0 -> 0
-ddmng531 minmag -0.1E-383 0 -> 0
-ddmng532 minmag -0.10E-383 0 -> 0
-ddmng533 minmag -0.100E-383 0 -> 0
-ddmng534 minmag -0.01E-383 0 -> 0
-ddmng535 minmag -0.999E-383 0 -> 0
-ddmng536 minmag -0.099E-383 0 -> 0
-ddmng537 minmag -0.009E-383 0 -> 0
-ddmng538 minmag -0.001E-383 0 -> 0
-ddmng539 minmag -0.0009E-383 0 -> 0
-ddmng540 minmag -0.0001E-383 0 -> 0
-
-
--- Null tests
-ddmng900 minmag 10 # -> NaN Invalid_operation
-ddmng901 minmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddMinMag.decTest -- decDouble minnummag --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmng001 minmag -2 -2 -> -2
+ddmng002 minmag -2 -1 -> -1
+ddmng003 minmag -2 0 -> 0
+ddmng004 minmag -2 1 -> 1
+ddmng005 minmag -2 2 -> -2
+ddmng006 minmag -1 -2 -> -1
+ddmng007 minmag -1 -1 -> -1
+ddmng008 minmag -1 0 -> 0
+ddmng009 minmag -1 1 -> -1
+ddmng010 minmag -1 2 -> -1
+ddmng011 minmag 0 -2 -> 0
+ddmng012 minmag 0 -1 -> 0
+ddmng013 minmag 0 0 -> 0
+ddmng014 minmag 0 1 -> 0
+ddmng015 minmag 0 2 -> 0
+ddmng016 minmag 1 -2 -> 1
+ddmng017 minmag 1 -1 -> -1
+ddmng018 minmag 1 0 -> 0
+ddmng019 minmag 1 1 -> 1
+ddmng020 minmag 1 2 -> 1
+ddmng021 minmag 2 -2 -> -2
+ddmng022 minmag 2 -1 -> -1
+ddmng023 minmag 2 0 -> 0
+ddmng025 minmag 2 1 -> 1
+ddmng026 minmag 2 2 -> 2
+
+-- extended zeros
+ddmng030 minmag 0 0 -> 0
+ddmng031 minmag 0 -0 -> -0
+ddmng032 minmag 0 -0.0 -> -0.0
+ddmng033 minmag 0 0.0 -> 0.0
+ddmng034 minmag -0 0 -> -0
+ddmng035 minmag -0 -0 -> -0
+ddmng036 minmag -0 -0.0 -> -0
+ddmng037 minmag -0 0.0 -> -0
+ddmng038 minmag 0.0 0 -> 0.0
+ddmng039 minmag 0.0 -0 -> -0
+ddmng040 minmag 0.0 -0.0 -> -0.0
+ddmng041 minmag 0.0 0.0 -> 0.0
+ddmng042 minmag -0.0 0 -> -0.0
+ddmng043 minmag -0.0 -0 -> -0
+ddmng044 minmag -0.0 -0.0 -> -0.0
+ddmng045 minmag -0.0 0.0 -> -0.0
+
+ddmng046 minmag 0E1 -0E1 -> -0E+1
+ddmng047 minmag -0E1 0E2 -> -0E+1
+ddmng048 minmag 0E2 0E1 -> 0E+1
+ddmng049 minmag 0E1 0E2 -> 0E+1
+ddmng050 minmag -0E3 -0E2 -> -0E+3
+ddmng051 minmag -0E2 -0E3 -> -0E+3
+
+-- Specials
+ddmng090 minmag Inf -Inf -> -Infinity
+ddmng091 minmag Inf -1000 -> -1000
+ddmng092 minmag Inf -1 -> -1
+ddmng093 minmag Inf -0 -> -0
+ddmng094 minmag Inf 0 -> 0
+ddmng095 minmag Inf 1 -> 1
+ddmng096 minmag Inf 1000 -> 1000
+ddmng097 minmag Inf Inf -> Infinity
+ddmng098 minmag -1000 Inf -> -1000
+ddmng099 minmag -Inf Inf -> -Infinity
+ddmng100 minmag -1 Inf -> -1
+ddmng101 minmag -0 Inf -> -0
+ddmng102 minmag 0 Inf -> 0
+ddmng103 minmag 1 Inf -> 1
+ddmng104 minmag 1000 Inf -> 1000
+ddmng105 minmag Inf Inf -> Infinity
+
+ddmng120 minmag -Inf -Inf -> -Infinity
+ddmng121 minmag -Inf -1000 -> -1000
+ddmng122 minmag -Inf -1 -> -1
+ddmng123 minmag -Inf -0 -> -0
+ddmng124 minmag -Inf 0 -> 0
+ddmng125 minmag -Inf 1 -> 1
+ddmng126 minmag -Inf 1000 -> 1000
+ddmng127 minmag -Inf Inf -> -Infinity
+ddmng128 minmag -Inf -Inf -> -Infinity
+ddmng129 minmag -1000 -Inf -> -1000
+ddmng130 minmag -1 -Inf -> -1
+ddmng131 minmag -0 -Inf -> -0
+ddmng132 minmag 0 -Inf -> 0
+ddmng133 minmag 1 -Inf -> 1
+ddmng134 minmag 1000 -Inf -> 1000
+ddmng135 minmag Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+ddmng141 minmag NaN -Inf -> -Infinity
+ddmng142 minmag NaN -1000 -> -1000
+ddmng143 minmag NaN -1 -> -1
+ddmng144 minmag NaN -0 -> -0
+ddmng145 minmag NaN 0 -> 0
+ddmng146 minmag NaN 1 -> 1
+ddmng147 minmag NaN 1000 -> 1000
+ddmng148 minmag NaN Inf -> Infinity
+ddmng149 minmag NaN NaN -> NaN
+ddmng150 minmag -Inf NaN -> -Infinity
+ddmng151 minmag -1000 NaN -> -1000
+ddmng152 minmag -1 -NaN -> -1
+ddmng153 minmag -0 NaN -> -0
+ddmng154 minmag 0 -NaN -> 0
+ddmng155 minmag 1 NaN -> 1
+ddmng156 minmag 1000 NaN -> 1000
+ddmng157 minmag Inf NaN -> Infinity
+
+ddmng161 minmag sNaN -Inf -> NaN Invalid_operation
+ddmng162 minmag sNaN -1000 -> NaN Invalid_operation
+ddmng163 minmag sNaN -1 -> NaN Invalid_operation
+ddmng164 minmag sNaN -0 -> NaN Invalid_operation
+ddmng165 minmag -sNaN 0 -> -NaN Invalid_operation
+ddmng166 minmag -sNaN 1 -> -NaN Invalid_operation
+ddmng167 minmag sNaN 1000 -> NaN Invalid_operation
+ddmng168 minmag sNaN NaN -> NaN Invalid_operation
+ddmng169 minmag sNaN sNaN -> NaN Invalid_operation
+ddmng170 minmag NaN sNaN -> NaN Invalid_operation
+ddmng171 minmag -Inf sNaN -> NaN Invalid_operation
+ddmng172 minmag -1000 sNaN -> NaN Invalid_operation
+ddmng173 minmag -1 sNaN -> NaN Invalid_operation
+ddmng174 minmag -0 sNaN -> NaN Invalid_operation
+ddmng175 minmag 0 sNaN -> NaN Invalid_operation
+ddmng176 minmag 1 sNaN -> NaN Invalid_operation
+ddmng177 minmag 1000 sNaN -> NaN Invalid_operation
+ddmng178 minmag Inf sNaN -> NaN Invalid_operation
+ddmng179 minmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmng181 minmag NaN9 -Inf -> -Infinity
+ddmng182 minmag -NaN8 9990 -> 9990
+ddmng183 minmag NaN71 Inf -> Infinity
+
+ddmng184 minmag NaN1 NaN54 -> NaN1
+ddmng185 minmag NaN22 -NaN53 -> NaN22
+ddmng186 minmag -NaN3 NaN6 -> -NaN3
+ddmng187 minmag -NaN44 NaN7 -> -NaN44
+
+ddmng188 minmag -Inf NaN41 -> -Infinity
+ddmng189 minmag -9999 -NaN33 -> -9999
+ddmng190 minmag Inf NaN2 -> Infinity
+
+ddmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
+ddmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation
+ddmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
+ddmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
+ddmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
+ddmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation
+ddmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation
+
+-- old rounding checks
+ddmng221 minmag -12345678000 1 -> 1
+ddmng222 minmag 1 -12345678000 -> 1
+ddmng223 minmag -1234567800 1 -> 1
+ddmng224 minmag 1 -1234567800 -> 1
+ddmng225 minmag -1234567890 1 -> 1
+ddmng226 minmag 1 -1234567890 -> 1
+ddmng227 minmag -1234567891 1 -> 1
+ddmng228 minmag 1 -1234567891 -> 1
+ddmng229 minmag -12345678901 1 -> 1
+ddmng230 minmag 1 -12345678901 -> 1
+ddmng231 minmag -1234567896 1 -> 1
+ddmng232 minmag 1 -1234567896 -> 1
+ddmng233 minmag 1234567891 1 -> 1
+ddmng234 minmag 1 1234567891 -> 1
+ddmng235 minmag 12345678901 1 -> 1
+ddmng236 minmag 1 12345678901 -> 1
+ddmng237 minmag 1234567896 1 -> 1
+ddmng238 minmag 1 1234567896 -> 1
+
+-- from examples
+ddmng280 minmag '3' '2' -> '2'
+ddmng281 minmag '-10' '3' -> '3'
+ddmng282 minmag '1.0' '1' -> '1.0'
+ddmng283 minmag '1' '1.0' -> '1.0'
+ddmng284 minmag '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+ddmng401 minmag Inf 1.1 -> 1.1
+ddmng402 minmag 1.1 1 -> 1
+ddmng403 minmag 1 1.0 -> 1.0
+ddmng404 minmag 1.0 0.1 -> 0.1
+ddmng405 minmag 0.1 0.10 -> 0.10
+ddmng406 minmag 0.10 0.100 -> 0.100
+ddmng407 minmag 0.10 0 -> 0
+ddmng408 minmag 0 0.0 -> 0.0
+ddmng409 minmag 0.0 -0 -> -0
+ddmng410 minmag 0.0 -0.0 -> -0.0
+ddmng411 minmag 0.00 -0.0 -> -0.0
+ddmng412 minmag 0.0 -0.00 -> -0.00
+ddmng413 minmag 0 -0.0 -> -0.0
+ddmng414 minmag 0 -0 -> -0
+ddmng415 minmag -0.0 -0 -> -0
+ddmng416 minmag -0 -0.100 -> -0
+ddmng417 minmag -0.100 -0.10 -> -0.10
+ddmng418 minmag -0.10 -0.1 -> -0.1
+ddmng419 minmag -0.1 -1.0 -> -0.1
+ddmng420 minmag -1.0 -1 -> -1
+ddmng421 minmag -1 -1.1 -> -1
+ddmng423 minmag -1.1 -Inf -> -1.1
+-- same with operands reversed
+ddmng431 minmag 1.1 Inf -> 1.1
+ddmng432 minmag 1 1.1 -> 1
+ddmng433 minmag 1.0 1 -> 1.0
+ddmng434 minmag 0.1 1.0 -> 0.1
+ddmng435 minmag 0.10 0.1 -> 0.10
+ddmng436 minmag 0.100 0.10 -> 0.100
+ddmng437 minmag 0 0.10 -> 0
+ddmng438 minmag 0.0 0 -> 0.0
+ddmng439 minmag -0 0.0 -> -0
+ddmng440 minmag -0.0 0.0 -> -0.0
+ddmng441 minmag -0.0 0.00 -> -0.0
+ddmng442 minmag -0.00 0.0 -> -0.00
+ddmng443 minmag -0.0 0 -> -0.0
+ddmng444 minmag -0 0 -> -0
+ddmng445 minmag -0 -0.0 -> -0
+ddmng446 minmag -0.100 -0 -> -0
+ddmng447 minmag -0.10 -0.100 -> -0.10
+ddmng448 minmag -0.1 -0.10 -> -0.1
+ddmng449 minmag -1.0 -0.1 -> -0.1
+ddmng450 minmag -1 -1.0 -> -1
+ddmng451 minmag -1.1 -1 -> -1
+ddmng453 minmag -Inf -1.1 -> -1.1
+-- largies
+ddmng460 minmag 1000 1E+3 -> 1000
+ddmng461 minmag 1E+3 1000 -> 1000
+ddmng462 minmag 1000 -1E+3 -> -1E+3
+ddmng463 minmag 1E+3 -384 -> -384
+ddmng464 minmag -384 1E+3 -> -384
+ddmng465 minmag -1E+3 1000 -> -1E+3
+ddmng466 minmag -384 -1E+3 -> -384
+ddmng467 minmag -1E+3 -384 -> -384
+
+-- subnormals
+ddmng510 minmag 1.00E-383 0 -> 0
+ddmng511 minmag 0.1E-383 0 -> 0
+ddmng512 minmag 0.10E-383 0 -> 0
+ddmng513 minmag 0.100E-383 0 -> 0
+ddmng514 minmag 0.01E-383 0 -> 0
+ddmng515 minmag 0.999E-383 0 -> 0
+ddmng516 minmag 0.099E-383 0 -> 0
+ddmng517 minmag 0.009E-383 0 -> 0
+ddmng518 minmag 0.001E-383 0 -> 0
+ddmng519 minmag 0.0009E-383 0 -> 0
+ddmng520 minmag 0.0001E-383 0 -> 0
+
+ddmng530 minmag -1.00E-383 0 -> 0
+ddmng531 minmag -0.1E-383 0 -> 0
+ddmng532 minmag -0.10E-383 0 -> 0
+ddmng533 minmag -0.100E-383 0 -> 0
+ddmng534 minmag -0.01E-383 0 -> 0
+ddmng535 minmag -0.999E-383 0 -> 0
+ddmng536 minmag -0.099E-383 0 -> 0
+ddmng537 minmag -0.009E-383 0 -> 0
+ddmng538 minmag -0.001E-383 0 -> 0
+ddmng539 minmag -0.0009E-383 0 -> 0
+ddmng540 minmag -0.0001E-383 0 -> 0
+
+
+-- Null tests
+ddmng900 minmag 10 # -> NaN Invalid_operation
+ddmng901 minmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddMinus.decTest b/Lib/test/decimaltestdata/ddMinus.decTest
index b7ffff7d89..2705e79ea2 100644
--- a/Lib/test/decimaltestdata/ddMinus.decTest
+++ b/Lib/test/decimaltestdata/ddMinus.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddMinus.decTest -- decDouble 0-x --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddmns001 minus +7.50 -> -7.50
-
--- Infinities
-ddmns011 minus Infinity -> -Infinity
-ddmns012 minus -Infinity -> Infinity
-
--- NaNs, 0 payload
-ddmns021 minus NaN -> NaN
-ddmns022 minus -NaN -> -NaN
-ddmns023 minus sNaN -> NaN Invalid_operation
-ddmns024 minus -sNaN -> -NaN Invalid_operation
-
--- NaNs, non-0 payload
-ddmns031 minus NaN13 -> NaN13
-ddmns032 minus -NaN13 -> -NaN13
-ddmns033 minus sNaN13 -> NaN13 Invalid_operation
-ddmns034 minus -sNaN13 -> -NaN13 Invalid_operation
-ddmns035 minus NaN70 -> NaN70
-ddmns036 minus -NaN70 -> -NaN70
-ddmns037 minus sNaN101 -> NaN101 Invalid_operation
-ddmns038 minus -sNaN101 -> -NaN101 Invalid_operation
-
--- finites
-ddmns101 minus 7 -> -7
-ddmns102 minus -7 -> 7
-ddmns103 minus 75 -> -75
-ddmns104 minus -75 -> 75
-ddmns105 minus 7.50 -> -7.50
-ddmns106 minus -7.50 -> 7.50
-ddmns107 minus 7.500 -> -7.500
-ddmns108 minus -7.500 -> 7.500
-
--- zeros
-ddmns111 minus 0 -> 0
-ddmns112 minus -0 -> 0
-ddmns113 minus 0E+4 -> 0E+4
-ddmns114 minus -0E+4 -> 0E+4
-ddmns115 minus 0.0000 -> 0.0000
-ddmns116 minus -0.0000 -> 0.0000
-ddmns117 minus 0E-141 -> 0E-141
-ddmns118 minus -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddmns121 minus 2682682682682682 -> -2682682682682682
-ddmns122 minus -2682682682682682 -> 2682682682682682
-ddmns123 minus 1341341341341341 -> -1341341341341341
-ddmns124 minus -1341341341341341 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddmns131 minus 9.999999999999999E+384 -> -9.999999999999999E+384
-ddmns132 minus 1E-383 -> -1E-383
-ddmns133 minus 1.000000000000000E-383 -> -1.000000000000000E-383
-ddmns134 minus 1E-398 -> -1E-398 Subnormal
-
-ddmns135 minus -1E-398 -> 1E-398 Subnormal
-ddmns136 minus -1.000000000000000E-383 -> 1.000000000000000E-383
-ddmns137 minus -1E-383 -> 1E-383
-ddmns138 minus -9.999999999999999E+384 -> 9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddMinus.decTest -- decDouble 0-x --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddmns001 minus +7.50 -> -7.50
+
+-- Infinities
+ddmns011 minus Infinity -> -Infinity
+ddmns012 minus -Infinity -> Infinity
+
+-- NaNs, 0 payload
+ddmns021 minus NaN -> NaN
+ddmns022 minus -NaN -> -NaN
+ddmns023 minus sNaN -> NaN Invalid_operation
+ddmns024 minus -sNaN -> -NaN Invalid_operation
+
+-- NaNs, non-0 payload
+ddmns031 minus NaN13 -> NaN13
+ddmns032 minus -NaN13 -> -NaN13
+ddmns033 minus sNaN13 -> NaN13 Invalid_operation
+ddmns034 minus -sNaN13 -> -NaN13 Invalid_operation
+ddmns035 minus NaN70 -> NaN70
+ddmns036 minus -NaN70 -> -NaN70
+ddmns037 minus sNaN101 -> NaN101 Invalid_operation
+ddmns038 minus -sNaN101 -> -NaN101 Invalid_operation
+
+-- finites
+ddmns101 minus 7 -> -7
+ddmns102 minus -7 -> 7
+ddmns103 minus 75 -> -75
+ddmns104 minus -75 -> 75
+ddmns105 minus 7.50 -> -7.50
+ddmns106 minus -7.50 -> 7.50
+ddmns107 minus 7.500 -> -7.500
+ddmns108 minus -7.500 -> 7.500
+
+-- zeros
+ddmns111 minus 0 -> 0
+ddmns112 minus -0 -> 0
+ddmns113 minus 0E+4 -> 0E+4
+ddmns114 minus -0E+4 -> 0E+4
+ddmns115 minus 0.0000 -> 0.0000
+ddmns116 minus -0.0000 -> 0.0000
+ddmns117 minus 0E-141 -> 0E-141
+ddmns118 minus -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddmns121 minus 2682682682682682 -> -2682682682682682
+ddmns122 minus -2682682682682682 -> 2682682682682682
+ddmns123 minus 1341341341341341 -> -1341341341341341
+ddmns124 minus -1341341341341341 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddmns131 minus 9.999999999999999E+384 -> -9.999999999999999E+384
+ddmns132 minus 1E-383 -> -1E-383
+ddmns133 minus 1.000000000000000E-383 -> -1.000000000000000E-383
+ddmns134 minus 1E-398 -> -1E-398 Subnormal
+
+ddmns135 minus -1E-398 -> 1E-398 Subnormal
+ddmns136 minus -1.000000000000000E-383 -> 1.000000000000000E-383
+ddmns137 minus -1E-383 -> 1E-383
+ddmns138 minus -9.999999999999999E+384 -> 9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddMultiply.decTest b/Lib/test/decimaltestdata/ddMultiply.decTest
index 5873f80345..45a381dc61 100644
--- a/Lib/test/decimaltestdata/ddMultiply.decTest
+++ b/Lib/test/decimaltestdata/ddMultiply.decTest
@@ -1,553 +1,553 @@
-------------------------------------------------------------------------
--- ddMultiply.decTest -- decDouble multiplication --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decDoubles only; all arguments are
--- representable in a decDouble
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmul000 multiply 2 2 -> 4
-ddmul001 multiply 2 3 -> 6
-ddmul002 multiply 5 1 -> 5
-ddmul003 multiply 5 2 -> 10
-ddmul004 multiply 1.20 2 -> 2.40
-ddmul005 multiply 1.20 0 -> 0.00
-ddmul006 multiply 1.20 -2 -> -2.40
-ddmul007 multiply -1.20 2 -> -2.40
-ddmul008 multiply -1.20 0 -> -0.00
-ddmul009 multiply -1.20 -2 -> 2.40
-ddmul010 multiply 5.09 7.1 -> 36.139
-ddmul011 multiply 2.5 4 -> 10.0
-ddmul012 multiply 2.50 4 -> 10.00
-ddmul013 multiply 1.23456789 1.00000000 -> 1.234567890000000 Rounded
-ddmul015 multiply 2.50 4 -> 10.00
-ddmul016 multiply 9.999999999 9.999999999 -> 99.99999998000000 Inexact Rounded
-ddmul017 multiply 9.999999999 -9.999999999 -> -99.99999998000000 Inexact Rounded
-ddmul018 multiply -9.999999999 9.999999999 -> -99.99999998000000 Inexact Rounded
-ddmul019 multiply -9.999999999 -9.999999999 -> 99.99999998000000 Inexact Rounded
-
--- zeros, etc.
-ddmul021 multiply 0 0 -> 0
-ddmul022 multiply 0 -0 -> -0
-ddmul023 multiply -0 0 -> -0
-ddmul024 multiply -0 -0 -> 0
-ddmul025 multiply -0.0 -0.0 -> 0.00
-ddmul026 multiply -0.0 -0.0 -> 0.00
-ddmul027 multiply -0.0 -0.0 -> 0.00
-ddmul028 multiply -0.0 -0.0 -> 0.00
-ddmul030 multiply 5.00 1E-3 -> 0.00500
-ddmul031 multiply 00.00 0.000 -> 0.00000
-ddmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
-ddmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
-ddmul034 multiply -5.00 1E-3 -> -0.00500
-ddmul035 multiply -00.00 0.000 -> -0.00000
-ddmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
-ddmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
-ddmul038 multiply 5.00 -1E-3 -> -0.00500
-ddmul039 multiply 00.00 -0.000 -> -0.00000
-ddmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
-ddmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
-ddmul042 multiply -5.00 -1E-3 -> 0.00500
-ddmul043 multiply -00.00 -0.000 -> 0.00000
-ddmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
-ddmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
-
--- examples from decarith
-ddmul050 multiply 1.20 3 -> 3.60
-ddmul051 multiply 7 3 -> 21
-ddmul052 multiply 0.9 0.8 -> 0.72
-ddmul053 multiply 0.9 -0 -> -0.0
-ddmul054 multiply 654321 654321 -> 428135971041
-
-ddmul060 multiply 123.45 1e7 -> 1.2345E+9
-ddmul061 multiply 123.45 1e8 -> 1.2345E+10
-ddmul062 multiply 123.45 1e+9 -> 1.2345E+11
-ddmul063 multiply 123.45 1e10 -> 1.2345E+12
-ddmul064 multiply 123.45 1e11 -> 1.2345E+13
-ddmul065 multiply 123.45 1e12 -> 1.2345E+14
-ddmul066 multiply 123.45 1e13 -> 1.2345E+15
-
-
--- test some intermediate lengths
--- 1234567890123456
-ddmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
-ddmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
-ddmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
-ddmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
-
--- test some more edge cases and carries
-ddmul101 multiply 9 9 -> 81
-ddmul102 multiply 9 90 -> 810
-ddmul103 multiply 9 900 -> 8100
-ddmul104 multiply 9 9000 -> 81000
-ddmul105 multiply 9 90000 -> 810000
-ddmul106 multiply 9 900000 -> 8100000
-ddmul107 multiply 9 9000000 -> 81000000
-ddmul108 multiply 9 90000000 -> 810000000
-ddmul109 multiply 9 900000000 -> 8100000000
-ddmul110 multiply 9 9000000000 -> 81000000000
-ddmul111 multiply 9 90000000000 -> 810000000000
-ddmul112 multiply 9 900000000000 -> 8100000000000
-ddmul113 multiply 9 9000000000000 -> 81000000000000
-ddmul114 multiply 9 90000000000000 -> 810000000000000
-ddmul115 multiply 9 900000000000000 -> 8100000000000000
---ddmul116 multiply 9 9000000000000000 -> 81000000000000000
---ddmul117 multiply 9 90000000000000000 -> 810000000000000000
---ddmul118 multiply 9 900000000000000000 -> 8100000000000000000
---ddmul119 multiply 9 9000000000000000000 -> 81000000000000000000
---ddmul120 multiply 9 90000000000000000000 -> 810000000000000000000
---ddmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
---ddmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
---ddmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
--- test some more edge cases without carries
-ddmul131 multiply 3 3 -> 9
-ddmul132 multiply 3 30 -> 90
-ddmul133 multiply 3 300 -> 900
-ddmul134 multiply 3 3000 -> 9000
-ddmul135 multiply 3 30000 -> 90000
-ddmul136 multiply 3 300000 -> 900000
-ddmul137 multiply 3 3000000 -> 9000000
-ddmul138 multiply 3 30000000 -> 90000000
-ddmul139 multiply 3 300000000 -> 900000000
-ddmul140 multiply 3 3000000000 -> 9000000000
-ddmul141 multiply 3 30000000000 -> 90000000000
-ddmul142 multiply 3 300000000000 -> 900000000000
-ddmul143 multiply 3 3000000000000 -> 9000000000000
-ddmul144 multiply 3 30000000000000 -> 90000000000000
-ddmul145 multiply 3 300000000000000 -> 900000000000000
-
--- test some edge cases with exact rounding
-ddmul301 multiply 9 9 -> 81
-ddmul302 multiply 9 90 -> 810
-ddmul303 multiply 9 900 -> 8100
-ddmul304 multiply 9 9000 -> 81000
-ddmul305 multiply 9 90000 -> 810000
-ddmul306 multiply 9 900000 -> 8100000
-ddmul307 multiply 9 9000000 -> 81000000
-ddmul308 multiply 9 90000000 -> 810000000
-ddmul309 multiply 9 900000000 -> 8100000000
-ddmul310 multiply 9 9000000000 -> 81000000000
-ddmul311 multiply 9 90000000000 -> 810000000000
-ddmul312 multiply 9 900000000000 -> 8100000000000
-ddmul313 multiply 9 9000000000000 -> 81000000000000
-ddmul314 multiply 9 90000000000000 -> 810000000000000
-ddmul315 multiply 9 900000000000000 -> 8100000000000000
-ddmul316 multiply 9 9000000000000000 -> 8.100000000000000E+16 Rounded
-ddmul317 multiply 90 9000000000000000 -> 8.100000000000000E+17 Rounded
-ddmul318 multiply 900 9000000000000000 -> 8.100000000000000E+18 Rounded
-ddmul319 multiply 9000 9000000000000000 -> 8.100000000000000E+19 Rounded
-ddmul320 multiply 90000 9000000000000000 -> 8.100000000000000E+20 Rounded
-ddmul321 multiply 900000 9000000000000000 -> 8.100000000000000E+21 Rounded
-ddmul322 multiply 9000000 9000000000000000 -> 8.100000000000000E+22 Rounded
-ddmul323 multiply 90000000 9000000000000000 -> 8.100000000000000E+23 Rounded
-
--- tryzeros cases
-ddmul504 multiply 0E-260 1000E-260 -> 0E-398 Clamped
-ddmul505 multiply 100E+260 0E+260 -> 0E+369 Clamped
--- 65K-1 case
-ddmul506 multiply 77.1 850 -> 65535.0
-
--- mixed with zeros
-ddmul541 multiply 0 -1 -> -0
-ddmul542 multiply -0 -1 -> 0
-ddmul543 multiply 0 1 -> 0
-ddmul544 multiply -0 1 -> -0
-ddmul545 multiply -1 0 -> -0
-ddmul546 multiply -1 -0 -> 0
-ddmul547 multiply 1 0 -> 0
-ddmul548 multiply 1 -0 -> -0
-
-ddmul551 multiply 0.0 -1 -> -0.0
-ddmul552 multiply -0.0 -1 -> 0.0
-ddmul553 multiply 0.0 1 -> 0.0
-ddmul554 multiply -0.0 1 -> -0.0
-ddmul555 multiply -1.0 0 -> -0.0
-ddmul556 multiply -1.0 -0 -> 0.0
-ddmul557 multiply 1.0 0 -> 0.0
-ddmul558 multiply 1.0 -0 -> -0.0
-
-ddmul561 multiply 0 -1.0 -> -0.0
-ddmul562 multiply -0 -1.0 -> 0.0
-ddmul563 multiply 0 1.0 -> 0.0
-ddmul564 multiply -0 1.0 -> -0.0
-ddmul565 multiply -1 0.0 -> -0.0
-ddmul566 multiply -1 -0.0 -> 0.0
-ddmul567 multiply 1 0.0 -> 0.0
-ddmul568 multiply 1 -0.0 -> -0.0
-
-ddmul571 multiply 0.0 -1.0 -> -0.00
-ddmul572 multiply -0.0 -1.0 -> 0.00
-ddmul573 multiply 0.0 1.0 -> 0.00
-ddmul574 multiply -0.0 1.0 -> -0.00
-ddmul575 multiply -1.0 0.0 -> -0.00
-ddmul576 multiply -1.0 -0.0 -> 0.00
-ddmul577 multiply 1.0 0.0 -> 0.00
-ddmul578 multiply 1.0 -0.0 -> -0.00
-
-
--- Specials
-ddmul580 multiply Inf -Inf -> -Infinity
-ddmul581 multiply Inf -1000 -> -Infinity
-ddmul582 multiply Inf -1 -> -Infinity
-ddmul583 multiply Inf -0 -> NaN Invalid_operation
-ddmul584 multiply Inf 0 -> NaN Invalid_operation
-ddmul585 multiply Inf 1 -> Infinity
-ddmul586 multiply Inf 1000 -> Infinity
-ddmul587 multiply Inf Inf -> Infinity
-ddmul588 multiply -1000 Inf -> -Infinity
-ddmul589 multiply -Inf Inf -> -Infinity
-ddmul590 multiply -1 Inf -> -Infinity
-ddmul591 multiply -0 Inf -> NaN Invalid_operation
-ddmul592 multiply 0 Inf -> NaN Invalid_operation
-ddmul593 multiply 1 Inf -> Infinity
-ddmul594 multiply 1000 Inf -> Infinity
-ddmul595 multiply Inf Inf -> Infinity
-
-ddmul600 multiply -Inf -Inf -> Infinity
-ddmul601 multiply -Inf -1000 -> Infinity
-ddmul602 multiply -Inf -1 -> Infinity
-ddmul603 multiply -Inf -0 -> NaN Invalid_operation
-ddmul604 multiply -Inf 0 -> NaN Invalid_operation
-ddmul605 multiply -Inf 1 -> -Infinity
-ddmul606 multiply -Inf 1000 -> -Infinity
-ddmul607 multiply -Inf Inf -> -Infinity
-ddmul608 multiply -1000 Inf -> -Infinity
-ddmul609 multiply -Inf -Inf -> Infinity
-ddmul610 multiply -1 -Inf -> Infinity
-ddmul611 multiply -0 -Inf -> NaN Invalid_operation
-ddmul612 multiply 0 -Inf -> NaN Invalid_operation
-ddmul613 multiply 1 -Inf -> -Infinity
-ddmul614 multiply 1000 -Inf -> -Infinity
-ddmul615 multiply Inf -Inf -> -Infinity
-
-ddmul621 multiply NaN -Inf -> NaN
-ddmul622 multiply NaN -1000 -> NaN
-ddmul623 multiply NaN -1 -> NaN
-ddmul624 multiply NaN -0 -> NaN
-ddmul625 multiply NaN 0 -> NaN
-ddmul626 multiply NaN 1 -> NaN
-ddmul627 multiply NaN 1000 -> NaN
-ddmul628 multiply NaN Inf -> NaN
-ddmul629 multiply NaN NaN -> NaN
-ddmul630 multiply -Inf NaN -> NaN
-ddmul631 multiply -1000 NaN -> NaN
-ddmul632 multiply -1 NaN -> NaN
-ddmul633 multiply -0 NaN -> NaN
-ddmul634 multiply 0 NaN -> NaN
-ddmul635 multiply 1 NaN -> NaN
-ddmul636 multiply 1000 NaN -> NaN
-ddmul637 multiply Inf NaN -> NaN
-
-ddmul641 multiply sNaN -Inf -> NaN Invalid_operation
-ddmul642 multiply sNaN -1000 -> NaN Invalid_operation
-ddmul643 multiply sNaN -1 -> NaN Invalid_operation
-ddmul644 multiply sNaN -0 -> NaN Invalid_operation
-ddmul645 multiply sNaN 0 -> NaN Invalid_operation
-ddmul646 multiply sNaN 1 -> NaN Invalid_operation
-ddmul647 multiply sNaN 1000 -> NaN Invalid_operation
-ddmul648 multiply sNaN NaN -> NaN Invalid_operation
-ddmul649 multiply sNaN sNaN -> NaN Invalid_operation
-ddmul650 multiply NaN sNaN -> NaN Invalid_operation
-ddmul651 multiply -Inf sNaN -> NaN Invalid_operation
-ddmul652 multiply -1000 sNaN -> NaN Invalid_operation
-ddmul653 multiply -1 sNaN -> NaN Invalid_operation
-ddmul654 multiply -0 sNaN -> NaN Invalid_operation
-ddmul655 multiply 0 sNaN -> NaN Invalid_operation
-ddmul656 multiply 1 sNaN -> NaN Invalid_operation
-ddmul657 multiply 1000 sNaN -> NaN Invalid_operation
-ddmul658 multiply Inf sNaN -> NaN Invalid_operation
-ddmul659 multiply NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmul661 multiply NaN9 -Inf -> NaN9
-ddmul662 multiply NaN8 999 -> NaN8
-ddmul663 multiply NaN71 Inf -> NaN71
-ddmul664 multiply NaN6 NaN5 -> NaN6
-ddmul665 multiply -Inf NaN4 -> NaN4
-ddmul666 multiply -999 NaN33 -> NaN33
-ddmul667 multiply Inf NaN2 -> NaN2
-
-ddmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
-ddmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
-ddmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
-ddmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
-ddmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
-ddmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
-ddmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
-ddmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
-
-ddmul681 multiply -NaN9 -Inf -> -NaN9
-ddmul682 multiply -NaN8 999 -> -NaN8
-ddmul683 multiply -NaN71 Inf -> -NaN71
-ddmul684 multiply -NaN6 -NaN5 -> -NaN6
-ddmul685 multiply -Inf -NaN4 -> -NaN4
-ddmul686 multiply -999 -NaN33 -> -NaN33
-ddmul687 multiply Inf -NaN2 -> -NaN2
-
-ddmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
-ddmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
-ddmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
-ddmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
-ddmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-ddmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
-ddmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
-ddmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
-
-ddmul701 multiply -NaN -Inf -> -NaN
-ddmul702 multiply -NaN 999 -> -NaN
-ddmul703 multiply -NaN Inf -> -NaN
-ddmul704 multiply -NaN -NaN -> -NaN
-ddmul705 multiply -Inf -NaN0 -> -NaN
-ddmul706 multiply -999 -NaN -> -NaN
-ddmul707 multiply Inf -NaN -> -NaN
-
-ddmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
-ddmul712 multiply -sNaN -11 -> -NaN Invalid_operation
-ddmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
-ddmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
-ddmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
-ddmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
-ddmul717 multiply 088 -sNaN -> -NaN Invalid_operation
-ddmul718 multiply Inf -sNaN -> -NaN Invalid_operation
-ddmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
--- signs
-ddmul751 multiply 1e+277 1e+311 -> Infinity Overflow Inexact Rounded
-ddmul752 multiply 1e+277 -1e+311 -> -Infinity Overflow Inexact Rounded
-ddmul753 multiply -1e+277 1e+311 -> -Infinity Overflow Inexact Rounded
-ddmul754 multiply -1e+277 -1e+311 -> Infinity Overflow Inexact Rounded
-ddmul755 multiply 1e-277 1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul756 multiply 1e-277 -1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul757 multiply -1e-277 1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul758 multiply -1e-277 -1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-ddmul760 multiply 1e-291 1e-101 -> 1E-392 Subnormal
-ddmul761 multiply 1e-291 1e-102 -> 1E-393 Subnormal
-ddmul762 multiply 1e-291 1e-103 -> 1E-394 Subnormal
-ddmul763 multiply 1e-291 1e-104 -> 1E-395 Subnormal
-ddmul764 multiply 1e-291 1e-105 -> 1E-396 Subnormal
-ddmul765 multiply 1e-291 1e-106 -> 1E-397 Subnormal
-ddmul766 multiply 1e-291 1e-107 -> 1E-398 Subnormal
-ddmul767 multiply 1e-291 1e-108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul768 multiply 1e-291 1e-109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul769 multiply 1e-291 1e-110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-ddmul770 multiply 1e+60 1e+321 -> 1.000000000000E+381 Clamped
-ddmul771 multiply 1e+60 1e+322 -> 1.0000000000000E+382 Clamped
-ddmul772 multiply 1e+60 1e+323 -> 1.00000000000000E+383 Clamped
-ddmul773 multiply 1e+60 1e+324 -> 1.000000000000000E+384 Clamped
-ddmul774 multiply 1e+60 1e+325 -> Infinity Overflow Inexact Rounded
-ddmul775 multiply 1e+60 1e+326 -> Infinity Overflow Inexact Rounded
-ddmul776 multiply 1e+60 1e+327 -> Infinity Overflow Inexact Rounded
-ddmul777 multiply 1e+60 1e+328 -> Infinity Overflow Inexact Rounded
-ddmul778 multiply 1e+60 1e+329 -> Infinity Overflow Inexact Rounded
-ddmul779 multiply 1e+60 1e+330 -> Infinity Overflow Inexact Rounded
-
-ddmul801 multiply 1.0000E-394 1 -> 1.0000E-394 Subnormal
-ddmul802 multiply 1.000E-394 1e-1 -> 1.000E-395 Subnormal
-ddmul803 multiply 1.00E-394 1e-2 -> 1.00E-396 Subnormal
-ddmul804 multiply 1.0E-394 1e-3 -> 1.0E-397 Subnormal
-ddmul805 multiply 1.0E-394 1e-4 -> 1E-398 Subnormal Rounded
-ddmul806 multiply 1.3E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddmul807 multiply 1.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul808 multiply 1.7E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul809 multiply 2.3E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul810 multiply 2.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul811 multiply 2.7E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
-ddmul812 multiply 1.49E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddmul813 multiply 1.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul814 multiply 1.51E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul815 multiply 2.49E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul816 multiply 2.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul817 multiply 2.51E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
-
-ddmul818 multiply 1E-394 1e-4 -> 1E-398 Subnormal
-ddmul819 multiply 3E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul820 multiply 5E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul821 multiply 7E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddmul822 multiply 9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddmul823 multiply 9.9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
-
-ddmul824 multiply 1E-394 -1e-4 -> -1E-398 Subnormal
-ddmul825 multiply 3E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul826 multiply -5E-394 1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul827 multiply 7E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddmul828 multiply -9E-394 1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddmul829 multiply 9.9E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddmul830 multiply 3.0E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-ddmul831 multiply 1.0E-199 1e-200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul832 multiply 1.0E-199 1e-199 -> 1E-398 Subnormal Rounded
-ddmul833 multiply 1.0E-199 1e-198 -> 1.0E-397 Subnormal
-ddmul834 multiply 2.0E-199 2e-198 -> 4.0E-397 Subnormal
-ddmul835 multiply 4.0E-199 4e-198 -> 1.60E-396 Subnormal
-ddmul836 multiply 10.0E-199 10e-198 -> 1.000E-395 Subnormal
-ddmul837 multiply 30.0E-199 30e-198 -> 9.000E-395 Subnormal
-ddmul838 multiply 40.0E-199 40e-188 -> 1.6000E-384 Subnormal
-ddmul839 multiply 40.0E-199 40e-187 -> 1.6000E-383
-ddmul840 multiply 40.0E-199 40e-186 -> 1.6000E-382
-
--- Long operand overflow may be a different path
-ddmul870 multiply 100 9.999E+383 -> Infinity Inexact Overflow Rounded
-ddmul871 multiply 100 -9.999E+383 -> -Infinity Inexact Overflow Rounded
-ddmul872 multiply 9.999E+383 100 -> Infinity Inexact Overflow Rounded
-ddmul873 multiply -9.999E+383 100 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-ddmul881 multiply 1.2347E-355 1.2347E-40 -> 1.524E-395 Inexact Rounded Subnormal Underflow
-ddmul882 multiply 1.234E-355 1.234E-40 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddmul883 multiply 1.23E-355 1.23E-40 -> 1.513E-395 Inexact Rounded Subnormal Underflow
-ddmul884 multiply 1.2E-355 1.2E-40 -> 1.44E-395 Subnormal
-ddmul885 multiply 1.2E-355 1.2E-41 -> 1.44E-396 Subnormal
-ddmul886 multiply 1.2E-355 1.2E-42 -> 1.4E-397 Subnormal Inexact Rounded Underflow
-ddmul887 multiply 1.2E-355 1.3E-42 -> 1.6E-397 Subnormal Inexact Rounded Underflow
-ddmul888 multiply 1.3E-355 1.3E-42 -> 1.7E-397 Subnormal Inexact Rounded Underflow
-ddmul889 multiply 1.3E-355 1.3E-43 -> 2E-398 Subnormal Inexact Rounded Underflow
-ddmul890 multiply 1.3E-356 1.3E-43 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow
-
-ddmul891 multiply 1.2345E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
-ddmul892 multiply 1.23456E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
-ddmul893 multiply 1.2345E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddmul894 multiply 1.23456E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddmul895 multiply 1.2345E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
-ddmul896 multiply 1.23456E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
--- 1 234567890123456
-ddmul900 multiply 0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded
-ddmul901 multiply 0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
-ddmul902 multiply 9.999999999999999E-383 0.0999999999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
-ddmul903 multiply 9.999999999999999E-383 0.09999999999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
-ddmul904 multiply 9.999999999999999E-383 0.099999999999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
-ddmul905 multiply 9.999999999999999E-383 0.0999999999999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
--- The next rounds to Nmin (b**emin); this is the distinguishing case
--- for detecting tininess (before or after rounding) -- if after
--- rounding then the result would be the same, but the Underflow flag
--- would not be set
-ddmul906 multiply 9.999999999999999E-383 0.09999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
--- prove those operands were exact
-ddmul907 multiply 9.999999999999999E-383 1 -> 9.999999999999999E-383
-ddmul908 multiply 1 0.09999999999999999 -> 0.09999999999999999
-
--- reducing tiniest
-ddmul910 multiply 1e-398 0.99 -> 1E-398 Subnormal Inexact Rounded Underflow
-ddmul911 multiply 1e-398 0.75 -> 1E-398 Subnormal Inexact Rounded Underflow
-ddmul912 multiply 1e-398 0.5 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-ddmul913 multiply 1e-398 0.25 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-ddmul914 multiply 1e-398 0.01 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-
--- hugest
-ddmul920 multiply 9999999999999999 9999999999999999 -> 9.999999999999998E+31 Inexact Rounded
-
--- power-of-ten edge cases
-ddmul1001 multiply 1 10 -> 10
-ddmul1002 multiply 1 100 -> 100
-ddmul1003 multiply 1 1000 -> 1000
-ddmul1004 multiply 1 10000 -> 10000
-ddmul1005 multiply 1 100000 -> 100000
-ddmul1006 multiply 1 1000000 -> 1000000
-ddmul1007 multiply 1 10000000 -> 10000000
-ddmul1008 multiply 1 100000000 -> 100000000
-ddmul1009 multiply 1 1000000000 -> 1000000000
-ddmul1010 multiply 1 10000000000 -> 10000000000
-ddmul1011 multiply 1 100000000000 -> 100000000000
-ddmul1012 multiply 1 1000000000000 -> 1000000000000
-ddmul1013 multiply 1 10000000000000 -> 10000000000000
-ddmul1014 multiply 1 100000000000000 -> 100000000000000
-ddmul1015 multiply 1 1000000000000000 -> 1000000000000000
-ddmul1021 multiply 10 1 -> 10
-ddmul1022 multiply 10 10 -> 100
-ddmul1023 multiply 10 100 -> 1000
-ddmul1024 multiply 10 1000 -> 10000
-ddmul1025 multiply 10 10000 -> 100000
-ddmul1026 multiply 10 100000 -> 1000000
-ddmul1027 multiply 10 1000000 -> 10000000
-ddmul1028 multiply 10 10000000 -> 100000000
-ddmul1029 multiply 10 100000000 -> 1000000000
-ddmul1030 multiply 10 1000000000 -> 10000000000
-ddmul1031 multiply 10 10000000000 -> 100000000000
-ddmul1032 multiply 10 100000000000 -> 1000000000000
-ddmul1033 multiply 10 1000000000000 -> 10000000000000
-ddmul1034 multiply 10 10000000000000 -> 100000000000000
-ddmul1035 multiply 10 100000000000000 -> 1000000000000000
-ddmul1041 multiply 100 0.1 -> 10.0
-ddmul1042 multiply 100 1 -> 100
-ddmul1043 multiply 100 10 -> 1000
-ddmul1044 multiply 100 100 -> 10000
-ddmul1045 multiply 100 1000 -> 100000
-ddmul1046 multiply 100 10000 -> 1000000
-ddmul1047 multiply 100 100000 -> 10000000
-ddmul1048 multiply 100 1000000 -> 100000000
-ddmul1049 multiply 100 10000000 -> 1000000000
-ddmul1050 multiply 100 100000000 -> 10000000000
-ddmul1051 multiply 100 1000000000 -> 100000000000
-ddmul1052 multiply 100 10000000000 -> 1000000000000
-ddmul1053 multiply 100 100000000000 -> 10000000000000
-ddmul1054 multiply 100 1000000000000 -> 100000000000000
-ddmul1055 multiply 100 10000000000000 -> 1000000000000000
-ddmul1061 multiply 1000 0.01 -> 10.00
-ddmul1062 multiply 1000 0.1 -> 100.0
-ddmul1063 multiply 1000 1 -> 1000
-ddmul1064 multiply 1000 10 -> 10000
-ddmul1065 multiply 1000 100 -> 100000
-ddmul1066 multiply 1000 1000 -> 1000000
-ddmul1067 multiply 1000 10000 -> 10000000
-ddmul1068 multiply 1000 100000 -> 100000000
-ddmul1069 multiply 1000 1000000 -> 1000000000
-ddmul1070 multiply 1000 10000000 -> 10000000000
-ddmul1071 multiply 1000 100000000 -> 100000000000
-ddmul1072 multiply 1000 1000000000 -> 1000000000000
-ddmul1073 multiply 1000 10000000000 -> 10000000000000
-ddmul1074 multiply 1000 100000000000 -> 100000000000000
-ddmul1075 multiply 1000 1000000000000 -> 1000000000000000
-ddmul1081 multiply 10000 0.001 -> 10.000
-ddmul1082 multiply 10000 0.01 -> 100.00
-ddmul1083 multiply 10000 0.1 -> 1000.0
-ddmul1084 multiply 10000 1 -> 10000
-ddmul1085 multiply 10000 10 -> 100000
-ddmul1086 multiply 10000 100 -> 1000000
-ddmul1087 multiply 10000 1000 -> 10000000
-ddmul1088 multiply 10000 10000 -> 100000000
-ddmul1089 multiply 10000 100000 -> 1000000000
-ddmul1090 multiply 10000 1000000 -> 10000000000
-ddmul1091 multiply 10000 10000000 -> 100000000000
-ddmul1092 multiply 10000 100000000 -> 1000000000000
-ddmul1093 multiply 10000 1000000000 -> 10000000000000
-ddmul1094 multiply 10000 10000000000 -> 100000000000000
-ddmul1095 multiply 10000 100000000000 -> 1000000000000000
-
-ddmul1097 multiply 10000 99999999999 -> 999999999990000
-ddmul1098 multiply 10000 99999999999 -> 999999999990000
-
-
--- Null tests
-ddmul9990 multiply 10 # -> NaN Invalid_operation
-ddmul9991 multiply # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddMultiply.decTest -- decDouble multiplication --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decDoubles only; all arguments are
+-- representable in a decDouble
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmul000 multiply 2 2 -> 4
+ddmul001 multiply 2 3 -> 6
+ddmul002 multiply 5 1 -> 5
+ddmul003 multiply 5 2 -> 10
+ddmul004 multiply 1.20 2 -> 2.40
+ddmul005 multiply 1.20 0 -> 0.00
+ddmul006 multiply 1.20 -2 -> -2.40
+ddmul007 multiply -1.20 2 -> -2.40
+ddmul008 multiply -1.20 0 -> -0.00
+ddmul009 multiply -1.20 -2 -> 2.40
+ddmul010 multiply 5.09 7.1 -> 36.139
+ddmul011 multiply 2.5 4 -> 10.0
+ddmul012 multiply 2.50 4 -> 10.00
+ddmul013 multiply 1.23456789 1.00000000 -> 1.234567890000000 Rounded
+ddmul015 multiply 2.50 4 -> 10.00
+ddmul016 multiply 9.999999999 9.999999999 -> 99.99999998000000 Inexact Rounded
+ddmul017 multiply 9.999999999 -9.999999999 -> -99.99999998000000 Inexact Rounded
+ddmul018 multiply -9.999999999 9.999999999 -> -99.99999998000000 Inexact Rounded
+ddmul019 multiply -9.999999999 -9.999999999 -> 99.99999998000000 Inexact Rounded
+
+-- zeros, etc.
+ddmul021 multiply 0 0 -> 0
+ddmul022 multiply 0 -0 -> -0
+ddmul023 multiply -0 0 -> -0
+ddmul024 multiply -0 -0 -> 0
+ddmul025 multiply -0.0 -0.0 -> 0.00
+ddmul026 multiply -0.0 -0.0 -> 0.00
+ddmul027 multiply -0.0 -0.0 -> 0.00
+ddmul028 multiply -0.0 -0.0 -> 0.00
+ddmul030 multiply 5.00 1E-3 -> 0.00500
+ddmul031 multiply 00.00 0.000 -> 0.00000
+ddmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
+ddmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
+ddmul034 multiply -5.00 1E-3 -> -0.00500
+ddmul035 multiply -00.00 0.000 -> -0.00000
+ddmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
+ddmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
+ddmul038 multiply 5.00 -1E-3 -> -0.00500
+ddmul039 multiply 00.00 -0.000 -> -0.00000
+ddmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
+ddmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
+ddmul042 multiply -5.00 -1E-3 -> 0.00500
+ddmul043 multiply -00.00 -0.000 -> 0.00000
+ddmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
+ddmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
+
+-- examples from decarith
+ddmul050 multiply 1.20 3 -> 3.60
+ddmul051 multiply 7 3 -> 21
+ddmul052 multiply 0.9 0.8 -> 0.72
+ddmul053 multiply 0.9 -0 -> -0.0
+ddmul054 multiply 654321 654321 -> 428135971041
+
+ddmul060 multiply 123.45 1e7 -> 1.2345E+9
+ddmul061 multiply 123.45 1e8 -> 1.2345E+10
+ddmul062 multiply 123.45 1e+9 -> 1.2345E+11
+ddmul063 multiply 123.45 1e10 -> 1.2345E+12
+ddmul064 multiply 123.45 1e11 -> 1.2345E+13
+ddmul065 multiply 123.45 1e12 -> 1.2345E+14
+ddmul066 multiply 123.45 1e13 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+-- 1234567890123456
+ddmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
+ddmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
+ddmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
+ddmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
+
+-- test some more edge cases and carries
+ddmul101 multiply 9 9 -> 81
+ddmul102 multiply 9 90 -> 810
+ddmul103 multiply 9 900 -> 8100
+ddmul104 multiply 9 9000 -> 81000
+ddmul105 multiply 9 90000 -> 810000
+ddmul106 multiply 9 900000 -> 8100000
+ddmul107 multiply 9 9000000 -> 81000000
+ddmul108 multiply 9 90000000 -> 810000000
+ddmul109 multiply 9 900000000 -> 8100000000
+ddmul110 multiply 9 9000000000 -> 81000000000
+ddmul111 multiply 9 90000000000 -> 810000000000
+ddmul112 multiply 9 900000000000 -> 8100000000000
+ddmul113 multiply 9 9000000000000 -> 81000000000000
+ddmul114 multiply 9 90000000000000 -> 810000000000000
+ddmul115 multiply 9 900000000000000 -> 8100000000000000
+--ddmul116 multiply 9 9000000000000000 -> 81000000000000000
+--ddmul117 multiply 9 90000000000000000 -> 810000000000000000
+--ddmul118 multiply 9 900000000000000000 -> 8100000000000000000
+--ddmul119 multiply 9 9000000000000000000 -> 81000000000000000000
+--ddmul120 multiply 9 90000000000000000000 -> 810000000000000000000
+--ddmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
+--ddmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
+--ddmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
+-- test some more edge cases without carries
+ddmul131 multiply 3 3 -> 9
+ddmul132 multiply 3 30 -> 90
+ddmul133 multiply 3 300 -> 900
+ddmul134 multiply 3 3000 -> 9000
+ddmul135 multiply 3 30000 -> 90000
+ddmul136 multiply 3 300000 -> 900000
+ddmul137 multiply 3 3000000 -> 9000000
+ddmul138 multiply 3 30000000 -> 90000000
+ddmul139 multiply 3 300000000 -> 900000000
+ddmul140 multiply 3 3000000000 -> 9000000000
+ddmul141 multiply 3 30000000000 -> 90000000000
+ddmul142 multiply 3 300000000000 -> 900000000000
+ddmul143 multiply 3 3000000000000 -> 9000000000000
+ddmul144 multiply 3 30000000000000 -> 90000000000000
+ddmul145 multiply 3 300000000000000 -> 900000000000000
+
+-- test some edge cases with exact rounding
+ddmul301 multiply 9 9 -> 81
+ddmul302 multiply 9 90 -> 810
+ddmul303 multiply 9 900 -> 8100
+ddmul304 multiply 9 9000 -> 81000
+ddmul305 multiply 9 90000 -> 810000
+ddmul306 multiply 9 900000 -> 8100000
+ddmul307 multiply 9 9000000 -> 81000000
+ddmul308 multiply 9 90000000 -> 810000000
+ddmul309 multiply 9 900000000 -> 8100000000
+ddmul310 multiply 9 9000000000 -> 81000000000
+ddmul311 multiply 9 90000000000 -> 810000000000
+ddmul312 multiply 9 900000000000 -> 8100000000000
+ddmul313 multiply 9 9000000000000 -> 81000000000000
+ddmul314 multiply 9 90000000000000 -> 810000000000000
+ddmul315 multiply 9 900000000000000 -> 8100000000000000
+ddmul316 multiply 9 9000000000000000 -> 8.100000000000000E+16 Rounded
+ddmul317 multiply 90 9000000000000000 -> 8.100000000000000E+17 Rounded
+ddmul318 multiply 900 9000000000000000 -> 8.100000000000000E+18 Rounded
+ddmul319 multiply 9000 9000000000000000 -> 8.100000000000000E+19 Rounded
+ddmul320 multiply 90000 9000000000000000 -> 8.100000000000000E+20 Rounded
+ddmul321 multiply 900000 9000000000000000 -> 8.100000000000000E+21 Rounded
+ddmul322 multiply 9000000 9000000000000000 -> 8.100000000000000E+22 Rounded
+ddmul323 multiply 90000000 9000000000000000 -> 8.100000000000000E+23 Rounded
+
+-- tryzeros cases
+ddmul504 multiply 0E-260 1000E-260 -> 0E-398 Clamped
+ddmul505 multiply 100E+260 0E+260 -> 0E+369 Clamped
+-- 65K-1 case
+ddmul506 multiply 77.1 850 -> 65535.0
+
+-- mixed with zeros
+ddmul541 multiply 0 -1 -> -0
+ddmul542 multiply -0 -1 -> 0
+ddmul543 multiply 0 1 -> 0
+ddmul544 multiply -0 1 -> -0
+ddmul545 multiply -1 0 -> -0
+ddmul546 multiply -1 -0 -> 0
+ddmul547 multiply 1 0 -> 0
+ddmul548 multiply 1 -0 -> -0
+
+ddmul551 multiply 0.0 -1 -> -0.0
+ddmul552 multiply -0.0 -1 -> 0.0
+ddmul553 multiply 0.0 1 -> 0.0
+ddmul554 multiply -0.0 1 -> -0.0
+ddmul555 multiply -1.0 0 -> -0.0
+ddmul556 multiply -1.0 -0 -> 0.0
+ddmul557 multiply 1.0 0 -> 0.0
+ddmul558 multiply 1.0 -0 -> -0.0
+
+ddmul561 multiply 0 -1.0 -> -0.0
+ddmul562 multiply -0 -1.0 -> 0.0
+ddmul563 multiply 0 1.0 -> 0.0
+ddmul564 multiply -0 1.0 -> -0.0
+ddmul565 multiply -1 0.0 -> -0.0
+ddmul566 multiply -1 -0.0 -> 0.0
+ddmul567 multiply 1 0.0 -> 0.0
+ddmul568 multiply 1 -0.0 -> -0.0
+
+ddmul571 multiply 0.0 -1.0 -> -0.00
+ddmul572 multiply -0.0 -1.0 -> 0.00
+ddmul573 multiply 0.0 1.0 -> 0.00
+ddmul574 multiply -0.0 1.0 -> -0.00
+ddmul575 multiply -1.0 0.0 -> -0.00
+ddmul576 multiply -1.0 -0.0 -> 0.00
+ddmul577 multiply 1.0 0.0 -> 0.00
+ddmul578 multiply 1.0 -0.0 -> -0.00
+
+
+-- Specials
+ddmul580 multiply Inf -Inf -> -Infinity
+ddmul581 multiply Inf -1000 -> -Infinity
+ddmul582 multiply Inf -1 -> -Infinity
+ddmul583 multiply Inf -0 -> NaN Invalid_operation
+ddmul584 multiply Inf 0 -> NaN Invalid_operation
+ddmul585 multiply Inf 1 -> Infinity
+ddmul586 multiply Inf 1000 -> Infinity
+ddmul587 multiply Inf Inf -> Infinity
+ddmul588 multiply -1000 Inf -> -Infinity
+ddmul589 multiply -Inf Inf -> -Infinity
+ddmul590 multiply -1 Inf -> -Infinity
+ddmul591 multiply -0 Inf -> NaN Invalid_operation
+ddmul592 multiply 0 Inf -> NaN Invalid_operation
+ddmul593 multiply 1 Inf -> Infinity
+ddmul594 multiply 1000 Inf -> Infinity
+ddmul595 multiply Inf Inf -> Infinity
+
+ddmul600 multiply -Inf -Inf -> Infinity
+ddmul601 multiply -Inf -1000 -> Infinity
+ddmul602 multiply -Inf -1 -> Infinity
+ddmul603 multiply -Inf -0 -> NaN Invalid_operation
+ddmul604 multiply -Inf 0 -> NaN Invalid_operation
+ddmul605 multiply -Inf 1 -> -Infinity
+ddmul606 multiply -Inf 1000 -> -Infinity
+ddmul607 multiply -Inf Inf -> -Infinity
+ddmul608 multiply -1000 Inf -> -Infinity
+ddmul609 multiply -Inf -Inf -> Infinity
+ddmul610 multiply -1 -Inf -> Infinity
+ddmul611 multiply -0 -Inf -> NaN Invalid_operation
+ddmul612 multiply 0 -Inf -> NaN Invalid_operation
+ddmul613 multiply 1 -Inf -> -Infinity
+ddmul614 multiply 1000 -Inf -> -Infinity
+ddmul615 multiply Inf -Inf -> -Infinity
+
+ddmul621 multiply NaN -Inf -> NaN
+ddmul622 multiply NaN -1000 -> NaN
+ddmul623 multiply NaN -1 -> NaN
+ddmul624 multiply NaN -0 -> NaN
+ddmul625 multiply NaN 0 -> NaN
+ddmul626 multiply NaN 1 -> NaN
+ddmul627 multiply NaN 1000 -> NaN
+ddmul628 multiply NaN Inf -> NaN
+ddmul629 multiply NaN NaN -> NaN
+ddmul630 multiply -Inf NaN -> NaN
+ddmul631 multiply -1000 NaN -> NaN
+ddmul632 multiply -1 NaN -> NaN
+ddmul633 multiply -0 NaN -> NaN
+ddmul634 multiply 0 NaN -> NaN
+ddmul635 multiply 1 NaN -> NaN
+ddmul636 multiply 1000 NaN -> NaN
+ddmul637 multiply Inf NaN -> NaN
+
+ddmul641 multiply sNaN -Inf -> NaN Invalid_operation
+ddmul642 multiply sNaN -1000 -> NaN Invalid_operation
+ddmul643 multiply sNaN -1 -> NaN Invalid_operation
+ddmul644 multiply sNaN -0 -> NaN Invalid_operation
+ddmul645 multiply sNaN 0 -> NaN Invalid_operation
+ddmul646 multiply sNaN 1 -> NaN Invalid_operation
+ddmul647 multiply sNaN 1000 -> NaN Invalid_operation
+ddmul648 multiply sNaN NaN -> NaN Invalid_operation
+ddmul649 multiply sNaN sNaN -> NaN Invalid_operation
+ddmul650 multiply NaN sNaN -> NaN Invalid_operation
+ddmul651 multiply -Inf sNaN -> NaN Invalid_operation
+ddmul652 multiply -1000 sNaN -> NaN Invalid_operation
+ddmul653 multiply -1 sNaN -> NaN Invalid_operation
+ddmul654 multiply -0 sNaN -> NaN Invalid_operation
+ddmul655 multiply 0 sNaN -> NaN Invalid_operation
+ddmul656 multiply 1 sNaN -> NaN Invalid_operation
+ddmul657 multiply 1000 sNaN -> NaN Invalid_operation
+ddmul658 multiply Inf sNaN -> NaN Invalid_operation
+ddmul659 multiply NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmul661 multiply NaN9 -Inf -> NaN9
+ddmul662 multiply NaN8 999 -> NaN8
+ddmul663 multiply NaN71 Inf -> NaN71
+ddmul664 multiply NaN6 NaN5 -> NaN6
+ddmul665 multiply -Inf NaN4 -> NaN4
+ddmul666 multiply -999 NaN33 -> NaN33
+ddmul667 multiply Inf NaN2 -> NaN2
+
+ddmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
+ddmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
+ddmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
+ddmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
+ddmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
+ddmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
+ddmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
+ddmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
+
+ddmul681 multiply -NaN9 -Inf -> -NaN9
+ddmul682 multiply -NaN8 999 -> -NaN8
+ddmul683 multiply -NaN71 Inf -> -NaN71
+ddmul684 multiply -NaN6 -NaN5 -> -NaN6
+ddmul685 multiply -Inf -NaN4 -> -NaN4
+ddmul686 multiply -999 -NaN33 -> -NaN33
+ddmul687 multiply Inf -NaN2 -> -NaN2
+
+ddmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
+ddmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
+ddmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
+ddmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
+ddmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+ddmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
+ddmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
+ddmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
+
+ddmul701 multiply -NaN -Inf -> -NaN
+ddmul702 multiply -NaN 999 -> -NaN
+ddmul703 multiply -NaN Inf -> -NaN
+ddmul704 multiply -NaN -NaN -> -NaN
+ddmul705 multiply -Inf -NaN0 -> -NaN
+ddmul706 multiply -999 -NaN -> -NaN
+ddmul707 multiply Inf -NaN -> -NaN
+
+ddmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
+ddmul712 multiply -sNaN -11 -> -NaN Invalid_operation
+ddmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
+ddmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
+ddmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
+ddmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
+ddmul717 multiply 088 -sNaN -> -NaN Invalid_operation
+ddmul718 multiply Inf -sNaN -> -NaN Invalid_operation
+ddmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+ddmul751 multiply 1e+277 1e+311 -> Infinity Overflow Inexact Rounded
+ddmul752 multiply 1e+277 -1e+311 -> -Infinity Overflow Inexact Rounded
+ddmul753 multiply -1e+277 1e+311 -> -Infinity Overflow Inexact Rounded
+ddmul754 multiply -1e+277 -1e+311 -> Infinity Overflow Inexact Rounded
+ddmul755 multiply 1e-277 1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul756 multiply 1e-277 -1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul757 multiply -1e-277 1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul758 multiply -1e-277 -1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+ddmul760 multiply 1e-291 1e-101 -> 1E-392 Subnormal
+ddmul761 multiply 1e-291 1e-102 -> 1E-393 Subnormal
+ddmul762 multiply 1e-291 1e-103 -> 1E-394 Subnormal
+ddmul763 multiply 1e-291 1e-104 -> 1E-395 Subnormal
+ddmul764 multiply 1e-291 1e-105 -> 1E-396 Subnormal
+ddmul765 multiply 1e-291 1e-106 -> 1E-397 Subnormal
+ddmul766 multiply 1e-291 1e-107 -> 1E-398 Subnormal
+ddmul767 multiply 1e-291 1e-108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul768 multiply 1e-291 1e-109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul769 multiply 1e-291 1e-110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+ddmul770 multiply 1e+60 1e+321 -> 1.000000000000E+381 Clamped
+ddmul771 multiply 1e+60 1e+322 -> 1.0000000000000E+382 Clamped
+ddmul772 multiply 1e+60 1e+323 -> 1.00000000000000E+383 Clamped
+ddmul773 multiply 1e+60 1e+324 -> 1.000000000000000E+384 Clamped
+ddmul774 multiply 1e+60 1e+325 -> Infinity Overflow Inexact Rounded
+ddmul775 multiply 1e+60 1e+326 -> Infinity Overflow Inexact Rounded
+ddmul776 multiply 1e+60 1e+327 -> Infinity Overflow Inexact Rounded
+ddmul777 multiply 1e+60 1e+328 -> Infinity Overflow Inexact Rounded
+ddmul778 multiply 1e+60 1e+329 -> Infinity Overflow Inexact Rounded
+ddmul779 multiply 1e+60 1e+330 -> Infinity Overflow Inexact Rounded
+
+ddmul801 multiply 1.0000E-394 1 -> 1.0000E-394 Subnormal
+ddmul802 multiply 1.000E-394 1e-1 -> 1.000E-395 Subnormal
+ddmul803 multiply 1.00E-394 1e-2 -> 1.00E-396 Subnormal
+ddmul804 multiply 1.0E-394 1e-3 -> 1.0E-397 Subnormal
+ddmul805 multiply 1.0E-394 1e-4 -> 1E-398 Subnormal Rounded
+ddmul806 multiply 1.3E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddmul807 multiply 1.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul808 multiply 1.7E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul809 multiply 2.3E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul810 multiply 2.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul811 multiply 2.7E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
+ddmul812 multiply 1.49E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddmul813 multiply 1.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul814 multiply 1.51E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul815 multiply 2.49E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul816 multiply 2.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul817 multiply 2.51E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
+
+ddmul818 multiply 1E-394 1e-4 -> 1E-398 Subnormal
+ddmul819 multiply 3E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul820 multiply 5E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul821 multiply 7E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddmul822 multiply 9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddmul823 multiply 9.9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
+
+ddmul824 multiply 1E-394 -1e-4 -> -1E-398 Subnormal
+ddmul825 multiply 3E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul826 multiply -5E-394 1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul827 multiply 7E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddmul828 multiply -9E-394 1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddmul829 multiply 9.9E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddmul830 multiply 3.0E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+ddmul831 multiply 1.0E-199 1e-200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul832 multiply 1.0E-199 1e-199 -> 1E-398 Subnormal Rounded
+ddmul833 multiply 1.0E-199 1e-198 -> 1.0E-397 Subnormal
+ddmul834 multiply 2.0E-199 2e-198 -> 4.0E-397 Subnormal
+ddmul835 multiply 4.0E-199 4e-198 -> 1.60E-396 Subnormal
+ddmul836 multiply 10.0E-199 10e-198 -> 1.000E-395 Subnormal
+ddmul837 multiply 30.0E-199 30e-198 -> 9.000E-395 Subnormal
+ddmul838 multiply 40.0E-199 40e-188 -> 1.6000E-384 Subnormal
+ddmul839 multiply 40.0E-199 40e-187 -> 1.6000E-383
+ddmul840 multiply 40.0E-199 40e-186 -> 1.6000E-382
+
+-- Long operand overflow may be a different path
+ddmul870 multiply 100 9.999E+383 -> Infinity Inexact Overflow Rounded
+ddmul871 multiply 100 -9.999E+383 -> -Infinity Inexact Overflow Rounded
+ddmul872 multiply 9.999E+383 100 -> Infinity Inexact Overflow Rounded
+ddmul873 multiply -9.999E+383 100 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+ddmul881 multiply 1.2347E-355 1.2347E-40 -> 1.524E-395 Inexact Rounded Subnormal Underflow
+ddmul882 multiply 1.234E-355 1.234E-40 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddmul883 multiply 1.23E-355 1.23E-40 -> 1.513E-395 Inexact Rounded Subnormal Underflow
+ddmul884 multiply 1.2E-355 1.2E-40 -> 1.44E-395 Subnormal
+ddmul885 multiply 1.2E-355 1.2E-41 -> 1.44E-396 Subnormal
+ddmul886 multiply 1.2E-355 1.2E-42 -> 1.4E-397 Subnormal Inexact Rounded Underflow
+ddmul887 multiply 1.2E-355 1.3E-42 -> 1.6E-397 Subnormal Inexact Rounded Underflow
+ddmul888 multiply 1.3E-355 1.3E-42 -> 1.7E-397 Subnormal Inexact Rounded Underflow
+ddmul889 multiply 1.3E-355 1.3E-43 -> 2E-398 Subnormal Inexact Rounded Underflow
+ddmul890 multiply 1.3E-356 1.3E-43 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow
+
+ddmul891 multiply 1.2345E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
+ddmul892 multiply 1.23456E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
+ddmul893 multiply 1.2345E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddmul894 multiply 1.23456E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddmul895 multiply 1.2345E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
+ddmul896 multiply 1.23456E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+-- 1 234567890123456
+ddmul900 multiply 0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded
+ddmul901 multiply 0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
+ddmul902 multiply 9.999999999999999E-383 0.0999999999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
+ddmul903 multiply 9.999999999999999E-383 0.09999999999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
+ddmul904 multiply 9.999999999999999E-383 0.099999999999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
+ddmul905 multiply 9.999999999999999E-383 0.0999999999999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
+-- The next rounds to Nmin (b**emin); this is the distinguishing case
+-- for detecting tininess (before or after rounding) -- if after
+-- rounding then the result would be the same, but the Underflow flag
+-- would not be set
+ddmul906 multiply 9.999999999999999E-383 0.09999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+-- prove those operands were exact
+ddmul907 multiply 9.999999999999999E-383 1 -> 9.999999999999999E-383
+ddmul908 multiply 1 0.09999999999999999 -> 0.09999999999999999
+
+-- reducing tiniest
+ddmul910 multiply 1e-398 0.99 -> 1E-398 Subnormal Inexact Rounded Underflow
+ddmul911 multiply 1e-398 0.75 -> 1E-398 Subnormal Inexact Rounded Underflow
+ddmul912 multiply 1e-398 0.5 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+ddmul913 multiply 1e-398 0.25 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+ddmul914 multiply 1e-398 0.01 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+-- hugest
+ddmul920 multiply 9999999999999999 9999999999999999 -> 9.999999999999998E+31 Inexact Rounded
+
+-- power-of-ten edge cases
+ddmul1001 multiply 1 10 -> 10
+ddmul1002 multiply 1 100 -> 100
+ddmul1003 multiply 1 1000 -> 1000
+ddmul1004 multiply 1 10000 -> 10000
+ddmul1005 multiply 1 100000 -> 100000
+ddmul1006 multiply 1 1000000 -> 1000000
+ddmul1007 multiply 1 10000000 -> 10000000
+ddmul1008 multiply 1 100000000 -> 100000000
+ddmul1009 multiply 1 1000000000 -> 1000000000
+ddmul1010 multiply 1 10000000000 -> 10000000000
+ddmul1011 multiply 1 100000000000 -> 100000000000
+ddmul1012 multiply 1 1000000000000 -> 1000000000000
+ddmul1013 multiply 1 10000000000000 -> 10000000000000
+ddmul1014 multiply 1 100000000000000 -> 100000000000000
+ddmul1015 multiply 1 1000000000000000 -> 1000000000000000
+ddmul1021 multiply 10 1 -> 10
+ddmul1022 multiply 10 10 -> 100
+ddmul1023 multiply 10 100 -> 1000
+ddmul1024 multiply 10 1000 -> 10000
+ddmul1025 multiply 10 10000 -> 100000
+ddmul1026 multiply 10 100000 -> 1000000
+ddmul1027 multiply 10 1000000 -> 10000000
+ddmul1028 multiply 10 10000000 -> 100000000
+ddmul1029 multiply 10 100000000 -> 1000000000
+ddmul1030 multiply 10 1000000000 -> 10000000000
+ddmul1031 multiply 10 10000000000 -> 100000000000
+ddmul1032 multiply 10 100000000000 -> 1000000000000
+ddmul1033 multiply 10 1000000000000 -> 10000000000000
+ddmul1034 multiply 10 10000000000000 -> 100000000000000
+ddmul1035 multiply 10 100000000000000 -> 1000000000000000
+ddmul1041 multiply 100 0.1 -> 10.0
+ddmul1042 multiply 100 1 -> 100
+ddmul1043 multiply 100 10 -> 1000
+ddmul1044 multiply 100 100 -> 10000
+ddmul1045 multiply 100 1000 -> 100000
+ddmul1046 multiply 100 10000 -> 1000000
+ddmul1047 multiply 100 100000 -> 10000000
+ddmul1048 multiply 100 1000000 -> 100000000
+ddmul1049 multiply 100 10000000 -> 1000000000
+ddmul1050 multiply 100 100000000 -> 10000000000
+ddmul1051 multiply 100 1000000000 -> 100000000000
+ddmul1052 multiply 100 10000000000 -> 1000000000000
+ddmul1053 multiply 100 100000000000 -> 10000000000000
+ddmul1054 multiply 100 1000000000000 -> 100000000000000
+ddmul1055 multiply 100 10000000000000 -> 1000000000000000
+ddmul1061 multiply 1000 0.01 -> 10.00
+ddmul1062 multiply 1000 0.1 -> 100.0
+ddmul1063 multiply 1000 1 -> 1000
+ddmul1064 multiply 1000 10 -> 10000
+ddmul1065 multiply 1000 100 -> 100000
+ddmul1066 multiply 1000 1000 -> 1000000
+ddmul1067 multiply 1000 10000 -> 10000000
+ddmul1068 multiply 1000 100000 -> 100000000
+ddmul1069 multiply 1000 1000000 -> 1000000000
+ddmul1070 multiply 1000 10000000 -> 10000000000
+ddmul1071 multiply 1000 100000000 -> 100000000000
+ddmul1072 multiply 1000 1000000000 -> 1000000000000
+ddmul1073 multiply 1000 10000000000 -> 10000000000000
+ddmul1074 multiply 1000 100000000000 -> 100000000000000
+ddmul1075 multiply 1000 1000000000000 -> 1000000000000000
+ddmul1081 multiply 10000 0.001 -> 10.000
+ddmul1082 multiply 10000 0.01 -> 100.00
+ddmul1083 multiply 10000 0.1 -> 1000.0
+ddmul1084 multiply 10000 1 -> 10000
+ddmul1085 multiply 10000 10 -> 100000
+ddmul1086 multiply 10000 100 -> 1000000
+ddmul1087 multiply 10000 1000 -> 10000000
+ddmul1088 multiply 10000 10000 -> 100000000
+ddmul1089 multiply 10000 100000 -> 1000000000
+ddmul1090 multiply 10000 1000000 -> 10000000000
+ddmul1091 multiply 10000 10000000 -> 100000000000
+ddmul1092 multiply 10000 100000000 -> 1000000000000
+ddmul1093 multiply 10000 1000000000 -> 10000000000000
+ddmul1094 multiply 10000 10000000000 -> 100000000000000
+ddmul1095 multiply 10000 100000000000 -> 1000000000000000
+
+ddmul1097 multiply 10000 99999999999 -> 999999999990000
+ddmul1098 multiply 10000 99999999999 -> 999999999990000
+
+
+-- Null tests
+ddmul9990 multiply 10 # -> NaN Invalid_operation
+ddmul9991 multiply # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddNextMinus.decTest b/Lib/test/decimaltestdata/ddNextMinus.decTest
index 39f58c14a4..f8a3c0eb32 100644
--- a/Lib/test/decimaltestdata/ddNextMinus.decTest
+++ b/Lib/test/decimaltestdata/ddNextMinus.decTest
@@ -1,126 +1,126 @@
-------------------------------------------------------------------------
--- ddNextMinus.decTest -- decDouble next that is less [754r nextdown] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddnextm001 nextminus 0.9999999999999995 -> 0.9999999999999994
-ddnextm002 nextminus 0.9999999999999996 -> 0.9999999999999995
-ddnextm003 nextminus 0.9999999999999997 -> 0.9999999999999996
-ddnextm004 nextminus 0.9999999999999998 -> 0.9999999999999997
-ddnextm005 nextminus 0.9999999999999999 -> 0.9999999999999998
-ddnextm006 nextminus 1.000000000000000 -> 0.9999999999999999
-ddnextm007 nextminus 1.0 -> 0.9999999999999999
-ddnextm008 nextminus 1 -> 0.9999999999999999
-ddnextm009 nextminus 1.000000000000001 -> 1.000000000000000
-ddnextm010 nextminus 1.000000000000002 -> 1.000000000000001
-ddnextm011 nextminus 1.000000000000003 -> 1.000000000000002
-ddnextm012 nextminus 1.000000000000004 -> 1.000000000000003
-ddnextm013 nextminus 1.000000000000005 -> 1.000000000000004
-ddnextm014 nextminus 1.000000000000006 -> 1.000000000000005
-ddnextm015 nextminus 1.000000000000007 -> 1.000000000000006
-ddnextm016 nextminus 1.000000000000008 -> 1.000000000000007
-ddnextm017 nextminus 1.000000000000009 -> 1.000000000000008
-ddnextm018 nextminus 1.000000000000010 -> 1.000000000000009
-ddnextm019 nextminus 1.000000000000011 -> 1.000000000000010
-ddnextm020 nextminus 1.000000000000012 -> 1.000000000000011
-
-ddnextm021 nextminus -0.9999999999999995 -> -0.9999999999999996
-ddnextm022 nextminus -0.9999999999999996 -> -0.9999999999999997
-ddnextm023 nextminus -0.9999999999999997 -> -0.9999999999999998
-ddnextm024 nextminus -0.9999999999999998 -> -0.9999999999999999
-ddnextm025 nextminus -0.9999999999999999 -> -1.000000000000000
-ddnextm026 nextminus -1.000000000000000 -> -1.000000000000001
-ddnextm027 nextminus -1.0 -> -1.000000000000001
-ddnextm028 nextminus -1 -> -1.000000000000001
-ddnextm029 nextminus -1.000000000000001 -> -1.000000000000002
-ddnextm030 nextminus -1.000000000000002 -> -1.000000000000003
-ddnextm031 nextminus -1.000000000000003 -> -1.000000000000004
-ddnextm032 nextminus -1.000000000000004 -> -1.000000000000005
-ddnextm033 nextminus -1.000000000000005 -> -1.000000000000006
-ddnextm034 nextminus -1.000000000000006 -> -1.000000000000007
-ddnextm035 nextminus -1.000000000000007 -> -1.000000000000008
-ddnextm036 nextminus -1.000000000000008 -> -1.000000000000009
-ddnextm037 nextminus -1.000000000000009 -> -1.000000000000010
-ddnextm038 nextminus -1.000000000000010 -> -1.000000000000011
-ddnextm039 nextminus -1.000000000000011 -> -1.000000000000012
-
--- ultra-tiny inputs
-ddnextm062 nextminus 1E-398 -> 0E-398
-ddnextm065 nextminus -1E-398 -> -2E-398
-
--- Zeros
-ddnextm100 nextminus -0 -> -1E-398
-ddnextm101 nextminus 0 -> -1E-398
-ddnextm102 nextminus 0.00 -> -1E-398
-ddnextm103 nextminus -0.00 -> -1E-398
-ddnextm104 nextminus 0E-300 -> -1E-398
-ddnextm105 nextminus 0E+300 -> -1E-398
-ddnextm106 nextminus 0E+30000 -> -1E-398
-ddnextm107 nextminus -0E+30000 -> -1E-398
-
--- specials
-ddnextm150 nextminus Inf -> 9.999999999999999E+384
-ddnextm151 nextminus -Inf -> -Infinity
-ddnextm152 nextminus NaN -> NaN
-ddnextm153 nextminus sNaN -> NaN Invalid_operation
-ddnextm154 nextminus NaN77 -> NaN77
-ddnextm155 nextminus sNaN88 -> NaN88 Invalid_operation
-ddnextm156 nextminus -NaN -> -NaN
-ddnextm157 nextminus -sNaN -> -NaN Invalid_operation
-ddnextm158 nextminus -NaN77 -> -NaN77
-ddnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-ddnextm170 nextminus 9.999999999999999E+384 -> 9.999999999999998E+384
-ddnextm171 nextminus 9.999999999999998E+384 -> 9.999999999999997E+384
-ddnextm172 nextminus 1E-383 -> 9.99999999999999E-384
-ddnextm173 nextminus 1.000000000000000E-383 -> 9.99999999999999E-384
-ddnextm174 nextminus 9E-398 -> 8E-398
-ddnextm175 nextminus 9.9E-397 -> 9.8E-397
-ddnextm176 nextminus 9.99999999999E-387 -> 9.99999999998E-387
-ddnextm177 nextminus 9.99999999999999E-384 -> 9.99999999999998E-384
-ddnextm178 nextminus 9.99999999999998E-384 -> 9.99999999999997E-384
-ddnextm179 nextminus 9.99999999999997E-384 -> 9.99999999999996E-384
-ddnextm180 nextminus 0E-398 -> -1E-398
-ddnextm181 nextminus 1E-398 -> 0E-398
-ddnextm182 nextminus 2E-398 -> 1E-398
-
-ddnextm183 nextminus -0E-398 -> -1E-398
-ddnextm184 nextminus -1E-398 -> -2E-398
-ddnextm185 nextminus -2E-398 -> -3E-398
-ddnextm186 nextminus -10E-398 -> -1.1E-397
-ddnextm187 nextminus -100E-398 -> -1.01E-396
-ddnextm188 nextminus -100000E-398 -> -1.00001E-393
-ddnextm189 nextminus -1.00000000000E-383 -> -1.000000000000001E-383
-ddnextm190 nextminus -1.000000000000000E-383 -> -1.000000000000001E-383
-ddnextm191 nextminus -1E-383 -> -1.000000000000001E-383
-ddnextm192 nextminus -9.999999999999998E+384 -> -9.999999999999999E+384
-ddnextm193 nextminus -9.999999999999999E+384 -> -Infinity
-
--- Null tests
-ddnextm900 nextminus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddNextMinus.decTest -- decDouble next that is less [754r nextdown] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddnextm001 nextminus 0.9999999999999995 -> 0.9999999999999994
+ddnextm002 nextminus 0.9999999999999996 -> 0.9999999999999995
+ddnextm003 nextminus 0.9999999999999997 -> 0.9999999999999996
+ddnextm004 nextminus 0.9999999999999998 -> 0.9999999999999997
+ddnextm005 nextminus 0.9999999999999999 -> 0.9999999999999998
+ddnextm006 nextminus 1.000000000000000 -> 0.9999999999999999
+ddnextm007 nextminus 1.0 -> 0.9999999999999999
+ddnextm008 nextminus 1 -> 0.9999999999999999
+ddnextm009 nextminus 1.000000000000001 -> 1.000000000000000
+ddnextm010 nextminus 1.000000000000002 -> 1.000000000000001
+ddnextm011 nextminus 1.000000000000003 -> 1.000000000000002
+ddnextm012 nextminus 1.000000000000004 -> 1.000000000000003
+ddnextm013 nextminus 1.000000000000005 -> 1.000000000000004
+ddnextm014 nextminus 1.000000000000006 -> 1.000000000000005
+ddnextm015 nextminus 1.000000000000007 -> 1.000000000000006
+ddnextm016 nextminus 1.000000000000008 -> 1.000000000000007
+ddnextm017 nextminus 1.000000000000009 -> 1.000000000000008
+ddnextm018 nextminus 1.000000000000010 -> 1.000000000000009
+ddnextm019 nextminus 1.000000000000011 -> 1.000000000000010
+ddnextm020 nextminus 1.000000000000012 -> 1.000000000000011
+
+ddnextm021 nextminus -0.9999999999999995 -> -0.9999999999999996
+ddnextm022 nextminus -0.9999999999999996 -> -0.9999999999999997
+ddnextm023 nextminus -0.9999999999999997 -> -0.9999999999999998
+ddnextm024 nextminus -0.9999999999999998 -> -0.9999999999999999
+ddnextm025 nextminus -0.9999999999999999 -> -1.000000000000000
+ddnextm026 nextminus -1.000000000000000 -> -1.000000000000001
+ddnextm027 nextminus -1.0 -> -1.000000000000001
+ddnextm028 nextminus -1 -> -1.000000000000001
+ddnextm029 nextminus -1.000000000000001 -> -1.000000000000002
+ddnextm030 nextminus -1.000000000000002 -> -1.000000000000003
+ddnextm031 nextminus -1.000000000000003 -> -1.000000000000004
+ddnextm032 nextminus -1.000000000000004 -> -1.000000000000005
+ddnextm033 nextminus -1.000000000000005 -> -1.000000000000006
+ddnextm034 nextminus -1.000000000000006 -> -1.000000000000007
+ddnextm035 nextminus -1.000000000000007 -> -1.000000000000008
+ddnextm036 nextminus -1.000000000000008 -> -1.000000000000009
+ddnextm037 nextminus -1.000000000000009 -> -1.000000000000010
+ddnextm038 nextminus -1.000000000000010 -> -1.000000000000011
+ddnextm039 nextminus -1.000000000000011 -> -1.000000000000012
+
+-- ultra-tiny inputs
+ddnextm062 nextminus 1E-398 -> 0E-398
+ddnextm065 nextminus -1E-398 -> -2E-398
+
+-- Zeros
+ddnextm100 nextminus -0 -> -1E-398
+ddnextm101 nextminus 0 -> -1E-398
+ddnextm102 nextminus 0.00 -> -1E-398
+ddnextm103 nextminus -0.00 -> -1E-398
+ddnextm104 nextminus 0E-300 -> -1E-398
+ddnextm105 nextminus 0E+300 -> -1E-398
+ddnextm106 nextminus 0E+30000 -> -1E-398
+ddnextm107 nextminus -0E+30000 -> -1E-398
+
+-- specials
+ddnextm150 nextminus Inf -> 9.999999999999999E+384
+ddnextm151 nextminus -Inf -> -Infinity
+ddnextm152 nextminus NaN -> NaN
+ddnextm153 nextminus sNaN -> NaN Invalid_operation
+ddnextm154 nextminus NaN77 -> NaN77
+ddnextm155 nextminus sNaN88 -> NaN88 Invalid_operation
+ddnextm156 nextminus -NaN -> -NaN
+ddnextm157 nextminus -sNaN -> -NaN Invalid_operation
+ddnextm158 nextminus -NaN77 -> -NaN77
+ddnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+ddnextm170 nextminus 9.999999999999999E+384 -> 9.999999999999998E+384
+ddnextm171 nextminus 9.999999999999998E+384 -> 9.999999999999997E+384
+ddnextm172 nextminus 1E-383 -> 9.99999999999999E-384
+ddnextm173 nextminus 1.000000000000000E-383 -> 9.99999999999999E-384
+ddnextm174 nextminus 9E-398 -> 8E-398
+ddnextm175 nextminus 9.9E-397 -> 9.8E-397
+ddnextm176 nextminus 9.99999999999E-387 -> 9.99999999998E-387
+ddnextm177 nextminus 9.99999999999999E-384 -> 9.99999999999998E-384
+ddnextm178 nextminus 9.99999999999998E-384 -> 9.99999999999997E-384
+ddnextm179 nextminus 9.99999999999997E-384 -> 9.99999999999996E-384
+ddnextm180 nextminus 0E-398 -> -1E-398
+ddnextm181 nextminus 1E-398 -> 0E-398
+ddnextm182 nextminus 2E-398 -> 1E-398
+
+ddnextm183 nextminus -0E-398 -> -1E-398
+ddnextm184 nextminus -1E-398 -> -2E-398
+ddnextm185 nextminus -2E-398 -> -3E-398
+ddnextm186 nextminus -10E-398 -> -1.1E-397
+ddnextm187 nextminus -100E-398 -> -1.01E-396
+ddnextm188 nextminus -100000E-398 -> -1.00001E-393
+ddnextm189 nextminus -1.00000000000E-383 -> -1.000000000000001E-383
+ddnextm190 nextminus -1.000000000000000E-383 -> -1.000000000000001E-383
+ddnextm191 nextminus -1E-383 -> -1.000000000000001E-383
+ddnextm192 nextminus -9.999999999999998E+384 -> -9.999999999999999E+384
+ddnextm193 nextminus -9.999999999999999E+384 -> -Infinity
+
+-- Null tests
+ddnextm900 nextminus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddNextPlus.decTest b/Lib/test/decimaltestdata/ddNextPlus.decTest
index d41dfbab3f..4a749a18c9 100644
--- a/Lib/test/decimaltestdata/ddNextPlus.decTest
+++ b/Lib/test/decimaltestdata/ddNextPlus.decTest
@@ -1,124 +1,124 @@
-------------------------------------------------------------------------
--- ddNextPlus.decTest -- decDouble next that is greater [754r nextup] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddnextp001 nextplus 0.9999999999999995 -> 0.9999999999999996
-ddnextp002 nextplus 0.9999999999999996 -> 0.9999999999999997
-ddnextp003 nextplus 0.9999999999999997 -> 0.9999999999999998
-ddnextp004 nextplus 0.9999999999999998 -> 0.9999999999999999
-ddnextp005 nextplus 0.9999999999999999 -> 1.000000000000000
-ddnextp006 nextplus 1.000000000000000 -> 1.000000000000001
-ddnextp007 nextplus 1.0 -> 1.000000000000001
-ddnextp008 nextplus 1 -> 1.000000000000001
-ddnextp009 nextplus 1.000000000000001 -> 1.000000000000002
-ddnextp010 nextplus 1.000000000000002 -> 1.000000000000003
-ddnextp011 nextplus 1.000000000000003 -> 1.000000000000004
-ddnextp012 nextplus 1.000000000000004 -> 1.000000000000005
-ddnextp013 nextplus 1.000000000000005 -> 1.000000000000006
-ddnextp014 nextplus 1.000000000000006 -> 1.000000000000007
-ddnextp015 nextplus 1.000000000000007 -> 1.000000000000008
-ddnextp016 nextplus 1.000000000000008 -> 1.000000000000009
-ddnextp017 nextplus 1.000000000000009 -> 1.000000000000010
-ddnextp018 nextplus 1.000000000000010 -> 1.000000000000011
-ddnextp019 nextplus 1.000000000000011 -> 1.000000000000012
-
-ddnextp021 nextplus -0.9999999999999995 -> -0.9999999999999994
-ddnextp022 nextplus -0.9999999999999996 -> -0.9999999999999995
-ddnextp023 nextplus -0.9999999999999997 -> -0.9999999999999996
-ddnextp024 nextplus -0.9999999999999998 -> -0.9999999999999997
-ddnextp025 nextplus -0.9999999999999999 -> -0.9999999999999998
-ddnextp026 nextplus -1.000000000000000 -> -0.9999999999999999
-ddnextp027 nextplus -1.0 -> -0.9999999999999999
-ddnextp028 nextplus -1 -> -0.9999999999999999
-ddnextp029 nextplus -1.000000000000001 -> -1.000000000000000
-ddnextp030 nextplus -1.000000000000002 -> -1.000000000000001
-ddnextp031 nextplus -1.000000000000003 -> -1.000000000000002
-ddnextp032 nextplus -1.000000000000004 -> -1.000000000000003
-ddnextp033 nextplus -1.000000000000005 -> -1.000000000000004
-ddnextp034 nextplus -1.000000000000006 -> -1.000000000000005
-ddnextp035 nextplus -1.000000000000007 -> -1.000000000000006
-ddnextp036 nextplus -1.000000000000008 -> -1.000000000000007
-ddnextp037 nextplus -1.000000000000009 -> -1.000000000000008
-ddnextp038 nextplus -1.000000000000010 -> -1.000000000000009
-ddnextp039 nextplus -1.000000000000011 -> -1.000000000000010
-ddnextp040 nextplus -1.000000000000012 -> -1.000000000000011
-
--- Zeros
-ddnextp100 nextplus 0 -> 1E-398
-ddnextp101 nextplus 0.00 -> 1E-398
-ddnextp102 nextplus 0E-300 -> 1E-398
-ddnextp103 nextplus 0E+300 -> 1E-398
-ddnextp104 nextplus 0E+30000 -> 1E-398
-ddnextp105 nextplus -0 -> 1E-398
-ddnextp106 nextplus -0.00 -> 1E-398
-ddnextp107 nextplus -0E-300 -> 1E-398
-ddnextp108 nextplus -0E+300 -> 1E-398
-ddnextp109 nextplus -0E+30000 -> 1E-398
-
--- specials
-ddnextp150 nextplus Inf -> Infinity
-ddnextp151 nextplus -Inf -> -9.999999999999999E+384
-ddnextp152 nextplus NaN -> NaN
-ddnextp153 nextplus sNaN -> NaN Invalid_operation
-ddnextp154 nextplus NaN77 -> NaN77
-ddnextp155 nextplus sNaN88 -> NaN88 Invalid_operation
-ddnextp156 nextplus -NaN -> -NaN
-ddnextp157 nextplus -sNaN -> -NaN Invalid_operation
-ddnextp158 nextplus -NaN77 -> -NaN77
-ddnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-ddnextp170 nextplus -9.999999999999999E+384 -> -9.999999999999998E+384
-ddnextp171 nextplus -9.999999999999998E+384 -> -9.999999999999997E+384
-ddnextp172 nextplus -1E-383 -> -9.99999999999999E-384
-ddnextp173 nextplus -1.000000000000000E-383 -> -9.99999999999999E-384
-ddnextp174 nextplus -9E-398 -> -8E-398
-ddnextp175 nextplus -9.9E-397 -> -9.8E-397
-ddnextp176 nextplus -9.99999999999E-387 -> -9.99999999998E-387
-ddnextp177 nextplus -9.99999999999999E-384 -> -9.99999999999998E-384
-ddnextp178 nextplus -9.99999999999998E-384 -> -9.99999999999997E-384
-ddnextp179 nextplus -9.99999999999997E-384 -> -9.99999999999996E-384
-ddnextp180 nextplus -0E-398 -> 1E-398
-ddnextp181 nextplus -1E-398 -> -0E-398
-ddnextp182 nextplus -2E-398 -> -1E-398
-
-ddnextp183 nextplus 0E-398 -> 1E-398
-ddnextp184 nextplus 1E-398 -> 2E-398
-ddnextp185 nextplus 2E-398 -> 3E-398
-ddnextp186 nextplus 10E-398 -> 1.1E-397
-ddnextp187 nextplus 100E-398 -> 1.01E-396
-ddnextp188 nextplus 100000E-398 -> 1.00001E-393
-ddnextp189 nextplus 1.00000000000E-383 -> 1.000000000000001E-383
-ddnextp190 nextplus 1.000000000000000E-383 -> 1.000000000000001E-383
-ddnextp191 nextplus 1E-383 -> 1.000000000000001E-383
-ddnextp192 nextplus 9.999999999999998E+384 -> 9.999999999999999E+384
-ddnextp193 nextplus 9.999999999999999E+384 -> Infinity
-
--- Null tests
-ddnextp900 nextplus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddNextPlus.decTest -- decDouble next that is greater [754r nextup] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddnextp001 nextplus 0.9999999999999995 -> 0.9999999999999996
+ddnextp002 nextplus 0.9999999999999996 -> 0.9999999999999997
+ddnextp003 nextplus 0.9999999999999997 -> 0.9999999999999998
+ddnextp004 nextplus 0.9999999999999998 -> 0.9999999999999999
+ddnextp005 nextplus 0.9999999999999999 -> 1.000000000000000
+ddnextp006 nextplus 1.000000000000000 -> 1.000000000000001
+ddnextp007 nextplus 1.0 -> 1.000000000000001
+ddnextp008 nextplus 1 -> 1.000000000000001
+ddnextp009 nextplus 1.000000000000001 -> 1.000000000000002
+ddnextp010 nextplus 1.000000000000002 -> 1.000000000000003
+ddnextp011 nextplus 1.000000000000003 -> 1.000000000000004
+ddnextp012 nextplus 1.000000000000004 -> 1.000000000000005
+ddnextp013 nextplus 1.000000000000005 -> 1.000000000000006
+ddnextp014 nextplus 1.000000000000006 -> 1.000000000000007
+ddnextp015 nextplus 1.000000000000007 -> 1.000000000000008
+ddnextp016 nextplus 1.000000000000008 -> 1.000000000000009
+ddnextp017 nextplus 1.000000000000009 -> 1.000000000000010
+ddnextp018 nextplus 1.000000000000010 -> 1.000000000000011
+ddnextp019 nextplus 1.000000000000011 -> 1.000000000000012
+
+ddnextp021 nextplus -0.9999999999999995 -> -0.9999999999999994
+ddnextp022 nextplus -0.9999999999999996 -> -0.9999999999999995
+ddnextp023 nextplus -0.9999999999999997 -> -0.9999999999999996
+ddnextp024 nextplus -0.9999999999999998 -> -0.9999999999999997
+ddnextp025 nextplus -0.9999999999999999 -> -0.9999999999999998
+ddnextp026 nextplus -1.000000000000000 -> -0.9999999999999999
+ddnextp027 nextplus -1.0 -> -0.9999999999999999
+ddnextp028 nextplus -1 -> -0.9999999999999999
+ddnextp029 nextplus -1.000000000000001 -> -1.000000000000000
+ddnextp030 nextplus -1.000000000000002 -> -1.000000000000001
+ddnextp031 nextplus -1.000000000000003 -> -1.000000000000002
+ddnextp032 nextplus -1.000000000000004 -> -1.000000000000003
+ddnextp033 nextplus -1.000000000000005 -> -1.000000000000004
+ddnextp034 nextplus -1.000000000000006 -> -1.000000000000005
+ddnextp035 nextplus -1.000000000000007 -> -1.000000000000006
+ddnextp036 nextplus -1.000000000000008 -> -1.000000000000007
+ddnextp037 nextplus -1.000000000000009 -> -1.000000000000008
+ddnextp038 nextplus -1.000000000000010 -> -1.000000000000009
+ddnextp039 nextplus -1.000000000000011 -> -1.000000000000010
+ddnextp040 nextplus -1.000000000000012 -> -1.000000000000011
+
+-- Zeros
+ddnextp100 nextplus 0 -> 1E-398
+ddnextp101 nextplus 0.00 -> 1E-398
+ddnextp102 nextplus 0E-300 -> 1E-398
+ddnextp103 nextplus 0E+300 -> 1E-398
+ddnextp104 nextplus 0E+30000 -> 1E-398
+ddnextp105 nextplus -0 -> 1E-398
+ddnextp106 nextplus -0.00 -> 1E-398
+ddnextp107 nextplus -0E-300 -> 1E-398
+ddnextp108 nextplus -0E+300 -> 1E-398
+ddnextp109 nextplus -0E+30000 -> 1E-398
+
+-- specials
+ddnextp150 nextplus Inf -> Infinity
+ddnextp151 nextplus -Inf -> -9.999999999999999E+384
+ddnextp152 nextplus NaN -> NaN
+ddnextp153 nextplus sNaN -> NaN Invalid_operation
+ddnextp154 nextplus NaN77 -> NaN77
+ddnextp155 nextplus sNaN88 -> NaN88 Invalid_operation
+ddnextp156 nextplus -NaN -> -NaN
+ddnextp157 nextplus -sNaN -> -NaN Invalid_operation
+ddnextp158 nextplus -NaN77 -> -NaN77
+ddnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+ddnextp170 nextplus -9.999999999999999E+384 -> -9.999999999999998E+384
+ddnextp171 nextplus -9.999999999999998E+384 -> -9.999999999999997E+384
+ddnextp172 nextplus -1E-383 -> -9.99999999999999E-384
+ddnextp173 nextplus -1.000000000000000E-383 -> -9.99999999999999E-384
+ddnextp174 nextplus -9E-398 -> -8E-398
+ddnextp175 nextplus -9.9E-397 -> -9.8E-397
+ddnextp176 nextplus -9.99999999999E-387 -> -9.99999999998E-387
+ddnextp177 nextplus -9.99999999999999E-384 -> -9.99999999999998E-384
+ddnextp178 nextplus -9.99999999999998E-384 -> -9.99999999999997E-384
+ddnextp179 nextplus -9.99999999999997E-384 -> -9.99999999999996E-384
+ddnextp180 nextplus -0E-398 -> 1E-398
+ddnextp181 nextplus -1E-398 -> -0E-398
+ddnextp182 nextplus -2E-398 -> -1E-398
+
+ddnextp183 nextplus 0E-398 -> 1E-398
+ddnextp184 nextplus 1E-398 -> 2E-398
+ddnextp185 nextplus 2E-398 -> 3E-398
+ddnextp186 nextplus 10E-398 -> 1.1E-397
+ddnextp187 nextplus 100E-398 -> 1.01E-396
+ddnextp188 nextplus 100000E-398 -> 1.00001E-393
+ddnextp189 nextplus 1.00000000000E-383 -> 1.000000000000001E-383
+ddnextp190 nextplus 1.000000000000000E-383 -> 1.000000000000001E-383
+ddnextp191 nextplus 1E-383 -> 1.000000000000001E-383
+ddnextp192 nextplus 9.999999999999998E+384 -> 9.999999999999999E+384
+ddnextp193 nextplus 9.999999999999999E+384 -> Infinity
+
+-- Null tests
+ddnextp900 nextplus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddNextToward.decTest b/Lib/test/decimaltestdata/ddNextToward.decTest
index f9e474d70f..75386add31 100644
--- a/Lib/test/decimaltestdata/ddNextToward.decTest
+++ b/Lib/test/decimaltestdata/ddNextToward.decTest
@@ -1,374 +1,374 @@
-------------------------------------------------------------------------
--- ddNextToward.decTest -- decDouble next toward rhs [754r nextafter] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check with a scattering of numerics
-ddnextt001 nexttoward 10 10 -> 10
-ddnextt002 nexttoward -10 -10 -> -10
-ddnextt003 nexttoward 1 10 -> 1.000000000000001
-ddnextt004 nexttoward 1 -10 -> 0.9999999999999999
-ddnextt005 nexttoward -1 10 -> -0.9999999999999999
-ddnextt006 nexttoward -1 -10 -> -1.000000000000001
-ddnextt007 nexttoward 0 10 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt008 nexttoward 0 -10 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt009 nexttoward 9.999999999999999E+384 +Infinity -> Infinity Overflow Inexact Rounded
-ddnextt010 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
-ddnextt011 nexttoward 9.999999999999999 10 -> 10.00000000000000
-ddnextt012 nexttoward 10 9.999999999999999 -> 9.999999999999999
-ddnextt013 nexttoward -9.999999999999999 -10 -> -10.00000000000000
-ddnextt014 nexttoward -10 -9.999999999999999 -> -9.999999999999999
-ddnextt015 nexttoward 9.999999999999998 10 -> 9.999999999999999
-ddnextt016 nexttoward 10 9.999999999999998 -> 9.999999999999999
-ddnextt017 nexttoward -9.999999999999998 -10 -> -9.999999999999999
-ddnextt018 nexttoward -10 -9.999999999999998 -> -9.999999999999999
-
-------- lhs=rhs
--- finites
-ddnextt101 nexttoward 7 7 -> 7
-ddnextt102 nexttoward -7 -7 -> -7
-ddnextt103 nexttoward 75 75 -> 75
-ddnextt104 nexttoward -75 -75 -> -75
-ddnextt105 nexttoward 7.50 7.5 -> 7.50
-ddnextt106 nexttoward -7.50 -7.50 -> -7.50
-ddnextt107 nexttoward 7.500 7.5000 -> 7.500
-ddnextt108 nexttoward -7.500 -7.5 -> -7.500
-
--- zeros
-ddnextt111 nexttoward 0 0 -> 0
-ddnextt112 nexttoward -0 -0 -> -0
-ddnextt113 nexttoward 0E+4 0 -> 0E+4
-ddnextt114 nexttoward -0E+4 -0 -> -0E+4
-ddnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11
-ddnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11
-ddnextt117 nexttoward 0E-141 0 -> 0E-141
-ddnextt118 nexttoward -0E-141 -000 -> -0E-141
-
--- full coefficients, alternating bits
-ddnextt121 nexttoward 268268268 268268268 -> 268268268
-ddnextt122 nexttoward -268268268 -268268268 -> -268268268
-ddnextt123 nexttoward 134134134 134134134 -> 134134134
-ddnextt124 nexttoward -134134134 -134134134 -> -134134134
-
--- Nmax, Nmin, Ntiny
-ddnextt131 nexttoward 9.999999999999999E+384 9.999999999999999E+384 -> 9.999999999999999E+384
-ddnextt132 nexttoward 1E-383 1E-383 -> 1E-383
-ddnextt133 nexttoward 1.000000000000000E-383 1.000000000000000E-383 -> 1.000000000000000E-383
-ddnextt134 nexttoward 1E-398 1E-398 -> 1E-398
-
-ddnextt135 nexttoward -1E-398 -1E-398 -> -1E-398
-ddnextt136 nexttoward -1.000000000000000E-383 -1.000000000000000E-383 -> -1.000000000000000E-383
-ddnextt137 nexttoward -1E-383 -1E-383 -> -1E-383
-ddnextt138 nexttoward -9.999999999999999E+384 -9.999999999999999E+384 -> -9.999999999999999E+384
-
-------- lhs<rhs
-ddnextt201 nexttoward 0.9999999999999995 Infinity -> 0.9999999999999996
-ddnextt202 nexttoward 0.9999999999999996 Infinity -> 0.9999999999999997
-ddnextt203 nexttoward 0.9999999999999997 Infinity -> 0.9999999999999998
-ddnextt204 nexttoward 0.9999999999999998 Infinity -> 0.9999999999999999
-ddnextt205 nexttoward 0.9999999999999999 Infinity -> 1.000000000000000
-ddnextt206 nexttoward 1.000000000000000 Infinity -> 1.000000000000001
-ddnextt207 nexttoward 1.0 Infinity -> 1.000000000000001
-ddnextt208 nexttoward 1 Infinity -> 1.000000000000001
-ddnextt209 nexttoward 1.000000000000001 Infinity -> 1.000000000000002
-ddnextt210 nexttoward 1.000000000000002 Infinity -> 1.000000000000003
-ddnextt211 nexttoward 1.000000000000003 Infinity -> 1.000000000000004
-ddnextt212 nexttoward 1.000000000000004 Infinity -> 1.000000000000005
-ddnextt213 nexttoward 1.000000000000005 Infinity -> 1.000000000000006
-ddnextt214 nexttoward 1.000000000000006 Infinity -> 1.000000000000007
-ddnextt215 nexttoward 1.000000000000007 Infinity -> 1.000000000000008
-ddnextt216 nexttoward 1.000000000000008 Infinity -> 1.000000000000009
-ddnextt217 nexttoward 1.000000000000009 Infinity -> 1.000000000000010
-ddnextt218 nexttoward 1.000000000000010 Infinity -> 1.000000000000011
-ddnextt219 nexttoward 1.000000000000011 Infinity -> 1.000000000000012
-
-ddnextt221 nexttoward -0.9999999999999995 Infinity -> -0.9999999999999994
-ddnextt222 nexttoward -0.9999999999999996 Infinity -> -0.9999999999999995
-ddnextt223 nexttoward -0.9999999999999997 Infinity -> -0.9999999999999996
-ddnextt224 nexttoward -0.9999999999999998 Infinity -> -0.9999999999999997
-ddnextt225 nexttoward -0.9999999999999999 Infinity -> -0.9999999999999998
-ddnextt226 nexttoward -1.000000000000000 Infinity -> -0.9999999999999999
-ddnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999
-ddnextt228 nexttoward -1 Infinity -> -0.9999999999999999
-ddnextt229 nexttoward -1.000000000000001 Infinity -> -1.000000000000000
-ddnextt230 nexttoward -1.000000000000002 Infinity -> -1.000000000000001
-ddnextt231 nexttoward -1.000000000000003 Infinity -> -1.000000000000002
-ddnextt232 nexttoward -1.000000000000004 Infinity -> -1.000000000000003
-ddnextt233 nexttoward -1.000000000000005 Infinity -> -1.000000000000004
-ddnextt234 nexttoward -1.000000000000006 Infinity -> -1.000000000000005
-ddnextt235 nexttoward -1.000000000000007 Infinity -> -1.000000000000006
-ddnextt236 nexttoward -1.000000000000008 Infinity -> -1.000000000000007
-ddnextt237 nexttoward -1.000000000000009 Infinity -> -1.000000000000008
-ddnextt238 nexttoward -1.000000000000010 Infinity -> -1.000000000000009
-ddnextt239 nexttoward -1.000000000000011 Infinity -> -1.000000000000010
-ddnextt240 nexttoward -1.000000000000012 Infinity -> -1.000000000000011
-
--- Zeros
-ddnextt300 nexttoward 0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt301 nexttoward 0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt302 nexttoward 0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt303 nexttoward 0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt304 nexttoward 0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt305 nexttoward -0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt306 nexttoward -0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt307 nexttoward -0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt308 nexttoward -0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt309 nexttoward -0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-
--- specials
-ddnextt350 nexttoward Inf Infinity -> Infinity
-ddnextt351 nexttoward -Inf Infinity -> -9.999999999999999E+384
-ddnextt352 nexttoward NaN Infinity -> NaN
-ddnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
-ddnextt354 nexttoward NaN77 Infinity -> NaN77
-ddnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
-ddnextt356 nexttoward -NaN Infinity -> -NaN
-ddnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
-ddnextt358 nexttoward -NaN77 Infinity -> -NaN77
-ddnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-ddnextt370 nexttoward -9.999999999999999E+384 Infinity -> -9.999999999999998E+384
-ddnextt371 nexttoward -9.999999999999998E+384 Infinity -> -9.999999999999997E+384
-ddnextt372 nexttoward -1E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
-ddnextt373 nexttoward -1.000000000000000E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
-ddnextt374 nexttoward -9E-398 Infinity -> -8E-398 Underflow Subnormal Inexact Rounded
-ddnextt375 nexttoward -9.9E-397 Infinity -> -9.8E-397 Underflow Subnormal Inexact Rounded
-ddnextt376 nexttoward -9.99999999999E-387 Infinity -> -9.99999999998E-387 Underflow Subnormal Inexact Rounded
-ddnextt377 nexttoward -9.99999999999999E-384 Infinity -> -9.99999999999998E-384 Underflow Subnormal Inexact Rounded
-ddnextt378 nexttoward -9.99999999999998E-384 Infinity -> -9.99999999999997E-384 Underflow Subnormal Inexact Rounded
-ddnextt379 nexttoward -9.99999999999997E-384 Infinity -> -9.99999999999996E-384 Underflow Subnormal Inexact Rounded
-ddnextt380 nexttoward -0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt381 nexttoward -1E-398 Infinity -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddnextt382 nexttoward -2E-398 Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-
-ddnextt383 nexttoward 0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt384 nexttoward 1E-398 Infinity -> 2E-398 Underflow Subnormal Inexact Rounded
-ddnextt385 nexttoward 2E-398 Infinity -> 3E-398 Underflow Subnormal Inexact Rounded
-ddnextt386 nexttoward 10E-398 Infinity -> 1.1E-397 Underflow Subnormal Inexact Rounded
-ddnextt387 nexttoward 100E-398 Infinity -> 1.01E-396 Underflow Subnormal Inexact Rounded
-ddnextt388 nexttoward 100000E-398 Infinity -> 1.00001E-393 Underflow Subnormal Inexact Rounded
-ddnextt389 nexttoward 1.00000000000E-383 Infinity -> 1.000000000000001E-383
-ddnextt390 nexttoward 1.000000000000000E-383 Infinity -> 1.000000000000001E-383
-ddnextt391 nexttoward 1E-383 Infinity -> 1.000000000000001E-383
-ddnextt392 nexttoward 9.999999999999997E+384 Infinity -> 9.999999999999998E+384
-ddnextt393 nexttoward 9.999999999999998E+384 Infinity -> 9.999999999999999E+384
-ddnextt394 nexttoward 9.999999999999999E+384 Infinity -> Infinity Overflow Inexact Rounded
-
-------- lhs>rhs
-ddnextt401 nexttoward 0.9999999999999995 -Infinity -> 0.9999999999999994
-ddnextt402 nexttoward 0.9999999999999996 -Infinity -> 0.9999999999999995
-ddnextt403 nexttoward 0.9999999999999997 -Infinity -> 0.9999999999999996
-ddnextt404 nexttoward 0.9999999999999998 -Infinity -> 0.9999999999999997
-ddnextt405 nexttoward 0.9999999999999999 -Infinity -> 0.9999999999999998
-ddnextt406 nexttoward 1.000000000000000 -Infinity -> 0.9999999999999999
-ddnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999
-ddnextt408 nexttoward 1 -Infinity -> 0.9999999999999999
-ddnextt409 nexttoward 1.000000000000001 -Infinity -> 1.000000000000000
-ddnextt410 nexttoward 1.000000000000002 -Infinity -> 1.000000000000001
-ddnextt411 nexttoward 1.000000000000003 -Infinity -> 1.000000000000002
-ddnextt412 nexttoward 1.000000000000004 -Infinity -> 1.000000000000003
-ddnextt413 nexttoward 1.000000000000005 -Infinity -> 1.000000000000004
-ddnextt414 nexttoward 1.000000000000006 -Infinity -> 1.000000000000005
-ddnextt415 nexttoward 1.000000000000007 -Infinity -> 1.000000000000006
-ddnextt416 nexttoward 1.000000000000008 -Infinity -> 1.000000000000007
-ddnextt417 nexttoward 1.000000000000009 -Infinity -> 1.000000000000008
-ddnextt418 nexttoward 1.000000000000010 -Infinity -> 1.000000000000009
-ddnextt419 nexttoward 1.000000000000011 -Infinity -> 1.000000000000010
-ddnextt420 nexttoward 1.000000000000012 -Infinity -> 1.000000000000011
-
-ddnextt421 nexttoward -0.9999999999999995 -Infinity -> -0.9999999999999996
-ddnextt422 nexttoward -0.9999999999999996 -Infinity -> -0.9999999999999997
-ddnextt423 nexttoward -0.9999999999999997 -Infinity -> -0.9999999999999998
-ddnextt424 nexttoward -0.9999999999999998 -Infinity -> -0.9999999999999999
-ddnextt425 nexttoward -0.9999999999999999 -Infinity -> -1.000000000000000
-ddnextt426 nexttoward -1.000000000000000 -Infinity -> -1.000000000000001
-ddnextt427 nexttoward -1.0 -Infinity -> -1.000000000000001
-ddnextt428 nexttoward -1 -Infinity -> -1.000000000000001
-ddnextt429 nexttoward -1.000000000000001 -Infinity -> -1.000000000000002
-ddnextt430 nexttoward -1.000000000000002 -Infinity -> -1.000000000000003
-ddnextt431 nexttoward -1.000000000000003 -Infinity -> -1.000000000000004
-ddnextt432 nexttoward -1.000000000000004 -Infinity -> -1.000000000000005
-ddnextt433 nexttoward -1.000000000000005 -Infinity -> -1.000000000000006
-ddnextt434 nexttoward -1.000000000000006 -Infinity -> -1.000000000000007
-ddnextt435 nexttoward -1.000000000000007 -Infinity -> -1.000000000000008
-ddnextt436 nexttoward -1.000000000000008 -Infinity -> -1.000000000000009
-ddnextt437 nexttoward -1.000000000000009 -Infinity -> -1.000000000000010
-ddnextt438 nexttoward -1.000000000000010 -Infinity -> -1.000000000000011
-ddnextt439 nexttoward -1.000000000000011 -Infinity -> -1.000000000000012
-
--- Zeros
-ddnextt500 nexttoward -0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt501 nexttoward 0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt502 nexttoward 0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt503 nexttoward -0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt504 nexttoward 0E-300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt505 nexttoward 0E+300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt506 nexttoward 0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt507 nexttoward -0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-
--- specials
-ddnextt550 nexttoward Inf -Infinity -> 9.999999999999999E+384
-ddnextt551 nexttoward -Inf -Infinity -> -Infinity
-ddnextt552 nexttoward NaN -Infinity -> NaN
-ddnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
-ddnextt554 nexttoward NaN77 -Infinity -> NaN77
-ddnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
-ddnextt556 nexttoward -NaN -Infinity -> -NaN
-ddnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
-ddnextt558 nexttoward -NaN77 -Infinity -> -NaN77
-ddnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-ddnextt670 nexttoward 9.999999999999999E+384 -Infinity -> 9.999999999999998E+384
-ddnextt671 nexttoward 9.999999999999998E+384 -Infinity -> 9.999999999999997E+384
-ddnextt672 nexttoward 1E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
-ddnextt673 nexttoward 1.000000000000000E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
-ddnextt674 nexttoward 9E-398 -Infinity -> 8E-398 Underflow Subnormal Inexact Rounded
-ddnextt675 nexttoward 9.9E-397 -Infinity -> 9.8E-397 Underflow Subnormal Inexact Rounded
-ddnextt676 nexttoward 9.99999999999E-387 -Infinity -> 9.99999999998E-387 Underflow Subnormal Inexact Rounded
-ddnextt677 nexttoward 9.99999999999999E-384 -Infinity -> 9.99999999999998E-384 Underflow Subnormal Inexact Rounded
-ddnextt678 nexttoward 9.99999999999998E-384 -Infinity -> 9.99999999999997E-384 Underflow Subnormal Inexact Rounded
-ddnextt679 nexttoward 9.99999999999997E-384 -Infinity -> 9.99999999999996E-384 Underflow Subnormal Inexact Rounded
-ddnextt680 nexttoward 0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt681 nexttoward 1E-398 -Infinity -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddnextt682 nexttoward 2E-398 -Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-
-ddnextt683 nexttoward -0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt684 nexttoward -1E-398 -Infinity -> -2E-398 Underflow Subnormal Inexact Rounded
-ddnextt685 nexttoward -2E-398 -Infinity -> -3E-398 Underflow Subnormal Inexact Rounded
-ddnextt686 nexttoward -10E-398 -Infinity -> -1.1E-397 Underflow Subnormal Inexact Rounded
-ddnextt687 nexttoward -100E-398 -Infinity -> -1.01E-396 Underflow Subnormal Inexact Rounded
-ddnextt688 nexttoward -100000E-398 -Infinity -> -1.00001E-393 Underflow Subnormal Inexact Rounded
-ddnextt689 nexttoward -1.00000000000E-383 -Infinity -> -1.000000000000001E-383
-ddnextt690 nexttoward -1.000000000000000E-383 -Infinity -> -1.000000000000001E-383
-ddnextt691 nexttoward -1E-383 -Infinity -> -1.000000000000001E-383
-ddnextt692 nexttoward -9.999999999999998E+384 -Infinity -> -9.999999999999999E+384
-ddnextt693 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
-
-------- Specials
-ddnextt780 nexttoward -Inf -Inf -> -Infinity
-ddnextt781 nexttoward -Inf -1000 -> -9.999999999999999E+384
-ddnextt782 nexttoward -Inf -1 -> -9.999999999999999E+384
-ddnextt783 nexttoward -Inf -0 -> -9.999999999999999E+384
-ddnextt784 nexttoward -Inf 0 -> -9.999999999999999E+384
-ddnextt785 nexttoward -Inf 1 -> -9.999999999999999E+384
-ddnextt786 nexttoward -Inf 1000 -> -9.999999999999999E+384
-ddnextt787 nexttoward -1000 -Inf -> -1000.000000000001
-ddnextt788 nexttoward -Inf -Inf -> -Infinity
-ddnextt789 nexttoward -1 -Inf -> -1.000000000000001
-ddnextt790 nexttoward -0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt791 nexttoward 0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt792 nexttoward 1 -Inf -> 0.9999999999999999
-ddnextt793 nexttoward 1000 -Inf -> 999.9999999999999
-ddnextt794 nexttoward Inf -Inf -> 9.999999999999999E+384
-
-ddnextt800 nexttoward Inf -Inf -> 9.999999999999999E+384
-ddnextt801 nexttoward Inf -1000 -> 9.999999999999999E+384
-ddnextt802 nexttoward Inf -1 -> 9.999999999999999E+384
-ddnextt803 nexttoward Inf -0 -> 9.999999999999999E+384
-ddnextt804 nexttoward Inf 0 -> 9.999999999999999E+384
-ddnextt805 nexttoward Inf 1 -> 9.999999999999999E+384
-ddnextt806 nexttoward Inf 1000 -> 9.999999999999999E+384
-ddnextt807 nexttoward Inf Inf -> Infinity
-ddnextt808 nexttoward -1000 Inf -> -999.9999999999999
-ddnextt809 nexttoward -Inf Inf -> -9.999999999999999E+384
-ddnextt810 nexttoward -1 Inf -> -0.9999999999999999
-ddnextt811 nexttoward -0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt812 nexttoward 0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt813 nexttoward 1 Inf -> 1.000000000000001
-ddnextt814 nexttoward 1000 Inf -> 1000.000000000001
-ddnextt815 nexttoward Inf Inf -> Infinity
-
-ddnextt821 nexttoward NaN -Inf -> NaN
-ddnextt822 nexttoward NaN -1000 -> NaN
-ddnextt823 nexttoward NaN -1 -> NaN
-ddnextt824 nexttoward NaN -0 -> NaN
-ddnextt825 nexttoward NaN 0 -> NaN
-ddnextt826 nexttoward NaN 1 -> NaN
-ddnextt827 nexttoward NaN 1000 -> NaN
-ddnextt828 nexttoward NaN Inf -> NaN
-ddnextt829 nexttoward NaN NaN -> NaN
-ddnextt830 nexttoward -Inf NaN -> NaN
-ddnextt831 nexttoward -1000 NaN -> NaN
-ddnextt832 nexttoward -1 NaN -> NaN
-ddnextt833 nexttoward -0 NaN -> NaN
-ddnextt834 nexttoward 0 NaN -> NaN
-ddnextt835 nexttoward 1 NaN -> NaN
-ddnextt836 nexttoward 1000 NaN -> NaN
-ddnextt837 nexttoward Inf NaN -> NaN
-
-ddnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
-ddnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
-ddnextt843 nexttoward sNaN -1 -> NaN Invalid_operation
-ddnextt844 nexttoward sNaN -0 -> NaN Invalid_operation
-ddnextt845 nexttoward sNaN 0 -> NaN Invalid_operation
-ddnextt846 nexttoward sNaN 1 -> NaN Invalid_operation
-ddnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
-ddnextt848 nexttoward sNaN NaN -> NaN Invalid_operation
-ddnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
-ddnextt850 nexttoward NaN sNaN -> NaN Invalid_operation
-ddnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
-ddnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
-ddnextt853 nexttoward -1 sNaN -> NaN Invalid_operation
-ddnextt854 nexttoward -0 sNaN -> NaN Invalid_operation
-ddnextt855 nexttoward 0 sNaN -> NaN Invalid_operation
-ddnextt856 nexttoward 1 sNaN -> NaN Invalid_operation
-ddnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
-ddnextt858 nexttoward Inf sNaN -> NaN Invalid_operation
-ddnextt859 nexttoward NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddnextt861 nexttoward NaN1 -Inf -> NaN1
-ddnextt862 nexttoward +NaN2 -1000 -> NaN2
-ddnextt863 nexttoward NaN3 1000 -> NaN3
-ddnextt864 nexttoward NaN4 Inf -> NaN4
-ddnextt865 nexttoward NaN5 +NaN6 -> NaN5
-ddnextt866 nexttoward -Inf NaN7 -> NaN7
-ddnextt867 nexttoward -1000 NaN8 -> NaN8
-ddnextt868 nexttoward 1000 NaN9 -> NaN9
-ddnextt869 nexttoward Inf +NaN10 -> NaN10
-ddnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
-ddnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
-ddnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
-ddnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
-ddnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
-ddnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
-ddnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
-ddnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
-ddnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
-ddnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddnextt882 nexttoward -NaN26 NaN28 -> -NaN26
-ddnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddnextt884 nexttoward 1000 -NaN30 -> -NaN30
-ddnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Null tests
-ddnextt900 nexttoward 1 # -> NaN Invalid_operation
-ddnextt901 nexttoward # 1 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddNextToward.decTest -- decDouble next toward rhs [754r nextafter] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check with a scattering of numerics
+ddnextt001 nexttoward 10 10 -> 10
+ddnextt002 nexttoward -10 -10 -> -10
+ddnextt003 nexttoward 1 10 -> 1.000000000000001
+ddnextt004 nexttoward 1 -10 -> 0.9999999999999999
+ddnextt005 nexttoward -1 10 -> -0.9999999999999999
+ddnextt006 nexttoward -1 -10 -> -1.000000000000001
+ddnextt007 nexttoward 0 10 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt008 nexttoward 0 -10 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt009 nexttoward 9.999999999999999E+384 +Infinity -> Infinity Overflow Inexact Rounded
+ddnextt010 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
+ddnextt011 nexttoward 9.999999999999999 10 -> 10.00000000000000
+ddnextt012 nexttoward 10 9.999999999999999 -> 9.999999999999999
+ddnextt013 nexttoward -9.999999999999999 -10 -> -10.00000000000000
+ddnextt014 nexttoward -10 -9.999999999999999 -> -9.999999999999999
+ddnextt015 nexttoward 9.999999999999998 10 -> 9.999999999999999
+ddnextt016 nexttoward 10 9.999999999999998 -> 9.999999999999999
+ddnextt017 nexttoward -9.999999999999998 -10 -> -9.999999999999999
+ddnextt018 nexttoward -10 -9.999999999999998 -> -9.999999999999999
+
+------- lhs=rhs
+-- finites
+ddnextt101 nexttoward 7 7 -> 7
+ddnextt102 nexttoward -7 -7 -> -7
+ddnextt103 nexttoward 75 75 -> 75
+ddnextt104 nexttoward -75 -75 -> -75
+ddnextt105 nexttoward 7.50 7.5 -> 7.50
+ddnextt106 nexttoward -7.50 -7.50 -> -7.50
+ddnextt107 nexttoward 7.500 7.5000 -> 7.500
+ddnextt108 nexttoward -7.500 -7.5 -> -7.500
+
+-- zeros
+ddnextt111 nexttoward 0 0 -> 0
+ddnextt112 nexttoward -0 -0 -> -0
+ddnextt113 nexttoward 0E+4 0 -> 0E+4
+ddnextt114 nexttoward -0E+4 -0 -> -0E+4
+ddnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11
+ddnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11
+ddnextt117 nexttoward 0E-141 0 -> 0E-141
+ddnextt118 nexttoward -0E-141 -000 -> -0E-141
+
+-- full coefficients, alternating bits
+ddnextt121 nexttoward 268268268 268268268 -> 268268268
+ddnextt122 nexttoward -268268268 -268268268 -> -268268268
+ddnextt123 nexttoward 134134134 134134134 -> 134134134
+ddnextt124 nexttoward -134134134 -134134134 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+ddnextt131 nexttoward 9.999999999999999E+384 9.999999999999999E+384 -> 9.999999999999999E+384
+ddnextt132 nexttoward 1E-383 1E-383 -> 1E-383
+ddnextt133 nexttoward 1.000000000000000E-383 1.000000000000000E-383 -> 1.000000000000000E-383
+ddnextt134 nexttoward 1E-398 1E-398 -> 1E-398
+
+ddnextt135 nexttoward -1E-398 -1E-398 -> -1E-398
+ddnextt136 nexttoward -1.000000000000000E-383 -1.000000000000000E-383 -> -1.000000000000000E-383
+ddnextt137 nexttoward -1E-383 -1E-383 -> -1E-383
+ddnextt138 nexttoward -9.999999999999999E+384 -9.999999999999999E+384 -> -9.999999999999999E+384
+
+------- lhs<rhs
+ddnextt201 nexttoward 0.9999999999999995 Infinity -> 0.9999999999999996
+ddnextt202 nexttoward 0.9999999999999996 Infinity -> 0.9999999999999997
+ddnextt203 nexttoward 0.9999999999999997 Infinity -> 0.9999999999999998
+ddnextt204 nexttoward 0.9999999999999998 Infinity -> 0.9999999999999999
+ddnextt205 nexttoward 0.9999999999999999 Infinity -> 1.000000000000000
+ddnextt206 nexttoward 1.000000000000000 Infinity -> 1.000000000000001
+ddnextt207 nexttoward 1.0 Infinity -> 1.000000000000001
+ddnextt208 nexttoward 1 Infinity -> 1.000000000000001
+ddnextt209 nexttoward 1.000000000000001 Infinity -> 1.000000000000002
+ddnextt210 nexttoward 1.000000000000002 Infinity -> 1.000000000000003
+ddnextt211 nexttoward 1.000000000000003 Infinity -> 1.000000000000004
+ddnextt212 nexttoward 1.000000000000004 Infinity -> 1.000000000000005
+ddnextt213 nexttoward 1.000000000000005 Infinity -> 1.000000000000006
+ddnextt214 nexttoward 1.000000000000006 Infinity -> 1.000000000000007
+ddnextt215 nexttoward 1.000000000000007 Infinity -> 1.000000000000008
+ddnextt216 nexttoward 1.000000000000008 Infinity -> 1.000000000000009
+ddnextt217 nexttoward 1.000000000000009 Infinity -> 1.000000000000010
+ddnextt218 nexttoward 1.000000000000010 Infinity -> 1.000000000000011
+ddnextt219 nexttoward 1.000000000000011 Infinity -> 1.000000000000012
+
+ddnextt221 nexttoward -0.9999999999999995 Infinity -> -0.9999999999999994
+ddnextt222 nexttoward -0.9999999999999996 Infinity -> -0.9999999999999995
+ddnextt223 nexttoward -0.9999999999999997 Infinity -> -0.9999999999999996
+ddnextt224 nexttoward -0.9999999999999998 Infinity -> -0.9999999999999997
+ddnextt225 nexttoward -0.9999999999999999 Infinity -> -0.9999999999999998
+ddnextt226 nexttoward -1.000000000000000 Infinity -> -0.9999999999999999
+ddnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999
+ddnextt228 nexttoward -1 Infinity -> -0.9999999999999999
+ddnextt229 nexttoward -1.000000000000001 Infinity -> -1.000000000000000
+ddnextt230 nexttoward -1.000000000000002 Infinity -> -1.000000000000001
+ddnextt231 nexttoward -1.000000000000003 Infinity -> -1.000000000000002
+ddnextt232 nexttoward -1.000000000000004 Infinity -> -1.000000000000003
+ddnextt233 nexttoward -1.000000000000005 Infinity -> -1.000000000000004
+ddnextt234 nexttoward -1.000000000000006 Infinity -> -1.000000000000005
+ddnextt235 nexttoward -1.000000000000007 Infinity -> -1.000000000000006
+ddnextt236 nexttoward -1.000000000000008 Infinity -> -1.000000000000007
+ddnextt237 nexttoward -1.000000000000009 Infinity -> -1.000000000000008
+ddnextt238 nexttoward -1.000000000000010 Infinity -> -1.000000000000009
+ddnextt239 nexttoward -1.000000000000011 Infinity -> -1.000000000000010
+ddnextt240 nexttoward -1.000000000000012 Infinity -> -1.000000000000011
+
+-- Zeros
+ddnextt300 nexttoward 0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt301 nexttoward 0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt302 nexttoward 0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt303 nexttoward 0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt304 nexttoward 0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt305 nexttoward -0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt306 nexttoward -0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt307 nexttoward -0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt308 nexttoward -0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt309 nexttoward -0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+
+-- specials
+ddnextt350 nexttoward Inf Infinity -> Infinity
+ddnextt351 nexttoward -Inf Infinity -> -9.999999999999999E+384
+ddnextt352 nexttoward NaN Infinity -> NaN
+ddnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
+ddnextt354 nexttoward NaN77 Infinity -> NaN77
+ddnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
+ddnextt356 nexttoward -NaN Infinity -> -NaN
+ddnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
+ddnextt358 nexttoward -NaN77 Infinity -> -NaN77
+ddnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+ddnextt370 nexttoward -9.999999999999999E+384 Infinity -> -9.999999999999998E+384
+ddnextt371 nexttoward -9.999999999999998E+384 Infinity -> -9.999999999999997E+384
+ddnextt372 nexttoward -1E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
+ddnextt373 nexttoward -1.000000000000000E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
+ddnextt374 nexttoward -9E-398 Infinity -> -8E-398 Underflow Subnormal Inexact Rounded
+ddnextt375 nexttoward -9.9E-397 Infinity -> -9.8E-397 Underflow Subnormal Inexact Rounded
+ddnextt376 nexttoward -9.99999999999E-387 Infinity -> -9.99999999998E-387 Underflow Subnormal Inexact Rounded
+ddnextt377 nexttoward -9.99999999999999E-384 Infinity -> -9.99999999999998E-384 Underflow Subnormal Inexact Rounded
+ddnextt378 nexttoward -9.99999999999998E-384 Infinity -> -9.99999999999997E-384 Underflow Subnormal Inexact Rounded
+ddnextt379 nexttoward -9.99999999999997E-384 Infinity -> -9.99999999999996E-384 Underflow Subnormal Inexact Rounded
+ddnextt380 nexttoward -0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt381 nexttoward -1E-398 Infinity -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddnextt382 nexttoward -2E-398 Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+
+ddnextt383 nexttoward 0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt384 nexttoward 1E-398 Infinity -> 2E-398 Underflow Subnormal Inexact Rounded
+ddnextt385 nexttoward 2E-398 Infinity -> 3E-398 Underflow Subnormal Inexact Rounded
+ddnextt386 nexttoward 10E-398 Infinity -> 1.1E-397 Underflow Subnormal Inexact Rounded
+ddnextt387 nexttoward 100E-398 Infinity -> 1.01E-396 Underflow Subnormal Inexact Rounded
+ddnextt388 nexttoward 100000E-398 Infinity -> 1.00001E-393 Underflow Subnormal Inexact Rounded
+ddnextt389 nexttoward 1.00000000000E-383 Infinity -> 1.000000000000001E-383
+ddnextt390 nexttoward 1.000000000000000E-383 Infinity -> 1.000000000000001E-383
+ddnextt391 nexttoward 1E-383 Infinity -> 1.000000000000001E-383
+ddnextt392 nexttoward 9.999999999999997E+384 Infinity -> 9.999999999999998E+384
+ddnextt393 nexttoward 9.999999999999998E+384 Infinity -> 9.999999999999999E+384
+ddnextt394 nexttoward 9.999999999999999E+384 Infinity -> Infinity Overflow Inexact Rounded
+
+------- lhs>rhs
+ddnextt401 nexttoward 0.9999999999999995 -Infinity -> 0.9999999999999994
+ddnextt402 nexttoward 0.9999999999999996 -Infinity -> 0.9999999999999995
+ddnextt403 nexttoward 0.9999999999999997 -Infinity -> 0.9999999999999996
+ddnextt404 nexttoward 0.9999999999999998 -Infinity -> 0.9999999999999997
+ddnextt405 nexttoward 0.9999999999999999 -Infinity -> 0.9999999999999998
+ddnextt406 nexttoward 1.000000000000000 -Infinity -> 0.9999999999999999
+ddnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999
+ddnextt408 nexttoward 1 -Infinity -> 0.9999999999999999
+ddnextt409 nexttoward 1.000000000000001 -Infinity -> 1.000000000000000
+ddnextt410 nexttoward 1.000000000000002 -Infinity -> 1.000000000000001
+ddnextt411 nexttoward 1.000000000000003 -Infinity -> 1.000000000000002
+ddnextt412 nexttoward 1.000000000000004 -Infinity -> 1.000000000000003
+ddnextt413 nexttoward 1.000000000000005 -Infinity -> 1.000000000000004
+ddnextt414 nexttoward 1.000000000000006 -Infinity -> 1.000000000000005
+ddnextt415 nexttoward 1.000000000000007 -Infinity -> 1.000000000000006
+ddnextt416 nexttoward 1.000000000000008 -Infinity -> 1.000000000000007
+ddnextt417 nexttoward 1.000000000000009 -Infinity -> 1.000000000000008
+ddnextt418 nexttoward 1.000000000000010 -Infinity -> 1.000000000000009
+ddnextt419 nexttoward 1.000000000000011 -Infinity -> 1.000000000000010
+ddnextt420 nexttoward 1.000000000000012 -Infinity -> 1.000000000000011
+
+ddnextt421 nexttoward -0.9999999999999995 -Infinity -> -0.9999999999999996
+ddnextt422 nexttoward -0.9999999999999996 -Infinity -> -0.9999999999999997
+ddnextt423 nexttoward -0.9999999999999997 -Infinity -> -0.9999999999999998
+ddnextt424 nexttoward -0.9999999999999998 -Infinity -> -0.9999999999999999
+ddnextt425 nexttoward -0.9999999999999999 -Infinity -> -1.000000000000000
+ddnextt426 nexttoward -1.000000000000000 -Infinity -> -1.000000000000001
+ddnextt427 nexttoward -1.0 -Infinity -> -1.000000000000001
+ddnextt428 nexttoward -1 -Infinity -> -1.000000000000001
+ddnextt429 nexttoward -1.000000000000001 -Infinity -> -1.000000000000002
+ddnextt430 nexttoward -1.000000000000002 -Infinity -> -1.000000000000003
+ddnextt431 nexttoward -1.000000000000003 -Infinity -> -1.000000000000004
+ddnextt432 nexttoward -1.000000000000004 -Infinity -> -1.000000000000005
+ddnextt433 nexttoward -1.000000000000005 -Infinity -> -1.000000000000006
+ddnextt434 nexttoward -1.000000000000006 -Infinity -> -1.000000000000007
+ddnextt435 nexttoward -1.000000000000007 -Infinity -> -1.000000000000008
+ddnextt436 nexttoward -1.000000000000008 -Infinity -> -1.000000000000009
+ddnextt437 nexttoward -1.000000000000009 -Infinity -> -1.000000000000010
+ddnextt438 nexttoward -1.000000000000010 -Infinity -> -1.000000000000011
+ddnextt439 nexttoward -1.000000000000011 -Infinity -> -1.000000000000012
+
+-- Zeros
+ddnextt500 nexttoward -0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt501 nexttoward 0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt502 nexttoward 0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt503 nexttoward -0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt504 nexttoward 0E-300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt505 nexttoward 0E+300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt506 nexttoward 0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt507 nexttoward -0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+
+-- specials
+ddnextt550 nexttoward Inf -Infinity -> 9.999999999999999E+384
+ddnextt551 nexttoward -Inf -Infinity -> -Infinity
+ddnextt552 nexttoward NaN -Infinity -> NaN
+ddnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
+ddnextt554 nexttoward NaN77 -Infinity -> NaN77
+ddnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
+ddnextt556 nexttoward -NaN -Infinity -> -NaN
+ddnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
+ddnextt558 nexttoward -NaN77 -Infinity -> -NaN77
+ddnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+ddnextt670 nexttoward 9.999999999999999E+384 -Infinity -> 9.999999999999998E+384
+ddnextt671 nexttoward 9.999999999999998E+384 -Infinity -> 9.999999999999997E+384
+ddnextt672 nexttoward 1E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
+ddnextt673 nexttoward 1.000000000000000E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
+ddnextt674 nexttoward 9E-398 -Infinity -> 8E-398 Underflow Subnormal Inexact Rounded
+ddnextt675 nexttoward 9.9E-397 -Infinity -> 9.8E-397 Underflow Subnormal Inexact Rounded
+ddnextt676 nexttoward 9.99999999999E-387 -Infinity -> 9.99999999998E-387 Underflow Subnormal Inexact Rounded
+ddnextt677 nexttoward 9.99999999999999E-384 -Infinity -> 9.99999999999998E-384 Underflow Subnormal Inexact Rounded
+ddnextt678 nexttoward 9.99999999999998E-384 -Infinity -> 9.99999999999997E-384 Underflow Subnormal Inexact Rounded
+ddnextt679 nexttoward 9.99999999999997E-384 -Infinity -> 9.99999999999996E-384 Underflow Subnormal Inexact Rounded
+ddnextt680 nexttoward 0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt681 nexttoward 1E-398 -Infinity -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddnextt682 nexttoward 2E-398 -Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+
+ddnextt683 nexttoward -0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt684 nexttoward -1E-398 -Infinity -> -2E-398 Underflow Subnormal Inexact Rounded
+ddnextt685 nexttoward -2E-398 -Infinity -> -3E-398 Underflow Subnormal Inexact Rounded
+ddnextt686 nexttoward -10E-398 -Infinity -> -1.1E-397 Underflow Subnormal Inexact Rounded
+ddnextt687 nexttoward -100E-398 -Infinity -> -1.01E-396 Underflow Subnormal Inexact Rounded
+ddnextt688 nexttoward -100000E-398 -Infinity -> -1.00001E-393 Underflow Subnormal Inexact Rounded
+ddnextt689 nexttoward -1.00000000000E-383 -Infinity -> -1.000000000000001E-383
+ddnextt690 nexttoward -1.000000000000000E-383 -Infinity -> -1.000000000000001E-383
+ddnextt691 nexttoward -1E-383 -Infinity -> -1.000000000000001E-383
+ddnextt692 nexttoward -9.999999999999998E+384 -Infinity -> -9.999999999999999E+384
+ddnextt693 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
+
+------- Specials
+ddnextt780 nexttoward -Inf -Inf -> -Infinity
+ddnextt781 nexttoward -Inf -1000 -> -9.999999999999999E+384
+ddnextt782 nexttoward -Inf -1 -> -9.999999999999999E+384
+ddnextt783 nexttoward -Inf -0 -> -9.999999999999999E+384
+ddnextt784 nexttoward -Inf 0 -> -9.999999999999999E+384
+ddnextt785 nexttoward -Inf 1 -> -9.999999999999999E+384
+ddnextt786 nexttoward -Inf 1000 -> -9.999999999999999E+384
+ddnextt787 nexttoward -1000 -Inf -> -1000.000000000001
+ddnextt788 nexttoward -Inf -Inf -> -Infinity
+ddnextt789 nexttoward -1 -Inf -> -1.000000000000001
+ddnextt790 nexttoward -0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt791 nexttoward 0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt792 nexttoward 1 -Inf -> 0.9999999999999999
+ddnextt793 nexttoward 1000 -Inf -> 999.9999999999999
+ddnextt794 nexttoward Inf -Inf -> 9.999999999999999E+384
+
+ddnextt800 nexttoward Inf -Inf -> 9.999999999999999E+384
+ddnextt801 nexttoward Inf -1000 -> 9.999999999999999E+384
+ddnextt802 nexttoward Inf -1 -> 9.999999999999999E+384
+ddnextt803 nexttoward Inf -0 -> 9.999999999999999E+384
+ddnextt804 nexttoward Inf 0 -> 9.999999999999999E+384
+ddnextt805 nexttoward Inf 1 -> 9.999999999999999E+384
+ddnextt806 nexttoward Inf 1000 -> 9.999999999999999E+384
+ddnextt807 nexttoward Inf Inf -> Infinity
+ddnextt808 nexttoward -1000 Inf -> -999.9999999999999
+ddnextt809 nexttoward -Inf Inf -> -9.999999999999999E+384
+ddnextt810 nexttoward -1 Inf -> -0.9999999999999999
+ddnextt811 nexttoward -0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt812 nexttoward 0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt813 nexttoward 1 Inf -> 1.000000000000001
+ddnextt814 nexttoward 1000 Inf -> 1000.000000000001
+ddnextt815 nexttoward Inf Inf -> Infinity
+
+ddnextt821 nexttoward NaN -Inf -> NaN
+ddnextt822 nexttoward NaN -1000 -> NaN
+ddnextt823 nexttoward NaN -1 -> NaN
+ddnextt824 nexttoward NaN -0 -> NaN
+ddnextt825 nexttoward NaN 0 -> NaN
+ddnextt826 nexttoward NaN 1 -> NaN
+ddnextt827 nexttoward NaN 1000 -> NaN
+ddnextt828 nexttoward NaN Inf -> NaN
+ddnextt829 nexttoward NaN NaN -> NaN
+ddnextt830 nexttoward -Inf NaN -> NaN
+ddnextt831 nexttoward -1000 NaN -> NaN
+ddnextt832 nexttoward -1 NaN -> NaN
+ddnextt833 nexttoward -0 NaN -> NaN
+ddnextt834 nexttoward 0 NaN -> NaN
+ddnextt835 nexttoward 1 NaN -> NaN
+ddnextt836 nexttoward 1000 NaN -> NaN
+ddnextt837 nexttoward Inf NaN -> NaN
+
+ddnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
+ddnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
+ddnextt843 nexttoward sNaN -1 -> NaN Invalid_operation
+ddnextt844 nexttoward sNaN -0 -> NaN Invalid_operation
+ddnextt845 nexttoward sNaN 0 -> NaN Invalid_operation
+ddnextt846 nexttoward sNaN 1 -> NaN Invalid_operation
+ddnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
+ddnextt848 nexttoward sNaN NaN -> NaN Invalid_operation
+ddnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
+ddnextt850 nexttoward NaN sNaN -> NaN Invalid_operation
+ddnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
+ddnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
+ddnextt853 nexttoward -1 sNaN -> NaN Invalid_operation
+ddnextt854 nexttoward -0 sNaN -> NaN Invalid_operation
+ddnextt855 nexttoward 0 sNaN -> NaN Invalid_operation
+ddnextt856 nexttoward 1 sNaN -> NaN Invalid_operation
+ddnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
+ddnextt858 nexttoward Inf sNaN -> NaN Invalid_operation
+ddnextt859 nexttoward NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddnextt861 nexttoward NaN1 -Inf -> NaN1
+ddnextt862 nexttoward +NaN2 -1000 -> NaN2
+ddnextt863 nexttoward NaN3 1000 -> NaN3
+ddnextt864 nexttoward NaN4 Inf -> NaN4
+ddnextt865 nexttoward NaN5 +NaN6 -> NaN5
+ddnextt866 nexttoward -Inf NaN7 -> NaN7
+ddnextt867 nexttoward -1000 NaN8 -> NaN8
+ddnextt868 nexttoward 1000 NaN9 -> NaN9
+ddnextt869 nexttoward Inf +NaN10 -> NaN10
+ddnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
+ddnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
+ddnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
+ddnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
+ddnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
+ddnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
+ddnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
+ddnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
+ddnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
+ddnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddnextt882 nexttoward -NaN26 NaN28 -> -NaN26
+ddnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddnextt884 nexttoward 1000 -NaN30 -> -NaN30
+ddnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Null tests
+ddnextt900 nexttoward 1 # -> NaN Invalid_operation
+ddnextt901 nexttoward # 1 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddOr.decTest b/Lib/test/decimaltestdata/ddOr.decTest
index f3a702b0ef..d36580bf66 100644
--- a/Lib/test/decimaltestdata/ddOr.decTest
+++ b/Lib/test/decimaltestdata/ddOr.decTest
@@ -1,292 +1,292 @@
-------------------------------------------------------------------------
--- ddOr.decTest -- digitwise logical OR for decDoubles --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check (truth table)
-ddor001 or 0 0 -> 0
-ddor002 or 0 1 -> 1
-ddor003 or 1 0 -> 1
-ddor004 or 1 1 -> 1
-ddor005 or 1100 1010 -> 1110
--- and at msd and msd-1
-ddor006 or 0000000000000000 0000000000000000 -> 0
-ddor007 or 0000000000000000 1000000000000000 -> 1000000000000000
-ddor008 or 1000000000000000 0000000000000000 -> 1000000000000000
-ddor009 or 1000000000000000 1000000000000000 -> 1000000000000000
-ddor010 or 0000000000000000 0000000000000000 -> 0
-ddor011 or 0000000000000000 0100000000000000 -> 100000000000000
-ddor012 or 0100000000000000 0000000000000000 -> 100000000000000
-ddor013 or 0100000000000000 0100000000000000 -> 100000000000000
-
--- Various lengths
--- 1234567890123456 1234567890123456 1234567890123456
-ddor020 or 1111111111111111 1111111111111111 -> 1111111111111111
-ddor021 or 111111111111111 111111111111111 -> 111111111111111
-ddor022 or 11111111111111 11111111111111 -> 11111111111111
-ddor023 or 1111111111111 1111111111111 -> 1111111111111
-ddor024 or 111111111111 111111111111 -> 111111111111
-ddor025 or 11111111111 11111111111 -> 11111111111
-ddor026 or 1111111111 1111111111 -> 1111111111
-ddor027 or 111111111 111111111 -> 111111111
-ddor028 or 11111111 11111111 -> 11111111
-ddor029 or 1111111 1111111 -> 1111111
-ddor030 or 111111 111111 -> 111111
-ddor031 or 11111 11111 -> 11111
-ddor032 or 1111 1111 -> 1111
-ddor033 or 111 111 -> 111
-ddor034 or 11 11 -> 11
-ddor035 or 1 1 -> 1
-ddor036 or 0 0 -> 0
-
-ddor042 or 111111110000000 1111111110000000 -> 1111111110000000
-ddor043 or 11111110000000 1000000100000000 -> 1011111110000000
-ddor044 or 1111110000000 1000001000000000 -> 1001111110000000
-ddor045 or 111110000000 1000010000000000 -> 1000111110000000
-ddor046 or 11110000000 1000100000000000 -> 1000111110000000
-ddor047 or 1110000000 1001000000000000 -> 1001001110000000
-ddor048 or 110000000 1010000000000000 -> 1010000110000000
-ddor049 or 10000000 1100000000000000 -> 1100000010000000
-
-ddor090 or 011111111 111101111 -> 111111111
-ddor091 or 101111111 111101111 -> 111111111
-ddor092 or 110111111 111101111 -> 111111111
-ddor093 or 111011111 111101111 -> 111111111
-ddor094 or 111101111 111101111 -> 111101111
-ddor095 or 111110111 111101111 -> 111111111
-ddor096 or 111111011 111101111 -> 111111111
-ddor097 or 111111101 111101111 -> 111111111
-ddor098 or 111111110 111101111 -> 111111111
-
-ddor100 or 111101111 011111111 -> 111111111
-ddor101 or 111101111 101111111 -> 111111111
-ddor102 or 111101111 110111111 -> 111111111
-ddor103 or 111101111 111011111 -> 111111111
-ddor104 or 111101111 111101111 -> 111101111
-ddor105 or 111101111 111110111 -> 111111111
-ddor106 or 111101111 111111011 -> 111111111
-ddor107 or 111101111 111111101 -> 111111111
-ddor108 or 111101111 111111110 -> 111111111
-
--- non-0/1 should not be accepted, nor should signs
-ddor220 or 111111112 111111111 -> NaN Invalid_operation
-ddor221 or 333333333 333333333 -> NaN Invalid_operation
-ddor222 or 555555555 555555555 -> NaN Invalid_operation
-ddor223 or 777777777 777777777 -> NaN Invalid_operation
-ddor224 or 999999999 999999999 -> NaN Invalid_operation
-ddor225 or 222222222 999999999 -> NaN Invalid_operation
-ddor226 or 444444444 999999999 -> NaN Invalid_operation
-ddor227 or 666666666 999999999 -> NaN Invalid_operation
-ddor228 or 888888888 999999999 -> NaN Invalid_operation
-ddor229 or 999999999 222222222 -> NaN Invalid_operation
-ddor230 or 999999999 444444444 -> NaN Invalid_operation
-ddor231 or 999999999 666666666 -> NaN Invalid_operation
-ddor232 or 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-ddor240 or 567468689 -934981942 -> NaN Invalid_operation
-ddor241 or 567367689 934981942 -> NaN Invalid_operation
-ddor242 or -631917772 -706014634 -> NaN Invalid_operation
-ddor243 or -756253257 138579234 -> NaN Invalid_operation
-ddor244 or 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-ddor250 or 2000000000000000 1000000000000000 -> NaN Invalid_operation
-ddor251 or 7000000000000000 1000000000000000 -> NaN Invalid_operation
-ddor252 or 8000000000000000 1000000000000000 -> NaN Invalid_operation
-ddor253 or 9000000000000000 1000000000000000 -> NaN Invalid_operation
-ddor254 or 2000000000000000 0000000000000000 -> NaN Invalid_operation
-ddor255 or 7000000000000000 0000000000000000 -> NaN Invalid_operation
-ddor256 or 8000000000000000 0000000000000000 -> NaN Invalid_operation
-ddor257 or 9000000000000000 0000000000000000 -> NaN Invalid_operation
-ddor258 or 1000000000000000 2000000000000000 -> NaN Invalid_operation
-ddor259 or 1000000000000000 7000000000000000 -> NaN Invalid_operation
-ddor260 or 1000000000000000 8000000000000000 -> NaN Invalid_operation
-ddor261 or 1000000000000000 9000000000000000 -> NaN Invalid_operation
-ddor262 or 0000000000000000 2000000000000000 -> NaN Invalid_operation
-ddor263 or 0000000000000000 7000000000000000 -> NaN Invalid_operation
-ddor264 or 0000000000000000 8000000000000000 -> NaN Invalid_operation
-ddor265 or 0000000000000000 9000000000000000 -> NaN Invalid_operation
--- test MSD-1
-ddor270 or 0200001000000000 1000100000000010 -> NaN Invalid_operation
-ddor271 or 0700000100000000 1000010000000100 -> NaN Invalid_operation
-ddor272 or 0800000010000000 1000001000001000 -> NaN Invalid_operation
-ddor273 or 0900000001000000 1000000100010000 -> NaN Invalid_operation
-ddor274 or 1000000000100000 0200000010100000 -> NaN Invalid_operation
-ddor275 or 1000000000010000 0700000001000000 -> NaN Invalid_operation
-ddor276 or 1000000000001000 0800000010100000 -> NaN Invalid_operation
-ddor277 or 1000000000000100 0900000000010000 -> NaN Invalid_operation
--- test LSD
-ddor280 or 0010000000000002 1000000100000001 -> NaN Invalid_operation
-ddor281 or 0001000000000007 1000001000000011 -> NaN Invalid_operation
-ddor282 or 0000100000000008 1000010000000001 -> NaN Invalid_operation
-ddor283 or 0000010000000009 1000100000000001 -> NaN Invalid_operation
-ddor284 or 1000001000000000 0001000000000002 -> NaN Invalid_operation
-ddor285 or 1000000100000000 0010000000000007 -> NaN Invalid_operation
-ddor286 or 1000000010000000 0100000000000008 -> NaN Invalid_operation
-ddor287 or 1000000001000000 1000000000000009 -> NaN Invalid_operation
--- test Middie
-ddor288 or 0010000020000000 1000001000000000 -> NaN Invalid_operation
-ddor289 or 0001000070000001 1000000100000000 -> NaN Invalid_operation
-ddor290 or 0000100080000010 1000000010000000 -> NaN Invalid_operation
-ddor291 or 0000010090000100 1000000001000000 -> NaN Invalid_operation
-ddor292 or 1000001000001000 0000000020100000 -> NaN Invalid_operation
-ddor293 or 1000000100010000 0000000070010000 -> NaN Invalid_operation
-ddor294 or 1000000010100000 0000000080001000 -> NaN Invalid_operation
-ddor295 or 1000000001000000 0000000090000100 -> NaN Invalid_operation
--- signs
-ddor296 or -1000000001000000 -0000010000000100 -> NaN Invalid_operation
-ddor297 or -1000000001000000 0000000010000100 -> NaN Invalid_operation
-ddor298 or 1000000001000000 -0000001000000100 -> NaN Invalid_operation
-ddor299 or 1000000001000000 0000000011000100 -> 1000000011000100
-
--- Nmax, Nmin, Ntiny-like
-ddor331 or 2 9.99999999E+199 -> NaN Invalid_operation
-ddor332 or 3 1E-199 -> NaN Invalid_operation
-ddor333 or 4 1.00000000E-199 -> NaN Invalid_operation
-ddor334 or 5 1E-100 -> NaN Invalid_operation
-ddor335 or 6 -1E-100 -> NaN Invalid_operation
-ddor336 or 7 -1.00000000E-199 -> NaN Invalid_operation
-ddor337 or 8 -1E-199 -> NaN Invalid_operation
-ddor338 or 9 -9.99999999E+199 -> NaN Invalid_operation
-ddor341 or 9.99999999E+299 -18 -> NaN Invalid_operation
-ddor342 or 1E-299 01 -> NaN Invalid_operation
-ddor343 or 1.00000000E-299 -18 -> NaN Invalid_operation
-ddor344 or 1E-100 18 -> NaN Invalid_operation
-ddor345 or -1E-100 -10 -> NaN Invalid_operation
-ddor346 or -1.00000000E-299 18 -> NaN Invalid_operation
-ddor347 or -1E-299 10 -> NaN Invalid_operation
-ddor348 or -9.99999999E+299 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-ddor361 or 1.0 1 -> NaN Invalid_operation
-ddor362 or 1E+1 1 -> NaN Invalid_operation
-ddor363 or 0.0 1 -> NaN Invalid_operation
-ddor364 or 0E+1 1 -> NaN Invalid_operation
-ddor365 or 9.9 1 -> NaN Invalid_operation
-ddor366 or 9E+1 1 -> NaN Invalid_operation
-ddor371 or 0 1.0 -> NaN Invalid_operation
-ddor372 or 0 1E+1 -> NaN Invalid_operation
-ddor373 or 0 0.0 -> NaN Invalid_operation
-ddor374 or 0 0E+1 -> NaN Invalid_operation
-ddor375 or 0 9.9 -> NaN Invalid_operation
-ddor376 or 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-ddor780 or -Inf -Inf -> NaN Invalid_operation
-ddor781 or -Inf -1000 -> NaN Invalid_operation
-ddor782 or -Inf -1 -> NaN Invalid_operation
-ddor783 or -Inf -0 -> NaN Invalid_operation
-ddor784 or -Inf 0 -> NaN Invalid_operation
-ddor785 or -Inf 1 -> NaN Invalid_operation
-ddor786 or -Inf 1000 -> NaN Invalid_operation
-ddor787 or -1000 -Inf -> NaN Invalid_operation
-ddor788 or -Inf -Inf -> NaN Invalid_operation
-ddor789 or -1 -Inf -> NaN Invalid_operation
-ddor790 or -0 -Inf -> NaN Invalid_operation
-ddor791 or 0 -Inf -> NaN Invalid_operation
-ddor792 or 1 -Inf -> NaN Invalid_operation
-ddor793 or 1000 -Inf -> NaN Invalid_operation
-ddor794 or Inf -Inf -> NaN Invalid_operation
-
-ddor800 or Inf -Inf -> NaN Invalid_operation
-ddor801 or Inf -1000 -> NaN Invalid_operation
-ddor802 or Inf -1 -> NaN Invalid_operation
-ddor803 or Inf -0 -> NaN Invalid_operation
-ddor804 or Inf 0 -> NaN Invalid_operation
-ddor805 or Inf 1 -> NaN Invalid_operation
-ddor806 or Inf 1000 -> NaN Invalid_operation
-ddor807 or Inf Inf -> NaN Invalid_operation
-ddor808 or -1000 Inf -> NaN Invalid_operation
-ddor809 or -Inf Inf -> NaN Invalid_operation
-ddor810 or -1 Inf -> NaN Invalid_operation
-ddor811 or -0 Inf -> NaN Invalid_operation
-ddor812 or 0 Inf -> NaN Invalid_operation
-ddor813 or 1 Inf -> NaN Invalid_operation
-ddor814 or 1000 Inf -> NaN Invalid_operation
-ddor815 or Inf Inf -> NaN Invalid_operation
-
-ddor821 or NaN -Inf -> NaN Invalid_operation
-ddor822 or NaN -1000 -> NaN Invalid_operation
-ddor823 or NaN -1 -> NaN Invalid_operation
-ddor824 or NaN -0 -> NaN Invalid_operation
-ddor825 or NaN 0 -> NaN Invalid_operation
-ddor826 or NaN 1 -> NaN Invalid_operation
-ddor827 or NaN 1000 -> NaN Invalid_operation
-ddor828 or NaN Inf -> NaN Invalid_operation
-ddor829 or NaN NaN -> NaN Invalid_operation
-ddor830 or -Inf NaN -> NaN Invalid_operation
-ddor831 or -1000 NaN -> NaN Invalid_operation
-ddor832 or -1 NaN -> NaN Invalid_operation
-ddor833 or -0 NaN -> NaN Invalid_operation
-ddor834 or 0 NaN -> NaN Invalid_operation
-ddor835 or 1 NaN -> NaN Invalid_operation
-ddor836 or 1000 NaN -> NaN Invalid_operation
-ddor837 or Inf NaN -> NaN Invalid_operation
-
-ddor841 or sNaN -Inf -> NaN Invalid_operation
-ddor842 or sNaN -1000 -> NaN Invalid_operation
-ddor843 or sNaN -1 -> NaN Invalid_operation
-ddor844 or sNaN -0 -> NaN Invalid_operation
-ddor845 or sNaN 0 -> NaN Invalid_operation
-ddor846 or sNaN 1 -> NaN Invalid_operation
-ddor847 or sNaN 1000 -> NaN Invalid_operation
-ddor848 or sNaN NaN -> NaN Invalid_operation
-ddor849 or sNaN sNaN -> NaN Invalid_operation
-ddor850 or NaN sNaN -> NaN Invalid_operation
-ddor851 or -Inf sNaN -> NaN Invalid_operation
-ddor852 or -1000 sNaN -> NaN Invalid_operation
-ddor853 or -1 sNaN -> NaN Invalid_operation
-ddor854 or -0 sNaN -> NaN Invalid_operation
-ddor855 or 0 sNaN -> NaN Invalid_operation
-ddor856 or 1 sNaN -> NaN Invalid_operation
-ddor857 or 1000 sNaN -> NaN Invalid_operation
-ddor858 or Inf sNaN -> NaN Invalid_operation
-ddor859 or NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddor861 or NaN1 -Inf -> NaN Invalid_operation
-ddor862 or +NaN2 -1000 -> NaN Invalid_operation
-ddor863 or NaN3 1000 -> NaN Invalid_operation
-ddor864 or NaN4 Inf -> NaN Invalid_operation
-ddor865 or NaN5 +NaN6 -> NaN Invalid_operation
-ddor866 or -Inf NaN7 -> NaN Invalid_operation
-ddor867 or -1000 NaN8 -> NaN Invalid_operation
-ddor868 or 1000 NaN9 -> NaN Invalid_operation
-ddor869 or Inf +NaN10 -> NaN Invalid_operation
-ddor871 or sNaN11 -Inf -> NaN Invalid_operation
-ddor872 or sNaN12 -1000 -> NaN Invalid_operation
-ddor873 or sNaN13 1000 -> NaN Invalid_operation
-ddor874 or sNaN14 NaN17 -> NaN Invalid_operation
-ddor875 or sNaN15 sNaN18 -> NaN Invalid_operation
-ddor876 or NaN16 sNaN19 -> NaN Invalid_operation
-ddor877 or -Inf +sNaN20 -> NaN Invalid_operation
-ddor878 or -1000 sNaN21 -> NaN Invalid_operation
-ddor879 or 1000 sNaN22 -> NaN Invalid_operation
-ddor880 or Inf sNaN23 -> NaN Invalid_operation
-ddor881 or +NaN25 +sNaN24 -> NaN Invalid_operation
-ddor882 or -NaN26 NaN28 -> NaN Invalid_operation
-ddor883 or -sNaN27 sNaN29 -> NaN Invalid_operation
-ddor884 or 1000 -NaN30 -> NaN Invalid_operation
-ddor885 or 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddOr.decTest -- digitwise logical OR for decDoubles --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check (truth table)
+ddor001 or 0 0 -> 0
+ddor002 or 0 1 -> 1
+ddor003 or 1 0 -> 1
+ddor004 or 1 1 -> 1
+ddor005 or 1100 1010 -> 1110
+-- and at msd and msd-1
+ddor006 or 0000000000000000 0000000000000000 -> 0
+ddor007 or 0000000000000000 1000000000000000 -> 1000000000000000
+ddor008 or 1000000000000000 0000000000000000 -> 1000000000000000
+ddor009 or 1000000000000000 1000000000000000 -> 1000000000000000
+ddor010 or 0000000000000000 0000000000000000 -> 0
+ddor011 or 0000000000000000 0100000000000000 -> 100000000000000
+ddor012 or 0100000000000000 0000000000000000 -> 100000000000000
+ddor013 or 0100000000000000 0100000000000000 -> 100000000000000
+
+-- Various lengths
+-- 1234567890123456 1234567890123456 1234567890123456
+ddor020 or 1111111111111111 1111111111111111 -> 1111111111111111
+ddor021 or 111111111111111 111111111111111 -> 111111111111111
+ddor022 or 11111111111111 11111111111111 -> 11111111111111
+ddor023 or 1111111111111 1111111111111 -> 1111111111111
+ddor024 or 111111111111 111111111111 -> 111111111111
+ddor025 or 11111111111 11111111111 -> 11111111111
+ddor026 or 1111111111 1111111111 -> 1111111111
+ddor027 or 111111111 111111111 -> 111111111
+ddor028 or 11111111 11111111 -> 11111111
+ddor029 or 1111111 1111111 -> 1111111
+ddor030 or 111111 111111 -> 111111
+ddor031 or 11111 11111 -> 11111
+ddor032 or 1111 1111 -> 1111
+ddor033 or 111 111 -> 111
+ddor034 or 11 11 -> 11
+ddor035 or 1 1 -> 1
+ddor036 or 0 0 -> 0
+
+ddor042 or 111111110000000 1111111110000000 -> 1111111110000000
+ddor043 or 11111110000000 1000000100000000 -> 1011111110000000
+ddor044 or 1111110000000 1000001000000000 -> 1001111110000000
+ddor045 or 111110000000 1000010000000000 -> 1000111110000000
+ddor046 or 11110000000 1000100000000000 -> 1000111110000000
+ddor047 or 1110000000 1001000000000000 -> 1001001110000000
+ddor048 or 110000000 1010000000000000 -> 1010000110000000
+ddor049 or 10000000 1100000000000000 -> 1100000010000000
+
+ddor090 or 011111111 111101111 -> 111111111
+ddor091 or 101111111 111101111 -> 111111111
+ddor092 or 110111111 111101111 -> 111111111
+ddor093 or 111011111 111101111 -> 111111111
+ddor094 or 111101111 111101111 -> 111101111
+ddor095 or 111110111 111101111 -> 111111111
+ddor096 or 111111011 111101111 -> 111111111
+ddor097 or 111111101 111101111 -> 111111111
+ddor098 or 111111110 111101111 -> 111111111
+
+ddor100 or 111101111 011111111 -> 111111111
+ddor101 or 111101111 101111111 -> 111111111
+ddor102 or 111101111 110111111 -> 111111111
+ddor103 or 111101111 111011111 -> 111111111
+ddor104 or 111101111 111101111 -> 111101111
+ddor105 or 111101111 111110111 -> 111111111
+ddor106 or 111101111 111111011 -> 111111111
+ddor107 or 111101111 111111101 -> 111111111
+ddor108 or 111101111 111111110 -> 111111111
+
+-- non-0/1 should not be accepted, nor should signs
+ddor220 or 111111112 111111111 -> NaN Invalid_operation
+ddor221 or 333333333 333333333 -> NaN Invalid_operation
+ddor222 or 555555555 555555555 -> NaN Invalid_operation
+ddor223 or 777777777 777777777 -> NaN Invalid_operation
+ddor224 or 999999999 999999999 -> NaN Invalid_operation
+ddor225 or 222222222 999999999 -> NaN Invalid_operation
+ddor226 or 444444444 999999999 -> NaN Invalid_operation
+ddor227 or 666666666 999999999 -> NaN Invalid_operation
+ddor228 or 888888888 999999999 -> NaN Invalid_operation
+ddor229 or 999999999 222222222 -> NaN Invalid_operation
+ddor230 or 999999999 444444444 -> NaN Invalid_operation
+ddor231 or 999999999 666666666 -> NaN Invalid_operation
+ddor232 or 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+ddor240 or 567468689 -934981942 -> NaN Invalid_operation
+ddor241 or 567367689 934981942 -> NaN Invalid_operation
+ddor242 or -631917772 -706014634 -> NaN Invalid_operation
+ddor243 or -756253257 138579234 -> NaN Invalid_operation
+ddor244 or 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+ddor250 or 2000000000000000 1000000000000000 -> NaN Invalid_operation
+ddor251 or 7000000000000000 1000000000000000 -> NaN Invalid_operation
+ddor252 or 8000000000000000 1000000000000000 -> NaN Invalid_operation
+ddor253 or 9000000000000000 1000000000000000 -> NaN Invalid_operation
+ddor254 or 2000000000000000 0000000000000000 -> NaN Invalid_operation
+ddor255 or 7000000000000000 0000000000000000 -> NaN Invalid_operation
+ddor256 or 8000000000000000 0000000000000000 -> NaN Invalid_operation
+ddor257 or 9000000000000000 0000000000000000 -> NaN Invalid_operation
+ddor258 or 1000000000000000 2000000000000000 -> NaN Invalid_operation
+ddor259 or 1000000000000000 7000000000000000 -> NaN Invalid_operation
+ddor260 or 1000000000000000 8000000000000000 -> NaN Invalid_operation
+ddor261 or 1000000000000000 9000000000000000 -> NaN Invalid_operation
+ddor262 or 0000000000000000 2000000000000000 -> NaN Invalid_operation
+ddor263 or 0000000000000000 7000000000000000 -> NaN Invalid_operation
+ddor264 or 0000000000000000 8000000000000000 -> NaN Invalid_operation
+ddor265 or 0000000000000000 9000000000000000 -> NaN Invalid_operation
+-- test MSD-1
+ddor270 or 0200001000000000 1000100000000010 -> NaN Invalid_operation
+ddor271 or 0700000100000000 1000010000000100 -> NaN Invalid_operation
+ddor272 or 0800000010000000 1000001000001000 -> NaN Invalid_operation
+ddor273 or 0900000001000000 1000000100010000 -> NaN Invalid_operation
+ddor274 or 1000000000100000 0200000010100000 -> NaN Invalid_operation
+ddor275 or 1000000000010000 0700000001000000 -> NaN Invalid_operation
+ddor276 or 1000000000001000 0800000010100000 -> NaN Invalid_operation
+ddor277 or 1000000000000100 0900000000010000 -> NaN Invalid_operation
+-- test LSD
+ddor280 or 0010000000000002 1000000100000001 -> NaN Invalid_operation
+ddor281 or 0001000000000007 1000001000000011 -> NaN Invalid_operation
+ddor282 or 0000100000000008 1000010000000001 -> NaN Invalid_operation
+ddor283 or 0000010000000009 1000100000000001 -> NaN Invalid_operation
+ddor284 or 1000001000000000 0001000000000002 -> NaN Invalid_operation
+ddor285 or 1000000100000000 0010000000000007 -> NaN Invalid_operation
+ddor286 or 1000000010000000 0100000000000008 -> NaN Invalid_operation
+ddor287 or 1000000001000000 1000000000000009 -> NaN Invalid_operation
+-- test Middie
+ddor288 or 0010000020000000 1000001000000000 -> NaN Invalid_operation
+ddor289 or 0001000070000001 1000000100000000 -> NaN Invalid_operation
+ddor290 or 0000100080000010 1000000010000000 -> NaN Invalid_operation
+ddor291 or 0000010090000100 1000000001000000 -> NaN Invalid_operation
+ddor292 or 1000001000001000 0000000020100000 -> NaN Invalid_operation
+ddor293 or 1000000100010000 0000000070010000 -> NaN Invalid_operation
+ddor294 or 1000000010100000 0000000080001000 -> NaN Invalid_operation
+ddor295 or 1000000001000000 0000000090000100 -> NaN Invalid_operation
+-- signs
+ddor296 or -1000000001000000 -0000010000000100 -> NaN Invalid_operation
+ddor297 or -1000000001000000 0000000010000100 -> NaN Invalid_operation
+ddor298 or 1000000001000000 -0000001000000100 -> NaN Invalid_operation
+ddor299 or 1000000001000000 0000000011000100 -> 1000000011000100
+
+-- Nmax, Nmin, Ntiny-like
+ddor331 or 2 9.99999999E+199 -> NaN Invalid_operation
+ddor332 or 3 1E-199 -> NaN Invalid_operation
+ddor333 or 4 1.00000000E-199 -> NaN Invalid_operation
+ddor334 or 5 1E-100 -> NaN Invalid_operation
+ddor335 or 6 -1E-100 -> NaN Invalid_operation
+ddor336 or 7 -1.00000000E-199 -> NaN Invalid_operation
+ddor337 or 8 -1E-199 -> NaN Invalid_operation
+ddor338 or 9 -9.99999999E+199 -> NaN Invalid_operation
+ddor341 or 9.99999999E+299 -18 -> NaN Invalid_operation
+ddor342 or 1E-299 01 -> NaN Invalid_operation
+ddor343 or 1.00000000E-299 -18 -> NaN Invalid_operation
+ddor344 or 1E-100 18 -> NaN Invalid_operation
+ddor345 or -1E-100 -10 -> NaN Invalid_operation
+ddor346 or -1.00000000E-299 18 -> NaN Invalid_operation
+ddor347 or -1E-299 10 -> NaN Invalid_operation
+ddor348 or -9.99999999E+299 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+ddor361 or 1.0 1 -> NaN Invalid_operation
+ddor362 or 1E+1 1 -> NaN Invalid_operation
+ddor363 or 0.0 1 -> NaN Invalid_operation
+ddor364 or 0E+1 1 -> NaN Invalid_operation
+ddor365 or 9.9 1 -> NaN Invalid_operation
+ddor366 or 9E+1 1 -> NaN Invalid_operation
+ddor371 or 0 1.0 -> NaN Invalid_operation
+ddor372 or 0 1E+1 -> NaN Invalid_operation
+ddor373 or 0 0.0 -> NaN Invalid_operation
+ddor374 or 0 0E+1 -> NaN Invalid_operation
+ddor375 or 0 9.9 -> NaN Invalid_operation
+ddor376 or 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+ddor780 or -Inf -Inf -> NaN Invalid_operation
+ddor781 or -Inf -1000 -> NaN Invalid_operation
+ddor782 or -Inf -1 -> NaN Invalid_operation
+ddor783 or -Inf -0 -> NaN Invalid_operation
+ddor784 or -Inf 0 -> NaN Invalid_operation
+ddor785 or -Inf 1 -> NaN Invalid_operation
+ddor786 or -Inf 1000 -> NaN Invalid_operation
+ddor787 or -1000 -Inf -> NaN Invalid_operation
+ddor788 or -Inf -Inf -> NaN Invalid_operation
+ddor789 or -1 -Inf -> NaN Invalid_operation
+ddor790 or -0 -Inf -> NaN Invalid_operation
+ddor791 or 0 -Inf -> NaN Invalid_operation
+ddor792 or 1 -Inf -> NaN Invalid_operation
+ddor793 or 1000 -Inf -> NaN Invalid_operation
+ddor794 or Inf -Inf -> NaN Invalid_operation
+
+ddor800 or Inf -Inf -> NaN Invalid_operation
+ddor801 or Inf -1000 -> NaN Invalid_operation
+ddor802 or Inf -1 -> NaN Invalid_operation
+ddor803 or Inf -0 -> NaN Invalid_operation
+ddor804 or Inf 0 -> NaN Invalid_operation
+ddor805 or Inf 1 -> NaN Invalid_operation
+ddor806 or Inf 1000 -> NaN Invalid_operation
+ddor807 or Inf Inf -> NaN Invalid_operation
+ddor808 or -1000 Inf -> NaN Invalid_operation
+ddor809 or -Inf Inf -> NaN Invalid_operation
+ddor810 or -1 Inf -> NaN Invalid_operation
+ddor811 or -0 Inf -> NaN Invalid_operation
+ddor812 or 0 Inf -> NaN Invalid_operation
+ddor813 or 1 Inf -> NaN Invalid_operation
+ddor814 or 1000 Inf -> NaN Invalid_operation
+ddor815 or Inf Inf -> NaN Invalid_operation
+
+ddor821 or NaN -Inf -> NaN Invalid_operation
+ddor822 or NaN -1000 -> NaN Invalid_operation
+ddor823 or NaN -1 -> NaN Invalid_operation
+ddor824 or NaN -0 -> NaN Invalid_operation
+ddor825 or NaN 0 -> NaN Invalid_operation
+ddor826 or NaN 1 -> NaN Invalid_operation
+ddor827 or NaN 1000 -> NaN Invalid_operation
+ddor828 or NaN Inf -> NaN Invalid_operation
+ddor829 or NaN NaN -> NaN Invalid_operation
+ddor830 or -Inf NaN -> NaN Invalid_operation
+ddor831 or -1000 NaN -> NaN Invalid_operation
+ddor832 or -1 NaN -> NaN Invalid_operation
+ddor833 or -0 NaN -> NaN Invalid_operation
+ddor834 or 0 NaN -> NaN Invalid_operation
+ddor835 or 1 NaN -> NaN Invalid_operation
+ddor836 or 1000 NaN -> NaN Invalid_operation
+ddor837 or Inf NaN -> NaN Invalid_operation
+
+ddor841 or sNaN -Inf -> NaN Invalid_operation
+ddor842 or sNaN -1000 -> NaN Invalid_operation
+ddor843 or sNaN -1 -> NaN Invalid_operation
+ddor844 or sNaN -0 -> NaN Invalid_operation
+ddor845 or sNaN 0 -> NaN Invalid_operation
+ddor846 or sNaN 1 -> NaN Invalid_operation
+ddor847 or sNaN 1000 -> NaN Invalid_operation
+ddor848 or sNaN NaN -> NaN Invalid_operation
+ddor849 or sNaN sNaN -> NaN Invalid_operation
+ddor850 or NaN sNaN -> NaN Invalid_operation
+ddor851 or -Inf sNaN -> NaN Invalid_operation
+ddor852 or -1000 sNaN -> NaN Invalid_operation
+ddor853 or -1 sNaN -> NaN Invalid_operation
+ddor854 or -0 sNaN -> NaN Invalid_operation
+ddor855 or 0 sNaN -> NaN Invalid_operation
+ddor856 or 1 sNaN -> NaN Invalid_operation
+ddor857 or 1000 sNaN -> NaN Invalid_operation
+ddor858 or Inf sNaN -> NaN Invalid_operation
+ddor859 or NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddor861 or NaN1 -Inf -> NaN Invalid_operation
+ddor862 or +NaN2 -1000 -> NaN Invalid_operation
+ddor863 or NaN3 1000 -> NaN Invalid_operation
+ddor864 or NaN4 Inf -> NaN Invalid_operation
+ddor865 or NaN5 +NaN6 -> NaN Invalid_operation
+ddor866 or -Inf NaN7 -> NaN Invalid_operation
+ddor867 or -1000 NaN8 -> NaN Invalid_operation
+ddor868 or 1000 NaN9 -> NaN Invalid_operation
+ddor869 or Inf +NaN10 -> NaN Invalid_operation
+ddor871 or sNaN11 -Inf -> NaN Invalid_operation
+ddor872 or sNaN12 -1000 -> NaN Invalid_operation
+ddor873 or sNaN13 1000 -> NaN Invalid_operation
+ddor874 or sNaN14 NaN17 -> NaN Invalid_operation
+ddor875 or sNaN15 sNaN18 -> NaN Invalid_operation
+ddor876 or NaN16 sNaN19 -> NaN Invalid_operation
+ddor877 or -Inf +sNaN20 -> NaN Invalid_operation
+ddor878 or -1000 sNaN21 -> NaN Invalid_operation
+ddor879 or 1000 sNaN22 -> NaN Invalid_operation
+ddor880 or Inf sNaN23 -> NaN Invalid_operation
+ddor881 or +NaN25 +sNaN24 -> NaN Invalid_operation
+ddor882 or -NaN26 NaN28 -> NaN Invalid_operation
+ddor883 or -sNaN27 sNaN29 -> NaN Invalid_operation
+ddor884 or 1000 -NaN30 -> NaN Invalid_operation
+ddor885 or 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddPlus.decTest b/Lib/test/decimaltestdata/ddPlus.decTest
index 17aa08af9f..5191239bf7 100644
--- a/Lib/test/decimaltestdata/ddPlus.decTest
+++ b/Lib/test/decimaltestdata/ddPlus.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddPlus.decTest -- decDouble 0+x --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddpls001 plus +7.50 -> 7.50
-
--- Infinities
-ddpls011 plus Infinity -> Infinity
-ddpls012 plus -Infinity -> -Infinity
-
--- NaNs, 0 payload
-ddpls021 plus NaN -> NaN
-ddpls022 plus -NaN -> -NaN
-ddpls023 plus sNaN -> NaN Invalid_operation
-ddpls024 plus -sNaN -> -NaN Invalid_operation
-
--- NaNs, non-0 payload
-ddpls031 plus NaN13 -> NaN13
-ddpls032 plus -NaN13 -> -NaN13
-ddpls033 plus sNaN13 -> NaN13 Invalid_operation
-ddpls034 plus -sNaN13 -> -NaN13 Invalid_operation
-ddpls035 plus NaN70 -> NaN70
-ddpls036 plus -NaN70 -> -NaN70
-ddpls037 plus sNaN101 -> NaN101 Invalid_operation
-ddpls038 plus -sNaN101 -> -NaN101 Invalid_operation
-
--- finites
-ddpls101 plus 7 -> 7
-ddpls102 plus -7 -> -7
-ddpls103 plus 75 -> 75
-ddpls104 plus -75 -> -75
-ddpls105 plus 7.50 -> 7.50
-ddpls106 plus -7.50 -> -7.50
-ddpls107 plus 7.500 -> 7.500
-ddpls108 plus -7.500 -> -7.500
-
--- zeros
-ddpls111 plus 0 -> 0
-ddpls112 plus -0 -> 0
-ddpls113 plus 0E+4 -> 0E+4
-ddpls114 plus -0E+4 -> 0E+4
-ddpls115 plus 0.0000 -> 0.0000
-ddpls116 plus -0.0000 -> 0.0000
-ddpls117 plus 0E-141 -> 0E-141
-ddpls118 plus -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddpls121 plus 2682682682682682 -> 2682682682682682
-ddpls122 plus -2682682682682682 -> -2682682682682682
-ddpls123 plus 1341341341341341 -> 1341341341341341
-ddpls124 plus -1341341341341341 -> -1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddpls131 plus 9.999999999999999E+384 -> 9.999999999999999E+384
-ddpls132 plus 1E-383 -> 1E-383
-ddpls133 plus 1.000000000000000E-383 -> 1.000000000000000E-383
-ddpls134 plus 1E-398 -> 1E-398 Subnormal
-
-ddpls135 plus -1E-398 -> -1E-398 Subnormal
-ddpls136 plus -1.000000000000000E-383 -> -1.000000000000000E-383
-ddpls137 plus -1E-383 -> -1E-383
-ddpls138 plus -9.999999999999999E+384 -> -9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddPlus.decTest -- decDouble 0+x --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddpls001 plus +7.50 -> 7.50
+
+-- Infinities
+ddpls011 plus Infinity -> Infinity
+ddpls012 plus -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+ddpls021 plus NaN -> NaN
+ddpls022 plus -NaN -> -NaN
+ddpls023 plus sNaN -> NaN Invalid_operation
+ddpls024 plus -sNaN -> -NaN Invalid_operation
+
+-- NaNs, non-0 payload
+ddpls031 plus NaN13 -> NaN13
+ddpls032 plus -NaN13 -> -NaN13
+ddpls033 plus sNaN13 -> NaN13 Invalid_operation
+ddpls034 plus -sNaN13 -> -NaN13 Invalid_operation
+ddpls035 plus NaN70 -> NaN70
+ddpls036 plus -NaN70 -> -NaN70
+ddpls037 plus sNaN101 -> NaN101 Invalid_operation
+ddpls038 plus -sNaN101 -> -NaN101 Invalid_operation
+
+-- finites
+ddpls101 plus 7 -> 7
+ddpls102 plus -7 -> -7
+ddpls103 plus 75 -> 75
+ddpls104 plus -75 -> -75
+ddpls105 plus 7.50 -> 7.50
+ddpls106 plus -7.50 -> -7.50
+ddpls107 plus 7.500 -> 7.500
+ddpls108 plus -7.500 -> -7.500
+
+-- zeros
+ddpls111 plus 0 -> 0
+ddpls112 plus -0 -> 0
+ddpls113 plus 0E+4 -> 0E+4
+ddpls114 plus -0E+4 -> 0E+4
+ddpls115 plus 0.0000 -> 0.0000
+ddpls116 plus -0.0000 -> 0.0000
+ddpls117 plus 0E-141 -> 0E-141
+ddpls118 plus -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddpls121 plus 2682682682682682 -> 2682682682682682
+ddpls122 plus -2682682682682682 -> -2682682682682682
+ddpls123 plus 1341341341341341 -> 1341341341341341
+ddpls124 plus -1341341341341341 -> -1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddpls131 plus 9.999999999999999E+384 -> 9.999999999999999E+384
+ddpls132 plus 1E-383 -> 1E-383
+ddpls133 plus 1.000000000000000E-383 -> 1.000000000000000E-383
+ddpls134 plus 1E-398 -> 1E-398 Subnormal
+
+ddpls135 plus -1E-398 -> -1E-398 Subnormal
+ddpls136 plus -1.000000000000000E-383 -> -1.000000000000000E-383
+ddpls137 plus -1E-383 -> -1E-383
+ddpls138 plus -9.999999999999999E+384 -> -9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddQuantize.decTest b/Lib/test/decimaltestdata/ddQuantize.decTest
index 0d19c9dcec..9177620169 100644
--- a/Lib/test/decimaltestdata/ddQuantize.decTest
+++ b/Lib/test/decimaltestdata/ddQuantize.decTest
@@ -1,833 +1,833 @@
-------------------------------------------------------------------------
--- ddQuantize.decTest -- decDouble quantize operation --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Most of the tests here assume a "regular pattern", where the
--- sign and coefficient are +1.
--- 2004.03.15 Underflow for quantize is suppressed
--- 2005.06.08 More extensive tests for 'does not fit'
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddqua001 quantize 0 1e0 -> 0
-ddqua002 quantize 1 1e0 -> 1
-ddqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
-ddqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
-ddqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
-ddqua007 quantize 0.1 1e-1 -> 0.1
-ddqua008 quantize 0.1 1e-2 -> 0.10
-ddqua009 quantize 0.1 1e-3 -> 0.100
-ddqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
-ddqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
-ddqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
-ddqua013 quantize 0.9 1e-1 -> 0.9
-ddqua014 quantize 0.9 1e-2 -> 0.90
-ddqua015 quantize 0.9 1e-3 -> 0.900
--- negatives
-ddqua021 quantize -0 1e0 -> -0
-ddqua022 quantize -1 1e0 -> -1
-ddqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
-ddqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
-ddqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
-ddqua027 quantize -0.1 1e-1 -> -0.1
-ddqua028 quantize -0.1 1e-2 -> -0.10
-ddqua029 quantize -0.1 1e-3 -> -0.100
-ddqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
-ddqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
-ddqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
-ddqua033 quantize -0.9 1e-1 -> -0.9
-ddqua034 quantize -0.9 1e-2 -> -0.90
-ddqua035 quantize -0.9 1e-3 -> -0.900
-ddqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
-ddqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
-ddqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
-ddqua039 quantize -0.5 1e-1 -> -0.5
-ddqua040 quantize -0.5 1e-2 -> -0.50
-ddqua041 quantize -0.5 1e-3 -> -0.500
-ddqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
-ddqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
-ddqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
-ddqua045 quantize -0.9 1e-1 -> -0.9
-ddqua046 quantize -0.9 1e-2 -> -0.90
-ddqua047 quantize -0.9 1e-3 -> -0.900
-
--- examples from Specification
-ddqua060 quantize 2.17 0.001 -> 2.170
-ddqua061 quantize 2.17 0.01 -> 2.17
-ddqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
-ddqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
-ddqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
-ddqua065 quantize -Inf Inf -> -Infinity
-ddqua066 quantize 2 Inf -> NaN Invalid_operation
-ddqua067 quantize -0.1 1 -> -0 Inexact Rounded
-ddqua068 quantize -0 1e+5 -> -0E+5
-ddqua069 quantize +123456789012345.6 1e-2 -> NaN Invalid_operation
-ddqua070 quantize -987654335236450.6 1e-2 -> NaN Invalid_operation
-ddqua071 quantize 217 1e-1 -> 217.0
-ddqua072 quantize 217 1e+0 -> 217
-ddqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
-ddqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
-
--- general tests ..
-ddqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
-ddqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
-ddqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
-ddqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
-ddqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
-ddqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
-ddqua095 quantize 1.2345 1e-6 -> 1.234500
-ddqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
-ddqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
-ddqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
-ddqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
-ddqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
-
-ddqua101 quantize -1 1e0 -> -1
-ddqua102 quantize -1 1e-1 -> -1.0
-ddqua103 quantize -1 1e-2 -> -1.00
-ddqua104 quantize 0 1e0 -> 0
-ddqua105 quantize 0 1e-1 -> 0.0
-ddqua106 quantize 0 1e-2 -> 0.00
-ddqua107 quantize 0.00 1e0 -> 0
-ddqua108 quantize 0 1e+1 -> 0E+1
-ddqua109 quantize 0 1e+2 -> 0E+2
-ddqua110 quantize +1 1e0 -> 1
-ddqua111 quantize +1 1e-1 -> 1.0
-ddqua112 quantize +1 1e-2 -> 1.00
-
-ddqua120 quantize 1.04 1e-3 -> 1.040
-ddqua121 quantize 1.04 1e-2 -> 1.04
-ddqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
-ddqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
-ddqua124 quantize 1.05 1e-3 -> 1.050
-ddqua125 quantize 1.05 1e-2 -> 1.05
-ddqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
-ddqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
-ddqua132 quantize 1.06 1e-3 -> 1.060
-ddqua133 quantize 1.06 1e-2 -> 1.06
-ddqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
-ddqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
-
-ddqua140 quantize -10 1e-2 -> -10.00
-ddqua141 quantize +1 1e-2 -> 1.00
-ddqua142 quantize +10 1e-2 -> 10.00
-ddqua143 quantize 1E+17 1e-2 -> NaN Invalid_operation
-ddqua144 quantize 1E-17 1e-2 -> 0.00 Inexact Rounded
-ddqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
-ddqua146 quantize 1E-2 1e-2 -> 0.01
-ddqua147 quantize 1E-1 1e-2 -> 0.10
-ddqua148 quantize 0E-17 1e-2 -> 0.00
-
-ddqua150 quantize 1.0600 1e-5 -> 1.06000
-ddqua151 quantize 1.0600 1e-4 -> 1.0600
-ddqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
-ddqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
-ddqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
-ddqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
-
--- a couple where rounding was different in base tests
-rounding: half_up
-ddqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
-ddqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
-ddqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
-rounding: half_even
-
--- base tests with non-1 coefficients
-ddqua161 quantize 0 -9e0 -> 0
-ddqua162 quantize 1 -7e0 -> 1
-ddqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
-ddqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
-ddqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
-ddqua167 quantize 0.1 3e-1 -> 0.1
-ddqua168 quantize 0.1 44e-2 -> 0.10
-ddqua169 quantize 0.1 555e-3 -> 0.100
-ddqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
-ddqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
-ddqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
-ddqua173 quantize 0.9 -9e-1 -> 0.9
-ddqua174 quantize 0.9 0e-2 -> 0.90
-ddqua175 quantize 0.9 1.1e-3 -> 0.9000
--- negatives
-ddqua181 quantize -0 1.1e0 -> -0.0
-ddqua182 quantize -1 -1e0 -> -1
-ddqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
-ddqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
-ddqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
-ddqua187 quantize -0.1 -91e-1 -> -0.1
-ddqua188 quantize -0.1 -.1e-2 -> -0.100
-ddqua189 quantize -0.1 -1e-3 -> -0.100
-ddqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
-ddqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
-ddqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
-ddqua193 quantize -0.9 100e-1 -> -0.9
-ddqua194 quantize -0.9 999e-2 -> -0.90
-
--- +ve exponents ..
-ddqua201 quantize -1 1e+0 -> -1
-ddqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
-ddqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
-ddqua204 quantize 0 1e+0 -> 0
-ddqua205 quantize 0 1e+1 -> 0E+1
-ddqua206 quantize 0 1e+2 -> 0E+2
-ddqua207 quantize +1 1e+0 -> 1
-ddqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
-ddqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
-
-ddqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
-ddqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
-ddqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
-ddqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
-ddqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
-ddqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
-ddqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
-ddqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
-ddqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
-ddqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
-ddqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
-ddqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
-ddqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
-ddqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
-ddqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
-ddqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
-
-ddqua240 quantize -10 1e+1 -> -1E+1 Rounded
-ddqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
-ddqua242 quantize +10 1e+1 -> 1E+1 Rounded
-ddqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
-ddqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
-ddqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
-ddqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
-ddqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
-ddqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
-ddqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
-ddqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
-ddqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
--- next one tries to add 9 zeros
-ddqua252 quantize 1E+17 1e+1 -> NaN Invalid_operation
-ddqua253 quantize 1E-17 1e+1 -> 0E+1 Inexact Rounded
-ddqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
-ddqua255 quantize 0E-17 1e+1 -> 0E+1
-ddqua256 quantize -0E-17 1e+1 -> -0E+1
-ddqua257 quantize -0E-1 1e+1 -> -0E+1
-ddqua258 quantize -0 1e+1 -> -0E+1
-ddqua259 quantize -0E+1 1e+1 -> -0E+1
-
-ddqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
-ddqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
-ddqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
-ddqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
-ddqua264 quantize 1E+2 1e+2 -> 1E+2
-ddqua265 quantize 1E+3 1e+2 -> 1.0E+3
-ddqua266 quantize 1E+4 1e+2 -> 1.00E+4
-ddqua267 quantize 1E+5 1e+2 -> 1.000E+5
-ddqua268 quantize 1E+6 1e+2 -> 1.0000E+6
-ddqua269 quantize 1E+7 1e+2 -> 1.00000E+7
-ddqua270 quantize 1E+8 1e+2 -> 1.000000E+8
-ddqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
-ddqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
-ddqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
-ddqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
-ddqua275 quantize 0E-10 1e+2 -> 0E+2
-
-ddqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
-ddqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
-ddqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
-ddqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
-ddqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
-ddqua285 quantize 1E+3 1e+3 -> 1E+3
-ddqua286 quantize 1E+4 1e+3 -> 1.0E+4
-ddqua287 quantize 1E+5 1e+3 -> 1.00E+5
-ddqua288 quantize 1E+6 1e+3 -> 1.000E+6
-ddqua289 quantize 1E+7 1e+3 -> 1.0000E+7
-ddqua290 quantize 1E+8 1e+3 -> 1.00000E+8
-ddqua291 quantize 1E+9 1e+3 -> 1.000000E+9
-ddqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
-ddqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
-ddqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
-ddqua295 quantize 0E-10 1e+3 -> 0E+3
-
--- round up from below [sign wrong in JIT compiler once]
-ddqua300 quantize 0.0078 1e-5 -> 0.00780
-ddqua301 quantize 0.0078 1e-4 -> 0.0078
-ddqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
-ddqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
-ddqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
-ddqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
-ddqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
-ddqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
-
-ddqua310 quantize -0.0078 1e-5 -> -0.00780
-ddqua311 quantize -0.0078 1e-4 -> -0.0078
-ddqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
-ddqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
-ddqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
-ddqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
-ddqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
-ddqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
-
-ddqua320 quantize 0.078 1e-5 -> 0.07800
-ddqua321 quantize 0.078 1e-4 -> 0.0780
-ddqua322 quantize 0.078 1e-3 -> 0.078
-ddqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
-ddqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
-ddqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
-ddqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
-ddqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
-
-ddqua330 quantize -0.078 1e-5 -> -0.07800
-ddqua331 quantize -0.078 1e-4 -> -0.0780
-ddqua332 quantize -0.078 1e-3 -> -0.078
-ddqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
-ddqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
-ddqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
-ddqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
-ddqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
-
-ddqua340 quantize 0.78 1e-5 -> 0.78000
-ddqua341 quantize 0.78 1e-4 -> 0.7800
-ddqua342 quantize 0.78 1e-3 -> 0.780
-ddqua343 quantize 0.78 1e-2 -> 0.78
-ddqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
-ddqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
-ddqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
-ddqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
-
-ddqua350 quantize -0.78 1e-5 -> -0.78000
-ddqua351 quantize -0.78 1e-4 -> -0.7800
-ddqua352 quantize -0.78 1e-3 -> -0.780
-ddqua353 quantize -0.78 1e-2 -> -0.78
-ddqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
-ddqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
-ddqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
-ddqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
-
-ddqua360 quantize 7.8 1e-5 -> 7.80000
-ddqua361 quantize 7.8 1e-4 -> 7.8000
-ddqua362 quantize 7.8 1e-3 -> 7.800
-ddqua363 quantize 7.8 1e-2 -> 7.80
-ddqua364 quantize 7.8 1e-1 -> 7.8
-ddqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
-ddqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
-ddqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
-ddqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
-
-ddqua370 quantize -7.8 1e-5 -> -7.80000
-ddqua371 quantize -7.8 1e-4 -> -7.8000
-ddqua372 quantize -7.8 1e-3 -> -7.800
-ddqua373 quantize -7.8 1e-2 -> -7.80
-ddqua374 quantize -7.8 1e-1 -> -7.8
-ddqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
-ddqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
-ddqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
-ddqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
-
--- some individuals
-ddqua380 quantize 1234567352364.506 1e-2 -> 1234567352364.51 Inexact Rounded
-ddqua381 quantize 12345673523645.06 1e-2 -> 12345673523645.06
-ddqua382 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
-ddqua383 quantize 1234567352364506 1e-2 -> NaN Invalid_operation
-ddqua384 quantize -1234567352364.506 1e-2 -> -1234567352364.51 Inexact Rounded
-ddqua385 quantize -12345673523645.06 1e-2 -> -12345673523645.06
-ddqua386 quantize -123456735236450.6 1e-2 -> NaN Invalid_operation
-ddqua387 quantize -1234567352364506 1e-2 -> NaN Invalid_operation
-
-rounding: down
-ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
--- ? should that one instead have been:
--- ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
-rounding: half_up
-
--- and a few more from e-mail discussions
-ddqua391 quantize 12345678912.34567 1e-3 -> 12345678912.346 Inexact Rounded
-ddqua392 quantize 123456789123.4567 1e-3 -> 123456789123.457 Inexact Rounded
-ddqua393 quantize 1234567891234.567 1e-3 -> 1234567891234.567
-ddqua394 quantize 12345678912345.67 1e-3 -> NaN Invalid_operation
-ddqua395 quantize 123456789123456.7 1e-3 -> NaN Invalid_operation
-ddqua396 quantize 1234567891234567. 1e-3 -> NaN Invalid_operation
-
--- some 9999 round-up cases
-ddqua400 quantize 9.999 1e-5 -> 9.99900
-ddqua401 quantize 9.999 1e-4 -> 9.9990
-ddqua402 quantize 9.999 1e-3 -> 9.999
-ddqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
-ddqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
-ddqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
-ddqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
-ddqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
-
-ddqua410 quantize 0.999 1e-5 -> 0.99900
-ddqua411 quantize 0.999 1e-4 -> 0.9990
-ddqua412 quantize 0.999 1e-3 -> 0.999
-ddqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
-ddqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
-ddqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
-ddqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
-
-ddqua420 quantize 0.0999 1e-5 -> 0.09990
-ddqua421 quantize 0.0999 1e-4 -> 0.0999
-ddqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
-ddqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
-ddqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
-ddqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
-ddqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
-
-ddqua430 quantize 0.00999 1e-5 -> 0.00999
-ddqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
-ddqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
-ddqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
-ddqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
-ddqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
-ddqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
-
-ddqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
-ddqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
-ddqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
-ddqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
-ddqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
-ddqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
-ddqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
-
-ddqua1001 quantize 0.000 0.001 -> 0.000
-ddqua1002 quantize 0.001 0.001 -> 0.001
-ddqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
-ddqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
-ddqua1005 quantize 0.501 0.001 -> 0.501
-ddqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
-ddqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
-ddqua1008 quantize 0.999 0.001 -> 0.999
-
-ddqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
-ddqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
-ddqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
-ddqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
-ddqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
-ddqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
--- a potential double-round
-ddqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
-ddqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
-
-ddqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
-ddqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
-ddqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
-ddqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
-ddqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
-ddqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
-ddqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
-ddqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
-
--- Zeros
-ddqua500 quantize 0 1e1 -> 0E+1
-ddqua501 quantize 0 1e0 -> 0
-ddqua502 quantize 0 1e-1 -> 0.0
-ddqua503 quantize 0.0 1e-1 -> 0.0
-ddqua504 quantize 0.0 1e0 -> 0
-ddqua505 quantize 0.0 1e+1 -> 0E+1
-ddqua506 quantize 0E+1 1e-1 -> 0.0
-ddqua507 quantize 0E+1 1e0 -> 0
-ddqua508 quantize 0E+1 1e+1 -> 0E+1
-ddqua509 quantize -0 1e1 -> -0E+1
-ddqua510 quantize -0 1e0 -> -0
-ddqua511 quantize -0 1e-1 -> -0.0
-ddqua512 quantize -0.0 1e-1 -> -0.0
-ddqua513 quantize -0.0 1e0 -> -0
-ddqua514 quantize -0.0 1e+1 -> -0E+1
-ddqua515 quantize -0E+1 1e-1 -> -0.0
-ddqua516 quantize -0E+1 1e0 -> -0
-ddqua517 quantize -0E+1 1e+1 -> -0E+1
-
--- Suspicious RHS values
-ddqua520 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
-ddqua521 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
-ddqua522 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
-ddqua523 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
--- next four are "won't fit" overfl
-ddqua526 quantize 1.234 1e-299 -> NaN Invalid_operation
-ddqua527 quantize 123.456 1e-299 -> NaN Invalid_operation
-ddqua528 quantize 1.234 1e-299 -> NaN Invalid_operation
-ddqua529 quantize 123.456 1e-299 -> NaN Invalid_operation
-
-ddqua532 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
-ddqua533 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
-ddqua534 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
-ddqua537 quantize 0 1e-299 -> 0E-299
--- next two are "won't fit" overflows
-ddqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
-ddqua539 quantize 1.234 1e-300 -> NaN Invalid_operation
--- [more below]
-
--- Specials
-ddqua580 quantize Inf -Inf -> Infinity
-ddqua581 quantize Inf 1e-299 -> NaN Invalid_operation
-ddqua582 quantize Inf 1e-1 -> NaN Invalid_operation
-ddqua583 quantize Inf 1e0 -> NaN Invalid_operation
-ddqua584 quantize Inf 1e1 -> NaN Invalid_operation
-ddqua585 quantize Inf 1e299 -> NaN Invalid_operation
-ddqua586 quantize Inf Inf -> Infinity
-ddqua587 quantize -1000 Inf -> NaN Invalid_operation
-ddqua588 quantize -Inf Inf -> -Infinity
-ddqua589 quantize -1 Inf -> NaN Invalid_operation
-ddqua590 quantize 0 Inf -> NaN Invalid_operation
-ddqua591 quantize 1 Inf -> NaN Invalid_operation
-ddqua592 quantize 1000 Inf -> NaN Invalid_operation
-ddqua593 quantize Inf Inf -> Infinity
-ddqua594 quantize Inf 1e-0 -> NaN Invalid_operation
-ddqua595 quantize -0 Inf -> NaN Invalid_operation
-
-ddqua600 quantize -Inf -Inf -> -Infinity
-ddqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
-ddqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
-ddqua603 quantize -Inf 1e0 -> NaN Invalid_operation
-ddqua604 quantize -Inf 1e1 -> NaN Invalid_operation
-ddqua605 quantize -Inf 1e299 -> NaN Invalid_operation
-ddqua606 quantize -Inf Inf -> -Infinity
-ddqua607 quantize -1000 Inf -> NaN Invalid_operation
-ddqua608 quantize -Inf -Inf -> -Infinity
-ddqua609 quantize -1 -Inf -> NaN Invalid_operation
-ddqua610 quantize 0 -Inf -> NaN Invalid_operation
-ddqua611 quantize 1 -Inf -> NaN Invalid_operation
-ddqua612 quantize 1000 -Inf -> NaN Invalid_operation
-ddqua613 quantize Inf -Inf -> Infinity
-ddqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
-ddqua615 quantize -0 -Inf -> NaN Invalid_operation
-
-ddqua621 quantize NaN -Inf -> NaN
-ddqua622 quantize NaN 1e-299 -> NaN
-ddqua623 quantize NaN 1e-1 -> NaN
-ddqua624 quantize NaN 1e0 -> NaN
-ddqua625 quantize NaN 1e1 -> NaN
-ddqua626 quantize NaN 1e299 -> NaN
-ddqua627 quantize NaN Inf -> NaN
-ddqua628 quantize NaN NaN -> NaN
-ddqua629 quantize -Inf NaN -> NaN
-ddqua630 quantize -1000 NaN -> NaN
-ddqua631 quantize -1 NaN -> NaN
-ddqua632 quantize 0 NaN -> NaN
-ddqua633 quantize 1 NaN -> NaN
-ddqua634 quantize 1000 NaN -> NaN
-ddqua635 quantize Inf NaN -> NaN
-ddqua636 quantize NaN 1e-0 -> NaN
-ddqua637 quantize -0 NaN -> NaN
-
-ddqua641 quantize sNaN -Inf -> NaN Invalid_operation
-ddqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
-ddqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
-ddqua644 quantize sNaN 1e0 -> NaN Invalid_operation
-ddqua645 quantize sNaN 1e1 -> NaN Invalid_operation
-ddqua646 quantize sNaN 1e299 -> NaN Invalid_operation
-ddqua647 quantize sNaN NaN -> NaN Invalid_operation
-ddqua648 quantize sNaN sNaN -> NaN Invalid_operation
-ddqua649 quantize NaN sNaN -> NaN Invalid_operation
-ddqua650 quantize -Inf sNaN -> NaN Invalid_operation
-ddqua651 quantize -1000 sNaN -> NaN Invalid_operation
-ddqua652 quantize -1 sNaN -> NaN Invalid_operation
-ddqua653 quantize 0 sNaN -> NaN Invalid_operation
-ddqua654 quantize 1 sNaN -> NaN Invalid_operation
-ddqua655 quantize 1000 sNaN -> NaN Invalid_operation
-ddqua656 quantize Inf sNaN -> NaN Invalid_operation
-ddqua657 quantize NaN sNaN -> NaN Invalid_operation
-ddqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
-ddqua659 quantize -0 sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddqua661 quantize NaN9 -Inf -> NaN9
-ddqua662 quantize NaN8 919 -> NaN8
-ddqua663 quantize NaN71 Inf -> NaN71
-ddqua664 quantize NaN6 NaN5 -> NaN6
-ddqua665 quantize -Inf NaN4 -> NaN4
-ddqua666 quantize -919 NaN31 -> NaN31
-ddqua667 quantize Inf NaN2 -> NaN2
-
-ddqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
-ddqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
-ddqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
-ddqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
-ddqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
-ddqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
-ddqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
-ddqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
-ddqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
-
-ddqua681 quantize -NaN9 -Inf -> -NaN9
-ddqua682 quantize -NaN8 919 -> -NaN8
-ddqua683 quantize -NaN71 Inf -> -NaN71
-ddqua684 quantize -NaN6 -NaN5 -> -NaN6
-ddqua685 quantize -Inf -NaN4 -> -NaN4
-ddqua686 quantize -919 -NaN31 -> -NaN31
-ddqua687 quantize Inf -NaN2 -> -NaN2
-
-ddqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
-ddqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
-ddqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
-ddqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
-ddqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-ddqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
-ddqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
-ddqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
-ddqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
-
--- subnormals and underflow
-ddqua710 quantize 1.00E-383 1e-383 -> 1E-383 Rounded
-ddqua711 quantize 0.1E-383 2e-384 -> 1E-384 Subnormal
-ddqua712 quantize 0.10E-383 3e-384 -> 1E-384 Subnormal Rounded
-ddqua713 quantize 0.100E-383 4e-384 -> 1E-384 Subnormal Rounded
-ddqua714 quantize 0.01E-383 5e-385 -> 1E-385 Subnormal
--- next is rounded to Emin
-ddqua715 quantize 0.999E-383 1e-383 -> 1E-383 Inexact Rounded
-ddqua716 quantize 0.099E-383 10e-384 -> 1E-384 Inexact Rounded Subnormal
-
-ddqua717 quantize 0.009E-383 1e-385 -> 1E-385 Inexact Rounded Subnormal
-ddqua718 quantize 0.001E-383 1e-385 -> 0E-385 Inexact Rounded
-ddqua719 quantize 0.0009E-383 1e-385 -> 0E-385 Inexact Rounded
-ddqua720 quantize 0.0001E-383 1e-385 -> 0E-385 Inexact Rounded
-
-ddqua730 quantize -1.00E-383 1e-383 -> -1E-383 Rounded
-ddqua731 quantize -0.1E-383 1e-383 -> -0E-383 Rounded Inexact
-ddqua732 quantize -0.10E-383 1e-383 -> -0E-383 Rounded Inexact
-ddqua733 quantize -0.100E-383 1e-383 -> -0E-383 Rounded Inexact
-ddqua734 quantize -0.01E-383 1e-383 -> -0E-383 Inexact Rounded
--- next is rounded to Emin
-ddqua735 quantize -0.999E-383 90e-383 -> -1E-383 Inexact Rounded
-ddqua736 quantize -0.099E-383 -1e-383 -> -0E-383 Inexact Rounded
-ddqua737 quantize -0.009E-383 -1e-383 -> -0E-383 Inexact Rounded
-ddqua738 quantize -0.001E-383 -0e-383 -> -0E-383 Inexact Rounded
-ddqua739 quantize -0.0001E-383 0e-383 -> -0E-383 Inexact Rounded
-
-ddqua740 quantize -1.00E-383 1e-384 -> -1.0E-383 Rounded
-ddqua741 quantize -0.1E-383 1e-384 -> -1E-384 Subnormal
-ddqua742 quantize -0.10E-383 1e-384 -> -1E-384 Subnormal Rounded
-ddqua743 quantize -0.100E-383 1e-384 -> -1E-384 Subnormal Rounded
-ddqua744 quantize -0.01E-383 1e-384 -> -0E-384 Inexact Rounded
--- next is rounded to Emin
-ddqua745 quantize -0.999E-383 1e-384 -> -1.0E-383 Inexact Rounded
-ddqua746 quantize -0.099E-383 1e-384 -> -1E-384 Inexact Rounded Subnormal
-ddqua747 quantize -0.009E-383 1e-384 -> -0E-384 Inexact Rounded
-ddqua748 quantize -0.001E-383 1e-384 -> -0E-384 Inexact Rounded
-ddqua749 quantize -0.0001E-383 1e-384 -> -0E-384 Inexact Rounded
-
-ddqua750 quantize -1.00E-383 1e-385 -> -1.00E-383
-ddqua751 quantize -0.1E-383 1e-385 -> -1.0E-384 Subnormal
-ddqua752 quantize -0.10E-383 1e-385 -> -1.0E-384 Subnormal
-ddqua753 quantize -0.100E-383 1e-385 -> -1.0E-384 Subnormal Rounded
-ddqua754 quantize -0.01E-383 1e-385 -> -1E-385 Subnormal
--- next is rounded to Emin
-ddqua755 quantize -0.999E-383 1e-385 -> -1.00E-383 Inexact Rounded
-ddqua756 quantize -0.099E-383 1e-385 -> -1.0E-384 Inexact Rounded Subnormal
-ddqua757 quantize -0.009E-383 1e-385 -> -1E-385 Inexact Rounded Subnormal
-ddqua758 quantize -0.001E-383 1e-385 -> -0E-385 Inexact Rounded
-ddqua759 quantize -0.0001E-383 1e-385 -> -0E-385 Inexact Rounded
-
-ddqua760 quantize -1.00E-383 1e-386 -> -1.000E-383
-ddqua761 quantize -0.1E-383 1e-386 -> -1.00E-384 Subnormal
-ddqua762 quantize -0.10E-383 1e-386 -> -1.00E-384 Subnormal
-ddqua763 quantize -0.100E-383 1e-386 -> -1.00E-384 Subnormal
-ddqua764 quantize -0.01E-383 1e-386 -> -1.0E-385 Subnormal
-ddqua765 quantize -0.999E-383 1e-386 -> -9.99E-384 Subnormal
-ddqua766 quantize -0.099E-383 1e-386 -> -9.9E-385 Subnormal
-ddqua767 quantize -0.009E-383 1e-386 -> -9E-386 Subnormal
-ddqua768 quantize -0.001E-383 1e-386 -> -1E-386 Subnormal
-ddqua769 quantize -0.0001E-383 1e-386 -> -0E-386 Inexact Rounded
-
--- More from Fung Lee
-ddqua1021 quantize 8.666666666666000E+384 1.000000000000000E+384 -> 8.666666666666000E+384
-ddqua1022 quantize -8.666666666666000E+384 1.000000000000000E+384 -> -8.666666666666000E+384
-ddqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
-ddqua1029 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
-
-
---ddqua1030 quantize 8.666666666666000E+384 1E+384 -> 9.000000000000000E+384 Rounded Inexact
---ddqua1031 quantize 8.666666666666000E+384 1E+384 -> 8.666666666666000E+384 Rounded
---ddqua1032 quantize 8.666666666666000E+384 1E+383 -> 8.666666666666000E+384 Rounded
---ddqua1033 quantize 8.666666666666000E+384 1E+382 -> 8.666666666666000E+384 Rounded
---ddqua1034 quantize 8.666666666666000E+384 1E+381 -> 8.666666666666000E+384 Rounded
---ddqua1035 quantize 8.666666666666000E+384 1E+380 -> 8.666666666666000E+384 Rounded
-
--- Int and uInt32 edge values for testing conversions
-ddqua1040 quantize -2147483646 0 -> -2147483646
-ddqua1041 quantize -2147483647 0 -> -2147483647
-ddqua1042 quantize -2147483648 0 -> -2147483648
-ddqua1043 quantize -2147483649 0 -> -2147483649
-ddqua1044 quantize 2147483646 0 -> 2147483646
-ddqua1045 quantize 2147483647 0 -> 2147483647
-ddqua1046 quantize 2147483648 0 -> 2147483648
-ddqua1047 quantize 2147483649 0 -> 2147483649
-ddqua1048 quantize 4294967294 0 -> 4294967294
-ddqua1049 quantize 4294967295 0 -> 4294967295
-ddqua1050 quantize 4294967296 0 -> 4294967296
-ddqua1051 quantize 4294967297 0 -> 4294967297
-
--- Rounding swathe
-rounding: half_even
-ddqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-ddqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: half_up
-ddqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-ddqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-ddqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: half_down
-ddqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-ddqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: up
-ddqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
-ddqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
-ddqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-ddqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-ddqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-ddqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
-
-rounding: down
-ddqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-ddqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
-ddqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-ddqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
-ddqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
-ddqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
-ddqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
-
-rounding: ceiling
-ddqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
-ddqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
-ddqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-ddqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-ddqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-ddqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
-
-rounding: floor
-ddqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-ddqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
-ddqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-ddqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
-ddqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
-ddqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
-ddqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
-
-rounding: 05up
-ddqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
-ddqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
-ddqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
-ddqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
-ddqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
-ddqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
-ddqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
-ddqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
-ddqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
-
-ddqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
-ddqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
-ddqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
-ddqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
-ddqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
-ddqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
-ddqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
-ddqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
-ddqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
-
-ddqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
-ddqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
-ddqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
-ddqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-ddqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
-ddqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
-ddqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
-ddqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
-
-ddqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
-ddqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
-ddqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
-ddqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
-ddqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
-ddqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
-ddqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
-ddqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
-ddqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
-
-ddqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
-ddqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
-ddqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
-ddqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
-ddqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
-ddqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
-ddqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
-ddqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
-ddqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
-
-ddqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
-ddqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
-ddqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
-ddqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
-ddqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
-ddqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
-ddqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
-ddqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
-ddqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
-
--- Null tests
-rounding: half_even
-ddqua998 quantize 10 # -> NaN Invalid_operation
-ddqua999 quantize # 1e10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddQuantize.decTest -- decDouble quantize operation --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Most of the tests here assume a "regular pattern", where the
+-- sign and coefficient are +1.
+-- 2004.03.15 Underflow for quantize is suppressed
+-- 2005.06.08 More extensive tests for 'does not fit'
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddqua001 quantize 0 1e0 -> 0
+ddqua002 quantize 1 1e0 -> 1
+ddqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
+ddqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
+ddqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
+ddqua007 quantize 0.1 1e-1 -> 0.1
+ddqua008 quantize 0.1 1e-2 -> 0.10
+ddqua009 quantize 0.1 1e-3 -> 0.100
+ddqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
+ddqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
+ddqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
+ddqua013 quantize 0.9 1e-1 -> 0.9
+ddqua014 quantize 0.9 1e-2 -> 0.90
+ddqua015 quantize 0.9 1e-3 -> 0.900
+-- negatives
+ddqua021 quantize -0 1e0 -> -0
+ddqua022 quantize -1 1e0 -> -1
+ddqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
+ddqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
+ddqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
+ddqua027 quantize -0.1 1e-1 -> -0.1
+ddqua028 quantize -0.1 1e-2 -> -0.10
+ddqua029 quantize -0.1 1e-3 -> -0.100
+ddqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
+ddqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
+ddqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
+ddqua033 quantize -0.9 1e-1 -> -0.9
+ddqua034 quantize -0.9 1e-2 -> -0.90
+ddqua035 quantize -0.9 1e-3 -> -0.900
+ddqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
+ddqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
+ddqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
+ddqua039 quantize -0.5 1e-1 -> -0.5
+ddqua040 quantize -0.5 1e-2 -> -0.50
+ddqua041 quantize -0.5 1e-3 -> -0.500
+ddqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
+ddqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
+ddqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
+ddqua045 quantize -0.9 1e-1 -> -0.9
+ddqua046 quantize -0.9 1e-2 -> -0.90
+ddqua047 quantize -0.9 1e-3 -> -0.900
+
+-- examples from Specification
+ddqua060 quantize 2.17 0.001 -> 2.170
+ddqua061 quantize 2.17 0.01 -> 2.17
+ddqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
+ddqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
+ddqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
+ddqua065 quantize -Inf Inf -> -Infinity
+ddqua066 quantize 2 Inf -> NaN Invalid_operation
+ddqua067 quantize -0.1 1 -> -0 Inexact Rounded
+ddqua068 quantize -0 1e+5 -> -0E+5
+ddqua069 quantize +123456789012345.6 1e-2 -> NaN Invalid_operation
+ddqua070 quantize -987654335236450.6 1e-2 -> NaN Invalid_operation
+ddqua071 quantize 217 1e-1 -> 217.0
+ddqua072 quantize 217 1e+0 -> 217
+ddqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
+ddqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
+
+-- general tests ..
+ddqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
+ddqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
+ddqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
+ddqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
+ddqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
+ddqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
+ddqua095 quantize 1.2345 1e-6 -> 1.234500
+ddqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
+ddqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
+ddqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
+ddqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
+ddqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
+
+ddqua101 quantize -1 1e0 -> -1
+ddqua102 quantize -1 1e-1 -> -1.0
+ddqua103 quantize -1 1e-2 -> -1.00
+ddqua104 quantize 0 1e0 -> 0
+ddqua105 quantize 0 1e-1 -> 0.0
+ddqua106 quantize 0 1e-2 -> 0.00
+ddqua107 quantize 0.00 1e0 -> 0
+ddqua108 quantize 0 1e+1 -> 0E+1
+ddqua109 quantize 0 1e+2 -> 0E+2
+ddqua110 quantize +1 1e0 -> 1
+ddqua111 quantize +1 1e-1 -> 1.0
+ddqua112 quantize +1 1e-2 -> 1.00
+
+ddqua120 quantize 1.04 1e-3 -> 1.040
+ddqua121 quantize 1.04 1e-2 -> 1.04
+ddqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
+ddqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
+ddqua124 quantize 1.05 1e-3 -> 1.050
+ddqua125 quantize 1.05 1e-2 -> 1.05
+ddqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
+ddqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
+ddqua132 quantize 1.06 1e-3 -> 1.060
+ddqua133 quantize 1.06 1e-2 -> 1.06
+ddqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
+ddqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
+
+ddqua140 quantize -10 1e-2 -> -10.00
+ddqua141 quantize +1 1e-2 -> 1.00
+ddqua142 quantize +10 1e-2 -> 10.00
+ddqua143 quantize 1E+17 1e-2 -> NaN Invalid_operation
+ddqua144 quantize 1E-17 1e-2 -> 0.00 Inexact Rounded
+ddqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
+ddqua146 quantize 1E-2 1e-2 -> 0.01
+ddqua147 quantize 1E-1 1e-2 -> 0.10
+ddqua148 quantize 0E-17 1e-2 -> 0.00
+
+ddqua150 quantize 1.0600 1e-5 -> 1.06000
+ddqua151 quantize 1.0600 1e-4 -> 1.0600
+ddqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
+ddqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
+ddqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
+ddqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
+
+-- a couple where rounding was different in base tests
+rounding: half_up
+ddqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
+ddqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
+ddqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
+rounding: half_even
+
+-- base tests with non-1 coefficients
+ddqua161 quantize 0 -9e0 -> 0
+ddqua162 quantize 1 -7e0 -> 1
+ddqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
+ddqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
+ddqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
+ddqua167 quantize 0.1 3e-1 -> 0.1
+ddqua168 quantize 0.1 44e-2 -> 0.10
+ddqua169 quantize 0.1 555e-3 -> 0.100
+ddqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
+ddqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
+ddqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
+ddqua173 quantize 0.9 -9e-1 -> 0.9
+ddqua174 quantize 0.9 0e-2 -> 0.90
+ddqua175 quantize 0.9 1.1e-3 -> 0.9000
+-- negatives
+ddqua181 quantize -0 1.1e0 -> -0.0
+ddqua182 quantize -1 -1e0 -> -1
+ddqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
+ddqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
+ddqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
+ddqua187 quantize -0.1 -91e-1 -> -0.1
+ddqua188 quantize -0.1 -.1e-2 -> -0.100
+ddqua189 quantize -0.1 -1e-3 -> -0.100
+ddqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
+ddqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
+ddqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
+ddqua193 quantize -0.9 100e-1 -> -0.9
+ddqua194 quantize -0.9 999e-2 -> -0.90
+
+-- +ve exponents ..
+ddqua201 quantize -1 1e+0 -> -1
+ddqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
+ddqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
+ddqua204 quantize 0 1e+0 -> 0
+ddqua205 quantize 0 1e+1 -> 0E+1
+ddqua206 quantize 0 1e+2 -> 0E+2
+ddqua207 quantize +1 1e+0 -> 1
+ddqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
+ddqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
+
+ddqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
+ddqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
+ddqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
+ddqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
+ddqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
+ddqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
+ddqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
+ddqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
+ddqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
+ddqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
+ddqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
+ddqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
+ddqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
+ddqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
+ddqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
+ddqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
+
+ddqua240 quantize -10 1e+1 -> -1E+1 Rounded
+ddqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
+ddqua242 quantize +10 1e+1 -> 1E+1 Rounded
+ddqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
+ddqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
+ddqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
+ddqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
+ddqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
+ddqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
+ddqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
+ddqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
+ddqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
+-- next one tries to add 9 zeros
+ddqua252 quantize 1E+17 1e+1 -> NaN Invalid_operation
+ddqua253 quantize 1E-17 1e+1 -> 0E+1 Inexact Rounded
+ddqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
+ddqua255 quantize 0E-17 1e+1 -> 0E+1
+ddqua256 quantize -0E-17 1e+1 -> -0E+1
+ddqua257 quantize -0E-1 1e+1 -> -0E+1
+ddqua258 quantize -0 1e+1 -> -0E+1
+ddqua259 quantize -0E+1 1e+1 -> -0E+1
+
+ddqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
+ddqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
+ddqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
+ddqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
+ddqua264 quantize 1E+2 1e+2 -> 1E+2
+ddqua265 quantize 1E+3 1e+2 -> 1.0E+3
+ddqua266 quantize 1E+4 1e+2 -> 1.00E+4
+ddqua267 quantize 1E+5 1e+2 -> 1.000E+5
+ddqua268 quantize 1E+6 1e+2 -> 1.0000E+6
+ddqua269 quantize 1E+7 1e+2 -> 1.00000E+7
+ddqua270 quantize 1E+8 1e+2 -> 1.000000E+8
+ddqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
+ddqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
+ddqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
+ddqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
+ddqua275 quantize 0E-10 1e+2 -> 0E+2
+
+ddqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
+ddqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
+ddqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
+ddqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
+ddqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
+ddqua285 quantize 1E+3 1e+3 -> 1E+3
+ddqua286 quantize 1E+4 1e+3 -> 1.0E+4
+ddqua287 quantize 1E+5 1e+3 -> 1.00E+5
+ddqua288 quantize 1E+6 1e+3 -> 1.000E+6
+ddqua289 quantize 1E+7 1e+3 -> 1.0000E+7
+ddqua290 quantize 1E+8 1e+3 -> 1.00000E+8
+ddqua291 quantize 1E+9 1e+3 -> 1.000000E+9
+ddqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
+ddqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
+ddqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
+ddqua295 quantize 0E-10 1e+3 -> 0E+3
+
+-- round up from below [sign wrong in JIT compiler once]
+ddqua300 quantize 0.0078 1e-5 -> 0.00780
+ddqua301 quantize 0.0078 1e-4 -> 0.0078
+ddqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
+ddqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
+ddqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
+ddqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
+ddqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
+ddqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
+
+ddqua310 quantize -0.0078 1e-5 -> -0.00780
+ddqua311 quantize -0.0078 1e-4 -> -0.0078
+ddqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
+ddqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
+ddqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
+ddqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
+ddqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
+ddqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
+
+ddqua320 quantize 0.078 1e-5 -> 0.07800
+ddqua321 quantize 0.078 1e-4 -> 0.0780
+ddqua322 quantize 0.078 1e-3 -> 0.078
+ddqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
+ddqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
+ddqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
+ddqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
+ddqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
+
+ddqua330 quantize -0.078 1e-5 -> -0.07800
+ddqua331 quantize -0.078 1e-4 -> -0.0780
+ddqua332 quantize -0.078 1e-3 -> -0.078
+ddqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
+ddqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
+ddqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
+ddqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
+ddqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
+
+ddqua340 quantize 0.78 1e-5 -> 0.78000
+ddqua341 quantize 0.78 1e-4 -> 0.7800
+ddqua342 quantize 0.78 1e-3 -> 0.780
+ddqua343 quantize 0.78 1e-2 -> 0.78
+ddqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
+ddqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
+ddqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
+ddqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
+
+ddqua350 quantize -0.78 1e-5 -> -0.78000
+ddqua351 quantize -0.78 1e-4 -> -0.7800
+ddqua352 quantize -0.78 1e-3 -> -0.780
+ddqua353 quantize -0.78 1e-2 -> -0.78
+ddqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
+ddqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
+ddqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
+ddqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
+
+ddqua360 quantize 7.8 1e-5 -> 7.80000
+ddqua361 quantize 7.8 1e-4 -> 7.8000
+ddqua362 quantize 7.8 1e-3 -> 7.800
+ddqua363 quantize 7.8 1e-2 -> 7.80
+ddqua364 quantize 7.8 1e-1 -> 7.8
+ddqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
+ddqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
+ddqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
+ddqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
+
+ddqua370 quantize -7.8 1e-5 -> -7.80000
+ddqua371 quantize -7.8 1e-4 -> -7.8000
+ddqua372 quantize -7.8 1e-3 -> -7.800
+ddqua373 quantize -7.8 1e-2 -> -7.80
+ddqua374 quantize -7.8 1e-1 -> -7.8
+ddqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
+ddqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
+ddqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
+ddqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
+
+-- some individuals
+ddqua380 quantize 1234567352364.506 1e-2 -> 1234567352364.51 Inexact Rounded
+ddqua381 quantize 12345673523645.06 1e-2 -> 12345673523645.06
+ddqua382 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
+ddqua383 quantize 1234567352364506 1e-2 -> NaN Invalid_operation
+ddqua384 quantize -1234567352364.506 1e-2 -> -1234567352364.51 Inexact Rounded
+ddqua385 quantize -12345673523645.06 1e-2 -> -12345673523645.06
+ddqua386 quantize -123456735236450.6 1e-2 -> NaN Invalid_operation
+ddqua387 quantize -1234567352364506 1e-2 -> NaN Invalid_operation
+
+rounding: down
+ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
+-- ? should that one instead have been:
+-- ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
+rounding: half_up
+
+-- and a few more from e-mail discussions
+ddqua391 quantize 12345678912.34567 1e-3 -> 12345678912.346 Inexact Rounded
+ddqua392 quantize 123456789123.4567 1e-3 -> 123456789123.457 Inexact Rounded
+ddqua393 quantize 1234567891234.567 1e-3 -> 1234567891234.567
+ddqua394 quantize 12345678912345.67 1e-3 -> NaN Invalid_operation
+ddqua395 quantize 123456789123456.7 1e-3 -> NaN Invalid_operation
+ddqua396 quantize 1234567891234567. 1e-3 -> NaN Invalid_operation
+
+-- some 9999 round-up cases
+ddqua400 quantize 9.999 1e-5 -> 9.99900
+ddqua401 quantize 9.999 1e-4 -> 9.9990
+ddqua402 quantize 9.999 1e-3 -> 9.999
+ddqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
+ddqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
+ddqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
+ddqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
+ddqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
+
+ddqua410 quantize 0.999 1e-5 -> 0.99900
+ddqua411 quantize 0.999 1e-4 -> 0.9990
+ddqua412 quantize 0.999 1e-3 -> 0.999
+ddqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
+ddqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
+ddqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
+ddqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
+
+ddqua420 quantize 0.0999 1e-5 -> 0.09990
+ddqua421 quantize 0.0999 1e-4 -> 0.0999
+ddqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
+ddqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
+ddqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
+ddqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
+ddqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
+
+ddqua430 quantize 0.00999 1e-5 -> 0.00999
+ddqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
+ddqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
+ddqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
+ddqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
+ddqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
+ddqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
+
+ddqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
+ddqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
+ddqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
+ddqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
+ddqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
+ddqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
+ddqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
+
+ddqua1001 quantize 0.000 0.001 -> 0.000
+ddqua1002 quantize 0.001 0.001 -> 0.001
+ddqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
+ddqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
+ddqua1005 quantize 0.501 0.001 -> 0.501
+ddqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
+ddqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
+ddqua1008 quantize 0.999 0.001 -> 0.999
+
+ddqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
+ddqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
+ddqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
+ddqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
+ddqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
+ddqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
+-- a potential double-round
+ddqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
+ddqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
+
+ddqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
+ddqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
+ddqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
+ddqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
+ddqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
+ddqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
+ddqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
+ddqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
+
+-- Zeros
+ddqua500 quantize 0 1e1 -> 0E+1
+ddqua501 quantize 0 1e0 -> 0
+ddqua502 quantize 0 1e-1 -> 0.0
+ddqua503 quantize 0.0 1e-1 -> 0.0
+ddqua504 quantize 0.0 1e0 -> 0
+ddqua505 quantize 0.0 1e+1 -> 0E+1
+ddqua506 quantize 0E+1 1e-1 -> 0.0
+ddqua507 quantize 0E+1 1e0 -> 0
+ddqua508 quantize 0E+1 1e+1 -> 0E+1
+ddqua509 quantize -0 1e1 -> -0E+1
+ddqua510 quantize -0 1e0 -> -0
+ddqua511 quantize -0 1e-1 -> -0.0
+ddqua512 quantize -0.0 1e-1 -> -0.0
+ddqua513 quantize -0.0 1e0 -> -0
+ddqua514 quantize -0.0 1e+1 -> -0E+1
+ddqua515 quantize -0E+1 1e-1 -> -0.0
+ddqua516 quantize -0E+1 1e0 -> -0
+ddqua517 quantize -0E+1 1e+1 -> -0E+1
+
+-- Suspicious RHS values
+ddqua520 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
+ddqua521 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
+ddqua522 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
+ddqua523 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
+-- next four are "won't fit" overfl
+ddqua526 quantize 1.234 1e-299 -> NaN Invalid_operation
+ddqua527 quantize 123.456 1e-299 -> NaN Invalid_operation
+ddqua528 quantize 1.234 1e-299 -> NaN Invalid_operation
+ddqua529 quantize 123.456 1e-299 -> NaN Invalid_operation
+
+ddqua532 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
+ddqua533 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
+ddqua534 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
+ddqua537 quantize 0 1e-299 -> 0E-299
+-- next two are "won't fit" overflows
+ddqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
+ddqua539 quantize 1.234 1e-300 -> NaN Invalid_operation
+-- [more below]
+
+-- Specials
+ddqua580 quantize Inf -Inf -> Infinity
+ddqua581 quantize Inf 1e-299 -> NaN Invalid_operation
+ddqua582 quantize Inf 1e-1 -> NaN Invalid_operation
+ddqua583 quantize Inf 1e0 -> NaN Invalid_operation
+ddqua584 quantize Inf 1e1 -> NaN Invalid_operation
+ddqua585 quantize Inf 1e299 -> NaN Invalid_operation
+ddqua586 quantize Inf Inf -> Infinity
+ddqua587 quantize -1000 Inf -> NaN Invalid_operation
+ddqua588 quantize -Inf Inf -> -Infinity
+ddqua589 quantize -1 Inf -> NaN Invalid_operation
+ddqua590 quantize 0 Inf -> NaN Invalid_operation
+ddqua591 quantize 1 Inf -> NaN Invalid_operation
+ddqua592 quantize 1000 Inf -> NaN Invalid_operation
+ddqua593 quantize Inf Inf -> Infinity
+ddqua594 quantize Inf 1e-0 -> NaN Invalid_operation
+ddqua595 quantize -0 Inf -> NaN Invalid_operation
+
+ddqua600 quantize -Inf -Inf -> -Infinity
+ddqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
+ddqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
+ddqua603 quantize -Inf 1e0 -> NaN Invalid_operation
+ddqua604 quantize -Inf 1e1 -> NaN Invalid_operation
+ddqua605 quantize -Inf 1e299 -> NaN Invalid_operation
+ddqua606 quantize -Inf Inf -> -Infinity
+ddqua607 quantize -1000 Inf -> NaN Invalid_operation
+ddqua608 quantize -Inf -Inf -> -Infinity
+ddqua609 quantize -1 -Inf -> NaN Invalid_operation
+ddqua610 quantize 0 -Inf -> NaN Invalid_operation
+ddqua611 quantize 1 -Inf -> NaN Invalid_operation
+ddqua612 quantize 1000 -Inf -> NaN Invalid_operation
+ddqua613 quantize Inf -Inf -> Infinity
+ddqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
+ddqua615 quantize -0 -Inf -> NaN Invalid_operation
+
+ddqua621 quantize NaN -Inf -> NaN
+ddqua622 quantize NaN 1e-299 -> NaN
+ddqua623 quantize NaN 1e-1 -> NaN
+ddqua624 quantize NaN 1e0 -> NaN
+ddqua625 quantize NaN 1e1 -> NaN
+ddqua626 quantize NaN 1e299 -> NaN
+ddqua627 quantize NaN Inf -> NaN
+ddqua628 quantize NaN NaN -> NaN
+ddqua629 quantize -Inf NaN -> NaN
+ddqua630 quantize -1000 NaN -> NaN
+ddqua631 quantize -1 NaN -> NaN
+ddqua632 quantize 0 NaN -> NaN
+ddqua633 quantize 1 NaN -> NaN
+ddqua634 quantize 1000 NaN -> NaN
+ddqua635 quantize Inf NaN -> NaN
+ddqua636 quantize NaN 1e-0 -> NaN
+ddqua637 quantize -0 NaN -> NaN
+
+ddqua641 quantize sNaN -Inf -> NaN Invalid_operation
+ddqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
+ddqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
+ddqua644 quantize sNaN 1e0 -> NaN Invalid_operation
+ddqua645 quantize sNaN 1e1 -> NaN Invalid_operation
+ddqua646 quantize sNaN 1e299 -> NaN Invalid_operation
+ddqua647 quantize sNaN NaN -> NaN Invalid_operation
+ddqua648 quantize sNaN sNaN -> NaN Invalid_operation
+ddqua649 quantize NaN sNaN -> NaN Invalid_operation
+ddqua650 quantize -Inf sNaN -> NaN Invalid_operation
+ddqua651 quantize -1000 sNaN -> NaN Invalid_operation
+ddqua652 quantize -1 sNaN -> NaN Invalid_operation
+ddqua653 quantize 0 sNaN -> NaN Invalid_operation
+ddqua654 quantize 1 sNaN -> NaN Invalid_operation
+ddqua655 quantize 1000 sNaN -> NaN Invalid_operation
+ddqua656 quantize Inf sNaN -> NaN Invalid_operation
+ddqua657 quantize NaN sNaN -> NaN Invalid_operation
+ddqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
+ddqua659 quantize -0 sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddqua661 quantize NaN9 -Inf -> NaN9
+ddqua662 quantize NaN8 919 -> NaN8
+ddqua663 quantize NaN71 Inf -> NaN71
+ddqua664 quantize NaN6 NaN5 -> NaN6
+ddqua665 quantize -Inf NaN4 -> NaN4
+ddqua666 quantize -919 NaN31 -> NaN31
+ddqua667 quantize Inf NaN2 -> NaN2
+
+ddqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
+ddqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
+ddqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
+ddqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
+ddqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
+ddqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
+ddqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
+ddqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
+ddqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
+
+ddqua681 quantize -NaN9 -Inf -> -NaN9
+ddqua682 quantize -NaN8 919 -> -NaN8
+ddqua683 quantize -NaN71 Inf -> -NaN71
+ddqua684 quantize -NaN6 -NaN5 -> -NaN6
+ddqua685 quantize -Inf -NaN4 -> -NaN4
+ddqua686 quantize -919 -NaN31 -> -NaN31
+ddqua687 quantize Inf -NaN2 -> -NaN2
+
+ddqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
+ddqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
+ddqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
+ddqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
+ddqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+ddqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
+ddqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
+ddqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
+ddqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
+
+-- subnormals and underflow
+ddqua710 quantize 1.00E-383 1e-383 -> 1E-383 Rounded
+ddqua711 quantize 0.1E-383 2e-384 -> 1E-384 Subnormal
+ddqua712 quantize 0.10E-383 3e-384 -> 1E-384 Subnormal Rounded
+ddqua713 quantize 0.100E-383 4e-384 -> 1E-384 Subnormal Rounded
+ddqua714 quantize 0.01E-383 5e-385 -> 1E-385 Subnormal
+-- next is rounded to Emin
+ddqua715 quantize 0.999E-383 1e-383 -> 1E-383 Inexact Rounded
+ddqua716 quantize 0.099E-383 10e-384 -> 1E-384 Inexact Rounded Subnormal
+
+ddqua717 quantize 0.009E-383 1e-385 -> 1E-385 Inexact Rounded Subnormal
+ddqua718 quantize 0.001E-383 1e-385 -> 0E-385 Inexact Rounded
+ddqua719 quantize 0.0009E-383 1e-385 -> 0E-385 Inexact Rounded
+ddqua720 quantize 0.0001E-383 1e-385 -> 0E-385 Inexact Rounded
+
+ddqua730 quantize -1.00E-383 1e-383 -> -1E-383 Rounded
+ddqua731 quantize -0.1E-383 1e-383 -> -0E-383 Rounded Inexact
+ddqua732 quantize -0.10E-383 1e-383 -> -0E-383 Rounded Inexact
+ddqua733 quantize -0.100E-383 1e-383 -> -0E-383 Rounded Inexact
+ddqua734 quantize -0.01E-383 1e-383 -> -0E-383 Inexact Rounded
+-- next is rounded to Emin
+ddqua735 quantize -0.999E-383 90e-383 -> -1E-383 Inexact Rounded
+ddqua736 quantize -0.099E-383 -1e-383 -> -0E-383 Inexact Rounded
+ddqua737 quantize -0.009E-383 -1e-383 -> -0E-383 Inexact Rounded
+ddqua738 quantize -0.001E-383 -0e-383 -> -0E-383 Inexact Rounded
+ddqua739 quantize -0.0001E-383 0e-383 -> -0E-383 Inexact Rounded
+
+ddqua740 quantize -1.00E-383 1e-384 -> -1.0E-383 Rounded
+ddqua741 quantize -0.1E-383 1e-384 -> -1E-384 Subnormal
+ddqua742 quantize -0.10E-383 1e-384 -> -1E-384 Subnormal Rounded
+ddqua743 quantize -0.100E-383 1e-384 -> -1E-384 Subnormal Rounded
+ddqua744 quantize -0.01E-383 1e-384 -> -0E-384 Inexact Rounded
+-- next is rounded to Emin
+ddqua745 quantize -0.999E-383 1e-384 -> -1.0E-383 Inexact Rounded
+ddqua746 quantize -0.099E-383 1e-384 -> -1E-384 Inexact Rounded Subnormal
+ddqua747 quantize -0.009E-383 1e-384 -> -0E-384 Inexact Rounded
+ddqua748 quantize -0.001E-383 1e-384 -> -0E-384 Inexact Rounded
+ddqua749 quantize -0.0001E-383 1e-384 -> -0E-384 Inexact Rounded
+
+ddqua750 quantize -1.00E-383 1e-385 -> -1.00E-383
+ddqua751 quantize -0.1E-383 1e-385 -> -1.0E-384 Subnormal
+ddqua752 quantize -0.10E-383 1e-385 -> -1.0E-384 Subnormal
+ddqua753 quantize -0.100E-383 1e-385 -> -1.0E-384 Subnormal Rounded
+ddqua754 quantize -0.01E-383 1e-385 -> -1E-385 Subnormal
+-- next is rounded to Emin
+ddqua755 quantize -0.999E-383 1e-385 -> -1.00E-383 Inexact Rounded
+ddqua756 quantize -0.099E-383 1e-385 -> -1.0E-384 Inexact Rounded Subnormal
+ddqua757 quantize -0.009E-383 1e-385 -> -1E-385 Inexact Rounded Subnormal
+ddqua758 quantize -0.001E-383 1e-385 -> -0E-385 Inexact Rounded
+ddqua759 quantize -0.0001E-383 1e-385 -> -0E-385 Inexact Rounded
+
+ddqua760 quantize -1.00E-383 1e-386 -> -1.000E-383
+ddqua761 quantize -0.1E-383 1e-386 -> -1.00E-384 Subnormal
+ddqua762 quantize -0.10E-383 1e-386 -> -1.00E-384 Subnormal
+ddqua763 quantize -0.100E-383 1e-386 -> -1.00E-384 Subnormal
+ddqua764 quantize -0.01E-383 1e-386 -> -1.0E-385 Subnormal
+ddqua765 quantize -0.999E-383 1e-386 -> -9.99E-384 Subnormal
+ddqua766 quantize -0.099E-383 1e-386 -> -9.9E-385 Subnormal
+ddqua767 quantize -0.009E-383 1e-386 -> -9E-386 Subnormal
+ddqua768 quantize -0.001E-383 1e-386 -> -1E-386 Subnormal
+ddqua769 quantize -0.0001E-383 1e-386 -> -0E-386 Inexact Rounded
+
+-- More from Fung Lee
+ddqua1021 quantize 8.666666666666000E+384 1.000000000000000E+384 -> 8.666666666666000E+384
+ddqua1022 quantize -8.666666666666000E+384 1.000000000000000E+384 -> -8.666666666666000E+384
+ddqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
+ddqua1029 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
+
+
+--ddqua1030 quantize 8.666666666666000E+384 1E+384 -> 9.000000000000000E+384 Rounded Inexact
+--ddqua1031 quantize 8.666666666666000E+384 1E+384 -> 8.666666666666000E+384 Rounded
+--ddqua1032 quantize 8.666666666666000E+384 1E+383 -> 8.666666666666000E+384 Rounded
+--ddqua1033 quantize 8.666666666666000E+384 1E+382 -> 8.666666666666000E+384 Rounded
+--ddqua1034 quantize 8.666666666666000E+384 1E+381 -> 8.666666666666000E+384 Rounded
+--ddqua1035 quantize 8.666666666666000E+384 1E+380 -> 8.666666666666000E+384 Rounded
+
+-- Int and uInt32 edge values for testing conversions
+ddqua1040 quantize -2147483646 0 -> -2147483646
+ddqua1041 quantize -2147483647 0 -> -2147483647
+ddqua1042 quantize -2147483648 0 -> -2147483648
+ddqua1043 quantize -2147483649 0 -> -2147483649
+ddqua1044 quantize 2147483646 0 -> 2147483646
+ddqua1045 quantize 2147483647 0 -> 2147483647
+ddqua1046 quantize 2147483648 0 -> 2147483648
+ddqua1047 quantize 2147483649 0 -> 2147483649
+ddqua1048 quantize 4294967294 0 -> 4294967294
+ddqua1049 quantize 4294967295 0 -> 4294967295
+ddqua1050 quantize 4294967296 0 -> 4294967296
+ddqua1051 quantize 4294967297 0 -> 4294967297
+
+-- Rounding swathe
+rounding: half_even
+ddqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+ddqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: half_up
+ddqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+ddqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+ddqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: half_down
+ddqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+ddqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: up
+ddqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
+ddqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
+ddqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+ddqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+ddqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+ddqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
+
+rounding: down
+ddqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+ddqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
+ddqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+ddqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
+ddqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
+ddqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
+ddqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
+
+rounding: ceiling
+ddqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
+ddqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
+ddqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+ddqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+ddqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+ddqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
+
+rounding: floor
+ddqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+ddqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
+ddqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+ddqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
+ddqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
+ddqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
+ddqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
+
+rounding: 05up
+ddqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
+ddqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
+ddqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
+ddqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
+ddqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
+ddqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
+ddqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
+ddqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
+ddqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
+
+ddqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
+ddqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
+ddqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
+ddqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
+ddqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
+ddqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
+ddqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
+ddqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
+ddqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
+
+ddqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
+ddqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
+ddqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
+ddqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+ddqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
+ddqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
+ddqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
+ddqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
+
+ddqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
+ddqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
+ddqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
+ddqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
+ddqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
+ddqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
+ddqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
+ddqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
+ddqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
+
+ddqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
+ddqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
+ddqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
+ddqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
+ddqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
+ddqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
+ddqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
+ddqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
+ddqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
+
+ddqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
+ddqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
+ddqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
+ddqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
+ddqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
+ddqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
+ddqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
+ddqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
+ddqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
+
+-- Null tests
+rounding: half_even
+ddqua998 quantize 10 # -> NaN Invalid_operation
+ddqua999 quantize # 1e10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddReduce.decTest b/Lib/test/decimaltestdata/ddReduce.decTest
index 9529e50a75..bdfd060492 100644
--- a/Lib/test/decimaltestdata/ddReduce.decTest
+++ b/Lib/test/decimaltestdata/ddReduce.decTest
@@ -1,182 +1,182 @@
-------------------------------------------------------------------------
--- ddReduce.decTest -- remove trailing zeros from a decDouble --
--- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddred001 reduce '1' -> '1'
-ddred002 reduce '-1' -> '-1'
-ddred003 reduce '1.00' -> '1'
-ddred004 reduce '-1.00' -> '-1'
-ddred005 reduce '0' -> '0'
-ddred006 reduce '0.00' -> '0'
-ddred007 reduce '00.0' -> '0'
-ddred008 reduce '00.00' -> '0'
-ddred009 reduce '00' -> '0'
-ddred010 reduce '0E+1' -> '0'
-ddred011 reduce '0E+5' -> '0'
-
-ddred012 reduce '-2' -> '-2'
-ddred013 reduce '2' -> '2'
-ddred014 reduce '-2.00' -> '-2'
-ddred015 reduce '2.00' -> '2'
-ddred016 reduce '-0' -> '-0'
-ddred017 reduce '-0.00' -> '-0'
-ddred018 reduce '-00.0' -> '-0'
-ddred019 reduce '-00.00' -> '-0'
-ddred020 reduce '-00' -> '-0'
-ddred021 reduce '-0E+5' -> '-0'
-ddred022 reduce '-0E+1' -> '-0'
-
-ddred030 reduce '+0.1' -> '0.1'
-ddred031 reduce '-0.1' -> '-0.1'
-ddred032 reduce '+0.01' -> '0.01'
-ddred033 reduce '-0.01' -> '-0.01'
-ddred034 reduce '+0.001' -> '0.001'
-ddred035 reduce '-0.001' -> '-0.001'
-ddred036 reduce '+0.000001' -> '0.000001'
-ddred037 reduce '-0.000001' -> '-0.000001'
-ddred038 reduce '+0.000000000001' -> '1E-12'
-ddred039 reduce '-0.000000000001' -> '-1E-12'
-
-ddred041 reduce 1.1 -> 1.1
-ddred042 reduce 1.10 -> 1.1
-ddred043 reduce 1.100 -> 1.1
-ddred044 reduce 1.110 -> 1.11
-ddred045 reduce -1.1 -> -1.1
-ddred046 reduce -1.10 -> -1.1
-ddred047 reduce -1.100 -> -1.1
-ddred048 reduce -1.110 -> -1.11
-ddred049 reduce 9.9 -> 9.9
-ddred050 reduce 9.90 -> 9.9
-ddred051 reduce 9.900 -> 9.9
-ddred052 reduce 9.990 -> 9.99
-ddred053 reduce -9.9 -> -9.9
-ddred054 reduce -9.90 -> -9.9
-ddred055 reduce -9.900 -> -9.9
-ddred056 reduce -9.990 -> -9.99
-
--- some trailing fractional zeros with zeros in units
-ddred060 reduce 10.0 -> 1E+1
-ddred061 reduce 10.00 -> 1E+1
-ddred062 reduce 100.0 -> 1E+2
-ddred063 reduce 100.00 -> 1E+2
-ddred064 reduce 1.1000E+3 -> 1.1E+3
-ddred065 reduce 1.10000E+3 -> 1.1E+3
-ddred066 reduce -10.0 -> -1E+1
-ddred067 reduce -10.00 -> -1E+1
-ddred068 reduce -100.0 -> -1E+2
-ddred069 reduce -100.00 -> -1E+2
-ddred070 reduce -1.1000E+3 -> -1.1E+3
-ddred071 reduce -1.10000E+3 -> -1.1E+3
-
--- some insignificant trailing zeros with positive exponent
-ddred080 reduce 10E+1 -> 1E+2
-ddred081 reduce 100E+1 -> 1E+3
-ddred082 reduce 1.0E+2 -> 1E+2
-ddred083 reduce 1.0E+3 -> 1E+3
-ddred084 reduce 1.1E+3 -> 1.1E+3
-ddred085 reduce 1.00E+3 -> 1E+3
-ddred086 reduce 1.10E+3 -> 1.1E+3
-ddred087 reduce -10E+1 -> -1E+2
-ddred088 reduce -100E+1 -> -1E+3
-ddred089 reduce -1.0E+2 -> -1E+2
-ddred090 reduce -1.0E+3 -> -1E+3
-ddred091 reduce -1.1E+3 -> -1.1E+3
-ddred092 reduce -1.00E+3 -> -1E+3
-ddred093 reduce -1.10E+3 -> -1.1E+3
-
--- some significant trailing zeros, were we to be trimming
-ddred100 reduce 11 -> 11
-ddred101 reduce 10 -> 1E+1
-ddred102 reduce 10. -> 1E+1
-ddred103 reduce 1.1E+1 -> 11
-ddred104 reduce 1.0E+1 -> 1E+1
-ddred105 reduce 1.10E+2 -> 1.1E+2
-ddred106 reduce 1.00E+2 -> 1E+2
-ddred107 reduce 1.100E+3 -> 1.1E+3
-ddred108 reduce 1.000E+3 -> 1E+3
-ddred109 reduce 1.000000E+6 -> 1E+6
-ddred110 reduce -11 -> -11
-ddred111 reduce -10 -> -1E+1
-ddred112 reduce -10. -> -1E+1
-ddred113 reduce -1.1E+1 -> -11
-ddred114 reduce -1.0E+1 -> -1E+1
-ddred115 reduce -1.10E+2 -> -1.1E+2
-ddred116 reduce -1.00E+2 -> -1E+2
-ddred117 reduce -1.100E+3 -> -1.1E+3
-ddred118 reduce -1.000E+3 -> -1E+3
-ddred119 reduce -1.00000E+5 -> -1E+5
-ddred120 reduce -1.000000E+6 -> -1E+6
-ddred121 reduce -10.00000E+6 -> -1E+7
-ddred122 reduce -100.0000E+6 -> -1E+8
-ddred123 reduce -1000.000E+6 -> -1E+9
-ddred124 reduce -10000.00E+6 -> -1E+10
-ddred125 reduce -100000.0E+6 -> -1E+11
-ddred126 reduce -1000000.E+6 -> -1E+12
-
--- examples from decArith
-ddred140 reduce '2.1' -> '2.1'
-ddred141 reduce '-2.0' -> '-2'
-ddred142 reduce '1.200' -> '1.2'
-ddred143 reduce '-120' -> '-1.2E+2'
-ddred144 reduce '120.00' -> '1.2E+2'
-ddred145 reduce '0.00' -> '0'
-
--- Nmax, Nmin, Ntiny
--- note origami effect on some of these
-ddred151 reduce 9.999999999999999E+384 -> 9.999999999999999E+384
-ddred152 reduce 9.999999000000000E+380 -> 9.99999900000E+380
-ddred153 reduce 9.999999999990000E+384 -> 9.999999999990000E+384
-ddred154 reduce 1E-383 -> 1E-383
-ddred155 reduce 1.000000000000000E-383 -> 1E-383
-ddred156 reduce 2.000E-395 -> 2E-395 Subnormal
-ddred157 reduce 1E-398 -> 1E-398 Subnormal
-
-ddred161 reduce -1E-398 -> -1E-398 Subnormal
-ddred162 reduce -2.000E-395 -> -2E-395 Subnormal
-ddred163 reduce -1.000000000000000E-383 -> -1E-383
-ddred164 reduce -1E-383 -> -1E-383
-ddred165 reduce -9.999999000000000E+380 -> -9.99999900000E+380
-ddred166 reduce -9.999999999990000E+384 -> -9.999999999990000E+384
-ddred167 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
-ddred168 reduce -9.999999999999999E+384 -> -9.999999999999999E+384
-ddred169 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
-
-
--- specials (reduce does not affect payload)
-ddred820 reduce 'Inf' -> 'Infinity'
-ddred821 reduce '-Inf' -> '-Infinity'
-ddred822 reduce NaN -> NaN
-ddred823 reduce sNaN -> NaN Invalid_operation
-ddred824 reduce NaN101 -> NaN101
-ddred825 reduce sNaN010 -> NaN10 Invalid_operation
-ddred827 reduce -NaN -> -NaN
-ddred828 reduce -sNaN -> -NaN Invalid_operation
-ddred829 reduce -NaN101 -> -NaN101
-ddred830 reduce -sNaN010 -> -NaN10 Invalid_operation
-
--- Null test
-ddred900 reduce # -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddReduce.decTest -- remove trailing zeros from a decDouble --
+-- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddred001 reduce '1' -> '1'
+ddred002 reduce '-1' -> '-1'
+ddred003 reduce '1.00' -> '1'
+ddred004 reduce '-1.00' -> '-1'
+ddred005 reduce '0' -> '0'
+ddred006 reduce '0.00' -> '0'
+ddred007 reduce '00.0' -> '0'
+ddred008 reduce '00.00' -> '0'
+ddred009 reduce '00' -> '0'
+ddred010 reduce '0E+1' -> '0'
+ddred011 reduce '0E+5' -> '0'
+
+ddred012 reduce '-2' -> '-2'
+ddred013 reduce '2' -> '2'
+ddred014 reduce '-2.00' -> '-2'
+ddred015 reduce '2.00' -> '2'
+ddred016 reduce '-0' -> '-0'
+ddred017 reduce '-0.00' -> '-0'
+ddred018 reduce '-00.0' -> '-0'
+ddred019 reduce '-00.00' -> '-0'
+ddred020 reduce '-00' -> '-0'
+ddred021 reduce '-0E+5' -> '-0'
+ddred022 reduce '-0E+1' -> '-0'
+
+ddred030 reduce '+0.1' -> '0.1'
+ddred031 reduce '-0.1' -> '-0.1'
+ddred032 reduce '+0.01' -> '0.01'
+ddred033 reduce '-0.01' -> '-0.01'
+ddred034 reduce '+0.001' -> '0.001'
+ddred035 reduce '-0.001' -> '-0.001'
+ddred036 reduce '+0.000001' -> '0.000001'
+ddred037 reduce '-0.000001' -> '-0.000001'
+ddred038 reduce '+0.000000000001' -> '1E-12'
+ddred039 reduce '-0.000000000001' -> '-1E-12'
+
+ddred041 reduce 1.1 -> 1.1
+ddred042 reduce 1.10 -> 1.1
+ddred043 reduce 1.100 -> 1.1
+ddred044 reduce 1.110 -> 1.11
+ddred045 reduce -1.1 -> -1.1
+ddred046 reduce -1.10 -> -1.1
+ddred047 reduce -1.100 -> -1.1
+ddred048 reduce -1.110 -> -1.11
+ddred049 reduce 9.9 -> 9.9
+ddred050 reduce 9.90 -> 9.9
+ddred051 reduce 9.900 -> 9.9
+ddred052 reduce 9.990 -> 9.99
+ddred053 reduce -9.9 -> -9.9
+ddred054 reduce -9.90 -> -9.9
+ddred055 reduce -9.900 -> -9.9
+ddred056 reduce -9.990 -> -9.99
+
+-- some trailing fractional zeros with zeros in units
+ddred060 reduce 10.0 -> 1E+1
+ddred061 reduce 10.00 -> 1E+1
+ddred062 reduce 100.0 -> 1E+2
+ddred063 reduce 100.00 -> 1E+2
+ddred064 reduce 1.1000E+3 -> 1.1E+3
+ddred065 reduce 1.10000E+3 -> 1.1E+3
+ddred066 reduce -10.0 -> -1E+1
+ddred067 reduce -10.00 -> -1E+1
+ddred068 reduce -100.0 -> -1E+2
+ddred069 reduce -100.00 -> -1E+2
+ddred070 reduce -1.1000E+3 -> -1.1E+3
+ddred071 reduce -1.10000E+3 -> -1.1E+3
+
+-- some insignificant trailing zeros with positive exponent
+ddred080 reduce 10E+1 -> 1E+2
+ddred081 reduce 100E+1 -> 1E+3
+ddred082 reduce 1.0E+2 -> 1E+2
+ddred083 reduce 1.0E+3 -> 1E+3
+ddred084 reduce 1.1E+3 -> 1.1E+3
+ddred085 reduce 1.00E+3 -> 1E+3
+ddred086 reduce 1.10E+3 -> 1.1E+3
+ddred087 reduce -10E+1 -> -1E+2
+ddred088 reduce -100E+1 -> -1E+3
+ddred089 reduce -1.0E+2 -> -1E+2
+ddred090 reduce -1.0E+3 -> -1E+3
+ddred091 reduce -1.1E+3 -> -1.1E+3
+ddred092 reduce -1.00E+3 -> -1E+3
+ddred093 reduce -1.10E+3 -> -1.1E+3
+
+-- some significant trailing zeros, were we to be trimming
+ddred100 reduce 11 -> 11
+ddred101 reduce 10 -> 1E+1
+ddred102 reduce 10. -> 1E+1
+ddred103 reduce 1.1E+1 -> 11
+ddred104 reduce 1.0E+1 -> 1E+1
+ddred105 reduce 1.10E+2 -> 1.1E+2
+ddred106 reduce 1.00E+2 -> 1E+2
+ddred107 reduce 1.100E+3 -> 1.1E+3
+ddred108 reduce 1.000E+3 -> 1E+3
+ddred109 reduce 1.000000E+6 -> 1E+6
+ddred110 reduce -11 -> -11
+ddred111 reduce -10 -> -1E+1
+ddred112 reduce -10. -> -1E+1
+ddred113 reduce -1.1E+1 -> -11
+ddred114 reduce -1.0E+1 -> -1E+1
+ddred115 reduce -1.10E+2 -> -1.1E+2
+ddred116 reduce -1.00E+2 -> -1E+2
+ddred117 reduce -1.100E+3 -> -1.1E+3
+ddred118 reduce -1.000E+3 -> -1E+3
+ddred119 reduce -1.00000E+5 -> -1E+5
+ddred120 reduce -1.000000E+6 -> -1E+6
+ddred121 reduce -10.00000E+6 -> -1E+7
+ddred122 reduce -100.0000E+6 -> -1E+8
+ddred123 reduce -1000.000E+6 -> -1E+9
+ddred124 reduce -10000.00E+6 -> -1E+10
+ddred125 reduce -100000.0E+6 -> -1E+11
+ddred126 reduce -1000000.E+6 -> -1E+12
+
+-- examples from decArith
+ddred140 reduce '2.1' -> '2.1'
+ddred141 reduce '-2.0' -> '-2'
+ddred142 reduce '1.200' -> '1.2'
+ddred143 reduce '-120' -> '-1.2E+2'
+ddred144 reduce '120.00' -> '1.2E+2'
+ddred145 reduce '0.00' -> '0'
+
+-- Nmax, Nmin, Ntiny
+-- note origami effect on some of these
+ddred151 reduce 9.999999999999999E+384 -> 9.999999999999999E+384
+ddred152 reduce 9.999999000000000E+380 -> 9.99999900000E+380
+ddred153 reduce 9.999999999990000E+384 -> 9.999999999990000E+384
+ddred154 reduce 1E-383 -> 1E-383
+ddred155 reduce 1.000000000000000E-383 -> 1E-383
+ddred156 reduce 2.000E-395 -> 2E-395 Subnormal
+ddred157 reduce 1E-398 -> 1E-398 Subnormal
+
+ddred161 reduce -1E-398 -> -1E-398 Subnormal
+ddred162 reduce -2.000E-395 -> -2E-395 Subnormal
+ddred163 reduce -1.000000000000000E-383 -> -1E-383
+ddred164 reduce -1E-383 -> -1E-383
+ddred165 reduce -9.999999000000000E+380 -> -9.99999900000E+380
+ddred166 reduce -9.999999999990000E+384 -> -9.999999999990000E+384
+ddred167 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
+ddred168 reduce -9.999999999999999E+384 -> -9.999999999999999E+384
+ddred169 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
+
+
+-- specials (reduce does not affect payload)
+ddred820 reduce 'Inf' -> 'Infinity'
+ddred821 reduce '-Inf' -> '-Infinity'
+ddred822 reduce NaN -> NaN
+ddred823 reduce sNaN -> NaN Invalid_operation
+ddred824 reduce NaN101 -> NaN101
+ddred825 reduce sNaN010 -> NaN10 Invalid_operation
+ddred827 reduce -NaN -> -NaN
+ddred828 reduce -sNaN -> -NaN Invalid_operation
+ddred829 reduce -NaN101 -> -NaN101
+ddred830 reduce -sNaN010 -> -NaN10 Invalid_operation
+
+-- Null test
+ddred900 reduce # -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddRemainder.decTest b/Lib/test/decimaltestdata/ddRemainder.decTest
index 85d86f9457..5bd1e32d01 100644
--- a/Lib/test/decimaltestdata/ddRemainder.decTest
+++ b/Lib/test/decimaltestdata/ddRemainder.decTest
@@ -1,600 +1,600 @@
-------------------------------------------------------------------------
--- ddRemainder.decTest -- decDouble remainder --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks (as base, above)
-ddrem001 remainder 1 1 -> 0
-ddrem002 remainder 2 1 -> 0
-ddrem003 remainder 1 2 -> 1
-ddrem004 remainder 2 2 -> 0
-ddrem005 remainder 0 1 -> 0
-ddrem006 remainder 0 2 -> 0
-ddrem007 remainder 1 3 -> 1
-ddrem008 remainder 2 3 -> 2
-ddrem009 remainder 3 3 -> 0
-
-ddrem010 remainder 2.4 1 -> 0.4
-ddrem011 remainder 2.4 -1 -> 0.4
-ddrem012 remainder -2.4 1 -> -0.4
-ddrem013 remainder -2.4 -1 -> -0.4
-ddrem014 remainder 2.40 1 -> 0.40
-ddrem015 remainder 2.400 1 -> 0.400
-ddrem016 remainder 2.4 2 -> 0.4
-ddrem017 remainder 2.400 2 -> 0.400
-ddrem018 remainder 2. 2 -> 0
-ddrem019 remainder 20 20 -> 0
-
-ddrem020 remainder 187 187 -> 0
-ddrem021 remainder 5 2 -> 1
-ddrem022 remainder 5 2.0 -> 1.0
-ddrem023 remainder 5 2.000 -> 1.000
-ddrem024 remainder 5 0.200 -> 0.000
-ddrem025 remainder 5 0.200 -> 0.000
-
-ddrem030 remainder 1 2 -> 1
-ddrem031 remainder 1 4 -> 1
-ddrem032 remainder 1 8 -> 1
-
-ddrem033 remainder 1 16 -> 1
-ddrem034 remainder 1 32 -> 1
-ddrem035 remainder 1 64 -> 1
-ddrem040 remainder 1 -2 -> 1
-ddrem041 remainder 1 -4 -> 1
-ddrem042 remainder 1 -8 -> 1
-ddrem043 remainder 1 -16 -> 1
-ddrem044 remainder 1 -32 -> 1
-ddrem045 remainder 1 -64 -> 1
-ddrem050 remainder -1 2 -> -1
-ddrem051 remainder -1 4 -> -1
-ddrem052 remainder -1 8 -> -1
-ddrem053 remainder -1 16 -> -1
-ddrem054 remainder -1 32 -> -1
-ddrem055 remainder -1 64 -> -1
-ddrem060 remainder -1 -2 -> -1
-ddrem061 remainder -1 -4 -> -1
-ddrem062 remainder -1 -8 -> -1
-ddrem063 remainder -1 -16 -> -1
-ddrem064 remainder -1 -32 -> -1
-ddrem065 remainder -1 -64 -> -1
-
-ddrem066 remainder 999999999 1 -> 0
-ddrem067 remainder 999999999.4 1 -> 0.4
-ddrem068 remainder 999999999.5 1 -> 0.5
-ddrem069 remainder 999999999.9 1 -> 0.9
-ddrem070 remainder 999999999.999 1 -> 0.999
-ddrem071 remainder 999999.999999 1 -> 0.999999
-ddrem072 remainder 9 1 -> 0
-ddrem073 remainder 9999999999999999 1 -> 0
-ddrem074 remainder 9999999999999999 2 -> 1
-ddrem075 remainder 9999999999999999 3 -> 0
-ddrem076 remainder 9999999999999999 4 -> 3
-
-ddrem080 remainder 0. 1 -> 0
-ddrem081 remainder .0 1 -> 0.0
-ddrem082 remainder 0.00 1 -> 0.00
-ddrem083 remainder 0.00E+9 1 -> 0
-ddrem084 remainder 0.00E+3 1 -> 0
-ddrem085 remainder 0.00E+2 1 -> 0
-ddrem086 remainder 0.00E+1 1 -> 0.0
-ddrem087 remainder 0.00E+0 1 -> 0.00
-ddrem088 remainder 0.00E-0 1 -> 0.00
-ddrem089 remainder 0.00E-1 1 -> 0.000
-ddrem090 remainder 0.00E-2 1 -> 0.0000
-ddrem091 remainder 0.00E-3 1 -> 0.00000
-ddrem092 remainder 0.00E-4 1 -> 0.000000
-ddrem093 remainder 0.00E-5 1 -> 0E-7
-ddrem094 remainder 0.00E-6 1 -> 0E-8
-ddrem095 remainder 0.0000E-50 1 -> 0E-54
-
--- Various flavours of remainder by 0
-ddrem101 remainder 0 0 -> NaN Division_undefined
-ddrem102 remainder 0 -0 -> NaN Division_undefined
-ddrem103 remainder -0 0 -> NaN Division_undefined
-ddrem104 remainder -0 -0 -> NaN Division_undefined
-ddrem105 remainder 0.0E5 0 -> NaN Division_undefined
-ddrem106 remainder 0.000 0 -> NaN Division_undefined
--- [Some think this next group should be Division_by_zero exception, but
--- IEEE 854 is explicit that it is Invalid operation .. for
--- remainder-near, anyway]
-ddrem107 remainder 0.0001 0 -> NaN Invalid_operation
-ddrem108 remainder 0.01 0 -> NaN Invalid_operation
-ddrem109 remainder 0.1 0 -> NaN Invalid_operation
-ddrem110 remainder 1 0 -> NaN Invalid_operation
-ddrem111 remainder 1 0.0 -> NaN Invalid_operation
-ddrem112 remainder 10 0.0 -> NaN Invalid_operation
-ddrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
-ddrem114 remainder 1E+380 0 -> NaN Invalid_operation
-ddrem115 remainder 0.0001 -0 -> NaN Invalid_operation
-ddrem116 remainder 0.01 -0 -> NaN Invalid_operation
-ddrem119 remainder 0.1 -0 -> NaN Invalid_operation
-ddrem120 remainder 1 -0 -> NaN Invalid_operation
-ddrem121 remainder 1 -0.0 -> NaN Invalid_operation
-ddrem122 remainder 10 -0.0 -> NaN Invalid_operation
-ddrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
-ddrem124 remainder 1E+384 -0 -> NaN Invalid_operation
--- and zeros on left
-ddrem130 remainder 0 1 -> 0
-ddrem131 remainder 0 -1 -> 0
-ddrem132 remainder 0.0 1 -> 0.0
-ddrem133 remainder 0.0 -1 -> 0.0
-ddrem134 remainder -0 1 -> -0
-ddrem135 remainder -0 -1 -> -0
-ddrem136 remainder -0.0 1 -> -0.0
-ddrem137 remainder -0.0 -1 -> -0.0
-
--- 0.5ers
-ddrem143 remainder 0.5 2 -> 0.5
-ddrem144 remainder 0.5 2.1 -> 0.5
-ddrem145 remainder 0.5 2.01 -> 0.50
-ddrem146 remainder 0.5 2.001 -> 0.500
-ddrem147 remainder 0.50 2 -> 0.50
-ddrem148 remainder 0.50 2.01 -> 0.50
-ddrem149 remainder 0.50 2.001 -> 0.500
-
--- steadies
-ddrem150 remainder 1 1 -> 0
-ddrem151 remainder 1 2 -> 1
-ddrem152 remainder 1 3 -> 1
-ddrem153 remainder 1 4 -> 1
-ddrem154 remainder 1 5 -> 1
-ddrem155 remainder 1 6 -> 1
-ddrem156 remainder 1 7 -> 1
-ddrem157 remainder 1 8 -> 1
-ddrem158 remainder 1 9 -> 1
-ddrem159 remainder 1 10 -> 1
-ddrem160 remainder 1 1 -> 0
-ddrem161 remainder 2 1 -> 0
-ddrem162 remainder 3 1 -> 0
-ddrem163 remainder 4 1 -> 0
-ddrem164 remainder 5 1 -> 0
-ddrem165 remainder 6 1 -> 0
-ddrem166 remainder 7 1 -> 0
-ddrem167 remainder 8 1 -> 0
-ddrem168 remainder 9 1 -> 0
-ddrem169 remainder 10 1 -> 0
-
--- some differences from remainderNear
-ddrem171 remainder 0.4 1.020 -> 0.400
-ddrem172 remainder 0.50 1.020 -> 0.500
-ddrem173 remainder 0.51 1.020 -> 0.510
-ddrem174 remainder 0.52 1.020 -> 0.520
-ddrem175 remainder 0.6 1.020 -> 0.600
-
--- More flavours of remainder by 0
-ddrem201 remainder 0 0 -> NaN Division_undefined
-ddrem202 remainder 0.0E5 0 -> NaN Division_undefined
-ddrem203 remainder 0.000 0 -> NaN Division_undefined
-ddrem204 remainder 0.0001 0 -> NaN Invalid_operation
-ddrem205 remainder 0.01 0 -> NaN Invalid_operation
-ddrem206 remainder 0.1 0 -> NaN Invalid_operation
-ddrem207 remainder 1 0 -> NaN Invalid_operation
-ddrem208 remainder 1 0.0 -> NaN Invalid_operation
-ddrem209 remainder 10 0.0 -> NaN Invalid_operation
-ddrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
-ddrem211 remainder 1E+380 0 -> NaN Invalid_operation
-
--- some differences from remainderNear
-ddrem231 remainder -0.4 1.020 -> -0.400
-ddrem232 remainder -0.50 1.020 -> -0.500
-ddrem233 remainder -0.51 1.020 -> -0.510
-ddrem234 remainder -0.52 1.020 -> -0.520
-ddrem235 remainder -0.6 1.020 -> -0.600
-
--- high Xs
-ddrem240 remainder 1E+2 1.00 -> 0.00
-
--- ddrem3xx are from DiagBigDecimal
-ddrem301 remainder 1 3 -> 1
-ddrem302 remainder 5 5 -> 0
-ddrem303 remainder 13 10 -> 3
-ddrem304 remainder 13 50 -> 13
-ddrem305 remainder 13 100 -> 13
-ddrem306 remainder 13 1000 -> 13
-ddrem307 remainder .13 1 -> 0.13
-ddrem308 remainder 0.133 1 -> 0.133
-ddrem309 remainder 0.1033 1 -> 0.1033
-ddrem310 remainder 1.033 1 -> 0.033
-ddrem311 remainder 10.33 1 -> 0.33
-ddrem312 remainder 10.33 10 -> 0.33
-ddrem313 remainder 103.3 1 -> 0.3
-ddrem314 remainder 133 10 -> 3
-ddrem315 remainder 1033 10 -> 3
-ddrem316 remainder 1033 50 -> 33
-ddrem317 remainder 101.0 3 -> 2.0
-ddrem318 remainder 102.0 3 -> 0.0
-ddrem319 remainder 103.0 3 -> 1.0
-ddrem320 remainder 2.40 1 -> 0.40
-ddrem321 remainder 2.400 1 -> 0.400
-ddrem322 remainder 2.4 1 -> 0.4
-ddrem323 remainder 2.4 2 -> 0.4
-ddrem324 remainder 2.400 2 -> 0.400
-ddrem325 remainder 1 0.3 -> 0.1
-ddrem326 remainder 1 0.30 -> 0.10
-ddrem327 remainder 1 0.300 -> 0.100
-ddrem328 remainder 1 0.3000 -> 0.1000
-ddrem329 remainder 1.0 0.3 -> 0.1
-ddrem330 remainder 1.00 0.3 -> 0.10
-ddrem331 remainder 1.000 0.3 -> 0.100
-ddrem332 remainder 1.0000 0.3 -> 0.1000
-ddrem333 remainder 0.5 2 -> 0.5
-ddrem334 remainder 0.5 2.1 -> 0.5
-ddrem335 remainder 0.5 2.01 -> 0.50
-ddrem336 remainder 0.5 2.001 -> 0.500
-ddrem337 remainder 0.50 2 -> 0.50
-ddrem338 remainder 0.50 2.01 -> 0.50
-ddrem339 remainder 0.50 2.001 -> 0.500
-
-ddrem340 remainder 0.5 0.5000001 -> 0.5000000
-ddrem341 remainder 0.5 0.50000001 -> 0.50000000
-ddrem342 remainder 0.5 0.500000001 -> 0.500000000
-ddrem343 remainder 0.5 0.5000000001 -> 0.5000000000
-ddrem344 remainder 0.5 0.50000000001 -> 0.50000000000
-ddrem345 remainder 0.5 0.4999999 -> 1E-7
-ddrem346 remainder 0.5 0.49999999 -> 1E-8
-ddrem347 remainder 0.5 0.499999999 -> 1E-9
-ddrem348 remainder 0.5 0.4999999999 -> 1E-10
-ddrem349 remainder 0.5 0.49999999999 -> 1E-11
-ddrem350 remainder 0.5 0.499999999999 -> 1E-12
-
-ddrem351 remainder 0.03 7 -> 0.03
-ddrem352 remainder 5 2 -> 1
-ddrem353 remainder 4.1 2 -> 0.1
-ddrem354 remainder 4.01 2 -> 0.01
-ddrem355 remainder 4.001 2 -> 0.001
-ddrem356 remainder 4.0001 2 -> 0.0001
-ddrem357 remainder 4.00001 2 -> 0.00001
-ddrem358 remainder 4.000001 2 -> 0.000001
-ddrem359 remainder 4.0000001 2 -> 1E-7
-
-ddrem360 remainder 1.2 0.7345 -> 0.4655
-ddrem361 remainder 0.8 12 -> 0.8
-ddrem362 remainder 0.8 0.2 -> 0.0
-ddrem363 remainder 0.8 0.3 -> 0.2
-ddrem364 remainder 0.800 12 -> 0.800
-ddrem365 remainder 0.800 1.7 -> 0.800
-ddrem366 remainder 2.400 2 -> 0.400
-
-ddrem371 remainder 2.400 2 -> 0.400
-
-ddrem381 remainder 12345 1 -> 0
-ddrem382 remainder 12345 1.0001 -> 0.7657
-ddrem383 remainder 12345 1.001 -> 0.668
-ddrem384 remainder 12345 1.01 -> 0.78
-ddrem385 remainder 12345 1.1 -> 0.8
-ddrem386 remainder 12355 4 -> 3
-ddrem387 remainder 12345 4 -> 1
-ddrem388 remainder 12355 4.0001 -> 2.6912
-ddrem389 remainder 12345 4.0001 -> 0.6914
-ddrem390 remainder 12345 4.9 -> 1.9
-ddrem391 remainder 12345 4.99 -> 4.73
-ddrem392 remainder 12345 4.999 -> 2.469
-ddrem393 remainder 12345 4.9999 -> 0.2469
-ddrem394 remainder 12345 5 -> 0
-ddrem395 remainder 12345 5.0001 -> 4.7532
-ddrem396 remainder 12345 5.001 -> 2.532
-ddrem397 remainder 12345 5.01 -> 0.36
-ddrem398 remainder 12345 5.1 -> 3.0
-
--- the nasty division-by-1 cases
-ddrem401 remainder 0.5 1 -> 0.5
-ddrem402 remainder 0.55 1 -> 0.55
-ddrem403 remainder 0.555 1 -> 0.555
-ddrem404 remainder 0.5555 1 -> 0.5555
-ddrem405 remainder 0.55555 1 -> 0.55555
-ddrem406 remainder 0.555555 1 -> 0.555555
-ddrem407 remainder 0.5555555 1 -> 0.5555555
-ddrem408 remainder 0.55555555 1 -> 0.55555555
-ddrem409 remainder 0.555555555 1 -> 0.555555555
-
--- folddowns
-ddrem421 remainder 1E+384 1 -> NaN Division_impossible
-ddrem422 remainder 1E+384 1E+383 -> 0E+369 Clamped
-ddrem423 remainder 1E+384 2E+383 -> 0E+369 Clamped
-ddrem424 remainder 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
-ddrem425 remainder 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
-ddrem426 remainder 1E+384 5E+383 -> 0E+369 Clamped
-ddrem427 remainder 1E+384 6E+383 -> 4.00000000000000E+383 Clamped
-ddrem428 remainder 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
-ddrem429 remainder 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
-ddrem430 remainder 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
--- tinies
-ddrem431 remainder 1E-397 1E-398 -> 0E-398
-ddrem432 remainder 1E-397 2E-398 -> 0E-398
-ddrem433 remainder 1E-397 3E-398 -> 1E-398 Subnormal
-ddrem434 remainder 1E-397 4E-398 -> 2E-398 Subnormal
-ddrem435 remainder 1E-397 5E-398 -> 0E-398
-ddrem436 remainder 1E-397 6E-398 -> 4E-398 Subnormal
-ddrem437 remainder 1E-397 7E-398 -> 3E-398 Subnormal
-ddrem438 remainder 1E-397 8E-398 -> 2E-398 Subnormal
-ddrem439 remainder 1E-397 9E-398 -> 1E-398 Subnormal
-ddrem440 remainder 1E-397 10E-398 -> 0E-398
-ddrem441 remainder 1E-397 11E-398 -> 1.0E-397 Subnormal
-ddrem442 remainder 100E-397 11E-398 -> 1.0E-397 Subnormal
-ddrem443 remainder 100E-397 20E-398 -> 0E-398
-ddrem444 remainder 100E-397 21E-398 -> 1.3E-397 Subnormal
-ddrem445 remainder 100E-397 30E-398 -> 1.0E-397 Subnormal
-
--- zero signs
-ddrem650 remainder 1 1 -> 0
-ddrem651 remainder -1 1 -> -0
-ddrem652 remainder 1 -1 -> 0
-ddrem653 remainder -1 -1 -> -0
-ddrem654 remainder 0 1 -> 0
-ddrem655 remainder -0 1 -> -0
-ddrem656 remainder 0 -1 -> 0
-ddrem657 remainder -0 -1 -> -0
-ddrem658 remainder 0.00 1 -> 0.00
-ddrem659 remainder -0.00 1 -> -0.00
-
--- Specials
-ddrem680 remainder Inf -Inf -> NaN Invalid_operation
-ddrem681 remainder Inf -1000 -> NaN Invalid_operation
-ddrem682 remainder Inf -1 -> NaN Invalid_operation
-ddrem683 remainder Inf 0 -> NaN Invalid_operation
-ddrem684 remainder Inf -0 -> NaN Invalid_operation
-ddrem685 remainder Inf 1 -> NaN Invalid_operation
-ddrem686 remainder Inf 1000 -> NaN Invalid_operation
-ddrem687 remainder Inf Inf -> NaN Invalid_operation
-ddrem688 remainder -1000 Inf -> -1000
-ddrem689 remainder -Inf Inf -> NaN Invalid_operation
-ddrem691 remainder -1 Inf -> -1
-ddrem692 remainder 0 Inf -> 0
-ddrem693 remainder -0 Inf -> -0
-ddrem694 remainder 1 Inf -> 1
-ddrem695 remainder 1000 Inf -> 1000
-ddrem696 remainder Inf Inf -> NaN Invalid_operation
-
-ddrem700 remainder -Inf -Inf -> NaN Invalid_operation
-ddrem701 remainder -Inf -1000 -> NaN Invalid_operation
-ddrem702 remainder -Inf -1 -> NaN Invalid_operation
-ddrem703 remainder -Inf -0 -> NaN Invalid_operation
-ddrem704 remainder -Inf 0 -> NaN Invalid_operation
-ddrem705 remainder -Inf 1 -> NaN Invalid_operation
-ddrem706 remainder -Inf 1000 -> NaN Invalid_operation
-ddrem707 remainder -Inf Inf -> NaN Invalid_operation
-ddrem708 remainder -Inf -Inf -> NaN Invalid_operation
-ddrem709 remainder -1000 Inf -> -1000
-ddrem710 remainder -1 -Inf -> -1
-ddrem711 remainder -0 -Inf -> -0
-ddrem712 remainder 0 -Inf -> 0
-ddrem713 remainder 1 -Inf -> 1
-ddrem714 remainder 1000 -Inf -> 1000
-ddrem715 remainder Inf -Inf -> NaN Invalid_operation
-
-ddrem721 remainder NaN -Inf -> NaN
-ddrem722 remainder NaN -1000 -> NaN
-ddrem723 remainder NaN -1 -> NaN
-ddrem724 remainder NaN -0 -> NaN
-ddrem725 remainder -NaN 0 -> -NaN
-ddrem726 remainder NaN 1 -> NaN
-ddrem727 remainder NaN 1000 -> NaN
-ddrem728 remainder NaN Inf -> NaN
-ddrem729 remainder NaN -NaN -> NaN
-ddrem730 remainder -Inf NaN -> NaN
-ddrem731 remainder -1000 NaN -> NaN
-ddrem732 remainder -1 NaN -> NaN
-ddrem733 remainder -0 -NaN -> -NaN
-ddrem734 remainder 0 NaN -> NaN
-ddrem735 remainder 1 -NaN -> -NaN
-ddrem736 remainder 1000 NaN -> NaN
-ddrem737 remainder Inf NaN -> NaN
-
-ddrem741 remainder sNaN -Inf -> NaN Invalid_operation
-ddrem742 remainder sNaN -1000 -> NaN Invalid_operation
-ddrem743 remainder -sNaN -1 -> -NaN Invalid_operation
-ddrem744 remainder sNaN -0 -> NaN Invalid_operation
-ddrem745 remainder sNaN 0 -> NaN Invalid_operation
-ddrem746 remainder sNaN 1 -> NaN Invalid_operation
-ddrem747 remainder sNaN 1000 -> NaN Invalid_operation
-ddrem749 remainder sNaN NaN -> NaN Invalid_operation
-ddrem750 remainder sNaN sNaN -> NaN Invalid_operation
-ddrem751 remainder NaN sNaN -> NaN Invalid_operation
-ddrem752 remainder -Inf sNaN -> NaN Invalid_operation
-ddrem753 remainder -1000 sNaN -> NaN Invalid_operation
-ddrem754 remainder -1 sNaN -> NaN Invalid_operation
-ddrem755 remainder -0 sNaN -> NaN Invalid_operation
-ddrem756 remainder 0 sNaN -> NaN Invalid_operation
-ddrem757 remainder 1 sNaN -> NaN Invalid_operation
-ddrem758 remainder 1000 sNaN -> NaN Invalid_operation
-ddrem759 remainder Inf -sNaN -> -NaN Invalid_operation
-
--- propaging NaNs
-ddrem760 remainder NaN1 NaN7 -> NaN1
-ddrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
-ddrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
-ddrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
-ddrem764 remainder 15 NaN11 -> NaN11
-ddrem765 remainder NaN6 NaN12 -> NaN6
-ddrem766 remainder Inf NaN13 -> NaN13
-ddrem767 remainder NaN14 -Inf -> NaN14
-ddrem768 remainder 0 NaN15 -> NaN15
-ddrem769 remainder NaN16 -0 -> NaN16
-
--- edge cases of impossible
-ddrem770 remainder 1234567890123456 10 -> 6
-ddrem771 remainder 1234567890123456 1 -> 0
-ddrem772 remainder 1234567890123456 0.1 -> NaN Division_impossible
-ddrem773 remainder 1234567890123456 0.01 -> NaN Division_impossible
-
--- long operand checks
-ddrem801 remainder 12345678000 100 -> 0
-ddrem802 remainder 1 12345678000 -> 1
-ddrem803 remainder 1234567800 10 -> 0
-ddrem804 remainder 1 1234567800 -> 1
-ddrem805 remainder 1234567890 10 -> 0
-ddrem806 remainder 1 1234567890 -> 1
-ddrem807 remainder 1234567891 10 -> 1
-ddrem808 remainder 1 1234567891 -> 1
-ddrem809 remainder 12345678901 100 -> 1
-ddrem810 remainder 1 12345678901 -> 1
-ddrem811 remainder 1234567896 10 -> 6
-ddrem812 remainder 1 1234567896 -> 1
-
-ddrem821 remainder 12345678000 100 -> 0
-ddrem822 remainder 1 12345678000 -> 1
-ddrem823 remainder 1234567800 10 -> 0
-ddrem824 remainder 1 1234567800 -> 1
-ddrem825 remainder 1234567890 10 -> 0
-ddrem826 remainder 1 1234567890 -> 1
-ddrem827 remainder 1234567891 10 -> 1
-ddrem828 remainder 1 1234567891 -> 1
-ddrem829 remainder 12345678901 100 -> 1
-ddrem830 remainder 1 12345678901 -> 1
-ddrem831 remainder 1234567896 10 -> 6
-ddrem832 remainder 1 1234567896 -> 1
-
--- from divideint
-ddrem840 remainder 100000000.0 1 -> 0.0
-ddrem841 remainder 100000000.4 1 -> 0.4
-ddrem842 remainder 100000000.5 1 -> 0.5
-ddrem843 remainder 100000000.9 1 -> 0.9
-ddrem844 remainder 100000000.999 1 -> 0.999
-ddrem850 remainder 100000003 5 -> 3
-ddrem851 remainder 10000003 5 -> 3
-ddrem852 remainder 1000003 5 -> 3
-ddrem853 remainder 100003 5 -> 3
-ddrem854 remainder 10003 5 -> 3
-ddrem855 remainder 1003 5 -> 3
-ddrem856 remainder 103 5 -> 3
-ddrem857 remainder 13 5 -> 3
-ddrem858 remainder 1 5 -> 1
-
--- Vladimir's cases 1234567890123456
-ddrem860 remainder 123.0e1 1000000000000000 -> 1230
-ddrem861 remainder 1230 1000000000000000 -> 1230
-ddrem862 remainder 12.3e2 1000000000000000 -> 1230
-ddrem863 remainder 1.23e3 1000000000000000 -> 1230
-ddrem864 remainder 123e1 1000000000000000 -> 1230
-ddrem870 remainder 123e1 1000000000000000 -> 1230
-ddrem871 remainder 123e1 100000000000000 -> 1230
-ddrem872 remainder 123e1 10000000000000 -> 1230
-ddrem873 remainder 123e1 1000000000000 -> 1230
-ddrem874 remainder 123e1 100000000000 -> 1230
-ddrem875 remainder 123e1 10000000000 -> 1230
-ddrem876 remainder 123e1 1000000000 -> 1230
-ddrem877 remainder 123e1 100000000 -> 1230
-ddrem878 remainder 1230 100000000 -> 1230
-ddrem879 remainder 123e1 10000000 -> 1230
-ddrem880 remainder 123e1 1000000 -> 1230
-ddrem881 remainder 123e1 100000 -> 1230
-ddrem882 remainder 123e1 10000 -> 1230
-ddrem883 remainder 123e1 1000 -> 230
-ddrem884 remainder 123e1 100 -> 30
-ddrem885 remainder 123e1 10 -> 0
-ddrem886 remainder 123e1 1 -> 0
-
-ddrem890 remainder 123e1 2000000000000000 -> 1230
-ddrem891 remainder 123e1 200000000000000 -> 1230
-ddrem892 remainder 123e1 20000000000000 -> 1230
-ddrem893 remainder 123e1 2000000000000 -> 1230
-ddrem894 remainder 123e1 200000000000 -> 1230
-ddrem895 remainder 123e1 20000000000 -> 1230
-ddrem896 remainder 123e1 2000000000 -> 1230
-ddrem897 remainder 123e1 200000000 -> 1230
-ddrem899 remainder 123e1 20000000 -> 1230
-ddrem900 remainder 123e1 2000000 -> 1230
-ddrem901 remainder 123e1 200000 -> 1230
-ddrem902 remainder 123e1 20000 -> 1230
-ddrem903 remainder 123e1 2000 -> 1230
-ddrem904 remainder 123e1 200 -> 30
-ddrem905 remainder 123e1 20 -> 10
-ddrem906 remainder 123e1 2 -> 0
-
-ddrem910 remainder 123e1 5000000000000000 -> 1230
-ddrem911 remainder 123e1 500000000000000 -> 1230
-ddrem912 remainder 123e1 50000000000000 -> 1230
-ddrem913 remainder 123e1 5000000000000 -> 1230
-ddrem914 remainder 123e1 500000000000 -> 1230
-ddrem915 remainder 123e1 50000000000 -> 1230
-ddrem916 remainder 123e1 5000000000 -> 1230
-ddrem917 remainder 123e1 500000000 -> 1230
-ddrem919 remainder 123e1 50000000 -> 1230
-ddrem920 remainder 123e1 5000000 -> 1230
-ddrem921 remainder 123e1 500000 -> 1230
-ddrem922 remainder 123e1 50000 -> 1230
-ddrem923 remainder 123e1 5000 -> 1230
-ddrem924 remainder 123e1 500 -> 230
-ddrem925 remainder 123e1 50 -> 30
-ddrem926 remainder 123e1 5 -> 0
-
-ddrem930 remainder 123e1 9000000000000000 -> 1230
-ddrem931 remainder 123e1 900000000000000 -> 1230
-ddrem932 remainder 123e1 90000000000000 -> 1230
-ddrem933 remainder 123e1 9000000000000 -> 1230
-ddrem934 remainder 123e1 900000000000 -> 1230
-ddrem935 remainder 123e1 90000000000 -> 1230
-ddrem936 remainder 123e1 9000000000 -> 1230
-ddrem937 remainder 123e1 900000000 -> 1230
-ddrem939 remainder 123e1 90000000 -> 1230
-ddrem940 remainder 123e1 9000000 -> 1230
-ddrem941 remainder 123e1 900000 -> 1230
-ddrem942 remainder 123e1 90000 -> 1230
-ddrem943 remainder 123e1 9000 -> 1230
-ddrem944 remainder 123e1 900 -> 330
-ddrem945 remainder 123e1 90 -> 60
-ddrem946 remainder 123e1 9 -> 6
-
-ddrem950 remainder 123e1 1000000000000000 -> 1230
-ddrem961 remainder 123e1 2999999999999999 -> 1230
-ddrem962 remainder 123e1 3999999999999999 -> 1230
-ddrem963 remainder 123e1 4999999999999999 -> 1230
-ddrem964 remainder 123e1 5999999999999999 -> 1230
-ddrem965 remainder 123e1 6999999999999999 -> 1230
-ddrem966 remainder 123e1 7999999999999999 -> 1230
-ddrem967 remainder 123e1 8999999999999999 -> 1230
-ddrem968 remainder 123e1 9999999999999999 -> 1230
-ddrem969 remainder 123e1 9876543210987654 -> 1230
-
-ddrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
-
--- overflow and underflow tests [from divide]
-ddrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
-ddrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
-ddrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
-ddrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
-ddrem1055 remainder 1e-277 1e+311 -> 1E-277
-ddrem1056 remainder 1e-277 -1e+311 -> 1E-277
-ddrem1057 remainder -1e-277 1e+311 -> -1E-277
-ddrem1058 remainder -1e-277 -1e+311 -> -1E-277
-
--- destructive subtract
-ddrem1101 remainder 1234567890123456 1.000000000000001 -> 0.765432109876546
-ddrem1102 remainder 1234567890123456 1.00000000000001 -> 0.65432109876557
-ddrem1103 remainder 1234567890123456 1.0000000000001 -> 0.5432109876668
-ddrem1104 remainder 1234567890123455 4.000000000000001 -> 2.691358027469137
-ddrem1105 remainder 1234567890123456 4.000000000000001 -> 3.691358027469137
-ddrem1106 remainder 1234567890123456 4.9999999999999 -> 0.6913578024696
-ddrem1107 remainder 1234567890123456 4.99999999999999 -> 3.46913578024691
-ddrem1108 remainder 1234567890123456 4.999999999999999 -> 1.246913578024691
-ddrem1109 remainder 1234567890123456 5.000000000000001 -> 0.753086421975309
-ddrem1110 remainder 1234567890123456 5.00000000000001 -> 3.53086421975310
-ddrem1111 remainder 1234567890123456 5.0000000000001 -> 1.3086421975314
-
--- Null tests
-ddrem1000 remainder 10 # -> NaN Invalid_operation
-ddrem1001 remainder # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddRemainder.decTest -- decDouble remainder --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks (as base, above)
+ddrem001 remainder 1 1 -> 0
+ddrem002 remainder 2 1 -> 0
+ddrem003 remainder 1 2 -> 1
+ddrem004 remainder 2 2 -> 0
+ddrem005 remainder 0 1 -> 0
+ddrem006 remainder 0 2 -> 0
+ddrem007 remainder 1 3 -> 1
+ddrem008 remainder 2 3 -> 2
+ddrem009 remainder 3 3 -> 0
+
+ddrem010 remainder 2.4 1 -> 0.4
+ddrem011 remainder 2.4 -1 -> 0.4
+ddrem012 remainder -2.4 1 -> -0.4
+ddrem013 remainder -2.4 -1 -> -0.4
+ddrem014 remainder 2.40 1 -> 0.40
+ddrem015 remainder 2.400 1 -> 0.400
+ddrem016 remainder 2.4 2 -> 0.4
+ddrem017 remainder 2.400 2 -> 0.400
+ddrem018 remainder 2. 2 -> 0
+ddrem019 remainder 20 20 -> 0
+
+ddrem020 remainder 187 187 -> 0
+ddrem021 remainder 5 2 -> 1
+ddrem022 remainder 5 2.0 -> 1.0
+ddrem023 remainder 5 2.000 -> 1.000
+ddrem024 remainder 5 0.200 -> 0.000
+ddrem025 remainder 5 0.200 -> 0.000
+
+ddrem030 remainder 1 2 -> 1
+ddrem031 remainder 1 4 -> 1
+ddrem032 remainder 1 8 -> 1
+
+ddrem033 remainder 1 16 -> 1
+ddrem034 remainder 1 32 -> 1
+ddrem035 remainder 1 64 -> 1
+ddrem040 remainder 1 -2 -> 1
+ddrem041 remainder 1 -4 -> 1
+ddrem042 remainder 1 -8 -> 1
+ddrem043 remainder 1 -16 -> 1
+ddrem044 remainder 1 -32 -> 1
+ddrem045 remainder 1 -64 -> 1
+ddrem050 remainder -1 2 -> -1
+ddrem051 remainder -1 4 -> -1
+ddrem052 remainder -1 8 -> -1
+ddrem053 remainder -1 16 -> -1
+ddrem054 remainder -1 32 -> -1
+ddrem055 remainder -1 64 -> -1
+ddrem060 remainder -1 -2 -> -1
+ddrem061 remainder -1 -4 -> -1
+ddrem062 remainder -1 -8 -> -1
+ddrem063 remainder -1 -16 -> -1
+ddrem064 remainder -1 -32 -> -1
+ddrem065 remainder -1 -64 -> -1
+
+ddrem066 remainder 999999999 1 -> 0
+ddrem067 remainder 999999999.4 1 -> 0.4
+ddrem068 remainder 999999999.5 1 -> 0.5
+ddrem069 remainder 999999999.9 1 -> 0.9
+ddrem070 remainder 999999999.999 1 -> 0.999
+ddrem071 remainder 999999.999999 1 -> 0.999999
+ddrem072 remainder 9 1 -> 0
+ddrem073 remainder 9999999999999999 1 -> 0
+ddrem074 remainder 9999999999999999 2 -> 1
+ddrem075 remainder 9999999999999999 3 -> 0
+ddrem076 remainder 9999999999999999 4 -> 3
+
+ddrem080 remainder 0. 1 -> 0
+ddrem081 remainder .0 1 -> 0.0
+ddrem082 remainder 0.00 1 -> 0.00
+ddrem083 remainder 0.00E+9 1 -> 0
+ddrem084 remainder 0.00E+3 1 -> 0
+ddrem085 remainder 0.00E+2 1 -> 0
+ddrem086 remainder 0.00E+1 1 -> 0.0
+ddrem087 remainder 0.00E+0 1 -> 0.00
+ddrem088 remainder 0.00E-0 1 -> 0.00
+ddrem089 remainder 0.00E-1 1 -> 0.000
+ddrem090 remainder 0.00E-2 1 -> 0.0000
+ddrem091 remainder 0.00E-3 1 -> 0.00000
+ddrem092 remainder 0.00E-4 1 -> 0.000000
+ddrem093 remainder 0.00E-5 1 -> 0E-7
+ddrem094 remainder 0.00E-6 1 -> 0E-8
+ddrem095 remainder 0.0000E-50 1 -> 0E-54
+
+-- Various flavours of remainder by 0
+ddrem101 remainder 0 0 -> NaN Division_undefined
+ddrem102 remainder 0 -0 -> NaN Division_undefined
+ddrem103 remainder -0 0 -> NaN Division_undefined
+ddrem104 remainder -0 -0 -> NaN Division_undefined
+ddrem105 remainder 0.0E5 0 -> NaN Division_undefined
+ddrem106 remainder 0.000 0 -> NaN Division_undefined
+-- [Some think this next group should be Division_by_zero exception, but
+-- IEEE 854 is explicit that it is Invalid operation .. for
+-- remainder-near, anyway]
+ddrem107 remainder 0.0001 0 -> NaN Invalid_operation
+ddrem108 remainder 0.01 0 -> NaN Invalid_operation
+ddrem109 remainder 0.1 0 -> NaN Invalid_operation
+ddrem110 remainder 1 0 -> NaN Invalid_operation
+ddrem111 remainder 1 0.0 -> NaN Invalid_operation
+ddrem112 remainder 10 0.0 -> NaN Invalid_operation
+ddrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
+ddrem114 remainder 1E+380 0 -> NaN Invalid_operation
+ddrem115 remainder 0.0001 -0 -> NaN Invalid_operation
+ddrem116 remainder 0.01 -0 -> NaN Invalid_operation
+ddrem119 remainder 0.1 -0 -> NaN Invalid_operation
+ddrem120 remainder 1 -0 -> NaN Invalid_operation
+ddrem121 remainder 1 -0.0 -> NaN Invalid_operation
+ddrem122 remainder 10 -0.0 -> NaN Invalid_operation
+ddrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
+ddrem124 remainder 1E+384 -0 -> NaN Invalid_operation
+-- and zeros on left
+ddrem130 remainder 0 1 -> 0
+ddrem131 remainder 0 -1 -> 0
+ddrem132 remainder 0.0 1 -> 0.0
+ddrem133 remainder 0.0 -1 -> 0.0
+ddrem134 remainder -0 1 -> -0
+ddrem135 remainder -0 -1 -> -0
+ddrem136 remainder -0.0 1 -> -0.0
+ddrem137 remainder -0.0 -1 -> -0.0
+
+-- 0.5ers
+ddrem143 remainder 0.5 2 -> 0.5
+ddrem144 remainder 0.5 2.1 -> 0.5
+ddrem145 remainder 0.5 2.01 -> 0.50
+ddrem146 remainder 0.5 2.001 -> 0.500
+ddrem147 remainder 0.50 2 -> 0.50
+ddrem148 remainder 0.50 2.01 -> 0.50
+ddrem149 remainder 0.50 2.001 -> 0.500
+
+-- steadies
+ddrem150 remainder 1 1 -> 0
+ddrem151 remainder 1 2 -> 1
+ddrem152 remainder 1 3 -> 1
+ddrem153 remainder 1 4 -> 1
+ddrem154 remainder 1 5 -> 1
+ddrem155 remainder 1 6 -> 1
+ddrem156 remainder 1 7 -> 1
+ddrem157 remainder 1 8 -> 1
+ddrem158 remainder 1 9 -> 1
+ddrem159 remainder 1 10 -> 1
+ddrem160 remainder 1 1 -> 0
+ddrem161 remainder 2 1 -> 0
+ddrem162 remainder 3 1 -> 0
+ddrem163 remainder 4 1 -> 0
+ddrem164 remainder 5 1 -> 0
+ddrem165 remainder 6 1 -> 0
+ddrem166 remainder 7 1 -> 0
+ddrem167 remainder 8 1 -> 0
+ddrem168 remainder 9 1 -> 0
+ddrem169 remainder 10 1 -> 0
+
+-- some differences from remainderNear
+ddrem171 remainder 0.4 1.020 -> 0.400
+ddrem172 remainder 0.50 1.020 -> 0.500
+ddrem173 remainder 0.51 1.020 -> 0.510
+ddrem174 remainder 0.52 1.020 -> 0.520
+ddrem175 remainder 0.6 1.020 -> 0.600
+
+-- More flavours of remainder by 0
+ddrem201 remainder 0 0 -> NaN Division_undefined
+ddrem202 remainder 0.0E5 0 -> NaN Division_undefined
+ddrem203 remainder 0.000 0 -> NaN Division_undefined
+ddrem204 remainder 0.0001 0 -> NaN Invalid_operation
+ddrem205 remainder 0.01 0 -> NaN Invalid_operation
+ddrem206 remainder 0.1 0 -> NaN Invalid_operation
+ddrem207 remainder 1 0 -> NaN Invalid_operation
+ddrem208 remainder 1 0.0 -> NaN Invalid_operation
+ddrem209 remainder 10 0.0 -> NaN Invalid_operation
+ddrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
+ddrem211 remainder 1E+380 0 -> NaN Invalid_operation
+
+-- some differences from remainderNear
+ddrem231 remainder -0.4 1.020 -> -0.400
+ddrem232 remainder -0.50 1.020 -> -0.500
+ddrem233 remainder -0.51 1.020 -> -0.510
+ddrem234 remainder -0.52 1.020 -> -0.520
+ddrem235 remainder -0.6 1.020 -> -0.600
+
+-- high Xs
+ddrem240 remainder 1E+2 1.00 -> 0.00
+
+-- ddrem3xx are from DiagBigDecimal
+ddrem301 remainder 1 3 -> 1
+ddrem302 remainder 5 5 -> 0
+ddrem303 remainder 13 10 -> 3
+ddrem304 remainder 13 50 -> 13
+ddrem305 remainder 13 100 -> 13
+ddrem306 remainder 13 1000 -> 13
+ddrem307 remainder .13 1 -> 0.13
+ddrem308 remainder 0.133 1 -> 0.133
+ddrem309 remainder 0.1033 1 -> 0.1033
+ddrem310 remainder 1.033 1 -> 0.033
+ddrem311 remainder 10.33 1 -> 0.33
+ddrem312 remainder 10.33 10 -> 0.33
+ddrem313 remainder 103.3 1 -> 0.3
+ddrem314 remainder 133 10 -> 3
+ddrem315 remainder 1033 10 -> 3
+ddrem316 remainder 1033 50 -> 33
+ddrem317 remainder 101.0 3 -> 2.0
+ddrem318 remainder 102.0 3 -> 0.0
+ddrem319 remainder 103.0 3 -> 1.0
+ddrem320 remainder 2.40 1 -> 0.40
+ddrem321 remainder 2.400 1 -> 0.400
+ddrem322 remainder 2.4 1 -> 0.4
+ddrem323 remainder 2.4 2 -> 0.4
+ddrem324 remainder 2.400 2 -> 0.400
+ddrem325 remainder 1 0.3 -> 0.1
+ddrem326 remainder 1 0.30 -> 0.10
+ddrem327 remainder 1 0.300 -> 0.100
+ddrem328 remainder 1 0.3000 -> 0.1000
+ddrem329 remainder 1.0 0.3 -> 0.1
+ddrem330 remainder 1.00 0.3 -> 0.10
+ddrem331 remainder 1.000 0.3 -> 0.100
+ddrem332 remainder 1.0000 0.3 -> 0.1000
+ddrem333 remainder 0.5 2 -> 0.5
+ddrem334 remainder 0.5 2.1 -> 0.5
+ddrem335 remainder 0.5 2.01 -> 0.50
+ddrem336 remainder 0.5 2.001 -> 0.500
+ddrem337 remainder 0.50 2 -> 0.50
+ddrem338 remainder 0.50 2.01 -> 0.50
+ddrem339 remainder 0.50 2.001 -> 0.500
+
+ddrem340 remainder 0.5 0.5000001 -> 0.5000000
+ddrem341 remainder 0.5 0.50000001 -> 0.50000000
+ddrem342 remainder 0.5 0.500000001 -> 0.500000000
+ddrem343 remainder 0.5 0.5000000001 -> 0.5000000000
+ddrem344 remainder 0.5 0.50000000001 -> 0.50000000000
+ddrem345 remainder 0.5 0.4999999 -> 1E-7
+ddrem346 remainder 0.5 0.49999999 -> 1E-8
+ddrem347 remainder 0.5 0.499999999 -> 1E-9
+ddrem348 remainder 0.5 0.4999999999 -> 1E-10
+ddrem349 remainder 0.5 0.49999999999 -> 1E-11
+ddrem350 remainder 0.5 0.499999999999 -> 1E-12
+
+ddrem351 remainder 0.03 7 -> 0.03
+ddrem352 remainder 5 2 -> 1
+ddrem353 remainder 4.1 2 -> 0.1
+ddrem354 remainder 4.01 2 -> 0.01
+ddrem355 remainder 4.001 2 -> 0.001
+ddrem356 remainder 4.0001 2 -> 0.0001
+ddrem357 remainder 4.00001 2 -> 0.00001
+ddrem358 remainder 4.000001 2 -> 0.000001
+ddrem359 remainder 4.0000001 2 -> 1E-7
+
+ddrem360 remainder 1.2 0.7345 -> 0.4655
+ddrem361 remainder 0.8 12 -> 0.8
+ddrem362 remainder 0.8 0.2 -> 0.0
+ddrem363 remainder 0.8 0.3 -> 0.2
+ddrem364 remainder 0.800 12 -> 0.800
+ddrem365 remainder 0.800 1.7 -> 0.800
+ddrem366 remainder 2.400 2 -> 0.400
+
+ddrem371 remainder 2.400 2 -> 0.400
+
+ddrem381 remainder 12345 1 -> 0
+ddrem382 remainder 12345 1.0001 -> 0.7657
+ddrem383 remainder 12345 1.001 -> 0.668
+ddrem384 remainder 12345 1.01 -> 0.78
+ddrem385 remainder 12345 1.1 -> 0.8
+ddrem386 remainder 12355 4 -> 3
+ddrem387 remainder 12345 4 -> 1
+ddrem388 remainder 12355 4.0001 -> 2.6912
+ddrem389 remainder 12345 4.0001 -> 0.6914
+ddrem390 remainder 12345 4.9 -> 1.9
+ddrem391 remainder 12345 4.99 -> 4.73
+ddrem392 remainder 12345 4.999 -> 2.469
+ddrem393 remainder 12345 4.9999 -> 0.2469
+ddrem394 remainder 12345 5 -> 0
+ddrem395 remainder 12345 5.0001 -> 4.7532
+ddrem396 remainder 12345 5.001 -> 2.532
+ddrem397 remainder 12345 5.01 -> 0.36
+ddrem398 remainder 12345 5.1 -> 3.0
+
+-- the nasty division-by-1 cases
+ddrem401 remainder 0.5 1 -> 0.5
+ddrem402 remainder 0.55 1 -> 0.55
+ddrem403 remainder 0.555 1 -> 0.555
+ddrem404 remainder 0.5555 1 -> 0.5555
+ddrem405 remainder 0.55555 1 -> 0.55555
+ddrem406 remainder 0.555555 1 -> 0.555555
+ddrem407 remainder 0.5555555 1 -> 0.5555555
+ddrem408 remainder 0.55555555 1 -> 0.55555555
+ddrem409 remainder 0.555555555 1 -> 0.555555555
+
+-- folddowns
+ddrem421 remainder 1E+384 1 -> NaN Division_impossible
+ddrem422 remainder 1E+384 1E+383 -> 0E+369 Clamped
+ddrem423 remainder 1E+384 2E+383 -> 0E+369 Clamped
+ddrem424 remainder 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
+ddrem425 remainder 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
+ddrem426 remainder 1E+384 5E+383 -> 0E+369 Clamped
+ddrem427 remainder 1E+384 6E+383 -> 4.00000000000000E+383 Clamped
+ddrem428 remainder 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
+ddrem429 remainder 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
+ddrem430 remainder 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
+-- tinies
+ddrem431 remainder 1E-397 1E-398 -> 0E-398
+ddrem432 remainder 1E-397 2E-398 -> 0E-398
+ddrem433 remainder 1E-397 3E-398 -> 1E-398 Subnormal
+ddrem434 remainder 1E-397 4E-398 -> 2E-398 Subnormal
+ddrem435 remainder 1E-397 5E-398 -> 0E-398
+ddrem436 remainder 1E-397 6E-398 -> 4E-398 Subnormal
+ddrem437 remainder 1E-397 7E-398 -> 3E-398 Subnormal
+ddrem438 remainder 1E-397 8E-398 -> 2E-398 Subnormal
+ddrem439 remainder 1E-397 9E-398 -> 1E-398 Subnormal
+ddrem440 remainder 1E-397 10E-398 -> 0E-398
+ddrem441 remainder 1E-397 11E-398 -> 1.0E-397 Subnormal
+ddrem442 remainder 100E-397 11E-398 -> 1.0E-397 Subnormal
+ddrem443 remainder 100E-397 20E-398 -> 0E-398
+ddrem444 remainder 100E-397 21E-398 -> 1.3E-397 Subnormal
+ddrem445 remainder 100E-397 30E-398 -> 1.0E-397 Subnormal
+
+-- zero signs
+ddrem650 remainder 1 1 -> 0
+ddrem651 remainder -1 1 -> -0
+ddrem652 remainder 1 -1 -> 0
+ddrem653 remainder -1 -1 -> -0
+ddrem654 remainder 0 1 -> 0
+ddrem655 remainder -0 1 -> -0
+ddrem656 remainder 0 -1 -> 0
+ddrem657 remainder -0 -1 -> -0
+ddrem658 remainder 0.00 1 -> 0.00
+ddrem659 remainder -0.00 1 -> -0.00
+
+-- Specials
+ddrem680 remainder Inf -Inf -> NaN Invalid_operation
+ddrem681 remainder Inf -1000 -> NaN Invalid_operation
+ddrem682 remainder Inf -1 -> NaN Invalid_operation
+ddrem683 remainder Inf 0 -> NaN Invalid_operation
+ddrem684 remainder Inf -0 -> NaN Invalid_operation
+ddrem685 remainder Inf 1 -> NaN Invalid_operation
+ddrem686 remainder Inf 1000 -> NaN Invalid_operation
+ddrem687 remainder Inf Inf -> NaN Invalid_operation
+ddrem688 remainder -1000 Inf -> -1000
+ddrem689 remainder -Inf Inf -> NaN Invalid_operation
+ddrem691 remainder -1 Inf -> -1
+ddrem692 remainder 0 Inf -> 0
+ddrem693 remainder -0 Inf -> -0
+ddrem694 remainder 1 Inf -> 1
+ddrem695 remainder 1000 Inf -> 1000
+ddrem696 remainder Inf Inf -> NaN Invalid_operation
+
+ddrem700 remainder -Inf -Inf -> NaN Invalid_operation
+ddrem701 remainder -Inf -1000 -> NaN Invalid_operation
+ddrem702 remainder -Inf -1 -> NaN Invalid_operation
+ddrem703 remainder -Inf -0 -> NaN Invalid_operation
+ddrem704 remainder -Inf 0 -> NaN Invalid_operation
+ddrem705 remainder -Inf 1 -> NaN Invalid_operation
+ddrem706 remainder -Inf 1000 -> NaN Invalid_operation
+ddrem707 remainder -Inf Inf -> NaN Invalid_operation
+ddrem708 remainder -Inf -Inf -> NaN Invalid_operation
+ddrem709 remainder -1000 Inf -> -1000
+ddrem710 remainder -1 -Inf -> -1
+ddrem711 remainder -0 -Inf -> -0
+ddrem712 remainder 0 -Inf -> 0
+ddrem713 remainder 1 -Inf -> 1
+ddrem714 remainder 1000 -Inf -> 1000
+ddrem715 remainder Inf -Inf -> NaN Invalid_operation
+
+ddrem721 remainder NaN -Inf -> NaN
+ddrem722 remainder NaN -1000 -> NaN
+ddrem723 remainder NaN -1 -> NaN
+ddrem724 remainder NaN -0 -> NaN
+ddrem725 remainder -NaN 0 -> -NaN
+ddrem726 remainder NaN 1 -> NaN
+ddrem727 remainder NaN 1000 -> NaN
+ddrem728 remainder NaN Inf -> NaN
+ddrem729 remainder NaN -NaN -> NaN
+ddrem730 remainder -Inf NaN -> NaN
+ddrem731 remainder -1000 NaN -> NaN
+ddrem732 remainder -1 NaN -> NaN
+ddrem733 remainder -0 -NaN -> -NaN
+ddrem734 remainder 0 NaN -> NaN
+ddrem735 remainder 1 -NaN -> -NaN
+ddrem736 remainder 1000 NaN -> NaN
+ddrem737 remainder Inf NaN -> NaN
+
+ddrem741 remainder sNaN -Inf -> NaN Invalid_operation
+ddrem742 remainder sNaN -1000 -> NaN Invalid_operation
+ddrem743 remainder -sNaN -1 -> -NaN Invalid_operation
+ddrem744 remainder sNaN -0 -> NaN Invalid_operation
+ddrem745 remainder sNaN 0 -> NaN Invalid_operation
+ddrem746 remainder sNaN 1 -> NaN Invalid_operation
+ddrem747 remainder sNaN 1000 -> NaN Invalid_operation
+ddrem749 remainder sNaN NaN -> NaN Invalid_operation
+ddrem750 remainder sNaN sNaN -> NaN Invalid_operation
+ddrem751 remainder NaN sNaN -> NaN Invalid_operation
+ddrem752 remainder -Inf sNaN -> NaN Invalid_operation
+ddrem753 remainder -1000 sNaN -> NaN Invalid_operation
+ddrem754 remainder -1 sNaN -> NaN Invalid_operation
+ddrem755 remainder -0 sNaN -> NaN Invalid_operation
+ddrem756 remainder 0 sNaN -> NaN Invalid_operation
+ddrem757 remainder 1 sNaN -> NaN Invalid_operation
+ddrem758 remainder 1000 sNaN -> NaN Invalid_operation
+ddrem759 remainder Inf -sNaN -> -NaN Invalid_operation
+
+-- propaging NaNs
+ddrem760 remainder NaN1 NaN7 -> NaN1
+ddrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
+ddrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
+ddrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
+ddrem764 remainder 15 NaN11 -> NaN11
+ddrem765 remainder NaN6 NaN12 -> NaN6
+ddrem766 remainder Inf NaN13 -> NaN13
+ddrem767 remainder NaN14 -Inf -> NaN14
+ddrem768 remainder 0 NaN15 -> NaN15
+ddrem769 remainder NaN16 -0 -> NaN16
+
+-- edge cases of impossible
+ddrem770 remainder 1234567890123456 10 -> 6
+ddrem771 remainder 1234567890123456 1 -> 0
+ddrem772 remainder 1234567890123456 0.1 -> NaN Division_impossible
+ddrem773 remainder 1234567890123456 0.01 -> NaN Division_impossible
+
+-- long operand checks
+ddrem801 remainder 12345678000 100 -> 0
+ddrem802 remainder 1 12345678000 -> 1
+ddrem803 remainder 1234567800 10 -> 0
+ddrem804 remainder 1 1234567800 -> 1
+ddrem805 remainder 1234567890 10 -> 0
+ddrem806 remainder 1 1234567890 -> 1
+ddrem807 remainder 1234567891 10 -> 1
+ddrem808 remainder 1 1234567891 -> 1
+ddrem809 remainder 12345678901 100 -> 1
+ddrem810 remainder 1 12345678901 -> 1
+ddrem811 remainder 1234567896 10 -> 6
+ddrem812 remainder 1 1234567896 -> 1
+
+ddrem821 remainder 12345678000 100 -> 0
+ddrem822 remainder 1 12345678000 -> 1
+ddrem823 remainder 1234567800 10 -> 0
+ddrem824 remainder 1 1234567800 -> 1
+ddrem825 remainder 1234567890 10 -> 0
+ddrem826 remainder 1 1234567890 -> 1
+ddrem827 remainder 1234567891 10 -> 1
+ddrem828 remainder 1 1234567891 -> 1
+ddrem829 remainder 12345678901 100 -> 1
+ddrem830 remainder 1 12345678901 -> 1
+ddrem831 remainder 1234567896 10 -> 6
+ddrem832 remainder 1 1234567896 -> 1
+
+-- from divideint
+ddrem840 remainder 100000000.0 1 -> 0.0
+ddrem841 remainder 100000000.4 1 -> 0.4
+ddrem842 remainder 100000000.5 1 -> 0.5
+ddrem843 remainder 100000000.9 1 -> 0.9
+ddrem844 remainder 100000000.999 1 -> 0.999
+ddrem850 remainder 100000003 5 -> 3
+ddrem851 remainder 10000003 5 -> 3
+ddrem852 remainder 1000003 5 -> 3
+ddrem853 remainder 100003 5 -> 3
+ddrem854 remainder 10003 5 -> 3
+ddrem855 remainder 1003 5 -> 3
+ddrem856 remainder 103 5 -> 3
+ddrem857 remainder 13 5 -> 3
+ddrem858 remainder 1 5 -> 1
+
+-- Vladimir's cases 1234567890123456
+ddrem860 remainder 123.0e1 1000000000000000 -> 1230
+ddrem861 remainder 1230 1000000000000000 -> 1230
+ddrem862 remainder 12.3e2 1000000000000000 -> 1230
+ddrem863 remainder 1.23e3 1000000000000000 -> 1230
+ddrem864 remainder 123e1 1000000000000000 -> 1230
+ddrem870 remainder 123e1 1000000000000000 -> 1230
+ddrem871 remainder 123e1 100000000000000 -> 1230
+ddrem872 remainder 123e1 10000000000000 -> 1230
+ddrem873 remainder 123e1 1000000000000 -> 1230
+ddrem874 remainder 123e1 100000000000 -> 1230
+ddrem875 remainder 123e1 10000000000 -> 1230
+ddrem876 remainder 123e1 1000000000 -> 1230
+ddrem877 remainder 123e1 100000000 -> 1230
+ddrem878 remainder 1230 100000000 -> 1230
+ddrem879 remainder 123e1 10000000 -> 1230
+ddrem880 remainder 123e1 1000000 -> 1230
+ddrem881 remainder 123e1 100000 -> 1230
+ddrem882 remainder 123e1 10000 -> 1230
+ddrem883 remainder 123e1 1000 -> 230
+ddrem884 remainder 123e1 100 -> 30
+ddrem885 remainder 123e1 10 -> 0
+ddrem886 remainder 123e1 1 -> 0
+
+ddrem890 remainder 123e1 2000000000000000 -> 1230
+ddrem891 remainder 123e1 200000000000000 -> 1230
+ddrem892 remainder 123e1 20000000000000 -> 1230
+ddrem893 remainder 123e1 2000000000000 -> 1230
+ddrem894 remainder 123e1 200000000000 -> 1230
+ddrem895 remainder 123e1 20000000000 -> 1230
+ddrem896 remainder 123e1 2000000000 -> 1230
+ddrem897 remainder 123e1 200000000 -> 1230
+ddrem899 remainder 123e1 20000000 -> 1230
+ddrem900 remainder 123e1 2000000 -> 1230
+ddrem901 remainder 123e1 200000 -> 1230
+ddrem902 remainder 123e1 20000 -> 1230
+ddrem903 remainder 123e1 2000 -> 1230
+ddrem904 remainder 123e1 200 -> 30
+ddrem905 remainder 123e1 20 -> 10
+ddrem906 remainder 123e1 2 -> 0
+
+ddrem910 remainder 123e1 5000000000000000 -> 1230
+ddrem911 remainder 123e1 500000000000000 -> 1230
+ddrem912 remainder 123e1 50000000000000 -> 1230
+ddrem913 remainder 123e1 5000000000000 -> 1230
+ddrem914 remainder 123e1 500000000000 -> 1230
+ddrem915 remainder 123e1 50000000000 -> 1230
+ddrem916 remainder 123e1 5000000000 -> 1230
+ddrem917 remainder 123e1 500000000 -> 1230
+ddrem919 remainder 123e1 50000000 -> 1230
+ddrem920 remainder 123e1 5000000 -> 1230
+ddrem921 remainder 123e1 500000 -> 1230
+ddrem922 remainder 123e1 50000 -> 1230
+ddrem923 remainder 123e1 5000 -> 1230
+ddrem924 remainder 123e1 500 -> 230
+ddrem925 remainder 123e1 50 -> 30
+ddrem926 remainder 123e1 5 -> 0
+
+ddrem930 remainder 123e1 9000000000000000 -> 1230
+ddrem931 remainder 123e1 900000000000000 -> 1230
+ddrem932 remainder 123e1 90000000000000 -> 1230
+ddrem933 remainder 123e1 9000000000000 -> 1230
+ddrem934 remainder 123e1 900000000000 -> 1230
+ddrem935 remainder 123e1 90000000000 -> 1230
+ddrem936 remainder 123e1 9000000000 -> 1230
+ddrem937 remainder 123e1 900000000 -> 1230
+ddrem939 remainder 123e1 90000000 -> 1230
+ddrem940 remainder 123e1 9000000 -> 1230
+ddrem941 remainder 123e1 900000 -> 1230
+ddrem942 remainder 123e1 90000 -> 1230
+ddrem943 remainder 123e1 9000 -> 1230
+ddrem944 remainder 123e1 900 -> 330
+ddrem945 remainder 123e1 90 -> 60
+ddrem946 remainder 123e1 9 -> 6
+
+ddrem950 remainder 123e1 1000000000000000 -> 1230
+ddrem961 remainder 123e1 2999999999999999 -> 1230
+ddrem962 remainder 123e1 3999999999999999 -> 1230
+ddrem963 remainder 123e1 4999999999999999 -> 1230
+ddrem964 remainder 123e1 5999999999999999 -> 1230
+ddrem965 remainder 123e1 6999999999999999 -> 1230
+ddrem966 remainder 123e1 7999999999999999 -> 1230
+ddrem967 remainder 123e1 8999999999999999 -> 1230
+ddrem968 remainder 123e1 9999999999999999 -> 1230
+ddrem969 remainder 123e1 9876543210987654 -> 1230
+
+ddrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
+
+-- overflow and underflow tests [from divide]
+ddrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
+ddrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
+ddrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
+ddrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
+ddrem1055 remainder 1e-277 1e+311 -> 1E-277
+ddrem1056 remainder 1e-277 -1e+311 -> 1E-277
+ddrem1057 remainder -1e-277 1e+311 -> -1E-277
+ddrem1058 remainder -1e-277 -1e+311 -> -1E-277
+
+-- destructive subtract
+ddrem1101 remainder 1234567890123456 1.000000000000001 -> 0.765432109876546
+ddrem1102 remainder 1234567890123456 1.00000000000001 -> 0.65432109876557
+ddrem1103 remainder 1234567890123456 1.0000000000001 -> 0.5432109876668
+ddrem1104 remainder 1234567890123455 4.000000000000001 -> 2.691358027469137
+ddrem1105 remainder 1234567890123456 4.000000000000001 -> 3.691358027469137
+ddrem1106 remainder 1234567890123456 4.9999999999999 -> 0.6913578024696
+ddrem1107 remainder 1234567890123456 4.99999999999999 -> 3.46913578024691
+ddrem1108 remainder 1234567890123456 4.999999999999999 -> 1.246913578024691
+ddrem1109 remainder 1234567890123456 5.000000000000001 -> 0.753086421975309
+ddrem1110 remainder 1234567890123456 5.00000000000001 -> 3.53086421975310
+ddrem1111 remainder 1234567890123456 5.0000000000001 -> 1.3086421975314
+
+-- Null tests
+ddrem1000 remainder 10 # -> NaN Invalid_operation
+ddrem1001 remainder # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddRemainderNear.decTest b/Lib/test/decimaltestdata/ddRemainderNear.decTest
index 8da9afc4c3..6ba64ebafe 100644
--- a/Lib/test/decimaltestdata/ddRemainderNear.decTest
+++ b/Lib/test/decimaltestdata/ddRemainderNear.decTest
@@ -1,629 +1,629 @@
-------------------------------------------------------------------------
--- ddRemainderNear.decTest -- decDouble remainder-near --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks (as base, above)
-ddrmn001 remaindernear 1 1 -> 0
-ddrmn002 remaindernear 2 1 -> 0
-ddrmn003 remaindernear 1 2 -> 1
-ddrmn004 remaindernear 2 2 -> 0
-ddrmn005 remaindernear 0 1 -> 0
-ddrmn006 remaindernear 0 2 -> 0
-ddrmn007 remaindernear 1 3 -> 1
-ddrmn008 remaindernear 2 3 -> -1
-ddrmn009 remaindernear 3 3 -> 0
-
-ddrmn010 remaindernear 2.4 1 -> 0.4
-ddrmn011 remaindernear 2.4 -1 -> 0.4
-ddrmn012 remaindernear -2.4 1 -> -0.4
-ddrmn013 remaindernear -2.4 -1 -> -0.4
-ddrmn014 remaindernear 2.40 1 -> 0.40
-ddrmn015 remaindernear 2.400 1 -> 0.400
-ddrmn016 remaindernear 2.4 2 -> 0.4
-ddrmn017 remaindernear 2.400 2 -> 0.400
-ddrmn018 remaindernear 2. 2 -> 0
-ddrmn019 remaindernear 20 20 -> 0
-
-ddrmn020 remaindernear 187 187 -> 0
-ddrmn021 remaindernear 5 2 -> 1
-ddrmn022 remaindernear 5 2.0 -> 1.0
-ddrmn023 remaindernear 5 2.000 -> 1.000
-ddrmn024 remaindernear 5 0.200 -> 0.000
-ddrmn025 remaindernear 5 0.200 -> 0.000
-
-ddrmn030 remaindernear 1 2 -> 1
-ddrmn031 remaindernear 1 4 -> 1
-ddrmn032 remaindernear 1 8 -> 1
-
-ddrmn033 remaindernear 1 16 -> 1
-ddrmn034 remaindernear 1 32 -> 1
-ddrmn035 remaindernear 1 64 -> 1
-ddrmn040 remaindernear 1 -2 -> 1
-ddrmn041 remaindernear 1 -4 -> 1
-ddrmn042 remaindernear 1 -8 -> 1
-ddrmn043 remaindernear 1 -16 -> 1
-ddrmn044 remaindernear 1 -32 -> 1
-ddrmn045 remaindernear 1 -64 -> 1
-ddrmn050 remaindernear -1 2 -> -1
-ddrmn051 remaindernear -1 4 -> -1
-ddrmn052 remaindernear -1 8 -> -1
-ddrmn053 remaindernear -1 16 -> -1
-ddrmn054 remaindernear -1 32 -> -1
-ddrmn055 remaindernear -1 64 -> -1
-ddrmn060 remaindernear -1 -2 -> -1
-ddrmn061 remaindernear -1 -4 -> -1
-ddrmn062 remaindernear -1 -8 -> -1
-ddrmn063 remaindernear -1 -16 -> -1
-ddrmn064 remaindernear -1 -32 -> -1
-ddrmn065 remaindernear -1 -64 -> -1
-
-ddrmn066 remaindernear 9.9 1 -> -0.1
-ddrmn067 remaindernear 99.7 1 -> -0.3
-ddrmn068 remaindernear 999999999 1 -> 0
-ddrmn069 remaindernear 999999999.4 1 -> 0.4
-ddrmn070 remaindernear 999999999.5 1 -> -0.5
-ddrmn071 remaindernear 999999999.9 1 -> -0.1
-ddrmn072 remaindernear 999999999.999 1 -> -0.001
-ddrmn073 remaindernear 999999.999999 1 -> -0.000001
-ddrmn074 remaindernear 9 1 -> 0
-ddrmn075 remaindernear 9999999999999999 1 -> 0
-ddrmn076 remaindernear 9999999999999999 2 -> -1
-ddrmn077 remaindernear 9999999999999999 3 -> 0
-ddrmn078 remaindernear 9999999999999999 4 -> -1
-
-ddrmn080 remaindernear 0. 1 -> 0
-ddrmn081 remaindernear .0 1 -> 0.0
-ddrmn082 remaindernear 0.00 1 -> 0.00
-ddrmn083 remaindernear 0.00E+9 1 -> 0
-ddrmn084 remaindernear 0.00E+3 1 -> 0
-ddrmn085 remaindernear 0.00E+2 1 -> 0
-ddrmn086 remaindernear 0.00E+1 1 -> 0.0
-ddrmn087 remaindernear 0.00E+0 1 -> 0.00
-ddrmn088 remaindernear 0.00E-0 1 -> 0.00
-ddrmn089 remaindernear 0.00E-1 1 -> 0.000
-ddrmn090 remaindernear 0.00E-2 1 -> 0.0000
-ddrmn091 remaindernear 0.00E-3 1 -> 0.00000
-ddrmn092 remaindernear 0.00E-4 1 -> 0.000000
-ddrmn093 remaindernear 0.00E-5 1 -> 0E-7
-ddrmn094 remaindernear 0.00E-6 1 -> 0E-8
-ddrmn095 remaindernear 0.0000E-50 1 -> 0E-54
-
--- Various flavours of remaindernear by 0
-ddrmn101 remaindernear 0 0 -> NaN Division_undefined
-ddrmn102 remaindernear 0 -0 -> NaN Division_undefined
-ddrmn103 remaindernear -0 0 -> NaN Division_undefined
-ddrmn104 remaindernear -0 -0 -> NaN Division_undefined
-ddrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined
-ddrmn106 remaindernear 0.000 0 -> NaN Division_undefined
--- [Some think this next group should be Division_by_zero exception, but
--- IEEE 854 is explicit that it is Invalid operation .. for
--- remainder-near, anyway]
-ddrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation
-ddrmn108 remaindernear 0.01 0 -> NaN Invalid_operation
-ddrmn109 remaindernear 0.1 0 -> NaN Invalid_operation
-ddrmn110 remaindernear 1 0 -> NaN Invalid_operation
-ddrmn111 remaindernear 1 0.0 -> NaN Invalid_operation
-ddrmn112 remaindernear 10 0.0 -> NaN Invalid_operation
-ddrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation
-ddrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation
-ddrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation
-ddrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation
-ddrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation
-ddrmn120 remaindernear 1 -0 -> NaN Invalid_operation
-ddrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation
-ddrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation
-ddrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation
-ddrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation
--- and zeros on left
-ddrmn130 remaindernear 0 1 -> 0
-ddrmn131 remaindernear 0 -1 -> 0
-ddrmn132 remaindernear 0.0 1 -> 0.0
-ddrmn133 remaindernear 0.0 -1 -> 0.0
-ddrmn134 remaindernear -0 1 -> -0
-ddrmn135 remaindernear -0 -1 -> -0
-ddrmn136 remaindernear -0.0 1 -> -0.0
-ddrmn137 remaindernear -0.0 -1 -> -0.0
-
--- 0.5ers
-ddrmn143 remaindernear 0.5 2 -> 0.5
-ddrmn144 remaindernear 0.5 2.1 -> 0.5
-ddrmn145 remaindernear 0.5 2.01 -> 0.50
-ddrmn146 remaindernear 0.5 2.001 -> 0.500
-ddrmn147 remaindernear 0.50 2 -> 0.50
-ddrmn148 remaindernear 0.50 2.01 -> 0.50
-ddrmn149 remaindernear 0.50 2.001 -> 0.500
-
--- steadies
-ddrmn150 remaindernear 1 1 -> 0
-ddrmn151 remaindernear 1 2 -> 1
-ddrmn152 remaindernear 1 3 -> 1
-ddrmn153 remaindernear 1 4 -> 1
-ddrmn154 remaindernear 1 5 -> 1
-ddrmn155 remaindernear 1 6 -> 1
-ddrmn156 remaindernear 1 7 -> 1
-ddrmn157 remaindernear 1 8 -> 1
-ddrmn158 remaindernear 1 9 -> 1
-ddrmn159 remaindernear 1 10 -> 1
-ddrmn160 remaindernear 1 1 -> 0
-ddrmn161 remaindernear 2 1 -> 0
-ddrmn162 remaindernear 3 1 -> 0
-ddrmn163 remaindernear 4 1 -> 0
-ddrmn164 remaindernear 5 1 -> 0
-ddrmn165 remaindernear 6 1 -> 0
-ddrmn166 remaindernear 7 1 -> 0
-ddrmn167 remaindernear 8 1 -> 0
-ddrmn168 remaindernear 9 1 -> 0
-ddrmn169 remaindernear 10 1 -> 0
-
--- some differences from remainder
-ddrmn171 remaindernear 0.4 1.020 -> 0.400
-ddrmn172 remaindernear 0.50 1.020 -> 0.500
-ddrmn173 remaindernear 0.51 1.020 -> 0.510
-ddrmn174 remaindernear 0.52 1.020 -> -0.500
-ddrmn175 remaindernear 0.6 1.020 -> -0.420
-
--- More flavours of remaindernear by 0
-ddrmn201 remaindernear 0 0 -> NaN Division_undefined
-ddrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined
-ddrmn203 remaindernear 0.000 0 -> NaN Division_undefined
-ddrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation
-ddrmn205 remaindernear 0.01 0 -> NaN Invalid_operation
-ddrmn206 remaindernear 0.1 0 -> NaN Invalid_operation
-ddrmn207 remaindernear 1 0 -> NaN Invalid_operation
-ddrmn208 remaindernear 1 0.0 -> NaN Invalid_operation
-ddrmn209 remaindernear 10 0.0 -> NaN Invalid_operation
-ddrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation
-ddrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation
-
--- tests from the extended specification
-ddrmn221 remaindernear 2.1 3 -> -0.9
-ddrmn222 remaindernear 10 6 -> -2
-ddrmn223 remaindernear 10 3 -> 1
-ddrmn224 remaindernear -10 3 -> -1
-ddrmn225 remaindernear 10.2 1 -> 0.2
-ddrmn226 remaindernear 10 0.3 -> 0.1
-ddrmn227 remaindernear 3.6 1.3 -> -0.3
-
--- some differences from remainder
-ddrmn231 remaindernear -0.4 1.020 -> -0.400
-ddrmn232 remaindernear -0.50 1.020 -> -0.500
-ddrmn233 remaindernear -0.51 1.020 -> -0.510
-ddrmn234 remaindernear -0.52 1.020 -> 0.500
-ddrmn235 remaindernear -0.6 1.020 -> 0.420
-
--- high Xs
-ddrmn240 remaindernear 1E+2 1.00 -> 0.00
-
--- ddrmn3xx are from DiagBigDecimal
-ddrmn301 remaindernear 1 3 -> 1
-ddrmn302 remaindernear 5 5 -> 0
-ddrmn303 remaindernear 13 10 -> 3
-ddrmn304 remaindernear 13 50 -> 13
-ddrmn305 remaindernear 13 100 -> 13
-ddrmn306 remaindernear 13 1000 -> 13
-ddrmn307 remaindernear .13 1 -> 0.13
-ddrmn308 remaindernear 0.133 1 -> 0.133
-ddrmn309 remaindernear 0.1033 1 -> 0.1033
-ddrmn310 remaindernear 1.033 1 -> 0.033
-ddrmn311 remaindernear 10.33 1 -> 0.33
-ddrmn312 remaindernear 10.33 10 -> 0.33
-ddrmn313 remaindernear 103.3 1 -> 0.3
-ddrmn314 remaindernear 133 10 -> 3
-ddrmn315 remaindernear 1033 10 -> 3
-ddrmn316 remaindernear 1033 50 -> -17
-ddrmn317 remaindernear 101.0 3 -> -1.0
-ddrmn318 remaindernear 102.0 3 -> 0.0
-ddrmn319 remaindernear 103.0 3 -> 1.0
-ddrmn320 remaindernear 2.40 1 -> 0.40
-ddrmn321 remaindernear 2.400 1 -> 0.400
-ddrmn322 remaindernear 2.4 1 -> 0.4
-ddrmn323 remaindernear 2.4 2 -> 0.4
-ddrmn324 remaindernear 2.400 2 -> 0.400
-ddrmn325 remaindernear 1 0.3 -> 0.1
-ddrmn326 remaindernear 1 0.30 -> 0.10
-ddrmn327 remaindernear 1 0.300 -> 0.100
-ddrmn328 remaindernear 1 0.3000 -> 0.1000
-ddrmn329 remaindernear 1.0 0.3 -> 0.1
-ddrmn330 remaindernear 1.00 0.3 -> 0.10
-ddrmn331 remaindernear 1.000 0.3 -> 0.100
-ddrmn332 remaindernear 1.0000 0.3 -> 0.1000
-ddrmn333 remaindernear 0.5 2 -> 0.5
-ddrmn334 remaindernear 0.5 2.1 -> 0.5
-ddrmn335 remaindernear 0.5 2.01 -> 0.50
-ddrmn336 remaindernear 0.5 2.001 -> 0.500
-ddrmn337 remaindernear 0.50 2 -> 0.50
-ddrmn338 remaindernear 0.50 2.01 -> 0.50
-ddrmn339 remaindernear 0.50 2.001 -> 0.500
-
-ddrmn340 remaindernear 0.5 0.5000001 -> -1E-7
-ddrmn341 remaindernear 0.5 0.50000001 -> -1E-8
-ddrmn342 remaindernear 0.5 0.500000001 -> -1E-9
-ddrmn343 remaindernear 0.5 0.5000000001 -> -1E-10
-ddrmn344 remaindernear 0.5 0.50000000001 -> -1E-11
-ddrmn345 remaindernear 0.5 0.4999999 -> 1E-7
-ddrmn346 remaindernear 0.5 0.49999999 -> 1E-8
-ddrmn347 remaindernear 0.5 0.499999999 -> 1E-9
-ddrmn348 remaindernear 0.5 0.4999999999 -> 1E-10
-ddrmn349 remaindernear 0.5 0.49999999999 -> 1E-11
-ddrmn350 remaindernear 0.5 0.499999999999 -> 1E-12
-
-ddrmn351 remaindernear 0.03 7 -> 0.03
-ddrmn352 remaindernear 5 2 -> 1
-ddrmn353 remaindernear 4.1 2 -> 0.1
-ddrmn354 remaindernear 4.01 2 -> 0.01
-ddrmn355 remaindernear 4.001 2 -> 0.001
-ddrmn356 remaindernear 4.0001 2 -> 0.0001
-ddrmn357 remaindernear 4.00001 2 -> 0.00001
-ddrmn358 remaindernear 4.000001 2 -> 0.000001
-ddrmn359 remaindernear 4.0000001 2 -> 1E-7
-
-ddrmn360 remaindernear 1.2 0.7345 -> -0.2690
-ddrmn361 remaindernear 0.8 12 -> 0.8
-ddrmn362 remaindernear 0.8 0.2 -> 0.0
-ddrmn363 remaindernear 0.8 0.3 -> -0.1
-ddrmn364 remaindernear 0.800 12 -> 0.800
-ddrmn365 remaindernear 0.800 1.7 -> 0.800
-ddrmn366 remaindernear 2.400 2 -> 0.400
-
--- round to even
-ddrmn371 remaindernear 121 2 -> 1
-ddrmn372 remaindernear 122 2 -> 0
-ddrmn373 remaindernear 123 2 -> -1
-ddrmn374 remaindernear 124 2 -> 0
-ddrmn375 remaindernear 125 2 -> 1
-ddrmn376 remaindernear 126 2 -> 0
-ddrmn377 remaindernear 127 2 -> -1
-
-ddrmn381 remaindernear 12345 1 -> 0
-ddrmn382 remaindernear 12345 1.0001 -> -0.2344
-ddrmn383 remaindernear 12345 1.001 -> -0.333
-ddrmn384 remaindernear 12345 1.01 -> -0.23
-ddrmn385 remaindernear 12345 1.1 -> -0.3
-ddrmn386 remaindernear 12355 4 -> -1
-ddrmn387 remaindernear 12345 4 -> 1
-ddrmn388 remaindernear 12355 4.0001 -> -1.3089
-ddrmn389 remaindernear 12345 4.0001 -> 0.6914
-ddrmn390 remaindernear 12345 4.9 -> 1.9
-ddrmn391 remaindernear 12345 4.99 -> -0.26
-ddrmn392 remaindernear 12345 4.999 -> 2.469
-ddrmn393 remaindernear 12345 4.9999 -> 0.2469
-ddrmn394 remaindernear 12345 5 -> 0
-ddrmn395 remaindernear 12345 5.0001 -> -0.2469
-ddrmn396 remaindernear 12345 5.001 -> -2.469
-ddrmn397 remaindernear 12345 5.01 -> 0.36
-ddrmn398 remaindernear 12345 5.1 -> -2.1
-
--- the nasty division-by-1 cases
-ddrmn401 remaindernear 0.4 1 -> 0.4
-ddrmn402 remaindernear 0.45 1 -> 0.45
-ddrmn403 remaindernear 0.455 1 -> 0.455
-ddrmn404 remaindernear 0.4555 1 -> 0.4555
-ddrmn405 remaindernear 0.45555 1 -> 0.45555
-ddrmn406 remaindernear 0.455555 1 -> 0.455555
-ddrmn407 remaindernear 0.4555555 1 -> 0.4555555
-ddrmn408 remaindernear 0.45555555 1 -> 0.45555555
-ddrmn409 remaindernear 0.455555555 1 -> 0.455555555
--- with spill... [412 exercises sticktab loop]
-ddrmn411 remaindernear 0.5 1 -> 0.5
-ddrmn412 remaindernear 0.55 1 -> -0.45
-ddrmn413 remaindernear 0.555 1 -> -0.445
-ddrmn414 remaindernear 0.5555 1 -> -0.4445
-ddrmn415 remaindernear 0.55555 1 -> -0.44445
-ddrmn416 remaindernear 0.555555 1 -> -0.444445
-ddrmn417 remaindernear 0.5555555 1 -> -0.4444445
-ddrmn418 remaindernear 0.55555555 1 -> -0.44444445
-ddrmn419 remaindernear 0.555555555 1 -> -0.444444445
-
--- folddowns
-ddrmn421 remaindernear 1E+384 1 -> NaN Division_impossible
-ddrmn422 remaindernear 1E+384 1E+383 -> 0E+369 Clamped
-ddrmn423 remaindernear 1E+384 2E+383 -> 0E+369 Clamped
-ddrmn424 remaindernear 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
-ddrmn425 remaindernear 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
-ddrmn426 remaindernear 1E+384 5E+383 -> 0E+369 Clamped
-ddrmn427 remaindernear 1E+384 6E+383 -> -2.00000000000000E+383 Clamped
-ddrmn428 remaindernear 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
-ddrmn429 remaindernear 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
-ddrmn430 remaindernear 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
--- tinies
-ddrmn431 remaindernear 1E-397 1E-398 -> 0E-398
-ddrmn432 remaindernear 1E-397 2E-398 -> 0E-398
-ddrmn433 remaindernear 1E-397 3E-398 -> 1E-398 Subnormal
-ddrmn434 remaindernear 1E-397 4E-398 -> 2E-398 Subnormal
-ddrmn435 remaindernear 1E-397 5E-398 -> 0E-398
-ddrmn436 remaindernear 1E-397 6E-398 -> -2E-398 Subnormal
-ddrmn437 remaindernear 1E-397 7E-398 -> 3E-398 Subnormal
-ddrmn438 remaindernear 1E-397 8E-398 -> 2E-398 Subnormal
-ddrmn439 remaindernear 1E-397 9E-398 -> 1E-398 Subnormal
-ddrmn440 remaindernear 1E-397 10E-398 -> 0E-398
-ddrmn441 remaindernear 1E-397 11E-398 -> -1E-398 Subnormal
-ddrmn442 remaindernear 100E-397 11E-398 -> -1E-398 Subnormal
-ddrmn443 remaindernear 100E-397 20E-398 -> 0E-398
-ddrmn444 remaindernear 100E-397 21E-398 -> -8E-398 Subnormal
-ddrmn445 remaindernear 100E-397 30E-398 -> 1.0E-397 Subnormal
-
--- zero signs
-ddrmn650 remaindernear 1 1 -> 0
-ddrmn651 remaindernear -1 1 -> -0
-ddrmn652 remaindernear 1 -1 -> 0
-ddrmn653 remaindernear -1 -1 -> -0
-ddrmn654 remaindernear 0 1 -> 0
-ddrmn655 remaindernear -0 1 -> -0
-ddrmn656 remaindernear 0 -1 -> 0
-ddrmn657 remaindernear -0 -1 -> -0
-ddrmn658 remaindernear 0.00 1 -> 0.00
-ddrmn659 remaindernear -0.00 1 -> -0.00
-
--- Specials
-ddrmn680 remaindernear Inf -Inf -> NaN Invalid_operation
-ddrmn681 remaindernear Inf -1000 -> NaN Invalid_operation
-ddrmn682 remaindernear Inf -1 -> NaN Invalid_operation
-ddrmn683 remaindernear Inf 0 -> NaN Invalid_operation
-ddrmn684 remaindernear Inf -0 -> NaN Invalid_operation
-ddrmn685 remaindernear Inf 1 -> NaN Invalid_operation
-ddrmn686 remaindernear Inf 1000 -> NaN Invalid_operation
-ddrmn687 remaindernear Inf Inf -> NaN Invalid_operation
-ddrmn688 remaindernear -1000 Inf -> -1000
-ddrmn689 remaindernear -Inf Inf -> NaN Invalid_operation
-ddrmn691 remaindernear -1 Inf -> -1
-ddrmn692 remaindernear 0 Inf -> 0
-ddrmn693 remaindernear -0 Inf -> -0
-ddrmn694 remaindernear 1 Inf -> 1
-ddrmn695 remaindernear 1000 Inf -> 1000
-ddrmn696 remaindernear Inf Inf -> NaN Invalid_operation
-
-ddrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation
-ddrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation
-ddrmn702 remaindernear -Inf -1 -> NaN Invalid_operation
-ddrmn703 remaindernear -Inf -0 -> NaN Invalid_operation
-ddrmn704 remaindernear -Inf 0 -> NaN Invalid_operation
-ddrmn705 remaindernear -Inf 1 -> NaN Invalid_operation
-ddrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation
-ddrmn707 remaindernear -Inf Inf -> NaN Invalid_operation
-ddrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation
-ddrmn709 remaindernear -1000 Inf -> -1000
-ddrmn710 remaindernear -1 -Inf -> -1
-ddrmn711 remaindernear -0 -Inf -> -0
-ddrmn712 remaindernear 0 -Inf -> 0
-ddrmn713 remaindernear 1 -Inf -> 1
-ddrmn714 remaindernear 1000 -Inf -> 1000
-ddrmn715 remaindernear Inf -Inf -> NaN Invalid_operation
-
-ddrmn721 remaindernear NaN -Inf -> NaN
-ddrmn722 remaindernear NaN -1000 -> NaN
-ddrmn723 remaindernear NaN -1 -> NaN
-ddrmn724 remaindernear NaN -0 -> NaN
-ddrmn725 remaindernear -NaN 0 -> -NaN
-ddrmn726 remaindernear NaN 1 -> NaN
-ddrmn727 remaindernear NaN 1000 -> NaN
-ddrmn728 remaindernear NaN Inf -> NaN
-ddrmn729 remaindernear NaN -NaN -> NaN
-ddrmn730 remaindernear -Inf NaN -> NaN
-ddrmn731 remaindernear -1000 NaN -> NaN
-ddrmn732 remaindernear -1 NaN -> NaN
-ddrmn733 remaindernear -0 -NaN -> -NaN
-ddrmn734 remaindernear 0 NaN -> NaN
-ddrmn735 remaindernear 1 -NaN -> -NaN
-ddrmn736 remaindernear 1000 NaN -> NaN
-ddrmn737 remaindernear Inf NaN -> NaN
-
-ddrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation
-ddrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation
-ddrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation
-ddrmn744 remaindernear sNaN -0 -> NaN Invalid_operation
-ddrmn745 remaindernear sNaN 0 -> NaN Invalid_operation
-ddrmn746 remaindernear sNaN 1 -> NaN Invalid_operation
-ddrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation
-ddrmn749 remaindernear sNaN NaN -> NaN Invalid_operation
-ddrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation
-ddrmn751 remaindernear NaN sNaN -> NaN Invalid_operation
-ddrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation
-ddrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation
-ddrmn754 remaindernear -1 sNaN -> NaN Invalid_operation
-ddrmn755 remaindernear -0 sNaN -> NaN Invalid_operation
-ddrmn756 remaindernear 0 sNaN -> NaN Invalid_operation
-ddrmn757 remaindernear 1 sNaN -> NaN Invalid_operation
-ddrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation
-ddrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation
-
--- propaging NaNs
-ddrmn760 remaindernear NaN1 NaN7 -> NaN1
-ddrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
-ddrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation
-ddrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
-ddrmn764 remaindernear 15 NaN11 -> NaN11
-ddrmn765 remaindernear NaN6 NaN12 -> NaN6
-ddrmn766 remaindernear Inf NaN13 -> NaN13
-ddrmn767 remaindernear NaN14 -Inf -> NaN14
-ddrmn768 remaindernear 0 NaN15 -> NaN15
-ddrmn769 remaindernear NaN16 -0 -> NaN16
-
--- edge cases of impossible
-ddrmn770 remaindernear 1234567890123456 10 -> -4
-ddrmn771 remaindernear 1234567890123456 1 -> 0
-ddrmn772 remaindernear 1234567890123456 0.1 -> NaN Division_impossible
-ddrmn773 remaindernear 1234567890123456 0.01 -> NaN Division_impossible
-
--- long operand checks
-ddrmn801 remaindernear 12345678000 100 -> 0
-ddrmn802 remaindernear 1 12345678000 -> 1
-ddrmn803 remaindernear 1234567800 10 -> 0
-ddrmn804 remaindernear 1 1234567800 -> 1
-ddrmn805 remaindernear 1234567890 10 -> 0
-ddrmn806 remaindernear 1 1234567890 -> 1
-ddrmn807 remaindernear 1234567891 10 -> 1
-ddrmn808 remaindernear 1 1234567891 -> 1
-ddrmn809 remaindernear 12345678901 100 -> 1
-ddrmn810 remaindernear 1 12345678901 -> 1
-ddrmn811 remaindernear 1234567896 10 -> -4
-ddrmn812 remaindernear 1 1234567896 -> 1
-
-ddrmn821 remaindernear 12345678000 100 -> 0
-ddrmn822 remaindernear 1 12345678000 -> 1
-ddrmn823 remaindernear 1234567800 10 -> 0
-ddrmn824 remaindernear 1 1234567800 -> 1
-ddrmn825 remaindernear 1234567890 10 -> 0
-ddrmn826 remaindernear 1 1234567890 -> 1
-ddrmn827 remaindernear 1234567891 10 -> 1
-ddrmn828 remaindernear 1 1234567891 -> 1
-ddrmn829 remaindernear 12345678901 100 -> 1
-ddrmn830 remaindernear 1 12345678901 -> 1
-ddrmn831 remaindernear 1234567896 10 -> -4
-ddrmn832 remaindernear 1 1234567896 -> 1
-
--- from divideint
-ddrmn840 remaindernear 100000000.0 1 -> 0.0
-ddrmn841 remaindernear 100000000.4 1 -> 0.4
-ddrmn842 remaindernear 100000000.5 1 -> 0.5
-ddrmn843 remaindernear 100000000.9 1 -> -0.1
-ddrmn844 remaindernear 100000000.999 1 -> -0.001
-ddrmn850 remaindernear 100000003 5 -> -2
-ddrmn851 remaindernear 10000003 5 -> -2
-ddrmn852 remaindernear 1000003 5 -> -2
-ddrmn853 remaindernear 100003 5 -> -2
-ddrmn854 remaindernear 10003 5 -> -2
-ddrmn855 remaindernear 1003 5 -> -2
-ddrmn856 remaindernear 103 5 -> -2
-ddrmn857 remaindernear 13 5 -> -2
-ddrmn858 remaindernear 1 5 -> 1
-
--- Vladimir's cases 1234567890123456
-ddrmn860 remaindernear 123.0e1 1000000000000000 -> 1230
-ddrmn861 remaindernear 1230 1000000000000000 -> 1230
-ddrmn862 remaindernear 12.3e2 1000000000000000 -> 1230
-ddrmn863 remaindernear 1.23e3 1000000000000000 -> 1230
-ddrmn864 remaindernear 123e1 1000000000000000 -> 1230
-ddrmn870 remaindernear 123e1 1000000000000000 -> 1230
-ddrmn871 remaindernear 123e1 100000000000000 -> 1230
-ddrmn872 remaindernear 123e1 10000000000000 -> 1230
-ddrmn873 remaindernear 123e1 1000000000000 -> 1230
-ddrmn874 remaindernear 123e1 100000000000 -> 1230
-ddrmn875 remaindernear 123e1 10000000000 -> 1230
-ddrmn876 remaindernear 123e1 1000000000 -> 1230
-ddrmn877 remaindernear 123e1 100000000 -> 1230
-ddrmn878 remaindernear 1230 100000000 -> 1230
-ddrmn879 remaindernear 123e1 10000000 -> 1230
-ddrmn880 remaindernear 123e1 1000000 -> 1230
-ddrmn881 remaindernear 123e1 100000 -> 1230
-ddrmn882 remaindernear 123e1 10000 -> 1230
-ddrmn883 remaindernear 123e1 1000 -> 230
-ddrmn884 remaindernear 123e1 100 -> 30
-ddrmn885 remaindernear 123e1 10 -> 0
-ddrmn886 remaindernear 123e1 1 -> 0
-
-ddrmn890 remaindernear 123e1 2000000000000000 -> 1230
-ddrmn891 remaindernear 123e1 200000000000000 -> 1230
-ddrmn892 remaindernear 123e1 20000000000000 -> 1230
-ddrmn893 remaindernear 123e1 2000000000000 -> 1230
-ddrmn894 remaindernear 123e1 200000000000 -> 1230
-ddrmn895 remaindernear 123e1 20000000000 -> 1230
-ddrmn896 remaindernear 123e1 2000000000 -> 1230
-ddrmn897 remaindernear 123e1 200000000 -> 1230
-ddrmn899 remaindernear 123e1 20000000 -> 1230
-ddrmn900 remaindernear 123e1 2000000 -> 1230
-ddrmn901 remaindernear 123e1 200000 -> 1230
-ddrmn902 remaindernear 123e1 20000 -> 1230
-ddrmn903 remaindernear 123e1 2000 -> -770
-ddrmn904 remaindernear 123e1 200 -> 30
-ddrmn905 remaindernear 123e1 20 -> -10
-ddrmn906 remaindernear 123e1 2 -> 0
-
-ddrmn910 remaindernear 123e1 5000000000000000 -> 1230
-ddrmn911 remaindernear 123e1 500000000000000 -> 1230
-ddrmn912 remaindernear 123e1 50000000000000 -> 1230
-ddrmn913 remaindernear 123e1 5000000000000 -> 1230
-ddrmn914 remaindernear 123e1 500000000000 -> 1230
-ddrmn915 remaindernear 123e1 50000000000 -> 1230
-ddrmn916 remaindernear 123e1 5000000000 -> 1230
-ddrmn917 remaindernear 123e1 500000000 -> 1230
-ddrmn919 remaindernear 123e1 50000000 -> 1230
-ddrmn920 remaindernear 123e1 5000000 -> 1230
-ddrmn921 remaindernear 123e1 500000 -> 1230
-ddrmn922 remaindernear 123e1 50000 -> 1230
-ddrmn923 remaindernear 123e1 5000 -> 1230
-ddrmn924 remaindernear 123e1 500 -> 230
-ddrmn925 remaindernear 123e1 50 -> -20
-ddrmn926 remaindernear 123e1 5 -> 0
-
-ddrmn930 remaindernear 123e1 9000000000000000 -> 1230
-ddrmn931 remaindernear 123e1 900000000000000 -> 1230
-ddrmn932 remaindernear 123e1 90000000000000 -> 1230
-ddrmn933 remaindernear 123e1 9000000000000 -> 1230
-ddrmn934 remaindernear 123e1 900000000000 -> 1230
-ddrmn935 remaindernear 123e1 90000000000 -> 1230
-ddrmn936 remaindernear 123e1 9000000000 -> 1230
-ddrmn937 remaindernear 123e1 900000000 -> 1230
-ddrmn939 remaindernear 123e1 90000000 -> 1230
-ddrmn940 remaindernear 123e1 9000000 -> 1230
-ddrmn941 remaindernear 123e1 900000 -> 1230
-ddrmn942 remaindernear 123e1 90000 -> 1230
-ddrmn943 remaindernear 123e1 9000 -> 1230
-ddrmn944 remaindernear 123e1 900 -> 330
-ddrmn945 remaindernear 123e1 90 -> -30
-ddrmn946 remaindernear 123e1 9 -> -3
-
-ddrmn950 remaindernear 123e1 1000000000000000 -> 1230
-ddrmn961 remaindernear 123e1 2999999999999999 -> 1230
-ddrmn962 remaindernear 123e1 3999999999999999 -> 1230
-ddrmn963 remaindernear 123e1 4999999999999999 -> 1230
-ddrmn964 remaindernear 123e1 5999999999999999 -> 1230
-ddrmn965 remaindernear 123e1 6999999999999999 -> 1230
-ddrmn966 remaindernear 123e1 7999999999999999 -> 1230
-ddrmn967 remaindernear 123e1 8999999999999999 -> 1230
-ddrmn968 remaindernear 123e1 9999999999999999 -> 1230
-ddrmn969 remaindernear 123e1 9876543210987654 -> 1230
-
-ddrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
-
-
--- overflow and underflow tests [from divide]
-ddrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible
-ddrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible
-ddrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible
-ddrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible
-ddrmn1055 remaindernear 1e-277 1e+311 -> 1E-277
-ddrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277
-ddrmn1057 remaindernear -1e-277 1e+311 -> -1E-277
-ddrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
-
--- destructive subtract
-ddrmn1100 remainderNear 1234567890123456 1.000000000000001 -> -0.234567890123455
-ddrmn1101 remainderNear 1234567890123456 1.00000000000001 -> -0.34567890123444
-ddrmn1102 remainderNear 1234567890123456 1.0000000000001 -> -0.4567890123333
-ddrmn1103 remainderNear 1234567890123455 4.000000000000001 -> -1.308641972530864
-ddrmn1104 remainderNear 1234567890123456 4.000000000000001 -> -0.308641972530864
-ddrmn1115 remainderNear 1234567890123456 4.9999999999999 -> 0.6913578024696
-ddrmn1116 remainderNear 1234567890123456 4.99999999999999 -> -1.53086421975308
-ddrmn1117 remainderNear 1234567890123456 4.999999999999999 -> 1.246913578024691
-ddrmn1118 remainderNear 1234567890123456 5.000000000000001 -> 0.753086421975309
-ddrmn1119 remainderNear 1234567890123456 5.00000000000001 -> -1.46913578024691
-ddrmn1110 remainderNear 1234567890123456 5.0000000000001 -> 1.3086421975314
-
--- Null tests
-ddrmn1000 remaindernear 10 # -> NaN Invalid_operation
-ddrmn1001 remaindernear # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddRemainderNear.decTest -- decDouble remainder-near --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks (as base, above)
+ddrmn001 remaindernear 1 1 -> 0
+ddrmn002 remaindernear 2 1 -> 0
+ddrmn003 remaindernear 1 2 -> 1
+ddrmn004 remaindernear 2 2 -> 0
+ddrmn005 remaindernear 0 1 -> 0
+ddrmn006 remaindernear 0 2 -> 0
+ddrmn007 remaindernear 1 3 -> 1
+ddrmn008 remaindernear 2 3 -> -1
+ddrmn009 remaindernear 3 3 -> 0
+
+ddrmn010 remaindernear 2.4 1 -> 0.4
+ddrmn011 remaindernear 2.4 -1 -> 0.4
+ddrmn012 remaindernear -2.4 1 -> -0.4
+ddrmn013 remaindernear -2.4 -1 -> -0.4
+ddrmn014 remaindernear 2.40 1 -> 0.40
+ddrmn015 remaindernear 2.400 1 -> 0.400
+ddrmn016 remaindernear 2.4 2 -> 0.4
+ddrmn017 remaindernear 2.400 2 -> 0.400
+ddrmn018 remaindernear 2. 2 -> 0
+ddrmn019 remaindernear 20 20 -> 0
+
+ddrmn020 remaindernear 187 187 -> 0
+ddrmn021 remaindernear 5 2 -> 1
+ddrmn022 remaindernear 5 2.0 -> 1.0
+ddrmn023 remaindernear 5 2.000 -> 1.000
+ddrmn024 remaindernear 5 0.200 -> 0.000
+ddrmn025 remaindernear 5 0.200 -> 0.000
+
+ddrmn030 remaindernear 1 2 -> 1
+ddrmn031 remaindernear 1 4 -> 1
+ddrmn032 remaindernear 1 8 -> 1
+
+ddrmn033 remaindernear 1 16 -> 1
+ddrmn034 remaindernear 1 32 -> 1
+ddrmn035 remaindernear 1 64 -> 1
+ddrmn040 remaindernear 1 -2 -> 1
+ddrmn041 remaindernear 1 -4 -> 1
+ddrmn042 remaindernear 1 -8 -> 1
+ddrmn043 remaindernear 1 -16 -> 1
+ddrmn044 remaindernear 1 -32 -> 1
+ddrmn045 remaindernear 1 -64 -> 1
+ddrmn050 remaindernear -1 2 -> -1
+ddrmn051 remaindernear -1 4 -> -1
+ddrmn052 remaindernear -1 8 -> -1
+ddrmn053 remaindernear -1 16 -> -1
+ddrmn054 remaindernear -1 32 -> -1
+ddrmn055 remaindernear -1 64 -> -1
+ddrmn060 remaindernear -1 -2 -> -1
+ddrmn061 remaindernear -1 -4 -> -1
+ddrmn062 remaindernear -1 -8 -> -1
+ddrmn063 remaindernear -1 -16 -> -1
+ddrmn064 remaindernear -1 -32 -> -1
+ddrmn065 remaindernear -1 -64 -> -1
+
+ddrmn066 remaindernear 9.9 1 -> -0.1
+ddrmn067 remaindernear 99.7 1 -> -0.3
+ddrmn068 remaindernear 999999999 1 -> 0
+ddrmn069 remaindernear 999999999.4 1 -> 0.4
+ddrmn070 remaindernear 999999999.5 1 -> -0.5
+ddrmn071 remaindernear 999999999.9 1 -> -0.1
+ddrmn072 remaindernear 999999999.999 1 -> -0.001
+ddrmn073 remaindernear 999999.999999 1 -> -0.000001
+ddrmn074 remaindernear 9 1 -> 0
+ddrmn075 remaindernear 9999999999999999 1 -> 0
+ddrmn076 remaindernear 9999999999999999 2 -> -1
+ddrmn077 remaindernear 9999999999999999 3 -> 0
+ddrmn078 remaindernear 9999999999999999 4 -> -1
+
+ddrmn080 remaindernear 0. 1 -> 0
+ddrmn081 remaindernear .0 1 -> 0.0
+ddrmn082 remaindernear 0.00 1 -> 0.00
+ddrmn083 remaindernear 0.00E+9 1 -> 0
+ddrmn084 remaindernear 0.00E+3 1 -> 0
+ddrmn085 remaindernear 0.00E+2 1 -> 0
+ddrmn086 remaindernear 0.00E+1 1 -> 0.0
+ddrmn087 remaindernear 0.00E+0 1 -> 0.00
+ddrmn088 remaindernear 0.00E-0 1 -> 0.00
+ddrmn089 remaindernear 0.00E-1 1 -> 0.000
+ddrmn090 remaindernear 0.00E-2 1 -> 0.0000
+ddrmn091 remaindernear 0.00E-3 1 -> 0.00000
+ddrmn092 remaindernear 0.00E-4 1 -> 0.000000
+ddrmn093 remaindernear 0.00E-5 1 -> 0E-7
+ddrmn094 remaindernear 0.00E-6 1 -> 0E-8
+ddrmn095 remaindernear 0.0000E-50 1 -> 0E-54
+
+-- Various flavours of remaindernear by 0
+ddrmn101 remaindernear 0 0 -> NaN Division_undefined
+ddrmn102 remaindernear 0 -0 -> NaN Division_undefined
+ddrmn103 remaindernear -0 0 -> NaN Division_undefined
+ddrmn104 remaindernear -0 -0 -> NaN Division_undefined
+ddrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined
+ddrmn106 remaindernear 0.000 0 -> NaN Division_undefined
+-- [Some think this next group should be Division_by_zero exception, but
+-- IEEE 854 is explicit that it is Invalid operation .. for
+-- remainder-near, anyway]
+ddrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation
+ddrmn108 remaindernear 0.01 0 -> NaN Invalid_operation
+ddrmn109 remaindernear 0.1 0 -> NaN Invalid_operation
+ddrmn110 remaindernear 1 0 -> NaN Invalid_operation
+ddrmn111 remaindernear 1 0.0 -> NaN Invalid_operation
+ddrmn112 remaindernear 10 0.0 -> NaN Invalid_operation
+ddrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation
+ddrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation
+ddrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation
+ddrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation
+ddrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation
+ddrmn120 remaindernear 1 -0 -> NaN Invalid_operation
+ddrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation
+ddrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation
+ddrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation
+ddrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation
+-- and zeros on left
+ddrmn130 remaindernear 0 1 -> 0
+ddrmn131 remaindernear 0 -1 -> 0
+ddrmn132 remaindernear 0.0 1 -> 0.0
+ddrmn133 remaindernear 0.0 -1 -> 0.0
+ddrmn134 remaindernear -0 1 -> -0
+ddrmn135 remaindernear -0 -1 -> -0
+ddrmn136 remaindernear -0.0 1 -> -0.0
+ddrmn137 remaindernear -0.0 -1 -> -0.0
+
+-- 0.5ers
+ddrmn143 remaindernear 0.5 2 -> 0.5
+ddrmn144 remaindernear 0.5 2.1 -> 0.5
+ddrmn145 remaindernear 0.5 2.01 -> 0.50
+ddrmn146 remaindernear 0.5 2.001 -> 0.500
+ddrmn147 remaindernear 0.50 2 -> 0.50
+ddrmn148 remaindernear 0.50 2.01 -> 0.50
+ddrmn149 remaindernear 0.50 2.001 -> 0.500
+
+-- steadies
+ddrmn150 remaindernear 1 1 -> 0
+ddrmn151 remaindernear 1 2 -> 1
+ddrmn152 remaindernear 1 3 -> 1
+ddrmn153 remaindernear 1 4 -> 1
+ddrmn154 remaindernear 1 5 -> 1
+ddrmn155 remaindernear 1 6 -> 1
+ddrmn156 remaindernear 1 7 -> 1
+ddrmn157 remaindernear 1 8 -> 1
+ddrmn158 remaindernear 1 9 -> 1
+ddrmn159 remaindernear 1 10 -> 1
+ddrmn160 remaindernear 1 1 -> 0
+ddrmn161 remaindernear 2 1 -> 0
+ddrmn162 remaindernear 3 1 -> 0
+ddrmn163 remaindernear 4 1 -> 0
+ddrmn164 remaindernear 5 1 -> 0
+ddrmn165 remaindernear 6 1 -> 0
+ddrmn166 remaindernear 7 1 -> 0
+ddrmn167 remaindernear 8 1 -> 0
+ddrmn168 remaindernear 9 1 -> 0
+ddrmn169 remaindernear 10 1 -> 0
+
+-- some differences from remainder
+ddrmn171 remaindernear 0.4 1.020 -> 0.400
+ddrmn172 remaindernear 0.50 1.020 -> 0.500
+ddrmn173 remaindernear 0.51 1.020 -> 0.510
+ddrmn174 remaindernear 0.52 1.020 -> -0.500
+ddrmn175 remaindernear 0.6 1.020 -> -0.420
+
+-- More flavours of remaindernear by 0
+ddrmn201 remaindernear 0 0 -> NaN Division_undefined
+ddrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined
+ddrmn203 remaindernear 0.000 0 -> NaN Division_undefined
+ddrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation
+ddrmn205 remaindernear 0.01 0 -> NaN Invalid_operation
+ddrmn206 remaindernear 0.1 0 -> NaN Invalid_operation
+ddrmn207 remaindernear 1 0 -> NaN Invalid_operation
+ddrmn208 remaindernear 1 0.0 -> NaN Invalid_operation
+ddrmn209 remaindernear 10 0.0 -> NaN Invalid_operation
+ddrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation
+ddrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation
+
+-- tests from the extended specification
+ddrmn221 remaindernear 2.1 3 -> -0.9
+ddrmn222 remaindernear 10 6 -> -2
+ddrmn223 remaindernear 10 3 -> 1
+ddrmn224 remaindernear -10 3 -> -1
+ddrmn225 remaindernear 10.2 1 -> 0.2
+ddrmn226 remaindernear 10 0.3 -> 0.1
+ddrmn227 remaindernear 3.6 1.3 -> -0.3
+
+-- some differences from remainder
+ddrmn231 remaindernear -0.4 1.020 -> -0.400
+ddrmn232 remaindernear -0.50 1.020 -> -0.500
+ddrmn233 remaindernear -0.51 1.020 -> -0.510
+ddrmn234 remaindernear -0.52 1.020 -> 0.500
+ddrmn235 remaindernear -0.6 1.020 -> 0.420
+
+-- high Xs
+ddrmn240 remaindernear 1E+2 1.00 -> 0.00
+
+-- ddrmn3xx are from DiagBigDecimal
+ddrmn301 remaindernear 1 3 -> 1
+ddrmn302 remaindernear 5 5 -> 0
+ddrmn303 remaindernear 13 10 -> 3
+ddrmn304 remaindernear 13 50 -> 13
+ddrmn305 remaindernear 13 100 -> 13
+ddrmn306 remaindernear 13 1000 -> 13
+ddrmn307 remaindernear .13 1 -> 0.13
+ddrmn308 remaindernear 0.133 1 -> 0.133
+ddrmn309 remaindernear 0.1033 1 -> 0.1033
+ddrmn310 remaindernear 1.033 1 -> 0.033
+ddrmn311 remaindernear 10.33 1 -> 0.33
+ddrmn312 remaindernear 10.33 10 -> 0.33
+ddrmn313 remaindernear 103.3 1 -> 0.3
+ddrmn314 remaindernear 133 10 -> 3
+ddrmn315 remaindernear 1033 10 -> 3
+ddrmn316 remaindernear 1033 50 -> -17
+ddrmn317 remaindernear 101.0 3 -> -1.0
+ddrmn318 remaindernear 102.0 3 -> 0.0
+ddrmn319 remaindernear 103.0 3 -> 1.0
+ddrmn320 remaindernear 2.40 1 -> 0.40
+ddrmn321 remaindernear 2.400 1 -> 0.400
+ddrmn322 remaindernear 2.4 1 -> 0.4
+ddrmn323 remaindernear 2.4 2 -> 0.4
+ddrmn324 remaindernear 2.400 2 -> 0.400
+ddrmn325 remaindernear 1 0.3 -> 0.1
+ddrmn326 remaindernear 1 0.30 -> 0.10
+ddrmn327 remaindernear 1 0.300 -> 0.100
+ddrmn328 remaindernear 1 0.3000 -> 0.1000
+ddrmn329 remaindernear 1.0 0.3 -> 0.1
+ddrmn330 remaindernear 1.00 0.3 -> 0.10
+ddrmn331 remaindernear 1.000 0.3 -> 0.100
+ddrmn332 remaindernear 1.0000 0.3 -> 0.1000
+ddrmn333 remaindernear 0.5 2 -> 0.5
+ddrmn334 remaindernear 0.5 2.1 -> 0.5
+ddrmn335 remaindernear 0.5 2.01 -> 0.50
+ddrmn336 remaindernear 0.5 2.001 -> 0.500
+ddrmn337 remaindernear 0.50 2 -> 0.50
+ddrmn338 remaindernear 0.50 2.01 -> 0.50
+ddrmn339 remaindernear 0.50 2.001 -> 0.500
+
+ddrmn340 remaindernear 0.5 0.5000001 -> -1E-7
+ddrmn341 remaindernear 0.5 0.50000001 -> -1E-8
+ddrmn342 remaindernear 0.5 0.500000001 -> -1E-9
+ddrmn343 remaindernear 0.5 0.5000000001 -> -1E-10
+ddrmn344 remaindernear 0.5 0.50000000001 -> -1E-11
+ddrmn345 remaindernear 0.5 0.4999999 -> 1E-7
+ddrmn346 remaindernear 0.5 0.49999999 -> 1E-8
+ddrmn347 remaindernear 0.5 0.499999999 -> 1E-9
+ddrmn348 remaindernear 0.5 0.4999999999 -> 1E-10
+ddrmn349 remaindernear 0.5 0.49999999999 -> 1E-11
+ddrmn350 remaindernear 0.5 0.499999999999 -> 1E-12
+
+ddrmn351 remaindernear 0.03 7 -> 0.03
+ddrmn352 remaindernear 5 2 -> 1
+ddrmn353 remaindernear 4.1 2 -> 0.1
+ddrmn354 remaindernear 4.01 2 -> 0.01
+ddrmn355 remaindernear 4.001 2 -> 0.001
+ddrmn356 remaindernear 4.0001 2 -> 0.0001
+ddrmn357 remaindernear 4.00001 2 -> 0.00001
+ddrmn358 remaindernear 4.000001 2 -> 0.000001
+ddrmn359 remaindernear 4.0000001 2 -> 1E-7
+
+ddrmn360 remaindernear 1.2 0.7345 -> -0.2690
+ddrmn361 remaindernear 0.8 12 -> 0.8
+ddrmn362 remaindernear 0.8 0.2 -> 0.0
+ddrmn363 remaindernear 0.8 0.3 -> -0.1
+ddrmn364 remaindernear 0.800 12 -> 0.800
+ddrmn365 remaindernear 0.800 1.7 -> 0.800
+ddrmn366 remaindernear 2.400 2 -> 0.400
+
+-- round to even
+ddrmn371 remaindernear 121 2 -> 1
+ddrmn372 remaindernear 122 2 -> 0
+ddrmn373 remaindernear 123 2 -> -1
+ddrmn374 remaindernear 124 2 -> 0
+ddrmn375 remaindernear 125 2 -> 1
+ddrmn376 remaindernear 126 2 -> 0
+ddrmn377 remaindernear 127 2 -> -1
+
+ddrmn381 remaindernear 12345 1 -> 0
+ddrmn382 remaindernear 12345 1.0001 -> -0.2344
+ddrmn383 remaindernear 12345 1.001 -> -0.333
+ddrmn384 remaindernear 12345 1.01 -> -0.23
+ddrmn385 remaindernear 12345 1.1 -> -0.3
+ddrmn386 remaindernear 12355 4 -> -1
+ddrmn387 remaindernear 12345 4 -> 1
+ddrmn388 remaindernear 12355 4.0001 -> -1.3089
+ddrmn389 remaindernear 12345 4.0001 -> 0.6914
+ddrmn390 remaindernear 12345 4.9 -> 1.9
+ddrmn391 remaindernear 12345 4.99 -> -0.26
+ddrmn392 remaindernear 12345 4.999 -> 2.469
+ddrmn393 remaindernear 12345 4.9999 -> 0.2469
+ddrmn394 remaindernear 12345 5 -> 0
+ddrmn395 remaindernear 12345 5.0001 -> -0.2469
+ddrmn396 remaindernear 12345 5.001 -> -2.469
+ddrmn397 remaindernear 12345 5.01 -> 0.36
+ddrmn398 remaindernear 12345 5.1 -> -2.1
+
+-- the nasty division-by-1 cases
+ddrmn401 remaindernear 0.4 1 -> 0.4
+ddrmn402 remaindernear 0.45 1 -> 0.45
+ddrmn403 remaindernear 0.455 1 -> 0.455
+ddrmn404 remaindernear 0.4555 1 -> 0.4555
+ddrmn405 remaindernear 0.45555 1 -> 0.45555
+ddrmn406 remaindernear 0.455555 1 -> 0.455555
+ddrmn407 remaindernear 0.4555555 1 -> 0.4555555
+ddrmn408 remaindernear 0.45555555 1 -> 0.45555555
+ddrmn409 remaindernear 0.455555555 1 -> 0.455555555
+-- with spill... [412 exercises sticktab loop]
+ddrmn411 remaindernear 0.5 1 -> 0.5
+ddrmn412 remaindernear 0.55 1 -> -0.45
+ddrmn413 remaindernear 0.555 1 -> -0.445
+ddrmn414 remaindernear 0.5555 1 -> -0.4445
+ddrmn415 remaindernear 0.55555 1 -> -0.44445
+ddrmn416 remaindernear 0.555555 1 -> -0.444445
+ddrmn417 remaindernear 0.5555555 1 -> -0.4444445
+ddrmn418 remaindernear 0.55555555 1 -> -0.44444445
+ddrmn419 remaindernear 0.555555555 1 -> -0.444444445
+
+-- folddowns
+ddrmn421 remaindernear 1E+384 1 -> NaN Division_impossible
+ddrmn422 remaindernear 1E+384 1E+383 -> 0E+369 Clamped
+ddrmn423 remaindernear 1E+384 2E+383 -> 0E+369 Clamped
+ddrmn424 remaindernear 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
+ddrmn425 remaindernear 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
+ddrmn426 remaindernear 1E+384 5E+383 -> 0E+369 Clamped
+ddrmn427 remaindernear 1E+384 6E+383 -> -2.00000000000000E+383 Clamped
+ddrmn428 remaindernear 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
+ddrmn429 remaindernear 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
+ddrmn430 remaindernear 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
+-- tinies
+ddrmn431 remaindernear 1E-397 1E-398 -> 0E-398
+ddrmn432 remaindernear 1E-397 2E-398 -> 0E-398
+ddrmn433 remaindernear 1E-397 3E-398 -> 1E-398 Subnormal
+ddrmn434 remaindernear 1E-397 4E-398 -> 2E-398 Subnormal
+ddrmn435 remaindernear 1E-397 5E-398 -> 0E-398
+ddrmn436 remaindernear 1E-397 6E-398 -> -2E-398 Subnormal
+ddrmn437 remaindernear 1E-397 7E-398 -> 3E-398 Subnormal
+ddrmn438 remaindernear 1E-397 8E-398 -> 2E-398 Subnormal
+ddrmn439 remaindernear 1E-397 9E-398 -> 1E-398 Subnormal
+ddrmn440 remaindernear 1E-397 10E-398 -> 0E-398
+ddrmn441 remaindernear 1E-397 11E-398 -> -1E-398 Subnormal
+ddrmn442 remaindernear 100E-397 11E-398 -> -1E-398 Subnormal
+ddrmn443 remaindernear 100E-397 20E-398 -> 0E-398
+ddrmn444 remaindernear 100E-397 21E-398 -> -8E-398 Subnormal
+ddrmn445 remaindernear 100E-397 30E-398 -> 1.0E-397 Subnormal
+
+-- zero signs
+ddrmn650 remaindernear 1 1 -> 0
+ddrmn651 remaindernear -1 1 -> -0
+ddrmn652 remaindernear 1 -1 -> 0
+ddrmn653 remaindernear -1 -1 -> -0
+ddrmn654 remaindernear 0 1 -> 0
+ddrmn655 remaindernear -0 1 -> -0
+ddrmn656 remaindernear 0 -1 -> 0
+ddrmn657 remaindernear -0 -1 -> -0
+ddrmn658 remaindernear 0.00 1 -> 0.00
+ddrmn659 remaindernear -0.00 1 -> -0.00
+
+-- Specials
+ddrmn680 remaindernear Inf -Inf -> NaN Invalid_operation
+ddrmn681 remaindernear Inf -1000 -> NaN Invalid_operation
+ddrmn682 remaindernear Inf -1 -> NaN Invalid_operation
+ddrmn683 remaindernear Inf 0 -> NaN Invalid_operation
+ddrmn684 remaindernear Inf -0 -> NaN Invalid_operation
+ddrmn685 remaindernear Inf 1 -> NaN Invalid_operation
+ddrmn686 remaindernear Inf 1000 -> NaN Invalid_operation
+ddrmn687 remaindernear Inf Inf -> NaN Invalid_operation
+ddrmn688 remaindernear -1000 Inf -> -1000
+ddrmn689 remaindernear -Inf Inf -> NaN Invalid_operation
+ddrmn691 remaindernear -1 Inf -> -1
+ddrmn692 remaindernear 0 Inf -> 0
+ddrmn693 remaindernear -0 Inf -> -0
+ddrmn694 remaindernear 1 Inf -> 1
+ddrmn695 remaindernear 1000 Inf -> 1000
+ddrmn696 remaindernear Inf Inf -> NaN Invalid_operation
+
+ddrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation
+ddrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation
+ddrmn702 remaindernear -Inf -1 -> NaN Invalid_operation
+ddrmn703 remaindernear -Inf -0 -> NaN Invalid_operation
+ddrmn704 remaindernear -Inf 0 -> NaN Invalid_operation
+ddrmn705 remaindernear -Inf 1 -> NaN Invalid_operation
+ddrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation
+ddrmn707 remaindernear -Inf Inf -> NaN Invalid_operation
+ddrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation
+ddrmn709 remaindernear -1000 Inf -> -1000
+ddrmn710 remaindernear -1 -Inf -> -1
+ddrmn711 remaindernear -0 -Inf -> -0
+ddrmn712 remaindernear 0 -Inf -> 0
+ddrmn713 remaindernear 1 -Inf -> 1
+ddrmn714 remaindernear 1000 -Inf -> 1000
+ddrmn715 remaindernear Inf -Inf -> NaN Invalid_operation
+
+ddrmn721 remaindernear NaN -Inf -> NaN
+ddrmn722 remaindernear NaN -1000 -> NaN
+ddrmn723 remaindernear NaN -1 -> NaN
+ddrmn724 remaindernear NaN -0 -> NaN
+ddrmn725 remaindernear -NaN 0 -> -NaN
+ddrmn726 remaindernear NaN 1 -> NaN
+ddrmn727 remaindernear NaN 1000 -> NaN
+ddrmn728 remaindernear NaN Inf -> NaN
+ddrmn729 remaindernear NaN -NaN -> NaN
+ddrmn730 remaindernear -Inf NaN -> NaN
+ddrmn731 remaindernear -1000 NaN -> NaN
+ddrmn732 remaindernear -1 NaN -> NaN
+ddrmn733 remaindernear -0 -NaN -> -NaN
+ddrmn734 remaindernear 0 NaN -> NaN
+ddrmn735 remaindernear 1 -NaN -> -NaN
+ddrmn736 remaindernear 1000 NaN -> NaN
+ddrmn737 remaindernear Inf NaN -> NaN
+
+ddrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation
+ddrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation
+ddrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation
+ddrmn744 remaindernear sNaN -0 -> NaN Invalid_operation
+ddrmn745 remaindernear sNaN 0 -> NaN Invalid_operation
+ddrmn746 remaindernear sNaN 1 -> NaN Invalid_operation
+ddrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation
+ddrmn749 remaindernear sNaN NaN -> NaN Invalid_operation
+ddrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation
+ddrmn751 remaindernear NaN sNaN -> NaN Invalid_operation
+ddrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation
+ddrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation
+ddrmn754 remaindernear -1 sNaN -> NaN Invalid_operation
+ddrmn755 remaindernear -0 sNaN -> NaN Invalid_operation
+ddrmn756 remaindernear 0 sNaN -> NaN Invalid_operation
+ddrmn757 remaindernear 1 sNaN -> NaN Invalid_operation
+ddrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation
+ddrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation
+
+-- propaging NaNs
+ddrmn760 remaindernear NaN1 NaN7 -> NaN1
+ddrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
+ddrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation
+ddrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
+ddrmn764 remaindernear 15 NaN11 -> NaN11
+ddrmn765 remaindernear NaN6 NaN12 -> NaN6
+ddrmn766 remaindernear Inf NaN13 -> NaN13
+ddrmn767 remaindernear NaN14 -Inf -> NaN14
+ddrmn768 remaindernear 0 NaN15 -> NaN15
+ddrmn769 remaindernear NaN16 -0 -> NaN16
+
+-- edge cases of impossible
+ddrmn770 remaindernear 1234567890123456 10 -> -4
+ddrmn771 remaindernear 1234567890123456 1 -> 0
+ddrmn772 remaindernear 1234567890123456 0.1 -> NaN Division_impossible
+ddrmn773 remaindernear 1234567890123456 0.01 -> NaN Division_impossible
+
+-- long operand checks
+ddrmn801 remaindernear 12345678000 100 -> 0
+ddrmn802 remaindernear 1 12345678000 -> 1
+ddrmn803 remaindernear 1234567800 10 -> 0
+ddrmn804 remaindernear 1 1234567800 -> 1
+ddrmn805 remaindernear 1234567890 10 -> 0
+ddrmn806 remaindernear 1 1234567890 -> 1
+ddrmn807 remaindernear 1234567891 10 -> 1
+ddrmn808 remaindernear 1 1234567891 -> 1
+ddrmn809 remaindernear 12345678901 100 -> 1
+ddrmn810 remaindernear 1 12345678901 -> 1
+ddrmn811 remaindernear 1234567896 10 -> -4
+ddrmn812 remaindernear 1 1234567896 -> 1
+
+ddrmn821 remaindernear 12345678000 100 -> 0
+ddrmn822 remaindernear 1 12345678000 -> 1
+ddrmn823 remaindernear 1234567800 10 -> 0
+ddrmn824 remaindernear 1 1234567800 -> 1
+ddrmn825 remaindernear 1234567890 10 -> 0
+ddrmn826 remaindernear 1 1234567890 -> 1
+ddrmn827 remaindernear 1234567891 10 -> 1
+ddrmn828 remaindernear 1 1234567891 -> 1
+ddrmn829 remaindernear 12345678901 100 -> 1
+ddrmn830 remaindernear 1 12345678901 -> 1
+ddrmn831 remaindernear 1234567896 10 -> -4
+ddrmn832 remaindernear 1 1234567896 -> 1
+
+-- from divideint
+ddrmn840 remaindernear 100000000.0 1 -> 0.0
+ddrmn841 remaindernear 100000000.4 1 -> 0.4
+ddrmn842 remaindernear 100000000.5 1 -> 0.5
+ddrmn843 remaindernear 100000000.9 1 -> -0.1
+ddrmn844 remaindernear 100000000.999 1 -> -0.001
+ddrmn850 remaindernear 100000003 5 -> -2
+ddrmn851 remaindernear 10000003 5 -> -2
+ddrmn852 remaindernear 1000003 5 -> -2
+ddrmn853 remaindernear 100003 5 -> -2
+ddrmn854 remaindernear 10003 5 -> -2
+ddrmn855 remaindernear 1003 5 -> -2
+ddrmn856 remaindernear 103 5 -> -2
+ddrmn857 remaindernear 13 5 -> -2
+ddrmn858 remaindernear 1 5 -> 1
+
+-- Vladimir's cases 1234567890123456
+ddrmn860 remaindernear 123.0e1 1000000000000000 -> 1230
+ddrmn861 remaindernear 1230 1000000000000000 -> 1230
+ddrmn862 remaindernear 12.3e2 1000000000000000 -> 1230
+ddrmn863 remaindernear 1.23e3 1000000000000000 -> 1230
+ddrmn864 remaindernear 123e1 1000000000000000 -> 1230
+ddrmn870 remaindernear 123e1 1000000000000000 -> 1230
+ddrmn871 remaindernear 123e1 100000000000000 -> 1230
+ddrmn872 remaindernear 123e1 10000000000000 -> 1230
+ddrmn873 remaindernear 123e1 1000000000000 -> 1230
+ddrmn874 remaindernear 123e1 100000000000 -> 1230
+ddrmn875 remaindernear 123e1 10000000000 -> 1230
+ddrmn876 remaindernear 123e1 1000000000 -> 1230
+ddrmn877 remaindernear 123e1 100000000 -> 1230
+ddrmn878 remaindernear 1230 100000000 -> 1230
+ddrmn879 remaindernear 123e1 10000000 -> 1230
+ddrmn880 remaindernear 123e1 1000000 -> 1230
+ddrmn881 remaindernear 123e1 100000 -> 1230
+ddrmn882 remaindernear 123e1 10000 -> 1230
+ddrmn883 remaindernear 123e1 1000 -> 230
+ddrmn884 remaindernear 123e1 100 -> 30
+ddrmn885 remaindernear 123e1 10 -> 0
+ddrmn886 remaindernear 123e1 1 -> 0
+
+ddrmn890 remaindernear 123e1 2000000000000000 -> 1230
+ddrmn891 remaindernear 123e1 200000000000000 -> 1230
+ddrmn892 remaindernear 123e1 20000000000000 -> 1230
+ddrmn893 remaindernear 123e1 2000000000000 -> 1230
+ddrmn894 remaindernear 123e1 200000000000 -> 1230
+ddrmn895 remaindernear 123e1 20000000000 -> 1230
+ddrmn896 remaindernear 123e1 2000000000 -> 1230
+ddrmn897 remaindernear 123e1 200000000 -> 1230
+ddrmn899 remaindernear 123e1 20000000 -> 1230
+ddrmn900 remaindernear 123e1 2000000 -> 1230
+ddrmn901 remaindernear 123e1 200000 -> 1230
+ddrmn902 remaindernear 123e1 20000 -> 1230
+ddrmn903 remaindernear 123e1 2000 -> -770
+ddrmn904 remaindernear 123e1 200 -> 30
+ddrmn905 remaindernear 123e1 20 -> -10
+ddrmn906 remaindernear 123e1 2 -> 0
+
+ddrmn910 remaindernear 123e1 5000000000000000 -> 1230
+ddrmn911 remaindernear 123e1 500000000000000 -> 1230
+ddrmn912 remaindernear 123e1 50000000000000 -> 1230
+ddrmn913 remaindernear 123e1 5000000000000 -> 1230
+ddrmn914 remaindernear 123e1 500000000000 -> 1230
+ddrmn915 remaindernear 123e1 50000000000 -> 1230
+ddrmn916 remaindernear 123e1 5000000000 -> 1230
+ddrmn917 remaindernear 123e1 500000000 -> 1230
+ddrmn919 remaindernear 123e1 50000000 -> 1230
+ddrmn920 remaindernear 123e1 5000000 -> 1230
+ddrmn921 remaindernear 123e1 500000 -> 1230
+ddrmn922 remaindernear 123e1 50000 -> 1230
+ddrmn923 remaindernear 123e1 5000 -> 1230
+ddrmn924 remaindernear 123e1 500 -> 230
+ddrmn925 remaindernear 123e1 50 -> -20
+ddrmn926 remaindernear 123e1 5 -> 0
+
+ddrmn930 remaindernear 123e1 9000000000000000 -> 1230
+ddrmn931 remaindernear 123e1 900000000000000 -> 1230
+ddrmn932 remaindernear 123e1 90000000000000 -> 1230
+ddrmn933 remaindernear 123e1 9000000000000 -> 1230
+ddrmn934 remaindernear 123e1 900000000000 -> 1230
+ddrmn935 remaindernear 123e1 90000000000 -> 1230
+ddrmn936 remaindernear 123e1 9000000000 -> 1230
+ddrmn937 remaindernear 123e1 900000000 -> 1230
+ddrmn939 remaindernear 123e1 90000000 -> 1230
+ddrmn940 remaindernear 123e1 9000000 -> 1230
+ddrmn941 remaindernear 123e1 900000 -> 1230
+ddrmn942 remaindernear 123e1 90000 -> 1230
+ddrmn943 remaindernear 123e1 9000 -> 1230
+ddrmn944 remaindernear 123e1 900 -> 330
+ddrmn945 remaindernear 123e1 90 -> -30
+ddrmn946 remaindernear 123e1 9 -> -3
+
+ddrmn950 remaindernear 123e1 1000000000000000 -> 1230
+ddrmn961 remaindernear 123e1 2999999999999999 -> 1230
+ddrmn962 remaindernear 123e1 3999999999999999 -> 1230
+ddrmn963 remaindernear 123e1 4999999999999999 -> 1230
+ddrmn964 remaindernear 123e1 5999999999999999 -> 1230
+ddrmn965 remaindernear 123e1 6999999999999999 -> 1230
+ddrmn966 remaindernear 123e1 7999999999999999 -> 1230
+ddrmn967 remaindernear 123e1 8999999999999999 -> 1230
+ddrmn968 remaindernear 123e1 9999999999999999 -> 1230
+ddrmn969 remaindernear 123e1 9876543210987654 -> 1230
+
+ddrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
+
+
+-- overflow and underflow tests [from divide]
+ddrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible
+ddrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible
+ddrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible
+ddrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible
+ddrmn1055 remaindernear 1e-277 1e+311 -> 1E-277
+ddrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277
+ddrmn1057 remaindernear -1e-277 1e+311 -> -1E-277
+ddrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
+
+-- destructive subtract
+ddrmn1100 remainderNear 1234567890123456 1.000000000000001 -> -0.234567890123455
+ddrmn1101 remainderNear 1234567890123456 1.00000000000001 -> -0.34567890123444
+ddrmn1102 remainderNear 1234567890123456 1.0000000000001 -> -0.4567890123333
+ddrmn1103 remainderNear 1234567890123455 4.000000000000001 -> -1.308641972530864
+ddrmn1104 remainderNear 1234567890123456 4.000000000000001 -> -0.308641972530864
+ddrmn1115 remainderNear 1234567890123456 4.9999999999999 -> 0.6913578024696
+ddrmn1116 remainderNear 1234567890123456 4.99999999999999 -> -1.53086421975308
+ddrmn1117 remainderNear 1234567890123456 4.999999999999999 -> 1.246913578024691
+ddrmn1118 remainderNear 1234567890123456 5.000000000000001 -> 0.753086421975309
+ddrmn1119 remainderNear 1234567890123456 5.00000000000001 -> -1.46913578024691
+ddrmn1110 remainderNear 1234567890123456 5.0000000000001 -> 1.3086421975314
+
+-- Null tests
+ddrmn1000 remaindernear 10 # -> NaN Invalid_operation
+ddrmn1001 remaindernear # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddRotate.decTest b/Lib/test/decimaltestdata/ddRotate.decTest
index 8b0fe2620d..87eeb1c0f1 100644
--- a/Lib/test/decimaltestdata/ddRotate.decTest
+++ b/Lib/test/decimaltestdata/ddRotate.decTest
@@ -1,262 +1,262 @@
-------------------------------------------------------------------------
--- ddRotate.decTest -- rotate a decDouble coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddrot001 rotate 0 0 -> 0
-ddrot002 rotate 0 2 -> 0
-ddrot003 rotate 1 2 -> 100
-ddrot004 rotate 1 15 -> 1000000000000000
-ddrot005 rotate 1 16 -> 1
-ddrot006 rotate 1 -1 -> 1000000000000000
-ddrot007 rotate 0 -2 -> 0
-ddrot008 rotate 1234567890123456 -1 -> 6123456789012345
-ddrot009 rotate 1234567890123456 -15 -> 2345678901234561
-ddrot010 rotate 1234567890123456 -16 -> 1234567890123456
-ddrot011 rotate 9934567890123456 -15 -> 9345678901234569
-ddrot012 rotate 9934567890123456 -16 -> 9934567890123456
-
--- rhs must be an integer
-ddrot015 rotate 1 1.5 -> NaN Invalid_operation
-ddrot016 rotate 1 1.0 -> NaN Invalid_operation
-ddrot017 rotate 1 0.1 -> NaN Invalid_operation
-ddrot018 rotate 1 0.0 -> NaN Invalid_operation
-ddrot019 rotate 1 1E+1 -> NaN Invalid_operation
-ddrot020 rotate 1 1E+99 -> NaN Invalid_operation
-ddrot021 rotate 1 Inf -> NaN Invalid_operation
-ddrot022 rotate 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-ddrot025 rotate 1 -1000 -> NaN Invalid_operation
-ddrot026 rotate 1 -17 -> NaN Invalid_operation
-ddrot027 rotate 1 17 -> NaN Invalid_operation
-ddrot028 rotate 1 1000 -> NaN Invalid_operation
-
--- full pattern
-ddrot030 rotate 1234567890123456 -16 -> 1234567890123456
-ddrot031 rotate 1234567890123456 -15 -> 2345678901234561
-ddrot032 rotate 1234567890123456 -14 -> 3456789012345612
-ddrot033 rotate 1234567890123456 -13 -> 4567890123456123
-ddrot034 rotate 1234567890123456 -12 -> 5678901234561234
-ddrot035 rotate 1234567890123456 -11 -> 6789012345612345
-ddrot036 rotate 1234567890123456 -10 -> 7890123456123456
-ddrot037 rotate 1234567890123456 -9 -> 8901234561234567
-ddrot038 rotate 1234567890123456 -8 -> 9012345612345678
-ddrot039 rotate 1234567890123456 -7 -> 123456123456789
-ddrot040 rotate 1234567890123456 -6 -> 1234561234567890
-ddrot041 rotate 1234567890123456 -5 -> 2345612345678901
-ddrot042 rotate 1234567890123456 -4 -> 3456123456789012
-ddrot043 rotate 1234567890123456 -3 -> 4561234567890123
-ddrot044 rotate 1234567890123456 -2 -> 5612345678901234
-ddrot045 rotate 1234567890123456 -1 -> 6123456789012345
-ddrot046 rotate 1234567890123456 -0 -> 1234567890123456
-
-ddrot047 rotate 1234567890123456 +0 -> 1234567890123456
-ddrot048 rotate 1234567890123456 +1 -> 2345678901234561
-ddrot049 rotate 1234567890123456 +2 -> 3456789012345612
-ddrot050 rotate 1234567890123456 +3 -> 4567890123456123
-ddrot051 rotate 1234567890123456 +4 -> 5678901234561234
-ddrot052 rotate 1234567890123456 +5 -> 6789012345612345
-ddrot053 rotate 1234567890123456 +6 -> 7890123456123456
-ddrot054 rotate 1234567890123456 +7 -> 8901234561234567
-ddrot055 rotate 1234567890123456 +8 -> 9012345612345678
-ddrot056 rotate 1234567890123456 +9 -> 123456123456789
-ddrot057 rotate 1234567890123456 +10 -> 1234561234567890
-ddrot058 rotate 1234567890123456 +11 -> 2345612345678901
-ddrot059 rotate 1234567890123456 +12 -> 3456123456789012
-ddrot060 rotate 1234567890123456 +13 -> 4561234567890123
-ddrot061 rotate 1234567890123456 +14 -> 5612345678901234
-ddrot062 rotate 1234567890123456 +15 -> 6123456789012345
-ddrot063 rotate 1234567890123456 +16 -> 1234567890123456
-
--- zeros
-ddrot070 rotate 0E-10 +9 -> 0E-10
-ddrot071 rotate 0E-10 -9 -> 0E-10
-ddrot072 rotate 0.000 +9 -> 0.000
-ddrot073 rotate 0.000 -9 -> 0.000
-ddrot074 rotate 0E+10 +9 -> 0E+10
-ddrot075 rotate 0E+10 -9 -> 0E+10
-ddrot076 rotate -0E-10 +9 -> -0E-10
-ddrot077 rotate -0E-10 -9 -> -0E-10
-ddrot078 rotate -0.000 +9 -> -0.000
-ddrot079 rotate -0.000 -9 -> -0.000
-ddrot080 rotate -0E+10 +9 -> -0E+10
-ddrot081 rotate -0E+10 -9 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-ddrot141 rotate 9.999999999999999E+384 -1 -> 9.999999999999999E+384
-ddrot142 rotate 9.999999999999999E+384 -15 -> 9.999999999999999E+384
-ddrot143 rotate 9.999999999999999E+384 1 -> 9.999999999999999E+384
-ddrot144 rotate 9.999999999999999E+384 15 -> 9.999999999999999E+384
-ddrot145 rotate 1E-383 -1 -> 1.000000000000000E-368
-ddrot146 rotate 1E-383 -15 -> 1.0E-382
-ddrot147 rotate 1E-383 1 -> 1.0E-382
-ddrot148 rotate 1E-383 15 -> 1.000000000000000E-368
-ddrot151 rotate 1.000000000000000E-383 -1 -> 1.00000000000000E-384
-ddrot152 rotate 1.000000000000000E-383 -15 -> 1E-398
-ddrot153 rotate 1.000000000000000E-383 1 -> 1E-398
-ddrot154 rotate 1.000000000000000E-383 15 -> 1.00000000000000E-384
-ddrot155 rotate 9.000000000000000E-383 -1 -> 9.00000000000000E-384
-ddrot156 rotate 9.000000000000000E-383 -15 -> 9E-398
-ddrot157 rotate 9.000000000000000E-383 1 -> 9E-398
-ddrot158 rotate 9.000000000000000E-383 15 -> 9.00000000000000E-384
-ddrot160 rotate 1E-398 -1 -> 1.000000000000000E-383
-ddrot161 rotate 1E-398 -15 -> 1.0E-397
-ddrot162 rotate 1E-398 1 -> 1.0E-397
-ddrot163 rotate 1E-398 15 -> 1.000000000000000E-383
--- negatives
-ddrot171 rotate -9.999999999999999E+384 -1 -> -9.999999999999999E+384
-ddrot172 rotate -9.999999999999999E+384 -15 -> -9.999999999999999E+384
-ddrot173 rotate -9.999999999999999E+384 1 -> -9.999999999999999E+384
-ddrot174 rotate -9.999999999999999E+384 15 -> -9.999999999999999E+384
-ddrot175 rotate -1E-383 -1 -> -1.000000000000000E-368
-ddrot176 rotate -1E-383 -15 -> -1.0E-382
-ddrot177 rotate -1E-383 1 -> -1.0E-382
-ddrot178 rotate -1E-383 15 -> -1.000000000000000E-368
-ddrot181 rotate -1.000000000000000E-383 -1 -> -1.00000000000000E-384
-ddrot182 rotate -1.000000000000000E-383 -15 -> -1E-398
-ddrot183 rotate -1.000000000000000E-383 1 -> -1E-398
-ddrot184 rotate -1.000000000000000E-383 15 -> -1.00000000000000E-384
-ddrot185 rotate -9.000000000000000E-383 -1 -> -9.00000000000000E-384
-ddrot186 rotate -9.000000000000000E-383 -15 -> -9E-398
-ddrot187 rotate -9.000000000000000E-383 1 -> -9E-398
-ddrot188 rotate -9.000000000000000E-383 15 -> -9.00000000000000E-384
-ddrot190 rotate -1E-398 -1 -> -1.000000000000000E-383
-ddrot191 rotate -1E-398 -15 -> -1.0E-397
-ddrot192 rotate -1E-398 1 -> -1.0E-397
-ddrot193 rotate -1E-398 15 -> -1.000000000000000E-383
-
--- more negatives (of sanities)
-ddrot201 rotate -0 0 -> -0
-ddrot202 rotate -0 2 -> -0
-ddrot203 rotate -1 2 -> -100
-ddrot204 rotate -1 15 -> -1000000000000000
-ddrot205 rotate -1 16 -> -1
-ddrot206 rotate -1 -1 -> -1000000000000000
-ddrot207 rotate -0 -2 -> -0
-ddrot208 rotate -1234567890123456 -1 -> -6123456789012345
-ddrot209 rotate -1234567890123456 -15 -> -2345678901234561
-ddrot210 rotate -1234567890123456 -16 -> -1234567890123456
-ddrot211 rotate -9934567890123456 -15 -> -9345678901234569
-ddrot212 rotate -9934567890123456 -16 -> -9934567890123456
-
-
--- Specials; NaNs are handled as usual
-ddrot781 rotate -Inf -8 -> -Infinity
-ddrot782 rotate -Inf -1 -> -Infinity
-ddrot783 rotate -Inf -0 -> -Infinity
-ddrot784 rotate -Inf 0 -> -Infinity
-ddrot785 rotate -Inf 1 -> -Infinity
-ddrot786 rotate -Inf 8 -> -Infinity
-ddrot787 rotate -1000 -Inf -> NaN Invalid_operation
-ddrot788 rotate -Inf -Inf -> NaN Invalid_operation
-ddrot789 rotate -1 -Inf -> NaN Invalid_operation
-ddrot790 rotate -0 -Inf -> NaN Invalid_operation
-ddrot791 rotate 0 -Inf -> NaN Invalid_operation
-ddrot792 rotate 1 -Inf -> NaN Invalid_operation
-ddrot793 rotate 1000 -Inf -> NaN Invalid_operation
-ddrot794 rotate Inf -Inf -> NaN Invalid_operation
-
-ddrot800 rotate Inf -Inf -> NaN Invalid_operation
-ddrot801 rotate Inf -8 -> Infinity
-ddrot802 rotate Inf -1 -> Infinity
-ddrot803 rotate Inf -0 -> Infinity
-ddrot804 rotate Inf 0 -> Infinity
-ddrot805 rotate Inf 1 -> Infinity
-ddrot806 rotate Inf 8 -> Infinity
-ddrot807 rotate Inf Inf -> NaN Invalid_operation
-ddrot808 rotate -1000 Inf -> NaN Invalid_operation
-ddrot809 rotate -Inf Inf -> NaN Invalid_operation
-ddrot810 rotate -1 Inf -> NaN Invalid_operation
-ddrot811 rotate -0 Inf -> NaN Invalid_operation
-ddrot812 rotate 0 Inf -> NaN Invalid_operation
-ddrot813 rotate 1 Inf -> NaN Invalid_operation
-ddrot814 rotate 1000 Inf -> NaN Invalid_operation
-ddrot815 rotate Inf Inf -> NaN Invalid_operation
-
-ddrot821 rotate NaN -Inf -> NaN
-ddrot822 rotate NaN -1000 -> NaN
-ddrot823 rotate NaN -1 -> NaN
-ddrot824 rotate NaN -0 -> NaN
-ddrot825 rotate NaN 0 -> NaN
-ddrot826 rotate NaN 1 -> NaN
-ddrot827 rotate NaN 1000 -> NaN
-ddrot828 rotate NaN Inf -> NaN
-ddrot829 rotate NaN NaN -> NaN
-ddrot830 rotate -Inf NaN -> NaN
-ddrot831 rotate -1000 NaN -> NaN
-ddrot832 rotate -1 NaN -> NaN
-ddrot833 rotate -0 NaN -> NaN
-ddrot834 rotate 0 NaN -> NaN
-ddrot835 rotate 1 NaN -> NaN
-ddrot836 rotate 1000 NaN -> NaN
-ddrot837 rotate Inf NaN -> NaN
-
-ddrot841 rotate sNaN -Inf -> NaN Invalid_operation
-ddrot842 rotate sNaN -1000 -> NaN Invalid_operation
-ddrot843 rotate sNaN -1 -> NaN Invalid_operation
-ddrot844 rotate sNaN -0 -> NaN Invalid_operation
-ddrot845 rotate sNaN 0 -> NaN Invalid_operation
-ddrot846 rotate sNaN 1 -> NaN Invalid_operation
-ddrot847 rotate sNaN 1000 -> NaN Invalid_operation
-ddrot848 rotate sNaN NaN -> NaN Invalid_operation
-ddrot849 rotate sNaN sNaN -> NaN Invalid_operation
-ddrot850 rotate NaN sNaN -> NaN Invalid_operation
-ddrot851 rotate -Inf sNaN -> NaN Invalid_operation
-ddrot852 rotate -1000 sNaN -> NaN Invalid_operation
-ddrot853 rotate -1 sNaN -> NaN Invalid_operation
-ddrot854 rotate -0 sNaN -> NaN Invalid_operation
-ddrot855 rotate 0 sNaN -> NaN Invalid_operation
-ddrot856 rotate 1 sNaN -> NaN Invalid_operation
-ddrot857 rotate 1000 sNaN -> NaN Invalid_operation
-ddrot858 rotate Inf sNaN -> NaN Invalid_operation
-ddrot859 rotate NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddrot861 rotate NaN1 -Inf -> NaN1
-ddrot862 rotate +NaN2 -1000 -> NaN2
-ddrot863 rotate NaN3 1000 -> NaN3
-ddrot864 rotate NaN4 Inf -> NaN4
-ddrot865 rotate NaN5 +NaN6 -> NaN5
-ddrot866 rotate -Inf NaN7 -> NaN7
-ddrot867 rotate -1000 NaN8 -> NaN8
-ddrot868 rotate 1000 NaN9 -> NaN9
-ddrot869 rotate Inf +NaN10 -> NaN10
-ddrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
-ddrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
-ddrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation
-ddrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
-ddrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
-ddrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
-ddrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
-ddrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
-ddrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation
-ddrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddrot882 rotate -NaN26 NaN28 -> -NaN26
-ddrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddrot884 rotate 1000 -NaN30 -> -NaN30
-ddrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- ddRotate.decTest -- rotate a decDouble coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddrot001 rotate 0 0 -> 0
+ddrot002 rotate 0 2 -> 0
+ddrot003 rotate 1 2 -> 100
+ddrot004 rotate 1 15 -> 1000000000000000
+ddrot005 rotate 1 16 -> 1
+ddrot006 rotate 1 -1 -> 1000000000000000
+ddrot007 rotate 0 -2 -> 0
+ddrot008 rotate 1234567890123456 -1 -> 6123456789012345
+ddrot009 rotate 1234567890123456 -15 -> 2345678901234561
+ddrot010 rotate 1234567890123456 -16 -> 1234567890123456
+ddrot011 rotate 9934567890123456 -15 -> 9345678901234569
+ddrot012 rotate 9934567890123456 -16 -> 9934567890123456
+
+-- rhs must be an integer
+ddrot015 rotate 1 1.5 -> NaN Invalid_operation
+ddrot016 rotate 1 1.0 -> NaN Invalid_operation
+ddrot017 rotate 1 0.1 -> NaN Invalid_operation
+ddrot018 rotate 1 0.0 -> NaN Invalid_operation
+ddrot019 rotate 1 1E+1 -> NaN Invalid_operation
+ddrot020 rotate 1 1E+99 -> NaN Invalid_operation
+ddrot021 rotate 1 Inf -> NaN Invalid_operation
+ddrot022 rotate 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+ddrot025 rotate 1 -1000 -> NaN Invalid_operation
+ddrot026 rotate 1 -17 -> NaN Invalid_operation
+ddrot027 rotate 1 17 -> NaN Invalid_operation
+ddrot028 rotate 1 1000 -> NaN Invalid_operation
+
+-- full pattern
+ddrot030 rotate 1234567890123456 -16 -> 1234567890123456
+ddrot031 rotate 1234567890123456 -15 -> 2345678901234561
+ddrot032 rotate 1234567890123456 -14 -> 3456789012345612
+ddrot033 rotate 1234567890123456 -13 -> 4567890123456123
+ddrot034 rotate 1234567890123456 -12 -> 5678901234561234
+ddrot035 rotate 1234567890123456 -11 -> 6789012345612345
+ddrot036 rotate 1234567890123456 -10 -> 7890123456123456
+ddrot037 rotate 1234567890123456 -9 -> 8901234561234567
+ddrot038 rotate 1234567890123456 -8 -> 9012345612345678
+ddrot039 rotate 1234567890123456 -7 -> 123456123456789
+ddrot040 rotate 1234567890123456 -6 -> 1234561234567890
+ddrot041 rotate 1234567890123456 -5 -> 2345612345678901
+ddrot042 rotate 1234567890123456 -4 -> 3456123456789012
+ddrot043 rotate 1234567890123456 -3 -> 4561234567890123
+ddrot044 rotate 1234567890123456 -2 -> 5612345678901234
+ddrot045 rotate 1234567890123456 -1 -> 6123456789012345
+ddrot046 rotate 1234567890123456 -0 -> 1234567890123456
+
+ddrot047 rotate 1234567890123456 +0 -> 1234567890123456
+ddrot048 rotate 1234567890123456 +1 -> 2345678901234561
+ddrot049 rotate 1234567890123456 +2 -> 3456789012345612
+ddrot050 rotate 1234567890123456 +3 -> 4567890123456123
+ddrot051 rotate 1234567890123456 +4 -> 5678901234561234
+ddrot052 rotate 1234567890123456 +5 -> 6789012345612345
+ddrot053 rotate 1234567890123456 +6 -> 7890123456123456
+ddrot054 rotate 1234567890123456 +7 -> 8901234561234567
+ddrot055 rotate 1234567890123456 +8 -> 9012345612345678
+ddrot056 rotate 1234567890123456 +9 -> 123456123456789
+ddrot057 rotate 1234567890123456 +10 -> 1234561234567890
+ddrot058 rotate 1234567890123456 +11 -> 2345612345678901
+ddrot059 rotate 1234567890123456 +12 -> 3456123456789012
+ddrot060 rotate 1234567890123456 +13 -> 4561234567890123
+ddrot061 rotate 1234567890123456 +14 -> 5612345678901234
+ddrot062 rotate 1234567890123456 +15 -> 6123456789012345
+ddrot063 rotate 1234567890123456 +16 -> 1234567890123456
+
+-- zeros
+ddrot070 rotate 0E-10 +9 -> 0E-10
+ddrot071 rotate 0E-10 -9 -> 0E-10
+ddrot072 rotate 0.000 +9 -> 0.000
+ddrot073 rotate 0.000 -9 -> 0.000
+ddrot074 rotate 0E+10 +9 -> 0E+10
+ddrot075 rotate 0E+10 -9 -> 0E+10
+ddrot076 rotate -0E-10 +9 -> -0E-10
+ddrot077 rotate -0E-10 -9 -> -0E-10
+ddrot078 rotate -0.000 +9 -> -0.000
+ddrot079 rotate -0.000 -9 -> -0.000
+ddrot080 rotate -0E+10 +9 -> -0E+10
+ddrot081 rotate -0E+10 -9 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+ddrot141 rotate 9.999999999999999E+384 -1 -> 9.999999999999999E+384
+ddrot142 rotate 9.999999999999999E+384 -15 -> 9.999999999999999E+384
+ddrot143 rotate 9.999999999999999E+384 1 -> 9.999999999999999E+384
+ddrot144 rotate 9.999999999999999E+384 15 -> 9.999999999999999E+384
+ddrot145 rotate 1E-383 -1 -> 1.000000000000000E-368
+ddrot146 rotate 1E-383 -15 -> 1.0E-382
+ddrot147 rotate 1E-383 1 -> 1.0E-382
+ddrot148 rotate 1E-383 15 -> 1.000000000000000E-368
+ddrot151 rotate 1.000000000000000E-383 -1 -> 1.00000000000000E-384
+ddrot152 rotate 1.000000000000000E-383 -15 -> 1E-398
+ddrot153 rotate 1.000000000000000E-383 1 -> 1E-398
+ddrot154 rotate 1.000000000000000E-383 15 -> 1.00000000000000E-384
+ddrot155 rotate 9.000000000000000E-383 -1 -> 9.00000000000000E-384
+ddrot156 rotate 9.000000000000000E-383 -15 -> 9E-398
+ddrot157 rotate 9.000000000000000E-383 1 -> 9E-398
+ddrot158 rotate 9.000000000000000E-383 15 -> 9.00000000000000E-384
+ddrot160 rotate 1E-398 -1 -> 1.000000000000000E-383
+ddrot161 rotate 1E-398 -15 -> 1.0E-397
+ddrot162 rotate 1E-398 1 -> 1.0E-397
+ddrot163 rotate 1E-398 15 -> 1.000000000000000E-383
+-- negatives
+ddrot171 rotate -9.999999999999999E+384 -1 -> -9.999999999999999E+384
+ddrot172 rotate -9.999999999999999E+384 -15 -> -9.999999999999999E+384
+ddrot173 rotate -9.999999999999999E+384 1 -> -9.999999999999999E+384
+ddrot174 rotate -9.999999999999999E+384 15 -> -9.999999999999999E+384
+ddrot175 rotate -1E-383 -1 -> -1.000000000000000E-368
+ddrot176 rotate -1E-383 -15 -> -1.0E-382
+ddrot177 rotate -1E-383 1 -> -1.0E-382
+ddrot178 rotate -1E-383 15 -> -1.000000000000000E-368
+ddrot181 rotate -1.000000000000000E-383 -1 -> -1.00000000000000E-384
+ddrot182 rotate -1.000000000000000E-383 -15 -> -1E-398
+ddrot183 rotate -1.000000000000000E-383 1 -> -1E-398
+ddrot184 rotate -1.000000000000000E-383 15 -> -1.00000000000000E-384
+ddrot185 rotate -9.000000000000000E-383 -1 -> -9.00000000000000E-384
+ddrot186 rotate -9.000000000000000E-383 -15 -> -9E-398
+ddrot187 rotate -9.000000000000000E-383 1 -> -9E-398
+ddrot188 rotate -9.000000000000000E-383 15 -> -9.00000000000000E-384
+ddrot190 rotate -1E-398 -1 -> -1.000000000000000E-383
+ddrot191 rotate -1E-398 -15 -> -1.0E-397
+ddrot192 rotate -1E-398 1 -> -1.0E-397
+ddrot193 rotate -1E-398 15 -> -1.000000000000000E-383
+
+-- more negatives (of sanities)
+ddrot201 rotate -0 0 -> -0
+ddrot202 rotate -0 2 -> -0
+ddrot203 rotate -1 2 -> -100
+ddrot204 rotate -1 15 -> -1000000000000000
+ddrot205 rotate -1 16 -> -1
+ddrot206 rotate -1 -1 -> -1000000000000000
+ddrot207 rotate -0 -2 -> -0
+ddrot208 rotate -1234567890123456 -1 -> -6123456789012345
+ddrot209 rotate -1234567890123456 -15 -> -2345678901234561
+ddrot210 rotate -1234567890123456 -16 -> -1234567890123456
+ddrot211 rotate -9934567890123456 -15 -> -9345678901234569
+ddrot212 rotate -9934567890123456 -16 -> -9934567890123456
+
+
+-- Specials; NaNs are handled as usual
+ddrot781 rotate -Inf -8 -> -Infinity
+ddrot782 rotate -Inf -1 -> -Infinity
+ddrot783 rotate -Inf -0 -> -Infinity
+ddrot784 rotate -Inf 0 -> -Infinity
+ddrot785 rotate -Inf 1 -> -Infinity
+ddrot786 rotate -Inf 8 -> -Infinity
+ddrot787 rotate -1000 -Inf -> NaN Invalid_operation
+ddrot788 rotate -Inf -Inf -> NaN Invalid_operation
+ddrot789 rotate -1 -Inf -> NaN Invalid_operation
+ddrot790 rotate -0 -Inf -> NaN Invalid_operation
+ddrot791 rotate 0 -Inf -> NaN Invalid_operation
+ddrot792 rotate 1 -Inf -> NaN Invalid_operation
+ddrot793 rotate 1000 -Inf -> NaN Invalid_operation
+ddrot794 rotate Inf -Inf -> NaN Invalid_operation
+
+ddrot800 rotate Inf -Inf -> NaN Invalid_operation
+ddrot801 rotate Inf -8 -> Infinity
+ddrot802 rotate Inf -1 -> Infinity
+ddrot803 rotate Inf -0 -> Infinity
+ddrot804 rotate Inf 0 -> Infinity
+ddrot805 rotate Inf 1 -> Infinity
+ddrot806 rotate Inf 8 -> Infinity
+ddrot807 rotate Inf Inf -> NaN Invalid_operation
+ddrot808 rotate -1000 Inf -> NaN Invalid_operation
+ddrot809 rotate -Inf Inf -> NaN Invalid_operation
+ddrot810 rotate -1 Inf -> NaN Invalid_operation
+ddrot811 rotate -0 Inf -> NaN Invalid_operation
+ddrot812 rotate 0 Inf -> NaN Invalid_operation
+ddrot813 rotate 1 Inf -> NaN Invalid_operation
+ddrot814 rotate 1000 Inf -> NaN Invalid_operation
+ddrot815 rotate Inf Inf -> NaN Invalid_operation
+
+ddrot821 rotate NaN -Inf -> NaN
+ddrot822 rotate NaN -1000 -> NaN
+ddrot823 rotate NaN -1 -> NaN
+ddrot824 rotate NaN -0 -> NaN
+ddrot825 rotate NaN 0 -> NaN
+ddrot826 rotate NaN 1 -> NaN
+ddrot827 rotate NaN 1000 -> NaN
+ddrot828 rotate NaN Inf -> NaN
+ddrot829 rotate NaN NaN -> NaN
+ddrot830 rotate -Inf NaN -> NaN
+ddrot831 rotate -1000 NaN -> NaN
+ddrot832 rotate -1 NaN -> NaN
+ddrot833 rotate -0 NaN -> NaN
+ddrot834 rotate 0 NaN -> NaN
+ddrot835 rotate 1 NaN -> NaN
+ddrot836 rotate 1000 NaN -> NaN
+ddrot837 rotate Inf NaN -> NaN
+
+ddrot841 rotate sNaN -Inf -> NaN Invalid_operation
+ddrot842 rotate sNaN -1000 -> NaN Invalid_operation
+ddrot843 rotate sNaN -1 -> NaN Invalid_operation
+ddrot844 rotate sNaN -0 -> NaN Invalid_operation
+ddrot845 rotate sNaN 0 -> NaN Invalid_operation
+ddrot846 rotate sNaN 1 -> NaN Invalid_operation
+ddrot847 rotate sNaN 1000 -> NaN Invalid_operation
+ddrot848 rotate sNaN NaN -> NaN Invalid_operation
+ddrot849 rotate sNaN sNaN -> NaN Invalid_operation
+ddrot850 rotate NaN sNaN -> NaN Invalid_operation
+ddrot851 rotate -Inf sNaN -> NaN Invalid_operation
+ddrot852 rotate -1000 sNaN -> NaN Invalid_operation
+ddrot853 rotate -1 sNaN -> NaN Invalid_operation
+ddrot854 rotate -0 sNaN -> NaN Invalid_operation
+ddrot855 rotate 0 sNaN -> NaN Invalid_operation
+ddrot856 rotate 1 sNaN -> NaN Invalid_operation
+ddrot857 rotate 1000 sNaN -> NaN Invalid_operation
+ddrot858 rotate Inf sNaN -> NaN Invalid_operation
+ddrot859 rotate NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddrot861 rotate NaN1 -Inf -> NaN1
+ddrot862 rotate +NaN2 -1000 -> NaN2
+ddrot863 rotate NaN3 1000 -> NaN3
+ddrot864 rotate NaN4 Inf -> NaN4
+ddrot865 rotate NaN5 +NaN6 -> NaN5
+ddrot866 rotate -Inf NaN7 -> NaN7
+ddrot867 rotate -1000 NaN8 -> NaN8
+ddrot868 rotate 1000 NaN9 -> NaN9
+ddrot869 rotate Inf +NaN10 -> NaN10
+ddrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
+ddrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
+ddrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation
+ddrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
+ddrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
+ddrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
+ddrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
+ddrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
+ddrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation
+ddrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddrot882 rotate -NaN26 NaN28 -> -NaN26
+ddrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddrot884 rotate 1000 -NaN30 -> -NaN30
+ddrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddSameQuantum.decTest b/Lib/test/decimaltestdata/ddSameQuantum.decTest
index 465b36a858..54a763cccf 100644
--- a/Lib/test/decimaltestdata/ddSameQuantum.decTest
+++ b/Lib/test/decimaltestdata/ddSameQuantum.decTest
@@ -1,389 +1,389 @@
-------------------------------------------------------------------------
--- ddSameQuantum.decTest -- check decDouble quantums match --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddsamq001 samequantum 0 0 -> 1
-ddsamq002 samequantum 0 1 -> 1
-ddsamq003 samequantum 1 0 -> 1
-ddsamq004 samequantum 1 1 -> 1
-
-ddsamq011 samequantum 10 1E+1 -> 0
-ddsamq012 samequantum 10E+1 10E+1 -> 1
-ddsamq013 samequantum 100 10E+1 -> 0
-ddsamq014 samequantum 100 1E+2 -> 0
-ddsamq015 samequantum 0.1 1E-2 -> 0
-ddsamq016 samequantum 0.1 1E-1 -> 1
-ddsamq017 samequantum 0.1 1E-0 -> 0
-ddsamq018 samequantum 999 999 -> 1
-ddsamq019 samequantum 999E-1 99.9 -> 1
-ddsamq020 samequantum 111E-1 22.2 -> 1
-ddsamq021 samequantum 111E-1 1234.2 -> 1
-
--- zeros
-ddsamq030 samequantum 0.0 1.1 -> 1
-ddsamq031 samequantum 0.0 1.11 -> 0
-ddsamq032 samequantum 0.0 0 -> 0
-ddsamq033 samequantum 0.0 0.0 -> 1
-ddsamq034 samequantum 0.0 0.00 -> 0
-ddsamq035 samequantum 0E+1 0E+0 -> 0
-ddsamq036 samequantum 0E+1 0E+1 -> 1
-ddsamq037 samequantum 0E+1 0E+2 -> 0
-ddsamq038 samequantum 0E-17 0E-16 -> 0
-ddsamq039 samequantum 0E-17 0E-17 -> 1
-ddsamq040 samequantum 0E-17 0E-18 -> 0
-ddsamq041 samequantum 0E-17 0.0E-15 -> 0
-ddsamq042 samequantum 0E-17 0.0E-16 -> 1
-ddsamq043 samequantum 0E-17 0.0E-17 -> 0
-ddsamq044 samequantum -0E-17 0.0E-16 -> 1
-ddsamq045 samequantum 0E-17 -0.0E-17 -> 0
-ddsamq046 samequantum 0E-17 -0.0E-16 -> 1
-ddsamq047 samequantum -0E-17 0.0E-17 -> 0
-ddsamq048 samequantum -0E-17 -0.0E-16 -> 1
-ddsamq049 samequantum -0E-17 -0.0E-17 -> 0
-
--- Nmax, Nmin, Ntiny
-ddsamq051 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
-ddsamq052 samequantum 1E-383 1E-383 -> 1
-ddsamq053 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
-ddsamq054 samequantum 1E-398 1E-398 -> 1
-ddsamq055 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
-ddsamq056 samequantum 1E-383 1E-383 -> 1
-ddsamq057 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
-ddsamq058 samequantum 1E-398 1E-398 -> 1
-
-ddsamq061 samequantum -1E-398 -1E-398 -> 1
-ddsamq062 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
-ddsamq063 samequantum -1E-383 -1E-383 -> 1
-ddsamq064 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
-ddsamq065 samequantum -1E-398 -1E-398 -> 1
-ddsamq066 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
-ddsamq067 samequantum -1E-383 -1E-383 -> 1
-ddsamq068 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
-
-ddsamq071 samequantum -4E-398 -1E-398 -> 1
-ddsamq072 samequantum -4.000000000000000E-383 -1.000040000000000E-383 -> 1
-ddsamq073 samequantum -4E-383 -1E-383 -> 1
-ddsamq074 samequantum -4.999999999999999E+384 -9.999999999949999E+384 -> 1
-ddsamq075 samequantum -4E-398 -1E-398 -> 1
-ddsamq076 samequantum -4.000000000000000E-383 -1.004000000000000E-383 -> 1
-ddsamq077 samequantum -4E-383 -1E-383 -> 1
-ddsamq078 samequantum -4.999999999999999E+384 -9.949999999999999E+384 -> 1
-
-ddsamq081 samequantum -4E-397 -1E-398 -> 0
-ddsamq082 samequantum -4.000000000000000E-383 -1.000040000000000E-336 -> 0
-ddsamq083 samequantum -4E-346 -1E-383 -> 0
-ddsamq084 samequantum -4.999999999999999E+384 -9.999499999999999E+336 -> 0
-ddsamq085 samequantum -4E-397 -1E-398 -> 0
-ddsamq086 samequantum -4.000000000000000E-383 -1.004000000000000E-336 -> 0
-ddsamq087 samequantum -4E-346 -1E-383 -> 0
-ddsamq088 samequantum -4.999999999999999E+384 -9.949999999999999E+336 -> 0
-
--- specials & combinations
-ddsamq0110 samequantum -Inf -Inf -> 1
-ddsamq0111 samequantum -Inf Inf -> 1
-ddsamq0112 samequantum -Inf NaN -> 0
-ddsamq0113 samequantum -Inf -7E+3 -> 0
-ddsamq0114 samequantum -Inf -7 -> 0
-ddsamq0115 samequantum -Inf -7E-3 -> 0
-ddsamq0116 samequantum -Inf -0E-3 -> 0
-ddsamq0117 samequantum -Inf -0 -> 0
-ddsamq0118 samequantum -Inf -0E+3 -> 0
-ddsamq0119 samequantum -Inf 0E-3 -> 0
-ddsamq0120 samequantum -Inf 0 -> 0
-ddsamq0121 samequantum -Inf 0E+3 -> 0
-ddsamq0122 samequantum -Inf 7E-3 -> 0
-ddsamq0123 samequantum -Inf 7 -> 0
-ddsamq0124 samequantum -Inf 7E+3 -> 0
-ddsamq0125 samequantum -Inf sNaN -> 0
-
-ddsamq0210 samequantum Inf -Inf -> 1
-ddsamq0211 samequantum Inf Inf -> 1
-ddsamq0212 samequantum Inf NaN -> 0
-ddsamq0213 samequantum Inf -7E+3 -> 0
-ddsamq0214 samequantum Inf -7 -> 0
-ddsamq0215 samequantum Inf -7E-3 -> 0
-ddsamq0216 samequantum Inf -0E-3 -> 0
-ddsamq0217 samequantum Inf -0 -> 0
-ddsamq0218 samequantum Inf -0E+3 -> 0
-ddsamq0219 samequantum Inf 0E-3 -> 0
-ddsamq0220 samequantum Inf 0 -> 0
-ddsamq0221 samequantum Inf 0E+3 -> 0
-ddsamq0222 samequantum Inf 7E-3 -> 0
-ddsamq0223 samequantum Inf 7 -> 0
-ddsamq0224 samequantum Inf 7E+3 -> 0
-ddsamq0225 samequantum Inf sNaN -> 0
-
-ddsamq0310 samequantum NaN -Inf -> 0
-ddsamq0311 samequantum NaN Inf -> 0
-ddsamq0312 samequantum NaN NaN -> 1
-ddsamq0313 samequantum NaN -7E+3 -> 0
-ddsamq0314 samequantum NaN -7 -> 0
-ddsamq0315 samequantum NaN -7E-3 -> 0
-ddsamq0316 samequantum NaN -0E-3 -> 0
-ddsamq0317 samequantum NaN -0 -> 0
-ddsamq0318 samequantum NaN -0E+3 -> 0
-ddsamq0319 samequantum NaN 0E-3 -> 0
-ddsamq0320 samequantum NaN 0 -> 0
-ddsamq0321 samequantum NaN 0E+3 -> 0
-ddsamq0322 samequantum NaN 7E-3 -> 0
-ddsamq0323 samequantum NaN 7 -> 0
-ddsamq0324 samequantum NaN 7E+3 -> 0
-ddsamq0325 samequantum NaN sNaN -> 1
-
-ddsamq0410 samequantum -7E+3 -Inf -> 0
-ddsamq0411 samequantum -7E+3 Inf -> 0
-ddsamq0412 samequantum -7E+3 NaN -> 0
-ddsamq0413 samequantum -7E+3 -7E+3 -> 1
-ddsamq0414 samequantum -7E+3 -7 -> 0
-ddsamq0415 samequantum -7E+3 -7E-3 -> 0
-ddsamq0416 samequantum -7E+3 -0E-3 -> 0
-ddsamq0417 samequantum -7E+3 -0 -> 0
-ddsamq0418 samequantum -7E+3 -0E+3 -> 1
-ddsamq0419 samequantum -7E+3 0E-3 -> 0
-ddsamq0420 samequantum -7E+3 0 -> 0
-ddsamq0421 samequantum -7E+3 0E+3 -> 1
-ddsamq0422 samequantum -7E+3 7E-3 -> 0
-ddsamq0423 samequantum -7E+3 7 -> 0
-ddsamq0424 samequantum -7E+3 7E+3 -> 1
-ddsamq0425 samequantum -7E+3 sNaN -> 0
-
-ddsamq0510 samequantum -7 -Inf -> 0
-ddsamq0511 samequantum -7 Inf -> 0
-ddsamq0512 samequantum -7 NaN -> 0
-ddsamq0513 samequantum -7 -7E+3 -> 0
-ddsamq0514 samequantum -7 -7 -> 1
-ddsamq0515 samequantum -7 -7E-3 -> 0
-ddsamq0516 samequantum -7 -0E-3 -> 0
-ddsamq0517 samequantum -7 -0 -> 1
-ddsamq0518 samequantum -7 -0E+3 -> 0
-ddsamq0519 samequantum -7 0E-3 -> 0
-ddsamq0520 samequantum -7 0 -> 1
-ddsamq0521 samequantum -7 0E+3 -> 0
-ddsamq0522 samequantum -7 7E-3 -> 0
-ddsamq0523 samequantum -7 7 -> 1
-ddsamq0524 samequantum -7 7E+3 -> 0
-ddsamq0525 samequantum -7 sNaN -> 0
-
-ddsamq0610 samequantum -7E-3 -Inf -> 0
-ddsamq0611 samequantum -7E-3 Inf -> 0
-ddsamq0612 samequantum -7E-3 NaN -> 0
-ddsamq0613 samequantum -7E-3 -7E+3 -> 0
-ddsamq0614 samequantum -7E-3 -7 -> 0
-ddsamq0615 samequantum -7E-3 -7E-3 -> 1
-ddsamq0616 samequantum -7E-3 -0E-3 -> 1
-ddsamq0617 samequantum -7E-3 -0 -> 0
-ddsamq0618 samequantum -7E-3 -0E+3 -> 0
-ddsamq0619 samequantum -7E-3 0E-3 -> 1
-ddsamq0620 samequantum -7E-3 0 -> 0
-ddsamq0621 samequantum -7E-3 0E+3 -> 0
-ddsamq0622 samequantum -7E-3 7E-3 -> 1
-ddsamq0623 samequantum -7E-3 7 -> 0
-ddsamq0624 samequantum -7E-3 7E+3 -> 0
-ddsamq0625 samequantum -7E-3 sNaN -> 0
-
-ddsamq0710 samequantum -0E-3 -Inf -> 0
-ddsamq0711 samequantum -0E-3 Inf -> 0
-ddsamq0712 samequantum -0E-3 NaN -> 0
-ddsamq0713 samequantum -0E-3 -7E+3 -> 0
-ddsamq0714 samequantum -0E-3 -7 -> 0
-ddsamq0715 samequantum -0E-3 -7E-3 -> 1
-ddsamq0716 samequantum -0E-3 -0E-3 -> 1
-ddsamq0717 samequantum -0E-3 -0 -> 0
-ddsamq0718 samequantum -0E-3 -0E+3 -> 0
-ddsamq0719 samequantum -0E-3 0E-3 -> 1
-ddsamq0720 samequantum -0E-3 0 -> 0
-ddsamq0721 samequantum -0E-3 0E+3 -> 0
-ddsamq0722 samequantum -0E-3 7E-3 -> 1
-ddsamq0723 samequantum -0E-3 7 -> 0
-ddsamq0724 samequantum -0E-3 7E+3 -> 0
-ddsamq0725 samequantum -0E-3 sNaN -> 0
-
-ddsamq0810 samequantum -0 -Inf -> 0
-ddsamq0811 samequantum -0 Inf -> 0
-ddsamq0812 samequantum -0 NaN -> 0
-ddsamq0813 samequantum -0 -7E+3 -> 0
-ddsamq0814 samequantum -0 -7 -> 1
-ddsamq0815 samequantum -0 -7E-3 -> 0
-ddsamq0816 samequantum -0 -0E-3 -> 0
-ddsamq0817 samequantum -0 -0 -> 1
-ddsamq0818 samequantum -0 -0E+3 -> 0
-ddsamq0819 samequantum -0 0E-3 -> 0
-ddsamq0820 samequantum -0 0 -> 1
-ddsamq0821 samequantum -0 0E+3 -> 0
-ddsamq0822 samequantum -0 7E-3 -> 0
-ddsamq0823 samequantum -0 7 -> 1
-ddsamq0824 samequantum -0 7E+3 -> 0
-ddsamq0825 samequantum -0 sNaN -> 0
-
-ddsamq0910 samequantum -0E+3 -Inf -> 0
-ddsamq0911 samequantum -0E+3 Inf -> 0
-ddsamq0912 samequantum -0E+3 NaN -> 0
-ddsamq0913 samequantum -0E+3 -7E+3 -> 1
-ddsamq0914 samequantum -0E+3 -7 -> 0
-ddsamq0915 samequantum -0E+3 -7E-3 -> 0
-ddsamq0916 samequantum -0E+3 -0E-3 -> 0
-ddsamq0917 samequantum -0E+3 -0 -> 0
-ddsamq0918 samequantum -0E+3 -0E+3 -> 1
-ddsamq0919 samequantum -0E+3 0E-3 -> 0
-ddsamq0920 samequantum -0E+3 0 -> 0
-ddsamq0921 samequantum -0E+3 0E+3 -> 1
-ddsamq0922 samequantum -0E+3 7E-3 -> 0
-ddsamq0923 samequantum -0E+3 7 -> 0
-ddsamq0924 samequantum -0E+3 7E+3 -> 1
-ddsamq0925 samequantum -0E+3 sNaN -> 0
-
-ddsamq1110 samequantum 0E-3 -Inf -> 0
-ddsamq1111 samequantum 0E-3 Inf -> 0
-ddsamq1112 samequantum 0E-3 NaN -> 0
-ddsamq1113 samequantum 0E-3 -7E+3 -> 0
-ddsamq1114 samequantum 0E-3 -7 -> 0
-ddsamq1115 samequantum 0E-3 -7E-3 -> 1
-ddsamq1116 samequantum 0E-3 -0E-3 -> 1
-ddsamq1117 samequantum 0E-3 -0 -> 0
-ddsamq1118 samequantum 0E-3 -0E+3 -> 0
-ddsamq1119 samequantum 0E-3 0E-3 -> 1
-ddsamq1120 samequantum 0E-3 0 -> 0
-ddsamq1121 samequantum 0E-3 0E+3 -> 0
-ddsamq1122 samequantum 0E-3 7E-3 -> 1
-ddsamq1123 samequantum 0E-3 7 -> 0
-ddsamq1124 samequantum 0E-3 7E+3 -> 0
-ddsamq1125 samequantum 0E-3 sNaN -> 0
-
-ddsamq1210 samequantum 0 -Inf -> 0
-ddsamq1211 samequantum 0 Inf -> 0
-ddsamq1212 samequantum 0 NaN -> 0
-ddsamq1213 samequantum 0 -7E+3 -> 0
-ddsamq1214 samequantum 0 -7 -> 1
-ddsamq1215 samequantum 0 -7E-3 -> 0
-ddsamq1216 samequantum 0 -0E-3 -> 0
-ddsamq1217 samequantum 0 -0 -> 1
-ddsamq1218 samequantum 0 -0E+3 -> 0
-ddsamq1219 samequantum 0 0E-3 -> 0
-ddsamq1220 samequantum 0 0 -> 1
-ddsamq1221 samequantum 0 0E+3 -> 0
-ddsamq1222 samequantum 0 7E-3 -> 0
-ddsamq1223 samequantum 0 7 -> 1
-ddsamq1224 samequantum 0 7E+3 -> 0
-ddsamq1225 samequantum 0 sNaN -> 0
-
-ddsamq1310 samequantum 0E+3 -Inf -> 0
-ddsamq1311 samequantum 0E+3 Inf -> 0
-ddsamq1312 samequantum 0E+3 NaN -> 0
-ddsamq1313 samequantum 0E+3 -7E+3 -> 1
-ddsamq1314 samequantum 0E+3 -7 -> 0
-ddsamq1315 samequantum 0E+3 -7E-3 -> 0
-ddsamq1316 samequantum 0E+3 -0E-3 -> 0
-ddsamq1317 samequantum 0E+3 -0 -> 0
-ddsamq1318 samequantum 0E+3 -0E+3 -> 1
-ddsamq1319 samequantum 0E+3 0E-3 -> 0
-ddsamq1320 samequantum 0E+3 0 -> 0
-ddsamq1321 samequantum 0E+3 0E+3 -> 1
-ddsamq1322 samequantum 0E+3 7E-3 -> 0
-ddsamq1323 samequantum 0E+3 7 -> 0
-ddsamq1324 samequantum 0E+3 7E+3 -> 1
-ddsamq1325 samequantum 0E+3 sNaN -> 0
-
-ddsamq1410 samequantum 7E-3 -Inf -> 0
-ddsamq1411 samequantum 7E-3 Inf -> 0
-ddsamq1412 samequantum 7E-3 NaN -> 0
-ddsamq1413 samequantum 7E-3 -7E+3 -> 0
-ddsamq1414 samequantum 7E-3 -7 -> 0
-ddsamq1415 samequantum 7E-3 -7E-3 -> 1
-ddsamq1416 samequantum 7E-3 -0E-3 -> 1
-ddsamq1417 samequantum 7E-3 -0 -> 0
-ddsamq1418 samequantum 7E-3 -0E+3 -> 0
-ddsamq1419 samequantum 7E-3 0E-3 -> 1
-ddsamq1420 samequantum 7E-3 0 -> 0
-ddsamq1421 samequantum 7E-3 0E+3 -> 0
-ddsamq1422 samequantum 7E-3 7E-3 -> 1
-ddsamq1423 samequantum 7E-3 7 -> 0
-ddsamq1424 samequantum 7E-3 7E+3 -> 0
-ddsamq1425 samequantum 7E-3 sNaN -> 0
-
-ddsamq1510 samequantum 7 -Inf -> 0
-ddsamq1511 samequantum 7 Inf -> 0
-ddsamq1512 samequantum 7 NaN -> 0
-ddsamq1513 samequantum 7 -7E+3 -> 0
-ddsamq1514 samequantum 7 -7 -> 1
-ddsamq1515 samequantum 7 -7E-3 -> 0
-ddsamq1516 samequantum 7 -0E-3 -> 0
-ddsamq1517 samequantum 7 -0 -> 1
-ddsamq1518 samequantum 7 -0E+3 -> 0
-ddsamq1519 samequantum 7 0E-3 -> 0
-ddsamq1520 samequantum 7 0 -> 1
-ddsamq1521 samequantum 7 0E+3 -> 0
-ddsamq1522 samequantum 7 7E-3 -> 0
-ddsamq1523 samequantum 7 7 -> 1
-ddsamq1524 samequantum 7 7E+3 -> 0
-ddsamq1525 samequantum 7 sNaN -> 0
-
-ddsamq1610 samequantum 7E+3 -Inf -> 0
-ddsamq1611 samequantum 7E+3 Inf -> 0
-ddsamq1612 samequantum 7E+3 NaN -> 0
-ddsamq1613 samequantum 7E+3 -7E+3 -> 1
-ddsamq1614 samequantum 7E+3 -7 -> 0
-ddsamq1615 samequantum 7E+3 -7E-3 -> 0
-ddsamq1616 samequantum 7E+3 -0E-3 -> 0
-ddsamq1617 samequantum 7E+3 -0 -> 0
-ddsamq1618 samequantum 7E+3 -0E+3 -> 1
-ddsamq1619 samequantum 7E+3 0E-3 -> 0
-ddsamq1620 samequantum 7E+3 0 -> 0
-ddsamq1621 samequantum 7E+3 0E+3 -> 1
-ddsamq1622 samequantum 7E+3 7E-3 -> 0
-ddsamq1623 samequantum 7E+3 7 -> 0
-ddsamq1624 samequantum 7E+3 7E+3 -> 1
-ddsamq1625 samequantum 7E+3 sNaN -> 0
-
-ddsamq1710 samequantum sNaN -Inf -> 0
-ddsamq1711 samequantum sNaN Inf -> 0
-ddsamq1712 samequantum sNaN NaN -> 1
-ddsamq1713 samequantum sNaN -7E+3 -> 0
-ddsamq1714 samequantum sNaN -7 -> 0
-ddsamq1715 samequantum sNaN -7E-3 -> 0
-ddsamq1716 samequantum sNaN -0E-3 -> 0
-ddsamq1717 samequantum sNaN -0 -> 0
-ddsamq1718 samequantum sNaN -0E+3 -> 0
-ddsamq1719 samequantum sNaN 0E-3 -> 0
-ddsamq1720 samequantum sNaN 0 -> 0
-ddsamq1721 samequantum sNaN 0E+3 -> 0
-ddsamq1722 samequantum sNaN 7E-3 -> 0
-ddsamq1723 samequantum sNaN 7 -> 0
-ddsamq1724 samequantum sNaN 7E+3 -> 0
-ddsamq1725 samequantum sNaN sNaN -> 1
--- noisy NaNs
-ddsamq1730 samequantum sNaN3 sNaN3 -> 1
-ddsamq1731 samequantum sNaN3 sNaN4 -> 1
-ddsamq1732 samequantum NaN3 NaN3 -> 1
-ddsamq1733 samequantum NaN3 NaN4 -> 1
-ddsamq1734 samequantum sNaN3 3 -> 0
-ddsamq1735 samequantum NaN3 3 -> 0
-ddsamq1736 samequantum 4 sNaN4 -> 0
-ddsamq1737 samequantum 3 NaN3 -> 0
-ddsamq1738 samequantum Inf sNaN4 -> 0
-ddsamq1739 samequantum -Inf NaN3 -> 0
-
+------------------------------------------------------------------------
+-- ddSameQuantum.decTest -- check decDouble quantums match --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddsamq001 samequantum 0 0 -> 1
+ddsamq002 samequantum 0 1 -> 1
+ddsamq003 samequantum 1 0 -> 1
+ddsamq004 samequantum 1 1 -> 1
+
+ddsamq011 samequantum 10 1E+1 -> 0
+ddsamq012 samequantum 10E+1 10E+1 -> 1
+ddsamq013 samequantum 100 10E+1 -> 0
+ddsamq014 samequantum 100 1E+2 -> 0
+ddsamq015 samequantum 0.1 1E-2 -> 0
+ddsamq016 samequantum 0.1 1E-1 -> 1
+ddsamq017 samequantum 0.1 1E-0 -> 0
+ddsamq018 samequantum 999 999 -> 1
+ddsamq019 samequantum 999E-1 99.9 -> 1
+ddsamq020 samequantum 111E-1 22.2 -> 1
+ddsamq021 samequantum 111E-1 1234.2 -> 1
+
+-- zeros
+ddsamq030 samequantum 0.0 1.1 -> 1
+ddsamq031 samequantum 0.0 1.11 -> 0
+ddsamq032 samequantum 0.0 0 -> 0
+ddsamq033 samequantum 0.0 0.0 -> 1
+ddsamq034 samequantum 0.0 0.00 -> 0
+ddsamq035 samequantum 0E+1 0E+0 -> 0
+ddsamq036 samequantum 0E+1 0E+1 -> 1
+ddsamq037 samequantum 0E+1 0E+2 -> 0
+ddsamq038 samequantum 0E-17 0E-16 -> 0
+ddsamq039 samequantum 0E-17 0E-17 -> 1
+ddsamq040 samequantum 0E-17 0E-18 -> 0
+ddsamq041 samequantum 0E-17 0.0E-15 -> 0
+ddsamq042 samequantum 0E-17 0.0E-16 -> 1
+ddsamq043 samequantum 0E-17 0.0E-17 -> 0
+ddsamq044 samequantum -0E-17 0.0E-16 -> 1
+ddsamq045 samequantum 0E-17 -0.0E-17 -> 0
+ddsamq046 samequantum 0E-17 -0.0E-16 -> 1
+ddsamq047 samequantum -0E-17 0.0E-17 -> 0
+ddsamq048 samequantum -0E-17 -0.0E-16 -> 1
+ddsamq049 samequantum -0E-17 -0.0E-17 -> 0
+
+-- Nmax, Nmin, Ntiny
+ddsamq051 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
+ddsamq052 samequantum 1E-383 1E-383 -> 1
+ddsamq053 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
+ddsamq054 samequantum 1E-398 1E-398 -> 1
+ddsamq055 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
+ddsamq056 samequantum 1E-383 1E-383 -> 1
+ddsamq057 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
+ddsamq058 samequantum 1E-398 1E-398 -> 1
+
+ddsamq061 samequantum -1E-398 -1E-398 -> 1
+ddsamq062 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
+ddsamq063 samequantum -1E-383 -1E-383 -> 1
+ddsamq064 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
+ddsamq065 samequantum -1E-398 -1E-398 -> 1
+ddsamq066 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
+ddsamq067 samequantum -1E-383 -1E-383 -> 1
+ddsamq068 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
+
+ddsamq071 samequantum -4E-398 -1E-398 -> 1
+ddsamq072 samequantum -4.000000000000000E-383 -1.000040000000000E-383 -> 1
+ddsamq073 samequantum -4E-383 -1E-383 -> 1
+ddsamq074 samequantum -4.999999999999999E+384 -9.999999999949999E+384 -> 1
+ddsamq075 samequantum -4E-398 -1E-398 -> 1
+ddsamq076 samequantum -4.000000000000000E-383 -1.004000000000000E-383 -> 1
+ddsamq077 samequantum -4E-383 -1E-383 -> 1
+ddsamq078 samequantum -4.999999999999999E+384 -9.949999999999999E+384 -> 1
+
+ddsamq081 samequantum -4E-397 -1E-398 -> 0
+ddsamq082 samequantum -4.000000000000000E-383 -1.000040000000000E-336 -> 0
+ddsamq083 samequantum -4E-346 -1E-383 -> 0
+ddsamq084 samequantum -4.999999999999999E+384 -9.999499999999999E+336 -> 0
+ddsamq085 samequantum -4E-397 -1E-398 -> 0
+ddsamq086 samequantum -4.000000000000000E-383 -1.004000000000000E-336 -> 0
+ddsamq087 samequantum -4E-346 -1E-383 -> 0
+ddsamq088 samequantum -4.999999999999999E+384 -9.949999999999999E+336 -> 0
+
+-- specials & combinations
+ddsamq0110 samequantum -Inf -Inf -> 1
+ddsamq0111 samequantum -Inf Inf -> 1
+ddsamq0112 samequantum -Inf NaN -> 0
+ddsamq0113 samequantum -Inf -7E+3 -> 0
+ddsamq0114 samequantum -Inf -7 -> 0
+ddsamq0115 samequantum -Inf -7E-3 -> 0
+ddsamq0116 samequantum -Inf -0E-3 -> 0
+ddsamq0117 samequantum -Inf -0 -> 0
+ddsamq0118 samequantum -Inf -0E+3 -> 0
+ddsamq0119 samequantum -Inf 0E-3 -> 0
+ddsamq0120 samequantum -Inf 0 -> 0
+ddsamq0121 samequantum -Inf 0E+3 -> 0
+ddsamq0122 samequantum -Inf 7E-3 -> 0
+ddsamq0123 samequantum -Inf 7 -> 0
+ddsamq0124 samequantum -Inf 7E+3 -> 0
+ddsamq0125 samequantum -Inf sNaN -> 0
+
+ddsamq0210 samequantum Inf -Inf -> 1
+ddsamq0211 samequantum Inf Inf -> 1
+ddsamq0212 samequantum Inf NaN -> 0
+ddsamq0213 samequantum Inf -7E+3 -> 0
+ddsamq0214 samequantum Inf -7 -> 0
+ddsamq0215 samequantum Inf -7E-3 -> 0
+ddsamq0216 samequantum Inf -0E-3 -> 0
+ddsamq0217 samequantum Inf -0 -> 0
+ddsamq0218 samequantum Inf -0E+3 -> 0
+ddsamq0219 samequantum Inf 0E-3 -> 0
+ddsamq0220 samequantum Inf 0 -> 0
+ddsamq0221 samequantum Inf 0E+3 -> 0
+ddsamq0222 samequantum Inf 7E-3 -> 0
+ddsamq0223 samequantum Inf 7 -> 0
+ddsamq0224 samequantum Inf 7E+3 -> 0
+ddsamq0225 samequantum Inf sNaN -> 0
+
+ddsamq0310 samequantum NaN -Inf -> 0
+ddsamq0311 samequantum NaN Inf -> 0
+ddsamq0312 samequantum NaN NaN -> 1
+ddsamq0313 samequantum NaN -7E+3 -> 0
+ddsamq0314 samequantum NaN -7 -> 0
+ddsamq0315 samequantum NaN -7E-3 -> 0
+ddsamq0316 samequantum NaN -0E-3 -> 0
+ddsamq0317 samequantum NaN -0 -> 0
+ddsamq0318 samequantum NaN -0E+3 -> 0
+ddsamq0319 samequantum NaN 0E-3 -> 0
+ddsamq0320 samequantum NaN 0 -> 0
+ddsamq0321 samequantum NaN 0E+3 -> 0
+ddsamq0322 samequantum NaN 7E-3 -> 0
+ddsamq0323 samequantum NaN 7 -> 0
+ddsamq0324 samequantum NaN 7E+3 -> 0
+ddsamq0325 samequantum NaN sNaN -> 1
+
+ddsamq0410 samequantum -7E+3 -Inf -> 0
+ddsamq0411 samequantum -7E+3 Inf -> 0
+ddsamq0412 samequantum -7E+3 NaN -> 0
+ddsamq0413 samequantum -7E+3 -7E+3 -> 1
+ddsamq0414 samequantum -7E+3 -7 -> 0
+ddsamq0415 samequantum -7E+3 -7E-3 -> 0
+ddsamq0416 samequantum -7E+3 -0E-3 -> 0
+ddsamq0417 samequantum -7E+3 -0 -> 0
+ddsamq0418 samequantum -7E+3 -0E+3 -> 1
+ddsamq0419 samequantum -7E+3 0E-3 -> 0
+ddsamq0420 samequantum -7E+3 0 -> 0
+ddsamq0421 samequantum -7E+3 0E+3 -> 1
+ddsamq0422 samequantum -7E+3 7E-3 -> 0
+ddsamq0423 samequantum -7E+3 7 -> 0
+ddsamq0424 samequantum -7E+3 7E+3 -> 1
+ddsamq0425 samequantum -7E+3 sNaN -> 0
+
+ddsamq0510 samequantum -7 -Inf -> 0
+ddsamq0511 samequantum -7 Inf -> 0
+ddsamq0512 samequantum -7 NaN -> 0
+ddsamq0513 samequantum -7 -7E+3 -> 0
+ddsamq0514 samequantum -7 -7 -> 1
+ddsamq0515 samequantum -7 -7E-3 -> 0
+ddsamq0516 samequantum -7 -0E-3 -> 0
+ddsamq0517 samequantum -7 -0 -> 1
+ddsamq0518 samequantum -7 -0E+3 -> 0
+ddsamq0519 samequantum -7 0E-3 -> 0
+ddsamq0520 samequantum -7 0 -> 1
+ddsamq0521 samequantum -7 0E+3 -> 0
+ddsamq0522 samequantum -7 7E-3 -> 0
+ddsamq0523 samequantum -7 7 -> 1
+ddsamq0524 samequantum -7 7E+3 -> 0
+ddsamq0525 samequantum -7 sNaN -> 0
+
+ddsamq0610 samequantum -7E-3 -Inf -> 0
+ddsamq0611 samequantum -7E-3 Inf -> 0
+ddsamq0612 samequantum -7E-3 NaN -> 0
+ddsamq0613 samequantum -7E-3 -7E+3 -> 0
+ddsamq0614 samequantum -7E-3 -7 -> 0
+ddsamq0615 samequantum -7E-3 -7E-3 -> 1
+ddsamq0616 samequantum -7E-3 -0E-3 -> 1
+ddsamq0617 samequantum -7E-3 -0 -> 0
+ddsamq0618 samequantum -7E-3 -0E+3 -> 0
+ddsamq0619 samequantum -7E-3 0E-3 -> 1
+ddsamq0620 samequantum -7E-3 0 -> 0
+ddsamq0621 samequantum -7E-3 0E+3 -> 0
+ddsamq0622 samequantum -7E-3 7E-3 -> 1
+ddsamq0623 samequantum -7E-3 7 -> 0
+ddsamq0624 samequantum -7E-3 7E+3 -> 0
+ddsamq0625 samequantum -7E-3 sNaN -> 0
+
+ddsamq0710 samequantum -0E-3 -Inf -> 0
+ddsamq0711 samequantum -0E-3 Inf -> 0
+ddsamq0712 samequantum -0E-3 NaN -> 0
+ddsamq0713 samequantum -0E-3 -7E+3 -> 0
+ddsamq0714 samequantum -0E-3 -7 -> 0
+ddsamq0715 samequantum -0E-3 -7E-3 -> 1
+ddsamq0716 samequantum -0E-3 -0E-3 -> 1
+ddsamq0717 samequantum -0E-3 -0 -> 0
+ddsamq0718 samequantum -0E-3 -0E+3 -> 0
+ddsamq0719 samequantum -0E-3 0E-3 -> 1
+ddsamq0720 samequantum -0E-3 0 -> 0
+ddsamq0721 samequantum -0E-3 0E+3 -> 0
+ddsamq0722 samequantum -0E-3 7E-3 -> 1
+ddsamq0723 samequantum -0E-3 7 -> 0
+ddsamq0724 samequantum -0E-3 7E+3 -> 0
+ddsamq0725 samequantum -0E-3 sNaN -> 0
+
+ddsamq0810 samequantum -0 -Inf -> 0
+ddsamq0811 samequantum -0 Inf -> 0
+ddsamq0812 samequantum -0 NaN -> 0
+ddsamq0813 samequantum -0 -7E+3 -> 0
+ddsamq0814 samequantum -0 -7 -> 1
+ddsamq0815 samequantum -0 -7E-3 -> 0
+ddsamq0816 samequantum -0 -0E-3 -> 0
+ddsamq0817 samequantum -0 -0 -> 1
+ddsamq0818 samequantum -0 -0E+3 -> 0
+ddsamq0819 samequantum -0 0E-3 -> 0
+ddsamq0820 samequantum -0 0 -> 1
+ddsamq0821 samequantum -0 0E+3 -> 0
+ddsamq0822 samequantum -0 7E-3 -> 0
+ddsamq0823 samequantum -0 7 -> 1
+ddsamq0824 samequantum -0 7E+3 -> 0
+ddsamq0825 samequantum -0 sNaN -> 0
+
+ddsamq0910 samequantum -0E+3 -Inf -> 0
+ddsamq0911 samequantum -0E+3 Inf -> 0
+ddsamq0912 samequantum -0E+3 NaN -> 0
+ddsamq0913 samequantum -0E+3 -7E+3 -> 1
+ddsamq0914 samequantum -0E+3 -7 -> 0
+ddsamq0915 samequantum -0E+3 -7E-3 -> 0
+ddsamq0916 samequantum -0E+3 -0E-3 -> 0
+ddsamq0917 samequantum -0E+3 -0 -> 0
+ddsamq0918 samequantum -0E+3 -0E+3 -> 1
+ddsamq0919 samequantum -0E+3 0E-3 -> 0
+ddsamq0920 samequantum -0E+3 0 -> 0
+ddsamq0921 samequantum -0E+3 0E+3 -> 1
+ddsamq0922 samequantum -0E+3 7E-3 -> 0
+ddsamq0923 samequantum -0E+3 7 -> 0
+ddsamq0924 samequantum -0E+3 7E+3 -> 1
+ddsamq0925 samequantum -0E+3 sNaN -> 0
+
+ddsamq1110 samequantum 0E-3 -Inf -> 0
+ddsamq1111 samequantum 0E-3 Inf -> 0
+ddsamq1112 samequantum 0E-3 NaN -> 0
+ddsamq1113 samequantum 0E-3 -7E+3 -> 0
+ddsamq1114 samequantum 0E-3 -7 -> 0
+ddsamq1115 samequantum 0E-3 -7E-3 -> 1
+ddsamq1116 samequantum 0E-3 -0E-3 -> 1
+ddsamq1117 samequantum 0E-3 -0 -> 0
+ddsamq1118 samequantum 0E-3 -0E+3 -> 0
+ddsamq1119 samequantum 0E-3 0E-3 -> 1
+ddsamq1120 samequantum 0E-3 0 -> 0
+ddsamq1121 samequantum 0E-3 0E+3 -> 0
+ddsamq1122 samequantum 0E-3 7E-3 -> 1
+ddsamq1123 samequantum 0E-3 7 -> 0
+ddsamq1124 samequantum 0E-3 7E+3 -> 0
+ddsamq1125 samequantum 0E-3 sNaN -> 0
+
+ddsamq1210 samequantum 0 -Inf -> 0
+ddsamq1211 samequantum 0 Inf -> 0
+ddsamq1212 samequantum 0 NaN -> 0
+ddsamq1213 samequantum 0 -7E+3 -> 0
+ddsamq1214 samequantum 0 -7 -> 1
+ddsamq1215 samequantum 0 -7E-3 -> 0
+ddsamq1216 samequantum 0 -0E-3 -> 0
+ddsamq1217 samequantum 0 -0 -> 1
+ddsamq1218 samequantum 0 -0E+3 -> 0
+ddsamq1219 samequantum 0 0E-3 -> 0
+ddsamq1220 samequantum 0 0 -> 1
+ddsamq1221 samequantum 0 0E+3 -> 0
+ddsamq1222 samequantum 0 7E-3 -> 0
+ddsamq1223 samequantum 0 7 -> 1
+ddsamq1224 samequantum 0 7E+3 -> 0
+ddsamq1225 samequantum 0 sNaN -> 0
+
+ddsamq1310 samequantum 0E+3 -Inf -> 0
+ddsamq1311 samequantum 0E+3 Inf -> 0
+ddsamq1312 samequantum 0E+3 NaN -> 0
+ddsamq1313 samequantum 0E+3 -7E+3 -> 1
+ddsamq1314 samequantum 0E+3 -7 -> 0
+ddsamq1315 samequantum 0E+3 -7E-3 -> 0
+ddsamq1316 samequantum 0E+3 -0E-3 -> 0
+ddsamq1317 samequantum 0E+3 -0 -> 0
+ddsamq1318 samequantum 0E+3 -0E+3 -> 1
+ddsamq1319 samequantum 0E+3 0E-3 -> 0
+ddsamq1320 samequantum 0E+3 0 -> 0
+ddsamq1321 samequantum 0E+3 0E+3 -> 1
+ddsamq1322 samequantum 0E+3 7E-3 -> 0
+ddsamq1323 samequantum 0E+3 7 -> 0
+ddsamq1324 samequantum 0E+3 7E+3 -> 1
+ddsamq1325 samequantum 0E+3 sNaN -> 0
+
+ddsamq1410 samequantum 7E-3 -Inf -> 0
+ddsamq1411 samequantum 7E-3 Inf -> 0
+ddsamq1412 samequantum 7E-3 NaN -> 0
+ddsamq1413 samequantum 7E-3 -7E+3 -> 0
+ddsamq1414 samequantum 7E-3 -7 -> 0
+ddsamq1415 samequantum 7E-3 -7E-3 -> 1
+ddsamq1416 samequantum 7E-3 -0E-3 -> 1
+ddsamq1417 samequantum 7E-3 -0 -> 0
+ddsamq1418 samequantum 7E-3 -0E+3 -> 0
+ddsamq1419 samequantum 7E-3 0E-3 -> 1
+ddsamq1420 samequantum 7E-3 0 -> 0
+ddsamq1421 samequantum 7E-3 0E+3 -> 0
+ddsamq1422 samequantum 7E-3 7E-3 -> 1
+ddsamq1423 samequantum 7E-3 7 -> 0
+ddsamq1424 samequantum 7E-3 7E+3 -> 0
+ddsamq1425 samequantum 7E-3 sNaN -> 0
+
+ddsamq1510 samequantum 7 -Inf -> 0
+ddsamq1511 samequantum 7 Inf -> 0
+ddsamq1512 samequantum 7 NaN -> 0
+ddsamq1513 samequantum 7 -7E+3 -> 0
+ddsamq1514 samequantum 7 -7 -> 1
+ddsamq1515 samequantum 7 -7E-3 -> 0
+ddsamq1516 samequantum 7 -0E-3 -> 0
+ddsamq1517 samequantum 7 -0 -> 1
+ddsamq1518 samequantum 7 -0E+3 -> 0
+ddsamq1519 samequantum 7 0E-3 -> 0
+ddsamq1520 samequantum 7 0 -> 1
+ddsamq1521 samequantum 7 0E+3 -> 0
+ddsamq1522 samequantum 7 7E-3 -> 0
+ddsamq1523 samequantum 7 7 -> 1
+ddsamq1524 samequantum 7 7E+3 -> 0
+ddsamq1525 samequantum 7 sNaN -> 0
+
+ddsamq1610 samequantum 7E+3 -Inf -> 0
+ddsamq1611 samequantum 7E+3 Inf -> 0
+ddsamq1612 samequantum 7E+3 NaN -> 0
+ddsamq1613 samequantum 7E+3 -7E+3 -> 1
+ddsamq1614 samequantum 7E+3 -7 -> 0
+ddsamq1615 samequantum 7E+3 -7E-3 -> 0
+ddsamq1616 samequantum 7E+3 -0E-3 -> 0
+ddsamq1617 samequantum 7E+3 -0 -> 0
+ddsamq1618 samequantum 7E+3 -0E+3 -> 1
+ddsamq1619 samequantum 7E+3 0E-3 -> 0
+ddsamq1620 samequantum 7E+3 0 -> 0
+ddsamq1621 samequantum 7E+3 0E+3 -> 1
+ddsamq1622 samequantum 7E+3 7E-3 -> 0
+ddsamq1623 samequantum 7E+3 7 -> 0
+ddsamq1624 samequantum 7E+3 7E+3 -> 1
+ddsamq1625 samequantum 7E+3 sNaN -> 0
+
+ddsamq1710 samequantum sNaN -Inf -> 0
+ddsamq1711 samequantum sNaN Inf -> 0
+ddsamq1712 samequantum sNaN NaN -> 1
+ddsamq1713 samequantum sNaN -7E+3 -> 0
+ddsamq1714 samequantum sNaN -7 -> 0
+ddsamq1715 samequantum sNaN -7E-3 -> 0
+ddsamq1716 samequantum sNaN -0E-3 -> 0
+ddsamq1717 samequantum sNaN -0 -> 0
+ddsamq1718 samequantum sNaN -0E+3 -> 0
+ddsamq1719 samequantum sNaN 0E-3 -> 0
+ddsamq1720 samequantum sNaN 0 -> 0
+ddsamq1721 samequantum sNaN 0E+3 -> 0
+ddsamq1722 samequantum sNaN 7E-3 -> 0
+ddsamq1723 samequantum sNaN 7 -> 0
+ddsamq1724 samequantum sNaN 7E+3 -> 0
+ddsamq1725 samequantum sNaN sNaN -> 1
+-- noisy NaNs
+ddsamq1730 samequantum sNaN3 sNaN3 -> 1
+ddsamq1731 samequantum sNaN3 sNaN4 -> 1
+ddsamq1732 samequantum NaN3 NaN3 -> 1
+ddsamq1733 samequantum NaN3 NaN4 -> 1
+ddsamq1734 samequantum sNaN3 3 -> 0
+ddsamq1735 samequantum NaN3 3 -> 0
+ddsamq1736 samequantum 4 sNaN4 -> 0
+ddsamq1737 samequantum 3 NaN3 -> 0
+ddsamq1738 samequantum Inf sNaN4 -> 0
+ddsamq1739 samequantum -Inf NaN3 -> 0
+
diff --git a/Lib/test/decimaltestdata/ddScaleB.decTest b/Lib/test/decimaltestdata/ddScaleB.decTest
index edee11bccc..6ba3e3976f 100644
--- a/Lib/test/decimaltestdata/ddScaleB.decTest
+++ b/Lib/test/decimaltestdata/ddScaleB.decTest
@@ -1,243 +1,243 @@
-------------------------------------------------------------------------
--- ddScalebB.decTest -- scale a decDouble by powers of 10 --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Max |rhs| is 2*(384+16) = 800
-
--- Sanity checks
-ddscb001 scaleb 7.50 10 -> 7.50E+10
-ddscb002 scaleb 7.50 3 -> 7.50E+3
-ddscb003 scaleb 7.50 2 -> 750
-ddscb004 scaleb 7.50 1 -> 75.0
-ddscb005 scaleb 7.50 0 -> 7.50
-ddscb006 scaleb 7.50 -1 -> 0.750
-ddscb007 scaleb 7.50 -2 -> 0.0750
-ddscb008 scaleb 7.50 -10 -> 7.50E-10
-ddscb009 scaleb -7.50 3 -> -7.50E+3
-ddscb010 scaleb -7.50 2 -> -750
-ddscb011 scaleb -7.50 1 -> -75.0
-ddscb012 scaleb -7.50 0 -> -7.50
-ddscb013 scaleb -7.50 -1 -> -0.750
-
--- Infinities
-ddscb014 scaleb Infinity 1 -> Infinity
-ddscb015 scaleb -Infinity 2 -> -Infinity
-ddscb016 scaleb Infinity -1 -> Infinity
-ddscb017 scaleb -Infinity -2 -> -Infinity
-
--- Next two are somewhat undefined in 754r; treat as non-integer
-ddscb018 scaleb 10 Infinity -> NaN Invalid_operation
-ddscb019 scaleb 10 -Infinity -> NaN Invalid_operation
-
--- NaNs are undefined in 754r; assume usual processing
--- NaNs, 0 payload
-ddscb021 scaleb NaN 1 -> NaN
-ddscb022 scaleb -NaN -1 -> -NaN
-ddscb023 scaleb sNaN 1 -> NaN Invalid_operation
-ddscb024 scaleb -sNaN 1 -> -NaN Invalid_operation
-ddscb025 scaleb 4 NaN -> NaN
-ddscb026 scaleb -Inf -NaN -> -NaN
-ddscb027 scaleb 4 sNaN -> NaN Invalid_operation
-ddscb028 scaleb Inf -sNaN -> -NaN Invalid_operation
-
--- non-integer RHS
-ddscb030 scaleb 1.23 1 -> 12.3
-ddscb031 scaleb 1.23 1.00 -> NaN Invalid_operation
-ddscb032 scaleb 1.23 1.1 -> NaN Invalid_operation
-ddscb033 scaleb 1.23 1.01 -> NaN Invalid_operation
-ddscb034 scaleb 1.23 0.01 -> NaN Invalid_operation
-ddscb035 scaleb 1.23 0.11 -> NaN Invalid_operation
-ddscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
-ddscb037 scaleb 1.23 -1 -> 0.123
-ddscb038 scaleb 1.23 -1.00 -> NaN Invalid_operation
-ddscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation
-ddscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation
-ddscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation
-ddscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation
-ddscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
-ddscb044 scaleb 1.23 0.1 -> NaN Invalid_operation
-ddscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation
-ddscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
-ddscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
-
--- out-of range RHS
-ddscb120 scaleb 1.23 799 -> Infinity Overflow Inexact Rounded
-ddscb121 scaleb 1.23 800 -> Infinity Overflow Inexact Rounded
-ddscb122 scaleb 1.23 801 -> NaN Invalid_operation
-ddscb123 scaleb 1.23 802 -> NaN Invalid_operation
-ddscb124 scaleb 1.23 -799 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddscb125 scaleb 1.23 -800 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddscb126 scaleb 1.23 -801 -> NaN Invalid_operation
-ddscb127 scaleb 1.23 -802 -> NaN Invalid_operation
-
--- NaNs, non-0 payload
--- propagating NaNs
-ddscb861 scaleb NaN01 -Inf -> NaN1
-ddscb862 scaleb -NaN02 -1000 -> -NaN2
-ddscb863 scaleb NaN03 1000 -> NaN3
-ddscb864 scaleb NaN04 Inf -> NaN4
-ddscb865 scaleb NaN05 NaN61 -> NaN5
-ddscb866 scaleb -Inf -NaN71 -> -NaN71
-ddscb867 scaleb -1000 NaN81 -> NaN81
-ddscb868 scaleb 1000 NaN91 -> NaN91
-ddscb869 scaleb Inf NaN101 -> NaN101
-ddscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
-ddscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
-ddscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
-ddscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
-ddscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
-ddscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
-ddscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
-ddscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
-ddscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
-ddscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
-ddscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- finites
-ddscb051 scaleb 7 -2 -> 0.07
-ddscb052 scaleb -7 -2 -> -0.07
-ddscb053 scaleb 75 -2 -> 0.75
-ddscb054 scaleb -75 -2 -> -0.75
-ddscb055 scaleb 7.50 -2 -> 0.0750
-ddscb056 scaleb -7.50 -2 -> -0.0750
-ddscb057 scaleb 7.500 -2 -> 0.07500
-ddscb058 scaleb -7.500 -2 -> -0.07500
-ddscb061 scaleb 7 -1 -> 0.7
-ddscb062 scaleb -7 -1 -> -0.7
-ddscb063 scaleb 75 -1 -> 7.5
-ddscb064 scaleb -75 -1 -> -7.5
-ddscb065 scaleb 7.50 -1 -> 0.750
-ddscb066 scaleb -7.50 -1 -> -0.750
-ddscb067 scaleb 7.500 -1 -> 0.7500
-ddscb068 scaleb -7.500 -1 -> -0.7500
-ddscb071 scaleb 7 0 -> 7
-ddscb072 scaleb -7 0 -> -7
-ddscb073 scaleb 75 0 -> 75
-ddscb074 scaleb -75 0 -> -75
-ddscb075 scaleb 7.50 0 -> 7.50
-ddscb076 scaleb -7.50 0 -> -7.50
-ddscb077 scaleb 7.500 0 -> 7.500
-ddscb078 scaleb -7.500 0 -> -7.500
-ddscb081 scaleb 7 1 -> 7E+1
-ddscb082 scaleb -7 1 -> -7E+1
-ddscb083 scaleb 75 1 -> 7.5E+2
-ddscb084 scaleb -75 1 -> -7.5E+2
-ddscb085 scaleb 7.50 1 -> 75.0
-ddscb086 scaleb -7.50 1 -> -75.0
-ddscb087 scaleb 7.500 1 -> 75.00
-ddscb088 scaleb -7.500 1 -> -75.00
-ddscb091 scaleb 7 2 -> 7E+2
-ddscb092 scaleb -7 2 -> -7E+2
-ddscb093 scaleb 75 2 -> 7.5E+3
-ddscb094 scaleb -75 2 -> -7.5E+3
-ddscb095 scaleb 7.50 2 -> 750
-ddscb096 scaleb -7.50 2 -> -750
-ddscb097 scaleb 7.500 2 -> 750.0
-ddscb098 scaleb -7.500 2 -> -750.0
-
--- zeros
-ddscb111 scaleb 0 1 -> 0E+1
-ddscb112 scaleb -0 2 -> -0E+2
-ddscb113 scaleb 0E+4 3 -> 0E+7
-ddscb114 scaleb -0E+4 4 -> -0E+8
-ddscb115 scaleb 0.0000 5 -> 0E+1
-ddscb116 scaleb -0.0000 6 -> -0E+2
-ddscb117 scaleb 0E-141 7 -> 0E-134
-ddscb118 scaleb -0E-141 8 -> -0E-133
-
--- Nmax, Nmin, Ntiny
-ddscb132 scaleb 9.999999999999999E+384 +384 -> Infinity Overflow Inexact Rounded
-ddscb133 scaleb 9.999999999999999E+384 +10 -> Infinity Overflow Inexact Rounded
-ddscb134 scaleb 9.999999999999999E+384 +1 -> Infinity Overflow Inexact Rounded
-ddscb135 scaleb 9.999999999999999E+384 0 -> 9.999999999999999E+384
-ddscb136 scaleb 9.999999999999999E+384 -1 -> 9.999999999999999E+383
-ddscb137 scaleb 1E-383 +1 -> 1E-382
-ddscb138 scaleb 1E-383 -0 -> 1E-383
-ddscb139 scaleb 1E-383 -1 -> 1E-384 Subnormal
-ddscb140 scaleb 1.000000000000000E-383 +1 -> 1.000000000000000E-382
-ddscb141 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
-ddscb142 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
-ddscb143 scaleb 1E-398 +1 -> 1E-397 Subnormal
-ddscb144 scaleb 1E-398 -0 -> 1E-398 Subnormal
-ddscb145 scaleb 1E-398 -1 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-ddscb150 scaleb -1E-398 +1 -> -1E-397 Subnormal
-ddscb151 scaleb -1E-398 -0 -> -1E-398 Subnormal
-ddscb152 scaleb -1E-398 -1 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddscb153 scaleb -1.000000000000000E-383 +1 -> -1.000000000000000E-382
-ddscb154 scaleb -1.000000000000000E-383 +0 -> -1.000000000000000E-383
-ddscb155 scaleb -1.000000000000000E-383 -1 -> -1.00000000000000E-384 Subnormal Rounded
-ddscb156 scaleb -1E-383 +1 -> -1E-382
-ddscb157 scaleb -1E-383 -0 -> -1E-383
-ddscb158 scaleb -1E-383 -1 -> -1E-384 Subnormal
-ddscb159 scaleb -9.999999999999999E+384 +1 -> -Infinity Overflow Inexact Rounded
-ddscb160 scaleb -9.999999999999999E+384 +0 -> -9.999999999999999E+384
-ddscb161 scaleb -9.999999999999999E+384 -1 -> -9.999999999999999E+383
-ddscb162 scaleb -9E+384 +1 -> -Infinity Overflow Inexact Rounded
-ddscb163 scaleb -1E+384 +1 -> -Infinity Overflow Inexact Rounded
-
--- some Origami
--- (these check that overflow is being done correctly)
-ddscb171 scaleb 1000E+365 +1 -> 1.000E+369
-ddscb172 scaleb 1000E+366 +1 -> 1.000E+370
-ddscb173 scaleb 1000E+367 +1 -> 1.000E+371
-ddscb174 scaleb 1000E+368 +1 -> 1.000E+372
-ddscb175 scaleb 1000E+369 +1 -> 1.0000E+373 Clamped
-ddscb176 scaleb 1000E+370 +1 -> 1.00000E+374 Clamped
-ddscb177 scaleb 1000E+371 +1 -> 1.000000E+375 Clamped
-ddscb178 scaleb 1000E+372 +1 -> 1.0000000E+376 Clamped
-ddscb179 scaleb 1000E+373 +1 -> 1.00000000E+377 Clamped
-ddscb180 scaleb 1000E+374 +1 -> 1.000000000E+378 Clamped
-ddscb181 scaleb 1000E+375 +1 -> 1.0000000000E+379 Clamped
-ddscb182 scaleb 1000E+376 +1 -> 1.00000000000E+380 Clamped
-ddscb183 scaleb 1000E+377 +1 -> 1.000000000000E+381 Clamped
-ddscb184 scaleb 1000E+378 +1 -> 1.0000000000000E+382 Clamped
-ddscb185 scaleb 1000E+379 +1 -> 1.00000000000000E+383 Clamped
-ddscb186 scaleb 1000E+380 +1 -> 1.000000000000000E+384 Clamped
-ddscb187 scaleb 1000E+381 +1 -> Infinity Overflow Inexact Rounded
-
--- and a few more subnormal truncations
--- (these check that underflow is being done correctly)
-ddscb201 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
-ddscb202 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
-ddscb203 scaleb 1.000000000000000E-383 -2 -> 1.0000000000000E-385 Subnormal Rounded
-ddscb204 scaleb 1.000000000000000E-383 -3 -> 1.000000000000E-386 Subnormal Rounded
-ddscb205 scaleb 1.000000000000000E-383 -4 -> 1.00000000000E-387 Subnormal Rounded
-ddscb206 scaleb 1.000000000000000E-383 -5 -> 1.0000000000E-388 Subnormal Rounded
-ddscb207 scaleb 1.000000000000000E-383 -6 -> 1.000000000E-389 Subnormal Rounded
-ddscb208 scaleb 1.000000000000000E-383 -7 -> 1.00000000E-390 Subnormal Rounded
-ddscb209 scaleb 1.000000000000000E-383 -8 -> 1.0000000E-391 Subnormal Rounded
-ddscb210 scaleb 1.000000000000000E-383 -9 -> 1.000000E-392 Subnormal Rounded
-ddscb211 scaleb 1.000000000000000E-383 -10 -> 1.00000E-393 Subnormal Rounded
-ddscb212 scaleb 1.000000000000000E-383 -11 -> 1.0000E-394 Subnormal Rounded
-ddscb213 scaleb 1.000000000000000E-383 -12 -> 1.000E-395 Subnormal Rounded
-ddscb214 scaleb 1.000000000000000E-383 -13 -> 1.00E-396 Subnormal Rounded
-ddscb215 scaleb 1.000000000000000E-383 -14 -> 1.0E-397 Subnormal Rounded
-ddscb216 scaleb 1.000000000000000E-383 -15 -> 1E-398 Subnormal Rounded
-ddscb217 scaleb 1.000000000000000E-383 -16 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddscb218 scaleb 1.000000000000000E-383 -17 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
+------------------------------------------------------------------------
+-- ddScalebB.decTest -- scale a decDouble by powers of 10 --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Max |rhs| is 2*(384+16) = 800
+
+-- Sanity checks
+ddscb001 scaleb 7.50 10 -> 7.50E+10
+ddscb002 scaleb 7.50 3 -> 7.50E+3
+ddscb003 scaleb 7.50 2 -> 750
+ddscb004 scaleb 7.50 1 -> 75.0
+ddscb005 scaleb 7.50 0 -> 7.50
+ddscb006 scaleb 7.50 -1 -> 0.750
+ddscb007 scaleb 7.50 -2 -> 0.0750
+ddscb008 scaleb 7.50 -10 -> 7.50E-10
+ddscb009 scaleb -7.50 3 -> -7.50E+3
+ddscb010 scaleb -7.50 2 -> -750
+ddscb011 scaleb -7.50 1 -> -75.0
+ddscb012 scaleb -7.50 0 -> -7.50
+ddscb013 scaleb -7.50 -1 -> -0.750
+
+-- Infinities
+ddscb014 scaleb Infinity 1 -> Infinity
+ddscb015 scaleb -Infinity 2 -> -Infinity
+ddscb016 scaleb Infinity -1 -> Infinity
+ddscb017 scaleb -Infinity -2 -> -Infinity
+
+-- Next two are somewhat undefined in 754r; treat as non-integer
+ddscb018 scaleb 10 Infinity -> NaN Invalid_operation
+ddscb019 scaleb 10 -Infinity -> NaN Invalid_operation
+
+-- NaNs are undefined in 754r; assume usual processing
+-- NaNs, 0 payload
+ddscb021 scaleb NaN 1 -> NaN
+ddscb022 scaleb -NaN -1 -> -NaN
+ddscb023 scaleb sNaN 1 -> NaN Invalid_operation
+ddscb024 scaleb -sNaN 1 -> -NaN Invalid_operation
+ddscb025 scaleb 4 NaN -> NaN
+ddscb026 scaleb -Inf -NaN -> -NaN
+ddscb027 scaleb 4 sNaN -> NaN Invalid_operation
+ddscb028 scaleb Inf -sNaN -> -NaN Invalid_operation
+
+-- non-integer RHS
+ddscb030 scaleb 1.23 1 -> 12.3
+ddscb031 scaleb 1.23 1.00 -> NaN Invalid_operation
+ddscb032 scaleb 1.23 1.1 -> NaN Invalid_operation
+ddscb033 scaleb 1.23 1.01 -> NaN Invalid_operation
+ddscb034 scaleb 1.23 0.01 -> NaN Invalid_operation
+ddscb035 scaleb 1.23 0.11 -> NaN Invalid_operation
+ddscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
+ddscb037 scaleb 1.23 -1 -> 0.123
+ddscb038 scaleb 1.23 -1.00 -> NaN Invalid_operation
+ddscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation
+ddscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation
+ddscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation
+ddscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation
+ddscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
+ddscb044 scaleb 1.23 0.1 -> NaN Invalid_operation
+ddscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation
+ddscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
+ddscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
+
+-- out-of range RHS
+ddscb120 scaleb 1.23 799 -> Infinity Overflow Inexact Rounded
+ddscb121 scaleb 1.23 800 -> Infinity Overflow Inexact Rounded
+ddscb122 scaleb 1.23 801 -> NaN Invalid_operation
+ddscb123 scaleb 1.23 802 -> NaN Invalid_operation
+ddscb124 scaleb 1.23 -799 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddscb125 scaleb 1.23 -800 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddscb126 scaleb 1.23 -801 -> NaN Invalid_operation
+ddscb127 scaleb 1.23 -802 -> NaN Invalid_operation
+
+-- NaNs, non-0 payload
+-- propagating NaNs
+ddscb861 scaleb NaN01 -Inf -> NaN1
+ddscb862 scaleb -NaN02 -1000 -> -NaN2
+ddscb863 scaleb NaN03 1000 -> NaN3
+ddscb864 scaleb NaN04 Inf -> NaN4
+ddscb865 scaleb NaN05 NaN61 -> NaN5
+ddscb866 scaleb -Inf -NaN71 -> -NaN71
+ddscb867 scaleb -1000 NaN81 -> NaN81
+ddscb868 scaleb 1000 NaN91 -> NaN91
+ddscb869 scaleb Inf NaN101 -> NaN101
+ddscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
+ddscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
+ddscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
+ddscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
+ddscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
+ddscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
+ddscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
+ddscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
+ddscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
+ddscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
+ddscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- finites
+ddscb051 scaleb 7 -2 -> 0.07
+ddscb052 scaleb -7 -2 -> -0.07
+ddscb053 scaleb 75 -2 -> 0.75
+ddscb054 scaleb -75 -2 -> -0.75
+ddscb055 scaleb 7.50 -2 -> 0.0750
+ddscb056 scaleb -7.50 -2 -> -0.0750
+ddscb057 scaleb 7.500 -2 -> 0.07500
+ddscb058 scaleb -7.500 -2 -> -0.07500
+ddscb061 scaleb 7 -1 -> 0.7
+ddscb062 scaleb -7 -1 -> -0.7
+ddscb063 scaleb 75 -1 -> 7.5
+ddscb064 scaleb -75 -1 -> -7.5
+ddscb065 scaleb 7.50 -1 -> 0.750
+ddscb066 scaleb -7.50 -1 -> -0.750
+ddscb067 scaleb 7.500 -1 -> 0.7500
+ddscb068 scaleb -7.500 -1 -> -0.7500
+ddscb071 scaleb 7 0 -> 7
+ddscb072 scaleb -7 0 -> -7
+ddscb073 scaleb 75 0 -> 75
+ddscb074 scaleb -75 0 -> -75
+ddscb075 scaleb 7.50 0 -> 7.50
+ddscb076 scaleb -7.50 0 -> -7.50
+ddscb077 scaleb 7.500 0 -> 7.500
+ddscb078 scaleb -7.500 0 -> -7.500
+ddscb081 scaleb 7 1 -> 7E+1
+ddscb082 scaleb -7 1 -> -7E+1
+ddscb083 scaleb 75 1 -> 7.5E+2
+ddscb084 scaleb -75 1 -> -7.5E+2
+ddscb085 scaleb 7.50 1 -> 75.0
+ddscb086 scaleb -7.50 1 -> -75.0
+ddscb087 scaleb 7.500 1 -> 75.00
+ddscb088 scaleb -7.500 1 -> -75.00
+ddscb091 scaleb 7 2 -> 7E+2
+ddscb092 scaleb -7 2 -> -7E+2
+ddscb093 scaleb 75 2 -> 7.5E+3
+ddscb094 scaleb -75 2 -> -7.5E+3
+ddscb095 scaleb 7.50 2 -> 750
+ddscb096 scaleb -7.50 2 -> -750
+ddscb097 scaleb 7.500 2 -> 750.0
+ddscb098 scaleb -7.500 2 -> -750.0
+
+-- zeros
+ddscb111 scaleb 0 1 -> 0E+1
+ddscb112 scaleb -0 2 -> -0E+2
+ddscb113 scaleb 0E+4 3 -> 0E+7
+ddscb114 scaleb -0E+4 4 -> -0E+8
+ddscb115 scaleb 0.0000 5 -> 0E+1
+ddscb116 scaleb -0.0000 6 -> -0E+2
+ddscb117 scaleb 0E-141 7 -> 0E-134
+ddscb118 scaleb -0E-141 8 -> -0E-133
+
+-- Nmax, Nmin, Ntiny
+ddscb132 scaleb 9.999999999999999E+384 +384 -> Infinity Overflow Inexact Rounded
+ddscb133 scaleb 9.999999999999999E+384 +10 -> Infinity Overflow Inexact Rounded
+ddscb134 scaleb 9.999999999999999E+384 +1 -> Infinity Overflow Inexact Rounded
+ddscb135 scaleb 9.999999999999999E+384 0 -> 9.999999999999999E+384
+ddscb136 scaleb 9.999999999999999E+384 -1 -> 9.999999999999999E+383
+ddscb137 scaleb 1E-383 +1 -> 1E-382
+ddscb138 scaleb 1E-383 -0 -> 1E-383
+ddscb139 scaleb 1E-383 -1 -> 1E-384 Subnormal
+ddscb140 scaleb 1.000000000000000E-383 +1 -> 1.000000000000000E-382
+ddscb141 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
+ddscb142 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
+ddscb143 scaleb 1E-398 +1 -> 1E-397 Subnormal
+ddscb144 scaleb 1E-398 -0 -> 1E-398 Subnormal
+ddscb145 scaleb 1E-398 -1 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+ddscb150 scaleb -1E-398 +1 -> -1E-397 Subnormal
+ddscb151 scaleb -1E-398 -0 -> -1E-398 Subnormal
+ddscb152 scaleb -1E-398 -1 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddscb153 scaleb -1.000000000000000E-383 +1 -> -1.000000000000000E-382
+ddscb154 scaleb -1.000000000000000E-383 +0 -> -1.000000000000000E-383
+ddscb155 scaleb -1.000000000000000E-383 -1 -> -1.00000000000000E-384 Subnormal Rounded
+ddscb156 scaleb -1E-383 +1 -> -1E-382
+ddscb157 scaleb -1E-383 -0 -> -1E-383
+ddscb158 scaleb -1E-383 -1 -> -1E-384 Subnormal
+ddscb159 scaleb -9.999999999999999E+384 +1 -> -Infinity Overflow Inexact Rounded
+ddscb160 scaleb -9.999999999999999E+384 +0 -> -9.999999999999999E+384
+ddscb161 scaleb -9.999999999999999E+384 -1 -> -9.999999999999999E+383
+ddscb162 scaleb -9E+384 +1 -> -Infinity Overflow Inexact Rounded
+ddscb163 scaleb -1E+384 +1 -> -Infinity Overflow Inexact Rounded
+
+-- some Origami
+-- (these check that overflow is being done correctly)
+ddscb171 scaleb 1000E+365 +1 -> 1.000E+369
+ddscb172 scaleb 1000E+366 +1 -> 1.000E+370
+ddscb173 scaleb 1000E+367 +1 -> 1.000E+371
+ddscb174 scaleb 1000E+368 +1 -> 1.000E+372
+ddscb175 scaleb 1000E+369 +1 -> 1.0000E+373 Clamped
+ddscb176 scaleb 1000E+370 +1 -> 1.00000E+374 Clamped
+ddscb177 scaleb 1000E+371 +1 -> 1.000000E+375 Clamped
+ddscb178 scaleb 1000E+372 +1 -> 1.0000000E+376 Clamped
+ddscb179 scaleb 1000E+373 +1 -> 1.00000000E+377 Clamped
+ddscb180 scaleb 1000E+374 +1 -> 1.000000000E+378 Clamped
+ddscb181 scaleb 1000E+375 +1 -> 1.0000000000E+379 Clamped
+ddscb182 scaleb 1000E+376 +1 -> 1.00000000000E+380 Clamped
+ddscb183 scaleb 1000E+377 +1 -> 1.000000000000E+381 Clamped
+ddscb184 scaleb 1000E+378 +1 -> 1.0000000000000E+382 Clamped
+ddscb185 scaleb 1000E+379 +1 -> 1.00000000000000E+383 Clamped
+ddscb186 scaleb 1000E+380 +1 -> 1.000000000000000E+384 Clamped
+ddscb187 scaleb 1000E+381 +1 -> Infinity Overflow Inexact Rounded
+
+-- and a few more subnormal truncations
+-- (these check that underflow is being done correctly)
+ddscb201 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
+ddscb202 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
+ddscb203 scaleb 1.000000000000000E-383 -2 -> 1.0000000000000E-385 Subnormal Rounded
+ddscb204 scaleb 1.000000000000000E-383 -3 -> 1.000000000000E-386 Subnormal Rounded
+ddscb205 scaleb 1.000000000000000E-383 -4 -> 1.00000000000E-387 Subnormal Rounded
+ddscb206 scaleb 1.000000000000000E-383 -5 -> 1.0000000000E-388 Subnormal Rounded
+ddscb207 scaleb 1.000000000000000E-383 -6 -> 1.000000000E-389 Subnormal Rounded
+ddscb208 scaleb 1.000000000000000E-383 -7 -> 1.00000000E-390 Subnormal Rounded
+ddscb209 scaleb 1.000000000000000E-383 -8 -> 1.0000000E-391 Subnormal Rounded
+ddscb210 scaleb 1.000000000000000E-383 -9 -> 1.000000E-392 Subnormal Rounded
+ddscb211 scaleb 1.000000000000000E-383 -10 -> 1.00000E-393 Subnormal Rounded
+ddscb212 scaleb 1.000000000000000E-383 -11 -> 1.0000E-394 Subnormal Rounded
+ddscb213 scaleb 1.000000000000000E-383 -12 -> 1.000E-395 Subnormal Rounded
+ddscb214 scaleb 1.000000000000000E-383 -13 -> 1.00E-396 Subnormal Rounded
+ddscb215 scaleb 1.000000000000000E-383 -14 -> 1.0E-397 Subnormal Rounded
+ddscb216 scaleb 1.000000000000000E-383 -15 -> 1E-398 Subnormal Rounded
+ddscb217 scaleb 1.000000000000000E-383 -16 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddscb218 scaleb 1.000000000000000E-383 -17 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
diff --git a/Lib/test/decimaltestdata/ddShift.decTest b/Lib/test/decimaltestdata/ddShift.decTest
index f62a236b2e..ec472403e6 100644
--- a/Lib/test/decimaltestdata/ddShift.decTest
+++ b/Lib/test/decimaltestdata/ddShift.decTest
@@ -1,262 +1,262 @@
-------------------------------------------------------------------------
--- ddShift.decTest -- shift decDouble coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddshi001 shift 0 0 -> 0
-ddshi002 shift 0 2 -> 0
-ddshi003 shift 1 2 -> 100
-ddshi004 shift 1 15 -> 1000000000000000
-ddshi005 shift 1 16 -> 0
-ddshi006 shift 1 -1 -> 0
-ddshi007 shift 0 -2 -> 0
-ddshi008 shift 1234567890123456 -1 -> 123456789012345
-ddshi009 shift 1234567890123456 -15 -> 1
-ddshi010 shift 1234567890123456 -16 -> 0
-ddshi011 shift 9934567890123456 -15 -> 9
-ddshi012 shift 9934567890123456 -16 -> 0
-
--- rhs must be an integer
-ddshi015 shift 1 1.5 -> NaN Invalid_operation
-ddshi016 shift 1 1.0 -> NaN Invalid_operation
-ddshi017 shift 1 0.1 -> NaN Invalid_operation
-ddshi018 shift 1 0.0 -> NaN Invalid_operation
-ddshi019 shift 1 1E+1 -> NaN Invalid_operation
-ddshi020 shift 1 1E+99 -> NaN Invalid_operation
-ddshi021 shift 1 Inf -> NaN Invalid_operation
-ddshi022 shift 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-ddshi025 shift 1 -1000 -> NaN Invalid_operation
-ddshi026 shift 1 -17 -> NaN Invalid_operation
-ddshi027 shift 1 17 -> NaN Invalid_operation
-ddshi028 shift 1 1000 -> NaN Invalid_operation
-
--- full shifting pattern
-ddshi030 shift 1234567890123456 -16 -> 0
-ddshi031 shift 1234567890123456 -15 -> 1
-ddshi032 shift 1234567890123456 -14 -> 12
-ddshi033 shift 1234567890123456 -13 -> 123
-ddshi034 shift 1234567890123456 -12 -> 1234
-ddshi035 shift 1234567890123456 -11 -> 12345
-ddshi036 shift 1234567890123456 -10 -> 123456
-ddshi037 shift 1234567890123456 -9 -> 1234567
-ddshi038 shift 1234567890123456 -8 -> 12345678
-ddshi039 shift 1234567890123456 -7 -> 123456789
-ddshi040 shift 1234567890123456 -6 -> 1234567890
-ddshi041 shift 1234567890123456 -5 -> 12345678901
-ddshi042 shift 1234567890123456 -4 -> 123456789012
-ddshi043 shift 1234567890123456 -3 -> 1234567890123
-ddshi044 shift 1234567890123456 -2 -> 12345678901234
-ddshi045 shift 1234567890123456 -1 -> 123456789012345
-ddshi046 shift 1234567890123456 -0 -> 1234567890123456
-
-ddshi047 shift 1234567890123456 +0 -> 1234567890123456
-ddshi048 shift 1234567890123456 +1 -> 2345678901234560
-ddshi049 shift 1234567890123456 +2 -> 3456789012345600
-ddshi050 shift 1234567890123456 +3 -> 4567890123456000
-ddshi051 shift 1234567890123456 +4 -> 5678901234560000
-ddshi052 shift 1234567890123456 +5 -> 6789012345600000
-ddshi053 shift 1234567890123456 +6 -> 7890123456000000
-ddshi054 shift 1234567890123456 +7 -> 8901234560000000
-ddshi055 shift 1234567890123456 +8 -> 9012345600000000
-ddshi056 shift 1234567890123456 +9 -> 123456000000000
-ddshi057 shift 1234567890123456 +10 -> 1234560000000000
-ddshi058 shift 1234567890123456 +11 -> 2345600000000000
-ddshi059 shift 1234567890123456 +12 -> 3456000000000000
-ddshi060 shift 1234567890123456 +13 -> 4560000000000000
-ddshi061 shift 1234567890123456 +14 -> 5600000000000000
-ddshi062 shift 1234567890123456 +15 -> 6000000000000000
-ddshi063 shift 1234567890123456 +16 -> 0
-
--- zeros
-ddshi070 shift 0E-10 +9 -> 0E-10
-ddshi071 shift 0E-10 -9 -> 0E-10
-ddshi072 shift 0.000 +9 -> 0.000
-ddshi073 shift 0.000 -9 -> 0.000
-ddshi074 shift 0E+10 +9 -> 0E+10
-ddshi075 shift 0E+10 -9 -> 0E+10
-ddshi076 shift -0E-10 +9 -> -0E-10
-ddshi077 shift -0E-10 -9 -> -0E-10
-ddshi078 shift -0.000 +9 -> -0.000
-ddshi079 shift -0.000 -9 -> -0.000
-ddshi080 shift -0E+10 +9 -> -0E+10
-ddshi081 shift -0E+10 -9 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-ddshi141 shift 9.999999999999999E+384 -1 -> 9.99999999999999E+383
-ddshi142 shift 9.999999999999999E+384 -15 -> 9E+369
-ddshi143 shift 9.999999999999999E+384 1 -> 9.999999999999990E+384
-ddshi144 shift 9.999999999999999E+384 15 -> 9.000000000000000E+384
-ddshi145 shift 1E-383 -1 -> 0E-383
-ddshi146 shift 1E-383 -15 -> 0E-383
-ddshi147 shift 1E-383 1 -> 1.0E-382
-ddshi148 shift 1E-383 15 -> 1.000000000000000E-368
-ddshi151 shift 1.000000000000000E-383 -1 -> 1.00000000000000E-384
-ddshi152 shift 1.000000000000000E-383 -15 -> 1E-398
-ddshi153 shift 1.000000000000000E-383 1 -> 0E-398
-ddshi154 shift 1.000000000000000E-383 15 -> 0E-398
-ddshi155 shift 9.000000000000000E-383 -1 -> 9.00000000000000E-384
-ddshi156 shift 9.000000000000000E-383 -15 -> 9E-398
-ddshi157 shift 9.000000000000000E-383 1 -> 0E-398
-ddshi158 shift 9.000000000000000E-383 15 -> 0E-398
-ddshi160 shift 1E-398 -1 -> 0E-398
-ddshi161 shift 1E-398 -15 -> 0E-398
-ddshi162 shift 1E-398 1 -> 1.0E-397
-ddshi163 shift 1E-398 15 -> 1.000000000000000E-383
--- negatives
-ddshi171 shift -9.999999999999999E+384 -1 -> -9.99999999999999E+383
-ddshi172 shift -9.999999999999999E+384 -15 -> -9E+369
-ddshi173 shift -9.999999999999999E+384 1 -> -9.999999999999990E+384
-ddshi174 shift -9.999999999999999E+384 15 -> -9.000000000000000E+384
-ddshi175 shift -1E-383 -1 -> -0E-383
-ddshi176 shift -1E-383 -15 -> -0E-383
-ddshi177 shift -1E-383 1 -> -1.0E-382
-ddshi178 shift -1E-383 15 -> -1.000000000000000E-368
-ddshi181 shift -1.000000000000000E-383 -1 -> -1.00000000000000E-384
-ddshi182 shift -1.000000000000000E-383 -15 -> -1E-398
-ddshi183 shift -1.000000000000000E-383 1 -> -0E-398
-ddshi184 shift -1.000000000000000E-383 15 -> -0E-398
-ddshi185 shift -9.000000000000000E-383 -1 -> -9.00000000000000E-384
-ddshi186 shift -9.000000000000000E-383 -15 -> -9E-398
-ddshi187 shift -9.000000000000000E-383 1 -> -0E-398
-ddshi188 shift -9.000000000000000E-383 15 -> -0E-398
-ddshi190 shift -1E-398 -1 -> -0E-398
-ddshi191 shift -1E-398 -15 -> -0E-398
-ddshi192 shift -1E-398 1 -> -1.0E-397
-ddshi193 shift -1E-398 15 -> -1.000000000000000E-383
-
--- more negatives (of sanities)
-ddshi201 shift -0 0 -> -0
-ddshi202 shift -0 2 -> -0
-ddshi203 shift -1 2 -> -100
-ddshi204 shift -1 15 -> -1000000000000000
-ddshi205 shift -1 16 -> -0
-ddshi206 shift -1 -1 -> -0
-ddshi207 shift -0 -2 -> -0
-ddshi208 shift -1234567890123456 -1 -> -123456789012345
-ddshi209 shift -1234567890123456 -15 -> -1
-ddshi210 shift -1234567890123456 -16 -> -0
-ddshi211 shift -9934567890123456 -15 -> -9
-ddshi212 shift -9934567890123456 -16 -> -0
-
-
--- Specials; NaNs are handled as usual
-ddshi781 shift -Inf -8 -> -Infinity
-ddshi782 shift -Inf -1 -> -Infinity
-ddshi783 shift -Inf -0 -> -Infinity
-ddshi784 shift -Inf 0 -> -Infinity
-ddshi785 shift -Inf 1 -> -Infinity
-ddshi786 shift -Inf 8 -> -Infinity
-ddshi787 shift -1000 -Inf -> NaN Invalid_operation
-ddshi788 shift -Inf -Inf -> NaN Invalid_operation
-ddshi789 shift -1 -Inf -> NaN Invalid_operation
-ddshi790 shift -0 -Inf -> NaN Invalid_operation
-ddshi791 shift 0 -Inf -> NaN Invalid_operation
-ddshi792 shift 1 -Inf -> NaN Invalid_operation
-ddshi793 shift 1000 -Inf -> NaN Invalid_operation
-ddshi794 shift Inf -Inf -> NaN Invalid_operation
-
-ddshi800 shift Inf -Inf -> NaN Invalid_operation
-ddshi801 shift Inf -8 -> Infinity
-ddshi802 shift Inf -1 -> Infinity
-ddshi803 shift Inf -0 -> Infinity
-ddshi804 shift Inf 0 -> Infinity
-ddshi805 shift Inf 1 -> Infinity
-ddshi806 shift Inf 8 -> Infinity
-ddshi807 shift Inf Inf -> NaN Invalid_operation
-ddshi808 shift -1000 Inf -> NaN Invalid_operation
-ddshi809 shift -Inf Inf -> NaN Invalid_operation
-ddshi810 shift -1 Inf -> NaN Invalid_operation
-ddshi811 shift -0 Inf -> NaN Invalid_operation
-ddshi812 shift 0 Inf -> NaN Invalid_operation
-ddshi813 shift 1 Inf -> NaN Invalid_operation
-ddshi814 shift 1000 Inf -> NaN Invalid_operation
-ddshi815 shift Inf Inf -> NaN Invalid_operation
-
-ddshi821 shift NaN -Inf -> NaN
-ddshi822 shift NaN -1000 -> NaN
-ddshi823 shift NaN -1 -> NaN
-ddshi824 shift NaN -0 -> NaN
-ddshi825 shift NaN 0 -> NaN
-ddshi826 shift NaN 1 -> NaN
-ddshi827 shift NaN 1000 -> NaN
-ddshi828 shift NaN Inf -> NaN
-ddshi829 shift NaN NaN -> NaN
-ddshi830 shift -Inf NaN -> NaN
-ddshi831 shift -1000 NaN -> NaN
-ddshi832 shift -1 NaN -> NaN
-ddshi833 shift -0 NaN -> NaN
-ddshi834 shift 0 NaN -> NaN
-ddshi835 shift 1 NaN -> NaN
-ddshi836 shift 1000 NaN -> NaN
-ddshi837 shift Inf NaN -> NaN
-
-ddshi841 shift sNaN -Inf -> NaN Invalid_operation
-ddshi842 shift sNaN -1000 -> NaN Invalid_operation
-ddshi843 shift sNaN -1 -> NaN Invalid_operation
-ddshi844 shift sNaN -0 -> NaN Invalid_operation
-ddshi845 shift sNaN 0 -> NaN Invalid_operation
-ddshi846 shift sNaN 1 -> NaN Invalid_operation
-ddshi847 shift sNaN 1000 -> NaN Invalid_operation
-ddshi848 shift sNaN NaN -> NaN Invalid_operation
-ddshi849 shift sNaN sNaN -> NaN Invalid_operation
-ddshi850 shift NaN sNaN -> NaN Invalid_operation
-ddshi851 shift -Inf sNaN -> NaN Invalid_operation
-ddshi852 shift -1000 sNaN -> NaN Invalid_operation
-ddshi853 shift -1 sNaN -> NaN Invalid_operation
-ddshi854 shift -0 sNaN -> NaN Invalid_operation
-ddshi855 shift 0 sNaN -> NaN Invalid_operation
-ddshi856 shift 1 sNaN -> NaN Invalid_operation
-ddshi857 shift 1000 sNaN -> NaN Invalid_operation
-ddshi858 shift Inf sNaN -> NaN Invalid_operation
-ddshi859 shift NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddshi861 shift NaN1 -Inf -> NaN1
-ddshi862 shift +NaN2 -1000 -> NaN2
-ddshi863 shift NaN3 1000 -> NaN3
-ddshi864 shift NaN4 Inf -> NaN4
-ddshi865 shift NaN5 +NaN6 -> NaN5
-ddshi866 shift -Inf NaN7 -> NaN7
-ddshi867 shift -1000 NaN8 -> NaN8
-ddshi868 shift 1000 NaN9 -> NaN9
-ddshi869 shift Inf +NaN10 -> NaN10
-ddshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation
-ddshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation
-ddshi873 shift sNaN13 1000 -> NaN13 Invalid_operation
-ddshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
-ddshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
-ddshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
-ddshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation
-ddshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation
-ddshi880 shift Inf sNaN23 -> NaN23 Invalid_operation
-ddshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddshi882 shift -NaN26 NaN28 -> -NaN26
-ddshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddshi884 shift 1000 -NaN30 -> -NaN30
-ddshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- ddShift.decTest -- shift decDouble coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddshi001 shift 0 0 -> 0
+ddshi002 shift 0 2 -> 0
+ddshi003 shift 1 2 -> 100
+ddshi004 shift 1 15 -> 1000000000000000
+ddshi005 shift 1 16 -> 0
+ddshi006 shift 1 -1 -> 0
+ddshi007 shift 0 -2 -> 0
+ddshi008 shift 1234567890123456 -1 -> 123456789012345
+ddshi009 shift 1234567890123456 -15 -> 1
+ddshi010 shift 1234567890123456 -16 -> 0
+ddshi011 shift 9934567890123456 -15 -> 9
+ddshi012 shift 9934567890123456 -16 -> 0
+
+-- rhs must be an integer
+ddshi015 shift 1 1.5 -> NaN Invalid_operation
+ddshi016 shift 1 1.0 -> NaN Invalid_operation
+ddshi017 shift 1 0.1 -> NaN Invalid_operation
+ddshi018 shift 1 0.0 -> NaN Invalid_operation
+ddshi019 shift 1 1E+1 -> NaN Invalid_operation
+ddshi020 shift 1 1E+99 -> NaN Invalid_operation
+ddshi021 shift 1 Inf -> NaN Invalid_operation
+ddshi022 shift 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+ddshi025 shift 1 -1000 -> NaN Invalid_operation
+ddshi026 shift 1 -17 -> NaN Invalid_operation
+ddshi027 shift 1 17 -> NaN Invalid_operation
+ddshi028 shift 1 1000 -> NaN Invalid_operation
+
+-- full shifting pattern
+ddshi030 shift 1234567890123456 -16 -> 0
+ddshi031 shift 1234567890123456 -15 -> 1
+ddshi032 shift 1234567890123456 -14 -> 12
+ddshi033 shift 1234567890123456 -13 -> 123
+ddshi034 shift 1234567890123456 -12 -> 1234
+ddshi035 shift 1234567890123456 -11 -> 12345
+ddshi036 shift 1234567890123456 -10 -> 123456
+ddshi037 shift 1234567890123456 -9 -> 1234567
+ddshi038 shift 1234567890123456 -8 -> 12345678
+ddshi039 shift 1234567890123456 -7 -> 123456789
+ddshi040 shift 1234567890123456 -6 -> 1234567890
+ddshi041 shift 1234567890123456 -5 -> 12345678901
+ddshi042 shift 1234567890123456 -4 -> 123456789012
+ddshi043 shift 1234567890123456 -3 -> 1234567890123
+ddshi044 shift 1234567890123456 -2 -> 12345678901234
+ddshi045 shift 1234567890123456 -1 -> 123456789012345
+ddshi046 shift 1234567890123456 -0 -> 1234567890123456
+
+ddshi047 shift 1234567890123456 +0 -> 1234567890123456
+ddshi048 shift 1234567890123456 +1 -> 2345678901234560
+ddshi049 shift 1234567890123456 +2 -> 3456789012345600
+ddshi050 shift 1234567890123456 +3 -> 4567890123456000
+ddshi051 shift 1234567890123456 +4 -> 5678901234560000
+ddshi052 shift 1234567890123456 +5 -> 6789012345600000
+ddshi053 shift 1234567890123456 +6 -> 7890123456000000
+ddshi054 shift 1234567890123456 +7 -> 8901234560000000
+ddshi055 shift 1234567890123456 +8 -> 9012345600000000
+ddshi056 shift 1234567890123456 +9 -> 123456000000000
+ddshi057 shift 1234567890123456 +10 -> 1234560000000000
+ddshi058 shift 1234567890123456 +11 -> 2345600000000000
+ddshi059 shift 1234567890123456 +12 -> 3456000000000000
+ddshi060 shift 1234567890123456 +13 -> 4560000000000000
+ddshi061 shift 1234567890123456 +14 -> 5600000000000000
+ddshi062 shift 1234567890123456 +15 -> 6000000000000000
+ddshi063 shift 1234567890123456 +16 -> 0
+
+-- zeros
+ddshi070 shift 0E-10 +9 -> 0E-10
+ddshi071 shift 0E-10 -9 -> 0E-10
+ddshi072 shift 0.000 +9 -> 0.000
+ddshi073 shift 0.000 -9 -> 0.000
+ddshi074 shift 0E+10 +9 -> 0E+10
+ddshi075 shift 0E+10 -9 -> 0E+10
+ddshi076 shift -0E-10 +9 -> -0E-10
+ddshi077 shift -0E-10 -9 -> -0E-10
+ddshi078 shift -0.000 +9 -> -0.000
+ddshi079 shift -0.000 -9 -> -0.000
+ddshi080 shift -0E+10 +9 -> -0E+10
+ddshi081 shift -0E+10 -9 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+ddshi141 shift 9.999999999999999E+384 -1 -> 9.99999999999999E+383
+ddshi142 shift 9.999999999999999E+384 -15 -> 9E+369
+ddshi143 shift 9.999999999999999E+384 1 -> 9.999999999999990E+384
+ddshi144 shift 9.999999999999999E+384 15 -> 9.000000000000000E+384
+ddshi145 shift 1E-383 -1 -> 0E-383
+ddshi146 shift 1E-383 -15 -> 0E-383
+ddshi147 shift 1E-383 1 -> 1.0E-382
+ddshi148 shift 1E-383 15 -> 1.000000000000000E-368
+ddshi151 shift 1.000000000000000E-383 -1 -> 1.00000000000000E-384
+ddshi152 shift 1.000000000000000E-383 -15 -> 1E-398
+ddshi153 shift 1.000000000000000E-383 1 -> 0E-398
+ddshi154 shift 1.000000000000000E-383 15 -> 0E-398
+ddshi155 shift 9.000000000000000E-383 -1 -> 9.00000000000000E-384
+ddshi156 shift 9.000000000000000E-383 -15 -> 9E-398
+ddshi157 shift 9.000000000000000E-383 1 -> 0E-398
+ddshi158 shift 9.000000000000000E-383 15 -> 0E-398
+ddshi160 shift 1E-398 -1 -> 0E-398
+ddshi161 shift 1E-398 -15 -> 0E-398
+ddshi162 shift 1E-398 1 -> 1.0E-397
+ddshi163 shift 1E-398 15 -> 1.000000000000000E-383
+-- negatives
+ddshi171 shift -9.999999999999999E+384 -1 -> -9.99999999999999E+383
+ddshi172 shift -9.999999999999999E+384 -15 -> -9E+369
+ddshi173 shift -9.999999999999999E+384 1 -> -9.999999999999990E+384
+ddshi174 shift -9.999999999999999E+384 15 -> -9.000000000000000E+384
+ddshi175 shift -1E-383 -1 -> -0E-383
+ddshi176 shift -1E-383 -15 -> -0E-383
+ddshi177 shift -1E-383 1 -> -1.0E-382
+ddshi178 shift -1E-383 15 -> -1.000000000000000E-368
+ddshi181 shift -1.000000000000000E-383 -1 -> -1.00000000000000E-384
+ddshi182 shift -1.000000000000000E-383 -15 -> -1E-398
+ddshi183 shift -1.000000000000000E-383 1 -> -0E-398
+ddshi184 shift -1.000000000000000E-383 15 -> -0E-398
+ddshi185 shift -9.000000000000000E-383 -1 -> -9.00000000000000E-384
+ddshi186 shift -9.000000000000000E-383 -15 -> -9E-398
+ddshi187 shift -9.000000000000000E-383 1 -> -0E-398
+ddshi188 shift -9.000000000000000E-383 15 -> -0E-398
+ddshi190 shift -1E-398 -1 -> -0E-398
+ddshi191 shift -1E-398 -15 -> -0E-398
+ddshi192 shift -1E-398 1 -> -1.0E-397
+ddshi193 shift -1E-398 15 -> -1.000000000000000E-383
+
+-- more negatives (of sanities)
+ddshi201 shift -0 0 -> -0
+ddshi202 shift -0 2 -> -0
+ddshi203 shift -1 2 -> -100
+ddshi204 shift -1 15 -> -1000000000000000
+ddshi205 shift -1 16 -> -0
+ddshi206 shift -1 -1 -> -0
+ddshi207 shift -0 -2 -> -0
+ddshi208 shift -1234567890123456 -1 -> -123456789012345
+ddshi209 shift -1234567890123456 -15 -> -1
+ddshi210 shift -1234567890123456 -16 -> -0
+ddshi211 shift -9934567890123456 -15 -> -9
+ddshi212 shift -9934567890123456 -16 -> -0
+
+
+-- Specials; NaNs are handled as usual
+ddshi781 shift -Inf -8 -> -Infinity
+ddshi782 shift -Inf -1 -> -Infinity
+ddshi783 shift -Inf -0 -> -Infinity
+ddshi784 shift -Inf 0 -> -Infinity
+ddshi785 shift -Inf 1 -> -Infinity
+ddshi786 shift -Inf 8 -> -Infinity
+ddshi787 shift -1000 -Inf -> NaN Invalid_operation
+ddshi788 shift -Inf -Inf -> NaN Invalid_operation
+ddshi789 shift -1 -Inf -> NaN Invalid_operation
+ddshi790 shift -0 -Inf -> NaN Invalid_operation
+ddshi791 shift 0 -Inf -> NaN Invalid_operation
+ddshi792 shift 1 -Inf -> NaN Invalid_operation
+ddshi793 shift 1000 -Inf -> NaN Invalid_operation
+ddshi794 shift Inf -Inf -> NaN Invalid_operation
+
+ddshi800 shift Inf -Inf -> NaN Invalid_operation
+ddshi801 shift Inf -8 -> Infinity
+ddshi802 shift Inf -1 -> Infinity
+ddshi803 shift Inf -0 -> Infinity
+ddshi804 shift Inf 0 -> Infinity
+ddshi805 shift Inf 1 -> Infinity
+ddshi806 shift Inf 8 -> Infinity
+ddshi807 shift Inf Inf -> NaN Invalid_operation
+ddshi808 shift -1000 Inf -> NaN Invalid_operation
+ddshi809 shift -Inf Inf -> NaN Invalid_operation
+ddshi810 shift -1 Inf -> NaN Invalid_operation
+ddshi811 shift -0 Inf -> NaN Invalid_operation
+ddshi812 shift 0 Inf -> NaN Invalid_operation
+ddshi813 shift 1 Inf -> NaN Invalid_operation
+ddshi814 shift 1000 Inf -> NaN Invalid_operation
+ddshi815 shift Inf Inf -> NaN Invalid_operation
+
+ddshi821 shift NaN -Inf -> NaN
+ddshi822 shift NaN -1000 -> NaN
+ddshi823 shift NaN -1 -> NaN
+ddshi824 shift NaN -0 -> NaN
+ddshi825 shift NaN 0 -> NaN
+ddshi826 shift NaN 1 -> NaN
+ddshi827 shift NaN 1000 -> NaN
+ddshi828 shift NaN Inf -> NaN
+ddshi829 shift NaN NaN -> NaN
+ddshi830 shift -Inf NaN -> NaN
+ddshi831 shift -1000 NaN -> NaN
+ddshi832 shift -1 NaN -> NaN
+ddshi833 shift -0 NaN -> NaN
+ddshi834 shift 0 NaN -> NaN
+ddshi835 shift 1 NaN -> NaN
+ddshi836 shift 1000 NaN -> NaN
+ddshi837 shift Inf NaN -> NaN
+
+ddshi841 shift sNaN -Inf -> NaN Invalid_operation
+ddshi842 shift sNaN -1000 -> NaN Invalid_operation
+ddshi843 shift sNaN -1 -> NaN Invalid_operation
+ddshi844 shift sNaN -0 -> NaN Invalid_operation
+ddshi845 shift sNaN 0 -> NaN Invalid_operation
+ddshi846 shift sNaN 1 -> NaN Invalid_operation
+ddshi847 shift sNaN 1000 -> NaN Invalid_operation
+ddshi848 shift sNaN NaN -> NaN Invalid_operation
+ddshi849 shift sNaN sNaN -> NaN Invalid_operation
+ddshi850 shift NaN sNaN -> NaN Invalid_operation
+ddshi851 shift -Inf sNaN -> NaN Invalid_operation
+ddshi852 shift -1000 sNaN -> NaN Invalid_operation
+ddshi853 shift -1 sNaN -> NaN Invalid_operation
+ddshi854 shift -0 sNaN -> NaN Invalid_operation
+ddshi855 shift 0 sNaN -> NaN Invalid_operation
+ddshi856 shift 1 sNaN -> NaN Invalid_operation
+ddshi857 shift 1000 sNaN -> NaN Invalid_operation
+ddshi858 shift Inf sNaN -> NaN Invalid_operation
+ddshi859 shift NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddshi861 shift NaN1 -Inf -> NaN1
+ddshi862 shift +NaN2 -1000 -> NaN2
+ddshi863 shift NaN3 1000 -> NaN3
+ddshi864 shift NaN4 Inf -> NaN4
+ddshi865 shift NaN5 +NaN6 -> NaN5
+ddshi866 shift -Inf NaN7 -> NaN7
+ddshi867 shift -1000 NaN8 -> NaN8
+ddshi868 shift 1000 NaN9 -> NaN9
+ddshi869 shift Inf +NaN10 -> NaN10
+ddshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation
+ddshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation
+ddshi873 shift sNaN13 1000 -> NaN13 Invalid_operation
+ddshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
+ddshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
+ddshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
+ddshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation
+ddshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation
+ddshi880 shift Inf sNaN23 -> NaN23 Invalid_operation
+ddshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddshi882 shift -NaN26 NaN28 -> -NaN26
+ddshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddshi884 shift 1000 -NaN30 -> -NaN30
+ddshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddSubtract.decTest b/Lib/test/decimaltestdata/ddSubtract.decTest
index 5ebc4878f0..15d47779eb 100644
--- a/Lib/test/decimaltestdata/ddSubtract.decTest
+++ b/Lib/test/decimaltestdata/ddSubtract.decTest
@@ -1,629 +1,629 @@
-------------------------------------------------------------------------
--- ddSubtract.decTest -- decDouble subtraction --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decDoubles only; all arguments are
--- representable in a decDouble
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- [first group are 'quick confidence check']
-ddsub001 subtract 0 0 -> '0'
-ddsub002 subtract 1 1 -> '0'
-ddsub003 subtract 1 2 -> '-1'
-ddsub004 subtract 2 1 -> '1'
-ddsub005 subtract 2 2 -> '0'
-ddsub006 subtract 3 2 -> '1'
-ddsub007 subtract 2 3 -> '-1'
-
-ddsub011 subtract -0 0 -> '-0'
-ddsub012 subtract -1 1 -> '-2'
-ddsub013 subtract -1 2 -> '-3'
-ddsub014 subtract -2 1 -> '-3'
-ddsub015 subtract -2 2 -> '-4'
-ddsub016 subtract -3 2 -> '-5'
-ddsub017 subtract -2 3 -> '-5'
-
-ddsub021 subtract 0 -0 -> '0'
-ddsub022 subtract 1 -1 -> '2'
-ddsub023 subtract 1 -2 -> '3'
-ddsub024 subtract 2 -1 -> '3'
-ddsub025 subtract 2 -2 -> '4'
-ddsub026 subtract 3 -2 -> '5'
-ddsub027 subtract 2 -3 -> '5'
-
-ddsub030 subtract 11 1 -> 10
-ddsub031 subtract 10 1 -> 9
-ddsub032 subtract 9 1 -> 8
-ddsub033 subtract 1 1 -> 0
-ddsub034 subtract 0 1 -> -1
-ddsub035 subtract -1 1 -> -2
-ddsub036 subtract -9 1 -> -10
-ddsub037 subtract -10 1 -> -11
-ddsub038 subtract -11 1 -> -12
-
-ddsub040 subtract '5.75' '3.3' -> '2.45'
-ddsub041 subtract '5' '-3' -> '8'
-ddsub042 subtract '-5' '-3' -> '-2'
-ddsub043 subtract '-7' '2.5' -> '-9.5'
-ddsub044 subtract '0.7' '0.3' -> '0.4'
-ddsub045 subtract '1.3' '0.3' -> '1.0'
-ddsub046 subtract '1.25' '1.25' -> '0.00'
-
-ddsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
-ddsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
-
-ddsub060 subtract '70' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
-ddsub061 subtract '700' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
-ddsub062 subtract '7000' '10000e+16' -> '-9.999999999999999E+19' Inexact Rounded
-ddsub063 subtract '70000' '10000e+16' -> '-9.999999999999993E+19' Rounded
-ddsub064 subtract '700000' '10000e+16' -> '-9.999999999999930E+19' Rounded
- -- symmetry:
-ddsub065 subtract '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
-ddsub066 subtract '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
-ddsub067 subtract '10000e+16' '7000' -> '9.999999999999999E+19' Inexact Rounded
-ddsub068 subtract '10000e+16' '70000' -> '9.999999999999993E+19' Rounded
-ddsub069 subtract '10000e+16' '700000' -> '9.999999999999930E+19' Rounded
-
- -- some of the next group are really constructor tests
-ddsub090 subtract '00.0' '0.0' -> '0.0'
-ddsub091 subtract '00.0' '0.00' -> '0.00'
-ddsub092 subtract '0.00' '00.0' -> '0.00'
-ddsub093 subtract '00.0' '0.00' -> '0.00'
-ddsub094 subtract '0.00' '00.0' -> '0.00'
-ddsub095 subtract '3' '.3' -> '2.7'
-ddsub096 subtract '3.' '.3' -> '2.7'
-ddsub097 subtract '3.0' '.3' -> '2.7'
-ddsub098 subtract '3.00' '.3' -> '2.70'
-ddsub099 subtract '3' '3' -> '0'
-ddsub100 subtract '3' '+3' -> '0'
-ddsub101 subtract '3' '-3' -> '6'
-ddsub102 subtract '3' '0.3' -> '2.7'
-ddsub103 subtract '3.' '0.3' -> '2.7'
-ddsub104 subtract '3.0' '0.3' -> '2.7'
-ddsub105 subtract '3.00' '0.3' -> '2.70'
-ddsub106 subtract '3' '3.0' -> '0.0'
-ddsub107 subtract '3' '+3.0' -> '0.0'
-ddsub108 subtract '3' '-3.0' -> '6.0'
-
--- the above all from add; massaged and extended. Now some new ones...
--- [particularly important for comparisons]
--- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
--- with input rounding.
-ddsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
-ddsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
-ddsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
-ddsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
-ddsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
-ddsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
-ddsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
-ddsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
-ddsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
-ddsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
-ddsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
-ddsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
-ddsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
-ddsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
-ddsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
-ddsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
-ddsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
-ddsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
-ddsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
-ddsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
-ddsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
-ddsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
-ddsub142 subtract '1' '0.999999999' -> '1E-9'
-ddsub143 subtract '0.999999999' '1' -> '-1E-9'
-ddsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
-ddsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
-ddsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
-
--- additional scaled arithmetic tests [0.97 problem]
-ddsub160 subtract '0' '.1' -> '-0.1'
-ddsub161 subtract '00' '.97983' -> '-0.97983'
-ddsub162 subtract '0' '.9' -> '-0.9'
-ddsub163 subtract '0' '0.102' -> '-0.102'
-ddsub164 subtract '0' '.4' -> '-0.4'
-ddsub165 subtract '0' '.307' -> '-0.307'
-ddsub166 subtract '0' '.43822' -> '-0.43822'
-ddsub167 subtract '0' '.911' -> '-0.911'
-ddsub168 subtract '.0' '.02' -> '-0.02'
-ddsub169 subtract '00' '.392' -> '-0.392'
-ddsub170 subtract '0' '.26' -> '-0.26'
-ddsub171 subtract '0' '0.51' -> '-0.51'
-ddsub172 subtract '0' '.2234' -> '-0.2234'
-ddsub173 subtract '0' '.2' -> '-0.2'
-ddsub174 subtract '.0' '.0008' -> '-0.0008'
--- 0. on left
-ddsub180 subtract '0.0' '-.1' -> '0.1'
-ddsub181 subtract '0.00' '-.97983' -> '0.97983'
-ddsub182 subtract '0.0' '-.9' -> '0.9'
-ddsub183 subtract '0.0' '-0.102' -> '0.102'
-ddsub184 subtract '0.0' '-.4' -> '0.4'
-ddsub185 subtract '0.0' '-.307' -> '0.307'
-ddsub186 subtract '0.0' '-.43822' -> '0.43822'
-ddsub187 subtract '0.0' '-.911' -> '0.911'
-ddsub188 subtract '0.0' '-.02' -> '0.02'
-ddsub189 subtract '0.00' '-.392' -> '0.392'
-ddsub190 subtract '0.0' '-.26' -> '0.26'
-ddsub191 subtract '0.0' '-0.51' -> '0.51'
-ddsub192 subtract '0.0' '-.2234' -> '0.2234'
-ddsub193 subtract '0.0' '-.2' -> '0.2'
-ddsub194 subtract '0.0' '-.0008' -> '0.0008'
--- negatives of same
-ddsub200 subtract '0' '-.1' -> '0.1'
-ddsub201 subtract '00' '-.97983' -> '0.97983'
-ddsub202 subtract '0' '-.9' -> '0.9'
-ddsub203 subtract '0' '-0.102' -> '0.102'
-ddsub204 subtract '0' '-.4' -> '0.4'
-ddsub205 subtract '0' '-.307' -> '0.307'
-ddsub206 subtract '0' '-.43822' -> '0.43822'
-ddsub207 subtract '0' '-.911' -> '0.911'
-ddsub208 subtract '.0' '-.02' -> '0.02'
-ddsub209 subtract '00' '-.392' -> '0.392'
-ddsub210 subtract '0' '-.26' -> '0.26'
-ddsub211 subtract '0' '-0.51' -> '0.51'
-ddsub212 subtract '0' '-.2234' -> '0.2234'
-ddsub213 subtract '0' '-.2' -> '0.2'
-ddsub214 subtract '.0' '-.0008' -> '0.0008'
-
--- more fixed, LHS swaps [really the same as testcases under add]
-ddsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
-ddsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
-ddsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
-ddsub223 subtract '-56267E-9' 0 -> '-0.000056267'
-ddsub224 subtract '-56267E-8' 0 -> '-0.00056267'
-ddsub225 subtract '-56267E-7' 0 -> '-0.0056267'
-ddsub226 subtract '-56267E-6' 0 -> '-0.056267'
-ddsub227 subtract '-56267E-5' 0 -> '-0.56267'
-ddsub228 subtract '-56267E-2' 0 -> '-562.67'
-ddsub229 subtract '-56267E-1' 0 -> '-5626.7'
-ddsub230 subtract '-56267E-0' 0 -> '-56267'
--- symmetry ...
-ddsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
-ddsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
-ddsub242 subtract 0 '-56267E-10' -> '0.0000056267'
-ddsub243 subtract 0 '-56267E-9' -> '0.000056267'
-ddsub244 subtract 0 '-56267E-8' -> '0.00056267'
-ddsub245 subtract 0 '-56267E-7' -> '0.0056267'
-ddsub246 subtract 0 '-56267E-6' -> '0.056267'
-ddsub247 subtract 0 '-56267E-5' -> '0.56267'
-ddsub248 subtract 0 '-56267E-2' -> '562.67'
-ddsub249 subtract 0 '-56267E-1' -> '5626.7'
-ddsub250 subtract 0 '-56267E-0' -> '56267'
-
--- now some more from the 'new' add
-ddsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
-ddsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
-
--- some carrying effects
-ddsub321 subtract '0.9998' '0.0000' -> '0.9998'
-ddsub322 subtract '0.9998' '0.0001' -> '0.9997'
-ddsub323 subtract '0.9998' '0.0002' -> '0.9996'
-ddsub324 subtract '0.9998' '0.0003' -> '0.9995'
-ddsub325 subtract '0.9998' '-0.0000' -> '0.9998'
-ddsub326 subtract '0.9998' '-0.0001' -> '0.9999'
-ddsub327 subtract '0.9998' '-0.0002' -> '1.0000'
-ddsub328 subtract '0.9998' '-0.0003' -> '1.0001'
-
--- internal boundaries
-ddsub346 subtract '10000e+9' '7' -> '9999999999993'
-ddsub347 subtract '10000e+9' '70' -> '9999999999930'
-ddsub348 subtract '10000e+9' '700' -> '9999999999300'
-ddsub349 subtract '10000e+9' '7000' -> '9999999993000'
-ddsub350 subtract '10000e+9' '70000' -> '9999999930000'
-ddsub351 subtract '10000e+9' '700000' -> '9999999300000'
-ddsub352 subtract '7' '10000e+9' -> '-9999999999993'
-ddsub353 subtract '70' '10000e+9' -> '-9999999999930'
-ddsub354 subtract '700' '10000e+9' -> '-9999999999300'
-ddsub355 subtract '7000' '10000e+9' -> '-9999999993000'
-ddsub356 subtract '70000' '10000e+9' -> '-9999999930000'
-ddsub357 subtract '700000' '10000e+9' -> '-9999999300000'
-
--- zero preservation
-ddsub361 subtract 1 '0.0001' -> '0.9999'
-ddsub362 subtract 1 '0.00001' -> '0.99999'
-ddsub363 subtract 1 '0.000001' -> '0.999999'
-ddsub364 subtract 1 '0.0000000000000001' -> '0.9999999999999999'
-ddsub365 subtract 1 '0.00000000000000001' -> '1.000000000000000' Inexact Rounded
-ddsub366 subtract 1 '0.000000000000000001' -> '1.000000000000000' Inexact Rounded
-
--- some funny zeros [in case of bad signum]
-ddsub370 subtract 1 0 -> 1
-ddsub371 subtract 1 0. -> 1
-ddsub372 subtract 1 .0 -> 1.0
-ddsub373 subtract 1 0.0 -> 1.0
-ddsub374 subtract 0 1 -> -1
-ddsub375 subtract 0. 1 -> -1
-ddsub376 subtract .0 1 -> -1.0
-ddsub377 subtract 0.0 1 -> -1.0
-
--- leading 0 digit before round
-ddsub910 subtract -103519362 -51897955.3 -> -51621406.7
-ddsub911 subtract 159579.444 89827.5229 -> 69751.9211
-
-ddsub920 subtract 333.0000000123456 33.00000001234566 -> 299.9999999999999 Inexact Rounded
-ddsub921 subtract 333.0000000123456 33.00000001234565 -> 300.0000000000000 Inexact Rounded
-ddsub922 subtract 133.0000000123456 33.00000001234565 -> 99.99999999999995
-ddsub923 subtract 133.0000000123456 33.00000001234564 -> 99.99999999999996
-ddsub924 subtract 133.0000000123456 33.00000001234540 -> 100.0000000000002 Rounded
-ddsub925 subtract 133.0000000123456 43.00000001234560 -> 90.00000000000000
-ddsub926 subtract 133.0000000123456 43.00000001234561 -> 89.99999999999999
-ddsub927 subtract 133.0000000123456 43.00000001234566 -> 89.99999999999994
-ddsub928 subtract 101.0000000123456 91.00000001234566 -> 9.99999999999994
-ddsub929 subtract 101.0000000123456 99.00000001234566 -> 1.99999999999994
-
--- more LHS swaps [were fixed]
-ddsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
-ddsub391 subtract '-56267E-6' 0 -> '-0.056267'
-ddsub392 subtract '-56267E-5' 0 -> '-0.56267'
-ddsub393 subtract '-56267E-4' 0 -> '-5.6267'
-ddsub394 subtract '-56267E-3' 0 -> '-56.267'
-ddsub395 subtract '-56267E-2' 0 -> '-562.67'
-ddsub396 subtract '-56267E-1' 0 -> '-5626.7'
-ddsub397 subtract '-56267E-0' 0 -> '-56267'
-ddsub398 subtract '-5E-10' 0 -> '-5E-10'
-ddsub399 subtract '-5E-7' 0 -> '-5E-7'
-ddsub400 subtract '-5E-6' 0 -> '-0.000005'
-ddsub401 subtract '-5E-5' 0 -> '-0.00005'
-ddsub402 subtract '-5E-4' 0 -> '-0.0005'
-ddsub403 subtract '-5E-1' 0 -> '-0.5'
-ddsub404 subtract '-5E0' 0 -> '-5'
-ddsub405 subtract '-5E1' 0 -> '-50'
-ddsub406 subtract '-5E5' 0 -> '-500000'
-ddsub407 subtract '-5E15' 0 -> '-5000000000000000'
-ddsub408 subtract '-5E16' 0 -> '-5.000000000000000E+16' Rounded
-ddsub409 subtract '-5E17' 0 -> '-5.000000000000000E+17' Rounded
-ddsub410 subtract '-5E18' 0 -> '-5.000000000000000E+18' Rounded
-ddsub411 subtract '-5E100' 0 -> '-5.000000000000000E+100' Rounded
-
--- more RHS swaps [were fixed]
-ddsub420 subtract 0 '-56267E-10' -> '0.0000056267'
-ddsub421 subtract 0 '-56267E-6' -> '0.056267'
-ddsub422 subtract 0 '-56267E-5' -> '0.56267'
-ddsub423 subtract 0 '-56267E-4' -> '5.6267'
-ddsub424 subtract 0 '-56267E-3' -> '56.267'
-ddsub425 subtract 0 '-56267E-2' -> '562.67'
-ddsub426 subtract 0 '-56267E-1' -> '5626.7'
-ddsub427 subtract 0 '-56267E-0' -> '56267'
-ddsub428 subtract 0 '-5E-10' -> '5E-10'
-ddsub429 subtract 0 '-5E-7' -> '5E-7'
-ddsub430 subtract 0 '-5E-6' -> '0.000005'
-ddsub431 subtract 0 '-5E-5' -> '0.00005'
-ddsub432 subtract 0 '-5E-4' -> '0.0005'
-ddsub433 subtract 0 '-5E-1' -> '0.5'
-ddsub434 subtract 0 '-5E0' -> '5'
-ddsub435 subtract 0 '-5E1' -> '50'
-ddsub436 subtract 0 '-5E5' -> '500000'
-ddsub437 subtract 0 '-5E15' -> '5000000000000000'
-ddsub438 subtract 0 '-5E16' -> '5.000000000000000E+16' Rounded
-ddsub439 subtract 0 '-5E17' -> '5.000000000000000E+17' Rounded
-ddsub440 subtract 0 '-5E18' -> '5.000000000000000E+18' Rounded
-ddsub441 subtract 0 '-5E100' -> '5.000000000000000E+100' Rounded
-
-
--- try borderline precision, with carries, etc.
-ddsub461 subtract '1E+16' '1' -> '9999999999999999'
-ddsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
-ddsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
-ddsub464 subtract '-1' '-1E+16' -> '9999999999999999'
-ddsub465 subtract '7E+15' '1' -> '6999999999999999'
-ddsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
-ddsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
-ddsub468 subtract '-1' '-7E+15' -> '6999999999999999'
-
--- 1234567890123456 1234567890123456 1 23456789012345
-ddsub470 subtract '0.4444444444444444' '-0.5555555555555563' -> '1.000000000000001' Inexact Rounded
-ddsub471 subtract '0.4444444444444444' '-0.5555555555555562' -> '1.000000000000001' Inexact Rounded
-ddsub472 subtract '0.4444444444444444' '-0.5555555555555561' -> '1.000000000000000' Inexact Rounded
-ddsub473 subtract '0.4444444444444444' '-0.5555555555555560' -> '1.000000000000000' Inexact Rounded
-ddsub474 subtract '0.4444444444444444' '-0.5555555555555559' -> '1.000000000000000' Inexact Rounded
-ddsub475 subtract '0.4444444444444444' '-0.5555555555555558' -> '1.000000000000000' Inexact Rounded
-ddsub476 subtract '0.4444444444444444' '-0.5555555555555557' -> '1.000000000000000' Inexact Rounded
-ddsub477 subtract '0.4444444444444444' '-0.5555555555555556' -> '1.000000000000000' Rounded
-ddsub478 subtract '0.4444444444444444' '-0.5555555555555555' -> '0.9999999999999999'
-ddsub479 subtract '0.4444444444444444' '-0.5555555555555554' -> '0.9999999999999998'
-ddsub480 subtract '0.4444444444444444' '-0.5555555555555553' -> '0.9999999999999997'
-ddsub481 subtract '0.4444444444444444' '-0.5555555555555552' -> '0.9999999999999996'
-ddsub482 subtract '0.4444444444444444' '-0.5555555555555551' -> '0.9999999999999995'
-ddsub483 subtract '0.4444444444444444' '-0.5555555555555550' -> '0.9999999999999994'
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-ddsub500 subtract '1231234567456789' 0 -> '1231234567456789'
-ddsub501 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
-ddsub502 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
-ddsub503 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
-ddsub504 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
-ddsub505 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
-ddsub506 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
-ddsub507 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
-ddsub508 subtract '1231234567456789' 0.5 -> '1231234567456789' Inexact Rounded
-ddsub509 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
-ddsub510 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
-ddsub511 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
-ddsub512 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
-ddsub513 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
-ddsub514 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
-ddsub515 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
-ddsub516 subtract '1231234567456789' 1 -> '1231234567456788'
-ddsub517 subtract '1231234567456789' 1.000000001 -> '1231234567456788' Inexact Rounded
-ddsub518 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
-ddsub519 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
-
-rounding: half_even
-ddsub520 subtract '1231234567456789' 0 -> '1231234567456789'
-ddsub521 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
-ddsub522 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
-ddsub523 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
-ddsub524 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
-ddsub525 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
-ddsub526 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
-ddsub527 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
-ddsub528 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
-ddsub529 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
-ddsub530 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
-ddsub531 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
-ddsub532 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
-ddsub533 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
-ddsub534 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
-ddsub535 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
-ddsub536 subtract '1231234567456789' 1 -> '1231234567456788'
-ddsub537 subtract '1231234567456789' 1.00000001 -> '1231234567456788' Inexact Rounded
-ddsub538 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
-ddsub539 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
--- critical few with even bottom digit...
-ddsub540 subtract '1231234567456788' 0.499999999 -> '1231234567456788' Inexact Rounded
-ddsub541 subtract '1231234567456788' 0.5 -> '1231234567456788' Inexact Rounded
-ddsub542 subtract '1231234567456788' 0.500000001 -> '1231234567456787' Inexact Rounded
-
-rounding: down
-ddsub550 subtract '1231234567456789' 0 -> '1231234567456789'
-ddsub551 subtract '1231234567456789' 0.000000001 -> '1231234567456788' Inexact Rounded
-ddsub552 subtract '1231234567456789' 0.000001 -> '1231234567456788' Inexact Rounded
-ddsub553 subtract '1231234567456789' 0.1 -> '1231234567456788' Inexact Rounded
-ddsub554 subtract '1231234567456789' 0.4 -> '1231234567456788' Inexact Rounded
-ddsub555 subtract '1231234567456789' 0.49 -> '1231234567456788' Inexact Rounded
-ddsub556 subtract '1231234567456789' 0.499999 -> '1231234567456788' Inexact Rounded
-ddsub557 subtract '1231234567456789' 0.499999999 -> '1231234567456788' Inexact Rounded
-ddsub558 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
-ddsub559 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
-ddsub560 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
-ddsub561 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
-ddsub562 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
-ddsub563 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
-ddsub564 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
-ddsub565 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
-ddsub566 subtract '1231234567456789' 1 -> '1231234567456788'
-ddsub567 subtract '1231234567456789' 1.00000001 -> '1231234567456787' Inexact Rounded
-ddsub568 subtract '1231234567456789' 1.00001 -> '1231234567456787' Inexact Rounded
-ddsub569 subtract '1231234567456789' 1.1 -> '1231234567456787' Inexact Rounded
-
--- symmetry...
-rounding: half_up
-ddsub600 subtract 0 '1231234567456789' -> '-1231234567456789'
-ddsub601 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub602 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub603 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub604 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub605 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub606 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub607 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub608 subtract 0.5 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub609 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub610 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub611 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub612 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub613 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub614 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub615 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub616 subtract 1 '1231234567456789' -> '-1231234567456788'
-ddsub617 subtract 1.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub618 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub619 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-
-rounding: half_even
-ddsub620 subtract 0 '1231234567456789' -> '-1231234567456789'
-ddsub621 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub622 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub623 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub624 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub625 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub626 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub627 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub628 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub629 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub630 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub631 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub632 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub633 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub634 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub635 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub636 subtract 1 '1231234567456789' -> '-1231234567456788'
-ddsub637 subtract 1.00000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub638 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub639 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
--- critical few with even bottom digit...
-ddsub640 subtract 0.499999999 '1231234567456788' -> '-1231234567456788' Inexact Rounded
-ddsub641 subtract 0.5 '1231234567456788' -> '-1231234567456788' Inexact Rounded
-ddsub642 subtract 0.500000001 '1231234567456788' -> '-1231234567456787' Inexact Rounded
-
-rounding: down
-ddsub650 subtract 0 '1231234567456789' -> '-1231234567456789'
-ddsub651 subtract 0.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub652 subtract 0.000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub653 subtract 0.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub654 subtract 0.4 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub655 subtract 0.49 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub656 subtract 0.499999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub657 subtract 0.499999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub658 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub659 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub660 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub661 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub662 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub663 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub664 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub665 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub666 subtract 1 '1231234567456789' -> '-1231234567456788'
-ddsub667 subtract 1.00000001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
-ddsub668 subtract 1.00001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
-ddsub669 subtract 1.1 '1231234567456789' -> '-1231234567456787' Inexact Rounded
-
-
--- lots of leading zeros in intermediate result, and showing effects of
--- input rounding would have affected the following
-rounding: half_up
-ddsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
-ddsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
-ddsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
-ddsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
-ddsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
-
-rounding: half_even
-ddsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
-ddsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
-ddsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
-ddsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
-ddsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
-
-ddsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
-ddsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
-ddsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
-ddsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
-ddsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
-
-rounding: down
-ddsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
-ddsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
-ddsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
-ddsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
-ddsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
-
--- Specials
-ddsub780 subtract -Inf Inf -> -Infinity
-ddsub781 subtract -Inf 1000 -> -Infinity
-ddsub782 subtract -Inf 1 -> -Infinity
-ddsub783 subtract -Inf -0 -> -Infinity
-ddsub784 subtract -Inf -1 -> -Infinity
-ddsub785 subtract -Inf -1000 -> -Infinity
-ddsub787 subtract -1000 Inf -> -Infinity
-ddsub788 subtract -Inf Inf -> -Infinity
-ddsub789 subtract -1 Inf -> -Infinity
-ddsub790 subtract 0 Inf -> -Infinity
-ddsub791 subtract 1 Inf -> -Infinity
-ddsub792 subtract 1000 Inf -> -Infinity
-
-ddsub800 subtract Inf Inf -> NaN Invalid_operation
-ddsub801 subtract Inf 1000 -> Infinity
-ddsub802 subtract Inf 1 -> Infinity
-ddsub803 subtract Inf 0 -> Infinity
-ddsub804 subtract Inf -0 -> Infinity
-ddsub805 subtract Inf -1 -> Infinity
-ddsub806 subtract Inf -1000 -> Infinity
-ddsub807 subtract Inf -Inf -> Infinity
-ddsub808 subtract -1000 -Inf -> Infinity
-ddsub809 subtract -Inf -Inf -> NaN Invalid_operation
-ddsub810 subtract -1 -Inf -> Infinity
-ddsub811 subtract -0 -Inf -> Infinity
-ddsub812 subtract 0 -Inf -> Infinity
-ddsub813 subtract 1 -Inf -> Infinity
-ddsub814 subtract 1000 -Inf -> Infinity
-ddsub815 subtract Inf -Inf -> Infinity
-
-ddsub821 subtract NaN Inf -> NaN
-ddsub822 subtract -NaN 1000 -> -NaN
-ddsub823 subtract NaN 1 -> NaN
-ddsub824 subtract NaN 0 -> NaN
-ddsub825 subtract NaN -0 -> NaN
-ddsub826 subtract NaN -1 -> NaN
-ddsub827 subtract NaN -1000 -> NaN
-ddsub828 subtract NaN -Inf -> NaN
-ddsub829 subtract -NaN NaN -> -NaN
-ddsub830 subtract -Inf NaN -> NaN
-ddsub831 subtract -1000 NaN -> NaN
-ddsub832 subtract -1 NaN -> NaN
-ddsub833 subtract -0 NaN -> NaN
-ddsub834 subtract 0 NaN -> NaN
-ddsub835 subtract 1 NaN -> NaN
-ddsub836 subtract 1000 -NaN -> -NaN
-ddsub837 subtract Inf NaN -> NaN
-
-ddsub841 subtract sNaN Inf -> NaN Invalid_operation
-ddsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
-ddsub843 subtract sNaN 1 -> NaN Invalid_operation
-ddsub844 subtract sNaN 0 -> NaN Invalid_operation
-ddsub845 subtract sNaN -0 -> NaN Invalid_operation
-ddsub846 subtract sNaN -1 -> NaN Invalid_operation
-ddsub847 subtract sNaN -1000 -> NaN Invalid_operation
-ddsub848 subtract sNaN NaN -> NaN Invalid_operation
-ddsub849 subtract sNaN sNaN -> NaN Invalid_operation
-ddsub850 subtract NaN sNaN -> NaN Invalid_operation
-ddsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
-ddsub852 subtract -1000 sNaN -> NaN Invalid_operation
-ddsub853 subtract -1 sNaN -> NaN Invalid_operation
-ddsub854 subtract -0 sNaN -> NaN Invalid_operation
-ddsub855 subtract 0 sNaN -> NaN Invalid_operation
-ddsub856 subtract 1 sNaN -> NaN Invalid_operation
-ddsub857 subtract 1000 sNaN -> NaN Invalid_operation
-ddsub858 subtract Inf sNaN -> NaN Invalid_operation
-ddsub859 subtract NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddsub861 subtract NaN01 -Inf -> NaN1
-ddsub862 subtract -NaN02 -1000 -> -NaN2
-ddsub863 subtract NaN03 1000 -> NaN3
-ddsub864 subtract NaN04 Inf -> NaN4
-ddsub865 subtract NaN05 NaN61 -> NaN5
-ddsub866 subtract -Inf -NaN71 -> -NaN71
-ddsub867 subtract -1000 NaN81 -> NaN81
-ddsub868 subtract 1000 NaN91 -> NaN91
-ddsub869 subtract Inf NaN101 -> NaN101
-ddsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
-ddsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
-ddsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
-ddsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
-ddsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
-ddsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
-ddsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
-ddsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
-ddsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
-ddsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
-ddsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- edge case spills
-ddsub901 subtract 2.E-3 1.002 -> -1.000
-ddsub902 subtract 2.0E-3 1.002 -> -1.0000
-ddsub903 subtract 2.00E-3 1.0020 -> -1.00000
-ddsub904 subtract 2.000E-3 1.00200 -> -1.000000
-ddsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
-ddsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
-ddsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
-ddsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
-
--- subnormals and overflows covered under Add
-
--- Null tests
-ddsub9990 subtract 10 # -> NaN Invalid_operation
-ddsub9991 subtract # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddSubtract.decTest -- decDouble subtraction --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decDoubles only; all arguments are
+-- representable in a decDouble
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+ddsub001 subtract 0 0 -> '0'
+ddsub002 subtract 1 1 -> '0'
+ddsub003 subtract 1 2 -> '-1'
+ddsub004 subtract 2 1 -> '1'
+ddsub005 subtract 2 2 -> '0'
+ddsub006 subtract 3 2 -> '1'
+ddsub007 subtract 2 3 -> '-1'
+
+ddsub011 subtract -0 0 -> '-0'
+ddsub012 subtract -1 1 -> '-2'
+ddsub013 subtract -1 2 -> '-3'
+ddsub014 subtract -2 1 -> '-3'
+ddsub015 subtract -2 2 -> '-4'
+ddsub016 subtract -3 2 -> '-5'
+ddsub017 subtract -2 3 -> '-5'
+
+ddsub021 subtract 0 -0 -> '0'
+ddsub022 subtract 1 -1 -> '2'
+ddsub023 subtract 1 -2 -> '3'
+ddsub024 subtract 2 -1 -> '3'
+ddsub025 subtract 2 -2 -> '4'
+ddsub026 subtract 3 -2 -> '5'
+ddsub027 subtract 2 -3 -> '5'
+
+ddsub030 subtract 11 1 -> 10
+ddsub031 subtract 10 1 -> 9
+ddsub032 subtract 9 1 -> 8
+ddsub033 subtract 1 1 -> 0
+ddsub034 subtract 0 1 -> -1
+ddsub035 subtract -1 1 -> -2
+ddsub036 subtract -9 1 -> -10
+ddsub037 subtract -10 1 -> -11
+ddsub038 subtract -11 1 -> -12
+
+ddsub040 subtract '5.75' '3.3' -> '2.45'
+ddsub041 subtract '5' '-3' -> '8'
+ddsub042 subtract '-5' '-3' -> '-2'
+ddsub043 subtract '-7' '2.5' -> '-9.5'
+ddsub044 subtract '0.7' '0.3' -> '0.4'
+ddsub045 subtract '1.3' '0.3' -> '1.0'
+ddsub046 subtract '1.25' '1.25' -> '0.00'
+
+ddsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
+ddsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
+
+ddsub060 subtract '70' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
+ddsub061 subtract '700' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
+ddsub062 subtract '7000' '10000e+16' -> '-9.999999999999999E+19' Inexact Rounded
+ddsub063 subtract '70000' '10000e+16' -> '-9.999999999999993E+19' Rounded
+ddsub064 subtract '700000' '10000e+16' -> '-9.999999999999930E+19' Rounded
+ -- symmetry:
+ddsub065 subtract '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
+ddsub066 subtract '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
+ddsub067 subtract '10000e+16' '7000' -> '9.999999999999999E+19' Inexact Rounded
+ddsub068 subtract '10000e+16' '70000' -> '9.999999999999993E+19' Rounded
+ddsub069 subtract '10000e+16' '700000' -> '9.999999999999930E+19' Rounded
+
+ -- some of the next group are really constructor tests
+ddsub090 subtract '00.0' '0.0' -> '0.0'
+ddsub091 subtract '00.0' '0.00' -> '0.00'
+ddsub092 subtract '0.00' '00.0' -> '0.00'
+ddsub093 subtract '00.0' '0.00' -> '0.00'
+ddsub094 subtract '0.00' '00.0' -> '0.00'
+ddsub095 subtract '3' '.3' -> '2.7'
+ddsub096 subtract '3.' '.3' -> '2.7'
+ddsub097 subtract '3.0' '.3' -> '2.7'
+ddsub098 subtract '3.00' '.3' -> '2.70'
+ddsub099 subtract '3' '3' -> '0'
+ddsub100 subtract '3' '+3' -> '0'
+ddsub101 subtract '3' '-3' -> '6'
+ddsub102 subtract '3' '0.3' -> '2.7'
+ddsub103 subtract '3.' '0.3' -> '2.7'
+ddsub104 subtract '3.0' '0.3' -> '2.7'
+ddsub105 subtract '3.00' '0.3' -> '2.70'
+ddsub106 subtract '3' '3.0' -> '0.0'
+ddsub107 subtract '3' '+3.0' -> '0.0'
+ddsub108 subtract '3' '-3.0' -> '6.0'
+
+-- the above all from add; massaged and extended. Now some new ones...
+-- [particularly important for comparisons]
+-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
+-- with input rounding.
+ddsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
+ddsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
+ddsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
+ddsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
+ddsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
+ddsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
+ddsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
+ddsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
+ddsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
+ddsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
+ddsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
+ddsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
+ddsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
+ddsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
+ddsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
+ddsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
+ddsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
+ddsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
+ddsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
+ddsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
+ddsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
+ddsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
+ddsub142 subtract '1' '0.999999999' -> '1E-9'
+ddsub143 subtract '0.999999999' '1' -> '-1E-9'
+ddsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
+ddsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
+ddsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
+
+-- additional scaled arithmetic tests [0.97 problem]
+ddsub160 subtract '0' '.1' -> '-0.1'
+ddsub161 subtract '00' '.97983' -> '-0.97983'
+ddsub162 subtract '0' '.9' -> '-0.9'
+ddsub163 subtract '0' '0.102' -> '-0.102'
+ddsub164 subtract '0' '.4' -> '-0.4'
+ddsub165 subtract '0' '.307' -> '-0.307'
+ddsub166 subtract '0' '.43822' -> '-0.43822'
+ddsub167 subtract '0' '.911' -> '-0.911'
+ddsub168 subtract '.0' '.02' -> '-0.02'
+ddsub169 subtract '00' '.392' -> '-0.392'
+ddsub170 subtract '0' '.26' -> '-0.26'
+ddsub171 subtract '0' '0.51' -> '-0.51'
+ddsub172 subtract '0' '.2234' -> '-0.2234'
+ddsub173 subtract '0' '.2' -> '-0.2'
+ddsub174 subtract '.0' '.0008' -> '-0.0008'
+-- 0. on left
+ddsub180 subtract '0.0' '-.1' -> '0.1'
+ddsub181 subtract '0.00' '-.97983' -> '0.97983'
+ddsub182 subtract '0.0' '-.9' -> '0.9'
+ddsub183 subtract '0.0' '-0.102' -> '0.102'
+ddsub184 subtract '0.0' '-.4' -> '0.4'
+ddsub185 subtract '0.0' '-.307' -> '0.307'
+ddsub186 subtract '0.0' '-.43822' -> '0.43822'
+ddsub187 subtract '0.0' '-.911' -> '0.911'
+ddsub188 subtract '0.0' '-.02' -> '0.02'
+ddsub189 subtract '0.00' '-.392' -> '0.392'
+ddsub190 subtract '0.0' '-.26' -> '0.26'
+ddsub191 subtract '0.0' '-0.51' -> '0.51'
+ddsub192 subtract '0.0' '-.2234' -> '0.2234'
+ddsub193 subtract '0.0' '-.2' -> '0.2'
+ddsub194 subtract '0.0' '-.0008' -> '0.0008'
+-- negatives of same
+ddsub200 subtract '0' '-.1' -> '0.1'
+ddsub201 subtract '00' '-.97983' -> '0.97983'
+ddsub202 subtract '0' '-.9' -> '0.9'
+ddsub203 subtract '0' '-0.102' -> '0.102'
+ddsub204 subtract '0' '-.4' -> '0.4'
+ddsub205 subtract '0' '-.307' -> '0.307'
+ddsub206 subtract '0' '-.43822' -> '0.43822'
+ddsub207 subtract '0' '-.911' -> '0.911'
+ddsub208 subtract '.0' '-.02' -> '0.02'
+ddsub209 subtract '00' '-.392' -> '0.392'
+ddsub210 subtract '0' '-.26' -> '0.26'
+ddsub211 subtract '0' '-0.51' -> '0.51'
+ddsub212 subtract '0' '-.2234' -> '0.2234'
+ddsub213 subtract '0' '-.2' -> '0.2'
+ddsub214 subtract '.0' '-.0008' -> '0.0008'
+
+-- more fixed, LHS swaps [really the same as testcases under add]
+ddsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
+ddsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
+ddsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
+ddsub223 subtract '-56267E-9' 0 -> '-0.000056267'
+ddsub224 subtract '-56267E-8' 0 -> '-0.00056267'
+ddsub225 subtract '-56267E-7' 0 -> '-0.0056267'
+ddsub226 subtract '-56267E-6' 0 -> '-0.056267'
+ddsub227 subtract '-56267E-5' 0 -> '-0.56267'
+ddsub228 subtract '-56267E-2' 0 -> '-562.67'
+ddsub229 subtract '-56267E-1' 0 -> '-5626.7'
+ddsub230 subtract '-56267E-0' 0 -> '-56267'
+-- symmetry ...
+ddsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
+ddsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
+ddsub242 subtract 0 '-56267E-10' -> '0.0000056267'
+ddsub243 subtract 0 '-56267E-9' -> '0.000056267'
+ddsub244 subtract 0 '-56267E-8' -> '0.00056267'
+ddsub245 subtract 0 '-56267E-7' -> '0.0056267'
+ddsub246 subtract 0 '-56267E-6' -> '0.056267'
+ddsub247 subtract 0 '-56267E-5' -> '0.56267'
+ddsub248 subtract 0 '-56267E-2' -> '562.67'
+ddsub249 subtract 0 '-56267E-1' -> '5626.7'
+ddsub250 subtract 0 '-56267E-0' -> '56267'
+
+-- now some more from the 'new' add
+ddsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
+ddsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
+
+-- some carrying effects
+ddsub321 subtract '0.9998' '0.0000' -> '0.9998'
+ddsub322 subtract '0.9998' '0.0001' -> '0.9997'
+ddsub323 subtract '0.9998' '0.0002' -> '0.9996'
+ddsub324 subtract '0.9998' '0.0003' -> '0.9995'
+ddsub325 subtract '0.9998' '-0.0000' -> '0.9998'
+ddsub326 subtract '0.9998' '-0.0001' -> '0.9999'
+ddsub327 subtract '0.9998' '-0.0002' -> '1.0000'
+ddsub328 subtract '0.9998' '-0.0003' -> '1.0001'
+
+-- internal boundaries
+ddsub346 subtract '10000e+9' '7' -> '9999999999993'
+ddsub347 subtract '10000e+9' '70' -> '9999999999930'
+ddsub348 subtract '10000e+9' '700' -> '9999999999300'
+ddsub349 subtract '10000e+9' '7000' -> '9999999993000'
+ddsub350 subtract '10000e+9' '70000' -> '9999999930000'
+ddsub351 subtract '10000e+9' '700000' -> '9999999300000'
+ddsub352 subtract '7' '10000e+9' -> '-9999999999993'
+ddsub353 subtract '70' '10000e+9' -> '-9999999999930'
+ddsub354 subtract '700' '10000e+9' -> '-9999999999300'
+ddsub355 subtract '7000' '10000e+9' -> '-9999999993000'
+ddsub356 subtract '70000' '10000e+9' -> '-9999999930000'
+ddsub357 subtract '700000' '10000e+9' -> '-9999999300000'
+
+-- zero preservation
+ddsub361 subtract 1 '0.0001' -> '0.9999'
+ddsub362 subtract 1 '0.00001' -> '0.99999'
+ddsub363 subtract 1 '0.000001' -> '0.999999'
+ddsub364 subtract 1 '0.0000000000000001' -> '0.9999999999999999'
+ddsub365 subtract 1 '0.00000000000000001' -> '1.000000000000000' Inexact Rounded
+ddsub366 subtract 1 '0.000000000000000001' -> '1.000000000000000' Inexact Rounded
+
+-- some funny zeros [in case of bad signum]
+ddsub370 subtract 1 0 -> 1
+ddsub371 subtract 1 0. -> 1
+ddsub372 subtract 1 .0 -> 1.0
+ddsub373 subtract 1 0.0 -> 1.0
+ddsub374 subtract 0 1 -> -1
+ddsub375 subtract 0. 1 -> -1
+ddsub376 subtract .0 1 -> -1.0
+ddsub377 subtract 0.0 1 -> -1.0
+
+-- leading 0 digit before round
+ddsub910 subtract -103519362 -51897955.3 -> -51621406.7
+ddsub911 subtract 159579.444 89827.5229 -> 69751.9211
+
+ddsub920 subtract 333.0000000123456 33.00000001234566 -> 299.9999999999999 Inexact Rounded
+ddsub921 subtract 333.0000000123456 33.00000001234565 -> 300.0000000000000 Inexact Rounded
+ddsub922 subtract 133.0000000123456 33.00000001234565 -> 99.99999999999995
+ddsub923 subtract 133.0000000123456 33.00000001234564 -> 99.99999999999996
+ddsub924 subtract 133.0000000123456 33.00000001234540 -> 100.0000000000002 Rounded
+ddsub925 subtract 133.0000000123456 43.00000001234560 -> 90.00000000000000
+ddsub926 subtract 133.0000000123456 43.00000001234561 -> 89.99999999999999
+ddsub927 subtract 133.0000000123456 43.00000001234566 -> 89.99999999999994
+ddsub928 subtract 101.0000000123456 91.00000001234566 -> 9.99999999999994
+ddsub929 subtract 101.0000000123456 99.00000001234566 -> 1.99999999999994
+
+-- more LHS swaps [were fixed]
+ddsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
+ddsub391 subtract '-56267E-6' 0 -> '-0.056267'
+ddsub392 subtract '-56267E-5' 0 -> '-0.56267'
+ddsub393 subtract '-56267E-4' 0 -> '-5.6267'
+ddsub394 subtract '-56267E-3' 0 -> '-56.267'
+ddsub395 subtract '-56267E-2' 0 -> '-562.67'
+ddsub396 subtract '-56267E-1' 0 -> '-5626.7'
+ddsub397 subtract '-56267E-0' 0 -> '-56267'
+ddsub398 subtract '-5E-10' 0 -> '-5E-10'
+ddsub399 subtract '-5E-7' 0 -> '-5E-7'
+ddsub400 subtract '-5E-6' 0 -> '-0.000005'
+ddsub401 subtract '-5E-5' 0 -> '-0.00005'
+ddsub402 subtract '-5E-4' 0 -> '-0.0005'
+ddsub403 subtract '-5E-1' 0 -> '-0.5'
+ddsub404 subtract '-5E0' 0 -> '-5'
+ddsub405 subtract '-5E1' 0 -> '-50'
+ddsub406 subtract '-5E5' 0 -> '-500000'
+ddsub407 subtract '-5E15' 0 -> '-5000000000000000'
+ddsub408 subtract '-5E16' 0 -> '-5.000000000000000E+16' Rounded
+ddsub409 subtract '-5E17' 0 -> '-5.000000000000000E+17' Rounded
+ddsub410 subtract '-5E18' 0 -> '-5.000000000000000E+18' Rounded
+ddsub411 subtract '-5E100' 0 -> '-5.000000000000000E+100' Rounded
+
+-- more RHS swaps [were fixed]
+ddsub420 subtract 0 '-56267E-10' -> '0.0000056267'
+ddsub421 subtract 0 '-56267E-6' -> '0.056267'
+ddsub422 subtract 0 '-56267E-5' -> '0.56267'
+ddsub423 subtract 0 '-56267E-4' -> '5.6267'
+ddsub424 subtract 0 '-56267E-3' -> '56.267'
+ddsub425 subtract 0 '-56267E-2' -> '562.67'
+ddsub426 subtract 0 '-56267E-1' -> '5626.7'
+ddsub427 subtract 0 '-56267E-0' -> '56267'
+ddsub428 subtract 0 '-5E-10' -> '5E-10'
+ddsub429 subtract 0 '-5E-7' -> '5E-7'
+ddsub430 subtract 0 '-5E-6' -> '0.000005'
+ddsub431 subtract 0 '-5E-5' -> '0.00005'
+ddsub432 subtract 0 '-5E-4' -> '0.0005'
+ddsub433 subtract 0 '-5E-1' -> '0.5'
+ddsub434 subtract 0 '-5E0' -> '5'
+ddsub435 subtract 0 '-5E1' -> '50'
+ddsub436 subtract 0 '-5E5' -> '500000'
+ddsub437 subtract 0 '-5E15' -> '5000000000000000'
+ddsub438 subtract 0 '-5E16' -> '5.000000000000000E+16' Rounded
+ddsub439 subtract 0 '-5E17' -> '5.000000000000000E+17' Rounded
+ddsub440 subtract 0 '-5E18' -> '5.000000000000000E+18' Rounded
+ddsub441 subtract 0 '-5E100' -> '5.000000000000000E+100' Rounded
+
+
+-- try borderline precision, with carries, etc.
+ddsub461 subtract '1E+16' '1' -> '9999999999999999'
+ddsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
+ddsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
+ddsub464 subtract '-1' '-1E+16' -> '9999999999999999'
+ddsub465 subtract '7E+15' '1' -> '6999999999999999'
+ddsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
+ddsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
+ddsub468 subtract '-1' '-7E+15' -> '6999999999999999'
+
+-- 1234567890123456 1234567890123456 1 23456789012345
+ddsub470 subtract '0.4444444444444444' '-0.5555555555555563' -> '1.000000000000001' Inexact Rounded
+ddsub471 subtract '0.4444444444444444' '-0.5555555555555562' -> '1.000000000000001' Inexact Rounded
+ddsub472 subtract '0.4444444444444444' '-0.5555555555555561' -> '1.000000000000000' Inexact Rounded
+ddsub473 subtract '0.4444444444444444' '-0.5555555555555560' -> '1.000000000000000' Inexact Rounded
+ddsub474 subtract '0.4444444444444444' '-0.5555555555555559' -> '1.000000000000000' Inexact Rounded
+ddsub475 subtract '0.4444444444444444' '-0.5555555555555558' -> '1.000000000000000' Inexact Rounded
+ddsub476 subtract '0.4444444444444444' '-0.5555555555555557' -> '1.000000000000000' Inexact Rounded
+ddsub477 subtract '0.4444444444444444' '-0.5555555555555556' -> '1.000000000000000' Rounded
+ddsub478 subtract '0.4444444444444444' '-0.5555555555555555' -> '0.9999999999999999'
+ddsub479 subtract '0.4444444444444444' '-0.5555555555555554' -> '0.9999999999999998'
+ddsub480 subtract '0.4444444444444444' '-0.5555555555555553' -> '0.9999999999999997'
+ddsub481 subtract '0.4444444444444444' '-0.5555555555555552' -> '0.9999999999999996'
+ddsub482 subtract '0.4444444444444444' '-0.5555555555555551' -> '0.9999999999999995'
+ddsub483 subtract '0.4444444444444444' '-0.5555555555555550' -> '0.9999999999999994'
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+ddsub500 subtract '1231234567456789' 0 -> '1231234567456789'
+ddsub501 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
+ddsub502 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
+ddsub503 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
+ddsub504 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
+ddsub505 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
+ddsub506 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
+ddsub507 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
+ddsub508 subtract '1231234567456789' 0.5 -> '1231234567456789' Inexact Rounded
+ddsub509 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
+ddsub510 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
+ddsub511 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
+ddsub512 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
+ddsub513 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
+ddsub514 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
+ddsub515 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
+ddsub516 subtract '1231234567456789' 1 -> '1231234567456788'
+ddsub517 subtract '1231234567456789' 1.000000001 -> '1231234567456788' Inexact Rounded
+ddsub518 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
+ddsub519 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
+
+rounding: half_even
+ddsub520 subtract '1231234567456789' 0 -> '1231234567456789'
+ddsub521 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
+ddsub522 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
+ddsub523 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
+ddsub524 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
+ddsub525 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
+ddsub526 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
+ddsub527 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
+ddsub528 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
+ddsub529 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
+ddsub530 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
+ddsub531 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
+ddsub532 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
+ddsub533 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
+ddsub534 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
+ddsub535 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
+ddsub536 subtract '1231234567456789' 1 -> '1231234567456788'
+ddsub537 subtract '1231234567456789' 1.00000001 -> '1231234567456788' Inexact Rounded
+ddsub538 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
+ddsub539 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
+-- critical few with even bottom digit...
+ddsub540 subtract '1231234567456788' 0.499999999 -> '1231234567456788' Inexact Rounded
+ddsub541 subtract '1231234567456788' 0.5 -> '1231234567456788' Inexact Rounded
+ddsub542 subtract '1231234567456788' 0.500000001 -> '1231234567456787' Inexact Rounded
+
+rounding: down
+ddsub550 subtract '1231234567456789' 0 -> '1231234567456789'
+ddsub551 subtract '1231234567456789' 0.000000001 -> '1231234567456788' Inexact Rounded
+ddsub552 subtract '1231234567456789' 0.000001 -> '1231234567456788' Inexact Rounded
+ddsub553 subtract '1231234567456789' 0.1 -> '1231234567456788' Inexact Rounded
+ddsub554 subtract '1231234567456789' 0.4 -> '1231234567456788' Inexact Rounded
+ddsub555 subtract '1231234567456789' 0.49 -> '1231234567456788' Inexact Rounded
+ddsub556 subtract '1231234567456789' 0.499999 -> '1231234567456788' Inexact Rounded
+ddsub557 subtract '1231234567456789' 0.499999999 -> '1231234567456788' Inexact Rounded
+ddsub558 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
+ddsub559 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
+ddsub560 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
+ddsub561 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
+ddsub562 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
+ddsub563 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
+ddsub564 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
+ddsub565 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
+ddsub566 subtract '1231234567456789' 1 -> '1231234567456788'
+ddsub567 subtract '1231234567456789' 1.00000001 -> '1231234567456787' Inexact Rounded
+ddsub568 subtract '1231234567456789' 1.00001 -> '1231234567456787' Inexact Rounded
+ddsub569 subtract '1231234567456789' 1.1 -> '1231234567456787' Inexact Rounded
+
+-- symmetry...
+rounding: half_up
+ddsub600 subtract 0 '1231234567456789' -> '-1231234567456789'
+ddsub601 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub602 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub603 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub604 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub605 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub606 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub607 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub608 subtract 0.5 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub609 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub610 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub611 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub612 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub613 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub614 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub615 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub616 subtract 1 '1231234567456789' -> '-1231234567456788'
+ddsub617 subtract 1.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub618 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub619 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+
+rounding: half_even
+ddsub620 subtract 0 '1231234567456789' -> '-1231234567456789'
+ddsub621 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub622 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub623 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub624 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub625 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub626 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub627 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub628 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub629 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub630 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub631 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub632 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub633 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub634 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub635 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub636 subtract 1 '1231234567456789' -> '-1231234567456788'
+ddsub637 subtract 1.00000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub638 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub639 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+-- critical few with even bottom digit...
+ddsub640 subtract 0.499999999 '1231234567456788' -> '-1231234567456788' Inexact Rounded
+ddsub641 subtract 0.5 '1231234567456788' -> '-1231234567456788' Inexact Rounded
+ddsub642 subtract 0.500000001 '1231234567456788' -> '-1231234567456787' Inexact Rounded
+
+rounding: down
+ddsub650 subtract 0 '1231234567456789' -> '-1231234567456789'
+ddsub651 subtract 0.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub652 subtract 0.000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub653 subtract 0.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub654 subtract 0.4 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub655 subtract 0.49 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub656 subtract 0.499999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub657 subtract 0.499999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub658 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub659 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub660 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub661 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub662 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub663 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub664 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub665 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub666 subtract 1 '1231234567456789' -> '-1231234567456788'
+ddsub667 subtract 1.00000001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
+ddsub668 subtract 1.00001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
+ddsub669 subtract 1.1 '1231234567456789' -> '-1231234567456787' Inexact Rounded
+
+
+-- lots of leading zeros in intermediate result, and showing effects of
+-- input rounding would have affected the following
+rounding: half_up
+ddsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
+ddsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
+ddsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
+ddsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
+ddsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+rounding: half_even
+ddsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
+ddsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
+ddsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
+ddsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
+ddsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+ddsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
+ddsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
+ddsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
+ddsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
+ddsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
+
+rounding: down
+ddsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
+ddsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
+ddsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
+ddsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
+ddsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+-- Specials
+ddsub780 subtract -Inf Inf -> -Infinity
+ddsub781 subtract -Inf 1000 -> -Infinity
+ddsub782 subtract -Inf 1 -> -Infinity
+ddsub783 subtract -Inf -0 -> -Infinity
+ddsub784 subtract -Inf -1 -> -Infinity
+ddsub785 subtract -Inf -1000 -> -Infinity
+ddsub787 subtract -1000 Inf -> -Infinity
+ddsub788 subtract -Inf Inf -> -Infinity
+ddsub789 subtract -1 Inf -> -Infinity
+ddsub790 subtract 0 Inf -> -Infinity
+ddsub791 subtract 1 Inf -> -Infinity
+ddsub792 subtract 1000 Inf -> -Infinity
+
+ddsub800 subtract Inf Inf -> NaN Invalid_operation
+ddsub801 subtract Inf 1000 -> Infinity
+ddsub802 subtract Inf 1 -> Infinity
+ddsub803 subtract Inf 0 -> Infinity
+ddsub804 subtract Inf -0 -> Infinity
+ddsub805 subtract Inf -1 -> Infinity
+ddsub806 subtract Inf -1000 -> Infinity
+ddsub807 subtract Inf -Inf -> Infinity
+ddsub808 subtract -1000 -Inf -> Infinity
+ddsub809 subtract -Inf -Inf -> NaN Invalid_operation
+ddsub810 subtract -1 -Inf -> Infinity
+ddsub811 subtract -0 -Inf -> Infinity
+ddsub812 subtract 0 -Inf -> Infinity
+ddsub813 subtract 1 -Inf -> Infinity
+ddsub814 subtract 1000 -Inf -> Infinity
+ddsub815 subtract Inf -Inf -> Infinity
+
+ddsub821 subtract NaN Inf -> NaN
+ddsub822 subtract -NaN 1000 -> -NaN
+ddsub823 subtract NaN 1 -> NaN
+ddsub824 subtract NaN 0 -> NaN
+ddsub825 subtract NaN -0 -> NaN
+ddsub826 subtract NaN -1 -> NaN
+ddsub827 subtract NaN -1000 -> NaN
+ddsub828 subtract NaN -Inf -> NaN
+ddsub829 subtract -NaN NaN -> -NaN
+ddsub830 subtract -Inf NaN -> NaN
+ddsub831 subtract -1000 NaN -> NaN
+ddsub832 subtract -1 NaN -> NaN
+ddsub833 subtract -0 NaN -> NaN
+ddsub834 subtract 0 NaN -> NaN
+ddsub835 subtract 1 NaN -> NaN
+ddsub836 subtract 1000 -NaN -> -NaN
+ddsub837 subtract Inf NaN -> NaN
+
+ddsub841 subtract sNaN Inf -> NaN Invalid_operation
+ddsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
+ddsub843 subtract sNaN 1 -> NaN Invalid_operation
+ddsub844 subtract sNaN 0 -> NaN Invalid_operation
+ddsub845 subtract sNaN -0 -> NaN Invalid_operation
+ddsub846 subtract sNaN -1 -> NaN Invalid_operation
+ddsub847 subtract sNaN -1000 -> NaN Invalid_operation
+ddsub848 subtract sNaN NaN -> NaN Invalid_operation
+ddsub849 subtract sNaN sNaN -> NaN Invalid_operation
+ddsub850 subtract NaN sNaN -> NaN Invalid_operation
+ddsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
+ddsub852 subtract -1000 sNaN -> NaN Invalid_operation
+ddsub853 subtract -1 sNaN -> NaN Invalid_operation
+ddsub854 subtract -0 sNaN -> NaN Invalid_operation
+ddsub855 subtract 0 sNaN -> NaN Invalid_operation
+ddsub856 subtract 1 sNaN -> NaN Invalid_operation
+ddsub857 subtract 1000 sNaN -> NaN Invalid_operation
+ddsub858 subtract Inf sNaN -> NaN Invalid_operation
+ddsub859 subtract NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddsub861 subtract NaN01 -Inf -> NaN1
+ddsub862 subtract -NaN02 -1000 -> -NaN2
+ddsub863 subtract NaN03 1000 -> NaN3
+ddsub864 subtract NaN04 Inf -> NaN4
+ddsub865 subtract NaN05 NaN61 -> NaN5
+ddsub866 subtract -Inf -NaN71 -> -NaN71
+ddsub867 subtract -1000 NaN81 -> NaN81
+ddsub868 subtract 1000 NaN91 -> NaN91
+ddsub869 subtract Inf NaN101 -> NaN101
+ddsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
+ddsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
+ddsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
+ddsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
+ddsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
+ddsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
+ddsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
+ddsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
+ddsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
+ddsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
+ddsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- edge case spills
+ddsub901 subtract 2.E-3 1.002 -> -1.000
+ddsub902 subtract 2.0E-3 1.002 -> -1.0000
+ddsub903 subtract 2.00E-3 1.0020 -> -1.00000
+ddsub904 subtract 2.000E-3 1.00200 -> -1.000000
+ddsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
+ddsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
+ddsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
+ddsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
+
+-- subnormals and overflows covered under Add
+
+-- Null tests
+ddsub9990 subtract 10 # -> NaN Invalid_operation
+ddsub9991 subtract # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddToIntegral.decTest b/Lib/test/decimaltestdata/ddToIntegral.decTest
index bf6d61fa56..900bd4ac3a 100644
--- a/Lib/test/decimaltestdata/ddToIntegral.decTest
+++ b/Lib/test/decimaltestdata/ddToIntegral.decTest
@@ -1,257 +1,257 @@
-------------------------------------------------------------------------
--- ddToIntegral.decTest -- round Double to integral value --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests tests the extended specification 'round-to-integral
--- value-exact' operations (from IEEE 854, later modified in 754r).
--- All non-zero results are defined as being those from either copy or
--- quantize, so those are assumed to have been tested extensively
--- elsewhere; the tests here are for integrity, rounding mode, etc.
--- Also, it is assumed the test harness will use these tests for both
--- ToIntegralExact (which does set Inexact) and the fixed-name
--- functions (which do not set Inexact).
-
--- Note that decNumber implements an earlier definition of toIntegral
--- which never sets Inexact; the decTest operator for that is called
--- 'tointegral' instead of 'tointegralx'.
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddintx001 tointegralx 0 -> 0
-ddintx002 tointegralx 0.0 -> 0
-ddintx003 tointegralx 0.1 -> 0 Inexact Rounded
-ddintx004 tointegralx 0.2 -> 0 Inexact Rounded
-ddintx005 tointegralx 0.3 -> 0 Inexact Rounded
-ddintx006 tointegralx 0.4 -> 0 Inexact Rounded
-ddintx007 tointegralx 0.5 -> 0 Inexact Rounded
-ddintx008 tointegralx 0.6 -> 1 Inexact Rounded
-ddintx009 tointegralx 0.7 -> 1 Inexact Rounded
-ddintx010 tointegralx 0.8 -> 1 Inexact Rounded
-ddintx011 tointegralx 0.9 -> 1 Inexact Rounded
-ddintx012 tointegralx 1 -> 1
-ddintx013 tointegralx 1.0 -> 1 Rounded
-ddintx014 tointegralx 1.1 -> 1 Inexact Rounded
-ddintx015 tointegralx 1.2 -> 1 Inexact Rounded
-ddintx016 tointegralx 1.3 -> 1 Inexact Rounded
-ddintx017 tointegralx 1.4 -> 1 Inexact Rounded
-ddintx018 tointegralx 1.5 -> 2 Inexact Rounded
-ddintx019 tointegralx 1.6 -> 2 Inexact Rounded
-ddintx020 tointegralx 1.7 -> 2 Inexact Rounded
-ddintx021 tointegralx 1.8 -> 2 Inexact Rounded
-ddintx022 tointegralx 1.9 -> 2 Inexact Rounded
--- negatives
-ddintx031 tointegralx -0 -> -0
-ddintx032 tointegralx -0.0 -> -0
-ddintx033 tointegralx -0.1 -> -0 Inexact Rounded
-ddintx034 tointegralx -0.2 -> -0 Inexact Rounded
-ddintx035 tointegralx -0.3 -> -0 Inexact Rounded
-ddintx036 tointegralx -0.4 -> -0 Inexact Rounded
-ddintx037 tointegralx -0.5 -> -0 Inexact Rounded
-ddintx038 tointegralx -0.6 -> -1 Inexact Rounded
-ddintx039 tointegralx -0.7 -> -1 Inexact Rounded
-ddintx040 tointegralx -0.8 -> -1 Inexact Rounded
-ddintx041 tointegralx -0.9 -> -1 Inexact Rounded
-ddintx042 tointegralx -1 -> -1
-ddintx043 tointegralx -1.0 -> -1 Rounded
-ddintx044 tointegralx -1.1 -> -1 Inexact Rounded
-ddintx045 tointegralx -1.2 -> -1 Inexact Rounded
-ddintx046 tointegralx -1.3 -> -1 Inexact Rounded
-ddintx047 tointegralx -1.4 -> -1 Inexact Rounded
-ddintx048 tointegralx -1.5 -> -2 Inexact Rounded
-ddintx049 tointegralx -1.6 -> -2 Inexact Rounded
-ddintx050 tointegralx -1.7 -> -2 Inexact Rounded
-ddintx051 tointegralx -1.8 -> -2 Inexact Rounded
-ddintx052 tointegralx -1.9 -> -2 Inexact Rounded
--- next two would be NaN using quantize(x, 0)
-ddintx053 tointegralx 10E+60 -> 1.0E+61
-ddintx054 tointegralx -10E+60 -> -1.0E+61
-
--- numbers around precision
-ddintx060 tointegralx '56267E-17' -> '0' Inexact Rounded
-ddintx061 tointegralx '56267E-5' -> '1' Inexact Rounded
-ddintx062 tointegralx '56267E-2' -> '563' Inexact Rounded
-ddintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
-ddintx065 tointegralx '56267E-0' -> '56267'
-ddintx066 tointegralx '56267E+0' -> '56267'
-ddintx067 tointegralx '56267E+1' -> '5.6267E+5'
-ddintx068 tointegralx '56267E+9' -> '5.6267E+13'
-ddintx069 tointegralx '56267E+10' -> '5.6267E+14'
-ddintx070 tointegralx '56267E+11' -> '5.6267E+15'
-ddintx071 tointegralx '56267E+12' -> '5.6267E+16'
-ddintx072 tointegralx '56267E+13' -> '5.6267E+17'
-ddintx073 tointegralx '1.23E+96' -> '1.23E+96'
-ddintx074 tointegralx '1.23E+384' -> #47fd300000000000 Clamped
-
-ddintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
-ddintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
-ddintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
-ddintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
-ddintx085 tointegralx '-56267E-0' -> '-56267'
-ddintx086 tointegralx '-56267E+0' -> '-56267'
-ddintx087 tointegralx '-56267E+1' -> '-5.6267E+5'
-ddintx088 tointegralx '-56267E+9' -> '-5.6267E+13'
-ddintx089 tointegralx '-56267E+10' -> '-5.6267E+14'
-ddintx090 tointegralx '-56267E+11' -> '-5.6267E+15'
-ddintx091 tointegralx '-56267E+12' -> '-5.6267E+16'
-ddintx092 tointegralx '-56267E+13' -> '-5.6267E+17'
-ddintx093 tointegralx '-1.23E+96' -> '-1.23E+96'
-ddintx094 tointegralx '-1.23E+384' -> #c7fd300000000000 Clamped
-
--- subnormal inputs
-ddintx100 tointegralx 1E-299 -> 0 Inexact Rounded
-ddintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded
-ddintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded
-ddintx103 tointegralx 0E-299 -> 0
-
--- specials and zeros
-ddintx120 tointegralx 'Inf' -> Infinity
-ddintx121 tointegralx '-Inf' -> -Infinity
-ddintx122 tointegralx NaN -> NaN
-ddintx123 tointegralx sNaN -> NaN Invalid_operation
-ddintx124 tointegralx 0 -> 0
-ddintx125 tointegralx -0 -> -0
-ddintx126 tointegralx 0.000 -> 0
-ddintx127 tointegralx 0.00 -> 0
-ddintx128 tointegralx 0.0 -> 0
-ddintx129 tointegralx 0 -> 0
-ddintx130 tointegralx 0E-3 -> 0
-ddintx131 tointegralx 0E-2 -> 0
-ddintx132 tointegralx 0E-1 -> 0
-ddintx133 tointegralx 0E-0 -> 0
-ddintx134 tointegralx 0E+1 -> 0E+1
-ddintx135 tointegralx 0E+2 -> 0E+2
-ddintx136 tointegralx 0E+3 -> 0E+3
-ddintx137 tointegralx 0E+4 -> 0E+4
-ddintx138 tointegralx 0E+5 -> 0E+5
-ddintx139 tointegralx -0.000 -> -0
-ddintx140 tointegralx -0.00 -> -0
-ddintx141 tointegralx -0.0 -> -0
-ddintx142 tointegralx -0 -> -0
-ddintx143 tointegralx -0E-3 -> -0
-ddintx144 tointegralx -0E-2 -> -0
-ddintx145 tointegralx -0E-1 -> -0
-ddintx146 tointegralx -0E-0 -> -0
-ddintx147 tointegralx -0E+1 -> -0E+1
-ddintx148 tointegralx -0E+2 -> -0E+2
-ddintx149 tointegralx -0E+3 -> -0E+3
-ddintx150 tointegralx -0E+4 -> -0E+4
-ddintx151 tointegralx -0E+5 -> -0E+5
--- propagating NaNs
-ddintx152 tointegralx NaN808 -> NaN808
-ddintx153 tointegralx sNaN080 -> NaN80 Invalid_operation
-ddintx154 tointegralx -NaN808 -> -NaN808
-ddintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
-ddintx156 tointegralx -NaN -> -NaN
-ddintx157 tointegralx -sNaN -> -NaN Invalid_operation
-
--- examples
-rounding: half_up
-ddintx200 tointegralx 2.1 -> 2 Inexact Rounded
-ddintx201 tointegralx 100 -> 100
-ddintx202 tointegralx 100.0 -> 100 Rounded
-ddintx203 tointegralx 101.5 -> 102 Inexact Rounded
-ddintx204 tointegralx -101.5 -> -102 Inexact Rounded
-ddintx205 tointegralx 10E+5 -> 1.0E+6
-ddintx206 tointegralx 7.89E+77 -> 7.89E+77
-ddintx207 tointegralx -Inf -> -Infinity
-
-
--- all rounding modes
-rounding: half_even
-ddintx210 tointegralx 55.5 -> 56 Inexact Rounded
-ddintx211 tointegralx 56.5 -> 56 Inexact Rounded
-ddintx212 tointegralx 57.5 -> 58 Inexact Rounded
-ddintx213 tointegralx -55.5 -> -56 Inexact Rounded
-ddintx214 tointegralx -56.5 -> -56 Inexact Rounded
-ddintx215 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_up
-
-ddintx220 tointegralx 55.5 -> 56 Inexact Rounded
-ddintx221 tointegralx 56.5 -> 57 Inexact Rounded
-ddintx222 tointegralx 57.5 -> 58 Inexact Rounded
-ddintx223 tointegralx -55.5 -> -56 Inexact Rounded
-ddintx224 tointegralx -56.5 -> -57 Inexact Rounded
-ddintx225 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_down
-
-ddintx230 tointegralx 55.5 -> 55 Inexact Rounded
-ddintx231 tointegralx 56.5 -> 56 Inexact Rounded
-ddintx232 tointegralx 57.5 -> 57 Inexact Rounded
-ddintx233 tointegralx -55.5 -> -55 Inexact Rounded
-ddintx234 tointegralx -56.5 -> -56 Inexact Rounded
-ddintx235 tointegralx -57.5 -> -57 Inexact Rounded
-
-rounding: up
-
-ddintx240 tointegralx 55.3 -> 56 Inexact Rounded
-ddintx241 tointegralx 56.3 -> 57 Inexact Rounded
-ddintx242 tointegralx 57.3 -> 58 Inexact Rounded
-ddintx243 tointegralx -55.3 -> -56 Inexact Rounded
-ddintx244 tointegralx -56.3 -> -57 Inexact Rounded
-ddintx245 tointegralx -57.3 -> -58 Inexact Rounded
-
-rounding: down
-
-ddintx250 tointegralx 55.7 -> 55 Inexact Rounded
-ddintx251 tointegralx 56.7 -> 56 Inexact Rounded
-ddintx252 tointegralx 57.7 -> 57 Inexact Rounded
-ddintx253 tointegralx -55.7 -> -55 Inexact Rounded
-ddintx254 tointegralx -56.7 -> -56 Inexact Rounded
-ddintx255 tointegralx -57.7 -> -57 Inexact Rounded
-
-rounding: ceiling
-
-ddintx260 tointegralx 55.3 -> 56 Inexact Rounded
-ddintx261 tointegralx 56.3 -> 57 Inexact Rounded
-ddintx262 tointegralx 57.3 -> 58 Inexact Rounded
-ddintx263 tointegralx -55.3 -> -55 Inexact Rounded
-ddintx264 tointegralx -56.3 -> -56 Inexact Rounded
-ddintx265 tointegralx -57.3 -> -57 Inexact Rounded
-
-rounding: floor
-
-ddintx270 tointegralx 55.7 -> 55 Inexact Rounded
-ddintx271 tointegralx 56.7 -> 56 Inexact Rounded
-ddintx272 tointegralx 57.7 -> 57 Inexact Rounded
-ddintx273 tointegralx -55.7 -> -56 Inexact Rounded
-ddintx274 tointegralx -56.7 -> -57 Inexact Rounded
-ddintx275 tointegralx -57.7 -> -58 Inexact Rounded
-
--- Int and uInt32 edge values for testing conversions
-ddintx300 tointegralx -2147483646 -> -2147483646
-ddintx301 tointegralx -2147483647 -> -2147483647
-ddintx302 tointegralx -2147483648 -> -2147483648
-ddintx303 tointegralx -2147483649 -> -2147483649
-ddintx304 tointegralx 2147483646 -> 2147483646
-ddintx305 tointegralx 2147483647 -> 2147483647
-ddintx306 tointegralx 2147483648 -> 2147483648
-ddintx307 tointegralx 2147483649 -> 2147483649
-ddintx308 tointegralx 4294967294 -> 4294967294
-ddintx309 tointegralx 4294967295 -> 4294967295
-ddintx310 tointegralx 4294967296 -> 4294967296
-ddintx311 tointegralx 4294967297 -> 4294967297
-
+------------------------------------------------------------------------
+-- ddToIntegral.decTest -- round Double to integral value --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests tests the extended specification 'round-to-integral
+-- value-exact' operations (from IEEE 854, later modified in 754r).
+-- All non-zero results are defined as being those from either copy or
+-- quantize, so those are assumed to have been tested extensively
+-- elsewhere; the tests here are for integrity, rounding mode, etc.
+-- Also, it is assumed the test harness will use these tests for both
+-- ToIntegralExact (which does set Inexact) and the fixed-name
+-- functions (which do not set Inexact).
+
+-- Note that decNumber implements an earlier definition of toIntegral
+-- which never sets Inexact; the decTest operator for that is called
+-- 'tointegral' instead of 'tointegralx'.
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddintx001 tointegralx 0 -> 0
+ddintx002 tointegralx 0.0 -> 0
+ddintx003 tointegralx 0.1 -> 0 Inexact Rounded
+ddintx004 tointegralx 0.2 -> 0 Inexact Rounded
+ddintx005 tointegralx 0.3 -> 0 Inexact Rounded
+ddintx006 tointegralx 0.4 -> 0 Inexact Rounded
+ddintx007 tointegralx 0.5 -> 0 Inexact Rounded
+ddintx008 tointegralx 0.6 -> 1 Inexact Rounded
+ddintx009 tointegralx 0.7 -> 1 Inexact Rounded
+ddintx010 tointegralx 0.8 -> 1 Inexact Rounded
+ddintx011 tointegralx 0.9 -> 1 Inexact Rounded
+ddintx012 tointegralx 1 -> 1
+ddintx013 tointegralx 1.0 -> 1 Rounded
+ddintx014 tointegralx 1.1 -> 1 Inexact Rounded
+ddintx015 tointegralx 1.2 -> 1 Inexact Rounded
+ddintx016 tointegralx 1.3 -> 1 Inexact Rounded
+ddintx017 tointegralx 1.4 -> 1 Inexact Rounded
+ddintx018 tointegralx 1.5 -> 2 Inexact Rounded
+ddintx019 tointegralx 1.6 -> 2 Inexact Rounded
+ddintx020 tointegralx 1.7 -> 2 Inexact Rounded
+ddintx021 tointegralx 1.8 -> 2 Inexact Rounded
+ddintx022 tointegralx 1.9 -> 2 Inexact Rounded
+-- negatives
+ddintx031 tointegralx -0 -> -0
+ddintx032 tointegralx -0.0 -> -0
+ddintx033 tointegralx -0.1 -> -0 Inexact Rounded
+ddintx034 tointegralx -0.2 -> -0 Inexact Rounded
+ddintx035 tointegralx -0.3 -> -0 Inexact Rounded
+ddintx036 tointegralx -0.4 -> -0 Inexact Rounded
+ddintx037 tointegralx -0.5 -> -0 Inexact Rounded
+ddintx038 tointegralx -0.6 -> -1 Inexact Rounded
+ddintx039 tointegralx -0.7 -> -1 Inexact Rounded
+ddintx040 tointegralx -0.8 -> -1 Inexact Rounded
+ddintx041 tointegralx -0.9 -> -1 Inexact Rounded
+ddintx042 tointegralx -1 -> -1
+ddintx043 tointegralx -1.0 -> -1 Rounded
+ddintx044 tointegralx -1.1 -> -1 Inexact Rounded
+ddintx045 tointegralx -1.2 -> -1 Inexact Rounded
+ddintx046 tointegralx -1.3 -> -1 Inexact Rounded
+ddintx047 tointegralx -1.4 -> -1 Inexact Rounded
+ddintx048 tointegralx -1.5 -> -2 Inexact Rounded
+ddintx049 tointegralx -1.6 -> -2 Inexact Rounded
+ddintx050 tointegralx -1.7 -> -2 Inexact Rounded
+ddintx051 tointegralx -1.8 -> -2 Inexact Rounded
+ddintx052 tointegralx -1.9 -> -2 Inexact Rounded
+-- next two would be NaN using quantize(x, 0)
+ddintx053 tointegralx 10E+60 -> 1.0E+61
+ddintx054 tointegralx -10E+60 -> -1.0E+61
+
+-- numbers around precision
+ddintx060 tointegralx '56267E-17' -> '0' Inexact Rounded
+ddintx061 tointegralx '56267E-5' -> '1' Inexact Rounded
+ddintx062 tointegralx '56267E-2' -> '563' Inexact Rounded
+ddintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
+ddintx065 tointegralx '56267E-0' -> '56267'
+ddintx066 tointegralx '56267E+0' -> '56267'
+ddintx067 tointegralx '56267E+1' -> '5.6267E+5'
+ddintx068 tointegralx '56267E+9' -> '5.6267E+13'
+ddintx069 tointegralx '56267E+10' -> '5.6267E+14'
+ddintx070 tointegralx '56267E+11' -> '5.6267E+15'
+ddintx071 tointegralx '56267E+12' -> '5.6267E+16'
+ddintx072 tointegralx '56267E+13' -> '5.6267E+17'
+ddintx073 tointegralx '1.23E+96' -> '1.23E+96'
+ddintx074 tointegralx '1.23E+384' -> #47fd300000000000 Clamped
+
+ddintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
+ddintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
+ddintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
+ddintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
+ddintx085 tointegralx '-56267E-0' -> '-56267'
+ddintx086 tointegralx '-56267E+0' -> '-56267'
+ddintx087 tointegralx '-56267E+1' -> '-5.6267E+5'
+ddintx088 tointegralx '-56267E+9' -> '-5.6267E+13'
+ddintx089 tointegralx '-56267E+10' -> '-5.6267E+14'
+ddintx090 tointegralx '-56267E+11' -> '-5.6267E+15'
+ddintx091 tointegralx '-56267E+12' -> '-5.6267E+16'
+ddintx092 tointegralx '-56267E+13' -> '-5.6267E+17'
+ddintx093 tointegralx '-1.23E+96' -> '-1.23E+96'
+ddintx094 tointegralx '-1.23E+384' -> #c7fd300000000000 Clamped
+
+-- subnormal inputs
+ddintx100 tointegralx 1E-299 -> 0 Inexact Rounded
+ddintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded
+ddintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded
+ddintx103 tointegralx 0E-299 -> 0
+
+-- specials and zeros
+ddintx120 tointegralx 'Inf' -> Infinity
+ddintx121 tointegralx '-Inf' -> -Infinity
+ddintx122 tointegralx NaN -> NaN
+ddintx123 tointegralx sNaN -> NaN Invalid_operation
+ddintx124 tointegralx 0 -> 0
+ddintx125 tointegralx -0 -> -0
+ddintx126 tointegralx 0.000 -> 0
+ddintx127 tointegralx 0.00 -> 0
+ddintx128 tointegralx 0.0 -> 0
+ddintx129 tointegralx 0 -> 0
+ddintx130 tointegralx 0E-3 -> 0
+ddintx131 tointegralx 0E-2 -> 0
+ddintx132 tointegralx 0E-1 -> 0
+ddintx133 tointegralx 0E-0 -> 0
+ddintx134 tointegralx 0E+1 -> 0E+1
+ddintx135 tointegralx 0E+2 -> 0E+2
+ddintx136 tointegralx 0E+3 -> 0E+3
+ddintx137 tointegralx 0E+4 -> 0E+4
+ddintx138 tointegralx 0E+5 -> 0E+5
+ddintx139 tointegralx -0.000 -> -0
+ddintx140 tointegralx -0.00 -> -0
+ddintx141 tointegralx -0.0 -> -0
+ddintx142 tointegralx -0 -> -0
+ddintx143 tointegralx -0E-3 -> -0
+ddintx144 tointegralx -0E-2 -> -0
+ddintx145 tointegralx -0E-1 -> -0
+ddintx146 tointegralx -0E-0 -> -0
+ddintx147 tointegralx -0E+1 -> -0E+1
+ddintx148 tointegralx -0E+2 -> -0E+2
+ddintx149 tointegralx -0E+3 -> -0E+3
+ddintx150 tointegralx -0E+4 -> -0E+4
+ddintx151 tointegralx -0E+5 -> -0E+5
+-- propagating NaNs
+ddintx152 tointegralx NaN808 -> NaN808
+ddintx153 tointegralx sNaN080 -> NaN80 Invalid_operation
+ddintx154 tointegralx -NaN808 -> -NaN808
+ddintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
+ddintx156 tointegralx -NaN -> -NaN
+ddintx157 tointegralx -sNaN -> -NaN Invalid_operation
+
+-- examples
+rounding: half_up
+ddintx200 tointegralx 2.1 -> 2 Inexact Rounded
+ddintx201 tointegralx 100 -> 100
+ddintx202 tointegralx 100.0 -> 100 Rounded
+ddintx203 tointegralx 101.5 -> 102 Inexact Rounded
+ddintx204 tointegralx -101.5 -> -102 Inexact Rounded
+ddintx205 tointegralx 10E+5 -> 1.0E+6
+ddintx206 tointegralx 7.89E+77 -> 7.89E+77
+ddintx207 tointegralx -Inf -> -Infinity
+
+
+-- all rounding modes
+rounding: half_even
+ddintx210 tointegralx 55.5 -> 56 Inexact Rounded
+ddintx211 tointegralx 56.5 -> 56 Inexact Rounded
+ddintx212 tointegralx 57.5 -> 58 Inexact Rounded
+ddintx213 tointegralx -55.5 -> -56 Inexact Rounded
+ddintx214 tointegralx -56.5 -> -56 Inexact Rounded
+ddintx215 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_up
+
+ddintx220 tointegralx 55.5 -> 56 Inexact Rounded
+ddintx221 tointegralx 56.5 -> 57 Inexact Rounded
+ddintx222 tointegralx 57.5 -> 58 Inexact Rounded
+ddintx223 tointegralx -55.5 -> -56 Inexact Rounded
+ddintx224 tointegralx -56.5 -> -57 Inexact Rounded
+ddintx225 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_down
+
+ddintx230 tointegralx 55.5 -> 55 Inexact Rounded
+ddintx231 tointegralx 56.5 -> 56 Inexact Rounded
+ddintx232 tointegralx 57.5 -> 57 Inexact Rounded
+ddintx233 tointegralx -55.5 -> -55 Inexact Rounded
+ddintx234 tointegralx -56.5 -> -56 Inexact Rounded
+ddintx235 tointegralx -57.5 -> -57 Inexact Rounded
+
+rounding: up
+
+ddintx240 tointegralx 55.3 -> 56 Inexact Rounded
+ddintx241 tointegralx 56.3 -> 57 Inexact Rounded
+ddintx242 tointegralx 57.3 -> 58 Inexact Rounded
+ddintx243 tointegralx -55.3 -> -56 Inexact Rounded
+ddintx244 tointegralx -56.3 -> -57 Inexact Rounded
+ddintx245 tointegralx -57.3 -> -58 Inexact Rounded
+
+rounding: down
+
+ddintx250 tointegralx 55.7 -> 55 Inexact Rounded
+ddintx251 tointegralx 56.7 -> 56 Inexact Rounded
+ddintx252 tointegralx 57.7 -> 57 Inexact Rounded
+ddintx253 tointegralx -55.7 -> -55 Inexact Rounded
+ddintx254 tointegralx -56.7 -> -56 Inexact Rounded
+ddintx255 tointegralx -57.7 -> -57 Inexact Rounded
+
+rounding: ceiling
+
+ddintx260 tointegralx 55.3 -> 56 Inexact Rounded
+ddintx261 tointegralx 56.3 -> 57 Inexact Rounded
+ddintx262 tointegralx 57.3 -> 58 Inexact Rounded
+ddintx263 tointegralx -55.3 -> -55 Inexact Rounded
+ddintx264 tointegralx -56.3 -> -56 Inexact Rounded
+ddintx265 tointegralx -57.3 -> -57 Inexact Rounded
+
+rounding: floor
+
+ddintx270 tointegralx 55.7 -> 55 Inexact Rounded
+ddintx271 tointegralx 56.7 -> 56 Inexact Rounded
+ddintx272 tointegralx 57.7 -> 57 Inexact Rounded
+ddintx273 tointegralx -55.7 -> -56 Inexact Rounded
+ddintx274 tointegralx -56.7 -> -57 Inexact Rounded
+ddintx275 tointegralx -57.7 -> -58 Inexact Rounded
+
+-- Int and uInt32 edge values for testing conversions
+ddintx300 tointegralx -2147483646 -> -2147483646
+ddintx301 tointegralx -2147483647 -> -2147483647
+ddintx302 tointegralx -2147483648 -> -2147483648
+ddintx303 tointegralx -2147483649 -> -2147483649
+ddintx304 tointegralx 2147483646 -> 2147483646
+ddintx305 tointegralx 2147483647 -> 2147483647
+ddintx306 tointegralx 2147483648 -> 2147483648
+ddintx307 tointegralx 2147483649 -> 2147483649
+ddintx308 tointegralx 4294967294 -> 4294967294
+ddintx309 tointegralx 4294967295 -> 4294967295
+ddintx310 tointegralx 4294967296 -> 4294967296
+ddintx311 tointegralx 4294967297 -> 4294967297
+
diff --git a/Lib/test/decimaltestdata/ddXor.decTest b/Lib/test/decimaltestdata/ddXor.decTest
index 131c7eb4b0..3c55548e5e 100644
--- a/Lib/test/decimaltestdata/ddXor.decTest
+++ b/Lib/test/decimaltestdata/ddXor.decTest
@@ -1,337 +1,337 @@
-------------------------------------------------------------------------
--- ddXor.decTest -- digitwise logical XOR for decDoubles --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check (truth table)
-ddxor001 xor 0 0 -> 0
-ddxor002 xor 0 1 -> 1
-ddxor003 xor 1 0 -> 1
-ddxor004 xor 1 1 -> 0
-ddxor005 xor 1100 1010 -> 110
--- and at msd and msd-1
-ddxor006 xor 0000000000000000 0000000000000000 -> 0
-ddxor007 xor 0000000000000000 1000000000000000 -> 1000000000000000
-ddxor008 xor 1000000000000000 0000000000000000 -> 1000000000000000
-ddxor009 xor 1000000000000000 1000000000000000 -> 0
-ddxor010 xor 0000000000000000 0000000000000000 -> 0
-ddxor011 xor 0000000000000000 0100000000000000 -> 100000000000000
-ddxor012 xor 0100000000000000 0000000000000000 -> 100000000000000
-ddxor013 xor 0100000000000000 0100000000000000 -> 0
-
--- Various lengths
--- 1234567890123456 1234567890123456 1234567890123456
-ddxor021 xor 1111111110000000 1111111110000000 -> 0
-ddxor022 xor 111111110000000 111111110000000 -> 0
-ddxor023 xor 11111110000000 11111110000000 -> 0
-ddxor024 xor 1111110000000 1111110000000 -> 0
-ddxor025 xor 111110000000 111110000000 -> 0
-ddxor026 xor 11110000000 11110000000 -> 0
-ddxor027 xor 1110000000 1110000000 -> 0
-ddxor028 xor 110000000 110000000 -> 0
-ddxor029 xor 10000000 10000000 -> 0
-ddxor030 xor 1000000 1000000 -> 0
-ddxor031 xor 100000 100000 -> 0
-ddxor032 xor 10000 10000 -> 0
-ddxor033 xor 1000 1000 -> 0
-ddxor034 xor 100 100 -> 0
-ddxor035 xor 10 10 -> 0
-ddxor036 xor 1 1 -> 0
-
-ddxor040 xor 111111111 111111111111 -> 111000000000
-ddxor041 xor 11111111 111111111111 -> 111100000000
-ddxor042 xor 11111111 111111111 -> 100000000
-ddxor043 xor 1111111 100000010 -> 101111101
-ddxor044 xor 111111 100000100 -> 100111011
-ddxor045 xor 11111 100001000 -> 100010111
-ddxor046 xor 1111 100010000 -> 100011111
-ddxor047 xor 111 100100000 -> 100100111
-ddxor048 xor 11 101000000 -> 101000011
-ddxor049 xor 1 110000000 -> 110000001
-
-ddxor050 xor 1111111111 1 -> 1111111110
-ddxor051 xor 111111111 1 -> 111111110
-ddxor052 xor 11111111 1 -> 11111110
-ddxor053 xor 1111111 1 -> 1111110
-ddxor054 xor 111111 1 -> 111110
-ddxor055 xor 11111 1 -> 11110
-ddxor056 xor 1111 1 -> 1110
-ddxor057 xor 111 1 -> 110
-ddxor058 xor 11 1 -> 10
-ddxor059 xor 1 1 -> 0
-
-ddxor060 xor 1111111111 0 -> 1111111111
-ddxor061 xor 111111111 0 -> 111111111
-ddxor062 xor 11111111 0 -> 11111111
-ddxor063 xor 1111111 0 -> 1111111
-ddxor064 xor 111111 0 -> 111111
-ddxor065 xor 11111 0 -> 11111
-ddxor066 xor 1111 0 -> 1111
-ddxor067 xor 111 0 -> 111
-ddxor068 xor 11 0 -> 11
-ddxor069 xor 1 0 -> 1
-
-ddxor070 xor 1 1111111111 -> 1111111110
-ddxor071 xor 1 111111111 -> 111111110
-ddxor072 xor 1 11111111 -> 11111110
-ddxor073 xor 1 1111111 -> 1111110
-ddxor074 xor 1 111111 -> 111110
-ddxor075 xor 1 11111 -> 11110
-ddxor076 xor 1 1111 -> 1110
-ddxor077 xor 1 111 -> 110
-ddxor078 xor 1 11 -> 10
-ddxor079 xor 1 1 -> 0
-
-ddxor080 xor 0 1111111111 -> 1111111111
-ddxor081 xor 0 111111111 -> 111111111
-ddxor082 xor 0 11111111 -> 11111111
-ddxor083 xor 0 1111111 -> 1111111
-ddxor084 xor 0 111111 -> 111111
-ddxor085 xor 0 11111 -> 11111
-ddxor086 xor 0 1111 -> 1111
-ddxor087 xor 0 111 -> 111
-ddxor088 xor 0 11 -> 11
-ddxor089 xor 0 1 -> 1
-
-ddxor090 xor 011111111 111101111 -> 100010000
-ddxor091 xor 101111111 111101111 -> 10010000
-ddxor092 xor 110111111 111101111 -> 1010000
-ddxor093 xor 111011111 111101111 -> 110000
-ddxor094 xor 111101111 111101111 -> 0
-ddxor095 xor 111110111 111101111 -> 11000
-ddxor096 xor 111111011 111101111 -> 10100
-ddxor097 xor 111111101 111101111 -> 10010
-ddxor098 xor 111111110 111101111 -> 10001
-
-ddxor100 xor 111101111 011111111 -> 100010000
-ddxor101 xor 111101111 101111111 -> 10010000
-ddxor102 xor 111101111 110111111 -> 1010000
-ddxor103 xor 111101111 111011111 -> 110000
-ddxor104 xor 111101111 111101111 -> 0
-ddxor105 xor 111101111 111110111 -> 11000
-ddxor106 xor 111101111 111111011 -> 10100
-ddxor107 xor 111101111 111111101 -> 10010
-ddxor108 xor 111101111 111111110 -> 10001
-
--- non-0/1 should not be accepted, nor should signs
-ddxor220 xor 111111112 111111111 -> NaN Invalid_operation
-ddxor221 xor 333333333 333333333 -> NaN Invalid_operation
-ddxor222 xor 555555555 555555555 -> NaN Invalid_operation
-ddxor223 xor 777777777 777777777 -> NaN Invalid_operation
-ddxor224 xor 999999999 999999999 -> NaN Invalid_operation
-ddxor225 xor 222222222 999999999 -> NaN Invalid_operation
-ddxor226 xor 444444444 999999999 -> NaN Invalid_operation
-ddxor227 xor 666666666 999999999 -> NaN Invalid_operation
-ddxor228 xor 888888888 999999999 -> NaN Invalid_operation
-ddxor229 xor 999999999 222222222 -> NaN Invalid_operation
-ddxor230 xor 999999999 444444444 -> NaN Invalid_operation
-ddxor231 xor 999999999 666666666 -> NaN Invalid_operation
-ddxor232 xor 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-ddxor240 xor 567468689 -934981942 -> NaN Invalid_operation
-ddxor241 xor 567367689 934981942 -> NaN Invalid_operation
-ddxor242 xor -631917772 -706014634 -> NaN Invalid_operation
-ddxor243 xor -756253257 138579234 -> NaN Invalid_operation
-ddxor244 xor 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-ddxor250 xor 2000000000000000 1000000000000000 -> NaN Invalid_operation
-ddxor251 xor 7000000000000000 1000000000000000 -> NaN Invalid_operation
-ddxor252 xor 8000000000000000 1000000000000000 -> NaN Invalid_operation
-ddxor253 xor 9000000000000000 1000000000000000 -> NaN Invalid_operation
-ddxor254 xor 2000000000000000 0000000000000000 -> NaN Invalid_operation
-ddxor255 xor 7000000000000000 0000000000000000 -> NaN Invalid_operation
-ddxor256 xor 8000000000000000 0000000000000000 -> NaN Invalid_operation
-ddxor257 xor 9000000000000000 0000000000000000 -> NaN Invalid_operation
-ddxor258 xor 1000000000000000 2000000000000000 -> NaN Invalid_operation
-ddxor259 xor 1000000000000000 7000000000000000 -> NaN Invalid_operation
-ddxor260 xor 1000000000000000 8000000000000000 -> NaN Invalid_operation
-ddxor261 xor 1000000000000000 9000000000000000 -> NaN Invalid_operation
-ddxor262 xor 0000000000000000 2000000000000000 -> NaN Invalid_operation
-ddxor263 xor 0000000000000000 7000000000000000 -> NaN Invalid_operation
-ddxor264 xor 0000000000000000 8000000000000000 -> NaN Invalid_operation
-ddxor265 xor 0000000000000000 9000000000000000 -> NaN Invalid_operation
--- test MSD-1
-ddxor270 xor 0200001000000000 1000100000000010 -> NaN Invalid_operation
-ddxor271 xor 0700000100000000 1000010000000100 -> NaN Invalid_operation
-ddxor272 xor 0800000010000000 1000001000001000 -> NaN Invalid_operation
-ddxor273 xor 0900000001000000 1000000100010000 -> NaN Invalid_operation
-ddxor274 xor 1000000000100000 0200000010100000 -> NaN Invalid_operation
-ddxor275 xor 1000000000010000 0700000001000000 -> NaN Invalid_operation
-ddxor276 xor 1000000000001000 0800000010100000 -> NaN Invalid_operation
-ddxor277 xor 1000000000000100 0900000000010000 -> NaN Invalid_operation
--- test LSD
-ddxor280 xor 0010000000000002 1000000100000001 -> NaN Invalid_operation
-ddxor281 xor 0001000000000007 1000001000000011 -> NaN Invalid_operation
-ddxor282 xor 0000100000000008 1000010000000001 -> NaN Invalid_operation
-ddxor283 xor 0000010000000009 1000100000000001 -> NaN Invalid_operation
-ddxor284 xor 1000001000000000 0001000000000002 -> NaN Invalid_operation
-ddxor285 xor 1000000100000000 0010000000000007 -> NaN Invalid_operation
-ddxor286 xor 1000000010000000 0100000000000008 -> NaN Invalid_operation
-ddxor287 xor 1000000001000000 1000000000000009 -> NaN Invalid_operation
--- test Middie
-ddxor288 xor 0010000020000000 1000001000000000 -> NaN Invalid_operation
-ddxor289 xor 0001000070000001 1000000100000000 -> NaN Invalid_operation
-ddxor290 xor 0000100080000010 1000000010000000 -> NaN Invalid_operation
-ddxor291 xor 0000010090000100 1000000001000000 -> NaN Invalid_operation
-ddxor292 xor 1000001000001000 0000000020100000 -> NaN Invalid_operation
-ddxor293 xor 1000000100010000 0000000070010000 -> NaN Invalid_operation
-ddxor294 xor 1000000010100000 0000000080001000 -> NaN Invalid_operation
-ddxor295 xor 1000000001000000 0000000090000100 -> NaN Invalid_operation
--- signs
-ddxor296 xor -1000000001000000 -0000010000000100 -> NaN Invalid_operation
-ddxor297 xor -1000000001000000 0000000010000100 -> NaN Invalid_operation
-ddxor298 xor 1000000001000000 -0000001000000100 -> NaN Invalid_operation
-ddxor299 xor 1000000001000000 0000000011000100 -> 1000000010000100
-
--- Nmax, Nmin, Ntiny-like
-ddxor331 xor 2 9.99999999E+299 -> NaN Invalid_operation
-ddxor332 xor 3 1E-299 -> NaN Invalid_operation
-ddxor333 xor 4 1.00000000E-299 -> NaN Invalid_operation
-ddxor334 xor 5 1E-200 -> NaN Invalid_operation
-ddxor335 xor 6 -1E-200 -> NaN Invalid_operation
-ddxor336 xor 7 -1.00000000E-299 -> NaN Invalid_operation
-ddxor337 xor 8 -1E-299 -> NaN Invalid_operation
-ddxor338 xor 9 -9.99999999E+299 -> NaN Invalid_operation
-ddxor341 xor 9.99999999E+299 -18 -> NaN Invalid_operation
-ddxor342 xor 1E-299 01 -> NaN Invalid_operation
-ddxor343 xor 1.00000000E-299 -18 -> NaN Invalid_operation
-ddxor344 xor 1E-208 18 -> NaN Invalid_operation
-ddxor345 xor -1E-207 -10 -> NaN Invalid_operation
-ddxor346 xor -1.00000000E-299 18 -> NaN Invalid_operation
-ddxor347 xor -1E-299 10 -> NaN Invalid_operation
-ddxor348 xor -9.99999999E+299 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-ddxor361 xor 1.0 1 -> NaN Invalid_operation
-ddxor362 xor 1E+1 1 -> NaN Invalid_operation
-ddxor363 xor 0.0 1 -> NaN Invalid_operation
-ddxor364 xor 0E+1 1 -> NaN Invalid_operation
-ddxor365 xor 9.9 1 -> NaN Invalid_operation
-ddxor366 xor 9E+1 1 -> NaN Invalid_operation
-ddxor371 xor 0 1.0 -> NaN Invalid_operation
-ddxor372 xor 0 1E+1 -> NaN Invalid_operation
-ddxor373 xor 0 0.0 -> NaN Invalid_operation
-ddxor374 xor 0 0E+1 -> NaN Invalid_operation
-ddxor375 xor 0 9.9 -> NaN Invalid_operation
-ddxor376 xor 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-ddxor780 xor -Inf -Inf -> NaN Invalid_operation
-ddxor781 xor -Inf -1000 -> NaN Invalid_operation
-ddxor782 xor -Inf -1 -> NaN Invalid_operation
-ddxor783 xor -Inf -0 -> NaN Invalid_operation
-ddxor784 xor -Inf 0 -> NaN Invalid_operation
-ddxor785 xor -Inf 1 -> NaN Invalid_operation
-ddxor786 xor -Inf 1000 -> NaN Invalid_operation
-ddxor787 xor -1000 -Inf -> NaN Invalid_operation
-ddxor788 xor -Inf -Inf -> NaN Invalid_operation
-ddxor789 xor -1 -Inf -> NaN Invalid_operation
-ddxor790 xor -0 -Inf -> NaN Invalid_operation
-ddxor791 xor 0 -Inf -> NaN Invalid_operation
-ddxor792 xor 1 -Inf -> NaN Invalid_operation
-ddxor793 xor 1000 -Inf -> NaN Invalid_operation
-ddxor794 xor Inf -Inf -> NaN Invalid_operation
-
-ddxor800 xor Inf -Inf -> NaN Invalid_operation
-ddxor801 xor Inf -1000 -> NaN Invalid_operation
-ddxor802 xor Inf -1 -> NaN Invalid_operation
-ddxor803 xor Inf -0 -> NaN Invalid_operation
-ddxor804 xor Inf 0 -> NaN Invalid_operation
-ddxor805 xor Inf 1 -> NaN Invalid_operation
-ddxor806 xor Inf 1000 -> NaN Invalid_operation
-ddxor807 xor Inf Inf -> NaN Invalid_operation
-ddxor808 xor -1000 Inf -> NaN Invalid_operation
-ddxor809 xor -Inf Inf -> NaN Invalid_operation
-ddxor810 xor -1 Inf -> NaN Invalid_operation
-ddxor811 xor -0 Inf -> NaN Invalid_operation
-ddxor812 xor 0 Inf -> NaN Invalid_operation
-ddxor813 xor 1 Inf -> NaN Invalid_operation
-ddxor814 xor 1000 Inf -> NaN Invalid_operation
-ddxor815 xor Inf Inf -> NaN Invalid_operation
-
-ddxor821 xor NaN -Inf -> NaN Invalid_operation
-ddxor822 xor NaN -1000 -> NaN Invalid_operation
-ddxor823 xor NaN -1 -> NaN Invalid_operation
-ddxor824 xor NaN -0 -> NaN Invalid_operation
-ddxor825 xor NaN 0 -> NaN Invalid_operation
-ddxor826 xor NaN 1 -> NaN Invalid_operation
-ddxor827 xor NaN 1000 -> NaN Invalid_operation
-ddxor828 xor NaN Inf -> NaN Invalid_operation
-ddxor829 xor NaN NaN -> NaN Invalid_operation
-ddxor830 xor -Inf NaN -> NaN Invalid_operation
-ddxor831 xor -1000 NaN -> NaN Invalid_operation
-ddxor832 xor -1 NaN -> NaN Invalid_operation
-ddxor833 xor -0 NaN -> NaN Invalid_operation
-ddxor834 xor 0 NaN -> NaN Invalid_operation
-ddxor835 xor 1 NaN -> NaN Invalid_operation
-ddxor836 xor 1000 NaN -> NaN Invalid_operation
-ddxor837 xor Inf NaN -> NaN Invalid_operation
-
-ddxor841 xor sNaN -Inf -> NaN Invalid_operation
-ddxor842 xor sNaN -1000 -> NaN Invalid_operation
-ddxor843 xor sNaN -1 -> NaN Invalid_operation
-ddxor844 xor sNaN -0 -> NaN Invalid_operation
-ddxor845 xor sNaN 0 -> NaN Invalid_operation
-ddxor846 xor sNaN 1 -> NaN Invalid_operation
-ddxor847 xor sNaN 1000 -> NaN Invalid_operation
-ddxor848 xor sNaN NaN -> NaN Invalid_operation
-ddxor849 xor sNaN sNaN -> NaN Invalid_operation
-ddxor850 xor NaN sNaN -> NaN Invalid_operation
-ddxor851 xor -Inf sNaN -> NaN Invalid_operation
-ddxor852 xor -1000 sNaN -> NaN Invalid_operation
-ddxor853 xor -1 sNaN -> NaN Invalid_operation
-ddxor854 xor -0 sNaN -> NaN Invalid_operation
-ddxor855 xor 0 sNaN -> NaN Invalid_operation
-ddxor856 xor 1 sNaN -> NaN Invalid_operation
-ddxor857 xor 1000 sNaN -> NaN Invalid_operation
-ddxor858 xor Inf sNaN -> NaN Invalid_operation
-ddxor859 xor NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddxor861 xor NaN1 -Inf -> NaN Invalid_operation
-ddxor862 xor +NaN2 -1000 -> NaN Invalid_operation
-ddxor863 xor NaN3 1000 -> NaN Invalid_operation
-ddxor864 xor NaN4 Inf -> NaN Invalid_operation
-ddxor865 xor NaN5 +NaN6 -> NaN Invalid_operation
-ddxor866 xor -Inf NaN7 -> NaN Invalid_operation
-ddxor867 xor -1000 NaN8 -> NaN Invalid_operation
-ddxor868 xor 1000 NaN9 -> NaN Invalid_operation
-ddxor869 xor Inf +NaN10 -> NaN Invalid_operation
-ddxor871 xor sNaN11 -Inf -> NaN Invalid_operation
-ddxor872 xor sNaN12 -1000 -> NaN Invalid_operation
-ddxor873 xor sNaN13 1000 -> NaN Invalid_operation
-ddxor874 xor sNaN14 NaN17 -> NaN Invalid_operation
-ddxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation
-ddxor876 xor NaN16 sNaN19 -> NaN Invalid_operation
-ddxor877 xor -Inf +sNaN20 -> NaN Invalid_operation
-ddxor878 xor -1000 sNaN21 -> NaN Invalid_operation
-ddxor879 xor 1000 sNaN22 -> NaN Invalid_operation
-ddxor880 xor Inf sNaN23 -> NaN Invalid_operation
-ddxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
-ddxor882 xor -NaN26 NaN28 -> NaN Invalid_operation
-ddxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
-ddxor884 xor 1000 -NaN30 -> NaN Invalid_operation
-ddxor885 xor 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddXor.decTest -- digitwise logical XOR for decDoubles --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check (truth table)
+ddxor001 xor 0 0 -> 0
+ddxor002 xor 0 1 -> 1
+ddxor003 xor 1 0 -> 1
+ddxor004 xor 1 1 -> 0
+ddxor005 xor 1100 1010 -> 110
+-- and at msd and msd-1
+ddxor006 xor 0000000000000000 0000000000000000 -> 0
+ddxor007 xor 0000000000000000 1000000000000000 -> 1000000000000000
+ddxor008 xor 1000000000000000 0000000000000000 -> 1000000000000000
+ddxor009 xor 1000000000000000 1000000000000000 -> 0
+ddxor010 xor 0000000000000000 0000000000000000 -> 0
+ddxor011 xor 0000000000000000 0100000000000000 -> 100000000000000
+ddxor012 xor 0100000000000000 0000000000000000 -> 100000000000000
+ddxor013 xor 0100000000000000 0100000000000000 -> 0
+
+-- Various lengths
+-- 1234567890123456 1234567890123456 1234567890123456
+ddxor021 xor 1111111110000000 1111111110000000 -> 0
+ddxor022 xor 111111110000000 111111110000000 -> 0
+ddxor023 xor 11111110000000 11111110000000 -> 0
+ddxor024 xor 1111110000000 1111110000000 -> 0
+ddxor025 xor 111110000000 111110000000 -> 0
+ddxor026 xor 11110000000 11110000000 -> 0
+ddxor027 xor 1110000000 1110000000 -> 0
+ddxor028 xor 110000000 110000000 -> 0
+ddxor029 xor 10000000 10000000 -> 0
+ddxor030 xor 1000000 1000000 -> 0
+ddxor031 xor 100000 100000 -> 0
+ddxor032 xor 10000 10000 -> 0
+ddxor033 xor 1000 1000 -> 0
+ddxor034 xor 100 100 -> 0
+ddxor035 xor 10 10 -> 0
+ddxor036 xor 1 1 -> 0
+
+ddxor040 xor 111111111 111111111111 -> 111000000000
+ddxor041 xor 11111111 111111111111 -> 111100000000
+ddxor042 xor 11111111 111111111 -> 100000000
+ddxor043 xor 1111111 100000010 -> 101111101
+ddxor044 xor 111111 100000100 -> 100111011
+ddxor045 xor 11111 100001000 -> 100010111
+ddxor046 xor 1111 100010000 -> 100011111
+ddxor047 xor 111 100100000 -> 100100111
+ddxor048 xor 11 101000000 -> 101000011
+ddxor049 xor 1 110000000 -> 110000001
+
+ddxor050 xor 1111111111 1 -> 1111111110
+ddxor051 xor 111111111 1 -> 111111110
+ddxor052 xor 11111111 1 -> 11111110
+ddxor053 xor 1111111 1 -> 1111110
+ddxor054 xor 111111 1 -> 111110
+ddxor055 xor 11111 1 -> 11110
+ddxor056 xor 1111 1 -> 1110
+ddxor057 xor 111 1 -> 110
+ddxor058 xor 11 1 -> 10
+ddxor059 xor 1 1 -> 0
+
+ddxor060 xor 1111111111 0 -> 1111111111
+ddxor061 xor 111111111 0 -> 111111111
+ddxor062 xor 11111111 0 -> 11111111
+ddxor063 xor 1111111 0 -> 1111111
+ddxor064 xor 111111 0 -> 111111
+ddxor065 xor 11111 0 -> 11111
+ddxor066 xor 1111 0 -> 1111
+ddxor067 xor 111 0 -> 111
+ddxor068 xor 11 0 -> 11
+ddxor069 xor 1 0 -> 1
+
+ddxor070 xor 1 1111111111 -> 1111111110
+ddxor071 xor 1 111111111 -> 111111110
+ddxor072 xor 1 11111111 -> 11111110
+ddxor073 xor 1 1111111 -> 1111110
+ddxor074 xor 1 111111 -> 111110
+ddxor075 xor 1 11111 -> 11110
+ddxor076 xor 1 1111 -> 1110
+ddxor077 xor 1 111 -> 110
+ddxor078 xor 1 11 -> 10
+ddxor079 xor 1 1 -> 0
+
+ddxor080 xor 0 1111111111 -> 1111111111
+ddxor081 xor 0 111111111 -> 111111111
+ddxor082 xor 0 11111111 -> 11111111
+ddxor083 xor 0 1111111 -> 1111111
+ddxor084 xor 0 111111 -> 111111
+ddxor085 xor 0 11111 -> 11111
+ddxor086 xor 0 1111 -> 1111
+ddxor087 xor 0 111 -> 111
+ddxor088 xor 0 11 -> 11
+ddxor089 xor 0 1 -> 1
+
+ddxor090 xor 011111111 111101111 -> 100010000
+ddxor091 xor 101111111 111101111 -> 10010000
+ddxor092 xor 110111111 111101111 -> 1010000
+ddxor093 xor 111011111 111101111 -> 110000
+ddxor094 xor 111101111 111101111 -> 0
+ddxor095 xor 111110111 111101111 -> 11000
+ddxor096 xor 111111011 111101111 -> 10100
+ddxor097 xor 111111101 111101111 -> 10010
+ddxor098 xor 111111110 111101111 -> 10001
+
+ddxor100 xor 111101111 011111111 -> 100010000
+ddxor101 xor 111101111 101111111 -> 10010000
+ddxor102 xor 111101111 110111111 -> 1010000
+ddxor103 xor 111101111 111011111 -> 110000
+ddxor104 xor 111101111 111101111 -> 0
+ddxor105 xor 111101111 111110111 -> 11000
+ddxor106 xor 111101111 111111011 -> 10100
+ddxor107 xor 111101111 111111101 -> 10010
+ddxor108 xor 111101111 111111110 -> 10001
+
+-- non-0/1 should not be accepted, nor should signs
+ddxor220 xor 111111112 111111111 -> NaN Invalid_operation
+ddxor221 xor 333333333 333333333 -> NaN Invalid_operation
+ddxor222 xor 555555555 555555555 -> NaN Invalid_operation
+ddxor223 xor 777777777 777777777 -> NaN Invalid_operation
+ddxor224 xor 999999999 999999999 -> NaN Invalid_operation
+ddxor225 xor 222222222 999999999 -> NaN Invalid_operation
+ddxor226 xor 444444444 999999999 -> NaN Invalid_operation
+ddxor227 xor 666666666 999999999 -> NaN Invalid_operation
+ddxor228 xor 888888888 999999999 -> NaN Invalid_operation
+ddxor229 xor 999999999 222222222 -> NaN Invalid_operation
+ddxor230 xor 999999999 444444444 -> NaN Invalid_operation
+ddxor231 xor 999999999 666666666 -> NaN Invalid_operation
+ddxor232 xor 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+ddxor240 xor 567468689 -934981942 -> NaN Invalid_operation
+ddxor241 xor 567367689 934981942 -> NaN Invalid_operation
+ddxor242 xor -631917772 -706014634 -> NaN Invalid_operation
+ddxor243 xor -756253257 138579234 -> NaN Invalid_operation
+ddxor244 xor 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+ddxor250 xor 2000000000000000 1000000000000000 -> NaN Invalid_operation
+ddxor251 xor 7000000000000000 1000000000000000 -> NaN Invalid_operation
+ddxor252 xor 8000000000000000 1000000000000000 -> NaN Invalid_operation
+ddxor253 xor 9000000000000000 1000000000000000 -> NaN Invalid_operation
+ddxor254 xor 2000000000000000 0000000000000000 -> NaN Invalid_operation
+ddxor255 xor 7000000000000000 0000000000000000 -> NaN Invalid_operation
+ddxor256 xor 8000000000000000 0000000000000000 -> NaN Invalid_operation
+ddxor257 xor 9000000000000000 0000000000000000 -> NaN Invalid_operation
+ddxor258 xor 1000000000000000 2000000000000000 -> NaN Invalid_operation
+ddxor259 xor 1000000000000000 7000000000000000 -> NaN Invalid_operation
+ddxor260 xor 1000000000000000 8000000000000000 -> NaN Invalid_operation
+ddxor261 xor 1000000000000000 9000000000000000 -> NaN Invalid_operation
+ddxor262 xor 0000000000000000 2000000000000000 -> NaN Invalid_operation
+ddxor263 xor 0000000000000000 7000000000000000 -> NaN Invalid_operation
+ddxor264 xor 0000000000000000 8000000000000000 -> NaN Invalid_operation
+ddxor265 xor 0000000000000000 9000000000000000 -> NaN Invalid_operation
+-- test MSD-1
+ddxor270 xor 0200001000000000 1000100000000010 -> NaN Invalid_operation
+ddxor271 xor 0700000100000000 1000010000000100 -> NaN Invalid_operation
+ddxor272 xor 0800000010000000 1000001000001000 -> NaN Invalid_operation
+ddxor273 xor 0900000001000000 1000000100010000 -> NaN Invalid_operation
+ddxor274 xor 1000000000100000 0200000010100000 -> NaN Invalid_operation
+ddxor275 xor 1000000000010000 0700000001000000 -> NaN Invalid_operation
+ddxor276 xor 1000000000001000 0800000010100000 -> NaN Invalid_operation
+ddxor277 xor 1000000000000100 0900000000010000 -> NaN Invalid_operation
+-- test LSD
+ddxor280 xor 0010000000000002 1000000100000001 -> NaN Invalid_operation
+ddxor281 xor 0001000000000007 1000001000000011 -> NaN Invalid_operation
+ddxor282 xor 0000100000000008 1000010000000001 -> NaN Invalid_operation
+ddxor283 xor 0000010000000009 1000100000000001 -> NaN Invalid_operation
+ddxor284 xor 1000001000000000 0001000000000002 -> NaN Invalid_operation
+ddxor285 xor 1000000100000000 0010000000000007 -> NaN Invalid_operation
+ddxor286 xor 1000000010000000 0100000000000008 -> NaN Invalid_operation
+ddxor287 xor 1000000001000000 1000000000000009 -> NaN Invalid_operation
+-- test Middie
+ddxor288 xor 0010000020000000 1000001000000000 -> NaN Invalid_operation
+ddxor289 xor 0001000070000001 1000000100000000 -> NaN Invalid_operation
+ddxor290 xor 0000100080000010 1000000010000000 -> NaN Invalid_operation
+ddxor291 xor 0000010090000100 1000000001000000 -> NaN Invalid_operation
+ddxor292 xor 1000001000001000 0000000020100000 -> NaN Invalid_operation
+ddxor293 xor 1000000100010000 0000000070010000 -> NaN Invalid_operation
+ddxor294 xor 1000000010100000 0000000080001000 -> NaN Invalid_operation
+ddxor295 xor 1000000001000000 0000000090000100 -> NaN Invalid_operation
+-- signs
+ddxor296 xor -1000000001000000 -0000010000000100 -> NaN Invalid_operation
+ddxor297 xor -1000000001000000 0000000010000100 -> NaN Invalid_operation
+ddxor298 xor 1000000001000000 -0000001000000100 -> NaN Invalid_operation
+ddxor299 xor 1000000001000000 0000000011000100 -> 1000000010000100
+
+-- Nmax, Nmin, Ntiny-like
+ddxor331 xor 2 9.99999999E+299 -> NaN Invalid_operation
+ddxor332 xor 3 1E-299 -> NaN Invalid_operation
+ddxor333 xor 4 1.00000000E-299 -> NaN Invalid_operation
+ddxor334 xor 5 1E-200 -> NaN Invalid_operation
+ddxor335 xor 6 -1E-200 -> NaN Invalid_operation
+ddxor336 xor 7 -1.00000000E-299 -> NaN Invalid_operation
+ddxor337 xor 8 -1E-299 -> NaN Invalid_operation
+ddxor338 xor 9 -9.99999999E+299 -> NaN Invalid_operation
+ddxor341 xor 9.99999999E+299 -18 -> NaN Invalid_operation
+ddxor342 xor 1E-299 01 -> NaN Invalid_operation
+ddxor343 xor 1.00000000E-299 -18 -> NaN Invalid_operation
+ddxor344 xor 1E-208 18 -> NaN Invalid_operation
+ddxor345 xor -1E-207 -10 -> NaN Invalid_operation
+ddxor346 xor -1.00000000E-299 18 -> NaN Invalid_operation
+ddxor347 xor -1E-299 10 -> NaN Invalid_operation
+ddxor348 xor -9.99999999E+299 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+ddxor361 xor 1.0 1 -> NaN Invalid_operation
+ddxor362 xor 1E+1 1 -> NaN Invalid_operation
+ddxor363 xor 0.0 1 -> NaN Invalid_operation
+ddxor364 xor 0E+1 1 -> NaN Invalid_operation
+ddxor365 xor 9.9 1 -> NaN Invalid_operation
+ddxor366 xor 9E+1 1 -> NaN Invalid_operation
+ddxor371 xor 0 1.0 -> NaN Invalid_operation
+ddxor372 xor 0 1E+1 -> NaN Invalid_operation
+ddxor373 xor 0 0.0 -> NaN Invalid_operation
+ddxor374 xor 0 0E+1 -> NaN Invalid_operation
+ddxor375 xor 0 9.9 -> NaN Invalid_operation
+ddxor376 xor 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+ddxor780 xor -Inf -Inf -> NaN Invalid_operation
+ddxor781 xor -Inf -1000 -> NaN Invalid_operation
+ddxor782 xor -Inf -1 -> NaN Invalid_operation
+ddxor783 xor -Inf -0 -> NaN Invalid_operation
+ddxor784 xor -Inf 0 -> NaN Invalid_operation
+ddxor785 xor -Inf 1 -> NaN Invalid_operation
+ddxor786 xor -Inf 1000 -> NaN Invalid_operation
+ddxor787 xor -1000 -Inf -> NaN Invalid_operation
+ddxor788 xor -Inf -Inf -> NaN Invalid_operation
+ddxor789 xor -1 -Inf -> NaN Invalid_operation
+ddxor790 xor -0 -Inf -> NaN Invalid_operation
+ddxor791 xor 0 -Inf -> NaN Invalid_operation
+ddxor792 xor 1 -Inf -> NaN Invalid_operation
+ddxor793 xor 1000 -Inf -> NaN Invalid_operation
+ddxor794 xor Inf -Inf -> NaN Invalid_operation
+
+ddxor800 xor Inf -Inf -> NaN Invalid_operation
+ddxor801 xor Inf -1000 -> NaN Invalid_operation
+ddxor802 xor Inf -1 -> NaN Invalid_operation
+ddxor803 xor Inf -0 -> NaN Invalid_operation
+ddxor804 xor Inf 0 -> NaN Invalid_operation
+ddxor805 xor Inf 1 -> NaN Invalid_operation
+ddxor806 xor Inf 1000 -> NaN Invalid_operation
+ddxor807 xor Inf Inf -> NaN Invalid_operation
+ddxor808 xor -1000 Inf -> NaN Invalid_operation
+ddxor809 xor -Inf Inf -> NaN Invalid_operation
+ddxor810 xor -1 Inf -> NaN Invalid_operation
+ddxor811 xor -0 Inf -> NaN Invalid_operation
+ddxor812 xor 0 Inf -> NaN Invalid_operation
+ddxor813 xor 1 Inf -> NaN Invalid_operation
+ddxor814 xor 1000 Inf -> NaN Invalid_operation
+ddxor815 xor Inf Inf -> NaN Invalid_operation
+
+ddxor821 xor NaN -Inf -> NaN Invalid_operation
+ddxor822 xor NaN -1000 -> NaN Invalid_operation
+ddxor823 xor NaN -1 -> NaN Invalid_operation
+ddxor824 xor NaN -0 -> NaN Invalid_operation
+ddxor825 xor NaN 0 -> NaN Invalid_operation
+ddxor826 xor NaN 1 -> NaN Invalid_operation
+ddxor827 xor NaN 1000 -> NaN Invalid_operation
+ddxor828 xor NaN Inf -> NaN Invalid_operation
+ddxor829 xor NaN NaN -> NaN Invalid_operation
+ddxor830 xor -Inf NaN -> NaN Invalid_operation
+ddxor831 xor -1000 NaN -> NaN Invalid_operation
+ddxor832 xor -1 NaN -> NaN Invalid_operation
+ddxor833 xor -0 NaN -> NaN Invalid_operation
+ddxor834 xor 0 NaN -> NaN Invalid_operation
+ddxor835 xor 1 NaN -> NaN Invalid_operation
+ddxor836 xor 1000 NaN -> NaN Invalid_operation
+ddxor837 xor Inf NaN -> NaN Invalid_operation
+
+ddxor841 xor sNaN -Inf -> NaN Invalid_operation
+ddxor842 xor sNaN -1000 -> NaN Invalid_operation
+ddxor843 xor sNaN -1 -> NaN Invalid_operation
+ddxor844 xor sNaN -0 -> NaN Invalid_operation
+ddxor845 xor sNaN 0 -> NaN Invalid_operation
+ddxor846 xor sNaN 1 -> NaN Invalid_operation
+ddxor847 xor sNaN 1000 -> NaN Invalid_operation
+ddxor848 xor sNaN NaN -> NaN Invalid_operation
+ddxor849 xor sNaN sNaN -> NaN Invalid_operation
+ddxor850 xor NaN sNaN -> NaN Invalid_operation
+ddxor851 xor -Inf sNaN -> NaN Invalid_operation
+ddxor852 xor -1000 sNaN -> NaN Invalid_operation
+ddxor853 xor -1 sNaN -> NaN Invalid_operation
+ddxor854 xor -0 sNaN -> NaN Invalid_operation
+ddxor855 xor 0 sNaN -> NaN Invalid_operation
+ddxor856 xor 1 sNaN -> NaN Invalid_operation
+ddxor857 xor 1000 sNaN -> NaN Invalid_operation
+ddxor858 xor Inf sNaN -> NaN Invalid_operation
+ddxor859 xor NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddxor861 xor NaN1 -Inf -> NaN Invalid_operation
+ddxor862 xor +NaN2 -1000 -> NaN Invalid_operation
+ddxor863 xor NaN3 1000 -> NaN Invalid_operation
+ddxor864 xor NaN4 Inf -> NaN Invalid_operation
+ddxor865 xor NaN5 +NaN6 -> NaN Invalid_operation
+ddxor866 xor -Inf NaN7 -> NaN Invalid_operation
+ddxor867 xor -1000 NaN8 -> NaN Invalid_operation
+ddxor868 xor 1000 NaN9 -> NaN Invalid_operation
+ddxor869 xor Inf +NaN10 -> NaN Invalid_operation
+ddxor871 xor sNaN11 -Inf -> NaN Invalid_operation
+ddxor872 xor sNaN12 -1000 -> NaN Invalid_operation
+ddxor873 xor sNaN13 1000 -> NaN Invalid_operation
+ddxor874 xor sNaN14 NaN17 -> NaN Invalid_operation
+ddxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation
+ddxor876 xor NaN16 sNaN19 -> NaN Invalid_operation
+ddxor877 xor -Inf +sNaN20 -> NaN Invalid_operation
+ddxor878 xor -1000 sNaN21 -> NaN Invalid_operation
+ddxor879 xor 1000 sNaN22 -> NaN Invalid_operation
+ddxor880 xor Inf sNaN23 -> NaN Invalid_operation
+ddxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
+ddxor882 xor -NaN26 NaN28 -> NaN Invalid_operation
+ddxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
+ddxor884 xor 1000 -NaN30 -> NaN Invalid_operation
+ddxor885 xor 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqAbs.decTest b/Lib/test/decimaltestdata/dqAbs.decTest
index baaa063bbc..f9119a9e79 100644
--- a/Lib/test/decimaltestdata/dqAbs.decTest
+++ b/Lib/test/decimaltestdata/dqAbs.decTest
@@ -1,126 +1,126 @@
-------------------------------------------------------------------------
--- dqAbs.decTest -- decQuad absolute value, heeding sNaN --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqabs001 abs '1' -> '1'
-dqabs002 abs '-1' -> '1'
-dqabs003 abs '1.00' -> '1.00'
-dqabs004 abs '-1.00' -> '1.00'
-dqabs005 abs '0' -> '0'
-dqabs006 abs '0.00' -> '0.00'
-dqabs007 abs '00.0' -> '0.0'
-dqabs008 abs '00.00' -> '0.00'
-dqabs009 abs '00' -> '0'
-
-dqabs010 abs '-2' -> '2'
-dqabs011 abs '2' -> '2'
-dqabs012 abs '-2.00' -> '2.00'
-dqabs013 abs '2.00' -> '2.00'
-dqabs014 abs '-0' -> '0'
-dqabs015 abs '-0.00' -> '0.00'
-dqabs016 abs '-00.0' -> '0.0'
-dqabs017 abs '-00.00' -> '0.00'
-dqabs018 abs '-00' -> '0'
-
-dqabs020 abs '-2000000' -> '2000000'
-dqabs021 abs '2000000' -> '2000000'
-
-dqabs030 abs '+0.1' -> '0.1'
-dqabs031 abs '-0.1' -> '0.1'
-dqabs032 abs '+0.01' -> '0.01'
-dqabs033 abs '-0.01' -> '0.01'
-dqabs034 abs '+0.001' -> '0.001'
-dqabs035 abs '-0.001' -> '0.001'
-dqabs036 abs '+0.000001' -> '0.000001'
-dqabs037 abs '-0.000001' -> '0.000001'
-dqabs038 abs '+0.000000000001' -> '1E-12'
-dqabs039 abs '-0.000000000001' -> '1E-12'
-
--- examples from decArith
-dqabs040 abs '2.1' -> '2.1'
-dqabs041 abs '-100' -> '100'
-dqabs042 abs '101.5' -> '101.5'
-dqabs043 abs '-101.5' -> '101.5'
-
--- more fixed, potential LHS swaps/overlays if done by subtract 0
-dqabs060 abs '-56267E-10' -> '0.0000056267'
-dqabs061 abs '-56267E-5' -> '0.56267'
-dqabs062 abs '-56267E-2' -> '562.67'
-dqabs063 abs '-56267E-1' -> '5626.7'
-dqabs065 abs '-56267E-0' -> '56267'
-
--- subnormals and underflow
-
--- long operand tests
-dqabs321 abs 1234567890123456 -> 1234567890123456
-dqabs322 abs 12345678000 -> 12345678000
-dqabs323 abs 1234567800 -> 1234567800
-dqabs324 abs 1234567890 -> 1234567890
-dqabs325 abs 1234567891 -> 1234567891
-dqabs326 abs 12345678901 -> 12345678901
-dqabs327 abs 1234567896 -> 1234567896
-
--- zeros
-dqabs111 abs 0 -> 0
-dqabs112 abs -0 -> 0
-dqabs113 abs 0E+6 -> 0E+6
-dqabs114 abs -0E+6 -> 0E+6
-dqabs115 abs 0.0000 -> 0.0000
-dqabs116 abs -0.0000 -> 0.0000
-dqabs117 abs 0E-141 -> 0E-141
-dqabs118 abs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqabs121 abs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqabs122 abs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqabs123 abs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-dqabs124 abs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqabs131 abs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqabs132 abs 1E-6143 -> 1E-6143
-dqabs133 abs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqabs134 abs 1E-6176 -> 1E-6176 Subnormal
-
-dqabs135 abs -1E-6176 -> 1E-6176 Subnormal
-dqabs136 abs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqabs137 abs -1E-6143 -> 1E-6143
-dqabs138 abs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-
--- specials
-dqabs520 abs 'Inf' -> 'Infinity'
-dqabs521 abs '-Inf' -> 'Infinity'
-dqabs522 abs NaN -> NaN
-dqabs523 abs sNaN -> NaN Invalid_operation
-dqabs524 abs NaN22 -> NaN22
-dqabs525 abs sNaN33 -> NaN33 Invalid_operation
-dqabs526 abs -NaN22 -> -NaN22
-dqabs527 abs -sNaN33 -> -NaN33 Invalid_operation
-
--- Null tests
-dqabs900 abs # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqAbs.decTest -- decQuad absolute value, heeding sNaN --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqabs001 abs '1' -> '1'
+dqabs002 abs '-1' -> '1'
+dqabs003 abs '1.00' -> '1.00'
+dqabs004 abs '-1.00' -> '1.00'
+dqabs005 abs '0' -> '0'
+dqabs006 abs '0.00' -> '0.00'
+dqabs007 abs '00.0' -> '0.0'
+dqabs008 abs '00.00' -> '0.00'
+dqabs009 abs '00' -> '0'
+
+dqabs010 abs '-2' -> '2'
+dqabs011 abs '2' -> '2'
+dqabs012 abs '-2.00' -> '2.00'
+dqabs013 abs '2.00' -> '2.00'
+dqabs014 abs '-0' -> '0'
+dqabs015 abs '-0.00' -> '0.00'
+dqabs016 abs '-00.0' -> '0.0'
+dqabs017 abs '-00.00' -> '0.00'
+dqabs018 abs '-00' -> '0'
+
+dqabs020 abs '-2000000' -> '2000000'
+dqabs021 abs '2000000' -> '2000000'
+
+dqabs030 abs '+0.1' -> '0.1'
+dqabs031 abs '-0.1' -> '0.1'
+dqabs032 abs '+0.01' -> '0.01'
+dqabs033 abs '-0.01' -> '0.01'
+dqabs034 abs '+0.001' -> '0.001'
+dqabs035 abs '-0.001' -> '0.001'
+dqabs036 abs '+0.000001' -> '0.000001'
+dqabs037 abs '-0.000001' -> '0.000001'
+dqabs038 abs '+0.000000000001' -> '1E-12'
+dqabs039 abs '-0.000000000001' -> '1E-12'
+
+-- examples from decArith
+dqabs040 abs '2.1' -> '2.1'
+dqabs041 abs '-100' -> '100'
+dqabs042 abs '101.5' -> '101.5'
+dqabs043 abs '-101.5' -> '101.5'
+
+-- more fixed, potential LHS swaps/overlays if done by subtract 0
+dqabs060 abs '-56267E-10' -> '0.0000056267'
+dqabs061 abs '-56267E-5' -> '0.56267'
+dqabs062 abs '-56267E-2' -> '562.67'
+dqabs063 abs '-56267E-1' -> '5626.7'
+dqabs065 abs '-56267E-0' -> '56267'
+
+-- subnormals and underflow
+
+-- long operand tests
+dqabs321 abs 1234567890123456 -> 1234567890123456
+dqabs322 abs 12345678000 -> 12345678000
+dqabs323 abs 1234567800 -> 1234567800
+dqabs324 abs 1234567890 -> 1234567890
+dqabs325 abs 1234567891 -> 1234567891
+dqabs326 abs 12345678901 -> 12345678901
+dqabs327 abs 1234567896 -> 1234567896
+
+-- zeros
+dqabs111 abs 0 -> 0
+dqabs112 abs -0 -> 0
+dqabs113 abs 0E+6 -> 0E+6
+dqabs114 abs -0E+6 -> 0E+6
+dqabs115 abs 0.0000 -> 0.0000
+dqabs116 abs -0.0000 -> 0.0000
+dqabs117 abs 0E-141 -> 0E-141
+dqabs118 abs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqabs121 abs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqabs122 abs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqabs123 abs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+dqabs124 abs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqabs131 abs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqabs132 abs 1E-6143 -> 1E-6143
+dqabs133 abs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqabs134 abs 1E-6176 -> 1E-6176 Subnormal
+
+dqabs135 abs -1E-6176 -> 1E-6176 Subnormal
+dqabs136 abs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqabs137 abs -1E-6143 -> 1E-6143
+dqabs138 abs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+
+-- specials
+dqabs520 abs 'Inf' -> 'Infinity'
+dqabs521 abs '-Inf' -> 'Infinity'
+dqabs522 abs NaN -> NaN
+dqabs523 abs sNaN -> NaN Invalid_operation
+dqabs524 abs NaN22 -> NaN22
+dqabs525 abs sNaN33 -> NaN33 Invalid_operation
+dqabs526 abs -NaN22 -> -NaN22
+dqabs527 abs -sNaN33 -> -NaN33 Invalid_operation
+
+-- Null tests
+dqabs900 abs # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqAdd.decTest b/Lib/test/decimaltestdata/dqAdd.decTest
index b1df77abc6..b3ad892bc1 100644
--- a/Lib/test/decimaltestdata/dqAdd.decTest
+++ b/Lib/test/decimaltestdata/dqAdd.decTest
@@ -1,1215 +1,1215 @@
-------------------------------------------------------------------------
--- dqAdd.decTest -- decQuad addition --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decQuads only; all arguments are
--- representable in a decQuad
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- [first group are 'quick confidence check']
-dqadd001 add 1 1 -> 2
-dqadd002 add 2 3 -> 5
-dqadd003 add '5.75' '3.3' -> 9.05
-dqadd004 add '5' '-3' -> 2
-dqadd005 add '-5' '-3' -> -8
-dqadd006 add '-7' '2.5' -> -4.5
-dqadd007 add '0.7' '0.3' -> 1.0
-dqadd008 add '1.25' '1.25' -> 2.50
-dqadd009 add '1.23456789' '1.00000000' -> '2.23456789'
-dqadd010 add '1.23456789' '1.00000011' -> '2.23456800'
-
--- 1234567890123456 1234567890123456
-dqadd011 add '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqadd012 add '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded
-dqadd013 add '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
-dqadd014 add '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd015 add '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd016 add '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd017 add '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd018 add '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded
-dqadd019 add '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded
-dqadd020 add '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded
-
-dqadd021 add 0 1 -> 1
-dqadd022 add 1 1 -> 2
-dqadd023 add 2 1 -> 3
-dqadd024 add 3 1 -> 4
-dqadd025 add 4 1 -> 5
-dqadd026 add 5 1 -> 6
-dqadd027 add 6 1 -> 7
-dqadd028 add 7 1 -> 8
-dqadd029 add 8 1 -> 9
-dqadd030 add 9 1 -> 10
-
--- some carrying effects
-dqadd031 add '0.9998' '0.0000' -> '0.9998'
-dqadd032 add '0.9998' '0.0001' -> '0.9999'
-dqadd033 add '0.9998' '0.0002' -> '1.0000'
-dqadd034 add '0.9998' '0.0003' -> '1.0001'
-
-dqadd035 add '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd036 add '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd037 add '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd038 add '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
-dqadd039 add '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded
-
--- symmetry:
-dqadd040 add '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd041 add '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd042 add '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd044 add '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
-dqadd045 add '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded
-
--- same, without rounding
-dqadd046 add '10000e+9' '7' -> '10000000000007'
-dqadd047 add '10000e+9' '70' -> '10000000000070'
-dqadd048 add '10000e+9' '700' -> '10000000000700'
-dqadd049 add '10000e+9' '7000' -> '10000000007000'
-dqadd050 add '10000e+9' '70000' -> '10000000070000'
-dqadd051 add '10000e+9' '700000' -> '10000000700000'
-dqadd052 add '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-dqadd053 add '12' '7.00' -> '19.00'
-dqadd054 add '1.3' '-1.07' -> '0.23'
-dqadd055 add '1.3' '-1.30' -> '0.00'
-dqadd056 add '1.3' '-2.07' -> '-0.77'
-dqadd057 add '1E+2' '1E+4' -> '1.01E+4'
-
--- leading zero preservation
-dqadd061 add 1 '0.0001' -> '1.0001'
-dqadd062 add 1 '0.00001' -> '1.00001'
-dqadd063 add 1 '0.000001' -> '1.000001'
-dqadd064 add 1 '0.0000001' -> '1.0000001'
-dqadd065 add 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-dqadd070 add 1 0 -> 1
-dqadd071 add 1 0. -> 1
-dqadd072 add 1 .0 -> 1.0
-dqadd073 add 1 0.0 -> 1.0
-dqadd074 add 1 0.00 -> 1.00
-dqadd075 add 0 1 -> 1
-dqadd076 add 0. 1 -> 1
-dqadd077 add .0 1 -> 1.0
-dqadd078 add 0.0 1 -> 1.0
-dqadd079 add 0.00 1 -> 1.00
-
--- some carries
-dqadd080 add 999999998 1 -> 999999999
-dqadd081 add 999999999 1 -> 1000000000
-dqadd082 add 99999999 1 -> 100000000
-dqadd083 add 9999999 1 -> 10000000
-dqadd084 add 999999 1 -> 1000000
-dqadd085 add 99999 1 -> 100000
-dqadd086 add 9999 1 -> 10000
-dqadd087 add 999 1 -> 1000
-dqadd088 add 99 1 -> 100
-dqadd089 add 9 1 -> 10
-
-
--- more LHS swaps
-dqadd090 add '-56267E-10' 0 -> '-0.0000056267'
-dqadd091 add '-56267E-6' 0 -> '-0.056267'
-dqadd092 add '-56267E-5' 0 -> '-0.56267'
-dqadd093 add '-56267E-4' 0 -> '-5.6267'
-dqadd094 add '-56267E-3' 0 -> '-56.267'
-dqadd095 add '-56267E-2' 0 -> '-562.67'
-dqadd096 add '-56267E-1' 0 -> '-5626.7'
-dqadd097 add '-56267E-0' 0 -> '-56267'
-dqadd098 add '-5E-10' 0 -> '-5E-10'
-dqadd099 add '-5E-7' 0 -> '-5E-7'
-dqadd100 add '-5E-6' 0 -> '-0.000005'
-dqadd101 add '-5E-5' 0 -> '-0.00005'
-dqadd102 add '-5E-4' 0 -> '-0.0005'
-dqadd103 add '-5E-1' 0 -> '-0.5'
-dqadd104 add '-5E0' 0 -> '-5'
-dqadd105 add '-5E1' 0 -> '-50'
-dqadd106 add '-5E5' 0 -> '-500000'
-dqadd107 add '-5E33' 0 -> '-5000000000000000000000000000000000'
-dqadd108 add '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
-dqadd109 add '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
-dqadd110 add '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
-dqadd111 add '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- more RHS swaps
-dqadd113 add 0 '-56267E-10' -> '-0.0000056267'
-dqadd114 add 0 '-56267E-6' -> '-0.056267'
-dqadd116 add 0 '-56267E-5' -> '-0.56267'
-dqadd117 add 0 '-56267E-4' -> '-5.6267'
-dqadd119 add 0 '-56267E-3' -> '-56.267'
-dqadd120 add 0 '-56267E-2' -> '-562.67'
-dqadd121 add 0 '-56267E-1' -> '-5626.7'
-dqadd122 add 0 '-56267E-0' -> '-56267'
-dqadd123 add 0 '-5E-10' -> '-5E-10'
-dqadd124 add 0 '-5E-7' -> '-5E-7'
-dqadd125 add 0 '-5E-6' -> '-0.000005'
-dqadd126 add 0 '-5E-5' -> '-0.00005'
-dqadd127 add 0 '-5E-4' -> '-0.0005'
-dqadd128 add 0 '-5E-1' -> '-0.5'
-dqadd129 add 0 '-5E0' -> '-5'
-dqadd130 add 0 '-5E1' -> '-50'
-dqadd131 add 0 '-5E5' -> '-500000'
-dqadd132 add 0 '-5E33' -> '-5000000000000000000000000000000000'
-dqadd133 add 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded
-dqadd134 add 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded
-dqadd135 add 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded
-dqadd136 add 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- related
-dqadd137 add 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded
-dqadd138 add -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded
-dqadd139 add '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded
-dqadd140 add '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded
-dqadd141 add 1E+29 0.0000 -> '100000000000000000000000000000.0000'
-dqadd142 add 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded
-dqadd143 add 0.000 1E+30 -> '1000000000000000000000000000000.000'
-dqadd144 add 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-dqadd146 add '00.0' 0 -> '0.0'
-dqadd147 add '0.00' 0 -> '0.00'
-dqadd148 add 0 '0.00' -> '0.00'
-dqadd149 add 0 '00.0' -> '0.0'
-dqadd150 add '00.0' '0.00' -> '0.00'
-dqadd151 add '0.00' '00.0' -> '0.00'
-dqadd152 add '3' '.3' -> '3.3'
-dqadd153 add '3.' '.3' -> '3.3'
-dqadd154 add '3.0' '.3' -> '3.3'
-dqadd155 add '3.00' '.3' -> '3.30'
-dqadd156 add '3' '3' -> '6'
-dqadd157 add '3' '+3' -> '6'
-dqadd158 add '3' '-3' -> '0'
-dqadd159 add '0.3' '-0.3' -> '0.0'
-dqadd160 add '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-dqadd161 add '1E+12' '-1' -> '999999999999'
-dqadd162 add '1E+12' '1.11' -> '1000000000001.11'
-dqadd163 add '1.11' '1E+12' -> '1000000000001.11'
-dqadd164 add '-1' '1E+12' -> '999999999999'
-dqadd165 add '7E+12' '-1' -> '6999999999999'
-dqadd166 add '7E+12' '1.11' -> '7000000000001.11'
-dqadd167 add '1.11' '7E+12' -> '7000000000001.11'
-dqadd168 add '-1' '7E+12' -> '6999999999999'
-
-rounding: half_up
-dqadd170 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd171 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd172 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd173 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded
-dqadd174 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd175 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd176 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd177 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded
-dqadd178 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd179 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd180 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd181 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd182 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd183 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-dqadd200 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd201 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd202 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd203 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd204 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd205 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd206 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd207 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd208 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd209 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd210 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd211 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd212 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd213 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd214 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd215 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd216 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd217 add '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd218 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd219 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
-
-rounding: half_even
-dqadd220 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd221 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd222 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd223 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd224 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd225 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd226 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd227 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd228 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd229 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd230 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd231 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd232 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd233 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd234 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd235 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd236 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd237 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd238 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd239 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
--- critical few with even bottom digit...
-dqadd240 add '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded
-dqadd241 add '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded
-dqadd242 add '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
-
-rounding: down
-dqadd250 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd251 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd252 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd253 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd254 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd255 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd256 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd257 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd258 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd259 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd260 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd261 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd262 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd263 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd264 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd265 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd266 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd267 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd268 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd269 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-dqadd301 add -1 1 -> 0
-dqadd302 add 0 1 -> 1
-dqadd303 add 1 1 -> 2
-dqadd304 add 12 1 -> 13
-dqadd305 add 98 1 -> 99
-dqadd306 add 99 1 -> 100
-dqadd307 add 100 1 -> 101
-dqadd308 add 101 1 -> 102
-dqadd309 add -1 -1 -> -2
-dqadd310 add 0 -1 -> -1
-dqadd311 add 1 -1 -> 0
-dqadd312 add 12 -1 -> 11
-dqadd313 add 98 -1 -> 97
-dqadd314 add 99 -1 -> 98
-dqadd315 add 100 -1 -> 99
-dqadd316 add 101 -1 -> 100
-
-dqadd321 add -0.01 0.01 -> 0.00
-dqadd322 add 0.00 0.01 -> 0.01
-dqadd323 add 0.01 0.01 -> 0.02
-dqadd324 add 0.12 0.01 -> 0.13
-dqadd325 add 0.98 0.01 -> 0.99
-dqadd326 add 0.99 0.01 -> 1.00
-dqadd327 add 1.00 0.01 -> 1.01
-dqadd328 add 1.01 0.01 -> 1.02
-dqadd329 add -0.01 -0.01 -> -0.02
-dqadd330 add 0.00 -0.01 -> -0.01
-dqadd331 add 0.01 -0.01 -> 0.00
-dqadd332 add 0.12 -0.01 -> 0.11
-dqadd333 add 0.98 -0.01 -> 0.97
-dqadd334 add 0.99 -0.01 -> 0.98
-dqadd335 add 1.00 -0.01 -> 0.99
-dqadd336 add 1.01 -0.01 -> 1.00
-
--- some more cases where adding 0 affects the coefficient
-dqadd340 add 1E+3 0 -> 1000
-dqadd341 add 1E+33 0 -> 1000000000000000000000000000000000
-dqadd342 add 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded
-dqadd343 add 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded
--- which simply follow from these cases ...
-dqadd344 add 1E+3 1 -> 1001
-dqadd345 add 1E+33 1 -> 1000000000000000000000000000000001
-dqadd346 add 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd347 add 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
-dqadd348 add 1E+3 7 -> 1007
-dqadd349 add 1E+33 7 -> 1000000000000000000000000000000007
-dqadd350 add 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded
-dqadd351 add 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
-
--- tryzeros cases
-rounding: half_up
-dqadd360 add 0E+50 10000E+1 -> 1.0000E+5
-dqadd361 add 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded
-dqadd362 add 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded
-dqadd363 add 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact
-dqadd364 add 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111
--- 1 234567890123456789012345678901234
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-dqadd370 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd371 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-rounding: half_up
-dqadd372 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd373 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-rounding: half_even
-dqadd374 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd375 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-
--- ulp replacement tests
-dqadd400 add 1 77e-32 -> 1.00000000000000000000000000000077
-dqadd401 add 1 77e-33 -> 1.000000000000000000000000000000077
-dqadd402 add 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded
-dqadd403 add 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded
-dqadd404 add 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd405 add 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd406 add 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd410 add 10 77e-32 -> 10.00000000000000000000000000000077
-dqadd411 add 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded
-dqadd412 add 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded
-dqadd413 add 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd414 add 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd415 add 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd416 add 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd420 add 77e-32 1 -> 1.00000000000000000000000000000077
-dqadd421 add 77e-33 1 -> 1.000000000000000000000000000000077
-dqadd422 add 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded
-dqadd423 add 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded
-dqadd424 add 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd425 add 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd426 add 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd430 add 77e-32 10 -> 10.00000000000000000000000000000077
-dqadd431 add 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded
-dqadd432 add 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded
-dqadd433 add 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd434 add 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd435 add 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd436 add 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-
--- fastpath boundaries
--- 1234567890123456789012345678901234
-dqadd501 add '4444444444444444444444444444444444' '5555555555555555555555555555555555' -> '9999999999999999999999999999999999'
-dqadd502 add '4444444444444444444444444444444444' '4555555555555555555555555555555555' -> '8999999999999999999999999999999999'
-dqadd503 add '4444444444444444444444444444444444' '3555555555555555555055555555555555' -> '7999999999999999999499999999999999'
-dqadd504 add '4444444444444444444444444444444444' '3955555555555555555555555555555555' -> '8399999999999999999999999999999999'
-dqadd505 add '4444444444444444444444444444444444' '4955555555555555555555555555555555' -> '9399999999999999999999999999999999'
-dqadd506 add '4444444444444444444444444444444444' '5955555555555555555555555555555555' -> 1.040000000000000000000000000000000E+34 Inexact Rounded
-dqadd511 add '344444444444444444444444444444444' '555555555555555555555555555555555' -> '899999999999999999999999999999999'
-dqadd512 add '34444444444444444444444444444444' '55555555555555555555555555555555' -> '89999999999999999999999999999999'
-dqadd513 add '3444444444444444444444444444444' '5555555555555555555555555555555' -> '8999999999999999999999999999999'
-dqadd514 add '344444444444444444444444444444' '555555555555555555555555555555' -> '899999999999999999999999999999'
-dqadd515 add '34444444444444444444444444444' '55555555555555555555555555555' -> '89999999999999999999999999999'
-dqadd516 add '3444444444444444444444444444' '5555555555555555555555555555' -> '8999999999999999999999999999'
-dqadd517 add '344444444444444444444444444' '555555555555555555555555555' -> '899999999999999999999999999'
-dqadd518 add '34444444444444444444444444' '55555555555555555555555555' -> '89999999999999999999999999'
-dqadd519 add '3444444444444444444444444' '5555555555555555555555555' -> '8999999999999999999999999'
-dqadd520 add '344444444444444444444444' '555555555555555555555555' -> '899999999999999999999999'
-dqadd521 add '34444444444444444444444' '55555555555555555555555' -> '89999999999999999999999'
-dqadd522 add '3444444444444444444444' '5555555555555555555555' -> '8999999999999999999999'
-dqadd523 add '4444444444444444444444' '3333333333333333333333' -> '7777777777777777777777'
-dqadd524 add '344444444444444444444' '555555555555555555555' -> '899999999999999999999'
-dqadd525 add '34444444444444444444' '55555555555555555555' -> '89999999999999999999'
-dqadd526 add '3444444444444444444' '5555555555555555555' -> '8999999999999999999'
-dqadd527 add '344444444444444444' '555555555555555555' -> '899999999999999999'
-dqadd528 add '34444444444444444' '55555555555555555' -> '89999999999999999'
-dqadd529 add '3444444444444444' '5555555555555555' -> '8999999999999999'
-dqadd530 add '344444444444444' '555555555555555' -> '899999999999999'
-dqadd531 add '34444444444444' '55555555555555' -> '89999999999999'
-dqadd532 add '3444444444444' '5555555555555' -> '8999999999999'
-dqadd533 add '344444444444' '555555555555' -> '899999999999'
-dqadd534 add '34444444444' '55555555555' -> '89999999999'
-dqadd535 add '3444444444' '5555555555' -> '8999999999'
-dqadd536 add '344444444' '555555555' -> '899999999'
-dqadd537 add '34444444' '55555555' -> '89999999'
-dqadd538 add '3444444' '5555555' -> '8999999'
-dqadd539 add '344444' '555555' -> '899999'
-dqadd540 add '34444' '55555' -> '89999'
-dqadd541 add '3444' '5555' -> '8999'
-dqadd542 add '344' '555' -> '899'
-dqadd543 add '34' '55' -> '89'
-dqadd544 add '3' '5' -> '8'
-
-dqadd545 add '3000004000000000000000000000000000' '3000000000000040000000000000000000' -> '6000004000000040000000000000000000'
-dqadd546 add '3000000400000000000000000000000000' '4000000000000400000000000000000000' -> '7000000400000400000000000000000000'
-dqadd547 add '3000000040000000000000000000000000' '5000000000004000000000000000000000' -> '8000000040004000000000000000000000'
-dqadd548 add '4000000004000000000000000000000000' '3000000000040000000000000000000000' -> '7000000004040000000000000000000000'
-dqadd549 add '4000000000400000000000000000000000' '4000000000400000000000000000000000' -> '8000000000800000000000000000000000'
-dqadd550 add '4000000000040000000000000000000000' '5000000004000000000000000000000000' -> '9000000004040000000000000000000000'
-dqadd551 add '5000000000004000000000000000000000' '3000000040000000000000000000000000' -> '8000000040004000000000000000000000'
-dqadd552 add '5000000000000400000000000000000000' '4000000400000000000000000000000000' -> '9000000400000400000000000000000000'
-dqadd553 add '5000000000000040000000000000000000' '5000004000000000000000000000000000' -> 1.000000400000004000000000000000000E+34 Rounded
--- check propagation
-dqadd554 add '8999999999999999999999999999999999' '0000000000000000000000000000000001' -> 9000000000000000000000000000000000
-dqadd555 add '0000000000000000000000000000000001' '8999999999999999999999999999999999' -> 9000000000000000000000000000000000
-dqadd556 add '4444444444444444444444444444444444' '4555555555555555555555555555555556' -> 9000000000000000000000000000000000
-dqadd557 add '4555555555555555555555555555555556' '4444444444444444444444444444444444' -> 9000000000000000000000000000000000
-
--- negative ulps
-dqadd6440 add 1 -77e-32 -> 0.99999999999999999999999999999923
-dqadd6441 add 1 -77e-33 -> 0.999999999999999999999999999999923
-dqadd6442 add 1 -77e-34 -> 0.9999999999999999999999999999999923
-dqadd6443 add 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded
-dqadd6444 add 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded
-dqadd6445 add 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd6446 add 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd6450 add 10 -77e-32 -> 9.99999999999999999999999999999923
-dqadd6451 add 10 -77e-33 -> 9.999999999999999999999999999999923
-dqadd6452 add 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded
-dqadd6453 add 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded
-dqadd6454 add 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd6455 add 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd6456 add 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd6460 add -77e-32 1 -> 0.99999999999999999999999999999923
-dqadd6461 add -77e-33 1 -> 0.999999999999999999999999999999923
-dqadd6462 add -77e-34 1 -> 0.9999999999999999999999999999999923
-dqadd6463 add -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded
-dqadd6464 add -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded
-dqadd6465 add -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd6466 add -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd6470 add -77e-32 10 -> 9.99999999999999999999999999999923
-dqadd6471 add -77e-33 10 -> 9.999999999999999999999999999999923
-dqadd6472 add -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded
-dqadd6473 add -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded
-dqadd6474 add -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd6475 add -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd6476 add -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-
--- negative ulps
-dqadd6480 add -1 77e-32 -> -0.99999999999999999999999999999923
-dqadd6481 add -1 77e-33 -> -0.999999999999999999999999999999923
-dqadd6482 add -1 77e-34 -> -0.9999999999999999999999999999999923
-dqadd6483 add -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded
-dqadd6484 add -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded
-dqadd6485 add -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded
-dqadd6486 add -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd6490 add -10 77e-32 -> -9.99999999999999999999999999999923
-dqadd6491 add -10 77e-33 -> -9.999999999999999999999999999999923
-dqadd6492 add -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded
-dqadd6493 add -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded
-dqadd6494 add -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd6495 add -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd6496 add -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd6500 add 77e-32 -1 -> -0.99999999999999999999999999999923
-dqadd6501 add 77e-33 -1 -> -0.999999999999999999999999999999923
-dqadd6502 add 77e-34 -1 -> -0.9999999999999999999999999999999923
-dqadd6503 add 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded
-dqadd6504 add 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded
-dqadd6505 add 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
-dqadd6506 add 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd6510 add 77e-32 -10 -> -9.99999999999999999999999999999923
-dqadd6511 add 77e-33 -10 -> -9.999999999999999999999999999999923
-dqadd6512 add 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded
-dqadd6513 add 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded
-dqadd6514 add 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd6515 add 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd6516 add 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-
--- and some more residue effects and different roundings
-rounding: half_up
-dqadd6540 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd6541 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6542 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6543 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6544 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6545 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6546 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6547 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6548 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6549 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6550 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6551 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6552 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6553 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6554 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6555 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6556 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd6557 add '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6558 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6559 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
-rounding: half_even
-dqadd6560 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd6561 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6562 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6563 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6564 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6565 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6566 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6567 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6568 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6569 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6570 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6571 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6572 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6573 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6574 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6575 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6576 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd6577 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6578 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6579 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
--- critical few with even bottom digit...
-dqadd7540 add '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded
-dqadd7541 add '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded
-dqadd7542 add '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
-
-rounding: down
-dqadd7550 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd7551 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7552 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7553 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7554 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7555 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7556 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7557 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7558 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7559 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7560 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7561 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7562 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7563 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7564 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7565 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7566 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd7567 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd7568 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd7569 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-dqadd7701 add 5.00 1.00E-3 -> 5.00100
-dqadd7702 add 00.00 0.000 -> 0.000
-dqadd7703 add 00.00 0E-3 -> 0.000
-dqadd7704 add 0E-3 00.00 -> 0.000
-
-dqadd7710 add 0E+3 00.00 -> 0.00
-dqadd7711 add 0E+3 00.0 -> 0.0
-dqadd7712 add 0E+3 00. -> 0
-dqadd7713 add 0E+3 00.E+1 -> 0E+1
-dqadd7714 add 0E+3 00.E+2 -> 0E+2
-dqadd7715 add 0E+3 00.E+3 -> 0E+3
-dqadd7716 add 0E+3 00.E+4 -> 0E+3
-dqadd7717 add 0E+3 00.E+5 -> 0E+3
-dqadd7718 add 0E+3 -00.0 -> 0.0
-dqadd7719 add 0E+3 -00. -> 0
-dqadd7731 add 0E+3 -00.E+1 -> 0E+1
-
-dqadd7720 add 00.00 0E+3 -> 0.00
-dqadd7721 add 00.0 0E+3 -> 0.0
-dqadd7722 add 00. 0E+3 -> 0
-dqadd7723 add 00.E+1 0E+3 -> 0E+1
-dqadd7724 add 00.E+2 0E+3 -> 0E+2
-dqadd7725 add 00.E+3 0E+3 -> 0E+3
-dqadd7726 add 00.E+4 0E+3 -> 0E+3
-dqadd7727 add 00.E+5 0E+3 -> 0E+3
-dqadd7728 add -00.00 0E+3 -> 0.00
-dqadd7729 add -00.0 0E+3 -> 0.0
-dqadd7730 add -00. 0E+3 -> 0
-
-dqadd7732 add 0 0 -> 0
-dqadd7733 add 0 -0 -> 0
-dqadd7734 add -0 0 -> 0
-dqadd7735 add -0 -0 -> -0 -- IEEE 754 special case
-
-dqadd7736 add 1 -1 -> 0
-dqadd7737 add -1 -1 -> -2
-dqadd7738 add 1 1 -> 2
-dqadd7739 add -1 1 -> 0
-
-dqadd7741 add 0 -1 -> -1
-dqadd7742 add -0 -1 -> -1
-dqadd7743 add 0 1 -> 1
-dqadd7744 add -0 1 -> 1
-dqadd7745 add -1 0 -> -1
-dqadd7746 add -1 -0 -> -1
-dqadd7747 add 1 0 -> 1
-dqadd7748 add 1 -0 -> 1
-
-dqadd7751 add 0.0 -1 -> -1.0
-dqadd7752 add -0.0 -1 -> -1.0
-dqadd7753 add 0.0 1 -> 1.0
-dqadd7754 add -0.0 1 -> 1.0
-dqadd7755 add -1.0 0 -> -1.0
-dqadd7756 add -1.0 -0 -> -1.0
-dqadd7757 add 1.0 0 -> 1.0
-dqadd7758 add 1.0 -0 -> 1.0
-
-dqadd7761 add 0 -1.0 -> -1.0
-dqadd7762 add -0 -1.0 -> -1.0
-dqadd7763 add 0 1.0 -> 1.0
-dqadd7764 add -0 1.0 -> 1.0
-dqadd7765 add -1 0.0 -> -1.0
-dqadd7766 add -1 -0.0 -> -1.0
-dqadd7767 add 1 0.0 -> 1.0
-dqadd7768 add 1 -0.0 -> 1.0
-
-dqadd7771 add 0.0 -1.0 -> -1.0
-dqadd7772 add -0.0 -1.0 -> -1.0
-dqadd7773 add 0.0 1.0 -> 1.0
-dqadd7774 add -0.0 1.0 -> 1.0
-dqadd7775 add -1.0 0.0 -> -1.0
-dqadd7776 add -1.0 -0.0 -> -1.0
-dqadd7777 add 1.0 0.0 -> 1.0
-dqadd7778 add 1.0 -0.0 -> 1.0
-
--- Specials
-dqadd7780 add -Inf -Inf -> -Infinity
-dqadd7781 add -Inf -1000 -> -Infinity
-dqadd7782 add -Inf -1 -> -Infinity
-dqadd7783 add -Inf -0 -> -Infinity
-dqadd7784 add -Inf 0 -> -Infinity
-dqadd7785 add -Inf 1 -> -Infinity
-dqadd7786 add -Inf 1000 -> -Infinity
-dqadd7787 add -1000 -Inf -> -Infinity
-dqadd7788 add -Inf -Inf -> -Infinity
-dqadd7789 add -1 -Inf -> -Infinity
-dqadd7790 add -0 -Inf -> -Infinity
-dqadd7791 add 0 -Inf -> -Infinity
-dqadd7792 add 1 -Inf -> -Infinity
-dqadd7793 add 1000 -Inf -> -Infinity
-dqadd7794 add Inf -Inf -> NaN Invalid_operation
-
-dqadd7800 add Inf -Inf -> NaN Invalid_operation
-dqadd7801 add Inf -1000 -> Infinity
-dqadd7802 add Inf -1 -> Infinity
-dqadd7803 add Inf -0 -> Infinity
-dqadd7804 add Inf 0 -> Infinity
-dqadd7805 add Inf 1 -> Infinity
-dqadd7806 add Inf 1000 -> Infinity
-dqadd7807 add Inf Inf -> Infinity
-dqadd7808 add -1000 Inf -> Infinity
-dqadd7809 add -Inf Inf -> NaN Invalid_operation
-dqadd7810 add -1 Inf -> Infinity
-dqadd7811 add -0 Inf -> Infinity
-dqadd7812 add 0 Inf -> Infinity
-dqadd7813 add 1 Inf -> Infinity
-dqadd7814 add 1000 Inf -> Infinity
-dqadd7815 add Inf Inf -> Infinity
-
-dqadd7821 add NaN -Inf -> NaN
-dqadd7822 add NaN -1000 -> NaN
-dqadd7823 add NaN -1 -> NaN
-dqadd7824 add NaN -0 -> NaN
-dqadd7825 add NaN 0 -> NaN
-dqadd7826 add NaN 1 -> NaN
-dqadd7827 add NaN 1000 -> NaN
-dqadd7828 add NaN Inf -> NaN
-dqadd7829 add NaN NaN -> NaN
-dqadd7830 add -Inf NaN -> NaN
-dqadd7831 add -1000 NaN -> NaN
-dqadd7832 add -1 NaN -> NaN
-dqadd7833 add -0 NaN -> NaN
-dqadd7834 add 0 NaN -> NaN
-dqadd7835 add 1 NaN -> NaN
-dqadd7836 add 1000 NaN -> NaN
-dqadd7837 add Inf NaN -> NaN
-
-dqadd7841 add sNaN -Inf -> NaN Invalid_operation
-dqadd7842 add sNaN -1000 -> NaN Invalid_operation
-dqadd7843 add sNaN -1 -> NaN Invalid_operation
-dqadd7844 add sNaN -0 -> NaN Invalid_operation
-dqadd7845 add sNaN 0 -> NaN Invalid_operation
-dqadd7846 add sNaN 1 -> NaN Invalid_operation
-dqadd7847 add sNaN 1000 -> NaN Invalid_operation
-dqadd7848 add sNaN NaN -> NaN Invalid_operation
-dqadd7849 add sNaN sNaN -> NaN Invalid_operation
-dqadd7850 add NaN sNaN -> NaN Invalid_operation
-dqadd7851 add -Inf sNaN -> NaN Invalid_operation
-dqadd7852 add -1000 sNaN -> NaN Invalid_operation
-dqadd7853 add -1 sNaN -> NaN Invalid_operation
-dqadd7854 add -0 sNaN -> NaN Invalid_operation
-dqadd7855 add 0 sNaN -> NaN Invalid_operation
-dqadd7856 add 1 sNaN -> NaN Invalid_operation
-dqadd7857 add 1000 sNaN -> NaN Invalid_operation
-dqadd7858 add Inf sNaN -> NaN Invalid_operation
-dqadd7859 add NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqadd7861 add NaN1 -Inf -> NaN1
-dqadd7862 add +NaN2 -1000 -> NaN2
-dqadd7863 add NaN3 1000 -> NaN3
-dqadd7864 add NaN4 Inf -> NaN4
-dqadd7865 add NaN5 +NaN6 -> NaN5
-dqadd7866 add -Inf NaN7 -> NaN7
-dqadd7867 add -1000 NaN8 -> NaN8
-dqadd7868 add 1000 NaN9 -> NaN9
-dqadd7869 add Inf +NaN10 -> NaN10
-dqadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation
-dqadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation
-dqadd7873 add sNaN13 1000 -> NaN13 Invalid_operation
-dqadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation
-dqadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation
-dqadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation
-dqadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation
-dqadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation
-dqadd7880 add Inf sNaN23 -> NaN23 Invalid_operation
-dqadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqadd7882 add -NaN26 NaN28 -> -NaN26
-dqadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqadd7884 add 1000 -NaN30 -> -NaN30
-dqadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Here we explore near the boundary of rounding a subnormal to Nmin
-dqadd7575 add 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal
-dqadd7576 add -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal
-
--- check overflow edge case
--- 1234567890123456
-dqadd7972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqadd7973 add 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7974 add 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7975 add 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded
-dqadd7976 add 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7977 add 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7978 add 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7979 add 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7980 add 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7981 add 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7982 add 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7983 add 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7984 add 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-
-dqadd7985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqadd7986 add -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7987 add -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7988 add -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded
-dqadd7989 add -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7990 add -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7991 add -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7992 add -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7993 add -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7994 add -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7995 add -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7996 add -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7997 add -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-dqadd71100 add 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact
-dqadd71101 add 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact
-dqadd71103 add +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact
-dqadd71104 add 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact
-dqadd71105 add 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact
-dqadd71106 add 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact
-dqadd71107 add 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact
-dqadd71108 add 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact
-dqadd71109 add 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-dqadd71110 add -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact
-dqadd71111 add -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact
-dqadd71113 add -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact
-dqadd71114 add -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact
-dqadd71115 add -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact
-dqadd71116 add -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact
-dqadd71117 add -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact
-dqadd71118 add -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact
-dqadd71119 add -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-dqadd71300 add 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71310 add 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71311 add 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71312 add 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71313 add 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71314 add 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71315 add 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71316 add 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71317 add 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71318 add 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71319 add 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71320 add 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71321 add 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71322 add 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71323 add 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71324 add 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71325 add 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71326 add 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71327 add 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71328 add 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71329 add 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71330 add 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71331 add 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71332 add 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71333 add 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71334 add 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71335 add 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71336 add 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71337 add 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71338 add 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71339 add 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-
-dqadd71340 add 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded
-dqadd71341 add 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded
-
-dqadd71349 add 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71350 add 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71351 add 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71352 add 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71353 add 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71354 add 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71355 add 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71356 add 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71357 add 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71358 add 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71359 add 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71360 add 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71361 add 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71362 add 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71363 add 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71364 add 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71365 add 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71367 add 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71368 add 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71369 add 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71370 add 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71371 add 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71372 add 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71373 add 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71374 add 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71375 add 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71376 add 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71377 add 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71378 add 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71379 add 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71380 add 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71381 add 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71382 add 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71383 add 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71384 add 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71385 add 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71386 add 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71387 add 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71388 add 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71389 add 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71390 add 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71391 add 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71392 add 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71393 add 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71394 add 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71395 add 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71396 add 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-dqadd71420 add 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345
-dqadd71421 add 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345
-dqadd71422 add 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345
-dqadd71423 add 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345
-dqadd71424 add 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345
-dqadd71425 add 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345
-dqadd71426 add 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345
-dqadd71427 add 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7
-dqadd71428 add 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8
-dqadd71429 add 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9
-dqadd71430 add 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10
-dqadd71431 add 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11
-dqadd71432 add 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12
-dqadd71433 add 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13
-dqadd71434 add 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14
-dqadd71435 add 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15
-dqadd71436 add 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16
-dqadd71437 add 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17
-dqadd71438 add 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18
-dqadd71439 add 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19
-dqadd71440 add 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20
-dqadd71441 add 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21
-dqadd71442 add 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22
-dqadd71443 add 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23
-dqadd71444 add 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24
-dqadd71445 add 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25
-dqadd71446 add 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26
-dqadd71447 add 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27
-dqadd71448 add 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28
-dqadd71449 add 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29
-dqadd71450 add 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30
-dqadd71451 add 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31
-dqadd71452 add 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32
-dqadd71453 add 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33
-dqadd71454 add 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34
-dqadd71455 add 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35
-dqadd71456 add 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36
-
--- same, reversed 0
-dqadd71460 add 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345
-dqadd71461 add 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345
-dqadd71462 add 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345
-dqadd71463 add 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345
-dqadd71464 add 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345
-dqadd71465 add 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345
-dqadd71466 add 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345
-dqadd71467 add 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7
-dqadd71468 add 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8
-dqadd71469 add 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9
-dqadd71470 add 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10
-dqadd71471 add 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11
-dqadd71472 add 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12
-dqadd71473 add 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13
-dqadd71474 add 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14
-dqadd71475 add 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15
-dqadd71476 add 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16
-dqadd71477 add 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17
-dqadd71478 add 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18
-dqadd71479 add 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19
-dqadd71480 add 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20
-dqadd71481 add 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21
-dqadd71482 add 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22
-dqadd71483 add 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23
-dqadd71484 add 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24
-dqadd71485 add 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25
-dqadd71486 add 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26
-dqadd71487 add 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27
-dqadd71488 add 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28
-dqadd71489 add 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29
-dqadd71490 add 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30
-dqadd71491 add 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31
-dqadd71492 add 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32
-dqadd71493 add 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33
-dqadd71494 add 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34
-dqadd71495 add 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35
-dqadd71496 add 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36
-
--- same, Es on the 0
-dqadd71500 add 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345
-dqadd71501 add 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345
-dqadd71502 add 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345
-dqadd71503 add 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345
-dqadd71504 add 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345
-dqadd71505 add 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345
-dqadd71506 add 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345
-dqadd71507 add 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345
-dqadd71508 add 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345
-dqadd71509 add 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345
-dqadd71510 add 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345
-dqadd71511 add 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345
-dqadd71512 add 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345
-dqadd71513 add 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345
-dqadd71514 add 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345
-dqadd71515 add 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345
-dqadd71516 add 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345
-dqadd71517 add 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345
-dqadd71518 add 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345
-dqadd71519 add 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345
-dqadd71520 add 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345
-dqadd71521 add 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345
-dqadd71522 add 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345
-dqadd71523 add 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345
-dqadd71524 add 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345
-dqadd71525 add 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345
-dqadd71526 add 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345
-dqadd71527 add 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345
-dqadd71528 add 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345
-dqadd71529 add 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345
-dqadd71530 add 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345
-dqadd71531 add 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345
-dqadd71532 add 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345
-dqadd71533 add 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345
--- next four flag Rounded because the 0 extends the result
-dqadd71534 add 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded
-dqadd71535 add 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded
-dqadd71536 add 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded
-dqadd71537 add 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-dqadd71600 add 0 0E-19 -> 0E-19
-dqadd71601 add -0 0E-19 -> 0E-19
-dqadd71602 add 0 -0E-19 -> 0E-19
-dqadd71603 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71611 add -11 11 -> 0
-dqadd71612 add 11 -11 -> 0
-
-rounding: half_down
--- exact zeros from zeros
-dqadd71620 add 0 0E-19 -> 0E-19
-dqadd71621 add -0 0E-19 -> 0E-19
-dqadd71622 add 0 -0E-19 -> 0E-19
-dqadd71623 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71631 add -11 11 -> 0
-dqadd71632 add 11 -11 -> 0
-
-rounding: half_even
--- exact zeros from zeros
-dqadd71640 add 0 0E-19 -> 0E-19
-dqadd71641 add -0 0E-19 -> 0E-19
-dqadd71642 add 0 -0E-19 -> 0E-19
-dqadd71643 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71651 add -11 11 -> 0
-dqadd71652 add 11 -11 -> 0
-
-rounding: up
--- exact zeros from zeros
-dqadd71660 add 0 0E-19 -> 0E-19
-dqadd71661 add -0 0E-19 -> 0E-19
-dqadd71662 add 0 -0E-19 -> 0E-19
-dqadd71663 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71671 add -11 11 -> 0
-dqadd71672 add 11 -11 -> 0
-
-rounding: down
--- exact zeros from zeros
-dqadd71680 add 0 0E-19 -> 0E-19
-dqadd71681 add -0 0E-19 -> 0E-19
-dqadd71682 add 0 -0E-19 -> 0E-19
-dqadd71683 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71691 add -11 11 -> 0
-dqadd71692 add 11 -11 -> 0
-
-rounding: ceiling
--- exact zeros from zeros
-dqadd71700 add 0 0E-19 -> 0E-19
-dqadd71701 add -0 0E-19 -> 0E-19
-dqadd71702 add 0 -0E-19 -> 0E-19
-dqadd71703 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71711 add -11 11 -> 0
-dqadd71712 add 11 -11 -> 0
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-dqadd71720 add 0 0E-19 -> 0E-19
-dqadd71721 add -0 0E-19 -> -0E-19 -- *
-dqadd71722 add 0 -0E-19 -> -0E-19 -- *
-dqadd71723 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71731 add -11 11 -> -0 -- *
-dqadd71732 add 11 -11 -> -0 -- *
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dqadd71741 add 130E-2 120E-2 -> 2.50
-dqadd71742 add 130E-2 12E-1 -> 2.50
-dqadd71743 add 130E-2 1E0 -> 2.30
-dqadd71744 add 1E2 1E4 -> 1.01E+4
-dqadd71745 add 130E-2 -120E-2 -> 0.10
-dqadd71746 add 130E-2 -12E-1 -> 0.10
-dqadd71747 add 130E-2 -1E0 -> 0.30
-dqadd71748 add 1E2 -1E4 -> -9.9E+3
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-dqadd75001 add 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457
-dqadd75002 add 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded
-dqadd75003 add 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75004 add 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75005 add 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75006 add 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75007 add 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75008 add 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75009 add 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75010 add 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75011 add 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75012 add 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75013 add 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75014 add 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75015 add 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75016 add 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75017 add 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75018 add 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75019 add 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75020 add 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75021 add 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded
-
--- widening second argument at gap
-dqadd75030 add 12398765432112345678945678 1 -> 12398765432112345678945679
-dqadd75031 add 12398765432112345678945678 0.1 -> 12398765432112345678945678.1
-dqadd75032 add 12398765432112345678945678 0.12 -> 12398765432112345678945678.12
-dqadd75033 add 12398765432112345678945678 0.123 -> 12398765432112345678945678.123
-dqadd75034 add 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234
-dqadd75035 add 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345
-dqadd75036 add 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456
-dqadd75037 add 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567
-dqadd75038 add 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678
-dqadd75039 add 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75040 add 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded
-dqadd75041 add 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded
-dqadd75042 add 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75043 add 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75044 add 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75045 add 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75046 add 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75047 add 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75048 add 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75049 add 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-dqadd75050 add 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded
-dqadd75051 add 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded
-dqadd75052 add 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded
-dqadd75053 add 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded
-dqadd75054 add 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded
-dqadd75055 add 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded
-dqadd75056 add 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded
-dqadd75057 add 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded
-dqadd75060 add 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded
-dqadd75061 add 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded
-dqadd75062 add 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded
-dqadd75063 add 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded
-dqadd75064 add 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded
-dqadd75065 add 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded
-dqadd75066 add 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded
-dqadd75067 add 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-dqadd75070 add 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001
-dqadd75071 add 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75072 add 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75073 add 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75074 add 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75075 add 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75076 add 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75077 add 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75078 add 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75079 add 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75080 add 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75081 add 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75082 add 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75083 add 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75084 add 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75085 add 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75086 add 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75087 add 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75088 add 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75089 add 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded
-
--- Null tests
-dqadd9990 add 10 # -> NaN Invalid_operation
-dqadd9991 add # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqAdd.decTest -- decQuad addition --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decQuads only; all arguments are
+-- representable in a decQuad
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+dqadd001 add 1 1 -> 2
+dqadd002 add 2 3 -> 5
+dqadd003 add '5.75' '3.3' -> 9.05
+dqadd004 add '5' '-3' -> 2
+dqadd005 add '-5' '-3' -> -8
+dqadd006 add '-7' '2.5' -> -4.5
+dqadd007 add '0.7' '0.3' -> 1.0
+dqadd008 add '1.25' '1.25' -> 2.50
+dqadd009 add '1.23456789' '1.00000000' -> '2.23456789'
+dqadd010 add '1.23456789' '1.00000011' -> '2.23456800'
+
+-- 1234567890123456 1234567890123456
+dqadd011 add '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqadd012 add '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded
+dqadd013 add '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
+dqadd014 add '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd015 add '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd016 add '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd017 add '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd018 add '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded
+dqadd019 add '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded
+dqadd020 add '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded
+
+dqadd021 add 0 1 -> 1
+dqadd022 add 1 1 -> 2
+dqadd023 add 2 1 -> 3
+dqadd024 add 3 1 -> 4
+dqadd025 add 4 1 -> 5
+dqadd026 add 5 1 -> 6
+dqadd027 add 6 1 -> 7
+dqadd028 add 7 1 -> 8
+dqadd029 add 8 1 -> 9
+dqadd030 add 9 1 -> 10
+
+-- some carrying effects
+dqadd031 add '0.9998' '0.0000' -> '0.9998'
+dqadd032 add '0.9998' '0.0001' -> '0.9999'
+dqadd033 add '0.9998' '0.0002' -> '1.0000'
+dqadd034 add '0.9998' '0.0003' -> '1.0001'
+
+dqadd035 add '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd036 add '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd037 add '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd038 add '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
+dqadd039 add '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded
+
+-- symmetry:
+dqadd040 add '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd041 add '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd042 add '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd044 add '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
+dqadd045 add '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded
+
+-- same, without rounding
+dqadd046 add '10000e+9' '7' -> '10000000000007'
+dqadd047 add '10000e+9' '70' -> '10000000000070'
+dqadd048 add '10000e+9' '700' -> '10000000000700'
+dqadd049 add '10000e+9' '7000' -> '10000000007000'
+dqadd050 add '10000e+9' '70000' -> '10000000070000'
+dqadd051 add '10000e+9' '700000' -> '10000000700000'
+dqadd052 add '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+dqadd053 add '12' '7.00' -> '19.00'
+dqadd054 add '1.3' '-1.07' -> '0.23'
+dqadd055 add '1.3' '-1.30' -> '0.00'
+dqadd056 add '1.3' '-2.07' -> '-0.77'
+dqadd057 add '1E+2' '1E+4' -> '1.01E+4'
+
+-- leading zero preservation
+dqadd061 add 1 '0.0001' -> '1.0001'
+dqadd062 add 1 '0.00001' -> '1.00001'
+dqadd063 add 1 '0.000001' -> '1.000001'
+dqadd064 add 1 '0.0000001' -> '1.0000001'
+dqadd065 add 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+dqadd070 add 1 0 -> 1
+dqadd071 add 1 0. -> 1
+dqadd072 add 1 .0 -> 1.0
+dqadd073 add 1 0.0 -> 1.0
+dqadd074 add 1 0.00 -> 1.00
+dqadd075 add 0 1 -> 1
+dqadd076 add 0. 1 -> 1
+dqadd077 add .0 1 -> 1.0
+dqadd078 add 0.0 1 -> 1.0
+dqadd079 add 0.00 1 -> 1.00
+
+-- some carries
+dqadd080 add 999999998 1 -> 999999999
+dqadd081 add 999999999 1 -> 1000000000
+dqadd082 add 99999999 1 -> 100000000
+dqadd083 add 9999999 1 -> 10000000
+dqadd084 add 999999 1 -> 1000000
+dqadd085 add 99999 1 -> 100000
+dqadd086 add 9999 1 -> 10000
+dqadd087 add 999 1 -> 1000
+dqadd088 add 99 1 -> 100
+dqadd089 add 9 1 -> 10
+
+
+-- more LHS swaps
+dqadd090 add '-56267E-10' 0 -> '-0.0000056267'
+dqadd091 add '-56267E-6' 0 -> '-0.056267'
+dqadd092 add '-56267E-5' 0 -> '-0.56267'
+dqadd093 add '-56267E-4' 0 -> '-5.6267'
+dqadd094 add '-56267E-3' 0 -> '-56.267'
+dqadd095 add '-56267E-2' 0 -> '-562.67'
+dqadd096 add '-56267E-1' 0 -> '-5626.7'
+dqadd097 add '-56267E-0' 0 -> '-56267'
+dqadd098 add '-5E-10' 0 -> '-5E-10'
+dqadd099 add '-5E-7' 0 -> '-5E-7'
+dqadd100 add '-5E-6' 0 -> '-0.000005'
+dqadd101 add '-5E-5' 0 -> '-0.00005'
+dqadd102 add '-5E-4' 0 -> '-0.0005'
+dqadd103 add '-5E-1' 0 -> '-0.5'
+dqadd104 add '-5E0' 0 -> '-5'
+dqadd105 add '-5E1' 0 -> '-50'
+dqadd106 add '-5E5' 0 -> '-500000'
+dqadd107 add '-5E33' 0 -> '-5000000000000000000000000000000000'
+dqadd108 add '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
+dqadd109 add '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
+dqadd110 add '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
+dqadd111 add '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- more RHS swaps
+dqadd113 add 0 '-56267E-10' -> '-0.0000056267'
+dqadd114 add 0 '-56267E-6' -> '-0.056267'
+dqadd116 add 0 '-56267E-5' -> '-0.56267'
+dqadd117 add 0 '-56267E-4' -> '-5.6267'
+dqadd119 add 0 '-56267E-3' -> '-56.267'
+dqadd120 add 0 '-56267E-2' -> '-562.67'
+dqadd121 add 0 '-56267E-1' -> '-5626.7'
+dqadd122 add 0 '-56267E-0' -> '-56267'
+dqadd123 add 0 '-5E-10' -> '-5E-10'
+dqadd124 add 0 '-5E-7' -> '-5E-7'
+dqadd125 add 0 '-5E-6' -> '-0.000005'
+dqadd126 add 0 '-5E-5' -> '-0.00005'
+dqadd127 add 0 '-5E-4' -> '-0.0005'
+dqadd128 add 0 '-5E-1' -> '-0.5'
+dqadd129 add 0 '-5E0' -> '-5'
+dqadd130 add 0 '-5E1' -> '-50'
+dqadd131 add 0 '-5E5' -> '-500000'
+dqadd132 add 0 '-5E33' -> '-5000000000000000000000000000000000'
+dqadd133 add 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded
+dqadd134 add 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded
+dqadd135 add 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded
+dqadd136 add 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- related
+dqadd137 add 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded
+dqadd138 add -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded
+dqadd139 add '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded
+dqadd140 add '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded
+dqadd141 add 1E+29 0.0000 -> '100000000000000000000000000000.0000'
+dqadd142 add 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded
+dqadd143 add 0.000 1E+30 -> '1000000000000000000000000000000.000'
+dqadd144 add 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+dqadd146 add '00.0' 0 -> '0.0'
+dqadd147 add '0.00' 0 -> '0.00'
+dqadd148 add 0 '0.00' -> '0.00'
+dqadd149 add 0 '00.0' -> '0.0'
+dqadd150 add '00.0' '0.00' -> '0.00'
+dqadd151 add '0.00' '00.0' -> '0.00'
+dqadd152 add '3' '.3' -> '3.3'
+dqadd153 add '3.' '.3' -> '3.3'
+dqadd154 add '3.0' '.3' -> '3.3'
+dqadd155 add '3.00' '.3' -> '3.30'
+dqadd156 add '3' '3' -> '6'
+dqadd157 add '3' '+3' -> '6'
+dqadd158 add '3' '-3' -> '0'
+dqadd159 add '0.3' '-0.3' -> '0.0'
+dqadd160 add '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+dqadd161 add '1E+12' '-1' -> '999999999999'
+dqadd162 add '1E+12' '1.11' -> '1000000000001.11'
+dqadd163 add '1.11' '1E+12' -> '1000000000001.11'
+dqadd164 add '-1' '1E+12' -> '999999999999'
+dqadd165 add '7E+12' '-1' -> '6999999999999'
+dqadd166 add '7E+12' '1.11' -> '7000000000001.11'
+dqadd167 add '1.11' '7E+12' -> '7000000000001.11'
+dqadd168 add '-1' '7E+12' -> '6999999999999'
+
+rounding: half_up
+dqadd170 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd171 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd172 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd173 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded
+dqadd174 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd175 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd176 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd177 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded
+dqadd178 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd179 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd180 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd181 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd182 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd183 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+dqadd200 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd201 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd202 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd203 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd204 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd205 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd206 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd207 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd208 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd209 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd210 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd211 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd212 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd213 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd214 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd215 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd216 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd217 add '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd218 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd219 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+
+rounding: half_even
+dqadd220 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd221 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd222 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd223 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd224 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd225 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd226 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd227 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd228 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd229 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd230 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd231 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd232 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd233 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd234 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd235 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd236 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd237 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd238 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd239 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+-- critical few with even bottom digit...
+dqadd240 add '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded
+dqadd241 add '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded
+dqadd242 add '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
+
+rounding: down
+dqadd250 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd251 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd252 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd253 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd254 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd255 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd256 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd257 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd258 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd259 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd260 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd261 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd262 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd263 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd264 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd265 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd266 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd267 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd268 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd269 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+dqadd301 add -1 1 -> 0
+dqadd302 add 0 1 -> 1
+dqadd303 add 1 1 -> 2
+dqadd304 add 12 1 -> 13
+dqadd305 add 98 1 -> 99
+dqadd306 add 99 1 -> 100
+dqadd307 add 100 1 -> 101
+dqadd308 add 101 1 -> 102
+dqadd309 add -1 -1 -> -2
+dqadd310 add 0 -1 -> -1
+dqadd311 add 1 -1 -> 0
+dqadd312 add 12 -1 -> 11
+dqadd313 add 98 -1 -> 97
+dqadd314 add 99 -1 -> 98
+dqadd315 add 100 -1 -> 99
+dqadd316 add 101 -1 -> 100
+
+dqadd321 add -0.01 0.01 -> 0.00
+dqadd322 add 0.00 0.01 -> 0.01
+dqadd323 add 0.01 0.01 -> 0.02
+dqadd324 add 0.12 0.01 -> 0.13
+dqadd325 add 0.98 0.01 -> 0.99
+dqadd326 add 0.99 0.01 -> 1.00
+dqadd327 add 1.00 0.01 -> 1.01
+dqadd328 add 1.01 0.01 -> 1.02
+dqadd329 add -0.01 -0.01 -> -0.02
+dqadd330 add 0.00 -0.01 -> -0.01
+dqadd331 add 0.01 -0.01 -> 0.00
+dqadd332 add 0.12 -0.01 -> 0.11
+dqadd333 add 0.98 -0.01 -> 0.97
+dqadd334 add 0.99 -0.01 -> 0.98
+dqadd335 add 1.00 -0.01 -> 0.99
+dqadd336 add 1.01 -0.01 -> 1.00
+
+-- some more cases where adding 0 affects the coefficient
+dqadd340 add 1E+3 0 -> 1000
+dqadd341 add 1E+33 0 -> 1000000000000000000000000000000000
+dqadd342 add 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded
+dqadd343 add 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded
+-- which simply follow from these cases ...
+dqadd344 add 1E+3 1 -> 1001
+dqadd345 add 1E+33 1 -> 1000000000000000000000000000000001
+dqadd346 add 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd347 add 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
+dqadd348 add 1E+3 7 -> 1007
+dqadd349 add 1E+33 7 -> 1000000000000000000000000000000007
+dqadd350 add 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded
+dqadd351 add 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
+
+-- tryzeros cases
+rounding: half_up
+dqadd360 add 0E+50 10000E+1 -> 1.0000E+5
+dqadd361 add 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded
+dqadd362 add 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded
+dqadd363 add 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact
+dqadd364 add 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111
+-- 1 234567890123456789012345678901234
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+dqadd370 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd371 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+rounding: half_up
+dqadd372 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd373 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+rounding: half_even
+dqadd374 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd375 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+
+-- ulp replacement tests
+dqadd400 add 1 77e-32 -> 1.00000000000000000000000000000077
+dqadd401 add 1 77e-33 -> 1.000000000000000000000000000000077
+dqadd402 add 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded
+dqadd403 add 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded
+dqadd404 add 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd405 add 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd406 add 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd410 add 10 77e-32 -> 10.00000000000000000000000000000077
+dqadd411 add 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded
+dqadd412 add 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded
+dqadd413 add 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd414 add 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd415 add 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd416 add 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd420 add 77e-32 1 -> 1.00000000000000000000000000000077
+dqadd421 add 77e-33 1 -> 1.000000000000000000000000000000077
+dqadd422 add 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded
+dqadd423 add 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded
+dqadd424 add 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd425 add 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd426 add 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd430 add 77e-32 10 -> 10.00000000000000000000000000000077
+dqadd431 add 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded
+dqadd432 add 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded
+dqadd433 add 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd434 add 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd435 add 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd436 add 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+-- fastpath boundaries
+-- 1234567890123456789012345678901234
+dqadd501 add '4444444444444444444444444444444444' '5555555555555555555555555555555555' -> '9999999999999999999999999999999999'
+dqadd502 add '4444444444444444444444444444444444' '4555555555555555555555555555555555' -> '8999999999999999999999999999999999'
+dqadd503 add '4444444444444444444444444444444444' '3555555555555555555055555555555555' -> '7999999999999999999499999999999999'
+dqadd504 add '4444444444444444444444444444444444' '3955555555555555555555555555555555' -> '8399999999999999999999999999999999'
+dqadd505 add '4444444444444444444444444444444444' '4955555555555555555555555555555555' -> '9399999999999999999999999999999999'
+dqadd506 add '4444444444444444444444444444444444' '5955555555555555555555555555555555' -> 1.040000000000000000000000000000000E+34 Inexact Rounded
+dqadd511 add '344444444444444444444444444444444' '555555555555555555555555555555555' -> '899999999999999999999999999999999'
+dqadd512 add '34444444444444444444444444444444' '55555555555555555555555555555555' -> '89999999999999999999999999999999'
+dqadd513 add '3444444444444444444444444444444' '5555555555555555555555555555555' -> '8999999999999999999999999999999'
+dqadd514 add '344444444444444444444444444444' '555555555555555555555555555555' -> '899999999999999999999999999999'
+dqadd515 add '34444444444444444444444444444' '55555555555555555555555555555' -> '89999999999999999999999999999'
+dqadd516 add '3444444444444444444444444444' '5555555555555555555555555555' -> '8999999999999999999999999999'
+dqadd517 add '344444444444444444444444444' '555555555555555555555555555' -> '899999999999999999999999999'
+dqadd518 add '34444444444444444444444444' '55555555555555555555555555' -> '89999999999999999999999999'
+dqadd519 add '3444444444444444444444444' '5555555555555555555555555' -> '8999999999999999999999999'
+dqadd520 add '344444444444444444444444' '555555555555555555555555' -> '899999999999999999999999'
+dqadd521 add '34444444444444444444444' '55555555555555555555555' -> '89999999999999999999999'
+dqadd522 add '3444444444444444444444' '5555555555555555555555' -> '8999999999999999999999'
+dqadd523 add '4444444444444444444444' '3333333333333333333333' -> '7777777777777777777777'
+dqadd524 add '344444444444444444444' '555555555555555555555' -> '899999999999999999999'
+dqadd525 add '34444444444444444444' '55555555555555555555' -> '89999999999999999999'
+dqadd526 add '3444444444444444444' '5555555555555555555' -> '8999999999999999999'
+dqadd527 add '344444444444444444' '555555555555555555' -> '899999999999999999'
+dqadd528 add '34444444444444444' '55555555555555555' -> '89999999999999999'
+dqadd529 add '3444444444444444' '5555555555555555' -> '8999999999999999'
+dqadd530 add '344444444444444' '555555555555555' -> '899999999999999'
+dqadd531 add '34444444444444' '55555555555555' -> '89999999999999'
+dqadd532 add '3444444444444' '5555555555555' -> '8999999999999'
+dqadd533 add '344444444444' '555555555555' -> '899999999999'
+dqadd534 add '34444444444' '55555555555' -> '89999999999'
+dqadd535 add '3444444444' '5555555555' -> '8999999999'
+dqadd536 add '344444444' '555555555' -> '899999999'
+dqadd537 add '34444444' '55555555' -> '89999999'
+dqadd538 add '3444444' '5555555' -> '8999999'
+dqadd539 add '344444' '555555' -> '899999'
+dqadd540 add '34444' '55555' -> '89999'
+dqadd541 add '3444' '5555' -> '8999'
+dqadd542 add '344' '555' -> '899'
+dqadd543 add '34' '55' -> '89'
+dqadd544 add '3' '5' -> '8'
+
+dqadd545 add '3000004000000000000000000000000000' '3000000000000040000000000000000000' -> '6000004000000040000000000000000000'
+dqadd546 add '3000000400000000000000000000000000' '4000000000000400000000000000000000' -> '7000000400000400000000000000000000'
+dqadd547 add '3000000040000000000000000000000000' '5000000000004000000000000000000000' -> '8000000040004000000000000000000000'
+dqadd548 add '4000000004000000000000000000000000' '3000000000040000000000000000000000' -> '7000000004040000000000000000000000'
+dqadd549 add '4000000000400000000000000000000000' '4000000000400000000000000000000000' -> '8000000000800000000000000000000000'
+dqadd550 add '4000000000040000000000000000000000' '5000000004000000000000000000000000' -> '9000000004040000000000000000000000'
+dqadd551 add '5000000000004000000000000000000000' '3000000040000000000000000000000000' -> '8000000040004000000000000000000000'
+dqadd552 add '5000000000000400000000000000000000' '4000000400000000000000000000000000' -> '9000000400000400000000000000000000'
+dqadd553 add '5000000000000040000000000000000000' '5000004000000000000000000000000000' -> 1.000000400000004000000000000000000E+34 Rounded
+-- check propagation
+dqadd554 add '8999999999999999999999999999999999' '0000000000000000000000000000000001' -> 9000000000000000000000000000000000
+dqadd555 add '0000000000000000000000000000000001' '8999999999999999999999999999999999' -> 9000000000000000000000000000000000
+dqadd556 add '4444444444444444444444444444444444' '4555555555555555555555555555555556' -> 9000000000000000000000000000000000
+dqadd557 add '4555555555555555555555555555555556' '4444444444444444444444444444444444' -> 9000000000000000000000000000000000
+
+-- negative ulps
+dqadd6440 add 1 -77e-32 -> 0.99999999999999999999999999999923
+dqadd6441 add 1 -77e-33 -> 0.999999999999999999999999999999923
+dqadd6442 add 1 -77e-34 -> 0.9999999999999999999999999999999923
+dqadd6443 add 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded
+dqadd6444 add 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded
+dqadd6445 add 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd6446 add 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd6450 add 10 -77e-32 -> 9.99999999999999999999999999999923
+dqadd6451 add 10 -77e-33 -> 9.999999999999999999999999999999923
+dqadd6452 add 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded
+dqadd6453 add 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded
+dqadd6454 add 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd6455 add 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd6456 add 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd6460 add -77e-32 1 -> 0.99999999999999999999999999999923
+dqadd6461 add -77e-33 1 -> 0.999999999999999999999999999999923
+dqadd6462 add -77e-34 1 -> 0.9999999999999999999999999999999923
+dqadd6463 add -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded
+dqadd6464 add -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded
+dqadd6465 add -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd6466 add -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd6470 add -77e-32 10 -> 9.99999999999999999999999999999923
+dqadd6471 add -77e-33 10 -> 9.999999999999999999999999999999923
+dqadd6472 add -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded
+dqadd6473 add -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded
+dqadd6474 add -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd6475 add -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd6476 add -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+-- negative ulps
+dqadd6480 add -1 77e-32 -> -0.99999999999999999999999999999923
+dqadd6481 add -1 77e-33 -> -0.999999999999999999999999999999923
+dqadd6482 add -1 77e-34 -> -0.9999999999999999999999999999999923
+dqadd6483 add -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded
+dqadd6484 add -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded
+dqadd6485 add -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded
+dqadd6486 add -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd6490 add -10 77e-32 -> -9.99999999999999999999999999999923
+dqadd6491 add -10 77e-33 -> -9.999999999999999999999999999999923
+dqadd6492 add -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded
+dqadd6493 add -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded
+dqadd6494 add -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd6495 add -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd6496 add -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd6500 add 77e-32 -1 -> -0.99999999999999999999999999999923
+dqadd6501 add 77e-33 -1 -> -0.999999999999999999999999999999923
+dqadd6502 add 77e-34 -1 -> -0.9999999999999999999999999999999923
+dqadd6503 add 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded
+dqadd6504 add 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded
+dqadd6505 add 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
+dqadd6506 add 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd6510 add 77e-32 -10 -> -9.99999999999999999999999999999923
+dqadd6511 add 77e-33 -10 -> -9.999999999999999999999999999999923
+dqadd6512 add 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded
+dqadd6513 add 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded
+dqadd6514 add 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd6515 add 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd6516 add 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+
+-- and some more residue effects and different roundings
+rounding: half_up
+dqadd6540 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd6541 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6542 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6543 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6544 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6545 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6546 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6547 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6548 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6549 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6550 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6551 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6552 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6553 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6554 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6555 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6556 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd6557 add '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6558 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6559 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+rounding: half_even
+dqadd6560 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd6561 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6562 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6563 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6564 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6565 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6566 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6567 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6568 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6569 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6570 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6571 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6572 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6573 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6574 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6575 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6576 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd6577 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6578 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6579 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+-- critical few with even bottom digit...
+dqadd7540 add '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded
+dqadd7541 add '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded
+dqadd7542 add '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
+
+rounding: down
+dqadd7550 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd7551 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7552 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7553 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7554 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7555 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7556 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7557 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7558 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7559 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7560 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7561 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7562 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7563 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7564 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7565 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7566 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd7567 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd7568 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd7569 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+dqadd7701 add 5.00 1.00E-3 -> 5.00100
+dqadd7702 add 00.00 0.000 -> 0.000
+dqadd7703 add 00.00 0E-3 -> 0.000
+dqadd7704 add 0E-3 00.00 -> 0.000
+
+dqadd7710 add 0E+3 00.00 -> 0.00
+dqadd7711 add 0E+3 00.0 -> 0.0
+dqadd7712 add 0E+3 00. -> 0
+dqadd7713 add 0E+3 00.E+1 -> 0E+1
+dqadd7714 add 0E+3 00.E+2 -> 0E+2
+dqadd7715 add 0E+3 00.E+3 -> 0E+3
+dqadd7716 add 0E+3 00.E+4 -> 0E+3
+dqadd7717 add 0E+3 00.E+5 -> 0E+3
+dqadd7718 add 0E+3 -00.0 -> 0.0
+dqadd7719 add 0E+3 -00. -> 0
+dqadd7731 add 0E+3 -00.E+1 -> 0E+1
+
+dqadd7720 add 00.00 0E+3 -> 0.00
+dqadd7721 add 00.0 0E+3 -> 0.0
+dqadd7722 add 00. 0E+3 -> 0
+dqadd7723 add 00.E+1 0E+3 -> 0E+1
+dqadd7724 add 00.E+2 0E+3 -> 0E+2
+dqadd7725 add 00.E+3 0E+3 -> 0E+3
+dqadd7726 add 00.E+4 0E+3 -> 0E+3
+dqadd7727 add 00.E+5 0E+3 -> 0E+3
+dqadd7728 add -00.00 0E+3 -> 0.00
+dqadd7729 add -00.0 0E+3 -> 0.0
+dqadd7730 add -00. 0E+3 -> 0
+
+dqadd7732 add 0 0 -> 0
+dqadd7733 add 0 -0 -> 0
+dqadd7734 add -0 0 -> 0
+dqadd7735 add -0 -0 -> -0 -- IEEE 754 special case
+
+dqadd7736 add 1 -1 -> 0
+dqadd7737 add -1 -1 -> -2
+dqadd7738 add 1 1 -> 2
+dqadd7739 add -1 1 -> 0
+
+dqadd7741 add 0 -1 -> -1
+dqadd7742 add -0 -1 -> -1
+dqadd7743 add 0 1 -> 1
+dqadd7744 add -0 1 -> 1
+dqadd7745 add -1 0 -> -1
+dqadd7746 add -1 -0 -> -1
+dqadd7747 add 1 0 -> 1
+dqadd7748 add 1 -0 -> 1
+
+dqadd7751 add 0.0 -1 -> -1.0
+dqadd7752 add -0.0 -1 -> -1.0
+dqadd7753 add 0.0 1 -> 1.0
+dqadd7754 add -0.0 1 -> 1.0
+dqadd7755 add -1.0 0 -> -1.0
+dqadd7756 add -1.0 -0 -> -1.0
+dqadd7757 add 1.0 0 -> 1.0
+dqadd7758 add 1.0 -0 -> 1.0
+
+dqadd7761 add 0 -1.0 -> -1.0
+dqadd7762 add -0 -1.0 -> -1.0
+dqadd7763 add 0 1.0 -> 1.0
+dqadd7764 add -0 1.0 -> 1.0
+dqadd7765 add -1 0.0 -> -1.0
+dqadd7766 add -1 -0.0 -> -1.0
+dqadd7767 add 1 0.0 -> 1.0
+dqadd7768 add 1 -0.0 -> 1.0
+
+dqadd7771 add 0.0 -1.0 -> -1.0
+dqadd7772 add -0.0 -1.0 -> -1.0
+dqadd7773 add 0.0 1.0 -> 1.0
+dqadd7774 add -0.0 1.0 -> 1.0
+dqadd7775 add -1.0 0.0 -> -1.0
+dqadd7776 add -1.0 -0.0 -> -1.0
+dqadd7777 add 1.0 0.0 -> 1.0
+dqadd7778 add 1.0 -0.0 -> 1.0
+
+-- Specials
+dqadd7780 add -Inf -Inf -> -Infinity
+dqadd7781 add -Inf -1000 -> -Infinity
+dqadd7782 add -Inf -1 -> -Infinity
+dqadd7783 add -Inf -0 -> -Infinity
+dqadd7784 add -Inf 0 -> -Infinity
+dqadd7785 add -Inf 1 -> -Infinity
+dqadd7786 add -Inf 1000 -> -Infinity
+dqadd7787 add -1000 -Inf -> -Infinity
+dqadd7788 add -Inf -Inf -> -Infinity
+dqadd7789 add -1 -Inf -> -Infinity
+dqadd7790 add -0 -Inf -> -Infinity
+dqadd7791 add 0 -Inf -> -Infinity
+dqadd7792 add 1 -Inf -> -Infinity
+dqadd7793 add 1000 -Inf -> -Infinity
+dqadd7794 add Inf -Inf -> NaN Invalid_operation
+
+dqadd7800 add Inf -Inf -> NaN Invalid_operation
+dqadd7801 add Inf -1000 -> Infinity
+dqadd7802 add Inf -1 -> Infinity
+dqadd7803 add Inf -0 -> Infinity
+dqadd7804 add Inf 0 -> Infinity
+dqadd7805 add Inf 1 -> Infinity
+dqadd7806 add Inf 1000 -> Infinity
+dqadd7807 add Inf Inf -> Infinity
+dqadd7808 add -1000 Inf -> Infinity
+dqadd7809 add -Inf Inf -> NaN Invalid_operation
+dqadd7810 add -1 Inf -> Infinity
+dqadd7811 add -0 Inf -> Infinity
+dqadd7812 add 0 Inf -> Infinity
+dqadd7813 add 1 Inf -> Infinity
+dqadd7814 add 1000 Inf -> Infinity
+dqadd7815 add Inf Inf -> Infinity
+
+dqadd7821 add NaN -Inf -> NaN
+dqadd7822 add NaN -1000 -> NaN
+dqadd7823 add NaN -1 -> NaN
+dqadd7824 add NaN -0 -> NaN
+dqadd7825 add NaN 0 -> NaN
+dqadd7826 add NaN 1 -> NaN
+dqadd7827 add NaN 1000 -> NaN
+dqadd7828 add NaN Inf -> NaN
+dqadd7829 add NaN NaN -> NaN
+dqadd7830 add -Inf NaN -> NaN
+dqadd7831 add -1000 NaN -> NaN
+dqadd7832 add -1 NaN -> NaN
+dqadd7833 add -0 NaN -> NaN
+dqadd7834 add 0 NaN -> NaN
+dqadd7835 add 1 NaN -> NaN
+dqadd7836 add 1000 NaN -> NaN
+dqadd7837 add Inf NaN -> NaN
+
+dqadd7841 add sNaN -Inf -> NaN Invalid_operation
+dqadd7842 add sNaN -1000 -> NaN Invalid_operation
+dqadd7843 add sNaN -1 -> NaN Invalid_operation
+dqadd7844 add sNaN -0 -> NaN Invalid_operation
+dqadd7845 add sNaN 0 -> NaN Invalid_operation
+dqadd7846 add sNaN 1 -> NaN Invalid_operation
+dqadd7847 add sNaN 1000 -> NaN Invalid_operation
+dqadd7848 add sNaN NaN -> NaN Invalid_operation
+dqadd7849 add sNaN sNaN -> NaN Invalid_operation
+dqadd7850 add NaN sNaN -> NaN Invalid_operation
+dqadd7851 add -Inf sNaN -> NaN Invalid_operation
+dqadd7852 add -1000 sNaN -> NaN Invalid_operation
+dqadd7853 add -1 sNaN -> NaN Invalid_operation
+dqadd7854 add -0 sNaN -> NaN Invalid_operation
+dqadd7855 add 0 sNaN -> NaN Invalid_operation
+dqadd7856 add 1 sNaN -> NaN Invalid_operation
+dqadd7857 add 1000 sNaN -> NaN Invalid_operation
+dqadd7858 add Inf sNaN -> NaN Invalid_operation
+dqadd7859 add NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqadd7861 add NaN1 -Inf -> NaN1
+dqadd7862 add +NaN2 -1000 -> NaN2
+dqadd7863 add NaN3 1000 -> NaN3
+dqadd7864 add NaN4 Inf -> NaN4
+dqadd7865 add NaN5 +NaN6 -> NaN5
+dqadd7866 add -Inf NaN7 -> NaN7
+dqadd7867 add -1000 NaN8 -> NaN8
+dqadd7868 add 1000 NaN9 -> NaN9
+dqadd7869 add Inf +NaN10 -> NaN10
+dqadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation
+dqadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation
+dqadd7873 add sNaN13 1000 -> NaN13 Invalid_operation
+dqadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation
+dqadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation
+dqadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation
+dqadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation
+dqadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation
+dqadd7880 add Inf sNaN23 -> NaN23 Invalid_operation
+dqadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqadd7882 add -NaN26 NaN28 -> -NaN26
+dqadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqadd7884 add 1000 -NaN30 -> -NaN30
+dqadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Here we explore near the boundary of rounding a subnormal to Nmin
+dqadd7575 add 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal
+dqadd7576 add -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal
+
+-- check overflow edge case
+-- 1234567890123456
+dqadd7972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqadd7973 add 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7974 add 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7975 add 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded
+dqadd7976 add 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7977 add 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7978 add 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7979 add 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7980 add 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7981 add 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7982 add 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7983 add 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7984 add 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+
+dqadd7985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqadd7986 add -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7987 add -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7988 add -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded
+dqadd7989 add -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7990 add -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7991 add -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7992 add -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7993 add -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7994 add -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7995 add -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7996 add -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7997 add -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+dqadd71100 add 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact
+dqadd71101 add 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact
+dqadd71103 add +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact
+dqadd71104 add 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact
+dqadd71105 add 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact
+dqadd71106 add 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact
+dqadd71107 add 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact
+dqadd71108 add 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact
+dqadd71109 add 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+dqadd71110 add -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact
+dqadd71111 add -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact
+dqadd71113 add -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact
+dqadd71114 add -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact
+dqadd71115 add -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact
+dqadd71116 add -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact
+dqadd71117 add -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact
+dqadd71118 add -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact
+dqadd71119 add -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+dqadd71300 add 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71310 add 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71311 add 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71312 add 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71313 add 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71314 add 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71315 add 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71316 add 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71317 add 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71318 add 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71319 add 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71320 add 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71321 add 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71322 add 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71323 add 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71324 add 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71325 add 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71326 add 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71327 add 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71328 add 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71329 add 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71330 add 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71331 add 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71332 add 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71333 add 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71334 add 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71335 add 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71336 add 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71337 add 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71338 add 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71339 add 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+
+dqadd71340 add 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded
+dqadd71341 add 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded
+
+dqadd71349 add 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71350 add 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71351 add 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71352 add 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71353 add 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71354 add 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71355 add 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71356 add 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71357 add 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71358 add 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71359 add 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71360 add 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71361 add 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71362 add 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71363 add 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71364 add 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71365 add 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71367 add 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71368 add 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71369 add 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71370 add 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71371 add 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71372 add 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71373 add 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71374 add 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71375 add 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71376 add 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71377 add 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71378 add 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71379 add 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71380 add 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71381 add 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71382 add 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71383 add 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71384 add 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71385 add 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71386 add 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71387 add 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71388 add 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71389 add 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71390 add 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71391 add 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71392 add 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71393 add 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71394 add 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71395 add 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71396 add 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+dqadd71420 add 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345
+dqadd71421 add 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345
+dqadd71422 add 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345
+dqadd71423 add 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345
+dqadd71424 add 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345
+dqadd71425 add 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345
+dqadd71426 add 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345
+dqadd71427 add 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7
+dqadd71428 add 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8
+dqadd71429 add 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9
+dqadd71430 add 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10
+dqadd71431 add 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11
+dqadd71432 add 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12
+dqadd71433 add 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13
+dqadd71434 add 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14
+dqadd71435 add 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15
+dqadd71436 add 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16
+dqadd71437 add 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17
+dqadd71438 add 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18
+dqadd71439 add 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19
+dqadd71440 add 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20
+dqadd71441 add 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21
+dqadd71442 add 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22
+dqadd71443 add 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23
+dqadd71444 add 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24
+dqadd71445 add 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25
+dqadd71446 add 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26
+dqadd71447 add 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27
+dqadd71448 add 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28
+dqadd71449 add 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29
+dqadd71450 add 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30
+dqadd71451 add 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31
+dqadd71452 add 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32
+dqadd71453 add 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33
+dqadd71454 add 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34
+dqadd71455 add 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35
+dqadd71456 add 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36
+
+-- same, reversed 0
+dqadd71460 add 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345
+dqadd71461 add 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345
+dqadd71462 add 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345
+dqadd71463 add 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345
+dqadd71464 add 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345
+dqadd71465 add 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345
+dqadd71466 add 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345
+dqadd71467 add 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7
+dqadd71468 add 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8
+dqadd71469 add 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9
+dqadd71470 add 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10
+dqadd71471 add 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11
+dqadd71472 add 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12
+dqadd71473 add 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13
+dqadd71474 add 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14
+dqadd71475 add 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15
+dqadd71476 add 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16
+dqadd71477 add 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17
+dqadd71478 add 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18
+dqadd71479 add 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19
+dqadd71480 add 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20
+dqadd71481 add 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21
+dqadd71482 add 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22
+dqadd71483 add 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23
+dqadd71484 add 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24
+dqadd71485 add 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25
+dqadd71486 add 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26
+dqadd71487 add 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27
+dqadd71488 add 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28
+dqadd71489 add 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29
+dqadd71490 add 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30
+dqadd71491 add 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31
+dqadd71492 add 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32
+dqadd71493 add 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33
+dqadd71494 add 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34
+dqadd71495 add 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35
+dqadd71496 add 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36
+
+-- same, Es on the 0
+dqadd71500 add 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345
+dqadd71501 add 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345
+dqadd71502 add 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345
+dqadd71503 add 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345
+dqadd71504 add 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345
+dqadd71505 add 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345
+dqadd71506 add 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345
+dqadd71507 add 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345
+dqadd71508 add 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345
+dqadd71509 add 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345
+dqadd71510 add 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345
+dqadd71511 add 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345
+dqadd71512 add 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345
+dqadd71513 add 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345
+dqadd71514 add 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345
+dqadd71515 add 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345
+dqadd71516 add 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345
+dqadd71517 add 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345
+dqadd71518 add 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345
+dqadd71519 add 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345
+dqadd71520 add 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345
+dqadd71521 add 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345
+dqadd71522 add 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345
+dqadd71523 add 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345
+dqadd71524 add 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345
+dqadd71525 add 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345
+dqadd71526 add 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345
+dqadd71527 add 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345
+dqadd71528 add 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345
+dqadd71529 add 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345
+dqadd71530 add 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345
+dqadd71531 add 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345
+dqadd71532 add 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345
+dqadd71533 add 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345
+-- next four flag Rounded because the 0 extends the result
+dqadd71534 add 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded
+dqadd71535 add 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded
+dqadd71536 add 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded
+dqadd71537 add 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+dqadd71600 add 0 0E-19 -> 0E-19
+dqadd71601 add -0 0E-19 -> 0E-19
+dqadd71602 add 0 -0E-19 -> 0E-19
+dqadd71603 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71611 add -11 11 -> 0
+dqadd71612 add 11 -11 -> 0
+
+rounding: half_down
+-- exact zeros from zeros
+dqadd71620 add 0 0E-19 -> 0E-19
+dqadd71621 add -0 0E-19 -> 0E-19
+dqadd71622 add 0 -0E-19 -> 0E-19
+dqadd71623 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71631 add -11 11 -> 0
+dqadd71632 add 11 -11 -> 0
+
+rounding: half_even
+-- exact zeros from zeros
+dqadd71640 add 0 0E-19 -> 0E-19
+dqadd71641 add -0 0E-19 -> 0E-19
+dqadd71642 add 0 -0E-19 -> 0E-19
+dqadd71643 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71651 add -11 11 -> 0
+dqadd71652 add 11 -11 -> 0
+
+rounding: up
+-- exact zeros from zeros
+dqadd71660 add 0 0E-19 -> 0E-19
+dqadd71661 add -0 0E-19 -> 0E-19
+dqadd71662 add 0 -0E-19 -> 0E-19
+dqadd71663 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71671 add -11 11 -> 0
+dqadd71672 add 11 -11 -> 0
+
+rounding: down
+-- exact zeros from zeros
+dqadd71680 add 0 0E-19 -> 0E-19
+dqadd71681 add -0 0E-19 -> 0E-19
+dqadd71682 add 0 -0E-19 -> 0E-19
+dqadd71683 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71691 add -11 11 -> 0
+dqadd71692 add 11 -11 -> 0
+
+rounding: ceiling
+-- exact zeros from zeros
+dqadd71700 add 0 0E-19 -> 0E-19
+dqadd71701 add -0 0E-19 -> 0E-19
+dqadd71702 add 0 -0E-19 -> 0E-19
+dqadd71703 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71711 add -11 11 -> 0
+dqadd71712 add 11 -11 -> 0
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+dqadd71720 add 0 0E-19 -> 0E-19
+dqadd71721 add -0 0E-19 -> -0E-19 -- *
+dqadd71722 add 0 -0E-19 -> -0E-19 -- *
+dqadd71723 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71731 add -11 11 -> -0 -- *
+dqadd71732 add 11 -11 -> -0 -- *
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dqadd71741 add 130E-2 120E-2 -> 2.50
+dqadd71742 add 130E-2 12E-1 -> 2.50
+dqadd71743 add 130E-2 1E0 -> 2.30
+dqadd71744 add 1E2 1E4 -> 1.01E+4
+dqadd71745 add 130E-2 -120E-2 -> 0.10
+dqadd71746 add 130E-2 -12E-1 -> 0.10
+dqadd71747 add 130E-2 -1E0 -> 0.30
+dqadd71748 add 1E2 -1E4 -> -9.9E+3
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+dqadd75001 add 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457
+dqadd75002 add 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded
+dqadd75003 add 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75004 add 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75005 add 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75006 add 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75007 add 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75008 add 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75009 add 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75010 add 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75011 add 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75012 add 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75013 add 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75014 add 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75015 add 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75016 add 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75017 add 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75018 add 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75019 add 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75020 add 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75021 add 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded
+
+-- widening second argument at gap
+dqadd75030 add 12398765432112345678945678 1 -> 12398765432112345678945679
+dqadd75031 add 12398765432112345678945678 0.1 -> 12398765432112345678945678.1
+dqadd75032 add 12398765432112345678945678 0.12 -> 12398765432112345678945678.12
+dqadd75033 add 12398765432112345678945678 0.123 -> 12398765432112345678945678.123
+dqadd75034 add 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234
+dqadd75035 add 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345
+dqadd75036 add 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456
+dqadd75037 add 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567
+dqadd75038 add 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678
+dqadd75039 add 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75040 add 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded
+dqadd75041 add 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded
+dqadd75042 add 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75043 add 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75044 add 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75045 add 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75046 add 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75047 add 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75048 add 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75049 add 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+dqadd75050 add 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded
+dqadd75051 add 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded
+dqadd75052 add 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded
+dqadd75053 add 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded
+dqadd75054 add 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded
+dqadd75055 add 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded
+dqadd75056 add 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded
+dqadd75057 add 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded
+dqadd75060 add 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded
+dqadd75061 add 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded
+dqadd75062 add 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded
+dqadd75063 add 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded
+dqadd75064 add 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded
+dqadd75065 add 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded
+dqadd75066 add 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded
+dqadd75067 add 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+dqadd75070 add 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001
+dqadd75071 add 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75072 add 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75073 add 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75074 add 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75075 add 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75076 add 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75077 add 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75078 add 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75079 add 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75080 add 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75081 add 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75082 add 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75083 add 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75084 add 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75085 add 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75086 add 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75087 add 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75088 add 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75089 add 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded
+
+-- Null tests
+dqadd9990 add 10 # -> NaN Invalid_operation
+dqadd9991 add # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqAnd.decTest b/Lib/test/decimaltestdata/dqAnd.decTest
index d609bc1c3b..57c416b48c 100644
--- a/Lib/test/decimaltestdata/dqAnd.decTest
+++ b/Lib/test/decimaltestdata/dqAnd.decTest
@@ -1,420 +1,420 @@
-------------------------------------------------------------------------
--- dqAnd.decTest -- digitwise logical AND for decQuads --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check (truth table)
-dqand001 and 0 0 -> 0
-dqand002 and 0 1 -> 0
-dqand003 and 1 0 -> 0
-dqand004 and 1 1 -> 1
-dqand005 and 1100 1010 -> 1000
--- and at msd and msd-1
--- 1234567890123456789012345678901234
-dqand006 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqand007 and 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 0
-dqand008 and 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqand009 and 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqand010 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqand011 and 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 0
-dqand012 and 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqand013 and 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
-
--- Various lengths
--- 1234567890123456789012345678901234
-
-dqand601 and 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 111111111111111111111111111111111
-dqand602 and 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 1011111111111111111111111111111111
-dqand603 and 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 1101111111111111111111111111111111
-dqand604 and 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1110111111111111111111111111111111
-dqand605 and 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 1111011111111111111111111111111111
-dqand606 and 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 1111101111111111111111111111111111
-dqand607 and 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1111110111111111111111111111111111
-dqand608 and 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 1111111011111111111111111111111111
-dqand609 and 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 1111111101111111111111111111111111
-dqand610 and 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1111111110111111111111111111111111
-dqand611 and 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 1111111111011111111111111111111111
-dqand612 and 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 1111111111101111111111111111111111
-dqand613 and 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1111111111110111111111111111111111
-dqand614 and 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 1111111111111011111111111111111111
-dqand615 and 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 1111111111111101111111111111111111
-dqand616 and 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1111111111111110111111111111111111
-dqand617 and 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 1111111111111111011111111111111111
-dqand618 and 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 1111111111111111101111111111111111
-dqand619 and 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1111111111111111110111111111111111
-dqand620 and 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 1111111111111111111011111111111111
-dqand621 and 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 1111111111111111111101111111111111
-dqand622 and 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1111111111111111111110111111111111
-dqand623 and 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 1111111111111111111111011111111111
-dqand624 and 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 1111111111111111111111101111111111
-dqand625 and 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1111111111111111111111110111111111
-dqand626 and 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 1111111111111111111111111011111111
-dqand627 and 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 1111111111111111111111111101111111
-dqand628 and 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1111111111111111111111111110111111
-dqand629 and 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 1111111111111111111111111111011111
-dqand630 and 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 1111111111111111111111111111101111
-dqand631 and 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1111111111111111111111111111110111
-dqand632 and 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 1111111111111111111111111111111011
-dqand633 and 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 1111111111111111111111111111111101
-dqand634 and 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1111111111111111111111111111111110
-
-dqand641 and 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 111111111111111111111111111111111
-dqand642 and 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 1011111111111111111111111111111111
-dqand643 and 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 1101111111111111111111111111111111
-dqand644 and 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1110111111111111111111111111111111
-dqand645 and 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 1111011111111111111111111111111111
-dqand646 and 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 1111101111111111111111111111111111
-dqand647 and 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1111110111111111111111111111111111
-dqand648 and 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 1111111011111111111111111111111111
-dqand649 and 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 1111111101111111111111111111111111
-dqand650 and 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1111111110111111111111111111111111
-dqand651 and 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 1111111111011111111111111111111111
-dqand652 and 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 1111111111101111111111111111111111
-dqand653 and 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1111111111110111111111111111111111
-dqand654 and 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 1111111111111011111111111111111111
-dqand655 and 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 1111111111111101111111111111111111
-dqand656 and 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1111111111111110111111111111111111
-dqand657 and 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 1111111111111111011111111111111111
-dqand658 and 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 1111111111111111101111111111111111
-dqand659 and 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1111111111111111110111111111111111
-dqand660 and 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111011111111111111
-dqand661 and 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111101111111111111
-dqand662 and 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111110111111111111
-dqand663 and 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111011111111111
-dqand664 and 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111101111111111
-dqand665 and 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111110111111111
-dqand666 and 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111011111111
-dqand667 and 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111101111111
-dqand668 and 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111110111111
-dqand669 and 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111011111
-dqand670 and 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111101111
-dqand671 and 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111110111
-dqand672 and 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111011
-dqand673 and 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111101
-dqand674 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
-dqand675 and 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 111111111111111111111111111111110
-dqand676 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
-
-dqand021 and 1111111111111111 1111111111111111 -> 1111111111111111
-dqand024 and 1111111111111111 111111111111111 -> 111111111111111
-dqand025 and 1111111111111111 11111111111111 -> 11111111111111
-dqand026 and 1111111111111111 1111111111111 -> 1111111111111
-dqand027 and 1111111111111111 111111111111 -> 111111111111
-dqand028 and 1111111111111111 11111111111 -> 11111111111
-dqand029 and 1111111111111111 1111111111 -> 1111111111
-dqand030 and 1111111111111111 111111111 -> 111111111
-dqand031 and 1111111111111111 11111111 -> 11111111
-dqand032 and 1111111111111111 1111111 -> 1111111
-dqand033 and 1111111111111111 111111 -> 111111
-dqand034 and 1111111111111111 11111 -> 11111
-dqand035 and 1111111111111111 1111 -> 1111
-dqand036 and 1111111111111111 111 -> 111
-dqand037 and 1111111111111111 11 -> 11
-dqand038 and 1111111111111111 1 -> 1
-dqand039 and 1111111111111111 0 -> 0
-
-dqand040 and 1111111111111111 1111111111111111 -> 1111111111111111
-dqand041 and 111111111111111 1111111111111111 -> 111111111111111
-dqand042 and 111111111111111 1111111111111111 -> 111111111111111
-dqand043 and 11111111111111 1111111111111111 -> 11111111111111
-dqand044 and 1111111111111 1111111111111111 -> 1111111111111
-dqand045 and 111111111111 1111111111111111 -> 111111111111
-dqand046 and 11111111111 1111111111111111 -> 11111111111
-dqand047 and 1111111111 1111111111111111 -> 1111111111
-dqand048 and 111111111 1111111111111111 -> 111111111
-dqand049 and 11111111 1111111111111111 -> 11111111
-dqand050 and 1111111 1111111111111111 -> 1111111
-dqand051 and 111111 1111111111111111 -> 111111
-dqand052 and 11111 1111111111111111 -> 11111
-dqand053 and 1111 1111111111111111 -> 1111
-dqand054 and 111 1111111111111111 -> 111
-dqand055 and 11 1111111111111111 -> 11
-dqand056 and 1 1111111111111111 -> 1
-dqand057 and 0 1111111111111111 -> 0
-
-dqand150 and 1111111111 1 -> 1
-dqand151 and 111111111 1 -> 1
-dqand152 and 11111111 1 -> 1
-dqand153 and 1111111 1 -> 1
-dqand154 and 111111 1 -> 1
-dqand155 and 11111 1 -> 1
-dqand156 and 1111 1 -> 1
-dqand157 and 111 1 -> 1
-dqand158 and 11 1 -> 1
-dqand159 and 1 1 -> 1
-
-dqand160 and 1111111111 0 -> 0
-dqand161 and 111111111 0 -> 0
-dqand162 and 11111111 0 -> 0
-dqand163 and 1111111 0 -> 0
-dqand164 and 111111 0 -> 0
-dqand165 and 11111 0 -> 0
-dqand166 and 1111 0 -> 0
-dqand167 and 111 0 -> 0
-dqand168 and 11 0 -> 0
-dqand169 and 1 0 -> 0
-
-dqand170 and 1 1111111111 -> 1
-dqand171 and 1 111111111 -> 1
-dqand172 and 1 11111111 -> 1
-dqand173 and 1 1111111 -> 1
-dqand174 and 1 111111 -> 1
-dqand175 and 1 11111 -> 1
-dqand176 and 1 1111 -> 1
-dqand177 and 1 111 -> 1
-dqand178 and 1 11 -> 1
-dqand179 and 1 1 -> 1
-
-dqand180 and 0 1111111111 -> 0
-dqand181 and 0 111111111 -> 0
-dqand182 and 0 11111111 -> 0
-dqand183 and 0 1111111 -> 0
-dqand184 and 0 111111 -> 0
-dqand185 and 0 11111 -> 0
-dqand186 and 0 1111 -> 0
-dqand187 and 0 111 -> 0
-dqand188 and 0 11 -> 0
-dqand189 and 0 1 -> 0
-
-dqand090 and 011111111 111111111 -> 11111111
-dqand091 and 101111111 111111111 -> 101111111
-dqand092 and 110111111 111111111 -> 110111111
-dqand093 and 111011111 111111111 -> 111011111
-dqand094 and 111101111 111111111 -> 111101111
-dqand095 and 111110111 111111111 -> 111110111
-dqand096 and 111111011 111111111 -> 111111011
-dqand097 and 111111101 111111111 -> 111111101
-dqand098 and 111111110 111111111 -> 111111110
-
-dqand100 and 111111111 011111111 -> 11111111
-dqand101 and 111111111 101111111 -> 101111111
-dqand102 and 111111111 110111111 -> 110111111
-dqand103 and 111111111 111011111 -> 111011111
-dqand104 and 111111111 111101111 -> 111101111
-dqand105 and 111111111 111110111 -> 111110111
-dqand106 and 111111111 111111011 -> 111111011
-dqand107 and 111111111 111111101 -> 111111101
-dqand108 and 111111111 111111110 -> 111111110
-
--- non-0/1 should not be accepted, nor should signs
-dqand220 and 111111112 111111111 -> NaN Invalid_operation
-dqand221 and 333333333 333333333 -> NaN Invalid_operation
-dqand222 and 555555555 555555555 -> NaN Invalid_operation
-dqand223 and 777777777 777777777 -> NaN Invalid_operation
-dqand224 and 999999999 999999999 -> NaN Invalid_operation
-dqand225 and 222222222 999999999 -> NaN Invalid_operation
-dqand226 and 444444444 999999999 -> NaN Invalid_operation
-dqand227 and 666666666 999999999 -> NaN Invalid_operation
-dqand228 and 888888888 999999999 -> NaN Invalid_operation
-dqand229 and 999999999 222222222 -> NaN Invalid_operation
-dqand230 and 999999999 444444444 -> NaN Invalid_operation
-dqand231 and 999999999 666666666 -> NaN Invalid_operation
-dqand232 and 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-dqand240 and 567468689 -934981942 -> NaN Invalid_operation
-dqand241 and 567367689 934981942 -> NaN Invalid_operation
-dqand242 and -631917772 -706014634 -> NaN Invalid_operation
-dqand243 and -756253257 138579234 -> NaN Invalid_operation
-dqand244 and 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-dqand250 and 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqand251 and 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqand252 and 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqand253 and 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqand254 and 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqand255 and 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqand256 and 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqand257 and 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqand258 and 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqand259 and 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqand260 and 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqand261 and 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
-dqand262 and 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqand263 and 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqand264 and 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqand265 and 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
--- test MSD-1
-dqand270 and 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
-dqand271 and 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
-dqand272 and 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
-dqand273 and 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
-dqand274 and 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
-dqand275 and 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
-dqand276 and 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
-dqand277 and 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
--- test LSD
-dqand280 and 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
-dqand281 and 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
-dqand282 and 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
-dqand283 and 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
-dqand284 and 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
-dqand285 and 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
-dqand286 and 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
-dqand287 and 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
--- test Middie
-dqand288 and 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
-dqand289 and 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
-dqand290 and 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
-dqand291 and 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
-dqand292 and 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
-dqand293 and 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
-dqand294 and 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
-dqand295 and 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
--- signs
-dqand296 and -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
-dqand297 and -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
-dqand298 and 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
-dqand299 and 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 110000110000110000001000000
-
--- Nmax, Nmin, Ntiny-like
-dqand331 and 2 9.99999999E+999 -> NaN Invalid_operation
-dqand332 and 3 1E-999 -> NaN Invalid_operation
-dqand333 and 4 1.00000000E-999 -> NaN Invalid_operation
-dqand334 and 5 1E-900 -> NaN Invalid_operation
-dqand335 and 6 -1E-900 -> NaN Invalid_operation
-dqand336 and 7 -1.00000000E-999 -> NaN Invalid_operation
-dqand337 and 8 -1E-999 -> NaN Invalid_operation
-dqand338 and 9 -9.99999999E+999 -> NaN Invalid_operation
-dqand341 and 9.99999999E+999 -18 -> NaN Invalid_operation
-dqand342 and 1E-999 01 -> NaN Invalid_operation
-dqand343 and 1.00000000E-999 -18 -> NaN Invalid_operation
-dqand344 and 1E-900 18 -> NaN Invalid_operation
-dqand345 and -1E-900 -10 -> NaN Invalid_operation
-dqand346 and -1.00000000E-999 18 -> NaN Invalid_operation
-dqand347 and -1E-999 10 -> NaN Invalid_operation
-dqand348 and -9.99999999E+999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-dqand361 and 1.0 1 -> NaN Invalid_operation
-dqand362 and 1E+1 1 -> NaN Invalid_operation
-dqand363 and 0.0 1 -> NaN Invalid_operation
-dqand364 and 0E+1 1 -> NaN Invalid_operation
-dqand365 and 9.9 1 -> NaN Invalid_operation
-dqand366 and 9E+1 1 -> NaN Invalid_operation
-dqand371 and 0 1.0 -> NaN Invalid_operation
-dqand372 and 0 1E+1 -> NaN Invalid_operation
-dqand373 and 0 0.0 -> NaN Invalid_operation
-dqand374 and 0 0E+1 -> NaN Invalid_operation
-dqand375 and 0 9.9 -> NaN Invalid_operation
-dqand376 and 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-dqand780 and -Inf -Inf -> NaN Invalid_operation
-dqand781 and -Inf -1000 -> NaN Invalid_operation
-dqand782 and -Inf -1 -> NaN Invalid_operation
-dqand783 and -Inf -0 -> NaN Invalid_operation
-dqand784 and -Inf 0 -> NaN Invalid_operation
-dqand785 and -Inf 1 -> NaN Invalid_operation
-dqand786 and -Inf 1000 -> NaN Invalid_operation
-dqand787 and -1000 -Inf -> NaN Invalid_operation
-dqand788 and -Inf -Inf -> NaN Invalid_operation
-dqand789 and -1 -Inf -> NaN Invalid_operation
-dqand790 and -0 -Inf -> NaN Invalid_operation
-dqand791 and 0 -Inf -> NaN Invalid_operation
-dqand792 and 1 -Inf -> NaN Invalid_operation
-dqand793 and 1000 -Inf -> NaN Invalid_operation
-dqand794 and Inf -Inf -> NaN Invalid_operation
-
-dqand800 and Inf -Inf -> NaN Invalid_operation
-dqand801 and Inf -1000 -> NaN Invalid_operation
-dqand802 and Inf -1 -> NaN Invalid_operation
-dqand803 and Inf -0 -> NaN Invalid_operation
-dqand804 and Inf 0 -> NaN Invalid_operation
-dqand805 and Inf 1 -> NaN Invalid_operation
-dqand806 and Inf 1000 -> NaN Invalid_operation
-dqand807 and Inf Inf -> NaN Invalid_operation
-dqand808 and -1000 Inf -> NaN Invalid_operation
-dqand809 and -Inf Inf -> NaN Invalid_operation
-dqand810 and -1 Inf -> NaN Invalid_operation
-dqand811 and -0 Inf -> NaN Invalid_operation
-dqand812 and 0 Inf -> NaN Invalid_operation
-dqand813 and 1 Inf -> NaN Invalid_operation
-dqand814 and 1000 Inf -> NaN Invalid_operation
-dqand815 and Inf Inf -> NaN Invalid_operation
-
-dqand821 and NaN -Inf -> NaN Invalid_operation
-dqand822 and NaN -1000 -> NaN Invalid_operation
-dqand823 and NaN -1 -> NaN Invalid_operation
-dqand824 and NaN -0 -> NaN Invalid_operation
-dqand825 and NaN 0 -> NaN Invalid_operation
-dqand826 and NaN 1 -> NaN Invalid_operation
-dqand827 and NaN 1000 -> NaN Invalid_operation
-dqand828 and NaN Inf -> NaN Invalid_operation
-dqand829 and NaN NaN -> NaN Invalid_operation
-dqand830 and -Inf NaN -> NaN Invalid_operation
-dqand831 and -1000 NaN -> NaN Invalid_operation
-dqand832 and -1 NaN -> NaN Invalid_operation
-dqand833 and -0 NaN -> NaN Invalid_operation
-dqand834 and 0 NaN -> NaN Invalid_operation
-dqand835 and 1 NaN -> NaN Invalid_operation
-dqand836 and 1000 NaN -> NaN Invalid_operation
-dqand837 and Inf NaN -> NaN Invalid_operation
-
-dqand841 and sNaN -Inf -> NaN Invalid_operation
-dqand842 and sNaN -1000 -> NaN Invalid_operation
-dqand843 and sNaN -1 -> NaN Invalid_operation
-dqand844 and sNaN -0 -> NaN Invalid_operation
-dqand845 and sNaN 0 -> NaN Invalid_operation
-dqand846 and sNaN 1 -> NaN Invalid_operation
-dqand847 and sNaN 1000 -> NaN Invalid_operation
-dqand848 and sNaN NaN -> NaN Invalid_operation
-dqand849 and sNaN sNaN -> NaN Invalid_operation
-dqand850 and NaN sNaN -> NaN Invalid_operation
-dqand851 and -Inf sNaN -> NaN Invalid_operation
-dqand852 and -1000 sNaN -> NaN Invalid_operation
-dqand853 and -1 sNaN -> NaN Invalid_operation
-dqand854 and -0 sNaN -> NaN Invalid_operation
-dqand855 and 0 sNaN -> NaN Invalid_operation
-dqand856 and 1 sNaN -> NaN Invalid_operation
-dqand857 and 1000 sNaN -> NaN Invalid_operation
-dqand858 and Inf sNaN -> NaN Invalid_operation
-dqand859 and NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqand861 and NaN1 -Inf -> NaN Invalid_operation
-dqand862 and +NaN2 -1000 -> NaN Invalid_operation
-dqand863 and NaN3 1000 -> NaN Invalid_operation
-dqand864 and NaN4 Inf -> NaN Invalid_operation
-dqand865 and NaN5 +NaN6 -> NaN Invalid_operation
-dqand866 and -Inf NaN7 -> NaN Invalid_operation
-dqand867 and -1000 NaN8 -> NaN Invalid_operation
-dqand868 and 1000 NaN9 -> NaN Invalid_operation
-dqand869 and Inf +NaN10 -> NaN Invalid_operation
-dqand871 and sNaN11 -Inf -> NaN Invalid_operation
-dqand872 and sNaN12 -1000 -> NaN Invalid_operation
-dqand873 and sNaN13 1000 -> NaN Invalid_operation
-dqand874 and sNaN14 NaN17 -> NaN Invalid_operation
-dqand875 and sNaN15 sNaN18 -> NaN Invalid_operation
-dqand876 and NaN16 sNaN19 -> NaN Invalid_operation
-dqand877 and -Inf +sNaN20 -> NaN Invalid_operation
-dqand878 and -1000 sNaN21 -> NaN Invalid_operation
-dqand879 and 1000 sNaN22 -> NaN Invalid_operation
-dqand880 and Inf sNaN23 -> NaN Invalid_operation
-dqand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
-dqand882 and -NaN26 NaN28 -> NaN Invalid_operation
-dqand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
-dqand884 and 1000 -NaN30 -> NaN Invalid_operation
-dqand885 and 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqAnd.decTest -- digitwise logical AND for decQuads --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check (truth table)
+dqand001 and 0 0 -> 0
+dqand002 and 0 1 -> 0
+dqand003 and 1 0 -> 0
+dqand004 and 1 1 -> 1
+dqand005 and 1100 1010 -> 1000
+-- and at msd and msd-1
+-- 1234567890123456789012345678901234
+dqand006 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqand007 and 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 0
+dqand008 and 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqand009 and 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqand010 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqand011 and 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 0
+dqand012 and 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqand013 and 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
+
+-- Various lengths
+-- 1234567890123456789012345678901234
+
+dqand601 and 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 111111111111111111111111111111111
+dqand602 and 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 1011111111111111111111111111111111
+dqand603 and 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 1101111111111111111111111111111111
+dqand604 and 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1110111111111111111111111111111111
+dqand605 and 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 1111011111111111111111111111111111
+dqand606 and 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 1111101111111111111111111111111111
+dqand607 and 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1111110111111111111111111111111111
+dqand608 and 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 1111111011111111111111111111111111
+dqand609 and 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 1111111101111111111111111111111111
+dqand610 and 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1111111110111111111111111111111111
+dqand611 and 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 1111111111011111111111111111111111
+dqand612 and 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 1111111111101111111111111111111111
+dqand613 and 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1111111111110111111111111111111111
+dqand614 and 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 1111111111111011111111111111111111
+dqand615 and 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 1111111111111101111111111111111111
+dqand616 and 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1111111111111110111111111111111111
+dqand617 and 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 1111111111111111011111111111111111
+dqand618 and 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 1111111111111111101111111111111111
+dqand619 and 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1111111111111111110111111111111111
+dqand620 and 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 1111111111111111111011111111111111
+dqand621 and 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 1111111111111111111101111111111111
+dqand622 and 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1111111111111111111110111111111111
+dqand623 and 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 1111111111111111111111011111111111
+dqand624 and 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 1111111111111111111111101111111111
+dqand625 and 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1111111111111111111111110111111111
+dqand626 and 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 1111111111111111111111111011111111
+dqand627 and 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 1111111111111111111111111101111111
+dqand628 and 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1111111111111111111111111110111111
+dqand629 and 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 1111111111111111111111111111011111
+dqand630 and 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 1111111111111111111111111111101111
+dqand631 and 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1111111111111111111111111111110111
+dqand632 and 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 1111111111111111111111111111111011
+dqand633 and 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 1111111111111111111111111111111101
+dqand634 and 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1111111111111111111111111111111110
+
+dqand641 and 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 111111111111111111111111111111111
+dqand642 and 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 1011111111111111111111111111111111
+dqand643 and 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 1101111111111111111111111111111111
+dqand644 and 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1110111111111111111111111111111111
+dqand645 and 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 1111011111111111111111111111111111
+dqand646 and 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 1111101111111111111111111111111111
+dqand647 and 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1111110111111111111111111111111111
+dqand648 and 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 1111111011111111111111111111111111
+dqand649 and 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 1111111101111111111111111111111111
+dqand650 and 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1111111110111111111111111111111111
+dqand651 and 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 1111111111011111111111111111111111
+dqand652 and 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 1111111111101111111111111111111111
+dqand653 and 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1111111111110111111111111111111111
+dqand654 and 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 1111111111111011111111111111111111
+dqand655 and 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 1111111111111101111111111111111111
+dqand656 and 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1111111111111110111111111111111111
+dqand657 and 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 1111111111111111011111111111111111
+dqand658 and 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 1111111111111111101111111111111111
+dqand659 and 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1111111111111111110111111111111111
+dqand660 and 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111011111111111111
+dqand661 and 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111101111111111111
+dqand662 and 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111110111111111111
+dqand663 and 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111011111111111
+dqand664 and 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111101111111111
+dqand665 and 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111110111111111
+dqand666 and 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111011111111
+dqand667 and 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111101111111
+dqand668 and 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111110111111
+dqand669 and 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111011111
+dqand670 and 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111101111
+dqand671 and 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111110111
+dqand672 and 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111011
+dqand673 and 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111101
+dqand674 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
+dqand675 and 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 111111111111111111111111111111110
+dqand676 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
+
+dqand021 and 1111111111111111 1111111111111111 -> 1111111111111111
+dqand024 and 1111111111111111 111111111111111 -> 111111111111111
+dqand025 and 1111111111111111 11111111111111 -> 11111111111111
+dqand026 and 1111111111111111 1111111111111 -> 1111111111111
+dqand027 and 1111111111111111 111111111111 -> 111111111111
+dqand028 and 1111111111111111 11111111111 -> 11111111111
+dqand029 and 1111111111111111 1111111111 -> 1111111111
+dqand030 and 1111111111111111 111111111 -> 111111111
+dqand031 and 1111111111111111 11111111 -> 11111111
+dqand032 and 1111111111111111 1111111 -> 1111111
+dqand033 and 1111111111111111 111111 -> 111111
+dqand034 and 1111111111111111 11111 -> 11111
+dqand035 and 1111111111111111 1111 -> 1111
+dqand036 and 1111111111111111 111 -> 111
+dqand037 and 1111111111111111 11 -> 11
+dqand038 and 1111111111111111 1 -> 1
+dqand039 and 1111111111111111 0 -> 0
+
+dqand040 and 1111111111111111 1111111111111111 -> 1111111111111111
+dqand041 and 111111111111111 1111111111111111 -> 111111111111111
+dqand042 and 111111111111111 1111111111111111 -> 111111111111111
+dqand043 and 11111111111111 1111111111111111 -> 11111111111111
+dqand044 and 1111111111111 1111111111111111 -> 1111111111111
+dqand045 and 111111111111 1111111111111111 -> 111111111111
+dqand046 and 11111111111 1111111111111111 -> 11111111111
+dqand047 and 1111111111 1111111111111111 -> 1111111111
+dqand048 and 111111111 1111111111111111 -> 111111111
+dqand049 and 11111111 1111111111111111 -> 11111111
+dqand050 and 1111111 1111111111111111 -> 1111111
+dqand051 and 111111 1111111111111111 -> 111111
+dqand052 and 11111 1111111111111111 -> 11111
+dqand053 and 1111 1111111111111111 -> 1111
+dqand054 and 111 1111111111111111 -> 111
+dqand055 and 11 1111111111111111 -> 11
+dqand056 and 1 1111111111111111 -> 1
+dqand057 and 0 1111111111111111 -> 0
+
+dqand150 and 1111111111 1 -> 1
+dqand151 and 111111111 1 -> 1
+dqand152 and 11111111 1 -> 1
+dqand153 and 1111111 1 -> 1
+dqand154 and 111111 1 -> 1
+dqand155 and 11111 1 -> 1
+dqand156 and 1111 1 -> 1
+dqand157 and 111 1 -> 1
+dqand158 and 11 1 -> 1
+dqand159 and 1 1 -> 1
+
+dqand160 and 1111111111 0 -> 0
+dqand161 and 111111111 0 -> 0
+dqand162 and 11111111 0 -> 0
+dqand163 and 1111111 0 -> 0
+dqand164 and 111111 0 -> 0
+dqand165 and 11111 0 -> 0
+dqand166 and 1111 0 -> 0
+dqand167 and 111 0 -> 0
+dqand168 and 11 0 -> 0
+dqand169 and 1 0 -> 0
+
+dqand170 and 1 1111111111 -> 1
+dqand171 and 1 111111111 -> 1
+dqand172 and 1 11111111 -> 1
+dqand173 and 1 1111111 -> 1
+dqand174 and 1 111111 -> 1
+dqand175 and 1 11111 -> 1
+dqand176 and 1 1111 -> 1
+dqand177 and 1 111 -> 1
+dqand178 and 1 11 -> 1
+dqand179 and 1 1 -> 1
+
+dqand180 and 0 1111111111 -> 0
+dqand181 and 0 111111111 -> 0
+dqand182 and 0 11111111 -> 0
+dqand183 and 0 1111111 -> 0
+dqand184 and 0 111111 -> 0
+dqand185 and 0 11111 -> 0
+dqand186 and 0 1111 -> 0
+dqand187 and 0 111 -> 0
+dqand188 and 0 11 -> 0
+dqand189 and 0 1 -> 0
+
+dqand090 and 011111111 111111111 -> 11111111
+dqand091 and 101111111 111111111 -> 101111111
+dqand092 and 110111111 111111111 -> 110111111
+dqand093 and 111011111 111111111 -> 111011111
+dqand094 and 111101111 111111111 -> 111101111
+dqand095 and 111110111 111111111 -> 111110111
+dqand096 and 111111011 111111111 -> 111111011
+dqand097 and 111111101 111111111 -> 111111101
+dqand098 and 111111110 111111111 -> 111111110
+
+dqand100 and 111111111 011111111 -> 11111111
+dqand101 and 111111111 101111111 -> 101111111
+dqand102 and 111111111 110111111 -> 110111111
+dqand103 and 111111111 111011111 -> 111011111
+dqand104 and 111111111 111101111 -> 111101111
+dqand105 and 111111111 111110111 -> 111110111
+dqand106 and 111111111 111111011 -> 111111011
+dqand107 and 111111111 111111101 -> 111111101
+dqand108 and 111111111 111111110 -> 111111110
+
+-- non-0/1 should not be accepted, nor should signs
+dqand220 and 111111112 111111111 -> NaN Invalid_operation
+dqand221 and 333333333 333333333 -> NaN Invalid_operation
+dqand222 and 555555555 555555555 -> NaN Invalid_operation
+dqand223 and 777777777 777777777 -> NaN Invalid_operation
+dqand224 and 999999999 999999999 -> NaN Invalid_operation
+dqand225 and 222222222 999999999 -> NaN Invalid_operation
+dqand226 and 444444444 999999999 -> NaN Invalid_operation
+dqand227 and 666666666 999999999 -> NaN Invalid_operation
+dqand228 and 888888888 999999999 -> NaN Invalid_operation
+dqand229 and 999999999 222222222 -> NaN Invalid_operation
+dqand230 and 999999999 444444444 -> NaN Invalid_operation
+dqand231 and 999999999 666666666 -> NaN Invalid_operation
+dqand232 and 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+dqand240 and 567468689 -934981942 -> NaN Invalid_operation
+dqand241 and 567367689 934981942 -> NaN Invalid_operation
+dqand242 and -631917772 -706014634 -> NaN Invalid_operation
+dqand243 and -756253257 138579234 -> NaN Invalid_operation
+dqand244 and 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+dqand250 and 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqand251 and 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqand252 and 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqand253 and 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqand254 and 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqand255 and 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqand256 and 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqand257 and 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqand258 and 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqand259 and 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqand260 and 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqand261 and 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+dqand262 and 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqand263 and 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqand264 and 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqand265 and 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+-- test MSD-1
+dqand270 and 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
+dqand271 and 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
+dqand272 and 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
+dqand273 and 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
+dqand274 and 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
+dqand275 and 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
+dqand276 and 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
+dqand277 and 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
+-- test LSD
+dqand280 and 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
+dqand281 and 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
+dqand282 and 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
+dqand283 and 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
+dqand284 and 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
+dqand285 and 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
+dqand286 and 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
+dqand287 and 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
+-- test Middie
+dqand288 and 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
+dqand289 and 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
+dqand290 and 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
+dqand291 and 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
+dqand292 and 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
+dqand293 and 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
+dqand294 and 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
+dqand295 and 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
+-- signs
+dqand296 and -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
+dqand297 and -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
+dqand298 and 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
+dqand299 and 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 110000110000110000001000000
+
+-- Nmax, Nmin, Ntiny-like
+dqand331 and 2 9.99999999E+999 -> NaN Invalid_operation
+dqand332 and 3 1E-999 -> NaN Invalid_operation
+dqand333 and 4 1.00000000E-999 -> NaN Invalid_operation
+dqand334 and 5 1E-900 -> NaN Invalid_operation
+dqand335 and 6 -1E-900 -> NaN Invalid_operation
+dqand336 and 7 -1.00000000E-999 -> NaN Invalid_operation
+dqand337 and 8 -1E-999 -> NaN Invalid_operation
+dqand338 and 9 -9.99999999E+999 -> NaN Invalid_operation
+dqand341 and 9.99999999E+999 -18 -> NaN Invalid_operation
+dqand342 and 1E-999 01 -> NaN Invalid_operation
+dqand343 and 1.00000000E-999 -18 -> NaN Invalid_operation
+dqand344 and 1E-900 18 -> NaN Invalid_operation
+dqand345 and -1E-900 -10 -> NaN Invalid_operation
+dqand346 and -1.00000000E-999 18 -> NaN Invalid_operation
+dqand347 and -1E-999 10 -> NaN Invalid_operation
+dqand348 and -9.99999999E+999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+dqand361 and 1.0 1 -> NaN Invalid_operation
+dqand362 and 1E+1 1 -> NaN Invalid_operation
+dqand363 and 0.0 1 -> NaN Invalid_operation
+dqand364 and 0E+1 1 -> NaN Invalid_operation
+dqand365 and 9.9 1 -> NaN Invalid_operation
+dqand366 and 9E+1 1 -> NaN Invalid_operation
+dqand371 and 0 1.0 -> NaN Invalid_operation
+dqand372 and 0 1E+1 -> NaN Invalid_operation
+dqand373 and 0 0.0 -> NaN Invalid_operation
+dqand374 and 0 0E+1 -> NaN Invalid_operation
+dqand375 and 0 9.9 -> NaN Invalid_operation
+dqand376 and 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+dqand780 and -Inf -Inf -> NaN Invalid_operation
+dqand781 and -Inf -1000 -> NaN Invalid_operation
+dqand782 and -Inf -1 -> NaN Invalid_operation
+dqand783 and -Inf -0 -> NaN Invalid_operation
+dqand784 and -Inf 0 -> NaN Invalid_operation
+dqand785 and -Inf 1 -> NaN Invalid_operation
+dqand786 and -Inf 1000 -> NaN Invalid_operation
+dqand787 and -1000 -Inf -> NaN Invalid_operation
+dqand788 and -Inf -Inf -> NaN Invalid_operation
+dqand789 and -1 -Inf -> NaN Invalid_operation
+dqand790 and -0 -Inf -> NaN Invalid_operation
+dqand791 and 0 -Inf -> NaN Invalid_operation
+dqand792 and 1 -Inf -> NaN Invalid_operation
+dqand793 and 1000 -Inf -> NaN Invalid_operation
+dqand794 and Inf -Inf -> NaN Invalid_operation
+
+dqand800 and Inf -Inf -> NaN Invalid_operation
+dqand801 and Inf -1000 -> NaN Invalid_operation
+dqand802 and Inf -1 -> NaN Invalid_operation
+dqand803 and Inf -0 -> NaN Invalid_operation
+dqand804 and Inf 0 -> NaN Invalid_operation
+dqand805 and Inf 1 -> NaN Invalid_operation
+dqand806 and Inf 1000 -> NaN Invalid_operation
+dqand807 and Inf Inf -> NaN Invalid_operation
+dqand808 and -1000 Inf -> NaN Invalid_operation
+dqand809 and -Inf Inf -> NaN Invalid_operation
+dqand810 and -1 Inf -> NaN Invalid_operation
+dqand811 and -0 Inf -> NaN Invalid_operation
+dqand812 and 0 Inf -> NaN Invalid_operation
+dqand813 and 1 Inf -> NaN Invalid_operation
+dqand814 and 1000 Inf -> NaN Invalid_operation
+dqand815 and Inf Inf -> NaN Invalid_operation
+
+dqand821 and NaN -Inf -> NaN Invalid_operation
+dqand822 and NaN -1000 -> NaN Invalid_operation
+dqand823 and NaN -1 -> NaN Invalid_operation
+dqand824 and NaN -0 -> NaN Invalid_operation
+dqand825 and NaN 0 -> NaN Invalid_operation
+dqand826 and NaN 1 -> NaN Invalid_operation
+dqand827 and NaN 1000 -> NaN Invalid_operation
+dqand828 and NaN Inf -> NaN Invalid_operation
+dqand829 and NaN NaN -> NaN Invalid_operation
+dqand830 and -Inf NaN -> NaN Invalid_operation
+dqand831 and -1000 NaN -> NaN Invalid_operation
+dqand832 and -1 NaN -> NaN Invalid_operation
+dqand833 and -0 NaN -> NaN Invalid_operation
+dqand834 and 0 NaN -> NaN Invalid_operation
+dqand835 and 1 NaN -> NaN Invalid_operation
+dqand836 and 1000 NaN -> NaN Invalid_operation
+dqand837 and Inf NaN -> NaN Invalid_operation
+
+dqand841 and sNaN -Inf -> NaN Invalid_operation
+dqand842 and sNaN -1000 -> NaN Invalid_operation
+dqand843 and sNaN -1 -> NaN Invalid_operation
+dqand844 and sNaN -0 -> NaN Invalid_operation
+dqand845 and sNaN 0 -> NaN Invalid_operation
+dqand846 and sNaN 1 -> NaN Invalid_operation
+dqand847 and sNaN 1000 -> NaN Invalid_operation
+dqand848 and sNaN NaN -> NaN Invalid_operation
+dqand849 and sNaN sNaN -> NaN Invalid_operation
+dqand850 and NaN sNaN -> NaN Invalid_operation
+dqand851 and -Inf sNaN -> NaN Invalid_operation
+dqand852 and -1000 sNaN -> NaN Invalid_operation
+dqand853 and -1 sNaN -> NaN Invalid_operation
+dqand854 and -0 sNaN -> NaN Invalid_operation
+dqand855 and 0 sNaN -> NaN Invalid_operation
+dqand856 and 1 sNaN -> NaN Invalid_operation
+dqand857 and 1000 sNaN -> NaN Invalid_operation
+dqand858 and Inf sNaN -> NaN Invalid_operation
+dqand859 and NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqand861 and NaN1 -Inf -> NaN Invalid_operation
+dqand862 and +NaN2 -1000 -> NaN Invalid_operation
+dqand863 and NaN3 1000 -> NaN Invalid_operation
+dqand864 and NaN4 Inf -> NaN Invalid_operation
+dqand865 and NaN5 +NaN6 -> NaN Invalid_operation
+dqand866 and -Inf NaN7 -> NaN Invalid_operation
+dqand867 and -1000 NaN8 -> NaN Invalid_operation
+dqand868 and 1000 NaN9 -> NaN Invalid_operation
+dqand869 and Inf +NaN10 -> NaN Invalid_operation
+dqand871 and sNaN11 -Inf -> NaN Invalid_operation
+dqand872 and sNaN12 -1000 -> NaN Invalid_operation
+dqand873 and sNaN13 1000 -> NaN Invalid_operation
+dqand874 and sNaN14 NaN17 -> NaN Invalid_operation
+dqand875 and sNaN15 sNaN18 -> NaN Invalid_operation
+dqand876 and NaN16 sNaN19 -> NaN Invalid_operation
+dqand877 and -Inf +sNaN20 -> NaN Invalid_operation
+dqand878 and -1000 sNaN21 -> NaN Invalid_operation
+dqand879 and 1000 sNaN22 -> NaN Invalid_operation
+dqand880 and Inf sNaN23 -> NaN Invalid_operation
+dqand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
+dqand882 and -NaN26 NaN28 -> NaN Invalid_operation
+dqand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
+dqand884 and 1000 -NaN30 -> NaN Invalid_operation
+dqand885 and 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqBase.decTest b/Lib/test/decimaltestdata/dqBase.decTest
index d09c6bf02c..6bb463388e 100644
--- a/Lib/test/decimaltestdata/dqBase.decTest
+++ b/Lib/test/decimaltestdata/dqBase.decTest
@@ -1,1081 +1,1081 @@
-------------------------------------------------------------------------
--- dqBase.decTest -- base decQuad <--> string conversions --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests base conversions from string to a decimal number
--- and back to a string (in Scientific form)
-
--- Note that unlike other operations the operand is subject to rounding
--- to conform to emax and precision settings (that is, numbers will
--- conform to rules and exponent will be in permitted range). The
--- 'left hand side', therefore, may have numbers that cannot be
--- represented in a decQuad. Some testcases go to the limit of the
--- next-wider format, and hence these testcases may also be used to
--- test narrowing and widening operations.
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqbas001 toSci 0 -> 0
-dqbas002 toSci 1 -> 1
-dqbas003 toSci 1.0 -> 1.0
-dqbas004 toSci 1.00 -> 1.00
-dqbas005 toSci 10 -> 10
-dqbas006 toSci 1000 -> 1000
-dqbas007 toSci 10.0 -> 10.0
-dqbas008 toSci 10.1 -> 10.1
-dqbas009 toSci 10.4 -> 10.4
-dqbas010 toSci 10.5 -> 10.5
-dqbas011 toSci 10.6 -> 10.6
-dqbas012 toSci 10.9 -> 10.9
-dqbas013 toSci 11.0 -> 11.0
-dqbas014 toSci 1.234 -> 1.234
-dqbas015 toSci 0.123 -> 0.123
-dqbas016 toSci 0.012 -> 0.012
-dqbas017 toSci -0 -> -0
-dqbas018 toSci -0.0 -> -0.0
-dqbas019 toSci -00.00 -> -0.00
-
-dqbas021 toSci -1 -> -1
-dqbas022 toSci -1.0 -> -1.0
-dqbas023 toSci -0.1 -> -0.1
-dqbas024 toSci -9.1 -> -9.1
-dqbas025 toSci -9.11 -> -9.11
-dqbas026 toSci -9.119 -> -9.119
-dqbas027 toSci -9.999 -> -9.999
-
-dqbas030 toSci '123456789.123456' -> '123456789.123456'
-dqbas031 toSci '123456789.000000' -> '123456789.000000'
-dqbas032 toSci '123456789123456' -> '123456789123456'
-dqbas033 toSci '0.0000123456789' -> '0.0000123456789'
-dqbas034 toSci '0.00000123456789' -> '0.00000123456789'
-dqbas035 toSci '0.000000123456789' -> '1.23456789E-7'
-dqbas036 toSci '0.0000000123456789' -> '1.23456789E-8'
-
-dqbas037 toSci '0.123456789012344' -> '0.123456789012344'
-dqbas038 toSci '0.123456789012345' -> '0.123456789012345'
-
--- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
-dqbsn001 toSci -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqbsn002 toSci -1E-6143 -> -1E-6143
-dqbsn003 toSci -1E-6176 -> -1E-6176 Subnormal
-dqbsn004 toSci -0 -> -0
-dqbsn005 toSci +0 -> 0
-dqbsn006 toSci +1E-6176 -> 1E-6176 Subnormal
-dqbsn007 toSci +1E-6143 -> 1E-6143
-dqbsn008 toSci +9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-
--- String [many more examples are implicitly tested elsewhere]
--- strings without E cannot generate E in result
-dqbas040 toSci "12" -> '12'
-dqbas041 toSci "-76" -> '-76'
-dqbas042 toSci "12.76" -> '12.76'
-dqbas043 toSci "+12.76" -> '12.76'
-dqbas044 toSci "012.76" -> '12.76'
-dqbas045 toSci "+0.003" -> '0.003'
-dqbas046 toSci "17." -> '17'
-dqbas047 toSci ".5" -> '0.5'
-dqbas048 toSci "044" -> '44'
-dqbas049 toSci "0044" -> '44'
-dqbas050 toSci "0.0005" -> '0.0005'
-dqbas051 toSci "00.00005" -> '0.00005'
-dqbas052 toSci "0.000005" -> '0.000005'
-dqbas053 toSci "0.0000050" -> '0.0000050'
-dqbas054 toSci "0.0000005" -> '5E-7'
-dqbas055 toSci "0.00000005" -> '5E-8'
-dqbas056 toSci "12345678.543210" -> '12345678.543210'
-dqbas057 toSci "2345678.543210" -> '2345678.543210'
-dqbas058 toSci "345678.543210" -> '345678.543210'
-dqbas059 toSci "0345678.54321" -> '345678.54321'
-dqbas060 toSci "345678.5432" -> '345678.5432'
-dqbas061 toSci "+345678.5432" -> '345678.5432'
-dqbas062 toSci "+0345678.5432" -> '345678.5432'
-dqbas063 toSci "+00345678.5432" -> '345678.5432'
-dqbas064 toSci "-345678.5432" -> '-345678.5432'
-dqbas065 toSci "-0345678.5432" -> '-345678.5432'
-dqbas066 toSci "-00345678.5432" -> '-345678.5432'
--- examples
-dqbas067 toSci "5E-6" -> '0.000005'
-dqbas068 toSci "50E-7" -> '0.0000050'
-dqbas069 toSci "5E-7" -> '5E-7'
-
--- [No exotics as no Unicode]
-
--- rounded with dots in all (including edge) places
-dqbas071 toSci .1234567891234567890123456780123456123 -> 0.1234567891234567890123456780123456 Inexact Rounded
-dqbas072 toSci 1.234567891234567890123456780123456123 -> 1.234567891234567890123456780123456 Inexact Rounded
-dqbas073 toSci 12.34567891234567890123456780123456123 -> 12.34567891234567890123456780123456 Inexact Rounded
-dqbas074 toSci 123.4567891234567890123456780123456123 -> 123.4567891234567890123456780123456 Inexact Rounded
-dqbas075 toSci 1234.567891234567890123456780123456123 -> 1234.567891234567890123456780123456 Inexact Rounded
-dqbas076 toSci 12345.67891234567890123456780123456123 -> 12345.67891234567890123456780123456 Inexact Rounded
-dqbas077 toSci 123456.7891234567890123456780123456123 -> 123456.7891234567890123456780123456 Inexact Rounded
-dqbas078 toSci 1234567.891234567890123456780123456123 -> 1234567.891234567890123456780123456 Inexact Rounded
-dqbas079 toSci 12345678.91234567890123456780123456123 -> 12345678.91234567890123456780123456 Inexact Rounded
-dqbas080 toSci 123456789.1234567890123456780123456123 -> 123456789.1234567890123456780123456 Inexact Rounded
-dqbas081 toSci 1234567891.234567890123456780123456123 -> 1234567891.234567890123456780123456 Inexact Rounded
-dqbas082 toSci 12345678912.34567890123456780123456123 -> 12345678912.34567890123456780123456 Inexact Rounded
-dqbas083 toSci 123456789123.4567890123456780123456123 -> 123456789123.4567890123456780123456 Inexact Rounded
-dqbas084 toSci 1234567891234.567890123456780123456123 -> 1234567891234.567890123456780123456 Inexact Rounded
-dqbas085 toSci 12345678912345.67890123456780123456123 -> 12345678912345.67890123456780123456 Inexact Rounded
-dqbas086 toSci 123456789123456.7890123456780123456123 -> 123456789123456.7890123456780123456 Inexact Rounded
-dqbas087 toSci 1234567891234567.890123456780123456123 -> 1234567891234567.890123456780123456 Inexact Rounded
-dqbas088 toSci 12345678912345678.90123456780123456123 -> 12345678912345678.90123456780123456 Inexact Rounded
-dqbas089 toSci 123456789123456789.0123456780123456123 -> 123456789123456789.0123456780123456 Inexact Rounded
-dqbas090 toSci 1234567891234567890.123456780123456123 -> 1234567891234567890.123456780123456 Inexact Rounded
-dqbas091 toSci 12345678912345678901.23456780123456123 -> 12345678912345678901.23456780123456 Inexact Rounded
-dqbas092 toSci 123456789123456789012.3456780123456123 -> 123456789123456789012.3456780123456 Inexact Rounded
-dqbas093 toSci 1234567891234567890123.456780123456123 -> 1234567891234567890123.456780123456 Inexact Rounded
-dqbas094 toSci 12345678912345678901234.56780123456123 -> 12345678912345678901234.56780123456 Inexact Rounded
-dqbas095 toSci 123456789123456789012345.6780123456123 -> 123456789123456789012345.6780123456 Inexact Rounded
-dqbas096 toSci 1234567891234567890123456.780123456123 -> 1234567891234567890123456.780123456 Inexact Rounded
-dqbas097 toSci 12345678912345678901234567.80123456123 -> 12345678912345678901234567.80123456 Inexact Rounded
-dqbas098 toSci 123456789123456789012345678.0123456123 -> 123456789123456789012345678.0123456 Inexact Rounded
-dqbas099 toSci 1234567891234567890123456780.123456123 -> 1234567891234567890123456780.123456 Inexact Rounded
-dqbas100 toSci 12345678912345678901234567801.23456123 -> 12345678912345678901234567801.23456 Inexact Rounded
-dqbas101 toSci 123456789123456789012345678012.3456123 -> 123456789123456789012345678012.3456 Inexact Rounded
-dqbas102 toSci 1234567891234567890123456780123.456123 -> 1234567891234567890123456780123.456 Inexact Rounded
-dqbas103 toSci 12345678912345678901234567801234.56123 -> 12345678912345678901234567801234.56 Inexact Rounded
-dqbas104 toSci 123456789123456789012345678012345.6123 -> 123456789123456789012345678012345.6 Inexact Rounded
-dqbas105 toSci 1234567891234567890123456780123456.123 -> 1234567891234567890123456780123456 Inexact Rounded
-dqbas106 toSci 12345678912345678901234567801234561.23 -> 1.234567891234567890123456780123456E+34 Inexact Rounded
-dqbas107 toSci 123456789123456789012345678012345612.3 -> 1.234567891234567890123456780123456E+35 Inexact Rounded
-dqbas108 toSci 1234567891234567890123456780123456123. -> 1.234567891234567890123456780123456E+36 Inexact Rounded
--- 123456789012345678
-
--- Numbers with E
-dqbas130 toSci "0.000E-1" -> '0.0000'
-dqbas131 toSci "0.000E-2" -> '0.00000'
-dqbas132 toSci "0.000E-3" -> '0.000000'
-dqbas133 toSci "0.000E-4" -> '0E-7'
-dqbas134 toSci "0.00E-2" -> '0.0000'
-dqbas135 toSci "0.00E-3" -> '0.00000'
-dqbas136 toSci "0.00E-4" -> '0.000000'
-dqbas137 toSci "0.00E-5" -> '0E-7'
-dqbas138 toSci "+0E+9" -> '0E+9'
-dqbas139 toSci "-0E+9" -> '-0E+9'
-dqbas140 toSci "1E+9" -> '1E+9'
-dqbas141 toSci "1e+09" -> '1E+9'
-dqbas142 toSci "1E+90" -> '1E+90'
-dqbas143 toSci "+1E+009" -> '1E+9'
-dqbas144 toSci "0E+9" -> '0E+9'
-dqbas145 toSci "1E+9" -> '1E+9'
-dqbas146 toSci "1E+09" -> '1E+9'
-dqbas147 toSci "1e+90" -> '1E+90'
-dqbas148 toSci "1E+009" -> '1E+9'
-dqbas149 toSci "000E+9" -> '0E+9'
-dqbas150 toSci "1E9" -> '1E+9'
-dqbas151 toSci "1e09" -> '1E+9'
-dqbas152 toSci "1E90" -> '1E+90'
-dqbas153 toSci "1E009" -> '1E+9'
-dqbas154 toSci "0E9" -> '0E+9'
-dqbas155 toSci "0.000e+0" -> '0.000'
-dqbas156 toSci "0.000E-1" -> '0.0000'
-dqbas157 toSci "4E+9" -> '4E+9'
-dqbas158 toSci "44E+9" -> '4.4E+10'
-dqbas159 toSci "0.73e-7" -> '7.3E-8'
-dqbas160 toSci "00E+9" -> '0E+9'
-dqbas161 toSci "00E-9" -> '0E-9'
-dqbas162 toSci "10E+9" -> '1.0E+10'
-dqbas163 toSci "10E+09" -> '1.0E+10'
-dqbas164 toSci "10e+90" -> '1.0E+91'
-dqbas165 toSci "10E+009" -> '1.0E+10'
-dqbas166 toSci "100e+9" -> '1.00E+11'
-dqbas167 toSci "100e+09" -> '1.00E+11'
-dqbas168 toSci "100E+90" -> '1.00E+92'
-dqbas169 toSci "100e+009" -> '1.00E+11'
-
-dqbas170 toSci "1.265" -> '1.265'
-dqbas171 toSci "1.265E-20" -> '1.265E-20'
-dqbas172 toSci "1.265E-8" -> '1.265E-8'
-dqbas173 toSci "1.265E-4" -> '0.0001265'
-dqbas174 toSci "1.265E-3" -> '0.001265'
-dqbas175 toSci "1.265E-2" -> '0.01265'
-dqbas176 toSci "1.265E-1" -> '0.1265'
-dqbas177 toSci "1.265E-0" -> '1.265'
-dqbas178 toSci "1.265E+1" -> '12.65'
-dqbas179 toSci "1.265E+2" -> '126.5'
-dqbas180 toSci "1.265E+3" -> '1265'
-dqbas181 toSci "1.265E+4" -> '1.265E+4'
-dqbas182 toSci "1.265E+8" -> '1.265E+8'
-dqbas183 toSci "1.265E+20" -> '1.265E+20'
-
-dqbas190 toSci "12.65" -> '12.65'
-dqbas191 toSci "12.65E-20" -> '1.265E-19'
-dqbas192 toSci "12.65E-8" -> '1.265E-7'
-dqbas193 toSci "12.65E-4" -> '0.001265'
-dqbas194 toSci "12.65E-3" -> '0.01265'
-dqbas195 toSci "12.65E-2" -> '0.1265'
-dqbas196 toSci "12.65E-1" -> '1.265'
-dqbas197 toSci "12.65E-0" -> '12.65'
-dqbas198 toSci "12.65E+1" -> '126.5'
-dqbas199 toSci "12.65E+2" -> '1265'
-dqbas200 toSci "12.65E+3" -> '1.265E+4'
-dqbas201 toSci "12.65E+4" -> '1.265E+5'
-dqbas202 toSci "12.65E+8" -> '1.265E+9'
-dqbas203 toSci "12.65E+20" -> '1.265E+21'
-
-dqbas210 toSci "126.5" -> '126.5'
-dqbas211 toSci "126.5E-20" -> '1.265E-18'
-dqbas212 toSci "126.5E-8" -> '0.000001265'
-dqbas213 toSci "126.5E-4" -> '0.01265'
-dqbas214 toSci "126.5E-3" -> '0.1265'
-dqbas215 toSci "126.5E-2" -> '1.265'
-dqbas216 toSci "126.5E-1" -> '12.65'
-dqbas217 toSci "126.5E-0" -> '126.5'
-dqbas218 toSci "126.5E+1" -> '1265'
-dqbas219 toSci "126.5E+2" -> '1.265E+4'
-dqbas220 toSci "126.5E+3" -> '1.265E+5'
-dqbas221 toSci "126.5E+4" -> '1.265E+6'
-dqbas222 toSci "126.5E+8" -> '1.265E+10'
-dqbas223 toSci "126.5E+20" -> '1.265E+22'
-
-dqbas230 toSci "1265" -> '1265'
-dqbas231 toSci "1265E-20" -> '1.265E-17'
-dqbas232 toSci "1265E-8" -> '0.00001265'
-dqbas233 toSci "1265E-4" -> '0.1265'
-dqbas234 toSci "1265E-3" -> '1.265'
-dqbas235 toSci "1265E-2" -> '12.65'
-dqbas236 toSci "1265E-1" -> '126.5'
-dqbas237 toSci "1265E-0" -> '1265'
-dqbas238 toSci "1265E+1" -> '1.265E+4'
-dqbas239 toSci "1265E+2" -> '1.265E+5'
-dqbas240 toSci "1265E+3" -> '1.265E+6'
-dqbas241 toSci "1265E+4" -> '1.265E+7'
-dqbas242 toSci "1265E+8" -> '1.265E+11'
-dqbas243 toSci "1265E+20" -> '1.265E+23'
-
-dqbas250 toSci "0.1265" -> '0.1265'
-dqbas251 toSci "0.1265E-20" -> '1.265E-21'
-dqbas252 toSci "0.1265E-8" -> '1.265E-9'
-dqbas253 toSci "0.1265E-4" -> '0.00001265'
-dqbas254 toSci "0.1265E-3" -> '0.0001265'
-dqbas255 toSci "0.1265E-2" -> '0.001265'
-dqbas256 toSci "0.1265E-1" -> '0.01265'
-dqbas257 toSci "0.1265E-0" -> '0.1265'
-dqbas258 toSci "0.1265E+1" -> '1.265'
-dqbas259 toSci "0.1265E+2" -> '12.65'
-dqbas260 toSci "0.1265E+3" -> '126.5'
-dqbas261 toSci "0.1265E+4" -> '1265'
-dqbas262 toSci "0.1265E+8" -> '1.265E+7'
-dqbas263 toSci "0.1265E+20" -> '1.265E+19'
-
--- some more negative zeros [systematic tests below]
-dqbas290 toSci "-0.000E-1" -> '-0.0000'
-dqbas291 toSci "-0.000E-2" -> '-0.00000'
-dqbas292 toSci "-0.000E-3" -> '-0.000000'
-dqbas293 toSci "-0.000E-4" -> '-0E-7'
-dqbas294 toSci "-0.00E-2" -> '-0.0000'
-dqbas295 toSci "-0.00E-3" -> '-0.00000'
-dqbas296 toSci "-0.0E-2" -> '-0.000'
-dqbas297 toSci "-0.0E-3" -> '-0.0000'
-dqbas298 toSci "-0E-2" -> '-0.00'
-dqbas299 toSci "-0E-3" -> '-0.000'
-
--- Engineering notation tests
-dqbas301 toSci 10e12 -> 1.0E+13
-dqbas302 toEng 10e12 -> 10E+12
-dqbas303 toSci 10e11 -> 1.0E+12
-dqbas304 toEng 10e11 -> 1.0E+12
-dqbas305 toSci 10e10 -> 1.0E+11
-dqbas306 toEng 10e10 -> 100E+9
-dqbas307 toSci 10e9 -> 1.0E+10
-dqbas308 toEng 10e9 -> 10E+9
-dqbas309 toSci 10e8 -> 1.0E+9
-dqbas310 toEng 10e8 -> 1.0E+9
-dqbas311 toSci 10e7 -> 1.0E+8
-dqbas312 toEng 10e7 -> 100E+6
-dqbas313 toSci 10e6 -> 1.0E+7
-dqbas314 toEng 10e6 -> 10E+6
-dqbas315 toSci 10e5 -> 1.0E+6
-dqbas316 toEng 10e5 -> 1.0E+6
-dqbas317 toSci 10e4 -> 1.0E+5
-dqbas318 toEng 10e4 -> 100E+3
-dqbas319 toSci 10e3 -> 1.0E+4
-dqbas320 toEng 10e3 -> 10E+3
-dqbas321 toSci 10e2 -> 1.0E+3
-dqbas322 toEng 10e2 -> 1.0E+3
-dqbas323 toSci 10e1 -> 1.0E+2
-dqbas324 toEng 10e1 -> 100
-dqbas325 toSci 10e0 -> 10
-dqbas326 toEng 10e0 -> 10
-dqbas327 toSci 10e-1 -> 1.0
-dqbas328 toEng 10e-1 -> 1.0
-dqbas329 toSci 10e-2 -> 0.10
-dqbas330 toEng 10e-2 -> 0.10
-dqbas331 toSci 10e-3 -> 0.010
-dqbas332 toEng 10e-3 -> 0.010
-dqbas333 toSci 10e-4 -> 0.0010
-dqbas334 toEng 10e-4 -> 0.0010
-dqbas335 toSci 10e-5 -> 0.00010
-dqbas336 toEng 10e-5 -> 0.00010
-dqbas337 toSci 10e-6 -> 0.000010
-dqbas338 toEng 10e-6 -> 0.000010
-dqbas339 toSci 10e-7 -> 0.0000010
-dqbas340 toEng 10e-7 -> 0.0000010
-dqbas341 toSci 10e-8 -> 1.0E-7
-dqbas342 toEng 10e-8 -> 100E-9
-dqbas343 toSci 10e-9 -> 1.0E-8
-dqbas344 toEng 10e-9 -> 10E-9
-dqbas345 toSci 10e-10 -> 1.0E-9
-dqbas346 toEng 10e-10 -> 1.0E-9
-dqbas347 toSci 10e-11 -> 1.0E-10
-dqbas348 toEng 10e-11 -> 100E-12
-dqbas349 toSci 10e-12 -> 1.0E-11
-dqbas350 toEng 10e-12 -> 10E-12
-dqbas351 toSci 10e-13 -> 1.0E-12
-dqbas352 toEng 10e-13 -> 1.0E-12
-
-dqbas361 toSci 7E12 -> 7E+12
-dqbas362 toEng 7E12 -> 7E+12
-dqbas363 toSci 7E11 -> 7E+11
-dqbas364 toEng 7E11 -> 700E+9
-dqbas365 toSci 7E10 -> 7E+10
-dqbas366 toEng 7E10 -> 70E+9
-dqbas367 toSci 7E9 -> 7E+9
-dqbas368 toEng 7E9 -> 7E+9
-dqbas369 toSci 7E8 -> 7E+8
-dqbas370 toEng 7E8 -> 700E+6
-dqbas371 toSci 7E7 -> 7E+7
-dqbas372 toEng 7E7 -> 70E+6
-dqbas373 toSci 7E6 -> 7E+6
-dqbas374 toEng 7E6 -> 7E+6
-dqbas375 toSci 7E5 -> 7E+5
-dqbas376 toEng 7E5 -> 700E+3
-dqbas377 toSci 7E4 -> 7E+4
-dqbas378 toEng 7E4 -> 70E+3
-dqbas379 toSci 7E3 -> 7E+3
-dqbas380 toEng 7E3 -> 7E+3
-dqbas381 toSci 7E2 -> 7E+2
-dqbas382 toEng 7E2 -> 700
-dqbas383 toSci 7E1 -> 7E+1
-dqbas384 toEng 7E1 -> 70
-dqbas385 toSci 7E0 -> 7
-dqbas386 toEng 7E0 -> 7
-dqbas387 toSci 7E-1 -> 0.7
-dqbas388 toEng 7E-1 -> 0.7
-dqbas389 toSci 7E-2 -> 0.07
-dqbas390 toEng 7E-2 -> 0.07
-dqbas391 toSci 7E-3 -> 0.007
-dqbas392 toEng 7E-3 -> 0.007
-dqbas393 toSci 7E-4 -> 0.0007
-dqbas394 toEng 7E-4 -> 0.0007
-dqbas395 toSci 7E-5 -> 0.00007
-dqbas396 toEng 7E-5 -> 0.00007
-dqbas397 toSci 7E-6 -> 0.000007
-dqbas398 toEng 7E-6 -> 0.000007
-dqbas399 toSci 7E-7 -> 7E-7
-dqbas400 toEng 7E-7 -> 700E-9
-dqbas401 toSci 7E-8 -> 7E-8
-dqbas402 toEng 7E-8 -> 70E-9
-dqbas403 toSci 7E-9 -> 7E-9
-dqbas404 toEng 7E-9 -> 7E-9
-dqbas405 toSci 7E-10 -> 7E-10
-dqbas406 toEng 7E-10 -> 700E-12
-dqbas407 toSci 7E-11 -> 7E-11
-dqbas408 toEng 7E-11 -> 70E-12
-dqbas409 toSci 7E-12 -> 7E-12
-dqbas410 toEng 7E-12 -> 7E-12
-dqbas411 toSci 7E-13 -> 7E-13
-dqbas412 toEng 7E-13 -> 700E-15
-
--- Exacts remain exact up to precision ..
-dqbas420 toSci 100 -> 100
-dqbas422 toSci 1000 -> 1000
-dqbas424 toSci 999.9 -> 999.9
-dqbas426 toSci 1000.0 -> 1000.0
-dqbas428 toSci 1000.1 -> 1000.1
-dqbas430 toSci 10000 -> 10000
-dqbas432 toSci 1000000000000000000000000000000 -> 1000000000000000000000000000000
-dqbas434 toSci 10000000000000000000000000000000 -> 10000000000000000000000000000000
-dqbas436 toSci 100000000000000000000000000000000 -> 100000000000000000000000000000000
-dqbas438 toSci 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqbas440 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded
-dqbas442 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded
-dqbas444 toSci 10000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+34 Rounded Inexact
-dqbas446 toSci 10000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+34 Rounded Inexact
-dqbas448 toSci 100000000000000000000000000000000050 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
-dqbas450 toSci 10000000000000000000000000000000009 -> 1.000000000000000000000000000000001E+34 Rounded Inexact
-dqbas452 toSci 100000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+35 Rounded
-dqbas454 toSci 100000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
-dqbas456 toSci 100000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
-dqbas458 toSci 100000000000000000000000000000000009 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
-dqbas460 toSci 1000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+36 Rounded
-dqbas462 toSci 1000000000000000000000000000000000300 -> 1.000000000000000000000000000000000E+36 Rounded Inexact
-dqbas464 toSci 1000000000000000000000000000000000500 -> 1.000000000000000000000000000000000E+36 Rounded Inexact
-dqbas466 toSci 1000000000000000000000000000000000900 -> 1.000000000000000000000000000000001E+36 Rounded Inexact
-dqbas468 toSci 10000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+37 Rounded
-dqbas470 toSci 10000000000000000000000000000000003000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact
-dqbas472 toSci 10000000000000000000000000000000005000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact
-dqbas474 toSci 10000000000000000000000000000000009000 -> 1.000000000000000000000000000000001E+37 Rounded Inexact
-
--- check rounding modes heeded
-rounding: ceiling
-dqbsr401 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr402 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr403 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr404 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
-rounding: up
-dqbsr405 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr406 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr407 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr408 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
-rounding: floor
-dqbsr410 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr411 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr412 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr413 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact
-rounding: half_down
-dqbsr415 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr416 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr417 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr418 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr419 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
-rounding: half_even
-dqbsr421 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr422 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr423 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr424 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr425 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
-rounding: down
-dqbsr426 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr427 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr428 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr429 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact
-rounding: half_up
-dqbsr431 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr432 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr433 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr434 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112347 Rounded Inexact
-dqbsr435 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
--- negatives
-rounding: ceiling
-dqbsr501 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr502 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr503 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr504 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact
-rounding: up
-dqbsr505 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr506 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr507 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr508 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-rounding: floor
-dqbsr510 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr511 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr512 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr513 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-rounding: half_down
-dqbsr515 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr516 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr517 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr518 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr519 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-rounding: half_even
-dqbsr521 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr522 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr523 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr524 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr525 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-rounding: down
-dqbsr526 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr527 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr528 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr529 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact
-rounding: half_up
-dqbsr531 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr532 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr533 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr534 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112347 Rounded Inexact
-dqbsr535 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-
-rounding: half_even
-
--- The 'baddies' tests from DiagBigDecimal, plus some new ones
-dqbas500 toSci '1..2' -> NaN Conversion_syntax
-dqbas501 toSci '.' -> NaN Conversion_syntax
-dqbas502 toSci '..' -> NaN Conversion_syntax
-dqbas503 toSci '++1' -> NaN Conversion_syntax
-dqbas504 toSci '--1' -> NaN Conversion_syntax
-dqbas505 toSci '-+1' -> NaN Conversion_syntax
-dqbas506 toSci '+-1' -> NaN Conversion_syntax
-dqbas507 toSci '12e' -> NaN Conversion_syntax
-dqbas508 toSci '12e++' -> NaN Conversion_syntax
-dqbas509 toSci '12f4' -> NaN Conversion_syntax
-dqbas510 toSci ' +1' -> NaN Conversion_syntax
-dqbas511 toSci '+ 1' -> NaN Conversion_syntax
-dqbas512 toSci '12 ' -> NaN Conversion_syntax
-dqbas513 toSci ' + 1' -> NaN Conversion_syntax
-dqbas514 toSci ' - 1 ' -> NaN Conversion_syntax
-dqbas515 toSci 'x' -> NaN Conversion_syntax
-dqbas516 toSci '-1-' -> NaN Conversion_syntax
-dqbas517 toSci '12-' -> NaN Conversion_syntax
-dqbas518 toSci '3+' -> NaN Conversion_syntax
-dqbas519 toSci '' -> NaN Conversion_syntax
-dqbas520 toSci '1e-' -> NaN Conversion_syntax
-dqbas521 toSci '7e99999a' -> NaN Conversion_syntax
-dqbas522 toSci '7e123567890x' -> NaN Conversion_syntax
-dqbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
-dqbas524 toSci '' -> NaN Conversion_syntax
-dqbas525 toSci 'e100' -> NaN Conversion_syntax
-dqbas526 toSci '\u0e5a' -> NaN Conversion_syntax
-dqbas527 toSci '\u0b65' -> NaN Conversion_syntax
-dqbas528 toSci '123,65' -> NaN Conversion_syntax
-dqbas529 toSci '1.34.5' -> NaN Conversion_syntax
-dqbas530 toSci '.123.5' -> NaN Conversion_syntax
-dqbas531 toSci '01.35.' -> NaN Conversion_syntax
-dqbas532 toSci '01.35-' -> NaN Conversion_syntax
-dqbas533 toSci '0000..' -> NaN Conversion_syntax
-dqbas534 toSci '.0000.' -> NaN Conversion_syntax
-dqbas535 toSci '00..00' -> NaN Conversion_syntax
-dqbas536 toSci '111e*123' -> NaN Conversion_syntax
-dqbas537 toSci '111e123-' -> NaN Conversion_syntax
-dqbas538 toSci '111e+12+' -> NaN Conversion_syntax
-dqbas539 toSci '111e1-3-' -> NaN Conversion_syntax
-dqbas540 toSci '111e1*23' -> NaN Conversion_syntax
-dqbas541 toSci '111e1e+3' -> NaN Conversion_syntax
-dqbas542 toSci '1e1.0' -> NaN Conversion_syntax
-dqbas543 toSci '1e123e' -> NaN Conversion_syntax
-dqbas544 toSci 'ten' -> NaN Conversion_syntax
-dqbas545 toSci 'ONE' -> NaN Conversion_syntax
-dqbas546 toSci '1e.1' -> NaN Conversion_syntax
-dqbas547 toSci '1e1.' -> NaN Conversion_syntax
-dqbas548 toSci '1ee' -> NaN Conversion_syntax
-dqbas549 toSci 'e+1' -> NaN Conversion_syntax
-dqbas550 toSci '1.23.4' -> NaN Conversion_syntax
-dqbas551 toSci '1.2.1' -> NaN Conversion_syntax
-dqbas552 toSci '1E+1.2' -> NaN Conversion_syntax
-dqbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
-dqbas554 toSci '1E++1' -> NaN Conversion_syntax
-dqbas555 toSci '1E--1' -> NaN Conversion_syntax
-dqbas556 toSci '1E+-1' -> NaN Conversion_syntax
-dqbas557 toSci '1E-+1' -> NaN Conversion_syntax
-dqbas558 toSci '1E''1' -> NaN Conversion_syntax
-dqbas559 toSci "1E""1" -> NaN Conversion_syntax
-dqbas560 toSci "1E""""" -> NaN Conversion_syntax
--- Near-specials
-dqbas561 toSci "qNaN" -> NaN Conversion_syntax
-dqbas562 toSci "NaNq" -> NaN Conversion_syntax
-dqbas563 toSci "NaNs" -> NaN Conversion_syntax
-dqbas564 toSci "Infi" -> NaN Conversion_syntax
-dqbas565 toSci "Infin" -> NaN Conversion_syntax
-dqbas566 toSci "Infini" -> NaN Conversion_syntax
-dqbas567 toSci "Infinit" -> NaN Conversion_syntax
-dqbas568 toSci "-Infinit" -> NaN Conversion_syntax
-dqbas569 toSci "0Inf" -> NaN Conversion_syntax
-dqbas570 toSci "9Inf" -> NaN Conversion_syntax
-dqbas571 toSci "-0Inf" -> NaN Conversion_syntax
-dqbas572 toSci "-9Inf" -> NaN Conversion_syntax
-dqbas573 toSci "-sNa" -> NaN Conversion_syntax
-dqbas574 toSci "xNaN" -> NaN Conversion_syntax
-dqbas575 toSci "0sNaN" -> NaN Conversion_syntax
-
--- some baddies with dots and Es and dots and specials
-dqbas576 toSci 'e+1' -> NaN Conversion_syntax
-dqbas577 toSci '.e+1' -> NaN Conversion_syntax
-dqbas578 toSci '+.e+1' -> NaN Conversion_syntax
-dqbas579 toSci '-.e+' -> NaN Conversion_syntax
-dqbas580 toSci '-.e' -> NaN Conversion_syntax
-dqbas581 toSci 'E+1' -> NaN Conversion_syntax
-dqbas582 toSci '.E+1' -> NaN Conversion_syntax
-dqbas583 toSci '+.E+1' -> NaN Conversion_syntax
-dqbas584 toSci '-.E+' -> NaN Conversion_syntax
-dqbas585 toSci '-.E' -> NaN Conversion_syntax
-
-dqbas586 toSci '.NaN' -> NaN Conversion_syntax
-dqbas587 toSci '-.NaN' -> NaN Conversion_syntax
-dqbas588 toSci '+.sNaN' -> NaN Conversion_syntax
-dqbas589 toSci '+.Inf' -> NaN Conversion_syntax
-dqbas590 toSci '.Infinity' -> NaN Conversion_syntax
-
--- Zeros
-dqbas601 toSci 0.000000000 -> 0E-9
-dqbas602 toSci 0.00000000 -> 0E-8
-dqbas603 toSci 0.0000000 -> 0E-7
-dqbas604 toSci 0.000000 -> 0.000000
-dqbas605 toSci 0.00000 -> 0.00000
-dqbas606 toSci 0.0000 -> 0.0000
-dqbas607 toSci 0.000 -> 0.000
-dqbas608 toSci 0.00 -> 0.00
-dqbas609 toSci 0.0 -> 0.0
-dqbas610 toSci .0 -> 0.0
-dqbas611 toSci 0. -> 0
-dqbas612 toSci -.0 -> -0.0
-dqbas613 toSci -0. -> -0
-dqbas614 toSci -0.0 -> -0.0
-dqbas615 toSci -0.00 -> -0.00
-dqbas616 toSci -0.000 -> -0.000
-dqbas617 toSci -0.0000 -> -0.0000
-dqbas618 toSci -0.00000 -> -0.00000
-dqbas619 toSci -0.000000 -> -0.000000
-dqbas620 toSci -0.0000000 -> -0E-7
-dqbas621 toSci -0.00000000 -> -0E-8
-dqbas622 toSci -0.000000000 -> -0E-9
-
-dqbas630 toSci 0.00E+0 -> 0.00
-dqbas631 toSci 0.00E+1 -> 0.0
-dqbas632 toSci 0.00E+2 -> 0
-dqbas633 toSci 0.00E+3 -> 0E+1
-dqbas634 toSci 0.00E+4 -> 0E+2
-dqbas635 toSci 0.00E+5 -> 0E+3
-dqbas636 toSci 0.00E+6 -> 0E+4
-dqbas637 toSci 0.00E+7 -> 0E+5
-dqbas638 toSci 0.00E+8 -> 0E+6
-dqbas639 toSci 0.00E+9 -> 0E+7
-
-dqbas640 toSci 0.0E+0 -> 0.0
-dqbas641 toSci 0.0E+1 -> 0
-dqbas642 toSci 0.0E+2 -> 0E+1
-dqbas643 toSci 0.0E+3 -> 0E+2
-dqbas644 toSci 0.0E+4 -> 0E+3
-dqbas645 toSci 0.0E+5 -> 0E+4
-dqbas646 toSci 0.0E+6 -> 0E+5
-dqbas647 toSci 0.0E+7 -> 0E+6
-dqbas648 toSci 0.0E+8 -> 0E+7
-dqbas649 toSci 0.0E+9 -> 0E+8
-
-dqbas650 toSci 0E+0 -> 0
-dqbas651 toSci 0E+1 -> 0E+1
-dqbas652 toSci 0E+2 -> 0E+2
-dqbas653 toSci 0E+3 -> 0E+3
-dqbas654 toSci 0E+4 -> 0E+4
-dqbas655 toSci 0E+5 -> 0E+5
-dqbas656 toSci 0E+6 -> 0E+6
-dqbas657 toSci 0E+7 -> 0E+7
-dqbas658 toSci 0E+8 -> 0E+8
-dqbas659 toSci 0E+9 -> 0E+9
-
-dqbas660 toSci 0.0E-0 -> 0.0
-dqbas661 toSci 0.0E-1 -> 0.00
-dqbas662 toSci 0.0E-2 -> 0.000
-dqbas663 toSci 0.0E-3 -> 0.0000
-dqbas664 toSci 0.0E-4 -> 0.00000
-dqbas665 toSci 0.0E-5 -> 0.000000
-dqbas666 toSci 0.0E-6 -> 0E-7
-dqbas667 toSci 0.0E-7 -> 0E-8
-dqbas668 toSci 0.0E-8 -> 0E-9
-dqbas669 toSci 0.0E-9 -> 0E-10
-
-dqbas670 toSci 0.00E-0 -> 0.00
-dqbas671 toSci 0.00E-1 -> 0.000
-dqbas672 toSci 0.00E-2 -> 0.0000
-dqbas673 toSci 0.00E-3 -> 0.00000
-dqbas674 toSci 0.00E-4 -> 0.000000
-dqbas675 toSci 0.00E-5 -> 0E-7
-dqbas676 toSci 0.00E-6 -> 0E-8
-dqbas677 toSci 0.00E-7 -> 0E-9
-dqbas678 toSci 0.00E-8 -> 0E-10
-dqbas679 toSci 0.00E-9 -> 0E-11
-
-dqbas680 toSci 000000. -> 0
-dqbas681 toSci 00000. -> 0
-dqbas682 toSci 0000. -> 0
-dqbas683 toSci 000. -> 0
-dqbas684 toSci 00. -> 0
-dqbas685 toSci 0. -> 0
-dqbas686 toSci +00000. -> 0
-dqbas687 toSci -00000. -> -0
-dqbas688 toSci +0. -> 0
-dqbas689 toSci -0. -> -0
-
--- Specials
-dqbas700 toSci "NaN" -> NaN
-dqbas701 toSci "nan" -> NaN
-dqbas702 toSci "nAn" -> NaN
-dqbas703 toSci "NAN" -> NaN
-dqbas704 toSci "+NaN" -> NaN
-dqbas705 toSci "+nan" -> NaN
-dqbas706 toSci "+nAn" -> NaN
-dqbas707 toSci "+NAN" -> NaN
-dqbas708 toSci "-NaN" -> -NaN
-dqbas709 toSci "-nan" -> -NaN
-dqbas710 toSci "-nAn" -> -NaN
-dqbas711 toSci "-NAN" -> -NaN
-dqbas712 toSci 'NaN0' -> NaN
-dqbas713 toSci 'NaN1' -> NaN1
-dqbas714 toSci 'NaN12' -> NaN12
-dqbas715 toSci 'NaN123' -> NaN123
-dqbas716 toSci 'NaN1234' -> NaN1234
-dqbas717 toSci 'NaN01' -> NaN1
-dqbas718 toSci 'NaN012' -> NaN12
-dqbas719 toSci 'NaN0123' -> NaN123
-dqbas720 toSci 'NaN01234' -> NaN1234
-dqbas721 toSci 'NaN001' -> NaN1
-dqbas722 toSci 'NaN0012' -> NaN12
-dqbas723 toSci 'NaN00123' -> NaN123
-dqbas724 toSci 'NaN001234' -> NaN1234
-dqbas725 toSci 'NaN1234567890123456781234567890123456' -> NaN Conversion_syntax
-dqbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
-dqbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
-dqbas728 toSci 'NaN-12' -> NaN Conversion_syntax
-dqbas729 toSci 'NaN+12' -> NaN Conversion_syntax
-
-dqbas730 toSci "sNaN" -> sNaN
-dqbas731 toSci "snan" -> sNaN
-dqbas732 toSci "SnAn" -> sNaN
-dqbas733 toSci "SNAN" -> sNaN
-dqbas734 toSci "+sNaN" -> sNaN
-dqbas735 toSci "+snan" -> sNaN
-dqbas736 toSci "+SnAn" -> sNaN
-dqbas737 toSci "+SNAN" -> sNaN
-dqbas738 toSci "-sNaN" -> -sNaN
-dqbas739 toSci "-snan" -> -sNaN
-dqbas740 toSci "-SnAn" -> -sNaN
-dqbas741 toSci "-SNAN" -> -sNaN
-dqbas742 toSci 'sNaN0000' -> sNaN
-dqbas743 toSci 'sNaN7' -> sNaN7
-dqbas744 toSci 'sNaN007234' -> sNaN7234
-dqbas745 toSci 'sNaN1234567890123456787234561234567890' -> NaN Conversion_syntax
-dqbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
-dqbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
-
-dqbas748 toSci "Inf" -> Infinity
-dqbas749 toSci "inf" -> Infinity
-dqbas750 toSci "iNf" -> Infinity
-dqbas751 toSci "INF" -> Infinity
-dqbas752 toSci "+Inf" -> Infinity
-dqbas753 toSci "+inf" -> Infinity
-dqbas754 toSci "+iNf" -> Infinity
-dqbas755 toSci "+INF" -> Infinity
-dqbas756 toSci "-Inf" -> -Infinity
-dqbas757 toSci "-inf" -> -Infinity
-dqbas758 toSci "-iNf" -> -Infinity
-dqbas759 toSci "-INF" -> -Infinity
-
-dqbas760 toSci "Infinity" -> Infinity
-dqbas761 toSci "infinity" -> Infinity
-dqbas762 toSci "iNfInItY" -> Infinity
-dqbas763 toSci "INFINITY" -> Infinity
-dqbas764 toSci "+Infinity" -> Infinity
-dqbas765 toSci "+infinity" -> Infinity
-dqbas766 toSci "+iNfInItY" -> Infinity
-dqbas767 toSci "+INFINITY" -> Infinity
-dqbas768 toSci "-Infinity" -> -Infinity
-dqbas769 toSci "-infinity" -> -Infinity
-dqbas770 toSci "-iNfInItY" -> -Infinity
-dqbas771 toSci "-INFINITY" -> -Infinity
-
--- Specials and zeros for toEng
-dqbast772 toEng "NaN" -> NaN
-dqbast773 toEng "-Infinity" -> -Infinity
-dqbast774 toEng "-sNaN" -> -sNaN
-dqbast775 toEng "-NaN" -> -NaN
-dqbast776 toEng "+Infinity" -> Infinity
-dqbast778 toEng "+sNaN" -> sNaN
-dqbast779 toEng "+NaN" -> NaN
-dqbast780 toEng "INFINITY" -> Infinity
-dqbast781 toEng "SNAN" -> sNaN
-dqbast782 toEng "NAN" -> NaN
-dqbast783 toEng "infinity" -> Infinity
-dqbast784 toEng "snan" -> sNaN
-dqbast785 toEng "nan" -> NaN
-dqbast786 toEng "InFINITY" -> Infinity
-dqbast787 toEng "SnAN" -> sNaN
-dqbast788 toEng "nAN" -> NaN
-dqbast789 toEng "iNfinity" -> Infinity
-dqbast790 toEng "sNan" -> sNaN
-dqbast791 toEng "Nan" -> NaN
-dqbast792 toEng "Infinity" -> Infinity
-dqbast793 toEng "sNaN" -> sNaN
-
--- Zero toEng, etc.
-dqbast800 toEng 0e+1 -> "0.00E+3" -- doc example
-
-dqbast801 toEng 0.000000000 -> 0E-9
-dqbast802 toEng 0.00000000 -> 0.00E-6
-dqbast803 toEng 0.0000000 -> 0.0E-6
-dqbast804 toEng 0.000000 -> 0.000000
-dqbast805 toEng 0.00000 -> 0.00000
-dqbast806 toEng 0.0000 -> 0.0000
-dqbast807 toEng 0.000 -> 0.000
-dqbast808 toEng 0.00 -> 0.00
-dqbast809 toEng 0.0 -> 0.0
-dqbast810 toEng .0 -> 0.0
-dqbast811 toEng 0. -> 0
-dqbast812 toEng -.0 -> -0.0
-dqbast813 toEng -0. -> -0
-dqbast814 toEng -0.0 -> -0.0
-dqbast815 toEng -0.00 -> -0.00
-dqbast816 toEng -0.000 -> -0.000
-dqbast817 toEng -0.0000 -> -0.0000
-dqbast818 toEng -0.00000 -> -0.00000
-dqbast819 toEng -0.000000 -> -0.000000
-dqbast820 toEng -0.0000000 -> -0.0E-6
-dqbast821 toEng -0.00000000 -> -0.00E-6
-dqbast822 toEng -0.000000000 -> -0E-9
-
-dqbast830 toEng 0.00E+0 -> 0.00
-dqbast831 toEng 0.00E+1 -> 0.0
-dqbast832 toEng 0.00E+2 -> 0
-dqbast833 toEng 0.00E+3 -> 0.00E+3
-dqbast834 toEng 0.00E+4 -> 0.0E+3
-dqbast835 toEng 0.00E+5 -> 0E+3
-dqbast836 toEng 0.00E+6 -> 0.00E+6
-dqbast837 toEng 0.00E+7 -> 0.0E+6
-dqbast838 toEng 0.00E+8 -> 0E+6
-dqbast839 toEng 0.00E+9 -> 0.00E+9
-
-dqbast840 toEng 0.0E+0 -> 0.0
-dqbast841 toEng 0.0E+1 -> 0
-dqbast842 toEng 0.0E+2 -> 0.00E+3
-dqbast843 toEng 0.0E+3 -> 0.0E+3
-dqbast844 toEng 0.0E+4 -> 0E+3
-dqbast845 toEng 0.0E+5 -> 0.00E+6
-dqbast846 toEng 0.0E+6 -> 0.0E+6
-dqbast847 toEng 0.0E+7 -> 0E+6
-dqbast848 toEng 0.0E+8 -> 0.00E+9
-dqbast849 toEng 0.0E+9 -> 0.0E+9
-
-dqbast850 toEng 0E+0 -> 0
-dqbast851 toEng 0E+1 -> 0.00E+3
-dqbast852 toEng 0E+2 -> 0.0E+3
-dqbast853 toEng 0E+3 -> 0E+3
-dqbast854 toEng 0E+4 -> 0.00E+6
-dqbast855 toEng 0E+5 -> 0.0E+6
-dqbast856 toEng 0E+6 -> 0E+6
-dqbast857 toEng 0E+7 -> 0.00E+9
-dqbast858 toEng 0E+8 -> 0.0E+9
-dqbast859 toEng 0E+9 -> 0E+9
-
-dqbast860 toEng 0.0E-0 -> 0.0
-dqbast861 toEng 0.0E-1 -> 0.00
-dqbast862 toEng 0.0E-2 -> 0.000
-dqbast863 toEng 0.0E-3 -> 0.0000
-dqbast864 toEng 0.0E-4 -> 0.00000
-dqbast865 toEng 0.0E-5 -> 0.000000
-dqbast866 toEng 0.0E-6 -> 0.0E-6
-dqbast867 toEng 0.0E-7 -> 0.00E-6
-dqbast868 toEng 0.0E-8 -> 0E-9
-dqbast869 toEng 0.0E-9 -> 0.0E-9
-
-dqbast870 toEng 0.00E-0 -> 0.00
-dqbast871 toEng 0.00E-1 -> 0.000
-dqbast872 toEng 0.00E-2 -> 0.0000
-dqbast873 toEng 0.00E-3 -> 0.00000
-dqbast874 toEng 0.00E-4 -> 0.000000
-dqbast875 toEng 0.00E-5 -> 0.0E-6
-dqbast876 toEng 0.00E-6 -> 0.00E-6
-dqbast877 toEng 0.00E-7 -> 0E-9
-dqbast878 toEng 0.00E-8 -> 0.0E-9
-dqbast879 toEng 0.00E-9 -> 0.00E-9
-
--- long input strings
-dqbas801 tosci '01234567890123456' -> 1234567890123456
-dqbas802 tosci '001234567890123456' -> 1234567890123456
-dqbas803 tosci '0001234567890123456' -> 1234567890123456
-dqbas804 tosci '00001234567890123456' -> 1234567890123456
-dqbas805 tosci '000001234567890123456' -> 1234567890123456
-dqbas806 tosci '0000001234567890123456' -> 1234567890123456
-dqbas807 tosci '00000001234567890123456' -> 1234567890123456
-dqbas808 tosci '000000001234567890123456' -> 1234567890123456
-dqbas809 tosci '0000000001234567890123456' -> 1234567890123456
-dqbas810 tosci '00000000001234567890123456' -> 1234567890123456
-
-dqbas811 tosci '0.1234567890123456' -> 0.1234567890123456
-dqbas812 tosci '0.01234567890123456' -> 0.01234567890123456
-dqbas813 tosci '0.001234567890123456' -> 0.001234567890123456
-dqbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456
-dqbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456
-dqbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456
-dqbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7
-dqbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8
-dqbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9
-dqbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10
-
-dqbas821 tosci '12345678912345678901234567801234567890' -> 1.234567891234567890123456780123457E+37 Inexact Rounded
-dqbas822 tosci '123456789123456789012345678012345678901' -> 1.234567891234567890123456780123457E+38 Inexact Rounded
-dqbas823 tosci '1234567891234567890123456780123456789012' -> 1.234567891234567890123456780123457E+39 Inexact Rounded
-dqbas824 tosci '12345678912345678901234567801234567890123' -> 1.234567891234567890123456780123457E+40 Inexact Rounded
-dqbas825 tosci '123456789123456789012345678012345678901234' -> 1.234567891234567890123456780123457E+41 Inexact Rounded
-dqbas826 tosci '1234567891234567890123456780123456789012345' -> 1.234567891234567890123456780123457E+42 Inexact Rounded
-dqbas827 tosci '12345678912345678901234567801234567890123456' -> 1.234567891234567890123456780123457E+43 Inexact Rounded
-dqbas828 tosci '123456789123456789012345678012345678901234567' -> 1.234567891234567890123456780123457E+44 Inexact Rounded
-dqbas829 tosci '1234567891234567890123456780123456789012345678' -> 1.234567891234567890123456780123457E+45 Inexact Rounded
-
--- subnormals and overflows
-dqbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
-dqbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
-dqbas908 toSci '0.9e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas909 toSci '0.09e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
-dqbas911 toSci '10e-1000000000' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
-dqbas913 toSci '99e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
-dqbas915 toSci '1111e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas916 toSci '1111e-99999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
--- negatives the same
-dqbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
-dqbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
-dqbas920 toSci '-0.9e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas921 toSci '-0.09e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
-dqbas923 toSci '-10e-1000000000' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
-dqbas925 toSci '-99e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
-dqbas927 toSci '-1111e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas928 toSci '-1111e-99999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
-
--- overflow results at different rounding modes
-rounding: ceiling
-dqbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas931 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-rounding: up
-dqbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: down
-dqbas934 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqbas935 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-rounding: floor
-dqbas936 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_up
-dqbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_even
-dqbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_down
-dqbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_even
-
--- Now check 854/754r some subnormals and underflow to 0
-dqbem400 toSci 1.0000E-383 -> 1.0000E-383
-dqbem401 toSci 0.1E-6172 -> 1E-6173 Subnormal
-dqbem402 toSci 0.1000E-6172 -> 1.000E-6173 Subnormal
-dqbem403 toSci 0.0100E-6172 -> 1.00E-6174 Subnormal
-dqbem404 toSci 0.0010E-6172 -> 1.0E-6175 Subnormal
-dqbem405 toSci 0.0001E-6172 -> 1E-6176 Subnormal
-dqbem406 toSci 0.00010E-6172 -> 1E-6176 Subnormal Rounded
-dqbem407 toSci 0.00013E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqbem408 toSci 0.00015E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem409 toSci 0.00017E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem410 toSci 0.00023E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem411 toSci 0.00025E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem412 toSci 0.00027E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqbem413 toSci 0.000149E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqbem414 toSci 0.000150E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem415 toSci 0.000151E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem416 toSci 0.000249E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem417 toSci 0.000250E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem418 toSci 0.000251E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqbem419 toSci 0.00009E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqbem420 toSci 0.00005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem421 toSci 0.00003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem422 toSci 0.000009E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem423 toSci 0.000005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem424 toSci 0.000003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqbem425 toSci 0.001049E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
-dqbem426 toSci 0.001050E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
-dqbem427 toSci 0.001051E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded
-dqbem428 toSci 0.001149E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded
-dqbem429 toSci 0.001150E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded
-dqbem430 toSci 0.001151E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded
-
-dqbem432 toSci 0.010049E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
-dqbem433 toSci 0.010050E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
-dqbem434 toSci 0.010051E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded
-dqbem435 toSci 0.010149E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded
-dqbem436 toSci 0.010150E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded
-dqbem437 toSci 0.010151E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded
-
-dqbem440 toSci 0.10103E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded
-dqbem441 toSci 0.10105E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded
-dqbem442 toSci 0.10107E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded
-dqbem443 toSci 0.10113E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded
-dqbem444 toSci 0.10115E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded
-dqbem445 toSci 0.10117E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded
-
-dqbem450 toSci 1.10730E-6173 -> 1.107E-6173 Underflow Subnormal Inexact Rounded
-dqbem451 toSci 1.10750E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
-dqbem452 toSci 1.10770E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
-dqbem453 toSci 1.10830E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
-dqbem454 toSci 1.10850E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
-dqbem455 toSci 1.10870E-6173 -> 1.109E-6173 Underflow Subnormal Inexact Rounded
-
--- make sure sign OK
-dqbem456 toSci -0.10103E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded
-dqbem457 toSci -0.10105E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded
-dqbem458 toSci -0.10107E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded
-dqbem459 toSci -0.10113E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded
-dqbem460 toSci -0.10115E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded
-dqbem461 toSci -0.10117E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded
-
--- '999s' cases
-dqbem464 toSci 999999E-6173 -> 9.99999E-6168 Subnormal
-dqbem465 toSci 99999.0E-6172 -> 9.99990E-6168 Subnormal
-dqbem466 toSci 99999.E-6172 -> 9.9999E-6168 Subnormal
-dqbem467 toSci 9999.9E-6172 -> 9.9999E-6169 Subnormal
-dqbem468 toSci 999.99E-6172 -> 9.9999E-6170 Subnormal
-dqbem469 toSci 99.999E-6172 -> 9.9999E-6171 Subnormal
-dqbem470 toSci 9.9999E-6172 -> 9.9999E-6172 Subnormal
-dqbem471 toSci 0.99999E-6172 -> 1.0000E-6172 Underflow Subnormal Inexact Rounded
-dqbem472 toSci 0.099999E-6172 -> 1.000E-6173 Underflow Subnormal Inexact Rounded
-dqbem473 toSci 0.0099999E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
-dqbem474 toSci 0.00099999E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
-dqbem475 toSci 0.000099999E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqbem476 toSci 0.0000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem477 toSci 0.00000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem478 toSci 0.000000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- Exponents with insignificant leading zeros
-dqbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
-dqbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
-dqbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
-dqbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
-dqbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
-dqbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
-dqbas1007 toSci 1e-999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1008 toSci 1e-0999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1009 toSci 1e-00999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1010 toSci 1e-000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1011 toSci 1e-000000000000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1012 toSci 1e-000000000001000000007 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- check for double-rounded subnormals
-dqbas1041 toSci 1.1111111111111111111111111111152444E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
-dqbas1042 toSci 1.1111111111111111111111111111152445E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
-dqbas1043 toSci 1.1111111111111111111111111111152446E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
-
--- clamped zeros [see also clamp.decTest]
-dqbas1075 toSci 0e+10000 -> 0E+6111 Clamped
-dqbas1076 toSci 0e-10000 -> 0E-6176 Clamped
-dqbas1077 toSci -0e+10000 -> -0E+6111 Clamped
-dqbas1078 toSci -0e-10000 -> -0E-6176 Clamped
-
--- extreme values from next-wider
-dqbas1101 toSci -9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> -Infinity Overflow Inexact Rounded
-dqbas1102 toSci -1E-1572863 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped
-dqbas1103 toSci -1E-1572932 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped
-dqbas1104 toSci -0 -> -0
-dqbas1105 toSci +0 -> 0
-dqbas1106 toSci +1E-1572932 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped
-dqbas1107 toSci +1E-1572863 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped
-dqbas1108 toSci +9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> Infinity Overflow Inexact Rounded
-
+------------------------------------------------------------------------
+-- dqBase.decTest -- base decQuad <--> string conversions --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests base conversions from string to a decimal number
+-- and back to a string (in Scientific form)
+
+-- Note that unlike other operations the operand is subject to rounding
+-- to conform to emax and precision settings (that is, numbers will
+-- conform to rules and exponent will be in permitted range). The
+-- 'left hand side', therefore, may have numbers that cannot be
+-- represented in a decQuad. Some testcases go to the limit of the
+-- next-wider format, and hence these testcases may also be used to
+-- test narrowing and widening operations.
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqbas001 toSci 0 -> 0
+dqbas002 toSci 1 -> 1
+dqbas003 toSci 1.0 -> 1.0
+dqbas004 toSci 1.00 -> 1.00
+dqbas005 toSci 10 -> 10
+dqbas006 toSci 1000 -> 1000
+dqbas007 toSci 10.0 -> 10.0
+dqbas008 toSci 10.1 -> 10.1
+dqbas009 toSci 10.4 -> 10.4
+dqbas010 toSci 10.5 -> 10.5
+dqbas011 toSci 10.6 -> 10.6
+dqbas012 toSci 10.9 -> 10.9
+dqbas013 toSci 11.0 -> 11.0
+dqbas014 toSci 1.234 -> 1.234
+dqbas015 toSci 0.123 -> 0.123
+dqbas016 toSci 0.012 -> 0.012
+dqbas017 toSci -0 -> -0
+dqbas018 toSci -0.0 -> -0.0
+dqbas019 toSci -00.00 -> -0.00
+
+dqbas021 toSci -1 -> -1
+dqbas022 toSci -1.0 -> -1.0
+dqbas023 toSci -0.1 -> -0.1
+dqbas024 toSci -9.1 -> -9.1
+dqbas025 toSci -9.11 -> -9.11
+dqbas026 toSci -9.119 -> -9.119
+dqbas027 toSci -9.999 -> -9.999
+
+dqbas030 toSci '123456789.123456' -> '123456789.123456'
+dqbas031 toSci '123456789.000000' -> '123456789.000000'
+dqbas032 toSci '123456789123456' -> '123456789123456'
+dqbas033 toSci '0.0000123456789' -> '0.0000123456789'
+dqbas034 toSci '0.00000123456789' -> '0.00000123456789'
+dqbas035 toSci '0.000000123456789' -> '1.23456789E-7'
+dqbas036 toSci '0.0000000123456789' -> '1.23456789E-8'
+
+dqbas037 toSci '0.123456789012344' -> '0.123456789012344'
+dqbas038 toSci '0.123456789012345' -> '0.123456789012345'
+
+-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
+dqbsn001 toSci -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqbsn002 toSci -1E-6143 -> -1E-6143
+dqbsn003 toSci -1E-6176 -> -1E-6176 Subnormal
+dqbsn004 toSci -0 -> -0
+dqbsn005 toSci +0 -> 0
+dqbsn006 toSci +1E-6176 -> 1E-6176 Subnormal
+dqbsn007 toSci +1E-6143 -> 1E-6143
+dqbsn008 toSci +9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+
+-- String [many more examples are implicitly tested elsewhere]
+-- strings without E cannot generate E in result
+dqbas040 toSci "12" -> '12'
+dqbas041 toSci "-76" -> '-76'
+dqbas042 toSci "12.76" -> '12.76'
+dqbas043 toSci "+12.76" -> '12.76'
+dqbas044 toSci "012.76" -> '12.76'
+dqbas045 toSci "+0.003" -> '0.003'
+dqbas046 toSci "17." -> '17'
+dqbas047 toSci ".5" -> '0.5'
+dqbas048 toSci "044" -> '44'
+dqbas049 toSci "0044" -> '44'
+dqbas050 toSci "0.0005" -> '0.0005'
+dqbas051 toSci "00.00005" -> '0.00005'
+dqbas052 toSci "0.000005" -> '0.000005'
+dqbas053 toSci "0.0000050" -> '0.0000050'
+dqbas054 toSci "0.0000005" -> '5E-7'
+dqbas055 toSci "0.00000005" -> '5E-8'
+dqbas056 toSci "12345678.543210" -> '12345678.543210'
+dqbas057 toSci "2345678.543210" -> '2345678.543210'
+dqbas058 toSci "345678.543210" -> '345678.543210'
+dqbas059 toSci "0345678.54321" -> '345678.54321'
+dqbas060 toSci "345678.5432" -> '345678.5432'
+dqbas061 toSci "+345678.5432" -> '345678.5432'
+dqbas062 toSci "+0345678.5432" -> '345678.5432'
+dqbas063 toSci "+00345678.5432" -> '345678.5432'
+dqbas064 toSci "-345678.5432" -> '-345678.5432'
+dqbas065 toSci "-0345678.5432" -> '-345678.5432'
+dqbas066 toSci "-00345678.5432" -> '-345678.5432'
+-- examples
+dqbas067 toSci "5E-6" -> '0.000005'
+dqbas068 toSci "50E-7" -> '0.0000050'
+dqbas069 toSci "5E-7" -> '5E-7'
+
+-- [No exotics as no Unicode]
+
+-- rounded with dots in all (including edge) places
+dqbas071 toSci .1234567891234567890123456780123456123 -> 0.1234567891234567890123456780123456 Inexact Rounded
+dqbas072 toSci 1.234567891234567890123456780123456123 -> 1.234567891234567890123456780123456 Inexact Rounded
+dqbas073 toSci 12.34567891234567890123456780123456123 -> 12.34567891234567890123456780123456 Inexact Rounded
+dqbas074 toSci 123.4567891234567890123456780123456123 -> 123.4567891234567890123456780123456 Inexact Rounded
+dqbas075 toSci 1234.567891234567890123456780123456123 -> 1234.567891234567890123456780123456 Inexact Rounded
+dqbas076 toSci 12345.67891234567890123456780123456123 -> 12345.67891234567890123456780123456 Inexact Rounded
+dqbas077 toSci 123456.7891234567890123456780123456123 -> 123456.7891234567890123456780123456 Inexact Rounded
+dqbas078 toSci 1234567.891234567890123456780123456123 -> 1234567.891234567890123456780123456 Inexact Rounded
+dqbas079 toSci 12345678.91234567890123456780123456123 -> 12345678.91234567890123456780123456 Inexact Rounded
+dqbas080 toSci 123456789.1234567890123456780123456123 -> 123456789.1234567890123456780123456 Inexact Rounded
+dqbas081 toSci 1234567891.234567890123456780123456123 -> 1234567891.234567890123456780123456 Inexact Rounded
+dqbas082 toSci 12345678912.34567890123456780123456123 -> 12345678912.34567890123456780123456 Inexact Rounded
+dqbas083 toSci 123456789123.4567890123456780123456123 -> 123456789123.4567890123456780123456 Inexact Rounded
+dqbas084 toSci 1234567891234.567890123456780123456123 -> 1234567891234.567890123456780123456 Inexact Rounded
+dqbas085 toSci 12345678912345.67890123456780123456123 -> 12345678912345.67890123456780123456 Inexact Rounded
+dqbas086 toSci 123456789123456.7890123456780123456123 -> 123456789123456.7890123456780123456 Inexact Rounded
+dqbas087 toSci 1234567891234567.890123456780123456123 -> 1234567891234567.890123456780123456 Inexact Rounded
+dqbas088 toSci 12345678912345678.90123456780123456123 -> 12345678912345678.90123456780123456 Inexact Rounded
+dqbas089 toSci 123456789123456789.0123456780123456123 -> 123456789123456789.0123456780123456 Inexact Rounded
+dqbas090 toSci 1234567891234567890.123456780123456123 -> 1234567891234567890.123456780123456 Inexact Rounded
+dqbas091 toSci 12345678912345678901.23456780123456123 -> 12345678912345678901.23456780123456 Inexact Rounded
+dqbas092 toSci 123456789123456789012.3456780123456123 -> 123456789123456789012.3456780123456 Inexact Rounded
+dqbas093 toSci 1234567891234567890123.456780123456123 -> 1234567891234567890123.456780123456 Inexact Rounded
+dqbas094 toSci 12345678912345678901234.56780123456123 -> 12345678912345678901234.56780123456 Inexact Rounded
+dqbas095 toSci 123456789123456789012345.6780123456123 -> 123456789123456789012345.6780123456 Inexact Rounded
+dqbas096 toSci 1234567891234567890123456.780123456123 -> 1234567891234567890123456.780123456 Inexact Rounded
+dqbas097 toSci 12345678912345678901234567.80123456123 -> 12345678912345678901234567.80123456 Inexact Rounded
+dqbas098 toSci 123456789123456789012345678.0123456123 -> 123456789123456789012345678.0123456 Inexact Rounded
+dqbas099 toSci 1234567891234567890123456780.123456123 -> 1234567891234567890123456780.123456 Inexact Rounded
+dqbas100 toSci 12345678912345678901234567801.23456123 -> 12345678912345678901234567801.23456 Inexact Rounded
+dqbas101 toSci 123456789123456789012345678012.3456123 -> 123456789123456789012345678012.3456 Inexact Rounded
+dqbas102 toSci 1234567891234567890123456780123.456123 -> 1234567891234567890123456780123.456 Inexact Rounded
+dqbas103 toSci 12345678912345678901234567801234.56123 -> 12345678912345678901234567801234.56 Inexact Rounded
+dqbas104 toSci 123456789123456789012345678012345.6123 -> 123456789123456789012345678012345.6 Inexact Rounded
+dqbas105 toSci 1234567891234567890123456780123456.123 -> 1234567891234567890123456780123456 Inexact Rounded
+dqbas106 toSci 12345678912345678901234567801234561.23 -> 1.234567891234567890123456780123456E+34 Inexact Rounded
+dqbas107 toSci 123456789123456789012345678012345612.3 -> 1.234567891234567890123456780123456E+35 Inexact Rounded
+dqbas108 toSci 1234567891234567890123456780123456123. -> 1.234567891234567890123456780123456E+36 Inexact Rounded
+-- 123456789012345678
+
+-- Numbers with E
+dqbas130 toSci "0.000E-1" -> '0.0000'
+dqbas131 toSci "0.000E-2" -> '0.00000'
+dqbas132 toSci "0.000E-3" -> '0.000000'
+dqbas133 toSci "0.000E-4" -> '0E-7'
+dqbas134 toSci "0.00E-2" -> '0.0000'
+dqbas135 toSci "0.00E-3" -> '0.00000'
+dqbas136 toSci "0.00E-4" -> '0.000000'
+dqbas137 toSci "0.00E-5" -> '0E-7'
+dqbas138 toSci "+0E+9" -> '0E+9'
+dqbas139 toSci "-0E+9" -> '-0E+9'
+dqbas140 toSci "1E+9" -> '1E+9'
+dqbas141 toSci "1e+09" -> '1E+9'
+dqbas142 toSci "1E+90" -> '1E+90'
+dqbas143 toSci "+1E+009" -> '1E+9'
+dqbas144 toSci "0E+9" -> '0E+9'
+dqbas145 toSci "1E+9" -> '1E+9'
+dqbas146 toSci "1E+09" -> '1E+9'
+dqbas147 toSci "1e+90" -> '1E+90'
+dqbas148 toSci "1E+009" -> '1E+9'
+dqbas149 toSci "000E+9" -> '0E+9'
+dqbas150 toSci "1E9" -> '1E+9'
+dqbas151 toSci "1e09" -> '1E+9'
+dqbas152 toSci "1E90" -> '1E+90'
+dqbas153 toSci "1E009" -> '1E+9'
+dqbas154 toSci "0E9" -> '0E+9'
+dqbas155 toSci "0.000e+0" -> '0.000'
+dqbas156 toSci "0.000E-1" -> '0.0000'
+dqbas157 toSci "4E+9" -> '4E+9'
+dqbas158 toSci "44E+9" -> '4.4E+10'
+dqbas159 toSci "0.73e-7" -> '7.3E-8'
+dqbas160 toSci "00E+9" -> '0E+9'
+dqbas161 toSci "00E-9" -> '0E-9'
+dqbas162 toSci "10E+9" -> '1.0E+10'
+dqbas163 toSci "10E+09" -> '1.0E+10'
+dqbas164 toSci "10e+90" -> '1.0E+91'
+dqbas165 toSci "10E+009" -> '1.0E+10'
+dqbas166 toSci "100e+9" -> '1.00E+11'
+dqbas167 toSci "100e+09" -> '1.00E+11'
+dqbas168 toSci "100E+90" -> '1.00E+92'
+dqbas169 toSci "100e+009" -> '1.00E+11'
+
+dqbas170 toSci "1.265" -> '1.265'
+dqbas171 toSci "1.265E-20" -> '1.265E-20'
+dqbas172 toSci "1.265E-8" -> '1.265E-8'
+dqbas173 toSci "1.265E-4" -> '0.0001265'
+dqbas174 toSci "1.265E-3" -> '0.001265'
+dqbas175 toSci "1.265E-2" -> '0.01265'
+dqbas176 toSci "1.265E-1" -> '0.1265'
+dqbas177 toSci "1.265E-0" -> '1.265'
+dqbas178 toSci "1.265E+1" -> '12.65'
+dqbas179 toSci "1.265E+2" -> '126.5'
+dqbas180 toSci "1.265E+3" -> '1265'
+dqbas181 toSci "1.265E+4" -> '1.265E+4'
+dqbas182 toSci "1.265E+8" -> '1.265E+8'
+dqbas183 toSci "1.265E+20" -> '1.265E+20'
+
+dqbas190 toSci "12.65" -> '12.65'
+dqbas191 toSci "12.65E-20" -> '1.265E-19'
+dqbas192 toSci "12.65E-8" -> '1.265E-7'
+dqbas193 toSci "12.65E-4" -> '0.001265'
+dqbas194 toSci "12.65E-3" -> '0.01265'
+dqbas195 toSci "12.65E-2" -> '0.1265'
+dqbas196 toSci "12.65E-1" -> '1.265'
+dqbas197 toSci "12.65E-0" -> '12.65'
+dqbas198 toSci "12.65E+1" -> '126.5'
+dqbas199 toSci "12.65E+2" -> '1265'
+dqbas200 toSci "12.65E+3" -> '1.265E+4'
+dqbas201 toSci "12.65E+4" -> '1.265E+5'
+dqbas202 toSci "12.65E+8" -> '1.265E+9'
+dqbas203 toSci "12.65E+20" -> '1.265E+21'
+
+dqbas210 toSci "126.5" -> '126.5'
+dqbas211 toSci "126.5E-20" -> '1.265E-18'
+dqbas212 toSci "126.5E-8" -> '0.000001265'
+dqbas213 toSci "126.5E-4" -> '0.01265'
+dqbas214 toSci "126.5E-3" -> '0.1265'
+dqbas215 toSci "126.5E-2" -> '1.265'
+dqbas216 toSci "126.5E-1" -> '12.65'
+dqbas217 toSci "126.5E-0" -> '126.5'
+dqbas218 toSci "126.5E+1" -> '1265'
+dqbas219 toSci "126.5E+2" -> '1.265E+4'
+dqbas220 toSci "126.5E+3" -> '1.265E+5'
+dqbas221 toSci "126.5E+4" -> '1.265E+6'
+dqbas222 toSci "126.5E+8" -> '1.265E+10'
+dqbas223 toSci "126.5E+20" -> '1.265E+22'
+
+dqbas230 toSci "1265" -> '1265'
+dqbas231 toSci "1265E-20" -> '1.265E-17'
+dqbas232 toSci "1265E-8" -> '0.00001265'
+dqbas233 toSci "1265E-4" -> '0.1265'
+dqbas234 toSci "1265E-3" -> '1.265'
+dqbas235 toSci "1265E-2" -> '12.65'
+dqbas236 toSci "1265E-1" -> '126.5'
+dqbas237 toSci "1265E-0" -> '1265'
+dqbas238 toSci "1265E+1" -> '1.265E+4'
+dqbas239 toSci "1265E+2" -> '1.265E+5'
+dqbas240 toSci "1265E+3" -> '1.265E+6'
+dqbas241 toSci "1265E+4" -> '1.265E+7'
+dqbas242 toSci "1265E+8" -> '1.265E+11'
+dqbas243 toSci "1265E+20" -> '1.265E+23'
+
+dqbas250 toSci "0.1265" -> '0.1265'
+dqbas251 toSci "0.1265E-20" -> '1.265E-21'
+dqbas252 toSci "0.1265E-8" -> '1.265E-9'
+dqbas253 toSci "0.1265E-4" -> '0.00001265'
+dqbas254 toSci "0.1265E-3" -> '0.0001265'
+dqbas255 toSci "0.1265E-2" -> '0.001265'
+dqbas256 toSci "0.1265E-1" -> '0.01265'
+dqbas257 toSci "0.1265E-0" -> '0.1265'
+dqbas258 toSci "0.1265E+1" -> '1.265'
+dqbas259 toSci "0.1265E+2" -> '12.65'
+dqbas260 toSci "0.1265E+3" -> '126.5'
+dqbas261 toSci "0.1265E+4" -> '1265'
+dqbas262 toSci "0.1265E+8" -> '1.265E+7'
+dqbas263 toSci "0.1265E+20" -> '1.265E+19'
+
+-- some more negative zeros [systematic tests below]
+dqbas290 toSci "-0.000E-1" -> '-0.0000'
+dqbas291 toSci "-0.000E-2" -> '-0.00000'
+dqbas292 toSci "-0.000E-3" -> '-0.000000'
+dqbas293 toSci "-0.000E-4" -> '-0E-7'
+dqbas294 toSci "-0.00E-2" -> '-0.0000'
+dqbas295 toSci "-0.00E-3" -> '-0.00000'
+dqbas296 toSci "-0.0E-2" -> '-0.000'
+dqbas297 toSci "-0.0E-3" -> '-0.0000'
+dqbas298 toSci "-0E-2" -> '-0.00'
+dqbas299 toSci "-0E-3" -> '-0.000'
+
+-- Engineering notation tests
+dqbas301 toSci 10e12 -> 1.0E+13
+dqbas302 toEng 10e12 -> 10E+12
+dqbas303 toSci 10e11 -> 1.0E+12
+dqbas304 toEng 10e11 -> 1.0E+12
+dqbas305 toSci 10e10 -> 1.0E+11
+dqbas306 toEng 10e10 -> 100E+9
+dqbas307 toSci 10e9 -> 1.0E+10
+dqbas308 toEng 10e9 -> 10E+9
+dqbas309 toSci 10e8 -> 1.0E+9
+dqbas310 toEng 10e8 -> 1.0E+9
+dqbas311 toSci 10e7 -> 1.0E+8
+dqbas312 toEng 10e7 -> 100E+6
+dqbas313 toSci 10e6 -> 1.0E+7
+dqbas314 toEng 10e6 -> 10E+6
+dqbas315 toSci 10e5 -> 1.0E+6
+dqbas316 toEng 10e5 -> 1.0E+6
+dqbas317 toSci 10e4 -> 1.0E+5
+dqbas318 toEng 10e4 -> 100E+3
+dqbas319 toSci 10e3 -> 1.0E+4
+dqbas320 toEng 10e3 -> 10E+3
+dqbas321 toSci 10e2 -> 1.0E+3
+dqbas322 toEng 10e2 -> 1.0E+3
+dqbas323 toSci 10e1 -> 1.0E+2
+dqbas324 toEng 10e1 -> 100
+dqbas325 toSci 10e0 -> 10
+dqbas326 toEng 10e0 -> 10
+dqbas327 toSci 10e-1 -> 1.0
+dqbas328 toEng 10e-1 -> 1.0
+dqbas329 toSci 10e-2 -> 0.10
+dqbas330 toEng 10e-2 -> 0.10
+dqbas331 toSci 10e-3 -> 0.010
+dqbas332 toEng 10e-3 -> 0.010
+dqbas333 toSci 10e-4 -> 0.0010
+dqbas334 toEng 10e-4 -> 0.0010
+dqbas335 toSci 10e-5 -> 0.00010
+dqbas336 toEng 10e-5 -> 0.00010
+dqbas337 toSci 10e-6 -> 0.000010
+dqbas338 toEng 10e-6 -> 0.000010
+dqbas339 toSci 10e-7 -> 0.0000010
+dqbas340 toEng 10e-7 -> 0.0000010
+dqbas341 toSci 10e-8 -> 1.0E-7
+dqbas342 toEng 10e-8 -> 100E-9
+dqbas343 toSci 10e-9 -> 1.0E-8
+dqbas344 toEng 10e-9 -> 10E-9
+dqbas345 toSci 10e-10 -> 1.0E-9
+dqbas346 toEng 10e-10 -> 1.0E-9
+dqbas347 toSci 10e-11 -> 1.0E-10
+dqbas348 toEng 10e-11 -> 100E-12
+dqbas349 toSci 10e-12 -> 1.0E-11
+dqbas350 toEng 10e-12 -> 10E-12
+dqbas351 toSci 10e-13 -> 1.0E-12
+dqbas352 toEng 10e-13 -> 1.0E-12
+
+dqbas361 toSci 7E12 -> 7E+12
+dqbas362 toEng 7E12 -> 7E+12
+dqbas363 toSci 7E11 -> 7E+11
+dqbas364 toEng 7E11 -> 700E+9
+dqbas365 toSci 7E10 -> 7E+10
+dqbas366 toEng 7E10 -> 70E+9
+dqbas367 toSci 7E9 -> 7E+9
+dqbas368 toEng 7E9 -> 7E+9
+dqbas369 toSci 7E8 -> 7E+8
+dqbas370 toEng 7E8 -> 700E+6
+dqbas371 toSci 7E7 -> 7E+7
+dqbas372 toEng 7E7 -> 70E+6
+dqbas373 toSci 7E6 -> 7E+6
+dqbas374 toEng 7E6 -> 7E+6
+dqbas375 toSci 7E5 -> 7E+5
+dqbas376 toEng 7E5 -> 700E+3
+dqbas377 toSci 7E4 -> 7E+4
+dqbas378 toEng 7E4 -> 70E+3
+dqbas379 toSci 7E3 -> 7E+3
+dqbas380 toEng 7E3 -> 7E+3
+dqbas381 toSci 7E2 -> 7E+2
+dqbas382 toEng 7E2 -> 700
+dqbas383 toSci 7E1 -> 7E+1
+dqbas384 toEng 7E1 -> 70
+dqbas385 toSci 7E0 -> 7
+dqbas386 toEng 7E0 -> 7
+dqbas387 toSci 7E-1 -> 0.7
+dqbas388 toEng 7E-1 -> 0.7
+dqbas389 toSci 7E-2 -> 0.07
+dqbas390 toEng 7E-2 -> 0.07
+dqbas391 toSci 7E-3 -> 0.007
+dqbas392 toEng 7E-3 -> 0.007
+dqbas393 toSci 7E-4 -> 0.0007
+dqbas394 toEng 7E-4 -> 0.0007
+dqbas395 toSci 7E-5 -> 0.00007
+dqbas396 toEng 7E-5 -> 0.00007
+dqbas397 toSci 7E-6 -> 0.000007
+dqbas398 toEng 7E-6 -> 0.000007
+dqbas399 toSci 7E-7 -> 7E-7
+dqbas400 toEng 7E-7 -> 700E-9
+dqbas401 toSci 7E-8 -> 7E-8
+dqbas402 toEng 7E-8 -> 70E-9
+dqbas403 toSci 7E-9 -> 7E-9
+dqbas404 toEng 7E-9 -> 7E-9
+dqbas405 toSci 7E-10 -> 7E-10
+dqbas406 toEng 7E-10 -> 700E-12
+dqbas407 toSci 7E-11 -> 7E-11
+dqbas408 toEng 7E-11 -> 70E-12
+dqbas409 toSci 7E-12 -> 7E-12
+dqbas410 toEng 7E-12 -> 7E-12
+dqbas411 toSci 7E-13 -> 7E-13
+dqbas412 toEng 7E-13 -> 700E-15
+
+-- Exacts remain exact up to precision ..
+dqbas420 toSci 100 -> 100
+dqbas422 toSci 1000 -> 1000
+dqbas424 toSci 999.9 -> 999.9
+dqbas426 toSci 1000.0 -> 1000.0
+dqbas428 toSci 1000.1 -> 1000.1
+dqbas430 toSci 10000 -> 10000
+dqbas432 toSci 1000000000000000000000000000000 -> 1000000000000000000000000000000
+dqbas434 toSci 10000000000000000000000000000000 -> 10000000000000000000000000000000
+dqbas436 toSci 100000000000000000000000000000000 -> 100000000000000000000000000000000
+dqbas438 toSci 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqbas440 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded
+dqbas442 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded
+dqbas444 toSci 10000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+34 Rounded Inexact
+dqbas446 toSci 10000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+34 Rounded Inexact
+dqbas448 toSci 100000000000000000000000000000000050 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
+dqbas450 toSci 10000000000000000000000000000000009 -> 1.000000000000000000000000000000001E+34 Rounded Inexact
+dqbas452 toSci 100000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+35 Rounded
+dqbas454 toSci 100000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
+dqbas456 toSci 100000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
+dqbas458 toSci 100000000000000000000000000000000009 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
+dqbas460 toSci 1000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+36 Rounded
+dqbas462 toSci 1000000000000000000000000000000000300 -> 1.000000000000000000000000000000000E+36 Rounded Inexact
+dqbas464 toSci 1000000000000000000000000000000000500 -> 1.000000000000000000000000000000000E+36 Rounded Inexact
+dqbas466 toSci 1000000000000000000000000000000000900 -> 1.000000000000000000000000000000001E+36 Rounded Inexact
+dqbas468 toSci 10000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+37 Rounded
+dqbas470 toSci 10000000000000000000000000000000003000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact
+dqbas472 toSci 10000000000000000000000000000000005000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact
+dqbas474 toSci 10000000000000000000000000000000009000 -> 1.000000000000000000000000000000001E+37 Rounded Inexact
+
+-- check rounding modes heeded
+rounding: ceiling
+dqbsr401 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr402 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr403 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr404 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+rounding: up
+dqbsr405 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr406 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr407 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr408 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+rounding: floor
+dqbsr410 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr411 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr412 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr413 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact
+rounding: half_down
+dqbsr415 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr416 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr417 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr418 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr419 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+rounding: half_even
+dqbsr421 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr422 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr423 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr424 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr425 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+rounding: down
+dqbsr426 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr427 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr428 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr429 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact
+rounding: half_up
+dqbsr431 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr432 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr433 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr434 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112347 Rounded Inexact
+dqbsr435 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+-- negatives
+rounding: ceiling
+dqbsr501 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr502 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr503 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr504 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact
+rounding: up
+dqbsr505 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr506 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr507 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr508 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+rounding: floor
+dqbsr510 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr511 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr512 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr513 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+rounding: half_down
+dqbsr515 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr516 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr517 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr518 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr519 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+rounding: half_even
+dqbsr521 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr522 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr523 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr524 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr525 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+rounding: down
+dqbsr526 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr527 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr528 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr529 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact
+rounding: half_up
+dqbsr531 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr532 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr533 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr534 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112347 Rounded Inexact
+dqbsr535 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+
+rounding: half_even
+
+-- The 'baddies' tests from DiagBigDecimal, plus some new ones
+dqbas500 toSci '1..2' -> NaN Conversion_syntax
+dqbas501 toSci '.' -> NaN Conversion_syntax
+dqbas502 toSci '..' -> NaN Conversion_syntax
+dqbas503 toSci '++1' -> NaN Conversion_syntax
+dqbas504 toSci '--1' -> NaN Conversion_syntax
+dqbas505 toSci '-+1' -> NaN Conversion_syntax
+dqbas506 toSci '+-1' -> NaN Conversion_syntax
+dqbas507 toSci '12e' -> NaN Conversion_syntax
+dqbas508 toSci '12e++' -> NaN Conversion_syntax
+dqbas509 toSci '12f4' -> NaN Conversion_syntax
+dqbas510 toSci ' +1' -> NaN Conversion_syntax
+dqbas511 toSci '+ 1' -> NaN Conversion_syntax
+dqbas512 toSci '12 ' -> NaN Conversion_syntax
+dqbas513 toSci ' + 1' -> NaN Conversion_syntax
+dqbas514 toSci ' - 1 ' -> NaN Conversion_syntax
+dqbas515 toSci 'x' -> NaN Conversion_syntax
+dqbas516 toSci '-1-' -> NaN Conversion_syntax
+dqbas517 toSci '12-' -> NaN Conversion_syntax
+dqbas518 toSci '3+' -> NaN Conversion_syntax
+dqbas519 toSci '' -> NaN Conversion_syntax
+dqbas520 toSci '1e-' -> NaN Conversion_syntax
+dqbas521 toSci '7e99999a' -> NaN Conversion_syntax
+dqbas522 toSci '7e123567890x' -> NaN Conversion_syntax
+dqbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
+dqbas524 toSci '' -> NaN Conversion_syntax
+dqbas525 toSci 'e100' -> NaN Conversion_syntax
+dqbas526 toSci '\u0e5a' -> NaN Conversion_syntax
+dqbas527 toSci '\u0b65' -> NaN Conversion_syntax
+dqbas528 toSci '123,65' -> NaN Conversion_syntax
+dqbas529 toSci '1.34.5' -> NaN Conversion_syntax
+dqbas530 toSci '.123.5' -> NaN Conversion_syntax
+dqbas531 toSci '01.35.' -> NaN Conversion_syntax
+dqbas532 toSci '01.35-' -> NaN Conversion_syntax
+dqbas533 toSci '0000..' -> NaN Conversion_syntax
+dqbas534 toSci '.0000.' -> NaN Conversion_syntax
+dqbas535 toSci '00..00' -> NaN Conversion_syntax
+dqbas536 toSci '111e*123' -> NaN Conversion_syntax
+dqbas537 toSci '111e123-' -> NaN Conversion_syntax
+dqbas538 toSci '111e+12+' -> NaN Conversion_syntax
+dqbas539 toSci '111e1-3-' -> NaN Conversion_syntax
+dqbas540 toSci '111e1*23' -> NaN Conversion_syntax
+dqbas541 toSci '111e1e+3' -> NaN Conversion_syntax
+dqbas542 toSci '1e1.0' -> NaN Conversion_syntax
+dqbas543 toSci '1e123e' -> NaN Conversion_syntax
+dqbas544 toSci 'ten' -> NaN Conversion_syntax
+dqbas545 toSci 'ONE' -> NaN Conversion_syntax
+dqbas546 toSci '1e.1' -> NaN Conversion_syntax
+dqbas547 toSci '1e1.' -> NaN Conversion_syntax
+dqbas548 toSci '1ee' -> NaN Conversion_syntax
+dqbas549 toSci 'e+1' -> NaN Conversion_syntax
+dqbas550 toSci '1.23.4' -> NaN Conversion_syntax
+dqbas551 toSci '1.2.1' -> NaN Conversion_syntax
+dqbas552 toSci '1E+1.2' -> NaN Conversion_syntax
+dqbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
+dqbas554 toSci '1E++1' -> NaN Conversion_syntax
+dqbas555 toSci '1E--1' -> NaN Conversion_syntax
+dqbas556 toSci '1E+-1' -> NaN Conversion_syntax
+dqbas557 toSci '1E-+1' -> NaN Conversion_syntax
+dqbas558 toSci '1E''1' -> NaN Conversion_syntax
+dqbas559 toSci "1E""1" -> NaN Conversion_syntax
+dqbas560 toSci "1E""""" -> NaN Conversion_syntax
+-- Near-specials
+dqbas561 toSci "qNaN" -> NaN Conversion_syntax
+dqbas562 toSci "NaNq" -> NaN Conversion_syntax
+dqbas563 toSci "NaNs" -> NaN Conversion_syntax
+dqbas564 toSci "Infi" -> NaN Conversion_syntax
+dqbas565 toSci "Infin" -> NaN Conversion_syntax
+dqbas566 toSci "Infini" -> NaN Conversion_syntax
+dqbas567 toSci "Infinit" -> NaN Conversion_syntax
+dqbas568 toSci "-Infinit" -> NaN Conversion_syntax
+dqbas569 toSci "0Inf" -> NaN Conversion_syntax
+dqbas570 toSci "9Inf" -> NaN Conversion_syntax
+dqbas571 toSci "-0Inf" -> NaN Conversion_syntax
+dqbas572 toSci "-9Inf" -> NaN Conversion_syntax
+dqbas573 toSci "-sNa" -> NaN Conversion_syntax
+dqbas574 toSci "xNaN" -> NaN Conversion_syntax
+dqbas575 toSci "0sNaN" -> NaN Conversion_syntax
+
+-- some baddies with dots and Es and dots and specials
+dqbas576 toSci 'e+1' -> NaN Conversion_syntax
+dqbas577 toSci '.e+1' -> NaN Conversion_syntax
+dqbas578 toSci '+.e+1' -> NaN Conversion_syntax
+dqbas579 toSci '-.e+' -> NaN Conversion_syntax
+dqbas580 toSci '-.e' -> NaN Conversion_syntax
+dqbas581 toSci 'E+1' -> NaN Conversion_syntax
+dqbas582 toSci '.E+1' -> NaN Conversion_syntax
+dqbas583 toSci '+.E+1' -> NaN Conversion_syntax
+dqbas584 toSci '-.E+' -> NaN Conversion_syntax
+dqbas585 toSci '-.E' -> NaN Conversion_syntax
+
+dqbas586 toSci '.NaN' -> NaN Conversion_syntax
+dqbas587 toSci '-.NaN' -> NaN Conversion_syntax
+dqbas588 toSci '+.sNaN' -> NaN Conversion_syntax
+dqbas589 toSci '+.Inf' -> NaN Conversion_syntax
+dqbas590 toSci '.Infinity' -> NaN Conversion_syntax
+
+-- Zeros
+dqbas601 toSci 0.000000000 -> 0E-9
+dqbas602 toSci 0.00000000 -> 0E-8
+dqbas603 toSci 0.0000000 -> 0E-7
+dqbas604 toSci 0.000000 -> 0.000000
+dqbas605 toSci 0.00000 -> 0.00000
+dqbas606 toSci 0.0000 -> 0.0000
+dqbas607 toSci 0.000 -> 0.000
+dqbas608 toSci 0.00 -> 0.00
+dqbas609 toSci 0.0 -> 0.0
+dqbas610 toSci .0 -> 0.0
+dqbas611 toSci 0. -> 0
+dqbas612 toSci -.0 -> -0.0
+dqbas613 toSci -0. -> -0
+dqbas614 toSci -0.0 -> -0.0
+dqbas615 toSci -0.00 -> -0.00
+dqbas616 toSci -0.000 -> -0.000
+dqbas617 toSci -0.0000 -> -0.0000
+dqbas618 toSci -0.00000 -> -0.00000
+dqbas619 toSci -0.000000 -> -0.000000
+dqbas620 toSci -0.0000000 -> -0E-7
+dqbas621 toSci -0.00000000 -> -0E-8
+dqbas622 toSci -0.000000000 -> -0E-9
+
+dqbas630 toSci 0.00E+0 -> 0.00
+dqbas631 toSci 0.00E+1 -> 0.0
+dqbas632 toSci 0.00E+2 -> 0
+dqbas633 toSci 0.00E+3 -> 0E+1
+dqbas634 toSci 0.00E+4 -> 0E+2
+dqbas635 toSci 0.00E+5 -> 0E+3
+dqbas636 toSci 0.00E+6 -> 0E+4
+dqbas637 toSci 0.00E+7 -> 0E+5
+dqbas638 toSci 0.00E+8 -> 0E+6
+dqbas639 toSci 0.00E+9 -> 0E+7
+
+dqbas640 toSci 0.0E+0 -> 0.0
+dqbas641 toSci 0.0E+1 -> 0
+dqbas642 toSci 0.0E+2 -> 0E+1
+dqbas643 toSci 0.0E+3 -> 0E+2
+dqbas644 toSci 0.0E+4 -> 0E+3
+dqbas645 toSci 0.0E+5 -> 0E+4
+dqbas646 toSci 0.0E+6 -> 0E+5
+dqbas647 toSci 0.0E+7 -> 0E+6
+dqbas648 toSci 0.0E+8 -> 0E+7
+dqbas649 toSci 0.0E+9 -> 0E+8
+
+dqbas650 toSci 0E+0 -> 0
+dqbas651 toSci 0E+1 -> 0E+1
+dqbas652 toSci 0E+2 -> 0E+2
+dqbas653 toSci 0E+3 -> 0E+3
+dqbas654 toSci 0E+4 -> 0E+4
+dqbas655 toSci 0E+5 -> 0E+5
+dqbas656 toSci 0E+6 -> 0E+6
+dqbas657 toSci 0E+7 -> 0E+7
+dqbas658 toSci 0E+8 -> 0E+8
+dqbas659 toSci 0E+9 -> 0E+9
+
+dqbas660 toSci 0.0E-0 -> 0.0
+dqbas661 toSci 0.0E-1 -> 0.00
+dqbas662 toSci 0.0E-2 -> 0.000
+dqbas663 toSci 0.0E-3 -> 0.0000
+dqbas664 toSci 0.0E-4 -> 0.00000
+dqbas665 toSci 0.0E-5 -> 0.000000
+dqbas666 toSci 0.0E-6 -> 0E-7
+dqbas667 toSci 0.0E-7 -> 0E-8
+dqbas668 toSci 0.0E-8 -> 0E-9
+dqbas669 toSci 0.0E-9 -> 0E-10
+
+dqbas670 toSci 0.00E-0 -> 0.00
+dqbas671 toSci 0.00E-1 -> 0.000
+dqbas672 toSci 0.00E-2 -> 0.0000
+dqbas673 toSci 0.00E-3 -> 0.00000
+dqbas674 toSci 0.00E-4 -> 0.000000
+dqbas675 toSci 0.00E-5 -> 0E-7
+dqbas676 toSci 0.00E-6 -> 0E-8
+dqbas677 toSci 0.00E-7 -> 0E-9
+dqbas678 toSci 0.00E-8 -> 0E-10
+dqbas679 toSci 0.00E-9 -> 0E-11
+
+dqbas680 toSci 000000. -> 0
+dqbas681 toSci 00000. -> 0
+dqbas682 toSci 0000. -> 0
+dqbas683 toSci 000. -> 0
+dqbas684 toSci 00. -> 0
+dqbas685 toSci 0. -> 0
+dqbas686 toSci +00000. -> 0
+dqbas687 toSci -00000. -> -0
+dqbas688 toSci +0. -> 0
+dqbas689 toSci -0. -> -0
+
+-- Specials
+dqbas700 toSci "NaN" -> NaN
+dqbas701 toSci "nan" -> NaN
+dqbas702 toSci "nAn" -> NaN
+dqbas703 toSci "NAN" -> NaN
+dqbas704 toSci "+NaN" -> NaN
+dqbas705 toSci "+nan" -> NaN
+dqbas706 toSci "+nAn" -> NaN
+dqbas707 toSci "+NAN" -> NaN
+dqbas708 toSci "-NaN" -> -NaN
+dqbas709 toSci "-nan" -> -NaN
+dqbas710 toSci "-nAn" -> -NaN
+dqbas711 toSci "-NAN" -> -NaN
+dqbas712 toSci 'NaN0' -> NaN
+dqbas713 toSci 'NaN1' -> NaN1
+dqbas714 toSci 'NaN12' -> NaN12
+dqbas715 toSci 'NaN123' -> NaN123
+dqbas716 toSci 'NaN1234' -> NaN1234
+dqbas717 toSci 'NaN01' -> NaN1
+dqbas718 toSci 'NaN012' -> NaN12
+dqbas719 toSci 'NaN0123' -> NaN123
+dqbas720 toSci 'NaN01234' -> NaN1234
+dqbas721 toSci 'NaN001' -> NaN1
+dqbas722 toSci 'NaN0012' -> NaN12
+dqbas723 toSci 'NaN00123' -> NaN123
+dqbas724 toSci 'NaN001234' -> NaN1234
+dqbas725 toSci 'NaN1234567890123456781234567890123456' -> NaN Conversion_syntax
+dqbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
+dqbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
+dqbas728 toSci 'NaN-12' -> NaN Conversion_syntax
+dqbas729 toSci 'NaN+12' -> NaN Conversion_syntax
+
+dqbas730 toSci "sNaN" -> sNaN
+dqbas731 toSci "snan" -> sNaN
+dqbas732 toSci "SnAn" -> sNaN
+dqbas733 toSci "SNAN" -> sNaN
+dqbas734 toSci "+sNaN" -> sNaN
+dqbas735 toSci "+snan" -> sNaN
+dqbas736 toSci "+SnAn" -> sNaN
+dqbas737 toSci "+SNAN" -> sNaN
+dqbas738 toSci "-sNaN" -> -sNaN
+dqbas739 toSci "-snan" -> -sNaN
+dqbas740 toSci "-SnAn" -> -sNaN
+dqbas741 toSci "-SNAN" -> -sNaN
+dqbas742 toSci 'sNaN0000' -> sNaN
+dqbas743 toSci 'sNaN7' -> sNaN7
+dqbas744 toSci 'sNaN007234' -> sNaN7234
+dqbas745 toSci 'sNaN1234567890123456787234561234567890' -> NaN Conversion_syntax
+dqbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
+dqbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
+
+dqbas748 toSci "Inf" -> Infinity
+dqbas749 toSci "inf" -> Infinity
+dqbas750 toSci "iNf" -> Infinity
+dqbas751 toSci "INF" -> Infinity
+dqbas752 toSci "+Inf" -> Infinity
+dqbas753 toSci "+inf" -> Infinity
+dqbas754 toSci "+iNf" -> Infinity
+dqbas755 toSci "+INF" -> Infinity
+dqbas756 toSci "-Inf" -> -Infinity
+dqbas757 toSci "-inf" -> -Infinity
+dqbas758 toSci "-iNf" -> -Infinity
+dqbas759 toSci "-INF" -> -Infinity
+
+dqbas760 toSci "Infinity" -> Infinity
+dqbas761 toSci "infinity" -> Infinity
+dqbas762 toSci "iNfInItY" -> Infinity
+dqbas763 toSci "INFINITY" -> Infinity
+dqbas764 toSci "+Infinity" -> Infinity
+dqbas765 toSci "+infinity" -> Infinity
+dqbas766 toSci "+iNfInItY" -> Infinity
+dqbas767 toSci "+INFINITY" -> Infinity
+dqbas768 toSci "-Infinity" -> -Infinity
+dqbas769 toSci "-infinity" -> -Infinity
+dqbas770 toSci "-iNfInItY" -> -Infinity
+dqbas771 toSci "-INFINITY" -> -Infinity
+
+-- Specials and zeros for toEng
+dqbast772 toEng "NaN" -> NaN
+dqbast773 toEng "-Infinity" -> -Infinity
+dqbast774 toEng "-sNaN" -> -sNaN
+dqbast775 toEng "-NaN" -> -NaN
+dqbast776 toEng "+Infinity" -> Infinity
+dqbast778 toEng "+sNaN" -> sNaN
+dqbast779 toEng "+NaN" -> NaN
+dqbast780 toEng "INFINITY" -> Infinity
+dqbast781 toEng "SNAN" -> sNaN
+dqbast782 toEng "NAN" -> NaN
+dqbast783 toEng "infinity" -> Infinity
+dqbast784 toEng "snan" -> sNaN
+dqbast785 toEng "nan" -> NaN
+dqbast786 toEng "InFINITY" -> Infinity
+dqbast787 toEng "SnAN" -> sNaN
+dqbast788 toEng "nAN" -> NaN
+dqbast789 toEng "iNfinity" -> Infinity
+dqbast790 toEng "sNan" -> sNaN
+dqbast791 toEng "Nan" -> NaN
+dqbast792 toEng "Infinity" -> Infinity
+dqbast793 toEng "sNaN" -> sNaN
+
+-- Zero toEng, etc.
+dqbast800 toEng 0e+1 -> "0.00E+3" -- doc example
+
+dqbast801 toEng 0.000000000 -> 0E-9
+dqbast802 toEng 0.00000000 -> 0.00E-6
+dqbast803 toEng 0.0000000 -> 0.0E-6
+dqbast804 toEng 0.000000 -> 0.000000
+dqbast805 toEng 0.00000 -> 0.00000
+dqbast806 toEng 0.0000 -> 0.0000
+dqbast807 toEng 0.000 -> 0.000
+dqbast808 toEng 0.00 -> 0.00
+dqbast809 toEng 0.0 -> 0.0
+dqbast810 toEng .0 -> 0.0
+dqbast811 toEng 0. -> 0
+dqbast812 toEng -.0 -> -0.0
+dqbast813 toEng -0. -> -0
+dqbast814 toEng -0.0 -> -0.0
+dqbast815 toEng -0.00 -> -0.00
+dqbast816 toEng -0.000 -> -0.000
+dqbast817 toEng -0.0000 -> -0.0000
+dqbast818 toEng -0.00000 -> -0.00000
+dqbast819 toEng -0.000000 -> -0.000000
+dqbast820 toEng -0.0000000 -> -0.0E-6
+dqbast821 toEng -0.00000000 -> -0.00E-6
+dqbast822 toEng -0.000000000 -> -0E-9
+
+dqbast830 toEng 0.00E+0 -> 0.00
+dqbast831 toEng 0.00E+1 -> 0.0
+dqbast832 toEng 0.00E+2 -> 0
+dqbast833 toEng 0.00E+3 -> 0.00E+3
+dqbast834 toEng 0.00E+4 -> 0.0E+3
+dqbast835 toEng 0.00E+5 -> 0E+3
+dqbast836 toEng 0.00E+6 -> 0.00E+6
+dqbast837 toEng 0.00E+7 -> 0.0E+6
+dqbast838 toEng 0.00E+8 -> 0E+6
+dqbast839 toEng 0.00E+9 -> 0.00E+9
+
+dqbast840 toEng 0.0E+0 -> 0.0
+dqbast841 toEng 0.0E+1 -> 0
+dqbast842 toEng 0.0E+2 -> 0.00E+3
+dqbast843 toEng 0.0E+3 -> 0.0E+3
+dqbast844 toEng 0.0E+4 -> 0E+3
+dqbast845 toEng 0.0E+5 -> 0.00E+6
+dqbast846 toEng 0.0E+6 -> 0.0E+6
+dqbast847 toEng 0.0E+7 -> 0E+6
+dqbast848 toEng 0.0E+8 -> 0.00E+9
+dqbast849 toEng 0.0E+9 -> 0.0E+9
+
+dqbast850 toEng 0E+0 -> 0
+dqbast851 toEng 0E+1 -> 0.00E+3
+dqbast852 toEng 0E+2 -> 0.0E+3
+dqbast853 toEng 0E+3 -> 0E+3
+dqbast854 toEng 0E+4 -> 0.00E+6
+dqbast855 toEng 0E+5 -> 0.0E+6
+dqbast856 toEng 0E+6 -> 0E+6
+dqbast857 toEng 0E+7 -> 0.00E+9
+dqbast858 toEng 0E+8 -> 0.0E+9
+dqbast859 toEng 0E+9 -> 0E+9
+
+dqbast860 toEng 0.0E-0 -> 0.0
+dqbast861 toEng 0.0E-1 -> 0.00
+dqbast862 toEng 0.0E-2 -> 0.000
+dqbast863 toEng 0.0E-3 -> 0.0000
+dqbast864 toEng 0.0E-4 -> 0.00000
+dqbast865 toEng 0.0E-5 -> 0.000000
+dqbast866 toEng 0.0E-6 -> 0.0E-6
+dqbast867 toEng 0.0E-7 -> 0.00E-6
+dqbast868 toEng 0.0E-8 -> 0E-9
+dqbast869 toEng 0.0E-9 -> 0.0E-9
+
+dqbast870 toEng 0.00E-0 -> 0.00
+dqbast871 toEng 0.00E-1 -> 0.000
+dqbast872 toEng 0.00E-2 -> 0.0000
+dqbast873 toEng 0.00E-3 -> 0.00000
+dqbast874 toEng 0.00E-4 -> 0.000000
+dqbast875 toEng 0.00E-5 -> 0.0E-6
+dqbast876 toEng 0.00E-6 -> 0.00E-6
+dqbast877 toEng 0.00E-7 -> 0E-9
+dqbast878 toEng 0.00E-8 -> 0.0E-9
+dqbast879 toEng 0.00E-9 -> 0.00E-9
+
+-- long input strings
+dqbas801 tosci '01234567890123456' -> 1234567890123456
+dqbas802 tosci '001234567890123456' -> 1234567890123456
+dqbas803 tosci '0001234567890123456' -> 1234567890123456
+dqbas804 tosci '00001234567890123456' -> 1234567890123456
+dqbas805 tosci '000001234567890123456' -> 1234567890123456
+dqbas806 tosci '0000001234567890123456' -> 1234567890123456
+dqbas807 tosci '00000001234567890123456' -> 1234567890123456
+dqbas808 tosci '000000001234567890123456' -> 1234567890123456
+dqbas809 tosci '0000000001234567890123456' -> 1234567890123456
+dqbas810 tosci '00000000001234567890123456' -> 1234567890123456
+
+dqbas811 tosci '0.1234567890123456' -> 0.1234567890123456
+dqbas812 tosci '0.01234567890123456' -> 0.01234567890123456
+dqbas813 tosci '0.001234567890123456' -> 0.001234567890123456
+dqbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456
+dqbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456
+dqbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456
+dqbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7
+dqbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8
+dqbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9
+dqbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10
+
+dqbas821 tosci '12345678912345678901234567801234567890' -> 1.234567891234567890123456780123457E+37 Inexact Rounded
+dqbas822 tosci '123456789123456789012345678012345678901' -> 1.234567891234567890123456780123457E+38 Inexact Rounded
+dqbas823 tosci '1234567891234567890123456780123456789012' -> 1.234567891234567890123456780123457E+39 Inexact Rounded
+dqbas824 tosci '12345678912345678901234567801234567890123' -> 1.234567891234567890123456780123457E+40 Inexact Rounded
+dqbas825 tosci '123456789123456789012345678012345678901234' -> 1.234567891234567890123456780123457E+41 Inexact Rounded
+dqbas826 tosci '1234567891234567890123456780123456789012345' -> 1.234567891234567890123456780123457E+42 Inexact Rounded
+dqbas827 tosci '12345678912345678901234567801234567890123456' -> 1.234567891234567890123456780123457E+43 Inexact Rounded
+dqbas828 tosci '123456789123456789012345678012345678901234567' -> 1.234567891234567890123456780123457E+44 Inexact Rounded
+dqbas829 tosci '1234567891234567890123456780123456789012345678' -> 1.234567891234567890123456780123457E+45 Inexact Rounded
+
+-- subnormals and overflows
+dqbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
+dqbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
+dqbas908 toSci '0.9e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas909 toSci '0.09e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
+dqbas911 toSci '10e-1000000000' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
+dqbas913 toSci '99e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
+dqbas915 toSci '1111e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas916 toSci '1111e-99999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
+-- negatives the same
+dqbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
+dqbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
+dqbas920 toSci '-0.9e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas921 toSci '-0.09e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
+dqbas923 toSci '-10e-1000000000' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
+dqbas925 toSci '-99e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
+dqbas927 toSci '-1111e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas928 toSci '-1111e-99999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
+
+-- overflow results at different rounding modes
+rounding: ceiling
+dqbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas931 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+rounding: up
+dqbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: down
+dqbas934 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqbas935 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+rounding: floor
+dqbas936 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_up
+dqbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_even
+dqbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_down
+dqbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_even
+
+-- Now check 854/754r some subnormals and underflow to 0
+dqbem400 toSci 1.0000E-383 -> 1.0000E-383
+dqbem401 toSci 0.1E-6172 -> 1E-6173 Subnormal
+dqbem402 toSci 0.1000E-6172 -> 1.000E-6173 Subnormal
+dqbem403 toSci 0.0100E-6172 -> 1.00E-6174 Subnormal
+dqbem404 toSci 0.0010E-6172 -> 1.0E-6175 Subnormal
+dqbem405 toSci 0.0001E-6172 -> 1E-6176 Subnormal
+dqbem406 toSci 0.00010E-6172 -> 1E-6176 Subnormal Rounded
+dqbem407 toSci 0.00013E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqbem408 toSci 0.00015E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem409 toSci 0.00017E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem410 toSci 0.00023E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem411 toSci 0.00025E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem412 toSci 0.00027E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqbem413 toSci 0.000149E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqbem414 toSci 0.000150E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem415 toSci 0.000151E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem416 toSci 0.000249E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem417 toSci 0.000250E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem418 toSci 0.000251E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqbem419 toSci 0.00009E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqbem420 toSci 0.00005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem421 toSci 0.00003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem422 toSci 0.000009E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem423 toSci 0.000005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem424 toSci 0.000003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqbem425 toSci 0.001049E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
+dqbem426 toSci 0.001050E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
+dqbem427 toSci 0.001051E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded
+dqbem428 toSci 0.001149E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded
+dqbem429 toSci 0.001150E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded
+dqbem430 toSci 0.001151E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded
+
+dqbem432 toSci 0.010049E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
+dqbem433 toSci 0.010050E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
+dqbem434 toSci 0.010051E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded
+dqbem435 toSci 0.010149E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded
+dqbem436 toSci 0.010150E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded
+dqbem437 toSci 0.010151E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded
+
+dqbem440 toSci 0.10103E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded
+dqbem441 toSci 0.10105E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded
+dqbem442 toSci 0.10107E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded
+dqbem443 toSci 0.10113E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded
+dqbem444 toSci 0.10115E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded
+dqbem445 toSci 0.10117E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded
+
+dqbem450 toSci 1.10730E-6173 -> 1.107E-6173 Underflow Subnormal Inexact Rounded
+dqbem451 toSci 1.10750E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
+dqbem452 toSci 1.10770E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
+dqbem453 toSci 1.10830E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
+dqbem454 toSci 1.10850E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
+dqbem455 toSci 1.10870E-6173 -> 1.109E-6173 Underflow Subnormal Inexact Rounded
+
+-- make sure sign OK
+dqbem456 toSci -0.10103E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded
+dqbem457 toSci -0.10105E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded
+dqbem458 toSci -0.10107E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded
+dqbem459 toSci -0.10113E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded
+dqbem460 toSci -0.10115E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded
+dqbem461 toSci -0.10117E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded
+
+-- '999s' cases
+dqbem464 toSci 999999E-6173 -> 9.99999E-6168 Subnormal
+dqbem465 toSci 99999.0E-6172 -> 9.99990E-6168 Subnormal
+dqbem466 toSci 99999.E-6172 -> 9.9999E-6168 Subnormal
+dqbem467 toSci 9999.9E-6172 -> 9.9999E-6169 Subnormal
+dqbem468 toSci 999.99E-6172 -> 9.9999E-6170 Subnormal
+dqbem469 toSci 99.999E-6172 -> 9.9999E-6171 Subnormal
+dqbem470 toSci 9.9999E-6172 -> 9.9999E-6172 Subnormal
+dqbem471 toSci 0.99999E-6172 -> 1.0000E-6172 Underflow Subnormal Inexact Rounded
+dqbem472 toSci 0.099999E-6172 -> 1.000E-6173 Underflow Subnormal Inexact Rounded
+dqbem473 toSci 0.0099999E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
+dqbem474 toSci 0.00099999E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
+dqbem475 toSci 0.000099999E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqbem476 toSci 0.0000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem477 toSci 0.00000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem478 toSci 0.000000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- Exponents with insignificant leading zeros
+dqbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
+dqbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
+dqbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
+dqbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
+dqbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
+dqbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
+dqbas1007 toSci 1e-999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1008 toSci 1e-0999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1009 toSci 1e-00999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1010 toSci 1e-000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1011 toSci 1e-000000000000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1012 toSci 1e-000000000001000000007 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- check for double-rounded subnormals
+dqbas1041 toSci 1.1111111111111111111111111111152444E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
+dqbas1042 toSci 1.1111111111111111111111111111152445E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
+dqbas1043 toSci 1.1111111111111111111111111111152446E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
+
+-- clamped zeros [see also clamp.decTest]
+dqbas1075 toSci 0e+10000 -> 0E+6111 Clamped
+dqbas1076 toSci 0e-10000 -> 0E-6176 Clamped
+dqbas1077 toSci -0e+10000 -> -0E+6111 Clamped
+dqbas1078 toSci -0e-10000 -> -0E-6176 Clamped
+
+-- extreme values from next-wider
+dqbas1101 toSci -9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> -Infinity Overflow Inexact Rounded
+dqbas1102 toSci -1E-1572863 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped
+dqbas1103 toSci -1E-1572932 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped
+dqbas1104 toSci -0 -> -0
+dqbas1105 toSci +0 -> 0
+dqbas1106 toSci +1E-1572932 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped
+dqbas1107 toSci +1E-1572863 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped
+dqbas1108 toSci +9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> Infinity Overflow Inexact Rounded
+
diff --git a/Lib/test/decimaltestdata/dqCanonical.decTest b/Lib/test/decimaltestdata/dqCanonical.decTest
index 006db8595c..3ddf6eab2d 100644
--- a/Lib/test/decimaltestdata/dqCanonical.decTest
+++ b/Lib/test/decimaltestdata/dqCanonical.decTest
@@ -1,372 +1,372 @@
-------------------------------------------------------------------------
--- dqCanonical.decTest -- test decQuad canonical results --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests that copy operations leave uncanonical operands
--- unchanged, and vice versa
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Uncanonical declets are: abc, where:
--- a=1,2,3
--- b=6,7,e,f
--- c=e,f
-
--- assert some standard (canonical) values; this tests that FromString
--- produces canonical results (many more in decimalNN)
-dqcan001 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan002 apply 0 -> #22080000000000000000000000000000
-dqcan003 apply 1 -> #22080000000000000000000000000001
-dqcan004 apply -1 -> #a2080000000000000000000000000001
-dqcan005 apply Infinity -> #78000000000000000000000000000000
-dqcan006 apply -Infinity -> #f8000000000000000000000000000000
-dqcan007 apply -NaN -> #fc000000000000000000000000000000
-dqcan008 apply -sNaN -> #fe000000000000000000000000000000
-dqcan009 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan010 apply sNaN999999999999999999999999999999999 -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-decan011 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff
-dqcan012 apply 7.50 -> #220780000000000000000000000003d0
-dqcan013 apply 9.99 -> #220780000000000000000000000000ff
-
--- Base tests for canonical encodings (individual operator
--- propagation is tested later)
-
--- Finites: declets in coefficient
-dqcan021 canonical #77ffcff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan022 canonical #77fffff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan023 canonical #77ffcffffcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan024 canonical #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan025 canonical #77ffcff3fcffffcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan026 canonical #77ffcff3fcff3ffff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan027 canonical #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan028 canonical #77ffcff3fcff3fcff3ffff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan029 canonical #77ffcff3fcff3fcff3fcffffcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan030 canonical #77ffcff3fcff3fcff3fcff3ffff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan031 canonical #77ffcff3fcff3fcff3fcff3fcffffcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan032 canonical #77ffcff3fcff3fcff3fcff3fcff3ffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-
--- NaN: declets in payload
-dqcan061 canonical #7c000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan062 canonical #7c000ffffcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan063 canonical #7c000ff3ffff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan064 canonical #7c000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan065 canonical #7c000ff3fcff3ffff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan066 canonical #7c000ff3fcff3fcffffcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan067 canonical #7c000ff3fcff3fcff3ffff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan068 canonical #7c000ff3fcff3fcff3fcffffcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan069 canonical #7c000ff3fcff3fcff3fcff3ffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan070 canonical #7c000ff3fcff3fcff3fcff3fcffffcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan071 canonical #7c000ff3fcff3fcff3fcff3fcff3ffff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-dqcan081 canonical #7d000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan082 canonical #7c800ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan083 canonical #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan084 canonical #7c200ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan085 canonical #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan086 canonical #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan087 canonical #7c040ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan088 canonical #7c020ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan089 canonical #7c010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan090 canonical #7c008ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan091 canonical #7c004ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-
--- sNaN: declets in payload
-dqcan101 canonical #7e000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan102 canonical #7e000ffffcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan103 canonical #7e000ff3ffff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan104 canonical #7e000ff3fcffffcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan105 canonical #7e000ff3fcff3ffff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan106 canonical #7e000ff3fcff3fcffffcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan107 canonical #7e000ff3fcff3fcff3ffff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan108 canonical #7e000ff3fcff3fcff3fcffffcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan109 canonical #7e000ff3fcff3fcff3fcff3ffff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan100 canonical #7e000ff3fcff3fcff3fcff3fcffffcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan111 canonical #7e000ff3fcff3fcff3fcff3fcff3ffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
--- sNaN: exponent continuation bits [excluding sNaN selector]
-dqcan121 canonical #7f000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan122 canonical #7e800ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan123 canonical #7e400ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan124 canonical #7e200ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan125 canonical #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan126 canonical #7e080ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan127 canonical #7e040ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan128 canonical #7e020ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan129 canonical #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan130 canonical #7e008ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan131 canonical #7e004ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-
--- Inf: exponent continuation bits
-dqcan137 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan138 canonical #79000000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan139 canonical #7a000000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan140 canonical #78800000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan141 canonical #78400000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan142 canonical #78200000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan143 canonical #78100000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan144 canonical #78080000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan145 canonical #78040000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan146 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan147 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan148 canonical #78008000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan149 canonical #78004000000000000000000000000000 -> #78000000000000000000000000000000
-
--- Inf: coefficient continuation bits (first, last, and a few others)
-dqcan150 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan151 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan152 canonical #78000000000000000000000000000001 -> #78000000000000000000000000000000
-dqcan153 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan154 canonical #78002000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan155 canonical #78000800000000000000000000000000 -> #78000000000000000000000000000000
-dqcan156 canonical #78000020000000000000000000000000 -> #78000000000000000000000000000000
-dqcan157 canonical #78000004000000000000000000000000 -> #78000000000000000000000000000000
-dqcan158 canonical #78000000400000000000000000000000 -> #78000000000000000000000000000000
-dqcan159 canonical #78000000080000000000000000000000 -> #78000000000000000000000000000000
-dqcan160 canonical #78000000004000000000000000000000 -> #78000000000000000000000000000000
-dqcan161 canonical #78000000000200000000000000000000 -> #78000000000000000000000000000000
-dqcan162 canonical #78000000000080000000000000000000 -> #78000000000000000000000000000000
-dqcan163 canonical #78000000000002000000000000000000 -> #78000000000000000000000000000000
-dqcan164 canonical #78000000000000400000000000000000 -> #78000000000000000000000000000000
-dqcan165 canonical #78000000000000080000000000000000 -> #78000000000000000000000000000000
-dqcan166 canonical #78000000000000001000000000000000 -> #78000000000000000000000000000000
-dqcan167 canonical #78000000000000000200000000000000 -> #78000000000000000000000000000000
-dqcan168 canonical #78000000000000000080000000000000 -> #78000000000000000000000000000000
-dqcan169 canonical #78000000000000000004000000000000 -> #78000000000000000000000000000000
-dqcan170 canonical #78000000000000000000400000000000 -> #78000000000000000000000000000000
-dqcan171 canonical #78000000000000000000010000000000 -> #78000000000000000000000000000000
-dqcan172 canonical #78000000000000000000002000000000 -> #78000000000000000000000000000000
-dqcan173 canonical #78000000000000000000000400000000 -> #78000000000000000000000000000000
-dqcan174 canonical #78000000000000000000000080000000 -> #78000000000000000000000000000000
-dqcan175 canonical #78000000000000000000000002000000 -> #78000000000000000000000000000000
-dqcan176 canonical #78000000000000000000000000400000 -> #78000000000000000000000000000000
-dqcan177 canonical #78000000000000000000000000020000 -> #78000000000000000000000000000000
-dqcan178 canonical #78000000000000000000000000001000 -> #78000000000000000000000000000000
-dqcan179 canonical #78000000000000000000000000000400 -> #78000000000000000000000000000000
-dqcan180 canonical #78000000000000000000000000000020 -> #78000000000000000000000000000000
-dqcan181 canonical #78000000000000000000000000000008 -> #78000000000000000000000000000000
-
-
--- Now the operators -- trying to check paths that might fail to
--- canonicalize propagated operands
-
------ Add:
--- Finites: neutral 0
-dqcan202 add 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan203 add #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
--- tiny zero
-dqcan204 add 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
-dqcan205 add #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
--- tiny non zero
-dqcan206 add -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
-dqcan207 add #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
--- NaN: declets in payload
-dqcan211 add 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan212 add #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-dqcan213 add 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan214 add #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- sNaN: declets in payload
-dqcan215 add 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan216 add #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-dqcan217 add 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan218 add #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-dqcan220 add 0 #78010000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan221 add #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
--- Inf: coefficient continuation bits
-dqcan222 add 0 #78002000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan223 add #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
-dqcan224 add 0 #78000002000000000000000000000000 -> #78000000000000000000000000000000
-dqcan225 add #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
-dqcan226 add 0 #78000000000000000005000000000000 -> #78000000000000000000000000000000
-dqcan227 add #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
-
------ Class: [does not return encoded]
-
------ Compare:
-dqcan231 compare -Inf 1 -> #a2080000000000000000000000000001
-dqcan232 compare -Inf -Inf -> #22080000000000000000000000000000
-dqcan233 compare 1 -Inf -> #22080000000000000000000000000001
-dqcan234 compare #7c010ff3fcff3fcff3fcff3ffffffcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan235 compare #7e004ff3fcff3fcff3ffffffcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-
------ CompareSig:
-dqcan241 comparesig -Inf 1 -> #a2080000000000000000000000000001
-dqcan242 comparesig -Inf -Inf -> #22080000000000000000000000000000
-dqcan243 comparesig 1 -Inf -> #22080000000000000000000000000001
-dqcan244 comparesig #7c400ff3ffff3fcff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan245 comparesig #7e050ff3fcfffffff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-
------ Copy: [does not usually canonicalize]
--- finites
-dqcan250 copy #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
-dqcan251 copy #ee080ff3fcff3ffff3fcff3ffff3fcff -> #ee080ff3fcff3ffff3fcff3ffff3fcff
--- NaNs
-dqcan252 copy #7c000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
-dqcan253 copy #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
--- sNaN
-dqcan254 copy #7e003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
-dqcan255 copy #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
--- Inf
-dqcan258 copy #78002000000000000000000000000000 -> #78002000000000000000000000000000
-dqcan259 copy #78000000000010000000000000100000 -> #78000000000010000000000000100000
-
------ CopyAbs: [does not usually canonicalize]
--- finites
-dqcan260 copyabs #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
-dqcan261 copyabs #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
--- NaNs
-dqcan262 copyabs #fc000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
-dqcan263 copyabs #fc080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
--- sNaN
-dqcan264 copyabs #fe003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
-dqcan265 copyabs #fe100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
--- Inf
-dqcan268 copyabs #f8002000000000000000000000000000 -> #78002000000000000000000000000000
-dqcan269 copyabs #f8000000000000700700700000000000 -> #78000000000000700700700000000000
-
------ CopyNegate: [does not usually canonicalize]
--- finites
-dqcan270 copynegate #6e080ff3fcff3fcfffffff3fcfffffff -> #ee080ff3fcff3fcfffffff3fcfffffff
-dqcan271 copynegate #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
--- NaNs
-dqcan272 copynegate #7c000ff3fcffffffffffff3fcff3fcff -> #fc000ff3fcffffffffffff3fcff3fcff
-dqcan273 copynegate #7c080ff3fcff3fcff3fcff3fcff3fcff -> #fc080ff3fcff3fcff3fcff3fcff3fcff
--- sNaN
-dqcan274 copynegate #7e003ff3fcffffffffffffffcff3fcff -> #fe003ff3fcffffffffffffffcff3fcff
-dqcan275 copynegate #7e100ff3fcff3fcff3fcff3fcff3fcff -> #fe100ff3fcff3fcff3fcff3fcff3fcff
--- Inf
-dqcan278 copynegate #78002000000000000000000000000000 -> #f8002000000000000000000000000000
-dqcan279 copynegate #78000000000010000000000000100000 -> #f8000000000010000000000000100000
-
------ CopySign: [does not usually canonicalize]
--- finites
-dqcan280 copysign #6e080ff3fcff3fcfffffff3fcfffffff -1 -> #ee080ff3fcff3fcfffffff3fcfffffff
-dqcan281 copysign #ee080ff3fcff3ffff3fcff3ffff3fcff 1 -> #6e080ff3fcff3ffff3fcff3ffff3fcff
--- NaNs
-dqcan282 copysign #7c000ff3fcffffffffffffffcff3fcff -1 -> #fc000ff3fcffffffffffffffcff3fcff
-dqcan283 copysign #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c080ff3fcff3fcff3fcff3fcff3fcff
--- sNaN
-dqcan284 copysign #7e003ff3fcffffffffffffffcff3fcff -1 -> #fe003ff3fcffffffffffffffcff3fcff
-dqcan285 copysign #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7e100ff3fcff3fcff3fcff3fcff3fcff
--- Inf
-dqcan288 copysign #78002000000000000000000000000000 -1 -> #f8002000000000000000000000000000
-dqcan289 copysign #78000000000010000000000000100000 1 -> #78000000000010000000000000100000
-
------ Multiply:
--- Finites: neutral 0
-dqcan302 multiply 1 #77ffff3fcff3fcff0000000000000000 -> #77ffff3fcff3fcff0000000000000000
-dqcan303 multiply #77fcffffcff3fcff0000000000000000 1 -> #77fccfffcff3fcff0000000000000000
--- negative
-dqcan306 multiply -1 #77ffff3fcff3fcff0000000000000000 -> #f7ffff3fcff3fcff0000000000000000
-dqcan307 multiply #77fcffffcff3fcff0000000000000000 -1 -> #f7fccfffcff3fcff0000000000000000
--- NaN: declets in payload
-dqcan311 multiply 1 #7c03ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
-dqcan312 multiply #7c03ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
--- NaN: exponent continuation bits [excluding sNaN selector]
-dqcan313 multiply 1 #7c40ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
-dqcan314 multiply #7c40ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
--- sNaN: declets in payload
-dqcan315 multiply 1 #7e00ffffcff3fcff0000000000000000 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
-dqcan316 multiply #7e00ffffcff3fcff0000000000000000 1 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-dqcan317 multiply 1 #7e80ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
-dqcan318 multiply #7e80ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
--- Inf: exponent continuation bits
-dqcan320 multiply 1 #78800000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan321 multiply #78800000000000000000000000000000 1 -> #78000000000000000000000000000000
--- Inf: coefficient continuation bits
-dqcan322 multiply 1 #78020000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan323 multiply #78020000000000000000000000000000 1 -> #78000000000000000000000000000000
-dqcan324 multiply 1 #78000000000000010000000000000000 -> #78000000000000000000000000000000
-dqcan325 multiply #78000000000000010000000000000000 1 -> #78000000000000000000000000000000
-dqcan326 multiply 1 #78000020000000000000000000000000 -> #78000000000000000000000000000000
-dqcan327 multiply #78000020000000000000000000000000 1 -> #78000000000000000000000000000000
-
------ Quantize:
-dqcan401 quantize #ee080ff3fcff3fcff3fffffffff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
-dqcan402 quantize #ee080ff3fffffffffffcff3fcff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
-dqcan403 quantize #78800000000000000000000000000000 Inf -> #78000000000000000000000000000000
-dqcan404 quantize #78020000000000000000000000000000 -Inf -> #78000000000000000000000000000000
-dqcan410 quantize #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan411 quantize #fc000ff3fcfffffff3fcff3fcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff
-dqcan412 quantize #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan413 quantize #fe000ff3fcff3fcff3ffffffcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-
------ Subtract:
--- Finites: neutral 0
-dqcan502 subtract 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan503 subtract #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
--- tiny zero
-dqcan504 subtract 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Rounded
-dqcan505 subtract #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
--- tiny non zero
-dqcan506 subtract -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
-dqcan507 subtract #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
--- NaN: declets in payload
-dqcan511 subtract 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan512 subtract #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-dqcan513 subtract 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan514 subtract #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- sNaN: declets in payload
-dqcan515 subtract 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan516 subtract #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-dqcan517 subtract 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan518 subtract #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-dqcan520 subtract 0 #78010000000000000000000000000000 -> #f8000000000000000000000000000000
-dqcan521 subtract #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
--- Inf: coefficient continuation bits
-dqcan522 subtract 0 #78002000000000000000000000000000 -> #f8000000000000000000000000000000
-dqcan523 subtract #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
-dqcan524 subtract 0 #78000002000000000000000000000000 -> #f8000000000000000000000000000000
-dqcan525 subtract #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
-dqcan526 subtract 0 #78000000000000000005000000000000 -> #f8000000000000000000000000000000
-dqcan527 subtract #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
-
------ ToIntegral:
-dqcan601 tointegralx #6e080ff3fdff3fcff3fcff3fcff3fcff -> #6e080ff3fcff3fcff3fcff3fcff3fcff
-dqcan602 tointegralx #ee080ff3fcff3ffff3fcff3fcff3fcff -> #ee080ff3fcff3fcff3fcff3fcff3fcff
-dqcan603 tointegralx #78800000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan604 tointegralx #78020000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan614 tointegralx #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan615 tointegralx #fc000ff3fcff3fcff3fcffffcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff
-dqcan616 tointegralx #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan617 tointegralx #fe000ff3fcff3fcff3fdff3fcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
-dqcan618 tointegralx #22080000000000000000000000000fff -> #22080000000000000000000000000cff
-dqcan619 tointegralx #22078000000000000000000000000fff -> #22080000000000000000000000000040 Inexact Rounded
-dqcan620 tointegralx #22074000000000000000000000000fff -> #22080000000000000000000000000004 Inexact Rounded
-dqcan621 tointegralx #22070000000000000000000000000fff -> #22080000000000000000000000000000 Inexact Rounded
-dqcan622 tointegralx #a2080000000000000000000000000fff -> #a2080000000000000000000000000cff
-dqcan623 tointegralx #a2078000000000000000000000000fff -> #a2080000000000000000000000000040 Inexact Rounded
-dqcan624 tointegralx #a2074000000000000000000000000fff -> #a2080000000000000000000000000004 Inexact Rounded
-dqcan625 tointegralx #a2070000000000000000000000000fff -> #a2080000000000000000000000000000 Inexact Rounded
-
-
-
+------------------------------------------------------------------------
+-- dqCanonical.decTest -- test decQuad canonical results --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests that copy operations leave uncanonical operands
+-- unchanged, and vice versa
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Uncanonical declets are: abc, where:
+-- a=1,2,3
+-- b=6,7,e,f
+-- c=e,f
+
+-- assert some standard (canonical) values; this tests that FromString
+-- produces canonical results (many more in decimalNN)
+dqcan001 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan002 apply 0 -> #22080000000000000000000000000000
+dqcan003 apply 1 -> #22080000000000000000000000000001
+dqcan004 apply -1 -> #a2080000000000000000000000000001
+dqcan005 apply Infinity -> #78000000000000000000000000000000
+dqcan006 apply -Infinity -> #f8000000000000000000000000000000
+dqcan007 apply -NaN -> #fc000000000000000000000000000000
+dqcan008 apply -sNaN -> #fe000000000000000000000000000000
+dqcan009 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan010 apply sNaN999999999999999999999999999999999 -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+decan011 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff
+dqcan012 apply 7.50 -> #220780000000000000000000000003d0
+dqcan013 apply 9.99 -> #220780000000000000000000000000ff
+
+-- Base tests for canonical encodings (individual operator
+-- propagation is tested later)
+
+-- Finites: declets in coefficient
+dqcan021 canonical #77ffcff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan022 canonical #77fffff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan023 canonical #77ffcffffcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan024 canonical #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan025 canonical #77ffcff3fcffffcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan026 canonical #77ffcff3fcff3ffff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan027 canonical #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan028 canonical #77ffcff3fcff3fcff3ffff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan029 canonical #77ffcff3fcff3fcff3fcffffcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan030 canonical #77ffcff3fcff3fcff3fcff3ffff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan031 canonical #77ffcff3fcff3fcff3fcff3fcffffcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan032 canonical #77ffcff3fcff3fcff3fcff3fcff3ffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+
+-- NaN: declets in payload
+dqcan061 canonical #7c000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan062 canonical #7c000ffffcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan063 canonical #7c000ff3ffff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan064 canonical #7c000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan065 canonical #7c000ff3fcff3ffff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan066 canonical #7c000ff3fcff3fcffffcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan067 canonical #7c000ff3fcff3fcff3ffff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan068 canonical #7c000ff3fcff3fcff3fcffffcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan069 canonical #7c000ff3fcff3fcff3fcff3ffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan070 canonical #7c000ff3fcff3fcff3fcff3fcffffcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan071 canonical #7c000ff3fcff3fcff3fcff3fcff3ffff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+dqcan081 canonical #7d000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan082 canonical #7c800ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan083 canonical #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan084 canonical #7c200ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan085 canonical #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan086 canonical #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan087 canonical #7c040ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan088 canonical #7c020ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan089 canonical #7c010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan090 canonical #7c008ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan091 canonical #7c004ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+
+-- sNaN: declets in payload
+dqcan101 canonical #7e000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan102 canonical #7e000ffffcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan103 canonical #7e000ff3ffff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan104 canonical #7e000ff3fcffffcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan105 canonical #7e000ff3fcff3ffff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan106 canonical #7e000ff3fcff3fcffffcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan107 canonical #7e000ff3fcff3fcff3ffff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan108 canonical #7e000ff3fcff3fcff3fcffffcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan109 canonical #7e000ff3fcff3fcff3fcff3ffff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan100 canonical #7e000ff3fcff3fcff3fcff3fcffffcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan111 canonical #7e000ff3fcff3fcff3fcff3fcff3ffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+dqcan121 canonical #7f000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan122 canonical #7e800ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan123 canonical #7e400ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan124 canonical #7e200ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan125 canonical #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan126 canonical #7e080ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan127 canonical #7e040ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan128 canonical #7e020ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan129 canonical #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan130 canonical #7e008ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan131 canonical #7e004ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+
+-- Inf: exponent continuation bits
+dqcan137 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan138 canonical #79000000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan139 canonical #7a000000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan140 canonical #78800000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan141 canonical #78400000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan142 canonical #78200000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan143 canonical #78100000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan144 canonical #78080000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan145 canonical #78040000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan146 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan147 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan148 canonical #78008000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan149 canonical #78004000000000000000000000000000 -> #78000000000000000000000000000000
+
+-- Inf: coefficient continuation bits (first, last, and a few others)
+dqcan150 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan151 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan152 canonical #78000000000000000000000000000001 -> #78000000000000000000000000000000
+dqcan153 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan154 canonical #78002000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan155 canonical #78000800000000000000000000000000 -> #78000000000000000000000000000000
+dqcan156 canonical #78000020000000000000000000000000 -> #78000000000000000000000000000000
+dqcan157 canonical #78000004000000000000000000000000 -> #78000000000000000000000000000000
+dqcan158 canonical #78000000400000000000000000000000 -> #78000000000000000000000000000000
+dqcan159 canonical #78000000080000000000000000000000 -> #78000000000000000000000000000000
+dqcan160 canonical #78000000004000000000000000000000 -> #78000000000000000000000000000000
+dqcan161 canonical #78000000000200000000000000000000 -> #78000000000000000000000000000000
+dqcan162 canonical #78000000000080000000000000000000 -> #78000000000000000000000000000000
+dqcan163 canonical #78000000000002000000000000000000 -> #78000000000000000000000000000000
+dqcan164 canonical #78000000000000400000000000000000 -> #78000000000000000000000000000000
+dqcan165 canonical #78000000000000080000000000000000 -> #78000000000000000000000000000000
+dqcan166 canonical #78000000000000001000000000000000 -> #78000000000000000000000000000000
+dqcan167 canonical #78000000000000000200000000000000 -> #78000000000000000000000000000000
+dqcan168 canonical #78000000000000000080000000000000 -> #78000000000000000000000000000000
+dqcan169 canonical #78000000000000000004000000000000 -> #78000000000000000000000000000000
+dqcan170 canonical #78000000000000000000400000000000 -> #78000000000000000000000000000000
+dqcan171 canonical #78000000000000000000010000000000 -> #78000000000000000000000000000000
+dqcan172 canonical #78000000000000000000002000000000 -> #78000000000000000000000000000000
+dqcan173 canonical #78000000000000000000000400000000 -> #78000000000000000000000000000000
+dqcan174 canonical #78000000000000000000000080000000 -> #78000000000000000000000000000000
+dqcan175 canonical #78000000000000000000000002000000 -> #78000000000000000000000000000000
+dqcan176 canonical #78000000000000000000000000400000 -> #78000000000000000000000000000000
+dqcan177 canonical #78000000000000000000000000020000 -> #78000000000000000000000000000000
+dqcan178 canonical #78000000000000000000000000001000 -> #78000000000000000000000000000000
+dqcan179 canonical #78000000000000000000000000000400 -> #78000000000000000000000000000000
+dqcan180 canonical #78000000000000000000000000000020 -> #78000000000000000000000000000000
+dqcan181 canonical #78000000000000000000000000000008 -> #78000000000000000000000000000000
+
+
+-- Now the operators -- trying to check paths that might fail to
+-- canonicalize propagated operands
+
+----- Add:
+-- Finites: neutral 0
+dqcan202 add 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan203 add #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+-- tiny zero
+dqcan204 add 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
+dqcan205 add #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
+-- tiny non zero
+dqcan206 add -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
+dqcan207 add #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
+-- NaN: declets in payload
+dqcan211 add 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan212 add #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+dqcan213 add 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan214 add #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN: declets in payload
+dqcan215 add 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan216 add #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+dqcan217 add 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan218 add #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+dqcan220 add 0 #78010000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan221 add #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
+-- Inf: coefficient continuation bits
+dqcan222 add 0 #78002000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan223 add #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
+dqcan224 add 0 #78000002000000000000000000000000 -> #78000000000000000000000000000000
+dqcan225 add #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
+dqcan226 add 0 #78000000000000000005000000000000 -> #78000000000000000000000000000000
+dqcan227 add #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
+
+----- Class: [does not return encoded]
+
+----- Compare:
+dqcan231 compare -Inf 1 -> #a2080000000000000000000000000001
+dqcan232 compare -Inf -Inf -> #22080000000000000000000000000000
+dqcan233 compare 1 -Inf -> #22080000000000000000000000000001
+dqcan234 compare #7c010ff3fcff3fcff3fcff3ffffffcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan235 compare #7e004ff3fcff3fcff3ffffffcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+
+----- CompareSig:
+dqcan241 comparesig -Inf 1 -> #a2080000000000000000000000000001
+dqcan242 comparesig -Inf -Inf -> #22080000000000000000000000000000
+dqcan243 comparesig 1 -Inf -> #22080000000000000000000000000001
+dqcan244 comparesig #7c400ff3ffff3fcff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan245 comparesig #7e050ff3fcfffffff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+
+----- Copy: [does not usually canonicalize]
+-- finites
+dqcan250 copy #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
+dqcan251 copy #ee080ff3fcff3ffff3fcff3ffff3fcff -> #ee080ff3fcff3ffff3fcff3ffff3fcff
+-- NaNs
+dqcan252 copy #7c000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
+dqcan253 copy #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN
+dqcan254 copy #7e003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
+dqcan255 copy #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
+-- Inf
+dqcan258 copy #78002000000000000000000000000000 -> #78002000000000000000000000000000
+dqcan259 copy #78000000000010000000000000100000 -> #78000000000010000000000000100000
+
+----- CopyAbs: [does not usually canonicalize]
+-- finites
+dqcan260 copyabs #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
+dqcan261 copyabs #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
+-- NaNs
+dqcan262 copyabs #fc000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
+dqcan263 copyabs #fc080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN
+dqcan264 copyabs #fe003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
+dqcan265 copyabs #fe100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
+-- Inf
+dqcan268 copyabs #f8002000000000000000000000000000 -> #78002000000000000000000000000000
+dqcan269 copyabs #f8000000000000700700700000000000 -> #78000000000000700700700000000000
+
+----- CopyNegate: [does not usually canonicalize]
+-- finites
+dqcan270 copynegate #6e080ff3fcff3fcfffffff3fcfffffff -> #ee080ff3fcff3fcfffffff3fcfffffff
+dqcan271 copynegate #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
+-- NaNs
+dqcan272 copynegate #7c000ff3fcffffffffffff3fcff3fcff -> #fc000ff3fcffffffffffff3fcff3fcff
+dqcan273 copynegate #7c080ff3fcff3fcff3fcff3fcff3fcff -> #fc080ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN
+dqcan274 copynegate #7e003ff3fcffffffffffffffcff3fcff -> #fe003ff3fcffffffffffffffcff3fcff
+dqcan275 copynegate #7e100ff3fcff3fcff3fcff3fcff3fcff -> #fe100ff3fcff3fcff3fcff3fcff3fcff
+-- Inf
+dqcan278 copynegate #78002000000000000000000000000000 -> #f8002000000000000000000000000000
+dqcan279 copynegate #78000000000010000000000000100000 -> #f8000000000010000000000000100000
+
+----- CopySign: [does not usually canonicalize]
+-- finites
+dqcan280 copysign #6e080ff3fcff3fcfffffff3fcfffffff -1 -> #ee080ff3fcff3fcfffffff3fcfffffff
+dqcan281 copysign #ee080ff3fcff3ffff3fcff3ffff3fcff 1 -> #6e080ff3fcff3ffff3fcff3ffff3fcff
+-- NaNs
+dqcan282 copysign #7c000ff3fcffffffffffffffcff3fcff -1 -> #fc000ff3fcffffffffffffffcff3fcff
+dqcan283 copysign #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c080ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN
+dqcan284 copysign #7e003ff3fcffffffffffffffcff3fcff -1 -> #fe003ff3fcffffffffffffffcff3fcff
+dqcan285 copysign #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7e100ff3fcff3fcff3fcff3fcff3fcff
+-- Inf
+dqcan288 copysign #78002000000000000000000000000000 -1 -> #f8002000000000000000000000000000
+dqcan289 copysign #78000000000010000000000000100000 1 -> #78000000000010000000000000100000
+
+----- Multiply:
+-- Finites: neutral 0
+dqcan302 multiply 1 #77ffff3fcff3fcff0000000000000000 -> #77ffff3fcff3fcff0000000000000000
+dqcan303 multiply #77fcffffcff3fcff0000000000000000 1 -> #77fccfffcff3fcff0000000000000000
+-- negative
+dqcan306 multiply -1 #77ffff3fcff3fcff0000000000000000 -> #f7ffff3fcff3fcff0000000000000000
+dqcan307 multiply #77fcffffcff3fcff0000000000000000 -1 -> #f7fccfffcff3fcff0000000000000000
+-- NaN: declets in payload
+dqcan311 multiply 1 #7c03ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
+dqcan312 multiply #7c03ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
+-- NaN: exponent continuation bits [excluding sNaN selector]
+dqcan313 multiply 1 #7c40ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
+dqcan314 multiply #7c40ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
+-- sNaN: declets in payload
+dqcan315 multiply 1 #7e00ffffcff3fcff0000000000000000 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
+dqcan316 multiply #7e00ffffcff3fcff0000000000000000 1 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+dqcan317 multiply 1 #7e80ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
+dqcan318 multiply #7e80ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
+-- Inf: exponent continuation bits
+dqcan320 multiply 1 #78800000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan321 multiply #78800000000000000000000000000000 1 -> #78000000000000000000000000000000
+-- Inf: coefficient continuation bits
+dqcan322 multiply 1 #78020000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan323 multiply #78020000000000000000000000000000 1 -> #78000000000000000000000000000000
+dqcan324 multiply 1 #78000000000000010000000000000000 -> #78000000000000000000000000000000
+dqcan325 multiply #78000000000000010000000000000000 1 -> #78000000000000000000000000000000
+dqcan326 multiply 1 #78000020000000000000000000000000 -> #78000000000000000000000000000000
+dqcan327 multiply #78000020000000000000000000000000 1 -> #78000000000000000000000000000000
+
+----- Quantize:
+dqcan401 quantize #ee080ff3fcff3fcff3fffffffff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
+dqcan402 quantize #ee080ff3fffffffffffcff3fcff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
+dqcan403 quantize #78800000000000000000000000000000 Inf -> #78000000000000000000000000000000
+dqcan404 quantize #78020000000000000000000000000000 -Inf -> #78000000000000000000000000000000
+dqcan410 quantize #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan411 quantize #fc000ff3fcfffffff3fcff3fcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff
+dqcan412 quantize #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan413 quantize #fe000ff3fcff3fcff3ffffffcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+
+----- Subtract:
+-- Finites: neutral 0
+dqcan502 subtract 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan503 subtract #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+-- tiny zero
+dqcan504 subtract 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Rounded
+dqcan505 subtract #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
+-- tiny non zero
+dqcan506 subtract -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
+dqcan507 subtract #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
+-- NaN: declets in payload
+dqcan511 subtract 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan512 subtract #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+dqcan513 subtract 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan514 subtract #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN: declets in payload
+dqcan515 subtract 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan516 subtract #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+dqcan517 subtract 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan518 subtract #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+dqcan520 subtract 0 #78010000000000000000000000000000 -> #f8000000000000000000000000000000
+dqcan521 subtract #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
+-- Inf: coefficient continuation bits
+dqcan522 subtract 0 #78002000000000000000000000000000 -> #f8000000000000000000000000000000
+dqcan523 subtract #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
+dqcan524 subtract 0 #78000002000000000000000000000000 -> #f8000000000000000000000000000000
+dqcan525 subtract #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
+dqcan526 subtract 0 #78000000000000000005000000000000 -> #f8000000000000000000000000000000
+dqcan527 subtract #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
+
+----- ToIntegral:
+dqcan601 tointegralx #6e080ff3fdff3fcff3fcff3fcff3fcff -> #6e080ff3fcff3fcff3fcff3fcff3fcff
+dqcan602 tointegralx #ee080ff3fcff3ffff3fcff3fcff3fcff -> #ee080ff3fcff3fcff3fcff3fcff3fcff
+dqcan603 tointegralx #78800000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan604 tointegralx #78020000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan614 tointegralx #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan615 tointegralx #fc000ff3fcff3fcff3fcffffcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff
+dqcan616 tointegralx #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan617 tointegralx #fe000ff3fcff3fcff3fdff3fcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
+dqcan618 tointegralx #22080000000000000000000000000fff -> #22080000000000000000000000000cff
+dqcan619 tointegralx #22078000000000000000000000000fff -> #22080000000000000000000000000040 Inexact Rounded
+dqcan620 tointegralx #22074000000000000000000000000fff -> #22080000000000000000000000000004 Inexact Rounded
+dqcan621 tointegralx #22070000000000000000000000000fff -> #22080000000000000000000000000000 Inexact Rounded
+dqcan622 tointegralx #a2080000000000000000000000000fff -> #a2080000000000000000000000000cff
+dqcan623 tointegralx #a2078000000000000000000000000fff -> #a2080000000000000000000000000040 Inexact Rounded
+dqcan624 tointegralx #a2074000000000000000000000000fff -> #a2080000000000000000000000000004 Inexact Rounded
+dqcan625 tointegralx #a2070000000000000000000000000fff -> #a2080000000000000000000000000000 Inexact Rounded
+
+
+
diff --git a/Lib/test/decimaltestdata/dqClass.decTest b/Lib/test/decimaltestdata/dqClass.decTest
index d7e19b3829..f341933878 100644
--- a/Lib/test/decimaltestdata/dqClass.decTest
+++ b/Lib/test/decimaltestdata/dqClass.decTest
@@ -1,77 +1,77 @@
-------------------------------------------------------------------------
--- dqClass.decTest -- decQuad Class operations --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- [New 2006.11.27]
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqcla001 class 0 -> +Zero
-dqcla002 class 0.00 -> +Zero
-dqcla003 class 0E+5 -> +Zero
-dqcla004 class 1E-6176 -> +Subnormal
-dqcla005 class 0.1E-6143 -> +Subnormal
-dqcla006 class 0.99999999999999999999999999999999E-6143 -> +Subnormal
-dqcla007 class 1.00000000000000000000000000000000E-6143 -> +Normal
-dqcla008 class 1E-6143 -> +Normal
-dqcla009 class 1E-100 -> +Normal
-dqcla010 class 1E-10 -> +Normal
-dqcla012 class 1E-1 -> +Normal
-dqcla013 class 1 -> +Normal
-dqcla014 class 2.50 -> +Normal
-dqcla015 class 100.100 -> +Normal
-dqcla016 class 1E+30 -> +Normal
-dqcla017 class 1E+6144 -> +Normal
-dqcla018 class 9.99999999999999999999999999999999E+6144 -> +Normal
-dqcla019 class Inf -> +Infinity
-
-dqcla021 class -0 -> -Zero
-dqcla022 class -0.00 -> -Zero
-dqcla023 class -0E+5 -> -Zero
-dqcla024 class -1E-6176 -> -Subnormal
-dqcla025 class -0.1E-6143 -> -Subnormal
-dqcla026 class -0.99999999999999999999999999999999E-6143 -> -Subnormal
-dqcla027 class -1.00000000000000000000000000000000E-6143 -> -Normal
-dqcla028 class -1E-6143 -> -Normal
-dqcla029 class -1E-100 -> -Normal
-dqcla030 class -1E-10 -> -Normal
-dqcla032 class -1E-1 -> -Normal
-dqcla033 class -1 -> -Normal
-dqcla034 class -2.50 -> -Normal
-dqcla035 class -100.100 -> -Normal
-dqcla036 class -1E+30 -> -Normal
-dqcla037 class -1E+6144 -> -Normal
-dqcla0614 class -9.99999999999999999999999999999999E+6144 -> -Normal
-dqcla039 class -Inf -> -Infinity
-
-dqcla041 class NaN -> NaN
-dqcla042 class -NaN -> NaN
-dqcla043 class +NaN12345 -> NaN
-dqcla044 class sNaN -> sNaN
-dqcla045 class -sNaN -> sNaN
-dqcla046 class +sNaN12345 -> sNaN
-
-
-
+------------------------------------------------------------------------
+-- dqClass.decTest -- decQuad Class operations --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- [New 2006.11.27]
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqcla001 class 0 -> +Zero
+dqcla002 class 0.00 -> +Zero
+dqcla003 class 0E+5 -> +Zero
+dqcla004 class 1E-6176 -> +Subnormal
+dqcla005 class 0.1E-6143 -> +Subnormal
+dqcla006 class 0.99999999999999999999999999999999E-6143 -> +Subnormal
+dqcla007 class 1.00000000000000000000000000000000E-6143 -> +Normal
+dqcla008 class 1E-6143 -> +Normal
+dqcla009 class 1E-100 -> +Normal
+dqcla010 class 1E-10 -> +Normal
+dqcla012 class 1E-1 -> +Normal
+dqcla013 class 1 -> +Normal
+dqcla014 class 2.50 -> +Normal
+dqcla015 class 100.100 -> +Normal
+dqcla016 class 1E+30 -> +Normal
+dqcla017 class 1E+6144 -> +Normal
+dqcla018 class 9.99999999999999999999999999999999E+6144 -> +Normal
+dqcla019 class Inf -> +Infinity
+
+dqcla021 class -0 -> -Zero
+dqcla022 class -0.00 -> -Zero
+dqcla023 class -0E+5 -> -Zero
+dqcla024 class -1E-6176 -> -Subnormal
+dqcla025 class -0.1E-6143 -> -Subnormal
+dqcla026 class -0.99999999999999999999999999999999E-6143 -> -Subnormal
+dqcla027 class -1.00000000000000000000000000000000E-6143 -> -Normal
+dqcla028 class -1E-6143 -> -Normal
+dqcla029 class -1E-100 -> -Normal
+dqcla030 class -1E-10 -> -Normal
+dqcla032 class -1E-1 -> -Normal
+dqcla033 class -1 -> -Normal
+dqcla034 class -2.50 -> -Normal
+dqcla035 class -100.100 -> -Normal
+dqcla036 class -1E+30 -> -Normal
+dqcla037 class -1E+6144 -> -Normal
+dqcla0614 class -9.99999999999999999999999999999999E+6144 -> -Normal
+dqcla039 class -Inf -> -Infinity
+
+dqcla041 class NaN -> NaN
+dqcla042 class -NaN -> NaN
+dqcla043 class +NaN12345 -> NaN
+dqcla044 class sNaN -> sNaN
+dqcla045 class -sNaN -> sNaN
+dqcla046 class +sNaN12345 -> sNaN
+
+
+
diff --git a/Lib/test/decimaltestdata/dqCompare.decTest b/Lib/test/decimaltestdata/dqCompare.decTest
index b7b5ee6b8e..a617ad110a 100644
--- a/Lib/test/decimaltestdata/dqCompare.decTest
+++ b/Lib/test/decimaltestdata/dqCompare.decTest
@@ -1,753 +1,753 @@
-------------------------------------------------------------------------
--- dqCompare.decTest -- decQuad comparison that allows quiet NaNs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqcom001 compare -2 -2 -> 0
-dqcom002 compare -2 -1 -> -1
-dqcom003 compare -2 0 -> -1
-dqcom004 compare -2 1 -> -1
-dqcom005 compare -2 2 -> -1
-dqcom006 compare -1 -2 -> 1
-dqcom007 compare -1 -1 -> 0
-dqcom008 compare -1 0 -> -1
-dqcom009 compare -1 1 -> -1
-dqcom010 compare -1 2 -> -1
-dqcom011 compare 0 -2 -> 1
-dqcom012 compare 0 -1 -> 1
-dqcom013 compare 0 0 -> 0
-dqcom014 compare 0 1 -> -1
-dqcom015 compare 0 2 -> -1
-dqcom016 compare 1 -2 -> 1
-dqcom017 compare 1 -1 -> 1
-dqcom018 compare 1 0 -> 1
-dqcom019 compare 1 1 -> 0
-dqcom020 compare 1 2 -> -1
-dqcom021 compare 2 -2 -> 1
-dqcom022 compare 2 -1 -> 1
-dqcom023 compare 2 0 -> 1
-dqcom025 compare 2 1 -> 1
-dqcom026 compare 2 2 -> 0
-
-dqcom031 compare -20 -20 -> 0
-dqcom032 compare -20 -10 -> -1
-dqcom033 compare -20 00 -> -1
-dqcom034 compare -20 10 -> -1
-dqcom035 compare -20 20 -> -1
-dqcom036 compare -10 -20 -> 1
-dqcom037 compare -10 -10 -> 0
-dqcom038 compare -10 00 -> -1
-dqcom039 compare -10 10 -> -1
-dqcom040 compare -10 20 -> -1
-dqcom041 compare 00 -20 -> 1
-dqcom042 compare 00 -10 -> 1
-dqcom043 compare 00 00 -> 0
-dqcom044 compare 00 10 -> -1
-dqcom045 compare 00 20 -> -1
-dqcom046 compare 10 -20 -> 1
-dqcom047 compare 10 -10 -> 1
-dqcom048 compare 10 00 -> 1
-dqcom049 compare 10 10 -> 0
-dqcom050 compare 10 20 -> -1
-dqcom051 compare 20 -20 -> 1
-dqcom052 compare 20 -10 -> 1
-dqcom053 compare 20 00 -> 1
-dqcom055 compare 20 10 -> 1
-dqcom056 compare 20 20 -> 0
-
-dqcom061 compare -2.0 -2.0 -> 0
-dqcom062 compare -2.0 -1.0 -> -1
-dqcom063 compare -2.0 0.0 -> -1
-dqcom064 compare -2.0 1.0 -> -1
-dqcom065 compare -2.0 2.0 -> -1
-dqcom066 compare -1.0 -2.0 -> 1
-dqcom067 compare -1.0 -1.0 -> 0
-dqcom068 compare -1.0 0.0 -> -1
-dqcom069 compare -1.0 1.0 -> -1
-dqcom070 compare -1.0 2.0 -> -1
-dqcom071 compare 0.0 -2.0 -> 1
-dqcom072 compare 0.0 -1.0 -> 1
-dqcom073 compare 0.0 0.0 -> 0
-dqcom074 compare 0.0 1.0 -> -1
-dqcom075 compare 0.0 2.0 -> -1
-dqcom076 compare 1.0 -2.0 -> 1
-dqcom077 compare 1.0 -1.0 -> 1
-dqcom078 compare 1.0 0.0 -> 1
-dqcom079 compare 1.0 1.0 -> 0
-dqcom080 compare 1.0 2.0 -> -1
-dqcom081 compare 2.0 -2.0 -> 1
-dqcom082 compare 2.0 -1.0 -> 1
-dqcom083 compare 2.0 0.0 -> 1
-dqcom085 compare 2.0 1.0 -> 1
-dqcom086 compare 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-dqcom090 compare 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0
-dqcom091 compare -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1
-dqcom092 compare 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1
-dqcom093 compare -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0
-
--- some differing length/exponent cases
-dqcom100 compare 7.0 7.0 -> 0
-dqcom101 compare 7.0 7 -> 0
-dqcom102 compare 7 7.0 -> 0
-dqcom103 compare 7E+0 7.0 -> 0
-dqcom104 compare 70E-1 7.0 -> 0
-dqcom105 compare 0.7E+1 7 -> 0
-dqcom106 compare 70E-1 7 -> 0
-dqcom107 compare 7.0 7E+0 -> 0
-dqcom108 compare 7.0 70E-1 -> 0
-dqcom109 compare 7 0.7E+1 -> 0
-dqcom110 compare 7 70E-1 -> 0
-
-dqcom120 compare 8.0 7.0 -> 1
-dqcom121 compare 8.0 7 -> 1
-dqcom122 compare 8 7.0 -> 1
-dqcom123 compare 8E+0 7.0 -> 1
-dqcom124 compare 80E-1 7.0 -> 1
-dqcom125 compare 0.8E+1 7 -> 1
-dqcom126 compare 80E-1 7 -> 1
-dqcom127 compare 8.0 7E+0 -> 1
-dqcom128 compare 8.0 70E-1 -> 1
-dqcom129 compare 8 0.7E+1 -> 1
-dqcom130 compare 8 70E-1 -> 1
-
-dqcom140 compare 8.0 9.0 -> -1
-dqcom141 compare 8.0 9 -> -1
-dqcom142 compare 8 9.0 -> -1
-dqcom143 compare 8E+0 9.0 -> -1
-dqcom144 compare 80E-1 9.0 -> -1
-dqcom145 compare 0.8E+1 9 -> -1
-dqcom146 compare 80E-1 9 -> -1
-dqcom147 compare 8.0 9E+0 -> -1
-dqcom148 compare 8.0 90E-1 -> -1
-dqcom149 compare 8 0.9E+1 -> -1
-dqcom150 compare 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-dqcom200 compare -7.0 7.0 -> -1
-dqcom201 compare -7.0 7 -> -1
-dqcom202 compare -7 7.0 -> -1
-dqcom203 compare -7E+0 7.0 -> -1
-dqcom204 compare -70E-1 7.0 -> -1
-dqcom205 compare -0.7E+1 7 -> -1
-dqcom206 compare -70E-1 7 -> -1
-dqcom207 compare -7.0 7E+0 -> -1
-dqcom208 compare -7.0 70E-1 -> -1
-dqcom209 compare -7 0.7E+1 -> -1
-dqcom210 compare -7 70E-1 -> -1
-
-dqcom220 compare -8.0 7.0 -> -1
-dqcom221 compare -8.0 7 -> -1
-dqcom222 compare -8 7.0 -> -1
-dqcom223 compare -8E+0 7.0 -> -1
-dqcom224 compare -80E-1 7.0 -> -1
-dqcom225 compare -0.8E+1 7 -> -1
-dqcom226 compare -80E-1 7 -> -1
-dqcom227 compare -8.0 7E+0 -> -1
-dqcom228 compare -8.0 70E-1 -> -1
-dqcom229 compare -8 0.7E+1 -> -1
-dqcom230 compare -8 70E-1 -> -1
-
-dqcom240 compare -8.0 9.0 -> -1
-dqcom241 compare -8.0 9 -> -1
-dqcom242 compare -8 9.0 -> -1
-dqcom243 compare -8E+0 9.0 -> -1
-dqcom244 compare -80E-1 9.0 -> -1
-dqcom245 compare -0.8E+1 9 -> -1
-dqcom246 compare -80E-1 9 -> -1
-dqcom247 compare -8.0 9E+0 -> -1
-dqcom248 compare -8.0 90E-1 -> -1
-dqcom249 compare -8 0.9E+1 -> -1
-dqcom250 compare -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-dqcom300 compare 7.0 -7.0 -> 1
-dqcom301 compare 7.0 -7 -> 1
-dqcom302 compare 7 -7.0 -> 1
-dqcom303 compare 7E+0 -7.0 -> 1
-dqcom304 compare 70E-1 -7.0 -> 1
-dqcom305 compare .7E+1 -7 -> 1
-dqcom306 compare 70E-1 -7 -> 1
-dqcom307 compare 7.0 -7E+0 -> 1
-dqcom308 compare 7.0 -70E-1 -> 1
-dqcom309 compare 7 -.7E+1 -> 1
-dqcom310 compare 7 -70E-1 -> 1
-
-dqcom320 compare 8.0 -7.0 -> 1
-dqcom321 compare 8.0 -7 -> 1
-dqcom322 compare 8 -7.0 -> 1
-dqcom323 compare 8E+0 -7.0 -> 1
-dqcom324 compare 80E-1 -7.0 -> 1
-dqcom325 compare .8E+1 -7 -> 1
-dqcom326 compare 80E-1 -7 -> 1
-dqcom327 compare 8.0 -7E+0 -> 1
-dqcom328 compare 8.0 -70E-1 -> 1
-dqcom329 compare 8 -.7E+1 -> 1
-dqcom330 compare 8 -70E-1 -> 1
-
-dqcom340 compare 8.0 -9.0 -> 1
-dqcom341 compare 8.0 -9 -> 1
-dqcom342 compare 8 -9.0 -> 1
-dqcom343 compare 8E+0 -9.0 -> 1
-dqcom344 compare 80E-1 -9.0 -> 1
-dqcom345 compare .8E+1 -9 -> 1
-dqcom346 compare 80E-1 -9 -> 1
-dqcom347 compare 8.0 -9E+0 -> 1
-dqcom348 compare 8.0 -90E-1 -> 1
-dqcom349 compare 8 -.9E+1 -> 1
-dqcom350 compare 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-dqcom400 compare -7.0 -7.0 -> 0
-dqcom401 compare -7.0 -7 -> 0
-dqcom402 compare -7 -7.0 -> 0
-dqcom403 compare -7E+0 -7.0 -> 0
-dqcom404 compare -70E-1 -7.0 -> 0
-dqcom405 compare -.7E+1 -7 -> 0
-dqcom406 compare -70E-1 -7 -> 0
-dqcom407 compare -7.0 -7E+0 -> 0
-dqcom408 compare -7.0 -70E-1 -> 0
-dqcom409 compare -7 -.7E+1 -> 0
-dqcom410 compare -7 -70E-1 -> 0
-
-dqcom420 compare -8.0 -7.0 -> -1
-dqcom421 compare -8.0 -7 -> -1
-dqcom422 compare -8 -7.0 -> -1
-dqcom423 compare -8E+0 -7.0 -> -1
-dqcom424 compare -80E-1 -7.0 -> -1
-dqcom425 compare -.8E+1 -7 -> -1
-dqcom426 compare -80E-1 -7 -> -1
-dqcom427 compare -8.0 -7E+0 -> -1
-dqcom428 compare -8.0 -70E-1 -> -1
-dqcom429 compare -8 -.7E+1 -> -1
-dqcom430 compare -8 -70E-1 -> -1
-
-dqcom440 compare -8.0 -9.0 -> 1
-dqcom441 compare -8.0 -9 -> 1
-dqcom442 compare -8 -9.0 -> 1
-dqcom443 compare -8E+0 -9.0 -> 1
-dqcom444 compare -80E-1 -9.0 -> 1
-dqcom445 compare -.8E+1 -9 -> 1
-dqcom446 compare -80E-1 -9 -> 1
-dqcom447 compare -8.0 -9E+0 -> 1
-dqcom448 compare -8.0 -90E-1 -> 1
-dqcom449 compare -8 -.9E+1 -> 1
-dqcom450 compare -8 -90E-1 -> 1
-
--- misalignment traps for little-endian
-dqcom451 compare 1.0 0.1 -> 1
-dqcom452 compare 0.1 1.0 -> -1
-dqcom453 compare 10.0 0.1 -> 1
-dqcom454 compare 0.1 10.0 -> -1
-dqcom455 compare 100 1.0 -> 1
-dqcom456 compare 1.0 100 -> -1
-dqcom457 compare 1000 10.0 -> 1
-dqcom458 compare 10.0 1000 -> -1
-dqcom459 compare 10000 100.0 -> 1
-dqcom460 compare 100.0 10000 -> -1
-dqcom461 compare 100000 1000.0 -> 1
-dqcom462 compare 1000.0 100000 -> -1
-dqcom463 compare 1000000 10000.0 -> 1
-dqcom464 compare 10000.0 1000000 -> -1
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-dqcom473 compare 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0
-dqcom474 compare 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0
-dqcom475 compare 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0
-dqcom476 compare 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0
-dqcom477 compare 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0
-dqcom478 compare 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0
-dqcom479 compare 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0
-dqcom480 compare 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0
-dqcom481 compare 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0
-dqcom482 compare 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0
-dqcom483 compare 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0
-dqcom487 compare 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0
-dqcom488 compare 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0
-dqcom489 compare 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0
-dqcom490 compare 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0
-dqcom491 compare 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0
-dqcom492 compare 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0
-dqcom493 compare 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0
-dqcom494 compare 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0
-dqcom495 compare 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0
-dqcom496 compare 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0
-dqcom497 compare 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-dqcom500 compare 1 1E-15 -> 1
-dqcom501 compare 1 1E-14 -> 1
-dqcom502 compare 1 1E-13 -> 1
-dqcom503 compare 1 1E-12 -> 1
-dqcom504 compare 1 1E-11 -> 1
-dqcom505 compare 1 1E-10 -> 1
-dqcom506 compare 1 1E-9 -> 1
-dqcom507 compare 1 1E-8 -> 1
-dqcom508 compare 1 1E-7 -> 1
-dqcom509 compare 1 1E-6 -> 1
-dqcom510 compare 1 1E-5 -> 1
-dqcom511 compare 1 1E-4 -> 1
-dqcom512 compare 1 1E-3 -> 1
-dqcom513 compare 1 1E-2 -> 1
-dqcom514 compare 1 1E-1 -> 1
-dqcom515 compare 1 1E-0 -> 0
-dqcom516 compare 1 1E+1 -> -1
-dqcom517 compare 1 1E+2 -> -1
-dqcom518 compare 1 1E+3 -> -1
-dqcom519 compare 1 1E+4 -> -1
-dqcom521 compare 1 1E+5 -> -1
-dqcom522 compare 1 1E+6 -> -1
-dqcom523 compare 1 1E+7 -> -1
-dqcom524 compare 1 1E+8 -> -1
-dqcom525 compare 1 1E+9 -> -1
-dqcom526 compare 1 1E+10 -> -1
-dqcom527 compare 1 1E+11 -> -1
-dqcom528 compare 1 1E+12 -> -1
-dqcom529 compare 1 1E+13 -> -1
-dqcom530 compare 1 1E+14 -> -1
-dqcom531 compare 1 1E+15 -> -1
--- LR swap
-dqcom540 compare 1E-15 1 -> -1
-dqcom541 compare 1E-14 1 -> -1
-dqcom542 compare 1E-13 1 -> -1
-dqcom543 compare 1E-12 1 -> -1
-dqcom544 compare 1E-11 1 -> -1
-dqcom545 compare 1E-10 1 -> -1
-dqcom546 compare 1E-9 1 -> -1
-dqcom547 compare 1E-8 1 -> -1
-dqcom548 compare 1E-7 1 -> -1
-dqcom549 compare 1E-6 1 -> -1
-dqcom550 compare 1E-5 1 -> -1
-dqcom551 compare 1E-4 1 -> -1
-dqcom552 compare 1E-3 1 -> -1
-dqcom553 compare 1E-2 1 -> -1
-dqcom554 compare 1E-1 1 -> -1
-dqcom555 compare 1E-0 1 -> 0
-dqcom556 compare 1E+1 1 -> 1
-dqcom557 compare 1E+2 1 -> 1
-dqcom558 compare 1E+3 1 -> 1
-dqcom559 compare 1E+4 1 -> 1
-dqcom561 compare 1E+5 1 -> 1
-dqcom562 compare 1E+6 1 -> 1
-dqcom563 compare 1E+7 1 -> 1
-dqcom564 compare 1E+8 1 -> 1
-dqcom565 compare 1E+9 1 -> 1
-dqcom566 compare 1E+10 1 -> 1
-dqcom567 compare 1E+11 1 -> 1
-dqcom568 compare 1E+12 1 -> 1
-dqcom569 compare 1E+13 1 -> 1
-dqcom570 compare 1E+14 1 -> 1
-dqcom571 compare 1E+15 1 -> 1
--- similar with a useful coefficient, one side only
-dqcom580 compare 0.000000987654321 1E-15 -> 1
-dqcom581 compare 0.000000987654321 1E-14 -> 1
-dqcom582 compare 0.000000987654321 1E-13 -> 1
-dqcom583 compare 0.000000987654321 1E-12 -> 1
-dqcom584 compare 0.000000987654321 1E-11 -> 1
-dqcom585 compare 0.000000987654321 1E-10 -> 1
-dqcom586 compare 0.000000987654321 1E-9 -> 1
-dqcom587 compare 0.000000987654321 1E-8 -> 1
-dqcom588 compare 0.000000987654321 1E-7 -> 1
-dqcom589 compare 0.000000987654321 1E-6 -> -1
-dqcom590 compare 0.000000987654321 1E-5 -> -1
-dqcom591 compare 0.000000987654321 1E-4 -> -1
-dqcom592 compare 0.000000987654321 1E-3 -> -1
-dqcom593 compare 0.000000987654321 1E-2 -> -1
-dqcom594 compare 0.000000987654321 1E-1 -> -1
-dqcom595 compare 0.000000987654321 1E-0 -> -1
-dqcom596 compare 0.000000987654321 1E+1 -> -1
-dqcom597 compare 0.000000987654321 1E+2 -> -1
-dqcom598 compare 0.000000987654321 1E+3 -> -1
-dqcom599 compare 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-dqcom600 compare 12 12.2345 -> -1
-dqcom601 compare 12.0 12.2345 -> -1
-dqcom602 compare 12.00 12.2345 -> -1
-dqcom603 compare 12.000 12.2345 -> -1
-dqcom604 compare 12.0000 12.2345 -> -1
-dqcom605 compare 12.00000 12.2345 -> -1
-dqcom606 compare 12.000000 12.2345 -> -1
-dqcom607 compare 12.0000000 12.2345 -> -1
-dqcom608 compare 12.00000000 12.2345 -> -1
-dqcom609 compare 12.000000000 12.2345 -> -1
-dqcom610 compare 12.1234 12 -> 1
-dqcom611 compare 12.1234 12.0 -> 1
-dqcom612 compare 12.1234 12.00 -> 1
-dqcom613 compare 12.1234 12.000 -> 1
-dqcom614 compare 12.1234 12.0000 -> 1
-dqcom615 compare 12.1234 12.00000 -> 1
-dqcom616 compare 12.1234 12.000000 -> 1
-dqcom617 compare 12.1234 12.0000000 -> 1
-dqcom618 compare 12.1234 12.00000000 -> 1
-dqcom619 compare 12.1234 12.000000000 -> 1
-dqcom620 compare -12 -12.2345 -> 1
-dqcom621 compare -12.0 -12.2345 -> 1
-dqcom622 compare -12.00 -12.2345 -> 1
-dqcom623 compare -12.000 -12.2345 -> 1
-dqcom624 compare -12.0000 -12.2345 -> 1
-dqcom625 compare -12.00000 -12.2345 -> 1
-dqcom626 compare -12.000000 -12.2345 -> 1
-dqcom627 compare -12.0000000 -12.2345 -> 1
-dqcom628 compare -12.00000000 -12.2345 -> 1
-dqcom629 compare -12.000000000 -12.2345 -> 1
-dqcom630 compare -12.1234 -12 -> -1
-dqcom631 compare -12.1234 -12.0 -> -1
-dqcom632 compare -12.1234 -12.00 -> -1
-dqcom633 compare -12.1234 -12.000 -> -1
-dqcom634 compare -12.1234 -12.0000 -> -1
-dqcom635 compare -12.1234 -12.00000 -> -1
-dqcom636 compare -12.1234 -12.000000 -> -1
-dqcom637 compare -12.1234 -12.0000000 -> -1
-dqcom638 compare -12.1234 -12.00000000 -> -1
-dqcom639 compare -12.1234 -12.000000000 -> -1
-
--- extended zeros
-dqcom640 compare 0 0 -> 0
-dqcom641 compare 0 -0 -> 0
-dqcom642 compare 0 -0.0 -> 0
-dqcom643 compare 0 0.0 -> 0
-dqcom644 compare -0 0 -> 0
-dqcom645 compare -0 -0 -> 0
-dqcom646 compare -0 -0.0 -> 0
-dqcom647 compare -0 0.0 -> 0
-dqcom648 compare 0.0 0 -> 0
-dqcom649 compare 0.0 -0 -> 0
-dqcom650 compare 0.0 -0.0 -> 0
-dqcom651 compare 0.0 0.0 -> 0
-dqcom652 compare -0.0 0 -> 0
-dqcom653 compare -0.0 -0 -> 0
-dqcom654 compare -0.0 -0.0 -> 0
-dqcom655 compare -0.0 0.0 -> 0
-
-dqcom656 compare -0E1 0.0 -> 0
-dqcom657 compare -0E2 0.0 -> 0
-dqcom658 compare 0E1 0.0 -> 0
-dqcom659 compare 0E2 0.0 -> 0
-dqcom660 compare -0E1 0 -> 0
-dqcom661 compare -0E2 0 -> 0
-dqcom662 compare 0E1 0 -> 0
-dqcom663 compare 0E2 0 -> 0
-dqcom664 compare -0E1 -0E1 -> 0
-dqcom665 compare -0E2 -0E1 -> 0
-dqcom666 compare 0E1 -0E1 -> 0
-dqcom667 compare 0E2 -0E1 -> 0
-dqcom668 compare -0E1 -0E2 -> 0
-dqcom669 compare -0E2 -0E2 -> 0
-dqcom670 compare 0E1 -0E2 -> 0
-dqcom671 compare 0E2 -0E2 -> 0
-dqcom672 compare -0E1 0E1 -> 0
-dqcom673 compare -0E2 0E1 -> 0
-dqcom674 compare 0E1 0E1 -> 0
-dqcom675 compare 0E2 0E1 -> 0
-dqcom676 compare -0E1 0E2 -> 0
-dqcom677 compare -0E2 0E2 -> 0
-dqcom678 compare 0E1 0E2 -> 0
-dqcom679 compare 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-dqcom680 compare 12 12 -> 0
-dqcom681 compare 12 12.0 -> 0
-dqcom682 compare 12 12.00 -> 0
-dqcom683 compare 12 12.000 -> 0
-dqcom684 compare 12 12.0000 -> 0
-dqcom685 compare 12 12.00000 -> 0
-dqcom686 compare 12 12.000000 -> 0
-dqcom687 compare 12 12.0000000 -> 0
-dqcom688 compare 12 12.00000000 -> 0
-dqcom689 compare 12 12.000000000 -> 0
-dqcom690 compare 12 12 -> 0
-dqcom691 compare 12.0 12 -> 0
-dqcom692 compare 12.00 12 -> 0
-dqcom693 compare 12.000 12 -> 0
-dqcom694 compare 12.0000 12 -> 0
-dqcom695 compare 12.00000 12 -> 0
-dqcom696 compare 12.000000 12 -> 0
-dqcom697 compare 12.0000000 12 -> 0
-dqcom698 compare 12.00000000 12 -> 0
-dqcom699 compare 12.000000000 12 -> 0
-
--- first, second, & last digit
-dqcom700 compare 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1
-dqcom701 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
-dqcom702 compare 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1
-dqcom703 compare 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1
-dqcom704 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
-dqcom705 compare 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1
-dqcom706 compare 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1
-dqcom707 compare 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0
-dqcom708 compare 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1
-
--- miscellaneous
-dqcom721 compare 12345678000 1 -> 1
-dqcom722 compare 1 12345678000 -> -1
-dqcom723 compare 1234567800 1 -> 1
-dqcom724 compare 1 1234567800 -> -1
-dqcom725 compare 1234567890 1 -> 1
-dqcom726 compare 1 1234567890 -> -1
-dqcom727 compare 1234567891 1 -> 1
-dqcom728 compare 1 1234567891 -> -1
-dqcom729 compare 12345678901 1 -> 1
-dqcom730 compare 1 12345678901 -> -1
-dqcom731 compare 1234567896 1 -> 1
-dqcom732 compare 1 1234567896 -> -1
-
--- residue cases at lower precision
-dqcom740 compare 1 0.9999999 -> 1
-dqcom741 compare 1 0.999999 -> 1
-dqcom742 compare 1 0.99999 -> 1
-dqcom743 compare 1 1.0000 -> 0
-dqcom744 compare 1 1.00001 -> -1
-dqcom745 compare 1 1.000001 -> -1
-dqcom746 compare 1 1.0000001 -> -1
-dqcom750 compare 0.9999999 1 -> -1
-dqcom751 compare 0.999999 1 -> -1
-dqcom752 compare 0.99999 1 -> -1
-dqcom753 compare 1.0000 1 -> 0
-dqcom754 compare 1.00001 1 -> 1
-dqcom755 compare 1.000001 1 -> 1
-dqcom756 compare 1.0000001 1 -> 1
-
--- Specials
-dqcom780 compare Inf -Inf -> 1
-dqcom781 compare Inf -1000 -> 1
-dqcom782 compare Inf -1 -> 1
-dqcom783 compare Inf -0 -> 1
-dqcom784 compare Inf 0 -> 1
-dqcom785 compare Inf 1 -> 1
-dqcom786 compare Inf 1000 -> 1
-dqcom787 compare Inf Inf -> 0
-dqcom788 compare -1000 Inf -> -1
-dqcom789 compare -Inf Inf -> -1
-dqcom790 compare -1 Inf -> -1
-dqcom791 compare -0 Inf -> -1
-dqcom792 compare 0 Inf -> -1
-dqcom793 compare 1 Inf -> -1
-dqcom794 compare 1000 Inf -> -1
-dqcom795 compare Inf Inf -> 0
-
-dqcom800 compare -Inf -Inf -> 0
-dqcom801 compare -Inf -1000 -> -1
-dqcom802 compare -Inf -1 -> -1
-dqcom803 compare -Inf -0 -> -1
-dqcom804 compare -Inf 0 -> -1
-dqcom805 compare -Inf 1 -> -1
-dqcom806 compare -Inf 1000 -> -1
-dqcom807 compare -Inf Inf -> -1
-dqcom808 compare -Inf -Inf -> 0
-dqcom809 compare -1000 -Inf -> 1
-dqcom810 compare -1 -Inf -> 1
-dqcom811 compare -0 -Inf -> 1
-dqcom812 compare 0 -Inf -> 1
-dqcom813 compare 1 -Inf -> 1
-dqcom814 compare 1000 -Inf -> 1
-dqcom815 compare Inf -Inf -> 1
-
-dqcom821 compare NaN -Inf -> NaN
-dqcom822 compare NaN -1000 -> NaN
-dqcom823 compare NaN -1 -> NaN
-dqcom824 compare NaN -0 -> NaN
-dqcom825 compare NaN 0 -> NaN
-dqcom826 compare NaN 1 -> NaN
-dqcom827 compare NaN 1000 -> NaN
-dqcom828 compare NaN Inf -> NaN
-dqcom829 compare NaN NaN -> NaN
-dqcom830 compare -Inf NaN -> NaN
-dqcom831 compare -1000 NaN -> NaN
-dqcom832 compare -1 NaN -> NaN
-dqcom833 compare -0 NaN -> NaN
-dqcom834 compare 0 NaN -> NaN
-dqcom835 compare 1 NaN -> NaN
-dqcom836 compare 1000 NaN -> NaN
-dqcom837 compare Inf NaN -> NaN
-dqcom838 compare -NaN -NaN -> -NaN
-dqcom839 compare +NaN -NaN -> NaN
-dqcom840 compare -NaN +NaN -> -NaN
-
-dqcom841 compare sNaN -Inf -> NaN Invalid_operation
-dqcom842 compare sNaN -1000 -> NaN Invalid_operation
-dqcom843 compare sNaN -1 -> NaN Invalid_operation
-dqcom844 compare sNaN -0 -> NaN Invalid_operation
-dqcom845 compare sNaN 0 -> NaN Invalid_operation
-dqcom846 compare sNaN 1 -> NaN Invalid_operation
-dqcom847 compare sNaN 1000 -> NaN Invalid_operation
-dqcom848 compare sNaN NaN -> NaN Invalid_operation
-dqcom849 compare sNaN sNaN -> NaN Invalid_operation
-dqcom850 compare NaN sNaN -> NaN Invalid_operation
-dqcom851 compare -Inf sNaN -> NaN Invalid_operation
-dqcom852 compare -1000 sNaN -> NaN Invalid_operation
-dqcom853 compare -1 sNaN -> NaN Invalid_operation
-dqcom854 compare -0 sNaN -> NaN Invalid_operation
-dqcom855 compare 0 sNaN -> NaN Invalid_operation
-dqcom856 compare 1 sNaN -> NaN Invalid_operation
-dqcom857 compare 1000 sNaN -> NaN Invalid_operation
-dqcom858 compare Inf sNaN -> NaN Invalid_operation
-dqcom859 compare NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqcom860 compare NaN9 -Inf -> NaN9
-dqcom861 compare NaN8 999 -> NaN8
-dqcom862 compare NaN77 Inf -> NaN77
-dqcom863 compare -NaN67 NaN5 -> -NaN67
-dqcom864 compare -Inf -NaN4 -> -NaN4
-dqcom865 compare -999 -NaN33 -> -NaN33
-dqcom866 compare Inf NaN2 -> NaN2
-dqcom867 compare -NaN41 -NaN42 -> -NaN41
-dqcom868 compare +NaN41 -NaN42 -> NaN41
-dqcom869 compare -NaN41 +NaN42 -> -NaN41
-dqcom870 compare +NaN41 +NaN42 -> NaN41
-
-dqcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
-dqcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
-dqcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
-dqcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
-dqcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
-dqcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
-dqcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
-dqcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- wide range
-dqcom880 compare +1.23456789012345E-0 9E+6144 -> -1
-dqcom881 compare 9E+6144 +1.23456789012345E-0 -> 1
-dqcom882 compare +0.100 9E-6143 -> 1
-dqcom883 compare 9E-6143 +0.100 -> -1
-dqcom885 compare -1.23456789012345E-0 9E+6144 -> -1
-dqcom886 compare 9E+6144 -1.23456789012345E-0 -> 1
-dqcom887 compare -0.100 9E-6143 -> -1
-dqcom888 compare 9E-6143 -0.100 -> 1
-
--- signs
-dqcom901 compare 1e+77 1e+11 -> 1
-dqcom902 compare 1e+77 -1e+11 -> 1
-dqcom903 compare -1e+77 1e+11 -> -1
-dqcom904 compare -1e+77 -1e+11 -> -1
-dqcom905 compare 1e-77 1e-11 -> -1
-dqcom906 compare 1e-77 -1e-11 -> 1
-dqcom907 compare -1e-77 1e-11 -> -1
-dqcom908 compare -1e-77 -1e-11 -> 1
-
--- full alignment range, both ways
-dqcomp1001 compare 1 1.000000000000000000000000000000000 -> 0
-dqcomp1002 compare 1 1.00000000000000000000000000000000 -> 0
-dqcomp1003 compare 1 1.0000000000000000000000000000000 -> 0
-dqcomp1004 compare 1 1.000000000000000000000000000000 -> 0
-dqcomp1005 compare 1 1.00000000000000000000000000000 -> 0
-dqcomp1006 compare 1 1.0000000000000000000000000000 -> 0
-dqcomp1007 compare 1 1.000000000000000000000000000 -> 0
-dqcomp1008 compare 1 1.00000000000000000000000000 -> 0
-dqcomp1009 compare 1 1.0000000000000000000000000 -> 0
-dqcomp1010 compare 1 1.000000000000000000000000 -> 0
-dqcomp1011 compare 1 1.00000000000000000000000 -> 0
-dqcomp1012 compare 1 1.0000000000000000000000 -> 0
-dqcomp1013 compare 1 1.000000000000000000000 -> 0
-dqcomp1014 compare 1 1.00000000000000000000 -> 0
-dqcomp1015 compare 1 1.0000000000000000000 -> 0
-dqcomp1016 compare 1 1.000000000000000000 -> 0
-dqcomp1017 compare 1 1.00000000000000000 -> 0
-dqcomp1018 compare 1 1.0000000000000000 -> 0
-dqcomp1019 compare 1 1.000000000000000 -> 0
-dqcomp1020 compare 1 1.00000000000000 -> 0
-dqcomp1021 compare 1 1.0000000000000 -> 0
-dqcomp1022 compare 1 1.000000000000 -> 0
-dqcomp1023 compare 1 1.00000000000 -> 0
-dqcomp1024 compare 1 1.0000000000 -> 0
-dqcomp1025 compare 1 1.000000000 -> 0
-dqcomp1026 compare 1 1.00000000 -> 0
-dqcomp1027 compare 1 1.0000000 -> 0
-dqcomp1028 compare 1 1.000000 -> 0
-dqcomp1029 compare 1 1.00000 -> 0
-dqcomp1030 compare 1 1.0000 -> 0
-dqcomp1031 compare 1 1.000 -> 0
-dqcomp1032 compare 1 1.00 -> 0
-dqcomp1033 compare 1 1.0 -> 0
-
-dqcomp1041 compare 1.000000000000000000000000000000000 1 -> 0
-dqcomp1042 compare 1.00000000000000000000000000000000 1 -> 0
-dqcomp1043 compare 1.0000000000000000000000000000000 1 -> 0
-dqcomp1044 compare 1.000000000000000000000000000000 1 -> 0
-dqcomp1045 compare 1.00000000000000000000000000000 1 -> 0
-dqcomp1046 compare 1.0000000000000000000000000000 1 -> 0
-dqcomp1047 compare 1.000000000000000000000000000 1 -> 0
-dqcomp1048 compare 1.00000000000000000000000000 1 -> 0
-dqcomp1049 compare 1.0000000000000000000000000 1 -> 0
-dqcomp1050 compare 1.000000000000000000000000 1 -> 0
-dqcomp1051 compare 1.00000000000000000000000 1 -> 0
-dqcomp1052 compare 1.0000000000000000000000 1 -> 0
-dqcomp1053 compare 1.000000000000000000000 1 -> 0
-dqcomp1054 compare 1.00000000000000000000 1 -> 0
-dqcomp1055 compare 1.0000000000000000000 1 -> 0
-dqcomp1056 compare 1.000000000000000000 1 -> 0
-dqcomp1057 compare 1.00000000000000000 1 -> 0
-dqcomp1058 compare 1.0000000000000000 1 -> 0
-dqcomp1059 compare 1.000000000000000 1 -> 0
-dqcomp1060 compare 1.00000000000000 1 -> 0
-dqcomp1061 compare 1.0000000000000 1 -> 0
-dqcomp1062 compare 1.000000000000 1 -> 0
-dqcomp1063 compare 1.00000000000 1 -> 0
-dqcomp1064 compare 1.0000000000 1 -> 0
-dqcomp1065 compare 1.000000000 1 -> 0
-dqcomp1066 compare 1.00000000 1 -> 0
-dqcomp1067 compare 1.0000000 1 -> 0
-dqcomp1068 compare 1.000000 1 -> 0
-dqcomp1069 compare 1.00000 1 -> 0
-dqcomp1070 compare 1.0000 1 -> 0
-dqcomp1071 compare 1.000 1 -> 0
-dqcomp1072 compare 1.00 1 -> 0
-dqcomp1073 compare 1.0 1 -> 0
-
--- check MSD always detected non-zero
-dqcomp1080 compare 0 0.000000000000000000000000000000000 -> 0
-dqcomp1081 compare 0 1.000000000000000000000000000000000 -> -1
-dqcomp1082 compare 0 2.000000000000000000000000000000000 -> -1
-dqcomp1083 compare 0 3.000000000000000000000000000000000 -> -1
-dqcomp1084 compare 0 4.000000000000000000000000000000000 -> -1
-dqcomp1085 compare 0 5.000000000000000000000000000000000 -> -1
-dqcomp1086 compare 0 6.000000000000000000000000000000000 -> -1
-dqcomp1087 compare 0 7.000000000000000000000000000000000 -> -1
-dqcomp1088 compare 0 8.000000000000000000000000000000000 -> -1
-dqcomp1089 compare 0 9.000000000000000000000000000000000 -> -1
-dqcomp1090 compare 0.000000000000000000000000000000000 0 -> 0
-dqcomp1091 compare 1.000000000000000000000000000000000 0 -> 1
-dqcomp1092 compare 2.000000000000000000000000000000000 0 -> 1
-dqcomp1093 compare 3.000000000000000000000000000000000 0 -> 1
-dqcomp1094 compare 4.000000000000000000000000000000000 0 -> 1
-dqcomp1095 compare 5.000000000000000000000000000000000 0 -> 1
-dqcomp1096 compare 6.000000000000000000000000000000000 0 -> 1
-dqcomp1097 compare 7.000000000000000000000000000000000 0 -> 1
-dqcomp1098 compare 8.000000000000000000000000000000000 0 -> 1
-dqcomp1099 compare 9.000000000000000000000000000000000 0 -> 1
-
--- Null tests
-dqcom990 compare 10 # -> NaN Invalid_operation
-dqcom991 compare # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqCompare.decTest -- decQuad comparison that allows quiet NaNs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqcom001 compare -2 -2 -> 0
+dqcom002 compare -2 -1 -> -1
+dqcom003 compare -2 0 -> -1
+dqcom004 compare -2 1 -> -1
+dqcom005 compare -2 2 -> -1
+dqcom006 compare -1 -2 -> 1
+dqcom007 compare -1 -1 -> 0
+dqcom008 compare -1 0 -> -1
+dqcom009 compare -1 1 -> -1
+dqcom010 compare -1 2 -> -1
+dqcom011 compare 0 -2 -> 1
+dqcom012 compare 0 -1 -> 1
+dqcom013 compare 0 0 -> 0
+dqcom014 compare 0 1 -> -1
+dqcom015 compare 0 2 -> -1
+dqcom016 compare 1 -2 -> 1
+dqcom017 compare 1 -1 -> 1
+dqcom018 compare 1 0 -> 1
+dqcom019 compare 1 1 -> 0
+dqcom020 compare 1 2 -> -1
+dqcom021 compare 2 -2 -> 1
+dqcom022 compare 2 -1 -> 1
+dqcom023 compare 2 0 -> 1
+dqcom025 compare 2 1 -> 1
+dqcom026 compare 2 2 -> 0
+
+dqcom031 compare -20 -20 -> 0
+dqcom032 compare -20 -10 -> -1
+dqcom033 compare -20 00 -> -1
+dqcom034 compare -20 10 -> -1
+dqcom035 compare -20 20 -> -1
+dqcom036 compare -10 -20 -> 1
+dqcom037 compare -10 -10 -> 0
+dqcom038 compare -10 00 -> -1
+dqcom039 compare -10 10 -> -1
+dqcom040 compare -10 20 -> -1
+dqcom041 compare 00 -20 -> 1
+dqcom042 compare 00 -10 -> 1
+dqcom043 compare 00 00 -> 0
+dqcom044 compare 00 10 -> -1
+dqcom045 compare 00 20 -> -1
+dqcom046 compare 10 -20 -> 1
+dqcom047 compare 10 -10 -> 1
+dqcom048 compare 10 00 -> 1
+dqcom049 compare 10 10 -> 0
+dqcom050 compare 10 20 -> -1
+dqcom051 compare 20 -20 -> 1
+dqcom052 compare 20 -10 -> 1
+dqcom053 compare 20 00 -> 1
+dqcom055 compare 20 10 -> 1
+dqcom056 compare 20 20 -> 0
+
+dqcom061 compare -2.0 -2.0 -> 0
+dqcom062 compare -2.0 -1.0 -> -1
+dqcom063 compare -2.0 0.0 -> -1
+dqcom064 compare -2.0 1.0 -> -1
+dqcom065 compare -2.0 2.0 -> -1
+dqcom066 compare -1.0 -2.0 -> 1
+dqcom067 compare -1.0 -1.0 -> 0
+dqcom068 compare -1.0 0.0 -> -1
+dqcom069 compare -1.0 1.0 -> -1
+dqcom070 compare -1.0 2.0 -> -1
+dqcom071 compare 0.0 -2.0 -> 1
+dqcom072 compare 0.0 -1.0 -> 1
+dqcom073 compare 0.0 0.0 -> 0
+dqcom074 compare 0.0 1.0 -> -1
+dqcom075 compare 0.0 2.0 -> -1
+dqcom076 compare 1.0 -2.0 -> 1
+dqcom077 compare 1.0 -1.0 -> 1
+dqcom078 compare 1.0 0.0 -> 1
+dqcom079 compare 1.0 1.0 -> 0
+dqcom080 compare 1.0 2.0 -> -1
+dqcom081 compare 2.0 -2.0 -> 1
+dqcom082 compare 2.0 -1.0 -> 1
+dqcom083 compare 2.0 0.0 -> 1
+dqcom085 compare 2.0 1.0 -> 1
+dqcom086 compare 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+dqcom090 compare 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0
+dqcom091 compare -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1
+dqcom092 compare 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1
+dqcom093 compare -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0
+
+-- some differing length/exponent cases
+dqcom100 compare 7.0 7.0 -> 0
+dqcom101 compare 7.0 7 -> 0
+dqcom102 compare 7 7.0 -> 0
+dqcom103 compare 7E+0 7.0 -> 0
+dqcom104 compare 70E-1 7.0 -> 0
+dqcom105 compare 0.7E+1 7 -> 0
+dqcom106 compare 70E-1 7 -> 0
+dqcom107 compare 7.0 7E+0 -> 0
+dqcom108 compare 7.0 70E-1 -> 0
+dqcom109 compare 7 0.7E+1 -> 0
+dqcom110 compare 7 70E-1 -> 0
+
+dqcom120 compare 8.0 7.0 -> 1
+dqcom121 compare 8.0 7 -> 1
+dqcom122 compare 8 7.0 -> 1
+dqcom123 compare 8E+0 7.0 -> 1
+dqcom124 compare 80E-1 7.0 -> 1
+dqcom125 compare 0.8E+1 7 -> 1
+dqcom126 compare 80E-1 7 -> 1
+dqcom127 compare 8.0 7E+0 -> 1
+dqcom128 compare 8.0 70E-1 -> 1
+dqcom129 compare 8 0.7E+1 -> 1
+dqcom130 compare 8 70E-1 -> 1
+
+dqcom140 compare 8.0 9.0 -> -1
+dqcom141 compare 8.0 9 -> -1
+dqcom142 compare 8 9.0 -> -1
+dqcom143 compare 8E+0 9.0 -> -1
+dqcom144 compare 80E-1 9.0 -> -1
+dqcom145 compare 0.8E+1 9 -> -1
+dqcom146 compare 80E-1 9 -> -1
+dqcom147 compare 8.0 9E+0 -> -1
+dqcom148 compare 8.0 90E-1 -> -1
+dqcom149 compare 8 0.9E+1 -> -1
+dqcom150 compare 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+dqcom200 compare -7.0 7.0 -> -1
+dqcom201 compare -7.0 7 -> -1
+dqcom202 compare -7 7.0 -> -1
+dqcom203 compare -7E+0 7.0 -> -1
+dqcom204 compare -70E-1 7.0 -> -1
+dqcom205 compare -0.7E+1 7 -> -1
+dqcom206 compare -70E-1 7 -> -1
+dqcom207 compare -7.0 7E+0 -> -1
+dqcom208 compare -7.0 70E-1 -> -1
+dqcom209 compare -7 0.7E+1 -> -1
+dqcom210 compare -7 70E-1 -> -1
+
+dqcom220 compare -8.0 7.0 -> -1
+dqcom221 compare -8.0 7 -> -1
+dqcom222 compare -8 7.0 -> -1
+dqcom223 compare -8E+0 7.0 -> -1
+dqcom224 compare -80E-1 7.0 -> -1
+dqcom225 compare -0.8E+1 7 -> -1
+dqcom226 compare -80E-1 7 -> -1
+dqcom227 compare -8.0 7E+0 -> -1
+dqcom228 compare -8.0 70E-1 -> -1
+dqcom229 compare -8 0.7E+1 -> -1
+dqcom230 compare -8 70E-1 -> -1
+
+dqcom240 compare -8.0 9.0 -> -1
+dqcom241 compare -8.0 9 -> -1
+dqcom242 compare -8 9.0 -> -1
+dqcom243 compare -8E+0 9.0 -> -1
+dqcom244 compare -80E-1 9.0 -> -1
+dqcom245 compare -0.8E+1 9 -> -1
+dqcom246 compare -80E-1 9 -> -1
+dqcom247 compare -8.0 9E+0 -> -1
+dqcom248 compare -8.0 90E-1 -> -1
+dqcom249 compare -8 0.9E+1 -> -1
+dqcom250 compare -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+dqcom300 compare 7.0 -7.0 -> 1
+dqcom301 compare 7.0 -7 -> 1
+dqcom302 compare 7 -7.0 -> 1
+dqcom303 compare 7E+0 -7.0 -> 1
+dqcom304 compare 70E-1 -7.0 -> 1
+dqcom305 compare .7E+1 -7 -> 1
+dqcom306 compare 70E-1 -7 -> 1
+dqcom307 compare 7.0 -7E+0 -> 1
+dqcom308 compare 7.0 -70E-1 -> 1
+dqcom309 compare 7 -.7E+1 -> 1
+dqcom310 compare 7 -70E-1 -> 1
+
+dqcom320 compare 8.0 -7.0 -> 1
+dqcom321 compare 8.0 -7 -> 1
+dqcom322 compare 8 -7.0 -> 1
+dqcom323 compare 8E+0 -7.0 -> 1
+dqcom324 compare 80E-1 -7.0 -> 1
+dqcom325 compare .8E+1 -7 -> 1
+dqcom326 compare 80E-1 -7 -> 1
+dqcom327 compare 8.0 -7E+0 -> 1
+dqcom328 compare 8.0 -70E-1 -> 1
+dqcom329 compare 8 -.7E+1 -> 1
+dqcom330 compare 8 -70E-1 -> 1
+
+dqcom340 compare 8.0 -9.0 -> 1
+dqcom341 compare 8.0 -9 -> 1
+dqcom342 compare 8 -9.0 -> 1
+dqcom343 compare 8E+0 -9.0 -> 1
+dqcom344 compare 80E-1 -9.0 -> 1
+dqcom345 compare .8E+1 -9 -> 1
+dqcom346 compare 80E-1 -9 -> 1
+dqcom347 compare 8.0 -9E+0 -> 1
+dqcom348 compare 8.0 -90E-1 -> 1
+dqcom349 compare 8 -.9E+1 -> 1
+dqcom350 compare 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+dqcom400 compare -7.0 -7.0 -> 0
+dqcom401 compare -7.0 -7 -> 0
+dqcom402 compare -7 -7.0 -> 0
+dqcom403 compare -7E+0 -7.0 -> 0
+dqcom404 compare -70E-1 -7.0 -> 0
+dqcom405 compare -.7E+1 -7 -> 0
+dqcom406 compare -70E-1 -7 -> 0
+dqcom407 compare -7.0 -7E+0 -> 0
+dqcom408 compare -7.0 -70E-1 -> 0
+dqcom409 compare -7 -.7E+1 -> 0
+dqcom410 compare -7 -70E-1 -> 0
+
+dqcom420 compare -8.0 -7.0 -> -1
+dqcom421 compare -8.0 -7 -> -1
+dqcom422 compare -8 -7.0 -> -1
+dqcom423 compare -8E+0 -7.0 -> -1
+dqcom424 compare -80E-1 -7.0 -> -1
+dqcom425 compare -.8E+1 -7 -> -1
+dqcom426 compare -80E-1 -7 -> -1
+dqcom427 compare -8.0 -7E+0 -> -1
+dqcom428 compare -8.0 -70E-1 -> -1
+dqcom429 compare -8 -.7E+1 -> -1
+dqcom430 compare -8 -70E-1 -> -1
+
+dqcom440 compare -8.0 -9.0 -> 1
+dqcom441 compare -8.0 -9 -> 1
+dqcom442 compare -8 -9.0 -> 1
+dqcom443 compare -8E+0 -9.0 -> 1
+dqcom444 compare -80E-1 -9.0 -> 1
+dqcom445 compare -.8E+1 -9 -> 1
+dqcom446 compare -80E-1 -9 -> 1
+dqcom447 compare -8.0 -9E+0 -> 1
+dqcom448 compare -8.0 -90E-1 -> 1
+dqcom449 compare -8 -.9E+1 -> 1
+dqcom450 compare -8 -90E-1 -> 1
+
+-- misalignment traps for little-endian
+dqcom451 compare 1.0 0.1 -> 1
+dqcom452 compare 0.1 1.0 -> -1
+dqcom453 compare 10.0 0.1 -> 1
+dqcom454 compare 0.1 10.0 -> -1
+dqcom455 compare 100 1.0 -> 1
+dqcom456 compare 1.0 100 -> -1
+dqcom457 compare 1000 10.0 -> 1
+dqcom458 compare 10.0 1000 -> -1
+dqcom459 compare 10000 100.0 -> 1
+dqcom460 compare 100.0 10000 -> -1
+dqcom461 compare 100000 1000.0 -> 1
+dqcom462 compare 1000.0 100000 -> -1
+dqcom463 compare 1000000 10000.0 -> 1
+dqcom464 compare 10000.0 1000000 -> -1
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+dqcom473 compare 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0
+dqcom474 compare 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0
+dqcom475 compare 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0
+dqcom476 compare 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0
+dqcom477 compare 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0
+dqcom478 compare 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0
+dqcom479 compare 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0
+dqcom480 compare 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0
+dqcom481 compare 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0
+dqcom482 compare 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0
+dqcom483 compare 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0
+dqcom487 compare 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0
+dqcom488 compare 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0
+dqcom489 compare 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0
+dqcom490 compare 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0
+dqcom491 compare 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0
+dqcom492 compare 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0
+dqcom493 compare 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0
+dqcom494 compare 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0
+dqcom495 compare 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0
+dqcom496 compare 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0
+dqcom497 compare 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+dqcom500 compare 1 1E-15 -> 1
+dqcom501 compare 1 1E-14 -> 1
+dqcom502 compare 1 1E-13 -> 1
+dqcom503 compare 1 1E-12 -> 1
+dqcom504 compare 1 1E-11 -> 1
+dqcom505 compare 1 1E-10 -> 1
+dqcom506 compare 1 1E-9 -> 1
+dqcom507 compare 1 1E-8 -> 1
+dqcom508 compare 1 1E-7 -> 1
+dqcom509 compare 1 1E-6 -> 1
+dqcom510 compare 1 1E-5 -> 1
+dqcom511 compare 1 1E-4 -> 1
+dqcom512 compare 1 1E-3 -> 1
+dqcom513 compare 1 1E-2 -> 1
+dqcom514 compare 1 1E-1 -> 1
+dqcom515 compare 1 1E-0 -> 0
+dqcom516 compare 1 1E+1 -> -1
+dqcom517 compare 1 1E+2 -> -1
+dqcom518 compare 1 1E+3 -> -1
+dqcom519 compare 1 1E+4 -> -1
+dqcom521 compare 1 1E+5 -> -1
+dqcom522 compare 1 1E+6 -> -1
+dqcom523 compare 1 1E+7 -> -1
+dqcom524 compare 1 1E+8 -> -1
+dqcom525 compare 1 1E+9 -> -1
+dqcom526 compare 1 1E+10 -> -1
+dqcom527 compare 1 1E+11 -> -1
+dqcom528 compare 1 1E+12 -> -1
+dqcom529 compare 1 1E+13 -> -1
+dqcom530 compare 1 1E+14 -> -1
+dqcom531 compare 1 1E+15 -> -1
+-- LR swap
+dqcom540 compare 1E-15 1 -> -1
+dqcom541 compare 1E-14 1 -> -1
+dqcom542 compare 1E-13 1 -> -1
+dqcom543 compare 1E-12 1 -> -1
+dqcom544 compare 1E-11 1 -> -1
+dqcom545 compare 1E-10 1 -> -1
+dqcom546 compare 1E-9 1 -> -1
+dqcom547 compare 1E-8 1 -> -1
+dqcom548 compare 1E-7 1 -> -1
+dqcom549 compare 1E-6 1 -> -1
+dqcom550 compare 1E-5 1 -> -1
+dqcom551 compare 1E-4 1 -> -1
+dqcom552 compare 1E-3 1 -> -1
+dqcom553 compare 1E-2 1 -> -1
+dqcom554 compare 1E-1 1 -> -1
+dqcom555 compare 1E-0 1 -> 0
+dqcom556 compare 1E+1 1 -> 1
+dqcom557 compare 1E+2 1 -> 1
+dqcom558 compare 1E+3 1 -> 1
+dqcom559 compare 1E+4 1 -> 1
+dqcom561 compare 1E+5 1 -> 1
+dqcom562 compare 1E+6 1 -> 1
+dqcom563 compare 1E+7 1 -> 1
+dqcom564 compare 1E+8 1 -> 1
+dqcom565 compare 1E+9 1 -> 1
+dqcom566 compare 1E+10 1 -> 1
+dqcom567 compare 1E+11 1 -> 1
+dqcom568 compare 1E+12 1 -> 1
+dqcom569 compare 1E+13 1 -> 1
+dqcom570 compare 1E+14 1 -> 1
+dqcom571 compare 1E+15 1 -> 1
+-- similar with a useful coefficient, one side only
+dqcom580 compare 0.000000987654321 1E-15 -> 1
+dqcom581 compare 0.000000987654321 1E-14 -> 1
+dqcom582 compare 0.000000987654321 1E-13 -> 1
+dqcom583 compare 0.000000987654321 1E-12 -> 1
+dqcom584 compare 0.000000987654321 1E-11 -> 1
+dqcom585 compare 0.000000987654321 1E-10 -> 1
+dqcom586 compare 0.000000987654321 1E-9 -> 1
+dqcom587 compare 0.000000987654321 1E-8 -> 1
+dqcom588 compare 0.000000987654321 1E-7 -> 1
+dqcom589 compare 0.000000987654321 1E-6 -> -1
+dqcom590 compare 0.000000987654321 1E-5 -> -1
+dqcom591 compare 0.000000987654321 1E-4 -> -1
+dqcom592 compare 0.000000987654321 1E-3 -> -1
+dqcom593 compare 0.000000987654321 1E-2 -> -1
+dqcom594 compare 0.000000987654321 1E-1 -> -1
+dqcom595 compare 0.000000987654321 1E-0 -> -1
+dqcom596 compare 0.000000987654321 1E+1 -> -1
+dqcom597 compare 0.000000987654321 1E+2 -> -1
+dqcom598 compare 0.000000987654321 1E+3 -> -1
+dqcom599 compare 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+dqcom600 compare 12 12.2345 -> -1
+dqcom601 compare 12.0 12.2345 -> -1
+dqcom602 compare 12.00 12.2345 -> -1
+dqcom603 compare 12.000 12.2345 -> -1
+dqcom604 compare 12.0000 12.2345 -> -1
+dqcom605 compare 12.00000 12.2345 -> -1
+dqcom606 compare 12.000000 12.2345 -> -1
+dqcom607 compare 12.0000000 12.2345 -> -1
+dqcom608 compare 12.00000000 12.2345 -> -1
+dqcom609 compare 12.000000000 12.2345 -> -1
+dqcom610 compare 12.1234 12 -> 1
+dqcom611 compare 12.1234 12.0 -> 1
+dqcom612 compare 12.1234 12.00 -> 1
+dqcom613 compare 12.1234 12.000 -> 1
+dqcom614 compare 12.1234 12.0000 -> 1
+dqcom615 compare 12.1234 12.00000 -> 1
+dqcom616 compare 12.1234 12.000000 -> 1
+dqcom617 compare 12.1234 12.0000000 -> 1
+dqcom618 compare 12.1234 12.00000000 -> 1
+dqcom619 compare 12.1234 12.000000000 -> 1
+dqcom620 compare -12 -12.2345 -> 1
+dqcom621 compare -12.0 -12.2345 -> 1
+dqcom622 compare -12.00 -12.2345 -> 1
+dqcom623 compare -12.000 -12.2345 -> 1
+dqcom624 compare -12.0000 -12.2345 -> 1
+dqcom625 compare -12.00000 -12.2345 -> 1
+dqcom626 compare -12.000000 -12.2345 -> 1
+dqcom627 compare -12.0000000 -12.2345 -> 1
+dqcom628 compare -12.00000000 -12.2345 -> 1
+dqcom629 compare -12.000000000 -12.2345 -> 1
+dqcom630 compare -12.1234 -12 -> -1
+dqcom631 compare -12.1234 -12.0 -> -1
+dqcom632 compare -12.1234 -12.00 -> -1
+dqcom633 compare -12.1234 -12.000 -> -1
+dqcom634 compare -12.1234 -12.0000 -> -1
+dqcom635 compare -12.1234 -12.00000 -> -1
+dqcom636 compare -12.1234 -12.000000 -> -1
+dqcom637 compare -12.1234 -12.0000000 -> -1
+dqcom638 compare -12.1234 -12.00000000 -> -1
+dqcom639 compare -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+dqcom640 compare 0 0 -> 0
+dqcom641 compare 0 -0 -> 0
+dqcom642 compare 0 -0.0 -> 0
+dqcom643 compare 0 0.0 -> 0
+dqcom644 compare -0 0 -> 0
+dqcom645 compare -0 -0 -> 0
+dqcom646 compare -0 -0.0 -> 0
+dqcom647 compare -0 0.0 -> 0
+dqcom648 compare 0.0 0 -> 0
+dqcom649 compare 0.0 -0 -> 0
+dqcom650 compare 0.0 -0.0 -> 0
+dqcom651 compare 0.0 0.0 -> 0
+dqcom652 compare -0.0 0 -> 0
+dqcom653 compare -0.0 -0 -> 0
+dqcom654 compare -0.0 -0.0 -> 0
+dqcom655 compare -0.0 0.0 -> 0
+
+dqcom656 compare -0E1 0.0 -> 0
+dqcom657 compare -0E2 0.0 -> 0
+dqcom658 compare 0E1 0.0 -> 0
+dqcom659 compare 0E2 0.0 -> 0
+dqcom660 compare -0E1 0 -> 0
+dqcom661 compare -0E2 0 -> 0
+dqcom662 compare 0E1 0 -> 0
+dqcom663 compare 0E2 0 -> 0
+dqcom664 compare -0E1 -0E1 -> 0
+dqcom665 compare -0E2 -0E1 -> 0
+dqcom666 compare 0E1 -0E1 -> 0
+dqcom667 compare 0E2 -0E1 -> 0
+dqcom668 compare -0E1 -0E2 -> 0
+dqcom669 compare -0E2 -0E2 -> 0
+dqcom670 compare 0E1 -0E2 -> 0
+dqcom671 compare 0E2 -0E2 -> 0
+dqcom672 compare -0E1 0E1 -> 0
+dqcom673 compare -0E2 0E1 -> 0
+dqcom674 compare 0E1 0E1 -> 0
+dqcom675 compare 0E2 0E1 -> 0
+dqcom676 compare -0E1 0E2 -> 0
+dqcom677 compare -0E2 0E2 -> 0
+dqcom678 compare 0E1 0E2 -> 0
+dqcom679 compare 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+dqcom680 compare 12 12 -> 0
+dqcom681 compare 12 12.0 -> 0
+dqcom682 compare 12 12.00 -> 0
+dqcom683 compare 12 12.000 -> 0
+dqcom684 compare 12 12.0000 -> 0
+dqcom685 compare 12 12.00000 -> 0
+dqcom686 compare 12 12.000000 -> 0
+dqcom687 compare 12 12.0000000 -> 0
+dqcom688 compare 12 12.00000000 -> 0
+dqcom689 compare 12 12.000000000 -> 0
+dqcom690 compare 12 12 -> 0
+dqcom691 compare 12.0 12 -> 0
+dqcom692 compare 12.00 12 -> 0
+dqcom693 compare 12.000 12 -> 0
+dqcom694 compare 12.0000 12 -> 0
+dqcom695 compare 12.00000 12 -> 0
+dqcom696 compare 12.000000 12 -> 0
+dqcom697 compare 12.0000000 12 -> 0
+dqcom698 compare 12.00000000 12 -> 0
+dqcom699 compare 12.000000000 12 -> 0
+
+-- first, second, & last digit
+dqcom700 compare 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1
+dqcom701 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
+dqcom702 compare 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1
+dqcom703 compare 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1
+dqcom704 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
+dqcom705 compare 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1
+dqcom706 compare 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1
+dqcom707 compare 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0
+dqcom708 compare 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1
+
+-- miscellaneous
+dqcom721 compare 12345678000 1 -> 1
+dqcom722 compare 1 12345678000 -> -1
+dqcom723 compare 1234567800 1 -> 1
+dqcom724 compare 1 1234567800 -> -1
+dqcom725 compare 1234567890 1 -> 1
+dqcom726 compare 1 1234567890 -> -1
+dqcom727 compare 1234567891 1 -> 1
+dqcom728 compare 1 1234567891 -> -1
+dqcom729 compare 12345678901 1 -> 1
+dqcom730 compare 1 12345678901 -> -1
+dqcom731 compare 1234567896 1 -> 1
+dqcom732 compare 1 1234567896 -> -1
+
+-- residue cases at lower precision
+dqcom740 compare 1 0.9999999 -> 1
+dqcom741 compare 1 0.999999 -> 1
+dqcom742 compare 1 0.99999 -> 1
+dqcom743 compare 1 1.0000 -> 0
+dqcom744 compare 1 1.00001 -> -1
+dqcom745 compare 1 1.000001 -> -1
+dqcom746 compare 1 1.0000001 -> -1
+dqcom750 compare 0.9999999 1 -> -1
+dqcom751 compare 0.999999 1 -> -1
+dqcom752 compare 0.99999 1 -> -1
+dqcom753 compare 1.0000 1 -> 0
+dqcom754 compare 1.00001 1 -> 1
+dqcom755 compare 1.000001 1 -> 1
+dqcom756 compare 1.0000001 1 -> 1
+
+-- Specials
+dqcom780 compare Inf -Inf -> 1
+dqcom781 compare Inf -1000 -> 1
+dqcom782 compare Inf -1 -> 1
+dqcom783 compare Inf -0 -> 1
+dqcom784 compare Inf 0 -> 1
+dqcom785 compare Inf 1 -> 1
+dqcom786 compare Inf 1000 -> 1
+dqcom787 compare Inf Inf -> 0
+dqcom788 compare -1000 Inf -> -1
+dqcom789 compare -Inf Inf -> -1
+dqcom790 compare -1 Inf -> -1
+dqcom791 compare -0 Inf -> -1
+dqcom792 compare 0 Inf -> -1
+dqcom793 compare 1 Inf -> -1
+dqcom794 compare 1000 Inf -> -1
+dqcom795 compare Inf Inf -> 0
+
+dqcom800 compare -Inf -Inf -> 0
+dqcom801 compare -Inf -1000 -> -1
+dqcom802 compare -Inf -1 -> -1
+dqcom803 compare -Inf -0 -> -1
+dqcom804 compare -Inf 0 -> -1
+dqcom805 compare -Inf 1 -> -1
+dqcom806 compare -Inf 1000 -> -1
+dqcom807 compare -Inf Inf -> -1
+dqcom808 compare -Inf -Inf -> 0
+dqcom809 compare -1000 -Inf -> 1
+dqcom810 compare -1 -Inf -> 1
+dqcom811 compare -0 -Inf -> 1
+dqcom812 compare 0 -Inf -> 1
+dqcom813 compare 1 -Inf -> 1
+dqcom814 compare 1000 -Inf -> 1
+dqcom815 compare Inf -Inf -> 1
+
+dqcom821 compare NaN -Inf -> NaN
+dqcom822 compare NaN -1000 -> NaN
+dqcom823 compare NaN -1 -> NaN
+dqcom824 compare NaN -0 -> NaN
+dqcom825 compare NaN 0 -> NaN
+dqcom826 compare NaN 1 -> NaN
+dqcom827 compare NaN 1000 -> NaN
+dqcom828 compare NaN Inf -> NaN
+dqcom829 compare NaN NaN -> NaN
+dqcom830 compare -Inf NaN -> NaN
+dqcom831 compare -1000 NaN -> NaN
+dqcom832 compare -1 NaN -> NaN
+dqcom833 compare -0 NaN -> NaN
+dqcom834 compare 0 NaN -> NaN
+dqcom835 compare 1 NaN -> NaN
+dqcom836 compare 1000 NaN -> NaN
+dqcom837 compare Inf NaN -> NaN
+dqcom838 compare -NaN -NaN -> -NaN
+dqcom839 compare +NaN -NaN -> NaN
+dqcom840 compare -NaN +NaN -> -NaN
+
+dqcom841 compare sNaN -Inf -> NaN Invalid_operation
+dqcom842 compare sNaN -1000 -> NaN Invalid_operation
+dqcom843 compare sNaN -1 -> NaN Invalid_operation
+dqcom844 compare sNaN -0 -> NaN Invalid_operation
+dqcom845 compare sNaN 0 -> NaN Invalid_operation
+dqcom846 compare sNaN 1 -> NaN Invalid_operation
+dqcom847 compare sNaN 1000 -> NaN Invalid_operation
+dqcom848 compare sNaN NaN -> NaN Invalid_operation
+dqcom849 compare sNaN sNaN -> NaN Invalid_operation
+dqcom850 compare NaN sNaN -> NaN Invalid_operation
+dqcom851 compare -Inf sNaN -> NaN Invalid_operation
+dqcom852 compare -1000 sNaN -> NaN Invalid_operation
+dqcom853 compare -1 sNaN -> NaN Invalid_operation
+dqcom854 compare -0 sNaN -> NaN Invalid_operation
+dqcom855 compare 0 sNaN -> NaN Invalid_operation
+dqcom856 compare 1 sNaN -> NaN Invalid_operation
+dqcom857 compare 1000 sNaN -> NaN Invalid_operation
+dqcom858 compare Inf sNaN -> NaN Invalid_operation
+dqcom859 compare NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqcom860 compare NaN9 -Inf -> NaN9
+dqcom861 compare NaN8 999 -> NaN8
+dqcom862 compare NaN77 Inf -> NaN77
+dqcom863 compare -NaN67 NaN5 -> -NaN67
+dqcom864 compare -Inf -NaN4 -> -NaN4
+dqcom865 compare -999 -NaN33 -> -NaN33
+dqcom866 compare Inf NaN2 -> NaN2
+dqcom867 compare -NaN41 -NaN42 -> -NaN41
+dqcom868 compare +NaN41 -NaN42 -> NaN41
+dqcom869 compare -NaN41 +NaN42 -> -NaN41
+dqcom870 compare +NaN41 +NaN42 -> NaN41
+
+dqcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
+dqcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
+dqcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
+dqcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
+dqcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
+dqcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
+dqcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
+dqcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- wide range
+dqcom880 compare +1.23456789012345E-0 9E+6144 -> -1
+dqcom881 compare 9E+6144 +1.23456789012345E-0 -> 1
+dqcom882 compare +0.100 9E-6143 -> 1
+dqcom883 compare 9E-6143 +0.100 -> -1
+dqcom885 compare -1.23456789012345E-0 9E+6144 -> -1
+dqcom886 compare 9E+6144 -1.23456789012345E-0 -> 1
+dqcom887 compare -0.100 9E-6143 -> -1
+dqcom888 compare 9E-6143 -0.100 -> 1
+
+-- signs
+dqcom901 compare 1e+77 1e+11 -> 1
+dqcom902 compare 1e+77 -1e+11 -> 1
+dqcom903 compare -1e+77 1e+11 -> -1
+dqcom904 compare -1e+77 -1e+11 -> -1
+dqcom905 compare 1e-77 1e-11 -> -1
+dqcom906 compare 1e-77 -1e-11 -> 1
+dqcom907 compare -1e-77 1e-11 -> -1
+dqcom908 compare -1e-77 -1e-11 -> 1
+
+-- full alignment range, both ways
+dqcomp1001 compare 1 1.000000000000000000000000000000000 -> 0
+dqcomp1002 compare 1 1.00000000000000000000000000000000 -> 0
+dqcomp1003 compare 1 1.0000000000000000000000000000000 -> 0
+dqcomp1004 compare 1 1.000000000000000000000000000000 -> 0
+dqcomp1005 compare 1 1.00000000000000000000000000000 -> 0
+dqcomp1006 compare 1 1.0000000000000000000000000000 -> 0
+dqcomp1007 compare 1 1.000000000000000000000000000 -> 0
+dqcomp1008 compare 1 1.00000000000000000000000000 -> 0
+dqcomp1009 compare 1 1.0000000000000000000000000 -> 0
+dqcomp1010 compare 1 1.000000000000000000000000 -> 0
+dqcomp1011 compare 1 1.00000000000000000000000 -> 0
+dqcomp1012 compare 1 1.0000000000000000000000 -> 0
+dqcomp1013 compare 1 1.000000000000000000000 -> 0
+dqcomp1014 compare 1 1.00000000000000000000 -> 0
+dqcomp1015 compare 1 1.0000000000000000000 -> 0
+dqcomp1016 compare 1 1.000000000000000000 -> 0
+dqcomp1017 compare 1 1.00000000000000000 -> 0
+dqcomp1018 compare 1 1.0000000000000000 -> 0
+dqcomp1019 compare 1 1.000000000000000 -> 0
+dqcomp1020 compare 1 1.00000000000000 -> 0
+dqcomp1021 compare 1 1.0000000000000 -> 0
+dqcomp1022 compare 1 1.000000000000 -> 0
+dqcomp1023 compare 1 1.00000000000 -> 0
+dqcomp1024 compare 1 1.0000000000 -> 0
+dqcomp1025 compare 1 1.000000000 -> 0
+dqcomp1026 compare 1 1.00000000 -> 0
+dqcomp1027 compare 1 1.0000000 -> 0
+dqcomp1028 compare 1 1.000000 -> 0
+dqcomp1029 compare 1 1.00000 -> 0
+dqcomp1030 compare 1 1.0000 -> 0
+dqcomp1031 compare 1 1.000 -> 0
+dqcomp1032 compare 1 1.00 -> 0
+dqcomp1033 compare 1 1.0 -> 0
+
+dqcomp1041 compare 1.000000000000000000000000000000000 1 -> 0
+dqcomp1042 compare 1.00000000000000000000000000000000 1 -> 0
+dqcomp1043 compare 1.0000000000000000000000000000000 1 -> 0
+dqcomp1044 compare 1.000000000000000000000000000000 1 -> 0
+dqcomp1045 compare 1.00000000000000000000000000000 1 -> 0
+dqcomp1046 compare 1.0000000000000000000000000000 1 -> 0
+dqcomp1047 compare 1.000000000000000000000000000 1 -> 0
+dqcomp1048 compare 1.00000000000000000000000000 1 -> 0
+dqcomp1049 compare 1.0000000000000000000000000 1 -> 0
+dqcomp1050 compare 1.000000000000000000000000 1 -> 0
+dqcomp1051 compare 1.00000000000000000000000 1 -> 0
+dqcomp1052 compare 1.0000000000000000000000 1 -> 0
+dqcomp1053 compare 1.000000000000000000000 1 -> 0
+dqcomp1054 compare 1.00000000000000000000 1 -> 0
+dqcomp1055 compare 1.0000000000000000000 1 -> 0
+dqcomp1056 compare 1.000000000000000000 1 -> 0
+dqcomp1057 compare 1.00000000000000000 1 -> 0
+dqcomp1058 compare 1.0000000000000000 1 -> 0
+dqcomp1059 compare 1.000000000000000 1 -> 0
+dqcomp1060 compare 1.00000000000000 1 -> 0
+dqcomp1061 compare 1.0000000000000 1 -> 0
+dqcomp1062 compare 1.000000000000 1 -> 0
+dqcomp1063 compare 1.00000000000 1 -> 0
+dqcomp1064 compare 1.0000000000 1 -> 0
+dqcomp1065 compare 1.000000000 1 -> 0
+dqcomp1066 compare 1.00000000 1 -> 0
+dqcomp1067 compare 1.0000000 1 -> 0
+dqcomp1068 compare 1.000000 1 -> 0
+dqcomp1069 compare 1.00000 1 -> 0
+dqcomp1070 compare 1.0000 1 -> 0
+dqcomp1071 compare 1.000 1 -> 0
+dqcomp1072 compare 1.00 1 -> 0
+dqcomp1073 compare 1.0 1 -> 0
+
+-- check MSD always detected non-zero
+dqcomp1080 compare 0 0.000000000000000000000000000000000 -> 0
+dqcomp1081 compare 0 1.000000000000000000000000000000000 -> -1
+dqcomp1082 compare 0 2.000000000000000000000000000000000 -> -1
+dqcomp1083 compare 0 3.000000000000000000000000000000000 -> -1
+dqcomp1084 compare 0 4.000000000000000000000000000000000 -> -1
+dqcomp1085 compare 0 5.000000000000000000000000000000000 -> -1
+dqcomp1086 compare 0 6.000000000000000000000000000000000 -> -1
+dqcomp1087 compare 0 7.000000000000000000000000000000000 -> -1
+dqcomp1088 compare 0 8.000000000000000000000000000000000 -> -1
+dqcomp1089 compare 0 9.000000000000000000000000000000000 -> -1
+dqcomp1090 compare 0.000000000000000000000000000000000 0 -> 0
+dqcomp1091 compare 1.000000000000000000000000000000000 0 -> 1
+dqcomp1092 compare 2.000000000000000000000000000000000 0 -> 1
+dqcomp1093 compare 3.000000000000000000000000000000000 0 -> 1
+dqcomp1094 compare 4.000000000000000000000000000000000 0 -> 1
+dqcomp1095 compare 5.000000000000000000000000000000000 0 -> 1
+dqcomp1096 compare 6.000000000000000000000000000000000 0 -> 1
+dqcomp1097 compare 7.000000000000000000000000000000000 0 -> 1
+dqcomp1098 compare 8.000000000000000000000000000000000 0 -> 1
+dqcomp1099 compare 9.000000000000000000000000000000000 0 -> 1
+
+-- Null tests
+dqcom990 compare 10 # -> NaN Invalid_operation
+dqcom991 compare # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqCompareSig.decTest b/Lib/test/decimaltestdata/dqCompareSig.decTest
index 795f0916dd..c068d471c1 100644
--- a/Lib/test/decimaltestdata/dqCompareSig.decTest
+++ b/Lib/test/decimaltestdata/dqCompareSig.decTest
@@ -1,647 +1,647 @@
-------------------------------------------------------------------------
--- dqCompareSig.decTest -- decQuad comparison; all NaNs signal --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqcms001 comparesig -2 -2 -> 0
-dqcms002 comparesig -2 -1 -> -1
-dqcms003 comparesig -2 0 -> -1
-dqcms004 comparesig -2 1 -> -1
-dqcms005 comparesig -2 2 -> -1
-dqcms006 comparesig -1 -2 -> 1
-dqcms007 comparesig -1 -1 -> 0
-dqcms008 comparesig -1 0 -> -1
-dqcms009 comparesig -1 1 -> -1
-dqcms010 comparesig -1 2 -> -1
-dqcms011 comparesig 0 -2 -> 1
-dqcms012 comparesig 0 -1 -> 1
-dqcms013 comparesig 0 0 -> 0
-dqcms014 comparesig 0 1 -> -1
-dqcms015 comparesig 0 2 -> -1
-dqcms016 comparesig 1 -2 -> 1
-dqcms017 comparesig 1 -1 -> 1
-dqcms018 comparesig 1 0 -> 1
-dqcms019 comparesig 1 1 -> 0
-dqcms020 comparesig 1 2 -> -1
-dqcms021 comparesig 2 -2 -> 1
-dqcms022 comparesig 2 -1 -> 1
-dqcms023 comparesig 2 0 -> 1
-dqcms025 comparesig 2 1 -> 1
-dqcms026 comparesig 2 2 -> 0
-
-dqcms031 comparesig -20 -20 -> 0
-dqcms032 comparesig -20 -10 -> -1
-dqcms033 comparesig -20 00 -> -1
-dqcms034 comparesig -20 10 -> -1
-dqcms035 comparesig -20 20 -> -1
-dqcms036 comparesig -10 -20 -> 1
-dqcms037 comparesig -10 -10 -> 0
-dqcms038 comparesig -10 00 -> -1
-dqcms039 comparesig -10 10 -> -1
-dqcms040 comparesig -10 20 -> -1
-dqcms041 comparesig 00 -20 -> 1
-dqcms042 comparesig 00 -10 -> 1
-dqcms043 comparesig 00 00 -> 0
-dqcms044 comparesig 00 10 -> -1
-dqcms045 comparesig 00 20 -> -1
-dqcms046 comparesig 10 -20 -> 1
-dqcms047 comparesig 10 -10 -> 1
-dqcms048 comparesig 10 00 -> 1
-dqcms049 comparesig 10 10 -> 0
-dqcms050 comparesig 10 20 -> -1
-dqcms051 comparesig 20 -20 -> 1
-dqcms052 comparesig 20 -10 -> 1
-dqcms053 comparesig 20 00 -> 1
-dqcms055 comparesig 20 10 -> 1
-dqcms056 comparesig 20 20 -> 0
-
-dqcms061 comparesig -2.0 -2.0 -> 0
-dqcms062 comparesig -2.0 -1.0 -> -1
-dqcms063 comparesig -2.0 0.0 -> -1
-dqcms064 comparesig -2.0 1.0 -> -1
-dqcms065 comparesig -2.0 2.0 -> -1
-dqcms066 comparesig -1.0 -2.0 -> 1
-dqcms067 comparesig -1.0 -1.0 -> 0
-dqcms068 comparesig -1.0 0.0 -> -1
-dqcms069 comparesig -1.0 1.0 -> -1
-dqcms070 comparesig -1.0 2.0 -> -1
-dqcms071 comparesig 0.0 -2.0 -> 1
-dqcms072 comparesig 0.0 -1.0 -> 1
-dqcms073 comparesig 0.0 0.0 -> 0
-dqcms074 comparesig 0.0 1.0 -> -1
-dqcms075 comparesig 0.0 2.0 -> -1
-dqcms076 comparesig 1.0 -2.0 -> 1
-dqcms077 comparesig 1.0 -1.0 -> 1
-dqcms078 comparesig 1.0 0.0 -> 1
-dqcms079 comparesig 1.0 1.0 -> 0
-dqcms080 comparesig 1.0 2.0 -> -1
-dqcms081 comparesig 2.0 -2.0 -> 1
-dqcms082 comparesig 2.0 -1.0 -> 1
-dqcms083 comparesig 2.0 0.0 -> 1
-dqcms085 comparesig 2.0 1.0 -> 1
-dqcms086 comparesig 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-dqcms090 comparesig 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0
-dqcms091 comparesig -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1
-dqcms092 comparesig 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1
-dqcms093 comparesig -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0
-
--- some differing length/exponent cases
-dqcms100 comparesig 7.0 7.0 -> 0
-dqcms101 comparesig 7.0 7 -> 0
-dqcms102 comparesig 7 7.0 -> 0
-dqcms103 comparesig 7E+0 7.0 -> 0
-dqcms104 comparesig 70E-1 7.0 -> 0
-dqcms105 comparesig 0.7E+1 7 -> 0
-dqcms106 comparesig 70E-1 7 -> 0
-dqcms107 comparesig 7.0 7E+0 -> 0
-dqcms108 comparesig 7.0 70E-1 -> 0
-dqcms109 comparesig 7 0.7E+1 -> 0
-dqcms110 comparesig 7 70E-1 -> 0
-
-dqcms120 comparesig 8.0 7.0 -> 1
-dqcms121 comparesig 8.0 7 -> 1
-dqcms122 comparesig 8 7.0 -> 1
-dqcms123 comparesig 8E+0 7.0 -> 1
-dqcms124 comparesig 80E-1 7.0 -> 1
-dqcms125 comparesig 0.8E+1 7 -> 1
-dqcms126 comparesig 80E-1 7 -> 1
-dqcms127 comparesig 8.0 7E+0 -> 1
-dqcms128 comparesig 8.0 70E-1 -> 1
-dqcms129 comparesig 8 0.7E+1 -> 1
-dqcms130 comparesig 8 70E-1 -> 1
-
-dqcms140 comparesig 8.0 9.0 -> -1
-dqcms141 comparesig 8.0 9 -> -1
-dqcms142 comparesig 8 9.0 -> -1
-dqcms143 comparesig 8E+0 9.0 -> -1
-dqcms144 comparesig 80E-1 9.0 -> -1
-dqcms145 comparesig 0.8E+1 9 -> -1
-dqcms146 comparesig 80E-1 9 -> -1
-dqcms147 comparesig 8.0 9E+0 -> -1
-dqcms148 comparesig 8.0 90E-1 -> -1
-dqcms149 comparesig 8 0.9E+1 -> -1
-dqcms150 comparesig 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-dqcms200 comparesig -7.0 7.0 -> -1
-dqcms201 comparesig -7.0 7 -> -1
-dqcms202 comparesig -7 7.0 -> -1
-dqcms203 comparesig -7E+0 7.0 -> -1
-dqcms204 comparesig -70E-1 7.0 -> -1
-dqcms205 comparesig -0.7E+1 7 -> -1
-dqcms206 comparesig -70E-1 7 -> -1
-dqcms207 comparesig -7.0 7E+0 -> -1
-dqcms208 comparesig -7.0 70E-1 -> -1
-dqcms209 comparesig -7 0.7E+1 -> -1
-dqcms210 comparesig -7 70E-1 -> -1
-
-dqcms220 comparesig -8.0 7.0 -> -1
-dqcms221 comparesig -8.0 7 -> -1
-dqcms222 comparesig -8 7.0 -> -1
-dqcms223 comparesig -8E+0 7.0 -> -1
-dqcms224 comparesig -80E-1 7.0 -> -1
-dqcms225 comparesig -0.8E+1 7 -> -1
-dqcms226 comparesig -80E-1 7 -> -1
-dqcms227 comparesig -8.0 7E+0 -> -1
-dqcms228 comparesig -8.0 70E-1 -> -1
-dqcms229 comparesig -8 0.7E+1 -> -1
-dqcms230 comparesig -8 70E-1 -> -1
-
-dqcms240 comparesig -8.0 9.0 -> -1
-dqcms241 comparesig -8.0 9 -> -1
-dqcms242 comparesig -8 9.0 -> -1
-dqcms243 comparesig -8E+0 9.0 -> -1
-dqcms244 comparesig -80E-1 9.0 -> -1
-dqcms245 comparesig -0.8E+1 9 -> -1
-dqcms246 comparesig -80E-1 9 -> -1
-dqcms247 comparesig -8.0 9E+0 -> -1
-dqcms248 comparesig -8.0 90E-1 -> -1
-dqcms249 comparesig -8 0.9E+1 -> -1
-dqcms250 comparesig -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-dqcms300 comparesig 7.0 -7.0 -> 1
-dqcms301 comparesig 7.0 -7 -> 1
-dqcms302 comparesig 7 -7.0 -> 1
-dqcms303 comparesig 7E+0 -7.0 -> 1
-dqcms304 comparesig 70E-1 -7.0 -> 1
-dqcms305 comparesig .7E+1 -7 -> 1
-dqcms306 comparesig 70E-1 -7 -> 1
-dqcms307 comparesig 7.0 -7E+0 -> 1
-dqcms308 comparesig 7.0 -70E-1 -> 1
-dqcms309 comparesig 7 -.7E+1 -> 1
-dqcms310 comparesig 7 -70E-1 -> 1
-
-dqcms320 comparesig 8.0 -7.0 -> 1
-dqcms321 comparesig 8.0 -7 -> 1
-dqcms322 comparesig 8 -7.0 -> 1
-dqcms323 comparesig 8E+0 -7.0 -> 1
-dqcms324 comparesig 80E-1 -7.0 -> 1
-dqcms325 comparesig .8E+1 -7 -> 1
-dqcms326 comparesig 80E-1 -7 -> 1
-dqcms327 comparesig 8.0 -7E+0 -> 1
-dqcms328 comparesig 8.0 -70E-1 -> 1
-dqcms329 comparesig 8 -.7E+1 -> 1
-dqcms330 comparesig 8 -70E-1 -> 1
-
-dqcms340 comparesig 8.0 -9.0 -> 1
-dqcms341 comparesig 8.0 -9 -> 1
-dqcms342 comparesig 8 -9.0 -> 1
-dqcms343 comparesig 8E+0 -9.0 -> 1
-dqcms344 comparesig 80E-1 -9.0 -> 1
-dqcms345 comparesig .8E+1 -9 -> 1
-dqcms346 comparesig 80E-1 -9 -> 1
-dqcms347 comparesig 8.0 -9E+0 -> 1
-dqcms348 comparesig 8.0 -90E-1 -> 1
-dqcms349 comparesig 8 -.9E+1 -> 1
-dqcms350 comparesig 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-dqcms400 comparesig -7.0 -7.0 -> 0
-dqcms401 comparesig -7.0 -7 -> 0
-dqcms402 comparesig -7 -7.0 -> 0
-dqcms403 comparesig -7E+0 -7.0 -> 0
-dqcms404 comparesig -70E-1 -7.0 -> 0
-dqcms405 comparesig -.7E+1 -7 -> 0
-dqcms406 comparesig -70E-1 -7 -> 0
-dqcms407 comparesig -7.0 -7E+0 -> 0
-dqcms408 comparesig -7.0 -70E-1 -> 0
-dqcms409 comparesig -7 -.7E+1 -> 0
-dqcms410 comparesig -7 -70E-1 -> 0
-
-dqcms420 comparesig -8.0 -7.0 -> -1
-dqcms421 comparesig -8.0 -7 -> -1
-dqcms422 comparesig -8 -7.0 -> -1
-dqcms423 comparesig -8E+0 -7.0 -> -1
-dqcms424 comparesig -80E-1 -7.0 -> -1
-dqcms425 comparesig -.8E+1 -7 -> -1
-dqcms426 comparesig -80E-1 -7 -> -1
-dqcms427 comparesig -8.0 -7E+0 -> -1
-dqcms428 comparesig -8.0 -70E-1 -> -1
-dqcms429 comparesig -8 -.7E+1 -> -1
-dqcms430 comparesig -8 -70E-1 -> -1
-
-dqcms440 comparesig -8.0 -9.0 -> 1
-dqcms441 comparesig -8.0 -9 -> 1
-dqcms442 comparesig -8 -9.0 -> 1
-dqcms443 comparesig -8E+0 -9.0 -> 1
-dqcms444 comparesig -80E-1 -9.0 -> 1
-dqcms445 comparesig -.8E+1 -9 -> 1
-dqcms446 comparesig -80E-1 -9 -> 1
-dqcms447 comparesig -8.0 -9E+0 -> 1
-dqcms448 comparesig -8.0 -90E-1 -> 1
-dqcms449 comparesig -8 -.9E+1 -> 1
-dqcms450 comparesig -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-dqcms473 comparesig 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0
-dqcms474 comparesig 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0
-dqcms475 comparesig 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0
-dqcms476 comparesig 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0
-dqcms477 comparesig 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0
-dqcms478 comparesig 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0
-dqcms479 comparesig 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0
-dqcms480 comparesig 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0
-dqcms481 comparesig 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0
-dqcms482 comparesig 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0
-dqcms483 comparesig 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0
-dqcms487 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0
-dqcms488 comparesig 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0
-dqcms489 comparesig 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0
-dqcms490 comparesig 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0
-dqcms491 comparesig 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0
-dqcms492 comparesig 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0
-dqcms493 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0
-dqcms494 comparesig 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0
-dqcms495 comparesig 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0
-dqcms496 comparesig 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0
-dqcms497 comparesig 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-dqcms500 comparesig 1 1E-15 -> 1
-dqcms501 comparesig 1 1E-14 -> 1
-dqcms502 comparesig 1 1E-13 -> 1
-dqcms503 comparesig 1 1E-12 -> 1
-dqcms504 comparesig 1 1E-11 -> 1
-dqcms505 comparesig 1 1E-10 -> 1
-dqcms506 comparesig 1 1E-9 -> 1
-dqcms507 comparesig 1 1E-8 -> 1
-dqcms508 comparesig 1 1E-7 -> 1
-dqcms509 comparesig 1 1E-6 -> 1
-dqcms510 comparesig 1 1E-5 -> 1
-dqcms511 comparesig 1 1E-4 -> 1
-dqcms512 comparesig 1 1E-3 -> 1
-dqcms513 comparesig 1 1E-2 -> 1
-dqcms514 comparesig 1 1E-1 -> 1
-dqcms515 comparesig 1 1E-0 -> 0
-dqcms516 comparesig 1 1E+1 -> -1
-dqcms517 comparesig 1 1E+2 -> -1
-dqcms518 comparesig 1 1E+3 -> -1
-dqcms519 comparesig 1 1E+4 -> -1
-dqcms521 comparesig 1 1E+5 -> -1
-dqcms522 comparesig 1 1E+6 -> -1
-dqcms523 comparesig 1 1E+7 -> -1
-dqcms524 comparesig 1 1E+8 -> -1
-dqcms525 comparesig 1 1E+9 -> -1
-dqcms526 comparesig 1 1E+10 -> -1
-dqcms527 comparesig 1 1E+11 -> -1
-dqcms528 comparesig 1 1E+12 -> -1
-dqcms529 comparesig 1 1E+13 -> -1
-dqcms530 comparesig 1 1E+14 -> -1
-dqcms531 comparesig 1 1E+15 -> -1
--- LR swap
-dqcms540 comparesig 1E-15 1 -> -1
-dqcms541 comparesig 1E-14 1 -> -1
-dqcms542 comparesig 1E-13 1 -> -1
-dqcms543 comparesig 1E-12 1 -> -1
-dqcms544 comparesig 1E-11 1 -> -1
-dqcms545 comparesig 1E-10 1 -> -1
-dqcms546 comparesig 1E-9 1 -> -1
-dqcms547 comparesig 1E-8 1 -> -1
-dqcms548 comparesig 1E-7 1 -> -1
-dqcms549 comparesig 1E-6 1 -> -1
-dqcms550 comparesig 1E-5 1 -> -1
-dqcms551 comparesig 1E-4 1 -> -1
-dqcms552 comparesig 1E-3 1 -> -1
-dqcms553 comparesig 1E-2 1 -> -1
-dqcms554 comparesig 1E-1 1 -> -1
-dqcms555 comparesig 1E-0 1 -> 0
-dqcms556 comparesig 1E+1 1 -> 1
-dqcms557 comparesig 1E+2 1 -> 1
-dqcms558 comparesig 1E+3 1 -> 1
-dqcms559 comparesig 1E+4 1 -> 1
-dqcms561 comparesig 1E+5 1 -> 1
-dqcms562 comparesig 1E+6 1 -> 1
-dqcms563 comparesig 1E+7 1 -> 1
-dqcms564 comparesig 1E+8 1 -> 1
-dqcms565 comparesig 1E+9 1 -> 1
-dqcms566 comparesig 1E+10 1 -> 1
-dqcms567 comparesig 1E+11 1 -> 1
-dqcms568 comparesig 1E+12 1 -> 1
-dqcms569 comparesig 1E+13 1 -> 1
-dqcms570 comparesig 1E+14 1 -> 1
-dqcms571 comparesig 1E+15 1 -> 1
--- similar with a useful coefficient, one side only
-dqcms580 comparesig 0.000000987654321 1E-15 -> 1
-dqcms581 comparesig 0.000000987654321 1E-14 -> 1
-dqcms582 comparesig 0.000000987654321 1E-13 -> 1
-dqcms583 comparesig 0.000000987654321 1E-12 -> 1
-dqcms584 comparesig 0.000000987654321 1E-11 -> 1
-dqcms585 comparesig 0.000000987654321 1E-10 -> 1
-dqcms586 comparesig 0.000000987654321 1E-9 -> 1
-dqcms587 comparesig 0.000000987654321 1E-8 -> 1
-dqcms588 comparesig 0.000000987654321 1E-7 -> 1
-dqcms589 comparesig 0.000000987654321 1E-6 -> -1
-dqcms590 comparesig 0.000000987654321 1E-5 -> -1
-dqcms591 comparesig 0.000000987654321 1E-4 -> -1
-dqcms592 comparesig 0.000000987654321 1E-3 -> -1
-dqcms593 comparesig 0.000000987654321 1E-2 -> -1
-dqcms594 comparesig 0.000000987654321 1E-1 -> -1
-dqcms595 comparesig 0.000000987654321 1E-0 -> -1
-dqcms596 comparesig 0.000000987654321 1E+1 -> -1
-dqcms597 comparesig 0.000000987654321 1E+2 -> -1
-dqcms598 comparesig 0.000000987654321 1E+3 -> -1
-dqcms599 comparesig 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-dqcms600 comparesig 12 12.2345 -> -1
-dqcms601 comparesig 12.0 12.2345 -> -1
-dqcms602 comparesig 12.00 12.2345 -> -1
-dqcms603 comparesig 12.000 12.2345 -> -1
-dqcms604 comparesig 12.0000 12.2345 -> -1
-dqcms605 comparesig 12.00000 12.2345 -> -1
-dqcms606 comparesig 12.000000 12.2345 -> -1
-dqcms607 comparesig 12.0000000 12.2345 -> -1
-dqcms608 comparesig 12.00000000 12.2345 -> -1
-dqcms609 comparesig 12.000000000 12.2345 -> -1
-dqcms610 comparesig 12.1234 12 -> 1
-dqcms611 comparesig 12.1234 12.0 -> 1
-dqcms612 comparesig 12.1234 12.00 -> 1
-dqcms613 comparesig 12.1234 12.000 -> 1
-dqcms614 comparesig 12.1234 12.0000 -> 1
-dqcms615 comparesig 12.1234 12.00000 -> 1
-dqcms616 comparesig 12.1234 12.000000 -> 1
-dqcms617 comparesig 12.1234 12.0000000 -> 1
-dqcms618 comparesig 12.1234 12.00000000 -> 1
-dqcms619 comparesig 12.1234 12.000000000 -> 1
-dqcms620 comparesig -12 -12.2345 -> 1
-dqcms621 comparesig -12.0 -12.2345 -> 1
-dqcms622 comparesig -12.00 -12.2345 -> 1
-dqcms623 comparesig -12.000 -12.2345 -> 1
-dqcms624 comparesig -12.0000 -12.2345 -> 1
-dqcms625 comparesig -12.00000 -12.2345 -> 1
-dqcms626 comparesig -12.000000 -12.2345 -> 1
-dqcms627 comparesig -12.0000000 -12.2345 -> 1
-dqcms628 comparesig -12.00000000 -12.2345 -> 1
-dqcms629 comparesig -12.000000000 -12.2345 -> 1
-dqcms630 comparesig -12.1234 -12 -> -1
-dqcms631 comparesig -12.1234 -12.0 -> -1
-dqcms632 comparesig -12.1234 -12.00 -> -1
-dqcms633 comparesig -12.1234 -12.000 -> -1
-dqcms634 comparesig -12.1234 -12.0000 -> -1
-dqcms635 comparesig -12.1234 -12.00000 -> -1
-dqcms636 comparesig -12.1234 -12.000000 -> -1
-dqcms637 comparesig -12.1234 -12.0000000 -> -1
-dqcms638 comparesig -12.1234 -12.00000000 -> -1
-dqcms639 comparesig -12.1234 -12.000000000 -> -1
-
--- extended zeros
-dqcms640 comparesig 0 0 -> 0
-dqcms641 comparesig 0 -0 -> 0
-dqcms642 comparesig 0 -0.0 -> 0
-dqcms643 comparesig 0 0.0 -> 0
-dqcms644 comparesig -0 0 -> 0
-dqcms645 comparesig -0 -0 -> 0
-dqcms646 comparesig -0 -0.0 -> 0
-dqcms647 comparesig -0 0.0 -> 0
-dqcms648 comparesig 0.0 0 -> 0
-dqcms649 comparesig 0.0 -0 -> 0
-dqcms650 comparesig 0.0 -0.0 -> 0
-dqcms651 comparesig 0.0 0.0 -> 0
-dqcms652 comparesig -0.0 0 -> 0
-dqcms653 comparesig -0.0 -0 -> 0
-dqcms654 comparesig -0.0 -0.0 -> 0
-dqcms655 comparesig -0.0 0.0 -> 0
-
-dqcms656 comparesig -0E1 0.0 -> 0
-dqcms657 comparesig -0E2 0.0 -> 0
-dqcms658 comparesig 0E1 0.0 -> 0
-dqcms659 comparesig 0E2 0.0 -> 0
-dqcms660 comparesig -0E1 0 -> 0
-dqcms661 comparesig -0E2 0 -> 0
-dqcms662 comparesig 0E1 0 -> 0
-dqcms663 comparesig 0E2 0 -> 0
-dqcms664 comparesig -0E1 -0E1 -> 0
-dqcms665 comparesig -0E2 -0E1 -> 0
-dqcms666 comparesig 0E1 -0E1 -> 0
-dqcms667 comparesig 0E2 -0E1 -> 0
-dqcms668 comparesig -0E1 -0E2 -> 0
-dqcms669 comparesig -0E2 -0E2 -> 0
-dqcms670 comparesig 0E1 -0E2 -> 0
-dqcms671 comparesig 0E2 -0E2 -> 0
-dqcms672 comparesig -0E1 0E1 -> 0
-dqcms673 comparesig -0E2 0E1 -> 0
-dqcms674 comparesig 0E1 0E1 -> 0
-dqcms675 comparesig 0E2 0E1 -> 0
-dqcms676 comparesig -0E1 0E2 -> 0
-dqcms677 comparesig -0E2 0E2 -> 0
-dqcms678 comparesig 0E1 0E2 -> 0
-dqcms679 comparesig 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-dqcms680 comparesig 12 12 -> 0
-dqcms681 comparesig 12 12.0 -> 0
-dqcms682 comparesig 12 12.00 -> 0
-dqcms683 comparesig 12 12.000 -> 0
-dqcms684 comparesig 12 12.0000 -> 0
-dqcms685 comparesig 12 12.00000 -> 0
-dqcms686 comparesig 12 12.000000 -> 0
-dqcms687 comparesig 12 12.0000000 -> 0
-dqcms688 comparesig 12 12.00000000 -> 0
-dqcms689 comparesig 12 12.000000000 -> 0
-dqcms690 comparesig 12 12 -> 0
-dqcms691 comparesig 12.0 12 -> 0
-dqcms692 comparesig 12.00 12 -> 0
-dqcms693 comparesig 12.000 12 -> 0
-dqcms694 comparesig 12.0000 12 -> 0
-dqcms695 comparesig 12.00000 12 -> 0
-dqcms696 comparesig 12.000000 12 -> 0
-dqcms697 comparesig 12.0000000 12 -> 0
-dqcms698 comparesig 12.00000000 12 -> 0
-dqcms699 comparesig 12.000000000 12 -> 0
-
--- first, second, & last digit
-dqcms700 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1
-dqcms701 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
-dqcms702 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1
-dqcms703 comparesig 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1
-dqcms704 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
-dqcms705 comparesig 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1
-dqcms706 comparesig 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1
-dqcms707 comparesig 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0
-dqcms708 comparesig 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1
-
--- miscellaneous
-dqcms721 comparesig 12345678000 1 -> 1
-dqcms722 comparesig 1 12345678000 -> -1
-dqcms723 comparesig 1234567800 1 -> 1
-dqcms724 comparesig 1 1234567800 -> -1
-dqcms725 comparesig 1234567890 1 -> 1
-dqcms726 comparesig 1 1234567890 -> -1
-dqcms727 comparesig 1234567891 1 -> 1
-dqcms728 comparesig 1 1234567891 -> -1
-dqcms729 comparesig 12345678901 1 -> 1
-dqcms730 comparesig 1 12345678901 -> -1
-dqcms731 comparesig 1234567896 1 -> 1
-dqcms732 comparesig 1 1234567896 -> -1
-
--- residue cases at lower precision
-dqcms740 comparesig 1 0.9999999 -> 1
-dqcms741 comparesig 1 0.999999 -> 1
-dqcms742 comparesig 1 0.99999 -> 1
-dqcms743 comparesig 1 1.0000 -> 0
-dqcms744 comparesig 1 1.00001 -> -1
-dqcms745 comparesig 1 1.000001 -> -1
-dqcms746 comparesig 1 1.0000001 -> -1
-dqcms750 comparesig 0.9999999 1 -> -1
-dqcms751 comparesig 0.999999 1 -> -1
-dqcms752 comparesig 0.99999 1 -> -1
-dqcms753 comparesig 1.0000 1 -> 0
-dqcms754 comparesig 1.00001 1 -> 1
-dqcms755 comparesig 1.000001 1 -> 1
-dqcms756 comparesig 1.0000001 1 -> 1
-
--- Specials
-dqcms780 comparesig Inf -Inf -> 1
-dqcms781 comparesig Inf -1000 -> 1
-dqcms782 comparesig Inf -1 -> 1
-dqcms783 comparesig Inf -0 -> 1
-dqcms784 comparesig Inf 0 -> 1
-dqcms785 comparesig Inf 1 -> 1
-dqcms786 comparesig Inf 1000 -> 1
-dqcms787 comparesig Inf Inf -> 0
-dqcms788 comparesig -1000 Inf -> -1
-dqcms789 comparesig -Inf Inf -> -1
-dqcms790 comparesig -1 Inf -> -1
-dqcms791 comparesig -0 Inf -> -1
-dqcms792 comparesig 0 Inf -> -1
-dqcms793 comparesig 1 Inf -> -1
-dqcms794 comparesig 1000 Inf -> -1
-dqcms795 comparesig Inf Inf -> 0
-
-dqcms800 comparesig -Inf -Inf -> 0
-dqcms801 comparesig -Inf -1000 -> -1
-dqcms802 comparesig -Inf -1 -> -1
-dqcms803 comparesig -Inf -0 -> -1
-dqcms804 comparesig -Inf 0 -> -1
-dqcms805 comparesig -Inf 1 -> -1
-dqcms806 comparesig -Inf 1000 -> -1
-dqcms807 comparesig -Inf Inf -> -1
-dqcms808 comparesig -Inf -Inf -> 0
-dqcms809 comparesig -1000 -Inf -> 1
-dqcms810 comparesig -1 -Inf -> 1
-dqcms811 comparesig -0 -Inf -> 1
-dqcms812 comparesig 0 -Inf -> 1
-dqcms813 comparesig 1 -Inf -> 1
-dqcms814 comparesig 1000 -Inf -> 1
-dqcms815 comparesig Inf -Inf -> 1
-
-dqcms821 comparesig NaN -Inf -> NaN Invalid_operation
-dqcms822 comparesig NaN -1000 -> NaN Invalid_operation
-dqcms823 comparesig NaN -1 -> NaN Invalid_operation
-dqcms824 comparesig NaN -0 -> NaN Invalid_operation
-dqcms825 comparesig NaN 0 -> NaN Invalid_operation
-dqcms826 comparesig NaN 1 -> NaN Invalid_operation
-dqcms827 comparesig NaN 1000 -> NaN Invalid_operation
-dqcms828 comparesig NaN Inf -> NaN Invalid_operation
-dqcms829 comparesig NaN NaN -> NaN Invalid_operation
-dqcms830 comparesig -Inf NaN -> NaN Invalid_operation
-dqcms831 comparesig -1000 NaN -> NaN Invalid_operation
-dqcms832 comparesig -1 NaN -> NaN Invalid_operation
-dqcms833 comparesig -0 NaN -> NaN Invalid_operation
-dqcms834 comparesig 0 NaN -> NaN Invalid_operation
-dqcms835 comparesig 1 NaN -> NaN Invalid_operation
-dqcms836 comparesig 1000 NaN -> NaN Invalid_operation
-dqcms837 comparesig Inf NaN -> NaN Invalid_operation
-dqcms838 comparesig -NaN -NaN -> -NaN Invalid_operation
-dqcms839 comparesig +NaN -NaN -> NaN Invalid_operation
-dqcms840 comparesig -NaN +NaN -> -NaN Invalid_operation
-
-dqcms841 comparesig sNaN -Inf -> NaN Invalid_operation
-dqcms842 comparesig sNaN -1000 -> NaN Invalid_operation
-dqcms843 comparesig sNaN -1 -> NaN Invalid_operation
-dqcms844 comparesig sNaN -0 -> NaN Invalid_operation
-dqcms845 comparesig sNaN 0 -> NaN Invalid_operation
-dqcms846 comparesig sNaN 1 -> NaN Invalid_operation
-dqcms847 comparesig sNaN 1000 -> NaN Invalid_operation
-dqcms848 comparesig sNaN NaN -> NaN Invalid_operation
-dqcms849 comparesig sNaN sNaN -> NaN Invalid_operation
-dqcms850 comparesig NaN sNaN -> NaN Invalid_operation
-dqcms851 comparesig -Inf sNaN -> NaN Invalid_operation
-dqcms852 comparesig -1000 sNaN -> NaN Invalid_operation
-dqcms853 comparesig -1 sNaN -> NaN Invalid_operation
-dqcms854 comparesig -0 sNaN -> NaN Invalid_operation
-dqcms855 comparesig 0 sNaN -> NaN Invalid_operation
-dqcms856 comparesig 1 sNaN -> NaN Invalid_operation
-dqcms857 comparesig 1000 sNaN -> NaN Invalid_operation
-dqcms858 comparesig Inf sNaN -> NaN Invalid_operation
-dqcms859 comparesig NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation
-dqcms861 comparesig NaN8 999 -> NaN8 Invalid_operation
-dqcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation
-dqcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation
-dqcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation
-dqcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation
-dqcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation
-dqcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation
-dqcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation
-dqcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation
-dqcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation
-
-dqcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation
-dqcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation
-dqcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation
-dqcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation
-dqcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation
-dqcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation
-dqcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation
-dqcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- wide range
-dqcms880 comparesig +1.23456789012345E-0 9E+6144 -> -1
-dqcms881 comparesig 9E+6144 +1.23456789012345E-0 -> 1
-dqcms882 comparesig +0.100 9E-6143 -> 1
-dqcms883 comparesig 9E-6143 +0.100 -> -1
-dqcms885 comparesig -1.23456789012345E-0 9E+6144 -> -1
-dqcms886 comparesig 9E+6144 -1.23456789012345E-0 -> 1
-dqcms887 comparesig -0.100 9E-6143 -> -1
-dqcms888 comparesig 9E-6143 -0.100 -> 1
-
--- signs
-dqcms901 comparesig 1e+77 1e+11 -> 1
-dqcms902 comparesig 1e+77 -1e+11 -> 1
-dqcms903 comparesig -1e+77 1e+11 -> -1
-dqcms904 comparesig -1e+77 -1e+11 -> -1
-dqcms905 comparesig 1e-77 1e-11 -> -1
-dqcms906 comparesig 1e-77 -1e-11 -> 1
-dqcms907 comparesig -1e-77 1e-11 -> -1
-dqcms908 comparesig -1e-77 -1e-11 -> 1
-
--- Null tests
-dqcms990 comparesig 10 # -> NaN Invalid_operation
-dqcms991 comparesig # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqCompareSig.decTest -- decQuad comparison; all NaNs signal --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqcms001 comparesig -2 -2 -> 0
+dqcms002 comparesig -2 -1 -> -1
+dqcms003 comparesig -2 0 -> -1
+dqcms004 comparesig -2 1 -> -1
+dqcms005 comparesig -2 2 -> -1
+dqcms006 comparesig -1 -2 -> 1
+dqcms007 comparesig -1 -1 -> 0
+dqcms008 comparesig -1 0 -> -1
+dqcms009 comparesig -1 1 -> -1
+dqcms010 comparesig -1 2 -> -1
+dqcms011 comparesig 0 -2 -> 1
+dqcms012 comparesig 0 -1 -> 1
+dqcms013 comparesig 0 0 -> 0
+dqcms014 comparesig 0 1 -> -1
+dqcms015 comparesig 0 2 -> -1
+dqcms016 comparesig 1 -2 -> 1
+dqcms017 comparesig 1 -1 -> 1
+dqcms018 comparesig 1 0 -> 1
+dqcms019 comparesig 1 1 -> 0
+dqcms020 comparesig 1 2 -> -1
+dqcms021 comparesig 2 -2 -> 1
+dqcms022 comparesig 2 -1 -> 1
+dqcms023 comparesig 2 0 -> 1
+dqcms025 comparesig 2 1 -> 1
+dqcms026 comparesig 2 2 -> 0
+
+dqcms031 comparesig -20 -20 -> 0
+dqcms032 comparesig -20 -10 -> -1
+dqcms033 comparesig -20 00 -> -1
+dqcms034 comparesig -20 10 -> -1
+dqcms035 comparesig -20 20 -> -1
+dqcms036 comparesig -10 -20 -> 1
+dqcms037 comparesig -10 -10 -> 0
+dqcms038 comparesig -10 00 -> -1
+dqcms039 comparesig -10 10 -> -1
+dqcms040 comparesig -10 20 -> -1
+dqcms041 comparesig 00 -20 -> 1
+dqcms042 comparesig 00 -10 -> 1
+dqcms043 comparesig 00 00 -> 0
+dqcms044 comparesig 00 10 -> -1
+dqcms045 comparesig 00 20 -> -1
+dqcms046 comparesig 10 -20 -> 1
+dqcms047 comparesig 10 -10 -> 1
+dqcms048 comparesig 10 00 -> 1
+dqcms049 comparesig 10 10 -> 0
+dqcms050 comparesig 10 20 -> -1
+dqcms051 comparesig 20 -20 -> 1
+dqcms052 comparesig 20 -10 -> 1
+dqcms053 comparesig 20 00 -> 1
+dqcms055 comparesig 20 10 -> 1
+dqcms056 comparesig 20 20 -> 0
+
+dqcms061 comparesig -2.0 -2.0 -> 0
+dqcms062 comparesig -2.0 -1.0 -> -1
+dqcms063 comparesig -2.0 0.0 -> -1
+dqcms064 comparesig -2.0 1.0 -> -1
+dqcms065 comparesig -2.0 2.0 -> -1
+dqcms066 comparesig -1.0 -2.0 -> 1
+dqcms067 comparesig -1.0 -1.0 -> 0
+dqcms068 comparesig -1.0 0.0 -> -1
+dqcms069 comparesig -1.0 1.0 -> -1
+dqcms070 comparesig -1.0 2.0 -> -1
+dqcms071 comparesig 0.0 -2.0 -> 1
+dqcms072 comparesig 0.0 -1.0 -> 1
+dqcms073 comparesig 0.0 0.0 -> 0
+dqcms074 comparesig 0.0 1.0 -> -1
+dqcms075 comparesig 0.0 2.0 -> -1
+dqcms076 comparesig 1.0 -2.0 -> 1
+dqcms077 comparesig 1.0 -1.0 -> 1
+dqcms078 comparesig 1.0 0.0 -> 1
+dqcms079 comparesig 1.0 1.0 -> 0
+dqcms080 comparesig 1.0 2.0 -> -1
+dqcms081 comparesig 2.0 -2.0 -> 1
+dqcms082 comparesig 2.0 -1.0 -> 1
+dqcms083 comparesig 2.0 0.0 -> 1
+dqcms085 comparesig 2.0 1.0 -> 1
+dqcms086 comparesig 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+dqcms090 comparesig 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0
+dqcms091 comparesig -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1
+dqcms092 comparesig 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1
+dqcms093 comparesig -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0
+
+-- some differing length/exponent cases
+dqcms100 comparesig 7.0 7.0 -> 0
+dqcms101 comparesig 7.0 7 -> 0
+dqcms102 comparesig 7 7.0 -> 0
+dqcms103 comparesig 7E+0 7.0 -> 0
+dqcms104 comparesig 70E-1 7.0 -> 0
+dqcms105 comparesig 0.7E+1 7 -> 0
+dqcms106 comparesig 70E-1 7 -> 0
+dqcms107 comparesig 7.0 7E+0 -> 0
+dqcms108 comparesig 7.0 70E-1 -> 0
+dqcms109 comparesig 7 0.7E+1 -> 0
+dqcms110 comparesig 7 70E-1 -> 0
+
+dqcms120 comparesig 8.0 7.0 -> 1
+dqcms121 comparesig 8.0 7 -> 1
+dqcms122 comparesig 8 7.0 -> 1
+dqcms123 comparesig 8E+0 7.0 -> 1
+dqcms124 comparesig 80E-1 7.0 -> 1
+dqcms125 comparesig 0.8E+1 7 -> 1
+dqcms126 comparesig 80E-1 7 -> 1
+dqcms127 comparesig 8.0 7E+0 -> 1
+dqcms128 comparesig 8.0 70E-1 -> 1
+dqcms129 comparesig 8 0.7E+1 -> 1
+dqcms130 comparesig 8 70E-1 -> 1
+
+dqcms140 comparesig 8.0 9.0 -> -1
+dqcms141 comparesig 8.0 9 -> -1
+dqcms142 comparesig 8 9.0 -> -1
+dqcms143 comparesig 8E+0 9.0 -> -1
+dqcms144 comparesig 80E-1 9.0 -> -1
+dqcms145 comparesig 0.8E+1 9 -> -1
+dqcms146 comparesig 80E-1 9 -> -1
+dqcms147 comparesig 8.0 9E+0 -> -1
+dqcms148 comparesig 8.0 90E-1 -> -1
+dqcms149 comparesig 8 0.9E+1 -> -1
+dqcms150 comparesig 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+dqcms200 comparesig -7.0 7.0 -> -1
+dqcms201 comparesig -7.0 7 -> -1
+dqcms202 comparesig -7 7.0 -> -1
+dqcms203 comparesig -7E+0 7.0 -> -1
+dqcms204 comparesig -70E-1 7.0 -> -1
+dqcms205 comparesig -0.7E+1 7 -> -1
+dqcms206 comparesig -70E-1 7 -> -1
+dqcms207 comparesig -7.0 7E+0 -> -1
+dqcms208 comparesig -7.0 70E-1 -> -1
+dqcms209 comparesig -7 0.7E+1 -> -1
+dqcms210 comparesig -7 70E-1 -> -1
+
+dqcms220 comparesig -8.0 7.0 -> -1
+dqcms221 comparesig -8.0 7 -> -1
+dqcms222 comparesig -8 7.0 -> -1
+dqcms223 comparesig -8E+0 7.0 -> -1
+dqcms224 comparesig -80E-1 7.0 -> -1
+dqcms225 comparesig -0.8E+1 7 -> -1
+dqcms226 comparesig -80E-1 7 -> -1
+dqcms227 comparesig -8.0 7E+0 -> -1
+dqcms228 comparesig -8.0 70E-1 -> -1
+dqcms229 comparesig -8 0.7E+1 -> -1
+dqcms230 comparesig -8 70E-1 -> -1
+
+dqcms240 comparesig -8.0 9.0 -> -1
+dqcms241 comparesig -8.0 9 -> -1
+dqcms242 comparesig -8 9.0 -> -1
+dqcms243 comparesig -8E+0 9.0 -> -1
+dqcms244 comparesig -80E-1 9.0 -> -1
+dqcms245 comparesig -0.8E+1 9 -> -1
+dqcms246 comparesig -80E-1 9 -> -1
+dqcms247 comparesig -8.0 9E+0 -> -1
+dqcms248 comparesig -8.0 90E-1 -> -1
+dqcms249 comparesig -8 0.9E+1 -> -1
+dqcms250 comparesig -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+dqcms300 comparesig 7.0 -7.0 -> 1
+dqcms301 comparesig 7.0 -7 -> 1
+dqcms302 comparesig 7 -7.0 -> 1
+dqcms303 comparesig 7E+0 -7.0 -> 1
+dqcms304 comparesig 70E-1 -7.0 -> 1
+dqcms305 comparesig .7E+1 -7 -> 1
+dqcms306 comparesig 70E-1 -7 -> 1
+dqcms307 comparesig 7.0 -7E+0 -> 1
+dqcms308 comparesig 7.0 -70E-1 -> 1
+dqcms309 comparesig 7 -.7E+1 -> 1
+dqcms310 comparesig 7 -70E-1 -> 1
+
+dqcms320 comparesig 8.0 -7.0 -> 1
+dqcms321 comparesig 8.0 -7 -> 1
+dqcms322 comparesig 8 -7.0 -> 1
+dqcms323 comparesig 8E+0 -7.0 -> 1
+dqcms324 comparesig 80E-1 -7.0 -> 1
+dqcms325 comparesig .8E+1 -7 -> 1
+dqcms326 comparesig 80E-1 -7 -> 1
+dqcms327 comparesig 8.0 -7E+0 -> 1
+dqcms328 comparesig 8.0 -70E-1 -> 1
+dqcms329 comparesig 8 -.7E+1 -> 1
+dqcms330 comparesig 8 -70E-1 -> 1
+
+dqcms340 comparesig 8.0 -9.0 -> 1
+dqcms341 comparesig 8.0 -9 -> 1
+dqcms342 comparesig 8 -9.0 -> 1
+dqcms343 comparesig 8E+0 -9.0 -> 1
+dqcms344 comparesig 80E-1 -9.0 -> 1
+dqcms345 comparesig .8E+1 -9 -> 1
+dqcms346 comparesig 80E-1 -9 -> 1
+dqcms347 comparesig 8.0 -9E+0 -> 1
+dqcms348 comparesig 8.0 -90E-1 -> 1
+dqcms349 comparesig 8 -.9E+1 -> 1
+dqcms350 comparesig 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+dqcms400 comparesig -7.0 -7.0 -> 0
+dqcms401 comparesig -7.0 -7 -> 0
+dqcms402 comparesig -7 -7.0 -> 0
+dqcms403 comparesig -7E+0 -7.0 -> 0
+dqcms404 comparesig -70E-1 -7.0 -> 0
+dqcms405 comparesig -.7E+1 -7 -> 0
+dqcms406 comparesig -70E-1 -7 -> 0
+dqcms407 comparesig -7.0 -7E+0 -> 0
+dqcms408 comparesig -7.0 -70E-1 -> 0
+dqcms409 comparesig -7 -.7E+1 -> 0
+dqcms410 comparesig -7 -70E-1 -> 0
+
+dqcms420 comparesig -8.0 -7.0 -> -1
+dqcms421 comparesig -8.0 -7 -> -1
+dqcms422 comparesig -8 -7.0 -> -1
+dqcms423 comparesig -8E+0 -7.0 -> -1
+dqcms424 comparesig -80E-1 -7.0 -> -1
+dqcms425 comparesig -.8E+1 -7 -> -1
+dqcms426 comparesig -80E-1 -7 -> -1
+dqcms427 comparesig -8.0 -7E+0 -> -1
+dqcms428 comparesig -8.0 -70E-1 -> -1
+dqcms429 comparesig -8 -.7E+1 -> -1
+dqcms430 comparesig -8 -70E-1 -> -1
+
+dqcms440 comparesig -8.0 -9.0 -> 1
+dqcms441 comparesig -8.0 -9 -> 1
+dqcms442 comparesig -8 -9.0 -> 1
+dqcms443 comparesig -8E+0 -9.0 -> 1
+dqcms444 comparesig -80E-1 -9.0 -> 1
+dqcms445 comparesig -.8E+1 -9 -> 1
+dqcms446 comparesig -80E-1 -9 -> 1
+dqcms447 comparesig -8.0 -9E+0 -> 1
+dqcms448 comparesig -8.0 -90E-1 -> 1
+dqcms449 comparesig -8 -.9E+1 -> 1
+dqcms450 comparesig -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+dqcms473 comparesig 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0
+dqcms474 comparesig 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0
+dqcms475 comparesig 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0
+dqcms476 comparesig 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0
+dqcms477 comparesig 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0
+dqcms478 comparesig 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0
+dqcms479 comparesig 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0
+dqcms480 comparesig 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0
+dqcms481 comparesig 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0
+dqcms482 comparesig 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0
+dqcms483 comparesig 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0
+dqcms487 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0
+dqcms488 comparesig 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0
+dqcms489 comparesig 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0
+dqcms490 comparesig 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0
+dqcms491 comparesig 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0
+dqcms492 comparesig 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0
+dqcms493 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0
+dqcms494 comparesig 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0
+dqcms495 comparesig 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0
+dqcms496 comparesig 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0
+dqcms497 comparesig 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+dqcms500 comparesig 1 1E-15 -> 1
+dqcms501 comparesig 1 1E-14 -> 1
+dqcms502 comparesig 1 1E-13 -> 1
+dqcms503 comparesig 1 1E-12 -> 1
+dqcms504 comparesig 1 1E-11 -> 1
+dqcms505 comparesig 1 1E-10 -> 1
+dqcms506 comparesig 1 1E-9 -> 1
+dqcms507 comparesig 1 1E-8 -> 1
+dqcms508 comparesig 1 1E-7 -> 1
+dqcms509 comparesig 1 1E-6 -> 1
+dqcms510 comparesig 1 1E-5 -> 1
+dqcms511 comparesig 1 1E-4 -> 1
+dqcms512 comparesig 1 1E-3 -> 1
+dqcms513 comparesig 1 1E-2 -> 1
+dqcms514 comparesig 1 1E-1 -> 1
+dqcms515 comparesig 1 1E-0 -> 0
+dqcms516 comparesig 1 1E+1 -> -1
+dqcms517 comparesig 1 1E+2 -> -1
+dqcms518 comparesig 1 1E+3 -> -1
+dqcms519 comparesig 1 1E+4 -> -1
+dqcms521 comparesig 1 1E+5 -> -1
+dqcms522 comparesig 1 1E+6 -> -1
+dqcms523 comparesig 1 1E+7 -> -1
+dqcms524 comparesig 1 1E+8 -> -1
+dqcms525 comparesig 1 1E+9 -> -1
+dqcms526 comparesig 1 1E+10 -> -1
+dqcms527 comparesig 1 1E+11 -> -1
+dqcms528 comparesig 1 1E+12 -> -1
+dqcms529 comparesig 1 1E+13 -> -1
+dqcms530 comparesig 1 1E+14 -> -1
+dqcms531 comparesig 1 1E+15 -> -1
+-- LR swap
+dqcms540 comparesig 1E-15 1 -> -1
+dqcms541 comparesig 1E-14 1 -> -1
+dqcms542 comparesig 1E-13 1 -> -1
+dqcms543 comparesig 1E-12 1 -> -1
+dqcms544 comparesig 1E-11 1 -> -1
+dqcms545 comparesig 1E-10 1 -> -1
+dqcms546 comparesig 1E-9 1 -> -1
+dqcms547 comparesig 1E-8 1 -> -1
+dqcms548 comparesig 1E-7 1 -> -1
+dqcms549 comparesig 1E-6 1 -> -1
+dqcms550 comparesig 1E-5 1 -> -1
+dqcms551 comparesig 1E-4 1 -> -1
+dqcms552 comparesig 1E-3 1 -> -1
+dqcms553 comparesig 1E-2 1 -> -1
+dqcms554 comparesig 1E-1 1 -> -1
+dqcms555 comparesig 1E-0 1 -> 0
+dqcms556 comparesig 1E+1 1 -> 1
+dqcms557 comparesig 1E+2 1 -> 1
+dqcms558 comparesig 1E+3 1 -> 1
+dqcms559 comparesig 1E+4 1 -> 1
+dqcms561 comparesig 1E+5 1 -> 1
+dqcms562 comparesig 1E+6 1 -> 1
+dqcms563 comparesig 1E+7 1 -> 1
+dqcms564 comparesig 1E+8 1 -> 1
+dqcms565 comparesig 1E+9 1 -> 1
+dqcms566 comparesig 1E+10 1 -> 1
+dqcms567 comparesig 1E+11 1 -> 1
+dqcms568 comparesig 1E+12 1 -> 1
+dqcms569 comparesig 1E+13 1 -> 1
+dqcms570 comparesig 1E+14 1 -> 1
+dqcms571 comparesig 1E+15 1 -> 1
+-- similar with a useful coefficient, one side only
+dqcms580 comparesig 0.000000987654321 1E-15 -> 1
+dqcms581 comparesig 0.000000987654321 1E-14 -> 1
+dqcms582 comparesig 0.000000987654321 1E-13 -> 1
+dqcms583 comparesig 0.000000987654321 1E-12 -> 1
+dqcms584 comparesig 0.000000987654321 1E-11 -> 1
+dqcms585 comparesig 0.000000987654321 1E-10 -> 1
+dqcms586 comparesig 0.000000987654321 1E-9 -> 1
+dqcms587 comparesig 0.000000987654321 1E-8 -> 1
+dqcms588 comparesig 0.000000987654321 1E-7 -> 1
+dqcms589 comparesig 0.000000987654321 1E-6 -> -1
+dqcms590 comparesig 0.000000987654321 1E-5 -> -1
+dqcms591 comparesig 0.000000987654321 1E-4 -> -1
+dqcms592 comparesig 0.000000987654321 1E-3 -> -1
+dqcms593 comparesig 0.000000987654321 1E-2 -> -1
+dqcms594 comparesig 0.000000987654321 1E-1 -> -1
+dqcms595 comparesig 0.000000987654321 1E-0 -> -1
+dqcms596 comparesig 0.000000987654321 1E+1 -> -1
+dqcms597 comparesig 0.000000987654321 1E+2 -> -1
+dqcms598 comparesig 0.000000987654321 1E+3 -> -1
+dqcms599 comparesig 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+dqcms600 comparesig 12 12.2345 -> -1
+dqcms601 comparesig 12.0 12.2345 -> -1
+dqcms602 comparesig 12.00 12.2345 -> -1
+dqcms603 comparesig 12.000 12.2345 -> -1
+dqcms604 comparesig 12.0000 12.2345 -> -1
+dqcms605 comparesig 12.00000 12.2345 -> -1
+dqcms606 comparesig 12.000000 12.2345 -> -1
+dqcms607 comparesig 12.0000000 12.2345 -> -1
+dqcms608 comparesig 12.00000000 12.2345 -> -1
+dqcms609 comparesig 12.000000000 12.2345 -> -1
+dqcms610 comparesig 12.1234 12 -> 1
+dqcms611 comparesig 12.1234 12.0 -> 1
+dqcms612 comparesig 12.1234 12.00 -> 1
+dqcms613 comparesig 12.1234 12.000 -> 1
+dqcms614 comparesig 12.1234 12.0000 -> 1
+dqcms615 comparesig 12.1234 12.00000 -> 1
+dqcms616 comparesig 12.1234 12.000000 -> 1
+dqcms617 comparesig 12.1234 12.0000000 -> 1
+dqcms618 comparesig 12.1234 12.00000000 -> 1
+dqcms619 comparesig 12.1234 12.000000000 -> 1
+dqcms620 comparesig -12 -12.2345 -> 1
+dqcms621 comparesig -12.0 -12.2345 -> 1
+dqcms622 comparesig -12.00 -12.2345 -> 1
+dqcms623 comparesig -12.000 -12.2345 -> 1
+dqcms624 comparesig -12.0000 -12.2345 -> 1
+dqcms625 comparesig -12.00000 -12.2345 -> 1
+dqcms626 comparesig -12.000000 -12.2345 -> 1
+dqcms627 comparesig -12.0000000 -12.2345 -> 1
+dqcms628 comparesig -12.00000000 -12.2345 -> 1
+dqcms629 comparesig -12.000000000 -12.2345 -> 1
+dqcms630 comparesig -12.1234 -12 -> -1
+dqcms631 comparesig -12.1234 -12.0 -> -1
+dqcms632 comparesig -12.1234 -12.00 -> -1
+dqcms633 comparesig -12.1234 -12.000 -> -1
+dqcms634 comparesig -12.1234 -12.0000 -> -1
+dqcms635 comparesig -12.1234 -12.00000 -> -1
+dqcms636 comparesig -12.1234 -12.000000 -> -1
+dqcms637 comparesig -12.1234 -12.0000000 -> -1
+dqcms638 comparesig -12.1234 -12.00000000 -> -1
+dqcms639 comparesig -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+dqcms640 comparesig 0 0 -> 0
+dqcms641 comparesig 0 -0 -> 0
+dqcms642 comparesig 0 -0.0 -> 0
+dqcms643 comparesig 0 0.0 -> 0
+dqcms644 comparesig -0 0 -> 0
+dqcms645 comparesig -0 -0 -> 0
+dqcms646 comparesig -0 -0.0 -> 0
+dqcms647 comparesig -0 0.0 -> 0
+dqcms648 comparesig 0.0 0 -> 0
+dqcms649 comparesig 0.0 -0 -> 0
+dqcms650 comparesig 0.0 -0.0 -> 0
+dqcms651 comparesig 0.0 0.0 -> 0
+dqcms652 comparesig -0.0 0 -> 0
+dqcms653 comparesig -0.0 -0 -> 0
+dqcms654 comparesig -0.0 -0.0 -> 0
+dqcms655 comparesig -0.0 0.0 -> 0
+
+dqcms656 comparesig -0E1 0.0 -> 0
+dqcms657 comparesig -0E2 0.0 -> 0
+dqcms658 comparesig 0E1 0.0 -> 0
+dqcms659 comparesig 0E2 0.0 -> 0
+dqcms660 comparesig -0E1 0 -> 0
+dqcms661 comparesig -0E2 0 -> 0
+dqcms662 comparesig 0E1 0 -> 0
+dqcms663 comparesig 0E2 0 -> 0
+dqcms664 comparesig -0E1 -0E1 -> 0
+dqcms665 comparesig -0E2 -0E1 -> 0
+dqcms666 comparesig 0E1 -0E1 -> 0
+dqcms667 comparesig 0E2 -0E1 -> 0
+dqcms668 comparesig -0E1 -0E2 -> 0
+dqcms669 comparesig -0E2 -0E2 -> 0
+dqcms670 comparesig 0E1 -0E2 -> 0
+dqcms671 comparesig 0E2 -0E2 -> 0
+dqcms672 comparesig -0E1 0E1 -> 0
+dqcms673 comparesig -0E2 0E1 -> 0
+dqcms674 comparesig 0E1 0E1 -> 0
+dqcms675 comparesig 0E2 0E1 -> 0
+dqcms676 comparesig -0E1 0E2 -> 0
+dqcms677 comparesig -0E2 0E2 -> 0
+dqcms678 comparesig 0E1 0E2 -> 0
+dqcms679 comparesig 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+dqcms680 comparesig 12 12 -> 0
+dqcms681 comparesig 12 12.0 -> 0
+dqcms682 comparesig 12 12.00 -> 0
+dqcms683 comparesig 12 12.000 -> 0
+dqcms684 comparesig 12 12.0000 -> 0
+dqcms685 comparesig 12 12.00000 -> 0
+dqcms686 comparesig 12 12.000000 -> 0
+dqcms687 comparesig 12 12.0000000 -> 0
+dqcms688 comparesig 12 12.00000000 -> 0
+dqcms689 comparesig 12 12.000000000 -> 0
+dqcms690 comparesig 12 12 -> 0
+dqcms691 comparesig 12.0 12 -> 0
+dqcms692 comparesig 12.00 12 -> 0
+dqcms693 comparesig 12.000 12 -> 0
+dqcms694 comparesig 12.0000 12 -> 0
+dqcms695 comparesig 12.00000 12 -> 0
+dqcms696 comparesig 12.000000 12 -> 0
+dqcms697 comparesig 12.0000000 12 -> 0
+dqcms698 comparesig 12.00000000 12 -> 0
+dqcms699 comparesig 12.000000000 12 -> 0
+
+-- first, second, & last digit
+dqcms700 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1
+dqcms701 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
+dqcms702 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1
+dqcms703 comparesig 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1
+dqcms704 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
+dqcms705 comparesig 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1
+dqcms706 comparesig 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1
+dqcms707 comparesig 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0
+dqcms708 comparesig 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1
+
+-- miscellaneous
+dqcms721 comparesig 12345678000 1 -> 1
+dqcms722 comparesig 1 12345678000 -> -1
+dqcms723 comparesig 1234567800 1 -> 1
+dqcms724 comparesig 1 1234567800 -> -1
+dqcms725 comparesig 1234567890 1 -> 1
+dqcms726 comparesig 1 1234567890 -> -1
+dqcms727 comparesig 1234567891 1 -> 1
+dqcms728 comparesig 1 1234567891 -> -1
+dqcms729 comparesig 12345678901 1 -> 1
+dqcms730 comparesig 1 12345678901 -> -1
+dqcms731 comparesig 1234567896 1 -> 1
+dqcms732 comparesig 1 1234567896 -> -1
+
+-- residue cases at lower precision
+dqcms740 comparesig 1 0.9999999 -> 1
+dqcms741 comparesig 1 0.999999 -> 1
+dqcms742 comparesig 1 0.99999 -> 1
+dqcms743 comparesig 1 1.0000 -> 0
+dqcms744 comparesig 1 1.00001 -> -1
+dqcms745 comparesig 1 1.000001 -> -1
+dqcms746 comparesig 1 1.0000001 -> -1
+dqcms750 comparesig 0.9999999 1 -> -1
+dqcms751 comparesig 0.999999 1 -> -1
+dqcms752 comparesig 0.99999 1 -> -1
+dqcms753 comparesig 1.0000 1 -> 0
+dqcms754 comparesig 1.00001 1 -> 1
+dqcms755 comparesig 1.000001 1 -> 1
+dqcms756 comparesig 1.0000001 1 -> 1
+
+-- Specials
+dqcms780 comparesig Inf -Inf -> 1
+dqcms781 comparesig Inf -1000 -> 1
+dqcms782 comparesig Inf -1 -> 1
+dqcms783 comparesig Inf -0 -> 1
+dqcms784 comparesig Inf 0 -> 1
+dqcms785 comparesig Inf 1 -> 1
+dqcms786 comparesig Inf 1000 -> 1
+dqcms787 comparesig Inf Inf -> 0
+dqcms788 comparesig -1000 Inf -> -1
+dqcms789 comparesig -Inf Inf -> -1
+dqcms790 comparesig -1 Inf -> -1
+dqcms791 comparesig -0 Inf -> -1
+dqcms792 comparesig 0 Inf -> -1
+dqcms793 comparesig 1 Inf -> -1
+dqcms794 comparesig 1000 Inf -> -1
+dqcms795 comparesig Inf Inf -> 0
+
+dqcms800 comparesig -Inf -Inf -> 0
+dqcms801 comparesig -Inf -1000 -> -1
+dqcms802 comparesig -Inf -1 -> -1
+dqcms803 comparesig -Inf -0 -> -1
+dqcms804 comparesig -Inf 0 -> -1
+dqcms805 comparesig -Inf 1 -> -1
+dqcms806 comparesig -Inf 1000 -> -1
+dqcms807 comparesig -Inf Inf -> -1
+dqcms808 comparesig -Inf -Inf -> 0
+dqcms809 comparesig -1000 -Inf -> 1
+dqcms810 comparesig -1 -Inf -> 1
+dqcms811 comparesig -0 -Inf -> 1
+dqcms812 comparesig 0 -Inf -> 1
+dqcms813 comparesig 1 -Inf -> 1
+dqcms814 comparesig 1000 -Inf -> 1
+dqcms815 comparesig Inf -Inf -> 1
+
+dqcms821 comparesig NaN -Inf -> NaN Invalid_operation
+dqcms822 comparesig NaN -1000 -> NaN Invalid_operation
+dqcms823 comparesig NaN -1 -> NaN Invalid_operation
+dqcms824 comparesig NaN -0 -> NaN Invalid_operation
+dqcms825 comparesig NaN 0 -> NaN Invalid_operation
+dqcms826 comparesig NaN 1 -> NaN Invalid_operation
+dqcms827 comparesig NaN 1000 -> NaN Invalid_operation
+dqcms828 comparesig NaN Inf -> NaN Invalid_operation
+dqcms829 comparesig NaN NaN -> NaN Invalid_operation
+dqcms830 comparesig -Inf NaN -> NaN Invalid_operation
+dqcms831 comparesig -1000 NaN -> NaN Invalid_operation
+dqcms832 comparesig -1 NaN -> NaN Invalid_operation
+dqcms833 comparesig -0 NaN -> NaN Invalid_operation
+dqcms834 comparesig 0 NaN -> NaN Invalid_operation
+dqcms835 comparesig 1 NaN -> NaN Invalid_operation
+dqcms836 comparesig 1000 NaN -> NaN Invalid_operation
+dqcms837 comparesig Inf NaN -> NaN Invalid_operation
+dqcms838 comparesig -NaN -NaN -> -NaN Invalid_operation
+dqcms839 comparesig +NaN -NaN -> NaN Invalid_operation
+dqcms840 comparesig -NaN +NaN -> -NaN Invalid_operation
+
+dqcms841 comparesig sNaN -Inf -> NaN Invalid_operation
+dqcms842 comparesig sNaN -1000 -> NaN Invalid_operation
+dqcms843 comparesig sNaN -1 -> NaN Invalid_operation
+dqcms844 comparesig sNaN -0 -> NaN Invalid_operation
+dqcms845 comparesig sNaN 0 -> NaN Invalid_operation
+dqcms846 comparesig sNaN 1 -> NaN Invalid_operation
+dqcms847 comparesig sNaN 1000 -> NaN Invalid_operation
+dqcms848 comparesig sNaN NaN -> NaN Invalid_operation
+dqcms849 comparesig sNaN sNaN -> NaN Invalid_operation
+dqcms850 comparesig NaN sNaN -> NaN Invalid_operation
+dqcms851 comparesig -Inf sNaN -> NaN Invalid_operation
+dqcms852 comparesig -1000 sNaN -> NaN Invalid_operation
+dqcms853 comparesig -1 sNaN -> NaN Invalid_operation
+dqcms854 comparesig -0 sNaN -> NaN Invalid_operation
+dqcms855 comparesig 0 sNaN -> NaN Invalid_operation
+dqcms856 comparesig 1 sNaN -> NaN Invalid_operation
+dqcms857 comparesig 1000 sNaN -> NaN Invalid_operation
+dqcms858 comparesig Inf sNaN -> NaN Invalid_operation
+dqcms859 comparesig NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation
+dqcms861 comparesig NaN8 999 -> NaN8 Invalid_operation
+dqcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation
+dqcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation
+dqcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation
+dqcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation
+dqcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation
+dqcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation
+dqcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation
+dqcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation
+dqcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation
+
+dqcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation
+dqcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation
+dqcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation
+dqcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation
+dqcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation
+dqcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation
+dqcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation
+dqcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- wide range
+dqcms880 comparesig +1.23456789012345E-0 9E+6144 -> -1
+dqcms881 comparesig 9E+6144 +1.23456789012345E-0 -> 1
+dqcms882 comparesig +0.100 9E-6143 -> 1
+dqcms883 comparesig 9E-6143 +0.100 -> -1
+dqcms885 comparesig -1.23456789012345E-0 9E+6144 -> -1
+dqcms886 comparesig 9E+6144 -1.23456789012345E-0 -> 1
+dqcms887 comparesig -0.100 9E-6143 -> -1
+dqcms888 comparesig 9E-6143 -0.100 -> 1
+
+-- signs
+dqcms901 comparesig 1e+77 1e+11 -> 1
+dqcms902 comparesig 1e+77 -1e+11 -> 1
+dqcms903 comparesig -1e+77 1e+11 -> -1
+dqcms904 comparesig -1e+77 -1e+11 -> -1
+dqcms905 comparesig 1e-77 1e-11 -> -1
+dqcms906 comparesig 1e-77 -1e-11 -> 1
+dqcms907 comparesig -1e-77 1e-11 -> -1
+dqcms908 comparesig -1e-77 -1e-11 -> 1
+
+-- Null tests
+dqcms990 comparesig 10 # -> NaN Invalid_operation
+dqcms991 comparesig # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqCompareTotal.decTest b/Lib/test/decimaltestdata/dqCompareTotal.decTest
index 13701ccb57..bae3761909 100644
--- a/Lib/test/decimaltestdata/dqCompareTotal.decTest
+++ b/Lib/test/decimaltestdata/dqCompareTotal.decTest
@@ -1,706 +1,706 @@
-------------------------------------------------------------------------
--- dqCompareTotal.decTest -- decQuad comparison using total ordering --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqcot001 comparetotal -2 -2 -> 0
-dqcot002 comparetotal -2 -1 -> -1
-dqcot003 comparetotal -2 0 -> -1
-dqcot004 comparetotal -2 1 -> -1
-dqcot005 comparetotal -2 2 -> -1
-dqcot006 comparetotal -1 -2 -> 1
-dqcot007 comparetotal -1 -1 -> 0
-dqcot008 comparetotal -1 0 -> -1
-dqcot009 comparetotal -1 1 -> -1
-dqcot010 comparetotal -1 2 -> -1
-dqcot011 comparetotal 0 -2 -> 1
-dqcot012 comparetotal 0 -1 -> 1
-dqcot013 comparetotal 0 0 -> 0
-dqcot014 comparetotal 0 1 -> -1
-dqcot015 comparetotal 0 2 -> -1
-dqcot016 comparetotal 1 -2 -> 1
-dqcot017 comparetotal 1 -1 -> 1
-dqcot018 comparetotal 1 0 -> 1
-dqcot019 comparetotal 1 1 -> 0
-dqcot020 comparetotal 1 2 -> -1
-dqcot021 comparetotal 2 -2 -> 1
-dqcot022 comparetotal 2 -1 -> 1
-dqcot023 comparetotal 2 0 -> 1
-dqcot025 comparetotal 2 1 -> 1
-dqcot026 comparetotal 2 2 -> 0
-
-dqcot031 comparetotal -20 -20 -> 0
-dqcot032 comparetotal -20 -10 -> -1
-dqcot033 comparetotal -20 00 -> -1
-dqcot034 comparetotal -20 10 -> -1
-dqcot035 comparetotal -20 20 -> -1
-dqcot036 comparetotal -10 -20 -> 1
-dqcot037 comparetotal -10 -10 -> 0
-dqcot038 comparetotal -10 00 -> -1
-dqcot039 comparetotal -10 10 -> -1
-dqcot040 comparetotal -10 20 -> -1
-dqcot041 comparetotal 00 -20 -> 1
-dqcot042 comparetotal 00 -10 -> 1
-dqcot043 comparetotal 00 00 -> 0
-dqcot044 comparetotal 00 10 -> -1
-dqcot045 comparetotal 00 20 -> -1
-dqcot046 comparetotal 10 -20 -> 1
-dqcot047 comparetotal 10 -10 -> 1
-dqcot048 comparetotal 10 00 -> 1
-dqcot049 comparetotal 10 10 -> 0
-dqcot050 comparetotal 10 20 -> -1
-dqcot051 comparetotal 20 -20 -> 1
-dqcot052 comparetotal 20 -10 -> 1
-dqcot053 comparetotal 20 00 -> 1
-dqcot055 comparetotal 20 10 -> 1
-dqcot056 comparetotal 20 20 -> 0
-
-dqcot061 comparetotal -2.0 -2.0 -> 0
-dqcot062 comparetotal -2.0 -1.0 -> -1
-dqcot063 comparetotal -2.0 0.0 -> -1
-dqcot064 comparetotal -2.0 1.0 -> -1
-dqcot065 comparetotal -2.0 2.0 -> -1
-dqcot066 comparetotal -1.0 -2.0 -> 1
-dqcot067 comparetotal -1.0 -1.0 -> 0
-dqcot068 comparetotal -1.0 0.0 -> -1
-dqcot069 comparetotal -1.0 1.0 -> -1
-dqcot070 comparetotal -1.0 2.0 -> -1
-dqcot071 comparetotal 0.0 -2.0 -> 1
-dqcot072 comparetotal 0.0 -1.0 -> 1
-dqcot073 comparetotal 0.0 0.0 -> 0
-dqcot074 comparetotal 0.0 1.0 -> -1
-dqcot075 comparetotal 0.0 2.0 -> -1
-dqcot076 comparetotal 1.0 -2.0 -> 1
-dqcot077 comparetotal 1.0 -1.0 -> 1
-dqcot078 comparetotal 1.0 0.0 -> 1
-dqcot079 comparetotal 1.0 1.0 -> 0
-dqcot080 comparetotal 1.0 2.0 -> -1
-dqcot081 comparetotal 2.0 -2.0 -> 1
-dqcot082 comparetotal 2.0 -1.0 -> 1
-dqcot083 comparetotal 2.0 0.0 -> 1
-dqcot085 comparetotal 2.0 1.0 -> 1
-dqcot086 comparetotal 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-dqcot090 comparetotal 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
-dqcot091 comparetotal -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> -1
-dqcot092 comparetotal 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 1
-dqcot093 comparetotal -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-dqcot100 comparetotal 7.0 7.0 -> 0
-dqcot101 comparetotal 7.0 7 -> -1
-dqcot102 comparetotal 7 7.0 -> 1
-dqcot103 comparetotal 7E+0 7.0 -> 1
-dqcot104 comparetotal 70E-1 7.0 -> 0
-dqcot105 comparetotal 0.7E+1 7 -> 0
-dqcot106 comparetotal 70E-1 7 -> -1
-dqcot107 comparetotal 7.0 7E+0 -> -1
-dqcot108 comparetotal 7.0 70E-1 -> 0
-dqcot109 comparetotal 7 0.7E+1 -> 0
-dqcot110 comparetotal 7 70E-1 -> 1
-
-dqcot120 comparetotal 8.0 7.0 -> 1
-dqcot121 comparetotal 8.0 7 -> 1
-dqcot122 comparetotal 8 7.0 -> 1
-dqcot123 comparetotal 8E+0 7.0 -> 1
-dqcot124 comparetotal 80E-1 7.0 -> 1
-dqcot125 comparetotal 0.8E+1 7 -> 1
-dqcot126 comparetotal 80E-1 7 -> 1
-dqcot127 comparetotal 8.0 7E+0 -> 1
-dqcot128 comparetotal 8.0 70E-1 -> 1
-dqcot129 comparetotal 8 0.7E+1 -> 1
-dqcot130 comparetotal 8 70E-1 -> 1
-
-dqcot140 comparetotal 8.0 9.0 -> -1
-dqcot141 comparetotal 8.0 9 -> -1
-dqcot142 comparetotal 8 9.0 -> -1
-dqcot143 comparetotal 8E+0 9.0 -> -1
-dqcot144 comparetotal 80E-1 9.0 -> -1
-dqcot145 comparetotal 0.8E+1 9 -> -1
-dqcot146 comparetotal 80E-1 9 -> -1
-dqcot147 comparetotal 8.0 9E+0 -> -1
-dqcot148 comparetotal 8.0 90E-1 -> -1
-dqcot149 comparetotal 8 0.9E+1 -> -1
-dqcot150 comparetotal 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-dqcot200 comparetotal -7.0 7.0 -> -1
-dqcot201 comparetotal -7.0 7 -> -1
-dqcot202 comparetotal -7 7.0 -> -1
-dqcot203 comparetotal -7E+0 7.0 -> -1
-dqcot204 comparetotal -70E-1 7.0 -> -1
-dqcot205 comparetotal -0.7E+1 7 -> -1
-dqcot206 comparetotal -70E-1 7 -> -1
-dqcot207 comparetotal -7.0 7E+0 -> -1
-dqcot208 comparetotal -7.0 70E-1 -> -1
-dqcot209 comparetotal -7 0.7E+1 -> -1
-dqcot210 comparetotal -7 70E-1 -> -1
-
-dqcot220 comparetotal -8.0 7.0 -> -1
-dqcot221 comparetotal -8.0 7 -> -1
-dqcot222 comparetotal -8 7.0 -> -1
-dqcot223 comparetotal -8E+0 7.0 -> -1
-dqcot224 comparetotal -80E-1 7.0 -> -1
-dqcot225 comparetotal -0.8E+1 7 -> -1
-dqcot226 comparetotal -80E-1 7 -> -1
-dqcot227 comparetotal -8.0 7E+0 -> -1
-dqcot228 comparetotal -8.0 70E-1 -> -1
-dqcot229 comparetotal -8 0.7E+1 -> -1
-dqcot230 comparetotal -8 70E-1 -> -1
-
-dqcot240 comparetotal -8.0 9.0 -> -1
-dqcot241 comparetotal -8.0 9 -> -1
-dqcot242 comparetotal -8 9.0 -> -1
-dqcot243 comparetotal -8E+0 9.0 -> -1
-dqcot244 comparetotal -80E-1 9.0 -> -1
-dqcot245 comparetotal -0.8E+1 9 -> -1
-dqcot246 comparetotal -80E-1 9 -> -1
-dqcot247 comparetotal -8.0 9E+0 -> -1
-dqcot248 comparetotal -8.0 90E-1 -> -1
-dqcot249 comparetotal -8 0.9E+1 -> -1
-dqcot250 comparetotal -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-dqcot300 comparetotal 7.0 -7.0 -> 1
-dqcot301 comparetotal 7.0 -7 -> 1
-dqcot302 comparetotal 7 -7.0 -> 1
-dqcot303 comparetotal 7E+0 -7.0 -> 1
-dqcot304 comparetotal 70E-1 -7.0 -> 1
-dqcot305 comparetotal .7E+1 -7 -> 1
-dqcot306 comparetotal 70E-1 -7 -> 1
-dqcot307 comparetotal 7.0 -7E+0 -> 1
-dqcot308 comparetotal 7.0 -70E-1 -> 1
-dqcot309 comparetotal 7 -.7E+1 -> 1
-dqcot310 comparetotal 7 -70E-1 -> 1
-
-dqcot320 comparetotal 8.0 -7.0 -> 1
-dqcot321 comparetotal 8.0 -7 -> 1
-dqcot322 comparetotal 8 -7.0 -> 1
-dqcot323 comparetotal 8E+0 -7.0 -> 1
-dqcot324 comparetotal 80E-1 -7.0 -> 1
-dqcot325 comparetotal .8E+1 -7 -> 1
-dqcot326 comparetotal 80E-1 -7 -> 1
-dqcot327 comparetotal 8.0 -7E+0 -> 1
-dqcot328 comparetotal 8.0 -70E-1 -> 1
-dqcot329 comparetotal 8 -.7E+1 -> 1
-dqcot330 comparetotal 8 -70E-1 -> 1
-
-dqcot340 comparetotal 8.0 -9.0 -> 1
-dqcot341 comparetotal 8.0 -9 -> 1
-dqcot342 comparetotal 8 -9.0 -> 1
-dqcot343 comparetotal 8E+0 -9.0 -> 1
-dqcot344 comparetotal 80E-1 -9.0 -> 1
-dqcot345 comparetotal .8E+1 -9 -> 1
-dqcot346 comparetotal 80E-1 -9 -> 1
-dqcot347 comparetotal 8.0 -9E+0 -> 1
-dqcot348 comparetotal 8.0 -90E-1 -> 1
-dqcot349 comparetotal 8 -.9E+1 -> 1
-dqcot350 comparetotal 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-dqcot400 comparetotal -7.0 -7.0 -> 0
-dqcot401 comparetotal -7.0 -7 -> 1
-dqcot402 comparetotal -7 -7.0 -> -1
-dqcot403 comparetotal -7E+0 -7.0 -> -1
-dqcot404 comparetotal -70E-1 -7.0 -> 0
-dqcot405 comparetotal -.7E+1 -7 -> 0
-dqcot406 comparetotal -70E-1 -7 -> 1
-dqcot407 comparetotal -7.0 -7E+0 -> 1
-dqcot408 comparetotal -7.0 -70E-1 -> 0
-dqcot409 comparetotal -7 -.7E+1 -> 0
-dqcot410 comparetotal -7 -70E-1 -> -1
-
-dqcot420 comparetotal -8.0 -7.0 -> -1
-dqcot421 comparetotal -8.0 -7 -> -1
-dqcot422 comparetotal -8 -7.0 -> -1
-dqcot423 comparetotal -8E+0 -7.0 -> -1
-dqcot424 comparetotal -80E-1 -7.0 -> -1
-dqcot425 comparetotal -.8E+1 -7 -> -1
-dqcot426 comparetotal -80E-1 -7 -> -1
-dqcot427 comparetotal -8.0 -7E+0 -> -1
-dqcot428 comparetotal -8.0 -70E-1 -> -1
-dqcot429 comparetotal -8 -.7E+1 -> -1
-dqcot430 comparetotal -8 -70E-1 -> -1
-
-dqcot440 comparetotal -8.0 -9.0 -> 1
-dqcot441 comparetotal -8.0 -9 -> 1
-dqcot442 comparetotal -8 -9.0 -> 1
-dqcot443 comparetotal -8E+0 -9.0 -> 1
-dqcot444 comparetotal -80E-1 -9.0 -> 1
-dqcot445 comparetotal -.8E+1 -9 -> 1
-dqcot446 comparetotal -80E-1 -9 -> 1
-dqcot447 comparetotal -8.0 -9E+0 -> 1
-dqcot448 comparetotal -8.0 -90E-1 -> 1
-dqcot449 comparetotal -8 -.9E+1 -> 1
-dqcot450 comparetotal -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-dqcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
-dqcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1
-dqcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
-dqcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1
-dqcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
-dqcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1
-dqcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
-dqcot480 comparetotal 123.456000E+89 123.456E+89 -> -1
-dqcot481 comparetotal 123.45600E-89 123.456E-89 -> -1
-dqcot482 comparetotal 123.4560E+89 123.456E+89 -> -1
-dqcot483 comparetotal 123.456E-89 123.456E-89 -> 0
-dqcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1
-dqcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
-dqcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1
-dqcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
-dqcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1
-dqcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
-dqcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1
-dqcot494 comparetotal 123.456E-89 123.456000E-89 -> 1
-dqcot495 comparetotal 123.456E+89 123.45600E+89 -> 1
-dqcot496 comparetotal 123.456E-89 123.4560E-89 -> 1
-dqcot497 comparetotal 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-dqcot498 comparetotal 1 1E-17 -> 1
-dqcot499 comparetotal 1 1E-16 -> 1
-dqcot500 comparetotal 1 1E-15 -> 1
-dqcot501 comparetotal 1 1E-14 -> 1
-dqcot502 comparetotal 1 1E-13 -> 1
-dqcot503 comparetotal 1 1E-12 -> 1
-dqcot504 comparetotal 1 1E-11 -> 1
-dqcot505 comparetotal 1 1E-10 -> 1
-dqcot506 comparetotal 1 1E-9 -> 1
-dqcot507 comparetotal 1 1E-8 -> 1
-dqcot508 comparetotal 1 1E-7 -> 1
-dqcot509 comparetotal 1 1E-6 -> 1
-dqcot510 comparetotal 1 1E-5 -> 1
-dqcot511 comparetotal 1 1E-4 -> 1
-dqcot512 comparetotal 1 1E-3 -> 1
-dqcot513 comparetotal 1 1E-2 -> 1
-dqcot514 comparetotal 1 1E-1 -> 1
-dqcot515 comparetotal 1 1E-0 -> 0
-dqcot516 comparetotal 1 1E+1 -> -1
-dqcot517 comparetotal 1 1E+2 -> -1
-dqcot518 comparetotal 1 1E+3 -> -1
-dqcot519 comparetotal 1 1E+4 -> -1
-dqcot521 comparetotal 1 1E+5 -> -1
-dqcot522 comparetotal 1 1E+6 -> -1
-dqcot523 comparetotal 1 1E+7 -> -1
-dqcot524 comparetotal 1 1E+8 -> -1
-dqcot525 comparetotal 1 1E+9 -> -1
-dqcot526 comparetotal 1 1E+10 -> -1
-dqcot527 comparetotal 1 1E+11 -> -1
-dqcot528 comparetotal 1 1E+12 -> -1
-dqcot529 comparetotal 1 1E+13 -> -1
-dqcot530 comparetotal 1 1E+14 -> -1
-dqcot531 comparetotal 1 1E+15 -> -1
-dqcot532 comparetotal 1 1E+16 -> -1
-dqcot533 comparetotal 1 1E+17 -> -1
--- LR swap
-dqcot538 comparetotal 1E-17 1 -> -1
-dqcot539 comparetotal 1E-16 1 -> -1
-dqcot540 comparetotal 1E-15 1 -> -1
-dqcot541 comparetotal 1E-14 1 -> -1
-dqcot542 comparetotal 1E-13 1 -> -1
-dqcot543 comparetotal 1E-12 1 -> -1
-dqcot544 comparetotal 1E-11 1 -> -1
-dqcot545 comparetotal 1E-10 1 -> -1
-dqcot546 comparetotal 1E-9 1 -> -1
-dqcot547 comparetotal 1E-8 1 -> -1
-dqcot548 comparetotal 1E-7 1 -> -1
-dqcot549 comparetotal 1E-6 1 -> -1
-dqcot550 comparetotal 1E-5 1 -> -1
-dqcot551 comparetotal 1E-4 1 -> -1
-dqcot552 comparetotal 1E-3 1 -> -1
-dqcot553 comparetotal 1E-2 1 -> -1
-dqcot554 comparetotal 1E-1 1 -> -1
-dqcot555 comparetotal 1E-0 1 -> 0
-dqcot556 comparetotal 1E+1 1 -> 1
-dqcot557 comparetotal 1E+2 1 -> 1
-dqcot558 comparetotal 1E+3 1 -> 1
-dqcot559 comparetotal 1E+4 1 -> 1
-dqcot561 comparetotal 1E+5 1 -> 1
-dqcot562 comparetotal 1E+6 1 -> 1
-dqcot563 comparetotal 1E+7 1 -> 1
-dqcot564 comparetotal 1E+8 1 -> 1
-dqcot565 comparetotal 1E+9 1 -> 1
-dqcot566 comparetotal 1E+10 1 -> 1
-dqcot567 comparetotal 1E+11 1 -> 1
-dqcot568 comparetotal 1E+12 1 -> 1
-dqcot569 comparetotal 1E+13 1 -> 1
-dqcot570 comparetotal 1E+14 1 -> 1
-dqcot571 comparetotal 1E+15 1 -> 1
-dqcot572 comparetotal 1E+16 1 -> 1
-dqcot573 comparetotal 1E+17 1 -> 1
--- similar with a useful coefficient, one side only
-dqcot578 comparetotal 0.000000987654321 1E-17 -> 1
-dqcot579 comparetotal 0.000000987654321 1E-16 -> 1
-dqcot580 comparetotal 0.000000987654321 1E-15 -> 1
-dqcot581 comparetotal 0.000000987654321 1E-14 -> 1
-dqcot582 comparetotal 0.000000987654321 1E-13 -> 1
-dqcot583 comparetotal 0.000000987654321 1E-12 -> 1
-dqcot584 comparetotal 0.000000987654321 1E-11 -> 1
-dqcot585 comparetotal 0.000000987654321 1E-10 -> 1
-dqcot586 comparetotal 0.000000987654321 1E-9 -> 1
-dqcot587 comparetotal 0.000000987654321 1E-8 -> 1
-dqcot588 comparetotal 0.000000987654321 1E-7 -> 1
-dqcot589 comparetotal 0.000000987654321 1E-6 -> -1
-dqcot590 comparetotal 0.000000987654321 1E-5 -> -1
-dqcot591 comparetotal 0.000000987654321 1E-4 -> -1
-dqcot592 comparetotal 0.000000987654321 1E-3 -> -1
-dqcot593 comparetotal 0.000000987654321 1E-2 -> -1
-dqcot594 comparetotal 0.000000987654321 1E-1 -> -1
-dqcot595 comparetotal 0.000000987654321 1E-0 -> -1
-dqcot596 comparetotal 0.000000987654321 1E+1 -> -1
-dqcot597 comparetotal 0.000000987654321 1E+2 -> -1
-dqcot598 comparetotal 0.000000987654321 1E+3 -> -1
-dqcot599 comparetotal 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-dqcot600 comparetotal 12 12.2345 -> -1
-dqcot601 comparetotal 12.0 12.2345 -> -1
-dqcot602 comparetotal 12.00 12.2345 -> -1
-dqcot603 comparetotal 12.000 12.2345 -> -1
-dqcot604 comparetotal 12.0000 12.2345 -> -1
-dqcot605 comparetotal 12.00000 12.2345 -> -1
-dqcot606 comparetotal 12.000000 12.2345 -> -1
-dqcot607 comparetotal 12.0000000 12.2345 -> -1
-dqcot608 comparetotal 12.00000000 12.2345 -> -1
-dqcot609 comparetotal 12.000000000 12.2345 -> -1
-dqcot610 comparetotal 12.1234 12 -> 1
-dqcot611 comparetotal 12.1234 12.0 -> 1
-dqcot612 comparetotal 12.1234 12.00 -> 1
-dqcot613 comparetotal 12.1234 12.000 -> 1
-dqcot614 comparetotal 12.1234 12.0000 -> 1
-dqcot615 comparetotal 12.1234 12.00000 -> 1
-dqcot616 comparetotal 12.1234 12.000000 -> 1
-dqcot617 comparetotal 12.1234 12.0000000 -> 1
-dqcot618 comparetotal 12.1234 12.00000000 -> 1
-dqcot619 comparetotal 12.1234 12.000000000 -> 1
-dqcot620 comparetotal -12 -12.2345 -> 1
-dqcot621 comparetotal -12.0 -12.2345 -> 1
-dqcot622 comparetotal -12.00 -12.2345 -> 1
-dqcot623 comparetotal -12.000 -12.2345 -> 1
-dqcot624 comparetotal -12.0000 -12.2345 -> 1
-dqcot625 comparetotal -12.00000 -12.2345 -> 1
-dqcot626 comparetotal -12.000000 -12.2345 -> 1
-dqcot627 comparetotal -12.0000000 -12.2345 -> 1
-dqcot628 comparetotal -12.00000000 -12.2345 -> 1
-dqcot629 comparetotal -12.000000000 -12.2345 -> 1
-dqcot630 comparetotal -12.1234 -12 -> -1
-dqcot631 comparetotal -12.1234 -12.0 -> -1
-dqcot632 comparetotal -12.1234 -12.00 -> -1
-dqcot633 comparetotal -12.1234 -12.000 -> -1
-dqcot634 comparetotal -12.1234 -12.0000 -> -1
-dqcot635 comparetotal -12.1234 -12.00000 -> -1
-dqcot636 comparetotal -12.1234 -12.000000 -> -1
-dqcot637 comparetotal -12.1234 -12.0000000 -> -1
-dqcot638 comparetotal -12.1234 -12.00000000 -> -1
-dqcot639 comparetotal -12.1234 -12.000000000 -> -1
-
--- extended zeros
-dqcot640 comparetotal 0 0 -> 0
-dqcot641 comparetotal 0 -0 -> 1
-dqcot642 comparetotal 0 -0.0 -> 1
-dqcot643 comparetotal 0 0.0 -> 1
-dqcot644 comparetotal -0 0 -> -1
-dqcot645 comparetotal -0 -0 -> 0
-dqcot646 comparetotal -0 -0.0 -> -1
-dqcot647 comparetotal -0 0.0 -> -1
-dqcot648 comparetotal 0.0 0 -> -1
-dqcot649 comparetotal 0.0 -0 -> 1
-dqcot650 comparetotal 0.0 -0.0 -> 1
-dqcot651 comparetotal 0.0 0.0 -> 0
-dqcot652 comparetotal -0.0 0 -> -1
-dqcot653 comparetotal -0.0 -0 -> 1
-dqcot654 comparetotal -0.0 -0.0 -> 0
-dqcot655 comparetotal -0.0 0.0 -> -1
-
-dqcot656 comparetotal -0E1 0.0 -> -1
-dqcot657 comparetotal -0E2 0.0 -> -1
-dqcot658 comparetotal 0E1 0.0 -> 1
-dqcot659 comparetotal 0E2 0.0 -> 1
-dqcot660 comparetotal -0E1 0 -> -1
-dqcot661 comparetotal -0E2 0 -> -1
-dqcot662 comparetotal 0E1 0 -> 1
-dqcot663 comparetotal 0E2 0 -> 1
-dqcot664 comparetotal -0E1 -0E1 -> 0
-dqcot665 comparetotal -0E2 -0E1 -> -1
-dqcot666 comparetotal 0E1 -0E1 -> 1
-dqcot667 comparetotal 0E2 -0E1 -> 1
-dqcot668 comparetotal -0E1 -0E2 -> 1
-dqcot669 comparetotal -0E2 -0E2 -> 0
-dqcot670 comparetotal 0E1 -0E2 -> 1
-dqcot671 comparetotal 0E2 -0E2 -> 1
-dqcot672 comparetotal -0E1 0E1 -> -1
-dqcot673 comparetotal -0E2 0E1 -> -1
-dqcot674 comparetotal 0E1 0E1 -> 0
-dqcot675 comparetotal 0E2 0E1 -> 1
-dqcot676 comparetotal -0E1 0E2 -> -1
-dqcot677 comparetotal -0E2 0E2 -> -1
-dqcot678 comparetotal 0E1 0E2 -> -1
-dqcot679 comparetotal 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-dqcot680 comparetotal 12 12 -> 0
-dqcot681 comparetotal 12 12.0 -> 1
-dqcot682 comparetotal 12 12.00 -> 1
-dqcot683 comparetotal 12 12.000 -> 1
-dqcot684 comparetotal 12 12.0000 -> 1
-dqcot685 comparetotal 12 12.00000 -> 1
-dqcot686 comparetotal 12 12.000000 -> 1
-dqcot687 comparetotal 12 12.0000000 -> 1
-dqcot688 comparetotal 12 12.00000000 -> 1
-dqcot689 comparetotal 12 12.000000000 -> 1
-dqcot690 comparetotal 12 12 -> 0
-dqcot691 comparetotal 12.0 12 -> -1
-dqcot692 comparetotal 12.00 12 -> -1
-dqcot693 comparetotal 12.000 12 -> -1
-dqcot694 comparetotal 12.0000 12 -> -1
-dqcot695 comparetotal 12.00000 12 -> -1
-dqcot696 comparetotal 12.000000 12 -> -1
-dqcot697 comparetotal 12.0000000 12 -> -1
-dqcot698 comparetotal 12.00000000 12 -> -1
-dqcot699 comparetotal 12.000000000 12 -> -1
-
--- old long operand checks
-dqcot701 comparetotal 12345678000 1 -> 1
-dqcot702 comparetotal 1 12345678000 -> -1
-dqcot703 comparetotal 1234567800 1 -> 1
-dqcot704 comparetotal 1 1234567800 -> -1
-dqcot705 comparetotal 1234567890 1 -> 1
-dqcot706 comparetotal 1 1234567890 -> -1
-dqcot707 comparetotal 1234567891 1 -> 1
-dqcot708 comparetotal 1 1234567891 -> -1
-dqcot709 comparetotal 12345678901 1 -> 1
-dqcot710 comparetotal 1 12345678901 -> -1
-dqcot711 comparetotal 1234567896 1 -> 1
-dqcot712 comparetotal 1 1234567896 -> -1
-dqcot713 comparetotal -1234567891 1 -> -1
-dqcot714 comparetotal 1 -1234567891 -> 1
-dqcot715 comparetotal -12345678901 1 -> -1
-dqcot716 comparetotal 1 -12345678901 -> 1
-dqcot717 comparetotal -1234567896 1 -> -1
-dqcot718 comparetotal 1 -1234567896 -> 1
-
--- old residue cases
-dqcot740 comparetotal 1 0.9999999 -> 1
-dqcot741 comparetotal 1 0.999999 -> 1
-dqcot742 comparetotal 1 0.99999 -> 1
-dqcot743 comparetotal 1 1.0000 -> 1
-dqcot744 comparetotal 1 1.00001 -> -1
-dqcot745 comparetotal 1 1.000001 -> -1
-dqcot746 comparetotal 1 1.0000001 -> -1
-dqcot750 comparetotal 0.9999999 1 -> -1
-dqcot751 comparetotal 0.999999 1 -> -1
-dqcot752 comparetotal 0.99999 1 -> -1
-dqcot753 comparetotal 1.0000 1 -> -1
-dqcot754 comparetotal 1.00001 1 -> 1
-dqcot755 comparetotal 1.000001 1 -> 1
-dqcot756 comparetotal 1.0000001 1 -> 1
-
--- Specials
-dqcot780 comparetotal Inf -Inf -> 1
-dqcot781 comparetotal Inf -1000 -> 1
-dqcot782 comparetotal Inf -1 -> 1
-dqcot783 comparetotal Inf -0 -> 1
-dqcot784 comparetotal Inf 0 -> 1
-dqcot785 comparetotal Inf 1 -> 1
-dqcot786 comparetotal Inf 1000 -> 1
-dqcot787 comparetotal Inf Inf -> 0
-dqcot788 comparetotal -1000 Inf -> -1
-dqcot789 comparetotal -Inf Inf -> -1
-dqcot790 comparetotal -1 Inf -> -1
-dqcot791 comparetotal -0 Inf -> -1
-dqcot792 comparetotal 0 Inf -> -1
-dqcot793 comparetotal 1 Inf -> -1
-dqcot794 comparetotal 1000 Inf -> -1
-dqcot795 comparetotal Inf Inf -> 0
-
-dqcot800 comparetotal -Inf -Inf -> 0
-dqcot801 comparetotal -Inf -1000 -> -1
-dqcot802 comparetotal -Inf -1 -> -1
-dqcot803 comparetotal -Inf -0 -> -1
-dqcot804 comparetotal -Inf 0 -> -1
-dqcot805 comparetotal -Inf 1 -> -1
-dqcot806 comparetotal -Inf 1000 -> -1
-dqcot807 comparetotal -Inf Inf -> -1
-dqcot808 comparetotal -Inf -Inf -> 0
-dqcot809 comparetotal -1000 -Inf -> 1
-dqcot810 comparetotal -1 -Inf -> 1
-dqcot811 comparetotal -0 -Inf -> 1
-dqcot812 comparetotal 0 -Inf -> 1
-dqcot813 comparetotal 1 -Inf -> 1
-dqcot814 comparetotal 1000 -Inf -> 1
-dqcot815 comparetotal Inf -Inf -> 1
-
-dqcot821 comparetotal NaN -Inf -> 1
-dqcot822 comparetotal NaN -1000 -> 1
-dqcot823 comparetotal NaN -1 -> 1
-dqcot824 comparetotal NaN -0 -> 1
-dqcot825 comparetotal NaN 0 -> 1
-dqcot826 comparetotal NaN 1 -> 1
-dqcot827 comparetotal NaN 1000 -> 1
-dqcot828 comparetotal NaN Inf -> 1
-dqcot829 comparetotal NaN NaN -> 0
-dqcot830 comparetotal -Inf NaN -> -1
-dqcot831 comparetotal -1000 NaN -> -1
-dqcot832 comparetotal -1 NaN -> -1
-dqcot833 comparetotal -0 NaN -> -1
-dqcot834 comparetotal 0 NaN -> -1
-dqcot835 comparetotal 1 NaN -> -1
-dqcot836 comparetotal 1000 NaN -> -1
-dqcot837 comparetotal Inf NaN -> -1
-dqcot838 comparetotal -NaN -NaN -> 0
-dqcot839 comparetotal +NaN -NaN -> 1
-dqcot840 comparetotal -NaN +NaN -> -1
-
-dqcot841 comparetotal sNaN -sNaN -> 1
-dqcot842 comparetotal sNaN -NaN -> 1
-dqcot843 comparetotal sNaN -Inf -> 1
-dqcot844 comparetotal sNaN -1000 -> 1
-dqcot845 comparetotal sNaN -1 -> 1
-dqcot846 comparetotal sNaN -0 -> 1
-dqcot847 comparetotal sNaN 0 -> 1
-dqcot848 comparetotal sNaN 1 -> 1
-dqcot849 comparetotal sNaN 1000 -> 1
-dqcot850 comparetotal sNaN NaN -> -1
-dqcot851 comparetotal sNaN sNaN -> 0
-
-dqcot852 comparetotal -sNaN sNaN -> -1
-dqcot853 comparetotal -NaN sNaN -> -1
-dqcot854 comparetotal -Inf sNaN -> -1
-dqcot855 comparetotal -1000 sNaN -> -1
-dqcot856 comparetotal -1 sNaN -> -1
-dqcot857 comparetotal -0 sNaN -> -1
-dqcot858 comparetotal 0 sNaN -> -1
-dqcot859 comparetotal 1 sNaN -> -1
-dqcot860 comparetotal 1000 sNaN -> -1
-dqcot861 comparetotal Inf sNaN -> -1
-dqcot862 comparetotal NaN sNaN -> 1
-dqcot863 comparetotal sNaN sNaN -> 0
-
-dqcot871 comparetotal -sNaN -sNaN -> 0
-dqcot872 comparetotal -sNaN -NaN -> 1
-dqcot873 comparetotal -sNaN -Inf -> -1
-dqcot874 comparetotal -sNaN -1000 -> -1
-dqcot875 comparetotal -sNaN -1 -> -1
-dqcot876 comparetotal -sNaN -0 -> -1
-dqcot877 comparetotal -sNaN 0 -> -1
-dqcot878 comparetotal -sNaN 1 -> -1
-dqcot879 comparetotal -sNaN 1000 -> -1
-dqcot880 comparetotal -sNaN NaN -> -1
-dqcot881 comparetotal -sNaN sNaN -> -1
-
-dqcot882 comparetotal -sNaN -sNaN -> 0
-dqcot883 comparetotal -NaN -sNaN -> -1
-dqcot884 comparetotal -Inf -sNaN -> 1
-dqcot885 comparetotal -1000 -sNaN -> 1
-dqcot886 comparetotal -1 -sNaN -> 1
-dqcot887 comparetotal -0 -sNaN -> 1
-dqcot888 comparetotal 0 -sNaN -> 1
-dqcot889 comparetotal 1 -sNaN -> 1
-dqcot890 comparetotal 1000 -sNaN -> 1
-dqcot891 comparetotal Inf -sNaN -> 1
-dqcot892 comparetotal NaN -sNaN -> 1
-dqcot893 comparetotal sNaN -sNaN -> 1
-
--- NaNs with payload
-dqcot960 comparetotal NaN9 -Inf -> 1
-dqcot961 comparetotal NaN8 999 -> 1
-dqcot962 comparetotal NaN77 Inf -> 1
-dqcot963 comparetotal -NaN67 NaN5 -> -1
-dqcot964 comparetotal -Inf -NaN4 -> 1
-dqcot965 comparetotal -999 -NaN33 -> 1
-dqcot966 comparetotal Inf NaN2 -> -1
-
-dqcot970 comparetotal -NaN41 -NaN42 -> 1
-dqcot971 comparetotal +NaN41 -NaN42 -> 1
-dqcot972 comparetotal -NaN41 +NaN42 -> -1
-dqcot973 comparetotal +NaN41 +NaN42 -> -1
-dqcot974 comparetotal -NaN42 -NaN01 -> -1
-dqcot975 comparetotal +NaN42 -NaN01 -> 1
-dqcot976 comparetotal -NaN42 +NaN01 -> -1
-dqcot977 comparetotal +NaN42 +NaN01 -> 1
-
-dqcot980 comparetotal -sNaN771 -sNaN772 -> 1
-dqcot981 comparetotal +sNaN771 -sNaN772 -> 1
-dqcot982 comparetotal -sNaN771 +sNaN772 -> -1
-dqcot983 comparetotal +sNaN771 +sNaN772 -> -1
-dqcot984 comparetotal -sNaN772 -sNaN771 -> -1
-dqcot985 comparetotal +sNaN772 -sNaN771 -> 1
-dqcot986 comparetotal -sNaN772 +sNaN771 -> -1
-dqcot987 comparetotal +sNaN772 +sNaN771 -> 1
-
-dqcot991 comparetotal -sNaN99 -Inf -> -1
-dqcot992 comparetotal sNaN98 -11 -> 1
-dqcot993 comparetotal sNaN97 NaN -> -1
-dqcot994 comparetotal sNaN16 sNaN94 -> -1
-dqcot995 comparetotal NaN85 sNaN83 -> 1
-dqcot996 comparetotal -Inf sNaN92 -> -1
-dqcot997 comparetotal 088 sNaN81 -> -1
-dqcot998 comparetotal Inf sNaN90 -> -1
-dqcot999 comparetotal NaN -sNaN89 -> 1
-
--- spread zeros
-dqcot1110 comparetotal 0E-6143 0 -> -1
-dqcot1111 comparetotal 0E-6143 -0 -> 1
-dqcot1112 comparetotal -0E-6143 0 -> -1
-dqcot1113 comparetotal -0E-6143 -0 -> 1
-dqcot1114 comparetotal 0E-6143 0E+6144 -> -1
-dqcot1115 comparetotal 0E-6143 -0E+6144 -> 1
-dqcot1116 comparetotal -0E-6143 0E+6144 -> -1
-dqcot1117 comparetotal -0E-6143 -0E+6144 -> 1
-dqcot1118 comparetotal 0 0E+6144 -> -1
-dqcot1119 comparetotal 0 -0E+6144 -> 1
-dqcot1120 comparetotal -0 0E+6144 -> -1
-dqcot1121 comparetotal -0 -0E+6144 -> 1
-
-dqcot1130 comparetotal 0E+6144 0 -> 1
-dqcot1131 comparetotal 0E+6144 -0 -> 1
-dqcot1132 comparetotal -0E+6144 0 -> -1
-dqcot1133 comparetotal -0E+6144 -0 -> -1
-dqcot1134 comparetotal 0E+6144 0E-6143 -> 1
-dqcot1135 comparetotal 0E+6144 -0E-6143 -> 1
-dqcot1136 comparetotal -0E+6144 0E-6143 -> -1
-dqcot1137 comparetotal -0E+6144 -0E-6143 -> -1
-dqcot1138 comparetotal 0 0E-6143 -> 1
-dqcot1139 comparetotal 0 -0E-6143 -> 1
-dqcot1140 comparetotal -0 0E-6143 -> -1
-dqcot1141 comparetotal -0 -0E-6143 -> -1
-
--- Null tests
-dqcot9990 comparetotal 10 # -> NaN Invalid_operation
-dqcot9991 comparetotal # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqCompareTotal.decTest -- decQuad comparison using total ordering --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqcot001 comparetotal -2 -2 -> 0
+dqcot002 comparetotal -2 -1 -> -1
+dqcot003 comparetotal -2 0 -> -1
+dqcot004 comparetotal -2 1 -> -1
+dqcot005 comparetotal -2 2 -> -1
+dqcot006 comparetotal -1 -2 -> 1
+dqcot007 comparetotal -1 -1 -> 0
+dqcot008 comparetotal -1 0 -> -1
+dqcot009 comparetotal -1 1 -> -1
+dqcot010 comparetotal -1 2 -> -1
+dqcot011 comparetotal 0 -2 -> 1
+dqcot012 comparetotal 0 -1 -> 1
+dqcot013 comparetotal 0 0 -> 0
+dqcot014 comparetotal 0 1 -> -1
+dqcot015 comparetotal 0 2 -> -1
+dqcot016 comparetotal 1 -2 -> 1
+dqcot017 comparetotal 1 -1 -> 1
+dqcot018 comparetotal 1 0 -> 1
+dqcot019 comparetotal 1 1 -> 0
+dqcot020 comparetotal 1 2 -> -1
+dqcot021 comparetotal 2 -2 -> 1
+dqcot022 comparetotal 2 -1 -> 1
+dqcot023 comparetotal 2 0 -> 1
+dqcot025 comparetotal 2 1 -> 1
+dqcot026 comparetotal 2 2 -> 0
+
+dqcot031 comparetotal -20 -20 -> 0
+dqcot032 comparetotal -20 -10 -> -1
+dqcot033 comparetotal -20 00 -> -1
+dqcot034 comparetotal -20 10 -> -1
+dqcot035 comparetotal -20 20 -> -1
+dqcot036 comparetotal -10 -20 -> 1
+dqcot037 comparetotal -10 -10 -> 0
+dqcot038 comparetotal -10 00 -> -1
+dqcot039 comparetotal -10 10 -> -1
+dqcot040 comparetotal -10 20 -> -1
+dqcot041 comparetotal 00 -20 -> 1
+dqcot042 comparetotal 00 -10 -> 1
+dqcot043 comparetotal 00 00 -> 0
+dqcot044 comparetotal 00 10 -> -1
+dqcot045 comparetotal 00 20 -> -1
+dqcot046 comparetotal 10 -20 -> 1
+dqcot047 comparetotal 10 -10 -> 1
+dqcot048 comparetotal 10 00 -> 1
+dqcot049 comparetotal 10 10 -> 0
+dqcot050 comparetotal 10 20 -> -1
+dqcot051 comparetotal 20 -20 -> 1
+dqcot052 comparetotal 20 -10 -> 1
+dqcot053 comparetotal 20 00 -> 1
+dqcot055 comparetotal 20 10 -> 1
+dqcot056 comparetotal 20 20 -> 0
+
+dqcot061 comparetotal -2.0 -2.0 -> 0
+dqcot062 comparetotal -2.0 -1.0 -> -1
+dqcot063 comparetotal -2.0 0.0 -> -1
+dqcot064 comparetotal -2.0 1.0 -> -1
+dqcot065 comparetotal -2.0 2.0 -> -1
+dqcot066 comparetotal -1.0 -2.0 -> 1
+dqcot067 comparetotal -1.0 -1.0 -> 0
+dqcot068 comparetotal -1.0 0.0 -> -1
+dqcot069 comparetotal -1.0 1.0 -> -1
+dqcot070 comparetotal -1.0 2.0 -> -1
+dqcot071 comparetotal 0.0 -2.0 -> 1
+dqcot072 comparetotal 0.0 -1.0 -> 1
+dqcot073 comparetotal 0.0 0.0 -> 0
+dqcot074 comparetotal 0.0 1.0 -> -1
+dqcot075 comparetotal 0.0 2.0 -> -1
+dqcot076 comparetotal 1.0 -2.0 -> 1
+dqcot077 comparetotal 1.0 -1.0 -> 1
+dqcot078 comparetotal 1.0 0.0 -> 1
+dqcot079 comparetotal 1.0 1.0 -> 0
+dqcot080 comparetotal 1.0 2.0 -> -1
+dqcot081 comparetotal 2.0 -2.0 -> 1
+dqcot082 comparetotal 2.0 -1.0 -> 1
+dqcot083 comparetotal 2.0 0.0 -> 1
+dqcot085 comparetotal 2.0 1.0 -> 1
+dqcot086 comparetotal 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+dqcot090 comparetotal 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
+dqcot091 comparetotal -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> -1
+dqcot092 comparetotal 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 1
+dqcot093 comparetotal -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+dqcot100 comparetotal 7.0 7.0 -> 0
+dqcot101 comparetotal 7.0 7 -> -1
+dqcot102 comparetotal 7 7.0 -> 1
+dqcot103 comparetotal 7E+0 7.0 -> 1
+dqcot104 comparetotal 70E-1 7.0 -> 0
+dqcot105 comparetotal 0.7E+1 7 -> 0
+dqcot106 comparetotal 70E-1 7 -> -1
+dqcot107 comparetotal 7.0 7E+0 -> -1
+dqcot108 comparetotal 7.0 70E-1 -> 0
+dqcot109 comparetotal 7 0.7E+1 -> 0
+dqcot110 comparetotal 7 70E-1 -> 1
+
+dqcot120 comparetotal 8.0 7.0 -> 1
+dqcot121 comparetotal 8.0 7 -> 1
+dqcot122 comparetotal 8 7.0 -> 1
+dqcot123 comparetotal 8E+0 7.0 -> 1
+dqcot124 comparetotal 80E-1 7.0 -> 1
+dqcot125 comparetotal 0.8E+1 7 -> 1
+dqcot126 comparetotal 80E-1 7 -> 1
+dqcot127 comparetotal 8.0 7E+0 -> 1
+dqcot128 comparetotal 8.0 70E-1 -> 1
+dqcot129 comparetotal 8 0.7E+1 -> 1
+dqcot130 comparetotal 8 70E-1 -> 1
+
+dqcot140 comparetotal 8.0 9.0 -> -1
+dqcot141 comparetotal 8.0 9 -> -1
+dqcot142 comparetotal 8 9.0 -> -1
+dqcot143 comparetotal 8E+0 9.0 -> -1
+dqcot144 comparetotal 80E-1 9.0 -> -1
+dqcot145 comparetotal 0.8E+1 9 -> -1
+dqcot146 comparetotal 80E-1 9 -> -1
+dqcot147 comparetotal 8.0 9E+0 -> -1
+dqcot148 comparetotal 8.0 90E-1 -> -1
+dqcot149 comparetotal 8 0.9E+1 -> -1
+dqcot150 comparetotal 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+dqcot200 comparetotal -7.0 7.0 -> -1
+dqcot201 comparetotal -7.0 7 -> -1
+dqcot202 comparetotal -7 7.0 -> -1
+dqcot203 comparetotal -7E+0 7.0 -> -1
+dqcot204 comparetotal -70E-1 7.0 -> -1
+dqcot205 comparetotal -0.7E+1 7 -> -1
+dqcot206 comparetotal -70E-1 7 -> -1
+dqcot207 comparetotal -7.0 7E+0 -> -1
+dqcot208 comparetotal -7.0 70E-1 -> -1
+dqcot209 comparetotal -7 0.7E+1 -> -1
+dqcot210 comparetotal -7 70E-1 -> -1
+
+dqcot220 comparetotal -8.0 7.0 -> -1
+dqcot221 comparetotal -8.0 7 -> -1
+dqcot222 comparetotal -8 7.0 -> -1
+dqcot223 comparetotal -8E+0 7.0 -> -1
+dqcot224 comparetotal -80E-1 7.0 -> -1
+dqcot225 comparetotal -0.8E+1 7 -> -1
+dqcot226 comparetotal -80E-1 7 -> -1
+dqcot227 comparetotal -8.0 7E+0 -> -1
+dqcot228 comparetotal -8.0 70E-1 -> -1
+dqcot229 comparetotal -8 0.7E+1 -> -1
+dqcot230 comparetotal -8 70E-1 -> -1
+
+dqcot240 comparetotal -8.0 9.0 -> -1
+dqcot241 comparetotal -8.0 9 -> -1
+dqcot242 comparetotal -8 9.0 -> -1
+dqcot243 comparetotal -8E+0 9.0 -> -1
+dqcot244 comparetotal -80E-1 9.0 -> -1
+dqcot245 comparetotal -0.8E+1 9 -> -1
+dqcot246 comparetotal -80E-1 9 -> -1
+dqcot247 comparetotal -8.0 9E+0 -> -1
+dqcot248 comparetotal -8.0 90E-1 -> -1
+dqcot249 comparetotal -8 0.9E+1 -> -1
+dqcot250 comparetotal -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+dqcot300 comparetotal 7.0 -7.0 -> 1
+dqcot301 comparetotal 7.0 -7 -> 1
+dqcot302 comparetotal 7 -7.0 -> 1
+dqcot303 comparetotal 7E+0 -7.0 -> 1
+dqcot304 comparetotal 70E-1 -7.0 -> 1
+dqcot305 comparetotal .7E+1 -7 -> 1
+dqcot306 comparetotal 70E-1 -7 -> 1
+dqcot307 comparetotal 7.0 -7E+0 -> 1
+dqcot308 comparetotal 7.0 -70E-1 -> 1
+dqcot309 comparetotal 7 -.7E+1 -> 1
+dqcot310 comparetotal 7 -70E-1 -> 1
+
+dqcot320 comparetotal 8.0 -7.0 -> 1
+dqcot321 comparetotal 8.0 -7 -> 1
+dqcot322 comparetotal 8 -7.0 -> 1
+dqcot323 comparetotal 8E+0 -7.0 -> 1
+dqcot324 comparetotal 80E-1 -7.0 -> 1
+dqcot325 comparetotal .8E+1 -7 -> 1
+dqcot326 comparetotal 80E-1 -7 -> 1
+dqcot327 comparetotal 8.0 -7E+0 -> 1
+dqcot328 comparetotal 8.0 -70E-1 -> 1
+dqcot329 comparetotal 8 -.7E+1 -> 1
+dqcot330 comparetotal 8 -70E-1 -> 1
+
+dqcot340 comparetotal 8.0 -9.0 -> 1
+dqcot341 comparetotal 8.0 -9 -> 1
+dqcot342 comparetotal 8 -9.0 -> 1
+dqcot343 comparetotal 8E+0 -9.0 -> 1
+dqcot344 comparetotal 80E-1 -9.0 -> 1
+dqcot345 comparetotal .8E+1 -9 -> 1
+dqcot346 comparetotal 80E-1 -9 -> 1
+dqcot347 comparetotal 8.0 -9E+0 -> 1
+dqcot348 comparetotal 8.0 -90E-1 -> 1
+dqcot349 comparetotal 8 -.9E+1 -> 1
+dqcot350 comparetotal 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+dqcot400 comparetotal -7.0 -7.0 -> 0
+dqcot401 comparetotal -7.0 -7 -> 1
+dqcot402 comparetotal -7 -7.0 -> -1
+dqcot403 comparetotal -7E+0 -7.0 -> -1
+dqcot404 comparetotal -70E-1 -7.0 -> 0
+dqcot405 comparetotal -.7E+1 -7 -> 0
+dqcot406 comparetotal -70E-1 -7 -> 1
+dqcot407 comparetotal -7.0 -7E+0 -> 1
+dqcot408 comparetotal -7.0 -70E-1 -> 0
+dqcot409 comparetotal -7 -.7E+1 -> 0
+dqcot410 comparetotal -7 -70E-1 -> -1
+
+dqcot420 comparetotal -8.0 -7.0 -> -1
+dqcot421 comparetotal -8.0 -7 -> -1
+dqcot422 comparetotal -8 -7.0 -> -1
+dqcot423 comparetotal -8E+0 -7.0 -> -1
+dqcot424 comparetotal -80E-1 -7.0 -> -1
+dqcot425 comparetotal -.8E+1 -7 -> -1
+dqcot426 comparetotal -80E-1 -7 -> -1
+dqcot427 comparetotal -8.0 -7E+0 -> -1
+dqcot428 comparetotal -8.0 -70E-1 -> -1
+dqcot429 comparetotal -8 -.7E+1 -> -1
+dqcot430 comparetotal -8 -70E-1 -> -1
+
+dqcot440 comparetotal -8.0 -9.0 -> 1
+dqcot441 comparetotal -8.0 -9 -> 1
+dqcot442 comparetotal -8 -9.0 -> 1
+dqcot443 comparetotal -8E+0 -9.0 -> 1
+dqcot444 comparetotal -80E-1 -9.0 -> 1
+dqcot445 comparetotal -.8E+1 -9 -> 1
+dqcot446 comparetotal -80E-1 -9 -> 1
+dqcot447 comparetotal -8.0 -9E+0 -> 1
+dqcot448 comparetotal -8.0 -90E-1 -> 1
+dqcot449 comparetotal -8 -.9E+1 -> 1
+dqcot450 comparetotal -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+dqcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
+dqcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1
+dqcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
+dqcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1
+dqcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
+dqcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1
+dqcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
+dqcot480 comparetotal 123.456000E+89 123.456E+89 -> -1
+dqcot481 comparetotal 123.45600E-89 123.456E-89 -> -1
+dqcot482 comparetotal 123.4560E+89 123.456E+89 -> -1
+dqcot483 comparetotal 123.456E-89 123.456E-89 -> 0
+dqcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1
+dqcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
+dqcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1
+dqcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
+dqcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1
+dqcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
+dqcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1
+dqcot494 comparetotal 123.456E-89 123.456000E-89 -> 1
+dqcot495 comparetotal 123.456E+89 123.45600E+89 -> 1
+dqcot496 comparetotal 123.456E-89 123.4560E-89 -> 1
+dqcot497 comparetotal 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+dqcot498 comparetotal 1 1E-17 -> 1
+dqcot499 comparetotal 1 1E-16 -> 1
+dqcot500 comparetotal 1 1E-15 -> 1
+dqcot501 comparetotal 1 1E-14 -> 1
+dqcot502 comparetotal 1 1E-13 -> 1
+dqcot503 comparetotal 1 1E-12 -> 1
+dqcot504 comparetotal 1 1E-11 -> 1
+dqcot505 comparetotal 1 1E-10 -> 1
+dqcot506 comparetotal 1 1E-9 -> 1
+dqcot507 comparetotal 1 1E-8 -> 1
+dqcot508 comparetotal 1 1E-7 -> 1
+dqcot509 comparetotal 1 1E-6 -> 1
+dqcot510 comparetotal 1 1E-5 -> 1
+dqcot511 comparetotal 1 1E-4 -> 1
+dqcot512 comparetotal 1 1E-3 -> 1
+dqcot513 comparetotal 1 1E-2 -> 1
+dqcot514 comparetotal 1 1E-1 -> 1
+dqcot515 comparetotal 1 1E-0 -> 0
+dqcot516 comparetotal 1 1E+1 -> -1
+dqcot517 comparetotal 1 1E+2 -> -1
+dqcot518 comparetotal 1 1E+3 -> -1
+dqcot519 comparetotal 1 1E+4 -> -1
+dqcot521 comparetotal 1 1E+5 -> -1
+dqcot522 comparetotal 1 1E+6 -> -1
+dqcot523 comparetotal 1 1E+7 -> -1
+dqcot524 comparetotal 1 1E+8 -> -1
+dqcot525 comparetotal 1 1E+9 -> -1
+dqcot526 comparetotal 1 1E+10 -> -1
+dqcot527 comparetotal 1 1E+11 -> -1
+dqcot528 comparetotal 1 1E+12 -> -1
+dqcot529 comparetotal 1 1E+13 -> -1
+dqcot530 comparetotal 1 1E+14 -> -1
+dqcot531 comparetotal 1 1E+15 -> -1
+dqcot532 comparetotal 1 1E+16 -> -1
+dqcot533 comparetotal 1 1E+17 -> -1
+-- LR swap
+dqcot538 comparetotal 1E-17 1 -> -1
+dqcot539 comparetotal 1E-16 1 -> -1
+dqcot540 comparetotal 1E-15 1 -> -1
+dqcot541 comparetotal 1E-14 1 -> -1
+dqcot542 comparetotal 1E-13 1 -> -1
+dqcot543 comparetotal 1E-12 1 -> -1
+dqcot544 comparetotal 1E-11 1 -> -1
+dqcot545 comparetotal 1E-10 1 -> -1
+dqcot546 comparetotal 1E-9 1 -> -1
+dqcot547 comparetotal 1E-8 1 -> -1
+dqcot548 comparetotal 1E-7 1 -> -1
+dqcot549 comparetotal 1E-6 1 -> -1
+dqcot550 comparetotal 1E-5 1 -> -1
+dqcot551 comparetotal 1E-4 1 -> -1
+dqcot552 comparetotal 1E-3 1 -> -1
+dqcot553 comparetotal 1E-2 1 -> -1
+dqcot554 comparetotal 1E-1 1 -> -1
+dqcot555 comparetotal 1E-0 1 -> 0
+dqcot556 comparetotal 1E+1 1 -> 1
+dqcot557 comparetotal 1E+2 1 -> 1
+dqcot558 comparetotal 1E+3 1 -> 1
+dqcot559 comparetotal 1E+4 1 -> 1
+dqcot561 comparetotal 1E+5 1 -> 1
+dqcot562 comparetotal 1E+6 1 -> 1
+dqcot563 comparetotal 1E+7 1 -> 1
+dqcot564 comparetotal 1E+8 1 -> 1
+dqcot565 comparetotal 1E+9 1 -> 1
+dqcot566 comparetotal 1E+10 1 -> 1
+dqcot567 comparetotal 1E+11 1 -> 1
+dqcot568 comparetotal 1E+12 1 -> 1
+dqcot569 comparetotal 1E+13 1 -> 1
+dqcot570 comparetotal 1E+14 1 -> 1
+dqcot571 comparetotal 1E+15 1 -> 1
+dqcot572 comparetotal 1E+16 1 -> 1
+dqcot573 comparetotal 1E+17 1 -> 1
+-- similar with a useful coefficient, one side only
+dqcot578 comparetotal 0.000000987654321 1E-17 -> 1
+dqcot579 comparetotal 0.000000987654321 1E-16 -> 1
+dqcot580 comparetotal 0.000000987654321 1E-15 -> 1
+dqcot581 comparetotal 0.000000987654321 1E-14 -> 1
+dqcot582 comparetotal 0.000000987654321 1E-13 -> 1
+dqcot583 comparetotal 0.000000987654321 1E-12 -> 1
+dqcot584 comparetotal 0.000000987654321 1E-11 -> 1
+dqcot585 comparetotal 0.000000987654321 1E-10 -> 1
+dqcot586 comparetotal 0.000000987654321 1E-9 -> 1
+dqcot587 comparetotal 0.000000987654321 1E-8 -> 1
+dqcot588 comparetotal 0.000000987654321 1E-7 -> 1
+dqcot589 comparetotal 0.000000987654321 1E-6 -> -1
+dqcot590 comparetotal 0.000000987654321 1E-5 -> -1
+dqcot591 comparetotal 0.000000987654321 1E-4 -> -1
+dqcot592 comparetotal 0.000000987654321 1E-3 -> -1
+dqcot593 comparetotal 0.000000987654321 1E-2 -> -1
+dqcot594 comparetotal 0.000000987654321 1E-1 -> -1
+dqcot595 comparetotal 0.000000987654321 1E-0 -> -1
+dqcot596 comparetotal 0.000000987654321 1E+1 -> -1
+dqcot597 comparetotal 0.000000987654321 1E+2 -> -1
+dqcot598 comparetotal 0.000000987654321 1E+3 -> -1
+dqcot599 comparetotal 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+dqcot600 comparetotal 12 12.2345 -> -1
+dqcot601 comparetotal 12.0 12.2345 -> -1
+dqcot602 comparetotal 12.00 12.2345 -> -1
+dqcot603 comparetotal 12.000 12.2345 -> -1
+dqcot604 comparetotal 12.0000 12.2345 -> -1
+dqcot605 comparetotal 12.00000 12.2345 -> -1
+dqcot606 comparetotal 12.000000 12.2345 -> -1
+dqcot607 comparetotal 12.0000000 12.2345 -> -1
+dqcot608 comparetotal 12.00000000 12.2345 -> -1
+dqcot609 comparetotal 12.000000000 12.2345 -> -1
+dqcot610 comparetotal 12.1234 12 -> 1
+dqcot611 comparetotal 12.1234 12.0 -> 1
+dqcot612 comparetotal 12.1234 12.00 -> 1
+dqcot613 comparetotal 12.1234 12.000 -> 1
+dqcot614 comparetotal 12.1234 12.0000 -> 1
+dqcot615 comparetotal 12.1234 12.00000 -> 1
+dqcot616 comparetotal 12.1234 12.000000 -> 1
+dqcot617 comparetotal 12.1234 12.0000000 -> 1
+dqcot618 comparetotal 12.1234 12.00000000 -> 1
+dqcot619 comparetotal 12.1234 12.000000000 -> 1
+dqcot620 comparetotal -12 -12.2345 -> 1
+dqcot621 comparetotal -12.0 -12.2345 -> 1
+dqcot622 comparetotal -12.00 -12.2345 -> 1
+dqcot623 comparetotal -12.000 -12.2345 -> 1
+dqcot624 comparetotal -12.0000 -12.2345 -> 1
+dqcot625 comparetotal -12.00000 -12.2345 -> 1
+dqcot626 comparetotal -12.000000 -12.2345 -> 1
+dqcot627 comparetotal -12.0000000 -12.2345 -> 1
+dqcot628 comparetotal -12.00000000 -12.2345 -> 1
+dqcot629 comparetotal -12.000000000 -12.2345 -> 1
+dqcot630 comparetotal -12.1234 -12 -> -1
+dqcot631 comparetotal -12.1234 -12.0 -> -1
+dqcot632 comparetotal -12.1234 -12.00 -> -1
+dqcot633 comparetotal -12.1234 -12.000 -> -1
+dqcot634 comparetotal -12.1234 -12.0000 -> -1
+dqcot635 comparetotal -12.1234 -12.00000 -> -1
+dqcot636 comparetotal -12.1234 -12.000000 -> -1
+dqcot637 comparetotal -12.1234 -12.0000000 -> -1
+dqcot638 comparetotal -12.1234 -12.00000000 -> -1
+dqcot639 comparetotal -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+dqcot640 comparetotal 0 0 -> 0
+dqcot641 comparetotal 0 -0 -> 1
+dqcot642 comparetotal 0 -0.0 -> 1
+dqcot643 comparetotal 0 0.0 -> 1
+dqcot644 comparetotal -0 0 -> -1
+dqcot645 comparetotal -0 -0 -> 0
+dqcot646 comparetotal -0 -0.0 -> -1
+dqcot647 comparetotal -0 0.0 -> -1
+dqcot648 comparetotal 0.0 0 -> -1
+dqcot649 comparetotal 0.0 -0 -> 1
+dqcot650 comparetotal 0.0 -0.0 -> 1
+dqcot651 comparetotal 0.0 0.0 -> 0
+dqcot652 comparetotal -0.0 0 -> -1
+dqcot653 comparetotal -0.0 -0 -> 1
+dqcot654 comparetotal -0.0 -0.0 -> 0
+dqcot655 comparetotal -0.0 0.0 -> -1
+
+dqcot656 comparetotal -0E1 0.0 -> -1
+dqcot657 comparetotal -0E2 0.0 -> -1
+dqcot658 comparetotal 0E1 0.0 -> 1
+dqcot659 comparetotal 0E2 0.0 -> 1
+dqcot660 comparetotal -0E1 0 -> -1
+dqcot661 comparetotal -0E2 0 -> -1
+dqcot662 comparetotal 0E1 0 -> 1
+dqcot663 comparetotal 0E2 0 -> 1
+dqcot664 comparetotal -0E1 -0E1 -> 0
+dqcot665 comparetotal -0E2 -0E1 -> -1
+dqcot666 comparetotal 0E1 -0E1 -> 1
+dqcot667 comparetotal 0E2 -0E1 -> 1
+dqcot668 comparetotal -0E1 -0E2 -> 1
+dqcot669 comparetotal -0E2 -0E2 -> 0
+dqcot670 comparetotal 0E1 -0E2 -> 1
+dqcot671 comparetotal 0E2 -0E2 -> 1
+dqcot672 comparetotal -0E1 0E1 -> -1
+dqcot673 comparetotal -0E2 0E1 -> -1
+dqcot674 comparetotal 0E1 0E1 -> 0
+dqcot675 comparetotal 0E2 0E1 -> 1
+dqcot676 comparetotal -0E1 0E2 -> -1
+dqcot677 comparetotal -0E2 0E2 -> -1
+dqcot678 comparetotal 0E1 0E2 -> -1
+dqcot679 comparetotal 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+dqcot680 comparetotal 12 12 -> 0
+dqcot681 comparetotal 12 12.0 -> 1
+dqcot682 comparetotal 12 12.00 -> 1
+dqcot683 comparetotal 12 12.000 -> 1
+dqcot684 comparetotal 12 12.0000 -> 1
+dqcot685 comparetotal 12 12.00000 -> 1
+dqcot686 comparetotal 12 12.000000 -> 1
+dqcot687 comparetotal 12 12.0000000 -> 1
+dqcot688 comparetotal 12 12.00000000 -> 1
+dqcot689 comparetotal 12 12.000000000 -> 1
+dqcot690 comparetotal 12 12 -> 0
+dqcot691 comparetotal 12.0 12 -> -1
+dqcot692 comparetotal 12.00 12 -> -1
+dqcot693 comparetotal 12.000 12 -> -1
+dqcot694 comparetotal 12.0000 12 -> -1
+dqcot695 comparetotal 12.00000 12 -> -1
+dqcot696 comparetotal 12.000000 12 -> -1
+dqcot697 comparetotal 12.0000000 12 -> -1
+dqcot698 comparetotal 12.00000000 12 -> -1
+dqcot699 comparetotal 12.000000000 12 -> -1
+
+-- old long operand checks
+dqcot701 comparetotal 12345678000 1 -> 1
+dqcot702 comparetotal 1 12345678000 -> -1
+dqcot703 comparetotal 1234567800 1 -> 1
+dqcot704 comparetotal 1 1234567800 -> -1
+dqcot705 comparetotal 1234567890 1 -> 1
+dqcot706 comparetotal 1 1234567890 -> -1
+dqcot707 comparetotal 1234567891 1 -> 1
+dqcot708 comparetotal 1 1234567891 -> -1
+dqcot709 comparetotal 12345678901 1 -> 1
+dqcot710 comparetotal 1 12345678901 -> -1
+dqcot711 comparetotal 1234567896 1 -> 1
+dqcot712 comparetotal 1 1234567896 -> -1
+dqcot713 comparetotal -1234567891 1 -> -1
+dqcot714 comparetotal 1 -1234567891 -> 1
+dqcot715 comparetotal -12345678901 1 -> -1
+dqcot716 comparetotal 1 -12345678901 -> 1
+dqcot717 comparetotal -1234567896 1 -> -1
+dqcot718 comparetotal 1 -1234567896 -> 1
+
+-- old residue cases
+dqcot740 comparetotal 1 0.9999999 -> 1
+dqcot741 comparetotal 1 0.999999 -> 1
+dqcot742 comparetotal 1 0.99999 -> 1
+dqcot743 comparetotal 1 1.0000 -> 1
+dqcot744 comparetotal 1 1.00001 -> -1
+dqcot745 comparetotal 1 1.000001 -> -1
+dqcot746 comparetotal 1 1.0000001 -> -1
+dqcot750 comparetotal 0.9999999 1 -> -1
+dqcot751 comparetotal 0.999999 1 -> -1
+dqcot752 comparetotal 0.99999 1 -> -1
+dqcot753 comparetotal 1.0000 1 -> -1
+dqcot754 comparetotal 1.00001 1 -> 1
+dqcot755 comparetotal 1.000001 1 -> 1
+dqcot756 comparetotal 1.0000001 1 -> 1
+
+-- Specials
+dqcot780 comparetotal Inf -Inf -> 1
+dqcot781 comparetotal Inf -1000 -> 1
+dqcot782 comparetotal Inf -1 -> 1
+dqcot783 comparetotal Inf -0 -> 1
+dqcot784 comparetotal Inf 0 -> 1
+dqcot785 comparetotal Inf 1 -> 1
+dqcot786 comparetotal Inf 1000 -> 1
+dqcot787 comparetotal Inf Inf -> 0
+dqcot788 comparetotal -1000 Inf -> -1
+dqcot789 comparetotal -Inf Inf -> -1
+dqcot790 comparetotal -1 Inf -> -1
+dqcot791 comparetotal -0 Inf -> -1
+dqcot792 comparetotal 0 Inf -> -1
+dqcot793 comparetotal 1 Inf -> -1
+dqcot794 comparetotal 1000 Inf -> -1
+dqcot795 comparetotal Inf Inf -> 0
+
+dqcot800 comparetotal -Inf -Inf -> 0
+dqcot801 comparetotal -Inf -1000 -> -1
+dqcot802 comparetotal -Inf -1 -> -1
+dqcot803 comparetotal -Inf -0 -> -1
+dqcot804 comparetotal -Inf 0 -> -1
+dqcot805 comparetotal -Inf 1 -> -1
+dqcot806 comparetotal -Inf 1000 -> -1
+dqcot807 comparetotal -Inf Inf -> -1
+dqcot808 comparetotal -Inf -Inf -> 0
+dqcot809 comparetotal -1000 -Inf -> 1
+dqcot810 comparetotal -1 -Inf -> 1
+dqcot811 comparetotal -0 -Inf -> 1
+dqcot812 comparetotal 0 -Inf -> 1
+dqcot813 comparetotal 1 -Inf -> 1
+dqcot814 comparetotal 1000 -Inf -> 1
+dqcot815 comparetotal Inf -Inf -> 1
+
+dqcot821 comparetotal NaN -Inf -> 1
+dqcot822 comparetotal NaN -1000 -> 1
+dqcot823 comparetotal NaN -1 -> 1
+dqcot824 comparetotal NaN -0 -> 1
+dqcot825 comparetotal NaN 0 -> 1
+dqcot826 comparetotal NaN 1 -> 1
+dqcot827 comparetotal NaN 1000 -> 1
+dqcot828 comparetotal NaN Inf -> 1
+dqcot829 comparetotal NaN NaN -> 0
+dqcot830 comparetotal -Inf NaN -> -1
+dqcot831 comparetotal -1000 NaN -> -1
+dqcot832 comparetotal -1 NaN -> -1
+dqcot833 comparetotal -0 NaN -> -1
+dqcot834 comparetotal 0 NaN -> -1
+dqcot835 comparetotal 1 NaN -> -1
+dqcot836 comparetotal 1000 NaN -> -1
+dqcot837 comparetotal Inf NaN -> -1
+dqcot838 comparetotal -NaN -NaN -> 0
+dqcot839 comparetotal +NaN -NaN -> 1
+dqcot840 comparetotal -NaN +NaN -> -1
+
+dqcot841 comparetotal sNaN -sNaN -> 1
+dqcot842 comparetotal sNaN -NaN -> 1
+dqcot843 comparetotal sNaN -Inf -> 1
+dqcot844 comparetotal sNaN -1000 -> 1
+dqcot845 comparetotal sNaN -1 -> 1
+dqcot846 comparetotal sNaN -0 -> 1
+dqcot847 comparetotal sNaN 0 -> 1
+dqcot848 comparetotal sNaN 1 -> 1
+dqcot849 comparetotal sNaN 1000 -> 1
+dqcot850 comparetotal sNaN NaN -> -1
+dqcot851 comparetotal sNaN sNaN -> 0
+
+dqcot852 comparetotal -sNaN sNaN -> -1
+dqcot853 comparetotal -NaN sNaN -> -1
+dqcot854 comparetotal -Inf sNaN -> -1
+dqcot855 comparetotal -1000 sNaN -> -1
+dqcot856 comparetotal -1 sNaN -> -1
+dqcot857 comparetotal -0 sNaN -> -1
+dqcot858 comparetotal 0 sNaN -> -1
+dqcot859 comparetotal 1 sNaN -> -1
+dqcot860 comparetotal 1000 sNaN -> -1
+dqcot861 comparetotal Inf sNaN -> -1
+dqcot862 comparetotal NaN sNaN -> 1
+dqcot863 comparetotal sNaN sNaN -> 0
+
+dqcot871 comparetotal -sNaN -sNaN -> 0
+dqcot872 comparetotal -sNaN -NaN -> 1
+dqcot873 comparetotal -sNaN -Inf -> -1
+dqcot874 comparetotal -sNaN -1000 -> -1
+dqcot875 comparetotal -sNaN -1 -> -1
+dqcot876 comparetotal -sNaN -0 -> -1
+dqcot877 comparetotal -sNaN 0 -> -1
+dqcot878 comparetotal -sNaN 1 -> -1
+dqcot879 comparetotal -sNaN 1000 -> -1
+dqcot880 comparetotal -sNaN NaN -> -1
+dqcot881 comparetotal -sNaN sNaN -> -1
+
+dqcot882 comparetotal -sNaN -sNaN -> 0
+dqcot883 comparetotal -NaN -sNaN -> -1
+dqcot884 comparetotal -Inf -sNaN -> 1
+dqcot885 comparetotal -1000 -sNaN -> 1
+dqcot886 comparetotal -1 -sNaN -> 1
+dqcot887 comparetotal -0 -sNaN -> 1
+dqcot888 comparetotal 0 -sNaN -> 1
+dqcot889 comparetotal 1 -sNaN -> 1
+dqcot890 comparetotal 1000 -sNaN -> 1
+dqcot891 comparetotal Inf -sNaN -> 1
+dqcot892 comparetotal NaN -sNaN -> 1
+dqcot893 comparetotal sNaN -sNaN -> 1
+
+-- NaNs with payload
+dqcot960 comparetotal NaN9 -Inf -> 1
+dqcot961 comparetotal NaN8 999 -> 1
+dqcot962 comparetotal NaN77 Inf -> 1
+dqcot963 comparetotal -NaN67 NaN5 -> -1
+dqcot964 comparetotal -Inf -NaN4 -> 1
+dqcot965 comparetotal -999 -NaN33 -> 1
+dqcot966 comparetotal Inf NaN2 -> -1
+
+dqcot970 comparetotal -NaN41 -NaN42 -> 1
+dqcot971 comparetotal +NaN41 -NaN42 -> 1
+dqcot972 comparetotal -NaN41 +NaN42 -> -1
+dqcot973 comparetotal +NaN41 +NaN42 -> -1
+dqcot974 comparetotal -NaN42 -NaN01 -> -1
+dqcot975 comparetotal +NaN42 -NaN01 -> 1
+dqcot976 comparetotal -NaN42 +NaN01 -> -1
+dqcot977 comparetotal +NaN42 +NaN01 -> 1
+
+dqcot980 comparetotal -sNaN771 -sNaN772 -> 1
+dqcot981 comparetotal +sNaN771 -sNaN772 -> 1
+dqcot982 comparetotal -sNaN771 +sNaN772 -> -1
+dqcot983 comparetotal +sNaN771 +sNaN772 -> -1
+dqcot984 comparetotal -sNaN772 -sNaN771 -> -1
+dqcot985 comparetotal +sNaN772 -sNaN771 -> 1
+dqcot986 comparetotal -sNaN772 +sNaN771 -> -1
+dqcot987 comparetotal +sNaN772 +sNaN771 -> 1
+
+dqcot991 comparetotal -sNaN99 -Inf -> -1
+dqcot992 comparetotal sNaN98 -11 -> 1
+dqcot993 comparetotal sNaN97 NaN -> -1
+dqcot994 comparetotal sNaN16 sNaN94 -> -1
+dqcot995 comparetotal NaN85 sNaN83 -> 1
+dqcot996 comparetotal -Inf sNaN92 -> -1
+dqcot997 comparetotal 088 sNaN81 -> -1
+dqcot998 comparetotal Inf sNaN90 -> -1
+dqcot999 comparetotal NaN -sNaN89 -> 1
+
+-- spread zeros
+dqcot1110 comparetotal 0E-6143 0 -> -1
+dqcot1111 comparetotal 0E-6143 -0 -> 1
+dqcot1112 comparetotal -0E-6143 0 -> -1
+dqcot1113 comparetotal -0E-6143 -0 -> 1
+dqcot1114 comparetotal 0E-6143 0E+6144 -> -1
+dqcot1115 comparetotal 0E-6143 -0E+6144 -> 1
+dqcot1116 comparetotal -0E-6143 0E+6144 -> -1
+dqcot1117 comparetotal -0E-6143 -0E+6144 -> 1
+dqcot1118 comparetotal 0 0E+6144 -> -1
+dqcot1119 comparetotal 0 -0E+6144 -> 1
+dqcot1120 comparetotal -0 0E+6144 -> -1
+dqcot1121 comparetotal -0 -0E+6144 -> 1
+
+dqcot1130 comparetotal 0E+6144 0 -> 1
+dqcot1131 comparetotal 0E+6144 -0 -> 1
+dqcot1132 comparetotal -0E+6144 0 -> -1
+dqcot1133 comparetotal -0E+6144 -0 -> -1
+dqcot1134 comparetotal 0E+6144 0E-6143 -> 1
+dqcot1135 comparetotal 0E+6144 -0E-6143 -> 1
+dqcot1136 comparetotal -0E+6144 0E-6143 -> -1
+dqcot1137 comparetotal -0E+6144 -0E-6143 -> -1
+dqcot1138 comparetotal 0 0E-6143 -> 1
+dqcot1139 comparetotal 0 -0E-6143 -> 1
+dqcot1140 comparetotal -0 0E-6143 -> -1
+dqcot1141 comparetotal -0 -0E-6143 -> -1
+
+-- Null tests
+dqcot9990 comparetotal 10 # -> NaN Invalid_operation
+dqcot9991 comparetotal # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqCompareTotalMag.decTest b/Lib/test/decimaltestdata/dqCompareTotalMag.decTest
index 0b81bfbc24..48b3e086b1 100644
--- a/Lib/test/decimaltestdata/dqCompareTotalMag.decTest
+++ b/Lib/test/decimaltestdata/dqCompareTotalMag.decTest
@@ -1,706 +1,706 @@
-------------------------------------------------------------------------
--- dqCompareTotalMag.decTest -- decQuad comparison; abs. total order --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqctm001 comparetotmag -2 -2 -> 0
-dqctm002 comparetotmag -2 -1 -> 1
-dqctm003 comparetotmag -2 0 -> 1
-dqctm004 comparetotmag -2 1 -> 1
-dqctm005 comparetotmag -2 2 -> 0
-dqctm006 comparetotmag -1 -2 -> -1
-dqctm007 comparetotmag -1 -1 -> 0
-dqctm008 comparetotmag -1 0 -> 1
-dqctm009 comparetotmag -1 1 -> 0
-dqctm010 comparetotmag -1 2 -> -1
-dqctm011 comparetotmag 0 -2 -> -1
-dqctm012 comparetotmag 0 -1 -> -1
-dqctm013 comparetotmag 0 0 -> 0
-dqctm014 comparetotmag 0 1 -> -1
-dqctm015 comparetotmag 0 2 -> -1
-dqctm016 comparetotmag 1 -2 -> -1
-dqctm017 comparetotmag 1 -1 -> 0
-dqctm018 comparetotmag 1 0 -> 1
-dqctm019 comparetotmag 1 1 -> 0
-dqctm020 comparetotmag 1 2 -> -1
-dqctm021 comparetotmag 2 -2 -> 0
-dqctm022 comparetotmag 2 -1 -> 1
-dqctm023 comparetotmag 2 0 -> 1
-dqctm025 comparetotmag 2 1 -> 1
-dqctm026 comparetotmag 2 2 -> 0
-
-dqctm031 comparetotmag -20 -20 -> 0
-dqctm032 comparetotmag -20 -10 -> 1
-dqctm033 comparetotmag -20 00 -> 1
-dqctm034 comparetotmag -20 10 -> 1
-dqctm035 comparetotmag -20 20 -> 0
-dqctm036 comparetotmag -10 -20 -> -1
-dqctm037 comparetotmag -10 -10 -> 0
-dqctm038 comparetotmag -10 00 -> 1
-dqctm039 comparetotmag -10 10 -> 0
-dqctm040 comparetotmag -10 20 -> -1
-dqctm041 comparetotmag 00 -20 -> -1
-dqctm042 comparetotmag 00 -10 -> -1
-dqctm043 comparetotmag 00 00 -> 0
-dqctm044 comparetotmag 00 10 -> -1
-dqctm045 comparetotmag 00 20 -> -1
-dqctm046 comparetotmag 10 -20 -> -1
-dqctm047 comparetotmag 10 -10 -> 0
-dqctm048 comparetotmag 10 00 -> 1
-dqctm049 comparetotmag 10 10 -> 0
-dqctm050 comparetotmag 10 20 -> -1
-dqctm051 comparetotmag 20 -20 -> 0
-dqctm052 comparetotmag 20 -10 -> 1
-dqctm053 comparetotmag 20 00 -> 1
-dqctm055 comparetotmag 20 10 -> 1
-dqctm056 comparetotmag 20 20 -> 0
-
-dqctm061 comparetotmag -2.0 -2.0 -> 0
-dqctm062 comparetotmag -2.0 -1.0 -> 1
-dqctm063 comparetotmag -2.0 0.0 -> 1
-dqctm064 comparetotmag -2.0 1.0 -> 1
-dqctm065 comparetotmag -2.0 2.0 -> 0
-dqctm066 comparetotmag -1.0 -2.0 -> -1
-dqctm067 comparetotmag -1.0 -1.0 -> 0
-dqctm068 comparetotmag -1.0 0.0 -> 1
-dqctm069 comparetotmag -1.0 1.0 -> 0
-dqctm070 comparetotmag -1.0 2.0 -> -1
-dqctm071 comparetotmag 0.0 -2.0 -> -1
-dqctm072 comparetotmag 0.0 -1.0 -> -1
-dqctm073 comparetotmag 0.0 0.0 -> 0
-dqctm074 comparetotmag 0.0 1.0 -> -1
-dqctm075 comparetotmag 0.0 2.0 -> -1
-dqctm076 comparetotmag 1.0 -2.0 -> -1
-dqctm077 comparetotmag 1.0 -1.0 -> 0
-dqctm078 comparetotmag 1.0 0.0 -> 1
-dqctm079 comparetotmag 1.0 1.0 -> 0
-dqctm080 comparetotmag 1.0 2.0 -> -1
-dqctm081 comparetotmag 2.0 -2.0 -> 0
-dqctm082 comparetotmag 2.0 -1.0 -> 1
-dqctm083 comparetotmag 2.0 0.0 -> 1
-dqctm085 comparetotmag 2.0 1.0 -> 1
-dqctm086 comparetotmag 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-dqctm090 comparetotmag 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
-dqctm091 comparetotmag -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
-dqctm092 comparetotmag 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
-dqctm093 comparetotmag -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-dqctm100 comparetotmag 7.0 7.0 -> 0
-dqctm101 comparetotmag 7.0 7 -> -1
-dqctm102 comparetotmag 7 7.0 -> 1
-dqctm103 comparetotmag 7E+0 7.0 -> 1
-dqctm104 comparetotmag 70E-1 7.0 -> 0
-dqctm105 comparetotmag 0.7E+1 7 -> 0
-dqctm106 comparetotmag 70E-1 7 -> -1
-dqctm107 comparetotmag 7.0 7E+0 -> -1
-dqctm108 comparetotmag 7.0 70E-1 -> 0
-dqctm109 comparetotmag 7 0.7E+1 -> 0
-dqctm110 comparetotmag 7 70E-1 -> 1
-
-dqctm120 comparetotmag 8.0 7.0 -> 1
-dqctm121 comparetotmag 8.0 7 -> 1
-dqctm122 comparetotmag 8 7.0 -> 1
-dqctm123 comparetotmag 8E+0 7.0 -> 1
-dqctm124 comparetotmag 80E-1 7.0 -> 1
-dqctm125 comparetotmag 0.8E+1 7 -> 1
-dqctm126 comparetotmag 80E-1 7 -> 1
-dqctm127 comparetotmag 8.0 7E+0 -> 1
-dqctm128 comparetotmag 8.0 70E-1 -> 1
-dqctm129 comparetotmag 8 0.7E+1 -> 1
-dqctm130 comparetotmag 8 70E-1 -> 1
-
-dqctm140 comparetotmag 8.0 9.0 -> -1
-dqctm141 comparetotmag 8.0 9 -> -1
-dqctm142 comparetotmag 8 9.0 -> -1
-dqctm143 comparetotmag 8E+0 9.0 -> -1
-dqctm144 comparetotmag 80E-1 9.0 -> -1
-dqctm145 comparetotmag 0.8E+1 9 -> -1
-dqctm146 comparetotmag 80E-1 9 -> -1
-dqctm147 comparetotmag 8.0 9E+0 -> -1
-dqctm148 comparetotmag 8.0 90E-1 -> -1
-dqctm149 comparetotmag 8 0.9E+1 -> -1
-dqctm150 comparetotmag 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-dqctm200 comparetotmag -7.0 7.0 -> 0
-dqctm201 comparetotmag -7.0 7 -> -1
-dqctm202 comparetotmag -7 7.0 -> 1
-dqctm203 comparetotmag -7E+0 7.0 -> 1
-dqctm204 comparetotmag -70E-1 7.0 -> 0
-dqctm205 comparetotmag -0.7E+1 7 -> 0
-dqctm206 comparetotmag -70E-1 7 -> -1
-dqctm207 comparetotmag -7.0 7E+0 -> -1
-dqctm208 comparetotmag -7.0 70E-1 -> 0
-dqctm209 comparetotmag -7 0.7E+1 -> 0
-dqctm210 comparetotmag -7 70E-1 -> 1
-
-dqctm220 comparetotmag -8.0 7.0 -> 1
-dqctm221 comparetotmag -8.0 7 -> 1
-dqctm222 comparetotmag -8 7.0 -> 1
-dqctm223 comparetotmag -8E+0 7.0 -> 1
-dqctm224 comparetotmag -80E-1 7.0 -> 1
-dqctm225 comparetotmag -0.8E+1 7 -> 1
-dqctm226 comparetotmag -80E-1 7 -> 1
-dqctm227 comparetotmag -8.0 7E+0 -> 1
-dqctm228 comparetotmag -8.0 70E-1 -> 1
-dqctm229 comparetotmag -8 0.7E+1 -> 1
-dqctm230 comparetotmag -8 70E-1 -> 1
-
-dqctm240 comparetotmag -8.0 9.0 -> -1
-dqctm241 comparetotmag -8.0 9 -> -1
-dqctm242 comparetotmag -8 9.0 -> -1
-dqctm243 comparetotmag -8E+0 9.0 -> -1
-dqctm244 comparetotmag -80E-1 9.0 -> -1
-dqctm245 comparetotmag -0.8E+1 9 -> -1
-dqctm246 comparetotmag -80E-1 9 -> -1
-dqctm247 comparetotmag -8.0 9E+0 -> -1
-dqctm248 comparetotmag -8.0 90E-1 -> -1
-dqctm249 comparetotmag -8 0.9E+1 -> -1
-dqctm250 comparetotmag -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-dqctm300 comparetotmag 7.0 -7.0 -> 0
-dqctm301 comparetotmag 7.0 -7 -> -1
-dqctm302 comparetotmag 7 -7.0 -> 1
-dqctm303 comparetotmag 7E+0 -7.0 -> 1
-dqctm304 comparetotmag 70E-1 -7.0 -> 0
-dqctm305 comparetotmag .7E+1 -7 -> 0
-dqctm306 comparetotmag 70E-1 -7 -> -1
-dqctm307 comparetotmag 7.0 -7E+0 -> -1
-dqctm308 comparetotmag 7.0 -70E-1 -> 0
-dqctm309 comparetotmag 7 -.7E+1 -> 0
-dqctm310 comparetotmag 7 -70E-1 -> 1
-
-dqctm320 comparetotmag 8.0 -7.0 -> 1
-dqctm321 comparetotmag 8.0 -7 -> 1
-dqctm322 comparetotmag 8 -7.0 -> 1
-dqctm323 comparetotmag 8E+0 -7.0 -> 1
-dqctm324 comparetotmag 80E-1 -7.0 -> 1
-dqctm325 comparetotmag .8E+1 -7 -> 1
-dqctm326 comparetotmag 80E-1 -7 -> 1
-dqctm327 comparetotmag 8.0 -7E+0 -> 1
-dqctm328 comparetotmag 8.0 -70E-1 -> 1
-dqctm329 comparetotmag 8 -.7E+1 -> 1
-dqctm330 comparetotmag 8 -70E-1 -> 1
-
-dqctm340 comparetotmag 8.0 -9.0 -> -1
-dqctm341 comparetotmag 8.0 -9 -> -1
-dqctm342 comparetotmag 8 -9.0 -> -1
-dqctm343 comparetotmag 8E+0 -9.0 -> -1
-dqctm344 comparetotmag 80E-1 -9.0 -> -1
-dqctm345 comparetotmag .8E+1 -9 -> -1
-dqctm346 comparetotmag 80E-1 -9 -> -1
-dqctm347 comparetotmag 8.0 -9E+0 -> -1
-dqctm348 comparetotmag 8.0 -90E-1 -> -1
-dqctm349 comparetotmag 8 -.9E+1 -> -1
-dqctm350 comparetotmag 8 -90E-1 -> -1
-
--- and again, with sign changes -- ..
-dqctm400 comparetotmag -7.0 -7.0 -> 0
-dqctm401 comparetotmag -7.0 -7 -> -1
-dqctm402 comparetotmag -7 -7.0 -> 1
-dqctm403 comparetotmag -7E+0 -7.0 -> 1
-dqctm404 comparetotmag -70E-1 -7.0 -> 0
-dqctm405 comparetotmag -.7E+1 -7 -> 0
-dqctm406 comparetotmag -70E-1 -7 -> -1
-dqctm407 comparetotmag -7.0 -7E+0 -> -1
-dqctm408 comparetotmag -7.0 -70E-1 -> 0
-dqctm409 comparetotmag -7 -.7E+1 -> 0
-dqctm410 comparetotmag -7 -70E-1 -> 1
-
-dqctm420 comparetotmag -8.0 -7.0 -> 1
-dqctm421 comparetotmag -8.0 -7 -> 1
-dqctm422 comparetotmag -8 -7.0 -> 1
-dqctm423 comparetotmag -8E+0 -7.0 -> 1
-dqctm424 comparetotmag -80E-1 -7.0 -> 1
-dqctm425 comparetotmag -.8E+1 -7 -> 1
-dqctm426 comparetotmag -80E-1 -7 -> 1
-dqctm427 comparetotmag -8.0 -7E+0 -> 1
-dqctm428 comparetotmag -8.0 -70E-1 -> 1
-dqctm429 comparetotmag -8 -.7E+1 -> 1
-dqctm430 comparetotmag -8 -70E-1 -> 1
-
-dqctm440 comparetotmag -8.0 -9.0 -> -1
-dqctm441 comparetotmag -8.0 -9 -> -1
-dqctm442 comparetotmag -8 -9.0 -> -1
-dqctm443 comparetotmag -8E+0 -9.0 -> -1
-dqctm444 comparetotmag -80E-1 -9.0 -> -1
-dqctm445 comparetotmag -.8E+1 -9 -> -1
-dqctm446 comparetotmag -80E-1 -9 -> -1
-dqctm447 comparetotmag -8.0 -9E+0 -> -1
-dqctm448 comparetotmag -8.0 -90E-1 -> -1
-dqctm449 comparetotmag -8 -.9E+1 -> -1
-dqctm450 comparetotmag -8 -90E-1 -> -1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-dqctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
-dqctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
-dqctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
-dqctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
-dqctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
-dqctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
-dqctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
-dqctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
-dqctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
-dqctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
-dqctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
-dqctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
-dqctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
-dqctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
-dqctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
-dqctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
-dqctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
-dqctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
-dqctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
-dqctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
-dqctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
-dqctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-dqctm498 comparetotmag 1 1E-17 -> 1
-dqctm499 comparetotmag 1 1E-16 -> 1
-dqctm500 comparetotmag 1 1E-15 -> 1
-dqctm501 comparetotmag 1 1E-14 -> 1
-dqctm502 comparetotmag 1 1E-13 -> 1
-dqctm503 comparetotmag 1 1E-12 -> 1
-dqctm504 comparetotmag 1 1E-11 -> 1
-dqctm505 comparetotmag 1 1E-10 -> 1
-dqctm506 comparetotmag 1 1E-9 -> 1
-dqctm507 comparetotmag 1 1E-8 -> 1
-dqctm508 comparetotmag 1 1E-7 -> 1
-dqctm509 comparetotmag 1 1E-6 -> 1
-dqctm510 comparetotmag 1 1E-5 -> 1
-dqctm511 comparetotmag 1 1E-4 -> 1
-dqctm512 comparetotmag 1 1E-3 -> 1
-dqctm513 comparetotmag 1 1E-2 -> 1
-dqctm514 comparetotmag 1 1E-1 -> 1
-dqctm515 comparetotmag 1 1E-0 -> 0
-dqctm516 comparetotmag 1 1E+1 -> -1
-dqctm517 comparetotmag 1 1E+2 -> -1
-dqctm518 comparetotmag 1 1E+3 -> -1
-dqctm519 comparetotmag 1 1E+4 -> -1
-dqctm521 comparetotmag 1 1E+5 -> -1
-dqctm522 comparetotmag 1 1E+6 -> -1
-dqctm523 comparetotmag 1 1E+7 -> -1
-dqctm524 comparetotmag 1 1E+8 -> -1
-dqctm525 comparetotmag 1 1E+9 -> -1
-dqctm526 comparetotmag 1 1E+10 -> -1
-dqctm527 comparetotmag 1 1E+11 -> -1
-dqctm528 comparetotmag 1 1E+12 -> -1
-dqctm529 comparetotmag 1 1E+13 -> -1
-dqctm530 comparetotmag 1 1E+14 -> -1
-dqctm531 comparetotmag 1 1E+15 -> -1
-dqctm532 comparetotmag 1 1E+16 -> -1
-dqctm533 comparetotmag 1 1E+17 -> -1
--- LR swap
-dqctm538 comparetotmag 1E-17 1 -> -1
-dqctm539 comparetotmag 1E-16 1 -> -1
-dqctm540 comparetotmag 1E-15 1 -> -1
-dqctm541 comparetotmag 1E-14 1 -> -1
-dqctm542 comparetotmag 1E-13 1 -> -1
-dqctm543 comparetotmag 1E-12 1 -> -1
-dqctm544 comparetotmag 1E-11 1 -> -1
-dqctm545 comparetotmag 1E-10 1 -> -1
-dqctm546 comparetotmag 1E-9 1 -> -1
-dqctm547 comparetotmag 1E-8 1 -> -1
-dqctm548 comparetotmag 1E-7 1 -> -1
-dqctm549 comparetotmag 1E-6 1 -> -1
-dqctm550 comparetotmag 1E-5 1 -> -1
-dqctm551 comparetotmag 1E-4 1 -> -1
-dqctm552 comparetotmag 1E-3 1 -> -1
-dqctm553 comparetotmag 1E-2 1 -> -1
-dqctm554 comparetotmag 1E-1 1 -> -1
-dqctm555 comparetotmag 1E-0 1 -> 0
-dqctm556 comparetotmag 1E+1 1 -> 1
-dqctm557 comparetotmag 1E+2 1 -> 1
-dqctm558 comparetotmag 1E+3 1 -> 1
-dqctm559 comparetotmag 1E+4 1 -> 1
-dqctm561 comparetotmag 1E+5 1 -> 1
-dqctm562 comparetotmag 1E+6 1 -> 1
-dqctm563 comparetotmag 1E+7 1 -> 1
-dqctm564 comparetotmag 1E+8 1 -> 1
-dqctm565 comparetotmag 1E+9 1 -> 1
-dqctm566 comparetotmag 1E+10 1 -> 1
-dqctm567 comparetotmag 1E+11 1 -> 1
-dqctm568 comparetotmag 1E+12 1 -> 1
-dqctm569 comparetotmag 1E+13 1 -> 1
-dqctm570 comparetotmag 1E+14 1 -> 1
-dqctm571 comparetotmag 1E+15 1 -> 1
-dqctm572 comparetotmag 1E+16 1 -> 1
-dqctm573 comparetotmag 1E+17 1 -> 1
--- similar with a useful coefficient, one side only
-dqctm578 comparetotmag 0.000000987654321 1E-17 -> 1
-dqctm579 comparetotmag 0.000000987654321 1E-16 -> 1
-dqctm580 comparetotmag 0.000000987654321 1E-15 -> 1
-dqctm581 comparetotmag 0.000000987654321 1E-14 -> 1
-dqctm582 comparetotmag 0.000000987654321 1E-13 -> 1
-dqctm583 comparetotmag 0.000000987654321 1E-12 -> 1
-dqctm584 comparetotmag 0.000000987654321 1E-11 -> 1
-dqctm585 comparetotmag 0.000000987654321 1E-10 -> 1
-dqctm586 comparetotmag 0.000000987654321 1E-9 -> 1
-dqctm587 comparetotmag 0.000000987654321 1E-8 -> 1
-dqctm588 comparetotmag 0.000000987654321 1E-7 -> 1
-dqctm589 comparetotmag 0.000000987654321 1E-6 -> -1
-dqctm590 comparetotmag 0.000000987654321 1E-5 -> -1
-dqctm591 comparetotmag 0.000000987654321 1E-4 -> -1
-dqctm592 comparetotmag 0.000000987654321 1E-3 -> -1
-dqctm593 comparetotmag 0.000000987654321 1E-2 -> -1
-dqctm594 comparetotmag 0.000000987654321 1E-1 -> -1
-dqctm595 comparetotmag 0.000000987654321 1E-0 -> -1
-dqctm596 comparetotmag 0.000000987654321 1E+1 -> -1
-dqctm597 comparetotmag 0.000000987654321 1E+2 -> -1
-dqctm598 comparetotmag 0.000000987654321 1E+3 -> -1
-dqctm599 comparetotmag 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-dqctm600 comparetotmag 12 12.2345 -> -1
-dqctm601 comparetotmag 12.0 12.2345 -> -1
-dqctm602 comparetotmag 12.00 12.2345 -> -1
-dqctm603 comparetotmag 12.000 12.2345 -> -1
-dqctm604 comparetotmag 12.0000 12.2345 -> -1
-dqctm605 comparetotmag 12.00000 12.2345 -> -1
-dqctm606 comparetotmag 12.000000 12.2345 -> -1
-dqctm607 comparetotmag 12.0000000 12.2345 -> -1
-dqctm608 comparetotmag 12.00000000 12.2345 -> -1
-dqctm609 comparetotmag 12.000000000 12.2345 -> -1
-dqctm610 comparetotmag 12.1234 12 -> 1
-dqctm611 comparetotmag 12.1234 12.0 -> 1
-dqctm612 comparetotmag 12.1234 12.00 -> 1
-dqctm613 comparetotmag 12.1234 12.000 -> 1
-dqctm614 comparetotmag 12.1234 12.0000 -> 1
-dqctm615 comparetotmag 12.1234 12.00000 -> 1
-dqctm616 comparetotmag 12.1234 12.000000 -> 1
-dqctm617 comparetotmag 12.1234 12.0000000 -> 1
-dqctm618 comparetotmag 12.1234 12.00000000 -> 1
-dqctm619 comparetotmag 12.1234 12.000000000 -> 1
-dqctm620 comparetotmag -12 -12.2345 -> -1
-dqctm621 comparetotmag -12.0 -12.2345 -> -1
-dqctm622 comparetotmag -12.00 -12.2345 -> -1
-dqctm623 comparetotmag -12.000 -12.2345 -> -1
-dqctm624 comparetotmag -12.0000 -12.2345 -> -1
-dqctm625 comparetotmag -12.00000 -12.2345 -> -1
-dqctm626 comparetotmag -12.000000 -12.2345 -> -1
-dqctm627 comparetotmag -12.0000000 -12.2345 -> -1
-dqctm628 comparetotmag -12.00000000 -12.2345 -> -1
-dqctm629 comparetotmag -12.000000000 -12.2345 -> -1
-dqctm630 comparetotmag -12.1234 -12 -> 1
-dqctm631 comparetotmag -12.1234 -12.0 -> 1
-dqctm632 comparetotmag -12.1234 -12.00 -> 1
-dqctm633 comparetotmag -12.1234 -12.000 -> 1
-dqctm634 comparetotmag -12.1234 -12.0000 -> 1
-dqctm635 comparetotmag -12.1234 -12.00000 -> 1
-dqctm636 comparetotmag -12.1234 -12.000000 -> 1
-dqctm637 comparetotmag -12.1234 -12.0000000 -> 1
-dqctm638 comparetotmag -12.1234 -12.00000000 -> 1
-dqctm639 comparetotmag -12.1234 -12.000000000 -> 1
-
--- extended zeros
-dqctm640 comparetotmag 0 0 -> 0
-dqctm641 comparetotmag 0 -0 -> 0
-dqctm642 comparetotmag 0 -0.0 -> 1
-dqctm643 comparetotmag 0 0.0 -> 1
-dqctm644 comparetotmag -0 0 -> 0
-dqctm645 comparetotmag -0 -0 -> 0
-dqctm646 comparetotmag -0 -0.0 -> 1
-dqctm647 comparetotmag -0 0.0 -> 1
-dqctm648 comparetotmag 0.0 0 -> -1
-dqctm649 comparetotmag 0.0 -0 -> -1
-dqctm650 comparetotmag 0.0 -0.0 -> 0
-dqctm651 comparetotmag 0.0 0.0 -> 0
-dqctm652 comparetotmag -0.0 0 -> -1
-dqctm653 comparetotmag -0.0 -0 -> -1
-dqctm654 comparetotmag -0.0 -0.0 -> 0
-dqctm655 comparetotmag -0.0 0.0 -> 0
-
-dqctm656 comparetotmag -0E1 0.0 -> 1
-dqctm657 comparetotmag -0E2 0.0 -> 1
-dqctm658 comparetotmag 0E1 0.0 -> 1
-dqctm659 comparetotmag 0E2 0.0 -> 1
-dqctm660 comparetotmag -0E1 0 -> 1
-dqctm661 comparetotmag -0E2 0 -> 1
-dqctm662 comparetotmag 0E1 0 -> 1
-dqctm663 comparetotmag 0E2 0 -> 1
-dqctm664 comparetotmag -0E1 -0E1 -> 0
-dqctm665 comparetotmag -0E2 -0E1 -> 1
-dqctm666 comparetotmag 0E1 -0E1 -> 0
-dqctm667 comparetotmag 0E2 -0E1 -> 1
-dqctm668 comparetotmag -0E1 -0E2 -> -1
-dqctm669 comparetotmag -0E2 -0E2 -> 0
-dqctm670 comparetotmag 0E1 -0E2 -> -1
-dqctm671 comparetotmag 0E2 -0E2 -> 0
-dqctm672 comparetotmag -0E1 0E1 -> 0
-dqctm673 comparetotmag -0E2 0E1 -> 1
-dqctm674 comparetotmag 0E1 0E1 -> 0
-dqctm675 comparetotmag 0E2 0E1 -> 1
-dqctm676 comparetotmag -0E1 0E2 -> -1
-dqctm677 comparetotmag -0E2 0E2 -> 0
-dqctm678 comparetotmag 0E1 0E2 -> -1
-dqctm679 comparetotmag 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-dqctm680 comparetotmag 12 12 -> 0
-dqctm681 comparetotmag 12 12.0 -> 1
-dqctm682 comparetotmag 12 12.00 -> 1
-dqctm683 comparetotmag 12 12.000 -> 1
-dqctm684 comparetotmag 12 12.0000 -> 1
-dqctm685 comparetotmag 12 12.00000 -> 1
-dqctm686 comparetotmag 12 12.000000 -> 1
-dqctm687 comparetotmag 12 12.0000000 -> 1
-dqctm688 comparetotmag 12 12.00000000 -> 1
-dqctm689 comparetotmag 12 12.000000000 -> 1
-dqctm690 comparetotmag 12 12 -> 0
-dqctm691 comparetotmag 12.0 12 -> -1
-dqctm692 comparetotmag 12.00 12 -> -1
-dqctm693 comparetotmag 12.000 12 -> -1
-dqctm694 comparetotmag 12.0000 12 -> -1
-dqctm695 comparetotmag 12.00000 12 -> -1
-dqctm696 comparetotmag 12.000000 12 -> -1
-dqctm697 comparetotmag 12.0000000 12 -> -1
-dqctm698 comparetotmag 12.00000000 12 -> -1
-dqctm699 comparetotmag 12.000000000 12 -> -1
-
--- old long operand checks
-dqctm701 comparetotmag 12345678000 1 -> 1
-dqctm702 comparetotmag 1 12345678000 -> -1
-dqctm703 comparetotmag 1234567800 1 -> 1
-dqctm704 comparetotmag 1 1234567800 -> -1
-dqctm705 comparetotmag 1234567890 1 -> 1
-dqctm706 comparetotmag 1 1234567890 -> -1
-dqctm707 comparetotmag 1234567891 1 -> 1
-dqctm708 comparetotmag 1 1234567891 -> -1
-dqctm709 comparetotmag 12345678901 1 -> 1
-dqctm710 comparetotmag 1 12345678901 -> -1
-dqctm711 comparetotmag 1234567896 1 -> 1
-dqctm712 comparetotmag 1 1234567896 -> -1
-dqctm713 comparetotmag -1234567891 1 -> 1
-dqctm714 comparetotmag 1 -1234567891 -> -1
-dqctm715 comparetotmag -12345678901 1 -> 1
-dqctm716 comparetotmag 1 -12345678901 -> -1
-dqctm717 comparetotmag -1234567896 1 -> 1
-dqctm718 comparetotmag 1 -1234567896 -> -1
-
--- old residue cases
-dqctm740 comparetotmag 1 0.9999999 -> 1
-dqctm741 comparetotmag 1 0.999999 -> 1
-dqctm742 comparetotmag 1 0.99999 -> 1
-dqctm743 comparetotmag 1 1.0000 -> 1
-dqctm744 comparetotmag 1 1.00001 -> -1
-dqctm745 comparetotmag 1 1.000001 -> -1
-dqctm746 comparetotmag 1 1.0000001 -> -1
-dqctm750 comparetotmag 0.9999999 1 -> -1
-dqctm751 comparetotmag 0.999999 1 -> -1
-dqctm752 comparetotmag 0.99999 1 -> -1
-dqctm753 comparetotmag 1.0000 1 -> -1
-dqctm754 comparetotmag 1.00001 1 -> 1
-dqctm755 comparetotmag 1.000001 1 -> 1
-dqctm756 comparetotmag 1.0000001 1 -> 1
-
--- Specials
-dqctm780 comparetotmag Inf -Inf -> 0
-dqctm781 comparetotmag Inf -1000 -> 1
-dqctm782 comparetotmag Inf -1 -> 1
-dqctm783 comparetotmag Inf -0 -> 1
-dqctm784 comparetotmag Inf 0 -> 1
-dqctm785 comparetotmag Inf 1 -> 1
-dqctm786 comparetotmag Inf 1000 -> 1
-dqctm787 comparetotmag Inf Inf -> 0
-dqctm788 comparetotmag -1000 Inf -> -1
-dqctm789 comparetotmag -Inf Inf -> 0
-dqctm790 comparetotmag -1 Inf -> -1
-dqctm791 comparetotmag -0 Inf -> -1
-dqctm792 comparetotmag 0 Inf -> -1
-dqctm793 comparetotmag 1 Inf -> -1
-dqctm794 comparetotmag 1000 Inf -> -1
-dqctm795 comparetotmag Inf Inf -> 0
-
-dqctm800 comparetotmag -Inf -Inf -> 0
-dqctm801 comparetotmag -Inf -1000 -> 1
-dqctm802 comparetotmag -Inf -1 -> 1
-dqctm803 comparetotmag -Inf -0 -> 1
-dqctm804 comparetotmag -Inf 0 -> 1
-dqctm805 comparetotmag -Inf 1 -> 1
-dqctm806 comparetotmag -Inf 1000 -> 1
-dqctm807 comparetotmag -Inf Inf -> 0
-dqctm808 comparetotmag -Inf -Inf -> 0
-dqctm809 comparetotmag -1000 -Inf -> -1
-dqctm810 comparetotmag -1 -Inf -> -1
-dqctm811 comparetotmag -0 -Inf -> -1
-dqctm812 comparetotmag 0 -Inf -> -1
-dqctm813 comparetotmag 1 -Inf -> -1
-dqctm814 comparetotmag 1000 -Inf -> -1
-dqctm815 comparetotmag Inf -Inf -> 0
-
-dqctm821 comparetotmag NaN -Inf -> 1
-dqctm822 comparetotmag NaN -1000 -> 1
-dqctm823 comparetotmag NaN -1 -> 1
-dqctm824 comparetotmag NaN -0 -> 1
-dqctm825 comparetotmag NaN 0 -> 1
-dqctm826 comparetotmag NaN 1 -> 1
-dqctm827 comparetotmag NaN 1000 -> 1
-dqctm828 comparetotmag NaN Inf -> 1
-dqctm829 comparetotmag NaN NaN -> 0
-dqctm830 comparetotmag -Inf NaN -> -1
-dqctm831 comparetotmag -1000 NaN -> -1
-dqctm832 comparetotmag -1 NaN -> -1
-dqctm833 comparetotmag -0 NaN -> -1
-dqctm834 comparetotmag 0 NaN -> -1
-dqctm835 comparetotmag 1 NaN -> -1
-dqctm836 comparetotmag 1000 NaN -> -1
-dqctm837 comparetotmag Inf NaN -> -1
-dqctm838 comparetotmag -NaN -NaN -> 0
-dqctm839 comparetotmag +NaN -NaN -> 0
-dqctm840 comparetotmag -NaN +NaN -> 0
-
-dqctm841 comparetotmag sNaN -sNaN -> 0
-dqctm842 comparetotmag sNaN -NaN -> -1
-dqctm843 comparetotmag sNaN -Inf -> 1
-dqctm844 comparetotmag sNaN -1000 -> 1
-dqctm845 comparetotmag sNaN -1 -> 1
-dqctm846 comparetotmag sNaN -0 -> 1
-dqctm847 comparetotmag sNaN 0 -> 1
-dqctm848 comparetotmag sNaN 1 -> 1
-dqctm849 comparetotmag sNaN 1000 -> 1
-dqctm850 comparetotmag sNaN NaN -> -1
-dqctm851 comparetotmag sNaN sNaN -> 0
-
-dqctm852 comparetotmag -sNaN sNaN -> 0
-dqctm853 comparetotmag -NaN sNaN -> 1
-dqctm854 comparetotmag -Inf sNaN -> -1
-dqctm855 comparetotmag -1000 sNaN -> -1
-dqctm856 comparetotmag -1 sNaN -> -1
-dqctm857 comparetotmag -0 sNaN -> -1
-dqctm858 comparetotmag 0 sNaN -> -1
-dqctm859 comparetotmag 1 sNaN -> -1
-dqctm860 comparetotmag 1000 sNaN -> -1
-dqctm861 comparetotmag Inf sNaN -> -1
-dqctm862 comparetotmag NaN sNaN -> 1
-dqctm863 comparetotmag sNaN sNaN -> 0
-
-dqctm871 comparetotmag -sNaN -sNaN -> 0
-dqctm872 comparetotmag -sNaN -NaN -> -1
-dqctm873 comparetotmag -sNaN -Inf -> 1
-dqctm874 comparetotmag -sNaN -1000 -> 1
-dqctm875 comparetotmag -sNaN -1 -> 1
-dqctm876 comparetotmag -sNaN -0 -> 1
-dqctm877 comparetotmag -sNaN 0 -> 1
-dqctm878 comparetotmag -sNaN 1 -> 1
-dqctm879 comparetotmag -sNaN 1000 -> 1
-dqctm880 comparetotmag -sNaN NaN -> -1
-dqctm881 comparetotmag -sNaN sNaN -> 0
-
-dqctm882 comparetotmag -sNaN -sNaN -> 0
-dqctm883 comparetotmag -NaN -sNaN -> 1
-dqctm884 comparetotmag -Inf -sNaN -> -1
-dqctm885 comparetotmag -1000 -sNaN -> -1
-dqctm886 comparetotmag -1 -sNaN -> -1
-dqctm887 comparetotmag -0 -sNaN -> -1
-dqctm888 comparetotmag 0 -sNaN -> -1
-dqctm889 comparetotmag 1 -sNaN -> -1
-dqctm890 comparetotmag 1000 -sNaN -> -1
-dqctm891 comparetotmag Inf -sNaN -> -1
-dqctm892 comparetotmag NaN -sNaN -> 1
-dqctm893 comparetotmag sNaN -sNaN -> 0
-
--- NaNs with payload
-dqctm960 comparetotmag NaN9 -Inf -> 1
-dqctm961 comparetotmag NaN8 999 -> 1
-dqctm962 comparetotmag NaN77 Inf -> 1
-dqctm963 comparetotmag -NaN67 NaN5 -> 1
-dqctm964 comparetotmag -Inf -NaN4 -> -1
-dqctm965 comparetotmag -999 -NaN33 -> -1
-dqctm966 comparetotmag Inf NaN2 -> -1
-
-dqctm970 comparetotmag -NaN41 -NaN42 -> -1
-dqctm971 comparetotmag +NaN41 -NaN42 -> -1
-dqctm972 comparetotmag -NaN41 +NaN42 -> -1
-dqctm973 comparetotmag +NaN41 +NaN42 -> -1
-dqctm974 comparetotmag -NaN42 -NaN01 -> 1
-dqctm975 comparetotmag +NaN42 -NaN01 -> 1
-dqctm976 comparetotmag -NaN42 +NaN01 -> 1
-dqctm977 comparetotmag +NaN42 +NaN01 -> 1
-
-dqctm980 comparetotmag -sNaN771 -sNaN772 -> -1
-dqctm981 comparetotmag +sNaN771 -sNaN772 -> -1
-dqctm982 comparetotmag -sNaN771 +sNaN772 -> -1
-dqctm983 comparetotmag +sNaN771 +sNaN772 -> -1
-dqctm984 comparetotmag -sNaN772 -sNaN771 -> 1
-dqctm985 comparetotmag +sNaN772 -sNaN771 -> 1
-dqctm986 comparetotmag -sNaN772 +sNaN771 -> 1
-dqctm987 comparetotmag +sNaN772 +sNaN771 -> 1
-
-dqctm991 comparetotmag -sNaN99 -Inf -> 1
-dqctm992 comparetotmag sNaN98 -11 -> 1
-dqctm993 comparetotmag sNaN97 NaN -> -1
-dqctm994 comparetotmag sNaN16 sNaN94 -> -1
-dqctm995 comparetotmag NaN85 sNaN83 -> 1
-dqctm996 comparetotmag -Inf sNaN92 -> -1
-dqctm997 comparetotmag 088 sNaN81 -> -1
-dqctm998 comparetotmag Inf sNaN90 -> -1
-dqctm999 comparetotmag NaN -sNaN89 -> 1
-
--- spread zeros
-dqctm1110 comparetotmag 0E-6143 0 -> -1
-dqctm1111 comparetotmag 0E-6143 -0 -> -1
-dqctm1112 comparetotmag -0E-6143 0 -> -1
-dqctm1113 comparetotmag -0E-6143 -0 -> -1
-dqctm1114 comparetotmag 0E-6143 0E+6144 -> -1
-dqctm1115 comparetotmag 0E-6143 -0E+6144 -> -1
-dqctm1116 comparetotmag -0E-6143 0E+6144 -> -1
-dqctm1117 comparetotmag -0E-6143 -0E+6144 -> -1
-dqctm1118 comparetotmag 0 0E+6144 -> -1
-dqctm1119 comparetotmag 0 -0E+6144 -> -1
-dqctm1120 comparetotmag -0 0E+6144 -> -1
-dqctm1121 comparetotmag -0 -0E+6144 -> -1
-
-dqctm1130 comparetotmag 0E+6144 0 -> 1
-dqctm1131 comparetotmag 0E+6144 -0 -> 1
-dqctm1132 comparetotmag -0E+6144 0 -> 1
-dqctm1133 comparetotmag -0E+6144 -0 -> 1
-dqctm1134 comparetotmag 0E+6144 0E-6143 -> 1
-dqctm1135 comparetotmag 0E+6144 -0E-6143 -> 1
-dqctm1136 comparetotmag -0E+6144 0E-6143 -> 1
-dqctm1137 comparetotmag -0E+6144 -0E-6143 -> 1
-dqctm1138 comparetotmag 0 0E-6143 -> 1
-dqctm1139 comparetotmag 0 -0E-6143 -> 1
-dqctm1140 comparetotmag -0 0E-6143 -> 1
-dqctm1141 comparetotmag -0 -0E-6143 -> 1
-
--- Null tests
-dqctm9990 comparetotmag 10 # -> NaN Invalid_operation
-dqctm9991 comparetotmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqCompareTotalMag.decTest -- decQuad comparison; abs. total order --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqctm001 comparetotmag -2 -2 -> 0
+dqctm002 comparetotmag -2 -1 -> 1
+dqctm003 comparetotmag -2 0 -> 1
+dqctm004 comparetotmag -2 1 -> 1
+dqctm005 comparetotmag -2 2 -> 0
+dqctm006 comparetotmag -1 -2 -> -1
+dqctm007 comparetotmag -1 -1 -> 0
+dqctm008 comparetotmag -1 0 -> 1
+dqctm009 comparetotmag -1 1 -> 0
+dqctm010 comparetotmag -1 2 -> -1
+dqctm011 comparetotmag 0 -2 -> -1
+dqctm012 comparetotmag 0 -1 -> -1
+dqctm013 comparetotmag 0 0 -> 0
+dqctm014 comparetotmag 0 1 -> -1
+dqctm015 comparetotmag 0 2 -> -1
+dqctm016 comparetotmag 1 -2 -> -1
+dqctm017 comparetotmag 1 -1 -> 0
+dqctm018 comparetotmag 1 0 -> 1
+dqctm019 comparetotmag 1 1 -> 0
+dqctm020 comparetotmag 1 2 -> -1
+dqctm021 comparetotmag 2 -2 -> 0
+dqctm022 comparetotmag 2 -1 -> 1
+dqctm023 comparetotmag 2 0 -> 1
+dqctm025 comparetotmag 2 1 -> 1
+dqctm026 comparetotmag 2 2 -> 0
+
+dqctm031 comparetotmag -20 -20 -> 0
+dqctm032 comparetotmag -20 -10 -> 1
+dqctm033 comparetotmag -20 00 -> 1
+dqctm034 comparetotmag -20 10 -> 1
+dqctm035 comparetotmag -20 20 -> 0
+dqctm036 comparetotmag -10 -20 -> -1
+dqctm037 comparetotmag -10 -10 -> 0
+dqctm038 comparetotmag -10 00 -> 1
+dqctm039 comparetotmag -10 10 -> 0
+dqctm040 comparetotmag -10 20 -> -1
+dqctm041 comparetotmag 00 -20 -> -1
+dqctm042 comparetotmag 00 -10 -> -1
+dqctm043 comparetotmag 00 00 -> 0
+dqctm044 comparetotmag 00 10 -> -1
+dqctm045 comparetotmag 00 20 -> -1
+dqctm046 comparetotmag 10 -20 -> -1
+dqctm047 comparetotmag 10 -10 -> 0
+dqctm048 comparetotmag 10 00 -> 1
+dqctm049 comparetotmag 10 10 -> 0
+dqctm050 comparetotmag 10 20 -> -1
+dqctm051 comparetotmag 20 -20 -> 0
+dqctm052 comparetotmag 20 -10 -> 1
+dqctm053 comparetotmag 20 00 -> 1
+dqctm055 comparetotmag 20 10 -> 1
+dqctm056 comparetotmag 20 20 -> 0
+
+dqctm061 comparetotmag -2.0 -2.0 -> 0
+dqctm062 comparetotmag -2.0 -1.0 -> 1
+dqctm063 comparetotmag -2.0 0.0 -> 1
+dqctm064 comparetotmag -2.0 1.0 -> 1
+dqctm065 comparetotmag -2.0 2.0 -> 0
+dqctm066 comparetotmag -1.0 -2.0 -> -1
+dqctm067 comparetotmag -1.0 -1.0 -> 0
+dqctm068 comparetotmag -1.0 0.0 -> 1
+dqctm069 comparetotmag -1.0 1.0 -> 0
+dqctm070 comparetotmag -1.0 2.0 -> -1
+dqctm071 comparetotmag 0.0 -2.0 -> -1
+dqctm072 comparetotmag 0.0 -1.0 -> -1
+dqctm073 comparetotmag 0.0 0.0 -> 0
+dqctm074 comparetotmag 0.0 1.0 -> -1
+dqctm075 comparetotmag 0.0 2.0 -> -1
+dqctm076 comparetotmag 1.0 -2.0 -> -1
+dqctm077 comparetotmag 1.0 -1.0 -> 0
+dqctm078 comparetotmag 1.0 0.0 -> 1
+dqctm079 comparetotmag 1.0 1.0 -> 0
+dqctm080 comparetotmag 1.0 2.0 -> -1
+dqctm081 comparetotmag 2.0 -2.0 -> 0
+dqctm082 comparetotmag 2.0 -1.0 -> 1
+dqctm083 comparetotmag 2.0 0.0 -> 1
+dqctm085 comparetotmag 2.0 1.0 -> 1
+dqctm086 comparetotmag 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+dqctm090 comparetotmag 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
+dqctm091 comparetotmag -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
+dqctm092 comparetotmag 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
+dqctm093 comparetotmag -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+dqctm100 comparetotmag 7.0 7.0 -> 0
+dqctm101 comparetotmag 7.0 7 -> -1
+dqctm102 comparetotmag 7 7.0 -> 1
+dqctm103 comparetotmag 7E+0 7.0 -> 1
+dqctm104 comparetotmag 70E-1 7.0 -> 0
+dqctm105 comparetotmag 0.7E+1 7 -> 0
+dqctm106 comparetotmag 70E-1 7 -> -1
+dqctm107 comparetotmag 7.0 7E+0 -> -1
+dqctm108 comparetotmag 7.0 70E-1 -> 0
+dqctm109 comparetotmag 7 0.7E+1 -> 0
+dqctm110 comparetotmag 7 70E-1 -> 1
+
+dqctm120 comparetotmag 8.0 7.0 -> 1
+dqctm121 comparetotmag 8.0 7 -> 1
+dqctm122 comparetotmag 8 7.0 -> 1
+dqctm123 comparetotmag 8E+0 7.0 -> 1
+dqctm124 comparetotmag 80E-1 7.0 -> 1
+dqctm125 comparetotmag 0.8E+1 7 -> 1
+dqctm126 comparetotmag 80E-1 7 -> 1
+dqctm127 comparetotmag 8.0 7E+0 -> 1
+dqctm128 comparetotmag 8.0 70E-1 -> 1
+dqctm129 comparetotmag 8 0.7E+1 -> 1
+dqctm130 comparetotmag 8 70E-1 -> 1
+
+dqctm140 comparetotmag 8.0 9.0 -> -1
+dqctm141 comparetotmag 8.0 9 -> -1
+dqctm142 comparetotmag 8 9.0 -> -1
+dqctm143 comparetotmag 8E+0 9.0 -> -1
+dqctm144 comparetotmag 80E-1 9.0 -> -1
+dqctm145 comparetotmag 0.8E+1 9 -> -1
+dqctm146 comparetotmag 80E-1 9 -> -1
+dqctm147 comparetotmag 8.0 9E+0 -> -1
+dqctm148 comparetotmag 8.0 90E-1 -> -1
+dqctm149 comparetotmag 8 0.9E+1 -> -1
+dqctm150 comparetotmag 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+dqctm200 comparetotmag -7.0 7.0 -> 0
+dqctm201 comparetotmag -7.0 7 -> -1
+dqctm202 comparetotmag -7 7.0 -> 1
+dqctm203 comparetotmag -7E+0 7.0 -> 1
+dqctm204 comparetotmag -70E-1 7.0 -> 0
+dqctm205 comparetotmag -0.7E+1 7 -> 0
+dqctm206 comparetotmag -70E-1 7 -> -1
+dqctm207 comparetotmag -7.0 7E+0 -> -1
+dqctm208 comparetotmag -7.0 70E-1 -> 0
+dqctm209 comparetotmag -7 0.7E+1 -> 0
+dqctm210 comparetotmag -7 70E-1 -> 1
+
+dqctm220 comparetotmag -8.0 7.0 -> 1
+dqctm221 comparetotmag -8.0 7 -> 1
+dqctm222 comparetotmag -8 7.0 -> 1
+dqctm223 comparetotmag -8E+0 7.0 -> 1
+dqctm224 comparetotmag -80E-1 7.0 -> 1
+dqctm225 comparetotmag -0.8E+1 7 -> 1
+dqctm226 comparetotmag -80E-1 7 -> 1
+dqctm227 comparetotmag -8.0 7E+0 -> 1
+dqctm228 comparetotmag -8.0 70E-1 -> 1
+dqctm229 comparetotmag -8 0.7E+1 -> 1
+dqctm230 comparetotmag -8 70E-1 -> 1
+
+dqctm240 comparetotmag -8.0 9.0 -> -1
+dqctm241 comparetotmag -8.0 9 -> -1
+dqctm242 comparetotmag -8 9.0 -> -1
+dqctm243 comparetotmag -8E+0 9.0 -> -1
+dqctm244 comparetotmag -80E-1 9.0 -> -1
+dqctm245 comparetotmag -0.8E+1 9 -> -1
+dqctm246 comparetotmag -80E-1 9 -> -1
+dqctm247 comparetotmag -8.0 9E+0 -> -1
+dqctm248 comparetotmag -8.0 90E-1 -> -1
+dqctm249 comparetotmag -8 0.9E+1 -> -1
+dqctm250 comparetotmag -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+dqctm300 comparetotmag 7.0 -7.0 -> 0
+dqctm301 comparetotmag 7.0 -7 -> -1
+dqctm302 comparetotmag 7 -7.0 -> 1
+dqctm303 comparetotmag 7E+0 -7.0 -> 1
+dqctm304 comparetotmag 70E-1 -7.0 -> 0
+dqctm305 comparetotmag .7E+1 -7 -> 0
+dqctm306 comparetotmag 70E-1 -7 -> -1
+dqctm307 comparetotmag 7.0 -7E+0 -> -1
+dqctm308 comparetotmag 7.0 -70E-1 -> 0
+dqctm309 comparetotmag 7 -.7E+1 -> 0
+dqctm310 comparetotmag 7 -70E-1 -> 1
+
+dqctm320 comparetotmag 8.0 -7.0 -> 1
+dqctm321 comparetotmag 8.0 -7 -> 1
+dqctm322 comparetotmag 8 -7.0 -> 1
+dqctm323 comparetotmag 8E+0 -7.0 -> 1
+dqctm324 comparetotmag 80E-1 -7.0 -> 1
+dqctm325 comparetotmag .8E+1 -7 -> 1
+dqctm326 comparetotmag 80E-1 -7 -> 1
+dqctm327 comparetotmag 8.0 -7E+0 -> 1
+dqctm328 comparetotmag 8.0 -70E-1 -> 1
+dqctm329 comparetotmag 8 -.7E+1 -> 1
+dqctm330 comparetotmag 8 -70E-1 -> 1
+
+dqctm340 comparetotmag 8.0 -9.0 -> -1
+dqctm341 comparetotmag 8.0 -9 -> -1
+dqctm342 comparetotmag 8 -9.0 -> -1
+dqctm343 comparetotmag 8E+0 -9.0 -> -1
+dqctm344 comparetotmag 80E-1 -9.0 -> -1
+dqctm345 comparetotmag .8E+1 -9 -> -1
+dqctm346 comparetotmag 80E-1 -9 -> -1
+dqctm347 comparetotmag 8.0 -9E+0 -> -1
+dqctm348 comparetotmag 8.0 -90E-1 -> -1
+dqctm349 comparetotmag 8 -.9E+1 -> -1
+dqctm350 comparetotmag 8 -90E-1 -> -1
+
+-- and again, with sign changes -- ..
+dqctm400 comparetotmag -7.0 -7.0 -> 0
+dqctm401 comparetotmag -7.0 -7 -> -1
+dqctm402 comparetotmag -7 -7.0 -> 1
+dqctm403 comparetotmag -7E+0 -7.0 -> 1
+dqctm404 comparetotmag -70E-1 -7.0 -> 0
+dqctm405 comparetotmag -.7E+1 -7 -> 0
+dqctm406 comparetotmag -70E-1 -7 -> -1
+dqctm407 comparetotmag -7.0 -7E+0 -> -1
+dqctm408 comparetotmag -7.0 -70E-1 -> 0
+dqctm409 comparetotmag -7 -.7E+1 -> 0
+dqctm410 comparetotmag -7 -70E-1 -> 1
+
+dqctm420 comparetotmag -8.0 -7.0 -> 1
+dqctm421 comparetotmag -8.0 -7 -> 1
+dqctm422 comparetotmag -8 -7.0 -> 1
+dqctm423 comparetotmag -8E+0 -7.0 -> 1
+dqctm424 comparetotmag -80E-1 -7.0 -> 1
+dqctm425 comparetotmag -.8E+1 -7 -> 1
+dqctm426 comparetotmag -80E-1 -7 -> 1
+dqctm427 comparetotmag -8.0 -7E+0 -> 1
+dqctm428 comparetotmag -8.0 -70E-1 -> 1
+dqctm429 comparetotmag -8 -.7E+1 -> 1
+dqctm430 comparetotmag -8 -70E-1 -> 1
+
+dqctm440 comparetotmag -8.0 -9.0 -> -1
+dqctm441 comparetotmag -8.0 -9 -> -1
+dqctm442 comparetotmag -8 -9.0 -> -1
+dqctm443 comparetotmag -8E+0 -9.0 -> -1
+dqctm444 comparetotmag -80E-1 -9.0 -> -1
+dqctm445 comparetotmag -.8E+1 -9 -> -1
+dqctm446 comparetotmag -80E-1 -9 -> -1
+dqctm447 comparetotmag -8.0 -9E+0 -> -1
+dqctm448 comparetotmag -8.0 -90E-1 -> -1
+dqctm449 comparetotmag -8 -.9E+1 -> -1
+dqctm450 comparetotmag -8 -90E-1 -> -1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+dqctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
+dqctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
+dqctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
+dqctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
+dqctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
+dqctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
+dqctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
+dqctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
+dqctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
+dqctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
+dqctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
+dqctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
+dqctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
+dqctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
+dqctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
+dqctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
+dqctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
+dqctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
+dqctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
+dqctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
+dqctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
+dqctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+dqctm498 comparetotmag 1 1E-17 -> 1
+dqctm499 comparetotmag 1 1E-16 -> 1
+dqctm500 comparetotmag 1 1E-15 -> 1
+dqctm501 comparetotmag 1 1E-14 -> 1
+dqctm502 comparetotmag 1 1E-13 -> 1
+dqctm503 comparetotmag 1 1E-12 -> 1
+dqctm504 comparetotmag 1 1E-11 -> 1
+dqctm505 comparetotmag 1 1E-10 -> 1
+dqctm506 comparetotmag 1 1E-9 -> 1
+dqctm507 comparetotmag 1 1E-8 -> 1
+dqctm508 comparetotmag 1 1E-7 -> 1
+dqctm509 comparetotmag 1 1E-6 -> 1
+dqctm510 comparetotmag 1 1E-5 -> 1
+dqctm511 comparetotmag 1 1E-4 -> 1
+dqctm512 comparetotmag 1 1E-3 -> 1
+dqctm513 comparetotmag 1 1E-2 -> 1
+dqctm514 comparetotmag 1 1E-1 -> 1
+dqctm515 comparetotmag 1 1E-0 -> 0
+dqctm516 comparetotmag 1 1E+1 -> -1
+dqctm517 comparetotmag 1 1E+2 -> -1
+dqctm518 comparetotmag 1 1E+3 -> -1
+dqctm519 comparetotmag 1 1E+4 -> -1
+dqctm521 comparetotmag 1 1E+5 -> -1
+dqctm522 comparetotmag 1 1E+6 -> -1
+dqctm523 comparetotmag 1 1E+7 -> -1
+dqctm524 comparetotmag 1 1E+8 -> -1
+dqctm525 comparetotmag 1 1E+9 -> -1
+dqctm526 comparetotmag 1 1E+10 -> -1
+dqctm527 comparetotmag 1 1E+11 -> -1
+dqctm528 comparetotmag 1 1E+12 -> -1
+dqctm529 comparetotmag 1 1E+13 -> -1
+dqctm530 comparetotmag 1 1E+14 -> -1
+dqctm531 comparetotmag 1 1E+15 -> -1
+dqctm532 comparetotmag 1 1E+16 -> -1
+dqctm533 comparetotmag 1 1E+17 -> -1
+-- LR swap
+dqctm538 comparetotmag 1E-17 1 -> -1
+dqctm539 comparetotmag 1E-16 1 -> -1
+dqctm540 comparetotmag 1E-15 1 -> -1
+dqctm541 comparetotmag 1E-14 1 -> -1
+dqctm542 comparetotmag 1E-13 1 -> -1
+dqctm543 comparetotmag 1E-12 1 -> -1
+dqctm544 comparetotmag 1E-11 1 -> -1
+dqctm545 comparetotmag 1E-10 1 -> -1
+dqctm546 comparetotmag 1E-9 1 -> -1
+dqctm547 comparetotmag 1E-8 1 -> -1
+dqctm548 comparetotmag 1E-7 1 -> -1
+dqctm549 comparetotmag 1E-6 1 -> -1
+dqctm550 comparetotmag 1E-5 1 -> -1
+dqctm551 comparetotmag 1E-4 1 -> -1
+dqctm552 comparetotmag 1E-3 1 -> -1
+dqctm553 comparetotmag 1E-2 1 -> -1
+dqctm554 comparetotmag 1E-1 1 -> -1
+dqctm555 comparetotmag 1E-0 1 -> 0
+dqctm556 comparetotmag 1E+1 1 -> 1
+dqctm557 comparetotmag 1E+2 1 -> 1
+dqctm558 comparetotmag 1E+3 1 -> 1
+dqctm559 comparetotmag 1E+4 1 -> 1
+dqctm561 comparetotmag 1E+5 1 -> 1
+dqctm562 comparetotmag 1E+6 1 -> 1
+dqctm563 comparetotmag 1E+7 1 -> 1
+dqctm564 comparetotmag 1E+8 1 -> 1
+dqctm565 comparetotmag 1E+9 1 -> 1
+dqctm566 comparetotmag 1E+10 1 -> 1
+dqctm567 comparetotmag 1E+11 1 -> 1
+dqctm568 comparetotmag 1E+12 1 -> 1
+dqctm569 comparetotmag 1E+13 1 -> 1
+dqctm570 comparetotmag 1E+14 1 -> 1
+dqctm571 comparetotmag 1E+15 1 -> 1
+dqctm572 comparetotmag 1E+16 1 -> 1
+dqctm573 comparetotmag 1E+17 1 -> 1
+-- similar with a useful coefficient, one side only
+dqctm578 comparetotmag 0.000000987654321 1E-17 -> 1
+dqctm579 comparetotmag 0.000000987654321 1E-16 -> 1
+dqctm580 comparetotmag 0.000000987654321 1E-15 -> 1
+dqctm581 comparetotmag 0.000000987654321 1E-14 -> 1
+dqctm582 comparetotmag 0.000000987654321 1E-13 -> 1
+dqctm583 comparetotmag 0.000000987654321 1E-12 -> 1
+dqctm584 comparetotmag 0.000000987654321 1E-11 -> 1
+dqctm585 comparetotmag 0.000000987654321 1E-10 -> 1
+dqctm586 comparetotmag 0.000000987654321 1E-9 -> 1
+dqctm587 comparetotmag 0.000000987654321 1E-8 -> 1
+dqctm588 comparetotmag 0.000000987654321 1E-7 -> 1
+dqctm589 comparetotmag 0.000000987654321 1E-6 -> -1
+dqctm590 comparetotmag 0.000000987654321 1E-5 -> -1
+dqctm591 comparetotmag 0.000000987654321 1E-4 -> -1
+dqctm592 comparetotmag 0.000000987654321 1E-3 -> -1
+dqctm593 comparetotmag 0.000000987654321 1E-2 -> -1
+dqctm594 comparetotmag 0.000000987654321 1E-1 -> -1
+dqctm595 comparetotmag 0.000000987654321 1E-0 -> -1
+dqctm596 comparetotmag 0.000000987654321 1E+1 -> -1
+dqctm597 comparetotmag 0.000000987654321 1E+2 -> -1
+dqctm598 comparetotmag 0.000000987654321 1E+3 -> -1
+dqctm599 comparetotmag 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+dqctm600 comparetotmag 12 12.2345 -> -1
+dqctm601 comparetotmag 12.0 12.2345 -> -1
+dqctm602 comparetotmag 12.00 12.2345 -> -1
+dqctm603 comparetotmag 12.000 12.2345 -> -1
+dqctm604 comparetotmag 12.0000 12.2345 -> -1
+dqctm605 comparetotmag 12.00000 12.2345 -> -1
+dqctm606 comparetotmag 12.000000 12.2345 -> -1
+dqctm607 comparetotmag 12.0000000 12.2345 -> -1
+dqctm608 comparetotmag 12.00000000 12.2345 -> -1
+dqctm609 comparetotmag 12.000000000 12.2345 -> -1
+dqctm610 comparetotmag 12.1234 12 -> 1
+dqctm611 comparetotmag 12.1234 12.0 -> 1
+dqctm612 comparetotmag 12.1234 12.00 -> 1
+dqctm613 comparetotmag 12.1234 12.000 -> 1
+dqctm614 comparetotmag 12.1234 12.0000 -> 1
+dqctm615 comparetotmag 12.1234 12.00000 -> 1
+dqctm616 comparetotmag 12.1234 12.000000 -> 1
+dqctm617 comparetotmag 12.1234 12.0000000 -> 1
+dqctm618 comparetotmag 12.1234 12.00000000 -> 1
+dqctm619 comparetotmag 12.1234 12.000000000 -> 1
+dqctm620 comparetotmag -12 -12.2345 -> -1
+dqctm621 comparetotmag -12.0 -12.2345 -> -1
+dqctm622 comparetotmag -12.00 -12.2345 -> -1
+dqctm623 comparetotmag -12.000 -12.2345 -> -1
+dqctm624 comparetotmag -12.0000 -12.2345 -> -1
+dqctm625 comparetotmag -12.00000 -12.2345 -> -1
+dqctm626 comparetotmag -12.000000 -12.2345 -> -1
+dqctm627 comparetotmag -12.0000000 -12.2345 -> -1
+dqctm628 comparetotmag -12.00000000 -12.2345 -> -1
+dqctm629 comparetotmag -12.000000000 -12.2345 -> -1
+dqctm630 comparetotmag -12.1234 -12 -> 1
+dqctm631 comparetotmag -12.1234 -12.0 -> 1
+dqctm632 comparetotmag -12.1234 -12.00 -> 1
+dqctm633 comparetotmag -12.1234 -12.000 -> 1
+dqctm634 comparetotmag -12.1234 -12.0000 -> 1
+dqctm635 comparetotmag -12.1234 -12.00000 -> 1
+dqctm636 comparetotmag -12.1234 -12.000000 -> 1
+dqctm637 comparetotmag -12.1234 -12.0000000 -> 1
+dqctm638 comparetotmag -12.1234 -12.00000000 -> 1
+dqctm639 comparetotmag -12.1234 -12.000000000 -> 1
+
+-- extended zeros
+dqctm640 comparetotmag 0 0 -> 0
+dqctm641 comparetotmag 0 -0 -> 0
+dqctm642 comparetotmag 0 -0.0 -> 1
+dqctm643 comparetotmag 0 0.0 -> 1
+dqctm644 comparetotmag -0 0 -> 0
+dqctm645 comparetotmag -0 -0 -> 0
+dqctm646 comparetotmag -0 -0.0 -> 1
+dqctm647 comparetotmag -0 0.0 -> 1
+dqctm648 comparetotmag 0.0 0 -> -1
+dqctm649 comparetotmag 0.0 -0 -> -1
+dqctm650 comparetotmag 0.0 -0.0 -> 0
+dqctm651 comparetotmag 0.0 0.0 -> 0
+dqctm652 comparetotmag -0.0 0 -> -1
+dqctm653 comparetotmag -0.0 -0 -> -1
+dqctm654 comparetotmag -0.0 -0.0 -> 0
+dqctm655 comparetotmag -0.0 0.0 -> 0
+
+dqctm656 comparetotmag -0E1 0.0 -> 1
+dqctm657 comparetotmag -0E2 0.0 -> 1
+dqctm658 comparetotmag 0E1 0.0 -> 1
+dqctm659 comparetotmag 0E2 0.0 -> 1
+dqctm660 comparetotmag -0E1 0 -> 1
+dqctm661 comparetotmag -0E2 0 -> 1
+dqctm662 comparetotmag 0E1 0 -> 1
+dqctm663 comparetotmag 0E2 0 -> 1
+dqctm664 comparetotmag -0E1 -0E1 -> 0
+dqctm665 comparetotmag -0E2 -0E1 -> 1
+dqctm666 comparetotmag 0E1 -0E1 -> 0
+dqctm667 comparetotmag 0E2 -0E1 -> 1
+dqctm668 comparetotmag -0E1 -0E2 -> -1
+dqctm669 comparetotmag -0E2 -0E2 -> 0
+dqctm670 comparetotmag 0E1 -0E2 -> -1
+dqctm671 comparetotmag 0E2 -0E2 -> 0
+dqctm672 comparetotmag -0E1 0E1 -> 0
+dqctm673 comparetotmag -0E2 0E1 -> 1
+dqctm674 comparetotmag 0E1 0E1 -> 0
+dqctm675 comparetotmag 0E2 0E1 -> 1
+dqctm676 comparetotmag -0E1 0E2 -> -1
+dqctm677 comparetotmag -0E2 0E2 -> 0
+dqctm678 comparetotmag 0E1 0E2 -> -1
+dqctm679 comparetotmag 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+dqctm680 comparetotmag 12 12 -> 0
+dqctm681 comparetotmag 12 12.0 -> 1
+dqctm682 comparetotmag 12 12.00 -> 1
+dqctm683 comparetotmag 12 12.000 -> 1
+dqctm684 comparetotmag 12 12.0000 -> 1
+dqctm685 comparetotmag 12 12.00000 -> 1
+dqctm686 comparetotmag 12 12.000000 -> 1
+dqctm687 comparetotmag 12 12.0000000 -> 1
+dqctm688 comparetotmag 12 12.00000000 -> 1
+dqctm689 comparetotmag 12 12.000000000 -> 1
+dqctm690 comparetotmag 12 12 -> 0
+dqctm691 comparetotmag 12.0 12 -> -1
+dqctm692 comparetotmag 12.00 12 -> -1
+dqctm693 comparetotmag 12.000 12 -> -1
+dqctm694 comparetotmag 12.0000 12 -> -1
+dqctm695 comparetotmag 12.00000 12 -> -1
+dqctm696 comparetotmag 12.000000 12 -> -1
+dqctm697 comparetotmag 12.0000000 12 -> -1
+dqctm698 comparetotmag 12.00000000 12 -> -1
+dqctm699 comparetotmag 12.000000000 12 -> -1
+
+-- old long operand checks
+dqctm701 comparetotmag 12345678000 1 -> 1
+dqctm702 comparetotmag 1 12345678000 -> -1
+dqctm703 comparetotmag 1234567800 1 -> 1
+dqctm704 comparetotmag 1 1234567800 -> -1
+dqctm705 comparetotmag 1234567890 1 -> 1
+dqctm706 comparetotmag 1 1234567890 -> -1
+dqctm707 comparetotmag 1234567891 1 -> 1
+dqctm708 comparetotmag 1 1234567891 -> -1
+dqctm709 comparetotmag 12345678901 1 -> 1
+dqctm710 comparetotmag 1 12345678901 -> -1
+dqctm711 comparetotmag 1234567896 1 -> 1
+dqctm712 comparetotmag 1 1234567896 -> -1
+dqctm713 comparetotmag -1234567891 1 -> 1
+dqctm714 comparetotmag 1 -1234567891 -> -1
+dqctm715 comparetotmag -12345678901 1 -> 1
+dqctm716 comparetotmag 1 -12345678901 -> -1
+dqctm717 comparetotmag -1234567896 1 -> 1
+dqctm718 comparetotmag 1 -1234567896 -> -1
+
+-- old residue cases
+dqctm740 comparetotmag 1 0.9999999 -> 1
+dqctm741 comparetotmag 1 0.999999 -> 1
+dqctm742 comparetotmag 1 0.99999 -> 1
+dqctm743 comparetotmag 1 1.0000 -> 1
+dqctm744 comparetotmag 1 1.00001 -> -1
+dqctm745 comparetotmag 1 1.000001 -> -1
+dqctm746 comparetotmag 1 1.0000001 -> -1
+dqctm750 comparetotmag 0.9999999 1 -> -1
+dqctm751 comparetotmag 0.999999 1 -> -1
+dqctm752 comparetotmag 0.99999 1 -> -1
+dqctm753 comparetotmag 1.0000 1 -> -1
+dqctm754 comparetotmag 1.00001 1 -> 1
+dqctm755 comparetotmag 1.000001 1 -> 1
+dqctm756 comparetotmag 1.0000001 1 -> 1
+
+-- Specials
+dqctm780 comparetotmag Inf -Inf -> 0
+dqctm781 comparetotmag Inf -1000 -> 1
+dqctm782 comparetotmag Inf -1 -> 1
+dqctm783 comparetotmag Inf -0 -> 1
+dqctm784 comparetotmag Inf 0 -> 1
+dqctm785 comparetotmag Inf 1 -> 1
+dqctm786 comparetotmag Inf 1000 -> 1
+dqctm787 comparetotmag Inf Inf -> 0
+dqctm788 comparetotmag -1000 Inf -> -1
+dqctm789 comparetotmag -Inf Inf -> 0
+dqctm790 comparetotmag -1 Inf -> -1
+dqctm791 comparetotmag -0 Inf -> -1
+dqctm792 comparetotmag 0 Inf -> -1
+dqctm793 comparetotmag 1 Inf -> -1
+dqctm794 comparetotmag 1000 Inf -> -1
+dqctm795 comparetotmag Inf Inf -> 0
+
+dqctm800 comparetotmag -Inf -Inf -> 0
+dqctm801 comparetotmag -Inf -1000 -> 1
+dqctm802 comparetotmag -Inf -1 -> 1
+dqctm803 comparetotmag -Inf -0 -> 1
+dqctm804 comparetotmag -Inf 0 -> 1
+dqctm805 comparetotmag -Inf 1 -> 1
+dqctm806 comparetotmag -Inf 1000 -> 1
+dqctm807 comparetotmag -Inf Inf -> 0
+dqctm808 comparetotmag -Inf -Inf -> 0
+dqctm809 comparetotmag -1000 -Inf -> -1
+dqctm810 comparetotmag -1 -Inf -> -1
+dqctm811 comparetotmag -0 -Inf -> -1
+dqctm812 comparetotmag 0 -Inf -> -1
+dqctm813 comparetotmag 1 -Inf -> -1
+dqctm814 comparetotmag 1000 -Inf -> -1
+dqctm815 comparetotmag Inf -Inf -> 0
+
+dqctm821 comparetotmag NaN -Inf -> 1
+dqctm822 comparetotmag NaN -1000 -> 1
+dqctm823 comparetotmag NaN -1 -> 1
+dqctm824 comparetotmag NaN -0 -> 1
+dqctm825 comparetotmag NaN 0 -> 1
+dqctm826 comparetotmag NaN 1 -> 1
+dqctm827 comparetotmag NaN 1000 -> 1
+dqctm828 comparetotmag NaN Inf -> 1
+dqctm829 comparetotmag NaN NaN -> 0
+dqctm830 comparetotmag -Inf NaN -> -1
+dqctm831 comparetotmag -1000 NaN -> -1
+dqctm832 comparetotmag -1 NaN -> -1
+dqctm833 comparetotmag -0 NaN -> -1
+dqctm834 comparetotmag 0 NaN -> -1
+dqctm835 comparetotmag 1 NaN -> -1
+dqctm836 comparetotmag 1000 NaN -> -1
+dqctm837 comparetotmag Inf NaN -> -1
+dqctm838 comparetotmag -NaN -NaN -> 0
+dqctm839 comparetotmag +NaN -NaN -> 0
+dqctm840 comparetotmag -NaN +NaN -> 0
+
+dqctm841 comparetotmag sNaN -sNaN -> 0
+dqctm842 comparetotmag sNaN -NaN -> -1
+dqctm843 comparetotmag sNaN -Inf -> 1
+dqctm844 comparetotmag sNaN -1000 -> 1
+dqctm845 comparetotmag sNaN -1 -> 1
+dqctm846 comparetotmag sNaN -0 -> 1
+dqctm847 comparetotmag sNaN 0 -> 1
+dqctm848 comparetotmag sNaN 1 -> 1
+dqctm849 comparetotmag sNaN 1000 -> 1
+dqctm850 comparetotmag sNaN NaN -> -1
+dqctm851 comparetotmag sNaN sNaN -> 0
+
+dqctm852 comparetotmag -sNaN sNaN -> 0
+dqctm853 comparetotmag -NaN sNaN -> 1
+dqctm854 comparetotmag -Inf sNaN -> -1
+dqctm855 comparetotmag -1000 sNaN -> -1
+dqctm856 comparetotmag -1 sNaN -> -1
+dqctm857 comparetotmag -0 sNaN -> -1
+dqctm858 comparetotmag 0 sNaN -> -1
+dqctm859 comparetotmag 1 sNaN -> -1
+dqctm860 comparetotmag 1000 sNaN -> -1
+dqctm861 comparetotmag Inf sNaN -> -1
+dqctm862 comparetotmag NaN sNaN -> 1
+dqctm863 comparetotmag sNaN sNaN -> 0
+
+dqctm871 comparetotmag -sNaN -sNaN -> 0
+dqctm872 comparetotmag -sNaN -NaN -> -1
+dqctm873 comparetotmag -sNaN -Inf -> 1
+dqctm874 comparetotmag -sNaN -1000 -> 1
+dqctm875 comparetotmag -sNaN -1 -> 1
+dqctm876 comparetotmag -sNaN -0 -> 1
+dqctm877 comparetotmag -sNaN 0 -> 1
+dqctm878 comparetotmag -sNaN 1 -> 1
+dqctm879 comparetotmag -sNaN 1000 -> 1
+dqctm880 comparetotmag -sNaN NaN -> -1
+dqctm881 comparetotmag -sNaN sNaN -> 0
+
+dqctm882 comparetotmag -sNaN -sNaN -> 0
+dqctm883 comparetotmag -NaN -sNaN -> 1
+dqctm884 comparetotmag -Inf -sNaN -> -1
+dqctm885 comparetotmag -1000 -sNaN -> -1
+dqctm886 comparetotmag -1 -sNaN -> -1
+dqctm887 comparetotmag -0 -sNaN -> -1
+dqctm888 comparetotmag 0 -sNaN -> -1
+dqctm889 comparetotmag 1 -sNaN -> -1
+dqctm890 comparetotmag 1000 -sNaN -> -1
+dqctm891 comparetotmag Inf -sNaN -> -1
+dqctm892 comparetotmag NaN -sNaN -> 1
+dqctm893 comparetotmag sNaN -sNaN -> 0
+
+-- NaNs with payload
+dqctm960 comparetotmag NaN9 -Inf -> 1
+dqctm961 comparetotmag NaN8 999 -> 1
+dqctm962 comparetotmag NaN77 Inf -> 1
+dqctm963 comparetotmag -NaN67 NaN5 -> 1
+dqctm964 comparetotmag -Inf -NaN4 -> -1
+dqctm965 comparetotmag -999 -NaN33 -> -1
+dqctm966 comparetotmag Inf NaN2 -> -1
+
+dqctm970 comparetotmag -NaN41 -NaN42 -> -1
+dqctm971 comparetotmag +NaN41 -NaN42 -> -1
+dqctm972 comparetotmag -NaN41 +NaN42 -> -1
+dqctm973 comparetotmag +NaN41 +NaN42 -> -1
+dqctm974 comparetotmag -NaN42 -NaN01 -> 1
+dqctm975 comparetotmag +NaN42 -NaN01 -> 1
+dqctm976 comparetotmag -NaN42 +NaN01 -> 1
+dqctm977 comparetotmag +NaN42 +NaN01 -> 1
+
+dqctm980 comparetotmag -sNaN771 -sNaN772 -> -1
+dqctm981 comparetotmag +sNaN771 -sNaN772 -> -1
+dqctm982 comparetotmag -sNaN771 +sNaN772 -> -1
+dqctm983 comparetotmag +sNaN771 +sNaN772 -> -1
+dqctm984 comparetotmag -sNaN772 -sNaN771 -> 1
+dqctm985 comparetotmag +sNaN772 -sNaN771 -> 1
+dqctm986 comparetotmag -sNaN772 +sNaN771 -> 1
+dqctm987 comparetotmag +sNaN772 +sNaN771 -> 1
+
+dqctm991 comparetotmag -sNaN99 -Inf -> 1
+dqctm992 comparetotmag sNaN98 -11 -> 1
+dqctm993 comparetotmag sNaN97 NaN -> -1
+dqctm994 comparetotmag sNaN16 sNaN94 -> -1
+dqctm995 comparetotmag NaN85 sNaN83 -> 1
+dqctm996 comparetotmag -Inf sNaN92 -> -1
+dqctm997 comparetotmag 088 sNaN81 -> -1
+dqctm998 comparetotmag Inf sNaN90 -> -1
+dqctm999 comparetotmag NaN -sNaN89 -> 1
+
+-- spread zeros
+dqctm1110 comparetotmag 0E-6143 0 -> -1
+dqctm1111 comparetotmag 0E-6143 -0 -> -1
+dqctm1112 comparetotmag -0E-6143 0 -> -1
+dqctm1113 comparetotmag -0E-6143 -0 -> -1
+dqctm1114 comparetotmag 0E-6143 0E+6144 -> -1
+dqctm1115 comparetotmag 0E-6143 -0E+6144 -> -1
+dqctm1116 comparetotmag -0E-6143 0E+6144 -> -1
+dqctm1117 comparetotmag -0E-6143 -0E+6144 -> -1
+dqctm1118 comparetotmag 0 0E+6144 -> -1
+dqctm1119 comparetotmag 0 -0E+6144 -> -1
+dqctm1120 comparetotmag -0 0E+6144 -> -1
+dqctm1121 comparetotmag -0 -0E+6144 -> -1
+
+dqctm1130 comparetotmag 0E+6144 0 -> 1
+dqctm1131 comparetotmag 0E+6144 -0 -> 1
+dqctm1132 comparetotmag -0E+6144 0 -> 1
+dqctm1133 comparetotmag -0E+6144 -0 -> 1
+dqctm1134 comparetotmag 0E+6144 0E-6143 -> 1
+dqctm1135 comparetotmag 0E+6144 -0E-6143 -> 1
+dqctm1136 comparetotmag -0E+6144 0E-6143 -> 1
+dqctm1137 comparetotmag -0E+6144 -0E-6143 -> 1
+dqctm1138 comparetotmag 0 0E-6143 -> 1
+dqctm1139 comparetotmag 0 -0E-6143 -> 1
+dqctm1140 comparetotmag -0 0E-6143 -> 1
+dqctm1141 comparetotmag -0 -0E-6143 -> 1
+
+-- Null tests
+dqctm9990 comparetotmag 10 # -> NaN Invalid_operation
+dqctm9991 comparetotmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqCopy.decTest b/Lib/test/decimaltestdata/dqCopy.decTest
index 0c6243158f..7254d68bb7 100644
--- a/Lib/test/decimaltestdata/dqCopy.decTest
+++ b/Lib/test/decimaltestdata/dqCopy.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqCopy.decTest -- quiet decQuad copy --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqcpy001 copy +7.50 -> 7.50
-
--- Infinities
-dqcpy011 copy Infinity -> Infinity
-dqcpy012 copy -Infinity -> -Infinity
-
--- NaNs, 0 payload
-dqcpy021 copy NaN -> NaN
-dqcpy022 copy -NaN -> -NaN
-dqcpy023 copy sNaN -> sNaN
-dqcpy024 copy -sNaN -> -sNaN
-
--- NaNs, non-0 payload
-dqcpy031 copy NaN10 -> NaN10
-dqcpy032 copy -NaN10 -> -NaN10
-dqcpy033 copy sNaN10 -> sNaN10
-dqcpy034 copy -sNaN10 -> -sNaN10
-dqcpy035 copy NaN7 -> NaN7
-dqcpy036 copy -NaN7 -> -NaN7
-dqcpy037 copy sNaN101 -> sNaN101
-dqcpy038 copy -sNaN101 -> -sNaN101
-
--- finites
-dqcpy101 copy 7 -> 7
-dqcpy102 copy -7 -> -7
-dqcpy103 copy 75 -> 75
-dqcpy104 copy -75 -> -75
-dqcpy105 copy 7.50 -> 7.50
-dqcpy106 copy -7.50 -> -7.50
-dqcpy107 copy 7.500 -> 7.500
-dqcpy108 copy -7.500 -> -7.500
-
--- zeros
-dqcpy111 copy 0 -> 0
-dqcpy112 copy -0 -> -0
-dqcpy113 copy 0E+4 -> 0E+4
-dqcpy114 copy -0E+4 -> -0E+4
-dqcpy115 copy 0.0000 -> 0.0000
-dqcpy116 copy -0.0000 -> -0.0000
-dqcpy117 copy 0E-141 -> 0E-141
-dqcpy118 copy -0E-141 -> -0E-141
-
--- full coefficients, alternating bits
-dqcpy121 copy 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqcpy122 copy -2682682682682682682682682682682682 -> -2682682682682682682682682682682682
-dqcpy123 copy 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-dqcpy124 copy -1341341341341341341341341341341341 -> -1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcpy131 copy 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqcpy132 copy 1E-6143 -> 1E-6143
-dqcpy133 copy 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqcpy134 copy 1E-6176 -> 1E-6176
-
-dqcpy135 copy -1E-6176 -> -1E-6176
-dqcpy136 copy -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqcpy137 copy -1E-6143 -> -1E-6143
-dqcpy138 copy -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqCopy.decTest -- quiet decQuad copy --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqcpy001 copy +7.50 -> 7.50
+
+-- Infinities
+dqcpy011 copy Infinity -> Infinity
+dqcpy012 copy -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+dqcpy021 copy NaN -> NaN
+dqcpy022 copy -NaN -> -NaN
+dqcpy023 copy sNaN -> sNaN
+dqcpy024 copy -sNaN -> -sNaN
+
+-- NaNs, non-0 payload
+dqcpy031 copy NaN10 -> NaN10
+dqcpy032 copy -NaN10 -> -NaN10
+dqcpy033 copy sNaN10 -> sNaN10
+dqcpy034 copy -sNaN10 -> -sNaN10
+dqcpy035 copy NaN7 -> NaN7
+dqcpy036 copy -NaN7 -> -NaN7
+dqcpy037 copy sNaN101 -> sNaN101
+dqcpy038 copy -sNaN101 -> -sNaN101
+
+-- finites
+dqcpy101 copy 7 -> 7
+dqcpy102 copy -7 -> -7
+dqcpy103 copy 75 -> 75
+dqcpy104 copy -75 -> -75
+dqcpy105 copy 7.50 -> 7.50
+dqcpy106 copy -7.50 -> -7.50
+dqcpy107 copy 7.500 -> 7.500
+dqcpy108 copy -7.500 -> -7.500
+
+-- zeros
+dqcpy111 copy 0 -> 0
+dqcpy112 copy -0 -> -0
+dqcpy113 copy 0E+4 -> 0E+4
+dqcpy114 copy -0E+4 -> -0E+4
+dqcpy115 copy 0.0000 -> 0.0000
+dqcpy116 copy -0.0000 -> -0.0000
+dqcpy117 copy 0E-141 -> 0E-141
+dqcpy118 copy -0E-141 -> -0E-141
+
+-- full coefficients, alternating bits
+dqcpy121 copy 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqcpy122 copy -2682682682682682682682682682682682 -> -2682682682682682682682682682682682
+dqcpy123 copy 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+dqcpy124 copy -1341341341341341341341341341341341 -> -1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcpy131 copy 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqcpy132 copy 1E-6143 -> 1E-6143
+dqcpy133 copy 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqcpy134 copy 1E-6176 -> 1E-6176
+
+dqcpy135 copy -1E-6176 -> -1E-6176
+dqcpy136 copy -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqcpy137 copy -1E-6143 -> -1E-6143
+dqcpy138 copy -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqCopyAbs.decTest b/Lib/test/decimaltestdata/dqCopyAbs.decTest
index 16bcb4eaed..bdec0206de 100644
--- a/Lib/test/decimaltestdata/dqCopyAbs.decTest
+++ b/Lib/test/decimaltestdata/dqCopyAbs.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqCopyAbs.decTest -- quiet decQuad copy and set sign to zero --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqcpa001 copyabs +7.50 -> 7.50
-
--- Infinities
-dqcpa011 copyabs Infinity -> Infinity
-dqcpa012 copyabs -Infinity -> Infinity
-
--- NaNs, 0 payload
-dqcpa021 copyabs NaN -> NaN
-dqcpa022 copyabs -NaN -> NaN
-dqcpa023 copyabs sNaN -> sNaN
-dqcpa024 copyabs -sNaN -> sNaN
-
--- NaNs, non-0 payload
-dqcpa031 copyabs NaN10 -> NaN10
-dqcpa032 copyabs -NaN15 -> NaN15
-dqcpa033 copyabs sNaN15 -> sNaN15
-dqcpa034 copyabs -sNaN10 -> sNaN10
-dqcpa035 copyabs NaN7 -> NaN7
-dqcpa036 copyabs -NaN7 -> NaN7
-dqcpa037 copyabs sNaN101 -> sNaN101
-dqcpa038 copyabs -sNaN101 -> sNaN101
-
--- finites
-dqcpa101 copyabs 7 -> 7
-dqcpa102 copyabs -7 -> 7
-dqcpa103 copyabs 75 -> 75
-dqcpa104 copyabs -75 -> 75
-dqcpa105 copyabs 7.10 -> 7.10
-dqcpa106 copyabs -7.10 -> 7.10
-dqcpa107 copyabs 7.500 -> 7.500
-dqcpa108 copyabs -7.500 -> 7.500
-
--- zeros
-dqcpa111 copyabs 0 -> 0
-dqcpa112 copyabs -0 -> 0
-dqcpa113 copyabs 0E+6 -> 0E+6
-dqcpa114 copyabs -0E+6 -> 0E+6
-dqcpa115 copyabs 0.0000 -> 0.0000
-dqcpa116 copyabs -0.0000 -> 0.0000
-dqcpa117 copyabs 0E-141 -> 0E-141
-dqcpa118 copyabs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqcpa121 copyabs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqcpa122 copyabs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqcpa123 copyabs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-dqcpa124 copyabs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcpa131 copyabs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqcpa132 copyabs 1E-6143 -> 1E-6143
-dqcpa133 copyabs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqcpa134 copyabs 1E-6176 -> 1E-6176
-
-dqcpa135 copyabs -1E-6176 -> 1E-6176
-dqcpa136 copyabs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqcpa137 copyabs -1E-6143 -> 1E-6143
-dqcpa138 copyabs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqCopyAbs.decTest -- quiet decQuad copy and set sign to zero --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqcpa001 copyabs +7.50 -> 7.50
+
+-- Infinities
+dqcpa011 copyabs Infinity -> Infinity
+dqcpa012 copyabs -Infinity -> Infinity
+
+-- NaNs, 0 payload
+dqcpa021 copyabs NaN -> NaN
+dqcpa022 copyabs -NaN -> NaN
+dqcpa023 copyabs sNaN -> sNaN
+dqcpa024 copyabs -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+dqcpa031 copyabs NaN10 -> NaN10
+dqcpa032 copyabs -NaN15 -> NaN15
+dqcpa033 copyabs sNaN15 -> sNaN15
+dqcpa034 copyabs -sNaN10 -> sNaN10
+dqcpa035 copyabs NaN7 -> NaN7
+dqcpa036 copyabs -NaN7 -> NaN7
+dqcpa037 copyabs sNaN101 -> sNaN101
+dqcpa038 copyabs -sNaN101 -> sNaN101
+
+-- finites
+dqcpa101 copyabs 7 -> 7
+dqcpa102 copyabs -7 -> 7
+dqcpa103 copyabs 75 -> 75
+dqcpa104 copyabs -75 -> 75
+dqcpa105 copyabs 7.10 -> 7.10
+dqcpa106 copyabs -7.10 -> 7.10
+dqcpa107 copyabs 7.500 -> 7.500
+dqcpa108 copyabs -7.500 -> 7.500
+
+-- zeros
+dqcpa111 copyabs 0 -> 0
+dqcpa112 copyabs -0 -> 0
+dqcpa113 copyabs 0E+6 -> 0E+6
+dqcpa114 copyabs -0E+6 -> 0E+6
+dqcpa115 copyabs 0.0000 -> 0.0000
+dqcpa116 copyabs -0.0000 -> 0.0000
+dqcpa117 copyabs 0E-141 -> 0E-141
+dqcpa118 copyabs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqcpa121 copyabs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqcpa122 copyabs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqcpa123 copyabs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+dqcpa124 copyabs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcpa131 copyabs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqcpa132 copyabs 1E-6143 -> 1E-6143
+dqcpa133 copyabs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqcpa134 copyabs 1E-6176 -> 1E-6176
+
+dqcpa135 copyabs -1E-6176 -> 1E-6176
+dqcpa136 copyabs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqcpa137 copyabs -1E-6143 -> 1E-6143
+dqcpa138 copyabs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqCopyNegate.decTest b/Lib/test/decimaltestdata/dqCopyNegate.decTest
index 6253f5a355..ea00855772 100644
--- a/Lib/test/decimaltestdata/dqCopyNegate.decTest
+++ b/Lib/test/decimaltestdata/dqCopyNegate.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqCopyNegate.decTest -- quiet decQuad copy and negate --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqcpn001 copynegate +7.50 -> -7.50
-
--- Infinities
-dqcpn011 copynegate Infinity -> -Infinity
-dqcpn012 copynegate -Infinity -> Infinity
-
--- NaNs, 0 payload
-dqcpn021 copynegate NaN -> -NaN
-dqcpn022 copynegate -NaN -> NaN
-dqcpn023 copynegate sNaN -> -sNaN
-dqcpn024 copynegate -sNaN -> sNaN
-
--- NaNs, non-0 payload
-dqcpn031 copynegate NaN13 -> -NaN13
-dqcpn032 copynegate -NaN13 -> NaN13
-dqcpn033 copynegate sNaN13 -> -sNaN13
-dqcpn034 copynegate -sNaN13 -> sNaN13
-dqcpn035 copynegate NaN70 -> -NaN70
-dqcpn036 copynegate -NaN70 -> NaN70
-dqcpn037 copynegate sNaN101 -> -sNaN101
-dqcpn038 copynegate -sNaN101 -> sNaN101
-
--- finites
-dqcpn101 copynegate 7 -> -7
-dqcpn102 copynegate -7 -> 7
-dqcpn103 copynegate 75 -> -75
-dqcpn104 copynegate -75 -> 75
-dqcpn105 copynegate 7.50 -> -7.50
-dqcpn106 copynegate -7.50 -> 7.50
-dqcpn107 copynegate 7.500 -> -7.500
-dqcpn108 copynegate -7.500 -> 7.500
-
--- zeros
-dqcpn111 copynegate 0 -> -0
-dqcpn112 copynegate -0 -> 0
-dqcpn113 copynegate 0E+4 -> -0E+4
-dqcpn114 copynegate -0E+4 -> 0E+4
-dqcpn115 copynegate 0.0000 -> -0.0000
-dqcpn116 copynegate -0.0000 -> 0.0000
-dqcpn117 copynegate 0E-141 -> -0E-141
-dqcpn118 copynegate -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqcpn121 copynegate 2682682682682682682682682682682682 -> -2682682682682682682682682682682682
-dqcpn122 copynegate -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqcpn123 copynegate 1341341341341341341341341341341341 -> -1341341341341341341341341341341341
-dqcpn124 copynegate -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcpn131 copynegate 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqcpn132 copynegate 1E-6143 -> -1E-6143
-dqcpn133 copynegate 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqcpn134 copynegate 1E-6176 -> -1E-6176
-
-dqcpn135 copynegate -1E-6176 -> 1E-6176
-dqcpn136 copynegate -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqcpn137 copynegate -1E-6143 -> 1E-6143
-dqcpn138 copynegate -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqCopyNegate.decTest -- quiet decQuad copy and negate --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqcpn001 copynegate +7.50 -> -7.50
+
+-- Infinities
+dqcpn011 copynegate Infinity -> -Infinity
+dqcpn012 copynegate -Infinity -> Infinity
+
+-- NaNs, 0 payload
+dqcpn021 copynegate NaN -> -NaN
+dqcpn022 copynegate -NaN -> NaN
+dqcpn023 copynegate sNaN -> -sNaN
+dqcpn024 copynegate -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+dqcpn031 copynegate NaN13 -> -NaN13
+dqcpn032 copynegate -NaN13 -> NaN13
+dqcpn033 copynegate sNaN13 -> -sNaN13
+dqcpn034 copynegate -sNaN13 -> sNaN13
+dqcpn035 copynegate NaN70 -> -NaN70
+dqcpn036 copynegate -NaN70 -> NaN70
+dqcpn037 copynegate sNaN101 -> -sNaN101
+dqcpn038 copynegate -sNaN101 -> sNaN101
+
+-- finites
+dqcpn101 copynegate 7 -> -7
+dqcpn102 copynegate -7 -> 7
+dqcpn103 copynegate 75 -> -75
+dqcpn104 copynegate -75 -> 75
+dqcpn105 copynegate 7.50 -> -7.50
+dqcpn106 copynegate -7.50 -> 7.50
+dqcpn107 copynegate 7.500 -> -7.500
+dqcpn108 copynegate -7.500 -> 7.500
+
+-- zeros
+dqcpn111 copynegate 0 -> -0
+dqcpn112 copynegate -0 -> 0
+dqcpn113 copynegate 0E+4 -> -0E+4
+dqcpn114 copynegate -0E+4 -> 0E+4
+dqcpn115 copynegate 0.0000 -> -0.0000
+dqcpn116 copynegate -0.0000 -> 0.0000
+dqcpn117 copynegate 0E-141 -> -0E-141
+dqcpn118 copynegate -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqcpn121 copynegate 2682682682682682682682682682682682 -> -2682682682682682682682682682682682
+dqcpn122 copynegate -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqcpn123 copynegate 1341341341341341341341341341341341 -> -1341341341341341341341341341341341
+dqcpn124 copynegate -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcpn131 copynegate 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqcpn132 copynegate 1E-6143 -> -1E-6143
+dqcpn133 copynegate 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqcpn134 copynegate 1E-6176 -> -1E-6176
+
+dqcpn135 copynegate -1E-6176 -> 1E-6176
+dqcpn136 copynegate -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqcpn137 copynegate -1E-6143 -> 1E-6143
+dqcpn138 copynegate -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqCopySign.decTest b/Lib/test/decimaltestdata/dqCopySign.decTest
index 97b5e6e955..ce794b7c35 100644
--- a/Lib/test/decimaltestdata/dqCopySign.decTest
+++ b/Lib/test/decimaltestdata/dqCopySign.decTest
@@ -1,175 +1,175 @@
-------------------------------------------------------------------------
--- dqCopySign.decTest -- quiet decQuad copy with sign from rhs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqcps001 copysign +7.50 11 -> 7.50
-
--- Infinities
-dqcps011 copysign Infinity 11 -> Infinity
-dqcps012 copysign -Infinity 11 -> Infinity
-
--- NaNs, 0 payload
-dqcps021 copysign NaN 11 -> NaN
-dqcps022 copysign -NaN 11 -> NaN
-dqcps023 copysign sNaN 11 -> sNaN
-dqcps024 copysign -sNaN 11 -> sNaN
-
--- NaNs, non-0 payload
-dqcps031 copysign NaN10 11 -> NaN10
-dqcps032 copysign -NaN10 11 -> NaN10
-dqcps033 copysign sNaN10 11 -> sNaN10
-dqcps034 copysign -sNaN10 11 -> sNaN10
-dqcps035 copysign NaN7 11 -> NaN7
-dqcps036 copysign -NaN7 11 -> NaN7
-dqcps037 copysign sNaN101 11 -> sNaN101
-dqcps038 copysign -sNaN101 11 -> sNaN101
-
--- finites
-dqcps101 copysign 7 11 -> 7
-dqcps102 copysign -7 11 -> 7
-dqcps103 copysign 75 11 -> 75
-dqcps104 copysign -75 11 -> 75
-dqcps105 copysign 7.50 11 -> 7.50
-dqcps106 copysign -7.50 11 -> 7.50
-dqcps107 copysign 7.500 11 -> 7.500
-dqcps108 copysign -7.500 11 -> 7.500
-
--- zeros
-dqcps111 copysign 0 11 -> 0
-dqcps112 copysign -0 11 -> 0
-dqcps113 copysign 0E+4 11 -> 0E+4
-dqcps114 copysign -0E+4 11 -> 0E+4
-dqcps115 copysign 0.0000 11 -> 0.0000
-dqcps116 copysign -0.0000 11 -> 0.0000
-dqcps117 copysign 0E-141 11 -> 0E-141
-dqcps118 copysign -0E-141 11 -> 0E-141
-
--- full coefficients, alternating bits
-dqcps121 copysign 2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682
-dqcps122 copysign -2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682
-dqcps123 copysign 1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341
-dqcps124 copysign -1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcps131 copysign 9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144
-dqcps132 copysign 1E-6143 8 -> 1E-6143
-dqcps133 copysign 1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143
-dqcps134 copysign 1E-6176 8 -> 1E-6176
-
-dqcps135 copysign -1E-6176 8 -> 1E-6176
-dqcps136 copysign -1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143
-dqcps137 copysign -1E-6143 8 -> 1E-6143
-dqcps138 copysign -9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144
-
--- repeat with negative RHS
-
--- Infinities
-dqcps211 copysign Infinity -34 -> -Infinity
-dqcps212 copysign -Infinity -34 -> -Infinity
-
--- NaNs, 0 payload
-dqcps221 copysign NaN -34 -> -NaN
-dqcps222 copysign -NaN -34 -> -NaN
-dqcps223 copysign sNaN -34 -> -sNaN
-dqcps224 copysign -sNaN -34 -> -sNaN
-
--- NaNs, non-0 payload
-dqcps231 copysign NaN10 -34 -> -NaN10
-dqcps232 copysign -NaN10 -34 -> -NaN10
-dqcps233 copysign sNaN10 -34 -> -sNaN10
-dqcps234 copysign -sNaN10 -34 -> -sNaN10
-dqcps235 copysign NaN7 -34 -> -NaN7
-dqcps236 copysign -NaN7 -34 -> -NaN7
-dqcps237 copysign sNaN101 -34 -> -sNaN101
-dqcps238 copysign -sNaN101 -34 -> -sNaN101
-
--- finites
-dqcps301 copysign 7 -34 -> -7
-dqcps302 copysign -7 -34 -> -7
-dqcps303 copysign 75 -34 -> -75
-dqcps304 copysign -75 -34 -> -75
-dqcps305 copysign 7.50 -34 -> -7.50
-dqcps306 copysign -7.50 -34 -> -7.50
-dqcps307 copysign 7.500 -34 -> -7.500
-dqcps308 copysign -7.500 -34 -> -7.500
-
--- zeros
-dqcps311 copysign 0 -34 -> -0
-dqcps312 copysign -0 -34 -> -0
-dqcps313 copysign 0E+4 -34 -> -0E+4
-dqcps314 copysign -0E+4 -34 -> -0E+4
-dqcps315 copysign 0.0000 -34 -> -0.0000
-dqcps316 copysign -0.0000 -34 -> -0.0000
-dqcps317 copysign 0E-141 -34 -> -0E-141
-dqcps318 copysign -0E-141 -34 -> -0E-141
-
--- full coefficients, alternating bits
-dqcps321 copysign 2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
-dqcps322 copysign -2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
-dqcps323 copysign 1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
-dqcps324 copysign -1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcps331 copysign 9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144
-dqcps332 copysign 1E-6143 -1 -> -1E-6143
-dqcps333 copysign 1.000000000000000000000000000000000E-6143 -1 -> -1.000000000000000000000000000000000E-6143
-dqcps334 copysign 1E-6176 -1 -> -1E-6176
-
-dqcps335 copysign -1E-6176 -3 -> -1E-6176
-dqcps336 copysign -1.000000000000000000000000000000000E-6143 -3 -> -1.000000000000000000000000000000000E-6143
-dqcps337 copysign -1E-6143 -3 -> -1E-6143
-dqcps338 copysign -9.999999999999999999999999999999999E+6144 -3 -> -9.999999999999999999999999999999999E+6144
-
--- Other kinds of RHS
-dqcps401 copysign 701 -34 -> -701
-dqcps402 copysign -720 -34 -> -720
-dqcps403 copysign 701 -0 -> -701
-dqcps404 copysign -720 -0 -> -720
-dqcps405 copysign 701 +0 -> 701
-dqcps406 copysign -720 +0 -> 720
-dqcps407 copysign 701 +34 -> 701
-dqcps408 copysign -720 +34 -> 720
-
-dqcps413 copysign 701 -Inf -> -701
-dqcps414 copysign -720 -Inf -> -720
-dqcps415 copysign 701 +Inf -> 701
-dqcps416 copysign -720 +Inf -> 720
-
-dqcps420 copysign 701 -NaN -> -701
-dqcps421 copysign -720 -NaN -> -720
-dqcps422 copysign 701 +NaN -> 701
-dqcps423 copysign -720 +NaN -> 720
-dqcps425 copysign -720 +NaN8 -> 720
-
-dqcps426 copysign 701 -sNaN -> -701
-dqcps427 copysign -720 -sNaN -> -720
-dqcps428 copysign 701 +sNaN -> 701
-dqcps429 copysign -720 +sNaN -> 720
-dqcps430 copysign -720 +sNaN3 -> 720
-
+------------------------------------------------------------------------
+-- dqCopySign.decTest -- quiet decQuad copy with sign from rhs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqcps001 copysign +7.50 11 -> 7.50
+
+-- Infinities
+dqcps011 copysign Infinity 11 -> Infinity
+dqcps012 copysign -Infinity 11 -> Infinity
+
+-- NaNs, 0 payload
+dqcps021 copysign NaN 11 -> NaN
+dqcps022 copysign -NaN 11 -> NaN
+dqcps023 copysign sNaN 11 -> sNaN
+dqcps024 copysign -sNaN 11 -> sNaN
+
+-- NaNs, non-0 payload
+dqcps031 copysign NaN10 11 -> NaN10
+dqcps032 copysign -NaN10 11 -> NaN10
+dqcps033 copysign sNaN10 11 -> sNaN10
+dqcps034 copysign -sNaN10 11 -> sNaN10
+dqcps035 copysign NaN7 11 -> NaN7
+dqcps036 copysign -NaN7 11 -> NaN7
+dqcps037 copysign sNaN101 11 -> sNaN101
+dqcps038 copysign -sNaN101 11 -> sNaN101
+
+-- finites
+dqcps101 copysign 7 11 -> 7
+dqcps102 copysign -7 11 -> 7
+dqcps103 copysign 75 11 -> 75
+dqcps104 copysign -75 11 -> 75
+dqcps105 copysign 7.50 11 -> 7.50
+dqcps106 copysign -7.50 11 -> 7.50
+dqcps107 copysign 7.500 11 -> 7.500
+dqcps108 copysign -7.500 11 -> 7.500
+
+-- zeros
+dqcps111 copysign 0 11 -> 0
+dqcps112 copysign -0 11 -> 0
+dqcps113 copysign 0E+4 11 -> 0E+4
+dqcps114 copysign -0E+4 11 -> 0E+4
+dqcps115 copysign 0.0000 11 -> 0.0000
+dqcps116 copysign -0.0000 11 -> 0.0000
+dqcps117 copysign 0E-141 11 -> 0E-141
+dqcps118 copysign -0E-141 11 -> 0E-141
+
+-- full coefficients, alternating bits
+dqcps121 copysign 2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682
+dqcps122 copysign -2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682
+dqcps123 copysign 1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341
+dqcps124 copysign -1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcps131 copysign 9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144
+dqcps132 copysign 1E-6143 8 -> 1E-6143
+dqcps133 copysign 1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143
+dqcps134 copysign 1E-6176 8 -> 1E-6176
+
+dqcps135 copysign -1E-6176 8 -> 1E-6176
+dqcps136 copysign -1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143
+dqcps137 copysign -1E-6143 8 -> 1E-6143
+dqcps138 copysign -9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144
+
+-- repeat with negative RHS
+
+-- Infinities
+dqcps211 copysign Infinity -34 -> -Infinity
+dqcps212 copysign -Infinity -34 -> -Infinity
+
+-- NaNs, 0 payload
+dqcps221 copysign NaN -34 -> -NaN
+dqcps222 copysign -NaN -34 -> -NaN
+dqcps223 copysign sNaN -34 -> -sNaN
+dqcps224 copysign -sNaN -34 -> -sNaN
+
+-- NaNs, non-0 payload
+dqcps231 copysign NaN10 -34 -> -NaN10
+dqcps232 copysign -NaN10 -34 -> -NaN10
+dqcps233 copysign sNaN10 -34 -> -sNaN10
+dqcps234 copysign -sNaN10 -34 -> -sNaN10
+dqcps235 copysign NaN7 -34 -> -NaN7
+dqcps236 copysign -NaN7 -34 -> -NaN7
+dqcps237 copysign sNaN101 -34 -> -sNaN101
+dqcps238 copysign -sNaN101 -34 -> -sNaN101
+
+-- finites
+dqcps301 copysign 7 -34 -> -7
+dqcps302 copysign -7 -34 -> -7
+dqcps303 copysign 75 -34 -> -75
+dqcps304 copysign -75 -34 -> -75
+dqcps305 copysign 7.50 -34 -> -7.50
+dqcps306 copysign -7.50 -34 -> -7.50
+dqcps307 copysign 7.500 -34 -> -7.500
+dqcps308 copysign -7.500 -34 -> -7.500
+
+-- zeros
+dqcps311 copysign 0 -34 -> -0
+dqcps312 copysign -0 -34 -> -0
+dqcps313 copysign 0E+4 -34 -> -0E+4
+dqcps314 copysign -0E+4 -34 -> -0E+4
+dqcps315 copysign 0.0000 -34 -> -0.0000
+dqcps316 copysign -0.0000 -34 -> -0.0000
+dqcps317 copysign 0E-141 -34 -> -0E-141
+dqcps318 copysign -0E-141 -34 -> -0E-141
+
+-- full coefficients, alternating bits
+dqcps321 copysign 2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
+dqcps322 copysign -2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
+dqcps323 copysign 1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
+dqcps324 copysign -1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcps331 copysign 9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144
+dqcps332 copysign 1E-6143 -1 -> -1E-6143
+dqcps333 copysign 1.000000000000000000000000000000000E-6143 -1 -> -1.000000000000000000000000000000000E-6143
+dqcps334 copysign 1E-6176 -1 -> -1E-6176
+
+dqcps335 copysign -1E-6176 -3 -> -1E-6176
+dqcps336 copysign -1.000000000000000000000000000000000E-6143 -3 -> -1.000000000000000000000000000000000E-6143
+dqcps337 copysign -1E-6143 -3 -> -1E-6143
+dqcps338 copysign -9.999999999999999999999999999999999E+6144 -3 -> -9.999999999999999999999999999999999E+6144
+
+-- Other kinds of RHS
+dqcps401 copysign 701 -34 -> -701
+dqcps402 copysign -720 -34 -> -720
+dqcps403 copysign 701 -0 -> -701
+dqcps404 copysign -720 -0 -> -720
+dqcps405 copysign 701 +0 -> 701
+dqcps406 copysign -720 +0 -> 720
+dqcps407 copysign 701 +34 -> 701
+dqcps408 copysign -720 +34 -> 720
+
+dqcps413 copysign 701 -Inf -> -701
+dqcps414 copysign -720 -Inf -> -720
+dqcps415 copysign 701 +Inf -> 701
+dqcps416 copysign -720 +Inf -> 720
+
+dqcps420 copysign 701 -NaN -> -701
+dqcps421 copysign -720 -NaN -> -720
+dqcps422 copysign 701 +NaN -> 701
+dqcps423 copysign -720 +NaN -> 720
+dqcps425 copysign -720 +NaN8 -> 720
+
+dqcps426 copysign 701 -sNaN -> -701
+dqcps427 copysign -720 -sNaN -> -720
+dqcps428 copysign 701 +sNaN -> 701
+dqcps429 copysign -720 +sNaN -> 720
+dqcps430 copysign -720 +sNaN3 -> 720
+
diff --git a/Lib/test/decimaltestdata/dqDivide.decTest b/Lib/test/decimaltestdata/dqDivide.decTest
index 2abb939d54..3cf60c6024 100644
--- a/Lib/test/decimaltestdata/dqDivide.decTest
+++ b/Lib/test/decimaltestdata/dqDivide.decTest
@@ -1,808 +1,808 @@
-------------------------------------------------------------------------
--- dqDivide.decTest -- decQuad division --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqdiv001 divide 1 1 -> 1
-dqdiv002 divide 2 1 -> 2
-dqdiv003 divide 1 2 -> 0.5
-dqdiv004 divide 2 2 -> 1
-dqdiv005 divide 0 1 -> 0
-dqdiv006 divide 0 2 -> 0
-dqdiv007 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded
-dqdiv008 divide 2 3 -> 0.6666666666666666666666666666666667 Inexact Rounded
-dqdiv009 divide 3 3 -> 1
-
-dqdiv010 divide 2.4 1 -> 2.4
-dqdiv011 divide 2.4 -1 -> -2.4
-dqdiv012 divide -2.4 1 -> -2.4
-dqdiv013 divide -2.4 -1 -> 2.4
-dqdiv014 divide 2.40 1 -> 2.40
-dqdiv015 divide 2.400 1 -> 2.400
-dqdiv016 divide 2.4 2 -> 1.2
-dqdiv017 divide 2.400 2 -> 1.200
-dqdiv018 divide 2. 2 -> 1
-dqdiv019 divide 20 20 -> 1
-
-dqdiv020 divide 187 187 -> 1
-dqdiv021 divide 5 2 -> 2.5
-dqdiv022 divide 50 20 -> 2.5
-dqdiv023 divide 500 200 -> 2.5
-dqdiv024 divide 50.0 20.0 -> 2.5
-dqdiv025 divide 5.00 2.00 -> 2.5
-dqdiv026 divide 5 2.0 -> 2.5
-dqdiv027 divide 5 2.000 -> 2.5
-dqdiv028 divide 5 0.20 -> 25
-dqdiv029 divide 5 0.200 -> 25
-dqdiv030 divide 10 1 -> 10
-dqdiv031 divide 100 1 -> 100
-dqdiv032 divide 1000 1 -> 1000
-dqdiv033 divide 1000 100 -> 10
-
-dqdiv035 divide 1 2 -> 0.5
-dqdiv036 divide 1 4 -> 0.25
-dqdiv037 divide 1 8 -> 0.125
-dqdiv038 divide 1 16 -> 0.0625
-dqdiv039 divide 1 32 -> 0.03125
-dqdiv040 divide 1 64 -> 0.015625
-dqdiv041 divide 1 -2 -> -0.5
-dqdiv042 divide 1 -4 -> -0.25
-dqdiv043 divide 1 -8 -> -0.125
-dqdiv044 divide 1 -16 -> -0.0625
-dqdiv045 divide 1 -32 -> -0.03125
-dqdiv046 divide 1 -64 -> -0.015625
-dqdiv047 divide -1 2 -> -0.5
-dqdiv048 divide -1 4 -> -0.25
-dqdiv049 divide -1 8 -> -0.125
-dqdiv050 divide -1 16 -> -0.0625
-dqdiv051 divide -1 32 -> -0.03125
-dqdiv052 divide -1 64 -> -0.015625
-dqdiv053 divide -1 -2 -> 0.5
-dqdiv054 divide -1 -4 -> 0.25
-dqdiv055 divide -1 -8 -> 0.125
-dqdiv056 divide -1 -16 -> 0.0625
-dqdiv057 divide -1 -32 -> 0.03125
-dqdiv058 divide -1 -64 -> 0.015625
-
--- bcdTime
-dqdiv060 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded
-dqdiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717123193907511985359 Inexact Rounded
-
--- 1234567890123456
-dqdiv067 divide 9999999999999999999999999999999999 1 -> 9999999999999999999999999999999999
-dqdiv068 divide 999999999999999999999999999999999 1 -> 999999999999999999999999999999999
-dqdiv069 divide 99999999999999999999999999999999 1 -> 99999999999999999999999999999999
-dqdiv070 divide 99999999999999999 1 -> 99999999999999999
-dqdiv071 divide 9999999999999999 1 -> 9999999999999999
-dqdiv072 divide 999999999999999 1 -> 999999999999999
-dqdiv073 divide 99999999999999 1 -> 99999999999999
-dqdiv074 divide 9999999999999 1 -> 9999999999999
-dqdiv075 divide 999999999999 1 -> 999999999999
-dqdiv076 divide 99999999999 1 -> 99999999999
-dqdiv077 divide 9999999999 1 -> 9999999999
-dqdiv078 divide 999999999 1 -> 999999999
-dqdiv079 divide 99999999 1 -> 99999999
-dqdiv080 divide 9999999 1 -> 9999999
-dqdiv081 divide 999999 1 -> 999999
-dqdiv082 divide 99999 1 -> 99999
-dqdiv083 divide 9999 1 -> 9999
-dqdiv084 divide 999 1 -> 999
-dqdiv085 divide 99 1 -> 99
-dqdiv086 divide 9 1 -> 9
-
-dqdiv090 divide 0. 1 -> 0
-dqdiv091 divide .0 1 -> 0.0
-dqdiv092 divide 0.00 1 -> 0.00
-dqdiv093 divide 0.00E+9 1 -> 0E+7
-dqdiv094 divide 0.0000E-50 1 -> 0E-54
-
-dqdiv095 divide 1 1E-8 -> 1E+8
-dqdiv096 divide 1 1E-9 -> 1E+9
-dqdiv097 divide 1 1E-10 -> 1E+10
-dqdiv098 divide 1 1E-11 -> 1E+11
-dqdiv099 divide 1 1E-12 -> 1E+12
-
-dqdiv100 divide 1 1 -> 1
-dqdiv101 divide 1 2 -> 0.5
-dqdiv102 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded
-dqdiv103 divide 1 4 -> 0.25
-dqdiv104 divide 1 5 -> 0.2
-dqdiv105 divide 1 6 -> 0.1666666666666666666666666666666667 Inexact Rounded
-dqdiv106 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded
-dqdiv107 divide 1 8 -> 0.125
-dqdiv108 divide 1 9 -> 0.1111111111111111111111111111111111 Inexact Rounded
-dqdiv109 divide 1 10 -> 0.1
-dqdiv110 divide 1 1 -> 1
-dqdiv111 divide 2 1 -> 2
-dqdiv112 divide 3 1 -> 3
-dqdiv113 divide 4 1 -> 4
-dqdiv114 divide 5 1 -> 5
-dqdiv115 divide 6 1 -> 6
-dqdiv116 divide 7 1 -> 7
-dqdiv117 divide 8 1 -> 8
-dqdiv118 divide 9 1 -> 9
-dqdiv119 divide 10 1 -> 10
-
-dqdiv120 divide 3E+1 0.001 -> 3E+4
-dqdiv121 divide 2.200 2 -> 1.100
-
-dqdiv130 divide 12345 4.999 -> 2469.493898779755951190238047609522 Inexact Rounded
-dqdiv131 divide 12345 4.99 -> 2473.947895791583166332665330661323 Inexact Rounded
-dqdiv132 divide 12345 4.9 -> 2519.387755102040816326530612244898 Inexact Rounded
-dqdiv133 divide 12345 5 -> 2469
-dqdiv134 divide 12345 5.1 -> 2420.588235294117647058823529411765 Inexact Rounded
-dqdiv135 divide 12345 5.01 -> 2464.071856287425149700598802395210 Inexact Rounded
-dqdiv136 divide 12345 5.001 -> 2468.506298740251949610077984403119 Inexact Rounded
-
--- test possibly imprecise results
-dqdiv220 divide 391 597 -> 0.6549413735343383584589614740368509 Inexact Rounded
-dqdiv221 divide 391 -597 -> -0.6549413735343383584589614740368509 Inexact Rounded
-dqdiv222 divide -391 597 -> -0.6549413735343383584589614740368509 Inexact Rounded
-dqdiv223 divide -391 -597 -> 0.6549413735343383584589614740368509 Inexact Rounded
-
--- test some cases that are close to exponent overflow
-dqdiv270 divide 1 1e6144 -> 1E-6144 Subnormal
-dqdiv271 divide 1 0.9e6144 -> 1.11111111111111111111111111111111E-6144 Rounded Inexact Subnormal Underflow
-dqdiv272 divide 1 0.99e6144 -> 1.01010101010101010101010101010101E-6144 Rounded Inexact Subnormal Underflow
-dqdiv273 divide 1 0.9999999999999999e6144 -> 1.00000000000000010000000000000001E-6144 Rounded Inexact Subnormal Underflow
-dqdiv274 divide 9e6144 1 -> 9.000000000000000000000000000000000E+6144 Clamped
-dqdiv275 divide 9.9e6144 1 -> 9.900000000000000000000000000000000E+6144 Clamped
-dqdiv276 divide 9.99e6144 1 -> 9.990000000000000000000000000000000E+6144 Clamped
-dqdiv277 divide 9.999999999999999e6144 1 -> 9.999999999999999000000000000000000E+6144 Clamped
-
-dqdiv278 divide 1 0.9999999999999999999999999999999999e6144 -> 1.00000000000000000000000000000000E-6144 Rounded Inexact Subnormal Underflow
-dqdiv279 divide 9.999999999999999999999999999999999e6144 1 -> 9.999999999999999999999999999999999E+6144
-
--- Divide into 0 tests
-dqdiv301 divide 0 7 -> 0
-dqdiv302 divide 0 7E-5 -> 0E+5
-dqdiv303 divide 0 7E-1 -> 0E+1
-dqdiv304 divide 0 7E+1 -> 0.0
-dqdiv305 divide 0 7E+5 -> 0.00000
-dqdiv306 divide 0 7E+6 -> 0.000000
-dqdiv307 divide 0 7E+7 -> 0E-7
-dqdiv308 divide 0 70E-5 -> 0E+5
-dqdiv309 divide 0 70E-1 -> 0E+1
-dqdiv310 divide 0 70E+0 -> 0
-dqdiv311 divide 0 70E+1 -> 0.0
-dqdiv312 divide 0 70E+5 -> 0.00000
-dqdiv313 divide 0 70E+6 -> 0.000000
-dqdiv314 divide 0 70E+7 -> 0E-7
-dqdiv315 divide 0 700E-5 -> 0E+5
-dqdiv316 divide 0 700E-1 -> 0E+1
-dqdiv317 divide 0 700E+0 -> 0
-dqdiv318 divide 0 700E+1 -> 0.0
-dqdiv319 divide 0 700E+5 -> 0.00000
-dqdiv320 divide 0 700E+6 -> 0.000000
-dqdiv321 divide 0 700E+7 -> 0E-7
-dqdiv322 divide 0 700E+77 -> 0E-77
-
-dqdiv331 divide 0E-3 7E-5 -> 0E+2
-dqdiv332 divide 0E-3 7E-1 -> 0.00
-dqdiv333 divide 0E-3 7E+1 -> 0.0000
-dqdiv334 divide 0E-3 7E+5 -> 0E-8
-dqdiv335 divide 0E-1 7E-5 -> 0E+4
-dqdiv336 divide 0E-1 7E-1 -> 0
-dqdiv337 divide 0E-1 7E+1 -> 0.00
-dqdiv338 divide 0E-1 7E+5 -> 0.000000
-dqdiv339 divide 0E+1 7E-5 -> 0E+6
-dqdiv340 divide 0E+1 7E-1 -> 0E+2
-dqdiv341 divide 0E+1 7E+1 -> 0
-dqdiv342 divide 0E+1 7E+5 -> 0.0000
-dqdiv343 divide 0E+3 7E-5 -> 0E+8
-dqdiv344 divide 0E+3 7E-1 -> 0E+4
-dqdiv345 divide 0E+3 7E+1 -> 0E+2
-dqdiv346 divide 0E+3 7E+5 -> 0.00
-
--- These were 'input rounding'
-dqdiv441 divide 12345678000 1 -> 12345678000
-dqdiv442 divide 1 12345678000 -> 8.100000664200054464404466081166219E-11 Inexact Rounded
-dqdiv443 divide 1234567800 1 -> 1234567800
-dqdiv444 divide 1 1234567800 -> 8.100000664200054464404466081166219E-10 Inexact Rounded
-dqdiv445 divide 1234567890 1 -> 1234567890
-dqdiv446 divide 1 1234567890 -> 8.100000073710000670761006103925156E-10 Inexact Rounded
-dqdiv447 divide 1234567891 1 -> 1234567891
-dqdiv448 divide 1 1234567891 -> 8.100000067149000556665214614754629E-10 Inexact Rounded
-dqdiv449 divide 12345678901 1 -> 12345678901
-dqdiv450 divide 1 12345678901 -> 8.100000073053900658873130042376760E-11 Inexact Rounded
-dqdiv451 divide 1234567896 1 -> 1234567896
-dqdiv452 divide 1 1234567896 -> 8.100000034344000145618560617422697E-10 Inexact Rounded
-
--- high-lows
-dqdiv453 divide 1e+1 1 -> 1E+1
-dqdiv454 divide 1e+1 1.0 -> 1E+1
-dqdiv455 divide 1e+1 1.00 -> 1E+1
-dqdiv456 divide 1e+2 2 -> 5E+1
-dqdiv457 divide 1e+2 2.0 -> 5E+1
-dqdiv458 divide 1e+2 2.00 -> 5E+1
-
--- some from IEEE discussions
-dqdiv460 divide 3e0 2e0 -> 1.5
-dqdiv461 divide 30e-1 2e0 -> 1.5
-dqdiv462 divide 300e-2 2e0 -> 1.50
-dqdiv464 divide 3000e-3 2e0 -> 1.500
-dqdiv465 divide 3e0 20e-1 -> 1.5
-dqdiv466 divide 30e-1 20e-1 -> 1.5
-dqdiv467 divide 300e-2 20e-1 -> 1.5
-dqdiv468 divide 3000e-3 20e-1 -> 1.50
-dqdiv469 divide 3e0 200e-2 -> 1.5
-dqdiv470 divide 30e-1 200e-2 -> 1.5
-dqdiv471 divide 300e-2 200e-2 -> 1.5
-dqdiv472 divide 3000e-3 200e-2 -> 1.5
-dqdiv473 divide 3e0 2000e-3 -> 1.5
-dqdiv474 divide 30e-1 2000e-3 -> 1.5
-dqdiv475 divide 300e-2 2000e-3 -> 1.5
-dqdiv476 divide 3000e-3 2000e-3 -> 1.5
-
--- some reciprocals
-dqdiv480 divide 1 1.0E+33 -> 1E-33
-dqdiv481 divide 1 10E+33 -> 1E-34
-dqdiv482 divide 1 1.0E-33 -> 1E+33
-dqdiv483 divide 1 10E-33 -> 1E+32
-
--- RMS discussion table
-dqdiv484 divide 0e5 1e3 -> 0E+2
-dqdiv485 divide 0e5 2e3 -> 0E+2
-dqdiv486 divide 0e5 10e2 -> 0E+3
-dqdiv487 divide 0e5 20e2 -> 0E+3
-dqdiv488 divide 0e5 100e1 -> 0E+4
-dqdiv489 divide 0e5 200e1 -> 0E+4
-
-dqdiv491 divide 1e5 1e3 -> 1E+2
-dqdiv492 divide 1e5 2e3 -> 5E+1
-dqdiv493 divide 1e5 10e2 -> 1E+2
-dqdiv494 divide 1e5 20e2 -> 5E+1
-dqdiv495 divide 1e5 100e1 -> 1E+2
-dqdiv496 divide 1e5 200e1 -> 5E+1
-
--- tryzeros cases
-rounding: half_up
-dqdiv497 divide 0E+6108 1000E-33 -> 0E+6111 Clamped
-dqdiv498 divide 0E-6170 1000E+33 -> 0E-6176 Clamped
-
-rounding: half_up
-
--- focus on trailing zeros issues
-dqdiv500 divide 1 9.9 -> 0.1010101010101010101010101010101010 Inexact Rounded
-dqdiv501 divide 1 9.09 -> 0.1100110011001100110011001100110011 Inexact Rounded
-dqdiv502 divide 1 9.009 -> 0.1110001110001110001110001110001110 Inexact Rounded
-
-dqdiv511 divide 1 2 -> 0.5
-dqdiv512 divide 1.0 2 -> 0.5
-dqdiv513 divide 1.00 2 -> 0.50
-dqdiv514 divide 1.000 2 -> 0.500
-dqdiv515 divide 1.0000 2 -> 0.5000
-dqdiv516 divide 1.00000 2 -> 0.50000
-dqdiv517 divide 1.000000 2 -> 0.500000
-dqdiv518 divide 1.0000000 2 -> 0.5000000
-dqdiv519 divide 1.00 2.00 -> 0.5
-
-dqdiv521 divide 2 1 -> 2
-dqdiv522 divide 2 1.0 -> 2
-dqdiv523 divide 2 1.00 -> 2
-dqdiv524 divide 2 1.000 -> 2
-dqdiv525 divide 2 1.0000 -> 2
-dqdiv526 divide 2 1.00000 -> 2
-dqdiv527 divide 2 1.000000 -> 2
-dqdiv528 divide 2 1.0000000 -> 2
-dqdiv529 divide 2.00 1.00 -> 2
-
-dqdiv530 divide 2.40 2 -> 1.20
-dqdiv531 divide 2.40 4 -> 0.60
-dqdiv532 divide 2.40 10 -> 0.24
-dqdiv533 divide 2.40 2.0 -> 1.2
-dqdiv534 divide 2.40 4.0 -> 0.6
-dqdiv535 divide 2.40 10.0 -> 0.24
-dqdiv536 divide 2.40 2.00 -> 1.2
-dqdiv537 divide 2.40 4.00 -> 0.6
-dqdiv538 divide 2.40 10.00 -> 0.24
-dqdiv539 divide 0.9 0.1 -> 9
-dqdiv540 divide 0.9 0.01 -> 9E+1
-dqdiv541 divide 0.9 0.001 -> 9E+2
-dqdiv542 divide 5 2 -> 2.5
-dqdiv543 divide 5 2.0 -> 2.5
-dqdiv544 divide 5 2.00 -> 2.5
-dqdiv545 divide 5 20 -> 0.25
-dqdiv546 divide 5 20.0 -> 0.25
-dqdiv547 divide 2.400 2 -> 1.200
-dqdiv548 divide 2.400 2.0 -> 1.20
-dqdiv549 divide 2.400 2.400 -> 1
-
-dqdiv550 divide 240 1 -> 240
-dqdiv551 divide 240 10 -> 24
-dqdiv552 divide 240 100 -> 2.4
-dqdiv553 divide 240 1000 -> 0.24
-dqdiv554 divide 2400 1 -> 2400
-dqdiv555 divide 2400 10 -> 240
-dqdiv556 divide 2400 100 -> 24
-dqdiv557 divide 2400 1000 -> 2.4
-
--- +ve exponent
-dqdiv600 divide 2.4E+9 2 -> 1.2E+9
-dqdiv601 divide 2.40E+9 2 -> 1.20E+9
-dqdiv602 divide 2.400E+9 2 -> 1.200E+9
-dqdiv603 divide 2.4000E+9 2 -> 1.2000E+9
-dqdiv604 divide 24E+8 2 -> 1.2E+9
-dqdiv605 divide 240E+7 2 -> 1.20E+9
-dqdiv606 divide 2400E+6 2 -> 1.200E+9
-dqdiv607 divide 24000E+5 2 -> 1.2000E+9
-
--- more zeros, etc.
-dqdiv731 divide 5.00 1E-3 -> 5.00E+3
-dqdiv732 divide 00.00 0.000 -> NaN Division_undefined
-dqdiv733 divide 00.00 0E-3 -> NaN Division_undefined
-dqdiv734 divide 0 -0 -> NaN Division_undefined
-dqdiv735 divide -0 0 -> NaN Division_undefined
-dqdiv736 divide -0 -0 -> NaN Division_undefined
-
-dqdiv741 divide 0 -1 -> -0
-dqdiv742 divide -0 -1 -> 0
-dqdiv743 divide 0 1 -> 0
-dqdiv744 divide -0 1 -> -0
-dqdiv745 divide -1 0 -> -Infinity Division_by_zero
-dqdiv746 divide -1 -0 -> Infinity Division_by_zero
-dqdiv747 divide 1 0 -> Infinity Division_by_zero
-dqdiv748 divide 1 -0 -> -Infinity Division_by_zero
-
-dqdiv751 divide 0.0 -1 -> -0.0
-dqdiv752 divide -0.0 -1 -> 0.0
-dqdiv753 divide 0.0 1 -> 0.0
-dqdiv754 divide -0.0 1 -> -0.0
-dqdiv755 divide -1.0 0 -> -Infinity Division_by_zero
-dqdiv756 divide -1.0 -0 -> Infinity Division_by_zero
-dqdiv757 divide 1.0 0 -> Infinity Division_by_zero
-dqdiv758 divide 1.0 -0 -> -Infinity Division_by_zero
-
-dqdiv761 divide 0 -1.0 -> -0E+1
-dqdiv762 divide -0 -1.0 -> 0E+1
-dqdiv763 divide 0 1.0 -> 0E+1
-dqdiv764 divide -0 1.0 -> -0E+1
-dqdiv765 divide -1 0.0 -> -Infinity Division_by_zero
-dqdiv766 divide -1 -0.0 -> Infinity Division_by_zero
-dqdiv767 divide 1 0.0 -> Infinity Division_by_zero
-dqdiv768 divide 1 -0.0 -> -Infinity Division_by_zero
-
-dqdiv771 divide 0.0 -1.0 -> -0
-dqdiv772 divide -0.0 -1.0 -> 0
-dqdiv773 divide 0.0 1.0 -> 0
-dqdiv774 divide -0.0 1.0 -> -0
-dqdiv775 divide -1.0 0.0 -> -Infinity Division_by_zero
-dqdiv776 divide -1.0 -0.0 -> Infinity Division_by_zero
-dqdiv777 divide 1.0 0.0 -> Infinity Division_by_zero
-dqdiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero
-
--- Specials
-dqdiv780 divide Inf -Inf -> NaN Invalid_operation
-dqdiv781 divide Inf -1000 -> -Infinity
-dqdiv782 divide Inf -1 -> -Infinity
-dqdiv783 divide Inf -0 -> -Infinity
-dqdiv784 divide Inf 0 -> Infinity
-dqdiv785 divide Inf 1 -> Infinity
-dqdiv786 divide Inf 1000 -> Infinity
-dqdiv787 divide Inf Inf -> NaN Invalid_operation
-dqdiv788 divide -1000 Inf -> -0E-6176 Clamped
-dqdiv789 divide -Inf Inf -> NaN Invalid_operation
-dqdiv790 divide -1 Inf -> -0E-6176 Clamped
-dqdiv791 divide -0 Inf -> -0E-6176 Clamped
-dqdiv792 divide 0 Inf -> 0E-6176 Clamped
-dqdiv793 divide 1 Inf -> 0E-6176 Clamped
-dqdiv794 divide 1000 Inf -> 0E-6176 Clamped
-dqdiv795 divide Inf Inf -> NaN Invalid_operation
-
-dqdiv800 divide -Inf -Inf -> NaN Invalid_operation
-dqdiv801 divide -Inf -1000 -> Infinity
-dqdiv802 divide -Inf -1 -> Infinity
-dqdiv803 divide -Inf -0 -> Infinity
-dqdiv804 divide -Inf 0 -> -Infinity
-dqdiv805 divide -Inf 1 -> -Infinity
-dqdiv806 divide -Inf 1000 -> -Infinity
-dqdiv807 divide -Inf Inf -> NaN Invalid_operation
-dqdiv808 divide -1000 Inf -> -0E-6176 Clamped
-dqdiv809 divide -Inf -Inf -> NaN Invalid_operation
-dqdiv810 divide -1 -Inf -> 0E-6176 Clamped
-dqdiv811 divide -0 -Inf -> 0E-6176 Clamped
-dqdiv812 divide 0 -Inf -> -0E-6176 Clamped
-dqdiv813 divide 1 -Inf -> -0E-6176 Clamped
-dqdiv814 divide 1000 -Inf -> -0E-6176 Clamped
-dqdiv815 divide Inf -Inf -> NaN Invalid_operation
-
-dqdiv821 divide NaN -Inf -> NaN
-dqdiv822 divide NaN -1000 -> NaN
-dqdiv823 divide NaN -1 -> NaN
-dqdiv824 divide NaN -0 -> NaN
-dqdiv825 divide NaN 0 -> NaN
-dqdiv826 divide NaN 1 -> NaN
-dqdiv827 divide NaN 1000 -> NaN
-dqdiv828 divide NaN Inf -> NaN
-dqdiv829 divide NaN NaN -> NaN
-dqdiv830 divide -Inf NaN -> NaN
-dqdiv831 divide -1000 NaN -> NaN
-dqdiv832 divide -1 NaN -> NaN
-dqdiv833 divide -0 NaN -> NaN
-dqdiv834 divide 0 NaN -> NaN
-dqdiv835 divide 1 NaN -> NaN
-dqdiv836 divide 1000 NaN -> NaN
-dqdiv837 divide Inf NaN -> NaN
-
-dqdiv841 divide sNaN -Inf -> NaN Invalid_operation
-dqdiv842 divide sNaN -1000 -> NaN Invalid_operation
-dqdiv843 divide sNaN -1 -> NaN Invalid_operation
-dqdiv844 divide sNaN -0 -> NaN Invalid_operation
-dqdiv845 divide sNaN 0 -> NaN Invalid_operation
-dqdiv846 divide sNaN 1 -> NaN Invalid_operation
-dqdiv847 divide sNaN 1000 -> NaN Invalid_operation
-dqdiv848 divide sNaN NaN -> NaN Invalid_operation
-dqdiv849 divide sNaN sNaN -> NaN Invalid_operation
-dqdiv850 divide NaN sNaN -> NaN Invalid_operation
-dqdiv851 divide -Inf sNaN -> NaN Invalid_operation
-dqdiv852 divide -1000 sNaN -> NaN Invalid_operation
-dqdiv853 divide -1 sNaN -> NaN Invalid_operation
-dqdiv854 divide -0 sNaN -> NaN Invalid_operation
-dqdiv855 divide 0 sNaN -> NaN Invalid_operation
-dqdiv856 divide 1 sNaN -> NaN Invalid_operation
-dqdiv857 divide 1000 sNaN -> NaN Invalid_operation
-dqdiv858 divide Inf sNaN -> NaN Invalid_operation
-dqdiv859 divide NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqdiv861 divide NaN9 -Inf -> NaN9
-dqdiv862 divide NaN8 1000 -> NaN8
-dqdiv863 divide NaN7 Inf -> NaN7
-dqdiv864 divide NaN6 NaN5 -> NaN6
-dqdiv865 divide -Inf NaN4 -> NaN4
-dqdiv866 divide -1000 NaN3 -> NaN3
-dqdiv867 divide Inf NaN2 -> NaN2
-
-dqdiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation
-dqdiv872 divide sNaN98 -1 -> NaN98 Invalid_operation
-dqdiv873 divide sNaN97 NaN -> NaN97 Invalid_operation
-dqdiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
-dqdiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
-dqdiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation
-dqdiv877 divide 0 sNaN91 -> NaN91 Invalid_operation
-dqdiv878 divide Inf sNaN90 -> NaN90 Invalid_operation
-dqdiv879 divide NaN sNaN89 -> NaN89 Invalid_operation
-
-dqdiv881 divide -NaN9 -Inf -> -NaN9
-dqdiv882 divide -NaN8 1000 -> -NaN8
-dqdiv883 divide -NaN7 Inf -> -NaN7
-dqdiv884 divide -NaN6 -NaN5 -> -NaN6
-dqdiv885 divide -Inf -NaN4 -> -NaN4
-dqdiv886 divide -1000 -NaN3 -> -NaN3
-dqdiv887 divide Inf -NaN2 -> -NaN2
-
-dqdiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqdiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
-dqdiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
-dqdiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
-dqdiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-dqdiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
-dqdiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
-dqdiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
-dqdiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- Various flavours of divide by 0
-dqdiv901 divide 0 0 -> NaN Division_undefined
-dqdiv902 divide 0.0E5 0 -> NaN Division_undefined
-dqdiv903 divide 0.000 0 -> NaN Division_undefined
-dqdiv904 divide 0.0001 0 -> Infinity Division_by_zero
-dqdiv905 divide 0.01 0 -> Infinity Division_by_zero
-dqdiv906 divide 0.1 0 -> Infinity Division_by_zero
-dqdiv907 divide 1 0 -> Infinity Division_by_zero
-dqdiv908 divide 1 0.0 -> Infinity Division_by_zero
-dqdiv909 divide 10 0.0 -> Infinity Division_by_zero
-dqdiv910 divide 1E+100 0.0 -> Infinity Division_by_zero
-dqdiv911 divide 1E+100 0 -> Infinity Division_by_zero
-
-dqdiv921 divide -0.0001 0 -> -Infinity Division_by_zero
-dqdiv922 divide -0.01 0 -> -Infinity Division_by_zero
-dqdiv923 divide -0.1 0 -> -Infinity Division_by_zero
-dqdiv924 divide -1 0 -> -Infinity Division_by_zero
-dqdiv925 divide -1 0.0 -> -Infinity Division_by_zero
-dqdiv926 divide -10 0.0 -> -Infinity Division_by_zero
-dqdiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero
-dqdiv928 divide -1E+100 0 -> -Infinity Division_by_zero
-
-dqdiv931 divide 0.0001 -0 -> -Infinity Division_by_zero
-dqdiv932 divide 0.01 -0 -> -Infinity Division_by_zero
-dqdiv933 divide 0.1 -0 -> -Infinity Division_by_zero
-dqdiv934 divide 1 -0 -> -Infinity Division_by_zero
-dqdiv935 divide 1 -0.0 -> -Infinity Division_by_zero
-dqdiv936 divide 10 -0.0 -> -Infinity Division_by_zero
-dqdiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
-dqdiv938 divide 1E+100 -0 -> -Infinity Division_by_zero
-
-dqdiv941 divide -0.0001 -0 -> Infinity Division_by_zero
-dqdiv942 divide -0.01 -0 -> Infinity Division_by_zero
-dqdiv943 divide -0.1 -0 -> Infinity Division_by_zero
-dqdiv944 divide -1 -0 -> Infinity Division_by_zero
-dqdiv945 divide -1 -0.0 -> Infinity Division_by_zero
-dqdiv946 divide -10 -0.0 -> Infinity Division_by_zero
-dqdiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero
-dqdiv948 divide -1E+100 -0 -> Infinity Division_by_zero
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dqdiv1021 divide 1E0 1E0 -> 1
-dqdiv1022 divide 1E0 2E0 -> 0.5
-dqdiv1023 divide 1E0 3E0 -> 0.3333333333333333333333333333333333 Inexact Rounded
-dqdiv1024 divide 100E-2 1000E-3 -> 1
-dqdiv1025 divide 24E-1 2E0 -> 1.2
-dqdiv1026 divide 2400E-3 2E0 -> 1.200
-dqdiv1027 divide 5E0 2E0 -> 2.5
-dqdiv1028 divide 5E0 20E-1 -> 2.5
-dqdiv1029 divide 5E0 2000E-3 -> 2.5
-dqdiv1030 divide 5E0 2E-1 -> 25
-dqdiv1031 divide 5E0 20E-2 -> 25
-dqdiv1032 divide 480E-2 3E0 -> 1.60
-dqdiv1033 divide 47E-1 2E0 -> 2.35
-
--- ECMAScript bad examples
-rounding: half_down
-dqdiv1040 divide 5 9 -> 0.5555555555555555555555555555555556 Inexact Rounded
-rounding: half_even
-dqdiv1041 divide 6 11 -> 0.5454545454545454545454545454545455 Inexact Rounded
-
--- Gyuris example
-dqdiv1050 divide 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0.9999999999999999999999999999991254 Inexact Rounded
-
--- overflow and underflow tests .. note subnormal results
--- signs
-dqdiv1751 divide 1e+4277 1e-3311 -> Infinity Overflow Inexact Rounded
-dqdiv1752 divide 1e+4277 -1e-3311 -> -Infinity Overflow Inexact Rounded
-dqdiv1753 divide -1e+4277 1e-3311 -> -Infinity Overflow Inexact Rounded
-dqdiv1754 divide -1e+4277 -1e-3311 -> Infinity Overflow Inexact Rounded
-dqdiv1755 divide 1e-4277 1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1756 divide 1e-4277 -1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1757 divide -1e-4277 1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1758 divide -1e-4277 -1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dqdiv1760 divide 1e-6069 1e+101 -> 1E-6170 Subnormal
-dqdiv1761 divide 1e-6069 1e+102 -> 1E-6171 Subnormal
-dqdiv1762 divide 1e-6069 1e+103 -> 1E-6172 Subnormal
-dqdiv1763 divide 1e-6069 1e+104 -> 1E-6173 Subnormal
-dqdiv1764 divide 1e-6069 1e+105 -> 1E-6174 Subnormal
-dqdiv1765 divide 1e-6069 1e+106 -> 1E-6175 Subnormal
-dqdiv1766 divide 1e-6069 1e+107 -> 1E-6176 Subnormal
-dqdiv1767 divide 1e-6069 1e+108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1768 divide 1e-6069 1e+109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1769 divide 1e-6069 1e+110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-dqdiv1770 divide 1e+40 1e-6101 -> 1.000000000000000000000000000000E+6141 Clamped
-dqdiv1771 divide 1e+40 1e-6102 -> 1.0000000000000000000000000000000E+6142 Clamped
-dqdiv1772 divide 1e+40 1e-6103 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqdiv1773 divide 1e+40 1e-6104 -> 1.000000000000000000000000000000000E+6144 Clamped
-dqdiv1774 divide 1e+40 1e-6105 -> Infinity Overflow Inexact Rounded
-dqdiv1775 divide 1e+40 1e-6106 -> Infinity Overflow Inexact Rounded
-dqdiv1776 divide 1e+40 1e-6107 -> Infinity Overflow Inexact Rounded
-dqdiv1777 divide 1e+40 1e-6108 -> Infinity Overflow Inexact Rounded
-dqdiv1778 divide 1e+40 1e-6109 -> Infinity Overflow Inexact Rounded
-dqdiv1779 divide 1e+40 1e-6110 -> Infinity Overflow Inexact Rounded
-
-dqdiv1801 divide 1.0000E-6172 1 -> 1.0000E-6172 Subnormal
-dqdiv1802 divide 1.000E-6172 1e+1 -> 1.000E-6173 Subnormal
-dqdiv1803 divide 1.00E-6172 1e+2 -> 1.00E-6174 Subnormal
-dqdiv1804 divide 1.0E-6172 1e+3 -> 1.0E-6175 Subnormal
-dqdiv1805 divide 1.0E-6172 1e+4 -> 1E-6176 Subnormal Rounded
-dqdiv1806 divide 1.3E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1807 divide 1.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1808 divide 1.7E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1809 divide 2.3E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1810 divide 2.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1811 divide 2.7E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1812 divide 1.49E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1813 divide 1.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1814 divide 1.51E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1815 divide 2.49E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1816 divide 2.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1817 divide 2.51E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded
-
-dqdiv1818 divide 1E-6172 1e+4 -> 1E-6176 Subnormal
-dqdiv1819 divide 3E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1820 divide 5E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1821 divide 7E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1822 divide 9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1823 divide 9.9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-
-dqdiv1824 divide 1E-6172 -1e+4 -> -1E-6176 Subnormal
-dqdiv1825 divide 3E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1826 divide -5E-6172 1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1827 divide 7E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1828 divide -9E-6172 1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1829 divide 9.9E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1830 divide 3.0E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqdiv1831 divide 1.0E-5977 1e+200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1832 divide 1.0E-5977 1e+199 -> 1E-6176 Subnormal Rounded
-dqdiv1833 divide 1.0E-5977 1e+198 -> 1.0E-6175 Subnormal
-dqdiv1834 divide 2.0E-5977 2e+198 -> 1.0E-6175 Subnormal
-dqdiv1835 divide 4.0E-5977 4e+198 -> 1.0E-6175 Subnormal
-dqdiv1836 divide 10.0E-5977 10e+198 -> 1.0E-6175 Subnormal
-dqdiv1837 divide 30.0E-5977 30e+198 -> 1.0E-6175 Subnormal
-dqdiv1838 divide 40.0E-5982 40e+166 -> 1.0E-6148 Subnormal
-dqdiv1839 divide 40.0E-5982 40e+165 -> 1.0E-6147 Subnormal
-dqdiv1840 divide 40.0E-5982 40e+164 -> 1.0E-6146 Subnormal
-
--- randoms
-rounding: half_even
-dqdiv2010 divide -5231195652931651968034356117118850 -7243718664422548573203260970.34995 -> 722169.9095831284624736051460550680 Inexact Rounded
-dqdiv2011 divide -89584669773927.82711237350022515352 -42077943728529635884.21142627532985 -> 0.000002129017291146471565928125887527266 Inexact Rounded
-dqdiv2012 divide -2.828201693360723203806974891946180E-232 812596541221823960386384403089240.9 -> -3.480450075640521320040055759125120E-265 Inexact Rounded
-dqdiv2013 divide -6442775372761069267502937539408720 24904085056.69185465145182606089196 -> -258703556388226463687701.4884719589 Inexact Rounded
-dqdiv2014 divide 5.535520011272625629610079879714705 -44343664650.57203052003068113531208 -> -1.248322630728089308975940533493562E-10 Inexact Rounded
-dqdiv2015 divide 65919273712517865964325.99419625010 -314733354141381737378622515.7789054 -> -0.0002094448295521490616379784758911632 Inexact Rounded
-dqdiv2016 divide -7.779172568193197107115275140431129E+759 -140453015639.3988987652895178782143 -> 5.538629792161641534962774244238115E+748 Inexact Rounded
-dqdiv2017 divide 644314832597569.0181226067518178797 -115024585257425.1635759521565201075 -> -5.601540150356479257367687450922795 Inexact Rounded
-dqdiv2018 divide 6.898640941579611450676592553286870E-47 -11272429881407851485163914999.25943 -> -6.119923578285338689371137648319280E-75 Inexact Rounded
-dqdiv2019 divide -3591344544888727133.30819750163254 5329395.423792795661446561090331037 -> -673874662941.1968525589460533725290 Inexact Rounded
-dqdiv2020 divide -7.682356781384631313156462724425838E+747 -6.60375855512219057281922141809940E+703 -> 1.163330960279556016678379128875149E+44 Inexact Rounded
-dqdiv2021 divide -4511495596596941820863224.274679699 3365395017.263329795449661616090724 -> -1340554548115304.904166888018346299 Inexact Rounded
-dqdiv2022 divide 5.211164127840931517263639608151299 164.5566381356276567012533847006453 -> 0.03166790587655228864478260157156510 Inexact Rounded
-dqdiv2023 divide -49891.2243893458830384077684620383 -47179.9312961860747554053371171530 -> 1.057467084386767291602189656430268 Inexact Rounded
-dqdiv2024 divide 15065477.47214268488077415462413353 4366211.120892953261309529740552596 -> 3.450469309661227984244545513441359 Inexact Rounded
-dqdiv2025 divide 1.575670269440761846109602429612644E+370 653199649324740300.006185482643439 -> 2.412233795700359170904588548041481E+352 Inexact Rounded
-dqdiv2026 divide -2112422311733448924573432192.620145 -80067206.03590693153848215848613406 -> 26383115089417660175.20102646756574 Inexact Rounded
-dqdiv2027 divide -67096536051279809.32218611548721839 -869685412881941081664251990181.1049 -> 7.715035236584805921278566365231168E-14 Inexact Rounded
-dqdiv2028 divide -58612908548962047.21866913425488972 -978449597531.3873665583475633831644 -> 59903.86085991703091236507859837023 Inexact Rounded
-dqdiv2029 divide -133032412010942.1476864138213319796 -7.882059293498670705446528648201359E-428 -> 1.687787506504433064549515681693715E+441 Inexact Rounded
-dqdiv2030 divide 1.83746698338966029492299716360513E+977 -9.897926608979649951672839879128603E+154 -> -1.856416051542212552042390218062458E+822 Inexact Rounded
-dqdiv2031 divide -113742475841399236307128962.1507063 8298602.203049834732657567965262989 -> -13706221006665137826.16557393919929 Inexact Rounded
-dqdiv2032 divide 196.4787574650754152995941808331862 929.6553388472318094427422117172394 -> 0.2113458066176526651006917922814018 Inexact Rounded
-dqdiv2033 divide 71931221465.43867996282803628130350 3838685934206426257090718.402248853 -> 1.873850132527423413607199513324021E-14 Inexact Rounded
-dqdiv2034 divide 488.4282502289651653783596246312885 -80.68940956806634280078706577953188 -> -6.053189047280693318844801899473272 Inexact Rounded
-dqdiv2035 divide 9.001764344963921754981762913247394E-162 -8.585540973667205753734967645386919E-729 -> -1.048479574271827326396012573232934E+567 Inexact Rounded
-dqdiv2036 divide -7.404133959409894743706402857145471E-828 -51.38159929460289711134684843086265 -> 1.441008855516029461032061785219773E-829 Inexact Rounded
-dqdiv2037 divide 2.967520235574419794048994436040717E-613 -6252513855.91394894949879262731889 -> -4.746123405656409127572998751885338E-623 Inexact Rounded
-dqdiv2038 divide -18826852654824040505.83920366765051 -6336924877942437992590557460147340 -> 2.970976146546494669807886278519194E-15 Inexact Rounded
-dqdiv2039 divide -8.101406784809197604949584001735949E+561 4.823300306948942821076681658771635E+361 -> -1.679639721610839204738445747238987E+200 Inexact Rounded
-dqdiv2040 divide -6.11981977773094052331062585191723E+295 1.507610253755339328302779005586534E+238 -> -4.059285058911577244044418416044763E+57 Inexact Rounded
-dqdiv2041 divide 6.472638850046815880599220534274055E-596 -4.475233712083047516933911786159972 -> -1.446324207062261745520496475778879E-596 Inexact Rounded
-dqdiv2042 divide -84438593330.71277839631144509397112 -586684596204401664208947.4054879633 -> 1.439250218550041228759983937772504E-13 Inexact Rounded
-dqdiv2043 divide 9.354533233294022616695815656704369E-24 405.500390626135304252144163591746 -> 2.306911028827774549740571229736198E-26 Inexact Rounded
-dqdiv2044 divide 985606423350210.7374876650149957881 -36811563697.41925681866694859828794 -> -26774.36990864119445335813354717711 Inexact Rounded
-dqdiv2045 divide -8.187280774177715706278002247766311E-123 -38784124393.91212870828430001300068 -> 2.110987653356139147357240727794365E-133 Inexact Rounded
-dqdiv2046 divide -4.612203126350070903459245798371657E+912 7.971562182727956290901984736800519E+64 -> -5.785820922708683237098826662769748E+847 Inexact Rounded
-dqdiv2047 divide 4.661015909421485298247928967977089E+888 -6.360911253323922338737311563845581E+388 -> -7.327591478321365980156654539638836E+499 Inexact Rounded
-dqdiv2048 divide 9156078172903.257500003260710833030 7.189796653262147139071634237964074E-90 -> 1.273482215766000994365201545096026E+102 Inexact Rounded
-dqdiv2049 divide -1.710722303327476586373477781276586E-311 -3167561628260156837329323.729380695 -> 5.400754599578613984875752958645655E-336 Inexact Rounded
-dqdiv2050 divide -4.647935210881806238321616345413021E-878 209388.5431867744648177308460639582 -> -2.219765771394593733140494297388140E-883 Inexact Rounded
-dqdiv2051 divide 5958.694728395760992719084781582700 4.541510156564315632536353171846096E-746 -> 1.312051393253638664947852693005480E+749 Inexact Rounded
-dqdiv2052 divide -7.935732544649702175256699886872093E-489 -7.433329073664793138998765647467971E+360 -> 1.067587949626076917672271619664656E-849 Inexact Rounded
-dqdiv2053 divide -2746650864601157.863589959939901350 7.016684945507647528907184694359598E+548 -> -3.914456593009309529351254950429932E-534 Inexact Rounded
-dqdiv2054 divide 3605149408631197365447953.994569178 -75614025825649082.78264864428237833 -> -47678315.88472693507060063188020532 Inexact Rounded
-dqdiv2055 divide 788194320921798404906375214.196349 -6.222718148433247384932573401976337E-418 -> -1.266639918634671803982222244977287E+444 Inexact Rounded
-dqdiv2056 divide 5620722730534752.758208943447603211 6.843552841168538319123000917657759E-139 -> 8.213164800485434666629970443739554E+153 Inexact Rounded
-dqdiv2057 divide 7304534676713703938102.403949019402 -576169.3685010935108153023803590835 -> -12677756014201995.31969237144394772 Inexact Rounded
-dqdiv2058 divide 8067918762.134621639254916786945547 -8.774771480055536009105596163864758E+954 -> -9.194448858836332156766764605125245E-946 Inexact Rounded
-dqdiv2059 divide 8.702093454123046507578256899537563E-324 -5.875399733016018404580201176576293E-401 -> -1.481106622452052581470443526957335E+77 Inexact Rounded
-dqdiv2060 divide -41426.01662518451861386352415092356 90.00146621684478300510769802013464 -> -460.2815750287318692732067709176200 Inexact Rounded
-
--- random divide tests with result near 1
-dqdiv4001 divide 2003100352770753969878925664524900 2003100352770753969878925664497824 -> 1.000000000000000000000000000013517 Inexact Rounded
-dqdiv4002 divide 4817785793916490652579552318371645 4817785793916490652579552318362097 -> 1.000000000000000000000000000001982 Inexact Rounded
-dqdiv4003 divide 8299187410920067325648068439560282 8299187410920067325648068439591159 -> 0.9999999999999999999999999999962795 Inexact Rounded
-dqdiv4004 divide 5641088455897407044544461785365899 5641088455897407044544461785389965 -> 0.9999999999999999999999999999957338 Inexact Rounded
-dqdiv4005 divide 5752274694706545359326361313490424 5752274694706545359326361313502723 -> 0.9999999999999999999999999999978619 Inexact Rounded
-dqdiv4006 divide 6762079477373670594829319346099665 6762079477373670594829319346132579 -> 0.9999999999999999999999999999951326 Inexact Rounded
-dqdiv4007 divide 7286425153691890341633023222602916 7286425153691890341633023222606556 -> 0.9999999999999999999999999999995004 Inexact Rounded
-dqdiv4008 divide 9481233991901305727648306421946655 9481233991901305727648306421919124 -> 1.000000000000000000000000000002904 Inexact Rounded
-dqdiv4009 divide 4282053941893951742029444065614311 4282053941893951742029444065583077 -> 1.000000000000000000000000000007294 Inexact Rounded
-dqdiv4010 divide 626888225441250639741781850338695 626888225441250639741781850327299 -> 1.000000000000000000000000000018179 Inexact Rounded
-dqdiv4011 divide 3860973649222028009456598604468547 3860973649222028009456598604476849 -> 0.9999999999999999999999999999978498 Inexact Rounded
-dqdiv4012 divide 4753157080127468127908060607821839 4753157080127468127908060607788379 -> 1.000000000000000000000000000007040 Inexact Rounded
-dqdiv4013 divide 552448546203754062805706277880419 552448546203754062805706277881903 -> 0.9999999999999999999999999999973138 Inexact Rounded
-dqdiv4014 divide 8405954527952158455323713728917395 8405954527952158455323713728933866 -> 0.9999999999999999999999999999980406 Inexact Rounded
-dqdiv4015 divide 7554096502235321142555802238016116 7554096502235321142555802238026546 -> 0.9999999999999999999999999999986193 Inexact Rounded
-dqdiv4016 divide 4053257674127518606871054934746782 4053257674127518606871054934767355 -> 0.9999999999999999999999999999949243 Inexact Rounded
-dqdiv4017 divide 7112419420755090454716888844011582 7112419420755090454716888844038105 -> 0.9999999999999999999999999999962709 Inexact Rounded
-dqdiv4018 divide 3132302137520072728164549730911846 3132302137520072728164549730908416 -> 1.000000000000000000000000000001095 Inexact Rounded
-dqdiv4019 divide 4788374045841416355706715048161013 4788374045841416355706715048190077 -> 0.9999999999999999999999999999939303 Inexact Rounded
-dqdiv4020 divide 9466021636047630218238075099510597 9466021636047630218238075099484053 -> 1.000000000000000000000000000002804 Inexact Rounded
-dqdiv4021 divide 912742745646765625597399692138650 912742745646765625597399692139042 -> 0.9999999999999999999999999999995705 Inexact Rounded
-dqdiv4022 divide 9508402742933643208806264897188504 9508402742933643208806264897195973 -> 0.9999999999999999999999999999992145 Inexact Rounded
-dqdiv4023 divide 1186956795727233704962361914360895 1186956795727233704962361914329577 -> 1.000000000000000000000000000026385 Inexact Rounded
-dqdiv4024 divide 5972210268839014812696916170967938 5972210268839014812696916170954974 -> 1.000000000000000000000000000002171 Inexact Rounded
-dqdiv4025 divide 2303801625521619930894460139793140 2303801625521619930894460139799643 -> 0.9999999999999999999999999999971773 Inexact Rounded
-dqdiv4026 divide 6022231560002898264777393473966595 6022231560002898264777393473947198 -> 1.000000000000000000000000000003221 Inexact Rounded
-dqdiv4027 divide 8426148335801396199969346032210893 8426148335801396199969346032203179 -> 1.000000000000000000000000000000915 Inexact Rounded
-dqdiv4028 divide 8812278947028784637382847098411749 8812278947028784637382847098385317 -> 1.000000000000000000000000000002999 Inexact Rounded
-dqdiv4029 divide 8145282002348367383264197170116146 8145282002348367383264197170083988 -> 1.000000000000000000000000000003948 Inexact Rounded
-dqdiv4030 divide 6821577571876840153123510107387026 6821577571876840153123510107418008 -> 0.9999999999999999999999999999954582 Inexact Rounded
-dqdiv4031 divide 9018555319518966970480565482023720 9018555319518966970480565482013346 -> 1.000000000000000000000000000001150 Inexact Rounded
-dqdiv4032 divide 4602155712998228449640717252788864 4602155712998228449640717252818502 -> 0.9999999999999999999999999999935600 Inexact Rounded
-dqdiv4033 divide 6675607481522785614506828292264472 6675607481522785614506828292277100 -> 0.9999999999999999999999999999981083 Inexact Rounded
-dqdiv4034 divide 4015881516871833897766945836264472 4015881516871833897766945836262645 -> 1.000000000000000000000000000000455 Inexact Rounded
-dqdiv4035 divide 1415580205933411837595459716910365 1415580205933411837595459716880139 -> 1.000000000000000000000000000021352 Inexact Rounded
-dqdiv4036 divide 9432968297069542816752035276361552 9432968297069542816752035276353054 -> 1.000000000000000000000000000000901 Inexact Rounded
-dqdiv4037 divide 4799319591303848500532766682140658 4799319591303848500532766682172655 -> 0.9999999999999999999999999999933330 Inexact Rounded
-dqdiv4038 divide 316854270732839529790584284987472 316854270732839529790584285004832 -> 0.9999999999999999999999999999452114 Inexact Rounded
-dqdiv4039 divide 3598981300592490427826027975697415 3598981300592490427826027975686712 -> 1.000000000000000000000000000002974 Inexact Rounded
-dqdiv4040 divide 1664315435694461371155800682196520 1664315435694461371155800682195617 -> 1.000000000000000000000000000000543 Inexact Rounded
-dqdiv4041 divide 1680872316531128890102855316510581 1680872316531128890102855316495545 -> 1.000000000000000000000000000008945 Inexact Rounded
-dqdiv4042 divide 9881274879566405475755499281644730 9881274879566405475755499281615743 -> 1.000000000000000000000000000002934 Inexact Rounded
-dqdiv4043 divide 4737225957717466960447204232279216 4737225957717466960447204232277452 -> 1.000000000000000000000000000000372 Inexact Rounded
-dqdiv4044 divide 2482097379414867061213319346418288 2482097379414867061213319346387936 -> 1.000000000000000000000000000012228 Inexact Rounded
-dqdiv4045 divide 7406977595233762723576434122161868 7406977595233762723576434122189042 -> 0.9999999999999999999999999999963313 Inexact Rounded
-dqdiv4046 divide 228782057757566047086593281773577 228782057757566047086593281769727 -> 1.000000000000000000000000000016828 Inexact Rounded
-dqdiv4047 divide 2956594270240579648823270540367653 2956594270240579648823270540368556 -> 0.9999999999999999999999999999996946 Inexact Rounded
-dqdiv4048 divide 6326964098897620620534136767634340 6326964098897620620534136767619339 -> 1.000000000000000000000000000002371 Inexact Rounded
-dqdiv4049 divide 414586440456590215247002678327800 414586440456590215247002678316922 -> 1.000000000000000000000000000026238 Inexact Rounded
-dqdiv4050 divide 7364552208570039386220505636779125 7364552208570039386220505636803548 -> 0.9999999999999999999999999999966837 Inexact Rounded
-dqdiv4051 divide 5626266749902369710022824950590056 5626266749902369710022824950591008 -> 0.9999999999999999999999999999998308 Inexact Rounded
-dqdiv4052 divide 4863278293916197454987481343460484 4863278293916197454987481343442522 -> 1.000000000000000000000000000003693 Inexact Rounded
-dqdiv4053 divide 1170713582030637359713249796835483 1170713582030637359713249796823345 -> 1.000000000000000000000000000010368 Inexact Rounded
-dqdiv4054 divide 9838062494725965667776326556052931 9838062494725965667776326556061002 -> 0.9999999999999999999999999999991796 Inexact Rounded
-dqdiv4055 divide 4071388731298861093005687091498922 4071388731298861093005687091498278 -> 1.000000000000000000000000000000158 Inexact Rounded
-dqdiv4056 divide 8753155722324706795855038590272526 8753155722324706795855038590276656 -> 0.9999999999999999999999999999995282 Inexact Rounded
-dqdiv4057 divide 4399941911533273418844742658240485 4399941911533273418844742658219891 -> 1.000000000000000000000000000004681 Inexact Rounded
-dqdiv4058 divide 4127884159949503677776430620050269 4127884159949503677776430620026091 -> 1.000000000000000000000000000005857 Inexact Rounded
-dqdiv4059 divide 5536160822360800067042528317438808 5536160822360800067042528317450687 -> 0.9999999999999999999999999999978543 Inexact Rounded
-dqdiv4060 divide 3973234998468664936671088237710246 3973234998468664936671088237741886 -> 0.9999999999999999999999999999920367 Inexact Rounded
-dqdiv4061 divide 9824855935638263593410444142327358 9824855935638263593410444142328576 -> 0.9999999999999999999999999999998760 Inexact Rounded
-dqdiv4062 divide 5917078517340218131867327300814867 5917078517340218131867327300788701 -> 1.000000000000000000000000000004422 Inexact Rounded
-dqdiv4063 divide 4354236601830544882286139612521362 4354236601830544882286139612543223 -> 0.9999999999999999999999999999949794 Inexact Rounded
-dqdiv4064 divide 8058474772375259017342110013891294 8058474772375259017342110013906792 -> 0.9999999999999999999999999999980768 Inexact Rounded
-dqdiv4065 divide 5519604020981748170517093746166328 5519604020981748170517093746181763 -> 0.9999999999999999999999999999972036 Inexact Rounded
-dqdiv4066 divide 1502130966879805458831323782443139 1502130966879805458831323782412213 -> 1.000000000000000000000000000020588 Inexact Rounded
-dqdiv4067 divide 562795633719481212915159787980270 562795633719481212915159788007066 -> 0.9999999999999999999999999999523877 Inexact Rounded
-dqdiv4068 divide 6584743324494664273941281557268878 6584743324494664273941281557258945 -> 1.000000000000000000000000000001508 Inexact Rounded
-dqdiv4069 divide 3632000327285743997976431109416500 3632000327285743997976431109408107 -> 1.000000000000000000000000000002311 Inexact Rounded
-dqdiv4070 divide 1145827237315430089388953838561450 1145827237315430089388953838527332 -> 1.000000000000000000000000000029776 Inexact Rounded
-dqdiv4071 divide 8874431010357691869725372317350380 8874431010357691869725372317316472 -> 1.000000000000000000000000000003821 Inexact Rounded
-dqdiv4072 divide 992948718902804648119753141202196 992948718902804648119753141235222 -> 0.9999999999999999999999999999667395 Inexact Rounded
-dqdiv4073 divide 2522735183374218505142417265439989 2522735183374218505142417265453779 -> 0.9999999999999999999999999999945337 Inexact Rounded
-dqdiv4074 divide 2668419161912936508006872303501052 2668419161912936508006872303471036 -> 1.000000000000000000000000000011249 Inexact Rounded
-dqdiv4075 divide 3036169085665186712590941111775092 3036169085665186712590941111808846 -> 0.9999999999999999999999999999888827 Inexact Rounded
-dqdiv4076 divide 9441634604917231638508898934006147 9441634604917231638508898934000288 -> 1.000000000000000000000000000000621 Inexact Rounded
-dqdiv4077 divide 2677301353164377091111458811839190 2677301353164377091111458811867722 -> 0.9999999999999999999999999999893430 Inexact Rounded
-dqdiv4078 divide 6844979203112066166583765857171426 6844979203112066166583765857189682 -> 0.9999999999999999999999999999973329 Inexact Rounded
-dqdiv4079 divide 2220337435141796724323783960231661 2220337435141796724323783960208778 -> 1.000000000000000000000000000010306 Inexact Rounded
-dqdiv4080 divide 6447424700019783931569996989561380 6447424700019783931569996989572454 -> 0.9999999999999999999999999999982824 Inexact Rounded
-dqdiv4081 divide 7512856762696607119847092195587180 7512856762696607119847092195557346 -> 1.000000000000000000000000000003971 Inexact Rounded
-dqdiv4082 divide 7395261981193960399087819077237482 7395261981193960399087819077242487 -> 0.9999999999999999999999999999993232 Inexact Rounded
-dqdiv4083 divide 2253442467682584035792724884376735 2253442467682584035792724884407178 -> 0.9999999999999999999999999999864904 Inexact Rounded
-dqdiv4084 divide 8153138680300213135577336466190997 8153138680300213135577336466220607 -> 0.9999999999999999999999999999963683 Inexact Rounded
-dqdiv4085 divide 4668731252254148074041022681801390 4668731252254148074041022681778101 -> 1.000000000000000000000000000004988 Inexact Rounded
-dqdiv4086 divide 6078404557993669696040425501815056 6078404557993669696040425501797612 -> 1.000000000000000000000000000002870 Inexact Rounded
-dqdiv4087 divide 2306352359874261623223356878316278 2306352359874261623223356878335612 -> 0.9999999999999999999999999999916171 Inexact Rounded
-dqdiv4088 divide 3264842186668480362900909564091908 3264842186668480362900909564058658 -> 1.000000000000000000000000000010184 Inexact Rounded
-dqdiv4089 divide 6971985047279636878957959608612204 6971985047279636878957959608615088 -> 0.9999999999999999999999999999995863 Inexact Rounded
-dqdiv4090 divide 5262810889952721235466445973816257 5262810889952721235466445973783077 -> 1.000000000000000000000000000006305 Inexact Rounded
-dqdiv4091 divide 7947944731035267178548357070080288 7947944731035267178548357070061339 -> 1.000000000000000000000000000002384 Inexact Rounded
-dqdiv4092 divide 5071808908395375108383035800443229 5071808908395375108383035800412429 -> 1.000000000000000000000000000006073 Inexact Rounded
-dqdiv4093 divide 2043146542084503655511507209262969 2043146542084503655511507209249263 -> 1.000000000000000000000000000006708 Inexact Rounded
-dqdiv4094 divide 4097632735384534181661959731264802 4097632735384534181661959731234499 -> 1.000000000000000000000000000007395 Inexact Rounded
-dqdiv4095 divide 3061477642831387489729464587044430 3061477642831387489729464587059452 -> 0.9999999999999999999999999999950932 Inexact Rounded
-dqdiv4096 divide 3429854941039776159498802936252638 3429854941039776159498802936246415 -> 1.000000000000000000000000000001814 Inexact Rounded
-dqdiv4097 divide 4874324979578599700024133278284545 4874324979578599700024133278262131 -> 1.000000000000000000000000000004598 Inexact Rounded
-dqdiv4098 divide 5701652369691833541455978515820882 5701652369691833541455978515834854 -> 0.9999999999999999999999999999975495 Inexact Rounded
-dqdiv4099 divide 2928205728402945266953255632343113 2928205728402945266953255632373794 -> 0.9999999999999999999999999999895223 Inexact Rounded
-
--- Null tests
-dqdiv9998 divide 10 # -> NaN Invalid_operation
-dqdiv9999 divide # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqDivide.decTest -- decQuad division --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqdiv001 divide 1 1 -> 1
+dqdiv002 divide 2 1 -> 2
+dqdiv003 divide 1 2 -> 0.5
+dqdiv004 divide 2 2 -> 1
+dqdiv005 divide 0 1 -> 0
+dqdiv006 divide 0 2 -> 0
+dqdiv007 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded
+dqdiv008 divide 2 3 -> 0.6666666666666666666666666666666667 Inexact Rounded
+dqdiv009 divide 3 3 -> 1
+
+dqdiv010 divide 2.4 1 -> 2.4
+dqdiv011 divide 2.4 -1 -> -2.4
+dqdiv012 divide -2.4 1 -> -2.4
+dqdiv013 divide -2.4 -1 -> 2.4
+dqdiv014 divide 2.40 1 -> 2.40
+dqdiv015 divide 2.400 1 -> 2.400
+dqdiv016 divide 2.4 2 -> 1.2
+dqdiv017 divide 2.400 2 -> 1.200
+dqdiv018 divide 2. 2 -> 1
+dqdiv019 divide 20 20 -> 1
+
+dqdiv020 divide 187 187 -> 1
+dqdiv021 divide 5 2 -> 2.5
+dqdiv022 divide 50 20 -> 2.5
+dqdiv023 divide 500 200 -> 2.5
+dqdiv024 divide 50.0 20.0 -> 2.5
+dqdiv025 divide 5.00 2.00 -> 2.5
+dqdiv026 divide 5 2.0 -> 2.5
+dqdiv027 divide 5 2.000 -> 2.5
+dqdiv028 divide 5 0.20 -> 25
+dqdiv029 divide 5 0.200 -> 25
+dqdiv030 divide 10 1 -> 10
+dqdiv031 divide 100 1 -> 100
+dqdiv032 divide 1000 1 -> 1000
+dqdiv033 divide 1000 100 -> 10
+
+dqdiv035 divide 1 2 -> 0.5
+dqdiv036 divide 1 4 -> 0.25
+dqdiv037 divide 1 8 -> 0.125
+dqdiv038 divide 1 16 -> 0.0625
+dqdiv039 divide 1 32 -> 0.03125
+dqdiv040 divide 1 64 -> 0.015625
+dqdiv041 divide 1 -2 -> -0.5
+dqdiv042 divide 1 -4 -> -0.25
+dqdiv043 divide 1 -8 -> -0.125
+dqdiv044 divide 1 -16 -> -0.0625
+dqdiv045 divide 1 -32 -> -0.03125
+dqdiv046 divide 1 -64 -> -0.015625
+dqdiv047 divide -1 2 -> -0.5
+dqdiv048 divide -1 4 -> -0.25
+dqdiv049 divide -1 8 -> -0.125
+dqdiv050 divide -1 16 -> -0.0625
+dqdiv051 divide -1 32 -> -0.03125
+dqdiv052 divide -1 64 -> -0.015625
+dqdiv053 divide -1 -2 -> 0.5
+dqdiv054 divide -1 -4 -> 0.25
+dqdiv055 divide -1 -8 -> 0.125
+dqdiv056 divide -1 -16 -> 0.0625
+dqdiv057 divide -1 -32 -> 0.03125
+dqdiv058 divide -1 -64 -> 0.015625
+
+-- bcdTime
+dqdiv060 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded
+dqdiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717123193907511985359 Inexact Rounded
+
+-- 1234567890123456
+dqdiv067 divide 9999999999999999999999999999999999 1 -> 9999999999999999999999999999999999
+dqdiv068 divide 999999999999999999999999999999999 1 -> 999999999999999999999999999999999
+dqdiv069 divide 99999999999999999999999999999999 1 -> 99999999999999999999999999999999
+dqdiv070 divide 99999999999999999 1 -> 99999999999999999
+dqdiv071 divide 9999999999999999 1 -> 9999999999999999
+dqdiv072 divide 999999999999999 1 -> 999999999999999
+dqdiv073 divide 99999999999999 1 -> 99999999999999
+dqdiv074 divide 9999999999999 1 -> 9999999999999
+dqdiv075 divide 999999999999 1 -> 999999999999
+dqdiv076 divide 99999999999 1 -> 99999999999
+dqdiv077 divide 9999999999 1 -> 9999999999
+dqdiv078 divide 999999999 1 -> 999999999
+dqdiv079 divide 99999999 1 -> 99999999
+dqdiv080 divide 9999999 1 -> 9999999
+dqdiv081 divide 999999 1 -> 999999
+dqdiv082 divide 99999 1 -> 99999
+dqdiv083 divide 9999 1 -> 9999
+dqdiv084 divide 999 1 -> 999
+dqdiv085 divide 99 1 -> 99
+dqdiv086 divide 9 1 -> 9
+
+dqdiv090 divide 0. 1 -> 0
+dqdiv091 divide .0 1 -> 0.0
+dqdiv092 divide 0.00 1 -> 0.00
+dqdiv093 divide 0.00E+9 1 -> 0E+7
+dqdiv094 divide 0.0000E-50 1 -> 0E-54
+
+dqdiv095 divide 1 1E-8 -> 1E+8
+dqdiv096 divide 1 1E-9 -> 1E+9
+dqdiv097 divide 1 1E-10 -> 1E+10
+dqdiv098 divide 1 1E-11 -> 1E+11
+dqdiv099 divide 1 1E-12 -> 1E+12
+
+dqdiv100 divide 1 1 -> 1
+dqdiv101 divide 1 2 -> 0.5
+dqdiv102 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded
+dqdiv103 divide 1 4 -> 0.25
+dqdiv104 divide 1 5 -> 0.2
+dqdiv105 divide 1 6 -> 0.1666666666666666666666666666666667 Inexact Rounded
+dqdiv106 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded
+dqdiv107 divide 1 8 -> 0.125
+dqdiv108 divide 1 9 -> 0.1111111111111111111111111111111111 Inexact Rounded
+dqdiv109 divide 1 10 -> 0.1
+dqdiv110 divide 1 1 -> 1
+dqdiv111 divide 2 1 -> 2
+dqdiv112 divide 3 1 -> 3
+dqdiv113 divide 4 1 -> 4
+dqdiv114 divide 5 1 -> 5
+dqdiv115 divide 6 1 -> 6
+dqdiv116 divide 7 1 -> 7
+dqdiv117 divide 8 1 -> 8
+dqdiv118 divide 9 1 -> 9
+dqdiv119 divide 10 1 -> 10
+
+dqdiv120 divide 3E+1 0.001 -> 3E+4
+dqdiv121 divide 2.200 2 -> 1.100
+
+dqdiv130 divide 12345 4.999 -> 2469.493898779755951190238047609522 Inexact Rounded
+dqdiv131 divide 12345 4.99 -> 2473.947895791583166332665330661323 Inexact Rounded
+dqdiv132 divide 12345 4.9 -> 2519.387755102040816326530612244898 Inexact Rounded
+dqdiv133 divide 12345 5 -> 2469
+dqdiv134 divide 12345 5.1 -> 2420.588235294117647058823529411765 Inexact Rounded
+dqdiv135 divide 12345 5.01 -> 2464.071856287425149700598802395210 Inexact Rounded
+dqdiv136 divide 12345 5.001 -> 2468.506298740251949610077984403119 Inexact Rounded
+
+-- test possibly imprecise results
+dqdiv220 divide 391 597 -> 0.6549413735343383584589614740368509 Inexact Rounded
+dqdiv221 divide 391 -597 -> -0.6549413735343383584589614740368509 Inexact Rounded
+dqdiv222 divide -391 597 -> -0.6549413735343383584589614740368509 Inexact Rounded
+dqdiv223 divide -391 -597 -> 0.6549413735343383584589614740368509 Inexact Rounded
+
+-- test some cases that are close to exponent overflow
+dqdiv270 divide 1 1e6144 -> 1E-6144 Subnormal
+dqdiv271 divide 1 0.9e6144 -> 1.11111111111111111111111111111111E-6144 Rounded Inexact Subnormal Underflow
+dqdiv272 divide 1 0.99e6144 -> 1.01010101010101010101010101010101E-6144 Rounded Inexact Subnormal Underflow
+dqdiv273 divide 1 0.9999999999999999e6144 -> 1.00000000000000010000000000000001E-6144 Rounded Inexact Subnormal Underflow
+dqdiv274 divide 9e6144 1 -> 9.000000000000000000000000000000000E+6144 Clamped
+dqdiv275 divide 9.9e6144 1 -> 9.900000000000000000000000000000000E+6144 Clamped
+dqdiv276 divide 9.99e6144 1 -> 9.990000000000000000000000000000000E+6144 Clamped
+dqdiv277 divide 9.999999999999999e6144 1 -> 9.999999999999999000000000000000000E+6144 Clamped
+
+dqdiv278 divide 1 0.9999999999999999999999999999999999e6144 -> 1.00000000000000000000000000000000E-6144 Rounded Inexact Subnormal Underflow
+dqdiv279 divide 9.999999999999999999999999999999999e6144 1 -> 9.999999999999999999999999999999999E+6144
+
+-- Divide into 0 tests
+dqdiv301 divide 0 7 -> 0
+dqdiv302 divide 0 7E-5 -> 0E+5
+dqdiv303 divide 0 7E-1 -> 0E+1
+dqdiv304 divide 0 7E+1 -> 0.0
+dqdiv305 divide 0 7E+5 -> 0.00000
+dqdiv306 divide 0 7E+6 -> 0.000000
+dqdiv307 divide 0 7E+7 -> 0E-7
+dqdiv308 divide 0 70E-5 -> 0E+5
+dqdiv309 divide 0 70E-1 -> 0E+1
+dqdiv310 divide 0 70E+0 -> 0
+dqdiv311 divide 0 70E+1 -> 0.0
+dqdiv312 divide 0 70E+5 -> 0.00000
+dqdiv313 divide 0 70E+6 -> 0.000000
+dqdiv314 divide 0 70E+7 -> 0E-7
+dqdiv315 divide 0 700E-5 -> 0E+5
+dqdiv316 divide 0 700E-1 -> 0E+1
+dqdiv317 divide 0 700E+0 -> 0
+dqdiv318 divide 0 700E+1 -> 0.0
+dqdiv319 divide 0 700E+5 -> 0.00000
+dqdiv320 divide 0 700E+6 -> 0.000000
+dqdiv321 divide 0 700E+7 -> 0E-7
+dqdiv322 divide 0 700E+77 -> 0E-77
+
+dqdiv331 divide 0E-3 7E-5 -> 0E+2
+dqdiv332 divide 0E-3 7E-1 -> 0.00
+dqdiv333 divide 0E-3 7E+1 -> 0.0000
+dqdiv334 divide 0E-3 7E+5 -> 0E-8
+dqdiv335 divide 0E-1 7E-5 -> 0E+4
+dqdiv336 divide 0E-1 7E-1 -> 0
+dqdiv337 divide 0E-1 7E+1 -> 0.00
+dqdiv338 divide 0E-1 7E+5 -> 0.000000
+dqdiv339 divide 0E+1 7E-5 -> 0E+6
+dqdiv340 divide 0E+1 7E-1 -> 0E+2
+dqdiv341 divide 0E+1 7E+1 -> 0
+dqdiv342 divide 0E+1 7E+5 -> 0.0000
+dqdiv343 divide 0E+3 7E-5 -> 0E+8
+dqdiv344 divide 0E+3 7E-1 -> 0E+4
+dqdiv345 divide 0E+3 7E+1 -> 0E+2
+dqdiv346 divide 0E+3 7E+5 -> 0.00
+
+-- These were 'input rounding'
+dqdiv441 divide 12345678000 1 -> 12345678000
+dqdiv442 divide 1 12345678000 -> 8.100000664200054464404466081166219E-11 Inexact Rounded
+dqdiv443 divide 1234567800 1 -> 1234567800
+dqdiv444 divide 1 1234567800 -> 8.100000664200054464404466081166219E-10 Inexact Rounded
+dqdiv445 divide 1234567890 1 -> 1234567890
+dqdiv446 divide 1 1234567890 -> 8.100000073710000670761006103925156E-10 Inexact Rounded
+dqdiv447 divide 1234567891 1 -> 1234567891
+dqdiv448 divide 1 1234567891 -> 8.100000067149000556665214614754629E-10 Inexact Rounded
+dqdiv449 divide 12345678901 1 -> 12345678901
+dqdiv450 divide 1 12345678901 -> 8.100000073053900658873130042376760E-11 Inexact Rounded
+dqdiv451 divide 1234567896 1 -> 1234567896
+dqdiv452 divide 1 1234567896 -> 8.100000034344000145618560617422697E-10 Inexact Rounded
+
+-- high-lows
+dqdiv453 divide 1e+1 1 -> 1E+1
+dqdiv454 divide 1e+1 1.0 -> 1E+1
+dqdiv455 divide 1e+1 1.00 -> 1E+1
+dqdiv456 divide 1e+2 2 -> 5E+1
+dqdiv457 divide 1e+2 2.0 -> 5E+1
+dqdiv458 divide 1e+2 2.00 -> 5E+1
+
+-- some from IEEE discussions
+dqdiv460 divide 3e0 2e0 -> 1.5
+dqdiv461 divide 30e-1 2e0 -> 1.5
+dqdiv462 divide 300e-2 2e0 -> 1.50
+dqdiv464 divide 3000e-3 2e0 -> 1.500
+dqdiv465 divide 3e0 20e-1 -> 1.5
+dqdiv466 divide 30e-1 20e-1 -> 1.5
+dqdiv467 divide 300e-2 20e-1 -> 1.5
+dqdiv468 divide 3000e-3 20e-1 -> 1.50
+dqdiv469 divide 3e0 200e-2 -> 1.5
+dqdiv470 divide 30e-1 200e-2 -> 1.5
+dqdiv471 divide 300e-2 200e-2 -> 1.5
+dqdiv472 divide 3000e-3 200e-2 -> 1.5
+dqdiv473 divide 3e0 2000e-3 -> 1.5
+dqdiv474 divide 30e-1 2000e-3 -> 1.5
+dqdiv475 divide 300e-2 2000e-3 -> 1.5
+dqdiv476 divide 3000e-3 2000e-3 -> 1.5
+
+-- some reciprocals
+dqdiv480 divide 1 1.0E+33 -> 1E-33
+dqdiv481 divide 1 10E+33 -> 1E-34
+dqdiv482 divide 1 1.0E-33 -> 1E+33
+dqdiv483 divide 1 10E-33 -> 1E+32
+
+-- RMS discussion table
+dqdiv484 divide 0e5 1e3 -> 0E+2
+dqdiv485 divide 0e5 2e3 -> 0E+2
+dqdiv486 divide 0e5 10e2 -> 0E+3
+dqdiv487 divide 0e5 20e2 -> 0E+3
+dqdiv488 divide 0e5 100e1 -> 0E+4
+dqdiv489 divide 0e5 200e1 -> 0E+4
+
+dqdiv491 divide 1e5 1e3 -> 1E+2
+dqdiv492 divide 1e5 2e3 -> 5E+1
+dqdiv493 divide 1e5 10e2 -> 1E+2
+dqdiv494 divide 1e5 20e2 -> 5E+1
+dqdiv495 divide 1e5 100e1 -> 1E+2
+dqdiv496 divide 1e5 200e1 -> 5E+1
+
+-- tryzeros cases
+rounding: half_up
+dqdiv497 divide 0E+6108 1000E-33 -> 0E+6111 Clamped
+dqdiv498 divide 0E-6170 1000E+33 -> 0E-6176 Clamped
+
+rounding: half_up
+
+-- focus on trailing zeros issues
+dqdiv500 divide 1 9.9 -> 0.1010101010101010101010101010101010 Inexact Rounded
+dqdiv501 divide 1 9.09 -> 0.1100110011001100110011001100110011 Inexact Rounded
+dqdiv502 divide 1 9.009 -> 0.1110001110001110001110001110001110 Inexact Rounded
+
+dqdiv511 divide 1 2 -> 0.5
+dqdiv512 divide 1.0 2 -> 0.5
+dqdiv513 divide 1.00 2 -> 0.50
+dqdiv514 divide 1.000 2 -> 0.500
+dqdiv515 divide 1.0000 2 -> 0.5000
+dqdiv516 divide 1.00000 2 -> 0.50000
+dqdiv517 divide 1.000000 2 -> 0.500000
+dqdiv518 divide 1.0000000 2 -> 0.5000000
+dqdiv519 divide 1.00 2.00 -> 0.5
+
+dqdiv521 divide 2 1 -> 2
+dqdiv522 divide 2 1.0 -> 2
+dqdiv523 divide 2 1.00 -> 2
+dqdiv524 divide 2 1.000 -> 2
+dqdiv525 divide 2 1.0000 -> 2
+dqdiv526 divide 2 1.00000 -> 2
+dqdiv527 divide 2 1.000000 -> 2
+dqdiv528 divide 2 1.0000000 -> 2
+dqdiv529 divide 2.00 1.00 -> 2
+
+dqdiv530 divide 2.40 2 -> 1.20
+dqdiv531 divide 2.40 4 -> 0.60
+dqdiv532 divide 2.40 10 -> 0.24
+dqdiv533 divide 2.40 2.0 -> 1.2
+dqdiv534 divide 2.40 4.0 -> 0.6
+dqdiv535 divide 2.40 10.0 -> 0.24
+dqdiv536 divide 2.40 2.00 -> 1.2
+dqdiv537 divide 2.40 4.00 -> 0.6
+dqdiv538 divide 2.40 10.00 -> 0.24
+dqdiv539 divide 0.9 0.1 -> 9
+dqdiv540 divide 0.9 0.01 -> 9E+1
+dqdiv541 divide 0.9 0.001 -> 9E+2
+dqdiv542 divide 5 2 -> 2.5
+dqdiv543 divide 5 2.0 -> 2.5
+dqdiv544 divide 5 2.00 -> 2.5
+dqdiv545 divide 5 20 -> 0.25
+dqdiv546 divide 5 20.0 -> 0.25
+dqdiv547 divide 2.400 2 -> 1.200
+dqdiv548 divide 2.400 2.0 -> 1.20
+dqdiv549 divide 2.400 2.400 -> 1
+
+dqdiv550 divide 240 1 -> 240
+dqdiv551 divide 240 10 -> 24
+dqdiv552 divide 240 100 -> 2.4
+dqdiv553 divide 240 1000 -> 0.24
+dqdiv554 divide 2400 1 -> 2400
+dqdiv555 divide 2400 10 -> 240
+dqdiv556 divide 2400 100 -> 24
+dqdiv557 divide 2400 1000 -> 2.4
+
+-- +ve exponent
+dqdiv600 divide 2.4E+9 2 -> 1.2E+9
+dqdiv601 divide 2.40E+9 2 -> 1.20E+9
+dqdiv602 divide 2.400E+9 2 -> 1.200E+9
+dqdiv603 divide 2.4000E+9 2 -> 1.2000E+9
+dqdiv604 divide 24E+8 2 -> 1.2E+9
+dqdiv605 divide 240E+7 2 -> 1.20E+9
+dqdiv606 divide 2400E+6 2 -> 1.200E+9
+dqdiv607 divide 24000E+5 2 -> 1.2000E+9
+
+-- more zeros, etc.
+dqdiv731 divide 5.00 1E-3 -> 5.00E+3
+dqdiv732 divide 00.00 0.000 -> NaN Division_undefined
+dqdiv733 divide 00.00 0E-3 -> NaN Division_undefined
+dqdiv734 divide 0 -0 -> NaN Division_undefined
+dqdiv735 divide -0 0 -> NaN Division_undefined
+dqdiv736 divide -0 -0 -> NaN Division_undefined
+
+dqdiv741 divide 0 -1 -> -0
+dqdiv742 divide -0 -1 -> 0
+dqdiv743 divide 0 1 -> 0
+dqdiv744 divide -0 1 -> -0
+dqdiv745 divide -1 0 -> -Infinity Division_by_zero
+dqdiv746 divide -1 -0 -> Infinity Division_by_zero
+dqdiv747 divide 1 0 -> Infinity Division_by_zero
+dqdiv748 divide 1 -0 -> -Infinity Division_by_zero
+
+dqdiv751 divide 0.0 -1 -> -0.0
+dqdiv752 divide -0.0 -1 -> 0.0
+dqdiv753 divide 0.0 1 -> 0.0
+dqdiv754 divide -0.0 1 -> -0.0
+dqdiv755 divide -1.0 0 -> -Infinity Division_by_zero
+dqdiv756 divide -1.0 -0 -> Infinity Division_by_zero
+dqdiv757 divide 1.0 0 -> Infinity Division_by_zero
+dqdiv758 divide 1.0 -0 -> -Infinity Division_by_zero
+
+dqdiv761 divide 0 -1.0 -> -0E+1
+dqdiv762 divide -0 -1.0 -> 0E+1
+dqdiv763 divide 0 1.0 -> 0E+1
+dqdiv764 divide -0 1.0 -> -0E+1
+dqdiv765 divide -1 0.0 -> -Infinity Division_by_zero
+dqdiv766 divide -1 -0.0 -> Infinity Division_by_zero
+dqdiv767 divide 1 0.0 -> Infinity Division_by_zero
+dqdiv768 divide 1 -0.0 -> -Infinity Division_by_zero
+
+dqdiv771 divide 0.0 -1.0 -> -0
+dqdiv772 divide -0.0 -1.0 -> 0
+dqdiv773 divide 0.0 1.0 -> 0
+dqdiv774 divide -0.0 1.0 -> -0
+dqdiv775 divide -1.0 0.0 -> -Infinity Division_by_zero
+dqdiv776 divide -1.0 -0.0 -> Infinity Division_by_zero
+dqdiv777 divide 1.0 0.0 -> Infinity Division_by_zero
+dqdiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero
+
+-- Specials
+dqdiv780 divide Inf -Inf -> NaN Invalid_operation
+dqdiv781 divide Inf -1000 -> -Infinity
+dqdiv782 divide Inf -1 -> -Infinity
+dqdiv783 divide Inf -0 -> -Infinity
+dqdiv784 divide Inf 0 -> Infinity
+dqdiv785 divide Inf 1 -> Infinity
+dqdiv786 divide Inf 1000 -> Infinity
+dqdiv787 divide Inf Inf -> NaN Invalid_operation
+dqdiv788 divide -1000 Inf -> -0E-6176 Clamped
+dqdiv789 divide -Inf Inf -> NaN Invalid_operation
+dqdiv790 divide -1 Inf -> -0E-6176 Clamped
+dqdiv791 divide -0 Inf -> -0E-6176 Clamped
+dqdiv792 divide 0 Inf -> 0E-6176 Clamped
+dqdiv793 divide 1 Inf -> 0E-6176 Clamped
+dqdiv794 divide 1000 Inf -> 0E-6176 Clamped
+dqdiv795 divide Inf Inf -> NaN Invalid_operation
+
+dqdiv800 divide -Inf -Inf -> NaN Invalid_operation
+dqdiv801 divide -Inf -1000 -> Infinity
+dqdiv802 divide -Inf -1 -> Infinity
+dqdiv803 divide -Inf -0 -> Infinity
+dqdiv804 divide -Inf 0 -> -Infinity
+dqdiv805 divide -Inf 1 -> -Infinity
+dqdiv806 divide -Inf 1000 -> -Infinity
+dqdiv807 divide -Inf Inf -> NaN Invalid_operation
+dqdiv808 divide -1000 Inf -> -0E-6176 Clamped
+dqdiv809 divide -Inf -Inf -> NaN Invalid_operation
+dqdiv810 divide -1 -Inf -> 0E-6176 Clamped
+dqdiv811 divide -0 -Inf -> 0E-6176 Clamped
+dqdiv812 divide 0 -Inf -> -0E-6176 Clamped
+dqdiv813 divide 1 -Inf -> -0E-6176 Clamped
+dqdiv814 divide 1000 -Inf -> -0E-6176 Clamped
+dqdiv815 divide Inf -Inf -> NaN Invalid_operation
+
+dqdiv821 divide NaN -Inf -> NaN
+dqdiv822 divide NaN -1000 -> NaN
+dqdiv823 divide NaN -1 -> NaN
+dqdiv824 divide NaN -0 -> NaN
+dqdiv825 divide NaN 0 -> NaN
+dqdiv826 divide NaN 1 -> NaN
+dqdiv827 divide NaN 1000 -> NaN
+dqdiv828 divide NaN Inf -> NaN
+dqdiv829 divide NaN NaN -> NaN
+dqdiv830 divide -Inf NaN -> NaN
+dqdiv831 divide -1000 NaN -> NaN
+dqdiv832 divide -1 NaN -> NaN
+dqdiv833 divide -0 NaN -> NaN
+dqdiv834 divide 0 NaN -> NaN
+dqdiv835 divide 1 NaN -> NaN
+dqdiv836 divide 1000 NaN -> NaN
+dqdiv837 divide Inf NaN -> NaN
+
+dqdiv841 divide sNaN -Inf -> NaN Invalid_operation
+dqdiv842 divide sNaN -1000 -> NaN Invalid_operation
+dqdiv843 divide sNaN -1 -> NaN Invalid_operation
+dqdiv844 divide sNaN -0 -> NaN Invalid_operation
+dqdiv845 divide sNaN 0 -> NaN Invalid_operation
+dqdiv846 divide sNaN 1 -> NaN Invalid_operation
+dqdiv847 divide sNaN 1000 -> NaN Invalid_operation
+dqdiv848 divide sNaN NaN -> NaN Invalid_operation
+dqdiv849 divide sNaN sNaN -> NaN Invalid_operation
+dqdiv850 divide NaN sNaN -> NaN Invalid_operation
+dqdiv851 divide -Inf sNaN -> NaN Invalid_operation
+dqdiv852 divide -1000 sNaN -> NaN Invalid_operation
+dqdiv853 divide -1 sNaN -> NaN Invalid_operation
+dqdiv854 divide -0 sNaN -> NaN Invalid_operation
+dqdiv855 divide 0 sNaN -> NaN Invalid_operation
+dqdiv856 divide 1 sNaN -> NaN Invalid_operation
+dqdiv857 divide 1000 sNaN -> NaN Invalid_operation
+dqdiv858 divide Inf sNaN -> NaN Invalid_operation
+dqdiv859 divide NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqdiv861 divide NaN9 -Inf -> NaN9
+dqdiv862 divide NaN8 1000 -> NaN8
+dqdiv863 divide NaN7 Inf -> NaN7
+dqdiv864 divide NaN6 NaN5 -> NaN6
+dqdiv865 divide -Inf NaN4 -> NaN4
+dqdiv866 divide -1000 NaN3 -> NaN3
+dqdiv867 divide Inf NaN2 -> NaN2
+
+dqdiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation
+dqdiv872 divide sNaN98 -1 -> NaN98 Invalid_operation
+dqdiv873 divide sNaN97 NaN -> NaN97 Invalid_operation
+dqdiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
+dqdiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
+dqdiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation
+dqdiv877 divide 0 sNaN91 -> NaN91 Invalid_operation
+dqdiv878 divide Inf sNaN90 -> NaN90 Invalid_operation
+dqdiv879 divide NaN sNaN89 -> NaN89 Invalid_operation
+
+dqdiv881 divide -NaN9 -Inf -> -NaN9
+dqdiv882 divide -NaN8 1000 -> -NaN8
+dqdiv883 divide -NaN7 Inf -> -NaN7
+dqdiv884 divide -NaN6 -NaN5 -> -NaN6
+dqdiv885 divide -Inf -NaN4 -> -NaN4
+dqdiv886 divide -1000 -NaN3 -> -NaN3
+dqdiv887 divide Inf -NaN2 -> -NaN2
+
+dqdiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqdiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
+dqdiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
+dqdiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
+dqdiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+dqdiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
+dqdiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
+dqdiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
+dqdiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- Various flavours of divide by 0
+dqdiv901 divide 0 0 -> NaN Division_undefined
+dqdiv902 divide 0.0E5 0 -> NaN Division_undefined
+dqdiv903 divide 0.000 0 -> NaN Division_undefined
+dqdiv904 divide 0.0001 0 -> Infinity Division_by_zero
+dqdiv905 divide 0.01 0 -> Infinity Division_by_zero
+dqdiv906 divide 0.1 0 -> Infinity Division_by_zero
+dqdiv907 divide 1 0 -> Infinity Division_by_zero
+dqdiv908 divide 1 0.0 -> Infinity Division_by_zero
+dqdiv909 divide 10 0.0 -> Infinity Division_by_zero
+dqdiv910 divide 1E+100 0.0 -> Infinity Division_by_zero
+dqdiv911 divide 1E+100 0 -> Infinity Division_by_zero
+
+dqdiv921 divide -0.0001 0 -> -Infinity Division_by_zero
+dqdiv922 divide -0.01 0 -> -Infinity Division_by_zero
+dqdiv923 divide -0.1 0 -> -Infinity Division_by_zero
+dqdiv924 divide -1 0 -> -Infinity Division_by_zero
+dqdiv925 divide -1 0.0 -> -Infinity Division_by_zero
+dqdiv926 divide -10 0.0 -> -Infinity Division_by_zero
+dqdiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero
+dqdiv928 divide -1E+100 0 -> -Infinity Division_by_zero
+
+dqdiv931 divide 0.0001 -0 -> -Infinity Division_by_zero
+dqdiv932 divide 0.01 -0 -> -Infinity Division_by_zero
+dqdiv933 divide 0.1 -0 -> -Infinity Division_by_zero
+dqdiv934 divide 1 -0 -> -Infinity Division_by_zero
+dqdiv935 divide 1 -0.0 -> -Infinity Division_by_zero
+dqdiv936 divide 10 -0.0 -> -Infinity Division_by_zero
+dqdiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
+dqdiv938 divide 1E+100 -0 -> -Infinity Division_by_zero
+
+dqdiv941 divide -0.0001 -0 -> Infinity Division_by_zero
+dqdiv942 divide -0.01 -0 -> Infinity Division_by_zero
+dqdiv943 divide -0.1 -0 -> Infinity Division_by_zero
+dqdiv944 divide -1 -0 -> Infinity Division_by_zero
+dqdiv945 divide -1 -0.0 -> Infinity Division_by_zero
+dqdiv946 divide -10 -0.0 -> Infinity Division_by_zero
+dqdiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero
+dqdiv948 divide -1E+100 -0 -> Infinity Division_by_zero
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dqdiv1021 divide 1E0 1E0 -> 1
+dqdiv1022 divide 1E0 2E0 -> 0.5
+dqdiv1023 divide 1E0 3E0 -> 0.3333333333333333333333333333333333 Inexact Rounded
+dqdiv1024 divide 100E-2 1000E-3 -> 1
+dqdiv1025 divide 24E-1 2E0 -> 1.2
+dqdiv1026 divide 2400E-3 2E0 -> 1.200
+dqdiv1027 divide 5E0 2E0 -> 2.5
+dqdiv1028 divide 5E0 20E-1 -> 2.5
+dqdiv1029 divide 5E0 2000E-3 -> 2.5
+dqdiv1030 divide 5E0 2E-1 -> 25
+dqdiv1031 divide 5E0 20E-2 -> 25
+dqdiv1032 divide 480E-2 3E0 -> 1.60
+dqdiv1033 divide 47E-1 2E0 -> 2.35
+
+-- ECMAScript bad examples
+rounding: half_down
+dqdiv1040 divide 5 9 -> 0.5555555555555555555555555555555556 Inexact Rounded
+rounding: half_even
+dqdiv1041 divide 6 11 -> 0.5454545454545454545454545454545455 Inexact Rounded
+
+-- Gyuris example
+dqdiv1050 divide 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0.9999999999999999999999999999991254 Inexact Rounded
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+dqdiv1751 divide 1e+4277 1e-3311 -> Infinity Overflow Inexact Rounded
+dqdiv1752 divide 1e+4277 -1e-3311 -> -Infinity Overflow Inexact Rounded
+dqdiv1753 divide -1e+4277 1e-3311 -> -Infinity Overflow Inexact Rounded
+dqdiv1754 divide -1e+4277 -1e-3311 -> Infinity Overflow Inexact Rounded
+dqdiv1755 divide 1e-4277 1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1756 divide 1e-4277 -1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1757 divide -1e-4277 1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1758 divide -1e-4277 -1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dqdiv1760 divide 1e-6069 1e+101 -> 1E-6170 Subnormal
+dqdiv1761 divide 1e-6069 1e+102 -> 1E-6171 Subnormal
+dqdiv1762 divide 1e-6069 1e+103 -> 1E-6172 Subnormal
+dqdiv1763 divide 1e-6069 1e+104 -> 1E-6173 Subnormal
+dqdiv1764 divide 1e-6069 1e+105 -> 1E-6174 Subnormal
+dqdiv1765 divide 1e-6069 1e+106 -> 1E-6175 Subnormal
+dqdiv1766 divide 1e-6069 1e+107 -> 1E-6176 Subnormal
+dqdiv1767 divide 1e-6069 1e+108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1768 divide 1e-6069 1e+109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1769 divide 1e-6069 1e+110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+dqdiv1770 divide 1e+40 1e-6101 -> 1.000000000000000000000000000000E+6141 Clamped
+dqdiv1771 divide 1e+40 1e-6102 -> 1.0000000000000000000000000000000E+6142 Clamped
+dqdiv1772 divide 1e+40 1e-6103 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqdiv1773 divide 1e+40 1e-6104 -> 1.000000000000000000000000000000000E+6144 Clamped
+dqdiv1774 divide 1e+40 1e-6105 -> Infinity Overflow Inexact Rounded
+dqdiv1775 divide 1e+40 1e-6106 -> Infinity Overflow Inexact Rounded
+dqdiv1776 divide 1e+40 1e-6107 -> Infinity Overflow Inexact Rounded
+dqdiv1777 divide 1e+40 1e-6108 -> Infinity Overflow Inexact Rounded
+dqdiv1778 divide 1e+40 1e-6109 -> Infinity Overflow Inexact Rounded
+dqdiv1779 divide 1e+40 1e-6110 -> Infinity Overflow Inexact Rounded
+
+dqdiv1801 divide 1.0000E-6172 1 -> 1.0000E-6172 Subnormal
+dqdiv1802 divide 1.000E-6172 1e+1 -> 1.000E-6173 Subnormal
+dqdiv1803 divide 1.00E-6172 1e+2 -> 1.00E-6174 Subnormal
+dqdiv1804 divide 1.0E-6172 1e+3 -> 1.0E-6175 Subnormal
+dqdiv1805 divide 1.0E-6172 1e+4 -> 1E-6176 Subnormal Rounded
+dqdiv1806 divide 1.3E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1807 divide 1.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1808 divide 1.7E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1809 divide 2.3E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1810 divide 2.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1811 divide 2.7E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1812 divide 1.49E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1813 divide 1.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1814 divide 1.51E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1815 divide 2.49E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1816 divide 2.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1817 divide 2.51E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded
+
+dqdiv1818 divide 1E-6172 1e+4 -> 1E-6176 Subnormal
+dqdiv1819 divide 3E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1820 divide 5E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1821 divide 7E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1822 divide 9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1823 divide 9.9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+dqdiv1824 divide 1E-6172 -1e+4 -> -1E-6176 Subnormal
+dqdiv1825 divide 3E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1826 divide -5E-6172 1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1827 divide 7E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1828 divide -9E-6172 1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1829 divide 9.9E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1830 divide 3.0E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqdiv1831 divide 1.0E-5977 1e+200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1832 divide 1.0E-5977 1e+199 -> 1E-6176 Subnormal Rounded
+dqdiv1833 divide 1.0E-5977 1e+198 -> 1.0E-6175 Subnormal
+dqdiv1834 divide 2.0E-5977 2e+198 -> 1.0E-6175 Subnormal
+dqdiv1835 divide 4.0E-5977 4e+198 -> 1.0E-6175 Subnormal
+dqdiv1836 divide 10.0E-5977 10e+198 -> 1.0E-6175 Subnormal
+dqdiv1837 divide 30.0E-5977 30e+198 -> 1.0E-6175 Subnormal
+dqdiv1838 divide 40.0E-5982 40e+166 -> 1.0E-6148 Subnormal
+dqdiv1839 divide 40.0E-5982 40e+165 -> 1.0E-6147 Subnormal
+dqdiv1840 divide 40.0E-5982 40e+164 -> 1.0E-6146 Subnormal
+
+-- randoms
+rounding: half_even
+dqdiv2010 divide -5231195652931651968034356117118850 -7243718664422548573203260970.34995 -> 722169.9095831284624736051460550680 Inexact Rounded
+dqdiv2011 divide -89584669773927.82711237350022515352 -42077943728529635884.21142627532985 -> 0.000002129017291146471565928125887527266 Inexact Rounded
+dqdiv2012 divide -2.828201693360723203806974891946180E-232 812596541221823960386384403089240.9 -> -3.480450075640521320040055759125120E-265 Inexact Rounded
+dqdiv2013 divide -6442775372761069267502937539408720 24904085056.69185465145182606089196 -> -258703556388226463687701.4884719589 Inexact Rounded
+dqdiv2014 divide 5.535520011272625629610079879714705 -44343664650.57203052003068113531208 -> -1.248322630728089308975940533493562E-10 Inexact Rounded
+dqdiv2015 divide 65919273712517865964325.99419625010 -314733354141381737378622515.7789054 -> -0.0002094448295521490616379784758911632 Inexact Rounded
+dqdiv2016 divide -7.779172568193197107115275140431129E+759 -140453015639.3988987652895178782143 -> 5.538629792161641534962774244238115E+748 Inexact Rounded
+dqdiv2017 divide 644314832597569.0181226067518178797 -115024585257425.1635759521565201075 -> -5.601540150356479257367687450922795 Inexact Rounded
+dqdiv2018 divide 6.898640941579611450676592553286870E-47 -11272429881407851485163914999.25943 -> -6.119923578285338689371137648319280E-75 Inexact Rounded
+dqdiv2019 divide -3591344544888727133.30819750163254 5329395.423792795661446561090331037 -> -673874662941.1968525589460533725290 Inexact Rounded
+dqdiv2020 divide -7.682356781384631313156462724425838E+747 -6.60375855512219057281922141809940E+703 -> 1.163330960279556016678379128875149E+44 Inexact Rounded
+dqdiv2021 divide -4511495596596941820863224.274679699 3365395017.263329795449661616090724 -> -1340554548115304.904166888018346299 Inexact Rounded
+dqdiv2022 divide 5.211164127840931517263639608151299 164.5566381356276567012533847006453 -> 0.03166790587655228864478260157156510 Inexact Rounded
+dqdiv2023 divide -49891.2243893458830384077684620383 -47179.9312961860747554053371171530 -> 1.057467084386767291602189656430268 Inexact Rounded
+dqdiv2024 divide 15065477.47214268488077415462413353 4366211.120892953261309529740552596 -> 3.450469309661227984244545513441359 Inexact Rounded
+dqdiv2025 divide 1.575670269440761846109602429612644E+370 653199649324740300.006185482643439 -> 2.412233795700359170904588548041481E+352 Inexact Rounded
+dqdiv2026 divide -2112422311733448924573432192.620145 -80067206.03590693153848215848613406 -> 26383115089417660175.20102646756574 Inexact Rounded
+dqdiv2027 divide -67096536051279809.32218611548721839 -869685412881941081664251990181.1049 -> 7.715035236584805921278566365231168E-14 Inexact Rounded
+dqdiv2028 divide -58612908548962047.21866913425488972 -978449597531.3873665583475633831644 -> 59903.86085991703091236507859837023 Inexact Rounded
+dqdiv2029 divide -133032412010942.1476864138213319796 -7.882059293498670705446528648201359E-428 -> 1.687787506504433064549515681693715E+441 Inexact Rounded
+dqdiv2030 divide 1.83746698338966029492299716360513E+977 -9.897926608979649951672839879128603E+154 -> -1.856416051542212552042390218062458E+822 Inexact Rounded
+dqdiv2031 divide -113742475841399236307128962.1507063 8298602.203049834732657567965262989 -> -13706221006665137826.16557393919929 Inexact Rounded
+dqdiv2032 divide 196.4787574650754152995941808331862 929.6553388472318094427422117172394 -> 0.2113458066176526651006917922814018 Inexact Rounded
+dqdiv2033 divide 71931221465.43867996282803628130350 3838685934206426257090718.402248853 -> 1.873850132527423413607199513324021E-14 Inexact Rounded
+dqdiv2034 divide 488.4282502289651653783596246312885 -80.68940956806634280078706577953188 -> -6.053189047280693318844801899473272 Inexact Rounded
+dqdiv2035 divide 9.001764344963921754981762913247394E-162 -8.585540973667205753734967645386919E-729 -> -1.048479574271827326396012573232934E+567 Inexact Rounded
+dqdiv2036 divide -7.404133959409894743706402857145471E-828 -51.38159929460289711134684843086265 -> 1.441008855516029461032061785219773E-829 Inexact Rounded
+dqdiv2037 divide 2.967520235574419794048994436040717E-613 -6252513855.91394894949879262731889 -> -4.746123405656409127572998751885338E-623 Inexact Rounded
+dqdiv2038 divide -18826852654824040505.83920366765051 -6336924877942437992590557460147340 -> 2.970976146546494669807886278519194E-15 Inexact Rounded
+dqdiv2039 divide -8.101406784809197604949584001735949E+561 4.823300306948942821076681658771635E+361 -> -1.679639721610839204738445747238987E+200 Inexact Rounded
+dqdiv2040 divide -6.11981977773094052331062585191723E+295 1.507610253755339328302779005586534E+238 -> -4.059285058911577244044418416044763E+57 Inexact Rounded
+dqdiv2041 divide 6.472638850046815880599220534274055E-596 -4.475233712083047516933911786159972 -> -1.446324207062261745520496475778879E-596 Inexact Rounded
+dqdiv2042 divide -84438593330.71277839631144509397112 -586684596204401664208947.4054879633 -> 1.439250218550041228759983937772504E-13 Inexact Rounded
+dqdiv2043 divide 9.354533233294022616695815656704369E-24 405.500390626135304252144163591746 -> 2.306911028827774549740571229736198E-26 Inexact Rounded
+dqdiv2044 divide 985606423350210.7374876650149957881 -36811563697.41925681866694859828794 -> -26774.36990864119445335813354717711 Inexact Rounded
+dqdiv2045 divide -8.187280774177715706278002247766311E-123 -38784124393.91212870828430001300068 -> 2.110987653356139147357240727794365E-133 Inexact Rounded
+dqdiv2046 divide -4.612203126350070903459245798371657E+912 7.971562182727956290901984736800519E+64 -> -5.785820922708683237098826662769748E+847 Inexact Rounded
+dqdiv2047 divide 4.661015909421485298247928967977089E+888 -6.360911253323922338737311563845581E+388 -> -7.327591478321365980156654539638836E+499 Inexact Rounded
+dqdiv2048 divide 9156078172903.257500003260710833030 7.189796653262147139071634237964074E-90 -> 1.273482215766000994365201545096026E+102 Inexact Rounded
+dqdiv2049 divide -1.710722303327476586373477781276586E-311 -3167561628260156837329323.729380695 -> 5.400754599578613984875752958645655E-336 Inexact Rounded
+dqdiv2050 divide -4.647935210881806238321616345413021E-878 209388.5431867744648177308460639582 -> -2.219765771394593733140494297388140E-883 Inexact Rounded
+dqdiv2051 divide 5958.694728395760992719084781582700 4.541510156564315632536353171846096E-746 -> 1.312051393253638664947852693005480E+749 Inexact Rounded
+dqdiv2052 divide -7.935732544649702175256699886872093E-489 -7.433329073664793138998765647467971E+360 -> 1.067587949626076917672271619664656E-849 Inexact Rounded
+dqdiv2053 divide -2746650864601157.863589959939901350 7.016684945507647528907184694359598E+548 -> -3.914456593009309529351254950429932E-534 Inexact Rounded
+dqdiv2054 divide 3605149408631197365447953.994569178 -75614025825649082.78264864428237833 -> -47678315.88472693507060063188020532 Inexact Rounded
+dqdiv2055 divide 788194320921798404906375214.196349 -6.222718148433247384932573401976337E-418 -> -1.266639918634671803982222244977287E+444 Inexact Rounded
+dqdiv2056 divide 5620722730534752.758208943447603211 6.843552841168538319123000917657759E-139 -> 8.213164800485434666629970443739554E+153 Inexact Rounded
+dqdiv2057 divide 7304534676713703938102.403949019402 -576169.3685010935108153023803590835 -> -12677756014201995.31969237144394772 Inexact Rounded
+dqdiv2058 divide 8067918762.134621639254916786945547 -8.774771480055536009105596163864758E+954 -> -9.194448858836332156766764605125245E-946 Inexact Rounded
+dqdiv2059 divide 8.702093454123046507578256899537563E-324 -5.875399733016018404580201176576293E-401 -> -1.481106622452052581470443526957335E+77 Inexact Rounded
+dqdiv2060 divide -41426.01662518451861386352415092356 90.00146621684478300510769802013464 -> -460.2815750287318692732067709176200 Inexact Rounded
+
+-- random divide tests with result near 1
+dqdiv4001 divide 2003100352770753969878925664524900 2003100352770753969878925664497824 -> 1.000000000000000000000000000013517 Inexact Rounded
+dqdiv4002 divide 4817785793916490652579552318371645 4817785793916490652579552318362097 -> 1.000000000000000000000000000001982 Inexact Rounded
+dqdiv4003 divide 8299187410920067325648068439560282 8299187410920067325648068439591159 -> 0.9999999999999999999999999999962795 Inexact Rounded
+dqdiv4004 divide 5641088455897407044544461785365899 5641088455897407044544461785389965 -> 0.9999999999999999999999999999957338 Inexact Rounded
+dqdiv4005 divide 5752274694706545359326361313490424 5752274694706545359326361313502723 -> 0.9999999999999999999999999999978619 Inexact Rounded
+dqdiv4006 divide 6762079477373670594829319346099665 6762079477373670594829319346132579 -> 0.9999999999999999999999999999951326 Inexact Rounded
+dqdiv4007 divide 7286425153691890341633023222602916 7286425153691890341633023222606556 -> 0.9999999999999999999999999999995004 Inexact Rounded
+dqdiv4008 divide 9481233991901305727648306421946655 9481233991901305727648306421919124 -> 1.000000000000000000000000000002904 Inexact Rounded
+dqdiv4009 divide 4282053941893951742029444065614311 4282053941893951742029444065583077 -> 1.000000000000000000000000000007294 Inexact Rounded
+dqdiv4010 divide 626888225441250639741781850338695 626888225441250639741781850327299 -> 1.000000000000000000000000000018179 Inexact Rounded
+dqdiv4011 divide 3860973649222028009456598604468547 3860973649222028009456598604476849 -> 0.9999999999999999999999999999978498 Inexact Rounded
+dqdiv4012 divide 4753157080127468127908060607821839 4753157080127468127908060607788379 -> 1.000000000000000000000000000007040 Inexact Rounded
+dqdiv4013 divide 552448546203754062805706277880419 552448546203754062805706277881903 -> 0.9999999999999999999999999999973138 Inexact Rounded
+dqdiv4014 divide 8405954527952158455323713728917395 8405954527952158455323713728933866 -> 0.9999999999999999999999999999980406 Inexact Rounded
+dqdiv4015 divide 7554096502235321142555802238016116 7554096502235321142555802238026546 -> 0.9999999999999999999999999999986193 Inexact Rounded
+dqdiv4016 divide 4053257674127518606871054934746782 4053257674127518606871054934767355 -> 0.9999999999999999999999999999949243 Inexact Rounded
+dqdiv4017 divide 7112419420755090454716888844011582 7112419420755090454716888844038105 -> 0.9999999999999999999999999999962709 Inexact Rounded
+dqdiv4018 divide 3132302137520072728164549730911846 3132302137520072728164549730908416 -> 1.000000000000000000000000000001095 Inexact Rounded
+dqdiv4019 divide 4788374045841416355706715048161013 4788374045841416355706715048190077 -> 0.9999999999999999999999999999939303 Inexact Rounded
+dqdiv4020 divide 9466021636047630218238075099510597 9466021636047630218238075099484053 -> 1.000000000000000000000000000002804 Inexact Rounded
+dqdiv4021 divide 912742745646765625597399692138650 912742745646765625597399692139042 -> 0.9999999999999999999999999999995705 Inexact Rounded
+dqdiv4022 divide 9508402742933643208806264897188504 9508402742933643208806264897195973 -> 0.9999999999999999999999999999992145 Inexact Rounded
+dqdiv4023 divide 1186956795727233704962361914360895 1186956795727233704962361914329577 -> 1.000000000000000000000000000026385 Inexact Rounded
+dqdiv4024 divide 5972210268839014812696916170967938 5972210268839014812696916170954974 -> 1.000000000000000000000000000002171 Inexact Rounded
+dqdiv4025 divide 2303801625521619930894460139793140 2303801625521619930894460139799643 -> 0.9999999999999999999999999999971773 Inexact Rounded
+dqdiv4026 divide 6022231560002898264777393473966595 6022231560002898264777393473947198 -> 1.000000000000000000000000000003221 Inexact Rounded
+dqdiv4027 divide 8426148335801396199969346032210893 8426148335801396199969346032203179 -> 1.000000000000000000000000000000915 Inexact Rounded
+dqdiv4028 divide 8812278947028784637382847098411749 8812278947028784637382847098385317 -> 1.000000000000000000000000000002999 Inexact Rounded
+dqdiv4029 divide 8145282002348367383264197170116146 8145282002348367383264197170083988 -> 1.000000000000000000000000000003948 Inexact Rounded
+dqdiv4030 divide 6821577571876840153123510107387026 6821577571876840153123510107418008 -> 0.9999999999999999999999999999954582 Inexact Rounded
+dqdiv4031 divide 9018555319518966970480565482023720 9018555319518966970480565482013346 -> 1.000000000000000000000000000001150 Inexact Rounded
+dqdiv4032 divide 4602155712998228449640717252788864 4602155712998228449640717252818502 -> 0.9999999999999999999999999999935600 Inexact Rounded
+dqdiv4033 divide 6675607481522785614506828292264472 6675607481522785614506828292277100 -> 0.9999999999999999999999999999981083 Inexact Rounded
+dqdiv4034 divide 4015881516871833897766945836264472 4015881516871833897766945836262645 -> 1.000000000000000000000000000000455 Inexact Rounded
+dqdiv4035 divide 1415580205933411837595459716910365 1415580205933411837595459716880139 -> 1.000000000000000000000000000021352 Inexact Rounded
+dqdiv4036 divide 9432968297069542816752035276361552 9432968297069542816752035276353054 -> 1.000000000000000000000000000000901 Inexact Rounded
+dqdiv4037 divide 4799319591303848500532766682140658 4799319591303848500532766682172655 -> 0.9999999999999999999999999999933330 Inexact Rounded
+dqdiv4038 divide 316854270732839529790584284987472 316854270732839529790584285004832 -> 0.9999999999999999999999999999452114 Inexact Rounded
+dqdiv4039 divide 3598981300592490427826027975697415 3598981300592490427826027975686712 -> 1.000000000000000000000000000002974 Inexact Rounded
+dqdiv4040 divide 1664315435694461371155800682196520 1664315435694461371155800682195617 -> 1.000000000000000000000000000000543 Inexact Rounded
+dqdiv4041 divide 1680872316531128890102855316510581 1680872316531128890102855316495545 -> 1.000000000000000000000000000008945 Inexact Rounded
+dqdiv4042 divide 9881274879566405475755499281644730 9881274879566405475755499281615743 -> 1.000000000000000000000000000002934 Inexact Rounded
+dqdiv4043 divide 4737225957717466960447204232279216 4737225957717466960447204232277452 -> 1.000000000000000000000000000000372 Inexact Rounded
+dqdiv4044 divide 2482097379414867061213319346418288 2482097379414867061213319346387936 -> 1.000000000000000000000000000012228 Inexact Rounded
+dqdiv4045 divide 7406977595233762723576434122161868 7406977595233762723576434122189042 -> 0.9999999999999999999999999999963313 Inexact Rounded
+dqdiv4046 divide 228782057757566047086593281773577 228782057757566047086593281769727 -> 1.000000000000000000000000000016828 Inexact Rounded
+dqdiv4047 divide 2956594270240579648823270540367653 2956594270240579648823270540368556 -> 0.9999999999999999999999999999996946 Inexact Rounded
+dqdiv4048 divide 6326964098897620620534136767634340 6326964098897620620534136767619339 -> 1.000000000000000000000000000002371 Inexact Rounded
+dqdiv4049 divide 414586440456590215247002678327800 414586440456590215247002678316922 -> 1.000000000000000000000000000026238 Inexact Rounded
+dqdiv4050 divide 7364552208570039386220505636779125 7364552208570039386220505636803548 -> 0.9999999999999999999999999999966837 Inexact Rounded
+dqdiv4051 divide 5626266749902369710022824950590056 5626266749902369710022824950591008 -> 0.9999999999999999999999999999998308 Inexact Rounded
+dqdiv4052 divide 4863278293916197454987481343460484 4863278293916197454987481343442522 -> 1.000000000000000000000000000003693 Inexact Rounded
+dqdiv4053 divide 1170713582030637359713249796835483 1170713582030637359713249796823345 -> 1.000000000000000000000000000010368 Inexact Rounded
+dqdiv4054 divide 9838062494725965667776326556052931 9838062494725965667776326556061002 -> 0.9999999999999999999999999999991796 Inexact Rounded
+dqdiv4055 divide 4071388731298861093005687091498922 4071388731298861093005687091498278 -> 1.000000000000000000000000000000158 Inexact Rounded
+dqdiv4056 divide 8753155722324706795855038590272526 8753155722324706795855038590276656 -> 0.9999999999999999999999999999995282 Inexact Rounded
+dqdiv4057 divide 4399941911533273418844742658240485 4399941911533273418844742658219891 -> 1.000000000000000000000000000004681 Inexact Rounded
+dqdiv4058 divide 4127884159949503677776430620050269 4127884159949503677776430620026091 -> 1.000000000000000000000000000005857 Inexact Rounded
+dqdiv4059 divide 5536160822360800067042528317438808 5536160822360800067042528317450687 -> 0.9999999999999999999999999999978543 Inexact Rounded
+dqdiv4060 divide 3973234998468664936671088237710246 3973234998468664936671088237741886 -> 0.9999999999999999999999999999920367 Inexact Rounded
+dqdiv4061 divide 9824855935638263593410444142327358 9824855935638263593410444142328576 -> 0.9999999999999999999999999999998760 Inexact Rounded
+dqdiv4062 divide 5917078517340218131867327300814867 5917078517340218131867327300788701 -> 1.000000000000000000000000000004422 Inexact Rounded
+dqdiv4063 divide 4354236601830544882286139612521362 4354236601830544882286139612543223 -> 0.9999999999999999999999999999949794 Inexact Rounded
+dqdiv4064 divide 8058474772375259017342110013891294 8058474772375259017342110013906792 -> 0.9999999999999999999999999999980768 Inexact Rounded
+dqdiv4065 divide 5519604020981748170517093746166328 5519604020981748170517093746181763 -> 0.9999999999999999999999999999972036 Inexact Rounded
+dqdiv4066 divide 1502130966879805458831323782443139 1502130966879805458831323782412213 -> 1.000000000000000000000000000020588 Inexact Rounded
+dqdiv4067 divide 562795633719481212915159787980270 562795633719481212915159788007066 -> 0.9999999999999999999999999999523877 Inexact Rounded
+dqdiv4068 divide 6584743324494664273941281557268878 6584743324494664273941281557258945 -> 1.000000000000000000000000000001508 Inexact Rounded
+dqdiv4069 divide 3632000327285743997976431109416500 3632000327285743997976431109408107 -> 1.000000000000000000000000000002311 Inexact Rounded
+dqdiv4070 divide 1145827237315430089388953838561450 1145827237315430089388953838527332 -> 1.000000000000000000000000000029776 Inexact Rounded
+dqdiv4071 divide 8874431010357691869725372317350380 8874431010357691869725372317316472 -> 1.000000000000000000000000000003821 Inexact Rounded
+dqdiv4072 divide 992948718902804648119753141202196 992948718902804648119753141235222 -> 0.9999999999999999999999999999667395 Inexact Rounded
+dqdiv4073 divide 2522735183374218505142417265439989 2522735183374218505142417265453779 -> 0.9999999999999999999999999999945337 Inexact Rounded
+dqdiv4074 divide 2668419161912936508006872303501052 2668419161912936508006872303471036 -> 1.000000000000000000000000000011249 Inexact Rounded
+dqdiv4075 divide 3036169085665186712590941111775092 3036169085665186712590941111808846 -> 0.9999999999999999999999999999888827 Inexact Rounded
+dqdiv4076 divide 9441634604917231638508898934006147 9441634604917231638508898934000288 -> 1.000000000000000000000000000000621 Inexact Rounded
+dqdiv4077 divide 2677301353164377091111458811839190 2677301353164377091111458811867722 -> 0.9999999999999999999999999999893430 Inexact Rounded
+dqdiv4078 divide 6844979203112066166583765857171426 6844979203112066166583765857189682 -> 0.9999999999999999999999999999973329 Inexact Rounded
+dqdiv4079 divide 2220337435141796724323783960231661 2220337435141796724323783960208778 -> 1.000000000000000000000000000010306 Inexact Rounded
+dqdiv4080 divide 6447424700019783931569996989561380 6447424700019783931569996989572454 -> 0.9999999999999999999999999999982824 Inexact Rounded
+dqdiv4081 divide 7512856762696607119847092195587180 7512856762696607119847092195557346 -> 1.000000000000000000000000000003971 Inexact Rounded
+dqdiv4082 divide 7395261981193960399087819077237482 7395261981193960399087819077242487 -> 0.9999999999999999999999999999993232 Inexact Rounded
+dqdiv4083 divide 2253442467682584035792724884376735 2253442467682584035792724884407178 -> 0.9999999999999999999999999999864904 Inexact Rounded
+dqdiv4084 divide 8153138680300213135577336466190997 8153138680300213135577336466220607 -> 0.9999999999999999999999999999963683 Inexact Rounded
+dqdiv4085 divide 4668731252254148074041022681801390 4668731252254148074041022681778101 -> 1.000000000000000000000000000004988 Inexact Rounded
+dqdiv4086 divide 6078404557993669696040425501815056 6078404557993669696040425501797612 -> 1.000000000000000000000000000002870 Inexact Rounded
+dqdiv4087 divide 2306352359874261623223356878316278 2306352359874261623223356878335612 -> 0.9999999999999999999999999999916171 Inexact Rounded
+dqdiv4088 divide 3264842186668480362900909564091908 3264842186668480362900909564058658 -> 1.000000000000000000000000000010184 Inexact Rounded
+dqdiv4089 divide 6971985047279636878957959608612204 6971985047279636878957959608615088 -> 0.9999999999999999999999999999995863 Inexact Rounded
+dqdiv4090 divide 5262810889952721235466445973816257 5262810889952721235466445973783077 -> 1.000000000000000000000000000006305 Inexact Rounded
+dqdiv4091 divide 7947944731035267178548357070080288 7947944731035267178548357070061339 -> 1.000000000000000000000000000002384 Inexact Rounded
+dqdiv4092 divide 5071808908395375108383035800443229 5071808908395375108383035800412429 -> 1.000000000000000000000000000006073 Inexact Rounded
+dqdiv4093 divide 2043146542084503655511507209262969 2043146542084503655511507209249263 -> 1.000000000000000000000000000006708 Inexact Rounded
+dqdiv4094 divide 4097632735384534181661959731264802 4097632735384534181661959731234499 -> 1.000000000000000000000000000007395 Inexact Rounded
+dqdiv4095 divide 3061477642831387489729464587044430 3061477642831387489729464587059452 -> 0.9999999999999999999999999999950932 Inexact Rounded
+dqdiv4096 divide 3429854941039776159498802936252638 3429854941039776159498802936246415 -> 1.000000000000000000000000000001814 Inexact Rounded
+dqdiv4097 divide 4874324979578599700024133278284545 4874324979578599700024133278262131 -> 1.000000000000000000000000000004598 Inexact Rounded
+dqdiv4098 divide 5701652369691833541455978515820882 5701652369691833541455978515834854 -> 0.9999999999999999999999999999975495 Inexact Rounded
+dqdiv4099 divide 2928205728402945266953255632343113 2928205728402945266953255632373794 -> 0.9999999999999999999999999999895223 Inexact Rounded
+
+-- Null tests
+dqdiv9998 divide 10 # -> NaN Invalid_operation
+dqdiv9999 divide # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqDivideInt.decTest b/Lib/test/decimaltestdata/dqDivideInt.decTest
index c29035119f..3fec6dbaa3 100644
--- a/Lib/test/decimaltestdata/dqDivideInt.decTest
+++ b/Lib/test/decimaltestdata/dqDivideInt.decTest
@@ -1,453 +1,453 @@
-------------------------------------------------------------------------
--- dqDivideInt.decTest -- decQuad integer division --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-
-dqdvi001 divideint 1 1 -> 1
-dqdvi002 divideint 2 1 -> 2
-dqdvi003 divideint 1 2 -> 0
-dqdvi004 divideint 2 2 -> 1
-dqdvi005 divideint 0 1 -> 0
-dqdvi006 divideint 0 2 -> 0
-dqdvi007 divideint 1 3 -> 0
-dqdvi008 divideint 2 3 -> 0
-dqdvi009 divideint 3 3 -> 1
-
-dqdvi010 divideint 2.4 1 -> 2
-dqdvi011 divideint 2.4 -1 -> -2
-dqdvi012 divideint -2.4 1 -> -2
-dqdvi013 divideint -2.4 -1 -> 2
-dqdvi014 divideint 2.40 1 -> 2
-dqdvi015 divideint 2.400 1 -> 2
-dqdvi016 divideint 2.4 2 -> 1
-dqdvi017 divideint 2.400 2 -> 1
-dqdvi018 divideint 2. 2 -> 1
-dqdvi019 divideint 20 20 -> 1
-
-dqdvi020 divideint 187 187 -> 1
-dqdvi021 divideint 5 2 -> 2
-dqdvi022 divideint 5 2.0 -> 2
-dqdvi023 divideint 5 2.000 -> 2
-dqdvi024 divideint 5 0.200 -> 25
-dqdvi025 divideint 5 0.200 -> 25
-
-dqdvi030 divideint 1 2 -> 0
-dqdvi031 divideint 1 4 -> 0
-dqdvi032 divideint 1 8 -> 0
-dqdvi033 divideint 1 16 -> 0
-dqdvi034 divideint 1 32 -> 0
-dqdvi035 divideint 1 64 -> 0
-dqdvi040 divideint 1 -2 -> -0
-dqdvi041 divideint 1 -4 -> -0
-dqdvi042 divideint 1 -8 -> -0
-dqdvi043 divideint 1 -16 -> -0
-dqdvi044 divideint 1 -32 -> -0
-dqdvi045 divideint 1 -64 -> -0
-dqdvi050 divideint -1 2 -> -0
-dqdvi051 divideint -1 4 -> -0
-dqdvi052 divideint -1 8 -> -0
-dqdvi053 divideint -1 16 -> -0
-dqdvi054 divideint -1 32 -> -0
-dqdvi055 divideint -1 64 -> -0
-dqdvi060 divideint -1 -2 -> 0
-dqdvi061 divideint -1 -4 -> 0
-dqdvi062 divideint -1 -8 -> 0
-dqdvi063 divideint -1 -16 -> 0
-dqdvi064 divideint -1 -32 -> 0
-dqdvi065 divideint -1 -64 -> 0
-
--- similar with powers of ten
-dqdvi160 divideint 1 1 -> 1
-dqdvi161 divideint 1 10 -> 0
-dqdvi162 divideint 1 100 -> 0
-dqdvi163 divideint 1 1000 -> 0
-dqdvi164 divideint 1 10000 -> 0
-dqdvi165 divideint 1 100000 -> 0
-dqdvi166 divideint 1 1000000 -> 0
-dqdvi167 divideint 1 10000000 -> 0
-dqdvi168 divideint 1 100000000 -> 0
-dqdvi170 divideint 1 -1 -> -1
-dqdvi171 divideint 1 -10 -> -0
-dqdvi172 divideint 1 -100 -> -0
-dqdvi173 divideint 1 -1000 -> -0
-dqdvi174 divideint 1 -10000 -> -0
-dqdvi175 divideint 1 -100000 -> -0
-dqdvi176 divideint 1 -1000000 -> -0
-dqdvi177 divideint 1 -10000000 -> -0
-dqdvi178 divideint 1 -100000000 -> -0
-dqdvi180 divideint -1 1 -> -1
-dqdvi181 divideint -1 10 -> -0
-dqdvi182 divideint -1 100 -> -0
-dqdvi183 divideint -1 1000 -> -0
-dqdvi184 divideint -1 10000 -> -0
-dqdvi185 divideint -1 100000 -> -0
-dqdvi186 divideint -1 1000000 -> -0
-dqdvi187 divideint -1 10000000 -> -0
-dqdvi188 divideint -1 100000000 -> -0
-dqdvi190 divideint -1 -1 -> 1
-dqdvi191 divideint -1 -10 -> 0
-dqdvi192 divideint -1 -100 -> 0
-dqdvi193 divideint -1 -1000 -> 0
-dqdvi194 divideint -1 -10000 -> 0
-dqdvi195 divideint -1 -100000 -> 0
-dqdvi196 divideint -1 -1000000 -> 0
-dqdvi197 divideint -1 -10000000 -> 0
-dqdvi198 divideint -1 -100000000 -> 0
-
--- some long operand (at p=9) cases
-dqdvi070 divideint 999999999 1 -> 999999999
-dqdvi071 divideint 999999999.4 1 -> 999999999
-dqdvi072 divideint 999999999.5 1 -> 999999999
-dqdvi073 divideint 999999999.9 1 -> 999999999
-dqdvi074 divideint 999999999.999 1 -> 999999999
-
-dqdvi090 divideint 0. 1 -> 0
-dqdvi091 divideint .0 1 -> 0
-dqdvi092 divideint 0.00 1 -> 0
-dqdvi093 divideint 0.00E+9 1 -> 0
-dqdvi094 divideint 0.0000E-50 1 -> 0
-
-dqdvi100 divideint 1 1 -> 1
-dqdvi101 divideint 1 2 -> 0
-dqdvi102 divideint 1 3 -> 0
-dqdvi103 divideint 1 4 -> 0
-dqdvi104 divideint 1 5 -> 0
-dqdvi105 divideint 1 6 -> 0
-dqdvi106 divideint 1 7 -> 0
-dqdvi107 divideint 1 8 -> 0
-dqdvi108 divideint 1 9 -> 0
-dqdvi109 divideint 1 10 -> 0
-dqdvi110 divideint 1 1 -> 1
-dqdvi111 divideint 2 1 -> 2
-dqdvi112 divideint 3 1 -> 3
-dqdvi113 divideint 4 1 -> 4
-dqdvi114 divideint 5 1 -> 5
-dqdvi115 divideint 6 1 -> 6
-dqdvi116 divideint 7 1 -> 7
-dqdvi117 divideint 8 1 -> 8
-dqdvi118 divideint 9 1 -> 9
-dqdvi119 divideint 10 1 -> 10
-
--- from DiagBigDecimal
-dqdvi131 divideint 101.3 1 -> 101
-dqdvi132 divideint 101.0 1 -> 101
-dqdvi133 divideint 101.3 3 -> 33
-dqdvi134 divideint 101.0 3 -> 33
-dqdvi135 divideint 2.4 1 -> 2
-dqdvi136 divideint 2.400 1 -> 2
-dqdvi137 divideint 18 18 -> 1
-dqdvi138 divideint 1120 1000 -> 1
-dqdvi139 divideint 2.4 2 -> 1
-dqdvi140 divideint 2.400 2 -> 1
-dqdvi141 divideint 0.5 2.000 -> 0
-dqdvi142 divideint 8.005 7 -> 1
-dqdvi143 divideint 5 2 -> 2
-dqdvi144 divideint 0 2 -> 0
-dqdvi145 divideint 0.00 2 -> 0
-
--- Others
-dqdvi150 divideint 12345 4.999 -> 2469
-dqdvi151 divideint 12345 4.99 -> 2473
-dqdvi152 divideint 12345 4.9 -> 2519
-dqdvi153 divideint 12345 5 -> 2469
-dqdvi154 divideint 12345 5.1 -> 2420
-dqdvi155 divideint 12345 5.01 -> 2464
-dqdvi156 divideint 12345 5.001 -> 2468
-dqdvi157 divideint 101 7.6 -> 13
-
--- Various flavours of divideint by 0
-dqdvi201 divideint 0 0 -> NaN Division_undefined
-dqdvi202 divideint 0.0E5 0 -> NaN Division_undefined
-dqdvi203 divideint 0.000 0 -> NaN Division_undefined
-dqdvi204 divideint 0.0001 0 -> Infinity Division_by_zero
-dqdvi205 divideint 0.01 0 -> Infinity Division_by_zero
-dqdvi206 divideint 0.1 0 -> Infinity Division_by_zero
-dqdvi207 divideint 1 0 -> Infinity Division_by_zero
-dqdvi208 divideint 1 0.0 -> Infinity Division_by_zero
-dqdvi209 divideint 10 0.0 -> Infinity Division_by_zero
-dqdvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero
-dqdvi211 divideint 1E+380 0 -> Infinity Division_by_zero
-dqdvi214 divideint -0.0001 0 -> -Infinity Division_by_zero
-dqdvi215 divideint -0.01 0 -> -Infinity Division_by_zero
-dqdvi216 divideint -0.1 0 -> -Infinity Division_by_zero
-dqdvi217 divideint -1 0 -> -Infinity Division_by_zero
-dqdvi218 divideint -1 0.0 -> -Infinity Division_by_zero
-dqdvi219 divideint -10 0.0 -> -Infinity Division_by_zero
-dqdvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero
-dqdvi221 divideint -1E+380 0 -> -Infinity Division_by_zero
-
--- test some cases that are close to exponent overflow
-dqdvi270 divideint 1 1e384 -> 0
-dqdvi271 divideint 1 0.9e384 -> 0
-dqdvi272 divideint 1 0.99e384 -> 0
-dqdvi273 divideint 1 0.9999999999999999e384 -> 0
-dqdvi274 divideint 9e384 1 -> NaN Division_impossible
-dqdvi275 divideint 9.9e384 1 -> NaN Division_impossible
-dqdvi276 divideint 9.99e384 1 -> NaN Division_impossible
-dqdvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible
-
-dqdvi280 divideint 0.1 9e-383 -> NaN Division_impossible
-dqdvi281 divideint 0.1 99e-383 -> NaN Division_impossible
-dqdvi282 divideint 0.1 999e-383 -> NaN Division_impossible
-dqdvi283 divideint 0.1 9e-382 -> NaN Division_impossible
-dqdvi284 divideint 0.1 99e-382 -> NaN Division_impossible
-
--- GD edge cases: lhs smaller than rhs but more digits
-dqdvi301 divideint 0.9 2 -> 0
-dqdvi302 divideint 0.9 2.0 -> 0
-dqdvi303 divideint 0.9 2.1 -> 0
-dqdvi304 divideint 0.9 2.00 -> 0
-dqdvi305 divideint 0.9 2.01 -> 0
-dqdvi306 divideint 0.12 1 -> 0
-dqdvi307 divideint 0.12 1.0 -> 0
-dqdvi308 divideint 0.12 1.00 -> 0
-dqdvi309 divideint 0.12 1.0 -> 0
-dqdvi310 divideint 0.12 1.00 -> 0
-dqdvi311 divideint 0.12 2 -> 0
-dqdvi312 divideint 0.12 2.0 -> 0
-dqdvi313 divideint 0.12 2.1 -> 0
-dqdvi314 divideint 0.12 2.00 -> 0
-dqdvi315 divideint 0.12 2.01 -> 0
-
--- edge cases of impossible
-dqdvi330 divideint 1234567987654321987654321890123456 10 -> 123456798765432198765432189012345
-dqdvi331 divideint 1234567987654321987654321890123456 1 -> 1234567987654321987654321890123456
-dqdvi332 divideint 1234567987654321987654321890123456 0.1 -> NaN Division_impossible
-dqdvi333 divideint 1234567987654321987654321890123456 0.01 -> NaN Division_impossible
-
--- overflow and underflow tests [from divide]
-dqdvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible
-dqdvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible
-dqdvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible
-dqdvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible
-dqdvi1055 divideint 1e-277 1e+311 -> 0
-dqdvi1056 divideint 1e-277 -1e+311 -> -0
-dqdvi1057 divideint -1e-277 1e+311 -> -0
-dqdvi1058 divideint -1e-277 -1e+311 -> 0
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dqdvi1060 divideint 1e-291 1e+101 -> 0
-dqdvi1061 divideint 1e-291 1e+102 -> 0
-dqdvi1062 divideint 1e-291 1e+103 -> 0
-dqdvi1063 divideint 1e-291 1e+104 -> 0
-dqdvi1064 divideint 1e-291 1e+105 -> 0
-dqdvi1065 divideint 1e-291 1e+106 -> 0
-dqdvi1066 divideint 1e-291 1e+107 -> 0
-dqdvi1067 divideint 1e-291 1e+108 -> 0
-dqdvi1068 divideint 1e-291 1e+109 -> 0
-dqdvi1069 divideint 1e-291 1e+110 -> 0
-
-dqdvi1101 divideint 1.0000E-394 1 -> 0
-dqdvi1102 divideint 1.000E-394 1e+1 -> 0
-dqdvi1103 divideint 1.00E-394 1e+2 -> 0
-
-dqdvi1118 divideint 1E-394 1e+4 -> 0
-dqdvi1119 divideint 3E-394 -1e+5 -> -0
-dqdvi1120 divideint 5E-394 1e+5 -> 0
-
-dqdvi1124 divideint 1E-394 -1e+4 -> -0
-dqdvi1130 divideint 3.0E-394 -1e+5 -> -0
-
-dqdvi1131 divideint 1.0E-199 1e+200 -> 0
-dqdvi1132 divideint 1.0E-199 1e+199 -> 0
-dqdvi1133 divideint 1.0E-199 1e+198 -> 0
-dqdvi1134 divideint 2.0E-199 2e+198 -> 0
-dqdvi1135 divideint 4.0E-199 4e+198 -> 0
-
--- long operand checks
-dqdvi401 divideint 12345678000 100 -> 123456780
-dqdvi402 divideint 1 12345678000 -> 0
-dqdvi403 divideint 1234567800 10 -> 123456780
-dqdvi404 divideint 1 1234567800 -> 0
-dqdvi405 divideint 1234567890 10 -> 123456789
-dqdvi406 divideint 1 1234567890 -> 0
-dqdvi407 divideint 1234567891 10 -> 123456789
-dqdvi408 divideint 1 1234567891 -> 0
-dqdvi409 divideint 12345678901 100 -> 123456789
-dqdvi410 divideint 1 12345678901 -> 0
-dqdvi411 divideint 1234567896 10 -> 123456789
-dqdvi412 divideint 1 1234567896 -> 0
-dqdvi413 divideint 12345678948 100 -> 123456789
-dqdvi414 divideint 12345678949 100 -> 123456789
-dqdvi415 divideint 12345678950 100 -> 123456789
-dqdvi416 divideint 12345678951 100 -> 123456789
-dqdvi417 divideint 12345678999 100 -> 123456789
-dqdvi441 divideint 12345678000 1 -> 12345678000
-dqdvi442 divideint 1 12345678000 -> 0
-dqdvi443 divideint 1234567800 1 -> 1234567800
-dqdvi444 divideint 1 1234567800 -> 0
-dqdvi445 divideint 1234567890 1 -> 1234567890
-dqdvi446 divideint 1 1234567890 -> 0
-dqdvi447 divideint 1234567891 1 -> 1234567891
-dqdvi448 divideint 1 1234567891 -> 0
-dqdvi449 divideint 12345678901 1 -> 12345678901
-dqdvi450 divideint 1 12345678901 -> 0
-dqdvi451 divideint 1234567896 1 -> 1234567896
-dqdvi452 divideint 1 1234567896 -> 0
-
--- more zeros, etc.
-dqdvi531 divideint 5.00 1E-3 -> 5000
-dqdvi532 divideint 00.00 0.000 -> NaN Division_undefined
-dqdvi533 divideint 00.00 0E-3 -> NaN Division_undefined
-dqdvi534 divideint 0 -0 -> NaN Division_undefined
-dqdvi535 divideint -0 0 -> NaN Division_undefined
-dqdvi536 divideint -0 -0 -> NaN Division_undefined
-
-dqdvi541 divideint 0 -1 -> -0
-dqdvi542 divideint -0 -1 -> 0
-dqdvi543 divideint 0 1 -> 0
-dqdvi544 divideint -0 1 -> -0
-dqdvi545 divideint -1 0 -> -Infinity Division_by_zero
-dqdvi546 divideint -1 -0 -> Infinity Division_by_zero
-dqdvi547 divideint 1 0 -> Infinity Division_by_zero
-dqdvi548 divideint 1 -0 -> -Infinity Division_by_zero
-
-dqdvi551 divideint 0.0 -1 -> -0
-dqdvi552 divideint -0.0 -1 -> 0
-dqdvi553 divideint 0.0 1 -> 0
-dqdvi554 divideint -0.0 1 -> -0
-dqdvi555 divideint -1.0 0 -> -Infinity Division_by_zero
-dqdvi556 divideint -1.0 -0 -> Infinity Division_by_zero
-dqdvi557 divideint 1.0 0 -> Infinity Division_by_zero
-dqdvi558 divideint 1.0 -0 -> -Infinity Division_by_zero
-
-dqdvi561 divideint 0 -1.0 -> -0
-dqdvi562 divideint -0 -1.0 -> 0
-dqdvi563 divideint 0 1.0 -> 0
-dqdvi564 divideint -0 1.0 -> -0
-dqdvi565 divideint -1 0.0 -> -Infinity Division_by_zero
-dqdvi566 divideint -1 -0.0 -> Infinity Division_by_zero
-dqdvi567 divideint 1 0.0 -> Infinity Division_by_zero
-dqdvi568 divideint 1 -0.0 -> -Infinity Division_by_zero
-
-dqdvi571 divideint 0.0 -1.0 -> -0
-dqdvi572 divideint -0.0 -1.0 -> 0
-dqdvi573 divideint 0.0 1.0 -> 0
-dqdvi574 divideint -0.0 1.0 -> -0
-dqdvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero
-dqdvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero
-dqdvi577 divideint 1.0 0.0 -> Infinity Division_by_zero
-dqdvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero
-
--- Specials
-dqdvi580 divideint Inf -Inf -> NaN Invalid_operation
-dqdvi581 divideint Inf -1000 -> -Infinity
-dqdvi582 divideint Inf -1 -> -Infinity
-dqdvi583 divideint Inf -0 -> -Infinity
-dqdvi584 divideint Inf 0 -> Infinity
-dqdvi585 divideint Inf 1 -> Infinity
-dqdvi586 divideint Inf 1000 -> Infinity
-dqdvi587 divideint Inf Inf -> NaN Invalid_operation
-dqdvi588 divideint -1000 Inf -> -0
-dqdvi589 divideint -Inf Inf -> NaN Invalid_operation
-dqdvi590 divideint -1 Inf -> -0
-dqdvi591 divideint -0 Inf -> -0
-dqdvi592 divideint 0 Inf -> 0
-dqdvi593 divideint 1 Inf -> 0
-dqdvi594 divideint 1000 Inf -> 0
-dqdvi595 divideint Inf Inf -> NaN Invalid_operation
-
-dqdvi600 divideint -Inf -Inf -> NaN Invalid_operation
-dqdvi601 divideint -Inf -1000 -> Infinity
-dqdvi602 divideint -Inf -1 -> Infinity
-dqdvi603 divideint -Inf -0 -> Infinity
-dqdvi604 divideint -Inf 0 -> -Infinity
-dqdvi605 divideint -Inf 1 -> -Infinity
-dqdvi606 divideint -Inf 1000 -> -Infinity
-dqdvi607 divideint -Inf Inf -> NaN Invalid_operation
-dqdvi608 divideint -1000 Inf -> -0
-dqdvi609 divideint -Inf -Inf -> NaN Invalid_operation
-dqdvi610 divideint -1 -Inf -> 0
-dqdvi611 divideint -0 -Inf -> 0
-dqdvi612 divideint 0 -Inf -> -0
-dqdvi613 divideint 1 -Inf -> -0
-dqdvi614 divideint 1000 -Inf -> -0
-dqdvi615 divideint Inf -Inf -> NaN Invalid_operation
-
-dqdvi621 divideint NaN -Inf -> NaN
-dqdvi622 divideint NaN -1000 -> NaN
-dqdvi623 divideint NaN -1 -> NaN
-dqdvi624 divideint NaN -0 -> NaN
-dqdvi625 divideint NaN 0 -> NaN
-dqdvi626 divideint NaN 1 -> NaN
-dqdvi627 divideint NaN 1000 -> NaN
-dqdvi628 divideint NaN Inf -> NaN
-dqdvi629 divideint NaN NaN -> NaN
-dqdvi630 divideint -Inf NaN -> NaN
-dqdvi631 divideint -1000 NaN -> NaN
-dqdvi632 divideint -1 NaN -> NaN
-dqdvi633 divideint -0 NaN -> NaN
-dqdvi634 divideint 0 NaN -> NaN
-dqdvi635 divideint 1 NaN -> NaN
-dqdvi636 divideint 1000 NaN -> NaN
-dqdvi637 divideint Inf NaN -> NaN
-
-dqdvi641 divideint sNaN -Inf -> NaN Invalid_operation
-dqdvi642 divideint sNaN -1000 -> NaN Invalid_operation
-dqdvi643 divideint sNaN -1 -> NaN Invalid_operation
-dqdvi644 divideint sNaN -0 -> NaN Invalid_operation
-dqdvi645 divideint sNaN 0 -> NaN Invalid_operation
-dqdvi646 divideint sNaN 1 -> NaN Invalid_operation
-dqdvi647 divideint sNaN 1000 -> NaN Invalid_operation
-dqdvi648 divideint sNaN NaN -> NaN Invalid_operation
-dqdvi649 divideint sNaN sNaN -> NaN Invalid_operation
-dqdvi650 divideint NaN sNaN -> NaN Invalid_operation
-dqdvi651 divideint -Inf sNaN -> NaN Invalid_operation
-dqdvi652 divideint -1000 sNaN -> NaN Invalid_operation
-dqdvi653 divideint -1 sNaN -> NaN Invalid_operation
-dqdvi654 divideint -0 sNaN -> NaN Invalid_operation
-dqdvi655 divideint 0 sNaN -> NaN Invalid_operation
-dqdvi656 divideint 1 sNaN -> NaN Invalid_operation
-dqdvi657 divideint 1000 sNaN -> NaN Invalid_operation
-dqdvi658 divideint Inf sNaN -> NaN Invalid_operation
-dqdvi659 divideint NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqdvi661 divideint NaN9 -Inf -> NaN9
-dqdvi662 divideint NaN8 1000 -> NaN8
-dqdvi663 divideint NaN7 Inf -> NaN7
-dqdvi664 divideint -NaN6 NaN5 -> -NaN6
-dqdvi665 divideint -Inf NaN4 -> NaN4
-dqdvi666 divideint -1000 NaN3 -> NaN3
-dqdvi667 divideint Inf -NaN2 -> -NaN2
-
-dqdvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqdvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation
-dqdvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation
-dqdvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
-dqdvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
-dqdvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
-dqdvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation
-dqdvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
-dqdvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation
-
--- Gyuris example
-dqdvi700 divideint 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0
-
--- Null tests
-dqdvi900 divideint 10 # -> NaN Invalid_operation
-dqdvi901 divideint # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqDivideInt.decTest -- decQuad integer division --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+
+dqdvi001 divideint 1 1 -> 1
+dqdvi002 divideint 2 1 -> 2
+dqdvi003 divideint 1 2 -> 0
+dqdvi004 divideint 2 2 -> 1
+dqdvi005 divideint 0 1 -> 0
+dqdvi006 divideint 0 2 -> 0
+dqdvi007 divideint 1 3 -> 0
+dqdvi008 divideint 2 3 -> 0
+dqdvi009 divideint 3 3 -> 1
+
+dqdvi010 divideint 2.4 1 -> 2
+dqdvi011 divideint 2.4 -1 -> -2
+dqdvi012 divideint -2.4 1 -> -2
+dqdvi013 divideint -2.4 -1 -> 2
+dqdvi014 divideint 2.40 1 -> 2
+dqdvi015 divideint 2.400 1 -> 2
+dqdvi016 divideint 2.4 2 -> 1
+dqdvi017 divideint 2.400 2 -> 1
+dqdvi018 divideint 2. 2 -> 1
+dqdvi019 divideint 20 20 -> 1
+
+dqdvi020 divideint 187 187 -> 1
+dqdvi021 divideint 5 2 -> 2
+dqdvi022 divideint 5 2.0 -> 2
+dqdvi023 divideint 5 2.000 -> 2
+dqdvi024 divideint 5 0.200 -> 25
+dqdvi025 divideint 5 0.200 -> 25
+
+dqdvi030 divideint 1 2 -> 0
+dqdvi031 divideint 1 4 -> 0
+dqdvi032 divideint 1 8 -> 0
+dqdvi033 divideint 1 16 -> 0
+dqdvi034 divideint 1 32 -> 0
+dqdvi035 divideint 1 64 -> 0
+dqdvi040 divideint 1 -2 -> -0
+dqdvi041 divideint 1 -4 -> -0
+dqdvi042 divideint 1 -8 -> -0
+dqdvi043 divideint 1 -16 -> -0
+dqdvi044 divideint 1 -32 -> -0
+dqdvi045 divideint 1 -64 -> -0
+dqdvi050 divideint -1 2 -> -0
+dqdvi051 divideint -1 4 -> -0
+dqdvi052 divideint -1 8 -> -0
+dqdvi053 divideint -1 16 -> -0
+dqdvi054 divideint -1 32 -> -0
+dqdvi055 divideint -1 64 -> -0
+dqdvi060 divideint -1 -2 -> 0
+dqdvi061 divideint -1 -4 -> 0
+dqdvi062 divideint -1 -8 -> 0
+dqdvi063 divideint -1 -16 -> 0
+dqdvi064 divideint -1 -32 -> 0
+dqdvi065 divideint -1 -64 -> 0
+
+-- similar with powers of ten
+dqdvi160 divideint 1 1 -> 1
+dqdvi161 divideint 1 10 -> 0
+dqdvi162 divideint 1 100 -> 0
+dqdvi163 divideint 1 1000 -> 0
+dqdvi164 divideint 1 10000 -> 0
+dqdvi165 divideint 1 100000 -> 0
+dqdvi166 divideint 1 1000000 -> 0
+dqdvi167 divideint 1 10000000 -> 0
+dqdvi168 divideint 1 100000000 -> 0
+dqdvi170 divideint 1 -1 -> -1
+dqdvi171 divideint 1 -10 -> -0
+dqdvi172 divideint 1 -100 -> -0
+dqdvi173 divideint 1 -1000 -> -0
+dqdvi174 divideint 1 -10000 -> -0
+dqdvi175 divideint 1 -100000 -> -0
+dqdvi176 divideint 1 -1000000 -> -0
+dqdvi177 divideint 1 -10000000 -> -0
+dqdvi178 divideint 1 -100000000 -> -0
+dqdvi180 divideint -1 1 -> -1
+dqdvi181 divideint -1 10 -> -0
+dqdvi182 divideint -1 100 -> -0
+dqdvi183 divideint -1 1000 -> -0
+dqdvi184 divideint -1 10000 -> -0
+dqdvi185 divideint -1 100000 -> -0
+dqdvi186 divideint -1 1000000 -> -0
+dqdvi187 divideint -1 10000000 -> -0
+dqdvi188 divideint -1 100000000 -> -0
+dqdvi190 divideint -1 -1 -> 1
+dqdvi191 divideint -1 -10 -> 0
+dqdvi192 divideint -1 -100 -> 0
+dqdvi193 divideint -1 -1000 -> 0
+dqdvi194 divideint -1 -10000 -> 0
+dqdvi195 divideint -1 -100000 -> 0
+dqdvi196 divideint -1 -1000000 -> 0
+dqdvi197 divideint -1 -10000000 -> 0
+dqdvi198 divideint -1 -100000000 -> 0
+
+-- some long operand (at p=9) cases
+dqdvi070 divideint 999999999 1 -> 999999999
+dqdvi071 divideint 999999999.4 1 -> 999999999
+dqdvi072 divideint 999999999.5 1 -> 999999999
+dqdvi073 divideint 999999999.9 1 -> 999999999
+dqdvi074 divideint 999999999.999 1 -> 999999999
+
+dqdvi090 divideint 0. 1 -> 0
+dqdvi091 divideint .0 1 -> 0
+dqdvi092 divideint 0.00 1 -> 0
+dqdvi093 divideint 0.00E+9 1 -> 0
+dqdvi094 divideint 0.0000E-50 1 -> 0
+
+dqdvi100 divideint 1 1 -> 1
+dqdvi101 divideint 1 2 -> 0
+dqdvi102 divideint 1 3 -> 0
+dqdvi103 divideint 1 4 -> 0
+dqdvi104 divideint 1 5 -> 0
+dqdvi105 divideint 1 6 -> 0
+dqdvi106 divideint 1 7 -> 0
+dqdvi107 divideint 1 8 -> 0
+dqdvi108 divideint 1 9 -> 0
+dqdvi109 divideint 1 10 -> 0
+dqdvi110 divideint 1 1 -> 1
+dqdvi111 divideint 2 1 -> 2
+dqdvi112 divideint 3 1 -> 3
+dqdvi113 divideint 4 1 -> 4
+dqdvi114 divideint 5 1 -> 5
+dqdvi115 divideint 6 1 -> 6
+dqdvi116 divideint 7 1 -> 7
+dqdvi117 divideint 8 1 -> 8
+dqdvi118 divideint 9 1 -> 9
+dqdvi119 divideint 10 1 -> 10
+
+-- from DiagBigDecimal
+dqdvi131 divideint 101.3 1 -> 101
+dqdvi132 divideint 101.0 1 -> 101
+dqdvi133 divideint 101.3 3 -> 33
+dqdvi134 divideint 101.0 3 -> 33
+dqdvi135 divideint 2.4 1 -> 2
+dqdvi136 divideint 2.400 1 -> 2
+dqdvi137 divideint 18 18 -> 1
+dqdvi138 divideint 1120 1000 -> 1
+dqdvi139 divideint 2.4 2 -> 1
+dqdvi140 divideint 2.400 2 -> 1
+dqdvi141 divideint 0.5 2.000 -> 0
+dqdvi142 divideint 8.005 7 -> 1
+dqdvi143 divideint 5 2 -> 2
+dqdvi144 divideint 0 2 -> 0
+dqdvi145 divideint 0.00 2 -> 0
+
+-- Others
+dqdvi150 divideint 12345 4.999 -> 2469
+dqdvi151 divideint 12345 4.99 -> 2473
+dqdvi152 divideint 12345 4.9 -> 2519
+dqdvi153 divideint 12345 5 -> 2469
+dqdvi154 divideint 12345 5.1 -> 2420
+dqdvi155 divideint 12345 5.01 -> 2464
+dqdvi156 divideint 12345 5.001 -> 2468
+dqdvi157 divideint 101 7.6 -> 13
+
+-- Various flavours of divideint by 0
+dqdvi201 divideint 0 0 -> NaN Division_undefined
+dqdvi202 divideint 0.0E5 0 -> NaN Division_undefined
+dqdvi203 divideint 0.000 0 -> NaN Division_undefined
+dqdvi204 divideint 0.0001 0 -> Infinity Division_by_zero
+dqdvi205 divideint 0.01 0 -> Infinity Division_by_zero
+dqdvi206 divideint 0.1 0 -> Infinity Division_by_zero
+dqdvi207 divideint 1 0 -> Infinity Division_by_zero
+dqdvi208 divideint 1 0.0 -> Infinity Division_by_zero
+dqdvi209 divideint 10 0.0 -> Infinity Division_by_zero
+dqdvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero
+dqdvi211 divideint 1E+380 0 -> Infinity Division_by_zero
+dqdvi214 divideint -0.0001 0 -> -Infinity Division_by_zero
+dqdvi215 divideint -0.01 0 -> -Infinity Division_by_zero
+dqdvi216 divideint -0.1 0 -> -Infinity Division_by_zero
+dqdvi217 divideint -1 0 -> -Infinity Division_by_zero
+dqdvi218 divideint -1 0.0 -> -Infinity Division_by_zero
+dqdvi219 divideint -10 0.0 -> -Infinity Division_by_zero
+dqdvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero
+dqdvi221 divideint -1E+380 0 -> -Infinity Division_by_zero
+
+-- test some cases that are close to exponent overflow
+dqdvi270 divideint 1 1e384 -> 0
+dqdvi271 divideint 1 0.9e384 -> 0
+dqdvi272 divideint 1 0.99e384 -> 0
+dqdvi273 divideint 1 0.9999999999999999e384 -> 0
+dqdvi274 divideint 9e384 1 -> NaN Division_impossible
+dqdvi275 divideint 9.9e384 1 -> NaN Division_impossible
+dqdvi276 divideint 9.99e384 1 -> NaN Division_impossible
+dqdvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible
+
+dqdvi280 divideint 0.1 9e-383 -> NaN Division_impossible
+dqdvi281 divideint 0.1 99e-383 -> NaN Division_impossible
+dqdvi282 divideint 0.1 999e-383 -> NaN Division_impossible
+dqdvi283 divideint 0.1 9e-382 -> NaN Division_impossible
+dqdvi284 divideint 0.1 99e-382 -> NaN Division_impossible
+
+-- GD edge cases: lhs smaller than rhs but more digits
+dqdvi301 divideint 0.9 2 -> 0
+dqdvi302 divideint 0.9 2.0 -> 0
+dqdvi303 divideint 0.9 2.1 -> 0
+dqdvi304 divideint 0.9 2.00 -> 0
+dqdvi305 divideint 0.9 2.01 -> 0
+dqdvi306 divideint 0.12 1 -> 0
+dqdvi307 divideint 0.12 1.0 -> 0
+dqdvi308 divideint 0.12 1.00 -> 0
+dqdvi309 divideint 0.12 1.0 -> 0
+dqdvi310 divideint 0.12 1.00 -> 0
+dqdvi311 divideint 0.12 2 -> 0
+dqdvi312 divideint 0.12 2.0 -> 0
+dqdvi313 divideint 0.12 2.1 -> 0
+dqdvi314 divideint 0.12 2.00 -> 0
+dqdvi315 divideint 0.12 2.01 -> 0
+
+-- edge cases of impossible
+dqdvi330 divideint 1234567987654321987654321890123456 10 -> 123456798765432198765432189012345
+dqdvi331 divideint 1234567987654321987654321890123456 1 -> 1234567987654321987654321890123456
+dqdvi332 divideint 1234567987654321987654321890123456 0.1 -> NaN Division_impossible
+dqdvi333 divideint 1234567987654321987654321890123456 0.01 -> NaN Division_impossible
+
+-- overflow and underflow tests [from divide]
+dqdvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible
+dqdvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible
+dqdvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible
+dqdvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible
+dqdvi1055 divideint 1e-277 1e+311 -> 0
+dqdvi1056 divideint 1e-277 -1e+311 -> -0
+dqdvi1057 divideint -1e-277 1e+311 -> -0
+dqdvi1058 divideint -1e-277 -1e+311 -> 0
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dqdvi1060 divideint 1e-291 1e+101 -> 0
+dqdvi1061 divideint 1e-291 1e+102 -> 0
+dqdvi1062 divideint 1e-291 1e+103 -> 0
+dqdvi1063 divideint 1e-291 1e+104 -> 0
+dqdvi1064 divideint 1e-291 1e+105 -> 0
+dqdvi1065 divideint 1e-291 1e+106 -> 0
+dqdvi1066 divideint 1e-291 1e+107 -> 0
+dqdvi1067 divideint 1e-291 1e+108 -> 0
+dqdvi1068 divideint 1e-291 1e+109 -> 0
+dqdvi1069 divideint 1e-291 1e+110 -> 0
+
+dqdvi1101 divideint 1.0000E-394 1 -> 0
+dqdvi1102 divideint 1.000E-394 1e+1 -> 0
+dqdvi1103 divideint 1.00E-394 1e+2 -> 0
+
+dqdvi1118 divideint 1E-394 1e+4 -> 0
+dqdvi1119 divideint 3E-394 -1e+5 -> -0
+dqdvi1120 divideint 5E-394 1e+5 -> 0
+
+dqdvi1124 divideint 1E-394 -1e+4 -> -0
+dqdvi1130 divideint 3.0E-394 -1e+5 -> -0
+
+dqdvi1131 divideint 1.0E-199 1e+200 -> 0
+dqdvi1132 divideint 1.0E-199 1e+199 -> 0
+dqdvi1133 divideint 1.0E-199 1e+198 -> 0
+dqdvi1134 divideint 2.0E-199 2e+198 -> 0
+dqdvi1135 divideint 4.0E-199 4e+198 -> 0
+
+-- long operand checks
+dqdvi401 divideint 12345678000 100 -> 123456780
+dqdvi402 divideint 1 12345678000 -> 0
+dqdvi403 divideint 1234567800 10 -> 123456780
+dqdvi404 divideint 1 1234567800 -> 0
+dqdvi405 divideint 1234567890 10 -> 123456789
+dqdvi406 divideint 1 1234567890 -> 0
+dqdvi407 divideint 1234567891 10 -> 123456789
+dqdvi408 divideint 1 1234567891 -> 0
+dqdvi409 divideint 12345678901 100 -> 123456789
+dqdvi410 divideint 1 12345678901 -> 0
+dqdvi411 divideint 1234567896 10 -> 123456789
+dqdvi412 divideint 1 1234567896 -> 0
+dqdvi413 divideint 12345678948 100 -> 123456789
+dqdvi414 divideint 12345678949 100 -> 123456789
+dqdvi415 divideint 12345678950 100 -> 123456789
+dqdvi416 divideint 12345678951 100 -> 123456789
+dqdvi417 divideint 12345678999 100 -> 123456789
+dqdvi441 divideint 12345678000 1 -> 12345678000
+dqdvi442 divideint 1 12345678000 -> 0
+dqdvi443 divideint 1234567800 1 -> 1234567800
+dqdvi444 divideint 1 1234567800 -> 0
+dqdvi445 divideint 1234567890 1 -> 1234567890
+dqdvi446 divideint 1 1234567890 -> 0
+dqdvi447 divideint 1234567891 1 -> 1234567891
+dqdvi448 divideint 1 1234567891 -> 0
+dqdvi449 divideint 12345678901 1 -> 12345678901
+dqdvi450 divideint 1 12345678901 -> 0
+dqdvi451 divideint 1234567896 1 -> 1234567896
+dqdvi452 divideint 1 1234567896 -> 0
+
+-- more zeros, etc.
+dqdvi531 divideint 5.00 1E-3 -> 5000
+dqdvi532 divideint 00.00 0.000 -> NaN Division_undefined
+dqdvi533 divideint 00.00 0E-3 -> NaN Division_undefined
+dqdvi534 divideint 0 -0 -> NaN Division_undefined
+dqdvi535 divideint -0 0 -> NaN Division_undefined
+dqdvi536 divideint -0 -0 -> NaN Division_undefined
+
+dqdvi541 divideint 0 -1 -> -0
+dqdvi542 divideint -0 -1 -> 0
+dqdvi543 divideint 0 1 -> 0
+dqdvi544 divideint -0 1 -> -0
+dqdvi545 divideint -1 0 -> -Infinity Division_by_zero
+dqdvi546 divideint -1 -0 -> Infinity Division_by_zero
+dqdvi547 divideint 1 0 -> Infinity Division_by_zero
+dqdvi548 divideint 1 -0 -> -Infinity Division_by_zero
+
+dqdvi551 divideint 0.0 -1 -> -0
+dqdvi552 divideint -0.0 -1 -> 0
+dqdvi553 divideint 0.0 1 -> 0
+dqdvi554 divideint -0.0 1 -> -0
+dqdvi555 divideint -1.0 0 -> -Infinity Division_by_zero
+dqdvi556 divideint -1.0 -0 -> Infinity Division_by_zero
+dqdvi557 divideint 1.0 0 -> Infinity Division_by_zero
+dqdvi558 divideint 1.0 -0 -> -Infinity Division_by_zero
+
+dqdvi561 divideint 0 -1.0 -> -0
+dqdvi562 divideint -0 -1.0 -> 0
+dqdvi563 divideint 0 1.0 -> 0
+dqdvi564 divideint -0 1.0 -> -0
+dqdvi565 divideint -1 0.0 -> -Infinity Division_by_zero
+dqdvi566 divideint -1 -0.0 -> Infinity Division_by_zero
+dqdvi567 divideint 1 0.0 -> Infinity Division_by_zero
+dqdvi568 divideint 1 -0.0 -> -Infinity Division_by_zero
+
+dqdvi571 divideint 0.0 -1.0 -> -0
+dqdvi572 divideint -0.0 -1.0 -> 0
+dqdvi573 divideint 0.0 1.0 -> 0
+dqdvi574 divideint -0.0 1.0 -> -0
+dqdvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero
+dqdvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero
+dqdvi577 divideint 1.0 0.0 -> Infinity Division_by_zero
+dqdvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero
+
+-- Specials
+dqdvi580 divideint Inf -Inf -> NaN Invalid_operation
+dqdvi581 divideint Inf -1000 -> -Infinity
+dqdvi582 divideint Inf -1 -> -Infinity
+dqdvi583 divideint Inf -0 -> -Infinity
+dqdvi584 divideint Inf 0 -> Infinity
+dqdvi585 divideint Inf 1 -> Infinity
+dqdvi586 divideint Inf 1000 -> Infinity
+dqdvi587 divideint Inf Inf -> NaN Invalid_operation
+dqdvi588 divideint -1000 Inf -> -0
+dqdvi589 divideint -Inf Inf -> NaN Invalid_operation
+dqdvi590 divideint -1 Inf -> -0
+dqdvi591 divideint -0 Inf -> -0
+dqdvi592 divideint 0 Inf -> 0
+dqdvi593 divideint 1 Inf -> 0
+dqdvi594 divideint 1000 Inf -> 0
+dqdvi595 divideint Inf Inf -> NaN Invalid_operation
+
+dqdvi600 divideint -Inf -Inf -> NaN Invalid_operation
+dqdvi601 divideint -Inf -1000 -> Infinity
+dqdvi602 divideint -Inf -1 -> Infinity
+dqdvi603 divideint -Inf -0 -> Infinity
+dqdvi604 divideint -Inf 0 -> -Infinity
+dqdvi605 divideint -Inf 1 -> -Infinity
+dqdvi606 divideint -Inf 1000 -> -Infinity
+dqdvi607 divideint -Inf Inf -> NaN Invalid_operation
+dqdvi608 divideint -1000 Inf -> -0
+dqdvi609 divideint -Inf -Inf -> NaN Invalid_operation
+dqdvi610 divideint -1 -Inf -> 0
+dqdvi611 divideint -0 -Inf -> 0
+dqdvi612 divideint 0 -Inf -> -0
+dqdvi613 divideint 1 -Inf -> -0
+dqdvi614 divideint 1000 -Inf -> -0
+dqdvi615 divideint Inf -Inf -> NaN Invalid_operation
+
+dqdvi621 divideint NaN -Inf -> NaN
+dqdvi622 divideint NaN -1000 -> NaN
+dqdvi623 divideint NaN -1 -> NaN
+dqdvi624 divideint NaN -0 -> NaN
+dqdvi625 divideint NaN 0 -> NaN
+dqdvi626 divideint NaN 1 -> NaN
+dqdvi627 divideint NaN 1000 -> NaN
+dqdvi628 divideint NaN Inf -> NaN
+dqdvi629 divideint NaN NaN -> NaN
+dqdvi630 divideint -Inf NaN -> NaN
+dqdvi631 divideint -1000 NaN -> NaN
+dqdvi632 divideint -1 NaN -> NaN
+dqdvi633 divideint -0 NaN -> NaN
+dqdvi634 divideint 0 NaN -> NaN
+dqdvi635 divideint 1 NaN -> NaN
+dqdvi636 divideint 1000 NaN -> NaN
+dqdvi637 divideint Inf NaN -> NaN
+
+dqdvi641 divideint sNaN -Inf -> NaN Invalid_operation
+dqdvi642 divideint sNaN -1000 -> NaN Invalid_operation
+dqdvi643 divideint sNaN -1 -> NaN Invalid_operation
+dqdvi644 divideint sNaN -0 -> NaN Invalid_operation
+dqdvi645 divideint sNaN 0 -> NaN Invalid_operation
+dqdvi646 divideint sNaN 1 -> NaN Invalid_operation
+dqdvi647 divideint sNaN 1000 -> NaN Invalid_operation
+dqdvi648 divideint sNaN NaN -> NaN Invalid_operation
+dqdvi649 divideint sNaN sNaN -> NaN Invalid_operation
+dqdvi650 divideint NaN sNaN -> NaN Invalid_operation
+dqdvi651 divideint -Inf sNaN -> NaN Invalid_operation
+dqdvi652 divideint -1000 sNaN -> NaN Invalid_operation
+dqdvi653 divideint -1 sNaN -> NaN Invalid_operation
+dqdvi654 divideint -0 sNaN -> NaN Invalid_operation
+dqdvi655 divideint 0 sNaN -> NaN Invalid_operation
+dqdvi656 divideint 1 sNaN -> NaN Invalid_operation
+dqdvi657 divideint 1000 sNaN -> NaN Invalid_operation
+dqdvi658 divideint Inf sNaN -> NaN Invalid_operation
+dqdvi659 divideint NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqdvi661 divideint NaN9 -Inf -> NaN9
+dqdvi662 divideint NaN8 1000 -> NaN8
+dqdvi663 divideint NaN7 Inf -> NaN7
+dqdvi664 divideint -NaN6 NaN5 -> -NaN6
+dqdvi665 divideint -Inf NaN4 -> NaN4
+dqdvi666 divideint -1000 NaN3 -> NaN3
+dqdvi667 divideint Inf -NaN2 -> -NaN2
+
+dqdvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqdvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation
+dqdvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation
+dqdvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
+dqdvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
+dqdvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
+dqdvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation
+dqdvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
+dqdvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation
+
+-- Gyuris example
+dqdvi700 divideint 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0
+
+-- Null tests
+dqdvi900 divideint 10 # -> NaN Invalid_operation
+dqdvi901 divideint # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqEncode.decTest b/Lib/test/decimaltestdata/dqEncode.decTest
index 49edf5b280..8c5d7b9b30 100644
--- a/Lib/test/decimaltestdata/dqEncode.decTest
+++ b/Lib/test/decimaltestdata/dqEncode.decTest
@@ -1,477 +1,477 @@
-------------------------------------------------------------------------
--- dqEncode.decTest -- decimal sixteen-byte format testcases --
--- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
--- [Previously called decimal128.decTest]
-version: 2.59
-
--- This set of tests is for the sixteen-byte concrete representation.
--- Its characteristics are:
---
--- 1 bit sign
--- 5 bits combination field
--- 12 bits exponent continuation
--- 110 bits coefficient continuation
---
--- Total exponent length 14 bits
--- Total coefficient length 114 bits (34 digits)
---
--- Elimit = 12287 (maximum encoded exponent)
--- Emax = 6144 (largest exponent value)
--- Emin = -6143 (smallest exponent value)
--- bias = 6176 (subtracted from encoded exponent) = -Etiny
-
--- The testcases here have only exactly representable data on the
--- 'left-hand-side'; rounding from strings is tested in 'base'
--- testcase groups.
-
-extended: 1
-clamp: 1
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
-
--- General testcases
--- (mostly derived from the Strawman 4 document and examples)
-decq001 apply #A20780000000000000000000000003D0 -> -7.50
-decq002 apply -7.50 -> #A20780000000000000000000000003D0
--- derivative canonical plain strings
-decq003 apply #A20840000000000000000000000003D0 -> -7.50E+3
-decq004 apply -7.50E+3 -> #A20840000000000000000000000003D0
-decq005 apply #A20800000000000000000000000003D0 -> -750
-decq006 apply -750 -> #A20800000000000000000000000003D0
-decq007 apply #A207c0000000000000000000000003D0 -> -75.0
-decq008 apply -75.0 -> #A207c0000000000000000000000003D0
-decq009 apply #A20740000000000000000000000003D0 -> -0.750
-decq010 apply -0.750 -> #A20740000000000000000000000003D0
-decq011 apply #A20700000000000000000000000003D0 -> -0.0750
-decq012 apply -0.0750 -> #A20700000000000000000000000003D0
-decq013 apply #A20680000000000000000000000003D0 -> -0.000750
-decq014 apply -0.000750 -> #A20680000000000000000000000003D0
-decq015 apply #A20600000000000000000000000003D0 -> -0.00000750
-decq016 apply -0.00000750 -> #A20600000000000000000000000003D0
-decq017 apply #A205c0000000000000000000000003D0 -> -7.50E-7
-decq018 apply -7.50E-7 -> #A205c0000000000000000000000003D0
-
--- Normality
-decq020 apply 1234567890123456789012345678901234 -> #2608134b9c1e28e56f3c127177823534
-decq021 apply -1234567890123456789012345678901234 -> #a608134b9c1e28e56f3c127177823534
-decq022 apply 1111111111111111111111111111111111 -> #26080912449124491244912449124491
-
--- Nmax and similar
-decq031 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-decq032 apply #77ffcff3fcff3fcff3fcff3fcff3fcff -> 9.999999999999999999999999999999999E+6144
-decq033 apply 1.234567890123456789012345678901234E+6144 -> #47ffd34b9c1e28e56f3c127177823534
-decq034 apply #47ffd34b9c1e28e56f3c127177823534 -> 1.234567890123456789012345678901234E+6144
--- fold-downs (more below)
-decq035 apply 1.23E+6144 -> #47ffd300000000000000000000000000 Clamped
-decq036 apply #47ffd300000000000000000000000000 -> 1.230000000000000000000000000000000E+6144
-decq037 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped
-decq038 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144
-
-decq051 apply 12345 -> #220800000000000000000000000049c5
-decq052 apply #220800000000000000000000000049c5 -> 12345
-decq053 apply 1234 -> #22080000000000000000000000000534
-decq054 apply #22080000000000000000000000000534 -> 1234
-decq055 apply 123 -> #220800000000000000000000000000a3
-decq056 apply #220800000000000000000000000000a3 -> 123
-decq057 apply 12 -> #22080000000000000000000000000012
-decq058 apply #22080000000000000000000000000012 -> 12
-decq059 apply 1 -> #22080000000000000000000000000001
-decq060 apply #22080000000000000000000000000001 -> 1
-decq061 apply 1.23 -> #220780000000000000000000000000a3
-decq062 apply #220780000000000000000000000000a3 -> 1.23
-decq063 apply 123.45 -> #220780000000000000000000000049c5
-decq064 apply #220780000000000000000000000049c5 -> 123.45
-
--- Nmin and below
-decq071 apply 1E-6143 -> #00084000000000000000000000000001
-decq072 apply #00084000000000000000000000000001 -> 1E-6143
-decq073 apply 1.000000000000000000000000000000000E-6143 -> #04000000000000000000000000000000
-decq074 apply #04000000000000000000000000000000 -> 1.000000000000000000000000000000000E-6143
-decq075 apply 1.000000000000000000000000000000001E-6143 -> #04000000000000000000000000000001
-decq076 apply #04000000000000000000000000000001 -> 1.000000000000000000000000000000001E-6143
-
-decq077 apply 0.100000000000000000000000000000000E-6143 -> #00000800000000000000000000000000 Subnormal
-decq078 apply #00000800000000000000000000000000 -> 1.00000000000000000000000000000000E-6144 Subnormal
-decq079 apply 0.000000000000000000000000000000010E-6143 -> #00000000000000000000000000000010 Subnormal
-decq080 apply #00000000000000000000000000000010 -> 1.0E-6175 Subnormal
-decq081 apply 0.00000000000000000000000000000001E-6143 -> #00004000000000000000000000000001 Subnormal
-decq082 apply #00004000000000000000000000000001 -> 1E-6175 Subnormal
-decq083 apply 0.000000000000000000000000000000001E-6143 -> #00000000000000000000000000000001 Subnormal
-decq084 apply #00000000000000000000000000000001 -> 1E-6176 Subnormal
-
--- underflows cannot be tested for simple copies, check edge cases
-decq090 apply 1e-6176 -> #00000000000000000000000000000001 Subnormal
-decq100 apply 999999999999999999999999999999999e-6176 -> #00000ff3fcff3fcff3fcff3fcff3fcff Subnormal
-
--- same again, negatives
--- Nmax and similar
-decq122 apply -9.999999999999999999999999999999999E+6144 -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
-decq123 apply #f7ffcff3fcff3fcff3fcff3fcff3fcff -> -9.999999999999999999999999999999999E+6144
-decq124 apply -1.234567890123456789012345678901234E+6144 -> #c7ffd34b9c1e28e56f3c127177823534
-decq125 apply #c7ffd34b9c1e28e56f3c127177823534 -> -1.234567890123456789012345678901234E+6144
--- fold-downs (more below)
-decq130 apply -1.23E+6144 -> #c7ffd300000000000000000000000000 Clamped
-decq131 apply #c7ffd300000000000000000000000000 -> -1.230000000000000000000000000000000E+6144
-decq132 apply -1E+6144 -> #c7ffc000000000000000000000000000 Clamped
-decq133 apply #c7ffc000000000000000000000000000 -> -1.000000000000000000000000000000000E+6144
-
-decq151 apply -12345 -> #a20800000000000000000000000049c5
-decq152 apply #a20800000000000000000000000049c5 -> -12345
-decq153 apply -1234 -> #a2080000000000000000000000000534
-decq154 apply #a2080000000000000000000000000534 -> -1234
-decq155 apply -123 -> #a20800000000000000000000000000a3
-decq156 apply #a20800000000000000000000000000a3 -> -123
-decq157 apply -12 -> #a2080000000000000000000000000012
-decq158 apply #a2080000000000000000000000000012 -> -12
-decq159 apply -1 -> #a2080000000000000000000000000001
-decq160 apply #a2080000000000000000000000000001 -> -1
-decq161 apply -1.23 -> #a20780000000000000000000000000a3
-decq162 apply #a20780000000000000000000000000a3 -> -1.23
-decq163 apply -123.45 -> #a20780000000000000000000000049c5
-decq164 apply #a20780000000000000000000000049c5 -> -123.45
-
--- Nmin and below
-decq171 apply -1E-6143 -> #80084000000000000000000000000001
-decq172 apply #80084000000000000000000000000001 -> -1E-6143
-decq173 apply -1.000000000000000000000000000000000E-6143 -> #84000000000000000000000000000000
-decq174 apply #84000000000000000000000000000000 -> -1.000000000000000000000000000000000E-6143
-decq175 apply -1.000000000000000000000000000000001E-6143 -> #84000000000000000000000000000001
-decq176 apply #84000000000000000000000000000001 -> -1.000000000000000000000000000000001E-6143
-
-decq177 apply -0.100000000000000000000000000000000E-6143 -> #80000800000000000000000000000000 Subnormal
-decq178 apply #80000800000000000000000000000000 -> -1.00000000000000000000000000000000E-6144 Subnormal
-decq179 apply -0.000000000000000000000000000000010E-6143 -> #80000000000000000000000000000010 Subnormal
-decq180 apply #80000000000000000000000000000010 -> -1.0E-6175 Subnormal
-decq181 apply -0.00000000000000000000000000000001E-6143 -> #80004000000000000000000000000001 Subnormal
-decq182 apply #80004000000000000000000000000001 -> -1E-6175 Subnormal
-decq183 apply -0.000000000000000000000000000000001E-6143 -> #80000000000000000000000000000001 Subnormal
-decq184 apply #80000000000000000000000000000001 -> -1E-6176 Subnormal
-
--- underflow edge cases
-decq190 apply -1e-6176 -> #80000000000000000000000000000001 Subnormal
-decq200 apply -999999999999999999999999999999999e-6176 -> #80000ff3fcff3fcff3fcff3fcff3fcff Subnormal
-
--- zeros
-decq400 apply 0E-8000 -> #00000000000000000000000000000000 Clamped
-decq401 apply 0E-6177 -> #00000000000000000000000000000000 Clamped
-decq402 apply 0E-6176 -> #00000000000000000000000000000000
-decq403 apply #00000000000000000000000000000000 -> 0E-6176
-decq404 apply 0.000000000000000000000000000000000E-6143 -> #00000000000000000000000000000000
-decq405 apply #00000000000000000000000000000000 -> 0E-6176
-decq406 apply 0E-2 -> #22078000000000000000000000000000
-decq407 apply #22078000000000000000000000000000 -> 0.00
-decq408 apply 0 -> #22080000000000000000000000000000
-decq409 apply #22080000000000000000000000000000 -> 0
-decq410 apply 0E+3 -> #2208c000000000000000000000000000
-decq411 apply #2208c000000000000000000000000000 -> 0E+3
-decq412 apply 0E+6111 -> #43ffc000000000000000000000000000
-decq413 apply #43ffc000000000000000000000000000 -> 0E+6111
--- clamped zeros...
-decq414 apply 0E+6112 -> #43ffc000000000000000000000000000 Clamped
-decq415 apply #43ffc000000000000000000000000000 -> 0E+6111
-decq416 apply 0E+6144 -> #43ffc000000000000000000000000000 Clamped
-decq417 apply #43ffc000000000000000000000000000 -> 0E+6111
-decq418 apply 0E+8000 -> #43ffc000000000000000000000000000 Clamped
-decq419 apply #43ffc000000000000000000000000000 -> 0E+6111
-
--- negative zeros
-decq420 apply -0E-8000 -> #80000000000000000000000000000000 Clamped
-decq421 apply -0E-6177 -> #80000000000000000000000000000000 Clamped
-decq422 apply -0E-6176 -> #80000000000000000000000000000000
-decq423 apply #80000000000000000000000000000000 -> -0E-6176
-decq424 apply -0.000000000000000000000000000000000E-6143 -> #80000000000000000000000000000000
-decq425 apply #80000000000000000000000000000000 -> -0E-6176
-decq426 apply -0E-2 -> #a2078000000000000000000000000000
-decq427 apply #a2078000000000000000000000000000 -> -0.00
-decq428 apply -0 -> #a2080000000000000000000000000000
-decq429 apply #a2080000000000000000000000000000 -> -0
-decq430 apply -0E+3 -> #a208c000000000000000000000000000
-decq431 apply #a208c000000000000000000000000000 -> -0E+3
-decq432 apply -0E+6111 -> #c3ffc000000000000000000000000000
-decq433 apply #c3ffc000000000000000000000000000 -> -0E+6111
--- clamped zeros...
-decq434 apply -0E+6112 -> #c3ffc000000000000000000000000000 Clamped
-decq435 apply #c3ffc000000000000000000000000000 -> -0E+6111
-decq436 apply -0E+6144 -> #c3ffc000000000000000000000000000 Clamped
-decq437 apply #c3ffc000000000000000000000000000 -> -0E+6111
-decq438 apply -0E+8000 -> #c3ffc000000000000000000000000000 Clamped
-decq439 apply #c3ffc000000000000000000000000000 -> -0E+6111
-
--- exponent lengths
-decq440 apply #22080000000000000000000000000007 -> 7
-decq441 apply 7 -> #22080000000000000000000000000007
-decq442 apply #220a4000000000000000000000000007 -> 7E+9
-decq443 apply 7E+9 -> #220a4000000000000000000000000007
-decq444 apply #2220c000000000000000000000000007 -> 7E+99
-decq445 apply 7E+99 -> #2220c000000000000000000000000007
-decq446 apply #2301c000000000000000000000000007 -> 7E+999
-decq447 apply 7E+999 -> #2301c000000000000000000000000007
-decq448 apply #43e3c000000000000000000000000007 -> 7E+5999
-decq449 apply 7E+5999 -> #43e3c000000000000000000000000007
-
--- Specials
-decq500 apply Infinity -> #78000000000000000000000000000000
-decq501 apply #78787878787878787878787878787878 -> #78000000000000000000000000000000
-decq502 apply #78000000000000000000000000000000 -> Infinity
-decq503 apply #79797979797979797979797979797979 -> #78000000000000000000000000000000
-decq504 apply #79000000000000000000000000000000 -> Infinity
-decq505 apply #7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #78000000000000000000000000000000
-decq506 apply #7a000000000000000000000000000000 -> Infinity
-decq507 apply #7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #78000000000000000000000000000000
-decq508 apply #7b000000000000000000000000000000 -> Infinity
-
-decq509 apply NaN -> #7c000000000000000000000000000000
-decq510 apply #7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #7c003c7c7c7c7c7c7c7c7c7c7c7c7c7c
-decq511 apply #7c000000000000000000000000000000 -> NaN
-decq512 apply #7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #7c003d7d7d7d7d7d7d7d7d7d7d7d7d7d
-decq513 apply #7d000000000000000000000000000000 -> NaN
-decq514 apply #7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #7e003e7e7c7e7e7e7e7c7e7e7e7e7c7e
-decq515 apply #7e000000000000000000000000000000 -> sNaN
-decq516 apply #7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #7e003f7f7c7f7f7f7f7c7f7f7f7f7c7f
-decq517 apply #7f000000000000000000000000000000 -> sNaN
-decq518 apply #7fffffffffffffffffffffffffffffff -> sNaN999999999999999999999999999999999
-decq519 apply #7fffffffffffffffffffffffffffffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-
-decq520 apply -Infinity -> #f8000000000000000000000000000000
-decq521 apply #f8787878787878787878787878787878 -> #f8000000000000000000000000000000
-decq522 apply #f8000000000000000000000000000000 -> -Infinity
-decq523 apply #f9797979797979797979797979797979 -> #f8000000000000000000000000000000
-decq524 apply #f9000000000000000000000000000000 -> -Infinity
-decq525 apply #fa7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #f8000000000000000000000000000000
-decq526 apply #fa000000000000000000000000000000 -> -Infinity
-decq527 apply #fb7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #f8000000000000000000000000000000
-decq528 apply #fb000000000000000000000000000000 -> -Infinity
-
-decq529 apply -NaN -> #fc000000000000000000000000000000
-decq530 apply #fc7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #fc003c7c7c7c7c7c7c7c7c7c7c7c7c7c
-decq531 apply #fc000000000000000000000000000000 -> -NaN
-decq532 apply #fd7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #fc003d7d7d7d7d7d7d7d7d7d7d7d7d7d
-decq533 apply #fd000000000000000000000000000000 -> -NaN
-decq534 apply #fe7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #fe003e7e7c7e7e7e7e7c7e7e7e7e7c7e
-decq535 apply #fe000000000000000000000000000000 -> -sNaN
-decq536 apply #ff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #fe003f7f7c7f7f7f7f7c7f7f7f7f7c7f
-decq537 apply #ff000000000000000000000000000000 -> -sNaN
-decq538 apply #ffffffffffffffffffffffffffffffff -> -sNaN999999999999999999999999999999999
-decq539 apply #ffffffffffffffffffffffffffffffff -> #fe000ff3fcff3fcff3fcff3fcff3fcff
-
-decq540 apply NaN -> #7c000000000000000000000000000000
-decq541 apply NaN0 -> #7c000000000000000000000000000000
-decq542 apply NaN1 -> #7c000000000000000000000000000001
-decq543 apply NaN12 -> #7c000000000000000000000000000012
-decq544 apply NaN79 -> #7c000000000000000000000000000079
-decq545 apply NaN12345 -> #7c0000000000000000000000000049c5
-decq546 apply NaN123456 -> #7c000000000000000000000000028e56
-decq547 apply NaN799799 -> #7c0000000000000000000000000f7fdf
-decq548 apply NaN799799799799799799799799799799799 -> #7c003dff7fdff7fdff7fdff7fdff7fdf
-decq549 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-decq550 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff
-
--- fold-down full sequence
-decq601 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped
-decq602 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144
-decq603 apply 1E+6143 -> #43ffc800000000000000000000000000 Clamped
-decq604 apply #43ffc800000000000000000000000000 -> 1.00000000000000000000000000000000E+6143
-decq605 apply 1E+6142 -> #43ffc100000000000000000000000000 Clamped
-decq606 apply #43ffc100000000000000000000000000 -> 1.0000000000000000000000000000000E+6142
-decq607 apply 1E+6141 -> #43ffc010000000000000000000000000 Clamped
-decq608 apply #43ffc010000000000000000000000000 -> 1.000000000000000000000000000000E+6141
-decq609 apply 1E+6140 -> #43ffc002000000000000000000000000 Clamped
-decq610 apply #43ffc002000000000000000000000000 -> 1.00000000000000000000000000000E+6140
-decq611 apply 1E+6139 -> #43ffc000400000000000000000000000 Clamped
-decq612 apply #43ffc000400000000000000000000000 -> 1.0000000000000000000000000000E+6139
-decq613 apply 1E+6138 -> #43ffc000040000000000000000000000 Clamped
-decq614 apply #43ffc000040000000000000000000000 -> 1.000000000000000000000000000E+6138
-decq615 apply 1E+6137 -> #43ffc000008000000000000000000000 Clamped
-decq616 apply #43ffc000008000000000000000000000 -> 1.00000000000000000000000000E+6137
-decq617 apply 1E+6136 -> #43ffc000001000000000000000000000 Clamped
-decq618 apply #43ffc000001000000000000000000000 -> 1.0000000000000000000000000E+6136
-decq619 apply 1E+6135 -> #43ffc000000100000000000000000000 Clamped
-decq620 apply #43ffc000000100000000000000000000 -> 1.000000000000000000000000E+6135
-decq621 apply 1E+6134 -> #43ffc000000020000000000000000000 Clamped
-decq622 apply #43ffc000000020000000000000000000 -> 1.00000000000000000000000E+6134
-decq623 apply 1E+6133 -> #43ffc000000004000000000000000000 Clamped
-decq624 apply #43ffc000000004000000000000000000 -> 1.0000000000000000000000E+6133
-decq625 apply 1E+6132 -> #43ffc000000000400000000000000000 Clamped
-decq626 apply #43ffc000000000400000000000000000 -> 1.000000000000000000000E+6132
-decq627 apply 1E+6131 -> #43ffc000000000080000000000000000 Clamped
-decq628 apply #43ffc000000000080000000000000000 -> 1.00000000000000000000E+6131
-decq629 apply 1E+6130 -> #43ffc000000000010000000000000000 Clamped
-decq630 apply #43ffc000000000010000000000000000 -> 1.0000000000000000000E+6130
-decq631 apply 1E+6129 -> #43ffc000000000001000000000000000 Clamped
-decq632 apply #43ffc000000000001000000000000000 -> 1.000000000000000000E+6129
-decq633 apply 1E+6128 -> #43ffc000000000000200000000000000 Clamped
-decq634 apply #43ffc000000000000200000000000000 -> 1.00000000000000000E+6128
-decq635 apply 1E+6127 -> #43ffc000000000000040000000000000 Clamped
-decq636 apply #43ffc000000000000040000000000000 -> 1.0000000000000000E+6127
-decq637 apply 1E+6126 -> #43ffc000000000000004000000000000 Clamped
-decq638 apply #43ffc000000000000004000000000000 -> 1.000000000000000E+6126
-decq639 apply 1E+6125 -> #43ffc000000000000000800000000000 Clamped
-decq640 apply #43ffc000000000000000800000000000 -> 1.00000000000000E+6125
-decq641 apply 1E+6124 -> #43ffc000000000000000100000000000 Clamped
-decq642 apply #43ffc000000000000000100000000000 -> 1.0000000000000E+6124
-decq643 apply 1E+6123 -> #43ffc000000000000000010000000000 Clamped
-decq644 apply #43ffc000000000000000010000000000 -> 1.000000000000E+6123
-decq645 apply 1E+6122 -> #43ffc000000000000000002000000000 Clamped
-decq646 apply #43ffc000000000000000002000000000 -> 1.00000000000E+6122
-decq647 apply 1E+6121 -> #43ffc000000000000000000400000000 Clamped
-decq648 apply #43ffc000000000000000000400000000 -> 1.0000000000E+6121
-decq649 apply 1E+6120 -> #43ffc000000000000000000040000000 Clamped
-decq650 apply #43ffc000000000000000000040000000 -> 1.000000000E+6120
-decq651 apply 1E+6119 -> #43ffc000000000000000000008000000 Clamped
-decq652 apply #43ffc000000000000000000008000000 -> 1.00000000E+6119
-decq653 apply 1E+6118 -> #43ffc000000000000000000001000000 Clamped
-decq654 apply #43ffc000000000000000000001000000 -> 1.0000000E+6118
-decq655 apply 1E+6117 -> #43ffc000000000000000000000100000 Clamped
-decq656 apply #43ffc000000000000000000000100000 -> 1.000000E+6117
-decq657 apply 1E+6116 -> #43ffc000000000000000000000020000 Clamped
-decq658 apply #43ffc000000000000000000000020000 -> 1.00000E+6116
-decq659 apply 1E+6115 -> #43ffc000000000000000000000004000 Clamped
-decq660 apply #43ffc000000000000000000000004000 -> 1.0000E+6115
-decq661 apply 1E+6114 -> #43ffc000000000000000000000000400 Clamped
-decq662 apply #43ffc000000000000000000000000400 -> 1.000E+6114
-decq663 apply 1E+6113 -> #43ffc000000000000000000000000080 Clamped
-decq664 apply #43ffc000000000000000000000000080 -> 1.00E+6113
-decq665 apply 1E+6112 -> #43ffc000000000000000000000000010 Clamped
-decq666 apply #43ffc000000000000000000000000010 -> 1.0E+6112
-decq667 apply 1E+6111 -> #43ffc000000000000000000000000001
-decq668 apply #43ffc000000000000000000000000001 -> 1E+6111
-decq669 apply 1E+6110 -> #43ff8000000000000000000000000001
-decq670 apply #43ff8000000000000000000000000001 -> 1E+6110
-
--- Selected DPD codes
-decq700 apply #22080000000000000000000000000000 -> 0
-decq701 apply #22080000000000000000000000000009 -> 9
-decq702 apply #22080000000000000000000000000010 -> 10
-decq703 apply #22080000000000000000000000000019 -> 19
-decq704 apply #22080000000000000000000000000020 -> 20
-decq705 apply #22080000000000000000000000000029 -> 29
-decq706 apply #22080000000000000000000000000030 -> 30
-decq707 apply #22080000000000000000000000000039 -> 39
-decq708 apply #22080000000000000000000000000040 -> 40
-decq709 apply #22080000000000000000000000000049 -> 49
-decq710 apply #22080000000000000000000000000050 -> 50
-decq711 apply #22080000000000000000000000000059 -> 59
-decq712 apply #22080000000000000000000000000060 -> 60
-decq713 apply #22080000000000000000000000000069 -> 69
-decq714 apply #22080000000000000000000000000070 -> 70
-decq715 apply #22080000000000000000000000000071 -> 71
-decq716 apply #22080000000000000000000000000072 -> 72
-decq717 apply #22080000000000000000000000000073 -> 73
-decq718 apply #22080000000000000000000000000074 -> 74
-decq719 apply #22080000000000000000000000000075 -> 75
-decq720 apply #22080000000000000000000000000076 -> 76
-decq721 apply #22080000000000000000000000000077 -> 77
-decq722 apply #22080000000000000000000000000078 -> 78
-decq723 apply #22080000000000000000000000000079 -> 79
-
-decq730 apply #2208000000000000000000000000029e -> 994
-decq731 apply #2208000000000000000000000000029f -> 995
-decq732 apply #220800000000000000000000000002a0 -> 520
-decq733 apply #220800000000000000000000000002a1 -> 521
-
--- DPD: one of each of the huffman groups
-decq740 apply #220800000000000000000000000003f7 -> 777
-decq741 apply #220800000000000000000000000003f8 -> 778
-decq742 apply #220800000000000000000000000003eb -> 787
-decq743 apply #2208000000000000000000000000037d -> 877
-decq744 apply #2208000000000000000000000000039f -> 997
-decq745 apply #220800000000000000000000000003bf -> 979
-decq746 apply #220800000000000000000000000003df -> 799
-decq747 apply #2208000000000000000000000000006e -> 888
-
-
--- DPD all-highs cases (includes the 24 redundant codes)
-decq750 apply #2208000000000000000000000000006e -> 888
-decq751 apply #2208000000000000000000000000016e -> 888
-decq752 apply #2208000000000000000000000000026e -> 888
-decq753 apply #2208000000000000000000000000036e -> 888
-decq754 apply #2208000000000000000000000000006f -> 889
-decq755 apply #2208000000000000000000000000016f -> 889
-decq756 apply #2208000000000000000000000000026f -> 889
-decq757 apply #2208000000000000000000000000036f -> 889
-
-decq760 apply #2208000000000000000000000000007e -> 898
-decq761 apply #2208000000000000000000000000017e -> 898
-decq762 apply #2208000000000000000000000000027e -> 898
-decq763 apply #2208000000000000000000000000037e -> 898
-decq764 apply #2208000000000000000000000000007f -> 899
-decq765 apply #2208000000000000000000000000017f -> 899
-decq766 apply #2208000000000000000000000000027f -> 899
-decq767 apply #2208000000000000000000000000037f -> 899
-
-decq770 apply #220800000000000000000000000000ee -> 988
-decq771 apply #220800000000000000000000000001ee -> 988
-decq772 apply #220800000000000000000000000002ee -> 988
-decq773 apply #220800000000000000000000000003ee -> 988
-decq774 apply #220800000000000000000000000000ef -> 989
-decq775 apply #220800000000000000000000000001ef -> 989
-decq776 apply #220800000000000000000000000002ef -> 989
-decq777 apply #220800000000000000000000000003ef -> 989
-
-decq780 apply #220800000000000000000000000000fe -> 998
-decq781 apply #220800000000000000000000000001fe -> 998
-decq782 apply #220800000000000000000000000002fe -> 998
-decq783 apply #220800000000000000000000000003fe -> 998
-decq784 apply #220800000000000000000000000000ff -> 999
-decq785 apply #220800000000000000000000000001ff -> 999
-decq786 apply #220800000000000000000000000002ff -> 999
-decq787 apply #220800000000000000000000000003ff -> 999
-
--- Miscellaneous (testers' queries, etc.)
-
-decq790 apply #2208000000000000000000000000c000 -> 30000
-decq791 apply #22080000000000000000000000007800 -> 890000
-decq792 apply 30000 -> #2208000000000000000000000000c000
-decq793 apply 890000 -> #22080000000000000000000000007800
-
--- values around [u]int32 edges (zeros done earlier)
-decq800 apply -2147483646 -> #a208000000000000000000008c78af46
-decq801 apply -2147483647 -> #a208000000000000000000008c78af47
-decq802 apply -2147483648 -> #a208000000000000000000008c78af48
-decq803 apply -2147483649 -> #a208000000000000000000008c78af49
-decq804 apply 2147483646 -> #2208000000000000000000008c78af46
-decq805 apply 2147483647 -> #2208000000000000000000008c78af47
-decq806 apply 2147483648 -> #2208000000000000000000008c78af48
-decq807 apply 2147483649 -> #2208000000000000000000008c78af49
-decq808 apply 4294967294 -> #22080000000000000000000115afb55a
-decq809 apply 4294967295 -> #22080000000000000000000115afb55b
-decq810 apply 4294967296 -> #22080000000000000000000115afb57a
-decq811 apply 4294967297 -> #22080000000000000000000115afb57b
-
-decq820 apply #a208000000000000000000008c78af46 -> -2147483646
-decq821 apply #a208000000000000000000008c78af47 -> -2147483647
-decq822 apply #a208000000000000000000008c78af48 -> -2147483648
-decq823 apply #a208000000000000000000008c78af49 -> -2147483649
-decq824 apply #2208000000000000000000008c78af46 -> 2147483646
-decq825 apply #2208000000000000000000008c78af47 -> 2147483647
-decq826 apply #2208000000000000000000008c78af48 -> 2147483648
-decq827 apply #2208000000000000000000008c78af49 -> 2147483649
-decq828 apply #22080000000000000000000115afb55a -> 4294967294
-decq829 apply #22080000000000000000000115afb55b -> 4294967295
-decq830 apply #22080000000000000000000115afb57a -> 4294967296
-decq831 apply #22080000000000000000000115afb57b -> 4294967297
-
--- VG testcase
-decq840 apply #2080000000000000F294000000172636 -> 8.81125000000001349436E-1548
-decq841 apply #20800000000000008000000000000000 -> 8.000000000000000000E-1550
-decq842 apply #1EF98490000000010F6E4E0000000000 -> 7.049000000000010795488000000000000E-3097
-decq843 multiply #20800000000000008000000000000000 #2080000000000000F294000000172636 -> #1EF98490000000010F6E4E0000000000 Rounded
-
+------------------------------------------------------------------------
+-- dqEncode.decTest -- decimal sixteen-byte format testcases --
+-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+-- [Previously called decimal128.decTest]
+version: 2.59
+
+-- This set of tests is for the sixteen-byte concrete representation.
+-- Its characteristics are:
+--
+-- 1 bit sign
+-- 5 bits combination field
+-- 12 bits exponent continuation
+-- 110 bits coefficient continuation
+--
+-- Total exponent length 14 bits
+-- Total coefficient length 114 bits (34 digits)
+--
+-- Elimit = 12287 (maximum encoded exponent)
+-- Emax = 6144 (largest exponent value)
+-- Emin = -6143 (smallest exponent value)
+-- bias = 6176 (subtracted from encoded exponent) = -Etiny
+
+-- The testcases here have only exactly representable data on the
+-- 'left-hand-side'; rounding from strings is tested in 'base'
+-- testcase groups.
+
+extended: 1
+clamp: 1
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+
+-- General testcases
+-- (mostly derived from the Strawman 4 document and examples)
+decq001 apply #A20780000000000000000000000003D0 -> -7.50
+decq002 apply -7.50 -> #A20780000000000000000000000003D0
+-- derivative canonical plain strings
+decq003 apply #A20840000000000000000000000003D0 -> -7.50E+3
+decq004 apply -7.50E+3 -> #A20840000000000000000000000003D0
+decq005 apply #A20800000000000000000000000003D0 -> -750
+decq006 apply -750 -> #A20800000000000000000000000003D0
+decq007 apply #A207c0000000000000000000000003D0 -> -75.0
+decq008 apply -75.0 -> #A207c0000000000000000000000003D0
+decq009 apply #A20740000000000000000000000003D0 -> -0.750
+decq010 apply -0.750 -> #A20740000000000000000000000003D0
+decq011 apply #A20700000000000000000000000003D0 -> -0.0750
+decq012 apply -0.0750 -> #A20700000000000000000000000003D0
+decq013 apply #A20680000000000000000000000003D0 -> -0.000750
+decq014 apply -0.000750 -> #A20680000000000000000000000003D0
+decq015 apply #A20600000000000000000000000003D0 -> -0.00000750
+decq016 apply -0.00000750 -> #A20600000000000000000000000003D0
+decq017 apply #A205c0000000000000000000000003D0 -> -7.50E-7
+decq018 apply -7.50E-7 -> #A205c0000000000000000000000003D0
+
+-- Normality
+decq020 apply 1234567890123456789012345678901234 -> #2608134b9c1e28e56f3c127177823534
+decq021 apply -1234567890123456789012345678901234 -> #a608134b9c1e28e56f3c127177823534
+decq022 apply 1111111111111111111111111111111111 -> #26080912449124491244912449124491
+
+-- Nmax and similar
+decq031 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+decq032 apply #77ffcff3fcff3fcff3fcff3fcff3fcff -> 9.999999999999999999999999999999999E+6144
+decq033 apply 1.234567890123456789012345678901234E+6144 -> #47ffd34b9c1e28e56f3c127177823534
+decq034 apply #47ffd34b9c1e28e56f3c127177823534 -> 1.234567890123456789012345678901234E+6144
+-- fold-downs (more below)
+decq035 apply 1.23E+6144 -> #47ffd300000000000000000000000000 Clamped
+decq036 apply #47ffd300000000000000000000000000 -> 1.230000000000000000000000000000000E+6144
+decq037 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped
+decq038 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144
+
+decq051 apply 12345 -> #220800000000000000000000000049c5
+decq052 apply #220800000000000000000000000049c5 -> 12345
+decq053 apply 1234 -> #22080000000000000000000000000534
+decq054 apply #22080000000000000000000000000534 -> 1234
+decq055 apply 123 -> #220800000000000000000000000000a3
+decq056 apply #220800000000000000000000000000a3 -> 123
+decq057 apply 12 -> #22080000000000000000000000000012
+decq058 apply #22080000000000000000000000000012 -> 12
+decq059 apply 1 -> #22080000000000000000000000000001
+decq060 apply #22080000000000000000000000000001 -> 1
+decq061 apply 1.23 -> #220780000000000000000000000000a3
+decq062 apply #220780000000000000000000000000a3 -> 1.23
+decq063 apply 123.45 -> #220780000000000000000000000049c5
+decq064 apply #220780000000000000000000000049c5 -> 123.45
+
+-- Nmin and below
+decq071 apply 1E-6143 -> #00084000000000000000000000000001
+decq072 apply #00084000000000000000000000000001 -> 1E-6143
+decq073 apply 1.000000000000000000000000000000000E-6143 -> #04000000000000000000000000000000
+decq074 apply #04000000000000000000000000000000 -> 1.000000000000000000000000000000000E-6143
+decq075 apply 1.000000000000000000000000000000001E-6143 -> #04000000000000000000000000000001
+decq076 apply #04000000000000000000000000000001 -> 1.000000000000000000000000000000001E-6143
+
+decq077 apply 0.100000000000000000000000000000000E-6143 -> #00000800000000000000000000000000 Subnormal
+decq078 apply #00000800000000000000000000000000 -> 1.00000000000000000000000000000000E-6144 Subnormal
+decq079 apply 0.000000000000000000000000000000010E-6143 -> #00000000000000000000000000000010 Subnormal
+decq080 apply #00000000000000000000000000000010 -> 1.0E-6175 Subnormal
+decq081 apply 0.00000000000000000000000000000001E-6143 -> #00004000000000000000000000000001 Subnormal
+decq082 apply #00004000000000000000000000000001 -> 1E-6175 Subnormal
+decq083 apply 0.000000000000000000000000000000001E-6143 -> #00000000000000000000000000000001 Subnormal
+decq084 apply #00000000000000000000000000000001 -> 1E-6176 Subnormal
+
+-- underflows cannot be tested for simple copies, check edge cases
+decq090 apply 1e-6176 -> #00000000000000000000000000000001 Subnormal
+decq100 apply 999999999999999999999999999999999e-6176 -> #00000ff3fcff3fcff3fcff3fcff3fcff Subnormal
+
+-- same again, negatives
+-- Nmax and similar
+decq122 apply -9.999999999999999999999999999999999E+6144 -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
+decq123 apply #f7ffcff3fcff3fcff3fcff3fcff3fcff -> -9.999999999999999999999999999999999E+6144
+decq124 apply -1.234567890123456789012345678901234E+6144 -> #c7ffd34b9c1e28e56f3c127177823534
+decq125 apply #c7ffd34b9c1e28e56f3c127177823534 -> -1.234567890123456789012345678901234E+6144
+-- fold-downs (more below)
+decq130 apply -1.23E+6144 -> #c7ffd300000000000000000000000000 Clamped
+decq131 apply #c7ffd300000000000000000000000000 -> -1.230000000000000000000000000000000E+6144
+decq132 apply -1E+6144 -> #c7ffc000000000000000000000000000 Clamped
+decq133 apply #c7ffc000000000000000000000000000 -> -1.000000000000000000000000000000000E+6144
+
+decq151 apply -12345 -> #a20800000000000000000000000049c5
+decq152 apply #a20800000000000000000000000049c5 -> -12345
+decq153 apply -1234 -> #a2080000000000000000000000000534
+decq154 apply #a2080000000000000000000000000534 -> -1234
+decq155 apply -123 -> #a20800000000000000000000000000a3
+decq156 apply #a20800000000000000000000000000a3 -> -123
+decq157 apply -12 -> #a2080000000000000000000000000012
+decq158 apply #a2080000000000000000000000000012 -> -12
+decq159 apply -1 -> #a2080000000000000000000000000001
+decq160 apply #a2080000000000000000000000000001 -> -1
+decq161 apply -1.23 -> #a20780000000000000000000000000a3
+decq162 apply #a20780000000000000000000000000a3 -> -1.23
+decq163 apply -123.45 -> #a20780000000000000000000000049c5
+decq164 apply #a20780000000000000000000000049c5 -> -123.45
+
+-- Nmin and below
+decq171 apply -1E-6143 -> #80084000000000000000000000000001
+decq172 apply #80084000000000000000000000000001 -> -1E-6143
+decq173 apply -1.000000000000000000000000000000000E-6143 -> #84000000000000000000000000000000
+decq174 apply #84000000000000000000000000000000 -> -1.000000000000000000000000000000000E-6143
+decq175 apply -1.000000000000000000000000000000001E-6143 -> #84000000000000000000000000000001
+decq176 apply #84000000000000000000000000000001 -> -1.000000000000000000000000000000001E-6143
+
+decq177 apply -0.100000000000000000000000000000000E-6143 -> #80000800000000000000000000000000 Subnormal
+decq178 apply #80000800000000000000000000000000 -> -1.00000000000000000000000000000000E-6144 Subnormal
+decq179 apply -0.000000000000000000000000000000010E-6143 -> #80000000000000000000000000000010 Subnormal
+decq180 apply #80000000000000000000000000000010 -> -1.0E-6175 Subnormal
+decq181 apply -0.00000000000000000000000000000001E-6143 -> #80004000000000000000000000000001 Subnormal
+decq182 apply #80004000000000000000000000000001 -> -1E-6175 Subnormal
+decq183 apply -0.000000000000000000000000000000001E-6143 -> #80000000000000000000000000000001 Subnormal
+decq184 apply #80000000000000000000000000000001 -> -1E-6176 Subnormal
+
+-- underflow edge cases
+decq190 apply -1e-6176 -> #80000000000000000000000000000001 Subnormal
+decq200 apply -999999999999999999999999999999999e-6176 -> #80000ff3fcff3fcff3fcff3fcff3fcff Subnormal
+
+-- zeros
+decq400 apply 0E-8000 -> #00000000000000000000000000000000 Clamped
+decq401 apply 0E-6177 -> #00000000000000000000000000000000 Clamped
+decq402 apply 0E-6176 -> #00000000000000000000000000000000
+decq403 apply #00000000000000000000000000000000 -> 0E-6176
+decq404 apply 0.000000000000000000000000000000000E-6143 -> #00000000000000000000000000000000
+decq405 apply #00000000000000000000000000000000 -> 0E-6176
+decq406 apply 0E-2 -> #22078000000000000000000000000000
+decq407 apply #22078000000000000000000000000000 -> 0.00
+decq408 apply 0 -> #22080000000000000000000000000000
+decq409 apply #22080000000000000000000000000000 -> 0
+decq410 apply 0E+3 -> #2208c000000000000000000000000000
+decq411 apply #2208c000000000000000000000000000 -> 0E+3
+decq412 apply 0E+6111 -> #43ffc000000000000000000000000000
+decq413 apply #43ffc000000000000000000000000000 -> 0E+6111
+-- clamped zeros...
+decq414 apply 0E+6112 -> #43ffc000000000000000000000000000 Clamped
+decq415 apply #43ffc000000000000000000000000000 -> 0E+6111
+decq416 apply 0E+6144 -> #43ffc000000000000000000000000000 Clamped
+decq417 apply #43ffc000000000000000000000000000 -> 0E+6111
+decq418 apply 0E+8000 -> #43ffc000000000000000000000000000 Clamped
+decq419 apply #43ffc000000000000000000000000000 -> 0E+6111
+
+-- negative zeros
+decq420 apply -0E-8000 -> #80000000000000000000000000000000 Clamped
+decq421 apply -0E-6177 -> #80000000000000000000000000000000 Clamped
+decq422 apply -0E-6176 -> #80000000000000000000000000000000
+decq423 apply #80000000000000000000000000000000 -> -0E-6176
+decq424 apply -0.000000000000000000000000000000000E-6143 -> #80000000000000000000000000000000
+decq425 apply #80000000000000000000000000000000 -> -0E-6176
+decq426 apply -0E-2 -> #a2078000000000000000000000000000
+decq427 apply #a2078000000000000000000000000000 -> -0.00
+decq428 apply -0 -> #a2080000000000000000000000000000
+decq429 apply #a2080000000000000000000000000000 -> -0
+decq430 apply -0E+3 -> #a208c000000000000000000000000000
+decq431 apply #a208c000000000000000000000000000 -> -0E+3
+decq432 apply -0E+6111 -> #c3ffc000000000000000000000000000
+decq433 apply #c3ffc000000000000000000000000000 -> -0E+6111
+-- clamped zeros...
+decq434 apply -0E+6112 -> #c3ffc000000000000000000000000000 Clamped
+decq435 apply #c3ffc000000000000000000000000000 -> -0E+6111
+decq436 apply -0E+6144 -> #c3ffc000000000000000000000000000 Clamped
+decq437 apply #c3ffc000000000000000000000000000 -> -0E+6111
+decq438 apply -0E+8000 -> #c3ffc000000000000000000000000000 Clamped
+decq439 apply #c3ffc000000000000000000000000000 -> -0E+6111
+
+-- exponent lengths
+decq440 apply #22080000000000000000000000000007 -> 7
+decq441 apply 7 -> #22080000000000000000000000000007
+decq442 apply #220a4000000000000000000000000007 -> 7E+9
+decq443 apply 7E+9 -> #220a4000000000000000000000000007
+decq444 apply #2220c000000000000000000000000007 -> 7E+99
+decq445 apply 7E+99 -> #2220c000000000000000000000000007
+decq446 apply #2301c000000000000000000000000007 -> 7E+999
+decq447 apply 7E+999 -> #2301c000000000000000000000000007
+decq448 apply #43e3c000000000000000000000000007 -> 7E+5999
+decq449 apply 7E+5999 -> #43e3c000000000000000000000000007
+
+-- Specials
+decq500 apply Infinity -> #78000000000000000000000000000000
+decq501 apply #78787878787878787878787878787878 -> #78000000000000000000000000000000
+decq502 apply #78000000000000000000000000000000 -> Infinity
+decq503 apply #79797979797979797979797979797979 -> #78000000000000000000000000000000
+decq504 apply #79000000000000000000000000000000 -> Infinity
+decq505 apply #7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #78000000000000000000000000000000
+decq506 apply #7a000000000000000000000000000000 -> Infinity
+decq507 apply #7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #78000000000000000000000000000000
+decq508 apply #7b000000000000000000000000000000 -> Infinity
+
+decq509 apply NaN -> #7c000000000000000000000000000000
+decq510 apply #7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #7c003c7c7c7c7c7c7c7c7c7c7c7c7c7c
+decq511 apply #7c000000000000000000000000000000 -> NaN
+decq512 apply #7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #7c003d7d7d7d7d7d7d7d7d7d7d7d7d7d
+decq513 apply #7d000000000000000000000000000000 -> NaN
+decq514 apply #7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #7e003e7e7c7e7e7e7e7c7e7e7e7e7c7e
+decq515 apply #7e000000000000000000000000000000 -> sNaN
+decq516 apply #7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #7e003f7f7c7f7f7f7f7c7f7f7f7f7c7f
+decq517 apply #7f000000000000000000000000000000 -> sNaN
+decq518 apply #7fffffffffffffffffffffffffffffff -> sNaN999999999999999999999999999999999
+decq519 apply #7fffffffffffffffffffffffffffffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+
+decq520 apply -Infinity -> #f8000000000000000000000000000000
+decq521 apply #f8787878787878787878787878787878 -> #f8000000000000000000000000000000
+decq522 apply #f8000000000000000000000000000000 -> -Infinity
+decq523 apply #f9797979797979797979797979797979 -> #f8000000000000000000000000000000
+decq524 apply #f9000000000000000000000000000000 -> -Infinity
+decq525 apply #fa7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #f8000000000000000000000000000000
+decq526 apply #fa000000000000000000000000000000 -> -Infinity
+decq527 apply #fb7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #f8000000000000000000000000000000
+decq528 apply #fb000000000000000000000000000000 -> -Infinity
+
+decq529 apply -NaN -> #fc000000000000000000000000000000
+decq530 apply #fc7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #fc003c7c7c7c7c7c7c7c7c7c7c7c7c7c
+decq531 apply #fc000000000000000000000000000000 -> -NaN
+decq532 apply #fd7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #fc003d7d7d7d7d7d7d7d7d7d7d7d7d7d
+decq533 apply #fd000000000000000000000000000000 -> -NaN
+decq534 apply #fe7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #fe003e7e7c7e7e7e7e7c7e7e7e7e7c7e
+decq535 apply #fe000000000000000000000000000000 -> -sNaN
+decq536 apply #ff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #fe003f7f7c7f7f7f7f7c7f7f7f7f7c7f
+decq537 apply #ff000000000000000000000000000000 -> -sNaN
+decq538 apply #ffffffffffffffffffffffffffffffff -> -sNaN999999999999999999999999999999999
+decq539 apply #ffffffffffffffffffffffffffffffff -> #fe000ff3fcff3fcff3fcff3fcff3fcff
+
+decq540 apply NaN -> #7c000000000000000000000000000000
+decq541 apply NaN0 -> #7c000000000000000000000000000000
+decq542 apply NaN1 -> #7c000000000000000000000000000001
+decq543 apply NaN12 -> #7c000000000000000000000000000012
+decq544 apply NaN79 -> #7c000000000000000000000000000079
+decq545 apply NaN12345 -> #7c0000000000000000000000000049c5
+decq546 apply NaN123456 -> #7c000000000000000000000000028e56
+decq547 apply NaN799799 -> #7c0000000000000000000000000f7fdf
+decq548 apply NaN799799799799799799799799799799799 -> #7c003dff7fdff7fdff7fdff7fdff7fdf
+decq549 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+decq550 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff
+
+-- fold-down full sequence
+decq601 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped
+decq602 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144
+decq603 apply 1E+6143 -> #43ffc800000000000000000000000000 Clamped
+decq604 apply #43ffc800000000000000000000000000 -> 1.00000000000000000000000000000000E+6143
+decq605 apply 1E+6142 -> #43ffc100000000000000000000000000 Clamped
+decq606 apply #43ffc100000000000000000000000000 -> 1.0000000000000000000000000000000E+6142
+decq607 apply 1E+6141 -> #43ffc010000000000000000000000000 Clamped
+decq608 apply #43ffc010000000000000000000000000 -> 1.000000000000000000000000000000E+6141
+decq609 apply 1E+6140 -> #43ffc002000000000000000000000000 Clamped
+decq610 apply #43ffc002000000000000000000000000 -> 1.00000000000000000000000000000E+6140
+decq611 apply 1E+6139 -> #43ffc000400000000000000000000000 Clamped
+decq612 apply #43ffc000400000000000000000000000 -> 1.0000000000000000000000000000E+6139
+decq613 apply 1E+6138 -> #43ffc000040000000000000000000000 Clamped
+decq614 apply #43ffc000040000000000000000000000 -> 1.000000000000000000000000000E+6138
+decq615 apply 1E+6137 -> #43ffc000008000000000000000000000 Clamped
+decq616 apply #43ffc000008000000000000000000000 -> 1.00000000000000000000000000E+6137
+decq617 apply 1E+6136 -> #43ffc000001000000000000000000000 Clamped
+decq618 apply #43ffc000001000000000000000000000 -> 1.0000000000000000000000000E+6136
+decq619 apply 1E+6135 -> #43ffc000000100000000000000000000 Clamped
+decq620 apply #43ffc000000100000000000000000000 -> 1.000000000000000000000000E+6135
+decq621 apply 1E+6134 -> #43ffc000000020000000000000000000 Clamped
+decq622 apply #43ffc000000020000000000000000000 -> 1.00000000000000000000000E+6134
+decq623 apply 1E+6133 -> #43ffc000000004000000000000000000 Clamped
+decq624 apply #43ffc000000004000000000000000000 -> 1.0000000000000000000000E+6133
+decq625 apply 1E+6132 -> #43ffc000000000400000000000000000 Clamped
+decq626 apply #43ffc000000000400000000000000000 -> 1.000000000000000000000E+6132
+decq627 apply 1E+6131 -> #43ffc000000000080000000000000000 Clamped
+decq628 apply #43ffc000000000080000000000000000 -> 1.00000000000000000000E+6131
+decq629 apply 1E+6130 -> #43ffc000000000010000000000000000 Clamped
+decq630 apply #43ffc000000000010000000000000000 -> 1.0000000000000000000E+6130
+decq631 apply 1E+6129 -> #43ffc000000000001000000000000000 Clamped
+decq632 apply #43ffc000000000001000000000000000 -> 1.000000000000000000E+6129
+decq633 apply 1E+6128 -> #43ffc000000000000200000000000000 Clamped
+decq634 apply #43ffc000000000000200000000000000 -> 1.00000000000000000E+6128
+decq635 apply 1E+6127 -> #43ffc000000000000040000000000000 Clamped
+decq636 apply #43ffc000000000000040000000000000 -> 1.0000000000000000E+6127
+decq637 apply 1E+6126 -> #43ffc000000000000004000000000000 Clamped
+decq638 apply #43ffc000000000000004000000000000 -> 1.000000000000000E+6126
+decq639 apply 1E+6125 -> #43ffc000000000000000800000000000 Clamped
+decq640 apply #43ffc000000000000000800000000000 -> 1.00000000000000E+6125
+decq641 apply 1E+6124 -> #43ffc000000000000000100000000000 Clamped
+decq642 apply #43ffc000000000000000100000000000 -> 1.0000000000000E+6124
+decq643 apply 1E+6123 -> #43ffc000000000000000010000000000 Clamped
+decq644 apply #43ffc000000000000000010000000000 -> 1.000000000000E+6123
+decq645 apply 1E+6122 -> #43ffc000000000000000002000000000 Clamped
+decq646 apply #43ffc000000000000000002000000000 -> 1.00000000000E+6122
+decq647 apply 1E+6121 -> #43ffc000000000000000000400000000 Clamped
+decq648 apply #43ffc000000000000000000400000000 -> 1.0000000000E+6121
+decq649 apply 1E+6120 -> #43ffc000000000000000000040000000 Clamped
+decq650 apply #43ffc000000000000000000040000000 -> 1.000000000E+6120
+decq651 apply 1E+6119 -> #43ffc000000000000000000008000000 Clamped
+decq652 apply #43ffc000000000000000000008000000 -> 1.00000000E+6119
+decq653 apply 1E+6118 -> #43ffc000000000000000000001000000 Clamped
+decq654 apply #43ffc000000000000000000001000000 -> 1.0000000E+6118
+decq655 apply 1E+6117 -> #43ffc000000000000000000000100000 Clamped
+decq656 apply #43ffc000000000000000000000100000 -> 1.000000E+6117
+decq657 apply 1E+6116 -> #43ffc000000000000000000000020000 Clamped
+decq658 apply #43ffc000000000000000000000020000 -> 1.00000E+6116
+decq659 apply 1E+6115 -> #43ffc000000000000000000000004000 Clamped
+decq660 apply #43ffc000000000000000000000004000 -> 1.0000E+6115
+decq661 apply 1E+6114 -> #43ffc000000000000000000000000400 Clamped
+decq662 apply #43ffc000000000000000000000000400 -> 1.000E+6114
+decq663 apply 1E+6113 -> #43ffc000000000000000000000000080 Clamped
+decq664 apply #43ffc000000000000000000000000080 -> 1.00E+6113
+decq665 apply 1E+6112 -> #43ffc000000000000000000000000010 Clamped
+decq666 apply #43ffc000000000000000000000000010 -> 1.0E+6112
+decq667 apply 1E+6111 -> #43ffc000000000000000000000000001
+decq668 apply #43ffc000000000000000000000000001 -> 1E+6111
+decq669 apply 1E+6110 -> #43ff8000000000000000000000000001
+decq670 apply #43ff8000000000000000000000000001 -> 1E+6110
+
+-- Selected DPD codes
+decq700 apply #22080000000000000000000000000000 -> 0
+decq701 apply #22080000000000000000000000000009 -> 9
+decq702 apply #22080000000000000000000000000010 -> 10
+decq703 apply #22080000000000000000000000000019 -> 19
+decq704 apply #22080000000000000000000000000020 -> 20
+decq705 apply #22080000000000000000000000000029 -> 29
+decq706 apply #22080000000000000000000000000030 -> 30
+decq707 apply #22080000000000000000000000000039 -> 39
+decq708 apply #22080000000000000000000000000040 -> 40
+decq709 apply #22080000000000000000000000000049 -> 49
+decq710 apply #22080000000000000000000000000050 -> 50
+decq711 apply #22080000000000000000000000000059 -> 59
+decq712 apply #22080000000000000000000000000060 -> 60
+decq713 apply #22080000000000000000000000000069 -> 69
+decq714 apply #22080000000000000000000000000070 -> 70
+decq715 apply #22080000000000000000000000000071 -> 71
+decq716 apply #22080000000000000000000000000072 -> 72
+decq717 apply #22080000000000000000000000000073 -> 73
+decq718 apply #22080000000000000000000000000074 -> 74
+decq719 apply #22080000000000000000000000000075 -> 75
+decq720 apply #22080000000000000000000000000076 -> 76
+decq721 apply #22080000000000000000000000000077 -> 77
+decq722 apply #22080000000000000000000000000078 -> 78
+decq723 apply #22080000000000000000000000000079 -> 79
+
+decq730 apply #2208000000000000000000000000029e -> 994
+decq731 apply #2208000000000000000000000000029f -> 995
+decq732 apply #220800000000000000000000000002a0 -> 520
+decq733 apply #220800000000000000000000000002a1 -> 521
+
+-- DPD: one of each of the huffman groups
+decq740 apply #220800000000000000000000000003f7 -> 777
+decq741 apply #220800000000000000000000000003f8 -> 778
+decq742 apply #220800000000000000000000000003eb -> 787
+decq743 apply #2208000000000000000000000000037d -> 877
+decq744 apply #2208000000000000000000000000039f -> 997
+decq745 apply #220800000000000000000000000003bf -> 979
+decq746 apply #220800000000000000000000000003df -> 799
+decq747 apply #2208000000000000000000000000006e -> 888
+
+
+-- DPD all-highs cases (includes the 24 redundant codes)
+decq750 apply #2208000000000000000000000000006e -> 888
+decq751 apply #2208000000000000000000000000016e -> 888
+decq752 apply #2208000000000000000000000000026e -> 888
+decq753 apply #2208000000000000000000000000036e -> 888
+decq754 apply #2208000000000000000000000000006f -> 889
+decq755 apply #2208000000000000000000000000016f -> 889
+decq756 apply #2208000000000000000000000000026f -> 889
+decq757 apply #2208000000000000000000000000036f -> 889
+
+decq760 apply #2208000000000000000000000000007e -> 898
+decq761 apply #2208000000000000000000000000017e -> 898
+decq762 apply #2208000000000000000000000000027e -> 898
+decq763 apply #2208000000000000000000000000037e -> 898
+decq764 apply #2208000000000000000000000000007f -> 899
+decq765 apply #2208000000000000000000000000017f -> 899
+decq766 apply #2208000000000000000000000000027f -> 899
+decq767 apply #2208000000000000000000000000037f -> 899
+
+decq770 apply #220800000000000000000000000000ee -> 988
+decq771 apply #220800000000000000000000000001ee -> 988
+decq772 apply #220800000000000000000000000002ee -> 988
+decq773 apply #220800000000000000000000000003ee -> 988
+decq774 apply #220800000000000000000000000000ef -> 989
+decq775 apply #220800000000000000000000000001ef -> 989
+decq776 apply #220800000000000000000000000002ef -> 989
+decq777 apply #220800000000000000000000000003ef -> 989
+
+decq780 apply #220800000000000000000000000000fe -> 998
+decq781 apply #220800000000000000000000000001fe -> 998
+decq782 apply #220800000000000000000000000002fe -> 998
+decq783 apply #220800000000000000000000000003fe -> 998
+decq784 apply #220800000000000000000000000000ff -> 999
+decq785 apply #220800000000000000000000000001ff -> 999
+decq786 apply #220800000000000000000000000002ff -> 999
+decq787 apply #220800000000000000000000000003ff -> 999
+
+-- Miscellaneous (testers' queries, etc.)
+
+decq790 apply #2208000000000000000000000000c000 -> 30000
+decq791 apply #22080000000000000000000000007800 -> 890000
+decq792 apply 30000 -> #2208000000000000000000000000c000
+decq793 apply 890000 -> #22080000000000000000000000007800
+
+-- values around [u]int32 edges (zeros done earlier)
+decq800 apply -2147483646 -> #a208000000000000000000008c78af46
+decq801 apply -2147483647 -> #a208000000000000000000008c78af47
+decq802 apply -2147483648 -> #a208000000000000000000008c78af48
+decq803 apply -2147483649 -> #a208000000000000000000008c78af49
+decq804 apply 2147483646 -> #2208000000000000000000008c78af46
+decq805 apply 2147483647 -> #2208000000000000000000008c78af47
+decq806 apply 2147483648 -> #2208000000000000000000008c78af48
+decq807 apply 2147483649 -> #2208000000000000000000008c78af49
+decq808 apply 4294967294 -> #22080000000000000000000115afb55a
+decq809 apply 4294967295 -> #22080000000000000000000115afb55b
+decq810 apply 4294967296 -> #22080000000000000000000115afb57a
+decq811 apply 4294967297 -> #22080000000000000000000115afb57b
+
+decq820 apply #a208000000000000000000008c78af46 -> -2147483646
+decq821 apply #a208000000000000000000008c78af47 -> -2147483647
+decq822 apply #a208000000000000000000008c78af48 -> -2147483648
+decq823 apply #a208000000000000000000008c78af49 -> -2147483649
+decq824 apply #2208000000000000000000008c78af46 -> 2147483646
+decq825 apply #2208000000000000000000008c78af47 -> 2147483647
+decq826 apply #2208000000000000000000008c78af48 -> 2147483648
+decq827 apply #2208000000000000000000008c78af49 -> 2147483649
+decq828 apply #22080000000000000000000115afb55a -> 4294967294
+decq829 apply #22080000000000000000000115afb55b -> 4294967295
+decq830 apply #22080000000000000000000115afb57a -> 4294967296
+decq831 apply #22080000000000000000000115afb57b -> 4294967297
+
+-- VG testcase
+decq840 apply #2080000000000000F294000000172636 -> 8.81125000000001349436E-1548
+decq841 apply #20800000000000008000000000000000 -> 8.000000000000000000E-1550
+decq842 apply #1EF98490000000010F6E4E0000000000 -> 7.049000000000010795488000000000000E-3097
+decq843 multiply #20800000000000008000000000000000 #2080000000000000F294000000172636 -> #1EF98490000000010F6E4E0000000000 Rounded
+
diff --git a/Lib/test/decimaltestdata/dqFMA.decTest b/Lib/test/decimaltestdata/dqFMA.decTest
index d884553b8a..2353f2fa2c 100644
--- a/Lib/test/decimaltestdata/dqFMA.decTest
+++ b/Lib/test/decimaltestdata/dqFMA.decTest
@@ -1,1786 +1,1786 @@
-------------------------------------------------------------------------
--- dqFMA.decTest -- decQuad Fused Multiply Add --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- These tests comprese three parts:
--- 1. Sanity checks and other three-operand tests (especially those
--- where the fused operation makes a difference)
--- 2. Multiply tests (third operand is neutral zero [0E+emax])
--- 3. Addition tests (first operand is 1)
--- The multiply and addition tests are extensive because FMA may have
--- its own dedicated multiplication or addition routine(s), and they
--- also inherently check the left-to-right properties.
-
--- Sanity checks
-dqfma0001 fma 1 1 1 -> 2
-dqfma0002 fma 1 1 2 -> 3
-dqfma0003 fma 2 2 3 -> 7
-dqfma0004 fma 9 9 9 -> 90
-dqfma0005 fma -1 1 1 -> 0
-dqfma0006 fma -1 1 2 -> 1
-dqfma0007 fma -2 2 3 -> -1
-dqfma0008 fma -9 9 9 -> -72
-dqfma0011 fma 1 -1 1 -> 0
-dqfma0012 fma 1 -1 2 -> 1
-dqfma0013 fma 2 -2 3 -> -1
-dqfma0014 fma 9 -9 9 -> -72
-dqfma0015 fma 1 1 -1 -> 0
-dqfma0016 fma 1 1 -2 -> -1
-dqfma0017 fma 2 2 -3 -> 1
-dqfma0018 fma 9 9 -9 -> 72
-
--- non-integer exacts
-dqfma0100 fma 25.2 63.6 -438 -> 1164.72
-dqfma0101 fma 0.301 0.380 334 -> 334.114380
-dqfma0102 fma 49.2 -4.8 23.3 -> -212.86
-dqfma0103 fma 4.22 0.079 -94.6 -> -94.26662
-dqfma0104 fma 903 0.797 0.887 -> 720.578
-dqfma0105 fma 6.13 -161 65.9 -> -921.03
-dqfma0106 fma 28.2 727 5.45 -> 20506.85
-dqfma0107 fma 4 605 688 -> 3108
-dqfma0108 fma 93.3 0.19 0.226 -> 17.953
-dqfma0109 fma 0.169 -341 5.61 -> -52.019
-dqfma0110 fma -72.2 30 -51.2 -> -2217.2
-dqfma0111 fma -0.409 13 20.4 -> 15.083
-dqfma0112 fma 317 77.0 19.0 -> 24428.0
-dqfma0113 fma 47 6.58 1.62 -> 310.88
-dqfma0114 fma 1.36 0.984 0.493 -> 1.83124
-dqfma0115 fma 72.7 274 1.56 -> 19921.36
-dqfma0116 fma 335 847 83 -> 283828
-dqfma0117 fma 666 0.247 25.4 -> 189.902
-dqfma0118 fma -3.87 3.06 78.0 -> 66.1578
-dqfma0119 fma 0.742 192 35.6 -> 178.064
-dqfma0120 fma -91.6 5.29 0.153 -> -484.411
-
--- cases where result is different from separate multiply + add; each
--- is preceded by the result of unfused multiply and add
--- [this is about 20% of all similar cases in general]
--- -> 4.500119002100000209469729375698778E+38
-dqfma0202 fma 68537985861355864457.5694 6565875762972086605.85969 35892634447236753.172812 -> 4.500119002100000209469729375698779E+38 Inexact Rounded
--- -> 5.996248469584594346858881620185514E+41
-dqfma0208 fma 89261822344727628571.9 6717595845654131383336.89 5061036497288796076266.11 -> 5.996248469584594346858881620185513E+41 Inexact Rounded
--- -> 1.899242968678256924021594770874070E+34
-dqfma0210 fma 320506237232448685.495971 59257597764017967.984448 3205615239077711589912.85 -> 1.899242968678256924021594770874071E+34 Inexact Rounded
--- -> 7.078596978842809537929699954860309E+37
-dqfma0215 fma 220247843259112263.17995 321392340287987979002.80 47533279819997167655440 -> 7.078596978842809537929699954860308E+37 Inexact Rounded
--- -> 1.224955667581427559754106862350743E+37
-dqfma0226 fma 23880729790368880412.1449 512947333827064719.55407 217117438419590824502.963 -> 1.224955667581427559754106862350744E+37 Inexact Rounded
--- -> -2.530094043253148806272276368579144E+42
-dqfma0229 fma 2539892357016099706.4126 -996142232667504817717435 53682082598315949425.937 -> -2.530094043253148806272276368579143E+42 Inexact Rounded
--- -> 1.713387085759711954319391412788454E+37
-dqfma0233 fma 4546339491341624464.0804 3768717864169205581 83578980278690395184.620 -> 1.713387085759711954319391412788453E+37 Inexact Rounded
--- -> 4.062275663405823716411579117771547E+35
-dqfma0235 fma 409242119433816131.42253 992633815166741501.477249 70179636544416756129546 -> 4.062275663405823716411579117771548E+35 Inexact Rounded
--- -> 6.002604327732568490562249875306823E+47
-dqfma0258 fma 817941336593541742159684 733867339769310729266598 78563844650942419311830.8 -> 6.002604327732568490562249875306822E+47 Inexact Rounded
--- -> -2.027022514381452197510103395283874E+39
-dqfma0264 fma 387617310169161270.737532 -5229442703414956061216.62 57665666816652967150473.5 -> -2.027022514381452197510103395283873E+39 Inexact Rounded
--- -> -7.856525039803554001144089842730361E+37
-dqfma0267 fma -847655845720565274701.210 92685316564117739.83984 22780950041376424429.5686 -> -7.856525039803554001144089842730360E+37 Inexact Rounded
--- -> 1.695515562011520746125607502237559E+38
-dqfma0268 fma 21590290365127685.3675 7853139227576541379426.8 -3275859437236180.761544 -> 1.695515562011520746125607502237558E+38 Inexact Rounded
--- -> -8.448422935783289219748115038014710E+38
-dqfma0269 fma -974320636272862697.971586 867109103641860247440.756 -9775170775902454762.98 -> -8.448422935783289219748115038014709E+38 Inexact Rounded
-
--- Cases where multiply would overflow or underflow if separate
-dqfma0300 fma 9e+6144 10 0 -> Infinity Overflow Inexact Rounded
-dqfma0301 fma 1e+6144 10 0 -> Infinity Overflow Inexact Rounded
-dqfma0302 fma 1e+6144 10 -1e+6144 -> 9.000000000000000000000000000000000E+6144 Clamped
-dqfma0303 fma 1e+6144 10 -9e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped
--- subnormal etc.
-dqfma0305 fma 1e-6176 0.1 0 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma0306 fma 1e-6176 0.1 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqfma0307 fma 1e-6176 0.1 1e-6176 -> 1E-6176 Underflow Subnormal Inexact Rounded
-
--- Infinite combinations
-dqfma0800 fma Inf Inf Inf -> Infinity
-dqfma0801 fma Inf Inf -Inf -> NaN Invalid_operation
-dqfma0802 fma Inf -Inf Inf -> NaN Invalid_operation
-dqfma0803 fma Inf -Inf -Inf -> -Infinity
-dqfma0804 fma -Inf Inf Inf -> NaN Invalid_operation
-dqfma0805 fma -Inf Inf -Inf -> -Infinity
-dqfma0806 fma -Inf -Inf Inf -> Infinity
-dqfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
-
--- Triple NaN propagation
-dqfma0900 fma NaN2 NaN3 NaN5 -> NaN2
-dqfma0901 fma 0 NaN3 NaN5 -> NaN3
-dqfma0902 fma 0 0 NaN5 -> NaN5
--- first sNaN wins (consider qNaN from earlier sNaN being
--- overridden by an sNaN in third operand)
-dqfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-dqfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
-dqfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
-dqfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-dqfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
-dqfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
-
--- MULTIPLICATION TESTS ------------------------------------------------
-rounding: half_even
-
--- sanity checks
-dqfma2000 fma 2 2 0e+6144 -> 4
-dqfma2001 fma 2 3 0e+6144 -> 6
-dqfma2002 fma 5 1 0e+6144 -> 5
-dqfma2003 fma 5 2 0e+6144 -> 10
-dqfma2004 fma 1.20 2 0e+6144 -> 2.40
-dqfma2005 fma 1.20 0 0e+6144 -> 0.00
-dqfma2006 fma 1.20 -2 0e+6144 -> -2.40
-dqfma2007 fma -1.20 2 0e+6144 -> -2.40
-dqfma2008 fma -1.20 0 0e+6144 -> 0.00
-dqfma2009 fma -1.20 -2 0e+6144 -> 2.40
-dqfma2010 fma 5.09 7.1 0e+6144 -> 36.139
-dqfma2011 fma 2.5 4 0e+6144 -> 10.0
-dqfma2012 fma 2.50 4 0e+6144 -> 10.00
-dqfma2013 fma 1.23456789 1.0000000000000000000000000000 0e+6144 -> 1.234567890000000000000000000000000 Rounded
-dqfma2015 fma 2.50 4 0e+6144 -> 10.00
-dqfma2016 fma 9.99999999999999999 9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded
-dqfma2017 fma 9.99999999999999999 -9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded
-dqfma2018 fma -9.99999999999999999 9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded
-dqfma2019 fma -9.99999999999999999 -9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded
-
--- zeros, etc.
-dqfma2021 fma 0 0 0e+6144 -> 0
-dqfma2022 fma 0 -0 0e+6144 -> 0
-dqfma2023 fma -0 0 0e+6144 -> 0
-dqfma2024 fma -0 -0 0e+6144 -> 0
-dqfma2025 fma -0.0 -0.0 0e+6144 -> 0.00
-dqfma2026 fma -0.0 -0.0 0e+6144 -> 0.00
-dqfma2027 fma -0.0 -0.0 0e+6144 -> 0.00
-dqfma2028 fma -0.0 -0.0 0e+6144 -> 0.00
-dqfma2030 fma 5.00 1E-3 0e+6144 -> 0.00500
-dqfma2031 fma 00.00 0.000 0e+6144 -> 0.00000
-dqfma2032 fma 00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0
-dqfma2033 fma 0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0
-dqfma2034 fma -5.00 1E-3 0e+6144 -> -0.00500
-dqfma2035 fma -00.00 0.000 0e+6144 -> 0.00000
-dqfma2036 fma -00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0
-dqfma2037 fma -0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0
-dqfma2038 fma 5.00 -1E-3 0e+6144 -> -0.00500
-dqfma2039 fma 00.00 -0.000 0e+6144 -> 0.00000
-dqfma2040 fma 00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0
-dqfma2041 fma 0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0
-dqfma2042 fma -5.00 -1E-3 0e+6144 -> 0.00500
-dqfma2043 fma -00.00 -0.000 0e+6144 -> 0.00000
-dqfma2044 fma -00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0
-dqfma2045 fma -0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0
-
--- examples from decarith
-dqfma2050 fma 1.20 3 0e+6144 -> 3.60
-dqfma2051 fma 7 3 0e+6144 -> 21
-dqfma2052 fma 0.9 0.8 0e+6144 -> 0.72
-dqfma2053 fma 0.9 -0 0e+6144 -> 0.0
-dqfma2054 fma 654321 654321 0e+6144 -> 428135971041
-
-dqfma2060 fma 123.45 1e7 0e+6144 -> 1.2345E+9
-dqfma2061 fma 123.45 1e8 0e+6144 -> 1.2345E+10
-dqfma2062 fma 123.45 1e+9 0e+6144 -> 1.2345E+11
-dqfma2063 fma 123.45 1e10 0e+6144 -> 1.2345E+12
-dqfma2064 fma 123.45 1e11 0e+6144 -> 1.2345E+13
-dqfma2065 fma 123.45 1e12 0e+6144 -> 1.2345E+14
-dqfma2066 fma 123.45 1e13 0e+6144 -> 1.2345E+15
-
-
--- test some intermediate lengths
--- 1234567890123456
-dqfma2080 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9
-dqfma2084 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9
-dqfma2090 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9
-dqfma2094 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9
-
--- test some more edge cases and carries
-dqfma2101 fma 9 9 0e+6144 -> 81
-dqfma2102 fma 9 90 0e+6144 -> 810
-dqfma2103 fma 9 900 0e+6144 -> 8100
-dqfma2104 fma 9 9000 0e+6144 -> 81000
-dqfma2105 fma 9 90000 0e+6144 -> 810000
-dqfma2106 fma 9 900000 0e+6144 -> 8100000
-dqfma2107 fma 9 9000000 0e+6144 -> 81000000
-dqfma2108 fma 9 90000000 0e+6144 -> 810000000
-dqfma2109 fma 9 900000000 0e+6144 -> 8100000000
-dqfma2110 fma 9 9000000000 0e+6144 -> 81000000000
-dqfma2111 fma 9 90000000000 0e+6144 -> 810000000000
-dqfma2112 fma 9 900000000000 0e+6144 -> 8100000000000
-dqfma2113 fma 9 9000000000000 0e+6144 -> 81000000000000
-dqfma2114 fma 9 90000000000000 0e+6144 -> 810000000000000
-dqfma2115 fma 9 900000000000000 0e+6144 -> 8100000000000000
---dqfma2116 fma 9 9000000000000000 0e+6144 -> 81000000000000000
---dqfma2117 fma 9 90000000000000000 0e+6144 -> 810000000000000000
---dqfma2118 fma 9 900000000000000000 0e+6144 -> 8100000000000000000
---dqfma2119 fma 9 9000000000000000000 0e+6144 -> 81000000000000000000
---dqfma2120 fma 9 90000000000000000000 0e+6144 -> 810000000000000000000
---dqfma2121 fma 9 900000000000000000000 0e+6144 -> 8100000000000000000000
---dqfma2122 fma 9 9000000000000000000000 0e+6144 -> 81000000000000000000000
---dqfma2123 fma 9 90000000000000000000000 0e+6144 -> 810000000000000000000000
--- test some more edge cases without carries
-dqfma2131 fma 3 3 0e+6144 -> 9
-dqfma2132 fma 3 30 0e+6144 -> 90
-dqfma2133 fma 3 300 0e+6144 -> 900
-dqfma2134 fma 3 3000 0e+6144 -> 9000
-dqfma2135 fma 3 30000 0e+6144 -> 90000
-dqfma2136 fma 3 300000 0e+6144 -> 900000
-dqfma2137 fma 3 3000000 0e+6144 -> 9000000
-dqfma2138 fma 3 30000000 0e+6144 -> 90000000
-dqfma2139 fma 3 300000000 0e+6144 -> 900000000
-dqfma2140 fma 3 3000000000 0e+6144 -> 9000000000
-dqfma2141 fma 3 30000000000 0e+6144 -> 90000000000
-dqfma2142 fma 3 300000000000 0e+6144 -> 900000000000
-dqfma2143 fma 3 3000000000000 0e+6144 -> 9000000000000
-dqfma2144 fma 3 30000000000000 0e+6144 -> 90000000000000
-dqfma2145 fma 3 300000000000000 0e+6144 -> 900000000000000
-dqfma2146 fma 3 3000000000000000 0e+6144 -> 9000000000000000
-dqfma2147 fma 3 30000000000000000 0e+6144 -> 90000000000000000
-dqfma2148 fma 3 300000000000000000 0e+6144 -> 900000000000000000
-dqfma2149 fma 3 3000000000000000000 0e+6144 -> 9000000000000000000
-dqfma2150 fma 3 30000000000000000000 0e+6144 -> 90000000000000000000
-dqfma2151 fma 3 300000000000000000000 0e+6144 -> 900000000000000000000
-dqfma2152 fma 3 3000000000000000000000 0e+6144 -> 9000000000000000000000
-dqfma2153 fma 3 30000000000000000000000 0e+6144 -> 90000000000000000000000
-
-dqfma2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0e+6144 -> 145433.2908011933696719165119928296 Inexact Rounded
-
--- test some edge cases with exact rounding
-dqfma2301 fma 900000000000000000 9 0e+6144 -> 8100000000000000000
-dqfma2302 fma 900000000000000000 90 0e+6144 -> 81000000000000000000
-dqfma2303 fma 900000000000000000 900 0e+6144 -> 810000000000000000000
-dqfma2304 fma 900000000000000000 9000 0e+6144 -> 8100000000000000000000
-dqfma2305 fma 900000000000000000 90000 0e+6144 -> 81000000000000000000000
-dqfma2306 fma 900000000000000000 900000 0e+6144 -> 810000000000000000000000
-dqfma2307 fma 900000000000000000 9000000 0e+6144 -> 8100000000000000000000000
-dqfma2308 fma 900000000000000000 90000000 0e+6144 -> 81000000000000000000000000
-dqfma2309 fma 900000000000000000 900000000 0e+6144 -> 810000000000000000000000000
-dqfma2310 fma 900000000000000000 9000000000 0e+6144 -> 8100000000000000000000000000
-dqfma2311 fma 900000000000000000 90000000000 0e+6144 -> 81000000000000000000000000000
-dqfma2312 fma 900000000000000000 900000000000 0e+6144 -> 810000000000000000000000000000
-dqfma2313 fma 900000000000000000 9000000000000 0e+6144 -> 8100000000000000000000000000000
-dqfma2314 fma 900000000000000000 90000000000000 0e+6144 -> 81000000000000000000000000000000
-dqfma2315 fma 900000000000000000 900000000000000 0e+6144 -> 810000000000000000000000000000000
-dqfma2316 fma 900000000000000000 9000000000000000 0e+6144 -> 8100000000000000000000000000000000
-dqfma2317 fma 9000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+34 Rounded
-dqfma2318 fma 90000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+35 Rounded
-dqfma2319 fma 900000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+36 Rounded
-dqfma2320 fma 9000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+37 Rounded
-dqfma2321 fma 90000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+38 Rounded
-dqfma2322 fma 900000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+39 Rounded
-dqfma2323 fma 9000000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+40 Rounded
-
--- tryzeros cases
-dqfma2504 fma 0E-4260 1000E-4260 0e+6144 -> 0E-6176 Clamped
-dqfma2505 fma 100E+4260 0E+4260 0e+6144 -> 0E+6111 Clamped
-
--- mixed with zeros
-dqfma2541 fma 0 -1 0e+6144 -> 0
-dqfma2542 fma -0 -1 0e+6144 -> 0
-dqfma2543 fma 0 1 0e+6144 -> 0
-dqfma2544 fma -0 1 0e+6144 -> 0
-dqfma2545 fma -1 0 0e+6144 -> 0
-dqfma2546 fma -1 -0 0e+6144 -> 0
-dqfma2547 fma 1 0 0e+6144 -> 0
-dqfma2548 fma 1 -0 0e+6144 -> 0
-
-dqfma2551 fma 0.0 -1 0e+6144 -> 0.0
-dqfma2552 fma -0.0 -1 0e+6144 -> 0.0
-dqfma2553 fma 0.0 1 0e+6144 -> 0.0
-dqfma2554 fma -0.0 1 0e+6144 -> 0.0
-dqfma2555 fma -1.0 0 0e+6144 -> 0.0
-dqfma2556 fma -1.0 -0 0e+6144 -> 0.0
-dqfma2557 fma 1.0 0 0e+6144 -> 0.0
-dqfma2558 fma 1.0 -0 0e+6144 -> 0.0
-
-dqfma2561 fma 0 -1.0 0e+6144 -> 0.0
-dqfma2562 fma -0 -1.0 0e+6144 -> 0.0
-dqfma2563 fma 0 1.0 0e+6144 -> 0.0
-dqfma2564 fma -0 1.0 0e+6144 -> 0.0
-dqfma2565 fma -1 0.0 0e+6144 -> 0.0
-dqfma2566 fma -1 -0.0 0e+6144 -> 0.0
-dqfma2567 fma 1 0.0 0e+6144 -> 0.0
-dqfma2568 fma 1 -0.0 0e+6144 -> 0.0
-
-dqfma2571 fma 0.0 -1.0 0e+6144 -> 0.00
-dqfma2572 fma -0.0 -1.0 0e+6144 -> 0.00
-dqfma2573 fma 0.0 1.0 0e+6144 -> 0.00
-dqfma2574 fma -0.0 1.0 0e+6144 -> 0.00
-dqfma2575 fma -1.0 0.0 0e+6144 -> 0.00
-dqfma2576 fma -1.0 -0.0 0e+6144 -> 0.00
-dqfma2577 fma 1.0 0.0 0e+6144 -> 0.00
-dqfma2578 fma 1.0 -0.0 0e+6144 -> 0.00
-dqfma2579 fma 1.0 0.0 0e+6144 -> 0.00
-dqfma2530 fma -1.0 -0.0 0e+6144 -> 0.00
-dqfma2531 fma -1.0 0.0 0e+6144 -> 0.00
-dqfma2532 fma 1.0 -0.0 -0e+6144 -> -0.00
-dqfma2533 fma 1.0 0.0 -0e+6144 -> 0.00
-dqfma2534 fma -1.0 -0.0 -0e+6144 -> 0.00
-dqfma2535 fma -1.0 0.0 -0e+6144 -> -0.00
-
-
--- Specials
-dqfma2580 fma Inf -Inf 0e+6144 -> -Infinity
-dqfma2581 fma Inf -1000 0e+6144 -> -Infinity
-dqfma2582 fma Inf -1 0e+6144 -> -Infinity
-dqfma2583 fma Inf -0 0e+6144 -> NaN Invalid_operation
-dqfma2584 fma Inf 0 0e+6144 -> NaN Invalid_operation
-dqfma2585 fma Inf 1 0e+6144 -> Infinity
-dqfma2586 fma Inf 1000 0e+6144 -> Infinity
-dqfma2587 fma Inf Inf 0e+6144 -> Infinity
-dqfma2588 fma -1000 Inf 0e+6144 -> -Infinity
-dqfma2589 fma -Inf Inf 0e+6144 -> -Infinity
-dqfma2590 fma -1 Inf 0e+6144 -> -Infinity
-dqfma2591 fma -0 Inf 0e+6144 -> NaN Invalid_operation
-dqfma2592 fma 0 Inf 0e+6144 -> NaN Invalid_operation
-dqfma2593 fma 1 Inf 0e+6144 -> Infinity
-dqfma2594 fma 1000 Inf 0e+6144 -> Infinity
-dqfma2595 fma Inf Inf 0e+6144 -> Infinity
-
-dqfma2600 fma -Inf -Inf 0e+6144 -> Infinity
-dqfma2601 fma -Inf -1000 0e+6144 -> Infinity
-dqfma2602 fma -Inf -1 0e+6144 -> Infinity
-dqfma2603 fma -Inf -0 0e+6144 -> NaN Invalid_operation
-dqfma2604 fma -Inf 0 0e+6144 -> NaN Invalid_operation
-dqfma2605 fma -Inf 1 0e+6144 -> -Infinity
-dqfma2606 fma -Inf 1000 0e+6144 -> -Infinity
-dqfma2607 fma -Inf Inf 0e+6144 -> -Infinity
-dqfma2608 fma -1000 Inf 0e+6144 -> -Infinity
-dqfma2609 fma -Inf -Inf 0e+6144 -> Infinity
-dqfma2610 fma -1 -Inf 0e+6144 -> Infinity
-dqfma2611 fma -0 -Inf 0e+6144 -> NaN Invalid_operation
-dqfma2612 fma 0 -Inf 0e+6144 -> NaN Invalid_operation
-dqfma2613 fma 1 -Inf 0e+6144 -> -Infinity
-dqfma2614 fma 1000 -Inf 0e+6144 -> -Infinity
-dqfma2615 fma Inf -Inf 0e+6144 -> -Infinity
-
-dqfma2621 fma NaN -Inf 0e+6144 -> NaN
-dqfma2622 fma NaN -1000 0e+6144 -> NaN
-dqfma2623 fma NaN -1 0e+6144 -> NaN
-dqfma2624 fma NaN -0 0e+6144 -> NaN
-dqfma2625 fma NaN 0 0e+6144 -> NaN
-dqfma2626 fma NaN 1 0e+6144 -> NaN
-dqfma2627 fma NaN 1000 0e+6144 -> NaN
-dqfma2628 fma NaN Inf 0e+6144 -> NaN
-dqfma2629 fma NaN NaN 0e+6144 -> NaN
-dqfma2630 fma -Inf NaN 0e+6144 -> NaN
-dqfma2631 fma -1000 NaN 0e+6144 -> NaN
-dqfma2632 fma -1 NaN 0e+6144 -> NaN
-dqfma2633 fma -0 NaN 0e+6144 -> NaN
-dqfma2634 fma 0 NaN 0e+6144 -> NaN
-dqfma2635 fma 1 NaN 0e+6144 -> NaN
-dqfma2636 fma 1000 NaN 0e+6144 -> NaN
-dqfma2637 fma Inf NaN 0e+6144 -> NaN
-
-dqfma2641 fma sNaN -Inf 0e+6144 -> NaN Invalid_operation
-dqfma2642 fma sNaN -1000 0e+6144 -> NaN Invalid_operation
-dqfma2643 fma sNaN -1 0e+6144 -> NaN Invalid_operation
-dqfma2644 fma sNaN -0 0e+6144 -> NaN Invalid_operation
-dqfma2645 fma sNaN 0 0e+6144 -> NaN Invalid_operation
-dqfma2646 fma sNaN 1 0e+6144 -> NaN Invalid_operation
-dqfma2647 fma sNaN 1000 0e+6144 -> NaN Invalid_operation
-dqfma2648 fma sNaN NaN 0e+6144 -> NaN Invalid_operation
-dqfma2649 fma sNaN sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2650 fma NaN sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2651 fma -Inf sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2652 fma -1000 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2653 fma -1 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2654 fma -0 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2655 fma 0 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2656 fma 1 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2657 fma 1000 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2658 fma Inf sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2659 fma NaN sNaN 0e+6144 -> NaN Invalid_operation
-
--- propagating NaNs
-dqfma2661 fma NaN9 -Inf 0e+6144 -> NaN9
-dqfma2662 fma NaN8 999 0e+6144 -> NaN8
-dqfma2663 fma NaN71 Inf 0e+6144 -> NaN71
-dqfma2664 fma NaN6 NaN5 0e+6144 -> NaN6
-dqfma2665 fma -Inf NaN4 0e+6144 -> NaN4
-dqfma2666 fma -999 NaN33 0e+6144 -> NaN33
-dqfma2667 fma Inf NaN2 0e+6144 -> NaN2
-
-dqfma2671 fma sNaN99 -Inf 0e+6144 -> NaN99 Invalid_operation
-dqfma2672 fma sNaN98 -11 0e+6144 -> NaN98 Invalid_operation
-dqfma2673 fma sNaN97 NaN 0e+6144 -> NaN97 Invalid_operation
-dqfma2674 fma sNaN16 sNaN94 0e+6144 -> NaN16 Invalid_operation
-dqfma2675 fma NaN95 sNaN93 0e+6144 -> NaN93 Invalid_operation
-dqfma2676 fma -Inf sNaN92 0e+6144 -> NaN92 Invalid_operation
-dqfma2677 fma 088 sNaN91 0e+6144 -> NaN91 Invalid_operation
-dqfma2678 fma Inf sNaN90 0e+6144 -> NaN90 Invalid_operation
-dqfma2679 fma NaN sNaN89 0e+6144 -> NaN89 Invalid_operation
-
-dqfma2681 fma -NaN9 -Inf 0e+6144 -> -NaN9
-dqfma2682 fma -NaN8 999 0e+6144 -> -NaN8
-dqfma2683 fma -NaN71 Inf 0e+6144 -> -NaN71
-dqfma2684 fma -NaN6 -NaN5 0e+6144 -> -NaN6
-dqfma2685 fma -Inf -NaN4 0e+6144 -> -NaN4
-dqfma2686 fma -999 -NaN33 0e+6144 -> -NaN33
-dqfma2687 fma Inf -NaN2 0e+6144 -> -NaN2
-
-dqfma2691 fma -sNaN99 -Inf 0e+6144 -> -NaN99 Invalid_operation
-dqfma2692 fma -sNaN98 -11 0e+6144 -> -NaN98 Invalid_operation
-dqfma2693 fma -sNaN97 NaN 0e+6144 -> -NaN97 Invalid_operation
-dqfma2694 fma -sNaN16 -sNaN94 0e+6144 -> -NaN16 Invalid_operation
-dqfma2695 fma -NaN95 -sNaN93 0e+6144 -> -NaN93 Invalid_operation
-dqfma2696 fma -Inf -sNaN92 0e+6144 -> -NaN92 Invalid_operation
-dqfma2697 fma 088 -sNaN91 0e+6144 -> -NaN91 Invalid_operation
-dqfma2698 fma Inf -sNaN90 0e+6144 -> -NaN90 Invalid_operation
-dqfma2699 fma -NaN -sNaN89 0e+6144 -> -NaN89 Invalid_operation
-
-dqfma2701 fma -NaN -Inf 0e+6144 -> -NaN
-dqfma2702 fma -NaN 999 0e+6144 -> -NaN
-dqfma2703 fma -NaN Inf 0e+6144 -> -NaN
-dqfma2704 fma -NaN -NaN 0e+6144 -> -NaN
-dqfma2705 fma -Inf -NaN0 0e+6144 -> -NaN
-dqfma2706 fma -999 -NaN 0e+6144 -> -NaN
-dqfma2707 fma Inf -NaN 0e+6144 -> -NaN
-
-dqfma2711 fma -sNaN -Inf 0e+6144 -> -NaN Invalid_operation
-dqfma2712 fma -sNaN -11 0e+6144 -> -NaN Invalid_operation
-dqfma2713 fma -sNaN00 NaN 0e+6144 -> -NaN Invalid_operation
-dqfma2714 fma -sNaN -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2715 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2716 fma -Inf -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2717 fma 088 -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2718 fma Inf -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2719 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
--- signs
-dqfma2751 fma 1e+4277 1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2752 fma 1e+4277 -1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded
-dqfma2753 fma -1e+4277 1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded
-dqfma2754 fma -1e+4277 -1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2755 fma 1e-4277 1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2756 fma 1e-4277 -1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2757 fma -1e-4277 1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2758 fma -1e-4277 -1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dqfma2760 fma 1e-6069 1e-101 0e+6144 -> 1E-6170 Subnormal
-dqfma2761 fma 1e-6069 1e-102 0e+6144 -> 1E-6171 Subnormal
-dqfma2762 fma 1e-6069 1e-103 0e+6144 -> 1E-6172 Subnormal
-dqfma2763 fma 1e-6069 1e-104 0e+6144 -> 1E-6173 Subnormal
-dqfma2764 fma 1e-6069 1e-105 0e+6144 -> 1E-6174 Subnormal
-dqfma2765 fma 1e-6069 1e-106 0e+6144 -> 1E-6175 Subnormal
-dqfma2766 fma 1e-6069 1e-107 0e+6144 -> 1E-6176 Subnormal
-dqfma2767 fma 1e-6069 1e-108 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2768 fma 1e-6069 1e-109 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2769 fma 1e-6069 1e-110 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-dqfma2770 fma 1e+40 1e+6101 0e+6144 -> 1.000000000000000000000000000000E+6141 Clamped
-dqfma2771 fma 1e+40 1e+6102 0e+6144 -> 1.0000000000000000000000000000000E+6142 Clamped
-dqfma2772 fma 1e+40 1e+6103 0e+6144 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqfma2773 fma 1e+40 1e+6104 0e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped
-dqfma2774 fma 1e+40 1e+6105 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2775 fma 1e+40 1e+6106 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2776 fma 1e+40 1e+6107 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2777 fma 1e+40 1e+6108 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2778 fma 1e+40 1e+6109 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2779 fma 1e+40 1e+6110 0e+6144 -> Infinity Overflow Inexact Rounded
-
-dqfma2801 fma 1.0000E-6172 1 0e+6144 -> 1.0000E-6172 Subnormal
-dqfma2802 fma 1.000E-6172 1e-1 0e+6144 -> 1.000E-6173 Subnormal
-dqfma2803 fma 1.00E-6172 1e-2 0e+6144 -> 1.00E-6174 Subnormal
-dqfma2804 fma 1.0E-6172 1e-3 0e+6144 -> 1.0E-6175 Subnormal
-dqfma2805 fma 1.0E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal Rounded
-dqfma2806 fma 1.3E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2807 fma 1.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2808 fma 1.7E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2809 fma 2.3E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2810 fma 2.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2811 fma 2.7E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqfma2812 fma 1.49E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2813 fma 1.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2814 fma 1.51E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2815 fma 2.49E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2816 fma 2.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2817 fma 2.51E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded
-
-dqfma2818 fma 1E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal
-dqfma2819 fma 3E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2820 fma 5E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2821 fma 7E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2822 fma 9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2823 fma 9.9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-
-dqfma2824 fma 1E-6172 -1e-4 0e+6144 -> -1E-6176 Subnormal
-dqfma2825 fma 3E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2826 fma -5E-6172 1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2827 fma 7E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2828 fma -9E-6172 1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2829 fma 9.9E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2830 fma 3.0E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqfma2831 fma 1.0E-5977 1e-200 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2832 fma 1.0E-5977 1e-199 0e+6144 -> 1E-6176 Subnormal Rounded
-dqfma2833 fma 1.0E-5977 1e-198 0e+6144 -> 1.0E-6175 Subnormal
-dqfma2834 fma 2.0E-5977 2e-198 0e+6144 -> 4.0E-6175 Subnormal
-dqfma2835 fma 4.0E-5977 4e-198 0e+6144 -> 1.60E-6174 Subnormal
-dqfma2836 fma 10.0E-5977 10e-198 0e+6144 -> 1.000E-6173 Subnormal
-dqfma2837 fma 30.0E-5977 30e-198 0e+6144 -> 9.000E-6173 Subnormal
-dqfma2838 fma 40.0E-5982 40e-166 0e+6144 -> 1.6000E-6145 Subnormal
-dqfma2839 fma 40.0E-5982 40e-165 0e+6144 -> 1.6000E-6144 Subnormal
-dqfma2840 fma 40.0E-5982 40e-164 0e+6144 -> 1.6000E-6143
-
--- Long operand overflow may be a different path
-dqfma2870 fma 100 9.999E+6143 0e+6144 -> Infinity Inexact Overflow Rounded
-dqfma2871 fma 100 -9.999E+6143 0e+6144 -> -Infinity Inexact Overflow Rounded
-dqfma2872 fma 9.999E+6143 100 0e+6144 -> Infinity Inexact Overflow Rounded
-dqfma2873 fma -9.999E+6143 100 0e+6144 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-dqfma2881 fma 1.2347E-6133 1.2347E-40 0e+6144 -> 1.524E-6173 Inexact Rounded Subnormal Underflow
-dqfma2882 fma 1.234E-6133 1.234E-40 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqfma2883 fma 1.23E-6133 1.23E-40 0e+6144 -> 1.513E-6173 Inexact Rounded Subnormal Underflow
-dqfma2884 fma 1.2E-6133 1.2E-40 0e+6144 -> 1.44E-6173 Subnormal
-dqfma2885 fma 1.2E-6133 1.2E-41 0e+6144 -> 1.44E-6174 Subnormal
-dqfma2886 fma 1.2E-6133 1.2E-42 0e+6144 -> 1.4E-6175 Subnormal Inexact Rounded Underflow
-dqfma2887 fma 1.2E-6133 1.3E-42 0e+6144 -> 1.6E-6175 Subnormal Inexact Rounded Underflow
-dqfma2888 fma 1.3E-6133 1.3E-42 0e+6144 -> 1.7E-6175 Subnormal Inexact Rounded Underflow
-dqfma2889 fma 1.3E-6133 1.3E-43 0e+6144 -> 2E-6176 Subnormal Inexact Rounded Underflow
-dqfma2890 fma 1.3E-6134 1.3E-43 0e+6144 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow
-
-dqfma2891 fma 1.2345E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
-dqfma2892 fma 1.23456E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
-dqfma2893 fma 1.2345E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqfma2894 fma 1.23456E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqfma2895 fma 1.2345E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
-dqfma2896 fma 1.23456E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
--- prove operands are exact
-dqfma2906 fma 9.999999999999999999999999999999999E-6143 1 0e+6144 -> 9.999999999999999999999999999999999E-6143
-dqfma2907 fma 1 0.09999999999999999999999999999999999 0e+6144 -> 0.09999999999999999999999999999999999
--- the next rounds to Nmin
-dqfma2908 fma 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 0e+6144 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded
-
--- hugest
-dqfma2909 fma 9999999999999999999999999999999999 9999999999999999999999999999999999 0e+6144 -> 9.999999999999999999999999999999998E+67 Inexact Rounded
-
--- Examples from SQL proposal (Krishna Kulkarni)
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
-dqfma21001 fma 130E-2 120E-2 0e+6144 -> 1.5600
-dqfma21002 fma 130E-2 12E-1 0e+6144 -> 1.560
-dqfma21003 fma 130E-2 1E0 0e+6144 -> 1.30
-dqfma21004 fma 1E2 1E4 0e+6144 -> 1E+6
-
--- Null tests
-dqfma2990 fma 10 # 0e+6144 -> NaN Invalid_operation
-dqfma2991 fma # 10 0e+6144 -> NaN Invalid_operation
-
-
--- ADDITION TESTS ------------------------------------------------------
-rounding: half_even
-
--- [first group are 'quick confidence check']
-dqadd3001 fma 1 1 1 -> 2
-dqadd3002 fma 1 2 3 -> 5
-dqadd3003 fma 1 '5.75' '3.3' -> 9.05
-dqadd3004 fma 1 '5' '-3' -> 2
-dqadd3005 fma 1 '-5' '-3' -> -8
-dqadd3006 fma 1 '-7' '2.5' -> -4.5
-dqadd3007 fma 1 '0.7' '0.3' -> 1.0
-dqadd3008 fma 1 '1.25' '1.25' -> 2.50
-dqadd3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
-dqadd3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
-
--- 1234567890123456 1234567890123456
-dqadd3011 fma 1 '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqadd3012 fma 1 '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded
-dqadd3013 fma 1 '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
-dqadd3014 fma 1 '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd3015 fma 1 '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd3016 fma 1 '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd3017 fma 1 '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd3018 fma 1 '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded
-dqadd3019 fma 1 '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded
-dqadd3020 fma 1 '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded
-
-dqadd3021 fma 1 0 1 -> 1
-dqadd3022 fma 1 1 1 -> 2
-dqadd3023 fma 1 2 1 -> 3
-dqadd3024 fma 1 3 1 -> 4
-dqadd3025 fma 1 4 1 -> 5
-dqadd3026 fma 1 5 1 -> 6
-dqadd3027 fma 1 6 1 -> 7
-dqadd3028 fma 1 7 1 -> 8
-dqadd3029 fma 1 8 1 -> 9
-dqadd3030 fma 1 9 1 -> 10
-
--- some carrying effects
-dqadd3031 fma 1 '0.9998' '0.0000' -> '0.9998'
-dqadd3032 fma 1 '0.9998' '0.0001' -> '0.9999'
-dqadd3033 fma 1 '0.9998' '0.0002' -> '1.0000'
-dqadd3034 fma 1 '0.9998' '0.0003' -> '1.0001'
-
-dqadd3035 fma 1 '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3036 fma 1 '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3037 fma 1 '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3038 fma 1 '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
-dqadd3039 fma 1 '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded
-
--- symmetry:
-dqadd3040 fma 1 '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3041 fma 1 '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3042 fma 1 '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3044 fma 1 '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
-dqadd3045 fma 1 '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded
-
--- same, without rounding
-dqadd3046 fma 1 '10000e+9' '7' -> '10000000000007'
-dqadd3047 fma 1 '10000e+9' '70' -> '10000000000070'
-dqadd3048 fma 1 '10000e+9' '700' -> '10000000000700'
-dqadd3049 fma 1 '10000e+9' '7000' -> '10000000007000'
-dqadd3050 fma 1 '10000e+9' '70000' -> '10000000070000'
-dqadd3051 fma 1 '10000e+9' '700000' -> '10000000700000'
-dqadd3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-dqadd3053 fma 1 '12' '7.00' -> '19.00'
-dqadd3054 fma 1 '1.3' '-1.07' -> '0.23'
-dqadd3055 fma 1 '1.3' '-1.30' -> '0.00'
-dqadd3056 fma 1 '1.3' '-2.07' -> '-0.77'
-dqadd3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
-
--- leading zero preservation
-dqadd3061 fma 1 1 '0.0001' -> '1.0001'
-dqadd3062 fma 1 1 '0.00001' -> '1.00001'
-dqadd3063 fma 1 1 '0.000001' -> '1.000001'
-dqadd3064 fma 1 1 '0.0000001' -> '1.0000001'
-dqadd3065 fma 1 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-dqadd3070 fma 1 1 0 -> 1
-dqadd3071 fma 1 1 0. -> 1
-dqadd3072 fma 1 1 .0 -> 1.0
-dqadd3073 fma 1 1 0.0 -> 1.0
-dqadd3074 fma 1 1 0.00 -> 1.00
-dqadd3075 fma 1 0 1 -> 1
-dqadd3076 fma 1 0. 1 -> 1
-dqadd3077 fma 1 .0 1 -> 1.0
-dqadd3078 fma 1 0.0 1 -> 1.0
-dqadd3079 fma 1 0.00 1 -> 1.00
-
--- some carries
-dqadd3080 fma 1 999999998 1 -> 999999999
-dqadd3081 fma 1 999999999 1 -> 1000000000
-dqadd3082 fma 1 99999999 1 -> 100000000
-dqadd3083 fma 1 9999999 1 -> 10000000
-dqadd3084 fma 1 999999 1 -> 1000000
-dqadd3085 fma 1 99999 1 -> 100000
-dqadd3086 fma 1 9999 1 -> 10000
-dqadd3087 fma 1 999 1 -> 1000
-dqadd3088 fma 1 99 1 -> 100
-dqadd3089 fma 1 9 1 -> 10
-
-
--- more LHS swaps
-dqadd3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
-dqadd3091 fma 1 '-56267E-6' 0 -> '-0.056267'
-dqadd3092 fma 1 '-56267E-5' 0 -> '-0.56267'
-dqadd3093 fma 1 '-56267E-4' 0 -> '-5.6267'
-dqadd3094 fma 1 '-56267E-3' 0 -> '-56.267'
-dqadd3095 fma 1 '-56267E-2' 0 -> '-562.67'
-dqadd3096 fma 1 '-56267E-1' 0 -> '-5626.7'
-dqadd3097 fma 1 '-56267E-0' 0 -> '-56267'
-dqadd3098 fma 1 '-5E-10' 0 -> '-5E-10'
-dqadd3099 fma 1 '-5E-7' 0 -> '-5E-7'
-dqadd3100 fma 1 '-5E-6' 0 -> '-0.000005'
-dqadd3101 fma 1 '-5E-5' 0 -> '-0.00005'
-dqadd3102 fma 1 '-5E-4' 0 -> '-0.0005'
-dqadd3103 fma 1 '-5E-1' 0 -> '-0.5'
-dqadd3104 fma 1 '-5E0' 0 -> '-5'
-dqadd3105 fma 1 '-5E1' 0 -> '-50'
-dqadd3106 fma 1 '-5E5' 0 -> '-500000'
-dqadd3107 fma 1 '-5E33' 0 -> '-5000000000000000000000000000000000'
-dqadd3108 fma 1 '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
-dqadd3109 fma 1 '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
-dqadd3110 fma 1 '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
-dqadd3111 fma 1 '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- more RHS swaps
-dqadd3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
-dqadd3114 fma 1 0 '-56267E-6' -> '-0.056267'
-dqadd3116 fma 1 0 '-56267E-5' -> '-0.56267'
-dqadd3117 fma 1 0 '-56267E-4' -> '-5.6267'
-dqadd3119 fma 1 0 '-56267E-3' -> '-56.267'
-dqadd3120 fma 1 0 '-56267E-2' -> '-562.67'
-dqadd3121 fma 1 0 '-56267E-1' -> '-5626.7'
-dqadd3122 fma 1 0 '-56267E-0' -> '-56267'
-dqadd3123 fma 1 0 '-5E-10' -> '-5E-10'
-dqadd3124 fma 1 0 '-5E-7' -> '-5E-7'
-dqadd3125 fma 1 0 '-5E-6' -> '-0.000005'
-dqadd3126 fma 1 0 '-5E-5' -> '-0.00005'
-dqadd3127 fma 1 0 '-5E-4' -> '-0.0005'
-dqadd3128 fma 1 0 '-5E-1' -> '-0.5'
-dqadd3129 fma 1 0 '-5E0' -> '-5'
-dqadd3130 fma 1 0 '-5E1' -> '-50'
-dqadd3131 fma 1 0 '-5E5' -> '-500000'
-dqadd3132 fma 1 0 '-5E33' -> '-5000000000000000000000000000000000'
-dqadd3133 fma 1 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded
-dqadd3134 fma 1 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded
-dqadd3135 fma 1 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded
-dqadd3136 fma 1 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- related
-dqadd3137 fma 1 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded
-dqadd3138 fma 1 -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded
-dqadd3139 fma 1 '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded
-dqadd3140 fma 1 '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded
-dqadd3141 fma 1 1E+29 0.0000 -> '100000000000000000000000000000.0000'
-dqadd3142 fma 1 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded
-dqadd3143 fma 1 0.000 1E+30 -> '1000000000000000000000000000000.000'
-dqadd3144 fma 1 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-dqadd3146 fma 1 '00.0' 0 -> '0.0'
-dqadd3147 fma 1 '0.00' 0 -> '0.00'
-dqadd3148 fma 1 0 '0.00' -> '0.00'
-dqadd3149 fma 1 0 '00.0' -> '0.0'
-dqadd3150 fma 1 '00.0' '0.00' -> '0.00'
-dqadd3151 fma 1 '0.00' '00.0' -> '0.00'
-dqadd3152 fma 1 '3' '.3' -> '3.3'
-dqadd3153 fma 1 '3.' '.3' -> '3.3'
-dqadd3154 fma 1 '3.0' '.3' -> '3.3'
-dqadd3155 fma 1 '3.00' '.3' -> '3.30'
-dqadd3156 fma 1 '3' '3' -> '6'
-dqadd3157 fma 1 '3' '+3' -> '6'
-dqadd3158 fma 1 '3' '-3' -> '0'
-dqadd3159 fma 1 '0.3' '-0.3' -> '0.0'
-dqadd3160 fma 1 '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-dqadd3161 fma 1 '1E+12' '-1' -> '999999999999'
-dqadd3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
-dqadd3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
-dqadd3164 fma 1 '-1' '1E+12' -> '999999999999'
-dqadd3165 fma 1 '7E+12' '-1' -> '6999999999999'
-dqadd3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
-dqadd3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
-dqadd3168 fma 1 '-1' '7E+12' -> '6999999999999'
-
-rounding: half_up
-dqadd3170 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd3171 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd3172 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd3173 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded
-dqadd3174 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd3175 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd3176 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd3177 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded
-dqadd3178 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd3179 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd3180 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd3181 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd3182 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd3183 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-dqadd3200 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd3201 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3202 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3203 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3204 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3205 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3206 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3207 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3208 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3209 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3210 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3211 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3212 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3213 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3214 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3215 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3216 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd3217 fma 1 '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3218 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3219 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
-
-rounding: half_even
-dqadd3220 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd3221 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3222 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3223 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3224 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3225 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3226 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3227 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3228 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3229 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3230 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3231 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3232 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3233 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3234 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3235 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3236 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd3237 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3238 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3239 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
--- critical few with even bottom digit...
-dqadd3240 fma 1 '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded
-dqadd3241 fma 1 '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded
-dqadd3242 fma 1 '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
-
-rounding: down
-dqadd3250 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd3251 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3252 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3253 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3254 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3255 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3256 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3257 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3258 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3259 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3260 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3261 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3262 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3263 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3264 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3265 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3266 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd3267 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3268 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3269 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-dqadd3301 fma 1 -1 1 -> 0
-dqadd3302 fma 1 0 1 -> 1
-dqadd3303 fma 1 1 1 -> 2
-dqadd3304 fma 1 12 1 -> 13
-dqadd3305 fma 1 98 1 -> 99
-dqadd3306 fma 1 99 1 -> 100
-dqadd3307 fma 1 100 1 -> 101
-dqadd3308 fma 1 101 1 -> 102
-dqadd3309 fma 1 -1 -1 -> -2
-dqadd3310 fma 1 0 -1 -> -1
-dqadd3311 fma 1 1 -1 -> 0
-dqadd3312 fma 1 12 -1 -> 11
-dqadd3313 fma 1 98 -1 -> 97
-dqadd3314 fma 1 99 -1 -> 98
-dqadd3315 fma 1 100 -1 -> 99
-dqadd3316 fma 1 101 -1 -> 100
-
-dqadd3321 fma 1 -0.01 0.01 -> 0.00
-dqadd3322 fma 1 0.00 0.01 -> 0.01
-dqadd3323 fma 1 0.01 0.01 -> 0.02
-dqadd3324 fma 1 0.12 0.01 -> 0.13
-dqadd3325 fma 1 0.98 0.01 -> 0.99
-dqadd3326 fma 1 0.99 0.01 -> 1.00
-dqadd3327 fma 1 1.00 0.01 -> 1.01
-dqadd3328 fma 1 1.01 0.01 -> 1.02
-dqadd3329 fma 1 -0.01 -0.01 -> -0.02
-dqadd3330 fma 1 0.00 -0.01 -> -0.01
-dqadd3331 fma 1 0.01 -0.01 -> 0.00
-dqadd3332 fma 1 0.12 -0.01 -> 0.11
-dqadd3333 fma 1 0.98 -0.01 -> 0.97
-dqadd3334 fma 1 0.99 -0.01 -> 0.98
-dqadd3335 fma 1 1.00 -0.01 -> 0.99
-dqadd3336 fma 1 1.01 -0.01 -> 1.00
-
--- some more cases where adding 0 affects the coefficient
-dqadd3340 fma 1 1E+3 0 -> 1000
-dqadd3341 fma 1 1E+33 0 -> 1000000000000000000000000000000000
-dqadd3342 fma 1 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded
-dqadd3343 fma 1 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded
--- which simply follow from these cases ...
-dqadd3344 fma 1 1E+3 1 -> 1001
-dqadd3345 fma 1 1E+33 1 -> 1000000000000000000000000000000001
-dqadd3346 fma 1 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd3347 fma 1 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
-dqadd3348 fma 1 1E+3 7 -> 1007
-dqadd3349 fma 1 1E+33 7 -> 1000000000000000000000000000000007
-dqadd3350 fma 1 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded
-dqadd3351 fma 1 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
-
--- tryzeros cases
-rounding: half_up
-dqadd3360 fma 1 0E+50 10000E+1 -> 1.0000E+5
-dqadd3361 fma 1 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded
-dqadd3362 fma 1 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded
-dqadd3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact
-dqadd3364 fma 1 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111
--- 1 234567890123456789012345678901234
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-dqadd3370 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd3371 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-rounding: half_up
-dqadd3372 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd3373 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-rounding: half_even
-dqadd3374 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd3375 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-
--- ulp replacement tests
-dqadd3400 fma 1 1 77e-32 -> 1.00000000000000000000000000000077
-dqadd3401 fma 1 1 77e-33 -> 1.000000000000000000000000000000077
-dqadd3402 fma 1 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded
-dqadd3403 fma 1 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded
-dqadd3404 fma 1 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd3405 fma 1 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd3406 fma 1 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd3410 fma 1 10 77e-32 -> 10.00000000000000000000000000000077
-dqadd3411 fma 1 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded
-dqadd3412 fma 1 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded
-dqadd3413 fma 1 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3414 fma 1 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3415 fma 1 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3416 fma 1 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd3420 fma 1 77e-32 1 -> 1.00000000000000000000000000000077
-dqadd3421 fma 1 77e-33 1 -> 1.000000000000000000000000000000077
-dqadd3422 fma 1 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded
-dqadd3423 fma 1 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded
-dqadd3424 fma 1 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd3425 fma 1 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd3426 fma 1 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd3430 fma 1 77e-32 10 -> 10.00000000000000000000000000000077
-dqadd3431 fma 1 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded
-dqadd3432 fma 1 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded
-dqadd3433 fma 1 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3434 fma 1 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3435 fma 1 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3436 fma 1 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-
--- negative ulps
-dqadd36440 fma 1 1 -77e-32 -> 0.99999999999999999999999999999923
-dqadd36441 fma 1 1 -77e-33 -> 0.999999999999999999999999999999923
-dqadd36442 fma 1 1 -77e-34 -> 0.9999999999999999999999999999999923
-dqadd36443 fma 1 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded
-dqadd36444 fma 1 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded
-dqadd36445 fma 1 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd36446 fma 1 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd36450 fma 1 10 -77e-32 -> 9.99999999999999999999999999999923
-dqadd36451 fma 1 10 -77e-33 -> 9.999999999999999999999999999999923
-dqadd36452 fma 1 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded
-dqadd36453 fma 1 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded
-dqadd36454 fma 1 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd36455 fma 1 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd36456 fma 1 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd36460 fma 1 -77e-32 1 -> 0.99999999999999999999999999999923
-dqadd36461 fma 1 -77e-33 1 -> 0.999999999999999999999999999999923
-dqadd36462 fma 1 -77e-34 1 -> 0.9999999999999999999999999999999923
-dqadd36463 fma 1 -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded
-dqadd36464 fma 1 -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded
-dqadd36465 fma 1 -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd36466 fma 1 -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd36470 fma 1 -77e-32 10 -> 9.99999999999999999999999999999923
-dqadd36471 fma 1 -77e-33 10 -> 9.999999999999999999999999999999923
-dqadd36472 fma 1 -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded
-dqadd36473 fma 1 -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded
-dqadd36474 fma 1 -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd36475 fma 1 -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd36476 fma 1 -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-
--- negative ulps
-dqadd36480 fma 1 -1 77e-32 -> -0.99999999999999999999999999999923
-dqadd36481 fma 1 -1 77e-33 -> -0.999999999999999999999999999999923
-dqadd36482 fma 1 -1 77e-34 -> -0.9999999999999999999999999999999923
-dqadd36483 fma 1 -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded
-dqadd36484 fma 1 -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded
-dqadd36485 fma 1 -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded
-dqadd36486 fma 1 -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd36490 fma 1 -10 77e-32 -> -9.99999999999999999999999999999923
-dqadd36491 fma 1 -10 77e-33 -> -9.999999999999999999999999999999923
-dqadd36492 fma 1 -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded
-dqadd36493 fma 1 -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded
-dqadd36494 fma 1 -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd36495 fma 1 -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd36496 fma 1 -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd36500 fma 1 77e-32 -1 -> -0.99999999999999999999999999999923
-dqadd36501 fma 1 77e-33 -1 -> -0.999999999999999999999999999999923
-dqadd36502 fma 1 77e-34 -1 -> -0.9999999999999999999999999999999923
-dqadd36503 fma 1 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded
-dqadd36504 fma 1 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded
-dqadd36505 fma 1 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
-dqadd36506 fma 1 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd36510 fma 1 77e-32 -10 -> -9.99999999999999999999999999999923
-dqadd36511 fma 1 77e-33 -10 -> -9.999999999999999999999999999999923
-dqadd36512 fma 1 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded
-dqadd36513 fma 1 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded
-dqadd36514 fma 1 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd36515 fma 1 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd36516 fma 1 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-
--- and some more residue effects and different roundings
-rounding: half_up
-dqadd36540 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd36541 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36542 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36543 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36544 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36545 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36546 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36547 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36548 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36549 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36550 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36551 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36552 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36553 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36554 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36555 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36556 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd36557 fma 1 '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36558 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36559 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
-rounding: half_even
-dqadd36560 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd36561 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36562 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36563 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36564 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36565 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36566 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36567 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36568 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36569 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36570 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36571 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36572 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36573 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36574 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36575 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36576 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd36577 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36578 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36579 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
--- critical few with even bottom digit...
-dqadd37540 fma 1 '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded
-dqadd37541 fma 1 '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded
-dqadd37542 fma 1 '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
-
-rounding: down
-dqadd37550 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd37551 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37552 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37553 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37554 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37555 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37556 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37557 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37558 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37559 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37560 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37561 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37562 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37563 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37564 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37565 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37566 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd37567 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd37568 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd37569 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-dqadd37701 fma 1 5.00 1.00E-3 -> 5.00100
-dqadd37702 fma 1 00.00 0.000 -> 0.000
-dqadd37703 fma 1 00.00 0E-3 -> 0.000
-dqadd37704 fma 1 0E-3 00.00 -> 0.000
-
-dqadd37710 fma 1 0E+3 00.00 -> 0.00
-dqadd37711 fma 1 0E+3 00.0 -> 0.0
-dqadd37712 fma 1 0E+3 00. -> 0
-dqadd37713 fma 1 0E+3 00.E+1 -> 0E+1
-dqadd37714 fma 1 0E+3 00.E+2 -> 0E+2
-dqadd37715 fma 1 0E+3 00.E+3 -> 0E+3
-dqadd37716 fma 1 0E+3 00.E+4 -> 0E+3
-dqadd37717 fma 1 0E+3 00.E+5 -> 0E+3
-dqadd37718 fma 1 0E+3 -00.0 -> 0.0
-dqadd37719 fma 1 0E+3 -00. -> 0
-dqadd37731 fma 1 0E+3 -00.E+1 -> 0E+1
-
-dqadd37720 fma 1 00.00 0E+3 -> 0.00
-dqadd37721 fma 1 00.0 0E+3 -> 0.0
-dqadd37722 fma 1 00. 0E+3 -> 0
-dqadd37723 fma 1 00.E+1 0E+3 -> 0E+1
-dqadd37724 fma 1 00.E+2 0E+3 -> 0E+2
-dqadd37725 fma 1 00.E+3 0E+3 -> 0E+3
-dqadd37726 fma 1 00.E+4 0E+3 -> 0E+3
-dqadd37727 fma 1 00.E+5 0E+3 -> 0E+3
-dqadd37728 fma 1 -00.00 0E+3 -> 0.00
-dqadd37729 fma 1 -00.0 0E+3 -> 0.0
-dqadd37730 fma 1 -00. 0E+3 -> 0
-
-dqadd37732 fma 1 0 0 -> 0
-dqadd37733 fma 1 0 -0 -> 0
-dqadd37734 fma 1 -0 0 -> 0
-dqadd37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
-
-dqadd37736 fma 1 1 -1 -> 0
-dqadd37737 fma 1 -1 -1 -> -2
-dqadd37738 fma 1 1 1 -> 2
-dqadd37739 fma 1 -1 1 -> 0
-
-dqadd37741 fma 1 0 -1 -> -1
-dqadd37742 fma 1 -0 -1 -> -1
-dqadd37743 fma 1 0 1 -> 1
-dqadd37744 fma 1 -0 1 -> 1
-dqadd37745 fma 1 -1 0 -> -1
-dqadd37746 fma 1 -1 -0 -> -1
-dqadd37747 fma 1 1 0 -> 1
-dqadd37748 fma 1 1 -0 -> 1
-
-dqadd37751 fma 1 0.0 -1 -> -1.0
-dqadd37752 fma 1 -0.0 -1 -> -1.0
-dqadd37753 fma 1 0.0 1 -> 1.0
-dqadd37754 fma 1 -0.0 1 -> 1.0
-dqadd37755 fma 1 -1.0 0 -> -1.0
-dqadd37756 fma 1 -1.0 -0 -> -1.0
-dqadd37757 fma 1 1.0 0 -> 1.0
-dqadd37758 fma 1 1.0 -0 -> 1.0
-
-dqadd37761 fma 1 0 -1.0 -> -1.0
-dqadd37762 fma 1 -0 -1.0 -> -1.0
-dqadd37763 fma 1 0 1.0 -> 1.0
-dqadd37764 fma 1 -0 1.0 -> 1.0
-dqadd37765 fma 1 -1 0.0 -> -1.0
-dqadd37766 fma 1 -1 -0.0 -> -1.0
-dqadd37767 fma 1 1 0.0 -> 1.0
-dqadd37768 fma 1 1 -0.0 -> 1.0
-
-dqadd37771 fma 1 0.0 -1.0 -> -1.0
-dqadd37772 fma 1 -0.0 -1.0 -> -1.0
-dqadd37773 fma 1 0.0 1.0 -> 1.0
-dqadd37774 fma 1 -0.0 1.0 -> 1.0
-dqadd37775 fma 1 -1.0 0.0 -> -1.0
-dqadd37776 fma 1 -1.0 -0.0 -> -1.0
-dqadd37777 fma 1 1.0 0.0 -> 1.0
-dqadd37778 fma 1 1.0 -0.0 -> 1.0
-
--- Specials
-dqadd37780 fma 1 -Inf -Inf -> -Infinity
-dqadd37781 fma 1 -Inf -1000 -> -Infinity
-dqadd37782 fma 1 -Inf -1 -> -Infinity
-dqadd37783 fma 1 -Inf -0 -> -Infinity
-dqadd37784 fma 1 -Inf 0 -> -Infinity
-dqadd37785 fma 1 -Inf 1 -> -Infinity
-dqadd37786 fma 1 -Inf 1000 -> -Infinity
-dqadd37787 fma 1 -1000 -Inf -> -Infinity
-dqadd37788 fma 1 -Inf -Inf -> -Infinity
-dqadd37789 fma 1 -1 -Inf -> -Infinity
-dqadd37790 fma 1 -0 -Inf -> -Infinity
-dqadd37791 fma 1 0 -Inf -> -Infinity
-dqadd37792 fma 1 1 -Inf -> -Infinity
-dqadd37793 fma 1 1000 -Inf -> -Infinity
-dqadd37794 fma 1 Inf -Inf -> NaN Invalid_operation
-
-dqadd37800 fma 1 Inf -Inf -> NaN Invalid_operation
-dqadd37801 fma 1 Inf -1000 -> Infinity
-dqadd37802 fma 1 Inf -1 -> Infinity
-dqadd37803 fma 1 Inf -0 -> Infinity
-dqadd37804 fma 1 Inf 0 -> Infinity
-dqadd37805 fma 1 Inf 1 -> Infinity
-dqadd37806 fma 1 Inf 1000 -> Infinity
-dqadd37807 fma 1 Inf Inf -> Infinity
-dqadd37808 fma 1 -1000 Inf -> Infinity
-dqadd37809 fma 1 -Inf Inf -> NaN Invalid_operation
-dqadd37810 fma 1 -1 Inf -> Infinity
-dqadd37811 fma 1 -0 Inf -> Infinity
-dqadd37812 fma 1 0 Inf -> Infinity
-dqadd37813 fma 1 1 Inf -> Infinity
-dqadd37814 fma 1 1000 Inf -> Infinity
-dqadd37815 fma 1 Inf Inf -> Infinity
-
-dqadd37821 fma 1 NaN -Inf -> NaN
-dqadd37822 fma 1 NaN -1000 -> NaN
-dqadd37823 fma 1 NaN -1 -> NaN
-dqadd37824 fma 1 NaN -0 -> NaN
-dqadd37825 fma 1 NaN 0 -> NaN
-dqadd37826 fma 1 NaN 1 -> NaN
-dqadd37827 fma 1 NaN 1000 -> NaN
-dqadd37828 fma 1 NaN Inf -> NaN
-dqadd37829 fma 1 NaN NaN -> NaN
-dqadd37830 fma 1 -Inf NaN -> NaN
-dqadd37831 fma 1 -1000 NaN -> NaN
-dqadd37832 fma 1 -1 NaN -> NaN
-dqadd37833 fma 1 -0 NaN -> NaN
-dqadd37834 fma 1 0 NaN -> NaN
-dqadd37835 fma 1 1 NaN -> NaN
-dqadd37836 fma 1 1000 NaN -> NaN
-dqadd37837 fma 1 Inf NaN -> NaN
-
-dqadd37841 fma 1 sNaN -Inf -> NaN Invalid_operation
-dqadd37842 fma 1 sNaN -1000 -> NaN Invalid_operation
-dqadd37843 fma 1 sNaN -1 -> NaN Invalid_operation
-dqadd37844 fma 1 sNaN -0 -> NaN Invalid_operation
-dqadd37845 fma 1 sNaN 0 -> NaN Invalid_operation
-dqadd37846 fma 1 sNaN 1 -> NaN Invalid_operation
-dqadd37847 fma 1 sNaN 1000 -> NaN Invalid_operation
-dqadd37848 fma 1 sNaN NaN -> NaN Invalid_operation
-dqadd37849 fma 1 sNaN sNaN -> NaN Invalid_operation
-dqadd37850 fma 1 NaN sNaN -> NaN Invalid_operation
-dqadd37851 fma 1 -Inf sNaN -> NaN Invalid_operation
-dqadd37852 fma 1 -1000 sNaN -> NaN Invalid_operation
-dqadd37853 fma 1 -1 sNaN -> NaN Invalid_operation
-dqadd37854 fma 1 -0 sNaN -> NaN Invalid_operation
-dqadd37855 fma 1 0 sNaN -> NaN Invalid_operation
-dqadd37856 fma 1 1 sNaN -> NaN Invalid_operation
-dqadd37857 fma 1 1000 sNaN -> NaN Invalid_operation
-dqadd37858 fma 1 Inf sNaN -> NaN Invalid_operation
-dqadd37859 fma 1 NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqadd37861 fma 1 NaN1 -Inf -> NaN1
-dqadd37862 fma 1 +NaN2 -1000 -> NaN2
-dqadd37863 fma 1 NaN3 1000 -> NaN3
-dqadd37864 fma 1 NaN4 Inf -> NaN4
-dqadd37865 fma 1 NaN5 +NaN6 -> NaN5
-dqadd37866 fma 1 -Inf NaN7 -> NaN7
-dqadd37867 fma 1 -1000 NaN8 -> NaN8
-dqadd37868 fma 1 1000 NaN9 -> NaN9
-dqadd37869 fma 1 Inf +NaN10 -> NaN10
-dqadd37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
-dqadd37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
-dqadd37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
-dqadd37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
-dqadd37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqadd37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
-dqadd37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
-dqadd37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
-dqadd37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
-dqadd37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
-dqadd37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqadd37882 fma 1 -NaN26 NaN28 -> -NaN26
-dqadd37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqadd37884 fma 1 1000 -NaN30 -> -NaN30
-dqadd37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Here we explore near the boundary of rounding a subnormal to Nmin
-dqadd37575 fma 1 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal
-dqadd37576 fma 1 -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal
-
--- check overflow edge case
--- 1234567890123456
-dqadd37972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqadd37973 fma 1 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37974 fma 1 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37975 fma 1 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded
-dqadd37976 fma 1 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37977 fma 1 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37978 fma 1 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37979 fma 1 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37980 fma 1 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37981 fma 1 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37982 fma 1 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37983 fma 1 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37984 fma 1 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-
-dqadd37985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqadd37986 fma 1 -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37987 fma 1 -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37988 fma 1 -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded
-dqadd37989 fma 1 -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37990 fma 1 -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37991 fma 1 -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37992 fma 1 -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37993 fma 1 -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37994 fma 1 -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37995 fma 1 -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37996 fma 1 -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37997 fma 1 -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-dqadd371100 fma 1 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact
-dqadd371101 fma 1 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact
-dqadd371103 fma 1 +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact
-dqadd371104 fma 1 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact
-dqadd371105 fma 1 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact
-dqadd371106 fma 1 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact
-dqadd371107 fma 1 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact
-dqadd371108 fma 1 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact
-dqadd371109 fma 1 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-dqadd371110 fma 1 -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact
-dqadd371111 fma 1 -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact
-dqadd371113 fma 1 -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact
-dqadd371114 fma 1 -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact
-dqadd371115 fma 1 -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact
-dqadd371116 fma 1 -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact
-dqadd371117 fma 1 -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact
-dqadd371118 fma 1 -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact
-dqadd371119 fma 1 -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-dqadd371300 fma 1 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371310 fma 1 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371311 fma 1 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371312 fma 1 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371313 fma 1 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371314 fma 1 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371315 fma 1 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371316 fma 1 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371317 fma 1 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371318 fma 1 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371319 fma 1 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371320 fma 1 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371321 fma 1 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371322 fma 1 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371323 fma 1 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371324 fma 1 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371325 fma 1 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371326 fma 1 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371327 fma 1 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371328 fma 1 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371329 fma 1 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371330 fma 1 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371331 fma 1 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371332 fma 1 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371333 fma 1 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371334 fma 1 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371335 fma 1 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371336 fma 1 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371337 fma 1 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371338 fma 1 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371339 fma 1 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-
-dqadd371340 fma 1 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded
-dqadd371341 fma 1 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded
-
-dqadd371349 fma 1 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371350 fma 1 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371351 fma 1 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371352 fma 1 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371353 fma 1 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371354 fma 1 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371355 fma 1 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371356 fma 1 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371357 fma 1 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371358 fma 1 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371359 fma 1 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371360 fma 1 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371361 fma 1 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371362 fma 1 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371363 fma 1 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371364 fma 1 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371365 fma 1 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371367 fma 1 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371368 fma 1 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371369 fma 1 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371370 fma 1 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371371 fma 1 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371372 fma 1 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371373 fma 1 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371374 fma 1 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371375 fma 1 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371376 fma 1 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371377 fma 1 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371378 fma 1 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371379 fma 1 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371380 fma 1 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371381 fma 1 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371382 fma 1 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371383 fma 1 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371384 fma 1 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371385 fma 1 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371386 fma 1 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371387 fma 1 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371388 fma 1 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371389 fma 1 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371390 fma 1 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371391 fma 1 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371392 fma 1 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371393 fma 1 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371394 fma 1 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371395 fma 1 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371396 fma 1 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-dqadd371420 fma 1 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345
-dqadd371421 fma 1 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345
-dqadd371422 fma 1 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345
-dqadd371423 fma 1 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345
-dqadd371424 fma 1 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345
-dqadd371425 fma 1 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345
-dqadd371426 fma 1 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345
-dqadd371427 fma 1 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7
-dqadd371428 fma 1 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8
-dqadd371429 fma 1 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9
-dqadd371430 fma 1 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10
-dqadd371431 fma 1 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11
-dqadd371432 fma 1 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12
-dqadd371433 fma 1 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13
-dqadd371434 fma 1 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14
-dqadd371435 fma 1 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15
-dqadd371436 fma 1 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16
-dqadd371437 fma 1 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17
-dqadd371438 fma 1 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18
-dqadd371439 fma 1 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19
-dqadd371440 fma 1 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20
-dqadd371441 fma 1 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21
-dqadd371442 fma 1 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22
-dqadd371443 fma 1 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23
-dqadd371444 fma 1 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24
-dqadd371445 fma 1 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25
-dqadd371446 fma 1 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26
-dqadd371447 fma 1 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27
-dqadd371448 fma 1 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28
-dqadd371449 fma 1 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29
-dqadd371450 fma 1 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30
-dqadd371451 fma 1 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31
-dqadd371452 fma 1 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32
-dqadd371453 fma 1 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33
-dqadd371454 fma 1 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34
-dqadd371455 fma 1 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35
-dqadd371456 fma 1 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36
-
--- same, reversed 0
-dqadd371460 fma 1 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345
-dqadd371461 fma 1 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345
-dqadd371462 fma 1 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345
-dqadd371463 fma 1 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345
-dqadd371464 fma 1 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345
-dqadd371465 fma 1 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345
-dqadd371466 fma 1 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345
-dqadd371467 fma 1 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7
-dqadd371468 fma 1 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8
-dqadd371469 fma 1 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9
-dqadd371470 fma 1 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10
-dqadd371471 fma 1 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11
-dqadd371472 fma 1 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12
-dqadd371473 fma 1 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13
-dqadd371474 fma 1 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14
-dqadd371475 fma 1 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15
-dqadd371476 fma 1 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16
-dqadd371477 fma 1 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17
-dqadd371478 fma 1 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18
-dqadd371479 fma 1 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19
-dqadd371480 fma 1 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20
-dqadd371481 fma 1 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21
-dqadd371482 fma 1 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22
-dqadd371483 fma 1 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23
-dqadd371484 fma 1 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24
-dqadd371485 fma 1 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25
-dqadd371486 fma 1 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26
-dqadd371487 fma 1 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27
-dqadd371488 fma 1 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28
-dqadd371489 fma 1 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29
-dqadd371490 fma 1 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30
-dqadd371491 fma 1 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31
-dqadd371492 fma 1 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32
-dqadd371493 fma 1 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33
-dqadd371494 fma 1 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34
-dqadd371495 fma 1 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35
-dqadd371496 fma 1 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36
-
--- same, Es on the 0
-dqadd371500 fma 1 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345
-dqadd371501 fma 1 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345
-dqadd371502 fma 1 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345
-dqadd371503 fma 1 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345
-dqadd371504 fma 1 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345
-dqadd371505 fma 1 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345
-dqadd371506 fma 1 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345
-dqadd371507 fma 1 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345
-dqadd371508 fma 1 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345
-dqadd371509 fma 1 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345
-dqadd371510 fma 1 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345
-dqadd371511 fma 1 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345
-dqadd371512 fma 1 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345
-dqadd371513 fma 1 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345
-dqadd371514 fma 1 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345
-dqadd371515 fma 1 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345
-dqadd371516 fma 1 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345
-dqadd371517 fma 1 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345
-dqadd371518 fma 1 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345
-dqadd371519 fma 1 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345
-dqadd371520 fma 1 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345
-dqadd371521 fma 1 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345
-dqadd371522 fma 1 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345
-dqadd371523 fma 1 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345
-dqadd371524 fma 1 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345
-dqadd371525 fma 1 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345
-dqadd371526 fma 1 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345
-dqadd371527 fma 1 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345
-dqadd371528 fma 1 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345
-dqadd371529 fma 1 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345
-dqadd371530 fma 1 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345
-dqadd371531 fma 1 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345
-dqadd371532 fma 1 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345
-dqadd371533 fma 1 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345
--- next four flag Rounded because the 0 extends the result
-dqadd371534 fma 1 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded
-dqadd371535 fma 1 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded
-dqadd371536 fma 1 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded
-dqadd371537 fma 1 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-dqadd371600 fma 1 0 0E-19 -> 0E-19
-dqadd371601 fma 1 -0 0E-19 -> 0E-19
-dqadd371602 fma 1 0 -0E-19 -> 0E-19
-dqadd371603 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371611 fma 1 -11 11 -> 0
-dqadd371612 fma 1 11 -11 -> 0
--- overflow
-dqadd371613 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371614 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: half_down
--- exact zeros from zeros
-dqadd371620 fma 1 0 0E-19 -> 0E-19
-dqadd371621 fma 1 -0 0E-19 -> 0E-19
-dqadd371622 fma 1 0 -0E-19 -> 0E-19
-dqadd371623 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371631 fma 1 -11 11 -> 0
-dqadd371632 fma 1 11 -11 -> 0
--- overflow
-dqadd371633 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371634 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: half_even
--- exact zeros from zeros
-dqadd371640 fma 1 0 0E-19 -> 0E-19
-dqadd371641 fma 1 -0 0E-19 -> 0E-19
-dqadd371642 fma 1 0 -0E-19 -> 0E-19
-dqadd371643 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371651 fma 1 -11 11 -> 0
-dqadd371652 fma 1 11 -11 -> 0
--- overflow
-dqadd371653 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371654 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: up
--- exact zeros from zeros
-dqadd371660 fma 1 0 0E-19 -> 0E-19
-dqadd371661 fma 1 -0 0E-19 -> 0E-19
-dqadd371662 fma 1 0 -0E-19 -> 0E-19
-dqadd371663 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371671 fma 1 -11 11 -> 0
-dqadd371672 fma 1 11 -11 -> 0
--- overflow
-dqadd371673 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371674 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: down
--- exact zeros from zeros
-dqadd371680 fma 1 0 0E-19 -> 0E-19
-dqadd371681 fma 1 -0 0E-19 -> 0E-19
-dqadd371682 fma 1 0 -0E-19 -> 0E-19
-dqadd371683 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371691 fma 1 -11 11 -> 0
-dqadd371692 fma 1 11 -11 -> 0
--- overflow
-dqadd371693 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqadd371694 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-
-rounding: ceiling
--- exact zeros from zeros
-dqadd371700 fma 1 0 0E-19 -> 0E-19
-dqadd371701 fma 1 -0 0E-19 -> 0E-19
-dqadd371702 fma 1 0 -0E-19 -> 0E-19
-dqadd371703 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371711 fma 1 -11 11 -> 0
-dqadd371712 fma 1 11 -11 -> 0
--- overflow
-dqadd371713 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371714 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-dqadd371720 fma 1 0 0E-19 -> 0E-19
-dqadd371721 fma 1 -0 0E-19 -> -0E-19 -- *
-dqadd371722 fma 1 0 -0E-19 -> -0E-19 -- *
-dqadd371723 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371731 fma 1 -11 11 -> -0 -- *
-dqadd371732 fma 1 11 -11 -> -0 -- *
--- overflow
-dqadd371733 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqadd371734 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: 05up
--- exact zeros from zeros
-dqadd371740 fma 1 0 0E-19 -> 0E-19
-dqadd371741 fma 1 -0 0E-19 -> 0E-19
-dqadd371742 fma 1 0 -0E-19 -> 0E-19
-dqadd371743 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371751 fma 1 -11 11 -> 0
-dqadd371752 fma 1 11 -11 -> 0
--- overflow
-dqadd371753 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqadd371754 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dqadd371761 fma 1 130E-2 120E-2 -> 2.50
-dqadd371762 fma 1 130E-2 12E-1 -> 2.50
-dqadd371763 fma 1 130E-2 1E0 -> 2.30
-dqadd371764 fma 1 1E2 1E4 -> 1.01E+4
-dqadd371765 fma 1 130E-2 -120E-2 -> 0.10
-dqadd371766 fma 1 130E-2 -12E-1 -> 0.10
-dqadd371767 fma 1 130E-2 -1E0 -> 0.30
-dqadd371768 fma 1 1E2 -1E4 -> -9.9E+3
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-dqadd375001 fma 1 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457
-dqadd375002 fma 1 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded
-dqadd375003 fma 1 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375004 fma 1 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375005 fma 1 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375006 fma 1 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375007 fma 1 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375008 fma 1 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375009 fma 1 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375010 fma 1 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375011 fma 1 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375012 fma 1 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375013 fma 1 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375014 fma 1 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375015 fma 1 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375016 fma 1 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375017 fma 1 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375018 fma 1 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375019 fma 1 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375020 fma 1 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375021 fma 1 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded
-
--- widening second argument at gap
-dqadd375030 fma 1 12398765432112345678945678 1 -> 12398765432112345678945679
-dqadd375031 fma 1 12398765432112345678945678 0.1 -> 12398765432112345678945678.1
-dqadd375032 fma 1 12398765432112345678945678 0.12 -> 12398765432112345678945678.12
-dqadd375033 fma 1 12398765432112345678945678 0.123 -> 12398765432112345678945678.123
-dqadd375034 fma 1 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234
-dqadd375035 fma 1 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345
-dqadd375036 fma 1 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456
-dqadd375037 fma 1 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567
-dqadd375038 fma 1 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678
-dqadd375039 fma 1 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375040 fma 1 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded
-dqadd375041 fma 1 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded
-dqadd375042 fma 1 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375043 fma 1 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375044 fma 1 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375045 fma 1 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375046 fma 1 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375047 fma 1 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375048 fma 1 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375049 fma 1 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-dqadd375050 fma 1 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded
-dqadd375051 fma 1 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded
-dqadd375052 fma 1 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded
-dqadd375053 fma 1 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded
-dqadd375054 fma 1 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded
-dqadd375055 fma 1 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded
-dqadd375056 fma 1 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded
-dqadd375057 fma 1 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded
-dqadd375060 fma 1 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded
-dqadd375061 fma 1 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded
-dqadd375062 fma 1 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded
-dqadd375063 fma 1 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded
-dqadd375064 fma 1 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded
-dqadd375065 fma 1 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded
-dqadd375066 fma 1 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded
-dqadd375067 fma 1 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-dqadd375070 fma 1 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001
-dqadd375071 fma 1 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375072 fma 1 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375073 fma 1 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375074 fma 1 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375075 fma 1 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375076 fma 1 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375077 fma 1 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375078 fma 1 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375079 fma 1 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375080 fma 1 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375081 fma 1 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375082 fma 1 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375083 fma 1 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375084 fma 1 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375085 fma 1 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375086 fma 1 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375087 fma 1 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375088 fma 1 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375089 fma 1 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded
-
--- Destructive subtract (from remainder tests)
-
--- +++ some of these will be off-by-one remainder vs remainderNear
-
-dqfma4000 fma -1234567890123456789012345678901233 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> -0.234567890123456789012345678901233
-dqfma4001 fma -1234567890123456789012345678901222 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> -0.34567890123456789012345678901222
-dqfma4002 fma -1234567890123456789012345678901111 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.4567890123456789012345678901111
-dqfma4003 fma -308641972530864197253086419725314 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> -1.308641972530864197253086419725314
-dqfma4004 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692
-dqfma4005 fma -246913578024691357802469135780252 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> -1.3086421975308642197530864219748
-dqfma4006 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247
-dqfma4007 fma -246913578024691357802469135780247 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> -0.753086421975308642197530864219753
-dqfma4008 fma -246913578024691357802469135780247 5.000000000000000000000000000000001 1234567890123456789012345678901234 -> -1.246913578024691357802469135780247
-dqfma4009 fma -246913578024691357802469135780246 5.00000000000000000000000000000001 1234567890123456789012345678901234 -> 1.53086421975308642197530864219754
-dqfma4010 fma -246913578024691357802469135780242 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.6913578024691357802469135780242
-dqfma4011 fma -1234567890123456789012345678901232 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> 0.765432109876543210987654321098768
-dqfma4012 fma -1234567890123456789012345678901221 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> 0.65432109876543210987654321098779
-dqfma4013 fma -1234567890123456789012345678901110 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> 0.5432109876543210987654321098890
-dqfma4014 fma -308641972530864197253086419725313 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> 2.691358027469135802746913580274687
-dqfma4015 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692
-dqfma4016 fma -246913578024691357802469135780251 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> 3.6913578024691357802469135780251
-dqfma4017 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247
-dqfma4018 fma -246913578024691357802469135780246 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> 4.246913578024691357802469135780246
-dqfma4019 fma -246913578024691357802469135780241 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> 4.3086421975308642197530864219759
-
--- Null tests
-dqadd39990 fma 1 10 # -> NaN Invalid_operation
-dqadd39991 fma 1 # 10 -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- dqFMA.decTest -- decQuad Fused Multiply Add --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- These tests comprese three parts:
+-- 1. Sanity checks and other three-operand tests (especially those
+-- where the fused operation makes a difference)
+-- 2. Multiply tests (third operand is neutral zero [0E+emax])
+-- 3. Addition tests (first operand is 1)
+-- The multiply and addition tests are extensive because FMA may have
+-- its own dedicated multiplication or addition routine(s), and they
+-- also inherently check the left-to-right properties.
+
+-- Sanity checks
+dqfma0001 fma 1 1 1 -> 2
+dqfma0002 fma 1 1 2 -> 3
+dqfma0003 fma 2 2 3 -> 7
+dqfma0004 fma 9 9 9 -> 90
+dqfma0005 fma -1 1 1 -> 0
+dqfma0006 fma -1 1 2 -> 1
+dqfma0007 fma -2 2 3 -> -1
+dqfma0008 fma -9 9 9 -> -72
+dqfma0011 fma 1 -1 1 -> 0
+dqfma0012 fma 1 -1 2 -> 1
+dqfma0013 fma 2 -2 3 -> -1
+dqfma0014 fma 9 -9 9 -> -72
+dqfma0015 fma 1 1 -1 -> 0
+dqfma0016 fma 1 1 -2 -> -1
+dqfma0017 fma 2 2 -3 -> 1
+dqfma0018 fma 9 9 -9 -> 72
+
+-- non-integer exacts
+dqfma0100 fma 25.2 63.6 -438 -> 1164.72
+dqfma0101 fma 0.301 0.380 334 -> 334.114380
+dqfma0102 fma 49.2 -4.8 23.3 -> -212.86
+dqfma0103 fma 4.22 0.079 -94.6 -> -94.26662
+dqfma0104 fma 903 0.797 0.887 -> 720.578
+dqfma0105 fma 6.13 -161 65.9 -> -921.03
+dqfma0106 fma 28.2 727 5.45 -> 20506.85
+dqfma0107 fma 4 605 688 -> 3108
+dqfma0108 fma 93.3 0.19 0.226 -> 17.953
+dqfma0109 fma 0.169 -341 5.61 -> -52.019
+dqfma0110 fma -72.2 30 -51.2 -> -2217.2
+dqfma0111 fma -0.409 13 20.4 -> 15.083
+dqfma0112 fma 317 77.0 19.0 -> 24428.0
+dqfma0113 fma 47 6.58 1.62 -> 310.88
+dqfma0114 fma 1.36 0.984 0.493 -> 1.83124
+dqfma0115 fma 72.7 274 1.56 -> 19921.36
+dqfma0116 fma 335 847 83 -> 283828
+dqfma0117 fma 666 0.247 25.4 -> 189.902
+dqfma0118 fma -3.87 3.06 78.0 -> 66.1578
+dqfma0119 fma 0.742 192 35.6 -> 178.064
+dqfma0120 fma -91.6 5.29 0.153 -> -484.411
+
+-- cases where result is different from separate multiply + add; each
+-- is preceded by the result of unfused multiply and add
+-- [this is about 20% of all similar cases in general]
+-- -> 4.500119002100000209469729375698778E+38
+dqfma0202 fma 68537985861355864457.5694 6565875762972086605.85969 35892634447236753.172812 -> 4.500119002100000209469729375698779E+38 Inexact Rounded
+-- -> 5.996248469584594346858881620185514E+41
+dqfma0208 fma 89261822344727628571.9 6717595845654131383336.89 5061036497288796076266.11 -> 5.996248469584594346858881620185513E+41 Inexact Rounded
+-- -> 1.899242968678256924021594770874070E+34
+dqfma0210 fma 320506237232448685.495971 59257597764017967.984448 3205615239077711589912.85 -> 1.899242968678256924021594770874071E+34 Inexact Rounded
+-- -> 7.078596978842809537929699954860309E+37
+dqfma0215 fma 220247843259112263.17995 321392340287987979002.80 47533279819997167655440 -> 7.078596978842809537929699954860308E+37 Inexact Rounded
+-- -> 1.224955667581427559754106862350743E+37
+dqfma0226 fma 23880729790368880412.1449 512947333827064719.55407 217117438419590824502.963 -> 1.224955667581427559754106862350744E+37 Inexact Rounded
+-- -> -2.530094043253148806272276368579144E+42
+dqfma0229 fma 2539892357016099706.4126 -996142232667504817717435 53682082598315949425.937 -> -2.530094043253148806272276368579143E+42 Inexact Rounded
+-- -> 1.713387085759711954319391412788454E+37
+dqfma0233 fma 4546339491341624464.0804 3768717864169205581 83578980278690395184.620 -> 1.713387085759711954319391412788453E+37 Inexact Rounded
+-- -> 4.062275663405823716411579117771547E+35
+dqfma0235 fma 409242119433816131.42253 992633815166741501.477249 70179636544416756129546 -> 4.062275663405823716411579117771548E+35 Inexact Rounded
+-- -> 6.002604327732568490562249875306823E+47
+dqfma0258 fma 817941336593541742159684 733867339769310729266598 78563844650942419311830.8 -> 6.002604327732568490562249875306822E+47 Inexact Rounded
+-- -> -2.027022514381452197510103395283874E+39
+dqfma0264 fma 387617310169161270.737532 -5229442703414956061216.62 57665666816652967150473.5 -> -2.027022514381452197510103395283873E+39 Inexact Rounded
+-- -> -7.856525039803554001144089842730361E+37
+dqfma0267 fma -847655845720565274701.210 92685316564117739.83984 22780950041376424429.5686 -> -7.856525039803554001144089842730360E+37 Inexact Rounded
+-- -> 1.695515562011520746125607502237559E+38
+dqfma0268 fma 21590290365127685.3675 7853139227576541379426.8 -3275859437236180.761544 -> 1.695515562011520746125607502237558E+38 Inexact Rounded
+-- -> -8.448422935783289219748115038014710E+38
+dqfma0269 fma -974320636272862697.971586 867109103641860247440.756 -9775170775902454762.98 -> -8.448422935783289219748115038014709E+38 Inexact Rounded
+
+-- Cases where multiply would overflow or underflow if separate
+dqfma0300 fma 9e+6144 10 0 -> Infinity Overflow Inexact Rounded
+dqfma0301 fma 1e+6144 10 0 -> Infinity Overflow Inexact Rounded
+dqfma0302 fma 1e+6144 10 -1e+6144 -> 9.000000000000000000000000000000000E+6144 Clamped
+dqfma0303 fma 1e+6144 10 -9e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped
+-- subnormal etc.
+dqfma0305 fma 1e-6176 0.1 0 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma0306 fma 1e-6176 0.1 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqfma0307 fma 1e-6176 0.1 1e-6176 -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+-- Infinite combinations
+dqfma0800 fma Inf Inf Inf -> Infinity
+dqfma0801 fma Inf Inf -Inf -> NaN Invalid_operation
+dqfma0802 fma Inf -Inf Inf -> NaN Invalid_operation
+dqfma0803 fma Inf -Inf -Inf -> -Infinity
+dqfma0804 fma -Inf Inf Inf -> NaN Invalid_operation
+dqfma0805 fma -Inf Inf -Inf -> -Infinity
+dqfma0806 fma -Inf -Inf Inf -> Infinity
+dqfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
+
+-- Triple NaN propagation
+dqfma0900 fma NaN2 NaN3 NaN5 -> NaN2
+dqfma0901 fma 0 NaN3 NaN5 -> NaN3
+dqfma0902 fma 0 0 NaN5 -> NaN5
+-- first sNaN wins (consider qNaN from earlier sNaN being
+-- overridden by an sNaN in third operand)
+dqfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+dqfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
+dqfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
+dqfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+dqfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
+dqfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
+
+-- MULTIPLICATION TESTS ------------------------------------------------
+rounding: half_even
+
+-- sanity checks
+dqfma2000 fma 2 2 0e+6144 -> 4
+dqfma2001 fma 2 3 0e+6144 -> 6
+dqfma2002 fma 5 1 0e+6144 -> 5
+dqfma2003 fma 5 2 0e+6144 -> 10
+dqfma2004 fma 1.20 2 0e+6144 -> 2.40
+dqfma2005 fma 1.20 0 0e+6144 -> 0.00
+dqfma2006 fma 1.20 -2 0e+6144 -> -2.40
+dqfma2007 fma -1.20 2 0e+6144 -> -2.40
+dqfma2008 fma -1.20 0 0e+6144 -> 0.00
+dqfma2009 fma -1.20 -2 0e+6144 -> 2.40
+dqfma2010 fma 5.09 7.1 0e+6144 -> 36.139
+dqfma2011 fma 2.5 4 0e+6144 -> 10.0
+dqfma2012 fma 2.50 4 0e+6144 -> 10.00
+dqfma2013 fma 1.23456789 1.0000000000000000000000000000 0e+6144 -> 1.234567890000000000000000000000000 Rounded
+dqfma2015 fma 2.50 4 0e+6144 -> 10.00
+dqfma2016 fma 9.99999999999999999 9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded
+dqfma2017 fma 9.99999999999999999 -9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded
+dqfma2018 fma -9.99999999999999999 9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded
+dqfma2019 fma -9.99999999999999999 -9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded
+
+-- zeros, etc.
+dqfma2021 fma 0 0 0e+6144 -> 0
+dqfma2022 fma 0 -0 0e+6144 -> 0
+dqfma2023 fma -0 0 0e+6144 -> 0
+dqfma2024 fma -0 -0 0e+6144 -> 0
+dqfma2025 fma -0.0 -0.0 0e+6144 -> 0.00
+dqfma2026 fma -0.0 -0.0 0e+6144 -> 0.00
+dqfma2027 fma -0.0 -0.0 0e+6144 -> 0.00
+dqfma2028 fma -0.0 -0.0 0e+6144 -> 0.00
+dqfma2030 fma 5.00 1E-3 0e+6144 -> 0.00500
+dqfma2031 fma 00.00 0.000 0e+6144 -> 0.00000
+dqfma2032 fma 00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0
+dqfma2033 fma 0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0
+dqfma2034 fma -5.00 1E-3 0e+6144 -> -0.00500
+dqfma2035 fma -00.00 0.000 0e+6144 -> 0.00000
+dqfma2036 fma -00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0
+dqfma2037 fma -0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0
+dqfma2038 fma 5.00 -1E-3 0e+6144 -> -0.00500
+dqfma2039 fma 00.00 -0.000 0e+6144 -> 0.00000
+dqfma2040 fma 00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0
+dqfma2041 fma 0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0
+dqfma2042 fma -5.00 -1E-3 0e+6144 -> 0.00500
+dqfma2043 fma -00.00 -0.000 0e+6144 -> 0.00000
+dqfma2044 fma -00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0
+dqfma2045 fma -0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0
+
+-- examples from decarith
+dqfma2050 fma 1.20 3 0e+6144 -> 3.60
+dqfma2051 fma 7 3 0e+6144 -> 21
+dqfma2052 fma 0.9 0.8 0e+6144 -> 0.72
+dqfma2053 fma 0.9 -0 0e+6144 -> 0.0
+dqfma2054 fma 654321 654321 0e+6144 -> 428135971041
+
+dqfma2060 fma 123.45 1e7 0e+6144 -> 1.2345E+9
+dqfma2061 fma 123.45 1e8 0e+6144 -> 1.2345E+10
+dqfma2062 fma 123.45 1e+9 0e+6144 -> 1.2345E+11
+dqfma2063 fma 123.45 1e10 0e+6144 -> 1.2345E+12
+dqfma2064 fma 123.45 1e11 0e+6144 -> 1.2345E+13
+dqfma2065 fma 123.45 1e12 0e+6144 -> 1.2345E+14
+dqfma2066 fma 123.45 1e13 0e+6144 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+-- 1234567890123456
+dqfma2080 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9
+dqfma2084 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9
+dqfma2090 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9
+dqfma2094 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9
+
+-- test some more edge cases and carries
+dqfma2101 fma 9 9 0e+6144 -> 81
+dqfma2102 fma 9 90 0e+6144 -> 810
+dqfma2103 fma 9 900 0e+6144 -> 8100
+dqfma2104 fma 9 9000 0e+6144 -> 81000
+dqfma2105 fma 9 90000 0e+6144 -> 810000
+dqfma2106 fma 9 900000 0e+6144 -> 8100000
+dqfma2107 fma 9 9000000 0e+6144 -> 81000000
+dqfma2108 fma 9 90000000 0e+6144 -> 810000000
+dqfma2109 fma 9 900000000 0e+6144 -> 8100000000
+dqfma2110 fma 9 9000000000 0e+6144 -> 81000000000
+dqfma2111 fma 9 90000000000 0e+6144 -> 810000000000
+dqfma2112 fma 9 900000000000 0e+6144 -> 8100000000000
+dqfma2113 fma 9 9000000000000 0e+6144 -> 81000000000000
+dqfma2114 fma 9 90000000000000 0e+6144 -> 810000000000000
+dqfma2115 fma 9 900000000000000 0e+6144 -> 8100000000000000
+--dqfma2116 fma 9 9000000000000000 0e+6144 -> 81000000000000000
+--dqfma2117 fma 9 90000000000000000 0e+6144 -> 810000000000000000
+--dqfma2118 fma 9 900000000000000000 0e+6144 -> 8100000000000000000
+--dqfma2119 fma 9 9000000000000000000 0e+6144 -> 81000000000000000000
+--dqfma2120 fma 9 90000000000000000000 0e+6144 -> 810000000000000000000
+--dqfma2121 fma 9 900000000000000000000 0e+6144 -> 8100000000000000000000
+--dqfma2122 fma 9 9000000000000000000000 0e+6144 -> 81000000000000000000000
+--dqfma2123 fma 9 90000000000000000000000 0e+6144 -> 810000000000000000000000
+-- test some more edge cases without carries
+dqfma2131 fma 3 3 0e+6144 -> 9
+dqfma2132 fma 3 30 0e+6144 -> 90
+dqfma2133 fma 3 300 0e+6144 -> 900
+dqfma2134 fma 3 3000 0e+6144 -> 9000
+dqfma2135 fma 3 30000 0e+6144 -> 90000
+dqfma2136 fma 3 300000 0e+6144 -> 900000
+dqfma2137 fma 3 3000000 0e+6144 -> 9000000
+dqfma2138 fma 3 30000000 0e+6144 -> 90000000
+dqfma2139 fma 3 300000000 0e+6144 -> 900000000
+dqfma2140 fma 3 3000000000 0e+6144 -> 9000000000
+dqfma2141 fma 3 30000000000 0e+6144 -> 90000000000
+dqfma2142 fma 3 300000000000 0e+6144 -> 900000000000
+dqfma2143 fma 3 3000000000000 0e+6144 -> 9000000000000
+dqfma2144 fma 3 30000000000000 0e+6144 -> 90000000000000
+dqfma2145 fma 3 300000000000000 0e+6144 -> 900000000000000
+dqfma2146 fma 3 3000000000000000 0e+6144 -> 9000000000000000
+dqfma2147 fma 3 30000000000000000 0e+6144 -> 90000000000000000
+dqfma2148 fma 3 300000000000000000 0e+6144 -> 900000000000000000
+dqfma2149 fma 3 3000000000000000000 0e+6144 -> 9000000000000000000
+dqfma2150 fma 3 30000000000000000000 0e+6144 -> 90000000000000000000
+dqfma2151 fma 3 300000000000000000000 0e+6144 -> 900000000000000000000
+dqfma2152 fma 3 3000000000000000000000 0e+6144 -> 9000000000000000000000
+dqfma2153 fma 3 30000000000000000000000 0e+6144 -> 90000000000000000000000
+
+dqfma2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0e+6144 -> 145433.2908011933696719165119928296 Inexact Rounded
+
+-- test some edge cases with exact rounding
+dqfma2301 fma 900000000000000000 9 0e+6144 -> 8100000000000000000
+dqfma2302 fma 900000000000000000 90 0e+6144 -> 81000000000000000000
+dqfma2303 fma 900000000000000000 900 0e+6144 -> 810000000000000000000
+dqfma2304 fma 900000000000000000 9000 0e+6144 -> 8100000000000000000000
+dqfma2305 fma 900000000000000000 90000 0e+6144 -> 81000000000000000000000
+dqfma2306 fma 900000000000000000 900000 0e+6144 -> 810000000000000000000000
+dqfma2307 fma 900000000000000000 9000000 0e+6144 -> 8100000000000000000000000
+dqfma2308 fma 900000000000000000 90000000 0e+6144 -> 81000000000000000000000000
+dqfma2309 fma 900000000000000000 900000000 0e+6144 -> 810000000000000000000000000
+dqfma2310 fma 900000000000000000 9000000000 0e+6144 -> 8100000000000000000000000000
+dqfma2311 fma 900000000000000000 90000000000 0e+6144 -> 81000000000000000000000000000
+dqfma2312 fma 900000000000000000 900000000000 0e+6144 -> 810000000000000000000000000000
+dqfma2313 fma 900000000000000000 9000000000000 0e+6144 -> 8100000000000000000000000000000
+dqfma2314 fma 900000000000000000 90000000000000 0e+6144 -> 81000000000000000000000000000000
+dqfma2315 fma 900000000000000000 900000000000000 0e+6144 -> 810000000000000000000000000000000
+dqfma2316 fma 900000000000000000 9000000000000000 0e+6144 -> 8100000000000000000000000000000000
+dqfma2317 fma 9000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+34 Rounded
+dqfma2318 fma 90000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+35 Rounded
+dqfma2319 fma 900000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+36 Rounded
+dqfma2320 fma 9000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+37 Rounded
+dqfma2321 fma 90000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+38 Rounded
+dqfma2322 fma 900000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+39 Rounded
+dqfma2323 fma 9000000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+40 Rounded
+
+-- tryzeros cases
+dqfma2504 fma 0E-4260 1000E-4260 0e+6144 -> 0E-6176 Clamped
+dqfma2505 fma 100E+4260 0E+4260 0e+6144 -> 0E+6111 Clamped
+
+-- mixed with zeros
+dqfma2541 fma 0 -1 0e+6144 -> 0
+dqfma2542 fma -0 -1 0e+6144 -> 0
+dqfma2543 fma 0 1 0e+6144 -> 0
+dqfma2544 fma -0 1 0e+6144 -> 0
+dqfma2545 fma -1 0 0e+6144 -> 0
+dqfma2546 fma -1 -0 0e+6144 -> 0
+dqfma2547 fma 1 0 0e+6144 -> 0
+dqfma2548 fma 1 -0 0e+6144 -> 0
+
+dqfma2551 fma 0.0 -1 0e+6144 -> 0.0
+dqfma2552 fma -0.0 -1 0e+6144 -> 0.0
+dqfma2553 fma 0.0 1 0e+6144 -> 0.0
+dqfma2554 fma -0.0 1 0e+6144 -> 0.0
+dqfma2555 fma -1.0 0 0e+6144 -> 0.0
+dqfma2556 fma -1.0 -0 0e+6144 -> 0.0
+dqfma2557 fma 1.0 0 0e+6144 -> 0.0
+dqfma2558 fma 1.0 -0 0e+6144 -> 0.0
+
+dqfma2561 fma 0 -1.0 0e+6144 -> 0.0
+dqfma2562 fma -0 -1.0 0e+6144 -> 0.0
+dqfma2563 fma 0 1.0 0e+6144 -> 0.0
+dqfma2564 fma -0 1.0 0e+6144 -> 0.0
+dqfma2565 fma -1 0.0 0e+6144 -> 0.0
+dqfma2566 fma -1 -0.0 0e+6144 -> 0.0
+dqfma2567 fma 1 0.0 0e+6144 -> 0.0
+dqfma2568 fma 1 -0.0 0e+6144 -> 0.0
+
+dqfma2571 fma 0.0 -1.0 0e+6144 -> 0.00
+dqfma2572 fma -0.0 -1.0 0e+6144 -> 0.00
+dqfma2573 fma 0.0 1.0 0e+6144 -> 0.00
+dqfma2574 fma -0.0 1.0 0e+6144 -> 0.00
+dqfma2575 fma -1.0 0.0 0e+6144 -> 0.00
+dqfma2576 fma -1.0 -0.0 0e+6144 -> 0.00
+dqfma2577 fma 1.0 0.0 0e+6144 -> 0.00
+dqfma2578 fma 1.0 -0.0 0e+6144 -> 0.00
+dqfma2579 fma 1.0 0.0 0e+6144 -> 0.00
+dqfma2530 fma -1.0 -0.0 0e+6144 -> 0.00
+dqfma2531 fma -1.0 0.0 0e+6144 -> 0.00
+dqfma2532 fma 1.0 -0.0 -0e+6144 -> -0.00
+dqfma2533 fma 1.0 0.0 -0e+6144 -> 0.00
+dqfma2534 fma -1.0 -0.0 -0e+6144 -> 0.00
+dqfma2535 fma -1.0 0.0 -0e+6144 -> -0.00
+
+
+-- Specials
+dqfma2580 fma Inf -Inf 0e+6144 -> -Infinity
+dqfma2581 fma Inf -1000 0e+6144 -> -Infinity
+dqfma2582 fma Inf -1 0e+6144 -> -Infinity
+dqfma2583 fma Inf -0 0e+6144 -> NaN Invalid_operation
+dqfma2584 fma Inf 0 0e+6144 -> NaN Invalid_operation
+dqfma2585 fma Inf 1 0e+6144 -> Infinity
+dqfma2586 fma Inf 1000 0e+6144 -> Infinity
+dqfma2587 fma Inf Inf 0e+6144 -> Infinity
+dqfma2588 fma -1000 Inf 0e+6144 -> -Infinity
+dqfma2589 fma -Inf Inf 0e+6144 -> -Infinity
+dqfma2590 fma -1 Inf 0e+6144 -> -Infinity
+dqfma2591 fma -0 Inf 0e+6144 -> NaN Invalid_operation
+dqfma2592 fma 0 Inf 0e+6144 -> NaN Invalid_operation
+dqfma2593 fma 1 Inf 0e+6144 -> Infinity
+dqfma2594 fma 1000 Inf 0e+6144 -> Infinity
+dqfma2595 fma Inf Inf 0e+6144 -> Infinity
+
+dqfma2600 fma -Inf -Inf 0e+6144 -> Infinity
+dqfma2601 fma -Inf -1000 0e+6144 -> Infinity
+dqfma2602 fma -Inf -1 0e+6144 -> Infinity
+dqfma2603 fma -Inf -0 0e+6144 -> NaN Invalid_operation
+dqfma2604 fma -Inf 0 0e+6144 -> NaN Invalid_operation
+dqfma2605 fma -Inf 1 0e+6144 -> -Infinity
+dqfma2606 fma -Inf 1000 0e+6144 -> -Infinity
+dqfma2607 fma -Inf Inf 0e+6144 -> -Infinity
+dqfma2608 fma -1000 Inf 0e+6144 -> -Infinity
+dqfma2609 fma -Inf -Inf 0e+6144 -> Infinity
+dqfma2610 fma -1 -Inf 0e+6144 -> Infinity
+dqfma2611 fma -0 -Inf 0e+6144 -> NaN Invalid_operation
+dqfma2612 fma 0 -Inf 0e+6144 -> NaN Invalid_operation
+dqfma2613 fma 1 -Inf 0e+6144 -> -Infinity
+dqfma2614 fma 1000 -Inf 0e+6144 -> -Infinity
+dqfma2615 fma Inf -Inf 0e+6144 -> -Infinity
+
+dqfma2621 fma NaN -Inf 0e+6144 -> NaN
+dqfma2622 fma NaN -1000 0e+6144 -> NaN
+dqfma2623 fma NaN -1 0e+6144 -> NaN
+dqfma2624 fma NaN -0 0e+6144 -> NaN
+dqfma2625 fma NaN 0 0e+6144 -> NaN
+dqfma2626 fma NaN 1 0e+6144 -> NaN
+dqfma2627 fma NaN 1000 0e+6144 -> NaN
+dqfma2628 fma NaN Inf 0e+6144 -> NaN
+dqfma2629 fma NaN NaN 0e+6144 -> NaN
+dqfma2630 fma -Inf NaN 0e+6144 -> NaN
+dqfma2631 fma -1000 NaN 0e+6144 -> NaN
+dqfma2632 fma -1 NaN 0e+6144 -> NaN
+dqfma2633 fma -0 NaN 0e+6144 -> NaN
+dqfma2634 fma 0 NaN 0e+6144 -> NaN
+dqfma2635 fma 1 NaN 0e+6144 -> NaN
+dqfma2636 fma 1000 NaN 0e+6144 -> NaN
+dqfma2637 fma Inf NaN 0e+6144 -> NaN
+
+dqfma2641 fma sNaN -Inf 0e+6144 -> NaN Invalid_operation
+dqfma2642 fma sNaN -1000 0e+6144 -> NaN Invalid_operation
+dqfma2643 fma sNaN -1 0e+6144 -> NaN Invalid_operation
+dqfma2644 fma sNaN -0 0e+6144 -> NaN Invalid_operation
+dqfma2645 fma sNaN 0 0e+6144 -> NaN Invalid_operation
+dqfma2646 fma sNaN 1 0e+6144 -> NaN Invalid_operation
+dqfma2647 fma sNaN 1000 0e+6144 -> NaN Invalid_operation
+dqfma2648 fma sNaN NaN 0e+6144 -> NaN Invalid_operation
+dqfma2649 fma sNaN sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2650 fma NaN sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2651 fma -Inf sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2652 fma -1000 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2653 fma -1 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2654 fma -0 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2655 fma 0 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2656 fma 1 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2657 fma 1000 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2658 fma Inf sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2659 fma NaN sNaN 0e+6144 -> NaN Invalid_operation
+
+-- propagating NaNs
+dqfma2661 fma NaN9 -Inf 0e+6144 -> NaN9
+dqfma2662 fma NaN8 999 0e+6144 -> NaN8
+dqfma2663 fma NaN71 Inf 0e+6144 -> NaN71
+dqfma2664 fma NaN6 NaN5 0e+6144 -> NaN6
+dqfma2665 fma -Inf NaN4 0e+6144 -> NaN4
+dqfma2666 fma -999 NaN33 0e+6144 -> NaN33
+dqfma2667 fma Inf NaN2 0e+6144 -> NaN2
+
+dqfma2671 fma sNaN99 -Inf 0e+6144 -> NaN99 Invalid_operation
+dqfma2672 fma sNaN98 -11 0e+6144 -> NaN98 Invalid_operation
+dqfma2673 fma sNaN97 NaN 0e+6144 -> NaN97 Invalid_operation
+dqfma2674 fma sNaN16 sNaN94 0e+6144 -> NaN16 Invalid_operation
+dqfma2675 fma NaN95 sNaN93 0e+6144 -> NaN93 Invalid_operation
+dqfma2676 fma -Inf sNaN92 0e+6144 -> NaN92 Invalid_operation
+dqfma2677 fma 088 sNaN91 0e+6144 -> NaN91 Invalid_operation
+dqfma2678 fma Inf sNaN90 0e+6144 -> NaN90 Invalid_operation
+dqfma2679 fma NaN sNaN89 0e+6144 -> NaN89 Invalid_operation
+
+dqfma2681 fma -NaN9 -Inf 0e+6144 -> -NaN9
+dqfma2682 fma -NaN8 999 0e+6144 -> -NaN8
+dqfma2683 fma -NaN71 Inf 0e+6144 -> -NaN71
+dqfma2684 fma -NaN6 -NaN5 0e+6144 -> -NaN6
+dqfma2685 fma -Inf -NaN4 0e+6144 -> -NaN4
+dqfma2686 fma -999 -NaN33 0e+6144 -> -NaN33
+dqfma2687 fma Inf -NaN2 0e+6144 -> -NaN2
+
+dqfma2691 fma -sNaN99 -Inf 0e+6144 -> -NaN99 Invalid_operation
+dqfma2692 fma -sNaN98 -11 0e+6144 -> -NaN98 Invalid_operation
+dqfma2693 fma -sNaN97 NaN 0e+6144 -> -NaN97 Invalid_operation
+dqfma2694 fma -sNaN16 -sNaN94 0e+6144 -> -NaN16 Invalid_operation
+dqfma2695 fma -NaN95 -sNaN93 0e+6144 -> -NaN93 Invalid_operation
+dqfma2696 fma -Inf -sNaN92 0e+6144 -> -NaN92 Invalid_operation
+dqfma2697 fma 088 -sNaN91 0e+6144 -> -NaN91 Invalid_operation
+dqfma2698 fma Inf -sNaN90 0e+6144 -> -NaN90 Invalid_operation
+dqfma2699 fma -NaN -sNaN89 0e+6144 -> -NaN89 Invalid_operation
+
+dqfma2701 fma -NaN -Inf 0e+6144 -> -NaN
+dqfma2702 fma -NaN 999 0e+6144 -> -NaN
+dqfma2703 fma -NaN Inf 0e+6144 -> -NaN
+dqfma2704 fma -NaN -NaN 0e+6144 -> -NaN
+dqfma2705 fma -Inf -NaN0 0e+6144 -> -NaN
+dqfma2706 fma -999 -NaN 0e+6144 -> -NaN
+dqfma2707 fma Inf -NaN 0e+6144 -> -NaN
+
+dqfma2711 fma -sNaN -Inf 0e+6144 -> -NaN Invalid_operation
+dqfma2712 fma -sNaN -11 0e+6144 -> -NaN Invalid_operation
+dqfma2713 fma -sNaN00 NaN 0e+6144 -> -NaN Invalid_operation
+dqfma2714 fma -sNaN -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2715 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2716 fma -Inf -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2717 fma 088 -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2718 fma Inf -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2719 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+dqfma2751 fma 1e+4277 1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2752 fma 1e+4277 -1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded
+dqfma2753 fma -1e+4277 1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded
+dqfma2754 fma -1e+4277 -1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2755 fma 1e-4277 1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2756 fma 1e-4277 -1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2757 fma -1e-4277 1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2758 fma -1e-4277 -1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dqfma2760 fma 1e-6069 1e-101 0e+6144 -> 1E-6170 Subnormal
+dqfma2761 fma 1e-6069 1e-102 0e+6144 -> 1E-6171 Subnormal
+dqfma2762 fma 1e-6069 1e-103 0e+6144 -> 1E-6172 Subnormal
+dqfma2763 fma 1e-6069 1e-104 0e+6144 -> 1E-6173 Subnormal
+dqfma2764 fma 1e-6069 1e-105 0e+6144 -> 1E-6174 Subnormal
+dqfma2765 fma 1e-6069 1e-106 0e+6144 -> 1E-6175 Subnormal
+dqfma2766 fma 1e-6069 1e-107 0e+6144 -> 1E-6176 Subnormal
+dqfma2767 fma 1e-6069 1e-108 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2768 fma 1e-6069 1e-109 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2769 fma 1e-6069 1e-110 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+dqfma2770 fma 1e+40 1e+6101 0e+6144 -> 1.000000000000000000000000000000E+6141 Clamped
+dqfma2771 fma 1e+40 1e+6102 0e+6144 -> 1.0000000000000000000000000000000E+6142 Clamped
+dqfma2772 fma 1e+40 1e+6103 0e+6144 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqfma2773 fma 1e+40 1e+6104 0e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped
+dqfma2774 fma 1e+40 1e+6105 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2775 fma 1e+40 1e+6106 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2776 fma 1e+40 1e+6107 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2777 fma 1e+40 1e+6108 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2778 fma 1e+40 1e+6109 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2779 fma 1e+40 1e+6110 0e+6144 -> Infinity Overflow Inexact Rounded
+
+dqfma2801 fma 1.0000E-6172 1 0e+6144 -> 1.0000E-6172 Subnormal
+dqfma2802 fma 1.000E-6172 1e-1 0e+6144 -> 1.000E-6173 Subnormal
+dqfma2803 fma 1.00E-6172 1e-2 0e+6144 -> 1.00E-6174 Subnormal
+dqfma2804 fma 1.0E-6172 1e-3 0e+6144 -> 1.0E-6175 Subnormal
+dqfma2805 fma 1.0E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal Rounded
+dqfma2806 fma 1.3E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2807 fma 1.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2808 fma 1.7E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2809 fma 2.3E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2810 fma 2.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2811 fma 2.7E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqfma2812 fma 1.49E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2813 fma 1.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2814 fma 1.51E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2815 fma 2.49E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2816 fma 2.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2817 fma 2.51E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded
+
+dqfma2818 fma 1E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal
+dqfma2819 fma 3E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2820 fma 5E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2821 fma 7E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2822 fma 9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2823 fma 9.9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+dqfma2824 fma 1E-6172 -1e-4 0e+6144 -> -1E-6176 Subnormal
+dqfma2825 fma 3E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2826 fma -5E-6172 1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2827 fma 7E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2828 fma -9E-6172 1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2829 fma 9.9E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2830 fma 3.0E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqfma2831 fma 1.0E-5977 1e-200 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2832 fma 1.0E-5977 1e-199 0e+6144 -> 1E-6176 Subnormal Rounded
+dqfma2833 fma 1.0E-5977 1e-198 0e+6144 -> 1.0E-6175 Subnormal
+dqfma2834 fma 2.0E-5977 2e-198 0e+6144 -> 4.0E-6175 Subnormal
+dqfma2835 fma 4.0E-5977 4e-198 0e+6144 -> 1.60E-6174 Subnormal
+dqfma2836 fma 10.0E-5977 10e-198 0e+6144 -> 1.000E-6173 Subnormal
+dqfma2837 fma 30.0E-5977 30e-198 0e+6144 -> 9.000E-6173 Subnormal
+dqfma2838 fma 40.0E-5982 40e-166 0e+6144 -> 1.6000E-6145 Subnormal
+dqfma2839 fma 40.0E-5982 40e-165 0e+6144 -> 1.6000E-6144 Subnormal
+dqfma2840 fma 40.0E-5982 40e-164 0e+6144 -> 1.6000E-6143
+
+-- Long operand overflow may be a different path
+dqfma2870 fma 100 9.999E+6143 0e+6144 -> Infinity Inexact Overflow Rounded
+dqfma2871 fma 100 -9.999E+6143 0e+6144 -> -Infinity Inexact Overflow Rounded
+dqfma2872 fma 9.999E+6143 100 0e+6144 -> Infinity Inexact Overflow Rounded
+dqfma2873 fma -9.999E+6143 100 0e+6144 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+dqfma2881 fma 1.2347E-6133 1.2347E-40 0e+6144 -> 1.524E-6173 Inexact Rounded Subnormal Underflow
+dqfma2882 fma 1.234E-6133 1.234E-40 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqfma2883 fma 1.23E-6133 1.23E-40 0e+6144 -> 1.513E-6173 Inexact Rounded Subnormal Underflow
+dqfma2884 fma 1.2E-6133 1.2E-40 0e+6144 -> 1.44E-6173 Subnormal
+dqfma2885 fma 1.2E-6133 1.2E-41 0e+6144 -> 1.44E-6174 Subnormal
+dqfma2886 fma 1.2E-6133 1.2E-42 0e+6144 -> 1.4E-6175 Subnormal Inexact Rounded Underflow
+dqfma2887 fma 1.2E-6133 1.3E-42 0e+6144 -> 1.6E-6175 Subnormal Inexact Rounded Underflow
+dqfma2888 fma 1.3E-6133 1.3E-42 0e+6144 -> 1.7E-6175 Subnormal Inexact Rounded Underflow
+dqfma2889 fma 1.3E-6133 1.3E-43 0e+6144 -> 2E-6176 Subnormal Inexact Rounded Underflow
+dqfma2890 fma 1.3E-6134 1.3E-43 0e+6144 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow
+
+dqfma2891 fma 1.2345E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
+dqfma2892 fma 1.23456E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
+dqfma2893 fma 1.2345E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqfma2894 fma 1.23456E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqfma2895 fma 1.2345E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
+dqfma2896 fma 1.23456E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+-- prove operands are exact
+dqfma2906 fma 9.999999999999999999999999999999999E-6143 1 0e+6144 -> 9.999999999999999999999999999999999E-6143
+dqfma2907 fma 1 0.09999999999999999999999999999999999 0e+6144 -> 0.09999999999999999999999999999999999
+-- the next rounds to Nmin
+dqfma2908 fma 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 0e+6144 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded
+
+-- hugest
+dqfma2909 fma 9999999999999999999999999999999999 9999999999999999999999999999999999 0e+6144 -> 9.999999999999999999999999999999998E+67 Inexact Rounded
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+dqfma21001 fma 130E-2 120E-2 0e+6144 -> 1.5600
+dqfma21002 fma 130E-2 12E-1 0e+6144 -> 1.560
+dqfma21003 fma 130E-2 1E0 0e+6144 -> 1.30
+dqfma21004 fma 1E2 1E4 0e+6144 -> 1E+6
+
+-- Null tests
+dqfma2990 fma 10 # 0e+6144 -> NaN Invalid_operation
+dqfma2991 fma # 10 0e+6144 -> NaN Invalid_operation
+
+
+-- ADDITION TESTS ------------------------------------------------------
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+dqadd3001 fma 1 1 1 -> 2
+dqadd3002 fma 1 2 3 -> 5
+dqadd3003 fma 1 '5.75' '3.3' -> 9.05
+dqadd3004 fma 1 '5' '-3' -> 2
+dqadd3005 fma 1 '-5' '-3' -> -8
+dqadd3006 fma 1 '-7' '2.5' -> -4.5
+dqadd3007 fma 1 '0.7' '0.3' -> 1.0
+dqadd3008 fma 1 '1.25' '1.25' -> 2.50
+dqadd3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
+dqadd3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
+
+-- 1234567890123456 1234567890123456
+dqadd3011 fma 1 '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqadd3012 fma 1 '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded
+dqadd3013 fma 1 '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
+dqadd3014 fma 1 '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd3015 fma 1 '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd3016 fma 1 '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd3017 fma 1 '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd3018 fma 1 '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded
+dqadd3019 fma 1 '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded
+dqadd3020 fma 1 '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded
+
+dqadd3021 fma 1 0 1 -> 1
+dqadd3022 fma 1 1 1 -> 2
+dqadd3023 fma 1 2 1 -> 3
+dqadd3024 fma 1 3 1 -> 4
+dqadd3025 fma 1 4 1 -> 5
+dqadd3026 fma 1 5 1 -> 6
+dqadd3027 fma 1 6 1 -> 7
+dqadd3028 fma 1 7 1 -> 8
+dqadd3029 fma 1 8 1 -> 9
+dqadd3030 fma 1 9 1 -> 10
+
+-- some carrying effects
+dqadd3031 fma 1 '0.9998' '0.0000' -> '0.9998'
+dqadd3032 fma 1 '0.9998' '0.0001' -> '0.9999'
+dqadd3033 fma 1 '0.9998' '0.0002' -> '1.0000'
+dqadd3034 fma 1 '0.9998' '0.0003' -> '1.0001'
+
+dqadd3035 fma 1 '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3036 fma 1 '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3037 fma 1 '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3038 fma 1 '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
+dqadd3039 fma 1 '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded
+
+-- symmetry:
+dqadd3040 fma 1 '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3041 fma 1 '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3042 fma 1 '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3044 fma 1 '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
+dqadd3045 fma 1 '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded
+
+-- same, without rounding
+dqadd3046 fma 1 '10000e+9' '7' -> '10000000000007'
+dqadd3047 fma 1 '10000e+9' '70' -> '10000000000070'
+dqadd3048 fma 1 '10000e+9' '700' -> '10000000000700'
+dqadd3049 fma 1 '10000e+9' '7000' -> '10000000007000'
+dqadd3050 fma 1 '10000e+9' '70000' -> '10000000070000'
+dqadd3051 fma 1 '10000e+9' '700000' -> '10000000700000'
+dqadd3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+dqadd3053 fma 1 '12' '7.00' -> '19.00'
+dqadd3054 fma 1 '1.3' '-1.07' -> '0.23'
+dqadd3055 fma 1 '1.3' '-1.30' -> '0.00'
+dqadd3056 fma 1 '1.3' '-2.07' -> '-0.77'
+dqadd3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
+
+-- leading zero preservation
+dqadd3061 fma 1 1 '0.0001' -> '1.0001'
+dqadd3062 fma 1 1 '0.00001' -> '1.00001'
+dqadd3063 fma 1 1 '0.000001' -> '1.000001'
+dqadd3064 fma 1 1 '0.0000001' -> '1.0000001'
+dqadd3065 fma 1 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+dqadd3070 fma 1 1 0 -> 1
+dqadd3071 fma 1 1 0. -> 1
+dqadd3072 fma 1 1 .0 -> 1.0
+dqadd3073 fma 1 1 0.0 -> 1.0
+dqadd3074 fma 1 1 0.00 -> 1.00
+dqadd3075 fma 1 0 1 -> 1
+dqadd3076 fma 1 0. 1 -> 1
+dqadd3077 fma 1 .0 1 -> 1.0
+dqadd3078 fma 1 0.0 1 -> 1.0
+dqadd3079 fma 1 0.00 1 -> 1.00
+
+-- some carries
+dqadd3080 fma 1 999999998 1 -> 999999999
+dqadd3081 fma 1 999999999 1 -> 1000000000
+dqadd3082 fma 1 99999999 1 -> 100000000
+dqadd3083 fma 1 9999999 1 -> 10000000
+dqadd3084 fma 1 999999 1 -> 1000000
+dqadd3085 fma 1 99999 1 -> 100000
+dqadd3086 fma 1 9999 1 -> 10000
+dqadd3087 fma 1 999 1 -> 1000
+dqadd3088 fma 1 99 1 -> 100
+dqadd3089 fma 1 9 1 -> 10
+
+
+-- more LHS swaps
+dqadd3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
+dqadd3091 fma 1 '-56267E-6' 0 -> '-0.056267'
+dqadd3092 fma 1 '-56267E-5' 0 -> '-0.56267'
+dqadd3093 fma 1 '-56267E-4' 0 -> '-5.6267'
+dqadd3094 fma 1 '-56267E-3' 0 -> '-56.267'
+dqadd3095 fma 1 '-56267E-2' 0 -> '-562.67'
+dqadd3096 fma 1 '-56267E-1' 0 -> '-5626.7'
+dqadd3097 fma 1 '-56267E-0' 0 -> '-56267'
+dqadd3098 fma 1 '-5E-10' 0 -> '-5E-10'
+dqadd3099 fma 1 '-5E-7' 0 -> '-5E-7'
+dqadd3100 fma 1 '-5E-6' 0 -> '-0.000005'
+dqadd3101 fma 1 '-5E-5' 0 -> '-0.00005'
+dqadd3102 fma 1 '-5E-4' 0 -> '-0.0005'
+dqadd3103 fma 1 '-5E-1' 0 -> '-0.5'
+dqadd3104 fma 1 '-5E0' 0 -> '-5'
+dqadd3105 fma 1 '-5E1' 0 -> '-50'
+dqadd3106 fma 1 '-5E5' 0 -> '-500000'
+dqadd3107 fma 1 '-5E33' 0 -> '-5000000000000000000000000000000000'
+dqadd3108 fma 1 '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
+dqadd3109 fma 1 '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
+dqadd3110 fma 1 '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
+dqadd3111 fma 1 '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- more RHS swaps
+dqadd3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
+dqadd3114 fma 1 0 '-56267E-6' -> '-0.056267'
+dqadd3116 fma 1 0 '-56267E-5' -> '-0.56267'
+dqadd3117 fma 1 0 '-56267E-4' -> '-5.6267'
+dqadd3119 fma 1 0 '-56267E-3' -> '-56.267'
+dqadd3120 fma 1 0 '-56267E-2' -> '-562.67'
+dqadd3121 fma 1 0 '-56267E-1' -> '-5626.7'
+dqadd3122 fma 1 0 '-56267E-0' -> '-56267'
+dqadd3123 fma 1 0 '-5E-10' -> '-5E-10'
+dqadd3124 fma 1 0 '-5E-7' -> '-5E-7'
+dqadd3125 fma 1 0 '-5E-6' -> '-0.000005'
+dqadd3126 fma 1 0 '-5E-5' -> '-0.00005'
+dqadd3127 fma 1 0 '-5E-4' -> '-0.0005'
+dqadd3128 fma 1 0 '-5E-1' -> '-0.5'
+dqadd3129 fma 1 0 '-5E0' -> '-5'
+dqadd3130 fma 1 0 '-5E1' -> '-50'
+dqadd3131 fma 1 0 '-5E5' -> '-500000'
+dqadd3132 fma 1 0 '-5E33' -> '-5000000000000000000000000000000000'
+dqadd3133 fma 1 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded
+dqadd3134 fma 1 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded
+dqadd3135 fma 1 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded
+dqadd3136 fma 1 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- related
+dqadd3137 fma 1 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded
+dqadd3138 fma 1 -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded
+dqadd3139 fma 1 '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded
+dqadd3140 fma 1 '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded
+dqadd3141 fma 1 1E+29 0.0000 -> '100000000000000000000000000000.0000'
+dqadd3142 fma 1 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded
+dqadd3143 fma 1 0.000 1E+30 -> '1000000000000000000000000000000.000'
+dqadd3144 fma 1 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+dqadd3146 fma 1 '00.0' 0 -> '0.0'
+dqadd3147 fma 1 '0.00' 0 -> '0.00'
+dqadd3148 fma 1 0 '0.00' -> '0.00'
+dqadd3149 fma 1 0 '00.0' -> '0.0'
+dqadd3150 fma 1 '00.0' '0.00' -> '0.00'
+dqadd3151 fma 1 '0.00' '00.0' -> '0.00'
+dqadd3152 fma 1 '3' '.3' -> '3.3'
+dqadd3153 fma 1 '3.' '.3' -> '3.3'
+dqadd3154 fma 1 '3.0' '.3' -> '3.3'
+dqadd3155 fma 1 '3.00' '.3' -> '3.30'
+dqadd3156 fma 1 '3' '3' -> '6'
+dqadd3157 fma 1 '3' '+3' -> '6'
+dqadd3158 fma 1 '3' '-3' -> '0'
+dqadd3159 fma 1 '0.3' '-0.3' -> '0.0'
+dqadd3160 fma 1 '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+dqadd3161 fma 1 '1E+12' '-1' -> '999999999999'
+dqadd3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
+dqadd3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
+dqadd3164 fma 1 '-1' '1E+12' -> '999999999999'
+dqadd3165 fma 1 '7E+12' '-1' -> '6999999999999'
+dqadd3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
+dqadd3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
+dqadd3168 fma 1 '-1' '7E+12' -> '6999999999999'
+
+rounding: half_up
+dqadd3170 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd3171 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd3172 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd3173 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded
+dqadd3174 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd3175 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd3176 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd3177 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded
+dqadd3178 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd3179 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd3180 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd3181 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd3182 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd3183 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+dqadd3200 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd3201 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3202 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3203 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3204 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3205 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3206 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3207 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3208 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3209 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3210 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3211 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3212 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3213 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3214 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3215 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3216 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd3217 fma 1 '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3218 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3219 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+
+rounding: half_even
+dqadd3220 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd3221 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3222 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3223 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3224 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3225 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3226 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3227 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3228 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3229 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3230 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3231 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3232 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3233 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3234 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3235 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3236 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd3237 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3238 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3239 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+-- critical few with even bottom digit...
+dqadd3240 fma 1 '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded
+dqadd3241 fma 1 '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded
+dqadd3242 fma 1 '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
+
+rounding: down
+dqadd3250 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd3251 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3252 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3253 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3254 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3255 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3256 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3257 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3258 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3259 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3260 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3261 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3262 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3263 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3264 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3265 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3266 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd3267 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3268 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3269 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+dqadd3301 fma 1 -1 1 -> 0
+dqadd3302 fma 1 0 1 -> 1
+dqadd3303 fma 1 1 1 -> 2
+dqadd3304 fma 1 12 1 -> 13
+dqadd3305 fma 1 98 1 -> 99
+dqadd3306 fma 1 99 1 -> 100
+dqadd3307 fma 1 100 1 -> 101
+dqadd3308 fma 1 101 1 -> 102
+dqadd3309 fma 1 -1 -1 -> -2
+dqadd3310 fma 1 0 -1 -> -1
+dqadd3311 fma 1 1 -1 -> 0
+dqadd3312 fma 1 12 -1 -> 11
+dqadd3313 fma 1 98 -1 -> 97
+dqadd3314 fma 1 99 -1 -> 98
+dqadd3315 fma 1 100 -1 -> 99
+dqadd3316 fma 1 101 -1 -> 100
+
+dqadd3321 fma 1 -0.01 0.01 -> 0.00
+dqadd3322 fma 1 0.00 0.01 -> 0.01
+dqadd3323 fma 1 0.01 0.01 -> 0.02
+dqadd3324 fma 1 0.12 0.01 -> 0.13
+dqadd3325 fma 1 0.98 0.01 -> 0.99
+dqadd3326 fma 1 0.99 0.01 -> 1.00
+dqadd3327 fma 1 1.00 0.01 -> 1.01
+dqadd3328 fma 1 1.01 0.01 -> 1.02
+dqadd3329 fma 1 -0.01 -0.01 -> -0.02
+dqadd3330 fma 1 0.00 -0.01 -> -0.01
+dqadd3331 fma 1 0.01 -0.01 -> 0.00
+dqadd3332 fma 1 0.12 -0.01 -> 0.11
+dqadd3333 fma 1 0.98 -0.01 -> 0.97
+dqadd3334 fma 1 0.99 -0.01 -> 0.98
+dqadd3335 fma 1 1.00 -0.01 -> 0.99
+dqadd3336 fma 1 1.01 -0.01 -> 1.00
+
+-- some more cases where adding 0 affects the coefficient
+dqadd3340 fma 1 1E+3 0 -> 1000
+dqadd3341 fma 1 1E+33 0 -> 1000000000000000000000000000000000
+dqadd3342 fma 1 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded
+dqadd3343 fma 1 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded
+-- which simply follow from these cases ...
+dqadd3344 fma 1 1E+3 1 -> 1001
+dqadd3345 fma 1 1E+33 1 -> 1000000000000000000000000000000001
+dqadd3346 fma 1 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd3347 fma 1 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
+dqadd3348 fma 1 1E+3 7 -> 1007
+dqadd3349 fma 1 1E+33 7 -> 1000000000000000000000000000000007
+dqadd3350 fma 1 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded
+dqadd3351 fma 1 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
+
+-- tryzeros cases
+rounding: half_up
+dqadd3360 fma 1 0E+50 10000E+1 -> 1.0000E+5
+dqadd3361 fma 1 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded
+dqadd3362 fma 1 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded
+dqadd3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact
+dqadd3364 fma 1 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111
+-- 1 234567890123456789012345678901234
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+dqadd3370 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd3371 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+rounding: half_up
+dqadd3372 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd3373 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+rounding: half_even
+dqadd3374 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd3375 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+
+-- ulp replacement tests
+dqadd3400 fma 1 1 77e-32 -> 1.00000000000000000000000000000077
+dqadd3401 fma 1 1 77e-33 -> 1.000000000000000000000000000000077
+dqadd3402 fma 1 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded
+dqadd3403 fma 1 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded
+dqadd3404 fma 1 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd3405 fma 1 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd3406 fma 1 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd3410 fma 1 10 77e-32 -> 10.00000000000000000000000000000077
+dqadd3411 fma 1 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded
+dqadd3412 fma 1 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded
+dqadd3413 fma 1 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3414 fma 1 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3415 fma 1 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3416 fma 1 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd3420 fma 1 77e-32 1 -> 1.00000000000000000000000000000077
+dqadd3421 fma 1 77e-33 1 -> 1.000000000000000000000000000000077
+dqadd3422 fma 1 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded
+dqadd3423 fma 1 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded
+dqadd3424 fma 1 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd3425 fma 1 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd3426 fma 1 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd3430 fma 1 77e-32 10 -> 10.00000000000000000000000000000077
+dqadd3431 fma 1 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded
+dqadd3432 fma 1 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded
+dqadd3433 fma 1 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3434 fma 1 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3435 fma 1 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3436 fma 1 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+-- negative ulps
+dqadd36440 fma 1 1 -77e-32 -> 0.99999999999999999999999999999923
+dqadd36441 fma 1 1 -77e-33 -> 0.999999999999999999999999999999923
+dqadd36442 fma 1 1 -77e-34 -> 0.9999999999999999999999999999999923
+dqadd36443 fma 1 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded
+dqadd36444 fma 1 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded
+dqadd36445 fma 1 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd36446 fma 1 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd36450 fma 1 10 -77e-32 -> 9.99999999999999999999999999999923
+dqadd36451 fma 1 10 -77e-33 -> 9.999999999999999999999999999999923
+dqadd36452 fma 1 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded
+dqadd36453 fma 1 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded
+dqadd36454 fma 1 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd36455 fma 1 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd36456 fma 1 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd36460 fma 1 -77e-32 1 -> 0.99999999999999999999999999999923
+dqadd36461 fma 1 -77e-33 1 -> 0.999999999999999999999999999999923
+dqadd36462 fma 1 -77e-34 1 -> 0.9999999999999999999999999999999923
+dqadd36463 fma 1 -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded
+dqadd36464 fma 1 -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded
+dqadd36465 fma 1 -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd36466 fma 1 -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd36470 fma 1 -77e-32 10 -> 9.99999999999999999999999999999923
+dqadd36471 fma 1 -77e-33 10 -> 9.999999999999999999999999999999923
+dqadd36472 fma 1 -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded
+dqadd36473 fma 1 -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded
+dqadd36474 fma 1 -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd36475 fma 1 -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd36476 fma 1 -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+-- negative ulps
+dqadd36480 fma 1 -1 77e-32 -> -0.99999999999999999999999999999923
+dqadd36481 fma 1 -1 77e-33 -> -0.999999999999999999999999999999923
+dqadd36482 fma 1 -1 77e-34 -> -0.9999999999999999999999999999999923
+dqadd36483 fma 1 -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded
+dqadd36484 fma 1 -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded
+dqadd36485 fma 1 -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded
+dqadd36486 fma 1 -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd36490 fma 1 -10 77e-32 -> -9.99999999999999999999999999999923
+dqadd36491 fma 1 -10 77e-33 -> -9.999999999999999999999999999999923
+dqadd36492 fma 1 -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded
+dqadd36493 fma 1 -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded
+dqadd36494 fma 1 -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd36495 fma 1 -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd36496 fma 1 -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd36500 fma 1 77e-32 -1 -> -0.99999999999999999999999999999923
+dqadd36501 fma 1 77e-33 -1 -> -0.999999999999999999999999999999923
+dqadd36502 fma 1 77e-34 -1 -> -0.9999999999999999999999999999999923
+dqadd36503 fma 1 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded
+dqadd36504 fma 1 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded
+dqadd36505 fma 1 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
+dqadd36506 fma 1 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd36510 fma 1 77e-32 -10 -> -9.99999999999999999999999999999923
+dqadd36511 fma 1 77e-33 -10 -> -9.999999999999999999999999999999923
+dqadd36512 fma 1 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded
+dqadd36513 fma 1 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded
+dqadd36514 fma 1 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd36515 fma 1 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd36516 fma 1 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+
+-- and some more residue effects and different roundings
+rounding: half_up
+dqadd36540 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd36541 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36542 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36543 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36544 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36545 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36546 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36547 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36548 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36549 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36550 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36551 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36552 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36553 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36554 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36555 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36556 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd36557 fma 1 '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36558 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36559 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+rounding: half_even
+dqadd36560 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd36561 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36562 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36563 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36564 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36565 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36566 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36567 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36568 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36569 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36570 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36571 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36572 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36573 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36574 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36575 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36576 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd36577 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36578 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36579 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+-- critical few with even bottom digit...
+dqadd37540 fma 1 '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded
+dqadd37541 fma 1 '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded
+dqadd37542 fma 1 '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
+
+rounding: down
+dqadd37550 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd37551 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37552 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37553 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37554 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37555 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37556 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37557 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37558 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37559 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37560 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37561 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37562 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37563 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37564 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37565 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37566 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd37567 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd37568 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd37569 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+dqadd37701 fma 1 5.00 1.00E-3 -> 5.00100
+dqadd37702 fma 1 00.00 0.000 -> 0.000
+dqadd37703 fma 1 00.00 0E-3 -> 0.000
+dqadd37704 fma 1 0E-3 00.00 -> 0.000
+
+dqadd37710 fma 1 0E+3 00.00 -> 0.00
+dqadd37711 fma 1 0E+3 00.0 -> 0.0
+dqadd37712 fma 1 0E+3 00. -> 0
+dqadd37713 fma 1 0E+3 00.E+1 -> 0E+1
+dqadd37714 fma 1 0E+3 00.E+2 -> 0E+2
+dqadd37715 fma 1 0E+3 00.E+3 -> 0E+3
+dqadd37716 fma 1 0E+3 00.E+4 -> 0E+3
+dqadd37717 fma 1 0E+3 00.E+5 -> 0E+3
+dqadd37718 fma 1 0E+3 -00.0 -> 0.0
+dqadd37719 fma 1 0E+3 -00. -> 0
+dqadd37731 fma 1 0E+3 -00.E+1 -> 0E+1
+
+dqadd37720 fma 1 00.00 0E+3 -> 0.00
+dqadd37721 fma 1 00.0 0E+3 -> 0.0
+dqadd37722 fma 1 00. 0E+3 -> 0
+dqadd37723 fma 1 00.E+1 0E+3 -> 0E+1
+dqadd37724 fma 1 00.E+2 0E+3 -> 0E+2
+dqadd37725 fma 1 00.E+3 0E+3 -> 0E+3
+dqadd37726 fma 1 00.E+4 0E+3 -> 0E+3
+dqadd37727 fma 1 00.E+5 0E+3 -> 0E+3
+dqadd37728 fma 1 -00.00 0E+3 -> 0.00
+dqadd37729 fma 1 -00.0 0E+3 -> 0.0
+dqadd37730 fma 1 -00. 0E+3 -> 0
+
+dqadd37732 fma 1 0 0 -> 0
+dqadd37733 fma 1 0 -0 -> 0
+dqadd37734 fma 1 -0 0 -> 0
+dqadd37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
+
+dqadd37736 fma 1 1 -1 -> 0
+dqadd37737 fma 1 -1 -1 -> -2
+dqadd37738 fma 1 1 1 -> 2
+dqadd37739 fma 1 -1 1 -> 0
+
+dqadd37741 fma 1 0 -1 -> -1
+dqadd37742 fma 1 -0 -1 -> -1
+dqadd37743 fma 1 0 1 -> 1
+dqadd37744 fma 1 -0 1 -> 1
+dqadd37745 fma 1 -1 0 -> -1
+dqadd37746 fma 1 -1 -0 -> -1
+dqadd37747 fma 1 1 0 -> 1
+dqadd37748 fma 1 1 -0 -> 1
+
+dqadd37751 fma 1 0.0 -1 -> -1.0
+dqadd37752 fma 1 -0.0 -1 -> -1.0
+dqadd37753 fma 1 0.0 1 -> 1.0
+dqadd37754 fma 1 -0.0 1 -> 1.0
+dqadd37755 fma 1 -1.0 0 -> -1.0
+dqadd37756 fma 1 -1.0 -0 -> -1.0
+dqadd37757 fma 1 1.0 0 -> 1.0
+dqadd37758 fma 1 1.0 -0 -> 1.0
+
+dqadd37761 fma 1 0 -1.0 -> -1.0
+dqadd37762 fma 1 -0 -1.0 -> -1.0
+dqadd37763 fma 1 0 1.0 -> 1.0
+dqadd37764 fma 1 -0 1.0 -> 1.0
+dqadd37765 fma 1 -1 0.0 -> -1.0
+dqadd37766 fma 1 -1 -0.0 -> -1.0
+dqadd37767 fma 1 1 0.0 -> 1.0
+dqadd37768 fma 1 1 -0.0 -> 1.0
+
+dqadd37771 fma 1 0.0 -1.0 -> -1.0
+dqadd37772 fma 1 -0.0 -1.0 -> -1.0
+dqadd37773 fma 1 0.0 1.0 -> 1.0
+dqadd37774 fma 1 -0.0 1.0 -> 1.0
+dqadd37775 fma 1 -1.0 0.0 -> -1.0
+dqadd37776 fma 1 -1.0 -0.0 -> -1.0
+dqadd37777 fma 1 1.0 0.0 -> 1.0
+dqadd37778 fma 1 1.0 -0.0 -> 1.0
+
+-- Specials
+dqadd37780 fma 1 -Inf -Inf -> -Infinity
+dqadd37781 fma 1 -Inf -1000 -> -Infinity
+dqadd37782 fma 1 -Inf -1 -> -Infinity
+dqadd37783 fma 1 -Inf -0 -> -Infinity
+dqadd37784 fma 1 -Inf 0 -> -Infinity
+dqadd37785 fma 1 -Inf 1 -> -Infinity
+dqadd37786 fma 1 -Inf 1000 -> -Infinity
+dqadd37787 fma 1 -1000 -Inf -> -Infinity
+dqadd37788 fma 1 -Inf -Inf -> -Infinity
+dqadd37789 fma 1 -1 -Inf -> -Infinity
+dqadd37790 fma 1 -0 -Inf -> -Infinity
+dqadd37791 fma 1 0 -Inf -> -Infinity
+dqadd37792 fma 1 1 -Inf -> -Infinity
+dqadd37793 fma 1 1000 -Inf -> -Infinity
+dqadd37794 fma 1 Inf -Inf -> NaN Invalid_operation
+
+dqadd37800 fma 1 Inf -Inf -> NaN Invalid_operation
+dqadd37801 fma 1 Inf -1000 -> Infinity
+dqadd37802 fma 1 Inf -1 -> Infinity
+dqadd37803 fma 1 Inf -0 -> Infinity
+dqadd37804 fma 1 Inf 0 -> Infinity
+dqadd37805 fma 1 Inf 1 -> Infinity
+dqadd37806 fma 1 Inf 1000 -> Infinity
+dqadd37807 fma 1 Inf Inf -> Infinity
+dqadd37808 fma 1 -1000 Inf -> Infinity
+dqadd37809 fma 1 -Inf Inf -> NaN Invalid_operation
+dqadd37810 fma 1 -1 Inf -> Infinity
+dqadd37811 fma 1 -0 Inf -> Infinity
+dqadd37812 fma 1 0 Inf -> Infinity
+dqadd37813 fma 1 1 Inf -> Infinity
+dqadd37814 fma 1 1000 Inf -> Infinity
+dqadd37815 fma 1 Inf Inf -> Infinity
+
+dqadd37821 fma 1 NaN -Inf -> NaN
+dqadd37822 fma 1 NaN -1000 -> NaN
+dqadd37823 fma 1 NaN -1 -> NaN
+dqadd37824 fma 1 NaN -0 -> NaN
+dqadd37825 fma 1 NaN 0 -> NaN
+dqadd37826 fma 1 NaN 1 -> NaN
+dqadd37827 fma 1 NaN 1000 -> NaN
+dqadd37828 fma 1 NaN Inf -> NaN
+dqadd37829 fma 1 NaN NaN -> NaN
+dqadd37830 fma 1 -Inf NaN -> NaN
+dqadd37831 fma 1 -1000 NaN -> NaN
+dqadd37832 fma 1 -1 NaN -> NaN
+dqadd37833 fma 1 -0 NaN -> NaN
+dqadd37834 fma 1 0 NaN -> NaN
+dqadd37835 fma 1 1 NaN -> NaN
+dqadd37836 fma 1 1000 NaN -> NaN
+dqadd37837 fma 1 Inf NaN -> NaN
+
+dqadd37841 fma 1 sNaN -Inf -> NaN Invalid_operation
+dqadd37842 fma 1 sNaN -1000 -> NaN Invalid_operation
+dqadd37843 fma 1 sNaN -1 -> NaN Invalid_operation
+dqadd37844 fma 1 sNaN -0 -> NaN Invalid_operation
+dqadd37845 fma 1 sNaN 0 -> NaN Invalid_operation
+dqadd37846 fma 1 sNaN 1 -> NaN Invalid_operation
+dqadd37847 fma 1 sNaN 1000 -> NaN Invalid_operation
+dqadd37848 fma 1 sNaN NaN -> NaN Invalid_operation
+dqadd37849 fma 1 sNaN sNaN -> NaN Invalid_operation
+dqadd37850 fma 1 NaN sNaN -> NaN Invalid_operation
+dqadd37851 fma 1 -Inf sNaN -> NaN Invalid_operation
+dqadd37852 fma 1 -1000 sNaN -> NaN Invalid_operation
+dqadd37853 fma 1 -1 sNaN -> NaN Invalid_operation
+dqadd37854 fma 1 -0 sNaN -> NaN Invalid_operation
+dqadd37855 fma 1 0 sNaN -> NaN Invalid_operation
+dqadd37856 fma 1 1 sNaN -> NaN Invalid_operation
+dqadd37857 fma 1 1000 sNaN -> NaN Invalid_operation
+dqadd37858 fma 1 Inf sNaN -> NaN Invalid_operation
+dqadd37859 fma 1 NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqadd37861 fma 1 NaN1 -Inf -> NaN1
+dqadd37862 fma 1 +NaN2 -1000 -> NaN2
+dqadd37863 fma 1 NaN3 1000 -> NaN3
+dqadd37864 fma 1 NaN4 Inf -> NaN4
+dqadd37865 fma 1 NaN5 +NaN6 -> NaN5
+dqadd37866 fma 1 -Inf NaN7 -> NaN7
+dqadd37867 fma 1 -1000 NaN8 -> NaN8
+dqadd37868 fma 1 1000 NaN9 -> NaN9
+dqadd37869 fma 1 Inf +NaN10 -> NaN10
+dqadd37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
+dqadd37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
+dqadd37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
+dqadd37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
+dqadd37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqadd37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
+dqadd37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
+dqadd37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
+dqadd37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
+dqadd37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
+dqadd37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqadd37882 fma 1 -NaN26 NaN28 -> -NaN26
+dqadd37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqadd37884 fma 1 1000 -NaN30 -> -NaN30
+dqadd37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Here we explore near the boundary of rounding a subnormal to Nmin
+dqadd37575 fma 1 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal
+dqadd37576 fma 1 -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal
+
+-- check overflow edge case
+-- 1234567890123456
+dqadd37972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqadd37973 fma 1 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37974 fma 1 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37975 fma 1 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded
+dqadd37976 fma 1 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37977 fma 1 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37978 fma 1 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37979 fma 1 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37980 fma 1 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37981 fma 1 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37982 fma 1 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37983 fma 1 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37984 fma 1 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+
+dqadd37985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqadd37986 fma 1 -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37987 fma 1 -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37988 fma 1 -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded
+dqadd37989 fma 1 -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37990 fma 1 -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37991 fma 1 -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37992 fma 1 -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37993 fma 1 -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37994 fma 1 -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37995 fma 1 -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37996 fma 1 -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37997 fma 1 -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+dqadd371100 fma 1 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact
+dqadd371101 fma 1 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact
+dqadd371103 fma 1 +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact
+dqadd371104 fma 1 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact
+dqadd371105 fma 1 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact
+dqadd371106 fma 1 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact
+dqadd371107 fma 1 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact
+dqadd371108 fma 1 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact
+dqadd371109 fma 1 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+dqadd371110 fma 1 -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact
+dqadd371111 fma 1 -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact
+dqadd371113 fma 1 -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact
+dqadd371114 fma 1 -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact
+dqadd371115 fma 1 -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact
+dqadd371116 fma 1 -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact
+dqadd371117 fma 1 -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact
+dqadd371118 fma 1 -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact
+dqadd371119 fma 1 -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+dqadd371300 fma 1 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371310 fma 1 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371311 fma 1 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371312 fma 1 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371313 fma 1 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371314 fma 1 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371315 fma 1 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371316 fma 1 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371317 fma 1 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371318 fma 1 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371319 fma 1 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371320 fma 1 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371321 fma 1 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371322 fma 1 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371323 fma 1 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371324 fma 1 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371325 fma 1 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371326 fma 1 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371327 fma 1 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371328 fma 1 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371329 fma 1 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371330 fma 1 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371331 fma 1 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371332 fma 1 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371333 fma 1 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371334 fma 1 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371335 fma 1 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371336 fma 1 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371337 fma 1 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371338 fma 1 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371339 fma 1 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+
+dqadd371340 fma 1 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded
+dqadd371341 fma 1 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded
+
+dqadd371349 fma 1 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371350 fma 1 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371351 fma 1 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371352 fma 1 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371353 fma 1 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371354 fma 1 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371355 fma 1 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371356 fma 1 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371357 fma 1 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371358 fma 1 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371359 fma 1 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371360 fma 1 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371361 fma 1 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371362 fma 1 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371363 fma 1 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371364 fma 1 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371365 fma 1 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371367 fma 1 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371368 fma 1 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371369 fma 1 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371370 fma 1 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371371 fma 1 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371372 fma 1 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371373 fma 1 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371374 fma 1 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371375 fma 1 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371376 fma 1 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371377 fma 1 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371378 fma 1 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371379 fma 1 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371380 fma 1 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371381 fma 1 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371382 fma 1 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371383 fma 1 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371384 fma 1 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371385 fma 1 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371386 fma 1 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371387 fma 1 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371388 fma 1 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371389 fma 1 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371390 fma 1 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371391 fma 1 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371392 fma 1 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371393 fma 1 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371394 fma 1 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371395 fma 1 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371396 fma 1 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+dqadd371420 fma 1 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345
+dqadd371421 fma 1 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345
+dqadd371422 fma 1 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345
+dqadd371423 fma 1 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345
+dqadd371424 fma 1 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345
+dqadd371425 fma 1 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345
+dqadd371426 fma 1 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345
+dqadd371427 fma 1 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7
+dqadd371428 fma 1 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8
+dqadd371429 fma 1 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9
+dqadd371430 fma 1 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10
+dqadd371431 fma 1 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11
+dqadd371432 fma 1 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12
+dqadd371433 fma 1 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13
+dqadd371434 fma 1 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14
+dqadd371435 fma 1 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15
+dqadd371436 fma 1 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16
+dqadd371437 fma 1 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17
+dqadd371438 fma 1 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18
+dqadd371439 fma 1 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19
+dqadd371440 fma 1 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20
+dqadd371441 fma 1 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21
+dqadd371442 fma 1 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22
+dqadd371443 fma 1 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23
+dqadd371444 fma 1 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24
+dqadd371445 fma 1 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25
+dqadd371446 fma 1 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26
+dqadd371447 fma 1 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27
+dqadd371448 fma 1 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28
+dqadd371449 fma 1 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29
+dqadd371450 fma 1 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30
+dqadd371451 fma 1 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31
+dqadd371452 fma 1 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32
+dqadd371453 fma 1 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33
+dqadd371454 fma 1 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34
+dqadd371455 fma 1 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35
+dqadd371456 fma 1 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36
+
+-- same, reversed 0
+dqadd371460 fma 1 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345
+dqadd371461 fma 1 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345
+dqadd371462 fma 1 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345
+dqadd371463 fma 1 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345
+dqadd371464 fma 1 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345
+dqadd371465 fma 1 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345
+dqadd371466 fma 1 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345
+dqadd371467 fma 1 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7
+dqadd371468 fma 1 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8
+dqadd371469 fma 1 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9
+dqadd371470 fma 1 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10
+dqadd371471 fma 1 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11
+dqadd371472 fma 1 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12
+dqadd371473 fma 1 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13
+dqadd371474 fma 1 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14
+dqadd371475 fma 1 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15
+dqadd371476 fma 1 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16
+dqadd371477 fma 1 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17
+dqadd371478 fma 1 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18
+dqadd371479 fma 1 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19
+dqadd371480 fma 1 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20
+dqadd371481 fma 1 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21
+dqadd371482 fma 1 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22
+dqadd371483 fma 1 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23
+dqadd371484 fma 1 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24
+dqadd371485 fma 1 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25
+dqadd371486 fma 1 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26
+dqadd371487 fma 1 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27
+dqadd371488 fma 1 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28
+dqadd371489 fma 1 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29
+dqadd371490 fma 1 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30
+dqadd371491 fma 1 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31
+dqadd371492 fma 1 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32
+dqadd371493 fma 1 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33
+dqadd371494 fma 1 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34
+dqadd371495 fma 1 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35
+dqadd371496 fma 1 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36
+
+-- same, Es on the 0
+dqadd371500 fma 1 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345
+dqadd371501 fma 1 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345
+dqadd371502 fma 1 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345
+dqadd371503 fma 1 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345
+dqadd371504 fma 1 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345
+dqadd371505 fma 1 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345
+dqadd371506 fma 1 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345
+dqadd371507 fma 1 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345
+dqadd371508 fma 1 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345
+dqadd371509 fma 1 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345
+dqadd371510 fma 1 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345
+dqadd371511 fma 1 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345
+dqadd371512 fma 1 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345
+dqadd371513 fma 1 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345
+dqadd371514 fma 1 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345
+dqadd371515 fma 1 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345
+dqadd371516 fma 1 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345
+dqadd371517 fma 1 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345
+dqadd371518 fma 1 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345
+dqadd371519 fma 1 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345
+dqadd371520 fma 1 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345
+dqadd371521 fma 1 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345
+dqadd371522 fma 1 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345
+dqadd371523 fma 1 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345
+dqadd371524 fma 1 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345
+dqadd371525 fma 1 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345
+dqadd371526 fma 1 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345
+dqadd371527 fma 1 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345
+dqadd371528 fma 1 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345
+dqadd371529 fma 1 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345
+dqadd371530 fma 1 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345
+dqadd371531 fma 1 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345
+dqadd371532 fma 1 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345
+dqadd371533 fma 1 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345
+-- next four flag Rounded because the 0 extends the result
+dqadd371534 fma 1 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded
+dqadd371535 fma 1 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded
+dqadd371536 fma 1 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded
+dqadd371537 fma 1 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+dqadd371600 fma 1 0 0E-19 -> 0E-19
+dqadd371601 fma 1 -0 0E-19 -> 0E-19
+dqadd371602 fma 1 0 -0E-19 -> 0E-19
+dqadd371603 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371611 fma 1 -11 11 -> 0
+dqadd371612 fma 1 11 -11 -> 0
+-- overflow
+dqadd371613 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371614 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: half_down
+-- exact zeros from zeros
+dqadd371620 fma 1 0 0E-19 -> 0E-19
+dqadd371621 fma 1 -0 0E-19 -> 0E-19
+dqadd371622 fma 1 0 -0E-19 -> 0E-19
+dqadd371623 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371631 fma 1 -11 11 -> 0
+dqadd371632 fma 1 11 -11 -> 0
+-- overflow
+dqadd371633 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371634 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: half_even
+-- exact zeros from zeros
+dqadd371640 fma 1 0 0E-19 -> 0E-19
+dqadd371641 fma 1 -0 0E-19 -> 0E-19
+dqadd371642 fma 1 0 -0E-19 -> 0E-19
+dqadd371643 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371651 fma 1 -11 11 -> 0
+dqadd371652 fma 1 11 -11 -> 0
+-- overflow
+dqadd371653 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371654 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: up
+-- exact zeros from zeros
+dqadd371660 fma 1 0 0E-19 -> 0E-19
+dqadd371661 fma 1 -0 0E-19 -> 0E-19
+dqadd371662 fma 1 0 -0E-19 -> 0E-19
+dqadd371663 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371671 fma 1 -11 11 -> 0
+dqadd371672 fma 1 11 -11 -> 0
+-- overflow
+dqadd371673 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371674 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: down
+-- exact zeros from zeros
+dqadd371680 fma 1 0 0E-19 -> 0E-19
+dqadd371681 fma 1 -0 0E-19 -> 0E-19
+dqadd371682 fma 1 0 -0E-19 -> 0E-19
+dqadd371683 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371691 fma 1 -11 11 -> 0
+dqadd371692 fma 1 11 -11 -> 0
+-- overflow
+dqadd371693 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqadd371694 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+
+rounding: ceiling
+-- exact zeros from zeros
+dqadd371700 fma 1 0 0E-19 -> 0E-19
+dqadd371701 fma 1 -0 0E-19 -> 0E-19
+dqadd371702 fma 1 0 -0E-19 -> 0E-19
+dqadd371703 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371711 fma 1 -11 11 -> 0
+dqadd371712 fma 1 11 -11 -> 0
+-- overflow
+dqadd371713 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371714 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+dqadd371720 fma 1 0 0E-19 -> 0E-19
+dqadd371721 fma 1 -0 0E-19 -> -0E-19 -- *
+dqadd371722 fma 1 0 -0E-19 -> -0E-19 -- *
+dqadd371723 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371731 fma 1 -11 11 -> -0 -- *
+dqadd371732 fma 1 11 -11 -> -0 -- *
+-- overflow
+dqadd371733 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqadd371734 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: 05up
+-- exact zeros from zeros
+dqadd371740 fma 1 0 0E-19 -> 0E-19
+dqadd371741 fma 1 -0 0E-19 -> 0E-19
+dqadd371742 fma 1 0 -0E-19 -> 0E-19
+dqadd371743 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371751 fma 1 -11 11 -> 0
+dqadd371752 fma 1 11 -11 -> 0
+-- overflow
+dqadd371753 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqadd371754 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dqadd371761 fma 1 130E-2 120E-2 -> 2.50
+dqadd371762 fma 1 130E-2 12E-1 -> 2.50
+dqadd371763 fma 1 130E-2 1E0 -> 2.30
+dqadd371764 fma 1 1E2 1E4 -> 1.01E+4
+dqadd371765 fma 1 130E-2 -120E-2 -> 0.10
+dqadd371766 fma 1 130E-2 -12E-1 -> 0.10
+dqadd371767 fma 1 130E-2 -1E0 -> 0.30
+dqadd371768 fma 1 1E2 -1E4 -> -9.9E+3
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+dqadd375001 fma 1 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457
+dqadd375002 fma 1 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded
+dqadd375003 fma 1 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375004 fma 1 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375005 fma 1 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375006 fma 1 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375007 fma 1 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375008 fma 1 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375009 fma 1 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375010 fma 1 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375011 fma 1 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375012 fma 1 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375013 fma 1 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375014 fma 1 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375015 fma 1 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375016 fma 1 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375017 fma 1 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375018 fma 1 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375019 fma 1 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375020 fma 1 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375021 fma 1 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded
+
+-- widening second argument at gap
+dqadd375030 fma 1 12398765432112345678945678 1 -> 12398765432112345678945679
+dqadd375031 fma 1 12398765432112345678945678 0.1 -> 12398765432112345678945678.1
+dqadd375032 fma 1 12398765432112345678945678 0.12 -> 12398765432112345678945678.12
+dqadd375033 fma 1 12398765432112345678945678 0.123 -> 12398765432112345678945678.123
+dqadd375034 fma 1 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234
+dqadd375035 fma 1 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345
+dqadd375036 fma 1 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456
+dqadd375037 fma 1 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567
+dqadd375038 fma 1 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678
+dqadd375039 fma 1 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375040 fma 1 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded
+dqadd375041 fma 1 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded
+dqadd375042 fma 1 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375043 fma 1 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375044 fma 1 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375045 fma 1 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375046 fma 1 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375047 fma 1 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375048 fma 1 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375049 fma 1 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+dqadd375050 fma 1 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded
+dqadd375051 fma 1 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded
+dqadd375052 fma 1 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded
+dqadd375053 fma 1 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded
+dqadd375054 fma 1 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded
+dqadd375055 fma 1 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded
+dqadd375056 fma 1 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded
+dqadd375057 fma 1 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded
+dqadd375060 fma 1 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded
+dqadd375061 fma 1 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded
+dqadd375062 fma 1 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded
+dqadd375063 fma 1 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded
+dqadd375064 fma 1 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded
+dqadd375065 fma 1 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded
+dqadd375066 fma 1 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded
+dqadd375067 fma 1 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+dqadd375070 fma 1 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001
+dqadd375071 fma 1 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375072 fma 1 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375073 fma 1 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375074 fma 1 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375075 fma 1 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375076 fma 1 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375077 fma 1 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375078 fma 1 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375079 fma 1 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375080 fma 1 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375081 fma 1 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375082 fma 1 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375083 fma 1 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375084 fma 1 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375085 fma 1 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375086 fma 1 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375087 fma 1 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375088 fma 1 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375089 fma 1 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded
+
+-- Destructive subtract (from remainder tests)
+
+-- +++ some of these will be off-by-one remainder vs remainderNear
+
+dqfma4000 fma -1234567890123456789012345678901233 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> -0.234567890123456789012345678901233
+dqfma4001 fma -1234567890123456789012345678901222 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> -0.34567890123456789012345678901222
+dqfma4002 fma -1234567890123456789012345678901111 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.4567890123456789012345678901111
+dqfma4003 fma -308641972530864197253086419725314 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> -1.308641972530864197253086419725314
+dqfma4004 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692
+dqfma4005 fma -246913578024691357802469135780252 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> -1.3086421975308642197530864219748
+dqfma4006 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247
+dqfma4007 fma -246913578024691357802469135780247 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> -0.753086421975308642197530864219753
+dqfma4008 fma -246913578024691357802469135780247 5.000000000000000000000000000000001 1234567890123456789012345678901234 -> -1.246913578024691357802469135780247
+dqfma4009 fma -246913578024691357802469135780246 5.00000000000000000000000000000001 1234567890123456789012345678901234 -> 1.53086421975308642197530864219754
+dqfma4010 fma -246913578024691357802469135780242 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.6913578024691357802469135780242
+dqfma4011 fma -1234567890123456789012345678901232 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> 0.765432109876543210987654321098768
+dqfma4012 fma -1234567890123456789012345678901221 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> 0.65432109876543210987654321098779
+dqfma4013 fma -1234567890123456789012345678901110 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> 0.5432109876543210987654321098890
+dqfma4014 fma -308641972530864197253086419725313 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> 2.691358027469135802746913580274687
+dqfma4015 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692
+dqfma4016 fma -246913578024691357802469135780251 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> 3.6913578024691357802469135780251
+dqfma4017 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247
+dqfma4018 fma -246913578024691357802469135780246 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> 4.246913578024691357802469135780246
+dqfma4019 fma -246913578024691357802469135780241 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> 4.3086421975308642197530864219759
+
+-- Null tests
+dqadd39990 fma 1 10 # -> NaN Invalid_operation
+dqadd39991 fma 1 # 10 -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/dqInvert.decTest b/Lib/test/decimaltestdata/dqInvert.decTest
index 522cfc80f0..3a1e29e21d 100644
--- a/Lib/test/decimaltestdata/dqInvert.decTest
+++ b/Lib/test/decimaltestdata/dqInvert.decTest
@@ -1,245 +1,245 @@
-------------------------------------------------------------------------
--- dqInvert.decTest -- digitwise logical INVERT for decQuads --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check (truth table)
-dqinv001 invert 0 -> 1111111111111111111111111111111111
-dqinv002 invert 1 -> 1111111111111111111111111111111110
-dqinv003 invert 10 -> 1111111111111111111111111111111101
-dqinv004 invert 111111111 -> 1111111111111111111111111000000000
-dqinv005 invert 000000000 -> 1111111111111111111111111111111111
--- and at msd and msd-1
-dqinv007 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111
-dqinv008 invert 1000000000000000000000000000000000 -> 111111111111111111111111111111111
-dqinv009 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111
-dqinv010 invert 0100000000000000000000000000000000 -> 1011111111111111111111111111111111
-dqinv011 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
-dqinv012 invert 1111111111111111111111111111111111 -> 0
-dqinv013 invert 0011111111111111111111111111111111 -> 1100000000000000000000000000000000
-dqinv014 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
-
--- Various lengths
-dqinv600 invert 0111111111111111111011111111111111 -> 1000000000000000000100000000000000
-dqinv601 invert 0011111111111111110101111111111111 -> 1100000000000000001010000000000000
-dqinv602 invert 0101111111111111101110111111111111 -> 1010000000000000010001000000000000
-dqinv603 invert 0110111111111111011111011111111111 -> 1001000000000000100000100000000000
-dqinv604 invert 0111011111111110111111101111111111 -> 1000100000000001000000010000000000
-dqinv605 invert 0111101111111101111111110111111111 -> 1000010000000010000000001000000000
-dqinv606 invert 0111110111111011111111111011111111 -> 1000001000000100000000000100000000
-dqinv607 invert 0111111011110111111111111101111111 -> 1000000100001000000000000010000000
-dqinv608 invert 0111111101101111111111111110111111 -> 1000000010010000000000000001000000
-dqinv609 invert 0111111110011111111111111111011111 -> 1000000001100000000000000000100000
-dqinv610 invert 0111111110011111111111111111101111 -> 1000000001100000000000000000010000
-dqinv611 invert 0111111101101111111111111111110111 -> 1000000010010000000000000000001000
-dqinv612 invert 0111111011110111111111111111111011 -> 1000000100001000000000000000000100
-dqinv613 invert 0111110111111011111111111111111101 -> 1000001000000100000000000000000010
-dqinv614 invert 0111101111111101111111111111111110 -> 1000010000000010000000000000000001
-dqinv615 invert 0111011111111110111111111111111111 -> 1000100000000001000000000000000000
-dqinv616 invert 0110111111111111011111111111111110 -> 1001000000000000100000000000000001
-dqinv617 invert 0101111111111111101111111111111101 -> 1010000000000000010000000000000010
-dqinv618 invert 0011111111111111110111111111111011 -> 1100000000000000001000000000000100
-dqinv619 invert 0101111111111111111011111111110111 -> 1010000000000000000100000000001000
-dqinv620 invert 0110111111111111111101111111101111 -> 1001000000000000000010000000010000
-dqinv621 invert 0111011111111111111110111111011111 -> 1000100000000000000001000000100000
-dqinv622 invert 0111101111111111111111011110111111 -> 1000010000000000000000100001000000
-dqinv623 invert 0111110111111111111111101101111111 -> 1000001000000000000000010010000000
-dqinv624 invert 0111111011111111111111110011111111 -> 1000000100000000000000001100000000
-dqinv625 invert 0111111101111111111111110011111111 -> 1000000010000000000000001100000000
-dqinv626 invert 0111111110111111111111101101111111 -> 1000000001000000000000010010000000
-dqinv627 invert 0111111111011111111111011110111111 -> 1000000000100000000000100001000000
-dqinv628 invert 0111111111101111111110111111011111 -> 1000000000010000000001000000100000
-dqinv629 invert 0111111111110111111101111111101111 -> 1000000000001000000010000000010000
-dqinv630 invert 0111111111111011111011111111110111 -> 1000000000000100000100000000001000
-dqinv631 invert 0111111111111101110111111111111011 -> 1000000000000010001000000000000100
-dqinv632 invert 0111111111111110101111111111111101 -> 1000000000000001010000000000000010
-dqinv633 invert 0111111111111111011111111111111110 -> 1000000000000000100000000000000001
-
-dqinv021 invert 111111111 -> 1111111111111111111111111000000000
-dqinv022 invert 111111111111 -> 1111111111111111111111000000000000
-dqinv023 invert 11111111 -> 1111111111111111111111111100000000
-dqinv025 invert 1111111 -> 1111111111111111111111111110000000
-dqinv026 invert 111111 -> 1111111111111111111111111111000000
-dqinv027 invert 11111 -> 1111111111111111111111111111100000
-dqinv028 invert 1111 -> 1111111111111111111111111111110000
-dqinv029 invert 111 -> 1111111111111111111111111111111000
-dqinv031 invert 11 -> 1111111111111111111111111111111100
-dqinv032 invert 1 -> 1111111111111111111111111111111110
-dqinv033 invert 111111111111 -> 1111111111111111111111000000000000
-dqinv034 invert 11111111111 -> 1111111111111111111111100000000000
-dqinv035 invert 1111111111 -> 1111111111111111111111110000000000
-dqinv036 invert 111111111 -> 1111111111111111111111111000000000
-
-dqinv040 invert 011111111 -> 1111111111111111111111111100000000
-dqinv041 invert 101111111 -> 1111111111111111111111111010000000
-dqinv042 invert 110111111 -> 1111111111111111111111111001000000
-dqinv043 invert 111011111 -> 1111111111111111111111111000100000
-dqinv044 invert 111101111 -> 1111111111111111111111111000010000
-dqinv045 invert 111110111 -> 1111111111111111111111111000001000
-dqinv046 invert 111111011 -> 1111111111111111111111111000000100
-dqinv047 invert 111111101 -> 1111111111111111111111111000000010
-dqinv048 invert 111111110 -> 1111111111111111111111111000000001
-dqinv049 invert 011111011 -> 1111111111111111111111111100000100
-dqinv050 invert 101111101 -> 1111111111111111111111111010000010
-dqinv051 invert 110111110 -> 1111111111111111111111111001000001
-dqinv052 invert 111011101 -> 1111111111111111111111111000100010
-dqinv053 invert 111101011 -> 1111111111111111111111111000010100
-dqinv054 invert 111110111 -> 1111111111111111111111111000001000
-dqinv055 invert 111101011 -> 1111111111111111111111111000010100
-dqinv056 invert 111011101 -> 1111111111111111111111111000100010
-dqinv057 invert 110111110 -> 1111111111111111111111111001000001
-dqinv058 invert 101111101 -> 1111111111111111111111111010000010
-dqinv059 invert 011111011 -> 1111111111111111111111111100000100
-
-dqinv080 invert 1000000011111111 -> 1111111111111111110111111100000000
-dqinv081 invert 0100000101111111 -> 1111111111111111111011111010000000
-dqinv082 invert 0010000110111111 -> 1111111111111111111101111001000000
-dqinv083 invert 0001000111011111 -> 1111111111111111111110111000100000
-dqinv084 invert 0000100111101111 -> 1111111111111111111111011000010000
-dqinv085 invert 0000010111110111 -> 1111111111111111111111101000001000
-dqinv086 invert 0000001111111011 -> 1111111111111111111111110000000100
-dqinv087 invert 0000010111111101 -> 1111111111111111111111101000000010
-dqinv088 invert 0000100111111110 -> 1111111111111111111111011000000001
-dqinv089 invert 0001000011111011 -> 1111111111111111111110111100000100
-dqinv090 invert 0010000101111101 -> 1111111111111111111101111010000010
-dqinv091 invert 0100000110111110 -> 1111111111111111111011111001000001
-dqinv092 invert 1000000111011101 -> 1111111111111111110111111000100010
-dqinv093 invert 0100000111101011 -> 1111111111111111111011111000010100
-dqinv094 invert 0010000111110111 -> 1111111111111111111101111000001000
-dqinv095 invert 0001000111101011 -> 1111111111111111111110111000010100
-dqinv096 invert 0000100111011101 -> 1111111111111111111111011000100010
-dqinv097 invert 0000010110111110 -> 1111111111111111111111101001000001
-dqinv098 invert 0000001101111101 -> 1111111111111111111111110010000010
-dqinv099 invert 0000010011111011 -> 1111111111111111111111101100000100
-
--- and more thorough MSD/LSD tests [8 and 9 mght be encoded differently...]
-dqinv151 invert 1111111111111111111111111111111110 -> 1
-dqinv152 invert 1111111111111111110000000000000000 -> 1111111111111111
-dqinv153 invert 1000000000000000001111111111111111 -> 111111111111111110000000000000000
-dqinv154 invert 1111111111111111111000000000000000 -> 111111111111111
-dqinv155 invert 0100000000000000000111111111111111 -> 1011111111111111111000000000000000
-dqinv156 invert 1011111111111111110100000000000000 -> 100000000000000001011111111111111
-dqinv157 invert 1101111111111111110111111111111111 -> 10000000000000001000000000000000
-dqinv158 invert 1110111111111111110011111111111111 -> 1000000000000001100000000000000
-
--- non-0/1 should not be accepted, nor should signs
-dqinv220 invert 111111112 -> NaN Invalid_operation
-dqinv221 invert 333333333 -> NaN Invalid_operation
-dqinv222 invert 555555555 -> NaN Invalid_operation
-dqinv223 invert 777777777 -> NaN Invalid_operation
-dqinv224 invert 999999999 -> NaN Invalid_operation
-dqinv225 invert 222222222 -> NaN Invalid_operation
-dqinv226 invert 444444444 -> NaN Invalid_operation
-dqinv227 invert 666666666 -> NaN Invalid_operation
-dqinv228 invert 888888888 -> NaN Invalid_operation
-dqinv229 invert 999999999 -> NaN Invalid_operation
-dqinv230 invert 999999999 -> NaN Invalid_operation
-dqinv231 invert 999999999 -> NaN Invalid_operation
-dqinv232 invert 999999999 -> NaN Invalid_operation
--- a few randoms
-dqinv240 invert 567468689 -> NaN Invalid_operation
-dqinv241 invert 567367689 -> NaN Invalid_operation
-dqinv242 invert -631917772 -> NaN Invalid_operation
-dqinv243 invert -756253257 -> NaN Invalid_operation
-dqinv244 invert 835590149 -> NaN Invalid_operation
--- test MSD
-dqinv250 invert 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv251 invert 3000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv252 invert 4000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv253 invert 5000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv254 invert 6000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv255 invert 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv256 invert 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv257 invert 9000000111000111000111000000000000 -> NaN Invalid_operation
--- test MSD-1
-dqinv270 invert 0200000111000111000111001000000000 -> NaN Invalid_operation
-dqinv271 invert 0300000111000111000111000100000000 -> NaN Invalid_operation
-dqinv272 invert 0400000111000111000111000010000000 -> NaN Invalid_operation
-dqinv273 invert 0500000111000111000111000001000000 -> NaN Invalid_operation
-dqinv274 invert 1600000111000111000111000000100000 -> NaN Invalid_operation
-dqinv275 invert 1700000111000111000111000000010000 -> NaN Invalid_operation
-dqinv276 invert 1800000111000111000111000000001000 -> NaN Invalid_operation
-dqinv277 invert 1900000111000111000111000000000100 -> NaN Invalid_operation
--- test LSD
-dqinv280 invert 0010000111000111000111000000000002 -> NaN Invalid_operation
-dqinv281 invert 0001000111000111000111000000000003 -> NaN Invalid_operation
-dqinv282 invert 0000000111000111000111100000000004 -> NaN Invalid_operation
-dqinv283 invert 0000000111000111000111010000000005 -> NaN Invalid_operation
-dqinv284 invert 1000000111000111000111001000000006 -> NaN Invalid_operation
-dqinv285 invert 1000000111000111000111000100000007 -> NaN Invalid_operation
-dqinv286 invert 1000000111000111000111000010000008 -> NaN Invalid_operation
-dqinv287 invert 1000000111000111000111000001000009 -> NaN Invalid_operation
--- test Middie
-dqinv288 invert 0010000111000111000111000020000000 -> NaN Invalid_operation
-dqinv289 invert 0001000111000111000111000030000001 -> NaN Invalid_operation
-dqinv290 invert 0000000111000111000111100040000010 -> NaN Invalid_operation
-dqinv291 invert 0000000111000111000111010050000100 -> NaN Invalid_operation
-dqinv292 invert 1000000111000111000111001060001000 -> NaN Invalid_operation
-dqinv293 invert 1000000111000111000111000170010000 -> NaN Invalid_operation
-dqinv294 invert 1000000111000111000111000080100000 -> NaN Invalid_operation
-dqinv295 invert 1000000111000111000111000091000000 -> NaN Invalid_operation
--- signs
-dqinv296 invert -1000000111000111000111000001000000 -> NaN Invalid_operation
-dqinv299 invert 1000000111000111000111000001000000 -> 111111000111000111000111110111111
-
--- Nmax, Nmin, Ntiny-like
-dqinv341 invert 9.99999999E+2998 -> NaN Invalid_operation
-dqinv342 invert 1E-2998 -> NaN Invalid_operation
-dqinv343 invert 1.00000000E-2998 -> NaN Invalid_operation
-dqinv344 invert 1E-2078 -> NaN Invalid_operation
-dqinv345 invert -1E-2078 -> NaN Invalid_operation
-dqinv346 invert -1.00000000E-2998 -> NaN Invalid_operation
-dqinv347 invert -1E-2998 -> NaN Invalid_operation
-dqinv348 invert -9.99999999E+2998 -> NaN Invalid_operation
-
--- A few other non-integers
-dqinv361 invert 1.0 -> NaN Invalid_operation
-dqinv362 invert 1E+1 -> NaN Invalid_operation
-dqinv363 invert 0.0 -> NaN Invalid_operation
-dqinv364 invert 0E+1 -> NaN Invalid_operation
-dqinv365 invert 9.9 -> NaN Invalid_operation
-dqinv366 invert 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-dqinv788 invert -Inf -> NaN Invalid_operation
-dqinv794 invert Inf -> NaN Invalid_operation
-dqinv821 invert NaN -> NaN Invalid_operation
-dqinv841 invert sNaN -> NaN Invalid_operation
--- propagating NaNs
-dqinv861 invert NaN1 -> NaN Invalid_operation
-dqinv862 invert +NaN2 -> NaN Invalid_operation
-dqinv863 invert NaN3 -> NaN Invalid_operation
-dqinv864 invert NaN4 -> NaN Invalid_operation
-dqinv865 invert NaN5 -> NaN Invalid_operation
-dqinv871 invert sNaN11 -> NaN Invalid_operation
-dqinv872 invert sNaN12 -> NaN Invalid_operation
-dqinv873 invert sNaN13 -> NaN Invalid_operation
-dqinv874 invert sNaN14 -> NaN Invalid_operation
-dqinv875 invert sNaN15 -> NaN Invalid_operation
-dqinv876 invert NaN16 -> NaN Invalid_operation
-dqinv881 invert +NaN25 -> NaN Invalid_operation
-dqinv882 invert -NaN26 -> NaN Invalid_operation
-dqinv883 invert -sNaN27 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqInvert.decTest -- digitwise logical INVERT for decQuads --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check (truth table)
+dqinv001 invert 0 -> 1111111111111111111111111111111111
+dqinv002 invert 1 -> 1111111111111111111111111111111110
+dqinv003 invert 10 -> 1111111111111111111111111111111101
+dqinv004 invert 111111111 -> 1111111111111111111111111000000000
+dqinv005 invert 000000000 -> 1111111111111111111111111111111111
+-- and at msd and msd-1
+dqinv007 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111
+dqinv008 invert 1000000000000000000000000000000000 -> 111111111111111111111111111111111
+dqinv009 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111
+dqinv010 invert 0100000000000000000000000000000000 -> 1011111111111111111111111111111111
+dqinv011 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
+dqinv012 invert 1111111111111111111111111111111111 -> 0
+dqinv013 invert 0011111111111111111111111111111111 -> 1100000000000000000000000000000000
+dqinv014 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
+
+-- Various lengths
+dqinv600 invert 0111111111111111111011111111111111 -> 1000000000000000000100000000000000
+dqinv601 invert 0011111111111111110101111111111111 -> 1100000000000000001010000000000000
+dqinv602 invert 0101111111111111101110111111111111 -> 1010000000000000010001000000000000
+dqinv603 invert 0110111111111111011111011111111111 -> 1001000000000000100000100000000000
+dqinv604 invert 0111011111111110111111101111111111 -> 1000100000000001000000010000000000
+dqinv605 invert 0111101111111101111111110111111111 -> 1000010000000010000000001000000000
+dqinv606 invert 0111110111111011111111111011111111 -> 1000001000000100000000000100000000
+dqinv607 invert 0111111011110111111111111101111111 -> 1000000100001000000000000010000000
+dqinv608 invert 0111111101101111111111111110111111 -> 1000000010010000000000000001000000
+dqinv609 invert 0111111110011111111111111111011111 -> 1000000001100000000000000000100000
+dqinv610 invert 0111111110011111111111111111101111 -> 1000000001100000000000000000010000
+dqinv611 invert 0111111101101111111111111111110111 -> 1000000010010000000000000000001000
+dqinv612 invert 0111111011110111111111111111111011 -> 1000000100001000000000000000000100
+dqinv613 invert 0111110111111011111111111111111101 -> 1000001000000100000000000000000010
+dqinv614 invert 0111101111111101111111111111111110 -> 1000010000000010000000000000000001
+dqinv615 invert 0111011111111110111111111111111111 -> 1000100000000001000000000000000000
+dqinv616 invert 0110111111111111011111111111111110 -> 1001000000000000100000000000000001
+dqinv617 invert 0101111111111111101111111111111101 -> 1010000000000000010000000000000010
+dqinv618 invert 0011111111111111110111111111111011 -> 1100000000000000001000000000000100
+dqinv619 invert 0101111111111111111011111111110111 -> 1010000000000000000100000000001000
+dqinv620 invert 0110111111111111111101111111101111 -> 1001000000000000000010000000010000
+dqinv621 invert 0111011111111111111110111111011111 -> 1000100000000000000001000000100000
+dqinv622 invert 0111101111111111111111011110111111 -> 1000010000000000000000100001000000
+dqinv623 invert 0111110111111111111111101101111111 -> 1000001000000000000000010010000000
+dqinv624 invert 0111111011111111111111110011111111 -> 1000000100000000000000001100000000
+dqinv625 invert 0111111101111111111111110011111111 -> 1000000010000000000000001100000000
+dqinv626 invert 0111111110111111111111101101111111 -> 1000000001000000000000010010000000
+dqinv627 invert 0111111111011111111111011110111111 -> 1000000000100000000000100001000000
+dqinv628 invert 0111111111101111111110111111011111 -> 1000000000010000000001000000100000
+dqinv629 invert 0111111111110111111101111111101111 -> 1000000000001000000010000000010000
+dqinv630 invert 0111111111111011111011111111110111 -> 1000000000000100000100000000001000
+dqinv631 invert 0111111111111101110111111111111011 -> 1000000000000010001000000000000100
+dqinv632 invert 0111111111111110101111111111111101 -> 1000000000000001010000000000000010
+dqinv633 invert 0111111111111111011111111111111110 -> 1000000000000000100000000000000001
+
+dqinv021 invert 111111111 -> 1111111111111111111111111000000000
+dqinv022 invert 111111111111 -> 1111111111111111111111000000000000
+dqinv023 invert 11111111 -> 1111111111111111111111111100000000
+dqinv025 invert 1111111 -> 1111111111111111111111111110000000
+dqinv026 invert 111111 -> 1111111111111111111111111111000000
+dqinv027 invert 11111 -> 1111111111111111111111111111100000
+dqinv028 invert 1111 -> 1111111111111111111111111111110000
+dqinv029 invert 111 -> 1111111111111111111111111111111000
+dqinv031 invert 11 -> 1111111111111111111111111111111100
+dqinv032 invert 1 -> 1111111111111111111111111111111110
+dqinv033 invert 111111111111 -> 1111111111111111111111000000000000
+dqinv034 invert 11111111111 -> 1111111111111111111111100000000000
+dqinv035 invert 1111111111 -> 1111111111111111111111110000000000
+dqinv036 invert 111111111 -> 1111111111111111111111111000000000
+
+dqinv040 invert 011111111 -> 1111111111111111111111111100000000
+dqinv041 invert 101111111 -> 1111111111111111111111111010000000
+dqinv042 invert 110111111 -> 1111111111111111111111111001000000
+dqinv043 invert 111011111 -> 1111111111111111111111111000100000
+dqinv044 invert 111101111 -> 1111111111111111111111111000010000
+dqinv045 invert 111110111 -> 1111111111111111111111111000001000
+dqinv046 invert 111111011 -> 1111111111111111111111111000000100
+dqinv047 invert 111111101 -> 1111111111111111111111111000000010
+dqinv048 invert 111111110 -> 1111111111111111111111111000000001
+dqinv049 invert 011111011 -> 1111111111111111111111111100000100
+dqinv050 invert 101111101 -> 1111111111111111111111111010000010
+dqinv051 invert 110111110 -> 1111111111111111111111111001000001
+dqinv052 invert 111011101 -> 1111111111111111111111111000100010
+dqinv053 invert 111101011 -> 1111111111111111111111111000010100
+dqinv054 invert 111110111 -> 1111111111111111111111111000001000
+dqinv055 invert 111101011 -> 1111111111111111111111111000010100
+dqinv056 invert 111011101 -> 1111111111111111111111111000100010
+dqinv057 invert 110111110 -> 1111111111111111111111111001000001
+dqinv058 invert 101111101 -> 1111111111111111111111111010000010
+dqinv059 invert 011111011 -> 1111111111111111111111111100000100
+
+dqinv080 invert 1000000011111111 -> 1111111111111111110111111100000000
+dqinv081 invert 0100000101111111 -> 1111111111111111111011111010000000
+dqinv082 invert 0010000110111111 -> 1111111111111111111101111001000000
+dqinv083 invert 0001000111011111 -> 1111111111111111111110111000100000
+dqinv084 invert 0000100111101111 -> 1111111111111111111111011000010000
+dqinv085 invert 0000010111110111 -> 1111111111111111111111101000001000
+dqinv086 invert 0000001111111011 -> 1111111111111111111111110000000100
+dqinv087 invert 0000010111111101 -> 1111111111111111111111101000000010
+dqinv088 invert 0000100111111110 -> 1111111111111111111111011000000001
+dqinv089 invert 0001000011111011 -> 1111111111111111111110111100000100
+dqinv090 invert 0010000101111101 -> 1111111111111111111101111010000010
+dqinv091 invert 0100000110111110 -> 1111111111111111111011111001000001
+dqinv092 invert 1000000111011101 -> 1111111111111111110111111000100010
+dqinv093 invert 0100000111101011 -> 1111111111111111111011111000010100
+dqinv094 invert 0010000111110111 -> 1111111111111111111101111000001000
+dqinv095 invert 0001000111101011 -> 1111111111111111111110111000010100
+dqinv096 invert 0000100111011101 -> 1111111111111111111111011000100010
+dqinv097 invert 0000010110111110 -> 1111111111111111111111101001000001
+dqinv098 invert 0000001101111101 -> 1111111111111111111111110010000010
+dqinv099 invert 0000010011111011 -> 1111111111111111111111101100000100
+
+-- and more thorough MSD/LSD tests [8 and 9 mght be encoded differently...]
+dqinv151 invert 1111111111111111111111111111111110 -> 1
+dqinv152 invert 1111111111111111110000000000000000 -> 1111111111111111
+dqinv153 invert 1000000000000000001111111111111111 -> 111111111111111110000000000000000
+dqinv154 invert 1111111111111111111000000000000000 -> 111111111111111
+dqinv155 invert 0100000000000000000111111111111111 -> 1011111111111111111000000000000000
+dqinv156 invert 1011111111111111110100000000000000 -> 100000000000000001011111111111111
+dqinv157 invert 1101111111111111110111111111111111 -> 10000000000000001000000000000000
+dqinv158 invert 1110111111111111110011111111111111 -> 1000000000000001100000000000000
+
+-- non-0/1 should not be accepted, nor should signs
+dqinv220 invert 111111112 -> NaN Invalid_operation
+dqinv221 invert 333333333 -> NaN Invalid_operation
+dqinv222 invert 555555555 -> NaN Invalid_operation
+dqinv223 invert 777777777 -> NaN Invalid_operation
+dqinv224 invert 999999999 -> NaN Invalid_operation
+dqinv225 invert 222222222 -> NaN Invalid_operation
+dqinv226 invert 444444444 -> NaN Invalid_operation
+dqinv227 invert 666666666 -> NaN Invalid_operation
+dqinv228 invert 888888888 -> NaN Invalid_operation
+dqinv229 invert 999999999 -> NaN Invalid_operation
+dqinv230 invert 999999999 -> NaN Invalid_operation
+dqinv231 invert 999999999 -> NaN Invalid_operation
+dqinv232 invert 999999999 -> NaN Invalid_operation
+-- a few randoms
+dqinv240 invert 567468689 -> NaN Invalid_operation
+dqinv241 invert 567367689 -> NaN Invalid_operation
+dqinv242 invert -631917772 -> NaN Invalid_operation
+dqinv243 invert -756253257 -> NaN Invalid_operation
+dqinv244 invert 835590149 -> NaN Invalid_operation
+-- test MSD
+dqinv250 invert 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv251 invert 3000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv252 invert 4000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv253 invert 5000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv254 invert 6000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv255 invert 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv256 invert 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv257 invert 9000000111000111000111000000000000 -> NaN Invalid_operation
+-- test MSD-1
+dqinv270 invert 0200000111000111000111001000000000 -> NaN Invalid_operation
+dqinv271 invert 0300000111000111000111000100000000 -> NaN Invalid_operation
+dqinv272 invert 0400000111000111000111000010000000 -> NaN Invalid_operation
+dqinv273 invert 0500000111000111000111000001000000 -> NaN Invalid_operation
+dqinv274 invert 1600000111000111000111000000100000 -> NaN Invalid_operation
+dqinv275 invert 1700000111000111000111000000010000 -> NaN Invalid_operation
+dqinv276 invert 1800000111000111000111000000001000 -> NaN Invalid_operation
+dqinv277 invert 1900000111000111000111000000000100 -> NaN Invalid_operation
+-- test LSD
+dqinv280 invert 0010000111000111000111000000000002 -> NaN Invalid_operation
+dqinv281 invert 0001000111000111000111000000000003 -> NaN Invalid_operation
+dqinv282 invert 0000000111000111000111100000000004 -> NaN Invalid_operation
+dqinv283 invert 0000000111000111000111010000000005 -> NaN Invalid_operation
+dqinv284 invert 1000000111000111000111001000000006 -> NaN Invalid_operation
+dqinv285 invert 1000000111000111000111000100000007 -> NaN Invalid_operation
+dqinv286 invert 1000000111000111000111000010000008 -> NaN Invalid_operation
+dqinv287 invert 1000000111000111000111000001000009 -> NaN Invalid_operation
+-- test Middie
+dqinv288 invert 0010000111000111000111000020000000 -> NaN Invalid_operation
+dqinv289 invert 0001000111000111000111000030000001 -> NaN Invalid_operation
+dqinv290 invert 0000000111000111000111100040000010 -> NaN Invalid_operation
+dqinv291 invert 0000000111000111000111010050000100 -> NaN Invalid_operation
+dqinv292 invert 1000000111000111000111001060001000 -> NaN Invalid_operation
+dqinv293 invert 1000000111000111000111000170010000 -> NaN Invalid_operation
+dqinv294 invert 1000000111000111000111000080100000 -> NaN Invalid_operation
+dqinv295 invert 1000000111000111000111000091000000 -> NaN Invalid_operation
+-- signs
+dqinv296 invert -1000000111000111000111000001000000 -> NaN Invalid_operation
+dqinv299 invert 1000000111000111000111000001000000 -> 111111000111000111000111110111111
+
+-- Nmax, Nmin, Ntiny-like
+dqinv341 invert 9.99999999E+2998 -> NaN Invalid_operation
+dqinv342 invert 1E-2998 -> NaN Invalid_operation
+dqinv343 invert 1.00000000E-2998 -> NaN Invalid_operation
+dqinv344 invert 1E-2078 -> NaN Invalid_operation
+dqinv345 invert -1E-2078 -> NaN Invalid_operation
+dqinv346 invert -1.00000000E-2998 -> NaN Invalid_operation
+dqinv347 invert -1E-2998 -> NaN Invalid_operation
+dqinv348 invert -9.99999999E+2998 -> NaN Invalid_operation
+
+-- A few other non-integers
+dqinv361 invert 1.0 -> NaN Invalid_operation
+dqinv362 invert 1E+1 -> NaN Invalid_operation
+dqinv363 invert 0.0 -> NaN Invalid_operation
+dqinv364 invert 0E+1 -> NaN Invalid_operation
+dqinv365 invert 9.9 -> NaN Invalid_operation
+dqinv366 invert 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+dqinv788 invert -Inf -> NaN Invalid_operation
+dqinv794 invert Inf -> NaN Invalid_operation
+dqinv821 invert NaN -> NaN Invalid_operation
+dqinv841 invert sNaN -> NaN Invalid_operation
+-- propagating NaNs
+dqinv861 invert NaN1 -> NaN Invalid_operation
+dqinv862 invert +NaN2 -> NaN Invalid_operation
+dqinv863 invert NaN3 -> NaN Invalid_operation
+dqinv864 invert NaN4 -> NaN Invalid_operation
+dqinv865 invert NaN5 -> NaN Invalid_operation
+dqinv871 invert sNaN11 -> NaN Invalid_operation
+dqinv872 invert sNaN12 -> NaN Invalid_operation
+dqinv873 invert sNaN13 -> NaN Invalid_operation
+dqinv874 invert sNaN14 -> NaN Invalid_operation
+dqinv875 invert sNaN15 -> NaN Invalid_operation
+dqinv876 invert NaN16 -> NaN Invalid_operation
+dqinv881 invert +NaN25 -> NaN Invalid_operation
+dqinv882 invert -NaN26 -> NaN Invalid_operation
+dqinv883 invert -sNaN27 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqLogB.decTest b/Lib/test/decimaltestdata/dqLogB.decTest
index 449f3dcb8d..a18313dc01 100644
--- a/Lib/test/decimaltestdata/dqLogB.decTest
+++ b/Lib/test/decimaltestdata/dqLogB.decTest
@@ -1,160 +1,160 @@
-------------------------------------------------------------------------
--- dqLogB.decTest -- integral 754r adjusted exponent, for decQuads --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- basics
-dqlogb000 logb 0 -> -Infinity Division_by_zero
-dqlogb001 logb 1E-6176 -> -6176
-dqlogb002 logb 1E-6143 -> -6143
-dqlogb003 logb 0.001 -> -3
-dqlogb004 logb 0.03 -> -2
-dqlogb005 logb 1 -> 0
-dqlogb006 logb 2 -> 0
-dqlogb007 logb 2.5 -> 0
-dqlogb008 logb 2.50 -> 0
-dqlogb009 logb 2.500 -> 0
-dqlogb010 logb 10 -> 1
-dqlogb011 logb 70 -> 1
-dqlogb012 logb 100 -> 2
-dqlogb013 logb 250 -> 2
-dqlogb014 logb 9E+6144 -> 6144
-dqlogb015 logb +Infinity -> Infinity
-
--- negatives appear to be treated as positives
-dqlogb021 logb -0 -> -Infinity Division_by_zero
-dqlogb022 logb -1E-6176 -> -6176
-dqlogb023 logb -9E-6143 -> -6143
-dqlogb024 logb -0.001 -> -3
-dqlogb025 logb -1 -> 0
-dqlogb026 logb -2 -> 0
-dqlogb027 logb -10 -> 1
-dqlogb028 logb -70 -> 1
-dqlogb029 logb -100 -> 2
-dqlogb030 logb -9E+6144 -> 6144
-dqlogb031 logb -Infinity -> Infinity
-
--- zeros
-dqlogb111 logb 0 -> -Infinity Division_by_zero
-dqlogb112 logb -0 -> -Infinity Division_by_zero
-dqlogb113 logb 0E+4 -> -Infinity Division_by_zero
-dqlogb114 logb -0E+4 -> -Infinity Division_by_zero
-dqlogb115 logb 0.0000 -> -Infinity Division_by_zero
-dqlogb116 logb -0.0000 -> -Infinity Division_by_zero
-dqlogb117 logb 0E-141 -> -Infinity Division_by_zero
-dqlogb118 logb -0E-141 -> -Infinity Division_by_zero
-
--- full coefficients, alternating bits
-dqlogb121 logb 268268268 -> 8
-dqlogb122 logb -268268268 -> 8
-dqlogb123 logb 134134134 -> 8
-dqlogb124 logb -134134134 -> 8
-
--- Nmax, Nmin, Ntiny
-dqlogb131 logb 9.999999999999999999999999999999999E+6144 -> 6144
-dqlogb132 logb 1E-6143 -> -6143
-dqlogb133 logb 1.000000000000000000000000000000000E-6143 -> -6143
-dqlogb134 logb 1E-6176 -> -6176
-
-dqlogb135 logb -1E-6176 -> -6176
-dqlogb136 logb -1.000000000000000000000000000000000E-6143 -> -6143
-dqlogb137 logb -1E-6143 -> -6143
-dqlogb1614 logb -9.999999999999999999999999999999999E+6144 -> 6144
-
--- ones
-dqlogb0061 logb 1 -> 0
-dqlogb0062 logb 1.0 -> 0
-dqlogb0063 logb 1.000000000000000 -> 0
-
--- notable cases -- exact powers of 10
-dqlogb1100 logb 1 -> 0
-dqlogb1101 logb 10 -> 1
-dqlogb1102 logb 100 -> 2
-dqlogb1103 logb 1000 -> 3
-dqlogb1104 logb 10000 -> 4
-dqlogb1105 logb 100000 -> 5
-dqlogb1106 logb 1000000 -> 6
-dqlogb1107 logb 10000000 -> 7
-dqlogb1108 logb 100000000 -> 8
-dqlogb1109 logb 1000000000 -> 9
-dqlogb1110 logb 10000000000 -> 10
-dqlogb1111 logb 100000000000 -> 11
-dqlogb1112 logb 1000000000000 -> 12
-dqlogb1113 logb 0.00000000001 -> -11
-dqlogb1114 logb 0.0000000001 -> -10
-dqlogb1115 logb 0.000000001 -> -9
-dqlogb1116 logb 0.00000001 -> -8
-dqlogb1117 logb 0.0000001 -> -7
-dqlogb1118 logb 0.000001 -> -6
-dqlogb1119 logb 0.00001 -> -5
-dqlogb1120 logb 0.0001 -> -4
-dqlogb1121 logb 0.001 -> -3
-dqlogb1122 logb 0.01 -> -2
-dqlogb1123 logb 0.1 -> -1
-dqlogb1124 logb 1E-99 -> -99
-dqlogb1125 logb 1E-100 -> -100
-dqlogb1127 logb 1E-299 -> -299
-dqlogb1126 logb 1E-6143 -> -6143
-
--- suggestions from Ilan Nehama
-dqlogb1400 logb 10E-3 -> -2
-dqlogb1401 logb 10E-2 -> -1
-dqlogb1402 logb 100E-2 -> 0
-dqlogb1403 logb 1000E-2 -> 1
-dqlogb1404 logb 10000E-2 -> 2
-dqlogb1405 logb 10E-1 -> 0
-dqlogb1406 logb 100E-1 -> 1
-dqlogb1407 logb 1000E-1 -> 2
-dqlogb1408 logb 10000E-1 -> 3
-dqlogb1409 logb 10E0 -> 1
-dqlogb1410 logb 100E0 -> 2
-dqlogb1411 logb 1000E0 -> 3
-dqlogb1412 logb 10000E0 -> 4
-dqlogb1413 logb 10E1 -> 2
-dqlogb1414 logb 100E1 -> 3
-dqlogb1415 logb 1000E1 -> 4
-dqlogb1416 logb 10000E1 -> 5
-dqlogb1417 logb 10E2 -> 3
-dqlogb1418 logb 100E2 -> 4
-dqlogb1419 logb 1000E2 -> 5
-dqlogb1420 logb 10000E2 -> 6
-
--- special values
-dqlogb820 logb Infinity -> Infinity
-dqlogb821 logb 0 -> -Infinity Division_by_zero
-dqlogb822 logb NaN -> NaN
-dqlogb823 logb sNaN -> NaN Invalid_operation
--- propagating NaNs
-dqlogb824 logb sNaN123 -> NaN123 Invalid_operation
-dqlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
-dqlogb826 logb NaN456 -> NaN456
-dqlogb827 logb -NaN654 -> -NaN654
-dqlogb828 logb NaN1 -> NaN1
-
--- Null test
-dqlogb900 logb # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- dqLogB.decTest -- integral 754r adjusted exponent, for decQuads --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- basics
+dqlogb000 logb 0 -> -Infinity Division_by_zero
+dqlogb001 logb 1E-6176 -> -6176
+dqlogb002 logb 1E-6143 -> -6143
+dqlogb003 logb 0.001 -> -3
+dqlogb004 logb 0.03 -> -2
+dqlogb005 logb 1 -> 0
+dqlogb006 logb 2 -> 0
+dqlogb007 logb 2.5 -> 0
+dqlogb008 logb 2.50 -> 0
+dqlogb009 logb 2.500 -> 0
+dqlogb010 logb 10 -> 1
+dqlogb011 logb 70 -> 1
+dqlogb012 logb 100 -> 2
+dqlogb013 logb 250 -> 2
+dqlogb014 logb 9E+6144 -> 6144
+dqlogb015 logb +Infinity -> Infinity
+
+-- negatives appear to be treated as positives
+dqlogb021 logb -0 -> -Infinity Division_by_zero
+dqlogb022 logb -1E-6176 -> -6176
+dqlogb023 logb -9E-6143 -> -6143
+dqlogb024 logb -0.001 -> -3
+dqlogb025 logb -1 -> 0
+dqlogb026 logb -2 -> 0
+dqlogb027 logb -10 -> 1
+dqlogb028 logb -70 -> 1
+dqlogb029 logb -100 -> 2
+dqlogb030 logb -9E+6144 -> 6144
+dqlogb031 logb -Infinity -> Infinity
+
+-- zeros
+dqlogb111 logb 0 -> -Infinity Division_by_zero
+dqlogb112 logb -0 -> -Infinity Division_by_zero
+dqlogb113 logb 0E+4 -> -Infinity Division_by_zero
+dqlogb114 logb -0E+4 -> -Infinity Division_by_zero
+dqlogb115 logb 0.0000 -> -Infinity Division_by_zero
+dqlogb116 logb -0.0000 -> -Infinity Division_by_zero
+dqlogb117 logb 0E-141 -> -Infinity Division_by_zero
+dqlogb118 logb -0E-141 -> -Infinity Division_by_zero
+
+-- full coefficients, alternating bits
+dqlogb121 logb 268268268 -> 8
+dqlogb122 logb -268268268 -> 8
+dqlogb123 logb 134134134 -> 8
+dqlogb124 logb -134134134 -> 8
+
+-- Nmax, Nmin, Ntiny
+dqlogb131 logb 9.999999999999999999999999999999999E+6144 -> 6144
+dqlogb132 logb 1E-6143 -> -6143
+dqlogb133 logb 1.000000000000000000000000000000000E-6143 -> -6143
+dqlogb134 logb 1E-6176 -> -6176
+
+dqlogb135 logb -1E-6176 -> -6176
+dqlogb136 logb -1.000000000000000000000000000000000E-6143 -> -6143
+dqlogb137 logb -1E-6143 -> -6143
+dqlogb1614 logb -9.999999999999999999999999999999999E+6144 -> 6144
+
+-- ones
+dqlogb0061 logb 1 -> 0
+dqlogb0062 logb 1.0 -> 0
+dqlogb0063 logb 1.000000000000000 -> 0
+
+-- notable cases -- exact powers of 10
+dqlogb1100 logb 1 -> 0
+dqlogb1101 logb 10 -> 1
+dqlogb1102 logb 100 -> 2
+dqlogb1103 logb 1000 -> 3
+dqlogb1104 logb 10000 -> 4
+dqlogb1105 logb 100000 -> 5
+dqlogb1106 logb 1000000 -> 6
+dqlogb1107 logb 10000000 -> 7
+dqlogb1108 logb 100000000 -> 8
+dqlogb1109 logb 1000000000 -> 9
+dqlogb1110 logb 10000000000 -> 10
+dqlogb1111 logb 100000000000 -> 11
+dqlogb1112 logb 1000000000000 -> 12
+dqlogb1113 logb 0.00000000001 -> -11
+dqlogb1114 logb 0.0000000001 -> -10
+dqlogb1115 logb 0.000000001 -> -9
+dqlogb1116 logb 0.00000001 -> -8
+dqlogb1117 logb 0.0000001 -> -7
+dqlogb1118 logb 0.000001 -> -6
+dqlogb1119 logb 0.00001 -> -5
+dqlogb1120 logb 0.0001 -> -4
+dqlogb1121 logb 0.001 -> -3
+dqlogb1122 logb 0.01 -> -2
+dqlogb1123 logb 0.1 -> -1
+dqlogb1124 logb 1E-99 -> -99
+dqlogb1125 logb 1E-100 -> -100
+dqlogb1127 logb 1E-299 -> -299
+dqlogb1126 logb 1E-6143 -> -6143
+
+-- suggestions from Ilan Nehama
+dqlogb1400 logb 10E-3 -> -2
+dqlogb1401 logb 10E-2 -> -1
+dqlogb1402 logb 100E-2 -> 0
+dqlogb1403 logb 1000E-2 -> 1
+dqlogb1404 logb 10000E-2 -> 2
+dqlogb1405 logb 10E-1 -> 0
+dqlogb1406 logb 100E-1 -> 1
+dqlogb1407 logb 1000E-1 -> 2
+dqlogb1408 logb 10000E-1 -> 3
+dqlogb1409 logb 10E0 -> 1
+dqlogb1410 logb 100E0 -> 2
+dqlogb1411 logb 1000E0 -> 3
+dqlogb1412 logb 10000E0 -> 4
+dqlogb1413 logb 10E1 -> 2
+dqlogb1414 logb 100E1 -> 3
+dqlogb1415 logb 1000E1 -> 4
+dqlogb1416 logb 10000E1 -> 5
+dqlogb1417 logb 10E2 -> 3
+dqlogb1418 logb 100E2 -> 4
+dqlogb1419 logb 1000E2 -> 5
+dqlogb1420 logb 10000E2 -> 6
+
+-- special values
+dqlogb820 logb Infinity -> Infinity
+dqlogb821 logb 0 -> -Infinity Division_by_zero
+dqlogb822 logb NaN -> NaN
+dqlogb823 logb sNaN -> NaN Invalid_operation
+-- propagating NaNs
+dqlogb824 logb sNaN123 -> NaN123 Invalid_operation
+dqlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
+dqlogb826 logb NaN456 -> NaN456
+dqlogb827 logb -NaN654 -> -NaN654
+dqlogb828 logb NaN1 -> NaN1
+
+-- Null test
+dqlogb900 logb # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/dqMax.decTest b/Lib/test/decimaltestdata/dqMax.decTest
index 162d4bda3d..dc6a1ab8f8 100644
--- a/Lib/test/decimaltestdata/dqMax.decTest
+++ b/Lib/test/decimaltestdata/dqMax.decTest
@@ -1,322 +1,322 @@
-------------------------------------------------------------------------
--- dqMax.decTest -- decQuad maxnum --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmax001 max -2 -2 -> -2
-dqmax002 max -2 -1 -> -1
-dqmax003 max -2 0 -> 0
-dqmax004 max -2 1 -> 1
-dqmax005 max -2 2 -> 2
-dqmax006 max -1 -2 -> -1
-dqmax007 max -1 -1 -> -1
-dqmax008 max -1 0 -> 0
-dqmax009 max -1 1 -> 1
-dqmax010 max -1 2 -> 2
-dqmax011 max 0 -2 -> 0
-dqmax012 max 0 -1 -> 0
-dqmax013 max 0 0 -> 0
-dqmax014 max 0 1 -> 1
-dqmax015 max 0 2 -> 2
-dqmax016 max 1 -2 -> 1
-dqmax017 max 1 -1 -> 1
-dqmax018 max 1 0 -> 1
-dqmax019 max 1 1 -> 1
-dqmax020 max 1 2 -> 2
-dqmax021 max 2 -2 -> 2
-dqmax022 max 2 -1 -> 2
-dqmax023 max 2 0 -> 2
-dqmax025 max 2 1 -> 2
-dqmax026 max 2 2 -> 2
-
--- extended zeros
-dqmax030 max 0 0 -> 0
-dqmax031 max 0 -0 -> 0
-dqmax032 max 0 -0.0 -> 0
-dqmax033 max 0 0.0 -> 0
-dqmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-dqmax035 max -0 -0 -> -0
-dqmax036 max -0 -0.0 -> -0.0
-dqmax037 max -0 0.0 -> 0.0
-dqmax038 max 0.0 0 -> 0
-dqmax039 max 0.0 -0 -> 0.0
-dqmax040 max 0.0 -0.0 -> 0.0
-dqmax041 max 0.0 0.0 -> 0.0
-dqmax042 max -0.0 0 -> 0
-dqmax043 max -0.0 -0 -> -0.0
-dqmax044 max -0.0 -0.0 -> -0.0
-dqmax045 max -0.0 0.0 -> 0.0
-
-dqmax050 max -0E1 0E1 -> 0E+1
-dqmax051 max -0E2 0E2 -> 0E+2
-dqmax052 max -0E2 0E1 -> 0E+1
-dqmax053 max -0E1 0E2 -> 0E+2
-dqmax054 max 0E1 -0E1 -> 0E+1
-dqmax055 max 0E2 -0E2 -> 0E+2
-dqmax056 max 0E2 -0E1 -> 0E+2
-dqmax057 max 0E1 -0E2 -> 0E+1
-
-dqmax058 max 0E1 0E1 -> 0E+1
-dqmax059 max 0E2 0E2 -> 0E+2
-dqmax060 max 0E2 0E1 -> 0E+2
-dqmax061 max 0E1 0E2 -> 0E+2
-dqmax062 max -0E1 -0E1 -> -0E+1
-dqmax063 max -0E2 -0E2 -> -0E+2
-dqmax064 max -0E2 -0E1 -> -0E+1
-dqmax065 max -0E1 -0E2 -> -0E+1
-
--- Specials
-dqmax090 max Inf -Inf -> Infinity
-dqmax091 max Inf -1000 -> Infinity
-dqmax092 max Inf -1 -> Infinity
-dqmax093 max Inf -0 -> Infinity
-dqmax094 max Inf 0 -> Infinity
-dqmax095 max Inf 1 -> Infinity
-dqmax096 max Inf 1000 -> Infinity
-dqmax097 max Inf Inf -> Infinity
-dqmax098 max -1000 Inf -> Infinity
-dqmax099 max -Inf Inf -> Infinity
-dqmax100 max -1 Inf -> Infinity
-dqmax101 max -0 Inf -> Infinity
-dqmax102 max 0 Inf -> Infinity
-dqmax103 max 1 Inf -> Infinity
-dqmax104 max 1000 Inf -> Infinity
-dqmax105 max Inf Inf -> Infinity
-
-dqmax120 max -Inf -Inf -> -Infinity
-dqmax121 max -Inf -1000 -> -1000
-dqmax122 max -Inf -1 -> -1
-dqmax123 max -Inf -0 -> -0
-dqmax124 max -Inf 0 -> 0
-dqmax125 max -Inf 1 -> 1
-dqmax126 max -Inf 1000 -> 1000
-dqmax127 max -Inf Inf -> Infinity
-dqmax128 max -Inf -Inf -> -Infinity
-dqmax129 max -1000 -Inf -> -1000
-dqmax130 max -1 -Inf -> -1
-dqmax131 max -0 -Inf -> -0
-dqmax132 max 0 -Inf -> 0
-dqmax133 max 1 -Inf -> 1
-dqmax134 max 1000 -Inf -> 1000
-dqmax135 max Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-dqmax141 max NaN -Inf -> -Infinity
-dqmax142 max NaN -1000 -> -1000
-dqmax143 max NaN -1 -> -1
-dqmax144 max NaN -0 -> -0
-dqmax145 max NaN 0 -> 0
-dqmax146 max NaN 1 -> 1
-dqmax147 max NaN 1000 -> 1000
-dqmax148 max NaN Inf -> Infinity
-dqmax149 max NaN NaN -> NaN
-dqmax150 max -Inf NaN -> -Infinity
-dqmax151 max -1000 NaN -> -1000
-dqmax152 max -1 NaN -> -1
-dqmax153 max -0 NaN -> -0
-dqmax154 max 0 NaN -> 0
-dqmax155 max 1 NaN -> 1
-dqmax156 max 1000 NaN -> 1000
-dqmax157 max Inf NaN -> Infinity
-
-dqmax161 max sNaN -Inf -> NaN Invalid_operation
-dqmax162 max sNaN -1000 -> NaN Invalid_operation
-dqmax163 max sNaN -1 -> NaN Invalid_operation
-dqmax164 max sNaN -0 -> NaN Invalid_operation
-dqmax165 max sNaN 0 -> NaN Invalid_operation
-dqmax166 max sNaN 1 -> NaN Invalid_operation
-dqmax167 max sNaN 1000 -> NaN Invalid_operation
-dqmax168 max sNaN NaN -> NaN Invalid_operation
-dqmax169 max sNaN sNaN -> NaN Invalid_operation
-dqmax170 max NaN sNaN -> NaN Invalid_operation
-dqmax171 max -Inf sNaN -> NaN Invalid_operation
-dqmax172 max -1000 sNaN -> NaN Invalid_operation
-dqmax173 max -1 sNaN -> NaN Invalid_operation
-dqmax174 max -0 sNaN -> NaN Invalid_operation
-dqmax175 max 0 sNaN -> NaN Invalid_operation
-dqmax176 max 1 sNaN -> NaN Invalid_operation
-dqmax177 max 1000 sNaN -> NaN Invalid_operation
-dqmax178 max Inf sNaN -> NaN Invalid_operation
-dqmax179 max NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmax181 max NaN9 -Inf -> -Infinity
-dqmax182 max NaN8 9 -> 9
-dqmax183 max -NaN7 Inf -> Infinity
-
-dqmax184 max -NaN1 NaN11 -> -NaN1
-dqmax185 max NaN2 NaN12 -> NaN2
-dqmax186 max -NaN13 -NaN7 -> -NaN13
-dqmax187 max NaN14 -NaN5 -> NaN14
-
-dqmax188 max -Inf NaN4 -> -Infinity
-dqmax189 max -9 -NaN3 -> -9
-dqmax190 max Inf NaN2 -> Infinity
-
-dqmax191 max sNaN99 -Inf -> NaN99 Invalid_operation
-dqmax192 max sNaN98 -1 -> NaN98 Invalid_operation
-dqmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation
-dqmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
-dqmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmax196 max -Inf sNaN92 -> NaN92 Invalid_operation
-dqmax197 max 0 sNaN91 -> NaN91 Invalid_operation
-dqmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmax199 max NaN sNaN89 -> NaN89 Invalid_operation
-
--- old rounding checks
-dqmax221 max 12345678000 1 -> 12345678000
-dqmax222 max 1 12345678000 -> 12345678000
-dqmax223 max 1234567800 1 -> 1234567800
-dqmax224 max 1 1234567800 -> 1234567800
-dqmax225 max 1234567890 1 -> 1234567890
-dqmax226 max 1 1234567890 -> 1234567890
-dqmax227 max 1234567891 1 -> 1234567891
-dqmax228 max 1 1234567891 -> 1234567891
-dqmax229 max 12345678901 1 -> 12345678901
-dqmax230 max 1 12345678901 -> 12345678901
-dqmax231 max 1234567896 1 -> 1234567896
-dqmax232 max 1 1234567896 -> 1234567896
-dqmax233 max -1234567891 1 -> 1
-dqmax234 max 1 -1234567891 -> 1
-dqmax235 max -12345678901 1 -> 1
-dqmax236 max 1 -12345678901 -> 1
-dqmax237 max -1234567896 1 -> 1
-dqmax238 max 1 -1234567896 -> 1
-
--- from examples
-dqmax280 max '3' '2' -> '3'
-dqmax281 max '-10' '3' -> '3'
-dqmax282 max '1.0' '1' -> '1'
-dqmax283 max '1' '1.0' -> '1'
-dqmax284 max '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-dqmax401 max Inf 1.1 -> Infinity
-dqmax402 max 1.1 1 -> 1.1
-dqmax403 max 1 1.0 -> 1
-dqmax404 max 1.0 0.1 -> 1.0
-dqmax405 max 0.1 0.10 -> 0.1
-dqmax406 max 0.10 0.100 -> 0.10
-dqmax407 max 0.10 0 -> 0.10
-dqmax408 max 0 0.0 -> 0
-dqmax409 max 0.0 -0 -> 0.0
-dqmax410 max 0.0 -0.0 -> 0.0
-dqmax411 max 0.00 -0.0 -> 0.00
-dqmax412 max 0.0 -0.00 -> 0.0
-dqmax413 max 0 -0.0 -> 0
-dqmax414 max 0 -0 -> 0
-dqmax415 max -0.0 -0 -> -0.0
-dqmax416 max -0 -0.100 -> -0
-dqmax417 max -0.100 -0.10 -> -0.100
-dqmax418 max -0.10 -0.1 -> -0.10
-dqmax419 max -0.1 -1.0 -> -0.1
-dqmax420 max -1.0 -1 -> -1.0
-dqmax421 max -1 -1.1 -> -1
-dqmax423 max -1.1 -Inf -> -1.1
--- same with operands reversed
-dqmax431 max 1.1 Inf -> Infinity
-dqmax432 max 1 1.1 -> 1.1
-dqmax433 max 1.0 1 -> 1
-dqmax434 max 0.1 1.0 -> 1.0
-dqmax435 max 0.10 0.1 -> 0.1
-dqmax436 max 0.100 0.10 -> 0.10
-dqmax437 max 0 0.10 -> 0.10
-dqmax438 max 0.0 0 -> 0
-dqmax439 max -0 0.0 -> 0.0
-dqmax440 max -0.0 0.0 -> 0.0
-dqmax441 max -0.0 0.00 -> 0.00
-dqmax442 max -0.00 0.0 -> 0.0
-dqmax443 max -0.0 0 -> 0
-dqmax444 max -0 0 -> 0
-dqmax445 max -0 -0.0 -> -0.0
-dqmax446 max -0.100 -0 -> -0
-dqmax447 max -0.10 -0.100 -> -0.100
-dqmax448 max -0.1 -0.10 -> -0.10
-dqmax449 max -1.0 -0.1 -> -0.1
-dqmax450 max -1 -1.0 -> -1.0
-dqmax451 max -1.1 -1 -> -1
-dqmax453 max -Inf -1.1 -> -1.1
--- largies
-dqmax460 max 1000 1E+3 -> 1E+3
-dqmax461 max 1E+3 1000 -> 1E+3
-dqmax462 max 1000 -1E+3 -> 1000
-dqmax463 max 1E+3 -1000 -> 1E+3
-dqmax464 max -1000 1E+3 -> 1E+3
-dqmax465 max -1E+3 1000 -> 1000
-dqmax466 max -1000 -1E+3 -> -1000
-dqmax467 max -1E+3 -1000 -> -1000
-
--- misalignment traps for little-endian
-dqmax471 max 1.0 0.1 -> 1.0
-dqmax472 max 0.1 1.0 -> 1.0
-dqmax473 max 10.0 0.1 -> 10.0
-dqmax474 max 0.1 10.0 -> 10.0
-dqmax475 max 100 1.0 -> 100
-dqmax476 max 1.0 100 -> 100
-dqmax477 max 1000 10.0 -> 1000
-dqmax478 max 10.0 1000 -> 1000
-dqmax479 max 10000 100.0 -> 10000
-dqmax480 max 100.0 10000 -> 10000
-dqmax481 max 100000 1000.0 -> 100000
-dqmax482 max 1000.0 100000 -> 100000
-dqmax483 max 1000000 10000.0 -> 1000000
-dqmax484 max 10000.0 1000000 -> 1000000
-
--- subnormals
-dqmax510 max 1.00E-6143 0 -> 1.00E-6143
-dqmax511 max 0.1E-6143 0 -> 1E-6144 Subnormal
-dqmax512 max 0.10E-6143 0 -> 1.0E-6144 Subnormal
-dqmax513 max 0.100E-6143 0 -> 1.00E-6144 Subnormal
-dqmax514 max 0.01E-6143 0 -> 1E-6145 Subnormal
-dqmax515 max 0.999E-6143 0 -> 9.99E-6144 Subnormal
-dqmax516 max 0.099E-6143 0 -> 9.9E-6145 Subnormal
-dqmax517 max 0.009E-6143 0 -> 9E-6146 Subnormal
-dqmax518 max 0.001E-6143 0 -> 1E-6146 Subnormal
-dqmax519 max 0.0009E-6143 0 -> 9E-6147 Subnormal
-dqmax520 max 0.0001E-6143 0 -> 1E-6147 Subnormal
-
-dqmax530 max -1.00E-6143 0 -> 0
-dqmax531 max -0.1E-6143 0 -> 0
-dqmax532 max -0.10E-6143 0 -> 0
-dqmax533 max -0.100E-6143 0 -> 0
-dqmax534 max -0.01E-6143 0 -> 0
-dqmax535 max -0.999E-6143 0 -> 0
-dqmax536 max -0.099E-6143 0 -> 0
-dqmax537 max -0.009E-6143 0 -> 0
-dqmax538 max -0.001E-6143 0 -> 0
-dqmax539 max -0.0009E-6143 0 -> 0
-dqmax540 max -0.0001E-6143 0 -> 0
-
--- Null tests
-dqmax900 max 10 # -> NaN Invalid_operation
-dqmax901 max # 10 -> NaN Invalid_operation
-
-
-
+------------------------------------------------------------------------
+-- dqMax.decTest -- decQuad maxnum --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmax001 max -2 -2 -> -2
+dqmax002 max -2 -1 -> -1
+dqmax003 max -2 0 -> 0
+dqmax004 max -2 1 -> 1
+dqmax005 max -2 2 -> 2
+dqmax006 max -1 -2 -> -1
+dqmax007 max -1 -1 -> -1
+dqmax008 max -1 0 -> 0
+dqmax009 max -1 1 -> 1
+dqmax010 max -1 2 -> 2
+dqmax011 max 0 -2 -> 0
+dqmax012 max 0 -1 -> 0
+dqmax013 max 0 0 -> 0
+dqmax014 max 0 1 -> 1
+dqmax015 max 0 2 -> 2
+dqmax016 max 1 -2 -> 1
+dqmax017 max 1 -1 -> 1
+dqmax018 max 1 0 -> 1
+dqmax019 max 1 1 -> 1
+dqmax020 max 1 2 -> 2
+dqmax021 max 2 -2 -> 2
+dqmax022 max 2 -1 -> 2
+dqmax023 max 2 0 -> 2
+dqmax025 max 2 1 -> 2
+dqmax026 max 2 2 -> 2
+
+-- extended zeros
+dqmax030 max 0 0 -> 0
+dqmax031 max 0 -0 -> 0
+dqmax032 max 0 -0.0 -> 0
+dqmax033 max 0 0.0 -> 0
+dqmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+dqmax035 max -0 -0 -> -0
+dqmax036 max -0 -0.0 -> -0.0
+dqmax037 max -0 0.0 -> 0.0
+dqmax038 max 0.0 0 -> 0
+dqmax039 max 0.0 -0 -> 0.0
+dqmax040 max 0.0 -0.0 -> 0.0
+dqmax041 max 0.0 0.0 -> 0.0
+dqmax042 max -0.0 0 -> 0
+dqmax043 max -0.0 -0 -> -0.0
+dqmax044 max -0.0 -0.0 -> -0.0
+dqmax045 max -0.0 0.0 -> 0.0
+
+dqmax050 max -0E1 0E1 -> 0E+1
+dqmax051 max -0E2 0E2 -> 0E+2
+dqmax052 max -0E2 0E1 -> 0E+1
+dqmax053 max -0E1 0E2 -> 0E+2
+dqmax054 max 0E1 -0E1 -> 0E+1
+dqmax055 max 0E2 -0E2 -> 0E+2
+dqmax056 max 0E2 -0E1 -> 0E+2
+dqmax057 max 0E1 -0E2 -> 0E+1
+
+dqmax058 max 0E1 0E1 -> 0E+1
+dqmax059 max 0E2 0E2 -> 0E+2
+dqmax060 max 0E2 0E1 -> 0E+2
+dqmax061 max 0E1 0E2 -> 0E+2
+dqmax062 max -0E1 -0E1 -> -0E+1
+dqmax063 max -0E2 -0E2 -> -0E+2
+dqmax064 max -0E2 -0E1 -> -0E+1
+dqmax065 max -0E1 -0E2 -> -0E+1
+
+-- Specials
+dqmax090 max Inf -Inf -> Infinity
+dqmax091 max Inf -1000 -> Infinity
+dqmax092 max Inf -1 -> Infinity
+dqmax093 max Inf -0 -> Infinity
+dqmax094 max Inf 0 -> Infinity
+dqmax095 max Inf 1 -> Infinity
+dqmax096 max Inf 1000 -> Infinity
+dqmax097 max Inf Inf -> Infinity
+dqmax098 max -1000 Inf -> Infinity
+dqmax099 max -Inf Inf -> Infinity
+dqmax100 max -1 Inf -> Infinity
+dqmax101 max -0 Inf -> Infinity
+dqmax102 max 0 Inf -> Infinity
+dqmax103 max 1 Inf -> Infinity
+dqmax104 max 1000 Inf -> Infinity
+dqmax105 max Inf Inf -> Infinity
+
+dqmax120 max -Inf -Inf -> -Infinity
+dqmax121 max -Inf -1000 -> -1000
+dqmax122 max -Inf -1 -> -1
+dqmax123 max -Inf -0 -> -0
+dqmax124 max -Inf 0 -> 0
+dqmax125 max -Inf 1 -> 1
+dqmax126 max -Inf 1000 -> 1000
+dqmax127 max -Inf Inf -> Infinity
+dqmax128 max -Inf -Inf -> -Infinity
+dqmax129 max -1000 -Inf -> -1000
+dqmax130 max -1 -Inf -> -1
+dqmax131 max -0 -Inf -> -0
+dqmax132 max 0 -Inf -> 0
+dqmax133 max 1 -Inf -> 1
+dqmax134 max 1000 -Inf -> 1000
+dqmax135 max Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+dqmax141 max NaN -Inf -> -Infinity
+dqmax142 max NaN -1000 -> -1000
+dqmax143 max NaN -1 -> -1
+dqmax144 max NaN -0 -> -0
+dqmax145 max NaN 0 -> 0
+dqmax146 max NaN 1 -> 1
+dqmax147 max NaN 1000 -> 1000
+dqmax148 max NaN Inf -> Infinity
+dqmax149 max NaN NaN -> NaN
+dqmax150 max -Inf NaN -> -Infinity
+dqmax151 max -1000 NaN -> -1000
+dqmax152 max -1 NaN -> -1
+dqmax153 max -0 NaN -> -0
+dqmax154 max 0 NaN -> 0
+dqmax155 max 1 NaN -> 1
+dqmax156 max 1000 NaN -> 1000
+dqmax157 max Inf NaN -> Infinity
+
+dqmax161 max sNaN -Inf -> NaN Invalid_operation
+dqmax162 max sNaN -1000 -> NaN Invalid_operation
+dqmax163 max sNaN -1 -> NaN Invalid_operation
+dqmax164 max sNaN -0 -> NaN Invalid_operation
+dqmax165 max sNaN 0 -> NaN Invalid_operation
+dqmax166 max sNaN 1 -> NaN Invalid_operation
+dqmax167 max sNaN 1000 -> NaN Invalid_operation
+dqmax168 max sNaN NaN -> NaN Invalid_operation
+dqmax169 max sNaN sNaN -> NaN Invalid_operation
+dqmax170 max NaN sNaN -> NaN Invalid_operation
+dqmax171 max -Inf sNaN -> NaN Invalid_operation
+dqmax172 max -1000 sNaN -> NaN Invalid_operation
+dqmax173 max -1 sNaN -> NaN Invalid_operation
+dqmax174 max -0 sNaN -> NaN Invalid_operation
+dqmax175 max 0 sNaN -> NaN Invalid_operation
+dqmax176 max 1 sNaN -> NaN Invalid_operation
+dqmax177 max 1000 sNaN -> NaN Invalid_operation
+dqmax178 max Inf sNaN -> NaN Invalid_operation
+dqmax179 max NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmax181 max NaN9 -Inf -> -Infinity
+dqmax182 max NaN8 9 -> 9
+dqmax183 max -NaN7 Inf -> Infinity
+
+dqmax184 max -NaN1 NaN11 -> -NaN1
+dqmax185 max NaN2 NaN12 -> NaN2
+dqmax186 max -NaN13 -NaN7 -> -NaN13
+dqmax187 max NaN14 -NaN5 -> NaN14
+
+dqmax188 max -Inf NaN4 -> -Infinity
+dqmax189 max -9 -NaN3 -> -9
+dqmax190 max Inf NaN2 -> Infinity
+
+dqmax191 max sNaN99 -Inf -> NaN99 Invalid_operation
+dqmax192 max sNaN98 -1 -> NaN98 Invalid_operation
+dqmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation
+dqmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
+dqmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmax196 max -Inf sNaN92 -> NaN92 Invalid_operation
+dqmax197 max 0 sNaN91 -> NaN91 Invalid_operation
+dqmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmax199 max NaN sNaN89 -> NaN89 Invalid_operation
+
+-- old rounding checks
+dqmax221 max 12345678000 1 -> 12345678000
+dqmax222 max 1 12345678000 -> 12345678000
+dqmax223 max 1234567800 1 -> 1234567800
+dqmax224 max 1 1234567800 -> 1234567800
+dqmax225 max 1234567890 1 -> 1234567890
+dqmax226 max 1 1234567890 -> 1234567890
+dqmax227 max 1234567891 1 -> 1234567891
+dqmax228 max 1 1234567891 -> 1234567891
+dqmax229 max 12345678901 1 -> 12345678901
+dqmax230 max 1 12345678901 -> 12345678901
+dqmax231 max 1234567896 1 -> 1234567896
+dqmax232 max 1 1234567896 -> 1234567896
+dqmax233 max -1234567891 1 -> 1
+dqmax234 max 1 -1234567891 -> 1
+dqmax235 max -12345678901 1 -> 1
+dqmax236 max 1 -12345678901 -> 1
+dqmax237 max -1234567896 1 -> 1
+dqmax238 max 1 -1234567896 -> 1
+
+-- from examples
+dqmax280 max '3' '2' -> '3'
+dqmax281 max '-10' '3' -> '3'
+dqmax282 max '1.0' '1' -> '1'
+dqmax283 max '1' '1.0' -> '1'
+dqmax284 max '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+dqmax401 max Inf 1.1 -> Infinity
+dqmax402 max 1.1 1 -> 1.1
+dqmax403 max 1 1.0 -> 1
+dqmax404 max 1.0 0.1 -> 1.0
+dqmax405 max 0.1 0.10 -> 0.1
+dqmax406 max 0.10 0.100 -> 0.10
+dqmax407 max 0.10 0 -> 0.10
+dqmax408 max 0 0.0 -> 0
+dqmax409 max 0.0 -0 -> 0.0
+dqmax410 max 0.0 -0.0 -> 0.0
+dqmax411 max 0.00 -0.0 -> 0.00
+dqmax412 max 0.0 -0.00 -> 0.0
+dqmax413 max 0 -0.0 -> 0
+dqmax414 max 0 -0 -> 0
+dqmax415 max -0.0 -0 -> -0.0
+dqmax416 max -0 -0.100 -> -0
+dqmax417 max -0.100 -0.10 -> -0.100
+dqmax418 max -0.10 -0.1 -> -0.10
+dqmax419 max -0.1 -1.0 -> -0.1
+dqmax420 max -1.0 -1 -> -1.0
+dqmax421 max -1 -1.1 -> -1
+dqmax423 max -1.1 -Inf -> -1.1
+-- same with operands reversed
+dqmax431 max 1.1 Inf -> Infinity
+dqmax432 max 1 1.1 -> 1.1
+dqmax433 max 1.0 1 -> 1
+dqmax434 max 0.1 1.0 -> 1.0
+dqmax435 max 0.10 0.1 -> 0.1
+dqmax436 max 0.100 0.10 -> 0.10
+dqmax437 max 0 0.10 -> 0.10
+dqmax438 max 0.0 0 -> 0
+dqmax439 max -0 0.0 -> 0.0
+dqmax440 max -0.0 0.0 -> 0.0
+dqmax441 max -0.0 0.00 -> 0.00
+dqmax442 max -0.00 0.0 -> 0.0
+dqmax443 max -0.0 0 -> 0
+dqmax444 max -0 0 -> 0
+dqmax445 max -0 -0.0 -> -0.0
+dqmax446 max -0.100 -0 -> -0
+dqmax447 max -0.10 -0.100 -> -0.100
+dqmax448 max -0.1 -0.10 -> -0.10
+dqmax449 max -1.0 -0.1 -> -0.1
+dqmax450 max -1 -1.0 -> -1.0
+dqmax451 max -1.1 -1 -> -1
+dqmax453 max -Inf -1.1 -> -1.1
+-- largies
+dqmax460 max 1000 1E+3 -> 1E+3
+dqmax461 max 1E+3 1000 -> 1E+3
+dqmax462 max 1000 -1E+3 -> 1000
+dqmax463 max 1E+3 -1000 -> 1E+3
+dqmax464 max -1000 1E+3 -> 1E+3
+dqmax465 max -1E+3 1000 -> 1000
+dqmax466 max -1000 -1E+3 -> -1000
+dqmax467 max -1E+3 -1000 -> -1000
+
+-- misalignment traps for little-endian
+dqmax471 max 1.0 0.1 -> 1.0
+dqmax472 max 0.1 1.0 -> 1.0
+dqmax473 max 10.0 0.1 -> 10.0
+dqmax474 max 0.1 10.0 -> 10.0
+dqmax475 max 100 1.0 -> 100
+dqmax476 max 1.0 100 -> 100
+dqmax477 max 1000 10.0 -> 1000
+dqmax478 max 10.0 1000 -> 1000
+dqmax479 max 10000 100.0 -> 10000
+dqmax480 max 100.0 10000 -> 10000
+dqmax481 max 100000 1000.0 -> 100000
+dqmax482 max 1000.0 100000 -> 100000
+dqmax483 max 1000000 10000.0 -> 1000000
+dqmax484 max 10000.0 1000000 -> 1000000
+
+-- subnormals
+dqmax510 max 1.00E-6143 0 -> 1.00E-6143
+dqmax511 max 0.1E-6143 0 -> 1E-6144 Subnormal
+dqmax512 max 0.10E-6143 0 -> 1.0E-6144 Subnormal
+dqmax513 max 0.100E-6143 0 -> 1.00E-6144 Subnormal
+dqmax514 max 0.01E-6143 0 -> 1E-6145 Subnormal
+dqmax515 max 0.999E-6143 0 -> 9.99E-6144 Subnormal
+dqmax516 max 0.099E-6143 0 -> 9.9E-6145 Subnormal
+dqmax517 max 0.009E-6143 0 -> 9E-6146 Subnormal
+dqmax518 max 0.001E-6143 0 -> 1E-6146 Subnormal
+dqmax519 max 0.0009E-6143 0 -> 9E-6147 Subnormal
+dqmax520 max 0.0001E-6143 0 -> 1E-6147 Subnormal
+
+dqmax530 max -1.00E-6143 0 -> 0
+dqmax531 max -0.1E-6143 0 -> 0
+dqmax532 max -0.10E-6143 0 -> 0
+dqmax533 max -0.100E-6143 0 -> 0
+dqmax534 max -0.01E-6143 0 -> 0
+dqmax535 max -0.999E-6143 0 -> 0
+dqmax536 max -0.099E-6143 0 -> 0
+dqmax537 max -0.009E-6143 0 -> 0
+dqmax538 max -0.001E-6143 0 -> 0
+dqmax539 max -0.0009E-6143 0 -> 0
+dqmax540 max -0.0001E-6143 0 -> 0
+
+-- Null tests
+dqmax900 max 10 # -> NaN Invalid_operation
+dqmax901 max # 10 -> NaN Invalid_operation
+
+
+
diff --git a/Lib/test/decimaltestdata/dqMaxMag.decTest b/Lib/test/decimaltestdata/dqMaxMag.decTest
index 6621e80d92..6f5be24609 100644
--- a/Lib/test/decimaltestdata/dqMaxMag.decTest
+++ b/Lib/test/decimaltestdata/dqMaxMag.decTest
@@ -1,304 +1,304 @@
-------------------------------------------------------------------------
--- dqMaxMag.decTest -- decQuad maxnummag --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmxg001 maxmag -2 -2 -> -2
-dqmxg002 maxmag -2 -1 -> -2
-dqmxg003 maxmag -2 0 -> -2
-dqmxg004 maxmag -2 1 -> -2
-dqmxg005 maxmag -2 2 -> 2
-dqmxg006 maxmag -1 -2 -> -2
-dqmxg007 maxmag -1 -1 -> -1
-dqmxg008 maxmag -1 0 -> -1
-dqmxg009 maxmag -1 1 -> 1
-dqmxg010 maxmag -1 2 -> 2
-dqmxg011 maxmag 0 -2 -> -2
-dqmxg012 maxmag 0 -1 -> -1
-dqmxg013 maxmag 0 0 -> 0
-dqmxg014 maxmag 0 1 -> 1
-dqmxg015 maxmag 0 2 -> 2
-dqmxg016 maxmag 1 -2 -> -2
-dqmxg017 maxmag 1 -1 -> 1
-dqmxg018 maxmag 1 0 -> 1
-dqmxg019 maxmag 1 1 -> 1
-dqmxg020 maxmag 1 2 -> 2
-dqmxg021 maxmag 2 -2 -> 2
-dqmxg022 maxmag 2 -1 -> 2
-dqmxg023 maxmag 2 0 -> 2
-dqmxg025 maxmag 2 1 -> 2
-dqmxg026 maxmag 2 2 -> 2
-
--- extended zeros
-dqmxg030 maxmag 0 0 -> 0
-dqmxg031 maxmag 0 -0 -> 0
-dqmxg032 maxmag 0 -0.0 -> 0
-dqmxg033 maxmag 0 0.0 -> 0
-dqmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-dqmxg035 maxmag -0 -0 -> -0
-dqmxg036 maxmag -0 -0.0 -> -0.0
-dqmxg037 maxmag -0 0.0 -> 0.0
-dqmxg038 maxmag 0.0 0 -> 0
-dqmxg039 maxmag 0.0 -0 -> 0.0
-dqmxg040 maxmag 0.0 -0.0 -> 0.0
-dqmxg041 maxmag 0.0 0.0 -> 0.0
-dqmxg042 maxmag -0.0 0 -> 0
-dqmxg043 maxmag -0.0 -0 -> -0.0
-dqmxg044 maxmag -0.0 -0.0 -> -0.0
-dqmxg045 maxmag -0.0 0.0 -> 0.0
-
-dqmxg050 maxmag -0E1 0E1 -> 0E+1
-dqmxg051 maxmag -0E2 0E2 -> 0E+2
-dqmxg052 maxmag -0E2 0E1 -> 0E+1
-dqmxg053 maxmag -0E1 0E2 -> 0E+2
-dqmxg054 maxmag 0E1 -0E1 -> 0E+1
-dqmxg055 maxmag 0E2 -0E2 -> 0E+2
-dqmxg056 maxmag 0E2 -0E1 -> 0E+2
-dqmxg057 maxmag 0E1 -0E2 -> 0E+1
-
-dqmxg058 maxmag 0E1 0E1 -> 0E+1
-dqmxg059 maxmag 0E2 0E2 -> 0E+2
-dqmxg060 maxmag 0E2 0E1 -> 0E+2
-dqmxg061 maxmag 0E1 0E2 -> 0E+2
-dqmxg062 maxmag -0E1 -0E1 -> -0E+1
-dqmxg063 maxmag -0E2 -0E2 -> -0E+2
-dqmxg064 maxmag -0E2 -0E1 -> -0E+1
-dqmxg065 maxmag -0E1 -0E2 -> -0E+1
-
--- Specials
-dqmxg090 maxmag Inf -Inf -> Infinity
-dqmxg091 maxmag Inf -1000 -> Infinity
-dqmxg092 maxmag Inf -1 -> Infinity
-dqmxg093 maxmag Inf -0 -> Infinity
-dqmxg094 maxmag Inf 0 -> Infinity
-dqmxg095 maxmag Inf 1 -> Infinity
-dqmxg096 maxmag Inf 1000 -> Infinity
-dqmxg097 maxmag Inf Inf -> Infinity
-dqmxg098 maxmag -1000 Inf -> Infinity
-dqmxg099 maxmag -Inf Inf -> Infinity
-dqmxg100 maxmag -1 Inf -> Infinity
-dqmxg101 maxmag -0 Inf -> Infinity
-dqmxg102 maxmag 0 Inf -> Infinity
-dqmxg103 maxmag 1 Inf -> Infinity
-dqmxg104 maxmag 1000 Inf -> Infinity
-dqmxg105 maxmag Inf Inf -> Infinity
-
-dqmxg120 maxmag -Inf -Inf -> -Infinity
-dqmxg121 maxmag -Inf -1000 -> -Infinity
-dqmxg122 maxmag -Inf -1 -> -Infinity
-dqmxg123 maxmag -Inf -0 -> -Infinity
-dqmxg124 maxmag -Inf 0 -> -Infinity
-dqmxg125 maxmag -Inf 1 -> -Infinity
-dqmxg126 maxmag -Inf 1000 -> -Infinity
-dqmxg127 maxmag -Inf Inf -> Infinity
-dqmxg128 maxmag -Inf -Inf -> -Infinity
-dqmxg129 maxmag -1000 -Inf -> -Infinity
-dqmxg130 maxmag -1 -Inf -> -Infinity
-dqmxg131 maxmag -0 -Inf -> -Infinity
-dqmxg132 maxmag 0 -Inf -> -Infinity
-dqmxg133 maxmag 1 -Inf -> -Infinity
-dqmxg134 maxmag 1000 -Inf -> -Infinity
-dqmxg135 maxmag Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-dqmxg141 maxmag NaN -Inf -> -Infinity
-dqmxg142 maxmag NaN -1000 -> -1000
-dqmxg143 maxmag NaN -1 -> -1
-dqmxg144 maxmag NaN -0 -> -0
-dqmxg145 maxmag NaN 0 -> 0
-dqmxg146 maxmag NaN 1 -> 1
-dqmxg147 maxmag NaN 1000 -> 1000
-dqmxg148 maxmag NaN Inf -> Infinity
-dqmxg149 maxmag NaN NaN -> NaN
-dqmxg150 maxmag -Inf NaN -> -Infinity
-dqmxg151 maxmag -1000 NaN -> -1000
-dqmxg152 maxmag -1 NaN -> -1
-dqmxg153 maxmag -0 NaN -> -0
-dqmxg154 maxmag 0 NaN -> 0
-dqmxg155 maxmag 1 NaN -> 1
-dqmxg156 maxmag 1000 NaN -> 1000
-dqmxg157 maxmag Inf NaN -> Infinity
-
-dqmxg161 maxmag sNaN -Inf -> NaN Invalid_operation
-dqmxg162 maxmag sNaN -1000 -> NaN Invalid_operation
-dqmxg163 maxmag sNaN -1 -> NaN Invalid_operation
-dqmxg164 maxmag sNaN -0 -> NaN Invalid_operation
-dqmxg165 maxmag sNaN 0 -> NaN Invalid_operation
-dqmxg166 maxmag sNaN 1 -> NaN Invalid_operation
-dqmxg167 maxmag sNaN 1000 -> NaN Invalid_operation
-dqmxg168 maxmag sNaN NaN -> NaN Invalid_operation
-dqmxg169 maxmag sNaN sNaN -> NaN Invalid_operation
-dqmxg170 maxmag NaN sNaN -> NaN Invalid_operation
-dqmxg171 maxmag -Inf sNaN -> NaN Invalid_operation
-dqmxg172 maxmag -1000 sNaN -> NaN Invalid_operation
-dqmxg173 maxmag -1 sNaN -> NaN Invalid_operation
-dqmxg174 maxmag -0 sNaN -> NaN Invalid_operation
-dqmxg175 maxmag 0 sNaN -> NaN Invalid_operation
-dqmxg176 maxmag 1 sNaN -> NaN Invalid_operation
-dqmxg177 maxmag 1000 sNaN -> NaN Invalid_operation
-dqmxg178 maxmag Inf sNaN -> NaN Invalid_operation
-dqmxg179 maxmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmxg181 maxmag NaN9 -Inf -> -Infinity
-dqmxg182 maxmag NaN8 9 -> 9
-dqmxg183 maxmag -NaN7 Inf -> Infinity
-
-dqmxg184 maxmag -NaN1 NaN11 -> -NaN1
-dqmxg185 maxmag NaN2 NaN12 -> NaN2
-dqmxg186 maxmag -NaN13 -NaN7 -> -NaN13
-dqmxg187 maxmag NaN14 -NaN5 -> NaN14
-
-dqmxg188 maxmag -Inf NaN4 -> -Infinity
-dqmxg189 maxmag -9 -NaN3 -> -9
-dqmxg190 maxmag Inf NaN2 -> Infinity
-
-dqmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
-dqmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
-dqmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
-dqmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
-dqmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
-dqmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
-dqmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
-
--- old rounding checks
-dqmxg221 maxmag 12345678000 1 -> 12345678000
-dqmxg222 maxmag 1 12345678000 -> 12345678000
-dqmxg223 maxmag 1234567800 1 -> 1234567800
-dqmxg224 maxmag 1 1234567800 -> 1234567800
-dqmxg225 maxmag 1234567890 1 -> 1234567890
-dqmxg226 maxmag 1 1234567890 -> 1234567890
-dqmxg227 maxmag 1234567891 1 -> 1234567891
-dqmxg228 maxmag 1 1234567891 -> 1234567891
-dqmxg229 maxmag 12345678901 1 -> 12345678901
-dqmxg230 maxmag 1 12345678901 -> 12345678901
-dqmxg231 maxmag 1234567896 1 -> 1234567896
-dqmxg232 maxmag 1 1234567896 -> 1234567896
-dqmxg233 maxmag -1234567891 1 -> -1234567891
-dqmxg234 maxmag 1 -1234567891 -> -1234567891
-dqmxg235 maxmag -12345678901 1 -> -12345678901
-dqmxg236 maxmag 1 -12345678901 -> -12345678901
-dqmxg237 maxmag -1234567896 1 -> -1234567896
-dqmxg238 maxmag 1 -1234567896 -> -1234567896
-
--- from examples
-dqmxg280 maxmag '3' '2' -> '3'
-dqmxg281 maxmag '-10' '3' -> '-10'
-dqmxg282 maxmag '1.0' '1' -> '1'
-dqmxg283 maxmag '1' '1.0' -> '1'
-dqmxg284 maxmag '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-dqmxg401 maxmag Inf 1.1 -> Infinity
-dqmxg402 maxmag 1.1 1 -> 1.1
-dqmxg403 maxmag 1 1.0 -> 1
-dqmxg404 maxmag 1.0 0.1 -> 1.0
-dqmxg405 maxmag 0.1 0.10 -> 0.1
-dqmxg406 maxmag 0.10 0.100 -> 0.10
-dqmxg407 maxmag 0.10 0 -> 0.10
-dqmxg408 maxmag 0 0.0 -> 0
-dqmxg409 maxmag 0.0 -0 -> 0.0
-dqmxg410 maxmag 0.0 -0.0 -> 0.0
-dqmxg411 maxmag 0.00 -0.0 -> 0.00
-dqmxg412 maxmag 0.0 -0.00 -> 0.0
-dqmxg413 maxmag 0 -0.0 -> 0
-dqmxg414 maxmag 0 -0 -> 0
-dqmxg415 maxmag -0.0 -0 -> -0.0
-dqmxg416 maxmag -0 -0.100 -> -0.100
-dqmxg417 maxmag -0.100 -0.10 -> -0.100
-dqmxg418 maxmag -0.10 -0.1 -> -0.10
-dqmxg419 maxmag -0.1 -1.0 -> -1.0
-dqmxg420 maxmag -1.0 -1 -> -1.0
-dqmxg421 maxmag -1 -1.1 -> -1.1
-dqmxg423 maxmag -1.1 -Inf -> -Infinity
--- same with operands reversed
-dqmxg431 maxmag 1.1 Inf -> Infinity
-dqmxg432 maxmag 1 1.1 -> 1.1
-dqmxg433 maxmag 1.0 1 -> 1
-dqmxg434 maxmag 0.1 1.0 -> 1.0
-dqmxg435 maxmag 0.10 0.1 -> 0.1
-dqmxg436 maxmag 0.100 0.10 -> 0.10
-dqmxg437 maxmag 0 0.10 -> 0.10
-dqmxg438 maxmag 0.0 0 -> 0
-dqmxg439 maxmag -0 0.0 -> 0.0
-dqmxg440 maxmag -0.0 0.0 -> 0.0
-dqmxg441 maxmag -0.0 0.00 -> 0.00
-dqmxg442 maxmag -0.00 0.0 -> 0.0
-dqmxg443 maxmag -0.0 0 -> 0
-dqmxg444 maxmag -0 0 -> 0
-dqmxg445 maxmag -0 -0.0 -> -0.0
-dqmxg446 maxmag -0.100 -0 -> -0.100
-dqmxg447 maxmag -0.10 -0.100 -> -0.100
-dqmxg448 maxmag -0.1 -0.10 -> -0.10
-dqmxg449 maxmag -1.0 -0.1 -> -1.0
-dqmxg450 maxmag -1 -1.0 -> -1.0
-dqmxg451 maxmag -1.1 -1 -> -1.1
-dqmxg453 maxmag -Inf -1.1 -> -Infinity
--- largies
-dqmxg460 maxmag 1000 1E+3 -> 1E+3
-dqmxg461 maxmag 1E+3 1000 -> 1E+3
-dqmxg462 maxmag 1000 -1E+3 -> 1000
-dqmxg463 maxmag 1E+3 -1000 -> 1E+3
-dqmxg464 maxmag -1000 1E+3 -> 1E+3
-dqmxg465 maxmag -1E+3 1000 -> 1000
-dqmxg466 maxmag -1000 -1E+3 -> -1000
-dqmxg467 maxmag -1E+3 -1000 -> -1000
-
--- subnormals
-dqmxg510 maxmag 1.00E-6143 0 -> 1.00E-6143
-dqmxg511 maxmag 0.1E-6143 0 -> 1E-6144 Subnormal
-dqmxg512 maxmag 0.10E-6143 0 -> 1.0E-6144 Subnormal
-dqmxg513 maxmag 0.100E-6143 0 -> 1.00E-6144 Subnormal
-dqmxg514 maxmag 0.01E-6143 0 -> 1E-6145 Subnormal
-dqmxg515 maxmag 0.999E-6143 0 -> 9.99E-6144 Subnormal
-dqmxg516 maxmag 0.099E-6143 0 -> 9.9E-6145 Subnormal
-dqmxg517 maxmag 0.009E-6143 0 -> 9E-6146 Subnormal
-dqmxg518 maxmag 0.001E-6143 0 -> 1E-6146 Subnormal
-dqmxg519 maxmag 0.0009E-6143 0 -> 9E-6147 Subnormal
-dqmxg520 maxmag 0.0001E-6143 0 -> 1E-6147 Subnormal
-
-dqmxg530 maxmag -1.00E-6143 0 -> -1.00E-6143
-dqmxg531 maxmag -0.1E-6143 0 -> -1E-6144 Subnormal
-dqmxg532 maxmag -0.10E-6143 0 -> -1.0E-6144 Subnormal
-dqmxg533 maxmag -0.100E-6143 0 -> -1.00E-6144 Subnormal
-dqmxg534 maxmag -0.01E-6143 0 -> -1E-6145 Subnormal
-dqmxg535 maxmag -0.999E-6143 0 -> -9.99E-6144 Subnormal
-dqmxg536 maxmag -0.099E-6143 0 -> -9.9E-6145 Subnormal
-dqmxg537 maxmag -0.009E-6143 0 -> -9E-6146 Subnormal
-dqmxg538 maxmag -0.001E-6143 0 -> -1E-6146 Subnormal
-dqmxg539 maxmag -0.0009E-6143 0 -> -9E-6147 Subnormal
-dqmxg540 maxmag -0.0001E-6143 0 -> -1E-6147 Subnormal
-
--- Null tests
-dqmxg900 maxmag 10 # -> NaN Invalid_operation
-dqmxg901 maxmag # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqMaxMag.decTest -- decQuad maxnummag --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmxg001 maxmag -2 -2 -> -2
+dqmxg002 maxmag -2 -1 -> -2
+dqmxg003 maxmag -2 0 -> -2
+dqmxg004 maxmag -2 1 -> -2
+dqmxg005 maxmag -2 2 -> 2
+dqmxg006 maxmag -1 -2 -> -2
+dqmxg007 maxmag -1 -1 -> -1
+dqmxg008 maxmag -1 0 -> -1
+dqmxg009 maxmag -1 1 -> 1
+dqmxg010 maxmag -1 2 -> 2
+dqmxg011 maxmag 0 -2 -> -2
+dqmxg012 maxmag 0 -1 -> -1
+dqmxg013 maxmag 0 0 -> 0
+dqmxg014 maxmag 0 1 -> 1
+dqmxg015 maxmag 0 2 -> 2
+dqmxg016 maxmag 1 -2 -> -2
+dqmxg017 maxmag 1 -1 -> 1
+dqmxg018 maxmag 1 0 -> 1
+dqmxg019 maxmag 1 1 -> 1
+dqmxg020 maxmag 1 2 -> 2
+dqmxg021 maxmag 2 -2 -> 2
+dqmxg022 maxmag 2 -1 -> 2
+dqmxg023 maxmag 2 0 -> 2
+dqmxg025 maxmag 2 1 -> 2
+dqmxg026 maxmag 2 2 -> 2
+
+-- extended zeros
+dqmxg030 maxmag 0 0 -> 0
+dqmxg031 maxmag 0 -0 -> 0
+dqmxg032 maxmag 0 -0.0 -> 0
+dqmxg033 maxmag 0 0.0 -> 0
+dqmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+dqmxg035 maxmag -0 -0 -> -0
+dqmxg036 maxmag -0 -0.0 -> -0.0
+dqmxg037 maxmag -0 0.0 -> 0.0
+dqmxg038 maxmag 0.0 0 -> 0
+dqmxg039 maxmag 0.0 -0 -> 0.0
+dqmxg040 maxmag 0.0 -0.0 -> 0.0
+dqmxg041 maxmag 0.0 0.0 -> 0.0
+dqmxg042 maxmag -0.0 0 -> 0
+dqmxg043 maxmag -0.0 -0 -> -0.0
+dqmxg044 maxmag -0.0 -0.0 -> -0.0
+dqmxg045 maxmag -0.0 0.0 -> 0.0
+
+dqmxg050 maxmag -0E1 0E1 -> 0E+1
+dqmxg051 maxmag -0E2 0E2 -> 0E+2
+dqmxg052 maxmag -0E2 0E1 -> 0E+1
+dqmxg053 maxmag -0E1 0E2 -> 0E+2
+dqmxg054 maxmag 0E1 -0E1 -> 0E+1
+dqmxg055 maxmag 0E2 -0E2 -> 0E+2
+dqmxg056 maxmag 0E2 -0E1 -> 0E+2
+dqmxg057 maxmag 0E1 -0E2 -> 0E+1
+
+dqmxg058 maxmag 0E1 0E1 -> 0E+1
+dqmxg059 maxmag 0E2 0E2 -> 0E+2
+dqmxg060 maxmag 0E2 0E1 -> 0E+2
+dqmxg061 maxmag 0E1 0E2 -> 0E+2
+dqmxg062 maxmag -0E1 -0E1 -> -0E+1
+dqmxg063 maxmag -0E2 -0E2 -> -0E+2
+dqmxg064 maxmag -0E2 -0E1 -> -0E+1
+dqmxg065 maxmag -0E1 -0E2 -> -0E+1
+
+-- Specials
+dqmxg090 maxmag Inf -Inf -> Infinity
+dqmxg091 maxmag Inf -1000 -> Infinity
+dqmxg092 maxmag Inf -1 -> Infinity
+dqmxg093 maxmag Inf -0 -> Infinity
+dqmxg094 maxmag Inf 0 -> Infinity
+dqmxg095 maxmag Inf 1 -> Infinity
+dqmxg096 maxmag Inf 1000 -> Infinity
+dqmxg097 maxmag Inf Inf -> Infinity
+dqmxg098 maxmag -1000 Inf -> Infinity
+dqmxg099 maxmag -Inf Inf -> Infinity
+dqmxg100 maxmag -1 Inf -> Infinity
+dqmxg101 maxmag -0 Inf -> Infinity
+dqmxg102 maxmag 0 Inf -> Infinity
+dqmxg103 maxmag 1 Inf -> Infinity
+dqmxg104 maxmag 1000 Inf -> Infinity
+dqmxg105 maxmag Inf Inf -> Infinity
+
+dqmxg120 maxmag -Inf -Inf -> -Infinity
+dqmxg121 maxmag -Inf -1000 -> -Infinity
+dqmxg122 maxmag -Inf -1 -> -Infinity
+dqmxg123 maxmag -Inf -0 -> -Infinity
+dqmxg124 maxmag -Inf 0 -> -Infinity
+dqmxg125 maxmag -Inf 1 -> -Infinity
+dqmxg126 maxmag -Inf 1000 -> -Infinity
+dqmxg127 maxmag -Inf Inf -> Infinity
+dqmxg128 maxmag -Inf -Inf -> -Infinity
+dqmxg129 maxmag -1000 -Inf -> -Infinity
+dqmxg130 maxmag -1 -Inf -> -Infinity
+dqmxg131 maxmag -0 -Inf -> -Infinity
+dqmxg132 maxmag 0 -Inf -> -Infinity
+dqmxg133 maxmag 1 -Inf -> -Infinity
+dqmxg134 maxmag 1000 -Inf -> -Infinity
+dqmxg135 maxmag Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+dqmxg141 maxmag NaN -Inf -> -Infinity
+dqmxg142 maxmag NaN -1000 -> -1000
+dqmxg143 maxmag NaN -1 -> -1
+dqmxg144 maxmag NaN -0 -> -0
+dqmxg145 maxmag NaN 0 -> 0
+dqmxg146 maxmag NaN 1 -> 1
+dqmxg147 maxmag NaN 1000 -> 1000
+dqmxg148 maxmag NaN Inf -> Infinity
+dqmxg149 maxmag NaN NaN -> NaN
+dqmxg150 maxmag -Inf NaN -> -Infinity
+dqmxg151 maxmag -1000 NaN -> -1000
+dqmxg152 maxmag -1 NaN -> -1
+dqmxg153 maxmag -0 NaN -> -0
+dqmxg154 maxmag 0 NaN -> 0
+dqmxg155 maxmag 1 NaN -> 1
+dqmxg156 maxmag 1000 NaN -> 1000
+dqmxg157 maxmag Inf NaN -> Infinity
+
+dqmxg161 maxmag sNaN -Inf -> NaN Invalid_operation
+dqmxg162 maxmag sNaN -1000 -> NaN Invalid_operation
+dqmxg163 maxmag sNaN -1 -> NaN Invalid_operation
+dqmxg164 maxmag sNaN -0 -> NaN Invalid_operation
+dqmxg165 maxmag sNaN 0 -> NaN Invalid_operation
+dqmxg166 maxmag sNaN 1 -> NaN Invalid_operation
+dqmxg167 maxmag sNaN 1000 -> NaN Invalid_operation
+dqmxg168 maxmag sNaN NaN -> NaN Invalid_operation
+dqmxg169 maxmag sNaN sNaN -> NaN Invalid_operation
+dqmxg170 maxmag NaN sNaN -> NaN Invalid_operation
+dqmxg171 maxmag -Inf sNaN -> NaN Invalid_operation
+dqmxg172 maxmag -1000 sNaN -> NaN Invalid_operation
+dqmxg173 maxmag -1 sNaN -> NaN Invalid_operation
+dqmxg174 maxmag -0 sNaN -> NaN Invalid_operation
+dqmxg175 maxmag 0 sNaN -> NaN Invalid_operation
+dqmxg176 maxmag 1 sNaN -> NaN Invalid_operation
+dqmxg177 maxmag 1000 sNaN -> NaN Invalid_operation
+dqmxg178 maxmag Inf sNaN -> NaN Invalid_operation
+dqmxg179 maxmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmxg181 maxmag NaN9 -Inf -> -Infinity
+dqmxg182 maxmag NaN8 9 -> 9
+dqmxg183 maxmag -NaN7 Inf -> Infinity
+
+dqmxg184 maxmag -NaN1 NaN11 -> -NaN1
+dqmxg185 maxmag NaN2 NaN12 -> NaN2
+dqmxg186 maxmag -NaN13 -NaN7 -> -NaN13
+dqmxg187 maxmag NaN14 -NaN5 -> NaN14
+
+dqmxg188 maxmag -Inf NaN4 -> -Infinity
+dqmxg189 maxmag -9 -NaN3 -> -9
+dqmxg190 maxmag Inf NaN2 -> Infinity
+
+dqmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
+dqmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
+dqmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
+dqmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
+dqmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
+dqmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
+dqmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
+
+-- old rounding checks
+dqmxg221 maxmag 12345678000 1 -> 12345678000
+dqmxg222 maxmag 1 12345678000 -> 12345678000
+dqmxg223 maxmag 1234567800 1 -> 1234567800
+dqmxg224 maxmag 1 1234567800 -> 1234567800
+dqmxg225 maxmag 1234567890 1 -> 1234567890
+dqmxg226 maxmag 1 1234567890 -> 1234567890
+dqmxg227 maxmag 1234567891 1 -> 1234567891
+dqmxg228 maxmag 1 1234567891 -> 1234567891
+dqmxg229 maxmag 12345678901 1 -> 12345678901
+dqmxg230 maxmag 1 12345678901 -> 12345678901
+dqmxg231 maxmag 1234567896 1 -> 1234567896
+dqmxg232 maxmag 1 1234567896 -> 1234567896
+dqmxg233 maxmag -1234567891 1 -> -1234567891
+dqmxg234 maxmag 1 -1234567891 -> -1234567891
+dqmxg235 maxmag -12345678901 1 -> -12345678901
+dqmxg236 maxmag 1 -12345678901 -> -12345678901
+dqmxg237 maxmag -1234567896 1 -> -1234567896
+dqmxg238 maxmag 1 -1234567896 -> -1234567896
+
+-- from examples
+dqmxg280 maxmag '3' '2' -> '3'
+dqmxg281 maxmag '-10' '3' -> '-10'
+dqmxg282 maxmag '1.0' '1' -> '1'
+dqmxg283 maxmag '1' '1.0' -> '1'
+dqmxg284 maxmag '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+dqmxg401 maxmag Inf 1.1 -> Infinity
+dqmxg402 maxmag 1.1 1 -> 1.1
+dqmxg403 maxmag 1 1.0 -> 1
+dqmxg404 maxmag 1.0 0.1 -> 1.0
+dqmxg405 maxmag 0.1 0.10 -> 0.1
+dqmxg406 maxmag 0.10 0.100 -> 0.10
+dqmxg407 maxmag 0.10 0 -> 0.10
+dqmxg408 maxmag 0 0.0 -> 0
+dqmxg409 maxmag 0.0 -0 -> 0.0
+dqmxg410 maxmag 0.0 -0.0 -> 0.0
+dqmxg411 maxmag 0.00 -0.0 -> 0.00
+dqmxg412 maxmag 0.0 -0.00 -> 0.0
+dqmxg413 maxmag 0 -0.0 -> 0
+dqmxg414 maxmag 0 -0 -> 0
+dqmxg415 maxmag -0.0 -0 -> -0.0
+dqmxg416 maxmag -0 -0.100 -> -0.100
+dqmxg417 maxmag -0.100 -0.10 -> -0.100
+dqmxg418 maxmag -0.10 -0.1 -> -0.10
+dqmxg419 maxmag -0.1 -1.0 -> -1.0
+dqmxg420 maxmag -1.0 -1 -> -1.0
+dqmxg421 maxmag -1 -1.1 -> -1.1
+dqmxg423 maxmag -1.1 -Inf -> -Infinity
+-- same with operands reversed
+dqmxg431 maxmag 1.1 Inf -> Infinity
+dqmxg432 maxmag 1 1.1 -> 1.1
+dqmxg433 maxmag 1.0 1 -> 1
+dqmxg434 maxmag 0.1 1.0 -> 1.0
+dqmxg435 maxmag 0.10 0.1 -> 0.1
+dqmxg436 maxmag 0.100 0.10 -> 0.10
+dqmxg437 maxmag 0 0.10 -> 0.10
+dqmxg438 maxmag 0.0 0 -> 0
+dqmxg439 maxmag -0 0.0 -> 0.0
+dqmxg440 maxmag -0.0 0.0 -> 0.0
+dqmxg441 maxmag -0.0 0.00 -> 0.00
+dqmxg442 maxmag -0.00 0.0 -> 0.0
+dqmxg443 maxmag -0.0 0 -> 0
+dqmxg444 maxmag -0 0 -> 0
+dqmxg445 maxmag -0 -0.0 -> -0.0
+dqmxg446 maxmag -0.100 -0 -> -0.100
+dqmxg447 maxmag -0.10 -0.100 -> -0.100
+dqmxg448 maxmag -0.1 -0.10 -> -0.10
+dqmxg449 maxmag -1.0 -0.1 -> -1.0
+dqmxg450 maxmag -1 -1.0 -> -1.0
+dqmxg451 maxmag -1.1 -1 -> -1.1
+dqmxg453 maxmag -Inf -1.1 -> -Infinity
+-- largies
+dqmxg460 maxmag 1000 1E+3 -> 1E+3
+dqmxg461 maxmag 1E+3 1000 -> 1E+3
+dqmxg462 maxmag 1000 -1E+3 -> 1000
+dqmxg463 maxmag 1E+3 -1000 -> 1E+3
+dqmxg464 maxmag -1000 1E+3 -> 1E+3
+dqmxg465 maxmag -1E+3 1000 -> 1000
+dqmxg466 maxmag -1000 -1E+3 -> -1000
+dqmxg467 maxmag -1E+3 -1000 -> -1000
+
+-- subnormals
+dqmxg510 maxmag 1.00E-6143 0 -> 1.00E-6143
+dqmxg511 maxmag 0.1E-6143 0 -> 1E-6144 Subnormal
+dqmxg512 maxmag 0.10E-6143 0 -> 1.0E-6144 Subnormal
+dqmxg513 maxmag 0.100E-6143 0 -> 1.00E-6144 Subnormal
+dqmxg514 maxmag 0.01E-6143 0 -> 1E-6145 Subnormal
+dqmxg515 maxmag 0.999E-6143 0 -> 9.99E-6144 Subnormal
+dqmxg516 maxmag 0.099E-6143 0 -> 9.9E-6145 Subnormal
+dqmxg517 maxmag 0.009E-6143 0 -> 9E-6146 Subnormal
+dqmxg518 maxmag 0.001E-6143 0 -> 1E-6146 Subnormal
+dqmxg519 maxmag 0.0009E-6143 0 -> 9E-6147 Subnormal
+dqmxg520 maxmag 0.0001E-6143 0 -> 1E-6147 Subnormal
+
+dqmxg530 maxmag -1.00E-6143 0 -> -1.00E-6143
+dqmxg531 maxmag -0.1E-6143 0 -> -1E-6144 Subnormal
+dqmxg532 maxmag -0.10E-6143 0 -> -1.0E-6144 Subnormal
+dqmxg533 maxmag -0.100E-6143 0 -> -1.00E-6144 Subnormal
+dqmxg534 maxmag -0.01E-6143 0 -> -1E-6145 Subnormal
+dqmxg535 maxmag -0.999E-6143 0 -> -9.99E-6144 Subnormal
+dqmxg536 maxmag -0.099E-6143 0 -> -9.9E-6145 Subnormal
+dqmxg537 maxmag -0.009E-6143 0 -> -9E-6146 Subnormal
+dqmxg538 maxmag -0.001E-6143 0 -> -1E-6146 Subnormal
+dqmxg539 maxmag -0.0009E-6143 0 -> -9E-6147 Subnormal
+dqmxg540 maxmag -0.0001E-6143 0 -> -1E-6147 Subnormal
+
+-- Null tests
+dqmxg900 maxmag 10 # -> NaN Invalid_operation
+dqmxg901 maxmag # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqMin.decTest b/Lib/test/decimaltestdata/dqMin.decTest
index c87f4c54ed..53020398c5 100644
--- a/Lib/test/decimaltestdata/dqMin.decTest
+++ b/Lib/test/decimaltestdata/dqMin.decTest
@@ -1,309 +1,309 @@
-------------------------------------------------------------------------
--- dqMin.decTest -- decQuad minnum --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmin001 min -2 -2 -> -2
-dqmin002 min -2 -1 -> -2
-dqmin003 min -2 0 -> -2
-dqmin004 min -2 1 -> -2
-dqmin005 min -2 2 -> -2
-dqmin006 min -1 -2 -> -2
-dqmin007 min -1 -1 -> -1
-dqmin008 min -1 0 -> -1
-dqmin009 min -1 1 -> -1
-dqmin010 min -1 2 -> -1
-dqmin011 min 0 -2 -> -2
-dqmin012 min 0 -1 -> -1
-dqmin013 min 0 0 -> 0
-dqmin014 min 0 1 -> 0
-dqmin015 min 0 2 -> 0
-dqmin016 min 1 -2 -> -2
-dqmin017 min 1 -1 -> -1
-dqmin018 min 1 0 -> 0
-dqmin019 min 1 1 -> 1
-dqmin020 min 1 2 -> 1
-dqmin021 min 2 -2 -> -2
-dqmin022 min 2 -1 -> -1
-dqmin023 min 2 0 -> 0
-dqmin025 min 2 1 -> 1
-dqmin026 min 2 2 -> 2
-
--- extended zeros
-dqmin030 min 0 0 -> 0
-dqmin031 min 0 -0 -> -0
-dqmin032 min 0 -0.0 -> -0.0
-dqmin033 min 0 0.0 -> 0.0
-dqmin034 min -0 0 -> -0
-dqmin035 min -0 -0 -> -0
-dqmin036 min -0 -0.0 -> -0
-dqmin037 min -0 0.0 -> -0
-dqmin038 min 0.0 0 -> 0.0
-dqmin039 min 0.0 -0 -> -0
-dqmin040 min 0.0 -0.0 -> -0.0
-dqmin041 min 0.0 0.0 -> 0.0
-dqmin042 min -0.0 0 -> -0.0
-dqmin043 min -0.0 -0 -> -0
-dqmin044 min -0.0 -0.0 -> -0.0
-dqmin045 min -0.0 0.0 -> -0.0
-
-dqmin046 min 0E1 -0E1 -> -0E+1
-dqmin047 min -0E1 0E2 -> -0E+1
-dqmin048 min 0E2 0E1 -> 0E+1
-dqmin049 min 0E1 0E2 -> 0E+1
-dqmin050 min -0E3 -0E2 -> -0E+3
-dqmin051 min -0E2 -0E3 -> -0E+3
-
--- Specials
-dqmin090 min Inf -Inf -> -Infinity
-dqmin091 min Inf -1000 -> -1000
-dqmin092 min Inf -1 -> -1
-dqmin093 min Inf -0 -> -0
-dqmin094 min Inf 0 -> 0
-dqmin095 min Inf 1 -> 1
-dqmin096 min Inf 1000 -> 1000
-dqmin097 min Inf Inf -> Infinity
-dqmin098 min -1000 Inf -> -1000
-dqmin099 min -Inf Inf -> -Infinity
-dqmin100 min -1 Inf -> -1
-dqmin101 min -0 Inf -> -0
-dqmin102 min 0 Inf -> 0
-dqmin103 min 1 Inf -> 1
-dqmin104 min 1000 Inf -> 1000
-dqmin105 min Inf Inf -> Infinity
-
-dqmin120 min -Inf -Inf -> -Infinity
-dqmin121 min -Inf -1000 -> -Infinity
-dqmin122 min -Inf -1 -> -Infinity
-dqmin123 min -Inf -0 -> -Infinity
-dqmin124 min -Inf 0 -> -Infinity
-dqmin125 min -Inf 1 -> -Infinity
-dqmin126 min -Inf 1000 -> -Infinity
-dqmin127 min -Inf Inf -> -Infinity
-dqmin128 min -Inf -Inf -> -Infinity
-dqmin129 min -1000 -Inf -> -Infinity
-dqmin130 min -1 -Inf -> -Infinity
-dqmin131 min -0 -Inf -> -Infinity
-dqmin132 min 0 -Inf -> -Infinity
-dqmin133 min 1 -Inf -> -Infinity
-dqmin134 min 1000 -Inf -> -Infinity
-dqmin135 min Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-dqmin141 min NaN -Inf -> -Infinity
-dqmin142 min NaN -1000 -> -1000
-dqmin143 min NaN -1 -> -1
-dqmin144 min NaN -0 -> -0
-dqmin145 min NaN 0 -> 0
-dqmin146 min NaN 1 -> 1
-dqmin147 min NaN 1000 -> 1000
-dqmin148 min NaN Inf -> Infinity
-dqmin149 min NaN NaN -> NaN
-dqmin150 min -Inf NaN -> -Infinity
-dqmin151 min -1000 NaN -> -1000
-dqmin152 min -1 -NaN -> -1
-dqmin153 min -0 NaN -> -0
-dqmin154 min 0 -NaN -> 0
-dqmin155 min 1 NaN -> 1
-dqmin156 min 1000 NaN -> 1000
-dqmin157 min Inf NaN -> Infinity
-
-dqmin161 min sNaN -Inf -> NaN Invalid_operation
-dqmin162 min sNaN -1000 -> NaN Invalid_operation
-dqmin163 min sNaN -1 -> NaN Invalid_operation
-dqmin164 min sNaN -0 -> NaN Invalid_operation
-dqmin165 min -sNaN 0 -> -NaN Invalid_operation
-dqmin166 min -sNaN 1 -> -NaN Invalid_operation
-dqmin167 min sNaN 1000 -> NaN Invalid_operation
-dqmin168 min sNaN NaN -> NaN Invalid_operation
-dqmin169 min sNaN sNaN -> NaN Invalid_operation
-dqmin170 min NaN sNaN -> NaN Invalid_operation
-dqmin171 min -Inf sNaN -> NaN Invalid_operation
-dqmin172 min -1000 sNaN -> NaN Invalid_operation
-dqmin173 min -1 sNaN -> NaN Invalid_operation
-dqmin174 min -0 sNaN -> NaN Invalid_operation
-dqmin175 min 0 sNaN -> NaN Invalid_operation
-dqmin176 min 1 sNaN -> NaN Invalid_operation
-dqmin177 min 1000 sNaN -> NaN Invalid_operation
-dqmin178 min Inf sNaN -> NaN Invalid_operation
-dqmin179 min NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmin181 min NaN9 -Inf -> -Infinity
-dqmin182 min -NaN8 9990 -> 9990
-dqmin183 min NaN71 Inf -> Infinity
-
-dqmin184 min NaN1 NaN54 -> NaN1
-dqmin185 min NaN22 -NaN53 -> NaN22
-dqmin186 min -NaN3 NaN6 -> -NaN3
-dqmin187 min -NaN44 NaN7 -> -NaN44
-
-dqmin188 min -Inf NaN41 -> -Infinity
-dqmin189 min -9999 -NaN33 -> -9999
-dqmin190 min Inf NaN2 -> Infinity
-
-dqmin191 min sNaN99 -Inf -> NaN99 Invalid_operation
-dqmin192 min sNaN98 -11 -> NaN98 Invalid_operation
-dqmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation
-dqmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
-dqmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmin196 min -Inf sNaN92 -> NaN92 Invalid_operation
-dqmin197 min 088 sNaN91 -> NaN91 Invalid_operation
-dqmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmin199 min NaN sNaN86 -> NaN86 Invalid_operation
-
--- old rounding checks
-dqmin221 min -12345678000 1 -> -12345678000
-dqmin222 min 1 -12345678000 -> -12345678000
-dqmin223 min -1234567800 1 -> -1234567800
-dqmin224 min 1 -1234567800 -> -1234567800
-dqmin225 min -1234567890 1 -> -1234567890
-dqmin226 min 1 -1234567890 -> -1234567890
-dqmin227 min -1234567891 1 -> -1234567891
-dqmin228 min 1 -1234567891 -> -1234567891
-dqmin229 min -12345678901 1 -> -12345678901
-dqmin230 min 1 -12345678901 -> -12345678901
-dqmin231 min -1234567896 1 -> -1234567896
-dqmin232 min 1 -1234567896 -> -1234567896
-dqmin233 min 1234567891 1 -> 1
-dqmin234 min 1 1234567891 -> 1
-dqmin235 min 12345678901 1 -> 1
-dqmin236 min 1 12345678901 -> 1
-dqmin237 min 1234567896 1 -> 1
-dqmin238 min 1 1234567896 -> 1
-
--- from examples
-dqmin280 min '3' '2' -> '2'
-dqmin281 min '-10' '3' -> '-10'
-dqmin282 min '1.0' '1' -> '1.0'
-dqmin283 min '1' '1.0' -> '1.0'
-dqmin284 min '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-dqmin401 min Inf 1.1 -> 1.1
-dqmin402 min 1.1 1 -> 1
-dqmin403 min 1 1.0 -> 1.0
-dqmin404 min 1.0 0.1 -> 0.1
-dqmin405 min 0.1 0.10 -> 0.10
-dqmin406 min 0.10 0.100 -> 0.100
-dqmin407 min 0.10 0 -> 0
-dqmin408 min 0 0.0 -> 0.0
-dqmin409 min 0.0 -0 -> -0
-dqmin410 min 0.0 -0.0 -> -0.0
-dqmin411 min 0.00 -0.0 -> -0.0
-dqmin412 min 0.0 -0.00 -> -0.00
-dqmin413 min 0 -0.0 -> -0.0
-dqmin414 min 0 -0 -> -0
-dqmin415 min -0.0 -0 -> -0
-dqmin416 min -0 -0.100 -> -0.100
-dqmin417 min -0.100 -0.10 -> -0.10
-dqmin418 min -0.10 -0.1 -> -0.1
-dqmin419 min -0.1 -1.0 -> -1.0
-dqmin420 min -1.0 -1 -> -1
-dqmin421 min -1 -1.1 -> -1.1
-dqmin423 min -1.1 -Inf -> -Infinity
--- same with operands reversed
-dqmin431 min 1.1 Inf -> 1.1
-dqmin432 min 1 1.1 -> 1
-dqmin433 min 1.0 1 -> 1.0
-dqmin434 min 0.1 1.0 -> 0.1
-dqmin435 min 0.10 0.1 -> 0.10
-dqmin436 min 0.100 0.10 -> 0.100
-dqmin437 min 0 0.10 -> 0
-dqmin438 min 0.0 0 -> 0.0
-dqmin439 min -0 0.0 -> -0
-dqmin440 min -0.0 0.0 -> -0.0
-dqmin441 min -0.0 0.00 -> -0.0
-dqmin442 min -0.00 0.0 -> -0.00
-dqmin443 min -0.0 0 -> -0.0
-dqmin444 min -0 0 -> -0
-dqmin445 min -0 -0.0 -> -0
-dqmin446 min -0.100 -0 -> -0.100
-dqmin447 min -0.10 -0.100 -> -0.10
-dqmin448 min -0.1 -0.10 -> -0.1
-dqmin449 min -1.0 -0.1 -> -1.0
-dqmin450 min -1 -1.0 -> -1
-dqmin451 min -1.1 -1 -> -1.1
-dqmin453 min -Inf -1.1 -> -Infinity
--- largies
-dqmin460 min 1000 1E+3 -> 1000
-dqmin461 min 1E+3 1000 -> 1000
-dqmin462 min 1000 -1E+3 -> -1E+3
-dqmin463 min 1E+3 -384 -> -384
-dqmin464 min -384 1E+3 -> -384
-dqmin465 min -1E+3 1000 -> -1E+3
-dqmin466 min -384 -1E+3 -> -1E+3
-dqmin467 min -1E+3 -384 -> -1E+3
-
--- misalignment traps for little-endian
-dqmin471 min 1.0 0.1 -> 0.1
-dqmin472 min 0.1 1.0 -> 0.1
-dqmin473 min 10.0 0.1 -> 0.1
-dqmin474 min 0.1 10.0 -> 0.1
-dqmin475 min 100 1.0 -> 1.0
-dqmin476 min 1.0 100 -> 1.0
-dqmin477 min 1000 10.0 -> 10.0
-dqmin478 min 10.0 1000 -> 10.0
-dqmin479 min 10000 100.0 -> 100.0
-dqmin480 min 100.0 10000 -> 100.0
-dqmin481 min 100000 1000.0 -> 1000.0
-dqmin482 min 1000.0 100000 -> 1000.0
-dqmin483 min 1000000 10000.0 -> 10000.0
-dqmin484 min 10000.0 1000000 -> 10000.0
-
--- subnormals
-dqmin510 min 1.00E-6143 0 -> 0
-dqmin511 min 0.1E-6143 0 -> 0
-dqmin512 min 0.10E-6143 0 -> 0
-dqmin513 min 0.100E-6143 0 -> 0
-dqmin514 min 0.01E-6143 0 -> 0
-dqmin515 min 0.999E-6143 0 -> 0
-dqmin516 min 0.099E-6143 0 -> 0
-dqmin517 min 0.009E-6143 0 -> 0
-dqmin518 min 0.001E-6143 0 -> 0
-dqmin519 min 0.0009E-6143 0 -> 0
-dqmin520 min 0.0001E-6143 0 -> 0
-
-dqmin530 min -1.00E-6143 0 -> -1.00E-6143
-dqmin531 min -0.1E-6143 0 -> -1E-6144 Subnormal
-dqmin532 min -0.10E-6143 0 -> -1.0E-6144 Subnormal
-dqmin533 min -0.100E-6143 0 -> -1.00E-6144 Subnormal
-dqmin534 min -0.01E-6143 0 -> -1E-6145 Subnormal
-dqmin535 min -0.999E-6143 0 -> -9.99E-6144 Subnormal
-dqmin536 min -0.099E-6143 0 -> -9.9E-6145 Subnormal
-dqmin537 min -0.009E-6143 0 -> -9E-6146 Subnormal
-dqmin538 min -0.001E-6143 0 -> -1E-6146 Subnormal
-dqmin539 min -0.0009E-6143 0 -> -9E-6147 Subnormal
-dqmin540 min -0.0001E-6143 0 -> -1E-6147 Subnormal
-
-
--- Null tests
-dqmin900 min 10 # -> NaN Invalid_operation
-dqmin901 min # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqMin.decTest -- decQuad minnum --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmin001 min -2 -2 -> -2
+dqmin002 min -2 -1 -> -2
+dqmin003 min -2 0 -> -2
+dqmin004 min -2 1 -> -2
+dqmin005 min -2 2 -> -2
+dqmin006 min -1 -2 -> -2
+dqmin007 min -1 -1 -> -1
+dqmin008 min -1 0 -> -1
+dqmin009 min -1 1 -> -1
+dqmin010 min -1 2 -> -1
+dqmin011 min 0 -2 -> -2
+dqmin012 min 0 -1 -> -1
+dqmin013 min 0 0 -> 0
+dqmin014 min 0 1 -> 0
+dqmin015 min 0 2 -> 0
+dqmin016 min 1 -2 -> -2
+dqmin017 min 1 -1 -> -1
+dqmin018 min 1 0 -> 0
+dqmin019 min 1 1 -> 1
+dqmin020 min 1 2 -> 1
+dqmin021 min 2 -2 -> -2
+dqmin022 min 2 -1 -> -1
+dqmin023 min 2 0 -> 0
+dqmin025 min 2 1 -> 1
+dqmin026 min 2 2 -> 2
+
+-- extended zeros
+dqmin030 min 0 0 -> 0
+dqmin031 min 0 -0 -> -0
+dqmin032 min 0 -0.0 -> -0.0
+dqmin033 min 0 0.0 -> 0.0
+dqmin034 min -0 0 -> -0
+dqmin035 min -0 -0 -> -0
+dqmin036 min -0 -0.0 -> -0
+dqmin037 min -0 0.0 -> -0
+dqmin038 min 0.0 0 -> 0.0
+dqmin039 min 0.0 -0 -> -0
+dqmin040 min 0.0 -0.0 -> -0.0
+dqmin041 min 0.0 0.0 -> 0.0
+dqmin042 min -0.0 0 -> -0.0
+dqmin043 min -0.0 -0 -> -0
+dqmin044 min -0.0 -0.0 -> -0.0
+dqmin045 min -0.0 0.0 -> -0.0
+
+dqmin046 min 0E1 -0E1 -> -0E+1
+dqmin047 min -0E1 0E2 -> -0E+1
+dqmin048 min 0E2 0E1 -> 0E+1
+dqmin049 min 0E1 0E2 -> 0E+1
+dqmin050 min -0E3 -0E2 -> -0E+3
+dqmin051 min -0E2 -0E3 -> -0E+3
+
+-- Specials
+dqmin090 min Inf -Inf -> -Infinity
+dqmin091 min Inf -1000 -> -1000
+dqmin092 min Inf -1 -> -1
+dqmin093 min Inf -0 -> -0
+dqmin094 min Inf 0 -> 0
+dqmin095 min Inf 1 -> 1
+dqmin096 min Inf 1000 -> 1000
+dqmin097 min Inf Inf -> Infinity
+dqmin098 min -1000 Inf -> -1000
+dqmin099 min -Inf Inf -> -Infinity
+dqmin100 min -1 Inf -> -1
+dqmin101 min -0 Inf -> -0
+dqmin102 min 0 Inf -> 0
+dqmin103 min 1 Inf -> 1
+dqmin104 min 1000 Inf -> 1000
+dqmin105 min Inf Inf -> Infinity
+
+dqmin120 min -Inf -Inf -> -Infinity
+dqmin121 min -Inf -1000 -> -Infinity
+dqmin122 min -Inf -1 -> -Infinity
+dqmin123 min -Inf -0 -> -Infinity
+dqmin124 min -Inf 0 -> -Infinity
+dqmin125 min -Inf 1 -> -Infinity
+dqmin126 min -Inf 1000 -> -Infinity
+dqmin127 min -Inf Inf -> -Infinity
+dqmin128 min -Inf -Inf -> -Infinity
+dqmin129 min -1000 -Inf -> -Infinity
+dqmin130 min -1 -Inf -> -Infinity
+dqmin131 min -0 -Inf -> -Infinity
+dqmin132 min 0 -Inf -> -Infinity
+dqmin133 min 1 -Inf -> -Infinity
+dqmin134 min 1000 -Inf -> -Infinity
+dqmin135 min Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+dqmin141 min NaN -Inf -> -Infinity
+dqmin142 min NaN -1000 -> -1000
+dqmin143 min NaN -1 -> -1
+dqmin144 min NaN -0 -> -0
+dqmin145 min NaN 0 -> 0
+dqmin146 min NaN 1 -> 1
+dqmin147 min NaN 1000 -> 1000
+dqmin148 min NaN Inf -> Infinity
+dqmin149 min NaN NaN -> NaN
+dqmin150 min -Inf NaN -> -Infinity
+dqmin151 min -1000 NaN -> -1000
+dqmin152 min -1 -NaN -> -1
+dqmin153 min -0 NaN -> -0
+dqmin154 min 0 -NaN -> 0
+dqmin155 min 1 NaN -> 1
+dqmin156 min 1000 NaN -> 1000
+dqmin157 min Inf NaN -> Infinity
+
+dqmin161 min sNaN -Inf -> NaN Invalid_operation
+dqmin162 min sNaN -1000 -> NaN Invalid_operation
+dqmin163 min sNaN -1 -> NaN Invalid_operation
+dqmin164 min sNaN -0 -> NaN Invalid_operation
+dqmin165 min -sNaN 0 -> -NaN Invalid_operation
+dqmin166 min -sNaN 1 -> -NaN Invalid_operation
+dqmin167 min sNaN 1000 -> NaN Invalid_operation
+dqmin168 min sNaN NaN -> NaN Invalid_operation
+dqmin169 min sNaN sNaN -> NaN Invalid_operation
+dqmin170 min NaN sNaN -> NaN Invalid_operation
+dqmin171 min -Inf sNaN -> NaN Invalid_operation
+dqmin172 min -1000 sNaN -> NaN Invalid_operation
+dqmin173 min -1 sNaN -> NaN Invalid_operation
+dqmin174 min -0 sNaN -> NaN Invalid_operation
+dqmin175 min 0 sNaN -> NaN Invalid_operation
+dqmin176 min 1 sNaN -> NaN Invalid_operation
+dqmin177 min 1000 sNaN -> NaN Invalid_operation
+dqmin178 min Inf sNaN -> NaN Invalid_operation
+dqmin179 min NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmin181 min NaN9 -Inf -> -Infinity
+dqmin182 min -NaN8 9990 -> 9990
+dqmin183 min NaN71 Inf -> Infinity
+
+dqmin184 min NaN1 NaN54 -> NaN1
+dqmin185 min NaN22 -NaN53 -> NaN22
+dqmin186 min -NaN3 NaN6 -> -NaN3
+dqmin187 min -NaN44 NaN7 -> -NaN44
+
+dqmin188 min -Inf NaN41 -> -Infinity
+dqmin189 min -9999 -NaN33 -> -9999
+dqmin190 min Inf NaN2 -> Infinity
+
+dqmin191 min sNaN99 -Inf -> NaN99 Invalid_operation
+dqmin192 min sNaN98 -11 -> NaN98 Invalid_operation
+dqmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation
+dqmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
+dqmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmin196 min -Inf sNaN92 -> NaN92 Invalid_operation
+dqmin197 min 088 sNaN91 -> NaN91 Invalid_operation
+dqmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmin199 min NaN sNaN86 -> NaN86 Invalid_operation
+
+-- old rounding checks
+dqmin221 min -12345678000 1 -> -12345678000
+dqmin222 min 1 -12345678000 -> -12345678000
+dqmin223 min -1234567800 1 -> -1234567800
+dqmin224 min 1 -1234567800 -> -1234567800
+dqmin225 min -1234567890 1 -> -1234567890
+dqmin226 min 1 -1234567890 -> -1234567890
+dqmin227 min -1234567891 1 -> -1234567891
+dqmin228 min 1 -1234567891 -> -1234567891
+dqmin229 min -12345678901 1 -> -12345678901
+dqmin230 min 1 -12345678901 -> -12345678901
+dqmin231 min -1234567896 1 -> -1234567896
+dqmin232 min 1 -1234567896 -> -1234567896
+dqmin233 min 1234567891 1 -> 1
+dqmin234 min 1 1234567891 -> 1
+dqmin235 min 12345678901 1 -> 1
+dqmin236 min 1 12345678901 -> 1
+dqmin237 min 1234567896 1 -> 1
+dqmin238 min 1 1234567896 -> 1
+
+-- from examples
+dqmin280 min '3' '2' -> '2'
+dqmin281 min '-10' '3' -> '-10'
+dqmin282 min '1.0' '1' -> '1.0'
+dqmin283 min '1' '1.0' -> '1.0'
+dqmin284 min '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+dqmin401 min Inf 1.1 -> 1.1
+dqmin402 min 1.1 1 -> 1
+dqmin403 min 1 1.0 -> 1.0
+dqmin404 min 1.0 0.1 -> 0.1
+dqmin405 min 0.1 0.10 -> 0.10
+dqmin406 min 0.10 0.100 -> 0.100
+dqmin407 min 0.10 0 -> 0
+dqmin408 min 0 0.0 -> 0.0
+dqmin409 min 0.0 -0 -> -0
+dqmin410 min 0.0 -0.0 -> -0.0
+dqmin411 min 0.00 -0.0 -> -0.0
+dqmin412 min 0.0 -0.00 -> -0.00
+dqmin413 min 0 -0.0 -> -0.0
+dqmin414 min 0 -0 -> -0
+dqmin415 min -0.0 -0 -> -0
+dqmin416 min -0 -0.100 -> -0.100
+dqmin417 min -0.100 -0.10 -> -0.10
+dqmin418 min -0.10 -0.1 -> -0.1
+dqmin419 min -0.1 -1.0 -> -1.0
+dqmin420 min -1.0 -1 -> -1
+dqmin421 min -1 -1.1 -> -1.1
+dqmin423 min -1.1 -Inf -> -Infinity
+-- same with operands reversed
+dqmin431 min 1.1 Inf -> 1.1
+dqmin432 min 1 1.1 -> 1
+dqmin433 min 1.0 1 -> 1.0
+dqmin434 min 0.1 1.0 -> 0.1
+dqmin435 min 0.10 0.1 -> 0.10
+dqmin436 min 0.100 0.10 -> 0.100
+dqmin437 min 0 0.10 -> 0
+dqmin438 min 0.0 0 -> 0.0
+dqmin439 min -0 0.0 -> -0
+dqmin440 min -0.0 0.0 -> -0.0
+dqmin441 min -0.0 0.00 -> -0.0
+dqmin442 min -0.00 0.0 -> -0.00
+dqmin443 min -0.0 0 -> -0.0
+dqmin444 min -0 0 -> -0
+dqmin445 min -0 -0.0 -> -0
+dqmin446 min -0.100 -0 -> -0.100
+dqmin447 min -0.10 -0.100 -> -0.10
+dqmin448 min -0.1 -0.10 -> -0.1
+dqmin449 min -1.0 -0.1 -> -1.0
+dqmin450 min -1 -1.0 -> -1
+dqmin451 min -1.1 -1 -> -1.1
+dqmin453 min -Inf -1.1 -> -Infinity
+-- largies
+dqmin460 min 1000 1E+3 -> 1000
+dqmin461 min 1E+3 1000 -> 1000
+dqmin462 min 1000 -1E+3 -> -1E+3
+dqmin463 min 1E+3 -384 -> -384
+dqmin464 min -384 1E+3 -> -384
+dqmin465 min -1E+3 1000 -> -1E+3
+dqmin466 min -384 -1E+3 -> -1E+3
+dqmin467 min -1E+3 -384 -> -1E+3
+
+-- misalignment traps for little-endian
+dqmin471 min 1.0 0.1 -> 0.1
+dqmin472 min 0.1 1.0 -> 0.1
+dqmin473 min 10.0 0.1 -> 0.1
+dqmin474 min 0.1 10.0 -> 0.1
+dqmin475 min 100 1.0 -> 1.0
+dqmin476 min 1.0 100 -> 1.0
+dqmin477 min 1000 10.0 -> 10.0
+dqmin478 min 10.0 1000 -> 10.0
+dqmin479 min 10000 100.0 -> 100.0
+dqmin480 min 100.0 10000 -> 100.0
+dqmin481 min 100000 1000.0 -> 1000.0
+dqmin482 min 1000.0 100000 -> 1000.0
+dqmin483 min 1000000 10000.0 -> 10000.0
+dqmin484 min 10000.0 1000000 -> 10000.0
+
+-- subnormals
+dqmin510 min 1.00E-6143 0 -> 0
+dqmin511 min 0.1E-6143 0 -> 0
+dqmin512 min 0.10E-6143 0 -> 0
+dqmin513 min 0.100E-6143 0 -> 0
+dqmin514 min 0.01E-6143 0 -> 0
+dqmin515 min 0.999E-6143 0 -> 0
+dqmin516 min 0.099E-6143 0 -> 0
+dqmin517 min 0.009E-6143 0 -> 0
+dqmin518 min 0.001E-6143 0 -> 0
+dqmin519 min 0.0009E-6143 0 -> 0
+dqmin520 min 0.0001E-6143 0 -> 0
+
+dqmin530 min -1.00E-6143 0 -> -1.00E-6143
+dqmin531 min -0.1E-6143 0 -> -1E-6144 Subnormal
+dqmin532 min -0.10E-6143 0 -> -1.0E-6144 Subnormal
+dqmin533 min -0.100E-6143 0 -> -1.00E-6144 Subnormal
+dqmin534 min -0.01E-6143 0 -> -1E-6145 Subnormal
+dqmin535 min -0.999E-6143 0 -> -9.99E-6144 Subnormal
+dqmin536 min -0.099E-6143 0 -> -9.9E-6145 Subnormal
+dqmin537 min -0.009E-6143 0 -> -9E-6146 Subnormal
+dqmin538 min -0.001E-6143 0 -> -1E-6146 Subnormal
+dqmin539 min -0.0009E-6143 0 -> -9E-6147 Subnormal
+dqmin540 min -0.0001E-6143 0 -> -1E-6147 Subnormal
+
+
+-- Null tests
+dqmin900 min 10 # -> NaN Invalid_operation
+dqmin901 min # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqMinMag.decTest b/Lib/test/decimaltestdata/dqMinMag.decTest
index edc2e476ac..71b886fb58 100644
--- a/Lib/test/decimaltestdata/dqMinMag.decTest
+++ b/Lib/test/decimaltestdata/dqMinMag.decTest
@@ -1,293 +1,293 @@
-------------------------------------------------------------------------
--- dqMinMag.decTest -- decQuad minnummag --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmng001 minmag -2 -2 -> -2
-dqmng002 minmag -2 -1 -> -1
-dqmng003 minmag -2 0 -> 0
-dqmng004 minmag -2 1 -> 1
-dqmng005 minmag -2 2 -> -2
-dqmng006 minmag -1 -2 -> -1
-dqmng007 minmag -1 -1 -> -1
-dqmng008 minmag -1 0 -> 0
-dqmng009 minmag -1 1 -> -1
-dqmng010 minmag -1 2 -> -1
-dqmng011 minmag 0 -2 -> 0
-dqmng012 minmag 0 -1 -> 0
-dqmng013 minmag 0 0 -> 0
-dqmng014 minmag 0 1 -> 0
-dqmng015 minmag 0 2 -> 0
-dqmng016 minmag 1 -2 -> 1
-dqmng017 minmag 1 -1 -> -1
-dqmng018 minmag 1 0 -> 0
-dqmng019 minmag 1 1 -> 1
-dqmng020 minmag 1 2 -> 1
-dqmng021 minmag 2 -2 -> -2
-dqmng022 minmag 2 -1 -> -1
-dqmng023 minmag 2 0 -> 0
-dqmng025 minmag 2 1 -> 1
-dqmng026 minmag 2 2 -> 2
-
--- extended zeros
-dqmng030 minmag 0 0 -> 0
-dqmng031 minmag 0 -0 -> -0
-dqmng032 minmag 0 -0.0 -> -0.0
-dqmng033 minmag 0 0.0 -> 0.0
-dqmng034 minmag -0 0 -> -0
-dqmng035 minmag -0 -0 -> -0
-dqmng036 minmag -0 -0.0 -> -0
-dqmng037 minmag -0 0.0 -> -0
-dqmng038 minmag 0.0 0 -> 0.0
-dqmng039 minmag 0.0 -0 -> -0
-dqmng040 minmag 0.0 -0.0 -> -0.0
-dqmng041 minmag 0.0 0.0 -> 0.0
-dqmng042 minmag -0.0 0 -> -0.0
-dqmng043 minmag -0.0 -0 -> -0
-dqmng044 minmag -0.0 -0.0 -> -0.0
-dqmng045 minmag -0.0 0.0 -> -0.0
-
-dqmng046 minmag 0E1 -0E1 -> -0E+1
-dqmng047 minmag -0E1 0E2 -> -0E+1
-dqmng048 minmag 0E2 0E1 -> 0E+1
-dqmng049 minmag 0E1 0E2 -> 0E+1
-dqmng050 minmag -0E3 -0E2 -> -0E+3
-dqmng051 minmag -0E2 -0E3 -> -0E+3
-
--- Specials
-dqmng090 minmag Inf -Inf -> -Infinity
-dqmng091 minmag Inf -1000 -> -1000
-dqmng092 minmag Inf -1 -> -1
-dqmng093 minmag Inf -0 -> -0
-dqmng094 minmag Inf 0 -> 0
-dqmng095 minmag Inf 1 -> 1
-dqmng096 minmag Inf 1000 -> 1000
-dqmng097 minmag Inf Inf -> Infinity
-dqmng098 minmag -1000 Inf -> -1000
-dqmng099 minmag -Inf Inf -> -Infinity
-dqmng100 minmag -1 Inf -> -1
-dqmng101 minmag -0 Inf -> -0
-dqmng102 minmag 0 Inf -> 0
-dqmng103 minmag 1 Inf -> 1
-dqmng104 minmag 1000 Inf -> 1000
-dqmng105 minmag Inf Inf -> Infinity
-
-dqmng120 minmag -Inf -Inf -> -Infinity
-dqmng121 minmag -Inf -1000 -> -1000
-dqmng122 minmag -Inf -1 -> -1
-dqmng123 minmag -Inf -0 -> -0
-dqmng124 minmag -Inf 0 -> 0
-dqmng125 minmag -Inf 1 -> 1
-dqmng126 minmag -Inf 1000 -> 1000
-dqmng127 minmag -Inf Inf -> -Infinity
-dqmng128 minmag -Inf -Inf -> -Infinity
-dqmng129 minmag -1000 -Inf -> -1000
-dqmng130 minmag -1 -Inf -> -1
-dqmng131 minmag -0 -Inf -> -0
-dqmng132 minmag 0 -Inf -> 0
-dqmng133 minmag 1 -Inf -> 1
-dqmng134 minmag 1000 -Inf -> 1000
-dqmng135 minmag Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-dqmng141 minmag NaN -Inf -> -Infinity
-dqmng142 minmag NaN -1000 -> -1000
-dqmng143 minmag NaN -1 -> -1
-dqmng144 minmag NaN -0 -> -0
-dqmng145 minmag NaN 0 -> 0
-dqmng146 minmag NaN 1 -> 1
-dqmng147 minmag NaN 1000 -> 1000
-dqmng148 minmag NaN Inf -> Infinity
-dqmng149 minmag NaN NaN -> NaN
-dqmng150 minmag -Inf NaN -> -Infinity
-dqmng151 minmag -1000 NaN -> -1000
-dqmng152 minmag -1 -NaN -> -1
-dqmng153 minmag -0 NaN -> -0
-dqmng154 minmag 0 -NaN -> 0
-dqmng155 minmag 1 NaN -> 1
-dqmng156 minmag 1000 NaN -> 1000
-dqmng157 minmag Inf NaN -> Infinity
-
-dqmng161 minmag sNaN -Inf -> NaN Invalid_operation
-dqmng162 minmag sNaN -1000 -> NaN Invalid_operation
-dqmng163 minmag sNaN -1 -> NaN Invalid_operation
-dqmng164 minmag sNaN -0 -> NaN Invalid_operation
-dqmng165 minmag -sNaN 0 -> -NaN Invalid_operation
-dqmng166 minmag -sNaN 1 -> -NaN Invalid_operation
-dqmng167 minmag sNaN 1000 -> NaN Invalid_operation
-dqmng168 minmag sNaN NaN -> NaN Invalid_operation
-dqmng169 minmag sNaN sNaN -> NaN Invalid_operation
-dqmng170 minmag NaN sNaN -> NaN Invalid_operation
-dqmng171 minmag -Inf sNaN -> NaN Invalid_operation
-dqmng172 minmag -1000 sNaN -> NaN Invalid_operation
-dqmng173 minmag -1 sNaN -> NaN Invalid_operation
-dqmng174 minmag -0 sNaN -> NaN Invalid_operation
-dqmng175 minmag 0 sNaN -> NaN Invalid_operation
-dqmng176 minmag 1 sNaN -> NaN Invalid_operation
-dqmng177 minmag 1000 sNaN -> NaN Invalid_operation
-dqmng178 minmag Inf sNaN -> NaN Invalid_operation
-dqmng179 minmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmng181 minmag NaN9 -Inf -> -Infinity
-dqmng182 minmag -NaN8 9990 -> 9990
-dqmng183 minmag NaN71 Inf -> Infinity
-
-dqmng184 minmag NaN1 NaN54 -> NaN1
-dqmng185 minmag NaN22 -NaN53 -> NaN22
-dqmng186 minmag -NaN3 NaN6 -> -NaN3
-dqmng187 minmag -NaN44 NaN7 -> -NaN44
-
-dqmng188 minmag -Inf NaN41 -> -Infinity
-dqmng189 minmag -9999 -NaN33 -> -9999
-dqmng190 minmag Inf NaN2 -> Infinity
-
-dqmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
-dqmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation
-dqmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
-dqmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
-dqmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
-dqmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation
-dqmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation
-
--- old rounding checks
-dqmng221 minmag -12345678000 1 -> 1
-dqmng222 minmag 1 -12345678000 -> 1
-dqmng223 minmag -1234567800 1 -> 1
-dqmng224 minmag 1 -1234567800 -> 1
-dqmng225 minmag -1234567890 1 -> 1
-dqmng226 minmag 1 -1234567890 -> 1
-dqmng227 minmag -1234567891 1 -> 1
-dqmng228 minmag 1 -1234567891 -> 1
-dqmng229 minmag -12345678901 1 -> 1
-dqmng230 minmag 1 -12345678901 -> 1
-dqmng231 minmag -1234567896 1 -> 1
-dqmng232 minmag 1 -1234567896 -> 1
-dqmng233 minmag 1234567891 1 -> 1
-dqmng234 minmag 1 1234567891 -> 1
-dqmng235 minmag 12345678901 1 -> 1
-dqmng236 minmag 1 12345678901 -> 1
-dqmng237 minmag 1234567896 1 -> 1
-dqmng238 minmag 1 1234567896 -> 1
-
--- from examples
-dqmng280 minmag '3' '2' -> '2'
-dqmng281 minmag '-10' '3' -> '3'
-dqmng282 minmag '1.0' '1' -> '1.0'
-dqmng283 minmag '1' '1.0' -> '1.0'
-dqmng284 minmag '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-dqmng401 minmag Inf 1.1 -> 1.1
-dqmng402 minmag 1.1 1 -> 1
-dqmng403 minmag 1 1.0 -> 1.0
-dqmng404 minmag 1.0 0.1 -> 0.1
-dqmng405 minmag 0.1 0.10 -> 0.10
-dqmng406 minmag 0.10 0.100 -> 0.100
-dqmng407 minmag 0.10 0 -> 0
-dqmng408 minmag 0 0.0 -> 0.0
-dqmng409 minmag 0.0 -0 -> -0
-dqmng410 minmag 0.0 -0.0 -> -0.0
-dqmng411 minmag 0.00 -0.0 -> -0.0
-dqmng412 minmag 0.0 -0.00 -> -0.00
-dqmng413 minmag 0 -0.0 -> -0.0
-dqmng414 minmag 0 -0 -> -0
-dqmng415 minmag -0.0 -0 -> -0
-dqmng416 minmag -0 -0.100 -> -0
-dqmng417 minmag -0.100 -0.10 -> -0.10
-dqmng418 minmag -0.10 -0.1 -> -0.1
-dqmng419 minmag -0.1 -1.0 -> -0.1
-dqmng420 minmag -1.0 -1 -> -1
-dqmng421 minmag -1 -1.1 -> -1
-dqmng423 minmag -1.1 -Inf -> -1.1
--- same with operands reversed
-dqmng431 minmag 1.1 Inf -> 1.1
-dqmng432 minmag 1 1.1 -> 1
-dqmng433 minmag 1.0 1 -> 1.0
-dqmng434 minmag 0.1 1.0 -> 0.1
-dqmng435 minmag 0.10 0.1 -> 0.10
-dqmng436 minmag 0.100 0.10 -> 0.100
-dqmng437 minmag 0 0.10 -> 0
-dqmng438 minmag 0.0 0 -> 0.0
-dqmng439 minmag -0 0.0 -> -0
-dqmng440 minmag -0.0 0.0 -> -0.0
-dqmng441 minmag -0.0 0.00 -> -0.0
-dqmng442 minmag -0.00 0.0 -> -0.00
-dqmng443 minmag -0.0 0 -> -0.0
-dqmng444 minmag -0 0 -> -0
-dqmng445 minmag -0 -0.0 -> -0
-dqmng446 minmag -0.100 -0 -> -0
-dqmng447 minmag -0.10 -0.100 -> -0.10
-dqmng448 minmag -0.1 -0.10 -> -0.1
-dqmng449 minmag -1.0 -0.1 -> -0.1
-dqmng450 minmag -1 -1.0 -> -1
-dqmng451 minmag -1.1 -1 -> -1
-dqmng453 minmag -Inf -1.1 -> -1.1
--- largies
-dqmng460 minmag 1000 1E+3 -> 1000
-dqmng461 minmag 1E+3 1000 -> 1000
-dqmng462 minmag 1000 -1E+3 -> -1E+3
-dqmng463 minmag 1E+3 -384 -> -384
-dqmng464 minmag -384 1E+3 -> -384
-dqmng465 minmag -1E+3 1000 -> -1E+3
-dqmng466 minmag -384 -1E+3 -> -384
-dqmng467 minmag -1E+3 -384 -> -384
-
--- subnormals
-dqmng510 minmag 1.00E-6143 0 -> 0
-dqmng511 minmag 0.1E-6143 0 -> 0
-dqmng512 minmag 0.10E-6143 0 -> 0
-dqmng513 minmag 0.100E-6143 0 -> 0
-dqmng514 minmag 0.01E-6143 0 -> 0
-dqmng515 minmag 0.999E-6143 0 -> 0
-dqmng516 minmag 0.099E-6143 0 -> 0
-dqmng517 minmag 0.009E-6143 0 -> 0
-dqmng518 minmag 0.001E-6143 0 -> 0
-dqmng519 minmag 0.0009E-6143 0 -> 0
-dqmng520 minmag 0.0001E-6143 0 -> 0
-
-dqmng530 minmag -1.00E-6143 0 -> 0
-dqmng531 minmag -0.1E-6143 0 -> 0
-dqmng532 minmag -0.10E-6143 0 -> 0
-dqmng533 minmag -0.100E-6143 0 -> 0
-dqmng534 minmag -0.01E-6143 0 -> 0
-dqmng535 minmag -0.999E-6143 0 -> 0
-dqmng536 minmag -0.099E-6143 0 -> 0
-dqmng537 minmag -0.009E-6143 0 -> 0
-dqmng538 minmag -0.001E-6143 0 -> 0
-dqmng539 minmag -0.0009E-6143 0 -> 0
-dqmng540 minmag -0.0001E-6143 0 -> 0
-
-
--- Null tests
-dqmng900 minmag 10 # -> NaN Invalid_operation
-dqmng901 minmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqMinMag.decTest -- decQuad minnummag --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmng001 minmag -2 -2 -> -2
+dqmng002 minmag -2 -1 -> -1
+dqmng003 minmag -2 0 -> 0
+dqmng004 minmag -2 1 -> 1
+dqmng005 minmag -2 2 -> -2
+dqmng006 minmag -1 -2 -> -1
+dqmng007 minmag -1 -1 -> -1
+dqmng008 minmag -1 0 -> 0
+dqmng009 minmag -1 1 -> -1
+dqmng010 minmag -1 2 -> -1
+dqmng011 minmag 0 -2 -> 0
+dqmng012 minmag 0 -1 -> 0
+dqmng013 minmag 0 0 -> 0
+dqmng014 minmag 0 1 -> 0
+dqmng015 minmag 0 2 -> 0
+dqmng016 minmag 1 -2 -> 1
+dqmng017 minmag 1 -1 -> -1
+dqmng018 minmag 1 0 -> 0
+dqmng019 minmag 1 1 -> 1
+dqmng020 minmag 1 2 -> 1
+dqmng021 minmag 2 -2 -> -2
+dqmng022 minmag 2 -1 -> -1
+dqmng023 minmag 2 0 -> 0
+dqmng025 minmag 2 1 -> 1
+dqmng026 minmag 2 2 -> 2
+
+-- extended zeros
+dqmng030 minmag 0 0 -> 0
+dqmng031 minmag 0 -0 -> -0
+dqmng032 minmag 0 -0.0 -> -0.0
+dqmng033 minmag 0 0.0 -> 0.0
+dqmng034 minmag -0 0 -> -0
+dqmng035 minmag -0 -0 -> -0
+dqmng036 minmag -0 -0.0 -> -0
+dqmng037 minmag -0 0.0 -> -0
+dqmng038 minmag 0.0 0 -> 0.0
+dqmng039 minmag 0.0 -0 -> -0
+dqmng040 minmag 0.0 -0.0 -> -0.0
+dqmng041 minmag 0.0 0.0 -> 0.0
+dqmng042 minmag -0.0 0 -> -0.0
+dqmng043 minmag -0.0 -0 -> -0
+dqmng044 minmag -0.0 -0.0 -> -0.0
+dqmng045 minmag -0.0 0.0 -> -0.0
+
+dqmng046 minmag 0E1 -0E1 -> -0E+1
+dqmng047 minmag -0E1 0E2 -> -0E+1
+dqmng048 minmag 0E2 0E1 -> 0E+1
+dqmng049 minmag 0E1 0E2 -> 0E+1
+dqmng050 minmag -0E3 -0E2 -> -0E+3
+dqmng051 minmag -0E2 -0E3 -> -0E+3
+
+-- Specials
+dqmng090 minmag Inf -Inf -> -Infinity
+dqmng091 minmag Inf -1000 -> -1000
+dqmng092 minmag Inf -1 -> -1
+dqmng093 minmag Inf -0 -> -0
+dqmng094 minmag Inf 0 -> 0
+dqmng095 minmag Inf 1 -> 1
+dqmng096 minmag Inf 1000 -> 1000
+dqmng097 minmag Inf Inf -> Infinity
+dqmng098 minmag -1000 Inf -> -1000
+dqmng099 minmag -Inf Inf -> -Infinity
+dqmng100 minmag -1 Inf -> -1
+dqmng101 minmag -0 Inf -> -0
+dqmng102 minmag 0 Inf -> 0
+dqmng103 minmag 1 Inf -> 1
+dqmng104 minmag 1000 Inf -> 1000
+dqmng105 minmag Inf Inf -> Infinity
+
+dqmng120 minmag -Inf -Inf -> -Infinity
+dqmng121 minmag -Inf -1000 -> -1000
+dqmng122 minmag -Inf -1 -> -1
+dqmng123 minmag -Inf -0 -> -0
+dqmng124 minmag -Inf 0 -> 0
+dqmng125 minmag -Inf 1 -> 1
+dqmng126 minmag -Inf 1000 -> 1000
+dqmng127 minmag -Inf Inf -> -Infinity
+dqmng128 minmag -Inf -Inf -> -Infinity
+dqmng129 minmag -1000 -Inf -> -1000
+dqmng130 minmag -1 -Inf -> -1
+dqmng131 minmag -0 -Inf -> -0
+dqmng132 minmag 0 -Inf -> 0
+dqmng133 minmag 1 -Inf -> 1
+dqmng134 minmag 1000 -Inf -> 1000
+dqmng135 minmag Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+dqmng141 minmag NaN -Inf -> -Infinity
+dqmng142 minmag NaN -1000 -> -1000
+dqmng143 minmag NaN -1 -> -1
+dqmng144 minmag NaN -0 -> -0
+dqmng145 minmag NaN 0 -> 0
+dqmng146 minmag NaN 1 -> 1
+dqmng147 minmag NaN 1000 -> 1000
+dqmng148 minmag NaN Inf -> Infinity
+dqmng149 minmag NaN NaN -> NaN
+dqmng150 minmag -Inf NaN -> -Infinity
+dqmng151 minmag -1000 NaN -> -1000
+dqmng152 minmag -1 -NaN -> -1
+dqmng153 minmag -0 NaN -> -0
+dqmng154 minmag 0 -NaN -> 0
+dqmng155 minmag 1 NaN -> 1
+dqmng156 minmag 1000 NaN -> 1000
+dqmng157 minmag Inf NaN -> Infinity
+
+dqmng161 minmag sNaN -Inf -> NaN Invalid_operation
+dqmng162 minmag sNaN -1000 -> NaN Invalid_operation
+dqmng163 minmag sNaN -1 -> NaN Invalid_operation
+dqmng164 minmag sNaN -0 -> NaN Invalid_operation
+dqmng165 minmag -sNaN 0 -> -NaN Invalid_operation
+dqmng166 minmag -sNaN 1 -> -NaN Invalid_operation
+dqmng167 minmag sNaN 1000 -> NaN Invalid_operation
+dqmng168 minmag sNaN NaN -> NaN Invalid_operation
+dqmng169 minmag sNaN sNaN -> NaN Invalid_operation
+dqmng170 minmag NaN sNaN -> NaN Invalid_operation
+dqmng171 minmag -Inf sNaN -> NaN Invalid_operation
+dqmng172 minmag -1000 sNaN -> NaN Invalid_operation
+dqmng173 minmag -1 sNaN -> NaN Invalid_operation
+dqmng174 minmag -0 sNaN -> NaN Invalid_operation
+dqmng175 minmag 0 sNaN -> NaN Invalid_operation
+dqmng176 minmag 1 sNaN -> NaN Invalid_operation
+dqmng177 minmag 1000 sNaN -> NaN Invalid_operation
+dqmng178 minmag Inf sNaN -> NaN Invalid_operation
+dqmng179 minmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmng181 minmag NaN9 -Inf -> -Infinity
+dqmng182 minmag -NaN8 9990 -> 9990
+dqmng183 minmag NaN71 Inf -> Infinity
+
+dqmng184 minmag NaN1 NaN54 -> NaN1
+dqmng185 minmag NaN22 -NaN53 -> NaN22
+dqmng186 minmag -NaN3 NaN6 -> -NaN3
+dqmng187 minmag -NaN44 NaN7 -> -NaN44
+
+dqmng188 minmag -Inf NaN41 -> -Infinity
+dqmng189 minmag -9999 -NaN33 -> -9999
+dqmng190 minmag Inf NaN2 -> Infinity
+
+dqmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
+dqmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation
+dqmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
+dqmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
+dqmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
+dqmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation
+dqmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation
+
+-- old rounding checks
+dqmng221 minmag -12345678000 1 -> 1
+dqmng222 minmag 1 -12345678000 -> 1
+dqmng223 minmag -1234567800 1 -> 1
+dqmng224 minmag 1 -1234567800 -> 1
+dqmng225 minmag -1234567890 1 -> 1
+dqmng226 minmag 1 -1234567890 -> 1
+dqmng227 minmag -1234567891 1 -> 1
+dqmng228 minmag 1 -1234567891 -> 1
+dqmng229 minmag -12345678901 1 -> 1
+dqmng230 minmag 1 -12345678901 -> 1
+dqmng231 minmag -1234567896 1 -> 1
+dqmng232 minmag 1 -1234567896 -> 1
+dqmng233 minmag 1234567891 1 -> 1
+dqmng234 minmag 1 1234567891 -> 1
+dqmng235 minmag 12345678901 1 -> 1
+dqmng236 minmag 1 12345678901 -> 1
+dqmng237 minmag 1234567896 1 -> 1
+dqmng238 minmag 1 1234567896 -> 1
+
+-- from examples
+dqmng280 minmag '3' '2' -> '2'
+dqmng281 minmag '-10' '3' -> '3'
+dqmng282 minmag '1.0' '1' -> '1.0'
+dqmng283 minmag '1' '1.0' -> '1.0'
+dqmng284 minmag '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+dqmng401 minmag Inf 1.1 -> 1.1
+dqmng402 minmag 1.1 1 -> 1
+dqmng403 minmag 1 1.0 -> 1.0
+dqmng404 minmag 1.0 0.1 -> 0.1
+dqmng405 minmag 0.1 0.10 -> 0.10
+dqmng406 minmag 0.10 0.100 -> 0.100
+dqmng407 minmag 0.10 0 -> 0
+dqmng408 minmag 0 0.0 -> 0.0
+dqmng409 minmag 0.0 -0 -> -0
+dqmng410 minmag 0.0 -0.0 -> -0.0
+dqmng411 minmag 0.00 -0.0 -> -0.0
+dqmng412 minmag 0.0 -0.00 -> -0.00
+dqmng413 minmag 0 -0.0 -> -0.0
+dqmng414 minmag 0 -0 -> -0
+dqmng415 minmag -0.0 -0 -> -0
+dqmng416 minmag -0 -0.100 -> -0
+dqmng417 minmag -0.100 -0.10 -> -0.10
+dqmng418 minmag -0.10 -0.1 -> -0.1
+dqmng419 minmag -0.1 -1.0 -> -0.1
+dqmng420 minmag -1.0 -1 -> -1
+dqmng421 minmag -1 -1.1 -> -1
+dqmng423 minmag -1.1 -Inf -> -1.1
+-- same with operands reversed
+dqmng431 minmag 1.1 Inf -> 1.1
+dqmng432 minmag 1 1.1 -> 1
+dqmng433 minmag 1.0 1 -> 1.0
+dqmng434 minmag 0.1 1.0 -> 0.1
+dqmng435 minmag 0.10 0.1 -> 0.10
+dqmng436 minmag 0.100 0.10 -> 0.100
+dqmng437 minmag 0 0.10 -> 0
+dqmng438 minmag 0.0 0 -> 0.0
+dqmng439 minmag -0 0.0 -> -0
+dqmng440 minmag -0.0 0.0 -> -0.0
+dqmng441 minmag -0.0 0.00 -> -0.0
+dqmng442 minmag -0.00 0.0 -> -0.00
+dqmng443 minmag -0.0 0 -> -0.0
+dqmng444 minmag -0 0 -> -0
+dqmng445 minmag -0 -0.0 -> -0
+dqmng446 minmag -0.100 -0 -> -0
+dqmng447 minmag -0.10 -0.100 -> -0.10
+dqmng448 minmag -0.1 -0.10 -> -0.1
+dqmng449 minmag -1.0 -0.1 -> -0.1
+dqmng450 minmag -1 -1.0 -> -1
+dqmng451 minmag -1.1 -1 -> -1
+dqmng453 minmag -Inf -1.1 -> -1.1
+-- largies
+dqmng460 minmag 1000 1E+3 -> 1000
+dqmng461 minmag 1E+3 1000 -> 1000
+dqmng462 minmag 1000 -1E+3 -> -1E+3
+dqmng463 minmag 1E+3 -384 -> -384
+dqmng464 minmag -384 1E+3 -> -384
+dqmng465 minmag -1E+3 1000 -> -1E+3
+dqmng466 minmag -384 -1E+3 -> -384
+dqmng467 minmag -1E+3 -384 -> -384
+
+-- subnormals
+dqmng510 minmag 1.00E-6143 0 -> 0
+dqmng511 minmag 0.1E-6143 0 -> 0
+dqmng512 minmag 0.10E-6143 0 -> 0
+dqmng513 minmag 0.100E-6143 0 -> 0
+dqmng514 minmag 0.01E-6143 0 -> 0
+dqmng515 minmag 0.999E-6143 0 -> 0
+dqmng516 minmag 0.099E-6143 0 -> 0
+dqmng517 minmag 0.009E-6143 0 -> 0
+dqmng518 minmag 0.001E-6143 0 -> 0
+dqmng519 minmag 0.0009E-6143 0 -> 0
+dqmng520 minmag 0.0001E-6143 0 -> 0
+
+dqmng530 minmag -1.00E-6143 0 -> 0
+dqmng531 minmag -0.1E-6143 0 -> 0
+dqmng532 minmag -0.10E-6143 0 -> 0
+dqmng533 minmag -0.100E-6143 0 -> 0
+dqmng534 minmag -0.01E-6143 0 -> 0
+dqmng535 minmag -0.999E-6143 0 -> 0
+dqmng536 minmag -0.099E-6143 0 -> 0
+dqmng537 minmag -0.009E-6143 0 -> 0
+dqmng538 minmag -0.001E-6143 0 -> 0
+dqmng539 minmag -0.0009E-6143 0 -> 0
+dqmng540 minmag -0.0001E-6143 0 -> 0
+
+
+-- Null tests
+dqmng900 minmag 10 # -> NaN Invalid_operation
+dqmng901 minmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqMinus.decTest b/Lib/test/decimaltestdata/dqMinus.decTest
index 02e462e0be..7a007791bf 100644
--- a/Lib/test/decimaltestdata/dqMinus.decTest
+++ b/Lib/test/decimaltestdata/dqMinus.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqMinus.decTest -- decQuad 0-x --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqmns001 minus +7.50 -> -7.50
-
--- Infinities
-dqmns011 minus Infinity -> -Infinity
-dqmns012 minus -Infinity -> Infinity
-
--- NaNs, 0 payload
-dqmns021 minus NaN -> NaN
-dqmns022 minus -NaN -> -NaN
-dqmns023 minus sNaN -> NaN Invalid_operation
-dqmns024 minus -sNaN -> -NaN Invalid_operation
-
--- NaNs, non-0 payload
-dqmns031 minus NaN13 -> NaN13
-dqmns032 minus -NaN13 -> -NaN13
-dqmns033 minus sNaN13 -> NaN13 Invalid_operation
-dqmns034 minus -sNaN13 -> -NaN13 Invalid_operation
-dqmns035 minus NaN70 -> NaN70
-dqmns036 minus -NaN70 -> -NaN70
-dqmns037 minus sNaN101 -> NaN101 Invalid_operation
-dqmns038 minus -sNaN101 -> -NaN101 Invalid_operation
-
--- finites
-dqmns101 minus 7 -> -7
-dqmns102 minus -7 -> 7
-dqmns103 minus 75 -> -75
-dqmns104 minus -75 -> 75
-dqmns105 minus 7.50 -> -7.50
-dqmns106 minus -7.50 -> 7.50
-dqmns107 minus 7.500 -> -7.500
-dqmns108 minus -7.500 -> 7.500
-
--- zeros
-dqmns111 minus 0 -> 0
-dqmns112 minus -0 -> 0
-dqmns113 minus 0E+4 -> 0E+4
-dqmns114 minus -0E+4 -> 0E+4
-dqmns115 minus 0.0000 -> 0.0000
-dqmns116 minus -0.0000 -> 0.0000
-dqmns117 minus 0E-141 -> 0E-141
-dqmns118 minus -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqmns121 minus 2682682682682682682682682682682682 -> -2682682682682682682682682682682682
-dqmns122 minus -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqmns123 minus 1341341341341341341341341341341341 -> -1341341341341341341341341341341341
-dqmns124 minus -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqmns131 minus 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqmns132 minus 1E-6143 -> -1E-6143
-dqmns133 minus 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqmns134 minus 1E-6176 -> -1E-6176 Subnormal
-
-dqmns135 minus -1E-6176 -> 1E-6176 Subnormal
-dqmns136 minus -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqmns137 minus -1E-6143 -> 1E-6143
-dqmns138 minus -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqMinus.decTest -- decQuad 0-x --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqmns001 minus +7.50 -> -7.50
+
+-- Infinities
+dqmns011 minus Infinity -> -Infinity
+dqmns012 minus -Infinity -> Infinity
+
+-- NaNs, 0 payload
+dqmns021 minus NaN -> NaN
+dqmns022 minus -NaN -> -NaN
+dqmns023 minus sNaN -> NaN Invalid_operation
+dqmns024 minus -sNaN -> -NaN Invalid_operation
+
+-- NaNs, non-0 payload
+dqmns031 minus NaN13 -> NaN13
+dqmns032 minus -NaN13 -> -NaN13
+dqmns033 minus sNaN13 -> NaN13 Invalid_operation
+dqmns034 minus -sNaN13 -> -NaN13 Invalid_operation
+dqmns035 minus NaN70 -> NaN70
+dqmns036 minus -NaN70 -> -NaN70
+dqmns037 minus sNaN101 -> NaN101 Invalid_operation
+dqmns038 minus -sNaN101 -> -NaN101 Invalid_operation
+
+-- finites
+dqmns101 minus 7 -> -7
+dqmns102 minus -7 -> 7
+dqmns103 minus 75 -> -75
+dqmns104 minus -75 -> 75
+dqmns105 minus 7.50 -> -7.50
+dqmns106 minus -7.50 -> 7.50
+dqmns107 minus 7.500 -> -7.500
+dqmns108 minus -7.500 -> 7.500
+
+-- zeros
+dqmns111 minus 0 -> 0
+dqmns112 minus -0 -> 0
+dqmns113 minus 0E+4 -> 0E+4
+dqmns114 minus -0E+4 -> 0E+4
+dqmns115 minus 0.0000 -> 0.0000
+dqmns116 minus -0.0000 -> 0.0000
+dqmns117 minus 0E-141 -> 0E-141
+dqmns118 minus -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqmns121 minus 2682682682682682682682682682682682 -> -2682682682682682682682682682682682
+dqmns122 minus -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqmns123 minus 1341341341341341341341341341341341 -> -1341341341341341341341341341341341
+dqmns124 minus -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqmns131 minus 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqmns132 minus 1E-6143 -> -1E-6143
+dqmns133 minus 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqmns134 minus 1E-6176 -> -1E-6176 Subnormal
+
+dqmns135 minus -1E-6176 -> 1E-6176 Subnormal
+dqmns136 minus -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqmns137 minus -1E-6143 -> 1E-6143
+dqmns138 minus -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqMultiply.decTest b/Lib/test/decimaltestdata/dqMultiply.decTest
index 8387a858d3..676c1f5ea4 100644
--- a/Lib/test/decimaltestdata/dqMultiply.decTest
+++ b/Lib/test/decimaltestdata/dqMultiply.decTest
@@ -1,589 +1,589 @@
-------------------------------------------------------------------------
--- dqMultiply.decTest -- decQuad multiplication --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decQuads only; all arguments are
--- representable in a decQuad
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmul000 multiply 2 2 -> 4
-dqmul001 multiply 2 3 -> 6
-dqmul002 multiply 5 1 -> 5
-dqmul003 multiply 5 2 -> 10
-dqmul004 multiply 1.20 2 -> 2.40
-dqmul005 multiply 1.20 0 -> 0.00
-dqmul006 multiply 1.20 -2 -> -2.40
-dqmul007 multiply -1.20 2 -> -2.40
-dqmul008 multiply -1.20 0 -> -0.00
-dqmul009 multiply -1.20 -2 -> 2.40
-dqmul010 multiply 5.09 7.1 -> 36.139
-dqmul011 multiply 2.5 4 -> 10.0
-dqmul012 multiply 2.50 4 -> 10.00
-dqmul013 multiply 1.23456789 1.0000000000000000000000000000 -> 1.234567890000000000000000000000000 Rounded
-dqmul015 multiply 2.50 4 -> 10.00
-dqmul016 multiply 9.99999999999999999 9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
-dqmul017 multiply 9.99999999999999999 -9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
-dqmul018 multiply -9.99999999999999999 9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
-dqmul019 multiply -9.99999999999999999 -9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
-
--- zeros, etc.
-dqmul021 multiply 0 0 -> 0
-dqmul022 multiply 0 -0 -> -0
-dqmul023 multiply -0 0 -> -0
-dqmul024 multiply -0 -0 -> 0
-dqmul025 multiply -0.0 -0.0 -> 0.00
-dqmul026 multiply -0.0 -0.0 -> 0.00
-dqmul027 multiply -0.0 -0.0 -> 0.00
-dqmul028 multiply -0.0 -0.0 -> 0.00
-dqmul030 multiply 5.00 1E-3 -> 0.00500
-dqmul031 multiply 00.00 0.000 -> 0.00000
-dqmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
-dqmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
-dqmul034 multiply -5.00 1E-3 -> -0.00500
-dqmul035 multiply -00.00 0.000 -> -0.00000
-dqmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
-dqmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
-dqmul038 multiply 5.00 -1E-3 -> -0.00500
-dqmul039 multiply 00.00 -0.000 -> -0.00000
-dqmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
-dqmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
-dqmul042 multiply -5.00 -1E-3 -> 0.00500
-dqmul043 multiply -00.00 -0.000 -> 0.00000
-dqmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
-dqmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
-
--- examples from decarith
-dqmul050 multiply 1.20 3 -> 3.60
-dqmul051 multiply 7 3 -> 21
-dqmul052 multiply 0.9 0.8 -> 0.72
-dqmul053 multiply 0.9 -0 -> -0.0
-dqmul054 multiply 654321 654321 -> 428135971041
-
-dqmul060 multiply 123.45 1e7 -> 1.2345E+9
-dqmul061 multiply 123.45 1e8 -> 1.2345E+10
-dqmul062 multiply 123.45 1e+9 -> 1.2345E+11
-dqmul063 multiply 123.45 1e10 -> 1.2345E+12
-dqmul064 multiply 123.45 1e11 -> 1.2345E+13
-dqmul065 multiply 123.45 1e12 -> 1.2345E+14
-dqmul066 multiply 123.45 1e13 -> 1.2345E+15
-
-
--- test some intermediate lengths
--- 1234567890123456
-dqmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
-dqmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
-dqmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
-dqmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
-
--- test some more edge cases and carries
-dqmul101 multiply 9 9 -> 81
-dqmul102 multiply 9 90 -> 810
-dqmul103 multiply 9 900 -> 8100
-dqmul104 multiply 9 9000 -> 81000
-dqmul105 multiply 9 90000 -> 810000
-dqmul106 multiply 9 900000 -> 8100000
-dqmul107 multiply 9 9000000 -> 81000000
-dqmul108 multiply 9 90000000 -> 810000000
-dqmul109 multiply 9 900000000 -> 8100000000
-dqmul110 multiply 9 9000000000 -> 81000000000
-dqmul111 multiply 9 90000000000 -> 810000000000
-dqmul112 multiply 9 900000000000 -> 8100000000000
-dqmul113 multiply 9 9000000000000 -> 81000000000000
-dqmul114 multiply 9 90000000000000 -> 810000000000000
-dqmul115 multiply 9 900000000000000 -> 8100000000000000
---dqmul116 multiply 9 9000000000000000 -> 81000000000000000
---dqmul117 multiply 9 90000000000000000 -> 810000000000000000
---dqmul118 multiply 9 900000000000000000 -> 8100000000000000000
---dqmul119 multiply 9 9000000000000000000 -> 81000000000000000000
---dqmul120 multiply 9 90000000000000000000 -> 810000000000000000000
---dqmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
---dqmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
---dqmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
--- test some more edge cases without carries
-dqmul131 multiply 3 3 -> 9
-dqmul132 multiply 3 30 -> 90
-dqmul133 multiply 3 300 -> 900
-dqmul134 multiply 3 3000 -> 9000
-dqmul135 multiply 3 30000 -> 90000
-dqmul136 multiply 3 300000 -> 900000
-dqmul137 multiply 3 3000000 -> 9000000
-dqmul138 multiply 3 30000000 -> 90000000
-dqmul139 multiply 3 300000000 -> 900000000
-dqmul140 multiply 3 3000000000 -> 9000000000
-dqmul141 multiply 3 30000000000 -> 90000000000
-dqmul142 multiply 3 300000000000 -> 900000000000
-dqmul143 multiply 3 3000000000000 -> 9000000000000
-dqmul144 multiply 3 30000000000000 -> 90000000000000
-dqmul145 multiply 3 300000000000000 -> 900000000000000
-dqmul146 multiply 3 3000000000000000 -> 9000000000000000
-dqmul147 multiply 3 30000000000000000 -> 90000000000000000
-dqmul148 multiply 3 300000000000000000 -> 900000000000000000
-dqmul149 multiply 3 3000000000000000000 -> 9000000000000000000
-dqmul150 multiply 3 30000000000000000000 -> 90000000000000000000
-dqmul151 multiply 3 300000000000000000000 -> 900000000000000000000
-dqmul152 multiply 3 3000000000000000000000 -> 9000000000000000000000
-dqmul153 multiply 3 30000000000000000000000 -> 90000000000000000000000
-
-dqmul263 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165119928296 Inexact Rounded
-
--- test some edge cases with exact rounding
-dqmul301 multiply 900000000000000000 9 -> 8100000000000000000
-dqmul302 multiply 900000000000000000 90 -> 81000000000000000000
-dqmul303 multiply 900000000000000000 900 -> 810000000000000000000
-dqmul304 multiply 900000000000000000 9000 -> 8100000000000000000000
-dqmul305 multiply 900000000000000000 90000 -> 81000000000000000000000
-dqmul306 multiply 900000000000000000 900000 -> 810000000000000000000000
-dqmul307 multiply 900000000000000000 9000000 -> 8100000000000000000000000
-dqmul308 multiply 900000000000000000 90000000 -> 81000000000000000000000000
-dqmul309 multiply 900000000000000000 900000000 -> 810000000000000000000000000
-dqmul310 multiply 900000000000000000 9000000000 -> 8100000000000000000000000000
-dqmul311 multiply 900000000000000000 90000000000 -> 81000000000000000000000000000
-dqmul312 multiply 900000000000000000 900000000000 -> 810000000000000000000000000000
-dqmul313 multiply 900000000000000000 9000000000000 -> 8100000000000000000000000000000
-dqmul314 multiply 900000000000000000 90000000000000 -> 81000000000000000000000000000000
-dqmul315 multiply 900000000000000000 900000000000000 -> 810000000000000000000000000000000
-dqmul316 multiply 900000000000000000 9000000000000000 -> 8100000000000000000000000000000000
-dqmul317 multiply 9000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+34 Rounded
-dqmul318 multiply 90000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+35 Rounded
-dqmul319 multiply 900000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+36 Rounded
-dqmul320 multiply 9000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+37 Rounded
-dqmul321 multiply 90000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+38 Rounded
-dqmul322 multiply 900000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+39 Rounded
-dqmul323 multiply 9000000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+40 Rounded
-
--- tryzeros cases
-dqmul504 multiply 0E-4260 1000E-4260 -> 0E-6176 Clamped
-dqmul505 multiply 100E+4260 0E+4260 -> 0E+6111 Clamped
-
--- mixed with zeros
-dqmul541 multiply 0 -1 -> -0
-dqmul542 multiply -0 -1 -> 0
-dqmul543 multiply 0 1 -> 0
-dqmul544 multiply -0 1 -> -0
-dqmul545 multiply -1 0 -> -0
-dqmul546 multiply -1 -0 -> 0
-dqmul547 multiply 1 0 -> 0
-dqmul548 multiply 1 -0 -> -0
-
-dqmul551 multiply 0.0 -1 -> -0.0
-dqmul552 multiply -0.0 -1 -> 0.0
-dqmul553 multiply 0.0 1 -> 0.0
-dqmul554 multiply -0.0 1 -> -0.0
-dqmul555 multiply -1.0 0 -> -0.0
-dqmul556 multiply -1.0 -0 -> 0.0
-dqmul557 multiply 1.0 0 -> 0.0
-dqmul558 multiply 1.0 -0 -> -0.0
-
-dqmul561 multiply 0 -1.0 -> -0.0
-dqmul562 multiply -0 -1.0 -> 0.0
-dqmul563 multiply 0 1.0 -> 0.0
-dqmul564 multiply -0 1.0 -> -0.0
-dqmul565 multiply -1 0.0 -> -0.0
-dqmul566 multiply -1 -0.0 -> 0.0
-dqmul567 multiply 1 0.0 -> 0.0
-dqmul568 multiply 1 -0.0 -> -0.0
-
-dqmul571 multiply 0.0 -1.0 -> -0.00
-dqmul572 multiply -0.0 -1.0 -> 0.00
-dqmul573 multiply 0.0 1.0 -> 0.00
-dqmul574 multiply -0.0 1.0 -> -0.00
-dqmul575 multiply -1.0 0.0 -> -0.00
-dqmul576 multiply -1.0 -0.0 -> 0.00
-dqmul577 multiply 1.0 0.0 -> 0.00
-dqmul578 multiply 1.0 -0.0 -> -0.00
-
-
--- Specials
-dqmul580 multiply Inf -Inf -> -Infinity
-dqmul581 multiply Inf -1000 -> -Infinity
-dqmul582 multiply Inf -1 -> -Infinity
-dqmul583 multiply Inf -0 -> NaN Invalid_operation
-dqmul584 multiply Inf 0 -> NaN Invalid_operation
-dqmul585 multiply Inf 1 -> Infinity
-dqmul586 multiply Inf 1000 -> Infinity
-dqmul587 multiply Inf Inf -> Infinity
-dqmul588 multiply -1000 Inf -> -Infinity
-dqmul589 multiply -Inf Inf -> -Infinity
-dqmul590 multiply -1 Inf -> -Infinity
-dqmul591 multiply -0 Inf -> NaN Invalid_operation
-dqmul592 multiply 0 Inf -> NaN Invalid_operation
-dqmul593 multiply 1 Inf -> Infinity
-dqmul594 multiply 1000 Inf -> Infinity
-dqmul595 multiply Inf Inf -> Infinity
-
-dqmul600 multiply -Inf -Inf -> Infinity
-dqmul601 multiply -Inf -1000 -> Infinity
-dqmul602 multiply -Inf -1 -> Infinity
-dqmul603 multiply -Inf -0 -> NaN Invalid_operation
-dqmul604 multiply -Inf 0 -> NaN Invalid_operation
-dqmul605 multiply -Inf 1 -> -Infinity
-dqmul606 multiply -Inf 1000 -> -Infinity
-dqmul607 multiply -Inf Inf -> -Infinity
-dqmul608 multiply -1000 Inf -> -Infinity
-dqmul609 multiply -Inf -Inf -> Infinity
-dqmul610 multiply -1 -Inf -> Infinity
-dqmul611 multiply -0 -Inf -> NaN Invalid_operation
-dqmul612 multiply 0 -Inf -> NaN Invalid_operation
-dqmul613 multiply 1 -Inf -> -Infinity
-dqmul614 multiply 1000 -Inf -> -Infinity
-dqmul615 multiply Inf -Inf -> -Infinity
-
-dqmul621 multiply NaN -Inf -> NaN
-dqmul622 multiply NaN -1000 -> NaN
-dqmul623 multiply NaN -1 -> NaN
-dqmul624 multiply NaN -0 -> NaN
-dqmul625 multiply NaN 0 -> NaN
-dqmul626 multiply NaN 1 -> NaN
-dqmul627 multiply NaN 1000 -> NaN
-dqmul628 multiply NaN Inf -> NaN
-dqmul629 multiply NaN NaN -> NaN
-dqmul630 multiply -Inf NaN -> NaN
-dqmul631 multiply -1000 NaN -> NaN
-dqmul632 multiply -1 NaN -> NaN
-dqmul633 multiply -0 NaN -> NaN
-dqmul634 multiply 0 NaN -> NaN
-dqmul635 multiply 1 NaN -> NaN
-dqmul636 multiply 1000 NaN -> NaN
-dqmul637 multiply Inf NaN -> NaN
-
-dqmul641 multiply sNaN -Inf -> NaN Invalid_operation
-dqmul642 multiply sNaN -1000 -> NaN Invalid_operation
-dqmul643 multiply sNaN -1 -> NaN Invalid_operation
-dqmul644 multiply sNaN -0 -> NaN Invalid_operation
-dqmul645 multiply sNaN 0 -> NaN Invalid_operation
-dqmul646 multiply sNaN 1 -> NaN Invalid_operation
-dqmul647 multiply sNaN 1000 -> NaN Invalid_operation
-dqmul648 multiply sNaN NaN -> NaN Invalid_operation
-dqmul649 multiply sNaN sNaN -> NaN Invalid_operation
-dqmul650 multiply NaN sNaN -> NaN Invalid_operation
-dqmul651 multiply -Inf sNaN -> NaN Invalid_operation
-dqmul652 multiply -1000 sNaN -> NaN Invalid_operation
-dqmul653 multiply -1 sNaN -> NaN Invalid_operation
-dqmul654 multiply -0 sNaN -> NaN Invalid_operation
-dqmul655 multiply 0 sNaN -> NaN Invalid_operation
-dqmul656 multiply 1 sNaN -> NaN Invalid_operation
-dqmul657 multiply 1000 sNaN -> NaN Invalid_operation
-dqmul658 multiply Inf sNaN -> NaN Invalid_operation
-dqmul659 multiply NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmul661 multiply NaN9 -Inf -> NaN9
-dqmul662 multiply NaN8 999 -> NaN8
-dqmul663 multiply NaN71 Inf -> NaN71
-dqmul664 multiply NaN6 NaN5 -> NaN6
-dqmul665 multiply -Inf NaN4 -> NaN4
-dqmul666 multiply -999 NaN33 -> NaN33
-dqmul667 multiply Inf NaN2 -> NaN2
-
-dqmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
-dqmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
-dqmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
-dqmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
-dqmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
-dqmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
-dqmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
-dqmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
-
-dqmul681 multiply -NaN9 -Inf -> -NaN9
-dqmul682 multiply -NaN8 999 -> -NaN8
-dqmul683 multiply -NaN71 Inf -> -NaN71
-dqmul684 multiply -NaN6 -NaN5 -> -NaN6
-dqmul685 multiply -Inf -NaN4 -> -NaN4
-dqmul686 multiply -999 -NaN33 -> -NaN33
-dqmul687 multiply Inf -NaN2 -> -NaN2
-
-dqmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
-dqmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
-dqmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
-dqmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-dqmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
-dqmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
-dqmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
-
-dqmul701 multiply -NaN -Inf -> -NaN
-dqmul702 multiply -NaN 999 -> -NaN
-dqmul703 multiply -NaN Inf -> -NaN
-dqmul704 multiply -NaN -NaN -> -NaN
-dqmul705 multiply -Inf -NaN0 -> -NaN
-dqmul706 multiply -999 -NaN -> -NaN
-dqmul707 multiply Inf -NaN -> -NaN
-
-dqmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
-dqmul712 multiply -sNaN -11 -> -NaN Invalid_operation
-dqmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
-dqmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
-dqmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
-dqmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
-dqmul717 multiply 088 -sNaN -> -NaN Invalid_operation
-dqmul718 multiply Inf -sNaN -> -NaN Invalid_operation
-dqmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
--- signs
-dqmul751 multiply 1e+4277 1e+3311 -> Infinity Overflow Inexact Rounded
-dqmul752 multiply 1e+4277 -1e+3311 -> -Infinity Overflow Inexact Rounded
-dqmul753 multiply -1e+4277 1e+3311 -> -Infinity Overflow Inexact Rounded
-dqmul754 multiply -1e+4277 -1e+3311 -> Infinity Overflow Inexact Rounded
-dqmul755 multiply 1e-4277 1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul756 multiply 1e-4277 -1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul757 multiply -1e-4277 1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul758 multiply -1e-4277 -1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dqmul760 multiply 1e-6069 1e-101 -> 1E-6170 Subnormal
-dqmul761 multiply 1e-6069 1e-102 -> 1E-6171 Subnormal
-dqmul762 multiply 1e-6069 1e-103 -> 1E-6172 Subnormal
-dqmul763 multiply 1e-6069 1e-104 -> 1E-6173 Subnormal
-dqmul764 multiply 1e-6069 1e-105 -> 1E-6174 Subnormal
-dqmul765 multiply 1e-6069 1e-106 -> 1E-6175 Subnormal
-dqmul766 multiply 1e-6069 1e-107 -> 1E-6176 Subnormal
-dqmul767 multiply 1e-6069 1e-108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul768 multiply 1e-6069 1e-109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul769 multiply 1e-6069 1e-110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-dqmul770 multiply 1e+40 1e+6101 -> 1.000000000000000000000000000000E+6141 Clamped
-dqmul771 multiply 1e+40 1e+6102 -> 1.0000000000000000000000000000000E+6142 Clamped
-dqmul772 multiply 1e+40 1e+6103 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqmul773 multiply 1e+40 1e+6104 -> 1.000000000000000000000000000000000E+6144 Clamped
-dqmul774 multiply 1e+40 1e+6105 -> Infinity Overflow Inexact Rounded
-dqmul775 multiply 1e+40 1e+6106 -> Infinity Overflow Inexact Rounded
-dqmul776 multiply 1e+40 1e+6107 -> Infinity Overflow Inexact Rounded
-dqmul777 multiply 1e+40 1e+6108 -> Infinity Overflow Inexact Rounded
-dqmul778 multiply 1e+40 1e+6109 -> Infinity Overflow Inexact Rounded
-dqmul779 multiply 1e+40 1e+6110 -> Infinity Overflow Inexact Rounded
-
-dqmul801 multiply 1.0000E-6172 1 -> 1.0000E-6172 Subnormal
-dqmul802 multiply 1.000E-6172 1e-1 -> 1.000E-6173 Subnormal
-dqmul803 multiply 1.00E-6172 1e-2 -> 1.00E-6174 Subnormal
-dqmul804 multiply 1.0E-6172 1e-3 -> 1.0E-6175 Subnormal
-dqmul805 multiply 1.0E-6172 1e-4 -> 1E-6176 Subnormal Rounded
-dqmul806 multiply 1.3E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqmul807 multiply 1.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul808 multiply 1.7E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul809 multiply 2.3E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul810 multiply 2.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul811 multiply 2.7E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqmul812 multiply 1.49E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqmul813 multiply 1.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul814 multiply 1.51E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul815 multiply 2.49E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul816 multiply 2.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul817 multiply 2.51E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
-
-dqmul818 multiply 1E-6172 1e-4 -> 1E-6176 Subnormal
-dqmul819 multiply 3E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul820 multiply 5E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul821 multiply 7E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqmul822 multiply 9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqmul823 multiply 9.9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-
-dqmul824 multiply 1E-6172 -1e-4 -> -1E-6176 Subnormal
-dqmul825 multiply 3E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul826 multiply -5E-6172 1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul827 multiply 7E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqmul828 multiply -9E-6172 1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqmul829 multiply 9.9E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqmul830 multiply 3.0E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqmul831 multiply 1.0E-5977 1e-200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul832 multiply 1.0E-5977 1e-199 -> 1E-6176 Subnormal Rounded
-dqmul833 multiply 1.0E-5977 1e-198 -> 1.0E-6175 Subnormal
-dqmul834 multiply 2.0E-5977 2e-198 -> 4.0E-6175 Subnormal
-dqmul835 multiply 4.0E-5977 4e-198 -> 1.60E-6174 Subnormal
-dqmul836 multiply 10.0E-5977 10e-198 -> 1.000E-6173 Subnormal
-dqmul837 multiply 30.0E-5977 30e-198 -> 9.000E-6173 Subnormal
-dqmul838 multiply 40.0E-5982 40e-166 -> 1.6000E-6145 Subnormal
-dqmul839 multiply 40.0E-5982 40e-165 -> 1.6000E-6144 Subnormal
-dqmul840 multiply 40.0E-5982 40e-164 -> 1.6000E-6143
-
--- Long operand overflow may be a different path
-dqmul870 multiply 100 9.999E+6143 -> Infinity Inexact Overflow Rounded
-dqmul871 multiply 100 -9.999E+6143 -> -Infinity Inexact Overflow Rounded
-dqmul872 multiply 9.999E+6143 100 -> Infinity Inexact Overflow Rounded
-dqmul873 multiply -9.999E+6143 100 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-dqmul881 multiply 1.2347E-6133 1.2347E-40 -> 1.524E-6173 Inexact Rounded Subnormal Underflow
-dqmul882 multiply 1.234E-6133 1.234E-40 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqmul883 multiply 1.23E-6133 1.23E-40 -> 1.513E-6173 Inexact Rounded Subnormal Underflow
-dqmul884 multiply 1.2E-6133 1.2E-40 -> 1.44E-6173 Subnormal
-dqmul885 multiply 1.2E-6133 1.2E-41 -> 1.44E-6174 Subnormal
-dqmul886 multiply 1.2E-6133 1.2E-42 -> 1.4E-6175 Subnormal Inexact Rounded Underflow
-dqmul887 multiply 1.2E-6133 1.3E-42 -> 1.6E-6175 Subnormal Inexact Rounded Underflow
-dqmul888 multiply 1.3E-6133 1.3E-42 -> 1.7E-6175 Subnormal Inexact Rounded Underflow
-dqmul889 multiply 1.3E-6133 1.3E-43 -> 2E-6176 Subnormal Inexact Rounded Underflow
-dqmul890 multiply 1.3E-6134 1.3E-43 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow
-
-dqmul891 multiply 1.2345E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
-dqmul892 multiply 1.23456E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
-dqmul893 multiply 1.2345E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqmul894 multiply 1.23456E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqmul895 multiply 1.2345E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
-dqmul896 multiply 1.23456E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
--- prove operands are exact
-dqmul906 multiply 9.999999999999999999999999999999999E-6143 1 -> 9.999999999999999999999999999999999E-6143
-dqmul907 multiply 1 0.09999999999999999999999999999999999 -> 0.09999999999999999999999999999999999
--- the next rounds to Nmin
-dqmul908 multiply 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded
-
--- hugest
-dqmul909 multiply 9999999999999999999999999999999999 9999999999999999999999999999999999 -> 9.999999999999999999999999999999998E+67 Inexact Rounded
--- VG case
-dqmul910 multiply 8.81125000000001349436E-1548 8.000000000000000000E-1550 -> 7.049000000000010795488000000000000E-3097 Rounded
-
--- Examples from SQL proposal (Krishna Kulkarni)
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
-dqmul911 multiply 130E-2 120E-2 -> 1.5600
-dqmul912 multiply 130E-2 12E-1 -> 1.560
-dqmul913 multiply 130E-2 1E0 -> 1.30
-dqmul914 multiply 1E2 1E4 -> 1E+6
-
--- power-of-ten edge cases
-dqmul1001 multiply 1 10 -> 10
-dqmul1002 multiply 1 100 -> 100
-dqmul1003 multiply 1 1000 -> 1000
-dqmul1004 multiply 1 10000 -> 10000
-dqmul1005 multiply 1 100000 -> 100000
-dqmul1006 multiply 1 1000000 -> 1000000
-dqmul1007 multiply 1 10000000 -> 10000000
-dqmul1008 multiply 1 100000000 -> 100000000
-dqmul1009 multiply 1 1000000000 -> 1000000000
-dqmul1010 multiply 1 10000000000 -> 10000000000
-dqmul1011 multiply 1 100000000000 -> 100000000000
-dqmul1012 multiply 1 1000000000000 -> 1000000000000
-dqmul1013 multiply 1 10000000000000 -> 10000000000000
-dqmul1014 multiply 1 100000000000000 -> 100000000000000
-dqmul1015 multiply 1 1000000000000000 -> 1000000000000000
-
-dqmul1016 multiply 1 1000000000000000000 -> 1000000000000000000
-dqmul1017 multiply 1 100000000000000000000000000 -> 100000000000000000000000000
-dqmul1018 multiply 1 1000000000000000000000000000 -> 1000000000000000000000000000
-dqmul1019 multiply 1 10000000000000000000000000000 -> 10000000000000000000000000000
-dqmul1020 multiply 1 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1021 multiply 10 1 -> 10
-dqmul1022 multiply 10 10 -> 100
-dqmul1023 multiply 10 100 -> 1000
-dqmul1024 multiply 10 1000 -> 10000
-dqmul1025 multiply 10 10000 -> 100000
-dqmul1026 multiply 10 100000 -> 1000000
-dqmul1027 multiply 10 1000000 -> 10000000
-dqmul1028 multiply 10 10000000 -> 100000000
-dqmul1029 multiply 10 100000000 -> 1000000000
-dqmul1030 multiply 10 1000000000 -> 10000000000
-dqmul1031 multiply 10 10000000000 -> 100000000000
-dqmul1032 multiply 10 100000000000 -> 1000000000000
-dqmul1033 multiply 10 1000000000000 -> 10000000000000
-dqmul1034 multiply 10 10000000000000 -> 100000000000000
-dqmul1035 multiply 10 100000000000000 -> 1000000000000000
-
-dqmul1036 multiply 10 100000000000000000 -> 1000000000000000000
-dqmul1037 multiply 10 10000000000000000000000000 -> 100000000000000000000000000
-dqmul1038 multiply 10 100000000000000000000000000 -> 1000000000000000000000000000
-dqmul1039 multiply 10 1000000000000000000000000000 -> 10000000000000000000000000000
-dqmul1040 multiply 10 100000000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1041 multiply 100 0.1 -> 10.0
-dqmul1042 multiply 100 1 -> 100
-dqmul1043 multiply 100 10 -> 1000
-dqmul1044 multiply 100 100 -> 10000
-dqmul1045 multiply 100 1000 -> 100000
-dqmul1046 multiply 100 10000 -> 1000000
-dqmul1047 multiply 100 100000 -> 10000000
-dqmul1048 multiply 100 1000000 -> 100000000
-dqmul1049 multiply 100 10000000 -> 1000000000
-dqmul1050 multiply 100 100000000 -> 10000000000
-dqmul1051 multiply 100 1000000000 -> 100000000000
-dqmul1052 multiply 100 10000000000 -> 1000000000000
-dqmul1053 multiply 100 100000000000 -> 10000000000000
-dqmul1054 multiply 100 1000000000000 -> 100000000000000
-dqmul1055 multiply 100 10000000000000 -> 1000000000000000
-
-dqmul1056 multiply 100 10000000000000000 -> 1000000000000000000
-dqmul1057 multiply 100 1000000000000000000000000 -> 100000000000000000000000000
-dqmul1058 multiply 100 10000000000000000000000000 -> 1000000000000000000000000000
-dqmul1059 multiply 100 100000000000000000000000000 -> 10000000000000000000000000000
-dqmul1060 multiply 100 10000000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1061 multiply 1000 0.01 -> 10.00
-dqmul1062 multiply 1000 0.1 -> 100.0
-dqmul1063 multiply 1000 1 -> 1000
-dqmul1064 multiply 1000 10 -> 10000
-dqmul1065 multiply 1000 100 -> 100000
-dqmul1066 multiply 1000 1000 -> 1000000
-dqmul1067 multiply 1000 10000 -> 10000000
-dqmul1068 multiply 1000 100000 -> 100000000
-dqmul1069 multiply 1000 1000000 -> 1000000000
-dqmul1070 multiply 1000 10000000 -> 10000000000
-dqmul1071 multiply 1000 100000000 -> 100000000000
-dqmul1072 multiply 1000 1000000000 -> 1000000000000
-dqmul1073 multiply 1000 10000000000 -> 10000000000000
-dqmul1074 multiply 1000 100000000000 -> 100000000000000
-dqmul1075 multiply 1000 1000000000000 -> 1000000000000000
-
-dqmul1076 multiply 1000 1000000000000000 -> 1000000000000000000
-dqmul1077 multiply 1000 100000000000000000000000 -> 100000000000000000000000000
-dqmul1078 multiply 1000 1000000000000000000000000 -> 1000000000000000000000000000
-dqmul1079 multiply 1000 10000000000000000000000000 -> 10000000000000000000000000000
-dqmul1080 multiply 1000 1000000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1081 multiply 10000 0.001 -> 10.000
-dqmul1082 multiply 10000 0.01 -> 100.00
-dqmul1083 multiply 10000 0.1 -> 1000.0
-dqmul1084 multiply 10000 1 -> 10000
-dqmul1085 multiply 10000 10 -> 100000
-dqmul1086 multiply 10000 100 -> 1000000
-dqmul1087 multiply 10000 1000 -> 10000000
-dqmul1088 multiply 10000 10000 -> 100000000
-dqmul1089 multiply 10000 100000 -> 1000000000
-dqmul1090 multiply 10000 1000000 -> 10000000000
-dqmul1091 multiply 10000 10000000 -> 100000000000
-dqmul1092 multiply 10000 100000000 -> 1000000000000
-dqmul1093 multiply 10000 1000000000 -> 10000000000000
-dqmul1094 multiply 10000 10000000000 -> 100000000000000
-dqmul1095 multiply 10000 100000000000 -> 1000000000000000
-
-dqmul1096 multiply 10000 100000000000000 -> 1000000000000000000
-dqmul1097 multiply 10000 10000000000000000000000 -> 100000000000000000000000000
-dqmul1098 multiply 10000 100000000000000000000000 -> 1000000000000000000000000000
-dqmul1099 multiply 10000 1000000000000000000000000 -> 10000000000000000000000000000
-dqmul1100 multiply 10000 100000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1107 multiply 10000 99999999999 -> 999999999990000
-dqmul1108 multiply 10000 99999999999 -> 999999999990000
-
--- Null tests
-dqmul9990 multiply 10 # -> NaN Invalid_operation
-dqmul9991 multiply # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqMultiply.decTest -- decQuad multiplication --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decQuads only; all arguments are
+-- representable in a decQuad
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmul000 multiply 2 2 -> 4
+dqmul001 multiply 2 3 -> 6
+dqmul002 multiply 5 1 -> 5
+dqmul003 multiply 5 2 -> 10
+dqmul004 multiply 1.20 2 -> 2.40
+dqmul005 multiply 1.20 0 -> 0.00
+dqmul006 multiply 1.20 -2 -> -2.40
+dqmul007 multiply -1.20 2 -> -2.40
+dqmul008 multiply -1.20 0 -> -0.00
+dqmul009 multiply -1.20 -2 -> 2.40
+dqmul010 multiply 5.09 7.1 -> 36.139
+dqmul011 multiply 2.5 4 -> 10.0
+dqmul012 multiply 2.50 4 -> 10.00
+dqmul013 multiply 1.23456789 1.0000000000000000000000000000 -> 1.234567890000000000000000000000000 Rounded
+dqmul015 multiply 2.50 4 -> 10.00
+dqmul016 multiply 9.99999999999999999 9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
+dqmul017 multiply 9.99999999999999999 -9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
+dqmul018 multiply -9.99999999999999999 9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
+dqmul019 multiply -9.99999999999999999 -9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
+
+-- zeros, etc.
+dqmul021 multiply 0 0 -> 0
+dqmul022 multiply 0 -0 -> -0
+dqmul023 multiply -0 0 -> -0
+dqmul024 multiply -0 -0 -> 0
+dqmul025 multiply -0.0 -0.0 -> 0.00
+dqmul026 multiply -0.0 -0.0 -> 0.00
+dqmul027 multiply -0.0 -0.0 -> 0.00
+dqmul028 multiply -0.0 -0.0 -> 0.00
+dqmul030 multiply 5.00 1E-3 -> 0.00500
+dqmul031 multiply 00.00 0.000 -> 0.00000
+dqmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
+dqmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
+dqmul034 multiply -5.00 1E-3 -> -0.00500
+dqmul035 multiply -00.00 0.000 -> -0.00000
+dqmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
+dqmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
+dqmul038 multiply 5.00 -1E-3 -> -0.00500
+dqmul039 multiply 00.00 -0.000 -> -0.00000
+dqmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
+dqmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
+dqmul042 multiply -5.00 -1E-3 -> 0.00500
+dqmul043 multiply -00.00 -0.000 -> 0.00000
+dqmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
+dqmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
+
+-- examples from decarith
+dqmul050 multiply 1.20 3 -> 3.60
+dqmul051 multiply 7 3 -> 21
+dqmul052 multiply 0.9 0.8 -> 0.72
+dqmul053 multiply 0.9 -0 -> -0.0
+dqmul054 multiply 654321 654321 -> 428135971041
+
+dqmul060 multiply 123.45 1e7 -> 1.2345E+9
+dqmul061 multiply 123.45 1e8 -> 1.2345E+10
+dqmul062 multiply 123.45 1e+9 -> 1.2345E+11
+dqmul063 multiply 123.45 1e10 -> 1.2345E+12
+dqmul064 multiply 123.45 1e11 -> 1.2345E+13
+dqmul065 multiply 123.45 1e12 -> 1.2345E+14
+dqmul066 multiply 123.45 1e13 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+-- 1234567890123456
+dqmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
+dqmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
+dqmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
+dqmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
+
+-- test some more edge cases and carries
+dqmul101 multiply 9 9 -> 81
+dqmul102 multiply 9 90 -> 810
+dqmul103 multiply 9 900 -> 8100
+dqmul104 multiply 9 9000 -> 81000
+dqmul105 multiply 9 90000 -> 810000
+dqmul106 multiply 9 900000 -> 8100000
+dqmul107 multiply 9 9000000 -> 81000000
+dqmul108 multiply 9 90000000 -> 810000000
+dqmul109 multiply 9 900000000 -> 8100000000
+dqmul110 multiply 9 9000000000 -> 81000000000
+dqmul111 multiply 9 90000000000 -> 810000000000
+dqmul112 multiply 9 900000000000 -> 8100000000000
+dqmul113 multiply 9 9000000000000 -> 81000000000000
+dqmul114 multiply 9 90000000000000 -> 810000000000000
+dqmul115 multiply 9 900000000000000 -> 8100000000000000
+--dqmul116 multiply 9 9000000000000000 -> 81000000000000000
+--dqmul117 multiply 9 90000000000000000 -> 810000000000000000
+--dqmul118 multiply 9 900000000000000000 -> 8100000000000000000
+--dqmul119 multiply 9 9000000000000000000 -> 81000000000000000000
+--dqmul120 multiply 9 90000000000000000000 -> 810000000000000000000
+--dqmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
+--dqmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
+--dqmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
+-- test some more edge cases without carries
+dqmul131 multiply 3 3 -> 9
+dqmul132 multiply 3 30 -> 90
+dqmul133 multiply 3 300 -> 900
+dqmul134 multiply 3 3000 -> 9000
+dqmul135 multiply 3 30000 -> 90000
+dqmul136 multiply 3 300000 -> 900000
+dqmul137 multiply 3 3000000 -> 9000000
+dqmul138 multiply 3 30000000 -> 90000000
+dqmul139 multiply 3 300000000 -> 900000000
+dqmul140 multiply 3 3000000000 -> 9000000000
+dqmul141 multiply 3 30000000000 -> 90000000000
+dqmul142 multiply 3 300000000000 -> 900000000000
+dqmul143 multiply 3 3000000000000 -> 9000000000000
+dqmul144 multiply 3 30000000000000 -> 90000000000000
+dqmul145 multiply 3 300000000000000 -> 900000000000000
+dqmul146 multiply 3 3000000000000000 -> 9000000000000000
+dqmul147 multiply 3 30000000000000000 -> 90000000000000000
+dqmul148 multiply 3 300000000000000000 -> 900000000000000000
+dqmul149 multiply 3 3000000000000000000 -> 9000000000000000000
+dqmul150 multiply 3 30000000000000000000 -> 90000000000000000000
+dqmul151 multiply 3 300000000000000000000 -> 900000000000000000000
+dqmul152 multiply 3 3000000000000000000000 -> 9000000000000000000000
+dqmul153 multiply 3 30000000000000000000000 -> 90000000000000000000000
+
+dqmul263 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165119928296 Inexact Rounded
+
+-- test some edge cases with exact rounding
+dqmul301 multiply 900000000000000000 9 -> 8100000000000000000
+dqmul302 multiply 900000000000000000 90 -> 81000000000000000000
+dqmul303 multiply 900000000000000000 900 -> 810000000000000000000
+dqmul304 multiply 900000000000000000 9000 -> 8100000000000000000000
+dqmul305 multiply 900000000000000000 90000 -> 81000000000000000000000
+dqmul306 multiply 900000000000000000 900000 -> 810000000000000000000000
+dqmul307 multiply 900000000000000000 9000000 -> 8100000000000000000000000
+dqmul308 multiply 900000000000000000 90000000 -> 81000000000000000000000000
+dqmul309 multiply 900000000000000000 900000000 -> 810000000000000000000000000
+dqmul310 multiply 900000000000000000 9000000000 -> 8100000000000000000000000000
+dqmul311 multiply 900000000000000000 90000000000 -> 81000000000000000000000000000
+dqmul312 multiply 900000000000000000 900000000000 -> 810000000000000000000000000000
+dqmul313 multiply 900000000000000000 9000000000000 -> 8100000000000000000000000000000
+dqmul314 multiply 900000000000000000 90000000000000 -> 81000000000000000000000000000000
+dqmul315 multiply 900000000000000000 900000000000000 -> 810000000000000000000000000000000
+dqmul316 multiply 900000000000000000 9000000000000000 -> 8100000000000000000000000000000000
+dqmul317 multiply 9000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+34 Rounded
+dqmul318 multiply 90000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+35 Rounded
+dqmul319 multiply 900000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+36 Rounded
+dqmul320 multiply 9000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+37 Rounded
+dqmul321 multiply 90000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+38 Rounded
+dqmul322 multiply 900000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+39 Rounded
+dqmul323 multiply 9000000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+40 Rounded
+
+-- tryzeros cases
+dqmul504 multiply 0E-4260 1000E-4260 -> 0E-6176 Clamped
+dqmul505 multiply 100E+4260 0E+4260 -> 0E+6111 Clamped
+
+-- mixed with zeros
+dqmul541 multiply 0 -1 -> -0
+dqmul542 multiply -0 -1 -> 0
+dqmul543 multiply 0 1 -> 0
+dqmul544 multiply -0 1 -> -0
+dqmul545 multiply -1 0 -> -0
+dqmul546 multiply -1 -0 -> 0
+dqmul547 multiply 1 0 -> 0
+dqmul548 multiply 1 -0 -> -0
+
+dqmul551 multiply 0.0 -1 -> -0.0
+dqmul552 multiply -0.0 -1 -> 0.0
+dqmul553 multiply 0.0 1 -> 0.0
+dqmul554 multiply -0.0 1 -> -0.0
+dqmul555 multiply -1.0 0 -> -0.0
+dqmul556 multiply -1.0 -0 -> 0.0
+dqmul557 multiply 1.0 0 -> 0.0
+dqmul558 multiply 1.0 -0 -> -0.0
+
+dqmul561 multiply 0 -1.0 -> -0.0
+dqmul562 multiply -0 -1.0 -> 0.0
+dqmul563 multiply 0 1.0 -> 0.0
+dqmul564 multiply -0 1.0 -> -0.0
+dqmul565 multiply -1 0.0 -> -0.0
+dqmul566 multiply -1 -0.0 -> 0.0
+dqmul567 multiply 1 0.0 -> 0.0
+dqmul568 multiply 1 -0.0 -> -0.0
+
+dqmul571 multiply 0.0 -1.0 -> -0.00
+dqmul572 multiply -0.0 -1.0 -> 0.00
+dqmul573 multiply 0.0 1.0 -> 0.00
+dqmul574 multiply -0.0 1.0 -> -0.00
+dqmul575 multiply -1.0 0.0 -> -0.00
+dqmul576 multiply -1.0 -0.0 -> 0.00
+dqmul577 multiply 1.0 0.0 -> 0.00
+dqmul578 multiply 1.0 -0.0 -> -0.00
+
+
+-- Specials
+dqmul580 multiply Inf -Inf -> -Infinity
+dqmul581 multiply Inf -1000 -> -Infinity
+dqmul582 multiply Inf -1 -> -Infinity
+dqmul583 multiply Inf -0 -> NaN Invalid_operation
+dqmul584 multiply Inf 0 -> NaN Invalid_operation
+dqmul585 multiply Inf 1 -> Infinity
+dqmul586 multiply Inf 1000 -> Infinity
+dqmul587 multiply Inf Inf -> Infinity
+dqmul588 multiply -1000 Inf -> -Infinity
+dqmul589 multiply -Inf Inf -> -Infinity
+dqmul590 multiply -1 Inf -> -Infinity
+dqmul591 multiply -0 Inf -> NaN Invalid_operation
+dqmul592 multiply 0 Inf -> NaN Invalid_operation
+dqmul593 multiply 1 Inf -> Infinity
+dqmul594 multiply 1000 Inf -> Infinity
+dqmul595 multiply Inf Inf -> Infinity
+
+dqmul600 multiply -Inf -Inf -> Infinity
+dqmul601 multiply -Inf -1000 -> Infinity
+dqmul602 multiply -Inf -1 -> Infinity
+dqmul603 multiply -Inf -0 -> NaN Invalid_operation
+dqmul604 multiply -Inf 0 -> NaN Invalid_operation
+dqmul605 multiply -Inf 1 -> -Infinity
+dqmul606 multiply -Inf 1000 -> -Infinity
+dqmul607 multiply -Inf Inf -> -Infinity
+dqmul608 multiply -1000 Inf -> -Infinity
+dqmul609 multiply -Inf -Inf -> Infinity
+dqmul610 multiply -1 -Inf -> Infinity
+dqmul611 multiply -0 -Inf -> NaN Invalid_operation
+dqmul612 multiply 0 -Inf -> NaN Invalid_operation
+dqmul613 multiply 1 -Inf -> -Infinity
+dqmul614 multiply 1000 -Inf -> -Infinity
+dqmul615 multiply Inf -Inf -> -Infinity
+
+dqmul621 multiply NaN -Inf -> NaN
+dqmul622 multiply NaN -1000 -> NaN
+dqmul623 multiply NaN -1 -> NaN
+dqmul624 multiply NaN -0 -> NaN
+dqmul625 multiply NaN 0 -> NaN
+dqmul626 multiply NaN 1 -> NaN
+dqmul627 multiply NaN 1000 -> NaN
+dqmul628 multiply NaN Inf -> NaN
+dqmul629 multiply NaN NaN -> NaN
+dqmul630 multiply -Inf NaN -> NaN
+dqmul631 multiply -1000 NaN -> NaN
+dqmul632 multiply -1 NaN -> NaN
+dqmul633 multiply -0 NaN -> NaN
+dqmul634 multiply 0 NaN -> NaN
+dqmul635 multiply 1 NaN -> NaN
+dqmul636 multiply 1000 NaN -> NaN
+dqmul637 multiply Inf NaN -> NaN
+
+dqmul641 multiply sNaN -Inf -> NaN Invalid_operation
+dqmul642 multiply sNaN -1000 -> NaN Invalid_operation
+dqmul643 multiply sNaN -1 -> NaN Invalid_operation
+dqmul644 multiply sNaN -0 -> NaN Invalid_operation
+dqmul645 multiply sNaN 0 -> NaN Invalid_operation
+dqmul646 multiply sNaN 1 -> NaN Invalid_operation
+dqmul647 multiply sNaN 1000 -> NaN Invalid_operation
+dqmul648 multiply sNaN NaN -> NaN Invalid_operation
+dqmul649 multiply sNaN sNaN -> NaN Invalid_operation
+dqmul650 multiply NaN sNaN -> NaN Invalid_operation
+dqmul651 multiply -Inf sNaN -> NaN Invalid_operation
+dqmul652 multiply -1000 sNaN -> NaN Invalid_operation
+dqmul653 multiply -1 sNaN -> NaN Invalid_operation
+dqmul654 multiply -0 sNaN -> NaN Invalid_operation
+dqmul655 multiply 0 sNaN -> NaN Invalid_operation
+dqmul656 multiply 1 sNaN -> NaN Invalid_operation
+dqmul657 multiply 1000 sNaN -> NaN Invalid_operation
+dqmul658 multiply Inf sNaN -> NaN Invalid_operation
+dqmul659 multiply NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmul661 multiply NaN9 -Inf -> NaN9
+dqmul662 multiply NaN8 999 -> NaN8
+dqmul663 multiply NaN71 Inf -> NaN71
+dqmul664 multiply NaN6 NaN5 -> NaN6
+dqmul665 multiply -Inf NaN4 -> NaN4
+dqmul666 multiply -999 NaN33 -> NaN33
+dqmul667 multiply Inf NaN2 -> NaN2
+
+dqmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
+dqmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
+dqmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
+dqmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
+dqmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
+dqmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
+dqmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
+dqmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
+
+dqmul681 multiply -NaN9 -Inf -> -NaN9
+dqmul682 multiply -NaN8 999 -> -NaN8
+dqmul683 multiply -NaN71 Inf -> -NaN71
+dqmul684 multiply -NaN6 -NaN5 -> -NaN6
+dqmul685 multiply -Inf -NaN4 -> -NaN4
+dqmul686 multiply -999 -NaN33 -> -NaN33
+dqmul687 multiply Inf -NaN2 -> -NaN2
+
+dqmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
+dqmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
+dqmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
+dqmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+dqmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
+dqmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
+dqmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
+
+dqmul701 multiply -NaN -Inf -> -NaN
+dqmul702 multiply -NaN 999 -> -NaN
+dqmul703 multiply -NaN Inf -> -NaN
+dqmul704 multiply -NaN -NaN -> -NaN
+dqmul705 multiply -Inf -NaN0 -> -NaN
+dqmul706 multiply -999 -NaN -> -NaN
+dqmul707 multiply Inf -NaN -> -NaN
+
+dqmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
+dqmul712 multiply -sNaN -11 -> -NaN Invalid_operation
+dqmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
+dqmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
+dqmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
+dqmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
+dqmul717 multiply 088 -sNaN -> -NaN Invalid_operation
+dqmul718 multiply Inf -sNaN -> -NaN Invalid_operation
+dqmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+dqmul751 multiply 1e+4277 1e+3311 -> Infinity Overflow Inexact Rounded
+dqmul752 multiply 1e+4277 -1e+3311 -> -Infinity Overflow Inexact Rounded
+dqmul753 multiply -1e+4277 1e+3311 -> -Infinity Overflow Inexact Rounded
+dqmul754 multiply -1e+4277 -1e+3311 -> Infinity Overflow Inexact Rounded
+dqmul755 multiply 1e-4277 1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul756 multiply 1e-4277 -1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul757 multiply -1e-4277 1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul758 multiply -1e-4277 -1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dqmul760 multiply 1e-6069 1e-101 -> 1E-6170 Subnormal
+dqmul761 multiply 1e-6069 1e-102 -> 1E-6171 Subnormal
+dqmul762 multiply 1e-6069 1e-103 -> 1E-6172 Subnormal
+dqmul763 multiply 1e-6069 1e-104 -> 1E-6173 Subnormal
+dqmul764 multiply 1e-6069 1e-105 -> 1E-6174 Subnormal
+dqmul765 multiply 1e-6069 1e-106 -> 1E-6175 Subnormal
+dqmul766 multiply 1e-6069 1e-107 -> 1E-6176 Subnormal
+dqmul767 multiply 1e-6069 1e-108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul768 multiply 1e-6069 1e-109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul769 multiply 1e-6069 1e-110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+dqmul770 multiply 1e+40 1e+6101 -> 1.000000000000000000000000000000E+6141 Clamped
+dqmul771 multiply 1e+40 1e+6102 -> 1.0000000000000000000000000000000E+6142 Clamped
+dqmul772 multiply 1e+40 1e+6103 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqmul773 multiply 1e+40 1e+6104 -> 1.000000000000000000000000000000000E+6144 Clamped
+dqmul774 multiply 1e+40 1e+6105 -> Infinity Overflow Inexact Rounded
+dqmul775 multiply 1e+40 1e+6106 -> Infinity Overflow Inexact Rounded
+dqmul776 multiply 1e+40 1e+6107 -> Infinity Overflow Inexact Rounded
+dqmul777 multiply 1e+40 1e+6108 -> Infinity Overflow Inexact Rounded
+dqmul778 multiply 1e+40 1e+6109 -> Infinity Overflow Inexact Rounded
+dqmul779 multiply 1e+40 1e+6110 -> Infinity Overflow Inexact Rounded
+
+dqmul801 multiply 1.0000E-6172 1 -> 1.0000E-6172 Subnormal
+dqmul802 multiply 1.000E-6172 1e-1 -> 1.000E-6173 Subnormal
+dqmul803 multiply 1.00E-6172 1e-2 -> 1.00E-6174 Subnormal
+dqmul804 multiply 1.0E-6172 1e-3 -> 1.0E-6175 Subnormal
+dqmul805 multiply 1.0E-6172 1e-4 -> 1E-6176 Subnormal Rounded
+dqmul806 multiply 1.3E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqmul807 multiply 1.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul808 multiply 1.7E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul809 multiply 2.3E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul810 multiply 2.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul811 multiply 2.7E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqmul812 multiply 1.49E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqmul813 multiply 1.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul814 multiply 1.51E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul815 multiply 2.49E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul816 multiply 2.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul817 multiply 2.51E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
+
+dqmul818 multiply 1E-6172 1e-4 -> 1E-6176 Subnormal
+dqmul819 multiply 3E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul820 multiply 5E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul821 multiply 7E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqmul822 multiply 9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqmul823 multiply 9.9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+dqmul824 multiply 1E-6172 -1e-4 -> -1E-6176 Subnormal
+dqmul825 multiply 3E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul826 multiply -5E-6172 1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul827 multiply 7E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqmul828 multiply -9E-6172 1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqmul829 multiply 9.9E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqmul830 multiply 3.0E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqmul831 multiply 1.0E-5977 1e-200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul832 multiply 1.0E-5977 1e-199 -> 1E-6176 Subnormal Rounded
+dqmul833 multiply 1.0E-5977 1e-198 -> 1.0E-6175 Subnormal
+dqmul834 multiply 2.0E-5977 2e-198 -> 4.0E-6175 Subnormal
+dqmul835 multiply 4.0E-5977 4e-198 -> 1.60E-6174 Subnormal
+dqmul836 multiply 10.0E-5977 10e-198 -> 1.000E-6173 Subnormal
+dqmul837 multiply 30.0E-5977 30e-198 -> 9.000E-6173 Subnormal
+dqmul838 multiply 40.0E-5982 40e-166 -> 1.6000E-6145 Subnormal
+dqmul839 multiply 40.0E-5982 40e-165 -> 1.6000E-6144 Subnormal
+dqmul840 multiply 40.0E-5982 40e-164 -> 1.6000E-6143
+
+-- Long operand overflow may be a different path
+dqmul870 multiply 100 9.999E+6143 -> Infinity Inexact Overflow Rounded
+dqmul871 multiply 100 -9.999E+6143 -> -Infinity Inexact Overflow Rounded
+dqmul872 multiply 9.999E+6143 100 -> Infinity Inexact Overflow Rounded
+dqmul873 multiply -9.999E+6143 100 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+dqmul881 multiply 1.2347E-6133 1.2347E-40 -> 1.524E-6173 Inexact Rounded Subnormal Underflow
+dqmul882 multiply 1.234E-6133 1.234E-40 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqmul883 multiply 1.23E-6133 1.23E-40 -> 1.513E-6173 Inexact Rounded Subnormal Underflow
+dqmul884 multiply 1.2E-6133 1.2E-40 -> 1.44E-6173 Subnormal
+dqmul885 multiply 1.2E-6133 1.2E-41 -> 1.44E-6174 Subnormal
+dqmul886 multiply 1.2E-6133 1.2E-42 -> 1.4E-6175 Subnormal Inexact Rounded Underflow
+dqmul887 multiply 1.2E-6133 1.3E-42 -> 1.6E-6175 Subnormal Inexact Rounded Underflow
+dqmul888 multiply 1.3E-6133 1.3E-42 -> 1.7E-6175 Subnormal Inexact Rounded Underflow
+dqmul889 multiply 1.3E-6133 1.3E-43 -> 2E-6176 Subnormal Inexact Rounded Underflow
+dqmul890 multiply 1.3E-6134 1.3E-43 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow
+
+dqmul891 multiply 1.2345E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
+dqmul892 multiply 1.23456E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
+dqmul893 multiply 1.2345E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqmul894 multiply 1.23456E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqmul895 multiply 1.2345E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
+dqmul896 multiply 1.23456E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+-- prove operands are exact
+dqmul906 multiply 9.999999999999999999999999999999999E-6143 1 -> 9.999999999999999999999999999999999E-6143
+dqmul907 multiply 1 0.09999999999999999999999999999999999 -> 0.09999999999999999999999999999999999
+-- the next rounds to Nmin
+dqmul908 multiply 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded
+
+-- hugest
+dqmul909 multiply 9999999999999999999999999999999999 9999999999999999999999999999999999 -> 9.999999999999999999999999999999998E+67 Inexact Rounded
+-- VG case
+dqmul910 multiply 8.81125000000001349436E-1548 8.000000000000000000E-1550 -> 7.049000000000010795488000000000000E-3097 Rounded
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+dqmul911 multiply 130E-2 120E-2 -> 1.5600
+dqmul912 multiply 130E-2 12E-1 -> 1.560
+dqmul913 multiply 130E-2 1E0 -> 1.30
+dqmul914 multiply 1E2 1E4 -> 1E+6
+
+-- power-of-ten edge cases
+dqmul1001 multiply 1 10 -> 10
+dqmul1002 multiply 1 100 -> 100
+dqmul1003 multiply 1 1000 -> 1000
+dqmul1004 multiply 1 10000 -> 10000
+dqmul1005 multiply 1 100000 -> 100000
+dqmul1006 multiply 1 1000000 -> 1000000
+dqmul1007 multiply 1 10000000 -> 10000000
+dqmul1008 multiply 1 100000000 -> 100000000
+dqmul1009 multiply 1 1000000000 -> 1000000000
+dqmul1010 multiply 1 10000000000 -> 10000000000
+dqmul1011 multiply 1 100000000000 -> 100000000000
+dqmul1012 multiply 1 1000000000000 -> 1000000000000
+dqmul1013 multiply 1 10000000000000 -> 10000000000000
+dqmul1014 multiply 1 100000000000000 -> 100000000000000
+dqmul1015 multiply 1 1000000000000000 -> 1000000000000000
+
+dqmul1016 multiply 1 1000000000000000000 -> 1000000000000000000
+dqmul1017 multiply 1 100000000000000000000000000 -> 100000000000000000000000000
+dqmul1018 multiply 1 1000000000000000000000000000 -> 1000000000000000000000000000
+dqmul1019 multiply 1 10000000000000000000000000000 -> 10000000000000000000000000000
+dqmul1020 multiply 1 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1021 multiply 10 1 -> 10
+dqmul1022 multiply 10 10 -> 100
+dqmul1023 multiply 10 100 -> 1000
+dqmul1024 multiply 10 1000 -> 10000
+dqmul1025 multiply 10 10000 -> 100000
+dqmul1026 multiply 10 100000 -> 1000000
+dqmul1027 multiply 10 1000000 -> 10000000
+dqmul1028 multiply 10 10000000 -> 100000000
+dqmul1029 multiply 10 100000000 -> 1000000000
+dqmul1030 multiply 10 1000000000 -> 10000000000
+dqmul1031 multiply 10 10000000000 -> 100000000000
+dqmul1032 multiply 10 100000000000 -> 1000000000000
+dqmul1033 multiply 10 1000000000000 -> 10000000000000
+dqmul1034 multiply 10 10000000000000 -> 100000000000000
+dqmul1035 multiply 10 100000000000000 -> 1000000000000000
+
+dqmul1036 multiply 10 100000000000000000 -> 1000000000000000000
+dqmul1037 multiply 10 10000000000000000000000000 -> 100000000000000000000000000
+dqmul1038 multiply 10 100000000000000000000000000 -> 1000000000000000000000000000
+dqmul1039 multiply 10 1000000000000000000000000000 -> 10000000000000000000000000000
+dqmul1040 multiply 10 100000000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1041 multiply 100 0.1 -> 10.0
+dqmul1042 multiply 100 1 -> 100
+dqmul1043 multiply 100 10 -> 1000
+dqmul1044 multiply 100 100 -> 10000
+dqmul1045 multiply 100 1000 -> 100000
+dqmul1046 multiply 100 10000 -> 1000000
+dqmul1047 multiply 100 100000 -> 10000000
+dqmul1048 multiply 100 1000000 -> 100000000
+dqmul1049 multiply 100 10000000 -> 1000000000
+dqmul1050 multiply 100 100000000 -> 10000000000
+dqmul1051 multiply 100 1000000000 -> 100000000000
+dqmul1052 multiply 100 10000000000 -> 1000000000000
+dqmul1053 multiply 100 100000000000 -> 10000000000000
+dqmul1054 multiply 100 1000000000000 -> 100000000000000
+dqmul1055 multiply 100 10000000000000 -> 1000000000000000
+
+dqmul1056 multiply 100 10000000000000000 -> 1000000000000000000
+dqmul1057 multiply 100 1000000000000000000000000 -> 100000000000000000000000000
+dqmul1058 multiply 100 10000000000000000000000000 -> 1000000000000000000000000000
+dqmul1059 multiply 100 100000000000000000000000000 -> 10000000000000000000000000000
+dqmul1060 multiply 100 10000000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1061 multiply 1000 0.01 -> 10.00
+dqmul1062 multiply 1000 0.1 -> 100.0
+dqmul1063 multiply 1000 1 -> 1000
+dqmul1064 multiply 1000 10 -> 10000
+dqmul1065 multiply 1000 100 -> 100000
+dqmul1066 multiply 1000 1000 -> 1000000
+dqmul1067 multiply 1000 10000 -> 10000000
+dqmul1068 multiply 1000 100000 -> 100000000
+dqmul1069 multiply 1000 1000000 -> 1000000000
+dqmul1070 multiply 1000 10000000 -> 10000000000
+dqmul1071 multiply 1000 100000000 -> 100000000000
+dqmul1072 multiply 1000 1000000000 -> 1000000000000
+dqmul1073 multiply 1000 10000000000 -> 10000000000000
+dqmul1074 multiply 1000 100000000000 -> 100000000000000
+dqmul1075 multiply 1000 1000000000000 -> 1000000000000000
+
+dqmul1076 multiply 1000 1000000000000000 -> 1000000000000000000
+dqmul1077 multiply 1000 100000000000000000000000 -> 100000000000000000000000000
+dqmul1078 multiply 1000 1000000000000000000000000 -> 1000000000000000000000000000
+dqmul1079 multiply 1000 10000000000000000000000000 -> 10000000000000000000000000000
+dqmul1080 multiply 1000 1000000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1081 multiply 10000 0.001 -> 10.000
+dqmul1082 multiply 10000 0.01 -> 100.00
+dqmul1083 multiply 10000 0.1 -> 1000.0
+dqmul1084 multiply 10000 1 -> 10000
+dqmul1085 multiply 10000 10 -> 100000
+dqmul1086 multiply 10000 100 -> 1000000
+dqmul1087 multiply 10000 1000 -> 10000000
+dqmul1088 multiply 10000 10000 -> 100000000
+dqmul1089 multiply 10000 100000 -> 1000000000
+dqmul1090 multiply 10000 1000000 -> 10000000000
+dqmul1091 multiply 10000 10000000 -> 100000000000
+dqmul1092 multiply 10000 100000000 -> 1000000000000
+dqmul1093 multiply 10000 1000000000 -> 10000000000000
+dqmul1094 multiply 10000 10000000000 -> 100000000000000
+dqmul1095 multiply 10000 100000000000 -> 1000000000000000
+
+dqmul1096 multiply 10000 100000000000000 -> 1000000000000000000
+dqmul1097 multiply 10000 10000000000000000000000 -> 100000000000000000000000000
+dqmul1098 multiply 10000 100000000000000000000000 -> 1000000000000000000000000000
+dqmul1099 multiply 10000 1000000000000000000000000 -> 10000000000000000000000000000
+dqmul1100 multiply 10000 100000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1107 multiply 10000 99999999999 -> 999999999990000
+dqmul1108 multiply 10000 99999999999 -> 999999999990000
+
+-- Null tests
+dqmul9990 multiply 10 # -> NaN Invalid_operation
+dqmul9991 multiply # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqNextMinus.decTest b/Lib/test/decimaltestdata/dqNextMinus.decTest
index 8177b58c6d..34f39581c3 100644
--- a/Lib/test/decimaltestdata/dqNextMinus.decTest
+++ b/Lib/test/decimaltestdata/dqNextMinus.decTest
@@ -1,126 +1,126 @@
-------------------------------------------------------------------------
--- dqNextMinus.decTest -- decQuad next that is less [754r nextdown] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqnextm001 nextminus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999994
-dqnextm002 nextminus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999995
-dqnextm003 nextminus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999996
-dqnextm004 nextminus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999997
-dqnextm005 nextminus 0.9999999999999999999999999999999999 -> 0.9999999999999999999999999999999998
-dqnextm006 nextminus 1.000000000000000000000000000000000 -> 0.9999999999999999999999999999999999
-dqnextm007 nextminus 1.0 -> 0.9999999999999999999999999999999999
-dqnextm008 nextminus 1 -> 0.9999999999999999999999999999999999
-dqnextm009 nextminus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000000
-dqnextm010 nextminus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000001
-dqnextm011 nextminus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000002
-dqnextm012 nextminus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000003
-dqnextm013 nextminus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000004
-dqnextm014 nextminus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000005
-dqnextm015 nextminus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000006
-dqnextm016 nextminus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000007
-dqnextm017 nextminus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000008
-dqnextm018 nextminus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000009
-dqnextm019 nextminus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000010
-dqnextm020 nextminus 1.000000000000000000000000000000012 -> 1.000000000000000000000000000000011
-
-dqnextm021 nextminus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999996
-dqnextm022 nextminus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999997
-dqnextm023 nextminus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999998
-dqnextm024 nextminus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999999
-dqnextm025 nextminus -0.9999999999999999999999999999999999 -> -1.000000000000000000000000000000000
-dqnextm026 nextminus -1.000000000000000000000000000000000 -> -1.000000000000000000000000000000001
-dqnextm027 nextminus -1.0 -> -1.000000000000000000000000000000001
-dqnextm028 nextminus -1 -> -1.000000000000000000000000000000001
-dqnextm029 nextminus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000002
-dqnextm030 nextminus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000003
-dqnextm031 nextminus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000004
-dqnextm032 nextminus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000005
-dqnextm033 nextminus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000006
-dqnextm034 nextminus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000007
-dqnextm035 nextminus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000008
-dqnextm036 nextminus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000009
-dqnextm037 nextminus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000010
-dqnextm038 nextminus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000011
-dqnextm039 nextminus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000012
-
--- ultra-tiny inputs
-dqnextm062 nextminus 1E-6176 -> 0E-6176
-dqnextm065 nextminus -1E-6176 -> -2E-6176
-
--- Zeros
-dqnextm100 nextminus -0 -> -1E-6176
-dqnextm101 nextminus 0 -> -1E-6176
-dqnextm102 nextminus 0.00 -> -1E-6176
-dqnextm103 nextminus -0.00 -> -1E-6176
-dqnextm104 nextminus 0E-300 -> -1E-6176
-dqnextm105 nextminus 0E+300 -> -1E-6176
-dqnextm106 nextminus 0E+30000 -> -1E-6176
-dqnextm107 nextminus -0E+30000 -> -1E-6176
-
--- specials
-dqnextm150 nextminus Inf -> 9.999999999999999999999999999999999E+6144
-dqnextm151 nextminus -Inf -> -Infinity
-dqnextm152 nextminus NaN -> NaN
-dqnextm153 nextminus sNaN -> NaN Invalid_operation
-dqnextm154 nextminus NaN77 -> NaN77
-dqnextm155 nextminus sNaN88 -> NaN88 Invalid_operation
-dqnextm156 nextminus -NaN -> -NaN
-dqnextm157 nextminus -sNaN -> -NaN Invalid_operation
-dqnextm158 nextminus -NaN77 -> -NaN77
-dqnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-dqnextm170 nextminus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999998E+6144
-dqnextm171 nextminus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999997E+6144
-dqnextm172 nextminus 1E-6143 -> 9.99999999999999999999999999999999E-6144
-dqnextm173 nextminus 1.000000000000000000000000000000000E-6143 -> 9.99999999999999999999999999999999E-6144
-dqnextm174 nextminus 9E-6176 -> 8E-6176
-dqnextm175 nextminus 9.9E-6175 -> 9.8E-6175
-dqnextm176 nextminus 9.99999999999999999999999999999E-6147 -> 9.99999999999999999999999999998E-6147
-dqnextm177 nextminus 9.99999999999999999999999999999999E-6144 -> 9.99999999999999999999999999999998E-6144
-dqnextm178 nextminus 9.99999999999999999999999999999998E-6144 -> 9.99999999999999999999999999999997E-6144
-dqnextm179 nextminus 9.99999999999999999999999999999997E-6144 -> 9.99999999999999999999999999999996E-6144
-dqnextm180 nextminus 0E-6176 -> -1E-6176
-dqnextm181 nextminus 1E-6176 -> 0E-6176
-dqnextm182 nextminus 2E-6176 -> 1E-6176
-
-dqnextm183 nextminus -0E-6176 -> -1E-6176
-dqnextm184 nextminus -1E-6176 -> -2E-6176
-dqnextm185 nextminus -2E-6176 -> -3E-6176
-dqnextm186 nextminus -10E-6176 -> -1.1E-6175
-dqnextm187 nextminus -100E-6176 -> -1.01E-6174
-dqnextm188 nextminus -100000E-6176 -> -1.00001E-6171
-dqnextm189 nextminus -1.00000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143
-dqnextm190 nextminus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143
-dqnextm191 nextminus -1E-6143 -> -1.000000000000000000000000000000001E-6143
-dqnextm192 nextminus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999999E+6144
-dqnextm193 nextminus -9.999999999999999999999999999999999E+6144 -> -Infinity
-
--- Null tests
-dqnextm900 nextminus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqNextMinus.decTest -- decQuad next that is less [754r nextdown] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqnextm001 nextminus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999994
+dqnextm002 nextminus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999995
+dqnextm003 nextminus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999996
+dqnextm004 nextminus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999997
+dqnextm005 nextminus 0.9999999999999999999999999999999999 -> 0.9999999999999999999999999999999998
+dqnextm006 nextminus 1.000000000000000000000000000000000 -> 0.9999999999999999999999999999999999
+dqnextm007 nextminus 1.0 -> 0.9999999999999999999999999999999999
+dqnextm008 nextminus 1 -> 0.9999999999999999999999999999999999
+dqnextm009 nextminus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000000
+dqnextm010 nextminus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000001
+dqnextm011 nextminus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000002
+dqnextm012 nextminus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000003
+dqnextm013 nextminus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000004
+dqnextm014 nextminus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000005
+dqnextm015 nextminus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000006
+dqnextm016 nextminus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000007
+dqnextm017 nextminus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000008
+dqnextm018 nextminus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000009
+dqnextm019 nextminus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000010
+dqnextm020 nextminus 1.000000000000000000000000000000012 -> 1.000000000000000000000000000000011
+
+dqnextm021 nextminus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999996
+dqnextm022 nextminus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999997
+dqnextm023 nextminus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999998
+dqnextm024 nextminus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999999
+dqnextm025 nextminus -0.9999999999999999999999999999999999 -> -1.000000000000000000000000000000000
+dqnextm026 nextminus -1.000000000000000000000000000000000 -> -1.000000000000000000000000000000001
+dqnextm027 nextminus -1.0 -> -1.000000000000000000000000000000001
+dqnextm028 nextminus -1 -> -1.000000000000000000000000000000001
+dqnextm029 nextminus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000002
+dqnextm030 nextminus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000003
+dqnextm031 nextminus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000004
+dqnextm032 nextminus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000005
+dqnextm033 nextminus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000006
+dqnextm034 nextminus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000007
+dqnextm035 nextminus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000008
+dqnextm036 nextminus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000009
+dqnextm037 nextminus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000010
+dqnextm038 nextminus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000011
+dqnextm039 nextminus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000012
+
+-- ultra-tiny inputs
+dqnextm062 nextminus 1E-6176 -> 0E-6176
+dqnextm065 nextminus -1E-6176 -> -2E-6176
+
+-- Zeros
+dqnextm100 nextminus -0 -> -1E-6176
+dqnextm101 nextminus 0 -> -1E-6176
+dqnextm102 nextminus 0.00 -> -1E-6176
+dqnextm103 nextminus -0.00 -> -1E-6176
+dqnextm104 nextminus 0E-300 -> -1E-6176
+dqnextm105 nextminus 0E+300 -> -1E-6176
+dqnextm106 nextminus 0E+30000 -> -1E-6176
+dqnextm107 nextminus -0E+30000 -> -1E-6176
+
+-- specials
+dqnextm150 nextminus Inf -> 9.999999999999999999999999999999999E+6144
+dqnextm151 nextminus -Inf -> -Infinity
+dqnextm152 nextminus NaN -> NaN
+dqnextm153 nextminus sNaN -> NaN Invalid_operation
+dqnextm154 nextminus NaN77 -> NaN77
+dqnextm155 nextminus sNaN88 -> NaN88 Invalid_operation
+dqnextm156 nextminus -NaN -> -NaN
+dqnextm157 nextminus -sNaN -> -NaN Invalid_operation
+dqnextm158 nextminus -NaN77 -> -NaN77
+dqnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+dqnextm170 nextminus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999998E+6144
+dqnextm171 nextminus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999997E+6144
+dqnextm172 nextminus 1E-6143 -> 9.99999999999999999999999999999999E-6144
+dqnextm173 nextminus 1.000000000000000000000000000000000E-6143 -> 9.99999999999999999999999999999999E-6144
+dqnextm174 nextminus 9E-6176 -> 8E-6176
+dqnextm175 nextminus 9.9E-6175 -> 9.8E-6175
+dqnextm176 nextminus 9.99999999999999999999999999999E-6147 -> 9.99999999999999999999999999998E-6147
+dqnextm177 nextminus 9.99999999999999999999999999999999E-6144 -> 9.99999999999999999999999999999998E-6144
+dqnextm178 nextminus 9.99999999999999999999999999999998E-6144 -> 9.99999999999999999999999999999997E-6144
+dqnextm179 nextminus 9.99999999999999999999999999999997E-6144 -> 9.99999999999999999999999999999996E-6144
+dqnextm180 nextminus 0E-6176 -> -1E-6176
+dqnextm181 nextminus 1E-6176 -> 0E-6176
+dqnextm182 nextminus 2E-6176 -> 1E-6176
+
+dqnextm183 nextminus -0E-6176 -> -1E-6176
+dqnextm184 nextminus -1E-6176 -> -2E-6176
+dqnextm185 nextminus -2E-6176 -> -3E-6176
+dqnextm186 nextminus -10E-6176 -> -1.1E-6175
+dqnextm187 nextminus -100E-6176 -> -1.01E-6174
+dqnextm188 nextminus -100000E-6176 -> -1.00001E-6171
+dqnextm189 nextminus -1.00000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143
+dqnextm190 nextminus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143
+dqnextm191 nextminus -1E-6143 -> -1.000000000000000000000000000000001E-6143
+dqnextm192 nextminus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999999E+6144
+dqnextm193 nextminus -9.999999999999999999999999999999999E+6144 -> -Infinity
+
+-- Null tests
+dqnextm900 nextminus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqNextPlus.decTest b/Lib/test/decimaltestdata/dqNextPlus.decTest
index 8c8e9cd2e7..ac3f04e69b 100644
--- a/Lib/test/decimaltestdata/dqNextPlus.decTest
+++ b/Lib/test/decimaltestdata/dqNextPlus.decTest
@@ -1,124 +1,124 @@
-------------------------------------------------------------------------
--- dqNextPlus.decTest -- decQuad next that is greater [754r nextup] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqnextp001 nextplus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999996
-dqnextp002 nextplus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999997
-dqnextp003 nextplus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999998
-dqnextp004 nextplus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999999
-dqnextp005 nextplus 0.9999999999999999999999999999999999 -> 1.000000000000000000000000000000000
-dqnextp006 nextplus 1.000000000000000000000000000000000 -> 1.000000000000000000000000000000001
-dqnextp007 nextplus 1.0 -> 1.000000000000000000000000000000001
-dqnextp008 nextplus 1 -> 1.000000000000000000000000000000001
-dqnextp009 nextplus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000002
-dqnextp010 nextplus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000003
-dqnextp011 nextplus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000004
-dqnextp012 nextplus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000005
-dqnextp013 nextplus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000006
-dqnextp014 nextplus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000007
-dqnextp015 nextplus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000008
-dqnextp016 nextplus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000009
-dqnextp017 nextplus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000010
-dqnextp018 nextplus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000011
-dqnextp019 nextplus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000012
-
-dqnextp021 nextplus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999994
-dqnextp022 nextplus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999995
-dqnextp023 nextplus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999996
-dqnextp024 nextplus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999997
-dqnextp025 nextplus -0.9999999999999999999999999999999999 -> -0.9999999999999999999999999999999998
-dqnextp026 nextplus -1.000000000000000000000000000000000 -> -0.9999999999999999999999999999999999
-dqnextp027 nextplus -1.0 -> -0.9999999999999999999999999999999999
-dqnextp028 nextplus -1 -> -0.9999999999999999999999999999999999
-dqnextp029 nextplus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000000
-dqnextp030 nextplus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000001
-dqnextp031 nextplus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000002
-dqnextp032 nextplus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000003
-dqnextp033 nextplus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000004
-dqnextp034 nextplus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000005
-dqnextp035 nextplus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000006
-dqnextp036 nextplus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000007
-dqnextp037 nextplus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000008
-dqnextp038 nextplus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000009
-dqnextp039 nextplus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000010
-dqnextp040 nextplus -1.000000000000000000000000000000012 -> -1.000000000000000000000000000000011
-
--- Zeros
-dqnextp100 nextplus 0 -> 1E-6176
-dqnextp101 nextplus 0.00 -> 1E-6176
-dqnextp102 nextplus 0E-300 -> 1E-6176
-dqnextp103 nextplus 0E+300 -> 1E-6176
-dqnextp104 nextplus 0E+30000 -> 1E-6176
-dqnextp105 nextplus -0 -> 1E-6176
-dqnextp106 nextplus -0.00 -> 1E-6176
-dqnextp107 nextplus -0E-300 -> 1E-6176
-dqnextp108 nextplus -0E+300 -> 1E-6176
-dqnextp109 nextplus -0E+30000 -> 1E-6176
-
--- specials
-dqnextp150 nextplus Inf -> Infinity
-dqnextp151 nextplus -Inf -> -9.999999999999999999999999999999999E+6144
-dqnextp152 nextplus NaN -> NaN
-dqnextp153 nextplus sNaN -> NaN Invalid_operation
-dqnextp154 nextplus NaN77 -> NaN77
-dqnextp155 nextplus sNaN88 -> NaN88 Invalid_operation
-dqnextp156 nextplus -NaN -> -NaN
-dqnextp157 nextplus -sNaN -> -NaN Invalid_operation
-dqnextp158 nextplus -NaN77 -> -NaN77
-dqnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-dqnextp170 nextplus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999998E+6144
-dqnextp171 nextplus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999997E+6144
-dqnextp172 nextplus -1E-6143 -> -9.99999999999999999999999999999999E-6144
-dqnextp173 nextplus -1.000000000000000E-6143 -> -9.99999999999999999999999999999999E-6144
-dqnextp174 nextplus -9E-6176 -> -8E-6176
-dqnextp175 nextplus -9.9E-6175 -> -9.8E-6175
-dqnextp176 nextplus -9.99999999999999999999999999999E-6147 -> -9.99999999999999999999999999998E-6147
-dqnextp177 nextplus -9.99999999999999999999999999999999E-6144 -> -9.99999999999999999999999999999998E-6144
-dqnextp178 nextplus -9.99999999999999999999999999999998E-6144 -> -9.99999999999999999999999999999997E-6144
-dqnextp179 nextplus -9.99999999999999999999999999999997E-6144 -> -9.99999999999999999999999999999996E-6144
-dqnextp180 nextplus -0E-6176 -> 1E-6176
-dqnextp181 nextplus -1E-6176 -> -0E-6176
-dqnextp182 nextplus -2E-6176 -> -1E-6176
-
-dqnextp183 nextplus 0E-6176 -> 1E-6176
-dqnextp184 nextplus 1E-6176 -> 2E-6176
-dqnextp185 nextplus 2E-6176 -> 3E-6176
-dqnextp186 nextplus 10E-6176 -> 1.1E-6175
-dqnextp187 nextplus 100E-6176 -> 1.01E-6174
-dqnextp188 nextplus 100000E-6176 -> 1.00001E-6171
-dqnextp189 nextplus 1.00000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143
-dqnextp190 nextplus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143
-dqnextp191 nextplus 1E-6143 -> 1.000000000000000000000000000000001E-6143
-dqnextp192 nextplus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999999E+6144
-dqnextp193 nextplus 9.999999999999999999999999999999999E+6144 -> Infinity
-
--- Null tests
-dqnextp900 nextplus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqNextPlus.decTest -- decQuad next that is greater [754r nextup] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqnextp001 nextplus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999996
+dqnextp002 nextplus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999997
+dqnextp003 nextplus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999998
+dqnextp004 nextplus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999999
+dqnextp005 nextplus 0.9999999999999999999999999999999999 -> 1.000000000000000000000000000000000
+dqnextp006 nextplus 1.000000000000000000000000000000000 -> 1.000000000000000000000000000000001
+dqnextp007 nextplus 1.0 -> 1.000000000000000000000000000000001
+dqnextp008 nextplus 1 -> 1.000000000000000000000000000000001
+dqnextp009 nextplus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000002
+dqnextp010 nextplus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000003
+dqnextp011 nextplus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000004
+dqnextp012 nextplus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000005
+dqnextp013 nextplus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000006
+dqnextp014 nextplus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000007
+dqnextp015 nextplus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000008
+dqnextp016 nextplus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000009
+dqnextp017 nextplus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000010
+dqnextp018 nextplus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000011
+dqnextp019 nextplus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000012
+
+dqnextp021 nextplus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999994
+dqnextp022 nextplus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999995
+dqnextp023 nextplus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999996
+dqnextp024 nextplus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999997
+dqnextp025 nextplus -0.9999999999999999999999999999999999 -> -0.9999999999999999999999999999999998
+dqnextp026 nextplus -1.000000000000000000000000000000000 -> -0.9999999999999999999999999999999999
+dqnextp027 nextplus -1.0 -> -0.9999999999999999999999999999999999
+dqnextp028 nextplus -1 -> -0.9999999999999999999999999999999999
+dqnextp029 nextplus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000000
+dqnextp030 nextplus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000001
+dqnextp031 nextplus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000002
+dqnextp032 nextplus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000003
+dqnextp033 nextplus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000004
+dqnextp034 nextplus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000005
+dqnextp035 nextplus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000006
+dqnextp036 nextplus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000007
+dqnextp037 nextplus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000008
+dqnextp038 nextplus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000009
+dqnextp039 nextplus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000010
+dqnextp040 nextplus -1.000000000000000000000000000000012 -> -1.000000000000000000000000000000011
+
+-- Zeros
+dqnextp100 nextplus 0 -> 1E-6176
+dqnextp101 nextplus 0.00 -> 1E-6176
+dqnextp102 nextplus 0E-300 -> 1E-6176
+dqnextp103 nextplus 0E+300 -> 1E-6176
+dqnextp104 nextplus 0E+30000 -> 1E-6176
+dqnextp105 nextplus -0 -> 1E-6176
+dqnextp106 nextplus -0.00 -> 1E-6176
+dqnextp107 nextplus -0E-300 -> 1E-6176
+dqnextp108 nextplus -0E+300 -> 1E-6176
+dqnextp109 nextplus -0E+30000 -> 1E-6176
+
+-- specials
+dqnextp150 nextplus Inf -> Infinity
+dqnextp151 nextplus -Inf -> -9.999999999999999999999999999999999E+6144
+dqnextp152 nextplus NaN -> NaN
+dqnextp153 nextplus sNaN -> NaN Invalid_operation
+dqnextp154 nextplus NaN77 -> NaN77
+dqnextp155 nextplus sNaN88 -> NaN88 Invalid_operation
+dqnextp156 nextplus -NaN -> -NaN
+dqnextp157 nextplus -sNaN -> -NaN Invalid_operation
+dqnextp158 nextplus -NaN77 -> -NaN77
+dqnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+dqnextp170 nextplus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999998E+6144
+dqnextp171 nextplus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999997E+6144
+dqnextp172 nextplus -1E-6143 -> -9.99999999999999999999999999999999E-6144
+dqnextp173 nextplus -1.000000000000000E-6143 -> -9.99999999999999999999999999999999E-6144
+dqnextp174 nextplus -9E-6176 -> -8E-6176
+dqnextp175 nextplus -9.9E-6175 -> -9.8E-6175
+dqnextp176 nextplus -9.99999999999999999999999999999E-6147 -> -9.99999999999999999999999999998E-6147
+dqnextp177 nextplus -9.99999999999999999999999999999999E-6144 -> -9.99999999999999999999999999999998E-6144
+dqnextp178 nextplus -9.99999999999999999999999999999998E-6144 -> -9.99999999999999999999999999999997E-6144
+dqnextp179 nextplus -9.99999999999999999999999999999997E-6144 -> -9.99999999999999999999999999999996E-6144
+dqnextp180 nextplus -0E-6176 -> 1E-6176
+dqnextp181 nextplus -1E-6176 -> -0E-6176
+dqnextp182 nextplus -2E-6176 -> -1E-6176
+
+dqnextp183 nextplus 0E-6176 -> 1E-6176
+dqnextp184 nextplus 1E-6176 -> 2E-6176
+dqnextp185 nextplus 2E-6176 -> 3E-6176
+dqnextp186 nextplus 10E-6176 -> 1.1E-6175
+dqnextp187 nextplus 100E-6176 -> 1.01E-6174
+dqnextp188 nextplus 100000E-6176 -> 1.00001E-6171
+dqnextp189 nextplus 1.00000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143
+dqnextp190 nextplus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143
+dqnextp191 nextplus 1E-6143 -> 1.000000000000000000000000000000001E-6143
+dqnextp192 nextplus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999999E+6144
+dqnextp193 nextplus 9.999999999999999999999999999999999E+6144 -> Infinity
+
+-- Null tests
+dqnextp900 nextplus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqNextToward.decTest b/Lib/test/decimaltestdata/dqNextToward.decTest
index 107e7f5c50..e6d1e0befb 100644
--- a/Lib/test/decimaltestdata/dqNextToward.decTest
+++ b/Lib/test/decimaltestdata/dqNextToward.decTest
@@ -1,375 +1,375 @@
-------------------------------------------------------------------------
--- dqNextToward.decTest -- decQuad next toward rhs [754r nextafter] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-
--- Sanity check with a scattering of numerics
-dqnextt001 nexttoward 10 10 -> 10
-dqnextt002 nexttoward -10 -10 -> -10
-dqnextt003 nexttoward 1 10 -> 1.000000000000000000000000000000001
-dqnextt004 nexttoward 1 -10 -> 0.9999999999999999999999999999999999
-dqnextt005 nexttoward -1 10 -> -0.9999999999999999999999999999999999
-dqnextt006 nexttoward -1 -10 -> -1.000000000000000000000000000000001
-dqnextt007 nexttoward 0 10 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt008 nexttoward 0 -10 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt009 nexttoward 9.999999999999999999999999999999999E+6144 +Infinity -> Infinity Overflow Inexact Rounded
-dqnextt010 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded
-dqnextt011 nexttoward 9.999999999999999999999999999999999 10 -> 10.00000000000000000000000000000000
-dqnextt012 nexttoward 10 9.999999999999999999999999999999999 -> 9.999999999999999999999999999999999
-dqnextt013 nexttoward -9.999999999999999999999999999999999 -10 -> -10.00000000000000000000000000000000
-dqnextt014 nexttoward -10 -9.999999999999999999999999999999999 -> -9.999999999999999999999999999999999
-dqnextt015 nexttoward 9.999999999999999999999999999999998 10 -> 9.999999999999999999999999999999999
-dqnextt016 nexttoward 10 9.999999999999999999999999999999998 -> 9.999999999999999999999999999999999
-dqnextt017 nexttoward -9.999999999999999999999999999999998 -10 -> -9.999999999999999999999999999999999
-dqnextt018 nexttoward -10 -9.999999999999999999999999999999998 -> -9.999999999999999999999999999999999
-
-------- lhs=rhs
--- finites
-dqnextt101 nexttoward 7 7 -> 7
-dqnextt102 nexttoward -7 -7 -> -7
-dqnextt103 nexttoward 75 75 -> 75
-dqnextt104 nexttoward -75 -75 -> -75
-dqnextt105 nexttoward 7.50 7.5 -> 7.50
-dqnextt106 nexttoward -7.50 -7.50 -> -7.50
-dqnextt107 nexttoward 7.500 7.5000 -> 7.500
-dqnextt108 nexttoward -7.500 -7.5 -> -7.500
-
--- zeros
-dqnextt111 nexttoward 0 0 -> 0
-dqnextt112 nexttoward -0 -0 -> -0
-dqnextt113 nexttoward 0E+4 0 -> 0E+4
-dqnextt114 nexttoward -0E+4 -0 -> -0E+4
-dqnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11
-dqnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11
-dqnextt117 nexttoward 0E-141 0 -> 0E-141
-dqnextt118 nexttoward -0E-141 -000 -> -0E-141
-
--- full coefficients, alternating bits
-dqnextt121 nexttoward 268268268 268268268 -> 268268268
-dqnextt122 nexttoward -268268268 -268268268 -> -268268268
-dqnextt123 nexttoward 134134134 134134134 -> 134134134
-dqnextt124 nexttoward -134134134 -134134134 -> -134134134
-
--- Nmax, Nmin, Ntiny
-dqnextt131 nexttoward 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqnextt132 nexttoward 1E-6143 1E-6143 -> 1E-6143
-dqnextt133 nexttoward 1.000000000000000000000000000000000E-6143 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqnextt134 nexttoward 1E-6176 1E-6176 -> 1E-6176
-
-dqnextt135 nexttoward -1E-6176 -1E-6176 -> -1E-6176
-dqnextt136 nexttoward -1.000000000000000000000000000000000E-6143 -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqnextt137 nexttoward -1E-6143 -1E-6143 -> -1E-6143
-dqnextt138 nexttoward -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-
-------- lhs<rhs
-dqnextt201 nexttoward 0.9999999999999999999999999999999995 Infinity -> 0.9999999999999999999999999999999996
-dqnextt202 nexttoward 0.9999999999999999999999999999999996 Infinity -> 0.9999999999999999999999999999999997
-dqnextt203 nexttoward 0.9999999999999999999999999999999997 Infinity -> 0.9999999999999999999999999999999998
-dqnextt204 nexttoward 0.9999999999999999999999999999999998 Infinity -> 0.9999999999999999999999999999999999
-dqnextt205 nexttoward 0.9999999999999999999999999999999999 Infinity -> 1.000000000000000000000000000000000
-dqnextt206 nexttoward 1.000000000000000000000000000000000 Infinity -> 1.000000000000000000000000000000001
-dqnextt207 nexttoward 1.0 Infinity -> 1.000000000000000000000000000000001
-dqnextt208 nexttoward 1 Infinity -> 1.000000000000000000000000000000001
-dqnextt209 nexttoward 1.000000000000000000000000000000001 Infinity -> 1.000000000000000000000000000000002
-dqnextt210 nexttoward 1.000000000000000000000000000000002 Infinity -> 1.000000000000000000000000000000003
-dqnextt211 nexttoward 1.000000000000000000000000000000003 Infinity -> 1.000000000000000000000000000000004
-dqnextt212 nexttoward 1.000000000000000000000000000000004 Infinity -> 1.000000000000000000000000000000005
-dqnextt213 nexttoward 1.000000000000000000000000000000005 Infinity -> 1.000000000000000000000000000000006
-dqnextt214 nexttoward 1.000000000000000000000000000000006 Infinity -> 1.000000000000000000000000000000007
-dqnextt215 nexttoward 1.000000000000000000000000000000007 Infinity -> 1.000000000000000000000000000000008
-dqnextt216 nexttoward 1.000000000000000000000000000000008 Infinity -> 1.000000000000000000000000000000009
-dqnextt217 nexttoward 1.000000000000000000000000000000009 Infinity -> 1.000000000000000000000000000000010
-dqnextt218 nexttoward 1.000000000000000000000000000000010 Infinity -> 1.000000000000000000000000000000011
-dqnextt219 nexttoward 1.000000000000000000000000000000011 Infinity -> 1.000000000000000000000000000000012
-
-dqnextt221 nexttoward -0.9999999999999999999999999999999995 Infinity -> -0.9999999999999999999999999999999994
-dqnextt222 nexttoward -0.9999999999999999999999999999999996 Infinity -> -0.9999999999999999999999999999999995
-dqnextt223 nexttoward -0.9999999999999999999999999999999997 Infinity -> -0.9999999999999999999999999999999996
-dqnextt224 nexttoward -0.9999999999999999999999999999999998 Infinity -> -0.9999999999999999999999999999999997
-dqnextt225 nexttoward -0.9999999999999999999999999999999999 Infinity -> -0.9999999999999999999999999999999998
-dqnextt226 nexttoward -1.000000000000000000000000000000000 Infinity -> -0.9999999999999999999999999999999999
-dqnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999999999999999999999
-dqnextt228 nexttoward -1 Infinity -> -0.9999999999999999999999999999999999
-dqnextt229 nexttoward -1.000000000000000000000000000000001 Infinity -> -1.000000000000000000000000000000000
-dqnextt230 nexttoward -1.000000000000000000000000000000002 Infinity -> -1.000000000000000000000000000000001
-dqnextt231 nexttoward -1.000000000000000000000000000000003 Infinity -> -1.000000000000000000000000000000002
-dqnextt232 nexttoward -1.000000000000000000000000000000004 Infinity -> -1.000000000000000000000000000000003
-dqnextt233 nexttoward -1.000000000000000000000000000000005 Infinity -> -1.000000000000000000000000000000004
-dqnextt234 nexttoward -1.000000000000000000000000000000006 Infinity -> -1.000000000000000000000000000000005
-dqnextt235 nexttoward -1.000000000000000000000000000000007 Infinity -> -1.000000000000000000000000000000006
-dqnextt236 nexttoward -1.000000000000000000000000000000008 Infinity -> -1.000000000000000000000000000000007
-dqnextt237 nexttoward -1.000000000000000000000000000000009 Infinity -> -1.000000000000000000000000000000008
-dqnextt238 nexttoward -1.000000000000000000000000000000010 Infinity -> -1.000000000000000000000000000000009
-dqnextt239 nexttoward -1.000000000000000000000000000000011 Infinity -> -1.000000000000000000000000000000010
-dqnextt240 nexttoward -1.000000000000000000000000000000012 Infinity -> -1.000000000000000000000000000000011
-
--- Zeros
-dqnextt300 nexttoward 0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt301 nexttoward 0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt302 nexttoward 0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt303 nexttoward 0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt304 nexttoward 0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt305 nexttoward -0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt306 nexttoward -0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt307 nexttoward -0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt308 nexttoward -0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt309 nexttoward -0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-
--- specials
-dqnextt350 nexttoward Inf Infinity -> Infinity
-dqnextt351 nexttoward -Inf Infinity -> -9.999999999999999999999999999999999E+6144
-dqnextt352 nexttoward NaN Infinity -> NaN
-dqnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
-dqnextt354 nexttoward NaN77 Infinity -> NaN77
-dqnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
-dqnextt356 nexttoward -NaN Infinity -> -NaN
-dqnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
-dqnextt358 nexttoward -NaN77 Infinity -> -NaN77
-dqnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-dqnextt370 nexttoward -9.999999999999999999999999999999999E+6144 Infinity -> -9.999999999999999999999999999999998E+6144
-dqnextt371 nexttoward -9.999999999999999999999999999999998E+6144 Infinity -> -9.999999999999999999999999999999997E+6144
-dqnextt372 nexttoward -1E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
-dqnextt373 nexttoward -1.000000000000000E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
-dqnextt374 nexttoward -9E-6176 Infinity -> -8E-6176 Underflow Subnormal Inexact Rounded
-dqnextt375 nexttoward -9.9E-6175 Infinity -> -9.8E-6175 Underflow Subnormal Inexact Rounded
-dqnextt376 nexttoward -9.99999999999999999999999999999E-6147 Infinity -> -9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded
-dqnextt377 nexttoward -9.99999999999999999999999999999999E-6144 Infinity -> -9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded
-dqnextt378 nexttoward -9.99999999999999999999999999999998E-6144 Infinity -> -9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded
-dqnextt379 nexttoward -9.99999999999999999999999999999997E-6144 Infinity -> -9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded
-dqnextt380 nexttoward -0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt381 nexttoward -1E-6176 Infinity -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqnextt382 nexttoward -2E-6176 Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-
-dqnextt383 nexttoward 0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt384 nexttoward 1E-6176 Infinity -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqnextt385 nexttoward 2E-6176 Infinity -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqnextt386 nexttoward 10E-6176 Infinity -> 1.1E-6175 Underflow Subnormal Inexact Rounded
-dqnextt387 nexttoward 100E-6176 Infinity -> 1.01E-6174 Underflow Subnormal Inexact Rounded
-dqnextt388 nexttoward 100000E-6176 Infinity -> 1.00001E-6171 Underflow Subnormal Inexact Rounded
-dqnextt389 nexttoward 1.00000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
-dqnextt390 nexttoward 1.000000000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
-dqnextt391 nexttoward 1E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
-dqnextt392 nexttoward 9.999999999999999999999999999999997E+6144 Infinity -> 9.999999999999999999999999999999998E+6144
-dqnextt393 nexttoward 9.999999999999999999999999999999998E+6144 Infinity -> 9.999999999999999999999999999999999E+6144
-dqnextt394 nexttoward 9.999999999999999999999999999999999E+6144 Infinity -> Infinity Overflow Inexact Rounded
-
-------- lhs>rhs
-dqnextt401 nexttoward 0.9999999999999999999999999999999995 -Infinity -> 0.9999999999999999999999999999999994
-dqnextt402 nexttoward 0.9999999999999999999999999999999996 -Infinity -> 0.9999999999999999999999999999999995
-dqnextt403 nexttoward 0.9999999999999999999999999999999997 -Infinity -> 0.9999999999999999999999999999999996
-dqnextt404 nexttoward 0.9999999999999999999999999999999998 -Infinity -> 0.9999999999999999999999999999999997
-dqnextt405 nexttoward 0.9999999999999999999999999999999999 -Infinity -> 0.9999999999999999999999999999999998
-dqnextt406 nexttoward 1.000000000000000000000000000000000 -Infinity -> 0.9999999999999999999999999999999999
-dqnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999999999999999999999
-dqnextt408 nexttoward 1 -Infinity -> 0.9999999999999999999999999999999999
-dqnextt409 nexttoward 1.000000000000000000000000000000001 -Infinity -> 1.000000000000000000000000000000000
-dqnextt410 nexttoward 1.000000000000000000000000000000002 -Infinity -> 1.000000000000000000000000000000001
-dqnextt411 nexttoward 1.000000000000000000000000000000003 -Infinity -> 1.000000000000000000000000000000002
-dqnextt412 nexttoward 1.000000000000000000000000000000004 -Infinity -> 1.000000000000000000000000000000003
-dqnextt413 nexttoward 1.000000000000000000000000000000005 -Infinity -> 1.000000000000000000000000000000004
-dqnextt414 nexttoward 1.000000000000000000000000000000006 -Infinity -> 1.000000000000000000000000000000005
-dqnextt415 nexttoward 1.000000000000000000000000000000007 -Infinity -> 1.000000000000000000000000000000006
-dqnextt416 nexttoward 1.000000000000000000000000000000008 -Infinity -> 1.000000000000000000000000000000007
-dqnextt417 nexttoward 1.000000000000000000000000000000009 -Infinity -> 1.000000000000000000000000000000008
-dqnextt418 nexttoward 1.000000000000000000000000000000010 -Infinity -> 1.000000000000000000000000000000009
-dqnextt419 nexttoward 1.000000000000000000000000000000011 -Infinity -> 1.000000000000000000000000000000010
-dqnextt420 nexttoward 1.000000000000000000000000000000012 -Infinity -> 1.000000000000000000000000000000011
-
-dqnextt421 nexttoward -0.9999999999999999999999999999999995 -Infinity -> -0.9999999999999999999999999999999996
-dqnextt422 nexttoward -0.9999999999999999999999999999999996 -Infinity -> -0.9999999999999999999999999999999997
-dqnextt423 nexttoward -0.9999999999999999999999999999999997 -Infinity -> -0.9999999999999999999999999999999998
-dqnextt424 nexttoward -0.9999999999999999999999999999999998 -Infinity -> -0.9999999999999999999999999999999999
-dqnextt425 nexttoward -0.9999999999999999999999999999999999 -Infinity -> -1.000000000000000000000000000000000
-dqnextt426 nexttoward -1.000000000000000000000000000000000 -Infinity -> -1.000000000000000000000000000000001
-dqnextt427 nexttoward -1.0 -Infinity -> -1.000000000000000000000000000000001
-dqnextt428 nexttoward -1 -Infinity -> -1.000000000000000000000000000000001
-dqnextt429 nexttoward -1.000000000000000000000000000000001 -Infinity -> -1.000000000000000000000000000000002
-dqnextt430 nexttoward -1.000000000000000000000000000000002 -Infinity -> -1.000000000000000000000000000000003
-dqnextt431 nexttoward -1.000000000000000000000000000000003 -Infinity -> -1.000000000000000000000000000000004
-dqnextt432 nexttoward -1.000000000000000000000000000000004 -Infinity -> -1.000000000000000000000000000000005
-dqnextt433 nexttoward -1.000000000000000000000000000000005 -Infinity -> -1.000000000000000000000000000000006
-dqnextt434 nexttoward -1.000000000000000000000000000000006 -Infinity -> -1.000000000000000000000000000000007
-dqnextt435 nexttoward -1.000000000000000000000000000000007 -Infinity -> -1.000000000000000000000000000000008
-dqnextt436 nexttoward -1.000000000000000000000000000000008 -Infinity -> -1.000000000000000000000000000000009
-dqnextt437 nexttoward -1.000000000000000000000000000000009 -Infinity -> -1.000000000000000000000000000000010
-dqnextt438 nexttoward -1.000000000000000000000000000000010 -Infinity -> -1.000000000000000000000000000000011
-dqnextt439 nexttoward -1.000000000000000000000000000000011 -Infinity -> -1.000000000000000000000000000000012
-
--- Zeros
-dqnextt500 nexttoward -0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt501 nexttoward 0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt502 nexttoward 0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt503 nexttoward -0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt504 nexttoward 0E-300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt505 nexttoward 0E+300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt506 nexttoward 0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt507 nexttoward -0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-
--- specials
-dqnextt550 nexttoward Inf -Infinity -> 9.999999999999999999999999999999999E+6144
-dqnextt551 nexttoward -Inf -Infinity -> -Infinity
-dqnextt552 nexttoward NaN -Infinity -> NaN
-dqnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
-dqnextt554 nexttoward NaN77 -Infinity -> NaN77
-dqnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
-dqnextt556 nexttoward -NaN -Infinity -> -NaN
-dqnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
-dqnextt558 nexttoward -NaN77 -Infinity -> -NaN77
-dqnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-dqnextt670 nexttoward 9.999999999999999999999999999999999E+6144 -Infinity -> 9.999999999999999999999999999999998E+6144
-dqnextt671 nexttoward 9.999999999999999999999999999999998E+6144 -Infinity -> 9.999999999999999999999999999999997E+6144
-dqnextt672 nexttoward 1E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
-dqnextt673 nexttoward 1.000000000000000000000000000000000E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
-dqnextt674 nexttoward 9E-6176 -Infinity -> 8E-6176 Underflow Subnormal Inexact Rounded
-dqnextt675 nexttoward 9.9E-6175 -Infinity -> 9.8E-6175 Underflow Subnormal Inexact Rounded
-dqnextt676 nexttoward 9.99999999999999999999999999999E-6147 -Infinity -> 9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded
-dqnextt677 nexttoward 9.99999999999999999999999999999999E-6144 -Infinity -> 9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded
-dqnextt678 nexttoward 9.99999999999999999999999999999998E-6144 -Infinity -> 9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded
-dqnextt679 nexttoward 9.99999999999999999999999999999997E-6144 -Infinity -> 9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded
-dqnextt680 nexttoward 0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt681 nexttoward 1E-6176 -Infinity -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqnextt682 nexttoward 2E-6176 -Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-
-dqnextt683 nexttoward -0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt684 nexttoward -1E-6176 -Infinity -> -2E-6176 Underflow Subnormal Inexact Rounded
-dqnextt685 nexttoward -2E-6176 -Infinity -> -3E-6176 Underflow Subnormal Inexact Rounded
-dqnextt686 nexttoward -10E-6176 -Infinity -> -1.1E-6175 Underflow Subnormal Inexact Rounded
-dqnextt687 nexttoward -100E-6176 -Infinity -> -1.01E-6174 Underflow Subnormal Inexact Rounded
-dqnextt688 nexttoward -100000E-6176 -Infinity -> -1.00001E-6171 Underflow Subnormal Inexact Rounded
-dqnextt689 nexttoward -1.00000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
-dqnextt690 nexttoward -1.000000000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
-dqnextt691 nexttoward -1E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
-dqnextt692 nexttoward -9.999999999999999999999999999999998E+6144 -Infinity -> -9.999999999999999999999999999999999E+6144
-dqnextt693 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded
-
-------- Specials
-dqnextt780 nexttoward -Inf -Inf -> -Infinity
-dqnextt781 nexttoward -Inf -1000 -> -9.999999999999999999999999999999999E+6144
-dqnextt782 nexttoward -Inf -1 -> -9.999999999999999999999999999999999E+6144
-dqnextt783 nexttoward -Inf -0 -> -9.999999999999999999999999999999999E+6144
-dqnextt784 nexttoward -Inf 0 -> -9.999999999999999999999999999999999E+6144
-dqnextt785 nexttoward -Inf 1 -> -9.999999999999999999999999999999999E+6144
-dqnextt786 nexttoward -Inf 1000 -> -9.999999999999999999999999999999999E+6144
-dqnextt787 nexttoward -1000 -Inf -> -1000.000000000000000000000000000001
-dqnextt788 nexttoward -Inf -Inf -> -Infinity
-dqnextt789 nexttoward -1 -Inf -> -1.000000000000000000000000000000001
-dqnextt790 nexttoward -0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt791 nexttoward 0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt792 nexttoward 1 -Inf -> 0.9999999999999999999999999999999999
-dqnextt793 nexttoward 1000 -Inf -> 999.9999999999999999999999999999999
-dqnextt794 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144
-
-dqnextt800 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144
-dqnextt801 nexttoward Inf -1000 -> 9.999999999999999999999999999999999E+6144
-dqnextt802 nexttoward Inf -1 -> 9.999999999999999999999999999999999E+6144
-dqnextt803 nexttoward Inf -0 -> 9.999999999999999999999999999999999E+6144
-dqnextt804 nexttoward Inf 0 -> 9.999999999999999999999999999999999E+6144
-dqnextt805 nexttoward Inf 1 -> 9.999999999999999999999999999999999E+6144
-dqnextt806 nexttoward Inf 1000 -> 9.999999999999999999999999999999999E+6144
-dqnextt807 nexttoward Inf Inf -> Infinity
-dqnextt808 nexttoward -1000 Inf -> -999.9999999999999999999999999999999
-dqnextt809 nexttoward -Inf Inf -> -9.999999999999999999999999999999999E+6144
-dqnextt810 nexttoward -1 Inf -> -0.9999999999999999999999999999999999
-dqnextt811 nexttoward -0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt812 nexttoward 0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt813 nexttoward 1 Inf -> 1.000000000000000000000000000000001
-dqnextt814 nexttoward 1000 Inf -> 1000.000000000000000000000000000001
-dqnextt815 nexttoward Inf Inf -> Infinity
-
-dqnextt821 nexttoward NaN -Inf -> NaN
-dqnextt822 nexttoward NaN -1000 -> NaN
-dqnextt823 nexttoward NaN -1 -> NaN
-dqnextt824 nexttoward NaN -0 -> NaN
-dqnextt825 nexttoward NaN 0 -> NaN
-dqnextt826 nexttoward NaN 1 -> NaN
-dqnextt827 nexttoward NaN 1000 -> NaN
-dqnextt828 nexttoward NaN Inf -> NaN
-dqnextt829 nexttoward NaN NaN -> NaN
-dqnextt830 nexttoward -Inf NaN -> NaN
-dqnextt831 nexttoward -1000 NaN -> NaN
-dqnextt832 nexttoward -1 NaN -> NaN
-dqnextt833 nexttoward -0 NaN -> NaN
-dqnextt834 nexttoward 0 NaN -> NaN
-dqnextt835 nexttoward 1 NaN -> NaN
-dqnextt836 nexttoward 1000 NaN -> NaN
-dqnextt837 nexttoward Inf NaN -> NaN
-
-dqnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
-dqnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
-dqnextt843 nexttoward sNaN -1 -> NaN Invalid_operation
-dqnextt844 nexttoward sNaN -0 -> NaN Invalid_operation
-dqnextt845 nexttoward sNaN 0 -> NaN Invalid_operation
-dqnextt846 nexttoward sNaN 1 -> NaN Invalid_operation
-dqnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
-dqnextt848 nexttoward sNaN NaN -> NaN Invalid_operation
-dqnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
-dqnextt850 nexttoward NaN sNaN -> NaN Invalid_operation
-dqnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
-dqnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
-dqnextt853 nexttoward -1 sNaN -> NaN Invalid_operation
-dqnextt854 nexttoward -0 sNaN -> NaN Invalid_operation
-dqnextt855 nexttoward 0 sNaN -> NaN Invalid_operation
-dqnextt856 nexttoward 1 sNaN -> NaN Invalid_operation
-dqnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
-dqnextt858 nexttoward Inf sNaN -> NaN Invalid_operation
-dqnextt859 nexttoward NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqnextt861 nexttoward NaN1 -Inf -> NaN1
-dqnextt862 nexttoward +NaN2 -1000 -> NaN2
-dqnextt863 nexttoward NaN3 1000 -> NaN3
-dqnextt864 nexttoward NaN4 Inf -> NaN4
-dqnextt865 nexttoward NaN5 +NaN6 -> NaN5
-dqnextt866 nexttoward -Inf NaN7 -> NaN7
-dqnextt867 nexttoward -1000 NaN8 -> NaN8
-dqnextt868 nexttoward 1000 NaN9 -> NaN9
-dqnextt869 nexttoward Inf +NaN10 -> NaN10
-dqnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
-dqnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
-dqnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
-dqnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
-dqnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
-dqnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
-dqnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
-dqnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
-dqnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
-dqnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqnextt882 nexttoward -NaN26 NaN28 -> -NaN26
-dqnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqnextt884 nexttoward 1000 -NaN30 -> -NaN30
-dqnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Null tests
-dqnextt900 nexttoward 1 # -> NaN Invalid_operation
-dqnextt901 nexttoward # 1 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqNextToward.decTest -- decQuad next toward rhs [754r nextafter] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+
+-- Sanity check with a scattering of numerics
+dqnextt001 nexttoward 10 10 -> 10
+dqnextt002 nexttoward -10 -10 -> -10
+dqnextt003 nexttoward 1 10 -> 1.000000000000000000000000000000001
+dqnextt004 nexttoward 1 -10 -> 0.9999999999999999999999999999999999
+dqnextt005 nexttoward -1 10 -> -0.9999999999999999999999999999999999
+dqnextt006 nexttoward -1 -10 -> -1.000000000000000000000000000000001
+dqnextt007 nexttoward 0 10 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt008 nexttoward 0 -10 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt009 nexttoward 9.999999999999999999999999999999999E+6144 +Infinity -> Infinity Overflow Inexact Rounded
+dqnextt010 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded
+dqnextt011 nexttoward 9.999999999999999999999999999999999 10 -> 10.00000000000000000000000000000000
+dqnextt012 nexttoward 10 9.999999999999999999999999999999999 -> 9.999999999999999999999999999999999
+dqnextt013 nexttoward -9.999999999999999999999999999999999 -10 -> -10.00000000000000000000000000000000
+dqnextt014 nexttoward -10 -9.999999999999999999999999999999999 -> -9.999999999999999999999999999999999
+dqnextt015 nexttoward 9.999999999999999999999999999999998 10 -> 9.999999999999999999999999999999999
+dqnextt016 nexttoward 10 9.999999999999999999999999999999998 -> 9.999999999999999999999999999999999
+dqnextt017 nexttoward -9.999999999999999999999999999999998 -10 -> -9.999999999999999999999999999999999
+dqnextt018 nexttoward -10 -9.999999999999999999999999999999998 -> -9.999999999999999999999999999999999
+
+------- lhs=rhs
+-- finites
+dqnextt101 nexttoward 7 7 -> 7
+dqnextt102 nexttoward -7 -7 -> -7
+dqnextt103 nexttoward 75 75 -> 75
+dqnextt104 nexttoward -75 -75 -> -75
+dqnextt105 nexttoward 7.50 7.5 -> 7.50
+dqnextt106 nexttoward -7.50 -7.50 -> -7.50
+dqnextt107 nexttoward 7.500 7.5000 -> 7.500
+dqnextt108 nexttoward -7.500 -7.5 -> -7.500
+
+-- zeros
+dqnextt111 nexttoward 0 0 -> 0
+dqnextt112 nexttoward -0 -0 -> -0
+dqnextt113 nexttoward 0E+4 0 -> 0E+4
+dqnextt114 nexttoward -0E+4 -0 -> -0E+4
+dqnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11
+dqnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11
+dqnextt117 nexttoward 0E-141 0 -> 0E-141
+dqnextt118 nexttoward -0E-141 -000 -> -0E-141
+
+-- full coefficients, alternating bits
+dqnextt121 nexttoward 268268268 268268268 -> 268268268
+dqnextt122 nexttoward -268268268 -268268268 -> -268268268
+dqnextt123 nexttoward 134134134 134134134 -> 134134134
+dqnextt124 nexttoward -134134134 -134134134 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+dqnextt131 nexttoward 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqnextt132 nexttoward 1E-6143 1E-6143 -> 1E-6143
+dqnextt133 nexttoward 1.000000000000000000000000000000000E-6143 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqnextt134 nexttoward 1E-6176 1E-6176 -> 1E-6176
+
+dqnextt135 nexttoward -1E-6176 -1E-6176 -> -1E-6176
+dqnextt136 nexttoward -1.000000000000000000000000000000000E-6143 -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqnextt137 nexttoward -1E-6143 -1E-6143 -> -1E-6143
+dqnextt138 nexttoward -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+
+------- lhs<rhs
+dqnextt201 nexttoward 0.9999999999999999999999999999999995 Infinity -> 0.9999999999999999999999999999999996
+dqnextt202 nexttoward 0.9999999999999999999999999999999996 Infinity -> 0.9999999999999999999999999999999997
+dqnextt203 nexttoward 0.9999999999999999999999999999999997 Infinity -> 0.9999999999999999999999999999999998
+dqnextt204 nexttoward 0.9999999999999999999999999999999998 Infinity -> 0.9999999999999999999999999999999999
+dqnextt205 nexttoward 0.9999999999999999999999999999999999 Infinity -> 1.000000000000000000000000000000000
+dqnextt206 nexttoward 1.000000000000000000000000000000000 Infinity -> 1.000000000000000000000000000000001
+dqnextt207 nexttoward 1.0 Infinity -> 1.000000000000000000000000000000001
+dqnextt208 nexttoward 1 Infinity -> 1.000000000000000000000000000000001
+dqnextt209 nexttoward 1.000000000000000000000000000000001 Infinity -> 1.000000000000000000000000000000002
+dqnextt210 nexttoward 1.000000000000000000000000000000002 Infinity -> 1.000000000000000000000000000000003
+dqnextt211 nexttoward 1.000000000000000000000000000000003 Infinity -> 1.000000000000000000000000000000004
+dqnextt212 nexttoward 1.000000000000000000000000000000004 Infinity -> 1.000000000000000000000000000000005
+dqnextt213 nexttoward 1.000000000000000000000000000000005 Infinity -> 1.000000000000000000000000000000006
+dqnextt214 nexttoward 1.000000000000000000000000000000006 Infinity -> 1.000000000000000000000000000000007
+dqnextt215 nexttoward 1.000000000000000000000000000000007 Infinity -> 1.000000000000000000000000000000008
+dqnextt216 nexttoward 1.000000000000000000000000000000008 Infinity -> 1.000000000000000000000000000000009
+dqnextt217 nexttoward 1.000000000000000000000000000000009 Infinity -> 1.000000000000000000000000000000010
+dqnextt218 nexttoward 1.000000000000000000000000000000010 Infinity -> 1.000000000000000000000000000000011
+dqnextt219 nexttoward 1.000000000000000000000000000000011 Infinity -> 1.000000000000000000000000000000012
+
+dqnextt221 nexttoward -0.9999999999999999999999999999999995 Infinity -> -0.9999999999999999999999999999999994
+dqnextt222 nexttoward -0.9999999999999999999999999999999996 Infinity -> -0.9999999999999999999999999999999995
+dqnextt223 nexttoward -0.9999999999999999999999999999999997 Infinity -> -0.9999999999999999999999999999999996
+dqnextt224 nexttoward -0.9999999999999999999999999999999998 Infinity -> -0.9999999999999999999999999999999997
+dqnextt225 nexttoward -0.9999999999999999999999999999999999 Infinity -> -0.9999999999999999999999999999999998
+dqnextt226 nexttoward -1.000000000000000000000000000000000 Infinity -> -0.9999999999999999999999999999999999
+dqnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999999999999999999999
+dqnextt228 nexttoward -1 Infinity -> -0.9999999999999999999999999999999999
+dqnextt229 nexttoward -1.000000000000000000000000000000001 Infinity -> -1.000000000000000000000000000000000
+dqnextt230 nexttoward -1.000000000000000000000000000000002 Infinity -> -1.000000000000000000000000000000001
+dqnextt231 nexttoward -1.000000000000000000000000000000003 Infinity -> -1.000000000000000000000000000000002
+dqnextt232 nexttoward -1.000000000000000000000000000000004 Infinity -> -1.000000000000000000000000000000003
+dqnextt233 nexttoward -1.000000000000000000000000000000005 Infinity -> -1.000000000000000000000000000000004
+dqnextt234 nexttoward -1.000000000000000000000000000000006 Infinity -> -1.000000000000000000000000000000005
+dqnextt235 nexttoward -1.000000000000000000000000000000007 Infinity -> -1.000000000000000000000000000000006
+dqnextt236 nexttoward -1.000000000000000000000000000000008 Infinity -> -1.000000000000000000000000000000007
+dqnextt237 nexttoward -1.000000000000000000000000000000009 Infinity -> -1.000000000000000000000000000000008
+dqnextt238 nexttoward -1.000000000000000000000000000000010 Infinity -> -1.000000000000000000000000000000009
+dqnextt239 nexttoward -1.000000000000000000000000000000011 Infinity -> -1.000000000000000000000000000000010
+dqnextt240 nexttoward -1.000000000000000000000000000000012 Infinity -> -1.000000000000000000000000000000011
+
+-- Zeros
+dqnextt300 nexttoward 0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt301 nexttoward 0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt302 nexttoward 0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt303 nexttoward 0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt304 nexttoward 0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt305 nexttoward -0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt306 nexttoward -0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt307 nexttoward -0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt308 nexttoward -0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt309 nexttoward -0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+-- specials
+dqnextt350 nexttoward Inf Infinity -> Infinity
+dqnextt351 nexttoward -Inf Infinity -> -9.999999999999999999999999999999999E+6144
+dqnextt352 nexttoward NaN Infinity -> NaN
+dqnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
+dqnextt354 nexttoward NaN77 Infinity -> NaN77
+dqnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
+dqnextt356 nexttoward -NaN Infinity -> -NaN
+dqnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
+dqnextt358 nexttoward -NaN77 Infinity -> -NaN77
+dqnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+dqnextt370 nexttoward -9.999999999999999999999999999999999E+6144 Infinity -> -9.999999999999999999999999999999998E+6144
+dqnextt371 nexttoward -9.999999999999999999999999999999998E+6144 Infinity -> -9.999999999999999999999999999999997E+6144
+dqnextt372 nexttoward -1E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
+dqnextt373 nexttoward -1.000000000000000E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
+dqnextt374 nexttoward -9E-6176 Infinity -> -8E-6176 Underflow Subnormal Inexact Rounded
+dqnextt375 nexttoward -9.9E-6175 Infinity -> -9.8E-6175 Underflow Subnormal Inexact Rounded
+dqnextt376 nexttoward -9.99999999999999999999999999999E-6147 Infinity -> -9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded
+dqnextt377 nexttoward -9.99999999999999999999999999999999E-6144 Infinity -> -9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded
+dqnextt378 nexttoward -9.99999999999999999999999999999998E-6144 Infinity -> -9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded
+dqnextt379 nexttoward -9.99999999999999999999999999999997E-6144 Infinity -> -9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded
+dqnextt380 nexttoward -0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt381 nexttoward -1E-6176 Infinity -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqnextt382 nexttoward -2E-6176 Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+
+dqnextt383 nexttoward 0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt384 nexttoward 1E-6176 Infinity -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqnextt385 nexttoward 2E-6176 Infinity -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqnextt386 nexttoward 10E-6176 Infinity -> 1.1E-6175 Underflow Subnormal Inexact Rounded
+dqnextt387 nexttoward 100E-6176 Infinity -> 1.01E-6174 Underflow Subnormal Inexact Rounded
+dqnextt388 nexttoward 100000E-6176 Infinity -> 1.00001E-6171 Underflow Subnormal Inexact Rounded
+dqnextt389 nexttoward 1.00000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
+dqnextt390 nexttoward 1.000000000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
+dqnextt391 nexttoward 1E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
+dqnextt392 nexttoward 9.999999999999999999999999999999997E+6144 Infinity -> 9.999999999999999999999999999999998E+6144
+dqnextt393 nexttoward 9.999999999999999999999999999999998E+6144 Infinity -> 9.999999999999999999999999999999999E+6144
+dqnextt394 nexttoward 9.999999999999999999999999999999999E+6144 Infinity -> Infinity Overflow Inexact Rounded
+
+------- lhs>rhs
+dqnextt401 nexttoward 0.9999999999999999999999999999999995 -Infinity -> 0.9999999999999999999999999999999994
+dqnextt402 nexttoward 0.9999999999999999999999999999999996 -Infinity -> 0.9999999999999999999999999999999995
+dqnextt403 nexttoward 0.9999999999999999999999999999999997 -Infinity -> 0.9999999999999999999999999999999996
+dqnextt404 nexttoward 0.9999999999999999999999999999999998 -Infinity -> 0.9999999999999999999999999999999997
+dqnextt405 nexttoward 0.9999999999999999999999999999999999 -Infinity -> 0.9999999999999999999999999999999998
+dqnextt406 nexttoward 1.000000000000000000000000000000000 -Infinity -> 0.9999999999999999999999999999999999
+dqnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999999999999999999999
+dqnextt408 nexttoward 1 -Infinity -> 0.9999999999999999999999999999999999
+dqnextt409 nexttoward 1.000000000000000000000000000000001 -Infinity -> 1.000000000000000000000000000000000
+dqnextt410 nexttoward 1.000000000000000000000000000000002 -Infinity -> 1.000000000000000000000000000000001
+dqnextt411 nexttoward 1.000000000000000000000000000000003 -Infinity -> 1.000000000000000000000000000000002
+dqnextt412 nexttoward 1.000000000000000000000000000000004 -Infinity -> 1.000000000000000000000000000000003
+dqnextt413 nexttoward 1.000000000000000000000000000000005 -Infinity -> 1.000000000000000000000000000000004
+dqnextt414 nexttoward 1.000000000000000000000000000000006 -Infinity -> 1.000000000000000000000000000000005
+dqnextt415 nexttoward 1.000000000000000000000000000000007 -Infinity -> 1.000000000000000000000000000000006
+dqnextt416 nexttoward 1.000000000000000000000000000000008 -Infinity -> 1.000000000000000000000000000000007
+dqnextt417 nexttoward 1.000000000000000000000000000000009 -Infinity -> 1.000000000000000000000000000000008
+dqnextt418 nexttoward 1.000000000000000000000000000000010 -Infinity -> 1.000000000000000000000000000000009
+dqnextt419 nexttoward 1.000000000000000000000000000000011 -Infinity -> 1.000000000000000000000000000000010
+dqnextt420 nexttoward 1.000000000000000000000000000000012 -Infinity -> 1.000000000000000000000000000000011
+
+dqnextt421 nexttoward -0.9999999999999999999999999999999995 -Infinity -> -0.9999999999999999999999999999999996
+dqnextt422 nexttoward -0.9999999999999999999999999999999996 -Infinity -> -0.9999999999999999999999999999999997
+dqnextt423 nexttoward -0.9999999999999999999999999999999997 -Infinity -> -0.9999999999999999999999999999999998
+dqnextt424 nexttoward -0.9999999999999999999999999999999998 -Infinity -> -0.9999999999999999999999999999999999
+dqnextt425 nexttoward -0.9999999999999999999999999999999999 -Infinity -> -1.000000000000000000000000000000000
+dqnextt426 nexttoward -1.000000000000000000000000000000000 -Infinity -> -1.000000000000000000000000000000001
+dqnextt427 nexttoward -1.0 -Infinity -> -1.000000000000000000000000000000001
+dqnextt428 nexttoward -1 -Infinity -> -1.000000000000000000000000000000001
+dqnextt429 nexttoward -1.000000000000000000000000000000001 -Infinity -> -1.000000000000000000000000000000002
+dqnextt430 nexttoward -1.000000000000000000000000000000002 -Infinity -> -1.000000000000000000000000000000003
+dqnextt431 nexttoward -1.000000000000000000000000000000003 -Infinity -> -1.000000000000000000000000000000004
+dqnextt432 nexttoward -1.000000000000000000000000000000004 -Infinity -> -1.000000000000000000000000000000005
+dqnextt433 nexttoward -1.000000000000000000000000000000005 -Infinity -> -1.000000000000000000000000000000006
+dqnextt434 nexttoward -1.000000000000000000000000000000006 -Infinity -> -1.000000000000000000000000000000007
+dqnextt435 nexttoward -1.000000000000000000000000000000007 -Infinity -> -1.000000000000000000000000000000008
+dqnextt436 nexttoward -1.000000000000000000000000000000008 -Infinity -> -1.000000000000000000000000000000009
+dqnextt437 nexttoward -1.000000000000000000000000000000009 -Infinity -> -1.000000000000000000000000000000010
+dqnextt438 nexttoward -1.000000000000000000000000000000010 -Infinity -> -1.000000000000000000000000000000011
+dqnextt439 nexttoward -1.000000000000000000000000000000011 -Infinity -> -1.000000000000000000000000000000012
+
+-- Zeros
+dqnextt500 nexttoward -0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt501 nexttoward 0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt502 nexttoward 0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt503 nexttoward -0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt504 nexttoward 0E-300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt505 nexttoward 0E+300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt506 nexttoward 0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt507 nexttoward -0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+
+-- specials
+dqnextt550 nexttoward Inf -Infinity -> 9.999999999999999999999999999999999E+6144
+dqnextt551 nexttoward -Inf -Infinity -> -Infinity
+dqnextt552 nexttoward NaN -Infinity -> NaN
+dqnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
+dqnextt554 nexttoward NaN77 -Infinity -> NaN77
+dqnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
+dqnextt556 nexttoward -NaN -Infinity -> -NaN
+dqnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
+dqnextt558 nexttoward -NaN77 -Infinity -> -NaN77
+dqnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+dqnextt670 nexttoward 9.999999999999999999999999999999999E+6144 -Infinity -> 9.999999999999999999999999999999998E+6144
+dqnextt671 nexttoward 9.999999999999999999999999999999998E+6144 -Infinity -> 9.999999999999999999999999999999997E+6144
+dqnextt672 nexttoward 1E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
+dqnextt673 nexttoward 1.000000000000000000000000000000000E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
+dqnextt674 nexttoward 9E-6176 -Infinity -> 8E-6176 Underflow Subnormal Inexact Rounded
+dqnextt675 nexttoward 9.9E-6175 -Infinity -> 9.8E-6175 Underflow Subnormal Inexact Rounded
+dqnextt676 nexttoward 9.99999999999999999999999999999E-6147 -Infinity -> 9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded
+dqnextt677 nexttoward 9.99999999999999999999999999999999E-6144 -Infinity -> 9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded
+dqnextt678 nexttoward 9.99999999999999999999999999999998E-6144 -Infinity -> 9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded
+dqnextt679 nexttoward 9.99999999999999999999999999999997E-6144 -Infinity -> 9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded
+dqnextt680 nexttoward 0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt681 nexttoward 1E-6176 -Infinity -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqnextt682 nexttoward 2E-6176 -Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+dqnextt683 nexttoward -0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt684 nexttoward -1E-6176 -Infinity -> -2E-6176 Underflow Subnormal Inexact Rounded
+dqnextt685 nexttoward -2E-6176 -Infinity -> -3E-6176 Underflow Subnormal Inexact Rounded
+dqnextt686 nexttoward -10E-6176 -Infinity -> -1.1E-6175 Underflow Subnormal Inexact Rounded
+dqnextt687 nexttoward -100E-6176 -Infinity -> -1.01E-6174 Underflow Subnormal Inexact Rounded
+dqnextt688 nexttoward -100000E-6176 -Infinity -> -1.00001E-6171 Underflow Subnormal Inexact Rounded
+dqnextt689 nexttoward -1.00000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
+dqnextt690 nexttoward -1.000000000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
+dqnextt691 nexttoward -1E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
+dqnextt692 nexttoward -9.999999999999999999999999999999998E+6144 -Infinity -> -9.999999999999999999999999999999999E+6144
+dqnextt693 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded
+
+------- Specials
+dqnextt780 nexttoward -Inf -Inf -> -Infinity
+dqnextt781 nexttoward -Inf -1000 -> -9.999999999999999999999999999999999E+6144
+dqnextt782 nexttoward -Inf -1 -> -9.999999999999999999999999999999999E+6144
+dqnextt783 nexttoward -Inf -0 -> -9.999999999999999999999999999999999E+6144
+dqnextt784 nexttoward -Inf 0 -> -9.999999999999999999999999999999999E+6144
+dqnextt785 nexttoward -Inf 1 -> -9.999999999999999999999999999999999E+6144
+dqnextt786 nexttoward -Inf 1000 -> -9.999999999999999999999999999999999E+6144
+dqnextt787 nexttoward -1000 -Inf -> -1000.000000000000000000000000000001
+dqnextt788 nexttoward -Inf -Inf -> -Infinity
+dqnextt789 nexttoward -1 -Inf -> -1.000000000000000000000000000000001
+dqnextt790 nexttoward -0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt791 nexttoward 0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt792 nexttoward 1 -Inf -> 0.9999999999999999999999999999999999
+dqnextt793 nexttoward 1000 -Inf -> 999.9999999999999999999999999999999
+dqnextt794 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144
+
+dqnextt800 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144
+dqnextt801 nexttoward Inf -1000 -> 9.999999999999999999999999999999999E+6144
+dqnextt802 nexttoward Inf -1 -> 9.999999999999999999999999999999999E+6144
+dqnextt803 nexttoward Inf -0 -> 9.999999999999999999999999999999999E+6144
+dqnextt804 nexttoward Inf 0 -> 9.999999999999999999999999999999999E+6144
+dqnextt805 nexttoward Inf 1 -> 9.999999999999999999999999999999999E+6144
+dqnextt806 nexttoward Inf 1000 -> 9.999999999999999999999999999999999E+6144
+dqnextt807 nexttoward Inf Inf -> Infinity
+dqnextt808 nexttoward -1000 Inf -> -999.9999999999999999999999999999999
+dqnextt809 nexttoward -Inf Inf -> -9.999999999999999999999999999999999E+6144
+dqnextt810 nexttoward -1 Inf -> -0.9999999999999999999999999999999999
+dqnextt811 nexttoward -0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt812 nexttoward 0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt813 nexttoward 1 Inf -> 1.000000000000000000000000000000001
+dqnextt814 nexttoward 1000 Inf -> 1000.000000000000000000000000000001
+dqnextt815 nexttoward Inf Inf -> Infinity
+
+dqnextt821 nexttoward NaN -Inf -> NaN
+dqnextt822 nexttoward NaN -1000 -> NaN
+dqnextt823 nexttoward NaN -1 -> NaN
+dqnextt824 nexttoward NaN -0 -> NaN
+dqnextt825 nexttoward NaN 0 -> NaN
+dqnextt826 nexttoward NaN 1 -> NaN
+dqnextt827 nexttoward NaN 1000 -> NaN
+dqnextt828 nexttoward NaN Inf -> NaN
+dqnextt829 nexttoward NaN NaN -> NaN
+dqnextt830 nexttoward -Inf NaN -> NaN
+dqnextt831 nexttoward -1000 NaN -> NaN
+dqnextt832 nexttoward -1 NaN -> NaN
+dqnextt833 nexttoward -0 NaN -> NaN
+dqnextt834 nexttoward 0 NaN -> NaN
+dqnextt835 nexttoward 1 NaN -> NaN
+dqnextt836 nexttoward 1000 NaN -> NaN
+dqnextt837 nexttoward Inf NaN -> NaN
+
+dqnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
+dqnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
+dqnextt843 nexttoward sNaN -1 -> NaN Invalid_operation
+dqnextt844 nexttoward sNaN -0 -> NaN Invalid_operation
+dqnextt845 nexttoward sNaN 0 -> NaN Invalid_operation
+dqnextt846 nexttoward sNaN 1 -> NaN Invalid_operation
+dqnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
+dqnextt848 nexttoward sNaN NaN -> NaN Invalid_operation
+dqnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
+dqnextt850 nexttoward NaN sNaN -> NaN Invalid_operation
+dqnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
+dqnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
+dqnextt853 nexttoward -1 sNaN -> NaN Invalid_operation
+dqnextt854 nexttoward -0 sNaN -> NaN Invalid_operation
+dqnextt855 nexttoward 0 sNaN -> NaN Invalid_operation
+dqnextt856 nexttoward 1 sNaN -> NaN Invalid_operation
+dqnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
+dqnextt858 nexttoward Inf sNaN -> NaN Invalid_operation
+dqnextt859 nexttoward NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqnextt861 nexttoward NaN1 -Inf -> NaN1
+dqnextt862 nexttoward +NaN2 -1000 -> NaN2
+dqnextt863 nexttoward NaN3 1000 -> NaN3
+dqnextt864 nexttoward NaN4 Inf -> NaN4
+dqnextt865 nexttoward NaN5 +NaN6 -> NaN5
+dqnextt866 nexttoward -Inf NaN7 -> NaN7
+dqnextt867 nexttoward -1000 NaN8 -> NaN8
+dqnextt868 nexttoward 1000 NaN9 -> NaN9
+dqnextt869 nexttoward Inf +NaN10 -> NaN10
+dqnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
+dqnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
+dqnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
+dqnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
+dqnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
+dqnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
+dqnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
+dqnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
+dqnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
+dqnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqnextt882 nexttoward -NaN26 NaN28 -> -NaN26
+dqnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqnextt884 nexttoward 1000 -NaN30 -> -NaN30
+dqnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Null tests
+dqnextt900 nexttoward 1 # -> NaN Invalid_operation
+dqnextt901 nexttoward # 1 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqOr.decTest b/Lib/test/decimaltestdata/dqOr.decTest
index 1fd34b2b35..daa3c86094 100644
--- a/Lib/test/decimaltestdata/dqOr.decTest
+++ b/Lib/test/decimaltestdata/dqOr.decTest
@@ -1,401 +1,401 @@
-------------------------------------------------------------------------
--- dqOr.decTest -- digitwise logical OR for decQuads --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check (truth table)
-dqor001 or 0 0 -> 0
-dqor002 or 0 1 -> 1
-dqor003 or 1 0 -> 1
-dqor004 or 1 1 -> 1
-dqor005 or 1100 1010 -> 1110
--- and at msd and msd-1
-dqor006 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqor007 or 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqor008 or 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqor009 or 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqor010 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqor011 or 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
-dqor012 or 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000
-dqor013 or 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
-
--- Various lengths
-dqor601 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111
-dqor602 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111
-dqor603 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111
-dqor604 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111
-dqor605 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111
-dqor606 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111
-dqor607 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111
-dqor608 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111
-dqor609 or 1111111101111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111111111111
-dqor610 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111
-dqor611 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111
-dqor612 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111
-dqor613 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111
-dqor614 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111
-dqor615 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111
-dqor616 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111
-dqor617 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111
-dqor618 or 1111111111111111101111111111111111 1111111111111111011111111111111111 -> 1111111111111111111111111111111111
-dqor619 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111
-dqor620 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111
-dqor621 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111
-dqor622 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111
-dqor623 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111
-dqor624 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111
-dqor625 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111
-dqor626 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111
-dqor627 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111
-dqor628 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor629 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor630 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor631 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor632 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor633 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor634 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111
-
-dqor641 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor642 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor643 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor644 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor645 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor646 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor647 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor648 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111
-dqor649 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111
-dqor650 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111
-dqor651 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111
-dqor652 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111
-dqor653 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111
-dqor654 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111
-dqor655 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111
-dqor656 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111
-dqor657 or 1010101010101010101010101010101010 1010101010101010001010101010101010 -> 1010101010101010101010101010101010
-dqor658 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111
-dqor659 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111
-dqor660 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111
-dqor661 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111
-dqor662 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111
-dqor663 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111
-dqor664 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111
-dqor665 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111
-dqor666 or 0101010101010101010101010101010101 0101010101010101010101010001010101 -> 101010101010101010101010101010101
-dqor667 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111
-dqor668 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111
-dqor669 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111
-dqor670 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111
-dqor671 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111
-dqor672 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111
-dqor673 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111
-dqor674 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111
-dqor675 or 0111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
-dqor676 or 1111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
-
-dqor681 or 0111111111111111111111111111111111 0111111111011111111111111111111110 -> 111111111111111111111111111111111
-dqor682 or 1011111111111111111111111111111111 1011111110101111111111111111111101 -> 1011111111111111111111111111111111
-dqor683 or 1101111111111111111111111111111111 1101111101110111111111111111111011 -> 1101111111111111111111111111111111
-dqor684 or 1110111111111111111111111111111111 1110111011111011111111111111110111 -> 1110111111111111111111111111111111
-dqor685 or 1111011111111111111111111111111111 1111010111111101111111111111101111 -> 1111011111111111111111111111111111
-dqor686 or 1111101111111111111111111111111111 1111101111111110111111111111011111 -> 1111101111111111111111111111111111
-dqor687 or 1111110111111111111111111111111111 1111010111111111011111111110111111 -> 1111110111111111111111111111111111
-dqor688 or 1111111011111111111111111111111111 1110111011111111101111111101111111 -> 1111111011111111111111111111111111
-dqor689 or 1111111101111111111111111111111111 1101111101111111110111111011111111 -> 1111111101111111111111111111111111
-dqor690 or 1111111110111111111111111111111111 1011111110111111111011110111111110 -> 1111111110111111111111111111111111
-dqor691 or 1111111111011111111111111111111111 0111111111011111111101101111111101 -> 1111111111011111111111111111111111
-dqor692 or 1111111111101111111111111111111111 1111111111101111111110011111111011 -> 1111111111101111111111111111111111
-dqor693 or 1111111111110111111111111111111111 1111111111110111111110011111110111 -> 1111111111110111111111111111111111
-dqor694 or 1111111111111011111111111111111111 1111111111111011111101101111101111 -> 1111111111111011111111111111111111
-dqor695 or 1111111111111101111111111111111111 1111111111111101111011110111011111 -> 1111111111111101111111111111111111
-dqor696 or 1111111111111110111111111111111111 1111111111111110110111111010111111 -> 1111111111111110111111111111111111
-dqor697 or 1111111111111111011111111111111111 1111111111111111001111111101111111 -> 1111111111111111011111111111111111
-dqor698 or 1111111111111111101111111111111111 1111111111111111001111111010111111 -> 1111111111111111101111111111111111
-dqor699 or 1111111111111111110111111111111111 1111111111111110110111110111011111 -> 1111111111111111110111111111111111
-dqor700 or 1111111111111111111011111111111111 1111111111111101111011101111101111 -> 1111111111111111111011111111111111
-dqor701 or 1111111111111111111101111111111111 1111111111111011111101011111110111 -> 1111111111111111111101111111111111
-dqor702 or 1111111111111111111110111111111111 1111111111110111111110111111111011 -> 1111111111111111111110111111111111
-dqor703 or 1111111111111111111111011111111111 1111111111101111111101011111111101 -> 1111111111111111111111011111111111
-dqor704 or 1111111111111111111111101111111111 1111111111011111111011101111111110 -> 1111111111111111111111101111111111
-dqor705 or 1111111111111111111111110111111111 0111111110111111110111110111111111 -> 1111111111111111111111110111111111
-dqor706 or 1111111111111111111111111011111111 1011111101111111101111111011111111 -> 1111111111111111111111111011111111
-dqor707 or 1111111111111111111111111101111111 1101111011111111011111111101111111 -> 1111111111111111111111111101111111
-dqor708 or 1111111111111111111111111110111111 1110110111111110111111111110111111 -> 1111111111111111111111111110111111
-dqor709 or 1111111111111111111111111111011111 1111001111111101111111111111011111 -> 1111111111111111111111111111011111
-dqor710 or 1111111111111111111111111111101111 1111001111111011111111111111101111 -> 1111111111111111111111111111101111
-dqor711 or 1111111111111111111111111111110111 1110110111110111111111111111110111 -> 1111111111111111111111111111110111
-dqor712 or 1111111111111111111111111111111011 1101111011101111111111111111111011 -> 1111111111111111111111111111111011
-dqor713 or 1111111111111111111111111111111101 1011111101011111111111111111111101 -> 1111111111111111111111111111111101
-dqor714 or 1111111111111111111111111111111110 0111111110111111111111111111111110 -> 1111111111111111111111111111111110
-
-
-
--- 1234567890123456 1234567890123456 1234567890123456
-dqor020 or 1111111111111111 1111111111111111 -> 1111111111111111
-dqor021 or 111111111111111 111111111111111 -> 111111111111111
-dqor022 or 11111111111111 11111111111111 -> 11111111111111
-dqor023 or 1111111111111 1111111111111 -> 1111111111111
-dqor024 or 111111111111 111111111111 -> 111111111111
-dqor025 or 11111111111 11111111111 -> 11111111111
-dqor026 or 1111111111 1111111111 -> 1111111111
-dqor027 or 111111111 111111111 -> 111111111
-dqor028 or 11111111 11111111 -> 11111111
-dqor029 or 1111111 1111111 -> 1111111
-dqor030 or 111111 111111 -> 111111
-dqor031 or 11111 11111 -> 11111
-dqor032 or 1111 1111 -> 1111
-dqor033 or 111 111 -> 111
-dqor034 or 11 11 -> 11
-dqor035 or 1 1 -> 1
-dqor036 or 0 0 -> 0
-
-dqor042 or 111111110000000 1111111110000000 -> 1111111110000000
-dqor043 or 11111110000000 1000000100000000 -> 1011111110000000
-dqor044 or 1111110000000 1000001000000000 -> 1001111110000000
-dqor045 or 111110000000 1000010000000000 -> 1000111110000000
-dqor046 or 11110000000 1000100000000000 -> 1000111110000000
-dqor047 or 1110000000 1001000000000000 -> 1001001110000000
-dqor048 or 110000000 1010000000000000 -> 1010000110000000
-dqor049 or 10000000 1100000000000000 -> 1100000010000000
-
-dqor090 or 011111111 111101111 -> 111111111
-dqor091 or 101111111 111101111 -> 111111111
-dqor092 or 110111111 111101111 -> 111111111
-dqor093 or 111011111 111101111 -> 111111111
-dqor094 or 111101111 111101111 -> 111101111
-dqor095 or 111110111 111101111 -> 111111111
-dqor096 or 111111011 111101111 -> 111111111
-dqor097 or 111111101 111101111 -> 111111111
-dqor098 or 111111110 111101111 -> 111111111
-
-dqor100 or 111101111 011111111 -> 111111111
-dqor101 or 111101111 101111111 -> 111111111
-dqor102 or 111101111 110111111 -> 111111111
-dqor103 or 111101111 111011111 -> 111111111
-dqor104 or 111101111 111101111 -> 111101111
-dqor105 or 111101111 111110111 -> 111111111
-dqor106 or 111101111 111111011 -> 111111111
-dqor107 or 111101111 111111101 -> 111111111
-dqor108 or 111101111 111111110 -> 111111111
-
--- non-0/1 should not be accepted, nor should signs
-dqor220 or 111111112 111111111 -> NaN Invalid_operation
-dqor221 or 333333333 333333333 -> NaN Invalid_operation
-dqor222 or 555555555 555555555 -> NaN Invalid_operation
-dqor223 or 777777777 777777777 -> NaN Invalid_operation
-dqor224 or 999999999 999999999 -> NaN Invalid_operation
-dqor225 or 222222222 999999999 -> NaN Invalid_operation
-dqor226 or 444444444 999999999 -> NaN Invalid_operation
-dqor227 or 666666666 999999999 -> NaN Invalid_operation
-dqor228 or 888888888 999999999 -> NaN Invalid_operation
-dqor229 or 999999999 222222222 -> NaN Invalid_operation
-dqor230 or 999999999 444444444 -> NaN Invalid_operation
-dqor231 or 999999999 666666666 -> NaN Invalid_operation
-dqor232 or 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-dqor240 or 567468689 -934981942 -> NaN Invalid_operation
-dqor241 or 567367689 934981942 -> NaN Invalid_operation
-dqor242 or -631917772 -706014634 -> NaN Invalid_operation
-dqor243 or -756253257 138579234 -> NaN Invalid_operation
-dqor244 or 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-dqor250 or 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqor251 or 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqor252 or 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqor253 or 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqor254 or 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqor255 or 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqor256 or 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqor257 or 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqor258 or 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqor259 or 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqor260 or 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqor261 or 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
-dqor262 or 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqor263 or 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqor264 or 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqor265 or 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
--- test MSD-1
-dqor270 or 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
-dqor271 or 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
-dqor272 or 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
-dqor273 or 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
-dqor274 or 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
-dqor275 or 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
-dqor276 or 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
-dqor277 or 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
--- test LSD
-dqor280 or 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
-dqor281 or 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
-dqor282 or 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
-dqor283 or 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
-dqor284 or 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
-dqor285 or 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
-dqor286 or 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
-dqor287 or 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
--- test Middie
-dqor288 or 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
-dqor289 or 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
-dqor290 or 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
-dqor291 or 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
-dqor292 or 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
-dqor293 or 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
-dqor294 or 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
-dqor295 or 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
--- signs
-dqor296 or -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
-dqor297 or -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
-dqor298 or 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
-dqor299 or 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001111001111001111000011000100
-
--- Nmax, Nmin, Ntiny-like
-dqor331 or 2 9.99999999E+1999 -> NaN Invalid_operation
-dqor332 or 3 1E-1999 -> NaN Invalid_operation
-dqor333 or 4 1.00000000E-1999 -> NaN Invalid_operation
-dqor334 or 5 1E-1009 -> NaN Invalid_operation
-dqor335 or 6 -1E-1009 -> NaN Invalid_operation
-dqor336 or 7 -1.00000000E-1999 -> NaN Invalid_operation
-dqor337 or 8 -1E-1999 -> NaN Invalid_operation
-dqor338 or 9 -9.99999999E+1999 -> NaN Invalid_operation
-dqor341 or 9.99999999E+2999 -18 -> NaN Invalid_operation
-dqor342 or 1E-2999 01 -> NaN Invalid_operation
-dqor343 or 1.00000000E-2999 -18 -> NaN Invalid_operation
-dqor344 or 1E-1009 18 -> NaN Invalid_operation
-dqor345 or -1E-1009 -10 -> NaN Invalid_operation
-dqor346 or -1.00000000E-2999 18 -> NaN Invalid_operation
-dqor347 or -1E-2999 10 -> NaN Invalid_operation
-dqor348 or -9.99999999E+2999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-dqor361 or 1.0 1 -> NaN Invalid_operation
-dqor362 or 1E+1 1 -> NaN Invalid_operation
-dqor363 or 0.0 1 -> NaN Invalid_operation
-dqor364 or 0E+1 1 -> NaN Invalid_operation
-dqor365 or 9.9 1 -> NaN Invalid_operation
-dqor366 or 9E+1 1 -> NaN Invalid_operation
-dqor371 or 0 1.0 -> NaN Invalid_operation
-dqor372 or 0 1E+1 -> NaN Invalid_operation
-dqor373 or 0 0.0 -> NaN Invalid_operation
-dqor374 or 0 0E+1 -> NaN Invalid_operation
-dqor375 or 0 9.9 -> NaN Invalid_operation
-dqor376 or 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-dqor780 or -Inf -Inf -> NaN Invalid_operation
-dqor781 or -Inf -1000 -> NaN Invalid_operation
-dqor782 or -Inf -1 -> NaN Invalid_operation
-dqor783 or -Inf -0 -> NaN Invalid_operation
-dqor784 or -Inf 0 -> NaN Invalid_operation
-dqor785 or -Inf 1 -> NaN Invalid_operation
-dqor786 or -Inf 1000 -> NaN Invalid_operation
-dqor787 or -1000 -Inf -> NaN Invalid_operation
-dqor788 or -Inf -Inf -> NaN Invalid_operation
-dqor789 or -1 -Inf -> NaN Invalid_operation
-dqor790 or -0 -Inf -> NaN Invalid_operation
-dqor791 or 0 -Inf -> NaN Invalid_operation
-dqor792 or 1 -Inf -> NaN Invalid_operation
-dqor793 or 1000 -Inf -> NaN Invalid_operation
-dqor794 or Inf -Inf -> NaN Invalid_operation
-
-dqor800 or Inf -Inf -> NaN Invalid_operation
-dqor801 or Inf -1000 -> NaN Invalid_operation
-dqor802 or Inf -1 -> NaN Invalid_operation
-dqor803 or Inf -0 -> NaN Invalid_operation
-dqor804 or Inf 0 -> NaN Invalid_operation
-dqor805 or Inf 1 -> NaN Invalid_operation
-dqor806 or Inf 1000 -> NaN Invalid_operation
-dqor807 or Inf Inf -> NaN Invalid_operation
-dqor808 or -1000 Inf -> NaN Invalid_operation
-dqor809 or -Inf Inf -> NaN Invalid_operation
-dqor810 or -1 Inf -> NaN Invalid_operation
-dqor811 or -0 Inf -> NaN Invalid_operation
-dqor812 or 0 Inf -> NaN Invalid_operation
-dqor813 or 1 Inf -> NaN Invalid_operation
-dqor814 or 1000 Inf -> NaN Invalid_operation
-dqor815 or Inf Inf -> NaN Invalid_operation
-
-dqor821 or NaN -Inf -> NaN Invalid_operation
-dqor822 or NaN -1000 -> NaN Invalid_operation
-dqor823 or NaN -1 -> NaN Invalid_operation
-dqor824 or NaN -0 -> NaN Invalid_operation
-dqor825 or NaN 0 -> NaN Invalid_operation
-dqor826 or NaN 1 -> NaN Invalid_operation
-dqor827 or NaN 1000 -> NaN Invalid_operation
-dqor828 or NaN Inf -> NaN Invalid_operation
-dqor829 or NaN NaN -> NaN Invalid_operation
-dqor830 or -Inf NaN -> NaN Invalid_operation
-dqor831 or -1000 NaN -> NaN Invalid_operation
-dqor832 or -1 NaN -> NaN Invalid_operation
-dqor833 or -0 NaN -> NaN Invalid_operation
-dqor834 or 0 NaN -> NaN Invalid_operation
-dqor835 or 1 NaN -> NaN Invalid_operation
-dqor836 or 1000 NaN -> NaN Invalid_operation
-dqor837 or Inf NaN -> NaN Invalid_operation
-
-dqor841 or sNaN -Inf -> NaN Invalid_operation
-dqor842 or sNaN -1000 -> NaN Invalid_operation
-dqor843 or sNaN -1 -> NaN Invalid_operation
-dqor844 or sNaN -0 -> NaN Invalid_operation
-dqor845 or sNaN 0 -> NaN Invalid_operation
-dqor846 or sNaN 1 -> NaN Invalid_operation
-dqor847 or sNaN 1000 -> NaN Invalid_operation
-dqor848 or sNaN NaN -> NaN Invalid_operation
-dqor849 or sNaN sNaN -> NaN Invalid_operation
-dqor850 or NaN sNaN -> NaN Invalid_operation
-dqor851 or -Inf sNaN -> NaN Invalid_operation
-dqor852 or -1000 sNaN -> NaN Invalid_operation
-dqor853 or -1 sNaN -> NaN Invalid_operation
-dqor854 or -0 sNaN -> NaN Invalid_operation
-dqor855 or 0 sNaN -> NaN Invalid_operation
-dqor856 or 1 sNaN -> NaN Invalid_operation
-dqor857 or 1000 sNaN -> NaN Invalid_operation
-dqor858 or Inf sNaN -> NaN Invalid_operation
-dqor859 or NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqor861 or NaN1 -Inf -> NaN Invalid_operation
-dqor862 or +NaN2 -1000 -> NaN Invalid_operation
-dqor863 or NaN3 1000 -> NaN Invalid_operation
-dqor864 or NaN4 Inf -> NaN Invalid_operation
-dqor865 or NaN5 +NaN6 -> NaN Invalid_operation
-dqor866 or -Inf NaN7 -> NaN Invalid_operation
-dqor867 or -1000 NaN8 -> NaN Invalid_operation
-dqor868 or 1000 NaN9 -> NaN Invalid_operation
-dqor869 or Inf +NaN10 -> NaN Invalid_operation
-dqor871 or sNaN11 -Inf -> NaN Invalid_operation
-dqor872 or sNaN12 -1000 -> NaN Invalid_operation
-dqor873 or sNaN13 1000 -> NaN Invalid_operation
-dqor874 or sNaN14 NaN17 -> NaN Invalid_operation
-dqor875 or sNaN15 sNaN18 -> NaN Invalid_operation
-dqor876 or NaN16 sNaN19 -> NaN Invalid_operation
-dqor877 or -Inf +sNaN20 -> NaN Invalid_operation
-dqor878 or -1000 sNaN21 -> NaN Invalid_operation
-dqor879 or 1000 sNaN22 -> NaN Invalid_operation
-dqor880 or Inf sNaN23 -> NaN Invalid_operation
-dqor881 or +NaN25 +sNaN24 -> NaN Invalid_operation
-dqor882 or -NaN26 NaN28 -> NaN Invalid_operation
-dqor883 or -sNaN27 sNaN29 -> NaN Invalid_operation
-dqor884 or 1000 -NaN30 -> NaN Invalid_operation
-dqor885 or 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqOr.decTest -- digitwise logical OR for decQuads --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check (truth table)
+dqor001 or 0 0 -> 0
+dqor002 or 0 1 -> 1
+dqor003 or 1 0 -> 1
+dqor004 or 1 1 -> 1
+dqor005 or 1100 1010 -> 1110
+-- and at msd and msd-1
+dqor006 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqor007 or 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqor008 or 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqor009 or 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqor010 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqor011 or 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
+dqor012 or 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000
+dqor013 or 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
+
+-- Various lengths
+dqor601 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111
+dqor602 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111
+dqor603 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111
+dqor604 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111
+dqor605 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111
+dqor606 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111
+dqor607 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111
+dqor608 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111
+dqor609 or 1111111101111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111111111111
+dqor610 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111
+dqor611 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111
+dqor612 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111
+dqor613 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111
+dqor614 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111
+dqor615 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111
+dqor616 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111
+dqor617 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111
+dqor618 or 1111111111111111101111111111111111 1111111111111111011111111111111111 -> 1111111111111111111111111111111111
+dqor619 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111
+dqor620 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111
+dqor621 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111
+dqor622 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111
+dqor623 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111
+dqor624 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111
+dqor625 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111
+dqor626 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111
+dqor627 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111
+dqor628 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor629 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor630 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor631 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor632 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor633 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor634 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111
+
+dqor641 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor642 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor643 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor644 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor645 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor646 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor647 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor648 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111
+dqor649 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111
+dqor650 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111
+dqor651 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111
+dqor652 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111
+dqor653 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111
+dqor654 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111
+dqor655 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111
+dqor656 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111
+dqor657 or 1010101010101010101010101010101010 1010101010101010001010101010101010 -> 1010101010101010101010101010101010
+dqor658 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111
+dqor659 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111
+dqor660 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111
+dqor661 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111
+dqor662 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111
+dqor663 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111
+dqor664 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111
+dqor665 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111
+dqor666 or 0101010101010101010101010101010101 0101010101010101010101010001010101 -> 101010101010101010101010101010101
+dqor667 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111
+dqor668 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111
+dqor669 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111
+dqor670 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111
+dqor671 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111
+dqor672 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111
+dqor673 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111
+dqor674 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111
+dqor675 or 0111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
+dqor676 or 1111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
+
+dqor681 or 0111111111111111111111111111111111 0111111111011111111111111111111110 -> 111111111111111111111111111111111
+dqor682 or 1011111111111111111111111111111111 1011111110101111111111111111111101 -> 1011111111111111111111111111111111
+dqor683 or 1101111111111111111111111111111111 1101111101110111111111111111111011 -> 1101111111111111111111111111111111
+dqor684 or 1110111111111111111111111111111111 1110111011111011111111111111110111 -> 1110111111111111111111111111111111
+dqor685 or 1111011111111111111111111111111111 1111010111111101111111111111101111 -> 1111011111111111111111111111111111
+dqor686 or 1111101111111111111111111111111111 1111101111111110111111111111011111 -> 1111101111111111111111111111111111
+dqor687 or 1111110111111111111111111111111111 1111010111111111011111111110111111 -> 1111110111111111111111111111111111
+dqor688 or 1111111011111111111111111111111111 1110111011111111101111111101111111 -> 1111111011111111111111111111111111
+dqor689 or 1111111101111111111111111111111111 1101111101111111110111111011111111 -> 1111111101111111111111111111111111
+dqor690 or 1111111110111111111111111111111111 1011111110111111111011110111111110 -> 1111111110111111111111111111111111
+dqor691 or 1111111111011111111111111111111111 0111111111011111111101101111111101 -> 1111111111011111111111111111111111
+dqor692 or 1111111111101111111111111111111111 1111111111101111111110011111111011 -> 1111111111101111111111111111111111
+dqor693 or 1111111111110111111111111111111111 1111111111110111111110011111110111 -> 1111111111110111111111111111111111
+dqor694 or 1111111111111011111111111111111111 1111111111111011111101101111101111 -> 1111111111111011111111111111111111
+dqor695 or 1111111111111101111111111111111111 1111111111111101111011110111011111 -> 1111111111111101111111111111111111
+dqor696 or 1111111111111110111111111111111111 1111111111111110110111111010111111 -> 1111111111111110111111111111111111
+dqor697 or 1111111111111111011111111111111111 1111111111111111001111111101111111 -> 1111111111111111011111111111111111
+dqor698 or 1111111111111111101111111111111111 1111111111111111001111111010111111 -> 1111111111111111101111111111111111
+dqor699 or 1111111111111111110111111111111111 1111111111111110110111110111011111 -> 1111111111111111110111111111111111
+dqor700 or 1111111111111111111011111111111111 1111111111111101111011101111101111 -> 1111111111111111111011111111111111
+dqor701 or 1111111111111111111101111111111111 1111111111111011111101011111110111 -> 1111111111111111111101111111111111
+dqor702 or 1111111111111111111110111111111111 1111111111110111111110111111111011 -> 1111111111111111111110111111111111
+dqor703 or 1111111111111111111111011111111111 1111111111101111111101011111111101 -> 1111111111111111111111011111111111
+dqor704 or 1111111111111111111111101111111111 1111111111011111111011101111111110 -> 1111111111111111111111101111111111
+dqor705 or 1111111111111111111111110111111111 0111111110111111110111110111111111 -> 1111111111111111111111110111111111
+dqor706 or 1111111111111111111111111011111111 1011111101111111101111111011111111 -> 1111111111111111111111111011111111
+dqor707 or 1111111111111111111111111101111111 1101111011111111011111111101111111 -> 1111111111111111111111111101111111
+dqor708 or 1111111111111111111111111110111111 1110110111111110111111111110111111 -> 1111111111111111111111111110111111
+dqor709 or 1111111111111111111111111111011111 1111001111111101111111111111011111 -> 1111111111111111111111111111011111
+dqor710 or 1111111111111111111111111111101111 1111001111111011111111111111101111 -> 1111111111111111111111111111101111
+dqor711 or 1111111111111111111111111111110111 1110110111110111111111111111110111 -> 1111111111111111111111111111110111
+dqor712 or 1111111111111111111111111111111011 1101111011101111111111111111111011 -> 1111111111111111111111111111111011
+dqor713 or 1111111111111111111111111111111101 1011111101011111111111111111111101 -> 1111111111111111111111111111111101
+dqor714 or 1111111111111111111111111111111110 0111111110111111111111111111111110 -> 1111111111111111111111111111111110
+
+
+
+-- 1234567890123456 1234567890123456 1234567890123456
+dqor020 or 1111111111111111 1111111111111111 -> 1111111111111111
+dqor021 or 111111111111111 111111111111111 -> 111111111111111
+dqor022 or 11111111111111 11111111111111 -> 11111111111111
+dqor023 or 1111111111111 1111111111111 -> 1111111111111
+dqor024 or 111111111111 111111111111 -> 111111111111
+dqor025 or 11111111111 11111111111 -> 11111111111
+dqor026 or 1111111111 1111111111 -> 1111111111
+dqor027 or 111111111 111111111 -> 111111111
+dqor028 or 11111111 11111111 -> 11111111
+dqor029 or 1111111 1111111 -> 1111111
+dqor030 or 111111 111111 -> 111111
+dqor031 or 11111 11111 -> 11111
+dqor032 or 1111 1111 -> 1111
+dqor033 or 111 111 -> 111
+dqor034 or 11 11 -> 11
+dqor035 or 1 1 -> 1
+dqor036 or 0 0 -> 0
+
+dqor042 or 111111110000000 1111111110000000 -> 1111111110000000
+dqor043 or 11111110000000 1000000100000000 -> 1011111110000000
+dqor044 or 1111110000000 1000001000000000 -> 1001111110000000
+dqor045 or 111110000000 1000010000000000 -> 1000111110000000
+dqor046 or 11110000000 1000100000000000 -> 1000111110000000
+dqor047 or 1110000000 1001000000000000 -> 1001001110000000
+dqor048 or 110000000 1010000000000000 -> 1010000110000000
+dqor049 or 10000000 1100000000000000 -> 1100000010000000
+
+dqor090 or 011111111 111101111 -> 111111111
+dqor091 or 101111111 111101111 -> 111111111
+dqor092 or 110111111 111101111 -> 111111111
+dqor093 or 111011111 111101111 -> 111111111
+dqor094 or 111101111 111101111 -> 111101111
+dqor095 or 111110111 111101111 -> 111111111
+dqor096 or 111111011 111101111 -> 111111111
+dqor097 or 111111101 111101111 -> 111111111
+dqor098 or 111111110 111101111 -> 111111111
+
+dqor100 or 111101111 011111111 -> 111111111
+dqor101 or 111101111 101111111 -> 111111111
+dqor102 or 111101111 110111111 -> 111111111
+dqor103 or 111101111 111011111 -> 111111111
+dqor104 or 111101111 111101111 -> 111101111
+dqor105 or 111101111 111110111 -> 111111111
+dqor106 or 111101111 111111011 -> 111111111
+dqor107 or 111101111 111111101 -> 111111111
+dqor108 or 111101111 111111110 -> 111111111
+
+-- non-0/1 should not be accepted, nor should signs
+dqor220 or 111111112 111111111 -> NaN Invalid_operation
+dqor221 or 333333333 333333333 -> NaN Invalid_operation
+dqor222 or 555555555 555555555 -> NaN Invalid_operation
+dqor223 or 777777777 777777777 -> NaN Invalid_operation
+dqor224 or 999999999 999999999 -> NaN Invalid_operation
+dqor225 or 222222222 999999999 -> NaN Invalid_operation
+dqor226 or 444444444 999999999 -> NaN Invalid_operation
+dqor227 or 666666666 999999999 -> NaN Invalid_operation
+dqor228 or 888888888 999999999 -> NaN Invalid_operation
+dqor229 or 999999999 222222222 -> NaN Invalid_operation
+dqor230 or 999999999 444444444 -> NaN Invalid_operation
+dqor231 or 999999999 666666666 -> NaN Invalid_operation
+dqor232 or 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+dqor240 or 567468689 -934981942 -> NaN Invalid_operation
+dqor241 or 567367689 934981942 -> NaN Invalid_operation
+dqor242 or -631917772 -706014634 -> NaN Invalid_operation
+dqor243 or -756253257 138579234 -> NaN Invalid_operation
+dqor244 or 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+dqor250 or 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqor251 or 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqor252 or 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqor253 or 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqor254 or 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqor255 or 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqor256 or 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqor257 or 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqor258 or 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqor259 or 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqor260 or 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqor261 or 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+dqor262 or 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqor263 or 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqor264 or 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqor265 or 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+-- test MSD-1
+dqor270 or 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
+dqor271 or 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
+dqor272 or 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
+dqor273 or 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
+dqor274 or 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
+dqor275 or 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
+dqor276 or 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
+dqor277 or 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
+-- test LSD
+dqor280 or 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
+dqor281 or 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
+dqor282 or 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
+dqor283 or 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
+dqor284 or 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
+dqor285 or 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
+dqor286 or 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
+dqor287 or 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
+-- test Middie
+dqor288 or 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
+dqor289 or 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
+dqor290 or 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
+dqor291 or 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
+dqor292 or 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
+dqor293 or 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
+dqor294 or 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
+dqor295 or 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
+-- signs
+dqor296 or -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
+dqor297 or -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
+dqor298 or 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
+dqor299 or 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001111001111001111000011000100
+
+-- Nmax, Nmin, Ntiny-like
+dqor331 or 2 9.99999999E+1999 -> NaN Invalid_operation
+dqor332 or 3 1E-1999 -> NaN Invalid_operation
+dqor333 or 4 1.00000000E-1999 -> NaN Invalid_operation
+dqor334 or 5 1E-1009 -> NaN Invalid_operation
+dqor335 or 6 -1E-1009 -> NaN Invalid_operation
+dqor336 or 7 -1.00000000E-1999 -> NaN Invalid_operation
+dqor337 or 8 -1E-1999 -> NaN Invalid_operation
+dqor338 or 9 -9.99999999E+1999 -> NaN Invalid_operation
+dqor341 or 9.99999999E+2999 -18 -> NaN Invalid_operation
+dqor342 or 1E-2999 01 -> NaN Invalid_operation
+dqor343 or 1.00000000E-2999 -18 -> NaN Invalid_operation
+dqor344 or 1E-1009 18 -> NaN Invalid_operation
+dqor345 or -1E-1009 -10 -> NaN Invalid_operation
+dqor346 or -1.00000000E-2999 18 -> NaN Invalid_operation
+dqor347 or -1E-2999 10 -> NaN Invalid_operation
+dqor348 or -9.99999999E+2999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+dqor361 or 1.0 1 -> NaN Invalid_operation
+dqor362 or 1E+1 1 -> NaN Invalid_operation
+dqor363 or 0.0 1 -> NaN Invalid_operation
+dqor364 or 0E+1 1 -> NaN Invalid_operation
+dqor365 or 9.9 1 -> NaN Invalid_operation
+dqor366 or 9E+1 1 -> NaN Invalid_operation
+dqor371 or 0 1.0 -> NaN Invalid_operation
+dqor372 or 0 1E+1 -> NaN Invalid_operation
+dqor373 or 0 0.0 -> NaN Invalid_operation
+dqor374 or 0 0E+1 -> NaN Invalid_operation
+dqor375 or 0 9.9 -> NaN Invalid_operation
+dqor376 or 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+dqor780 or -Inf -Inf -> NaN Invalid_operation
+dqor781 or -Inf -1000 -> NaN Invalid_operation
+dqor782 or -Inf -1 -> NaN Invalid_operation
+dqor783 or -Inf -0 -> NaN Invalid_operation
+dqor784 or -Inf 0 -> NaN Invalid_operation
+dqor785 or -Inf 1 -> NaN Invalid_operation
+dqor786 or -Inf 1000 -> NaN Invalid_operation
+dqor787 or -1000 -Inf -> NaN Invalid_operation
+dqor788 or -Inf -Inf -> NaN Invalid_operation
+dqor789 or -1 -Inf -> NaN Invalid_operation
+dqor790 or -0 -Inf -> NaN Invalid_operation
+dqor791 or 0 -Inf -> NaN Invalid_operation
+dqor792 or 1 -Inf -> NaN Invalid_operation
+dqor793 or 1000 -Inf -> NaN Invalid_operation
+dqor794 or Inf -Inf -> NaN Invalid_operation
+
+dqor800 or Inf -Inf -> NaN Invalid_operation
+dqor801 or Inf -1000 -> NaN Invalid_operation
+dqor802 or Inf -1 -> NaN Invalid_operation
+dqor803 or Inf -0 -> NaN Invalid_operation
+dqor804 or Inf 0 -> NaN Invalid_operation
+dqor805 or Inf 1 -> NaN Invalid_operation
+dqor806 or Inf 1000 -> NaN Invalid_operation
+dqor807 or Inf Inf -> NaN Invalid_operation
+dqor808 or -1000 Inf -> NaN Invalid_operation
+dqor809 or -Inf Inf -> NaN Invalid_operation
+dqor810 or -1 Inf -> NaN Invalid_operation
+dqor811 or -0 Inf -> NaN Invalid_operation
+dqor812 or 0 Inf -> NaN Invalid_operation
+dqor813 or 1 Inf -> NaN Invalid_operation
+dqor814 or 1000 Inf -> NaN Invalid_operation
+dqor815 or Inf Inf -> NaN Invalid_operation
+
+dqor821 or NaN -Inf -> NaN Invalid_operation
+dqor822 or NaN -1000 -> NaN Invalid_operation
+dqor823 or NaN -1 -> NaN Invalid_operation
+dqor824 or NaN -0 -> NaN Invalid_operation
+dqor825 or NaN 0 -> NaN Invalid_operation
+dqor826 or NaN 1 -> NaN Invalid_operation
+dqor827 or NaN 1000 -> NaN Invalid_operation
+dqor828 or NaN Inf -> NaN Invalid_operation
+dqor829 or NaN NaN -> NaN Invalid_operation
+dqor830 or -Inf NaN -> NaN Invalid_operation
+dqor831 or -1000 NaN -> NaN Invalid_operation
+dqor832 or -1 NaN -> NaN Invalid_operation
+dqor833 or -0 NaN -> NaN Invalid_operation
+dqor834 or 0 NaN -> NaN Invalid_operation
+dqor835 or 1 NaN -> NaN Invalid_operation
+dqor836 or 1000 NaN -> NaN Invalid_operation
+dqor837 or Inf NaN -> NaN Invalid_operation
+
+dqor841 or sNaN -Inf -> NaN Invalid_operation
+dqor842 or sNaN -1000 -> NaN Invalid_operation
+dqor843 or sNaN -1 -> NaN Invalid_operation
+dqor844 or sNaN -0 -> NaN Invalid_operation
+dqor845 or sNaN 0 -> NaN Invalid_operation
+dqor846 or sNaN 1 -> NaN Invalid_operation
+dqor847 or sNaN 1000 -> NaN Invalid_operation
+dqor848 or sNaN NaN -> NaN Invalid_operation
+dqor849 or sNaN sNaN -> NaN Invalid_operation
+dqor850 or NaN sNaN -> NaN Invalid_operation
+dqor851 or -Inf sNaN -> NaN Invalid_operation
+dqor852 or -1000 sNaN -> NaN Invalid_operation
+dqor853 or -1 sNaN -> NaN Invalid_operation
+dqor854 or -0 sNaN -> NaN Invalid_operation
+dqor855 or 0 sNaN -> NaN Invalid_operation
+dqor856 or 1 sNaN -> NaN Invalid_operation
+dqor857 or 1000 sNaN -> NaN Invalid_operation
+dqor858 or Inf sNaN -> NaN Invalid_operation
+dqor859 or NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqor861 or NaN1 -Inf -> NaN Invalid_operation
+dqor862 or +NaN2 -1000 -> NaN Invalid_operation
+dqor863 or NaN3 1000 -> NaN Invalid_operation
+dqor864 or NaN4 Inf -> NaN Invalid_operation
+dqor865 or NaN5 +NaN6 -> NaN Invalid_operation
+dqor866 or -Inf NaN7 -> NaN Invalid_operation
+dqor867 or -1000 NaN8 -> NaN Invalid_operation
+dqor868 or 1000 NaN9 -> NaN Invalid_operation
+dqor869 or Inf +NaN10 -> NaN Invalid_operation
+dqor871 or sNaN11 -Inf -> NaN Invalid_operation
+dqor872 or sNaN12 -1000 -> NaN Invalid_operation
+dqor873 or sNaN13 1000 -> NaN Invalid_operation
+dqor874 or sNaN14 NaN17 -> NaN Invalid_operation
+dqor875 or sNaN15 sNaN18 -> NaN Invalid_operation
+dqor876 or NaN16 sNaN19 -> NaN Invalid_operation
+dqor877 or -Inf +sNaN20 -> NaN Invalid_operation
+dqor878 or -1000 sNaN21 -> NaN Invalid_operation
+dqor879 or 1000 sNaN22 -> NaN Invalid_operation
+dqor880 or Inf sNaN23 -> NaN Invalid_operation
+dqor881 or +NaN25 +sNaN24 -> NaN Invalid_operation
+dqor882 or -NaN26 NaN28 -> NaN Invalid_operation
+dqor883 or -sNaN27 sNaN29 -> NaN Invalid_operation
+dqor884 or 1000 -NaN30 -> NaN Invalid_operation
+dqor885 or 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqPlus.decTest b/Lib/test/decimaltestdata/dqPlus.decTest
index 8aecaab796..df1a15ca7f 100644
--- a/Lib/test/decimaltestdata/dqPlus.decTest
+++ b/Lib/test/decimaltestdata/dqPlus.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqPlus.decTest -- decQuad 0+x --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqpls001 plus +7.50 -> 7.50
-
--- Infinities
-dqpls011 plus Infinity -> Infinity
-dqpls012 plus -Infinity -> -Infinity
-
--- NaNs, 0 payload
-ddqls021 plus NaN -> NaN
-ddqls022 plus -NaN -> -NaN
-ddqls023 plus sNaN -> NaN Invalid_operation
-ddqls024 plus -sNaN -> -NaN Invalid_operation
-
--- NaNs, non-0 payload
-ddqls031 plus NaN13 -> NaN13
-ddqls032 plus -NaN13 -> -NaN13
-ddqls033 plus sNaN13 -> NaN13 Invalid_operation
-ddqls034 plus -sNaN13 -> -NaN13 Invalid_operation
-ddqls035 plus NaN70 -> NaN70
-ddqls036 plus -NaN70 -> -NaN70
-ddqls037 plus sNaN101 -> NaN101 Invalid_operation
-ddqls038 plus -sNaN101 -> -NaN101 Invalid_operation
-
--- finites
-dqpls101 plus 7 -> 7
-dqpls102 plus -7 -> -7
-dqpls103 plus 75 -> 75
-dqpls104 plus -75 -> -75
-dqpls105 plus 7.50 -> 7.50
-dqpls106 plus -7.50 -> -7.50
-dqpls107 plus 7.500 -> 7.500
-dqpls108 plus -7.500 -> -7.500
-
--- zeros
-dqpls111 plus 0 -> 0
-dqpls112 plus -0 -> 0
-dqpls113 plus 0E+4 -> 0E+4
-dqpls114 plus -0E+4 -> 0E+4
-dqpls115 plus 0.0000 -> 0.0000
-dqpls116 plus -0.0000 -> 0.0000
-dqpls117 plus 0E-141 -> 0E-141
-dqpls118 plus -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqpls121 plus 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqpls122 plus -2682682682682682682682682682682682 -> -2682682682682682682682682682682682
-dqpls123 plus 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-dqpls124 plus -1341341341341341341341341341341341 -> -1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqpls131 plus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqpls132 plus 1E-6143 -> 1E-6143
-dqpls133 plus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqpls134 plus 1E-6176 -> 1E-6176 Subnormal
-
-dqpls135 plus -1E-6176 -> -1E-6176 Subnormal
-dqpls136 plus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqpls137 plus -1E-6143 -> -1E-6143
-dqpls138 plus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqPlus.decTest -- decQuad 0+x --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqpls001 plus +7.50 -> 7.50
+
+-- Infinities
+dqpls011 plus Infinity -> Infinity
+dqpls012 plus -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+ddqls021 plus NaN -> NaN
+ddqls022 plus -NaN -> -NaN
+ddqls023 plus sNaN -> NaN Invalid_operation
+ddqls024 plus -sNaN -> -NaN Invalid_operation
+
+-- NaNs, non-0 payload
+ddqls031 plus NaN13 -> NaN13
+ddqls032 plus -NaN13 -> -NaN13
+ddqls033 plus sNaN13 -> NaN13 Invalid_operation
+ddqls034 plus -sNaN13 -> -NaN13 Invalid_operation
+ddqls035 plus NaN70 -> NaN70
+ddqls036 plus -NaN70 -> -NaN70
+ddqls037 plus sNaN101 -> NaN101 Invalid_operation
+ddqls038 plus -sNaN101 -> -NaN101 Invalid_operation
+
+-- finites
+dqpls101 plus 7 -> 7
+dqpls102 plus -7 -> -7
+dqpls103 plus 75 -> 75
+dqpls104 plus -75 -> -75
+dqpls105 plus 7.50 -> 7.50
+dqpls106 plus -7.50 -> -7.50
+dqpls107 plus 7.500 -> 7.500
+dqpls108 plus -7.500 -> -7.500
+
+-- zeros
+dqpls111 plus 0 -> 0
+dqpls112 plus -0 -> 0
+dqpls113 plus 0E+4 -> 0E+4
+dqpls114 plus -0E+4 -> 0E+4
+dqpls115 plus 0.0000 -> 0.0000
+dqpls116 plus -0.0000 -> 0.0000
+dqpls117 plus 0E-141 -> 0E-141
+dqpls118 plus -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqpls121 plus 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqpls122 plus -2682682682682682682682682682682682 -> -2682682682682682682682682682682682
+dqpls123 plus 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+dqpls124 plus -1341341341341341341341341341341341 -> -1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqpls131 plus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqpls132 plus 1E-6143 -> 1E-6143
+dqpls133 plus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqpls134 plus 1E-6176 -> 1E-6176 Subnormal
+
+dqpls135 plus -1E-6176 -> -1E-6176 Subnormal
+dqpls136 plus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqpls137 plus -1E-6143 -> -1E-6143
+dqpls138 plus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqQuantize.decTest b/Lib/test/decimaltestdata/dqQuantize.decTest
index 51471c2626..4ed39b45c4 100644
--- a/Lib/test/decimaltestdata/dqQuantize.decTest
+++ b/Lib/test/decimaltestdata/dqQuantize.decTest
@@ -1,836 +1,836 @@
-------------------------------------------------------------------------
--- dqQuantize.decTest -- decQuad quantize operation --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Most of the tests here assume a "regular pattern", where the
--- sign and coefficient are +1.
--- 2004.03.15 Underflow for quantize is suppressed
--- 2005.06.08 More extensive tests for 'does not fit'
--- [Forked from quantize.decTest 2006.11.25]
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqqua001 quantize 0 1e0 -> 0
-dqqua002 quantize 1 1e0 -> 1
-dqqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
-dqqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
-dqqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
-dqqua007 quantize 0.1 1e-1 -> 0.1
-dqqua008 quantize 0.1 1e-2 -> 0.10
-dqqua009 quantize 0.1 1e-3 -> 0.100
-dqqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
-dqqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
-dqqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
-dqqua013 quantize 0.9 1e-1 -> 0.9
-dqqua014 quantize 0.9 1e-2 -> 0.90
-dqqua015 quantize 0.9 1e-3 -> 0.900
--- negatives
-dqqua021 quantize -0 1e0 -> -0
-dqqua022 quantize -1 1e0 -> -1
-dqqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
-dqqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
-dqqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
-dqqua027 quantize -0.1 1e-1 -> -0.1
-dqqua028 quantize -0.1 1e-2 -> -0.10
-dqqua029 quantize -0.1 1e-3 -> -0.100
-dqqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
-dqqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
-dqqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
-dqqua033 quantize -0.9 1e-1 -> -0.9
-dqqua034 quantize -0.9 1e-2 -> -0.90
-dqqua035 quantize -0.9 1e-3 -> -0.900
-dqqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
-dqqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
-dqqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
-dqqua039 quantize -0.5 1e-1 -> -0.5
-dqqua040 quantize -0.5 1e-2 -> -0.50
-dqqua041 quantize -0.5 1e-3 -> -0.500
-dqqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
-dqqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
-dqqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
-dqqua045 quantize -0.9 1e-1 -> -0.9
-dqqua046 quantize -0.9 1e-2 -> -0.90
-dqqua047 quantize -0.9 1e-3 -> -0.900
-
--- examples from Specification
-dqqua060 quantize 2.17 0.001 -> 2.170
-dqqua061 quantize 2.17 0.01 -> 2.17
-dqqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
-dqqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
-dqqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
-dqqua065 quantize -Inf Inf -> -Infinity
-dqqua066 quantize 2 Inf -> NaN Invalid_operation
-dqqua067 quantize -0.1 1 -> -0 Inexact Rounded
-dqqua068 quantize -0 1e+5 -> -0E+5
-dqqua069 quantize +123451234567899876543216789012345.6 1e-2 -> NaN Invalid_operation
-dqqua070 quantize -987651234567899876543214335236450.6 1e-2 -> NaN Invalid_operation
-dqqua071 quantize 217 1e-1 -> 217.0
-dqqua072 quantize 217 1e+0 -> 217
-dqqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
-dqqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
-
--- general tests ..
-dqqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
-dqqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
-dqqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
-dqqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
-dqqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
-dqqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
-dqqua095 quantize 1.2345 1e-6 -> 1.234500
-dqqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
-dqqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
-dqqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
-dqqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
-dqqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
-
-dqqua101 quantize -1 1e0 -> -1
-dqqua102 quantize -1 1e-1 -> -1.0
-dqqua103 quantize -1 1e-2 -> -1.00
-dqqua104 quantize 0 1e0 -> 0
-dqqua105 quantize 0 1e-1 -> 0.0
-dqqua106 quantize 0 1e-2 -> 0.00
-dqqua107 quantize 0.00 1e0 -> 0
-dqqua108 quantize 0 1e+1 -> 0E+1
-dqqua109 quantize 0 1e+2 -> 0E+2
-dqqua110 quantize +1 1e0 -> 1
-dqqua111 quantize +1 1e-1 -> 1.0
-dqqua112 quantize +1 1e-2 -> 1.00
-
-dqqua120 quantize 1.04 1e-3 -> 1.040
-dqqua121 quantize 1.04 1e-2 -> 1.04
-dqqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
-dqqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
-dqqua124 quantize 1.05 1e-3 -> 1.050
-dqqua125 quantize 1.05 1e-2 -> 1.05
-dqqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
-dqqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
-dqqua132 quantize 1.06 1e-3 -> 1.060
-dqqua133 quantize 1.06 1e-2 -> 1.06
-dqqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
-dqqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
-
-dqqua140 quantize -10 1e-2 -> -10.00
-dqqua141 quantize +1 1e-2 -> 1.00
-dqqua142 quantize +10 1e-2 -> 10.00
-dqqua143 quantize 1E+37 1e-2 -> NaN Invalid_operation
-dqqua144 quantize 1E-37 1e-2 -> 0.00 Inexact Rounded
-dqqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
-dqqua146 quantize 1E-2 1e-2 -> 0.01
-dqqua147 quantize 1E-1 1e-2 -> 0.10
-dqqua148 quantize 0E-37 1e-2 -> 0.00
-
-dqqua150 quantize 1.0600 1e-5 -> 1.06000
-dqqua151 quantize 1.0600 1e-4 -> 1.0600
-dqqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
-dqqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
-dqqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
-dqqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
-
--- a couple where rounding was different in base tests
-rounding: half_up
-dqqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
-dqqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
-dqqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
-rounding: half_even
-
--- base tests with non-1 coefficients
-dqqua161 quantize 0 -9e0 -> 0
-dqqua162 quantize 1 -7e0 -> 1
-dqqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
-dqqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
-dqqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
-dqqua167 quantize 0.1 3e-1 -> 0.1
-dqqua168 quantize 0.1 44e-2 -> 0.10
-dqqua169 quantize 0.1 555e-3 -> 0.100
-dqqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
-dqqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
-dqqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
-dqqua173 quantize 0.9 -9e-1 -> 0.9
-dqqua174 quantize 0.9 0e-2 -> 0.90
-dqqua175 quantize 0.9 1.1e-3 -> 0.9000
--- negatives
-dqqua181 quantize -0 1.1e0 -> -0.0
-dqqua182 quantize -1 -1e0 -> -1
-dqqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
-dqqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
-dqqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
-dqqua187 quantize -0.1 -91e-1 -> -0.1
-dqqua188 quantize -0.1 -.1e-2 -> -0.100
-dqqua189 quantize -0.1 -1e-3 -> -0.100
-dqqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
-dqqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
-dqqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
-dqqua193 quantize -0.9 100e-1 -> -0.9
-dqqua194 quantize -0.9 999e-2 -> -0.90
-
--- +ve exponents ..
-dqqua201 quantize -1 1e+0 -> -1
-dqqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
-dqqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
-dqqua204 quantize 0 1e+0 -> 0
-dqqua205 quantize 0 1e+1 -> 0E+1
-dqqua206 quantize 0 1e+2 -> 0E+2
-dqqua207 quantize +1 1e+0 -> 1
-dqqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
-dqqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
-
-dqqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
-dqqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
-dqqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
-dqqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
-dqqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
-dqqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
-dqqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
-dqqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
-dqqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
-dqqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
-dqqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
-dqqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
-dqqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
-dqqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
-dqqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
-dqqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
-
-dqqua240 quantize -10 1e+1 -> -1E+1 Rounded
-dqqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
-dqqua242 quantize +10 1e+1 -> 1E+1 Rounded
-dqqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
-dqqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
-dqqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
-dqqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
-dqqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
-dqqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
-dqqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
-dqqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
-dqqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
--- next one tries to add 9 zeros
-dqqua252 quantize 1E+37 1e+1 -> NaN Invalid_operation
-dqqua253 quantize 1E-37 1e+1 -> 0E+1 Inexact Rounded
-dqqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
-dqqua255 quantize 0E-37 1e+1 -> 0E+1
-dqqua256 quantize -0E-37 1e+1 -> -0E+1
-dqqua257 quantize -0E-1 1e+1 -> -0E+1
-dqqua258 quantize -0 1e+1 -> -0E+1
-dqqua259 quantize -0E+1 1e+1 -> -0E+1
-
-dqqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
-dqqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
-dqqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
-dqqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
-dqqua264 quantize 1E+2 1e+2 -> 1E+2
-dqqua265 quantize 1E+3 1e+2 -> 1.0E+3
-dqqua266 quantize 1E+4 1e+2 -> 1.00E+4
-dqqua267 quantize 1E+5 1e+2 -> 1.000E+5
-dqqua268 quantize 1E+6 1e+2 -> 1.0000E+6
-dqqua269 quantize 1E+7 1e+2 -> 1.00000E+7
-dqqua270 quantize 1E+8 1e+2 -> 1.000000E+8
-dqqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
-dqqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
-dqqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
-dqqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
-dqqua275 quantize 0E-10 1e+2 -> 0E+2
-
-dqqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
-dqqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
-dqqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
-dqqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
-dqqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
-dqqua285 quantize 1E+3 1e+3 -> 1E+3
-dqqua286 quantize 1E+4 1e+3 -> 1.0E+4
-dqqua287 quantize 1E+5 1e+3 -> 1.00E+5
-dqqua288 quantize 1E+6 1e+3 -> 1.000E+6
-dqqua289 quantize 1E+7 1e+3 -> 1.0000E+7
-dqqua290 quantize 1E+8 1e+3 -> 1.00000E+8
-dqqua291 quantize 1E+9 1e+3 -> 1.000000E+9
-dqqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
-dqqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
-dqqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
-dqqua295 quantize 0E-10 1e+3 -> 0E+3
-
--- round up from below [sign wrong in JIT compiler once]
-dqqua300 quantize 0.0078 1e-5 -> 0.00780
-dqqua301 quantize 0.0078 1e-4 -> 0.0078
-dqqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
-dqqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
-dqqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
-dqqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
-dqqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
-dqqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
-
-dqqua310 quantize -0.0078 1e-5 -> -0.00780
-dqqua311 quantize -0.0078 1e-4 -> -0.0078
-dqqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
-dqqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
-dqqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
-dqqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
-dqqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
-dqqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
-
-dqqua320 quantize 0.078 1e-5 -> 0.07800
-dqqua321 quantize 0.078 1e-4 -> 0.0780
-dqqua322 quantize 0.078 1e-3 -> 0.078
-dqqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
-dqqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
-dqqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
-dqqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
-dqqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
-
-dqqua330 quantize -0.078 1e-5 -> -0.07800
-dqqua331 quantize -0.078 1e-4 -> -0.0780
-dqqua332 quantize -0.078 1e-3 -> -0.078
-dqqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
-dqqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
-dqqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
-dqqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
-dqqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
-
-dqqua340 quantize 0.78 1e-5 -> 0.78000
-dqqua341 quantize 0.78 1e-4 -> 0.7800
-dqqua342 quantize 0.78 1e-3 -> 0.780
-dqqua343 quantize 0.78 1e-2 -> 0.78
-dqqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
-dqqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
-dqqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
-dqqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
-
-dqqua350 quantize -0.78 1e-5 -> -0.78000
-dqqua351 quantize -0.78 1e-4 -> -0.7800
-dqqua352 quantize -0.78 1e-3 -> -0.780
-dqqua353 quantize -0.78 1e-2 -> -0.78
-dqqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
-dqqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
-dqqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
-dqqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
-
-dqqua360 quantize 7.8 1e-5 -> 7.80000
-dqqua361 quantize 7.8 1e-4 -> 7.8000
-dqqua362 quantize 7.8 1e-3 -> 7.800
-dqqua363 quantize 7.8 1e-2 -> 7.80
-dqqua364 quantize 7.8 1e-1 -> 7.8
-dqqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
-dqqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
-dqqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
-dqqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
-
-dqqua370 quantize -7.8 1e-5 -> -7.80000
-dqqua371 quantize -7.8 1e-4 -> -7.8000
-dqqua372 quantize -7.8 1e-3 -> -7.800
-dqqua373 quantize -7.8 1e-2 -> -7.80
-dqqua374 quantize -7.8 1e-1 -> -7.8
-dqqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
-dqqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
-dqqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
-dqqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
-
--- some individuals
-dqqua380 quantize 1122334455667788991234567352364.506 1e-2 -> 1122334455667788991234567352364.51 Inexact Rounded
-dqqua381 quantize 11223344556677889912345673523645.06 1e-2 -> 11223344556677889912345673523645.06
-dqqua382 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
-dqqua383 quantize 1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
-dqqua384 quantize -1122334455667788991234567352364.506 1e-2 -> -1122334455667788991234567352364.51 Inexact Rounded
-dqqua385 quantize -11223344556677889912345673523645.06 1e-2 -> -11223344556677889912345673523645.06
-dqqua386 quantize -112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
-dqqua387 quantize -1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
-
-rounding: down
-dqqua389 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
-rounding: half_up
-
--- and a few more from e-mail discussions
-dqqua391 quantize 11223344556677889912345678912.34567 1e-3 -> 11223344556677889912345678912.346 Inexact Rounded
-dqqua392 quantize 112233445566778899123456789123.4567 1e-3 -> 112233445566778899123456789123.457 Inexact Rounded
-dqqua393 quantize 1122334455667788991234567891234567. 1e-3 -> NaN Invalid_operation
-
--- some 9999 round-up cases
-dqqua400 quantize 9.999 1e-5 -> 9.99900
-dqqua401 quantize 9.999 1e-4 -> 9.9990
-dqqua402 quantize 9.999 1e-3 -> 9.999
-dqqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
-dqqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
-dqqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
-dqqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
-dqqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
-
-dqqua410 quantize 0.999 1e-5 -> 0.99900
-dqqua411 quantize 0.999 1e-4 -> 0.9990
-dqqua412 quantize 0.999 1e-3 -> 0.999
-dqqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
-dqqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
-dqqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
-dqqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
-
-dqqua420 quantize 0.0999 1e-5 -> 0.09990
-dqqua421 quantize 0.0999 1e-4 -> 0.0999
-dqqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
-dqqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
-dqqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
-dqqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
-dqqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
-
-dqqua430 quantize 0.00999 1e-5 -> 0.00999
-dqqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
-dqqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
-dqqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
-dqqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
-dqqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
-dqqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
-
-dqqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
-dqqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
-dqqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
-dqqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
-dqqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
-dqqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
-dqqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
-
-dqqua1001 quantize 0.000 0.001 -> 0.000
-dqqua1002 quantize 0.001 0.001 -> 0.001
-dqqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
-dqqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
-dqqua1005 quantize 0.501 0.001 -> 0.501
-dqqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
-dqqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
-dqqua1008 quantize 0.999 0.001 -> 0.999
-
-dqqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
-dqqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
-dqqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
-dqqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
-dqqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
-dqqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
--- a potential double-round
-dqqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
-dqqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
-
-dqqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
-dqqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
-dqqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
-dqqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
-dqqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
-dqqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
-dqqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
-dqqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
-
--- Zeros
-dqqua500 quantize 0 1e1 -> 0E+1
-dqqua501 quantize 0 1e0 -> 0
-dqqua502 quantize 0 1e-1 -> 0.0
-dqqua503 quantize 0.0 1e-1 -> 0.0
-dqqua504 quantize 0.0 1e0 -> 0
-dqqua505 quantize 0.0 1e+1 -> 0E+1
-dqqua506 quantize 0E+1 1e-1 -> 0.0
-dqqua507 quantize 0E+1 1e0 -> 0
-dqqua508 quantize 0E+1 1e+1 -> 0E+1
-dqqua509 quantize -0 1e1 -> -0E+1
-dqqua510 quantize -0 1e0 -> -0
-dqqua511 quantize -0 1e-1 -> -0.0
-dqqua512 quantize -0.0 1e-1 -> -0.0
-dqqua513 quantize -0.0 1e0 -> -0
-dqqua514 quantize -0.0 1e+1 -> -0E+1
-dqqua515 quantize -0E+1 1e-1 -> -0.0
-dqqua516 quantize -0E+1 1e0 -> -0
-dqqua517 quantize -0E+1 1e+1 -> -0E+1
--- #519 here once a problem
-dqqua518 quantize 0 0E-3 -> 0.000
-dqqua519 quantize 0 0E-33 -> 0E-33
-dqqua520 quantize 0.00000000000000000000000000000000 0E-33 -> 0E-33
-dqqua521 quantize 0.000000000000000000000000000000000 0E-33 -> 0E-33
-
--- Some non-zeros with lots of padding on the right
-dqqua523 quantize 1 0E-33 -> 1.000000000000000000000000000000000
-dqqua524 quantize 12 0E-32 -> 12.00000000000000000000000000000000
-dqqua525 quantize 123 0E-31 -> 123.0000000000000000000000000000000
-dqqua526 quantize 123 0E-32 -> NaN Invalid_operation
-dqqua527 quantize 123.4 0E-31 -> 123.4000000000000000000000000000000
-dqqua528 quantize 123.4 0E-32 -> NaN Invalid_operation
-
--- Suspicious RHS values
-dqqua530 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
-dqqua531 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
-dqqua532 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
-dqqua533 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
--- next four are "won't fit" overflows
-dqqua536 quantize 1.234 1e-299 -> NaN Invalid_operation
-dqqua537 quantize 123.456 1e-299 -> NaN Invalid_operation
-dqqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
-dqqua539 quantize 123.456 1e-299 -> NaN Invalid_operation
-
-dqqua542 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
-dqqua543 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
-dqqua544 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
-dqqua547 quantize 0 1e-299 -> 0E-299
--- next two are "won't fit" overflows
-dqqua548 quantize 1.234 1e-299 -> NaN Invalid_operation
-dqqua549 quantize 1.234 1e-300 -> NaN Invalid_operation
--- [more below]
-
--- Specials
-dqqua580 quantize Inf -Inf -> Infinity
-dqqua581 quantize Inf 1e-299 -> NaN Invalid_operation
-dqqua582 quantize Inf 1e-1 -> NaN Invalid_operation
-dqqua583 quantize Inf 1e0 -> NaN Invalid_operation
-dqqua584 quantize Inf 1e1 -> NaN Invalid_operation
-dqqua585 quantize Inf 1e299 -> NaN Invalid_operation
-dqqua586 quantize Inf Inf -> Infinity
-dqqua587 quantize -1000 Inf -> NaN Invalid_operation
-dqqua588 quantize -Inf Inf -> -Infinity
-dqqua589 quantize -1 Inf -> NaN Invalid_operation
-dqqua590 quantize 0 Inf -> NaN Invalid_operation
-dqqua591 quantize 1 Inf -> NaN Invalid_operation
-dqqua592 quantize 1000 Inf -> NaN Invalid_operation
-dqqua593 quantize Inf Inf -> Infinity
-dqqua594 quantize Inf 1e-0 -> NaN Invalid_operation
-dqqua595 quantize -0 Inf -> NaN Invalid_operation
-
-dqqua600 quantize -Inf -Inf -> -Infinity
-dqqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
-dqqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
-dqqua603 quantize -Inf 1e0 -> NaN Invalid_operation
-dqqua604 quantize -Inf 1e1 -> NaN Invalid_operation
-dqqua605 quantize -Inf 1e299 -> NaN Invalid_operation
-dqqua606 quantize -Inf Inf -> -Infinity
-dqqua607 quantize -1000 Inf -> NaN Invalid_operation
-dqqua608 quantize -Inf -Inf -> -Infinity
-dqqua609 quantize -1 -Inf -> NaN Invalid_operation
-dqqua610 quantize 0 -Inf -> NaN Invalid_operation
-dqqua611 quantize 1 -Inf -> NaN Invalid_operation
-dqqua612 quantize 1000 -Inf -> NaN Invalid_operation
-dqqua613 quantize Inf -Inf -> Infinity
-dqqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
-dqqua615 quantize -0 -Inf -> NaN Invalid_operation
-
-dqqua621 quantize NaN -Inf -> NaN
-dqqua622 quantize NaN 1e-299 -> NaN
-dqqua623 quantize NaN 1e-1 -> NaN
-dqqua624 quantize NaN 1e0 -> NaN
-dqqua625 quantize NaN 1e1 -> NaN
-dqqua626 quantize NaN 1e299 -> NaN
-dqqua627 quantize NaN Inf -> NaN
-dqqua628 quantize NaN NaN -> NaN
-dqqua629 quantize -Inf NaN -> NaN
-dqqua630 quantize -1000 NaN -> NaN
-dqqua631 quantize -1 NaN -> NaN
-dqqua632 quantize 0 NaN -> NaN
-dqqua633 quantize 1 NaN -> NaN
-dqqua634 quantize 1000 NaN -> NaN
-dqqua635 quantize Inf NaN -> NaN
-dqqua636 quantize NaN 1e-0 -> NaN
-dqqua637 quantize -0 NaN -> NaN
-
-dqqua641 quantize sNaN -Inf -> NaN Invalid_operation
-dqqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
-dqqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
-dqqua644 quantize sNaN 1e0 -> NaN Invalid_operation
-dqqua645 quantize sNaN 1e1 -> NaN Invalid_operation
-dqqua646 quantize sNaN 1e299 -> NaN Invalid_operation
-dqqua647 quantize sNaN NaN -> NaN Invalid_operation
-dqqua648 quantize sNaN sNaN -> NaN Invalid_operation
-dqqua649 quantize NaN sNaN -> NaN Invalid_operation
-dqqua650 quantize -Inf sNaN -> NaN Invalid_operation
-dqqua651 quantize -1000 sNaN -> NaN Invalid_operation
-dqqua652 quantize -1 sNaN -> NaN Invalid_operation
-dqqua653 quantize 0 sNaN -> NaN Invalid_operation
-dqqua654 quantize 1 sNaN -> NaN Invalid_operation
-dqqua655 quantize 1000 sNaN -> NaN Invalid_operation
-dqqua656 quantize Inf sNaN -> NaN Invalid_operation
-dqqua657 quantize NaN sNaN -> NaN Invalid_operation
-dqqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
-dqqua659 quantize -0 sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqqua661 quantize NaN9 -Inf -> NaN9
-dqqua662 quantize NaN8 919 -> NaN8
-dqqua663 quantize NaN71 Inf -> NaN71
-dqqua664 quantize NaN6 NaN5 -> NaN6
-dqqua665 quantize -Inf NaN4 -> NaN4
-dqqua666 quantize -919 NaN31 -> NaN31
-dqqua667 quantize Inf NaN2 -> NaN2
-
-dqqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
-dqqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
-dqqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
-dqqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
-dqqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
-dqqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
-dqqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
-dqqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
-dqqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
-
-dqqua681 quantize -NaN9 -Inf -> -NaN9
-dqqua682 quantize -NaN8 919 -> -NaN8
-dqqua683 quantize -NaN71 Inf -> -NaN71
-dqqua684 quantize -NaN6 -NaN5 -> -NaN6
-dqqua685 quantize -Inf -NaN4 -> -NaN4
-dqqua686 quantize -919 -NaN31 -> -NaN31
-dqqua687 quantize Inf -NaN2 -> -NaN2
-
-dqqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
-dqqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
-dqqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
-dqqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-dqqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
-dqqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
-dqqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
-dqqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
-
--- subnormals and underflow
-dqqua710 quantize 1.00E-6143 1e-6143 -> 1E-6143 Rounded
-dqqua711 quantize 0.1E-6143 2e-6144 -> 1E-6144 Subnormal
-dqqua712 quantize 0.10E-6143 3e-6144 -> 1E-6144 Subnormal Rounded
-dqqua713 quantize 0.100E-6143 4e-6144 -> 1E-6144 Subnormal Rounded
-dqqua714 quantize 0.01E-6143 5e-6145 -> 1E-6145 Subnormal
--- next is rounded to Emin
-dqqua715 quantize 0.999E-6143 1e-6143 -> 1E-6143 Inexact Rounded
-dqqua716 quantize 0.099E-6143 10e-6144 -> 1E-6144 Inexact Rounded Subnormal
-
-dqqua717 quantize 0.009E-6143 1e-6145 -> 1E-6145 Inexact Rounded Subnormal
-dqqua718 quantize 0.001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
-dqqua719 quantize 0.0009E-6143 1e-6145 -> 0E-6145 Inexact Rounded
-dqqua720 quantize 0.0001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
-
-dqqua730 quantize -1.00E-6143 1e-6143 -> -1E-6143 Rounded
-dqqua731 quantize -0.1E-6143 1e-6143 -> -0E-6143 Rounded Inexact
-dqqua732 quantize -0.10E-6143 1e-6143 -> -0E-6143 Rounded Inexact
-dqqua733 quantize -0.100E-6143 1e-6143 -> -0E-6143 Rounded Inexact
-dqqua734 quantize -0.01E-6143 1e-6143 -> -0E-6143 Inexact Rounded
--- next is rounded to Emin
-dqqua735 quantize -0.999E-6143 90e-6143 -> -1E-6143 Inexact Rounded
-dqqua736 quantize -0.099E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
-dqqua737 quantize -0.009E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
-dqqua738 quantize -0.001E-6143 -0e-6143 -> -0E-6143 Inexact Rounded
-dqqua739 quantize -0.0001E-6143 0e-6143 -> -0E-6143 Inexact Rounded
-
-dqqua740 quantize -1.00E-6143 1e-6144 -> -1.0E-6143 Rounded
-dqqua741 quantize -0.1E-6143 1e-6144 -> -1E-6144 Subnormal
-dqqua742 quantize -0.10E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
-dqqua743 quantize -0.100E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
-dqqua744 quantize -0.01E-6143 1e-6144 -> -0E-6144 Inexact Rounded
--- next is rounded to Emin
-dqqua745 quantize -0.999E-6143 1e-6144 -> -1.0E-6143 Inexact Rounded
-dqqua746 quantize -0.099E-6143 1e-6144 -> -1E-6144 Inexact Rounded Subnormal
-dqqua747 quantize -0.009E-6143 1e-6144 -> -0E-6144 Inexact Rounded
-dqqua748 quantize -0.001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
-dqqua749 quantize -0.0001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
-
-dqqua750 quantize -1.00E-6143 1e-6145 -> -1.00E-6143
-dqqua751 quantize -0.1E-6143 1e-6145 -> -1.0E-6144 Subnormal
-dqqua752 quantize -0.10E-6143 1e-6145 -> -1.0E-6144 Subnormal
-dqqua753 quantize -0.100E-6143 1e-6145 -> -1.0E-6144 Subnormal Rounded
-dqqua754 quantize -0.01E-6143 1e-6145 -> -1E-6145 Subnormal
--- next is rounded to Emin
-dqqua755 quantize -0.999E-6143 1e-6145 -> -1.00E-6143 Inexact Rounded
-dqqua756 quantize -0.099E-6143 1e-6145 -> -1.0E-6144 Inexact Rounded Subnormal
-dqqua757 quantize -0.009E-6143 1e-6145 -> -1E-6145 Inexact Rounded Subnormal
-dqqua758 quantize -0.001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
-dqqua759 quantize -0.0001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
-
-dqqua760 quantize -1.00E-6143 1e-6146 -> -1.000E-6143
-dqqua761 quantize -0.1E-6143 1e-6146 -> -1.00E-6144 Subnormal
-dqqua762 quantize -0.10E-6143 1e-6146 -> -1.00E-6144 Subnormal
-dqqua763 quantize -0.100E-6143 1e-6146 -> -1.00E-6144 Subnormal
-dqqua764 quantize -0.01E-6143 1e-6146 -> -1.0E-6145 Subnormal
-dqqua765 quantize -0.999E-6143 1e-6146 -> -9.99E-6144 Subnormal
-dqqua766 quantize -0.099E-6143 1e-6146 -> -9.9E-6145 Subnormal
-dqqua767 quantize -0.009E-6143 1e-6146 -> -9E-6146 Subnormal
-dqqua768 quantize -0.001E-6143 1e-6146 -> -1E-6146 Subnormal
-dqqua769 quantize -0.0001E-6143 1e-6146 -> -0E-6146 Inexact Rounded
-
--- More from Fung Lee
--- the next four would appear to be in error, but they are misleading (the
--- operands will be clamped to a lower exponent) and so are omitted
--- dqqua1021 quantize 8.666666666666000E+6144 1.000000000000000E+6144 -> 8.666666666666000000000000000000000E+6144 Clamped
--- dqqua1022 quantize -8.666666666666000E+6144 1.000000000000000E+6144 -> -8.666666666666000000000000000000000E+6144 Clamped
--- dqqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
--- dqqua1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
-
--- Int and uInt32 edge values for testing conversions
-dqqua1040 quantize -2147483646 0 -> -2147483646
-dqqua1041 quantize -2147483647 0 -> -2147483647
-dqqua1042 quantize -2147483648 0 -> -2147483648
-dqqua1043 quantize -2147483649 0 -> -2147483649
-dqqua1044 quantize 2147483646 0 -> 2147483646
-dqqua1045 quantize 2147483647 0 -> 2147483647
-dqqua1046 quantize 2147483648 0 -> 2147483648
-dqqua1047 quantize 2147483649 0 -> 2147483649
-dqqua1048 quantize 4294967294 0 -> 4294967294
-dqqua1049 quantize 4294967295 0 -> 4294967295
-dqqua1050 quantize 4294967296 0 -> 4294967296
-dqqua1051 quantize 4294967297 0 -> 4294967297
-
--- Rounding swathe
-rounding: half_even
-dqqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-dqqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: half_up
-dqqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-dqqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-dqqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: half_down
-dqqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-dqqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: up
-dqqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
-dqqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
-dqqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-dqqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-dqqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-dqqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
-
-rounding: down
-dqqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-dqqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
-dqqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-dqqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
-dqqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
-dqqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
-dqqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
-
-rounding: ceiling
-dqqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
-dqqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
-dqqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-dqqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-dqqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-dqqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
-
-rounding: floor
-dqqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-dqqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
-dqqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-dqqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
-dqqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
-dqqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
-dqqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
-
-rounding: 05up
-dqqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
-dqqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
-dqqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
-dqqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
-dqqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
-dqqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
-dqqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
-dqqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
-dqqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
-
-dqqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
-dqqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
-dqqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
-dqqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
-dqqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
-dqqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
-dqqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
-dqqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
-dqqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
-
-dqqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
-dqqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
-dqqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
-dqqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-dqqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
-dqqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
-dqqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
-dqqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
-
-dqqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
-dqqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
-dqqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
-dqqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
-dqqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
-dqqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
-dqqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
-dqqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
-dqqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
-
-dqqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
-dqqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
-dqqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
-dqqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
-dqqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
-dqqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
-dqqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
-dqqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
-dqqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
-
-dqqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
-dqqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
-dqqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
-dqqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
-dqqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
-dqqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
-dqqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
-dqqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
-dqqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
-
--- Null tests
-dqqua998 quantize 10 # -> NaN Invalid_operation
-dqqua999 quantize # 1e10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqQuantize.decTest -- decQuad quantize operation --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Most of the tests here assume a "regular pattern", where the
+-- sign and coefficient are +1.
+-- 2004.03.15 Underflow for quantize is suppressed
+-- 2005.06.08 More extensive tests for 'does not fit'
+-- [Forked from quantize.decTest 2006.11.25]
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqqua001 quantize 0 1e0 -> 0
+dqqua002 quantize 1 1e0 -> 1
+dqqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
+dqqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
+dqqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
+dqqua007 quantize 0.1 1e-1 -> 0.1
+dqqua008 quantize 0.1 1e-2 -> 0.10
+dqqua009 quantize 0.1 1e-3 -> 0.100
+dqqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
+dqqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
+dqqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
+dqqua013 quantize 0.9 1e-1 -> 0.9
+dqqua014 quantize 0.9 1e-2 -> 0.90
+dqqua015 quantize 0.9 1e-3 -> 0.900
+-- negatives
+dqqua021 quantize -0 1e0 -> -0
+dqqua022 quantize -1 1e0 -> -1
+dqqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
+dqqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
+dqqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
+dqqua027 quantize -0.1 1e-1 -> -0.1
+dqqua028 quantize -0.1 1e-2 -> -0.10
+dqqua029 quantize -0.1 1e-3 -> -0.100
+dqqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
+dqqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
+dqqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
+dqqua033 quantize -0.9 1e-1 -> -0.9
+dqqua034 quantize -0.9 1e-2 -> -0.90
+dqqua035 quantize -0.9 1e-3 -> -0.900
+dqqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
+dqqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
+dqqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
+dqqua039 quantize -0.5 1e-1 -> -0.5
+dqqua040 quantize -0.5 1e-2 -> -0.50
+dqqua041 quantize -0.5 1e-3 -> -0.500
+dqqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
+dqqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
+dqqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
+dqqua045 quantize -0.9 1e-1 -> -0.9
+dqqua046 quantize -0.9 1e-2 -> -0.90
+dqqua047 quantize -0.9 1e-3 -> -0.900
+
+-- examples from Specification
+dqqua060 quantize 2.17 0.001 -> 2.170
+dqqua061 quantize 2.17 0.01 -> 2.17
+dqqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
+dqqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
+dqqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
+dqqua065 quantize -Inf Inf -> -Infinity
+dqqua066 quantize 2 Inf -> NaN Invalid_operation
+dqqua067 quantize -0.1 1 -> -0 Inexact Rounded
+dqqua068 quantize -0 1e+5 -> -0E+5
+dqqua069 quantize +123451234567899876543216789012345.6 1e-2 -> NaN Invalid_operation
+dqqua070 quantize -987651234567899876543214335236450.6 1e-2 -> NaN Invalid_operation
+dqqua071 quantize 217 1e-1 -> 217.0
+dqqua072 quantize 217 1e+0 -> 217
+dqqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
+dqqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
+
+-- general tests ..
+dqqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
+dqqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
+dqqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
+dqqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
+dqqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
+dqqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
+dqqua095 quantize 1.2345 1e-6 -> 1.234500
+dqqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
+dqqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
+dqqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
+dqqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
+dqqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
+
+dqqua101 quantize -1 1e0 -> -1
+dqqua102 quantize -1 1e-1 -> -1.0
+dqqua103 quantize -1 1e-2 -> -1.00
+dqqua104 quantize 0 1e0 -> 0
+dqqua105 quantize 0 1e-1 -> 0.0
+dqqua106 quantize 0 1e-2 -> 0.00
+dqqua107 quantize 0.00 1e0 -> 0
+dqqua108 quantize 0 1e+1 -> 0E+1
+dqqua109 quantize 0 1e+2 -> 0E+2
+dqqua110 quantize +1 1e0 -> 1
+dqqua111 quantize +1 1e-1 -> 1.0
+dqqua112 quantize +1 1e-2 -> 1.00
+
+dqqua120 quantize 1.04 1e-3 -> 1.040
+dqqua121 quantize 1.04 1e-2 -> 1.04
+dqqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
+dqqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
+dqqua124 quantize 1.05 1e-3 -> 1.050
+dqqua125 quantize 1.05 1e-2 -> 1.05
+dqqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
+dqqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
+dqqua132 quantize 1.06 1e-3 -> 1.060
+dqqua133 quantize 1.06 1e-2 -> 1.06
+dqqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
+dqqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
+
+dqqua140 quantize -10 1e-2 -> -10.00
+dqqua141 quantize +1 1e-2 -> 1.00
+dqqua142 quantize +10 1e-2 -> 10.00
+dqqua143 quantize 1E+37 1e-2 -> NaN Invalid_operation
+dqqua144 quantize 1E-37 1e-2 -> 0.00 Inexact Rounded
+dqqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
+dqqua146 quantize 1E-2 1e-2 -> 0.01
+dqqua147 quantize 1E-1 1e-2 -> 0.10
+dqqua148 quantize 0E-37 1e-2 -> 0.00
+
+dqqua150 quantize 1.0600 1e-5 -> 1.06000
+dqqua151 quantize 1.0600 1e-4 -> 1.0600
+dqqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
+dqqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
+dqqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
+dqqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
+
+-- a couple where rounding was different in base tests
+rounding: half_up
+dqqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
+dqqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
+dqqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
+rounding: half_even
+
+-- base tests with non-1 coefficients
+dqqua161 quantize 0 -9e0 -> 0
+dqqua162 quantize 1 -7e0 -> 1
+dqqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
+dqqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
+dqqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
+dqqua167 quantize 0.1 3e-1 -> 0.1
+dqqua168 quantize 0.1 44e-2 -> 0.10
+dqqua169 quantize 0.1 555e-3 -> 0.100
+dqqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
+dqqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
+dqqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
+dqqua173 quantize 0.9 -9e-1 -> 0.9
+dqqua174 quantize 0.9 0e-2 -> 0.90
+dqqua175 quantize 0.9 1.1e-3 -> 0.9000
+-- negatives
+dqqua181 quantize -0 1.1e0 -> -0.0
+dqqua182 quantize -1 -1e0 -> -1
+dqqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
+dqqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
+dqqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
+dqqua187 quantize -0.1 -91e-1 -> -0.1
+dqqua188 quantize -0.1 -.1e-2 -> -0.100
+dqqua189 quantize -0.1 -1e-3 -> -0.100
+dqqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
+dqqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
+dqqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
+dqqua193 quantize -0.9 100e-1 -> -0.9
+dqqua194 quantize -0.9 999e-2 -> -0.90
+
+-- +ve exponents ..
+dqqua201 quantize -1 1e+0 -> -1
+dqqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
+dqqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
+dqqua204 quantize 0 1e+0 -> 0
+dqqua205 quantize 0 1e+1 -> 0E+1
+dqqua206 quantize 0 1e+2 -> 0E+2
+dqqua207 quantize +1 1e+0 -> 1
+dqqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
+dqqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
+
+dqqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
+dqqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
+dqqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
+dqqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
+dqqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
+dqqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
+dqqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
+dqqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
+dqqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
+dqqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
+dqqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
+dqqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
+dqqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
+dqqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
+dqqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
+dqqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
+
+dqqua240 quantize -10 1e+1 -> -1E+1 Rounded
+dqqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
+dqqua242 quantize +10 1e+1 -> 1E+1 Rounded
+dqqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
+dqqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
+dqqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
+dqqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
+dqqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
+dqqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
+dqqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
+dqqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
+dqqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
+-- next one tries to add 9 zeros
+dqqua252 quantize 1E+37 1e+1 -> NaN Invalid_operation
+dqqua253 quantize 1E-37 1e+1 -> 0E+1 Inexact Rounded
+dqqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
+dqqua255 quantize 0E-37 1e+1 -> 0E+1
+dqqua256 quantize -0E-37 1e+1 -> -0E+1
+dqqua257 quantize -0E-1 1e+1 -> -0E+1
+dqqua258 quantize -0 1e+1 -> -0E+1
+dqqua259 quantize -0E+1 1e+1 -> -0E+1
+
+dqqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
+dqqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
+dqqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
+dqqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
+dqqua264 quantize 1E+2 1e+2 -> 1E+2
+dqqua265 quantize 1E+3 1e+2 -> 1.0E+3
+dqqua266 quantize 1E+4 1e+2 -> 1.00E+4
+dqqua267 quantize 1E+5 1e+2 -> 1.000E+5
+dqqua268 quantize 1E+6 1e+2 -> 1.0000E+6
+dqqua269 quantize 1E+7 1e+2 -> 1.00000E+7
+dqqua270 quantize 1E+8 1e+2 -> 1.000000E+8
+dqqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
+dqqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
+dqqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
+dqqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
+dqqua275 quantize 0E-10 1e+2 -> 0E+2
+
+dqqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
+dqqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
+dqqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
+dqqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
+dqqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
+dqqua285 quantize 1E+3 1e+3 -> 1E+3
+dqqua286 quantize 1E+4 1e+3 -> 1.0E+4
+dqqua287 quantize 1E+5 1e+3 -> 1.00E+5
+dqqua288 quantize 1E+6 1e+3 -> 1.000E+6
+dqqua289 quantize 1E+7 1e+3 -> 1.0000E+7
+dqqua290 quantize 1E+8 1e+3 -> 1.00000E+8
+dqqua291 quantize 1E+9 1e+3 -> 1.000000E+9
+dqqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
+dqqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
+dqqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
+dqqua295 quantize 0E-10 1e+3 -> 0E+3
+
+-- round up from below [sign wrong in JIT compiler once]
+dqqua300 quantize 0.0078 1e-5 -> 0.00780
+dqqua301 quantize 0.0078 1e-4 -> 0.0078
+dqqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
+dqqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
+dqqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
+dqqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
+dqqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
+dqqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
+
+dqqua310 quantize -0.0078 1e-5 -> -0.00780
+dqqua311 quantize -0.0078 1e-4 -> -0.0078
+dqqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
+dqqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
+dqqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
+dqqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
+dqqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
+dqqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
+
+dqqua320 quantize 0.078 1e-5 -> 0.07800
+dqqua321 quantize 0.078 1e-4 -> 0.0780
+dqqua322 quantize 0.078 1e-3 -> 0.078
+dqqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
+dqqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
+dqqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
+dqqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
+dqqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
+
+dqqua330 quantize -0.078 1e-5 -> -0.07800
+dqqua331 quantize -0.078 1e-4 -> -0.0780
+dqqua332 quantize -0.078 1e-3 -> -0.078
+dqqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
+dqqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
+dqqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
+dqqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
+dqqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
+
+dqqua340 quantize 0.78 1e-5 -> 0.78000
+dqqua341 quantize 0.78 1e-4 -> 0.7800
+dqqua342 quantize 0.78 1e-3 -> 0.780
+dqqua343 quantize 0.78 1e-2 -> 0.78
+dqqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
+dqqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
+dqqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
+dqqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
+
+dqqua350 quantize -0.78 1e-5 -> -0.78000
+dqqua351 quantize -0.78 1e-4 -> -0.7800
+dqqua352 quantize -0.78 1e-3 -> -0.780
+dqqua353 quantize -0.78 1e-2 -> -0.78
+dqqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
+dqqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
+dqqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
+dqqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
+
+dqqua360 quantize 7.8 1e-5 -> 7.80000
+dqqua361 quantize 7.8 1e-4 -> 7.8000
+dqqua362 quantize 7.8 1e-3 -> 7.800
+dqqua363 quantize 7.8 1e-2 -> 7.80
+dqqua364 quantize 7.8 1e-1 -> 7.8
+dqqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
+dqqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
+dqqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
+dqqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
+
+dqqua370 quantize -7.8 1e-5 -> -7.80000
+dqqua371 quantize -7.8 1e-4 -> -7.8000
+dqqua372 quantize -7.8 1e-3 -> -7.800
+dqqua373 quantize -7.8 1e-2 -> -7.80
+dqqua374 quantize -7.8 1e-1 -> -7.8
+dqqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
+dqqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
+dqqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
+dqqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
+
+-- some individuals
+dqqua380 quantize 1122334455667788991234567352364.506 1e-2 -> 1122334455667788991234567352364.51 Inexact Rounded
+dqqua381 quantize 11223344556677889912345673523645.06 1e-2 -> 11223344556677889912345673523645.06
+dqqua382 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
+dqqua383 quantize 1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
+dqqua384 quantize -1122334455667788991234567352364.506 1e-2 -> -1122334455667788991234567352364.51 Inexact Rounded
+dqqua385 quantize -11223344556677889912345673523645.06 1e-2 -> -11223344556677889912345673523645.06
+dqqua386 quantize -112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
+dqqua387 quantize -1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
+
+rounding: down
+dqqua389 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
+rounding: half_up
+
+-- and a few more from e-mail discussions
+dqqua391 quantize 11223344556677889912345678912.34567 1e-3 -> 11223344556677889912345678912.346 Inexact Rounded
+dqqua392 quantize 112233445566778899123456789123.4567 1e-3 -> 112233445566778899123456789123.457 Inexact Rounded
+dqqua393 quantize 1122334455667788991234567891234567. 1e-3 -> NaN Invalid_operation
+
+-- some 9999 round-up cases
+dqqua400 quantize 9.999 1e-5 -> 9.99900
+dqqua401 quantize 9.999 1e-4 -> 9.9990
+dqqua402 quantize 9.999 1e-3 -> 9.999
+dqqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
+dqqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
+dqqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
+dqqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
+dqqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
+
+dqqua410 quantize 0.999 1e-5 -> 0.99900
+dqqua411 quantize 0.999 1e-4 -> 0.9990
+dqqua412 quantize 0.999 1e-3 -> 0.999
+dqqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
+dqqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
+dqqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
+dqqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
+
+dqqua420 quantize 0.0999 1e-5 -> 0.09990
+dqqua421 quantize 0.0999 1e-4 -> 0.0999
+dqqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
+dqqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
+dqqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
+dqqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
+dqqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
+
+dqqua430 quantize 0.00999 1e-5 -> 0.00999
+dqqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
+dqqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
+dqqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
+dqqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
+dqqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
+dqqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
+
+dqqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
+dqqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
+dqqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
+dqqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
+dqqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
+dqqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
+dqqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
+
+dqqua1001 quantize 0.000 0.001 -> 0.000
+dqqua1002 quantize 0.001 0.001 -> 0.001
+dqqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
+dqqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
+dqqua1005 quantize 0.501 0.001 -> 0.501
+dqqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
+dqqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
+dqqua1008 quantize 0.999 0.001 -> 0.999
+
+dqqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
+dqqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
+dqqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
+dqqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
+dqqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
+dqqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
+-- a potential double-round
+dqqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
+dqqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
+
+dqqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
+dqqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
+dqqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
+dqqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
+dqqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
+dqqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
+dqqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
+dqqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
+
+-- Zeros
+dqqua500 quantize 0 1e1 -> 0E+1
+dqqua501 quantize 0 1e0 -> 0
+dqqua502 quantize 0 1e-1 -> 0.0
+dqqua503 quantize 0.0 1e-1 -> 0.0
+dqqua504 quantize 0.0 1e0 -> 0
+dqqua505 quantize 0.0 1e+1 -> 0E+1
+dqqua506 quantize 0E+1 1e-1 -> 0.0
+dqqua507 quantize 0E+1 1e0 -> 0
+dqqua508 quantize 0E+1 1e+1 -> 0E+1
+dqqua509 quantize -0 1e1 -> -0E+1
+dqqua510 quantize -0 1e0 -> -0
+dqqua511 quantize -0 1e-1 -> -0.0
+dqqua512 quantize -0.0 1e-1 -> -0.0
+dqqua513 quantize -0.0 1e0 -> -0
+dqqua514 quantize -0.0 1e+1 -> -0E+1
+dqqua515 quantize -0E+1 1e-1 -> -0.0
+dqqua516 quantize -0E+1 1e0 -> -0
+dqqua517 quantize -0E+1 1e+1 -> -0E+1
+-- #519 here once a problem
+dqqua518 quantize 0 0E-3 -> 0.000
+dqqua519 quantize 0 0E-33 -> 0E-33
+dqqua520 quantize 0.00000000000000000000000000000000 0E-33 -> 0E-33
+dqqua521 quantize 0.000000000000000000000000000000000 0E-33 -> 0E-33
+
+-- Some non-zeros with lots of padding on the right
+dqqua523 quantize 1 0E-33 -> 1.000000000000000000000000000000000
+dqqua524 quantize 12 0E-32 -> 12.00000000000000000000000000000000
+dqqua525 quantize 123 0E-31 -> 123.0000000000000000000000000000000
+dqqua526 quantize 123 0E-32 -> NaN Invalid_operation
+dqqua527 quantize 123.4 0E-31 -> 123.4000000000000000000000000000000
+dqqua528 quantize 123.4 0E-32 -> NaN Invalid_operation
+
+-- Suspicious RHS values
+dqqua530 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
+dqqua531 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
+dqqua532 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
+dqqua533 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
+-- next four are "won't fit" overflows
+dqqua536 quantize 1.234 1e-299 -> NaN Invalid_operation
+dqqua537 quantize 123.456 1e-299 -> NaN Invalid_operation
+dqqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
+dqqua539 quantize 123.456 1e-299 -> NaN Invalid_operation
+
+dqqua542 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
+dqqua543 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
+dqqua544 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
+dqqua547 quantize 0 1e-299 -> 0E-299
+-- next two are "won't fit" overflows
+dqqua548 quantize 1.234 1e-299 -> NaN Invalid_operation
+dqqua549 quantize 1.234 1e-300 -> NaN Invalid_operation
+-- [more below]
+
+-- Specials
+dqqua580 quantize Inf -Inf -> Infinity
+dqqua581 quantize Inf 1e-299 -> NaN Invalid_operation
+dqqua582 quantize Inf 1e-1 -> NaN Invalid_operation
+dqqua583 quantize Inf 1e0 -> NaN Invalid_operation
+dqqua584 quantize Inf 1e1 -> NaN Invalid_operation
+dqqua585 quantize Inf 1e299 -> NaN Invalid_operation
+dqqua586 quantize Inf Inf -> Infinity
+dqqua587 quantize -1000 Inf -> NaN Invalid_operation
+dqqua588 quantize -Inf Inf -> -Infinity
+dqqua589 quantize -1 Inf -> NaN Invalid_operation
+dqqua590 quantize 0 Inf -> NaN Invalid_operation
+dqqua591 quantize 1 Inf -> NaN Invalid_operation
+dqqua592 quantize 1000 Inf -> NaN Invalid_operation
+dqqua593 quantize Inf Inf -> Infinity
+dqqua594 quantize Inf 1e-0 -> NaN Invalid_operation
+dqqua595 quantize -0 Inf -> NaN Invalid_operation
+
+dqqua600 quantize -Inf -Inf -> -Infinity
+dqqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
+dqqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
+dqqua603 quantize -Inf 1e0 -> NaN Invalid_operation
+dqqua604 quantize -Inf 1e1 -> NaN Invalid_operation
+dqqua605 quantize -Inf 1e299 -> NaN Invalid_operation
+dqqua606 quantize -Inf Inf -> -Infinity
+dqqua607 quantize -1000 Inf -> NaN Invalid_operation
+dqqua608 quantize -Inf -Inf -> -Infinity
+dqqua609 quantize -1 -Inf -> NaN Invalid_operation
+dqqua610 quantize 0 -Inf -> NaN Invalid_operation
+dqqua611 quantize 1 -Inf -> NaN Invalid_operation
+dqqua612 quantize 1000 -Inf -> NaN Invalid_operation
+dqqua613 quantize Inf -Inf -> Infinity
+dqqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
+dqqua615 quantize -0 -Inf -> NaN Invalid_operation
+
+dqqua621 quantize NaN -Inf -> NaN
+dqqua622 quantize NaN 1e-299 -> NaN
+dqqua623 quantize NaN 1e-1 -> NaN
+dqqua624 quantize NaN 1e0 -> NaN
+dqqua625 quantize NaN 1e1 -> NaN
+dqqua626 quantize NaN 1e299 -> NaN
+dqqua627 quantize NaN Inf -> NaN
+dqqua628 quantize NaN NaN -> NaN
+dqqua629 quantize -Inf NaN -> NaN
+dqqua630 quantize -1000 NaN -> NaN
+dqqua631 quantize -1 NaN -> NaN
+dqqua632 quantize 0 NaN -> NaN
+dqqua633 quantize 1 NaN -> NaN
+dqqua634 quantize 1000 NaN -> NaN
+dqqua635 quantize Inf NaN -> NaN
+dqqua636 quantize NaN 1e-0 -> NaN
+dqqua637 quantize -0 NaN -> NaN
+
+dqqua641 quantize sNaN -Inf -> NaN Invalid_operation
+dqqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
+dqqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
+dqqua644 quantize sNaN 1e0 -> NaN Invalid_operation
+dqqua645 quantize sNaN 1e1 -> NaN Invalid_operation
+dqqua646 quantize sNaN 1e299 -> NaN Invalid_operation
+dqqua647 quantize sNaN NaN -> NaN Invalid_operation
+dqqua648 quantize sNaN sNaN -> NaN Invalid_operation
+dqqua649 quantize NaN sNaN -> NaN Invalid_operation
+dqqua650 quantize -Inf sNaN -> NaN Invalid_operation
+dqqua651 quantize -1000 sNaN -> NaN Invalid_operation
+dqqua652 quantize -1 sNaN -> NaN Invalid_operation
+dqqua653 quantize 0 sNaN -> NaN Invalid_operation
+dqqua654 quantize 1 sNaN -> NaN Invalid_operation
+dqqua655 quantize 1000 sNaN -> NaN Invalid_operation
+dqqua656 quantize Inf sNaN -> NaN Invalid_operation
+dqqua657 quantize NaN sNaN -> NaN Invalid_operation
+dqqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
+dqqua659 quantize -0 sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqqua661 quantize NaN9 -Inf -> NaN9
+dqqua662 quantize NaN8 919 -> NaN8
+dqqua663 quantize NaN71 Inf -> NaN71
+dqqua664 quantize NaN6 NaN5 -> NaN6
+dqqua665 quantize -Inf NaN4 -> NaN4
+dqqua666 quantize -919 NaN31 -> NaN31
+dqqua667 quantize Inf NaN2 -> NaN2
+
+dqqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
+dqqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
+dqqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
+dqqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
+dqqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
+dqqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
+dqqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
+dqqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
+dqqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
+
+dqqua681 quantize -NaN9 -Inf -> -NaN9
+dqqua682 quantize -NaN8 919 -> -NaN8
+dqqua683 quantize -NaN71 Inf -> -NaN71
+dqqua684 quantize -NaN6 -NaN5 -> -NaN6
+dqqua685 quantize -Inf -NaN4 -> -NaN4
+dqqua686 quantize -919 -NaN31 -> -NaN31
+dqqua687 quantize Inf -NaN2 -> -NaN2
+
+dqqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
+dqqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
+dqqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
+dqqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+dqqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
+dqqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
+dqqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
+dqqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
+
+-- subnormals and underflow
+dqqua710 quantize 1.00E-6143 1e-6143 -> 1E-6143 Rounded
+dqqua711 quantize 0.1E-6143 2e-6144 -> 1E-6144 Subnormal
+dqqua712 quantize 0.10E-6143 3e-6144 -> 1E-6144 Subnormal Rounded
+dqqua713 quantize 0.100E-6143 4e-6144 -> 1E-6144 Subnormal Rounded
+dqqua714 quantize 0.01E-6143 5e-6145 -> 1E-6145 Subnormal
+-- next is rounded to Emin
+dqqua715 quantize 0.999E-6143 1e-6143 -> 1E-6143 Inexact Rounded
+dqqua716 quantize 0.099E-6143 10e-6144 -> 1E-6144 Inexact Rounded Subnormal
+
+dqqua717 quantize 0.009E-6143 1e-6145 -> 1E-6145 Inexact Rounded Subnormal
+dqqua718 quantize 0.001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
+dqqua719 quantize 0.0009E-6143 1e-6145 -> 0E-6145 Inexact Rounded
+dqqua720 quantize 0.0001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
+
+dqqua730 quantize -1.00E-6143 1e-6143 -> -1E-6143 Rounded
+dqqua731 quantize -0.1E-6143 1e-6143 -> -0E-6143 Rounded Inexact
+dqqua732 quantize -0.10E-6143 1e-6143 -> -0E-6143 Rounded Inexact
+dqqua733 quantize -0.100E-6143 1e-6143 -> -0E-6143 Rounded Inexact
+dqqua734 quantize -0.01E-6143 1e-6143 -> -0E-6143 Inexact Rounded
+-- next is rounded to Emin
+dqqua735 quantize -0.999E-6143 90e-6143 -> -1E-6143 Inexact Rounded
+dqqua736 quantize -0.099E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
+dqqua737 quantize -0.009E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
+dqqua738 quantize -0.001E-6143 -0e-6143 -> -0E-6143 Inexact Rounded
+dqqua739 quantize -0.0001E-6143 0e-6143 -> -0E-6143 Inexact Rounded
+
+dqqua740 quantize -1.00E-6143 1e-6144 -> -1.0E-6143 Rounded
+dqqua741 quantize -0.1E-6143 1e-6144 -> -1E-6144 Subnormal
+dqqua742 quantize -0.10E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
+dqqua743 quantize -0.100E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
+dqqua744 quantize -0.01E-6143 1e-6144 -> -0E-6144 Inexact Rounded
+-- next is rounded to Emin
+dqqua745 quantize -0.999E-6143 1e-6144 -> -1.0E-6143 Inexact Rounded
+dqqua746 quantize -0.099E-6143 1e-6144 -> -1E-6144 Inexact Rounded Subnormal
+dqqua747 quantize -0.009E-6143 1e-6144 -> -0E-6144 Inexact Rounded
+dqqua748 quantize -0.001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
+dqqua749 quantize -0.0001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
+
+dqqua750 quantize -1.00E-6143 1e-6145 -> -1.00E-6143
+dqqua751 quantize -0.1E-6143 1e-6145 -> -1.0E-6144 Subnormal
+dqqua752 quantize -0.10E-6143 1e-6145 -> -1.0E-6144 Subnormal
+dqqua753 quantize -0.100E-6143 1e-6145 -> -1.0E-6144 Subnormal Rounded
+dqqua754 quantize -0.01E-6143 1e-6145 -> -1E-6145 Subnormal
+-- next is rounded to Emin
+dqqua755 quantize -0.999E-6143 1e-6145 -> -1.00E-6143 Inexact Rounded
+dqqua756 quantize -0.099E-6143 1e-6145 -> -1.0E-6144 Inexact Rounded Subnormal
+dqqua757 quantize -0.009E-6143 1e-6145 -> -1E-6145 Inexact Rounded Subnormal
+dqqua758 quantize -0.001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
+dqqua759 quantize -0.0001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
+
+dqqua760 quantize -1.00E-6143 1e-6146 -> -1.000E-6143
+dqqua761 quantize -0.1E-6143 1e-6146 -> -1.00E-6144 Subnormal
+dqqua762 quantize -0.10E-6143 1e-6146 -> -1.00E-6144 Subnormal
+dqqua763 quantize -0.100E-6143 1e-6146 -> -1.00E-6144 Subnormal
+dqqua764 quantize -0.01E-6143 1e-6146 -> -1.0E-6145 Subnormal
+dqqua765 quantize -0.999E-6143 1e-6146 -> -9.99E-6144 Subnormal
+dqqua766 quantize -0.099E-6143 1e-6146 -> -9.9E-6145 Subnormal
+dqqua767 quantize -0.009E-6143 1e-6146 -> -9E-6146 Subnormal
+dqqua768 quantize -0.001E-6143 1e-6146 -> -1E-6146 Subnormal
+dqqua769 quantize -0.0001E-6143 1e-6146 -> -0E-6146 Inexact Rounded
+
+-- More from Fung Lee
+-- the next four would appear to be in error, but they are misleading (the
+-- operands will be clamped to a lower exponent) and so are omitted
+-- dqqua1021 quantize 8.666666666666000E+6144 1.000000000000000E+6144 -> 8.666666666666000000000000000000000E+6144 Clamped
+-- dqqua1022 quantize -8.666666666666000E+6144 1.000000000000000E+6144 -> -8.666666666666000000000000000000000E+6144 Clamped
+-- dqqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
+-- dqqua1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
+
+-- Int and uInt32 edge values for testing conversions
+dqqua1040 quantize -2147483646 0 -> -2147483646
+dqqua1041 quantize -2147483647 0 -> -2147483647
+dqqua1042 quantize -2147483648 0 -> -2147483648
+dqqua1043 quantize -2147483649 0 -> -2147483649
+dqqua1044 quantize 2147483646 0 -> 2147483646
+dqqua1045 quantize 2147483647 0 -> 2147483647
+dqqua1046 quantize 2147483648 0 -> 2147483648
+dqqua1047 quantize 2147483649 0 -> 2147483649
+dqqua1048 quantize 4294967294 0 -> 4294967294
+dqqua1049 quantize 4294967295 0 -> 4294967295
+dqqua1050 quantize 4294967296 0 -> 4294967296
+dqqua1051 quantize 4294967297 0 -> 4294967297
+
+-- Rounding swathe
+rounding: half_even
+dqqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+dqqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: half_up
+dqqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+dqqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+dqqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: half_down
+dqqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+dqqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: up
+dqqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
+dqqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
+dqqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+dqqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+dqqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+dqqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
+
+rounding: down
+dqqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+dqqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
+dqqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+dqqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
+dqqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
+dqqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
+dqqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
+
+rounding: ceiling
+dqqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
+dqqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
+dqqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+dqqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+dqqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+dqqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
+
+rounding: floor
+dqqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+dqqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
+dqqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+dqqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
+dqqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
+dqqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
+dqqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
+
+rounding: 05up
+dqqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
+dqqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
+dqqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
+dqqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
+dqqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
+dqqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
+dqqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
+dqqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
+dqqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
+
+dqqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
+dqqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
+dqqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
+dqqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
+dqqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
+dqqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
+dqqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
+dqqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
+dqqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
+
+dqqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
+dqqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
+dqqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
+dqqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+dqqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
+dqqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
+dqqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
+dqqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
+
+dqqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
+dqqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
+dqqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
+dqqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
+dqqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
+dqqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
+dqqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
+dqqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
+dqqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
+
+dqqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
+dqqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
+dqqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
+dqqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
+dqqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
+dqqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
+dqqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
+dqqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
+dqqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
+
+dqqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
+dqqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
+dqqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
+dqqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
+dqqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
+dqqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
+dqqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
+dqqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
+dqqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
+
+-- Null tests
+dqqua998 quantize 10 # -> NaN Invalid_operation
+dqqua999 quantize # 1e10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqReduce.decTest b/Lib/test/decimaltestdata/dqReduce.decTest
index 5635e6b70f..236574f4c7 100644
--- a/Lib/test/decimaltestdata/dqReduce.decTest
+++ b/Lib/test/decimaltestdata/dqReduce.decTest
@@ -1,183 +1,183 @@
-------------------------------------------------------------------------
--- dqReduce.decTest -- remove trailing zeros from a decQuad --
--- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqred001 reduce '1' -> '1'
-dqred002 reduce '-1' -> '-1'
-dqred003 reduce '1.00' -> '1'
-dqred004 reduce '-1.00' -> '-1'
-dqred005 reduce '0' -> '0'
-dqred006 reduce '0.00' -> '0'
-dqred007 reduce '00.0' -> '0'
-dqred008 reduce '00.00' -> '0'
-dqred009 reduce '00' -> '0'
-dqred010 reduce '0E+1' -> '0'
-dqred011 reduce '0E+5' -> '0'
-
-dqred012 reduce '-2' -> '-2'
-dqred013 reduce '2' -> '2'
-dqred014 reduce '-2.00' -> '-2'
-dqred015 reduce '2.00' -> '2'
-dqred016 reduce '-0' -> '-0'
-dqred017 reduce '-0.00' -> '-0'
-dqred018 reduce '-00.0' -> '-0'
-dqred019 reduce '-00.00' -> '-0'
-dqred020 reduce '-00' -> '-0'
-dqred021 reduce '-0E+5' -> '-0'
-dqred022 reduce '-0E+1' -> '-0'
-
-dqred030 reduce '+0.1' -> '0.1'
-dqred031 reduce '-0.1' -> '-0.1'
-dqred032 reduce '+0.01' -> '0.01'
-dqred033 reduce '-0.01' -> '-0.01'
-dqred034 reduce '+0.001' -> '0.001'
-dqred035 reduce '-0.001' -> '-0.001'
-dqred036 reduce '+0.000001' -> '0.000001'
-dqred037 reduce '-0.000001' -> '-0.000001'
-dqred038 reduce '+0.000000000001' -> '1E-12'
-dqred039 reduce '-0.000000000001' -> '-1E-12'
-
-dqred041 reduce 1.1 -> 1.1
-dqred042 reduce 1.10 -> 1.1
-dqred043 reduce 1.100 -> 1.1
-dqred044 reduce 1.110 -> 1.11
-dqred045 reduce -1.1 -> -1.1
-dqred046 reduce -1.10 -> -1.1
-dqred047 reduce -1.100 -> -1.1
-dqred048 reduce -1.110 -> -1.11
-dqred049 reduce 9.9 -> 9.9
-dqred050 reduce 9.90 -> 9.9
-dqred051 reduce 9.900 -> 9.9
-dqred052 reduce 9.990 -> 9.99
-dqred053 reduce -9.9 -> -9.9
-dqred054 reduce -9.90 -> -9.9
-dqred055 reduce -9.900 -> -9.9
-dqred056 reduce -9.990 -> -9.99
-
--- some trailing fractional zeros with zeros in units
-dqred060 reduce 10.0 -> 1E+1
-dqred061 reduce 10.00 -> 1E+1
-dqred062 reduce 100.0 -> 1E+2
-dqred063 reduce 100.00 -> 1E+2
-dqred064 reduce 1.1000E+3 -> 1.1E+3
-dqred065 reduce 1.10000E+3 -> 1.1E+3
-dqred066 reduce -10.0 -> -1E+1
-dqred067 reduce -10.00 -> -1E+1
-dqred068 reduce -100.0 -> -1E+2
-dqred069 reduce -100.00 -> -1E+2
-dqred070 reduce -1.1000E+3 -> -1.1E+3
-dqred071 reduce -1.10000E+3 -> -1.1E+3
-
--- some insignificant trailing zeros with positive exponent
-dqred080 reduce 10E+1 -> 1E+2
-dqred081 reduce 100E+1 -> 1E+3
-dqred082 reduce 1.0E+2 -> 1E+2
-dqred083 reduce 1.0E+3 -> 1E+3
-dqred084 reduce 1.1E+3 -> 1.1E+3
-dqred085 reduce 1.00E+3 -> 1E+3
-dqred086 reduce 1.10E+3 -> 1.1E+3
-dqred087 reduce -10E+1 -> -1E+2
-dqred088 reduce -100E+1 -> -1E+3
-dqred089 reduce -1.0E+2 -> -1E+2
-dqred090 reduce -1.0E+3 -> -1E+3
-dqred091 reduce -1.1E+3 -> -1.1E+3
-dqred092 reduce -1.00E+3 -> -1E+3
-dqred093 reduce -1.10E+3 -> -1.1E+3
-
--- some significant trailing zeros, were we to be trimming
-dqred100 reduce 11 -> 11
-dqred101 reduce 10 -> 1E+1
-dqred102 reduce 10. -> 1E+1
-dqred103 reduce 1.1E+1 -> 11
-dqred104 reduce 1.0E+1 -> 1E+1
-dqred105 reduce 1.10E+2 -> 1.1E+2
-dqred106 reduce 1.00E+2 -> 1E+2
-dqred107 reduce 1.100E+3 -> 1.1E+3
-dqred108 reduce 1.000E+3 -> 1E+3
-dqred109 reduce 1.000000E+6 -> 1E+6
-dqred110 reduce -11 -> -11
-dqred111 reduce -10 -> -1E+1
-dqred112 reduce -10. -> -1E+1
-dqred113 reduce -1.1E+1 -> -11
-dqred114 reduce -1.0E+1 -> -1E+1
-dqred115 reduce -1.10E+2 -> -1.1E+2
-dqred116 reduce -1.00E+2 -> -1E+2
-dqred117 reduce -1.100E+3 -> -1.1E+3
-dqred118 reduce -1.000E+3 -> -1E+3
-dqred119 reduce -1.00000E+5 -> -1E+5
-dqred120 reduce -1.000000E+6 -> -1E+6
-dqred121 reduce -10.00000E+6 -> -1E+7
-dqred122 reduce -100.0000E+6 -> -1E+8
-dqred123 reduce -1000.000E+6 -> -1E+9
-dqred124 reduce -10000.00E+6 -> -1E+10
-dqred125 reduce -100000.0E+6 -> -1E+11
-dqred126 reduce -1000000.E+6 -> -1E+12
-
--- examples from decArith
-dqred140 reduce '2.1' -> '2.1'
-dqred141 reduce '-2.0' -> '-2'
-dqred142 reduce '1.200' -> '1.2'
-dqred143 reduce '-120' -> '-1.2E+2'
-dqred144 reduce '120.00' -> '1.2E+2'
-dqred145 reduce '0.00' -> '0'
-
--- Nmax, Nmin, Ntiny
--- note origami effect on some of these
-dqred151 reduce 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqred152 reduce 9.999999999999999999999999000000000E+6140 -> 9.99999999999999999999999900000E+6140
-dqred153 reduce 9.999999999999999999999999999990000E+6144 -> 9.999999999999999999999999999990000E+6144
-dqred154 reduce 1E-6143 -> 1E-6143
-dqred155 reduce 1.000000000000000000000000000000000E-6143 -> 1E-6143
-dqred156 reduce 2.000E-6173 -> 2E-6173 Subnormal
-dqred157 reduce 1E-6176 -> 1E-6176 Subnormal
-
-dqred161 reduce -1E-6176 -> -1E-6176 Subnormal
-dqred162 reduce -2.000E-6173 -> -2E-6173 Subnormal
-dqred163 reduce -1.000000000000000000000000000000000E-6143 -> -1E-6143
-dqred164 reduce -1E-6143 -> -1E-6143
-dqred165 reduce -9.999999999999999999999999000000000E+6140 -> -9.99999999999999999999999900000E+6140
-dqred166 reduce -9.999999999999999999999999999990000E+6144 -> -9.999999999999999999999999999990000E+6144
-dqred167 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144
-dqred168 reduce -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqred169 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144
-
-
--- specials (reduce does not affect payload)
-dqred820 reduce 'Inf' -> 'Infinity'
-dqred821 reduce '-Inf' -> '-Infinity'
-dqred822 reduce NaN -> NaN
-dqred823 reduce sNaN -> NaN Invalid_operation
-dqred824 reduce NaN101 -> NaN101
-dqred825 reduce sNaN010 -> NaN10 Invalid_operation
-dqred827 reduce -NaN -> -NaN
-dqred828 reduce -sNaN -> -NaN Invalid_operation
-dqred829 reduce -NaN101 -> -NaN101
-dqred830 reduce -sNaN010 -> -NaN10 Invalid_operation
-
--- Null test
-dqred900 reduce # -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqReduce.decTest -- remove trailing zeros from a decQuad --
+-- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqred001 reduce '1' -> '1'
+dqred002 reduce '-1' -> '-1'
+dqred003 reduce '1.00' -> '1'
+dqred004 reduce '-1.00' -> '-1'
+dqred005 reduce '0' -> '0'
+dqred006 reduce '0.00' -> '0'
+dqred007 reduce '00.0' -> '0'
+dqred008 reduce '00.00' -> '0'
+dqred009 reduce '00' -> '0'
+dqred010 reduce '0E+1' -> '0'
+dqred011 reduce '0E+5' -> '0'
+
+dqred012 reduce '-2' -> '-2'
+dqred013 reduce '2' -> '2'
+dqred014 reduce '-2.00' -> '-2'
+dqred015 reduce '2.00' -> '2'
+dqred016 reduce '-0' -> '-0'
+dqred017 reduce '-0.00' -> '-0'
+dqred018 reduce '-00.0' -> '-0'
+dqred019 reduce '-00.00' -> '-0'
+dqred020 reduce '-00' -> '-0'
+dqred021 reduce '-0E+5' -> '-0'
+dqred022 reduce '-0E+1' -> '-0'
+
+dqred030 reduce '+0.1' -> '0.1'
+dqred031 reduce '-0.1' -> '-0.1'
+dqred032 reduce '+0.01' -> '0.01'
+dqred033 reduce '-0.01' -> '-0.01'
+dqred034 reduce '+0.001' -> '0.001'
+dqred035 reduce '-0.001' -> '-0.001'
+dqred036 reduce '+0.000001' -> '0.000001'
+dqred037 reduce '-0.000001' -> '-0.000001'
+dqred038 reduce '+0.000000000001' -> '1E-12'
+dqred039 reduce '-0.000000000001' -> '-1E-12'
+
+dqred041 reduce 1.1 -> 1.1
+dqred042 reduce 1.10 -> 1.1
+dqred043 reduce 1.100 -> 1.1
+dqred044 reduce 1.110 -> 1.11
+dqred045 reduce -1.1 -> -1.1
+dqred046 reduce -1.10 -> -1.1
+dqred047 reduce -1.100 -> -1.1
+dqred048 reduce -1.110 -> -1.11
+dqred049 reduce 9.9 -> 9.9
+dqred050 reduce 9.90 -> 9.9
+dqred051 reduce 9.900 -> 9.9
+dqred052 reduce 9.990 -> 9.99
+dqred053 reduce -9.9 -> -9.9
+dqred054 reduce -9.90 -> -9.9
+dqred055 reduce -9.900 -> -9.9
+dqred056 reduce -9.990 -> -9.99
+
+-- some trailing fractional zeros with zeros in units
+dqred060 reduce 10.0 -> 1E+1
+dqred061 reduce 10.00 -> 1E+1
+dqred062 reduce 100.0 -> 1E+2
+dqred063 reduce 100.00 -> 1E+2
+dqred064 reduce 1.1000E+3 -> 1.1E+3
+dqred065 reduce 1.10000E+3 -> 1.1E+3
+dqred066 reduce -10.0 -> -1E+1
+dqred067 reduce -10.00 -> -1E+1
+dqred068 reduce -100.0 -> -1E+2
+dqred069 reduce -100.00 -> -1E+2
+dqred070 reduce -1.1000E+3 -> -1.1E+3
+dqred071 reduce -1.10000E+3 -> -1.1E+3
+
+-- some insignificant trailing zeros with positive exponent
+dqred080 reduce 10E+1 -> 1E+2
+dqred081 reduce 100E+1 -> 1E+3
+dqred082 reduce 1.0E+2 -> 1E+2
+dqred083 reduce 1.0E+3 -> 1E+3
+dqred084 reduce 1.1E+3 -> 1.1E+3
+dqred085 reduce 1.00E+3 -> 1E+3
+dqred086 reduce 1.10E+3 -> 1.1E+3
+dqred087 reduce -10E+1 -> -1E+2
+dqred088 reduce -100E+1 -> -1E+3
+dqred089 reduce -1.0E+2 -> -1E+2
+dqred090 reduce -1.0E+3 -> -1E+3
+dqred091 reduce -1.1E+3 -> -1.1E+3
+dqred092 reduce -1.00E+3 -> -1E+3
+dqred093 reduce -1.10E+3 -> -1.1E+3
+
+-- some significant trailing zeros, were we to be trimming
+dqred100 reduce 11 -> 11
+dqred101 reduce 10 -> 1E+1
+dqred102 reduce 10. -> 1E+1
+dqred103 reduce 1.1E+1 -> 11
+dqred104 reduce 1.0E+1 -> 1E+1
+dqred105 reduce 1.10E+2 -> 1.1E+2
+dqred106 reduce 1.00E+2 -> 1E+2
+dqred107 reduce 1.100E+3 -> 1.1E+3
+dqred108 reduce 1.000E+3 -> 1E+3
+dqred109 reduce 1.000000E+6 -> 1E+6
+dqred110 reduce -11 -> -11
+dqred111 reduce -10 -> -1E+1
+dqred112 reduce -10. -> -1E+1
+dqred113 reduce -1.1E+1 -> -11
+dqred114 reduce -1.0E+1 -> -1E+1
+dqred115 reduce -1.10E+2 -> -1.1E+2
+dqred116 reduce -1.00E+2 -> -1E+2
+dqred117 reduce -1.100E+3 -> -1.1E+3
+dqred118 reduce -1.000E+3 -> -1E+3
+dqred119 reduce -1.00000E+5 -> -1E+5
+dqred120 reduce -1.000000E+6 -> -1E+6
+dqred121 reduce -10.00000E+6 -> -1E+7
+dqred122 reduce -100.0000E+6 -> -1E+8
+dqred123 reduce -1000.000E+6 -> -1E+9
+dqred124 reduce -10000.00E+6 -> -1E+10
+dqred125 reduce -100000.0E+6 -> -1E+11
+dqred126 reduce -1000000.E+6 -> -1E+12
+
+-- examples from decArith
+dqred140 reduce '2.1' -> '2.1'
+dqred141 reduce '-2.0' -> '-2'
+dqred142 reduce '1.200' -> '1.2'
+dqred143 reduce '-120' -> '-1.2E+2'
+dqred144 reduce '120.00' -> '1.2E+2'
+dqred145 reduce '0.00' -> '0'
+
+-- Nmax, Nmin, Ntiny
+-- note origami effect on some of these
+dqred151 reduce 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqred152 reduce 9.999999999999999999999999000000000E+6140 -> 9.99999999999999999999999900000E+6140
+dqred153 reduce 9.999999999999999999999999999990000E+6144 -> 9.999999999999999999999999999990000E+6144
+dqred154 reduce 1E-6143 -> 1E-6143
+dqred155 reduce 1.000000000000000000000000000000000E-6143 -> 1E-6143
+dqred156 reduce 2.000E-6173 -> 2E-6173 Subnormal
+dqred157 reduce 1E-6176 -> 1E-6176 Subnormal
+
+dqred161 reduce -1E-6176 -> -1E-6176 Subnormal
+dqred162 reduce -2.000E-6173 -> -2E-6173 Subnormal
+dqred163 reduce -1.000000000000000000000000000000000E-6143 -> -1E-6143
+dqred164 reduce -1E-6143 -> -1E-6143
+dqred165 reduce -9.999999999999999999999999000000000E+6140 -> -9.99999999999999999999999900000E+6140
+dqred166 reduce -9.999999999999999999999999999990000E+6144 -> -9.999999999999999999999999999990000E+6144
+dqred167 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144
+dqred168 reduce -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqred169 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144
+
+
+-- specials (reduce does not affect payload)
+dqred820 reduce 'Inf' -> 'Infinity'
+dqred821 reduce '-Inf' -> '-Infinity'
+dqred822 reduce NaN -> NaN
+dqred823 reduce sNaN -> NaN Invalid_operation
+dqred824 reduce NaN101 -> NaN101
+dqred825 reduce sNaN010 -> NaN10 Invalid_operation
+dqred827 reduce -NaN -> -NaN
+dqred828 reduce -sNaN -> -NaN Invalid_operation
+dqred829 reduce -NaN101 -> -NaN101
+dqred830 reduce -sNaN010 -> -NaN10 Invalid_operation
+
+-- Null test
+dqred900 reduce # -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqRemainder.decTest b/Lib/test/decimaltestdata/dqRemainder.decTest
index 090d3cf559..bae8eae526 100644
--- a/Lib/test/decimaltestdata/dqRemainder.decTest
+++ b/Lib/test/decimaltestdata/dqRemainder.decTest
@@ -1,597 +1,597 @@
-------------------------------------------------------------------------
--- dqRemainder.decTest -- decQuad remainder --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks (as base, above)
-dqrem001 remainder 1 1 -> 0
-dqrem002 remainder 2 1 -> 0
-dqrem003 remainder 1 2 -> 1
-dqrem004 remainder 2 2 -> 0
-dqrem005 remainder 0 1 -> 0
-dqrem006 remainder 0 2 -> 0
-dqrem007 remainder 1 3 -> 1
-dqrem008 remainder 2 3 -> 2
-dqrem009 remainder 3 3 -> 0
-
-dqrem010 remainder 2.4 1 -> 0.4
-dqrem011 remainder 2.4 -1 -> 0.4
-dqrem012 remainder -2.4 1 -> -0.4
-dqrem013 remainder -2.4 -1 -> -0.4
-dqrem014 remainder 2.40 1 -> 0.40
-dqrem015 remainder 2.400 1 -> 0.400
-dqrem016 remainder 2.4 2 -> 0.4
-dqrem017 remainder 2.400 2 -> 0.400
-dqrem018 remainder 2. 2 -> 0
-dqrem019 remainder 20 20 -> 0
-
-dqrem020 remainder 187 187 -> 0
-dqrem021 remainder 5 2 -> 1
-dqrem022 remainder 5 2.0 -> 1.0
-dqrem023 remainder 5 2.000 -> 1.000
-dqrem024 remainder 5 0.200 -> 0.000
-dqrem025 remainder 5 0.200 -> 0.000
-
-dqrem030 remainder 1 2 -> 1
-dqrem031 remainder 1 4 -> 1
-dqrem032 remainder 1 8 -> 1
-
-dqrem033 remainder 1 16 -> 1
-dqrem034 remainder 1 32 -> 1
-dqrem035 remainder 1 64 -> 1
-dqrem040 remainder 1 -2 -> 1
-dqrem041 remainder 1 -4 -> 1
-dqrem042 remainder 1 -8 -> 1
-dqrem043 remainder 1 -16 -> 1
-dqrem044 remainder 1 -32 -> 1
-dqrem045 remainder 1 -64 -> 1
-dqrem050 remainder -1 2 -> -1
-dqrem051 remainder -1 4 -> -1
-dqrem052 remainder -1 8 -> -1
-dqrem053 remainder -1 16 -> -1
-dqrem054 remainder -1 32 -> -1
-dqrem055 remainder -1 64 -> -1
-dqrem060 remainder -1 -2 -> -1
-dqrem061 remainder -1 -4 -> -1
-dqrem062 remainder -1 -8 -> -1
-dqrem063 remainder -1 -16 -> -1
-dqrem064 remainder -1 -32 -> -1
-dqrem065 remainder -1 -64 -> -1
-
-dqrem066 remainder 999999999 1 -> 0
-dqrem067 remainder 999999999.4 1 -> 0.4
-dqrem068 remainder 999999999.5 1 -> 0.5
-dqrem069 remainder 999999999.9 1 -> 0.9
-dqrem070 remainder 999999999.999 1 -> 0.999
-dqrem071 remainder 999999.999999 1 -> 0.999999
-dqrem072 remainder 9 1 -> 0
-
-dqrem080 remainder 0. 1 -> 0
-dqrem081 remainder .0 1 -> 0.0
-dqrem082 remainder 0.00 1 -> 0.00
-dqrem083 remainder 0.00E+9 1 -> 0
-dqrem084 remainder 0.00E+3 1 -> 0
-dqrem085 remainder 0.00E+2 1 -> 0
-dqrem086 remainder 0.00E+1 1 -> 0.0
-dqrem087 remainder 0.00E+0 1 -> 0.00
-dqrem088 remainder 0.00E-0 1 -> 0.00
-dqrem089 remainder 0.00E-1 1 -> 0.000
-dqrem090 remainder 0.00E-2 1 -> 0.0000
-dqrem091 remainder 0.00E-3 1 -> 0.00000
-dqrem092 remainder 0.00E-4 1 -> 0.000000
-dqrem093 remainder 0.00E-5 1 -> 0E-7
-dqrem094 remainder 0.00E-6 1 -> 0E-8
-dqrem095 remainder 0.0000E-50 1 -> 0E-54
-
--- Various flavours of remainder by 0
-dqrem101 remainder 0 0 -> NaN Division_undefined
-dqrem102 remainder 0 -0 -> NaN Division_undefined
-dqrem103 remainder -0 0 -> NaN Division_undefined
-dqrem104 remainder -0 -0 -> NaN Division_undefined
-dqrem105 remainder 0.0E5 0 -> NaN Division_undefined
-dqrem106 remainder 0.000 0 -> NaN Division_undefined
--- [Some think this next group should be Division_by_zero exception, but
--- IEEE 854 is explicit that it is Invalid operation .. for
--- remainder-near, anyway]
-dqrem107 remainder 0.0001 0 -> NaN Invalid_operation
-dqrem108 remainder 0.01 0 -> NaN Invalid_operation
-dqrem109 remainder 0.1 0 -> NaN Invalid_operation
-dqrem110 remainder 1 0 -> NaN Invalid_operation
-dqrem111 remainder 1 0.0 -> NaN Invalid_operation
-dqrem112 remainder 10 0.0 -> NaN Invalid_operation
-dqrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
-dqrem114 remainder 1E+380 0 -> NaN Invalid_operation
-dqrem115 remainder 0.0001 -0 -> NaN Invalid_operation
-dqrem116 remainder 0.01 -0 -> NaN Invalid_operation
-dqrem119 remainder 0.1 -0 -> NaN Invalid_operation
-dqrem120 remainder 1 -0 -> NaN Invalid_operation
-dqrem121 remainder 1 -0.0 -> NaN Invalid_operation
-dqrem122 remainder 10 -0.0 -> NaN Invalid_operation
-dqrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
-dqrem124 remainder 1E+384 -0 -> NaN Invalid_operation
--- and zeros on left
-dqrem130 remainder 0 1 -> 0
-dqrem131 remainder 0 -1 -> 0
-dqrem132 remainder 0.0 1 -> 0.0
-dqrem133 remainder 0.0 -1 -> 0.0
-dqrem134 remainder -0 1 -> -0
-dqrem135 remainder -0 -1 -> -0
-dqrem136 remainder -0.0 1 -> -0.0
-dqrem137 remainder -0.0 -1 -> -0.0
-
--- 0.5ers
-dqrem143 remainder 0.5 2 -> 0.5
-dqrem144 remainder 0.5 2.1 -> 0.5
-dqrem145 remainder 0.5 2.01 -> 0.50
-dqrem146 remainder 0.5 2.001 -> 0.500
-dqrem147 remainder 0.50 2 -> 0.50
-dqrem148 remainder 0.50 2.01 -> 0.50
-dqrem149 remainder 0.50 2.001 -> 0.500
-
--- steadies
-dqrem150 remainder 1 1 -> 0
-dqrem151 remainder 1 2 -> 1
-dqrem152 remainder 1 3 -> 1
-dqrem153 remainder 1 4 -> 1
-dqrem154 remainder 1 5 -> 1
-dqrem155 remainder 1 6 -> 1
-dqrem156 remainder 1 7 -> 1
-dqrem157 remainder 1 8 -> 1
-dqrem158 remainder 1 9 -> 1
-dqrem159 remainder 1 10 -> 1
-dqrem160 remainder 1 1 -> 0
-dqrem161 remainder 2 1 -> 0
-dqrem162 remainder 3 1 -> 0
-dqrem163 remainder 4 1 -> 0
-dqrem164 remainder 5 1 -> 0
-dqrem165 remainder 6 1 -> 0
-dqrem166 remainder 7 1 -> 0
-dqrem167 remainder 8 1 -> 0
-dqrem168 remainder 9 1 -> 0
-dqrem169 remainder 10 1 -> 0
-
--- some differences from remainderNear
-dqrem171 remainder 0.4 1.020 -> 0.400
-dqrem172 remainder 0.50 1.020 -> 0.500
-dqrem173 remainder 0.51 1.020 -> 0.510
-dqrem174 remainder 0.52 1.020 -> 0.520
-dqrem175 remainder 0.6 1.020 -> 0.600
-
--- More flavours of remainder by 0
-dqrem201 remainder 0 0 -> NaN Division_undefined
-dqrem202 remainder 0.0E5 0 -> NaN Division_undefined
-dqrem203 remainder 0.000 0 -> NaN Division_undefined
-dqrem204 remainder 0.0001 0 -> NaN Invalid_operation
-dqrem205 remainder 0.01 0 -> NaN Invalid_operation
-dqrem206 remainder 0.1 0 -> NaN Invalid_operation
-dqrem207 remainder 1 0 -> NaN Invalid_operation
-dqrem208 remainder 1 0.0 -> NaN Invalid_operation
-dqrem209 remainder 10 0.0 -> NaN Invalid_operation
-dqrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
-dqrem211 remainder 1E+380 0 -> NaN Invalid_operation
-
--- some differences from remainderNear
-dqrem231 remainder -0.4 1.020 -> -0.400
-dqrem232 remainder -0.50 1.020 -> -0.500
-dqrem233 remainder -0.51 1.020 -> -0.510
-dqrem234 remainder -0.52 1.020 -> -0.520
-dqrem235 remainder -0.6 1.020 -> -0.600
-
--- high Xs
-dqrem240 remainder 1E+2 1.00 -> 0.00
-
--- dqrem3xx are from DiagBigDecimal
-dqrem301 remainder 1 3 -> 1
-dqrem302 remainder 5 5 -> 0
-dqrem303 remainder 13 10 -> 3
-dqrem304 remainder 13 50 -> 13
-dqrem305 remainder 13 100 -> 13
-dqrem306 remainder 13 1000 -> 13
-dqrem307 remainder .13 1 -> 0.13
-dqrem308 remainder 0.133 1 -> 0.133
-dqrem309 remainder 0.1033 1 -> 0.1033
-dqrem310 remainder 1.033 1 -> 0.033
-dqrem311 remainder 10.33 1 -> 0.33
-dqrem312 remainder 10.33 10 -> 0.33
-dqrem313 remainder 103.3 1 -> 0.3
-dqrem314 remainder 133 10 -> 3
-dqrem315 remainder 1033 10 -> 3
-dqrem316 remainder 1033 50 -> 33
-dqrem317 remainder 101.0 3 -> 2.0
-dqrem318 remainder 102.0 3 -> 0.0
-dqrem319 remainder 103.0 3 -> 1.0
-dqrem320 remainder 2.40 1 -> 0.40
-dqrem321 remainder 2.400 1 -> 0.400
-dqrem322 remainder 2.4 1 -> 0.4
-dqrem323 remainder 2.4 2 -> 0.4
-dqrem324 remainder 2.400 2 -> 0.400
-dqrem325 remainder 1 0.3 -> 0.1
-dqrem326 remainder 1 0.30 -> 0.10
-dqrem327 remainder 1 0.300 -> 0.100
-dqrem328 remainder 1 0.3000 -> 0.1000
-dqrem329 remainder 1.0 0.3 -> 0.1
-dqrem330 remainder 1.00 0.3 -> 0.10
-dqrem331 remainder 1.000 0.3 -> 0.100
-dqrem332 remainder 1.0000 0.3 -> 0.1000
-dqrem333 remainder 0.5 2 -> 0.5
-dqrem334 remainder 0.5 2.1 -> 0.5
-dqrem335 remainder 0.5 2.01 -> 0.50
-dqrem336 remainder 0.5 2.001 -> 0.500
-dqrem337 remainder 0.50 2 -> 0.50
-dqrem338 remainder 0.50 2.01 -> 0.50
-dqrem339 remainder 0.50 2.001 -> 0.500
-
-dqrem340 remainder 0.5 0.5000001 -> 0.5000000
-dqrem341 remainder 0.5 0.50000001 -> 0.50000000
-dqrem342 remainder 0.5 0.500000001 -> 0.500000000
-dqrem343 remainder 0.5 0.5000000001 -> 0.5000000000
-dqrem344 remainder 0.5 0.50000000001 -> 0.50000000000
-dqrem345 remainder 0.5 0.4999999 -> 1E-7
-dqrem346 remainder 0.5 0.49999999 -> 1E-8
-dqrem347 remainder 0.5 0.499999999 -> 1E-9
-dqrem348 remainder 0.5 0.4999999999 -> 1E-10
-dqrem349 remainder 0.5 0.49999999999 -> 1E-11
-dqrem350 remainder 0.5 0.499999999999 -> 1E-12
-
-dqrem351 remainder 0.03 7 -> 0.03
-dqrem352 remainder 5 2 -> 1
-dqrem353 remainder 4.1 2 -> 0.1
-dqrem354 remainder 4.01 2 -> 0.01
-dqrem355 remainder 4.001 2 -> 0.001
-dqrem356 remainder 4.0001 2 -> 0.0001
-dqrem357 remainder 4.00001 2 -> 0.00001
-dqrem358 remainder 4.000001 2 -> 0.000001
-dqrem359 remainder 4.0000001 2 -> 1E-7
-
-dqrem360 remainder 1.2 0.7345 -> 0.4655
-dqrem361 remainder 0.8 12 -> 0.8
-dqrem362 remainder 0.8 0.2 -> 0.0
-dqrem363 remainder 0.8 0.3 -> 0.2
-dqrem364 remainder 0.800 12 -> 0.800
-dqrem365 remainder 0.800 1.7 -> 0.800
-dqrem366 remainder 2.400 2 -> 0.400
-
-dqrem371 remainder 2.400 2 -> 0.400
-
-dqrem381 remainder 12345 1 -> 0
-dqrem382 remainder 12345 1.0001 -> 0.7657
-dqrem383 remainder 12345 1.001 -> 0.668
-dqrem384 remainder 12345 1.01 -> 0.78
-dqrem385 remainder 12345 1.1 -> 0.8
-dqrem386 remainder 12355 4 -> 3
-dqrem387 remainder 12345 4 -> 1
-dqrem388 remainder 12355 4.0001 -> 2.6912
-dqrem389 remainder 12345 4.0001 -> 0.6914
-dqrem390 remainder 12345 4.9 -> 1.9
-dqrem391 remainder 12345 4.99 -> 4.73
-dqrem392 remainder 12345 4.999 -> 2.469
-dqrem393 remainder 12345 4.9999 -> 0.2469
-dqrem394 remainder 12345 5 -> 0
-dqrem395 remainder 12345 5.0001 -> 4.7532
-dqrem396 remainder 12345 5.001 -> 2.532
-dqrem397 remainder 12345 5.01 -> 0.36
-dqrem398 remainder 12345 5.1 -> 3.0
-
--- the nasty division-by-1 cases
-dqrem401 remainder 0.5 1 -> 0.5
-dqrem402 remainder 0.55 1 -> 0.55
-dqrem403 remainder 0.555 1 -> 0.555
-dqrem404 remainder 0.5555 1 -> 0.5555
-dqrem405 remainder 0.55555 1 -> 0.55555
-dqrem406 remainder 0.555555 1 -> 0.555555
-dqrem407 remainder 0.5555555 1 -> 0.5555555
-dqrem408 remainder 0.55555555 1 -> 0.55555555
-dqrem409 remainder 0.555555555 1 -> 0.555555555
-
--- folddowns
-dqrem421 remainder 1E+6144 1 -> NaN Division_impossible
-dqrem422 remainder 1E+6144 1E+6143 -> 0E+6111 Clamped
-dqrem423 remainder 1E+6144 2E+6143 -> 0E+6111 Clamped
-dqrem424 remainder 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqrem425 remainder 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
-dqrem426 remainder 1E+6144 5E+6143 -> 0E+6111 Clamped
-dqrem427 remainder 1E+6144 6E+6143 -> 4.00000000000000000000000000000000E+6143 Clamped
-dqrem428 remainder 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped
-dqrem429 remainder 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
-dqrem430 remainder 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
--- tinies
-dqrem431 remainder 1E-6175 1E-6176 -> 0E-6176
-dqrem432 remainder 1E-6175 2E-6176 -> 0E-6176
-dqrem433 remainder 1E-6175 3E-6176 -> 1E-6176 Subnormal
-dqrem434 remainder 1E-6175 4E-6176 -> 2E-6176 Subnormal
-dqrem435 remainder 1E-6175 5E-6176 -> 0E-6176
-dqrem436 remainder 1E-6175 6E-6176 -> 4E-6176 Subnormal
-dqrem437 remainder 1E-6175 7E-6176 -> 3E-6176 Subnormal
-dqrem438 remainder 1E-6175 8E-6176 -> 2E-6176 Subnormal
-dqrem439 remainder 1E-6175 9E-6176 -> 1E-6176 Subnormal
-dqrem440 remainder 1E-6175 10E-6176 -> 0E-6176
-dqrem441 remainder 1E-6175 11E-6176 -> 1.0E-6175 Subnormal
-dqrem442 remainder 100E-6175 11E-6176 -> 1.0E-6175 Subnormal
-dqrem443 remainder 100E-6175 20E-6176 -> 0E-6176
-dqrem444 remainder 100E-6175 21E-6176 -> 1.3E-6175 Subnormal
-dqrem445 remainder 100E-6175 30E-6176 -> 1.0E-6175 Subnormal
-
--- zero signs
-dqrem650 remainder 1 1 -> 0
-dqrem651 remainder -1 1 -> -0
-dqrem652 remainder 1 -1 -> 0
-dqrem653 remainder -1 -1 -> -0
-dqrem654 remainder 0 1 -> 0
-dqrem655 remainder -0 1 -> -0
-dqrem656 remainder 0 -1 -> 0
-dqrem657 remainder -0 -1 -> -0
-dqrem658 remainder 0.00 1 -> 0.00
-dqrem659 remainder -0.00 1 -> -0.00
-
--- Specials
-dqrem680 remainder Inf -Inf -> NaN Invalid_operation
-dqrem681 remainder Inf -1000 -> NaN Invalid_operation
-dqrem682 remainder Inf -1 -> NaN Invalid_operation
-dqrem683 remainder Inf 0 -> NaN Invalid_operation
-dqrem684 remainder Inf -0 -> NaN Invalid_operation
-dqrem685 remainder Inf 1 -> NaN Invalid_operation
-dqrem686 remainder Inf 1000 -> NaN Invalid_operation
-dqrem687 remainder Inf Inf -> NaN Invalid_operation
-dqrem688 remainder -1000 Inf -> -1000
-dqrem689 remainder -Inf Inf -> NaN Invalid_operation
-dqrem691 remainder -1 Inf -> -1
-dqrem692 remainder 0 Inf -> 0
-dqrem693 remainder -0 Inf -> -0
-dqrem694 remainder 1 Inf -> 1
-dqrem695 remainder 1000 Inf -> 1000
-dqrem696 remainder Inf Inf -> NaN Invalid_operation
-
-dqrem700 remainder -Inf -Inf -> NaN Invalid_operation
-dqrem701 remainder -Inf -1000 -> NaN Invalid_operation
-dqrem702 remainder -Inf -1 -> NaN Invalid_operation
-dqrem703 remainder -Inf -0 -> NaN Invalid_operation
-dqrem704 remainder -Inf 0 -> NaN Invalid_operation
-dqrem705 remainder -Inf 1 -> NaN Invalid_operation
-dqrem706 remainder -Inf 1000 -> NaN Invalid_operation
-dqrem707 remainder -Inf Inf -> NaN Invalid_operation
-dqrem708 remainder -Inf -Inf -> NaN Invalid_operation
-dqrem709 remainder -1000 Inf -> -1000
-dqrem710 remainder -1 -Inf -> -1
-dqrem711 remainder -0 -Inf -> -0
-dqrem712 remainder 0 -Inf -> 0
-dqrem713 remainder 1 -Inf -> 1
-dqrem714 remainder 1000 -Inf -> 1000
-dqrem715 remainder Inf -Inf -> NaN Invalid_operation
-
-dqrem721 remainder NaN -Inf -> NaN
-dqrem722 remainder NaN -1000 -> NaN
-dqrem723 remainder NaN -1 -> NaN
-dqrem724 remainder NaN -0 -> NaN
-dqrem725 remainder -NaN 0 -> -NaN
-dqrem726 remainder NaN 1 -> NaN
-dqrem727 remainder NaN 1000 -> NaN
-dqrem728 remainder NaN Inf -> NaN
-dqrem729 remainder NaN -NaN -> NaN
-dqrem730 remainder -Inf NaN -> NaN
-dqrem731 remainder -1000 NaN -> NaN
-dqrem732 remainder -1 NaN -> NaN
-dqrem733 remainder -0 -NaN -> -NaN
-dqrem734 remainder 0 NaN -> NaN
-dqrem735 remainder 1 -NaN -> -NaN
-dqrem736 remainder 1000 NaN -> NaN
-dqrem737 remainder Inf NaN -> NaN
-
-dqrem741 remainder sNaN -Inf -> NaN Invalid_operation
-dqrem742 remainder sNaN -1000 -> NaN Invalid_operation
-dqrem743 remainder -sNaN -1 -> -NaN Invalid_operation
-dqrem744 remainder sNaN -0 -> NaN Invalid_operation
-dqrem745 remainder sNaN 0 -> NaN Invalid_operation
-dqrem746 remainder sNaN 1 -> NaN Invalid_operation
-dqrem747 remainder sNaN 1000 -> NaN Invalid_operation
-dqrem749 remainder sNaN NaN -> NaN Invalid_operation
-dqrem750 remainder sNaN sNaN -> NaN Invalid_operation
-dqrem751 remainder NaN sNaN -> NaN Invalid_operation
-dqrem752 remainder -Inf sNaN -> NaN Invalid_operation
-dqrem753 remainder -1000 sNaN -> NaN Invalid_operation
-dqrem754 remainder -1 sNaN -> NaN Invalid_operation
-dqrem755 remainder -0 sNaN -> NaN Invalid_operation
-dqrem756 remainder 0 sNaN -> NaN Invalid_operation
-dqrem757 remainder 1 sNaN -> NaN Invalid_operation
-dqrem758 remainder 1000 sNaN -> NaN Invalid_operation
-dqrem759 remainder Inf -sNaN -> -NaN Invalid_operation
-
--- propaging NaNs
-dqrem760 remainder NaN1 NaN7 -> NaN1
-dqrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
-dqrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
-dqrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
-dqrem764 remainder 15 NaN11 -> NaN11
-dqrem765 remainder NaN6 NaN12 -> NaN6
-dqrem766 remainder Inf NaN13 -> NaN13
-dqrem767 remainder NaN14 -Inf -> NaN14
-dqrem768 remainder 0 NaN15 -> NaN15
-dqrem769 remainder NaN16 -0 -> NaN16
-
--- edge cases of impossible
-dqrem770 remainder 1234568888888887777777777890123456 10 -> 6
-dqrem771 remainder 1234568888888887777777777890123456 1 -> 0
-dqrem772 remainder 1234568888888887777777777890123456 0.1 -> NaN Division_impossible
-dqrem773 remainder 1234568888888887777777777890123456 0.01 -> NaN Division_impossible
-
--- long operand checks
-dqrem801 remainder 12345678000 100 -> 0
-dqrem802 remainder 1 12345678000 -> 1
-dqrem803 remainder 1234567800 10 -> 0
-dqrem804 remainder 1 1234567800 -> 1
-dqrem805 remainder 1234567890 10 -> 0
-dqrem806 remainder 1 1234567890 -> 1
-dqrem807 remainder 1234567891 10 -> 1
-dqrem808 remainder 1 1234567891 -> 1
-dqrem809 remainder 12345678901 100 -> 1
-dqrem810 remainder 1 12345678901 -> 1
-dqrem811 remainder 1234567896 10 -> 6
-dqrem812 remainder 1 1234567896 -> 1
-
-dqrem821 remainder 12345678000 100 -> 0
-dqrem822 remainder 1 12345678000 -> 1
-dqrem823 remainder 1234567800 10 -> 0
-dqrem824 remainder 1 1234567800 -> 1
-dqrem825 remainder 1234567890 10 -> 0
-dqrem826 remainder 1 1234567890 -> 1
-dqrem827 remainder 1234567891 10 -> 1
-dqrem828 remainder 1 1234567891 -> 1
-dqrem829 remainder 12345678901 100 -> 1
-dqrem830 remainder 1 12345678901 -> 1
-dqrem831 remainder 1234567896 10 -> 6
-dqrem832 remainder 1 1234567896 -> 1
-
--- from divideint
-dqrem840 remainder 100000000.0 1 -> 0.0
-dqrem841 remainder 100000000.4 1 -> 0.4
-dqrem842 remainder 100000000.5 1 -> 0.5
-dqrem843 remainder 100000000.9 1 -> 0.9
-dqrem844 remainder 100000000.999 1 -> 0.999
-dqrem850 remainder 100000003 5 -> 3
-dqrem851 remainder 10000003 5 -> 3
-dqrem852 remainder 1000003 5 -> 3
-dqrem853 remainder 100003 5 -> 3
-dqrem854 remainder 10003 5 -> 3
-dqrem855 remainder 1003 5 -> 3
-dqrem856 remainder 103 5 -> 3
-dqrem857 remainder 13 5 -> 3
-dqrem858 remainder 1 5 -> 1
-
--- Vladimir's cases 1234567890123456
-dqrem860 remainder 123.0e1 1000000000000000 -> 1230
-dqrem861 remainder 1230 1000000000000000 -> 1230
-dqrem862 remainder 12.3e2 1000000000000000 -> 1230
-dqrem863 remainder 1.23e3 1000000000000000 -> 1230
-dqrem864 remainder 123e1 1000000000000000 -> 1230
-dqrem870 remainder 123e1 1000000000000000 -> 1230
-dqrem871 remainder 123e1 100000000000000 -> 1230
-dqrem872 remainder 123e1 10000000000000 -> 1230
-dqrem873 remainder 123e1 1000000000000 -> 1230
-dqrem874 remainder 123e1 100000000000 -> 1230
-dqrem875 remainder 123e1 10000000000 -> 1230
-dqrem876 remainder 123e1 1000000000 -> 1230
-dqrem877 remainder 123e1 100000000 -> 1230
-dqrem878 remainder 1230 100000000 -> 1230
-dqrem879 remainder 123e1 10000000 -> 1230
-dqrem880 remainder 123e1 1000000 -> 1230
-dqrem881 remainder 123e1 100000 -> 1230
-dqrem882 remainder 123e1 10000 -> 1230
-dqrem883 remainder 123e1 1000 -> 230
-dqrem884 remainder 123e1 100 -> 30
-dqrem885 remainder 123e1 10 -> 0
-dqrem886 remainder 123e1 1 -> 0
-
-dqrem890 remainder 123e1 2000000000000000 -> 1230
-dqrem891 remainder 123e1 200000000000000 -> 1230
-dqrem892 remainder 123e1 20000000000000 -> 1230
-dqrem893 remainder 123e1 2000000000000 -> 1230
-dqrem894 remainder 123e1 200000000000 -> 1230
-dqrem895 remainder 123e1 20000000000 -> 1230
-dqrem896 remainder 123e1 2000000000 -> 1230
-dqrem897 remainder 123e1 200000000 -> 1230
-dqrem899 remainder 123e1 20000000 -> 1230
-dqrem900 remainder 123e1 2000000 -> 1230
-dqrem901 remainder 123e1 200000 -> 1230
-dqrem902 remainder 123e1 20000 -> 1230
-dqrem903 remainder 123e1 2000 -> 1230
-dqrem904 remainder 123e1 200 -> 30
-dqrem905 remainder 123e1 20 -> 10
-dqrem906 remainder 123e1 2 -> 0
-
-dqrem910 remainder 123e1 5000000000000000 -> 1230
-dqrem911 remainder 123e1 500000000000000 -> 1230
-dqrem912 remainder 123e1 50000000000000 -> 1230
-dqrem913 remainder 123e1 5000000000000 -> 1230
-dqrem914 remainder 123e1 500000000000 -> 1230
-dqrem915 remainder 123e1 50000000000 -> 1230
-dqrem916 remainder 123e1 5000000000 -> 1230
-dqrem917 remainder 123e1 500000000 -> 1230
-dqrem919 remainder 123e1 50000000 -> 1230
-dqrem920 remainder 123e1 5000000 -> 1230
-dqrem921 remainder 123e1 500000 -> 1230
-dqrem922 remainder 123e1 50000 -> 1230
-dqrem923 remainder 123e1 5000 -> 1230
-dqrem924 remainder 123e1 500 -> 230
-dqrem925 remainder 123e1 50 -> 30
-dqrem926 remainder 123e1 5 -> 0
-
-dqrem930 remainder 123e1 9000000000000000 -> 1230
-dqrem931 remainder 123e1 900000000000000 -> 1230
-dqrem932 remainder 123e1 90000000000000 -> 1230
-dqrem933 remainder 123e1 9000000000000 -> 1230
-dqrem934 remainder 123e1 900000000000 -> 1230
-dqrem935 remainder 123e1 90000000000 -> 1230
-dqrem936 remainder 123e1 9000000000 -> 1230
-dqrem937 remainder 123e1 900000000 -> 1230
-dqrem939 remainder 123e1 90000000 -> 1230
-dqrem940 remainder 123e1 9000000 -> 1230
-dqrem941 remainder 123e1 900000 -> 1230
-dqrem942 remainder 123e1 90000 -> 1230
-dqrem943 remainder 123e1 9000 -> 1230
-dqrem944 remainder 123e1 900 -> 330
-dqrem945 remainder 123e1 90 -> 60
-dqrem946 remainder 123e1 9 -> 6
-
-dqrem950 remainder 123e1 1000000000000000 -> 1230
-dqrem961 remainder 123e1 2999999999999999 -> 1230
-dqrem962 remainder 123e1 3999999999999999 -> 1230
-dqrem963 remainder 123e1 4999999999999999 -> 1230
-dqrem964 remainder 123e1 5999999999999999 -> 1230
-dqrem965 remainder 123e1 6999999999999999 -> 1230
-dqrem966 remainder 123e1 7999999999999999 -> 1230
-dqrem967 remainder 123e1 8999999999999999 -> 1230
-dqrem968 remainder 123e1 9999999999999999 -> 1230
-dqrem969 remainder 123e1 9876543210987654 -> 1230
-
-dqrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
-
--- overflow and underflow tests [from divide]
-dqrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
-dqrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
-dqrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
-dqrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
-dqrem1055 remainder 1e-277 1e+311 -> 1E-277
-dqrem1056 remainder 1e-277 -1e+311 -> 1E-277
-dqrem1057 remainder -1e-277 1e+311 -> -1E-277
-dqrem1058 remainder -1e-277 -1e+311 -> -1E-277
-
--- Gyuris example
-dqrem1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
-
--- destructive subtract
-dqrem1120 remainder 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> 0.765432109876543210987654321098768
-dqrem1121 remainder 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> 0.65432109876543210987654321098779
-dqrem1122 remainder 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> 0.5432109876543210987654321098890
-dqrem1123 remainder 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> 2.691358027469135802746913580274687
-dqrem1124 remainder 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692
-dqrem1125 remainder 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> 3.6913578024691357802469135780251
-dqrem1126 remainder 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247
-dqrem1127 remainder 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> 4.246913578024691357802469135780246
-dqrem1128 remainder 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> 4.3086421975308642197530864219759
-
--- Null tests
-dqrem1000 remainder 10 # -> NaN Invalid_operation
-dqrem1001 remainder # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqRemainder.decTest -- decQuad remainder --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks (as base, above)
+dqrem001 remainder 1 1 -> 0
+dqrem002 remainder 2 1 -> 0
+dqrem003 remainder 1 2 -> 1
+dqrem004 remainder 2 2 -> 0
+dqrem005 remainder 0 1 -> 0
+dqrem006 remainder 0 2 -> 0
+dqrem007 remainder 1 3 -> 1
+dqrem008 remainder 2 3 -> 2
+dqrem009 remainder 3 3 -> 0
+
+dqrem010 remainder 2.4 1 -> 0.4
+dqrem011 remainder 2.4 -1 -> 0.4
+dqrem012 remainder -2.4 1 -> -0.4
+dqrem013 remainder -2.4 -1 -> -0.4
+dqrem014 remainder 2.40 1 -> 0.40
+dqrem015 remainder 2.400 1 -> 0.400
+dqrem016 remainder 2.4 2 -> 0.4
+dqrem017 remainder 2.400 2 -> 0.400
+dqrem018 remainder 2. 2 -> 0
+dqrem019 remainder 20 20 -> 0
+
+dqrem020 remainder 187 187 -> 0
+dqrem021 remainder 5 2 -> 1
+dqrem022 remainder 5 2.0 -> 1.0
+dqrem023 remainder 5 2.000 -> 1.000
+dqrem024 remainder 5 0.200 -> 0.000
+dqrem025 remainder 5 0.200 -> 0.000
+
+dqrem030 remainder 1 2 -> 1
+dqrem031 remainder 1 4 -> 1
+dqrem032 remainder 1 8 -> 1
+
+dqrem033 remainder 1 16 -> 1
+dqrem034 remainder 1 32 -> 1
+dqrem035 remainder 1 64 -> 1
+dqrem040 remainder 1 -2 -> 1
+dqrem041 remainder 1 -4 -> 1
+dqrem042 remainder 1 -8 -> 1
+dqrem043 remainder 1 -16 -> 1
+dqrem044 remainder 1 -32 -> 1
+dqrem045 remainder 1 -64 -> 1
+dqrem050 remainder -1 2 -> -1
+dqrem051 remainder -1 4 -> -1
+dqrem052 remainder -1 8 -> -1
+dqrem053 remainder -1 16 -> -1
+dqrem054 remainder -1 32 -> -1
+dqrem055 remainder -1 64 -> -1
+dqrem060 remainder -1 -2 -> -1
+dqrem061 remainder -1 -4 -> -1
+dqrem062 remainder -1 -8 -> -1
+dqrem063 remainder -1 -16 -> -1
+dqrem064 remainder -1 -32 -> -1
+dqrem065 remainder -1 -64 -> -1
+
+dqrem066 remainder 999999999 1 -> 0
+dqrem067 remainder 999999999.4 1 -> 0.4
+dqrem068 remainder 999999999.5 1 -> 0.5
+dqrem069 remainder 999999999.9 1 -> 0.9
+dqrem070 remainder 999999999.999 1 -> 0.999
+dqrem071 remainder 999999.999999 1 -> 0.999999
+dqrem072 remainder 9 1 -> 0
+
+dqrem080 remainder 0. 1 -> 0
+dqrem081 remainder .0 1 -> 0.0
+dqrem082 remainder 0.00 1 -> 0.00
+dqrem083 remainder 0.00E+9 1 -> 0
+dqrem084 remainder 0.00E+3 1 -> 0
+dqrem085 remainder 0.00E+2 1 -> 0
+dqrem086 remainder 0.00E+1 1 -> 0.0
+dqrem087 remainder 0.00E+0 1 -> 0.00
+dqrem088 remainder 0.00E-0 1 -> 0.00
+dqrem089 remainder 0.00E-1 1 -> 0.000
+dqrem090 remainder 0.00E-2 1 -> 0.0000
+dqrem091 remainder 0.00E-3 1 -> 0.00000
+dqrem092 remainder 0.00E-4 1 -> 0.000000
+dqrem093 remainder 0.00E-5 1 -> 0E-7
+dqrem094 remainder 0.00E-6 1 -> 0E-8
+dqrem095 remainder 0.0000E-50 1 -> 0E-54
+
+-- Various flavours of remainder by 0
+dqrem101 remainder 0 0 -> NaN Division_undefined
+dqrem102 remainder 0 -0 -> NaN Division_undefined
+dqrem103 remainder -0 0 -> NaN Division_undefined
+dqrem104 remainder -0 -0 -> NaN Division_undefined
+dqrem105 remainder 0.0E5 0 -> NaN Division_undefined
+dqrem106 remainder 0.000 0 -> NaN Division_undefined
+-- [Some think this next group should be Division_by_zero exception, but
+-- IEEE 854 is explicit that it is Invalid operation .. for
+-- remainder-near, anyway]
+dqrem107 remainder 0.0001 0 -> NaN Invalid_operation
+dqrem108 remainder 0.01 0 -> NaN Invalid_operation
+dqrem109 remainder 0.1 0 -> NaN Invalid_operation
+dqrem110 remainder 1 0 -> NaN Invalid_operation
+dqrem111 remainder 1 0.0 -> NaN Invalid_operation
+dqrem112 remainder 10 0.0 -> NaN Invalid_operation
+dqrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
+dqrem114 remainder 1E+380 0 -> NaN Invalid_operation
+dqrem115 remainder 0.0001 -0 -> NaN Invalid_operation
+dqrem116 remainder 0.01 -0 -> NaN Invalid_operation
+dqrem119 remainder 0.1 -0 -> NaN Invalid_operation
+dqrem120 remainder 1 -0 -> NaN Invalid_operation
+dqrem121 remainder 1 -0.0 -> NaN Invalid_operation
+dqrem122 remainder 10 -0.0 -> NaN Invalid_operation
+dqrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
+dqrem124 remainder 1E+384 -0 -> NaN Invalid_operation
+-- and zeros on left
+dqrem130 remainder 0 1 -> 0
+dqrem131 remainder 0 -1 -> 0
+dqrem132 remainder 0.0 1 -> 0.0
+dqrem133 remainder 0.0 -1 -> 0.0
+dqrem134 remainder -0 1 -> -0
+dqrem135 remainder -0 -1 -> -0
+dqrem136 remainder -0.0 1 -> -0.0
+dqrem137 remainder -0.0 -1 -> -0.0
+
+-- 0.5ers
+dqrem143 remainder 0.5 2 -> 0.5
+dqrem144 remainder 0.5 2.1 -> 0.5
+dqrem145 remainder 0.5 2.01 -> 0.50
+dqrem146 remainder 0.5 2.001 -> 0.500
+dqrem147 remainder 0.50 2 -> 0.50
+dqrem148 remainder 0.50 2.01 -> 0.50
+dqrem149 remainder 0.50 2.001 -> 0.500
+
+-- steadies
+dqrem150 remainder 1 1 -> 0
+dqrem151 remainder 1 2 -> 1
+dqrem152 remainder 1 3 -> 1
+dqrem153 remainder 1 4 -> 1
+dqrem154 remainder 1 5 -> 1
+dqrem155 remainder 1 6 -> 1
+dqrem156 remainder 1 7 -> 1
+dqrem157 remainder 1 8 -> 1
+dqrem158 remainder 1 9 -> 1
+dqrem159 remainder 1 10 -> 1
+dqrem160 remainder 1 1 -> 0
+dqrem161 remainder 2 1 -> 0
+dqrem162 remainder 3 1 -> 0
+dqrem163 remainder 4 1 -> 0
+dqrem164 remainder 5 1 -> 0
+dqrem165 remainder 6 1 -> 0
+dqrem166 remainder 7 1 -> 0
+dqrem167 remainder 8 1 -> 0
+dqrem168 remainder 9 1 -> 0
+dqrem169 remainder 10 1 -> 0
+
+-- some differences from remainderNear
+dqrem171 remainder 0.4 1.020 -> 0.400
+dqrem172 remainder 0.50 1.020 -> 0.500
+dqrem173 remainder 0.51 1.020 -> 0.510
+dqrem174 remainder 0.52 1.020 -> 0.520
+dqrem175 remainder 0.6 1.020 -> 0.600
+
+-- More flavours of remainder by 0
+dqrem201 remainder 0 0 -> NaN Division_undefined
+dqrem202 remainder 0.0E5 0 -> NaN Division_undefined
+dqrem203 remainder 0.000 0 -> NaN Division_undefined
+dqrem204 remainder 0.0001 0 -> NaN Invalid_operation
+dqrem205 remainder 0.01 0 -> NaN Invalid_operation
+dqrem206 remainder 0.1 0 -> NaN Invalid_operation
+dqrem207 remainder 1 0 -> NaN Invalid_operation
+dqrem208 remainder 1 0.0 -> NaN Invalid_operation
+dqrem209 remainder 10 0.0 -> NaN Invalid_operation
+dqrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
+dqrem211 remainder 1E+380 0 -> NaN Invalid_operation
+
+-- some differences from remainderNear
+dqrem231 remainder -0.4 1.020 -> -0.400
+dqrem232 remainder -0.50 1.020 -> -0.500
+dqrem233 remainder -0.51 1.020 -> -0.510
+dqrem234 remainder -0.52 1.020 -> -0.520
+dqrem235 remainder -0.6 1.020 -> -0.600
+
+-- high Xs
+dqrem240 remainder 1E+2 1.00 -> 0.00
+
+-- dqrem3xx are from DiagBigDecimal
+dqrem301 remainder 1 3 -> 1
+dqrem302 remainder 5 5 -> 0
+dqrem303 remainder 13 10 -> 3
+dqrem304 remainder 13 50 -> 13
+dqrem305 remainder 13 100 -> 13
+dqrem306 remainder 13 1000 -> 13
+dqrem307 remainder .13 1 -> 0.13
+dqrem308 remainder 0.133 1 -> 0.133
+dqrem309 remainder 0.1033 1 -> 0.1033
+dqrem310 remainder 1.033 1 -> 0.033
+dqrem311 remainder 10.33 1 -> 0.33
+dqrem312 remainder 10.33 10 -> 0.33
+dqrem313 remainder 103.3 1 -> 0.3
+dqrem314 remainder 133 10 -> 3
+dqrem315 remainder 1033 10 -> 3
+dqrem316 remainder 1033 50 -> 33
+dqrem317 remainder 101.0 3 -> 2.0
+dqrem318 remainder 102.0 3 -> 0.0
+dqrem319 remainder 103.0 3 -> 1.0
+dqrem320 remainder 2.40 1 -> 0.40
+dqrem321 remainder 2.400 1 -> 0.400
+dqrem322 remainder 2.4 1 -> 0.4
+dqrem323 remainder 2.4 2 -> 0.4
+dqrem324 remainder 2.400 2 -> 0.400
+dqrem325 remainder 1 0.3 -> 0.1
+dqrem326 remainder 1 0.30 -> 0.10
+dqrem327 remainder 1 0.300 -> 0.100
+dqrem328 remainder 1 0.3000 -> 0.1000
+dqrem329 remainder 1.0 0.3 -> 0.1
+dqrem330 remainder 1.00 0.3 -> 0.10
+dqrem331 remainder 1.000 0.3 -> 0.100
+dqrem332 remainder 1.0000 0.3 -> 0.1000
+dqrem333 remainder 0.5 2 -> 0.5
+dqrem334 remainder 0.5 2.1 -> 0.5
+dqrem335 remainder 0.5 2.01 -> 0.50
+dqrem336 remainder 0.5 2.001 -> 0.500
+dqrem337 remainder 0.50 2 -> 0.50
+dqrem338 remainder 0.50 2.01 -> 0.50
+dqrem339 remainder 0.50 2.001 -> 0.500
+
+dqrem340 remainder 0.5 0.5000001 -> 0.5000000
+dqrem341 remainder 0.5 0.50000001 -> 0.50000000
+dqrem342 remainder 0.5 0.500000001 -> 0.500000000
+dqrem343 remainder 0.5 0.5000000001 -> 0.5000000000
+dqrem344 remainder 0.5 0.50000000001 -> 0.50000000000
+dqrem345 remainder 0.5 0.4999999 -> 1E-7
+dqrem346 remainder 0.5 0.49999999 -> 1E-8
+dqrem347 remainder 0.5 0.499999999 -> 1E-9
+dqrem348 remainder 0.5 0.4999999999 -> 1E-10
+dqrem349 remainder 0.5 0.49999999999 -> 1E-11
+dqrem350 remainder 0.5 0.499999999999 -> 1E-12
+
+dqrem351 remainder 0.03 7 -> 0.03
+dqrem352 remainder 5 2 -> 1
+dqrem353 remainder 4.1 2 -> 0.1
+dqrem354 remainder 4.01 2 -> 0.01
+dqrem355 remainder 4.001 2 -> 0.001
+dqrem356 remainder 4.0001 2 -> 0.0001
+dqrem357 remainder 4.00001 2 -> 0.00001
+dqrem358 remainder 4.000001 2 -> 0.000001
+dqrem359 remainder 4.0000001 2 -> 1E-7
+
+dqrem360 remainder 1.2 0.7345 -> 0.4655
+dqrem361 remainder 0.8 12 -> 0.8
+dqrem362 remainder 0.8 0.2 -> 0.0
+dqrem363 remainder 0.8 0.3 -> 0.2
+dqrem364 remainder 0.800 12 -> 0.800
+dqrem365 remainder 0.800 1.7 -> 0.800
+dqrem366 remainder 2.400 2 -> 0.400
+
+dqrem371 remainder 2.400 2 -> 0.400
+
+dqrem381 remainder 12345 1 -> 0
+dqrem382 remainder 12345 1.0001 -> 0.7657
+dqrem383 remainder 12345 1.001 -> 0.668
+dqrem384 remainder 12345 1.01 -> 0.78
+dqrem385 remainder 12345 1.1 -> 0.8
+dqrem386 remainder 12355 4 -> 3
+dqrem387 remainder 12345 4 -> 1
+dqrem388 remainder 12355 4.0001 -> 2.6912
+dqrem389 remainder 12345 4.0001 -> 0.6914
+dqrem390 remainder 12345 4.9 -> 1.9
+dqrem391 remainder 12345 4.99 -> 4.73
+dqrem392 remainder 12345 4.999 -> 2.469
+dqrem393 remainder 12345 4.9999 -> 0.2469
+dqrem394 remainder 12345 5 -> 0
+dqrem395 remainder 12345 5.0001 -> 4.7532
+dqrem396 remainder 12345 5.001 -> 2.532
+dqrem397 remainder 12345 5.01 -> 0.36
+dqrem398 remainder 12345 5.1 -> 3.0
+
+-- the nasty division-by-1 cases
+dqrem401 remainder 0.5 1 -> 0.5
+dqrem402 remainder 0.55 1 -> 0.55
+dqrem403 remainder 0.555 1 -> 0.555
+dqrem404 remainder 0.5555 1 -> 0.5555
+dqrem405 remainder 0.55555 1 -> 0.55555
+dqrem406 remainder 0.555555 1 -> 0.555555
+dqrem407 remainder 0.5555555 1 -> 0.5555555
+dqrem408 remainder 0.55555555 1 -> 0.55555555
+dqrem409 remainder 0.555555555 1 -> 0.555555555
+
+-- folddowns
+dqrem421 remainder 1E+6144 1 -> NaN Division_impossible
+dqrem422 remainder 1E+6144 1E+6143 -> 0E+6111 Clamped
+dqrem423 remainder 1E+6144 2E+6143 -> 0E+6111 Clamped
+dqrem424 remainder 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqrem425 remainder 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
+dqrem426 remainder 1E+6144 5E+6143 -> 0E+6111 Clamped
+dqrem427 remainder 1E+6144 6E+6143 -> 4.00000000000000000000000000000000E+6143 Clamped
+dqrem428 remainder 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped
+dqrem429 remainder 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
+dqrem430 remainder 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
+-- tinies
+dqrem431 remainder 1E-6175 1E-6176 -> 0E-6176
+dqrem432 remainder 1E-6175 2E-6176 -> 0E-6176
+dqrem433 remainder 1E-6175 3E-6176 -> 1E-6176 Subnormal
+dqrem434 remainder 1E-6175 4E-6176 -> 2E-6176 Subnormal
+dqrem435 remainder 1E-6175 5E-6176 -> 0E-6176
+dqrem436 remainder 1E-6175 6E-6176 -> 4E-6176 Subnormal
+dqrem437 remainder 1E-6175 7E-6176 -> 3E-6176 Subnormal
+dqrem438 remainder 1E-6175 8E-6176 -> 2E-6176 Subnormal
+dqrem439 remainder 1E-6175 9E-6176 -> 1E-6176 Subnormal
+dqrem440 remainder 1E-6175 10E-6176 -> 0E-6176
+dqrem441 remainder 1E-6175 11E-6176 -> 1.0E-6175 Subnormal
+dqrem442 remainder 100E-6175 11E-6176 -> 1.0E-6175 Subnormal
+dqrem443 remainder 100E-6175 20E-6176 -> 0E-6176
+dqrem444 remainder 100E-6175 21E-6176 -> 1.3E-6175 Subnormal
+dqrem445 remainder 100E-6175 30E-6176 -> 1.0E-6175 Subnormal
+
+-- zero signs
+dqrem650 remainder 1 1 -> 0
+dqrem651 remainder -1 1 -> -0
+dqrem652 remainder 1 -1 -> 0
+dqrem653 remainder -1 -1 -> -0
+dqrem654 remainder 0 1 -> 0
+dqrem655 remainder -0 1 -> -0
+dqrem656 remainder 0 -1 -> 0
+dqrem657 remainder -0 -1 -> -0
+dqrem658 remainder 0.00 1 -> 0.00
+dqrem659 remainder -0.00 1 -> -0.00
+
+-- Specials
+dqrem680 remainder Inf -Inf -> NaN Invalid_operation
+dqrem681 remainder Inf -1000 -> NaN Invalid_operation
+dqrem682 remainder Inf -1 -> NaN Invalid_operation
+dqrem683 remainder Inf 0 -> NaN Invalid_operation
+dqrem684 remainder Inf -0 -> NaN Invalid_operation
+dqrem685 remainder Inf 1 -> NaN Invalid_operation
+dqrem686 remainder Inf 1000 -> NaN Invalid_operation
+dqrem687 remainder Inf Inf -> NaN Invalid_operation
+dqrem688 remainder -1000 Inf -> -1000
+dqrem689 remainder -Inf Inf -> NaN Invalid_operation
+dqrem691 remainder -1 Inf -> -1
+dqrem692 remainder 0 Inf -> 0
+dqrem693 remainder -0 Inf -> -0
+dqrem694 remainder 1 Inf -> 1
+dqrem695 remainder 1000 Inf -> 1000
+dqrem696 remainder Inf Inf -> NaN Invalid_operation
+
+dqrem700 remainder -Inf -Inf -> NaN Invalid_operation
+dqrem701 remainder -Inf -1000 -> NaN Invalid_operation
+dqrem702 remainder -Inf -1 -> NaN Invalid_operation
+dqrem703 remainder -Inf -0 -> NaN Invalid_operation
+dqrem704 remainder -Inf 0 -> NaN Invalid_operation
+dqrem705 remainder -Inf 1 -> NaN Invalid_operation
+dqrem706 remainder -Inf 1000 -> NaN Invalid_operation
+dqrem707 remainder -Inf Inf -> NaN Invalid_operation
+dqrem708 remainder -Inf -Inf -> NaN Invalid_operation
+dqrem709 remainder -1000 Inf -> -1000
+dqrem710 remainder -1 -Inf -> -1
+dqrem711 remainder -0 -Inf -> -0
+dqrem712 remainder 0 -Inf -> 0
+dqrem713 remainder 1 -Inf -> 1
+dqrem714 remainder 1000 -Inf -> 1000
+dqrem715 remainder Inf -Inf -> NaN Invalid_operation
+
+dqrem721 remainder NaN -Inf -> NaN
+dqrem722 remainder NaN -1000 -> NaN
+dqrem723 remainder NaN -1 -> NaN
+dqrem724 remainder NaN -0 -> NaN
+dqrem725 remainder -NaN 0 -> -NaN
+dqrem726 remainder NaN 1 -> NaN
+dqrem727 remainder NaN 1000 -> NaN
+dqrem728 remainder NaN Inf -> NaN
+dqrem729 remainder NaN -NaN -> NaN
+dqrem730 remainder -Inf NaN -> NaN
+dqrem731 remainder -1000 NaN -> NaN
+dqrem732 remainder -1 NaN -> NaN
+dqrem733 remainder -0 -NaN -> -NaN
+dqrem734 remainder 0 NaN -> NaN
+dqrem735 remainder 1 -NaN -> -NaN
+dqrem736 remainder 1000 NaN -> NaN
+dqrem737 remainder Inf NaN -> NaN
+
+dqrem741 remainder sNaN -Inf -> NaN Invalid_operation
+dqrem742 remainder sNaN -1000 -> NaN Invalid_operation
+dqrem743 remainder -sNaN -1 -> -NaN Invalid_operation
+dqrem744 remainder sNaN -0 -> NaN Invalid_operation
+dqrem745 remainder sNaN 0 -> NaN Invalid_operation
+dqrem746 remainder sNaN 1 -> NaN Invalid_operation
+dqrem747 remainder sNaN 1000 -> NaN Invalid_operation
+dqrem749 remainder sNaN NaN -> NaN Invalid_operation
+dqrem750 remainder sNaN sNaN -> NaN Invalid_operation
+dqrem751 remainder NaN sNaN -> NaN Invalid_operation
+dqrem752 remainder -Inf sNaN -> NaN Invalid_operation
+dqrem753 remainder -1000 sNaN -> NaN Invalid_operation
+dqrem754 remainder -1 sNaN -> NaN Invalid_operation
+dqrem755 remainder -0 sNaN -> NaN Invalid_operation
+dqrem756 remainder 0 sNaN -> NaN Invalid_operation
+dqrem757 remainder 1 sNaN -> NaN Invalid_operation
+dqrem758 remainder 1000 sNaN -> NaN Invalid_operation
+dqrem759 remainder Inf -sNaN -> -NaN Invalid_operation
+
+-- propaging NaNs
+dqrem760 remainder NaN1 NaN7 -> NaN1
+dqrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
+dqrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
+dqrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
+dqrem764 remainder 15 NaN11 -> NaN11
+dqrem765 remainder NaN6 NaN12 -> NaN6
+dqrem766 remainder Inf NaN13 -> NaN13
+dqrem767 remainder NaN14 -Inf -> NaN14
+dqrem768 remainder 0 NaN15 -> NaN15
+dqrem769 remainder NaN16 -0 -> NaN16
+
+-- edge cases of impossible
+dqrem770 remainder 1234568888888887777777777890123456 10 -> 6
+dqrem771 remainder 1234568888888887777777777890123456 1 -> 0
+dqrem772 remainder 1234568888888887777777777890123456 0.1 -> NaN Division_impossible
+dqrem773 remainder 1234568888888887777777777890123456 0.01 -> NaN Division_impossible
+
+-- long operand checks
+dqrem801 remainder 12345678000 100 -> 0
+dqrem802 remainder 1 12345678000 -> 1
+dqrem803 remainder 1234567800 10 -> 0
+dqrem804 remainder 1 1234567800 -> 1
+dqrem805 remainder 1234567890 10 -> 0
+dqrem806 remainder 1 1234567890 -> 1
+dqrem807 remainder 1234567891 10 -> 1
+dqrem808 remainder 1 1234567891 -> 1
+dqrem809 remainder 12345678901 100 -> 1
+dqrem810 remainder 1 12345678901 -> 1
+dqrem811 remainder 1234567896 10 -> 6
+dqrem812 remainder 1 1234567896 -> 1
+
+dqrem821 remainder 12345678000 100 -> 0
+dqrem822 remainder 1 12345678000 -> 1
+dqrem823 remainder 1234567800 10 -> 0
+dqrem824 remainder 1 1234567800 -> 1
+dqrem825 remainder 1234567890 10 -> 0
+dqrem826 remainder 1 1234567890 -> 1
+dqrem827 remainder 1234567891 10 -> 1
+dqrem828 remainder 1 1234567891 -> 1
+dqrem829 remainder 12345678901 100 -> 1
+dqrem830 remainder 1 12345678901 -> 1
+dqrem831 remainder 1234567896 10 -> 6
+dqrem832 remainder 1 1234567896 -> 1
+
+-- from divideint
+dqrem840 remainder 100000000.0 1 -> 0.0
+dqrem841 remainder 100000000.4 1 -> 0.4
+dqrem842 remainder 100000000.5 1 -> 0.5
+dqrem843 remainder 100000000.9 1 -> 0.9
+dqrem844 remainder 100000000.999 1 -> 0.999
+dqrem850 remainder 100000003 5 -> 3
+dqrem851 remainder 10000003 5 -> 3
+dqrem852 remainder 1000003 5 -> 3
+dqrem853 remainder 100003 5 -> 3
+dqrem854 remainder 10003 5 -> 3
+dqrem855 remainder 1003 5 -> 3
+dqrem856 remainder 103 5 -> 3
+dqrem857 remainder 13 5 -> 3
+dqrem858 remainder 1 5 -> 1
+
+-- Vladimir's cases 1234567890123456
+dqrem860 remainder 123.0e1 1000000000000000 -> 1230
+dqrem861 remainder 1230 1000000000000000 -> 1230
+dqrem862 remainder 12.3e2 1000000000000000 -> 1230
+dqrem863 remainder 1.23e3 1000000000000000 -> 1230
+dqrem864 remainder 123e1 1000000000000000 -> 1230
+dqrem870 remainder 123e1 1000000000000000 -> 1230
+dqrem871 remainder 123e1 100000000000000 -> 1230
+dqrem872 remainder 123e1 10000000000000 -> 1230
+dqrem873 remainder 123e1 1000000000000 -> 1230
+dqrem874 remainder 123e1 100000000000 -> 1230
+dqrem875 remainder 123e1 10000000000 -> 1230
+dqrem876 remainder 123e1 1000000000 -> 1230
+dqrem877 remainder 123e1 100000000 -> 1230
+dqrem878 remainder 1230 100000000 -> 1230
+dqrem879 remainder 123e1 10000000 -> 1230
+dqrem880 remainder 123e1 1000000 -> 1230
+dqrem881 remainder 123e1 100000 -> 1230
+dqrem882 remainder 123e1 10000 -> 1230
+dqrem883 remainder 123e1 1000 -> 230
+dqrem884 remainder 123e1 100 -> 30
+dqrem885 remainder 123e1 10 -> 0
+dqrem886 remainder 123e1 1 -> 0
+
+dqrem890 remainder 123e1 2000000000000000 -> 1230
+dqrem891 remainder 123e1 200000000000000 -> 1230
+dqrem892 remainder 123e1 20000000000000 -> 1230
+dqrem893 remainder 123e1 2000000000000 -> 1230
+dqrem894 remainder 123e1 200000000000 -> 1230
+dqrem895 remainder 123e1 20000000000 -> 1230
+dqrem896 remainder 123e1 2000000000 -> 1230
+dqrem897 remainder 123e1 200000000 -> 1230
+dqrem899 remainder 123e1 20000000 -> 1230
+dqrem900 remainder 123e1 2000000 -> 1230
+dqrem901 remainder 123e1 200000 -> 1230
+dqrem902 remainder 123e1 20000 -> 1230
+dqrem903 remainder 123e1 2000 -> 1230
+dqrem904 remainder 123e1 200 -> 30
+dqrem905 remainder 123e1 20 -> 10
+dqrem906 remainder 123e1 2 -> 0
+
+dqrem910 remainder 123e1 5000000000000000 -> 1230
+dqrem911 remainder 123e1 500000000000000 -> 1230
+dqrem912 remainder 123e1 50000000000000 -> 1230
+dqrem913 remainder 123e1 5000000000000 -> 1230
+dqrem914 remainder 123e1 500000000000 -> 1230
+dqrem915 remainder 123e1 50000000000 -> 1230
+dqrem916 remainder 123e1 5000000000 -> 1230
+dqrem917 remainder 123e1 500000000 -> 1230
+dqrem919 remainder 123e1 50000000 -> 1230
+dqrem920 remainder 123e1 5000000 -> 1230
+dqrem921 remainder 123e1 500000 -> 1230
+dqrem922 remainder 123e1 50000 -> 1230
+dqrem923 remainder 123e1 5000 -> 1230
+dqrem924 remainder 123e1 500 -> 230
+dqrem925 remainder 123e1 50 -> 30
+dqrem926 remainder 123e1 5 -> 0
+
+dqrem930 remainder 123e1 9000000000000000 -> 1230
+dqrem931 remainder 123e1 900000000000000 -> 1230
+dqrem932 remainder 123e1 90000000000000 -> 1230
+dqrem933 remainder 123e1 9000000000000 -> 1230
+dqrem934 remainder 123e1 900000000000 -> 1230
+dqrem935 remainder 123e1 90000000000 -> 1230
+dqrem936 remainder 123e1 9000000000 -> 1230
+dqrem937 remainder 123e1 900000000 -> 1230
+dqrem939 remainder 123e1 90000000 -> 1230
+dqrem940 remainder 123e1 9000000 -> 1230
+dqrem941 remainder 123e1 900000 -> 1230
+dqrem942 remainder 123e1 90000 -> 1230
+dqrem943 remainder 123e1 9000 -> 1230
+dqrem944 remainder 123e1 900 -> 330
+dqrem945 remainder 123e1 90 -> 60
+dqrem946 remainder 123e1 9 -> 6
+
+dqrem950 remainder 123e1 1000000000000000 -> 1230
+dqrem961 remainder 123e1 2999999999999999 -> 1230
+dqrem962 remainder 123e1 3999999999999999 -> 1230
+dqrem963 remainder 123e1 4999999999999999 -> 1230
+dqrem964 remainder 123e1 5999999999999999 -> 1230
+dqrem965 remainder 123e1 6999999999999999 -> 1230
+dqrem966 remainder 123e1 7999999999999999 -> 1230
+dqrem967 remainder 123e1 8999999999999999 -> 1230
+dqrem968 remainder 123e1 9999999999999999 -> 1230
+dqrem969 remainder 123e1 9876543210987654 -> 1230
+
+dqrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
+
+-- overflow and underflow tests [from divide]
+dqrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
+dqrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
+dqrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
+dqrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
+dqrem1055 remainder 1e-277 1e+311 -> 1E-277
+dqrem1056 remainder 1e-277 -1e+311 -> 1E-277
+dqrem1057 remainder -1e-277 1e+311 -> -1E-277
+dqrem1058 remainder -1e-277 -1e+311 -> -1E-277
+
+-- Gyuris example
+dqrem1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
+
+-- destructive subtract
+dqrem1120 remainder 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> 0.765432109876543210987654321098768
+dqrem1121 remainder 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> 0.65432109876543210987654321098779
+dqrem1122 remainder 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> 0.5432109876543210987654321098890
+dqrem1123 remainder 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> 2.691358027469135802746913580274687
+dqrem1124 remainder 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692
+dqrem1125 remainder 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> 3.6913578024691357802469135780251
+dqrem1126 remainder 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247
+dqrem1127 remainder 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> 4.246913578024691357802469135780246
+dqrem1128 remainder 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> 4.3086421975308642197530864219759
+
+-- Null tests
+dqrem1000 remainder 10 # -> NaN Invalid_operation
+dqrem1001 remainder # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqRemainderNear.decTest b/Lib/test/decimaltestdata/dqRemainderNear.decTest
index 0dd273fe38..b850626fe4 100644
--- a/Lib/test/decimaltestdata/dqRemainderNear.decTest
+++ b/Lib/test/decimaltestdata/dqRemainderNear.decTest
@@ -1,631 +1,631 @@
-------------------------------------------------------------------------
--- dqRemainderNear.decTest -- decQuad remainder-near --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks (as base, above)
-dqrmn001 remaindernear 1 1 -> 0
-dqrmn002 remaindernear 2 1 -> 0
-dqrmn003 remaindernear 1 2 -> 1
-dqrmn004 remaindernear 2 2 -> 0
-dqrmn005 remaindernear 0 1 -> 0
-dqrmn006 remaindernear 0 2 -> 0
-dqrmn007 remaindernear 1 3 -> 1
-dqrmn008 remaindernear 2 3 -> -1
-dqrmn009 remaindernear 3 3 -> 0
-
-dqrmn010 remaindernear 2.4 1 -> 0.4
-dqrmn011 remaindernear 2.4 -1 -> 0.4
-dqrmn012 remaindernear -2.4 1 -> -0.4
-dqrmn013 remaindernear -2.4 -1 -> -0.4
-dqrmn014 remaindernear 2.40 1 -> 0.40
-dqrmn015 remaindernear 2.400 1 -> 0.400
-dqrmn016 remaindernear 2.4 2 -> 0.4
-dqrmn017 remaindernear 2.400 2 -> 0.400
-dqrmn018 remaindernear 2. 2 -> 0
-dqrmn019 remaindernear 20 20 -> 0
-
-dqrmn020 remaindernear 187 187 -> 0
-dqrmn021 remaindernear 5 2 -> 1
-dqrmn022 remaindernear 5 2.0 -> 1.0
-dqrmn023 remaindernear 5 2.000 -> 1.000
-dqrmn024 remaindernear 5 0.200 -> 0.000
-dqrmn025 remaindernear 5 0.200 -> 0.000
-
-dqrmn030 remaindernear 1 2 -> 1
-dqrmn031 remaindernear 1 4 -> 1
-dqrmn032 remaindernear 1 8 -> 1
-
-dqrmn033 remaindernear 1 16 -> 1
-dqrmn034 remaindernear 1 32 -> 1
-dqrmn035 remaindernear 1 64 -> 1
-dqrmn040 remaindernear 1 -2 -> 1
-dqrmn041 remaindernear 1 -4 -> 1
-dqrmn042 remaindernear 1 -8 -> 1
-dqrmn043 remaindernear 1 -16 -> 1
-dqrmn044 remaindernear 1 -32 -> 1
-dqrmn045 remaindernear 1 -64 -> 1
-dqrmn050 remaindernear -1 2 -> -1
-dqrmn051 remaindernear -1 4 -> -1
-dqrmn052 remaindernear -1 8 -> -1
-dqrmn053 remaindernear -1 16 -> -1
-dqrmn054 remaindernear -1 32 -> -1
-dqrmn055 remaindernear -1 64 -> -1
-dqrmn060 remaindernear -1 -2 -> -1
-dqrmn061 remaindernear -1 -4 -> -1
-dqrmn062 remaindernear -1 -8 -> -1
-dqrmn063 remaindernear -1 -16 -> -1
-dqrmn064 remaindernear -1 -32 -> -1
-dqrmn065 remaindernear -1 -64 -> -1
-
-dqrmn066 remaindernear 9.9 1 -> -0.1
-dqrmn067 remaindernear 99.7 1 -> -0.3
-dqrmn068 remaindernear 999999999 1 -> 0
-dqrmn069 remaindernear 999999999.4 1 -> 0.4
-dqrmn070 remaindernear 999999999.5 1 -> -0.5
-dqrmn071 remaindernear 999999999.9 1 -> -0.1
-dqrmn072 remaindernear 999999999.999 1 -> -0.001
-dqrmn073 remaindernear 999999.999999 1 -> -0.000001
-dqrmn074 remaindernear 9 1 -> 0
-dqrmn075 remaindernear 9999999999999999 1 -> 0
-dqrmn076 remaindernear 9999999999999999 2 -> -1
-dqrmn077 remaindernear 9999999999999999 3 -> 0
-dqrmn078 remaindernear 9999999999999999 4 -> -1
-
-dqrmn080 remaindernear 0. 1 -> 0
-dqrmn081 remaindernear .0 1 -> 0.0
-dqrmn082 remaindernear 0.00 1 -> 0.00
-dqrmn083 remaindernear 0.00E+9 1 -> 0
-dqrmn084 remaindernear 0.00E+3 1 -> 0
-dqrmn085 remaindernear 0.00E+2 1 -> 0
-dqrmn086 remaindernear 0.00E+1 1 -> 0.0
-dqrmn087 remaindernear 0.00E+0 1 -> 0.00
-dqrmn088 remaindernear 0.00E-0 1 -> 0.00
-dqrmn089 remaindernear 0.00E-1 1 -> 0.000
-dqrmn090 remaindernear 0.00E-2 1 -> 0.0000
-dqrmn091 remaindernear 0.00E-3 1 -> 0.00000
-dqrmn092 remaindernear 0.00E-4 1 -> 0.000000
-dqrmn093 remaindernear 0.00E-5 1 -> 0E-7
-dqrmn094 remaindernear 0.00E-6 1 -> 0E-8
-dqrmn095 remaindernear 0.0000E-50 1 -> 0E-54
-
--- Various flavours of remaindernear by 0
-dqrmn101 remaindernear 0 0 -> NaN Division_undefined
-dqrmn102 remaindernear 0 -0 -> NaN Division_undefined
-dqrmn103 remaindernear -0 0 -> NaN Division_undefined
-dqrmn104 remaindernear -0 -0 -> NaN Division_undefined
-dqrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined
-dqrmn106 remaindernear 0.000 0 -> NaN Division_undefined
--- [Some think this next group should be Division_by_zero exception, but
--- IEEE 854 is explicit that it is Invalid operation .. for
--- remainder-near, anyway]
-dqrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation
-dqrmn108 remaindernear 0.01 0 -> NaN Invalid_operation
-dqrmn109 remaindernear 0.1 0 -> NaN Invalid_operation
-dqrmn110 remaindernear 1 0 -> NaN Invalid_operation
-dqrmn111 remaindernear 1 0.0 -> NaN Invalid_operation
-dqrmn112 remaindernear 10 0.0 -> NaN Invalid_operation
-dqrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation
-dqrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation
-dqrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation
-dqrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation
-dqrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation
-dqrmn120 remaindernear 1 -0 -> NaN Invalid_operation
-dqrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation
-dqrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation
-dqrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation
-dqrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation
--- and zeros on left
-dqrmn130 remaindernear 0 1 -> 0
-dqrmn131 remaindernear 0 -1 -> 0
-dqrmn132 remaindernear 0.0 1 -> 0.0
-dqrmn133 remaindernear 0.0 -1 -> 0.0
-dqrmn134 remaindernear -0 1 -> -0
-dqrmn135 remaindernear -0 -1 -> -0
-dqrmn136 remaindernear -0.0 1 -> -0.0
-dqrmn137 remaindernear -0.0 -1 -> -0.0
-
--- 0.5ers
-dqrmn143 remaindernear 0.5 2 -> 0.5
-dqrmn144 remaindernear 0.5 2.1 -> 0.5
-dqrmn145 remaindernear 0.5 2.01 -> 0.50
-dqrmn146 remaindernear 0.5 2.001 -> 0.500
-dqrmn147 remaindernear 0.50 2 -> 0.50
-dqrmn148 remaindernear 0.50 2.01 -> 0.50
-dqrmn149 remaindernear 0.50 2.001 -> 0.500
-
--- steadies
-dqrmn150 remaindernear 1 1 -> 0
-dqrmn151 remaindernear 1 2 -> 1
-dqrmn152 remaindernear 1 3 -> 1
-dqrmn153 remaindernear 1 4 -> 1
-dqrmn154 remaindernear 1 5 -> 1
-dqrmn155 remaindernear 1 6 -> 1
-dqrmn156 remaindernear 1 7 -> 1
-dqrmn157 remaindernear 1 8 -> 1
-dqrmn158 remaindernear 1 9 -> 1
-dqrmn159 remaindernear 1 10 -> 1
-dqrmn160 remaindernear 1 1 -> 0
-dqrmn161 remaindernear 2 1 -> 0
-dqrmn162 remaindernear 3 1 -> 0
-dqrmn163 remaindernear 4 1 -> 0
-dqrmn164 remaindernear 5 1 -> 0
-dqrmn165 remaindernear 6 1 -> 0
-dqrmn166 remaindernear 7 1 -> 0
-dqrmn167 remaindernear 8 1 -> 0
-dqrmn168 remaindernear 9 1 -> 0
-dqrmn169 remaindernear 10 1 -> 0
-
--- some differences from remainder
-dqrmn171 remaindernear 0.4 1.020 -> 0.400
-dqrmn172 remaindernear 0.50 1.020 -> 0.500
-dqrmn173 remaindernear 0.51 1.020 -> 0.510
-dqrmn174 remaindernear 0.52 1.020 -> -0.500
-dqrmn175 remaindernear 0.6 1.020 -> -0.420
-
--- More flavours of remaindernear by 0
-dqrmn201 remaindernear 0 0 -> NaN Division_undefined
-dqrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined
-dqrmn203 remaindernear 0.000 0 -> NaN Division_undefined
-dqrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation
-dqrmn205 remaindernear 0.01 0 -> NaN Invalid_operation
-dqrmn206 remaindernear 0.1 0 -> NaN Invalid_operation
-dqrmn207 remaindernear 1 0 -> NaN Invalid_operation
-dqrmn208 remaindernear 1 0.0 -> NaN Invalid_operation
-dqrmn209 remaindernear 10 0.0 -> NaN Invalid_operation
-dqrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation
-dqrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation
-
--- tests from the extended specification
-dqrmn221 remaindernear 2.1 3 -> -0.9
-dqrmn222 remaindernear 10 6 -> -2
-dqrmn223 remaindernear 10 3 -> 1
-dqrmn224 remaindernear -10 3 -> -1
-dqrmn225 remaindernear 10.2 1 -> 0.2
-dqrmn226 remaindernear 10 0.3 -> 0.1
-dqrmn227 remaindernear 3.6 1.3 -> -0.3
-
--- some differences from remainder
-dqrmn231 remaindernear -0.4 1.020 -> -0.400
-dqrmn232 remaindernear -0.50 1.020 -> -0.500
-dqrmn233 remaindernear -0.51 1.020 -> -0.510
-dqrmn234 remaindernear -0.52 1.020 -> 0.500
-dqrmn235 remaindernear -0.6 1.020 -> 0.420
-
--- high Xs
-dqrmn240 remaindernear 1E+2 1.00 -> 0.00
-
--- dqrmn3xx are from DiagBigDecimal
-dqrmn301 remaindernear 1 3 -> 1
-dqrmn302 remaindernear 5 5 -> 0
-dqrmn303 remaindernear 13 10 -> 3
-dqrmn304 remaindernear 13 50 -> 13
-dqrmn305 remaindernear 13 100 -> 13
-dqrmn306 remaindernear 13 1000 -> 13
-dqrmn307 remaindernear .13 1 -> 0.13
-dqrmn308 remaindernear 0.133 1 -> 0.133
-dqrmn309 remaindernear 0.1033 1 -> 0.1033
-dqrmn310 remaindernear 1.033 1 -> 0.033
-dqrmn311 remaindernear 10.33 1 -> 0.33
-dqrmn312 remaindernear 10.33 10 -> 0.33
-dqrmn313 remaindernear 103.3 1 -> 0.3
-dqrmn314 remaindernear 133 10 -> 3
-dqrmn315 remaindernear 1033 10 -> 3
-dqrmn316 remaindernear 1033 50 -> -17
-dqrmn317 remaindernear 101.0 3 -> -1.0
-dqrmn318 remaindernear 102.0 3 -> 0.0
-dqrmn319 remaindernear 103.0 3 -> 1.0
-dqrmn320 remaindernear 2.40 1 -> 0.40
-dqrmn321 remaindernear 2.400 1 -> 0.400
-dqrmn322 remaindernear 2.4 1 -> 0.4
-dqrmn323 remaindernear 2.4 2 -> 0.4
-dqrmn324 remaindernear 2.400 2 -> 0.400
-dqrmn325 remaindernear 1 0.3 -> 0.1
-dqrmn326 remaindernear 1 0.30 -> 0.10
-dqrmn327 remaindernear 1 0.300 -> 0.100
-dqrmn328 remaindernear 1 0.3000 -> 0.1000
-dqrmn329 remaindernear 1.0 0.3 -> 0.1
-dqrmn330 remaindernear 1.00 0.3 -> 0.10
-dqrmn331 remaindernear 1.000 0.3 -> 0.100
-dqrmn332 remaindernear 1.0000 0.3 -> 0.1000
-dqrmn333 remaindernear 0.5 2 -> 0.5
-dqrmn334 remaindernear 0.5 2.1 -> 0.5
-dqrmn335 remaindernear 0.5 2.01 -> 0.50
-dqrmn336 remaindernear 0.5 2.001 -> 0.500
-dqrmn337 remaindernear 0.50 2 -> 0.50
-dqrmn338 remaindernear 0.50 2.01 -> 0.50
-dqrmn339 remaindernear 0.50 2.001 -> 0.500
-
-dqrmn340 remaindernear 0.5 0.5000001 -> -1E-7
-dqrmn341 remaindernear 0.5 0.50000001 -> -1E-8
-dqrmn342 remaindernear 0.5 0.500000001 -> -1E-9
-dqrmn343 remaindernear 0.5 0.5000000001 -> -1E-10
-dqrmn344 remaindernear 0.5 0.50000000001 -> -1E-11
-dqrmn345 remaindernear 0.5 0.4999999 -> 1E-7
-dqrmn346 remaindernear 0.5 0.49999999 -> 1E-8
-dqrmn347 remaindernear 0.5 0.499999999 -> 1E-9
-dqrmn348 remaindernear 0.5 0.4999999999 -> 1E-10
-dqrmn349 remaindernear 0.5 0.49999999999 -> 1E-11
-dqrmn350 remaindernear 0.5 0.499999999999 -> 1E-12
-
-dqrmn351 remaindernear 0.03 7 -> 0.03
-dqrmn352 remaindernear 5 2 -> 1
-dqrmn353 remaindernear 4.1 2 -> 0.1
-dqrmn354 remaindernear 4.01 2 -> 0.01
-dqrmn355 remaindernear 4.001 2 -> 0.001
-dqrmn356 remaindernear 4.0001 2 -> 0.0001
-dqrmn357 remaindernear 4.00001 2 -> 0.00001
-dqrmn358 remaindernear 4.000001 2 -> 0.000001
-dqrmn359 remaindernear 4.0000001 2 -> 1E-7
-
-dqrmn360 remaindernear 1.2 0.7345 -> -0.2690
-dqrmn361 remaindernear 0.8 12 -> 0.8
-dqrmn362 remaindernear 0.8 0.2 -> 0.0
-dqrmn363 remaindernear 0.8 0.3 -> -0.1
-dqrmn364 remaindernear 0.800 12 -> 0.800
-dqrmn365 remaindernear 0.800 1.7 -> 0.800
-dqrmn366 remaindernear 2.400 2 -> 0.400
-
--- round to even
-dqrmn371 remaindernear 121 2 -> 1
-dqrmn372 remaindernear 122 2 -> 0
-dqrmn373 remaindernear 123 2 -> -1
-dqrmn374 remaindernear 124 2 -> 0
-dqrmn375 remaindernear 125 2 -> 1
-dqrmn376 remaindernear 126 2 -> 0
-dqrmn377 remaindernear 127 2 -> -1
-
-dqrmn381 remaindernear 12345 1 -> 0
-dqrmn382 remaindernear 12345 1.0001 -> -0.2344
-dqrmn383 remaindernear 12345 1.001 -> -0.333
-dqrmn384 remaindernear 12345 1.01 -> -0.23
-dqrmn385 remaindernear 12345 1.1 -> -0.3
-dqrmn386 remaindernear 12355 4 -> -1
-dqrmn387 remaindernear 12345 4 -> 1
-dqrmn388 remaindernear 12355 4.0001 -> -1.3089
-dqrmn389 remaindernear 12345 4.0001 -> 0.6914
-dqrmn390 remaindernear 12345 4.9 -> 1.9
-dqrmn391 remaindernear 12345 4.99 -> -0.26
-dqrmn392 remaindernear 12345 4.999 -> 2.469
-dqrmn393 remaindernear 12345 4.9999 -> 0.2469
-dqrmn394 remaindernear 12345 5 -> 0
-dqrmn395 remaindernear 12345 5.0001 -> -0.2469
-dqrmn396 remaindernear 12345 5.001 -> -2.469
-dqrmn397 remaindernear 12345 5.01 -> 0.36
-dqrmn398 remaindernear 12345 5.1 -> -2.1
-
--- the nasty division-by-1 cases
-dqrmn401 remaindernear 0.4 1 -> 0.4
-dqrmn402 remaindernear 0.45 1 -> 0.45
-dqrmn403 remaindernear 0.455 1 -> 0.455
-dqrmn404 remaindernear 0.4555 1 -> 0.4555
-dqrmn405 remaindernear 0.45555 1 -> 0.45555
-dqrmn406 remaindernear 0.455555 1 -> 0.455555
-dqrmn407 remaindernear 0.4555555 1 -> 0.4555555
-dqrmn408 remaindernear 0.45555555 1 -> 0.45555555
-dqrmn409 remaindernear 0.455555555 1 -> 0.455555555
--- with spill... [412 exercises sticktab loop]
-dqrmn411 remaindernear 0.5 1 -> 0.5
-dqrmn412 remaindernear 0.55 1 -> -0.45
-dqrmn413 remaindernear 0.555 1 -> -0.445
-dqrmn414 remaindernear 0.5555 1 -> -0.4445
-dqrmn415 remaindernear 0.55555 1 -> -0.44445
-dqrmn416 remaindernear 0.555555 1 -> -0.444445
-dqrmn417 remaindernear 0.5555555 1 -> -0.4444445
-dqrmn418 remaindernear 0.55555555 1 -> -0.44444445
-dqrmn419 remaindernear 0.555555555 1 -> -0.444444445
-
--- folddowns
-dqrmn421 remaindernear 1E+6144 1 -> NaN Division_impossible
-dqrmn422 remaindernear 1E+6144 1E+6143 -> 0E+6111 Clamped
-dqrmn423 remaindernear 1E+6144 2E+6143 -> 0E+6111 Clamped
-dqrmn424 remaindernear 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqrmn425 remaindernear 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
-dqrmn426 remaindernear 1E+6144 5E+6143 -> 0E+6111 Clamped
-dqrmn427 remaindernear 1E+6144 6E+6143 -> -2.00000000000000000000000000000000E+6143 Clamped
-dqrmn428 remaindernear 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped
-dqrmn429 remaindernear 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
-dqrmn430 remaindernear 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
--- tinies
-dqrmn431 remaindernear 1E-6175 1E-6176 -> 0E-6176
-dqrmn432 remaindernear 1E-6175 2E-6176 -> 0E-6176
-dqrmn433 remaindernear 1E-6175 3E-6176 -> 1E-6176 Subnormal
-dqrmn434 remaindernear 1E-6175 4E-6176 -> 2E-6176 Subnormal
-dqrmn435 remaindernear 1E-6175 5E-6176 -> 0E-6176
-dqrmn436 remaindernear 1E-6175 6E-6176 -> -2E-6176 Subnormal
-dqrmn437 remaindernear 1E-6175 7E-6176 -> 3E-6176 Subnormal
-dqrmn438 remaindernear 1E-6175 8E-6176 -> 2E-6176 Subnormal
-dqrmn439 remaindernear 1E-6175 9E-6176 -> 1E-6176 Subnormal
-dqrmn440 remaindernear 1E-6175 10E-6176 -> 0E-6176
-dqrmn441 remaindernear 1E-6175 11E-6176 -> -1E-6176 Subnormal
-dqrmn442 remaindernear 100E-6175 11E-6176 -> -1E-6176 Subnormal
-dqrmn443 remaindernear 100E-6175 20E-6176 -> 0E-6176
-dqrmn444 remaindernear 100E-6175 21E-6176 -> -8E-6176 Subnormal
-dqrmn445 remaindernear 100E-6175 30E-6176 -> 1.0E-6175 Subnormal
-
--- zero signs
-dqrmn650 remaindernear 1 1 -> 0
-dqrmn651 remaindernear -1 1 -> -0
-dqrmn652 remaindernear 1 -1 -> 0
-dqrmn653 remaindernear -1 -1 -> -0
-dqrmn654 remaindernear 0 1 -> 0
-dqrmn655 remaindernear -0 1 -> -0
-dqrmn656 remaindernear 0 -1 -> 0
-dqrmn657 remaindernear -0 -1 -> -0
-dqrmn658 remaindernear 0.00 1 -> 0.00
-dqrmn659 remaindernear -0.00 1 -> -0.00
-
--- Specials
-dqrmn680 remaindernear Inf -Inf -> NaN Invalid_operation
-dqrmn681 remaindernear Inf -1000 -> NaN Invalid_operation
-dqrmn682 remaindernear Inf -1 -> NaN Invalid_operation
-dqrmn683 remaindernear Inf 0 -> NaN Invalid_operation
-dqrmn684 remaindernear Inf -0 -> NaN Invalid_operation
-dqrmn685 remaindernear Inf 1 -> NaN Invalid_operation
-dqrmn686 remaindernear Inf 1000 -> NaN Invalid_operation
-dqrmn687 remaindernear Inf Inf -> NaN Invalid_operation
-dqrmn688 remaindernear -1000 Inf -> -1000
-dqrmn689 remaindernear -Inf Inf -> NaN Invalid_operation
-dqrmn691 remaindernear -1 Inf -> -1
-dqrmn692 remaindernear 0 Inf -> 0
-dqrmn693 remaindernear -0 Inf -> -0
-dqrmn694 remaindernear 1 Inf -> 1
-dqrmn695 remaindernear 1000 Inf -> 1000
-dqrmn696 remaindernear Inf Inf -> NaN Invalid_operation
-
-dqrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation
-dqrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation
-dqrmn702 remaindernear -Inf -1 -> NaN Invalid_operation
-dqrmn703 remaindernear -Inf -0 -> NaN Invalid_operation
-dqrmn704 remaindernear -Inf 0 -> NaN Invalid_operation
-dqrmn705 remaindernear -Inf 1 -> NaN Invalid_operation
-dqrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation
-dqrmn707 remaindernear -Inf Inf -> NaN Invalid_operation
-dqrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation
-dqrmn709 remaindernear -1000 Inf -> -1000
-dqrmn710 remaindernear -1 -Inf -> -1
-dqrmn711 remaindernear -0 -Inf -> -0
-dqrmn712 remaindernear 0 -Inf -> 0
-dqrmn713 remaindernear 1 -Inf -> 1
-dqrmn714 remaindernear 1000 -Inf -> 1000
-dqrmn715 remaindernear Inf -Inf -> NaN Invalid_operation
-
-dqrmn721 remaindernear NaN -Inf -> NaN
-dqrmn722 remaindernear NaN -1000 -> NaN
-dqrmn723 remaindernear NaN -1 -> NaN
-dqrmn724 remaindernear NaN -0 -> NaN
-dqrmn725 remaindernear -NaN 0 -> -NaN
-dqrmn726 remaindernear NaN 1 -> NaN
-dqrmn727 remaindernear NaN 1000 -> NaN
-dqrmn728 remaindernear NaN Inf -> NaN
-dqrmn729 remaindernear NaN -NaN -> NaN
-dqrmn730 remaindernear -Inf NaN -> NaN
-dqrmn731 remaindernear -1000 NaN -> NaN
-dqrmn732 remaindernear -1 NaN -> NaN
-dqrmn733 remaindernear -0 -NaN -> -NaN
-dqrmn734 remaindernear 0 NaN -> NaN
-dqrmn735 remaindernear 1 -NaN -> -NaN
-dqrmn736 remaindernear 1000 NaN -> NaN
-dqrmn737 remaindernear Inf NaN -> NaN
-
-dqrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation
-dqrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation
-dqrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation
-dqrmn744 remaindernear sNaN -0 -> NaN Invalid_operation
-dqrmn745 remaindernear sNaN 0 -> NaN Invalid_operation
-dqrmn746 remaindernear sNaN 1 -> NaN Invalid_operation
-dqrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation
-dqrmn749 remaindernear sNaN NaN -> NaN Invalid_operation
-dqrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation
-dqrmn751 remaindernear NaN sNaN -> NaN Invalid_operation
-dqrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation
-dqrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation
-dqrmn754 remaindernear -1 sNaN -> NaN Invalid_operation
-dqrmn755 remaindernear -0 sNaN -> NaN Invalid_operation
-dqrmn756 remaindernear 0 sNaN -> NaN Invalid_operation
-dqrmn757 remaindernear 1 sNaN -> NaN Invalid_operation
-dqrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation
-dqrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation
-
--- propaging NaNs
-dqrmn760 remaindernear NaN1 NaN7 -> NaN1
-dqrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
-dqrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation
-dqrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
-dqrmn764 remaindernear 15 NaN11 -> NaN11
-dqrmn765 remaindernear NaN6 NaN12 -> NaN6
-dqrmn766 remaindernear Inf NaN13 -> NaN13
-dqrmn767 remaindernear NaN14 -Inf -> NaN14
-dqrmn768 remaindernear 0 NaN15 -> NaN15
-dqrmn769 remaindernear NaN16 -0 -> NaN16
-
--- edge cases of impossible
-dqrmn770 remaindernear 1234500000000000000000067890123456 10 -> -4
-dqrmn771 remaindernear 1234500000000000000000067890123456 1 -> 0
-dqrmn772 remaindernear 1234500000000000000000067890123456 0.1 -> NaN Division_impossible
-dqrmn773 remaindernear 1234500000000000000000067890123456 0.01 -> NaN Division_impossible
-
--- long operand checks
-dqrmn801 remaindernear 12345678000 100 -> 0
-dqrmn802 remaindernear 1 12345678000 -> 1
-dqrmn803 remaindernear 1234567800 10 -> 0
-dqrmn804 remaindernear 1 1234567800 -> 1
-dqrmn805 remaindernear 1234567890 10 -> 0
-dqrmn806 remaindernear 1 1234567890 -> 1
-dqrmn807 remaindernear 1234567891 10 -> 1
-dqrmn808 remaindernear 1 1234567891 -> 1
-dqrmn809 remaindernear 12345678901 100 -> 1
-dqrmn810 remaindernear 1 12345678901 -> 1
-dqrmn811 remaindernear 1234567896 10 -> -4
-dqrmn812 remaindernear 1 1234567896 -> 1
-
-dqrmn821 remaindernear 12345678000 100 -> 0
-dqrmn822 remaindernear 1 12345678000 -> 1
-dqrmn823 remaindernear 1234567800 10 -> 0
-dqrmn824 remaindernear 1 1234567800 -> 1
-dqrmn825 remaindernear 1234567890 10 -> 0
-dqrmn826 remaindernear 1 1234567890 -> 1
-dqrmn827 remaindernear 1234567891 10 -> 1
-dqrmn828 remaindernear 1 1234567891 -> 1
-dqrmn829 remaindernear 12345678901 100 -> 1
-dqrmn830 remaindernear 1 12345678901 -> 1
-dqrmn831 remaindernear 1234567896 10 -> -4
-dqrmn832 remaindernear 1 1234567896 -> 1
-
--- from divideint
-dqrmn840 remaindernear 100000000.0 1 -> 0.0
-dqrmn841 remaindernear 100000000.4 1 -> 0.4
-dqrmn842 remaindernear 100000000.5 1 -> 0.5
-dqrmn843 remaindernear 100000000.9 1 -> -0.1
-dqrmn844 remaindernear 100000000.999 1 -> -0.001
-dqrmn850 remaindernear 100000003 5 -> -2
-dqrmn851 remaindernear 10000003 5 -> -2
-dqrmn852 remaindernear 1000003 5 -> -2
-dqrmn853 remaindernear 100003 5 -> -2
-dqrmn854 remaindernear 10003 5 -> -2
-dqrmn855 remaindernear 1003 5 -> -2
-dqrmn856 remaindernear 103 5 -> -2
-dqrmn857 remaindernear 13 5 -> -2
-dqrmn858 remaindernear 1 5 -> 1
-
--- Vladimir's cases 1234567890123456
-dqrmn860 remaindernear 123.0e1 1000000000000000 -> 1230
-dqrmn861 remaindernear 1230 1000000000000000 -> 1230
-dqrmn862 remaindernear 12.3e2 1000000000000000 -> 1230
-dqrmn863 remaindernear 1.23e3 1000000000000000 -> 1230
-dqrmn864 remaindernear 123e1 1000000000000000 -> 1230
-dqrmn870 remaindernear 123e1 1000000000000000 -> 1230
-dqrmn871 remaindernear 123e1 100000000000000 -> 1230
-dqrmn872 remaindernear 123e1 10000000000000 -> 1230
-dqrmn873 remaindernear 123e1 1000000000000 -> 1230
-dqrmn874 remaindernear 123e1 100000000000 -> 1230
-dqrmn875 remaindernear 123e1 10000000000 -> 1230
-dqrmn876 remaindernear 123e1 1000000000 -> 1230
-dqrmn877 remaindernear 123e1 100000000 -> 1230
-dqrmn878 remaindernear 1230 100000000 -> 1230
-dqrmn879 remaindernear 123e1 10000000 -> 1230
-dqrmn880 remaindernear 123e1 1000000 -> 1230
-dqrmn881 remaindernear 123e1 100000 -> 1230
-dqrmn882 remaindernear 123e1 10000 -> 1230
-dqrmn883 remaindernear 123e1 1000 -> 230
-dqrmn884 remaindernear 123e1 100 -> 30
-dqrmn885 remaindernear 123e1 10 -> 0
-dqrmn886 remaindernear 123e1 1 -> 0
-
-dqrmn890 remaindernear 123e1 2000000000000000 -> 1230
-dqrmn891 remaindernear 123e1 200000000000000 -> 1230
-dqrmn892 remaindernear 123e1 20000000000000 -> 1230
-dqrmn893 remaindernear 123e1 2000000000000 -> 1230
-dqrmn894 remaindernear 123e1 200000000000 -> 1230
-dqrmn895 remaindernear 123e1 20000000000 -> 1230
-dqrmn896 remaindernear 123e1 2000000000 -> 1230
-dqrmn897 remaindernear 123e1 200000000 -> 1230
-dqrmn899 remaindernear 123e1 20000000 -> 1230
-dqrmn900 remaindernear 123e1 2000000 -> 1230
-dqrmn901 remaindernear 123e1 200000 -> 1230
-dqrmn902 remaindernear 123e1 20000 -> 1230
-dqrmn903 remaindernear 123e1 2000 -> -770
-dqrmn904 remaindernear 123e1 200 -> 30
-dqrmn905 remaindernear 123e1 20 -> -10
-dqrmn906 remaindernear 123e1 2 -> 0
-
-dqrmn910 remaindernear 123e1 5000000000000000 -> 1230
-dqrmn911 remaindernear 123e1 500000000000000 -> 1230
-dqrmn912 remaindernear 123e1 50000000000000 -> 1230
-dqrmn913 remaindernear 123e1 5000000000000 -> 1230
-dqrmn914 remaindernear 123e1 500000000000 -> 1230
-dqrmn915 remaindernear 123e1 50000000000 -> 1230
-dqrmn916 remaindernear 123e1 5000000000 -> 1230
-dqrmn917 remaindernear 123e1 500000000 -> 1230
-dqrmn919 remaindernear 123e1 50000000 -> 1230
-dqrmn920 remaindernear 123e1 5000000 -> 1230
-dqrmn921 remaindernear 123e1 500000 -> 1230
-dqrmn922 remaindernear 123e1 50000 -> 1230
-dqrmn923 remaindernear 123e1 5000 -> 1230
-dqrmn924 remaindernear 123e1 500 -> 230
-dqrmn925 remaindernear 123e1 50 -> -20
-dqrmn926 remaindernear 123e1 5 -> 0
-
-dqrmn930 remaindernear 123e1 9000000000000000 -> 1230
-dqrmn931 remaindernear 123e1 900000000000000 -> 1230
-dqrmn932 remaindernear 123e1 90000000000000 -> 1230
-dqrmn933 remaindernear 123e1 9000000000000 -> 1230
-dqrmn934 remaindernear 123e1 900000000000 -> 1230
-dqrmn935 remaindernear 123e1 90000000000 -> 1230
-dqrmn936 remaindernear 123e1 9000000000 -> 1230
-dqrmn937 remaindernear 123e1 900000000 -> 1230
-dqrmn939 remaindernear 123e1 90000000 -> 1230
-dqrmn940 remaindernear 123e1 9000000 -> 1230
-dqrmn941 remaindernear 123e1 900000 -> 1230
-dqrmn942 remaindernear 123e1 90000 -> 1230
-dqrmn943 remaindernear 123e1 9000 -> 1230
-dqrmn944 remaindernear 123e1 900 -> 330
-dqrmn945 remaindernear 123e1 90 -> -30
-dqrmn946 remaindernear 123e1 9 -> -3
-
-dqrmn950 remaindernear 123e1 1000000000000000 -> 1230
-dqrmn961 remaindernear 123e1 2999999999999999 -> 1230
-dqrmn962 remaindernear 123e1 3999999999999999 -> 1230
-dqrmn963 remaindernear 123e1 4999999999999999 -> 1230
-dqrmn964 remaindernear 123e1 5999999999999999 -> 1230
-dqrmn965 remaindernear 123e1 6999999999999999 -> 1230
-dqrmn966 remaindernear 123e1 7999999999999999 -> 1230
-dqrmn967 remaindernear 123e1 8999999999999999 -> 1230
-dqrmn968 remaindernear 123e1 9999999999999999 -> 1230
-dqrmn969 remaindernear 123e1 9876543210987654 -> 1230
-
-dqrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
-
--- overflow and underflow tests [from divide]
-dqrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible
-dqrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible
-dqrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible
-dqrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible
-dqrmn1055 remaindernear 1e-277 1e+311 -> 1E-277
-dqrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277
-dqrmn1057 remaindernear -1e-277 1e+311 -> -1E-277
-dqrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
-
--- Gyuris example
-dqrmn1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
-
--- destructive subtract
-dqrmn1101 remaindernear 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> -0.234567890123456789012345678901233
-dqrmn1102 remaindernear 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> -0.34567890123456789012345678901222
-dqrmn1103 remaindernear 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> -0.4567890123456789012345678901111
-dqrmn1104 remaindernear 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> -1.308641972530864197253086419725314
-dqrmn1105 remaindernear 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692
-dqrmn1106 remaindernear 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> -1.3086421975308642197530864219748
-dqrmn1107 remaindernear 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247
-dqrmn1108 remaindernear 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> -0.753086421975308642197530864219753
-dqrmn1109 remaindernear 1234567890123456789012345678901234 5.000000000000000000000000000000001 -> -1.246913578024691357802469135780247
-dqrmn1110 remaindernear 1234567890123456789012345678901234 5.00000000000000000000000000000001 -> 1.53086421975308642197530864219754
-dqrmn1111 remaindernear 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> -0.6913578024691357802469135780242
-
--- Null tests
-dqrmn1000 remaindernear 10 # -> NaN Invalid_operation
-dqrmn1001 remaindernear # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqRemainderNear.decTest -- decQuad remainder-near --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks (as base, above)
+dqrmn001 remaindernear 1 1 -> 0
+dqrmn002 remaindernear 2 1 -> 0
+dqrmn003 remaindernear 1 2 -> 1
+dqrmn004 remaindernear 2 2 -> 0
+dqrmn005 remaindernear 0 1 -> 0
+dqrmn006 remaindernear 0 2 -> 0
+dqrmn007 remaindernear 1 3 -> 1
+dqrmn008 remaindernear 2 3 -> -1
+dqrmn009 remaindernear 3 3 -> 0
+
+dqrmn010 remaindernear 2.4 1 -> 0.4
+dqrmn011 remaindernear 2.4 -1 -> 0.4
+dqrmn012 remaindernear -2.4 1 -> -0.4
+dqrmn013 remaindernear -2.4 -1 -> -0.4
+dqrmn014 remaindernear 2.40 1 -> 0.40
+dqrmn015 remaindernear 2.400 1 -> 0.400
+dqrmn016 remaindernear 2.4 2 -> 0.4
+dqrmn017 remaindernear 2.400 2 -> 0.400
+dqrmn018 remaindernear 2. 2 -> 0
+dqrmn019 remaindernear 20 20 -> 0
+
+dqrmn020 remaindernear 187 187 -> 0
+dqrmn021 remaindernear 5 2 -> 1
+dqrmn022 remaindernear 5 2.0 -> 1.0
+dqrmn023 remaindernear 5 2.000 -> 1.000
+dqrmn024 remaindernear 5 0.200 -> 0.000
+dqrmn025 remaindernear 5 0.200 -> 0.000
+
+dqrmn030 remaindernear 1 2 -> 1
+dqrmn031 remaindernear 1 4 -> 1
+dqrmn032 remaindernear 1 8 -> 1
+
+dqrmn033 remaindernear 1 16 -> 1
+dqrmn034 remaindernear 1 32 -> 1
+dqrmn035 remaindernear 1 64 -> 1
+dqrmn040 remaindernear 1 -2 -> 1
+dqrmn041 remaindernear 1 -4 -> 1
+dqrmn042 remaindernear 1 -8 -> 1
+dqrmn043 remaindernear 1 -16 -> 1
+dqrmn044 remaindernear 1 -32 -> 1
+dqrmn045 remaindernear 1 -64 -> 1
+dqrmn050 remaindernear -1 2 -> -1
+dqrmn051 remaindernear -1 4 -> -1
+dqrmn052 remaindernear -1 8 -> -1
+dqrmn053 remaindernear -1 16 -> -1
+dqrmn054 remaindernear -1 32 -> -1
+dqrmn055 remaindernear -1 64 -> -1
+dqrmn060 remaindernear -1 -2 -> -1
+dqrmn061 remaindernear -1 -4 -> -1
+dqrmn062 remaindernear -1 -8 -> -1
+dqrmn063 remaindernear -1 -16 -> -1
+dqrmn064 remaindernear -1 -32 -> -1
+dqrmn065 remaindernear -1 -64 -> -1
+
+dqrmn066 remaindernear 9.9 1 -> -0.1
+dqrmn067 remaindernear 99.7 1 -> -0.3
+dqrmn068 remaindernear 999999999 1 -> 0
+dqrmn069 remaindernear 999999999.4 1 -> 0.4
+dqrmn070 remaindernear 999999999.5 1 -> -0.5
+dqrmn071 remaindernear 999999999.9 1 -> -0.1
+dqrmn072 remaindernear 999999999.999 1 -> -0.001
+dqrmn073 remaindernear 999999.999999 1 -> -0.000001
+dqrmn074 remaindernear 9 1 -> 0
+dqrmn075 remaindernear 9999999999999999 1 -> 0
+dqrmn076 remaindernear 9999999999999999 2 -> -1
+dqrmn077 remaindernear 9999999999999999 3 -> 0
+dqrmn078 remaindernear 9999999999999999 4 -> -1
+
+dqrmn080 remaindernear 0. 1 -> 0
+dqrmn081 remaindernear .0 1 -> 0.0
+dqrmn082 remaindernear 0.00 1 -> 0.00
+dqrmn083 remaindernear 0.00E+9 1 -> 0
+dqrmn084 remaindernear 0.00E+3 1 -> 0
+dqrmn085 remaindernear 0.00E+2 1 -> 0
+dqrmn086 remaindernear 0.00E+1 1 -> 0.0
+dqrmn087 remaindernear 0.00E+0 1 -> 0.00
+dqrmn088 remaindernear 0.00E-0 1 -> 0.00
+dqrmn089 remaindernear 0.00E-1 1 -> 0.000
+dqrmn090 remaindernear 0.00E-2 1 -> 0.0000
+dqrmn091 remaindernear 0.00E-3 1 -> 0.00000
+dqrmn092 remaindernear 0.00E-4 1 -> 0.000000
+dqrmn093 remaindernear 0.00E-5 1 -> 0E-7
+dqrmn094 remaindernear 0.00E-6 1 -> 0E-8
+dqrmn095 remaindernear 0.0000E-50 1 -> 0E-54
+
+-- Various flavours of remaindernear by 0
+dqrmn101 remaindernear 0 0 -> NaN Division_undefined
+dqrmn102 remaindernear 0 -0 -> NaN Division_undefined
+dqrmn103 remaindernear -0 0 -> NaN Division_undefined
+dqrmn104 remaindernear -0 -0 -> NaN Division_undefined
+dqrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined
+dqrmn106 remaindernear 0.000 0 -> NaN Division_undefined
+-- [Some think this next group should be Division_by_zero exception, but
+-- IEEE 854 is explicit that it is Invalid operation .. for
+-- remainder-near, anyway]
+dqrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation
+dqrmn108 remaindernear 0.01 0 -> NaN Invalid_operation
+dqrmn109 remaindernear 0.1 0 -> NaN Invalid_operation
+dqrmn110 remaindernear 1 0 -> NaN Invalid_operation
+dqrmn111 remaindernear 1 0.0 -> NaN Invalid_operation
+dqrmn112 remaindernear 10 0.0 -> NaN Invalid_operation
+dqrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation
+dqrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation
+dqrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation
+dqrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation
+dqrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation
+dqrmn120 remaindernear 1 -0 -> NaN Invalid_operation
+dqrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation
+dqrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation
+dqrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation
+dqrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation
+-- and zeros on left
+dqrmn130 remaindernear 0 1 -> 0
+dqrmn131 remaindernear 0 -1 -> 0
+dqrmn132 remaindernear 0.0 1 -> 0.0
+dqrmn133 remaindernear 0.0 -1 -> 0.0
+dqrmn134 remaindernear -0 1 -> -0
+dqrmn135 remaindernear -0 -1 -> -0
+dqrmn136 remaindernear -0.0 1 -> -0.0
+dqrmn137 remaindernear -0.0 -1 -> -0.0
+
+-- 0.5ers
+dqrmn143 remaindernear 0.5 2 -> 0.5
+dqrmn144 remaindernear 0.5 2.1 -> 0.5
+dqrmn145 remaindernear 0.5 2.01 -> 0.50
+dqrmn146 remaindernear 0.5 2.001 -> 0.500
+dqrmn147 remaindernear 0.50 2 -> 0.50
+dqrmn148 remaindernear 0.50 2.01 -> 0.50
+dqrmn149 remaindernear 0.50 2.001 -> 0.500
+
+-- steadies
+dqrmn150 remaindernear 1 1 -> 0
+dqrmn151 remaindernear 1 2 -> 1
+dqrmn152 remaindernear 1 3 -> 1
+dqrmn153 remaindernear 1 4 -> 1
+dqrmn154 remaindernear 1 5 -> 1
+dqrmn155 remaindernear 1 6 -> 1
+dqrmn156 remaindernear 1 7 -> 1
+dqrmn157 remaindernear 1 8 -> 1
+dqrmn158 remaindernear 1 9 -> 1
+dqrmn159 remaindernear 1 10 -> 1
+dqrmn160 remaindernear 1 1 -> 0
+dqrmn161 remaindernear 2 1 -> 0
+dqrmn162 remaindernear 3 1 -> 0
+dqrmn163 remaindernear 4 1 -> 0
+dqrmn164 remaindernear 5 1 -> 0
+dqrmn165 remaindernear 6 1 -> 0
+dqrmn166 remaindernear 7 1 -> 0
+dqrmn167 remaindernear 8 1 -> 0
+dqrmn168 remaindernear 9 1 -> 0
+dqrmn169 remaindernear 10 1 -> 0
+
+-- some differences from remainder
+dqrmn171 remaindernear 0.4 1.020 -> 0.400
+dqrmn172 remaindernear 0.50 1.020 -> 0.500
+dqrmn173 remaindernear 0.51 1.020 -> 0.510
+dqrmn174 remaindernear 0.52 1.020 -> -0.500
+dqrmn175 remaindernear 0.6 1.020 -> -0.420
+
+-- More flavours of remaindernear by 0
+dqrmn201 remaindernear 0 0 -> NaN Division_undefined
+dqrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined
+dqrmn203 remaindernear 0.000 0 -> NaN Division_undefined
+dqrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation
+dqrmn205 remaindernear 0.01 0 -> NaN Invalid_operation
+dqrmn206 remaindernear 0.1 0 -> NaN Invalid_operation
+dqrmn207 remaindernear 1 0 -> NaN Invalid_operation
+dqrmn208 remaindernear 1 0.0 -> NaN Invalid_operation
+dqrmn209 remaindernear 10 0.0 -> NaN Invalid_operation
+dqrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation
+dqrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation
+
+-- tests from the extended specification
+dqrmn221 remaindernear 2.1 3 -> -0.9
+dqrmn222 remaindernear 10 6 -> -2
+dqrmn223 remaindernear 10 3 -> 1
+dqrmn224 remaindernear -10 3 -> -1
+dqrmn225 remaindernear 10.2 1 -> 0.2
+dqrmn226 remaindernear 10 0.3 -> 0.1
+dqrmn227 remaindernear 3.6 1.3 -> -0.3
+
+-- some differences from remainder
+dqrmn231 remaindernear -0.4 1.020 -> -0.400
+dqrmn232 remaindernear -0.50 1.020 -> -0.500
+dqrmn233 remaindernear -0.51 1.020 -> -0.510
+dqrmn234 remaindernear -0.52 1.020 -> 0.500
+dqrmn235 remaindernear -0.6 1.020 -> 0.420
+
+-- high Xs
+dqrmn240 remaindernear 1E+2 1.00 -> 0.00
+
+-- dqrmn3xx are from DiagBigDecimal
+dqrmn301 remaindernear 1 3 -> 1
+dqrmn302 remaindernear 5 5 -> 0
+dqrmn303 remaindernear 13 10 -> 3
+dqrmn304 remaindernear 13 50 -> 13
+dqrmn305 remaindernear 13 100 -> 13
+dqrmn306 remaindernear 13 1000 -> 13
+dqrmn307 remaindernear .13 1 -> 0.13
+dqrmn308 remaindernear 0.133 1 -> 0.133
+dqrmn309 remaindernear 0.1033 1 -> 0.1033
+dqrmn310 remaindernear 1.033 1 -> 0.033
+dqrmn311 remaindernear 10.33 1 -> 0.33
+dqrmn312 remaindernear 10.33 10 -> 0.33
+dqrmn313 remaindernear 103.3 1 -> 0.3
+dqrmn314 remaindernear 133 10 -> 3
+dqrmn315 remaindernear 1033 10 -> 3
+dqrmn316 remaindernear 1033 50 -> -17
+dqrmn317 remaindernear 101.0 3 -> -1.0
+dqrmn318 remaindernear 102.0 3 -> 0.0
+dqrmn319 remaindernear 103.0 3 -> 1.0
+dqrmn320 remaindernear 2.40 1 -> 0.40
+dqrmn321 remaindernear 2.400 1 -> 0.400
+dqrmn322 remaindernear 2.4 1 -> 0.4
+dqrmn323 remaindernear 2.4 2 -> 0.4
+dqrmn324 remaindernear 2.400 2 -> 0.400
+dqrmn325 remaindernear 1 0.3 -> 0.1
+dqrmn326 remaindernear 1 0.30 -> 0.10
+dqrmn327 remaindernear 1 0.300 -> 0.100
+dqrmn328 remaindernear 1 0.3000 -> 0.1000
+dqrmn329 remaindernear 1.0 0.3 -> 0.1
+dqrmn330 remaindernear 1.00 0.3 -> 0.10
+dqrmn331 remaindernear 1.000 0.3 -> 0.100
+dqrmn332 remaindernear 1.0000 0.3 -> 0.1000
+dqrmn333 remaindernear 0.5 2 -> 0.5
+dqrmn334 remaindernear 0.5 2.1 -> 0.5
+dqrmn335 remaindernear 0.5 2.01 -> 0.50
+dqrmn336 remaindernear 0.5 2.001 -> 0.500
+dqrmn337 remaindernear 0.50 2 -> 0.50
+dqrmn338 remaindernear 0.50 2.01 -> 0.50
+dqrmn339 remaindernear 0.50 2.001 -> 0.500
+
+dqrmn340 remaindernear 0.5 0.5000001 -> -1E-7
+dqrmn341 remaindernear 0.5 0.50000001 -> -1E-8
+dqrmn342 remaindernear 0.5 0.500000001 -> -1E-9
+dqrmn343 remaindernear 0.5 0.5000000001 -> -1E-10
+dqrmn344 remaindernear 0.5 0.50000000001 -> -1E-11
+dqrmn345 remaindernear 0.5 0.4999999 -> 1E-7
+dqrmn346 remaindernear 0.5 0.49999999 -> 1E-8
+dqrmn347 remaindernear 0.5 0.499999999 -> 1E-9
+dqrmn348 remaindernear 0.5 0.4999999999 -> 1E-10
+dqrmn349 remaindernear 0.5 0.49999999999 -> 1E-11
+dqrmn350 remaindernear 0.5 0.499999999999 -> 1E-12
+
+dqrmn351 remaindernear 0.03 7 -> 0.03
+dqrmn352 remaindernear 5 2 -> 1
+dqrmn353 remaindernear 4.1 2 -> 0.1
+dqrmn354 remaindernear 4.01 2 -> 0.01
+dqrmn355 remaindernear 4.001 2 -> 0.001
+dqrmn356 remaindernear 4.0001 2 -> 0.0001
+dqrmn357 remaindernear 4.00001 2 -> 0.00001
+dqrmn358 remaindernear 4.000001 2 -> 0.000001
+dqrmn359 remaindernear 4.0000001 2 -> 1E-7
+
+dqrmn360 remaindernear 1.2 0.7345 -> -0.2690
+dqrmn361 remaindernear 0.8 12 -> 0.8
+dqrmn362 remaindernear 0.8 0.2 -> 0.0
+dqrmn363 remaindernear 0.8 0.3 -> -0.1
+dqrmn364 remaindernear 0.800 12 -> 0.800
+dqrmn365 remaindernear 0.800 1.7 -> 0.800
+dqrmn366 remaindernear 2.400 2 -> 0.400
+
+-- round to even
+dqrmn371 remaindernear 121 2 -> 1
+dqrmn372 remaindernear 122 2 -> 0
+dqrmn373 remaindernear 123 2 -> -1
+dqrmn374 remaindernear 124 2 -> 0
+dqrmn375 remaindernear 125 2 -> 1
+dqrmn376 remaindernear 126 2 -> 0
+dqrmn377 remaindernear 127 2 -> -1
+
+dqrmn381 remaindernear 12345 1 -> 0
+dqrmn382 remaindernear 12345 1.0001 -> -0.2344
+dqrmn383 remaindernear 12345 1.001 -> -0.333
+dqrmn384 remaindernear 12345 1.01 -> -0.23
+dqrmn385 remaindernear 12345 1.1 -> -0.3
+dqrmn386 remaindernear 12355 4 -> -1
+dqrmn387 remaindernear 12345 4 -> 1
+dqrmn388 remaindernear 12355 4.0001 -> -1.3089
+dqrmn389 remaindernear 12345 4.0001 -> 0.6914
+dqrmn390 remaindernear 12345 4.9 -> 1.9
+dqrmn391 remaindernear 12345 4.99 -> -0.26
+dqrmn392 remaindernear 12345 4.999 -> 2.469
+dqrmn393 remaindernear 12345 4.9999 -> 0.2469
+dqrmn394 remaindernear 12345 5 -> 0
+dqrmn395 remaindernear 12345 5.0001 -> -0.2469
+dqrmn396 remaindernear 12345 5.001 -> -2.469
+dqrmn397 remaindernear 12345 5.01 -> 0.36
+dqrmn398 remaindernear 12345 5.1 -> -2.1
+
+-- the nasty division-by-1 cases
+dqrmn401 remaindernear 0.4 1 -> 0.4
+dqrmn402 remaindernear 0.45 1 -> 0.45
+dqrmn403 remaindernear 0.455 1 -> 0.455
+dqrmn404 remaindernear 0.4555 1 -> 0.4555
+dqrmn405 remaindernear 0.45555 1 -> 0.45555
+dqrmn406 remaindernear 0.455555 1 -> 0.455555
+dqrmn407 remaindernear 0.4555555 1 -> 0.4555555
+dqrmn408 remaindernear 0.45555555 1 -> 0.45555555
+dqrmn409 remaindernear 0.455555555 1 -> 0.455555555
+-- with spill... [412 exercises sticktab loop]
+dqrmn411 remaindernear 0.5 1 -> 0.5
+dqrmn412 remaindernear 0.55 1 -> -0.45
+dqrmn413 remaindernear 0.555 1 -> -0.445
+dqrmn414 remaindernear 0.5555 1 -> -0.4445
+dqrmn415 remaindernear 0.55555 1 -> -0.44445
+dqrmn416 remaindernear 0.555555 1 -> -0.444445
+dqrmn417 remaindernear 0.5555555 1 -> -0.4444445
+dqrmn418 remaindernear 0.55555555 1 -> -0.44444445
+dqrmn419 remaindernear 0.555555555 1 -> -0.444444445
+
+-- folddowns
+dqrmn421 remaindernear 1E+6144 1 -> NaN Division_impossible
+dqrmn422 remaindernear 1E+6144 1E+6143 -> 0E+6111 Clamped
+dqrmn423 remaindernear 1E+6144 2E+6143 -> 0E+6111 Clamped
+dqrmn424 remaindernear 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqrmn425 remaindernear 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
+dqrmn426 remaindernear 1E+6144 5E+6143 -> 0E+6111 Clamped
+dqrmn427 remaindernear 1E+6144 6E+6143 -> -2.00000000000000000000000000000000E+6143 Clamped
+dqrmn428 remaindernear 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped
+dqrmn429 remaindernear 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
+dqrmn430 remaindernear 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
+-- tinies
+dqrmn431 remaindernear 1E-6175 1E-6176 -> 0E-6176
+dqrmn432 remaindernear 1E-6175 2E-6176 -> 0E-6176
+dqrmn433 remaindernear 1E-6175 3E-6176 -> 1E-6176 Subnormal
+dqrmn434 remaindernear 1E-6175 4E-6176 -> 2E-6176 Subnormal
+dqrmn435 remaindernear 1E-6175 5E-6176 -> 0E-6176
+dqrmn436 remaindernear 1E-6175 6E-6176 -> -2E-6176 Subnormal
+dqrmn437 remaindernear 1E-6175 7E-6176 -> 3E-6176 Subnormal
+dqrmn438 remaindernear 1E-6175 8E-6176 -> 2E-6176 Subnormal
+dqrmn439 remaindernear 1E-6175 9E-6176 -> 1E-6176 Subnormal
+dqrmn440 remaindernear 1E-6175 10E-6176 -> 0E-6176
+dqrmn441 remaindernear 1E-6175 11E-6176 -> -1E-6176 Subnormal
+dqrmn442 remaindernear 100E-6175 11E-6176 -> -1E-6176 Subnormal
+dqrmn443 remaindernear 100E-6175 20E-6176 -> 0E-6176
+dqrmn444 remaindernear 100E-6175 21E-6176 -> -8E-6176 Subnormal
+dqrmn445 remaindernear 100E-6175 30E-6176 -> 1.0E-6175 Subnormal
+
+-- zero signs
+dqrmn650 remaindernear 1 1 -> 0
+dqrmn651 remaindernear -1 1 -> -0
+dqrmn652 remaindernear 1 -1 -> 0
+dqrmn653 remaindernear -1 -1 -> -0
+dqrmn654 remaindernear 0 1 -> 0
+dqrmn655 remaindernear -0 1 -> -0
+dqrmn656 remaindernear 0 -1 -> 0
+dqrmn657 remaindernear -0 -1 -> -0
+dqrmn658 remaindernear 0.00 1 -> 0.00
+dqrmn659 remaindernear -0.00 1 -> -0.00
+
+-- Specials
+dqrmn680 remaindernear Inf -Inf -> NaN Invalid_operation
+dqrmn681 remaindernear Inf -1000 -> NaN Invalid_operation
+dqrmn682 remaindernear Inf -1 -> NaN Invalid_operation
+dqrmn683 remaindernear Inf 0 -> NaN Invalid_operation
+dqrmn684 remaindernear Inf -0 -> NaN Invalid_operation
+dqrmn685 remaindernear Inf 1 -> NaN Invalid_operation
+dqrmn686 remaindernear Inf 1000 -> NaN Invalid_operation
+dqrmn687 remaindernear Inf Inf -> NaN Invalid_operation
+dqrmn688 remaindernear -1000 Inf -> -1000
+dqrmn689 remaindernear -Inf Inf -> NaN Invalid_operation
+dqrmn691 remaindernear -1 Inf -> -1
+dqrmn692 remaindernear 0 Inf -> 0
+dqrmn693 remaindernear -0 Inf -> -0
+dqrmn694 remaindernear 1 Inf -> 1
+dqrmn695 remaindernear 1000 Inf -> 1000
+dqrmn696 remaindernear Inf Inf -> NaN Invalid_operation
+
+dqrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation
+dqrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation
+dqrmn702 remaindernear -Inf -1 -> NaN Invalid_operation
+dqrmn703 remaindernear -Inf -0 -> NaN Invalid_operation
+dqrmn704 remaindernear -Inf 0 -> NaN Invalid_operation
+dqrmn705 remaindernear -Inf 1 -> NaN Invalid_operation
+dqrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation
+dqrmn707 remaindernear -Inf Inf -> NaN Invalid_operation
+dqrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation
+dqrmn709 remaindernear -1000 Inf -> -1000
+dqrmn710 remaindernear -1 -Inf -> -1
+dqrmn711 remaindernear -0 -Inf -> -0
+dqrmn712 remaindernear 0 -Inf -> 0
+dqrmn713 remaindernear 1 -Inf -> 1
+dqrmn714 remaindernear 1000 -Inf -> 1000
+dqrmn715 remaindernear Inf -Inf -> NaN Invalid_operation
+
+dqrmn721 remaindernear NaN -Inf -> NaN
+dqrmn722 remaindernear NaN -1000 -> NaN
+dqrmn723 remaindernear NaN -1 -> NaN
+dqrmn724 remaindernear NaN -0 -> NaN
+dqrmn725 remaindernear -NaN 0 -> -NaN
+dqrmn726 remaindernear NaN 1 -> NaN
+dqrmn727 remaindernear NaN 1000 -> NaN
+dqrmn728 remaindernear NaN Inf -> NaN
+dqrmn729 remaindernear NaN -NaN -> NaN
+dqrmn730 remaindernear -Inf NaN -> NaN
+dqrmn731 remaindernear -1000 NaN -> NaN
+dqrmn732 remaindernear -1 NaN -> NaN
+dqrmn733 remaindernear -0 -NaN -> -NaN
+dqrmn734 remaindernear 0 NaN -> NaN
+dqrmn735 remaindernear 1 -NaN -> -NaN
+dqrmn736 remaindernear 1000 NaN -> NaN
+dqrmn737 remaindernear Inf NaN -> NaN
+
+dqrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation
+dqrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation
+dqrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation
+dqrmn744 remaindernear sNaN -0 -> NaN Invalid_operation
+dqrmn745 remaindernear sNaN 0 -> NaN Invalid_operation
+dqrmn746 remaindernear sNaN 1 -> NaN Invalid_operation
+dqrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation
+dqrmn749 remaindernear sNaN NaN -> NaN Invalid_operation
+dqrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation
+dqrmn751 remaindernear NaN sNaN -> NaN Invalid_operation
+dqrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation
+dqrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation
+dqrmn754 remaindernear -1 sNaN -> NaN Invalid_operation
+dqrmn755 remaindernear -0 sNaN -> NaN Invalid_operation
+dqrmn756 remaindernear 0 sNaN -> NaN Invalid_operation
+dqrmn757 remaindernear 1 sNaN -> NaN Invalid_operation
+dqrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation
+dqrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation
+
+-- propaging NaNs
+dqrmn760 remaindernear NaN1 NaN7 -> NaN1
+dqrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
+dqrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation
+dqrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
+dqrmn764 remaindernear 15 NaN11 -> NaN11
+dqrmn765 remaindernear NaN6 NaN12 -> NaN6
+dqrmn766 remaindernear Inf NaN13 -> NaN13
+dqrmn767 remaindernear NaN14 -Inf -> NaN14
+dqrmn768 remaindernear 0 NaN15 -> NaN15
+dqrmn769 remaindernear NaN16 -0 -> NaN16
+
+-- edge cases of impossible
+dqrmn770 remaindernear 1234500000000000000000067890123456 10 -> -4
+dqrmn771 remaindernear 1234500000000000000000067890123456 1 -> 0
+dqrmn772 remaindernear 1234500000000000000000067890123456 0.1 -> NaN Division_impossible
+dqrmn773 remaindernear 1234500000000000000000067890123456 0.01 -> NaN Division_impossible
+
+-- long operand checks
+dqrmn801 remaindernear 12345678000 100 -> 0
+dqrmn802 remaindernear 1 12345678000 -> 1
+dqrmn803 remaindernear 1234567800 10 -> 0
+dqrmn804 remaindernear 1 1234567800 -> 1
+dqrmn805 remaindernear 1234567890 10 -> 0
+dqrmn806 remaindernear 1 1234567890 -> 1
+dqrmn807 remaindernear 1234567891 10 -> 1
+dqrmn808 remaindernear 1 1234567891 -> 1
+dqrmn809 remaindernear 12345678901 100 -> 1
+dqrmn810 remaindernear 1 12345678901 -> 1
+dqrmn811 remaindernear 1234567896 10 -> -4
+dqrmn812 remaindernear 1 1234567896 -> 1
+
+dqrmn821 remaindernear 12345678000 100 -> 0
+dqrmn822 remaindernear 1 12345678000 -> 1
+dqrmn823 remaindernear 1234567800 10 -> 0
+dqrmn824 remaindernear 1 1234567800 -> 1
+dqrmn825 remaindernear 1234567890 10 -> 0
+dqrmn826 remaindernear 1 1234567890 -> 1
+dqrmn827 remaindernear 1234567891 10 -> 1
+dqrmn828 remaindernear 1 1234567891 -> 1
+dqrmn829 remaindernear 12345678901 100 -> 1
+dqrmn830 remaindernear 1 12345678901 -> 1
+dqrmn831 remaindernear 1234567896 10 -> -4
+dqrmn832 remaindernear 1 1234567896 -> 1
+
+-- from divideint
+dqrmn840 remaindernear 100000000.0 1 -> 0.0
+dqrmn841 remaindernear 100000000.4 1 -> 0.4
+dqrmn842 remaindernear 100000000.5 1 -> 0.5
+dqrmn843 remaindernear 100000000.9 1 -> -0.1
+dqrmn844 remaindernear 100000000.999 1 -> -0.001
+dqrmn850 remaindernear 100000003 5 -> -2
+dqrmn851 remaindernear 10000003 5 -> -2
+dqrmn852 remaindernear 1000003 5 -> -2
+dqrmn853 remaindernear 100003 5 -> -2
+dqrmn854 remaindernear 10003 5 -> -2
+dqrmn855 remaindernear 1003 5 -> -2
+dqrmn856 remaindernear 103 5 -> -2
+dqrmn857 remaindernear 13 5 -> -2
+dqrmn858 remaindernear 1 5 -> 1
+
+-- Vladimir's cases 1234567890123456
+dqrmn860 remaindernear 123.0e1 1000000000000000 -> 1230
+dqrmn861 remaindernear 1230 1000000000000000 -> 1230
+dqrmn862 remaindernear 12.3e2 1000000000000000 -> 1230
+dqrmn863 remaindernear 1.23e3 1000000000000000 -> 1230
+dqrmn864 remaindernear 123e1 1000000000000000 -> 1230
+dqrmn870 remaindernear 123e1 1000000000000000 -> 1230
+dqrmn871 remaindernear 123e1 100000000000000 -> 1230
+dqrmn872 remaindernear 123e1 10000000000000 -> 1230
+dqrmn873 remaindernear 123e1 1000000000000 -> 1230
+dqrmn874 remaindernear 123e1 100000000000 -> 1230
+dqrmn875 remaindernear 123e1 10000000000 -> 1230
+dqrmn876 remaindernear 123e1 1000000000 -> 1230
+dqrmn877 remaindernear 123e1 100000000 -> 1230
+dqrmn878 remaindernear 1230 100000000 -> 1230
+dqrmn879 remaindernear 123e1 10000000 -> 1230
+dqrmn880 remaindernear 123e1 1000000 -> 1230
+dqrmn881 remaindernear 123e1 100000 -> 1230
+dqrmn882 remaindernear 123e1 10000 -> 1230
+dqrmn883 remaindernear 123e1 1000 -> 230
+dqrmn884 remaindernear 123e1 100 -> 30
+dqrmn885 remaindernear 123e1 10 -> 0
+dqrmn886 remaindernear 123e1 1 -> 0
+
+dqrmn890 remaindernear 123e1 2000000000000000 -> 1230
+dqrmn891 remaindernear 123e1 200000000000000 -> 1230
+dqrmn892 remaindernear 123e1 20000000000000 -> 1230
+dqrmn893 remaindernear 123e1 2000000000000 -> 1230
+dqrmn894 remaindernear 123e1 200000000000 -> 1230
+dqrmn895 remaindernear 123e1 20000000000 -> 1230
+dqrmn896 remaindernear 123e1 2000000000 -> 1230
+dqrmn897 remaindernear 123e1 200000000 -> 1230
+dqrmn899 remaindernear 123e1 20000000 -> 1230
+dqrmn900 remaindernear 123e1 2000000 -> 1230
+dqrmn901 remaindernear 123e1 200000 -> 1230
+dqrmn902 remaindernear 123e1 20000 -> 1230
+dqrmn903 remaindernear 123e1 2000 -> -770
+dqrmn904 remaindernear 123e1 200 -> 30
+dqrmn905 remaindernear 123e1 20 -> -10
+dqrmn906 remaindernear 123e1 2 -> 0
+
+dqrmn910 remaindernear 123e1 5000000000000000 -> 1230
+dqrmn911 remaindernear 123e1 500000000000000 -> 1230
+dqrmn912 remaindernear 123e1 50000000000000 -> 1230
+dqrmn913 remaindernear 123e1 5000000000000 -> 1230
+dqrmn914 remaindernear 123e1 500000000000 -> 1230
+dqrmn915 remaindernear 123e1 50000000000 -> 1230
+dqrmn916 remaindernear 123e1 5000000000 -> 1230
+dqrmn917 remaindernear 123e1 500000000 -> 1230
+dqrmn919 remaindernear 123e1 50000000 -> 1230
+dqrmn920 remaindernear 123e1 5000000 -> 1230
+dqrmn921 remaindernear 123e1 500000 -> 1230
+dqrmn922 remaindernear 123e1 50000 -> 1230
+dqrmn923 remaindernear 123e1 5000 -> 1230
+dqrmn924 remaindernear 123e1 500 -> 230
+dqrmn925 remaindernear 123e1 50 -> -20
+dqrmn926 remaindernear 123e1 5 -> 0
+
+dqrmn930 remaindernear 123e1 9000000000000000 -> 1230
+dqrmn931 remaindernear 123e1 900000000000000 -> 1230
+dqrmn932 remaindernear 123e1 90000000000000 -> 1230
+dqrmn933 remaindernear 123e1 9000000000000 -> 1230
+dqrmn934 remaindernear 123e1 900000000000 -> 1230
+dqrmn935 remaindernear 123e1 90000000000 -> 1230
+dqrmn936 remaindernear 123e1 9000000000 -> 1230
+dqrmn937 remaindernear 123e1 900000000 -> 1230
+dqrmn939 remaindernear 123e1 90000000 -> 1230
+dqrmn940 remaindernear 123e1 9000000 -> 1230
+dqrmn941 remaindernear 123e1 900000 -> 1230
+dqrmn942 remaindernear 123e1 90000 -> 1230
+dqrmn943 remaindernear 123e1 9000 -> 1230
+dqrmn944 remaindernear 123e1 900 -> 330
+dqrmn945 remaindernear 123e1 90 -> -30
+dqrmn946 remaindernear 123e1 9 -> -3
+
+dqrmn950 remaindernear 123e1 1000000000000000 -> 1230
+dqrmn961 remaindernear 123e1 2999999999999999 -> 1230
+dqrmn962 remaindernear 123e1 3999999999999999 -> 1230
+dqrmn963 remaindernear 123e1 4999999999999999 -> 1230
+dqrmn964 remaindernear 123e1 5999999999999999 -> 1230
+dqrmn965 remaindernear 123e1 6999999999999999 -> 1230
+dqrmn966 remaindernear 123e1 7999999999999999 -> 1230
+dqrmn967 remaindernear 123e1 8999999999999999 -> 1230
+dqrmn968 remaindernear 123e1 9999999999999999 -> 1230
+dqrmn969 remaindernear 123e1 9876543210987654 -> 1230
+
+dqrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
+
+-- overflow and underflow tests [from divide]
+dqrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible
+dqrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible
+dqrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible
+dqrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible
+dqrmn1055 remaindernear 1e-277 1e+311 -> 1E-277
+dqrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277
+dqrmn1057 remaindernear -1e-277 1e+311 -> -1E-277
+dqrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
+
+-- Gyuris example
+dqrmn1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
+
+-- destructive subtract
+dqrmn1101 remaindernear 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> -0.234567890123456789012345678901233
+dqrmn1102 remaindernear 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> -0.34567890123456789012345678901222
+dqrmn1103 remaindernear 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> -0.4567890123456789012345678901111
+dqrmn1104 remaindernear 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> -1.308641972530864197253086419725314
+dqrmn1105 remaindernear 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692
+dqrmn1106 remaindernear 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> -1.3086421975308642197530864219748
+dqrmn1107 remaindernear 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247
+dqrmn1108 remaindernear 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> -0.753086421975308642197530864219753
+dqrmn1109 remaindernear 1234567890123456789012345678901234 5.000000000000000000000000000000001 -> -1.246913578024691357802469135780247
+dqrmn1110 remaindernear 1234567890123456789012345678901234 5.00000000000000000000000000000001 -> 1.53086421975308642197530864219754
+dqrmn1111 remaindernear 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> -0.6913578024691357802469135780242
+
+-- Null tests
+dqrmn1000 remaindernear 10 # -> NaN Invalid_operation
+dqrmn1001 remaindernear # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqRotate.decTest b/Lib/test/decimaltestdata/dqRotate.decTest
index edcf9eed23..858b823e08 100644
--- a/Lib/test/decimaltestdata/dqRotate.decTest
+++ b/Lib/test/decimaltestdata/dqRotate.decTest
@@ -1,298 +1,298 @@
-------------------------------------------------------------------------
--- dqRotate.decTest -- rotate decQuad coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqrot001 rotate 0 0 -> 0
-dqrot002 rotate 0 2 -> 0
-dqrot003 rotate 1 2 -> 100
-dqrot004 rotate 1 33 -> 1000000000000000000000000000000000
-dqrot005 rotate 1 34 -> 1
-dqrot006 rotate 1 -1 -> 1000000000000000000000000000000000
-dqrot007 rotate 0 -2 -> 0
-dqrot008 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123
-dqrot009 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341
-dqrot010 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234
-dqrot011 rotate 9934567890123456789012345678901234 -33 -> 9345678901234567890123456789012349
-dqrot012 rotate 9934567890123456789012345678901234 -34 -> 9934567890123456789012345678901234
-
--- rhs must be an integer
-dqrot015 rotate 1 1.5 -> NaN Invalid_operation
-dqrot016 rotate 1 1.0 -> NaN Invalid_operation
-dqrot017 rotate 1 0.1 -> NaN Invalid_operation
-dqrot018 rotate 1 0.0 -> NaN Invalid_operation
-dqrot019 rotate 1 1E+1 -> NaN Invalid_operation
-dqrot020 rotate 1 1E+99 -> NaN Invalid_operation
-dqrot021 rotate 1 Inf -> NaN Invalid_operation
-dqrot022 rotate 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-dqrot025 rotate 1 -1000 -> NaN Invalid_operation
-dqrot026 rotate 1 -35 -> NaN Invalid_operation
-dqrot027 rotate 1 35 -> NaN Invalid_operation
-dqrot028 rotate 1 1000 -> NaN Invalid_operation
-
--- full pattern
-dqrot030 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234
-dqrot031 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341
-dqrot032 rotate 1234567890123456789012345678901234 -32 -> 3456789012345678901234567890123412
-dqrot033 rotate 1234567890123456789012345678901234 -31 -> 4567890123456789012345678901234123
-dqrot034 rotate 1234567890123456789012345678901234 -30 -> 5678901234567890123456789012341234
-dqrot035 rotate 1234567890123456789012345678901234 -29 -> 6789012345678901234567890123412345
-dqrot036 rotate 1234567890123456789012345678901234 -28 -> 7890123456789012345678901234123456
-dqrot037 rotate 1234567890123456789012345678901234 -27 -> 8901234567890123456789012341234567
-dqrot038 rotate 1234567890123456789012345678901234 -26 -> 9012345678901234567890123412345678
-dqrot039 rotate 1234567890123456789012345678901234 -25 -> 123456789012345678901234123456789
-dqrot040 rotate 1234567890123456789012345678901234 -24 -> 1234567890123456789012341234567890
-dqrot041 rotate 1234567890123456789012345678901234 -23 -> 2345678901234567890123412345678901
-dqrot042 rotate 1234567890123456789012345678901234 -22 -> 3456789012345678901234123456789012
-dqrot043 rotate 1234567890123456789012345678901234 -21 -> 4567890123456789012341234567890123
-dqrot044 rotate 1234567890123456789012345678901234 -20 -> 5678901234567890123412345678901234
-dqrot045 rotate 1234567890123456789012345678901234 -19 -> 6789012345678901234123456789012345
-dqrot047 rotate 1234567890123456789012345678901234 -18 -> 7890123456789012341234567890123456
-dqrot048 rotate 1234567890123456789012345678901234 -17 -> 8901234567890123412345678901234567
-dqrot049 rotate 1234567890123456789012345678901234 -16 -> 9012345678901234123456789012345678
-dqrot050 rotate 1234567890123456789012345678901234 -15 -> 123456789012341234567890123456789
-dqrot051 rotate 1234567890123456789012345678901234 -14 -> 1234567890123412345678901234567890
-dqrot052 rotate 1234567890123456789012345678901234 -13 -> 2345678901234123456789012345678901
-dqrot053 rotate 1234567890123456789012345678901234 -12 -> 3456789012341234567890123456789012
-dqrot054 rotate 1234567890123456789012345678901234 -11 -> 4567890123412345678901234567890123
-dqrot055 rotate 1234567890123456789012345678901234 -10 -> 5678901234123456789012345678901234
-dqrot056 rotate 1234567890123456789012345678901234 -9 -> 6789012341234567890123456789012345
-dqrot057 rotate 1234567890123456789012345678901234 -8 -> 7890123412345678901234567890123456
-dqrot058 rotate 1234567890123456789012345678901234 -7 -> 8901234123456789012345678901234567
-dqrot059 rotate 1234567890123456789012345678901234 -6 -> 9012341234567890123456789012345678
-dqrot060 rotate 1234567890123456789012345678901234 -5 -> 123412345678901234567890123456789
-dqrot061 rotate 1234567890123456789012345678901234 -4 -> 1234123456789012345678901234567890
-dqrot062 rotate 1234567890123456789012345678901234 -3 -> 2341234567890123456789012345678901
-dqrot063 rotate 1234567890123456789012345678901234 -2 -> 3412345678901234567890123456789012
-dqrot064 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123
-dqrot065 rotate 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234
-
-dqrot066 rotate 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234
-dqrot067 rotate 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012341
-dqrot068 rotate 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123412
-dqrot069 rotate 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234123
-dqrot070 rotate 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012341234
-dqrot071 rotate 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123412345
-dqrot072 rotate 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234123456
-dqrot073 rotate 1234567890123456789012345678901234 +7 -> 8901234567890123456789012341234567
-dqrot074 rotate 1234567890123456789012345678901234 +8 -> 9012345678901234567890123412345678
-dqrot075 rotate 1234567890123456789012345678901234 +9 -> 123456789012345678901234123456789
-dqrot076 rotate 1234567890123456789012345678901234 +10 -> 1234567890123456789012341234567890
-dqrot077 rotate 1234567890123456789012345678901234 +11 -> 2345678901234567890123412345678901
-dqrot078 rotate 1234567890123456789012345678901234 +12 -> 3456789012345678901234123456789012
-dqrot079 rotate 1234567890123456789012345678901234 +13 -> 4567890123456789012341234567890123
-dqrot080 rotate 1234567890123456789012345678901234 +14 -> 5678901234567890123412345678901234
-dqrot081 rotate 1234567890123456789012345678901234 +15 -> 6789012345678901234123456789012345
-dqrot082 rotate 1234567890123456789012345678901234 +16 -> 7890123456789012341234567890123456
-dqrot083 rotate 1234567890123456789012345678901234 +17 -> 8901234567890123412345678901234567
-dqrot084 rotate 1234567890123456789012345678901234 +18 -> 9012345678901234123456789012345678
-dqrot085 rotate 1234567890123456789012345678901234 +19 -> 123456789012341234567890123456789
-dqrot086 rotate 1234567890123456789012345678901234 +20 -> 1234567890123412345678901234567890
-dqrot087 rotate 1234567890123456789012345678901234 +21 -> 2345678901234123456789012345678901
-dqrot088 rotate 1234567890123456789012345678901234 +22 -> 3456789012341234567890123456789012
-dqrot089 rotate 1234567890123456789012345678901234 +23 -> 4567890123412345678901234567890123
-dqrot090 rotate 1234567890123456789012345678901234 +24 -> 5678901234123456789012345678901234
-dqrot091 rotate 1234567890123456789012345678901234 +25 -> 6789012341234567890123456789012345
-dqrot092 rotate 1234567890123456789012345678901234 +26 -> 7890123412345678901234567890123456
-dqrot093 rotate 1234567890123456789012345678901234 +27 -> 8901234123456789012345678901234567
-dqrot094 rotate 1234567890123456789012345678901234 +28 -> 9012341234567890123456789012345678
-dqrot095 rotate 1234567890123456789012345678901234 +29 -> 123412345678901234567890123456789
-dqrot096 rotate 1234567890123456789012345678901234 +30 -> 1234123456789012345678901234567890
-dqrot097 rotate 1234567890123456789012345678901234 +31 -> 2341234567890123456789012345678901
-dqrot098 rotate 1234567890123456789012345678901234 +32 -> 3412345678901234567890123456789012
-dqrot099 rotate 1234567890123456789012345678901234 +33 -> 4123456789012345678901234567890123
-dqrot100 rotate 1234567890123456789012345678901234 +34 -> 1234567890123456789012345678901234
-
--- zeros
-dqrot270 rotate 0E-10 +29 -> 0E-10
-dqrot271 rotate 0E-10 -29 -> 0E-10
-dqrot272 rotate 0.000 +29 -> 0.000
-dqrot273 rotate 0.000 -29 -> 0.000
-dqrot274 rotate 0E+10 +29 -> 0E+10
-dqrot275 rotate 0E+10 -29 -> 0E+10
-dqrot276 rotate -0E-10 +29 -> -0E-10
-dqrot277 rotate -0E-10 -29 -> -0E-10
-dqrot278 rotate -0.000 +29 -> -0.000
-dqrot279 rotate -0.000 -29 -> -0.000
-dqrot280 rotate -0E+10 +29 -> -0E+10
-dqrot281 rotate -0E+10 -29 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-dqrot141 rotate 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6144
-dqrot142 rotate 9.999999999999999999999999999999999E+6144 -33 -> 9.999999999999999999999999999999999E+6144
-dqrot143 rotate 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144
-dqrot144 rotate 9.999999999999999999999999999999999E+6144 33 -> 9.999999999999999999999999999999999E+6144
-dqrot145 rotate 1E-6143 -1 -> 1.000000000000000000000000000000000E-6110
-dqrot146 rotate 1E-6143 -33 -> 1.0E-6142
-dqrot147 rotate 1E-6143 1 -> 1.0E-6142
-dqrot148 rotate 1E-6143 33 -> 1.000000000000000000000000000000000E-6110
-dqrot151 rotate 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144
-dqrot152 rotate 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176
-dqrot153 rotate 1.000000000000000000000000000000000E-6143 1 -> 1E-6176
-dqrot154 rotate 1.000000000000000000000000000000000E-6143 33 -> 1.00000000000000000000000000000000E-6144
-dqrot155 rotate 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144
-dqrot156 rotate 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176
-dqrot157 rotate 9.000000000000000000000000000000000E-6143 1 -> 9E-6176
-dqrot158 rotate 9.000000000000000000000000000000000E-6143 33 -> 9.00000000000000000000000000000000E-6144
-dqrot160 rotate 1E-6176 -1 -> 1.000000000000000000000000000000000E-6143
-dqrot161 rotate 1E-6176 -33 -> 1.0E-6175
-dqrot162 rotate 1E-6176 1 -> 1.0E-6175
-dqrot163 rotate 1E-6176 33 -> 1.000000000000000000000000000000000E-6143
--- negatives
-dqrot171 rotate -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144
-dqrot172 rotate -9.999999999999999999999999999999999E+6144 -33 -> -9.999999999999999999999999999999999E+6144
-dqrot173 rotate -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999999E+6144
-dqrot174 rotate -9.999999999999999999999999999999999E+6144 33 -> -9.999999999999999999999999999999999E+6144
-dqrot175 rotate -1E-6143 -1 -> -1.000000000000000000000000000000000E-6110
-dqrot176 rotate -1E-6143 -33 -> -1.0E-6142
-dqrot177 rotate -1E-6143 1 -> -1.0E-6142
-dqrot178 rotate -1E-6143 33 -> -1.000000000000000000000000000000000E-6110
-dqrot181 rotate -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144
-dqrot182 rotate -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176
-dqrot183 rotate -1.000000000000000000000000000000000E-6143 1 -> -1E-6176
-dqrot184 rotate -1.000000000000000000000000000000000E-6143 33 -> -1.00000000000000000000000000000000E-6144
-dqrot185 rotate -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144
-dqrot186 rotate -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176
-dqrot187 rotate -9.000000000000000000000000000000000E-6143 1 -> -9E-6176
-dqrot188 rotate -9.000000000000000000000000000000000E-6143 33 -> -9.00000000000000000000000000000000E-6144
-dqrot190 rotate -1E-6176 -1 -> -1.000000000000000000000000000000000E-6143
-dqrot191 rotate -1E-6176 -33 -> -1.0E-6175
-dqrot192 rotate -1E-6176 1 -> -1.0E-6175
-dqrot193 rotate -1E-6176 33 -> -1.000000000000000000000000000000000E-6143
-
--- more negatives (of sanities)
-dqrot201 rotate -0 0 -> -0
-dqrot202 rotate -0 2 -> -0
-dqrot203 rotate -1 2 -> -100
-dqrot204 rotate -1 33 -> -1000000000000000000000000000000000
-dqrot205 rotate -1 34 -> -1
-dqrot206 rotate -1 -1 -> -1000000000000000000000000000000000
-dqrot207 rotate -0 -2 -> -0
-dqrot208 rotate -1234567890123456789012345678901234 -1 -> -4123456789012345678901234567890123
-dqrot209 rotate -1234567890123456789012345678901234 -33 -> -2345678901234567890123456789012341
-dqrot210 rotate -1234567890123456789012345678901234 -34 -> -1234567890123456789012345678901234
-dqrot211 rotate -9934567890123456789012345678901234 -33 -> -9345678901234567890123456789012349
-dqrot212 rotate -9934567890123456789012345678901234 -34 -> -9934567890123456789012345678901234
-
-
--- Specials; NaNs are handled as usual
-dqrot781 rotate -Inf -8 -> -Infinity
-dqrot782 rotate -Inf -1 -> -Infinity
-dqrot783 rotate -Inf -0 -> -Infinity
-dqrot784 rotate -Inf 0 -> -Infinity
-dqrot785 rotate -Inf 1 -> -Infinity
-dqrot786 rotate -Inf 8 -> -Infinity
-dqrot787 rotate -1000 -Inf -> NaN Invalid_operation
-dqrot788 rotate -Inf -Inf -> NaN Invalid_operation
-dqrot789 rotate -1 -Inf -> NaN Invalid_operation
-dqrot790 rotate -0 -Inf -> NaN Invalid_operation
-dqrot791 rotate 0 -Inf -> NaN Invalid_operation
-dqrot792 rotate 1 -Inf -> NaN Invalid_operation
-dqrot793 rotate 1000 -Inf -> NaN Invalid_operation
-dqrot794 rotate Inf -Inf -> NaN Invalid_operation
-
-dqrot800 rotate Inf -Inf -> NaN Invalid_operation
-dqrot801 rotate Inf -8 -> Infinity
-dqrot802 rotate Inf -1 -> Infinity
-dqrot803 rotate Inf -0 -> Infinity
-dqrot804 rotate Inf 0 -> Infinity
-dqrot805 rotate Inf 1 -> Infinity
-dqrot806 rotate Inf 8 -> Infinity
-dqrot807 rotate Inf Inf -> NaN Invalid_operation
-dqrot808 rotate -1000 Inf -> NaN Invalid_operation
-dqrot809 rotate -Inf Inf -> NaN Invalid_operation
-dqrot810 rotate -1 Inf -> NaN Invalid_operation
-dqrot811 rotate -0 Inf -> NaN Invalid_operation
-dqrot812 rotate 0 Inf -> NaN Invalid_operation
-dqrot813 rotate 1 Inf -> NaN Invalid_operation
-dqrot814 rotate 1000 Inf -> NaN Invalid_operation
-dqrot815 rotate Inf Inf -> NaN Invalid_operation
-
-dqrot821 rotate NaN -Inf -> NaN
-dqrot822 rotate NaN -1000 -> NaN
-dqrot823 rotate NaN -1 -> NaN
-dqrot824 rotate NaN -0 -> NaN
-dqrot825 rotate NaN 0 -> NaN
-dqrot826 rotate NaN 1 -> NaN
-dqrot827 rotate NaN 1000 -> NaN
-dqrot828 rotate NaN Inf -> NaN
-dqrot829 rotate NaN NaN -> NaN
-dqrot830 rotate -Inf NaN -> NaN
-dqrot831 rotate -1000 NaN -> NaN
-dqrot832 rotate -1 NaN -> NaN
-dqrot833 rotate -0 NaN -> NaN
-dqrot834 rotate 0 NaN -> NaN
-dqrot835 rotate 1 NaN -> NaN
-dqrot836 rotate 1000 NaN -> NaN
-dqrot837 rotate Inf NaN -> NaN
-
-dqrot841 rotate sNaN -Inf -> NaN Invalid_operation
-dqrot842 rotate sNaN -1000 -> NaN Invalid_operation
-dqrot843 rotate sNaN -1 -> NaN Invalid_operation
-dqrot844 rotate sNaN -0 -> NaN Invalid_operation
-dqrot845 rotate sNaN 0 -> NaN Invalid_operation
-dqrot846 rotate sNaN 1 -> NaN Invalid_operation
-dqrot847 rotate sNaN 1000 -> NaN Invalid_operation
-dqrot848 rotate sNaN NaN -> NaN Invalid_operation
-dqrot849 rotate sNaN sNaN -> NaN Invalid_operation
-dqrot850 rotate NaN sNaN -> NaN Invalid_operation
-dqrot851 rotate -Inf sNaN -> NaN Invalid_operation
-dqrot852 rotate -1000 sNaN -> NaN Invalid_operation
-dqrot853 rotate -1 sNaN -> NaN Invalid_operation
-dqrot854 rotate -0 sNaN -> NaN Invalid_operation
-dqrot855 rotate 0 sNaN -> NaN Invalid_operation
-dqrot856 rotate 1 sNaN -> NaN Invalid_operation
-dqrot857 rotate 1000 sNaN -> NaN Invalid_operation
-dqrot858 rotate Inf sNaN -> NaN Invalid_operation
-dqrot859 rotate NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqrot861 rotate NaN1 -Inf -> NaN1
-dqrot862 rotate +NaN2 -1000 -> NaN2
-dqrot863 rotate NaN3 1000 -> NaN3
-dqrot864 rotate NaN4 Inf -> NaN4
-dqrot865 rotate NaN5 +NaN6 -> NaN5
-dqrot866 rotate -Inf NaN7 -> NaN7
-dqrot867 rotate -1000 NaN8 -> NaN8
-dqrot868 rotate 1000 NaN9 -> NaN9
-dqrot869 rotate Inf +NaN10 -> NaN10
-dqrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
-dqrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
-dqrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation
-dqrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
-dqrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
-dqrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
-dqrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
-dqrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
-dqrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation
-dqrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqrot882 rotate -NaN26 NaN28 -> -NaN26
-dqrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqrot884 rotate 1000 -NaN30 -> -NaN30
-dqrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- dqRotate.decTest -- rotate decQuad coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqrot001 rotate 0 0 -> 0
+dqrot002 rotate 0 2 -> 0
+dqrot003 rotate 1 2 -> 100
+dqrot004 rotate 1 33 -> 1000000000000000000000000000000000
+dqrot005 rotate 1 34 -> 1
+dqrot006 rotate 1 -1 -> 1000000000000000000000000000000000
+dqrot007 rotate 0 -2 -> 0
+dqrot008 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123
+dqrot009 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341
+dqrot010 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234
+dqrot011 rotate 9934567890123456789012345678901234 -33 -> 9345678901234567890123456789012349
+dqrot012 rotate 9934567890123456789012345678901234 -34 -> 9934567890123456789012345678901234
+
+-- rhs must be an integer
+dqrot015 rotate 1 1.5 -> NaN Invalid_operation
+dqrot016 rotate 1 1.0 -> NaN Invalid_operation
+dqrot017 rotate 1 0.1 -> NaN Invalid_operation
+dqrot018 rotate 1 0.0 -> NaN Invalid_operation
+dqrot019 rotate 1 1E+1 -> NaN Invalid_operation
+dqrot020 rotate 1 1E+99 -> NaN Invalid_operation
+dqrot021 rotate 1 Inf -> NaN Invalid_operation
+dqrot022 rotate 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+dqrot025 rotate 1 -1000 -> NaN Invalid_operation
+dqrot026 rotate 1 -35 -> NaN Invalid_operation
+dqrot027 rotate 1 35 -> NaN Invalid_operation
+dqrot028 rotate 1 1000 -> NaN Invalid_operation
+
+-- full pattern
+dqrot030 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234
+dqrot031 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341
+dqrot032 rotate 1234567890123456789012345678901234 -32 -> 3456789012345678901234567890123412
+dqrot033 rotate 1234567890123456789012345678901234 -31 -> 4567890123456789012345678901234123
+dqrot034 rotate 1234567890123456789012345678901234 -30 -> 5678901234567890123456789012341234
+dqrot035 rotate 1234567890123456789012345678901234 -29 -> 6789012345678901234567890123412345
+dqrot036 rotate 1234567890123456789012345678901234 -28 -> 7890123456789012345678901234123456
+dqrot037 rotate 1234567890123456789012345678901234 -27 -> 8901234567890123456789012341234567
+dqrot038 rotate 1234567890123456789012345678901234 -26 -> 9012345678901234567890123412345678
+dqrot039 rotate 1234567890123456789012345678901234 -25 -> 123456789012345678901234123456789
+dqrot040 rotate 1234567890123456789012345678901234 -24 -> 1234567890123456789012341234567890
+dqrot041 rotate 1234567890123456789012345678901234 -23 -> 2345678901234567890123412345678901
+dqrot042 rotate 1234567890123456789012345678901234 -22 -> 3456789012345678901234123456789012
+dqrot043 rotate 1234567890123456789012345678901234 -21 -> 4567890123456789012341234567890123
+dqrot044 rotate 1234567890123456789012345678901234 -20 -> 5678901234567890123412345678901234
+dqrot045 rotate 1234567890123456789012345678901234 -19 -> 6789012345678901234123456789012345
+dqrot047 rotate 1234567890123456789012345678901234 -18 -> 7890123456789012341234567890123456
+dqrot048 rotate 1234567890123456789012345678901234 -17 -> 8901234567890123412345678901234567
+dqrot049 rotate 1234567890123456789012345678901234 -16 -> 9012345678901234123456789012345678
+dqrot050 rotate 1234567890123456789012345678901234 -15 -> 123456789012341234567890123456789
+dqrot051 rotate 1234567890123456789012345678901234 -14 -> 1234567890123412345678901234567890
+dqrot052 rotate 1234567890123456789012345678901234 -13 -> 2345678901234123456789012345678901
+dqrot053 rotate 1234567890123456789012345678901234 -12 -> 3456789012341234567890123456789012
+dqrot054 rotate 1234567890123456789012345678901234 -11 -> 4567890123412345678901234567890123
+dqrot055 rotate 1234567890123456789012345678901234 -10 -> 5678901234123456789012345678901234
+dqrot056 rotate 1234567890123456789012345678901234 -9 -> 6789012341234567890123456789012345
+dqrot057 rotate 1234567890123456789012345678901234 -8 -> 7890123412345678901234567890123456
+dqrot058 rotate 1234567890123456789012345678901234 -7 -> 8901234123456789012345678901234567
+dqrot059 rotate 1234567890123456789012345678901234 -6 -> 9012341234567890123456789012345678
+dqrot060 rotate 1234567890123456789012345678901234 -5 -> 123412345678901234567890123456789
+dqrot061 rotate 1234567890123456789012345678901234 -4 -> 1234123456789012345678901234567890
+dqrot062 rotate 1234567890123456789012345678901234 -3 -> 2341234567890123456789012345678901
+dqrot063 rotate 1234567890123456789012345678901234 -2 -> 3412345678901234567890123456789012
+dqrot064 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123
+dqrot065 rotate 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234
+
+dqrot066 rotate 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234
+dqrot067 rotate 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012341
+dqrot068 rotate 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123412
+dqrot069 rotate 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234123
+dqrot070 rotate 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012341234
+dqrot071 rotate 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123412345
+dqrot072 rotate 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234123456
+dqrot073 rotate 1234567890123456789012345678901234 +7 -> 8901234567890123456789012341234567
+dqrot074 rotate 1234567890123456789012345678901234 +8 -> 9012345678901234567890123412345678
+dqrot075 rotate 1234567890123456789012345678901234 +9 -> 123456789012345678901234123456789
+dqrot076 rotate 1234567890123456789012345678901234 +10 -> 1234567890123456789012341234567890
+dqrot077 rotate 1234567890123456789012345678901234 +11 -> 2345678901234567890123412345678901
+dqrot078 rotate 1234567890123456789012345678901234 +12 -> 3456789012345678901234123456789012
+dqrot079 rotate 1234567890123456789012345678901234 +13 -> 4567890123456789012341234567890123
+dqrot080 rotate 1234567890123456789012345678901234 +14 -> 5678901234567890123412345678901234
+dqrot081 rotate 1234567890123456789012345678901234 +15 -> 6789012345678901234123456789012345
+dqrot082 rotate 1234567890123456789012345678901234 +16 -> 7890123456789012341234567890123456
+dqrot083 rotate 1234567890123456789012345678901234 +17 -> 8901234567890123412345678901234567
+dqrot084 rotate 1234567890123456789012345678901234 +18 -> 9012345678901234123456789012345678
+dqrot085 rotate 1234567890123456789012345678901234 +19 -> 123456789012341234567890123456789
+dqrot086 rotate 1234567890123456789012345678901234 +20 -> 1234567890123412345678901234567890
+dqrot087 rotate 1234567890123456789012345678901234 +21 -> 2345678901234123456789012345678901
+dqrot088 rotate 1234567890123456789012345678901234 +22 -> 3456789012341234567890123456789012
+dqrot089 rotate 1234567890123456789012345678901234 +23 -> 4567890123412345678901234567890123
+dqrot090 rotate 1234567890123456789012345678901234 +24 -> 5678901234123456789012345678901234
+dqrot091 rotate 1234567890123456789012345678901234 +25 -> 6789012341234567890123456789012345
+dqrot092 rotate 1234567890123456789012345678901234 +26 -> 7890123412345678901234567890123456
+dqrot093 rotate 1234567890123456789012345678901234 +27 -> 8901234123456789012345678901234567
+dqrot094 rotate 1234567890123456789012345678901234 +28 -> 9012341234567890123456789012345678
+dqrot095 rotate 1234567890123456789012345678901234 +29 -> 123412345678901234567890123456789
+dqrot096 rotate 1234567890123456789012345678901234 +30 -> 1234123456789012345678901234567890
+dqrot097 rotate 1234567890123456789012345678901234 +31 -> 2341234567890123456789012345678901
+dqrot098 rotate 1234567890123456789012345678901234 +32 -> 3412345678901234567890123456789012
+dqrot099 rotate 1234567890123456789012345678901234 +33 -> 4123456789012345678901234567890123
+dqrot100 rotate 1234567890123456789012345678901234 +34 -> 1234567890123456789012345678901234
+
+-- zeros
+dqrot270 rotate 0E-10 +29 -> 0E-10
+dqrot271 rotate 0E-10 -29 -> 0E-10
+dqrot272 rotate 0.000 +29 -> 0.000
+dqrot273 rotate 0.000 -29 -> 0.000
+dqrot274 rotate 0E+10 +29 -> 0E+10
+dqrot275 rotate 0E+10 -29 -> 0E+10
+dqrot276 rotate -0E-10 +29 -> -0E-10
+dqrot277 rotate -0E-10 -29 -> -0E-10
+dqrot278 rotate -0.000 +29 -> -0.000
+dqrot279 rotate -0.000 -29 -> -0.000
+dqrot280 rotate -0E+10 +29 -> -0E+10
+dqrot281 rotate -0E+10 -29 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+dqrot141 rotate 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6144
+dqrot142 rotate 9.999999999999999999999999999999999E+6144 -33 -> 9.999999999999999999999999999999999E+6144
+dqrot143 rotate 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144
+dqrot144 rotate 9.999999999999999999999999999999999E+6144 33 -> 9.999999999999999999999999999999999E+6144
+dqrot145 rotate 1E-6143 -1 -> 1.000000000000000000000000000000000E-6110
+dqrot146 rotate 1E-6143 -33 -> 1.0E-6142
+dqrot147 rotate 1E-6143 1 -> 1.0E-6142
+dqrot148 rotate 1E-6143 33 -> 1.000000000000000000000000000000000E-6110
+dqrot151 rotate 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144
+dqrot152 rotate 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176
+dqrot153 rotate 1.000000000000000000000000000000000E-6143 1 -> 1E-6176
+dqrot154 rotate 1.000000000000000000000000000000000E-6143 33 -> 1.00000000000000000000000000000000E-6144
+dqrot155 rotate 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144
+dqrot156 rotate 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176
+dqrot157 rotate 9.000000000000000000000000000000000E-6143 1 -> 9E-6176
+dqrot158 rotate 9.000000000000000000000000000000000E-6143 33 -> 9.00000000000000000000000000000000E-6144
+dqrot160 rotate 1E-6176 -1 -> 1.000000000000000000000000000000000E-6143
+dqrot161 rotate 1E-6176 -33 -> 1.0E-6175
+dqrot162 rotate 1E-6176 1 -> 1.0E-6175
+dqrot163 rotate 1E-6176 33 -> 1.000000000000000000000000000000000E-6143
+-- negatives
+dqrot171 rotate -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144
+dqrot172 rotate -9.999999999999999999999999999999999E+6144 -33 -> -9.999999999999999999999999999999999E+6144
+dqrot173 rotate -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999999E+6144
+dqrot174 rotate -9.999999999999999999999999999999999E+6144 33 -> -9.999999999999999999999999999999999E+6144
+dqrot175 rotate -1E-6143 -1 -> -1.000000000000000000000000000000000E-6110
+dqrot176 rotate -1E-6143 -33 -> -1.0E-6142
+dqrot177 rotate -1E-6143 1 -> -1.0E-6142
+dqrot178 rotate -1E-6143 33 -> -1.000000000000000000000000000000000E-6110
+dqrot181 rotate -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144
+dqrot182 rotate -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176
+dqrot183 rotate -1.000000000000000000000000000000000E-6143 1 -> -1E-6176
+dqrot184 rotate -1.000000000000000000000000000000000E-6143 33 -> -1.00000000000000000000000000000000E-6144
+dqrot185 rotate -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144
+dqrot186 rotate -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176
+dqrot187 rotate -9.000000000000000000000000000000000E-6143 1 -> -9E-6176
+dqrot188 rotate -9.000000000000000000000000000000000E-6143 33 -> -9.00000000000000000000000000000000E-6144
+dqrot190 rotate -1E-6176 -1 -> -1.000000000000000000000000000000000E-6143
+dqrot191 rotate -1E-6176 -33 -> -1.0E-6175
+dqrot192 rotate -1E-6176 1 -> -1.0E-6175
+dqrot193 rotate -1E-6176 33 -> -1.000000000000000000000000000000000E-6143
+
+-- more negatives (of sanities)
+dqrot201 rotate -0 0 -> -0
+dqrot202 rotate -0 2 -> -0
+dqrot203 rotate -1 2 -> -100
+dqrot204 rotate -1 33 -> -1000000000000000000000000000000000
+dqrot205 rotate -1 34 -> -1
+dqrot206 rotate -1 -1 -> -1000000000000000000000000000000000
+dqrot207 rotate -0 -2 -> -0
+dqrot208 rotate -1234567890123456789012345678901234 -1 -> -4123456789012345678901234567890123
+dqrot209 rotate -1234567890123456789012345678901234 -33 -> -2345678901234567890123456789012341
+dqrot210 rotate -1234567890123456789012345678901234 -34 -> -1234567890123456789012345678901234
+dqrot211 rotate -9934567890123456789012345678901234 -33 -> -9345678901234567890123456789012349
+dqrot212 rotate -9934567890123456789012345678901234 -34 -> -9934567890123456789012345678901234
+
+
+-- Specials; NaNs are handled as usual
+dqrot781 rotate -Inf -8 -> -Infinity
+dqrot782 rotate -Inf -1 -> -Infinity
+dqrot783 rotate -Inf -0 -> -Infinity
+dqrot784 rotate -Inf 0 -> -Infinity
+dqrot785 rotate -Inf 1 -> -Infinity
+dqrot786 rotate -Inf 8 -> -Infinity
+dqrot787 rotate -1000 -Inf -> NaN Invalid_operation
+dqrot788 rotate -Inf -Inf -> NaN Invalid_operation
+dqrot789 rotate -1 -Inf -> NaN Invalid_operation
+dqrot790 rotate -0 -Inf -> NaN Invalid_operation
+dqrot791 rotate 0 -Inf -> NaN Invalid_operation
+dqrot792 rotate 1 -Inf -> NaN Invalid_operation
+dqrot793 rotate 1000 -Inf -> NaN Invalid_operation
+dqrot794 rotate Inf -Inf -> NaN Invalid_operation
+
+dqrot800 rotate Inf -Inf -> NaN Invalid_operation
+dqrot801 rotate Inf -8 -> Infinity
+dqrot802 rotate Inf -1 -> Infinity
+dqrot803 rotate Inf -0 -> Infinity
+dqrot804 rotate Inf 0 -> Infinity
+dqrot805 rotate Inf 1 -> Infinity
+dqrot806 rotate Inf 8 -> Infinity
+dqrot807 rotate Inf Inf -> NaN Invalid_operation
+dqrot808 rotate -1000 Inf -> NaN Invalid_operation
+dqrot809 rotate -Inf Inf -> NaN Invalid_operation
+dqrot810 rotate -1 Inf -> NaN Invalid_operation
+dqrot811 rotate -0 Inf -> NaN Invalid_operation
+dqrot812 rotate 0 Inf -> NaN Invalid_operation
+dqrot813 rotate 1 Inf -> NaN Invalid_operation
+dqrot814 rotate 1000 Inf -> NaN Invalid_operation
+dqrot815 rotate Inf Inf -> NaN Invalid_operation
+
+dqrot821 rotate NaN -Inf -> NaN
+dqrot822 rotate NaN -1000 -> NaN
+dqrot823 rotate NaN -1 -> NaN
+dqrot824 rotate NaN -0 -> NaN
+dqrot825 rotate NaN 0 -> NaN
+dqrot826 rotate NaN 1 -> NaN
+dqrot827 rotate NaN 1000 -> NaN
+dqrot828 rotate NaN Inf -> NaN
+dqrot829 rotate NaN NaN -> NaN
+dqrot830 rotate -Inf NaN -> NaN
+dqrot831 rotate -1000 NaN -> NaN
+dqrot832 rotate -1 NaN -> NaN
+dqrot833 rotate -0 NaN -> NaN
+dqrot834 rotate 0 NaN -> NaN
+dqrot835 rotate 1 NaN -> NaN
+dqrot836 rotate 1000 NaN -> NaN
+dqrot837 rotate Inf NaN -> NaN
+
+dqrot841 rotate sNaN -Inf -> NaN Invalid_operation
+dqrot842 rotate sNaN -1000 -> NaN Invalid_operation
+dqrot843 rotate sNaN -1 -> NaN Invalid_operation
+dqrot844 rotate sNaN -0 -> NaN Invalid_operation
+dqrot845 rotate sNaN 0 -> NaN Invalid_operation
+dqrot846 rotate sNaN 1 -> NaN Invalid_operation
+dqrot847 rotate sNaN 1000 -> NaN Invalid_operation
+dqrot848 rotate sNaN NaN -> NaN Invalid_operation
+dqrot849 rotate sNaN sNaN -> NaN Invalid_operation
+dqrot850 rotate NaN sNaN -> NaN Invalid_operation
+dqrot851 rotate -Inf sNaN -> NaN Invalid_operation
+dqrot852 rotate -1000 sNaN -> NaN Invalid_operation
+dqrot853 rotate -1 sNaN -> NaN Invalid_operation
+dqrot854 rotate -0 sNaN -> NaN Invalid_operation
+dqrot855 rotate 0 sNaN -> NaN Invalid_operation
+dqrot856 rotate 1 sNaN -> NaN Invalid_operation
+dqrot857 rotate 1000 sNaN -> NaN Invalid_operation
+dqrot858 rotate Inf sNaN -> NaN Invalid_operation
+dqrot859 rotate NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqrot861 rotate NaN1 -Inf -> NaN1
+dqrot862 rotate +NaN2 -1000 -> NaN2
+dqrot863 rotate NaN3 1000 -> NaN3
+dqrot864 rotate NaN4 Inf -> NaN4
+dqrot865 rotate NaN5 +NaN6 -> NaN5
+dqrot866 rotate -Inf NaN7 -> NaN7
+dqrot867 rotate -1000 NaN8 -> NaN8
+dqrot868 rotate 1000 NaN9 -> NaN9
+dqrot869 rotate Inf +NaN10 -> NaN10
+dqrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
+dqrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
+dqrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation
+dqrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
+dqrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
+dqrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
+dqrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
+dqrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
+dqrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation
+dqrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqrot882 rotate -NaN26 NaN28 -> -NaN26
+dqrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqrot884 rotate 1000 -NaN30 -> -NaN30
+dqrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqSameQuantum.decTest b/Lib/test/decimaltestdata/dqSameQuantum.decTest
index 257cda802d..2f356bbae9 100644
--- a/Lib/test/decimaltestdata/dqSameQuantum.decTest
+++ b/Lib/test/decimaltestdata/dqSameQuantum.decTest
@@ -1,389 +1,389 @@
-------------------------------------------------------------------------
--- dqSameQuantum.decTest -- check decQuad quantums match --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqsamq001 samequantum 0 0 -> 1
-dqsamq002 samequantum 0 1 -> 1
-dqsamq003 samequantum 1 0 -> 1
-dqsamq004 samequantum 1 1 -> 1
-
-dqsamq011 samequantum 10 1E+1 -> 0
-dqsamq012 samequantum 10E+1 10E+1 -> 1
-dqsamq013 samequantum 100 10E+1 -> 0
-dqsamq014 samequantum 100 1E+2 -> 0
-dqsamq015 samequantum 0.1 1E-2 -> 0
-dqsamq016 samequantum 0.1 1E-1 -> 1
-dqsamq017 samequantum 0.1 1E-0 -> 0
-dqsamq018 samequantum 999 999 -> 1
-dqsamq019 samequantum 999E-1 99.9 -> 1
-dqsamq020 samequantum 111E-1 22.2 -> 1
-dqsamq021 samequantum 111E-1 1234.2 -> 1
-
--- zeros
-dqsamq030 samequantum 0.0 1.1 -> 1
-dqsamq031 samequantum 0.0 1.11 -> 0
-dqsamq032 samequantum 0.0 0 -> 0
-dqsamq033 samequantum 0.0 0.0 -> 1
-dqsamq034 samequantum 0.0 0.00 -> 0
-dqsamq035 samequantum 0E+1 0E+0 -> 0
-dqsamq036 samequantum 0E+1 0E+1 -> 1
-dqsamq037 samequantum 0E+1 0E+2 -> 0
-dqsamq038 samequantum 0E-17 0E-16 -> 0
-dqsamq039 samequantum 0E-17 0E-17 -> 1
-dqsamq040 samequantum 0E-17 0E-18 -> 0
-dqsamq041 samequantum 0E-17 0.0E-15 -> 0
-dqsamq042 samequantum 0E-17 0.0E-16 -> 1
-dqsamq043 samequantum 0E-17 0.0E-17 -> 0
-dqsamq044 samequantum -0E-17 0.0E-16 -> 1
-dqsamq045 samequantum 0E-17 -0.0E-17 -> 0
-dqsamq046 samequantum 0E-17 -0.0E-16 -> 1
-dqsamq047 samequantum -0E-17 0.0E-17 -> 0
-dqsamq048 samequantum -0E-17 -0.0E-16 -> 1
-dqsamq049 samequantum -0E-17 -0.0E-17 -> 0
-
--- Nmax, Nmin, Ntiny
-dqsamq051 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1
-dqsamq052 samequantum 1E-6143 1E-6143 -> 1
-dqsamq053 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1
-dqsamq054 samequantum 1E-6176 1E-6176 -> 1
-dqsamq055 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1
-dqsamq056 samequantum 1E-6143 1E-6143 -> 1
-dqsamq057 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1
-dqsamq058 samequantum 1E-6176 1E-6176 -> 1
-
-dqsamq061 samequantum -1E-6176 -1E-6176 -> 1
-dqsamq062 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1
-dqsamq063 samequantum -1E-6143 -1E-6143 -> 1
-dqsamq064 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1
-dqsamq065 samequantum -1E-6176 -1E-6176 -> 1
-dqsamq066 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1
-dqsamq067 samequantum -1E-6143 -1E-6143 -> 1
-dqsamq068 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1
-
-dqsamq071 samequantum -4E-6176 -1E-6176 -> 1
-dqsamq072 samequantum -4.00000000000000000000000000000000E-6143 -1.00000000000000000000000000004000E-6143 -> 1
-dqsamq073 samequantum -4E-6143 -1E-6143 -> 1
-dqsamq074 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6144 -> 1
-dqsamq075 samequantum -4E-6176 -1E-6176 -> 1
-dqsamq076 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6143 -> 1
-dqsamq077 samequantum -4E-6143 -1E-6143 -> 1
-dqsamq078 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6144 -> 1
-
-dqsamq081 samequantum -4E-1006 -1E-6176 -> 0
-dqsamq082 samequantum -4.00000000000000000000000000000000E-6143 -1.00004000000000000000000000000000E-6136 -> 0
-dqsamq083 samequantum -4E-6140 -1E-6143 -> 0
-dqsamq084 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6136 -> 0
-dqsamq085 samequantum -4E-1006 -1E-6176 -> 0
-dqsamq086 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6136 -> 0
-dqsamq087 samequantum -4E-6133 -1E-6143 -> 0
-dqsamq088 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6136 -> 0
-
--- specials & combinations
-dqsamq0110 samequantum -Inf -Inf -> 1
-dqsamq0111 samequantum -Inf Inf -> 1
-dqsamq0112 samequantum -Inf NaN -> 0
-dqsamq0113 samequantum -Inf -7E+3 -> 0
-dqsamq0114 samequantum -Inf -7 -> 0
-dqsamq0115 samequantum -Inf -7E-3 -> 0
-dqsamq0116 samequantum -Inf -0E-3 -> 0
-dqsamq0117 samequantum -Inf -0 -> 0
-dqsamq0118 samequantum -Inf -0E+3 -> 0
-dqsamq0119 samequantum -Inf 0E-3 -> 0
-dqsamq0120 samequantum -Inf 0 -> 0
-dqsamq0121 samequantum -Inf 0E+3 -> 0
-dqsamq0122 samequantum -Inf 7E-3 -> 0
-dqsamq0123 samequantum -Inf 7 -> 0
-dqsamq0124 samequantum -Inf 7E+3 -> 0
-dqsamq0125 samequantum -Inf sNaN -> 0
-
-dqsamq0210 samequantum Inf -Inf -> 1
-dqsamq0211 samequantum Inf Inf -> 1
-dqsamq0212 samequantum Inf NaN -> 0
-dqsamq0213 samequantum Inf -7E+3 -> 0
-dqsamq0214 samequantum Inf -7 -> 0
-dqsamq0215 samequantum Inf -7E-3 -> 0
-dqsamq0216 samequantum Inf -0E-3 -> 0
-dqsamq0217 samequantum Inf -0 -> 0
-dqsamq0218 samequantum Inf -0E+3 -> 0
-dqsamq0219 samequantum Inf 0E-3 -> 0
-dqsamq0220 samequantum Inf 0 -> 0
-dqsamq0221 samequantum Inf 0E+3 -> 0
-dqsamq0222 samequantum Inf 7E-3 -> 0
-dqsamq0223 samequantum Inf 7 -> 0
-dqsamq0224 samequantum Inf 7E+3 -> 0
-dqsamq0225 samequantum Inf sNaN -> 0
-
-dqsamq0310 samequantum NaN -Inf -> 0
-dqsamq0311 samequantum NaN Inf -> 0
-dqsamq0312 samequantum NaN NaN -> 1
-dqsamq0313 samequantum NaN -7E+3 -> 0
-dqsamq0314 samequantum NaN -7 -> 0
-dqsamq0315 samequantum NaN -7E-3 -> 0
-dqsamq0316 samequantum NaN -0E-3 -> 0
-dqsamq0317 samequantum NaN -0 -> 0
-dqsamq0318 samequantum NaN -0E+3 -> 0
-dqsamq0319 samequantum NaN 0E-3 -> 0
-dqsamq0320 samequantum NaN 0 -> 0
-dqsamq0321 samequantum NaN 0E+3 -> 0
-dqsamq0322 samequantum NaN 7E-3 -> 0
-dqsamq0323 samequantum NaN 7 -> 0
-dqsamq0324 samequantum NaN 7E+3 -> 0
-dqsamq0325 samequantum NaN sNaN -> 1
-
-dqsamq0410 samequantum -7E+3 -Inf -> 0
-dqsamq0411 samequantum -7E+3 Inf -> 0
-dqsamq0412 samequantum -7E+3 NaN -> 0
-dqsamq0413 samequantum -7E+3 -7E+3 -> 1
-dqsamq0414 samequantum -7E+3 -7 -> 0
-dqsamq0415 samequantum -7E+3 -7E-3 -> 0
-dqsamq0416 samequantum -7E+3 -0E-3 -> 0
-dqsamq0417 samequantum -7E+3 -0 -> 0
-dqsamq0418 samequantum -7E+3 -0E+3 -> 1
-dqsamq0419 samequantum -7E+3 0E-3 -> 0
-dqsamq0420 samequantum -7E+3 0 -> 0
-dqsamq0421 samequantum -7E+3 0E+3 -> 1
-dqsamq0422 samequantum -7E+3 7E-3 -> 0
-dqsamq0423 samequantum -7E+3 7 -> 0
-dqsamq0424 samequantum -7E+3 7E+3 -> 1
-dqsamq0425 samequantum -7E+3 sNaN -> 0
-
-dqsamq0510 samequantum -7 -Inf -> 0
-dqsamq0511 samequantum -7 Inf -> 0
-dqsamq0512 samequantum -7 NaN -> 0
-dqsamq0513 samequantum -7 -7E+3 -> 0
-dqsamq0514 samequantum -7 -7 -> 1
-dqsamq0515 samequantum -7 -7E-3 -> 0
-dqsamq0516 samequantum -7 -0E-3 -> 0
-dqsamq0517 samequantum -7 -0 -> 1
-dqsamq0518 samequantum -7 -0E+3 -> 0
-dqsamq0519 samequantum -7 0E-3 -> 0
-dqsamq0520 samequantum -7 0 -> 1
-dqsamq0521 samequantum -7 0E+3 -> 0
-dqsamq0522 samequantum -7 7E-3 -> 0
-dqsamq0523 samequantum -7 7 -> 1
-dqsamq0524 samequantum -7 7E+3 -> 0
-dqsamq0525 samequantum -7 sNaN -> 0
-
-dqsamq0610 samequantum -7E-3 -Inf -> 0
-dqsamq0611 samequantum -7E-3 Inf -> 0
-dqsamq0612 samequantum -7E-3 NaN -> 0
-dqsamq0613 samequantum -7E-3 -7E+3 -> 0
-dqsamq0614 samequantum -7E-3 -7 -> 0
-dqsamq0615 samequantum -7E-3 -7E-3 -> 1
-dqsamq0616 samequantum -7E-3 -0E-3 -> 1
-dqsamq0617 samequantum -7E-3 -0 -> 0
-dqsamq0618 samequantum -7E-3 -0E+3 -> 0
-dqsamq0619 samequantum -7E-3 0E-3 -> 1
-dqsamq0620 samequantum -7E-3 0 -> 0
-dqsamq0621 samequantum -7E-3 0E+3 -> 0
-dqsamq0622 samequantum -7E-3 7E-3 -> 1
-dqsamq0623 samequantum -7E-3 7 -> 0
-dqsamq0624 samequantum -7E-3 7E+3 -> 0
-dqsamq0625 samequantum -7E-3 sNaN -> 0
-
-dqsamq0710 samequantum -0E-3 -Inf -> 0
-dqsamq0711 samequantum -0E-3 Inf -> 0
-dqsamq0712 samequantum -0E-3 NaN -> 0
-dqsamq0713 samequantum -0E-3 -7E+3 -> 0
-dqsamq0714 samequantum -0E-3 -7 -> 0
-dqsamq0715 samequantum -0E-3 -7E-3 -> 1
-dqsamq0716 samequantum -0E-3 -0E-3 -> 1
-dqsamq0717 samequantum -0E-3 -0 -> 0
-dqsamq0718 samequantum -0E-3 -0E+3 -> 0
-dqsamq0719 samequantum -0E-3 0E-3 -> 1
-dqsamq0720 samequantum -0E-3 0 -> 0
-dqsamq0721 samequantum -0E-3 0E+3 -> 0
-dqsamq0722 samequantum -0E-3 7E-3 -> 1
-dqsamq0723 samequantum -0E-3 7 -> 0
-dqsamq0724 samequantum -0E-3 7E+3 -> 0
-dqsamq0725 samequantum -0E-3 sNaN -> 0
-
-dqsamq0810 samequantum -0 -Inf -> 0
-dqsamq0811 samequantum -0 Inf -> 0
-dqsamq0812 samequantum -0 NaN -> 0
-dqsamq0813 samequantum -0 -7E+3 -> 0
-dqsamq0814 samequantum -0 -7 -> 1
-dqsamq0815 samequantum -0 -7E-3 -> 0
-dqsamq0816 samequantum -0 -0E-3 -> 0
-dqsamq0817 samequantum -0 -0 -> 1
-dqsamq0818 samequantum -0 -0E+3 -> 0
-dqsamq0819 samequantum -0 0E-3 -> 0
-dqsamq0820 samequantum -0 0 -> 1
-dqsamq0821 samequantum -0 0E+3 -> 0
-dqsamq0822 samequantum -0 7E-3 -> 0
-dqsamq0823 samequantum -0 7 -> 1
-dqsamq0824 samequantum -0 7E+3 -> 0
-dqsamq0825 samequantum -0 sNaN -> 0
-
-dqsamq0910 samequantum -0E+3 -Inf -> 0
-dqsamq0911 samequantum -0E+3 Inf -> 0
-dqsamq0912 samequantum -0E+3 NaN -> 0
-dqsamq0913 samequantum -0E+3 -7E+3 -> 1
-dqsamq0914 samequantum -0E+3 -7 -> 0
-dqsamq0915 samequantum -0E+3 -7E-3 -> 0
-dqsamq0916 samequantum -0E+3 -0E-3 -> 0
-dqsamq0917 samequantum -0E+3 -0 -> 0
-dqsamq0918 samequantum -0E+3 -0E+3 -> 1
-dqsamq0919 samequantum -0E+3 0E-3 -> 0
-dqsamq0920 samequantum -0E+3 0 -> 0
-dqsamq0921 samequantum -0E+3 0E+3 -> 1
-dqsamq0922 samequantum -0E+3 7E-3 -> 0
-dqsamq0923 samequantum -0E+3 7 -> 0
-dqsamq0924 samequantum -0E+3 7E+3 -> 1
-dqsamq0925 samequantum -0E+3 sNaN -> 0
-
-dqsamq1110 samequantum 0E-3 -Inf -> 0
-dqsamq1111 samequantum 0E-3 Inf -> 0
-dqsamq1112 samequantum 0E-3 NaN -> 0
-dqsamq1113 samequantum 0E-3 -7E+3 -> 0
-dqsamq1114 samequantum 0E-3 -7 -> 0
-dqsamq1115 samequantum 0E-3 -7E-3 -> 1
-dqsamq1116 samequantum 0E-3 -0E-3 -> 1
-dqsamq1117 samequantum 0E-3 -0 -> 0
-dqsamq1118 samequantum 0E-3 -0E+3 -> 0
-dqsamq1119 samequantum 0E-3 0E-3 -> 1
-dqsamq1120 samequantum 0E-3 0 -> 0
-dqsamq1121 samequantum 0E-3 0E+3 -> 0
-dqsamq1122 samequantum 0E-3 7E-3 -> 1
-dqsamq1123 samequantum 0E-3 7 -> 0
-dqsamq1124 samequantum 0E-3 7E+3 -> 0
-dqsamq1125 samequantum 0E-3 sNaN -> 0
-
-dqsamq1210 samequantum 0 -Inf -> 0
-dqsamq1211 samequantum 0 Inf -> 0
-dqsamq1212 samequantum 0 NaN -> 0
-dqsamq1213 samequantum 0 -7E+3 -> 0
-dqsamq1214 samequantum 0 -7 -> 1
-dqsamq1215 samequantum 0 -7E-3 -> 0
-dqsamq1216 samequantum 0 -0E-3 -> 0
-dqsamq1217 samequantum 0 -0 -> 1
-dqsamq1218 samequantum 0 -0E+3 -> 0
-dqsamq1219 samequantum 0 0E-3 -> 0
-dqsamq1220 samequantum 0 0 -> 1
-dqsamq1221 samequantum 0 0E+3 -> 0
-dqsamq1222 samequantum 0 7E-3 -> 0
-dqsamq1223 samequantum 0 7 -> 1
-dqsamq1224 samequantum 0 7E+3 -> 0
-dqsamq1225 samequantum 0 sNaN -> 0
-
-dqsamq1310 samequantum 0E+3 -Inf -> 0
-dqsamq1311 samequantum 0E+3 Inf -> 0
-dqsamq1312 samequantum 0E+3 NaN -> 0
-dqsamq1313 samequantum 0E+3 -7E+3 -> 1
-dqsamq1314 samequantum 0E+3 -7 -> 0
-dqsamq1315 samequantum 0E+3 -7E-3 -> 0
-dqsamq1316 samequantum 0E+3 -0E-3 -> 0
-dqsamq1317 samequantum 0E+3 -0 -> 0
-dqsamq1318 samequantum 0E+3 -0E+3 -> 1
-dqsamq1319 samequantum 0E+3 0E-3 -> 0
-dqsamq1320 samequantum 0E+3 0 -> 0
-dqsamq1321 samequantum 0E+3 0E+3 -> 1
-dqsamq1322 samequantum 0E+3 7E-3 -> 0
-dqsamq1323 samequantum 0E+3 7 -> 0
-dqsamq1324 samequantum 0E+3 7E+3 -> 1
-dqsamq1325 samequantum 0E+3 sNaN -> 0
-
-dqsamq1410 samequantum 7E-3 -Inf -> 0
-dqsamq1411 samequantum 7E-3 Inf -> 0
-dqsamq1412 samequantum 7E-3 NaN -> 0
-dqsamq1413 samequantum 7E-3 -7E+3 -> 0
-dqsamq1414 samequantum 7E-3 -7 -> 0
-dqsamq1415 samequantum 7E-3 -7E-3 -> 1
-dqsamq1416 samequantum 7E-3 -0E-3 -> 1
-dqsamq1417 samequantum 7E-3 -0 -> 0
-dqsamq1418 samequantum 7E-3 -0E+3 -> 0
-dqsamq1419 samequantum 7E-3 0E-3 -> 1
-dqsamq1420 samequantum 7E-3 0 -> 0
-dqsamq1421 samequantum 7E-3 0E+3 -> 0
-dqsamq1422 samequantum 7E-3 7E-3 -> 1
-dqsamq1423 samequantum 7E-3 7 -> 0
-dqsamq1424 samequantum 7E-3 7E+3 -> 0
-dqsamq1425 samequantum 7E-3 sNaN -> 0
-
-dqsamq1510 samequantum 7 -Inf -> 0
-dqsamq1511 samequantum 7 Inf -> 0
-dqsamq1512 samequantum 7 NaN -> 0
-dqsamq1513 samequantum 7 -7E+3 -> 0
-dqsamq1514 samequantum 7 -7 -> 1
-dqsamq1515 samequantum 7 -7E-3 -> 0
-dqsamq1516 samequantum 7 -0E-3 -> 0
-dqsamq1517 samequantum 7 -0 -> 1
-dqsamq1518 samequantum 7 -0E+3 -> 0
-dqsamq1519 samequantum 7 0E-3 -> 0
-dqsamq1520 samequantum 7 0 -> 1
-dqsamq1521 samequantum 7 0E+3 -> 0
-dqsamq1522 samequantum 7 7E-3 -> 0
-dqsamq1523 samequantum 7 7 -> 1
-dqsamq1524 samequantum 7 7E+3 -> 0
-dqsamq1525 samequantum 7 sNaN -> 0
-
-dqsamq1610 samequantum 7E+3 -Inf -> 0
-dqsamq1611 samequantum 7E+3 Inf -> 0
-dqsamq1612 samequantum 7E+3 NaN -> 0
-dqsamq1613 samequantum 7E+3 -7E+3 -> 1
-dqsamq1614 samequantum 7E+3 -7 -> 0
-dqsamq1615 samequantum 7E+3 -7E-3 -> 0
-dqsamq1616 samequantum 7E+3 -0E-3 -> 0
-dqsamq1617 samequantum 7E+3 -0 -> 0
-dqsamq1618 samequantum 7E+3 -0E+3 -> 1
-dqsamq1619 samequantum 7E+3 0E-3 -> 0
-dqsamq1620 samequantum 7E+3 0 -> 0
-dqsamq1621 samequantum 7E+3 0E+3 -> 1
-dqsamq1622 samequantum 7E+3 7E-3 -> 0
-dqsamq1623 samequantum 7E+3 7 -> 0
-dqsamq1624 samequantum 7E+3 7E+3 -> 1
-dqsamq1625 samequantum 7E+3 sNaN -> 0
-
-dqsamq1710 samequantum sNaN -Inf -> 0
-dqsamq1711 samequantum sNaN Inf -> 0
-dqsamq1712 samequantum sNaN NaN -> 1
-dqsamq1713 samequantum sNaN -7E+3 -> 0
-dqsamq1714 samequantum sNaN -7 -> 0
-dqsamq1715 samequantum sNaN -7E-3 -> 0
-dqsamq1716 samequantum sNaN -0E-3 -> 0
-dqsamq1717 samequantum sNaN -0 -> 0
-dqsamq1718 samequantum sNaN -0E+3 -> 0
-dqsamq1719 samequantum sNaN 0E-3 -> 0
-dqsamq1720 samequantum sNaN 0 -> 0
-dqsamq1721 samequantum sNaN 0E+3 -> 0
-dqsamq1722 samequantum sNaN 7E-3 -> 0
-dqsamq1723 samequantum sNaN 7 -> 0
-dqsamq1724 samequantum sNaN 7E+3 -> 0
-dqsamq1725 samequantum sNaN sNaN -> 1
--- noisy NaNs
-dqsamq1730 samequantum sNaN3 sNaN3 -> 1
-dqsamq1731 samequantum sNaN3 sNaN4 -> 1
-dqsamq1732 samequantum NaN3 NaN3 -> 1
-dqsamq1733 samequantum NaN3 NaN4 -> 1
-dqsamq1734 samequantum sNaN3 3 -> 0
-dqsamq1735 samequantum NaN3 3 -> 0
-dqsamq1736 samequantum 4 sNaN4 -> 0
-dqsamq1737 samequantum 3 NaN3 -> 0
-dqsamq1738 samequantum Inf sNaN4 -> 0
-dqsamq1739 samequantum -Inf NaN3 -> 0
-
+------------------------------------------------------------------------
+-- dqSameQuantum.decTest -- check decQuad quantums match --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqsamq001 samequantum 0 0 -> 1
+dqsamq002 samequantum 0 1 -> 1
+dqsamq003 samequantum 1 0 -> 1
+dqsamq004 samequantum 1 1 -> 1
+
+dqsamq011 samequantum 10 1E+1 -> 0
+dqsamq012 samequantum 10E+1 10E+1 -> 1
+dqsamq013 samequantum 100 10E+1 -> 0
+dqsamq014 samequantum 100 1E+2 -> 0
+dqsamq015 samequantum 0.1 1E-2 -> 0
+dqsamq016 samequantum 0.1 1E-1 -> 1
+dqsamq017 samequantum 0.1 1E-0 -> 0
+dqsamq018 samequantum 999 999 -> 1
+dqsamq019 samequantum 999E-1 99.9 -> 1
+dqsamq020 samequantum 111E-1 22.2 -> 1
+dqsamq021 samequantum 111E-1 1234.2 -> 1
+
+-- zeros
+dqsamq030 samequantum 0.0 1.1 -> 1
+dqsamq031 samequantum 0.0 1.11 -> 0
+dqsamq032 samequantum 0.0 0 -> 0
+dqsamq033 samequantum 0.0 0.0 -> 1
+dqsamq034 samequantum 0.0 0.00 -> 0
+dqsamq035 samequantum 0E+1 0E+0 -> 0
+dqsamq036 samequantum 0E+1 0E+1 -> 1
+dqsamq037 samequantum 0E+1 0E+2 -> 0
+dqsamq038 samequantum 0E-17 0E-16 -> 0
+dqsamq039 samequantum 0E-17 0E-17 -> 1
+dqsamq040 samequantum 0E-17 0E-18 -> 0
+dqsamq041 samequantum 0E-17 0.0E-15 -> 0
+dqsamq042 samequantum 0E-17 0.0E-16 -> 1
+dqsamq043 samequantum 0E-17 0.0E-17 -> 0
+dqsamq044 samequantum -0E-17 0.0E-16 -> 1
+dqsamq045 samequantum 0E-17 -0.0E-17 -> 0
+dqsamq046 samequantum 0E-17 -0.0E-16 -> 1
+dqsamq047 samequantum -0E-17 0.0E-17 -> 0
+dqsamq048 samequantum -0E-17 -0.0E-16 -> 1
+dqsamq049 samequantum -0E-17 -0.0E-17 -> 0
+
+-- Nmax, Nmin, Ntiny
+dqsamq051 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1
+dqsamq052 samequantum 1E-6143 1E-6143 -> 1
+dqsamq053 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1
+dqsamq054 samequantum 1E-6176 1E-6176 -> 1
+dqsamq055 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1
+dqsamq056 samequantum 1E-6143 1E-6143 -> 1
+dqsamq057 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1
+dqsamq058 samequantum 1E-6176 1E-6176 -> 1
+
+dqsamq061 samequantum -1E-6176 -1E-6176 -> 1
+dqsamq062 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1
+dqsamq063 samequantum -1E-6143 -1E-6143 -> 1
+dqsamq064 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1
+dqsamq065 samequantum -1E-6176 -1E-6176 -> 1
+dqsamq066 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1
+dqsamq067 samequantum -1E-6143 -1E-6143 -> 1
+dqsamq068 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1
+
+dqsamq071 samequantum -4E-6176 -1E-6176 -> 1
+dqsamq072 samequantum -4.00000000000000000000000000000000E-6143 -1.00000000000000000000000000004000E-6143 -> 1
+dqsamq073 samequantum -4E-6143 -1E-6143 -> 1
+dqsamq074 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6144 -> 1
+dqsamq075 samequantum -4E-6176 -1E-6176 -> 1
+dqsamq076 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6143 -> 1
+dqsamq077 samequantum -4E-6143 -1E-6143 -> 1
+dqsamq078 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6144 -> 1
+
+dqsamq081 samequantum -4E-1006 -1E-6176 -> 0
+dqsamq082 samequantum -4.00000000000000000000000000000000E-6143 -1.00004000000000000000000000000000E-6136 -> 0
+dqsamq083 samequantum -4E-6140 -1E-6143 -> 0
+dqsamq084 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6136 -> 0
+dqsamq085 samequantum -4E-1006 -1E-6176 -> 0
+dqsamq086 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6136 -> 0
+dqsamq087 samequantum -4E-6133 -1E-6143 -> 0
+dqsamq088 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6136 -> 0
+
+-- specials & combinations
+dqsamq0110 samequantum -Inf -Inf -> 1
+dqsamq0111 samequantum -Inf Inf -> 1
+dqsamq0112 samequantum -Inf NaN -> 0
+dqsamq0113 samequantum -Inf -7E+3 -> 0
+dqsamq0114 samequantum -Inf -7 -> 0
+dqsamq0115 samequantum -Inf -7E-3 -> 0
+dqsamq0116 samequantum -Inf -0E-3 -> 0
+dqsamq0117 samequantum -Inf -0 -> 0
+dqsamq0118 samequantum -Inf -0E+3 -> 0
+dqsamq0119 samequantum -Inf 0E-3 -> 0
+dqsamq0120 samequantum -Inf 0 -> 0
+dqsamq0121 samequantum -Inf 0E+3 -> 0
+dqsamq0122 samequantum -Inf 7E-3 -> 0
+dqsamq0123 samequantum -Inf 7 -> 0
+dqsamq0124 samequantum -Inf 7E+3 -> 0
+dqsamq0125 samequantum -Inf sNaN -> 0
+
+dqsamq0210 samequantum Inf -Inf -> 1
+dqsamq0211 samequantum Inf Inf -> 1
+dqsamq0212 samequantum Inf NaN -> 0
+dqsamq0213 samequantum Inf -7E+3 -> 0
+dqsamq0214 samequantum Inf -7 -> 0
+dqsamq0215 samequantum Inf -7E-3 -> 0
+dqsamq0216 samequantum Inf -0E-3 -> 0
+dqsamq0217 samequantum Inf -0 -> 0
+dqsamq0218 samequantum Inf -0E+3 -> 0
+dqsamq0219 samequantum Inf 0E-3 -> 0
+dqsamq0220 samequantum Inf 0 -> 0
+dqsamq0221 samequantum Inf 0E+3 -> 0
+dqsamq0222 samequantum Inf 7E-3 -> 0
+dqsamq0223 samequantum Inf 7 -> 0
+dqsamq0224 samequantum Inf 7E+3 -> 0
+dqsamq0225 samequantum Inf sNaN -> 0
+
+dqsamq0310 samequantum NaN -Inf -> 0
+dqsamq0311 samequantum NaN Inf -> 0
+dqsamq0312 samequantum NaN NaN -> 1
+dqsamq0313 samequantum NaN -7E+3 -> 0
+dqsamq0314 samequantum NaN -7 -> 0
+dqsamq0315 samequantum NaN -7E-3 -> 0
+dqsamq0316 samequantum NaN -0E-3 -> 0
+dqsamq0317 samequantum NaN -0 -> 0
+dqsamq0318 samequantum NaN -0E+3 -> 0
+dqsamq0319 samequantum NaN 0E-3 -> 0
+dqsamq0320 samequantum NaN 0 -> 0
+dqsamq0321 samequantum NaN 0E+3 -> 0
+dqsamq0322 samequantum NaN 7E-3 -> 0
+dqsamq0323 samequantum NaN 7 -> 0
+dqsamq0324 samequantum NaN 7E+3 -> 0
+dqsamq0325 samequantum NaN sNaN -> 1
+
+dqsamq0410 samequantum -7E+3 -Inf -> 0
+dqsamq0411 samequantum -7E+3 Inf -> 0
+dqsamq0412 samequantum -7E+3 NaN -> 0
+dqsamq0413 samequantum -7E+3 -7E+3 -> 1
+dqsamq0414 samequantum -7E+3 -7 -> 0
+dqsamq0415 samequantum -7E+3 -7E-3 -> 0
+dqsamq0416 samequantum -7E+3 -0E-3 -> 0
+dqsamq0417 samequantum -7E+3 -0 -> 0
+dqsamq0418 samequantum -7E+3 -0E+3 -> 1
+dqsamq0419 samequantum -7E+3 0E-3 -> 0
+dqsamq0420 samequantum -7E+3 0 -> 0
+dqsamq0421 samequantum -7E+3 0E+3 -> 1
+dqsamq0422 samequantum -7E+3 7E-3 -> 0
+dqsamq0423 samequantum -7E+3 7 -> 0
+dqsamq0424 samequantum -7E+3 7E+3 -> 1
+dqsamq0425 samequantum -7E+3 sNaN -> 0
+
+dqsamq0510 samequantum -7 -Inf -> 0
+dqsamq0511 samequantum -7 Inf -> 0
+dqsamq0512 samequantum -7 NaN -> 0
+dqsamq0513 samequantum -7 -7E+3 -> 0
+dqsamq0514 samequantum -7 -7 -> 1
+dqsamq0515 samequantum -7 -7E-3 -> 0
+dqsamq0516 samequantum -7 -0E-3 -> 0
+dqsamq0517 samequantum -7 -0 -> 1
+dqsamq0518 samequantum -7 -0E+3 -> 0
+dqsamq0519 samequantum -7 0E-3 -> 0
+dqsamq0520 samequantum -7 0 -> 1
+dqsamq0521 samequantum -7 0E+3 -> 0
+dqsamq0522 samequantum -7 7E-3 -> 0
+dqsamq0523 samequantum -7 7 -> 1
+dqsamq0524 samequantum -7 7E+3 -> 0
+dqsamq0525 samequantum -7 sNaN -> 0
+
+dqsamq0610 samequantum -7E-3 -Inf -> 0
+dqsamq0611 samequantum -7E-3 Inf -> 0
+dqsamq0612 samequantum -7E-3 NaN -> 0
+dqsamq0613 samequantum -7E-3 -7E+3 -> 0
+dqsamq0614 samequantum -7E-3 -7 -> 0
+dqsamq0615 samequantum -7E-3 -7E-3 -> 1
+dqsamq0616 samequantum -7E-3 -0E-3 -> 1
+dqsamq0617 samequantum -7E-3 -0 -> 0
+dqsamq0618 samequantum -7E-3 -0E+3 -> 0
+dqsamq0619 samequantum -7E-3 0E-3 -> 1
+dqsamq0620 samequantum -7E-3 0 -> 0
+dqsamq0621 samequantum -7E-3 0E+3 -> 0
+dqsamq0622 samequantum -7E-3 7E-3 -> 1
+dqsamq0623 samequantum -7E-3 7 -> 0
+dqsamq0624 samequantum -7E-3 7E+3 -> 0
+dqsamq0625 samequantum -7E-3 sNaN -> 0
+
+dqsamq0710 samequantum -0E-3 -Inf -> 0
+dqsamq0711 samequantum -0E-3 Inf -> 0
+dqsamq0712 samequantum -0E-3 NaN -> 0
+dqsamq0713 samequantum -0E-3 -7E+3 -> 0
+dqsamq0714 samequantum -0E-3 -7 -> 0
+dqsamq0715 samequantum -0E-3 -7E-3 -> 1
+dqsamq0716 samequantum -0E-3 -0E-3 -> 1
+dqsamq0717 samequantum -0E-3 -0 -> 0
+dqsamq0718 samequantum -0E-3 -0E+3 -> 0
+dqsamq0719 samequantum -0E-3 0E-3 -> 1
+dqsamq0720 samequantum -0E-3 0 -> 0
+dqsamq0721 samequantum -0E-3 0E+3 -> 0
+dqsamq0722 samequantum -0E-3 7E-3 -> 1
+dqsamq0723 samequantum -0E-3 7 -> 0
+dqsamq0724 samequantum -0E-3 7E+3 -> 0
+dqsamq0725 samequantum -0E-3 sNaN -> 0
+
+dqsamq0810 samequantum -0 -Inf -> 0
+dqsamq0811 samequantum -0 Inf -> 0
+dqsamq0812 samequantum -0 NaN -> 0
+dqsamq0813 samequantum -0 -7E+3 -> 0
+dqsamq0814 samequantum -0 -7 -> 1
+dqsamq0815 samequantum -0 -7E-3 -> 0
+dqsamq0816 samequantum -0 -0E-3 -> 0
+dqsamq0817 samequantum -0 -0 -> 1
+dqsamq0818 samequantum -0 -0E+3 -> 0
+dqsamq0819 samequantum -0 0E-3 -> 0
+dqsamq0820 samequantum -0 0 -> 1
+dqsamq0821 samequantum -0 0E+3 -> 0
+dqsamq0822 samequantum -0 7E-3 -> 0
+dqsamq0823 samequantum -0 7 -> 1
+dqsamq0824 samequantum -0 7E+3 -> 0
+dqsamq0825 samequantum -0 sNaN -> 0
+
+dqsamq0910 samequantum -0E+3 -Inf -> 0
+dqsamq0911 samequantum -0E+3 Inf -> 0
+dqsamq0912 samequantum -0E+3 NaN -> 0
+dqsamq0913 samequantum -0E+3 -7E+3 -> 1
+dqsamq0914 samequantum -0E+3 -7 -> 0
+dqsamq0915 samequantum -0E+3 -7E-3 -> 0
+dqsamq0916 samequantum -0E+3 -0E-3 -> 0
+dqsamq0917 samequantum -0E+3 -0 -> 0
+dqsamq0918 samequantum -0E+3 -0E+3 -> 1
+dqsamq0919 samequantum -0E+3 0E-3 -> 0
+dqsamq0920 samequantum -0E+3 0 -> 0
+dqsamq0921 samequantum -0E+3 0E+3 -> 1
+dqsamq0922 samequantum -0E+3 7E-3 -> 0
+dqsamq0923 samequantum -0E+3 7 -> 0
+dqsamq0924 samequantum -0E+3 7E+3 -> 1
+dqsamq0925 samequantum -0E+3 sNaN -> 0
+
+dqsamq1110 samequantum 0E-3 -Inf -> 0
+dqsamq1111 samequantum 0E-3 Inf -> 0
+dqsamq1112 samequantum 0E-3 NaN -> 0
+dqsamq1113 samequantum 0E-3 -7E+3 -> 0
+dqsamq1114 samequantum 0E-3 -7 -> 0
+dqsamq1115 samequantum 0E-3 -7E-3 -> 1
+dqsamq1116 samequantum 0E-3 -0E-3 -> 1
+dqsamq1117 samequantum 0E-3 -0 -> 0
+dqsamq1118 samequantum 0E-3 -0E+3 -> 0
+dqsamq1119 samequantum 0E-3 0E-3 -> 1
+dqsamq1120 samequantum 0E-3 0 -> 0
+dqsamq1121 samequantum 0E-3 0E+3 -> 0
+dqsamq1122 samequantum 0E-3 7E-3 -> 1
+dqsamq1123 samequantum 0E-3 7 -> 0
+dqsamq1124 samequantum 0E-3 7E+3 -> 0
+dqsamq1125 samequantum 0E-3 sNaN -> 0
+
+dqsamq1210 samequantum 0 -Inf -> 0
+dqsamq1211 samequantum 0 Inf -> 0
+dqsamq1212 samequantum 0 NaN -> 0
+dqsamq1213 samequantum 0 -7E+3 -> 0
+dqsamq1214 samequantum 0 -7 -> 1
+dqsamq1215 samequantum 0 -7E-3 -> 0
+dqsamq1216 samequantum 0 -0E-3 -> 0
+dqsamq1217 samequantum 0 -0 -> 1
+dqsamq1218 samequantum 0 -0E+3 -> 0
+dqsamq1219 samequantum 0 0E-3 -> 0
+dqsamq1220 samequantum 0 0 -> 1
+dqsamq1221 samequantum 0 0E+3 -> 0
+dqsamq1222 samequantum 0 7E-3 -> 0
+dqsamq1223 samequantum 0 7 -> 1
+dqsamq1224 samequantum 0 7E+3 -> 0
+dqsamq1225 samequantum 0 sNaN -> 0
+
+dqsamq1310 samequantum 0E+3 -Inf -> 0
+dqsamq1311 samequantum 0E+3 Inf -> 0
+dqsamq1312 samequantum 0E+3 NaN -> 0
+dqsamq1313 samequantum 0E+3 -7E+3 -> 1
+dqsamq1314 samequantum 0E+3 -7 -> 0
+dqsamq1315 samequantum 0E+3 -7E-3 -> 0
+dqsamq1316 samequantum 0E+3 -0E-3 -> 0
+dqsamq1317 samequantum 0E+3 -0 -> 0
+dqsamq1318 samequantum 0E+3 -0E+3 -> 1
+dqsamq1319 samequantum 0E+3 0E-3 -> 0
+dqsamq1320 samequantum 0E+3 0 -> 0
+dqsamq1321 samequantum 0E+3 0E+3 -> 1
+dqsamq1322 samequantum 0E+3 7E-3 -> 0
+dqsamq1323 samequantum 0E+3 7 -> 0
+dqsamq1324 samequantum 0E+3 7E+3 -> 1
+dqsamq1325 samequantum 0E+3 sNaN -> 0
+
+dqsamq1410 samequantum 7E-3 -Inf -> 0
+dqsamq1411 samequantum 7E-3 Inf -> 0
+dqsamq1412 samequantum 7E-3 NaN -> 0
+dqsamq1413 samequantum 7E-3 -7E+3 -> 0
+dqsamq1414 samequantum 7E-3 -7 -> 0
+dqsamq1415 samequantum 7E-3 -7E-3 -> 1
+dqsamq1416 samequantum 7E-3 -0E-3 -> 1
+dqsamq1417 samequantum 7E-3 -0 -> 0
+dqsamq1418 samequantum 7E-3 -0E+3 -> 0
+dqsamq1419 samequantum 7E-3 0E-3 -> 1
+dqsamq1420 samequantum 7E-3 0 -> 0
+dqsamq1421 samequantum 7E-3 0E+3 -> 0
+dqsamq1422 samequantum 7E-3 7E-3 -> 1
+dqsamq1423 samequantum 7E-3 7 -> 0
+dqsamq1424 samequantum 7E-3 7E+3 -> 0
+dqsamq1425 samequantum 7E-3 sNaN -> 0
+
+dqsamq1510 samequantum 7 -Inf -> 0
+dqsamq1511 samequantum 7 Inf -> 0
+dqsamq1512 samequantum 7 NaN -> 0
+dqsamq1513 samequantum 7 -7E+3 -> 0
+dqsamq1514 samequantum 7 -7 -> 1
+dqsamq1515 samequantum 7 -7E-3 -> 0
+dqsamq1516 samequantum 7 -0E-3 -> 0
+dqsamq1517 samequantum 7 -0 -> 1
+dqsamq1518 samequantum 7 -0E+3 -> 0
+dqsamq1519 samequantum 7 0E-3 -> 0
+dqsamq1520 samequantum 7 0 -> 1
+dqsamq1521 samequantum 7 0E+3 -> 0
+dqsamq1522 samequantum 7 7E-3 -> 0
+dqsamq1523 samequantum 7 7 -> 1
+dqsamq1524 samequantum 7 7E+3 -> 0
+dqsamq1525 samequantum 7 sNaN -> 0
+
+dqsamq1610 samequantum 7E+3 -Inf -> 0
+dqsamq1611 samequantum 7E+3 Inf -> 0
+dqsamq1612 samequantum 7E+3 NaN -> 0
+dqsamq1613 samequantum 7E+3 -7E+3 -> 1
+dqsamq1614 samequantum 7E+3 -7 -> 0
+dqsamq1615 samequantum 7E+3 -7E-3 -> 0
+dqsamq1616 samequantum 7E+3 -0E-3 -> 0
+dqsamq1617 samequantum 7E+3 -0 -> 0
+dqsamq1618 samequantum 7E+3 -0E+3 -> 1
+dqsamq1619 samequantum 7E+3 0E-3 -> 0
+dqsamq1620 samequantum 7E+3 0 -> 0
+dqsamq1621 samequantum 7E+3 0E+3 -> 1
+dqsamq1622 samequantum 7E+3 7E-3 -> 0
+dqsamq1623 samequantum 7E+3 7 -> 0
+dqsamq1624 samequantum 7E+3 7E+3 -> 1
+dqsamq1625 samequantum 7E+3 sNaN -> 0
+
+dqsamq1710 samequantum sNaN -Inf -> 0
+dqsamq1711 samequantum sNaN Inf -> 0
+dqsamq1712 samequantum sNaN NaN -> 1
+dqsamq1713 samequantum sNaN -7E+3 -> 0
+dqsamq1714 samequantum sNaN -7 -> 0
+dqsamq1715 samequantum sNaN -7E-3 -> 0
+dqsamq1716 samequantum sNaN -0E-3 -> 0
+dqsamq1717 samequantum sNaN -0 -> 0
+dqsamq1718 samequantum sNaN -0E+3 -> 0
+dqsamq1719 samequantum sNaN 0E-3 -> 0
+dqsamq1720 samequantum sNaN 0 -> 0
+dqsamq1721 samequantum sNaN 0E+3 -> 0
+dqsamq1722 samequantum sNaN 7E-3 -> 0
+dqsamq1723 samequantum sNaN 7 -> 0
+dqsamq1724 samequantum sNaN 7E+3 -> 0
+dqsamq1725 samequantum sNaN sNaN -> 1
+-- noisy NaNs
+dqsamq1730 samequantum sNaN3 sNaN3 -> 1
+dqsamq1731 samequantum sNaN3 sNaN4 -> 1
+dqsamq1732 samequantum NaN3 NaN3 -> 1
+dqsamq1733 samequantum NaN3 NaN4 -> 1
+dqsamq1734 samequantum sNaN3 3 -> 0
+dqsamq1735 samequantum NaN3 3 -> 0
+dqsamq1736 samequantum 4 sNaN4 -> 0
+dqsamq1737 samequantum 3 NaN3 -> 0
+dqsamq1738 samequantum Inf sNaN4 -> 0
+dqsamq1739 samequantum -Inf NaN3 -> 0
+
diff --git a/Lib/test/decimaltestdata/dqScaleB.decTest b/Lib/test/decimaltestdata/dqScaleB.decTest
index 045dc58d82..01e1191963 100644
--- a/Lib/test/decimaltestdata/dqScaleB.decTest
+++ b/Lib/test/decimaltestdata/dqScaleB.decTest
@@ -1,260 +1,260 @@
-------------------------------------------------------------------------
--- dqScalebB.decTest -- scale a decQuad by powers of 10 --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Max |rhs| is 2*(6144+34) = 12356
-
--- Sanity checks
-dqscb001 scaleb 7.50 10 -> 7.50E+10
-dqscb002 scaleb 7.50 3 -> 7.50E+3
-dqscb003 scaleb 7.50 2 -> 750
-dqscb004 scaleb 7.50 1 -> 75.0
-dqscb005 scaleb 7.50 0 -> 7.50
-dqscb006 scaleb 7.50 -1 -> 0.750
-dqscb007 scaleb 7.50 -2 -> 0.0750
-dqscb008 scaleb 7.50 -10 -> 7.50E-10
-dqscb009 scaleb -7.50 3 -> -7.50E+3
-dqscb010 scaleb -7.50 2 -> -750
-dqscb011 scaleb -7.50 1 -> -75.0
-dqscb012 scaleb -7.50 0 -> -7.50
-dqscb013 scaleb -7.50 -1 -> -0.750
-
--- Infinities
-dqscb014 scaleb Infinity 1 -> Infinity
-dqscb015 scaleb -Infinity 2 -> -Infinity
-dqscb016 scaleb Infinity -1 -> Infinity
-dqscb017 scaleb -Infinity -2 -> -Infinity
-
--- Next two are somewhat undefined in 754r; treat as non-integer
-dqscb018 scaleb 10 Infinity -> NaN Invalid_operation
-dqscb019 scaleb 10 -Infinity -> NaN Invalid_operation
-
--- NaNs are undefined in 754r; assume usual processing
--- NaNs, 0 payload
-dqscb021 scaleb NaN 1 -> NaN
-dqscb022 scaleb -NaN -1 -> -NaN
-dqscb023 scaleb sNaN 1 -> NaN Invalid_operation
-dqscb024 scaleb -sNaN 1 -> -NaN Invalid_operation
-dqscb025 scaleb 4 NaN -> NaN
-dqscb026 scaleb -Inf -NaN -> -NaN
-dqscb027 scaleb 4 sNaN -> NaN Invalid_operation
-dqscb028 scaleb Inf -sNaN -> -NaN Invalid_operation
-
--- non-integer RHS
-dqscb030 scaleb 1.23 1 -> 12.3
-dqscb031 scaleb 1.23 1.00 -> NaN Invalid_operation
-dqscb032 scaleb 1.23 1.1 -> NaN Invalid_operation
-dqscb033 scaleb 1.23 1.01 -> NaN Invalid_operation
-dqscb034 scaleb 1.23 0.01 -> NaN Invalid_operation
-dqscb035 scaleb 1.23 0.11 -> NaN Invalid_operation
-dqscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
-dqscb037 scaleb 1.23 -1 -> 0.123
-dqscb0614 scaleb 1.23 -1.00 -> NaN Invalid_operation
-dqscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation
-dqscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation
-dqscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation
-dqscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation
-dqscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
-dqscb044 scaleb 1.23 0.1 -> NaN Invalid_operation
-dqscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation
-dqscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
-dqscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
-
--- out-of range RHS
-dqscb120 scaleb 1.23 12355 -> Infinity Overflow Inexact Rounded
-dqscb121 scaleb 1.23 12356 -> Infinity Overflow Inexact Rounded
-dqscb122 scaleb 1.23 12357 -> NaN Invalid_operation
-dqscb123 scaleb 1.23 12358 -> NaN Invalid_operation
-dqscb124 scaleb 1.23 -12355 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqscb125 scaleb 1.23 -12356 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqscb126 scaleb 1.23 -12357 -> NaN Invalid_operation
-dqscb127 scaleb 1.23 -12358 -> NaN Invalid_operation
-
--- NaNs, non-0 payload
--- propagating NaNs
-dqscb861 scaleb NaN01 -Inf -> NaN1
-dqscb862 scaleb -NaN02 -1000 -> -NaN2
-dqscb863 scaleb NaN03 1000 -> NaN3
-dqscb864 scaleb NaN04 Inf -> NaN4
-dqscb865 scaleb NaN05 NaN61 -> NaN5
-dqscb866 scaleb -Inf -NaN71 -> -NaN71
-dqscb867 scaleb -1000 NaN81 -> NaN81
-dqscb868 scaleb 1000 NaN91 -> NaN91
-dqscb869 scaleb Inf NaN101 -> NaN101
-dqscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
-dqscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
-dqscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
-dqscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
-dqscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
-dqscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
-dqscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
-dqscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
-dqscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
-dqscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
-dqscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- finites
-dqscb051 scaleb 7 -2 -> 0.07
-dqscb052 scaleb -7 -2 -> -0.07
-dqscb053 scaleb 75 -2 -> 0.75
-dqscb054 scaleb -75 -2 -> -0.75
-dqscb055 scaleb 7.50 -2 -> 0.0750
-dqscb056 scaleb -7.50 -2 -> -0.0750
-dqscb057 scaleb 7.500 -2 -> 0.07500
-dqscb058 scaleb -7.500 -2 -> -0.07500
-dqscb061 scaleb 7 -1 -> 0.7
-dqscb062 scaleb -7 -1 -> -0.7
-dqscb063 scaleb 75 -1 -> 7.5
-dqscb064 scaleb -75 -1 -> -7.5
-dqscb065 scaleb 7.50 -1 -> 0.750
-dqscb066 scaleb -7.50 -1 -> -0.750
-dqscb067 scaleb 7.500 -1 -> 0.7500
-dqscb068 scaleb -7.500 -1 -> -0.7500
-dqscb071 scaleb 7 0 -> 7
-dqscb072 scaleb -7 0 -> -7
-dqscb073 scaleb 75 0 -> 75
-dqscb074 scaleb -75 0 -> -75
-dqscb075 scaleb 7.50 0 -> 7.50
-dqscb076 scaleb -7.50 0 -> -7.50
-dqscb077 scaleb 7.500 0 -> 7.500
-dqscb078 scaleb -7.500 0 -> -7.500
-dqscb081 scaleb 7 1 -> 7E+1
-dqscb082 scaleb -7 1 -> -7E+1
-dqscb083 scaleb 75 1 -> 7.5E+2
-dqscb084 scaleb -75 1 -> -7.5E+2
-dqscb085 scaleb 7.50 1 -> 75.0
-dqscb086 scaleb -7.50 1 -> -75.0
-dqscb087 scaleb 7.500 1 -> 75.00
-dqscb088 scaleb -7.500 1 -> -75.00
-dqscb091 scaleb 7 2 -> 7E+2
-dqscb092 scaleb -7 2 -> -7E+2
-dqscb093 scaleb 75 2 -> 7.5E+3
-dqscb094 scaleb -75 2 -> -7.5E+3
-dqscb095 scaleb 7.50 2 -> 750
-dqscb096 scaleb -7.50 2 -> -750
-dqscb097 scaleb 7.500 2 -> 750.0
-dqscb098 scaleb -7.500 2 -> -750.0
-
--- zeros
-dqscb111 scaleb 0 1 -> 0E+1
-dqscb112 scaleb -0 2 -> -0E+2
-dqscb113 scaleb 0E+4 3 -> 0E+7
-dqscb114 scaleb -0E+4 4 -> -0E+8
-dqscb115 scaleb 0.0000 5 -> 0E+1
-dqscb116 scaleb -0.0000 6 -> -0E+2
-dqscb117 scaleb 0E-141 7 -> 0E-134
-dqscb118 scaleb -0E-141 8 -> -0E-133
-
--- Nmax, Nmin, Ntiny
-dqscb132 scaleb 9.999999999999999999999999999999999E+6144 +6144 -> Infinity Overflow Inexact Rounded
-dqscb133 scaleb 9.999999999999999999999999999999999E+6144 +10 -> Infinity Overflow Inexact Rounded
-dqscb134 scaleb 9.999999999999999999999999999999999E+6144 +1 -> Infinity Overflow Inexact Rounded
-dqscb135 scaleb 9.999999999999999999999999999999999E+6144 0 -> 9.999999999999999999999999999999999E+6144
-dqscb136 scaleb 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6143
-dqscb137 scaleb 1E-6143 +1 -> 1E-6142
-dqscb1614 scaleb 1E-6143 -0 -> 1E-6143
-dqscb139 scaleb 1E-6143 -1 -> 1E-6144 Subnormal
-dqscb140 scaleb 1.000000000000000000000000000000000E-6143 +1 -> 1.000000000000000000000000000000000E-6142
-dqscb141 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143
-dqscb142 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded
-dqscb143 scaleb 1E-6176 +1 -> 1E-6175 Subnormal
-dqscb144 scaleb 1E-6176 -0 -> 1E-6176 Subnormal
-dqscb145 scaleb 1E-6176 -1 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqscb150 scaleb -1E-6176 +1 -> -1E-6175 Subnormal
-dqscb151 scaleb -1E-6176 -0 -> -1E-6176 Subnormal
-dqscb152 scaleb -1E-6176 -1 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqscb153 scaleb -1.000000000000000000000000000000000E-6143 +1 -> -1.000000000000000000000000000000000E-6142
-dqscb154 scaleb -1.000000000000000000000000000000000E-6143 +0 -> -1.000000000000000000000000000000000E-6143
-dqscb155 scaleb -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144 Subnormal Rounded
-dqscb156 scaleb -1E-6143 +1 -> -1E-6142
-dqscb157 scaleb -1E-6143 -0 -> -1E-6143
-dqscb158 scaleb -1E-6143 -1 -> -1E-6144 Subnormal
-dqscb159 scaleb -9.999999999999999999999999999999999E+6144 +1 -> -Infinity Overflow Inexact Rounded
-dqscb160 scaleb -9.999999999999999999999999999999999E+6144 +0 -> -9.999999999999999999999999999999999E+6144
-dqscb161 scaleb -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6143
-dqscb162 scaleb -9E+6144 +1 -> -Infinity Overflow Inexact Rounded
-dqscb163 scaleb -1E+6144 +1 -> -Infinity Overflow Inexact Rounded
-
--- some Origami
--- (these check that overflow is being done correctly)
-dqscb171 scaleb 1000E+6109 +1 -> 1.000E+6113
-dqscb172 scaleb 1000E+6110 +1 -> 1.000E+6114
-dqscb173 scaleb 1000E+6111 +1 -> 1.0000E+6115 Clamped
-dqscb174 scaleb 1000E+6112 +1 -> 1.00000E+6116 Clamped
-dqscb175 scaleb 1000E+6113 +1 -> 1.000000E+6117 Clamped
-dqscb176 scaleb 1000E+6114 +1 -> 1.0000000E+6118 Clamped
-dqscb177 scaleb 1000E+6131 +1 -> 1.000000000000000000000000E+6135 Clamped
-dqscb178 scaleb 1000E+6132 +1 -> 1.0000000000000000000000000E+6136 Clamped
-dqscb179 scaleb 1000E+6133 +1 -> 1.00000000000000000000000000E+6137 Clamped
-dqscb180 scaleb 1000E+6134 +1 -> 1.000000000000000000000000000E+6138 Clamped
-dqscb181 scaleb 1000E+6135 +1 -> 1.0000000000000000000000000000E+6139 Clamped
-dqscb182 scaleb 1000E+6136 +1 -> 1.00000000000000000000000000000E+6140 Clamped
-dqscb183 scaleb 1000E+6137 +1 -> 1.000000000000000000000000000000E+6141 Clamped
-dqscb184 scaleb 1000E+6138 +1 -> 1.0000000000000000000000000000000E+6142 Clamped
-dqscb185 scaleb 1000E+6139 +1 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqscb186 scaleb 1000E+6140 +1 -> 1.000000000000000000000000000000000E+6144 Clamped
-dqscb187 scaleb 1000E+6141 +1 -> Infinity Overflow Inexact Rounded
-
--- and a few more subnormal truncations
--- (these check that underflow is being done correctly)
-dqscb221 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143
-dqscb222 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded
-dqscb223 scaleb 1.000000000000000000000000000000000E-6143 -2 -> 1.0000000000000000000000000000000E-6145 Subnormal Rounded
-dqscb224 scaleb 1.000000000000000000000000000000000E-6143 -3 -> 1.000000000000000000000000000000E-6146 Subnormal Rounded
-dqscb225 scaleb 1.000000000000000000000000000000000E-6143 -4 -> 1.00000000000000000000000000000E-6147 Subnormal Rounded
-dqscb226 scaleb 1.000000000000000000000000000000000E-6143 -5 -> 1.0000000000000000000000000000E-6148 Subnormal Rounded
-dqscb227 scaleb 1.000000000000000000000000000000000E-6143 -6 -> 1.000000000000000000000000000E-6149 Subnormal Rounded
-dqscb228 scaleb 1.000000000000000000000000000000000E-6143 -7 -> 1.00000000000000000000000000E-6150 Subnormal Rounded
-dqscb229 scaleb 1.000000000000000000000000000000000E-6143 -8 -> 1.0000000000000000000000000E-6151 Subnormal Rounded
-dqscb230 scaleb 1.000000000000000000000000000000000E-6143 -9 -> 1.000000000000000000000000E-6152 Subnormal Rounded
-dqscb231 scaleb 1.000000000000000000000000000000000E-6143 -10 -> 1.00000000000000000000000E-6153 Subnormal Rounded
-dqscb232 scaleb 1.000000000000000000000000000000000E-6143 -11 -> 1.0000000000000000000000E-6154 Subnormal Rounded
-dqscb233 scaleb 1.000000000000000000000000000000000E-6143 -12 -> 1.000000000000000000000E-6155 Subnormal Rounded
-dqscb234 scaleb 1.000000000000000000000000000000000E-6143 -13 -> 1.00000000000000000000E-6156 Subnormal Rounded
-dqscb235 scaleb 1.000000000000000000000000000000000E-6143 -14 -> 1.0000000000000000000E-6157 Subnormal Rounded
-dqscb236 scaleb 1.000000000000000000000000000000000E-6143 -15 -> 1.000000000000000000E-6158 Subnormal Rounded
-dqscb237 scaleb 1.000000000000000000000000000000000E-6143 -16 -> 1.00000000000000000E-6159 Subnormal Rounded
-dqscb238 scaleb 1.000000000000000000000000000000000E-6143 -17 -> 1.0000000000000000E-6160 Subnormal Rounded
-dqscb239 scaleb 1.000000000000000000000000000000000E-6143 -18 -> 1.000000000000000E-6161 Subnormal Rounded
-dqscb202 scaleb 1.000000000000000000000000000000000E-6143 -19 -> 1.00000000000000E-6162 Subnormal Rounded
-dqscb203 scaleb 1.000000000000000000000000000000000E-6143 -20 -> 1.0000000000000E-6163 Subnormal Rounded
-dqscb204 scaleb 1.000000000000000000000000000000000E-6143 -21 -> 1.000000000000E-6164 Subnormal Rounded
-dqscb205 scaleb 1.000000000000000000000000000000000E-6143 -22 -> 1.00000000000E-6165 Subnormal Rounded
-dqscb206 scaleb 1.000000000000000000000000000000000E-6143 -23 -> 1.0000000000E-6166 Subnormal Rounded
-dqscb207 scaleb 1.000000000000000000000000000000000E-6143 -24 -> 1.000000000E-6167 Subnormal Rounded
-dqscb208 scaleb 1.000000000000000000000000000000000E-6143 -25 -> 1.00000000E-6168 Subnormal Rounded
-dqscb209 scaleb 1.000000000000000000000000000000000E-6143 -26 -> 1.0000000E-6169 Subnormal Rounded
-dqscb210 scaleb 1.000000000000000000000000000000000E-6143 -27 -> 1.000000E-6170 Subnormal Rounded
-dqscb211 scaleb 1.000000000000000000000000000000000E-6143 -28 -> 1.00000E-6171 Subnormal Rounded
-dqscb212 scaleb 1.000000000000000000000000000000000E-6143 -29 -> 1.0000E-6172 Subnormal Rounded
-dqscb213 scaleb 1.000000000000000000000000000000000E-6143 -30 -> 1.000E-6173 Subnormal Rounded
-dqscb214 scaleb 1.000000000000000000000000000000000E-6143 -31 -> 1.00E-6174 Subnormal Rounded
-dqscb215 scaleb 1.000000000000000000000000000000000E-6143 -32 -> 1.0E-6175 Subnormal Rounded
-dqscb216 scaleb 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176 Subnormal Rounded
-dqscb217 scaleb 1.000000000000000000000000000000000E-6143 -34 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqscb218 scaleb 1.000000000000000000000000000000000E-6143 -35 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+------------------------------------------------------------------------
+-- dqScalebB.decTest -- scale a decQuad by powers of 10 --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Max |rhs| is 2*(6144+34) = 12356
+
+-- Sanity checks
+dqscb001 scaleb 7.50 10 -> 7.50E+10
+dqscb002 scaleb 7.50 3 -> 7.50E+3
+dqscb003 scaleb 7.50 2 -> 750
+dqscb004 scaleb 7.50 1 -> 75.0
+dqscb005 scaleb 7.50 0 -> 7.50
+dqscb006 scaleb 7.50 -1 -> 0.750
+dqscb007 scaleb 7.50 -2 -> 0.0750
+dqscb008 scaleb 7.50 -10 -> 7.50E-10
+dqscb009 scaleb -7.50 3 -> -7.50E+3
+dqscb010 scaleb -7.50 2 -> -750
+dqscb011 scaleb -7.50 1 -> -75.0
+dqscb012 scaleb -7.50 0 -> -7.50
+dqscb013 scaleb -7.50 -1 -> -0.750
+
+-- Infinities
+dqscb014 scaleb Infinity 1 -> Infinity
+dqscb015 scaleb -Infinity 2 -> -Infinity
+dqscb016 scaleb Infinity -1 -> Infinity
+dqscb017 scaleb -Infinity -2 -> -Infinity
+
+-- Next two are somewhat undefined in 754r; treat as non-integer
+dqscb018 scaleb 10 Infinity -> NaN Invalid_operation
+dqscb019 scaleb 10 -Infinity -> NaN Invalid_operation
+
+-- NaNs are undefined in 754r; assume usual processing
+-- NaNs, 0 payload
+dqscb021 scaleb NaN 1 -> NaN
+dqscb022 scaleb -NaN -1 -> -NaN
+dqscb023 scaleb sNaN 1 -> NaN Invalid_operation
+dqscb024 scaleb -sNaN 1 -> -NaN Invalid_operation
+dqscb025 scaleb 4 NaN -> NaN
+dqscb026 scaleb -Inf -NaN -> -NaN
+dqscb027 scaleb 4 sNaN -> NaN Invalid_operation
+dqscb028 scaleb Inf -sNaN -> -NaN Invalid_operation
+
+-- non-integer RHS
+dqscb030 scaleb 1.23 1 -> 12.3
+dqscb031 scaleb 1.23 1.00 -> NaN Invalid_operation
+dqscb032 scaleb 1.23 1.1 -> NaN Invalid_operation
+dqscb033 scaleb 1.23 1.01 -> NaN Invalid_operation
+dqscb034 scaleb 1.23 0.01 -> NaN Invalid_operation
+dqscb035 scaleb 1.23 0.11 -> NaN Invalid_operation
+dqscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
+dqscb037 scaleb 1.23 -1 -> 0.123
+dqscb0614 scaleb 1.23 -1.00 -> NaN Invalid_operation
+dqscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation
+dqscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation
+dqscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation
+dqscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation
+dqscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
+dqscb044 scaleb 1.23 0.1 -> NaN Invalid_operation
+dqscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation
+dqscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
+dqscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
+
+-- out-of range RHS
+dqscb120 scaleb 1.23 12355 -> Infinity Overflow Inexact Rounded
+dqscb121 scaleb 1.23 12356 -> Infinity Overflow Inexact Rounded
+dqscb122 scaleb 1.23 12357 -> NaN Invalid_operation
+dqscb123 scaleb 1.23 12358 -> NaN Invalid_operation
+dqscb124 scaleb 1.23 -12355 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqscb125 scaleb 1.23 -12356 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqscb126 scaleb 1.23 -12357 -> NaN Invalid_operation
+dqscb127 scaleb 1.23 -12358 -> NaN Invalid_operation
+
+-- NaNs, non-0 payload
+-- propagating NaNs
+dqscb861 scaleb NaN01 -Inf -> NaN1
+dqscb862 scaleb -NaN02 -1000 -> -NaN2
+dqscb863 scaleb NaN03 1000 -> NaN3
+dqscb864 scaleb NaN04 Inf -> NaN4
+dqscb865 scaleb NaN05 NaN61 -> NaN5
+dqscb866 scaleb -Inf -NaN71 -> -NaN71
+dqscb867 scaleb -1000 NaN81 -> NaN81
+dqscb868 scaleb 1000 NaN91 -> NaN91
+dqscb869 scaleb Inf NaN101 -> NaN101
+dqscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
+dqscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
+dqscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
+dqscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
+dqscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
+dqscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
+dqscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
+dqscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
+dqscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
+dqscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
+dqscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- finites
+dqscb051 scaleb 7 -2 -> 0.07
+dqscb052 scaleb -7 -2 -> -0.07
+dqscb053 scaleb 75 -2 -> 0.75
+dqscb054 scaleb -75 -2 -> -0.75
+dqscb055 scaleb 7.50 -2 -> 0.0750
+dqscb056 scaleb -7.50 -2 -> -0.0750
+dqscb057 scaleb 7.500 -2 -> 0.07500
+dqscb058 scaleb -7.500 -2 -> -0.07500
+dqscb061 scaleb 7 -1 -> 0.7
+dqscb062 scaleb -7 -1 -> -0.7
+dqscb063 scaleb 75 -1 -> 7.5
+dqscb064 scaleb -75 -1 -> -7.5
+dqscb065 scaleb 7.50 -1 -> 0.750
+dqscb066 scaleb -7.50 -1 -> -0.750
+dqscb067 scaleb 7.500 -1 -> 0.7500
+dqscb068 scaleb -7.500 -1 -> -0.7500
+dqscb071 scaleb 7 0 -> 7
+dqscb072 scaleb -7 0 -> -7
+dqscb073 scaleb 75 0 -> 75
+dqscb074 scaleb -75 0 -> -75
+dqscb075 scaleb 7.50 0 -> 7.50
+dqscb076 scaleb -7.50 0 -> -7.50
+dqscb077 scaleb 7.500 0 -> 7.500
+dqscb078 scaleb -7.500 0 -> -7.500
+dqscb081 scaleb 7 1 -> 7E+1
+dqscb082 scaleb -7 1 -> -7E+1
+dqscb083 scaleb 75 1 -> 7.5E+2
+dqscb084 scaleb -75 1 -> -7.5E+2
+dqscb085 scaleb 7.50 1 -> 75.0
+dqscb086 scaleb -7.50 1 -> -75.0
+dqscb087 scaleb 7.500 1 -> 75.00
+dqscb088 scaleb -7.500 1 -> -75.00
+dqscb091 scaleb 7 2 -> 7E+2
+dqscb092 scaleb -7 2 -> -7E+2
+dqscb093 scaleb 75 2 -> 7.5E+3
+dqscb094 scaleb -75 2 -> -7.5E+3
+dqscb095 scaleb 7.50 2 -> 750
+dqscb096 scaleb -7.50 2 -> -750
+dqscb097 scaleb 7.500 2 -> 750.0
+dqscb098 scaleb -7.500 2 -> -750.0
+
+-- zeros
+dqscb111 scaleb 0 1 -> 0E+1
+dqscb112 scaleb -0 2 -> -0E+2
+dqscb113 scaleb 0E+4 3 -> 0E+7
+dqscb114 scaleb -0E+4 4 -> -0E+8
+dqscb115 scaleb 0.0000 5 -> 0E+1
+dqscb116 scaleb -0.0000 6 -> -0E+2
+dqscb117 scaleb 0E-141 7 -> 0E-134
+dqscb118 scaleb -0E-141 8 -> -0E-133
+
+-- Nmax, Nmin, Ntiny
+dqscb132 scaleb 9.999999999999999999999999999999999E+6144 +6144 -> Infinity Overflow Inexact Rounded
+dqscb133 scaleb 9.999999999999999999999999999999999E+6144 +10 -> Infinity Overflow Inexact Rounded
+dqscb134 scaleb 9.999999999999999999999999999999999E+6144 +1 -> Infinity Overflow Inexact Rounded
+dqscb135 scaleb 9.999999999999999999999999999999999E+6144 0 -> 9.999999999999999999999999999999999E+6144
+dqscb136 scaleb 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6143
+dqscb137 scaleb 1E-6143 +1 -> 1E-6142
+dqscb1614 scaleb 1E-6143 -0 -> 1E-6143
+dqscb139 scaleb 1E-6143 -1 -> 1E-6144 Subnormal
+dqscb140 scaleb 1.000000000000000000000000000000000E-6143 +1 -> 1.000000000000000000000000000000000E-6142
+dqscb141 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143
+dqscb142 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded
+dqscb143 scaleb 1E-6176 +1 -> 1E-6175 Subnormal
+dqscb144 scaleb 1E-6176 -0 -> 1E-6176 Subnormal
+dqscb145 scaleb 1E-6176 -1 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqscb150 scaleb -1E-6176 +1 -> -1E-6175 Subnormal
+dqscb151 scaleb -1E-6176 -0 -> -1E-6176 Subnormal
+dqscb152 scaleb -1E-6176 -1 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqscb153 scaleb -1.000000000000000000000000000000000E-6143 +1 -> -1.000000000000000000000000000000000E-6142
+dqscb154 scaleb -1.000000000000000000000000000000000E-6143 +0 -> -1.000000000000000000000000000000000E-6143
+dqscb155 scaleb -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144 Subnormal Rounded
+dqscb156 scaleb -1E-6143 +1 -> -1E-6142
+dqscb157 scaleb -1E-6143 -0 -> -1E-6143
+dqscb158 scaleb -1E-6143 -1 -> -1E-6144 Subnormal
+dqscb159 scaleb -9.999999999999999999999999999999999E+6144 +1 -> -Infinity Overflow Inexact Rounded
+dqscb160 scaleb -9.999999999999999999999999999999999E+6144 +0 -> -9.999999999999999999999999999999999E+6144
+dqscb161 scaleb -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6143
+dqscb162 scaleb -9E+6144 +1 -> -Infinity Overflow Inexact Rounded
+dqscb163 scaleb -1E+6144 +1 -> -Infinity Overflow Inexact Rounded
+
+-- some Origami
+-- (these check that overflow is being done correctly)
+dqscb171 scaleb 1000E+6109 +1 -> 1.000E+6113
+dqscb172 scaleb 1000E+6110 +1 -> 1.000E+6114
+dqscb173 scaleb 1000E+6111 +1 -> 1.0000E+6115 Clamped
+dqscb174 scaleb 1000E+6112 +1 -> 1.00000E+6116 Clamped
+dqscb175 scaleb 1000E+6113 +1 -> 1.000000E+6117 Clamped
+dqscb176 scaleb 1000E+6114 +1 -> 1.0000000E+6118 Clamped
+dqscb177 scaleb 1000E+6131 +1 -> 1.000000000000000000000000E+6135 Clamped
+dqscb178 scaleb 1000E+6132 +1 -> 1.0000000000000000000000000E+6136 Clamped
+dqscb179 scaleb 1000E+6133 +1 -> 1.00000000000000000000000000E+6137 Clamped
+dqscb180 scaleb 1000E+6134 +1 -> 1.000000000000000000000000000E+6138 Clamped
+dqscb181 scaleb 1000E+6135 +1 -> 1.0000000000000000000000000000E+6139 Clamped
+dqscb182 scaleb 1000E+6136 +1 -> 1.00000000000000000000000000000E+6140 Clamped
+dqscb183 scaleb 1000E+6137 +1 -> 1.000000000000000000000000000000E+6141 Clamped
+dqscb184 scaleb 1000E+6138 +1 -> 1.0000000000000000000000000000000E+6142 Clamped
+dqscb185 scaleb 1000E+6139 +1 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqscb186 scaleb 1000E+6140 +1 -> 1.000000000000000000000000000000000E+6144 Clamped
+dqscb187 scaleb 1000E+6141 +1 -> Infinity Overflow Inexact Rounded
+
+-- and a few more subnormal truncations
+-- (these check that underflow is being done correctly)
+dqscb221 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143
+dqscb222 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded
+dqscb223 scaleb 1.000000000000000000000000000000000E-6143 -2 -> 1.0000000000000000000000000000000E-6145 Subnormal Rounded
+dqscb224 scaleb 1.000000000000000000000000000000000E-6143 -3 -> 1.000000000000000000000000000000E-6146 Subnormal Rounded
+dqscb225 scaleb 1.000000000000000000000000000000000E-6143 -4 -> 1.00000000000000000000000000000E-6147 Subnormal Rounded
+dqscb226 scaleb 1.000000000000000000000000000000000E-6143 -5 -> 1.0000000000000000000000000000E-6148 Subnormal Rounded
+dqscb227 scaleb 1.000000000000000000000000000000000E-6143 -6 -> 1.000000000000000000000000000E-6149 Subnormal Rounded
+dqscb228 scaleb 1.000000000000000000000000000000000E-6143 -7 -> 1.00000000000000000000000000E-6150 Subnormal Rounded
+dqscb229 scaleb 1.000000000000000000000000000000000E-6143 -8 -> 1.0000000000000000000000000E-6151 Subnormal Rounded
+dqscb230 scaleb 1.000000000000000000000000000000000E-6143 -9 -> 1.000000000000000000000000E-6152 Subnormal Rounded
+dqscb231 scaleb 1.000000000000000000000000000000000E-6143 -10 -> 1.00000000000000000000000E-6153 Subnormal Rounded
+dqscb232 scaleb 1.000000000000000000000000000000000E-6143 -11 -> 1.0000000000000000000000E-6154 Subnormal Rounded
+dqscb233 scaleb 1.000000000000000000000000000000000E-6143 -12 -> 1.000000000000000000000E-6155 Subnormal Rounded
+dqscb234 scaleb 1.000000000000000000000000000000000E-6143 -13 -> 1.00000000000000000000E-6156 Subnormal Rounded
+dqscb235 scaleb 1.000000000000000000000000000000000E-6143 -14 -> 1.0000000000000000000E-6157 Subnormal Rounded
+dqscb236 scaleb 1.000000000000000000000000000000000E-6143 -15 -> 1.000000000000000000E-6158 Subnormal Rounded
+dqscb237 scaleb 1.000000000000000000000000000000000E-6143 -16 -> 1.00000000000000000E-6159 Subnormal Rounded
+dqscb238 scaleb 1.000000000000000000000000000000000E-6143 -17 -> 1.0000000000000000E-6160 Subnormal Rounded
+dqscb239 scaleb 1.000000000000000000000000000000000E-6143 -18 -> 1.000000000000000E-6161 Subnormal Rounded
+dqscb202 scaleb 1.000000000000000000000000000000000E-6143 -19 -> 1.00000000000000E-6162 Subnormal Rounded
+dqscb203 scaleb 1.000000000000000000000000000000000E-6143 -20 -> 1.0000000000000E-6163 Subnormal Rounded
+dqscb204 scaleb 1.000000000000000000000000000000000E-6143 -21 -> 1.000000000000E-6164 Subnormal Rounded
+dqscb205 scaleb 1.000000000000000000000000000000000E-6143 -22 -> 1.00000000000E-6165 Subnormal Rounded
+dqscb206 scaleb 1.000000000000000000000000000000000E-6143 -23 -> 1.0000000000E-6166 Subnormal Rounded
+dqscb207 scaleb 1.000000000000000000000000000000000E-6143 -24 -> 1.000000000E-6167 Subnormal Rounded
+dqscb208 scaleb 1.000000000000000000000000000000000E-6143 -25 -> 1.00000000E-6168 Subnormal Rounded
+dqscb209 scaleb 1.000000000000000000000000000000000E-6143 -26 -> 1.0000000E-6169 Subnormal Rounded
+dqscb210 scaleb 1.000000000000000000000000000000000E-6143 -27 -> 1.000000E-6170 Subnormal Rounded
+dqscb211 scaleb 1.000000000000000000000000000000000E-6143 -28 -> 1.00000E-6171 Subnormal Rounded
+dqscb212 scaleb 1.000000000000000000000000000000000E-6143 -29 -> 1.0000E-6172 Subnormal Rounded
+dqscb213 scaleb 1.000000000000000000000000000000000E-6143 -30 -> 1.000E-6173 Subnormal Rounded
+dqscb214 scaleb 1.000000000000000000000000000000000E-6143 -31 -> 1.00E-6174 Subnormal Rounded
+dqscb215 scaleb 1.000000000000000000000000000000000E-6143 -32 -> 1.0E-6175 Subnormal Rounded
+dqscb216 scaleb 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176 Subnormal Rounded
+dqscb217 scaleb 1.000000000000000000000000000000000E-6143 -34 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqscb218 scaleb 1.000000000000000000000000000000000E-6143 -35 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
diff --git a/Lib/test/decimaltestdata/dqShift.decTest b/Lib/test/decimaltestdata/dqShift.decTest
index 6d69213455..4ee836eb48 100644
--- a/Lib/test/decimaltestdata/dqShift.decTest
+++ b/Lib/test/decimaltestdata/dqShift.decTest
@@ -1,298 +1,298 @@
-------------------------------------------------------------------------
--- dqShift.decTest -- shift decQuad coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqshi001 shift 0 0 -> 0
-dqshi002 shift 0 2 -> 0
-dqshi003 shift 1 2 -> 100
-dqshi004 shift 1 33 -> 1000000000000000000000000000000000
-dqshi005 shift 1 34 -> 0
-dqshi006 shift 1 -1 -> 0
-dqshi007 shift 0 -2 -> 0
-dqshi008 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123
-dqshi009 shift 1234567890123456789012345678901234 -33 -> 1
-dqshi010 shift 1234567890123456789012345678901234 -34 -> 0
-dqshi011 shift 9934567890123456789012345678901234 -33 -> 9
-dqshi012 shift 9934567890123456789012345678901234 -34 -> 0
-
--- rhs must be an integer
-dqshi015 shift 1 1.5 -> NaN Invalid_operation
-dqshi016 shift 1 1.0 -> NaN Invalid_operation
-dqshi017 shift 1 0.1 -> NaN Invalid_operation
-dqshi018 shift 1 0.0 -> NaN Invalid_operation
-dqshi019 shift 1 1E+1 -> NaN Invalid_operation
-dqshi020 shift 1 1E+99 -> NaN Invalid_operation
-dqshi021 shift 1 Inf -> NaN Invalid_operation
-dqshi022 shift 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-dqshi025 shift 1 -1000 -> NaN Invalid_operation
-dqshi026 shift 1 -35 -> NaN Invalid_operation
-dqshi027 shift 1 35 -> NaN Invalid_operation
-dqshi028 shift 1 1000 -> NaN Invalid_operation
-
--- full shifting pattern
-dqshi030 shift 1234567890123456789012345678901234 -34 -> 0
-dqshi031 shift 1234567890123456789012345678901234 -33 -> 1
-dqshi032 shift 1234567890123456789012345678901234 -32 -> 12
-dqshi033 shift 1234567890123456789012345678901234 -31 -> 123
-dqshi034 shift 1234567890123456789012345678901234 -30 -> 1234
-dqshi035 shift 1234567890123456789012345678901234 -29 -> 12345
-dqshi036 shift 1234567890123456789012345678901234 -28 -> 123456
-dqshi037 shift 1234567890123456789012345678901234 -27 -> 1234567
-dqshi038 shift 1234567890123456789012345678901234 -26 -> 12345678
-dqshi039 shift 1234567890123456789012345678901234 -25 -> 123456789
-dqshi040 shift 1234567890123456789012345678901234 -24 -> 1234567890
-dqshi041 shift 1234567890123456789012345678901234 -23 -> 12345678901
-dqshi042 shift 1234567890123456789012345678901234 -22 -> 123456789012
-dqshi043 shift 1234567890123456789012345678901234 -21 -> 1234567890123
-dqshi044 shift 1234567890123456789012345678901234 -20 -> 12345678901234
-dqshi045 shift 1234567890123456789012345678901234 -19 -> 123456789012345
-dqshi047 shift 1234567890123456789012345678901234 -18 -> 1234567890123456
-dqshi048 shift 1234567890123456789012345678901234 -17 -> 12345678901234567
-dqshi049 shift 1234567890123456789012345678901234 -16 -> 123456789012345678
-dqshi050 shift 1234567890123456789012345678901234 -15 -> 1234567890123456789
-dqshi051 shift 1234567890123456789012345678901234 -14 -> 12345678901234567890
-dqshi052 shift 1234567890123456789012345678901234 -13 -> 123456789012345678901
-dqshi053 shift 1234567890123456789012345678901234 -12 -> 1234567890123456789012
-dqshi054 shift 1234567890123456789012345678901234 -11 -> 12345678901234567890123
-dqshi055 shift 1234567890123456789012345678901234 -10 -> 123456789012345678901234
-dqshi056 shift 1234567890123456789012345678901234 -9 -> 1234567890123456789012345
-dqshi057 shift 1234567890123456789012345678901234 -8 -> 12345678901234567890123456
-dqshi058 shift 1234567890123456789012345678901234 -7 -> 123456789012345678901234567
-dqshi059 shift 1234567890123456789012345678901234 -6 -> 1234567890123456789012345678
-dqshi060 shift 1234567890123456789012345678901234 -5 -> 12345678901234567890123456789
-dqshi061 shift 1234567890123456789012345678901234 -4 -> 123456789012345678901234567890
-dqshi062 shift 1234567890123456789012345678901234 -3 -> 1234567890123456789012345678901
-dqshi063 shift 1234567890123456789012345678901234 -2 -> 12345678901234567890123456789012
-dqshi064 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123
-dqshi065 shift 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234
-
-dqshi066 shift 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234
-dqshi067 shift 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012340
-dqshi068 shift 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123400
-dqshi069 shift 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234000
-dqshi070 shift 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012340000
-dqshi071 shift 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123400000
-dqshi072 shift 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234000000
-dqshi073 shift 1234567890123456789012345678901234 +7 -> 8901234567890123456789012340000000
-dqshi074 shift 1234567890123456789012345678901234 +8 -> 9012345678901234567890123400000000
-dqshi075 shift 1234567890123456789012345678901234 +9 -> 123456789012345678901234000000000
-dqshi076 shift 1234567890123456789012345678901234 +10 -> 1234567890123456789012340000000000
-dqshi077 shift 1234567890123456789012345678901234 +11 -> 2345678901234567890123400000000000
-dqshi078 shift 1234567890123456789012345678901234 +12 -> 3456789012345678901234000000000000
-dqshi079 shift 1234567890123456789012345678901234 +13 -> 4567890123456789012340000000000000
-dqshi080 shift 1234567890123456789012345678901234 +14 -> 5678901234567890123400000000000000
-dqshi081 shift 1234567890123456789012345678901234 +15 -> 6789012345678901234000000000000000
-dqshi082 shift 1234567890123456789012345678901234 +16 -> 7890123456789012340000000000000000
-dqshi083 shift 1234567890123456789012345678901234 +17 -> 8901234567890123400000000000000000
-dqshi084 shift 1234567890123456789012345678901234 +18 -> 9012345678901234000000000000000000
-dqshi085 shift 1234567890123456789012345678901234 +19 -> 123456789012340000000000000000000
-dqshi086 shift 1234567890123456789012345678901234 +20 -> 1234567890123400000000000000000000
-dqshi087 shift 1234567890123456789012345678901234 +21 -> 2345678901234000000000000000000000
-dqshi088 shift 1234567890123456789012345678901234 +22 -> 3456789012340000000000000000000000
-dqshi089 shift 1234567890123456789012345678901234 +23 -> 4567890123400000000000000000000000
-dqshi090 shift 1234567890123456789012345678901234 +24 -> 5678901234000000000000000000000000
-dqshi091 shift 1234567890123456789012345678901234 +25 -> 6789012340000000000000000000000000
-dqshi092 shift 1234567890123456789012345678901234 +26 -> 7890123400000000000000000000000000
-dqshi093 shift 1234567890123456789012345678901234 +27 -> 8901234000000000000000000000000000
-dqshi094 shift 1234567890123456789012345678901234 +28 -> 9012340000000000000000000000000000
-dqshi095 shift 1234567890123456789012345678901234 +29 -> 123400000000000000000000000000000
-dqshi096 shift 1234567890123456789012345678901234 +30 -> 1234000000000000000000000000000000
-dqshi097 shift 1234567890123456789012345678901234 +31 -> 2340000000000000000000000000000000
-dqshi098 shift 1234567890123456789012345678901234 +32 -> 3400000000000000000000000000000000
-dqshi099 shift 1234567890123456789012345678901234 +33 -> 4000000000000000000000000000000000
-dqshi100 shift 1234567890123456789012345678901234 +34 -> 0
-
--- zeros
-dqshi270 shift 0E-10 +29 -> 0E-10
-dqshi271 shift 0E-10 -29 -> 0E-10
-dqshi272 shift 0.000 +29 -> 0.000
-dqshi273 shift 0.000 -29 -> 0.000
-dqshi274 shift 0E+10 +29 -> 0E+10
-dqshi275 shift 0E+10 -29 -> 0E+10
-dqshi276 shift -0E-10 +29 -> -0E-10
-dqshi277 shift -0E-10 -29 -> -0E-10
-dqshi278 shift -0.000 +29 -> -0.000
-dqshi279 shift -0.000 -29 -> -0.000
-dqshi280 shift -0E+10 +29 -> -0E+10
-dqshi281 shift -0E+10 -29 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-dqshi141 shift 9.999999999999999999999999999999999E+6144 -1 -> 9.99999999999999999999999999999999E+6143
-dqshi142 shift 9.999999999999999999999999999999999E+6144 -33 -> 9E+6111
-dqshi143 shift 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999990E+6144
-dqshi144 shift 9.999999999999999999999999999999999E+6144 33 -> 9.000000000000000000000000000000000E+6144
-dqshi145 shift 1E-6143 -1 -> 0E-6143
-dqshi146 shift 1E-6143 -33 -> 0E-6143
-dqshi147 shift 1E-6143 1 -> 1.0E-6142
-dqshi148 shift 1E-6143 33 -> 1.000000000000000000000000000000000E-6110
-dqshi151 shift 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144
-dqshi152 shift 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176
-dqshi153 shift 1.000000000000000000000000000000000E-6143 1 -> 0E-6176
-dqshi154 shift 1.000000000000000000000000000000000E-6143 33 -> 0E-6176
-dqshi155 shift 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144
-dqshi156 shift 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176
-dqshi157 shift 9.000000000000000000000000000000000E-6143 1 -> 0E-6176
-dqshi158 shift 9.000000000000000000000000000000000E-6143 33 -> 0E-6176
-dqshi160 shift 1E-6176 -1 -> 0E-6176
-dqshi161 shift 1E-6176 -33 -> 0E-6176
-dqshi162 shift 1E-6176 1 -> 1.0E-6175
-dqshi163 shift 1E-6176 33 -> 1.000000000000000000000000000000000E-6143
--- negatives
-dqshi171 shift -9.999999999999999999999999999999999E+6144 -1 -> -9.99999999999999999999999999999999E+6143
-dqshi172 shift -9.999999999999999999999999999999999E+6144 -33 -> -9E+6111
-dqshi173 shift -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999990E+6144
-dqshi174 shift -9.999999999999999999999999999999999E+6144 33 -> -9.000000000000000000000000000000000E+6144
-dqshi175 shift -1E-6143 -1 -> -0E-6143
-dqshi176 shift -1E-6143 -33 -> -0E-6143
-dqshi177 shift -1E-6143 1 -> -1.0E-6142
-dqshi178 shift -1E-6143 33 -> -1.000000000000000000000000000000000E-6110
-dqshi181 shift -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144
-dqshi182 shift -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176
-dqshi183 shift -1.000000000000000000000000000000000E-6143 1 -> -0E-6176
-dqshi184 shift -1.000000000000000000000000000000000E-6143 33 -> -0E-6176
-dqshi185 shift -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144
-dqshi186 shift -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176
-dqshi187 shift -9.000000000000000000000000000000000E-6143 1 -> -0E-6176
-dqshi188 shift -9.000000000000000000000000000000000E-6143 33 -> -0E-6176
-dqshi190 shift -1E-6176 -1 -> -0E-6176
-dqshi191 shift -1E-6176 -33 -> -0E-6176
-dqshi192 shift -1E-6176 1 -> -1.0E-6175
-dqshi193 shift -1E-6176 33 -> -1.000000000000000000000000000000000E-6143
-
--- more negatives (of sanities)
-dqshi201 shift -0 0 -> -0
-dqshi202 shift -0 2 -> -0
-dqshi203 shift -1 2 -> -100
-dqshi204 shift -1 33 -> -1000000000000000000000000000000000
-dqshi205 shift -1 34 -> -0
-dqshi206 shift -1 -1 -> -0
-dqshi207 shift -0 -2 -> -0
-dqshi208 shift -1234567890123456789012345678901234 -1 -> -123456789012345678901234567890123
-dqshi209 shift -1234567890123456789012345678901234 -33 -> -1
-dqshi210 shift -1234567890123456789012345678901234 -34 -> -0
-dqshi211 shift -9934567890123456789012345678901234 -33 -> -9
-dqshi212 shift -9934567890123456789012345678901234 -34 -> -0
-
-
--- Specials; NaNs are handled as usual
-dqshi781 shift -Inf -8 -> -Infinity
-dqshi782 shift -Inf -1 -> -Infinity
-dqshi783 shift -Inf -0 -> -Infinity
-dqshi784 shift -Inf 0 -> -Infinity
-dqshi785 shift -Inf 1 -> -Infinity
-dqshi786 shift -Inf 8 -> -Infinity
-dqshi787 shift -1000 -Inf -> NaN Invalid_operation
-dqshi788 shift -Inf -Inf -> NaN Invalid_operation
-dqshi789 shift -1 -Inf -> NaN Invalid_operation
-dqshi790 shift -0 -Inf -> NaN Invalid_operation
-dqshi791 shift 0 -Inf -> NaN Invalid_operation
-dqshi792 shift 1 -Inf -> NaN Invalid_operation
-dqshi793 shift 1000 -Inf -> NaN Invalid_operation
-dqshi794 shift Inf -Inf -> NaN Invalid_operation
-
-dqshi800 shift Inf -Inf -> NaN Invalid_operation
-dqshi801 shift Inf -8 -> Infinity
-dqshi802 shift Inf -1 -> Infinity
-dqshi803 shift Inf -0 -> Infinity
-dqshi804 shift Inf 0 -> Infinity
-dqshi805 shift Inf 1 -> Infinity
-dqshi806 shift Inf 8 -> Infinity
-dqshi807 shift Inf Inf -> NaN Invalid_operation
-dqshi808 shift -1000 Inf -> NaN Invalid_operation
-dqshi809 shift -Inf Inf -> NaN Invalid_operation
-dqshi810 shift -1 Inf -> NaN Invalid_operation
-dqshi811 shift -0 Inf -> NaN Invalid_operation
-dqshi812 shift 0 Inf -> NaN Invalid_operation
-dqshi813 shift 1 Inf -> NaN Invalid_operation
-dqshi814 shift 1000 Inf -> NaN Invalid_operation
-dqshi815 shift Inf Inf -> NaN Invalid_operation
-
-dqshi821 shift NaN -Inf -> NaN
-dqshi822 shift NaN -1000 -> NaN
-dqshi823 shift NaN -1 -> NaN
-dqshi824 shift NaN -0 -> NaN
-dqshi825 shift NaN 0 -> NaN
-dqshi826 shift NaN 1 -> NaN
-dqshi827 shift NaN 1000 -> NaN
-dqshi828 shift NaN Inf -> NaN
-dqshi829 shift NaN NaN -> NaN
-dqshi830 shift -Inf NaN -> NaN
-dqshi831 shift -1000 NaN -> NaN
-dqshi832 shift -1 NaN -> NaN
-dqshi833 shift -0 NaN -> NaN
-dqshi834 shift 0 NaN -> NaN
-dqshi835 shift 1 NaN -> NaN
-dqshi836 shift 1000 NaN -> NaN
-dqshi837 shift Inf NaN -> NaN
-
-dqshi841 shift sNaN -Inf -> NaN Invalid_operation
-dqshi842 shift sNaN -1000 -> NaN Invalid_operation
-dqshi843 shift sNaN -1 -> NaN Invalid_operation
-dqshi844 shift sNaN -0 -> NaN Invalid_operation
-dqshi845 shift sNaN 0 -> NaN Invalid_operation
-dqshi846 shift sNaN 1 -> NaN Invalid_operation
-dqshi847 shift sNaN 1000 -> NaN Invalid_operation
-dqshi848 shift sNaN NaN -> NaN Invalid_operation
-dqshi849 shift sNaN sNaN -> NaN Invalid_operation
-dqshi850 shift NaN sNaN -> NaN Invalid_operation
-dqshi851 shift -Inf sNaN -> NaN Invalid_operation
-dqshi852 shift -1000 sNaN -> NaN Invalid_operation
-dqshi853 shift -1 sNaN -> NaN Invalid_operation
-dqshi854 shift -0 sNaN -> NaN Invalid_operation
-dqshi855 shift 0 sNaN -> NaN Invalid_operation
-dqshi856 shift 1 sNaN -> NaN Invalid_operation
-dqshi857 shift 1000 sNaN -> NaN Invalid_operation
-dqshi858 shift Inf sNaN -> NaN Invalid_operation
-dqshi859 shift NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqshi861 shift NaN1 -Inf -> NaN1
-dqshi862 shift +NaN2 -1000 -> NaN2
-dqshi863 shift NaN3 1000 -> NaN3
-dqshi864 shift NaN4 Inf -> NaN4
-dqshi865 shift NaN5 +NaN6 -> NaN5
-dqshi866 shift -Inf NaN7 -> NaN7
-dqshi867 shift -1000 NaN8 -> NaN8
-dqshi868 shift 1000 NaN9 -> NaN9
-dqshi869 shift Inf +NaN10 -> NaN10
-dqshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation
-dqshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation
-dqshi873 shift sNaN13 1000 -> NaN13 Invalid_operation
-dqshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
-dqshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
-dqshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
-dqshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation
-dqshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation
-dqshi880 shift Inf sNaN23 -> NaN23 Invalid_operation
-dqshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqshi882 shift -NaN26 NaN28 -> -NaN26
-dqshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqshi884 shift 1000 -NaN30 -> -NaN30
-dqshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- dqShift.decTest -- shift decQuad coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqshi001 shift 0 0 -> 0
+dqshi002 shift 0 2 -> 0
+dqshi003 shift 1 2 -> 100
+dqshi004 shift 1 33 -> 1000000000000000000000000000000000
+dqshi005 shift 1 34 -> 0
+dqshi006 shift 1 -1 -> 0
+dqshi007 shift 0 -2 -> 0
+dqshi008 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123
+dqshi009 shift 1234567890123456789012345678901234 -33 -> 1
+dqshi010 shift 1234567890123456789012345678901234 -34 -> 0
+dqshi011 shift 9934567890123456789012345678901234 -33 -> 9
+dqshi012 shift 9934567890123456789012345678901234 -34 -> 0
+
+-- rhs must be an integer
+dqshi015 shift 1 1.5 -> NaN Invalid_operation
+dqshi016 shift 1 1.0 -> NaN Invalid_operation
+dqshi017 shift 1 0.1 -> NaN Invalid_operation
+dqshi018 shift 1 0.0 -> NaN Invalid_operation
+dqshi019 shift 1 1E+1 -> NaN Invalid_operation
+dqshi020 shift 1 1E+99 -> NaN Invalid_operation
+dqshi021 shift 1 Inf -> NaN Invalid_operation
+dqshi022 shift 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+dqshi025 shift 1 -1000 -> NaN Invalid_operation
+dqshi026 shift 1 -35 -> NaN Invalid_operation
+dqshi027 shift 1 35 -> NaN Invalid_operation
+dqshi028 shift 1 1000 -> NaN Invalid_operation
+
+-- full shifting pattern
+dqshi030 shift 1234567890123456789012345678901234 -34 -> 0
+dqshi031 shift 1234567890123456789012345678901234 -33 -> 1
+dqshi032 shift 1234567890123456789012345678901234 -32 -> 12
+dqshi033 shift 1234567890123456789012345678901234 -31 -> 123
+dqshi034 shift 1234567890123456789012345678901234 -30 -> 1234
+dqshi035 shift 1234567890123456789012345678901234 -29 -> 12345
+dqshi036 shift 1234567890123456789012345678901234 -28 -> 123456
+dqshi037 shift 1234567890123456789012345678901234 -27 -> 1234567
+dqshi038 shift 1234567890123456789012345678901234 -26 -> 12345678
+dqshi039 shift 1234567890123456789012345678901234 -25 -> 123456789
+dqshi040 shift 1234567890123456789012345678901234 -24 -> 1234567890
+dqshi041 shift 1234567890123456789012345678901234 -23 -> 12345678901
+dqshi042 shift 1234567890123456789012345678901234 -22 -> 123456789012
+dqshi043 shift 1234567890123456789012345678901234 -21 -> 1234567890123
+dqshi044 shift 1234567890123456789012345678901234 -20 -> 12345678901234
+dqshi045 shift 1234567890123456789012345678901234 -19 -> 123456789012345
+dqshi047 shift 1234567890123456789012345678901234 -18 -> 1234567890123456
+dqshi048 shift 1234567890123456789012345678901234 -17 -> 12345678901234567
+dqshi049 shift 1234567890123456789012345678901234 -16 -> 123456789012345678
+dqshi050 shift 1234567890123456789012345678901234 -15 -> 1234567890123456789
+dqshi051 shift 1234567890123456789012345678901234 -14 -> 12345678901234567890
+dqshi052 shift 1234567890123456789012345678901234 -13 -> 123456789012345678901
+dqshi053 shift 1234567890123456789012345678901234 -12 -> 1234567890123456789012
+dqshi054 shift 1234567890123456789012345678901234 -11 -> 12345678901234567890123
+dqshi055 shift 1234567890123456789012345678901234 -10 -> 123456789012345678901234
+dqshi056 shift 1234567890123456789012345678901234 -9 -> 1234567890123456789012345
+dqshi057 shift 1234567890123456789012345678901234 -8 -> 12345678901234567890123456
+dqshi058 shift 1234567890123456789012345678901234 -7 -> 123456789012345678901234567
+dqshi059 shift 1234567890123456789012345678901234 -6 -> 1234567890123456789012345678
+dqshi060 shift 1234567890123456789012345678901234 -5 -> 12345678901234567890123456789
+dqshi061 shift 1234567890123456789012345678901234 -4 -> 123456789012345678901234567890
+dqshi062 shift 1234567890123456789012345678901234 -3 -> 1234567890123456789012345678901
+dqshi063 shift 1234567890123456789012345678901234 -2 -> 12345678901234567890123456789012
+dqshi064 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123
+dqshi065 shift 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234
+
+dqshi066 shift 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234
+dqshi067 shift 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012340
+dqshi068 shift 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123400
+dqshi069 shift 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234000
+dqshi070 shift 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012340000
+dqshi071 shift 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123400000
+dqshi072 shift 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234000000
+dqshi073 shift 1234567890123456789012345678901234 +7 -> 8901234567890123456789012340000000
+dqshi074 shift 1234567890123456789012345678901234 +8 -> 9012345678901234567890123400000000
+dqshi075 shift 1234567890123456789012345678901234 +9 -> 123456789012345678901234000000000
+dqshi076 shift 1234567890123456789012345678901234 +10 -> 1234567890123456789012340000000000
+dqshi077 shift 1234567890123456789012345678901234 +11 -> 2345678901234567890123400000000000
+dqshi078 shift 1234567890123456789012345678901234 +12 -> 3456789012345678901234000000000000
+dqshi079 shift 1234567890123456789012345678901234 +13 -> 4567890123456789012340000000000000
+dqshi080 shift 1234567890123456789012345678901234 +14 -> 5678901234567890123400000000000000
+dqshi081 shift 1234567890123456789012345678901234 +15 -> 6789012345678901234000000000000000
+dqshi082 shift 1234567890123456789012345678901234 +16 -> 7890123456789012340000000000000000
+dqshi083 shift 1234567890123456789012345678901234 +17 -> 8901234567890123400000000000000000
+dqshi084 shift 1234567890123456789012345678901234 +18 -> 9012345678901234000000000000000000
+dqshi085 shift 1234567890123456789012345678901234 +19 -> 123456789012340000000000000000000
+dqshi086 shift 1234567890123456789012345678901234 +20 -> 1234567890123400000000000000000000
+dqshi087 shift 1234567890123456789012345678901234 +21 -> 2345678901234000000000000000000000
+dqshi088 shift 1234567890123456789012345678901234 +22 -> 3456789012340000000000000000000000
+dqshi089 shift 1234567890123456789012345678901234 +23 -> 4567890123400000000000000000000000
+dqshi090 shift 1234567890123456789012345678901234 +24 -> 5678901234000000000000000000000000
+dqshi091 shift 1234567890123456789012345678901234 +25 -> 6789012340000000000000000000000000
+dqshi092 shift 1234567890123456789012345678901234 +26 -> 7890123400000000000000000000000000
+dqshi093 shift 1234567890123456789012345678901234 +27 -> 8901234000000000000000000000000000
+dqshi094 shift 1234567890123456789012345678901234 +28 -> 9012340000000000000000000000000000
+dqshi095 shift 1234567890123456789012345678901234 +29 -> 123400000000000000000000000000000
+dqshi096 shift 1234567890123456789012345678901234 +30 -> 1234000000000000000000000000000000
+dqshi097 shift 1234567890123456789012345678901234 +31 -> 2340000000000000000000000000000000
+dqshi098 shift 1234567890123456789012345678901234 +32 -> 3400000000000000000000000000000000
+dqshi099 shift 1234567890123456789012345678901234 +33 -> 4000000000000000000000000000000000
+dqshi100 shift 1234567890123456789012345678901234 +34 -> 0
+
+-- zeros
+dqshi270 shift 0E-10 +29 -> 0E-10
+dqshi271 shift 0E-10 -29 -> 0E-10
+dqshi272 shift 0.000 +29 -> 0.000
+dqshi273 shift 0.000 -29 -> 0.000
+dqshi274 shift 0E+10 +29 -> 0E+10
+dqshi275 shift 0E+10 -29 -> 0E+10
+dqshi276 shift -0E-10 +29 -> -0E-10
+dqshi277 shift -0E-10 -29 -> -0E-10
+dqshi278 shift -0.000 +29 -> -0.000
+dqshi279 shift -0.000 -29 -> -0.000
+dqshi280 shift -0E+10 +29 -> -0E+10
+dqshi281 shift -0E+10 -29 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+dqshi141 shift 9.999999999999999999999999999999999E+6144 -1 -> 9.99999999999999999999999999999999E+6143
+dqshi142 shift 9.999999999999999999999999999999999E+6144 -33 -> 9E+6111
+dqshi143 shift 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999990E+6144
+dqshi144 shift 9.999999999999999999999999999999999E+6144 33 -> 9.000000000000000000000000000000000E+6144
+dqshi145 shift 1E-6143 -1 -> 0E-6143
+dqshi146 shift 1E-6143 -33 -> 0E-6143
+dqshi147 shift 1E-6143 1 -> 1.0E-6142
+dqshi148 shift 1E-6143 33 -> 1.000000000000000000000000000000000E-6110
+dqshi151 shift 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144
+dqshi152 shift 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176
+dqshi153 shift 1.000000000000000000000000000000000E-6143 1 -> 0E-6176
+dqshi154 shift 1.000000000000000000000000000000000E-6143 33 -> 0E-6176
+dqshi155 shift 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144
+dqshi156 shift 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176
+dqshi157 shift 9.000000000000000000000000000000000E-6143 1 -> 0E-6176
+dqshi158 shift 9.000000000000000000000000000000000E-6143 33 -> 0E-6176
+dqshi160 shift 1E-6176 -1 -> 0E-6176
+dqshi161 shift 1E-6176 -33 -> 0E-6176
+dqshi162 shift 1E-6176 1 -> 1.0E-6175
+dqshi163 shift 1E-6176 33 -> 1.000000000000000000000000000000000E-6143
+-- negatives
+dqshi171 shift -9.999999999999999999999999999999999E+6144 -1 -> -9.99999999999999999999999999999999E+6143
+dqshi172 shift -9.999999999999999999999999999999999E+6144 -33 -> -9E+6111
+dqshi173 shift -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999990E+6144
+dqshi174 shift -9.999999999999999999999999999999999E+6144 33 -> -9.000000000000000000000000000000000E+6144
+dqshi175 shift -1E-6143 -1 -> -0E-6143
+dqshi176 shift -1E-6143 -33 -> -0E-6143
+dqshi177 shift -1E-6143 1 -> -1.0E-6142
+dqshi178 shift -1E-6143 33 -> -1.000000000000000000000000000000000E-6110
+dqshi181 shift -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144
+dqshi182 shift -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176
+dqshi183 shift -1.000000000000000000000000000000000E-6143 1 -> -0E-6176
+dqshi184 shift -1.000000000000000000000000000000000E-6143 33 -> -0E-6176
+dqshi185 shift -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144
+dqshi186 shift -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176
+dqshi187 shift -9.000000000000000000000000000000000E-6143 1 -> -0E-6176
+dqshi188 shift -9.000000000000000000000000000000000E-6143 33 -> -0E-6176
+dqshi190 shift -1E-6176 -1 -> -0E-6176
+dqshi191 shift -1E-6176 -33 -> -0E-6176
+dqshi192 shift -1E-6176 1 -> -1.0E-6175
+dqshi193 shift -1E-6176 33 -> -1.000000000000000000000000000000000E-6143
+
+-- more negatives (of sanities)
+dqshi201 shift -0 0 -> -0
+dqshi202 shift -0 2 -> -0
+dqshi203 shift -1 2 -> -100
+dqshi204 shift -1 33 -> -1000000000000000000000000000000000
+dqshi205 shift -1 34 -> -0
+dqshi206 shift -1 -1 -> -0
+dqshi207 shift -0 -2 -> -0
+dqshi208 shift -1234567890123456789012345678901234 -1 -> -123456789012345678901234567890123
+dqshi209 shift -1234567890123456789012345678901234 -33 -> -1
+dqshi210 shift -1234567890123456789012345678901234 -34 -> -0
+dqshi211 shift -9934567890123456789012345678901234 -33 -> -9
+dqshi212 shift -9934567890123456789012345678901234 -34 -> -0
+
+
+-- Specials; NaNs are handled as usual
+dqshi781 shift -Inf -8 -> -Infinity
+dqshi782 shift -Inf -1 -> -Infinity
+dqshi783 shift -Inf -0 -> -Infinity
+dqshi784 shift -Inf 0 -> -Infinity
+dqshi785 shift -Inf 1 -> -Infinity
+dqshi786 shift -Inf 8 -> -Infinity
+dqshi787 shift -1000 -Inf -> NaN Invalid_operation
+dqshi788 shift -Inf -Inf -> NaN Invalid_operation
+dqshi789 shift -1 -Inf -> NaN Invalid_operation
+dqshi790 shift -0 -Inf -> NaN Invalid_operation
+dqshi791 shift 0 -Inf -> NaN Invalid_operation
+dqshi792 shift 1 -Inf -> NaN Invalid_operation
+dqshi793 shift 1000 -Inf -> NaN Invalid_operation
+dqshi794 shift Inf -Inf -> NaN Invalid_operation
+
+dqshi800 shift Inf -Inf -> NaN Invalid_operation
+dqshi801 shift Inf -8 -> Infinity
+dqshi802 shift Inf -1 -> Infinity
+dqshi803 shift Inf -0 -> Infinity
+dqshi804 shift Inf 0 -> Infinity
+dqshi805 shift Inf 1 -> Infinity
+dqshi806 shift Inf 8 -> Infinity
+dqshi807 shift Inf Inf -> NaN Invalid_operation
+dqshi808 shift -1000 Inf -> NaN Invalid_operation
+dqshi809 shift -Inf Inf -> NaN Invalid_operation
+dqshi810 shift -1 Inf -> NaN Invalid_operation
+dqshi811 shift -0 Inf -> NaN Invalid_operation
+dqshi812 shift 0 Inf -> NaN Invalid_operation
+dqshi813 shift 1 Inf -> NaN Invalid_operation
+dqshi814 shift 1000 Inf -> NaN Invalid_operation
+dqshi815 shift Inf Inf -> NaN Invalid_operation
+
+dqshi821 shift NaN -Inf -> NaN
+dqshi822 shift NaN -1000 -> NaN
+dqshi823 shift NaN -1 -> NaN
+dqshi824 shift NaN -0 -> NaN
+dqshi825 shift NaN 0 -> NaN
+dqshi826 shift NaN 1 -> NaN
+dqshi827 shift NaN 1000 -> NaN
+dqshi828 shift NaN Inf -> NaN
+dqshi829 shift NaN NaN -> NaN
+dqshi830 shift -Inf NaN -> NaN
+dqshi831 shift -1000 NaN -> NaN
+dqshi832 shift -1 NaN -> NaN
+dqshi833 shift -0 NaN -> NaN
+dqshi834 shift 0 NaN -> NaN
+dqshi835 shift 1 NaN -> NaN
+dqshi836 shift 1000 NaN -> NaN
+dqshi837 shift Inf NaN -> NaN
+
+dqshi841 shift sNaN -Inf -> NaN Invalid_operation
+dqshi842 shift sNaN -1000 -> NaN Invalid_operation
+dqshi843 shift sNaN -1 -> NaN Invalid_operation
+dqshi844 shift sNaN -0 -> NaN Invalid_operation
+dqshi845 shift sNaN 0 -> NaN Invalid_operation
+dqshi846 shift sNaN 1 -> NaN Invalid_operation
+dqshi847 shift sNaN 1000 -> NaN Invalid_operation
+dqshi848 shift sNaN NaN -> NaN Invalid_operation
+dqshi849 shift sNaN sNaN -> NaN Invalid_operation
+dqshi850 shift NaN sNaN -> NaN Invalid_operation
+dqshi851 shift -Inf sNaN -> NaN Invalid_operation
+dqshi852 shift -1000 sNaN -> NaN Invalid_operation
+dqshi853 shift -1 sNaN -> NaN Invalid_operation
+dqshi854 shift -0 sNaN -> NaN Invalid_operation
+dqshi855 shift 0 sNaN -> NaN Invalid_operation
+dqshi856 shift 1 sNaN -> NaN Invalid_operation
+dqshi857 shift 1000 sNaN -> NaN Invalid_operation
+dqshi858 shift Inf sNaN -> NaN Invalid_operation
+dqshi859 shift NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqshi861 shift NaN1 -Inf -> NaN1
+dqshi862 shift +NaN2 -1000 -> NaN2
+dqshi863 shift NaN3 1000 -> NaN3
+dqshi864 shift NaN4 Inf -> NaN4
+dqshi865 shift NaN5 +NaN6 -> NaN5
+dqshi866 shift -Inf NaN7 -> NaN7
+dqshi867 shift -1000 NaN8 -> NaN8
+dqshi868 shift 1000 NaN9 -> NaN9
+dqshi869 shift Inf +NaN10 -> NaN10
+dqshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation
+dqshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation
+dqshi873 shift sNaN13 1000 -> NaN13 Invalid_operation
+dqshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
+dqshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
+dqshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
+dqshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation
+dqshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation
+dqshi880 shift Inf sNaN23 -> NaN23 Invalid_operation
+dqshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqshi882 shift -NaN26 NaN28 -> -NaN26
+dqshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqshi884 shift 1000 -NaN30 -> -NaN30
+dqshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqSubtract.decTest b/Lib/test/decimaltestdata/dqSubtract.decTest
index 34572f69d5..f3b92270f9 100644
--- a/Lib/test/decimaltestdata/dqSubtract.decTest
+++ b/Lib/test/decimaltestdata/dqSubtract.decTest
@@ -1,635 +1,635 @@
-------------------------------------------------------------------------
--- dqSubtract.decTest -- decQuad subtraction --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decQuads only; all arguments are
--- representable in a decQuad
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- [first group are 'quick confidence check']
-dqsub001 subtract 0 0 -> '0'
-dqsub002 subtract 1 1 -> '0'
-dqsub003 subtract 1 2 -> '-1'
-dqsub004 subtract 2 1 -> '1'
-dqsub005 subtract 2 2 -> '0'
-dqsub006 subtract 3 2 -> '1'
-dqsub007 subtract 2 3 -> '-1'
-
-dqsub011 subtract -0 0 -> '-0'
-dqsub012 subtract -1 1 -> '-2'
-dqsub013 subtract -1 2 -> '-3'
-dqsub014 subtract -2 1 -> '-3'
-dqsub015 subtract -2 2 -> '-4'
-dqsub016 subtract -3 2 -> '-5'
-dqsub017 subtract -2 3 -> '-5'
-
-dqsub021 subtract 0 -0 -> '0'
-dqsub022 subtract 1 -1 -> '2'
-dqsub023 subtract 1 -2 -> '3'
-dqsub024 subtract 2 -1 -> '3'
-dqsub025 subtract 2 -2 -> '4'
-dqsub026 subtract 3 -2 -> '5'
-dqsub027 subtract 2 -3 -> '5'
-
-dqsub030 subtract 11 1 -> 10
-dqsub031 subtract 10 1 -> 9
-dqsub032 subtract 9 1 -> 8
-dqsub033 subtract 1 1 -> 0
-dqsub034 subtract 0 1 -> -1
-dqsub035 subtract -1 1 -> -2
-dqsub036 subtract -9 1 -> -10
-dqsub037 subtract -10 1 -> -11
-dqsub038 subtract -11 1 -> -12
-
-dqsub040 subtract '5.75' '3.3' -> '2.45'
-dqsub041 subtract '5' '-3' -> '8'
-dqsub042 subtract '-5' '-3' -> '-2'
-dqsub043 subtract '-7' '2.5' -> '-9.5'
-dqsub044 subtract '0.7' '0.3' -> '0.4'
-dqsub045 subtract '1.3' '0.3' -> '1.0'
-dqsub046 subtract '1.25' '1.25' -> '0.00'
-
-dqsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
-dqsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
-
-dqsub060 subtract '70' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
-dqsub061 subtract '700' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
-dqsub062 subtract '7000' '10000e+34' -> '-9.999999999999999999999999999999999E+37' Inexact Rounded
-dqsub063 subtract '70000' '10000e+34' -> '-9.999999999999999999999999999999993E+37' Rounded
-dqsub064 subtract '700000' '10000e+34' -> '-9.999999999999999999999999999999930E+37' Rounded
- -- symmetry:
-dqsub065 subtract '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqsub066 subtract '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqsub067 subtract '10000e+34' '7000' -> '9.999999999999999999999999999999999E+37' Inexact Rounded
-dqsub068 subtract '10000e+34' '70000' -> '9.999999999999999999999999999999993E+37' Rounded
-dqsub069 subtract '10000e+34' '700000' -> '9.999999999999999999999999999999930E+37' Rounded
-
- -- some of the next group are really constructor tests
-dqsub090 subtract '00.0' '0.0' -> '0.0'
-dqsub091 subtract '00.0' '0.00' -> '0.00'
-dqsub092 subtract '0.00' '00.0' -> '0.00'
-dqsub093 subtract '00.0' '0.00' -> '0.00'
-dqsub094 subtract '0.00' '00.0' -> '0.00'
-dqsub095 subtract '3' '.3' -> '2.7'
-dqsub096 subtract '3.' '.3' -> '2.7'
-dqsub097 subtract '3.0' '.3' -> '2.7'
-dqsub098 subtract '3.00' '.3' -> '2.70'
-dqsub099 subtract '3' '3' -> '0'
-dqsub100 subtract '3' '+3' -> '0'
-dqsub101 subtract '3' '-3' -> '6'
-dqsub102 subtract '3' '0.3' -> '2.7'
-dqsub103 subtract '3.' '0.3' -> '2.7'
-dqsub104 subtract '3.0' '0.3' -> '2.7'
-dqsub105 subtract '3.00' '0.3' -> '2.70'
-dqsub106 subtract '3' '3.0' -> '0.0'
-dqsub107 subtract '3' '+3.0' -> '0.0'
-dqsub108 subtract '3' '-3.0' -> '6.0'
-
--- the above all from add; massaged and extended. Now some new ones...
--- [particularly important for comparisons]
--- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
--- with input rounding.
-dqsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
-dqsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
-dqsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
-dqsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
-dqsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
-dqsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
-dqsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
-dqsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
-dqsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
-dqsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
-dqsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
-dqsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
-dqsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
-dqsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
-dqsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
-dqsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
-dqsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
-dqsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
-dqsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
-dqsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
-dqsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
-dqsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
-dqsub142 subtract '1' '0.999999999' -> '1E-9'
-dqsub143 subtract '0.999999999' '1' -> '-1E-9'
-dqsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
-dqsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
-dqsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
-
--- additional scaled arithmetic tests [0.97 problem]
-dqsub160 subtract '0' '.1' -> '-0.1'
-dqsub161 subtract '00' '.97983' -> '-0.97983'
-dqsub162 subtract '0' '.9' -> '-0.9'
-dqsub163 subtract '0' '0.102' -> '-0.102'
-dqsub164 subtract '0' '.4' -> '-0.4'
-dqsub165 subtract '0' '.307' -> '-0.307'
-dqsub166 subtract '0' '.43822' -> '-0.43822'
-dqsub167 subtract '0' '.911' -> '-0.911'
-dqsub168 subtract '.0' '.02' -> '-0.02'
-dqsub169 subtract '00' '.392' -> '-0.392'
-dqsub170 subtract '0' '.26' -> '-0.26'
-dqsub171 subtract '0' '0.51' -> '-0.51'
-dqsub172 subtract '0' '.2234' -> '-0.2234'
-dqsub173 subtract '0' '.2' -> '-0.2'
-dqsub174 subtract '.0' '.0008' -> '-0.0008'
--- 0. on left
-dqsub180 subtract '0.0' '-.1' -> '0.1'
-dqsub181 subtract '0.00' '-.97983' -> '0.97983'
-dqsub182 subtract '0.0' '-.9' -> '0.9'
-dqsub183 subtract '0.0' '-0.102' -> '0.102'
-dqsub184 subtract '0.0' '-.4' -> '0.4'
-dqsub185 subtract '0.0' '-.307' -> '0.307'
-dqsub186 subtract '0.0' '-.43822' -> '0.43822'
-dqsub187 subtract '0.0' '-.911' -> '0.911'
-dqsub188 subtract '0.0' '-.02' -> '0.02'
-dqsub189 subtract '0.00' '-.392' -> '0.392'
-dqsub190 subtract '0.0' '-.26' -> '0.26'
-dqsub191 subtract '0.0' '-0.51' -> '0.51'
-dqsub192 subtract '0.0' '-.2234' -> '0.2234'
-dqsub193 subtract '0.0' '-.2' -> '0.2'
-dqsub194 subtract '0.0' '-.0008' -> '0.0008'
--- negatives of same
-dqsub200 subtract '0' '-.1' -> '0.1'
-dqsub201 subtract '00' '-.97983' -> '0.97983'
-dqsub202 subtract '0' '-.9' -> '0.9'
-dqsub203 subtract '0' '-0.102' -> '0.102'
-dqsub204 subtract '0' '-.4' -> '0.4'
-dqsub205 subtract '0' '-.307' -> '0.307'
-dqsub206 subtract '0' '-.43822' -> '0.43822'
-dqsub207 subtract '0' '-.911' -> '0.911'
-dqsub208 subtract '.0' '-.02' -> '0.02'
-dqsub209 subtract '00' '-.392' -> '0.392'
-dqsub210 subtract '0' '-.26' -> '0.26'
-dqsub211 subtract '0' '-0.51' -> '0.51'
-dqsub212 subtract '0' '-.2234' -> '0.2234'
-dqsub213 subtract '0' '-.2' -> '0.2'
-dqsub214 subtract '.0' '-.0008' -> '0.0008'
-
--- more fixed, LHS swaps [really the same as testcases under add]
-dqsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
-dqsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
-dqsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
-dqsub223 subtract '-56267E-9' 0 -> '-0.000056267'
-dqsub224 subtract '-56267E-8' 0 -> '-0.00056267'
-dqsub225 subtract '-56267E-7' 0 -> '-0.0056267'
-dqsub226 subtract '-56267E-6' 0 -> '-0.056267'
-dqsub227 subtract '-56267E-5' 0 -> '-0.56267'
-dqsub228 subtract '-56267E-2' 0 -> '-562.67'
-dqsub229 subtract '-56267E-1' 0 -> '-5626.7'
-dqsub230 subtract '-56267E-0' 0 -> '-56267'
--- symmetry ...
-dqsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
-dqsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
-dqsub242 subtract 0 '-56267E-10' -> '0.0000056267'
-dqsub243 subtract 0 '-56267E-9' -> '0.000056267'
-dqsub244 subtract 0 '-56267E-8' -> '0.00056267'
-dqsub245 subtract 0 '-56267E-7' -> '0.0056267'
-dqsub246 subtract 0 '-56267E-6' -> '0.056267'
-dqsub247 subtract 0 '-56267E-5' -> '0.56267'
-dqsub248 subtract 0 '-56267E-2' -> '562.67'
-dqsub249 subtract 0 '-56267E-1' -> '5626.7'
-dqsub250 subtract 0 '-56267E-0' -> '56267'
-
--- now some more from the 'new' add
-dqsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
-dqsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
-
--- some carrying effects
-dqsub321 subtract '0.9998' '0.0000' -> '0.9998'
-dqsub322 subtract '0.9998' '0.0001' -> '0.9997'
-dqsub323 subtract '0.9998' '0.0002' -> '0.9996'
-dqsub324 subtract '0.9998' '0.0003' -> '0.9995'
-dqsub325 subtract '0.9998' '-0.0000' -> '0.9998'
-dqsub326 subtract '0.9998' '-0.0001' -> '0.9999'
-dqsub327 subtract '0.9998' '-0.0002' -> '1.0000'
-dqsub328 subtract '0.9998' '-0.0003' -> '1.0001'
-
--- internal boundaries
-dqsub346 subtract '10000e+9' '7' -> '9999999999993'
-dqsub347 subtract '10000e+9' '70' -> '9999999999930'
-dqsub348 subtract '10000e+9' '700' -> '9999999999300'
-dqsub349 subtract '10000e+9' '7000' -> '9999999993000'
-dqsub350 subtract '10000e+9' '70000' -> '9999999930000'
-dqsub351 subtract '10000e+9' '700000' -> '9999999300000'
-dqsub352 subtract '7' '10000e+9' -> '-9999999999993'
-dqsub353 subtract '70' '10000e+9' -> '-9999999999930'
-dqsub354 subtract '700' '10000e+9' -> '-9999999999300'
-dqsub355 subtract '7000' '10000e+9' -> '-9999999993000'
-dqsub356 subtract '70000' '10000e+9' -> '-9999999930000'
-dqsub357 subtract '700000' '10000e+9' -> '-9999999300000'
-
--- zero preservation
-dqsub361 subtract 1 '0.0001' -> '0.9999'
-dqsub362 subtract 1 '0.00001' -> '0.99999'
-dqsub363 subtract 1 '0.000001' -> '0.999999'
-dqsub364 subtract 1 '0.0000000000000000000000000000000001' -> '0.9999999999999999999999999999999999'
-dqsub365 subtract 1 '0.00000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub366 subtract 1 '0.000000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
-
--- some funny zeros [in case of bad signum]
-dqsub370 subtract 1 0 -> 1
-dqsub371 subtract 1 0. -> 1
-dqsub372 subtract 1 .0 -> 1.0
-dqsub373 subtract 1 0.0 -> 1.0
-dqsub374 subtract 0 1 -> -1
-dqsub375 subtract 0. 1 -> -1
-dqsub376 subtract .0 1 -> -1.0
-dqsub377 subtract 0.0 1 -> -1.0
-
--- leading 0 digit before round
-dqsub910 subtract -103519362 -51897955.3 -> -51621406.7
-dqsub911 subtract 159579.444 89827.5229 -> 69751.9211
-
-dqsub920 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234566 -> 299.9999999999999999999999999999999 Inexact Rounded
-dqsub921 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 300.0000000000000000000000000000000 Inexact Rounded
-dqsub922 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 99.99999999999999999999999999999995
-dqsub923 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234564 -> 99.99999999999999999999999999999996
-dqsub924 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234540 -> 100.0000000000000000000000000000002 Rounded
-dqsub925 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234560 -> 90.00000000000000000000000000000000
-dqsub926 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234561 -> 89.99999999999999999999999999999999
-dqsub927 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234566 -> 89.99999999999999999999999999999994
-dqsub928 subtract 101.0000000000000000000000000123456 91.00000000000000000000000001234566 -> 9.99999999999999999999999999999994
-dqsub929 subtract 101.0000000000000000000000000123456 99.00000000000000000000000001234566 -> 1.99999999999999999999999999999994
-
--- more LHS swaps [were fixed]
-dqsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
-dqsub391 subtract '-56267E-6' 0 -> '-0.056267'
-dqsub392 subtract '-56267E-5' 0 -> '-0.56267'
-dqsub393 subtract '-56267E-4' 0 -> '-5.6267'
-dqsub394 subtract '-56267E-3' 0 -> '-56.267'
-dqsub395 subtract '-56267E-2' 0 -> '-562.67'
-dqsub396 subtract '-56267E-1' 0 -> '-5626.7'
-dqsub397 subtract '-56267E-0' 0 -> '-56267'
-dqsub398 subtract '-5E-10' 0 -> '-5E-10'
-dqsub399 subtract '-5E-7' 0 -> '-5E-7'
-dqsub400 subtract '-5E-6' 0 -> '-0.000005'
-dqsub401 subtract '-5E-5' 0 -> '-0.00005'
-dqsub402 subtract '-5E-4' 0 -> '-0.0005'
-dqsub403 subtract '-5E-1' 0 -> '-0.5'
-dqsub404 subtract '-5E0' 0 -> '-5'
-dqsub405 subtract '-5E1' 0 -> '-50'
-dqsub406 subtract '-5E5' 0 -> '-500000'
-dqsub407 subtract '-5E33' 0 -> '-5000000000000000000000000000000000'
-dqsub408 subtract '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
-dqsub409 subtract '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
-dqsub410 subtract '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
-dqsub411 subtract '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- more RHS swaps [were fixed]
-dqsub420 subtract 0 '-56267E-10' -> '0.0000056267'
-dqsub421 subtract 0 '-56267E-6' -> '0.056267'
-dqsub422 subtract 0 '-56267E-5' -> '0.56267'
-dqsub423 subtract 0 '-56267E-4' -> '5.6267'
-dqsub424 subtract 0 '-56267E-3' -> '56.267'
-dqsub425 subtract 0 '-56267E-2' -> '562.67'
-dqsub426 subtract 0 '-56267E-1' -> '5626.7'
-dqsub427 subtract 0 '-56267E-0' -> '56267'
-dqsub428 subtract 0 '-5E-10' -> '5E-10'
-dqsub429 subtract 0 '-5E-7' -> '5E-7'
-dqsub430 subtract 0 '-5E-6' -> '0.000005'
-dqsub431 subtract 0 '-5E-5' -> '0.00005'
-dqsub432 subtract 0 '-5E-4' -> '0.0005'
-dqsub433 subtract 0 '-5E-1' -> '0.5'
-dqsub434 subtract 0 '-5E0' -> '5'
-dqsub435 subtract 0 '-5E1' -> '50'
-dqsub436 subtract 0 '-5E5' -> '500000'
-dqsub437 subtract 0 '-5E33' -> '5000000000000000000000000000000000'
-dqsub438 subtract 0 '-5E34' -> '5.000000000000000000000000000000000E+34' Rounded
-dqsub439 subtract 0 '-5E35' -> '5.000000000000000000000000000000000E+35' Rounded
-dqsub440 subtract 0 '-5E36' -> '5.000000000000000000000000000000000E+36' Rounded
-dqsub441 subtract 0 '-5E100' -> '5.000000000000000000000000000000000E+100' Rounded
-
-
--- try borderline precision, with carries, etc.
-dqsub461 subtract '1E+16' '1' -> '9999999999999999'
-dqsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
-dqsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
-dqsub464 subtract '-1' '-1E+16' -> '9999999999999999'
-dqsub465 subtract '7E+15' '1' -> '6999999999999999'
-dqsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
-dqsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
-dqsub468 subtract '-1' '-7E+15' -> '6999999999999999'
-
--- 1234567890123456 1234567890123456 1 23456789012345
-dqsub470 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555563' -> '1.000000000000000000000000000000001' Inexact Rounded
-dqsub471 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555562' -> '1.000000000000000000000000000000001' Inexact Rounded
-dqsub472 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555561' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub473 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555560' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub474 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555559' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub475 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555558' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub476 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555557' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub477 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555556' -> '1.000000000000000000000000000000000' Rounded
-dqsub478 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
-dqsub479 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555554' -> '0.9999999999999999999999999999999998'
-dqsub480 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555553' -> '0.9999999999999999999999999999999997'
-dqsub481 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555552' -> '0.9999999999999999999999999999999996'
-dqsub482 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555551' -> '0.9999999999999999999999999999999995'
-dqsub483 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555550' -> '0.9999999999999999999999999999999994'
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-dqsub500 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
-dqsub501 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub502 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub503 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub504 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub505 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub506 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub507 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub508 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub509 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub510 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub511 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub512 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub513 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub514 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub515 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub516 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
-dqsub517 subtract '1231234555555555555555555567456789' 1.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub518 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub519 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
-
-rounding: half_even
-dqsub520 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
-dqsub521 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub522 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub523 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub524 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub525 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub526 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub527 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub528 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub529 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub530 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub531 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub532 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub533 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub534 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub535 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub536 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
-dqsub537 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub538 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub539 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
--- critical few with even bottom digit...
-dqsub540 subtract '1231234555555555555555555567456788' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub541 subtract '1231234555555555555555555567456788' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub542 subtract '1231234555555555555555555567456788' 0.500000001 -> '1231234555555555555555555567456787' Inexact Rounded
-
-rounding: down
-dqsub550 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
-dqsub551 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub552 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub553 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub554 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub555 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub556 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub557 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub558 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub559 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub560 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub561 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub562 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub563 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub564 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub565 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub566 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
-dqsub567 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456787' Inexact Rounded
-dqsub568 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456787' Inexact Rounded
-dqsub569 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456787' Inexact Rounded
-
--- symmetry...
-rounding: half_up
-dqsub600 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
-dqsub601 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub602 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub603 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub604 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub605 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub606 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub607 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub608 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub609 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub610 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub611 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub612 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub613 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub614 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub615 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub616 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
-dqsub617 subtract 1.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub618 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub619 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-
-rounding: half_even
-dqsub620 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
-dqsub621 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub622 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub623 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub624 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub625 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub626 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub627 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub628 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub629 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub630 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub631 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub632 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub633 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub634 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub635 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub636 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
-dqsub637 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub638 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub639 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
--- critical few with even bottom digit...
-dqsub640 subtract 0.499999999 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub641 subtract 0.5 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub642 subtract 0.500000001 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456787' Inexact Rounded
-
-rounding: down
-dqsub650 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
-dqsub651 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub652 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub653 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub654 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub655 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub656 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub657 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub658 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub659 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub660 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub661 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub662 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub663 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub664 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub665 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub666 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
-dqsub667 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
-dqsub668 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
-dqsub669 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
-
-
--- lots of leading zeros in intermediate result, and showing effects of
--- input rounding would have affected the following
-rounding: half_up
-dqsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
-dqsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
-dqsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
-dqsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
-dqsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
-
-rounding: half_even
-dqsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
-dqsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
-dqsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
-dqsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
-dqsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
-
-dqsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
-dqsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
-dqsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
-dqsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
-dqsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
-
-rounding: down
-dqsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
-dqsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
-dqsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
-dqsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
-dqsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
-
--- Specials
-dqsub780 subtract -Inf Inf -> -Infinity
-dqsub781 subtract -Inf 1000 -> -Infinity
-dqsub782 subtract -Inf 1 -> -Infinity
-dqsub783 subtract -Inf -0 -> -Infinity
-dqsub784 subtract -Inf -1 -> -Infinity
-dqsub785 subtract -Inf -1000 -> -Infinity
-dqsub787 subtract -1000 Inf -> -Infinity
-dqsub788 subtract -Inf Inf -> -Infinity
-dqsub789 subtract -1 Inf -> -Infinity
-dqsub790 subtract 0 Inf -> -Infinity
-dqsub791 subtract 1 Inf -> -Infinity
-dqsub792 subtract 1000 Inf -> -Infinity
-
-dqsub800 subtract Inf Inf -> NaN Invalid_operation
-dqsub801 subtract Inf 1000 -> Infinity
-dqsub802 subtract Inf 1 -> Infinity
-dqsub803 subtract Inf 0 -> Infinity
-dqsub804 subtract Inf -0 -> Infinity
-dqsub805 subtract Inf -1 -> Infinity
-dqsub806 subtract Inf -1000 -> Infinity
-dqsub807 subtract Inf -Inf -> Infinity
-dqsub808 subtract -1000 -Inf -> Infinity
-dqsub809 subtract -Inf -Inf -> NaN Invalid_operation
-dqsub810 subtract -1 -Inf -> Infinity
-dqsub811 subtract -0 -Inf -> Infinity
-dqsub812 subtract 0 -Inf -> Infinity
-dqsub813 subtract 1 -Inf -> Infinity
-dqsub814 subtract 1000 -Inf -> Infinity
-dqsub815 subtract Inf -Inf -> Infinity
-
-dqsub821 subtract NaN Inf -> NaN
-dqsub822 subtract -NaN 1000 -> -NaN
-dqsub823 subtract NaN 1 -> NaN
-dqsub824 subtract NaN 0 -> NaN
-dqsub825 subtract NaN -0 -> NaN
-dqsub826 subtract NaN -1 -> NaN
-dqsub827 subtract NaN -1000 -> NaN
-dqsub828 subtract NaN -Inf -> NaN
-dqsub829 subtract -NaN NaN -> -NaN
-dqsub830 subtract -Inf NaN -> NaN
-dqsub831 subtract -1000 NaN -> NaN
-dqsub832 subtract -1 NaN -> NaN
-dqsub833 subtract -0 NaN -> NaN
-dqsub834 subtract 0 NaN -> NaN
-dqsub835 subtract 1 NaN -> NaN
-dqsub836 subtract 1000 -NaN -> -NaN
-dqsub837 subtract Inf NaN -> NaN
-
-dqsub841 subtract sNaN Inf -> NaN Invalid_operation
-dqsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
-dqsub843 subtract sNaN 1 -> NaN Invalid_operation
-dqsub844 subtract sNaN 0 -> NaN Invalid_operation
-dqsub845 subtract sNaN -0 -> NaN Invalid_operation
-dqsub846 subtract sNaN -1 -> NaN Invalid_operation
-dqsub847 subtract sNaN -1000 -> NaN Invalid_operation
-dqsub848 subtract sNaN NaN -> NaN Invalid_operation
-dqsub849 subtract sNaN sNaN -> NaN Invalid_operation
-dqsub850 subtract NaN sNaN -> NaN Invalid_operation
-dqsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
-dqsub852 subtract -1000 sNaN -> NaN Invalid_operation
-dqsub853 subtract -1 sNaN -> NaN Invalid_operation
-dqsub854 subtract -0 sNaN -> NaN Invalid_operation
-dqsub855 subtract 0 sNaN -> NaN Invalid_operation
-dqsub856 subtract 1 sNaN -> NaN Invalid_operation
-dqsub857 subtract 1000 sNaN -> NaN Invalid_operation
-dqsub858 subtract Inf sNaN -> NaN Invalid_operation
-dqsub859 subtract NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqsub861 subtract NaN01 -Inf -> NaN1
-dqsub862 subtract -NaN02 -1000 -> -NaN2
-dqsub863 subtract NaN03 1000 -> NaN3
-dqsub864 subtract NaN04 Inf -> NaN4
-dqsub865 subtract NaN05 NaN61 -> NaN5
-dqsub866 subtract -Inf -NaN71 -> -NaN71
-dqsub867 subtract -1000 NaN81 -> NaN81
-dqsub868 subtract 1000 NaN91 -> NaN91
-dqsub869 subtract Inf NaN101 -> NaN101
-dqsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
-dqsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
-dqsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
-dqsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
-dqsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
-dqsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
-dqsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
-dqsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
-dqsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
-dqsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
-dqsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- edge case spills
-dqsub901 subtract 2.E-3 1.002 -> -1.000
-dqsub902 subtract 2.0E-3 1.002 -> -1.0000
-dqsub903 subtract 2.00E-3 1.0020 -> -1.00000
-dqsub904 subtract 2.000E-3 1.00200 -> -1.000000
-dqsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
-dqsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
-dqsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
-dqsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
-
--- subnormals and overflows covered under Add
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dqsub1125 subtract 130E-2 120E-2 -> 0.10
-dqsub1126 subtract 130E-2 12E-1 -> 0.10
-dqsub1127 subtract 130E-2 1E0 -> 0.30
-dqsub1128 subtract 1E2 1E4 -> -9.9E+3
-
--- Null tests
-dqsub9990 subtract 10 # -> NaN Invalid_operation
-dqsub9991 subtract # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqSubtract.decTest -- decQuad subtraction --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decQuads only; all arguments are
+-- representable in a decQuad
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+dqsub001 subtract 0 0 -> '0'
+dqsub002 subtract 1 1 -> '0'
+dqsub003 subtract 1 2 -> '-1'
+dqsub004 subtract 2 1 -> '1'
+dqsub005 subtract 2 2 -> '0'
+dqsub006 subtract 3 2 -> '1'
+dqsub007 subtract 2 3 -> '-1'
+
+dqsub011 subtract -0 0 -> '-0'
+dqsub012 subtract -1 1 -> '-2'
+dqsub013 subtract -1 2 -> '-3'
+dqsub014 subtract -2 1 -> '-3'
+dqsub015 subtract -2 2 -> '-4'
+dqsub016 subtract -3 2 -> '-5'
+dqsub017 subtract -2 3 -> '-5'
+
+dqsub021 subtract 0 -0 -> '0'
+dqsub022 subtract 1 -1 -> '2'
+dqsub023 subtract 1 -2 -> '3'
+dqsub024 subtract 2 -1 -> '3'
+dqsub025 subtract 2 -2 -> '4'
+dqsub026 subtract 3 -2 -> '5'
+dqsub027 subtract 2 -3 -> '5'
+
+dqsub030 subtract 11 1 -> 10
+dqsub031 subtract 10 1 -> 9
+dqsub032 subtract 9 1 -> 8
+dqsub033 subtract 1 1 -> 0
+dqsub034 subtract 0 1 -> -1
+dqsub035 subtract -1 1 -> -2
+dqsub036 subtract -9 1 -> -10
+dqsub037 subtract -10 1 -> -11
+dqsub038 subtract -11 1 -> -12
+
+dqsub040 subtract '5.75' '3.3' -> '2.45'
+dqsub041 subtract '5' '-3' -> '8'
+dqsub042 subtract '-5' '-3' -> '-2'
+dqsub043 subtract '-7' '2.5' -> '-9.5'
+dqsub044 subtract '0.7' '0.3' -> '0.4'
+dqsub045 subtract '1.3' '0.3' -> '1.0'
+dqsub046 subtract '1.25' '1.25' -> '0.00'
+
+dqsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
+dqsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
+
+dqsub060 subtract '70' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
+dqsub061 subtract '700' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
+dqsub062 subtract '7000' '10000e+34' -> '-9.999999999999999999999999999999999E+37' Inexact Rounded
+dqsub063 subtract '70000' '10000e+34' -> '-9.999999999999999999999999999999993E+37' Rounded
+dqsub064 subtract '700000' '10000e+34' -> '-9.999999999999999999999999999999930E+37' Rounded
+ -- symmetry:
+dqsub065 subtract '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqsub066 subtract '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqsub067 subtract '10000e+34' '7000' -> '9.999999999999999999999999999999999E+37' Inexact Rounded
+dqsub068 subtract '10000e+34' '70000' -> '9.999999999999999999999999999999993E+37' Rounded
+dqsub069 subtract '10000e+34' '700000' -> '9.999999999999999999999999999999930E+37' Rounded
+
+ -- some of the next group are really constructor tests
+dqsub090 subtract '00.0' '0.0' -> '0.0'
+dqsub091 subtract '00.0' '0.00' -> '0.00'
+dqsub092 subtract '0.00' '00.0' -> '0.00'
+dqsub093 subtract '00.0' '0.00' -> '0.00'
+dqsub094 subtract '0.00' '00.0' -> '0.00'
+dqsub095 subtract '3' '.3' -> '2.7'
+dqsub096 subtract '3.' '.3' -> '2.7'
+dqsub097 subtract '3.0' '.3' -> '2.7'
+dqsub098 subtract '3.00' '.3' -> '2.70'
+dqsub099 subtract '3' '3' -> '0'
+dqsub100 subtract '3' '+3' -> '0'
+dqsub101 subtract '3' '-3' -> '6'
+dqsub102 subtract '3' '0.3' -> '2.7'
+dqsub103 subtract '3.' '0.3' -> '2.7'
+dqsub104 subtract '3.0' '0.3' -> '2.7'
+dqsub105 subtract '3.00' '0.3' -> '2.70'
+dqsub106 subtract '3' '3.0' -> '0.0'
+dqsub107 subtract '3' '+3.0' -> '0.0'
+dqsub108 subtract '3' '-3.0' -> '6.0'
+
+-- the above all from add; massaged and extended. Now some new ones...
+-- [particularly important for comparisons]
+-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
+-- with input rounding.
+dqsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
+dqsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
+dqsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
+dqsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
+dqsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
+dqsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
+dqsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
+dqsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
+dqsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
+dqsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
+dqsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
+dqsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
+dqsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
+dqsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
+dqsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
+dqsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
+dqsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
+dqsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
+dqsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
+dqsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
+dqsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
+dqsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
+dqsub142 subtract '1' '0.999999999' -> '1E-9'
+dqsub143 subtract '0.999999999' '1' -> '-1E-9'
+dqsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
+dqsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
+dqsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
+
+-- additional scaled arithmetic tests [0.97 problem]
+dqsub160 subtract '0' '.1' -> '-0.1'
+dqsub161 subtract '00' '.97983' -> '-0.97983'
+dqsub162 subtract '0' '.9' -> '-0.9'
+dqsub163 subtract '0' '0.102' -> '-0.102'
+dqsub164 subtract '0' '.4' -> '-0.4'
+dqsub165 subtract '0' '.307' -> '-0.307'
+dqsub166 subtract '0' '.43822' -> '-0.43822'
+dqsub167 subtract '0' '.911' -> '-0.911'
+dqsub168 subtract '.0' '.02' -> '-0.02'
+dqsub169 subtract '00' '.392' -> '-0.392'
+dqsub170 subtract '0' '.26' -> '-0.26'
+dqsub171 subtract '0' '0.51' -> '-0.51'
+dqsub172 subtract '0' '.2234' -> '-0.2234'
+dqsub173 subtract '0' '.2' -> '-0.2'
+dqsub174 subtract '.0' '.0008' -> '-0.0008'
+-- 0. on left
+dqsub180 subtract '0.0' '-.1' -> '0.1'
+dqsub181 subtract '0.00' '-.97983' -> '0.97983'
+dqsub182 subtract '0.0' '-.9' -> '0.9'
+dqsub183 subtract '0.0' '-0.102' -> '0.102'
+dqsub184 subtract '0.0' '-.4' -> '0.4'
+dqsub185 subtract '0.0' '-.307' -> '0.307'
+dqsub186 subtract '0.0' '-.43822' -> '0.43822'
+dqsub187 subtract '0.0' '-.911' -> '0.911'
+dqsub188 subtract '0.0' '-.02' -> '0.02'
+dqsub189 subtract '0.00' '-.392' -> '0.392'
+dqsub190 subtract '0.0' '-.26' -> '0.26'
+dqsub191 subtract '0.0' '-0.51' -> '0.51'
+dqsub192 subtract '0.0' '-.2234' -> '0.2234'
+dqsub193 subtract '0.0' '-.2' -> '0.2'
+dqsub194 subtract '0.0' '-.0008' -> '0.0008'
+-- negatives of same
+dqsub200 subtract '0' '-.1' -> '0.1'
+dqsub201 subtract '00' '-.97983' -> '0.97983'
+dqsub202 subtract '0' '-.9' -> '0.9'
+dqsub203 subtract '0' '-0.102' -> '0.102'
+dqsub204 subtract '0' '-.4' -> '0.4'
+dqsub205 subtract '0' '-.307' -> '0.307'
+dqsub206 subtract '0' '-.43822' -> '0.43822'
+dqsub207 subtract '0' '-.911' -> '0.911'
+dqsub208 subtract '.0' '-.02' -> '0.02'
+dqsub209 subtract '00' '-.392' -> '0.392'
+dqsub210 subtract '0' '-.26' -> '0.26'
+dqsub211 subtract '0' '-0.51' -> '0.51'
+dqsub212 subtract '0' '-.2234' -> '0.2234'
+dqsub213 subtract '0' '-.2' -> '0.2'
+dqsub214 subtract '.0' '-.0008' -> '0.0008'
+
+-- more fixed, LHS swaps [really the same as testcases under add]
+dqsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
+dqsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
+dqsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
+dqsub223 subtract '-56267E-9' 0 -> '-0.000056267'
+dqsub224 subtract '-56267E-8' 0 -> '-0.00056267'
+dqsub225 subtract '-56267E-7' 0 -> '-0.0056267'
+dqsub226 subtract '-56267E-6' 0 -> '-0.056267'
+dqsub227 subtract '-56267E-5' 0 -> '-0.56267'
+dqsub228 subtract '-56267E-2' 0 -> '-562.67'
+dqsub229 subtract '-56267E-1' 0 -> '-5626.7'
+dqsub230 subtract '-56267E-0' 0 -> '-56267'
+-- symmetry ...
+dqsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
+dqsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
+dqsub242 subtract 0 '-56267E-10' -> '0.0000056267'
+dqsub243 subtract 0 '-56267E-9' -> '0.000056267'
+dqsub244 subtract 0 '-56267E-8' -> '0.00056267'
+dqsub245 subtract 0 '-56267E-7' -> '0.0056267'
+dqsub246 subtract 0 '-56267E-6' -> '0.056267'
+dqsub247 subtract 0 '-56267E-5' -> '0.56267'
+dqsub248 subtract 0 '-56267E-2' -> '562.67'
+dqsub249 subtract 0 '-56267E-1' -> '5626.7'
+dqsub250 subtract 0 '-56267E-0' -> '56267'
+
+-- now some more from the 'new' add
+dqsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
+dqsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
+
+-- some carrying effects
+dqsub321 subtract '0.9998' '0.0000' -> '0.9998'
+dqsub322 subtract '0.9998' '0.0001' -> '0.9997'
+dqsub323 subtract '0.9998' '0.0002' -> '0.9996'
+dqsub324 subtract '0.9998' '0.0003' -> '0.9995'
+dqsub325 subtract '0.9998' '-0.0000' -> '0.9998'
+dqsub326 subtract '0.9998' '-0.0001' -> '0.9999'
+dqsub327 subtract '0.9998' '-0.0002' -> '1.0000'
+dqsub328 subtract '0.9998' '-0.0003' -> '1.0001'
+
+-- internal boundaries
+dqsub346 subtract '10000e+9' '7' -> '9999999999993'
+dqsub347 subtract '10000e+9' '70' -> '9999999999930'
+dqsub348 subtract '10000e+9' '700' -> '9999999999300'
+dqsub349 subtract '10000e+9' '7000' -> '9999999993000'
+dqsub350 subtract '10000e+9' '70000' -> '9999999930000'
+dqsub351 subtract '10000e+9' '700000' -> '9999999300000'
+dqsub352 subtract '7' '10000e+9' -> '-9999999999993'
+dqsub353 subtract '70' '10000e+9' -> '-9999999999930'
+dqsub354 subtract '700' '10000e+9' -> '-9999999999300'
+dqsub355 subtract '7000' '10000e+9' -> '-9999999993000'
+dqsub356 subtract '70000' '10000e+9' -> '-9999999930000'
+dqsub357 subtract '700000' '10000e+9' -> '-9999999300000'
+
+-- zero preservation
+dqsub361 subtract 1 '0.0001' -> '0.9999'
+dqsub362 subtract 1 '0.00001' -> '0.99999'
+dqsub363 subtract 1 '0.000001' -> '0.999999'
+dqsub364 subtract 1 '0.0000000000000000000000000000000001' -> '0.9999999999999999999999999999999999'
+dqsub365 subtract 1 '0.00000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub366 subtract 1 '0.000000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
+
+-- some funny zeros [in case of bad signum]
+dqsub370 subtract 1 0 -> 1
+dqsub371 subtract 1 0. -> 1
+dqsub372 subtract 1 .0 -> 1.0
+dqsub373 subtract 1 0.0 -> 1.0
+dqsub374 subtract 0 1 -> -1
+dqsub375 subtract 0. 1 -> -1
+dqsub376 subtract .0 1 -> -1.0
+dqsub377 subtract 0.0 1 -> -1.0
+
+-- leading 0 digit before round
+dqsub910 subtract -103519362 -51897955.3 -> -51621406.7
+dqsub911 subtract 159579.444 89827.5229 -> 69751.9211
+
+dqsub920 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234566 -> 299.9999999999999999999999999999999 Inexact Rounded
+dqsub921 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 300.0000000000000000000000000000000 Inexact Rounded
+dqsub922 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 99.99999999999999999999999999999995
+dqsub923 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234564 -> 99.99999999999999999999999999999996
+dqsub924 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234540 -> 100.0000000000000000000000000000002 Rounded
+dqsub925 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234560 -> 90.00000000000000000000000000000000
+dqsub926 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234561 -> 89.99999999999999999999999999999999
+dqsub927 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234566 -> 89.99999999999999999999999999999994
+dqsub928 subtract 101.0000000000000000000000000123456 91.00000000000000000000000001234566 -> 9.99999999999999999999999999999994
+dqsub929 subtract 101.0000000000000000000000000123456 99.00000000000000000000000001234566 -> 1.99999999999999999999999999999994
+
+-- more LHS swaps [were fixed]
+dqsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
+dqsub391 subtract '-56267E-6' 0 -> '-0.056267'
+dqsub392 subtract '-56267E-5' 0 -> '-0.56267'
+dqsub393 subtract '-56267E-4' 0 -> '-5.6267'
+dqsub394 subtract '-56267E-3' 0 -> '-56.267'
+dqsub395 subtract '-56267E-2' 0 -> '-562.67'
+dqsub396 subtract '-56267E-1' 0 -> '-5626.7'
+dqsub397 subtract '-56267E-0' 0 -> '-56267'
+dqsub398 subtract '-5E-10' 0 -> '-5E-10'
+dqsub399 subtract '-5E-7' 0 -> '-5E-7'
+dqsub400 subtract '-5E-6' 0 -> '-0.000005'
+dqsub401 subtract '-5E-5' 0 -> '-0.00005'
+dqsub402 subtract '-5E-4' 0 -> '-0.0005'
+dqsub403 subtract '-5E-1' 0 -> '-0.5'
+dqsub404 subtract '-5E0' 0 -> '-5'
+dqsub405 subtract '-5E1' 0 -> '-50'
+dqsub406 subtract '-5E5' 0 -> '-500000'
+dqsub407 subtract '-5E33' 0 -> '-5000000000000000000000000000000000'
+dqsub408 subtract '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
+dqsub409 subtract '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
+dqsub410 subtract '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
+dqsub411 subtract '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- more RHS swaps [were fixed]
+dqsub420 subtract 0 '-56267E-10' -> '0.0000056267'
+dqsub421 subtract 0 '-56267E-6' -> '0.056267'
+dqsub422 subtract 0 '-56267E-5' -> '0.56267'
+dqsub423 subtract 0 '-56267E-4' -> '5.6267'
+dqsub424 subtract 0 '-56267E-3' -> '56.267'
+dqsub425 subtract 0 '-56267E-2' -> '562.67'
+dqsub426 subtract 0 '-56267E-1' -> '5626.7'
+dqsub427 subtract 0 '-56267E-0' -> '56267'
+dqsub428 subtract 0 '-5E-10' -> '5E-10'
+dqsub429 subtract 0 '-5E-7' -> '5E-7'
+dqsub430 subtract 0 '-5E-6' -> '0.000005'
+dqsub431 subtract 0 '-5E-5' -> '0.00005'
+dqsub432 subtract 0 '-5E-4' -> '0.0005'
+dqsub433 subtract 0 '-5E-1' -> '0.5'
+dqsub434 subtract 0 '-5E0' -> '5'
+dqsub435 subtract 0 '-5E1' -> '50'
+dqsub436 subtract 0 '-5E5' -> '500000'
+dqsub437 subtract 0 '-5E33' -> '5000000000000000000000000000000000'
+dqsub438 subtract 0 '-5E34' -> '5.000000000000000000000000000000000E+34' Rounded
+dqsub439 subtract 0 '-5E35' -> '5.000000000000000000000000000000000E+35' Rounded
+dqsub440 subtract 0 '-5E36' -> '5.000000000000000000000000000000000E+36' Rounded
+dqsub441 subtract 0 '-5E100' -> '5.000000000000000000000000000000000E+100' Rounded
+
+
+-- try borderline precision, with carries, etc.
+dqsub461 subtract '1E+16' '1' -> '9999999999999999'
+dqsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
+dqsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
+dqsub464 subtract '-1' '-1E+16' -> '9999999999999999'
+dqsub465 subtract '7E+15' '1' -> '6999999999999999'
+dqsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
+dqsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
+dqsub468 subtract '-1' '-7E+15' -> '6999999999999999'
+
+-- 1234567890123456 1234567890123456 1 23456789012345
+dqsub470 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555563' -> '1.000000000000000000000000000000001' Inexact Rounded
+dqsub471 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555562' -> '1.000000000000000000000000000000001' Inexact Rounded
+dqsub472 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555561' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub473 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555560' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub474 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555559' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub475 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555558' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub476 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555557' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub477 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555556' -> '1.000000000000000000000000000000000' Rounded
+dqsub478 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
+dqsub479 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555554' -> '0.9999999999999999999999999999999998'
+dqsub480 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555553' -> '0.9999999999999999999999999999999997'
+dqsub481 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555552' -> '0.9999999999999999999999999999999996'
+dqsub482 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555551' -> '0.9999999999999999999999999999999995'
+dqsub483 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555550' -> '0.9999999999999999999999999999999994'
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+dqsub500 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
+dqsub501 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub502 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub503 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub504 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub505 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub506 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub507 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub508 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub509 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub510 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub511 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub512 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub513 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub514 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub515 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub516 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
+dqsub517 subtract '1231234555555555555555555567456789' 1.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub518 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub519 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
+
+rounding: half_even
+dqsub520 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
+dqsub521 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub522 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub523 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub524 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub525 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub526 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub527 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub528 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub529 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub530 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub531 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub532 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub533 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub534 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub535 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub536 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
+dqsub537 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub538 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub539 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
+-- critical few with even bottom digit...
+dqsub540 subtract '1231234555555555555555555567456788' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub541 subtract '1231234555555555555555555567456788' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub542 subtract '1231234555555555555555555567456788' 0.500000001 -> '1231234555555555555555555567456787' Inexact Rounded
+
+rounding: down
+dqsub550 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
+dqsub551 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub552 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub553 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub554 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub555 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub556 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub557 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub558 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub559 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub560 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub561 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub562 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub563 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub564 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub565 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub566 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
+dqsub567 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456787' Inexact Rounded
+dqsub568 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456787' Inexact Rounded
+dqsub569 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456787' Inexact Rounded
+
+-- symmetry...
+rounding: half_up
+dqsub600 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
+dqsub601 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub602 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub603 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub604 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub605 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub606 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub607 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub608 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub609 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub610 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub611 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub612 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub613 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub614 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub615 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub616 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
+dqsub617 subtract 1.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub618 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub619 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+
+rounding: half_even
+dqsub620 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
+dqsub621 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub622 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub623 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub624 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub625 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub626 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub627 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub628 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub629 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub630 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub631 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub632 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub633 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub634 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub635 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub636 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
+dqsub637 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub638 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub639 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+-- critical few with even bottom digit...
+dqsub640 subtract 0.499999999 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub641 subtract 0.5 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub642 subtract 0.500000001 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456787' Inexact Rounded
+
+rounding: down
+dqsub650 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
+dqsub651 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub652 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub653 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub654 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub655 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub656 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub657 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub658 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub659 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub660 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub661 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub662 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub663 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub664 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub665 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub666 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
+dqsub667 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
+dqsub668 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
+dqsub669 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
+
+
+-- lots of leading zeros in intermediate result, and showing effects of
+-- input rounding would have affected the following
+rounding: half_up
+dqsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
+dqsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
+dqsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
+dqsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
+dqsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+rounding: half_even
+dqsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
+dqsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
+dqsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
+dqsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
+dqsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+dqsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
+dqsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
+dqsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
+dqsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
+dqsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
+
+rounding: down
+dqsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
+dqsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
+dqsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
+dqsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
+dqsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+-- Specials
+dqsub780 subtract -Inf Inf -> -Infinity
+dqsub781 subtract -Inf 1000 -> -Infinity
+dqsub782 subtract -Inf 1 -> -Infinity
+dqsub783 subtract -Inf -0 -> -Infinity
+dqsub784 subtract -Inf -1 -> -Infinity
+dqsub785 subtract -Inf -1000 -> -Infinity
+dqsub787 subtract -1000 Inf -> -Infinity
+dqsub788 subtract -Inf Inf -> -Infinity
+dqsub789 subtract -1 Inf -> -Infinity
+dqsub790 subtract 0 Inf -> -Infinity
+dqsub791 subtract 1 Inf -> -Infinity
+dqsub792 subtract 1000 Inf -> -Infinity
+
+dqsub800 subtract Inf Inf -> NaN Invalid_operation
+dqsub801 subtract Inf 1000 -> Infinity
+dqsub802 subtract Inf 1 -> Infinity
+dqsub803 subtract Inf 0 -> Infinity
+dqsub804 subtract Inf -0 -> Infinity
+dqsub805 subtract Inf -1 -> Infinity
+dqsub806 subtract Inf -1000 -> Infinity
+dqsub807 subtract Inf -Inf -> Infinity
+dqsub808 subtract -1000 -Inf -> Infinity
+dqsub809 subtract -Inf -Inf -> NaN Invalid_operation
+dqsub810 subtract -1 -Inf -> Infinity
+dqsub811 subtract -0 -Inf -> Infinity
+dqsub812 subtract 0 -Inf -> Infinity
+dqsub813 subtract 1 -Inf -> Infinity
+dqsub814 subtract 1000 -Inf -> Infinity
+dqsub815 subtract Inf -Inf -> Infinity
+
+dqsub821 subtract NaN Inf -> NaN
+dqsub822 subtract -NaN 1000 -> -NaN
+dqsub823 subtract NaN 1 -> NaN
+dqsub824 subtract NaN 0 -> NaN
+dqsub825 subtract NaN -0 -> NaN
+dqsub826 subtract NaN -1 -> NaN
+dqsub827 subtract NaN -1000 -> NaN
+dqsub828 subtract NaN -Inf -> NaN
+dqsub829 subtract -NaN NaN -> -NaN
+dqsub830 subtract -Inf NaN -> NaN
+dqsub831 subtract -1000 NaN -> NaN
+dqsub832 subtract -1 NaN -> NaN
+dqsub833 subtract -0 NaN -> NaN
+dqsub834 subtract 0 NaN -> NaN
+dqsub835 subtract 1 NaN -> NaN
+dqsub836 subtract 1000 -NaN -> -NaN
+dqsub837 subtract Inf NaN -> NaN
+
+dqsub841 subtract sNaN Inf -> NaN Invalid_operation
+dqsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
+dqsub843 subtract sNaN 1 -> NaN Invalid_operation
+dqsub844 subtract sNaN 0 -> NaN Invalid_operation
+dqsub845 subtract sNaN -0 -> NaN Invalid_operation
+dqsub846 subtract sNaN -1 -> NaN Invalid_operation
+dqsub847 subtract sNaN -1000 -> NaN Invalid_operation
+dqsub848 subtract sNaN NaN -> NaN Invalid_operation
+dqsub849 subtract sNaN sNaN -> NaN Invalid_operation
+dqsub850 subtract NaN sNaN -> NaN Invalid_operation
+dqsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
+dqsub852 subtract -1000 sNaN -> NaN Invalid_operation
+dqsub853 subtract -1 sNaN -> NaN Invalid_operation
+dqsub854 subtract -0 sNaN -> NaN Invalid_operation
+dqsub855 subtract 0 sNaN -> NaN Invalid_operation
+dqsub856 subtract 1 sNaN -> NaN Invalid_operation
+dqsub857 subtract 1000 sNaN -> NaN Invalid_operation
+dqsub858 subtract Inf sNaN -> NaN Invalid_operation
+dqsub859 subtract NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqsub861 subtract NaN01 -Inf -> NaN1
+dqsub862 subtract -NaN02 -1000 -> -NaN2
+dqsub863 subtract NaN03 1000 -> NaN3
+dqsub864 subtract NaN04 Inf -> NaN4
+dqsub865 subtract NaN05 NaN61 -> NaN5
+dqsub866 subtract -Inf -NaN71 -> -NaN71
+dqsub867 subtract -1000 NaN81 -> NaN81
+dqsub868 subtract 1000 NaN91 -> NaN91
+dqsub869 subtract Inf NaN101 -> NaN101
+dqsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
+dqsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
+dqsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
+dqsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
+dqsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
+dqsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
+dqsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
+dqsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
+dqsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
+dqsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
+dqsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- edge case spills
+dqsub901 subtract 2.E-3 1.002 -> -1.000
+dqsub902 subtract 2.0E-3 1.002 -> -1.0000
+dqsub903 subtract 2.00E-3 1.0020 -> -1.00000
+dqsub904 subtract 2.000E-3 1.00200 -> -1.000000
+dqsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
+dqsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
+dqsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
+dqsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
+
+-- subnormals and overflows covered under Add
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dqsub1125 subtract 130E-2 120E-2 -> 0.10
+dqsub1126 subtract 130E-2 12E-1 -> 0.10
+dqsub1127 subtract 130E-2 1E0 -> 0.30
+dqsub1128 subtract 1E2 1E4 -> -9.9E+3
+
+-- Null tests
+dqsub9990 subtract 10 # -> NaN Invalid_operation
+dqsub9991 subtract # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqToIntegral.decTest b/Lib/test/decimaltestdata/dqToIntegral.decTest
index 3055de572d..eb12387eab 100644
--- a/Lib/test/decimaltestdata/dqToIntegral.decTest
+++ b/Lib/test/decimaltestdata/dqToIntegral.decTest
@@ -1,257 +1,257 @@
-------------------------------------------------------------------------
--- dqToIntegral.decTest -- round Quad to integral value --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests tests the extended specification 'round-to-integral
--- value-exact' operations (from IEEE 854, later modified in 754r).
--- All non-zero results are defined as being those from either copy or
--- quantize, so those are assumed to have been tested extensively
--- elsewhere; the tests here are for integrity, rounding mode, etc.
--- Also, it is assumed the test harness will use these tests for both
--- ToIntegralExact (which does set Inexact) and the fixed-name
--- functions (which do not set Inexact).
-
--- Note that decNumber implements an earlier definition of toIntegral
--- which never sets Inexact; the decTest operator for that is called
--- 'tointegral' instead of 'tointegralx'.
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqintx001 tointegralx 0 -> 0
-dqintx002 tointegralx 0.0 -> 0
-dqintx003 tointegralx 0.1 -> 0 Inexact Rounded
-dqintx004 tointegralx 0.2 -> 0 Inexact Rounded
-dqintx005 tointegralx 0.3 -> 0 Inexact Rounded
-dqintx006 tointegralx 0.4 -> 0 Inexact Rounded
-dqintx007 tointegralx 0.5 -> 0 Inexact Rounded
-dqintx008 tointegralx 0.6 -> 1 Inexact Rounded
-dqintx009 tointegralx 0.7 -> 1 Inexact Rounded
-dqintx010 tointegralx 0.8 -> 1 Inexact Rounded
-dqintx011 tointegralx 0.9 -> 1 Inexact Rounded
-dqintx012 tointegralx 1 -> 1
-dqintx013 tointegralx 1.0 -> 1 Rounded
-dqintx014 tointegralx 1.1 -> 1 Inexact Rounded
-dqintx015 tointegralx 1.2 -> 1 Inexact Rounded
-dqintx016 tointegralx 1.3 -> 1 Inexact Rounded
-dqintx017 tointegralx 1.4 -> 1 Inexact Rounded
-dqintx018 tointegralx 1.5 -> 2 Inexact Rounded
-dqintx019 tointegralx 1.6 -> 2 Inexact Rounded
-dqintx020 tointegralx 1.7 -> 2 Inexact Rounded
-dqintx021 tointegralx 1.8 -> 2 Inexact Rounded
-dqintx022 tointegralx 1.9 -> 2 Inexact Rounded
--- negatives
-dqintx031 tointegralx -0 -> -0
-dqintx032 tointegralx -0.0 -> -0
-dqintx033 tointegralx -0.1 -> -0 Inexact Rounded
-dqintx034 tointegralx -0.2 -> -0 Inexact Rounded
-dqintx035 tointegralx -0.3 -> -0 Inexact Rounded
-dqintx036 tointegralx -0.4 -> -0 Inexact Rounded
-dqintx037 tointegralx -0.5 -> -0 Inexact Rounded
-dqintx038 tointegralx -0.6 -> -1 Inexact Rounded
-dqintx039 tointegralx -0.7 -> -1 Inexact Rounded
-dqintx040 tointegralx -0.8 -> -1 Inexact Rounded
-dqintx041 tointegralx -0.9 -> -1 Inexact Rounded
-dqintx042 tointegralx -1 -> -1
-dqintx043 tointegralx -1.0 -> -1 Rounded
-dqintx044 tointegralx -1.1 -> -1 Inexact Rounded
-dqintx045 tointegralx -1.2 -> -1 Inexact Rounded
-dqintx046 tointegralx -1.3 -> -1 Inexact Rounded
-dqintx047 tointegralx -1.4 -> -1 Inexact Rounded
-dqintx048 tointegralx -1.5 -> -2 Inexact Rounded
-dqintx049 tointegralx -1.6 -> -2 Inexact Rounded
-dqintx050 tointegralx -1.7 -> -2 Inexact Rounded
-dqintx051 tointegralx -1.8 -> -2 Inexact Rounded
-dqintx052 tointegralx -1.9 -> -2 Inexact Rounded
--- next two would be NaN using quantize(x, 0)
-dqintx053 tointegralx 10E+60 -> 1.0E+61
-dqintx054 tointegralx -10E+60 -> -1.0E+61
-
--- numbers around precision
-dqintx060 tointegralx '56267E-17' -> '0' Inexact Rounded
-dqintx061 tointegralx '56267E-5' -> '1' Inexact Rounded
-dqintx062 tointegralx '56267E-2' -> '563' Inexact Rounded
-dqintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
-dqintx065 tointegralx '56267E-0' -> '56267'
-dqintx066 tointegralx '56267E+0' -> '56267'
-dqintx067 tointegralx '56267E+1' -> '5.6267E+5'
-dqintx068 tointegralx '56267E+9' -> '5.6267E+13'
-dqintx069 tointegralx '56267E+10' -> '5.6267E+14'
-dqintx070 tointegralx '56267E+11' -> '5.6267E+15'
-dqintx071 tointegralx '56267E+12' -> '5.6267E+16'
-dqintx072 tointegralx '56267E+13' -> '5.6267E+17'
-dqintx073 tointegralx '1.23E+96' -> '1.23E+96'
-dqintx074 tointegralx '1.23E+6144' -> #47ffd300000000000000000000000000 Clamped
-
-dqintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
-dqintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
-dqintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
-dqintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
-dqintx085 tointegralx '-56267E-0' -> '-56267'
-dqintx086 tointegralx '-56267E+0' -> '-56267'
-dqintx087 tointegralx '-56267E+1' -> '-5.6267E+5'
-dqintx088 tointegralx '-56267E+9' -> '-5.6267E+13'
-dqintx089 tointegralx '-56267E+10' -> '-5.6267E+14'
-dqintx090 tointegralx '-56267E+11' -> '-5.6267E+15'
-dqintx091 tointegralx '-56267E+12' -> '-5.6267E+16'
-dqintx092 tointegralx '-56267E+13' -> '-5.6267E+17'
-dqintx093 tointegralx '-1.23E+96' -> '-1.23E+96'
-dqintx094 tointegralx '-1.23E+6144' -> #c7ffd300000000000000000000000000 Clamped
-
--- subnormal inputs
-dqintx100 tointegralx 1E-299 -> 0 Inexact Rounded
-dqintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded
-dqintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded
-dqintx103 tointegralx 0E-299 -> 0
-
--- specials and zeros
-dqintx120 tointegralx 'Inf' -> Infinity
-dqintx121 tointegralx '-Inf' -> -Infinity
-dqintx122 tointegralx NaN -> NaN
-dqintx123 tointegralx sNaN -> NaN Invalid_operation
-dqintx124 tointegralx 0 -> 0
-dqintx125 tointegralx -0 -> -0
-dqintx126 tointegralx 0.000 -> 0
-dqintx127 tointegralx 0.00 -> 0
-dqintx128 tointegralx 0.0 -> 0
-dqintx129 tointegralx 0 -> 0
-dqintx130 tointegralx 0E-3 -> 0
-dqintx131 tointegralx 0E-2 -> 0
-dqintx132 tointegralx 0E-1 -> 0
-dqintx133 tointegralx 0E-0 -> 0
-dqintx134 tointegralx 0E+1 -> 0E+1
-dqintx135 tointegralx 0E+2 -> 0E+2
-dqintx136 tointegralx 0E+3 -> 0E+3
-dqintx137 tointegralx 0E+4 -> 0E+4
-dqintx138 tointegralx 0E+5 -> 0E+5
-dqintx139 tointegralx -0.000 -> -0
-dqintx140 tointegralx -0.00 -> -0
-dqintx141 tointegralx -0.0 -> -0
-dqintx142 tointegralx -0 -> -0
-dqintx143 tointegralx -0E-3 -> -0
-dqintx144 tointegralx -0E-2 -> -0
-dqintx145 tointegralx -0E-1 -> -0
-dqintx146 tointegralx -0E-0 -> -0
-dqintx147 tointegralx -0E+1 -> -0E+1
-dqintx148 tointegralx -0E+2 -> -0E+2
-dqintx149 tointegralx -0E+3 -> -0E+3
-dqintx150 tointegralx -0E+4 -> -0E+4
-dqintx151 tointegralx -0E+5 -> -0E+5
--- propagating NaNs
-dqintx152 tointegralx NaN808 -> NaN808
-dqintx153 tointegralx sNaN080 -> NaN80 Invalid_operation
-dqintx154 tointegralx -NaN808 -> -NaN808
-dqintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
-dqintx156 tointegralx -NaN -> -NaN
-dqintx157 tointegralx -sNaN -> -NaN Invalid_operation
-
--- examples
-rounding: half_up
-dqintx200 tointegralx 2.1 -> 2 Inexact Rounded
-dqintx201 tointegralx 100 -> 100
-dqintx202 tointegralx 100.0 -> 100 Rounded
-dqintx203 tointegralx 101.5 -> 102 Inexact Rounded
-dqintx204 tointegralx -101.5 -> -102 Inexact Rounded
-dqintx205 tointegralx 10E+5 -> 1.0E+6
-dqintx206 tointegralx 7.89E+77 -> 7.89E+77
-dqintx207 tointegralx -Inf -> -Infinity
-
-
--- all rounding modes
-rounding: half_even
-dqintx210 tointegralx 55.5 -> 56 Inexact Rounded
-dqintx211 tointegralx 56.5 -> 56 Inexact Rounded
-dqintx212 tointegralx 57.5 -> 58 Inexact Rounded
-dqintx213 tointegralx -55.5 -> -56 Inexact Rounded
-dqintx214 tointegralx -56.5 -> -56 Inexact Rounded
-dqintx215 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_up
-
-dqintx220 tointegralx 55.5 -> 56 Inexact Rounded
-dqintx221 tointegralx 56.5 -> 57 Inexact Rounded
-dqintx222 tointegralx 57.5 -> 58 Inexact Rounded
-dqintx223 tointegralx -55.5 -> -56 Inexact Rounded
-dqintx224 tointegralx -56.5 -> -57 Inexact Rounded
-dqintx225 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_down
-
-dqintx230 tointegralx 55.5 -> 55 Inexact Rounded
-dqintx231 tointegralx 56.5 -> 56 Inexact Rounded
-dqintx232 tointegralx 57.5 -> 57 Inexact Rounded
-dqintx233 tointegralx -55.5 -> -55 Inexact Rounded
-dqintx234 tointegralx -56.5 -> -56 Inexact Rounded
-dqintx235 tointegralx -57.5 -> -57 Inexact Rounded
-
-rounding: up
-
-dqintx240 tointegralx 55.3 -> 56 Inexact Rounded
-dqintx241 tointegralx 56.3 -> 57 Inexact Rounded
-dqintx242 tointegralx 57.3 -> 58 Inexact Rounded
-dqintx243 tointegralx -55.3 -> -56 Inexact Rounded
-dqintx244 tointegralx -56.3 -> -57 Inexact Rounded
-dqintx245 tointegralx -57.3 -> -58 Inexact Rounded
-
-rounding: down
-
-dqintx250 tointegralx 55.7 -> 55 Inexact Rounded
-dqintx251 tointegralx 56.7 -> 56 Inexact Rounded
-dqintx252 tointegralx 57.7 -> 57 Inexact Rounded
-dqintx253 tointegralx -55.7 -> -55 Inexact Rounded
-dqintx254 tointegralx -56.7 -> -56 Inexact Rounded
-dqintx255 tointegralx -57.7 -> -57 Inexact Rounded
-
-rounding: ceiling
-
-dqintx260 tointegralx 55.3 -> 56 Inexact Rounded
-dqintx261 tointegralx 56.3 -> 57 Inexact Rounded
-dqintx262 tointegralx 57.3 -> 58 Inexact Rounded
-dqintx263 tointegralx -55.3 -> -55 Inexact Rounded
-dqintx264 tointegralx -56.3 -> -56 Inexact Rounded
-dqintx265 tointegralx -57.3 -> -57 Inexact Rounded
-
-rounding: floor
-
-dqintx270 tointegralx 55.7 -> 55 Inexact Rounded
-dqintx271 tointegralx 56.7 -> 56 Inexact Rounded
-dqintx272 tointegralx 57.7 -> 57 Inexact Rounded
-dqintx273 tointegralx -55.7 -> -56 Inexact Rounded
-dqintx274 tointegralx -56.7 -> -57 Inexact Rounded
-dqintx275 tointegralx -57.7 -> -58 Inexact Rounded
-
--- Int and uInt32 edge values for testing conversions
-dqintx300 tointegralx -2147483646 -> -2147483646
-dqintx301 tointegralx -2147483647 -> -2147483647
-dqintx302 tointegralx -2147483648 -> -2147483648
-dqintx303 tointegralx -2147483649 -> -2147483649
-dqintx304 tointegralx 2147483646 -> 2147483646
-dqintx305 tointegralx 2147483647 -> 2147483647
-dqintx306 tointegralx 2147483648 -> 2147483648
-dqintx307 tointegralx 2147483649 -> 2147483649
-dqintx308 tointegralx 4294967294 -> 4294967294
-dqintx309 tointegralx 4294967295 -> 4294967295
-dqintx310 tointegralx 4294967296 -> 4294967296
-dqintx311 tointegralx 4294967297 -> 4294967297
-
+------------------------------------------------------------------------
+-- dqToIntegral.decTest -- round Quad to integral value --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests tests the extended specification 'round-to-integral
+-- value-exact' operations (from IEEE 854, later modified in 754r).
+-- All non-zero results are defined as being those from either copy or
+-- quantize, so those are assumed to have been tested extensively
+-- elsewhere; the tests here are for integrity, rounding mode, etc.
+-- Also, it is assumed the test harness will use these tests for both
+-- ToIntegralExact (which does set Inexact) and the fixed-name
+-- functions (which do not set Inexact).
+
+-- Note that decNumber implements an earlier definition of toIntegral
+-- which never sets Inexact; the decTest operator for that is called
+-- 'tointegral' instead of 'tointegralx'.
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqintx001 tointegralx 0 -> 0
+dqintx002 tointegralx 0.0 -> 0
+dqintx003 tointegralx 0.1 -> 0 Inexact Rounded
+dqintx004 tointegralx 0.2 -> 0 Inexact Rounded
+dqintx005 tointegralx 0.3 -> 0 Inexact Rounded
+dqintx006 tointegralx 0.4 -> 0 Inexact Rounded
+dqintx007 tointegralx 0.5 -> 0 Inexact Rounded
+dqintx008 tointegralx 0.6 -> 1 Inexact Rounded
+dqintx009 tointegralx 0.7 -> 1 Inexact Rounded
+dqintx010 tointegralx 0.8 -> 1 Inexact Rounded
+dqintx011 tointegralx 0.9 -> 1 Inexact Rounded
+dqintx012 tointegralx 1 -> 1
+dqintx013 tointegralx 1.0 -> 1 Rounded
+dqintx014 tointegralx 1.1 -> 1 Inexact Rounded
+dqintx015 tointegralx 1.2 -> 1 Inexact Rounded
+dqintx016 tointegralx 1.3 -> 1 Inexact Rounded
+dqintx017 tointegralx 1.4 -> 1 Inexact Rounded
+dqintx018 tointegralx 1.5 -> 2 Inexact Rounded
+dqintx019 tointegralx 1.6 -> 2 Inexact Rounded
+dqintx020 tointegralx 1.7 -> 2 Inexact Rounded
+dqintx021 tointegralx 1.8 -> 2 Inexact Rounded
+dqintx022 tointegralx 1.9 -> 2 Inexact Rounded
+-- negatives
+dqintx031 tointegralx -0 -> -0
+dqintx032 tointegralx -0.0 -> -0
+dqintx033 tointegralx -0.1 -> -0 Inexact Rounded
+dqintx034 tointegralx -0.2 -> -0 Inexact Rounded
+dqintx035 tointegralx -0.3 -> -0 Inexact Rounded
+dqintx036 tointegralx -0.4 -> -0 Inexact Rounded
+dqintx037 tointegralx -0.5 -> -0 Inexact Rounded
+dqintx038 tointegralx -0.6 -> -1 Inexact Rounded
+dqintx039 tointegralx -0.7 -> -1 Inexact Rounded
+dqintx040 tointegralx -0.8 -> -1 Inexact Rounded
+dqintx041 tointegralx -0.9 -> -1 Inexact Rounded
+dqintx042 tointegralx -1 -> -1
+dqintx043 tointegralx -1.0 -> -1 Rounded
+dqintx044 tointegralx -1.1 -> -1 Inexact Rounded
+dqintx045 tointegralx -1.2 -> -1 Inexact Rounded
+dqintx046 tointegralx -1.3 -> -1 Inexact Rounded
+dqintx047 tointegralx -1.4 -> -1 Inexact Rounded
+dqintx048 tointegralx -1.5 -> -2 Inexact Rounded
+dqintx049 tointegralx -1.6 -> -2 Inexact Rounded
+dqintx050 tointegralx -1.7 -> -2 Inexact Rounded
+dqintx051 tointegralx -1.8 -> -2 Inexact Rounded
+dqintx052 tointegralx -1.9 -> -2 Inexact Rounded
+-- next two would be NaN using quantize(x, 0)
+dqintx053 tointegralx 10E+60 -> 1.0E+61
+dqintx054 tointegralx -10E+60 -> -1.0E+61
+
+-- numbers around precision
+dqintx060 tointegralx '56267E-17' -> '0' Inexact Rounded
+dqintx061 tointegralx '56267E-5' -> '1' Inexact Rounded
+dqintx062 tointegralx '56267E-2' -> '563' Inexact Rounded
+dqintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
+dqintx065 tointegralx '56267E-0' -> '56267'
+dqintx066 tointegralx '56267E+0' -> '56267'
+dqintx067 tointegralx '56267E+1' -> '5.6267E+5'
+dqintx068 tointegralx '56267E+9' -> '5.6267E+13'
+dqintx069 tointegralx '56267E+10' -> '5.6267E+14'
+dqintx070 tointegralx '56267E+11' -> '5.6267E+15'
+dqintx071 tointegralx '56267E+12' -> '5.6267E+16'
+dqintx072 tointegralx '56267E+13' -> '5.6267E+17'
+dqintx073 tointegralx '1.23E+96' -> '1.23E+96'
+dqintx074 tointegralx '1.23E+6144' -> #47ffd300000000000000000000000000 Clamped
+
+dqintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
+dqintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
+dqintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
+dqintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
+dqintx085 tointegralx '-56267E-0' -> '-56267'
+dqintx086 tointegralx '-56267E+0' -> '-56267'
+dqintx087 tointegralx '-56267E+1' -> '-5.6267E+5'
+dqintx088 tointegralx '-56267E+9' -> '-5.6267E+13'
+dqintx089 tointegralx '-56267E+10' -> '-5.6267E+14'
+dqintx090 tointegralx '-56267E+11' -> '-5.6267E+15'
+dqintx091 tointegralx '-56267E+12' -> '-5.6267E+16'
+dqintx092 tointegralx '-56267E+13' -> '-5.6267E+17'
+dqintx093 tointegralx '-1.23E+96' -> '-1.23E+96'
+dqintx094 tointegralx '-1.23E+6144' -> #c7ffd300000000000000000000000000 Clamped
+
+-- subnormal inputs
+dqintx100 tointegralx 1E-299 -> 0 Inexact Rounded
+dqintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded
+dqintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded
+dqintx103 tointegralx 0E-299 -> 0
+
+-- specials and zeros
+dqintx120 tointegralx 'Inf' -> Infinity
+dqintx121 tointegralx '-Inf' -> -Infinity
+dqintx122 tointegralx NaN -> NaN
+dqintx123 tointegralx sNaN -> NaN Invalid_operation
+dqintx124 tointegralx 0 -> 0
+dqintx125 tointegralx -0 -> -0
+dqintx126 tointegralx 0.000 -> 0
+dqintx127 tointegralx 0.00 -> 0
+dqintx128 tointegralx 0.0 -> 0
+dqintx129 tointegralx 0 -> 0
+dqintx130 tointegralx 0E-3 -> 0
+dqintx131 tointegralx 0E-2 -> 0
+dqintx132 tointegralx 0E-1 -> 0
+dqintx133 tointegralx 0E-0 -> 0
+dqintx134 tointegralx 0E+1 -> 0E+1
+dqintx135 tointegralx 0E+2 -> 0E+2
+dqintx136 tointegralx 0E+3 -> 0E+3
+dqintx137 tointegralx 0E+4 -> 0E+4
+dqintx138 tointegralx 0E+5 -> 0E+5
+dqintx139 tointegralx -0.000 -> -0
+dqintx140 tointegralx -0.00 -> -0
+dqintx141 tointegralx -0.0 -> -0
+dqintx142 tointegralx -0 -> -0
+dqintx143 tointegralx -0E-3 -> -0
+dqintx144 tointegralx -0E-2 -> -0
+dqintx145 tointegralx -0E-1 -> -0
+dqintx146 tointegralx -0E-0 -> -0
+dqintx147 tointegralx -0E+1 -> -0E+1
+dqintx148 tointegralx -0E+2 -> -0E+2
+dqintx149 tointegralx -0E+3 -> -0E+3
+dqintx150 tointegralx -0E+4 -> -0E+4
+dqintx151 tointegralx -0E+5 -> -0E+5
+-- propagating NaNs
+dqintx152 tointegralx NaN808 -> NaN808
+dqintx153 tointegralx sNaN080 -> NaN80 Invalid_operation
+dqintx154 tointegralx -NaN808 -> -NaN808
+dqintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
+dqintx156 tointegralx -NaN -> -NaN
+dqintx157 tointegralx -sNaN -> -NaN Invalid_operation
+
+-- examples
+rounding: half_up
+dqintx200 tointegralx 2.1 -> 2 Inexact Rounded
+dqintx201 tointegralx 100 -> 100
+dqintx202 tointegralx 100.0 -> 100 Rounded
+dqintx203 tointegralx 101.5 -> 102 Inexact Rounded
+dqintx204 tointegralx -101.5 -> -102 Inexact Rounded
+dqintx205 tointegralx 10E+5 -> 1.0E+6
+dqintx206 tointegralx 7.89E+77 -> 7.89E+77
+dqintx207 tointegralx -Inf -> -Infinity
+
+
+-- all rounding modes
+rounding: half_even
+dqintx210 tointegralx 55.5 -> 56 Inexact Rounded
+dqintx211 tointegralx 56.5 -> 56 Inexact Rounded
+dqintx212 tointegralx 57.5 -> 58 Inexact Rounded
+dqintx213 tointegralx -55.5 -> -56 Inexact Rounded
+dqintx214 tointegralx -56.5 -> -56 Inexact Rounded
+dqintx215 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_up
+
+dqintx220 tointegralx 55.5 -> 56 Inexact Rounded
+dqintx221 tointegralx 56.5 -> 57 Inexact Rounded
+dqintx222 tointegralx 57.5 -> 58 Inexact Rounded
+dqintx223 tointegralx -55.5 -> -56 Inexact Rounded
+dqintx224 tointegralx -56.5 -> -57 Inexact Rounded
+dqintx225 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_down
+
+dqintx230 tointegralx 55.5 -> 55 Inexact Rounded
+dqintx231 tointegralx 56.5 -> 56 Inexact Rounded
+dqintx232 tointegralx 57.5 -> 57 Inexact Rounded
+dqintx233 tointegralx -55.5 -> -55 Inexact Rounded
+dqintx234 tointegralx -56.5 -> -56 Inexact Rounded
+dqintx235 tointegralx -57.5 -> -57 Inexact Rounded
+
+rounding: up
+
+dqintx240 tointegralx 55.3 -> 56 Inexact Rounded
+dqintx241 tointegralx 56.3 -> 57 Inexact Rounded
+dqintx242 tointegralx 57.3 -> 58 Inexact Rounded
+dqintx243 tointegralx -55.3 -> -56 Inexact Rounded
+dqintx244 tointegralx -56.3 -> -57 Inexact Rounded
+dqintx245 tointegralx -57.3 -> -58 Inexact Rounded
+
+rounding: down
+
+dqintx250 tointegralx 55.7 -> 55 Inexact Rounded
+dqintx251 tointegralx 56.7 -> 56 Inexact Rounded
+dqintx252 tointegralx 57.7 -> 57 Inexact Rounded
+dqintx253 tointegralx -55.7 -> -55 Inexact Rounded
+dqintx254 tointegralx -56.7 -> -56 Inexact Rounded
+dqintx255 tointegralx -57.7 -> -57 Inexact Rounded
+
+rounding: ceiling
+
+dqintx260 tointegralx 55.3 -> 56 Inexact Rounded
+dqintx261 tointegralx 56.3 -> 57 Inexact Rounded
+dqintx262 tointegralx 57.3 -> 58 Inexact Rounded
+dqintx263 tointegralx -55.3 -> -55 Inexact Rounded
+dqintx264 tointegralx -56.3 -> -56 Inexact Rounded
+dqintx265 tointegralx -57.3 -> -57 Inexact Rounded
+
+rounding: floor
+
+dqintx270 tointegralx 55.7 -> 55 Inexact Rounded
+dqintx271 tointegralx 56.7 -> 56 Inexact Rounded
+dqintx272 tointegralx 57.7 -> 57 Inexact Rounded
+dqintx273 tointegralx -55.7 -> -56 Inexact Rounded
+dqintx274 tointegralx -56.7 -> -57 Inexact Rounded
+dqintx275 tointegralx -57.7 -> -58 Inexact Rounded
+
+-- Int and uInt32 edge values for testing conversions
+dqintx300 tointegralx -2147483646 -> -2147483646
+dqintx301 tointegralx -2147483647 -> -2147483647
+dqintx302 tointegralx -2147483648 -> -2147483648
+dqintx303 tointegralx -2147483649 -> -2147483649
+dqintx304 tointegralx 2147483646 -> 2147483646
+dqintx305 tointegralx 2147483647 -> 2147483647
+dqintx306 tointegralx 2147483648 -> 2147483648
+dqintx307 tointegralx 2147483649 -> 2147483649
+dqintx308 tointegralx 4294967294 -> 4294967294
+dqintx309 tointegralx 4294967295 -> 4294967295
+dqintx310 tointegralx 4294967296 -> 4294967296
+dqintx311 tointegralx 4294967297 -> 4294967297
+
diff --git a/Lib/test/decimaltestdata/dqXor.decTest b/Lib/test/decimaltestdata/dqXor.decTest
index 2216e9ebf8..fbb32e441b 100644
--- a/Lib/test/decimaltestdata/dqXor.decTest
+++ b/Lib/test/decimaltestdata/dqXor.decTest
@@ -1,410 +1,410 @@
-------------------------------------------------------------------------
--- dqXor.decTest -- digitwise logical XOR for decQuads --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check (truth table)
-dqxor001 xor 0 0 -> 0
-dqxor002 xor 0 1 -> 1
-dqxor003 xor 1 0 -> 1
-dqxor004 xor 1 1 -> 0
-dqxor005 xor 1100 1010 -> 110
--- and at msd and msd-1
-dqxor006 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqxor007 xor 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqxor008 xor 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqxor009 xor 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 0
-dqxor010 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqxor011 xor 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
-dqxor012 xor 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000
-dqxor013 xor 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 0
-
--- Various lengths
--- 1234567890123456789012345678901234
-dqxor601 xor 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000000
-dqxor602 xor 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000000
-dqxor603 xor 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000000
-dqxor604 xor 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000
-dqxor605 xor 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000
-dqxor606 xor 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000
-dqxor607 xor 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000
-dqxor608 xor 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000
-dqxor609 xor 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000
-dqxor610 xor 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000
-dqxor611 xor 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000
-dqxor612 xor 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000
-dqxor613 xor 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000
-dqxor614 xor 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000
-dqxor615 xor 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000
-dqxor616 xor 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000
-dqxor617 xor 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 100000000000000000
-dqxor618 xor 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 10000000000000000
-dqxor619 xor 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1000000000000000
-dqxor620 xor 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 100000000000000
-dqxor621 xor 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 10000000000000
-dqxor622 xor 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1000000000000
-dqxor623 xor 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 100000000000
-dqxor624 xor 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 10000000000
-dqxor625 xor 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1000000000
-dqxor626 xor 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 100000000
-dqxor627 xor 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 10000000
-dqxor628 xor 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1000000
-dqxor629 xor 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 100000
-dqxor630 xor 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 10000
-dqxor631 xor 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1000
-dqxor632 xor 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 100
-dqxor633 xor 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 10
-dqxor634 xor 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1
-
-dqxor641 xor 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
-dqxor642 xor 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 100000000000000000000000000000000
-dqxor643 xor 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 10000000000000000000000000000000
-dqxor644 xor 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1000000000000000000000000000000
-dqxor645 xor 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 100000000000000000000000000000
-dqxor646 xor 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 10000000000000000000000000000
-dqxor647 xor 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1000000000000000000000000000
-dqxor648 xor 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 100000000000000000000000000
-dqxor649 xor 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 10000000000000000000000000
-dqxor650 xor 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1000000000000000000000000
-dqxor651 xor 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 100000000000000000000000
-dqxor652 xor 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 10000000000000000000000
-dqxor653 xor 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1000000000000000000000
-dqxor654 xor 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 100000000000000000000
-dqxor655 xor 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 10000000000000000000
-dqxor656 xor 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1000000000000000000
-dqxor657 xor 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 100000000000000000
-dqxor658 xor 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 10000000000000000
-dqxor659 xor 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1000000000000000
-dqxor660 xor 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 100000000000000
-dqxor661 xor 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 10000000000000
-dqxor662 xor 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1000000000000
-dqxor663 xor 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 100000000000
-dqxor664 xor 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 10000000000
-dqxor665 xor 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1000000000
-dqxor666 xor 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 100000000
-dqxor667 xor 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 10000000
-dqxor668 xor 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1000000
-dqxor669 xor 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 100000
-dqxor670 xor 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 10000
-dqxor671 xor 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1000
-dqxor672 xor 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 100
-dqxor673 xor 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 10
-dqxor674 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1
-dqxor675 xor 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1000000000000000000000000000000001
-dqxor676 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1
-
-
-dqxor021 xor 1111111110000000 1111111110000000 -> 0
-dqxor022 xor 111111110000000 111111110000000 -> 0
-dqxor023 xor 11111110000000 11111110000000 -> 0
-dqxor024 xor 1111110000000 1111110000000 -> 0
-dqxor025 xor 111110000000 111110000000 -> 0
-dqxor026 xor 11110000000 11110000000 -> 0
-dqxor027 xor 1110000000 1110000000 -> 0
-dqxor028 xor 110000000 110000000 -> 0
-dqxor029 xor 10000000 10000000 -> 0
-dqxor030 xor 1000000 1000000 -> 0
-dqxor031 xor 100000 100000 -> 0
-dqxor032 xor 10000 10000 -> 0
-dqxor033 xor 1000 1000 -> 0
-dqxor034 xor 100 100 -> 0
-dqxor035 xor 10 10 -> 0
-dqxor036 xor 1 1 -> 0
-
-dqxor040 xor 111111111 111111111111 -> 111000000000
-dqxor041 xor 11111111 111111111111 -> 111100000000
-dqxor042 xor 11111111 111111111 -> 100000000
-dqxor043 xor 1111111 100000010 -> 101111101
-dqxor044 xor 111111 100000100 -> 100111011
-dqxor045 xor 11111 100001000 -> 100010111
-dqxor046 xor 1111 100010000 -> 100011111
-dqxor047 xor 111 100100000 -> 100100111
-dqxor048 xor 11 101000000 -> 101000011
-dqxor049 xor 1 110000000 -> 110000001
-
-dqxor050 xor 1111111111 1 -> 1111111110
-dqxor051 xor 111111111 1 -> 111111110
-dqxor052 xor 11111111 1 -> 11111110
-dqxor053 xor 1111111 1 -> 1111110
-dqxor054 xor 111111 1 -> 111110
-dqxor055 xor 11111 1 -> 11110
-dqxor056 xor 1111 1 -> 1110
-dqxor057 xor 111 1 -> 110
-dqxor058 xor 11 1 -> 10
-dqxor059 xor 1 1 -> 0
-
-dqxor060 xor 1111111111 0 -> 1111111111
-dqxor061 xor 111111111 0 -> 111111111
-dqxor062 xor 11111111 0 -> 11111111
-dqxor063 xor 1111111 0 -> 1111111
-dqxor064 xor 111111 0 -> 111111
-dqxor065 xor 11111 0 -> 11111
-dqxor066 xor 1111 0 -> 1111
-dqxor067 xor 111 0 -> 111
-dqxor068 xor 11 0 -> 11
-dqxor069 xor 1 0 -> 1
-
-dqxor070 xor 1 1111111111 -> 1111111110
-dqxor071 xor 1 111111111 -> 111111110
-dqxor072 xor 1 11111111 -> 11111110
-dqxor073 xor 1 1111111 -> 1111110
-dqxor074 xor 1 111111 -> 111110
-dqxor075 xor 1 11111 -> 11110
-dqxor076 xor 1 1111 -> 1110
-dqxor077 xor 1 111 -> 110
-dqxor078 xor 1 11 -> 10
-dqxor079 xor 1 1 -> 0
-
-dqxor080 xor 0 1111111111 -> 1111111111
-dqxor081 xor 0 111111111 -> 111111111
-dqxor082 xor 0 11111111 -> 11111111
-dqxor083 xor 0 1111111 -> 1111111
-dqxor084 xor 0 111111 -> 111111
-dqxor085 xor 0 11111 -> 11111
-dqxor086 xor 0 1111 -> 1111
-dqxor087 xor 0 111 -> 111
-dqxor088 xor 0 11 -> 11
-dqxor089 xor 0 1 -> 1
-
-dqxor090 xor 011111111 111101111 -> 100010000
-dqxor091 xor 101111111 111101111 -> 10010000
-dqxor092 xor 110111111 111101111 -> 1010000
-dqxor093 xor 111011111 111101111 -> 110000
-dqxor094 xor 111101111 111101111 -> 0
-dqxor095 xor 111110111 111101111 -> 11000
-dqxor096 xor 111111011 111101111 -> 10100
-dqxor097 xor 111111101 111101111 -> 10010
-dqxor098 xor 111111110 111101111 -> 10001
-
-dqxor100 xor 111101111 011111111 -> 100010000
-dqxor101 xor 111101111 101111111 -> 10010000
-dqxor102 xor 111101111 110111111 -> 1010000
-dqxor103 xor 111101111 111011111 -> 110000
-dqxor104 xor 111101111 111101111 -> 0
-dqxor105 xor 111101111 111110111 -> 11000
-dqxor106 xor 111101111 111111011 -> 10100
-dqxor107 xor 111101111 111111101 -> 10010
-dqxor108 xor 111101111 111111110 -> 10001
-
--- non-0/1 should not be accepted, nor should signs
-dqxor220 xor 111111112 111111111 -> NaN Invalid_operation
-dqxor221 xor 333333333 333333333 -> NaN Invalid_operation
-dqxor222 xor 555555555 555555555 -> NaN Invalid_operation
-dqxor223 xor 777777777 777777777 -> NaN Invalid_operation
-dqxor224 xor 999999999 999999999 -> NaN Invalid_operation
-dqxor225 xor 222222222 999999999 -> NaN Invalid_operation
-dqxor226 xor 444444444 999999999 -> NaN Invalid_operation
-dqxor227 xor 666666666 999999999 -> NaN Invalid_operation
-dqxor228 xor 888888888 999999999 -> NaN Invalid_operation
-dqxor229 xor 999999999 222222222 -> NaN Invalid_operation
-dqxor230 xor 999999999 444444444 -> NaN Invalid_operation
-dqxor231 xor 999999999 666666666 -> NaN Invalid_operation
-dqxor232 xor 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-dqxor240 xor 567468689 -934981942 -> NaN Invalid_operation
-dqxor241 xor 567367689 934981942 -> NaN Invalid_operation
-dqxor242 xor -631917772 -706014634 -> NaN Invalid_operation
-dqxor243 xor -756253257 138579234 -> NaN Invalid_operation
-dqxor244 xor 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-dqxor250 xor 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor251 xor 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor252 xor 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor253 xor 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor254 xor 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor255 xor 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor256 xor 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor257 xor 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor258 xor 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor259 xor 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor260 xor 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor261 xor 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor262 xor 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor263 xor 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor264 xor 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor265 xor 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
--- test MSD-1
-dqxor270 xor 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
-dqxor271 xor 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
-dqxor272 xor 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
-dqxor273 xor 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
-dqxor274 xor 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
-dqxor275 xor 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
-dqxor276 xor 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
-dqxor277 xor 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
--- test LSD
-dqxor280 xor 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
-dqxor281 xor 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
-dqxor282 xor 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
-dqxor283 xor 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
-dqxor284 xor 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
-dqxor285 xor 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
-dqxor286 xor 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
-dqxor287 xor 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
--- test Middie
-dqxor288 xor 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
-dqxor289 xor 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
-dqxor290 xor 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
-dqxor291 xor 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
-dqxor292 xor 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
-dqxor293 xor 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
-dqxor294 xor 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
-dqxor295 xor 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
--- signs
-dqxor296 xor -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
-dqxor297 xor -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
-dqxor298 xor 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
-dqxor299 xor 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001001001001001001000010000100
-
--- Nmax, Nmin, Ntiny-like
-dqxor331 xor 2 9.99999999E+999 -> NaN Invalid_operation
-dqxor332 xor 3 1E-999 -> NaN Invalid_operation
-dqxor333 xor 4 1.00000000E-2821 -> NaN Invalid_operation
-dqxor334 xor 5 1E-900 -> NaN Invalid_operation
-dqxor335 xor 6 -1E-900 -> NaN Invalid_operation
-dqxor336 xor 7 -1.00000000E-999 -> NaN Invalid_operation
-dqxor337 xor 8 -1E-999 -> NaN Invalid_operation
-dqxor338 xor 9 -9.99999999E+999 -> NaN Invalid_operation
-dqxor341 xor 9.99999999E+999 -18 -> NaN Invalid_operation
-dqxor342 xor 1E-999 01 -> NaN Invalid_operation
-dqxor343 xor 1.00000000E-999 -18 -> NaN Invalid_operation
-dqxor344 xor 1E-908 18 -> NaN Invalid_operation
-dqxor345 xor -1E-907 -10 -> NaN Invalid_operation
-dqxor346 xor -1.00000000E-999 18 -> NaN Invalid_operation
-dqxor347 xor -1E-999 10 -> NaN Invalid_operation
-dqxor348 xor -9.99999999E+2991 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-dqxor361 xor 1.0 1 -> NaN Invalid_operation
-dqxor362 xor 1E+1 1 -> NaN Invalid_operation
-dqxor363 xor 0.0 1 -> NaN Invalid_operation
-dqxor364 xor 0E+1 1 -> NaN Invalid_operation
-dqxor365 xor 9.9 1 -> NaN Invalid_operation
-dqxor366 xor 9E+1 1 -> NaN Invalid_operation
-dqxor371 xor 0 1.0 -> NaN Invalid_operation
-dqxor372 xor 0 1E+1 -> NaN Invalid_operation
-dqxor373 xor 0 0.0 -> NaN Invalid_operation
-dqxor374 xor 0 0E+1 -> NaN Invalid_operation
-dqxor375 xor 0 9.9 -> NaN Invalid_operation
-dqxor376 xor 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-dqxor780 xor -Inf -Inf -> NaN Invalid_operation
-dqxor781 xor -Inf -1000 -> NaN Invalid_operation
-dqxor782 xor -Inf -1 -> NaN Invalid_operation
-dqxor783 xor -Inf -0 -> NaN Invalid_operation
-dqxor784 xor -Inf 0 -> NaN Invalid_operation
-dqxor785 xor -Inf 1 -> NaN Invalid_operation
-dqxor786 xor -Inf 1000 -> NaN Invalid_operation
-dqxor787 xor -1000 -Inf -> NaN Invalid_operation
-dqxor788 xor -Inf -Inf -> NaN Invalid_operation
-dqxor789 xor -1 -Inf -> NaN Invalid_operation
-dqxor790 xor -0 -Inf -> NaN Invalid_operation
-dqxor791 xor 0 -Inf -> NaN Invalid_operation
-dqxor792 xor 1 -Inf -> NaN Invalid_operation
-dqxor793 xor 1000 -Inf -> NaN Invalid_operation
-dqxor794 xor Inf -Inf -> NaN Invalid_operation
-
-dqxor800 xor Inf -Inf -> NaN Invalid_operation
-dqxor801 xor Inf -1000 -> NaN Invalid_operation
-dqxor802 xor Inf -1 -> NaN Invalid_operation
-dqxor803 xor Inf -0 -> NaN Invalid_operation
-dqxor804 xor Inf 0 -> NaN Invalid_operation
-dqxor805 xor Inf 1 -> NaN Invalid_operation
-dqxor806 xor Inf 1000 -> NaN Invalid_operation
-dqxor807 xor Inf Inf -> NaN Invalid_operation
-dqxor808 xor -1000 Inf -> NaN Invalid_operation
-dqxor809 xor -Inf Inf -> NaN Invalid_operation
-dqxor810 xor -1 Inf -> NaN Invalid_operation
-dqxor811 xor -0 Inf -> NaN Invalid_operation
-dqxor812 xor 0 Inf -> NaN Invalid_operation
-dqxor813 xor 1 Inf -> NaN Invalid_operation
-dqxor814 xor 1000 Inf -> NaN Invalid_operation
-dqxor815 xor Inf Inf -> NaN Invalid_operation
-
-dqxor821 xor NaN -Inf -> NaN Invalid_operation
-dqxor822 xor NaN -1000 -> NaN Invalid_operation
-dqxor823 xor NaN -1 -> NaN Invalid_operation
-dqxor824 xor NaN -0 -> NaN Invalid_operation
-dqxor825 xor NaN 0 -> NaN Invalid_operation
-dqxor826 xor NaN 1 -> NaN Invalid_operation
-dqxor827 xor NaN 1000 -> NaN Invalid_operation
-dqxor828 xor NaN Inf -> NaN Invalid_operation
-dqxor829 xor NaN NaN -> NaN Invalid_operation
-dqxor830 xor -Inf NaN -> NaN Invalid_operation
-dqxor831 xor -1000 NaN -> NaN Invalid_operation
-dqxor832 xor -1 NaN -> NaN Invalid_operation
-dqxor833 xor -0 NaN -> NaN Invalid_operation
-dqxor834 xor 0 NaN -> NaN Invalid_operation
-dqxor835 xor 1 NaN -> NaN Invalid_operation
-dqxor836 xor 1000 NaN -> NaN Invalid_operation
-dqxor837 xor Inf NaN -> NaN Invalid_operation
-
-dqxor841 xor sNaN -Inf -> NaN Invalid_operation
-dqxor842 xor sNaN -1000 -> NaN Invalid_operation
-dqxor843 xor sNaN -1 -> NaN Invalid_operation
-dqxor844 xor sNaN -0 -> NaN Invalid_operation
-dqxor845 xor sNaN 0 -> NaN Invalid_operation
-dqxor846 xor sNaN 1 -> NaN Invalid_operation
-dqxor847 xor sNaN 1000 -> NaN Invalid_operation
-dqxor848 xor sNaN NaN -> NaN Invalid_operation
-dqxor849 xor sNaN sNaN -> NaN Invalid_operation
-dqxor850 xor NaN sNaN -> NaN Invalid_operation
-dqxor851 xor -Inf sNaN -> NaN Invalid_operation
-dqxor852 xor -1000 sNaN -> NaN Invalid_operation
-dqxor853 xor -1 sNaN -> NaN Invalid_operation
-dqxor854 xor -0 sNaN -> NaN Invalid_operation
-dqxor855 xor 0 sNaN -> NaN Invalid_operation
-dqxor856 xor 1 sNaN -> NaN Invalid_operation
-dqxor857 xor 1000 sNaN -> NaN Invalid_operation
-dqxor858 xor Inf sNaN -> NaN Invalid_operation
-dqxor859 xor NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqxor861 xor NaN1 -Inf -> NaN Invalid_operation
-dqxor862 xor +NaN2 -1000 -> NaN Invalid_operation
-dqxor863 xor NaN3 1000 -> NaN Invalid_operation
-dqxor864 xor NaN4 Inf -> NaN Invalid_operation
-dqxor865 xor NaN5 +NaN6 -> NaN Invalid_operation
-dqxor866 xor -Inf NaN7 -> NaN Invalid_operation
-dqxor867 xor -1000 NaN8 -> NaN Invalid_operation
-dqxor868 xor 1000 NaN9 -> NaN Invalid_operation
-dqxor869 xor Inf +NaN10 -> NaN Invalid_operation
-dqxor871 xor sNaN11 -Inf -> NaN Invalid_operation
-dqxor872 xor sNaN12 -1000 -> NaN Invalid_operation
-dqxor873 xor sNaN13 1000 -> NaN Invalid_operation
-dqxor874 xor sNaN14 NaN17 -> NaN Invalid_operation
-dqxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation
-dqxor876 xor NaN16 sNaN19 -> NaN Invalid_operation
-dqxor877 xor -Inf +sNaN20 -> NaN Invalid_operation
-dqxor878 xor -1000 sNaN21 -> NaN Invalid_operation
-dqxor879 xor 1000 sNaN22 -> NaN Invalid_operation
-dqxor880 xor Inf sNaN23 -> NaN Invalid_operation
-dqxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
-dqxor882 xor -NaN26 NaN28 -> NaN Invalid_operation
-dqxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
-dqxor884 xor 1000 -NaN30 -> NaN Invalid_operation
-dqxor885 xor 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqXor.decTest -- digitwise logical XOR for decQuads --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check (truth table)
+dqxor001 xor 0 0 -> 0
+dqxor002 xor 0 1 -> 1
+dqxor003 xor 1 0 -> 1
+dqxor004 xor 1 1 -> 0
+dqxor005 xor 1100 1010 -> 110
+-- and at msd and msd-1
+dqxor006 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqxor007 xor 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqxor008 xor 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqxor009 xor 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 0
+dqxor010 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqxor011 xor 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
+dqxor012 xor 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000
+dqxor013 xor 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 0
+
+-- Various lengths
+-- 1234567890123456789012345678901234
+dqxor601 xor 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000000
+dqxor602 xor 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000000
+dqxor603 xor 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000000
+dqxor604 xor 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000
+dqxor605 xor 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000
+dqxor606 xor 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000
+dqxor607 xor 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000
+dqxor608 xor 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000
+dqxor609 xor 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000
+dqxor610 xor 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000
+dqxor611 xor 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000
+dqxor612 xor 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000
+dqxor613 xor 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000
+dqxor614 xor 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000
+dqxor615 xor 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000
+dqxor616 xor 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000
+dqxor617 xor 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 100000000000000000
+dqxor618 xor 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 10000000000000000
+dqxor619 xor 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1000000000000000
+dqxor620 xor 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 100000000000000
+dqxor621 xor 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 10000000000000
+dqxor622 xor 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1000000000000
+dqxor623 xor 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 100000000000
+dqxor624 xor 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 10000000000
+dqxor625 xor 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1000000000
+dqxor626 xor 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 100000000
+dqxor627 xor 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 10000000
+dqxor628 xor 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1000000
+dqxor629 xor 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 100000
+dqxor630 xor 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 10000
+dqxor631 xor 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1000
+dqxor632 xor 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 100
+dqxor633 xor 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 10
+dqxor634 xor 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1
+
+dqxor641 xor 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
+dqxor642 xor 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 100000000000000000000000000000000
+dqxor643 xor 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 10000000000000000000000000000000
+dqxor644 xor 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1000000000000000000000000000000
+dqxor645 xor 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 100000000000000000000000000000
+dqxor646 xor 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 10000000000000000000000000000
+dqxor647 xor 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1000000000000000000000000000
+dqxor648 xor 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 100000000000000000000000000
+dqxor649 xor 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 10000000000000000000000000
+dqxor650 xor 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1000000000000000000000000
+dqxor651 xor 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 100000000000000000000000
+dqxor652 xor 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 10000000000000000000000
+dqxor653 xor 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1000000000000000000000
+dqxor654 xor 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 100000000000000000000
+dqxor655 xor 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 10000000000000000000
+dqxor656 xor 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1000000000000000000
+dqxor657 xor 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 100000000000000000
+dqxor658 xor 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 10000000000000000
+dqxor659 xor 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1000000000000000
+dqxor660 xor 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 100000000000000
+dqxor661 xor 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 10000000000000
+dqxor662 xor 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1000000000000
+dqxor663 xor 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 100000000000
+dqxor664 xor 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 10000000000
+dqxor665 xor 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1000000000
+dqxor666 xor 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 100000000
+dqxor667 xor 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 10000000
+dqxor668 xor 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1000000
+dqxor669 xor 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 100000
+dqxor670 xor 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 10000
+dqxor671 xor 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1000
+dqxor672 xor 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 100
+dqxor673 xor 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 10
+dqxor674 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1
+dqxor675 xor 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1000000000000000000000000000000001
+dqxor676 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1
+
+
+dqxor021 xor 1111111110000000 1111111110000000 -> 0
+dqxor022 xor 111111110000000 111111110000000 -> 0
+dqxor023 xor 11111110000000 11111110000000 -> 0
+dqxor024 xor 1111110000000 1111110000000 -> 0
+dqxor025 xor 111110000000 111110000000 -> 0
+dqxor026 xor 11110000000 11110000000 -> 0
+dqxor027 xor 1110000000 1110000000 -> 0
+dqxor028 xor 110000000 110000000 -> 0
+dqxor029 xor 10000000 10000000 -> 0
+dqxor030 xor 1000000 1000000 -> 0
+dqxor031 xor 100000 100000 -> 0
+dqxor032 xor 10000 10000 -> 0
+dqxor033 xor 1000 1000 -> 0
+dqxor034 xor 100 100 -> 0
+dqxor035 xor 10 10 -> 0
+dqxor036 xor 1 1 -> 0
+
+dqxor040 xor 111111111 111111111111 -> 111000000000
+dqxor041 xor 11111111 111111111111 -> 111100000000
+dqxor042 xor 11111111 111111111 -> 100000000
+dqxor043 xor 1111111 100000010 -> 101111101
+dqxor044 xor 111111 100000100 -> 100111011
+dqxor045 xor 11111 100001000 -> 100010111
+dqxor046 xor 1111 100010000 -> 100011111
+dqxor047 xor 111 100100000 -> 100100111
+dqxor048 xor 11 101000000 -> 101000011
+dqxor049 xor 1 110000000 -> 110000001
+
+dqxor050 xor 1111111111 1 -> 1111111110
+dqxor051 xor 111111111 1 -> 111111110
+dqxor052 xor 11111111 1 -> 11111110
+dqxor053 xor 1111111 1 -> 1111110
+dqxor054 xor 111111 1 -> 111110
+dqxor055 xor 11111 1 -> 11110
+dqxor056 xor 1111 1 -> 1110
+dqxor057 xor 111 1 -> 110
+dqxor058 xor 11 1 -> 10
+dqxor059 xor 1 1 -> 0
+
+dqxor060 xor 1111111111 0 -> 1111111111
+dqxor061 xor 111111111 0 -> 111111111
+dqxor062 xor 11111111 0 -> 11111111
+dqxor063 xor 1111111 0 -> 1111111
+dqxor064 xor 111111 0 -> 111111
+dqxor065 xor 11111 0 -> 11111
+dqxor066 xor 1111 0 -> 1111
+dqxor067 xor 111 0 -> 111
+dqxor068 xor 11 0 -> 11
+dqxor069 xor 1 0 -> 1
+
+dqxor070 xor 1 1111111111 -> 1111111110
+dqxor071 xor 1 111111111 -> 111111110
+dqxor072 xor 1 11111111 -> 11111110
+dqxor073 xor 1 1111111 -> 1111110
+dqxor074 xor 1 111111 -> 111110
+dqxor075 xor 1 11111 -> 11110
+dqxor076 xor 1 1111 -> 1110
+dqxor077 xor 1 111 -> 110
+dqxor078 xor 1 11 -> 10
+dqxor079 xor 1 1 -> 0
+
+dqxor080 xor 0 1111111111 -> 1111111111
+dqxor081 xor 0 111111111 -> 111111111
+dqxor082 xor 0 11111111 -> 11111111
+dqxor083 xor 0 1111111 -> 1111111
+dqxor084 xor 0 111111 -> 111111
+dqxor085 xor 0 11111 -> 11111
+dqxor086 xor 0 1111 -> 1111
+dqxor087 xor 0 111 -> 111
+dqxor088 xor 0 11 -> 11
+dqxor089 xor 0 1 -> 1
+
+dqxor090 xor 011111111 111101111 -> 100010000
+dqxor091 xor 101111111 111101111 -> 10010000
+dqxor092 xor 110111111 111101111 -> 1010000
+dqxor093 xor 111011111 111101111 -> 110000
+dqxor094 xor 111101111 111101111 -> 0
+dqxor095 xor 111110111 111101111 -> 11000
+dqxor096 xor 111111011 111101111 -> 10100
+dqxor097 xor 111111101 111101111 -> 10010
+dqxor098 xor 111111110 111101111 -> 10001
+
+dqxor100 xor 111101111 011111111 -> 100010000
+dqxor101 xor 111101111 101111111 -> 10010000
+dqxor102 xor 111101111 110111111 -> 1010000
+dqxor103 xor 111101111 111011111 -> 110000
+dqxor104 xor 111101111 111101111 -> 0
+dqxor105 xor 111101111 111110111 -> 11000
+dqxor106 xor 111101111 111111011 -> 10100
+dqxor107 xor 111101111 111111101 -> 10010
+dqxor108 xor 111101111 111111110 -> 10001
+
+-- non-0/1 should not be accepted, nor should signs
+dqxor220 xor 111111112 111111111 -> NaN Invalid_operation
+dqxor221 xor 333333333 333333333 -> NaN Invalid_operation
+dqxor222 xor 555555555 555555555 -> NaN Invalid_operation
+dqxor223 xor 777777777 777777777 -> NaN Invalid_operation
+dqxor224 xor 999999999 999999999 -> NaN Invalid_operation
+dqxor225 xor 222222222 999999999 -> NaN Invalid_operation
+dqxor226 xor 444444444 999999999 -> NaN Invalid_operation
+dqxor227 xor 666666666 999999999 -> NaN Invalid_operation
+dqxor228 xor 888888888 999999999 -> NaN Invalid_operation
+dqxor229 xor 999999999 222222222 -> NaN Invalid_operation
+dqxor230 xor 999999999 444444444 -> NaN Invalid_operation
+dqxor231 xor 999999999 666666666 -> NaN Invalid_operation
+dqxor232 xor 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+dqxor240 xor 567468689 -934981942 -> NaN Invalid_operation
+dqxor241 xor 567367689 934981942 -> NaN Invalid_operation
+dqxor242 xor -631917772 -706014634 -> NaN Invalid_operation
+dqxor243 xor -756253257 138579234 -> NaN Invalid_operation
+dqxor244 xor 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+dqxor250 xor 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor251 xor 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor252 xor 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor253 xor 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor254 xor 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor255 xor 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor256 xor 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor257 xor 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor258 xor 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor259 xor 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor260 xor 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor261 xor 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor262 xor 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor263 xor 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor264 xor 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor265 xor 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+-- test MSD-1
+dqxor270 xor 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
+dqxor271 xor 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
+dqxor272 xor 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
+dqxor273 xor 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
+dqxor274 xor 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
+dqxor275 xor 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
+dqxor276 xor 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
+dqxor277 xor 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
+-- test LSD
+dqxor280 xor 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
+dqxor281 xor 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
+dqxor282 xor 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
+dqxor283 xor 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
+dqxor284 xor 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
+dqxor285 xor 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
+dqxor286 xor 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
+dqxor287 xor 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
+-- test Middie
+dqxor288 xor 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
+dqxor289 xor 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
+dqxor290 xor 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
+dqxor291 xor 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
+dqxor292 xor 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
+dqxor293 xor 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
+dqxor294 xor 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
+dqxor295 xor 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
+-- signs
+dqxor296 xor -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
+dqxor297 xor -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
+dqxor298 xor 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
+dqxor299 xor 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001001001001001001000010000100
+
+-- Nmax, Nmin, Ntiny-like
+dqxor331 xor 2 9.99999999E+999 -> NaN Invalid_operation
+dqxor332 xor 3 1E-999 -> NaN Invalid_operation
+dqxor333 xor 4 1.00000000E-2821 -> NaN Invalid_operation
+dqxor334 xor 5 1E-900 -> NaN Invalid_operation
+dqxor335 xor 6 -1E-900 -> NaN Invalid_operation
+dqxor336 xor 7 -1.00000000E-999 -> NaN Invalid_operation
+dqxor337 xor 8 -1E-999 -> NaN Invalid_operation
+dqxor338 xor 9 -9.99999999E+999 -> NaN Invalid_operation
+dqxor341 xor 9.99999999E+999 -18 -> NaN Invalid_operation
+dqxor342 xor 1E-999 01 -> NaN Invalid_operation
+dqxor343 xor 1.00000000E-999 -18 -> NaN Invalid_operation
+dqxor344 xor 1E-908 18 -> NaN Invalid_operation
+dqxor345 xor -1E-907 -10 -> NaN Invalid_operation
+dqxor346 xor -1.00000000E-999 18 -> NaN Invalid_operation
+dqxor347 xor -1E-999 10 -> NaN Invalid_operation
+dqxor348 xor -9.99999999E+2991 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+dqxor361 xor 1.0 1 -> NaN Invalid_operation
+dqxor362 xor 1E+1 1 -> NaN Invalid_operation
+dqxor363 xor 0.0 1 -> NaN Invalid_operation
+dqxor364 xor 0E+1 1 -> NaN Invalid_operation
+dqxor365 xor 9.9 1 -> NaN Invalid_operation
+dqxor366 xor 9E+1 1 -> NaN Invalid_operation
+dqxor371 xor 0 1.0 -> NaN Invalid_operation
+dqxor372 xor 0 1E+1 -> NaN Invalid_operation
+dqxor373 xor 0 0.0 -> NaN Invalid_operation
+dqxor374 xor 0 0E+1 -> NaN Invalid_operation
+dqxor375 xor 0 9.9 -> NaN Invalid_operation
+dqxor376 xor 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+dqxor780 xor -Inf -Inf -> NaN Invalid_operation
+dqxor781 xor -Inf -1000 -> NaN Invalid_operation
+dqxor782 xor -Inf -1 -> NaN Invalid_operation
+dqxor783 xor -Inf -0 -> NaN Invalid_operation
+dqxor784 xor -Inf 0 -> NaN Invalid_operation
+dqxor785 xor -Inf 1 -> NaN Invalid_operation
+dqxor786 xor -Inf 1000 -> NaN Invalid_operation
+dqxor787 xor -1000 -Inf -> NaN Invalid_operation
+dqxor788 xor -Inf -Inf -> NaN Invalid_operation
+dqxor789 xor -1 -Inf -> NaN Invalid_operation
+dqxor790 xor -0 -Inf -> NaN Invalid_operation
+dqxor791 xor 0 -Inf -> NaN Invalid_operation
+dqxor792 xor 1 -Inf -> NaN Invalid_operation
+dqxor793 xor 1000 -Inf -> NaN Invalid_operation
+dqxor794 xor Inf -Inf -> NaN Invalid_operation
+
+dqxor800 xor Inf -Inf -> NaN Invalid_operation
+dqxor801 xor Inf -1000 -> NaN Invalid_operation
+dqxor802 xor Inf -1 -> NaN Invalid_operation
+dqxor803 xor Inf -0 -> NaN Invalid_operation
+dqxor804 xor Inf 0 -> NaN Invalid_operation
+dqxor805 xor Inf 1 -> NaN Invalid_operation
+dqxor806 xor Inf 1000 -> NaN Invalid_operation
+dqxor807 xor Inf Inf -> NaN Invalid_operation
+dqxor808 xor -1000 Inf -> NaN Invalid_operation
+dqxor809 xor -Inf Inf -> NaN Invalid_operation
+dqxor810 xor -1 Inf -> NaN Invalid_operation
+dqxor811 xor -0 Inf -> NaN Invalid_operation
+dqxor812 xor 0 Inf -> NaN Invalid_operation
+dqxor813 xor 1 Inf -> NaN Invalid_operation
+dqxor814 xor 1000 Inf -> NaN Invalid_operation
+dqxor815 xor Inf Inf -> NaN Invalid_operation
+
+dqxor821 xor NaN -Inf -> NaN Invalid_operation
+dqxor822 xor NaN -1000 -> NaN Invalid_operation
+dqxor823 xor NaN -1 -> NaN Invalid_operation
+dqxor824 xor NaN -0 -> NaN Invalid_operation
+dqxor825 xor NaN 0 -> NaN Invalid_operation
+dqxor826 xor NaN 1 -> NaN Invalid_operation
+dqxor827 xor NaN 1000 -> NaN Invalid_operation
+dqxor828 xor NaN Inf -> NaN Invalid_operation
+dqxor829 xor NaN NaN -> NaN Invalid_operation
+dqxor830 xor -Inf NaN -> NaN Invalid_operation
+dqxor831 xor -1000 NaN -> NaN Invalid_operation
+dqxor832 xor -1 NaN -> NaN Invalid_operation
+dqxor833 xor -0 NaN -> NaN Invalid_operation
+dqxor834 xor 0 NaN -> NaN Invalid_operation
+dqxor835 xor 1 NaN -> NaN Invalid_operation
+dqxor836 xor 1000 NaN -> NaN Invalid_operation
+dqxor837 xor Inf NaN -> NaN Invalid_operation
+
+dqxor841 xor sNaN -Inf -> NaN Invalid_operation
+dqxor842 xor sNaN -1000 -> NaN Invalid_operation
+dqxor843 xor sNaN -1 -> NaN Invalid_operation
+dqxor844 xor sNaN -0 -> NaN Invalid_operation
+dqxor845 xor sNaN 0 -> NaN Invalid_operation
+dqxor846 xor sNaN 1 -> NaN Invalid_operation
+dqxor847 xor sNaN 1000 -> NaN Invalid_operation
+dqxor848 xor sNaN NaN -> NaN Invalid_operation
+dqxor849 xor sNaN sNaN -> NaN Invalid_operation
+dqxor850 xor NaN sNaN -> NaN Invalid_operation
+dqxor851 xor -Inf sNaN -> NaN Invalid_operation
+dqxor852 xor -1000 sNaN -> NaN Invalid_operation
+dqxor853 xor -1 sNaN -> NaN Invalid_operation
+dqxor854 xor -0 sNaN -> NaN Invalid_operation
+dqxor855 xor 0 sNaN -> NaN Invalid_operation
+dqxor856 xor 1 sNaN -> NaN Invalid_operation
+dqxor857 xor 1000 sNaN -> NaN Invalid_operation
+dqxor858 xor Inf sNaN -> NaN Invalid_operation
+dqxor859 xor NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqxor861 xor NaN1 -Inf -> NaN Invalid_operation
+dqxor862 xor +NaN2 -1000 -> NaN Invalid_operation
+dqxor863 xor NaN3 1000 -> NaN Invalid_operation
+dqxor864 xor NaN4 Inf -> NaN Invalid_operation
+dqxor865 xor NaN5 +NaN6 -> NaN Invalid_operation
+dqxor866 xor -Inf NaN7 -> NaN Invalid_operation
+dqxor867 xor -1000 NaN8 -> NaN Invalid_operation
+dqxor868 xor 1000 NaN9 -> NaN Invalid_operation
+dqxor869 xor Inf +NaN10 -> NaN Invalid_operation
+dqxor871 xor sNaN11 -Inf -> NaN Invalid_operation
+dqxor872 xor sNaN12 -1000 -> NaN Invalid_operation
+dqxor873 xor sNaN13 1000 -> NaN Invalid_operation
+dqxor874 xor sNaN14 NaN17 -> NaN Invalid_operation
+dqxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation
+dqxor876 xor NaN16 sNaN19 -> NaN Invalid_operation
+dqxor877 xor -Inf +sNaN20 -> NaN Invalid_operation
+dqxor878 xor -1000 sNaN21 -> NaN Invalid_operation
+dqxor879 xor 1000 sNaN22 -> NaN Invalid_operation
+dqxor880 xor Inf sNaN23 -> NaN Invalid_operation
+dqxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
+dqxor882 xor -NaN26 NaN28 -> NaN Invalid_operation
+dqxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
+dqxor884 xor 1000 -NaN30 -> NaN Invalid_operation
+dqxor885 xor 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dsBase.decTest b/Lib/test/decimaltestdata/dsBase.decTest
index 5e5e5a5d91..8ac45fc552 100644
--- a/Lib/test/decimaltestdata/dsBase.decTest
+++ b/Lib/test/decimaltestdata/dsBase.decTest
@@ -1,1062 +1,1062 @@
-------------------------------------------------------------------------
--- dsBase.decTest -- base decSingle <--> string conversions --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests base conversions from string to a decimal number
--- and back to a string (in Scientific form)
-
--- Note that unlike other operations the operand is subject to rounding
--- to conform to emax and precision settings (that is, numbers will
--- conform to rules and exponent will be in permitted range). The
--- 'left hand side', therefore, may have numbers that cannot be
--- represented in a decSingle. Some testcases go to the limit of the
--- next-wider format, and hence these testcases may also be used to
--- test narrowing and widening operations.
-
-extended: 1
-clamp: 1
-precision: 7
-maxExponent: 96
-minExponent: -95
-rounding: half_even
-
-dsbas001 toSci 0 -> 0
-dsbas002 toSci 1 -> 1
-dsbas003 toSci 1.0 -> 1.0
-dsbas004 toSci 1.00 -> 1.00
-dsbas005 toSci 10 -> 10
-dsbas006 toSci 1000 -> 1000
-dsbas007 toSci 10.0 -> 10.0
-dsbas008 toSci 10.1 -> 10.1
-dsbas009 toSci 10.4 -> 10.4
-dsbas010 toSci 10.5 -> 10.5
-dsbas011 toSci 10.6 -> 10.6
-dsbas012 toSci 10.9 -> 10.9
-dsbas013 toSci 11.0 -> 11.0
-dsbas014 toSci 1.234 -> 1.234
-dsbas015 toSci 0.123 -> 0.123
-dsbas016 toSci 0.012 -> 0.012
-dsbas017 toSci -0 -> -0
-dsbas018 toSci -0.0 -> -0.0
-dsbas019 toSci -00.00 -> -0.00
-
-dsbas021 toSci -1 -> -1
-dsbas022 toSci -1.0 -> -1.0
-dsbas023 toSci -0.1 -> -0.1
-dsbas024 toSci -9.1 -> -9.1
-dsbas025 toSci -9.11 -> -9.11
-dsbas026 toSci -9.119 -> -9.119
-dsbas027 toSci -9.999 -> -9.999
-
-dsbas030 toSci '1234.567' -> '1234.567'
-dsbas031 toSci '1234.000' -> '1234.000'
-dsbas032 toSci '1234912' -> '1234912'
-dsbas033 toSci '0.00001234567' -> '0.00001234567'
-dsbas034 toSci '0.000001234567' -> '0.000001234567'
-dsbas035 toSci '0.0000001234567' -> '1.234567E-7'
-dsbas036 toSci '0.00000001234567' -> '1.234567E-8'
-
-dsbas037 toSci '0.1234564' -> '0.1234564'
-dsbas038 toSci '0.1234565' -> '0.1234565'
-
--- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
-dsbsn001 toSci -9.999999E+96 -> -9.999999E+96
-dsbsn002 toSci -1E-95 -> -1E-95
-dsbsn003 toSci -1E-101 -> -1E-101 Subnormal
-dsbsn004 toSci -0 -> -0
-dsbsn005 toSci +0 -> 0
-dsbsn006 toSci +1E-101 -> 1E-101 Subnormal
-dsbsn007 toSci +1E-95 -> 1E-95
-dsbsn008 toSci +9.999999E+96 -> 9.999999E+96
-
--- String [many more examples are implicitly tested elsewhere]
--- strings without E cannot generate E in result
-dsbas040 toSci "12" -> '12'
-dsbas041 toSci "-76" -> '-76'
-dsbas042 toSci "12.76" -> '12.76'
-dsbas043 toSci "+12.76" -> '12.76'
-dsbas044 toSci "012.76" -> '12.76'
-dsbas045 toSci "+0.003" -> '0.003'
-dsbas046 toSci "17." -> '17'
-dsbas047 toSci ".5" -> '0.5'
-dsbas048 toSci "044" -> '44'
-dsbas049 toSci "0044" -> '44'
-dsbas050 toSci "0.0005" -> '0.0005'
-dsbas051 toSci "00.00005" -> '0.00005'
-dsbas052 toSci "0.000005" -> '0.000005'
-dsbas053 toSci "0.0000050" -> '0.0000050'
-dsbas054 toSci "0.0000005" -> '5E-7'
-dsbas055 toSci "0.00000005" -> '5E-8'
-dsbas056 toSci "12678.54" -> '12678.54'
-dsbas057 toSci "2678.543" -> '2678.543'
-dsbas058 toSci "345678.5" -> '345678.5'
-dsbas059 toSci "0678.5432" -> '678.5432'
-dsbas060 toSci "678.5432" -> '678.5432'
-dsbas061 toSci "+678.5432" -> '678.5432'
-dsbas062 toSci "+0678.5432" -> '678.5432'
-dsbas063 toSci "+00678.5432" -> '678.5432'
-dsbas064 toSci "-678.5432" -> '-678.5432'
-dsbas065 toSci "-0678.5432" -> '-678.5432'
-dsbas066 toSci "-00678.5432" -> '-678.5432'
--- examples
-dsbas067 toSci "5E-6" -> '0.000005'
-dsbas068 toSci "50E-7" -> '0.0000050'
-dsbas069 toSci "5E-7" -> '5E-7'
-
--- [No exotics as no Unicode]
-
--- rounded with dots in all (including edge) places
-dsbas071 toSci .1234567890123456 -> 0.1234568 Inexact Rounded
-dsbas072 toSci 1.234567890123456 -> 1.234568 Inexact Rounded
-dsbas073 toSci 12.34567890123456 -> 12.34568 Inexact Rounded
-dsbas074 toSci 123.4567890123456 -> 123.4568 Inexact Rounded
-dsbas075 toSci 1234.567890123456 -> 1234.568 Inexact Rounded
-dsbas076 toSci 12345.67890123456 -> 12345.68 Inexact Rounded
-dsbas077 toSci 123456.7890123456 -> 123456.8 Inexact Rounded
-dsbas078 toSci 1234567.890123456 -> 1234568 Inexact Rounded
-dsbas079 toSci 12345678.90123456 -> 1.234568E+7 Inexact Rounded
-dsbas080 toSci 123456789.0123456 -> 1.234568E+8 Inexact Rounded
-dsbas081 toSci 1234567890.123456 -> 1.234568E+9 Inexact Rounded
-dsbas082 toSci 12345678901.23456 -> 1.234568E+10 Inexact Rounded
-dsbas083 toSci 123456789012.3456 -> 1.234568E+11 Inexact Rounded
-dsbas084 toSci 1234567890123.456 -> 1.234568E+12 Inexact Rounded
-dsbas085 toSci 12345678901234.56 -> 1.234568E+13 Inexact Rounded
-dsbas086 toSci 123456789012345.6 -> 1.234568E+14 Inexact Rounded
-dsbas087 toSci 1234567890123456. -> 1.234568E+15 Inexact Rounded
-dsbas088 toSci 1234567890123456 -> 1.234568E+15 Inexact Rounded
-
--- Numbers with E
-dsbas130 toSci "0.000E-1" -> '0.0000'
-dsbas131 toSci "0.000E-2" -> '0.00000'
-dsbas132 toSci "0.000E-3" -> '0.000000'
-dsbas133 toSci "0.000E-4" -> '0E-7'
-dsbas134 toSci "0.00E-2" -> '0.0000'
-dsbas135 toSci "0.00E-3" -> '0.00000'
-dsbas136 toSci "0.00E-4" -> '0.000000'
-dsbas137 toSci "0.00E-5" -> '0E-7'
-dsbas138 toSci "+0E+9" -> '0E+9'
-dsbas139 toSci "-0E+9" -> '-0E+9'
-dsbas140 toSci "1E+9" -> '1E+9'
-dsbas141 toSci "1e+09" -> '1E+9'
-dsbas142 toSci "1E+90" -> '1E+90'
-dsbas143 toSci "+1E+009" -> '1E+9'
-dsbas144 toSci "0E+9" -> '0E+9'
-dsbas145 toSci "1E+9" -> '1E+9'
-dsbas146 toSci "1E+09" -> '1E+9'
-dsbas147 toSci "1e+90" -> '1E+90'
-dsbas148 toSci "1E+009" -> '1E+9'
-dsbas149 toSci "000E+9" -> '0E+9'
-dsbas150 toSci "1E9" -> '1E+9'
-dsbas151 toSci "1e09" -> '1E+9'
-dsbas152 toSci "1E90" -> '1E+90'
-dsbas153 toSci "1E009" -> '1E+9'
-dsbas154 toSci "0E9" -> '0E+9'
-dsbas155 toSci "0.000e+0" -> '0.000'
-dsbas156 toSci "0.000E-1" -> '0.0000'
-dsbas157 toSci "4E+9" -> '4E+9'
-dsbas158 toSci "44E+9" -> '4.4E+10'
-dsbas159 toSci "0.73e-7" -> '7.3E-8'
-dsbas160 toSci "00E+9" -> '0E+9'
-dsbas161 toSci "00E-9" -> '0E-9'
-dsbas162 toSci "10E+9" -> '1.0E+10'
-dsbas163 toSci "10E+09" -> '1.0E+10'
-dsbas164 toSci "10e+90" -> '1.0E+91'
-dsbas165 toSci "10E+009" -> '1.0E+10'
-dsbas166 toSci "100e+9" -> '1.00E+11'
-dsbas167 toSci "100e+09" -> '1.00E+11'
-dsbas168 toSci "100E+90" -> '1.00E+92'
-dsbas169 toSci "100e+009" -> '1.00E+11'
-
-dsbas170 toSci "1.265" -> '1.265'
-dsbas171 toSci "1.265E-20" -> '1.265E-20'
-dsbas172 toSci "1.265E-8" -> '1.265E-8'
-dsbas173 toSci "1.265E-4" -> '0.0001265'
-dsbas174 toSci "1.265E-3" -> '0.001265'
-dsbas175 toSci "1.265E-2" -> '0.01265'
-dsbas176 toSci "1.265E-1" -> '0.1265'
-dsbas177 toSci "1.265E-0" -> '1.265'
-dsbas178 toSci "1.265E+1" -> '12.65'
-dsbas179 toSci "1.265E+2" -> '126.5'
-dsbas180 toSci "1.265E+3" -> '1265'
-dsbas181 toSci "1.265E+4" -> '1.265E+4'
-dsbas182 toSci "1.265E+8" -> '1.265E+8'
-dsbas183 toSci "1.265E+20" -> '1.265E+20'
-
-dsbas190 toSci "12.65" -> '12.65'
-dsbas191 toSci "12.65E-20" -> '1.265E-19'
-dsbas192 toSci "12.65E-8" -> '1.265E-7'
-dsbas193 toSci "12.65E-4" -> '0.001265'
-dsbas194 toSci "12.65E-3" -> '0.01265'
-dsbas195 toSci "12.65E-2" -> '0.1265'
-dsbas196 toSci "12.65E-1" -> '1.265'
-dsbas197 toSci "12.65E-0" -> '12.65'
-dsbas198 toSci "12.65E+1" -> '126.5'
-dsbas199 toSci "12.65E+2" -> '1265'
-dsbas200 toSci "12.65E+3" -> '1.265E+4'
-dsbas201 toSci "12.65E+4" -> '1.265E+5'
-dsbas202 toSci "12.65E+8" -> '1.265E+9'
-dsbas203 toSci "12.65E+20" -> '1.265E+21'
-
-dsbas210 toSci "126.5" -> '126.5'
-dsbas211 toSci "126.5E-20" -> '1.265E-18'
-dsbas212 toSci "126.5E-8" -> '0.000001265'
-dsbas213 toSci "126.5E-4" -> '0.01265'
-dsbas214 toSci "126.5E-3" -> '0.1265'
-dsbas215 toSci "126.5E-2" -> '1.265'
-dsbas216 toSci "126.5E-1" -> '12.65'
-dsbas217 toSci "126.5E-0" -> '126.5'
-dsbas218 toSci "126.5E+1" -> '1265'
-dsbas219 toSci "126.5E+2" -> '1.265E+4'
-dsbas220 toSci "126.5E+3" -> '1.265E+5'
-dsbas221 toSci "126.5E+4" -> '1.265E+6'
-dsbas222 toSci "126.5E+8" -> '1.265E+10'
-dsbas223 toSci "126.5E+20" -> '1.265E+22'
-
-dsbas230 toSci "1265" -> '1265'
-dsbas231 toSci "1265E-20" -> '1.265E-17'
-dsbas232 toSci "1265E-8" -> '0.00001265'
-dsbas233 toSci "1265E-4" -> '0.1265'
-dsbas234 toSci "1265E-3" -> '1.265'
-dsbas235 toSci "1265E-2" -> '12.65'
-dsbas236 toSci "1265E-1" -> '126.5'
-dsbas237 toSci "1265E-0" -> '1265'
-dsbas238 toSci "1265E+1" -> '1.265E+4'
-dsbas239 toSci "1265E+2" -> '1.265E+5'
-dsbas240 toSci "1265E+3" -> '1.265E+6'
-dsbas241 toSci "1265E+4" -> '1.265E+7'
-dsbas242 toSci "1265E+8" -> '1.265E+11'
-dsbas243 toSci "1265E+20" -> '1.265E+23'
-
-dsbas250 toSci "0.1265" -> '0.1265'
-dsbas251 toSci "0.1265E-20" -> '1.265E-21'
-dsbas252 toSci "0.1265E-8" -> '1.265E-9'
-dsbas253 toSci "0.1265E-4" -> '0.00001265'
-dsbas254 toSci "0.1265E-3" -> '0.0001265'
-dsbas255 toSci "0.1265E-2" -> '0.001265'
-dsbas256 toSci "0.1265E-1" -> '0.01265'
-dsbas257 toSci "0.1265E-0" -> '0.1265'
-dsbas258 toSci "0.1265E+1" -> '1.265'
-dsbas259 toSci "0.1265E+2" -> '12.65'
-dsbas260 toSci "0.1265E+3" -> '126.5'
-dsbas261 toSci "0.1265E+4" -> '1265'
-dsbas262 toSci "0.1265E+8" -> '1.265E+7'
-dsbas263 toSci "0.1265E+20" -> '1.265E+19'
-
--- some more negative zeros [systematic tests below]
-dsbas290 toSci "-0.000E-1" -> '-0.0000'
-dsbas291 toSci "-0.000E-2" -> '-0.00000'
-dsbas292 toSci "-0.000E-3" -> '-0.000000'
-dsbas293 toSci "-0.000E-4" -> '-0E-7'
-dsbas294 toSci "-0.00E-2" -> '-0.0000'
-dsbas295 toSci "-0.00E-3" -> '-0.00000'
-dsbas296 toSci "-0.0E-2" -> '-0.000'
-dsbas297 toSci "-0.0E-3" -> '-0.0000'
-dsbas298 toSci "-0E-2" -> '-0.00'
-dsbas299 toSci "-0E-3" -> '-0.000'
-
--- Engineering notation tests
-dsbas301 toSci 10e12 -> 1.0E+13
-dsbas302 toEng 10e12 -> 10E+12
-dsbas303 toSci 10e11 -> 1.0E+12
-dsbas304 toEng 10e11 -> 1.0E+12
-dsbas305 toSci 10e10 -> 1.0E+11
-dsbas306 toEng 10e10 -> 100E+9
-dsbas307 toSci 10e9 -> 1.0E+10
-dsbas308 toEng 10e9 -> 10E+9
-dsbas309 toSci 10e8 -> 1.0E+9
-dsbas310 toEng 10e8 -> 1.0E+9
-dsbas311 toSci 10e7 -> 1.0E+8
-dsbas312 toEng 10e7 -> 100E+6
-dsbas313 toSci 10e6 -> 1.0E+7
-dsbas314 toEng 10e6 -> 10E+6
-dsbas315 toSci 10e5 -> 1.0E+6
-dsbas316 toEng 10e5 -> 1.0E+6
-dsbas317 toSci 10e4 -> 1.0E+5
-dsbas318 toEng 10e4 -> 100E+3
-dsbas319 toSci 10e3 -> 1.0E+4
-dsbas320 toEng 10e3 -> 10E+3
-dsbas321 toSci 10e2 -> 1.0E+3
-dsbas322 toEng 10e2 -> 1.0E+3
-dsbas323 toSci 10e1 -> 1.0E+2
-dsbas324 toEng 10e1 -> 100
-dsbas325 toSci 10e0 -> 10
-dsbas326 toEng 10e0 -> 10
-dsbas327 toSci 10e-1 -> 1.0
-dsbas328 toEng 10e-1 -> 1.0
-dsbas329 toSci 10e-2 -> 0.10
-dsbas330 toEng 10e-2 -> 0.10
-dsbas331 toSci 10e-3 -> 0.010
-dsbas332 toEng 10e-3 -> 0.010
-dsbas333 toSci 10e-4 -> 0.0010
-dsbas334 toEng 10e-4 -> 0.0010
-dsbas335 toSci 10e-5 -> 0.00010
-dsbas336 toEng 10e-5 -> 0.00010
-dsbas337 toSci 10e-6 -> 0.000010
-dsbas338 toEng 10e-6 -> 0.000010
-dsbas339 toSci 10e-7 -> 0.0000010
-dsbas340 toEng 10e-7 -> 0.0000010
-dsbas341 toSci 10e-8 -> 1.0E-7
-dsbas342 toEng 10e-8 -> 100E-9
-dsbas343 toSci 10e-9 -> 1.0E-8
-dsbas344 toEng 10e-9 -> 10E-9
-dsbas345 toSci 10e-10 -> 1.0E-9
-dsbas346 toEng 10e-10 -> 1.0E-9
-dsbas347 toSci 10e-11 -> 1.0E-10
-dsbas348 toEng 10e-11 -> 100E-12
-dsbas349 toSci 10e-12 -> 1.0E-11
-dsbas350 toEng 10e-12 -> 10E-12
-dsbas351 toSci 10e-13 -> 1.0E-12
-dsbas352 toEng 10e-13 -> 1.0E-12
-
-dsbas361 toSci 7E12 -> 7E+12
-dsbas362 toEng 7E12 -> 7E+12
-dsbas363 toSci 7E11 -> 7E+11
-dsbas364 toEng 7E11 -> 700E+9
-dsbas365 toSci 7E10 -> 7E+10
-dsbas366 toEng 7E10 -> 70E+9
-dsbas367 toSci 7E9 -> 7E+9
-dsbas368 toEng 7E9 -> 7E+9
-dsbas369 toSci 7E8 -> 7E+8
-dsbas370 toEng 7E8 -> 700E+6
-dsbas371 toSci 7E7 -> 7E+7
-dsbas372 toEng 7E7 -> 70E+6
-dsbas373 toSci 7E6 -> 7E+6
-dsbas374 toEng 7E6 -> 7E+6
-dsbas375 toSci 7E5 -> 7E+5
-dsbas376 toEng 7E5 -> 700E+3
-dsbas377 toSci 7E4 -> 7E+4
-dsbas378 toEng 7E4 -> 70E+3
-dsbas379 toSci 7E3 -> 7E+3
-dsbas380 toEng 7E3 -> 7E+3
-dsbas381 toSci 7E2 -> 7E+2
-dsbas382 toEng 7E2 -> 700
-dsbas383 toSci 7E1 -> 7E+1
-dsbas384 toEng 7E1 -> 70
-dsbas385 toSci 7E0 -> 7
-dsbas386 toEng 7E0 -> 7
-dsbas387 toSci 7E-1 -> 0.7
-dsbas388 toEng 7E-1 -> 0.7
-dsbas389 toSci 7E-2 -> 0.07
-dsbas390 toEng 7E-2 -> 0.07
-dsbas391 toSci 7E-3 -> 0.007
-dsbas392 toEng 7E-3 -> 0.007
-dsbas393 toSci 7E-4 -> 0.0007
-dsbas394 toEng 7E-4 -> 0.0007
-dsbas395 toSci 7E-5 -> 0.00007
-dsbas396 toEng 7E-5 -> 0.00007
-dsbas397 toSci 7E-6 -> 0.000007
-dsbas398 toEng 7E-6 -> 0.000007
-dsbas399 toSci 7E-7 -> 7E-7
-dsbas400 toEng 7E-7 -> 700E-9
-dsbas401 toSci 7E-8 -> 7E-8
-dsbas402 toEng 7E-8 -> 70E-9
-dsbas403 toSci 7E-9 -> 7E-9
-dsbas404 toEng 7E-9 -> 7E-9
-dsbas405 toSci 7E-10 -> 7E-10
-dsbas406 toEng 7E-10 -> 700E-12
-dsbas407 toSci 7E-11 -> 7E-11
-dsbas408 toEng 7E-11 -> 70E-12
-dsbas409 toSci 7E-12 -> 7E-12
-dsbas410 toEng 7E-12 -> 7E-12
-dsbas411 toSci 7E-13 -> 7E-13
-dsbas412 toEng 7E-13 -> 700E-15
-
--- Exacts remain exact up to precision ..
-dsbas420 toSci 100 -> 100
-dsbas422 toSci 1000 -> 1000
-dsbas424 toSci 999.9 -> 999.9
-dsbas426 toSci 1000.0 -> 1000.0
-dsbas428 toSci 1000.1 -> 1000.1
-dsbas430 toSci 10000 -> 10000
-dsbas432 toSci 1000 -> 1000
-dsbas434 toSci 10000 -> 10000
-dsbas436 toSci 100000 -> 100000
-dsbas438 toSci 1000000 -> 1000000
-dsbas440 toSci 10000000 -> 1.000000E+7 Rounded
-dsbas442 toSci 10000000 -> 1.000000E+7 Rounded
-dsbas444 toSci 10000003 -> 1.000000E+7 Rounded Inexact
-dsbas446 toSci 10000005 -> 1.000000E+7 Rounded Inexact
-dsbas448 toSci 100000050 -> 1.000000E+8 Rounded Inexact
-dsbas450 toSci 10000009 -> 1.000001E+7 Rounded Inexact
-dsbas452 toSci 100000000 -> 1.000000E+8 Rounded
-dsbas454 toSci 100000003 -> 1.000000E+8 Rounded Inexact
-dsbas456 toSci 100000005 -> 1.000000E+8 Rounded Inexact
-dsbas458 toSci 100000009 -> 1.000000E+8 Rounded Inexact
-dsbas460 toSci 1000000000 -> 1.000000E+9 Rounded
-dsbas462 toSci 1000000300 -> 1.000000E+9 Rounded Inexact
-dsbas464 toSci 1000000500 -> 1.000000E+9 Rounded Inexact
-dsbas466 toSci 1000000900 -> 1.000001E+9 Rounded Inexact
-dsbas468 toSci 10000000000 -> 1.000000E+10 Rounded
-dsbas470 toSci 10000003000 -> 1.000000E+10 Rounded Inexact
-dsbas472 toSci 10000005000 -> 1.000000E+10 Rounded Inexact
-dsbas474 toSci 10000009000 -> 1.000001E+10 Rounded Inexact
-
--- check rounding modes heeded
-rounding: ceiling
-dsbsr401 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr402 toSci 1.11234549 -> 1.112346 Rounded Inexact
-dsbsr403 toSci 1.11234550 -> 1.112346 Rounded Inexact
-dsbsr404 toSci 1.11234551 -> 1.112346 Rounded Inexact
-rounding: up
-dsbsr405 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr406 toSci 1.11234549 -> 1.112346 Rounded Inexact
-dsbsr407 toSci 1.11234550 -> 1.112346 Rounded Inexact
-dsbsr408 toSci 1.11234551 -> 1.112346 Rounded Inexact
-rounding: floor
-dsbsr410 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr411 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr412 toSci 1.11234550 -> 1.112345 Rounded Inexact
-dsbsr413 toSci 1.11234551 -> 1.112345 Rounded Inexact
-rounding: half_down
-dsbsr415 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr416 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr417 toSci 1.11234550 -> 1.112345 Rounded Inexact
-dsbsr418 toSci 1.11234650 -> 1.112346 Rounded Inexact
-dsbsr419 toSci 1.11234551 -> 1.112346 Rounded Inexact
-rounding: half_even
-dsbsr421 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr422 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr423 toSci 1.11234550 -> 1.112346 Rounded Inexact
-dsbsr424 toSci 1.11234650 -> 1.112346 Rounded Inexact
-dsbsr425 toSci 1.11234551 -> 1.112346 Rounded Inexact
-rounding: down
-dsbsr426 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr427 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr428 toSci 1.11234550 -> 1.112345 Rounded Inexact
-dsbsr429 toSci 1.11234551 -> 1.112345 Rounded Inexact
-rounding: half_up
-dsbsr431 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr432 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr433 toSci 1.11234550 -> 1.112346 Rounded Inexact
-dsbsr434 toSci 1.11234650 -> 1.112347 Rounded Inexact
-dsbsr435 toSci 1.11234551 -> 1.112346 Rounded Inexact
--- negatives
-rounding: ceiling
-dsbsr501 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr502 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr503 toSci -1.11234550 -> -1.112345 Rounded Inexact
-dsbsr504 toSci -1.11234551 -> -1.112345 Rounded Inexact
-rounding: up
-dsbsr505 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr506 toSci -1.11234549 -> -1.112346 Rounded Inexact
-dsbsr507 toSci -1.11234550 -> -1.112346 Rounded Inexact
-dsbsr508 toSci -1.11234551 -> -1.112346 Rounded Inexact
-rounding: floor
-dsbsr510 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr511 toSci -1.11234549 -> -1.112346 Rounded Inexact
-dsbsr512 toSci -1.11234550 -> -1.112346 Rounded Inexact
-dsbsr513 toSci -1.11234551 -> -1.112346 Rounded Inexact
-rounding: half_down
-dsbsr515 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr516 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr517 toSci -1.11234550 -> -1.112345 Rounded Inexact
-dsbsr518 toSci -1.11234650 -> -1.112346 Rounded Inexact
-dsbsr519 toSci -1.11234551 -> -1.112346 Rounded Inexact
-rounding: half_even
-dsbsr521 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr522 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr523 toSci -1.11234550 -> -1.112346 Rounded Inexact
-dsbsr524 toSci -1.11234650 -> -1.112346 Rounded Inexact
-dsbsr525 toSci -1.11234551 -> -1.112346 Rounded Inexact
-rounding: down
-dsbsr526 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr527 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr528 toSci -1.11234550 -> -1.112345 Rounded Inexact
-dsbsr529 toSci -1.11234551 -> -1.112345 Rounded Inexact
-rounding: half_up
-dsbsr531 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr532 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr533 toSci -1.11234550 -> -1.112346 Rounded Inexact
-dsbsr534 toSci -1.11234650 -> -1.112347 Rounded Inexact
-dsbsr535 toSci -1.11234551 -> -1.112346 Rounded Inexact
-
-rounding: half_even
-
--- The 'baddies' tests from DiagBigDecimal, plus some new ones
-dsbas500 toSci '1..2' -> NaN Conversion_syntax
-dsbas501 toSci '.' -> NaN Conversion_syntax
-dsbas502 toSci '..' -> NaN Conversion_syntax
-dsbas503 toSci '++1' -> NaN Conversion_syntax
-dsbas504 toSci '--1' -> NaN Conversion_syntax
-dsbas505 toSci '-+1' -> NaN Conversion_syntax
-dsbas506 toSci '+-1' -> NaN Conversion_syntax
-dsbas507 toSci '12e' -> NaN Conversion_syntax
-dsbas508 toSci '12e++' -> NaN Conversion_syntax
-dsbas509 toSci '12f4' -> NaN Conversion_syntax
-dsbas510 toSci ' +1' -> NaN Conversion_syntax
-dsbas511 toSci '+ 1' -> NaN Conversion_syntax
-dsbas512 toSci '12 ' -> NaN Conversion_syntax
-dsbas513 toSci ' + 1' -> NaN Conversion_syntax
-dsbas514 toSci ' - 1 ' -> NaN Conversion_syntax
-dsbas515 toSci 'x' -> NaN Conversion_syntax
-dsbas516 toSci '-1-' -> NaN Conversion_syntax
-dsbas517 toSci '12-' -> NaN Conversion_syntax
-dsbas518 toSci '3+' -> NaN Conversion_syntax
-dsbas519 toSci '' -> NaN Conversion_syntax
-dsbas520 toSci '1e-' -> NaN Conversion_syntax
-dsbas521 toSci '7e99999a' -> NaN Conversion_syntax
-dsbas522 toSci '7e123567890x' -> NaN Conversion_syntax
-dsbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
-dsbas524 toSci '' -> NaN Conversion_syntax
-dsbas525 toSci 'e100' -> NaN Conversion_syntax
-dsbas526 toSci '\u0e5a' -> NaN Conversion_syntax
-dsbas527 toSci '\u0b65' -> NaN Conversion_syntax
-dsbas528 toSci '123,65' -> NaN Conversion_syntax
-dsbas529 toSci '1.34.5' -> NaN Conversion_syntax
-dsbas530 toSci '.123.5' -> NaN Conversion_syntax
-dsbas531 toSci '01.35.' -> NaN Conversion_syntax
-dsbas532 toSci '01.35-' -> NaN Conversion_syntax
-dsbas533 toSci '0000..' -> NaN Conversion_syntax
-dsbas534 toSci '.0000.' -> NaN Conversion_syntax
-dsbas535 toSci '00..00' -> NaN Conversion_syntax
-dsbas536 toSci '111e*123' -> NaN Conversion_syntax
-dsbas537 toSci '111e123-' -> NaN Conversion_syntax
-dsbas538 toSci '111e+12+' -> NaN Conversion_syntax
-dsbas539 toSci '111e1-3-' -> NaN Conversion_syntax
-dsbas540 toSci '111e1*23' -> NaN Conversion_syntax
-dsbas541 toSci '111e1e+3' -> NaN Conversion_syntax
-dsbas542 toSci '1e1.0' -> NaN Conversion_syntax
-dsbas543 toSci '1e123e' -> NaN Conversion_syntax
-dsbas544 toSci 'ten' -> NaN Conversion_syntax
-dsbas545 toSci 'ONE' -> NaN Conversion_syntax
-dsbas546 toSci '1e.1' -> NaN Conversion_syntax
-dsbas547 toSci '1e1.' -> NaN Conversion_syntax
-dsbas548 toSci '1ee' -> NaN Conversion_syntax
-dsbas549 toSci 'e+1' -> NaN Conversion_syntax
-dsbas550 toSci '1.23.4' -> NaN Conversion_syntax
-dsbas551 toSci '1.2.1' -> NaN Conversion_syntax
-dsbas552 toSci '1E+1.2' -> NaN Conversion_syntax
-dsbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
-dsbas554 toSci '1E++1' -> NaN Conversion_syntax
-dsbas555 toSci '1E--1' -> NaN Conversion_syntax
-dsbas556 toSci '1E+-1' -> NaN Conversion_syntax
-dsbas557 toSci '1E-+1' -> NaN Conversion_syntax
-dsbas558 toSci '1E''1' -> NaN Conversion_syntax
-dsbas559 toSci "1E""1" -> NaN Conversion_syntax
-dsbas560 toSci "1E""""" -> NaN Conversion_syntax
--- Near-specials
-dsbas561 toSci "qNaN" -> NaN Conversion_syntax
-dsbas562 toSci "NaNq" -> NaN Conversion_syntax
-dsbas563 toSci "NaNs" -> NaN Conversion_syntax
-dsbas564 toSci "Infi" -> NaN Conversion_syntax
-dsbas565 toSci "Infin" -> NaN Conversion_syntax
-dsbas566 toSci "Infini" -> NaN Conversion_syntax
-dsbas567 toSci "Infinit" -> NaN Conversion_syntax
-dsbas568 toSci "-Infinit" -> NaN Conversion_syntax
-dsbas569 toSci "0Inf" -> NaN Conversion_syntax
-dsbas570 toSci "9Inf" -> NaN Conversion_syntax
-dsbas571 toSci "-0Inf" -> NaN Conversion_syntax
-dsbas572 toSci "-9Inf" -> NaN Conversion_syntax
-dsbas573 toSci "-sNa" -> NaN Conversion_syntax
-dsbas574 toSci "xNaN" -> NaN Conversion_syntax
-dsbas575 toSci "0sNaN" -> NaN Conversion_syntax
-
--- some baddies with dots and Es and dots and specials
-dsbas576 toSci 'e+1' -> NaN Conversion_syntax
-dsbas577 toSci '.e+1' -> NaN Conversion_syntax
-dsbas578 toSci '+.e+1' -> NaN Conversion_syntax
-dsbas579 toSci '-.e+' -> NaN Conversion_syntax
-dsbas580 toSci '-.e' -> NaN Conversion_syntax
-dsbas581 toSci 'E+1' -> NaN Conversion_syntax
-dsbas582 toSci '.E+1' -> NaN Conversion_syntax
-dsbas583 toSci '+.E+1' -> NaN Conversion_syntax
-dsbas584 toSci '-.E+' -> NaN Conversion_syntax
-dsbas585 toSci '-.E' -> NaN Conversion_syntax
-
-dsbas586 toSci '.NaN' -> NaN Conversion_syntax
-dsbas587 toSci '-.NaN' -> NaN Conversion_syntax
-dsbas588 toSci '+.sNaN' -> NaN Conversion_syntax
-dsbas589 toSci '+.Inf' -> NaN Conversion_syntax
-dsbas590 toSci '.Infinity' -> NaN Conversion_syntax
-
--- Zeros
-dsbas601 toSci 0.000000000 -> 0E-9
-dsbas602 toSci 0.00000000 -> 0E-8
-dsbas603 toSci 0.0000000 -> 0E-7
-dsbas604 toSci 0.000000 -> 0.000000
-dsbas605 toSci 0.00000 -> 0.00000
-dsbas606 toSci 0.0000 -> 0.0000
-dsbas607 toSci 0.000 -> 0.000
-dsbas608 toSci 0.00 -> 0.00
-dsbas609 toSci 0.0 -> 0.0
-dsbas610 toSci .0 -> 0.0
-dsbas611 toSci 0. -> 0
-dsbas612 toSci -.0 -> -0.0
-dsbas613 toSci -0. -> -0
-dsbas614 toSci -0.0 -> -0.0
-dsbas615 toSci -0.00 -> -0.00
-dsbas616 toSci -0.000 -> -0.000
-dsbas617 toSci -0.0000 -> -0.0000
-dsbas618 toSci -0.00000 -> -0.00000
-dsbas619 toSci -0.000000 -> -0.000000
-dsbas620 toSci -0.0000000 -> -0E-7
-dsbas621 toSci -0.00000000 -> -0E-8
-dsbas622 toSci -0.000000000 -> -0E-9
-
-dsbas630 toSci 0.00E+0 -> 0.00
-dsbas631 toSci 0.00E+1 -> 0.0
-dsbas632 toSci 0.00E+2 -> 0
-dsbas633 toSci 0.00E+3 -> 0E+1
-dsbas634 toSci 0.00E+4 -> 0E+2
-dsbas635 toSci 0.00E+5 -> 0E+3
-dsbas636 toSci 0.00E+6 -> 0E+4
-dsbas637 toSci 0.00E+7 -> 0E+5
-dsbas638 toSci 0.00E+8 -> 0E+6
-dsbas639 toSci 0.00E+9 -> 0E+7
-
-dsbas640 toSci 0.0E+0 -> 0.0
-dsbas641 toSci 0.0E+1 -> 0
-dsbas642 toSci 0.0E+2 -> 0E+1
-dsbas643 toSci 0.0E+3 -> 0E+2
-dsbas644 toSci 0.0E+4 -> 0E+3
-dsbas645 toSci 0.0E+5 -> 0E+4
-dsbas646 toSci 0.0E+6 -> 0E+5
-dsbas647 toSci 0.0E+7 -> 0E+6
-dsbas648 toSci 0.0E+8 -> 0E+7
-dsbas649 toSci 0.0E+9 -> 0E+8
-
-dsbas650 toSci 0E+0 -> 0
-dsbas651 toSci 0E+1 -> 0E+1
-dsbas652 toSci 0E+2 -> 0E+2
-dsbas653 toSci 0E+3 -> 0E+3
-dsbas654 toSci 0E+4 -> 0E+4
-dsbas655 toSci 0E+5 -> 0E+5
-dsbas656 toSci 0E+6 -> 0E+6
-dsbas657 toSci 0E+7 -> 0E+7
-dsbas658 toSci 0E+8 -> 0E+8
-dsbas659 toSci 0E+9 -> 0E+9
-
-dsbas660 toSci 0.0E-0 -> 0.0
-dsbas661 toSci 0.0E-1 -> 0.00
-dsbas662 toSci 0.0E-2 -> 0.000
-dsbas663 toSci 0.0E-3 -> 0.0000
-dsbas664 toSci 0.0E-4 -> 0.00000
-dsbas665 toSci 0.0E-5 -> 0.000000
-dsbas666 toSci 0.0E-6 -> 0E-7
-dsbas667 toSci 0.0E-7 -> 0E-8
-dsbas668 toSci 0.0E-8 -> 0E-9
-dsbas669 toSci 0.0E-9 -> 0E-10
-
-dsbas670 toSci 0.00E-0 -> 0.00
-dsbas671 toSci 0.00E-1 -> 0.000
-dsbas672 toSci 0.00E-2 -> 0.0000
-dsbas673 toSci 0.00E-3 -> 0.00000
-dsbas674 toSci 0.00E-4 -> 0.000000
-dsbas675 toSci 0.00E-5 -> 0E-7
-dsbas676 toSci 0.00E-6 -> 0E-8
-dsbas677 toSci 0.00E-7 -> 0E-9
-dsbas678 toSci 0.00E-8 -> 0E-10
-dsbas679 toSci 0.00E-9 -> 0E-11
-
-dsbas680 toSci 000000. -> 0
-dsbas681 toSci 00000. -> 0
-dsbas682 toSci 0000. -> 0
-dsbas683 toSci 000. -> 0
-dsbas684 toSci 00. -> 0
-dsbas685 toSci 0. -> 0
-dsbas686 toSci +00000. -> 0
-dsbas687 toSci -00000. -> -0
-dsbas688 toSci +0. -> 0
-dsbas689 toSci -0. -> -0
-
--- Specials
-dsbas700 toSci "NaN" -> NaN
-dsbas701 toSci "nan" -> NaN
-dsbas702 toSci "nAn" -> NaN
-dsbas703 toSci "NAN" -> NaN
-dsbas704 toSci "+NaN" -> NaN
-dsbas705 toSci "+nan" -> NaN
-dsbas706 toSci "+nAn" -> NaN
-dsbas707 toSci "+NAN" -> NaN
-dsbas708 toSci "-NaN" -> -NaN
-dsbas709 toSci "-nan" -> -NaN
-dsbas710 toSci "-nAn" -> -NaN
-dsbas711 toSci "-NAN" -> -NaN
-dsbas712 toSci 'NaN0' -> NaN
-dsbas713 toSci 'NaN1' -> NaN1
-dsbas714 toSci 'NaN12' -> NaN12
-dsbas715 toSci 'NaN123' -> NaN123
-dsbas716 toSci 'NaN1234' -> NaN1234
-dsbas717 toSci 'NaN01' -> NaN1
-dsbas718 toSci 'NaN012' -> NaN12
-dsbas719 toSci 'NaN0123' -> NaN123
-dsbas720 toSci 'NaN01234' -> NaN1234
-dsbas721 toSci 'NaN001' -> NaN1
-dsbas722 toSci 'NaN0012' -> NaN12
-dsbas723 toSci 'NaN00123' -> NaN123
-dsbas724 toSci 'NaN001234' -> NaN1234
-dsbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax
-dsbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
-dsbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
-dsbas728 toSci 'NaN-12' -> NaN Conversion_syntax
-dsbas729 toSci 'NaN+12' -> NaN Conversion_syntax
-
-dsbas730 toSci "sNaN" -> sNaN
-dsbas731 toSci "snan" -> sNaN
-dsbas732 toSci "SnAn" -> sNaN
-dsbas733 toSci "SNAN" -> sNaN
-dsbas734 toSci "+sNaN" -> sNaN
-dsbas735 toSci "+snan" -> sNaN
-dsbas736 toSci "+SnAn" -> sNaN
-dsbas737 toSci "+SNAN" -> sNaN
-dsbas738 toSci "-sNaN" -> -sNaN
-dsbas739 toSci "-snan" -> -sNaN
-dsbas740 toSci "-SnAn" -> -sNaN
-dsbas741 toSci "-SNAN" -> -sNaN
-dsbas742 toSci 'sNaN0000' -> sNaN
-dsbas743 toSci 'sNaN7' -> sNaN7
-dsbas744 toSci 'sNaN007234' -> sNaN7234
-dsbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax
-dsbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
-dsbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
-
-dsbas748 toSci "Inf" -> Infinity
-dsbas749 toSci "inf" -> Infinity
-dsbas750 toSci "iNf" -> Infinity
-dsbas751 toSci "INF" -> Infinity
-dsbas752 toSci "+Inf" -> Infinity
-dsbas753 toSci "+inf" -> Infinity
-dsbas754 toSci "+iNf" -> Infinity
-dsbas755 toSci "+INF" -> Infinity
-dsbas756 toSci "-Inf" -> -Infinity
-dsbas757 toSci "-inf" -> -Infinity
-dsbas758 toSci "-iNf" -> -Infinity
-dsbas759 toSci "-INF" -> -Infinity
-
-dsbas760 toSci "Infinity" -> Infinity
-dsbas761 toSci "infinity" -> Infinity
-dsbas762 toSci "iNfInItY" -> Infinity
-dsbas763 toSci "INFINITY" -> Infinity
-dsbas764 toSci "+Infinity" -> Infinity
-dsbas765 toSci "+infinity" -> Infinity
-dsbas766 toSci "+iNfInItY" -> Infinity
-dsbas767 toSci "+INFINITY" -> Infinity
-dsbas768 toSci "-Infinity" -> -Infinity
-dsbas769 toSci "-infinity" -> -Infinity
-dsbas770 toSci "-iNfInItY" -> -Infinity
-dsbas771 toSci "-INFINITY" -> -Infinity
-
--- Specials and zeros for toEng
-dsbast772 toEng "NaN" -> NaN
-dsbast773 toEng "-Infinity" -> -Infinity
-dsbast774 toEng "-sNaN" -> -sNaN
-dsbast775 toEng "-NaN" -> -NaN
-dsbast776 toEng "+Infinity" -> Infinity
-dsbast778 toEng "+sNaN" -> sNaN
-dsbast779 toEng "+NaN" -> NaN
-dsbast780 toEng "INFINITY" -> Infinity
-dsbast781 toEng "SNAN" -> sNaN
-dsbast782 toEng "NAN" -> NaN
-dsbast783 toEng "infinity" -> Infinity
-dsbast784 toEng "snan" -> sNaN
-dsbast785 toEng "nan" -> NaN
-dsbast786 toEng "InFINITY" -> Infinity
-dsbast787 toEng "SnAN" -> sNaN
-dsbast788 toEng "nAN" -> NaN
-dsbast789 toEng "iNfinity" -> Infinity
-dsbast790 toEng "sNan" -> sNaN
-dsbast791 toEng "Nan" -> NaN
-dsbast792 toEng "Infinity" -> Infinity
-dsbast793 toEng "sNaN" -> sNaN
-
--- Zero toEng, etc.
-dsbast800 toEng 0e+1 -> "0.00E+3" -- doc example
-
-dsbast801 toEng 0.000000000 -> 0E-9
-dsbast802 toEng 0.00000000 -> 0.00E-6
-dsbast803 toEng 0.0000000 -> 0.0E-6
-dsbast804 toEng 0.000000 -> 0.000000
-dsbast805 toEng 0.00000 -> 0.00000
-dsbast806 toEng 0.0000 -> 0.0000
-dsbast807 toEng 0.000 -> 0.000
-dsbast808 toEng 0.00 -> 0.00
-dsbast809 toEng 0.0 -> 0.0
-dsbast810 toEng .0 -> 0.0
-dsbast811 toEng 0. -> 0
-dsbast812 toEng -.0 -> -0.0
-dsbast813 toEng -0. -> -0
-dsbast814 toEng -0.0 -> -0.0
-dsbast815 toEng -0.00 -> -0.00
-dsbast816 toEng -0.000 -> -0.000
-dsbast817 toEng -0.0000 -> -0.0000
-dsbast818 toEng -0.00000 -> -0.00000
-dsbast819 toEng -0.000000 -> -0.000000
-dsbast820 toEng -0.0000000 -> -0.0E-6
-dsbast821 toEng -0.00000000 -> -0.00E-6
-dsbast822 toEng -0.000000000 -> -0E-9
-
-dsbast830 toEng 0.00E+0 -> 0.00
-dsbast831 toEng 0.00E+1 -> 0.0
-dsbast832 toEng 0.00E+2 -> 0
-dsbast833 toEng 0.00E+3 -> 0.00E+3
-dsbast834 toEng 0.00E+4 -> 0.0E+3
-dsbast835 toEng 0.00E+5 -> 0E+3
-dsbast836 toEng 0.00E+6 -> 0.00E+6
-dsbast837 toEng 0.00E+7 -> 0.0E+6
-dsbast838 toEng 0.00E+8 -> 0E+6
-dsbast839 toEng 0.00E+9 -> 0.00E+9
-
-dsbast840 toEng 0.0E+0 -> 0.0
-dsbast841 toEng 0.0E+1 -> 0
-dsbast842 toEng 0.0E+2 -> 0.00E+3
-dsbast843 toEng 0.0E+3 -> 0.0E+3
-dsbast844 toEng 0.0E+4 -> 0E+3
-dsbast845 toEng 0.0E+5 -> 0.00E+6
-dsbast846 toEng 0.0E+6 -> 0.0E+6
-dsbast847 toEng 0.0E+7 -> 0E+6
-dsbast848 toEng 0.0E+8 -> 0.00E+9
-dsbast849 toEng 0.0E+9 -> 0.0E+9
-
-dsbast850 toEng 0E+0 -> 0
-dsbast851 toEng 0E+1 -> 0.00E+3
-dsbast852 toEng 0E+2 -> 0.0E+3
-dsbast853 toEng 0E+3 -> 0E+3
-dsbast854 toEng 0E+4 -> 0.00E+6
-dsbast855 toEng 0E+5 -> 0.0E+6
-dsbast856 toEng 0E+6 -> 0E+6
-dsbast857 toEng 0E+7 -> 0.00E+9
-dsbast858 toEng 0E+8 -> 0.0E+9
-dsbast859 toEng 0E+9 -> 0E+9
-
-dsbast860 toEng 0.0E-0 -> 0.0
-dsbast861 toEng 0.0E-1 -> 0.00
-dsbast862 toEng 0.0E-2 -> 0.000
-dsbast863 toEng 0.0E-3 -> 0.0000
-dsbast864 toEng 0.0E-4 -> 0.00000
-dsbast865 toEng 0.0E-5 -> 0.000000
-dsbast866 toEng 0.0E-6 -> 0.0E-6
-dsbast867 toEng 0.0E-7 -> 0.00E-6
-dsbast868 toEng 0.0E-8 -> 0E-9
-dsbast869 toEng 0.0E-9 -> 0.0E-9
-
-dsbast870 toEng 0.00E-0 -> 0.00
-dsbast871 toEng 0.00E-1 -> 0.000
-dsbast872 toEng 0.00E-2 -> 0.0000
-dsbast873 toEng 0.00E-3 -> 0.00000
-dsbast874 toEng 0.00E-4 -> 0.000000
-dsbast875 toEng 0.00E-5 -> 0.0E-6
-dsbast876 toEng 0.00E-6 -> 0.00E-6
-dsbast877 toEng 0.00E-7 -> 0E-9
-dsbast878 toEng 0.00E-8 -> 0.0E-9
-dsbast879 toEng 0.00E-9 -> 0.00E-9
-
--- long input strings
-dsbas801 tosci '01234567' -> 1234567
-dsbas802 tosci '001234567' -> 1234567
-dsbas803 tosci '0001234567' -> 1234567
-dsbas804 tosci '00001234567' -> 1234567
-dsbas805 tosci '000001234567' -> 1234567
-dsbas806 tosci '0000001234567' -> 1234567
-dsbas807 tosci '00000001234567' -> 1234567
-dsbas808 tosci '000000001234567' -> 1234567
-dsbas809 tosci '0000000001234567' -> 1234567
-dsbas810 tosci '00000000001234567' -> 1234567
-
-dsbas811 tosci '0.1234567' -> 0.1234567
-dsbas812 tosci '0.01234567' -> 0.01234567
-dsbas813 tosci '0.001234567' -> 0.001234567
-dsbas814 tosci '0.0001234567' -> 0.0001234567
-dsbas815 tosci '0.00001234567' -> 0.00001234567
-dsbas816 tosci '0.000001234567' -> 0.000001234567
-dsbas817 tosci '0.0000001234567' -> 1.234567E-7
-dsbas818 tosci '0.00000001234567' -> 1.234567E-8
-dsbas819 tosci '0.000000001234567' -> 1.234567E-9
-dsbas820 tosci '0.0000000001234567' -> 1.234567E-10
-
-dsbas821 tosci '123456790' -> 1.234568E+8 Inexact Rounded
-dsbas822 tosci '1234567901' -> 1.234568E+9 Inexact Rounded
-dsbas823 tosci '12345679012' -> 1.234568E+10 Inexact Rounded
-dsbas824 tosci '123456790123' -> 1.234568E+11 Inexact Rounded
-dsbas825 tosci '1234567901234' -> 1.234568E+12 Inexact Rounded
-dsbas826 tosci '12345679012345' -> 1.234568E+13 Inexact Rounded
-dsbas827 tosci '123456790123456' -> 1.234568E+14 Inexact Rounded
-dsbas828 tosci '1234567901234567' -> 1.234568E+15 Inexact Rounded
-dsbas829 tosci '1234567890123456' -> 1.234568E+15 Inexact Rounded
-
--- subnormals and overflows
-dsbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
-dsbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
-dsbas908 toSci '0.9e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas909 toSci '0.09e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
-dsbas911 toSci '10e-1000000000' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
-dsbas913 toSci '99e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
-dsbas915 toSci '1111e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas916 toSci '1111e-99999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
--- negatives the same
-dsbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
-dsbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
-dsbas920 toSci '-0.9e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas921 toSci '-0.09e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
-dsbas923 toSci '-10e-1000000000' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
-dsbas925 toSci '-99e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
-dsbas927 toSci '-1111e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas928 toSci '-1111e-99999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
-
--- overflow results at different rounding modes
-rounding: ceiling
-dsbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas931 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded
-rounding: up
-dsbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: down
-dsbas934 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded
-dsbas935 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded
-rounding: floor
-dsbas936 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded
-dsbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_up
-dsbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_even
-dsbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_down
-dsbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_even
-
--- Now check 854/754r some subnormals and underflow to 0
-dsbem400 toSci 1.0000E-86 -> 1.0000E-86
-dsbem401 toSci 0.1E-97 -> 1E-98 Subnormal
-dsbem402 toSci 0.1000E-97 -> 1.000E-98 Subnormal
-dsbem403 toSci 0.0100E-97 -> 1.00E-99 Subnormal
-dsbem404 toSci 0.0010E-97 -> 1.0E-100 Subnormal
-dsbem405 toSci 0.0001E-97 -> 1E-101 Subnormal
-dsbem406 toSci 0.00010E-97 -> 1E-101 Subnormal Rounded
-dsbem407 toSci 0.00013E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
-dsbem408 toSci 0.00015E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem409 toSci 0.00017E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem410 toSci 0.00023E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem411 toSci 0.00025E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem412 toSci 0.00027E-97 -> 3E-101 Underflow Subnormal Inexact Rounded
-dsbem413 toSci 0.000149E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
-dsbem414 toSci 0.000150E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem415 toSci 0.000151E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem416 toSci 0.000249E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem417 toSci 0.000250E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem418 toSci 0.000251E-97 -> 3E-101 Underflow Subnormal Inexact Rounded
-dsbem419 toSci 0.00009E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
-dsbem420 toSci 0.00005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem421 toSci 0.00003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem422 toSci 0.000009E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem423 toSci 0.000005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem424 toSci 0.000003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-
-dsbem425 toSci 0.001049E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
-dsbem426 toSci 0.001050E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
-dsbem427 toSci 0.001051E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded
-dsbem428 toSci 0.001149E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded
-dsbem429 toSci 0.001150E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded
-dsbem430 toSci 0.001151E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded
-
-dsbem432 toSci 0.010049E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
-dsbem433 toSci 0.010050E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
-dsbem434 toSci 0.010051E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded
-dsbem435 toSci 0.010149E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded
-dsbem436 toSci 0.010150E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded
-dsbem437 toSci 0.010151E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded
-
-dsbem440 toSci 0.10103E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded
-dsbem441 toSci 0.10105E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded
-dsbem442 toSci 0.10107E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded
-dsbem443 toSci 0.10113E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded
-dsbem444 toSci 0.10115E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded
-dsbem445 toSci 0.10117E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded
-
-dsbem450 toSci 1.10730E-98 -> 1.107E-98 Underflow Subnormal Inexact Rounded
-dsbem451 toSci 1.10750E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
-dsbem452 toSci 1.10770E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
-dsbem453 toSci 1.10830E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
-dsbem454 toSci 1.10850E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
-dsbem455 toSci 1.10870E-98 -> 1.109E-98 Underflow Subnormal Inexact Rounded
-
--- make sure sign OK
-dsbem456 toSci -0.10103E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded
-dsbem457 toSci -0.10105E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded
-dsbem458 toSci -0.10107E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded
-dsbem459 toSci -0.10113E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded
-dsbem460 toSci -0.10115E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded
-dsbem461 toSci -0.10117E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded
-
--- '999s' cases
-dsbem464 toSci 999999E-98 -> 9.99999E-93
-dsbem465 toSci 99999.0E-97 -> 9.99990E-93
-dsbem466 toSci 99999.E-97 -> 9.9999E-93
-dsbem467 toSci 9999.9E-97 -> 9.9999E-94
-dsbem468 toSci 999.99E-97 -> 9.9999E-95
-dsbem469 toSci 99.999E-97 -> 9.9999E-96 Subnormal
-dsbem470 toSci 9.9999E-97 -> 9.9999E-97 Subnormal
-dsbem471 toSci 0.99999E-97 -> 1.0000E-97 Underflow Subnormal Inexact Rounded
-dsbem472 toSci 0.099999E-97 -> 1.000E-98 Underflow Subnormal Inexact Rounded
-dsbem473 toSci 0.0099999E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
-dsbem474 toSci 0.00099999E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
-dsbem475 toSci 0.000099999E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
-dsbem476 toSci 0.0000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem477 toSci 0.00000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem478 toSci 0.000000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-
--- Exponents with insignificant leading zeros
-dsbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
-dsbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
-dsbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
-dsbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
-dsbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
-dsbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
-dsbas1007 toSci 1e-999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1008 toSci 1e-0999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1009 toSci 1e-00999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1010 toSci 1e-000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1011 toSci 1e-000000000000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1012 toSci 1e-000000000001000000007 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-
--- check for double-rounded subnormals
-dsbas1041 toSci 1.1152444E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
-dsbas1042 toSci 1.1152445E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
-dsbas1043 toSci 1.1152446E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
-
--- clamped zeros [see also clamp.decTest]
-dsbas1075 toSci 0e+10000 -> 0E+90 Clamped
-dsbas1076 toSci 0e-10000 -> 0E-101 Clamped
-dsbas1077 toSci -0e+10000 -> -0E+90 Clamped
-dsbas1078 toSci -0e-10000 -> -0E-101 Clamped
-
--- extreme values from next-wider
-dsbas1101 toSci -9.999999999999999E+384 -> -Infinity Overflow Inexact Rounded
-dsbas1102 toSci -1E-383 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped
-dsbas1103 toSci -1E-398 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped
-dsbas1104 toSci -0 -> -0
-dsbas1105 toSci +0 -> 0
-dsbas1106 toSci +1E-398 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped
-dsbas1107 toSci +1E-383 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped
-dsbas1108 toSci +9.999999999999999E+384 -> Infinity Overflow Inexact Rounded
-
--- narrowing case
-dsbas1110 toSci 2.000000000000000E-99 -> 2.00E-99 Rounded Subnormal
+------------------------------------------------------------------------
+-- dsBase.decTest -- base decSingle <--> string conversions --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests base conversions from string to a decimal number
+-- and back to a string (in Scientific form)
+
+-- Note that unlike other operations the operand is subject to rounding
+-- to conform to emax and precision settings (that is, numbers will
+-- conform to rules and exponent will be in permitted range). The
+-- 'left hand side', therefore, may have numbers that cannot be
+-- represented in a decSingle. Some testcases go to the limit of the
+-- next-wider format, and hence these testcases may also be used to
+-- test narrowing and widening operations.
+
+extended: 1
+clamp: 1
+precision: 7
+maxExponent: 96
+minExponent: -95
+rounding: half_even
+
+dsbas001 toSci 0 -> 0
+dsbas002 toSci 1 -> 1
+dsbas003 toSci 1.0 -> 1.0
+dsbas004 toSci 1.00 -> 1.00
+dsbas005 toSci 10 -> 10
+dsbas006 toSci 1000 -> 1000
+dsbas007 toSci 10.0 -> 10.0
+dsbas008 toSci 10.1 -> 10.1
+dsbas009 toSci 10.4 -> 10.4
+dsbas010 toSci 10.5 -> 10.5
+dsbas011 toSci 10.6 -> 10.6
+dsbas012 toSci 10.9 -> 10.9
+dsbas013 toSci 11.0 -> 11.0
+dsbas014 toSci 1.234 -> 1.234
+dsbas015 toSci 0.123 -> 0.123
+dsbas016 toSci 0.012 -> 0.012
+dsbas017 toSci -0 -> -0
+dsbas018 toSci -0.0 -> -0.0
+dsbas019 toSci -00.00 -> -0.00
+
+dsbas021 toSci -1 -> -1
+dsbas022 toSci -1.0 -> -1.0
+dsbas023 toSci -0.1 -> -0.1
+dsbas024 toSci -9.1 -> -9.1
+dsbas025 toSci -9.11 -> -9.11
+dsbas026 toSci -9.119 -> -9.119
+dsbas027 toSci -9.999 -> -9.999
+
+dsbas030 toSci '1234.567' -> '1234.567'
+dsbas031 toSci '1234.000' -> '1234.000'
+dsbas032 toSci '1234912' -> '1234912'
+dsbas033 toSci '0.00001234567' -> '0.00001234567'
+dsbas034 toSci '0.000001234567' -> '0.000001234567'
+dsbas035 toSci '0.0000001234567' -> '1.234567E-7'
+dsbas036 toSci '0.00000001234567' -> '1.234567E-8'
+
+dsbas037 toSci '0.1234564' -> '0.1234564'
+dsbas038 toSci '0.1234565' -> '0.1234565'
+
+-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
+dsbsn001 toSci -9.999999E+96 -> -9.999999E+96
+dsbsn002 toSci -1E-95 -> -1E-95
+dsbsn003 toSci -1E-101 -> -1E-101 Subnormal
+dsbsn004 toSci -0 -> -0
+dsbsn005 toSci +0 -> 0
+dsbsn006 toSci +1E-101 -> 1E-101 Subnormal
+dsbsn007 toSci +1E-95 -> 1E-95
+dsbsn008 toSci +9.999999E+96 -> 9.999999E+96
+
+-- String [many more examples are implicitly tested elsewhere]
+-- strings without E cannot generate E in result
+dsbas040 toSci "12" -> '12'
+dsbas041 toSci "-76" -> '-76'
+dsbas042 toSci "12.76" -> '12.76'
+dsbas043 toSci "+12.76" -> '12.76'
+dsbas044 toSci "012.76" -> '12.76'
+dsbas045 toSci "+0.003" -> '0.003'
+dsbas046 toSci "17." -> '17'
+dsbas047 toSci ".5" -> '0.5'
+dsbas048 toSci "044" -> '44'
+dsbas049 toSci "0044" -> '44'
+dsbas050 toSci "0.0005" -> '0.0005'
+dsbas051 toSci "00.00005" -> '0.00005'
+dsbas052 toSci "0.000005" -> '0.000005'
+dsbas053 toSci "0.0000050" -> '0.0000050'
+dsbas054 toSci "0.0000005" -> '5E-7'
+dsbas055 toSci "0.00000005" -> '5E-8'
+dsbas056 toSci "12678.54" -> '12678.54'
+dsbas057 toSci "2678.543" -> '2678.543'
+dsbas058 toSci "345678.5" -> '345678.5'
+dsbas059 toSci "0678.5432" -> '678.5432'
+dsbas060 toSci "678.5432" -> '678.5432'
+dsbas061 toSci "+678.5432" -> '678.5432'
+dsbas062 toSci "+0678.5432" -> '678.5432'
+dsbas063 toSci "+00678.5432" -> '678.5432'
+dsbas064 toSci "-678.5432" -> '-678.5432'
+dsbas065 toSci "-0678.5432" -> '-678.5432'
+dsbas066 toSci "-00678.5432" -> '-678.5432'
+-- examples
+dsbas067 toSci "5E-6" -> '0.000005'
+dsbas068 toSci "50E-7" -> '0.0000050'
+dsbas069 toSci "5E-7" -> '5E-7'
+
+-- [No exotics as no Unicode]
+
+-- rounded with dots in all (including edge) places
+dsbas071 toSci .1234567890123456 -> 0.1234568 Inexact Rounded
+dsbas072 toSci 1.234567890123456 -> 1.234568 Inexact Rounded
+dsbas073 toSci 12.34567890123456 -> 12.34568 Inexact Rounded
+dsbas074 toSci 123.4567890123456 -> 123.4568 Inexact Rounded
+dsbas075 toSci 1234.567890123456 -> 1234.568 Inexact Rounded
+dsbas076 toSci 12345.67890123456 -> 12345.68 Inexact Rounded
+dsbas077 toSci 123456.7890123456 -> 123456.8 Inexact Rounded
+dsbas078 toSci 1234567.890123456 -> 1234568 Inexact Rounded
+dsbas079 toSci 12345678.90123456 -> 1.234568E+7 Inexact Rounded
+dsbas080 toSci 123456789.0123456 -> 1.234568E+8 Inexact Rounded
+dsbas081 toSci 1234567890.123456 -> 1.234568E+9 Inexact Rounded
+dsbas082 toSci 12345678901.23456 -> 1.234568E+10 Inexact Rounded
+dsbas083 toSci 123456789012.3456 -> 1.234568E+11 Inexact Rounded
+dsbas084 toSci 1234567890123.456 -> 1.234568E+12 Inexact Rounded
+dsbas085 toSci 12345678901234.56 -> 1.234568E+13 Inexact Rounded
+dsbas086 toSci 123456789012345.6 -> 1.234568E+14 Inexact Rounded
+dsbas087 toSci 1234567890123456. -> 1.234568E+15 Inexact Rounded
+dsbas088 toSci 1234567890123456 -> 1.234568E+15 Inexact Rounded
+
+-- Numbers with E
+dsbas130 toSci "0.000E-1" -> '0.0000'
+dsbas131 toSci "0.000E-2" -> '0.00000'
+dsbas132 toSci "0.000E-3" -> '0.000000'
+dsbas133 toSci "0.000E-4" -> '0E-7'
+dsbas134 toSci "0.00E-2" -> '0.0000'
+dsbas135 toSci "0.00E-3" -> '0.00000'
+dsbas136 toSci "0.00E-4" -> '0.000000'
+dsbas137 toSci "0.00E-5" -> '0E-7'
+dsbas138 toSci "+0E+9" -> '0E+9'
+dsbas139 toSci "-0E+9" -> '-0E+9'
+dsbas140 toSci "1E+9" -> '1E+9'
+dsbas141 toSci "1e+09" -> '1E+9'
+dsbas142 toSci "1E+90" -> '1E+90'
+dsbas143 toSci "+1E+009" -> '1E+9'
+dsbas144 toSci "0E+9" -> '0E+9'
+dsbas145 toSci "1E+9" -> '1E+9'
+dsbas146 toSci "1E+09" -> '1E+9'
+dsbas147 toSci "1e+90" -> '1E+90'
+dsbas148 toSci "1E+009" -> '1E+9'
+dsbas149 toSci "000E+9" -> '0E+9'
+dsbas150 toSci "1E9" -> '1E+9'
+dsbas151 toSci "1e09" -> '1E+9'
+dsbas152 toSci "1E90" -> '1E+90'
+dsbas153 toSci "1E009" -> '1E+9'
+dsbas154 toSci "0E9" -> '0E+9'
+dsbas155 toSci "0.000e+0" -> '0.000'
+dsbas156 toSci "0.000E-1" -> '0.0000'
+dsbas157 toSci "4E+9" -> '4E+9'
+dsbas158 toSci "44E+9" -> '4.4E+10'
+dsbas159 toSci "0.73e-7" -> '7.3E-8'
+dsbas160 toSci "00E+9" -> '0E+9'
+dsbas161 toSci "00E-9" -> '0E-9'
+dsbas162 toSci "10E+9" -> '1.0E+10'
+dsbas163 toSci "10E+09" -> '1.0E+10'
+dsbas164 toSci "10e+90" -> '1.0E+91'
+dsbas165 toSci "10E+009" -> '1.0E+10'
+dsbas166 toSci "100e+9" -> '1.00E+11'
+dsbas167 toSci "100e+09" -> '1.00E+11'
+dsbas168 toSci "100E+90" -> '1.00E+92'
+dsbas169 toSci "100e+009" -> '1.00E+11'
+
+dsbas170 toSci "1.265" -> '1.265'
+dsbas171 toSci "1.265E-20" -> '1.265E-20'
+dsbas172 toSci "1.265E-8" -> '1.265E-8'
+dsbas173 toSci "1.265E-4" -> '0.0001265'
+dsbas174 toSci "1.265E-3" -> '0.001265'
+dsbas175 toSci "1.265E-2" -> '0.01265'
+dsbas176 toSci "1.265E-1" -> '0.1265'
+dsbas177 toSci "1.265E-0" -> '1.265'
+dsbas178 toSci "1.265E+1" -> '12.65'
+dsbas179 toSci "1.265E+2" -> '126.5'
+dsbas180 toSci "1.265E+3" -> '1265'
+dsbas181 toSci "1.265E+4" -> '1.265E+4'
+dsbas182 toSci "1.265E+8" -> '1.265E+8'
+dsbas183 toSci "1.265E+20" -> '1.265E+20'
+
+dsbas190 toSci "12.65" -> '12.65'
+dsbas191 toSci "12.65E-20" -> '1.265E-19'
+dsbas192 toSci "12.65E-8" -> '1.265E-7'
+dsbas193 toSci "12.65E-4" -> '0.001265'
+dsbas194 toSci "12.65E-3" -> '0.01265'
+dsbas195 toSci "12.65E-2" -> '0.1265'
+dsbas196 toSci "12.65E-1" -> '1.265'
+dsbas197 toSci "12.65E-0" -> '12.65'
+dsbas198 toSci "12.65E+1" -> '126.5'
+dsbas199 toSci "12.65E+2" -> '1265'
+dsbas200 toSci "12.65E+3" -> '1.265E+4'
+dsbas201 toSci "12.65E+4" -> '1.265E+5'
+dsbas202 toSci "12.65E+8" -> '1.265E+9'
+dsbas203 toSci "12.65E+20" -> '1.265E+21'
+
+dsbas210 toSci "126.5" -> '126.5'
+dsbas211 toSci "126.5E-20" -> '1.265E-18'
+dsbas212 toSci "126.5E-8" -> '0.000001265'
+dsbas213 toSci "126.5E-4" -> '0.01265'
+dsbas214 toSci "126.5E-3" -> '0.1265'
+dsbas215 toSci "126.5E-2" -> '1.265'
+dsbas216 toSci "126.5E-1" -> '12.65'
+dsbas217 toSci "126.5E-0" -> '126.5'
+dsbas218 toSci "126.5E+1" -> '1265'
+dsbas219 toSci "126.5E+2" -> '1.265E+4'
+dsbas220 toSci "126.5E+3" -> '1.265E+5'
+dsbas221 toSci "126.5E+4" -> '1.265E+6'
+dsbas222 toSci "126.5E+8" -> '1.265E+10'
+dsbas223 toSci "126.5E+20" -> '1.265E+22'
+
+dsbas230 toSci "1265" -> '1265'
+dsbas231 toSci "1265E-20" -> '1.265E-17'
+dsbas232 toSci "1265E-8" -> '0.00001265'
+dsbas233 toSci "1265E-4" -> '0.1265'
+dsbas234 toSci "1265E-3" -> '1.265'
+dsbas235 toSci "1265E-2" -> '12.65'
+dsbas236 toSci "1265E-1" -> '126.5'
+dsbas237 toSci "1265E-0" -> '1265'
+dsbas238 toSci "1265E+1" -> '1.265E+4'
+dsbas239 toSci "1265E+2" -> '1.265E+5'
+dsbas240 toSci "1265E+3" -> '1.265E+6'
+dsbas241 toSci "1265E+4" -> '1.265E+7'
+dsbas242 toSci "1265E+8" -> '1.265E+11'
+dsbas243 toSci "1265E+20" -> '1.265E+23'
+
+dsbas250 toSci "0.1265" -> '0.1265'
+dsbas251 toSci "0.1265E-20" -> '1.265E-21'
+dsbas252 toSci "0.1265E-8" -> '1.265E-9'
+dsbas253 toSci "0.1265E-4" -> '0.00001265'
+dsbas254 toSci "0.1265E-3" -> '0.0001265'
+dsbas255 toSci "0.1265E-2" -> '0.001265'
+dsbas256 toSci "0.1265E-1" -> '0.01265'
+dsbas257 toSci "0.1265E-0" -> '0.1265'
+dsbas258 toSci "0.1265E+1" -> '1.265'
+dsbas259 toSci "0.1265E+2" -> '12.65'
+dsbas260 toSci "0.1265E+3" -> '126.5'
+dsbas261 toSci "0.1265E+4" -> '1265'
+dsbas262 toSci "0.1265E+8" -> '1.265E+7'
+dsbas263 toSci "0.1265E+20" -> '1.265E+19'
+
+-- some more negative zeros [systematic tests below]
+dsbas290 toSci "-0.000E-1" -> '-0.0000'
+dsbas291 toSci "-0.000E-2" -> '-0.00000'
+dsbas292 toSci "-0.000E-3" -> '-0.000000'
+dsbas293 toSci "-0.000E-4" -> '-0E-7'
+dsbas294 toSci "-0.00E-2" -> '-0.0000'
+dsbas295 toSci "-0.00E-3" -> '-0.00000'
+dsbas296 toSci "-0.0E-2" -> '-0.000'
+dsbas297 toSci "-0.0E-3" -> '-0.0000'
+dsbas298 toSci "-0E-2" -> '-0.00'
+dsbas299 toSci "-0E-3" -> '-0.000'
+
+-- Engineering notation tests
+dsbas301 toSci 10e12 -> 1.0E+13
+dsbas302 toEng 10e12 -> 10E+12
+dsbas303 toSci 10e11 -> 1.0E+12
+dsbas304 toEng 10e11 -> 1.0E+12
+dsbas305 toSci 10e10 -> 1.0E+11
+dsbas306 toEng 10e10 -> 100E+9
+dsbas307 toSci 10e9 -> 1.0E+10
+dsbas308 toEng 10e9 -> 10E+9
+dsbas309 toSci 10e8 -> 1.0E+9
+dsbas310 toEng 10e8 -> 1.0E+9
+dsbas311 toSci 10e7 -> 1.0E+8
+dsbas312 toEng 10e7 -> 100E+6
+dsbas313 toSci 10e6 -> 1.0E+7
+dsbas314 toEng 10e6 -> 10E+6
+dsbas315 toSci 10e5 -> 1.0E+6
+dsbas316 toEng 10e5 -> 1.0E+6
+dsbas317 toSci 10e4 -> 1.0E+5
+dsbas318 toEng 10e4 -> 100E+3
+dsbas319 toSci 10e3 -> 1.0E+4
+dsbas320 toEng 10e3 -> 10E+3
+dsbas321 toSci 10e2 -> 1.0E+3
+dsbas322 toEng 10e2 -> 1.0E+3
+dsbas323 toSci 10e1 -> 1.0E+2
+dsbas324 toEng 10e1 -> 100
+dsbas325 toSci 10e0 -> 10
+dsbas326 toEng 10e0 -> 10
+dsbas327 toSci 10e-1 -> 1.0
+dsbas328 toEng 10e-1 -> 1.0
+dsbas329 toSci 10e-2 -> 0.10
+dsbas330 toEng 10e-2 -> 0.10
+dsbas331 toSci 10e-3 -> 0.010
+dsbas332 toEng 10e-3 -> 0.010
+dsbas333 toSci 10e-4 -> 0.0010
+dsbas334 toEng 10e-4 -> 0.0010
+dsbas335 toSci 10e-5 -> 0.00010
+dsbas336 toEng 10e-5 -> 0.00010
+dsbas337 toSci 10e-6 -> 0.000010
+dsbas338 toEng 10e-6 -> 0.000010
+dsbas339 toSci 10e-7 -> 0.0000010
+dsbas340 toEng 10e-7 -> 0.0000010
+dsbas341 toSci 10e-8 -> 1.0E-7
+dsbas342 toEng 10e-8 -> 100E-9
+dsbas343 toSci 10e-9 -> 1.0E-8
+dsbas344 toEng 10e-9 -> 10E-9
+dsbas345 toSci 10e-10 -> 1.0E-9
+dsbas346 toEng 10e-10 -> 1.0E-9
+dsbas347 toSci 10e-11 -> 1.0E-10
+dsbas348 toEng 10e-11 -> 100E-12
+dsbas349 toSci 10e-12 -> 1.0E-11
+dsbas350 toEng 10e-12 -> 10E-12
+dsbas351 toSci 10e-13 -> 1.0E-12
+dsbas352 toEng 10e-13 -> 1.0E-12
+
+dsbas361 toSci 7E12 -> 7E+12
+dsbas362 toEng 7E12 -> 7E+12
+dsbas363 toSci 7E11 -> 7E+11
+dsbas364 toEng 7E11 -> 700E+9
+dsbas365 toSci 7E10 -> 7E+10
+dsbas366 toEng 7E10 -> 70E+9
+dsbas367 toSci 7E9 -> 7E+9
+dsbas368 toEng 7E9 -> 7E+9
+dsbas369 toSci 7E8 -> 7E+8
+dsbas370 toEng 7E8 -> 700E+6
+dsbas371 toSci 7E7 -> 7E+7
+dsbas372 toEng 7E7 -> 70E+6
+dsbas373 toSci 7E6 -> 7E+6
+dsbas374 toEng 7E6 -> 7E+6
+dsbas375 toSci 7E5 -> 7E+5
+dsbas376 toEng 7E5 -> 700E+3
+dsbas377 toSci 7E4 -> 7E+4
+dsbas378 toEng 7E4 -> 70E+3
+dsbas379 toSci 7E3 -> 7E+3
+dsbas380 toEng 7E3 -> 7E+3
+dsbas381 toSci 7E2 -> 7E+2
+dsbas382 toEng 7E2 -> 700
+dsbas383 toSci 7E1 -> 7E+1
+dsbas384 toEng 7E1 -> 70
+dsbas385 toSci 7E0 -> 7
+dsbas386 toEng 7E0 -> 7
+dsbas387 toSci 7E-1 -> 0.7
+dsbas388 toEng 7E-1 -> 0.7
+dsbas389 toSci 7E-2 -> 0.07
+dsbas390 toEng 7E-2 -> 0.07
+dsbas391 toSci 7E-3 -> 0.007
+dsbas392 toEng 7E-3 -> 0.007
+dsbas393 toSci 7E-4 -> 0.0007
+dsbas394 toEng 7E-4 -> 0.0007
+dsbas395 toSci 7E-5 -> 0.00007
+dsbas396 toEng 7E-5 -> 0.00007
+dsbas397 toSci 7E-6 -> 0.000007
+dsbas398 toEng 7E-6 -> 0.000007
+dsbas399 toSci 7E-7 -> 7E-7
+dsbas400 toEng 7E-7 -> 700E-9
+dsbas401 toSci 7E-8 -> 7E-8
+dsbas402 toEng 7E-8 -> 70E-9
+dsbas403 toSci 7E-9 -> 7E-9
+dsbas404 toEng 7E-9 -> 7E-9
+dsbas405 toSci 7E-10 -> 7E-10
+dsbas406 toEng 7E-10 -> 700E-12
+dsbas407 toSci 7E-11 -> 7E-11
+dsbas408 toEng 7E-11 -> 70E-12
+dsbas409 toSci 7E-12 -> 7E-12
+dsbas410 toEng 7E-12 -> 7E-12
+dsbas411 toSci 7E-13 -> 7E-13
+dsbas412 toEng 7E-13 -> 700E-15
+
+-- Exacts remain exact up to precision ..
+dsbas420 toSci 100 -> 100
+dsbas422 toSci 1000 -> 1000
+dsbas424 toSci 999.9 -> 999.9
+dsbas426 toSci 1000.0 -> 1000.0
+dsbas428 toSci 1000.1 -> 1000.1
+dsbas430 toSci 10000 -> 10000
+dsbas432 toSci 1000 -> 1000
+dsbas434 toSci 10000 -> 10000
+dsbas436 toSci 100000 -> 100000
+dsbas438 toSci 1000000 -> 1000000
+dsbas440 toSci 10000000 -> 1.000000E+7 Rounded
+dsbas442 toSci 10000000 -> 1.000000E+7 Rounded
+dsbas444 toSci 10000003 -> 1.000000E+7 Rounded Inexact
+dsbas446 toSci 10000005 -> 1.000000E+7 Rounded Inexact
+dsbas448 toSci 100000050 -> 1.000000E+8 Rounded Inexact
+dsbas450 toSci 10000009 -> 1.000001E+7 Rounded Inexact
+dsbas452 toSci 100000000 -> 1.000000E+8 Rounded
+dsbas454 toSci 100000003 -> 1.000000E+8 Rounded Inexact
+dsbas456 toSci 100000005 -> 1.000000E+8 Rounded Inexact
+dsbas458 toSci 100000009 -> 1.000000E+8 Rounded Inexact
+dsbas460 toSci 1000000000 -> 1.000000E+9 Rounded
+dsbas462 toSci 1000000300 -> 1.000000E+9 Rounded Inexact
+dsbas464 toSci 1000000500 -> 1.000000E+9 Rounded Inexact
+dsbas466 toSci 1000000900 -> 1.000001E+9 Rounded Inexact
+dsbas468 toSci 10000000000 -> 1.000000E+10 Rounded
+dsbas470 toSci 10000003000 -> 1.000000E+10 Rounded Inexact
+dsbas472 toSci 10000005000 -> 1.000000E+10 Rounded Inexact
+dsbas474 toSci 10000009000 -> 1.000001E+10 Rounded Inexact
+
+-- check rounding modes heeded
+rounding: ceiling
+dsbsr401 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr402 toSci 1.11234549 -> 1.112346 Rounded Inexact
+dsbsr403 toSci 1.11234550 -> 1.112346 Rounded Inexact
+dsbsr404 toSci 1.11234551 -> 1.112346 Rounded Inexact
+rounding: up
+dsbsr405 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr406 toSci 1.11234549 -> 1.112346 Rounded Inexact
+dsbsr407 toSci 1.11234550 -> 1.112346 Rounded Inexact
+dsbsr408 toSci 1.11234551 -> 1.112346 Rounded Inexact
+rounding: floor
+dsbsr410 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr411 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr412 toSci 1.11234550 -> 1.112345 Rounded Inexact
+dsbsr413 toSci 1.11234551 -> 1.112345 Rounded Inexact
+rounding: half_down
+dsbsr415 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr416 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr417 toSci 1.11234550 -> 1.112345 Rounded Inexact
+dsbsr418 toSci 1.11234650 -> 1.112346 Rounded Inexact
+dsbsr419 toSci 1.11234551 -> 1.112346 Rounded Inexact
+rounding: half_even
+dsbsr421 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr422 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr423 toSci 1.11234550 -> 1.112346 Rounded Inexact
+dsbsr424 toSci 1.11234650 -> 1.112346 Rounded Inexact
+dsbsr425 toSci 1.11234551 -> 1.112346 Rounded Inexact
+rounding: down
+dsbsr426 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr427 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr428 toSci 1.11234550 -> 1.112345 Rounded Inexact
+dsbsr429 toSci 1.11234551 -> 1.112345 Rounded Inexact
+rounding: half_up
+dsbsr431 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr432 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr433 toSci 1.11234550 -> 1.112346 Rounded Inexact
+dsbsr434 toSci 1.11234650 -> 1.112347 Rounded Inexact
+dsbsr435 toSci 1.11234551 -> 1.112346 Rounded Inexact
+-- negatives
+rounding: ceiling
+dsbsr501 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr502 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr503 toSci -1.11234550 -> -1.112345 Rounded Inexact
+dsbsr504 toSci -1.11234551 -> -1.112345 Rounded Inexact
+rounding: up
+dsbsr505 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr506 toSci -1.11234549 -> -1.112346 Rounded Inexact
+dsbsr507 toSci -1.11234550 -> -1.112346 Rounded Inexact
+dsbsr508 toSci -1.11234551 -> -1.112346 Rounded Inexact
+rounding: floor
+dsbsr510 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr511 toSci -1.11234549 -> -1.112346 Rounded Inexact
+dsbsr512 toSci -1.11234550 -> -1.112346 Rounded Inexact
+dsbsr513 toSci -1.11234551 -> -1.112346 Rounded Inexact
+rounding: half_down
+dsbsr515 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr516 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr517 toSci -1.11234550 -> -1.112345 Rounded Inexact
+dsbsr518 toSci -1.11234650 -> -1.112346 Rounded Inexact
+dsbsr519 toSci -1.11234551 -> -1.112346 Rounded Inexact
+rounding: half_even
+dsbsr521 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr522 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr523 toSci -1.11234550 -> -1.112346 Rounded Inexact
+dsbsr524 toSci -1.11234650 -> -1.112346 Rounded Inexact
+dsbsr525 toSci -1.11234551 -> -1.112346 Rounded Inexact
+rounding: down
+dsbsr526 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr527 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr528 toSci -1.11234550 -> -1.112345 Rounded Inexact
+dsbsr529 toSci -1.11234551 -> -1.112345 Rounded Inexact
+rounding: half_up
+dsbsr531 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr532 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr533 toSci -1.11234550 -> -1.112346 Rounded Inexact
+dsbsr534 toSci -1.11234650 -> -1.112347 Rounded Inexact
+dsbsr535 toSci -1.11234551 -> -1.112346 Rounded Inexact
+
+rounding: half_even
+
+-- The 'baddies' tests from DiagBigDecimal, plus some new ones
+dsbas500 toSci '1..2' -> NaN Conversion_syntax
+dsbas501 toSci '.' -> NaN Conversion_syntax
+dsbas502 toSci '..' -> NaN Conversion_syntax
+dsbas503 toSci '++1' -> NaN Conversion_syntax
+dsbas504 toSci '--1' -> NaN Conversion_syntax
+dsbas505 toSci '-+1' -> NaN Conversion_syntax
+dsbas506 toSci '+-1' -> NaN Conversion_syntax
+dsbas507 toSci '12e' -> NaN Conversion_syntax
+dsbas508 toSci '12e++' -> NaN Conversion_syntax
+dsbas509 toSci '12f4' -> NaN Conversion_syntax
+dsbas510 toSci ' +1' -> NaN Conversion_syntax
+dsbas511 toSci '+ 1' -> NaN Conversion_syntax
+dsbas512 toSci '12 ' -> NaN Conversion_syntax
+dsbas513 toSci ' + 1' -> NaN Conversion_syntax
+dsbas514 toSci ' - 1 ' -> NaN Conversion_syntax
+dsbas515 toSci 'x' -> NaN Conversion_syntax
+dsbas516 toSci '-1-' -> NaN Conversion_syntax
+dsbas517 toSci '12-' -> NaN Conversion_syntax
+dsbas518 toSci '3+' -> NaN Conversion_syntax
+dsbas519 toSci '' -> NaN Conversion_syntax
+dsbas520 toSci '1e-' -> NaN Conversion_syntax
+dsbas521 toSci '7e99999a' -> NaN Conversion_syntax
+dsbas522 toSci '7e123567890x' -> NaN Conversion_syntax
+dsbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
+dsbas524 toSci '' -> NaN Conversion_syntax
+dsbas525 toSci 'e100' -> NaN Conversion_syntax
+dsbas526 toSci '\u0e5a' -> NaN Conversion_syntax
+dsbas527 toSci '\u0b65' -> NaN Conversion_syntax
+dsbas528 toSci '123,65' -> NaN Conversion_syntax
+dsbas529 toSci '1.34.5' -> NaN Conversion_syntax
+dsbas530 toSci '.123.5' -> NaN Conversion_syntax
+dsbas531 toSci '01.35.' -> NaN Conversion_syntax
+dsbas532 toSci '01.35-' -> NaN Conversion_syntax
+dsbas533 toSci '0000..' -> NaN Conversion_syntax
+dsbas534 toSci '.0000.' -> NaN Conversion_syntax
+dsbas535 toSci '00..00' -> NaN Conversion_syntax
+dsbas536 toSci '111e*123' -> NaN Conversion_syntax
+dsbas537 toSci '111e123-' -> NaN Conversion_syntax
+dsbas538 toSci '111e+12+' -> NaN Conversion_syntax
+dsbas539 toSci '111e1-3-' -> NaN Conversion_syntax
+dsbas540 toSci '111e1*23' -> NaN Conversion_syntax
+dsbas541 toSci '111e1e+3' -> NaN Conversion_syntax
+dsbas542 toSci '1e1.0' -> NaN Conversion_syntax
+dsbas543 toSci '1e123e' -> NaN Conversion_syntax
+dsbas544 toSci 'ten' -> NaN Conversion_syntax
+dsbas545 toSci 'ONE' -> NaN Conversion_syntax
+dsbas546 toSci '1e.1' -> NaN Conversion_syntax
+dsbas547 toSci '1e1.' -> NaN Conversion_syntax
+dsbas548 toSci '1ee' -> NaN Conversion_syntax
+dsbas549 toSci 'e+1' -> NaN Conversion_syntax
+dsbas550 toSci '1.23.4' -> NaN Conversion_syntax
+dsbas551 toSci '1.2.1' -> NaN Conversion_syntax
+dsbas552 toSci '1E+1.2' -> NaN Conversion_syntax
+dsbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
+dsbas554 toSci '1E++1' -> NaN Conversion_syntax
+dsbas555 toSci '1E--1' -> NaN Conversion_syntax
+dsbas556 toSci '1E+-1' -> NaN Conversion_syntax
+dsbas557 toSci '1E-+1' -> NaN Conversion_syntax
+dsbas558 toSci '1E''1' -> NaN Conversion_syntax
+dsbas559 toSci "1E""1" -> NaN Conversion_syntax
+dsbas560 toSci "1E""""" -> NaN Conversion_syntax
+-- Near-specials
+dsbas561 toSci "qNaN" -> NaN Conversion_syntax
+dsbas562 toSci "NaNq" -> NaN Conversion_syntax
+dsbas563 toSci "NaNs" -> NaN Conversion_syntax
+dsbas564 toSci "Infi" -> NaN Conversion_syntax
+dsbas565 toSci "Infin" -> NaN Conversion_syntax
+dsbas566 toSci "Infini" -> NaN Conversion_syntax
+dsbas567 toSci "Infinit" -> NaN Conversion_syntax
+dsbas568 toSci "-Infinit" -> NaN Conversion_syntax
+dsbas569 toSci "0Inf" -> NaN Conversion_syntax
+dsbas570 toSci "9Inf" -> NaN Conversion_syntax
+dsbas571 toSci "-0Inf" -> NaN Conversion_syntax
+dsbas572 toSci "-9Inf" -> NaN Conversion_syntax
+dsbas573 toSci "-sNa" -> NaN Conversion_syntax
+dsbas574 toSci "xNaN" -> NaN Conversion_syntax
+dsbas575 toSci "0sNaN" -> NaN Conversion_syntax
+
+-- some baddies with dots and Es and dots and specials
+dsbas576 toSci 'e+1' -> NaN Conversion_syntax
+dsbas577 toSci '.e+1' -> NaN Conversion_syntax
+dsbas578 toSci '+.e+1' -> NaN Conversion_syntax
+dsbas579 toSci '-.e+' -> NaN Conversion_syntax
+dsbas580 toSci '-.e' -> NaN Conversion_syntax
+dsbas581 toSci 'E+1' -> NaN Conversion_syntax
+dsbas582 toSci '.E+1' -> NaN Conversion_syntax
+dsbas583 toSci '+.E+1' -> NaN Conversion_syntax
+dsbas584 toSci '-.E+' -> NaN Conversion_syntax
+dsbas585 toSci '-.E' -> NaN Conversion_syntax
+
+dsbas586 toSci '.NaN' -> NaN Conversion_syntax
+dsbas587 toSci '-.NaN' -> NaN Conversion_syntax
+dsbas588 toSci '+.sNaN' -> NaN Conversion_syntax
+dsbas589 toSci '+.Inf' -> NaN Conversion_syntax
+dsbas590 toSci '.Infinity' -> NaN Conversion_syntax
+
+-- Zeros
+dsbas601 toSci 0.000000000 -> 0E-9
+dsbas602 toSci 0.00000000 -> 0E-8
+dsbas603 toSci 0.0000000 -> 0E-7
+dsbas604 toSci 0.000000 -> 0.000000
+dsbas605 toSci 0.00000 -> 0.00000
+dsbas606 toSci 0.0000 -> 0.0000
+dsbas607 toSci 0.000 -> 0.000
+dsbas608 toSci 0.00 -> 0.00
+dsbas609 toSci 0.0 -> 0.0
+dsbas610 toSci .0 -> 0.0
+dsbas611 toSci 0. -> 0
+dsbas612 toSci -.0 -> -0.0
+dsbas613 toSci -0. -> -0
+dsbas614 toSci -0.0 -> -0.0
+dsbas615 toSci -0.00 -> -0.00
+dsbas616 toSci -0.000 -> -0.000
+dsbas617 toSci -0.0000 -> -0.0000
+dsbas618 toSci -0.00000 -> -0.00000
+dsbas619 toSci -0.000000 -> -0.000000
+dsbas620 toSci -0.0000000 -> -0E-7
+dsbas621 toSci -0.00000000 -> -0E-8
+dsbas622 toSci -0.000000000 -> -0E-9
+
+dsbas630 toSci 0.00E+0 -> 0.00
+dsbas631 toSci 0.00E+1 -> 0.0
+dsbas632 toSci 0.00E+2 -> 0
+dsbas633 toSci 0.00E+3 -> 0E+1
+dsbas634 toSci 0.00E+4 -> 0E+2
+dsbas635 toSci 0.00E+5 -> 0E+3
+dsbas636 toSci 0.00E+6 -> 0E+4
+dsbas637 toSci 0.00E+7 -> 0E+5
+dsbas638 toSci 0.00E+8 -> 0E+6
+dsbas639 toSci 0.00E+9 -> 0E+7
+
+dsbas640 toSci 0.0E+0 -> 0.0
+dsbas641 toSci 0.0E+1 -> 0
+dsbas642 toSci 0.0E+2 -> 0E+1
+dsbas643 toSci 0.0E+3 -> 0E+2
+dsbas644 toSci 0.0E+4 -> 0E+3
+dsbas645 toSci 0.0E+5 -> 0E+4
+dsbas646 toSci 0.0E+6 -> 0E+5
+dsbas647 toSci 0.0E+7 -> 0E+6
+dsbas648 toSci 0.0E+8 -> 0E+7
+dsbas649 toSci 0.0E+9 -> 0E+8
+
+dsbas650 toSci 0E+0 -> 0
+dsbas651 toSci 0E+1 -> 0E+1
+dsbas652 toSci 0E+2 -> 0E+2
+dsbas653 toSci 0E+3 -> 0E+3
+dsbas654 toSci 0E+4 -> 0E+4
+dsbas655 toSci 0E+5 -> 0E+5
+dsbas656 toSci 0E+6 -> 0E+6
+dsbas657 toSci 0E+7 -> 0E+7
+dsbas658 toSci 0E+8 -> 0E+8
+dsbas659 toSci 0E+9 -> 0E+9
+
+dsbas660 toSci 0.0E-0 -> 0.0
+dsbas661 toSci 0.0E-1 -> 0.00
+dsbas662 toSci 0.0E-2 -> 0.000
+dsbas663 toSci 0.0E-3 -> 0.0000
+dsbas664 toSci 0.0E-4 -> 0.00000
+dsbas665 toSci 0.0E-5 -> 0.000000
+dsbas666 toSci 0.0E-6 -> 0E-7
+dsbas667 toSci 0.0E-7 -> 0E-8
+dsbas668 toSci 0.0E-8 -> 0E-9
+dsbas669 toSci 0.0E-9 -> 0E-10
+
+dsbas670 toSci 0.00E-0 -> 0.00
+dsbas671 toSci 0.00E-1 -> 0.000
+dsbas672 toSci 0.00E-2 -> 0.0000
+dsbas673 toSci 0.00E-3 -> 0.00000
+dsbas674 toSci 0.00E-4 -> 0.000000
+dsbas675 toSci 0.00E-5 -> 0E-7
+dsbas676 toSci 0.00E-6 -> 0E-8
+dsbas677 toSci 0.00E-7 -> 0E-9
+dsbas678 toSci 0.00E-8 -> 0E-10
+dsbas679 toSci 0.00E-9 -> 0E-11
+
+dsbas680 toSci 000000. -> 0
+dsbas681 toSci 00000. -> 0
+dsbas682 toSci 0000. -> 0
+dsbas683 toSci 000. -> 0
+dsbas684 toSci 00. -> 0
+dsbas685 toSci 0. -> 0
+dsbas686 toSci +00000. -> 0
+dsbas687 toSci -00000. -> -0
+dsbas688 toSci +0. -> 0
+dsbas689 toSci -0. -> -0
+
+-- Specials
+dsbas700 toSci "NaN" -> NaN
+dsbas701 toSci "nan" -> NaN
+dsbas702 toSci "nAn" -> NaN
+dsbas703 toSci "NAN" -> NaN
+dsbas704 toSci "+NaN" -> NaN
+dsbas705 toSci "+nan" -> NaN
+dsbas706 toSci "+nAn" -> NaN
+dsbas707 toSci "+NAN" -> NaN
+dsbas708 toSci "-NaN" -> -NaN
+dsbas709 toSci "-nan" -> -NaN
+dsbas710 toSci "-nAn" -> -NaN
+dsbas711 toSci "-NAN" -> -NaN
+dsbas712 toSci 'NaN0' -> NaN
+dsbas713 toSci 'NaN1' -> NaN1
+dsbas714 toSci 'NaN12' -> NaN12
+dsbas715 toSci 'NaN123' -> NaN123
+dsbas716 toSci 'NaN1234' -> NaN1234
+dsbas717 toSci 'NaN01' -> NaN1
+dsbas718 toSci 'NaN012' -> NaN12
+dsbas719 toSci 'NaN0123' -> NaN123
+dsbas720 toSci 'NaN01234' -> NaN1234
+dsbas721 toSci 'NaN001' -> NaN1
+dsbas722 toSci 'NaN0012' -> NaN12
+dsbas723 toSci 'NaN00123' -> NaN123
+dsbas724 toSci 'NaN001234' -> NaN1234
+dsbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax
+dsbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
+dsbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
+dsbas728 toSci 'NaN-12' -> NaN Conversion_syntax
+dsbas729 toSci 'NaN+12' -> NaN Conversion_syntax
+
+dsbas730 toSci "sNaN" -> sNaN
+dsbas731 toSci "snan" -> sNaN
+dsbas732 toSci "SnAn" -> sNaN
+dsbas733 toSci "SNAN" -> sNaN
+dsbas734 toSci "+sNaN" -> sNaN
+dsbas735 toSci "+snan" -> sNaN
+dsbas736 toSci "+SnAn" -> sNaN
+dsbas737 toSci "+SNAN" -> sNaN
+dsbas738 toSci "-sNaN" -> -sNaN
+dsbas739 toSci "-snan" -> -sNaN
+dsbas740 toSci "-SnAn" -> -sNaN
+dsbas741 toSci "-SNAN" -> -sNaN
+dsbas742 toSci 'sNaN0000' -> sNaN
+dsbas743 toSci 'sNaN7' -> sNaN7
+dsbas744 toSci 'sNaN007234' -> sNaN7234
+dsbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax
+dsbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
+dsbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
+
+dsbas748 toSci "Inf" -> Infinity
+dsbas749 toSci "inf" -> Infinity
+dsbas750 toSci "iNf" -> Infinity
+dsbas751 toSci "INF" -> Infinity
+dsbas752 toSci "+Inf" -> Infinity
+dsbas753 toSci "+inf" -> Infinity
+dsbas754 toSci "+iNf" -> Infinity
+dsbas755 toSci "+INF" -> Infinity
+dsbas756 toSci "-Inf" -> -Infinity
+dsbas757 toSci "-inf" -> -Infinity
+dsbas758 toSci "-iNf" -> -Infinity
+dsbas759 toSci "-INF" -> -Infinity
+
+dsbas760 toSci "Infinity" -> Infinity
+dsbas761 toSci "infinity" -> Infinity
+dsbas762 toSci "iNfInItY" -> Infinity
+dsbas763 toSci "INFINITY" -> Infinity
+dsbas764 toSci "+Infinity" -> Infinity
+dsbas765 toSci "+infinity" -> Infinity
+dsbas766 toSci "+iNfInItY" -> Infinity
+dsbas767 toSci "+INFINITY" -> Infinity
+dsbas768 toSci "-Infinity" -> -Infinity
+dsbas769 toSci "-infinity" -> -Infinity
+dsbas770 toSci "-iNfInItY" -> -Infinity
+dsbas771 toSci "-INFINITY" -> -Infinity
+
+-- Specials and zeros for toEng
+dsbast772 toEng "NaN" -> NaN
+dsbast773 toEng "-Infinity" -> -Infinity
+dsbast774 toEng "-sNaN" -> -sNaN
+dsbast775 toEng "-NaN" -> -NaN
+dsbast776 toEng "+Infinity" -> Infinity
+dsbast778 toEng "+sNaN" -> sNaN
+dsbast779 toEng "+NaN" -> NaN
+dsbast780 toEng "INFINITY" -> Infinity
+dsbast781 toEng "SNAN" -> sNaN
+dsbast782 toEng "NAN" -> NaN
+dsbast783 toEng "infinity" -> Infinity
+dsbast784 toEng "snan" -> sNaN
+dsbast785 toEng "nan" -> NaN
+dsbast786 toEng "InFINITY" -> Infinity
+dsbast787 toEng "SnAN" -> sNaN
+dsbast788 toEng "nAN" -> NaN
+dsbast789 toEng "iNfinity" -> Infinity
+dsbast790 toEng "sNan" -> sNaN
+dsbast791 toEng "Nan" -> NaN
+dsbast792 toEng "Infinity" -> Infinity
+dsbast793 toEng "sNaN" -> sNaN
+
+-- Zero toEng, etc.
+dsbast800 toEng 0e+1 -> "0.00E+3" -- doc example
+
+dsbast801 toEng 0.000000000 -> 0E-9
+dsbast802 toEng 0.00000000 -> 0.00E-6
+dsbast803 toEng 0.0000000 -> 0.0E-6
+dsbast804 toEng 0.000000 -> 0.000000
+dsbast805 toEng 0.00000 -> 0.00000
+dsbast806 toEng 0.0000 -> 0.0000
+dsbast807 toEng 0.000 -> 0.000
+dsbast808 toEng 0.00 -> 0.00
+dsbast809 toEng 0.0 -> 0.0
+dsbast810 toEng .0 -> 0.0
+dsbast811 toEng 0. -> 0
+dsbast812 toEng -.0 -> -0.0
+dsbast813 toEng -0. -> -0
+dsbast814 toEng -0.0 -> -0.0
+dsbast815 toEng -0.00 -> -0.00
+dsbast816 toEng -0.000 -> -0.000
+dsbast817 toEng -0.0000 -> -0.0000
+dsbast818 toEng -0.00000 -> -0.00000
+dsbast819 toEng -0.000000 -> -0.000000
+dsbast820 toEng -0.0000000 -> -0.0E-6
+dsbast821 toEng -0.00000000 -> -0.00E-6
+dsbast822 toEng -0.000000000 -> -0E-9
+
+dsbast830 toEng 0.00E+0 -> 0.00
+dsbast831 toEng 0.00E+1 -> 0.0
+dsbast832 toEng 0.00E+2 -> 0
+dsbast833 toEng 0.00E+3 -> 0.00E+3
+dsbast834 toEng 0.00E+4 -> 0.0E+3
+dsbast835 toEng 0.00E+5 -> 0E+3
+dsbast836 toEng 0.00E+6 -> 0.00E+6
+dsbast837 toEng 0.00E+7 -> 0.0E+6
+dsbast838 toEng 0.00E+8 -> 0E+6
+dsbast839 toEng 0.00E+9 -> 0.00E+9
+
+dsbast840 toEng 0.0E+0 -> 0.0
+dsbast841 toEng 0.0E+1 -> 0
+dsbast842 toEng 0.0E+2 -> 0.00E+3
+dsbast843 toEng 0.0E+3 -> 0.0E+3
+dsbast844 toEng 0.0E+4 -> 0E+3
+dsbast845 toEng 0.0E+5 -> 0.00E+6
+dsbast846 toEng 0.0E+6 -> 0.0E+6
+dsbast847 toEng 0.0E+7 -> 0E+6
+dsbast848 toEng 0.0E+8 -> 0.00E+9
+dsbast849 toEng 0.0E+9 -> 0.0E+9
+
+dsbast850 toEng 0E+0 -> 0
+dsbast851 toEng 0E+1 -> 0.00E+3
+dsbast852 toEng 0E+2 -> 0.0E+3
+dsbast853 toEng 0E+3 -> 0E+3
+dsbast854 toEng 0E+4 -> 0.00E+6
+dsbast855 toEng 0E+5 -> 0.0E+6
+dsbast856 toEng 0E+6 -> 0E+6
+dsbast857 toEng 0E+7 -> 0.00E+9
+dsbast858 toEng 0E+8 -> 0.0E+9
+dsbast859 toEng 0E+9 -> 0E+9
+
+dsbast860 toEng 0.0E-0 -> 0.0
+dsbast861 toEng 0.0E-1 -> 0.00
+dsbast862 toEng 0.0E-2 -> 0.000
+dsbast863 toEng 0.0E-3 -> 0.0000
+dsbast864 toEng 0.0E-4 -> 0.00000
+dsbast865 toEng 0.0E-5 -> 0.000000
+dsbast866 toEng 0.0E-6 -> 0.0E-6
+dsbast867 toEng 0.0E-7 -> 0.00E-6
+dsbast868 toEng 0.0E-8 -> 0E-9
+dsbast869 toEng 0.0E-9 -> 0.0E-9
+
+dsbast870 toEng 0.00E-0 -> 0.00
+dsbast871 toEng 0.00E-1 -> 0.000
+dsbast872 toEng 0.00E-2 -> 0.0000
+dsbast873 toEng 0.00E-3 -> 0.00000
+dsbast874 toEng 0.00E-4 -> 0.000000
+dsbast875 toEng 0.00E-5 -> 0.0E-6
+dsbast876 toEng 0.00E-6 -> 0.00E-6
+dsbast877 toEng 0.00E-7 -> 0E-9
+dsbast878 toEng 0.00E-8 -> 0.0E-9
+dsbast879 toEng 0.00E-9 -> 0.00E-9
+
+-- long input strings
+dsbas801 tosci '01234567' -> 1234567
+dsbas802 tosci '001234567' -> 1234567
+dsbas803 tosci '0001234567' -> 1234567
+dsbas804 tosci '00001234567' -> 1234567
+dsbas805 tosci '000001234567' -> 1234567
+dsbas806 tosci '0000001234567' -> 1234567
+dsbas807 tosci '00000001234567' -> 1234567
+dsbas808 tosci '000000001234567' -> 1234567
+dsbas809 tosci '0000000001234567' -> 1234567
+dsbas810 tosci '00000000001234567' -> 1234567
+
+dsbas811 tosci '0.1234567' -> 0.1234567
+dsbas812 tosci '0.01234567' -> 0.01234567
+dsbas813 tosci '0.001234567' -> 0.001234567
+dsbas814 tosci '0.0001234567' -> 0.0001234567
+dsbas815 tosci '0.00001234567' -> 0.00001234567
+dsbas816 tosci '0.000001234567' -> 0.000001234567
+dsbas817 tosci '0.0000001234567' -> 1.234567E-7
+dsbas818 tosci '0.00000001234567' -> 1.234567E-8
+dsbas819 tosci '0.000000001234567' -> 1.234567E-9
+dsbas820 tosci '0.0000000001234567' -> 1.234567E-10
+
+dsbas821 tosci '123456790' -> 1.234568E+8 Inexact Rounded
+dsbas822 tosci '1234567901' -> 1.234568E+9 Inexact Rounded
+dsbas823 tosci '12345679012' -> 1.234568E+10 Inexact Rounded
+dsbas824 tosci '123456790123' -> 1.234568E+11 Inexact Rounded
+dsbas825 tosci '1234567901234' -> 1.234568E+12 Inexact Rounded
+dsbas826 tosci '12345679012345' -> 1.234568E+13 Inexact Rounded
+dsbas827 tosci '123456790123456' -> 1.234568E+14 Inexact Rounded
+dsbas828 tosci '1234567901234567' -> 1.234568E+15 Inexact Rounded
+dsbas829 tosci '1234567890123456' -> 1.234568E+15 Inexact Rounded
+
+-- subnormals and overflows
+dsbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
+dsbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
+dsbas908 toSci '0.9e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas909 toSci '0.09e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
+dsbas911 toSci '10e-1000000000' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
+dsbas913 toSci '99e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
+dsbas915 toSci '1111e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas916 toSci '1111e-99999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
+-- negatives the same
+dsbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
+dsbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
+dsbas920 toSci '-0.9e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas921 toSci '-0.09e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
+dsbas923 toSci '-10e-1000000000' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
+dsbas925 toSci '-99e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
+dsbas927 toSci '-1111e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas928 toSci '-1111e-99999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
+
+-- overflow results at different rounding modes
+rounding: ceiling
+dsbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas931 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded
+rounding: up
+dsbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: down
+dsbas934 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded
+dsbas935 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded
+rounding: floor
+dsbas936 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded
+dsbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_up
+dsbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_even
+dsbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_down
+dsbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_even
+
+-- Now check 854/754r some subnormals and underflow to 0
+dsbem400 toSci 1.0000E-86 -> 1.0000E-86
+dsbem401 toSci 0.1E-97 -> 1E-98 Subnormal
+dsbem402 toSci 0.1000E-97 -> 1.000E-98 Subnormal
+dsbem403 toSci 0.0100E-97 -> 1.00E-99 Subnormal
+dsbem404 toSci 0.0010E-97 -> 1.0E-100 Subnormal
+dsbem405 toSci 0.0001E-97 -> 1E-101 Subnormal
+dsbem406 toSci 0.00010E-97 -> 1E-101 Subnormal Rounded
+dsbem407 toSci 0.00013E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
+dsbem408 toSci 0.00015E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem409 toSci 0.00017E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem410 toSci 0.00023E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem411 toSci 0.00025E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem412 toSci 0.00027E-97 -> 3E-101 Underflow Subnormal Inexact Rounded
+dsbem413 toSci 0.000149E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
+dsbem414 toSci 0.000150E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem415 toSci 0.000151E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem416 toSci 0.000249E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem417 toSci 0.000250E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem418 toSci 0.000251E-97 -> 3E-101 Underflow Subnormal Inexact Rounded
+dsbem419 toSci 0.00009E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
+dsbem420 toSci 0.00005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem421 toSci 0.00003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem422 toSci 0.000009E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem423 toSci 0.000005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem424 toSci 0.000003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+
+dsbem425 toSci 0.001049E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
+dsbem426 toSci 0.001050E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
+dsbem427 toSci 0.001051E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded
+dsbem428 toSci 0.001149E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded
+dsbem429 toSci 0.001150E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded
+dsbem430 toSci 0.001151E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded
+
+dsbem432 toSci 0.010049E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
+dsbem433 toSci 0.010050E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
+dsbem434 toSci 0.010051E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded
+dsbem435 toSci 0.010149E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded
+dsbem436 toSci 0.010150E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded
+dsbem437 toSci 0.010151E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded
+
+dsbem440 toSci 0.10103E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded
+dsbem441 toSci 0.10105E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded
+dsbem442 toSci 0.10107E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded
+dsbem443 toSci 0.10113E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded
+dsbem444 toSci 0.10115E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded
+dsbem445 toSci 0.10117E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded
+
+dsbem450 toSci 1.10730E-98 -> 1.107E-98 Underflow Subnormal Inexact Rounded
+dsbem451 toSci 1.10750E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
+dsbem452 toSci 1.10770E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
+dsbem453 toSci 1.10830E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
+dsbem454 toSci 1.10850E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
+dsbem455 toSci 1.10870E-98 -> 1.109E-98 Underflow Subnormal Inexact Rounded
+
+-- make sure sign OK
+dsbem456 toSci -0.10103E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded
+dsbem457 toSci -0.10105E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded
+dsbem458 toSci -0.10107E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded
+dsbem459 toSci -0.10113E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded
+dsbem460 toSci -0.10115E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded
+dsbem461 toSci -0.10117E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded
+
+-- '999s' cases
+dsbem464 toSci 999999E-98 -> 9.99999E-93
+dsbem465 toSci 99999.0E-97 -> 9.99990E-93
+dsbem466 toSci 99999.E-97 -> 9.9999E-93
+dsbem467 toSci 9999.9E-97 -> 9.9999E-94
+dsbem468 toSci 999.99E-97 -> 9.9999E-95
+dsbem469 toSci 99.999E-97 -> 9.9999E-96 Subnormal
+dsbem470 toSci 9.9999E-97 -> 9.9999E-97 Subnormal
+dsbem471 toSci 0.99999E-97 -> 1.0000E-97 Underflow Subnormal Inexact Rounded
+dsbem472 toSci 0.099999E-97 -> 1.000E-98 Underflow Subnormal Inexact Rounded
+dsbem473 toSci 0.0099999E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
+dsbem474 toSci 0.00099999E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
+dsbem475 toSci 0.000099999E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
+dsbem476 toSci 0.0000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem477 toSci 0.00000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem478 toSci 0.000000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+
+-- Exponents with insignificant leading zeros
+dsbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
+dsbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
+dsbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
+dsbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
+dsbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
+dsbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
+dsbas1007 toSci 1e-999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1008 toSci 1e-0999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1009 toSci 1e-00999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1010 toSci 1e-000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1011 toSci 1e-000000000000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1012 toSci 1e-000000000001000000007 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+
+-- check for double-rounded subnormals
+dsbas1041 toSci 1.1152444E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
+dsbas1042 toSci 1.1152445E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
+dsbas1043 toSci 1.1152446E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
+
+-- clamped zeros [see also clamp.decTest]
+dsbas1075 toSci 0e+10000 -> 0E+90 Clamped
+dsbas1076 toSci 0e-10000 -> 0E-101 Clamped
+dsbas1077 toSci -0e+10000 -> -0E+90 Clamped
+dsbas1078 toSci -0e-10000 -> -0E-101 Clamped
+
+-- extreme values from next-wider
+dsbas1101 toSci -9.999999999999999E+384 -> -Infinity Overflow Inexact Rounded
+dsbas1102 toSci -1E-383 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped
+dsbas1103 toSci -1E-398 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped
+dsbas1104 toSci -0 -> -0
+dsbas1105 toSci +0 -> 0
+dsbas1106 toSci +1E-398 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped
+dsbas1107 toSci +1E-383 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped
+dsbas1108 toSci +9.999999999999999E+384 -> Infinity Overflow Inexact Rounded
+
+-- narrowing case
+dsbas1110 toSci 2.000000000000000E-99 -> 2.00E-99 Rounded Subnormal
diff --git a/Lib/test/decimaltestdata/dsEncode.decTest b/Lib/test/decimaltestdata/dsEncode.decTest
index 818578b179..7264748759 100644
--- a/Lib/test/decimaltestdata/dsEncode.decTest
+++ b/Lib/test/decimaltestdata/dsEncode.decTest
@@ -1,372 +1,372 @@
-------------------------------------------------------------------------
--- dsEncode.decTest -- decimal four-byte format testcases --
--- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
--- [Previously called decimal32.decTest]
-version: 2.59
-
--- This set of tests is for the four-byte concrete representation.
--- Its characteristics are:
---
--- 1 bit sign
--- 5 bits combination field
--- 6 bits exponent continuation
--- 20 bits coefficient continuation
---
--- Total exponent length 8 bits
--- Total coefficient length 24 bits (7 digits)
---
--- Elimit = 191 (maximum encoded exponent)
--- Emax = 96 (largest exponent value)
--- Emin = -95 (smallest exponent value)
--- bias = 101 (subtracted from encoded exponent) = -Etiny
-
--- The testcases here have only exactly representable data on the
--- 'left-hand-side'; rounding from strings is tested in 'base'
--- testcase groups.
-
-extended: 1
-clamp: 1
-precision: 7
-rounding: half_up
-maxExponent: 96
-minExponent: -95
-
--- General testcases
--- (mostly derived from the Strawman 4 document and examples)
-decs001 apply #A23003D0 -> -7.50
-decs002 apply -7.50 -> #A23003D0
--- derivative canonical plain strings
-decs003 apply #A26003D0 -> -7.50E+3
-decs004 apply -7.50E+3 -> #A26003D0
-decs005 apply #A25003D0 -> -750
-decs006 apply -750 -> #A25003D0
-decs007 apply #A24003D0 -> -75.0
-decs008 apply -75.0 -> #A24003D0
-decs009 apply #A22003D0 -> -0.750
-decs010 apply -0.750 -> #A22003D0
-decs011 apply #A21003D0 -> -0.0750
-decs012 apply -0.0750 -> #A21003D0
-decs013 apply #A1f003D0 -> -0.000750
-decs014 apply -0.000750 -> #A1f003D0
-decs015 apply #A1d003D0 -> -0.00000750
-decs016 apply -0.00000750 -> #A1d003D0
-decs017 apply #A1c003D0 -> -7.50E-7
-decs018 apply -7.50E-7 -> #A1c003D0
-
--- Normality
-decs020 apply 1234567 -> #2654d2e7
-decs021 apply -1234567 -> #a654d2e7
-decs022 apply 1111111 -> #26524491
-
--- Nmax and similar
-decs031 apply 9.999999E+96 -> #77f3fcff
-decs032 apply #77f3fcff -> 9.999999E+96
-decs033 apply 1.234567E+96 -> #47f4d2e7
-decs034 apply #47f4d2e7 -> 1.234567E+96
--- fold-downs (more below)
-decs035 apply 1.23E+96 -> #47f4c000 Clamped
-decs036 apply #47f4c000 -> 1.230000E+96
-decs037 apply 1E+96 -> #47f00000 Clamped
-decs038 apply #47f00000 -> 1.000000E+96
-
-decs051 apply 12345 -> #225049c5
-decs052 apply #225049c5 -> 12345
-decs053 apply 1234 -> #22500534
-decs054 apply #22500534 -> 1234
-decs055 apply 123 -> #225000a3
-decs056 apply #225000a3 -> 123
-decs057 apply 12 -> #22500012
-decs058 apply #22500012 -> 12
-decs059 apply 1 -> #22500001
-decs060 apply #22500001 -> 1
-decs061 apply 1.23 -> #223000a3
-decs062 apply #223000a3 -> 1.23
-decs063 apply 123.45 -> #223049c5
-decs064 apply #223049c5 -> 123.45
-
--- Nmin and below
-decs071 apply 1E-95 -> #00600001
-decs072 apply #00600001 -> 1E-95
-decs073 apply 1.000000E-95 -> #04000000
-decs074 apply #04000000 -> 1.000000E-95
-decs075 apply 1.000001E-95 -> #04000001
-decs076 apply #04000001 -> 1.000001E-95
-
-decs077 apply 0.100000E-95 -> #00020000 Subnormal
-decs07x apply 1.00000E-96 -> 1.00000E-96 Subnormal
-decs078 apply #00020000 -> 1.00000E-96 Subnormal
-decs079 apply 0.000010E-95 -> #00000010 Subnormal
-decs080 apply #00000010 -> 1.0E-100 Subnormal
-decs081 apply 0.000001E-95 -> #00000001 Subnormal
-decs082 apply #00000001 -> 1E-101 Subnormal
-decs083 apply 1e-101 -> #00000001 Subnormal
-decs084 apply #00000001 -> 1E-101 Subnormal
-decs08x apply 1e-101 -> 1E-101 Subnormal
-
--- underflows cannot be tested; just check edge case
-decs090 apply 1e-101 -> #00000001 Subnormal
-
--- same again, negatives --
-
--- Nmax and similar
-decs122 apply -9.999999E+96 -> #f7f3fcff
-decs123 apply #f7f3fcff -> -9.999999E+96
-decs124 apply -1.234567E+96 -> #c7f4d2e7
-decs125 apply #c7f4d2e7 -> -1.234567E+96
--- fold-downs (more below)
-decs130 apply -1.23E+96 -> #c7f4c000 Clamped
-decs131 apply #c7f4c000 -> -1.230000E+96
-decs132 apply -1E+96 -> #c7f00000 Clamped
-decs133 apply #c7f00000 -> -1.000000E+96
-
-decs151 apply -12345 -> #a25049c5
-decs152 apply #a25049c5 -> -12345
-decs153 apply -1234 -> #a2500534
-decs154 apply #a2500534 -> -1234
-decs155 apply -123 -> #a25000a3
-decs156 apply #a25000a3 -> -123
-decs157 apply -12 -> #a2500012
-decs158 apply #a2500012 -> -12
-decs159 apply -1 -> #a2500001
-decs160 apply #a2500001 -> -1
-decs161 apply -1.23 -> #a23000a3
-decs162 apply #a23000a3 -> -1.23
-decs163 apply -123.45 -> #a23049c5
-decs164 apply #a23049c5 -> -123.45
-
--- Nmin and below
-decs171 apply -1E-95 -> #80600001
-decs172 apply #80600001 -> -1E-95
-decs173 apply -1.000000E-95 -> #84000000
-decs174 apply #84000000 -> -1.000000E-95
-decs175 apply -1.000001E-95 -> #84000001
-decs176 apply #84000001 -> -1.000001E-95
-
-decs177 apply -0.100000E-95 -> #80020000 Subnormal
-decs178 apply #80020000 -> -1.00000E-96 Subnormal
-decs179 apply -0.000010E-95 -> #80000010 Subnormal
-decs180 apply #80000010 -> -1.0E-100 Subnormal
-decs181 apply -0.000001E-95 -> #80000001 Subnormal
-decs182 apply #80000001 -> -1E-101 Subnormal
-decs183 apply -1e-101 -> #80000001 Subnormal
-decs184 apply #80000001 -> -1E-101 Subnormal
-
--- underflow edge case
-decs190 apply -1e-101 -> #80000001 Subnormal
-
--- zeros
-decs400 apply 0E-400 -> #00000000 Clamped
-decs401 apply 0E-101 -> #00000000
-decs402 apply #00000000 -> 0E-101
-decs403 apply 0.000000E-95 -> #00000000
-decs404 apply #00000000 -> 0E-101
-decs405 apply 0E-2 -> #22300000
-decs406 apply #22300000 -> 0.00
-decs407 apply 0 -> #22500000
-decs408 apply #22500000 -> 0
-decs409 apply 0E+3 -> #22800000
-decs410 apply #22800000 -> 0E+3
-decs411 apply 0E+90 -> #43f00000
-decs412 apply #43f00000 -> 0E+90
--- clamped zeros...
-decs413 apply 0E+91 -> #43f00000 Clamped
-decs414 apply #43f00000 -> 0E+90
-decs415 apply 0E+96 -> #43f00000 Clamped
-decs416 apply #43f00000 -> 0E+90
-decs417 apply 0E+400 -> #43f00000 Clamped
-decs418 apply #43f00000 -> 0E+90
-
--- negative zeros
-decs420 apply -0E-400 -> #80000000 Clamped
-decs421 apply -0E-101 -> #80000000
-decs422 apply #80000000 -> -0E-101
-decs423 apply -0.000000E-95 -> #80000000
-decs424 apply #80000000 -> -0E-101
-decs425 apply -0E-2 -> #a2300000
-decs426 apply #a2300000 -> -0.00
-decs427 apply -0 -> #a2500000
-decs428 apply #a2500000 -> -0
-decs429 apply -0E+3 -> #a2800000
-decs430 apply #a2800000 -> -0E+3
-decs431 apply -0E+90 -> #c3f00000
-decs432 apply #c3f00000 -> -0E+90
--- clamped zeros...
-decs433 apply -0E+91 -> #c3f00000 Clamped
-decs434 apply #c3f00000 -> -0E+90
-decs435 apply -0E+96 -> #c3f00000 Clamped
-decs436 apply #c3f00000 -> -0E+90
-decs437 apply -0E+400 -> #c3f00000 Clamped
-decs438 apply #c3f00000 -> -0E+90
-
--- Specials
-decs500 apply Infinity -> #78000000
-decs501 apply #78787878 -> #78000000
-decs502 apply #78000000 -> Infinity
-decs503 apply #79797979 -> #78000000
-decs504 apply #79000000 -> Infinity
-decs505 apply #7a7a7a7a -> #78000000
-decs506 apply #7a000000 -> Infinity
-decs507 apply #7b7b7b7b -> #78000000
-decs508 apply #7b000000 -> Infinity
-decs509 apply #7c7c7c7c -> #7c0c7c7c
-
-decs510 apply NaN -> #7c000000
-decs511 apply #7c000000 -> NaN
-decs512 apply #7d7d7d7d -> #7c0d7d7d
-decs513 apply #7d000000 -> NaN
-decs514 apply #7e7e7e7e -> #7e0e7c7e
-decs515 apply #7e000000 -> sNaN
-decs516 apply #7f7f7f7f -> #7e0f7c7f
-decs517 apply #7f000000 -> sNaN
-decs518 apply #7fffffff -> sNaN999999
-decs519 apply #7fffffff -> #7e03fcff
-
-decs520 apply -Infinity -> #f8000000
-decs521 apply #f8787878 -> #f8000000
-decs522 apply #f8000000 -> -Infinity
-decs523 apply #f9797979 -> #f8000000
-decs524 apply #f9000000 -> -Infinity
-decs525 apply #fa7a7a7a -> #f8000000
-decs526 apply #fa000000 -> -Infinity
-decs527 apply #fb7b7b7b -> #f8000000
-decs528 apply #fb000000 -> -Infinity
-
-decs529 apply -NaN -> #fc000000
-decs530 apply #fc7c7c7c -> #fc0c7c7c
-decs531 apply #fc000000 -> -NaN
-decs532 apply #fd7d7d7d -> #fc0d7d7d
-decs533 apply #fd000000 -> -NaN
-decs534 apply #fe7e7e7e -> #fe0e7c7e
-decs535 apply #fe000000 -> -sNaN
-decs536 apply #ff7f7f7f -> #fe0f7c7f
-decs537 apply #ff000000 -> -sNaN
-decs538 apply #ffffffff -> -sNaN999999
-decs539 apply #ffffffff -> #fe03fcff
-
--- diagnostic NaNs
-decs540 apply NaN -> #7c000000
-decs541 apply NaN0 -> #7c000000
-decs542 apply NaN1 -> #7c000001
-decs543 apply NaN12 -> #7c000012
-decs544 apply NaN79 -> #7c000079
-decs545 apply NaN12345 -> #7c0049c5
-decs546 apply NaN123456 -> #7c028e56
-decs547 apply NaN799799 -> #7c0f7fdf
-decs548 apply NaN999999 -> #7c03fcff
-
-
--- fold-down full sequence
-decs601 apply 1E+96 -> #47f00000 Clamped
-decs602 apply #47f00000 -> 1.000000E+96
-decs603 apply 1E+95 -> #43f20000 Clamped
-decs604 apply #43f20000 -> 1.00000E+95
-decs605 apply 1E+94 -> #43f04000 Clamped
-decs606 apply #43f04000 -> 1.0000E+94
-decs607 apply 1E+93 -> #43f00400 Clamped
-decs608 apply #43f00400 -> 1.000E+93
-decs609 apply 1E+92 -> #43f00080 Clamped
-decs610 apply #43f00080 -> 1.00E+92
-decs611 apply 1E+91 -> #43f00010 Clamped
-decs612 apply #43f00010 -> 1.0E+91
-decs613 apply 1E+90 -> #43f00001
-decs614 apply #43f00001 -> 1E+90
-
-
--- Selected DPD codes
-decs700 apply #22500000 -> 0
-decs701 apply #22500009 -> 9
-decs702 apply #22500010 -> 10
-decs703 apply #22500019 -> 19
-decs704 apply #22500020 -> 20
-decs705 apply #22500029 -> 29
-decs706 apply #22500030 -> 30
-decs707 apply #22500039 -> 39
-decs708 apply #22500040 -> 40
-decs709 apply #22500049 -> 49
-decs710 apply #22500050 -> 50
-decs711 apply #22500059 -> 59
-decs712 apply #22500060 -> 60
-decs713 apply #22500069 -> 69
-decs714 apply #22500070 -> 70
-decs715 apply #22500071 -> 71
-decs716 apply #22500072 -> 72
-decs717 apply #22500073 -> 73
-decs718 apply #22500074 -> 74
-decs719 apply #22500075 -> 75
-decs720 apply #22500076 -> 76
-decs721 apply #22500077 -> 77
-decs722 apply #22500078 -> 78
-decs723 apply #22500079 -> 79
-
-decs730 apply #2250029e -> 994
-decs731 apply #2250029f -> 995
-decs732 apply #225002a0 -> 520
-decs733 apply #225002a1 -> 521
-
--- DPD: one of each of the huffman groups
-decs740 apply #225003f7 -> 777
-decs741 apply #225003f8 -> 778
-decs742 apply #225003eb -> 787
-decs743 apply #2250037d -> 877
-decs744 apply #2250039f -> 997
-decs745 apply #225003bf -> 979
-decs746 apply #225003df -> 799
-decs747 apply #2250006e -> 888
-
-
--- DPD all-highs cases (includes the 24 redundant codes)
-decs750 apply #2250006e -> 888
-decs751 apply #2250016e -> 888
-decs752 apply #2250026e -> 888
-decs753 apply #2250036e -> 888
-decs754 apply #2250006f -> 889
-decs755 apply #2250016f -> 889
-decs756 apply #2250026f -> 889
-decs757 apply #2250036f -> 889
-
-decs760 apply #2250007e -> 898
-decs761 apply #2250017e -> 898
-decs762 apply #2250027e -> 898
-decs763 apply #2250037e -> 898
-decs764 apply #2250007f -> 899
-decs765 apply #2250017f -> 899
-decs766 apply #2250027f -> 899
-decs767 apply #2250037f -> 899
-
-decs770 apply #225000ee -> 988
-decs771 apply #225001ee -> 988
-decs772 apply #225002ee -> 988
-decs773 apply #225003ee -> 988
-decs774 apply #225000ef -> 989
-decs775 apply #225001ef -> 989
-decs776 apply #225002ef -> 989
-decs777 apply #225003ef -> 989
-
-decs780 apply #225000fe -> 998
-decs781 apply #225001fe -> 998
-decs782 apply #225002fe -> 998
-decs783 apply #225003fe -> 998
-decs784 apply #225000ff -> 999
-decs785 apply #225001ff -> 999
-decs786 apply #225002ff -> 999
-decs787 apply #225003ff -> 999
-
--- narrowing case
-decs790 apply 2.00E-99 -> #00000100 Subnormal
-decs791 apply #00000100 -> 2.00E-99 Subnormal
+------------------------------------------------------------------------
+-- dsEncode.decTest -- decimal four-byte format testcases --
+-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+-- [Previously called decimal32.decTest]
+version: 2.59
+
+-- This set of tests is for the four-byte concrete representation.
+-- Its characteristics are:
+--
+-- 1 bit sign
+-- 5 bits combination field
+-- 6 bits exponent continuation
+-- 20 bits coefficient continuation
+--
+-- Total exponent length 8 bits
+-- Total coefficient length 24 bits (7 digits)
+--
+-- Elimit = 191 (maximum encoded exponent)
+-- Emax = 96 (largest exponent value)
+-- Emin = -95 (smallest exponent value)
+-- bias = 101 (subtracted from encoded exponent) = -Etiny
+
+-- The testcases here have only exactly representable data on the
+-- 'left-hand-side'; rounding from strings is tested in 'base'
+-- testcase groups.
+
+extended: 1
+clamp: 1
+precision: 7
+rounding: half_up
+maxExponent: 96
+minExponent: -95
+
+-- General testcases
+-- (mostly derived from the Strawman 4 document and examples)
+decs001 apply #A23003D0 -> -7.50
+decs002 apply -7.50 -> #A23003D0
+-- derivative canonical plain strings
+decs003 apply #A26003D0 -> -7.50E+3
+decs004 apply -7.50E+3 -> #A26003D0
+decs005 apply #A25003D0 -> -750
+decs006 apply -750 -> #A25003D0
+decs007 apply #A24003D0 -> -75.0
+decs008 apply -75.0 -> #A24003D0
+decs009 apply #A22003D0 -> -0.750
+decs010 apply -0.750 -> #A22003D0
+decs011 apply #A21003D0 -> -0.0750
+decs012 apply -0.0750 -> #A21003D0
+decs013 apply #A1f003D0 -> -0.000750
+decs014 apply -0.000750 -> #A1f003D0
+decs015 apply #A1d003D0 -> -0.00000750
+decs016 apply -0.00000750 -> #A1d003D0
+decs017 apply #A1c003D0 -> -7.50E-7
+decs018 apply -7.50E-7 -> #A1c003D0
+
+-- Normality
+decs020 apply 1234567 -> #2654d2e7
+decs021 apply -1234567 -> #a654d2e7
+decs022 apply 1111111 -> #26524491
+
+-- Nmax and similar
+decs031 apply 9.999999E+96 -> #77f3fcff
+decs032 apply #77f3fcff -> 9.999999E+96
+decs033 apply 1.234567E+96 -> #47f4d2e7
+decs034 apply #47f4d2e7 -> 1.234567E+96
+-- fold-downs (more below)
+decs035 apply 1.23E+96 -> #47f4c000 Clamped
+decs036 apply #47f4c000 -> 1.230000E+96
+decs037 apply 1E+96 -> #47f00000 Clamped
+decs038 apply #47f00000 -> 1.000000E+96
+
+decs051 apply 12345 -> #225049c5
+decs052 apply #225049c5 -> 12345
+decs053 apply 1234 -> #22500534
+decs054 apply #22500534 -> 1234
+decs055 apply 123 -> #225000a3
+decs056 apply #225000a3 -> 123
+decs057 apply 12 -> #22500012
+decs058 apply #22500012 -> 12
+decs059 apply 1 -> #22500001
+decs060 apply #22500001 -> 1
+decs061 apply 1.23 -> #223000a3
+decs062 apply #223000a3 -> 1.23
+decs063 apply 123.45 -> #223049c5
+decs064 apply #223049c5 -> 123.45
+
+-- Nmin and below
+decs071 apply 1E-95 -> #00600001
+decs072 apply #00600001 -> 1E-95
+decs073 apply 1.000000E-95 -> #04000000
+decs074 apply #04000000 -> 1.000000E-95
+decs075 apply 1.000001E-95 -> #04000001
+decs076 apply #04000001 -> 1.000001E-95
+
+decs077 apply 0.100000E-95 -> #00020000 Subnormal
+decs07x apply 1.00000E-96 -> 1.00000E-96 Subnormal
+decs078 apply #00020000 -> 1.00000E-96 Subnormal
+decs079 apply 0.000010E-95 -> #00000010 Subnormal
+decs080 apply #00000010 -> 1.0E-100 Subnormal
+decs081 apply 0.000001E-95 -> #00000001 Subnormal
+decs082 apply #00000001 -> 1E-101 Subnormal
+decs083 apply 1e-101 -> #00000001 Subnormal
+decs084 apply #00000001 -> 1E-101 Subnormal
+decs08x apply 1e-101 -> 1E-101 Subnormal
+
+-- underflows cannot be tested; just check edge case
+decs090 apply 1e-101 -> #00000001 Subnormal
+
+-- same again, negatives --
+
+-- Nmax and similar
+decs122 apply -9.999999E+96 -> #f7f3fcff
+decs123 apply #f7f3fcff -> -9.999999E+96
+decs124 apply -1.234567E+96 -> #c7f4d2e7
+decs125 apply #c7f4d2e7 -> -1.234567E+96
+-- fold-downs (more below)
+decs130 apply -1.23E+96 -> #c7f4c000 Clamped
+decs131 apply #c7f4c000 -> -1.230000E+96
+decs132 apply -1E+96 -> #c7f00000 Clamped
+decs133 apply #c7f00000 -> -1.000000E+96
+
+decs151 apply -12345 -> #a25049c5
+decs152 apply #a25049c5 -> -12345
+decs153 apply -1234 -> #a2500534
+decs154 apply #a2500534 -> -1234
+decs155 apply -123 -> #a25000a3
+decs156 apply #a25000a3 -> -123
+decs157 apply -12 -> #a2500012
+decs158 apply #a2500012 -> -12
+decs159 apply -1 -> #a2500001
+decs160 apply #a2500001 -> -1
+decs161 apply -1.23 -> #a23000a3
+decs162 apply #a23000a3 -> -1.23
+decs163 apply -123.45 -> #a23049c5
+decs164 apply #a23049c5 -> -123.45
+
+-- Nmin and below
+decs171 apply -1E-95 -> #80600001
+decs172 apply #80600001 -> -1E-95
+decs173 apply -1.000000E-95 -> #84000000
+decs174 apply #84000000 -> -1.000000E-95
+decs175 apply -1.000001E-95 -> #84000001
+decs176 apply #84000001 -> -1.000001E-95
+
+decs177 apply -0.100000E-95 -> #80020000 Subnormal
+decs178 apply #80020000 -> -1.00000E-96 Subnormal
+decs179 apply -0.000010E-95 -> #80000010 Subnormal
+decs180 apply #80000010 -> -1.0E-100 Subnormal
+decs181 apply -0.000001E-95 -> #80000001 Subnormal
+decs182 apply #80000001 -> -1E-101 Subnormal
+decs183 apply -1e-101 -> #80000001 Subnormal
+decs184 apply #80000001 -> -1E-101 Subnormal
+
+-- underflow edge case
+decs190 apply -1e-101 -> #80000001 Subnormal
+
+-- zeros
+decs400 apply 0E-400 -> #00000000 Clamped
+decs401 apply 0E-101 -> #00000000
+decs402 apply #00000000 -> 0E-101
+decs403 apply 0.000000E-95 -> #00000000
+decs404 apply #00000000 -> 0E-101
+decs405 apply 0E-2 -> #22300000
+decs406 apply #22300000 -> 0.00
+decs407 apply 0 -> #22500000
+decs408 apply #22500000 -> 0
+decs409 apply 0E+3 -> #22800000
+decs410 apply #22800000 -> 0E+3
+decs411 apply 0E+90 -> #43f00000
+decs412 apply #43f00000 -> 0E+90
+-- clamped zeros...
+decs413 apply 0E+91 -> #43f00000 Clamped
+decs414 apply #43f00000 -> 0E+90
+decs415 apply 0E+96 -> #43f00000 Clamped
+decs416 apply #43f00000 -> 0E+90
+decs417 apply 0E+400 -> #43f00000 Clamped
+decs418 apply #43f00000 -> 0E+90
+
+-- negative zeros
+decs420 apply -0E-400 -> #80000000 Clamped
+decs421 apply -0E-101 -> #80000000
+decs422 apply #80000000 -> -0E-101
+decs423 apply -0.000000E-95 -> #80000000
+decs424 apply #80000000 -> -0E-101
+decs425 apply -0E-2 -> #a2300000
+decs426 apply #a2300000 -> -0.00
+decs427 apply -0 -> #a2500000
+decs428 apply #a2500000 -> -0
+decs429 apply -0E+3 -> #a2800000
+decs430 apply #a2800000 -> -0E+3
+decs431 apply -0E+90 -> #c3f00000
+decs432 apply #c3f00000 -> -0E+90
+-- clamped zeros...
+decs433 apply -0E+91 -> #c3f00000 Clamped
+decs434 apply #c3f00000 -> -0E+90
+decs435 apply -0E+96 -> #c3f00000 Clamped
+decs436 apply #c3f00000 -> -0E+90
+decs437 apply -0E+400 -> #c3f00000 Clamped
+decs438 apply #c3f00000 -> -0E+90
+
+-- Specials
+decs500 apply Infinity -> #78000000
+decs501 apply #78787878 -> #78000000
+decs502 apply #78000000 -> Infinity
+decs503 apply #79797979 -> #78000000
+decs504 apply #79000000 -> Infinity
+decs505 apply #7a7a7a7a -> #78000000
+decs506 apply #7a000000 -> Infinity
+decs507 apply #7b7b7b7b -> #78000000
+decs508 apply #7b000000 -> Infinity
+decs509 apply #7c7c7c7c -> #7c0c7c7c
+
+decs510 apply NaN -> #7c000000
+decs511 apply #7c000000 -> NaN
+decs512 apply #7d7d7d7d -> #7c0d7d7d
+decs513 apply #7d000000 -> NaN
+decs514 apply #7e7e7e7e -> #7e0e7c7e
+decs515 apply #7e000000 -> sNaN
+decs516 apply #7f7f7f7f -> #7e0f7c7f
+decs517 apply #7f000000 -> sNaN
+decs518 apply #7fffffff -> sNaN999999
+decs519 apply #7fffffff -> #7e03fcff
+
+decs520 apply -Infinity -> #f8000000
+decs521 apply #f8787878 -> #f8000000
+decs522 apply #f8000000 -> -Infinity
+decs523 apply #f9797979 -> #f8000000
+decs524 apply #f9000000 -> -Infinity
+decs525 apply #fa7a7a7a -> #f8000000
+decs526 apply #fa000000 -> -Infinity
+decs527 apply #fb7b7b7b -> #f8000000
+decs528 apply #fb000000 -> -Infinity
+
+decs529 apply -NaN -> #fc000000
+decs530 apply #fc7c7c7c -> #fc0c7c7c
+decs531 apply #fc000000 -> -NaN
+decs532 apply #fd7d7d7d -> #fc0d7d7d
+decs533 apply #fd000000 -> -NaN
+decs534 apply #fe7e7e7e -> #fe0e7c7e
+decs535 apply #fe000000 -> -sNaN
+decs536 apply #ff7f7f7f -> #fe0f7c7f
+decs537 apply #ff000000 -> -sNaN
+decs538 apply #ffffffff -> -sNaN999999
+decs539 apply #ffffffff -> #fe03fcff
+
+-- diagnostic NaNs
+decs540 apply NaN -> #7c000000
+decs541 apply NaN0 -> #7c000000
+decs542 apply NaN1 -> #7c000001
+decs543 apply NaN12 -> #7c000012
+decs544 apply NaN79 -> #7c000079
+decs545 apply NaN12345 -> #7c0049c5
+decs546 apply NaN123456 -> #7c028e56
+decs547 apply NaN799799 -> #7c0f7fdf
+decs548 apply NaN999999 -> #7c03fcff
+
+
+-- fold-down full sequence
+decs601 apply 1E+96 -> #47f00000 Clamped
+decs602 apply #47f00000 -> 1.000000E+96
+decs603 apply 1E+95 -> #43f20000 Clamped
+decs604 apply #43f20000 -> 1.00000E+95
+decs605 apply 1E+94 -> #43f04000 Clamped
+decs606 apply #43f04000 -> 1.0000E+94
+decs607 apply 1E+93 -> #43f00400 Clamped
+decs608 apply #43f00400 -> 1.000E+93
+decs609 apply 1E+92 -> #43f00080 Clamped
+decs610 apply #43f00080 -> 1.00E+92
+decs611 apply 1E+91 -> #43f00010 Clamped
+decs612 apply #43f00010 -> 1.0E+91
+decs613 apply 1E+90 -> #43f00001
+decs614 apply #43f00001 -> 1E+90
+
+
+-- Selected DPD codes
+decs700 apply #22500000 -> 0
+decs701 apply #22500009 -> 9
+decs702 apply #22500010 -> 10
+decs703 apply #22500019 -> 19
+decs704 apply #22500020 -> 20
+decs705 apply #22500029 -> 29
+decs706 apply #22500030 -> 30
+decs707 apply #22500039 -> 39
+decs708 apply #22500040 -> 40
+decs709 apply #22500049 -> 49
+decs710 apply #22500050 -> 50
+decs711 apply #22500059 -> 59
+decs712 apply #22500060 -> 60
+decs713 apply #22500069 -> 69
+decs714 apply #22500070 -> 70
+decs715 apply #22500071 -> 71
+decs716 apply #22500072 -> 72
+decs717 apply #22500073 -> 73
+decs718 apply #22500074 -> 74
+decs719 apply #22500075 -> 75
+decs720 apply #22500076 -> 76
+decs721 apply #22500077 -> 77
+decs722 apply #22500078 -> 78
+decs723 apply #22500079 -> 79
+
+decs730 apply #2250029e -> 994
+decs731 apply #2250029f -> 995
+decs732 apply #225002a0 -> 520
+decs733 apply #225002a1 -> 521
+
+-- DPD: one of each of the huffman groups
+decs740 apply #225003f7 -> 777
+decs741 apply #225003f8 -> 778
+decs742 apply #225003eb -> 787
+decs743 apply #2250037d -> 877
+decs744 apply #2250039f -> 997
+decs745 apply #225003bf -> 979
+decs746 apply #225003df -> 799
+decs747 apply #2250006e -> 888
+
+
+-- DPD all-highs cases (includes the 24 redundant codes)
+decs750 apply #2250006e -> 888
+decs751 apply #2250016e -> 888
+decs752 apply #2250026e -> 888
+decs753 apply #2250036e -> 888
+decs754 apply #2250006f -> 889
+decs755 apply #2250016f -> 889
+decs756 apply #2250026f -> 889
+decs757 apply #2250036f -> 889
+
+decs760 apply #2250007e -> 898
+decs761 apply #2250017e -> 898
+decs762 apply #2250027e -> 898
+decs763 apply #2250037e -> 898
+decs764 apply #2250007f -> 899
+decs765 apply #2250017f -> 899
+decs766 apply #2250027f -> 899
+decs767 apply #2250037f -> 899
+
+decs770 apply #225000ee -> 988
+decs771 apply #225001ee -> 988
+decs772 apply #225002ee -> 988
+decs773 apply #225003ee -> 988
+decs774 apply #225000ef -> 989
+decs775 apply #225001ef -> 989
+decs776 apply #225002ef -> 989
+decs777 apply #225003ef -> 989
+
+decs780 apply #225000fe -> 998
+decs781 apply #225001fe -> 998
+decs782 apply #225002fe -> 998
+decs783 apply #225003fe -> 998
+decs784 apply #225000ff -> 999
+decs785 apply #225001ff -> 999
+decs786 apply #225002ff -> 999
+decs787 apply #225003ff -> 999
+
+-- narrowing case
+decs790 apply 2.00E-99 -> #00000100 Subnormal
+decs791 apply #00000100 -> 2.00E-99 Subnormal
diff --git a/Lib/test/decimaltestdata/exp.decTest b/Lib/test/decimaltestdata/exp.decTest
index eab990d3ef..021b478ac2 100644
--- a/Lib/test/decimaltestdata/exp.decTest
+++ b/Lib/test/decimaltestdata/exp.decTest
@@ -1,674 +1,674 @@
-------------------------------------------------------------------------
--- exp.decTest -- decimal natural exponentiation --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Tests of the exponential funtion. Currently all testcases here
--- show results which are correctly rounded (within <= 0.5 ulp).
-
-extended: 1
-precision: 9
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- basics (examples in specificiation, etc.)
-expx001 exp -Infinity -> 0
-expx002 exp -10 -> 0.0000453999298 Inexact Rounded
-expx003 exp -1 -> 0.367879441 Inexact Rounded
-expx004 exp 0 -> 1
-expx005 exp -0 -> 1
-expx006 exp 1 -> 2.71828183 Inexact Rounded
-expx007 exp 0.693147181 -> 2.00000000 Inexact Rounded
-expx008 exp 10 -> 22026.4658 Inexact Rounded
-expx009 exp +Infinity -> Infinity
-
--- tiny edge cases
-precision: 7
-expx011 exp 0.1 -> 1.105171 Inexact Rounded
-expx012 exp 0.01 -> 1.010050 Inexact Rounded
-expx013 exp 0.001 -> 1.001001 Inexact Rounded
-expx014 exp 0.0001 -> 1.000100 Inexact Rounded
-expx015 exp 0.00001 -> 1.000010 Inexact Rounded
-expx016 exp 0.000001 -> 1.000001 Inexact Rounded
-expx017 exp 0.0000001 -> 1.000000 Inexact Rounded
-expx018 exp 0.0000003 -> 1.000000 Inexact Rounded
-expx019 exp 0.0000004 -> 1.000000 Inexact Rounded
-expx020 exp 0.0000005 -> 1.000001 Inexact Rounded
-expx021 exp 0.0000008 -> 1.000001 Inexact Rounded
-expx022 exp 0.0000009 -> 1.000001 Inexact Rounded
-expx023 exp 0.0000010 -> 1.000001 Inexact Rounded
-expx024 exp 0.0000011 -> 1.000001 Inexact Rounded
-expx025 exp 0.00000009 -> 1.000000 Inexact Rounded
-expx026 exp 0.00000005 -> 1.000000 Inexact Rounded
-expx027 exp 0.00000004 -> 1.000000 Inexact Rounded
-expx028 exp 0.00000001 -> 1.000000 Inexact Rounded
-
--- and some more zeros
-expx030 exp 0.00000000 -> 1
-expx031 exp 0E+100 -> 1
-expx032 exp 0E-100 -> 1
-expx033 exp -0.00000000 -> 1
-expx034 exp -0E+100 -> 1
-expx035 exp -0E-100 -> 1
-
--- basic e=0, e=1, e=2, e=4, e>=8 cases
-precision: 7
-expx041 exp 1 -> 2.718282 Inexact Rounded
-expx042 exp -1 -> 0.3678794 Inexact Rounded
-expx043 exp 10 -> 22026.47 Inexact Rounded
-expx044 exp -10 -> 0.00004539993 Inexact Rounded
-expx045 exp 100 -> 2.688117E+43 Inexact Rounded
-expx046 exp -100 -> 3.720076E-44 Inexact Rounded
-expx047 exp 1000 -> Infinity Overflow Inexact Rounded
-expx048 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx049 exp 100000000 -> Infinity Overflow Inexact Rounded
-expx050 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-
--- miscellanea
--- similar to 'VF bug' test, at 17, but with last digit corrected for decimal
-precision: 16
-expx055 exp -5.42410311287441459172E+2 -> 2.717658486884572E-236 Inexact Rounded
--- result from NetRexx/Java prototype -> 2.7176584868845721117677929628617246054459644711108E-236
--- result from Rexx (series) version -> 2.717658486884572111767792962861724605446E-236
-precision: 17
-expx056 exp -5.42410311287441459172E+2 -> 2.7176584868845721E-236 Inexact Rounded
-precision: 18
-expx057 exp -5.42410311287441459172E+2 -> 2.71765848688457211E-236 Inexact Rounded
-precision: 19
-expx058 exp -5.42410311287441459172E+2 -> 2.717658486884572112E-236 Inexact Rounded
-precision: 20
-expx059 exp -5.42410311287441459172E+2 -> 2.7176584868845721118E-236 Inexact Rounded
-
--- rounding in areas of ..500.., ..499.., ..100.., ..999.. sequences
-precision: 50
-expx101 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
-precision: 31
-expx102 exp -9E-8 -> 0.9999999100000040499998785000027 Inexact Rounded
-precision: 30
-expx103 exp -9E-8 -> 0.999999910000004049999878500003 Inexact Rounded
-precision: 29
-expx104 exp -9E-8 -> 0.99999991000000404999987850000 Inexact Rounded
-precision: 28
-expx105 exp -9E-8 -> 0.9999999100000040499998785000 Inexact Rounded
-precision: 27
-expx106 exp -9E-8 -> 0.999999910000004049999878500 Inexact Rounded
-precision: 26
-expx107 exp -9E-8 -> 0.99999991000000404999987850 Inexact Rounded
-precision: 25
-expx108 exp -9E-8 -> 0.9999999100000040499998785 Inexact Rounded
-precision: 24
-expx109 exp -9E-8 -> 0.999999910000004049999879 Inexact Rounded
-precision: 23
-expx110 exp -9E-8 -> 0.99999991000000404999988 Inexact Rounded
-precision: 22
-expx111 exp -9E-8 -> 0.9999999100000040499999 Inexact Rounded
-precision: 21
-expx112 exp -9E-8 -> 0.999999910000004050000 Inexact Rounded
-precision: 20
-expx113 exp -9E-8 -> 0.99999991000000405000 Inexact Rounded
-precision: 19
-expx114 exp -9E-8 -> 0.9999999100000040500 Inexact Rounded
-precision: 18
-expx115 exp -9E-8 -> 0.999999910000004050 Inexact Rounded
-precision: 17
-expx116 exp -9E-8 -> 0.99999991000000405 Inexact Rounded
-precision: 16
-expx117 exp -9E-8 -> 0.9999999100000040 Inexact Rounded
-precision: 15
-expx118 exp -9E-8 -> 0.999999910000004 Inexact Rounded
-precision: 14
-expx119 exp -9E-8 -> 0.99999991000000 Inexact Rounded
-precision: 13
-expx120 exp -9E-8 -> 0.9999999100000 Inexact Rounded
-precision: 12
-expx121 exp -9E-8 -> 0.999999910000 Inexact Rounded
-precision: 11
-expx122 exp -9E-8 -> 0.99999991000 Inexact Rounded
-precision: 10
-expx123 exp -9E-8 -> 0.9999999100 Inexact Rounded
-precision: 9
-expx124 exp -9E-8 -> 0.999999910 Inexact Rounded
-precision: 8
-expx125 exp -9E-8 -> 0.99999991 Inexact Rounded
-precision: 7
-expx126 exp -9E-8 -> 0.9999999 Inexact Rounded
-precision: 6
-expx127 exp -9E-8 -> 1.00000 Inexact Rounded
-precision: 5
-expx128 exp -9E-8 -> 1.0000 Inexact Rounded
-precision: 4
-expx129 exp -9E-8 -> 1.000 Inexact Rounded
-precision: 3
-expx130 exp -9E-8 -> 1.00 Inexact Rounded
-precision: 2
-expx131 exp -9E-8 -> 1.0 Inexact Rounded
-precision: 1
-expx132 exp -9E-8 -> 1 Inexact Rounded
-
-
--- sanity checks, with iteration counts [normalized so 0<=|x|<1]
-precision: 50
-
-expx210 exp 0 -> 1
--- iterations: 2
-expx211 exp -1E-40 -> 0.99999999999999999999999999999999999999990000000000 Inexact Rounded
--- iterations: 8
-expx212 exp -9E-7 -> 0.99999910000040499987850002733749507925073811240510 Inexact Rounded
--- iterations: 6
-expx213 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
--- iterations: 15
-expx214 exp -0.003 -> 0.99700449550337297601206623409756091074177480489845 Inexact Rounded
--- iterations: 14
-expx215 exp -0.001 -> 0.99900049983337499166805535716765597470235590236008 Inexact Rounded
--- iterations: 26
-expx216 exp -0.1 -> 0.90483741803595957316424905944643662119470536098040 Inexact Rounded
--- iterations: 39
-expx217 exp -0.7 -> 0.49658530379140951470480009339752896170766716571182 Inexact Rounded
--- iterations: 41
-expx218 exp -0.9 -> 0.40656965974059911188345423964562598783370337617038 Inexact Rounded
--- iterations: 43
-expx219 exp -0.99 -> 0.37157669102204569053152411990820138691802885490501 Inexact Rounded
--- iterations: 26
-expx220 exp -1 -> 0.36787944117144232159552377016146086744581113103177 Inexact Rounded
--- iterations: 26
-expx221 exp -1.01 -> 0.36421897957152331975704629563734548959589139192482 Inexact Rounded
--- iterations: 27
-expx222 exp -1.1 -> 0.33287108369807955328884690643131552161247952156921 Inexact Rounded
--- iterations: 28
-expx223 exp -1.5 -> 0.22313016014842982893328047076401252134217162936108 Inexact Rounded
--- iterations: 30
-expx224 exp -2 -> 0.13533528323661269189399949497248440340763154590958 Inexact Rounded
--- iterations: 36
-expx225 exp -5 -> 0.0067379469990854670966360484231484242488495850273551 Inexact Rounded
--- iterations: 26
-expx226 exp -10 -> 0.000045399929762484851535591515560550610237918088866565 Inexact Rounded
--- iterations: 28
-expx227 exp -14 -> 8.3152871910356788406398514256526229460765836498457E-7 Inexact Rounded
--- iterations: 29
-expx228 exp -15 -> 3.0590232050182578837147949770228963937082078081856E-7 Inexact Rounded
--- iterations: 30
-expx233 exp 0 -> 1
--- iterations: 2
-expx234 exp 1E-40 -> 1.0000000000000000000000000000000000000001000000000 Inexact Rounded
--- iterations: 7
-expx235 exp 9E-7 -> 1.0000009000004050001215000273375049207507381125949 Inexact Rounded
--- iterations: 6
-expx236 exp 9E-8 -> 1.0000000900000040500001215000027337500492075007381 Inexact Rounded
--- iterations: 15
-expx237 exp 0.003 -> 1.0030045045033770260129340913489002053318727195619 Inexact Rounded
--- iterations: 13
-expx238 exp 0.001 -> 1.0010005001667083416680557539930583115630762005807 Inexact Rounded
--- iterations: 25
-expx239 exp 0.1 -> 1.1051709180756476248117078264902466682245471947375 Inexact Rounded
--- iterations: 38
-expx240 exp 0.7 -> 2.0137527074704765216245493885830652700175423941459 Inexact Rounded
--- iterations: 41
-expx241 exp 0.9 -> 2.4596031111569496638001265636024706954217723064401 Inexact Rounded
--- iterations: 42
-expx242 exp 0.99 -> 2.6912344723492622890998794040710139721802931841030 Inexact Rounded
--- iterations: 26
-expx243 exp 1 -> 2.7182818284590452353602874713526624977572470937000 Inexact Rounded
--- iterations: 26
-expx244 exp 1.01 -> 2.7456010150169164939897763166603876240737508195960 Inexact Rounded
--- iterations: 26
-expx245 exp 1.1 -> 3.0041660239464331120584079535886723932826810260163 Inexact Rounded
--- iterations: 28
-expx246 exp 1.5 -> 4.4816890703380648226020554601192758190057498683697 Inexact Rounded
--- iterations: 29
-expx247 exp 2 -> 7.3890560989306502272304274605750078131803155705518 Inexact Rounded
--- iterations: 36
-expx248 exp 5 -> 148.41315910257660342111558004055227962348766759388 Inexact Rounded
--- iterations: 26
-expx249 exp 10 -> 22026.465794806716516957900645284244366353512618557 Inexact Rounded
--- iterations: 28
-expx250 exp 14 -> 1202604.2841647767777492367707678594494124865433761 Inexact Rounded
--- iterations: 28
-expx251 exp 15 -> 3269017.3724721106393018550460917213155057385438200 Inexact Rounded
--- iterations: 29
-
--- a biggie [result verified 3 ways]
-precision: 250
-expx260 exp 1 -> 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668 Inexact Rounded
-
--- extreme range boundaries
-precision: 16
-maxExponent: 999999
-minExponent: -999999
--- Ntiny boundary
-expx290 exp -2302618.022332529 -> 0E-1000014 Underflow Subnormal Inexact Rounded Clamped
-expx291 exp -2302618.022332528 -> 1E-1000014 Underflow Subnormal Inexact Rounded
--- Nmax/10 and Nmax boundary
-expx292 exp 2302582.790408952 -> 9.999999993100277E+999998 Inexact Rounded
-expx293 exp 2302582.790408953 -> 1.000000000310028E+999999 Inexact Rounded
-expx294 exp 2302585.092993946 -> 9.999999003159870E+999999 Inexact Rounded
-expx295 exp 2302585.092994036 -> 9.999999903159821E+999999 Inexact Rounded
-expx296 exp 2302585.092994045 -> 9.999999993159820E+999999 Inexact Rounded
-expx297 exp 2302585.092994046 -> Infinity Overflow Inexact Rounded
-
--- 0<-x<<1 effects
-precision: 30
-expx320 exp -4.9999999999999E-8 -> 0.999999950000001250000979166617 Inexact Rounded
-expx321 exp -5.0000000000000E-8 -> 0.999999950000001249999979166667 Inexact Rounded
-expx322 exp -5.0000000000001E-8 -> 0.999999950000001249998979166717 Inexact Rounded
-precision: 20
-expx323 exp -4.9999999999999E-8 -> 0.99999995000000125000 Inexact Rounded
-expx324 exp -5.0000000000000E-8 -> 0.99999995000000125000 Inexact Rounded
-expx325 exp -5.0000000000001E-8 -> 0.99999995000000125000 Inexact Rounded
-precision: 14
-expx326 exp -4.9999999999999E-8 -> 0.99999995000000 Inexact Rounded
-expx327 exp -5.0000000000000E-8 -> 0.99999995000000 Inexact Rounded
-expx328 exp -5.0000000000001E-8 -> 0.99999995000000 Inexact Rounded
--- overprecise and 0<-x<<1
-precision: 8
-expx330 exp -4.9999999999999E-8 -> 0.99999995 Inexact Rounded
-expx331 exp -5.0000000000000E-8 -> 0.99999995 Inexact Rounded
-expx332 exp -5.0000000000001E-8 -> 0.99999995 Inexact Rounded
-precision: 7
-expx333 exp -4.9999999999999E-8 -> 1.000000 Inexact Rounded
-expx334 exp -5.0000000000000E-8 -> 1.000000 Inexact Rounded
-expx335 exp -5.0000000000001E-8 -> 1.000000 Inexact Rounded
-precision: 3
-expx336 exp -4.9999999999999E-8 -> 1.00 Inexact Rounded
-expx337 exp -5.0000000000000E-8 -> 1.00 Inexact Rounded
-expx338 exp -5.0000000000001E-8 -> 1.00 Inexact Rounded
-
--- 0<x<<1 effects
-precision: 30
-expx340 exp 4.9999999999999E-8 -> 1.00000005000000124999902083328 Inexact Rounded
-expx341 exp 5.0000000000000E-8 -> 1.00000005000000125000002083333 Inexact Rounded
-expx342 exp 5.0000000000001E-8 -> 1.00000005000000125000102083338 Inexact Rounded
-precision: 20
-expx343 exp 4.9999999999999E-8 -> 1.0000000500000012500 Inexact Rounded
-expx344 exp 5.0000000000000E-8 -> 1.0000000500000012500 Inexact Rounded
-expx345 exp 5.0000000000001E-8 -> 1.0000000500000012500 Inexact Rounded
-precision: 14
-expx346 exp 4.9999999999999E-8 -> 1.0000000500000 Inexact Rounded
-expx347 exp 5.0000000000000E-8 -> 1.0000000500000 Inexact Rounded
-expx348 exp 5.0000000000001E-8 -> 1.0000000500000 Inexact Rounded
--- overprecise and 0<x<<1
-precision: 8
-expx350 exp 4.9999999999999E-8 -> 1.0000001 Inexact Rounded
-expx351 exp 5.0000000000000E-8 -> 1.0000001 Inexact Rounded
-expx352 exp 5.0000000000001E-8 -> 1.0000001 Inexact Rounded
-precision: 7
-expx353 exp 4.9999999999999E-8 -> 1.000000 Inexact Rounded
-expx354 exp 5.0000000000000E-8 -> 1.000000 Inexact Rounded
-expx355 exp 5.0000000000001E-8 -> 1.000000 Inexact Rounded
-precision: 3
-expx356 exp 4.9999999999999E-8 -> 1.00 Inexact Rounded
-expx357 exp 5.0000000000000E-8 -> 1.00 Inexact Rounded
-expx358 exp 5.0000000000001E-8 -> 1.00 Inexact Rounded
-
--- cases near 1 -- 1 2345678901234567890
-precision: 20
-expx401 exp 0.99999999999996 -> 2.7182818284589365041 Inexact Rounded
-expx402 exp 0.99999999999997 -> 2.7182818284589636869 Inexact Rounded
-expx403 exp 0.99999999999998 -> 2.7182818284589908697 Inexact Rounded
-expx404 exp 0.99999999999999 -> 2.7182818284590180525 Inexact Rounded
-expx405 exp 1.0000000000000 -> 2.7182818284590452354 Inexact Rounded
-expx406 exp 1.0000000000001 -> 2.7182818284593170635 Inexact Rounded
-expx407 exp 1.0000000000002 -> 2.7182818284595888917 Inexact Rounded
-precision: 14
-expx411 exp 0.99999999999996 -> 2.7182818284589 Inexact Rounded
-expx412 exp 0.99999999999997 -> 2.7182818284590 Inexact Rounded
-expx413 exp 0.99999999999998 -> 2.7182818284590 Inexact Rounded
-expx414 exp 0.99999999999999 -> 2.7182818284590 Inexact Rounded
-expx415 exp 1.0000000000000 -> 2.7182818284590 Inexact Rounded
-expx416 exp 1.0000000000001 -> 2.7182818284593 Inexact Rounded
-expx417 exp 1.0000000000002 -> 2.7182818284596 Inexact Rounded
--- overprecise...
-precision: 7
-expx421 exp 0.99999999999996 -> 2.718282 Inexact Rounded
-expx422 exp 0.99999999999997 -> 2.718282 Inexact Rounded
-expx423 exp 0.99999999999998 -> 2.718282 Inexact Rounded
-expx424 exp 0.99999999999999 -> 2.718282 Inexact Rounded
-expx425 exp 1.0000000000001 -> 2.718282 Inexact Rounded
-expx426 exp 1.0000000000002 -> 2.718282 Inexact Rounded
-expx427 exp 1.0000000000003 -> 2.718282 Inexact Rounded
-precision: 2
-expx431 exp 0.99999999999996 -> 2.7 Inexact Rounded
-expx432 exp 0.99999999999997 -> 2.7 Inexact Rounded
-expx433 exp 0.99999999999998 -> 2.7 Inexact Rounded
-expx434 exp 0.99999999999999 -> 2.7 Inexact Rounded
-expx435 exp 1.0000000000001 -> 2.7 Inexact Rounded
-expx436 exp 1.0000000000002 -> 2.7 Inexact Rounded
-expx437 exp 1.0000000000003 -> 2.7 Inexact Rounded
-
--- basics at low precisions
-precision: 3
-expx501 exp -Infinity -> 0
-expx502 exp -10 -> 0.0000454 Inexact Rounded
-expx503 exp -1 -> 0.368 Inexact Rounded
-expx504 exp 0 -> 1
-expx505 exp -0 -> 1
-expx506 exp 1 -> 2.72 Inexact Rounded
-expx507 exp 0.693147181 -> 2.00 Inexact Rounded
-expx508 exp 10 -> 2.20E+4 Inexact Rounded
-expx509 exp +Infinity -> Infinity
-precision: 2
-expx511 exp -Infinity -> 0
-expx512 exp -10 -> 0.000045 Inexact Rounded
-expx513 exp -1 -> 0.37 Inexact Rounded
-expx514 exp 0 -> 1
-expx515 exp -0 -> 1
-expx516 exp 1 -> 2.7 Inexact Rounded
-expx517 exp 0.693147181 -> 2.0 Inexact Rounded
-expx518 exp 10 -> 2.2E+4 Inexact Rounded
-expx519 exp +Infinity -> Infinity
-precision: 1
-expx521 exp -Infinity -> 0
-expx522 exp -10 -> 0.00005 Inexact Rounded
-expx523 exp -1 -> 0.4 Inexact Rounded
-expx524 exp 0 -> 1
-expx525 exp -0 -> 1
-expx526 exp 1 -> 3 Inexact Rounded
-expx527 exp 0.693147181 -> 2 Inexact Rounded
-expx528 exp 10 -> 2E+4 Inexact Rounded
-expx529 exp +Infinity -> Infinity
-
--- overflows, including some overprecise borderlines
-precision: 7
-maxExponent: 384
-minExponent: -383
-expx701 exp 1000000000 -> Infinity Overflow Inexact Rounded
-expx702 exp 100000000 -> Infinity Overflow Inexact Rounded
-expx703 exp 10000000 -> Infinity Overflow Inexact Rounded
-expx704 exp 1000000 -> Infinity Overflow Inexact Rounded
-expx705 exp 100000 -> Infinity Overflow Inexact Rounded
-expx706 exp 10000 -> Infinity Overflow Inexact Rounded
-expx707 exp 1000 -> Infinity Overflow Inexact Rounded
-expx708 exp 886.4952608 -> Infinity Overflow Inexact Rounded
-expx709 exp 886.4952607 -> 9.999999E+384 Inexact Rounded
-expx710 exp 886.49527 -> Infinity Overflow Inexact Rounded
-expx711 exp 886.49526 -> 9.999992E+384 Inexact Rounded
-precision: 16
-expx721 exp 886.4952608027075883 -> Infinity Overflow Inexact Rounded
-expx722 exp 886.4952608027075882 -> 9.999999999999999E+384 Inexact Rounded
-expx723 exp 886.49526080270759 -> Infinity Overflow Inexact Rounded
-expx724 exp 886.49526080270758 -> 9.999999999999917E+384 Inexact Rounded
-expx725 exp 886.4952608027076 -> Infinity Overflow Inexact Rounded
-expx726 exp 886.4952608027075 -> 9.999999999999117E+384 Inexact Rounded
--- and by special request ...
-precision: 15
-expx731 exp 886.495260802708 -> Infinity Overflow Inexact Rounded
-expx732 exp 886.495260802707 -> 9.99999999999412E+384 Inexact Rounded
-expx733 exp 886.495260802706 -> 9.99999999998412E+384 Inexact Rounded
-maxExponent: 999
-minExponent: -999
-expx735 exp 2302.58509299405 -> Infinity Overflow Inexact Rounded
-expx736 exp 2302.58509299404 -> 9.99999999994316E+999 Inexact Rounded
-expx737 exp 2302.58509299403 -> 9.99999999984316E+999 Inexact Rounded
-
--- subnormals and underflows, including underflow-to-zero edge point
-precision: 7
-maxExponent: 384
-minExponent: -383
-expx751 exp -1000000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx752 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx753 exp -10000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx754 exp -1000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx755 exp -100000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx756 exp -10000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx757 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx758 exp -881.89009 -> 1.000001E-383 Inexact Rounded
-expx759 exp -881.8901 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
-expx760 exp -885 -> 4.4605E-385 Inexact Rounded Underflow Subnormal
-expx761 exp -888 -> 2.221E-386 Inexact Rounded Underflow Subnormal
-expx762 exp -890 -> 3.01E-387 Inexact Rounded Underflow Subnormal
-expx763 exp -892.9 -> 1.7E-388 Inexact Rounded Underflow Subnormal
-expx764 exp -893 -> 1.5E-388 Inexact Rounded Underflow Subnormal
-expx765 exp -893.5 -> 9E-389 Inexact Rounded Underflow Subnormal
-expx766 exp -895.7056 -> 1E-389 Inexact Rounded Underflow Subnormal
-expx769 exp -895.8 -> 1E-389 Inexact Rounded Underflow Subnormal
-expx770 exp -895.73 -> 1E-389 Inexact Rounded Underflow Subnormal
-expx771 exp -896.3987 -> 1E-389 Inexact Rounded Underflow Subnormal
-expx772 exp -896.3988 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
-expx773 exp -898.0081 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
-expx774 exp -898.0082 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
-
--- special values
-maxexponent: 999
-minexponent: -999
-expx820 exp Inf -> Infinity
-expx821 exp -Inf -> 0
-expx822 exp NaN -> NaN
-expx823 exp sNaN -> NaN Invalid_operation
--- propagating NaNs
-expx824 exp sNaN123 -> NaN123 Invalid_operation
-expx825 exp -sNaN321 -> -NaN321 Invalid_operation
-expx826 exp NaN456 -> NaN456
-expx827 exp -NaN654 -> -NaN654
-expx828 exp NaN1 -> NaN1
-
--- Invalid operations due to restrictions
--- [next two probably skipped by most test harnesses]
-precision: 100000000
-expx901 exp -Infinity -> NaN Invalid_context
-precision: 99999999
-expx902 exp -Infinity -> NaN Invalid_context
-
-precision: 9
-maxExponent: 1000000
-minExponent: -999999
-expx903 exp -Infinity -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999999
-expx904 exp -Infinity -> 0
-maxExponent: 999999
-minExponent: -1000000
-expx905 exp -Infinity -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999998
-expx906 exp -Infinity -> 0
-
---
-maxExponent: 384
-minExponent: -383
-precision: 16
-rounding: half_even
-
--- Null test
-expx900 exp # -> NaN Invalid_operation
-
-
--- Randoms P=50, within 0-999
-Precision: 50
-maxExponent: 384
-minExponent: -383
-expx1501 exp 656.35397950590285612266095596539934213943872885728 -> 1.1243757610640319783611178528839652672062820040314E+285 Inexact Rounded
-expx1502 exp 0.93620571093652800225038550600780322831236082781471 -> 2.5502865130986176689199711857825771311178046842009 Inexact Rounded
-expx1503 exp 0.00000000000000008340785856601514714183373874105791 -> 1.0000000000000000834078585660151506202691740252512 Inexact Rounded
-expx1504 exp 0.00009174057262887789625745574686545163168788456203 -> 1.0000917447809239005146722341251524081006051473273 Inexact Rounded
-expx1505 exp 33.909116897973797735657751591014926629051117541243 -> 532773181025002.03543618901306726495870476617232229 Inexact Rounded
-expx1506 exp 0.00000740470413004406592124575295278456936809587311 -> 1.0000074047315449333590066395670306135567889210814 Inexact Rounded
-expx1507 exp 0.00000000000124854922222108802453746922483071445492 -> 1.0000000000012485492222218674621176239911424968263 Inexact Rounded
-expx1508 exp 4.1793280674155659794286951159430651258356014391382 -> 65.321946520147199404199787811336860087975118278185 Inexact Rounded
-expx1509 exp 485.43595745460655893746179890255529919221550201686 -> 6.6398403920459617255950476953129377459845366585463E+210 Inexact Rounded
-expx1510 exp 0.00000000003547259806590856032527875157830328156597 -> 1.0000000000354725980665377129320589406715000685515 Inexact Rounded
-expx1511 exp 0.00000000000000759621497339104047930616478635042678 -> 1.0000000000000075962149733910693305471257715463887 Inexact Rounded
-expx1512 exp 9.7959168821760339304571595474480640286072720233796 -> 17960.261146042955179164303653412650751681436352437 Inexact Rounded
-expx1513 exp 0.00000000566642006258290526783901451194943164535581 -> 1.0000000056664200786370634609832438815665249347650 Inexact Rounded
-expx1514 exp 741.29888791134298194088827572374718940925820027354 -> 8.7501694006317332808128946666402622432064923198731E+321 Inexact Rounded
-expx1515 exp 032.75573003552517668808529099897153710887014947935 -> 168125196578678.17725841108617955904425345631092339 Inexact Rounded
-expx1516 exp 42.333700726429333308594265553422902463737399437644 -> 2428245675864172475.4681119493045657797309369672012 Inexact Rounded
-expx1517 exp 0.00000000000000559682616876491888197609158802835798 -> 1.0000000000000055968261687649345442076732739577049 Inexact Rounded
-expx1518 exp 0.00000000000080703688668280193584758300973549486312 -> 1.0000000000008070368866831275901158164321867914342 Inexact Rounded
-expx1519 exp 640.72396012796509482382712891709072570653606838251 -> 1.8318094990683394229304133068983914236995326891045E+278 Inexact Rounded
-expx1520 exp 0.00000000000000509458922167631071416948112219512224 -> 1.0000000000000050945892216763236915891499324358556 Inexact Rounded
-expx1521 exp 6.7670394314315206378625221583973414660727960241395 -> 868.73613012822031367806248697092884415119568271315 Inexact Rounded
-expx1522 exp 04.823217407412963506638267226891024138054783122548 -> 124.36457929588837129731821077586705505565904205366 Inexact Rounded
-expx1523 exp 193.51307878701196403991208482520115359690106143615 -> 1.1006830872854715677390914655452261550768957576034E+84 Inexact Rounded
-expx1524 exp 5.7307749038303650539200345901210497015617393970463 -> 308.20800743106843083522721523715645950574866495196 Inexact Rounded
-expx1525 exp 0.00000000000095217825199797965200541169123743500267 -> 1.0000000000009521782519984329737172007991390381273 Inexact Rounded
-expx1526 exp 0.00027131440949183370966393682617930153495028919140 -> 1.0002713512185751022906058160480606598754913607364 Inexact Rounded
-expx1527 exp 0.00000000064503059114680682343002315662069272707123 -> 1.0000000006450305913548390552323517403613135496633 Inexact Rounded
-expx1528 exp 0.00000000000000095616643506527288866235238548440593 -> 1.0000000000000009561664350652733457894781582009094 Inexact Rounded
-expx1529 exp 0.00000000000000086449942811678650244459550252743433 -> 1.0000000000000008644994281167868761242261096529986 Inexact Rounded
-expx1530 exp 0.06223488355635359965683053157729204988381887621850 -> 1.0642122813392406657789688931838919323826250630831 Inexact Rounded
-expx1531 exp 0.00000400710807804429435502657131912308680674057053 -> 1.0000040071161065125925620890019319832127863559260 Inexact Rounded
-expx1532 exp 85.522796894744576211573232055494551429297878413017 -> 13870073686404228452757799770251085177.853337368935 Inexact Rounded
-expx1533 exp 9.1496720811363678696938036379756663548353399954363 -> 9411.3537122832743386783597629161763057370034495157 Inexact Rounded
-expx1534 exp 8.2215705240788294472944382056330516738577785177942 -> 3720.3406813383076953899654701615084425598377758189 Inexact Rounded
-expx1535 exp 0.00000000015772064569640613142823203726821076239561 -> 1.0000000001577206457088440324683315788358926129830 Inexact Rounded
-expx1536 exp 0.58179346473959531432624153576883440625538017532480 -> 1.7892445018275360163797022372655837188423194863605 Inexact Rounded
-expx1537 exp 33.555726197149525061455517784870570470833498096559 -> 374168069896324.62578073148993526626307095854407952 Inexact Rounded
-expx1538 exp 9.7898079803906215094140010009583375537259810398659 -> 17850.878119912208888217100998019986634620368538426 Inexact Rounded
-expx1539 exp 89.157697327174521542502447953032536541038636966347 -> 525649152320166503771224149330448089550.67293829227 Inexact Rounded
-expx1540 exp 25.022947600123328912029051897171319573322888514885 -> 73676343442.952517824345431437683153304645851960524 Inexact Rounded
-
--- exp(1) at 34
-Precision: 34
-expx1200 exp 1 -> 2.718281828459045235360287471352662 Inexact Rounded
-
--- Randoms P=34, within 0-999
-Precision: 34
-maxExponent: 6144
-minExponent: -6143
-expx1201 exp 309.5948855821510212996700645087188 -> 2.853319692901387521201738015050724E+134 Inexact Rounded
-expx1202 exp 9.936543068706211420422803962680164 -> 20672.15839203171877476511093276022 Inexact Rounded
-expx1203 exp 6.307870323881505684429839491707908 -> 548.8747777054637296137277391754665 Inexact Rounded
-expx1204 exp 0.0003543281389438420535201308282503 -> 1.000354390920573746164733350843155 Inexact Rounded
-expx1205 exp 0.0000037087453363918375598394920229 -> 1.000003708752213796324841920189323 Inexact Rounded
-expx1206 exp 0.0020432312687512438040222444116585 -> 1.002045320088164826013561630975308 Inexact Rounded
-expx1207 exp 6.856313340032177672550343216129586 -> 949.8587981604144147983589660524396 Inexact Rounded
-expx1208 exp 0.0000000000402094928333815643326418 -> 1.000000000040209492834189965989612 Inexact Rounded
-expx1209 exp 0.0049610784722412117632647003545839 -> 1.004973404997901987039589029277833 Inexact Rounded
-expx1210 exp 0.0000891471883724066909746786702686 -> 1.000089151162101085412780088266699 Inexact Rounded
-expx1211 exp 08.59979170376061890684723211112566 -> 5430.528314920905714615339273738097 Inexact Rounded
-expx1212 exp 9.473117039341003854872778112752590 -> 13005.36234331224953460055897913917 Inexact Rounded
-expx1213 exp 0.0999060724692207648429969999310118 -> 1.105067116975190602296052700726802 Inexact Rounded
-expx1214 exp 0.0000000927804533555877884082269247 -> 1.000000092780457659694183954740772 Inexact Rounded
-expx1215 exp 0.0376578583872889916298772818265677 -> 1.038375900489771946477857818447556 Inexact Rounded
-expx1216 exp 261.6896411697539524911536116712307 -> 4.470613562127465095241600174941460E+113 Inexact Rounded
-expx1217 exp 0.0709997423269162980875824213889626 -> 1.073580949235407949417814485533172 Inexact Rounded
-expx1218 exp 0.0000000444605583295169895235658731 -> 1.000000044460559317887627657593900 Inexact Rounded
-expx1219 exp 0.0000021224072854777512281369815185 -> 1.000002122409537785687390631070906 Inexact Rounded
-expx1220 exp 547.5174462574156885473558485475052 -> 6.078629247383807942612114579728672E+237 Inexact Rounded
-expx1221 exp 0.0000009067598041615192002339844670 -> 1.000000906760215268314680115374387 Inexact Rounded
-expx1222 exp 0.0316476500308065365803455533244603 -> 1.032153761880187977658387961769034 Inexact Rounded
-expx1223 exp 84.46160530377645101833996706384473 -> 4.799644995897968383503269871697856E+36 Inexact Rounded
-expx1224 exp 0.0000000000520599740290848018904145 -> 1.000000000052059974030439922338393 Inexact Rounded
-expx1225 exp 0.0000006748530640093620665651726708 -> 1.000000674853291722742292331812997 Inexact Rounded
-expx1226 exp 0.0000000116853119761042020507916169 -> 1.000000011685312044377460306165203 Inexact Rounded
-expx1227 exp 0.0022593818094258636727616886693280 -> 1.002261936135876893707094845543461 Inexact Rounded
-expx1228 exp 0.0029398857673478912249856509667517 -> 1.002944211469495086813087651287012 Inexact Rounded
-expx1229 exp 0.7511480029928802775376270557636963 -> 2.119431734510320169806976569366789 Inexact Rounded
-expx1230 exp 174.9431952176750671150886423048447 -> 9.481222305374955011464619468044051E+75 Inexact Rounded
-expx1231 exp 0.0000810612451694136129199895164424 -> 1.000081064530720924186615149646920 Inexact Rounded
-expx1232 exp 51.06888989702669288180946272499035 -> 15098613888619165073959.89896018749 Inexact Rounded
-expx1233 exp 0.0000000005992887599437093651494510 -> 1.000000000599288760123282874082758 Inexact Rounded
-expx1234 exp 714.8549046761054856311108828903972 -> 2.867744544891081117381595080480784E+310 Inexact Rounded
-expx1235 exp 0.0000000004468247802990643645607110 -> 1.000000000446824780398890556720233 Inexact Rounded
-expx1236 exp 831.5818151589890366323551672043709 -> 1.417077409182624969435938062261655E+361 Inexact Rounded
-expx1237 exp 0.0000000006868323825179605747108044 -> 1.000000000686832382753829935602454 Inexact Rounded
-expx1238 exp 0.0000001306740266408976840228440255 -> 1.000000130674035178748675187648098 Inexact Rounded
-expx1239 exp 0.3182210609022267704811502412335163 -> 1.374680115667798185758927247894859 Inexact Rounded
-expx1240 exp 0.0147741234179104437440264644295501 -> 1.014883800239950682628277534839222 Inexact Rounded
-
--- Randoms P=16, within 0-99
-Precision: 16
-maxExponent: 384
-minExponent: -383
-expx1101 exp 8.473011527013724 -> 4783.900643969246 Inexact Rounded
-expx1102 exp 0.0000055753022764 -> 1.000005575317818 Inexact Rounded
-expx1103 exp 0.0000323474114482 -> 1.000032347934631 Inexact Rounded
-expx1104 exp 64.54374138544166 -> 1.073966476173531E+28 Inexact Rounded
-expx1105 exp 90.47203246416569 -> 1.956610887250643E+39 Inexact Rounded
-expx1106 exp 9.299931532342757 -> 10937.27033325227 Inexact Rounded
-expx1107 exp 8.759678437852203 -> 6372.062234495381 Inexact Rounded
-expx1108 exp 0.0000931755127172 -> 1.000093179853690 Inexact Rounded
-expx1109 exp 0.0000028101158373 -> 1.000002810119786 Inexact Rounded
-expx1110 exp 0.0000008008130919 -> 1.000000800813413 Inexact Rounded
-expx1111 exp 8.339771722299049 -> 4187.133803081878 Inexact Rounded
-expx1112 exp 0.0026140497995474 -> 1.002617469406750 Inexact Rounded
-expx1113 exp 0.7478033356261771 -> 2.112354781975418 Inexact Rounded
-expx1114 exp 51.77663761827966 -> 3.064135801120365E+22 Inexact Rounded
-expx1115 exp 0.1524989783061012 -> 1.164741272084955 Inexact Rounded
-expx1116 exp 0.0066298798669219 -> 1.006651906170791 Inexact Rounded
-expx1117 exp 9.955141865534960 -> 21060.23334287038 Inexact Rounded
-expx1118 exp 92.34503059198483 -> 1.273318993481226E+40 Inexact Rounded
-expx1119 exp 0.0000709388677346 -> 1.000070941383956 Inexact Rounded
-expx1120 exp 79.12883036433204 -> 2.318538899389243E+34 Inexact Rounded
-expx1121 exp 0.0000090881548873 -> 1.000009088196185 Inexact Rounded
-expx1122 exp 0.0424828809603411 -> 1.043398194245720 Inexact Rounded
-expx1123 exp 0.8009035891427416 -> 2.227552811933310 Inexact Rounded
-expx1124 exp 8.825786167283102 -> 6807.540455289995 Inexact Rounded
-expx1125 exp 1.535457249746275 -> 4.643448260146849 Inexact Rounded
-expx1126 exp 69.02254254355800 -> 9.464754500670653E+29 Inexact Rounded
-expx1127 exp 0.0007050554368713 -> 1.000705304046880 Inexact Rounded
-expx1128 exp 0.0000081206549504 -> 1.000008120687923 Inexact Rounded
-expx1129 exp 0.621774854641137 -> 1.862230298554903 Inexact Rounded
-expx1130 exp 3.847629031404354 -> 46.88177613568203 Inexact Rounded
-expx1131 exp 24.81250184697732 -> 59694268456.19966 Inexact Rounded
-expx1132 exp 5.107546500516044 -> 165.2643809755670 Inexact Rounded
-expx1133 exp 79.17810943951986 -> 2.435656372541360E+34 Inexact Rounded
-expx1134 exp 0.0051394695667015 -> 1.005152699295301 Inexact Rounded
-expx1135 exp 57.44504488501725 -> 8.872908566929688E+24 Inexact Rounded
-expx1136 exp 0.0000508388968036 -> 1.000050840189122 Inexact Rounded
-expx1137 exp 69.71309932148997 -> 1.888053740693541E+30 Inexact Rounded
-expx1138 exp 0.0064183412981502 -> 1.006438982988835 Inexact Rounded
-expx1139 exp 9.346991220814677 -> 11464.27802035082 Inexact Rounded
-expx1140 exp 33.09087139999152 -> 235062229168763.5 Inexact Rounded
-
--- Randoms P=7, within 0-9
-Precision: 7
-maxExponent: 96
-minExponent: -95
-expx1001 exp 2.395441 -> 10.97304 Inexact Rounded
-expx1002 exp 0.6406779 -> 1.897767 Inexact Rounded
-expx1003 exp 0.5618218 -> 1.753865 Inexact Rounded
-expx1004 exp 3.055120 -> 21.22373 Inexact Rounded
-expx1005 exp 1.536792 -> 4.649650 Inexact Rounded
-expx1006 exp 0.0801591 -> 1.083459 Inexact Rounded
-expx1007 exp 0.0966875 -> 1.101516 Inexact Rounded
-expx1008 exp 0.0646761 -> 1.066813 Inexact Rounded
-expx1009 exp 0.0095670 -> 1.009613 Inexact Rounded
-expx1010 exp 2.956859 -> 19.23745 Inexact Rounded
-expx1011 exp 7.504679 -> 1816.522 Inexact Rounded
-expx1012 exp 0.0045259 -> 1.004536 Inexact Rounded
-expx1013 exp 3.810071 -> 45.15364 Inexact Rounded
-expx1014 exp 1.502390 -> 4.492413 Inexact Rounded
-expx1015 exp 0.0321523 -> 1.032675 Inexact Rounded
-expx1016 exp 0.0057214 -> 1.005738 Inexact Rounded
-expx1017 exp 9.811445 -> 18241.33 Inexact Rounded
-expx1018 exp 3.245249 -> 25.66810 Inexact Rounded
-expx1019 exp 0.3189742 -> 1.375716 Inexact Rounded
-expx1020 exp 0.8621610 -> 2.368273 Inexact Rounded
-expx1021 exp 0.0122511 -> 1.012326 Inexact Rounded
-expx1022 exp 2.202088 -> 9.043877 Inexact Rounded
-expx1023 exp 8.778203 -> 6491.202 Inexact Rounded
-expx1024 exp 0.1896279 -> 1.208800 Inexact Rounded
-expx1025 exp 0.4510947 -> 1.570030 Inexact Rounded
-expx1026 exp 0.276413 -> 1.318392 Inexact Rounded
-expx1027 exp 4.490067 -> 89.12742 Inexact Rounded
-expx1028 exp 0.0439786 -> 1.044960 Inexact Rounded
-expx1029 exp 0.8168245 -> 2.263301 Inexact Rounded
-expx1030 exp 0.0391658 -> 1.039943 Inexact Rounded
-expx1031 exp 9.261816 -> 10528.24 Inexact Rounded
-expx1032 exp 9.611186 -> 14930.87 Inexact Rounded
-expx1033 exp 9.118125 -> 9119.087 Inexact Rounded
-expx1034 exp 9.469083 -> 12953.00 Inexact Rounded
-expx1035 exp 0.0499983 -> 1.051269 Inexact Rounded
-expx1036 exp 0.0050746 -> 1.005087 Inexact Rounded
-expx1037 exp 0.0014696 -> 1.001471 Inexact Rounded
-expx1038 exp 9.138494 -> 9306.739 Inexact Rounded
-expx1039 exp 0.0065436 -> 1.006565 Inexact Rounded
-expx1040 exp 0.7284803 -> 2.071930 Inexact Rounded
-
+------------------------------------------------------------------------
+-- exp.decTest -- decimal natural exponentiation --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Tests of the exponential funtion. Currently all testcases here
+-- show results which are correctly rounded (within <= 0.5 ulp).
+
+extended: 1
+precision: 9
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- basics (examples in specificiation, etc.)
+expx001 exp -Infinity -> 0
+expx002 exp -10 -> 0.0000453999298 Inexact Rounded
+expx003 exp -1 -> 0.367879441 Inexact Rounded
+expx004 exp 0 -> 1
+expx005 exp -0 -> 1
+expx006 exp 1 -> 2.71828183 Inexact Rounded
+expx007 exp 0.693147181 -> 2.00000000 Inexact Rounded
+expx008 exp 10 -> 22026.4658 Inexact Rounded
+expx009 exp +Infinity -> Infinity
+
+-- tiny edge cases
+precision: 7
+expx011 exp 0.1 -> 1.105171 Inexact Rounded
+expx012 exp 0.01 -> 1.010050 Inexact Rounded
+expx013 exp 0.001 -> 1.001001 Inexact Rounded
+expx014 exp 0.0001 -> 1.000100 Inexact Rounded
+expx015 exp 0.00001 -> 1.000010 Inexact Rounded
+expx016 exp 0.000001 -> 1.000001 Inexact Rounded
+expx017 exp 0.0000001 -> 1.000000 Inexact Rounded
+expx018 exp 0.0000003 -> 1.000000 Inexact Rounded
+expx019 exp 0.0000004 -> 1.000000 Inexact Rounded
+expx020 exp 0.0000005 -> 1.000001 Inexact Rounded
+expx021 exp 0.0000008 -> 1.000001 Inexact Rounded
+expx022 exp 0.0000009 -> 1.000001 Inexact Rounded
+expx023 exp 0.0000010 -> 1.000001 Inexact Rounded
+expx024 exp 0.0000011 -> 1.000001 Inexact Rounded
+expx025 exp 0.00000009 -> 1.000000 Inexact Rounded
+expx026 exp 0.00000005 -> 1.000000 Inexact Rounded
+expx027 exp 0.00000004 -> 1.000000 Inexact Rounded
+expx028 exp 0.00000001 -> 1.000000 Inexact Rounded
+
+-- and some more zeros
+expx030 exp 0.00000000 -> 1
+expx031 exp 0E+100 -> 1
+expx032 exp 0E-100 -> 1
+expx033 exp -0.00000000 -> 1
+expx034 exp -0E+100 -> 1
+expx035 exp -0E-100 -> 1
+
+-- basic e=0, e=1, e=2, e=4, e>=8 cases
+precision: 7
+expx041 exp 1 -> 2.718282 Inexact Rounded
+expx042 exp -1 -> 0.3678794 Inexact Rounded
+expx043 exp 10 -> 22026.47 Inexact Rounded
+expx044 exp -10 -> 0.00004539993 Inexact Rounded
+expx045 exp 100 -> 2.688117E+43 Inexact Rounded
+expx046 exp -100 -> 3.720076E-44 Inexact Rounded
+expx047 exp 1000 -> Infinity Overflow Inexact Rounded
+expx048 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx049 exp 100000000 -> Infinity Overflow Inexact Rounded
+expx050 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+
+-- miscellanea
+-- similar to 'VF bug' test, at 17, but with last digit corrected for decimal
+precision: 16
+expx055 exp -5.42410311287441459172E+2 -> 2.717658486884572E-236 Inexact Rounded
+-- result from NetRexx/Java prototype -> 2.7176584868845721117677929628617246054459644711108E-236
+-- result from Rexx (series) version -> 2.717658486884572111767792962861724605446E-236
+precision: 17
+expx056 exp -5.42410311287441459172E+2 -> 2.7176584868845721E-236 Inexact Rounded
+precision: 18
+expx057 exp -5.42410311287441459172E+2 -> 2.71765848688457211E-236 Inexact Rounded
+precision: 19
+expx058 exp -5.42410311287441459172E+2 -> 2.717658486884572112E-236 Inexact Rounded
+precision: 20
+expx059 exp -5.42410311287441459172E+2 -> 2.7176584868845721118E-236 Inexact Rounded
+
+-- rounding in areas of ..500.., ..499.., ..100.., ..999.. sequences
+precision: 50
+expx101 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
+precision: 31
+expx102 exp -9E-8 -> 0.9999999100000040499998785000027 Inexact Rounded
+precision: 30
+expx103 exp -9E-8 -> 0.999999910000004049999878500003 Inexact Rounded
+precision: 29
+expx104 exp -9E-8 -> 0.99999991000000404999987850000 Inexact Rounded
+precision: 28
+expx105 exp -9E-8 -> 0.9999999100000040499998785000 Inexact Rounded
+precision: 27
+expx106 exp -9E-8 -> 0.999999910000004049999878500 Inexact Rounded
+precision: 26
+expx107 exp -9E-8 -> 0.99999991000000404999987850 Inexact Rounded
+precision: 25
+expx108 exp -9E-8 -> 0.9999999100000040499998785 Inexact Rounded
+precision: 24
+expx109 exp -9E-8 -> 0.999999910000004049999879 Inexact Rounded
+precision: 23
+expx110 exp -9E-8 -> 0.99999991000000404999988 Inexact Rounded
+precision: 22
+expx111 exp -9E-8 -> 0.9999999100000040499999 Inexact Rounded
+precision: 21
+expx112 exp -9E-8 -> 0.999999910000004050000 Inexact Rounded
+precision: 20
+expx113 exp -9E-8 -> 0.99999991000000405000 Inexact Rounded
+precision: 19
+expx114 exp -9E-8 -> 0.9999999100000040500 Inexact Rounded
+precision: 18
+expx115 exp -9E-8 -> 0.999999910000004050 Inexact Rounded
+precision: 17
+expx116 exp -9E-8 -> 0.99999991000000405 Inexact Rounded
+precision: 16
+expx117 exp -9E-8 -> 0.9999999100000040 Inexact Rounded
+precision: 15
+expx118 exp -9E-8 -> 0.999999910000004 Inexact Rounded
+precision: 14
+expx119 exp -9E-8 -> 0.99999991000000 Inexact Rounded
+precision: 13
+expx120 exp -9E-8 -> 0.9999999100000 Inexact Rounded
+precision: 12
+expx121 exp -9E-8 -> 0.999999910000 Inexact Rounded
+precision: 11
+expx122 exp -9E-8 -> 0.99999991000 Inexact Rounded
+precision: 10
+expx123 exp -9E-8 -> 0.9999999100 Inexact Rounded
+precision: 9
+expx124 exp -9E-8 -> 0.999999910 Inexact Rounded
+precision: 8
+expx125 exp -9E-8 -> 0.99999991 Inexact Rounded
+precision: 7
+expx126 exp -9E-8 -> 0.9999999 Inexact Rounded
+precision: 6
+expx127 exp -9E-8 -> 1.00000 Inexact Rounded
+precision: 5
+expx128 exp -9E-8 -> 1.0000 Inexact Rounded
+precision: 4
+expx129 exp -9E-8 -> 1.000 Inexact Rounded
+precision: 3
+expx130 exp -9E-8 -> 1.00 Inexact Rounded
+precision: 2
+expx131 exp -9E-8 -> 1.0 Inexact Rounded
+precision: 1
+expx132 exp -9E-8 -> 1 Inexact Rounded
+
+
+-- sanity checks, with iteration counts [normalized so 0<=|x|<1]
+precision: 50
+
+expx210 exp 0 -> 1
+-- iterations: 2
+expx211 exp -1E-40 -> 0.99999999999999999999999999999999999999990000000000 Inexact Rounded
+-- iterations: 8
+expx212 exp -9E-7 -> 0.99999910000040499987850002733749507925073811240510 Inexact Rounded
+-- iterations: 6
+expx213 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
+-- iterations: 15
+expx214 exp -0.003 -> 0.99700449550337297601206623409756091074177480489845 Inexact Rounded
+-- iterations: 14
+expx215 exp -0.001 -> 0.99900049983337499166805535716765597470235590236008 Inexact Rounded
+-- iterations: 26
+expx216 exp -0.1 -> 0.90483741803595957316424905944643662119470536098040 Inexact Rounded
+-- iterations: 39
+expx217 exp -0.7 -> 0.49658530379140951470480009339752896170766716571182 Inexact Rounded
+-- iterations: 41
+expx218 exp -0.9 -> 0.40656965974059911188345423964562598783370337617038 Inexact Rounded
+-- iterations: 43
+expx219 exp -0.99 -> 0.37157669102204569053152411990820138691802885490501 Inexact Rounded
+-- iterations: 26
+expx220 exp -1 -> 0.36787944117144232159552377016146086744581113103177 Inexact Rounded
+-- iterations: 26
+expx221 exp -1.01 -> 0.36421897957152331975704629563734548959589139192482 Inexact Rounded
+-- iterations: 27
+expx222 exp -1.1 -> 0.33287108369807955328884690643131552161247952156921 Inexact Rounded
+-- iterations: 28
+expx223 exp -1.5 -> 0.22313016014842982893328047076401252134217162936108 Inexact Rounded
+-- iterations: 30
+expx224 exp -2 -> 0.13533528323661269189399949497248440340763154590958 Inexact Rounded
+-- iterations: 36
+expx225 exp -5 -> 0.0067379469990854670966360484231484242488495850273551 Inexact Rounded
+-- iterations: 26
+expx226 exp -10 -> 0.000045399929762484851535591515560550610237918088866565 Inexact Rounded
+-- iterations: 28
+expx227 exp -14 -> 8.3152871910356788406398514256526229460765836498457E-7 Inexact Rounded
+-- iterations: 29
+expx228 exp -15 -> 3.0590232050182578837147949770228963937082078081856E-7 Inexact Rounded
+-- iterations: 30
+expx233 exp 0 -> 1
+-- iterations: 2
+expx234 exp 1E-40 -> 1.0000000000000000000000000000000000000001000000000 Inexact Rounded
+-- iterations: 7
+expx235 exp 9E-7 -> 1.0000009000004050001215000273375049207507381125949 Inexact Rounded
+-- iterations: 6
+expx236 exp 9E-8 -> 1.0000000900000040500001215000027337500492075007381 Inexact Rounded
+-- iterations: 15
+expx237 exp 0.003 -> 1.0030045045033770260129340913489002053318727195619 Inexact Rounded
+-- iterations: 13
+expx238 exp 0.001 -> 1.0010005001667083416680557539930583115630762005807 Inexact Rounded
+-- iterations: 25
+expx239 exp 0.1 -> 1.1051709180756476248117078264902466682245471947375 Inexact Rounded
+-- iterations: 38
+expx240 exp 0.7 -> 2.0137527074704765216245493885830652700175423941459 Inexact Rounded
+-- iterations: 41
+expx241 exp 0.9 -> 2.4596031111569496638001265636024706954217723064401 Inexact Rounded
+-- iterations: 42
+expx242 exp 0.99 -> 2.6912344723492622890998794040710139721802931841030 Inexact Rounded
+-- iterations: 26
+expx243 exp 1 -> 2.7182818284590452353602874713526624977572470937000 Inexact Rounded
+-- iterations: 26
+expx244 exp 1.01 -> 2.7456010150169164939897763166603876240737508195960 Inexact Rounded
+-- iterations: 26
+expx245 exp 1.1 -> 3.0041660239464331120584079535886723932826810260163 Inexact Rounded
+-- iterations: 28
+expx246 exp 1.5 -> 4.4816890703380648226020554601192758190057498683697 Inexact Rounded
+-- iterations: 29
+expx247 exp 2 -> 7.3890560989306502272304274605750078131803155705518 Inexact Rounded
+-- iterations: 36
+expx248 exp 5 -> 148.41315910257660342111558004055227962348766759388 Inexact Rounded
+-- iterations: 26
+expx249 exp 10 -> 22026.465794806716516957900645284244366353512618557 Inexact Rounded
+-- iterations: 28
+expx250 exp 14 -> 1202604.2841647767777492367707678594494124865433761 Inexact Rounded
+-- iterations: 28
+expx251 exp 15 -> 3269017.3724721106393018550460917213155057385438200 Inexact Rounded
+-- iterations: 29
+
+-- a biggie [result verified 3 ways]
+precision: 250
+expx260 exp 1 -> 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668 Inexact Rounded
+
+-- extreme range boundaries
+precision: 16
+maxExponent: 999999
+minExponent: -999999
+-- Ntiny boundary
+expx290 exp -2302618.022332529 -> 0E-1000014 Underflow Subnormal Inexact Rounded Clamped
+expx291 exp -2302618.022332528 -> 1E-1000014 Underflow Subnormal Inexact Rounded
+-- Nmax/10 and Nmax boundary
+expx292 exp 2302582.790408952 -> 9.999999993100277E+999998 Inexact Rounded
+expx293 exp 2302582.790408953 -> 1.000000000310028E+999999 Inexact Rounded
+expx294 exp 2302585.092993946 -> 9.999999003159870E+999999 Inexact Rounded
+expx295 exp 2302585.092994036 -> 9.999999903159821E+999999 Inexact Rounded
+expx296 exp 2302585.092994045 -> 9.999999993159820E+999999 Inexact Rounded
+expx297 exp 2302585.092994046 -> Infinity Overflow Inexact Rounded
+
+-- 0<-x<<1 effects
+precision: 30
+expx320 exp -4.9999999999999E-8 -> 0.999999950000001250000979166617 Inexact Rounded
+expx321 exp -5.0000000000000E-8 -> 0.999999950000001249999979166667 Inexact Rounded
+expx322 exp -5.0000000000001E-8 -> 0.999999950000001249998979166717 Inexact Rounded
+precision: 20
+expx323 exp -4.9999999999999E-8 -> 0.99999995000000125000 Inexact Rounded
+expx324 exp -5.0000000000000E-8 -> 0.99999995000000125000 Inexact Rounded
+expx325 exp -5.0000000000001E-8 -> 0.99999995000000125000 Inexact Rounded
+precision: 14
+expx326 exp -4.9999999999999E-8 -> 0.99999995000000 Inexact Rounded
+expx327 exp -5.0000000000000E-8 -> 0.99999995000000 Inexact Rounded
+expx328 exp -5.0000000000001E-8 -> 0.99999995000000 Inexact Rounded
+-- overprecise and 0<-x<<1
+precision: 8
+expx330 exp -4.9999999999999E-8 -> 0.99999995 Inexact Rounded
+expx331 exp -5.0000000000000E-8 -> 0.99999995 Inexact Rounded
+expx332 exp -5.0000000000001E-8 -> 0.99999995 Inexact Rounded
+precision: 7
+expx333 exp -4.9999999999999E-8 -> 1.000000 Inexact Rounded
+expx334 exp -5.0000000000000E-8 -> 1.000000 Inexact Rounded
+expx335 exp -5.0000000000001E-8 -> 1.000000 Inexact Rounded
+precision: 3
+expx336 exp -4.9999999999999E-8 -> 1.00 Inexact Rounded
+expx337 exp -5.0000000000000E-8 -> 1.00 Inexact Rounded
+expx338 exp -5.0000000000001E-8 -> 1.00 Inexact Rounded
+
+-- 0<x<<1 effects
+precision: 30
+expx340 exp 4.9999999999999E-8 -> 1.00000005000000124999902083328 Inexact Rounded
+expx341 exp 5.0000000000000E-8 -> 1.00000005000000125000002083333 Inexact Rounded
+expx342 exp 5.0000000000001E-8 -> 1.00000005000000125000102083338 Inexact Rounded
+precision: 20
+expx343 exp 4.9999999999999E-8 -> 1.0000000500000012500 Inexact Rounded
+expx344 exp 5.0000000000000E-8 -> 1.0000000500000012500 Inexact Rounded
+expx345 exp 5.0000000000001E-8 -> 1.0000000500000012500 Inexact Rounded
+precision: 14
+expx346 exp 4.9999999999999E-8 -> 1.0000000500000 Inexact Rounded
+expx347 exp 5.0000000000000E-8 -> 1.0000000500000 Inexact Rounded
+expx348 exp 5.0000000000001E-8 -> 1.0000000500000 Inexact Rounded
+-- overprecise and 0<x<<1
+precision: 8
+expx350 exp 4.9999999999999E-8 -> 1.0000001 Inexact Rounded
+expx351 exp 5.0000000000000E-8 -> 1.0000001 Inexact Rounded
+expx352 exp 5.0000000000001E-8 -> 1.0000001 Inexact Rounded
+precision: 7
+expx353 exp 4.9999999999999E-8 -> 1.000000 Inexact Rounded
+expx354 exp 5.0000000000000E-8 -> 1.000000 Inexact Rounded
+expx355 exp 5.0000000000001E-8 -> 1.000000 Inexact Rounded
+precision: 3
+expx356 exp 4.9999999999999E-8 -> 1.00 Inexact Rounded
+expx357 exp 5.0000000000000E-8 -> 1.00 Inexact Rounded
+expx358 exp 5.0000000000001E-8 -> 1.00 Inexact Rounded
+
+-- cases near 1 -- 1 2345678901234567890
+precision: 20
+expx401 exp 0.99999999999996 -> 2.7182818284589365041 Inexact Rounded
+expx402 exp 0.99999999999997 -> 2.7182818284589636869 Inexact Rounded
+expx403 exp 0.99999999999998 -> 2.7182818284589908697 Inexact Rounded
+expx404 exp 0.99999999999999 -> 2.7182818284590180525 Inexact Rounded
+expx405 exp 1.0000000000000 -> 2.7182818284590452354 Inexact Rounded
+expx406 exp 1.0000000000001 -> 2.7182818284593170635 Inexact Rounded
+expx407 exp 1.0000000000002 -> 2.7182818284595888917 Inexact Rounded
+precision: 14
+expx411 exp 0.99999999999996 -> 2.7182818284589 Inexact Rounded
+expx412 exp 0.99999999999997 -> 2.7182818284590 Inexact Rounded
+expx413 exp 0.99999999999998 -> 2.7182818284590 Inexact Rounded
+expx414 exp 0.99999999999999 -> 2.7182818284590 Inexact Rounded
+expx415 exp 1.0000000000000 -> 2.7182818284590 Inexact Rounded
+expx416 exp 1.0000000000001 -> 2.7182818284593 Inexact Rounded
+expx417 exp 1.0000000000002 -> 2.7182818284596 Inexact Rounded
+-- overprecise...
+precision: 7
+expx421 exp 0.99999999999996 -> 2.718282 Inexact Rounded
+expx422 exp 0.99999999999997 -> 2.718282 Inexact Rounded
+expx423 exp 0.99999999999998 -> 2.718282 Inexact Rounded
+expx424 exp 0.99999999999999 -> 2.718282 Inexact Rounded
+expx425 exp 1.0000000000001 -> 2.718282 Inexact Rounded
+expx426 exp 1.0000000000002 -> 2.718282 Inexact Rounded
+expx427 exp 1.0000000000003 -> 2.718282 Inexact Rounded
+precision: 2
+expx431 exp 0.99999999999996 -> 2.7 Inexact Rounded
+expx432 exp 0.99999999999997 -> 2.7 Inexact Rounded
+expx433 exp 0.99999999999998 -> 2.7 Inexact Rounded
+expx434 exp 0.99999999999999 -> 2.7 Inexact Rounded
+expx435 exp 1.0000000000001 -> 2.7 Inexact Rounded
+expx436 exp 1.0000000000002 -> 2.7 Inexact Rounded
+expx437 exp 1.0000000000003 -> 2.7 Inexact Rounded
+
+-- basics at low precisions
+precision: 3
+expx501 exp -Infinity -> 0
+expx502 exp -10 -> 0.0000454 Inexact Rounded
+expx503 exp -1 -> 0.368 Inexact Rounded
+expx504 exp 0 -> 1
+expx505 exp -0 -> 1
+expx506 exp 1 -> 2.72 Inexact Rounded
+expx507 exp 0.693147181 -> 2.00 Inexact Rounded
+expx508 exp 10 -> 2.20E+4 Inexact Rounded
+expx509 exp +Infinity -> Infinity
+precision: 2
+expx511 exp -Infinity -> 0
+expx512 exp -10 -> 0.000045 Inexact Rounded
+expx513 exp -1 -> 0.37 Inexact Rounded
+expx514 exp 0 -> 1
+expx515 exp -0 -> 1
+expx516 exp 1 -> 2.7 Inexact Rounded
+expx517 exp 0.693147181 -> 2.0 Inexact Rounded
+expx518 exp 10 -> 2.2E+4 Inexact Rounded
+expx519 exp +Infinity -> Infinity
+precision: 1
+expx521 exp -Infinity -> 0
+expx522 exp -10 -> 0.00005 Inexact Rounded
+expx523 exp -1 -> 0.4 Inexact Rounded
+expx524 exp 0 -> 1
+expx525 exp -0 -> 1
+expx526 exp 1 -> 3 Inexact Rounded
+expx527 exp 0.693147181 -> 2 Inexact Rounded
+expx528 exp 10 -> 2E+4 Inexact Rounded
+expx529 exp +Infinity -> Infinity
+
+-- overflows, including some overprecise borderlines
+precision: 7
+maxExponent: 384
+minExponent: -383
+expx701 exp 1000000000 -> Infinity Overflow Inexact Rounded
+expx702 exp 100000000 -> Infinity Overflow Inexact Rounded
+expx703 exp 10000000 -> Infinity Overflow Inexact Rounded
+expx704 exp 1000000 -> Infinity Overflow Inexact Rounded
+expx705 exp 100000 -> Infinity Overflow Inexact Rounded
+expx706 exp 10000 -> Infinity Overflow Inexact Rounded
+expx707 exp 1000 -> Infinity Overflow Inexact Rounded
+expx708 exp 886.4952608 -> Infinity Overflow Inexact Rounded
+expx709 exp 886.4952607 -> 9.999999E+384 Inexact Rounded
+expx710 exp 886.49527 -> Infinity Overflow Inexact Rounded
+expx711 exp 886.49526 -> 9.999992E+384 Inexact Rounded
+precision: 16
+expx721 exp 886.4952608027075883 -> Infinity Overflow Inexact Rounded
+expx722 exp 886.4952608027075882 -> 9.999999999999999E+384 Inexact Rounded
+expx723 exp 886.49526080270759 -> Infinity Overflow Inexact Rounded
+expx724 exp 886.49526080270758 -> 9.999999999999917E+384 Inexact Rounded
+expx725 exp 886.4952608027076 -> Infinity Overflow Inexact Rounded
+expx726 exp 886.4952608027075 -> 9.999999999999117E+384 Inexact Rounded
+-- and by special request ...
+precision: 15
+expx731 exp 886.495260802708 -> Infinity Overflow Inexact Rounded
+expx732 exp 886.495260802707 -> 9.99999999999412E+384 Inexact Rounded
+expx733 exp 886.495260802706 -> 9.99999999998412E+384 Inexact Rounded
+maxExponent: 999
+minExponent: -999
+expx735 exp 2302.58509299405 -> Infinity Overflow Inexact Rounded
+expx736 exp 2302.58509299404 -> 9.99999999994316E+999 Inexact Rounded
+expx737 exp 2302.58509299403 -> 9.99999999984316E+999 Inexact Rounded
+
+-- subnormals and underflows, including underflow-to-zero edge point
+precision: 7
+maxExponent: 384
+minExponent: -383
+expx751 exp -1000000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx752 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx753 exp -10000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx754 exp -1000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx755 exp -100000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx756 exp -10000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx757 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx758 exp -881.89009 -> 1.000001E-383 Inexact Rounded
+expx759 exp -881.8901 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
+expx760 exp -885 -> 4.4605E-385 Inexact Rounded Underflow Subnormal
+expx761 exp -888 -> 2.221E-386 Inexact Rounded Underflow Subnormal
+expx762 exp -890 -> 3.01E-387 Inexact Rounded Underflow Subnormal
+expx763 exp -892.9 -> 1.7E-388 Inexact Rounded Underflow Subnormal
+expx764 exp -893 -> 1.5E-388 Inexact Rounded Underflow Subnormal
+expx765 exp -893.5 -> 9E-389 Inexact Rounded Underflow Subnormal
+expx766 exp -895.7056 -> 1E-389 Inexact Rounded Underflow Subnormal
+expx769 exp -895.8 -> 1E-389 Inexact Rounded Underflow Subnormal
+expx770 exp -895.73 -> 1E-389 Inexact Rounded Underflow Subnormal
+expx771 exp -896.3987 -> 1E-389 Inexact Rounded Underflow Subnormal
+expx772 exp -896.3988 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
+expx773 exp -898.0081 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
+expx774 exp -898.0082 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
+
+-- special values
+maxexponent: 999
+minexponent: -999
+expx820 exp Inf -> Infinity
+expx821 exp -Inf -> 0
+expx822 exp NaN -> NaN
+expx823 exp sNaN -> NaN Invalid_operation
+-- propagating NaNs
+expx824 exp sNaN123 -> NaN123 Invalid_operation
+expx825 exp -sNaN321 -> -NaN321 Invalid_operation
+expx826 exp NaN456 -> NaN456
+expx827 exp -NaN654 -> -NaN654
+expx828 exp NaN1 -> NaN1
+
+-- Invalid operations due to restrictions
+-- [next two probably skipped by most test harnesses]
+precision: 100000000
+expx901 exp -Infinity -> NaN Invalid_context
+precision: 99999999
+expx902 exp -Infinity -> NaN Invalid_context
+
+precision: 9
+maxExponent: 1000000
+minExponent: -999999
+expx903 exp -Infinity -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999999
+expx904 exp -Infinity -> 0
+maxExponent: 999999
+minExponent: -1000000
+expx905 exp -Infinity -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999998
+expx906 exp -Infinity -> 0
+
+--
+maxExponent: 384
+minExponent: -383
+precision: 16
+rounding: half_even
+
+-- Null test
+expx900 exp # -> NaN Invalid_operation
+
+
+-- Randoms P=50, within 0-999
+Precision: 50
+maxExponent: 384
+minExponent: -383
+expx1501 exp 656.35397950590285612266095596539934213943872885728 -> 1.1243757610640319783611178528839652672062820040314E+285 Inexact Rounded
+expx1502 exp 0.93620571093652800225038550600780322831236082781471 -> 2.5502865130986176689199711857825771311178046842009 Inexact Rounded
+expx1503 exp 0.00000000000000008340785856601514714183373874105791 -> 1.0000000000000000834078585660151506202691740252512 Inexact Rounded
+expx1504 exp 0.00009174057262887789625745574686545163168788456203 -> 1.0000917447809239005146722341251524081006051473273 Inexact Rounded
+expx1505 exp 33.909116897973797735657751591014926629051117541243 -> 532773181025002.03543618901306726495870476617232229 Inexact Rounded
+expx1506 exp 0.00000740470413004406592124575295278456936809587311 -> 1.0000074047315449333590066395670306135567889210814 Inexact Rounded
+expx1507 exp 0.00000000000124854922222108802453746922483071445492 -> 1.0000000000012485492222218674621176239911424968263 Inexact Rounded
+expx1508 exp 4.1793280674155659794286951159430651258356014391382 -> 65.321946520147199404199787811336860087975118278185 Inexact Rounded
+expx1509 exp 485.43595745460655893746179890255529919221550201686 -> 6.6398403920459617255950476953129377459845366585463E+210 Inexact Rounded
+expx1510 exp 0.00000000003547259806590856032527875157830328156597 -> 1.0000000000354725980665377129320589406715000685515 Inexact Rounded
+expx1511 exp 0.00000000000000759621497339104047930616478635042678 -> 1.0000000000000075962149733910693305471257715463887 Inexact Rounded
+expx1512 exp 9.7959168821760339304571595474480640286072720233796 -> 17960.261146042955179164303653412650751681436352437 Inexact Rounded
+expx1513 exp 0.00000000566642006258290526783901451194943164535581 -> 1.0000000056664200786370634609832438815665249347650 Inexact Rounded
+expx1514 exp 741.29888791134298194088827572374718940925820027354 -> 8.7501694006317332808128946666402622432064923198731E+321 Inexact Rounded
+expx1515 exp 032.75573003552517668808529099897153710887014947935 -> 168125196578678.17725841108617955904425345631092339 Inexact Rounded
+expx1516 exp 42.333700726429333308594265553422902463737399437644 -> 2428245675864172475.4681119493045657797309369672012 Inexact Rounded
+expx1517 exp 0.00000000000000559682616876491888197609158802835798 -> 1.0000000000000055968261687649345442076732739577049 Inexact Rounded
+expx1518 exp 0.00000000000080703688668280193584758300973549486312 -> 1.0000000000008070368866831275901158164321867914342 Inexact Rounded
+expx1519 exp 640.72396012796509482382712891709072570653606838251 -> 1.8318094990683394229304133068983914236995326891045E+278 Inexact Rounded
+expx1520 exp 0.00000000000000509458922167631071416948112219512224 -> 1.0000000000000050945892216763236915891499324358556 Inexact Rounded
+expx1521 exp 6.7670394314315206378625221583973414660727960241395 -> 868.73613012822031367806248697092884415119568271315 Inexact Rounded
+expx1522 exp 04.823217407412963506638267226891024138054783122548 -> 124.36457929588837129731821077586705505565904205366 Inexact Rounded
+expx1523 exp 193.51307878701196403991208482520115359690106143615 -> 1.1006830872854715677390914655452261550768957576034E+84 Inexact Rounded
+expx1524 exp 5.7307749038303650539200345901210497015617393970463 -> 308.20800743106843083522721523715645950574866495196 Inexact Rounded
+expx1525 exp 0.00000000000095217825199797965200541169123743500267 -> 1.0000000000009521782519984329737172007991390381273 Inexact Rounded
+expx1526 exp 0.00027131440949183370966393682617930153495028919140 -> 1.0002713512185751022906058160480606598754913607364 Inexact Rounded
+expx1527 exp 0.00000000064503059114680682343002315662069272707123 -> 1.0000000006450305913548390552323517403613135496633 Inexact Rounded
+expx1528 exp 0.00000000000000095616643506527288866235238548440593 -> 1.0000000000000009561664350652733457894781582009094 Inexact Rounded
+expx1529 exp 0.00000000000000086449942811678650244459550252743433 -> 1.0000000000000008644994281167868761242261096529986 Inexact Rounded
+expx1530 exp 0.06223488355635359965683053157729204988381887621850 -> 1.0642122813392406657789688931838919323826250630831 Inexact Rounded
+expx1531 exp 0.00000400710807804429435502657131912308680674057053 -> 1.0000040071161065125925620890019319832127863559260 Inexact Rounded
+expx1532 exp 85.522796894744576211573232055494551429297878413017 -> 13870073686404228452757799770251085177.853337368935 Inexact Rounded
+expx1533 exp 9.1496720811363678696938036379756663548353399954363 -> 9411.3537122832743386783597629161763057370034495157 Inexact Rounded
+expx1534 exp 8.2215705240788294472944382056330516738577785177942 -> 3720.3406813383076953899654701615084425598377758189 Inexact Rounded
+expx1535 exp 0.00000000015772064569640613142823203726821076239561 -> 1.0000000001577206457088440324683315788358926129830 Inexact Rounded
+expx1536 exp 0.58179346473959531432624153576883440625538017532480 -> 1.7892445018275360163797022372655837188423194863605 Inexact Rounded
+expx1537 exp 33.555726197149525061455517784870570470833498096559 -> 374168069896324.62578073148993526626307095854407952 Inexact Rounded
+expx1538 exp 9.7898079803906215094140010009583375537259810398659 -> 17850.878119912208888217100998019986634620368538426 Inexact Rounded
+expx1539 exp 89.157697327174521542502447953032536541038636966347 -> 525649152320166503771224149330448089550.67293829227 Inexact Rounded
+expx1540 exp 25.022947600123328912029051897171319573322888514885 -> 73676343442.952517824345431437683153304645851960524 Inexact Rounded
+
+-- exp(1) at 34
+Precision: 34
+expx1200 exp 1 -> 2.718281828459045235360287471352662 Inexact Rounded
+
+-- Randoms P=34, within 0-999
+Precision: 34
+maxExponent: 6144
+minExponent: -6143
+expx1201 exp 309.5948855821510212996700645087188 -> 2.853319692901387521201738015050724E+134 Inexact Rounded
+expx1202 exp 9.936543068706211420422803962680164 -> 20672.15839203171877476511093276022 Inexact Rounded
+expx1203 exp 6.307870323881505684429839491707908 -> 548.8747777054637296137277391754665 Inexact Rounded
+expx1204 exp 0.0003543281389438420535201308282503 -> 1.000354390920573746164733350843155 Inexact Rounded
+expx1205 exp 0.0000037087453363918375598394920229 -> 1.000003708752213796324841920189323 Inexact Rounded
+expx1206 exp 0.0020432312687512438040222444116585 -> 1.002045320088164826013561630975308 Inexact Rounded
+expx1207 exp 6.856313340032177672550343216129586 -> 949.8587981604144147983589660524396 Inexact Rounded
+expx1208 exp 0.0000000000402094928333815643326418 -> 1.000000000040209492834189965989612 Inexact Rounded
+expx1209 exp 0.0049610784722412117632647003545839 -> 1.004973404997901987039589029277833 Inexact Rounded
+expx1210 exp 0.0000891471883724066909746786702686 -> 1.000089151162101085412780088266699 Inexact Rounded
+expx1211 exp 08.59979170376061890684723211112566 -> 5430.528314920905714615339273738097 Inexact Rounded
+expx1212 exp 9.473117039341003854872778112752590 -> 13005.36234331224953460055897913917 Inexact Rounded
+expx1213 exp 0.0999060724692207648429969999310118 -> 1.105067116975190602296052700726802 Inexact Rounded
+expx1214 exp 0.0000000927804533555877884082269247 -> 1.000000092780457659694183954740772 Inexact Rounded
+expx1215 exp 0.0376578583872889916298772818265677 -> 1.038375900489771946477857818447556 Inexact Rounded
+expx1216 exp 261.6896411697539524911536116712307 -> 4.470613562127465095241600174941460E+113 Inexact Rounded
+expx1217 exp 0.0709997423269162980875824213889626 -> 1.073580949235407949417814485533172 Inexact Rounded
+expx1218 exp 0.0000000444605583295169895235658731 -> 1.000000044460559317887627657593900 Inexact Rounded
+expx1219 exp 0.0000021224072854777512281369815185 -> 1.000002122409537785687390631070906 Inexact Rounded
+expx1220 exp 547.5174462574156885473558485475052 -> 6.078629247383807942612114579728672E+237 Inexact Rounded
+expx1221 exp 0.0000009067598041615192002339844670 -> 1.000000906760215268314680115374387 Inexact Rounded
+expx1222 exp 0.0316476500308065365803455533244603 -> 1.032153761880187977658387961769034 Inexact Rounded
+expx1223 exp 84.46160530377645101833996706384473 -> 4.799644995897968383503269871697856E+36 Inexact Rounded
+expx1224 exp 0.0000000000520599740290848018904145 -> 1.000000000052059974030439922338393 Inexact Rounded
+expx1225 exp 0.0000006748530640093620665651726708 -> 1.000000674853291722742292331812997 Inexact Rounded
+expx1226 exp 0.0000000116853119761042020507916169 -> 1.000000011685312044377460306165203 Inexact Rounded
+expx1227 exp 0.0022593818094258636727616886693280 -> 1.002261936135876893707094845543461 Inexact Rounded
+expx1228 exp 0.0029398857673478912249856509667517 -> 1.002944211469495086813087651287012 Inexact Rounded
+expx1229 exp 0.7511480029928802775376270557636963 -> 2.119431734510320169806976569366789 Inexact Rounded
+expx1230 exp 174.9431952176750671150886423048447 -> 9.481222305374955011464619468044051E+75 Inexact Rounded
+expx1231 exp 0.0000810612451694136129199895164424 -> 1.000081064530720924186615149646920 Inexact Rounded
+expx1232 exp 51.06888989702669288180946272499035 -> 15098613888619165073959.89896018749 Inexact Rounded
+expx1233 exp 0.0000000005992887599437093651494510 -> 1.000000000599288760123282874082758 Inexact Rounded
+expx1234 exp 714.8549046761054856311108828903972 -> 2.867744544891081117381595080480784E+310 Inexact Rounded
+expx1235 exp 0.0000000004468247802990643645607110 -> 1.000000000446824780398890556720233 Inexact Rounded
+expx1236 exp 831.5818151589890366323551672043709 -> 1.417077409182624969435938062261655E+361 Inexact Rounded
+expx1237 exp 0.0000000006868323825179605747108044 -> 1.000000000686832382753829935602454 Inexact Rounded
+expx1238 exp 0.0000001306740266408976840228440255 -> 1.000000130674035178748675187648098 Inexact Rounded
+expx1239 exp 0.3182210609022267704811502412335163 -> 1.374680115667798185758927247894859 Inexact Rounded
+expx1240 exp 0.0147741234179104437440264644295501 -> 1.014883800239950682628277534839222 Inexact Rounded
+
+-- Randoms P=16, within 0-99
+Precision: 16
+maxExponent: 384
+minExponent: -383
+expx1101 exp 8.473011527013724 -> 4783.900643969246 Inexact Rounded
+expx1102 exp 0.0000055753022764 -> 1.000005575317818 Inexact Rounded
+expx1103 exp 0.0000323474114482 -> 1.000032347934631 Inexact Rounded
+expx1104 exp 64.54374138544166 -> 1.073966476173531E+28 Inexact Rounded
+expx1105 exp 90.47203246416569 -> 1.956610887250643E+39 Inexact Rounded
+expx1106 exp 9.299931532342757 -> 10937.27033325227 Inexact Rounded
+expx1107 exp 8.759678437852203 -> 6372.062234495381 Inexact Rounded
+expx1108 exp 0.0000931755127172 -> 1.000093179853690 Inexact Rounded
+expx1109 exp 0.0000028101158373 -> 1.000002810119786 Inexact Rounded
+expx1110 exp 0.0000008008130919 -> 1.000000800813413 Inexact Rounded
+expx1111 exp 8.339771722299049 -> 4187.133803081878 Inexact Rounded
+expx1112 exp 0.0026140497995474 -> 1.002617469406750 Inexact Rounded
+expx1113 exp 0.7478033356261771 -> 2.112354781975418 Inexact Rounded
+expx1114 exp 51.77663761827966 -> 3.064135801120365E+22 Inexact Rounded
+expx1115 exp 0.1524989783061012 -> 1.164741272084955 Inexact Rounded
+expx1116 exp 0.0066298798669219 -> 1.006651906170791 Inexact Rounded
+expx1117 exp 9.955141865534960 -> 21060.23334287038 Inexact Rounded
+expx1118 exp 92.34503059198483 -> 1.273318993481226E+40 Inexact Rounded
+expx1119 exp 0.0000709388677346 -> 1.000070941383956 Inexact Rounded
+expx1120 exp 79.12883036433204 -> 2.318538899389243E+34 Inexact Rounded
+expx1121 exp 0.0000090881548873 -> 1.000009088196185 Inexact Rounded
+expx1122 exp 0.0424828809603411 -> 1.043398194245720 Inexact Rounded
+expx1123 exp 0.8009035891427416 -> 2.227552811933310 Inexact Rounded
+expx1124 exp 8.825786167283102 -> 6807.540455289995 Inexact Rounded
+expx1125 exp 1.535457249746275 -> 4.643448260146849 Inexact Rounded
+expx1126 exp 69.02254254355800 -> 9.464754500670653E+29 Inexact Rounded
+expx1127 exp 0.0007050554368713 -> 1.000705304046880 Inexact Rounded
+expx1128 exp 0.0000081206549504 -> 1.000008120687923 Inexact Rounded
+expx1129 exp 0.621774854641137 -> 1.862230298554903 Inexact Rounded
+expx1130 exp 3.847629031404354 -> 46.88177613568203 Inexact Rounded
+expx1131 exp 24.81250184697732 -> 59694268456.19966 Inexact Rounded
+expx1132 exp 5.107546500516044 -> 165.2643809755670 Inexact Rounded
+expx1133 exp 79.17810943951986 -> 2.435656372541360E+34 Inexact Rounded
+expx1134 exp 0.0051394695667015 -> 1.005152699295301 Inexact Rounded
+expx1135 exp 57.44504488501725 -> 8.872908566929688E+24 Inexact Rounded
+expx1136 exp 0.0000508388968036 -> 1.000050840189122 Inexact Rounded
+expx1137 exp 69.71309932148997 -> 1.888053740693541E+30 Inexact Rounded
+expx1138 exp 0.0064183412981502 -> 1.006438982988835 Inexact Rounded
+expx1139 exp 9.346991220814677 -> 11464.27802035082 Inexact Rounded
+expx1140 exp 33.09087139999152 -> 235062229168763.5 Inexact Rounded
+
+-- Randoms P=7, within 0-9
+Precision: 7
+maxExponent: 96
+minExponent: -95
+expx1001 exp 2.395441 -> 10.97304 Inexact Rounded
+expx1002 exp 0.6406779 -> 1.897767 Inexact Rounded
+expx1003 exp 0.5618218 -> 1.753865 Inexact Rounded
+expx1004 exp 3.055120 -> 21.22373 Inexact Rounded
+expx1005 exp 1.536792 -> 4.649650 Inexact Rounded
+expx1006 exp 0.0801591 -> 1.083459 Inexact Rounded
+expx1007 exp 0.0966875 -> 1.101516 Inexact Rounded
+expx1008 exp 0.0646761 -> 1.066813 Inexact Rounded
+expx1009 exp 0.0095670 -> 1.009613 Inexact Rounded
+expx1010 exp 2.956859 -> 19.23745 Inexact Rounded
+expx1011 exp 7.504679 -> 1816.522 Inexact Rounded
+expx1012 exp 0.0045259 -> 1.004536 Inexact Rounded
+expx1013 exp 3.810071 -> 45.15364 Inexact Rounded
+expx1014 exp 1.502390 -> 4.492413 Inexact Rounded
+expx1015 exp 0.0321523 -> 1.032675 Inexact Rounded
+expx1016 exp 0.0057214 -> 1.005738 Inexact Rounded
+expx1017 exp 9.811445 -> 18241.33 Inexact Rounded
+expx1018 exp 3.245249 -> 25.66810 Inexact Rounded
+expx1019 exp 0.3189742 -> 1.375716 Inexact Rounded
+expx1020 exp 0.8621610 -> 2.368273 Inexact Rounded
+expx1021 exp 0.0122511 -> 1.012326 Inexact Rounded
+expx1022 exp 2.202088 -> 9.043877 Inexact Rounded
+expx1023 exp 8.778203 -> 6491.202 Inexact Rounded
+expx1024 exp 0.1896279 -> 1.208800 Inexact Rounded
+expx1025 exp 0.4510947 -> 1.570030 Inexact Rounded
+expx1026 exp 0.276413 -> 1.318392 Inexact Rounded
+expx1027 exp 4.490067 -> 89.12742 Inexact Rounded
+expx1028 exp 0.0439786 -> 1.044960 Inexact Rounded
+expx1029 exp 0.8168245 -> 2.263301 Inexact Rounded
+expx1030 exp 0.0391658 -> 1.039943 Inexact Rounded
+expx1031 exp 9.261816 -> 10528.24 Inexact Rounded
+expx1032 exp 9.611186 -> 14930.87 Inexact Rounded
+expx1033 exp 9.118125 -> 9119.087 Inexact Rounded
+expx1034 exp 9.469083 -> 12953.00 Inexact Rounded
+expx1035 exp 0.0499983 -> 1.051269 Inexact Rounded
+expx1036 exp 0.0050746 -> 1.005087 Inexact Rounded
+expx1037 exp 0.0014696 -> 1.001471 Inexact Rounded
+expx1038 exp 9.138494 -> 9306.739 Inexact Rounded
+expx1039 exp 0.0065436 -> 1.006565 Inexact Rounded
+expx1040 exp 0.7284803 -> 2.071930 Inexact Rounded
+
diff --git a/Lib/test/decimaltestdata/fma.decTest b/Lib/test/decimaltestdata/fma.decTest
index a8197ef8a4..b0a81ca179 100644
--- a/Lib/test/decimaltestdata/fma.decTest
+++ b/Lib/test/decimaltestdata/fma.decTest
@@ -1,3426 +1,3426 @@
-------------------------------------------------------------------------
--- fma.decTest -- decimal fused multiply add --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- These tests comprese three parts:
--- 1. Sanity checks and other three-operand tests (especially those
--- where the fused operation makes a difference)
--- 2. Multiply tests (third operand is neutral zero [0E+emax])
--- 3. Addition tests (first operand is 1)
--- The multiply and addition tests are extensive because FMA may have
--- its own dedicated multiplication or addition routine(s), and they
--- also inherently check the left-to-right properties.
-
--- Sanity checks
-fmax0001 fma 1 1 1 -> 2
-fmax0002 fma 1 1 2 -> 3
-fmax0003 fma 2 2 3 -> 7
-fmax0004 fma 9 9 9 -> 90
-fmax0005 fma -1 1 1 -> 0
-fmax0006 fma -1 1 2 -> 1
-fmax0007 fma -2 2 3 -> -1
-fmax0008 fma -9 9 9 -> -72
-fmax0011 fma 1 -1 1 -> 0
-fmax0012 fma 1 -1 2 -> 1
-fmax0013 fma 2 -2 3 -> -1
-fmax0014 fma 9 -9 9 -> -72
-fmax0015 fma 1 1 -1 -> 0
-fmax0016 fma 1 1 -2 -> -1
-fmax0017 fma 2 2 -3 -> 1
-fmax0018 fma 9 9 -9 -> 72
-fmax0019 fma 3 5 7 -> 22
-fmax0029 fma 3 -5 7 -> -8
-
--- non-integer exacts
-fma0100 fma 25.2 63.6 -438 -> 1164.72
-fma0101 fma 0.301 0.380 334 -> 334.114380
-fma0102 fma 49.2 -4.8 23.3 -> -212.86
-fma0103 fma 4.22 0.079 -94.6 -> -94.26662
-fma0104 fma 903 0.797 0.887 -> 720.578
-fma0105 fma 6.13 -161 65.9 -> -921.03
-fma0106 fma 28.2 727 5.45 -> 20506.85
-fma0107 fma 4 605 688 -> 3108
-fma0108 fma 93.3 0.19 0.226 -> 17.953
-fma0109 fma 0.169 -341 5.61 -> -52.019
-fma0110 fma -72.2 30 -51.2 -> -2217.2
-fma0111 fma -0.409 13 20.4 -> 15.083
-fma0112 fma 317 77.0 19.0 -> 24428.0
-fma0113 fma 47 6.58 1.62 -> 310.88
-fma0114 fma 1.36 0.984 0.493 -> 1.83124
-fma0115 fma 72.7 274 1.56 -> 19921.36
-fma0116 fma 335 847 83 -> 283828
-fma0117 fma 666 0.247 25.4 -> 189.902
-fma0118 fma -3.87 3.06 78.0 -> 66.1578
-fma0119 fma 0.742 192 35.6 -> 178.064
-fma0120 fma -91.6 5.29 0.153 -> -484.411
-
--- cases where result is different from separate multiply + add; each
--- is preceded by the result of unfused multiply and add
--- [this is about 20% of all similar cases in general]
--- 888565290 1557.96930 -86087.7578 -> 1.38435735E+12
-fma0201 fma 888565290 1557.96930 -86087.7578 -> 1.38435736E+12 Inexact Rounded
--- -85519342.9 735155419 42010431 -> -6.28700084E+16
-fma0205 fma -85519342.9 735155419 42010431 -> -6.28700083E+16 Inexact Rounded
--- -98025.5 -294603.472 10414348.2 -> 2.88890669E+10
-fma0208 fma -98025.5 -294603.472 10414348.2 -> 2.88890670E+10 Inexact Rounded
--- 5967627.39 83526540.6 498494.810 -> 4.98455271E+14
-fma0211 fma 5967627.39 83526540.6 498494.810 -> 4.98455272E+14 Inexact Rounded
--- 3456.9433 874.39518 197866.615 -> 3220601.18
-fma0216 fma 3456.9433 874.39518 197866.615 -> 3220601.17 Inexact Rounded
--- 62769.8287 2096.98927 48.420317 -> 131627705
-fma0218 fma 62769.8287 2096.98927 48.420317 -> 131627706 Inexact Rounded
--- -68.81500 59961113.9 -8988862 -> -4.13521291E+9
-fma0219 fma -68.81500 59961113.9 -8988862 -> -4.13521292E+9 Inexact Rounded
--- 2126341.02 63491.5152 302427455 -> 1.35307040E+11
-fma0226 fma 2126341.02 63491.5152 302427455 -> 1.35307041E+11 Inexact Rounded
-
-
--- Infinite combinations
-fmax0800 fma Inf Inf Inf -> Infinity
-fmax0801 fma Inf Inf -Inf -> NaN Invalid_operation
-fmax0802 fma Inf -Inf Inf -> NaN Invalid_operation
-fmax0803 fma Inf -Inf -Inf -> -Infinity
-fmax0804 fma -Inf Inf Inf -> NaN Invalid_operation
-fmax0805 fma -Inf Inf -Inf -> -Infinity
-fmax0806 fma -Inf -Inf Inf -> Infinity
-fmax0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
-fmax0808 fma -Inf 0 1 -> NaN Invalid_operation
-fmax0809 fma -Inf 0 NaN -> NaN Invalid_operation
-
--- Triple NaN propagation
-fmax0900 fma NaN2 NaN3 NaN5 -> NaN2
-fmax0901 fma 0 NaN3 NaN5 -> NaN3
-fmax0902 fma 0 0 NaN5 -> NaN5
--- first sNaN wins (consider qNaN from earlier sNaN being
--- overridden by an sNaN in third operand)
-fmax0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-fmax0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
-fmax0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
-fmax0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-fmax0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
-fmax0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
-
--- MULTIPLICATION TESTS ------------------------------------------------
--- sanity checks (as base, above)
-fmax2000 fma 2 2 0E+999999 -> 4
-fmax2001 fma 2 3 0E+999999 -> 6
-fmax2002 fma 5 1 0E+999999 -> 5
-fmax2003 fma 5 2 0E+999999 -> 10
-fmax2004 fma 1.20 2 0E+999999 -> 2.40
-fmax2005 fma 1.20 0 0E+999999 -> 0.00
-fmax2006 fma 1.20 -2 0E+999999 -> -2.40
-fmax2007 fma -1.20 2 0E+999999 -> -2.40
-fmax2008 fma -1.20 0 0E+999999 -> 0.00
-fmax2009 fma -1.20 -2 0E+999999 -> 2.40
-fmax2010 fma 5.09 7.1 0E+999999 -> 36.139
-fmax2011 fma 2.5 4 0E+999999 -> 10.0
-fmax2012 fma 2.50 4 0E+999999 -> 10.00
-fmax2013 fma 1.23456789 1.00000000 0E+999999 -> 1.23456789 Rounded
-fmax2014 fma 9.999999999 9.999999999 0E+999999 -> 100.000000 Inexact Rounded
-fmax2015 fma 2.50 4 0E+999999 -> 10.00
-precision: 6
-fmax2016 fma 2.50 4 0E+999999 -> 10.00
-fmax2017 fma 9.999999 9.999999 0E+999999 -> 100.000 Inexact Rounded
-fmax2018 fma 9.999999 -9.999999 0E+999999 -> -100.000 Inexact Rounded
-fmax2019 fma -9.999999 9.999999 0E+999999 -> -100.000 Inexact Rounded
-fmax2020 fma -9.999999 -9.999999 0E+999999 -> 100.000 Inexact Rounded
-
--- 1999.12.21: next one is a edge case if intermediate longs are used
-precision: 15
-fmax2059 fma 999999999999 9765625 0E+999999 -> 9.76562499999023E+18 Inexact Rounded
-precision: 30
-fmax2160 fma 999999999999 9765625 0E+999999 -> 9765624999990234375
-precision: 9
------
-
--- zeros, etc.
-fmax2021 fma 0 0 0E+999999 -> 0
-fmax2022 fma 0 -0 0E+999999 -> 0
-fmax2023 fma -0 0 0E+999999 -> 0
-fmax2024 fma -0 -0 0E+999999 -> 0
-fmax2025 fma -0.0 -0.0 0E+999999 -> 0.00
-fmax2026 fma -0.0 -0.0 0E+999999 -> 0.00
-fmax2027 fma -0.0 -0.0 0E+999999 -> 0.00
-fmax2028 fma -0.0 -0.0 0E+999999 -> 0.00
-fmax2030 fma 5.00 1E-3 0E+999999 -> 0.00500
-fmax2031 fma 00.00 0.000 0E+999999 -> 0.00000
-fmax2032 fma 00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0
-fmax2033 fma 0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0
-fmax2034 fma -5.00 1E-3 0E+999999 -> -0.00500
-fmax2035 fma -00.00 0.000 0E+999999 -> 0.00000
-fmax2036 fma -00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0
-fmax2037 fma -0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0
-fmax2038 fma 5.00 -1E-3 0E+999999 -> -0.00500
-fmax2039 fma 00.00 -0.000 0E+999999 -> 0.00000
-fmax2040 fma 00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0
-fmax2041 fma 0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0
-fmax2042 fma -5.00 -1E-3 0E+999999 -> 0.00500
-fmax2043 fma -00.00 -0.000 0E+999999 -> 0.00000
-fmax2044 fma -00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0
-fmax2045 fma -0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0
-
--- examples from decarith multiply
-fmax2050 fma 1.20 3 0E+999999 -> 3.60
-fmax2051 fma 7 3 0E+999999 -> 21
-fmax2052 fma 0.9 0.8 0E+999999 -> 0.72
-fmax2053 fma 0.9 -0 0E+999999 -> 0.0
-fmax2054 fma 654321 654321 0E+999999 -> 4.28135971E+11 Inexact Rounded
-
-fmax2060 fma 123.45 1e7 0E+999999 -> 1.2345E+9
-fmax2061 fma 123.45 1e8 0E+999999 -> 1.2345E+10
-fmax2062 fma 123.45 1e+9 0E+999999 -> 1.2345E+11
-fmax2063 fma 123.45 1e10 0E+999999 -> 1.2345E+12
-fmax2064 fma 123.45 1e11 0E+999999 -> 1.2345E+13
-fmax2065 fma 123.45 1e12 0E+999999 -> 1.2345E+14
-fmax2066 fma 123.45 1e13 0E+999999 -> 1.2345E+15
-
-
--- test some intermediate lengths
-precision: 9
-fmax2080 fma 0.1 123456789 0E+999999 -> 12345678.9
-fmax2081 fma 0.1 1234567891 0E+999999 -> 123456789 Inexact Rounded
-fmax2082 fma 0.1 12345678912 0E+999999 -> 1.23456789E+9 Inexact Rounded
-fmax2083 fma 0.1 12345678912345 0E+999999 -> 1.23456789E+12 Inexact Rounded
-fmax2084 fma 0.1 123456789 0E+999999 -> 12345678.9
-precision: 8
-fmax2085 fma 0.1 12345678912 0E+999999 -> 1.2345679E+9 Inexact Rounded
-fmax2086 fma 0.1 12345678912345 0E+999999 -> 1.2345679E+12 Inexact Rounded
-precision: 7
-fmax2087 fma 0.1 12345678912 0E+999999 -> 1.234568E+9 Inexact Rounded
-fmax2088 fma 0.1 12345678912345 0E+999999 -> 1.234568E+12 Inexact Rounded
-
-precision: 9
-fmax2090 fma 123456789 0.1 0E+999999 -> 12345678.9
-fmax2091 fma 1234567891 0.1 0E+999999 -> 123456789 Inexact Rounded
-fmax2092 fma 12345678912 0.1 0E+999999 -> 1.23456789E+9 Inexact Rounded
-fmax2093 fma 12345678912345 0.1 0E+999999 -> 1.23456789E+12 Inexact Rounded
-fmax2094 fma 123456789 0.1 0E+999999 -> 12345678.9
-precision: 8
-fmax2095 fma 12345678912 0.1 0E+999999 -> 1.2345679E+9 Inexact Rounded
-fmax2096 fma 12345678912345 0.1 0E+999999 -> 1.2345679E+12 Inexact Rounded
-precision: 7
-fmax2097 fma 12345678912 0.1 0E+999999 -> 1.234568E+9 Inexact Rounded
-fmax2098 fma 12345678912345 0.1 0E+999999 -> 1.234568E+12 Inexact Rounded
-
--- test some more edge cases and carries
-maxexponent: 9999
-minexponent: -9999
-precision: 33
-fmax2101 fma 9 9 0E+999999 -> 81
-fmax2102 fma 9 90 0E+999999 -> 810
-fmax2103 fma 9 900 0E+999999 -> 8100
-fmax2104 fma 9 9000 0E+999999 -> 81000
-fmax2105 fma 9 90000 0E+999999 -> 810000
-fmax2106 fma 9 900000 0E+999999 -> 8100000
-fmax2107 fma 9 9000000 0E+999999 -> 81000000
-fmax2108 fma 9 90000000 0E+999999 -> 810000000
-fmax2109 fma 9 900000000 0E+999999 -> 8100000000
-fmax2110 fma 9 9000000000 0E+999999 -> 81000000000
-fmax2111 fma 9 90000000000 0E+999999 -> 810000000000
-fmax2112 fma 9 900000000000 0E+999999 -> 8100000000000
-fmax2113 fma 9 9000000000000 0E+999999 -> 81000000000000
-fmax2114 fma 9 90000000000000 0E+999999 -> 810000000000000
-fmax2115 fma 9 900000000000000 0E+999999 -> 8100000000000000
-fmax2116 fma 9 9000000000000000 0E+999999 -> 81000000000000000
-fmax2117 fma 9 90000000000000000 0E+999999 -> 810000000000000000
-fmax2118 fma 9 900000000000000000 0E+999999 -> 8100000000000000000
-fmax2119 fma 9 9000000000000000000 0E+999999 -> 81000000000000000000
-fmax2120 fma 9 90000000000000000000 0E+999999 -> 810000000000000000000
-fmax2121 fma 9 900000000000000000000 0E+999999 -> 8100000000000000000000
-fmax2122 fma 9 9000000000000000000000 0E+999999 -> 81000000000000000000000
-fmax2123 fma 9 90000000000000000000000 0E+999999 -> 810000000000000000000000
--- test some more edge cases without carries
-fmax2131 fma 3 3 0E+999999 -> 9
-fmax2132 fma 3 30 0E+999999 -> 90
-fmax2133 fma 3 300 0E+999999 -> 900
-fmax2134 fma 3 3000 0E+999999 -> 9000
-fmax2135 fma 3 30000 0E+999999 -> 90000
-fmax2136 fma 3 300000 0E+999999 -> 900000
-fmax2137 fma 3 3000000 0E+999999 -> 9000000
-fmax2138 fma 3 30000000 0E+999999 -> 90000000
-fmax2139 fma 3 300000000 0E+999999 -> 900000000
-fmax2140 fma 3 3000000000 0E+999999 -> 9000000000
-fmax2141 fma 3 30000000000 0E+999999 -> 90000000000
-fmax2142 fma 3 300000000000 0E+999999 -> 900000000000
-fmax2143 fma 3 3000000000000 0E+999999 -> 9000000000000
-fmax2144 fma 3 30000000000000 0E+999999 -> 90000000000000
-fmax2145 fma 3 300000000000000 0E+999999 -> 900000000000000
-fmax2146 fma 3 3000000000000000 0E+999999 -> 9000000000000000
-fmax2147 fma 3 30000000000000000 0E+999999 -> 90000000000000000
-fmax2148 fma 3 300000000000000000 0E+999999 -> 900000000000000000
-fmax2149 fma 3 3000000000000000000 0E+999999 -> 9000000000000000000
-fmax2150 fma 3 30000000000000000000 0E+999999 -> 90000000000000000000
-fmax2151 fma 3 300000000000000000000 0E+999999 -> 900000000000000000000
-fmax2152 fma 3 3000000000000000000000 0E+999999 -> 9000000000000000000000
-fmax2153 fma 3 30000000000000000000000 0E+999999 -> 90000000000000000000000
-
-maxexponent: 999999
-minexponent: -999999
-precision: 9
--- test some cases that are close to exponent overflow/underflow
-fmax2170 fma 1 9e999999 0E+999999 -> 9E+999999
-fmax2171 fma 1 9.9e999999 0E+999999 -> 9.9E+999999
-fmax2172 fma 1 9.99e999999 0E+999999 -> 9.99E+999999
-fmax2173 fma 9e999999 1 0E+999999 -> 9E+999999
-fmax2174 fma 9.9e999999 1 0E+999999 -> 9.9E+999999
-fmax2176 fma 9.99e999999 1 0E+999999 -> 9.99E+999999
-fmax2177 fma 1 9.99999e999999 0E+999999 -> 9.99999E+999999
-fmax2178 fma 9.99999e999999 1 0E+999999 -> 9.99999E+999999
-
-fmax2180 fma 0.1 9e-999998 0E+999999 -> 9E-999999
-fmax2181 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998
-fmax2182 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997
-
-fmax2183 fma 0.1 9e-999998 0E+999999 -> 9E-999999
-fmax2184 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998
-fmax2185 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997
-fmax2186 fma 0.1 999e-999997 0E+999999 -> 9.99E-999996
-fmax2187 fma 0.1 9999e-999997 0E+999999 -> 9.999E-999995
-fmax2188 fma 0.1 99999e-999997 0E+999999 -> 9.9999E-999994
-
-fmax2190 fma 1 9e-999998 0E+999999 -> 9E-999998
-fmax2191 fma 1 99e-999998 0E+999999 -> 9.9E-999997
-fmax2192 fma 1 999e-999998 0E+999999 -> 9.99E-999996
-fmax2193 fma 9e-999998 1 0E+999999 -> 9E-999998
-fmax2194 fma 99e-999998 1 0E+999999 -> 9.9E-999997
-fmax2195 fma 999e-999998 1 0E+999999 -> 9.99E-999996
-
--- long operand triangle
-precision: 33
-fmax2246 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511992830 Inexact Rounded
-precision: 32
-fmax2247 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199283 Inexact Rounded
-precision: 31
-fmax2248 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165119928 Inexact Rounded
-precision: 30
-fmax2249 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511993 Inexact Rounded
-precision: 29
-fmax2250 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199 Inexact Rounded
-precision: 28
-fmax2251 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165120 Inexact Rounded
-precision: 27
-fmax2252 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916512 Inexact Rounded
-precision: 26
-fmax2253 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651 Inexact Rounded
-precision: 25
-fmax2254 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165 Inexact Rounded
-precision: 24
-fmax2255 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671917 Inexact Rounded
-precision: 23
-fmax2256 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967192 Inexact Rounded
-precision: 22
-fmax2257 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719 Inexact Rounded
-precision: 21
-fmax2258 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369672 Inexact Rounded
-precision: 20
-fmax2259 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967 Inexact Rounded
-precision: 19
-fmax2260 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933697 Inexact Rounded
-precision: 18
-fmax2261 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193370 Inexact Rounded
-precision: 17
-fmax2262 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119337 Inexact Rounded
-precision: 16
-fmax2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011934 Inexact Rounded
-precision: 15
-fmax2264 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193 Inexact Rounded
-precision: 14
-fmax2265 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119 Inexact Rounded
-precision: 13
-fmax2266 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908012 Inexact Rounded
-precision: 12
-fmax2267 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801 Inexact Rounded
-precision: 11
-fmax2268 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080 Inexact Rounded
-precision: 10
-fmax2269 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908 Inexact Rounded
-precision: 9
-fmax2270 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.291 Inexact Rounded
-precision: 8
-fmax2271 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29 Inexact Rounded
-precision: 7
-fmax2272 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.3 Inexact Rounded
-precision: 6
-fmax2273 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433 Inexact Rounded
-precision: 5
-fmax2274 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.4543E+5 Inexact Rounded
-precision: 4
-fmax2275 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.454E+5 Inexact Rounded
-precision: 3
-fmax2276 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.45E+5 Inexact Rounded
-precision: 2
-fmax2277 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.5E+5 Inexact Rounded
-precision: 1
-fmax2278 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1E+5 Inexact Rounded
-
--- test some edge cases with exact rounding
-maxexponent: 9999
-minexponent: -9999
-precision: 9
-fmax2301 fma 9 9 0E+999999 -> 81
-fmax2302 fma 9 90 0E+999999 -> 810
-fmax2303 fma 9 900 0E+999999 -> 8100
-fmax2304 fma 9 9000 0E+999999 -> 81000
-fmax2305 fma 9 90000 0E+999999 -> 810000
-fmax2306 fma 9 900000 0E+999999 -> 8100000
-fmax2307 fma 9 9000000 0E+999999 -> 81000000
-fmax2308 fma 9 90000000 0E+999999 -> 810000000
-fmax2309 fma 9 900000000 0E+999999 -> 8.10000000E+9 Rounded
-fmax2310 fma 9 9000000000 0E+999999 -> 8.10000000E+10 Rounded
-fmax2311 fma 9 90000000000 0E+999999 -> 8.10000000E+11 Rounded
-fmax2312 fma 9 900000000000 0E+999999 -> 8.10000000E+12 Rounded
-fmax2313 fma 9 9000000000000 0E+999999 -> 8.10000000E+13 Rounded
-fmax2314 fma 9 90000000000000 0E+999999 -> 8.10000000E+14 Rounded
-fmax2315 fma 9 900000000000000 0E+999999 -> 8.10000000E+15 Rounded
-fmax2316 fma 9 9000000000000000 0E+999999 -> 8.10000000E+16 Rounded
-fmax2317 fma 9 90000000000000000 0E+999999 -> 8.10000000E+17 Rounded
-fmax2318 fma 9 900000000000000000 0E+999999 -> 8.10000000E+18 Rounded
-fmax2319 fma 9 9000000000000000000 0E+999999 -> 8.10000000E+19 Rounded
-fmax2320 fma 9 90000000000000000000 0E+999999 -> 8.10000000E+20 Rounded
-fmax2321 fma 9 900000000000000000000 0E+999999 -> 8.10000000E+21 Rounded
-fmax2322 fma 9 9000000000000000000000 0E+999999 -> 8.10000000E+22 Rounded
-fmax2323 fma 9 90000000000000000000000 0E+999999 -> 8.10000000E+23 Rounded
-
--- fastpath breakers
-precision: 29
-fmax2330 fma 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603 0E+999999 -> 1.6487212707001281468486507878 Inexact Rounded
-precision: 55
-fmax2331 fma 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428 0E+999999 -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded
-
-
--- tryzeros cases
-precision: 7
-rounding: half_up
-maxExponent: 92
-minexponent: -92
-fmax2504 fma 0E-60 1000E-60 0E+999999 -> 0E-98 Clamped
-fmax2505 fma 100E+60 0E+60 0E+999999 -> 0E+92 Clamped
-
--- mixed with zeros
-maxexponent: 999999
-minexponent: -999999
-precision: 9
-fmax2541 fma 0 -1 0E+999999 -> 0
-fmax2542 fma -0 -1 0E+999999 -> 0
-fmax2543 fma 0 1 0E+999999 -> 0
-fmax2544 fma -0 1 0E+999999 -> 0
-fmax2545 fma -1 0 0E+999999 -> 0
-fmax2546 fma -1 -0 0E+999999 -> 0
-fmax2547 fma 1 0 0E+999999 -> 0
-fmax2548 fma 1 -0 0E+999999 -> 0
-
-fmax2551 fma 0.0 -1 0E+999999 -> 0.0
-fmax2552 fma -0.0 -1 0E+999999 -> 0.0
-fmax2553 fma 0.0 1 0E+999999 -> 0.0
-fmax2554 fma -0.0 1 0E+999999 -> 0.0
-fmax2555 fma -1.0 0 0E+999999 -> 0.0
-fmax2556 fma -1.0 -0 0E+999999 -> 0.0
-fmax2557 fma 1.0 0 0E+999999 -> 0.0
-fmax2558 fma 1.0 -0 0E+999999 -> 0.0
-
-fmax2561 fma 0 -1.0 0E+999999 -> 0.0
-fmax2562 fma -0 -1.0 0E+999999 -> 0.0
-fmax2563 fma 0 1.0 0E+999999 -> 0.0
-fmax2564 fma -0 1.0 0E+999999 -> 0.0
-fmax2565 fma -1 0.0 0E+999999 -> 0.0
-fmax2566 fma -1 -0.0 0E+999999 -> 0.0
-fmax2567 fma 1 0.0 0E+999999 -> 0.0
-fmax2568 fma 1 -0.0 0E+999999 -> 0.0
-
-fmax2571 fma 0.0 -1.0 0E+999999 -> 0.00
-fmax2572 fma -0.0 -1.0 0E+999999 -> 0.00
-fmax2573 fma 0.0 1.0 0E+999999 -> 0.00
-fmax2574 fma -0.0 1.0 0E+999999 -> 0.00
-fmax2575 fma -1.0 0.0 0E+999999 -> 0.00
-fmax2576 fma -1.0 -0.0 0E+999999 -> 0.00
-fmax2577 fma 1.0 0.0 0E+999999 -> 0.00
-fmax2578 fma 1.0 -0.0 0E+999999 -> 0.00
-
-
--- Specials
-fmax2580 fma Inf -Inf 0E+999999 -> -Infinity
-fmax2581 fma Inf -1000 0E+999999 -> -Infinity
-fmax2582 fma Inf -1 0E+999999 -> -Infinity
-fmax2583 fma Inf -0 0E+999999 -> NaN Invalid_operation
-fmax2584 fma Inf 0 0E+999999 -> NaN Invalid_operation
-fmax2585 fma Inf 1 0E+999999 -> Infinity
-fmax2586 fma Inf 1000 0E+999999 -> Infinity
-fmax2587 fma Inf Inf 0E+999999 -> Infinity
-fmax2588 fma -1000 Inf 0E+999999 -> -Infinity
-fmax2589 fma -Inf Inf 0E+999999 -> -Infinity
-fmax2590 fma -1 Inf 0E+999999 -> -Infinity
-fmax2591 fma -0 Inf 0E+999999 -> NaN Invalid_operation
-fmax2592 fma 0 Inf 0E+999999 -> NaN Invalid_operation
-fmax2593 fma 1 Inf 0E+999999 -> Infinity
-fmax2594 fma 1000 Inf 0E+999999 -> Infinity
-fmax2595 fma Inf Inf 0E+999999 -> Infinity
-
-fmax2600 fma -Inf -Inf 0E+999999 -> Infinity
-fmax2601 fma -Inf -1000 0E+999999 -> Infinity
-fmax2602 fma -Inf -1 0E+999999 -> Infinity
-fmax2603 fma -Inf -0 0E+999999 -> NaN Invalid_operation
-fmax2604 fma -Inf 0 0E+999999 -> NaN Invalid_operation
-fmax2605 fma -Inf 1 0E+999999 -> -Infinity
-fmax2606 fma -Inf 1000 0E+999999 -> -Infinity
-fmax2607 fma -Inf Inf 0E+999999 -> -Infinity
-fmax2608 fma -1000 Inf 0E+999999 -> -Infinity
-fmax2609 fma -Inf -Inf 0E+999999 -> Infinity
-fmax2610 fma -1 -Inf 0E+999999 -> Infinity
-fmax2611 fma -0 -Inf 0E+999999 -> NaN Invalid_operation
-fmax2612 fma 0 -Inf 0E+999999 -> NaN Invalid_operation
-fmax2613 fma 1 -Inf 0E+999999 -> -Infinity
-fmax2614 fma 1000 -Inf 0E+999999 -> -Infinity
-fmax2615 fma Inf -Inf 0E+999999 -> -Infinity
-
-fmax2621 fma NaN -Inf 0E+999999 -> NaN
-fmax2622 fma NaN -1000 0E+999999 -> NaN
-fmax2623 fma NaN -1 0E+999999 -> NaN
-fmax2624 fma NaN -0 0E+999999 -> NaN
-fmax2625 fma NaN 0 0E+999999 -> NaN
-fmax2626 fma NaN 1 0E+999999 -> NaN
-fmax2627 fma NaN 1000 0E+999999 -> NaN
-fmax2628 fma NaN Inf 0E+999999 -> NaN
-fmax2629 fma NaN NaN 0E+999999 -> NaN
-fmax2630 fma -Inf NaN 0E+999999 -> NaN
-fmax2631 fma -1000 NaN 0E+999999 -> NaN
-fmax2632 fma -1 NaN 0E+999999 -> NaN
-fmax2633 fma -0 NaN 0E+999999 -> NaN
-fmax2634 fma 0 NaN 0E+999999 -> NaN
-fmax2635 fma 1 NaN 0E+999999 -> NaN
-fmax2636 fma 1000 NaN 0E+999999 -> NaN
-fmax2637 fma Inf NaN 0E+999999 -> NaN
-
-fmax2641 fma sNaN -Inf 0E+999999 -> NaN Invalid_operation
-fmax2642 fma sNaN -1000 0E+999999 -> NaN Invalid_operation
-fmax2643 fma sNaN -1 0E+999999 -> NaN Invalid_operation
-fmax2644 fma sNaN -0 0E+999999 -> NaN Invalid_operation
-fmax2645 fma sNaN 0 0E+999999 -> NaN Invalid_operation
-fmax2646 fma sNaN 1 0E+999999 -> NaN Invalid_operation
-fmax2647 fma sNaN 1000 0E+999999 -> NaN Invalid_operation
-fmax2648 fma sNaN NaN 0E+999999 -> NaN Invalid_operation
-fmax2649 fma sNaN sNaN 0E+999999 -> NaN Invalid_operation
-fmax2650 fma NaN sNaN 0E+999999 -> NaN Invalid_operation
-fmax2651 fma -Inf sNaN 0E+999999 -> NaN Invalid_operation
-fmax2652 fma -1000 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2653 fma -1 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2654 fma -0 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2655 fma 0 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2656 fma 1 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2657 fma 1000 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2658 fma Inf sNaN 0E+999999 -> NaN Invalid_operation
-fmax2659 fma NaN sNaN 0E+999999 -> NaN Invalid_operation
-
--- propagating NaNs
-fmax2661 fma NaN9 -Inf 0E+999999 -> NaN9
-fmax2662 fma NaN8 999 0E+999999 -> NaN8
-fmax2663 fma NaN71 Inf 0E+999999 -> NaN71
-fmax2664 fma NaN6 NaN5 0E+999999 -> NaN6
-fmax2665 fma -Inf NaN4 0E+999999 -> NaN4
-fmax2666 fma -999 NaN33 0E+999999 -> NaN33
-fmax2667 fma Inf NaN2 0E+999999 -> NaN2
-
-fmax2671 fma sNaN99 -Inf 0E+999999 -> NaN99 Invalid_operation
-fmax2672 fma sNaN98 -11 0E+999999 -> NaN98 Invalid_operation
-fmax2673 fma sNaN97 NaN 0E+999999 -> NaN97 Invalid_operation
-fmax2674 fma sNaN16 sNaN94 0E+999999 -> NaN16 Invalid_operation
-fmax2675 fma NaN95 sNaN93 0E+999999 -> NaN93 Invalid_operation
-fmax2676 fma -Inf sNaN92 0E+999999 -> NaN92 Invalid_operation
-fmax2677 fma 088 sNaN91 0E+999999 -> NaN91 Invalid_operation
-fmax2678 fma Inf sNaN90 0E+999999 -> NaN90 Invalid_operation
-fmax2679 fma NaN sNaN89 0E+999999 -> NaN89 Invalid_operation
-
-fmax2681 fma -NaN9 -Inf 0E+999999 -> -NaN9
-fmax2682 fma -NaN8 999 0E+999999 -> -NaN8
-fmax2683 fma -NaN71 Inf 0E+999999 -> -NaN71
-fmax2684 fma -NaN6 -NaN5 0E+999999 -> -NaN6
-fmax2685 fma -Inf -NaN4 0E+999999 -> -NaN4
-fmax2686 fma -999 -NaN33 0E+999999 -> -NaN33
-fmax2687 fma Inf -NaN2 0E+999999 -> -NaN2
-
-fmax2691 fma -sNaN99 -Inf 0E+999999 -> -NaN99 Invalid_operation
-fmax2692 fma -sNaN98 -11 0E+999999 -> -NaN98 Invalid_operation
-fmax2693 fma -sNaN97 NaN 0E+999999 -> -NaN97 Invalid_operation
-fmax2694 fma -sNaN16 -sNaN94 0E+999999 -> -NaN16 Invalid_operation
-fmax2695 fma -NaN95 -sNaN93 0E+999999 -> -NaN93 Invalid_operation
-fmax2696 fma -Inf -sNaN92 0E+999999 -> -NaN92 Invalid_operation
-fmax2697 fma 088 -sNaN91 0E+999999 -> -NaN91 Invalid_operation
-fmax2698 fma Inf -sNaN90 0E+999999 -> -NaN90 Invalid_operation
-fmax2699 fma -NaN -sNaN89 0E+999999 -> -NaN89 Invalid_operation
-
-fmax2701 fma -NaN -Inf 0E+999999 -> -NaN
-fmax2702 fma -NaN 999 0E+999999 -> -NaN
-fmax2703 fma -NaN Inf 0E+999999 -> -NaN
-fmax2704 fma -NaN -NaN 0E+999999 -> -NaN
-fmax2705 fma -Inf -NaN0 0E+999999 -> -NaN
-fmax2706 fma -999 -NaN 0E+999999 -> -NaN
-fmax2707 fma Inf -NaN 0E+999999 -> -NaN
-
-fmax2711 fma -sNaN -Inf 0E+999999 -> -NaN Invalid_operation
-fmax2712 fma -sNaN -11 0E+999999 -> -NaN Invalid_operation
-fmax2713 fma -sNaN00 NaN 0E+999999 -> -NaN Invalid_operation
-fmax2714 fma -sNaN -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2715 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2716 fma -Inf -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2717 fma 088 -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2718 fma Inf -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2719 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
-maxexponent: 999999
-minexponent: -999999
-fmax2730 fma +1.23456789012345E-0 9E+999999 0E+999999 -> Infinity Inexact Overflow Rounded
-fmax2731 fma 9E+999999 +1.23456789012345E-0 0E+999999 -> Infinity Inexact Overflow Rounded
-fmax2732 fma +0.100 9E-999999 0E+999999 -> 9.00E-1000000 Subnormal
-fmax2733 fma 9E-999999 +0.100 0E+999999 -> 9.00E-1000000 Subnormal
-fmax2735 fma -1.23456789012345E-0 9E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded
-fmax2736 fma 9E+999999 -1.23456789012345E-0 0E+999999 -> -Infinity Inexact Overflow Rounded
-fmax2737 fma -0.100 9E-999999 0E+999999 -> -9.00E-1000000 Subnormal
-fmax2738 fma 9E-999999 -0.100 0E+999999 -> -9.00E-1000000 Subnormal
-
--- signs
-fmax2751 fma 1e+777777 1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2752 fma 1e+777777 -1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded
-fmax2753 fma -1e+777777 1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded
-fmax2754 fma -1e+777777 -1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2755 fma 1e-777777 1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2756 fma 1e-777777 -1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2757 fma -1e-777777 1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2758 fma -1e-777777 -1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-precision: 9
-fmax2760 fma 1e-600000 1e-400001 0E+999999 -> 1E-1000001 Subnormal
-fmax2761 fma 1e-600000 1e-400002 0E+999999 -> 1E-1000002 Subnormal
-fmax2762 fma 1e-600000 1e-400003 0E+999999 -> 1E-1000003 Subnormal
-fmax2763 fma 1e-600000 1e-400004 0E+999999 -> 1E-1000004 Subnormal
-fmax2764 fma 1e-600000 1e-400005 0E+999999 -> 1E-1000005 Subnormal
-fmax2765 fma 1e-600000 1e-400006 0E+999999 -> 1E-1000006 Subnormal
-fmax2766 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal
-fmax2767 fma 1e-600000 1e-400008 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2768 fma 1e-600000 1e-400009 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2769 fma 1e-600000 1e-400010 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-fmax2770 fma 1e+600000 1e+400001 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2771 fma 1e+600000 1e+400002 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2772 fma 1e+600000 1e+400003 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2773 fma 1e+600000 1e+400004 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2774 fma 1e+600000 1e+400005 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2775 fma 1e+600000 1e+400006 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2776 fma 1e+600000 1e+400007 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2777 fma 1e+600000 1e+400008 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2778 fma 1e+600000 1e+400009 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2779 fma 1e+600000 1e+400010 0E+999999 -> Infinity Overflow Inexact Rounded
-
--- 'subnormal' test edge condition at higher precisions
-precision: 99
-fmax2780 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal
-fmax2781 fma 1e-600000 1e-400008 0E+999999 -> 1E-1000008 Subnormal
-fmax2782 fma 1e-600000 1e-400097 0E+999999 -> 1E-1000097 Subnormal
-fmax2783 fma 1e-600000 1e-400098 0E+999999 -> 0E-1000097 Underflow Subnormal Inexact Rounded Clamped
-precision: 999
-fmax2784 fma 1e-600000 1e-400997 0E+999999 -> 1E-1000997 Subnormal
-fmax2785 fma 1e-600000 1e-400998 0E+999999 -> 0E-1000997 Underflow Subnormal Inexact Rounded Clamped
-
--- test subnormals rounding
-precision: 5
-maxExponent: 999
-minexponent: -999
-rounding: half_even
-
-fmax2801 fma 1.0000E-999 1 0E+999999 -> 1.0000E-999
-fmax2802 fma 1.000E-999 1e-1 0E+999999 -> 1.000E-1000 Subnormal
-fmax2803 fma 1.00E-999 1e-2 0E+999999 -> 1.00E-1001 Subnormal
-fmax2804 fma 1.0E-999 1e-3 0E+999999 -> 1.0E-1002 Subnormal
-fmax2805 fma 1.0E-999 1e-4 0E+999999 -> 1E-1003 Subnormal Rounded
-fmax2806 fma 1.3E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-fmax2807 fma 1.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2808 fma 1.7E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2809 fma 2.3E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2810 fma 2.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2811 fma 2.7E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded
-fmax2812 fma 1.49E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-fmax2813 fma 1.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2814 fma 1.51E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2815 fma 2.49E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2816 fma 2.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2817 fma 2.51E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded
-
-fmax2818 fma 1E-999 1e-4 0E+999999 -> 1E-1003 Subnormal
-fmax2819 fma 3E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2820 fma 5E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2821 fma 7E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-fmax2822 fma 9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-fmax2823 fma 9.9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-
-fmax2824 fma 1E-999 -1e-4 0E+999999 -> -1E-1003 Subnormal
-fmax2825 fma 3E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2826 fma -5E-999 1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2827 fma 7E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
-fmax2828 fma -9E-999 1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
-fmax2829 fma 9.9E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
-fmax2830 fma 3.0E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
-
-fmax2831 fma 1.0E-501 1e-501 0E+999999 -> 1.0E-1002 Subnormal
-fmax2832 fma 2.0E-501 2e-501 0E+999999 -> 4.0E-1002 Subnormal
-fmax2833 fma 4.0E-501 4e-501 0E+999999 -> 1.60E-1001 Subnormal
-fmax2834 fma 10.0E-501 10e-501 0E+999999 -> 1.000E-1000 Subnormal
-fmax2835 fma 30.0E-501 30e-501 0E+999999 -> 9.000E-1000 Subnormal
-fmax2836 fma 40.0E-501 40e-501 0E+999999 -> 1.6000E-999
-
--- squares
-fmax2840 fma 1E-502 1e-502 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2841 fma 1E-501 1e-501 0E+999999 -> 1E-1002 Subnormal
-fmax2842 fma 2E-501 2e-501 0E+999999 -> 4E-1002 Subnormal
-fmax2843 fma 4E-501 4e-501 0E+999999 -> 1.6E-1001 Subnormal
-fmax2844 fma 10E-501 10e-501 0E+999999 -> 1.00E-1000 Subnormal
-fmax2845 fma 30E-501 30e-501 0E+999999 -> 9.00E-1000 Subnormal
-fmax2846 fma 40E-501 40e-501 0E+999999 -> 1.600E-999
-
--- cubes
-fmax2850 fma 1E-670 1e-335 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2851 fma 1E-668 1e-334 0E+999999 -> 1E-1002 Subnormal
-fmax2852 fma 4E-668 2e-334 0E+999999 -> 8E-1002 Subnormal
-fmax2853 fma 9E-668 3e-334 0E+999999 -> 2.7E-1001 Subnormal
-fmax2854 fma 16E-668 4e-334 0E+999999 -> 6.4E-1001 Subnormal
-fmax2855 fma 25E-668 5e-334 0E+999999 -> 1.25E-1000 Subnormal
-fmax2856 fma 10E-668 100e-334 0E+999999 -> 1.000E-999
-
--- test derived from result of 0.099 ** 999 at 15 digits with unlimited exponent
-precision: 19
-fmax2860 fma 6636851557994578716E-520 6636851557994578716E-520 0E+999999 -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded
-
--- Long operand overflow may be a different path
-precision: 3
-maxExponent: 999999
-minexponent: -999999
-fmax2870 fma 1 9.999E+999999 0E+999999 -> Infinity Inexact Overflow Rounded
-fmax2871 fma 1 -9.999E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded
-fmax2872 fma 9.999E+999999 1 0E+999999 -> Infinity Inexact Overflow Rounded
-fmax2873 fma -9.999E+999999 1 0E+999999 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-precision: 5
-maxexponent: 79
-minexponent: -79
-fmax2881 fma 1.2347E-40 1.2347E-40 0E+999999 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax2882 fma 1.234E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
-fmax2883 fma 1.23E-40 1.23E-40 0E+999999 -> 1.513E-80 Inexact Rounded Subnormal Underflow
-fmax2884 fma 1.2E-40 1.2E-40 0E+999999 -> 1.44E-80 Subnormal
-fmax2885 fma 1.2E-40 1.2E-41 0E+999999 -> 1.44E-81 Subnormal
-fmax2886 fma 1.2E-40 1.2E-42 0E+999999 -> 1.4E-82 Subnormal Inexact Rounded Underflow
-fmax2887 fma 1.2E-40 1.3E-42 0E+999999 -> 1.6E-82 Subnormal Inexact Rounded Underflow
-fmax2888 fma 1.3E-40 1.3E-42 0E+999999 -> 1.7E-82 Subnormal Inexact Rounded Underflow
-fmax2889 fma 1.3E-40 1.3E-43 0E+999999 -> 2E-83 Subnormal Inexact Rounded Underflow
-fmax2890 fma 1.3E-41 1.3E-43 0E+999999 -> 0E-83 Clamped Subnormal Inexact Rounded Underflow
-
-fmax2891 fma 1.2345E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded
-fmax2892 fma 1.23456E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded
-fmax2893 fma 1.2345E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
-fmax2894 fma 1.23456E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
-fmax2895 fma 1.2345E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow
-fmax2896 fma 1.23456E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
-fmax2900 fma 0.3000000000E-191 0.3000000000E-191 0E+999999 -> 9.00000000000000E-384 Subnormal Rounded
-fmax2901 fma 0.3000000001E-191 0.3000000001E-191 0E+999999 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
-fmax2902 fma 9.999999999999999E-383 0.0999999999999 0E+999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
-fmax2903 fma 9.999999999999999E-383 0.09999999999999 0E+999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
-fmax2904 fma 9.999999999999999E-383 0.099999999999999 0E+999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
-fmax2905 fma 9.999999999999999E-383 0.0999999999999999 0E+999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
--- prove operands are exact
-fmax2906 fma 9.999999999999999E-383 1 0E+999999 -> 9.999999999999999E-383
-fmax2907 fma 1 0.09999999999999999 0E+999999 -> 0.09999999999999999
--- the next rounds to Nmin
-fmax2908 fma 9.999999999999999E-383 0.09999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax2909 fma 9.999999999999999E-383 0.099999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax2910 fma 9.999999999999999E-383 0.0999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax2911 fma 9.999999999999999E-383 0.09999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-
--- Examples from SQL proposal (Krishna Kulkarni)
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
-fmax2921 fma 130E-2 120E-2 0E+999999 -> 1.5600
-fmax2922 fma 130E-2 12E-1 0E+999999 -> 1.560
-fmax2923 fma 130E-2 1E0 0E+999999 -> 1.30
-
--- Null tests
-fmax2990 fma # 10 0E+999999 -> NaN Invalid_operation
-fmax2991 fma 10 # 0E+999999 -> NaN Invalid_operation
-
--- ADDITION TESTS ------------------------------------------------------
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- [first group are 'quick confidence check']
-fmax3001 fma 1 1 1 -> 2
-fmax3002 fma 1 2 3 -> 5
-fmax3003 fma 1 '5.75' '3.3' -> 9.05
-fmax3004 fma 1 '5' '-3' -> 2
-fmax3005 fma 1 '-5' '-3' -> -8
-fmax3006 fma 1 '-7' '2.5' -> -4.5
-fmax3007 fma 1 '0.7' '0.3' -> 1.0
-fmax3008 fma 1 '1.25' '1.25' -> 2.50
-fmax3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
-fmax3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
-
-fmax3011 fma 1 '0.4444444444' '0.5555555555' -> '1.00000000' Inexact Rounded
-fmax3012 fma 1 '0.4444444440' '0.5555555555' -> '1.00000000' Inexact Rounded
-fmax3013 fma 1 '0.4444444444' '0.5555555550' -> '0.999999999' Inexact Rounded
-fmax3014 fma 1 '0.44444444449' '0' -> '0.444444444' Inexact Rounded
-fmax3015 fma 1 '0.444444444499' '0' -> '0.444444444' Inexact Rounded
-fmax3016 fma 1 '0.4444444444999' '0' -> '0.444444444' Inexact Rounded
-fmax3017 fma 1 '0.4444444445000' '0' -> '0.444444445' Inexact Rounded
-fmax3018 fma 1 '0.4444444445001' '0' -> '0.444444445' Inexact Rounded
-fmax3019 fma 1 '0.444444444501' '0' -> '0.444444445' Inexact Rounded
-fmax3020 fma 1 '0.44444444451' '0' -> '0.444444445' Inexact Rounded
-
-fmax3021 fma 1 0 1 -> 1
-fmax3022 fma 1 1 1 -> 2
-fmax3023 fma 1 2 1 -> 3
-fmax3024 fma 1 3 1 -> 4
-fmax3025 fma 1 4 1 -> 5
-fmax3026 fma 1 5 1 -> 6
-fmax3027 fma 1 6 1 -> 7
-fmax3028 fma 1 7 1 -> 8
-fmax3029 fma 1 8 1 -> 9
-fmax3030 fma 1 9 1 -> 10
-
--- some carrying effects
-fmax3031 fma 1 '0.9998' '0.0000' -> '0.9998'
-fmax3032 fma 1 '0.9998' '0.0001' -> '0.9999'
-fmax3033 fma 1 '0.9998' '0.0002' -> '1.0000'
-fmax3034 fma 1 '0.9998' '0.0003' -> '1.0001'
-
-fmax3035 fma 1 '70' '10000e+9' -> '1.00000000E+13' Inexact Rounded
-fmax3036 fma 1 '700' '10000e+9' -> '1.00000000E+13' Inexact Rounded
-fmax3037 fma 1 '7000' '10000e+9' -> '1.00000000E+13' Inexact Rounded
-fmax3038 fma 1 '70000' '10000e+9' -> '1.00000001E+13' Inexact Rounded
-fmax3039 fma 1 '700000' '10000e+9' -> '1.00000007E+13' Rounded
-
--- symmetry:
-fmax3040 fma 1 '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded
-fmax3041 fma 1 '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded
-fmax3042 fma 1 '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded
-fmax3044 fma 1 '10000e+9' '70000' -> '1.00000001E+13' Inexact Rounded
-fmax3045 fma 1 '10000e+9' '700000' -> '1.00000007E+13' Rounded
-
--- same, higher precision
-precision: 15
-fmax3046 fma 1 '10000e+9' '7' -> '10000000000007'
-fmax3047 fma 1 '10000e+9' '70' -> '10000000000070'
-fmax3048 fma 1 '10000e+9' '700' -> '10000000000700'
-fmax3049 fma 1 '10000e+9' '7000' -> '10000000007000'
-fmax3050 fma 1 '10000e+9' '70000' -> '10000000070000'
-fmax3051 fma 1 '10000e+9' '700000' -> '10000000700000'
-fmax3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-fmax3053 fma 1 '12' '7.00' -> '19.00'
-fmax3054 fma 1 '1.3' '-1.07' -> '0.23'
-fmax3055 fma 1 '1.3' '-1.30' -> '0.00'
-fmax3056 fma 1 '1.3' '-2.07' -> '-0.77'
-fmax3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
-
--- zero preservation
-precision: 6
-fmax3060 fma 1 '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded
-fmax3061 fma 1 1 '0.0001' -> '1.0001'
-fmax3062 fma 1 1 '0.00001' -> '1.00001'
-fmax3063 fma 1 1 '0.000001' -> '1.00000' Inexact Rounded
-fmax3064 fma 1 1 '0.0000001' -> '1.00000' Inexact Rounded
-fmax3065 fma 1 1 '0.00000001' -> '1.00000' Inexact Rounded
-
--- some funny zeros [in case of bad signum]
-fmax3070 fma 1 1 0 -> 1
-fmax3071 fma 1 1 0. -> 1
-fmax3072 fma 1 1 .0 -> 1.0
-fmax3073 fma 1 1 0.0 -> 1.0
-fmax3074 fma 1 1 0.00 -> 1.00
-fmax3075 fma 1 0 1 -> 1
-fmax3076 fma 1 0. 1 -> 1
-fmax3077 fma 1 .0 1 -> 1.0
-fmax3078 fma 1 0.0 1 -> 1.0
-fmax3079 fma 1 0.00 1 -> 1.00
-
-precision: 9
-
--- some carries
-fmax3080 fma 1 999999998 1 -> 999999999
-fmax3081 fma 1 999999999 1 -> 1.00000000E+9 Rounded
-fmax3082 fma 1 99999999 1 -> 100000000
-fmax3083 fma 1 9999999 1 -> 10000000
-fmax3084 fma 1 999999 1 -> 1000000
-fmax3085 fma 1 99999 1 -> 100000
-fmax3086 fma 1 9999 1 -> 10000
-fmax3087 fma 1 999 1 -> 1000
-fmax3088 fma 1 99 1 -> 100
-fmax3089 fma 1 9 1 -> 10
-
-
--- more LHS swaps
-fmax3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
-fmax3091 fma 1 '-56267E-6' 0 -> '-0.056267'
-fmax3092 fma 1 '-56267E-5' 0 -> '-0.56267'
-fmax3093 fma 1 '-56267E-4' 0 -> '-5.6267'
-fmax3094 fma 1 '-56267E-3' 0 -> '-56.267'
-fmax3095 fma 1 '-56267E-2' 0 -> '-562.67'
-fmax3096 fma 1 '-56267E-1' 0 -> '-5626.7'
-fmax3097 fma 1 '-56267E-0' 0 -> '-56267'
-fmax3098 fma 1 '-5E-10' 0 -> '-5E-10'
-fmax3099 fma 1 '-5E-7' 0 -> '-5E-7'
-fmax3100 fma 1 '-5E-6' 0 -> '-0.000005'
-fmax3101 fma 1 '-5E-5' 0 -> '-0.00005'
-fmax3102 fma 1 '-5E-4' 0 -> '-0.0005'
-fmax3103 fma 1 '-5E-1' 0 -> '-0.5'
-fmax3104 fma 1 '-5E0' 0 -> '-5'
-fmax3105 fma 1 '-5E1' 0 -> '-50'
-fmax3106 fma 1 '-5E5' 0 -> '-500000'
-fmax3107 fma 1 '-5E8' 0 -> '-500000000'
-fmax3108 fma 1 '-5E9' 0 -> '-5.00000000E+9' Rounded
-fmax3109 fma 1 '-5E10' 0 -> '-5.00000000E+10' Rounded
-fmax3110 fma 1 '-5E11' 0 -> '-5.00000000E+11' Rounded
-fmax3111 fma 1 '-5E100' 0 -> '-5.00000000E+100' Rounded
-
--- more RHS swaps
-fmax3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
-fmax3114 fma 1 0 '-56267E-6' -> '-0.056267'
-fmax3116 fma 1 0 '-56267E-5' -> '-0.56267'
-fmax3117 fma 1 0 '-56267E-4' -> '-5.6267'
-fmax3119 fma 1 0 '-56267E-3' -> '-56.267'
-fmax3120 fma 1 0 '-56267E-2' -> '-562.67'
-fmax3121 fma 1 0 '-56267E-1' -> '-5626.7'
-fmax3122 fma 1 0 '-56267E-0' -> '-56267'
-fmax3123 fma 1 0 '-5E-10' -> '-5E-10'
-fmax3124 fma 1 0 '-5E-7' -> '-5E-7'
-fmax3125 fma 1 0 '-5E-6' -> '-0.000005'
-fmax3126 fma 1 0 '-5E-5' -> '-0.00005'
-fmax3127 fma 1 0 '-5E-4' -> '-0.0005'
-fmax3128 fma 1 0 '-5E-1' -> '-0.5'
-fmax3129 fma 1 0 '-5E0' -> '-5'
-fmax3130 fma 1 0 '-5E1' -> '-50'
-fmax3131 fma 1 0 '-5E5' -> '-500000'
-fmax3132 fma 1 0 '-5E8' -> '-500000000'
-fmax3133 fma 1 0 '-5E9' -> '-5.00000000E+9' Rounded
-fmax3134 fma 1 0 '-5E10' -> '-5.00000000E+10' Rounded
-fmax3135 fma 1 0 '-5E11' -> '-5.00000000E+11' Rounded
-fmax3136 fma 1 0 '-5E100' -> '-5.00000000E+100' Rounded
-
--- related
-fmax3137 fma 1 1 '0E-12' -> '1.00000000' Rounded
-fmax3138 fma 1 -1 '0E-12' -> '-1.00000000' Rounded
-fmax3139 fma 1 '0E-12' 1 -> '1.00000000' Rounded
-fmax3140 fma 1 '0E-12' -1 -> '-1.00000000' Rounded
-fmax3141 fma 1 1E+4 0.0000 -> '10000.0000'
-fmax3142 fma 1 1E+4 0.00000 -> '10000.0000' Rounded
-fmax3143 fma 1 0.000 1E+5 -> '100000.000'
-fmax3144 fma 1 0.0000 1E+5 -> '100000.000' Rounded
-
--- [some of the next group are really constructor tests]
-fmax3146 fma 1 '00.0' 0 -> '0.0'
-fmax3147 fma 1 '0.00' 0 -> '0.00'
-fmax3148 fma 1 0 '0.00' -> '0.00'
-fmax3149 fma 1 0 '00.0' -> '0.0'
-fmax3150 fma 1 '00.0' '0.00' -> '0.00'
-fmax3151 fma 1 '0.00' '00.0' -> '0.00'
-fmax3152 fma 1 '3' '.3' -> '3.3'
-fmax3153 fma 1 '3.' '.3' -> '3.3'
-fmax3154 fma 1 '3.0' '.3' -> '3.3'
-fmax3155 fma 1 '3.00' '.3' -> '3.30'
-fmax3156 fma 1 '3' '3' -> '6'
-fmax3157 fma 1 '3' '+3' -> '6'
-fmax3158 fma 1 '3' '-3' -> '0'
-fmax3159 fma 1 '0.3' '-0.3' -> '0.0'
-fmax3160 fma 1 '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-precision: 15
-fmax3161 fma 1 '1E+12' '-1' -> '999999999999'
-fmax3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
-fmax3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
-fmax3164 fma 1 '-1' '1E+12' -> '999999999999'
-fmax3165 fma 1 '7E+12' '-1' -> '6999999999999'
-fmax3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
-fmax3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
-fmax3168 fma 1 '-1' '7E+12' -> '6999999999999'
-
--- 123456789012345 123456789012345 1 23456789012345
-fmax3170 fma 1 '0.444444444444444' '0.555555555555563' -> '1.00000000000001' Inexact Rounded
-fmax3171 fma 1 '0.444444444444444' '0.555555555555562' -> '1.00000000000001' Inexact Rounded
-fmax3172 fma 1 '0.444444444444444' '0.555555555555561' -> '1.00000000000001' Inexact Rounded
-fmax3173 fma 1 '0.444444444444444' '0.555555555555560' -> '1.00000000000000' Inexact Rounded
-fmax3174 fma 1 '0.444444444444444' '0.555555555555559' -> '1.00000000000000' Inexact Rounded
-fmax3175 fma 1 '0.444444444444444' '0.555555555555558' -> '1.00000000000000' Inexact Rounded
-fmax3176 fma 1 '0.444444444444444' '0.555555555555557' -> '1.00000000000000' Inexact Rounded
-fmax3177 fma 1 '0.444444444444444' '0.555555555555556' -> '1.00000000000000' Rounded
-fmax3178 fma 1 '0.444444444444444' '0.555555555555555' -> '0.999999999999999'
-fmax3179 fma 1 '0.444444444444444' '0.555555555555554' -> '0.999999999999998'
-fmax3180 fma 1 '0.444444444444444' '0.555555555555553' -> '0.999999999999997'
-fmax3181 fma 1 '0.444444444444444' '0.555555555555552' -> '0.999999999999996'
-fmax3182 fma 1 '0.444444444444444' '0.555555555555551' -> '0.999999999999995'
-fmax3183 fma 1 '0.444444444444444' '0.555555555555550' -> '0.999999999999994'
-
--- and some more, including residue effects and different roundings
-precision: 9
-rounding: half_up
-fmax3200 fma 1 '123456789' 0 -> '123456789'
-fmax3201 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
-fmax3202 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
-fmax3203 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
-fmax3204 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
-fmax3205 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
-fmax3206 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
-fmax3207 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
-fmax3208 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded
-fmax3209 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded
-fmax3210 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded
-fmax3211 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded
-fmax3212 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded
-fmax3213 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded
-fmax3214 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded
-fmax3215 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded
-fmax3216 fma 1 '123456789' 1 -> '123456790'
-fmax3217 fma 1 '123456789' 1.000000001 -> '123456790' Inexact Rounded
-fmax3218 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
-fmax3219 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
-
-rounding: half_even
-fmax3220 fma 1 '123456789' 0 -> '123456789'
-fmax3221 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
-fmax3222 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
-fmax3223 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
-fmax3224 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
-fmax3225 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
-fmax3226 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
-fmax3227 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
-fmax3228 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded
-fmax3229 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded
-fmax3230 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded
-fmax3231 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded
-fmax3232 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded
-fmax3233 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded
-fmax3234 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded
-fmax3235 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded
-fmax3236 fma 1 '123456789' 1 -> '123456790'
-fmax3237 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded
-fmax3238 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
-fmax3239 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
--- critical few with even bottom digit...
-fmax3240 fma 1 '123456788' 0.499999999 -> '123456788' Inexact Rounded
-fmax3241 fma 1 '123456788' 0.5 -> '123456788' Inexact Rounded
-fmax3242 fma 1 '123456788' 0.500000001 -> '123456789' Inexact Rounded
-
-rounding: down
-fmax3250 fma 1 '123456789' 0 -> '123456789'
-fmax3251 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
-fmax3252 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
-fmax3253 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
-fmax3254 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
-fmax3255 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
-fmax3256 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
-fmax3257 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
-fmax3258 fma 1 '123456789' 0.5 -> '123456789' Inexact Rounded
-fmax3259 fma 1 '123456789' 0.500000001 -> '123456789' Inexact Rounded
-fmax3260 fma 1 '123456789' 0.500001 -> '123456789' Inexact Rounded
-fmax3261 fma 1 '123456789' 0.51 -> '123456789' Inexact Rounded
-fmax3262 fma 1 '123456789' 0.6 -> '123456789' Inexact Rounded
-fmax3263 fma 1 '123456789' 0.9 -> '123456789' Inexact Rounded
-fmax3264 fma 1 '123456789' 0.99999 -> '123456789' Inexact Rounded
-fmax3265 fma 1 '123456789' 0.999999999 -> '123456789' Inexact Rounded
-fmax3266 fma 1 '123456789' 1 -> '123456790'
-fmax3267 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded
-fmax3268 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
-fmax3269 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
-
--- input preparation tests (operands should not be rounded)
-precision: 3
-rounding: half_up
-
-fmax3270 fma 1 '12345678900000' 9999999999999 -> '2.23E+13' Inexact Rounded
-fmax3271 fma 1 '9999999999999' 12345678900000 -> '2.23E+13' Inexact Rounded
-
-fmax3272 fma 1 '12E+3' '3444' -> '1.54E+4' Inexact Rounded
-fmax3273 fma 1 '12E+3' '3446' -> '1.54E+4' Inexact Rounded
-fmax3274 fma 1 '12E+3' '3449.9' -> '1.54E+4' Inexact Rounded
-fmax3275 fma 1 '12E+3' '3450.0' -> '1.55E+4' Inexact Rounded
-fmax3276 fma 1 '12E+3' '3450.1' -> '1.55E+4' Inexact Rounded
-fmax3277 fma 1 '12E+3' '3454' -> '1.55E+4' Inexact Rounded
-fmax3278 fma 1 '12E+3' '3456' -> '1.55E+4' Inexact Rounded
-
-fmax3281 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3282 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3283 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3284 fma 1 '3450.0' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3285 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3286 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3287 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded
-
-rounding: half_down
-fmax3291 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3292 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3293 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3294 fma 1 '3450.0' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3295 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3296 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3297 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-fmax3301 fma 1 -1 1 -> 0
-fmax3302 fma 1 0 1 -> 1
-fmax3303 fma 1 1 1 -> 2
-fmax3304 fma 1 12 1 -> 13
-fmax3305 fma 1 98 1 -> 99
-fmax3306 fma 1 99 1 -> 100
-fmax3307 fma 1 100 1 -> 101
-fmax3308 fma 1 101 1 -> 102
-fmax3309 fma 1 -1 -1 -> -2
-fmax3310 fma 1 0 -1 -> -1
-fmax3311 fma 1 1 -1 -> 0
-fmax3312 fma 1 12 -1 -> 11
-fmax3313 fma 1 98 -1 -> 97
-fmax3314 fma 1 99 -1 -> 98
-fmax3315 fma 1 100 -1 -> 99
-fmax3316 fma 1 101 -1 -> 100
-
-fmax3321 fma 1 -0.01 0.01 -> 0.00
-fmax3322 fma 1 0.00 0.01 -> 0.01
-fmax3323 fma 1 0.01 0.01 -> 0.02
-fmax3324 fma 1 0.12 0.01 -> 0.13
-fmax3325 fma 1 0.98 0.01 -> 0.99
-fmax3326 fma 1 0.99 0.01 -> 1.00
-fmax3327 fma 1 1.00 0.01 -> 1.01
-fmax3328 fma 1 1.01 0.01 -> 1.02
-fmax3329 fma 1 -0.01 -0.01 -> -0.02
-fmax3330 fma 1 0.00 -0.01 -> -0.01
-fmax3331 fma 1 0.01 -0.01 -> 0.00
-fmax3332 fma 1 0.12 -0.01 -> 0.11
-fmax3333 fma 1 0.98 -0.01 -> 0.97
-fmax3334 fma 1 0.99 -0.01 -> 0.98
-fmax3335 fma 1 1.00 -0.01 -> 0.99
-fmax3336 fma 1 1.01 -0.01 -> 1.00
-
--- some more cases where fma 1 ing 0 affects the coefficient
-precision: 9
-fmax3340 fma 1 1E+3 0 -> 1000
-fmax3341 fma 1 1E+8 0 -> 100000000
-fmax3342 fma 1 1E+9 0 -> 1.00000000E+9 Rounded
-fmax3343 fma 1 1E+10 0 -> 1.00000000E+10 Rounded
--- which simply follow from these cases ...
-fmax3344 fma 1 1E+3 1 -> 1001
-fmax3345 fma 1 1E+8 1 -> 100000001
-fmax3346 fma 1 1E+9 1 -> 1.00000000E+9 Inexact Rounded
-fmax3347 fma 1 1E+10 1 -> 1.00000000E+10 Inexact Rounded
-fmax3348 fma 1 1E+3 7 -> 1007
-fmax3349 fma 1 1E+8 7 -> 100000007
-fmax3350 fma 1 1E+9 7 -> 1.00000001E+9 Inexact Rounded
-fmax3351 fma 1 1E+10 7 -> 1.00000000E+10 Inexact Rounded
-
--- tryzeros cases
-precision: 7
-rounding: half_up
-maxExponent: 92
-minexponent: -92
-fmax3361 fma 1 0E+50 10000E+1 -> 1.0000E+5
-fmax3362 fma 1 10000E+1 0E-50 -> 100000.0 Rounded
-fmax3363 fma 1 10000E+1 10000E-50 -> 100000.0 Rounded Inexact
-fmax3364 fma 1 9.999999E+92 -9.999999E+92 -> 0E+86
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-precision: 10
-fmax3370 fma 1 99999999 81512 -> 100081511
-precision: 6
-fmax3371 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
-rounding: half_up
-precision: 10
-fmax3372 fma 1 99999999 81512 -> 100081511
-precision: 6
-fmax3373 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
-rounding: half_even
-precision: 10
-fmax3374 fma 1 99999999 81512 -> 100081511
-precision: 6
-fmax3375 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
-
--- ulp replacement tests
-precision: 9
-maxexponent: 999999
-minexponent: -999999
-fmax3400 fma 1 1 77e-7 -> 1.0000077
-fmax3401 fma 1 1 77e-8 -> 1.00000077
-fmax3402 fma 1 1 77e-9 -> 1.00000008 Inexact Rounded
-fmax3403 fma 1 1 77e-10 -> 1.00000001 Inexact Rounded
-fmax3404 fma 1 1 77e-11 -> 1.00000000 Inexact Rounded
-fmax3405 fma 1 1 77e-12 -> 1.00000000 Inexact Rounded
-fmax3406 fma 1 1 77e-999 -> 1.00000000 Inexact Rounded
-fmax3407 fma 1 1 77e-999999 -> 1.00000000 Inexact Rounded
-
-fmax3410 fma 1 10 77e-7 -> 10.0000077
-fmax3411 fma 1 10 77e-8 -> 10.0000008 Inexact Rounded
-fmax3412 fma 1 10 77e-9 -> 10.0000001 Inexact Rounded
-fmax3413 fma 1 10 77e-10 -> 10.0000000 Inexact Rounded
-fmax3414 fma 1 10 77e-11 -> 10.0000000 Inexact Rounded
-fmax3415 fma 1 10 77e-12 -> 10.0000000 Inexact Rounded
-fmax3416 fma 1 10 77e-999 -> 10.0000000 Inexact Rounded
-fmax3417 fma 1 10 77e-999999 -> 10.0000000 Inexact Rounded
-
-fmax3420 fma 1 77e-7 1 -> 1.0000077
-fmax3421 fma 1 77e-8 1 -> 1.00000077
-fmax3422 fma 1 77e-9 1 -> 1.00000008 Inexact Rounded
-fmax3423 fma 1 77e-10 1 -> 1.00000001 Inexact Rounded
-fmax3424 fma 1 77e-11 1 -> 1.00000000 Inexact Rounded
-fmax3425 fma 1 77e-12 1 -> 1.00000000 Inexact Rounded
-fmax3426 fma 1 77e-999 1 -> 1.00000000 Inexact Rounded
-fmax3427 fma 1 77e-999999 1 -> 1.00000000 Inexact Rounded
-
-fmax3430 fma 1 77e-7 10 -> 10.0000077
-fmax3431 fma 1 77e-8 10 -> 10.0000008 Inexact Rounded
-fmax3432 fma 1 77e-9 10 -> 10.0000001 Inexact Rounded
-fmax3433 fma 1 77e-10 10 -> 10.0000000 Inexact Rounded
-fmax3434 fma 1 77e-11 10 -> 10.0000000 Inexact Rounded
-fmax3435 fma 1 77e-12 10 -> 10.0000000 Inexact Rounded
-fmax3436 fma 1 77e-999 10 -> 10.0000000 Inexact Rounded
-fmax3437 fma 1 77e-999999 10 -> 10.0000000 Inexact Rounded
-
--- negative ulps
-fmax3440 fma 1 1 -77e-7 -> 0.9999923
-fmax3441 fma 1 1 -77e-8 -> 0.99999923
-fmax3442 fma 1 1 -77e-9 -> 0.999999923
-fmax3443 fma 1 1 -77e-10 -> 0.999999992 Inexact Rounded
-fmax3444 fma 1 1 -77e-11 -> 0.999999999 Inexact Rounded
-fmax3445 fma 1 1 -77e-12 -> 1.00000000 Inexact Rounded
-fmax3446 fma 1 1 -77e-999 -> 1.00000000 Inexact Rounded
-fmax3447 fma 1 1 -77e-999999 -> 1.00000000 Inexact Rounded
-
-fmax3450 fma 1 10 -77e-7 -> 9.9999923
-fmax3451 fma 1 10 -77e-8 -> 9.99999923
-fmax3452 fma 1 10 -77e-9 -> 9.99999992 Inexact Rounded
-fmax3453 fma 1 10 -77e-10 -> 9.99999999 Inexact Rounded
-fmax3454 fma 1 10 -77e-11 -> 10.0000000 Inexact Rounded
-fmax3455 fma 1 10 -77e-12 -> 10.0000000 Inexact Rounded
-fmax3456 fma 1 10 -77e-999 -> 10.0000000 Inexact Rounded
-fmax3457 fma 1 10 -77e-999999 -> 10.0000000 Inexact Rounded
-
-fmax3460 fma 1 -77e-7 1 -> 0.9999923
-fmax3461 fma 1 -77e-8 1 -> 0.99999923
-fmax3462 fma 1 -77e-9 1 -> 0.999999923
-fmax3463 fma 1 -77e-10 1 -> 0.999999992 Inexact Rounded
-fmax3464 fma 1 -77e-11 1 -> 0.999999999 Inexact Rounded
-fmax3465 fma 1 -77e-12 1 -> 1.00000000 Inexact Rounded
-fmax3466 fma 1 -77e-999 1 -> 1.00000000 Inexact Rounded
-fmax3467 fma 1 -77e-999999 1 -> 1.00000000 Inexact Rounded
-
-fmax3470 fma 1 -77e-7 10 -> 9.9999923
-fmax3471 fma 1 -77e-8 10 -> 9.99999923
-fmax3472 fma 1 -77e-9 10 -> 9.99999992 Inexact Rounded
-fmax3473 fma 1 -77e-10 10 -> 9.99999999 Inexact Rounded
-fmax3474 fma 1 -77e-11 10 -> 10.0000000 Inexact Rounded
-fmax3475 fma 1 -77e-12 10 -> 10.0000000 Inexact Rounded
-fmax3476 fma 1 -77e-999 10 -> 10.0000000 Inexact Rounded
-fmax3477 fma 1 -77e-999999 10 -> 10.0000000 Inexact Rounded
-
--- negative ulps
-fmax3480 fma 1 -1 77e-7 -> -0.9999923
-fmax3481 fma 1 -1 77e-8 -> -0.99999923
-fmax3482 fma 1 -1 77e-9 -> -0.999999923
-fmax3483 fma 1 -1 77e-10 -> -0.999999992 Inexact Rounded
-fmax3484 fma 1 -1 77e-11 -> -0.999999999 Inexact Rounded
-fmax3485 fma 1 -1 77e-12 -> -1.00000000 Inexact Rounded
-fmax3486 fma 1 -1 77e-999 -> -1.00000000 Inexact Rounded
-fmax3487 fma 1 -1 77e-999999 -> -1.00000000 Inexact Rounded
-
-fmax3490 fma 1 -10 77e-7 -> -9.9999923
-fmax3491 fma 1 -10 77e-8 -> -9.99999923
-fmax3492 fma 1 -10 77e-9 -> -9.99999992 Inexact Rounded
-fmax3493 fma 1 -10 77e-10 -> -9.99999999 Inexact Rounded
-fmax3494 fma 1 -10 77e-11 -> -10.0000000 Inexact Rounded
-fmax3495 fma 1 -10 77e-12 -> -10.0000000 Inexact Rounded
-fmax3496 fma 1 -10 77e-999 -> -10.0000000 Inexact Rounded
-fmax3497 fma 1 -10 77e-999999 -> -10.0000000 Inexact Rounded
-
-fmax3500 fma 1 77e-7 -1 -> -0.9999923
-fmax3501 fma 1 77e-8 -1 -> -0.99999923
-fmax3502 fma 1 77e-9 -1 -> -0.999999923
-fmax3503 fma 1 77e-10 -1 -> -0.999999992 Inexact Rounded
-fmax3504 fma 1 77e-11 -1 -> -0.999999999 Inexact Rounded
-fmax3505 fma 1 77e-12 -1 -> -1.00000000 Inexact Rounded
-fmax3506 fma 1 77e-999 -1 -> -1.00000000 Inexact Rounded
-fmax3507 fma 1 77e-999999 -1 -> -1.00000000 Inexact Rounded
-
-fmax3510 fma 1 77e-7 -10 -> -9.9999923
-fmax3511 fma 1 77e-8 -10 -> -9.99999923
-fmax3512 fma 1 77e-9 -10 -> -9.99999992 Inexact Rounded
-fmax3513 fma 1 77e-10 -10 -> -9.99999999 Inexact Rounded
-fmax3514 fma 1 77e-11 -10 -> -10.0000000 Inexact Rounded
-fmax3515 fma 1 77e-12 -10 -> -10.0000000 Inexact Rounded
-fmax3516 fma 1 77e-999 -10 -> -10.0000000 Inexact Rounded
-fmax3517 fma 1 77e-999999 -10 -> -10.0000000 Inexact Rounded
-
-
--- long operands
-maxexponent: 999
-minexponent: -999
-precision: 9
-fmax3521 fma 1 12345678000 0 -> 1.23456780E+10 Rounded
-fmax3522 fma 1 0 12345678000 -> 1.23456780E+10 Rounded
-fmax3523 fma 1 1234567800 0 -> 1.23456780E+9 Rounded
-fmax3524 fma 1 0 1234567800 -> 1.23456780E+9 Rounded
-fmax3525 fma 1 1234567890 0 -> 1.23456789E+9 Rounded
-fmax3526 fma 1 0 1234567890 -> 1.23456789E+9 Rounded
-fmax3527 fma 1 1234567891 0 -> 1.23456789E+9 Inexact Rounded
-fmax3528 fma 1 0 1234567891 -> 1.23456789E+9 Inexact Rounded
-fmax3529 fma 1 12345678901 0 -> 1.23456789E+10 Inexact Rounded
-fmax3530 fma 1 0 12345678901 -> 1.23456789E+10 Inexact Rounded
-fmax3531 fma 1 1234567896 0 -> 1.23456790E+9 Inexact Rounded
-fmax3532 fma 1 0 1234567896 -> 1.23456790E+9 Inexact Rounded
-
-precision: 15
--- still checking
-fmax3541 fma 1 12345678000 0 -> 12345678000
-fmax3542 fma 1 0 12345678000 -> 12345678000
-fmax3543 fma 1 1234567800 0 -> 1234567800
-fmax3544 fma 1 0 1234567800 -> 1234567800
-fmax3545 fma 1 1234567890 0 -> 1234567890
-fmax3546 fma 1 0 1234567890 -> 1234567890
-fmax3547 fma 1 1234567891 0 -> 1234567891
-fmax3548 fma 1 0 1234567891 -> 1234567891
-fmax3549 fma 1 12345678901 0 -> 12345678901
-fmax3550 fma 1 0 12345678901 -> 12345678901
-fmax3551 fma 1 1234567896 0 -> 1234567896
-fmax3552 fma 1 0 1234567896 -> 1234567896
-
--- verify a query
-precision: 16
-maxExponent: +394
-minExponent: -393
-rounding: down
-fmax3561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
-fmax3562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
--- and using decimal64 bounds...
-precision: 16
-maxExponent: +384
-minExponent: -383
-rounding: down
-fmax3563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
-fmax3564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
-
-
--- some more residue effects with extreme rounding
-precision: 9
-rounding: half_up
-fmax3601 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-rounding: half_even
-fmax3602 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-rounding: half_down
-fmax3603 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-rounding: floor
-fmax3604 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-rounding: ceiling
-fmax3605 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded
-rounding: up
-fmax3606 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded
-rounding: down
-fmax3607 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-
-rounding: half_up
-fmax3611 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: half_even
-fmax3612 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: half_down
-fmax3613 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: floor
-fmax3614 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded
-rounding: ceiling
-fmax3615 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: up
-fmax3616 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: down
-fmax3617 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded
-
-rounding: half_up
-fmax3621 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-rounding: half_even
-fmax3622 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-rounding: half_down
-fmax3623 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-rounding: floor
-fmax3624 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-rounding: ceiling
-fmax3625 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded
-rounding: up
-fmax3626 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded
-rounding: down
-fmax3627 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-
-rounding: half_up
-fmax3631 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: half_even
-fmax3632 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: half_down
-fmax3633 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: floor
-fmax3634 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded
-rounding: ceiling
-fmax3635 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: up
-fmax3636 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: down
-fmax3637 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded
-
-rounding: half_up
-fmax3641 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: half_even
-fmax3642 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: half_down
-fmax3643 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: floor
-fmax3644 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded
-rounding: ceiling
-fmax3645 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: up
-fmax3646 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: down
-fmax3647 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded
-
-rounding: half_up
-fmax3651 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-rounding: half_even
-fmax3652 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-rounding: half_down
-fmax3653 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-rounding: floor
-fmax3654 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-rounding: ceiling
-fmax3655 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded
-rounding: up
-fmax3656 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded
-rounding: down
-fmax3657 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-
--- long operand triangle
-rounding: half_up
-precision: 37
-fmax3660 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114834538
-precision: 36
-fmax3661 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483454 Inexact Rounded
-precision: 35
-fmax3662 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148345 Inexact Rounded
-precision: 34
-fmax3663 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114835 Inexact Rounded
-precision: 33
-fmax3664 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483 Inexact Rounded
-precision: 32
-fmax3665 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148 Inexact Rounded
-precision: 31
-fmax3666 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded
-precision: 30
-fmax3667 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711 Inexact Rounded
-precision: 29
-fmax3668 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371 Inexact Rounded
-precision: 28
-fmax3669 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337 Inexact Rounded
-precision: 27
-fmax3670 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892234 Inexact Rounded
-precision: 26
-fmax3671 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223 Inexact Rounded
-precision: 25
-fmax3672 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922 Inexact Rounded
-precision: 24
-fmax3673 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892 Inexact Rounded
-precision: 23
-fmax3674 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389 Inexact Rounded
-precision: 22
-fmax3675 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023639 Inexact Rounded
-precision: 21
-fmax3676 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102364 Inexact Rounded
-precision: 20
-fmax3677 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236 Inexact Rounded
-precision: 19
-fmax3678 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211024 Inexact Rounded
-precision: 18
-fmax3679 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102 Inexact Rounded
-precision: 17
-fmax3680 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110 Inexact Rounded
-precision: 16
-fmax3681 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211 Inexact Rounded
-precision: 15
-fmax3682 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221 Inexact Rounded
-precision: 14
-fmax3683 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422 Inexact Rounded
-precision: 13
-fmax3684 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42 Inexact Rounded
-precision: 12
-fmax3685 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4 Inexact Rounded
-precision: 11
-fmax3686 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166 Inexact Rounded
-precision: 10
-fmax3687 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117417E+10 Inexact Rounded
-precision: 9
-fmax3688 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84711742E+10 Inexact Rounded
-precision: 8
-fmax3689 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471174E+10 Inexact Rounded
-precision: 7
-fmax3690 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117E+10 Inexact Rounded
-precision: 6
-fmax3691 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84712E+10 Inexact Rounded
-precision: 5
-fmax3692 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471E+10 Inexact Rounded
-precision: 4
-fmax3693 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847E+10 Inexact Rounded
-precision: 3
-fmax3694 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.85E+10 Inexact Rounded
-precision: 2
-fmax3695 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8E+10 Inexact Rounded
-precision: 1
-fmax3696 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1E+11 Inexact Rounded
-
--- more zeros, etc.
-rounding: half_up
-precision: 9
-
-fmax3701 fma 1 5.00 1.00E-3 -> 5.00100
-fmax3702 fma 1 00.00 0.000 -> 0.000
-fmax3703 fma 1 00.00 0E-3 -> 0.000
-fmax3704 fma 1 0E-3 00.00 -> 0.000
-
-fmax3710 fma 1 0E+3 00.00 -> 0.00
-fmax3711 fma 1 0E+3 00.0 -> 0.0
-fmax3712 fma 1 0E+3 00. -> 0
-fmax3713 fma 1 0E+3 00.E+1 -> 0E+1
-fmax3714 fma 1 0E+3 00.E+2 -> 0E+2
-fmax3715 fma 1 0E+3 00.E+3 -> 0E+3
-fmax3716 fma 1 0E+3 00.E+4 -> 0E+3
-fmax3717 fma 1 0E+3 00.E+5 -> 0E+3
-fmax3718 fma 1 0E+3 -00.0 -> 0.0
-fmax3719 fma 1 0E+3 -00. -> 0
-fmax3731 fma 1 0E+3 -00.E+1 -> 0E+1
-
-fmax3720 fma 1 00.00 0E+3 -> 0.00
-fmax3721 fma 1 00.0 0E+3 -> 0.0
-fmax3722 fma 1 00. 0E+3 -> 0
-fmax3723 fma 1 00.E+1 0E+3 -> 0E+1
-fmax3724 fma 1 00.E+2 0E+3 -> 0E+2
-fmax3725 fma 1 00.E+3 0E+3 -> 0E+3
-fmax3726 fma 1 00.E+4 0E+3 -> 0E+3
-fmax3727 fma 1 00.E+5 0E+3 -> 0E+3
-fmax3728 fma 1 -00.00 0E+3 -> 0.00
-fmax3729 fma 1 -00.0 0E+3 -> 0.0
-fmax3730 fma 1 -00. 0E+3 -> 0
-
-fmax3732 fma 1 0 0 -> 0
-fmax3733 fma 1 0 -0 -> 0
-fmax3734 fma 1 -0 0 -> 0
-fmax3735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
-
-fmax3736 fma 1 1 -1 -> 0
-fmax3737 fma 1 -1 -1 -> -2
-fmax3738 fma 1 1 1 -> 2
-fmax3739 fma 1 -1 1 -> 0
-
-fmax3741 fma 1 0 -1 -> -1
-fmax3742 fma 1 -0 -1 -> -1
-fmax3743 fma 1 0 1 -> 1
-fmax3744 fma 1 -0 1 -> 1
-fmax3745 fma 1 -1 0 -> -1
-fmax3746 fma 1 -1 -0 -> -1
-fmax3747 fma 1 1 0 -> 1
-fmax3748 fma 1 1 -0 -> 1
-
-fmax3751 fma 1 0.0 -1 -> -1.0
-fmax3752 fma 1 -0.0 -1 -> -1.0
-fmax3753 fma 1 0.0 1 -> 1.0
-fmax3754 fma 1 -0.0 1 -> 1.0
-fmax3755 fma 1 -1.0 0 -> -1.0
-fmax3756 fma 1 -1.0 -0 -> -1.0
-fmax3757 fma 1 1.0 0 -> 1.0
-fmax3758 fma 1 1.0 -0 -> 1.0
-
-fmax3761 fma 1 0 -1.0 -> -1.0
-fmax3762 fma 1 -0 -1.0 -> -1.0
-fmax3763 fma 1 0 1.0 -> 1.0
-fmax3764 fma 1 -0 1.0 -> 1.0
-fmax3765 fma 1 -1 0.0 -> -1.0
-fmax3766 fma 1 -1 -0.0 -> -1.0
-fmax3767 fma 1 1 0.0 -> 1.0
-fmax3768 fma 1 1 -0.0 -> 1.0
-
-fmax3771 fma 1 0.0 -1.0 -> -1.0
-fmax3772 fma 1 -0.0 -1.0 -> -1.0
-fmax3773 fma 1 0.0 1.0 -> 1.0
-fmax3774 fma 1 -0.0 1.0 -> 1.0
-fmax3775 fma 1 -1.0 0.0 -> -1.0
-fmax3776 fma 1 -1.0 -0.0 -> -1.0
-fmax3777 fma 1 1.0 0.0 -> 1.0
-fmax3778 fma 1 1.0 -0.0 -> 1.0
-
--- Specials
-fmax3780 fma 1 -Inf -Inf -> -Infinity
-fmax3781 fma 1 -Inf -1000 -> -Infinity
-fmax3782 fma 1 -Inf -1 -> -Infinity
-fmax3783 fma 1 -Inf -0 -> -Infinity
-fmax3784 fma 1 -Inf 0 -> -Infinity
-fmax3785 fma 1 -Inf 1 -> -Infinity
-fmax3786 fma 1 -Inf 1000 -> -Infinity
-fmax3787 fma 1 -1000 -Inf -> -Infinity
-fmax3788 fma 1 -Inf -Inf -> -Infinity
-fmax3789 fma 1 -1 -Inf -> -Infinity
-fmax3790 fma 1 -0 -Inf -> -Infinity
-fmax3791 fma 1 0 -Inf -> -Infinity
-fmax3792 fma 1 1 -Inf -> -Infinity
-fmax3793 fma 1 1000 -Inf -> -Infinity
-fmax3794 fma 1 Inf -Inf -> NaN Invalid_operation
-
-fmax3800 fma 1 Inf -Inf -> NaN Invalid_operation
-fmax3801 fma 1 Inf -1000 -> Infinity
-fmax3802 fma 1 Inf -1 -> Infinity
-fmax3803 fma 1 Inf -0 -> Infinity
-fmax3804 fma 1 Inf 0 -> Infinity
-fmax3805 fma 1 Inf 1 -> Infinity
-fmax3806 fma 1 Inf 1000 -> Infinity
-fmax3807 fma 1 Inf Inf -> Infinity
-fmax3808 fma 1 -1000 Inf -> Infinity
-fmax3809 fma 1 -Inf Inf -> NaN Invalid_operation
-fmax3810 fma 1 -1 Inf -> Infinity
-fmax3811 fma 1 -0 Inf -> Infinity
-fmax3812 fma 1 0 Inf -> Infinity
-fmax3813 fma 1 1 Inf -> Infinity
-fmax3814 fma 1 1000 Inf -> Infinity
-fmax3815 fma 1 Inf Inf -> Infinity
-
-fmax3821 fma 1 NaN -Inf -> NaN
-fmax3822 fma 1 NaN -1000 -> NaN
-fmax3823 fma 1 NaN -1 -> NaN
-fmax3824 fma 1 NaN -0 -> NaN
-fmax3825 fma 1 NaN 0 -> NaN
-fmax3826 fma 1 NaN 1 -> NaN
-fmax3827 fma 1 NaN 1000 -> NaN
-fmax3828 fma 1 NaN Inf -> NaN
-fmax3829 fma 1 NaN NaN -> NaN
-fmax3830 fma 1 -Inf NaN -> NaN
-fmax3831 fma 1 -1000 NaN -> NaN
-fmax3832 fma 1 -1 NaN -> NaN
-fmax3833 fma 1 -0 NaN -> NaN
-fmax3834 fma 1 0 NaN -> NaN
-fmax3835 fma 1 1 NaN -> NaN
-fmax3836 fma 1 1000 NaN -> NaN
-fmax3837 fma 1 Inf NaN -> NaN
-
-fmax3841 fma 1 sNaN -Inf -> NaN Invalid_operation
-fmax3842 fma 1 sNaN -1000 -> NaN Invalid_operation
-fmax3843 fma 1 sNaN -1 -> NaN Invalid_operation
-fmax3844 fma 1 sNaN -0 -> NaN Invalid_operation
-fmax3845 fma 1 sNaN 0 -> NaN Invalid_operation
-fmax3846 fma 1 sNaN 1 -> NaN Invalid_operation
-fmax3847 fma 1 sNaN 1000 -> NaN Invalid_operation
-fmax3848 fma 1 sNaN NaN -> NaN Invalid_operation
-fmax3849 fma 1 sNaN sNaN -> NaN Invalid_operation
-fmax3850 fma 1 NaN sNaN -> NaN Invalid_operation
-fmax3851 fma 1 -Inf sNaN -> NaN Invalid_operation
-fmax3852 fma 1 -1000 sNaN -> NaN Invalid_operation
-fmax3853 fma 1 -1 sNaN -> NaN Invalid_operation
-fmax3854 fma 1 -0 sNaN -> NaN Invalid_operation
-fmax3855 fma 1 0 sNaN -> NaN Invalid_operation
-fmax3856 fma 1 1 sNaN -> NaN Invalid_operation
-fmax3857 fma 1 1000 sNaN -> NaN Invalid_operation
-fmax3858 fma 1 Inf sNaN -> NaN Invalid_operation
-fmax3859 fma 1 NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-fmax3861 fma 1 NaN1 -Inf -> NaN1
-fmax3862 fma 1 +NaN2 -1000 -> NaN2
-fmax3863 fma 1 NaN3 1000 -> NaN3
-fmax3864 fma 1 NaN4 Inf -> NaN4
-fmax3865 fma 1 NaN5 +NaN6 -> NaN5
-fmax3866 fma 1 -Inf NaN7 -> NaN7
-fmax3867 fma 1 -1000 NaN8 -> NaN8
-fmax3868 fma 1 1000 NaN9 -> NaN9
-fmax3869 fma 1 Inf +NaN10 -> NaN10
-fmax3871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
-fmax3872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
-fmax3873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
-fmax3874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
-fmax3875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
-fmax3876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
-fmax3877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
-fmax3878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
-fmax3879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
-fmax3880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
-fmax3881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
-fmax3882 fma 1 -NaN26 NaN28 -> -NaN26
-fmax3883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-fmax3884 fma 1 1000 -NaN30 -> -NaN30
-fmax3885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- overflow, underflow and subnormal tests
-maxexponent: 999999
-minexponent: -999999
-precision: 9
-fmax3890 fma 1 1E+999999 9E+999999 -> Infinity Overflow Inexact Rounded
-fmax3891 fma 1 9E+999999 1E+999999 -> Infinity Overflow Inexact Rounded
-fmax3892 fma 1 -1.1E-999999 1E-999999 -> -1E-1000000 Subnormal
-fmax3893 fma 1 1E-999999 -1.1e-999999 -> -1E-1000000 Subnormal
-fmax3894 fma 1 -1.0001E-999999 1E-999999 -> -1E-1000003 Subnormal
-fmax3895 fma 1 1E-999999 -1.0001e-999999 -> -1E-1000003 Subnormal
-fmax3896 fma 1 -1E+999999 -9E+999999 -> -Infinity Overflow Inexact Rounded
-fmax3897 fma 1 -9E+999999 -1E+999999 -> -Infinity Overflow Inexact Rounded
-fmax3898 fma 1 +1.1E-999999 -1E-999999 -> 1E-1000000 Subnormal
-fmax3899 fma 1 -1E-999999 +1.1e-999999 -> 1E-1000000 Subnormal
-fmax3900 fma 1 +1.0001E-999999 -1E-999999 -> 1E-1000003 Subnormal
-fmax3901 fma 1 -1E-999999 +1.0001e-999999 -> 1E-1000003 Subnormal
-fmax3902 fma 1 -1E+999999 +9E+999999 -> 8E+999999
-fmax3903 fma 1 -9E+999999 +1E+999999 -> -8E+999999
-
-precision: 3
-fmax3904 fma 1 0 -9.999E+999999 -> -Infinity Inexact Overflow Rounded
-fmax3905 fma 1 -9.999E+999999 0 -> -Infinity Inexact Overflow Rounded
-fmax3906 fma 1 0 9.999E+999999 -> Infinity Inexact Overflow Rounded
-fmax3907 fma 1 9.999E+999999 0 -> Infinity Inexact Overflow Rounded
-
-precision: 3
-maxexponent: 999
-minexponent: -999
-fmax3910 fma 1 1.00E-999 0 -> 1.00E-999
-fmax3911 fma 1 0.1E-999 0 -> 1E-1000 Subnormal
-fmax3912 fma 1 0.10E-999 0 -> 1.0E-1000 Subnormal
-fmax3913 fma 1 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded
-fmax3914 fma 1 0.01E-999 0 -> 1E-1001 Subnormal
--- next is rounded to Nmin
-fmax3915 fma 1 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow
-fmax3916 fma 1 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3917 fma 1 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow
-fmax3918 fma 1 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3919 fma 1 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3920 fma 1 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-
-fmax3930 fma 1 -1.00E-999 0 -> -1.00E-999
-fmax3931 fma 1 -0.1E-999 0 -> -1E-1000 Subnormal
-fmax3932 fma 1 -0.10E-999 0 -> -1.0E-1000 Subnormal
-fmax3933 fma 1 -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded
-fmax3934 fma 1 -0.01E-999 0 -> -1E-1001 Subnormal
--- next is rounded to Nmin
-fmax3935 fma 1 -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow
-fmax3936 fma 1 -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3937 fma 1 -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow
-fmax3938 fma 1 -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3939 fma 1 -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3940 fma 1 -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-
--- some non-zero subnormal fma 1 s
-fmax3950 fma 1 1.00E-999 0.1E-999 -> 1.10E-999
-fmax3951 fma 1 0.1E-999 0.1E-999 -> 2E-1000 Subnormal
-fmax3952 fma 1 0.10E-999 0.1E-999 -> 2.0E-1000 Subnormal
-fmax3953 fma 1 0.100E-999 0.1E-999 -> 2.0E-1000 Subnormal Rounded
-fmax3954 fma 1 0.01E-999 0.1E-999 -> 1.1E-1000 Subnormal
-fmax3955 fma 1 0.999E-999 0.1E-999 -> 1.10E-999 Inexact Rounded
-fmax3956 fma 1 0.099E-999 0.1E-999 -> 2.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3957 fma 1 0.009E-999 0.1E-999 -> 1.1E-1000 Inexact Rounded Subnormal Underflow
-fmax3958 fma 1 0.001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3959 fma 1 0.0009E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3960 fma 1 0.0001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
--- negatives...
-fmax3961 fma 1 1.00E-999 -0.1E-999 -> 9.0E-1000 Subnormal
-fmax3962 fma 1 0.1E-999 -0.1E-999 -> 0E-1000
-fmax3963 fma 1 0.10E-999 -0.1E-999 -> 0E-1001
-fmax3964 fma 1 0.100E-999 -0.1E-999 -> 0E-1001 Clamped
-fmax3965 fma 1 0.01E-999 -0.1E-999 -> -9E-1001 Subnormal
-fmax3966 fma 1 0.999E-999 -0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3967 fma 1 0.099E-999 -0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3968 fma 1 0.009E-999 -0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow
-fmax3969 fma 1 0.001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3970 fma 1 0.0009E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3971 fma 1 0.0001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-
--- some 'real' numbers
-maxExponent: 384
-minExponent: -383
-precision: 8
-fmax3566 fma 1 99999061735E-394 0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal
-precision: 7
-fmax3567 fma 1 99999061735E-394 0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
-precision: 6
-fmax3568 fma 1 99999061735E-394 0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal
-
--- now the case where we can get underflow but the result is normal
--- [note this can't happen if the operands are also bounded, as we
--- cannot represent 1E-399, for example]
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
-fmax3571 fma 1 1E-383 0 -> 1E-383
-fmax3572 fma 1 1E-384 0 -> 1E-384 Subnormal
-fmax3573 fma 1 1E-383 1E-384 -> 1.1E-383
-fmax3574 subtract 1E-383 1E-384 -> 9E-384 Subnormal
-
--- Here we explore the boundary of rounding a subnormal to Nmin
-fmax3575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
-fmax3576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
-fmax3577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax3578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax3579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax3580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-
--- check for double-rounded subnormals
-precision: 5
-maxexponent: 79
-minexponent: -79
--- Add: lhs and rhs 0
-fmax31001 fma 1 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31002 fma 1 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31003 fma 1 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31004 fma 1 0 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31005 fma 1 0 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31006 fma 1 0 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-
--- Add: lhs >> rhs and vice versa
-fmax31011 fma 1 1.52444E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31012 fma 1 1.52445E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31013 fma 1 1.52446E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31014 fma 1 1E-100 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31015 fma 1 1E-100 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31016 fma 1 1E-100 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-
--- Add: lhs + rhs fma 1 ition carried out
-fmax31021 fma 1 1.52443E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31022 fma 1 1.52444E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31023 fma 1 1.52445E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31024 fma 1 1.00001E-80 1.52443E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31025 fma 1 1.00001E-80 1.52444E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31026 fma 1 1.00001E-80 1.52445E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-
--- And for round down full and subnormal results
-precision: 16
-maxExponent: +384
-minExponent: -383
-rounding: down
-
-fmax31100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
-fmax31101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
-fmax31103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
-fmax31104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
-fmax31105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
-fmax31106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
-fmax31107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
-fmax31108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
-fmax31109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-fmax31110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
-fmax31111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
-fmax31113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
-fmax31114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
-fmax31115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
-fmax31116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
-fmax31117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
-fmax31118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
-fmax31119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
-
-rounding: down
-precision: 7
-maxExponent: +96
-minExponent: -95
-fmax31130 fma 1 1 -1e-200 -> 0.9999999 Rounded Inexact
--- subnormal boundary
-fmax31131 fma 1 1.000000E-94 -1e-200 -> 9.999999E-95 Rounded Inexact
-fmax31132 fma 1 1.000001E-95 -1e-200 -> 1.000000E-95 Rounded Inexact
-fmax31133 fma 1 1.000000E-95 -1e-200 -> 9.99999E-96 Rounded Inexact Subnormal Underflow
-fmax31134 fma 1 0.999999E-95 -1e-200 -> 9.99998E-96 Rounded Inexact Subnormal Underflow
-fmax31135 fma 1 0.001000E-95 -1e-200 -> 9.99E-99 Rounded Inexact Subnormal Underflow
-fmax31136 fma 1 0.000999E-95 -1e-200 -> 9.98E-99 Rounded Inexact Subnormal Underflow
-fmax31137 fma 1 1.000000E-95 -1e-101 -> 9.99999E-96 Subnormal
-fmax31138 fma 1 10000E-101 -1e-200 -> 9.999E-98 Subnormal Inexact Rounded Underflow
-fmax31139 fma 1 1000E-101 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow
-fmax31140 fma 1 100E-101 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow
-fmax31141 fma 1 10E-101 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow
-fmax31142 fma 1 1E-101 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31143 fma 1 0E-101 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31144 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-
-fmax31151 fma 1 10000E-102 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow
-fmax31152 fma 1 1000E-102 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow
-fmax31153 fma 1 100E-102 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow
-fmax31154 fma 1 10E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31155 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31156 fma 1 0E-102 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31157 fma 1 1E-103 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-
-fmax31160 fma 1 100E-105 -1e-101 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31161 fma 1 100E-105 -1e-201 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-
--- tests based on Gunnar Degnbol's edge case
-precision: 15
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
-fmax31200 fma 1 1E15 -0.5 -> 1.00000000000000E+15 Inexact Rounded
-fmax31201 fma 1 1E15 -0.50 -> 1.00000000000000E+15 Inexact Rounded
-fmax31210 fma 1 1E15 -0.51 -> 999999999999999 Inexact Rounded
-fmax31211 fma 1 1E15 -0.501 -> 999999999999999 Inexact Rounded
-fmax31212 fma 1 1E15 -0.5001 -> 999999999999999 Inexact Rounded
-fmax31213 fma 1 1E15 -0.50001 -> 999999999999999 Inexact Rounded
-fmax31214 fma 1 1E15 -0.500001 -> 999999999999999 Inexact Rounded
-fmax31215 fma 1 1E15 -0.5000001 -> 999999999999999 Inexact Rounded
-fmax31216 fma 1 1E15 -0.50000001 -> 999999999999999 Inexact Rounded
-fmax31217 fma 1 1E15 -0.500000001 -> 999999999999999 Inexact Rounded
-fmax31218 fma 1 1E15 -0.5000000001 -> 999999999999999 Inexact Rounded
-fmax31219 fma 1 1E15 -0.50000000001 -> 999999999999999 Inexact Rounded
-fmax31220 fma 1 1E15 -0.500000000001 -> 999999999999999 Inexact Rounded
-fmax31221 fma 1 1E15 -0.5000000000001 -> 999999999999999 Inexact Rounded
-fmax31222 fma 1 1E15 -0.50000000000001 -> 999999999999999 Inexact Rounded
-fmax31223 fma 1 1E15 -0.500000000000001 -> 999999999999999 Inexact Rounded
-fmax31224 fma 1 1E15 -0.5000000000000001 -> 999999999999999 Inexact Rounded
-fmax31225 fma 1 1E15 -0.5000000000000000 -> 1.00000000000000E+15 Inexact Rounded
-fmax31230 fma 1 1E15 -5000000.000000001 -> 999999995000000 Inexact Rounded
-
-precision: 16
-
-fmax31300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
-fmax31310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
-fmax31311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
-fmax31312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
-fmax31313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
-fmax31314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
-fmax31315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
-fmax31316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
-fmax31317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
-fmax31318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
-fmax31319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
-fmax31320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
-fmax31321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
-fmax31322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
-fmax31323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
-fmax31324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
-fmax31325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
-fmax31339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
-
-fmax31340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
-fmax31341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
-
-fmax31349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
-fmax31350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
-fmax31351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
-fmax31352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
-fmax31353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
-fmax31354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
-fmax31355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
-fmax31356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
-fmax31357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
-fmax31358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
-fmax31359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
-fmax31360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
-fmax31361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
-fmax31362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
-fmax31363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
-fmax31364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
-fmax31365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
-fmax31380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
-fmax31381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
-fmax31382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
-fmax31396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-precision: 15
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
-fmax31400 fma 1 0 1.23456789012345 -> 1.23456789012345
-fmax31401 fma 1 0 1.23456789012345E-1 -> 0.123456789012345
-fmax31402 fma 1 0 1.23456789012345E-2 -> 0.0123456789012345
-fmax31403 fma 1 0 1.23456789012345E-3 -> 0.00123456789012345
-fmax31404 fma 1 0 1.23456789012345E-4 -> 0.000123456789012345
-fmax31405 fma 1 0 1.23456789012345E-5 -> 0.0000123456789012345
-fmax31406 fma 1 0 1.23456789012345E-6 -> 0.00000123456789012345
-fmax31407 fma 1 0 1.23456789012345E-7 -> 1.23456789012345E-7
-fmax31408 fma 1 0 1.23456789012345E-8 -> 1.23456789012345E-8
-fmax31409 fma 1 0 1.23456789012345E-9 -> 1.23456789012345E-9
-fmax31410 fma 1 0 1.23456789012345E-10 -> 1.23456789012345E-10
-fmax31411 fma 1 0 1.23456789012345E-11 -> 1.23456789012345E-11
-fmax31412 fma 1 0 1.23456789012345E-12 -> 1.23456789012345E-12
-fmax31413 fma 1 0 1.23456789012345E-13 -> 1.23456789012345E-13
-fmax31414 fma 1 0 1.23456789012345E-14 -> 1.23456789012345E-14
-fmax31415 fma 1 0 1.23456789012345E-15 -> 1.23456789012345E-15
-fmax31416 fma 1 0 1.23456789012345E-16 -> 1.23456789012345E-16
-fmax31417 fma 1 0 1.23456789012345E-17 -> 1.23456789012345E-17
-fmax31418 fma 1 0 1.23456789012345E-18 -> 1.23456789012345E-18
-fmax31419 fma 1 0 1.23456789012345E-19 -> 1.23456789012345E-19
-
--- same, precision 16..
-precision: 16
-fmax31420 fma 1 0 1.123456789012345 -> 1.123456789012345
-fmax31421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
-fmax31422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
-fmax31423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
-fmax31424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
-fmax31425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
-fmax31426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
-fmax31427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
-fmax31428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
-fmax31429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
-fmax31430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
-fmax31431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
-fmax31432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
-fmax31433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
-fmax31434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
-fmax31435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
-fmax31436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
-fmax31437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
-fmax31438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
-fmax31439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
-
--- same, reversed 0
-fmax31440 fma 1 1.123456789012345 0 -> 1.123456789012345
-fmax31441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
-fmax31442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
-fmax31443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
-fmax31444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
-fmax31445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
-fmax31446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
-fmax31447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
-fmax31448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
-fmax31449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
-fmax31450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
-fmax31451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
-fmax31452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
-fmax31453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
-fmax31454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
-fmax31455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
-fmax31456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
-fmax31457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
-fmax31458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
-fmax31459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
-
--- same, Es on the 0
-fmax31460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
-fmax31461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
-fmax31462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
-fmax31463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
-fmax31464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
-fmax31465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
-fmax31466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
-fmax31467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
-fmax31468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
-fmax31469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
-fmax31470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
-fmax31471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
-fmax31472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
-fmax31473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
-fmax31474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
-fmax31475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
--- next four flag Rounded because the 0 extends the result
-fmax31476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
-fmax31477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
-fmax31478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
-fmax31479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-precision: 16
-maxExponent: 384
-minexponent: -383
-
-rounding: half_up
--- exact zeros from zeros
-fmax31500 fma 1 0 0E-19 -> 0E-19
-fmax31501 fma 1 -0 0E-19 -> 0E-19
-fmax31502 fma 1 0 -0E-19 -> 0E-19
-fmax31503 fma 1 -0 -0E-19 -> -0E-19
-fmax31504 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: half_down
--- exact zeros from zeros
-fmax31520 fma 1 0 0E-19 -> 0E-19
-fmax31521 fma 1 -0 0E-19 -> 0E-19
-fmax31522 fma 1 0 -0E-19 -> 0E-19
-fmax31523 fma 1 -0 -0E-19 -> -0E-19
-fmax31524 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: half_even
--- exact zeros from zeros
-fmax31540 fma 1 0 0E-19 -> 0E-19
-fmax31541 fma 1 -0 0E-19 -> 0E-19
-fmax31542 fma 1 0 -0E-19 -> 0E-19
-fmax31543 fma 1 -0 -0E-19 -> -0E-19
-fmax31544 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: up
--- exact zeros from zeros
-fmax31560 fma 1 0 0E-19 -> 0E-19
-fmax31561 fma 1 -0 0E-19 -> 0E-19
-fmax31562 fma 1 0 -0E-19 -> 0E-19
-fmax31563 fma 1 -0 -0E-19 -> -0E-19
-fmax31564 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
-fmax31574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
--- some exact zeros from non-zeros
-fmax31575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
-
-rounding: down
--- exact zeros from zeros
-fmax31580 fma 1 0 0E-19 -> 0E-19
-fmax31581 fma 1 -0 0E-19 -> 0E-19
-fmax31582 fma 1 0 -0E-19 -> 0E-19
-fmax31583 fma 1 -0 -0E-19 -> -0E-19
-fmax31584 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: ceiling
--- exact zeros from zeros
-fmax31600 fma 1 0 0E-19 -> 0E-19
-fmax31601 fma 1 -0 0E-19 -> 0E-19
-fmax31602 fma 1 0 -0E-19 -> 0E-19
-fmax31603 fma 1 -0 -0E-19 -> -0E-19
-fmax31604 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-fmax31620 fma 1 0 0E-19 -> 0E-19
-fmax31621 fma 1 -0 0E-19 -> -0E-19 -- *
-fmax31622 fma 1 0 -0E-19 -> -0E-19 -- *
-fmax31623 fma 1 -0 -0E-19 -> -0E-19
-fmax31624 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- *
-fmax31626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- *
-fmax31627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
-fmax31634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
--- some exact zeros from non-zeros
-fmax31635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- *
-fmax31637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- *
-fmax31638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
-
--- BigDecimal problem testcases 2006.01.23
-precision: 16
-maxExponent: 384
-minexponent: -383
-
-rounding: down
-precision: 7
-fmax31651 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 6
-fmax31652 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 5
-fmax31653 fma 1 10001E+2 -2E+1 -> 1.0000E+6 Inexact Rounded
-precision: 4
-fmax31654 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded
-precision: 3
-fmax31655 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded
-precision: 2
-fmax31656 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded
-precision: 1
-fmax31657 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded
-
-rounding: half_even
-precision: 7
-fmax31661 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 6
-fmax31662 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 5
-fmax31663 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded
-precision: 4
-fmax31664 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded
-precision: 3
-fmax31665 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded
-precision: 2
-fmax31666 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded
-precision: 1
-fmax31667 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded
-
-rounding: up
-precision: 7
-fmax31671 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 6
-fmax31672 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 5
-fmax31673 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded
-precision: 4
-fmax31674 fma 1 10001E+2 -2E+1 -> 1.001E+6 Inexact Rounded
-precision: 3
-fmax31675 fma 1 10001E+2 -2E+1 -> 1.01E+6 Inexact Rounded
-precision: 2
-fmax31676 fma 1 10001E+2 -2E+1 -> 1.1E+6 Inexact Rounded
-precision: 1
-fmax31677 fma 1 10001E+2 -2E+1 -> 2E+6 Inexact Rounded
-
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
--- Examples from SQL proposal (Krishna Kulkarni)
-fmax31701 fma 1 130E-2 120E-2 -> 2.50
-fmax31702 fma 1 130E-2 12E-1 -> 2.50
-fmax31703 fma 1 130E-2 1E0 -> 2.30
-fmax31704 fma 1 1E2 1E4 -> 1.01E+4
-fmax31705 subtract 130E-2 120E-2 -> 0.10
-fmax31706 subtract 130E-2 12E-1 -> 0.10
-fmax31707 subtract 130E-2 1E0 -> 0.30
-fmax31708 subtract 1E2 1E4 -> -9.9E+3
-
-------------------------------------------------------------------------
--- Same as above, using decimal64 default parameters --
-------------------------------------------------------------------------
-precision: 16
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- [first group are 'quick confidence check']
-fmax36001 fma 1 1 1 -> 2
-fmax36002 fma 1 2 3 -> 5
-fmax36003 fma 1 '5.75' '3.3' -> 9.05
-fmax36004 fma 1 '5' '-3' -> 2
-fmax36005 fma 1 '-5' '-3' -> -8
-fmax36006 fma 1 '-7' '2.5' -> -4.5
-fmax36007 fma 1 '0.7' '0.3' -> 1.0
-fmax36008 fma 1 '1.25' '1.25' -> 2.50
-fmax36009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
-fmax36010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
-
-fmax36011 fma 1 '0.44444444444444444' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
-fmax36012 fma 1 '0.44444444444444440' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
-fmax36013 fma 1 '0.44444444444444444' '0.55555555555555550' -> '0.9999999999999999' Inexact Rounded
-fmax36014 fma 1 '0.444444444444444449' '0' -> '0.4444444444444444' Inexact Rounded
-fmax36015 fma 1 '0.4444444444444444499' '0' -> '0.4444444444444444' Inexact Rounded
-fmax36016 fma 1 '0.44444444444444444999' '0' -> '0.4444444444444444' Inexact Rounded
-fmax36017 fma 1 '0.44444444444444445000' '0' -> '0.4444444444444444' Inexact Rounded
-fmax36018 fma 1 '0.44444444444444445001' '0' -> '0.4444444444444445' Inexact Rounded
-fmax36019 fma 1 '0.4444444444444444501' '0' -> '0.4444444444444445' Inexact Rounded
-fmax36020 fma 1 '0.444444444444444451' '0' -> '0.4444444444444445' Inexact Rounded
-
-fmax36021 fma 1 0 1 -> 1
-fmax36022 fma 1 1 1 -> 2
-fmax36023 fma 1 2 1 -> 3
-fmax36024 fma 1 3 1 -> 4
-fmax36025 fma 1 4 1 -> 5
-fmax36026 fma 1 5 1 -> 6
-fmax36027 fma 1 6 1 -> 7
-fmax36028 fma 1 7 1 -> 8
-fmax36029 fma 1 8 1 -> 9
-fmax36030 fma 1 9 1 -> 10
-
--- some carrying effects
-fmax36031 fma 1 '0.9998' '0.0000' -> '0.9998'
-fmax36032 fma 1 '0.9998' '0.0001' -> '0.9999'
-fmax36033 fma 1 '0.9998' '0.0002' -> '1.0000'
-fmax36034 fma 1 '0.9998' '0.0003' -> '1.0001'
-
-fmax36035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-fmax36036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-fmax36037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-fmax36038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
-fmax36039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
-
--- symmetry:
-fmax36040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
-fmax36041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
-fmax36042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
-fmax36044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
-fmax36045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
-
-fmax36046 fma 1 '10000e+9' '7' -> '10000000000007'
-fmax36047 fma 1 '10000e+9' '70' -> '10000000000070'
-fmax36048 fma 1 '10000e+9' '700' -> '10000000000700'
-fmax36049 fma 1 '10000e+9' '7000' -> '10000000007000'
-fmax36050 fma 1 '10000e+9' '70000' -> '10000000070000'
-fmax36051 fma 1 '10000e+9' '700000' -> '10000000700000'
-
--- examples from decarith
-fmax36053 fma 1 '12' '7.00' -> '19.00'
-fmax36054 fma 1 '1.3' '-1.07' -> '0.23'
-fmax36055 fma 1 '1.3' '-1.30' -> '0.00'
-fmax36056 fma 1 '1.3' '-2.07' -> '-0.77'
-fmax36057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
-
--- from above
-fmax36061 fma 1 1 '0.1' -> '1.1'
-fmax36062 fma 1 1 '0.01' -> '1.01'
-fmax36063 fma 1 1 '0.001' -> '1.001'
-fmax36064 fma 1 1 '0.0001' -> '1.0001'
-fmax36065 fma 1 1 '0.00001' -> '1.00001'
-fmax36066 fma 1 1 '0.000001' -> '1.000001'
-fmax36067 fma 1 1 '0.0000001' -> '1.0000001'
-fmax36068 fma 1 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-fmax36070 fma 1 1 0 -> 1
-fmax36071 fma 1 1 0. -> 1
-fmax36072 fma 1 1 .0 -> 1.0
-fmax36073 fma 1 1 0.0 -> 1.0
-fmax36074 fma 1 1 0.00 -> 1.00
-fmax36075 fma 1 0 1 -> 1
-fmax36076 fma 1 0. 1 -> 1
-fmax36077 fma 1 .0 1 -> 1.0
-fmax36078 fma 1 0.0 1 -> 1.0
-fmax36079 fma 1 0.00 1 -> 1.00
-
--- some carries
-fmax36080 fma 1 9999999999999998 1 -> 9999999999999999
-fmax36081 fma 1 9999999999999999 1 -> 1.000000000000000E+16 Rounded
-fmax36082 fma 1 999999999999999 1 -> 1000000000000000
-fmax36083 fma 1 9999999999999 1 -> 10000000000000
-fmax36084 fma 1 99999999999 1 -> 100000000000
-fmax36085 fma 1 999999999 1 -> 1000000000
-fmax36086 fma 1 9999999 1 -> 10000000
-fmax36087 fma 1 99999 1 -> 100000
-fmax36088 fma 1 999 1 -> 1000
-fmax36089 fma 1 9 1 -> 10
-
-
--- more LHS swaps
-fmax36090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
-fmax36091 fma 1 '-56267E-6' 0 -> '-0.056267'
-fmax36092 fma 1 '-56267E-5' 0 -> '-0.56267'
-fmax36093 fma 1 '-56267E-4' 0 -> '-5.6267'
-fmax36094 fma 1 '-56267E-3' 0 -> '-56.267'
-fmax36095 fma 1 '-56267E-2' 0 -> '-562.67'
-fmax36096 fma 1 '-56267E-1' 0 -> '-5626.7'
-fmax36097 fma 1 '-56267E-0' 0 -> '-56267'
-fmax36098 fma 1 '-5E-10' 0 -> '-5E-10'
-fmax36099 fma 1 '-5E-7' 0 -> '-5E-7'
-fmax36100 fma 1 '-5E-6' 0 -> '-0.000005'
-fmax36101 fma 1 '-5E-5' 0 -> '-0.00005'
-fmax36102 fma 1 '-5E-4' 0 -> '-0.0005'
-fmax36103 fma 1 '-5E-1' 0 -> '-0.5'
-fmax36104 fma 1 '-5E0' 0 -> '-5'
-fmax36105 fma 1 '-5E1' 0 -> '-50'
-fmax36106 fma 1 '-5E5' 0 -> '-500000'
-fmax36107 fma 1 '-5E15' 0 -> '-5000000000000000'
-fmax36108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded
-fmax36109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded
-fmax36110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded
-fmax36111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded
-
--- more RHS swaps
-fmax36113 fma 1 0 '-56267E-10' -> '-0.0000056267'
-fmax36114 fma 1 0 '-56267E-6' -> '-0.056267'
-fmax36116 fma 1 0 '-56267E-5' -> '-0.56267'
-fmax36117 fma 1 0 '-56267E-4' -> '-5.6267'
-fmax36119 fma 1 0 '-56267E-3' -> '-56.267'
-fmax36120 fma 1 0 '-56267E-2' -> '-562.67'
-fmax36121 fma 1 0 '-56267E-1' -> '-5626.7'
-fmax36122 fma 1 0 '-56267E-0' -> '-56267'
-fmax36123 fma 1 0 '-5E-10' -> '-5E-10'
-fmax36124 fma 1 0 '-5E-7' -> '-5E-7'
-fmax36125 fma 1 0 '-5E-6' -> '-0.000005'
-fmax36126 fma 1 0 '-5E-5' -> '-0.00005'
-fmax36127 fma 1 0 '-5E-4' -> '-0.0005'
-fmax36128 fma 1 0 '-5E-1' -> '-0.5'
-fmax36129 fma 1 0 '-5E0' -> '-5'
-fmax36130 fma 1 0 '-5E1' -> '-50'
-fmax36131 fma 1 0 '-5E5' -> '-500000'
-fmax36132 fma 1 0 '-5E15' -> '-5000000000000000'
-fmax36133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded
-fmax36134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded
-fmax36135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded
-fmax36136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded
-
--- related
-fmax36137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded
-fmax36138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded
-fmax36139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded
-fmax36140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded
-fmax36141 fma 1 1E+11 0.0000 -> '100000000000.0000'
-fmax36142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded
-fmax36143 fma 1 0.000 1E+12 -> '1000000000000.000'
-fmax36144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-fmax36146 fma 1 '00.0' 0 -> '0.0'
-fmax36147 fma 1 '0.00' 0 -> '0.00'
-fmax36148 fma 1 0 '0.00' -> '0.00'
-fmax36149 fma 1 0 '00.0' -> '0.0'
-fmax36150 fma 1 '00.0' '0.00' -> '0.00'
-fmax36151 fma 1 '0.00' '00.0' -> '0.00'
-fmax36152 fma 1 '3' '.3' -> '3.3'
-fmax36153 fma 1 '3.' '.3' -> '3.3'
-fmax36154 fma 1 '3.0' '.3' -> '3.3'
-fmax36155 fma 1 '3.00' '.3' -> '3.30'
-fmax36156 fma 1 '3' '3' -> '6'
-fmax36157 fma 1 '3' '+3' -> '6'
-fmax36158 fma 1 '3' '-3' -> '0'
-fmax36159 fma 1 '0.3' '-0.3' -> '0.0'
-fmax36160 fma 1 '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-fmax36161 fma 1 '1E+13' '-1' -> '9999999999999'
-fmax36162 fma 1 '1E+13' '1.11' -> '10000000000001.11'
-fmax36163 fma 1 '1.11' '1E+13' -> '10000000000001.11'
-fmax36164 fma 1 '-1' '1E+13' -> '9999999999999'
-fmax36165 fma 1 '7E+13' '-1' -> '69999999999999'
-fmax36166 fma 1 '7E+13' '1.11' -> '70000000000001.11'
-fmax36167 fma 1 '1.11' '7E+13' -> '70000000000001.11'
-fmax36168 fma 1 '-1' '7E+13' -> '69999999999999'
-
--- 1234567890123456 1234567890123456 1 234567890123456
-fmax36170 fma 1 '0.4444444444444444' '0.5555555555555563' -> '1.000000000000001' Inexact Rounded
-fmax36171 fma 1 '0.4444444444444444' '0.5555555555555562' -> '1.000000000000001' Inexact Rounded
-fmax36172 fma 1 '0.4444444444444444' '0.5555555555555561' -> '1.000000000000000' Inexact Rounded
-fmax36173 fma 1 '0.4444444444444444' '0.5555555555555560' -> '1.000000000000000' Inexact Rounded
-fmax36174 fma 1 '0.4444444444444444' '0.5555555555555559' -> '1.000000000000000' Inexact Rounded
-fmax36175 fma 1 '0.4444444444444444' '0.5555555555555558' -> '1.000000000000000' Inexact Rounded
-fmax36176 fma 1 '0.4444444444444444' '0.5555555555555557' -> '1.000000000000000' Inexact Rounded
-fmax36177 fma 1 '0.4444444444444444' '0.5555555555555556' -> '1.000000000000000' Rounded
-fmax36178 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
-fmax36179 fma 1 '0.4444444444444444' '0.5555555555555554' -> '0.9999999999999998'
-fmax36180 fma 1 '0.4444444444444444' '0.5555555555555553' -> '0.9999999999999997'
-fmax36181 fma 1 '0.4444444444444444' '0.5555555555555552' -> '0.9999999999999996'
-fmax36182 fma 1 '0.4444444444444444' '0.5555555555555551' -> '0.9999999999999995'
-fmax36183 fma 1 '0.4444444444444444' '0.5555555555555550' -> '0.9999999999999994'
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-fmax36200 fma 1 '6543210123456789' 0 -> '6543210123456789'
-fmax36201 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-fmax36202 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-fmax36203 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-fmax36204 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-fmax36205 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-fmax36206 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36207 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36208 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-fmax36209 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-fmax36210 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-fmax36211 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-fmax36212 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-fmax36213 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-fmax36214 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-fmax36215 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded
-fmax36216 fma 1 '6543210123456789' 1 -> '6543210123456790'
-fmax36217 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
-fmax36218 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-fmax36219 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
-rounding: half_even
-fmax36220 fma 1 '6543210123456789' 0 -> '6543210123456789'
-fmax36221 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-fmax36222 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-fmax36223 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-fmax36224 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-fmax36225 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-fmax36226 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36227 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36228 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-fmax36229 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-fmax36230 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-fmax36231 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-fmax36232 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-fmax36233 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-fmax36234 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-fmax36235 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded
-fmax36236 fma 1 '6543210123456789' 1 -> '6543210123456790'
-fmax36237 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-fmax36238 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-fmax36239 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
--- critical few with even bottom digit...
-fmax36240 fma 1 '6543210123456788' 0.499999 -> '6543210123456788' Inexact Rounded
-fmax36241 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
-fmax36242 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
-
-rounding: down
-fmax36250 fma 1 '6543210123456789' 0 -> '6543210123456789'
-fmax36251 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-fmax36252 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-fmax36253 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-fmax36254 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-fmax36255 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-fmax36256 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36257 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36258 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
-fmax36259 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
-fmax36260 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
-fmax36261 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
-fmax36262 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
-fmax36263 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
-fmax36264 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
-fmax36265 fma 1 '6543210123456789' 0.999999 -> '6543210123456789' Inexact Rounded
-fmax36266 fma 1 '6543210123456789' 1 -> '6543210123456790'
-fmax36267 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-fmax36268 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-fmax36269 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_even
-fmax36301 fma 1 -1 1 -> 0
-fmax36302 fma 1 0 1 -> 1
-fmax36303 fma 1 1 1 -> 2
-fmax36304 fma 1 12 1 -> 13
-fmax36305 fma 1 98 1 -> 99
-fmax36306 fma 1 99 1 -> 100
-fmax36307 fma 1 100 1 -> 101
-fmax36308 fma 1 101 1 -> 102
-fmax36309 fma 1 -1 -1 -> -2
-fmax36310 fma 1 0 -1 -> -1
-fmax36311 fma 1 1 -1 -> 0
-fmax36312 fma 1 12 -1 -> 11
-fmax36313 fma 1 98 -1 -> 97
-fmax36314 fma 1 99 -1 -> 98
-fmax36315 fma 1 100 -1 -> 99
-fmax36316 fma 1 101 -1 -> 100
-
-fmax36321 fma 1 -0.01 0.01 -> 0.00
-fmax36322 fma 1 0.00 0.01 -> 0.01
-fmax36323 fma 1 0.01 0.01 -> 0.02
-fmax36324 fma 1 0.12 0.01 -> 0.13
-fmax36325 fma 1 0.98 0.01 -> 0.99
-fmax36326 fma 1 0.99 0.01 -> 1.00
-fmax36327 fma 1 1.00 0.01 -> 1.01
-fmax36328 fma 1 1.01 0.01 -> 1.02
-fmax36329 fma 1 -0.01 -0.01 -> -0.02
-fmax36330 fma 1 0.00 -0.01 -> -0.01
-fmax36331 fma 1 0.01 -0.01 -> 0.00
-fmax36332 fma 1 0.12 -0.01 -> 0.11
-fmax36333 fma 1 0.98 -0.01 -> 0.97
-fmax36334 fma 1 0.99 -0.01 -> 0.98
-fmax36335 fma 1 1.00 -0.01 -> 0.99
-fmax36336 fma 1 1.01 -0.01 -> 1.00
-
--- some more cases where fma 1 ing 0 affects the coefficient
-fmax36340 fma 1 1E+3 0 -> 1000
-fmax36341 fma 1 1E+15 0 -> 1000000000000000
-fmax36342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded
-fmax36343 fma 1 1E+17 0 -> 1.000000000000000E+17 Rounded
--- which simply follow from these cases ...
-fmax36344 fma 1 1E+3 1 -> 1001
-fmax36345 fma 1 1E+15 1 -> 1000000000000001
-fmax36346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
-fmax36347 fma 1 1E+17 1 -> 1.000000000000000E+17 Inexact Rounded
-fmax36348 fma 1 1E+3 7 -> 1007
-fmax36349 fma 1 1E+15 7 -> 1000000000000007
-fmax36350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
-fmax36351 fma 1 1E+17 7 -> 1.000000000000000E+17 Inexact Rounded
-
--- tryzeros cases
-fmax36361 fma 1 0E+50 10000E+1 -> 1.0000E+5
-fmax36362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded
-fmax36363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
-fmax36364 fma 1 12.34 0e-398 -> 12.34000000000000 Rounded
-
--- ulp replacement tests
-fmax36400 fma 1 1 77e-14 -> 1.00000000000077
-fmax36401 fma 1 1 77e-15 -> 1.000000000000077
-fmax36402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded
-fmax36403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded
-fmax36404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded
-fmax36405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded
-fmax36406 fma 1 1 77e-99 -> 1.000000000000000 Inexact Rounded
-
-fmax36410 fma 1 10 77e-14 -> 10.00000000000077
-fmax36411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded
-fmax36412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded
-fmax36413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded
-fmax36414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded
-fmax36415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded
-fmax36416 fma 1 10 77e-99 -> 10.00000000000000 Inexact Rounded
-
-fmax36420 fma 1 77e-14 1 -> 1.00000000000077
-fmax36421 fma 1 77e-15 1 -> 1.000000000000077
-fmax36422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded
-fmax36423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded
-fmax36424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded
-fmax36425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded
-fmax36426 fma 1 77e-99 1 -> 1.000000000000000 Inexact Rounded
-
-fmax36430 fma 1 77e-14 10 -> 10.00000000000077
-fmax36431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded
-fmax36432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded
-fmax36433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded
-fmax36434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded
-fmax36435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded
-fmax36436 fma 1 77e-99 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-fmax36440 fma 1 1 -77e-14 -> 0.99999999999923
-fmax36441 fma 1 1 -77e-15 -> 0.999999999999923
-fmax36442 fma 1 1 -77e-16 -> 0.9999999999999923
-fmax36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
-fmax36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
-fmax36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded
-fmax36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded
-
-fmax36450 fma 1 10 -77e-14 -> 9.99999999999923
-fmax36451 fma 1 10 -77e-15 -> 9.999999999999923
-fmax36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded
-fmax36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded
-fmax36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded
-fmax36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded
-fmax36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded
-
-fmax36460 fma 1 -77e-14 1 -> 0.99999999999923
-fmax36461 fma 1 -77e-15 1 -> 0.999999999999923
-fmax36462 fma 1 -77e-16 1 -> 0.9999999999999923
-fmax36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded
-fmax36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded
-fmax36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded
-fmax36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded
-
-fmax36470 fma 1 -77e-14 10 -> 9.99999999999923
-fmax36471 fma 1 -77e-15 10 -> 9.999999999999923
-fmax36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded
-fmax36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded
-fmax36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded
-fmax36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded
-fmax36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-fmax36480 fma 1 -1 77e-14 -> -0.99999999999923
-fmax36481 fma 1 -1 77e-15 -> -0.999999999999923
-fmax36482 fma 1 -1 77e-16 -> -0.9999999999999923
-fmax36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded
-fmax36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded
-fmax36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded
-fmax36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded
-
-fmax36490 fma 1 -10 77e-14 -> -9.99999999999923
-fmax36491 fma 1 -10 77e-15 -> -9.999999999999923
-fmax36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded
-fmax36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded
-fmax36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded
-fmax36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded
-fmax36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded
-
-fmax36500 fma 1 77e-14 -1 -> -0.99999999999923
-fmax36501 fma 1 77e-15 -1 -> -0.999999999999923
-fmax36502 fma 1 77e-16 -1 -> -0.9999999999999923
-fmax36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
-fmax36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
-fmax36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded
-fmax36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded
-
-fmax36510 fma 1 77e-14 -10 -> -9.99999999999923
-fmax36511 fma 1 77e-15 -10 -> -9.999999999999923
-fmax36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded
-fmax36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded
-fmax36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded
-fmax36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded
-fmax36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded
-
-
--- long operands
-fmax36521 fma 1 101234562345678000 0 -> 1.012345623456780E+17 Rounded
-fmax36522 fma 1 0 101234562345678000 -> 1.012345623456780E+17 Rounded
-fmax36523 fma 1 10123456234567800 0 -> 1.012345623456780E+16 Rounded
-fmax36524 fma 1 0 10123456234567800 -> 1.012345623456780E+16 Rounded
-fmax36525 fma 1 10123456234567890 0 -> 1.012345623456789E+16 Rounded
-fmax36526 fma 1 0 10123456234567890 -> 1.012345623456789E+16 Rounded
-fmax36527 fma 1 10123456234567891 0 -> 1.012345623456789E+16 Inexact Rounded
-fmax36528 fma 1 0 10123456234567891 -> 1.012345623456789E+16 Inexact Rounded
-fmax36529 fma 1 101234562345678901 0 -> 1.012345623456789E+17 Inexact Rounded
-fmax36530 fma 1 0 101234562345678901 -> 1.012345623456789E+17 Inexact Rounded
-fmax36531 fma 1 10123456234567896 0 -> 1.012345623456790E+16 Inexact Rounded
-fmax36532 fma 1 0 10123456234567896 -> 1.012345623456790E+16 Inexact Rounded
-
--- verify a query
-rounding: down
-fmax36561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
-fmax36562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
--- and using decimal64 bounds...
-rounding: down
-fmax36563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
-fmax36564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-fmax36701 fma 1 5.00 1.00E-3 -> 5.00100
-fmax36702 fma 1 00.00 0.000 -> 0.000
-fmax36703 fma 1 00.00 0E-3 -> 0.000
-fmax36704 fma 1 0E-3 00.00 -> 0.000
-
-fmax36710 fma 1 0E+3 00.00 -> 0.00
-fmax36711 fma 1 0E+3 00.0 -> 0.0
-fmax36712 fma 1 0E+3 00. -> 0
-fmax36713 fma 1 0E+3 00.E+1 -> 0E+1
-fmax36714 fma 1 0E+3 00.E+2 -> 0E+2
-fmax36715 fma 1 0E+3 00.E+3 -> 0E+3
-fmax36716 fma 1 0E+3 00.E+4 -> 0E+3
-fmax36717 fma 1 0E+3 00.E+5 -> 0E+3
-fmax36718 fma 1 0E+3 -00.0 -> 0.0
-fmax36719 fma 1 0E+3 -00. -> 0
-fmax36731 fma 1 0E+3 -00.E+1 -> 0E+1
-
-fmax36720 fma 1 00.00 0E+3 -> 0.00
-fmax36721 fma 1 00.0 0E+3 -> 0.0
-fmax36722 fma 1 00. 0E+3 -> 0
-fmax36723 fma 1 00.E+1 0E+3 -> 0E+1
-fmax36724 fma 1 00.E+2 0E+3 -> 0E+2
-fmax36725 fma 1 00.E+3 0E+3 -> 0E+3
-fmax36726 fma 1 00.E+4 0E+3 -> 0E+3
-fmax36727 fma 1 00.E+5 0E+3 -> 0E+3
-fmax36728 fma 1 -00.00 0E+3 -> 0.00
-fmax36729 fma 1 -00.0 0E+3 -> 0.0
-fmax36730 fma 1 -00. 0E+3 -> 0
-
-fmax36732 fma 1 0 0 -> 0
-fmax36733 fma 1 0 -0 -> 0
-fmax36734 fma 1 -0 0 -> 0
-fmax36735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
-
-fmax36736 fma 1 1 -1 -> 0
-fmax36737 fma 1 -1 -1 -> -2
-fmax36738 fma 1 1 1 -> 2
-fmax36739 fma 1 -1 1 -> 0
-
-fmax36741 fma 1 0 -1 -> -1
-fmax36742 fma 1 -0 -1 -> -1
-fmax36743 fma 1 0 1 -> 1
-fmax36744 fma 1 -0 1 -> 1
-fmax36745 fma 1 -1 0 -> -1
-fmax36746 fma 1 -1 -0 -> -1
-fmax36747 fma 1 1 0 -> 1
-fmax36748 fma 1 1 -0 -> 1
-
-fmax36751 fma 1 0.0 -1 -> -1.0
-fmax36752 fma 1 -0.0 -1 -> -1.0
-fmax36753 fma 1 0.0 1 -> 1.0
-fmax36754 fma 1 -0.0 1 -> 1.0
-fmax36755 fma 1 -1.0 0 -> -1.0
-fmax36756 fma 1 -1.0 -0 -> -1.0
-fmax36757 fma 1 1.0 0 -> 1.0
-fmax36758 fma 1 1.0 -0 -> 1.0
-
-fmax36761 fma 1 0 -1.0 -> -1.0
-fmax36762 fma 1 -0 -1.0 -> -1.0
-fmax36763 fma 1 0 1.0 -> 1.0
-fmax36764 fma 1 -0 1.0 -> 1.0
-fmax36765 fma 1 -1 0.0 -> -1.0
-fmax36766 fma 1 -1 -0.0 -> -1.0
-fmax36767 fma 1 1 0.0 -> 1.0
-fmax36768 fma 1 1 -0.0 -> 1.0
-
-fmax36771 fma 1 0.0 -1.0 -> -1.0
-fmax36772 fma 1 -0.0 -1.0 -> -1.0
-fmax36773 fma 1 0.0 1.0 -> 1.0
-fmax36774 fma 1 -0.0 1.0 -> 1.0
-fmax36775 fma 1 -1.0 0.0 -> -1.0
-fmax36776 fma 1 -1.0 -0.0 -> -1.0
-fmax36777 fma 1 1.0 0.0 -> 1.0
-fmax36778 fma 1 1.0 -0.0 -> 1.0
-
--- Specials
-fmax36780 fma 1 -Inf -Inf -> -Infinity
-fmax36781 fma 1 -Inf -1000 -> -Infinity
-fmax36782 fma 1 -Inf -1 -> -Infinity
-fmax36783 fma 1 -Inf -0 -> -Infinity
-fmax36784 fma 1 -Inf 0 -> -Infinity
-fmax36785 fma 1 -Inf 1 -> -Infinity
-fmax36786 fma 1 -Inf 1000 -> -Infinity
-fmax36787 fma 1 -1000 -Inf -> -Infinity
-fmax36788 fma 1 -Inf -Inf -> -Infinity
-fmax36789 fma 1 -1 -Inf -> -Infinity
-fmax36790 fma 1 -0 -Inf -> -Infinity
-fmax36791 fma 1 0 -Inf -> -Infinity
-fmax36792 fma 1 1 -Inf -> -Infinity
-fmax36793 fma 1 1000 -Inf -> -Infinity
-fmax36794 fma 1 Inf -Inf -> NaN Invalid_operation
-
-fmax36800 fma 1 Inf -Inf -> NaN Invalid_operation
-fmax36801 fma 1 Inf -1000 -> Infinity
-fmax36802 fma 1 Inf -1 -> Infinity
-fmax36803 fma 1 Inf -0 -> Infinity
-fmax36804 fma 1 Inf 0 -> Infinity
-fmax36805 fma 1 Inf 1 -> Infinity
-fmax36806 fma 1 Inf 1000 -> Infinity
-fmax36807 fma 1 Inf Inf -> Infinity
-fmax36808 fma 1 -1000 Inf -> Infinity
-fmax36809 fma 1 -Inf Inf -> NaN Invalid_operation
-fmax36810 fma 1 -1 Inf -> Infinity
-fmax36811 fma 1 -0 Inf -> Infinity
-fmax36812 fma 1 0 Inf -> Infinity
-fmax36813 fma 1 1 Inf -> Infinity
-fmax36814 fma 1 1000 Inf -> Infinity
-fmax36815 fma 1 Inf Inf -> Infinity
-
-fmax36821 fma 1 NaN -Inf -> NaN
-fmax36822 fma 1 NaN -1000 -> NaN
-fmax36823 fma 1 NaN -1 -> NaN
-fmax36824 fma 1 NaN -0 -> NaN
-fmax36825 fma 1 NaN 0 -> NaN
-fmax36826 fma 1 NaN 1 -> NaN
-fmax36827 fma 1 NaN 1000 -> NaN
-fmax36828 fma 1 NaN Inf -> NaN
-fmax36829 fma 1 NaN NaN -> NaN
-fmax36830 fma 1 -Inf NaN -> NaN
-fmax36831 fma 1 -1000 NaN -> NaN
-fmax36832 fma 1 -1 NaN -> NaN
-fmax36833 fma 1 -0 NaN -> NaN
-fmax36834 fma 1 0 NaN -> NaN
-fmax36835 fma 1 1 NaN -> NaN
-fmax36836 fma 1 1000 NaN -> NaN
-fmax36837 fma 1 Inf NaN -> NaN
-
-fmax36841 fma 1 sNaN -Inf -> NaN Invalid_operation
-fmax36842 fma 1 sNaN -1000 -> NaN Invalid_operation
-fmax36843 fma 1 sNaN -1 -> NaN Invalid_operation
-fmax36844 fma 1 sNaN -0 -> NaN Invalid_operation
-fmax36845 fma 1 sNaN 0 -> NaN Invalid_operation
-fmax36846 fma 1 sNaN 1 -> NaN Invalid_operation
-fmax36847 fma 1 sNaN 1000 -> NaN Invalid_operation
-fmax36848 fma 1 sNaN NaN -> NaN Invalid_operation
-fmax36849 fma 1 sNaN sNaN -> NaN Invalid_operation
-fmax36850 fma 1 NaN sNaN -> NaN Invalid_operation
-fmax36851 fma 1 -Inf sNaN -> NaN Invalid_operation
-fmax36852 fma 1 -1000 sNaN -> NaN Invalid_operation
-fmax36853 fma 1 -1 sNaN -> NaN Invalid_operation
-fmax36854 fma 1 -0 sNaN -> NaN Invalid_operation
-fmax36855 fma 1 0 sNaN -> NaN Invalid_operation
-fmax36856 fma 1 1 sNaN -> NaN Invalid_operation
-fmax36857 fma 1 1000 sNaN -> NaN Invalid_operation
-fmax36858 fma 1 Inf sNaN -> NaN Invalid_operation
-fmax36859 fma 1 NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-fmax36861 fma 1 NaN1 -Inf -> NaN1
-fmax36862 fma 1 +NaN2 -1000 -> NaN2
-fmax36863 fma 1 NaN3 1000 -> NaN3
-fmax36864 fma 1 NaN4 Inf -> NaN4
-fmax36865 fma 1 NaN5 +NaN6 -> NaN5
-fmax36866 fma 1 -Inf NaN7 -> NaN7
-fmax36867 fma 1 -1000 NaN8 -> NaN8
-fmax36868 fma 1 1000 NaN9 -> NaN9
-fmax36869 fma 1 Inf +NaN10 -> NaN10
-fmax36871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
-fmax36872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
-fmax36873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
-fmax36874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
-fmax36875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
-fmax36876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
-fmax36877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
-fmax36878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
-fmax36879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
-fmax36880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
-fmax36881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
-fmax36882 fma 1 -NaN26 NaN28 -> -NaN26
-fmax36883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-fmax36884 fma 1 1000 -NaN30 -> -NaN30
-fmax36885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- now the case where we can get underflow but the result is normal
--- [note this can't happen if the operands are also bounded, as we
--- cannot represent 1E-399, for example]
-
-fmax36571 fma 1 1E-383 0 -> 1E-383
-fmax36572 fma 1 1E-384 0 -> 1E-384 Subnormal
-fmax36573 fma 1 1E-383 1E-384 -> 1.1E-383
-fmax36574 subtract 1E-383 1E-384 -> 9E-384 Subnormal
-
--- Here we explore the boundary of rounding a subnormal to Nmin
-fmax36575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
-fmax36576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
-fmax36577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax36578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax36579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax36580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-
--- check overflow edge case
--- 1234567890123456
-fmax36972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
-fmax36973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
-fmax36974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
-fmax36975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
-fmax36976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
-fmax36977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
-fmax36978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
-fmax36979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
-fmax36980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
-fmax36981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
-fmax36982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
-fmax36983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
-fmax36984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
-
-fmax36985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
-fmax36986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
-fmax36987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
-fmax36988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
-fmax36989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
-fmax36990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
-fmax36991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
-fmax36992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
-fmax36993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
-fmax36994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
-fmax36995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
-fmax36996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
-fmax36997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-fmax361100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
-fmax361101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
-fmax361103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
-fmax361104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
-fmax361105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
-fmax361106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
-fmax361107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
-fmax361108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
-fmax361109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-fmax361110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
-fmax361111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
-fmax361113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
-fmax361114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
-fmax361115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
-fmax361116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
-fmax361117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
-fmax361118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
-fmax361119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-fmax361300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
-fmax361310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
-fmax361311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
-fmax361312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
-fmax361313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
-fmax361314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
-fmax361315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
-fmax361316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
-fmax361317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
-fmax361318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
-fmax361319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
-fmax361320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
-fmax361321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
-fmax361322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
-fmax361323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
-fmax361324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
-fmax361325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
-fmax361339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
-
-fmax361340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
-fmax361341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
-
-fmax361349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
-fmax361350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
-fmax361351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
-fmax361352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
-fmax361353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
-fmax361354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
-fmax361355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
-fmax361356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
-fmax361357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
-fmax361358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
-fmax361359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
-fmax361360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
-fmax361361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
-fmax361362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
-fmax361363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
-fmax361364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
-fmax361365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
-fmax361380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
-fmax361381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
-fmax361382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
-fmax361396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-fmax361420 fma 1 0 1.123456789012345 -> 1.123456789012345
-fmax361421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
-fmax361422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
-fmax361423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
-fmax361424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
-fmax361425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
-fmax361426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
-fmax361427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
-fmax361428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
-fmax361429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
-fmax361430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
-fmax361431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
-fmax361432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
-fmax361433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
-fmax361434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
-fmax361435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
-fmax361436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
-fmax361437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
-fmax361438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
-fmax361439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
-
--- same, reversed 0
-fmax361440 fma 1 1.123456789012345 0 -> 1.123456789012345
-fmax361441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
-fmax361442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
-fmax361443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
-fmax361444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
-fmax361445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
-fmax361446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
-fmax361447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
-fmax361448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
-fmax361449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
-fmax361450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
-fmax361451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
-fmax361452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
-fmax361453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
-fmax361454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
-fmax361455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
-fmax361456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
-fmax361457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
-fmax361458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
-fmax361459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
-
--- same, Es on the 0
-fmax361460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
-fmax361461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
-fmax361462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
-fmax361463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
-fmax361464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
-fmax361465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
-fmax361466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
-fmax361467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
-fmax361468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
-fmax361469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
-fmax361470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
-fmax361471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
-fmax361472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
-fmax361473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
-fmax361474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
-fmax361475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
--- next four flag Rounded because the 0 extends the result
-fmax361476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
-fmax361477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
-fmax361478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
-fmax361479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-fmax361500 fma 1 0 0E-19 -> 0E-19
-fmax361501 fma 1 -0 0E-19 -> 0E-19
-fmax361502 fma 1 0 -0E-19 -> 0E-19
-fmax361503 fma 1 -0 -0E-19 -> -0E-19
-fmax361504 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: half_down
--- exact zeros from zeros
-fmax361520 fma 1 0 0E-19 -> 0E-19
-fmax361521 fma 1 -0 0E-19 -> 0E-19
-fmax361522 fma 1 0 -0E-19 -> 0E-19
-fmax361523 fma 1 -0 -0E-19 -> -0E-19
-fmax361524 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: half_even
--- exact zeros from zeros
-fmax361540 fma 1 0 0E-19 -> 0E-19
-fmax361541 fma 1 -0 0E-19 -> 0E-19
-fmax361542 fma 1 0 -0E-19 -> 0E-19
-fmax361543 fma 1 -0 -0E-19 -> -0E-19
-fmax361544 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: up
--- exact zeros from zeros
-fmax361560 fma 1 0 0E-19 -> 0E-19
-fmax361561 fma 1 -0 0E-19 -> 0E-19
-fmax361562 fma 1 0 -0E-19 -> 0E-19
-fmax361563 fma 1 -0 -0E-19 -> -0E-19
-fmax361564 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
-fmax361574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
--- some exact zeros from non-zeros
-fmax361575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
-
-rounding: down
--- exact zeros from zeros
-fmax361580 fma 1 0 0E-19 -> 0E-19
-fmax361581 fma 1 -0 0E-19 -> 0E-19
-fmax361582 fma 1 0 -0E-19 -> 0E-19
-fmax361583 fma 1 -0 -0E-19 -> -0E-19
-fmax361584 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: ceiling
--- exact zeros from zeros
-fmax361600 fma 1 0 0E-19 -> 0E-19
-fmax361601 fma 1 -0 0E-19 -> 0E-19
-fmax361602 fma 1 0 -0E-19 -> 0E-19
-fmax361603 fma 1 -0 -0E-19 -> -0E-19
-fmax361604 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-fmax361620 fma 1 0 0E-19 -> 0E-19
-fmax361621 fma 1 -0 0E-19 -> -0E-19 -- *
-fmax361622 fma 1 0 -0E-19 -> -0E-19 -- *
-fmax361623 fma 1 -0 -0E-19 -> -0E-19
-fmax361624 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- *
-fmax361626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- *
-fmax361627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
-fmax361634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
--- some exact zeros from non-zeros
-fmax361635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- *
-fmax361637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- *
-fmax361638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
-
--- Examples from SQL proposal (Krishna Kulkarni)
-fmax361701 fma 1 130E-2 120E-2 -> 2.50
-fmax361702 fma 1 130E-2 12E-1 -> 2.50
-fmax361703 fma 1 130E-2 1E0 -> 2.30
-fmax361704 fma 1 1E2 1E4 -> 1.01E+4
-fmax361705 subtract 130E-2 120E-2 -> 0.10
-fmax361706 subtract 130E-2 12E-1 -> 0.10
-fmax361707 subtract 130E-2 1E0 -> 0.30
-fmax361708 subtract 1E2 1E4 -> -9.9E+3
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-fmax362001 fma 1 1234567890123456 1 -> 1234567890123457
-fmax362002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
-fmax362003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
-fmax362004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
-fmax362005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
-fmax362006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
-fmax362007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
-fmax362008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
-fmax362009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
-fmax362010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
-fmax362011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
-fmax362012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
-fmax362013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
-fmax362014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
-fmax362015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
-fmax362016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
-fmax362017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
-fmax362018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
-fmax362019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
-fmax362020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
-fmax362021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
-
--- widening second argument at gap
-fmax362030 fma 1 12345678 1 -> 12345679
-fmax362031 fma 1 12345678 0.1 -> 12345678.1
-fmax362032 fma 1 12345678 0.12 -> 12345678.12
-fmax362033 fma 1 12345678 0.123 -> 12345678.123
-fmax362034 fma 1 12345678 0.1234 -> 12345678.1234
-fmax362035 fma 1 12345678 0.12345 -> 12345678.12345
-fmax362036 fma 1 12345678 0.123456 -> 12345678.123456
-fmax362037 fma 1 12345678 0.1234567 -> 12345678.1234567
-fmax362038 fma 1 12345678 0.12345678 -> 12345678.12345678
-fmax362039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
-fmax362040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
-fmax362041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
-fmax362042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
-fmax362043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
-fmax362044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
-fmax362045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
-fmax362046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
-fmax362047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
-fmax362048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
-fmax362049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-fmax362050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
-fmax362051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
-fmax362052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
-fmax362053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
-fmax362054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
-fmax362055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
-fmax362056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
-fmax362057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
-fmax362060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
-fmax362061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
-fmax362062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
-fmax362063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
-fmax362064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
-fmax362065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
-fmax362066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
-fmax362067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-fmax362070 fma 1 12345678 1E-8 -> 12345678.00000001
-fmax362071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
-fmax362072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
-fmax362073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
-fmax362074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
-fmax362075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
-fmax362076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
-fmax362077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
-fmax362078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
-fmax362079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
-fmax362080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
-fmax362081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
-fmax362082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
-fmax362083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
-fmax362084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
-fmax362085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
-fmax362086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
-fmax362087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
-fmax362088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
-fmax362089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
-
--- payload decapitate x3
-precision: 5
-fmax363000 fma 1 1 sNaN1234567890 -> NaN67890 Invalid_operation
-fmax363001 fma 1 -sNaN1234512345 1 -> -NaN12345 Invalid_operation
-fmax363002 fma sNaN1234554321 1 1 -> NaN54321 Invalid_operation
-
--- Null tests
-fmax39990 fma 1 10 # -> NaN Invalid_operation
-fmax39991 fma 1 # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- fma.decTest -- decimal fused multiply add --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- These tests comprese three parts:
+-- 1. Sanity checks and other three-operand tests (especially those
+-- where the fused operation makes a difference)
+-- 2. Multiply tests (third operand is neutral zero [0E+emax])
+-- 3. Addition tests (first operand is 1)
+-- The multiply and addition tests are extensive because FMA may have
+-- its own dedicated multiplication or addition routine(s), and they
+-- also inherently check the left-to-right properties.
+
+-- Sanity checks
+fmax0001 fma 1 1 1 -> 2
+fmax0002 fma 1 1 2 -> 3
+fmax0003 fma 2 2 3 -> 7
+fmax0004 fma 9 9 9 -> 90
+fmax0005 fma -1 1 1 -> 0
+fmax0006 fma -1 1 2 -> 1
+fmax0007 fma -2 2 3 -> -1
+fmax0008 fma -9 9 9 -> -72
+fmax0011 fma 1 -1 1 -> 0
+fmax0012 fma 1 -1 2 -> 1
+fmax0013 fma 2 -2 3 -> -1
+fmax0014 fma 9 -9 9 -> -72
+fmax0015 fma 1 1 -1 -> 0
+fmax0016 fma 1 1 -2 -> -1
+fmax0017 fma 2 2 -3 -> 1
+fmax0018 fma 9 9 -9 -> 72
+fmax0019 fma 3 5 7 -> 22
+fmax0029 fma 3 -5 7 -> -8
+
+-- non-integer exacts
+fma0100 fma 25.2 63.6 -438 -> 1164.72
+fma0101 fma 0.301 0.380 334 -> 334.114380
+fma0102 fma 49.2 -4.8 23.3 -> -212.86
+fma0103 fma 4.22 0.079 -94.6 -> -94.26662
+fma0104 fma 903 0.797 0.887 -> 720.578
+fma0105 fma 6.13 -161 65.9 -> -921.03
+fma0106 fma 28.2 727 5.45 -> 20506.85
+fma0107 fma 4 605 688 -> 3108
+fma0108 fma 93.3 0.19 0.226 -> 17.953
+fma0109 fma 0.169 -341 5.61 -> -52.019
+fma0110 fma -72.2 30 -51.2 -> -2217.2
+fma0111 fma -0.409 13 20.4 -> 15.083
+fma0112 fma 317 77.0 19.0 -> 24428.0
+fma0113 fma 47 6.58 1.62 -> 310.88
+fma0114 fma 1.36 0.984 0.493 -> 1.83124
+fma0115 fma 72.7 274 1.56 -> 19921.36
+fma0116 fma 335 847 83 -> 283828
+fma0117 fma 666 0.247 25.4 -> 189.902
+fma0118 fma -3.87 3.06 78.0 -> 66.1578
+fma0119 fma 0.742 192 35.6 -> 178.064
+fma0120 fma -91.6 5.29 0.153 -> -484.411
+
+-- cases where result is different from separate multiply + add; each
+-- is preceded by the result of unfused multiply and add
+-- [this is about 20% of all similar cases in general]
+-- 888565290 1557.96930 -86087.7578 -> 1.38435735E+12
+fma0201 fma 888565290 1557.96930 -86087.7578 -> 1.38435736E+12 Inexact Rounded
+-- -85519342.9 735155419 42010431 -> -6.28700084E+16
+fma0205 fma -85519342.9 735155419 42010431 -> -6.28700083E+16 Inexact Rounded
+-- -98025.5 -294603.472 10414348.2 -> 2.88890669E+10
+fma0208 fma -98025.5 -294603.472 10414348.2 -> 2.88890670E+10 Inexact Rounded
+-- 5967627.39 83526540.6 498494.810 -> 4.98455271E+14
+fma0211 fma 5967627.39 83526540.6 498494.810 -> 4.98455272E+14 Inexact Rounded
+-- 3456.9433 874.39518 197866.615 -> 3220601.18
+fma0216 fma 3456.9433 874.39518 197866.615 -> 3220601.17 Inexact Rounded
+-- 62769.8287 2096.98927 48.420317 -> 131627705
+fma0218 fma 62769.8287 2096.98927 48.420317 -> 131627706 Inexact Rounded
+-- -68.81500 59961113.9 -8988862 -> -4.13521291E+9
+fma0219 fma -68.81500 59961113.9 -8988862 -> -4.13521292E+9 Inexact Rounded
+-- 2126341.02 63491.5152 302427455 -> 1.35307040E+11
+fma0226 fma 2126341.02 63491.5152 302427455 -> 1.35307041E+11 Inexact Rounded
+
+
+-- Infinite combinations
+fmax0800 fma Inf Inf Inf -> Infinity
+fmax0801 fma Inf Inf -Inf -> NaN Invalid_operation
+fmax0802 fma Inf -Inf Inf -> NaN Invalid_operation
+fmax0803 fma Inf -Inf -Inf -> -Infinity
+fmax0804 fma -Inf Inf Inf -> NaN Invalid_operation
+fmax0805 fma -Inf Inf -Inf -> -Infinity
+fmax0806 fma -Inf -Inf Inf -> Infinity
+fmax0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
+fmax0808 fma -Inf 0 1 -> NaN Invalid_operation
+fmax0809 fma -Inf 0 NaN -> NaN Invalid_operation
+
+-- Triple NaN propagation
+fmax0900 fma NaN2 NaN3 NaN5 -> NaN2
+fmax0901 fma 0 NaN3 NaN5 -> NaN3
+fmax0902 fma 0 0 NaN5 -> NaN5
+-- first sNaN wins (consider qNaN from earlier sNaN being
+-- overridden by an sNaN in third operand)
+fmax0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+fmax0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
+fmax0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
+fmax0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+fmax0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
+fmax0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
+
+-- MULTIPLICATION TESTS ------------------------------------------------
+-- sanity checks (as base, above)
+fmax2000 fma 2 2 0E+999999 -> 4
+fmax2001 fma 2 3 0E+999999 -> 6
+fmax2002 fma 5 1 0E+999999 -> 5
+fmax2003 fma 5 2 0E+999999 -> 10
+fmax2004 fma 1.20 2 0E+999999 -> 2.40
+fmax2005 fma 1.20 0 0E+999999 -> 0.00
+fmax2006 fma 1.20 -2 0E+999999 -> -2.40
+fmax2007 fma -1.20 2 0E+999999 -> -2.40
+fmax2008 fma -1.20 0 0E+999999 -> 0.00
+fmax2009 fma -1.20 -2 0E+999999 -> 2.40
+fmax2010 fma 5.09 7.1 0E+999999 -> 36.139
+fmax2011 fma 2.5 4 0E+999999 -> 10.0
+fmax2012 fma 2.50 4 0E+999999 -> 10.00
+fmax2013 fma 1.23456789 1.00000000 0E+999999 -> 1.23456789 Rounded
+fmax2014 fma 9.999999999 9.999999999 0E+999999 -> 100.000000 Inexact Rounded
+fmax2015 fma 2.50 4 0E+999999 -> 10.00
+precision: 6
+fmax2016 fma 2.50 4 0E+999999 -> 10.00
+fmax2017 fma 9.999999 9.999999 0E+999999 -> 100.000 Inexact Rounded
+fmax2018 fma 9.999999 -9.999999 0E+999999 -> -100.000 Inexact Rounded
+fmax2019 fma -9.999999 9.999999 0E+999999 -> -100.000 Inexact Rounded
+fmax2020 fma -9.999999 -9.999999 0E+999999 -> 100.000 Inexact Rounded
+
+-- 1999.12.21: next one is a edge case if intermediate longs are used
+precision: 15
+fmax2059 fma 999999999999 9765625 0E+999999 -> 9.76562499999023E+18 Inexact Rounded
+precision: 30
+fmax2160 fma 999999999999 9765625 0E+999999 -> 9765624999990234375
+precision: 9
+-----
+
+-- zeros, etc.
+fmax2021 fma 0 0 0E+999999 -> 0
+fmax2022 fma 0 -0 0E+999999 -> 0
+fmax2023 fma -0 0 0E+999999 -> 0
+fmax2024 fma -0 -0 0E+999999 -> 0
+fmax2025 fma -0.0 -0.0 0E+999999 -> 0.00
+fmax2026 fma -0.0 -0.0 0E+999999 -> 0.00
+fmax2027 fma -0.0 -0.0 0E+999999 -> 0.00
+fmax2028 fma -0.0 -0.0 0E+999999 -> 0.00
+fmax2030 fma 5.00 1E-3 0E+999999 -> 0.00500
+fmax2031 fma 00.00 0.000 0E+999999 -> 0.00000
+fmax2032 fma 00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0
+fmax2033 fma 0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0
+fmax2034 fma -5.00 1E-3 0E+999999 -> -0.00500
+fmax2035 fma -00.00 0.000 0E+999999 -> 0.00000
+fmax2036 fma -00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0
+fmax2037 fma -0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0
+fmax2038 fma 5.00 -1E-3 0E+999999 -> -0.00500
+fmax2039 fma 00.00 -0.000 0E+999999 -> 0.00000
+fmax2040 fma 00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0
+fmax2041 fma 0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0
+fmax2042 fma -5.00 -1E-3 0E+999999 -> 0.00500
+fmax2043 fma -00.00 -0.000 0E+999999 -> 0.00000
+fmax2044 fma -00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0
+fmax2045 fma -0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0
+
+-- examples from decarith multiply
+fmax2050 fma 1.20 3 0E+999999 -> 3.60
+fmax2051 fma 7 3 0E+999999 -> 21
+fmax2052 fma 0.9 0.8 0E+999999 -> 0.72
+fmax2053 fma 0.9 -0 0E+999999 -> 0.0
+fmax2054 fma 654321 654321 0E+999999 -> 4.28135971E+11 Inexact Rounded
+
+fmax2060 fma 123.45 1e7 0E+999999 -> 1.2345E+9
+fmax2061 fma 123.45 1e8 0E+999999 -> 1.2345E+10
+fmax2062 fma 123.45 1e+9 0E+999999 -> 1.2345E+11
+fmax2063 fma 123.45 1e10 0E+999999 -> 1.2345E+12
+fmax2064 fma 123.45 1e11 0E+999999 -> 1.2345E+13
+fmax2065 fma 123.45 1e12 0E+999999 -> 1.2345E+14
+fmax2066 fma 123.45 1e13 0E+999999 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+precision: 9
+fmax2080 fma 0.1 123456789 0E+999999 -> 12345678.9
+fmax2081 fma 0.1 1234567891 0E+999999 -> 123456789 Inexact Rounded
+fmax2082 fma 0.1 12345678912 0E+999999 -> 1.23456789E+9 Inexact Rounded
+fmax2083 fma 0.1 12345678912345 0E+999999 -> 1.23456789E+12 Inexact Rounded
+fmax2084 fma 0.1 123456789 0E+999999 -> 12345678.9
+precision: 8
+fmax2085 fma 0.1 12345678912 0E+999999 -> 1.2345679E+9 Inexact Rounded
+fmax2086 fma 0.1 12345678912345 0E+999999 -> 1.2345679E+12 Inexact Rounded
+precision: 7
+fmax2087 fma 0.1 12345678912 0E+999999 -> 1.234568E+9 Inexact Rounded
+fmax2088 fma 0.1 12345678912345 0E+999999 -> 1.234568E+12 Inexact Rounded
+
+precision: 9
+fmax2090 fma 123456789 0.1 0E+999999 -> 12345678.9
+fmax2091 fma 1234567891 0.1 0E+999999 -> 123456789 Inexact Rounded
+fmax2092 fma 12345678912 0.1 0E+999999 -> 1.23456789E+9 Inexact Rounded
+fmax2093 fma 12345678912345 0.1 0E+999999 -> 1.23456789E+12 Inexact Rounded
+fmax2094 fma 123456789 0.1 0E+999999 -> 12345678.9
+precision: 8
+fmax2095 fma 12345678912 0.1 0E+999999 -> 1.2345679E+9 Inexact Rounded
+fmax2096 fma 12345678912345 0.1 0E+999999 -> 1.2345679E+12 Inexact Rounded
+precision: 7
+fmax2097 fma 12345678912 0.1 0E+999999 -> 1.234568E+9 Inexact Rounded
+fmax2098 fma 12345678912345 0.1 0E+999999 -> 1.234568E+12 Inexact Rounded
+
+-- test some more edge cases and carries
+maxexponent: 9999
+minexponent: -9999
+precision: 33
+fmax2101 fma 9 9 0E+999999 -> 81
+fmax2102 fma 9 90 0E+999999 -> 810
+fmax2103 fma 9 900 0E+999999 -> 8100
+fmax2104 fma 9 9000 0E+999999 -> 81000
+fmax2105 fma 9 90000 0E+999999 -> 810000
+fmax2106 fma 9 900000 0E+999999 -> 8100000
+fmax2107 fma 9 9000000 0E+999999 -> 81000000
+fmax2108 fma 9 90000000 0E+999999 -> 810000000
+fmax2109 fma 9 900000000 0E+999999 -> 8100000000
+fmax2110 fma 9 9000000000 0E+999999 -> 81000000000
+fmax2111 fma 9 90000000000 0E+999999 -> 810000000000
+fmax2112 fma 9 900000000000 0E+999999 -> 8100000000000
+fmax2113 fma 9 9000000000000 0E+999999 -> 81000000000000
+fmax2114 fma 9 90000000000000 0E+999999 -> 810000000000000
+fmax2115 fma 9 900000000000000 0E+999999 -> 8100000000000000
+fmax2116 fma 9 9000000000000000 0E+999999 -> 81000000000000000
+fmax2117 fma 9 90000000000000000 0E+999999 -> 810000000000000000
+fmax2118 fma 9 900000000000000000 0E+999999 -> 8100000000000000000
+fmax2119 fma 9 9000000000000000000 0E+999999 -> 81000000000000000000
+fmax2120 fma 9 90000000000000000000 0E+999999 -> 810000000000000000000
+fmax2121 fma 9 900000000000000000000 0E+999999 -> 8100000000000000000000
+fmax2122 fma 9 9000000000000000000000 0E+999999 -> 81000000000000000000000
+fmax2123 fma 9 90000000000000000000000 0E+999999 -> 810000000000000000000000
+-- test some more edge cases without carries
+fmax2131 fma 3 3 0E+999999 -> 9
+fmax2132 fma 3 30 0E+999999 -> 90
+fmax2133 fma 3 300 0E+999999 -> 900
+fmax2134 fma 3 3000 0E+999999 -> 9000
+fmax2135 fma 3 30000 0E+999999 -> 90000
+fmax2136 fma 3 300000 0E+999999 -> 900000
+fmax2137 fma 3 3000000 0E+999999 -> 9000000
+fmax2138 fma 3 30000000 0E+999999 -> 90000000
+fmax2139 fma 3 300000000 0E+999999 -> 900000000
+fmax2140 fma 3 3000000000 0E+999999 -> 9000000000
+fmax2141 fma 3 30000000000 0E+999999 -> 90000000000
+fmax2142 fma 3 300000000000 0E+999999 -> 900000000000
+fmax2143 fma 3 3000000000000 0E+999999 -> 9000000000000
+fmax2144 fma 3 30000000000000 0E+999999 -> 90000000000000
+fmax2145 fma 3 300000000000000 0E+999999 -> 900000000000000
+fmax2146 fma 3 3000000000000000 0E+999999 -> 9000000000000000
+fmax2147 fma 3 30000000000000000 0E+999999 -> 90000000000000000
+fmax2148 fma 3 300000000000000000 0E+999999 -> 900000000000000000
+fmax2149 fma 3 3000000000000000000 0E+999999 -> 9000000000000000000
+fmax2150 fma 3 30000000000000000000 0E+999999 -> 90000000000000000000
+fmax2151 fma 3 300000000000000000000 0E+999999 -> 900000000000000000000
+fmax2152 fma 3 3000000000000000000000 0E+999999 -> 9000000000000000000000
+fmax2153 fma 3 30000000000000000000000 0E+999999 -> 90000000000000000000000
+
+maxexponent: 999999
+minexponent: -999999
+precision: 9
+-- test some cases that are close to exponent overflow/underflow
+fmax2170 fma 1 9e999999 0E+999999 -> 9E+999999
+fmax2171 fma 1 9.9e999999 0E+999999 -> 9.9E+999999
+fmax2172 fma 1 9.99e999999 0E+999999 -> 9.99E+999999
+fmax2173 fma 9e999999 1 0E+999999 -> 9E+999999
+fmax2174 fma 9.9e999999 1 0E+999999 -> 9.9E+999999
+fmax2176 fma 9.99e999999 1 0E+999999 -> 9.99E+999999
+fmax2177 fma 1 9.99999e999999 0E+999999 -> 9.99999E+999999
+fmax2178 fma 9.99999e999999 1 0E+999999 -> 9.99999E+999999
+
+fmax2180 fma 0.1 9e-999998 0E+999999 -> 9E-999999
+fmax2181 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998
+fmax2182 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997
+
+fmax2183 fma 0.1 9e-999998 0E+999999 -> 9E-999999
+fmax2184 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998
+fmax2185 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997
+fmax2186 fma 0.1 999e-999997 0E+999999 -> 9.99E-999996
+fmax2187 fma 0.1 9999e-999997 0E+999999 -> 9.999E-999995
+fmax2188 fma 0.1 99999e-999997 0E+999999 -> 9.9999E-999994
+
+fmax2190 fma 1 9e-999998 0E+999999 -> 9E-999998
+fmax2191 fma 1 99e-999998 0E+999999 -> 9.9E-999997
+fmax2192 fma 1 999e-999998 0E+999999 -> 9.99E-999996
+fmax2193 fma 9e-999998 1 0E+999999 -> 9E-999998
+fmax2194 fma 99e-999998 1 0E+999999 -> 9.9E-999997
+fmax2195 fma 999e-999998 1 0E+999999 -> 9.99E-999996
+
+-- long operand triangle
+precision: 33
+fmax2246 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511992830 Inexact Rounded
+precision: 32
+fmax2247 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199283 Inexact Rounded
+precision: 31
+fmax2248 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165119928 Inexact Rounded
+precision: 30
+fmax2249 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511993 Inexact Rounded
+precision: 29
+fmax2250 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199 Inexact Rounded
+precision: 28
+fmax2251 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165120 Inexact Rounded
+precision: 27
+fmax2252 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916512 Inexact Rounded
+precision: 26
+fmax2253 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651 Inexact Rounded
+precision: 25
+fmax2254 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165 Inexact Rounded
+precision: 24
+fmax2255 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671917 Inexact Rounded
+precision: 23
+fmax2256 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967192 Inexact Rounded
+precision: 22
+fmax2257 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719 Inexact Rounded
+precision: 21
+fmax2258 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369672 Inexact Rounded
+precision: 20
+fmax2259 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967 Inexact Rounded
+precision: 19
+fmax2260 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933697 Inexact Rounded
+precision: 18
+fmax2261 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193370 Inexact Rounded
+precision: 17
+fmax2262 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119337 Inexact Rounded
+precision: 16
+fmax2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011934 Inexact Rounded
+precision: 15
+fmax2264 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193 Inexact Rounded
+precision: 14
+fmax2265 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119 Inexact Rounded
+precision: 13
+fmax2266 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908012 Inexact Rounded
+precision: 12
+fmax2267 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801 Inexact Rounded
+precision: 11
+fmax2268 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080 Inexact Rounded
+precision: 10
+fmax2269 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908 Inexact Rounded
+precision: 9
+fmax2270 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.291 Inexact Rounded
+precision: 8
+fmax2271 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29 Inexact Rounded
+precision: 7
+fmax2272 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.3 Inexact Rounded
+precision: 6
+fmax2273 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433 Inexact Rounded
+precision: 5
+fmax2274 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.4543E+5 Inexact Rounded
+precision: 4
+fmax2275 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.454E+5 Inexact Rounded
+precision: 3
+fmax2276 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.45E+5 Inexact Rounded
+precision: 2
+fmax2277 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.5E+5 Inexact Rounded
+precision: 1
+fmax2278 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1E+5 Inexact Rounded
+
+-- test some edge cases with exact rounding
+maxexponent: 9999
+minexponent: -9999
+precision: 9
+fmax2301 fma 9 9 0E+999999 -> 81
+fmax2302 fma 9 90 0E+999999 -> 810
+fmax2303 fma 9 900 0E+999999 -> 8100
+fmax2304 fma 9 9000 0E+999999 -> 81000
+fmax2305 fma 9 90000 0E+999999 -> 810000
+fmax2306 fma 9 900000 0E+999999 -> 8100000
+fmax2307 fma 9 9000000 0E+999999 -> 81000000
+fmax2308 fma 9 90000000 0E+999999 -> 810000000
+fmax2309 fma 9 900000000 0E+999999 -> 8.10000000E+9 Rounded
+fmax2310 fma 9 9000000000 0E+999999 -> 8.10000000E+10 Rounded
+fmax2311 fma 9 90000000000 0E+999999 -> 8.10000000E+11 Rounded
+fmax2312 fma 9 900000000000 0E+999999 -> 8.10000000E+12 Rounded
+fmax2313 fma 9 9000000000000 0E+999999 -> 8.10000000E+13 Rounded
+fmax2314 fma 9 90000000000000 0E+999999 -> 8.10000000E+14 Rounded
+fmax2315 fma 9 900000000000000 0E+999999 -> 8.10000000E+15 Rounded
+fmax2316 fma 9 9000000000000000 0E+999999 -> 8.10000000E+16 Rounded
+fmax2317 fma 9 90000000000000000 0E+999999 -> 8.10000000E+17 Rounded
+fmax2318 fma 9 900000000000000000 0E+999999 -> 8.10000000E+18 Rounded
+fmax2319 fma 9 9000000000000000000 0E+999999 -> 8.10000000E+19 Rounded
+fmax2320 fma 9 90000000000000000000 0E+999999 -> 8.10000000E+20 Rounded
+fmax2321 fma 9 900000000000000000000 0E+999999 -> 8.10000000E+21 Rounded
+fmax2322 fma 9 9000000000000000000000 0E+999999 -> 8.10000000E+22 Rounded
+fmax2323 fma 9 90000000000000000000000 0E+999999 -> 8.10000000E+23 Rounded
+
+-- fastpath breakers
+precision: 29
+fmax2330 fma 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603 0E+999999 -> 1.6487212707001281468486507878 Inexact Rounded
+precision: 55
+fmax2331 fma 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428 0E+999999 -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded
+
+
+-- tryzeros cases
+precision: 7
+rounding: half_up
+maxExponent: 92
+minexponent: -92
+fmax2504 fma 0E-60 1000E-60 0E+999999 -> 0E-98 Clamped
+fmax2505 fma 100E+60 0E+60 0E+999999 -> 0E+92 Clamped
+
+-- mixed with zeros
+maxexponent: 999999
+minexponent: -999999
+precision: 9
+fmax2541 fma 0 -1 0E+999999 -> 0
+fmax2542 fma -0 -1 0E+999999 -> 0
+fmax2543 fma 0 1 0E+999999 -> 0
+fmax2544 fma -0 1 0E+999999 -> 0
+fmax2545 fma -1 0 0E+999999 -> 0
+fmax2546 fma -1 -0 0E+999999 -> 0
+fmax2547 fma 1 0 0E+999999 -> 0
+fmax2548 fma 1 -0 0E+999999 -> 0
+
+fmax2551 fma 0.0 -1 0E+999999 -> 0.0
+fmax2552 fma -0.0 -1 0E+999999 -> 0.0
+fmax2553 fma 0.0 1 0E+999999 -> 0.0
+fmax2554 fma -0.0 1 0E+999999 -> 0.0
+fmax2555 fma -1.0 0 0E+999999 -> 0.0
+fmax2556 fma -1.0 -0 0E+999999 -> 0.0
+fmax2557 fma 1.0 0 0E+999999 -> 0.0
+fmax2558 fma 1.0 -0 0E+999999 -> 0.0
+
+fmax2561 fma 0 -1.0 0E+999999 -> 0.0
+fmax2562 fma -0 -1.0 0E+999999 -> 0.0
+fmax2563 fma 0 1.0 0E+999999 -> 0.0
+fmax2564 fma -0 1.0 0E+999999 -> 0.0
+fmax2565 fma -1 0.0 0E+999999 -> 0.0
+fmax2566 fma -1 -0.0 0E+999999 -> 0.0
+fmax2567 fma 1 0.0 0E+999999 -> 0.0
+fmax2568 fma 1 -0.0 0E+999999 -> 0.0
+
+fmax2571 fma 0.0 -1.0 0E+999999 -> 0.00
+fmax2572 fma -0.0 -1.0 0E+999999 -> 0.00
+fmax2573 fma 0.0 1.0 0E+999999 -> 0.00
+fmax2574 fma -0.0 1.0 0E+999999 -> 0.00
+fmax2575 fma -1.0 0.0 0E+999999 -> 0.00
+fmax2576 fma -1.0 -0.0 0E+999999 -> 0.00
+fmax2577 fma 1.0 0.0 0E+999999 -> 0.00
+fmax2578 fma 1.0 -0.0 0E+999999 -> 0.00
+
+
+-- Specials
+fmax2580 fma Inf -Inf 0E+999999 -> -Infinity
+fmax2581 fma Inf -1000 0E+999999 -> -Infinity
+fmax2582 fma Inf -1 0E+999999 -> -Infinity
+fmax2583 fma Inf -0 0E+999999 -> NaN Invalid_operation
+fmax2584 fma Inf 0 0E+999999 -> NaN Invalid_operation
+fmax2585 fma Inf 1 0E+999999 -> Infinity
+fmax2586 fma Inf 1000 0E+999999 -> Infinity
+fmax2587 fma Inf Inf 0E+999999 -> Infinity
+fmax2588 fma -1000 Inf 0E+999999 -> -Infinity
+fmax2589 fma -Inf Inf 0E+999999 -> -Infinity
+fmax2590 fma -1 Inf 0E+999999 -> -Infinity
+fmax2591 fma -0 Inf 0E+999999 -> NaN Invalid_operation
+fmax2592 fma 0 Inf 0E+999999 -> NaN Invalid_operation
+fmax2593 fma 1 Inf 0E+999999 -> Infinity
+fmax2594 fma 1000 Inf 0E+999999 -> Infinity
+fmax2595 fma Inf Inf 0E+999999 -> Infinity
+
+fmax2600 fma -Inf -Inf 0E+999999 -> Infinity
+fmax2601 fma -Inf -1000 0E+999999 -> Infinity
+fmax2602 fma -Inf -1 0E+999999 -> Infinity
+fmax2603 fma -Inf -0 0E+999999 -> NaN Invalid_operation
+fmax2604 fma -Inf 0 0E+999999 -> NaN Invalid_operation
+fmax2605 fma -Inf 1 0E+999999 -> -Infinity
+fmax2606 fma -Inf 1000 0E+999999 -> -Infinity
+fmax2607 fma -Inf Inf 0E+999999 -> -Infinity
+fmax2608 fma -1000 Inf 0E+999999 -> -Infinity
+fmax2609 fma -Inf -Inf 0E+999999 -> Infinity
+fmax2610 fma -1 -Inf 0E+999999 -> Infinity
+fmax2611 fma -0 -Inf 0E+999999 -> NaN Invalid_operation
+fmax2612 fma 0 -Inf 0E+999999 -> NaN Invalid_operation
+fmax2613 fma 1 -Inf 0E+999999 -> -Infinity
+fmax2614 fma 1000 -Inf 0E+999999 -> -Infinity
+fmax2615 fma Inf -Inf 0E+999999 -> -Infinity
+
+fmax2621 fma NaN -Inf 0E+999999 -> NaN
+fmax2622 fma NaN -1000 0E+999999 -> NaN
+fmax2623 fma NaN -1 0E+999999 -> NaN
+fmax2624 fma NaN -0 0E+999999 -> NaN
+fmax2625 fma NaN 0 0E+999999 -> NaN
+fmax2626 fma NaN 1 0E+999999 -> NaN
+fmax2627 fma NaN 1000 0E+999999 -> NaN
+fmax2628 fma NaN Inf 0E+999999 -> NaN
+fmax2629 fma NaN NaN 0E+999999 -> NaN
+fmax2630 fma -Inf NaN 0E+999999 -> NaN
+fmax2631 fma -1000 NaN 0E+999999 -> NaN
+fmax2632 fma -1 NaN 0E+999999 -> NaN
+fmax2633 fma -0 NaN 0E+999999 -> NaN
+fmax2634 fma 0 NaN 0E+999999 -> NaN
+fmax2635 fma 1 NaN 0E+999999 -> NaN
+fmax2636 fma 1000 NaN 0E+999999 -> NaN
+fmax2637 fma Inf NaN 0E+999999 -> NaN
+
+fmax2641 fma sNaN -Inf 0E+999999 -> NaN Invalid_operation
+fmax2642 fma sNaN -1000 0E+999999 -> NaN Invalid_operation
+fmax2643 fma sNaN -1 0E+999999 -> NaN Invalid_operation
+fmax2644 fma sNaN -0 0E+999999 -> NaN Invalid_operation
+fmax2645 fma sNaN 0 0E+999999 -> NaN Invalid_operation
+fmax2646 fma sNaN 1 0E+999999 -> NaN Invalid_operation
+fmax2647 fma sNaN 1000 0E+999999 -> NaN Invalid_operation
+fmax2648 fma sNaN NaN 0E+999999 -> NaN Invalid_operation
+fmax2649 fma sNaN sNaN 0E+999999 -> NaN Invalid_operation
+fmax2650 fma NaN sNaN 0E+999999 -> NaN Invalid_operation
+fmax2651 fma -Inf sNaN 0E+999999 -> NaN Invalid_operation
+fmax2652 fma -1000 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2653 fma -1 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2654 fma -0 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2655 fma 0 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2656 fma 1 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2657 fma 1000 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2658 fma Inf sNaN 0E+999999 -> NaN Invalid_operation
+fmax2659 fma NaN sNaN 0E+999999 -> NaN Invalid_operation
+
+-- propagating NaNs
+fmax2661 fma NaN9 -Inf 0E+999999 -> NaN9
+fmax2662 fma NaN8 999 0E+999999 -> NaN8
+fmax2663 fma NaN71 Inf 0E+999999 -> NaN71
+fmax2664 fma NaN6 NaN5 0E+999999 -> NaN6
+fmax2665 fma -Inf NaN4 0E+999999 -> NaN4
+fmax2666 fma -999 NaN33 0E+999999 -> NaN33
+fmax2667 fma Inf NaN2 0E+999999 -> NaN2
+
+fmax2671 fma sNaN99 -Inf 0E+999999 -> NaN99 Invalid_operation
+fmax2672 fma sNaN98 -11 0E+999999 -> NaN98 Invalid_operation
+fmax2673 fma sNaN97 NaN 0E+999999 -> NaN97 Invalid_operation
+fmax2674 fma sNaN16 sNaN94 0E+999999 -> NaN16 Invalid_operation
+fmax2675 fma NaN95 sNaN93 0E+999999 -> NaN93 Invalid_operation
+fmax2676 fma -Inf sNaN92 0E+999999 -> NaN92 Invalid_operation
+fmax2677 fma 088 sNaN91 0E+999999 -> NaN91 Invalid_operation
+fmax2678 fma Inf sNaN90 0E+999999 -> NaN90 Invalid_operation
+fmax2679 fma NaN sNaN89 0E+999999 -> NaN89 Invalid_operation
+
+fmax2681 fma -NaN9 -Inf 0E+999999 -> -NaN9
+fmax2682 fma -NaN8 999 0E+999999 -> -NaN8
+fmax2683 fma -NaN71 Inf 0E+999999 -> -NaN71
+fmax2684 fma -NaN6 -NaN5 0E+999999 -> -NaN6
+fmax2685 fma -Inf -NaN4 0E+999999 -> -NaN4
+fmax2686 fma -999 -NaN33 0E+999999 -> -NaN33
+fmax2687 fma Inf -NaN2 0E+999999 -> -NaN2
+
+fmax2691 fma -sNaN99 -Inf 0E+999999 -> -NaN99 Invalid_operation
+fmax2692 fma -sNaN98 -11 0E+999999 -> -NaN98 Invalid_operation
+fmax2693 fma -sNaN97 NaN 0E+999999 -> -NaN97 Invalid_operation
+fmax2694 fma -sNaN16 -sNaN94 0E+999999 -> -NaN16 Invalid_operation
+fmax2695 fma -NaN95 -sNaN93 0E+999999 -> -NaN93 Invalid_operation
+fmax2696 fma -Inf -sNaN92 0E+999999 -> -NaN92 Invalid_operation
+fmax2697 fma 088 -sNaN91 0E+999999 -> -NaN91 Invalid_operation
+fmax2698 fma Inf -sNaN90 0E+999999 -> -NaN90 Invalid_operation
+fmax2699 fma -NaN -sNaN89 0E+999999 -> -NaN89 Invalid_operation
+
+fmax2701 fma -NaN -Inf 0E+999999 -> -NaN
+fmax2702 fma -NaN 999 0E+999999 -> -NaN
+fmax2703 fma -NaN Inf 0E+999999 -> -NaN
+fmax2704 fma -NaN -NaN 0E+999999 -> -NaN
+fmax2705 fma -Inf -NaN0 0E+999999 -> -NaN
+fmax2706 fma -999 -NaN 0E+999999 -> -NaN
+fmax2707 fma Inf -NaN 0E+999999 -> -NaN
+
+fmax2711 fma -sNaN -Inf 0E+999999 -> -NaN Invalid_operation
+fmax2712 fma -sNaN -11 0E+999999 -> -NaN Invalid_operation
+fmax2713 fma -sNaN00 NaN 0E+999999 -> -NaN Invalid_operation
+fmax2714 fma -sNaN -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2715 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2716 fma -Inf -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2717 fma 088 -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2718 fma Inf -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2719 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+maxexponent: 999999
+minexponent: -999999
+fmax2730 fma +1.23456789012345E-0 9E+999999 0E+999999 -> Infinity Inexact Overflow Rounded
+fmax2731 fma 9E+999999 +1.23456789012345E-0 0E+999999 -> Infinity Inexact Overflow Rounded
+fmax2732 fma +0.100 9E-999999 0E+999999 -> 9.00E-1000000 Subnormal
+fmax2733 fma 9E-999999 +0.100 0E+999999 -> 9.00E-1000000 Subnormal
+fmax2735 fma -1.23456789012345E-0 9E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded
+fmax2736 fma 9E+999999 -1.23456789012345E-0 0E+999999 -> -Infinity Inexact Overflow Rounded
+fmax2737 fma -0.100 9E-999999 0E+999999 -> -9.00E-1000000 Subnormal
+fmax2738 fma 9E-999999 -0.100 0E+999999 -> -9.00E-1000000 Subnormal
+
+-- signs
+fmax2751 fma 1e+777777 1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2752 fma 1e+777777 -1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded
+fmax2753 fma -1e+777777 1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded
+fmax2754 fma -1e+777777 -1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2755 fma 1e-777777 1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2756 fma 1e-777777 -1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2757 fma -1e-777777 1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2758 fma -1e-777777 -1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+precision: 9
+fmax2760 fma 1e-600000 1e-400001 0E+999999 -> 1E-1000001 Subnormal
+fmax2761 fma 1e-600000 1e-400002 0E+999999 -> 1E-1000002 Subnormal
+fmax2762 fma 1e-600000 1e-400003 0E+999999 -> 1E-1000003 Subnormal
+fmax2763 fma 1e-600000 1e-400004 0E+999999 -> 1E-1000004 Subnormal
+fmax2764 fma 1e-600000 1e-400005 0E+999999 -> 1E-1000005 Subnormal
+fmax2765 fma 1e-600000 1e-400006 0E+999999 -> 1E-1000006 Subnormal
+fmax2766 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal
+fmax2767 fma 1e-600000 1e-400008 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2768 fma 1e-600000 1e-400009 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2769 fma 1e-600000 1e-400010 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+fmax2770 fma 1e+600000 1e+400001 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2771 fma 1e+600000 1e+400002 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2772 fma 1e+600000 1e+400003 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2773 fma 1e+600000 1e+400004 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2774 fma 1e+600000 1e+400005 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2775 fma 1e+600000 1e+400006 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2776 fma 1e+600000 1e+400007 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2777 fma 1e+600000 1e+400008 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2778 fma 1e+600000 1e+400009 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2779 fma 1e+600000 1e+400010 0E+999999 -> Infinity Overflow Inexact Rounded
+
+-- 'subnormal' test edge condition at higher precisions
+precision: 99
+fmax2780 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal
+fmax2781 fma 1e-600000 1e-400008 0E+999999 -> 1E-1000008 Subnormal
+fmax2782 fma 1e-600000 1e-400097 0E+999999 -> 1E-1000097 Subnormal
+fmax2783 fma 1e-600000 1e-400098 0E+999999 -> 0E-1000097 Underflow Subnormal Inexact Rounded Clamped
+precision: 999
+fmax2784 fma 1e-600000 1e-400997 0E+999999 -> 1E-1000997 Subnormal
+fmax2785 fma 1e-600000 1e-400998 0E+999999 -> 0E-1000997 Underflow Subnormal Inexact Rounded Clamped
+
+-- test subnormals rounding
+precision: 5
+maxExponent: 999
+minexponent: -999
+rounding: half_even
+
+fmax2801 fma 1.0000E-999 1 0E+999999 -> 1.0000E-999
+fmax2802 fma 1.000E-999 1e-1 0E+999999 -> 1.000E-1000 Subnormal
+fmax2803 fma 1.00E-999 1e-2 0E+999999 -> 1.00E-1001 Subnormal
+fmax2804 fma 1.0E-999 1e-3 0E+999999 -> 1.0E-1002 Subnormal
+fmax2805 fma 1.0E-999 1e-4 0E+999999 -> 1E-1003 Subnormal Rounded
+fmax2806 fma 1.3E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+fmax2807 fma 1.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2808 fma 1.7E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2809 fma 2.3E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2810 fma 2.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2811 fma 2.7E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded
+fmax2812 fma 1.49E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+fmax2813 fma 1.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2814 fma 1.51E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2815 fma 2.49E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2816 fma 2.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2817 fma 2.51E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded
+
+fmax2818 fma 1E-999 1e-4 0E+999999 -> 1E-1003 Subnormal
+fmax2819 fma 3E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2820 fma 5E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2821 fma 7E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+fmax2822 fma 9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+fmax2823 fma 9.9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+
+fmax2824 fma 1E-999 -1e-4 0E+999999 -> -1E-1003 Subnormal
+fmax2825 fma 3E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2826 fma -5E-999 1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2827 fma 7E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
+fmax2828 fma -9E-999 1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
+fmax2829 fma 9.9E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
+fmax2830 fma 3.0E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
+
+fmax2831 fma 1.0E-501 1e-501 0E+999999 -> 1.0E-1002 Subnormal
+fmax2832 fma 2.0E-501 2e-501 0E+999999 -> 4.0E-1002 Subnormal
+fmax2833 fma 4.0E-501 4e-501 0E+999999 -> 1.60E-1001 Subnormal
+fmax2834 fma 10.0E-501 10e-501 0E+999999 -> 1.000E-1000 Subnormal
+fmax2835 fma 30.0E-501 30e-501 0E+999999 -> 9.000E-1000 Subnormal
+fmax2836 fma 40.0E-501 40e-501 0E+999999 -> 1.6000E-999
+
+-- squares
+fmax2840 fma 1E-502 1e-502 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2841 fma 1E-501 1e-501 0E+999999 -> 1E-1002 Subnormal
+fmax2842 fma 2E-501 2e-501 0E+999999 -> 4E-1002 Subnormal
+fmax2843 fma 4E-501 4e-501 0E+999999 -> 1.6E-1001 Subnormal
+fmax2844 fma 10E-501 10e-501 0E+999999 -> 1.00E-1000 Subnormal
+fmax2845 fma 30E-501 30e-501 0E+999999 -> 9.00E-1000 Subnormal
+fmax2846 fma 40E-501 40e-501 0E+999999 -> 1.600E-999
+
+-- cubes
+fmax2850 fma 1E-670 1e-335 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2851 fma 1E-668 1e-334 0E+999999 -> 1E-1002 Subnormal
+fmax2852 fma 4E-668 2e-334 0E+999999 -> 8E-1002 Subnormal
+fmax2853 fma 9E-668 3e-334 0E+999999 -> 2.7E-1001 Subnormal
+fmax2854 fma 16E-668 4e-334 0E+999999 -> 6.4E-1001 Subnormal
+fmax2855 fma 25E-668 5e-334 0E+999999 -> 1.25E-1000 Subnormal
+fmax2856 fma 10E-668 100e-334 0E+999999 -> 1.000E-999
+
+-- test derived from result of 0.099 ** 999 at 15 digits with unlimited exponent
+precision: 19
+fmax2860 fma 6636851557994578716E-520 6636851557994578716E-520 0E+999999 -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded
+
+-- Long operand overflow may be a different path
+precision: 3
+maxExponent: 999999
+minexponent: -999999
+fmax2870 fma 1 9.999E+999999 0E+999999 -> Infinity Inexact Overflow Rounded
+fmax2871 fma 1 -9.999E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded
+fmax2872 fma 9.999E+999999 1 0E+999999 -> Infinity Inexact Overflow Rounded
+fmax2873 fma -9.999E+999999 1 0E+999999 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+precision: 5
+maxexponent: 79
+minexponent: -79
+fmax2881 fma 1.2347E-40 1.2347E-40 0E+999999 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax2882 fma 1.234E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
+fmax2883 fma 1.23E-40 1.23E-40 0E+999999 -> 1.513E-80 Inexact Rounded Subnormal Underflow
+fmax2884 fma 1.2E-40 1.2E-40 0E+999999 -> 1.44E-80 Subnormal
+fmax2885 fma 1.2E-40 1.2E-41 0E+999999 -> 1.44E-81 Subnormal
+fmax2886 fma 1.2E-40 1.2E-42 0E+999999 -> 1.4E-82 Subnormal Inexact Rounded Underflow
+fmax2887 fma 1.2E-40 1.3E-42 0E+999999 -> 1.6E-82 Subnormal Inexact Rounded Underflow
+fmax2888 fma 1.3E-40 1.3E-42 0E+999999 -> 1.7E-82 Subnormal Inexact Rounded Underflow
+fmax2889 fma 1.3E-40 1.3E-43 0E+999999 -> 2E-83 Subnormal Inexact Rounded Underflow
+fmax2890 fma 1.3E-41 1.3E-43 0E+999999 -> 0E-83 Clamped Subnormal Inexact Rounded Underflow
+
+fmax2891 fma 1.2345E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded
+fmax2892 fma 1.23456E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded
+fmax2893 fma 1.2345E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
+fmax2894 fma 1.23456E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
+fmax2895 fma 1.2345E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow
+fmax2896 fma 1.23456E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+fmax2900 fma 0.3000000000E-191 0.3000000000E-191 0E+999999 -> 9.00000000000000E-384 Subnormal Rounded
+fmax2901 fma 0.3000000001E-191 0.3000000001E-191 0E+999999 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
+fmax2902 fma 9.999999999999999E-383 0.0999999999999 0E+999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
+fmax2903 fma 9.999999999999999E-383 0.09999999999999 0E+999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
+fmax2904 fma 9.999999999999999E-383 0.099999999999999 0E+999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
+fmax2905 fma 9.999999999999999E-383 0.0999999999999999 0E+999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
+-- prove operands are exact
+fmax2906 fma 9.999999999999999E-383 1 0E+999999 -> 9.999999999999999E-383
+fmax2907 fma 1 0.09999999999999999 0E+999999 -> 0.09999999999999999
+-- the next rounds to Nmin
+fmax2908 fma 9.999999999999999E-383 0.09999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax2909 fma 9.999999999999999E-383 0.099999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax2910 fma 9.999999999999999E-383 0.0999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax2911 fma 9.999999999999999E-383 0.09999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+fmax2921 fma 130E-2 120E-2 0E+999999 -> 1.5600
+fmax2922 fma 130E-2 12E-1 0E+999999 -> 1.560
+fmax2923 fma 130E-2 1E0 0E+999999 -> 1.30
+
+-- Null tests
+fmax2990 fma # 10 0E+999999 -> NaN Invalid_operation
+fmax2991 fma 10 # 0E+999999 -> NaN Invalid_operation
+
+-- ADDITION TESTS ------------------------------------------------------
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- [first group are 'quick confidence check']
+fmax3001 fma 1 1 1 -> 2
+fmax3002 fma 1 2 3 -> 5
+fmax3003 fma 1 '5.75' '3.3' -> 9.05
+fmax3004 fma 1 '5' '-3' -> 2
+fmax3005 fma 1 '-5' '-3' -> -8
+fmax3006 fma 1 '-7' '2.5' -> -4.5
+fmax3007 fma 1 '0.7' '0.3' -> 1.0
+fmax3008 fma 1 '1.25' '1.25' -> 2.50
+fmax3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
+fmax3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
+
+fmax3011 fma 1 '0.4444444444' '0.5555555555' -> '1.00000000' Inexact Rounded
+fmax3012 fma 1 '0.4444444440' '0.5555555555' -> '1.00000000' Inexact Rounded
+fmax3013 fma 1 '0.4444444444' '0.5555555550' -> '0.999999999' Inexact Rounded
+fmax3014 fma 1 '0.44444444449' '0' -> '0.444444444' Inexact Rounded
+fmax3015 fma 1 '0.444444444499' '0' -> '0.444444444' Inexact Rounded
+fmax3016 fma 1 '0.4444444444999' '0' -> '0.444444444' Inexact Rounded
+fmax3017 fma 1 '0.4444444445000' '0' -> '0.444444445' Inexact Rounded
+fmax3018 fma 1 '0.4444444445001' '0' -> '0.444444445' Inexact Rounded
+fmax3019 fma 1 '0.444444444501' '0' -> '0.444444445' Inexact Rounded
+fmax3020 fma 1 '0.44444444451' '0' -> '0.444444445' Inexact Rounded
+
+fmax3021 fma 1 0 1 -> 1
+fmax3022 fma 1 1 1 -> 2
+fmax3023 fma 1 2 1 -> 3
+fmax3024 fma 1 3 1 -> 4
+fmax3025 fma 1 4 1 -> 5
+fmax3026 fma 1 5 1 -> 6
+fmax3027 fma 1 6 1 -> 7
+fmax3028 fma 1 7 1 -> 8
+fmax3029 fma 1 8 1 -> 9
+fmax3030 fma 1 9 1 -> 10
+
+-- some carrying effects
+fmax3031 fma 1 '0.9998' '0.0000' -> '0.9998'
+fmax3032 fma 1 '0.9998' '0.0001' -> '0.9999'
+fmax3033 fma 1 '0.9998' '0.0002' -> '1.0000'
+fmax3034 fma 1 '0.9998' '0.0003' -> '1.0001'
+
+fmax3035 fma 1 '70' '10000e+9' -> '1.00000000E+13' Inexact Rounded
+fmax3036 fma 1 '700' '10000e+9' -> '1.00000000E+13' Inexact Rounded
+fmax3037 fma 1 '7000' '10000e+9' -> '1.00000000E+13' Inexact Rounded
+fmax3038 fma 1 '70000' '10000e+9' -> '1.00000001E+13' Inexact Rounded
+fmax3039 fma 1 '700000' '10000e+9' -> '1.00000007E+13' Rounded
+
+-- symmetry:
+fmax3040 fma 1 '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded
+fmax3041 fma 1 '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded
+fmax3042 fma 1 '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded
+fmax3044 fma 1 '10000e+9' '70000' -> '1.00000001E+13' Inexact Rounded
+fmax3045 fma 1 '10000e+9' '700000' -> '1.00000007E+13' Rounded
+
+-- same, higher precision
+precision: 15
+fmax3046 fma 1 '10000e+9' '7' -> '10000000000007'
+fmax3047 fma 1 '10000e+9' '70' -> '10000000000070'
+fmax3048 fma 1 '10000e+9' '700' -> '10000000000700'
+fmax3049 fma 1 '10000e+9' '7000' -> '10000000007000'
+fmax3050 fma 1 '10000e+9' '70000' -> '10000000070000'
+fmax3051 fma 1 '10000e+9' '700000' -> '10000000700000'
+fmax3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+fmax3053 fma 1 '12' '7.00' -> '19.00'
+fmax3054 fma 1 '1.3' '-1.07' -> '0.23'
+fmax3055 fma 1 '1.3' '-1.30' -> '0.00'
+fmax3056 fma 1 '1.3' '-2.07' -> '-0.77'
+fmax3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
+
+-- zero preservation
+precision: 6
+fmax3060 fma 1 '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded
+fmax3061 fma 1 1 '0.0001' -> '1.0001'
+fmax3062 fma 1 1 '0.00001' -> '1.00001'
+fmax3063 fma 1 1 '0.000001' -> '1.00000' Inexact Rounded
+fmax3064 fma 1 1 '0.0000001' -> '1.00000' Inexact Rounded
+fmax3065 fma 1 1 '0.00000001' -> '1.00000' Inexact Rounded
+
+-- some funny zeros [in case of bad signum]
+fmax3070 fma 1 1 0 -> 1
+fmax3071 fma 1 1 0. -> 1
+fmax3072 fma 1 1 .0 -> 1.0
+fmax3073 fma 1 1 0.0 -> 1.0
+fmax3074 fma 1 1 0.00 -> 1.00
+fmax3075 fma 1 0 1 -> 1
+fmax3076 fma 1 0. 1 -> 1
+fmax3077 fma 1 .0 1 -> 1.0
+fmax3078 fma 1 0.0 1 -> 1.0
+fmax3079 fma 1 0.00 1 -> 1.00
+
+precision: 9
+
+-- some carries
+fmax3080 fma 1 999999998 1 -> 999999999
+fmax3081 fma 1 999999999 1 -> 1.00000000E+9 Rounded
+fmax3082 fma 1 99999999 1 -> 100000000
+fmax3083 fma 1 9999999 1 -> 10000000
+fmax3084 fma 1 999999 1 -> 1000000
+fmax3085 fma 1 99999 1 -> 100000
+fmax3086 fma 1 9999 1 -> 10000
+fmax3087 fma 1 999 1 -> 1000
+fmax3088 fma 1 99 1 -> 100
+fmax3089 fma 1 9 1 -> 10
+
+
+-- more LHS swaps
+fmax3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
+fmax3091 fma 1 '-56267E-6' 0 -> '-0.056267'
+fmax3092 fma 1 '-56267E-5' 0 -> '-0.56267'
+fmax3093 fma 1 '-56267E-4' 0 -> '-5.6267'
+fmax3094 fma 1 '-56267E-3' 0 -> '-56.267'
+fmax3095 fma 1 '-56267E-2' 0 -> '-562.67'
+fmax3096 fma 1 '-56267E-1' 0 -> '-5626.7'
+fmax3097 fma 1 '-56267E-0' 0 -> '-56267'
+fmax3098 fma 1 '-5E-10' 0 -> '-5E-10'
+fmax3099 fma 1 '-5E-7' 0 -> '-5E-7'
+fmax3100 fma 1 '-5E-6' 0 -> '-0.000005'
+fmax3101 fma 1 '-5E-5' 0 -> '-0.00005'
+fmax3102 fma 1 '-5E-4' 0 -> '-0.0005'
+fmax3103 fma 1 '-5E-1' 0 -> '-0.5'
+fmax3104 fma 1 '-5E0' 0 -> '-5'
+fmax3105 fma 1 '-5E1' 0 -> '-50'
+fmax3106 fma 1 '-5E5' 0 -> '-500000'
+fmax3107 fma 1 '-5E8' 0 -> '-500000000'
+fmax3108 fma 1 '-5E9' 0 -> '-5.00000000E+9' Rounded
+fmax3109 fma 1 '-5E10' 0 -> '-5.00000000E+10' Rounded
+fmax3110 fma 1 '-5E11' 0 -> '-5.00000000E+11' Rounded
+fmax3111 fma 1 '-5E100' 0 -> '-5.00000000E+100' Rounded
+
+-- more RHS swaps
+fmax3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
+fmax3114 fma 1 0 '-56267E-6' -> '-0.056267'
+fmax3116 fma 1 0 '-56267E-5' -> '-0.56267'
+fmax3117 fma 1 0 '-56267E-4' -> '-5.6267'
+fmax3119 fma 1 0 '-56267E-3' -> '-56.267'
+fmax3120 fma 1 0 '-56267E-2' -> '-562.67'
+fmax3121 fma 1 0 '-56267E-1' -> '-5626.7'
+fmax3122 fma 1 0 '-56267E-0' -> '-56267'
+fmax3123 fma 1 0 '-5E-10' -> '-5E-10'
+fmax3124 fma 1 0 '-5E-7' -> '-5E-7'
+fmax3125 fma 1 0 '-5E-6' -> '-0.000005'
+fmax3126 fma 1 0 '-5E-5' -> '-0.00005'
+fmax3127 fma 1 0 '-5E-4' -> '-0.0005'
+fmax3128 fma 1 0 '-5E-1' -> '-0.5'
+fmax3129 fma 1 0 '-5E0' -> '-5'
+fmax3130 fma 1 0 '-5E1' -> '-50'
+fmax3131 fma 1 0 '-5E5' -> '-500000'
+fmax3132 fma 1 0 '-5E8' -> '-500000000'
+fmax3133 fma 1 0 '-5E9' -> '-5.00000000E+9' Rounded
+fmax3134 fma 1 0 '-5E10' -> '-5.00000000E+10' Rounded
+fmax3135 fma 1 0 '-5E11' -> '-5.00000000E+11' Rounded
+fmax3136 fma 1 0 '-5E100' -> '-5.00000000E+100' Rounded
+
+-- related
+fmax3137 fma 1 1 '0E-12' -> '1.00000000' Rounded
+fmax3138 fma 1 -1 '0E-12' -> '-1.00000000' Rounded
+fmax3139 fma 1 '0E-12' 1 -> '1.00000000' Rounded
+fmax3140 fma 1 '0E-12' -1 -> '-1.00000000' Rounded
+fmax3141 fma 1 1E+4 0.0000 -> '10000.0000'
+fmax3142 fma 1 1E+4 0.00000 -> '10000.0000' Rounded
+fmax3143 fma 1 0.000 1E+5 -> '100000.000'
+fmax3144 fma 1 0.0000 1E+5 -> '100000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+fmax3146 fma 1 '00.0' 0 -> '0.0'
+fmax3147 fma 1 '0.00' 0 -> '0.00'
+fmax3148 fma 1 0 '0.00' -> '0.00'
+fmax3149 fma 1 0 '00.0' -> '0.0'
+fmax3150 fma 1 '00.0' '0.00' -> '0.00'
+fmax3151 fma 1 '0.00' '00.0' -> '0.00'
+fmax3152 fma 1 '3' '.3' -> '3.3'
+fmax3153 fma 1 '3.' '.3' -> '3.3'
+fmax3154 fma 1 '3.0' '.3' -> '3.3'
+fmax3155 fma 1 '3.00' '.3' -> '3.30'
+fmax3156 fma 1 '3' '3' -> '6'
+fmax3157 fma 1 '3' '+3' -> '6'
+fmax3158 fma 1 '3' '-3' -> '0'
+fmax3159 fma 1 '0.3' '-0.3' -> '0.0'
+fmax3160 fma 1 '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+precision: 15
+fmax3161 fma 1 '1E+12' '-1' -> '999999999999'
+fmax3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
+fmax3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
+fmax3164 fma 1 '-1' '1E+12' -> '999999999999'
+fmax3165 fma 1 '7E+12' '-1' -> '6999999999999'
+fmax3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
+fmax3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
+fmax3168 fma 1 '-1' '7E+12' -> '6999999999999'
+
+-- 123456789012345 123456789012345 1 23456789012345
+fmax3170 fma 1 '0.444444444444444' '0.555555555555563' -> '1.00000000000001' Inexact Rounded
+fmax3171 fma 1 '0.444444444444444' '0.555555555555562' -> '1.00000000000001' Inexact Rounded
+fmax3172 fma 1 '0.444444444444444' '0.555555555555561' -> '1.00000000000001' Inexact Rounded
+fmax3173 fma 1 '0.444444444444444' '0.555555555555560' -> '1.00000000000000' Inexact Rounded
+fmax3174 fma 1 '0.444444444444444' '0.555555555555559' -> '1.00000000000000' Inexact Rounded
+fmax3175 fma 1 '0.444444444444444' '0.555555555555558' -> '1.00000000000000' Inexact Rounded
+fmax3176 fma 1 '0.444444444444444' '0.555555555555557' -> '1.00000000000000' Inexact Rounded
+fmax3177 fma 1 '0.444444444444444' '0.555555555555556' -> '1.00000000000000' Rounded
+fmax3178 fma 1 '0.444444444444444' '0.555555555555555' -> '0.999999999999999'
+fmax3179 fma 1 '0.444444444444444' '0.555555555555554' -> '0.999999999999998'
+fmax3180 fma 1 '0.444444444444444' '0.555555555555553' -> '0.999999999999997'
+fmax3181 fma 1 '0.444444444444444' '0.555555555555552' -> '0.999999999999996'
+fmax3182 fma 1 '0.444444444444444' '0.555555555555551' -> '0.999999999999995'
+fmax3183 fma 1 '0.444444444444444' '0.555555555555550' -> '0.999999999999994'
+
+-- and some more, including residue effects and different roundings
+precision: 9
+rounding: half_up
+fmax3200 fma 1 '123456789' 0 -> '123456789'
+fmax3201 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
+fmax3202 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
+fmax3203 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
+fmax3204 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
+fmax3205 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
+fmax3206 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
+fmax3207 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
+fmax3208 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded
+fmax3209 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded
+fmax3210 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded
+fmax3211 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded
+fmax3212 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded
+fmax3213 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded
+fmax3214 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded
+fmax3215 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded
+fmax3216 fma 1 '123456789' 1 -> '123456790'
+fmax3217 fma 1 '123456789' 1.000000001 -> '123456790' Inexact Rounded
+fmax3218 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
+fmax3219 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
+
+rounding: half_even
+fmax3220 fma 1 '123456789' 0 -> '123456789'
+fmax3221 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
+fmax3222 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
+fmax3223 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
+fmax3224 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
+fmax3225 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
+fmax3226 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
+fmax3227 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
+fmax3228 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded
+fmax3229 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded
+fmax3230 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded
+fmax3231 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded
+fmax3232 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded
+fmax3233 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded
+fmax3234 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded
+fmax3235 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded
+fmax3236 fma 1 '123456789' 1 -> '123456790'
+fmax3237 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded
+fmax3238 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
+fmax3239 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
+-- critical few with even bottom digit...
+fmax3240 fma 1 '123456788' 0.499999999 -> '123456788' Inexact Rounded
+fmax3241 fma 1 '123456788' 0.5 -> '123456788' Inexact Rounded
+fmax3242 fma 1 '123456788' 0.500000001 -> '123456789' Inexact Rounded
+
+rounding: down
+fmax3250 fma 1 '123456789' 0 -> '123456789'
+fmax3251 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
+fmax3252 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
+fmax3253 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
+fmax3254 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
+fmax3255 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
+fmax3256 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
+fmax3257 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
+fmax3258 fma 1 '123456789' 0.5 -> '123456789' Inexact Rounded
+fmax3259 fma 1 '123456789' 0.500000001 -> '123456789' Inexact Rounded
+fmax3260 fma 1 '123456789' 0.500001 -> '123456789' Inexact Rounded
+fmax3261 fma 1 '123456789' 0.51 -> '123456789' Inexact Rounded
+fmax3262 fma 1 '123456789' 0.6 -> '123456789' Inexact Rounded
+fmax3263 fma 1 '123456789' 0.9 -> '123456789' Inexact Rounded
+fmax3264 fma 1 '123456789' 0.99999 -> '123456789' Inexact Rounded
+fmax3265 fma 1 '123456789' 0.999999999 -> '123456789' Inexact Rounded
+fmax3266 fma 1 '123456789' 1 -> '123456790'
+fmax3267 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded
+fmax3268 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
+fmax3269 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
+
+-- input preparation tests (operands should not be rounded)
+precision: 3
+rounding: half_up
+
+fmax3270 fma 1 '12345678900000' 9999999999999 -> '2.23E+13' Inexact Rounded
+fmax3271 fma 1 '9999999999999' 12345678900000 -> '2.23E+13' Inexact Rounded
+
+fmax3272 fma 1 '12E+3' '3444' -> '1.54E+4' Inexact Rounded
+fmax3273 fma 1 '12E+3' '3446' -> '1.54E+4' Inexact Rounded
+fmax3274 fma 1 '12E+3' '3449.9' -> '1.54E+4' Inexact Rounded
+fmax3275 fma 1 '12E+3' '3450.0' -> '1.55E+4' Inexact Rounded
+fmax3276 fma 1 '12E+3' '3450.1' -> '1.55E+4' Inexact Rounded
+fmax3277 fma 1 '12E+3' '3454' -> '1.55E+4' Inexact Rounded
+fmax3278 fma 1 '12E+3' '3456' -> '1.55E+4' Inexact Rounded
+
+fmax3281 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3282 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3283 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3284 fma 1 '3450.0' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3285 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3286 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3287 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded
+
+rounding: half_down
+fmax3291 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3292 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3293 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3294 fma 1 '3450.0' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3295 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3296 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3297 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+fmax3301 fma 1 -1 1 -> 0
+fmax3302 fma 1 0 1 -> 1
+fmax3303 fma 1 1 1 -> 2
+fmax3304 fma 1 12 1 -> 13
+fmax3305 fma 1 98 1 -> 99
+fmax3306 fma 1 99 1 -> 100
+fmax3307 fma 1 100 1 -> 101
+fmax3308 fma 1 101 1 -> 102
+fmax3309 fma 1 -1 -1 -> -2
+fmax3310 fma 1 0 -1 -> -1
+fmax3311 fma 1 1 -1 -> 0
+fmax3312 fma 1 12 -1 -> 11
+fmax3313 fma 1 98 -1 -> 97
+fmax3314 fma 1 99 -1 -> 98
+fmax3315 fma 1 100 -1 -> 99
+fmax3316 fma 1 101 -1 -> 100
+
+fmax3321 fma 1 -0.01 0.01 -> 0.00
+fmax3322 fma 1 0.00 0.01 -> 0.01
+fmax3323 fma 1 0.01 0.01 -> 0.02
+fmax3324 fma 1 0.12 0.01 -> 0.13
+fmax3325 fma 1 0.98 0.01 -> 0.99
+fmax3326 fma 1 0.99 0.01 -> 1.00
+fmax3327 fma 1 1.00 0.01 -> 1.01
+fmax3328 fma 1 1.01 0.01 -> 1.02
+fmax3329 fma 1 -0.01 -0.01 -> -0.02
+fmax3330 fma 1 0.00 -0.01 -> -0.01
+fmax3331 fma 1 0.01 -0.01 -> 0.00
+fmax3332 fma 1 0.12 -0.01 -> 0.11
+fmax3333 fma 1 0.98 -0.01 -> 0.97
+fmax3334 fma 1 0.99 -0.01 -> 0.98
+fmax3335 fma 1 1.00 -0.01 -> 0.99
+fmax3336 fma 1 1.01 -0.01 -> 1.00
+
+-- some more cases where fma 1 ing 0 affects the coefficient
+precision: 9
+fmax3340 fma 1 1E+3 0 -> 1000
+fmax3341 fma 1 1E+8 0 -> 100000000
+fmax3342 fma 1 1E+9 0 -> 1.00000000E+9 Rounded
+fmax3343 fma 1 1E+10 0 -> 1.00000000E+10 Rounded
+-- which simply follow from these cases ...
+fmax3344 fma 1 1E+3 1 -> 1001
+fmax3345 fma 1 1E+8 1 -> 100000001
+fmax3346 fma 1 1E+9 1 -> 1.00000000E+9 Inexact Rounded
+fmax3347 fma 1 1E+10 1 -> 1.00000000E+10 Inexact Rounded
+fmax3348 fma 1 1E+3 7 -> 1007
+fmax3349 fma 1 1E+8 7 -> 100000007
+fmax3350 fma 1 1E+9 7 -> 1.00000001E+9 Inexact Rounded
+fmax3351 fma 1 1E+10 7 -> 1.00000000E+10 Inexact Rounded
+
+-- tryzeros cases
+precision: 7
+rounding: half_up
+maxExponent: 92
+minexponent: -92
+fmax3361 fma 1 0E+50 10000E+1 -> 1.0000E+5
+fmax3362 fma 1 10000E+1 0E-50 -> 100000.0 Rounded
+fmax3363 fma 1 10000E+1 10000E-50 -> 100000.0 Rounded Inexact
+fmax3364 fma 1 9.999999E+92 -9.999999E+92 -> 0E+86
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+precision: 10
+fmax3370 fma 1 99999999 81512 -> 100081511
+precision: 6
+fmax3371 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
+rounding: half_up
+precision: 10
+fmax3372 fma 1 99999999 81512 -> 100081511
+precision: 6
+fmax3373 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
+rounding: half_even
+precision: 10
+fmax3374 fma 1 99999999 81512 -> 100081511
+precision: 6
+fmax3375 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
+
+-- ulp replacement tests
+precision: 9
+maxexponent: 999999
+minexponent: -999999
+fmax3400 fma 1 1 77e-7 -> 1.0000077
+fmax3401 fma 1 1 77e-8 -> 1.00000077
+fmax3402 fma 1 1 77e-9 -> 1.00000008 Inexact Rounded
+fmax3403 fma 1 1 77e-10 -> 1.00000001 Inexact Rounded
+fmax3404 fma 1 1 77e-11 -> 1.00000000 Inexact Rounded
+fmax3405 fma 1 1 77e-12 -> 1.00000000 Inexact Rounded
+fmax3406 fma 1 1 77e-999 -> 1.00000000 Inexact Rounded
+fmax3407 fma 1 1 77e-999999 -> 1.00000000 Inexact Rounded
+
+fmax3410 fma 1 10 77e-7 -> 10.0000077
+fmax3411 fma 1 10 77e-8 -> 10.0000008 Inexact Rounded
+fmax3412 fma 1 10 77e-9 -> 10.0000001 Inexact Rounded
+fmax3413 fma 1 10 77e-10 -> 10.0000000 Inexact Rounded
+fmax3414 fma 1 10 77e-11 -> 10.0000000 Inexact Rounded
+fmax3415 fma 1 10 77e-12 -> 10.0000000 Inexact Rounded
+fmax3416 fma 1 10 77e-999 -> 10.0000000 Inexact Rounded
+fmax3417 fma 1 10 77e-999999 -> 10.0000000 Inexact Rounded
+
+fmax3420 fma 1 77e-7 1 -> 1.0000077
+fmax3421 fma 1 77e-8 1 -> 1.00000077
+fmax3422 fma 1 77e-9 1 -> 1.00000008 Inexact Rounded
+fmax3423 fma 1 77e-10 1 -> 1.00000001 Inexact Rounded
+fmax3424 fma 1 77e-11 1 -> 1.00000000 Inexact Rounded
+fmax3425 fma 1 77e-12 1 -> 1.00000000 Inexact Rounded
+fmax3426 fma 1 77e-999 1 -> 1.00000000 Inexact Rounded
+fmax3427 fma 1 77e-999999 1 -> 1.00000000 Inexact Rounded
+
+fmax3430 fma 1 77e-7 10 -> 10.0000077
+fmax3431 fma 1 77e-8 10 -> 10.0000008 Inexact Rounded
+fmax3432 fma 1 77e-9 10 -> 10.0000001 Inexact Rounded
+fmax3433 fma 1 77e-10 10 -> 10.0000000 Inexact Rounded
+fmax3434 fma 1 77e-11 10 -> 10.0000000 Inexact Rounded
+fmax3435 fma 1 77e-12 10 -> 10.0000000 Inexact Rounded
+fmax3436 fma 1 77e-999 10 -> 10.0000000 Inexact Rounded
+fmax3437 fma 1 77e-999999 10 -> 10.0000000 Inexact Rounded
+
+-- negative ulps
+fmax3440 fma 1 1 -77e-7 -> 0.9999923
+fmax3441 fma 1 1 -77e-8 -> 0.99999923
+fmax3442 fma 1 1 -77e-9 -> 0.999999923
+fmax3443 fma 1 1 -77e-10 -> 0.999999992 Inexact Rounded
+fmax3444 fma 1 1 -77e-11 -> 0.999999999 Inexact Rounded
+fmax3445 fma 1 1 -77e-12 -> 1.00000000 Inexact Rounded
+fmax3446 fma 1 1 -77e-999 -> 1.00000000 Inexact Rounded
+fmax3447 fma 1 1 -77e-999999 -> 1.00000000 Inexact Rounded
+
+fmax3450 fma 1 10 -77e-7 -> 9.9999923
+fmax3451 fma 1 10 -77e-8 -> 9.99999923
+fmax3452 fma 1 10 -77e-9 -> 9.99999992 Inexact Rounded
+fmax3453 fma 1 10 -77e-10 -> 9.99999999 Inexact Rounded
+fmax3454 fma 1 10 -77e-11 -> 10.0000000 Inexact Rounded
+fmax3455 fma 1 10 -77e-12 -> 10.0000000 Inexact Rounded
+fmax3456 fma 1 10 -77e-999 -> 10.0000000 Inexact Rounded
+fmax3457 fma 1 10 -77e-999999 -> 10.0000000 Inexact Rounded
+
+fmax3460 fma 1 -77e-7 1 -> 0.9999923
+fmax3461 fma 1 -77e-8 1 -> 0.99999923
+fmax3462 fma 1 -77e-9 1 -> 0.999999923
+fmax3463 fma 1 -77e-10 1 -> 0.999999992 Inexact Rounded
+fmax3464 fma 1 -77e-11 1 -> 0.999999999 Inexact Rounded
+fmax3465 fma 1 -77e-12 1 -> 1.00000000 Inexact Rounded
+fmax3466 fma 1 -77e-999 1 -> 1.00000000 Inexact Rounded
+fmax3467 fma 1 -77e-999999 1 -> 1.00000000 Inexact Rounded
+
+fmax3470 fma 1 -77e-7 10 -> 9.9999923
+fmax3471 fma 1 -77e-8 10 -> 9.99999923
+fmax3472 fma 1 -77e-9 10 -> 9.99999992 Inexact Rounded
+fmax3473 fma 1 -77e-10 10 -> 9.99999999 Inexact Rounded
+fmax3474 fma 1 -77e-11 10 -> 10.0000000 Inexact Rounded
+fmax3475 fma 1 -77e-12 10 -> 10.0000000 Inexact Rounded
+fmax3476 fma 1 -77e-999 10 -> 10.0000000 Inexact Rounded
+fmax3477 fma 1 -77e-999999 10 -> 10.0000000 Inexact Rounded
+
+-- negative ulps
+fmax3480 fma 1 -1 77e-7 -> -0.9999923
+fmax3481 fma 1 -1 77e-8 -> -0.99999923
+fmax3482 fma 1 -1 77e-9 -> -0.999999923
+fmax3483 fma 1 -1 77e-10 -> -0.999999992 Inexact Rounded
+fmax3484 fma 1 -1 77e-11 -> -0.999999999 Inexact Rounded
+fmax3485 fma 1 -1 77e-12 -> -1.00000000 Inexact Rounded
+fmax3486 fma 1 -1 77e-999 -> -1.00000000 Inexact Rounded
+fmax3487 fma 1 -1 77e-999999 -> -1.00000000 Inexact Rounded
+
+fmax3490 fma 1 -10 77e-7 -> -9.9999923
+fmax3491 fma 1 -10 77e-8 -> -9.99999923
+fmax3492 fma 1 -10 77e-9 -> -9.99999992 Inexact Rounded
+fmax3493 fma 1 -10 77e-10 -> -9.99999999 Inexact Rounded
+fmax3494 fma 1 -10 77e-11 -> -10.0000000 Inexact Rounded
+fmax3495 fma 1 -10 77e-12 -> -10.0000000 Inexact Rounded
+fmax3496 fma 1 -10 77e-999 -> -10.0000000 Inexact Rounded
+fmax3497 fma 1 -10 77e-999999 -> -10.0000000 Inexact Rounded
+
+fmax3500 fma 1 77e-7 -1 -> -0.9999923
+fmax3501 fma 1 77e-8 -1 -> -0.99999923
+fmax3502 fma 1 77e-9 -1 -> -0.999999923
+fmax3503 fma 1 77e-10 -1 -> -0.999999992 Inexact Rounded
+fmax3504 fma 1 77e-11 -1 -> -0.999999999 Inexact Rounded
+fmax3505 fma 1 77e-12 -1 -> -1.00000000 Inexact Rounded
+fmax3506 fma 1 77e-999 -1 -> -1.00000000 Inexact Rounded
+fmax3507 fma 1 77e-999999 -1 -> -1.00000000 Inexact Rounded
+
+fmax3510 fma 1 77e-7 -10 -> -9.9999923
+fmax3511 fma 1 77e-8 -10 -> -9.99999923
+fmax3512 fma 1 77e-9 -10 -> -9.99999992 Inexact Rounded
+fmax3513 fma 1 77e-10 -10 -> -9.99999999 Inexact Rounded
+fmax3514 fma 1 77e-11 -10 -> -10.0000000 Inexact Rounded
+fmax3515 fma 1 77e-12 -10 -> -10.0000000 Inexact Rounded
+fmax3516 fma 1 77e-999 -10 -> -10.0000000 Inexact Rounded
+fmax3517 fma 1 77e-999999 -10 -> -10.0000000 Inexact Rounded
+
+
+-- long operands
+maxexponent: 999
+minexponent: -999
+precision: 9
+fmax3521 fma 1 12345678000 0 -> 1.23456780E+10 Rounded
+fmax3522 fma 1 0 12345678000 -> 1.23456780E+10 Rounded
+fmax3523 fma 1 1234567800 0 -> 1.23456780E+9 Rounded
+fmax3524 fma 1 0 1234567800 -> 1.23456780E+9 Rounded
+fmax3525 fma 1 1234567890 0 -> 1.23456789E+9 Rounded
+fmax3526 fma 1 0 1234567890 -> 1.23456789E+9 Rounded
+fmax3527 fma 1 1234567891 0 -> 1.23456789E+9 Inexact Rounded
+fmax3528 fma 1 0 1234567891 -> 1.23456789E+9 Inexact Rounded
+fmax3529 fma 1 12345678901 0 -> 1.23456789E+10 Inexact Rounded
+fmax3530 fma 1 0 12345678901 -> 1.23456789E+10 Inexact Rounded
+fmax3531 fma 1 1234567896 0 -> 1.23456790E+9 Inexact Rounded
+fmax3532 fma 1 0 1234567896 -> 1.23456790E+9 Inexact Rounded
+
+precision: 15
+-- still checking
+fmax3541 fma 1 12345678000 0 -> 12345678000
+fmax3542 fma 1 0 12345678000 -> 12345678000
+fmax3543 fma 1 1234567800 0 -> 1234567800
+fmax3544 fma 1 0 1234567800 -> 1234567800
+fmax3545 fma 1 1234567890 0 -> 1234567890
+fmax3546 fma 1 0 1234567890 -> 1234567890
+fmax3547 fma 1 1234567891 0 -> 1234567891
+fmax3548 fma 1 0 1234567891 -> 1234567891
+fmax3549 fma 1 12345678901 0 -> 12345678901
+fmax3550 fma 1 0 12345678901 -> 12345678901
+fmax3551 fma 1 1234567896 0 -> 1234567896
+fmax3552 fma 1 0 1234567896 -> 1234567896
+
+-- verify a query
+precision: 16
+maxExponent: +394
+minExponent: -393
+rounding: down
+fmax3561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
+fmax3562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
+-- and using decimal64 bounds...
+precision: 16
+maxExponent: +384
+minExponent: -383
+rounding: down
+fmax3563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
+fmax3564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
+
+
+-- some more residue effects with extreme rounding
+precision: 9
+rounding: half_up
+fmax3601 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+rounding: half_even
+fmax3602 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+rounding: half_down
+fmax3603 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+rounding: floor
+fmax3604 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+rounding: ceiling
+fmax3605 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded
+rounding: up
+fmax3606 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded
+rounding: down
+fmax3607 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+
+rounding: half_up
+fmax3611 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: half_even
+fmax3612 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: half_down
+fmax3613 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: floor
+fmax3614 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded
+rounding: ceiling
+fmax3615 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: up
+fmax3616 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: down
+fmax3617 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded
+
+rounding: half_up
+fmax3621 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+rounding: half_even
+fmax3622 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+rounding: half_down
+fmax3623 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+rounding: floor
+fmax3624 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+rounding: ceiling
+fmax3625 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded
+rounding: up
+fmax3626 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded
+rounding: down
+fmax3627 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+
+rounding: half_up
+fmax3631 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: half_even
+fmax3632 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: half_down
+fmax3633 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: floor
+fmax3634 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded
+rounding: ceiling
+fmax3635 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: up
+fmax3636 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: down
+fmax3637 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded
+
+rounding: half_up
+fmax3641 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: half_even
+fmax3642 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: half_down
+fmax3643 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: floor
+fmax3644 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded
+rounding: ceiling
+fmax3645 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: up
+fmax3646 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: down
+fmax3647 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded
+
+rounding: half_up
+fmax3651 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+rounding: half_even
+fmax3652 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+rounding: half_down
+fmax3653 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+rounding: floor
+fmax3654 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+rounding: ceiling
+fmax3655 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded
+rounding: up
+fmax3656 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded
+rounding: down
+fmax3657 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+
+-- long operand triangle
+rounding: half_up
+precision: 37
+fmax3660 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114834538
+precision: 36
+fmax3661 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483454 Inexact Rounded
+precision: 35
+fmax3662 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148345 Inexact Rounded
+precision: 34
+fmax3663 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114835 Inexact Rounded
+precision: 33
+fmax3664 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483 Inexact Rounded
+precision: 32
+fmax3665 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148 Inexact Rounded
+precision: 31
+fmax3666 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded
+precision: 30
+fmax3667 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711 Inexact Rounded
+precision: 29
+fmax3668 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371 Inexact Rounded
+precision: 28
+fmax3669 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337 Inexact Rounded
+precision: 27
+fmax3670 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892234 Inexact Rounded
+precision: 26
+fmax3671 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223 Inexact Rounded
+precision: 25
+fmax3672 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922 Inexact Rounded
+precision: 24
+fmax3673 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892 Inexact Rounded
+precision: 23
+fmax3674 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389 Inexact Rounded
+precision: 22
+fmax3675 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023639 Inexact Rounded
+precision: 21
+fmax3676 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102364 Inexact Rounded
+precision: 20
+fmax3677 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236 Inexact Rounded
+precision: 19
+fmax3678 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211024 Inexact Rounded
+precision: 18
+fmax3679 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102 Inexact Rounded
+precision: 17
+fmax3680 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110 Inexact Rounded
+precision: 16
+fmax3681 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211 Inexact Rounded
+precision: 15
+fmax3682 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221 Inexact Rounded
+precision: 14
+fmax3683 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422 Inexact Rounded
+precision: 13
+fmax3684 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42 Inexact Rounded
+precision: 12
+fmax3685 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4 Inexact Rounded
+precision: 11
+fmax3686 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166 Inexact Rounded
+precision: 10
+fmax3687 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117417E+10 Inexact Rounded
+precision: 9
+fmax3688 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84711742E+10 Inexact Rounded
+precision: 8
+fmax3689 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471174E+10 Inexact Rounded
+precision: 7
+fmax3690 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117E+10 Inexact Rounded
+precision: 6
+fmax3691 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84712E+10 Inexact Rounded
+precision: 5
+fmax3692 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471E+10 Inexact Rounded
+precision: 4
+fmax3693 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847E+10 Inexact Rounded
+precision: 3
+fmax3694 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.85E+10 Inexact Rounded
+precision: 2
+fmax3695 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8E+10 Inexact Rounded
+precision: 1
+fmax3696 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1E+11 Inexact Rounded
+
+-- more zeros, etc.
+rounding: half_up
+precision: 9
+
+fmax3701 fma 1 5.00 1.00E-3 -> 5.00100
+fmax3702 fma 1 00.00 0.000 -> 0.000
+fmax3703 fma 1 00.00 0E-3 -> 0.000
+fmax3704 fma 1 0E-3 00.00 -> 0.000
+
+fmax3710 fma 1 0E+3 00.00 -> 0.00
+fmax3711 fma 1 0E+3 00.0 -> 0.0
+fmax3712 fma 1 0E+3 00. -> 0
+fmax3713 fma 1 0E+3 00.E+1 -> 0E+1
+fmax3714 fma 1 0E+3 00.E+2 -> 0E+2
+fmax3715 fma 1 0E+3 00.E+3 -> 0E+3
+fmax3716 fma 1 0E+3 00.E+4 -> 0E+3
+fmax3717 fma 1 0E+3 00.E+5 -> 0E+3
+fmax3718 fma 1 0E+3 -00.0 -> 0.0
+fmax3719 fma 1 0E+3 -00. -> 0
+fmax3731 fma 1 0E+3 -00.E+1 -> 0E+1
+
+fmax3720 fma 1 00.00 0E+3 -> 0.00
+fmax3721 fma 1 00.0 0E+3 -> 0.0
+fmax3722 fma 1 00. 0E+3 -> 0
+fmax3723 fma 1 00.E+1 0E+3 -> 0E+1
+fmax3724 fma 1 00.E+2 0E+3 -> 0E+2
+fmax3725 fma 1 00.E+3 0E+3 -> 0E+3
+fmax3726 fma 1 00.E+4 0E+3 -> 0E+3
+fmax3727 fma 1 00.E+5 0E+3 -> 0E+3
+fmax3728 fma 1 -00.00 0E+3 -> 0.00
+fmax3729 fma 1 -00.0 0E+3 -> 0.0
+fmax3730 fma 1 -00. 0E+3 -> 0
+
+fmax3732 fma 1 0 0 -> 0
+fmax3733 fma 1 0 -0 -> 0
+fmax3734 fma 1 -0 0 -> 0
+fmax3735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
+
+fmax3736 fma 1 1 -1 -> 0
+fmax3737 fma 1 -1 -1 -> -2
+fmax3738 fma 1 1 1 -> 2
+fmax3739 fma 1 -1 1 -> 0
+
+fmax3741 fma 1 0 -1 -> -1
+fmax3742 fma 1 -0 -1 -> -1
+fmax3743 fma 1 0 1 -> 1
+fmax3744 fma 1 -0 1 -> 1
+fmax3745 fma 1 -1 0 -> -1
+fmax3746 fma 1 -1 -0 -> -1
+fmax3747 fma 1 1 0 -> 1
+fmax3748 fma 1 1 -0 -> 1
+
+fmax3751 fma 1 0.0 -1 -> -1.0
+fmax3752 fma 1 -0.0 -1 -> -1.0
+fmax3753 fma 1 0.0 1 -> 1.0
+fmax3754 fma 1 -0.0 1 -> 1.0
+fmax3755 fma 1 -1.0 0 -> -1.0
+fmax3756 fma 1 -1.0 -0 -> -1.0
+fmax3757 fma 1 1.0 0 -> 1.0
+fmax3758 fma 1 1.0 -0 -> 1.0
+
+fmax3761 fma 1 0 -1.0 -> -1.0
+fmax3762 fma 1 -0 -1.0 -> -1.0
+fmax3763 fma 1 0 1.0 -> 1.0
+fmax3764 fma 1 -0 1.0 -> 1.0
+fmax3765 fma 1 -1 0.0 -> -1.0
+fmax3766 fma 1 -1 -0.0 -> -1.0
+fmax3767 fma 1 1 0.0 -> 1.0
+fmax3768 fma 1 1 -0.0 -> 1.0
+
+fmax3771 fma 1 0.0 -1.0 -> -1.0
+fmax3772 fma 1 -0.0 -1.0 -> -1.0
+fmax3773 fma 1 0.0 1.0 -> 1.0
+fmax3774 fma 1 -0.0 1.0 -> 1.0
+fmax3775 fma 1 -1.0 0.0 -> -1.0
+fmax3776 fma 1 -1.0 -0.0 -> -1.0
+fmax3777 fma 1 1.0 0.0 -> 1.0
+fmax3778 fma 1 1.0 -0.0 -> 1.0
+
+-- Specials
+fmax3780 fma 1 -Inf -Inf -> -Infinity
+fmax3781 fma 1 -Inf -1000 -> -Infinity
+fmax3782 fma 1 -Inf -1 -> -Infinity
+fmax3783 fma 1 -Inf -0 -> -Infinity
+fmax3784 fma 1 -Inf 0 -> -Infinity
+fmax3785 fma 1 -Inf 1 -> -Infinity
+fmax3786 fma 1 -Inf 1000 -> -Infinity
+fmax3787 fma 1 -1000 -Inf -> -Infinity
+fmax3788 fma 1 -Inf -Inf -> -Infinity
+fmax3789 fma 1 -1 -Inf -> -Infinity
+fmax3790 fma 1 -0 -Inf -> -Infinity
+fmax3791 fma 1 0 -Inf -> -Infinity
+fmax3792 fma 1 1 -Inf -> -Infinity
+fmax3793 fma 1 1000 -Inf -> -Infinity
+fmax3794 fma 1 Inf -Inf -> NaN Invalid_operation
+
+fmax3800 fma 1 Inf -Inf -> NaN Invalid_operation
+fmax3801 fma 1 Inf -1000 -> Infinity
+fmax3802 fma 1 Inf -1 -> Infinity
+fmax3803 fma 1 Inf -0 -> Infinity
+fmax3804 fma 1 Inf 0 -> Infinity
+fmax3805 fma 1 Inf 1 -> Infinity
+fmax3806 fma 1 Inf 1000 -> Infinity
+fmax3807 fma 1 Inf Inf -> Infinity
+fmax3808 fma 1 -1000 Inf -> Infinity
+fmax3809 fma 1 -Inf Inf -> NaN Invalid_operation
+fmax3810 fma 1 -1 Inf -> Infinity
+fmax3811 fma 1 -0 Inf -> Infinity
+fmax3812 fma 1 0 Inf -> Infinity
+fmax3813 fma 1 1 Inf -> Infinity
+fmax3814 fma 1 1000 Inf -> Infinity
+fmax3815 fma 1 Inf Inf -> Infinity
+
+fmax3821 fma 1 NaN -Inf -> NaN
+fmax3822 fma 1 NaN -1000 -> NaN
+fmax3823 fma 1 NaN -1 -> NaN
+fmax3824 fma 1 NaN -0 -> NaN
+fmax3825 fma 1 NaN 0 -> NaN
+fmax3826 fma 1 NaN 1 -> NaN
+fmax3827 fma 1 NaN 1000 -> NaN
+fmax3828 fma 1 NaN Inf -> NaN
+fmax3829 fma 1 NaN NaN -> NaN
+fmax3830 fma 1 -Inf NaN -> NaN
+fmax3831 fma 1 -1000 NaN -> NaN
+fmax3832 fma 1 -1 NaN -> NaN
+fmax3833 fma 1 -0 NaN -> NaN
+fmax3834 fma 1 0 NaN -> NaN
+fmax3835 fma 1 1 NaN -> NaN
+fmax3836 fma 1 1000 NaN -> NaN
+fmax3837 fma 1 Inf NaN -> NaN
+
+fmax3841 fma 1 sNaN -Inf -> NaN Invalid_operation
+fmax3842 fma 1 sNaN -1000 -> NaN Invalid_operation
+fmax3843 fma 1 sNaN -1 -> NaN Invalid_operation
+fmax3844 fma 1 sNaN -0 -> NaN Invalid_operation
+fmax3845 fma 1 sNaN 0 -> NaN Invalid_operation
+fmax3846 fma 1 sNaN 1 -> NaN Invalid_operation
+fmax3847 fma 1 sNaN 1000 -> NaN Invalid_operation
+fmax3848 fma 1 sNaN NaN -> NaN Invalid_operation
+fmax3849 fma 1 sNaN sNaN -> NaN Invalid_operation
+fmax3850 fma 1 NaN sNaN -> NaN Invalid_operation
+fmax3851 fma 1 -Inf sNaN -> NaN Invalid_operation
+fmax3852 fma 1 -1000 sNaN -> NaN Invalid_operation
+fmax3853 fma 1 -1 sNaN -> NaN Invalid_operation
+fmax3854 fma 1 -0 sNaN -> NaN Invalid_operation
+fmax3855 fma 1 0 sNaN -> NaN Invalid_operation
+fmax3856 fma 1 1 sNaN -> NaN Invalid_operation
+fmax3857 fma 1 1000 sNaN -> NaN Invalid_operation
+fmax3858 fma 1 Inf sNaN -> NaN Invalid_operation
+fmax3859 fma 1 NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+fmax3861 fma 1 NaN1 -Inf -> NaN1
+fmax3862 fma 1 +NaN2 -1000 -> NaN2
+fmax3863 fma 1 NaN3 1000 -> NaN3
+fmax3864 fma 1 NaN4 Inf -> NaN4
+fmax3865 fma 1 NaN5 +NaN6 -> NaN5
+fmax3866 fma 1 -Inf NaN7 -> NaN7
+fmax3867 fma 1 -1000 NaN8 -> NaN8
+fmax3868 fma 1 1000 NaN9 -> NaN9
+fmax3869 fma 1 Inf +NaN10 -> NaN10
+fmax3871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
+fmax3872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
+fmax3873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
+fmax3874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
+fmax3875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
+fmax3876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
+fmax3877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
+fmax3878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
+fmax3879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
+fmax3880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
+fmax3881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
+fmax3882 fma 1 -NaN26 NaN28 -> -NaN26
+fmax3883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+fmax3884 fma 1 1000 -NaN30 -> -NaN30
+fmax3885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- overflow, underflow and subnormal tests
+maxexponent: 999999
+minexponent: -999999
+precision: 9
+fmax3890 fma 1 1E+999999 9E+999999 -> Infinity Overflow Inexact Rounded
+fmax3891 fma 1 9E+999999 1E+999999 -> Infinity Overflow Inexact Rounded
+fmax3892 fma 1 -1.1E-999999 1E-999999 -> -1E-1000000 Subnormal
+fmax3893 fma 1 1E-999999 -1.1e-999999 -> -1E-1000000 Subnormal
+fmax3894 fma 1 -1.0001E-999999 1E-999999 -> -1E-1000003 Subnormal
+fmax3895 fma 1 1E-999999 -1.0001e-999999 -> -1E-1000003 Subnormal
+fmax3896 fma 1 -1E+999999 -9E+999999 -> -Infinity Overflow Inexact Rounded
+fmax3897 fma 1 -9E+999999 -1E+999999 -> -Infinity Overflow Inexact Rounded
+fmax3898 fma 1 +1.1E-999999 -1E-999999 -> 1E-1000000 Subnormal
+fmax3899 fma 1 -1E-999999 +1.1e-999999 -> 1E-1000000 Subnormal
+fmax3900 fma 1 +1.0001E-999999 -1E-999999 -> 1E-1000003 Subnormal
+fmax3901 fma 1 -1E-999999 +1.0001e-999999 -> 1E-1000003 Subnormal
+fmax3902 fma 1 -1E+999999 +9E+999999 -> 8E+999999
+fmax3903 fma 1 -9E+999999 +1E+999999 -> -8E+999999
+
+precision: 3
+fmax3904 fma 1 0 -9.999E+999999 -> -Infinity Inexact Overflow Rounded
+fmax3905 fma 1 -9.999E+999999 0 -> -Infinity Inexact Overflow Rounded
+fmax3906 fma 1 0 9.999E+999999 -> Infinity Inexact Overflow Rounded
+fmax3907 fma 1 9.999E+999999 0 -> Infinity Inexact Overflow Rounded
+
+precision: 3
+maxexponent: 999
+minexponent: -999
+fmax3910 fma 1 1.00E-999 0 -> 1.00E-999
+fmax3911 fma 1 0.1E-999 0 -> 1E-1000 Subnormal
+fmax3912 fma 1 0.10E-999 0 -> 1.0E-1000 Subnormal
+fmax3913 fma 1 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded
+fmax3914 fma 1 0.01E-999 0 -> 1E-1001 Subnormal
+-- next is rounded to Nmin
+fmax3915 fma 1 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow
+fmax3916 fma 1 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3917 fma 1 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow
+fmax3918 fma 1 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3919 fma 1 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3920 fma 1 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+
+fmax3930 fma 1 -1.00E-999 0 -> -1.00E-999
+fmax3931 fma 1 -0.1E-999 0 -> -1E-1000 Subnormal
+fmax3932 fma 1 -0.10E-999 0 -> -1.0E-1000 Subnormal
+fmax3933 fma 1 -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded
+fmax3934 fma 1 -0.01E-999 0 -> -1E-1001 Subnormal
+-- next is rounded to Nmin
+fmax3935 fma 1 -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow
+fmax3936 fma 1 -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3937 fma 1 -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow
+fmax3938 fma 1 -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3939 fma 1 -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3940 fma 1 -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+
+-- some non-zero subnormal fma 1 s
+fmax3950 fma 1 1.00E-999 0.1E-999 -> 1.10E-999
+fmax3951 fma 1 0.1E-999 0.1E-999 -> 2E-1000 Subnormal
+fmax3952 fma 1 0.10E-999 0.1E-999 -> 2.0E-1000 Subnormal
+fmax3953 fma 1 0.100E-999 0.1E-999 -> 2.0E-1000 Subnormal Rounded
+fmax3954 fma 1 0.01E-999 0.1E-999 -> 1.1E-1000 Subnormal
+fmax3955 fma 1 0.999E-999 0.1E-999 -> 1.10E-999 Inexact Rounded
+fmax3956 fma 1 0.099E-999 0.1E-999 -> 2.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3957 fma 1 0.009E-999 0.1E-999 -> 1.1E-1000 Inexact Rounded Subnormal Underflow
+fmax3958 fma 1 0.001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3959 fma 1 0.0009E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3960 fma 1 0.0001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+-- negatives...
+fmax3961 fma 1 1.00E-999 -0.1E-999 -> 9.0E-1000 Subnormal
+fmax3962 fma 1 0.1E-999 -0.1E-999 -> 0E-1000
+fmax3963 fma 1 0.10E-999 -0.1E-999 -> 0E-1001
+fmax3964 fma 1 0.100E-999 -0.1E-999 -> 0E-1001 Clamped
+fmax3965 fma 1 0.01E-999 -0.1E-999 -> -9E-1001 Subnormal
+fmax3966 fma 1 0.999E-999 -0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3967 fma 1 0.099E-999 -0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3968 fma 1 0.009E-999 -0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow
+fmax3969 fma 1 0.001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3970 fma 1 0.0009E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3971 fma 1 0.0001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+
+-- some 'real' numbers
+maxExponent: 384
+minExponent: -383
+precision: 8
+fmax3566 fma 1 99999061735E-394 0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal
+precision: 7
+fmax3567 fma 1 99999061735E-394 0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
+precision: 6
+fmax3568 fma 1 99999061735E-394 0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal
+
+-- now the case where we can get underflow but the result is normal
+-- [note this can't happen if the operands are also bounded, as we
+-- cannot represent 1E-399, for example]
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+fmax3571 fma 1 1E-383 0 -> 1E-383
+fmax3572 fma 1 1E-384 0 -> 1E-384 Subnormal
+fmax3573 fma 1 1E-383 1E-384 -> 1.1E-383
+fmax3574 subtract 1E-383 1E-384 -> 9E-384 Subnormal
+
+-- Here we explore the boundary of rounding a subnormal to Nmin
+fmax3575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
+fmax3576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
+fmax3577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax3578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax3579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax3580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+-- check for double-rounded subnormals
+precision: 5
+maxexponent: 79
+minexponent: -79
+-- Add: lhs and rhs 0
+fmax31001 fma 1 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31002 fma 1 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31003 fma 1 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31004 fma 1 0 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31005 fma 1 0 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31006 fma 1 0 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+
+-- Add: lhs >> rhs and vice versa
+fmax31011 fma 1 1.52444E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31012 fma 1 1.52445E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31013 fma 1 1.52446E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31014 fma 1 1E-100 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31015 fma 1 1E-100 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31016 fma 1 1E-100 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+
+-- Add: lhs + rhs fma 1 ition carried out
+fmax31021 fma 1 1.52443E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31022 fma 1 1.52444E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31023 fma 1 1.52445E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31024 fma 1 1.00001E-80 1.52443E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31025 fma 1 1.00001E-80 1.52444E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31026 fma 1 1.00001E-80 1.52445E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+
+-- And for round down full and subnormal results
+precision: 16
+maxExponent: +384
+minExponent: -383
+rounding: down
+
+fmax31100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
+fmax31101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
+fmax31103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
+fmax31104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
+fmax31105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
+fmax31106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
+fmax31107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
+fmax31108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
+fmax31109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+fmax31110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
+fmax31111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
+fmax31113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
+fmax31114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
+fmax31115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
+fmax31116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
+fmax31117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
+fmax31118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
+fmax31119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
+
+rounding: down
+precision: 7
+maxExponent: +96
+minExponent: -95
+fmax31130 fma 1 1 -1e-200 -> 0.9999999 Rounded Inexact
+-- subnormal boundary
+fmax31131 fma 1 1.000000E-94 -1e-200 -> 9.999999E-95 Rounded Inexact
+fmax31132 fma 1 1.000001E-95 -1e-200 -> 1.000000E-95 Rounded Inexact
+fmax31133 fma 1 1.000000E-95 -1e-200 -> 9.99999E-96 Rounded Inexact Subnormal Underflow
+fmax31134 fma 1 0.999999E-95 -1e-200 -> 9.99998E-96 Rounded Inexact Subnormal Underflow
+fmax31135 fma 1 0.001000E-95 -1e-200 -> 9.99E-99 Rounded Inexact Subnormal Underflow
+fmax31136 fma 1 0.000999E-95 -1e-200 -> 9.98E-99 Rounded Inexact Subnormal Underflow
+fmax31137 fma 1 1.000000E-95 -1e-101 -> 9.99999E-96 Subnormal
+fmax31138 fma 1 10000E-101 -1e-200 -> 9.999E-98 Subnormal Inexact Rounded Underflow
+fmax31139 fma 1 1000E-101 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow
+fmax31140 fma 1 100E-101 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow
+fmax31141 fma 1 10E-101 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow
+fmax31142 fma 1 1E-101 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31143 fma 1 0E-101 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31144 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+
+fmax31151 fma 1 10000E-102 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow
+fmax31152 fma 1 1000E-102 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow
+fmax31153 fma 1 100E-102 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow
+fmax31154 fma 1 10E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31155 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31156 fma 1 0E-102 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31157 fma 1 1E-103 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+
+fmax31160 fma 1 100E-105 -1e-101 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31161 fma 1 100E-105 -1e-201 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+
+-- tests based on Gunnar Degnbol's edge case
+precision: 15
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+fmax31200 fma 1 1E15 -0.5 -> 1.00000000000000E+15 Inexact Rounded
+fmax31201 fma 1 1E15 -0.50 -> 1.00000000000000E+15 Inexact Rounded
+fmax31210 fma 1 1E15 -0.51 -> 999999999999999 Inexact Rounded
+fmax31211 fma 1 1E15 -0.501 -> 999999999999999 Inexact Rounded
+fmax31212 fma 1 1E15 -0.5001 -> 999999999999999 Inexact Rounded
+fmax31213 fma 1 1E15 -0.50001 -> 999999999999999 Inexact Rounded
+fmax31214 fma 1 1E15 -0.500001 -> 999999999999999 Inexact Rounded
+fmax31215 fma 1 1E15 -0.5000001 -> 999999999999999 Inexact Rounded
+fmax31216 fma 1 1E15 -0.50000001 -> 999999999999999 Inexact Rounded
+fmax31217 fma 1 1E15 -0.500000001 -> 999999999999999 Inexact Rounded
+fmax31218 fma 1 1E15 -0.5000000001 -> 999999999999999 Inexact Rounded
+fmax31219 fma 1 1E15 -0.50000000001 -> 999999999999999 Inexact Rounded
+fmax31220 fma 1 1E15 -0.500000000001 -> 999999999999999 Inexact Rounded
+fmax31221 fma 1 1E15 -0.5000000000001 -> 999999999999999 Inexact Rounded
+fmax31222 fma 1 1E15 -0.50000000000001 -> 999999999999999 Inexact Rounded
+fmax31223 fma 1 1E15 -0.500000000000001 -> 999999999999999 Inexact Rounded
+fmax31224 fma 1 1E15 -0.5000000000000001 -> 999999999999999 Inexact Rounded
+fmax31225 fma 1 1E15 -0.5000000000000000 -> 1.00000000000000E+15 Inexact Rounded
+fmax31230 fma 1 1E15 -5000000.000000001 -> 999999995000000 Inexact Rounded
+
+precision: 16
+
+fmax31300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
+fmax31310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
+fmax31311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
+fmax31312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
+fmax31313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
+fmax31314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
+fmax31315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
+fmax31316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
+fmax31317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
+fmax31318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
+fmax31319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
+fmax31320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
+fmax31321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
+fmax31322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
+fmax31323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
+fmax31324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
+fmax31325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
+fmax31339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
+
+fmax31340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
+fmax31341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
+
+fmax31349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
+fmax31350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
+fmax31351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
+fmax31352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
+fmax31353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
+fmax31354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
+fmax31355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
+fmax31356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
+fmax31357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
+fmax31358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
+fmax31359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
+fmax31360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
+fmax31361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
+fmax31362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
+fmax31363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
+fmax31364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
+fmax31365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
+fmax31380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
+fmax31381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
+fmax31382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
+fmax31396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+precision: 15
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+fmax31400 fma 1 0 1.23456789012345 -> 1.23456789012345
+fmax31401 fma 1 0 1.23456789012345E-1 -> 0.123456789012345
+fmax31402 fma 1 0 1.23456789012345E-2 -> 0.0123456789012345
+fmax31403 fma 1 0 1.23456789012345E-3 -> 0.00123456789012345
+fmax31404 fma 1 0 1.23456789012345E-4 -> 0.000123456789012345
+fmax31405 fma 1 0 1.23456789012345E-5 -> 0.0000123456789012345
+fmax31406 fma 1 0 1.23456789012345E-6 -> 0.00000123456789012345
+fmax31407 fma 1 0 1.23456789012345E-7 -> 1.23456789012345E-7
+fmax31408 fma 1 0 1.23456789012345E-8 -> 1.23456789012345E-8
+fmax31409 fma 1 0 1.23456789012345E-9 -> 1.23456789012345E-9
+fmax31410 fma 1 0 1.23456789012345E-10 -> 1.23456789012345E-10
+fmax31411 fma 1 0 1.23456789012345E-11 -> 1.23456789012345E-11
+fmax31412 fma 1 0 1.23456789012345E-12 -> 1.23456789012345E-12
+fmax31413 fma 1 0 1.23456789012345E-13 -> 1.23456789012345E-13
+fmax31414 fma 1 0 1.23456789012345E-14 -> 1.23456789012345E-14
+fmax31415 fma 1 0 1.23456789012345E-15 -> 1.23456789012345E-15
+fmax31416 fma 1 0 1.23456789012345E-16 -> 1.23456789012345E-16
+fmax31417 fma 1 0 1.23456789012345E-17 -> 1.23456789012345E-17
+fmax31418 fma 1 0 1.23456789012345E-18 -> 1.23456789012345E-18
+fmax31419 fma 1 0 1.23456789012345E-19 -> 1.23456789012345E-19
+
+-- same, precision 16..
+precision: 16
+fmax31420 fma 1 0 1.123456789012345 -> 1.123456789012345
+fmax31421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
+fmax31422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
+fmax31423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
+fmax31424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
+fmax31425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
+fmax31426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
+fmax31427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
+fmax31428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
+fmax31429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
+fmax31430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
+fmax31431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
+fmax31432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
+fmax31433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
+fmax31434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
+fmax31435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
+fmax31436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
+fmax31437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
+fmax31438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
+fmax31439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+fmax31440 fma 1 1.123456789012345 0 -> 1.123456789012345
+fmax31441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
+fmax31442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
+fmax31443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
+fmax31444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
+fmax31445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
+fmax31446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
+fmax31447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
+fmax31448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
+fmax31449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
+fmax31450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
+fmax31451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
+fmax31452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
+fmax31453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
+fmax31454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
+fmax31455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
+fmax31456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
+fmax31457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
+fmax31458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
+fmax31459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+fmax31460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
+fmax31461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
+fmax31462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
+fmax31463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
+fmax31464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
+fmax31465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
+fmax31466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
+fmax31467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
+fmax31468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
+fmax31469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
+fmax31470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
+fmax31471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
+fmax31472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
+fmax31473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
+fmax31474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
+fmax31475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+fmax31476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
+fmax31477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
+fmax31478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
+fmax31479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+precision: 16
+maxExponent: 384
+minexponent: -383
+
+rounding: half_up
+-- exact zeros from zeros
+fmax31500 fma 1 0 0E-19 -> 0E-19
+fmax31501 fma 1 -0 0E-19 -> 0E-19
+fmax31502 fma 1 0 -0E-19 -> 0E-19
+fmax31503 fma 1 -0 -0E-19 -> -0E-19
+fmax31504 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: half_down
+-- exact zeros from zeros
+fmax31520 fma 1 0 0E-19 -> 0E-19
+fmax31521 fma 1 -0 0E-19 -> 0E-19
+fmax31522 fma 1 0 -0E-19 -> 0E-19
+fmax31523 fma 1 -0 -0E-19 -> -0E-19
+fmax31524 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: half_even
+-- exact zeros from zeros
+fmax31540 fma 1 0 0E-19 -> 0E-19
+fmax31541 fma 1 -0 0E-19 -> 0E-19
+fmax31542 fma 1 0 -0E-19 -> 0E-19
+fmax31543 fma 1 -0 -0E-19 -> -0E-19
+fmax31544 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: up
+-- exact zeros from zeros
+fmax31560 fma 1 0 0E-19 -> 0E-19
+fmax31561 fma 1 -0 0E-19 -> 0E-19
+fmax31562 fma 1 0 -0E-19 -> 0E-19
+fmax31563 fma 1 -0 -0E-19 -> -0E-19
+fmax31564 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+fmax31574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+fmax31575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+rounding: down
+-- exact zeros from zeros
+fmax31580 fma 1 0 0E-19 -> 0E-19
+fmax31581 fma 1 -0 0E-19 -> 0E-19
+fmax31582 fma 1 0 -0E-19 -> 0E-19
+fmax31583 fma 1 -0 -0E-19 -> -0E-19
+fmax31584 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: ceiling
+-- exact zeros from zeros
+fmax31600 fma 1 0 0E-19 -> 0E-19
+fmax31601 fma 1 -0 0E-19 -> 0E-19
+fmax31602 fma 1 0 -0E-19 -> 0E-19
+fmax31603 fma 1 -0 -0E-19 -> -0E-19
+fmax31604 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+fmax31620 fma 1 0 0E-19 -> 0E-19
+fmax31621 fma 1 -0 0E-19 -> -0E-19 -- *
+fmax31622 fma 1 0 -0E-19 -> -0E-19 -- *
+fmax31623 fma 1 -0 -0E-19 -> -0E-19
+fmax31624 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- *
+fmax31626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- *
+fmax31627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+fmax31634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+fmax31635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- *
+fmax31637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- *
+fmax31638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+-- BigDecimal problem testcases 2006.01.23
+precision: 16
+maxExponent: 384
+minexponent: -383
+
+rounding: down
+precision: 7
+fmax31651 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 6
+fmax31652 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 5
+fmax31653 fma 1 10001E+2 -2E+1 -> 1.0000E+6 Inexact Rounded
+precision: 4
+fmax31654 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded
+precision: 3
+fmax31655 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded
+precision: 2
+fmax31656 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded
+precision: 1
+fmax31657 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded
+
+rounding: half_even
+precision: 7
+fmax31661 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 6
+fmax31662 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 5
+fmax31663 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded
+precision: 4
+fmax31664 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded
+precision: 3
+fmax31665 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded
+precision: 2
+fmax31666 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded
+precision: 1
+fmax31667 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded
+
+rounding: up
+precision: 7
+fmax31671 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 6
+fmax31672 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 5
+fmax31673 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded
+precision: 4
+fmax31674 fma 1 10001E+2 -2E+1 -> 1.001E+6 Inexact Rounded
+precision: 3
+fmax31675 fma 1 10001E+2 -2E+1 -> 1.01E+6 Inexact Rounded
+precision: 2
+fmax31676 fma 1 10001E+2 -2E+1 -> 1.1E+6 Inexact Rounded
+precision: 1
+fmax31677 fma 1 10001E+2 -2E+1 -> 2E+6 Inexact Rounded
+
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+-- Examples from SQL proposal (Krishna Kulkarni)
+fmax31701 fma 1 130E-2 120E-2 -> 2.50
+fmax31702 fma 1 130E-2 12E-1 -> 2.50
+fmax31703 fma 1 130E-2 1E0 -> 2.30
+fmax31704 fma 1 1E2 1E4 -> 1.01E+4
+fmax31705 subtract 130E-2 120E-2 -> 0.10
+fmax31706 subtract 130E-2 12E-1 -> 0.10
+fmax31707 subtract 130E-2 1E0 -> 0.30
+fmax31708 subtract 1E2 1E4 -> -9.9E+3
+
+------------------------------------------------------------------------
+-- Same as above, using decimal64 default parameters --
+------------------------------------------------------------------------
+precision: 16
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- [first group are 'quick confidence check']
+fmax36001 fma 1 1 1 -> 2
+fmax36002 fma 1 2 3 -> 5
+fmax36003 fma 1 '5.75' '3.3' -> 9.05
+fmax36004 fma 1 '5' '-3' -> 2
+fmax36005 fma 1 '-5' '-3' -> -8
+fmax36006 fma 1 '-7' '2.5' -> -4.5
+fmax36007 fma 1 '0.7' '0.3' -> 1.0
+fmax36008 fma 1 '1.25' '1.25' -> 2.50
+fmax36009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
+fmax36010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
+
+fmax36011 fma 1 '0.44444444444444444' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
+fmax36012 fma 1 '0.44444444444444440' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
+fmax36013 fma 1 '0.44444444444444444' '0.55555555555555550' -> '0.9999999999999999' Inexact Rounded
+fmax36014 fma 1 '0.444444444444444449' '0' -> '0.4444444444444444' Inexact Rounded
+fmax36015 fma 1 '0.4444444444444444499' '0' -> '0.4444444444444444' Inexact Rounded
+fmax36016 fma 1 '0.44444444444444444999' '0' -> '0.4444444444444444' Inexact Rounded
+fmax36017 fma 1 '0.44444444444444445000' '0' -> '0.4444444444444444' Inexact Rounded
+fmax36018 fma 1 '0.44444444444444445001' '0' -> '0.4444444444444445' Inexact Rounded
+fmax36019 fma 1 '0.4444444444444444501' '0' -> '0.4444444444444445' Inexact Rounded
+fmax36020 fma 1 '0.444444444444444451' '0' -> '0.4444444444444445' Inexact Rounded
+
+fmax36021 fma 1 0 1 -> 1
+fmax36022 fma 1 1 1 -> 2
+fmax36023 fma 1 2 1 -> 3
+fmax36024 fma 1 3 1 -> 4
+fmax36025 fma 1 4 1 -> 5
+fmax36026 fma 1 5 1 -> 6
+fmax36027 fma 1 6 1 -> 7
+fmax36028 fma 1 7 1 -> 8
+fmax36029 fma 1 8 1 -> 9
+fmax36030 fma 1 9 1 -> 10
+
+-- some carrying effects
+fmax36031 fma 1 '0.9998' '0.0000' -> '0.9998'
+fmax36032 fma 1 '0.9998' '0.0001' -> '0.9999'
+fmax36033 fma 1 '0.9998' '0.0002' -> '1.0000'
+fmax36034 fma 1 '0.9998' '0.0003' -> '1.0001'
+
+fmax36035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+fmax36036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+fmax36037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+fmax36038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
+fmax36039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
+
+-- symmetry:
+fmax36040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
+fmax36041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
+fmax36042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
+fmax36044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
+fmax36045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
+
+fmax36046 fma 1 '10000e+9' '7' -> '10000000000007'
+fmax36047 fma 1 '10000e+9' '70' -> '10000000000070'
+fmax36048 fma 1 '10000e+9' '700' -> '10000000000700'
+fmax36049 fma 1 '10000e+9' '7000' -> '10000000007000'
+fmax36050 fma 1 '10000e+9' '70000' -> '10000000070000'
+fmax36051 fma 1 '10000e+9' '700000' -> '10000000700000'
+
+-- examples from decarith
+fmax36053 fma 1 '12' '7.00' -> '19.00'
+fmax36054 fma 1 '1.3' '-1.07' -> '0.23'
+fmax36055 fma 1 '1.3' '-1.30' -> '0.00'
+fmax36056 fma 1 '1.3' '-2.07' -> '-0.77'
+fmax36057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
+
+-- from above
+fmax36061 fma 1 1 '0.1' -> '1.1'
+fmax36062 fma 1 1 '0.01' -> '1.01'
+fmax36063 fma 1 1 '0.001' -> '1.001'
+fmax36064 fma 1 1 '0.0001' -> '1.0001'
+fmax36065 fma 1 1 '0.00001' -> '1.00001'
+fmax36066 fma 1 1 '0.000001' -> '1.000001'
+fmax36067 fma 1 1 '0.0000001' -> '1.0000001'
+fmax36068 fma 1 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+fmax36070 fma 1 1 0 -> 1
+fmax36071 fma 1 1 0. -> 1
+fmax36072 fma 1 1 .0 -> 1.0
+fmax36073 fma 1 1 0.0 -> 1.0
+fmax36074 fma 1 1 0.00 -> 1.00
+fmax36075 fma 1 0 1 -> 1
+fmax36076 fma 1 0. 1 -> 1
+fmax36077 fma 1 .0 1 -> 1.0
+fmax36078 fma 1 0.0 1 -> 1.0
+fmax36079 fma 1 0.00 1 -> 1.00
+
+-- some carries
+fmax36080 fma 1 9999999999999998 1 -> 9999999999999999
+fmax36081 fma 1 9999999999999999 1 -> 1.000000000000000E+16 Rounded
+fmax36082 fma 1 999999999999999 1 -> 1000000000000000
+fmax36083 fma 1 9999999999999 1 -> 10000000000000
+fmax36084 fma 1 99999999999 1 -> 100000000000
+fmax36085 fma 1 999999999 1 -> 1000000000
+fmax36086 fma 1 9999999 1 -> 10000000
+fmax36087 fma 1 99999 1 -> 100000
+fmax36088 fma 1 999 1 -> 1000
+fmax36089 fma 1 9 1 -> 10
+
+
+-- more LHS swaps
+fmax36090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
+fmax36091 fma 1 '-56267E-6' 0 -> '-0.056267'
+fmax36092 fma 1 '-56267E-5' 0 -> '-0.56267'
+fmax36093 fma 1 '-56267E-4' 0 -> '-5.6267'
+fmax36094 fma 1 '-56267E-3' 0 -> '-56.267'
+fmax36095 fma 1 '-56267E-2' 0 -> '-562.67'
+fmax36096 fma 1 '-56267E-1' 0 -> '-5626.7'
+fmax36097 fma 1 '-56267E-0' 0 -> '-56267'
+fmax36098 fma 1 '-5E-10' 0 -> '-5E-10'
+fmax36099 fma 1 '-5E-7' 0 -> '-5E-7'
+fmax36100 fma 1 '-5E-6' 0 -> '-0.000005'
+fmax36101 fma 1 '-5E-5' 0 -> '-0.00005'
+fmax36102 fma 1 '-5E-4' 0 -> '-0.0005'
+fmax36103 fma 1 '-5E-1' 0 -> '-0.5'
+fmax36104 fma 1 '-5E0' 0 -> '-5'
+fmax36105 fma 1 '-5E1' 0 -> '-50'
+fmax36106 fma 1 '-5E5' 0 -> '-500000'
+fmax36107 fma 1 '-5E15' 0 -> '-5000000000000000'
+fmax36108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded
+fmax36109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded
+fmax36110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded
+fmax36111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded
+
+-- more RHS swaps
+fmax36113 fma 1 0 '-56267E-10' -> '-0.0000056267'
+fmax36114 fma 1 0 '-56267E-6' -> '-0.056267'
+fmax36116 fma 1 0 '-56267E-5' -> '-0.56267'
+fmax36117 fma 1 0 '-56267E-4' -> '-5.6267'
+fmax36119 fma 1 0 '-56267E-3' -> '-56.267'
+fmax36120 fma 1 0 '-56267E-2' -> '-562.67'
+fmax36121 fma 1 0 '-56267E-1' -> '-5626.7'
+fmax36122 fma 1 0 '-56267E-0' -> '-56267'
+fmax36123 fma 1 0 '-5E-10' -> '-5E-10'
+fmax36124 fma 1 0 '-5E-7' -> '-5E-7'
+fmax36125 fma 1 0 '-5E-6' -> '-0.000005'
+fmax36126 fma 1 0 '-5E-5' -> '-0.00005'
+fmax36127 fma 1 0 '-5E-4' -> '-0.0005'
+fmax36128 fma 1 0 '-5E-1' -> '-0.5'
+fmax36129 fma 1 0 '-5E0' -> '-5'
+fmax36130 fma 1 0 '-5E1' -> '-50'
+fmax36131 fma 1 0 '-5E5' -> '-500000'
+fmax36132 fma 1 0 '-5E15' -> '-5000000000000000'
+fmax36133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded
+fmax36134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded
+fmax36135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded
+fmax36136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded
+
+-- related
+fmax36137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded
+fmax36138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded
+fmax36139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded
+fmax36140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded
+fmax36141 fma 1 1E+11 0.0000 -> '100000000000.0000'
+fmax36142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded
+fmax36143 fma 1 0.000 1E+12 -> '1000000000000.000'
+fmax36144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+fmax36146 fma 1 '00.0' 0 -> '0.0'
+fmax36147 fma 1 '0.00' 0 -> '0.00'
+fmax36148 fma 1 0 '0.00' -> '0.00'
+fmax36149 fma 1 0 '00.0' -> '0.0'
+fmax36150 fma 1 '00.0' '0.00' -> '0.00'
+fmax36151 fma 1 '0.00' '00.0' -> '0.00'
+fmax36152 fma 1 '3' '.3' -> '3.3'
+fmax36153 fma 1 '3.' '.3' -> '3.3'
+fmax36154 fma 1 '3.0' '.3' -> '3.3'
+fmax36155 fma 1 '3.00' '.3' -> '3.30'
+fmax36156 fma 1 '3' '3' -> '6'
+fmax36157 fma 1 '3' '+3' -> '6'
+fmax36158 fma 1 '3' '-3' -> '0'
+fmax36159 fma 1 '0.3' '-0.3' -> '0.0'
+fmax36160 fma 1 '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+fmax36161 fma 1 '1E+13' '-1' -> '9999999999999'
+fmax36162 fma 1 '1E+13' '1.11' -> '10000000000001.11'
+fmax36163 fma 1 '1.11' '1E+13' -> '10000000000001.11'
+fmax36164 fma 1 '-1' '1E+13' -> '9999999999999'
+fmax36165 fma 1 '7E+13' '-1' -> '69999999999999'
+fmax36166 fma 1 '7E+13' '1.11' -> '70000000000001.11'
+fmax36167 fma 1 '1.11' '7E+13' -> '70000000000001.11'
+fmax36168 fma 1 '-1' '7E+13' -> '69999999999999'
+
+-- 1234567890123456 1234567890123456 1 234567890123456
+fmax36170 fma 1 '0.4444444444444444' '0.5555555555555563' -> '1.000000000000001' Inexact Rounded
+fmax36171 fma 1 '0.4444444444444444' '0.5555555555555562' -> '1.000000000000001' Inexact Rounded
+fmax36172 fma 1 '0.4444444444444444' '0.5555555555555561' -> '1.000000000000000' Inexact Rounded
+fmax36173 fma 1 '0.4444444444444444' '0.5555555555555560' -> '1.000000000000000' Inexact Rounded
+fmax36174 fma 1 '0.4444444444444444' '0.5555555555555559' -> '1.000000000000000' Inexact Rounded
+fmax36175 fma 1 '0.4444444444444444' '0.5555555555555558' -> '1.000000000000000' Inexact Rounded
+fmax36176 fma 1 '0.4444444444444444' '0.5555555555555557' -> '1.000000000000000' Inexact Rounded
+fmax36177 fma 1 '0.4444444444444444' '0.5555555555555556' -> '1.000000000000000' Rounded
+fmax36178 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
+fmax36179 fma 1 '0.4444444444444444' '0.5555555555555554' -> '0.9999999999999998'
+fmax36180 fma 1 '0.4444444444444444' '0.5555555555555553' -> '0.9999999999999997'
+fmax36181 fma 1 '0.4444444444444444' '0.5555555555555552' -> '0.9999999999999996'
+fmax36182 fma 1 '0.4444444444444444' '0.5555555555555551' -> '0.9999999999999995'
+fmax36183 fma 1 '0.4444444444444444' '0.5555555555555550' -> '0.9999999999999994'
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+fmax36200 fma 1 '6543210123456789' 0 -> '6543210123456789'
+fmax36201 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+fmax36202 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+fmax36203 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+fmax36204 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+fmax36205 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+fmax36206 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36207 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36208 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+fmax36209 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+fmax36210 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+fmax36211 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+fmax36212 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+fmax36213 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+fmax36214 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+fmax36215 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded
+fmax36216 fma 1 '6543210123456789' 1 -> '6543210123456790'
+fmax36217 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
+fmax36218 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+fmax36219 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+rounding: half_even
+fmax36220 fma 1 '6543210123456789' 0 -> '6543210123456789'
+fmax36221 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+fmax36222 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+fmax36223 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+fmax36224 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+fmax36225 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+fmax36226 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36227 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36228 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+fmax36229 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+fmax36230 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+fmax36231 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+fmax36232 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+fmax36233 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+fmax36234 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+fmax36235 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded
+fmax36236 fma 1 '6543210123456789' 1 -> '6543210123456790'
+fmax36237 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+fmax36238 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+fmax36239 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+-- critical few with even bottom digit...
+fmax36240 fma 1 '6543210123456788' 0.499999 -> '6543210123456788' Inexact Rounded
+fmax36241 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
+fmax36242 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
+
+rounding: down
+fmax36250 fma 1 '6543210123456789' 0 -> '6543210123456789'
+fmax36251 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+fmax36252 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+fmax36253 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+fmax36254 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+fmax36255 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+fmax36256 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36257 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36258 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
+fmax36259 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
+fmax36260 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
+fmax36261 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
+fmax36262 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
+fmax36263 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
+fmax36264 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
+fmax36265 fma 1 '6543210123456789' 0.999999 -> '6543210123456789' Inexact Rounded
+fmax36266 fma 1 '6543210123456789' 1 -> '6543210123456790'
+fmax36267 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+fmax36268 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+fmax36269 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_even
+fmax36301 fma 1 -1 1 -> 0
+fmax36302 fma 1 0 1 -> 1
+fmax36303 fma 1 1 1 -> 2
+fmax36304 fma 1 12 1 -> 13
+fmax36305 fma 1 98 1 -> 99
+fmax36306 fma 1 99 1 -> 100
+fmax36307 fma 1 100 1 -> 101
+fmax36308 fma 1 101 1 -> 102
+fmax36309 fma 1 -1 -1 -> -2
+fmax36310 fma 1 0 -1 -> -1
+fmax36311 fma 1 1 -1 -> 0
+fmax36312 fma 1 12 -1 -> 11
+fmax36313 fma 1 98 -1 -> 97
+fmax36314 fma 1 99 -1 -> 98
+fmax36315 fma 1 100 -1 -> 99
+fmax36316 fma 1 101 -1 -> 100
+
+fmax36321 fma 1 -0.01 0.01 -> 0.00
+fmax36322 fma 1 0.00 0.01 -> 0.01
+fmax36323 fma 1 0.01 0.01 -> 0.02
+fmax36324 fma 1 0.12 0.01 -> 0.13
+fmax36325 fma 1 0.98 0.01 -> 0.99
+fmax36326 fma 1 0.99 0.01 -> 1.00
+fmax36327 fma 1 1.00 0.01 -> 1.01
+fmax36328 fma 1 1.01 0.01 -> 1.02
+fmax36329 fma 1 -0.01 -0.01 -> -0.02
+fmax36330 fma 1 0.00 -0.01 -> -0.01
+fmax36331 fma 1 0.01 -0.01 -> 0.00
+fmax36332 fma 1 0.12 -0.01 -> 0.11
+fmax36333 fma 1 0.98 -0.01 -> 0.97
+fmax36334 fma 1 0.99 -0.01 -> 0.98
+fmax36335 fma 1 1.00 -0.01 -> 0.99
+fmax36336 fma 1 1.01 -0.01 -> 1.00
+
+-- some more cases where fma 1 ing 0 affects the coefficient
+fmax36340 fma 1 1E+3 0 -> 1000
+fmax36341 fma 1 1E+15 0 -> 1000000000000000
+fmax36342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded
+fmax36343 fma 1 1E+17 0 -> 1.000000000000000E+17 Rounded
+-- which simply follow from these cases ...
+fmax36344 fma 1 1E+3 1 -> 1001
+fmax36345 fma 1 1E+15 1 -> 1000000000000001
+fmax36346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
+fmax36347 fma 1 1E+17 1 -> 1.000000000000000E+17 Inexact Rounded
+fmax36348 fma 1 1E+3 7 -> 1007
+fmax36349 fma 1 1E+15 7 -> 1000000000000007
+fmax36350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
+fmax36351 fma 1 1E+17 7 -> 1.000000000000000E+17 Inexact Rounded
+
+-- tryzeros cases
+fmax36361 fma 1 0E+50 10000E+1 -> 1.0000E+5
+fmax36362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded
+fmax36363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
+fmax36364 fma 1 12.34 0e-398 -> 12.34000000000000 Rounded
+
+-- ulp replacement tests
+fmax36400 fma 1 1 77e-14 -> 1.00000000000077
+fmax36401 fma 1 1 77e-15 -> 1.000000000000077
+fmax36402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded
+fmax36403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded
+fmax36404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded
+fmax36405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded
+fmax36406 fma 1 1 77e-99 -> 1.000000000000000 Inexact Rounded
+
+fmax36410 fma 1 10 77e-14 -> 10.00000000000077
+fmax36411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded
+fmax36412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded
+fmax36413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded
+fmax36414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded
+fmax36415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded
+fmax36416 fma 1 10 77e-99 -> 10.00000000000000 Inexact Rounded
+
+fmax36420 fma 1 77e-14 1 -> 1.00000000000077
+fmax36421 fma 1 77e-15 1 -> 1.000000000000077
+fmax36422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded
+fmax36423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded
+fmax36424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded
+fmax36425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded
+fmax36426 fma 1 77e-99 1 -> 1.000000000000000 Inexact Rounded
+
+fmax36430 fma 1 77e-14 10 -> 10.00000000000077
+fmax36431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded
+fmax36432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded
+fmax36433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded
+fmax36434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded
+fmax36435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded
+fmax36436 fma 1 77e-99 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+fmax36440 fma 1 1 -77e-14 -> 0.99999999999923
+fmax36441 fma 1 1 -77e-15 -> 0.999999999999923
+fmax36442 fma 1 1 -77e-16 -> 0.9999999999999923
+fmax36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
+fmax36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
+fmax36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded
+fmax36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded
+
+fmax36450 fma 1 10 -77e-14 -> 9.99999999999923
+fmax36451 fma 1 10 -77e-15 -> 9.999999999999923
+fmax36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded
+fmax36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded
+fmax36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded
+fmax36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded
+fmax36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded
+
+fmax36460 fma 1 -77e-14 1 -> 0.99999999999923
+fmax36461 fma 1 -77e-15 1 -> 0.999999999999923
+fmax36462 fma 1 -77e-16 1 -> 0.9999999999999923
+fmax36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded
+fmax36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded
+fmax36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded
+fmax36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded
+
+fmax36470 fma 1 -77e-14 10 -> 9.99999999999923
+fmax36471 fma 1 -77e-15 10 -> 9.999999999999923
+fmax36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded
+fmax36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded
+fmax36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded
+fmax36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded
+fmax36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+fmax36480 fma 1 -1 77e-14 -> -0.99999999999923
+fmax36481 fma 1 -1 77e-15 -> -0.999999999999923
+fmax36482 fma 1 -1 77e-16 -> -0.9999999999999923
+fmax36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded
+fmax36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded
+fmax36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded
+fmax36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded
+
+fmax36490 fma 1 -10 77e-14 -> -9.99999999999923
+fmax36491 fma 1 -10 77e-15 -> -9.999999999999923
+fmax36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded
+fmax36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded
+fmax36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded
+fmax36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded
+fmax36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded
+
+fmax36500 fma 1 77e-14 -1 -> -0.99999999999923
+fmax36501 fma 1 77e-15 -1 -> -0.999999999999923
+fmax36502 fma 1 77e-16 -1 -> -0.9999999999999923
+fmax36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
+fmax36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
+fmax36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded
+fmax36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded
+
+fmax36510 fma 1 77e-14 -10 -> -9.99999999999923
+fmax36511 fma 1 77e-15 -10 -> -9.999999999999923
+fmax36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded
+fmax36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded
+fmax36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded
+fmax36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded
+fmax36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded
+
+
+-- long operands
+fmax36521 fma 1 101234562345678000 0 -> 1.012345623456780E+17 Rounded
+fmax36522 fma 1 0 101234562345678000 -> 1.012345623456780E+17 Rounded
+fmax36523 fma 1 10123456234567800 0 -> 1.012345623456780E+16 Rounded
+fmax36524 fma 1 0 10123456234567800 -> 1.012345623456780E+16 Rounded
+fmax36525 fma 1 10123456234567890 0 -> 1.012345623456789E+16 Rounded
+fmax36526 fma 1 0 10123456234567890 -> 1.012345623456789E+16 Rounded
+fmax36527 fma 1 10123456234567891 0 -> 1.012345623456789E+16 Inexact Rounded
+fmax36528 fma 1 0 10123456234567891 -> 1.012345623456789E+16 Inexact Rounded
+fmax36529 fma 1 101234562345678901 0 -> 1.012345623456789E+17 Inexact Rounded
+fmax36530 fma 1 0 101234562345678901 -> 1.012345623456789E+17 Inexact Rounded
+fmax36531 fma 1 10123456234567896 0 -> 1.012345623456790E+16 Inexact Rounded
+fmax36532 fma 1 0 10123456234567896 -> 1.012345623456790E+16 Inexact Rounded
+
+-- verify a query
+rounding: down
+fmax36561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
+fmax36562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
+-- and using decimal64 bounds...
+rounding: down
+fmax36563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
+fmax36564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+fmax36701 fma 1 5.00 1.00E-3 -> 5.00100
+fmax36702 fma 1 00.00 0.000 -> 0.000
+fmax36703 fma 1 00.00 0E-3 -> 0.000
+fmax36704 fma 1 0E-3 00.00 -> 0.000
+
+fmax36710 fma 1 0E+3 00.00 -> 0.00
+fmax36711 fma 1 0E+3 00.0 -> 0.0
+fmax36712 fma 1 0E+3 00. -> 0
+fmax36713 fma 1 0E+3 00.E+1 -> 0E+1
+fmax36714 fma 1 0E+3 00.E+2 -> 0E+2
+fmax36715 fma 1 0E+3 00.E+3 -> 0E+3
+fmax36716 fma 1 0E+3 00.E+4 -> 0E+3
+fmax36717 fma 1 0E+3 00.E+5 -> 0E+3
+fmax36718 fma 1 0E+3 -00.0 -> 0.0
+fmax36719 fma 1 0E+3 -00. -> 0
+fmax36731 fma 1 0E+3 -00.E+1 -> 0E+1
+
+fmax36720 fma 1 00.00 0E+3 -> 0.00
+fmax36721 fma 1 00.0 0E+3 -> 0.0
+fmax36722 fma 1 00. 0E+3 -> 0
+fmax36723 fma 1 00.E+1 0E+3 -> 0E+1
+fmax36724 fma 1 00.E+2 0E+3 -> 0E+2
+fmax36725 fma 1 00.E+3 0E+3 -> 0E+3
+fmax36726 fma 1 00.E+4 0E+3 -> 0E+3
+fmax36727 fma 1 00.E+5 0E+3 -> 0E+3
+fmax36728 fma 1 -00.00 0E+3 -> 0.00
+fmax36729 fma 1 -00.0 0E+3 -> 0.0
+fmax36730 fma 1 -00. 0E+3 -> 0
+
+fmax36732 fma 1 0 0 -> 0
+fmax36733 fma 1 0 -0 -> 0
+fmax36734 fma 1 -0 0 -> 0
+fmax36735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
+
+fmax36736 fma 1 1 -1 -> 0
+fmax36737 fma 1 -1 -1 -> -2
+fmax36738 fma 1 1 1 -> 2
+fmax36739 fma 1 -1 1 -> 0
+
+fmax36741 fma 1 0 -1 -> -1
+fmax36742 fma 1 -0 -1 -> -1
+fmax36743 fma 1 0 1 -> 1
+fmax36744 fma 1 -0 1 -> 1
+fmax36745 fma 1 -1 0 -> -1
+fmax36746 fma 1 -1 -0 -> -1
+fmax36747 fma 1 1 0 -> 1
+fmax36748 fma 1 1 -0 -> 1
+
+fmax36751 fma 1 0.0 -1 -> -1.0
+fmax36752 fma 1 -0.0 -1 -> -1.0
+fmax36753 fma 1 0.0 1 -> 1.0
+fmax36754 fma 1 -0.0 1 -> 1.0
+fmax36755 fma 1 -1.0 0 -> -1.0
+fmax36756 fma 1 -1.0 -0 -> -1.0
+fmax36757 fma 1 1.0 0 -> 1.0
+fmax36758 fma 1 1.0 -0 -> 1.0
+
+fmax36761 fma 1 0 -1.0 -> -1.0
+fmax36762 fma 1 -0 -1.0 -> -1.0
+fmax36763 fma 1 0 1.0 -> 1.0
+fmax36764 fma 1 -0 1.0 -> 1.0
+fmax36765 fma 1 -1 0.0 -> -1.0
+fmax36766 fma 1 -1 -0.0 -> -1.0
+fmax36767 fma 1 1 0.0 -> 1.0
+fmax36768 fma 1 1 -0.0 -> 1.0
+
+fmax36771 fma 1 0.0 -1.0 -> -1.0
+fmax36772 fma 1 -0.0 -1.0 -> -1.0
+fmax36773 fma 1 0.0 1.0 -> 1.0
+fmax36774 fma 1 -0.0 1.0 -> 1.0
+fmax36775 fma 1 -1.0 0.0 -> -1.0
+fmax36776 fma 1 -1.0 -0.0 -> -1.0
+fmax36777 fma 1 1.0 0.0 -> 1.0
+fmax36778 fma 1 1.0 -0.0 -> 1.0
+
+-- Specials
+fmax36780 fma 1 -Inf -Inf -> -Infinity
+fmax36781 fma 1 -Inf -1000 -> -Infinity
+fmax36782 fma 1 -Inf -1 -> -Infinity
+fmax36783 fma 1 -Inf -0 -> -Infinity
+fmax36784 fma 1 -Inf 0 -> -Infinity
+fmax36785 fma 1 -Inf 1 -> -Infinity
+fmax36786 fma 1 -Inf 1000 -> -Infinity
+fmax36787 fma 1 -1000 -Inf -> -Infinity
+fmax36788 fma 1 -Inf -Inf -> -Infinity
+fmax36789 fma 1 -1 -Inf -> -Infinity
+fmax36790 fma 1 -0 -Inf -> -Infinity
+fmax36791 fma 1 0 -Inf -> -Infinity
+fmax36792 fma 1 1 -Inf -> -Infinity
+fmax36793 fma 1 1000 -Inf -> -Infinity
+fmax36794 fma 1 Inf -Inf -> NaN Invalid_operation
+
+fmax36800 fma 1 Inf -Inf -> NaN Invalid_operation
+fmax36801 fma 1 Inf -1000 -> Infinity
+fmax36802 fma 1 Inf -1 -> Infinity
+fmax36803 fma 1 Inf -0 -> Infinity
+fmax36804 fma 1 Inf 0 -> Infinity
+fmax36805 fma 1 Inf 1 -> Infinity
+fmax36806 fma 1 Inf 1000 -> Infinity
+fmax36807 fma 1 Inf Inf -> Infinity
+fmax36808 fma 1 -1000 Inf -> Infinity
+fmax36809 fma 1 -Inf Inf -> NaN Invalid_operation
+fmax36810 fma 1 -1 Inf -> Infinity
+fmax36811 fma 1 -0 Inf -> Infinity
+fmax36812 fma 1 0 Inf -> Infinity
+fmax36813 fma 1 1 Inf -> Infinity
+fmax36814 fma 1 1000 Inf -> Infinity
+fmax36815 fma 1 Inf Inf -> Infinity
+
+fmax36821 fma 1 NaN -Inf -> NaN
+fmax36822 fma 1 NaN -1000 -> NaN
+fmax36823 fma 1 NaN -1 -> NaN
+fmax36824 fma 1 NaN -0 -> NaN
+fmax36825 fma 1 NaN 0 -> NaN
+fmax36826 fma 1 NaN 1 -> NaN
+fmax36827 fma 1 NaN 1000 -> NaN
+fmax36828 fma 1 NaN Inf -> NaN
+fmax36829 fma 1 NaN NaN -> NaN
+fmax36830 fma 1 -Inf NaN -> NaN
+fmax36831 fma 1 -1000 NaN -> NaN
+fmax36832 fma 1 -1 NaN -> NaN
+fmax36833 fma 1 -0 NaN -> NaN
+fmax36834 fma 1 0 NaN -> NaN
+fmax36835 fma 1 1 NaN -> NaN
+fmax36836 fma 1 1000 NaN -> NaN
+fmax36837 fma 1 Inf NaN -> NaN
+
+fmax36841 fma 1 sNaN -Inf -> NaN Invalid_operation
+fmax36842 fma 1 sNaN -1000 -> NaN Invalid_operation
+fmax36843 fma 1 sNaN -1 -> NaN Invalid_operation
+fmax36844 fma 1 sNaN -0 -> NaN Invalid_operation
+fmax36845 fma 1 sNaN 0 -> NaN Invalid_operation
+fmax36846 fma 1 sNaN 1 -> NaN Invalid_operation
+fmax36847 fma 1 sNaN 1000 -> NaN Invalid_operation
+fmax36848 fma 1 sNaN NaN -> NaN Invalid_operation
+fmax36849 fma 1 sNaN sNaN -> NaN Invalid_operation
+fmax36850 fma 1 NaN sNaN -> NaN Invalid_operation
+fmax36851 fma 1 -Inf sNaN -> NaN Invalid_operation
+fmax36852 fma 1 -1000 sNaN -> NaN Invalid_operation
+fmax36853 fma 1 -1 sNaN -> NaN Invalid_operation
+fmax36854 fma 1 -0 sNaN -> NaN Invalid_operation
+fmax36855 fma 1 0 sNaN -> NaN Invalid_operation
+fmax36856 fma 1 1 sNaN -> NaN Invalid_operation
+fmax36857 fma 1 1000 sNaN -> NaN Invalid_operation
+fmax36858 fma 1 Inf sNaN -> NaN Invalid_operation
+fmax36859 fma 1 NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+fmax36861 fma 1 NaN1 -Inf -> NaN1
+fmax36862 fma 1 +NaN2 -1000 -> NaN2
+fmax36863 fma 1 NaN3 1000 -> NaN3
+fmax36864 fma 1 NaN4 Inf -> NaN4
+fmax36865 fma 1 NaN5 +NaN6 -> NaN5
+fmax36866 fma 1 -Inf NaN7 -> NaN7
+fmax36867 fma 1 -1000 NaN8 -> NaN8
+fmax36868 fma 1 1000 NaN9 -> NaN9
+fmax36869 fma 1 Inf +NaN10 -> NaN10
+fmax36871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
+fmax36872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
+fmax36873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
+fmax36874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
+fmax36875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
+fmax36876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
+fmax36877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
+fmax36878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
+fmax36879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
+fmax36880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
+fmax36881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
+fmax36882 fma 1 -NaN26 NaN28 -> -NaN26
+fmax36883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+fmax36884 fma 1 1000 -NaN30 -> -NaN30
+fmax36885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- now the case where we can get underflow but the result is normal
+-- [note this can't happen if the operands are also bounded, as we
+-- cannot represent 1E-399, for example]
+
+fmax36571 fma 1 1E-383 0 -> 1E-383
+fmax36572 fma 1 1E-384 0 -> 1E-384 Subnormal
+fmax36573 fma 1 1E-383 1E-384 -> 1.1E-383
+fmax36574 subtract 1E-383 1E-384 -> 9E-384 Subnormal
+
+-- Here we explore the boundary of rounding a subnormal to Nmin
+fmax36575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
+fmax36576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
+fmax36577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax36578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax36579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax36580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+-- check overflow edge case
+-- 1234567890123456
+fmax36972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
+fmax36973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
+fmax36974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
+fmax36975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
+fmax36976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
+fmax36977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
+fmax36978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
+fmax36979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
+fmax36980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
+fmax36981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
+fmax36982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
+fmax36983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
+fmax36984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
+
+fmax36985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
+fmax36986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
+fmax36987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
+fmax36988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
+fmax36989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
+fmax36990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
+fmax36991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
+fmax36992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
+fmax36993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
+fmax36994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
+fmax36995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
+fmax36996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
+fmax36997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+fmax361100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
+fmax361101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
+fmax361103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
+fmax361104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
+fmax361105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
+fmax361106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
+fmax361107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
+fmax361108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
+fmax361109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+fmax361110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
+fmax361111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
+fmax361113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
+fmax361114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
+fmax361115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
+fmax361116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
+fmax361117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
+fmax361118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
+fmax361119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+fmax361300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
+fmax361310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
+fmax361311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
+fmax361312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
+fmax361313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
+fmax361314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
+fmax361315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
+fmax361316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
+fmax361317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
+fmax361318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
+fmax361319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
+fmax361320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
+fmax361321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
+fmax361322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
+fmax361323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
+fmax361324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
+fmax361325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
+fmax361339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
+
+fmax361340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
+fmax361341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
+
+fmax361349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
+fmax361350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
+fmax361351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
+fmax361352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
+fmax361353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
+fmax361354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
+fmax361355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
+fmax361356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
+fmax361357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
+fmax361358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
+fmax361359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
+fmax361360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
+fmax361361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
+fmax361362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
+fmax361363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
+fmax361364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
+fmax361365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
+fmax361380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
+fmax361381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
+fmax361382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
+fmax361396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+fmax361420 fma 1 0 1.123456789012345 -> 1.123456789012345
+fmax361421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
+fmax361422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
+fmax361423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
+fmax361424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
+fmax361425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
+fmax361426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
+fmax361427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
+fmax361428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
+fmax361429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
+fmax361430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
+fmax361431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
+fmax361432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
+fmax361433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
+fmax361434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
+fmax361435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
+fmax361436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
+fmax361437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
+fmax361438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
+fmax361439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+fmax361440 fma 1 1.123456789012345 0 -> 1.123456789012345
+fmax361441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
+fmax361442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
+fmax361443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
+fmax361444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
+fmax361445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
+fmax361446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
+fmax361447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
+fmax361448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
+fmax361449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
+fmax361450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
+fmax361451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
+fmax361452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
+fmax361453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
+fmax361454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
+fmax361455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
+fmax361456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
+fmax361457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
+fmax361458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
+fmax361459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+fmax361460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
+fmax361461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
+fmax361462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
+fmax361463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
+fmax361464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
+fmax361465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
+fmax361466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
+fmax361467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
+fmax361468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
+fmax361469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
+fmax361470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
+fmax361471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
+fmax361472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
+fmax361473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
+fmax361474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
+fmax361475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+fmax361476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
+fmax361477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
+fmax361478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
+fmax361479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+fmax361500 fma 1 0 0E-19 -> 0E-19
+fmax361501 fma 1 -0 0E-19 -> 0E-19
+fmax361502 fma 1 0 -0E-19 -> 0E-19
+fmax361503 fma 1 -0 -0E-19 -> -0E-19
+fmax361504 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: half_down
+-- exact zeros from zeros
+fmax361520 fma 1 0 0E-19 -> 0E-19
+fmax361521 fma 1 -0 0E-19 -> 0E-19
+fmax361522 fma 1 0 -0E-19 -> 0E-19
+fmax361523 fma 1 -0 -0E-19 -> -0E-19
+fmax361524 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: half_even
+-- exact zeros from zeros
+fmax361540 fma 1 0 0E-19 -> 0E-19
+fmax361541 fma 1 -0 0E-19 -> 0E-19
+fmax361542 fma 1 0 -0E-19 -> 0E-19
+fmax361543 fma 1 -0 -0E-19 -> -0E-19
+fmax361544 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: up
+-- exact zeros from zeros
+fmax361560 fma 1 0 0E-19 -> 0E-19
+fmax361561 fma 1 -0 0E-19 -> 0E-19
+fmax361562 fma 1 0 -0E-19 -> 0E-19
+fmax361563 fma 1 -0 -0E-19 -> -0E-19
+fmax361564 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+fmax361574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+fmax361575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+rounding: down
+-- exact zeros from zeros
+fmax361580 fma 1 0 0E-19 -> 0E-19
+fmax361581 fma 1 -0 0E-19 -> 0E-19
+fmax361582 fma 1 0 -0E-19 -> 0E-19
+fmax361583 fma 1 -0 -0E-19 -> -0E-19
+fmax361584 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: ceiling
+-- exact zeros from zeros
+fmax361600 fma 1 0 0E-19 -> 0E-19
+fmax361601 fma 1 -0 0E-19 -> 0E-19
+fmax361602 fma 1 0 -0E-19 -> 0E-19
+fmax361603 fma 1 -0 -0E-19 -> -0E-19
+fmax361604 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+fmax361620 fma 1 0 0E-19 -> 0E-19
+fmax361621 fma 1 -0 0E-19 -> -0E-19 -- *
+fmax361622 fma 1 0 -0E-19 -> -0E-19 -- *
+fmax361623 fma 1 -0 -0E-19 -> -0E-19
+fmax361624 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- *
+fmax361626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- *
+fmax361627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+fmax361634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+fmax361635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- *
+fmax361637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- *
+fmax361638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+fmax361701 fma 1 130E-2 120E-2 -> 2.50
+fmax361702 fma 1 130E-2 12E-1 -> 2.50
+fmax361703 fma 1 130E-2 1E0 -> 2.30
+fmax361704 fma 1 1E2 1E4 -> 1.01E+4
+fmax361705 subtract 130E-2 120E-2 -> 0.10
+fmax361706 subtract 130E-2 12E-1 -> 0.10
+fmax361707 subtract 130E-2 1E0 -> 0.30
+fmax361708 subtract 1E2 1E4 -> -9.9E+3
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+fmax362001 fma 1 1234567890123456 1 -> 1234567890123457
+fmax362002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
+fmax362003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
+fmax362004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
+fmax362005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
+fmax362006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
+fmax362007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
+fmax362008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
+fmax362009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
+fmax362010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
+fmax362011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
+fmax362012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
+fmax362013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
+fmax362014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
+fmax362015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
+fmax362016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
+fmax362017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
+fmax362018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
+fmax362019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
+fmax362020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
+fmax362021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
+
+-- widening second argument at gap
+fmax362030 fma 1 12345678 1 -> 12345679
+fmax362031 fma 1 12345678 0.1 -> 12345678.1
+fmax362032 fma 1 12345678 0.12 -> 12345678.12
+fmax362033 fma 1 12345678 0.123 -> 12345678.123
+fmax362034 fma 1 12345678 0.1234 -> 12345678.1234
+fmax362035 fma 1 12345678 0.12345 -> 12345678.12345
+fmax362036 fma 1 12345678 0.123456 -> 12345678.123456
+fmax362037 fma 1 12345678 0.1234567 -> 12345678.1234567
+fmax362038 fma 1 12345678 0.12345678 -> 12345678.12345678
+fmax362039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
+fmax362040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
+fmax362041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
+fmax362042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
+fmax362043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
+fmax362044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
+fmax362045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
+fmax362046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
+fmax362047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
+fmax362048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
+fmax362049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+fmax362050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
+fmax362051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
+fmax362052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
+fmax362053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
+fmax362054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
+fmax362055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
+fmax362056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
+fmax362057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
+fmax362060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
+fmax362061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
+fmax362062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
+fmax362063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
+fmax362064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
+fmax362065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
+fmax362066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
+fmax362067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+fmax362070 fma 1 12345678 1E-8 -> 12345678.00000001
+fmax362071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
+fmax362072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
+fmax362073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
+fmax362074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
+fmax362075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
+fmax362076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
+fmax362077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
+fmax362078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
+fmax362079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
+fmax362080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
+fmax362081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
+fmax362082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
+fmax362083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
+fmax362084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
+fmax362085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
+fmax362086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
+fmax362087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
+fmax362088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
+fmax362089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
+
+-- payload decapitate x3
+precision: 5
+fmax363000 fma 1 1 sNaN1234567890 -> NaN67890 Invalid_operation
+fmax363001 fma 1 -sNaN1234512345 1 -> -NaN12345 Invalid_operation
+fmax363002 fma sNaN1234554321 1 1 -> NaN54321 Invalid_operation
+
+-- Null tests
+fmax39990 fma 1 10 # -> NaN Invalid_operation
+fmax39991 fma 1 # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/invert.decTest b/Lib/test/decimaltestdata/invert.decTest
index a2f7be5a77..9ef5a9137c 100644
--- a/Lib/test/decimaltestdata/invert.decTest
+++ b/Lib/test/decimaltestdata/invert.decTest
@@ -1,176 +1,176 @@
-------------------------------------------------------------------------
--- invert.decTest -- digitwise logical INVERT --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check (truth table), and examples from decArith
-invx001 invert 0 -> 111111111
-invx002 invert 1 -> 111111110
-invx003 invert 10 -> 111111101
-invx004 invert 111111111 -> 0
-invx005 invert 000000000 -> 111111111
-invx006 invert 101010101 -> '10101010'
--- and at msd and msd-1
-invx007 invert 000000000 -> 111111111
-invx009 invert 100000000 -> 11111111
-invx011 invert 000000000 -> 111111111
-invx013 invert 010000000 -> 101111111
-
--- Various lengths
--- 123456789 123456789
-invx021 invert 111111111 -> 0
-invx022 invert 111111111111 -> 0
-invx023 invert 11111111 -> 100000000
-invx025 invert 1111111 -> 110000000
-invx026 invert 111111 -> 111000000
-invx027 invert 11111 -> 111100000
-invx028 invert 1111 -> 111110000
-invx029 invert 111 -> 111111000
-invx031 invert 11 -> 111111100
-invx032 invert 1 -> 111111110
-invx033 invert 111111111111 -> 0
-invx034 invert 11111111111 -> 0
-invx035 invert 1111111111 -> 0
-invx036 invert 111111111 -> 0
-
-invx080 invert 011111111 -> 100000000
-invx081 invert 101111111 -> 10000000
-invx082 invert 110111111 -> 1000000
-invx083 invert 111011111 -> 100000
-invx084 invert 111101111 -> 10000
-invx085 invert 111110111 -> 1000
-invx086 invert 111111011 -> 100
-invx087 invert 111111101 -> 10
-invx088 invert 111111110 -> 1
-invx089 invert 011111011 -> 100000100
-invx090 invert 101111101 -> 10000010
-invx091 invert 110111110 -> 1000001
-invx092 invert 111011101 -> 100010
-invx093 invert 111101011 -> 10100
-invx094 invert 111110111 -> 1000
-invx095 invert 111101011 -> 10100
-invx096 invert 111011101 -> 100010
-invx097 invert 110111110 -> 1000001
-invx098 invert 101111101 -> 10000010
-invx099 invert 011111011 -> 100000100
-
--- non-0/1 should not be accepted, nor should signs
-invx220 invert 111111112 -> NaN Invalid_operation
-invx221 invert 333333333 -> NaN Invalid_operation
-invx222 invert 555555555 -> NaN Invalid_operation
-invx223 invert 777777777 -> NaN Invalid_operation
-invx224 invert 999999999 -> NaN Invalid_operation
-invx225 invert 222222222 -> NaN Invalid_operation
-invx226 invert 444444444 -> NaN Invalid_operation
-invx227 invert 666666666 -> NaN Invalid_operation
-invx228 invert 888888888 -> NaN Invalid_operation
-invx229 invert 999999999 -> NaN Invalid_operation
-invx230 invert 999999999 -> NaN Invalid_operation
-invx231 invert 999999999 -> NaN Invalid_operation
-invx232 invert 999999999 -> NaN Invalid_operation
--- a few randoms
-invx240 invert 567468689 -> NaN Invalid_operation
-invx241 invert 567367689 -> NaN Invalid_operation
-invx242 invert -631917772 -> NaN Invalid_operation
-invx243 invert -756253257 -> NaN Invalid_operation
-invx244 invert 835590149 -> NaN Invalid_operation
--- test MSD
-invx250 invert 200000000 -> NaN Invalid_operation
-invx251 invert 300000000 -> NaN Invalid_operation
-invx252 invert 400000000 -> NaN Invalid_operation
-invx253 invert 500000000 -> NaN Invalid_operation
-invx254 invert 600000000 -> NaN Invalid_operation
-invx255 invert 700000000 -> NaN Invalid_operation
-invx256 invert 800000000 -> NaN Invalid_operation
-invx257 invert 900000000 -> NaN Invalid_operation
--- test MSD-1
-invx270 invert 021000000 -> NaN Invalid_operation
-invx271 invert 030100000 -> NaN Invalid_operation
-invx272 invert 040010000 -> NaN Invalid_operation
-invx273 invert 050001000 -> NaN Invalid_operation
-invx274 invert 160000100 -> NaN Invalid_operation
-invx275 invert 170000010 -> NaN Invalid_operation
-invx276 invert 180000000 -> NaN Invalid_operation
-invx277 invert 190000000 -> NaN Invalid_operation
--- test LSD
-invx280 invert 000000002 -> NaN Invalid_operation
-invx281 invert 000000003 -> NaN Invalid_operation
-invx282 invert 000000004 -> NaN Invalid_operation
-invx283 invert 000000005 -> NaN Invalid_operation
-invx284 invert 101000006 -> NaN Invalid_operation
-invx285 invert 100100007 -> NaN Invalid_operation
-invx286 invert 100010008 -> NaN Invalid_operation
-invx287 invert 100001009 -> NaN Invalid_operation
--- test Middie
-invx288 invert 000020000 -> NaN Invalid_operation
-invx289 invert 000030001 -> NaN Invalid_operation
-invx290 invert 000040000 -> NaN Invalid_operation
-invx291 invert 000050000 -> NaN Invalid_operation
-invx292 invert 101060000 -> NaN Invalid_operation
-invx293 invert 100170010 -> NaN Invalid_operation
-invx294 invert 100080100 -> NaN Invalid_operation
-invx295 invert 100091000 -> NaN Invalid_operation
--- signs
-invx296 invert -100001000 -> NaN Invalid_operation
-invx299 invert 100001000 -> 11110111
-
--- Nmax, Nmin, Ntiny
-invx341 invert 9.99999999E+999 -> NaN Invalid_operation
-invx342 invert 1E-999 -> NaN Invalid_operation
-invx343 invert 1.00000000E-999 -> NaN Invalid_operation
-invx344 invert 1E-1007 -> NaN Invalid_operation
-invx345 invert -1E-1007 -> NaN Invalid_operation
-invx346 invert -1.00000000E-999 -> NaN Invalid_operation
-invx347 invert -1E-999 -> NaN Invalid_operation
-invx348 invert -9.99999999E+999 -> NaN Invalid_operation
-
--- A few other non-integers
-invx361 invert 1.0 -> NaN Invalid_operation
-invx362 invert 1E+1 -> NaN Invalid_operation
-invx363 invert 0.0 -> NaN Invalid_operation
-invx364 invert 0E+1 -> NaN Invalid_operation
-invx365 invert 9.9 -> NaN Invalid_operation
-invx366 invert 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-invx788 invert -Inf -> NaN Invalid_operation
-invx794 invert Inf -> NaN Invalid_operation
-invx821 invert NaN -> NaN Invalid_operation
-invx841 invert sNaN -> NaN Invalid_operation
--- propagating NaNs
-invx861 invert NaN1 -> NaN Invalid_operation
-invx862 invert +NaN2 -> NaN Invalid_operation
-invx863 invert NaN3 -> NaN Invalid_operation
-invx864 invert NaN4 -> NaN Invalid_operation
-invx865 invert NaN5 -> NaN Invalid_operation
-invx871 invert sNaN11 -> NaN Invalid_operation
-invx872 invert sNaN12 -> NaN Invalid_operation
-invx873 invert sNaN13 -> NaN Invalid_operation
-invx874 invert sNaN14 -> NaN Invalid_operation
-invx875 invert sNaN15 -> NaN Invalid_operation
-invx876 invert NaN16 -> NaN Invalid_operation
-invx881 invert +NaN25 -> NaN Invalid_operation
-invx882 invert -NaN26 -> NaN Invalid_operation
-invx883 invert -sNaN27 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- invert.decTest -- digitwise logical INVERT --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check (truth table), and examples from decArith
+invx001 invert 0 -> 111111111
+invx002 invert 1 -> 111111110
+invx003 invert 10 -> 111111101
+invx004 invert 111111111 -> 0
+invx005 invert 000000000 -> 111111111
+invx006 invert 101010101 -> '10101010'
+-- and at msd and msd-1
+invx007 invert 000000000 -> 111111111
+invx009 invert 100000000 -> 11111111
+invx011 invert 000000000 -> 111111111
+invx013 invert 010000000 -> 101111111
+
+-- Various lengths
+-- 123456789 123456789
+invx021 invert 111111111 -> 0
+invx022 invert 111111111111 -> 0
+invx023 invert 11111111 -> 100000000
+invx025 invert 1111111 -> 110000000
+invx026 invert 111111 -> 111000000
+invx027 invert 11111 -> 111100000
+invx028 invert 1111 -> 111110000
+invx029 invert 111 -> 111111000
+invx031 invert 11 -> 111111100
+invx032 invert 1 -> 111111110
+invx033 invert 111111111111 -> 0
+invx034 invert 11111111111 -> 0
+invx035 invert 1111111111 -> 0
+invx036 invert 111111111 -> 0
+
+invx080 invert 011111111 -> 100000000
+invx081 invert 101111111 -> 10000000
+invx082 invert 110111111 -> 1000000
+invx083 invert 111011111 -> 100000
+invx084 invert 111101111 -> 10000
+invx085 invert 111110111 -> 1000
+invx086 invert 111111011 -> 100
+invx087 invert 111111101 -> 10
+invx088 invert 111111110 -> 1
+invx089 invert 011111011 -> 100000100
+invx090 invert 101111101 -> 10000010
+invx091 invert 110111110 -> 1000001
+invx092 invert 111011101 -> 100010
+invx093 invert 111101011 -> 10100
+invx094 invert 111110111 -> 1000
+invx095 invert 111101011 -> 10100
+invx096 invert 111011101 -> 100010
+invx097 invert 110111110 -> 1000001
+invx098 invert 101111101 -> 10000010
+invx099 invert 011111011 -> 100000100
+
+-- non-0/1 should not be accepted, nor should signs
+invx220 invert 111111112 -> NaN Invalid_operation
+invx221 invert 333333333 -> NaN Invalid_operation
+invx222 invert 555555555 -> NaN Invalid_operation
+invx223 invert 777777777 -> NaN Invalid_operation
+invx224 invert 999999999 -> NaN Invalid_operation
+invx225 invert 222222222 -> NaN Invalid_operation
+invx226 invert 444444444 -> NaN Invalid_operation
+invx227 invert 666666666 -> NaN Invalid_operation
+invx228 invert 888888888 -> NaN Invalid_operation
+invx229 invert 999999999 -> NaN Invalid_operation
+invx230 invert 999999999 -> NaN Invalid_operation
+invx231 invert 999999999 -> NaN Invalid_operation
+invx232 invert 999999999 -> NaN Invalid_operation
+-- a few randoms
+invx240 invert 567468689 -> NaN Invalid_operation
+invx241 invert 567367689 -> NaN Invalid_operation
+invx242 invert -631917772 -> NaN Invalid_operation
+invx243 invert -756253257 -> NaN Invalid_operation
+invx244 invert 835590149 -> NaN Invalid_operation
+-- test MSD
+invx250 invert 200000000 -> NaN Invalid_operation
+invx251 invert 300000000 -> NaN Invalid_operation
+invx252 invert 400000000 -> NaN Invalid_operation
+invx253 invert 500000000 -> NaN Invalid_operation
+invx254 invert 600000000 -> NaN Invalid_operation
+invx255 invert 700000000 -> NaN Invalid_operation
+invx256 invert 800000000 -> NaN Invalid_operation
+invx257 invert 900000000 -> NaN Invalid_operation
+-- test MSD-1
+invx270 invert 021000000 -> NaN Invalid_operation
+invx271 invert 030100000 -> NaN Invalid_operation
+invx272 invert 040010000 -> NaN Invalid_operation
+invx273 invert 050001000 -> NaN Invalid_operation
+invx274 invert 160000100 -> NaN Invalid_operation
+invx275 invert 170000010 -> NaN Invalid_operation
+invx276 invert 180000000 -> NaN Invalid_operation
+invx277 invert 190000000 -> NaN Invalid_operation
+-- test LSD
+invx280 invert 000000002 -> NaN Invalid_operation
+invx281 invert 000000003 -> NaN Invalid_operation
+invx282 invert 000000004 -> NaN Invalid_operation
+invx283 invert 000000005 -> NaN Invalid_operation
+invx284 invert 101000006 -> NaN Invalid_operation
+invx285 invert 100100007 -> NaN Invalid_operation
+invx286 invert 100010008 -> NaN Invalid_operation
+invx287 invert 100001009 -> NaN Invalid_operation
+-- test Middie
+invx288 invert 000020000 -> NaN Invalid_operation
+invx289 invert 000030001 -> NaN Invalid_operation
+invx290 invert 000040000 -> NaN Invalid_operation
+invx291 invert 000050000 -> NaN Invalid_operation
+invx292 invert 101060000 -> NaN Invalid_operation
+invx293 invert 100170010 -> NaN Invalid_operation
+invx294 invert 100080100 -> NaN Invalid_operation
+invx295 invert 100091000 -> NaN Invalid_operation
+-- signs
+invx296 invert -100001000 -> NaN Invalid_operation
+invx299 invert 100001000 -> 11110111
+
+-- Nmax, Nmin, Ntiny
+invx341 invert 9.99999999E+999 -> NaN Invalid_operation
+invx342 invert 1E-999 -> NaN Invalid_operation
+invx343 invert 1.00000000E-999 -> NaN Invalid_operation
+invx344 invert 1E-1007 -> NaN Invalid_operation
+invx345 invert -1E-1007 -> NaN Invalid_operation
+invx346 invert -1.00000000E-999 -> NaN Invalid_operation
+invx347 invert -1E-999 -> NaN Invalid_operation
+invx348 invert -9.99999999E+999 -> NaN Invalid_operation
+
+-- A few other non-integers
+invx361 invert 1.0 -> NaN Invalid_operation
+invx362 invert 1E+1 -> NaN Invalid_operation
+invx363 invert 0.0 -> NaN Invalid_operation
+invx364 invert 0E+1 -> NaN Invalid_operation
+invx365 invert 9.9 -> NaN Invalid_operation
+invx366 invert 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+invx788 invert -Inf -> NaN Invalid_operation
+invx794 invert Inf -> NaN Invalid_operation
+invx821 invert NaN -> NaN Invalid_operation
+invx841 invert sNaN -> NaN Invalid_operation
+-- propagating NaNs
+invx861 invert NaN1 -> NaN Invalid_operation
+invx862 invert +NaN2 -> NaN Invalid_operation
+invx863 invert NaN3 -> NaN Invalid_operation
+invx864 invert NaN4 -> NaN Invalid_operation
+invx865 invert NaN5 -> NaN Invalid_operation
+invx871 invert sNaN11 -> NaN Invalid_operation
+invx872 invert sNaN12 -> NaN Invalid_operation
+invx873 invert sNaN13 -> NaN Invalid_operation
+invx874 invert sNaN14 -> NaN Invalid_operation
+invx875 invert sNaN15 -> NaN Invalid_operation
+invx876 invert NaN16 -> NaN Invalid_operation
+invx881 invert +NaN25 -> NaN Invalid_operation
+invx882 invert -NaN26 -> NaN Invalid_operation
+invx883 invert -sNaN27 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ln.decTest b/Lib/test/decimaltestdata/ln.decTest
index f602af2377..efcb2a6606 100644
--- a/Lib/test/decimaltestdata/ln.decTest
+++ b/Lib/test/decimaltestdata/ln.decTest
@@ -1,611 +1,611 @@
-------------------------------------------------------------------------
--- ln.decTest -- decimal natural logarithm --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 16
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- basics (examples in specification)
-precision: 9
-lnxs001 ln 0 -> -Infinity
-lnxs002 ln 1.000 -> 0
-lnxs003 ln 2.71828183 -> 1.00000000 Inexact Rounded
-lnxs004 ln 10 -> 2.30258509 Inexact Rounded
-lnxs005 ln +Infinity -> Infinity
-
-
--- basics
-precision: 16
-lnx0001 ln 0 -> -Infinity
-lnx0002 ln 1E-9 -> -20.72326583694641 Inexact Rounded
-lnx0003 ln 0.0007 -> -7.264430222920869 Inexact Rounded
-lnx0004 ln 0.1 -> -2.302585092994046 Inexact Rounded
-lnx0005 ln 0.7 -> -0.3566749439387324 Inexact Rounded
-lnx0006 ln 1 -> 0
-lnx0007 ln 1.000 -> 0
-lnx0008 ln 1.5 -> 0.4054651081081644 Inexact Rounded
-lnx0009 ln 2 -> 0.6931471805599453 Inexact Rounded
-lnx0010 ln 2.718281828459045 -> 0.9999999999999999 Inexact Rounded
-lnx0011 ln 2.718281828459046 -> 1.000000000000000 Inexact Rounded
-lnx0012 ln 2.718281828459047 -> 1.000000000000001 Inexact Rounded
-lnx0013 ln 10 -> 2.302585092994046 Inexact Rounded
-lnx0014 ln 10.5 -> 2.351375257163478 Inexact Rounded
-lnx0015 ln 9999 -> 9.210240366975849 Inexact Rounded
-lnx0016 ln 1E6 -> 13.81551055796427 Inexact Rounded
-lnx0017 ln 1E+9 -> 20.72326583694641 Inexact Rounded
-lnx0018 ln +Infinity -> Infinity
-
--- notable cases
--- negatives
-lnx0021 ln -1E-9 -> NaN Invalid_operation
-lnx0022 ln -0.0007 -> NaN Invalid_operation
-lnx0023 ln -0.1 -> NaN Invalid_operation
-lnx0024 ln -0.7 -> NaN Invalid_operation
-lnx0025 ln -1 -> NaN Invalid_operation
-lnx0026 ln -1.5 -> NaN Invalid_operation
-lnx0027 ln -2 -> NaN Invalid_operation
-lnx0029 ln -10.5 -> NaN Invalid_operation
-lnx0028 ln -9999 -> NaN Invalid_operation
-lnx0030 ln -2.718281828459045 -> NaN Invalid_operation
-lnx0031 ln -2.718281828459046 -> NaN Invalid_operation
-lnx0032 ln -0 -> -Infinity
-lnx0033 ln -0E+17 -> -Infinity
-lnx0034 ln -0E-17 -> -Infinity
--- other zeros
-lnx0041 ln 0 -> -Infinity
-lnx0042 ln 0E+17 -> -Infinity
-lnx0043 ln 0E-17 -> -Infinity
--- infinities
-lnx0045 ln -Infinity -> NaN Invalid_operation
-lnx0046 ln +Infinity -> Infinity
--- ones
-lnx0050 ln 1 -> 0
-lnx0051 ln 1.0 -> 0
-lnx0052 ln 1.000000000000000 -> 0
-lnx0053 ln 1.000000000000000000 -> 0
-
--- lower precision basics
-Precision: 7
-lnx0101 ln 0 -> -Infinity
-lnx0102 ln 1E-9 -> -20.72327 Inexact Rounded
-lnx0103 ln 0.0007 -> -7.264430 Inexact Rounded
-lnx0104 ln 0.1 -> -2.302585 Inexact Rounded
-lnx0105 ln 0.7 -> -0.3566749 Inexact Rounded
-lnx0106 ln 1 -> 0
-lnx0107 ln 1.5 -> 0.4054651 Inexact Rounded
-lnx0108 ln 2 -> 0.6931472 Inexact Rounded
-lnx0109 ln 2.718281828459045 -> 1.000000 Inexact Rounded
-lnx0110 ln 2.718281828459046 -> 1.000000 Inexact Rounded
-lnx0111 ln 2.718281828459047 -> 1.000000 Inexact Rounded
-lnx0112 ln 10 -> 2.302585 Inexact Rounded
-lnx0113 ln 10.5 -> 2.351375 Inexact Rounded
-lnx0114 ln 9999 -> 9.210240 Inexact Rounded
-lnx0115 ln 1E6 -> 13.81551 Inexact Rounded
-lnx0116 ln 1E+9 -> 20.72327 Inexact Rounded
-lnx0117 ln +Infinity -> Infinity
-Precision: 2
-lnx0121 ln 0 -> -Infinity
-lnx0122 ln 1E-9 -> -21 Inexact Rounded
-lnx0123 ln 0.0007 -> -7.3 Inexact Rounded
-lnx0124 ln 0.1 -> -2.3 Inexact Rounded
-lnx0125 ln 0.7 -> -0.36 Inexact Rounded
-lnx0126 ln 1 -> 0
-lnx0127 ln 1.5 -> 0.41 Inexact Rounded
-lnx0128 ln 2 -> 0.69 Inexact Rounded
-lnx0129 ln 2.718281828459045 -> 1.0 Inexact Rounded
-lnx0130 ln 2.718281828459046 -> 1.0 Inexact Rounded
-lnx0131 ln 2.718281828459047 -> 1.0 Inexact Rounded
-lnx0132 ln 10 -> 2.3 Inexact Rounded
-lnx0133 ln 10.5 -> 2.4 Inexact Rounded
-lnx0134 ln 9999 -> 9.2 Inexact Rounded
-lnx0135 ln 1E6 -> 14 Inexact Rounded
-lnx0136 ln 1E+9 -> 21 Inexact Rounded
-lnx0137 ln +Infinity -> Infinity
-Precision: 1
-lnx0141 ln 0 -> -Infinity
-lnx0142 ln 1E-9 -> -2E+1 Inexact Rounded
-lnx0143 ln 0.0007 -> -7 Inexact Rounded
-lnx0144 ln 0.1 -> -2 Inexact Rounded
-lnx0145 ln 0.7 -> -0.4 Inexact Rounded
-lnx0146 ln 1 -> 0
-lnx0147 ln 1.5 -> 0.4 Inexact Rounded
-lnx0148 ln 2 -> 0.7 Inexact Rounded
-lnx0149 ln 2.718281828459045 -> 1 Inexact Rounded
-lnx0150 ln 2.718281828459046 -> 1 Inexact Rounded
-lnx0151 ln 2.718281828459047 -> 1 Inexact Rounded
-lnx0152 ln 10 -> 2 Inexact Rounded
-lnx0153 ln 10.5 -> 2 Inexact Rounded
-lnx0154 ln 9999 -> 9 Inexact Rounded
-lnx0155 ln 1E6 -> 1E+1 Inexact Rounded
-lnx0156 ln 1E+9 -> 2E+1 Inexact Rounded
-lnx0157 ln +Infinity -> Infinity
-
--- group low-precision ln(1)s:
-precision: 1
-lnx0161 ln 1 -> 0
-precision: 2
-lnx0162 ln 1 -> 0
-precision: 3
-lnx0163 ln 1 -> 0
-precision: 4
-lnx0164 ln 1 -> 0
-precision: 5
-lnx0165 ln 1 -> 0
-precision: 6
-lnx0166 ln 1 -> 0
-precision: 7
-lnx0167 ln 1 -> 0
-precision: 8
-lnx0168 ln 1 -> 0
-
--- edge-test ln(2) and ln(10) in case of lookasides
-precision: 45
-lnx201 ln 2 -> 0.693147180559945309417232121458176568075500134 Inexact Rounded
-lnx202 ln 10 -> 2.30258509299404568401799145468436420760110149 Inexact Rounded
-precision: 44
-lnx203 ln 2 -> 0.69314718055994530941723212145817656807550013 Inexact Rounded
-lnx204 ln 10 -> 2.3025850929940456840179914546843642076011015 Inexact Rounded
-precision: 43
-lnx205 ln 2 -> 0.6931471805599453094172321214581765680755001 Inexact Rounded
-lnx206 ln 10 -> 2.302585092994045684017991454684364207601101 Inexact Rounded
-precision: 42
-lnx207 ln 2 -> 0.693147180559945309417232121458176568075500 Inexact Rounded
-lnx208 ln 10 -> 2.30258509299404568401799145468436420760110 Inexact Rounded
-precision: 41
-lnx209 ln 2 -> 0.69314718055994530941723212145817656807550 Inexact Rounded
-lnx210 ln 10 -> 2.3025850929940456840179914546843642076011 Inexact Rounded
-precision: 40
-lnx211 ln 2 -> 0.6931471805599453094172321214581765680755 Inexact Rounded
-lnx212 ln 10 -> 2.302585092994045684017991454684364207601 Inexact Rounded
-precision: 39
-lnx213 ln 2 -> 0.693147180559945309417232121458176568076 Inexact Rounded
-lnx214 ln 10 -> 2.30258509299404568401799145468436420760 Inexact Rounded
-precision: 38
-lnx215 ln 2 -> 0.69314718055994530941723212145817656808 Inexact Rounded
-lnx216 ln 10 -> 2.3025850929940456840179914546843642076 Inexact Rounded
-precision: 37
-lnx217 ln 2 -> 0.6931471805599453094172321214581765681 Inexact Rounded
-lnx218 ln 10 -> 2.302585092994045684017991454684364208 Inexact Rounded
-precision: 36
-lnx219 ln 2 -> 0.693147180559945309417232121458176568 Inexact Rounded
-lnx220 ln 10 -> 2.30258509299404568401799145468436421 Inexact Rounded
-precision: 35
-lnx221 ln 2 -> 0.69314718055994530941723212145817657 Inexact Rounded
-lnx222 ln 10 -> 2.3025850929940456840179914546843642 Inexact Rounded
-precision: 34
-lnx223 ln 2 -> 0.6931471805599453094172321214581766 Inexact Rounded
-lnx224 ln 10 -> 2.302585092994045684017991454684364 Inexact Rounded
-precision: 33
-lnx225 ln 2 -> 0.693147180559945309417232121458177 Inexact Rounded
-lnx226 ln 10 -> 2.30258509299404568401799145468436 Inexact Rounded
-precision: 32
-lnx227 ln 2 -> 0.69314718055994530941723212145818 Inexact Rounded
-lnx228 ln 10 -> 2.3025850929940456840179914546844 Inexact Rounded
-precision: 31
-lnx229 ln 2 -> 0.6931471805599453094172321214582 Inexact Rounded
-lnx230 ln 10 -> 2.302585092994045684017991454684 Inexact Rounded
-precision: 30
-lnx231 ln 2 -> 0.693147180559945309417232121458 Inexact Rounded
-lnx232 ln 10 -> 2.30258509299404568401799145468 Inexact Rounded
-
--- extreme input range values
-maxExponent: 384
-minExponent: -383
-Precision: 16
-
-lnx0901 ln 1e-400 -> -921.0340371976183 Inexact Rounded
-lnx0902 ln 1e+400 -> 921.0340371976183 Inexact Rounded
-lnx0903 ln 1e-999999 -> -2302582.790408953 Inexact Rounded
-lnx0904 ln 1e+999999 -> 2302582.790408953 Inexact Rounded
-lnx0905 ln 1e-1000013 -> -2302615.026600255 Inexact Rounded
-lnx0906 ln 2e-1000013 -> -2302614.333453074 Inexact Rounded
-
-lnx0910 ln 9.999999e+999999 -> 2302585.092993946 Inexact Rounded
-lnx0911 ln 9.9999999e+999999 -> 2302585.092994036 Inexact Rounded
-lnx0912 ln 9.99999999e+999999 -> 2302585.092994045 Inexact Rounded
-lnx0913 ln 9.999999999e+999999 -> 2302585.092994046 Inexact Rounded
-lnx0914 ln 9.999999999999e+999999 -> 2302585.092994046 Inexact Rounded
-lnx0915 ln 9.999999999999999e+999999 -> 2302585.092994046 Inexact Rounded
-lnx0916 ln 9.999999999999999999999999e+999999 -> 2302585.092994046 Inexact Rounded
-
--- randoms
--- P=50, within 0-999
-Precision: 50
-maxExponent: 384
-minExponent: -383
-lnx1501 ln 0.00098800906574486388604608477869812518857023768951 -> -6.9198186844033787995945147836955586009548513043689 Inexact Rounded
-lnx1502 ln 158.15866624664623070184595045304145949900714987827 -> 5.0635987458895647454907806507503825602758392287684 Inexact Rounded
-lnx1503 ln 0.00565661412059571925040285814021799775249288309321 -> -5.1749297776760632102047540300491550931651318975237 Inexact Rounded
-lnx1504 ln 0.00000006914232532620489602008402091666547903180607 -> -16.487098770877825308138976818688771638172333034347 Inexact Rounded
-lnx1505 ln 0.00025380374621297657504661540749355251231770070723 -> -8.2789492423005003205242162741569033124260321954589 Inexact Rounded
-lnx1506 ln 83.033654063877426261108592599182418953442677554806 -> 4.4192459962647137976949249810815698465031609843669 Inexact Rounded
-lnx1507 ln 0.00000000416863228092481651627734668440663678118729 -> -19.295677845122141772791294599714950175284915666430 Inexact Rounded
-lnx1508 ln 0.00000140847873187820570181214271960511080523457669 -> -13.473000349581967189668305314384952251556809480339 Inexact Rounded
-lnx1509 ln 66.176106555181527101630351127583944689752069132522 -> 4.1923194696232505883666171116966137694013431504252 Inexact Rounded
-lnx1510 ln 0.00000000000009899043487403590900111602024562297908 -> -29.943753166877840985821508112917991506656545174163 Inexact Rounded
-lnx1511 ln 0.00000000000324618296721747097510453388683912733569 -> -26.453541281444586819009546418577507163362590139422 Inexact Rounded
-lnx1512 ln 72.646968818463546449499147579023555008392860423385 -> 4.2856116660689646882852128853423566276718230426479 Inexact Rounded
-lnx1513 ln 0.00000000000000066755483124635612574263153825990523 -> -34.942910142802769319262875080398852491588707172483 Inexact Rounded
-lnx1514 ln 61.002910447202398204114909451851111424657671911002 -> 4.1109215752843377323363182051446177066434038096529 Inexact Rounded
-lnx1515 ln 917.06917611331980999227893584010544542312239174774 -> 6.8211829068303114128752453661946446979787826282907 Inexact Rounded
-lnx1516 ln 0.00000000170823794883673083358549749078972003965194 -> -20.187803436976150477297246666771626827057191023004 Inexact Rounded
-lnx1517 ln 0.53731767845358224445809761315159249898566542910649 -> -0.62116577939968409211736413628236285160048357000961 Inexact Rounded
-lnx1518 ln 0.00000000000000008965291392882804161299758708033373 -> -36.950585970980857376081265073276303670820056916206 Inexact Rounded
-lnx1519 ln 0.00000000006990244916026429904498278982530170295668 -> -23.383920429244457578373523508427783144589480420753 Inexact Rounded
-lnx1520 ln 4.0312542977070300070506064666536478373801988540614 -> 1.3940775676592451945795752796421391871302024763305 Inexact Rounded
-lnx1521 ln 271.84991311551875601432518819562391699324632396423 -> 5.6052501239873862517916679747146539808077431873478 Inexact Rounded
-lnx1522 ln 7.4118671629373864667229445746862314443895404818689 -> 2.0030823863706344628239147639318289961917060121141 Inexact Rounded
-lnx1523 ln 0.00000000000002026311452625364905357321664186034258 -> -31.529974180054438792043856877314043794320951134754 Inexact Rounded
-lnx1524 ln 0.00000000000009563398651261756952398250624737809347 -> -29.978248130576972953141284136962670021368834792579 Inexact Rounded
-lnx1525 ln 0.00000000009556772669409858653026558223465197808991 -> -23.071185939748285541228206161472956661196956741186 Inexact Rounded
-lnx1526 ln 6.8441648298027301292342057248737326152250794026761 -> 1.9233964395801946597272589473417948024361005082908 Inexact Rounded
-lnx1527 ln 0.00000000000073059699884439979394945822035704264577 -> -27.944914388353724718836101828677771967128509603158 Inexact Rounded
-lnx1528 ln 0.00000000000000002610078280419082263138064745416787 -> -38.184566367516207885573773320135965798717120735115 Inexact Rounded
-lnx1529 ln 0.00000000000000000150259517166294243088546806083283 -> -41.039337946266676108538170837580051699618334928421 Inexact Rounded
-lnx1530 ln 0.00000000000000087919160541714580707181969708502091 -> -34.667528818827671507514319744047440696187358676848 Inexact Rounded
-lnx1531 ln 0.00000000000395726725120787763271849577708068584598 -> -26.255467416961357741818735787226671938678424748431 Inexact Rounded
-lnx1532 ln 0.00000000002014334901669366218018377213150715938355 -> -24.628146955635359035289123027319969201693737159108 Inexact Rounded
-lnx1533 ln 0.00000008097927101101093117753938766241442896030637 -> -16.329072628469715178637178365710373398203190937454 Inexact Rounded
-lnx1534 ln 0.00000000000017115834162632864392039668116243984176 -> -29.396187292434898225453626794459285157263177528034 Inexact Rounded
-lnx1535 ln 0.39168317593866334087305459933723864294857086105035 -> -0.93730199062757240485836637306785037368746737693029 Inexact Rounded
-lnx1536 ln 79.335036798971515026519630103325369729637514127617 -> 4.3736798570287828823772149735170431010616961976965 Inexact Rounded
-lnx1537 ln 0.00000000000000056004952129926137413602116591493625 -> -35.118506463181870020730685884333000241039028127213 Inexact Rounded
-lnx1538 ln 0.00000006006035907843890918832481099660639553666078 -> -16.627915795747112566532705974853114454405010472043 Inexact Rounded
-lnx1539 ln 0.00000000085242024937414906371333826574632450587590 -> -20.882941460268101080186482230657774997273494107221 Inexact Rounded
-lnx1540 ln 0.00000000000043671099499262350316173246550771951561 -> -28.459504757285639221776305968469058854558726593945 Inexact Rounded
-
--- P=34, within 0-999
-Precision: 34
-lnx1201 ln 0.0086732880815927182997566810334394 -> -4.747507311920844752486938187973721 Inexact Rounded
-lnx1202 ln 0.0007104103693460260609792222569854 -> -7.249667769903503023005549250347695 Inexact Rounded
-lnx1203 ln 786.8398945385105190697541493392742 -> 6.668024790031836340471824147010546 Inexact Rounded
-lnx1204 ln 0.7723073620282687656895190171967399 -> -0.2583726708506850868786816238217326 Inexact Rounded
-lnx1205 ln 0.0061057951517197631287183938412200 -> -5.098516933918797347064454103742635 Inexact Rounded
-lnx1206 ln 0.6181379708184393730103917562498745 -> -0.4810435926903365087463387760350021 Inexact Rounded
-lnx1207 ln 09.13888261229039989110753389096760 -> 2.212538125507975574509563027696021 Inexact Rounded
-lnx1208 ln 802.0105417063143696497292158147174 -> 6.687121752052341737234832203350214 Inexact Rounded
-lnx1209 ln 778.7749710387773713523028497333058 -> 6.657722135126935472086625031413031 Inexact Rounded
-lnx1210 ln 0.0024457295895346502513567679390616 -> -6.013411799940245345321348290398517 Inexact Rounded
-lnx1211 ln 0.0000511296947872828310338864217860 -> -9.881145118237281798081573131711636 Inexact Rounded
-lnx1212 ln 0.0000246803508602554924938685155658 -> -10.60950314264825661825360971430218 Inexact Rounded
-lnx1213 ln 9.027898199253511668242977766616082 -> 2.200319582778899029786017830557293 Inexact Rounded
-lnx1214 ln 0.0991812396542505631850692800904188 -> -2.310806398964672258823043180400384 Inexact Rounded
-lnx1215 ln 0.0000000000070238810143028811223924 -> -25.68170519961636647174714538290075 Inexact Rounded
-lnx1216 ln 2.630101665342826494730394729313167 -> 0.9670225014664367465128243039749559 Inexact Rounded
-lnx1217 ln 0.0056878928594359587691526063254683 -> -5.169415422904037819736637399445096 Inexact Rounded
-lnx1218 ln 567.3436047121057843908106573095590 -> 6.340965124964258486463444360787970 Inexact Rounded
-lnx1219 ln 1.199291248124655996614605745649725 -> 0.1817307557425911805765087755675657 Inexact Rounded
-lnx1220 ln 25.02050448582031098696267479135557 -> 3.219695668137659139544178905459317 Inexact Rounded
-lnx1221 ln 0.0000000000009939597023558756961300 -> -27.63707972996537636504396558259058 Inexact Rounded
-lnx1222 ln 0.0000007988551670159429716506430403 -> -14.04008617542597230988198612376415 Inexact Rounded
-lnx1223 ln 4.681515800176129184873770605589795 -> 1.543621946415383338972124445445748 Inexact Rounded
-lnx1224 ln 15.95126669161103011206658749345781 -> 2.769538242479483539275986395443539 Inexact Rounded
-lnx1225 ln 0.0301626783922211213675457279076066 -> -3.501149933677283341023932281826341 Inexact Rounded
-lnx1226 ln 000.0040544064881821770528475185674 -> -5.507950967557021671647165889608324 Inexact Rounded
-lnx1227 ln 29.01617095935593792095913785100360 -> 3.367853293862745651888450004473297 Inexact Rounded
-lnx1228 ln 78.01836167344736733024804243195323 -> 4.356944205055768575987781375003992 Inexact Rounded
-lnx1229 ln 0.0000000096545319316965321158634893 -> -18.45583840160965814462095477365013 Inexact Rounded
-lnx1230 ln 97.95475237720579752770587185074428 -> 4.584505661612812742208619358214729 Inexact Rounded
-lnx1231 ln 528.0609262050423246402564228432371 -> 6.269211667589138113396583894315956 Inexact Rounded
-lnx1232 ln 0.0000002250064349732969696660452972 -> -15.30713683526963996712167701738724 Inexact Rounded
-lnx1233 ln 47.97063637767998658567199049725754 -> 3.870589081585660692195989854842372 Inexact Rounded
-lnx1234 ln 0.0005394311344541432318853513414361 -> -7.524995428393925934087126702974121 Inexact Rounded
-lnx1235 ln 0.0000000090973385649567471674972633 -> -18.51528393158931783447035004125791 Inexact Rounded
-lnx1236 ln 0.0000000000238776490227576197317977 -> -24.45807828188389561331158879207262 Inexact Rounded
-lnx1237 ln 0.0000236587000231921532145326218758 -> -10.65177964499823314952429277979034 Inexact Rounded
-lnx1238 ln 499.1277448846130709827154556125942 -> 6.212862064761427967461188083514774 Inexact Rounded
-lnx1239 ln 0.0000003960192300284787663712417647 -> -14.74180306619298548093697608293284 Inexact Rounded
-lnx1240 ln 41.08268350829477451667228892495136 -> 3.715586706887278039173584859218960 Inexact Rounded
-
--- P=16, within 0-99
-Precision: 16
-lnx1101 ln 7.964875261033948 -> 2.075041282352241 Inexact Rounded
-lnx1102 ln 13.54527396845394 -> 2.606037701870263 Inexact Rounded
-lnx1103 ln 0.0008026554341331 -> -7.127585034321814 Inexact Rounded
-lnx1104 ln 0.0000030582233261 -> -12.69767642300625 Inexact Rounded
-lnx1105 ln 0.0004477497509672 -> -7.711276073210766 Inexact Rounded
-lnx1106 ln 7.616268622474371 -> 2.030286567675148 Inexact Rounded
-lnx1107 ln 51.58329925806381 -> 3.943197962309569 Inexact Rounded
-lnx1108 ln 0.0018197497951263 -> -6.309056262549345 Inexact Rounded
-lnx1109 ln 2.956282457072984 -> 1.083932552334575 Inexact Rounded
-lnx1110 ln 0.3843325579189906 -> -0.9562470649400558 Inexact Rounded
-lnx1111 ln 0.0074466329265663 -> -4.899993304919237 Inexact Rounded
-lnx1112 ln 0.0003372478532993 -> -7.994692428206378 Inexact Rounded
-lnx1113 ln 0.0084792263167809 -> -4.770136069569271 Inexact Rounded
-lnx1114 ln 5.926756998151102 -> 1.779477182834305 Inexact Rounded
-lnx1115 ln 9.025699152180897 -> 2.200075969604119 Inexact Rounded
-lnx1116 ln 1.910124643533526 -> 0.6471684983238183 Inexact Rounded
-lnx1117 ln 0.8158922711411020 -> -0.2034729533939387 Inexact Rounded
-lnx1118 ln 0.0067080016475322 -> -5.004454189414139 Inexact Rounded
-lnx1119 ln 0.0047583242092716 -> -5.347859729601094 Inexact Rounded
-lnx1120 ln 0.0386647411641339 -> -3.252827175263113 Inexact Rounded
-lnx1121 ln 0.0050226427841761 -> -5.293799032774131 Inexact Rounded
-lnx1122 ln 6.927937541637261 -> 1.935562155866906 Inexact Rounded
-lnx1123 ln 0.0000095745343513 -> -11.55640365579814 Inexact Rounded
-lnx1124 ln 1.602465492956538 -> 0.4715433763243936 Inexact Rounded
-lnx1125 ln 38.98415625087535 -> 3.663155313610213 Inexact Rounded
-lnx1126 ln 5.343182042276734 -> 1.675821363568112 Inexact Rounded
-lnx1127 ln 55.89763703245816 -> 4.023522107934110 Inexact Rounded
-lnx1128 ln 0.7445257810280847 -> -0.2950077988101030 Inexact Rounded
-lnx1129 ln 1.631407314946094 -> 0.4894430257201248 Inexact Rounded
-lnx1130 ln 0.0005462451932602 -> -7.512442611116852 Inexact Rounded
-lnx1131 ln 0.0000864173269362 -> -9.356322359017317 Inexact Rounded
-lnx1132 ln 5.227161719132849 -> 1.653868438439637 Inexact Rounded
-lnx1133 ln 60.57078466941998 -> 4.103812675662452 Inexact Rounded
-lnx1134 ln 0.0992864325333160 -> -2.309746348350318 Inexact Rounded
-lnx1135 ln 09.48564268447325 -> 2.249779359074983 Inexact Rounded
-lnx1136 ln 0.0036106089355634 -> -5.623878840650787 Inexact Rounded
-lnx1137 ln 1.805176865587172 -> 0.5906585734593707 Inexact Rounded
-lnx1138 ln 62.59363259642255 -> 4.136663557220559 Inexact Rounded
-lnx1139 ln 4.373828261137201 -> 1.475638657912000 Inexact Rounded
-lnx1140 ln 0.994483524148738 -> -0.005531747794938690 Inexact Rounded
-
--- P=7, within 0-9
-Precision: 7
-lnx1001 ln 0.0912025 -> -2.394673 Inexact Rounded
-lnx1002 ln 0.9728626 -> -0.02751242 Inexact Rounded
-lnx1003 ln 0.3886032 -> -0.9451965 Inexact Rounded
-lnx1004 ln 8.798639 -> 2.174597 Inexact Rounded
-lnx1005 ln 2.459121 -> 0.8998040 Inexact Rounded
-lnx1006 ln 2.013193 -> 0.6997220 Inexact Rounded
-lnx1007 ln 9.064857 -> 2.204405 Inexact Rounded
-lnx1008 ln 5.796417 -> 1.757240 Inexact Rounded
-lnx1009 ln 0.1143471 -> -2.168517 Inexact Rounded
-lnx1010 ln 0.5341542 -> -0.6270707 Inexact Rounded
-lnx1011 ln 6.693781 -> 1.901179 Inexact Rounded
-lnx1012 ln 0.0081779 -> -4.806320 Inexact Rounded
-lnx1013 ln 8.313616 -> 2.117895 Inexact Rounded
-lnx1014 ln 3.486925 -> 1.249020 Inexact Rounded
-lnx1015 ln 0.1801401 -> -1.714020 Inexact Rounded
-lnx1016 ln 0.5227148 -> -0.6487193 Inexact Rounded
-lnx1017 ln 7.818111 -> 2.056443 Inexact Rounded
-lnx1018 ln 0.0870671 -> -2.441076 Inexact Rounded
-lnx1019 ln 8.153966 -> 2.098504 Inexact Rounded
-lnx1020 ln 2.040975 -> 0.7134276 Inexact Rounded
-lnx1021 ln 1.481642 -> 0.3931509 Inexact Rounded
-lnx1022 ln 0.2610123 -> -1.343188 Inexact Rounded
-lnx1023 ln 0.466723 -> -0.7620193 Inexact Rounded
-lnx1024 ln 0.0518756 -> -2.958907 Inexact Rounded
-lnx1025 ln 2.056410 -> 0.7209617 Inexact Rounded
-lnx1026 ln 0.181522 -> -1.706378 Inexact Rounded
-lnx1027 ln 0.515551 -> -0.6625190 Inexact Rounded
-lnx1028 ln 8.425089 -> 2.131214 Inexact Rounded
-lnx1029 ln 2.077091 -> 0.7309684 Inexact Rounded
-lnx1030 ln 6.212705 -> 1.826596 Inexact Rounded
-lnx1031 ln 5.729343 -> 1.745601 Inexact Rounded
-lnx1032 ln 4.831251 -> 1.575105 Inexact Rounded
-lnx1033 ln 2.029760 -> 0.7079176 Inexact Rounded
-lnx1034 ln 8.615060 -> 2.153512 Inexact Rounded
-lnx1035 ln 0.0611511 -> -2.794407 Inexact Rounded
-lnx1036 ln 5.195269 -> 1.647748 Inexact Rounded
-lnx1037 ln 9.617686 -> 2.263604 Inexact Rounded
-lnx1038 ln 0.0049382 -> -5.310754 Inexact Rounded
-lnx1039 ln 2.786840 -> 1.024908 Inexact Rounded
-lnx1040 ln 0.0091073 -> -4.698679 Inexact Rounded
-
--- from here 3-digit tests are based on reverse exp tests
-precision: 9
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
-lnx001 ln 0 -> -Infinity
-lnx002 ln 0.367879441 -> -1.00000000 Inexact Rounded
-lnx003 ln 1 -> 0
-lnx005 ln 2.71828183 -> 1.00000000 Inexact Rounded
-lnx006 ln 2.00000000 -> 0.693147181 Inexact Rounded
-lnx007 ln +Infinity -> Infinity
-
--- tiny edge cases
-precision: 7
-lnx011 ln 1.105171 -> 0.1000001 Inexact Rounded
-lnx012 ln 1.010050 -> 0.009999835 Inexact Rounded
-lnx013 ln 1.000010 -> 0.000009999950 Inexact Rounded
-lnx014 ln 1.000001 -> 9.999995E-7 Inexact Rounded
-lnx015 ln 1.000000 -> 0
-
--- basic e=0, e=1, e=2, e=4, e>=8 cases
-precision: 7
-lnx041 ln 2.718282 -> 1.000000 Inexact Rounded
-lnx042 ln 0.3678794 -> -1.000000 Inexact Rounded
-lnx043 ln 22026.47 -> 10.00000 Inexact Rounded
-lnx044 ln 0.00004539993 -> -10.00000 Inexact Rounded
-lnx045 ln 2.688117E+43 -> 100.0000 Inexact Rounded
-lnx046 ln 3.720076E-44 -> -100.0000 Inexact Rounded
-lnx047 ln Infinity -> Infinity
-lnx048 ln 0E-389 -> -Infinity
-
--- miscellanea
-precision: 16
-lnx055 ln 2.717658486884572E-236 -> -542.4103112874415 Inexact Rounded
-precision: 17
-lnx056 ln 2.7176584868845721E-236 -> -542.41031128744146 Inexact Rounded
-precision: 18
-lnx057 ln 2.71765848688457211E-236 -> -542.410311287441459 Inexact Rounded
-precision: 19
-lnx058 ln 2.717658486884572112E-236 -> -542.4103112874414592 Inexact Rounded
-precision: 20
-lnx059 ln 2.7176584868845721118E-236 -> -542.41031128744145917 Inexact Rounded
-
--- inputs ending in ..500.., ..499.., ..100.., ..999.. sequences
-precision: 50
-lnx102 ln 0.9999999100000040499998785000027 -> -9.0000000000000000000000033749953829996446124861750E-8 Inexact Rounded
-precision: 30
-lnx103 ln 0.999999910000004049999878500003 -> -8.99999999999999999999997337499E-8 Inexact Rounded
-precision: 29
-lnx104 ln 0.99999991000000404999987850000 -> -9.0000000000000000000002733750E-8 Inexact Rounded
-precision: 28
-lnx105 ln 0.9999999100000040499998785000 -> -9.000000000000000000000273375E-8 Inexact Rounded
-precision: 27
-lnx106 ln 0.999999910000004049999878500 -> -9.00000000000000000000027338E-8 Inexact Rounded
-precision: 26
-lnx107 ln 0.99999991000000404999987850 -> -9.0000000000000000000002734E-8 Inexact Rounded
-precision: 25
-lnx108 ln 0.9999999100000040499998785 -> -9.000000000000000000000273E-8 Inexact Rounded
-precision: 24
-lnx109 ln 0.999999910000004049999879 -> -8.99999999999999995000027E-8 Inexact Rounded
-precision: 23
-lnx110 ln 0.99999991000000404999988 -> -8.9999999999999998500003E-8 Inexact Rounded
-precision: 22
-lnx111 ln 0.9999999100000040499999 -> -8.999999999999997850000E-8 Inexact Rounded
-precision: 21
-lnx112 ln 0.999999910000004050000 -> -8.99999999999998785000E-8 Inexact Rounded
-precision: 20
-lnx113 ln 0.99999991000000405000 -> -8.9999999999999878500E-8 Inexact Rounded
-precision: 19
-lnx114 ln 0.9999999100000040500 -> -8.999999999999987850E-8 Inexact Rounded
-precision: 18
-lnx115 ln 0.999999910000004050 -> -8.99999999999998785E-8 Inexact Rounded
--- next may be a > 0.5ulp case; a more precise answer is:
--- -8.99999999999998784999918E-8
-precision: 17
-lnx116 ln 0.99999991000000405 -> -8.9999999999999878E-8 Inexact Rounded
-precision: 16
-lnx117 ln 0.9999999100000040 -> -9.000000004999988E-8 Inexact Rounded
-precision: 15
-lnx118 ln 0.999999910000004 -> -9.00000000499999E-8 Inexact Rounded
-precision: 14
-lnx119 ln 0.99999991000000 -> -9.0000004050000E-8 Inexact Rounded
-precision: 13
-lnx120 ln 0.9999999100000 -> -9.000000405000E-8 Inexact Rounded
-precision: 12
-lnx121 ln 0.999999910000 -> -9.00000040500E-8 Inexact Rounded
-precision: 11
-lnx122 ln 0.99999991000 -> -9.0000004050E-8 Inexact Rounded
-precision: 10
-lnx123 ln 0.9999999100 -> -9.000000405E-8 Inexact Rounded
-precision: 9
-lnx124 ln 0.999999910 -> -9.00000041E-8 Inexact Rounded
-precision: 8
-lnx125 ln 0.99999991 -> -9.0000004E-8 Inexact Rounded
-precision: 7
-lnx126 ln 0.9999999 -> -1.000000E-7 Inexact Rounded
-precision: 16
-lnx126b ln 0.9999999 -> -1.000000050000003E-7 Inexact Rounded
-precision: 6
-lnx127 ln 0.999999 -> -0.00000100000 Inexact Rounded
-precision: 5
-lnx128 ln 0.99999 -> -0.000010000 Inexact Rounded
-precision: 4
-lnx129 ln 0.9999 -> -0.0001000 Inexact Rounded
-precision: 3
-lnx130 ln 0.999 -> -0.00100 Inexact Rounded
-precision: 2
-lnx131 ln 0.99 -> -0.010 Inexact Rounded
-precision: 1
-lnx132 ln 0.9 -> -0.1 Inexact Rounded
-
-
--- cases near 1 -- 1 2345678901234567890
-precision: 20
-lnx401 ln 2.7182818284589365041 -> 0.99999999999996000000 Inexact Rounded
-lnx402 ln 2.7182818284589636869 -> 0.99999999999997000000 Inexact Rounded
-lnx403 ln 2.7182818284589908697 -> 0.99999999999997999999 Inexact Rounded
-lnx404 ln 2.7182818284590180525 -> 0.99999999999998999998 Inexact Rounded
-lnx405 ln 2.7182818284590452354 -> 1.0000000000000000000 Inexact Rounded
-lnx406 ln 2.7182818284593170635 -> 1.0000000000001000000 Inexact Rounded
-lnx407 ln 2.7182818284595888917 -> 1.0000000000002000000 Inexact Rounded
-precision: 14
-lnx411 ln 2.7182818284589 -> 0.99999999999995 Inexact Rounded
-lnx413 ln 2.7182818284590 -> 0.99999999999998 Inexact Rounded
-lnx416 ln 2.7182818284591 -> 1.0000000000000 Inexact Rounded
-lnx417 ln 2.7182818284592 -> 1.0000000000001 Inexact Rounded
-
--- overflows, including some exp overprecise borderlines
-precision: 7
-maxExponent: 384
-minExponent: -383
-lnx709 ln 9.999999E+384 -> 886.4953 Inexact Rounded
-lnx711 ln 9.999992E+384 -> 886.4953 Inexact Rounded
-precision: 16
-lnx722 ln 9.999999999999999E+384 -> 886.4952608027076 Inexact Rounded
-lnx724 ln 9.999999999999917E+384 -> 886.4952608027076 Inexact Rounded
-lnx726 ln 9.999999999999117E+384 -> 886.4952608027075 Inexact Rounded
--- and more...
-precision: 15
-maxExponent: 999
-minExponent: -999
-lnx731 ln 9.99999999999999E+999 -> 2302.58509299405 Inexact Rounded
--- next may be a > 0.5ulp case; a more precise answer is:
--- 2302.58509299404495001799145442
-lnx732 ln 9.99999999999266E+999 -> 2302.58509299404 Inexact Rounded
-lnx733 ln 9.99999999999265E+999 -> 2302.58509299404 Inexact Rounded
-lnx734 ln 9.99999999999264E+999 -> 2302.58509299404 Inexact Rounded
-
--- subnormals and underflows for exp, including underflow-to-zero edge point
-precision: 7
-maxExponent: 384
-minExponent: -383
-lnx751 ln 0E-389 -> -Infinity
-lnx758 ln 1.000001E-383 -> -881.8901 Inexact Rounded
-lnx759 ln 9.99991E-384 -> -881.8901 Inexact Rounded
-lnx760 ln 4.4605E-385 -> -885.0000 Inexact Rounded
-lnx761 ln 2.221E-386 -> -887.9999 Inexact Rounded
-lnx762 ln 3.01E-387 -> -889.9985 Inexact Rounded
-lnx763 ln 1.7E-388 -> -892.8724 Inexact Rounded
-lnx764 ln 1.5E-388 -> -892.9976 Inexact Rounded
-lnx765 ln 9E-389 -> -893.5084 Inexact Rounded
-lnx766 ln 1E-389 -> -895.7056 Inexact Rounded
-lnx774 ln 0E-389 -> -Infinity
-
--- special values
-lnx820 ln Infinity -> Infinity
-lnx821 ln 0 -> -Infinity
-lnx822 ln NaN -> NaN
-lnx823 ln sNaN -> NaN Invalid_operation
--- propagating NaNs
-lnx824 ln sNaN123 -> NaN123 Invalid_operation
-lnx825 ln -sNaN321 -> -NaN321 Invalid_operation
-lnx826 ln NaN456 -> NaN456
-lnx827 ln -NaN654 -> -NaN654
-lnx828 ln NaN1 -> NaN1
-
--- Invalid operations due to restrictions
--- [next two probably skipped by most test harnesses]
-precision: 100000000
-lnx901 ln 1 -> NaN Invalid_context
-precision: 99999999
-lnx902 ln 0 -> NaN Invalid_context
-
-precision: 9
-maxExponent: 1000000
-minExponent: -999999
-lnx903 ln 1 -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999999
-lnx904 ln 0 -> -Infinity
-maxExponent: 999999
-minExponent: -1000000
-lnx905 ln 1 -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999998
-lnx906 ln 0 -> -Infinity
-
--- payload decapitate
-precision: 5
-lnx910 ln -sNaN1234567890 -> -NaN67890 Invalid_operation
-
--- Null test
-lnx900 ln # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- ln.decTest -- decimal natural logarithm --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 16
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- basics (examples in specification)
+precision: 9
+lnxs001 ln 0 -> -Infinity
+lnxs002 ln 1.000 -> 0
+lnxs003 ln 2.71828183 -> 1.00000000 Inexact Rounded
+lnxs004 ln 10 -> 2.30258509 Inexact Rounded
+lnxs005 ln +Infinity -> Infinity
+
+
+-- basics
+precision: 16
+lnx0001 ln 0 -> -Infinity
+lnx0002 ln 1E-9 -> -20.72326583694641 Inexact Rounded
+lnx0003 ln 0.0007 -> -7.264430222920869 Inexact Rounded
+lnx0004 ln 0.1 -> -2.302585092994046 Inexact Rounded
+lnx0005 ln 0.7 -> -0.3566749439387324 Inexact Rounded
+lnx0006 ln 1 -> 0
+lnx0007 ln 1.000 -> 0
+lnx0008 ln 1.5 -> 0.4054651081081644 Inexact Rounded
+lnx0009 ln 2 -> 0.6931471805599453 Inexact Rounded
+lnx0010 ln 2.718281828459045 -> 0.9999999999999999 Inexact Rounded
+lnx0011 ln 2.718281828459046 -> 1.000000000000000 Inexact Rounded
+lnx0012 ln 2.718281828459047 -> 1.000000000000001 Inexact Rounded
+lnx0013 ln 10 -> 2.302585092994046 Inexact Rounded
+lnx0014 ln 10.5 -> 2.351375257163478 Inexact Rounded
+lnx0015 ln 9999 -> 9.210240366975849 Inexact Rounded
+lnx0016 ln 1E6 -> 13.81551055796427 Inexact Rounded
+lnx0017 ln 1E+9 -> 20.72326583694641 Inexact Rounded
+lnx0018 ln +Infinity -> Infinity
+
+-- notable cases
+-- negatives
+lnx0021 ln -1E-9 -> NaN Invalid_operation
+lnx0022 ln -0.0007 -> NaN Invalid_operation
+lnx0023 ln -0.1 -> NaN Invalid_operation
+lnx0024 ln -0.7 -> NaN Invalid_operation
+lnx0025 ln -1 -> NaN Invalid_operation
+lnx0026 ln -1.5 -> NaN Invalid_operation
+lnx0027 ln -2 -> NaN Invalid_operation
+lnx0029 ln -10.5 -> NaN Invalid_operation
+lnx0028 ln -9999 -> NaN Invalid_operation
+lnx0030 ln -2.718281828459045 -> NaN Invalid_operation
+lnx0031 ln -2.718281828459046 -> NaN Invalid_operation
+lnx0032 ln -0 -> -Infinity
+lnx0033 ln -0E+17 -> -Infinity
+lnx0034 ln -0E-17 -> -Infinity
+-- other zeros
+lnx0041 ln 0 -> -Infinity
+lnx0042 ln 0E+17 -> -Infinity
+lnx0043 ln 0E-17 -> -Infinity
+-- infinities
+lnx0045 ln -Infinity -> NaN Invalid_operation
+lnx0046 ln +Infinity -> Infinity
+-- ones
+lnx0050 ln 1 -> 0
+lnx0051 ln 1.0 -> 0
+lnx0052 ln 1.000000000000000 -> 0
+lnx0053 ln 1.000000000000000000 -> 0
+
+-- lower precision basics
+Precision: 7
+lnx0101 ln 0 -> -Infinity
+lnx0102 ln 1E-9 -> -20.72327 Inexact Rounded
+lnx0103 ln 0.0007 -> -7.264430 Inexact Rounded
+lnx0104 ln 0.1 -> -2.302585 Inexact Rounded
+lnx0105 ln 0.7 -> -0.3566749 Inexact Rounded
+lnx0106 ln 1 -> 0
+lnx0107 ln 1.5 -> 0.4054651 Inexact Rounded
+lnx0108 ln 2 -> 0.6931472 Inexact Rounded
+lnx0109 ln 2.718281828459045 -> 1.000000 Inexact Rounded
+lnx0110 ln 2.718281828459046 -> 1.000000 Inexact Rounded
+lnx0111 ln 2.718281828459047 -> 1.000000 Inexact Rounded
+lnx0112 ln 10 -> 2.302585 Inexact Rounded
+lnx0113 ln 10.5 -> 2.351375 Inexact Rounded
+lnx0114 ln 9999 -> 9.210240 Inexact Rounded
+lnx0115 ln 1E6 -> 13.81551 Inexact Rounded
+lnx0116 ln 1E+9 -> 20.72327 Inexact Rounded
+lnx0117 ln +Infinity -> Infinity
+Precision: 2
+lnx0121 ln 0 -> -Infinity
+lnx0122 ln 1E-9 -> -21 Inexact Rounded
+lnx0123 ln 0.0007 -> -7.3 Inexact Rounded
+lnx0124 ln 0.1 -> -2.3 Inexact Rounded
+lnx0125 ln 0.7 -> -0.36 Inexact Rounded
+lnx0126 ln 1 -> 0
+lnx0127 ln 1.5 -> 0.41 Inexact Rounded
+lnx0128 ln 2 -> 0.69 Inexact Rounded
+lnx0129 ln 2.718281828459045 -> 1.0 Inexact Rounded
+lnx0130 ln 2.718281828459046 -> 1.0 Inexact Rounded
+lnx0131 ln 2.718281828459047 -> 1.0 Inexact Rounded
+lnx0132 ln 10 -> 2.3 Inexact Rounded
+lnx0133 ln 10.5 -> 2.4 Inexact Rounded
+lnx0134 ln 9999 -> 9.2 Inexact Rounded
+lnx0135 ln 1E6 -> 14 Inexact Rounded
+lnx0136 ln 1E+9 -> 21 Inexact Rounded
+lnx0137 ln +Infinity -> Infinity
+Precision: 1
+lnx0141 ln 0 -> -Infinity
+lnx0142 ln 1E-9 -> -2E+1 Inexact Rounded
+lnx0143 ln 0.0007 -> -7 Inexact Rounded
+lnx0144 ln 0.1 -> -2 Inexact Rounded
+lnx0145 ln 0.7 -> -0.4 Inexact Rounded
+lnx0146 ln 1 -> 0
+lnx0147 ln 1.5 -> 0.4 Inexact Rounded
+lnx0148 ln 2 -> 0.7 Inexact Rounded
+lnx0149 ln 2.718281828459045 -> 1 Inexact Rounded
+lnx0150 ln 2.718281828459046 -> 1 Inexact Rounded
+lnx0151 ln 2.718281828459047 -> 1 Inexact Rounded
+lnx0152 ln 10 -> 2 Inexact Rounded
+lnx0153 ln 10.5 -> 2 Inexact Rounded
+lnx0154 ln 9999 -> 9 Inexact Rounded
+lnx0155 ln 1E6 -> 1E+1 Inexact Rounded
+lnx0156 ln 1E+9 -> 2E+1 Inexact Rounded
+lnx0157 ln +Infinity -> Infinity
+
+-- group low-precision ln(1)s:
+precision: 1
+lnx0161 ln 1 -> 0
+precision: 2
+lnx0162 ln 1 -> 0
+precision: 3
+lnx0163 ln 1 -> 0
+precision: 4
+lnx0164 ln 1 -> 0
+precision: 5
+lnx0165 ln 1 -> 0
+precision: 6
+lnx0166 ln 1 -> 0
+precision: 7
+lnx0167 ln 1 -> 0
+precision: 8
+lnx0168 ln 1 -> 0
+
+-- edge-test ln(2) and ln(10) in case of lookasides
+precision: 45
+lnx201 ln 2 -> 0.693147180559945309417232121458176568075500134 Inexact Rounded
+lnx202 ln 10 -> 2.30258509299404568401799145468436420760110149 Inexact Rounded
+precision: 44
+lnx203 ln 2 -> 0.69314718055994530941723212145817656807550013 Inexact Rounded
+lnx204 ln 10 -> 2.3025850929940456840179914546843642076011015 Inexact Rounded
+precision: 43
+lnx205 ln 2 -> 0.6931471805599453094172321214581765680755001 Inexact Rounded
+lnx206 ln 10 -> 2.302585092994045684017991454684364207601101 Inexact Rounded
+precision: 42
+lnx207 ln 2 -> 0.693147180559945309417232121458176568075500 Inexact Rounded
+lnx208 ln 10 -> 2.30258509299404568401799145468436420760110 Inexact Rounded
+precision: 41
+lnx209 ln 2 -> 0.69314718055994530941723212145817656807550 Inexact Rounded
+lnx210 ln 10 -> 2.3025850929940456840179914546843642076011 Inexact Rounded
+precision: 40
+lnx211 ln 2 -> 0.6931471805599453094172321214581765680755 Inexact Rounded
+lnx212 ln 10 -> 2.302585092994045684017991454684364207601 Inexact Rounded
+precision: 39
+lnx213 ln 2 -> 0.693147180559945309417232121458176568076 Inexact Rounded
+lnx214 ln 10 -> 2.30258509299404568401799145468436420760 Inexact Rounded
+precision: 38
+lnx215 ln 2 -> 0.69314718055994530941723212145817656808 Inexact Rounded
+lnx216 ln 10 -> 2.3025850929940456840179914546843642076 Inexact Rounded
+precision: 37
+lnx217 ln 2 -> 0.6931471805599453094172321214581765681 Inexact Rounded
+lnx218 ln 10 -> 2.302585092994045684017991454684364208 Inexact Rounded
+precision: 36
+lnx219 ln 2 -> 0.693147180559945309417232121458176568 Inexact Rounded
+lnx220 ln 10 -> 2.30258509299404568401799145468436421 Inexact Rounded
+precision: 35
+lnx221 ln 2 -> 0.69314718055994530941723212145817657 Inexact Rounded
+lnx222 ln 10 -> 2.3025850929940456840179914546843642 Inexact Rounded
+precision: 34
+lnx223 ln 2 -> 0.6931471805599453094172321214581766 Inexact Rounded
+lnx224 ln 10 -> 2.302585092994045684017991454684364 Inexact Rounded
+precision: 33
+lnx225 ln 2 -> 0.693147180559945309417232121458177 Inexact Rounded
+lnx226 ln 10 -> 2.30258509299404568401799145468436 Inexact Rounded
+precision: 32
+lnx227 ln 2 -> 0.69314718055994530941723212145818 Inexact Rounded
+lnx228 ln 10 -> 2.3025850929940456840179914546844 Inexact Rounded
+precision: 31
+lnx229 ln 2 -> 0.6931471805599453094172321214582 Inexact Rounded
+lnx230 ln 10 -> 2.302585092994045684017991454684 Inexact Rounded
+precision: 30
+lnx231 ln 2 -> 0.693147180559945309417232121458 Inexact Rounded
+lnx232 ln 10 -> 2.30258509299404568401799145468 Inexact Rounded
+
+-- extreme input range values
+maxExponent: 384
+minExponent: -383
+Precision: 16
+
+lnx0901 ln 1e-400 -> -921.0340371976183 Inexact Rounded
+lnx0902 ln 1e+400 -> 921.0340371976183 Inexact Rounded
+lnx0903 ln 1e-999999 -> -2302582.790408953 Inexact Rounded
+lnx0904 ln 1e+999999 -> 2302582.790408953 Inexact Rounded
+lnx0905 ln 1e-1000013 -> -2302615.026600255 Inexact Rounded
+lnx0906 ln 2e-1000013 -> -2302614.333453074 Inexact Rounded
+
+lnx0910 ln 9.999999e+999999 -> 2302585.092993946 Inexact Rounded
+lnx0911 ln 9.9999999e+999999 -> 2302585.092994036 Inexact Rounded
+lnx0912 ln 9.99999999e+999999 -> 2302585.092994045 Inexact Rounded
+lnx0913 ln 9.999999999e+999999 -> 2302585.092994046 Inexact Rounded
+lnx0914 ln 9.999999999999e+999999 -> 2302585.092994046 Inexact Rounded
+lnx0915 ln 9.999999999999999e+999999 -> 2302585.092994046 Inexact Rounded
+lnx0916 ln 9.999999999999999999999999e+999999 -> 2302585.092994046 Inexact Rounded
+
+-- randoms
+-- P=50, within 0-999
+Precision: 50
+maxExponent: 384
+minExponent: -383
+lnx1501 ln 0.00098800906574486388604608477869812518857023768951 -> -6.9198186844033787995945147836955586009548513043689 Inexact Rounded
+lnx1502 ln 158.15866624664623070184595045304145949900714987827 -> 5.0635987458895647454907806507503825602758392287684 Inexact Rounded
+lnx1503 ln 0.00565661412059571925040285814021799775249288309321 -> -5.1749297776760632102047540300491550931651318975237 Inexact Rounded
+lnx1504 ln 0.00000006914232532620489602008402091666547903180607 -> -16.487098770877825308138976818688771638172333034347 Inexact Rounded
+lnx1505 ln 0.00025380374621297657504661540749355251231770070723 -> -8.2789492423005003205242162741569033124260321954589 Inexact Rounded
+lnx1506 ln 83.033654063877426261108592599182418953442677554806 -> 4.4192459962647137976949249810815698465031609843669 Inexact Rounded
+lnx1507 ln 0.00000000416863228092481651627734668440663678118729 -> -19.295677845122141772791294599714950175284915666430 Inexact Rounded
+lnx1508 ln 0.00000140847873187820570181214271960511080523457669 -> -13.473000349581967189668305314384952251556809480339 Inexact Rounded
+lnx1509 ln 66.176106555181527101630351127583944689752069132522 -> 4.1923194696232505883666171116966137694013431504252 Inexact Rounded
+lnx1510 ln 0.00000000000009899043487403590900111602024562297908 -> -29.943753166877840985821508112917991506656545174163 Inexact Rounded
+lnx1511 ln 0.00000000000324618296721747097510453388683912733569 -> -26.453541281444586819009546418577507163362590139422 Inexact Rounded
+lnx1512 ln 72.646968818463546449499147579023555008392860423385 -> 4.2856116660689646882852128853423566276718230426479 Inexact Rounded
+lnx1513 ln 0.00000000000000066755483124635612574263153825990523 -> -34.942910142802769319262875080398852491588707172483 Inexact Rounded
+lnx1514 ln 61.002910447202398204114909451851111424657671911002 -> 4.1109215752843377323363182051446177066434038096529 Inexact Rounded
+lnx1515 ln 917.06917611331980999227893584010544542312239174774 -> 6.8211829068303114128752453661946446979787826282907 Inexact Rounded
+lnx1516 ln 0.00000000170823794883673083358549749078972003965194 -> -20.187803436976150477297246666771626827057191023004 Inexact Rounded
+lnx1517 ln 0.53731767845358224445809761315159249898566542910649 -> -0.62116577939968409211736413628236285160048357000961 Inexact Rounded
+lnx1518 ln 0.00000000000000008965291392882804161299758708033373 -> -36.950585970980857376081265073276303670820056916206 Inexact Rounded
+lnx1519 ln 0.00000000006990244916026429904498278982530170295668 -> -23.383920429244457578373523508427783144589480420753 Inexact Rounded
+lnx1520 ln 4.0312542977070300070506064666536478373801988540614 -> 1.3940775676592451945795752796421391871302024763305 Inexact Rounded
+lnx1521 ln 271.84991311551875601432518819562391699324632396423 -> 5.6052501239873862517916679747146539808077431873478 Inexact Rounded
+lnx1522 ln 7.4118671629373864667229445746862314443895404818689 -> 2.0030823863706344628239147639318289961917060121141 Inexact Rounded
+lnx1523 ln 0.00000000000002026311452625364905357321664186034258 -> -31.529974180054438792043856877314043794320951134754 Inexact Rounded
+lnx1524 ln 0.00000000000009563398651261756952398250624737809347 -> -29.978248130576972953141284136962670021368834792579 Inexact Rounded
+lnx1525 ln 0.00000000009556772669409858653026558223465197808991 -> -23.071185939748285541228206161472956661196956741186 Inexact Rounded
+lnx1526 ln 6.8441648298027301292342057248737326152250794026761 -> 1.9233964395801946597272589473417948024361005082908 Inexact Rounded
+lnx1527 ln 0.00000000000073059699884439979394945822035704264577 -> -27.944914388353724718836101828677771967128509603158 Inexact Rounded
+lnx1528 ln 0.00000000000000002610078280419082263138064745416787 -> -38.184566367516207885573773320135965798717120735115 Inexact Rounded
+lnx1529 ln 0.00000000000000000150259517166294243088546806083283 -> -41.039337946266676108538170837580051699618334928421 Inexact Rounded
+lnx1530 ln 0.00000000000000087919160541714580707181969708502091 -> -34.667528818827671507514319744047440696187358676848 Inexact Rounded
+lnx1531 ln 0.00000000000395726725120787763271849577708068584598 -> -26.255467416961357741818735787226671938678424748431 Inexact Rounded
+lnx1532 ln 0.00000000002014334901669366218018377213150715938355 -> -24.628146955635359035289123027319969201693737159108 Inexact Rounded
+lnx1533 ln 0.00000008097927101101093117753938766241442896030637 -> -16.329072628469715178637178365710373398203190937454 Inexact Rounded
+lnx1534 ln 0.00000000000017115834162632864392039668116243984176 -> -29.396187292434898225453626794459285157263177528034 Inexact Rounded
+lnx1535 ln 0.39168317593866334087305459933723864294857086105035 -> -0.93730199062757240485836637306785037368746737693029 Inexact Rounded
+lnx1536 ln 79.335036798971515026519630103325369729637514127617 -> 4.3736798570287828823772149735170431010616961976965 Inexact Rounded
+lnx1537 ln 0.00000000000000056004952129926137413602116591493625 -> -35.118506463181870020730685884333000241039028127213 Inexact Rounded
+lnx1538 ln 0.00000006006035907843890918832481099660639553666078 -> -16.627915795747112566532705974853114454405010472043 Inexact Rounded
+lnx1539 ln 0.00000000085242024937414906371333826574632450587590 -> -20.882941460268101080186482230657774997273494107221 Inexact Rounded
+lnx1540 ln 0.00000000000043671099499262350316173246550771951561 -> -28.459504757285639221776305968469058854558726593945 Inexact Rounded
+
+-- P=34, within 0-999
+Precision: 34
+lnx1201 ln 0.0086732880815927182997566810334394 -> -4.747507311920844752486938187973721 Inexact Rounded
+lnx1202 ln 0.0007104103693460260609792222569854 -> -7.249667769903503023005549250347695 Inexact Rounded
+lnx1203 ln 786.8398945385105190697541493392742 -> 6.668024790031836340471824147010546 Inexact Rounded
+lnx1204 ln 0.7723073620282687656895190171967399 -> -0.2583726708506850868786816238217326 Inexact Rounded
+lnx1205 ln 0.0061057951517197631287183938412200 -> -5.098516933918797347064454103742635 Inexact Rounded
+lnx1206 ln 0.6181379708184393730103917562498745 -> -0.4810435926903365087463387760350021 Inexact Rounded
+lnx1207 ln 09.13888261229039989110753389096760 -> 2.212538125507975574509563027696021 Inexact Rounded
+lnx1208 ln 802.0105417063143696497292158147174 -> 6.687121752052341737234832203350214 Inexact Rounded
+lnx1209 ln 778.7749710387773713523028497333058 -> 6.657722135126935472086625031413031 Inexact Rounded
+lnx1210 ln 0.0024457295895346502513567679390616 -> -6.013411799940245345321348290398517 Inexact Rounded
+lnx1211 ln 0.0000511296947872828310338864217860 -> -9.881145118237281798081573131711636 Inexact Rounded
+lnx1212 ln 0.0000246803508602554924938685155658 -> -10.60950314264825661825360971430218 Inexact Rounded
+lnx1213 ln 9.027898199253511668242977766616082 -> 2.200319582778899029786017830557293 Inexact Rounded
+lnx1214 ln 0.0991812396542505631850692800904188 -> -2.310806398964672258823043180400384 Inexact Rounded
+lnx1215 ln 0.0000000000070238810143028811223924 -> -25.68170519961636647174714538290075 Inexact Rounded
+lnx1216 ln 2.630101665342826494730394729313167 -> 0.9670225014664367465128243039749559 Inexact Rounded
+lnx1217 ln 0.0056878928594359587691526063254683 -> -5.169415422904037819736637399445096 Inexact Rounded
+lnx1218 ln 567.3436047121057843908106573095590 -> 6.340965124964258486463444360787970 Inexact Rounded
+lnx1219 ln 1.199291248124655996614605745649725 -> 0.1817307557425911805765087755675657 Inexact Rounded
+lnx1220 ln 25.02050448582031098696267479135557 -> 3.219695668137659139544178905459317 Inexact Rounded
+lnx1221 ln 0.0000000000009939597023558756961300 -> -27.63707972996537636504396558259058 Inexact Rounded
+lnx1222 ln 0.0000007988551670159429716506430403 -> -14.04008617542597230988198612376415 Inexact Rounded
+lnx1223 ln 4.681515800176129184873770605589795 -> 1.543621946415383338972124445445748 Inexact Rounded
+lnx1224 ln 15.95126669161103011206658749345781 -> 2.769538242479483539275986395443539 Inexact Rounded
+lnx1225 ln 0.0301626783922211213675457279076066 -> -3.501149933677283341023932281826341 Inexact Rounded
+lnx1226 ln 000.0040544064881821770528475185674 -> -5.507950967557021671647165889608324 Inexact Rounded
+lnx1227 ln 29.01617095935593792095913785100360 -> 3.367853293862745651888450004473297 Inexact Rounded
+lnx1228 ln 78.01836167344736733024804243195323 -> 4.356944205055768575987781375003992 Inexact Rounded
+lnx1229 ln 0.0000000096545319316965321158634893 -> -18.45583840160965814462095477365013 Inexact Rounded
+lnx1230 ln 97.95475237720579752770587185074428 -> 4.584505661612812742208619358214729 Inexact Rounded
+lnx1231 ln 528.0609262050423246402564228432371 -> 6.269211667589138113396583894315956 Inexact Rounded
+lnx1232 ln 0.0000002250064349732969696660452972 -> -15.30713683526963996712167701738724 Inexact Rounded
+lnx1233 ln 47.97063637767998658567199049725754 -> 3.870589081585660692195989854842372 Inexact Rounded
+lnx1234 ln 0.0005394311344541432318853513414361 -> -7.524995428393925934087126702974121 Inexact Rounded
+lnx1235 ln 0.0000000090973385649567471674972633 -> -18.51528393158931783447035004125791 Inexact Rounded
+lnx1236 ln 0.0000000000238776490227576197317977 -> -24.45807828188389561331158879207262 Inexact Rounded
+lnx1237 ln 0.0000236587000231921532145326218758 -> -10.65177964499823314952429277979034 Inexact Rounded
+lnx1238 ln 499.1277448846130709827154556125942 -> 6.212862064761427967461188083514774 Inexact Rounded
+lnx1239 ln 0.0000003960192300284787663712417647 -> -14.74180306619298548093697608293284 Inexact Rounded
+lnx1240 ln 41.08268350829477451667228892495136 -> 3.715586706887278039173584859218960 Inexact Rounded
+
+-- P=16, within 0-99
+Precision: 16
+lnx1101 ln 7.964875261033948 -> 2.075041282352241 Inexact Rounded
+lnx1102 ln 13.54527396845394 -> 2.606037701870263 Inexact Rounded
+lnx1103 ln 0.0008026554341331 -> -7.127585034321814 Inexact Rounded
+lnx1104 ln 0.0000030582233261 -> -12.69767642300625 Inexact Rounded
+lnx1105 ln 0.0004477497509672 -> -7.711276073210766 Inexact Rounded
+lnx1106 ln 7.616268622474371 -> 2.030286567675148 Inexact Rounded
+lnx1107 ln 51.58329925806381 -> 3.943197962309569 Inexact Rounded
+lnx1108 ln 0.0018197497951263 -> -6.309056262549345 Inexact Rounded
+lnx1109 ln 2.956282457072984 -> 1.083932552334575 Inexact Rounded
+lnx1110 ln 0.3843325579189906 -> -0.9562470649400558 Inexact Rounded
+lnx1111 ln 0.0074466329265663 -> -4.899993304919237 Inexact Rounded
+lnx1112 ln 0.0003372478532993 -> -7.994692428206378 Inexact Rounded
+lnx1113 ln 0.0084792263167809 -> -4.770136069569271 Inexact Rounded
+lnx1114 ln 5.926756998151102 -> 1.779477182834305 Inexact Rounded
+lnx1115 ln 9.025699152180897 -> 2.200075969604119 Inexact Rounded
+lnx1116 ln 1.910124643533526 -> 0.6471684983238183 Inexact Rounded
+lnx1117 ln 0.8158922711411020 -> -0.2034729533939387 Inexact Rounded
+lnx1118 ln 0.0067080016475322 -> -5.004454189414139 Inexact Rounded
+lnx1119 ln 0.0047583242092716 -> -5.347859729601094 Inexact Rounded
+lnx1120 ln 0.0386647411641339 -> -3.252827175263113 Inexact Rounded
+lnx1121 ln 0.0050226427841761 -> -5.293799032774131 Inexact Rounded
+lnx1122 ln 6.927937541637261 -> 1.935562155866906 Inexact Rounded
+lnx1123 ln 0.0000095745343513 -> -11.55640365579814 Inexact Rounded
+lnx1124 ln 1.602465492956538 -> 0.4715433763243936 Inexact Rounded
+lnx1125 ln 38.98415625087535 -> 3.663155313610213 Inexact Rounded
+lnx1126 ln 5.343182042276734 -> 1.675821363568112 Inexact Rounded
+lnx1127 ln 55.89763703245816 -> 4.023522107934110 Inexact Rounded
+lnx1128 ln 0.7445257810280847 -> -0.2950077988101030 Inexact Rounded
+lnx1129 ln 1.631407314946094 -> 0.4894430257201248 Inexact Rounded
+lnx1130 ln 0.0005462451932602 -> -7.512442611116852 Inexact Rounded
+lnx1131 ln 0.0000864173269362 -> -9.356322359017317 Inexact Rounded
+lnx1132 ln 5.227161719132849 -> 1.653868438439637 Inexact Rounded
+lnx1133 ln 60.57078466941998 -> 4.103812675662452 Inexact Rounded
+lnx1134 ln 0.0992864325333160 -> -2.309746348350318 Inexact Rounded
+lnx1135 ln 09.48564268447325 -> 2.249779359074983 Inexact Rounded
+lnx1136 ln 0.0036106089355634 -> -5.623878840650787 Inexact Rounded
+lnx1137 ln 1.805176865587172 -> 0.5906585734593707 Inexact Rounded
+lnx1138 ln 62.59363259642255 -> 4.136663557220559 Inexact Rounded
+lnx1139 ln 4.373828261137201 -> 1.475638657912000 Inexact Rounded
+lnx1140 ln 0.994483524148738 -> -0.005531747794938690 Inexact Rounded
+
+-- P=7, within 0-9
+Precision: 7
+lnx1001 ln 0.0912025 -> -2.394673 Inexact Rounded
+lnx1002 ln 0.9728626 -> -0.02751242 Inexact Rounded
+lnx1003 ln 0.3886032 -> -0.9451965 Inexact Rounded
+lnx1004 ln 8.798639 -> 2.174597 Inexact Rounded
+lnx1005 ln 2.459121 -> 0.8998040 Inexact Rounded
+lnx1006 ln 2.013193 -> 0.6997220 Inexact Rounded
+lnx1007 ln 9.064857 -> 2.204405 Inexact Rounded
+lnx1008 ln 5.796417 -> 1.757240 Inexact Rounded
+lnx1009 ln 0.1143471 -> -2.168517 Inexact Rounded
+lnx1010 ln 0.5341542 -> -0.6270707 Inexact Rounded
+lnx1011 ln 6.693781 -> 1.901179 Inexact Rounded
+lnx1012 ln 0.0081779 -> -4.806320 Inexact Rounded
+lnx1013 ln 8.313616 -> 2.117895 Inexact Rounded
+lnx1014 ln 3.486925 -> 1.249020 Inexact Rounded
+lnx1015 ln 0.1801401 -> -1.714020 Inexact Rounded
+lnx1016 ln 0.5227148 -> -0.6487193 Inexact Rounded
+lnx1017 ln 7.818111 -> 2.056443 Inexact Rounded
+lnx1018 ln 0.0870671 -> -2.441076 Inexact Rounded
+lnx1019 ln 8.153966 -> 2.098504 Inexact Rounded
+lnx1020 ln 2.040975 -> 0.7134276 Inexact Rounded
+lnx1021 ln 1.481642 -> 0.3931509 Inexact Rounded
+lnx1022 ln 0.2610123 -> -1.343188 Inexact Rounded
+lnx1023 ln 0.466723 -> -0.7620193 Inexact Rounded
+lnx1024 ln 0.0518756 -> -2.958907 Inexact Rounded
+lnx1025 ln 2.056410 -> 0.7209617 Inexact Rounded
+lnx1026 ln 0.181522 -> -1.706378 Inexact Rounded
+lnx1027 ln 0.515551 -> -0.6625190 Inexact Rounded
+lnx1028 ln 8.425089 -> 2.131214 Inexact Rounded
+lnx1029 ln 2.077091 -> 0.7309684 Inexact Rounded
+lnx1030 ln 6.212705 -> 1.826596 Inexact Rounded
+lnx1031 ln 5.729343 -> 1.745601 Inexact Rounded
+lnx1032 ln 4.831251 -> 1.575105 Inexact Rounded
+lnx1033 ln 2.029760 -> 0.7079176 Inexact Rounded
+lnx1034 ln 8.615060 -> 2.153512 Inexact Rounded
+lnx1035 ln 0.0611511 -> -2.794407 Inexact Rounded
+lnx1036 ln 5.195269 -> 1.647748 Inexact Rounded
+lnx1037 ln 9.617686 -> 2.263604 Inexact Rounded
+lnx1038 ln 0.0049382 -> -5.310754 Inexact Rounded
+lnx1039 ln 2.786840 -> 1.024908 Inexact Rounded
+lnx1040 ln 0.0091073 -> -4.698679 Inexact Rounded
+
+-- from here 3-digit tests are based on reverse exp tests
+precision: 9
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+lnx001 ln 0 -> -Infinity
+lnx002 ln 0.367879441 -> -1.00000000 Inexact Rounded
+lnx003 ln 1 -> 0
+lnx005 ln 2.71828183 -> 1.00000000 Inexact Rounded
+lnx006 ln 2.00000000 -> 0.693147181 Inexact Rounded
+lnx007 ln +Infinity -> Infinity
+
+-- tiny edge cases
+precision: 7
+lnx011 ln 1.105171 -> 0.1000001 Inexact Rounded
+lnx012 ln 1.010050 -> 0.009999835 Inexact Rounded
+lnx013 ln 1.000010 -> 0.000009999950 Inexact Rounded
+lnx014 ln 1.000001 -> 9.999995E-7 Inexact Rounded
+lnx015 ln 1.000000 -> 0
+
+-- basic e=0, e=1, e=2, e=4, e>=8 cases
+precision: 7
+lnx041 ln 2.718282 -> 1.000000 Inexact Rounded
+lnx042 ln 0.3678794 -> -1.000000 Inexact Rounded
+lnx043 ln 22026.47 -> 10.00000 Inexact Rounded
+lnx044 ln 0.00004539993 -> -10.00000 Inexact Rounded
+lnx045 ln 2.688117E+43 -> 100.0000 Inexact Rounded
+lnx046 ln 3.720076E-44 -> -100.0000 Inexact Rounded
+lnx047 ln Infinity -> Infinity
+lnx048 ln 0E-389 -> -Infinity
+
+-- miscellanea
+precision: 16
+lnx055 ln 2.717658486884572E-236 -> -542.4103112874415 Inexact Rounded
+precision: 17
+lnx056 ln 2.7176584868845721E-236 -> -542.41031128744146 Inexact Rounded
+precision: 18
+lnx057 ln 2.71765848688457211E-236 -> -542.410311287441459 Inexact Rounded
+precision: 19
+lnx058 ln 2.717658486884572112E-236 -> -542.4103112874414592 Inexact Rounded
+precision: 20
+lnx059 ln 2.7176584868845721118E-236 -> -542.41031128744145917 Inexact Rounded
+
+-- inputs ending in ..500.., ..499.., ..100.., ..999.. sequences
+precision: 50
+lnx102 ln 0.9999999100000040499998785000027 -> -9.0000000000000000000000033749953829996446124861750E-8 Inexact Rounded
+precision: 30
+lnx103 ln 0.999999910000004049999878500003 -> -8.99999999999999999999997337499E-8 Inexact Rounded
+precision: 29
+lnx104 ln 0.99999991000000404999987850000 -> -9.0000000000000000000002733750E-8 Inexact Rounded
+precision: 28
+lnx105 ln 0.9999999100000040499998785000 -> -9.000000000000000000000273375E-8 Inexact Rounded
+precision: 27
+lnx106 ln 0.999999910000004049999878500 -> -9.00000000000000000000027338E-8 Inexact Rounded
+precision: 26
+lnx107 ln 0.99999991000000404999987850 -> -9.0000000000000000000002734E-8 Inexact Rounded
+precision: 25
+lnx108 ln 0.9999999100000040499998785 -> -9.000000000000000000000273E-8 Inexact Rounded
+precision: 24
+lnx109 ln 0.999999910000004049999879 -> -8.99999999999999995000027E-8 Inexact Rounded
+precision: 23
+lnx110 ln 0.99999991000000404999988 -> -8.9999999999999998500003E-8 Inexact Rounded
+precision: 22
+lnx111 ln 0.9999999100000040499999 -> -8.999999999999997850000E-8 Inexact Rounded
+precision: 21
+lnx112 ln 0.999999910000004050000 -> -8.99999999999998785000E-8 Inexact Rounded
+precision: 20
+lnx113 ln 0.99999991000000405000 -> -8.9999999999999878500E-8 Inexact Rounded
+precision: 19
+lnx114 ln 0.9999999100000040500 -> -8.999999999999987850E-8 Inexact Rounded
+precision: 18
+lnx115 ln 0.999999910000004050 -> -8.99999999999998785E-8 Inexact Rounded
+-- next may be a > 0.5ulp case; a more precise answer is:
+-- -8.99999999999998784999918E-8
+precision: 17
+lnx116 ln 0.99999991000000405 -> -8.9999999999999878E-8 Inexact Rounded
+precision: 16
+lnx117 ln 0.9999999100000040 -> -9.000000004999988E-8 Inexact Rounded
+precision: 15
+lnx118 ln 0.999999910000004 -> -9.00000000499999E-8 Inexact Rounded
+precision: 14
+lnx119 ln 0.99999991000000 -> -9.0000004050000E-8 Inexact Rounded
+precision: 13
+lnx120 ln 0.9999999100000 -> -9.000000405000E-8 Inexact Rounded
+precision: 12
+lnx121 ln 0.999999910000 -> -9.00000040500E-8 Inexact Rounded
+precision: 11
+lnx122 ln 0.99999991000 -> -9.0000004050E-8 Inexact Rounded
+precision: 10
+lnx123 ln 0.9999999100 -> -9.000000405E-8 Inexact Rounded
+precision: 9
+lnx124 ln 0.999999910 -> -9.00000041E-8 Inexact Rounded
+precision: 8
+lnx125 ln 0.99999991 -> -9.0000004E-8 Inexact Rounded
+precision: 7
+lnx126 ln 0.9999999 -> -1.000000E-7 Inexact Rounded
+precision: 16
+lnx126b ln 0.9999999 -> -1.000000050000003E-7 Inexact Rounded
+precision: 6
+lnx127 ln 0.999999 -> -0.00000100000 Inexact Rounded
+precision: 5
+lnx128 ln 0.99999 -> -0.000010000 Inexact Rounded
+precision: 4
+lnx129 ln 0.9999 -> -0.0001000 Inexact Rounded
+precision: 3
+lnx130 ln 0.999 -> -0.00100 Inexact Rounded
+precision: 2
+lnx131 ln 0.99 -> -0.010 Inexact Rounded
+precision: 1
+lnx132 ln 0.9 -> -0.1 Inexact Rounded
+
+
+-- cases near 1 -- 1 2345678901234567890
+precision: 20
+lnx401 ln 2.7182818284589365041 -> 0.99999999999996000000 Inexact Rounded
+lnx402 ln 2.7182818284589636869 -> 0.99999999999997000000 Inexact Rounded
+lnx403 ln 2.7182818284589908697 -> 0.99999999999997999999 Inexact Rounded
+lnx404 ln 2.7182818284590180525 -> 0.99999999999998999998 Inexact Rounded
+lnx405 ln 2.7182818284590452354 -> 1.0000000000000000000 Inexact Rounded
+lnx406 ln 2.7182818284593170635 -> 1.0000000000001000000 Inexact Rounded
+lnx407 ln 2.7182818284595888917 -> 1.0000000000002000000 Inexact Rounded
+precision: 14
+lnx411 ln 2.7182818284589 -> 0.99999999999995 Inexact Rounded
+lnx413 ln 2.7182818284590 -> 0.99999999999998 Inexact Rounded
+lnx416 ln 2.7182818284591 -> 1.0000000000000 Inexact Rounded
+lnx417 ln 2.7182818284592 -> 1.0000000000001 Inexact Rounded
+
+-- overflows, including some exp overprecise borderlines
+precision: 7
+maxExponent: 384
+minExponent: -383
+lnx709 ln 9.999999E+384 -> 886.4953 Inexact Rounded
+lnx711 ln 9.999992E+384 -> 886.4953 Inexact Rounded
+precision: 16
+lnx722 ln 9.999999999999999E+384 -> 886.4952608027076 Inexact Rounded
+lnx724 ln 9.999999999999917E+384 -> 886.4952608027076 Inexact Rounded
+lnx726 ln 9.999999999999117E+384 -> 886.4952608027075 Inexact Rounded
+-- and more...
+precision: 15
+maxExponent: 999
+minExponent: -999
+lnx731 ln 9.99999999999999E+999 -> 2302.58509299405 Inexact Rounded
+-- next may be a > 0.5ulp case; a more precise answer is:
+-- 2302.58509299404495001799145442
+lnx732 ln 9.99999999999266E+999 -> 2302.58509299404 Inexact Rounded
+lnx733 ln 9.99999999999265E+999 -> 2302.58509299404 Inexact Rounded
+lnx734 ln 9.99999999999264E+999 -> 2302.58509299404 Inexact Rounded
+
+-- subnormals and underflows for exp, including underflow-to-zero edge point
+precision: 7
+maxExponent: 384
+minExponent: -383
+lnx751 ln 0E-389 -> -Infinity
+lnx758 ln 1.000001E-383 -> -881.8901 Inexact Rounded
+lnx759 ln 9.99991E-384 -> -881.8901 Inexact Rounded
+lnx760 ln 4.4605E-385 -> -885.0000 Inexact Rounded
+lnx761 ln 2.221E-386 -> -887.9999 Inexact Rounded
+lnx762 ln 3.01E-387 -> -889.9985 Inexact Rounded
+lnx763 ln 1.7E-388 -> -892.8724 Inexact Rounded
+lnx764 ln 1.5E-388 -> -892.9976 Inexact Rounded
+lnx765 ln 9E-389 -> -893.5084 Inexact Rounded
+lnx766 ln 1E-389 -> -895.7056 Inexact Rounded
+lnx774 ln 0E-389 -> -Infinity
+
+-- special values
+lnx820 ln Infinity -> Infinity
+lnx821 ln 0 -> -Infinity
+lnx822 ln NaN -> NaN
+lnx823 ln sNaN -> NaN Invalid_operation
+-- propagating NaNs
+lnx824 ln sNaN123 -> NaN123 Invalid_operation
+lnx825 ln -sNaN321 -> -NaN321 Invalid_operation
+lnx826 ln NaN456 -> NaN456
+lnx827 ln -NaN654 -> -NaN654
+lnx828 ln NaN1 -> NaN1
+
+-- Invalid operations due to restrictions
+-- [next two probably skipped by most test harnesses]
+precision: 100000000
+lnx901 ln 1 -> NaN Invalid_context
+precision: 99999999
+lnx902 ln 0 -> NaN Invalid_context
+
+precision: 9
+maxExponent: 1000000
+minExponent: -999999
+lnx903 ln 1 -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999999
+lnx904 ln 0 -> -Infinity
+maxExponent: 999999
+minExponent: -1000000
+lnx905 ln 1 -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999998
+lnx906 ln 0 -> -Infinity
+
+-- payload decapitate
+precision: 5
+lnx910 ln -sNaN1234567890 -> -NaN67890 Invalid_operation
+
+-- Null test
+lnx900 ln # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/log10.decTest b/Lib/test/decimaltestdata/log10.decTest
index 6502f0d091..5169eabde3 100644
--- a/Lib/test/decimaltestdata/log10.decTest
+++ b/Lib/test/decimaltestdata/log10.decTest
@@ -1,551 +1,551 @@
-------------------------------------------------------------------------
--- log10.decTest -- decimal logarithm in base 10 --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This emphasises the testing of notable cases, as they will often
--- have unusual paths (especially the 10**n results).
-
-extended: 1
-precision: 16
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- examples in specification
-precision: 9
-logxs000 log10 0 -> -Infinity
-logxs001 log10 0.001 -> -3
-logxs002 log10 1 -> 0
-logxs003 log10 2 -> 0.301029996 Inexact Rounded
-logxs004 log10 10 -> 1
-logxs005 log10 70 -> 1.84509804 Inexact Rounded
-logxs006 log10 +Infinity -> Infinity
-
-
--- basics (examples in specification, etc.)
-precision: 16
-logx0000 log10 0 -> -Infinity
-logx0001 log10 7E-1000 -> -999.1549019599857 Inexact Rounded
-logx0002 log10 1.1E-9 -> -8.958607314841775 Inexact Rounded
-logx0003 log10 0.0007 -> -3.154901959985743 Inexact Rounded
-logx0004 log10 0.11 -> -0.9586073148417750 Inexact Rounded
-logx0005 log10 0.7 -> -0.1549019599857432 Inexact Rounded
-logx0006 log10 1 -> 0
-logx0007 log10 1.5 -> 0.1760912590556812 Inexact Rounded
-logx0008 log10 2 -> 0.3010299956639812 Inexact Rounded
-logx0009 log10 2.718281828459045 -> 0.4342944819032518 Inexact Rounded
-logx0010 log10 2.718281828459046 -> 0.4342944819032519 Inexact Rounded
-logx0011 log10 2.718281828459047 -> 0.4342944819032521 Inexact Rounded
-logx0012 log10 7 -> 0.8450980400142568 Inexact Rounded
-logx0013 log10 10 -> 1
-logx0014 log10 10.5 -> 1.021189299069938 Inexact Rounded
-logx0015 log10 11 -> 1.041392685158225 Inexact Rounded
-logx0016 log10 70 -> 1.845098040014257 Inexact Rounded
-logx0017 log10 9999 -> 3.999956568380192 Inexact Rounded
-logx0018 log10 1.21E6 -> 6.082785370316450 Inexact Rounded
-logx0019 log10 1.1E+9 -> 9.041392685158225 Inexact Rounded
-logx0020 log10 7E+1000 -> 1000.845098040014 Inexact Rounded
-logx0021 log10 +Infinity -> Infinity
-
--- notable cases
--- negatives
-logx0031 log10 -1E-9 -> NaN Invalid_operation
-logx0032 log10 -0.0007 -> NaN Invalid_operation
-logx0033 log10 -0.1 -> NaN Invalid_operation
-logx0034 log10 -0.7 -> NaN Invalid_operation
-logx0035 log10 -1 -> NaN Invalid_operation
-logx0036 log10 -1.5 -> NaN Invalid_operation
-logx0037 log10 -2 -> NaN Invalid_operation
-logx0038 log10 -10.5 -> NaN Invalid_operation
-logx0039 log10 -10.5 -> NaN Invalid_operation
-logx0040 log10 -9999 -> NaN Invalid_operation
-logx0041 log10 -10 -> NaN Invalid_operation
-logx0042 log10 -0 -> -Infinity
-logx0043 log10 -0E+17 -> -Infinity
-logx0044 log10 -0E-17 -> -Infinity
--- other zeros
-logx0051 log10 0 -> -Infinity
-logx0052 log10 0E+17 -> -Infinity
-logx0053 log10 0E-17 -> -Infinity
--- infinities
-logx0055 log10 -Infinity -> NaN Invalid_operation
-logx0056 log10 +Infinity -> Infinity
--- ones
-logx0061 log10 1 -> 0
-logx0062 log10 1.0 -> 0
-logx0063 log10 1.000000000000000 -> 0
-logx0064 log10 1.000000000000000000 -> 0
-
--- notable cases -- exact powers of 10
-logx1100 log10 1 -> 0
-logx1101 log10 10 -> 1
-logx1102 log10 100 -> 2
-logx1103 log10 1000 -> 3
-logx1104 log10 10000 -> 4
-logx1105 log10 100000 -> 5
-logx1106 log10 1000000 -> 6
-logx1107 log10 10000000 -> 7
-logx1108 log10 100000000 -> 8
-logx1109 log10 1000000000 -> 9
-logx1110 log10 10000000000 -> 10
-logx1111 log10 100000000000 -> 11
-logx1112 log10 1000000000000 -> 12
-logx1113 log10 0.00000000001 -> -11
-logx1114 log10 0.0000000001 -> -10
-logx1115 log10 0.000000001 -> -9
-logx1116 log10 0.00000001 -> -8
-logx1117 log10 0.0000001 -> -7
-logx1118 log10 0.000001 -> -6
-logx1119 log10 0.00001 -> -5
-logx1120 log10 0.0001 -> -4
-logx1121 log10 0.001 -> -3
-logx1122 log10 0.01 -> -2
-logx1123 log10 0.1 -> -1
-logx1124 log10 1E-99 -> -99
-logx1125 log10 1E-100 -> -100
-logx1126 log10 1E-383 -> -383
-
--- check normally exact cases round properly
-precision: 1
-logx1141 log10 10000000000 -> 1E+1 Rounded
-logx1142 log10 1000000000000 -> 1E+1 Inexact Rounded
-logx1143 log10 1E+100 -> 1E+2 Rounded
-logx1144 log10 1E+123 -> 1E+2 Inexact Rounded
-logx1145 log10 1E+126 -> 1E+2 Inexact Rounded
-logx1146 log10 1E+916 -> 9E+2 Inexact Rounded
-logx1147 log10 1E+999 -> 1E+3 Inexact Rounded
-
-precision: 2
-logx1151 log10 10000000000 -> 10
-logx1152 log10 1000000000000 -> 12
-logx1153 log10 1E+100 -> 1.0E+2 Rounded
-logx1154 log10 1E+123 -> 1.2E+2 Inexact Rounded
-logx1155 log10 1E+126 -> 1.3E+2 Inexact Rounded
-logx1156 log10 1E+916 -> 9.2E+2 Inexact Rounded
-logx1157 log10 1E+999 -> 1.0E+3 Inexact Rounded
--- some half-way point rounds, other cases, and negatives
-logx1158 log10 1E+125 -> 1.2E+2 Inexact Rounded
-logx1159 log10 1E+135 -> 1.4E+2 Inexact Rounded
-logx1160 log10 1E+129 -> 1.3E+2 Inexact Rounded
-logx1161 log10 1E+131 -> 1.3E+2 Inexact Rounded
-logx1162 log10 1E-123 -> -1.2E+2 Inexact Rounded
-logx1163 log10 1E-126 -> -1.3E+2 Inexact Rounded
-logx1164 log10 1E-916 -> -9.2E+2 Inexact Rounded
-logx1165 log10 1E-999 -> -1.0E+3 Inexact Rounded
-logx1166 log10 1E-125 -> -1.2E+2 Inexact Rounded
-logx1167 log10 1E-135 -> -1.4E+2 Inexact Rounded
-logx1168 log10 1E-129 -> -1.3E+2 Inexact Rounded
-logx1169 log10 1E-131 -> -1.3E+2 Inexact Rounded
-
-precision: 3
-logx1171 log10 10000000000 -> 10
-logx1172 log10 1000000000000 -> 12
-logx1173 log10 1E+100 -> 100
-logx1174 log10 1E+123 -> 123
-logx1175 log10 1E+126 -> 126
-logx1176 log10 1E+916 -> 916
-logx1177 log10 1E+999 -> 999
-
--- log10(2) .. tests both ln(2) and ln(10) constants, too
-precision: 50
-logx1201 log10 2 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
-logx1202 log10 2.000 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
-logx1203 log10 0.2E1 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
-precision: 49
-logx1204 log10 2 -> 0.3010299956639811952137388947244930267681898814621 Inexact Rounded
-precision: 48
-logx1205 log10 2 -> 0.301029995663981195213738894724493026768189881462 Inexact Rounded
-precision: 47
-logx1206 log10 2 -> 0.30102999566398119521373889472449302676818988146 Inexact Rounded
-precision: 46
-logx1207 log10 2 -> 0.3010299956639811952137388947244930267681898815 Inexact Rounded
-precision: 45
-logx1208 log10 2 -> 0.301029995663981195213738894724493026768189881 Inexact Rounded
-precision: 44
-logx1209 log10 2 -> 0.30102999566398119521373889472449302676818988 Inexact Rounded
-precision: 43
-logx1210 log10 2 -> 0.3010299956639811952137388947244930267681899 Inexact Rounded
-precision: 42
-logx1211 log10 2 -> 0.301029995663981195213738894724493026768190 Inexact Rounded
-precision: 41
-logx1212 log10 2 -> 0.30102999566398119521373889472449302676819 Inexact Rounded
-precision: 40
-logx1213 log10 2 -> 0.3010299956639811952137388947244930267682 Inexact Rounded
-precision: 39
-logx1214 log10 2 -> 0.301029995663981195213738894724493026768 Inexact Rounded
-precision: 38
-logx1215 log10 2 -> 0.30102999566398119521373889472449302677 Inexact Rounded
-precision: 37
-logx1216 log10 2 -> 0.3010299956639811952137388947244930268 Inexact Rounded
-precision: 36
-logx1217 log10 2 -> 0.301029995663981195213738894724493027 Inexact Rounded
-precision: 35
-logx1218 log10 2 -> 0.30102999566398119521373889472449303 Inexact Rounded
-precision: 34
-logx1219 log10 2 -> 0.3010299956639811952137388947244930 Inexact Rounded
-precision: 33
-logx1220 log10 2 -> 0.301029995663981195213738894724493 Inexact Rounded
-precision: 32
-logx1221 log10 2 -> 0.30102999566398119521373889472449 Inexact Rounded
-precision: 31
-logx1222 log10 2 -> 0.3010299956639811952137388947245 Inexact Rounded
-precision: 30
-logx1223 log10 2 -> 0.301029995663981195213738894724 Inexact Rounded
-precision: 29
-logx1224 log10 2 -> 0.30102999566398119521373889472 Inexact Rounded
-precision: 28
-logx1225 log10 2 -> 0.3010299956639811952137388947 Inexact Rounded
-precision: 27
-logx1226 log10 2 -> 0.301029995663981195213738895 Inexact Rounded
-precision: 26
-logx1227 log10 2 -> 0.30102999566398119521373889 Inexact Rounded
-precision: 25
-logx1228 log10 2 -> 0.3010299956639811952137389 Inexact Rounded
-precision: 24
-logx1229 log10 2 -> 0.301029995663981195213739 Inexact Rounded
-precision: 23
-logx1230 log10 2 -> 0.30102999566398119521374 Inexact Rounded
-precision: 22
-logx1231 log10 2 -> 0.3010299956639811952137 Inexact Rounded
-precision: 21
-logx1232 log10 2 -> 0.301029995663981195214 Inexact Rounded
-precision: 20
-logx1233 log10 2 -> 0.30102999566398119521 Inexact Rounded
-precision: 19
-logx1234 log10 2 -> 0.3010299956639811952 Inexact Rounded
-precision: 18
-logx1235 log10 2 -> 0.301029995663981195 Inexact Rounded
-precision: 17
-logx1236 log10 2 -> 0.30102999566398120 Inexact Rounded
-precision: 16
-logx1237 log10 2 -> 0.3010299956639812 Inexact Rounded
-precision: 15
-logx1238 log10 2 -> 0.301029995663981 Inexact Rounded
-precision: 14
-logx1239 log10 2 -> 0.30102999566398 Inexact Rounded
-precision: 13
-logx1240 log10 2 -> 0.3010299956640 Inexact Rounded
-precision: 12
-logx1241 log10 2 -> 0.301029995664 Inexact Rounded
-precision: 11
-logx1242 log10 2 -> 0.30102999566 Inexact Rounded
-precision: 10
-logx1243 log10 2 -> 0.3010299957 Inexact Rounded
-precision: 9
-logx1244 log10 2 -> 0.301029996 Inexact Rounded
-precision: 8
-logx1245 log10 2 -> 0.30103000 Inexact Rounded
-precision: 7
-logx1246 log10 2 -> 0.3010300 Inexact Rounded
-precision: 6
-logx1247 log10 2 -> 0.301030 Inexact Rounded
-precision: 5
-logx1248 log10 2 -> 0.30103 Inexact Rounded
-precision: 4
-logx1249 log10 2 -> 0.3010 Inexact Rounded
-precision: 3
-logx1250 log10 2 -> 0.301 Inexact Rounded
-precision: 2
-logx1251 log10 2 -> 0.30 Inexact Rounded
-precision: 1
-logx1252 log10 2 -> 0.3 Inexact Rounded
-
-maxExponent: 384
-minExponent: -383
-precision: 16
-rounding: half_even
-
--- More close-to-e, etc., tests
-precision: 34
-logx1301 log10 2.718281828459045235360287471352661 -> 0.4342944819032518276511289189166048 Inexact Rounded
-logx1302 log10 2.718281828459045235360287471352662 -> 0.4342944819032518276511289189166050 Inexact Rounded
-logx1303 log10 2.718281828459045235360287471352663 -> 0.4342944819032518276511289189166052 Inexact Rounded
-logx1304 log10 0.99999999999999999999999999999999 -> -4.342944819032518276511289189166073E-33 Inexact Rounded
-logx1305 log10 0.999999999999999999999999999999999 -> -4.342944819032518276511289189166053E-34 Inexact Rounded
-logx1306 log10 0.9999999999999999999999999999999999 -> -4.342944819032518276511289189166051E-35 Inexact Rounded
-logx1307 log10 1.000000000000000000000000000000000 -> 0
-logx1308 log10 1.0000000000000000000000000000000001 -> 4.342944819032518276511289189166051E-35 Inexact Rounded
-logx1309 log10 1.000000000000000000000000000000001 -> 4.342944819032518276511289189166049E-34 Inexact Rounded
-logx1310 log10 1.00000000000000000000000000000001 -> 4.342944819032518276511289189166029E-33 Inexact Rounded
--- lower p
-precision: 7
-logx1320 log10 0.999999 -> -4.342947E-7 Inexact Rounded
-logx1321 log10 0.9999999 -> -4.342945E-8 Inexact Rounded
-logx1322 log10 0.99999999 -> -4.342945E-9 Inexact Rounded
-logx1323 log10 0.999999999 -> -4.342945E-10 Inexact Rounded
-logx1324 log10 1.00000000 -> 0
-logx1325 log10 1.00000001 -> 4.342945E-9 Inexact Rounded
-logx1326 log10 1.0000001 -> 4.342945E-8 Inexact Rounded
-logx1327 log10 1.000001 -> 4.342943E-7 Inexact Rounded
-
--- near 10^3
-precision: 9
-logx1331 log10 999.9999998 -> 3.00000000 Inexact Rounded
-logx1332 log10 999.9999999 -> 3.00000000 Inexact Rounded
-logx1333 log10 1000.000000 -> 3
-logx1334 log10 1000.000001 -> 3.00000000 Inexact Rounded
-logx1335 log10 1000.000002 -> 3.00000000 Inexact Rounded
-precision: 16
-logx1341 log10 999.9999998 -> 2.999999999913141 Inexact Rounded
-logx1342 log10 999.9999999 -> 2.999999999956571 Inexact Rounded
-logx1343 log10 1000.000000 -> 3
-logx1344 log10 1000.000001 -> 3.000000000434294 Inexact Rounded
-logx1345 log10 1000.000002 -> 3.000000000868589 Inexact Rounded
-
--- suggestions from Ilan Nehama
-logx1400 log10 10E-3 -> -2
-logx1401 log10 10E-2 -> -1
-logx1402 log10 100E-2 -> 0
-logx1403 log10 1000E-2 -> 1
-logx1404 log10 10000E-2 -> 2
-logx1405 log10 10E-1 -> 0
-logx1406 log10 100E-1 -> 1
-logx1407 log10 1000E-1 -> 2
-logx1408 log10 10000E-1 -> 3
-logx1409 log10 10E0 -> 1
-logx1410 log10 100E0 -> 2
-logx1411 log10 1000E0 -> 3
-logx1412 log10 10000E0 -> 4
-logx1413 log10 10E1 -> 2
-logx1414 log10 100E1 -> 3
-logx1415 log10 1000E1 -> 4
-logx1416 log10 10000E1 -> 5
-logx1417 log10 10E2 -> 3
-logx1418 log10 100E2 -> 4
-logx1419 log10 1000E2 -> 5
-logx1420 log10 10000E2 -> 6
-
--- Randoms
--- P=50, within 0-9999
-Precision: 50
-logx2501 log10 0.00035448001667968141775891246991912655961163345904 -> -3.4504082425411775290864053318247274944685586188505 Inexact Rounded
-logx2502 log10 70.636455726424311228255338637935330826995136597644 -> 1.8490288998408492045793070255302335558140975719247 Inexact Rounded
-logx2503 log10 0.00000000000000233550362473821889060812804063040169 -> -14.631619454343834858023578299142866557717904223667 Inexact Rounded
-logx2504 log10 97.783628621523244679901260358286898958832135433764 -> 1.9902661493224219517897657964362571690592734407330 Inexact Rounded
-logx2505 log10 0062.2377135315858392802612812022807838599572017342 -> 1.7940536293085066199287632725026837018486533544141 Inexact Rounded
-logx2506 log10 6.3767634652071053619977602804724129652981747879532 -> 0.80460030789825961615100163576080761326857374098644 Inexact Rounded
-logx2507 log10 63.297088981313278529306533814195068850532666658798 -> 1.8013837373724427092417170149098614410849353839673 Inexact Rounded
-logx2508 log10 0.00000077239693316881797717820110898167721602299187 -> -6.1121594592718550613773886241951966264826760310047 Inexact Rounded
-logx2509 log10 0.00000003953580359780185534830572461922527831395002 -> -7.4030094293833847136252547069905477213541787177561 Inexact Rounded
-logx2510 log10 754.62905817369989169188998111527272688791544577204 -> 2.8777335243761300047758534304371912099958057545416 Inexact Rounded
-logx2511 log10 0.00000048360378410241428936607147056283282849158312 -> -6.3155103095309353457604038397980091650760346334512 Inexact Rounded
-logx2512 log10 0.00007509037583645612577196104591672080542932166089 -> -4.1244157219700166314012344705538088030592896111026 Inexact Rounded
-logx2513 log10 0.00000000000705475944638915053419839063567898092064 -> -11.151517790256466048553810002525868198178167950377 Inexact Rounded
-logx2514 log10 9.6210300460497657917445410947099633479609165120661 -> 0.98322157093260978206633922877716078683518617768411 Inexact Rounded
-logx2515 log10 0.00000000050150361386555527496607245976120864985611 -> -9.2997259330798261040411086835563234390934934629340 Inexact Rounded
-logx2516 log10 098.24754029731994125797723545333677604490074810751 -> 1.9923216862874337077795278629351060819105679670633 Inexact Rounded
-logx2517 log10 7.5091998150046994320441463854301624742491015752980 -> 0.87559366078005924080766469158763499725414024128781 Inexact Rounded
-logx2518 log10 0.00000000000079540571273330075193668596942268542425 -> -12.099411294165176028817305108475326325006250936963 Inexact Rounded
-logx2519 log10 0.00000042395034799555215782907515074134154915491701 -> -6.3726850039125381134069450802108893075604464135297 Inexact Rounded
-logx2520 log10 56.683376304674355481905023145238799909301732694982 -> 1.7534557107853480435703421826077606250636580091754 Inexact Rounded
-logx2521 log10 48.734033811444195070807606721517169810438049581227 -> 1.6878323602741065190942654710049433808208291564049 Inexact Rounded
-logx2522 log10 0.00074830310930046865009851706989430228561880221063 -> -3.1259224502209974082223667712016445572431791920618 Inexact Rounded
-logx2523 log10 36.677348885111593384020836720396262497122708598359 -> 1.5643979364260796086754530282302605477567469395425 Inexact Rounded
-logx2524 log10 0.00000000000000004495678560480432858812419145833744 -> -16.347204748239740510014320630363244015916029619561 Inexact Rounded
-logx2525 log10 9509.5854013650642799374159131940108748594774307104 -> 3.9781615829916326741100166519726824430945406302661 Inexact Rounded
-logx2526 log10 0.07834891268689177014044454793608715276615743819097 -> -1.1059670262197643147805517398621288897669876996348 Inexact Rounded
-logx2527 log10 0.00000029584529880706128444454688454999032801904794 -> -6.5289353275814043710076526920566721570375026917206 Inexact Rounded
-logx2528 log10 3.0713496544497618098794332787772186176981011904294 -> 0.48732926103896828546424341029492468100431414072994 Inexact Rounded
-logx2529 log10 352.66392670788816474407442785460803833927136413943 -> 2.5473610388199562714709836398243933320284077008314 Inexact Rounded
-logx2530 log10 0.00304743125181876267210516527361742185617091801650 -> -2.5160660830163981967774124745311497447050056400207 Inexact Rounded
-logx2531 log10 0.00000076120535894952136499250364604538117729437183 -> -6.1184981629047051532448413863950776496652483019415 Inexact Rounded
-logx2532 log10 769.88795978534353052965286195053735007473187735815 -> 2.8864275277862652709986498581064117950288798222100 Inexact Rounded
-logx2533 log10 0.00000000000000041297494808612226304619570016336188 -> -15.384076292745415917510668454361868659468669804710 Inexact Rounded
-logx2534 log10 860.88864595714426940247940960258558876903741966974 -> 2.9349469800554277915920278090647283233440859155176 Inexact Rounded
-logx2535 log10 5839.0328812994787235900178587371051096898683972444 -> 3.7663409208972392569269125539438874737147906238543 Inexact Rounded
-logx2536 log10 0.00000028532710151284840471670497112821201598377841 -> -6.5446569753514027675878879843238065488490618159490 Inexact Rounded
-logx2537 log10 0.00000000000000009734490059931638483445631835651581 -> -16.011686794011271135978633880864278692254243106931 Inexact Rounded
-logx2538 log10 5.8610949526439529489252302463450302981511714144330 -> 0.76797875722452549281028552067645732490929361952278 Inexact Rounded
-logx2539 log10 6.6282432221115923372151148990137179611977576327206 -> 0.82139843639227213211012044000785757267155736071361 Inexact Rounded
-logx2540 log10 0.00000000001994071862386846626954819923923344413454 -> -10.700259194632339980266559224447212260115021637626 Inexact Rounded
-
--- P=34, within 0-9999
-Precision: 34
-logx2201 log10 1.522513203889714179088327328864183 -> 0.1825610677098896250496651330492109 Inexact Rounded
-logx2202 log10 0.171123774769717316154080888930404 -> -0.7666896483548462582461898092764408 Inexact Rounded
-logx2203 log10 0.0000000997467236251714283104963838 -> -7.001101360652518274271569010312115 Inexact Rounded
-logx2204 log10 0.0008856103624122479769647543468633 -> -3.052757310476070891830490327138190 Inexact Rounded
-logx2205 log10 1.938274868738032930709498221236758 -> 0.2874153648259449520201536171714594 Inexact Rounded
-logx2206 log10 479.5667847823826713082613445010097 -> 2.680849095850361068709165157286435 Inexact Rounded
-logx2207 log10 8856.136599178820202141823157336804 -> 3.947244306584767101480454261950559 Inexact Rounded
-logx2208 log10 0.0000911026318801903982642871344858 -> -4.040469076434979398438617464033826 Inexact Rounded
-logx2209 log10 0.0000000000017271112650427414732630 -> -11.76267968314038748995178212654921 Inexact Rounded
-logx2210 log10 6.962605370078885647639503548229695 -> 0.8427717807200322352686396925992250 Inexact Rounded
-logx2211 log10 0.3354804428992793132855923541692781 -> -0.4743327923012159170967636070844834 Inexact Rounded
-logx2212 log10 2.079864257474859008252165836663504 -> 0.3180349916198059046812506741388856 Inexact Rounded
-logx2213 log10 2805.479529292939499220276986621988 -> 3.448007104139974344565978780624744 Inexact Rounded
-logx2214 log10 66.45731133034187374557028537213949 -> 1.822542767005644041661520936223086 Inexact Rounded
-logx2215 log10 0.0000001206521261762681738274822835 -> -6.918465020390216969561494755767318 Inexact Rounded
-logx2216 log10 0.0000000001884891916264401160472381 -> -9.724713548119065386091933007528633 Inexact Rounded
-logx2217 log10 0.0000015467279551726326581314582759 -> -5.810586065070435383755759514608738 Inexact Rounded
-logx2218 log10 0.0090776316728068586744633914135952 -> -2.042027442843745884503280954390114 Inexact Rounded
-logx2219 log10 0.0000000000024541106528713393740030 -> -11.61010585935635713090119156069479 Inexact Rounded
-logx2220 log10 14.12936879385863410081087750645856 -> 1.150122760895466989841057385742662 Inexact Rounded
-logx2221 log10 0.0000036912481831392922922647231392 -> -5.432826753789892283556211380824203 Inexact Rounded
-logx2222 log10 0.0000000004067477525420424270138734 -> -9.390674838050073122857868012475060 Inexact Rounded
-logx2223 log10 7080.122562705399744969319589806194 -> 3.850040775747103318724330047546916 Inexact Rounded
-logx2224 log10 261.3491411363679209175524790255725 -> 2.417221077227536319655699517530855 Inexact Rounded
-logx2225 log10 003.9945581449915240094728380041494 -> 0.6014687471531988260823066997845691 Inexact Rounded
-logx2226 log10 0.0000000000583549164588495206767840 -> -10.23392254834182677023231713519341 Inexact Rounded
-logx2227 log10 9567.961832607240278342761088487484 -> 3.980819434211107631569386147016368 Inexact Rounded
-logx2228 log10 06.26592979160342972777219828867033 -> 0.7969855243966221408595024012574729 Inexact Rounded
-logx2229 log10 0.0000000000589847046598067273287319 -> -10.22926059078206218717755253582907 Inexact Rounded
-logx2230 log10 567.9388648235589204769442863724997 -> 2.754301589058313576472380262907638 Inexact Rounded
-logx2231 log10 039.7790325480037778918162264883415 -> 1.599654216592019199639285308997886 Inexact Rounded
-logx2232 log10 0.0000000005123951921894162149817207 -> -9.290394953898862694847327137242690 Inexact Rounded
-logx2233 log10 0.0000000000038500999723636904276723 -> -11.41452799337924056186867324854691 Inexact Rounded
-logx2234 log10 0.0006726500658977759825616537935864 -> -3.172210810922768725687671849421792 Inexact Rounded
-logx2235 log10 260.2400250475967528429943779126507 -> 2.415374092073799204236801383070064 Inexact Rounded
-logx2236 log10 0.0000000006101942339385102585042548 -> -9.214531900562046557191261226632509 Inexact Rounded
-logx2237 log10 0.0000000010846867501382746760066557 -> -8.964695664883282406359874242387236 Inexact Rounded
-logx2238 log10 60.24078375568814769010333711509928 -> 1.779890613567084253168373266648922 Inexact Rounded
-logx2239 log10 0.0012058738711757669337600252986093 -> -2.918698115012605915753728220896010 Inexact Rounded
-logx2240 log10 230.9450930197841600611503095185600 -> 2.363508739056822846742942599628966 Inexact Rounded
-
--- P=16, within 0-999
-Precision: 16
-logx2101 log10 0.0072067119605184 -> -2.142262835573038 Inexact Rounded
-logx2102 log10 503.6828482226624 -> 2.702157162195652 Inexact Rounded
-logx2103 log10 64.96074447821815 -> 1.812650993464174 Inexact Rounded
-logx2104 log10 48.75408597467246 -> 1.688011018842600 Inexact Rounded
-logx2105 log10 0.0329009839269587 -> -1.482791113975280 Inexact Rounded
-logx2106 log10 223.5320415060633 -> 2.349339784523410 Inexact Rounded
-logx2107 log10 73.12765002292194 -> 1.864081617476268 Inexact Rounded
-logx2108 log10 487.3749378358509 -> 2.687863192802252 Inexact Rounded
-logx2109 log10 0.0000019671987621 -> -5.706151757557926 Inexact Rounded
-logx2110 log10 0.0570680660609784 -> -1.243606844697873 Inexact Rounded
-logx2111 log10 33.10311638788998 -> 1.519868880976773 Inexact Rounded
-logx2112 log10 0.0687382699187077 -> -1.162801402868185 Inexact Rounded
-logx2113 log10 258.9416193626484 -> 2.413201859654145 Inexact Rounded
-logx2114 log10 0.0005306100136736 -> -3.275224558269725 Inexact Rounded
-logx2115 log10 65.78490393408572 -> 1.818126244825109 Inexact Rounded
-logx2116 log10 504.2328842073510 -> 2.702631165346958 Inexact Rounded
-logx2117 log10 9.417432755815027 -> 0.9739325278524503 Inexact Rounded
-logx2118 log10 006.7054835355498 -> 0.8264301004947640 Inexact Rounded
-logx2119 log10 0.0917012272363915 -> -1.037624852133399 Inexact Rounded
-logx2120 log10 5.959404385244921 -> 0.7752028561953401 Inexact Rounded
-logx2121 log10 0.0001209759148486 -> -3.917301084968903 Inexact Rounded
-logx2122 log10 0.0004706112139838 -> -3.327337728428039 Inexact Rounded
-logx2123 log10 0.0069700457377046 -> -2.156764372035771 Inexact Rounded
-logx2124 log10 0.5155584569852619 -> -0.2877220847805025 Inexact Rounded
-logx2125 log10 88.06005885607414 -> 1.944778971389913 Inexact Rounded
-logx2126 log10 0.0448240038219866 -> -1.348489353509709 Inexact Rounded
-logx2127 log10 3.419622484059565 -> 0.5339781639101145 Inexact Rounded
-logx2128 log10 5.171123353858721 -> 0.7135848977142854 Inexact Rounded
-logx2129 log10 0.0002133188319807 -> -3.670970802945872 Inexact Rounded
-logx2130 log10 46.21086703136966 -> 1.664744117045149 Inexact Rounded
-logx2131 log10 0.0000631053714415 -> -4.199933672639880 Inexact Rounded
-logx2132 log10 78.66019196870698 -> 1.895755001962469 Inexact Rounded
-logx2133 log10 0.0007152278351188 -> -3.145555592082297 Inexact Rounded
-logx2134 log10 45.52509819928536 -> 1.658250891256892 Inexact Rounded
-logx2135 log10 0.0000703227795740 -> -4.152903971697183 Inexact Rounded
-logx2136 log10 26.24438641426669 -> 1.419036423550599 Inexact Rounded
-logx2137 log10 0.0000044654829535 -> -5.350131564166817 Inexact Rounded
-logx2138 log10 0.7360702733062529 -> -0.1330807211893611 Inexact Rounded
-logx2139 log10 8.417059176469655 -> 0.9251603805112778 Inexact Rounded
-logx2140 log10 0.0002926570767968 -> -3.533640969664818 Inexact Rounded
-
--- P=7, within 0-99
-Precision: 7
-logx2001 log10 57.26089 -> 1.757858 Inexact Rounded
-logx2002 log10 0.0575421 -> -1.240014 Inexact Rounded
-logx2003 log10 0.5918465 -> -0.2277909 Inexact Rounded
-logx2004 log10 0.0068776 -> -2.162563 Inexact Rounded
-logx2005 log10 0.0066833 -> -2.175009 Inexact Rounded
-logx2006 log10 9.926963 -> 0.9968164 Inexact Rounded
-logx2007 log10 0.0041852 -> -2.378284 Inexact Rounded
-logx2008 log10 84.15412 -> 1.925075 Inexact Rounded
-logx2009 log10 2.466856 -> 0.3921438 Inexact Rounded
-logx2010 log10 0.0058047 -> -2.236220 Inexact Rounded
-logx2011 log10 9.885154 -> 0.9949834 Inexact Rounded
-logx2012 log10 0.6667654 -> -0.1760269 Inexact Rounded
-logx2013 log10 34.65736 -> 1.539795 Inexact Rounded
-logx2014 log10 0.0026884 -> -2.570506 Inexact Rounded
-logx2015 log10 0.0432767 -> -1.363746 Inexact Rounded
-logx2016 log10 66.01407 -> 1.819637 Inexact Rounded
-logx2017 log10 0.0070572 -> -2.151368 Inexact Rounded
-logx2018 log10 0.0731613 -> -1.135719 Inexact Rounded
-logx2019 log10 9.838983 -> 0.9929502 Inexact Rounded
-logx2020 log10 15.89696 -> 1.201314 Inexact Rounded
-logx2021 log10 8.459247 -> 0.9273317 Inexact Rounded
-logx2022 log10 0.0010873 -> -2.963651 Inexact Rounded
-logx2023 log10 0.6498619 -> -0.1871789 Inexact Rounded
-logx2024 log10 0.0847008 -> -1.072112 Inexact Rounded
-logx2025 log10 0.0075489 -> -2.122116 Inexact Rounded
-logx2026 log10 51.11152 -> 1.708519 Inexact Rounded
-logx2027 log10 0.7233866 -> -0.1406295 Inexact Rounded
-logx2028 log10 2.254721 -> 0.3530928 Inexact Rounded
-logx2029 log10 6.568444 -> 0.8174625 Inexact Rounded
-logx2030 log10 83.72639 -> 1.922862 Inexact Rounded
-logx2031 log10 6.720585 -> 0.8274071 Inexact Rounded
-logx2032 log10 87.90366 -> 1.944007 Inexact Rounded
-logx2033 log10 0.0433324 -> -1.363187 Inexact Rounded
-logx2034 log10 34.63912 -> 1.539567 Inexact Rounded
-logx2035 log10 0.8089059 -> -0.09210200 Inexact Rounded
-logx2036 log10 7.793405 -> 0.8917272 Inexact Rounded
-logx2037 log10 0.0041757 -> -2.379271 Inexact Rounded
-logx2038 log10 7.135417 -> 0.8534194 Inexact Rounded
-logx2039 log10 12.49570 -> 1.096761 Inexact Rounded
-logx2040 log10 6.356276 -> 0.8032027 Inexact Rounded
-
---------
-maxExponent: 384
-minExponent: -383
-precision: 16
-rounding: half_even
-
--- special values
-logx820 log10 Infinity -> Infinity
-logx821 log10 0 -> -Infinity
-logx822 log10 NaN -> NaN
-logx823 log10 sNaN -> NaN Invalid_operation
--- propagating NaNs
-logx824 log10 sNaN123 -> NaN123 Invalid_operation
-logx825 log10 -sNaN321 -> -NaN321 Invalid_operation
-logx826 log10 NaN456 -> NaN456
-logx827 log10 -NaN654 -> -NaN654
-logx828 log10 NaN1 -> NaN1
-
-
--- Invalid operations due to restrictions
--- [next two probably skipped by most test harnesses]
-precision: 100000000
-logx901 log10 1 -> NaN Invalid_context
-precision: 99999999
-logx902 log10 0 -> NaN Invalid_context
-
-precision: 9
-maxExponent: 1000000
-minExponent: -999999
-logx903 log10 1 -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999999
-logx904 log10 0 -> -Infinity
-maxExponent: 999999
-minExponent: -1000000
-logx905 log10 1 -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999998
-logx906 log10 0 -> -Infinity
-
--- Null test
-logx900 log10 # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- log10.decTest -- decimal logarithm in base 10 --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This emphasises the testing of notable cases, as they will often
+-- have unusual paths (especially the 10**n results).
+
+extended: 1
+precision: 16
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- examples in specification
+precision: 9
+logxs000 log10 0 -> -Infinity
+logxs001 log10 0.001 -> -3
+logxs002 log10 1 -> 0
+logxs003 log10 2 -> 0.301029996 Inexact Rounded
+logxs004 log10 10 -> 1
+logxs005 log10 70 -> 1.84509804 Inexact Rounded
+logxs006 log10 +Infinity -> Infinity
+
+
+-- basics (examples in specification, etc.)
+precision: 16
+logx0000 log10 0 -> -Infinity
+logx0001 log10 7E-1000 -> -999.1549019599857 Inexact Rounded
+logx0002 log10 1.1E-9 -> -8.958607314841775 Inexact Rounded
+logx0003 log10 0.0007 -> -3.154901959985743 Inexact Rounded
+logx0004 log10 0.11 -> -0.9586073148417750 Inexact Rounded
+logx0005 log10 0.7 -> -0.1549019599857432 Inexact Rounded
+logx0006 log10 1 -> 0
+logx0007 log10 1.5 -> 0.1760912590556812 Inexact Rounded
+logx0008 log10 2 -> 0.3010299956639812 Inexact Rounded
+logx0009 log10 2.718281828459045 -> 0.4342944819032518 Inexact Rounded
+logx0010 log10 2.718281828459046 -> 0.4342944819032519 Inexact Rounded
+logx0011 log10 2.718281828459047 -> 0.4342944819032521 Inexact Rounded
+logx0012 log10 7 -> 0.8450980400142568 Inexact Rounded
+logx0013 log10 10 -> 1
+logx0014 log10 10.5 -> 1.021189299069938 Inexact Rounded
+logx0015 log10 11 -> 1.041392685158225 Inexact Rounded
+logx0016 log10 70 -> 1.845098040014257 Inexact Rounded
+logx0017 log10 9999 -> 3.999956568380192 Inexact Rounded
+logx0018 log10 1.21E6 -> 6.082785370316450 Inexact Rounded
+logx0019 log10 1.1E+9 -> 9.041392685158225 Inexact Rounded
+logx0020 log10 7E+1000 -> 1000.845098040014 Inexact Rounded
+logx0021 log10 +Infinity -> Infinity
+
+-- notable cases
+-- negatives
+logx0031 log10 -1E-9 -> NaN Invalid_operation
+logx0032 log10 -0.0007 -> NaN Invalid_operation
+logx0033 log10 -0.1 -> NaN Invalid_operation
+logx0034 log10 -0.7 -> NaN Invalid_operation
+logx0035 log10 -1 -> NaN Invalid_operation
+logx0036 log10 -1.5 -> NaN Invalid_operation
+logx0037 log10 -2 -> NaN Invalid_operation
+logx0038 log10 -10.5 -> NaN Invalid_operation
+logx0039 log10 -10.5 -> NaN Invalid_operation
+logx0040 log10 -9999 -> NaN Invalid_operation
+logx0041 log10 -10 -> NaN Invalid_operation
+logx0042 log10 -0 -> -Infinity
+logx0043 log10 -0E+17 -> -Infinity
+logx0044 log10 -0E-17 -> -Infinity
+-- other zeros
+logx0051 log10 0 -> -Infinity
+logx0052 log10 0E+17 -> -Infinity
+logx0053 log10 0E-17 -> -Infinity
+-- infinities
+logx0055 log10 -Infinity -> NaN Invalid_operation
+logx0056 log10 +Infinity -> Infinity
+-- ones
+logx0061 log10 1 -> 0
+logx0062 log10 1.0 -> 0
+logx0063 log10 1.000000000000000 -> 0
+logx0064 log10 1.000000000000000000 -> 0
+
+-- notable cases -- exact powers of 10
+logx1100 log10 1 -> 0
+logx1101 log10 10 -> 1
+logx1102 log10 100 -> 2
+logx1103 log10 1000 -> 3
+logx1104 log10 10000 -> 4
+logx1105 log10 100000 -> 5
+logx1106 log10 1000000 -> 6
+logx1107 log10 10000000 -> 7
+logx1108 log10 100000000 -> 8
+logx1109 log10 1000000000 -> 9
+logx1110 log10 10000000000 -> 10
+logx1111 log10 100000000000 -> 11
+logx1112 log10 1000000000000 -> 12
+logx1113 log10 0.00000000001 -> -11
+logx1114 log10 0.0000000001 -> -10
+logx1115 log10 0.000000001 -> -9
+logx1116 log10 0.00000001 -> -8
+logx1117 log10 0.0000001 -> -7
+logx1118 log10 0.000001 -> -6
+logx1119 log10 0.00001 -> -5
+logx1120 log10 0.0001 -> -4
+logx1121 log10 0.001 -> -3
+logx1122 log10 0.01 -> -2
+logx1123 log10 0.1 -> -1
+logx1124 log10 1E-99 -> -99
+logx1125 log10 1E-100 -> -100
+logx1126 log10 1E-383 -> -383
+
+-- check normally exact cases round properly
+precision: 1
+logx1141 log10 10000000000 -> 1E+1 Rounded
+logx1142 log10 1000000000000 -> 1E+1 Inexact Rounded
+logx1143 log10 1E+100 -> 1E+2 Rounded
+logx1144 log10 1E+123 -> 1E+2 Inexact Rounded
+logx1145 log10 1E+126 -> 1E+2 Inexact Rounded
+logx1146 log10 1E+916 -> 9E+2 Inexact Rounded
+logx1147 log10 1E+999 -> 1E+3 Inexact Rounded
+
+precision: 2
+logx1151 log10 10000000000 -> 10
+logx1152 log10 1000000000000 -> 12
+logx1153 log10 1E+100 -> 1.0E+2 Rounded
+logx1154 log10 1E+123 -> 1.2E+2 Inexact Rounded
+logx1155 log10 1E+126 -> 1.3E+2 Inexact Rounded
+logx1156 log10 1E+916 -> 9.2E+2 Inexact Rounded
+logx1157 log10 1E+999 -> 1.0E+3 Inexact Rounded
+-- some half-way point rounds, other cases, and negatives
+logx1158 log10 1E+125 -> 1.2E+2 Inexact Rounded
+logx1159 log10 1E+135 -> 1.4E+2 Inexact Rounded
+logx1160 log10 1E+129 -> 1.3E+2 Inexact Rounded
+logx1161 log10 1E+131 -> 1.3E+2 Inexact Rounded
+logx1162 log10 1E-123 -> -1.2E+2 Inexact Rounded
+logx1163 log10 1E-126 -> -1.3E+2 Inexact Rounded
+logx1164 log10 1E-916 -> -9.2E+2 Inexact Rounded
+logx1165 log10 1E-999 -> -1.0E+3 Inexact Rounded
+logx1166 log10 1E-125 -> -1.2E+2 Inexact Rounded
+logx1167 log10 1E-135 -> -1.4E+2 Inexact Rounded
+logx1168 log10 1E-129 -> -1.3E+2 Inexact Rounded
+logx1169 log10 1E-131 -> -1.3E+2 Inexact Rounded
+
+precision: 3
+logx1171 log10 10000000000 -> 10
+logx1172 log10 1000000000000 -> 12
+logx1173 log10 1E+100 -> 100
+logx1174 log10 1E+123 -> 123
+logx1175 log10 1E+126 -> 126
+logx1176 log10 1E+916 -> 916
+logx1177 log10 1E+999 -> 999
+
+-- log10(2) .. tests both ln(2) and ln(10) constants, too
+precision: 50
+logx1201 log10 2 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
+logx1202 log10 2.000 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
+logx1203 log10 0.2E1 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
+precision: 49
+logx1204 log10 2 -> 0.3010299956639811952137388947244930267681898814621 Inexact Rounded
+precision: 48
+logx1205 log10 2 -> 0.301029995663981195213738894724493026768189881462 Inexact Rounded
+precision: 47
+logx1206 log10 2 -> 0.30102999566398119521373889472449302676818988146 Inexact Rounded
+precision: 46
+logx1207 log10 2 -> 0.3010299956639811952137388947244930267681898815 Inexact Rounded
+precision: 45
+logx1208 log10 2 -> 0.301029995663981195213738894724493026768189881 Inexact Rounded
+precision: 44
+logx1209 log10 2 -> 0.30102999566398119521373889472449302676818988 Inexact Rounded
+precision: 43
+logx1210 log10 2 -> 0.3010299956639811952137388947244930267681899 Inexact Rounded
+precision: 42
+logx1211 log10 2 -> 0.301029995663981195213738894724493026768190 Inexact Rounded
+precision: 41
+logx1212 log10 2 -> 0.30102999566398119521373889472449302676819 Inexact Rounded
+precision: 40
+logx1213 log10 2 -> 0.3010299956639811952137388947244930267682 Inexact Rounded
+precision: 39
+logx1214 log10 2 -> 0.301029995663981195213738894724493026768 Inexact Rounded
+precision: 38
+logx1215 log10 2 -> 0.30102999566398119521373889472449302677 Inexact Rounded
+precision: 37
+logx1216 log10 2 -> 0.3010299956639811952137388947244930268 Inexact Rounded
+precision: 36
+logx1217 log10 2 -> 0.301029995663981195213738894724493027 Inexact Rounded
+precision: 35
+logx1218 log10 2 -> 0.30102999566398119521373889472449303 Inexact Rounded
+precision: 34
+logx1219 log10 2 -> 0.3010299956639811952137388947244930 Inexact Rounded
+precision: 33
+logx1220 log10 2 -> 0.301029995663981195213738894724493 Inexact Rounded
+precision: 32
+logx1221 log10 2 -> 0.30102999566398119521373889472449 Inexact Rounded
+precision: 31
+logx1222 log10 2 -> 0.3010299956639811952137388947245 Inexact Rounded
+precision: 30
+logx1223 log10 2 -> 0.301029995663981195213738894724 Inexact Rounded
+precision: 29
+logx1224 log10 2 -> 0.30102999566398119521373889472 Inexact Rounded
+precision: 28
+logx1225 log10 2 -> 0.3010299956639811952137388947 Inexact Rounded
+precision: 27
+logx1226 log10 2 -> 0.301029995663981195213738895 Inexact Rounded
+precision: 26
+logx1227 log10 2 -> 0.30102999566398119521373889 Inexact Rounded
+precision: 25
+logx1228 log10 2 -> 0.3010299956639811952137389 Inexact Rounded
+precision: 24
+logx1229 log10 2 -> 0.301029995663981195213739 Inexact Rounded
+precision: 23
+logx1230 log10 2 -> 0.30102999566398119521374 Inexact Rounded
+precision: 22
+logx1231 log10 2 -> 0.3010299956639811952137 Inexact Rounded
+precision: 21
+logx1232 log10 2 -> 0.301029995663981195214 Inexact Rounded
+precision: 20
+logx1233 log10 2 -> 0.30102999566398119521 Inexact Rounded
+precision: 19
+logx1234 log10 2 -> 0.3010299956639811952 Inexact Rounded
+precision: 18
+logx1235 log10 2 -> 0.301029995663981195 Inexact Rounded
+precision: 17
+logx1236 log10 2 -> 0.30102999566398120 Inexact Rounded
+precision: 16
+logx1237 log10 2 -> 0.3010299956639812 Inexact Rounded
+precision: 15
+logx1238 log10 2 -> 0.301029995663981 Inexact Rounded
+precision: 14
+logx1239 log10 2 -> 0.30102999566398 Inexact Rounded
+precision: 13
+logx1240 log10 2 -> 0.3010299956640 Inexact Rounded
+precision: 12
+logx1241 log10 2 -> 0.301029995664 Inexact Rounded
+precision: 11
+logx1242 log10 2 -> 0.30102999566 Inexact Rounded
+precision: 10
+logx1243 log10 2 -> 0.3010299957 Inexact Rounded
+precision: 9
+logx1244 log10 2 -> 0.301029996 Inexact Rounded
+precision: 8
+logx1245 log10 2 -> 0.30103000 Inexact Rounded
+precision: 7
+logx1246 log10 2 -> 0.3010300 Inexact Rounded
+precision: 6
+logx1247 log10 2 -> 0.301030 Inexact Rounded
+precision: 5
+logx1248 log10 2 -> 0.30103 Inexact Rounded
+precision: 4
+logx1249 log10 2 -> 0.3010 Inexact Rounded
+precision: 3
+logx1250 log10 2 -> 0.301 Inexact Rounded
+precision: 2
+logx1251 log10 2 -> 0.30 Inexact Rounded
+precision: 1
+logx1252 log10 2 -> 0.3 Inexact Rounded
+
+maxExponent: 384
+minExponent: -383
+precision: 16
+rounding: half_even
+
+-- More close-to-e, etc., tests
+precision: 34
+logx1301 log10 2.718281828459045235360287471352661 -> 0.4342944819032518276511289189166048 Inexact Rounded
+logx1302 log10 2.718281828459045235360287471352662 -> 0.4342944819032518276511289189166050 Inexact Rounded
+logx1303 log10 2.718281828459045235360287471352663 -> 0.4342944819032518276511289189166052 Inexact Rounded
+logx1304 log10 0.99999999999999999999999999999999 -> -4.342944819032518276511289189166073E-33 Inexact Rounded
+logx1305 log10 0.999999999999999999999999999999999 -> -4.342944819032518276511289189166053E-34 Inexact Rounded
+logx1306 log10 0.9999999999999999999999999999999999 -> -4.342944819032518276511289189166051E-35 Inexact Rounded
+logx1307 log10 1.000000000000000000000000000000000 -> 0
+logx1308 log10 1.0000000000000000000000000000000001 -> 4.342944819032518276511289189166051E-35 Inexact Rounded
+logx1309 log10 1.000000000000000000000000000000001 -> 4.342944819032518276511289189166049E-34 Inexact Rounded
+logx1310 log10 1.00000000000000000000000000000001 -> 4.342944819032518276511289189166029E-33 Inexact Rounded
+-- lower p
+precision: 7
+logx1320 log10 0.999999 -> -4.342947E-7 Inexact Rounded
+logx1321 log10 0.9999999 -> -4.342945E-8 Inexact Rounded
+logx1322 log10 0.99999999 -> -4.342945E-9 Inexact Rounded
+logx1323 log10 0.999999999 -> -4.342945E-10 Inexact Rounded
+logx1324 log10 1.00000000 -> 0
+logx1325 log10 1.00000001 -> 4.342945E-9 Inexact Rounded
+logx1326 log10 1.0000001 -> 4.342945E-8 Inexact Rounded
+logx1327 log10 1.000001 -> 4.342943E-7 Inexact Rounded
+
+-- near 10^3
+precision: 9
+logx1331 log10 999.9999998 -> 3.00000000 Inexact Rounded
+logx1332 log10 999.9999999 -> 3.00000000 Inexact Rounded
+logx1333 log10 1000.000000 -> 3
+logx1334 log10 1000.000001 -> 3.00000000 Inexact Rounded
+logx1335 log10 1000.000002 -> 3.00000000 Inexact Rounded
+precision: 16
+logx1341 log10 999.9999998 -> 2.999999999913141 Inexact Rounded
+logx1342 log10 999.9999999 -> 2.999999999956571 Inexact Rounded
+logx1343 log10 1000.000000 -> 3
+logx1344 log10 1000.000001 -> 3.000000000434294 Inexact Rounded
+logx1345 log10 1000.000002 -> 3.000000000868589 Inexact Rounded
+
+-- suggestions from Ilan Nehama
+logx1400 log10 10E-3 -> -2
+logx1401 log10 10E-2 -> -1
+logx1402 log10 100E-2 -> 0
+logx1403 log10 1000E-2 -> 1
+logx1404 log10 10000E-2 -> 2
+logx1405 log10 10E-1 -> 0
+logx1406 log10 100E-1 -> 1
+logx1407 log10 1000E-1 -> 2
+logx1408 log10 10000E-1 -> 3
+logx1409 log10 10E0 -> 1
+logx1410 log10 100E0 -> 2
+logx1411 log10 1000E0 -> 3
+logx1412 log10 10000E0 -> 4
+logx1413 log10 10E1 -> 2
+logx1414 log10 100E1 -> 3
+logx1415 log10 1000E1 -> 4
+logx1416 log10 10000E1 -> 5
+logx1417 log10 10E2 -> 3
+logx1418 log10 100E2 -> 4
+logx1419 log10 1000E2 -> 5
+logx1420 log10 10000E2 -> 6
+
+-- Randoms
+-- P=50, within 0-9999
+Precision: 50
+logx2501 log10 0.00035448001667968141775891246991912655961163345904 -> -3.4504082425411775290864053318247274944685586188505 Inexact Rounded
+logx2502 log10 70.636455726424311228255338637935330826995136597644 -> 1.8490288998408492045793070255302335558140975719247 Inexact Rounded
+logx2503 log10 0.00000000000000233550362473821889060812804063040169 -> -14.631619454343834858023578299142866557717904223667 Inexact Rounded
+logx2504 log10 97.783628621523244679901260358286898958832135433764 -> 1.9902661493224219517897657964362571690592734407330 Inexact Rounded
+logx2505 log10 0062.2377135315858392802612812022807838599572017342 -> 1.7940536293085066199287632725026837018486533544141 Inexact Rounded
+logx2506 log10 6.3767634652071053619977602804724129652981747879532 -> 0.80460030789825961615100163576080761326857374098644 Inexact Rounded
+logx2507 log10 63.297088981313278529306533814195068850532666658798 -> 1.8013837373724427092417170149098614410849353839673 Inexact Rounded
+logx2508 log10 0.00000077239693316881797717820110898167721602299187 -> -6.1121594592718550613773886241951966264826760310047 Inexact Rounded
+logx2509 log10 0.00000003953580359780185534830572461922527831395002 -> -7.4030094293833847136252547069905477213541787177561 Inexact Rounded
+logx2510 log10 754.62905817369989169188998111527272688791544577204 -> 2.8777335243761300047758534304371912099958057545416 Inexact Rounded
+logx2511 log10 0.00000048360378410241428936607147056283282849158312 -> -6.3155103095309353457604038397980091650760346334512 Inexact Rounded
+logx2512 log10 0.00007509037583645612577196104591672080542932166089 -> -4.1244157219700166314012344705538088030592896111026 Inexact Rounded
+logx2513 log10 0.00000000000705475944638915053419839063567898092064 -> -11.151517790256466048553810002525868198178167950377 Inexact Rounded
+logx2514 log10 9.6210300460497657917445410947099633479609165120661 -> 0.98322157093260978206633922877716078683518617768411 Inexact Rounded
+logx2515 log10 0.00000000050150361386555527496607245976120864985611 -> -9.2997259330798261040411086835563234390934934629340 Inexact Rounded
+logx2516 log10 098.24754029731994125797723545333677604490074810751 -> 1.9923216862874337077795278629351060819105679670633 Inexact Rounded
+logx2517 log10 7.5091998150046994320441463854301624742491015752980 -> 0.87559366078005924080766469158763499725414024128781 Inexact Rounded
+logx2518 log10 0.00000000000079540571273330075193668596942268542425 -> -12.099411294165176028817305108475326325006250936963 Inexact Rounded
+logx2519 log10 0.00000042395034799555215782907515074134154915491701 -> -6.3726850039125381134069450802108893075604464135297 Inexact Rounded
+logx2520 log10 56.683376304674355481905023145238799909301732694982 -> 1.7534557107853480435703421826077606250636580091754 Inexact Rounded
+logx2521 log10 48.734033811444195070807606721517169810438049581227 -> 1.6878323602741065190942654710049433808208291564049 Inexact Rounded
+logx2522 log10 0.00074830310930046865009851706989430228561880221063 -> -3.1259224502209974082223667712016445572431791920618 Inexact Rounded
+logx2523 log10 36.677348885111593384020836720396262497122708598359 -> 1.5643979364260796086754530282302605477567469395425 Inexact Rounded
+logx2524 log10 0.00000000000000004495678560480432858812419145833744 -> -16.347204748239740510014320630363244015916029619561 Inexact Rounded
+logx2525 log10 9509.5854013650642799374159131940108748594774307104 -> 3.9781615829916326741100166519726824430945406302661 Inexact Rounded
+logx2526 log10 0.07834891268689177014044454793608715276615743819097 -> -1.1059670262197643147805517398621288897669876996348 Inexact Rounded
+logx2527 log10 0.00000029584529880706128444454688454999032801904794 -> -6.5289353275814043710076526920566721570375026917206 Inexact Rounded
+logx2528 log10 3.0713496544497618098794332787772186176981011904294 -> 0.48732926103896828546424341029492468100431414072994 Inexact Rounded
+logx2529 log10 352.66392670788816474407442785460803833927136413943 -> 2.5473610388199562714709836398243933320284077008314 Inexact Rounded
+logx2530 log10 0.00304743125181876267210516527361742185617091801650 -> -2.5160660830163981967774124745311497447050056400207 Inexact Rounded
+logx2531 log10 0.00000076120535894952136499250364604538117729437183 -> -6.1184981629047051532448413863950776496652483019415 Inexact Rounded
+logx2532 log10 769.88795978534353052965286195053735007473187735815 -> 2.8864275277862652709986498581064117950288798222100 Inexact Rounded
+logx2533 log10 0.00000000000000041297494808612226304619570016336188 -> -15.384076292745415917510668454361868659468669804710 Inexact Rounded
+logx2534 log10 860.88864595714426940247940960258558876903741966974 -> 2.9349469800554277915920278090647283233440859155176 Inexact Rounded
+logx2535 log10 5839.0328812994787235900178587371051096898683972444 -> 3.7663409208972392569269125539438874737147906238543 Inexact Rounded
+logx2536 log10 0.00000028532710151284840471670497112821201598377841 -> -6.5446569753514027675878879843238065488490618159490 Inexact Rounded
+logx2537 log10 0.00000000000000009734490059931638483445631835651581 -> -16.011686794011271135978633880864278692254243106931 Inexact Rounded
+logx2538 log10 5.8610949526439529489252302463450302981511714144330 -> 0.76797875722452549281028552067645732490929361952278 Inexact Rounded
+logx2539 log10 6.6282432221115923372151148990137179611977576327206 -> 0.82139843639227213211012044000785757267155736071361 Inexact Rounded
+logx2540 log10 0.00000000001994071862386846626954819923923344413454 -> -10.700259194632339980266559224447212260115021637626 Inexact Rounded
+
+-- P=34, within 0-9999
+Precision: 34
+logx2201 log10 1.522513203889714179088327328864183 -> 0.1825610677098896250496651330492109 Inexact Rounded
+logx2202 log10 0.171123774769717316154080888930404 -> -0.7666896483548462582461898092764408 Inexact Rounded
+logx2203 log10 0.0000000997467236251714283104963838 -> -7.001101360652518274271569010312115 Inexact Rounded
+logx2204 log10 0.0008856103624122479769647543468633 -> -3.052757310476070891830490327138190 Inexact Rounded
+logx2205 log10 1.938274868738032930709498221236758 -> 0.2874153648259449520201536171714594 Inexact Rounded
+logx2206 log10 479.5667847823826713082613445010097 -> 2.680849095850361068709165157286435 Inexact Rounded
+logx2207 log10 8856.136599178820202141823157336804 -> 3.947244306584767101480454261950559 Inexact Rounded
+logx2208 log10 0.0000911026318801903982642871344858 -> -4.040469076434979398438617464033826 Inexact Rounded
+logx2209 log10 0.0000000000017271112650427414732630 -> -11.76267968314038748995178212654921 Inexact Rounded
+logx2210 log10 6.962605370078885647639503548229695 -> 0.8427717807200322352686396925992250 Inexact Rounded
+logx2211 log10 0.3354804428992793132855923541692781 -> -0.4743327923012159170967636070844834 Inexact Rounded
+logx2212 log10 2.079864257474859008252165836663504 -> 0.3180349916198059046812506741388856 Inexact Rounded
+logx2213 log10 2805.479529292939499220276986621988 -> 3.448007104139974344565978780624744 Inexact Rounded
+logx2214 log10 66.45731133034187374557028537213949 -> 1.822542767005644041661520936223086 Inexact Rounded
+logx2215 log10 0.0000001206521261762681738274822835 -> -6.918465020390216969561494755767318 Inexact Rounded
+logx2216 log10 0.0000000001884891916264401160472381 -> -9.724713548119065386091933007528633 Inexact Rounded
+logx2217 log10 0.0000015467279551726326581314582759 -> -5.810586065070435383755759514608738 Inexact Rounded
+logx2218 log10 0.0090776316728068586744633914135952 -> -2.042027442843745884503280954390114 Inexact Rounded
+logx2219 log10 0.0000000000024541106528713393740030 -> -11.61010585935635713090119156069479 Inexact Rounded
+logx2220 log10 14.12936879385863410081087750645856 -> 1.150122760895466989841057385742662 Inexact Rounded
+logx2221 log10 0.0000036912481831392922922647231392 -> -5.432826753789892283556211380824203 Inexact Rounded
+logx2222 log10 0.0000000004067477525420424270138734 -> -9.390674838050073122857868012475060 Inexact Rounded
+logx2223 log10 7080.122562705399744969319589806194 -> 3.850040775747103318724330047546916 Inexact Rounded
+logx2224 log10 261.3491411363679209175524790255725 -> 2.417221077227536319655699517530855 Inexact Rounded
+logx2225 log10 003.9945581449915240094728380041494 -> 0.6014687471531988260823066997845691 Inexact Rounded
+logx2226 log10 0.0000000000583549164588495206767840 -> -10.23392254834182677023231713519341 Inexact Rounded
+logx2227 log10 9567.961832607240278342761088487484 -> 3.980819434211107631569386147016368 Inexact Rounded
+logx2228 log10 06.26592979160342972777219828867033 -> 0.7969855243966221408595024012574729 Inexact Rounded
+logx2229 log10 0.0000000000589847046598067273287319 -> -10.22926059078206218717755253582907 Inexact Rounded
+logx2230 log10 567.9388648235589204769442863724997 -> 2.754301589058313576472380262907638 Inexact Rounded
+logx2231 log10 039.7790325480037778918162264883415 -> 1.599654216592019199639285308997886 Inexact Rounded
+logx2232 log10 0.0000000005123951921894162149817207 -> -9.290394953898862694847327137242690 Inexact Rounded
+logx2233 log10 0.0000000000038500999723636904276723 -> -11.41452799337924056186867324854691 Inexact Rounded
+logx2234 log10 0.0006726500658977759825616537935864 -> -3.172210810922768725687671849421792 Inexact Rounded
+logx2235 log10 260.2400250475967528429943779126507 -> 2.415374092073799204236801383070064 Inexact Rounded
+logx2236 log10 0.0000000006101942339385102585042548 -> -9.214531900562046557191261226632509 Inexact Rounded
+logx2237 log10 0.0000000010846867501382746760066557 -> -8.964695664883282406359874242387236 Inexact Rounded
+logx2238 log10 60.24078375568814769010333711509928 -> 1.779890613567084253168373266648922 Inexact Rounded
+logx2239 log10 0.0012058738711757669337600252986093 -> -2.918698115012605915753728220896010 Inexact Rounded
+logx2240 log10 230.9450930197841600611503095185600 -> 2.363508739056822846742942599628966 Inexact Rounded
+
+-- P=16, within 0-999
+Precision: 16
+logx2101 log10 0.0072067119605184 -> -2.142262835573038 Inexact Rounded
+logx2102 log10 503.6828482226624 -> 2.702157162195652 Inexact Rounded
+logx2103 log10 64.96074447821815 -> 1.812650993464174 Inexact Rounded
+logx2104 log10 48.75408597467246 -> 1.688011018842600 Inexact Rounded
+logx2105 log10 0.0329009839269587 -> -1.482791113975280 Inexact Rounded
+logx2106 log10 223.5320415060633 -> 2.349339784523410 Inexact Rounded
+logx2107 log10 73.12765002292194 -> 1.864081617476268 Inexact Rounded
+logx2108 log10 487.3749378358509 -> 2.687863192802252 Inexact Rounded
+logx2109 log10 0.0000019671987621 -> -5.706151757557926 Inexact Rounded
+logx2110 log10 0.0570680660609784 -> -1.243606844697873 Inexact Rounded
+logx2111 log10 33.10311638788998 -> 1.519868880976773 Inexact Rounded
+logx2112 log10 0.0687382699187077 -> -1.162801402868185 Inexact Rounded
+logx2113 log10 258.9416193626484 -> 2.413201859654145 Inexact Rounded
+logx2114 log10 0.0005306100136736 -> -3.275224558269725 Inexact Rounded
+logx2115 log10 65.78490393408572 -> 1.818126244825109 Inexact Rounded
+logx2116 log10 504.2328842073510 -> 2.702631165346958 Inexact Rounded
+logx2117 log10 9.417432755815027 -> 0.9739325278524503 Inexact Rounded
+logx2118 log10 006.7054835355498 -> 0.8264301004947640 Inexact Rounded
+logx2119 log10 0.0917012272363915 -> -1.037624852133399 Inexact Rounded
+logx2120 log10 5.959404385244921 -> 0.7752028561953401 Inexact Rounded
+logx2121 log10 0.0001209759148486 -> -3.917301084968903 Inexact Rounded
+logx2122 log10 0.0004706112139838 -> -3.327337728428039 Inexact Rounded
+logx2123 log10 0.0069700457377046 -> -2.156764372035771 Inexact Rounded
+logx2124 log10 0.5155584569852619 -> -0.2877220847805025 Inexact Rounded
+logx2125 log10 88.06005885607414 -> 1.944778971389913 Inexact Rounded
+logx2126 log10 0.0448240038219866 -> -1.348489353509709 Inexact Rounded
+logx2127 log10 3.419622484059565 -> 0.5339781639101145 Inexact Rounded
+logx2128 log10 5.171123353858721 -> 0.7135848977142854 Inexact Rounded
+logx2129 log10 0.0002133188319807 -> -3.670970802945872 Inexact Rounded
+logx2130 log10 46.21086703136966 -> 1.664744117045149 Inexact Rounded
+logx2131 log10 0.0000631053714415 -> -4.199933672639880 Inexact Rounded
+logx2132 log10 78.66019196870698 -> 1.895755001962469 Inexact Rounded
+logx2133 log10 0.0007152278351188 -> -3.145555592082297 Inexact Rounded
+logx2134 log10 45.52509819928536 -> 1.658250891256892 Inexact Rounded
+logx2135 log10 0.0000703227795740 -> -4.152903971697183 Inexact Rounded
+logx2136 log10 26.24438641426669 -> 1.419036423550599 Inexact Rounded
+logx2137 log10 0.0000044654829535 -> -5.350131564166817 Inexact Rounded
+logx2138 log10 0.7360702733062529 -> -0.1330807211893611 Inexact Rounded
+logx2139 log10 8.417059176469655 -> 0.9251603805112778 Inexact Rounded
+logx2140 log10 0.0002926570767968 -> -3.533640969664818 Inexact Rounded
+
+-- P=7, within 0-99
+Precision: 7
+logx2001 log10 57.26089 -> 1.757858 Inexact Rounded
+logx2002 log10 0.0575421 -> -1.240014 Inexact Rounded
+logx2003 log10 0.5918465 -> -0.2277909 Inexact Rounded
+logx2004 log10 0.0068776 -> -2.162563 Inexact Rounded
+logx2005 log10 0.0066833 -> -2.175009 Inexact Rounded
+logx2006 log10 9.926963 -> 0.9968164 Inexact Rounded
+logx2007 log10 0.0041852 -> -2.378284 Inexact Rounded
+logx2008 log10 84.15412 -> 1.925075 Inexact Rounded
+logx2009 log10 2.466856 -> 0.3921438 Inexact Rounded
+logx2010 log10 0.0058047 -> -2.236220 Inexact Rounded
+logx2011 log10 9.885154 -> 0.9949834 Inexact Rounded
+logx2012 log10 0.6667654 -> -0.1760269 Inexact Rounded
+logx2013 log10 34.65736 -> 1.539795 Inexact Rounded
+logx2014 log10 0.0026884 -> -2.570506 Inexact Rounded
+logx2015 log10 0.0432767 -> -1.363746 Inexact Rounded
+logx2016 log10 66.01407 -> 1.819637 Inexact Rounded
+logx2017 log10 0.0070572 -> -2.151368 Inexact Rounded
+logx2018 log10 0.0731613 -> -1.135719 Inexact Rounded
+logx2019 log10 9.838983 -> 0.9929502 Inexact Rounded
+logx2020 log10 15.89696 -> 1.201314 Inexact Rounded
+logx2021 log10 8.459247 -> 0.9273317 Inexact Rounded
+logx2022 log10 0.0010873 -> -2.963651 Inexact Rounded
+logx2023 log10 0.6498619 -> -0.1871789 Inexact Rounded
+logx2024 log10 0.0847008 -> -1.072112 Inexact Rounded
+logx2025 log10 0.0075489 -> -2.122116 Inexact Rounded
+logx2026 log10 51.11152 -> 1.708519 Inexact Rounded
+logx2027 log10 0.7233866 -> -0.1406295 Inexact Rounded
+logx2028 log10 2.254721 -> 0.3530928 Inexact Rounded
+logx2029 log10 6.568444 -> 0.8174625 Inexact Rounded
+logx2030 log10 83.72639 -> 1.922862 Inexact Rounded
+logx2031 log10 6.720585 -> 0.8274071 Inexact Rounded
+logx2032 log10 87.90366 -> 1.944007 Inexact Rounded
+logx2033 log10 0.0433324 -> -1.363187 Inexact Rounded
+logx2034 log10 34.63912 -> 1.539567 Inexact Rounded
+logx2035 log10 0.8089059 -> -0.09210200 Inexact Rounded
+logx2036 log10 7.793405 -> 0.8917272 Inexact Rounded
+logx2037 log10 0.0041757 -> -2.379271 Inexact Rounded
+logx2038 log10 7.135417 -> 0.8534194 Inexact Rounded
+logx2039 log10 12.49570 -> 1.096761 Inexact Rounded
+logx2040 log10 6.356276 -> 0.8032027 Inexact Rounded
+
+--------
+maxExponent: 384
+minExponent: -383
+precision: 16
+rounding: half_even
+
+-- special values
+logx820 log10 Infinity -> Infinity
+logx821 log10 0 -> -Infinity
+logx822 log10 NaN -> NaN
+logx823 log10 sNaN -> NaN Invalid_operation
+-- propagating NaNs
+logx824 log10 sNaN123 -> NaN123 Invalid_operation
+logx825 log10 -sNaN321 -> -NaN321 Invalid_operation
+logx826 log10 NaN456 -> NaN456
+logx827 log10 -NaN654 -> -NaN654
+logx828 log10 NaN1 -> NaN1
+
+
+-- Invalid operations due to restrictions
+-- [next two probably skipped by most test harnesses]
+precision: 100000000
+logx901 log10 1 -> NaN Invalid_context
+precision: 99999999
+logx902 log10 0 -> NaN Invalid_context
+
+precision: 9
+maxExponent: 1000000
+minExponent: -999999
+logx903 log10 1 -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999999
+logx904 log10 0 -> -Infinity
+maxExponent: 999999
+minExponent: -1000000
+logx905 log10 1 -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999998
+logx906 log10 0 -> -Infinity
+
+-- Null test
+logx900 log10 # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/logb.decTest b/Lib/test/decimaltestdata/logb.decTest
index 8b79006257..ff420d0a84 100644
--- a/Lib/test/decimaltestdata/logb.decTest
+++ b/Lib/test/decimaltestdata/logb.decTest
@@ -1,188 +1,188 @@
-------------------------------------------------------------------------
--- logb.decTest -- return integral adjusted exponent as per 754r --
--- Copyright (c) IBM Corporation, 2005, 2009. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This emphasises the testing of notable cases, as they will often
--- have unusual paths (especially the 10**n results).
-
-extended: 1
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-
--- basics & examples
-precision: 9
-logbx001 logb 0 -> -Infinity Division_by_zero
-logbx002 logb 1E-999 -> -999
-logbx003 logb 9E-999 -> -999
-logbx004 logb 0.001 -> -3
-logbx005 logb 0.03 -> -2
-logbx006 logb 1 -> 0
-logbx007 logb 2 -> 0
-logbx008 logb 2.5 -> 0
-logbx009 logb 2.50 -> 0
-logbx010 logb 10 -> 1
-logbx011 logb 70 -> 1
-logbx012 logb 100 -> 2
-logbx013 logb 250 -> 2
-logbx014 logb +Infinity -> Infinity
-
--- negatives are treated as positives
-logbx021 logb -0 -> -Infinity Division_by_zero
-logbx022 logb -1E-999 -> -999
-logbx023 logb -9E-999 -> -999
-logbx024 logb -0.001 -> -3
-logbx025 logb -1 -> 0
-logbx026 logb -2 -> 0
-logbx027 logb -10 -> 1
-logbx028 logb -70 -> 1
-logbx029 logb -100 -> 2
-logbx030 logb -100000000 -> 8
-logbx031 logb -Infinity -> Infinity
-
--- zeros
-logbx111 logb 0 -> -Infinity Division_by_zero
-logbx112 logb -0 -> -Infinity Division_by_zero
-logbx113 logb 0E+4 -> -Infinity Division_by_zero
-logbx114 logb -0E+4 -> -Infinity Division_by_zero
-logbx115 logb 0.0000 -> -Infinity Division_by_zero
-logbx116 logb -0.0000 -> -Infinity Division_by_zero
-logbx117 logb 0E-141 -> -Infinity Division_by_zero
-logbx118 logb -0E-141 -> -Infinity Division_by_zero
-
--- full coefficients, alternating bits
-logbx121 logb 268268268 -> 8
-logbx122 logb -268268268 -> 8
-logbx123 logb 134134134 -> 8
-logbx124 logb -134134134 -> 8
-
--- Nmax, Nmin, Ntiny
-logbx131 logb 9.99999999E+999 -> 999
-logbx132 logb 1E-999 -> -999
-logbx133 logb 1.00000000E-999 -> -999
-logbx134 logb 1E-1007 -> -1007
-
-logbx135 logb -1E-1007 -> -1007
-logbx136 logb -1.00000000E-999 -> -999
-logbx137 logb -1E-999 -> -999
-logbx138 logb -9.99999999E+999 -> 999
-
--- ones
-logbx0061 logb 1 -> 0
-logbx0062 logb 1.0 -> 0
-logbx0063 logb 1.000000000000000 -> 0
-logbx0064 logb 1.000000000000000000 -> 0
-
--- notable cases -- exact powers of 10
-logbx1100 logb 1 -> 0
-logbx1101 logb 10 -> 1
-logbx1102 logb 100 -> 2
-logbx1103 logb 1000 -> 3
-logbx1104 logb 10000 -> 4
-logbx1105 logb 100000 -> 5
-logbx1106 logb 1000000 -> 6
-logbx1107 logb 10000000 -> 7
-logbx1108 logb 100000000 -> 8
-logbx1109 logb 1000000000 -> 9
-logbx1110 logb 10000000000 -> 10
-logbx1111 logb 100000000000 -> 11
-logbx1112 logb 1000000000000 -> 12
-logbx1113 logb 0.00000000001 -> -11
-logbx1114 logb 0.0000000001 -> -10
-logbx1115 logb 0.000000001 -> -9
-logbx1116 logb 0.00000001 -> -8
-logbx1117 logb 0.0000001 -> -7
-logbx1118 logb 0.000001 -> -6
-logbx1119 logb 0.00001 -> -5
-logbx1120 logb 0.0001 -> -4
-logbx1121 logb 0.001 -> -3
-logbx1122 logb 0.01 -> -2
-logbx1123 logb 0.1 -> -1
-logbx1124 logb 1E-99 -> -99
-logbx1125 logb 1E-100 -> -100
-logbx1126 logb 1E-383 -> -383
-logbx1127 logb 1E-999 -> -999
-
--- suggestions from Ilan Nehama
-logbx1400 logb 10E-3 -> -2
-logbx1401 logb 10E-2 -> -1
-logbx1402 logb 100E-2 -> 0
-logbx1403 logb 1000E-2 -> 1
-logbx1404 logb 10000E-2 -> 2
-logbx1405 logb 10E-1 -> 0
-logbx1406 logb 100E-1 -> 1
-logbx1407 logb 1000E-1 -> 2
-logbx1408 logb 10000E-1 -> 3
-logbx1409 logb 10E0 -> 1
-logbx1410 logb 100E0 -> 2
-logbx1411 logb 1000E0 -> 3
-logbx1412 logb 10000E0 -> 4
-logbx1413 logb 10E1 -> 2
-logbx1414 logb 100E1 -> 3
-logbx1415 logb 1000E1 -> 4
-logbx1416 logb 10000E1 -> 5
-logbx1417 logb 10E2 -> 3
-logbx1418 logb 100E2 -> 4
-logbx1419 logb 1000E2 -> 5
-logbx1420 logb 10000E2 -> 6
-
--- inexacts
-precision: 2
-logbx1500 logb 10000E2 -> 6
-logbx1501 logb 1E+99 -> 99
-logbx1502 logb 1E-99 -> -99
-logbx1503 logb 1E+100 -> 1.0E+2 Rounded
-logbx1504 logb 1E+999 -> 1.0E+3 Inexact Rounded
-logbx1505 logb 1E-100 -> -1.0E+2 Rounded
-logbx1506 logb 1E-999 -> -1.0E+3 Inexact Rounded
-logbx1507 logb 1E-1111 -> -1.1E+3 Inexact Rounded
-logbx1508 logb 1E-3333 -> -3.3E+3 Inexact Rounded
-logbx1509 logb 1E-6666 -> -6.7E+3 Inexact Rounded
-logbx1510 logb 1E+999999999 -> 1.0E+9 Inexact Rounded
-logbx1511 logb 1E-999999999 -> -1.0E+9 Inexact Rounded
-precision: 1
-logbx1517 logb 1E-1111 -> -1E+3 Inexact Rounded
-logbx1518 logb 1E-3333 -> -3E+3 Inexact Rounded
-logbx1519 logb 1E-6666 -> -7E+3 Inexact Rounded
-precision: 8
-logbx1520 logb 1E+999999999 -> 1.0000000E+9 Inexact Rounded
-logbx1521 logb 1E-999999999 -> -1.0000000E+9 Inexact Rounded
-precision: 9
-logbx1523 logb 1E+999999999 -> 999999999
-logbx1524 logb 1E-999999999 -> -999999999
-
--- special values
-precision: 9
-logbx820 logb Infinity -> Infinity
-logbx821 logb -Infinity -> Infinity
-logbx822 logb 0 -> -Infinity Division_by_zero
-logbx823 logb NaN -> NaN
-logbx824 logb sNaN -> NaN Invalid_operation
--- propagating NaNs
-logbx825 logb sNaN123 -> NaN123 Invalid_operation
-logbx826 logb -sNaN321 -> -NaN321 Invalid_operation
-logbx827 logb NaN456 -> NaN456
-logbx828 logb -NaN654 -> -NaN654
-logbx829 logb NaN1 -> NaN1
-
--- Null test
-logbx900 logb # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- logb.decTest -- return integral adjusted exponent as per 754r --
+-- Copyright (c) IBM Corporation, 2005, 2009. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This emphasises the testing of notable cases, as they will often
+-- have unusual paths (especially the 10**n results).
+
+extended: 1
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+
+-- basics & examples
+precision: 9
+logbx001 logb 0 -> -Infinity Division_by_zero
+logbx002 logb 1E-999 -> -999
+logbx003 logb 9E-999 -> -999
+logbx004 logb 0.001 -> -3
+logbx005 logb 0.03 -> -2
+logbx006 logb 1 -> 0
+logbx007 logb 2 -> 0
+logbx008 logb 2.5 -> 0
+logbx009 logb 2.50 -> 0
+logbx010 logb 10 -> 1
+logbx011 logb 70 -> 1
+logbx012 logb 100 -> 2
+logbx013 logb 250 -> 2
+logbx014 logb +Infinity -> Infinity
+
+-- negatives are treated as positives
+logbx021 logb -0 -> -Infinity Division_by_zero
+logbx022 logb -1E-999 -> -999
+logbx023 logb -9E-999 -> -999
+logbx024 logb -0.001 -> -3
+logbx025 logb -1 -> 0
+logbx026 logb -2 -> 0
+logbx027 logb -10 -> 1
+logbx028 logb -70 -> 1
+logbx029 logb -100 -> 2
+logbx030 logb -100000000 -> 8
+logbx031 logb -Infinity -> Infinity
+
+-- zeros
+logbx111 logb 0 -> -Infinity Division_by_zero
+logbx112 logb -0 -> -Infinity Division_by_zero
+logbx113 logb 0E+4 -> -Infinity Division_by_zero
+logbx114 logb -0E+4 -> -Infinity Division_by_zero
+logbx115 logb 0.0000 -> -Infinity Division_by_zero
+logbx116 logb -0.0000 -> -Infinity Division_by_zero
+logbx117 logb 0E-141 -> -Infinity Division_by_zero
+logbx118 logb -0E-141 -> -Infinity Division_by_zero
+
+-- full coefficients, alternating bits
+logbx121 logb 268268268 -> 8
+logbx122 logb -268268268 -> 8
+logbx123 logb 134134134 -> 8
+logbx124 logb -134134134 -> 8
+
+-- Nmax, Nmin, Ntiny
+logbx131 logb 9.99999999E+999 -> 999
+logbx132 logb 1E-999 -> -999
+logbx133 logb 1.00000000E-999 -> -999
+logbx134 logb 1E-1007 -> -1007
+
+logbx135 logb -1E-1007 -> -1007
+logbx136 logb -1.00000000E-999 -> -999
+logbx137 logb -1E-999 -> -999
+logbx138 logb -9.99999999E+999 -> 999
+
+-- ones
+logbx0061 logb 1 -> 0
+logbx0062 logb 1.0 -> 0
+logbx0063 logb 1.000000000000000 -> 0
+logbx0064 logb 1.000000000000000000 -> 0
+
+-- notable cases -- exact powers of 10
+logbx1100 logb 1 -> 0
+logbx1101 logb 10 -> 1
+logbx1102 logb 100 -> 2
+logbx1103 logb 1000 -> 3
+logbx1104 logb 10000 -> 4
+logbx1105 logb 100000 -> 5
+logbx1106 logb 1000000 -> 6
+logbx1107 logb 10000000 -> 7
+logbx1108 logb 100000000 -> 8
+logbx1109 logb 1000000000 -> 9
+logbx1110 logb 10000000000 -> 10
+logbx1111 logb 100000000000 -> 11
+logbx1112 logb 1000000000000 -> 12
+logbx1113 logb 0.00000000001 -> -11
+logbx1114 logb 0.0000000001 -> -10
+logbx1115 logb 0.000000001 -> -9
+logbx1116 logb 0.00000001 -> -8
+logbx1117 logb 0.0000001 -> -7
+logbx1118 logb 0.000001 -> -6
+logbx1119 logb 0.00001 -> -5
+logbx1120 logb 0.0001 -> -4
+logbx1121 logb 0.001 -> -3
+logbx1122 logb 0.01 -> -2
+logbx1123 logb 0.1 -> -1
+logbx1124 logb 1E-99 -> -99
+logbx1125 logb 1E-100 -> -100
+logbx1126 logb 1E-383 -> -383
+logbx1127 logb 1E-999 -> -999
+
+-- suggestions from Ilan Nehama
+logbx1400 logb 10E-3 -> -2
+logbx1401 logb 10E-2 -> -1
+logbx1402 logb 100E-2 -> 0
+logbx1403 logb 1000E-2 -> 1
+logbx1404 logb 10000E-2 -> 2
+logbx1405 logb 10E-1 -> 0
+logbx1406 logb 100E-1 -> 1
+logbx1407 logb 1000E-1 -> 2
+logbx1408 logb 10000E-1 -> 3
+logbx1409 logb 10E0 -> 1
+logbx1410 logb 100E0 -> 2
+logbx1411 logb 1000E0 -> 3
+logbx1412 logb 10000E0 -> 4
+logbx1413 logb 10E1 -> 2
+logbx1414 logb 100E1 -> 3
+logbx1415 logb 1000E1 -> 4
+logbx1416 logb 10000E1 -> 5
+logbx1417 logb 10E2 -> 3
+logbx1418 logb 100E2 -> 4
+logbx1419 logb 1000E2 -> 5
+logbx1420 logb 10000E2 -> 6
+
+-- inexacts
+precision: 2
+logbx1500 logb 10000E2 -> 6
+logbx1501 logb 1E+99 -> 99
+logbx1502 logb 1E-99 -> -99
+logbx1503 logb 1E+100 -> 1.0E+2 Rounded
+logbx1504 logb 1E+999 -> 1.0E+3 Inexact Rounded
+logbx1505 logb 1E-100 -> -1.0E+2 Rounded
+logbx1506 logb 1E-999 -> -1.0E+3 Inexact Rounded
+logbx1507 logb 1E-1111 -> -1.1E+3 Inexact Rounded
+logbx1508 logb 1E-3333 -> -3.3E+3 Inexact Rounded
+logbx1509 logb 1E-6666 -> -6.7E+3 Inexact Rounded
+logbx1510 logb 1E+999999999 -> 1.0E+9 Inexact Rounded
+logbx1511 logb 1E-999999999 -> -1.0E+9 Inexact Rounded
+precision: 1
+logbx1517 logb 1E-1111 -> -1E+3 Inexact Rounded
+logbx1518 logb 1E-3333 -> -3E+3 Inexact Rounded
+logbx1519 logb 1E-6666 -> -7E+3 Inexact Rounded
+precision: 8
+logbx1520 logb 1E+999999999 -> 1.0000000E+9 Inexact Rounded
+logbx1521 logb 1E-999999999 -> -1.0000000E+9 Inexact Rounded
+precision: 9
+logbx1523 logb 1E+999999999 -> 999999999
+logbx1524 logb 1E-999999999 -> -999999999
+
+-- special values
+precision: 9
+logbx820 logb Infinity -> Infinity
+logbx821 logb -Infinity -> Infinity
+logbx822 logb 0 -> -Infinity Division_by_zero
+logbx823 logb NaN -> NaN
+logbx824 logb sNaN -> NaN Invalid_operation
+-- propagating NaNs
+logbx825 logb sNaN123 -> NaN123 Invalid_operation
+logbx826 logb -sNaN321 -> -NaN321 Invalid_operation
+logbx827 logb NaN456 -> NaN456
+logbx828 logb -NaN654 -> -NaN654
+logbx829 logb NaN1 -> NaN1
+
+-- Null test
+logbx900 logb # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/maxmag.decTest b/Lib/test/decimaltestdata/maxmag.decTest
index 265e912ed4..6b44213079 100644
--- a/Lib/test/decimaltestdata/maxmag.decTest
+++ b/Lib/test/decimaltestdata/maxmag.decTest
@@ -1,404 +1,404 @@
-------------------------------------------------------------------------
--- maxmag.decTest -- decimal maximum by magnitude --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- sanity checks
-mxgx001 maxmag -2 -2 -> -2
-mxgx002 maxmag -2 -1 -> -2
-mxgx003 maxmag -2 0 -> -2
-mxgx004 maxmag -2 1 -> -2
-mxgx005 maxmag -2 2 -> 2
-mxgx006 maxmag -1 -2 -> -2
-mxgx007 maxmag -1 -1 -> -1
-mxgx008 maxmag -1 0 -> -1
-mxgx009 maxmag -1 1 -> 1
-mxgx010 maxmag -1 2 -> 2
-mxgx011 maxmag 0 -2 -> -2
-mxgx012 maxmag 0 -1 -> -1
-mxgx013 maxmag 0 0 -> 0
-mxgx014 maxmag 0 1 -> 1
-mxgx015 maxmag 0 2 -> 2
-mxgx016 maxmag 1 -2 -> -2
-mxgx017 maxmag 1 -1 -> 1
-mxgx018 maxmag 1 0 -> 1
-mxgx019 maxmag 1 1 -> 1
-mxgx020 maxmag 1 2 -> 2
-mxgx021 maxmag 2 -2 -> 2
-mxgx022 maxmag 2 -1 -> 2
-mxgx023 maxmag 2 0 -> 2
-mxgx025 maxmag 2 1 -> 2
-mxgx026 maxmag 2 2 -> 2
-
--- extended zeros
-mxgx030 maxmag 0 0 -> 0
-mxgx031 maxmag 0 -0 -> 0
-mxgx032 maxmag 0 -0.0 -> 0
-mxgx033 maxmag 0 0.0 -> 0
-mxgx034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-mxgx035 maxmag -0 -0 -> -0
-mxgx036 maxmag -0 -0.0 -> -0.0
-mxgx037 maxmag -0 0.0 -> 0.0
-mxgx038 maxmag 0.0 0 -> 0
-mxgx039 maxmag 0.0 -0 -> 0.0
-mxgx040 maxmag 0.0 -0.0 -> 0.0
-mxgx041 maxmag 0.0 0.0 -> 0.0
-mxgx042 maxmag -0.0 0 -> 0
-mxgx043 maxmag -0.0 -0 -> -0.0
-mxgx044 maxmag -0.0 -0.0 -> -0.0
-mxgx045 maxmag -0.0 0.0 -> 0.0
-
-mxgx050 maxmag -0E1 0E1 -> 0E+1
-mxgx051 maxmag -0E2 0E2 -> 0E+2
-mxgx052 maxmag -0E2 0E1 -> 0E+1
-mxgx053 maxmag -0E1 0E2 -> 0E+2
-mxgx054 maxmag 0E1 -0E1 -> 0E+1
-mxgx055 maxmag 0E2 -0E2 -> 0E+2
-mxgx056 maxmag 0E2 -0E1 -> 0E+2
-mxgx057 maxmag 0E1 -0E2 -> 0E+1
-
-mxgx058 maxmag 0E1 0E1 -> 0E+1
-mxgx059 maxmag 0E2 0E2 -> 0E+2
-mxgx060 maxmag 0E2 0E1 -> 0E+2
-mxgx061 maxmag 0E1 0E2 -> 0E+2
-mxgx062 maxmag -0E1 -0E1 -> -0E+1
-mxgx063 maxmag -0E2 -0E2 -> -0E+2
-mxgx064 maxmag -0E2 -0E1 -> -0E+1
-mxgx065 maxmag -0E1 -0E2 -> -0E+1
-
--- Specials
-precision: 9
-mxgx090 maxmag Inf -Inf -> Infinity
-mxgx091 maxmag Inf -1000 -> Infinity
-mxgx092 maxmag Inf -1 -> Infinity
-mxgx093 maxmag Inf -0 -> Infinity
-mxgx094 maxmag Inf 0 -> Infinity
-mxgx095 maxmag Inf 1 -> Infinity
-mxgx096 maxmag Inf 1000 -> Infinity
-mxgx097 maxmag Inf Inf -> Infinity
-mxgx098 maxmag -1000 Inf -> Infinity
-mxgx099 maxmag -Inf Inf -> Infinity
-mxgx100 maxmag -1 Inf -> Infinity
-mxgx101 maxmag -0 Inf -> Infinity
-mxgx102 maxmag 0 Inf -> Infinity
-mxgx103 maxmag 1 Inf -> Infinity
-mxgx104 maxmag 1000 Inf -> Infinity
-mxgx105 maxmag Inf Inf -> Infinity
-
-mxgx120 maxmag -Inf -Inf -> -Infinity
-mxgx121 maxmag -Inf -1000 -> -Infinity
-mxgx122 maxmag -Inf -1 -> -Infinity
-mxgx123 maxmag -Inf -0 -> -Infinity
-mxgx124 maxmag -Inf 0 -> -Infinity
-mxgx125 maxmag -Inf 1 -> -Infinity
-mxgx126 maxmag -Inf 1000 -> -Infinity
-mxgx127 maxmag -Inf Inf -> Infinity
-mxgx128 maxmag -Inf -Inf -> -Infinity
-mxgx129 maxmag -1000 -Inf -> -Infinity
-mxgx130 maxmag -1 -Inf -> -Infinity
-mxgx131 maxmag -0 -Inf -> -Infinity
-mxgx132 maxmag 0 -Inf -> -Infinity
-mxgx133 maxmag 1 -Inf -> -Infinity
-mxgx134 maxmag 1000 -Inf -> -Infinity
-mxgx135 maxmag Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-mxgx141 maxmag NaN -Inf -> -Infinity
-mxgx142 maxmag NaN -1000 -> -1000
-mxgx143 maxmag NaN -1 -> -1
-mxgx144 maxmag NaN -0 -> -0
-mxgx145 maxmag NaN 0 -> 0
-mxgx146 maxmag NaN 1 -> 1
-mxgx147 maxmag NaN 1000 -> 1000
-mxgx148 maxmag NaN Inf -> Infinity
-mxgx149 maxmag NaN NaN -> NaN
-mxgx150 maxmag -Inf NaN -> -Infinity
-mxgx151 maxmag -1000 NaN -> -1000
-mxgx152 maxmag -1 NaN -> -1
-mxgx153 maxmag -0 NaN -> -0
-mxgx154 maxmag 0 NaN -> 0
-mxgx155 maxmag 1 NaN -> 1
-mxgx156 maxmag 1000 NaN -> 1000
-mxgx157 maxmag Inf NaN -> Infinity
-
-mxgx161 maxmag sNaN -Inf -> NaN Invalid_operation
-mxgx162 maxmag sNaN -1000 -> NaN Invalid_operation
-mxgx163 maxmag sNaN -1 -> NaN Invalid_operation
-mxgx164 maxmag sNaN -0 -> NaN Invalid_operation
-mxgx165 maxmag sNaN 0 -> NaN Invalid_operation
-mxgx166 maxmag sNaN 1 -> NaN Invalid_operation
-mxgx167 maxmag sNaN 1000 -> NaN Invalid_operation
-mxgx168 maxmag sNaN NaN -> NaN Invalid_operation
-mxgx169 maxmag sNaN sNaN -> NaN Invalid_operation
-mxgx170 maxmag NaN sNaN -> NaN Invalid_operation
-mxgx171 maxmag -Inf sNaN -> NaN Invalid_operation
-mxgx172 maxmag -1000 sNaN -> NaN Invalid_operation
-mxgx173 maxmag -1 sNaN -> NaN Invalid_operation
-mxgx174 maxmag -0 sNaN -> NaN Invalid_operation
-mxgx175 maxmag 0 sNaN -> NaN Invalid_operation
-mxgx176 maxmag 1 sNaN -> NaN Invalid_operation
-mxgx177 maxmag 1000 sNaN -> NaN Invalid_operation
-mxgx178 maxmag Inf sNaN -> NaN Invalid_operation
-mxgx179 maxmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-mxgx181 maxmag NaN9 -Inf -> -Infinity
-mxgx182 maxmag NaN8 9 -> 9
-mxgx183 maxmag -NaN7 Inf -> Infinity
-
-mxgx184 maxmag -NaN1 NaN11 -> -NaN1
-mxgx185 maxmag NaN2 NaN12 -> NaN2
-mxgx186 maxmag -NaN13 -NaN7 -> -NaN13
-mxgx187 maxmag NaN14 -NaN5 -> NaN14
-
-mxgx188 maxmag -Inf NaN4 -> -Infinity
-mxgx189 maxmag -9 -NaN3 -> -9
-mxgx190 maxmag Inf NaN2 -> Infinity
-
-mxgx191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
-mxgx192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
-mxgx193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
-mxgx194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
-mxgx195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
-mxgx196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
-mxgx197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
-mxgx198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
-mxgx199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
-
--- rounding checks
-maxexponent: 999
-minexponent: -999
-precision: 9
-mxgx201 maxmag 12345678000 1 -> 1.23456780E+10 Rounded
-mxgx202 maxmag 1 12345678000 -> 1.23456780E+10 Rounded
-mxgx203 maxmag 1234567800 1 -> 1.23456780E+9 Rounded
-mxgx204 maxmag 1 1234567800 -> 1.23456780E+9 Rounded
-mxgx205 maxmag 1234567890 1 -> 1.23456789E+9 Rounded
-mxgx206 maxmag 1 1234567890 -> 1.23456789E+9 Rounded
-mxgx207 maxmag 1234567891 1 -> 1.23456789E+9 Inexact Rounded
-mxgx208 maxmag 1 1234567891 -> 1.23456789E+9 Inexact Rounded
-mxgx209 maxmag 12345678901 1 -> 1.23456789E+10 Inexact Rounded
-mxgx210 maxmag 1 12345678901 -> 1.23456789E+10 Inexact Rounded
-mxgx211 maxmag 1234567896 1 -> 1.23456790E+9 Inexact Rounded
-mxgx212 maxmag 1 1234567896 -> 1.23456790E+9 Inexact Rounded
-mxgx213 maxmag -1234567891 1 -> -1.23456789E+9 Inexact Rounded
-mxgx214 maxmag 1 -1234567891 -> -1.23456789E+9 Inexact Rounded
-mxgx215 maxmag -12345678901 1 -> -1.23456789E+10 Inexact Rounded
-mxgx216 maxmag 1 -12345678901 -> -1.23456789E+10 Inexact Rounded
-mxgx217 maxmag -1234567896 1 -> -1.23456790E+9 Inexact Rounded
-mxgx218 maxmag 1 -1234567896 -> -1.23456790E+9 Inexact Rounded
-
-precision: 15
-mxgx221 maxmag 12345678000 1 -> 12345678000
-mxgx222 maxmag 1 12345678000 -> 12345678000
-mxgx223 maxmag 1234567800 1 -> 1234567800
-mxgx224 maxmag 1 1234567800 -> 1234567800
-mxgx225 maxmag 1234567890 1 -> 1234567890
-mxgx226 maxmag 1 1234567890 -> 1234567890
-mxgx227 maxmag 1234567891 1 -> 1234567891
-mxgx228 maxmag 1 1234567891 -> 1234567891
-mxgx229 maxmag 12345678901 1 -> 12345678901
-mxgx230 maxmag 1 12345678901 -> 12345678901
-mxgx231 maxmag 1234567896 1 -> 1234567896
-mxgx232 maxmag 1 1234567896 -> 1234567896
-mxgx233 maxmag -1234567891 1 -> -1234567891
-mxgx234 maxmag 1 -1234567891 -> -1234567891
-mxgx235 maxmag -12345678901 1 -> -12345678901
-mxgx236 maxmag 1 -12345678901 -> -12345678901
-mxgx237 maxmag -1234567896 1 -> -1234567896
-mxgx238 maxmag 1 -1234567896 -> -1234567896
-
--- from examples
-mxgx280 maxmag '3' '2' -> '3'
-mxgx281 maxmag '-10' '3' -> '-10'
-mxgx282 maxmag '1.0' '1' -> '1'
-mxgx283 maxmag '1' '1.0' -> '1'
-mxgx284 maxmag '7' 'NaN' -> '7'
-
--- overflow and underflow tests ...
-maxExponent: 999999999
-minexponent: -999999999
-mxgx330 maxmag +1.23456789012345E-0 9E+999999999 -> 9E+999999999
-mxgx331 maxmag 9E+999999999 +1.23456789012345E-0 -> 9E+999999999
-mxgx332 maxmag +0.100 9E-999999999 -> 0.100
-mxgx333 maxmag 9E-999999999 +0.100 -> 0.100
-mxgx335 maxmag -1.23456789012345E-0 9E+999999999 -> 9E+999999999
-mxgx336 maxmag 9E+999999999 -1.23456789012345E-0 -> 9E+999999999
-mxgx337 maxmag -0.100 9E-999999999 -> -0.100
-mxgx338 maxmag 9E-999999999 -0.100 -> -0.100
-
-mxgx339 maxmag 1e-599999999 1e-400000001 -> 1E-400000001
-mxgx340 maxmag 1e-599999999 1e-400000000 -> 1E-400000000
-mxgx341 maxmag 1e-600000000 1e-400000000 -> 1E-400000000
-mxgx342 maxmag 9e-999999998 0.01 -> 0.01
-mxgx343 maxmag 9e-999999998 0.1 -> 0.1
-mxgx344 maxmag 0.01 9e-999999998 -> 0.01
-mxgx345 maxmag 1e599999999 1e400000001 -> 1E+599999999
-mxgx346 maxmag 1e599999999 1e400000000 -> 1E+599999999
-mxgx347 maxmag 1e600000000 1e400000000 -> 1E+600000000
-mxgx348 maxmag 9e999999998 100 -> 9E+999999998
-mxgx349 maxmag 9e999999998 10 -> 9E+999999998
-mxgx350 maxmag 100 9e999999998 -> 9E+999999998
--- signs
-mxgx351 maxmag 1e+777777777 1e+411111111 -> 1E+777777777
-mxgx352 maxmag 1e+777777777 -1e+411111111 -> 1E+777777777
-mxgx353 maxmag -1e+777777777 1e+411111111 -> -1E+777777777
-mxgx354 maxmag -1e+777777777 -1e+411111111 -> -1E+777777777
-mxgx355 maxmag 1e-777777777 1e-411111111 -> 1E-411111111
-mxgx356 maxmag 1e-777777777 -1e-411111111 -> -1E-411111111
-mxgx357 maxmag -1e-777777777 1e-411111111 -> 1E-411111111
-mxgx358 maxmag -1e-777777777 -1e-411111111 -> -1E-411111111
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-mxgx401 maxmag Inf 1.1 -> Infinity
-mxgx402 maxmag 1.1 1 -> 1.1
-mxgx403 maxmag 1 1.0 -> 1
-mxgx404 maxmag 1.0 0.1 -> 1.0
-mxgx405 maxmag 0.1 0.10 -> 0.1
-mxgx406 maxmag 0.10 0.100 -> 0.10
-mxgx407 maxmag 0.10 0 -> 0.10
-mxgx408 maxmag 0 0.0 -> 0
-mxgx409 maxmag 0.0 -0 -> 0.0
-mxgx410 maxmag 0.0 -0.0 -> 0.0
-mxgx411 maxmag 0.00 -0.0 -> 0.00
-mxgx412 maxmag 0.0 -0.00 -> 0.0
-mxgx413 maxmag 0 -0.0 -> 0
-mxgx414 maxmag 0 -0 -> 0
-mxgx415 maxmag -0.0 -0 -> -0.0
-mxgx416 maxmag -0 -0.100 -> -0.100
-mxgx417 maxmag -0.100 -0.10 -> -0.100
-mxgx418 maxmag -0.10 -0.1 -> -0.10
-mxgx419 maxmag -0.1 -1.0 -> -1.0
-mxgx420 maxmag -1.0 -1 -> -1.0
-mxgx421 maxmag -1 -1.1 -> -1.1
-mxgx423 maxmag -1.1 -Inf -> -Infinity
--- same with operands reversed
-mxgx431 maxmag 1.1 Inf -> Infinity
-mxgx432 maxmag 1 1.1 -> 1.1
-mxgx433 maxmag 1.0 1 -> 1
-mxgx434 maxmag 0.1 1.0 -> 1.0
-mxgx435 maxmag 0.10 0.1 -> 0.1
-mxgx436 maxmag 0.100 0.10 -> 0.10
-mxgx437 maxmag 0 0.10 -> 0.10
-mxgx438 maxmag 0.0 0 -> 0
-mxgx439 maxmag -0 0.0 -> 0.0
-mxgx440 maxmag -0.0 0.0 -> 0.0
-mxgx441 maxmag -0.0 0.00 -> 0.00
-mxgx442 maxmag -0.00 0.0 -> 0.0
-mxgx443 maxmag -0.0 0 -> 0
-mxgx444 maxmag -0 0 -> 0
-mxgx445 maxmag -0 -0.0 -> -0.0
-mxgx446 maxmag -0.100 -0 -> -0.100
-mxgx447 maxmag -0.10 -0.100 -> -0.100
-mxgx448 maxmag -0.1 -0.10 -> -0.10
-mxgx449 maxmag -1.0 -0.1 -> -1.0
-mxgx450 maxmag -1 -1.0 -> -1.0
-mxgx451 maxmag -1.1 -1 -> -1.1
-mxgx453 maxmag -Inf -1.1 -> -Infinity
--- largies
-mxgx460 maxmag 1000 1E+3 -> 1E+3
-mxgx461 maxmag 1E+3 1000 -> 1E+3
-mxgx462 maxmag 1000 -1E+3 -> 1000
-mxgx463 maxmag 1E+3 -1000 -> 1E+3
-mxgx464 maxmag -1000 1E+3 -> 1E+3
-mxgx465 maxmag -1E+3 1000 -> 1000
-mxgx466 maxmag -1000 -1E+3 -> -1000
-mxgx467 maxmag -1E+3 -1000 -> -1000
-
--- rounding (results treated as though plus)
-maxexponent: 999999999
-minexponent: -999999999
-precision: 3
-
-mxgx470 maxmag 1 .5 -> 1
-mxgx471 maxmag 10 5 -> 10
-mxgx472 maxmag 100 50 -> 100
-mxgx473 maxmag 1000 500 -> 1.00E+3 Rounded
-mxgx474 maxmag 10000 5000 -> 1.00E+4 Rounded
-mxgx475 maxmag 6 .5 -> 6
-mxgx476 maxmag 66 5 -> 66
-mxgx477 maxmag 666 50 -> 666
-mxgx478 maxmag 6666 500 -> 6.67E+3 Rounded Inexact
-mxgx479 maxmag 66666 5000 -> 6.67E+4 Rounded Inexact
-mxgx480 maxmag 33333 5000 -> 3.33E+4 Rounded Inexact
-mxgx481 maxmag .5 1 -> 1
-mxgx482 maxmag .5 10 -> 10
-mxgx483 maxmag .5 100 -> 100
-mxgx484 maxmag .5 1000 -> 1.00E+3 Rounded
-mxgx485 maxmag .5 10000 -> 1.00E+4 Rounded
-mxgx486 maxmag .5 6 -> 6
-mxgx487 maxmag .5 66 -> 66
-mxgx488 maxmag .5 666 -> 666
-mxgx489 maxmag .5 6666 -> 6.67E+3 Rounded Inexact
-mxgx490 maxmag .5 66666 -> 6.67E+4 Rounded Inexact
-mxgx491 maxmag .5 33333 -> 3.33E+4 Rounded Inexact
-
--- overflow tests
-maxexponent: 999999999
-minexponent: -999999999
-precision: 3
-mxgx500 maxmag 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded
-mxgx501 maxmag -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded
-
--- subnormals and underflow
-precision: 3
-maxexponent: 999
-minexponent: -999
-mxgx510 maxmag 1.00E-999 0 -> 1.00E-999
-mxgx511 maxmag 0.1E-999 0 -> 1E-1000 Subnormal
-mxgx512 maxmag 0.10E-999 0 -> 1.0E-1000 Subnormal
-mxgx513 maxmag 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded
-mxgx514 maxmag 0.01E-999 0 -> 1E-1001 Subnormal
--- next is rounded to Nmin
-mxgx515 maxmag 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow
-mxgx516 maxmag 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
-mxgx517 maxmag 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow
-mxgx518 maxmag 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-mxgx519 maxmag 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-mxgx520 maxmag 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-
-mxgx530 maxmag -1.00E-999 0 -> -1.00E-999
-mxgx531 maxmag -0.1E-999 0 -> -1E-1000 Subnormal
-mxgx532 maxmag -0.10E-999 0 -> -1.0E-1000 Subnormal
-mxgx533 maxmag -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded
-mxgx534 maxmag -0.01E-999 0 -> -1E-1001 Subnormal
--- next is rounded to -Nmin
-mxgx535 maxmag -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow
-mxgx536 maxmag -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-mxgx537 maxmag -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow
-mxgx538 maxmag -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-mxgx539 maxmag -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-mxgx540 maxmag -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-
--- Null tests
-mxgx900 maxmag 10 # -> NaN Invalid_operation
-mxgx901 maxmag # 10 -> NaN Invalid_operation
-
-
-
+------------------------------------------------------------------------
+-- maxmag.decTest -- decimal maximum by magnitude --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- sanity checks
+mxgx001 maxmag -2 -2 -> -2
+mxgx002 maxmag -2 -1 -> -2
+mxgx003 maxmag -2 0 -> -2
+mxgx004 maxmag -2 1 -> -2
+mxgx005 maxmag -2 2 -> 2
+mxgx006 maxmag -1 -2 -> -2
+mxgx007 maxmag -1 -1 -> -1
+mxgx008 maxmag -1 0 -> -1
+mxgx009 maxmag -1 1 -> 1
+mxgx010 maxmag -1 2 -> 2
+mxgx011 maxmag 0 -2 -> -2
+mxgx012 maxmag 0 -1 -> -1
+mxgx013 maxmag 0 0 -> 0
+mxgx014 maxmag 0 1 -> 1
+mxgx015 maxmag 0 2 -> 2
+mxgx016 maxmag 1 -2 -> -2
+mxgx017 maxmag 1 -1 -> 1
+mxgx018 maxmag 1 0 -> 1
+mxgx019 maxmag 1 1 -> 1
+mxgx020 maxmag 1 2 -> 2
+mxgx021 maxmag 2 -2 -> 2
+mxgx022 maxmag 2 -1 -> 2
+mxgx023 maxmag 2 0 -> 2
+mxgx025 maxmag 2 1 -> 2
+mxgx026 maxmag 2 2 -> 2
+
+-- extended zeros
+mxgx030 maxmag 0 0 -> 0
+mxgx031 maxmag 0 -0 -> 0
+mxgx032 maxmag 0 -0.0 -> 0
+mxgx033 maxmag 0 0.0 -> 0
+mxgx034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+mxgx035 maxmag -0 -0 -> -0
+mxgx036 maxmag -0 -0.0 -> -0.0
+mxgx037 maxmag -0 0.0 -> 0.0
+mxgx038 maxmag 0.0 0 -> 0
+mxgx039 maxmag 0.0 -0 -> 0.0
+mxgx040 maxmag 0.0 -0.0 -> 0.0
+mxgx041 maxmag 0.0 0.0 -> 0.0
+mxgx042 maxmag -0.0 0 -> 0
+mxgx043 maxmag -0.0 -0 -> -0.0
+mxgx044 maxmag -0.0 -0.0 -> -0.0
+mxgx045 maxmag -0.0 0.0 -> 0.0
+
+mxgx050 maxmag -0E1 0E1 -> 0E+1
+mxgx051 maxmag -0E2 0E2 -> 0E+2
+mxgx052 maxmag -0E2 0E1 -> 0E+1
+mxgx053 maxmag -0E1 0E2 -> 0E+2
+mxgx054 maxmag 0E1 -0E1 -> 0E+1
+mxgx055 maxmag 0E2 -0E2 -> 0E+2
+mxgx056 maxmag 0E2 -0E1 -> 0E+2
+mxgx057 maxmag 0E1 -0E2 -> 0E+1
+
+mxgx058 maxmag 0E1 0E1 -> 0E+1
+mxgx059 maxmag 0E2 0E2 -> 0E+2
+mxgx060 maxmag 0E2 0E1 -> 0E+2
+mxgx061 maxmag 0E1 0E2 -> 0E+2
+mxgx062 maxmag -0E1 -0E1 -> -0E+1
+mxgx063 maxmag -0E2 -0E2 -> -0E+2
+mxgx064 maxmag -0E2 -0E1 -> -0E+1
+mxgx065 maxmag -0E1 -0E2 -> -0E+1
+
+-- Specials
+precision: 9
+mxgx090 maxmag Inf -Inf -> Infinity
+mxgx091 maxmag Inf -1000 -> Infinity
+mxgx092 maxmag Inf -1 -> Infinity
+mxgx093 maxmag Inf -0 -> Infinity
+mxgx094 maxmag Inf 0 -> Infinity
+mxgx095 maxmag Inf 1 -> Infinity
+mxgx096 maxmag Inf 1000 -> Infinity
+mxgx097 maxmag Inf Inf -> Infinity
+mxgx098 maxmag -1000 Inf -> Infinity
+mxgx099 maxmag -Inf Inf -> Infinity
+mxgx100 maxmag -1 Inf -> Infinity
+mxgx101 maxmag -0 Inf -> Infinity
+mxgx102 maxmag 0 Inf -> Infinity
+mxgx103 maxmag 1 Inf -> Infinity
+mxgx104 maxmag 1000 Inf -> Infinity
+mxgx105 maxmag Inf Inf -> Infinity
+
+mxgx120 maxmag -Inf -Inf -> -Infinity
+mxgx121 maxmag -Inf -1000 -> -Infinity
+mxgx122 maxmag -Inf -1 -> -Infinity
+mxgx123 maxmag -Inf -0 -> -Infinity
+mxgx124 maxmag -Inf 0 -> -Infinity
+mxgx125 maxmag -Inf 1 -> -Infinity
+mxgx126 maxmag -Inf 1000 -> -Infinity
+mxgx127 maxmag -Inf Inf -> Infinity
+mxgx128 maxmag -Inf -Inf -> -Infinity
+mxgx129 maxmag -1000 -Inf -> -Infinity
+mxgx130 maxmag -1 -Inf -> -Infinity
+mxgx131 maxmag -0 -Inf -> -Infinity
+mxgx132 maxmag 0 -Inf -> -Infinity
+mxgx133 maxmag 1 -Inf -> -Infinity
+mxgx134 maxmag 1000 -Inf -> -Infinity
+mxgx135 maxmag Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+mxgx141 maxmag NaN -Inf -> -Infinity
+mxgx142 maxmag NaN -1000 -> -1000
+mxgx143 maxmag NaN -1 -> -1
+mxgx144 maxmag NaN -0 -> -0
+mxgx145 maxmag NaN 0 -> 0
+mxgx146 maxmag NaN 1 -> 1
+mxgx147 maxmag NaN 1000 -> 1000
+mxgx148 maxmag NaN Inf -> Infinity
+mxgx149 maxmag NaN NaN -> NaN
+mxgx150 maxmag -Inf NaN -> -Infinity
+mxgx151 maxmag -1000 NaN -> -1000
+mxgx152 maxmag -1 NaN -> -1
+mxgx153 maxmag -0 NaN -> -0
+mxgx154 maxmag 0 NaN -> 0
+mxgx155 maxmag 1 NaN -> 1
+mxgx156 maxmag 1000 NaN -> 1000
+mxgx157 maxmag Inf NaN -> Infinity
+
+mxgx161 maxmag sNaN -Inf -> NaN Invalid_operation
+mxgx162 maxmag sNaN -1000 -> NaN Invalid_operation
+mxgx163 maxmag sNaN -1 -> NaN Invalid_operation
+mxgx164 maxmag sNaN -0 -> NaN Invalid_operation
+mxgx165 maxmag sNaN 0 -> NaN Invalid_operation
+mxgx166 maxmag sNaN 1 -> NaN Invalid_operation
+mxgx167 maxmag sNaN 1000 -> NaN Invalid_operation
+mxgx168 maxmag sNaN NaN -> NaN Invalid_operation
+mxgx169 maxmag sNaN sNaN -> NaN Invalid_operation
+mxgx170 maxmag NaN sNaN -> NaN Invalid_operation
+mxgx171 maxmag -Inf sNaN -> NaN Invalid_operation
+mxgx172 maxmag -1000 sNaN -> NaN Invalid_operation
+mxgx173 maxmag -1 sNaN -> NaN Invalid_operation
+mxgx174 maxmag -0 sNaN -> NaN Invalid_operation
+mxgx175 maxmag 0 sNaN -> NaN Invalid_operation
+mxgx176 maxmag 1 sNaN -> NaN Invalid_operation
+mxgx177 maxmag 1000 sNaN -> NaN Invalid_operation
+mxgx178 maxmag Inf sNaN -> NaN Invalid_operation
+mxgx179 maxmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+mxgx181 maxmag NaN9 -Inf -> -Infinity
+mxgx182 maxmag NaN8 9 -> 9
+mxgx183 maxmag -NaN7 Inf -> Infinity
+
+mxgx184 maxmag -NaN1 NaN11 -> -NaN1
+mxgx185 maxmag NaN2 NaN12 -> NaN2
+mxgx186 maxmag -NaN13 -NaN7 -> -NaN13
+mxgx187 maxmag NaN14 -NaN5 -> NaN14
+
+mxgx188 maxmag -Inf NaN4 -> -Infinity
+mxgx189 maxmag -9 -NaN3 -> -9
+mxgx190 maxmag Inf NaN2 -> Infinity
+
+mxgx191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
+mxgx192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
+mxgx193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
+mxgx194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
+mxgx195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
+mxgx196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
+mxgx197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
+mxgx198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
+mxgx199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
+
+-- rounding checks
+maxexponent: 999
+minexponent: -999
+precision: 9
+mxgx201 maxmag 12345678000 1 -> 1.23456780E+10 Rounded
+mxgx202 maxmag 1 12345678000 -> 1.23456780E+10 Rounded
+mxgx203 maxmag 1234567800 1 -> 1.23456780E+9 Rounded
+mxgx204 maxmag 1 1234567800 -> 1.23456780E+9 Rounded
+mxgx205 maxmag 1234567890 1 -> 1.23456789E+9 Rounded
+mxgx206 maxmag 1 1234567890 -> 1.23456789E+9 Rounded
+mxgx207 maxmag 1234567891 1 -> 1.23456789E+9 Inexact Rounded
+mxgx208 maxmag 1 1234567891 -> 1.23456789E+9 Inexact Rounded
+mxgx209 maxmag 12345678901 1 -> 1.23456789E+10 Inexact Rounded
+mxgx210 maxmag 1 12345678901 -> 1.23456789E+10 Inexact Rounded
+mxgx211 maxmag 1234567896 1 -> 1.23456790E+9 Inexact Rounded
+mxgx212 maxmag 1 1234567896 -> 1.23456790E+9 Inexact Rounded
+mxgx213 maxmag -1234567891 1 -> -1.23456789E+9 Inexact Rounded
+mxgx214 maxmag 1 -1234567891 -> -1.23456789E+9 Inexact Rounded
+mxgx215 maxmag -12345678901 1 -> -1.23456789E+10 Inexact Rounded
+mxgx216 maxmag 1 -12345678901 -> -1.23456789E+10 Inexact Rounded
+mxgx217 maxmag -1234567896 1 -> -1.23456790E+9 Inexact Rounded
+mxgx218 maxmag 1 -1234567896 -> -1.23456790E+9 Inexact Rounded
+
+precision: 15
+mxgx221 maxmag 12345678000 1 -> 12345678000
+mxgx222 maxmag 1 12345678000 -> 12345678000
+mxgx223 maxmag 1234567800 1 -> 1234567800
+mxgx224 maxmag 1 1234567800 -> 1234567800
+mxgx225 maxmag 1234567890 1 -> 1234567890
+mxgx226 maxmag 1 1234567890 -> 1234567890
+mxgx227 maxmag 1234567891 1 -> 1234567891
+mxgx228 maxmag 1 1234567891 -> 1234567891
+mxgx229 maxmag 12345678901 1 -> 12345678901
+mxgx230 maxmag 1 12345678901 -> 12345678901
+mxgx231 maxmag 1234567896 1 -> 1234567896
+mxgx232 maxmag 1 1234567896 -> 1234567896
+mxgx233 maxmag -1234567891 1 -> -1234567891
+mxgx234 maxmag 1 -1234567891 -> -1234567891
+mxgx235 maxmag -12345678901 1 -> -12345678901
+mxgx236 maxmag 1 -12345678901 -> -12345678901
+mxgx237 maxmag -1234567896 1 -> -1234567896
+mxgx238 maxmag 1 -1234567896 -> -1234567896
+
+-- from examples
+mxgx280 maxmag '3' '2' -> '3'
+mxgx281 maxmag '-10' '3' -> '-10'
+mxgx282 maxmag '1.0' '1' -> '1'
+mxgx283 maxmag '1' '1.0' -> '1'
+mxgx284 maxmag '7' 'NaN' -> '7'
+
+-- overflow and underflow tests ...
+maxExponent: 999999999
+minexponent: -999999999
+mxgx330 maxmag +1.23456789012345E-0 9E+999999999 -> 9E+999999999
+mxgx331 maxmag 9E+999999999 +1.23456789012345E-0 -> 9E+999999999
+mxgx332 maxmag +0.100 9E-999999999 -> 0.100
+mxgx333 maxmag 9E-999999999 +0.100 -> 0.100
+mxgx335 maxmag -1.23456789012345E-0 9E+999999999 -> 9E+999999999
+mxgx336 maxmag 9E+999999999 -1.23456789012345E-0 -> 9E+999999999
+mxgx337 maxmag -0.100 9E-999999999 -> -0.100
+mxgx338 maxmag 9E-999999999 -0.100 -> -0.100
+
+mxgx339 maxmag 1e-599999999 1e-400000001 -> 1E-400000001
+mxgx340 maxmag 1e-599999999 1e-400000000 -> 1E-400000000
+mxgx341 maxmag 1e-600000000 1e-400000000 -> 1E-400000000
+mxgx342 maxmag 9e-999999998 0.01 -> 0.01
+mxgx343 maxmag 9e-999999998 0.1 -> 0.1
+mxgx344 maxmag 0.01 9e-999999998 -> 0.01
+mxgx345 maxmag 1e599999999 1e400000001 -> 1E+599999999
+mxgx346 maxmag 1e599999999 1e400000000 -> 1E+599999999
+mxgx347 maxmag 1e600000000 1e400000000 -> 1E+600000000
+mxgx348 maxmag 9e999999998 100 -> 9E+999999998
+mxgx349 maxmag 9e999999998 10 -> 9E+999999998
+mxgx350 maxmag 100 9e999999998 -> 9E+999999998
+-- signs
+mxgx351 maxmag 1e+777777777 1e+411111111 -> 1E+777777777
+mxgx352 maxmag 1e+777777777 -1e+411111111 -> 1E+777777777
+mxgx353 maxmag -1e+777777777 1e+411111111 -> -1E+777777777
+mxgx354 maxmag -1e+777777777 -1e+411111111 -> -1E+777777777
+mxgx355 maxmag 1e-777777777 1e-411111111 -> 1E-411111111
+mxgx356 maxmag 1e-777777777 -1e-411111111 -> -1E-411111111
+mxgx357 maxmag -1e-777777777 1e-411111111 -> 1E-411111111
+mxgx358 maxmag -1e-777777777 -1e-411111111 -> -1E-411111111
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+mxgx401 maxmag Inf 1.1 -> Infinity
+mxgx402 maxmag 1.1 1 -> 1.1
+mxgx403 maxmag 1 1.0 -> 1
+mxgx404 maxmag 1.0 0.1 -> 1.0
+mxgx405 maxmag 0.1 0.10 -> 0.1
+mxgx406 maxmag 0.10 0.100 -> 0.10
+mxgx407 maxmag 0.10 0 -> 0.10
+mxgx408 maxmag 0 0.0 -> 0
+mxgx409 maxmag 0.0 -0 -> 0.0
+mxgx410 maxmag 0.0 -0.0 -> 0.0
+mxgx411 maxmag 0.00 -0.0 -> 0.00
+mxgx412 maxmag 0.0 -0.00 -> 0.0
+mxgx413 maxmag 0 -0.0 -> 0
+mxgx414 maxmag 0 -0 -> 0
+mxgx415 maxmag -0.0 -0 -> -0.0
+mxgx416 maxmag -0 -0.100 -> -0.100
+mxgx417 maxmag -0.100 -0.10 -> -0.100
+mxgx418 maxmag -0.10 -0.1 -> -0.10
+mxgx419 maxmag -0.1 -1.0 -> -1.0
+mxgx420 maxmag -1.0 -1 -> -1.0
+mxgx421 maxmag -1 -1.1 -> -1.1
+mxgx423 maxmag -1.1 -Inf -> -Infinity
+-- same with operands reversed
+mxgx431 maxmag 1.1 Inf -> Infinity
+mxgx432 maxmag 1 1.1 -> 1.1
+mxgx433 maxmag 1.0 1 -> 1
+mxgx434 maxmag 0.1 1.0 -> 1.0
+mxgx435 maxmag 0.10 0.1 -> 0.1
+mxgx436 maxmag 0.100 0.10 -> 0.10
+mxgx437 maxmag 0 0.10 -> 0.10
+mxgx438 maxmag 0.0 0 -> 0
+mxgx439 maxmag -0 0.0 -> 0.0
+mxgx440 maxmag -0.0 0.0 -> 0.0
+mxgx441 maxmag -0.0 0.00 -> 0.00
+mxgx442 maxmag -0.00 0.0 -> 0.0
+mxgx443 maxmag -0.0 0 -> 0
+mxgx444 maxmag -0 0 -> 0
+mxgx445 maxmag -0 -0.0 -> -0.0
+mxgx446 maxmag -0.100 -0 -> -0.100
+mxgx447 maxmag -0.10 -0.100 -> -0.100
+mxgx448 maxmag -0.1 -0.10 -> -0.10
+mxgx449 maxmag -1.0 -0.1 -> -1.0
+mxgx450 maxmag -1 -1.0 -> -1.0
+mxgx451 maxmag -1.1 -1 -> -1.1
+mxgx453 maxmag -Inf -1.1 -> -Infinity
+-- largies
+mxgx460 maxmag 1000 1E+3 -> 1E+3
+mxgx461 maxmag 1E+3 1000 -> 1E+3
+mxgx462 maxmag 1000 -1E+3 -> 1000
+mxgx463 maxmag 1E+3 -1000 -> 1E+3
+mxgx464 maxmag -1000 1E+3 -> 1E+3
+mxgx465 maxmag -1E+3 1000 -> 1000
+mxgx466 maxmag -1000 -1E+3 -> -1000
+mxgx467 maxmag -1E+3 -1000 -> -1000
+
+-- rounding (results treated as though plus)
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+
+mxgx470 maxmag 1 .5 -> 1
+mxgx471 maxmag 10 5 -> 10
+mxgx472 maxmag 100 50 -> 100
+mxgx473 maxmag 1000 500 -> 1.00E+3 Rounded
+mxgx474 maxmag 10000 5000 -> 1.00E+4 Rounded
+mxgx475 maxmag 6 .5 -> 6
+mxgx476 maxmag 66 5 -> 66
+mxgx477 maxmag 666 50 -> 666
+mxgx478 maxmag 6666 500 -> 6.67E+3 Rounded Inexact
+mxgx479 maxmag 66666 5000 -> 6.67E+4 Rounded Inexact
+mxgx480 maxmag 33333 5000 -> 3.33E+4 Rounded Inexact
+mxgx481 maxmag .5 1 -> 1
+mxgx482 maxmag .5 10 -> 10
+mxgx483 maxmag .5 100 -> 100
+mxgx484 maxmag .5 1000 -> 1.00E+3 Rounded
+mxgx485 maxmag .5 10000 -> 1.00E+4 Rounded
+mxgx486 maxmag .5 6 -> 6
+mxgx487 maxmag .5 66 -> 66
+mxgx488 maxmag .5 666 -> 666
+mxgx489 maxmag .5 6666 -> 6.67E+3 Rounded Inexact
+mxgx490 maxmag .5 66666 -> 6.67E+4 Rounded Inexact
+mxgx491 maxmag .5 33333 -> 3.33E+4 Rounded Inexact
+
+-- overflow tests
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+mxgx500 maxmag 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded
+mxgx501 maxmag -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded
+
+-- subnormals and underflow
+precision: 3
+maxexponent: 999
+minexponent: -999
+mxgx510 maxmag 1.00E-999 0 -> 1.00E-999
+mxgx511 maxmag 0.1E-999 0 -> 1E-1000 Subnormal
+mxgx512 maxmag 0.10E-999 0 -> 1.0E-1000 Subnormal
+mxgx513 maxmag 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded
+mxgx514 maxmag 0.01E-999 0 -> 1E-1001 Subnormal
+-- next is rounded to Nmin
+mxgx515 maxmag 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow
+mxgx516 maxmag 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+mxgx517 maxmag 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow
+mxgx518 maxmag 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+mxgx519 maxmag 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+mxgx520 maxmag 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+
+mxgx530 maxmag -1.00E-999 0 -> -1.00E-999
+mxgx531 maxmag -0.1E-999 0 -> -1E-1000 Subnormal
+mxgx532 maxmag -0.10E-999 0 -> -1.0E-1000 Subnormal
+mxgx533 maxmag -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded
+mxgx534 maxmag -0.01E-999 0 -> -1E-1001 Subnormal
+-- next is rounded to -Nmin
+mxgx535 maxmag -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow
+mxgx536 maxmag -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+mxgx537 maxmag -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow
+mxgx538 maxmag -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+mxgx539 maxmag -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+mxgx540 maxmag -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+
+-- Null tests
+mxgx900 maxmag 10 # -> NaN Invalid_operation
+mxgx901 maxmag # 10 -> NaN Invalid_operation
+
+
+
diff --git a/Lib/test/decimaltestdata/minmag.decTest b/Lib/test/decimaltestdata/minmag.decTest
index f1ac3852e8..9e562339eb 100644
--- a/Lib/test/decimaltestdata/minmag.decTest
+++ b/Lib/test/decimaltestdata/minmag.decTest
@@ -1,390 +1,390 @@
-------------------------------------------------------------------------
--- minmag.decTest -- decimal minimum by magnitude --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- sanity checks
-mngx001 minmag -2 -2 -> -2
-mngx002 minmag -2 -1 -> -1
-mngx003 minmag -2 0 -> 0
-mngx004 minmag -2 1 -> 1
-mngx005 minmag -2 2 -> -2
-mngx006 minmag -1 -2 -> -1
-mngx007 minmag -1 -1 -> -1
-mngx008 minmag -1 0 -> 0
-mngx009 minmag -1 1 -> -1
-mngx010 minmag -1 2 -> -1
-mngx011 minmag 0 -2 -> 0
-mngx012 minmag 0 -1 -> 0
-mngx013 minmag 0 0 -> 0
-mngx014 minmag 0 1 -> 0
-mngx015 minmag 0 2 -> 0
-mngx016 minmag 1 -2 -> 1
-mngx017 minmag 1 -1 -> -1
-mngx018 minmag 1 0 -> 0
-mngx019 minmag 1 1 -> 1
-mngx020 minmag 1 2 -> 1
-mngx021 minmag 2 -2 -> -2
-mngx022 minmag 2 -1 -> -1
-mngx023 minmag 2 0 -> 0
-mngx025 minmag 2 1 -> 1
-mngx026 minmag 2 2 -> 2
-
--- extended zeros
-mngx030 minmag 0 0 -> 0
-mngx031 minmag 0 -0 -> -0
-mngx032 minmag 0 -0.0 -> -0.0
-mngx033 minmag 0 0.0 -> 0.0
-mngx034 minmag -0 0 -> -0
-mngx035 minmag -0 -0 -> -0
-mngx036 minmag -0 -0.0 -> -0
-mngx037 minmag -0 0.0 -> -0
-mngx038 minmag 0.0 0 -> 0.0
-mngx039 minmag 0.0 -0 -> -0
-mngx040 minmag 0.0 -0.0 -> -0.0
-mngx041 minmag 0.0 0.0 -> 0.0
-mngx042 minmag -0.0 0 -> -0.0
-mngx043 minmag -0.0 -0 -> -0
-mngx044 minmag -0.0 -0.0 -> -0.0
-mngx045 minmag -0.0 0.0 -> -0.0
-
-mngx046 minmag 0E1 -0E1 -> -0E+1
-mngx047 minmag -0E1 0E2 -> -0E+1
-mngx048 minmag 0E2 0E1 -> 0E+1
-mngx049 minmag 0E1 0E2 -> 0E+1
-mngx050 minmag -0E3 -0E2 -> -0E+3
-mngx051 minmag -0E2 -0E3 -> -0E+3
-
--- Specials
-precision: 9
-mngx090 minmag Inf -Inf -> -Infinity
-mngx091 minmag Inf -1000 -> -1000
-mngx092 minmag Inf -1 -> -1
-mngx093 minmag Inf -0 -> -0
-mngx094 minmag Inf 0 -> 0
-mngx095 minmag Inf 1 -> 1
-mngx096 minmag Inf 1000 -> 1000
-mngx097 minmag Inf Inf -> Infinity
-mngx098 minmag -1000 Inf -> -1000
-mngx099 minmag -Inf Inf -> -Infinity
-mngx100 minmag -1 Inf -> -1
-mngx101 minmag -0 Inf -> -0
-mngx102 minmag 0 Inf -> 0
-mngx103 minmag 1 Inf -> 1
-mngx104 minmag 1000 Inf -> 1000
-mngx105 minmag Inf Inf -> Infinity
-
-mngx120 minmag -Inf -Inf -> -Infinity
-mngx121 minmag -Inf -1000 -> -1000
-mngx122 minmag -Inf -1 -> -1
-mngx123 minmag -Inf -0 -> -0
-mngx124 minmag -Inf 0 -> 0
-mngx125 minmag -Inf 1 -> 1
-mngx126 minmag -Inf 1000 -> 1000
-mngx127 minmag -Inf Inf -> -Infinity
-mngx128 minmag -Inf -Inf -> -Infinity
-mngx129 minmag -1000 -Inf -> -1000
-mngx130 minmag -1 -Inf -> -1
-mngx131 minmag -0 -Inf -> -0
-mngx132 minmag 0 -Inf -> 0
-mngx133 minmag 1 -Inf -> 1
-mngx134 minmag 1000 -Inf -> 1000
-mngx135 minmag Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-mngx141 minmag NaN -Inf -> -Infinity
-mngx142 minmag NaN -1000 -> -1000
-mngx143 minmag NaN -1 -> -1
-mngx144 minmag NaN -0 -> -0
-mngx145 minmag NaN 0 -> 0
-mngx146 minmag NaN 1 -> 1
-mngx147 minmag NaN 1000 -> 1000
-mngx148 minmag NaN Inf -> Infinity
-mngx149 minmag NaN NaN -> NaN
-mngx150 minmag -Inf NaN -> -Infinity
-mngx151 minmag -1000 NaN -> -1000
-mngx152 minmag -1 -NaN -> -1
-mngx153 minmag -0 NaN -> -0
-mngx154 minmag 0 -NaN -> 0
-mngx155 minmag 1 NaN -> 1
-mngx156 minmag 1000 NaN -> 1000
-mngx157 minmag Inf NaN -> Infinity
-
-mngx161 minmag sNaN -Inf -> NaN Invalid_operation
-mngx162 minmag sNaN -1000 -> NaN Invalid_operation
-mngx163 minmag sNaN -1 -> NaN Invalid_operation
-mngx164 minmag sNaN -0 -> NaN Invalid_operation
-mngx165 minmag -sNaN 0 -> -NaN Invalid_operation
-mngx166 minmag -sNaN 1 -> -NaN Invalid_operation
-mngx167 minmag sNaN 1000 -> NaN Invalid_operation
-mngx168 minmag sNaN NaN -> NaN Invalid_operation
-mngx169 minmag sNaN sNaN -> NaN Invalid_operation
-mngx170 minmag NaN sNaN -> NaN Invalid_operation
-mngx171 minmag -Inf sNaN -> NaN Invalid_operation
-mngx172 minmag -1000 sNaN -> NaN Invalid_operation
-mngx173 minmag -1 sNaN -> NaN Invalid_operation
-mngx174 minmag -0 sNaN -> NaN Invalid_operation
-mngx175 minmag 0 sNaN -> NaN Invalid_operation
-mngx176 minmag 1 sNaN -> NaN Invalid_operation
-mngx177 minmag 1000 sNaN -> NaN Invalid_operation
-mngx178 minmag Inf sNaN -> NaN Invalid_operation
-mngx179 minmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-mngx181 minmag NaN9 -Inf -> -Infinity
-mngx182 minmag -NaN8 9990 -> 9990
-mngx183 minmag NaN71 Inf -> Infinity
-
-mngx184 minmag NaN1 NaN54 -> NaN1
-mngx185 minmag NaN22 -NaN53 -> NaN22
-mngx186 minmag -NaN3 NaN6 -> -NaN3
-mngx187 minmag -NaN44 NaN7 -> -NaN44
-
-mngx188 minmag -Inf NaN41 -> -Infinity
-mngx189 minmag -9999 -NaN33 -> -9999
-mngx190 minmag Inf NaN2 -> Infinity
-
-mngx191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
-mngx192 minmag sNaN98 -11 -> NaN98 Invalid_operation
-mngx193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
-mngx194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
-mngx195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
-mngx196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
-mngx197 minmag 088 sNaN91 -> NaN91 Invalid_operation
-mngx198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
-mngx199 minmag NaN sNaN86 -> NaN86 Invalid_operation
-
--- rounding checks -- chosen is rounded, or not
-maxExponent: 999
-minexponent: -999
-precision: 9
-mngx201 minmag -12345678000 1 -> 1
-mngx202 minmag 1 -12345678000 -> 1
-mngx203 minmag -1234567800 1 -> 1
-mngx204 minmag 1 -1234567800 -> 1
-mngx205 minmag -1234567890 1 -> 1
-mngx206 minmag 1 -1234567890 -> 1
-mngx207 minmag -1234567891 1 -> 1
-mngx208 minmag 1 -1234567891 -> 1
-mngx209 minmag -12345678901 1 -> 1
-mngx210 minmag 1 -12345678901 -> 1
-mngx211 minmag -1234567896 1 -> 1
-mngx212 minmag 1 -1234567896 -> 1
-mngx213 minmag 1234567891 1 -> 1
-mngx214 minmag 1 1234567891 -> 1
-mngx215 minmag 12345678901 1 -> 1
-mngx216 minmag 1 12345678901 -> 1
-mngx217 minmag 1234567896 1 -> 1
-mngx218 minmag 1 1234567896 -> 1
-
-precision: 15
-mngx221 minmag -12345678000 1 -> 1
-mngx222 minmag 1 -12345678000 -> 1
-mngx223 minmag -1234567800 1 -> 1
-mngx224 minmag 1 -1234567800 -> 1
-mngx225 minmag -1234567890 1 -> 1
-mngx226 minmag 1 -1234567890 -> 1
-mngx227 minmag -1234567891 1 -> 1
-mngx228 minmag 1 -1234567891 -> 1
-mngx229 minmag -12345678901 1 -> 1
-mngx230 minmag 1 -12345678901 -> 1
-mngx231 minmag -1234567896 1 -> 1
-mngx232 minmag 1 -1234567896 -> 1
-mngx233 minmag 1234567891 1 -> 1
-mngx234 minmag 1 1234567891 -> 1
-mngx235 minmag 12345678901 1 -> 1
-mngx236 minmag 1 12345678901 -> 1
-mngx237 minmag 1234567896 1 -> 1
-mngx238 minmag 1 1234567896 -> 1
-
--- from examples
-mngx280 minmag '3' '2' -> '2'
-mngx281 minmag '-10' '3' -> '3'
-mngx282 minmag '1.0' '1' -> '1.0'
-mngx283 minmag '1' '1.0' -> '1.0'
-mngx284 minmag '7' 'NaN' -> '7'
-
--- overflow and underflow tests .. subnormal results [inputs] now allowed
-maxExponent: 999999999
-minexponent: -999999999
-mngx330 minmag -1.23456789012345E-0 -9E+999999999 -> -1.23456789012345
-mngx331 minmag -9E+999999999 -1.23456789012345E-0 -> -1.23456789012345
-mngx332 minmag -0.100 -9E-999999999 -> -9E-999999999
-mngx333 minmag -9E-999999999 -0.100 -> -9E-999999999
-mngx335 minmag +1.23456789012345E-0 -9E+999999999 -> 1.23456789012345
-mngx336 minmag -9E+999999999 1.23456789012345E-0 -> 1.23456789012345
-mngx337 minmag +0.100 -9E-999999999 -> -9E-999999999
-mngx338 minmag -9E-999999999 0.100 -> -9E-999999999
-
-mngx339 minmag -1e-599999999 -1e-400000001 -> -1E-599999999
-mngx340 minmag -1e-599999999 -1e-400000000 -> -1E-599999999
-mngx341 minmag -1e-600000000 -1e-400000000 -> -1E-600000000
-mngx342 minmag -9e-999999998 -0.01 -> -9E-999999998
-mngx343 minmag -9e-999999998 -0.1 -> -9E-999999998
-mngx344 minmag -0.01 -9e-999999998 -> -9E-999999998
-mngx345 minmag -1e599999999 -1e400000001 -> -1E+400000001
-mngx346 minmag -1e599999999 -1e400000000 -> -1E+400000000
-mngx347 minmag -1e600000000 -1e400000000 -> -1E+400000000
-mngx348 minmag -9e999999998 -100 -> -100
-mngx349 minmag -9e999999998 -10 -> -10
-mngx350 minmag -100 -9e999999998 -> -100
--- signs
-mngx351 minmag -1e+777777777 -1e+411111111 -> -1E+411111111
-mngx352 minmag -1e+777777777 +1e+411111111 -> 1E+411111111
-mngx353 minmag +1e+777777777 -1e+411111111 -> -1E+411111111
-mngx354 minmag +1e+777777777 +1e+411111111 -> 1E+411111111
-mngx355 minmag -1e-777777777 -1e-411111111 -> -1E-777777777
-mngx356 minmag -1e-777777777 +1e-411111111 -> -1E-777777777
-mngx357 minmag +1e-777777777 -1e-411111111 -> 1E-777777777
-mngx358 minmag +1e-777777777 +1e-411111111 -> 1E-777777777
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-mngx401 minmag Inf 1.1 -> 1.1
-mngx402 minmag 1.1 1 -> 1
-mngx403 minmag 1 1.0 -> 1.0
-mngx404 minmag 1.0 0.1 -> 0.1
-mngx405 minmag 0.1 0.10 -> 0.10
-mngx406 minmag 0.10 0.100 -> 0.100
-mngx407 minmag 0.10 0 -> 0
-mngx408 minmag 0 0.0 -> 0.0
-mngx409 minmag 0.0 -0 -> -0
-mngx410 minmag 0.0 -0.0 -> -0.0
-mngx411 minmag 0.00 -0.0 -> -0.0
-mngx412 minmag 0.0 -0.00 -> -0.00
-mngx413 minmag 0 -0.0 -> -0.0
-mngx414 minmag 0 -0 -> -0
-mngx415 minmag -0.0 -0 -> -0
-mngx416 minmag -0 -0.100 -> -0
-mngx417 minmag -0.100 -0.10 -> -0.10
-mngx418 minmag -0.10 -0.1 -> -0.1
-mngx419 minmag -0.1 -1.0 -> -0.1
-mngx420 minmag -1.0 -1 -> -1
-mngx421 minmag -1 -1.1 -> -1
-mngx423 minmag -1.1 -Inf -> -1.1
--- same with operands reversed
-mngx431 minmag 1.1 Inf -> 1.1
-mngx432 minmag 1 1.1 -> 1
-mngx433 minmag 1.0 1 -> 1.0
-mngx434 minmag 0.1 1.0 -> 0.1
-mngx435 minmag 0.10 0.1 -> 0.10
-mngx436 minmag 0.100 0.10 -> 0.100
-mngx437 minmag 0 0.10 -> 0
-mngx438 minmag 0.0 0 -> 0.0
-mngx439 minmag -0 0.0 -> -0
-mngx440 minmag -0.0 0.0 -> -0.0
-mngx441 minmag -0.0 0.00 -> -0.0
-mngx442 minmag -0.00 0.0 -> -0.00
-mngx443 minmag -0.0 0 -> -0.0
-mngx444 minmag -0 0 -> -0
-mngx445 minmag -0 -0.0 -> -0
-mngx446 minmag -0.100 -0 -> -0
-mngx447 minmag -0.10 -0.100 -> -0.10
-mngx448 minmag -0.1 -0.10 -> -0.1
-mngx449 minmag -1.0 -0.1 -> -0.1
-mngx450 minmag -1 -1.0 -> -1
-mngx451 minmag -1.1 -1 -> -1
-mngx453 minmag -Inf -1.1 -> -1.1
--- largies
-mngx460 minmag 1000 1E+3 -> 1000
-mngx461 minmag 1E+3 1000 -> 1000
-mngx462 minmag 1000 -1E+3 -> -1E+3
-mngx463 minmag 1E+3 -1000 -> -1000
-mngx464 minmag -1000 1E+3 -> -1000
-mngx465 minmag -1E+3 1000 -> -1E+3
-mngx466 minmag -1000 -1E+3 -> -1E+3
-mngx467 minmag -1E+3 -1000 -> -1E+3
-
--- rounding (results treated as though plus)
-maxexponent: 999999999
-minexponent: -999999999
-precision: 3
-
-mngx470 minmag 1 5 -> 1
-mngx471 minmag 10 50 -> 10
-mngx472 minmag 100 500 -> 100
-mngx473 minmag 1000 5000 -> 1.00E+3 Rounded
-mngx474 minmag 10000 50000 -> 1.00E+4 Rounded
-mngx475 minmag 6 50 -> 6
-mngx476 minmag 66 500 -> 66
-mngx477 minmag 666 5000 -> 666
-mngx478 minmag 6666 50000 -> 6.67E+3 Rounded Inexact
-mngx479 minmag 66666 500000 -> 6.67E+4 Rounded Inexact
-mngx480 minmag 33333 500000 -> 3.33E+4 Rounded Inexact
-mngx481 minmag 75401 1 -> 1
-mngx482 minmag 75402 10 -> 10
-mngx483 minmag 75403 100 -> 100
-mngx484 minmag 75404 1000 -> 1.00E+3 Rounded
-mngx485 minmag 75405 10000 -> 1.00E+4 Rounded
-mngx486 minmag 75406 6 -> 6
-mngx487 minmag 75407 66 -> 66
-mngx488 minmag 75408 666 -> 666
-mngx489 minmag 75409 6666 -> 6.67E+3 Rounded Inexact
-mngx490 minmag 75410 66666 -> 6.67E+4 Rounded Inexact
-mngx491 minmag 75411 33333 -> 3.33E+4 Rounded Inexact
-
-
--- overflow tests
-maxexponent: 999999999
-minexponent: -999999999
-precision: 3
-mngx500 minmag 9.999E+999999999 0 -> 0
-mngx501 minmag -9.999E+999999999 0 -> 0
-
--- subnormals and underflow
-precision: 3
-maxexponent: 999
-minexponent: -999
-mngx510 minmag 1.00E-999 0 -> 0
-mngx511 minmag 0.1E-999 0 -> 0
-mngx512 minmag 0.10E-999 0 -> 0
-mngx513 minmag 0.100E-999 0 -> 0
-mngx514 minmag 0.01E-999 0 -> 0
-mngx515 minmag 0.999E-999 0 -> 0
-mngx516 minmag 0.099E-999 0 -> 0
-mngx517 minmag 0.009E-999 0 -> 0
-mngx518 minmag 0.001E-999 0 -> 0
-mngx519 minmag 0.0009E-999 0 -> 0
-mngx520 minmag 0.0001E-999 0 -> 0
-
-mngx530 minmag -1.00E-999 0 -> 0
-mngx531 minmag -0.1E-999 0 -> 0
-mngx532 minmag -0.10E-999 0 -> 0
-mngx533 minmag -0.100E-999 0 -> 0
-mngx534 minmag -0.01E-999 0 -> 0
-mngx535 minmag -0.999E-999 0 -> 0
-mngx536 minmag -0.099E-999 0 -> 0
-mngx537 minmag -0.009E-999 0 -> 0
-mngx538 minmag -0.001E-999 0 -> 0
-mngx539 minmag -0.0009E-999 0 -> 0
-mngx540 minmag -0.0001E-999 0 -> 0
-
-
--- Null tests
-mng900 minmag 10 # -> NaN Invalid_operation
-mng901 minmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- minmag.decTest -- decimal minimum by magnitude --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- sanity checks
+mngx001 minmag -2 -2 -> -2
+mngx002 minmag -2 -1 -> -1
+mngx003 minmag -2 0 -> 0
+mngx004 minmag -2 1 -> 1
+mngx005 minmag -2 2 -> -2
+mngx006 minmag -1 -2 -> -1
+mngx007 minmag -1 -1 -> -1
+mngx008 minmag -1 0 -> 0
+mngx009 minmag -1 1 -> -1
+mngx010 minmag -1 2 -> -1
+mngx011 minmag 0 -2 -> 0
+mngx012 minmag 0 -1 -> 0
+mngx013 minmag 0 0 -> 0
+mngx014 minmag 0 1 -> 0
+mngx015 minmag 0 2 -> 0
+mngx016 minmag 1 -2 -> 1
+mngx017 minmag 1 -1 -> -1
+mngx018 minmag 1 0 -> 0
+mngx019 minmag 1 1 -> 1
+mngx020 minmag 1 2 -> 1
+mngx021 minmag 2 -2 -> -2
+mngx022 minmag 2 -1 -> -1
+mngx023 minmag 2 0 -> 0
+mngx025 minmag 2 1 -> 1
+mngx026 minmag 2 2 -> 2
+
+-- extended zeros
+mngx030 minmag 0 0 -> 0
+mngx031 minmag 0 -0 -> -0
+mngx032 minmag 0 -0.0 -> -0.0
+mngx033 minmag 0 0.0 -> 0.0
+mngx034 minmag -0 0 -> -0
+mngx035 minmag -0 -0 -> -0
+mngx036 minmag -0 -0.0 -> -0
+mngx037 minmag -0 0.0 -> -0
+mngx038 minmag 0.0 0 -> 0.0
+mngx039 minmag 0.0 -0 -> -0
+mngx040 minmag 0.0 -0.0 -> -0.0
+mngx041 minmag 0.0 0.0 -> 0.0
+mngx042 minmag -0.0 0 -> -0.0
+mngx043 minmag -0.0 -0 -> -0
+mngx044 minmag -0.0 -0.0 -> -0.0
+mngx045 minmag -0.0 0.0 -> -0.0
+
+mngx046 minmag 0E1 -0E1 -> -0E+1
+mngx047 minmag -0E1 0E2 -> -0E+1
+mngx048 minmag 0E2 0E1 -> 0E+1
+mngx049 minmag 0E1 0E2 -> 0E+1
+mngx050 minmag -0E3 -0E2 -> -0E+3
+mngx051 minmag -0E2 -0E3 -> -0E+3
+
+-- Specials
+precision: 9
+mngx090 minmag Inf -Inf -> -Infinity
+mngx091 minmag Inf -1000 -> -1000
+mngx092 minmag Inf -1 -> -1
+mngx093 minmag Inf -0 -> -0
+mngx094 minmag Inf 0 -> 0
+mngx095 minmag Inf 1 -> 1
+mngx096 minmag Inf 1000 -> 1000
+mngx097 minmag Inf Inf -> Infinity
+mngx098 minmag -1000 Inf -> -1000
+mngx099 minmag -Inf Inf -> -Infinity
+mngx100 minmag -1 Inf -> -1
+mngx101 minmag -0 Inf -> -0
+mngx102 minmag 0 Inf -> 0
+mngx103 minmag 1 Inf -> 1
+mngx104 minmag 1000 Inf -> 1000
+mngx105 minmag Inf Inf -> Infinity
+
+mngx120 minmag -Inf -Inf -> -Infinity
+mngx121 minmag -Inf -1000 -> -1000
+mngx122 minmag -Inf -1 -> -1
+mngx123 minmag -Inf -0 -> -0
+mngx124 minmag -Inf 0 -> 0
+mngx125 minmag -Inf 1 -> 1
+mngx126 minmag -Inf 1000 -> 1000
+mngx127 minmag -Inf Inf -> -Infinity
+mngx128 minmag -Inf -Inf -> -Infinity
+mngx129 minmag -1000 -Inf -> -1000
+mngx130 minmag -1 -Inf -> -1
+mngx131 minmag -0 -Inf -> -0
+mngx132 minmag 0 -Inf -> 0
+mngx133 minmag 1 -Inf -> 1
+mngx134 minmag 1000 -Inf -> 1000
+mngx135 minmag Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+mngx141 minmag NaN -Inf -> -Infinity
+mngx142 minmag NaN -1000 -> -1000
+mngx143 minmag NaN -1 -> -1
+mngx144 minmag NaN -0 -> -0
+mngx145 minmag NaN 0 -> 0
+mngx146 minmag NaN 1 -> 1
+mngx147 minmag NaN 1000 -> 1000
+mngx148 minmag NaN Inf -> Infinity
+mngx149 minmag NaN NaN -> NaN
+mngx150 minmag -Inf NaN -> -Infinity
+mngx151 minmag -1000 NaN -> -1000
+mngx152 minmag -1 -NaN -> -1
+mngx153 minmag -0 NaN -> -0
+mngx154 minmag 0 -NaN -> 0
+mngx155 minmag 1 NaN -> 1
+mngx156 minmag 1000 NaN -> 1000
+mngx157 minmag Inf NaN -> Infinity
+
+mngx161 minmag sNaN -Inf -> NaN Invalid_operation
+mngx162 minmag sNaN -1000 -> NaN Invalid_operation
+mngx163 minmag sNaN -1 -> NaN Invalid_operation
+mngx164 minmag sNaN -0 -> NaN Invalid_operation
+mngx165 minmag -sNaN 0 -> -NaN Invalid_operation
+mngx166 minmag -sNaN 1 -> -NaN Invalid_operation
+mngx167 minmag sNaN 1000 -> NaN Invalid_operation
+mngx168 minmag sNaN NaN -> NaN Invalid_operation
+mngx169 minmag sNaN sNaN -> NaN Invalid_operation
+mngx170 minmag NaN sNaN -> NaN Invalid_operation
+mngx171 minmag -Inf sNaN -> NaN Invalid_operation
+mngx172 minmag -1000 sNaN -> NaN Invalid_operation
+mngx173 minmag -1 sNaN -> NaN Invalid_operation
+mngx174 minmag -0 sNaN -> NaN Invalid_operation
+mngx175 minmag 0 sNaN -> NaN Invalid_operation
+mngx176 minmag 1 sNaN -> NaN Invalid_operation
+mngx177 minmag 1000 sNaN -> NaN Invalid_operation
+mngx178 minmag Inf sNaN -> NaN Invalid_operation
+mngx179 minmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+mngx181 minmag NaN9 -Inf -> -Infinity
+mngx182 minmag -NaN8 9990 -> 9990
+mngx183 minmag NaN71 Inf -> Infinity
+
+mngx184 minmag NaN1 NaN54 -> NaN1
+mngx185 minmag NaN22 -NaN53 -> NaN22
+mngx186 minmag -NaN3 NaN6 -> -NaN3
+mngx187 minmag -NaN44 NaN7 -> -NaN44
+
+mngx188 minmag -Inf NaN41 -> -Infinity
+mngx189 minmag -9999 -NaN33 -> -9999
+mngx190 minmag Inf NaN2 -> Infinity
+
+mngx191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
+mngx192 minmag sNaN98 -11 -> NaN98 Invalid_operation
+mngx193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
+mngx194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
+mngx195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
+mngx196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
+mngx197 minmag 088 sNaN91 -> NaN91 Invalid_operation
+mngx198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
+mngx199 minmag NaN sNaN86 -> NaN86 Invalid_operation
+
+-- rounding checks -- chosen is rounded, or not
+maxExponent: 999
+minexponent: -999
+precision: 9
+mngx201 minmag -12345678000 1 -> 1
+mngx202 minmag 1 -12345678000 -> 1
+mngx203 minmag -1234567800 1 -> 1
+mngx204 minmag 1 -1234567800 -> 1
+mngx205 minmag -1234567890 1 -> 1
+mngx206 minmag 1 -1234567890 -> 1
+mngx207 minmag -1234567891 1 -> 1
+mngx208 minmag 1 -1234567891 -> 1
+mngx209 minmag -12345678901 1 -> 1
+mngx210 minmag 1 -12345678901 -> 1
+mngx211 minmag -1234567896 1 -> 1
+mngx212 minmag 1 -1234567896 -> 1
+mngx213 minmag 1234567891 1 -> 1
+mngx214 minmag 1 1234567891 -> 1
+mngx215 minmag 12345678901 1 -> 1
+mngx216 minmag 1 12345678901 -> 1
+mngx217 minmag 1234567896 1 -> 1
+mngx218 minmag 1 1234567896 -> 1
+
+precision: 15
+mngx221 minmag -12345678000 1 -> 1
+mngx222 minmag 1 -12345678000 -> 1
+mngx223 minmag -1234567800 1 -> 1
+mngx224 minmag 1 -1234567800 -> 1
+mngx225 minmag -1234567890 1 -> 1
+mngx226 minmag 1 -1234567890 -> 1
+mngx227 minmag -1234567891 1 -> 1
+mngx228 minmag 1 -1234567891 -> 1
+mngx229 minmag -12345678901 1 -> 1
+mngx230 minmag 1 -12345678901 -> 1
+mngx231 minmag -1234567896 1 -> 1
+mngx232 minmag 1 -1234567896 -> 1
+mngx233 minmag 1234567891 1 -> 1
+mngx234 minmag 1 1234567891 -> 1
+mngx235 minmag 12345678901 1 -> 1
+mngx236 minmag 1 12345678901 -> 1
+mngx237 minmag 1234567896 1 -> 1
+mngx238 minmag 1 1234567896 -> 1
+
+-- from examples
+mngx280 minmag '3' '2' -> '2'
+mngx281 minmag '-10' '3' -> '3'
+mngx282 minmag '1.0' '1' -> '1.0'
+mngx283 minmag '1' '1.0' -> '1.0'
+mngx284 minmag '7' 'NaN' -> '7'
+
+-- overflow and underflow tests .. subnormal results [inputs] now allowed
+maxExponent: 999999999
+minexponent: -999999999
+mngx330 minmag -1.23456789012345E-0 -9E+999999999 -> -1.23456789012345
+mngx331 minmag -9E+999999999 -1.23456789012345E-0 -> -1.23456789012345
+mngx332 minmag -0.100 -9E-999999999 -> -9E-999999999
+mngx333 minmag -9E-999999999 -0.100 -> -9E-999999999
+mngx335 minmag +1.23456789012345E-0 -9E+999999999 -> 1.23456789012345
+mngx336 minmag -9E+999999999 1.23456789012345E-0 -> 1.23456789012345
+mngx337 minmag +0.100 -9E-999999999 -> -9E-999999999
+mngx338 minmag -9E-999999999 0.100 -> -9E-999999999
+
+mngx339 minmag -1e-599999999 -1e-400000001 -> -1E-599999999
+mngx340 minmag -1e-599999999 -1e-400000000 -> -1E-599999999
+mngx341 minmag -1e-600000000 -1e-400000000 -> -1E-600000000
+mngx342 minmag -9e-999999998 -0.01 -> -9E-999999998
+mngx343 minmag -9e-999999998 -0.1 -> -9E-999999998
+mngx344 minmag -0.01 -9e-999999998 -> -9E-999999998
+mngx345 minmag -1e599999999 -1e400000001 -> -1E+400000001
+mngx346 minmag -1e599999999 -1e400000000 -> -1E+400000000
+mngx347 minmag -1e600000000 -1e400000000 -> -1E+400000000
+mngx348 minmag -9e999999998 -100 -> -100
+mngx349 minmag -9e999999998 -10 -> -10
+mngx350 minmag -100 -9e999999998 -> -100
+-- signs
+mngx351 minmag -1e+777777777 -1e+411111111 -> -1E+411111111
+mngx352 minmag -1e+777777777 +1e+411111111 -> 1E+411111111
+mngx353 minmag +1e+777777777 -1e+411111111 -> -1E+411111111
+mngx354 minmag +1e+777777777 +1e+411111111 -> 1E+411111111
+mngx355 minmag -1e-777777777 -1e-411111111 -> -1E-777777777
+mngx356 minmag -1e-777777777 +1e-411111111 -> -1E-777777777
+mngx357 minmag +1e-777777777 -1e-411111111 -> 1E-777777777
+mngx358 minmag +1e-777777777 +1e-411111111 -> 1E-777777777
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+mngx401 minmag Inf 1.1 -> 1.1
+mngx402 minmag 1.1 1 -> 1
+mngx403 minmag 1 1.0 -> 1.0
+mngx404 minmag 1.0 0.1 -> 0.1
+mngx405 minmag 0.1 0.10 -> 0.10
+mngx406 minmag 0.10 0.100 -> 0.100
+mngx407 minmag 0.10 0 -> 0
+mngx408 minmag 0 0.0 -> 0.0
+mngx409 minmag 0.0 -0 -> -0
+mngx410 minmag 0.0 -0.0 -> -0.0
+mngx411 minmag 0.00 -0.0 -> -0.0
+mngx412 minmag 0.0 -0.00 -> -0.00
+mngx413 minmag 0 -0.0 -> -0.0
+mngx414 minmag 0 -0 -> -0
+mngx415 minmag -0.0 -0 -> -0
+mngx416 minmag -0 -0.100 -> -0
+mngx417 minmag -0.100 -0.10 -> -0.10
+mngx418 minmag -0.10 -0.1 -> -0.1
+mngx419 minmag -0.1 -1.0 -> -0.1
+mngx420 minmag -1.0 -1 -> -1
+mngx421 minmag -1 -1.1 -> -1
+mngx423 minmag -1.1 -Inf -> -1.1
+-- same with operands reversed
+mngx431 minmag 1.1 Inf -> 1.1
+mngx432 minmag 1 1.1 -> 1
+mngx433 minmag 1.0 1 -> 1.0
+mngx434 minmag 0.1 1.0 -> 0.1
+mngx435 minmag 0.10 0.1 -> 0.10
+mngx436 minmag 0.100 0.10 -> 0.100
+mngx437 minmag 0 0.10 -> 0
+mngx438 minmag 0.0 0 -> 0.0
+mngx439 minmag -0 0.0 -> -0
+mngx440 minmag -0.0 0.0 -> -0.0
+mngx441 minmag -0.0 0.00 -> -0.0
+mngx442 minmag -0.00 0.0 -> -0.00
+mngx443 minmag -0.0 0 -> -0.0
+mngx444 minmag -0 0 -> -0
+mngx445 minmag -0 -0.0 -> -0
+mngx446 minmag -0.100 -0 -> -0
+mngx447 minmag -0.10 -0.100 -> -0.10
+mngx448 minmag -0.1 -0.10 -> -0.1
+mngx449 minmag -1.0 -0.1 -> -0.1
+mngx450 minmag -1 -1.0 -> -1
+mngx451 minmag -1.1 -1 -> -1
+mngx453 minmag -Inf -1.1 -> -1.1
+-- largies
+mngx460 minmag 1000 1E+3 -> 1000
+mngx461 minmag 1E+3 1000 -> 1000
+mngx462 minmag 1000 -1E+3 -> -1E+3
+mngx463 minmag 1E+3 -1000 -> -1000
+mngx464 minmag -1000 1E+3 -> -1000
+mngx465 minmag -1E+3 1000 -> -1E+3
+mngx466 minmag -1000 -1E+3 -> -1E+3
+mngx467 minmag -1E+3 -1000 -> -1E+3
+
+-- rounding (results treated as though plus)
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+
+mngx470 minmag 1 5 -> 1
+mngx471 minmag 10 50 -> 10
+mngx472 minmag 100 500 -> 100
+mngx473 minmag 1000 5000 -> 1.00E+3 Rounded
+mngx474 minmag 10000 50000 -> 1.00E+4 Rounded
+mngx475 minmag 6 50 -> 6
+mngx476 minmag 66 500 -> 66
+mngx477 minmag 666 5000 -> 666
+mngx478 minmag 6666 50000 -> 6.67E+3 Rounded Inexact
+mngx479 minmag 66666 500000 -> 6.67E+4 Rounded Inexact
+mngx480 minmag 33333 500000 -> 3.33E+4 Rounded Inexact
+mngx481 minmag 75401 1 -> 1
+mngx482 minmag 75402 10 -> 10
+mngx483 minmag 75403 100 -> 100
+mngx484 minmag 75404 1000 -> 1.00E+3 Rounded
+mngx485 minmag 75405 10000 -> 1.00E+4 Rounded
+mngx486 minmag 75406 6 -> 6
+mngx487 minmag 75407 66 -> 66
+mngx488 minmag 75408 666 -> 666
+mngx489 minmag 75409 6666 -> 6.67E+3 Rounded Inexact
+mngx490 minmag 75410 66666 -> 6.67E+4 Rounded Inexact
+mngx491 minmag 75411 33333 -> 3.33E+4 Rounded Inexact
+
+
+-- overflow tests
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+mngx500 minmag 9.999E+999999999 0 -> 0
+mngx501 minmag -9.999E+999999999 0 -> 0
+
+-- subnormals and underflow
+precision: 3
+maxexponent: 999
+minexponent: -999
+mngx510 minmag 1.00E-999 0 -> 0
+mngx511 minmag 0.1E-999 0 -> 0
+mngx512 minmag 0.10E-999 0 -> 0
+mngx513 minmag 0.100E-999 0 -> 0
+mngx514 minmag 0.01E-999 0 -> 0
+mngx515 minmag 0.999E-999 0 -> 0
+mngx516 minmag 0.099E-999 0 -> 0
+mngx517 minmag 0.009E-999 0 -> 0
+mngx518 minmag 0.001E-999 0 -> 0
+mngx519 minmag 0.0009E-999 0 -> 0
+mngx520 minmag 0.0001E-999 0 -> 0
+
+mngx530 minmag -1.00E-999 0 -> 0
+mngx531 minmag -0.1E-999 0 -> 0
+mngx532 minmag -0.10E-999 0 -> 0
+mngx533 minmag -0.100E-999 0 -> 0
+mngx534 minmag -0.01E-999 0 -> 0
+mngx535 minmag -0.999E-999 0 -> 0
+mngx536 minmag -0.099E-999 0 -> 0
+mngx537 minmag -0.009E-999 0 -> 0
+mngx538 minmag -0.001E-999 0 -> 0
+mngx539 minmag -0.0009E-999 0 -> 0
+mngx540 minmag -0.0001E-999 0 -> 0
+
+
+-- Null tests
+mng900 minmag 10 # -> NaN Invalid_operation
+mng901 minmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/nextminus.decTest b/Lib/test/decimaltestdata/nextminus.decTest
index 531c5252a5..ba93066b96 100644
--- a/Lib/test/decimaltestdata/nextminus.decTest
+++ b/Lib/test/decimaltestdata/nextminus.decTest
@@ -1,148 +1,148 @@
-------------------------------------------------------------------------
--- nextminus.decTest -- decimal next that is less [754r nextdown] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
-nextm001 nextminus 0.999999995 -> 0.999999994
-nextm002 nextminus 0.999999996 -> 0.999999995
-nextm003 nextminus 0.999999997 -> 0.999999996
-nextm004 nextminus 0.999999998 -> 0.999999997
-nextm005 nextminus 0.999999999 -> 0.999999998
-nextm006 nextminus 1.00000000 -> 0.999999999
-nextm007 nextminus 1.0 -> 0.999999999
-nextm008 nextminus 1 -> 0.999999999
-nextm009 nextminus 1.00000001 -> 1.00000000
-nextm010 nextminus 1.00000002 -> 1.00000001
-nextm011 nextminus 1.00000003 -> 1.00000002
-nextm012 nextminus 1.00000004 -> 1.00000003
-nextm013 nextminus 1.00000005 -> 1.00000004
-nextm014 nextminus 1.00000006 -> 1.00000005
-nextm015 nextminus 1.00000007 -> 1.00000006
-nextm016 nextminus 1.00000008 -> 1.00000007
-nextm017 nextminus 1.00000009 -> 1.00000008
-nextm018 nextminus 1.00000010 -> 1.00000009
-nextm019 nextminus 1.00000011 -> 1.00000010
-nextm020 nextminus 1.00000012 -> 1.00000011
-
-nextm021 nextminus -0.999999995 -> -0.999999996
-nextm022 nextminus -0.999999996 -> -0.999999997
-nextm023 nextminus -0.999999997 -> -0.999999998
-nextm024 nextminus -0.999999998 -> -0.999999999
-nextm025 nextminus -0.999999999 -> -1.00000000
-nextm026 nextminus -1.00000000 -> -1.00000001
-nextm027 nextminus -1.0 -> -1.00000001
-nextm028 nextminus -1 -> -1.00000001
-nextm029 nextminus -1.00000001 -> -1.00000002
-nextm030 nextminus -1.00000002 -> -1.00000003
-nextm031 nextminus -1.00000003 -> -1.00000004
-nextm032 nextminus -1.00000004 -> -1.00000005
-nextm033 nextminus -1.00000005 -> -1.00000006
-nextm034 nextminus -1.00000006 -> -1.00000007
-nextm035 nextminus -1.00000007 -> -1.00000008
-nextm036 nextminus -1.00000008 -> -1.00000009
-nextm037 nextminus -1.00000009 -> -1.00000010
-nextm038 nextminus -1.00000010 -> -1.00000011
-nextm039 nextminus -1.00000011 -> -1.00000012
-
--- input operand is >precision
-nextm041 nextminus 1.00000010998 -> 1.00000010
-nextm042 nextminus 1.00000010999 -> 1.00000010
-nextm043 nextminus 1.00000011000 -> 1.00000010
-nextm044 nextminus 1.00000011001 -> 1.00000011
-nextm045 nextminus 1.00000011002 -> 1.00000011
-nextm046 nextminus 1.00000011002 -> 1.00000011
-nextm047 nextminus 1.00000011052 -> 1.00000011
-nextm048 nextminus 1.00000011552 -> 1.00000011
-nextm049 nextminus -1.00000010998 -> -1.00000011
-nextm050 nextminus -1.00000010999 -> -1.00000011
-nextm051 nextminus -1.00000011000 -> -1.00000012
-nextm052 nextminus -1.00000011001 -> -1.00000012
-nextm053 nextminus -1.00000011002 -> -1.00000012
-nextm054 nextminus -1.00000011002 -> -1.00000012
-nextm055 nextminus -1.00000011052 -> -1.00000012
-nextm056 nextminus -1.00000011552 -> -1.00000012
--- ultra-tiny inputs
-nextm060 nextminus 1E-99999 -> 0E-391
-nextm061 nextminus 1E-999999999 -> 0E-391
-nextm062 nextminus 1E-391 -> 0E-391
-nextm063 nextminus -1E-99999 -> -1E-391
-nextm064 nextminus -1E-999999999 -> -1E-391
-nextm065 nextminus -1E-391 -> -2E-391
-
--- Zeros
-nextm100 nextminus -0 -> -1E-391
-nextm101 nextminus 0 -> -1E-391
-nextm102 nextminus 0.00 -> -1E-391
-nextm103 nextminus -0.00 -> -1E-391
-nextm104 nextminus 0E-300 -> -1E-391
-nextm105 nextminus 0E+300 -> -1E-391
-nextm106 nextminus 0E+30000 -> -1E-391
-nextm107 nextminus -0E+30000 -> -1E-391
-
-precision: 9
-maxExponent: 999
-minexponent: -999
--- specials
-nextm150 nextminus Inf -> 9.99999999E+999
-nextm151 nextminus -Inf -> -Infinity
-nextm152 nextminus NaN -> NaN
-nextm153 nextminus sNaN -> NaN Invalid_operation
-nextm154 nextminus NaN77 -> NaN77
-nextm155 nextminus sNaN88 -> NaN88 Invalid_operation
-nextm156 nextminus -NaN -> -NaN
-nextm157 nextminus -sNaN -> -NaN Invalid_operation
-nextm158 nextminus -NaN77 -> -NaN77
-nextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-nextm170 nextminus 9.99999999E+999 -> 9.99999998E+999
-nextm171 nextminus 9.99999998E+999 -> 9.99999997E+999
-nextm172 nextminus 1E-999 -> 9.9999999E-1000
-nextm173 nextminus 1.00000000E-999 -> 9.9999999E-1000
-nextm174 nextminus 9E-1007 -> 8E-1007
-nextm175 nextminus 9.9E-1006 -> 9.8E-1006
-nextm176 nextminus 9.9999E-1003 -> 9.9998E-1003
-nextm177 nextminus 9.9999999E-1000 -> 9.9999998E-1000
-nextm178 nextminus 9.9999998E-1000 -> 9.9999997E-1000
-nextm179 nextminus 9.9999997E-1000 -> 9.9999996E-1000
-nextm180 nextminus 0E-1007 -> -1E-1007
-nextm181 nextminus 1E-1007 -> 0E-1007
-nextm182 nextminus 2E-1007 -> 1E-1007
-
-nextm183 nextminus -0E-1007 -> -1E-1007
-nextm184 nextminus -1E-1007 -> -2E-1007
-nextm185 nextminus -2E-1007 -> -3E-1007
-nextm186 nextminus -10E-1007 -> -1.1E-1006
-nextm187 nextminus -100E-1007 -> -1.01E-1005
-nextm188 nextminus -100000E-1007 -> -1.00001E-1002
-nextm189 nextminus -1.0000E-999 -> -1.00000001E-999
-nextm190 nextminus -1.00000000E-999 -> -1.00000001E-999
-nextm191 nextminus -1E-999 -> -1.00000001E-999
-nextm192 nextminus -9.99999998E+999 -> -9.99999999E+999
-nextm193 nextminus -9.99999999E+999 -> -Infinity
-
--- Null tests
-nextm900 nextminus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- nextminus.decTest -- decimal next that is less [754r nextdown] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+nextm001 nextminus 0.999999995 -> 0.999999994
+nextm002 nextminus 0.999999996 -> 0.999999995
+nextm003 nextminus 0.999999997 -> 0.999999996
+nextm004 nextminus 0.999999998 -> 0.999999997
+nextm005 nextminus 0.999999999 -> 0.999999998
+nextm006 nextminus 1.00000000 -> 0.999999999
+nextm007 nextminus 1.0 -> 0.999999999
+nextm008 nextminus 1 -> 0.999999999
+nextm009 nextminus 1.00000001 -> 1.00000000
+nextm010 nextminus 1.00000002 -> 1.00000001
+nextm011 nextminus 1.00000003 -> 1.00000002
+nextm012 nextminus 1.00000004 -> 1.00000003
+nextm013 nextminus 1.00000005 -> 1.00000004
+nextm014 nextminus 1.00000006 -> 1.00000005
+nextm015 nextminus 1.00000007 -> 1.00000006
+nextm016 nextminus 1.00000008 -> 1.00000007
+nextm017 nextminus 1.00000009 -> 1.00000008
+nextm018 nextminus 1.00000010 -> 1.00000009
+nextm019 nextminus 1.00000011 -> 1.00000010
+nextm020 nextminus 1.00000012 -> 1.00000011
+
+nextm021 nextminus -0.999999995 -> -0.999999996
+nextm022 nextminus -0.999999996 -> -0.999999997
+nextm023 nextminus -0.999999997 -> -0.999999998
+nextm024 nextminus -0.999999998 -> -0.999999999
+nextm025 nextminus -0.999999999 -> -1.00000000
+nextm026 nextminus -1.00000000 -> -1.00000001
+nextm027 nextminus -1.0 -> -1.00000001
+nextm028 nextminus -1 -> -1.00000001
+nextm029 nextminus -1.00000001 -> -1.00000002
+nextm030 nextminus -1.00000002 -> -1.00000003
+nextm031 nextminus -1.00000003 -> -1.00000004
+nextm032 nextminus -1.00000004 -> -1.00000005
+nextm033 nextminus -1.00000005 -> -1.00000006
+nextm034 nextminus -1.00000006 -> -1.00000007
+nextm035 nextminus -1.00000007 -> -1.00000008
+nextm036 nextminus -1.00000008 -> -1.00000009
+nextm037 nextminus -1.00000009 -> -1.00000010
+nextm038 nextminus -1.00000010 -> -1.00000011
+nextm039 nextminus -1.00000011 -> -1.00000012
+
+-- input operand is >precision
+nextm041 nextminus 1.00000010998 -> 1.00000010
+nextm042 nextminus 1.00000010999 -> 1.00000010
+nextm043 nextminus 1.00000011000 -> 1.00000010
+nextm044 nextminus 1.00000011001 -> 1.00000011
+nextm045 nextminus 1.00000011002 -> 1.00000011
+nextm046 nextminus 1.00000011002 -> 1.00000011
+nextm047 nextminus 1.00000011052 -> 1.00000011
+nextm048 nextminus 1.00000011552 -> 1.00000011
+nextm049 nextminus -1.00000010998 -> -1.00000011
+nextm050 nextminus -1.00000010999 -> -1.00000011
+nextm051 nextminus -1.00000011000 -> -1.00000012
+nextm052 nextminus -1.00000011001 -> -1.00000012
+nextm053 nextminus -1.00000011002 -> -1.00000012
+nextm054 nextminus -1.00000011002 -> -1.00000012
+nextm055 nextminus -1.00000011052 -> -1.00000012
+nextm056 nextminus -1.00000011552 -> -1.00000012
+-- ultra-tiny inputs
+nextm060 nextminus 1E-99999 -> 0E-391
+nextm061 nextminus 1E-999999999 -> 0E-391
+nextm062 nextminus 1E-391 -> 0E-391
+nextm063 nextminus -1E-99999 -> -1E-391
+nextm064 nextminus -1E-999999999 -> -1E-391
+nextm065 nextminus -1E-391 -> -2E-391
+
+-- Zeros
+nextm100 nextminus -0 -> -1E-391
+nextm101 nextminus 0 -> -1E-391
+nextm102 nextminus 0.00 -> -1E-391
+nextm103 nextminus -0.00 -> -1E-391
+nextm104 nextminus 0E-300 -> -1E-391
+nextm105 nextminus 0E+300 -> -1E-391
+nextm106 nextminus 0E+30000 -> -1E-391
+nextm107 nextminus -0E+30000 -> -1E-391
+
+precision: 9
+maxExponent: 999
+minexponent: -999
+-- specials
+nextm150 nextminus Inf -> 9.99999999E+999
+nextm151 nextminus -Inf -> -Infinity
+nextm152 nextminus NaN -> NaN
+nextm153 nextminus sNaN -> NaN Invalid_operation
+nextm154 nextminus NaN77 -> NaN77
+nextm155 nextminus sNaN88 -> NaN88 Invalid_operation
+nextm156 nextminus -NaN -> -NaN
+nextm157 nextminus -sNaN -> -NaN Invalid_operation
+nextm158 nextminus -NaN77 -> -NaN77
+nextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+nextm170 nextminus 9.99999999E+999 -> 9.99999998E+999
+nextm171 nextminus 9.99999998E+999 -> 9.99999997E+999
+nextm172 nextminus 1E-999 -> 9.9999999E-1000
+nextm173 nextminus 1.00000000E-999 -> 9.9999999E-1000
+nextm174 nextminus 9E-1007 -> 8E-1007
+nextm175 nextminus 9.9E-1006 -> 9.8E-1006
+nextm176 nextminus 9.9999E-1003 -> 9.9998E-1003
+nextm177 nextminus 9.9999999E-1000 -> 9.9999998E-1000
+nextm178 nextminus 9.9999998E-1000 -> 9.9999997E-1000
+nextm179 nextminus 9.9999997E-1000 -> 9.9999996E-1000
+nextm180 nextminus 0E-1007 -> -1E-1007
+nextm181 nextminus 1E-1007 -> 0E-1007
+nextm182 nextminus 2E-1007 -> 1E-1007
+
+nextm183 nextminus -0E-1007 -> -1E-1007
+nextm184 nextminus -1E-1007 -> -2E-1007
+nextm185 nextminus -2E-1007 -> -3E-1007
+nextm186 nextminus -10E-1007 -> -1.1E-1006
+nextm187 nextminus -100E-1007 -> -1.01E-1005
+nextm188 nextminus -100000E-1007 -> -1.00001E-1002
+nextm189 nextminus -1.0000E-999 -> -1.00000001E-999
+nextm190 nextminus -1.00000000E-999 -> -1.00000001E-999
+nextm191 nextminus -1E-999 -> -1.00000001E-999
+nextm192 nextminus -9.99999998E+999 -> -9.99999999E+999
+nextm193 nextminus -9.99999999E+999 -> -Infinity
+
+-- Null tests
+nextm900 nextminus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/nextplus.decTest b/Lib/test/decimaltestdata/nextplus.decTest
index c66e328727..44989e50b1 100644
--- a/Lib/test/decimaltestdata/nextplus.decTest
+++ b/Lib/test/decimaltestdata/nextplus.decTest
@@ -1,150 +1,150 @@
-------------------------------------------------------------------------
--- nextplus.decTest -- decimal next that is greater [754r nextup] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
-nextp001 nextplus 0.999999995 -> 0.999999996
-nextp002 nextplus 0.999999996 -> 0.999999997
-nextp003 nextplus 0.999999997 -> 0.999999998
-nextp004 nextplus 0.999999998 -> 0.999999999
-nextp005 nextplus 0.999999999 -> 1.00000000
-nextp006 nextplus 1.00000000 -> 1.00000001
-nextp007 nextplus 1.0 -> 1.00000001
-nextp008 nextplus 1 -> 1.00000001
-nextp009 nextplus 1.00000001 -> 1.00000002
-nextp010 nextplus 1.00000002 -> 1.00000003
-nextp011 nextplus 1.00000003 -> 1.00000004
-nextp012 nextplus 1.00000004 -> 1.00000005
-nextp013 nextplus 1.00000005 -> 1.00000006
-nextp014 nextplus 1.00000006 -> 1.00000007
-nextp015 nextplus 1.00000007 -> 1.00000008
-nextp016 nextplus 1.00000008 -> 1.00000009
-nextp017 nextplus 1.00000009 -> 1.00000010
-nextp018 nextplus 1.00000010 -> 1.00000011
-nextp019 nextplus 1.00000011 -> 1.00000012
-
-nextp021 nextplus -0.999999995 -> -0.999999994
-nextp022 nextplus -0.999999996 -> -0.999999995
-nextp023 nextplus -0.999999997 -> -0.999999996
-nextp024 nextplus -0.999999998 -> -0.999999997
-nextp025 nextplus -0.999999999 -> -0.999999998
-nextp026 nextplus -1.00000000 -> -0.999999999
-nextp027 nextplus -1.0 -> -0.999999999
-nextp028 nextplus -1 -> -0.999999999
-nextp029 nextplus -1.00000001 -> -1.00000000
-nextp030 nextplus -1.00000002 -> -1.00000001
-nextp031 nextplus -1.00000003 -> -1.00000002
-nextp032 nextplus -1.00000004 -> -1.00000003
-nextp033 nextplus -1.00000005 -> -1.00000004
-nextp034 nextplus -1.00000006 -> -1.00000005
-nextp035 nextplus -1.00000007 -> -1.00000006
-nextp036 nextplus -1.00000008 -> -1.00000007
-nextp037 nextplus -1.00000009 -> -1.00000008
-nextp038 nextplus -1.00000010 -> -1.00000009
-nextp039 nextplus -1.00000011 -> -1.00000010
-nextp040 nextplus -1.00000012 -> -1.00000011
-
--- input operand is >precision
-nextp041 nextplus 1.00000010998 -> 1.00000011
-nextp042 nextplus 1.00000010999 -> 1.00000011
-nextp043 nextplus 1.00000011000 -> 1.00000012
-nextp044 nextplus 1.00000011001 -> 1.00000012
-nextp045 nextplus 1.00000011002 -> 1.00000012
-nextp046 nextplus 1.00000011002 -> 1.00000012
-nextp047 nextplus 1.00000011052 -> 1.00000012
-nextp048 nextplus 1.00000011552 -> 1.00000012
-nextp049 nextplus -1.00000010998 -> -1.00000010
-nextp050 nextplus -1.00000010999 -> -1.00000010
-nextp051 nextplus -1.00000011000 -> -1.00000010
-nextp052 nextplus -1.00000011001 -> -1.00000011
-nextp053 nextplus -1.00000011002 -> -1.00000011
-nextp054 nextplus -1.00000011002 -> -1.00000011
-nextp055 nextplus -1.00000011052 -> -1.00000011
-nextp056 nextplus -1.00000011552 -> -1.00000011
--- ultra-tiny inputs
-nextp060 nextplus 1E-99999 -> 1E-391
-nextp061 nextplus 1E-999999999 -> 1E-391
-nextp062 nextplus 1E-391 -> 2E-391
-nextp063 nextplus -1E-99999 -> -0E-391
-nextp064 nextplus -1E-999999999 -> -0E-391
-nextp065 nextplus -1E-391 -> -0E-391
-
--- Zeros
-nextp100 nextplus 0 -> 1E-391
-nextp101 nextplus 0.00 -> 1E-391
-nextp102 nextplus 0E-300 -> 1E-391
-nextp103 nextplus 0E+300 -> 1E-391
-nextp104 nextplus 0E+30000 -> 1E-391
-nextp105 nextplus -0 -> 1E-391
-nextp106 nextplus -0.00 -> 1E-391
-nextp107 nextplus -0E-300 -> 1E-391
-nextp108 nextplus -0E+300 -> 1E-391
-nextp109 nextplus -0E+30000 -> 1E-391
-
-maxExponent: 999
-minexponent: -999
-precision: 9
--- specials
-nextp150 nextplus Inf -> Infinity
-nextp151 nextplus -Inf -> -9.99999999E+999
-nextp152 nextplus NaN -> NaN
-nextp153 nextplus sNaN -> NaN Invalid_operation
-nextp154 nextplus NaN77 -> NaN77
-nextp155 nextplus sNaN88 -> NaN88 Invalid_operation
-nextp156 nextplus -NaN -> -NaN
-nextp157 nextplus -sNaN -> -NaN Invalid_operation
-nextp158 nextplus -NaN77 -> -NaN77
-nextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-nextp170 nextplus 9.99999999E+999 -> Infinity
-nextp171 nextplus 9.99999998E+999 -> 9.99999999E+999
-nextp172 nextplus 1E-999 -> 1.00000001E-999
-nextp173 nextplus 1.00000000E-999 -> 1.00000001E-999
-nextp174 nextplus 9E-1007 -> 1.0E-1006
-nextp175 nextplus 9.9E-1006 -> 1.00E-1005
-nextp176 nextplus 9.9999E-1003 -> 1.00000E-1002
-nextp177 nextplus 9.9999999E-1000 -> 1.00000000E-999
-nextp178 nextplus 9.9999998E-1000 -> 9.9999999E-1000
-nextp179 nextplus 9.9999997E-1000 -> 9.9999998E-1000
-nextp180 nextplus 0E-1007 -> 1E-1007
-nextp181 nextplus 1E-1007 -> 2E-1007
-nextp182 nextplus 2E-1007 -> 3E-1007
-
-nextp183 nextplus -0E-1007 -> 1E-1007
-nextp184 nextplus -1E-1007 -> -0E-1007
-nextp185 nextplus -2E-1007 -> -1E-1007
-nextp186 nextplus -10E-1007 -> -9E-1007
-nextp187 nextplus -100E-1007 -> -9.9E-1006
-nextp188 nextplus -100000E-1007 -> -9.9999E-1003
-nextp189 nextplus -1.0000E-999 -> -9.9999999E-1000
-nextp190 nextplus -1.00000000E-999 -> -9.9999999E-1000
-nextp191 nextplus -1E-999 -> -9.9999999E-1000
-nextp192 nextplus -9.99999998E+999 -> -9.99999997E+999
-nextp193 nextplus -9.99999999E+999 -> -9.99999998E+999
-
--- Null tests
-nextp900 nextplus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- nextplus.decTest -- decimal next that is greater [754r nextup] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+nextp001 nextplus 0.999999995 -> 0.999999996
+nextp002 nextplus 0.999999996 -> 0.999999997
+nextp003 nextplus 0.999999997 -> 0.999999998
+nextp004 nextplus 0.999999998 -> 0.999999999
+nextp005 nextplus 0.999999999 -> 1.00000000
+nextp006 nextplus 1.00000000 -> 1.00000001
+nextp007 nextplus 1.0 -> 1.00000001
+nextp008 nextplus 1 -> 1.00000001
+nextp009 nextplus 1.00000001 -> 1.00000002
+nextp010 nextplus 1.00000002 -> 1.00000003
+nextp011 nextplus 1.00000003 -> 1.00000004
+nextp012 nextplus 1.00000004 -> 1.00000005
+nextp013 nextplus 1.00000005 -> 1.00000006
+nextp014 nextplus 1.00000006 -> 1.00000007
+nextp015 nextplus 1.00000007 -> 1.00000008
+nextp016 nextplus 1.00000008 -> 1.00000009
+nextp017 nextplus 1.00000009 -> 1.00000010
+nextp018 nextplus 1.00000010 -> 1.00000011
+nextp019 nextplus 1.00000011 -> 1.00000012
+
+nextp021 nextplus -0.999999995 -> -0.999999994
+nextp022 nextplus -0.999999996 -> -0.999999995
+nextp023 nextplus -0.999999997 -> -0.999999996
+nextp024 nextplus -0.999999998 -> -0.999999997
+nextp025 nextplus -0.999999999 -> -0.999999998
+nextp026 nextplus -1.00000000 -> -0.999999999
+nextp027 nextplus -1.0 -> -0.999999999
+nextp028 nextplus -1 -> -0.999999999
+nextp029 nextplus -1.00000001 -> -1.00000000
+nextp030 nextplus -1.00000002 -> -1.00000001
+nextp031 nextplus -1.00000003 -> -1.00000002
+nextp032 nextplus -1.00000004 -> -1.00000003
+nextp033 nextplus -1.00000005 -> -1.00000004
+nextp034 nextplus -1.00000006 -> -1.00000005
+nextp035 nextplus -1.00000007 -> -1.00000006
+nextp036 nextplus -1.00000008 -> -1.00000007
+nextp037 nextplus -1.00000009 -> -1.00000008
+nextp038 nextplus -1.00000010 -> -1.00000009
+nextp039 nextplus -1.00000011 -> -1.00000010
+nextp040 nextplus -1.00000012 -> -1.00000011
+
+-- input operand is >precision
+nextp041 nextplus 1.00000010998 -> 1.00000011
+nextp042 nextplus 1.00000010999 -> 1.00000011
+nextp043 nextplus 1.00000011000 -> 1.00000012
+nextp044 nextplus 1.00000011001 -> 1.00000012
+nextp045 nextplus 1.00000011002 -> 1.00000012
+nextp046 nextplus 1.00000011002 -> 1.00000012
+nextp047 nextplus 1.00000011052 -> 1.00000012
+nextp048 nextplus 1.00000011552 -> 1.00000012
+nextp049 nextplus -1.00000010998 -> -1.00000010
+nextp050 nextplus -1.00000010999 -> -1.00000010
+nextp051 nextplus -1.00000011000 -> -1.00000010
+nextp052 nextplus -1.00000011001 -> -1.00000011
+nextp053 nextplus -1.00000011002 -> -1.00000011
+nextp054 nextplus -1.00000011002 -> -1.00000011
+nextp055 nextplus -1.00000011052 -> -1.00000011
+nextp056 nextplus -1.00000011552 -> -1.00000011
+-- ultra-tiny inputs
+nextp060 nextplus 1E-99999 -> 1E-391
+nextp061 nextplus 1E-999999999 -> 1E-391
+nextp062 nextplus 1E-391 -> 2E-391
+nextp063 nextplus -1E-99999 -> -0E-391
+nextp064 nextplus -1E-999999999 -> -0E-391
+nextp065 nextplus -1E-391 -> -0E-391
+
+-- Zeros
+nextp100 nextplus 0 -> 1E-391
+nextp101 nextplus 0.00 -> 1E-391
+nextp102 nextplus 0E-300 -> 1E-391
+nextp103 nextplus 0E+300 -> 1E-391
+nextp104 nextplus 0E+30000 -> 1E-391
+nextp105 nextplus -0 -> 1E-391
+nextp106 nextplus -0.00 -> 1E-391
+nextp107 nextplus -0E-300 -> 1E-391
+nextp108 nextplus -0E+300 -> 1E-391
+nextp109 nextplus -0E+30000 -> 1E-391
+
+maxExponent: 999
+minexponent: -999
+precision: 9
+-- specials
+nextp150 nextplus Inf -> Infinity
+nextp151 nextplus -Inf -> -9.99999999E+999
+nextp152 nextplus NaN -> NaN
+nextp153 nextplus sNaN -> NaN Invalid_operation
+nextp154 nextplus NaN77 -> NaN77
+nextp155 nextplus sNaN88 -> NaN88 Invalid_operation
+nextp156 nextplus -NaN -> -NaN
+nextp157 nextplus -sNaN -> -NaN Invalid_operation
+nextp158 nextplus -NaN77 -> -NaN77
+nextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+nextp170 nextplus 9.99999999E+999 -> Infinity
+nextp171 nextplus 9.99999998E+999 -> 9.99999999E+999
+nextp172 nextplus 1E-999 -> 1.00000001E-999
+nextp173 nextplus 1.00000000E-999 -> 1.00000001E-999
+nextp174 nextplus 9E-1007 -> 1.0E-1006
+nextp175 nextplus 9.9E-1006 -> 1.00E-1005
+nextp176 nextplus 9.9999E-1003 -> 1.00000E-1002
+nextp177 nextplus 9.9999999E-1000 -> 1.00000000E-999
+nextp178 nextplus 9.9999998E-1000 -> 9.9999999E-1000
+nextp179 nextplus 9.9999997E-1000 -> 9.9999998E-1000
+nextp180 nextplus 0E-1007 -> 1E-1007
+nextp181 nextplus 1E-1007 -> 2E-1007
+nextp182 nextplus 2E-1007 -> 3E-1007
+
+nextp183 nextplus -0E-1007 -> 1E-1007
+nextp184 nextplus -1E-1007 -> -0E-1007
+nextp185 nextplus -2E-1007 -> -1E-1007
+nextp186 nextplus -10E-1007 -> -9E-1007
+nextp187 nextplus -100E-1007 -> -9.9E-1006
+nextp188 nextplus -100000E-1007 -> -9.9999E-1003
+nextp189 nextplus -1.0000E-999 -> -9.9999999E-1000
+nextp190 nextplus -1.00000000E-999 -> -9.9999999E-1000
+nextp191 nextplus -1E-999 -> -9.9999999E-1000
+nextp192 nextplus -9.99999998E+999 -> -9.99999997E+999
+nextp193 nextplus -9.99999999E+999 -> -9.99999998E+999
+
+-- Null tests
+nextp900 nextplus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/nexttoward.decTest b/Lib/test/decimaltestdata/nexttoward.decTest
index 562385a00f..da26f651c8 100644
--- a/Lib/test/decimaltestdata/nexttoward.decTest
+++ b/Lib/test/decimaltestdata/nexttoward.decTest
@@ -1,426 +1,426 @@
-------------------------------------------------------------------------
--- nexttoward.decTest -- decimal next toward rhs [754r nextafter] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- Sanity check with a scattering of numerics
-nextt001 nexttoward 10 10 -> 10
-nextt002 nexttoward -10 -10 -> -10
-nextt003 nexttoward 1 10 -> 1.00000001
-nextt004 nexttoward 1 -10 -> 0.999999999
-nextt005 nexttoward -1 10 -> -0.999999999
-nextt006 nexttoward -1 -10 -> -1.00000001
-nextt007 nexttoward 0 10 -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt008 nexttoward 0 -10 -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt009 nexttoward 9.99999999E+384 +Infinity -> Infinity Overflow Inexact Rounded
-nextt010 nexttoward -9.99999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
-
-------- lhs=rhs
--- finites
-nextt101 nexttoward 7 7 -> 7
-nextt102 nexttoward -7 -7 -> -7
-nextt103 nexttoward 75 75 -> 75
-nextt104 nexttoward -75 -75 -> -75
-nextt105 nexttoward 7.50 7.5 -> 7.50
-nextt106 nexttoward -7.50 -7.50 -> -7.50
-nextt107 nexttoward 7.500 7.5000 -> 7.500
-nextt108 nexttoward -7.500 -7.5 -> -7.500
-
--- zeros
-nextt111 nexttoward 0 0 -> 0
-nextt112 nexttoward -0 -0 -> -0
-nextt113 nexttoward 0E+4 0 -> 0E+4
-nextt114 nexttoward -0E+4 -0 -> -0E+4
-nextt115 nexttoward 0.0000 0.00000 -> 0.0000
-nextt116 nexttoward -0.0000 -0.00 -> -0.0000
-nextt117 nexttoward 0E-141 0 -> 0E-141
-nextt118 nexttoward -0E-141 -000 -> -0E-141
-
--- full coefficients, alternating bits
-nextt121 nexttoward 268268268 268268268 -> 268268268
-nextt122 nexttoward -268268268 -268268268 -> -268268268
-nextt123 nexttoward 134134134 134134134 -> 134134134
-nextt124 nexttoward -134134134 -134134134 -> -134134134
-
--- Nmax, Nmin, Ntiny
-nextt131 nexttoward 9.99999999E+384 9.99999999E+384 -> 9.99999999E+384
-nextt132 nexttoward 1E-383 1E-383 -> 1E-383
-nextt133 nexttoward 1.00000000E-383 1.00000000E-383 -> 1.00000000E-383
-nextt134 nexttoward 1E-391 1E-391 -> 1E-391
-
-nextt135 nexttoward -1E-391 -1E-391 -> -1E-391
-nextt136 nexttoward -1.00000000E-383 -1.00000000E-383 -> -1.00000000E-383
-nextt137 nexttoward -1E-383 -1E-383 -> -1E-383
-nextt138 nexttoward -9.99999999E+384 -9.99999999E+384 -> -9.99999999E+384
-
-------- lhs<rhs
-nextt201 nexttoward 0.999999995 Infinity -> 0.999999996
-nextt202 nexttoward 0.999999996 Infinity -> 0.999999997
-nextt203 nexttoward 0.999999997 Infinity -> 0.999999998
-nextt204 nexttoward 0.999999998 Infinity -> 0.999999999
-nextt205 nexttoward 0.999999999 Infinity -> 1.00000000
-nextt206 nexttoward 1.00000000 Infinity -> 1.00000001
-nextt207 nexttoward 1.0 Infinity -> 1.00000001
-nextt208 nexttoward 1 Infinity -> 1.00000001
-nextt209 nexttoward 1.00000001 Infinity -> 1.00000002
-nextt210 nexttoward 1.00000002 Infinity -> 1.00000003
-nextt211 nexttoward 1.00000003 Infinity -> 1.00000004
-nextt212 nexttoward 1.00000004 Infinity -> 1.00000005
-nextt213 nexttoward 1.00000005 Infinity -> 1.00000006
-nextt214 nexttoward 1.00000006 Infinity -> 1.00000007
-nextt215 nexttoward 1.00000007 Infinity -> 1.00000008
-nextt216 nexttoward 1.00000008 Infinity -> 1.00000009
-nextt217 nexttoward 1.00000009 Infinity -> 1.00000010
-nextt218 nexttoward 1.00000010 Infinity -> 1.00000011
-nextt219 nexttoward 1.00000011 Infinity -> 1.00000012
-
-nextt221 nexttoward -0.999999995 Infinity -> -0.999999994
-nextt222 nexttoward -0.999999996 Infinity -> -0.999999995
-nextt223 nexttoward -0.999999997 Infinity -> -0.999999996
-nextt224 nexttoward -0.999999998 Infinity -> -0.999999997
-nextt225 nexttoward -0.999999999 Infinity -> -0.999999998
-nextt226 nexttoward -1.00000000 Infinity -> -0.999999999
-nextt227 nexttoward -1.0 Infinity -> -0.999999999
-nextt228 nexttoward -1 Infinity -> -0.999999999
-nextt229 nexttoward -1.00000001 Infinity -> -1.00000000
-nextt230 nexttoward -1.00000002 Infinity -> -1.00000001
-nextt231 nexttoward -1.00000003 Infinity -> -1.00000002
-nextt232 nexttoward -1.00000004 Infinity -> -1.00000003
-nextt233 nexttoward -1.00000005 Infinity -> -1.00000004
-nextt234 nexttoward -1.00000006 Infinity -> -1.00000005
-nextt235 nexttoward -1.00000007 Infinity -> -1.00000006
-nextt236 nexttoward -1.00000008 Infinity -> -1.00000007
-nextt237 nexttoward -1.00000009 Infinity -> -1.00000008
-nextt238 nexttoward -1.00000010 Infinity -> -1.00000009
-nextt239 nexttoward -1.00000011 Infinity -> -1.00000010
-nextt240 nexttoward -1.00000012 Infinity -> -1.00000011
-
--- input operand is >precision
-nextt241 nexttoward 1.00000010998 Infinity -> 1.00000011
-nextt242 nexttoward 1.00000010999 Infinity -> 1.00000011
-nextt243 nexttoward 1.00000011000 Infinity -> 1.00000012
-nextt244 nexttoward 1.00000011001 Infinity -> 1.00000012
-nextt245 nexttoward 1.00000011002 Infinity -> 1.00000012
-nextt246 nexttoward 1.00000011002 Infinity -> 1.00000012
-nextt247 nexttoward 1.00000011052 Infinity -> 1.00000012
-nextt248 nexttoward 1.00000011552 Infinity -> 1.00000012
-nextt249 nexttoward -1.00000010998 Infinity -> -1.00000010
-nextt250 nexttoward -1.00000010999 Infinity -> -1.00000010
-nextt251 nexttoward -1.00000011000 Infinity -> -1.00000010
-nextt252 nexttoward -1.00000011001 Infinity -> -1.00000011
-nextt253 nexttoward -1.00000011002 Infinity -> -1.00000011
-nextt254 nexttoward -1.00000011002 Infinity -> -1.00000011
-nextt255 nexttoward -1.00000011052 Infinity -> -1.00000011
-nextt256 nexttoward -1.00000011552 Infinity -> -1.00000011
--- ultra-tiny inputs
-nextt260 nexttoward 1E-99999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt261 nexttoward 1E-999999999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt262 nexttoward 1E-391 Infinity -> 2E-391 Underflow Subnormal Inexact Rounded
-nextt263 nexttoward -1E-99999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt264 nexttoward -1E-999999999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt265 nexttoward -1E-391 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
-
--- Zeros
-nextt300 nexttoward 0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt301 nexttoward 0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt302 nexttoward 0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt303 nexttoward 0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt304 nexttoward 0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt305 nexttoward -0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt306 nexttoward -0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt307 nexttoward -0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt308 nexttoward -0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt309 nexttoward -0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-
--- specials
-nextt350 nexttoward Inf Infinity -> Infinity
-nextt351 nexttoward -Inf Infinity -> -9.99999999E+384
-nextt352 nexttoward NaN Infinity -> NaN
-nextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
-nextt354 nexttoward NaN77 Infinity -> NaN77
-nextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
-nextt356 nexttoward -NaN Infinity -> -NaN
-nextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
-nextt358 nexttoward -NaN77 Infinity -> -NaN77
-nextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-maxExponent: 999
-minexponent: -999
-nextt370 nexttoward 9.99999999E+999 Infinity -> Infinity Overflow Inexact Rounded
-nextt371 nexttoward 9.99999998E+999 Infinity -> 9.99999999E+999
-nextt372 nexttoward 1E-999 Infinity -> 1.00000001E-999
-nextt373 nexttoward 1.00000000E-999 Infinity -> 1.00000001E-999
-nextt374 nexttoward 0.999999999E-999 Infinity -> 1.00000000E-999
-nextt375 nexttoward 0.99999999E-999 Infinity -> 1.00000000E-999
-nextt376 nexttoward 9E-1007 Infinity -> 1.0E-1006 Underflow Subnormal Inexact Rounded
-nextt377 nexttoward 9.9E-1006 Infinity -> 1.00E-1005 Underflow Subnormal Inexact Rounded
-nextt378 nexttoward 9.9999E-1003 Infinity -> 1.00000E-1002 Underflow Subnormal Inexact Rounded
-nextt379 nexttoward 9.9999998E-1000 Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt380 nexttoward 9.9999997E-1000 Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
-nextt381 nexttoward 0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
-nextt382 nexttoward 1E-1007 Infinity -> 2E-1007 Underflow Subnormal Inexact Rounded
-nextt383 nexttoward 2E-1007 Infinity -> 3E-1007 Underflow Subnormal Inexact Rounded
-
-nextt385 nexttoward -0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
-nextt386 nexttoward -1E-1007 Infinity -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped
-nextt387 nexttoward -2E-1007 Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
-nextt388 nexttoward -10E-1007 Infinity -> -9E-1007 Underflow Subnormal Inexact Rounded
-nextt389 nexttoward -100E-1007 Infinity -> -9.9E-1006 Underflow Subnormal Inexact Rounded
-nextt390 nexttoward -100000E-1007 Infinity -> -9.9999E-1003 Underflow Subnormal Inexact Rounded
-nextt391 nexttoward -1.0000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt392 nexttoward -1.00000000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt393 nexttoward -1E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt394 nexttoward -9.99999998E+999 Infinity -> -9.99999997E+999
-nextt395 nexttoward -9.99999999E+999 Infinity -> -9.99999998E+999
-
-------- lhs>rhs
-maxExponent: 384
-minexponent: -383
-nextt401 nexttoward 0.999999995 -Infinity -> 0.999999994
-nextt402 nexttoward 0.999999996 -Infinity -> 0.999999995
-nextt403 nexttoward 0.999999997 -Infinity -> 0.999999996
-nextt404 nexttoward 0.999999998 -Infinity -> 0.999999997
-nextt405 nexttoward 0.999999999 -Infinity -> 0.999999998
-nextt406 nexttoward 1.00000000 -Infinity -> 0.999999999
-nextt407 nexttoward 1.0 -Infinity -> 0.999999999
-nextt408 nexttoward 1 -Infinity -> 0.999999999
-nextt409 nexttoward 1.00000001 -Infinity -> 1.00000000
-nextt410 nexttoward 1.00000002 -Infinity -> 1.00000001
-nextt411 nexttoward 1.00000003 -Infinity -> 1.00000002
-nextt412 nexttoward 1.00000004 -Infinity -> 1.00000003
-nextt413 nexttoward 1.00000005 -Infinity -> 1.00000004
-nextt414 nexttoward 1.00000006 -Infinity -> 1.00000005
-nextt415 nexttoward 1.00000007 -Infinity -> 1.00000006
-nextt416 nexttoward 1.00000008 -Infinity -> 1.00000007
-nextt417 nexttoward 1.00000009 -Infinity -> 1.00000008
-nextt418 nexttoward 1.00000010 -Infinity -> 1.00000009
-nextt419 nexttoward 1.00000011 -Infinity -> 1.00000010
-nextt420 nexttoward 1.00000012 -Infinity -> 1.00000011
-
-nextt421 nexttoward -0.999999995 -Infinity -> -0.999999996
-nextt422 nexttoward -0.999999996 -Infinity -> -0.999999997
-nextt423 nexttoward -0.999999997 -Infinity -> -0.999999998
-nextt424 nexttoward -0.999999998 -Infinity -> -0.999999999
-nextt425 nexttoward -0.999999999 -Infinity -> -1.00000000
-nextt426 nexttoward -1.00000000 -Infinity -> -1.00000001
-nextt427 nexttoward -1.0 -Infinity -> -1.00000001
-nextt428 nexttoward -1 -Infinity -> -1.00000001
-nextt429 nexttoward -1.00000001 -Infinity -> -1.00000002
-nextt430 nexttoward -1.00000002 -Infinity -> -1.00000003
-nextt431 nexttoward -1.00000003 -Infinity -> -1.00000004
-nextt432 nexttoward -1.00000004 -Infinity -> -1.00000005
-nextt433 nexttoward -1.00000005 -Infinity -> -1.00000006
-nextt434 nexttoward -1.00000006 -Infinity -> -1.00000007
-nextt435 nexttoward -1.00000007 -Infinity -> -1.00000008
-nextt436 nexttoward -1.00000008 -Infinity -> -1.00000009
-nextt437 nexttoward -1.00000009 -Infinity -> -1.00000010
-nextt438 nexttoward -1.00000010 -Infinity -> -1.00000011
-nextt439 nexttoward -1.00000011 -Infinity -> -1.00000012
-
--- input operand is >precision
-nextt441 nexttoward 1.00000010998 -Infinity -> 1.00000010
-nextt442 nexttoward 1.00000010999 -Infinity -> 1.00000010
-nextt443 nexttoward 1.00000011000 -Infinity -> 1.00000010
-nextt444 nexttoward 1.00000011001 -Infinity -> 1.00000011
-nextt445 nexttoward 1.00000011002 -Infinity -> 1.00000011
-nextt446 nexttoward 1.00000011002 -Infinity -> 1.00000011
-nextt447 nexttoward 1.00000011052 -Infinity -> 1.00000011
-nextt448 nexttoward 1.00000011552 -Infinity -> 1.00000011
-nextt449 nexttoward -1.00000010998 -Infinity -> -1.00000011
-nextt450 nexttoward -1.00000010999 -Infinity -> -1.00000011
-nextt451 nexttoward -1.00000011000 -Infinity -> -1.00000012
-nextt452 nexttoward -1.00000011001 -Infinity -> -1.00000012
-nextt453 nexttoward -1.00000011002 -Infinity -> -1.00000012
-nextt454 nexttoward -1.00000011002 -Infinity -> -1.00000012
-nextt455 nexttoward -1.00000011052 -Infinity -> -1.00000012
-nextt456 nexttoward -1.00000011552 -Infinity -> -1.00000012
--- ultra-tiny inputs
-nextt460 nexttoward 1E-99999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt461 nexttoward 1E-999999999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt462 nexttoward 1E-391 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt463 nexttoward -1E-99999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt464 nexttoward -1E-999999999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt465 nexttoward -1E-391 -Infinity -> -2E-391 Underflow Subnormal Inexact Rounded
-
--- Zeros
-nextt500 nexttoward -0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt501 nexttoward 0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt502 nexttoward 0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt503 nexttoward -0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt504 nexttoward 0E-300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt505 nexttoward 0E+300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt506 nexttoward 0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt507 nexttoward -0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt508 nexttoward 0.00 -0.0000 -> -0.00
-
--- specials
-nextt550 nexttoward Inf -Infinity -> 9.99999999E+384
-nextt551 nexttoward -Inf -Infinity -> -Infinity
-nextt552 nexttoward NaN -Infinity -> NaN
-nextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
-nextt554 nexttoward NaN77 -Infinity -> NaN77
-nextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
-nextt556 nexttoward -NaN -Infinity -> -NaN
-nextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
-nextt558 nexttoward -NaN77 -Infinity -> -NaN77
-nextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-maxExponent: 999
-minexponent: -999
-nextt570 nexttoward 9.99999999E+999 -Infinity -> 9.99999998E+999
-nextt571 nexttoward 9.99999998E+999 -Infinity -> 9.99999997E+999
-nextt572 nexttoward 1E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt573 nexttoward 1.00000000E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt574 nexttoward 9E-1007 -Infinity -> 8E-1007 Underflow Subnormal Inexact Rounded
-nextt575 nexttoward 9.9E-1006 -Infinity -> 9.8E-1006 Underflow Subnormal Inexact Rounded
-nextt576 nexttoward 9.9999E-1003 -Infinity -> 9.9998E-1003 Underflow Subnormal Inexact Rounded
-nextt577 nexttoward 9.9999999E-1000 -Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
-nextt578 nexttoward 9.9999998E-1000 -Infinity -> 9.9999997E-1000 Underflow Subnormal Inexact Rounded
-nextt579 nexttoward 9.9999997E-1000 -Infinity -> 9.9999996E-1000 Underflow Subnormal Inexact Rounded
-nextt580 nexttoward 0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
-nextt581 nexttoward 1E-1007 -Infinity -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
-nextt582 nexttoward 2E-1007 -Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
-
-nextt583 nexttoward -0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
-nextt584 nexttoward -1E-1007 -Infinity -> -2E-1007 Underflow Subnormal Inexact Rounded
-nextt585 nexttoward -2E-1007 -Infinity -> -3E-1007 Underflow Subnormal Inexact Rounded
-nextt586 nexttoward -10E-1007 -Infinity -> -1.1E-1006 Underflow Subnormal Inexact Rounded
-nextt587 nexttoward -100E-1007 -Infinity -> -1.01E-1005 Underflow Subnormal Inexact Rounded
-nextt588 nexttoward -100000E-1007 -Infinity -> -1.00001E-1002 Underflow Subnormal Inexact Rounded
-nextt589 nexttoward -1.0000E-999 -Infinity -> -1.00000001E-999
-nextt590 nexttoward -1.00000000E-999 -Infinity -> -1.00000001E-999
-nextt591 nexttoward -1E-999 -Infinity -> -1.00000001E-999
-nextt592 nexttoward -9.99999998E+999 -Infinity -> -9.99999999E+999
-nextt593 nexttoward -9.99999999E+999 -Infinity -> -Infinity Overflow Inexact Rounded
-
-
-
-
-------- Specials
-maxExponent: 384
-minexponent: -383
-nextt780 nexttoward -Inf -Inf -> -Infinity
-nextt781 nexttoward -Inf -1000 -> -9.99999999E+384
-nextt782 nexttoward -Inf -1 -> -9.99999999E+384
-nextt783 nexttoward -Inf -0 -> -9.99999999E+384
-nextt784 nexttoward -Inf 0 -> -9.99999999E+384
-nextt785 nexttoward -Inf 1 -> -9.99999999E+384
-nextt786 nexttoward -Inf 1000 -> -9.99999999E+384
-nextt787 nexttoward -1000 -Inf -> -1000.00001
-nextt788 nexttoward -Inf -Inf -> -Infinity
-nextt789 nexttoward -1 -Inf -> -1.00000001
-nextt790 nexttoward -0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt791 nexttoward 0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt792 nexttoward 1 -Inf -> 0.999999999
-nextt793 nexttoward 1000 -Inf -> 999.999999
-nextt794 nexttoward Inf -Inf -> 9.99999999E+384
-
-nextt800 nexttoward Inf -Inf -> 9.99999999E+384
-nextt801 nexttoward Inf -1000 -> 9.99999999E+384
-nextt802 nexttoward Inf -1 -> 9.99999999E+384
-nextt803 nexttoward Inf -0 -> 9.99999999E+384
-nextt804 nexttoward Inf 0 -> 9.99999999E+384
-nextt805 nexttoward Inf 1 -> 9.99999999E+384
-nextt806 nexttoward Inf 1000 -> 9.99999999E+384
-nextt807 nexttoward Inf Inf -> Infinity
-nextt808 nexttoward -1000 Inf -> -999.999999
-nextt809 nexttoward -Inf Inf -> -9.99999999E+384
-nextt810 nexttoward -1 Inf -> -0.999999999
-nextt811 nexttoward -0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt812 nexttoward 0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt813 nexttoward 1 Inf -> 1.00000001
-nextt814 nexttoward 1000 Inf -> 1000.00001
-nextt815 nexttoward Inf Inf -> Infinity
-
-nextt821 nexttoward NaN -Inf -> NaN
-nextt822 nexttoward NaN -1000 -> NaN
-nextt823 nexttoward NaN -1 -> NaN
-nextt824 nexttoward NaN -0 -> NaN
-nextt825 nexttoward NaN 0 -> NaN
-nextt826 nexttoward NaN 1 -> NaN
-nextt827 nexttoward NaN 1000 -> NaN
-nextt828 nexttoward NaN Inf -> NaN
-nextt829 nexttoward NaN NaN -> NaN
-nextt830 nexttoward -Inf NaN -> NaN
-nextt831 nexttoward -1000 NaN -> NaN
-nextt832 nexttoward -1 NaN -> NaN
-nextt833 nexttoward -0 NaN -> NaN
-nextt834 nexttoward 0 NaN -> NaN
-nextt835 nexttoward 1 NaN -> NaN
-nextt836 nexttoward 1000 NaN -> NaN
-nextt837 nexttoward Inf NaN -> NaN
-
-nextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
-nextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
-nextt843 nexttoward sNaN -1 -> NaN Invalid_operation
-nextt844 nexttoward sNaN -0 -> NaN Invalid_operation
-nextt845 nexttoward sNaN 0 -> NaN Invalid_operation
-nextt846 nexttoward sNaN 1 -> NaN Invalid_operation
-nextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
-nextt848 nexttoward sNaN NaN -> NaN Invalid_operation
-nextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
-nextt850 nexttoward NaN sNaN -> NaN Invalid_operation
-nextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
-nextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
-nextt853 nexttoward -1 sNaN -> NaN Invalid_operation
-nextt854 nexttoward -0 sNaN -> NaN Invalid_operation
-nextt855 nexttoward 0 sNaN -> NaN Invalid_operation
-nextt856 nexttoward 1 sNaN -> NaN Invalid_operation
-nextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
-nextt858 nexttoward Inf sNaN -> NaN Invalid_operation
-nextt859 nexttoward NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-nextt861 nexttoward NaN1 -Inf -> NaN1
-nextt862 nexttoward +NaN2 -1000 -> NaN2
-nextt863 nexttoward NaN3 1000 -> NaN3
-nextt864 nexttoward NaN4 Inf -> NaN4
-nextt865 nexttoward NaN5 +NaN6 -> NaN5
-nextt866 nexttoward -Inf NaN7 -> NaN7
-nextt867 nexttoward -1000 NaN8 -> NaN8
-nextt868 nexttoward 1000 NaN9 -> NaN9
-nextt869 nexttoward Inf +NaN10 -> NaN10
-nextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
-nextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
-nextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
-nextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
-nextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
-nextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
-nextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
-nextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
-nextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
-nextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
-nextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
-nextt882 nexttoward -NaN26 NaN28 -> -NaN26
-nextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-nextt884 nexttoward 1000 -NaN30 -> -NaN30
-nextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Null tests
-nextt900 nexttoward 1 # -> NaN Invalid_operation
-nextt901 nexttoward # 1 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- nexttoward.decTest -- decimal next toward rhs [754r nextafter] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- Sanity check with a scattering of numerics
+nextt001 nexttoward 10 10 -> 10
+nextt002 nexttoward -10 -10 -> -10
+nextt003 nexttoward 1 10 -> 1.00000001
+nextt004 nexttoward 1 -10 -> 0.999999999
+nextt005 nexttoward -1 10 -> -0.999999999
+nextt006 nexttoward -1 -10 -> -1.00000001
+nextt007 nexttoward 0 10 -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt008 nexttoward 0 -10 -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt009 nexttoward 9.99999999E+384 +Infinity -> Infinity Overflow Inexact Rounded
+nextt010 nexttoward -9.99999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
+
+------- lhs=rhs
+-- finites
+nextt101 nexttoward 7 7 -> 7
+nextt102 nexttoward -7 -7 -> -7
+nextt103 nexttoward 75 75 -> 75
+nextt104 nexttoward -75 -75 -> -75
+nextt105 nexttoward 7.50 7.5 -> 7.50
+nextt106 nexttoward -7.50 -7.50 -> -7.50
+nextt107 nexttoward 7.500 7.5000 -> 7.500
+nextt108 nexttoward -7.500 -7.5 -> -7.500
+
+-- zeros
+nextt111 nexttoward 0 0 -> 0
+nextt112 nexttoward -0 -0 -> -0
+nextt113 nexttoward 0E+4 0 -> 0E+4
+nextt114 nexttoward -0E+4 -0 -> -0E+4
+nextt115 nexttoward 0.0000 0.00000 -> 0.0000
+nextt116 nexttoward -0.0000 -0.00 -> -0.0000
+nextt117 nexttoward 0E-141 0 -> 0E-141
+nextt118 nexttoward -0E-141 -000 -> -0E-141
+
+-- full coefficients, alternating bits
+nextt121 nexttoward 268268268 268268268 -> 268268268
+nextt122 nexttoward -268268268 -268268268 -> -268268268
+nextt123 nexttoward 134134134 134134134 -> 134134134
+nextt124 nexttoward -134134134 -134134134 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+nextt131 nexttoward 9.99999999E+384 9.99999999E+384 -> 9.99999999E+384
+nextt132 nexttoward 1E-383 1E-383 -> 1E-383
+nextt133 nexttoward 1.00000000E-383 1.00000000E-383 -> 1.00000000E-383
+nextt134 nexttoward 1E-391 1E-391 -> 1E-391
+
+nextt135 nexttoward -1E-391 -1E-391 -> -1E-391
+nextt136 nexttoward -1.00000000E-383 -1.00000000E-383 -> -1.00000000E-383
+nextt137 nexttoward -1E-383 -1E-383 -> -1E-383
+nextt138 nexttoward -9.99999999E+384 -9.99999999E+384 -> -9.99999999E+384
+
+------- lhs<rhs
+nextt201 nexttoward 0.999999995 Infinity -> 0.999999996
+nextt202 nexttoward 0.999999996 Infinity -> 0.999999997
+nextt203 nexttoward 0.999999997 Infinity -> 0.999999998
+nextt204 nexttoward 0.999999998 Infinity -> 0.999999999
+nextt205 nexttoward 0.999999999 Infinity -> 1.00000000
+nextt206 nexttoward 1.00000000 Infinity -> 1.00000001
+nextt207 nexttoward 1.0 Infinity -> 1.00000001
+nextt208 nexttoward 1 Infinity -> 1.00000001
+nextt209 nexttoward 1.00000001 Infinity -> 1.00000002
+nextt210 nexttoward 1.00000002 Infinity -> 1.00000003
+nextt211 nexttoward 1.00000003 Infinity -> 1.00000004
+nextt212 nexttoward 1.00000004 Infinity -> 1.00000005
+nextt213 nexttoward 1.00000005 Infinity -> 1.00000006
+nextt214 nexttoward 1.00000006 Infinity -> 1.00000007
+nextt215 nexttoward 1.00000007 Infinity -> 1.00000008
+nextt216 nexttoward 1.00000008 Infinity -> 1.00000009
+nextt217 nexttoward 1.00000009 Infinity -> 1.00000010
+nextt218 nexttoward 1.00000010 Infinity -> 1.00000011
+nextt219 nexttoward 1.00000011 Infinity -> 1.00000012
+
+nextt221 nexttoward -0.999999995 Infinity -> -0.999999994
+nextt222 nexttoward -0.999999996 Infinity -> -0.999999995
+nextt223 nexttoward -0.999999997 Infinity -> -0.999999996
+nextt224 nexttoward -0.999999998 Infinity -> -0.999999997
+nextt225 nexttoward -0.999999999 Infinity -> -0.999999998
+nextt226 nexttoward -1.00000000 Infinity -> -0.999999999
+nextt227 nexttoward -1.0 Infinity -> -0.999999999
+nextt228 nexttoward -1 Infinity -> -0.999999999
+nextt229 nexttoward -1.00000001 Infinity -> -1.00000000
+nextt230 nexttoward -1.00000002 Infinity -> -1.00000001
+nextt231 nexttoward -1.00000003 Infinity -> -1.00000002
+nextt232 nexttoward -1.00000004 Infinity -> -1.00000003
+nextt233 nexttoward -1.00000005 Infinity -> -1.00000004
+nextt234 nexttoward -1.00000006 Infinity -> -1.00000005
+nextt235 nexttoward -1.00000007 Infinity -> -1.00000006
+nextt236 nexttoward -1.00000008 Infinity -> -1.00000007
+nextt237 nexttoward -1.00000009 Infinity -> -1.00000008
+nextt238 nexttoward -1.00000010 Infinity -> -1.00000009
+nextt239 nexttoward -1.00000011 Infinity -> -1.00000010
+nextt240 nexttoward -1.00000012 Infinity -> -1.00000011
+
+-- input operand is >precision
+nextt241 nexttoward 1.00000010998 Infinity -> 1.00000011
+nextt242 nexttoward 1.00000010999 Infinity -> 1.00000011
+nextt243 nexttoward 1.00000011000 Infinity -> 1.00000012
+nextt244 nexttoward 1.00000011001 Infinity -> 1.00000012
+nextt245 nexttoward 1.00000011002 Infinity -> 1.00000012
+nextt246 nexttoward 1.00000011002 Infinity -> 1.00000012
+nextt247 nexttoward 1.00000011052 Infinity -> 1.00000012
+nextt248 nexttoward 1.00000011552 Infinity -> 1.00000012
+nextt249 nexttoward -1.00000010998 Infinity -> -1.00000010
+nextt250 nexttoward -1.00000010999 Infinity -> -1.00000010
+nextt251 nexttoward -1.00000011000 Infinity -> -1.00000010
+nextt252 nexttoward -1.00000011001 Infinity -> -1.00000011
+nextt253 nexttoward -1.00000011002 Infinity -> -1.00000011
+nextt254 nexttoward -1.00000011002 Infinity -> -1.00000011
+nextt255 nexttoward -1.00000011052 Infinity -> -1.00000011
+nextt256 nexttoward -1.00000011552 Infinity -> -1.00000011
+-- ultra-tiny inputs
+nextt260 nexttoward 1E-99999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt261 nexttoward 1E-999999999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt262 nexttoward 1E-391 Infinity -> 2E-391 Underflow Subnormal Inexact Rounded
+nextt263 nexttoward -1E-99999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt264 nexttoward -1E-999999999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt265 nexttoward -1E-391 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
+
+-- Zeros
+nextt300 nexttoward 0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt301 nexttoward 0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt302 nexttoward 0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt303 nexttoward 0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt304 nexttoward 0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt305 nexttoward -0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt306 nexttoward -0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt307 nexttoward -0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt308 nexttoward -0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt309 nexttoward -0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+
+-- specials
+nextt350 nexttoward Inf Infinity -> Infinity
+nextt351 nexttoward -Inf Infinity -> -9.99999999E+384
+nextt352 nexttoward NaN Infinity -> NaN
+nextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
+nextt354 nexttoward NaN77 Infinity -> NaN77
+nextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
+nextt356 nexttoward -NaN Infinity -> -NaN
+nextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
+nextt358 nexttoward -NaN77 Infinity -> -NaN77
+nextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+maxExponent: 999
+minexponent: -999
+nextt370 nexttoward 9.99999999E+999 Infinity -> Infinity Overflow Inexact Rounded
+nextt371 nexttoward 9.99999998E+999 Infinity -> 9.99999999E+999
+nextt372 nexttoward 1E-999 Infinity -> 1.00000001E-999
+nextt373 nexttoward 1.00000000E-999 Infinity -> 1.00000001E-999
+nextt374 nexttoward 0.999999999E-999 Infinity -> 1.00000000E-999
+nextt375 nexttoward 0.99999999E-999 Infinity -> 1.00000000E-999
+nextt376 nexttoward 9E-1007 Infinity -> 1.0E-1006 Underflow Subnormal Inexact Rounded
+nextt377 nexttoward 9.9E-1006 Infinity -> 1.00E-1005 Underflow Subnormal Inexact Rounded
+nextt378 nexttoward 9.9999E-1003 Infinity -> 1.00000E-1002 Underflow Subnormal Inexact Rounded
+nextt379 nexttoward 9.9999998E-1000 Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt380 nexttoward 9.9999997E-1000 Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
+nextt381 nexttoward 0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
+nextt382 nexttoward 1E-1007 Infinity -> 2E-1007 Underflow Subnormal Inexact Rounded
+nextt383 nexttoward 2E-1007 Infinity -> 3E-1007 Underflow Subnormal Inexact Rounded
+
+nextt385 nexttoward -0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
+nextt386 nexttoward -1E-1007 Infinity -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped
+nextt387 nexttoward -2E-1007 Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
+nextt388 nexttoward -10E-1007 Infinity -> -9E-1007 Underflow Subnormal Inexact Rounded
+nextt389 nexttoward -100E-1007 Infinity -> -9.9E-1006 Underflow Subnormal Inexact Rounded
+nextt390 nexttoward -100000E-1007 Infinity -> -9.9999E-1003 Underflow Subnormal Inexact Rounded
+nextt391 nexttoward -1.0000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt392 nexttoward -1.00000000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt393 nexttoward -1E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt394 nexttoward -9.99999998E+999 Infinity -> -9.99999997E+999
+nextt395 nexttoward -9.99999999E+999 Infinity -> -9.99999998E+999
+
+------- lhs>rhs
+maxExponent: 384
+minexponent: -383
+nextt401 nexttoward 0.999999995 -Infinity -> 0.999999994
+nextt402 nexttoward 0.999999996 -Infinity -> 0.999999995
+nextt403 nexttoward 0.999999997 -Infinity -> 0.999999996
+nextt404 nexttoward 0.999999998 -Infinity -> 0.999999997
+nextt405 nexttoward 0.999999999 -Infinity -> 0.999999998
+nextt406 nexttoward 1.00000000 -Infinity -> 0.999999999
+nextt407 nexttoward 1.0 -Infinity -> 0.999999999
+nextt408 nexttoward 1 -Infinity -> 0.999999999
+nextt409 nexttoward 1.00000001 -Infinity -> 1.00000000
+nextt410 nexttoward 1.00000002 -Infinity -> 1.00000001
+nextt411 nexttoward 1.00000003 -Infinity -> 1.00000002
+nextt412 nexttoward 1.00000004 -Infinity -> 1.00000003
+nextt413 nexttoward 1.00000005 -Infinity -> 1.00000004
+nextt414 nexttoward 1.00000006 -Infinity -> 1.00000005
+nextt415 nexttoward 1.00000007 -Infinity -> 1.00000006
+nextt416 nexttoward 1.00000008 -Infinity -> 1.00000007
+nextt417 nexttoward 1.00000009 -Infinity -> 1.00000008
+nextt418 nexttoward 1.00000010 -Infinity -> 1.00000009
+nextt419 nexttoward 1.00000011 -Infinity -> 1.00000010
+nextt420 nexttoward 1.00000012 -Infinity -> 1.00000011
+
+nextt421 nexttoward -0.999999995 -Infinity -> -0.999999996
+nextt422 nexttoward -0.999999996 -Infinity -> -0.999999997
+nextt423 nexttoward -0.999999997 -Infinity -> -0.999999998
+nextt424 nexttoward -0.999999998 -Infinity -> -0.999999999
+nextt425 nexttoward -0.999999999 -Infinity -> -1.00000000
+nextt426 nexttoward -1.00000000 -Infinity -> -1.00000001
+nextt427 nexttoward -1.0 -Infinity -> -1.00000001
+nextt428 nexttoward -1 -Infinity -> -1.00000001
+nextt429 nexttoward -1.00000001 -Infinity -> -1.00000002
+nextt430 nexttoward -1.00000002 -Infinity -> -1.00000003
+nextt431 nexttoward -1.00000003 -Infinity -> -1.00000004
+nextt432 nexttoward -1.00000004 -Infinity -> -1.00000005
+nextt433 nexttoward -1.00000005 -Infinity -> -1.00000006
+nextt434 nexttoward -1.00000006 -Infinity -> -1.00000007
+nextt435 nexttoward -1.00000007 -Infinity -> -1.00000008
+nextt436 nexttoward -1.00000008 -Infinity -> -1.00000009
+nextt437 nexttoward -1.00000009 -Infinity -> -1.00000010
+nextt438 nexttoward -1.00000010 -Infinity -> -1.00000011
+nextt439 nexttoward -1.00000011 -Infinity -> -1.00000012
+
+-- input operand is >precision
+nextt441 nexttoward 1.00000010998 -Infinity -> 1.00000010
+nextt442 nexttoward 1.00000010999 -Infinity -> 1.00000010
+nextt443 nexttoward 1.00000011000 -Infinity -> 1.00000010
+nextt444 nexttoward 1.00000011001 -Infinity -> 1.00000011
+nextt445 nexttoward 1.00000011002 -Infinity -> 1.00000011
+nextt446 nexttoward 1.00000011002 -Infinity -> 1.00000011
+nextt447 nexttoward 1.00000011052 -Infinity -> 1.00000011
+nextt448 nexttoward 1.00000011552 -Infinity -> 1.00000011
+nextt449 nexttoward -1.00000010998 -Infinity -> -1.00000011
+nextt450 nexttoward -1.00000010999 -Infinity -> -1.00000011
+nextt451 nexttoward -1.00000011000 -Infinity -> -1.00000012
+nextt452 nexttoward -1.00000011001 -Infinity -> -1.00000012
+nextt453 nexttoward -1.00000011002 -Infinity -> -1.00000012
+nextt454 nexttoward -1.00000011002 -Infinity -> -1.00000012
+nextt455 nexttoward -1.00000011052 -Infinity -> -1.00000012
+nextt456 nexttoward -1.00000011552 -Infinity -> -1.00000012
+-- ultra-tiny inputs
+nextt460 nexttoward 1E-99999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt461 nexttoward 1E-999999999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt462 nexttoward 1E-391 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt463 nexttoward -1E-99999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt464 nexttoward -1E-999999999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt465 nexttoward -1E-391 -Infinity -> -2E-391 Underflow Subnormal Inexact Rounded
+
+-- Zeros
+nextt500 nexttoward -0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt501 nexttoward 0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt502 nexttoward 0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt503 nexttoward -0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt504 nexttoward 0E-300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt505 nexttoward 0E+300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt506 nexttoward 0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt507 nexttoward -0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt508 nexttoward 0.00 -0.0000 -> -0.00
+
+-- specials
+nextt550 nexttoward Inf -Infinity -> 9.99999999E+384
+nextt551 nexttoward -Inf -Infinity -> -Infinity
+nextt552 nexttoward NaN -Infinity -> NaN
+nextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
+nextt554 nexttoward NaN77 -Infinity -> NaN77
+nextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
+nextt556 nexttoward -NaN -Infinity -> -NaN
+nextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
+nextt558 nexttoward -NaN77 -Infinity -> -NaN77
+nextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+maxExponent: 999
+minexponent: -999
+nextt570 nexttoward 9.99999999E+999 -Infinity -> 9.99999998E+999
+nextt571 nexttoward 9.99999998E+999 -Infinity -> 9.99999997E+999
+nextt572 nexttoward 1E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt573 nexttoward 1.00000000E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt574 nexttoward 9E-1007 -Infinity -> 8E-1007 Underflow Subnormal Inexact Rounded
+nextt575 nexttoward 9.9E-1006 -Infinity -> 9.8E-1006 Underflow Subnormal Inexact Rounded
+nextt576 nexttoward 9.9999E-1003 -Infinity -> 9.9998E-1003 Underflow Subnormal Inexact Rounded
+nextt577 nexttoward 9.9999999E-1000 -Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
+nextt578 nexttoward 9.9999998E-1000 -Infinity -> 9.9999997E-1000 Underflow Subnormal Inexact Rounded
+nextt579 nexttoward 9.9999997E-1000 -Infinity -> 9.9999996E-1000 Underflow Subnormal Inexact Rounded
+nextt580 nexttoward 0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
+nextt581 nexttoward 1E-1007 -Infinity -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
+nextt582 nexttoward 2E-1007 -Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
+
+nextt583 nexttoward -0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
+nextt584 nexttoward -1E-1007 -Infinity -> -2E-1007 Underflow Subnormal Inexact Rounded
+nextt585 nexttoward -2E-1007 -Infinity -> -3E-1007 Underflow Subnormal Inexact Rounded
+nextt586 nexttoward -10E-1007 -Infinity -> -1.1E-1006 Underflow Subnormal Inexact Rounded
+nextt587 nexttoward -100E-1007 -Infinity -> -1.01E-1005 Underflow Subnormal Inexact Rounded
+nextt588 nexttoward -100000E-1007 -Infinity -> -1.00001E-1002 Underflow Subnormal Inexact Rounded
+nextt589 nexttoward -1.0000E-999 -Infinity -> -1.00000001E-999
+nextt590 nexttoward -1.00000000E-999 -Infinity -> -1.00000001E-999
+nextt591 nexttoward -1E-999 -Infinity -> -1.00000001E-999
+nextt592 nexttoward -9.99999998E+999 -Infinity -> -9.99999999E+999
+nextt593 nexttoward -9.99999999E+999 -Infinity -> -Infinity Overflow Inexact Rounded
+
+
+
+
+------- Specials
+maxExponent: 384
+minexponent: -383
+nextt780 nexttoward -Inf -Inf -> -Infinity
+nextt781 nexttoward -Inf -1000 -> -9.99999999E+384
+nextt782 nexttoward -Inf -1 -> -9.99999999E+384
+nextt783 nexttoward -Inf -0 -> -9.99999999E+384
+nextt784 nexttoward -Inf 0 -> -9.99999999E+384
+nextt785 nexttoward -Inf 1 -> -9.99999999E+384
+nextt786 nexttoward -Inf 1000 -> -9.99999999E+384
+nextt787 nexttoward -1000 -Inf -> -1000.00001
+nextt788 nexttoward -Inf -Inf -> -Infinity
+nextt789 nexttoward -1 -Inf -> -1.00000001
+nextt790 nexttoward -0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt791 nexttoward 0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt792 nexttoward 1 -Inf -> 0.999999999
+nextt793 nexttoward 1000 -Inf -> 999.999999
+nextt794 nexttoward Inf -Inf -> 9.99999999E+384
+
+nextt800 nexttoward Inf -Inf -> 9.99999999E+384
+nextt801 nexttoward Inf -1000 -> 9.99999999E+384
+nextt802 nexttoward Inf -1 -> 9.99999999E+384
+nextt803 nexttoward Inf -0 -> 9.99999999E+384
+nextt804 nexttoward Inf 0 -> 9.99999999E+384
+nextt805 nexttoward Inf 1 -> 9.99999999E+384
+nextt806 nexttoward Inf 1000 -> 9.99999999E+384
+nextt807 nexttoward Inf Inf -> Infinity
+nextt808 nexttoward -1000 Inf -> -999.999999
+nextt809 nexttoward -Inf Inf -> -9.99999999E+384
+nextt810 nexttoward -1 Inf -> -0.999999999
+nextt811 nexttoward -0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt812 nexttoward 0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt813 nexttoward 1 Inf -> 1.00000001
+nextt814 nexttoward 1000 Inf -> 1000.00001
+nextt815 nexttoward Inf Inf -> Infinity
+
+nextt821 nexttoward NaN -Inf -> NaN
+nextt822 nexttoward NaN -1000 -> NaN
+nextt823 nexttoward NaN -1 -> NaN
+nextt824 nexttoward NaN -0 -> NaN
+nextt825 nexttoward NaN 0 -> NaN
+nextt826 nexttoward NaN 1 -> NaN
+nextt827 nexttoward NaN 1000 -> NaN
+nextt828 nexttoward NaN Inf -> NaN
+nextt829 nexttoward NaN NaN -> NaN
+nextt830 nexttoward -Inf NaN -> NaN
+nextt831 nexttoward -1000 NaN -> NaN
+nextt832 nexttoward -1 NaN -> NaN
+nextt833 nexttoward -0 NaN -> NaN
+nextt834 nexttoward 0 NaN -> NaN
+nextt835 nexttoward 1 NaN -> NaN
+nextt836 nexttoward 1000 NaN -> NaN
+nextt837 nexttoward Inf NaN -> NaN
+
+nextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
+nextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
+nextt843 nexttoward sNaN -1 -> NaN Invalid_operation
+nextt844 nexttoward sNaN -0 -> NaN Invalid_operation
+nextt845 nexttoward sNaN 0 -> NaN Invalid_operation
+nextt846 nexttoward sNaN 1 -> NaN Invalid_operation
+nextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
+nextt848 nexttoward sNaN NaN -> NaN Invalid_operation
+nextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
+nextt850 nexttoward NaN sNaN -> NaN Invalid_operation
+nextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
+nextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
+nextt853 nexttoward -1 sNaN -> NaN Invalid_operation
+nextt854 nexttoward -0 sNaN -> NaN Invalid_operation
+nextt855 nexttoward 0 sNaN -> NaN Invalid_operation
+nextt856 nexttoward 1 sNaN -> NaN Invalid_operation
+nextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
+nextt858 nexttoward Inf sNaN -> NaN Invalid_operation
+nextt859 nexttoward NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+nextt861 nexttoward NaN1 -Inf -> NaN1
+nextt862 nexttoward +NaN2 -1000 -> NaN2
+nextt863 nexttoward NaN3 1000 -> NaN3
+nextt864 nexttoward NaN4 Inf -> NaN4
+nextt865 nexttoward NaN5 +NaN6 -> NaN5
+nextt866 nexttoward -Inf NaN7 -> NaN7
+nextt867 nexttoward -1000 NaN8 -> NaN8
+nextt868 nexttoward 1000 NaN9 -> NaN9
+nextt869 nexttoward Inf +NaN10 -> NaN10
+nextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
+nextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
+nextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
+nextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
+nextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
+nextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
+nextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
+nextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
+nextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
+nextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
+nextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
+nextt882 nexttoward -NaN26 NaN28 -> -NaN26
+nextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+nextt884 nexttoward 1000 -NaN30 -> -NaN30
+nextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Null tests
+nextt900 nexttoward 1 # -> NaN Invalid_operation
+nextt901 nexttoward # 1 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/or.decTest b/Lib/test/decimaltestdata/or.decTest
index 1aebff4e00..f471d0b6ce 100644
--- a/Lib/test/decimaltestdata/or.decTest
+++ b/Lib/test/decimaltestdata/or.decTest
@@ -1,334 +1,334 @@
-------------------------------------------------------------------------
--- or.decTest -- digitwise logical OR --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check (truth table)
-orx001 or 0 0 -> 0
-orx002 or 0 1 -> 1
-orx003 or 1 0 -> 1
-orx004 or 1 1 -> 1
-orx005 or 1100 1010 -> 1110
--- and at msd and msd-1
-orx006 or 000000000 000000000 -> 0
-orx007 or 000000000 100000000 -> 100000000
-orx008 or 100000000 000000000 -> 100000000
-orx009 or 100000000 100000000 -> 100000000
-orx010 or 000000000 000000000 -> 0
-orx011 or 000000000 010000000 -> 10000000
-orx012 or 010000000 000000000 -> 10000000
-orx013 or 010000000 010000000 -> 10000000
-
--- Various lengths
--- 123456789 123456789 123456789
-orx021 or 111111111 111111111 -> 111111111
-orx022 or 111111111111 111111111 -> 111111111
-orx023 or 11111111 11111111 -> 11111111
-orx025 or 1111111 1111111 -> 1111111
-orx026 or 111111 111111 -> 111111
-orx027 or 11111 11111 -> 11111
-orx028 or 1111 1111 -> 1111
-orx029 or 111 111 -> 111
-orx031 or 11 11 -> 11
-orx032 or 1 1 -> 1
-orx033 or 111111111111 1111111111 -> 111111111
-orx034 or 11111111111 11111111111 -> 111111111
-orx035 or 1111111111 111111111111 -> 111111111
-orx036 or 111111111 1111111111111 -> 111111111
-
-orx040 or 111111111 111111111111 -> 111111111
-orx041 or 11111111 111111111111 -> 111111111
-orx042 or 11111111 111111111 -> 111111111
-orx043 or 1111111 100000010 -> 101111111
-orx044 or 111111 100000100 -> 100111111
-orx045 or 11111 100001000 -> 100011111
-orx046 or 1111 100010000 -> 100011111
-orx047 or 111 100100000 -> 100100111
-orx048 or 11 101000000 -> 101000011
-orx049 or 1 110000000 -> 110000001
-
-orx050 or 1111111111 1 -> 111111111
-orx051 or 111111111 1 -> 111111111
-orx052 or 11111111 1 -> 11111111
-orx053 or 1111111 1 -> 1111111
-orx054 or 111111 1 -> 111111
-orx055 or 11111 1 -> 11111
-orx056 or 1111 1 -> 1111
-orx057 or 111 1 -> 111
-orx058 or 11 1 -> 11
-orx059 or 1 1 -> 1
-
-orx060 or 1111111111 0 -> 111111111
-orx061 or 111111111 0 -> 111111111
-orx062 or 11111111 0 -> 11111111
-orx063 or 1111111 0 -> 1111111
-orx064 or 111111 0 -> 111111
-orx065 or 11111 0 -> 11111
-orx066 or 1111 0 -> 1111
-orx067 or 111 0 -> 111
-orx068 or 11 0 -> 11
-orx069 or 1 0 -> 1
-
-orx070 or 1 1111111111 -> 111111111
-orx071 or 1 111111111 -> 111111111
-orx072 or 1 11111111 -> 11111111
-orx073 or 1 1111111 -> 1111111
-orx074 or 1 111111 -> 111111
-orx075 or 1 11111 -> 11111
-orx076 or 1 1111 -> 1111
-orx077 or 1 111 -> 111
-orx078 or 1 11 -> 11
-orx079 or 1 1 -> 1
-
-orx080 or 0 1111111111 -> 111111111
-orx081 or 0 111111111 -> 111111111
-orx082 or 0 11111111 -> 11111111
-orx083 or 0 1111111 -> 1111111
-orx084 or 0 111111 -> 111111
-orx085 or 0 11111 -> 11111
-orx086 or 0 1111 -> 1111
-orx087 or 0 111 -> 111
-orx088 or 0 11 -> 11
-orx089 or 0 1 -> 1
-
-orx090 or 011111111 111101111 -> 111111111
-orx091 or 101111111 111101111 -> 111111111
-orx092 or 110111111 111101111 -> 111111111
-orx093 or 111011111 111101111 -> 111111111
-orx094 or 111101111 111101111 -> 111101111
-orx095 or 111110111 111101111 -> 111111111
-orx096 or 111111011 111101111 -> 111111111
-orx097 or 111111101 111101111 -> 111111111
-orx098 or 111111110 111101111 -> 111111111
-
-orx100 or 111101111 011111111 -> 111111111
-orx101 or 111101111 101111111 -> 111111111
-orx102 or 111101111 110111111 -> 111111111
-orx103 or 111101111 111011111 -> 111111111
-orx104 or 111101111 111101111 -> 111101111
-orx105 or 111101111 111110111 -> 111111111
-orx106 or 111101111 111111011 -> 111111111
-orx107 or 111101111 111111101 -> 111111111
-orx108 or 111101111 111111110 -> 111111111
-
--- non-0/1 should not be accepted, nor should signs
-orx220 or 111111112 111111111 -> NaN Invalid_operation
-orx221 or 333333333 333333333 -> NaN Invalid_operation
-orx222 or 555555555 555555555 -> NaN Invalid_operation
-orx223 or 777777777 777777777 -> NaN Invalid_operation
-orx224 or 999999999 999999999 -> NaN Invalid_operation
-orx225 or 222222222 999999999 -> NaN Invalid_operation
-orx226 or 444444444 999999999 -> NaN Invalid_operation
-orx227 or 666666666 999999999 -> NaN Invalid_operation
-orx228 or 888888888 999999999 -> NaN Invalid_operation
-orx229 or 999999999 222222222 -> NaN Invalid_operation
-orx230 or 999999999 444444444 -> NaN Invalid_operation
-orx231 or 999999999 666666666 -> NaN Invalid_operation
-orx232 or 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-orx240 or 567468689 -934981942 -> NaN Invalid_operation
-orx241 or 567367689 934981942 -> NaN Invalid_operation
-orx242 or -631917772 -706014634 -> NaN Invalid_operation
-orx243 or -756253257 138579234 -> NaN Invalid_operation
-orx244 or 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-orx250 or 200000000 100000000 -> NaN Invalid_operation
-orx251 or 700000000 100000000 -> NaN Invalid_operation
-orx252 or 800000000 100000000 -> NaN Invalid_operation
-orx253 or 900000000 100000000 -> NaN Invalid_operation
-orx254 or 200000000 000000000 -> NaN Invalid_operation
-orx255 or 700000000 000000000 -> NaN Invalid_operation
-orx256 or 800000000 000000000 -> NaN Invalid_operation
-orx257 or 900000000 000000000 -> NaN Invalid_operation
-orx258 or 100000000 200000000 -> NaN Invalid_operation
-orx259 or 100000000 700000000 -> NaN Invalid_operation
-orx260 or 100000000 800000000 -> NaN Invalid_operation
-orx261 or 100000000 900000000 -> NaN Invalid_operation
-orx262 or 000000000 200000000 -> NaN Invalid_operation
-orx263 or 000000000 700000000 -> NaN Invalid_operation
-orx264 or 000000000 800000000 -> NaN Invalid_operation
-orx265 or 000000000 900000000 -> NaN Invalid_operation
--- test MSD-1
-orx270 or 020000000 100000000 -> NaN Invalid_operation
-orx271 or 070100000 100000000 -> NaN Invalid_operation
-orx272 or 080010000 100000001 -> NaN Invalid_operation
-orx273 or 090001000 100000010 -> NaN Invalid_operation
-orx274 or 100000100 020010100 -> NaN Invalid_operation
-orx275 or 100000000 070001000 -> NaN Invalid_operation
-orx276 or 100000010 080010100 -> NaN Invalid_operation
-orx277 or 100000000 090000010 -> NaN Invalid_operation
--- test LSD
-orx280 or 001000002 100000000 -> NaN Invalid_operation
-orx281 or 000000007 100000000 -> NaN Invalid_operation
-orx282 or 000000008 100000000 -> NaN Invalid_operation
-orx283 or 000000009 100000000 -> NaN Invalid_operation
-orx284 or 100000000 000100002 -> NaN Invalid_operation
-orx285 or 100100000 001000007 -> NaN Invalid_operation
-orx286 or 100010000 010000008 -> NaN Invalid_operation
-orx287 or 100001000 100000009 -> NaN Invalid_operation
--- test Middie
-orx288 or 001020000 100000000 -> NaN Invalid_operation
-orx289 or 000070001 100000000 -> NaN Invalid_operation
-orx290 or 000080000 100010000 -> NaN Invalid_operation
-orx291 or 000090000 100001000 -> NaN Invalid_operation
-orx292 or 100000010 000020100 -> NaN Invalid_operation
-orx293 or 100100000 000070010 -> NaN Invalid_operation
-orx294 or 100010100 000080001 -> NaN Invalid_operation
-orx295 or 100001000 000090000 -> NaN Invalid_operation
--- signs
-orx296 or -100001000 -000000000 -> NaN Invalid_operation
-orx297 or -100001000 000010000 -> NaN Invalid_operation
-orx298 or 100001000 -000000000 -> NaN Invalid_operation
-orx299 or 100001000 000011000 -> 100011000
-
--- Nmax, Nmin, Ntiny
-orx331 or 2 9.99999999E+999 -> NaN Invalid_operation
-orx332 or 3 1E-999 -> NaN Invalid_operation
-orx333 or 4 1.00000000E-999 -> NaN Invalid_operation
-orx334 or 5 1E-1007 -> NaN Invalid_operation
-orx335 or 6 -1E-1007 -> NaN Invalid_operation
-orx336 or 7 -1.00000000E-999 -> NaN Invalid_operation
-orx337 or 8 -1E-999 -> NaN Invalid_operation
-orx338 or 9 -9.99999999E+999 -> NaN Invalid_operation
-orx341 or 9.99999999E+999 -18 -> NaN Invalid_operation
-orx342 or 1E-999 01 -> NaN Invalid_operation
-orx343 or 1.00000000E-999 -18 -> NaN Invalid_operation
-orx344 or 1E-1007 18 -> NaN Invalid_operation
-orx345 or -1E-1007 -10 -> NaN Invalid_operation
-orx346 or -1.00000000E-999 18 -> NaN Invalid_operation
-orx347 or -1E-999 10 -> NaN Invalid_operation
-orx348 or -9.99999999E+999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-orx361 or 1.0 1 -> NaN Invalid_operation
-orx362 or 1E+1 1 -> NaN Invalid_operation
-orx363 or 0.0 1 -> NaN Invalid_operation
-orx364 or 0E+1 1 -> NaN Invalid_operation
-orx365 or 9.9 1 -> NaN Invalid_operation
-orx366 or 9E+1 1 -> NaN Invalid_operation
-orx371 or 0 1.0 -> NaN Invalid_operation
-orx372 or 0 1E+1 -> NaN Invalid_operation
-orx373 or 0 0.0 -> NaN Invalid_operation
-orx374 or 0 0E+1 -> NaN Invalid_operation
-orx375 or 0 9.9 -> NaN Invalid_operation
-orx376 or 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-orx780 or -Inf -Inf -> NaN Invalid_operation
-orx781 or -Inf -1000 -> NaN Invalid_operation
-orx782 or -Inf -1 -> NaN Invalid_operation
-orx783 or -Inf -0 -> NaN Invalid_operation
-orx784 or -Inf 0 -> NaN Invalid_operation
-orx785 or -Inf 1 -> NaN Invalid_operation
-orx786 or -Inf 1000 -> NaN Invalid_operation
-orx787 or -1000 -Inf -> NaN Invalid_operation
-orx788 or -Inf -Inf -> NaN Invalid_operation
-orx789 or -1 -Inf -> NaN Invalid_operation
-orx790 or -0 -Inf -> NaN Invalid_operation
-orx791 or 0 -Inf -> NaN Invalid_operation
-orx792 or 1 -Inf -> NaN Invalid_operation
-orx793 or 1000 -Inf -> NaN Invalid_operation
-orx794 or Inf -Inf -> NaN Invalid_operation
-
-orx800 or Inf -Inf -> NaN Invalid_operation
-orx801 or Inf -1000 -> NaN Invalid_operation
-orx802 or Inf -1 -> NaN Invalid_operation
-orx803 or Inf -0 -> NaN Invalid_operation
-orx804 or Inf 0 -> NaN Invalid_operation
-orx805 or Inf 1 -> NaN Invalid_operation
-orx806 or Inf 1000 -> NaN Invalid_operation
-orx807 or Inf Inf -> NaN Invalid_operation
-orx808 or -1000 Inf -> NaN Invalid_operation
-orx809 or -Inf Inf -> NaN Invalid_operation
-orx810 or -1 Inf -> NaN Invalid_operation
-orx811 or -0 Inf -> NaN Invalid_operation
-orx812 or 0 Inf -> NaN Invalid_operation
-orx813 or 1 Inf -> NaN Invalid_operation
-orx814 or 1000 Inf -> NaN Invalid_operation
-orx815 or Inf Inf -> NaN Invalid_operation
-
-orx821 or NaN -Inf -> NaN Invalid_operation
-orx822 or NaN -1000 -> NaN Invalid_operation
-orx823 or NaN -1 -> NaN Invalid_operation
-orx824 or NaN -0 -> NaN Invalid_operation
-orx825 or NaN 0 -> NaN Invalid_operation
-orx826 or NaN 1 -> NaN Invalid_operation
-orx827 or NaN 1000 -> NaN Invalid_operation
-orx828 or NaN Inf -> NaN Invalid_operation
-orx829 or NaN NaN -> NaN Invalid_operation
-orx830 or -Inf NaN -> NaN Invalid_operation
-orx831 or -1000 NaN -> NaN Invalid_operation
-orx832 or -1 NaN -> NaN Invalid_operation
-orx833 or -0 NaN -> NaN Invalid_operation
-orx834 or 0 NaN -> NaN Invalid_operation
-orx835 or 1 NaN -> NaN Invalid_operation
-orx836 or 1000 NaN -> NaN Invalid_operation
-orx837 or Inf NaN -> NaN Invalid_operation
-
-orx841 or sNaN -Inf -> NaN Invalid_operation
-orx842 or sNaN -1000 -> NaN Invalid_operation
-orx843 or sNaN -1 -> NaN Invalid_operation
-orx844 or sNaN -0 -> NaN Invalid_operation
-orx845 or sNaN 0 -> NaN Invalid_operation
-orx846 or sNaN 1 -> NaN Invalid_operation
-orx847 or sNaN 1000 -> NaN Invalid_operation
-orx848 or sNaN NaN -> NaN Invalid_operation
-orx849 or sNaN sNaN -> NaN Invalid_operation
-orx850 or NaN sNaN -> NaN Invalid_operation
-orx851 or -Inf sNaN -> NaN Invalid_operation
-orx852 or -1000 sNaN -> NaN Invalid_operation
-orx853 or -1 sNaN -> NaN Invalid_operation
-orx854 or -0 sNaN -> NaN Invalid_operation
-orx855 or 0 sNaN -> NaN Invalid_operation
-orx856 or 1 sNaN -> NaN Invalid_operation
-orx857 or 1000 sNaN -> NaN Invalid_operation
-orx858 or Inf sNaN -> NaN Invalid_operation
-orx859 or NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-orx861 or NaN1 -Inf -> NaN Invalid_operation
-orx862 or +NaN2 -1000 -> NaN Invalid_operation
-orx863 or NaN3 1000 -> NaN Invalid_operation
-orx864 or NaN4 Inf -> NaN Invalid_operation
-orx865 or NaN5 +NaN6 -> NaN Invalid_operation
-orx866 or -Inf NaN7 -> NaN Invalid_operation
-orx867 or -1000 NaN8 -> NaN Invalid_operation
-orx868 or 1000 NaN9 -> NaN Invalid_operation
-orx869 or Inf +NaN10 -> NaN Invalid_operation
-orx871 or sNaN11 -Inf -> NaN Invalid_operation
-orx872 or sNaN12 -1000 -> NaN Invalid_operation
-orx873 or sNaN13 1000 -> NaN Invalid_operation
-orx874 or sNaN14 NaN17 -> NaN Invalid_operation
-orx875 or sNaN15 sNaN18 -> NaN Invalid_operation
-orx876 or NaN16 sNaN19 -> NaN Invalid_operation
-orx877 or -Inf +sNaN20 -> NaN Invalid_operation
-orx878 or -1000 sNaN21 -> NaN Invalid_operation
-orx879 or 1000 sNaN22 -> NaN Invalid_operation
-orx880 or Inf sNaN23 -> NaN Invalid_operation
-orx881 or +NaN25 +sNaN24 -> NaN Invalid_operation
-orx882 or -NaN26 NaN28 -> NaN Invalid_operation
-orx883 or -sNaN27 sNaN29 -> NaN Invalid_operation
-orx884 or 1000 -NaN30 -> NaN Invalid_operation
-orx885 or 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- or.decTest -- digitwise logical OR --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check (truth table)
+orx001 or 0 0 -> 0
+orx002 or 0 1 -> 1
+orx003 or 1 0 -> 1
+orx004 or 1 1 -> 1
+orx005 or 1100 1010 -> 1110
+-- and at msd and msd-1
+orx006 or 000000000 000000000 -> 0
+orx007 or 000000000 100000000 -> 100000000
+orx008 or 100000000 000000000 -> 100000000
+orx009 or 100000000 100000000 -> 100000000
+orx010 or 000000000 000000000 -> 0
+orx011 or 000000000 010000000 -> 10000000
+orx012 or 010000000 000000000 -> 10000000
+orx013 or 010000000 010000000 -> 10000000
+
+-- Various lengths
+-- 123456789 123456789 123456789
+orx021 or 111111111 111111111 -> 111111111
+orx022 or 111111111111 111111111 -> 111111111
+orx023 or 11111111 11111111 -> 11111111
+orx025 or 1111111 1111111 -> 1111111
+orx026 or 111111 111111 -> 111111
+orx027 or 11111 11111 -> 11111
+orx028 or 1111 1111 -> 1111
+orx029 or 111 111 -> 111
+orx031 or 11 11 -> 11
+orx032 or 1 1 -> 1
+orx033 or 111111111111 1111111111 -> 111111111
+orx034 or 11111111111 11111111111 -> 111111111
+orx035 or 1111111111 111111111111 -> 111111111
+orx036 or 111111111 1111111111111 -> 111111111
+
+orx040 or 111111111 111111111111 -> 111111111
+orx041 or 11111111 111111111111 -> 111111111
+orx042 or 11111111 111111111 -> 111111111
+orx043 or 1111111 100000010 -> 101111111
+orx044 or 111111 100000100 -> 100111111
+orx045 or 11111 100001000 -> 100011111
+orx046 or 1111 100010000 -> 100011111
+orx047 or 111 100100000 -> 100100111
+orx048 or 11 101000000 -> 101000011
+orx049 or 1 110000000 -> 110000001
+
+orx050 or 1111111111 1 -> 111111111
+orx051 or 111111111 1 -> 111111111
+orx052 or 11111111 1 -> 11111111
+orx053 or 1111111 1 -> 1111111
+orx054 or 111111 1 -> 111111
+orx055 or 11111 1 -> 11111
+orx056 or 1111 1 -> 1111
+orx057 or 111 1 -> 111
+orx058 or 11 1 -> 11
+orx059 or 1 1 -> 1
+
+orx060 or 1111111111 0 -> 111111111
+orx061 or 111111111 0 -> 111111111
+orx062 or 11111111 0 -> 11111111
+orx063 or 1111111 0 -> 1111111
+orx064 or 111111 0 -> 111111
+orx065 or 11111 0 -> 11111
+orx066 or 1111 0 -> 1111
+orx067 or 111 0 -> 111
+orx068 or 11 0 -> 11
+orx069 or 1 0 -> 1
+
+orx070 or 1 1111111111 -> 111111111
+orx071 or 1 111111111 -> 111111111
+orx072 or 1 11111111 -> 11111111
+orx073 or 1 1111111 -> 1111111
+orx074 or 1 111111 -> 111111
+orx075 or 1 11111 -> 11111
+orx076 or 1 1111 -> 1111
+orx077 or 1 111 -> 111
+orx078 or 1 11 -> 11
+orx079 or 1 1 -> 1
+
+orx080 or 0 1111111111 -> 111111111
+orx081 or 0 111111111 -> 111111111
+orx082 or 0 11111111 -> 11111111
+orx083 or 0 1111111 -> 1111111
+orx084 or 0 111111 -> 111111
+orx085 or 0 11111 -> 11111
+orx086 or 0 1111 -> 1111
+orx087 or 0 111 -> 111
+orx088 or 0 11 -> 11
+orx089 or 0 1 -> 1
+
+orx090 or 011111111 111101111 -> 111111111
+orx091 or 101111111 111101111 -> 111111111
+orx092 or 110111111 111101111 -> 111111111
+orx093 or 111011111 111101111 -> 111111111
+orx094 or 111101111 111101111 -> 111101111
+orx095 or 111110111 111101111 -> 111111111
+orx096 or 111111011 111101111 -> 111111111
+orx097 or 111111101 111101111 -> 111111111
+orx098 or 111111110 111101111 -> 111111111
+
+orx100 or 111101111 011111111 -> 111111111
+orx101 or 111101111 101111111 -> 111111111
+orx102 or 111101111 110111111 -> 111111111
+orx103 or 111101111 111011111 -> 111111111
+orx104 or 111101111 111101111 -> 111101111
+orx105 or 111101111 111110111 -> 111111111
+orx106 or 111101111 111111011 -> 111111111
+orx107 or 111101111 111111101 -> 111111111
+orx108 or 111101111 111111110 -> 111111111
+
+-- non-0/1 should not be accepted, nor should signs
+orx220 or 111111112 111111111 -> NaN Invalid_operation
+orx221 or 333333333 333333333 -> NaN Invalid_operation
+orx222 or 555555555 555555555 -> NaN Invalid_operation
+orx223 or 777777777 777777777 -> NaN Invalid_operation
+orx224 or 999999999 999999999 -> NaN Invalid_operation
+orx225 or 222222222 999999999 -> NaN Invalid_operation
+orx226 or 444444444 999999999 -> NaN Invalid_operation
+orx227 or 666666666 999999999 -> NaN Invalid_operation
+orx228 or 888888888 999999999 -> NaN Invalid_operation
+orx229 or 999999999 222222222 -> NaN Invalid_operation
+orx230 or 999999999 444444444 -> NaN Invalid_operation
+orx231 or 999999999 666666666 -> NaN Invalid_operation
+orx232 or 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+orx240 or 567468689 -934981942 -> NaN Invalid_operation
+orx241 or 567367689 934981942 -> NaN Invalid_operation
+orx242 or -631917772 -706014634 -> NaN Invalid_operation
+orx243 or -756253257 138579234 -> NaN Invalid_operation
+orx244 or 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+orx250 or 200000000 100000000 -> NaN Invalid_operation
+orx251 or 700000000 100000000 -> NaN Invalid_operation
+orx252 or 800000000 100000000 -> NaN Invalid_operation
+orx253 or 900000000 100000000 -> NaN Invalid_operation
+orx254 or 200000000 000000000 -> NaN Invalid_operation
+orx255 or 700000000 000000000 -> NaN Invalid_operation
+orx256 or 800000000 000000000 -> NaN Invalid_operation
+orx257 or 900000000 000000000 -> NaN Invalid_operation
+orx258 or 100000000 200000000 -> NaN Invalid_operation
+orx259 or 100000000 700000000 -> NaN Invalid_operation
+orx260 or 100000000 800000000 -> NaN Invalid_operation
+orx261 or 100000000 900000000 -> NaN Invalid_operation
+orx262 or 000000000 200000000 -> NaN Invalid_operation
+orx263 or 000000000 700000000 -> NaN Invalid_operation
+orx264 or 000000000 800000000 -> NaN Invalid_operation
+orx265 or 000000000 900000000 -> NaN Invalid_operation
+-- test MSD-1
+orx270 or 020000000 100000000 -> NaN Invalid_operation
+orx271 or 070100000 100000000 -> NaN Invalid_operation
+orx272 or 080010000 100000001 -> NaN Invalid_operation
+orx273 or 090001000 100000010 -> NaN Invalid_operation
+orx274 or 100000100 020010100 -> NaN Invalid_operation
+orx275 or 100000000 070001000 -> NaN Invalid_operation
+orx276 or 100000010 080010100 -> NaN Invalid_operation
+orx277 or 100000000 090000010 -> NaN Invalid_operation
+-- test LSD
+orx280 or 001000002 100000000 -> NaN Invalid_operation
+orx281 or 000000007 100000000 -> NaN Invalid_operation
+orx282 or 000000008 100000000 -> NaN Invalid_operation
+orx283 or 000000009 100000000 -> NaN Invalid_operation
+orx284 or 100000000 000100002 -> NaN Invalid_operation
+orx285 or 100100000 001000007 -> NaN Invalid_operation
+orx286 or 100010000 010000008 -> NaN Invalid_operation
+orx287 or 100001000 100000009 -> NaN Invalid_operation
+-- test Middie
+orx288 or 001020000 100000000 -> NaN Invalid_operation
+orx289 or 000070001 100000000 -> NaN Invalid_operation
+orx290 or 000080000 100010000 -> NaN Invalid_operation
+orx291 or 000090000 100001000 -> NaN Invalid_operation
+orx292 or 100000010 000020100 -> NaN Invalid_operation
+orx293 or 100100000 000070010 -> NaN Invalid_operation
+orx294 or 100010100 000080001 -> NaN Invalid_operation
+orx295 or 100001000 000090000 -> NaN Invalid_operation
+-- signs
+orx296 or -100001000 -000000000 -> NaN Invalid_operation
+orx297 or -100001000 000010000 -> NaN Invalid_operation
+orx298 or 100001000 -000000000 -> NaN Invalid_operation
+orx299 or 100001000 000011000 -> 100011000
+
+-- Nmax, Nmin, Ntiny
+orx331 or 2 9.99999999E+999 -> NaN Invalid_operation
+orx332 or 3 1E-999 -> NaN Invalid_operation
+orx333 or 4 1.00000000E-999 -> NaN Invalid_operation
+orx334 or 5 1E-1007 -> NaN Invalid_operation
+orx335 or 6 -1E-1007 -> NaN Invalid_operation
+orx336 or 7 -1.00000000E-999 -> NaN Invalid_operation
+orx337 or 8 -1E-999 -> NaN Invalid_operation
+orx338 or 9 -9.99999999E+999 -> NaN Invalid_operation
+orx341 or 9.99999999E+999 -18 -> NaN Invalid_operation
+orx342 or 1E-999 01 -> NaN Invalid_operation
+orx343 or 1.00000000E-999 -18 -> NaN Invalid_operation
+orx344 or 1E-1007 18 -> NaN Invalid_operation
+orx345 or -1E-1007 -10 -> NaN Invalid_operation
+orx346 or -1.00000000E-999 18 -> NaN Invalid_operation
+orx347 or -1E-999 10 -> NaN Invalid_operation
+orx348 or -9.99999999E+999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+orx361 or 1.0 1 -> NaN Invalid_operation
+orx362 or 1E+1 1 -> NaN Invalid_operation
+orx363 or 0.0 1 -> NaN Invalid_operation
+orx364 or 0E+1 1 -> NaN Invalid_operation
+orx365 or 9.9 1 -> NaN Invalid_operation
+orx366 or 9E+1 1 -> NaN Invalid_operation
+orx371 or 0 1.0 -> NaN Invalid_operation
+orx372 or 0 1E+1 -> NaN Invalid_operation
+orx373 or 0 0.0 -> NaN Invalid_operation
+orx374 or 0 0E+1 -> NaN Invalid_operation
+orx375 or 0 9.9 -> NaN Invalid_operation
+orx376 or 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+orx780 or -Inf -Inf -> NaN Invalid_operation
+orx781 or -Inf -1000 -> NaN Invalid_operation
+orx782 or -Inf -1 -> NaN Invalid_operation
+orx783 or -Inf -0 -> NaN Invalid_operation
+orx784 or -Inf 0 -> NaN Invalid_operation
+orx785 or -Inf 1 -> NaN Invalid_operation
+orx786 or -Inf 1000 -> NaN Invalid_operation
+orx787 or -1000 -Inf -> NaN Invalid_operation
+orx788 or -Inf -Inf -> NaN Invalid_operation
+orx789 or -1 -Inf -> NaN Invalid_operation
+orx790 or -0 -Inf -> NaN Invalid_operation
+orx791 or 0 -Inf -> NaN Invalid_operation
+orx792 or 1 -Inf -> NaN Invalid_operation
+orx793 or 1000 -Inf -> NaN Invalid_operation
+orx794 or Inf -Inf -> NaN Invalid_operation
+
+orx800 or Inf -Inf -> NaN Invalid_operation
+orx801 or Inf -1000 -> NaN Invalid_operation
+orx802 or Inf -1 -> NaN Invalid_operation
+orx803 or Inf -0 -> NaN Invalid_operation
+orx804 or Inf 0 -> NaN Invalid_operation
+orx805 or Inf 1 -> NaN Invalid_operation
+orx806 or Inf 1000 -> NaN Invalid_operation
+orx807 or Inf Inf -> NaN Invalid_operation
+orx808 or -1000 Inf -> NaN Invalid_operation
+orx809 or -Inf Inf -> NaN Invalid_operation
+orx810 or -1 Inf -> NaN Invalid_operation
+orx811 or -0 Inf -> NaN Invalid_operation
+orx812 or 0 Inf -> NaN Invalid_operation
+orx813 or 1 Inf -> NaN Invalid_operation
+orx814 or 1000 Inf -> NaN Invalid_operation
+orx815 or Inf Inf -> NaN Invalid_operation
+
+orx821 or NaN -Inf -> NaN Invalid_operation
+orx822 or NaN -1000 -> NaN Invalid_operation
+orx823 or NaN -1 -> NaN Invalid_operation
+orx824 or NaN -0 -> NaN Invalid_operation
+orx825 or NaN 0 -> NaN Invalid_operation
+orx826 or NaN 1 -> NaN Invalid_operation
+orx827 or NaN 1000 -> NaN Invalid_operation
+orx828 or NaN Inf -> NaN Invalid_operation
+orx829 or NaN NaN -> NaN Invalid_operation
+orx830 or -Inf NaN -> NaN Invalid_operation
+orx831 or -1000 NaN -> NaN Invalid_operation
+orx832 or -1 NaN -> NaN Invalid_operation
+orx833 or -0 NaN -> NaN Invalid_operation
+orx834 or 0 NaN -> NaN Invalid_operation
+orx835 or 1 NaN -> NaN Invalid_operation
+orx836 or 1000 NaN -> NaN Invalid_operation
+orx837 or Inf NaN -> NaN Invalid_operation
+
+orx841 or sNaN -Inf -> NaN Invalid_operation
+orx842 or sNaN -1000 -> NaN Invalid_operation
+orx843 or sNaN -1 -> NaN Invalid_operation
+orx844 or sNaN -0 -> NaN Invalid_operation
+orx845 or sNaN 0 -> NaN Invalid_operation
+orx846 or sNaN 1 -> NaN Invalid_operation
+orx847 or sNaN 1000 -> NaN Invalid_operation
+orx848 or sNaN NaN -> NaN Invalid_operation
+orx849 or sNaN sNaN -> NaN Invalid_operation
+orx850 or NaN sNaN -> NaN Invalid_operation
+orx851 or -Inf sNaN -> NaN Invalid_operation
+orx852 or -1000 sNaN -> NaN Invalid_operation
+orx853 or -1 sNaN -> NaN Invalid_operation
+orx854 or -0 sNaN -> NaN Invalid_operation
+orx855 or 0 sNaN -> NaN Invalid_operation
+orx856 or 1 sNaN -> NaN Invalid_operation
+orx857 or 1000 sNaN -> NaN Invalid_operation
+orx858 or Inf sNaN -> NaN Invalid_operation
+orx859 or NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+orx861 or NaN1 -Inf -> NaN Invalid_operation
+orx862 or +NaN2 -1000 -> NaN Invalid_operation
+orx863 or NaN3 1000 -> NaN Invalid_operation
+orx864 or NaN4 Inf -> NaN Invalid_operation
+orx865 or NaN5 +NaN6 -> NaN Invalid_operation
+orx866 or -Inf NaN7 -> NaN Invalid_operation
+orx867 or -1000 NaN8 -> NaN Invalid_operation
+orx868 or 1000 NaN9 -> NaN Invalid_operation
+orx869 or Inf +NaN10 -> NaN Invalid_operation
+orx871 or sNaN11 -Inf -> NaN Invalid_operation
+orx872 or sNaN12 -1000 -> NaN Invalid_operation
+orx873 or sNaN13 1000 -> NaN Invalid_operation
+orx874 or sNaN14 NaN17 -> NaN Invalid_operation
+orx875 or sNaN15 sNaN18 -> NaN Invalid_operation
+orx876 or NaN16 sNaN19 -> NaN Invalid_operation
+orx877 or -Inf +sNaN20 -> NaN Invalid_operation
+orx878 or -1000 sNaN21 -> NaN Invalid_operation
+orx879 or 1000 sNaN22 -> NaN Invalid_operation
+orx880 or Inf sNaN23 -> NaN Invalid_operation
+orx881 or +NaN25 +sNaN24 -> NaN Invalid_operation
+orx882 or -NaN26 NaN28 -> NaN Invalid_operation
+orx883 or -sNaN27 sNaN29 -> NaN Invalid_operation
+orx884 or 1000 -NaN30 -> NaN Invalid_operation
+orx885 or 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/powersqrt.decTest b/Lib/test/decimaltestdata/powersqrt.decTest
index 260b941537..6c021a0cbb 100644
--- a/Lib/test/decimaltestdata/powersqrt.decTest
+++ b/Lib/test/decimaltestdata/powersqrt.decTest
@@ -1,2970 +1,2970 @@
-------------------------------------------------------------------------
--- powersqrt.decTest -- decimal square root, using power --
--- Copyright (c) IBM Corporation, 2004, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- These testcases are taken from squareroot.decTest but are
--- evaluated using the power operator. The differences in results
--- (153 out of 2856) fall into the following categories:
---
--- x ** 0.5 (x>0) has no preferred exponent, and is Inexact
--- (and hence full precision); almost all differences are
--- in this category
--- 0.00 ** 0.5 becomes 0 (not 0.0), etc.
--- -0 ** 0.5 becomes 0 (never -0)
--- Some exact subnormals become inexact and hence underflows
-
-extended: 1
-precision: 9
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- basics
-pwsx001 power 1 0.5 -> 1.00000000 Inexact Rounded
-pwsx002 power -1 0.5 -> NaN Invalid_operation
-pwsx003 power 1.00 0.5 -> 1.00000000 Inexact Rounded
-pwsx004 power -1.00 0.5 -> NaN Invalid_operation
-pwsx005 power 0 0.5 -> 0
-pwsx006 power 00.0 0.5 -> 0
-pwsx007 power 0.00 0.5 -> 0
-pwsx008 power 00.00 0.5 -> 0
-pwsx009 power 00.000 0.5 -> 0
-pwsx010 power 00.0000 0.5 -> 0
-pwsx011 power 00 0.5 -> 0
-
-pwsx012 power -2 0.5 -> NaN Invalid_operation
-pwsx013 power 2 0.5 -> 1.41421356 Inexact Rounded
-pwsx014 power -2.00 0.5 -> NaN Invalid_operation
-pwsx015 power 2.00 0.5 -> 1.41421356 Inexact Rounded
-pwsx016 power -0 0.5 -> 0
-pwsx017 power -0.0 0.5 -> 0
-pwsx018 power -00.00 0.5 -> 0
-pwsx019 power -00.000 0.5 -> 0
-pwsx020 power -0.0000 0.5 -> 0
-pwsx021 power -0E+9 0.5 -> 0
-pwsx022 power -0E+10 0.5 -> 0
-pwsx023 power -0E+11 0.5 -> 0
-pwsx024 power -0E+12 0.5 -> 0
-pwsx025 power -00 0.5 -> 0
-pwsx026 power 0E+5 0.5 -> 0
-pwsx027 power 4.0 0.5 -> 2.00000000 Inexact Rounded
-pwsx028 power 4.00 0.5 -> 2.00000000 Inexact Rounded
-
-pwsx030 power +0.1 0.5 -> 0.316227766 Inexact Rounded
-pwsx031 power -0.1 0.5 -> NaN Invalid_operation
-pwsx032 power +0.01 0.5 -> 0.100000000 Inexact Rounded
-pwsx033 power -0.01 0.5 -> NaN Invalid_operation
-pwsx034 power +0.001 0.5 -> 0.0316227766 Inexact Rounded
-pwsx035 power -0.001 0.5 -> NaN Invalid_operation
-pwsx036 power +0.000001 0.5 -> 0.00100000000 Inexact Rounded
-pwsx037 power -0.000001 0.5 -> NaN Invalid_operation
-pwsx038 power +0.000000000001 0.5 -> 0.00000100000000 Inexact Rounded
-pwsx039 power -0.000000000001 0.5 -> NaN Invalid_operation
-
-pwsx041 power 1.1 0.5 -> 1.04880885 Inexact Rounded
-pwsx042 power 1.10 0.5 -> 1.04880885 Inexact Rounded
-pwsx043 power 1.100 0.5 -> 1.04880885 Inexact Rounded
-pwsx044 power 1.110 0.5 -> 1.05356538 Inexact Rounded
-pwsx045 power -1.1 0.5 -> NaN Invalid_operation
-pwsx046 power -1.10 0.5 -> NaN Invalid_operation
-pwsx047 power -1.100 0.5 -> NaN Invalid_operation
-pwsx048 power -1.110 0.5 -> NaN Invalid_operation
-pwsx049 power 9.9 0.5 -> 3.14642654 Inexact Rounded
-pwsx050 power 9.90 0.5 -> 3.14642654 Inexact Rounded
-pwsx051 power 9.900 0.5 -> 3.14642654 Inexact Rounded
-pwsx052 power 9.990 0.5 -> 3.16069613 Inexact Rounded
-pwsx053 power -9.9 0.5 -> NaN Invalid_operation
-pwsx054 power -9.90 0.5 -> NaN Invalid_operation
-pwsx055 power -9.900 0.5 -> NaN Invalid_operation
-pwsx056 power -9.990 0.5 -> NaN Invalid_operation
-
-pwsx060 power 1 0.5 -> 1.00000000 Inexact Rounded
-pwsx061 power 1.0 0.5 -> 1.00000000 Inexact Rounded
-pwsx062 power 1.00 0.5 -> 1.00000000 Inexact Rounded
-pwsx063 power 10.0 0.5 -> 3.16227766 Inexact Rounded
-pwsx064 power 10.0 0.5 -> 3.16227766 Inexact Rounded
-pwsx065 power 10.0 0.5 -> 3.16227766 Inexact Rounded
-pwsx066 power 10.00 0.5 -> 3.16227766 Inexact Rounded
-pwsx067 power 100 0.5 -> 10.0000000 Inexact Rounded
-pwsx068 power 100.0 0.5 -> 10.0000000 Inexact Rounded
-pwsx069 power 100.00 0.5 -> 10.0000000 Inexact Rounded
-pwsx070 power 1.1000E+3 0.5 -> 33.1662479 Inexact Rounded
-pwsx071 power 1.10000E+3 0.5 -> 33.1662479 Inexact Rounded
-pwsx072 power -10.0 0.5 -> NaN Invalid_operation
-pwsx073 power -10.00 0.5 -> NaN Invalid_operation
-pwsx074 power -100.0 0.5 -> NaN Invalid_operation
-pwsx075 power -100.00 0.5 -> NaN Invalid_operation
-pwsx076 power -1.1000E+3 0.5 -> NaN Invalid_operation
-pwsx077 power -1.10000E+3 0.5 -> NaN Invalid_operation
-
--- famous squares
-pwsx080 power 1 0.5 -> 1.00000000 Inexact Rounded
-pwsx081 power 4 0.5 -> 2.00000000 Inexact Rounded
-pwsx082 power 9 0.5 -> 3.00000000 Inexact Rounded
-pwsx083 power 16 0.5 -> 4.00000000 Inexact Rounded
-pwsx084 power 25 0.5 -> 5.00000000 Inexact Rounded
-pwsx085 power 36 0.5 -> 6.00000000 Inexact Rounded
-pwsx086 power 49 0.5 -> 7.00000000 Inexact Rounded
-pwsx087 power 64 0.5 -> 8.00000000 Inexact Rounded
-pwsx088 power 81 0.5 -> 9.00000000 Inexact Rounded
-pwsx089 power 100 0.5 -> 10.0000000 Inexact Rounded
-pwsx090 power 121 0.5 -> 11.0000000 Inexact Rounded
-pwsx091 power 144 0.5 -> 12.0000000 Inexact Rounded
-pwsx092 power 169 0.5 -> 13.0000000 Inexact Rounded
-pwsx093 power 256 0.5 -> 16.0000000 Inexact Rounded
-pwsx094 power 1024 0.5 -> 32.0000000 Inexact Rounded
-pwsx095 power 4096 0.5 -> 64.0000000 Inexact Rounded
-pwsx100 power 0.01 0.5 -> 0.100000000 Inexact Rounded
-pwsx101 power 0.04 0.5 -> 0.200000000 Inexact Rounded
-pwsx102 power 0.09 0.5 -> 0.300000000 Inexact Rounded
-pwsx103 power 0.16 0.5 -> 0.400000000 Inexact Rounded
-pwsx104 power 0.25 0.5 -> 0.500000000 Inexact Rounded
-pwsx105 power 0.36 0.5 -> 0.600000000 Inexact Rounded
-pwsx106 power 0.49 0.5 -> 0.700000000 Inexact Rounded
-pwsx107 power 0.64 0.5 -> 0.800000000 Inexact Rounded
-pwsx108 power 0.81 0.5 -> 0.900000000 Inexact Rounded
-pwsx109 power 1.00 0.5 -> 1.00000000 Inexact Rounded
-pwsx110 power 1.21 0.5 -> 1.10000000 Inexact Rounded
-pwsx111 power 1.44 0.5 -> 1.20000000 Inexact Rounded
-pwsx112 power 1.69 0.5 -> 1.30000000 Inexact Rounded
-pwsx113 power 2.56 0.5 -> 1.60000000 Inexact Rounded
-pwsx114 power 10.24 0.5 -> 3.20000000 Inexact Rounded
-pwsx115 power 40.96 0.5 -> 6.40000000 Inexact Rounded
-
--- Precision 1 squareroot tests [exhaustive, plus exponent adjusts]
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-precision: 1
-pwsx1201 power 0.1 0.5 -> 0.3 Inexact Rounded
-pwsx1202 power 0.01 0.5 -> 0.1 Inexact Rounded
-pwsx1203 power 1.0E-1 0.5 -> 0.3 Inexact Rounded
-pwsx1204 power 1.00E-2 0.5 -> 0.1 Inexact Rounded
-pwsx1205 power 1E-3 0.5 -> 0.03 Inexact Rounded
-pwsx1206 power 1E+1 0.5 -> 3 Inexact Rounded
-pwsx1207 power 1E+2 0.5 -> 1E+1 Inexact Rounded
-pwsx1208 power 1E+3 0.5 -> 3E+1 Inexact Rounded
-pwsx1209 power 0.2 0.5 -> 0.4 Inexact Rounded
-pwsx1210 power 0.02 0.5 -> 0.1 Inexact Rounded
-pwsx1211 power 2.0E-1 0.5 -> 0.4 Inexact Rounded
-pwsx1212 power 2.00E-2 0.5 -> 0.1 Inexact Rounded
-pwsx1213 power 2E-3 0.5 -> 0.04 Inexact Rounded
-pwsx1214 power 2E+1 0.5 -> 4 Inexact Rounded
-pwsx1215 power 2E+2 0.5 -> 1E+1 Inexact Rounded
-pwsx1216 power 2E+3 0.5 -> 4E+1 Inexact Rounded
-pwsx1217 power 0.3 0.5 -> 0.5 Inexact Rounded
-pwsx1218 power 0.03 0.5 -> 0.2 Inexact Rounded
-pwsx1219 power 3.0E-1 0.5 -> 0.5 Inexact Rounded
-pwsx1220 power 3.00E-2 0.5 -> 0.2 Inexact Rounded
-pwsx1221 power 3E-3 0.5 -> 0.05 Inexact Rounded
-pwsx1222 power 3E+1 0.5 -> 5 Inexact Rounded
-pwsx1223 power 3E+2 0.5 -> 2E+1 Inexact Rounded
-pwsx1224 power 3E+3 0.5 -> 5E+1 Inexact Rounded
-pwsx1225 power 0.4 0.5 -> 0.6 Inexact Rounded
-pwsx1226 power 0.04 0.5 -> 0.2 Inexact Rounded
-pwsx1227 power 4.0E-1 0.5 -> 0.6 Inexact Rounded
-pwsx1228 power 4.00E-2 0.5 -> 0.2 Inexact Rounded
-pwsx1229 power 4E-3 0.5 -> 0.06 Inexact Rounded
-pwsx1230 power 4E+1 0.5 -> 6 Inexact Rounded
-pwsx1231 power 4E+2 0.5 -> 2E+1 Inexact Rounded
-pwsx1232 power 4E+3 0.5 -> 6E+1 Inexact Rounded
-pwsx1233 power 0.5 0.5 -> 0.7 Inexact Rounded
-pwsx1234 power 0.05 0.5 -> 0.2 Inexact Rounded
-pwsx1235 power 5.0E-1 0.5 -> 0.7 Inexact Rounded
-pwsx1236 power 5.00E-2 0.5 -> 0.2 Inexact Rounded
-pwsx1237 power 5E-3 0.5 -> 0.07 Inexact Rounded
-pwsx1238 power 5E+1 0.5 -> 7 Inexact Rounded
-pwsx1239 power 5E+2 0.5 -> 2E+1 Inexact Rounded
-pwsx1240 power 5E+3 0.5 -> 7E+1 Inexact Rounded
-pwsx1241 power 0.6 0.5 -> 0.8 Inexact Rounded
-pwsx1242 power 0.06 0.5 -> 0.2 Inexact Rounded
-pwsx1243 power 6.0E-1 0.5 -> 0.8 Inexact Rounded
-pwsx1244 power 6.00E-2 0.5 -> 0.2 Inexact Rounded
-pwsx1245 power 6E-3 0.5 -> 0.08 Inexact Rounded
-pwsx1246 power 6E+1 0.5 -> 8 Inexact Rounded
-pwsx1247 power 6E+2 0.5 -> 2E+1 Inexact Rounded
-pwsx1248 power 6E+3 0.5 -> 8E+1 Inexact Rounded
-pwsx1249 power 0.7 0.5 -> 0.8 Inexact Rounded
-pwsx1250 power 0.07 0.5 -> 0.3 Inexact Rounded
-pwsx1251 power 7.0E-1 0.5 -> 0.8 Inexact Rounded
-pwsx1252 power 7.00E-2 0.5 -> 0.3 Inexact Rounded
-pwsx1253 power 7E-3 0.5 -> 0.08 Inexact Rounded
-pwsx1254 power 7E+1 0.5 -> 8 Inexact Rounded
-pwsx1255 power 7E+2 0.5 -> 3E+1 Inexact Rounded
-pwsx1256 power 7E+3 0.5 -> 8E+1 Inexact Rounded
-pwsx1257 power 0.8 0.5 -> 0.9 Inexact Rounded
-pwsx1258 power 0.08 0.5 -> 0.3 Inexact Rounded
-pwsx1259 power 8.0E-1 0.5 -> 0.9 Inexact Rounded
-pwsx1260 power 8.00E-2 0.5 -> 0.3 Inexact Rounded
-pwsx1261 power 8E-3 0.5 -> 0.09 Inexact Rounded
-pwsx1262 power 8E+1 0.5 -> 9 Inexact Rounded
-pwsx1263 power 8E+2 0.5 -> 3E+1 Inexact Rounded
-pwsx1264 power 8E+3 0.5 -> 9E+1 Inexact Rounded
-pwsx1265 power 0.9 0.5 -> 0.9 Inexact Rounded
-pwsx1266 power 0.09 0.5 -> 0.3 Inexact Rounded
-pwsx1267 power 9.0E-1 0.5 -> 0.9 Inexact Rounded
-pwsx1268 power 9.00E-2 0.5 -> 0.3 Inexact Rounded
-pwsx1269 power 9E-3 0.5 -> 0.09 Inexact Rounded
-pwsx1270 power 9E+1 0.5 -> 9 Inexact Rounded
-pwsx1271 power 9E+2 0.5 -> 3E+1 Inexact Rounded
-pwsx1272 power 9E+3 0.5 -> 9E+1 Inexact Rounded
-
--- Precision 2 squareroot tests [exhaustive, plus exponent adjusts]
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-precision: 2
-pwsx2201 power 0.1 0.5 -> 0.32 Inexact Rounded
-pwsx2202 power 0.01 0.5 -> 0.10 Inexact Rounded
-pwsx2203 power 1.0E-1 0.5 -> 0.32 Inexact Rounded
-pwsx2204 power 1.00E-2 0.5 -> 0.10 Inexact Rounded
-pwsx2205 power 1E-3 0.5 -> 0.032 Inexact Rounded
-pwsx2206 power 1E+1 0.5 -> 3.2 Inexact Rounded
-pwsx2207 power 1E+2 0.5 -> 10 Inexact Rounded
-pwsx2208 power 1E+3 0.5 -> 32 Inexact Rounded
-pwsx2209 power 0.2 0.5 -> 0.45 Inexact Rounded
-pwsx2210 power 0.02 0.5 -> 0.14 Inexact Rounded
-pwsx2211 power 2.0E-1 0.5 -> 0.45 Inexact Rounded
-pwsx2212 power 2.00E-2 0.5 -> 0.14 Inexact Rounded
-pwsx2213 power 2E-3 0.5 -> 0.045 Inexact Rounded
-pwsx2214 power 2E+1 0.5 -> 4.5 Inexact Rounded
-pwsx2215 power 2E+2 0.5 -> 14 Inexact Rounded
-pwsx2216 power 2E+3 0.5 -> 45 Inexact Rounded
-pwsx2217 power 0.3 0.5 -> 0.55 Inexact Rounded
-pwsx2218 power 0.03 0.5 -> 0.17 Inexact Rounded
-pwsx2219 power 3.0E-1 0.5 -> 0.55 Inexact Rounded
-pwsx2220 power 3.00E-2 0.5 -> 0.17 Inexact Rounded
-pwsx2221 power 3E-3 0.5 -> 0.055 Inexact Rounded
-pwsx2222 power 3E+1 0.5 -> 5.5 Inexact Rounded
-pwsx2223 power 3E+2 0.5 -> 17 Inexact Rounded
-pwsx2224 power 3E+3 0.5 -> 55 Inexact Rounded
-pwsx2225 power 0.4 0.5 -> 0.63 Inexact Rounded
-pwsx2226 power 0.04 0.5 -> 0.20 Inexact Rounded
-pwsx2227 power 4.0E-1 0.5 -> 0.63 Inexact Rounded
-pwsx2228 power 4.00E-2 0.5 -> 0.20 Inexact Rounded
-pwsx2229 power 4E-3 0.5 -> 0.063 Inexact Rounded
-pwsx2230 power 4E+1 0.5 -> 6.3 Inexact Rounded
-pwsx2231 power 4E+2 0.5 -> 20 Inexact Rounded
-pwsx2232 power 4E+3 0.5 -> 63 Inexact Rounded
-pwsx2233 power 0.5 0.5 -> 0.71 Inexact Rounded
-pwsx2234 power 0.05 0.5 -> 0.22 Inexact Rounded
-pwsx2235 power 5.0E-1 0.5 -> 0.71 Inexact Rounded
-pwsx2236 power 5.00E-2 0.5 -> 0.22 Inexact Rounded
-pwsx2237 power 5E-3 0.5 -> 0.071 Inexact Rounded
-pwsx2238 power 5E+1 0.5 -> 7.1 Inexact Rounded
-pwsx2239 power 5E+2 0.5 -> 22 Inexact Rounded
-pwsx2240 power 5E+3 0.5 -> 71 Inexact Rounded
-pwsx2241 power 0.6 0.5 -> 0.77 Inexact Rounded
-pwsx2242 power 0.06 0.5 -> 0.24 Inexact Rounded
-pwsx2243 power 6.0E-1 0.5 -> 0.77 Inexact Rounded
-pwsx2244 power 6.00E-2 0.5 -> 0.24 Inexact Rounded
-pwsx2245 power 6E-3 0.5 -> 0.077 Inexact Rounded
-pwsx2246 power 6E+1 0.5 -> 7.7 Inexact Rounded
-pwsx2247 power 6E+2 0.5 -> 24 Inexact Rounded
-pwsx2248 power 6E+3 0.5 -> 77 Inexact Rounded
-pwsx2249 power 0.7 0.5 -> 0.84 Inexact Rounded
-pwsx2250 power 0.07 0.5 -> 0.26 Inexact Rounded
-pwsx2251 power 7.0E-1 0.5 -> 0.84 Inexact Rounded
-pwsx2252 power 7.00E-2 0.5 -> 0.26 Inexact Rounded
-pwsx2253 power 7E-3 0.5 -> 0.084 Inexact Rounded
-pwsx2254 power 7E+1 0.5 -> 8.4 Inexact Rounded
-pwsx2255 power 7E+2 0.5 -> 26 Inexact Rounded
-pwsx2256 power 7E+3 0.5 -> 84 Inexact Rounded
-pwsx2257 power 0.8 0.5 -> 0.89 Inexact Rounded
-pwsx2258 power 0.08 0.5 -> 0.28 Inexact Rounded
-pwsx2259 power 8.0E-1 0.5 -> 0.89 Inexact Rounded
-pwsx2260 power 8.00E-2 0.5 -> 0.28 Inexact Rounded
-pwsx2261 power 8E-3 0.5 -> 0.089 Inexact Rounded
-pwsx2262 power 8E+1 0.5 -> 8.9 Inexact Rounded
-pwsx2263 power 8E+2 0.5 -> 28 Inexact Rounded
-pwsx2264 power 8E+3 0.5 -> 89 Inexact Rounded
-pwsx2265 power 0.9 0.5 -> 0.95 Inexact Rounded
-pwsx2266 power 0.09 0.5 -> 0.30 Inexact Rounded
-pwsx2267 power 9.0E-1 0.5 -> 0.95 Inexact Rounded
-pwsx2268 power 9.00E-2 0.5 -> 0.30 Inexact Rounded
-pwsx2269 power 9E-3 0.5 -> 0.095 Inexact Rounded
-pwsx2270 power 9E+1 0.5 -> 9.5 Inexact Rounded
-pwsx2271 power 9E+2 0.5 -> 30 Inexact Rounded
-pwsx2272 power 9E+3 0.5 -> 95 Inexact Rounded
-pwsx2273 power 0.10 0.5 -> 0.32 Inexact Rounded
-pwsx2274 power 0.010 0.5 -> 0.10 Inexact Rounded
-pwsx2275 power 10.0E-1 0.5 -> 1.0 Inexact Rounded
-pwsx2276 power 10.00E-2 0.5 -> 0.32 Inexact Rounded
-pwsx2277 power 10E-3 0.5 -> 0.10 Inexact Rounded
-pwsx2278 power 10E+1 0.5 -> 10 Inexact Rounded
-pwsx2279 power 10E+2 0.5 -> 32 Inexact Rounded
-pwsx2280 power 10E+3 0.5 -> 1.0E+2 Inexact Rounded
-pwsx2281 power 0.11 0.5 -> 0.33 Inexact Rounded
-pwsx2282 power 0.011 0.5 -> 0.10 Inexact Rounded
-pwsx2283 power 11.0E-1 0.5 -> 1.0 Inexact Rounded
-pwsx2284 power 11.00E-2 0.5 -> 0.33 Inexact Rounded
-pwsx2285 power 11E-3 0.5 -> 0.10 Inexact Rounded
-pwsx2286 power 11E+1 0.5 -> 10 Inexact Rounded
-pwsx2287 power 11E+2 0.5 -> 33 Inexact Rounded
-pwsx2288 power 11E+3 0.5 -> 1.0E+2 Inexact Rounded
-pwsx2289 power 0.12 0.5 -> 0.35 Inexact Rounded
-pwsx2290 power 0.012 0.5 -> 0.11 Inexact Rounded
-pwsx2291 power 12.0E-1 0.5 -> 1.1 Inexact Rounded
-pwsx2292 power 12.00E-2 0.5 -> 0.35 Inexact Rounded
-pwsx2293 power 12E-3 0.5 -> 0.11 Inexact Rounded
-pwsx2294 power 12E+1 0.5 -> 11 Inexact Rounded
-pwsx2295 power 12E+2 0.5 -> 35 Inexact Rounded
-pwsx2296 power 12E+3 0.5 -> 1.1E+2 Inexact Rounded
-pwsx2297 power 0.13 0.5 -> 0.36 Inexact Rounded
-pwsx2298 power 0.013 0.5 -> 0.11 Inexact Rounded
-pwsx2299 power 13.0E-1 0.5 -> 1.1 Inexact Rounded
-pwsx2300 power 13.00E-2 0.5 -> 0.36 Inexact Rounded
-pwsx2301 power 13E-3 0.5 -> 0.11 Inexact Rounded
-pwsx2302 power 13E+1 0.5 -> 11 Inexact Rounded
-pwsx2303 power 13E+2 0.5 -> 36 Inexact Rounded
-pwsx2304 power 13E+3 0.5 -> 1.1E+2 Inexact Rounded
-pwsx2305 power 0.14 0.5 -> 0.37 Inexact Rounded
-pwsx2306 power 0.014 0.5 -> 0.12 Inexact Rounded
-pwsx2307 power 14.0E-1 0.5 -> 1.2 Inexact Rounded
-pwsx2308 power 14.00E-2 0.5 -> 0.37 Inexact Rounded
-pwsx2309 power 14E-3 0.5 -> 0.12 Inexact Rounded
-pwsx2310 power 14E+1 0.5 -> 12 Inexact Rounded
-pwsx2311 power 14E+2 0.5 -> 37 Inexact Rounded
-pwsx2312 power 14E+3 0.5 -> 1.2E+2 Inexact Rounded
-pwsx2313 power 0.15 0.5 -> 0.39 Inexact Rounded
-pwsx2314 power 0.015 0.5 -> 0.12 Inexact Rounded
-pwsx2315 power 15.0E-1 0.5 -> 1.2 Inexact Rounded
-pwsx2316 power 15.00E-2 0.5 -> 0.39 Inexact Rounded
-pwsx2317 power 15E-3 0.5 -> 0.12 Inexact Rounded
-pwsx2318 power 15E+1 0.5 -> 12 Inexact Rounded
-pwsx2319 power 15E+2 0.5 -> 39 Inexact Rounded
-pwsx2320 power 15E+3 0.5 -> 1.2E+2 Inexact Rounded
-pwsx2321 power 0.16 0.5 -> 0.40 Inexact Rounded
-pwsx2322 power 0.016 0.5 -> 0.13 Inexact Rounded
-pwsx2323 power 16.0E-1 0.5 -> 1.3 Inexact Rounded
-pwsx2324 power 16.00E-2 0.5 -> 0.40 Inexact Rounded
-pwsx2325 power 16E-3 0.5 -> 0.13 Inexact Rounded
-pwsx2326 power 16E+1 0.5 -> 13 Inexact Rounded
-pwsx2327 power 16E+2 0.5 -> 40 Inexact Rounded
-pwsx2328 power 16E+3 0.5 -> 1.3E+2 Inexact Rounded
-pwsx2329 power 0.17 0.5 -> 0.41 Inexact Rounded
-pwsx2330 power 0.017 0.5 -> 0.13 Inexact Rounded
-pwsx2331 power 17.0E-1 0.5 -> 1.3 Inexact Rounded
-pwsx2332 power 17.00E-2 0.5 -> 0.41 Inexact Rounded
-pwsx2333 power 17E-3 0.5 -> 0.13 Inexact Rounded
-pwsx2334 power 17E+1 0.5 -> 13 Inexact Rounded
-pwsx2335 power 17E+2 0.5 -> 41 Inexact Rounded
-pwsx2336 power 17E+3 0.5 -> 1.3E+2 Inexact Rounded
-pwsx2337 power 0.18 0.5 -> 0.42 Inexact Rounded
-pwsx2338 power 0.018 0.5 -> 0.13 Inexact Rounded
-pwsx2339 power 18.0E-1 0.5 -> 1.3 Inexact Rounded
-pwsx2340 power 18.00E-2 0.5 -> 0.42 Inexact Rounded
-pwsx2341 power 18E-3 0.5 -> 0.13 Inexact Rounded
-pwsx2342 power 18E+1 0.5 -> 13 Inexact Rounded
-pwsx2343 power 18E+2 0.5 -> 42 Inexact Rounded
-pwsx2344 power 18E+3 0.5 -> 1.3E+2 Inexact Rounded
-pwsx2345 power 0.19 0.5 -> 0.44 Inexact Rounded
-pwsx2346 power 0.019 0.5 -> 0.14 Inexact Rounded
-pwsx2347 power 19.0E-1 0.5 -> 1.4 Inexact Rounded
-pwsx2348 power 19.00E-2 0.5 -> 0.44 Inexact Rounded
-pwsx2349 power 19E-3 0.5 -> 0.14 Inexact Rounded
-pwsx2350 power 19E+1 0.5 -> 14 Inexact Rounded
-pwsx2351 power 19E+2 0.5 -> 44 Inexact Rounded
-pwsx2352 power 19E+3 0.5 -> 1.4E+2 Inexact Rounded
-pwsx2353 power 0.20 0.5 -> 0.45 Inexact Rounded
-pwsx2354 power 0.020 0.5 -> 0.14 Inexact Rounded
-pwsx2355 power 20.0E-1 0.5 -> 1.4 Inexact Rounded
-pwsx2356 power 20.00E-2 0.5 -> 0.45 Inexact Rounded
-pwsx2357 power 20E-3 0.5 -> 0.14 Inexact Rounded
-pwsx2358 power 20E+1 0.5 -> 14 Inexact Rounded
-pwsx2359 power 20E+2 0.5 -> 45 Inexact Rounded
-pwsx2360 power 20E+3 0.5 -> 1.4E+2 Inexact Rounded
-pwsx2361 power 0.21 0.5 -> 0.46 Inexact Rounded
-pwsx2362 power 0.021 0.5 -> 0.14 Inexact Rounded
-pwsx2363 power 21.0E-1 0.5 -> 1.4 Inexact Rounded
-pwsx2364 power 21.00E-2 0.5 -> 0.46 Inexact Rounded
-pwsx2365 power 21E-3 0.5 -> 0.14 Inexact Rounded
-pwsx2366 power 21E+1 0.5 -> 14 Inexact Rounded
-pwsx2367 power 21E+2 0.5 -> 46 Inexact Rounded
-pwsx2368 power 21E+3 0.5 -> 1.4E+2 Inexact Rounded
-pwsx2369 power 0.22 0.5 -> 0.47 Inexact Rounded
-pwsx2370 power 0.022 0.5 -> 0.15 Inexact Rounded
-pwsx2371 power 22.0E-1 0.5 -> 1.5 Inexact Rounded
-pwsx2372 power 22.00E-2 0.5 -> 0.47 Inexact Rounded
-pwsx2373 power 22E-3 0.5 -> 0.15 Inexact Rounded
-pwsx2374 power 22E+1 0.5 -> 15 Inexact Rounded
-pwsx2375 power 22E+2 0.5 -> 47 Inexact Rounded
-pwsx2376 power 22E+3 0.5 -> 1.5E+2 Inexact Rounded
-pwsx2377 power 0.23 0.5 -> 0.48 Inexact Rounded
-pwsx2378 power 0.023 0.5 -> 0.15 Inexact Rounded
-pwsx2379 power 23.0E-1 0.5 -> 1.5 Inexact Rounded
-pwsx2380 power 23.00E-2 0.5 -> 0.48 Inexact Rounded
-pwsx2381 power 23E-3 0.5 -> 0.15 Inexact Rounded
-pwsx2382 power 23E+1 0.5 -> 15 Inexact Rounded
-pwsx2383 power 23E+2 0.5 -> 48 Inexact Rounded
-pwsx2384 power 23E+3 0.5 -> 1.5E+2 Inexact Rounded
-pwsx2385 power 0.24 0.5 -> 0.49 Inexact Rounded
-pwsx2386 power 0.024 0.5 -> 0.15 Inexact Rounded
-pwsx2387 power 24.0E-1 0.5 -> 1.5 Inexact Rounded
-pwsx2388 power 24.00E-2 0.5 -> 0.49 Inexact Rounded
-pwsx2389 power 24E-3 0.5 -> 0.15 Inexact Rounded
-pwsx2390 power 24E+1 0.5 -> 15 Inexact Rounded
-pwsx2391 power 24E+2 0.5 -> 49 Inexact Rounded
-pwsx2392 power 24E+3 0.5 -> 1.5E+2 Inexact Rounded
-pwsx2393 power 0.25 0.5 -> 0.50 Inexact Rounded
-pwsx2394 power 0.025 0.5 -> 0.16 Inexact Rounded
-pwsx2395 power 25.0E-1 0.5 -> 1.6 Inexact Rounded
-pwsx2396 power 25.00E-2 0.5 -> 0.50 Inexact Rounded
-pwsx2397 power 25E-3 0.5 -> 0.16 Inexact Rounded
-pwsx2398 power 25E+1 0.5 -> 16 Inexact Rounded
-pwsx2399 power 25E+2 0.5 -> 50 Inexact Rounded
-pwsx2400 power 25E+3 0.5 -> 1.6E+2 Inexact Rounded
-pwsx2401 power 0.26 0.5 -> 0.51 Inexact Rounded
-pwsx2402 power 0.026 0.5 -> 0.16 Inexact Rounded
-pwsx2403 power 26.0E-1 0.5 -> 1.6 Inexact Rounded
-pwsx2404 power 26.00E-2 0.5 -> 0.51 Inexact Rounded
-pwsx2405 power 26E-3 0.5 -> 0.16 Inexact Rounded
-pwsx2406 power 26E+1 0.5 -> 16 Inexact Rounded
-pwsx2407 power 26E+2 0.5 -> 51 Inexact Rounded
-pwsx2408 power 26E+3 0.5 -> 1.6E+2 Inexact Rounded
-pwsx2409 power 0.27 0.5 -> 0.52 Inexact Rounded
-pwsx2410 power 0.027 0.5 -> 0.16 Inexact Rounded
-pwsx2411 power 27.0E-1 0.5 -> 1.6 Inexact Rounded
-pwsx2412 power 27.00E-2 0.5 -> 0.52 Inexact Rounded
-pwsx2413 power 27E-3 0.5 -> 0.16 Inexact Rounded
-pwsx2414 power 27E+1 0.5 -> 16 Inexact Rounded
-pwsx2415 power 27E+2 0.5 -> 52 Inexact Rounded
-pwsx2416 power 27E+3 0.5 -> 1.6E+2 Inexact Rounded
-pwsx2417 power 0.28 0.5 -> 0.53 Inexact Rounded
-pwsx2418 power 0.028 0.5 -> 0.17 Inexact Rounded
-pwsx2419 power 28.0E-1 0.5 -> 1.7 Inexact Rounded
-pwsx2420 power 28.00E-2 0.5 -> 0.53 Inexact Rounded
-pwsx2421 power 28E-3 0.5 -> 0.17 Inexact Rounded
-pwsx2422 power 28E+1 0.5 -> 17 Inexact Rounded
-pwsx2423 power 28E+2 0.5 -> 53 Inexact Rounded
-pwsx2424 power 28E+3 0.5 -> 1.7E+2 Inexact Rounded
-pwsx2425 power 0.29 0.5 -> 0.54 Inexact Rounded
-pwsx2426 power 0.029 0.5 -> 0.17 Inexact Rounded
-pwsx2427 power 29.0E-1 0.5 -> 1.7 Inexact Rounded
-pwsx2428 power 29.00E-2 0.5 -> 0.54 Inexact Rounded
-pwsx2429 power 29E-3 0.5 -> 0.17 Inexact Rounded
-pwsx2430 power 29E+1 0.5 -> 17 Inexact Rounded
-pwsx2431 power 29E+2 0.5 -> 54 Inexact Rounded
-pwsx2432 power 29E+3 0.5 -> 1.7E+2 Inexact Rounded
-pwsx2433 power 0.30 0.5 -> 0.55 Inexact Rounded
-pwsx2434 power 0.030 0.5 -> 0.17 Inexact Rounded
-pwsx2435 power 30.0E-1 0.5 -> 1.7 Inexact Rounded
-pwsx2436 power 30.00E-2 0.5 -> 0.55 Inexact Rounded
-pwsx2437 power 30E-3 0.5 -> 0.17 Inexact Rounded
-pwsx2438 power 30E+1 0.5 -> 17 Inexact Rounded
-pwsx2439 power 30E+2 0.5 -> 55 Inexact Rounded
-pwsx2440 power 30E+3 0.5 -> 1.7E+2 Inexact Rounded
-pwsx2441 power 0.31 0.5 -> 0.56 Inexact Rounded
-pwsx2442 power 0.031 0.5 -> 0.18 Inexact Rounded
-pwsx2443 power 31.0E-1 0.5 -> 1.8 Inexact Rounded
-pwsx2444 power 31.00E-2 0.5 -> 0.56 Inexact Rounded
-pwsx2445 power 31E-3 0.5 -> 0.18 Inexact Rounded
-pwsx2446 power 31E+1 0.5 -> 18 Inexact Rounded
-pwsx2447 power 31E+2 0.5 -> 56 Inexact Rounded
-pwsx2448 power 31E+3 0.5 -> 1.8E+2 Inexact Rounded
-pwsx2449 power 0.32 0.5 -> 0.57 Inexact Rounded
-pwsx2450 power 0.032 0.5 -> 0.18 Inexact Rounded
-pwsx2451 power 32.0E-1 0.5 -> 1.8 Inexact Rounded
-pwsx2452 power 32.00E-2 0.5 -> 0.57 Inexact Rounded
-pwsx2453 power 32E-3 0.5 -> 0.18 Inexact Rounded
-pwsx2454 power 32E+1 0.5 -> 18 Inexact Rounded
-pwsx2455 power 32E+2 0.5 -> 57 Inexact Rounded
-pwsx2456 power 32E+3 0.5 -> 1.8E+2 Inexact Rounded
-pwsx2457 power 0.33 0.5 -> 0.57 Inexact Rounded
-pwsx2458 power 0.033 0.5 -> 0.18 Inexact Rounded
-pwsx2459 power 33.0E-1 0.5 -> 1.8 Inexact Rounded
-pwsx2460 power 33.00E-2 0.5 -> 0.57 Inexact Rounded
-pwsx2461 power 33E-3 0.5 -> 0.18 Inexact Rounded
-pwsx2462 power 33E+1 0.5 -> 18 Inexact Rounded
-pwsx2463 power 33E+2 0.5 -> 57 Inexact Rounded
-pwsx2464 power 33E+3 0.5 -> 1.8E+2 Inexact Rounded
-pwsx2465 power 0.34 0.5 -> 0.58 Inexact Rounded
-pwsx2466 power 0.034 0.5 -> 0.18 Inexact Rounded
-pwsx2467 power 34.0E-1 0.5 -> 1.8 Inexact Rounded
-pwsx2468 power 34.00E-2 0.5 -> 0.58 Inexact Rounded
-pwsx2469 power 34E-3 0.5 -> 0.18 Inexact Rounded
-pwsx2470 power 34E+1 0.5 -> 18 Inexact Rounded
-pwsx2471 power 34E+2 0.5 -> 58 Inexact Rounded
-pwsx2472 power 34E+3 0.5 -> 1.8E+2 Inexact Rounded
-pwsx2473 power 0.35 0.5 -> 0.59 Inexact Rounded
-pwsx2474 power 0.035 0.5 -> 0.19 Inexact Rounded
-pwsx2475 power 35.0E-1 0.5 -> 1.9 Inexact Rounded
-pwsx2476 power 35.00E-2 0.5 -> 0.59 Inexact Rounded
-pwsx2477 power 35E-3 0.5 -> 0.19 Inexact Rounded
-pwsx2478 power 35E+1 0.5 -> 19 Inexact Rounded
-pwsx2479 power 35E+2 0.5 -> 59 Inexact Rounded
-pwsx2480 power 35E+3 0.5 -> 1.9E+2 Inexact Rounded
-pwsx2481 power 0.36 0.5 -> 0.60 Inexact Rounded
-pwsx2482 power 0.036 0.5 -> 0.19 Inexact Rounded
-pwsx2483 power 36.0E-1 0.5 -> 1.9 Inexact Rounded
-pwsx2484 power 36.00E-2 0.5 -> 0.60 Inexact Rounded
-pwsx2485 power 36E-3 0.5 -> 0.19 Inexact Rounded
-pwsx2486 power 36E+1 0.5 -> 19 Inexact Rounded
-pwsx2487 power 36E+2 0.5 -> 60 Inexact Rounded
-pwsx2488 power 36E+3 0.5 -> 1.9E+2 Inexact Rounded
-pwsx2489 power 0.37 0.5 -> 0.61 Inexact Rounded
-pwsx2490 power 0.037 0.5 -> 0.19 Inexact Rounded
-pwsx2491 power 37.0E-1 0.5 -> 1.9 Inexact Rounded
-pwsx2492 power 37.00E-2 0.5 -> 0.61 Inexact Rounded
-pwsx2493 power 37E-3 0.5 -> 0.19 Inexact Rounded
-pwsx2494 power 37E+1 0.5 -> 19 Inexact Rounded
-pwsx2495 power 37E+2 0.5 -> 61 Inexact Rounded
-pwsx2496 power 37E+3 0.5 -> 1.9E+2 Inexact Rounded
-pwsx2497 power 0.38 0.5 -> 0.62 Inexact Rounded
-pwsx2498 power 0.038 0.5 -> 0.19 Inexact Rounded
-pwsx2499 power 38.0E-1 0.5 -> 1.9 Inexact Rounded
-pwsx2500 power 38.00E-2 0.5 -> 0.62 Inexact Rounded
-pwsx2501 power 38E-3 0.5 -> 0.19 Inexact Rounded
-pwsx2502 power 38E+1 0.5 -> 19 Inexact Rounded
-pwsx2503 power 38E+2 0.5 -> 62 Inexact Rounded
-pwsx2504 power 38E+3 0.5 -> 1.9E+2 Inexact Rounded
-pwsx2505 power 0.39 0.5 -> 0.62 Inexact Rounded
-pwsx2506 power 0.039 0.5 -> 0.20 Inexact Rounded
-pwsx2507 power 39.0E-1 0.5 -> 2.0 Inexact Rounded
-pwsx2508 power 39.00E-2 0.5 -> 0.62 Inexact Rounded
-pwsx2509 power 39E-3 0.5 -> 0.20 Inexact Rounded
-pwsx2510 power 39E+1 0.5 -> 20 Inexact Rounded
-pwsx2511 power 39E+2 0.5 -> 62 Inexact Rounded
-pwsx2512 power 39E+3 0.5 -> 2.0E+2 Inexact Rounded
-pwsx2513 power 0.40 0.5 -> 0.63 Inexact Rounded
-pwsx2514 power 0.040 0.5 -> 0.20 Inexact Rounded
-pwsx2515 power 40.0E-1 0.5 -> 2.0 Inexact Rounded
-pwsx2516 power 40.00E-2 0.5 -> 0.63 Inexact Rounded
-pwsx2517 power 40E-3 0.5 -> 0.20 Inexact Rounded
-pwsx2518 power 40E+1 0.5 -> 20 Inexact Rounded
-pwsx2519 power 40E+2 0.5 -> 63 Inexact Rounded
-pwsx2520 power 40E+3 0.5 -> 2.0E+2 Inexact Rounded
-pwsx2521 power 0.41 0.5 -> 0.64 Inexact Rounded
-pwsx2522 power 0.041 0.5 -> 0.20 Inexact Rounded
-pwsx2523 power 41.0E-1 0.5 -> 2.0 Inexact Rounded
-pwsx2524 power 41.00E-2 0.5 -> 0.64 Inexact Rounded
-pwsx2525 power 41E-3 0.5 -> 0.20 Inexact Rounded
-pwsx2526 power 41E+1 0.5 -> 20 Inexact Rounded
-pwsx2527 power 41E+2 0.5 -> 64 Inexact Rounded
-pwsx2528 power 41E+3 0.5 -> 2.0E+2 Inexact Rounded
-pwsx2529 power 0.42 0.5 -> 0.65 Inexact Rounded
-pwsx2530 power 0.042 0.5 -> 0.20 Inexact Rounded
-pwsx2531 power 42.0E-1 0.5 -> 2.0 Inexact Rounded
-pwsx2532 power 42.00E-2 0.5 -> 0.65 Inexact Rounded
-pwsx2533 power 42E-3 0.5 -> 0.20 Inexact Rounded
-pwsx2534 power 42E+1 0.5 -> 20 Inexact Rounded
-pwsx2535 power 42E+2 0.5 -> 65 Inexact Rounded
-pwsx2536 power 42E+3 0.5 -> 2.0E+2 Inexact Rounded
-pwsx2537 power 0.43 0.5 -> 0.66 Inexact Rounded
-pwsx2538 power 0.043 0.5 -> 0.21 Inexact Rounded
-pwsx2539 power 43.0E-1 0.5 -> 2.1 Inexact Rounded
-pwsx2540 power 43.00E-2 0.5 -> 0.66 Inexact Rounded
-pwsx2541 power 43E-3 0.5 -> 0.21 Inexact Rounded
-pwsx2542 power 43E+1 0.5 -> 21 Inexact Rounded
-pwsx2543 power 43E+2 0.5 -> 66 Inexact Rounded
-pwsx2544 power 43E+3 0.5 -> 2.1E+2 Inexact Rounded
-pwsx2545 power 0.44 0.5 -> 0.66 Inexact Rounded
-pwsx2546 power 0.044 0.5 -> 0.21 Inexact Rounded
-pwsx2547 power 44.0E-1 0.5 -> 2.1 Inexact Rounded
-pwsx2548 power 44.00E-2 0.5 -> 0.66 Inexact Rounded
-pwsx2549 power 44E-3 0.5 -> 0.21 Inexact Rounded
-pwsx2550 power 44E+1 0.5 -> 21 Inexact Rounded
-pwsx2551 power 44E+2 0.5 -> 66 Inexact Rounded
-pwsx2552 power 44E+3 0.5 -> 2.1E+2 Inexact Rounded
-pwsx2553 power 0.45 0.5 -> 0.67 Inexact Rounded
-pwsx2554 power 0.045 0.5 -> 0.21 Inexact Rounded
-pwsx2555 power 45.0E-1 0.5 -> 2.1 Inexact Rounded
-pwsx2556 power 45.00E-2 0.5 -> 0.67 Inexact Rounded
-pwsx2557 power 45E-3 0.5 -> 0.21 Inexact Rounded
-pwsx2558 power 45E+1 0.5 -> 21 Inexact Rounded
-pwsx2559 power 45E+2 0.5 -> 67 Inexact Rounded
-pwsx2560 power 45E+3 0.5 -> 2.1E+2 Inexact Rounded
-pwsx2561 power 0.46 0.5 -> 0.68 Inexact Rounded
-pwsx2562 power 0.046 0.5 -> 0.21 Inexact Rounded
-pwsx2563 power 46.0E-1 0.5 -> 2.1 Inexact Rounded
-pwsx2564 power 46.00E-2 0.5 -> 0.68 Inexact Rounded
-pwsx2565 power 46E-3 0.5 -> 0.21 Inexact Rounded
-pwsx2566 power 46E+1 0.5 -> 21 Inexact Rounded
-pwsx2567 power 46E+2 0.5 -> 68 Inexact Rounded
-pwsx2568 power 46E+3 0.5 -> 2.1E+2 Inexact Rounded
-pwsx2569 power 0.47 0.5 -> 0.69 Inexact Rounded
-pwsx2570 power 0.047 0.5 -> 0.22 Inexact Rounded
-pwsx2571 power 47.0E-1 0.5 -> 2.2 Inexact Rounded
-pwsx2572 power 47.00E-2 0.5 -> 0.69 Inexact Rounded
-pwsx2573 power 47E-3 0.5 -> 0.22 Inexact Rounded
-pwsx2574 power 47E+1 0.5 -> 22 Inexact Rounded
-pwsx2575 power 47E+2 0.5 -> 69 Inexact Rounded
-pwsx2576 power 47E+3 0.5 -> 2.2E+2 Inexact Rounded
-pwsx2577 power 0.48 0.5 -> 0.69 Inexact Rounded
-pwsx2578 power 0.048 0.5 -> 0.22 Inexact Rounded
-pwsx2579 power 48.0E-1 0.5 -> 2.2 Inexact Rounded
-pwsx2580 power 48.00E-2 0.5 -> 0.69 Inexact Rounded
-pwsx2581 power 48E-3 0.5 -> 0.22 Inexact Rounded
-pwsx2582 power 48E+1 0.5 -> 22 Inexact Rounded
-pwsx2583 power 48E+2 0.5 -> 69 Inexact Rounded
-pwsx2584 power 48E+3 0.5 -> 2.2E+2 Inexact Rounded
-pwsx2585 power 0.49 0.5 -> 0.70 Inexact Rounded
-pwsx2586 power 0.049 0.5 -> 0.22 Inexact Rounded
-pwsx2587 power 49.0E-1 0.5 -> 2.2 Inexact Rounded
-pwsx2588 power 49.00E-2 0.5 -> 0.70 Inexact Rounded
-pwsx2589 power 49E-3 0.5 -> 0.22 Inexact Rounded
-pwsx2590 power 49E+1 0.5 -> 22 Inexact Rounded
-pwsx2591 power 49E+2 0.5 -> 70 Inexact Rounded
-pwsx2592 power 49E+3 0.5 -> 2.2E+2 Inexact Rounded
-pwsx2593 power 0.50 0.5 -> 0.71 Inexact Rounded
-pwsx2594 power 0.050 0.5 -> 0.22 Inexact Rounded
-pwsx2595 power 50.0E-1 0.5 -> 2.2 Inexact Rounded
-pwsx2596 power 50.00E-2 0.5 -> 0.71 Inexact Rounded
-pwsx2597 power 50E-3 0.5 -> 0.22 Inexact Rounded
-pwsx2598 power 50E+1 0.5 -> 22 Inexact Rounded
-pwsx2599 power 50E+2 0.5 -> 71 Inexact Rounded
-pwsx2600 power 50E+3 0.5 -> 2.2E+2 Inexact Rounded
-pwsx2601 power 0.51 0.5 -> 0.71 Inexact Rounded
-pwsx2602 power 0.051 0.5 -> 0.23 Inexact Rounded
-pwsx2603 power 51.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2604 power 51.00E-2 0.5 -> 0.71 Inexact Rounded
-pwsx2605 power 51E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2606 power 51E+1 0.5 -> 23 Inexact Rounded
-pwsx2607 power 51E+2 0.5 -> 71 Inexact Rounded
-pwsx2608 power 51E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2609 power 0.52 0.5 -> 0.72 Inexact Rounded
-pwsx2610 power 0.052 0.5 -> 0.23 Inexact Rounded
-pwsx2611 power 52.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2612 power 52.00E-2 0.5 -> 0.72 Inexact Rounded
-pwsx2613 power 52E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2614 power 52E+1 0.5 -> 23 Inexact Rounded
-pwsx2615 power 52E+2 0.5 -> 72 Inexact Rounded
-pwsx2616 power 52E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2617 power 0.53 0.5 -> 0.73 Inexact Rounded
-pwsx2618 power 0.053 0.5 -> 0.23 Inexact Rounded
-pwsx2619 power 53.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2620 power 53.00E-2 0.5 -> 0.73 Inexact Rounded
-pwsx2621 power 53E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2622 power 53E+1 0.5 -> 23 Inexact Rounded
-pwsx2623 power 53E+2 0.5 -> 73 Inexact Rounded
-pwsx2624 power 53E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2625 power 0.54 0.5 -> 0.73 Inexact Rounded
-pwsx2626 power 0.054 0.5 -> 0.23 Inexact Rounded
-pwsx2627 power 54.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2628 power 54.00E-2 0.5 -> 0.73 Inexact Rounded
-pwsx2629 power 54E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2630 power 54E+1 0.5 -> 23 Inexact Rounded
-pwsx2631 power 54E+2 0.5 -> 73 Inexact Rounded
-pwsx2632 power 54E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2633 power 0.55 0.5 -> 0.74 Inexact Rounded
-pwsx2634 power 0.055 0.5 -> 0.23 Inexact Rounded
-pwsx2635 power 55.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2636 power 55.00E-2 0.5 -> 0.74 Inexact Rounded
-pwsx2637 power 55E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2638 power 55E+1 0.5 -> 23 Inexact Rounded
-pwsx2639 power 55E+2 0.5 -> 74 Inexact Rounded
-pwsx2640 power 55E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2641 power 0.56 0.5 -> 0.75 Inexact Rounded
-pwsx2642 power 0.056 0.5 -> 0.24 Inexact Rounded
-pwsx2643 power 56.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2644 power 56.00E-2 0.5 -> 0.75 Inexact Rounded
-pwsx2645 power 56E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2646 power 56E+1 0.5 -> 24 Inexact Rounded
-pwsx2647 power 56E+2 0.5 -> 75 Inexact Rounded
-pwsx2648 power 56E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2649 power 0.57 0.5 -> 0.75 Inexact Rounded
-pwsx2650 power 0.057 0.5 -> 0.24 Inexact Rounded
-pwsx2651 power 57.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2652 power 57.00E-2 0.5 -> 0.75 Inexact Rounded
-pwsx2653 power 57E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2654 power 57E+1 0.5 -> 24 Inexact Rounded
-pwsx2655 power 57E+2 0.5 -> 75 Inexact Rounded
-pwsx2656 power 57E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2657 power 0.58 0.5 -> 0.76 Inexact Rounded
-pwsx2658 power 0.058 0.5 -> 0.24 Inexact Rounded
-pwsx2659 power 58.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2660 power 58.00E-2 0.5 -> 0.76 Inexact Rounded
-pwsx2661 power 58E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2662 power 58E+1 0.5 -> 24 Inexact Rounded
-pwsx2663 power 58E+2 0.5 -> 76 Inexact Rounded
-pwsx2664 power 58E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2665 power 0.59 0.5 -> 0.77 Inexact Rounded
-pwsx2666 power 0.059 0.5 -> 0.24 Inexact Rounded
-pwsx2667 power 59.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2668 power 59.00E-2 0.5 -> 0.77 Inexact Rounded
-pwsx2669 power 59E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2670 power 59E+1 0.5 -> 24 Inexact Rounded
-pwsx2671 power 59E+2 0.5 -> 77 Inexact Rounded
-pwsx2672 power 59E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2673 power 0.60 0.5 -> 0.77 Inexact Rounded
-pwsx2674 power 0.060 0.5 -> 0.24 Inexact Rounded
-pwsx2675 power 60.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2676 power 60.00E-2 0.5 -> 0.77 Inexact Rounded
-pwsx2677 power 60E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2678 power 60E+1 0.5 -> 24 Inexact Rounded
-pwsx2679 power 60E+2 0.5 -> 77 Inexact Rounded
-pwsx2680 power 60E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2681 power 0.61 0.5 -> 0.78 Inexact Rounded
-pwsx2682 power 0.061 0.5 -> 0.25 Inexact Rounded
-pwsx2683 power 61.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2684 power 61.00E-2 0.5 -> 0.78 Inexact Rounded
-pwsx2685 power 61E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2686 power 61E+1 0.5 -> 25 Inexact Rounded
-pwsx2687 power 61E+2 0.5 -> 78 Inexact Rounded
-pwsx2688 power 61E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2689 power 0.62 0.5 -> 0.79 Inexact Rounded
-pwsx2690 power 0.062 0.5 -> 0.25 Inexact Rounded
-pwsx2691 power 62.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2692 power 62.00E-2 0.5 -> 0.79 Inexact Rounded
-pwsx2693 power 62E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2694 power 62E+1 0.5 -> 25 Inexact Rounded
-pwsx2695 power 62E+2 0.5 -> 79 Inexact Rounded
-pwsx2696 power 62E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2697 power 0.63 0.5 -> 0.79 Inexact Rounded
-pwsx2698 power 0.063 0.5 -> 0.25 Inexact Rounded
-pwsx2699 power 63.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2700 power 63.00E-2 0.5 -> 0.79 Inexact Rounded
-pwsx2701 power 63E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2702 power 63E+1 0.5 -> 25 Inexact Rounded
-pwsx2703 power 63E+2 0.5 -> 79 Inexact Rounded
-pwsx2704 power 63E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2705 power 0.64 0.5 -> 0.80 Inexact Rounded
-pwsx2706 power 0.064 0.5 -> 0.25 Inexact Rounded
-pwsx2707 power 64.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2708 power 64.00E-2 0.5 -> 0.80 Inexact Rounded
-pwsx2709 power 64E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2710 power 64E+1 0.5 -> 25 Inexact Rounded
-pwsx2711 power 64E+2 0.5 -> 80 Inexact Rounded
-pwsx2712 power 64E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2713 power 0.65 0.5 -> 0.81 Inexact Rounded
-pwsx2714 power 0.065 0.5 -> 0.25 Inexact Rounded
-pwsx2715 power 65.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2716 power 65.00E-2 0.5 -> 0.81 Inexact Rounded
-pwsx2717 power 65E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2718 power 65E+1 0.5 -> 25 Inexact Rounded
-pwsx2719 power 65E+2 0.5 -> 81 Inexact Rounded
-pwsx2720 power 65E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2721 power 0.66 0.5 -> 0.81 Inexact Rounded
-pwsx2722 power 0.066 0.5 -> 0.26 Inexact Rounded
-pwsx2723 power 66.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2724 power 66.00E-2 0.5 -> 0.81 Inexact Rounded
-pwsx2725 power 66E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2726 power 66E+1 0.5 -> 26 Inexact Rounded
-pwsx2727 power 66E+2 0.5 -> 81 Inexact Rounded
-pwsx2728 power 66E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2729 power 0.67 0.5 -> 0.82 Inexact Rounded
-pwsx2730 power 0.067 0.5 -> 0.26 Inexact Rounded
-pwsx2731 power 67.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2732 power 67.00E-2 0.5 -> 0.82 Inexact Rounded
-pwsx2733 power 67E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2734 power 67E+1 0.5 -> 26 Inexact Rounded
-pwsx2735 power 67E+2 0.5 -> 82 Inexact Rounded
-pwsx2736 power 67E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2737 power 0.68 0.5 -> 0.82 Inexact Rounded
-pwsx2738 power 0.068 0.5 -> 0.26 Inexact Rounded
-pwsx2739 power 68.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2740 power 68.00E-2 0.5 -> 0.82 Inexact Rounded
-pwsx2741 power 68E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2742 power 68E+1 0.5 -> 26 Inexact Rounded
-pwsx2743 power 68E+2 0.5 -> 82 Inexact Rounded
-pwsx2744 power 68E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2745 power 0.69 0.5 -> 0.83 Inexact Rounded
-pwsx2746 power 0.069 0.5 -> 0.26 Inexact Rounded
-pwsx2747 power 69.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2748 power 69.00E-2 0.5 -> 0.83 Inexact Rounded
-pwsx2749 power 69E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2750 power 69E+1 0.5 -> 26 Inexact Rounded
-pwsx2751 power 69E+2 0.5 -> 83 Inexact Rounded
-pwsx2752 power 69E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2753 power 0.70 0.5 -> 0.84 Inexact Rounded
-pwsx2754 power 0.070 0.5 -> 0.26 Inexact Rounded
-pwsx2755 power 70.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2756 power 70.00E-2 0.5 -> 0.84 Inexact Rounded
-pwsx2757 power 70E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2758 power 70E+1 0.5 -> 26 Inexact Rounded
-pwsx2759 power 70E+2 0.5 -> 84 Inexact Rounded
-pwsx2760 power 70E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2761 power 0.71 0.5 -> 0.84 Inexact Rounded
-pwsx2762 power 0.071 0.5 -> 0.27 Inexact Rounded
-pwsx2763 power 71.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2764 power 71.00E-2 0.5 -> 0.84 Inexact Rounded
-pwsx2765 power 71E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2766 power 71E+1 0.5 -> 27 Inexact Rounded
-pwsx2767 power 71E+2 0.5 -> 84 Inexact Rounded
-pwsx2768 power 71E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2769 power 0.72 0.5 -> 0.85 Inexact Rounded
-pwsx2770 power 0.072 0.5 -> 0.27 Inexact Rounded
-pwsx2771 power 72.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2772 power 72.00E-2 0.5 -> 0.85 Inexact Rounded
-pwsx2773 power 72E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2774 power 72E+1 0.5 -> 27 Inexact Rounded
-pwsx2775 power 72E+2 0.5 -> 85 Inexact Rounded
-pwsx2776 power 72E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2777 power 0.73 0.5 -> 0.85 Inexact Rounded
-pwsx2778 power 0.073 0.5 -> 0.27 Inexact Rounded
-pwsx2779 power 73.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2780 power 73.00E-2 0.5 -> 0.85 Inexact Rounded
-pwsx2781 power 73E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2782 power 73E+1 0.5 -> 27 Inexact Rounded
-pwsx2783 power 73E+2 0.5 -> 85 Inexact Rounded
-pwsx2784 power 73E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2785 power 0.74 0.5 -> 0.86 Inexact Rounded
-pwsx2786 power 0.074 0.5 -> 0.27 Inexact Rounded
-pwsx2787 power 74.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2788 power 74.00E-2 0.5 -> 0.86 Inexact Rounded
-pwsx2789 power 74E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2790 power 74E+1 0.5 -> 27 Inexact Rounded
-pwsx2791 power 74E+2 0.5 -> 86 Inexact Rounded
-pwsx2792 power 74E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2793 power 0.75 0.5 -> 0.87 Inexact Rounded
-pwsx2794 power 0.075 0.5 -> 0.27 Inexact Rounded
-pwsx2795 power 75.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2796 power 75.00E-2 0.5 -> 0.87 Inexact Rounded
-pwsx2797 power 75E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2798 power 75E+1 0.5 -> 27 Inexact Rounded
-pwsx2799 power 75E+2 0.5 -> 87 Inexact Rounded
-pwsx2800 power 75E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2801 power 0.76 0.5 -> 0.87 Inexact Rounded
-pwsx2802 power 0.076 0.5 -> 0.28 Inexact Rounded
-pwsx2803 power 76.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2804 power 76.00E-2 0.5 -> 0.87 Inexact Rounded
-pwsx2805 power 76E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2806 power 76E+1 0.5 -> 28 Inexact Rounded
-pwsx2807 power 76E+2 0.5 -> 87 Inexact Rounded
-pwsx2808 power 76E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2809 power 0.77 0.5 -> 0.88 Inexact Rounded
-pwsx2810 power 0.077 0.5 -> 0.28 Inexact Rounded
-pwsx2811 power 77.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2812 power 77.00E-2 0.5 -> 0.88 Inexact Rounded
-pwsx2813 power 77E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2814 power 77E+1 0.5 -> 28 Inexact Rounded
-pwsx2815 power 77E+2 0.5 -> 88 Inexact Rounded
-pwsx2816 power 77E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2817 power 0.78 0.5 -> 0.88 Inexact Rounded
-pwsx2818 power 0.078 0.5 -> 0.28 Inexact Rounded
-pwsx2819 power 78.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2820 power 78.00E-2 0.5 -> 0.88 Inexact Rounded
-pwsx2821 power 78E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2822 power 78E+1 0.5 -> 28 Inexact Rounded
-pwsx2823 power 78E+2 0.5 -> 88 Inexact Rounded
-pwsx2824 power 78E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2825 power 0.79 0.5 -> 0.89 Inexact Rounded
-pwsx2826 power 0.079 0.5 -> 0.28 Inexact Rounded
-pwsx2827 power 79.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2828 power 79.00E-2 0.5 -> 0.89 Inexact Rounded
-pwsx2829 power 79E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2830 power 79E+1 0.5 -> 28 Inexact Rounded
-pwsx2831 power 79E+2 0.5 -> 89 Inexact Rounded
-pwsx2832 power 79E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2833 power 0.80 0.5 -> 0.89 Inexact Rounded
-pwsx2834 power 0.080 0.5 -> 0.28 Inexact Rounded
-pwsx2835 power 80.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2836 power 80.00E-2 0.5 -> 0.89 Inexact Rounded
-pwsx2837 power 80E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2838 power 80E+1 0.5 -> 28 Inexact Rounded
-pwsx2839 power 80E+2 0.5 -> 89 Inexact Rounded
-pwsx2840 power 80E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2841 power 0.81 0.5 -> 0.90 Inexact Rounded
-pwsx2842 power 0.081 0.5 -> 0.28 Inexact Rounded
-pwsx2843 power 81.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2844 power 81.00E-2 0.5 -> 0.90 Inexact Rounded
-pwsx2845 power 81E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2846 power 81E+1 0.5 -> 28 Inexact Rounded
-pwsx2847 power 81E+2 0.5 -> 90 Inexact Rounded
-pwsx2848 power 81E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2849 power 0.82 0.5 -> 0.91 Inexact Rounded
-pwsx2850 power 0.082 0.5 -> 0.29 Inexact Rounded
-pwsx2851 power 82.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2852 power 82.00E-2 0.5 -> 0.91 Inexact Rounded
-pwsx2853 power 82E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2854 power 82E+1 0.5 -> 29 Inexact Rounded
-pwsx2855 power 82E+2 0.5 -> 91 Inexact Rounded
-pwsx2856 power 82E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2857 power 0.83 0.5 -> 0.91 Inexact Rounded
-pwsx2858 power 0.083 0.5 -> 0.29 Inexact Rounded
-pwsx2859 power 83.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2860 power 83.00E-2 0.5 -> 0.91 Inexact Rounded
-pwsx2861 power 83E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2862 power 83E+1 0.5 -> 29 Inexact Rounded
-pwsx2863 power 83E+2 0.5 -> 91 Inexact Rounded
-pwsx2864 power 83E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2865 power 0.84 0.5 -> 0.92 Inexact Rounded
-pwsx2866 power 0.084 0.5 -> 0.29 Inexact Rounded
-pwsx2867 power 84.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2868 power 84.00E-2 0.5 -> 0.92 Inexact Rounded
-pwsx2869 power 84E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2870 power 84E+1 0.5 -> 29 Inexact Rounded
-pwsx2871 power 84E+2 0.5 -> 92 Inexact Rounded
-pwsx2872 power 84E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2873 power 0.85 0.5 -> 0.92 Inexact Rounded
-pwsx2874 power 0.085 0.5 -> 0.29 Inexact Rounded
-pwsx2875 power 85.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2876 power 85.00E-2 0.5 -> 0.92 Inexact Rounded
-pwsx2877 power 85E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2878 power 85E+1 0.5 -> 29 Inexact Rounded
-pwsx2879 power 85E+2 0.5 -> 92 Inexact Rounded
-pwsx2880 power 85E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2881 power 0.86 0.5 -> 0.93 Inexact Rounded
-pwsx2882 power 0.086 0.5 -> 0.29 Inexact Rounded
-pwsx2883 power 86.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2884 power 86.00E-2 0.5 -> 0.93 Inexact Rounded
-pwsx2885 power 86E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2886 power 86E+1 0.5 -> 29 Inexact Rounded
-pwsx2887 power 86E+2 0.5 -> 93 Inexact Rounded
-pwsx2888 power 86E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2889 power 0.87 0.5 -> 0.93 Inexact Rounded
-pwsx2890 power 0.087 0.5 -> 0.29 Inexact Rounded
-pwsx2891 power 87.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2892 power 87.00E-2 0.5 -> 0.93 Inexact Rounded
-pwsx2893 power 87E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2894 power 87E+1 0.5 -> 29 Inexact Rounded
-pwsx2895 power 87E+2 0.5 -> 93 Inexact Rounded
-pwsx2896 power 87E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2897 power 0.88 0.5 -> 0.94 Inexact Rounded
-pwsx2898 power 0.088 0.5 -> 0.30 Inexact Rounded
-pwsx2899 power 88.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2900 power 88.00E-2 0.5 -> 0.94 Inexact Rounded
-pwsx2901 power 88E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2902 power 88E+1 0.5 -> 30 Inexact Rounded
-pwsx2903 power 88E+2 0.5 -> 94 Inexact Rounded
-pwsx2904 power 88E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2905 power 0.89 0.5 -> 0.94 Inexact Rounded
-pwsx2906 power 0.089 0.5 -> 0.30 Inexact Rounded
-pwsx2907 power 89.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2908 power 89.00E-2 0.5 -> 0.94 Inexact Rounded
-pwsx2909 power 89E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2910 power 89E+1 0.5 -> 30 Inexact Rounded
-pwsx2911 power 89E+2 0.5 -> 94 Inexact Rounded
-pwsx2912 power 89E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2913 power 0.90 0.5 -> 0.95 Inexact Rounded
-pwsx2914 power 0.090 0.5 -> 0.30 Inexact Rounded
-pwsx2915 power 90.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2916 power 90.00E-2 0.5 -> 0.95 Inexact Rounded
-pwsx2917 power 90E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2918 power 90E+1 0.5 -> 30 Inexact Rounded
-pwsx2919 power 90E+2 0.5 -> 95 Inexact Rounded
-pwsx2920 power 90E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2921 power 0.91 0.5 -> 0.95 Inexact Rounded
-pwsx2922 power 0.091 0.5 -> 0.30 Inexact Rounded
-pwsx2923 power 91.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2924 power 91.00E-2 0.5 -> 0.95 Inexact Rounded
-pwsx2925 power 91E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2926 power 91E+1 0.5 -> 30 Inexact Rounded
-pwsx2927 power 91E+2 0.5 -> 95 Inexact Rounded
-pwsx2928 power 91E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2929 power 0.92 0.5 -> 0.96 Inexact Rounded
-pwsx2930 power 0.092 0.5 -> 0.30 Inexact Rounded
-pwsx2931 power 92.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2932 power 92.00E-2 0.5 -> 0.96 Inexact Rounded
-pwsx2933 power 92E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2934 power 92E+1 0.5 -> 30 Inexact Rounded
-pwsx2935 power 92E+2 0.5 -> 96 Inexact Rounded
-pwsx2936 power 92E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2937 power 0.93 0.5 -> 0.96 Inexact Rounded
-pwsx2938 power 0.093 0.5 -> 0.30 Inexact Rounded
-pwsx2939 power 93.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2940 power 93.00E-2 0.5 -> 0.96 Inexact Rounded
-pwsx2941 power 93E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2942 power 93E+1 0.5 -> 30 Inexact Rounded
-pwsx2943 power 93E+2 0.5 -> 96 Inexact Rounded
-pwsx2944 power 93E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2945 power 0.94 0.5 -> 0.97 Inexact Rounded
-pwsx2946 power 0.094 0.5 -> 0.31 Inexact Rounded
-pwsx2947 power 94.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2948 power 94.00E-2 0.5 -> 0.97 Inexact Rounded
-pwsx2949 power 94E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2950 power 94E+1 0.5 -> 31 Inexact Rounded
-pwsx2951 power 94E+2 0.5 -> 97 Inexact Rounded
-pwsx2952 power 94E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2953 power 0.95 0.5 -> 0.97 Inexact Rounded
-pwsx2954 power 0.095 0.5 -> 0.31 Inexact Rounded
-pwsx2955 power 95.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2956 power 95.00E-2 0.5 -> 0.97 Inexact Rounded
-pwsx2957 power 95E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2958 power 95E+1 0.5 -> 31 Inexact Rounded
-pwsx2959 power 95E+2 0.5 -> 97 Inexact Rounded
-pwsx2960 power 95E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2961 power 0.96 0.5 -> 0.98 Inexact Rounded
-pwsx2962 power 0.096 0.5 -> 0.31 Inexact Rounded
-pwsx2963 power 96.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2964 power 96.00E-2 0.5 -> 0.98 Inexact Rounded
-pwsx2965 power 96E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2966 power 96E+1 0.5 -> 31 Inexact Rounded
-pwsx2967 power 96E+2 0.5 -> 98 Inexact Rounded
-pwsx2968 power 96E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2969 power 0.97 0.5 -> 0.98 Inexact Rounded
-pwsx2970 power 0.097 0.5 -> 0.31 Inexact Rounded
-pwsx2971 power 97.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2972 power 97.00E-2 0.5 -> 0.98 Inexact Rounded
-pwsx2973 power 97E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2974 power 97E+1 0.5 -> 31 Inexact Rounded
-pwsx2975 power 97E+2 0.5 -> 98 Inexact Rounded
-pwsx2976 power 97E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2977 power 0.98 0.5 -> 0.99 Inexact Rounded
-pwsx2978 power 0.098 0.5 -> 0.31 Inexact Rounded
-pwsx2979 power 98.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2980 power 98.00E-2 0.5 -> 0.99 Inexact Rounded
-pwsx2981 power 98E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2982 power 98E+1 0.5 -> 31 Inexact Rounded
-pwsx2983 power 98E+2 0.5 -> 99 Inexact Rounded
-pwsx2984 power 98E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2985 power 0.99 0.5 -> 0.99 Inexact Rounded
-pwsx2986 power 0.099 0.5 -> 0.31 Inexact Rounded
-pwsx2987 power 99.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2988 power 99.00E-2 0.5 -> 0.99 Inexact Rounded
-pwsx2989 power 99E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2990 power 99E+1 0.5 -> 31 Inexact Rounded
-pwsx2991 power 99E+2 0.5 -> 99 Inexact Rounded
-pwsx2992 power 99E+3 0.5 -> 3.1E+2 Inexact Rounded
-
--- Precision 3 squareroot tests [exhaustive, f and f/10]
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-precision: 3
-pwsx3001 power 0.1 0.5 -> 0.316 Inexact Rounded
-pwsx3002 power 0.01 0.5 -> 0.100 Inexact Rounded
-pwsx3003 power 0.2 0.5 -> 0.447 Inexact Rounded
-pwsx3004 power 0.02 0.5 -> 0.141 Inexact Rounded
-pwsx3005 power 0.3 0.5 -> 0.548 Inexact Rounded
-pwsx3006 power 0.03 0.5 -> 0.173 Inexact Rounded
-pwsx3007 power 0.4 0.5 -> 0.632 Inexact Rounded
-pwsx3008 power 0.04 0.5 -> 0.200 Inexact Rounded
-pwsx3009 power 0.5 0.5 -> 0.707 Inexact Rounded
-pwsx3010 power 0.05 0.5 -> 0.224 Inexact Rounded
-pwsx3011 power 0.6 0.5 -> 0.775 Inexact Rounded
-pwsx3012 power 0.06 0.5 -> 0.245 Inexact Rounded
-pwsx3013 power 0.7 0.5 -> 0.837 Inexact Rounded
-pwsx3014 power 0.07 0.5 -> 0.265 Inexact Rounded
-pwsx3015 power 0.8 0.5 -> 0.894 Inexact Rounded
-pwsx3016 power 0.08 0.5 -> 0.283 Inexact Rounded
-pwsx3017 power 0.9 0.5 -> 0.949 Inexact Rounded
-pwsx3018 power 0.09 0.5 -> 0.300 Inexact Rounded
-pwsx3019 power 0.11 0.5 -> 0.332 Inexact Rounded
-pwsx3020 power 0.011 0.5 -> 0.105 Inexact Rounded
-pwsx3021 power 0.12 0.5 -> 0.346 Inexact Rounded
-pwsx3022 power 0.012 0.5 -> 0.110 Inexact Rounded
-pwsx3023 power 0.13 0.5 -> 0.361 Inexact Rounded
-pwsx3024 power 0.013 0.5 -> 0.114 Inexact Rounded
-pwsx3025 power 0.14 0.5 -> 0.374 Inexact Rounded
-pwsx3026 power 0.014 0.5 -> 0.118 Inexact Rounded
-pwsx3027 power 0.15 0.5 -> 0.387 Inexact Rounded
-pwsx3028 power 0.015 0.5 -> 0.122 Inexact Rounded
-pwsx3029 power 0.16 0.5 -> 0.400 Inexact Rounded
-pwsx3030 power 0.016 0.5 -> 0.126 Inexact Rounded
-pwsx3031 power 0.17 0.5 -> 0.412 Inexact Rounded
-pwsx3032 power 0.017 0.5 -> 0.130 Inexact Rounded
-pwsx3033 power 0.18 0.5 -> 0.424 Inexact Rounded
-pwsx3034 power 0.018 0.5 -> 0.134 Inexact Rounded
-pwsx3035 power 0.19 0.5 -> 0.436 Inexact Rounded
-pwsx3036 power 0.019 0.5 -> 0.138 Inexact Rounded
-pwsx3037 power 0.21 0.5 -> 0.458 Inexact Rounded
-pwsx3038 power 0.021 0.5 -> 0.145 Inexact Rounded
-pwsx3039 power 0.22 0.5 -> 0.469 Inexact Rounded
-pwsx3040 power 0.022 0.5 -> 0.148 Inexact Rounded
-pwsx3041 power 0.23 0.5 -> 0.480 Inexact Rounded
-pwsx3042 power 0.023 0.5 -> 0.152 Inexact Rounded
-pwsx3043 power 0.24 0.5 -> 0.490 Inexact Rounded
-pwsx3044 power 0.024 0.5 -> 0.155 Inexact Rounded
-pwsx3045 power 0.25 0.5 -> 0.500 Inexact Rounded
-pwsx3046 power 0.025 0.5 -> 0.158 Inexact Rounded
-pwsx3047 power 0.26 0.5 -> 0.510 Inexact Rounded
-pwsx3048 power 0.026 0.5 -> 0.161 Inexact Rounded
-pwsx3049 power 0.27 0.5 -> 0.520 Inexact Rounded
-pwsx3050 power 0.027 0.5 -> 0.164 Inexact Rounded
-pwsx3051 power 0.28 0.5 -> 0.529 Inexact Rounded
-pwsx3052 power 0.028 0.5 -> 0.167 Inexact Rounded
-pwsx3053 power 0.29 0.5 -> 0.539 Inexact Rounded
-pwsx3054 power 0.029 0.5 -> 0.170 Inexact Rounded
-pwsx3055 power 0.31 0.5 -> 0.557 Inexact Rounded
-pwsx3056 power 0.031 0.5 -> 0.176 Inexact Rounded
-pwsx3057 power 0.32 0.5 -> 0.566 Inexact Rounded
-pwsx3058 power 0.032 0.5 -> 0.179 Inexact Rounded
-pwsx3059 power 0.33 0.5 -> 0.574 Inexact Rounded
-pwsx3060 power 0.033 0.5 -> 0.182 Inexact Rounded
-pwsx3061 power 0.34 0.5 -> 0.583 Inexact Rounded
-pwsx3062 power 0.034 0.5 -> 0.184 Inexact Rounded
-pwsx3063 power 0.35 0.5 -> 0.592 Inexact Rounded
-pwsx3064 power 0.035 0.5 -> 0.187 Inexact Rounded
-pwsx3065 power 0.36 0.5 -> 0.600 Inexact Rounded
-pwsx3066 power 0.036 0.5 -> 0.190 Inexact Rounded
-pwsx3067 power 0.37 0.5 -> 0.608 Inexact Rounded
-pwsx3068 power 0.037 0.5 -> 0.192 Inexact Rounded
-pwsx3069 power 0.38 0.5 -> 0.616 Inexact Rounded
-pwsx3070 power 0.038 0.5 -> 0.195 Inexact Rounded
-pwsx3071 power 0.39 0.5 -> 0.624 Inexact Rounded
-pwsx3072 power 0.039 0.5 -> 0.197 Inexact Rounded
-pwsx3073 power 0.41 0.5 -> 0.640 Inexact Rounded
-pwsx3074 power 0.041 0.5 -> 0.202 Inexact Rounded
-pwsx3075 power 0.42 0.5 -> 0.648 Inexact Rounded
-pwsx3076 power 0.042 0.5 -> 0.205 Inexact Rounded
-pwsx3077 power 0.43 0.5 -> 0.656 Inexact Rounded
-pwsx3078 power 0.043 0.5 -> 0.207 Inexact Rounded
-pwsx3079 power 0.44 0.5 -> 0.663 Inexact Rounded
-pwsx3080 power 0.044 0.5 -> 0.210 Inexact Rounded
-pwsx3081 power 0.45 0.5 -> 0.671 Inexact Rounded
-pwsx3082 power 0.045 0.5 -> 0.212 Inexact Rounded
-pwsx3083 power 0.46 0.5 -> 0.678 Inexact Rounded
-pwsx3084 power 0.046 0.5 -> 0.214 Inexact Rounded
-pwsx3085 power 0.47 0.5 -> 0.686 Inexact Rounded
-pwsx3086 power 0.047 0.5 -> 0.217 Inexact Rounded
-pwsx3087 power 0.48 0.5 -> 0.693 Inexact Rounded
-pwsx3088 power 0.048 0.5 -> 0.219 Inexact Rounded
-pwsx3089 power 0.49 0.5 -> 0.700 Inexact Rounded
-pwsx3090 power 0.049 0.5 -> 0.221 Inexact Rounded
-pwsx3091 power 0.51 0.5 -> 0.714 Inexact Rounded
-pwsx3092 power 0.051 0.5 -> 0.226 Inexact Rounded
-pwsx3093 power 0.52 0.5 -> 0.721 Inexact Rounded
-pwsx3094 power 0.052 0.5 -> 0.228 Inexact Rounded
-pwsx3095 power 0.53 0.5 -> 0.728 Inexact Rounded
-pwsx3096 power 0.053 0.5 -> 0.230 Inexact Rounded
-pwsx3097 power 0.54 0.5 -> 0.735 Inexact Rounded
-pwsx3098 power 0.054 0.5 -> 0.232 Inexact Rounded
-pwsx3099 power 0.55 0.5 -> 0.742 Inexact Rounded
-pwsx3100 power 0.055 0.5 -> 0.235 Inexact Rounded
-pwsx3101 power 0.56 0.5 -> 0.748 Inexact Rounded
-pwsx3102 power 0.056 0.5 -> 0.237 Inexact Rounded
-pwsx3103 power 0.57 0.5 -> 0.755 Inexact Rounded
-pwsx3104 power 0.057 0.5 -> 0.239 Inexact Rounded
-pwsx3105 power 0.58 0.5 -> 0.762 Inexact Rounded
-pwsx3106 power 0.058 0.5 -> 0.241 Inexact Rounded
-pwsx3107 power 0.59 0.5 -> 0.768 Inexact Rounded
-pwsx3108 power 0.059 0.5 -> 0.243 Inexact Rounded
-pwsx3109 power 0.61 0.5 -> 0.781 Inexact Rounded
-pwsx3110 power 0.061 0.5 -> 0.247 Inexact Rounded
-pwsx3111 power 0.62 0.5 -> 0.787 Inexact Rounded
-pwsx3112 power 0.062 0.5 -> 0.249 Inexact Rounded
-pwsx3113 power 0.63 0.5 -> 0.794 Inexact Rounded
-pwsx3114 power 0.063 0.5 -> 0.251 Inexact Rounded
-pwsx3115 power 0.64 0.5 -> 0.800 Inexact Rounded
-pwsx3116 power 0.064 0.5 -> 0.253 Inexact Rounded
-pwsx3117 power 0.65 0.5 -> 0.806 Inexact Rounded
-pwsx3118 power 0.065 0.5 -> 0.255 Inexact Rounded
-pwsx3119 power 0.66 0.5 -> 0.812 Inexact Rounded
-pwsx3120 power 0.066 0.5 -> 0.257 Inexact Rounded
-pwsx3121 power 0.67 0.5 -> 0.819 Inexact Rounded
-pwsx3122 power 0.067 0.5 -> 0.259 Inexact Rounded
-pwsx3123 power 0.68 0.5 -> 0.825 Inexact Rounded
-pwsx3124 power 0.068 0.5 -> 0.261 Inexact Rounded
-pwsx3125 power 0.69 0.5 -> 0.831 Inexact Rounded
-pwsx3126 power 0.069 0.5 -> 0.263 Inexact Rounded
-pwsx3127 power 0.71 0.5 -> 0.843 Inexact Rounded
-pwsx3128 power 0.071 0.5 -> 0.266 Inexact Rounded
-pwsx3129 power 0.72 0.5 -> 0.849 Inexact Rounded
-pwsx3130 power 0.072 0.5 -> 0.268 Inexact Rounded
-pwsx3131 power 0.73 0.5 -> 0.854 Inexact Rounded
-pwsx3132 power 0.073 0.5 -> 0.270 Inexact Rounded
-pwsx3133 power 0.74 0.5 -> 0.860 Inexact Rounded
-pwsx3134 power 0.074 0.5 -> 0.272 Inexact Rounded
-pwsx3135 power 0.75 0.5 -> 0.866 Inexact Rounded
-pwsx3136 power 0.075 0.5 -> 0.274 Inexact Rounded
-pwsx3137 power 0.76 0.5 -> 0.872 Inexact Rounded
-pwsx3138 power 0.076 0.5 -> 0.276 Inexact Rounded
-pwsx3139 power 0.77 0.5 -> 0.877 Inexact Rounded
-pwsx3140 power 0.077 0.5 -> 0.277 Inexact Rounded
-pwsx3141 power 0.78 0.5 -> 0.883 Inexact Rounded
-pwsx3142 power 0.078 0.5 -> 0.279 Inexact Rounded
-pwsx3143 power 0.79 0.5 -> 0.889 Inexact Rounded
-pwsx3144 power 0.079 0.5 -> 0.281 Inexact Rounded
-pwsx3145 power 0.81 0.5 -> 0.900 Inexact Rounded
-pwsx3146 power 0.081 0.5 -> 0.285 Inexact Rounded
-pwsx3147 power 0.82 0.5 -> 0.906 Inexact Rounded
-pwsx3148 power 0.082 0.5 -> 0.286 Inexact Rounded
-pwsx3149 power 0.83 0.5 -> 0.911 Inexact Rounded
-pwsx3150 power 0.083 0.5 -> 0.288 Inexact Rounded
-pwsx3151 power 0.84 0.5 -> 0.917 Inexact Rounded
-pwsx3152 power 0.084 0.5 -> 0.290 Inexact Rounded
-pwsx3153 power 0.85 0.5 -> 0.922 Inexact Rounded
-pwsx3154 power 0.085 0.5 -> 0.292 Inexact Rounded
-pwsx3155 power 0.86 0.5 -> 0.927 Inexact Rounded
-pwsx3156 power 0.086 0.5 -> 0.293 Inexact Rounded
-pwsx3157 power 0.87 0.5 -> 0.933 Inexact Rounded
-pwsx3158 power 0.087 0.5 -> 0.295 Inexact Rounded
-pwsx3159 power 0.88 0.5 -> 0.938 Inexact Rounded
-pwsx3160 power 0.088 0.5 -> 0.297 Inexact Rounded
-pwsx3161 power 0.89 0.5 -> 0.943 Inexact Rounded
-pwsx3162 power 0.089 0.5 -> 0.298 Inexact Rounded
-pwsx3163 power 0.91 0.5 -> 0.954 Inexact Rounded
-pwsx3164 power 0.091 0.5 -> 0.302 Inexact Rounded
-pwsx3165 power 0.92 0.5 -> 0.959 Inexact Rounded
-pwsx3166 power 0.092 0.5 -> 0.303 Inexact Rounded
-pwsx3167 power 0.93 0.5 -> 0.964 Inexact Rounded
-pwsx3168 power 0.093 0.5 -> 0.305 Inexact Rounded
-pwsx3169 power 0.94 0.5 -> 0.970 Inexact Rounded
-pwsx3170 power 0.094 0.5 -> 0.307 Inexact Rounded
-pwsx3171 power 0.95 0.5 -> 0.975 Inexact Rounded
-pwsx3172 power 0.095 0.5 -> 0.308 Inexact Rounded
-pwsx3173 power 0.96 0.5 -> 0.980 Inexact Rounded
-pwsx3174 power 0.096 0.5 -> 0.310 Inexact Rounded
-pwsx3175 power 0.97 0.5 -> 0.985 Inexact Rounded
-pwsx3176 power 0.097 0.5 -> 0.311 Inexact Rounded
-pwsx3177 power 0.98 0.5 -> 0.990 Inexact Rounded
-pwsx3178 power 0.098 0.5 -> 0.313 Inexact Rounded
-pwsx3179 power 0.99 0.5 -> 0.995 Inexact Rounded
-pwsx3180 power 0.099 0.5 -> 0.315 Inexact Rounded
-pwsx3181 power 0.101 0.5 -> 0.318 Inexact Rounded
-pwsx3182 power 0.0101 0.5 -> 0.100 Inexact Rounded
-pwsx3183 power 0.102 0.5 -> 0.319 Inexact Rounded
-pwsx3184 power 0.0102 0.5 -> 0.101 Inexact Rounded
-pwsx3185 power 0.103 0.5 -> 0.321 Inexact Rounded
-pwsx3186 power 0.0103 0.5 -> 0.101 Inexact Rounded
-pwsx3187 power 0.104 0.5 -> 0.322 Inexact Rounded
-pwsx3188 power 0.0104 0.5 -> 0.102 Inexact Rounded
-pwsx3189 power 0.105 0.5 -> 0.324 Inexact Rounded
-pwsx3190 power 0.0105 0.5 -> 0.102 Inexact Rounded
-pwsx3191 power 0.106 0.5 -> 0.326 Inexact Rounded
-pwsx3192 power 0.0106 0.5 -> 0.103 Inexact Rounded
-pwsx3193 power 0.107 0.5 -> 0.327 Inexact Rounded
-pwsx3194 power 0.0107 0.5 -> 0.103 Inexact Rounded
-pwsx3195 power 0.108 0.5 -> 0.329 Inexact Rounded
-pwsx3196 power 0.0108 0.5 -> 0.104 Inexact Rounded
-pwsx3197 power 0.109 0.5 -> 0.330 Inexact Rounded
-pwsx3198 power 0.0109 0.5 -> 0.104 Inexact Rounded
-pwsx3199 power 0.111 0.5 -> 0.333 Inexact Rounded
-pwsx3200 power 0.0111 0.5 -> 0.105 Inexact Rounded
-pwsx3201 power 0.112 0.5 -> 0.335 Inexact Rounded
-pwsx3202 power 0.0112 0.5 -> 0.106 Inexact Rounded
-pwsx3203 power 0.113 0.5 -> 0.336 Inexact Rounded
-pwsx3204 power 0.0113 0.5 -> 0.106 Inexact Rounded
-pwsx3205 power 0.114 0.5 -> 0.338 Inexact Rounded
-pwsx3206 power 0.0114 0.5 -> 0.107 Inexact Rounded
-pwsx3207 power 0.115 0.5 -> 0.339 Inexact Rounded
-pwsx3208 power 0.0115 0.5 -> 0.107 Inexact Rounded
-pwsx3209 power 0.116 0.5 -> 0.341 Inexact Rounded
-pwsx3210 power 0.0116 0.5 -> 0.108 Inexact Rounded
-pwsx3211 power 0.117 0.5 -> 0.342 Inexact Rounded
-pwsx3212 power 0.0117 0.5 -> 0.108 Inexact Rounded
-pwsx3213 power 0.118 0.5 -> 0.344 Inexact Rounded
-pwsx3214 power 0.0118 0.5 -> 0.109 Inexact Rounded
-pwsx3215 power 0.119 0.5 -> 0.345 Inexact Rounded
-pwsx3216 power 0.0119 0.5 -> 0.109 Inexact Rounded
-pwsx3217 power 0.121 0.5 -> 0.348 Inexact Rounded
-pwsx3218 power 0.0121 0.5 -> 0.110 Inexact Rounded
-pwsx3219 power 0.122 0.5 -> 0.349 Inexact Rounded
-pwsx3220 power 0.0122 0.5 -> 0.110 Inexact Rounded
-pwsx3221 power 0.123 0.5 -> 0.351 Inexact Rounded
-pwsx3222 power 0.0123 0.5 -> 0.111 Inexact Rounded
-pwsx3223 power 0.124 0.5 -> 0.352 Inexact Rounded
-pwsx3224 power 0.0124 0.5 -> 0.111 Inexact Rounded
-pwsx3225 power 0.125 0.5 -> 0.354 Inexact Rounded
-pwsx3226 power 0.0125 0.5 -> 0.112 Inexact Rounded
-pwsx3227 power 0.126 0.5 -> 0.355 Inexact Rounded
-pwsx3228 power 0.0126 0.5 -> 0.112 Inexact Rounded
-pwsx3229 power 0.127 0.5 -> 0.356 Inexact Rounded
-pwsx3230 power 0.0127 0.5 -> 0.113 Inexact Rounded
-pwsx3231 power 0.128 0.5 -> 0.358 Inexact Rounded
-pwsx3232 power 0.0128 0.5 -> 0.113 Inexact Rounded
-pwsx3233 power 0.129 0.5 -> 0.359 Inexact Rounded
-pwsx3234 power 0.0129 0.5 -> 0.114 Inexact Rounded
-pwsx3235 power 0.131 0.5 -> 0.362 Inexact Rounded
-pwsx3236 power 0.0131 0.5 -> 0.114 Inexact Rounded
-pwsx3237 power 0.132 0.5 -> 0.363 Inexact Rounded
-pwsx3238 power 0.0132 0.5 -> 0.115 Inexact Rounded
-pwsx3239 power 0.133 0.5 -> 0.365 Inexact Rounded
-pwsx3240 power 0.0133 0.5 -> 0.115 Inexact Rounded
-pwsx3241 power 0.134 0.5 -> 0.366 Inexact Rounded
-pwsx3242 power 0.0134 0.5 -> 0.116 Inexact Rounded
-pwsx3243 power 0.135 0.5 -> 0.367 Inexact Rounded
-pwsx3244 power 0.0135 0.5 -> 0.116 Inexact Rounded
-pwsx3245 power 0.136 0.5 -> 0.369 Inexact Rounded
-pwsx3246 power 0.0136 0.5 -> 0.117 Inexact Rounded
-pwsx3247 power 0.137 0.5 -> 0.370 Inexact Rounded
-pwsx3248 power 0.0137 0.5 -> 0.117 Inexact Rounded
-pwsx3249 power 0.138 0.5 -> 0.371 Inexact Rounded
-pwsx3250 power 0.0138 0.5 -> 0.117 Inexact Rounded
-pwsx3251 power 0.139 0.5 -> 0.373 Inexact Rounded
-pwsx3252 power 0.0139 0.5 -> 0.118 Inexact Rounded
-pwsx3253 power 0.141 0.5 -> 0.375 Inexact Rounded
-pwsx3254 power 0.0141 0.5 -> 0.119 Inexact Rounded
-pwsx3255 power 0.142 0.5 -> 0.377 Inexact Rounded
-pwsx3256 power 0.0142 0.5 -> 0.119 Inexact Rounded
-pwsx3257 power 0.143 0.5 -> 0.378 Inexact Rounded
-pwsx3258 power 0.0143 0.5 -> 0.120 Inexact Rounded
-pwsx3259 power 0.144 0.5 -> 0.379 Inexact Rounded
-pwsx3260 power 0.0144 0.5 -> 0.120 Inexact Rounded
-pwsx3261 power 0.145 0.5 -> 0.381 Inexact Rounded
-pwsx3262 power 0.0145 0.5 -> 0.120 Inexact Rounded
-pwsx3263 power 0.146 0.5 -> 0.382 Inexact Rounded
-pwsx3264 power 0.0146 0.5 -> 0.121 Inexact Rounded
-pwsx3265 power 0.147 0.5 -> 0.383 Inexact Rounded
-pwsx3266 power 0.0147 0.5 -> 0.121 Inexact Rounded
-pwsx3267 power 0.148 0.5 -> 0.385 Inexact Rounded
-pwsx3268 power 0.0148 0.5 -> 0.122 Inexact Rounded
-pwsx3269 power 0.149 0.5 -> 0.386 Inexact Rounded
-pwsx3270 power 0.0149 0.5 -> 0.122 Inexact Rounded
-pwsx3271 power 0.151 0.5 -> 0.389 Inexact Rounded
-pwsx3272 power 0.0151 0.5 -> 0.123 Inexact Rounded
-pwsx3273 power 0.152 0.5 -> 0.390 Inexact Rounded
-pwsx3274 power 0.0152 0.5 -> 0.123 Inexact Rounded
-pwsx3275 power 0.153 0.5 -> 0.391 Inexact Rounded
-pwsx3276 power 0.0153 0.5 -> 0.124 Inexact Rounded
-pwsx3277 power 0.154 0.5 -> 0.392 Inexact Rounded
-pwsx3278 power 0.0154 0.5 -> 0.124 Inexact Rounded
-pwsx3279 power 0.155 0.5 -> 0.394 Inexact Rounded
-pwsx3280 power 0.0155 0.5 -> 0.124 Inexact Rounded
-pwsx3281 power 0.156 0.5 -> 0.395 Inexact Rounded
-pwsx3282 power 0.0156 0.5 -> 0.125 Inexact Rounded
-pwsx3283 power 0.157 0.5 -> 0.396 Inexact Rounded
-pwsx3284 power 0.0157 0.5 -> 0.125 Inexact Rounded
-pwsx3285 power 0.158 0.5 -> 0.397 Inexact Rounded
-pwsx3286 power 0.0158 0.5 -> 0.126 Inexact Rounded
-pwsx3287 power 0.159 0.5 -> 0.399 Inexact Rounded
-pwsx3288 power 0.0159 0.5 -> 0.126 Inexact Rounded
-pwsx3289 power 0.161 0.5 -> 0.401 Inexact Rounded
-pwsx3290 power 0.0161 0.5 -> 0.127 Inexact Rounded
-pwsx3291 power 0.162 0.5 -> 0.402 Inexact Rounded
-pwsx3292 power 0.0162 0.5 -> 0.127 Inexact Rounded
-pwsx3293 power 0.163 0.5 -> 0.404 Inexact Rounded
-pwsx3294 power 0.0163 0.5 -> 0.128 Inexact Rounded
-pwsx3295 power 0.164 0.5 -> 0.405 Inexact Rounded
-pwsx3296 power 0.0164 0.5 -> 0.128 Inexact Rounded
-pwsx3297 power 0.165 0.5 -> 0.406 Inexact Rounded
-pwsx3298 power 0.0165 0.5 -> 0.128 Inexact Rounded
-pwsx3299 power 0.166 0.5 -> 0.407 Inexact Rounded
-pwsx3300 power 0.0166 0.5 -> 0.129 Inexact Rounded
-pwsx3301 power 0.167 0.5 -> 0.409 Inexact Rounded
-pwsx3302 power 0.0167 0.5 -> 0.129 Inexact Rounded
-pwsx3303 power 0.168 0.5 -> 0.410 Inexact Rounded
-pwsx3304 power 0.0168 0.5 -> 0.130 Inexact Rounded
-pwsx3305 power 0.169 0.5 -> 0.411 Inexact Rounded
-pwsx3306 power 0.0169 0.5 -> 0.130 Inexact Rounded
-pwsx3307 power 0.171 0.5 -> 0.414 Inexact Rounded
-pwsx3308 power 0.0171 0.5 -> 0.131 Inexact Rounded
-pwsx3309 power 0.172 0.5 -> 0.415 Inexact Rounded
-pwsx3310 power 0.0172 0.5 -> 0.131 Inexact Rounded
-pwsx3311 power 0.173 0.5 -> 0.416 Inexact Rounded
-pwsx3312 power 0.0173 0.5 -> 0.132 Inexact Rounded
-pwsx3313 power 0.174 0.5 -> 0.417 Inexact Rounded
-pwsx3314 power 0.0174 0.5 -> 0.132 Inexact Rounded
-pwsx3315 power 0.175 0.5 -> 0.418 Inexact Rounded
-pwsx3316 power 0.0175 0.5 -> 0.132 Inexact Rounded
-pwsx3317 power 0.176 0.5 -> 0.420 Inexact Rounded
-pwsx3318 power 0.0176 0.5 -> 0.133 Inexact Rounded
-pwsx3319 power 0.177 0.5 -> 0.421 Inexact Rounded
-pwsx3320 power 0.0177 0.5 -> 0.133 Inexact Rounded
-pwsx3321 power 0.178 0.5 -> 0.422 Inexact Rounded
-pwsx3322 power 0.0178 0.5 -> 0.133 Inexact Rounded
-pwsx3323 power 0.179 0.5 -> 0.423 Inexact Rounded
-pwsx3324 power 0.0179 0.5 -> 0.134 Inexact Rounded
-pwsx3325 power 0.181 0.5 -> 0.425 Inexact Rounded
-pwsx3326 power 0.0181 0.5 -> 0.135 Inexact Rounded
-pwsx3327 power 0.182 0.5 -> 0.427 Inexact Rounded
-pwsx3328 power 0.0182 0.5 -> 0.135 Inexact Rounded
-pwsx3329 power 0.183 0.5 -> 0.428 Inexact Rounded
-pwsx3330 power 0.0183 0.5 -> 0.135 Inexact Rounded
-pwsx3331 power 0.184 0.5 -> 0.429 Inexact Rounded
-pwsx3332 power 0.0184 0.5 -> 0.136 Inexact Rounded
-pwsx3333 power 0.185 0.5 -> 0.430 Inexact Rounded
-pwsx3334 power 0.0185 0.5 -> 0.136 Inexact Rounded
-pwsx3335 power 0.186 0.5 -> 0.431 Inexact Rounded
-pwsx3336 power 0.0186 0.5 -> 0.136 Inexact Rounded
-pwsx3337 power 0.187 0.5 -> 0.432 Inexact Rounded
-pwsx3338 power 0.0187 0.5 -> 0.137 Inexact Rounded
-pwsx3339 power 0.188 0.5 -> 0.434 Inexact Rounded
-pwsx3340 power 0.0188 0.5 -> 0.137 Inexact Rounded
-pwsx3341 power 0.189 0.5 -> 0.435 Inexact Rounded
-pwsx3342 power 0.0189 0.5 -> 0.137 Inexact Rounded
-pwsx3343 power 0.191 0.5 -> 0.437 Inexact Rounded
-pwsx3344 power 0.0191 0.5 -> 0.138 Inexact Rounded
-pwsx3345 power 0.192 0.5 -> 0.438 Inexact Rounded
-pwsx3346 power 0.0192 0.5 -> 0.139 Inexact Rounded
-pwsx3347 power 0.193 0.5 -> 0.439 Inexact Rounded
-pwsx3348 power 0.0193 0.5 -> 0.139 Inexact Rounded
-pwsx3349 power 0.194 0.5 -> 0.440 Inexact Rounded
-pwsx3350 power 0.0194 0.5 -> 0.139 Inexact Rounded
-pwsx3351 power 0.195 0.5 -> 0.442 Inexact Rounded
-pwsx3352 power 0.0195 0.5 -> 0.140 Inexact Rounded
-pwsx3353 power 0.196 0.5 -> 0.443 Inexact Rounded
-pwsx3354 power 0.0196 0.5 -> 0.140 Inexact Rounded
-pwsx3355 power 0.197 0.5 -> 0.444 Inexact Rounded
-pwsx3356 power 0.0197 0.5 -> 0.140 Inexact Rounded
-pwsx3357 power 0.198 0.5 -> 0.445 Inexact Rounded
-pwsx3358 power 0.0198 0.5 -> 0.141 Inexact Rounded
-pwsx3359 power 0.199 0.5 -> 0.446 Inexact Rounded
-pwsx3360 power 0.0199 0.5 -> 0.141 Inexact Rounded
-pwsx3361 power 0.201 0.5 -> 0.448 Inexact Rounded
-pwsx3362 power 0.0201 0.5 -> 0.142 Inexact Rounded
-pwsx3363 power 0.202 0.5 -> 0.449 Inexact Rounded
-pwsx3364 power 0.0202 0.5 -> 0.142 Inexact Rounded
-pwsx3365 power 0.203 0.5 -> 0.451 Inexact Rounded
-pwsx3366 power 0.0203 0.5 -> 0.142 Inexact Rounded
-pwsx3367 power 0.204 0.5 -> 0.452 Inexact Rounded
-pwsx3368 power 0.0204 0.5 -> 0.143 Inexact Rounded
-pwsx3369 power 0.205 0.5 -> 0.453 Inexact Rounded
-pwsx3370 power 0.0205 0.5 -> 0.143 Inexact Rounded
-pwsx3371 power 0.206 0.5 -> 0.454 Inexact Rounded
-pwsx3372 power 0.0206 0.5 -> 0.144 Inexact Rounded
-pwsx3373 power 0.207 0.5 -> 0.455 Inexact Rounded
-pwsx3374 power 0.0207 0.5 -> 0.144 Inexact Rounded
-pwsx3375 power 0.208 0.5 -> 0.456 Inexact Rounded
-pwsx3376 power 0.0208 0.5 -> 0.144 Inexact Rounded
-pwsx3377 power 0.209 0.5 -> 0.457 Inexact Rounded
-pwsx3378 power 0.0209 0.5 -> 0.145 Inexact Rounded
-pwsx3379 power 0.211 0.5 -> 0.459 Inexact Rounded
-pwsx3380 power 0.0211 0.5 -> 0.145 Inexact Rounded
-pwsx3381 power 0.212 0.5 -> 0.460 Inexact Rounded
-pwsx3382 power 0.0212 0.5 -> 0.146 Inexact Rounded
-pwsx3383 power 0.213 0.5 -> 0.462 Inexact Rounded
-pwsx3384 power 0.0213 0.5 -> 0.146 Inexact Rounded
-pwsx3385 power 0.214 0.5 -> 0.463 Inexact Rounded
-pwsx3386 power 0.0214 0.5 -> 0.146 Inexact Rounded
-pwsx3387 power 0.215 0.5 -> 0.464 Inexact Rounded
-pwsx3388 power 0.0215 0.5 -> 0.147 Inexact Rounded
-pwsx3389 power 0.216 0.5 -> 0.465 Inexact Rounded
-pwsx3390 power 0.0216 0.5 -> 0.147 Inexact Rounded
-pwsx3391 power 0.217 0.5 -> 0.466 Inexact Rounded
-pwsx3392 power 0.0217 0.5 -> 0.147 Inexact Rounded
-pwsx3393 power 0.218 0.5 -> 0.467 Inexact Rounded
-pwsx3394 power 0.0218 0.5 -> 0.148 Inexact Rounded
-pwsx3395 power 0.219 0.5 -> 0.468 Inexact Rounded
-pwsx3396 power 0.0219 0.5 -> 0.148 Inexact Rounded
-pwsx3397 power 0.221 0.5 -> 0.470 Inexact Rounded
-pwsx3398 power 0.0221 0.5 -> 0.149 Inexact Rounded
-pwsx3399 power 0.222 0.5 -> 0.471 Inexact Rounded
-pwsx3400 power 0.0222 0.5 -> 0.149 Inexact Rounded
-pwsx3401 power 0.223 0.5 -> 0.472 Inexact Rounded
-pwsx3402 power 0.0223 0.5 -> 0.149 Inexact Rounded
-pwsx3403 power 0.224 0.5 -> 0.473 Inexact Rounded
-pwsx3404 power 0.0224 0.5 -> 0.150 Inexact Rounded
-pwsx3405 power 0.225 0.5 -> 0.474 Inexact Rounded
-pwsx3406 power 0.0225 0.5 -> 0.150 Inexact Rounded
-pwsx3407 power 0.226 0.5 -> 0.475 Inexact Rounded
-pwsx3408 power 0.0226 0.5 -> 0.150 Inexact Rounded
-pwsx3409 power 0.227 0.5 -> 0.476 Inexact Rounded
-pwsx3410 power 0.0227 0.5 -> 0.151 Inexact Rounded
-pwsx3411 power 0.228 0.5 -> 0.477 Inexact Rounded
-pwsx3412 power 0.0228 0.5 -> 0.151 Inexact Rounded
-pwsx3413 power 0.229 0.5 -> 0.479 Inexact Rounded
-pwsx3414 power 0.0229 0.5 -> 0.151 Inexact Rounded
-pwsx3415 power 0.231 0.5 -> 0.481 Inexact Rounded
-pwsx3416 power 0.0231 0.5 -> 0.152 Inexact Rounded
-pwsx3417 power 0.232 0.5 -> 0.482 Inexact Rounded
-pwsx3418 power 0.0232 0.5 -> 0.152 Inexact Rounded
-pwsx3419 power 0.233 0.5 -> 0.483 Inexact Rounded
-pwsx3420 power 0.0233 0.5 -> 0.153 Inexact Rounded
-pwsx3421 power 0.234 0.5 -> 0.484 Inexact Rounded
-pwsx3422 power 0.0234 0.5 -> 0.153 Inexact Rounded
-pwsx3423 power 0.235 0.5 -> 0.485 Inexact Rounded
-pwsx3424 power 0.0235 0.5 -> 0.153 Inexact Rounded
-pwsx3425 power 0.236 0.5 -> 0.486 Inexact Rounded
-pwsx3426 power 0.0236 0.5 -> 0.154 Inexact Rounded
-pwsx3427 power 0.237 0.5 -> 0.487 Inexact Rounded
-pwsx3428 power 0.0237 0.5 -> 0.154 Inexact Rounded
-pwsx3429 power 0.238 0.5 -> 0.488 Inexact Rounded
-pwsx3430 power 0.0238 0.5 -> 0.154 Inexact Rounded
-pwsx3431 power 0.239 0.5 -> 0.489 Inexact Rounded
-pwsx3432 power 0.0239 0.5 -> 0.155 Inexact Rounded
-pwsx3433 power 0.241 0.5 -> 0.491 Inexact Rounded
-pwsx3434 power 0.0241 0.5 -> 0.155 Inexact Rounded
-pwsx3435 power 0.242 0.5 -> 0.492 Inexact Rounded
-pwsx3436 power 0.0242 0.5 -> 0.156 Inexact Rounded
-pwsx3437 power 0.243 0.5 -> 0.493 Inexact Rounded
-pwsx3438 power 0.0243 0.5 -> 0.156 Inexact Rounded
-pwsx3439 power 0.244 0.5 -> 0.494 Inexact Rounded
-pwsx3440 power 0.0244 0.5 -> 0.156 Inexact Rounded
-pwsx3441 power 0.245 0.5 -> 0.495 Inexact Rounded
-pwsx3442 power 0.0245 0.5 -> 0.157 Inexact Rounded
-pwsx3443 power 0.246 0.5 -> 0.496 Inexact Rounded
-pwsx3444 power 0.0246 0.5 -> 0.157 Inexact Rounded
-pwsx3445 power 0.247 0.5 -> 0.497 Inexact Rounded
-pwsx3446 power 0.0247 0.5 -> 0.157 Inexact Rounded
-pwsx3447 power 0.248 0.5 -> 0.498 Inexact Rounded
-pwsx3448 power 0.0248 0.5 -> 0.157 Inexact Rounded
-pwsx3449 power 0.249 0.5 -> 0.499 Inexact Rounded
-pwsx3450 power 0.0249 0.5 -> 0.158 Inexact Rounded
-pwsx3451 power 0.251 0.5 -> 0.501 Inexact Rounded
-pwsx3452 power 0.0251 0.5 -> 0.158 Inexact Rounded
-pwsx3453 power 0.252 0.5 -> 0.502 Inexact Rounded
-pwsx3454 power 0.0252 0.5 -> 0.159 Inexact Rounded
-pwsx3455 power 0.253 0.5 -> 0.503 Inexact Rounded
-pwsx3456 power 0.0253 0.5 -> 0.159 Inexact Rounded
-pwsx3457 power 0.254 0.5 -> 0.504 Inexact Rounded
-pwsx3458 power 0.0254 0.5 -> 0.159 Inexact Rounded
-pwsx3459 power 0.255 0.5 -> 0.505 Inexact Rounded
-pwsx3460 power 0.0255 0.5 -> 0.160 Inexact Rounded
-pwsx3461 power 0.256 0.5 -> 0.506 Inexact Rounded
-pwsx3462 power 0.0256 0.5 -> 0.160 Inexact Rounded
-pwsx3463 power 0.257 0.5 -> 0.507 Inexact Rounded
-pwsx3464 power 0.0257 0.5 -> 0.160 Inexact Rounded
-pwsx3465 power 0.258 0.5 -> 0.508 Inexact Rounded
-pwsx3466 power 0.0258 0.5 -> 0.161 Inexact Rounded
-pwsx3467 power 0.259 0.5 -> 0.509 Inexact Rounded
-pwsx3468 power 0.0259 0.5 -> 0.161 Inexact Rounded
-pwsx3469 power 0.261 0.5 -> 0.511 Inexact Rounded
-pwsx3470 power 0.0261 0.5 -> 0.162 Inexact Rounded
-pwsx3471 power 0.262 0.5 -> 0.512 Inexact Rounded
-pwsx3472 power 0.0262 0.5 -> 0.162 Inexact Rounded
-pwsx3473 power 0.263 0.5 -> 0.513 Inexact Rounded
-pwsx3474 power 0.0263 0.5 -> 0.162 Inexact Rounded
-pwsx3475 power 0.264 0.5 -> 0.514 Inexact Rounded
-pwsx3476 power 0.0264 0.5 -> 0.162 Inexact Rounded
-pwsx3477 power 0.265 0.5 -> 0.515 Inexact Rounded
-pwsx3478 power 0.0265 0.5 -> 0.163 Inexact Rounded
-pwsx3479 power 0.266 0.5 -> 0.516 Inexact Rounded
-pwsx3480 power 0.0266 0.5 -> 0.163 Inexact Rounded
-pwsx3481 power 0.267 0.5 -> 0.517 Inexact Rounded
-pwsx3482 power 0.0267 0.5 -> 0.163 Inexact Rounded
-pwsx3483 power 0.268 0.5 -> 0.518 Inexact Rounded
-pwsx3484 power 0.0268 0.5 -> 0.164 Inexact Rounded
-pwsx3485 power 0.269 0.5 -> 0.519 Inexact Rounded
-pwsx3486 power 0.0269 0.5 -> 0.164 Inexact Rounded
-pwsx3487 power 0.271 0.5 -> 0.521 Inexact Rounded
-pwsx3488 power 0.0271 0.5 -> 0.165 Inexact Rounded
-pwsx3489 power 0.272 0.5 -> 0.522 Inexact Rounded
-pwsx3490 power 0.0272 0.5 -> 0.165 Inexact Rounded
-pwsx3491 power 0.273 0.5 -> 0.522 Inexact Rounded
-pwsx3492 power 0.0273 0.5 -> 0.165 Inexact Rounded
-pwsx3493 power 0.274 0.5 -> 0.523 Inexact Rounded
-pwsx3494 power 0.0274 0.5 -> 0.166 Inexact Rounded
-pwsx3495 power 0.275 0.5 -> 0.524 Inexact Rounded
-pwsx3496 power 0.0275 0.5 -> 0.166 Inexact Rounded
-pwsx3497 power 0.276 0.5 -> 0.525 Inexact Rounded
-pwsx3498 power 0.0276 0.5 -> 0.166 Inexact Rounded
-pwsx3499 power 0.277 0.5 -> 0.526 Inexact Rounded
-pwsx3500 power 0.0277 0.5 -> 0.166 Inexact Rounded
-pwsx3501 power 0.278 0.5 -> 0.527 Inexact Rounded
-pwsx3502 power 0.0278 0.5 -> 0.167 Inexact Rounded
-pwsx3503 power 0.279 0.5 -> 0.528 Inexact Rounded
-pwsx3504 power 0.0279 0.5 -> 0.167 Inexact Rounded
-pwsx3505 power 0.281 0.5 -> 0.530 Inexact Rounded
-pwsx3506 power 0.0281 0.5 -> 0.168 Inexact Rounded
-pwsx3507 power 0.282 0.5 -> 0.531 Inexact Rounded
-pwsx3508 power 0.0282 0.5 -> 0.168 Inexact Rounded
-pwsx3509 power 0.283 0.5 -> 0.532 Inexact Rounded
-pwsx3510 power 0.0283 0.5 -> 0.168 Inexact Rounded
-pwsx3511 power 0.284 0.5 -> 0.533 Inexact Rounded
-pwsx3512 power 0.0284 0.5 -> 0.169 Inexact Rounded
-pwsx3513 power 0.285 0.5 -> 0.534 Inexact Rounded
-pwsx3514 power 0.0285 0.5 -> 0.169 Inexact Rounded
-pwsx3515 power 0.286 0.5 -> 0.535 Inexact Rounded
-pwsx3516 power 0.0286 0.5 -> 0.169 Inexact Rounded
-pwsx3517 power 0.287 0.5 -> 0.536 Inexact Rounded
-pwsx3518 power 0.0287 0.5 -> 0.169 Inexact Rounded
-pwsx3519 power 0.288 0.5 -> 0.537 Inexact Rounded
-pwsx3520 power 0.0288 0.5 -> 0.170 Inexact Rounded
-pwsx3521 power 0.289 0.5 -> 0.538 Inexact Rounded
-pwsx3522 power 0.0289 0.5 -> 0.170 Inexact Rounded
-pwsx3523 power 0.291 0.5 -> 0.539 Inexact Rounded
-pwsx3524 power 0.0291 0.5 -> 0.171 Inexact Rounded
-pwsx3525 power 0.292 0.5 -> 0.540 Inexact Rounded
-pwsx3526 power 0.0292 0.5 -> 0.171 Inexact Rounded
-pwsx3527 power 0.293 0.5 -> 0.541 Inexact Rounded
-pwsx3528 power 0.0293 0.5 -> 0.171 Inexact Rounded
-pwsx3529 power 0.294 0.5 -> 0.542 Inexact Rounded
-pwsx3530 power 0.0294 0.5 -> 0.171 Inexact Rounded
-pwsx3531 power 0.295 0.5 -> 0.543 Inexact Rounded
-pwsx3532 power 0.0295 0.5 -> 0.172 Inexact Rounded
-pwsx3533 power 0.296 0.5 -> 0.544 Inexact Rounded
-pwsx3534 power 0.0296 0.5 -> 0.172 Inexact Rounded
-pwsx3535 power 0.297 0.5 -> 0.545 Inexact Rounded
-pwsx3536 power 0.0297 0.5 -> 0.172 Inexact Rounded
-pwsx3537 power 0.298 0.5 -> 0.546 Inexact Rounded
-pwsx3538 power 0.0298 0.5 -> 0.173 Inexact Rounded
-pwsx3539 power 0.299 0.5 -> 0.547 Inexact Rounded
-pwsx3540 power 0.0299 0.5 -> 0.173 Inexact Rounded
-pwsx3541 power 0.301 0.5 -> 0.549 Inexact Rounded
-pwsx3542 power 0.0301 0.5 -> 0.173 Inexact Rounded
-pwsx3543 power 0.302 0.5 -> 0.550 Inexact Rounded
-pwsx3544 power 0.0302 0.5 -> 0.174 Inexact Rounded
-pwsx3545 power 0.303 0.5 -> 0.550 Inexact Rounded
-pwsx3546 power 0.0303 0.5 -> 0.174 Inexact Rounded
-pwsx3547 power 0.304 0.5 -> 0.551 Inexact Rounded
-pwsx3548 power 0.0304 0.5 -> 0.174 Inexact Rounded
-pwsx3549 power 0.305 0.5 -> 0.552 Inexact Rounded
-pwsx3550 power 0.0305 0.5 -> 0.175 Inexact Rounded
-pwsx3551 power 0.306 0.5 -> 0.553 Inexact Rounded
-pwsx3552 power 0.0306 0.5 -> 0.175 Inexact Rounded
-pwsx3553 power 0.307 0.5 -> 0.554 Inexact Rounded
-pwsx3554 power 0.0307 0.5 -> 0.175 Inexact Rounded
-pwsx3555 power 0.308 0.5 -> 0.555 Inexact Rounded
-pwsx3556 power 0.0308 0.5 -> 0.175 Inexact Rounded
-pwsx3557 power 0.309 0.5 -> 0.556 Inexact Rounded
-pwsx3558 power 0.0309 0.5 -> 0.176 Inexact Rounded
-pwsx3559 power 0.311 0.5 -> 0.558 Inexact Rounded
-pwsx3560 power 0.0311 0.5 -> 0.176 Inexact Rounded
-pwsx3561 power 0.312 0.5 -> 0.559 Inexact Rounded
-pwsx3562 power 0.0312 0.5 -> 0.177 Inexact Rounded
-pwsx3563 power 0.313 0.5 -> 0.559 Inexact Rounded
-pwsx3564 power 0.0313 0.5 -> 0.177 Inexact Rounded
-pwsx3565 power 0.314 0.5 -> 0.560 Inexact Rounded
-pwsx3566 power 0.0314 0.5 -> 0.177 Inexact Rounded
-pwsx3567 power 0.315 0.5 -> 0.561 Inexact Rounded
-pwsx3568 power 0.0315 0.5 -> 0.177 Inexact Rounded
-pwsx3569 power 0.316 0.5 -> 0.562 Inexact Rounded
-pwsx3570 power 0.0316 0.5 -> 0.178 Inexact Rounded
-pwsx3571 power 0.317 0.5 -> 0.563 Inexact Rounded
-pwsx3572 power 0.0317 0.5 -> 0.178 Inexact Rounded
-pwsx3573 power 0.318 0.5 -> 0.564 Inexact Rounded
-pwsx3574 power 0.0318 0.5 -> 0.178 Inexact Rounded
-pwsx3575 power 0.319 0.5 -> 0.565 Inexact Rounded
-pwsx3576 power 0.0319 0.5 -> 0.179 Inexact Rounded
-pwsx3577 power 0.321 0.5 -> 0.567 Inexact Rounded
-pwsx3578 power 0.0321 0.5 -> 0.179 Inexact Rounded
-pwsx3579 power 0.322 0.5 -> 0.567 Inexact Rounded
-pwsx3580 power 0.0322 0.5 -> 0.179 Inexact Rounded
-pwsx3581 power 0.323 0.5 -> 0.568 Inexact Rounded
-pwsx3582 power 0.0323 0.5 -> 0.180 Inexact Rounded
-pwsx3583 power 0.324 0.5 -> 0.569 Inexact Rounded
-pwsx3584 power 0.0324 0.5 -> 0.180 Inexact Rounded
-pwsx3585 power 0.325 0.5 -> 0.570 Inexact Rounded
-pwsx3586 power 0.0325 0.5 -> 0.180 Inexact Rounded
-pwsx3587 power 0.326 0.5 -> 0.571 Inexact Rounded
-pwsx3588 power 0.0326 0.5 -> 0.181 Inexact Rounded
-pwsx3589 power 0.327 0.5 -> 0.572 Inexact Rounded
-pwsx3590 power 0.0327 0.5 -> 0.181 Inexact Rounded
-pwsx3591 power 0.328 0.5 -> 0.573 Inexact Rounded
-pwsx3592 power 0.0328 0.5 -> 0.181 Inexact Rounded
-pwsx3593 power 0.329 0.5 -> 0.574 Inexact Rounded
-pwsx3594 power 0.0329 0.5 -> 0.181 Inexact Rounded
-pwsx3595 power 0.331 0.5 -> 0.575 Inexact Rounded
-pwsx3596 power 0.0331 0.5 -> 0.182 Inexact Rounded
-pwsx3597 power 0.332 0.5 -> 0.576 Inexact Rounded
-pwsx3598 power 0.0332 0.5 -> 0.182 Inexact Rounded
-pwsx3599 power 0.333 0.5 -> 0.577 Inexact Rounded
-pwsx3600 power 0.0333 0.5 -> 0.182 Inexact Rounded
-pwsx3601 power 0.334 0.5 -> 0.578 Inexact Rounded
-pwsx3602 power 0.0334 0.5 -> 0.183 Inexact Rounded
-pwsx3603 power 0.335 0.5 -> 0.579 Inexact Rounded
-pwsx3604 power 0.0335 0.5 -> 0.183 Inexact Rounded
-pwsx3605 power 0.336 0.5 -> 0.580 Inexact Rounded
-pwsx3606 power 0.0336 0.5 -> 0.183 Inexact Rounded
-pwsx3607 power 0.337 0.5 -> 0.581 Inexact Rounded
-pwsx3608 power 0.0337 0.5 -> 0.184 Inexact Rounded
-pwsx3609 power 0.338 0.5 -> 0.581 Inexact Rounded
-pwsx3610 power 0.0338 0.5 -> 0.184 Inexact Rounded
-pwsx3611 power 0.339 0.5 -> 0.582 Inexact Rounded
-pwsx3612 power 0.0339 0.5 -> 0.184 Inexact Rounded
-pwsx3613 power 0.341 0.5 -> 0.584 Inexact Rounded
-pwsx3614 power 0.0341 0.5 -> 0.185 Inexact Rounded
-pwsx3615 power 0.342 0.5 -> 0.585 Inexact Rounded
-pwsx3616 power 0.0342 0.5 -> 0.185 Inexact Rounded
-pwsx3617 power 0.343 0.5 -> 0.586 Inexact Rounded
-pwsx3618 power 0.0343 0.5 -> 0.185 Inexact Rounded
-pwsx3619 power 0.344 0.5 -> 0.587 Inexact Rounded
-pwsx3620 power 0.0344 0.5 -> 0.185 Inexact Rounded
-pwsx3621 power 0.345 0.5 -> 0.587 Inexact Rounded
-pwsx3622 power 0.0345 0.5 -> 0.186 Inexact Rounded
-pwsx3623 power 0.346 0.5 -> 0.588 Inexact Rounded
-pwsx3624 power 0.0346 0.5 -> 0.186 Inexact Rounded
-pwsx3625 power 0.347 0.5 -> 0.589 Inexact Rounded
-pwsx3626 power 0.0347 0.5 -> 0.186 Inexact Rounded
-pwsx3627 power 0.348 0.5 -> 0.590 Inexact Rounded
-pwsx3628 power 0.0348 0.5 -> 0.187 Inexact Rounded
-pwsx3629 power 0.349 0.5 -> 0.591 Inexact Rounded
-pwsx3630 power 0.0349 0.5 -> 0.187 Inexact Rounded
-pwsx3631 power 0.351 0.5 -> 0.592 Inexact Rounded
-pwsx3632 power 0.0351 0.5 -> 0.187 Inexact Rounded
-pwsx3633 power 0.352 0.5 -> 0.593 Inexact Rounded
-pwsx3634 power 0.0352 0.5 -> 0.188 Inexact Rounded
-pwsx3635 power 0.353 0.5 -> 0.594 Inexact Rounded
-pwsx3636 power 0.0353 0.5 -> 0.188 Inexact Rounded
-pwsx3637 power 0.354 0.5 -> 0.595 Inexact Rounded
-pwsx3638 power 0.0354 0.5 -> 0.188 Inexact Rounded
-pwsx3639 power 0.355 0.5 -> 0.596 Inexact Rounded
-pwsx3640 power 0.0355 0.5 -> 0.188 Inexact Rounded
-pwsx3641 power 0.356 0.5 -> 0.597 Inexact Rounded
-pwsx3642 power 0.0356 0.5 -> 0.189 Inexact Rounded
-pwsx3643 power 0.357 0.5 -> 0.597 Inexact Rounded
-pwsx3644 power 0.0357 0.5 -> 0.189 Inexact Rounded
-pwsx3645 power 0.358 0.5 -> 0.598 Inexact Rounded
-pwsx3646 power 0.0358 0.5 -> 0.189 Inexact Rounded
-pwsx3647 power 0.359 0.5 -> 0.599 Inexact Rounded
-pwsx3648 power 0.0359 0.5 -> 0.189 Inexact Rounded
-pwsx3649 power 0.361 0.5 -> 0.601 Inexact Rounded
-pwsx3650 power 0.0361 0.5 -> 0.190 Inexact Rounded
-pwsx3651 power 0.362 0.5 -> 0.602 Inexact Rounded
-pwsx3652 power 0.0362 0.5 -> 0.190 Inexact Rounded
-pwsx3653 power 0.363 0.5 -> 0.602 Inexact Rounded
-pwsx3654 power 0.0363 0.5 -> 0.191 Inexact Rounded
-pwsx3655 power 0.364 0.5 -> 0.603 Inexact Rounded
-pwsx3656 power 0.0364 0.5 -> 0.191 Inexact Rounded
-pwsx3657 power 0.365 0.5 -> 0.604 Inexact Rounded
-pwsx3658 power 0.0365 0.5 -> 0.191 Inexact Rounded
-pwsx3659 power 0.366 0.5 -> 0.605 Inexact Rounded
-pwsx3660 power 0.0366 0.5 -> 0.191 Inexact Rounded
-pwsx3661 power 0.367 0.5 -> 0.606 Inexact Rounded
-pwsx3662 power 0.0367 0.5 -> 0.192 Inexact Rounded
-pwsx3663 power 0.368 0.5 -> 0.607 Inexact Rounded
-pwsx3664 power 0.0368 0.5 -> 0.192 Inexact Rounded
-pwsx3665 power 0.369 0.5 -> 0.607 Inexact Rounded
-pwsx3666 power 0.0369 0.5 -> 0.192 Inexact Rounded
-pwsx3667 power 0.371 0.5 -> 0.609 Inexact Rounded
-pwsx3668 power 0.0371 0.5 -> 0.193 Inexact Rounded
-pwsx3669 power 0.372 0.5 -> 0.610 Inexact Rounded
-pwsx3670 power 0.0372 0.5 -> 0.193 Inexact Rounded
-pwsx3671 power 0.373 0.5 -> 0.611 Inexact Rounded
-pwsx3672 power 0.0373 0.5 -> 0.193 Inexact Rounded
-pwsx3673 power 0.374 0.5 -> 0.612 Inexact Rounded
-pwsx3674 power 0.0374 0.5 -> 0.193 Inexact Rounded
-pwsx3675 power 0.375 0.5 -> 0.612 Inexact Rounded
-pwsx3676 power 0.0375 0.5 -> 0.194 Inexact Rounded
-pwsx3677 power 0.376 0.5 -> 0.613 Inexact Rounded
-pwsx3678 power 0.0376 0.5 -> 0.194 Inexact Rounded
-pwsx3679 power 0.377 0.5 -> 0.614 Inexact Rounded
-pwsx3680 power 0.0377 0.5 -> 0.194 Inexact Rounded
-pwsx3681 power 0.378 0.5 -> 0.615 Inexact Rounded
-pwsx3682 power 0.0378 0.5 -> 0.194 Inexact Rounded
-pwsx3683 power 0.379 0.5 -> 0.616 Inexact Rounded
-pwsx3684 power 0.0379 0.5 -> 0.195 Inexact Rounded
-pwsx3685 power 0.381 0.5 -> 0.617 Inexact Rounded
-pwsx3686 power 0.0381 0.5 -> 0.195 Inexact Rounded
-pwsx3687 power 0.382 0.5 -> 0.618 Inexact Rounded
-pwsx3688 power 0.0382 0.5 -> 0.195 Inexact Rounded
-pwsx3689 power 0.383 0.5 -> 0.619 Inexact Rounded
-pwsx3690 power 0.0383 0.5 -> 0.196 Inexact Rounded
-pwsx3691 power 0.384 0.5 -> 0.620 Inexact Rounded
-pwsx3692 power 0.0384 0.5 -> 0.196 Inexact Rounded
-pwsx3693 power 0.385 0.5 -> 0.620 Inexact Rounded
-pwsx3694 power 0.0385 0.5 -> 0.196 Inexact Rounded
-pwsx3695 power 0.386 0.5 -> 0.621 Inexact Rounded
-pwsx3696 power 0.0386 0.5 -> 0.196 Inexact Rounded
-pwsx3697 power 0.387 0.5 -> 0.622 Inexact Rounded
-pwsx3698 power 0.0387 0.5 -> 0.197 Inexact Rounded
-pwsx3699 power 0.388 0.5 -> 0.623 Inexact Rounded
-pwsx3700 power 0.0388 0.5 -> 0.197 Inexact Rounded
-pwsx3701 power 0.389 0.5 -> 0.624 Inexact Rounded
-pwsx3702 power 0.0389 0.5 -> 0.197 Inexact Rounded
-pwsx3703 power 0.391 0.5 -> 0.625 Inexact Rounded
-pwsx3704 power 0.0391 0.5 -> 0.198 Inexact Rounded
-pwsx3705 power 0.392 0.5 -> 0.626 Inexact Rounded
-pwsx3706 power 0.0392 0.5 -> 0.198 Inexact Rounded
-pwsx3707 power 0.393 0.5 -> 0.627 Inexact Rounded
-pwsx3708 power 0.0393 0.5 -> 0.198 Inexact Rounded
-pwsx3709 power 0.394 0.5 -> 0.628 Inexact Rounded
-pwsx3710 power 0.0394 0.5 -> 0.198 Inexact Rounded
-pwsx3711 power 0.395 0.5 -> 0.628 Inexact Rounded
-pwsx3712 power 0.0395 0.5 -> 0.199 Inexact Rounded
-pwsx3713 power 0.396 0.5 -> 0.629 Inexact Rounded
-pwsx3714 power 0.0396 0.5 -> 0.199 Inexact Rounded
-pwsx3715 power 0.397 0.5 -> 0.630 Inexact Rounded
-pwsx3716 power 0.0397 0.5 -> 0.199 Inexact Rounded
-pwsx3717 power 0.398 0.5 -> 0.631 Inexact Rounded
-pwsx3718 power 0.0398 0.5 -> 0.199 Inexact Rounded
-pwsx3719 power 0.399 0.5 -> 0.632 Inexact Rounded
-pwsx3720 power 0.0399 0.5 -> 0.200 Inexact Rounded
-pwsx3721 power 0.401 0.5 -> 0.633 Inexact Rounded
-pwsx3722 power 0.0401 0.5 -> 0.200 Inexact Rounded
-pwsx3723 power 0.402 0.5 -> 0.634 Inexact Rounded
-pwsx3724 power 0.0402 0.5 -> 0.200 Inexact Rounded
-pwsx3725 power 0.403 0.5 -> 0.635 Inexact Rounded
-pwsx3726 power 0.0403 0.5 -> 0.201 Inexact Rounded
-pwsx3727 power 0.404 0.5 -> 0.636 Inexact Rounded
-pwsx3728 power 0.0404 0.5 -> 0.201 Inexact Rounded
-pwsx3729 power 0.405 0.5 -> 0.636 Inexact Rounded
-pwsx3730 power 0.0405 0.5 -> 0.201 Inexact Rounded
-pwsx3731 power 0.406 0.5 -> 0.637 Inexact Rounded
-pwsx3732 power 0.0406 0.5 -> 0.201 Inexact Rounded
-pwsx3733 power 0.407 0.5 -> 0.638 Inexact Rounded
-pwsx3734 power 0.0407 0.5 -> 0.202 Inexact Rounded
-pwsx3735 power 0.408 0.5 -> 0.639 Inexact Rounded
-pwsx3736 power 0.0408 0.5 -> 0.202 Inexact Rounded
-pwsx3737 power 0.409 0.5 -> 0.640 Inexact Rounded
-pwsx3738 power 0.0409 0.5 -> 0.202 Inexact Rounded
-pwsx3739 power 0.411 0.5 -> 0.641 Inexact Rounded
-pwsx3740 power 0.0411 0.5 -> 0.203 Inexact Rounded
-pwsx3741 power 0.412 0.5 -> 0.642 Inexact Rounded
-pwsx3742 power 0.0412 0.5 -> 0.203 Inexact Rounded
-pwsx3743 power 0.413 0.5 -> 0.643 Inexact Rounded
-pwsx3744 power 0.0413 0.5 -> 0.203 Inexact Rounded
-pwsx3745 power 0.414 0.5 -> 0.643 Inexact Rounded
-pwsx3746 power 0.0414 0.5 -> 0.203 Inexact Rounded
-pwsx3747 power 0.415 0.5 -> 0.644 Inexact Rounded
-pwsx3748 power 0.0415 0.5 -> 0.204 Inexact Rounded
-pwsx3749 power 0.416 0.5 -> 0.645 Inexact Rounded
-pwsx3750 power 0.0416 0.5 -> 0.204 Inexact Rounded
-pwsx3751 power 0.417 0.5 -> 0.646 Inexact Rounded
-pwsx3752 power 0.0417 0.5 -> 0.204 Inexact Rounded
-pwsx3753 power 0.418 0.5 -> 0.647 Inexact Rounded
-pwsx3754 power 0.0418 0.5 -> 0.204 Inexact Rounded
-pwsx3755 power 0.419 0.5 -> 0.647 Inexact Rounded
-pwsx3756 power 0.0419 0.5 -> 0.205 Inexact Rounded
-pwsx3757 power 0.421 0.5 -> 0.649 Inexact Rounded
-pwsx3758 power 0.0421 0.5 -> 0.205 Inexact Rounded
-pwsx3759 power 0.422 0.5 -> 0.650 Inexact Rounded
-pwsx3760 power 0.0422 0.5 -> 0.205 Inexact Rounded
-pwsx3761 power 0.423 0.5 -> 0.650 Inexact Rounded
-pwsx3762 power 0.0423 0.5 -> 0.206 Inexact Rounded
-pwsx3763 power 0.424 0.5 -> 0.651 Inexact Rounded
-pwsx3764 power 0.0424 0.5 -> 0.206 Inexact Rounded
-pwsx3765 power 0.425 0.5 -> 0.652 Inexact Rounded
-pwsx3766 power 0.0425 0.5 -> 0.206 Inexact Rounded
-pwsx3767 power 0.426 0.5 -> 0.653 Inexact Rounded
-pwsx3768 power 0.0426 0.5 -> 0.206 Inexact Rounded
-pwsx3769 power 0.427 0.5 -> 0.653 Inexact Rounded
-pwsx3770 power 0.0427 0.5 -> 0.207 Inexact Rounded
-pwsx3771 power 0.428 0.5 -> 0.654 Inexact Rounded
-pwsx3772 power 0.0428 0.5 -> 0.207 Inexact Rounded
-pwsx3773 power 0.429 0.5 -> 0.655 Inexact Rounded
-pwsx3774 power 0.0429 0.5 -> 0.207 Inexact Rounded
-pwsx3775 power 0.431 0.5 -> 0.657 Inexact Rounded
-pwsx3776 power 0.0431 0.5 -> 0.208 Inexact Rounded
-pwsx3777 power 0.432 0.5 -> 0.657 Inexact Rounded
-pwsx3778 power 0.0432 0.5 -> 0.208 Inexact Rounded
-pwsx3779 power 0.433 0.5 -> 0.658 Inexact Rounded
-pwsx3780 power 0.0433 0.5 -> 0.208 Inexact Rounded
-pwsx3781 power 0.434 0.5 -> 0.659 Inexact Rounded
-pwsx3782 power 0.0434 0.5 -> 0.208 Inexact Rounded
-pwsx3783 power 0.435 0.5 -> 0.660 Inexact Rounded
-pwsx3784 power 0.0435 0.5 -> 0.209 Inexact Rounded
-pwsx3785 power 0.436 0.5 -> 0.660 Inexact Rounded
-pwsx3786 power 0.0436 0.5 -> 0.209 Inexact Rounded
-pwsx3787 power 0.437 0.5 -> 0.661 Inexact Rounded
-pwsx3788 power 0.0437 0.5 -> 0.209 Inexact Rounded
-pwsx3789 power 0.438 0.5 -> 0.662 Inexact Rounded
-pwsx3790 power 0.0438 0.5 -> 0.209 Inexact Rounded
-pwsx3791 power 0.439 0.5 -> 0.663 Inexact Rounded
-pwsx3792 power 0.0439 0.5 -> 0.210 Inexact Rounded
-pwsx3793 power 0.441 0.5 -> 0.664 Inexact Rounded
-pwsx3794 power 0.0441 0.5 -> 0.210 Inexact Rounded
-pwsx3795 power 0.442 0.5 -> 0.665 Inexact Rounded
-pwsx3796 power 0.0442 0.5 -> 0.210 Inexact Rounded
-pwsx3797 power 0.443 0.5 -> 0.666 Inexact Rounded
-pwsx3798 power 0.0443 0.5 -> 0.210 Inexact Rounded
-pwsx3799 power 0.444 0.5 -> 0.666 Inexact Rounded
-pwsx3800 power 0.0444 0.5 -> 0.211 Inexact Rounded
-pwsx3801 power 0.445 0.5 -> 0.667 Inexact Rounded
-pwsx3802 power 0.0445 0.5 -> 0.211 Inexact Rounded
-pwsx3803 power 0.446 0.5 -> 0.668 Inexact Rounded
-pwsx3804 power 0.0446 0.5 -> 0.211 Inexact Rounded
-pwsx3805 power 0.447 0.5 -> 0.669 Inexact Rounded
-pwsx3806 power 0.0447 0.5 -> 0.211 Inexact Rounded
-pwsx3807 power 0.448 0.5 -> 0.669 Inexact Rounded
-pwsx3808 power 0.0448 0.5 -> 0.212 Inexact Rounded
-pwsx3809 power 0.449 0.5 -> 0.670 Inexact Rounded
-pwsx3810 power 0.0449 0.5 -> 0.212 Inexact Rounded
-pwsx3811 power 0.451 0.5 -> 0.672 Inexact Rounded
-pwsx3812 power 0.0451 0.5 -> 0.212 Inexact Rounded
-pwsx3813 power 0.452 0.5 -> 0.672 Inexact Rounded
-pwsx3814 power 0.0452 0.5 -> 0.213 Inexact Rounded
-pwsx3815 power 0.453 0.5 -> 0.673 Inexact Rounded
-pwsx3816 power 0.0453 0.5 -> 0.213 Inexact Rounded
-pwsx3817 power 0.454 0.5 -> 0.674 Inexact Rounded
-pwsx3818 power 0.0454 0.5 -> 0.213 Inexact Rounded
-pwsx3819 power 0.455 0.5 -> 0.675 Inexact Rounded
-pwsx3820 power 0.0455 0.5 -> 0.213 Inexact Rounded
-pwsx3821 power 0.456 0.5 -> 0.675 Inexact Rounded
-pwsx3822 power 0.0456 0.5 -> 0.214 Inexact Rounded
-pwsx3823 power 0.457 0.5 -> 0.676 Inexact Rounded
-pwsx3824 power 0.0457 0.5 -> 0.214 Inexact Rounded
-pwsx3825 power 0.458 0.5 -> 0.677 Inexact Rounded
-pwsx3826 power 0.0458 0.5 -> 0.214 Inexact Rounded
-pwsx3827 power 0.459 0.5 -> 0.677 Inexact Rounded
-pwsx3828 power 0.0459 0.5 -> 0.214 Inexact Rounded
-pwsx3829 power 0.461 0.5 -> 0.679 Inexact Rounded
-pwsx3830 power 0.0461 0.5 -> 0.215 Inexact Rounded
-pwsx3831 power 0.462 0.5 -> 0.680 Inexact Rounded
-pwsx3832 power 0.0462 0.5 -> 0.215 Inexact Rounded
-pwsx3833 power 0.463 0.5 -> 0.680 Inexact Rounded
-pwsx3834 power 0.0463 0.5 -> 0.215 Inexact Rounded
-pwsx3835 power 0.464 0.5 -> 0.681 Inexact Rounded
-pwsx3836 power 0.0464 0.5 -> 0.215 Inexact Rounded
-pwsx3837 power 0.465 0.5 -> 0.682 Inexact Rounded
-pwsx3838 power 0.0465 0.5 -> 0.216 Inexact Rounded
-pwsx3839 power 0.466 0.5 -> 0.683 Inexact Rounded
-pwsx3840 power 0.0466 0.5 -> 0.216 Inexact Rounded
-pwsx3841 power 0.467 0.5 -> 0.683 Inexact Rounded
-pwsx3842 power 0.0467 0.5 -> 0.216 Inexact Rounded
-pwsx3843 power 0.468 0.5 -> 0.684 Inexact Rounded
-pwsx3844 power 0.0468 0.5 -> 0.216 Inexact Rounded
-pwsx3845 power 0.469 0.5 -> 0.685 Inexact Rounded
-pwsx3846 power 0.0469 0.5 -> 0.217 Inexact Rounded
-pwsx3847 power 0.471 0.5 -> 0.686 Inexact Rounded
-pwsx3848 power 0.0471 0.5 -> 0.217 Inexact Rounded
-pwsx3849 power 0.472 0.5 -> 0.687 Inexact Rounded
-pwsx3850 power 0.0472 0.5 -> 0.217 Inexact Rounded
-pwsx3851 power 0.473 0.5 -> 0.688 Inexact Rounded
-pwsx3852 power 0.0473 0.5 -> 0.217 Inexact Rounded
-pwsx3853 power 0.474 0.5 -> 0.688 Inexact Rounded
-pwsx3854 power 0.0474 0.5 -> 0.218 Inexact Rounded
-pwsx3855 power 0.475 0.5 -> 0.689 Inexact Rounded
-pwsx3856 power 0.0475 0.5 -> 0.218 Inexact Rounded
-pwsx3857 power 0.476 0.5 -> 0.690 Inexact Rounded
-pwsx3858 power 0.0476 0.5 -> 0.218 Inexact Rounded
-pwsx3859 power 0.477 0.5 -> 0.691 Inexact Rounded
-pwsx3860 power 0.0477 0.5 -> 0.218 Inexact Rounded
-pwsx3861 power 0.478 0.5 -> 0.691 Inexact Rounded
-pwsx3862 power 0.0478 0.5 -> 0.219 Inexact Rounded
-pwsx3863 power 0.479 0.5 -> 0.692 Inexact Rounded
-pwsx3864 power 0.0479 0.5 -> 0.219 Inexact Rounded
-pwsx3865 power 0.481 0.5 -> 0.694 Inexact Rounded
-pwsx3866 power 0.0481 0.5 -> 0.219 Inexact Rounded
-pwsx3867 power 0.482 0.5 -> 0.694 Inexact Rounded
-pwsx3868 power 0.0482 0.5 -> 0.220 Inexact Rounded
-pwsx3869 power 0.483 0.5 -> 0.695 Inexact Rounded
-pwsx3870 power 0.0483 0.5 -> 0.220 Inexact Rounded
-pwsx3871 power 0.484 0.5 -> 0.696 Inexact Rounded
-pwsx3872 power 0.0484 0.5 -> 0.220 Inexact Rounded
-pwsx3873 power 0.485 0.5 -> 0.696 Inexact Rounded
-pwsx3874 power 0.0485 0.5 -> 0.220 Inexact Rounded
-pwsx3875 power 0.486 0.5 -> 0.697 Inexact Rounded
-pwsx3876 power 0.0486 0.5 -> 0.220 Inexact Rounded
-pwsx3877 power 0.487 0.5 -> 0.698 Inexact Rounded
-pwsx3878 power 0.0487 0.5 -> 0.221 Inexact Rounded
-pwsx3879 power 0.488 0.5 -> 0.699 Inexact Rounded
-pwsx3880 power 0.0488 0.5 -> 0.221 Inexact Rounded
-pwsx3881 power 0.489 0.5 -> 0.699 Inexact Rounded
-pwsx3882 power 0.0489 0.5 -> 0.221 Inexact Rounded
-pwsx3883 power 0.491 0.5 -> 0.701 Inexact Rounded
-pwsx3884 power 0.0491 0.5 -> 0.222 Inexact Rounded
-pwsx3885 power 0.492 0.5 -> 0.701 Inexact Rounded
-pwsx3886 power 0.0492 0.5 -> 0.222 Inexact Rounded
-pwsx3887 power 0.493 0.5 -> 0.702 Inexact Rounded
-pwsx3888 power 0.0493 0.5 -> 0.222 Inexact Rounded
-pwsx3889 power 0.494 0.5 -> 0.703 Inexact Rounded
-pwsx3890 power 0.0494 0.5 -> 0.222 Inexact Rounded
-pwsx3891 power 0.495 0.5 -> 0.704 Inexact Rounded
-pwsx3892 power 0.0495 0.5 -> 0.222 Inexact Rounded
-pwsx3893 power 0.496 0.5 -> 0.704 Inexact Rounded
-pwsx3894 power 0.0496 0.5 -> 0.223 Inexact Rounded
-pwsx3895 power 0.497 0.5 -> 0.705 Inexact Rounded
-pwsx3896 power 0.0497 0.5 -> 0.223 Inexact Rounded
-pwsx3897 power 0.498 0.5 -> 0.706 Inexact Rounded
-pwsx3898 power 0.0498 0.5 -> 0.223 Inexact Rounded
-pwsx3899 power 0.499 0.5 -> 0.706 Inexact Rounded
-pwsx3900 power 0.0499 0.5 -> 0.223 Inexact Rounded
-pwsx3901 power 0.501 0.5 -> 0.708 Inexact Rounded
-pwsx3902 power 0.0501 0.5 -> 0.224 Inexact Rounded
-pwsx3903 power 0.502 0.5 -> 0.709 Inexact Rounded
-pwsx3904 power 0.0502 0.5 -> 0.224 Inexact Rounded
-pwsx3905 power 0.503 0.5 -> 0.709 Inexact Rounded
-pwsx3906 power 0.0503 0.5 -> 0.224 Inexact Rounded
-pwsx3907 power 0.504 0.5 -> 0.710 Inexact Rounded
-pwsx3908 power 0.0504 0.5 -> 0.224 Inexact Rounded
-pwsx3909 power 0.505 0.5 -> 0.711 Inexact Rounded
-pwsx3910 power 0.0505 0.5 -> 0.225 Inexact Rounded
-pwsx3911 power 0.506 0.5 -> 0.711 Inexact Rounded
-pwsx3912 power 0.0506 0.5 -> 0.225 Inexact Rounded
-pwsx3913 power 0.507 0.5 -> 0.712 Inexact Rounded
-pwsx3914 power 0.0507 0.5 -> 0.225 Inexact Rounded
-pwsx3915 power 0.508 0.5 -> 0.713 Inexact Rounded
-pwsx3916 power 0.0508 0.5 -> 0.225 Inexact Rounded
-pwsx3917 power 0.509 0.5 -> 0.713 Inexact Rounded
-pwsx3918 power 0.0509 0.5 -> 0.226 Inexact Rounded
-pwsx3919 power 0.511 0.5 -> 0.715 Inexact Rounded
-pwsx3920 power 0.0511 0.5 -> 0.226 Inexact Rounded
-pwsx3921 power 0.512 0.5 -> 0.716 Inexact Rounded
-pwsx3922 power 0.0512 0.5 -> 0.226 Inexact Rounded
-pwsx3923 power 0.513 0.5 -> 0.716 Inexact Rounded
-pwsx3924 power 0.0513 0.5 -> 0.226 Inexact Rounded
-pwsx3925 power 0.514 0.5 -> 0.717 Inexact Rounded
-pwsx3926 power 0.0514 0.5 -> 0.227 Inexact Rounded
-pwsx3927 power 0.515 0.5 -> 0.718 Inexact Rounded
-pwsx3928 power 0.0515 0.5 -> 0.227 Inexact Rounded
-pwsx3929 power 0.516 0.5 -> 0.718 Inexact Rounded
-pwsx3930 power 0.0516 0.5 -> 0.227 Inexact Rounded
-pwsx3931 power 0.517 0.5 -> 0.719 Inexact Rounded
-pwsx3932 power 0.0517 0.5 -> 0.227 Inexact Rounded
-pwsx3933 power 0.518 0.5 -> 0.720 Inexact Rounded
-pwsx3934 power 0.0518 0.5 -> 0.228 Inexact Rounded
-pwsx3935 power 0.519 0.5 -> 0.720 Inexact Rounded
-pwsx3936 power 0.0519 0.5 -> 0.228 Inexact Rounded
-pwsx3937 power 0.521 0.5 -> 0.722 Inexact Rounded
-pwsx3938 power 0.0521 0.5 -> 0.228 Inexact Rounded
-pwsx3939 power 0.522 0.5 -> 0.722 Inexact Rounded
-pwsx3940 power 0.0522 0.5 -> 0.228 Inexact Rounded
-pwsx3941 power 0.523 0.5 -> 0.723 Inexact Rounded
-pwsx3942 power 0.0523 0.5 -> 0.229 Inexact Rounded
-pwsx3943 power 0.524 0.5 -> 0.724 Inexact Rounded
-pwsx3944 power 0.0524 0.5 -> 0.229 Inexact Rounded
-pwsx3945 power 0.525 0.5 -> 0.725 Inexact Rounded
-pwsx3946 power 0.0525 0.5 -> 0.229 Inexact Rounded
-pwsx3947 power 0.526 0.5 -> 0.725 Inexact Rounded
-pwsx3948 power 0.0526 0.5 -> 0.229 Inexact Rounded
-pwsx3949 power 0.527 0.5 -> 0.726 Inexact Rounded
-pwsx3950 power 0.0527 0.5 -> 0.230 Inexact Rounded
-pwsx3951 power 0.528 0.5 -> 0.727 Inexact Rounded
-pwsx3952 power 0.0528 0.5 -> 0.230 Inexact Rounded
-pwsx3953 power 0.529 0.5 -> 0.727 Inexact Rounded
-pwsx3954 power 0.0529 0.5 -> 0.230 Inexact Rounded
-pwsx3955 power 0.531 0.5 -> 0.729 Inexact Rounded
-pwsx3956 power 0.0531 0.5 -> 0.230 Inexact Rounded
-pwsx3957 power 0.532 0.5 -> 0.729 Inexact Rounded
-pwsx3958 power 0.0532 0.5 -> 0.231 Inexact Rounded
-pwsx3959 power 0.533 0.5 -> 0.730 Inexact Rounded
-pwsx3960 power 0.0533 0.5 -> 0.231 Inexact Rounded
-pwsx3961 power 0.534 0.5 -> 0.731 Inexact Rounded
-pwsx3962 power 0.0534 0.5 -> 0.231 Inexact Rounded
-pwsx3963 power 0.535 0.5 -> 0.731 Inexact Rounded
-pwsx3964 power 0.0535 0.5 -> 0.231 Inexact Rounded
-pwsx3965 power 0.536 0.5 -> 0.732 Inexact Rounded
-pwsx3966 power 0.0536 0.5 -> 0.232 Inexact Rounded
-pwsx3967 power 0.537 0.5 -> 0.733 Inexact Rounded
-pwsx3968 power 0.0537 0.5 -> 0.232 Inexact Rounded
-pwsx3969 power 0.538 0.5 -> 0.733 Inexact Rounded
-pwsx3970 power 0.0538 0.5 -> 0.232 Inexact Rounded
-pwsx3971 power 0.539 0.5 -> 0.734 Inexact Rounded
-pwsx3972 power 0.0539 0.5 -> 0.232 Inexact Rounded
-pwsx3973 power 0.541 0.5 -> 0.736 Inexact Rounded
-pwsx3974 power 0.0541 0.5 -> 0.233 Inexact Rounded
-pwsx3975 power 0.542 0.5 -> 0.736 Inexact Rounded
-pwsx3976 power 0.0542 0.5 -> 0.233 Inexact Rounded
-pwsx3977 power 0.543 0.5 -> 0.737 Inexact Rounded
-pwsx3978 power 0.0543 0.5 -> 0.233 Inexact Rounded
-pwsx3979 power 0.544 0.5 -> 0.738 Inexact Rounded
-pwsx3980 power 0.0544 0.5 -> 0.233 Inexact Rounded
-pwsx3981 power 0.545 0.5 -> 0.738 Inexact Rounded
-pwsx3982 power 0.0545 0.5 -> 0.233 Inexact Rounded
-pwsx3983 power 0.546 0.5 -> 0.739 Inexact Rounded
-pwsx3984 power 0.0546 0.5 -> 0.234 Inexact Rounded
-pwsx3985 power 0.547 0.5 -> 0.740 Inexact Rounded
-pwsx3986 power 0.0547 0.5 -> 0.234 Inexact Rounded
-pwsx3987 power 0.548 0.5 -> 0.740 Inexact Rounded
-pwsx3988 power 0.0548 0.5 -> 0.234 Inexact Rounded
-pwsx3989 power 0.549 0.5 -> 0.741 Inexact Rounded
-pwsx3990 power 0.0549 0.5 -> 0.234 Inexact Rounded
-pwsx3991 power 0.551 0.5 -> 0.742 Inexact Rounded
-pwsx3992 power 0.0551 0.5 -> 0.235 Inexact Rounded
-pwsx3993 power 0.552 0.5 -> 0.743 Inexact Rounded
-pwsx3994 power 0.0552 0.5 -> 0.235 Inexact Rounded
-pwsx3995 power 0.553 0.5 -> 0.744 Inexact Rounded
-pwsx3996 power 0.0553 0.5 -> 0.235 Inexact Rounded
-pwsx3997 power 0.554 0.5 -> 0.744 Inexact Rounded
-pwsx3998 power 0.0554 0.5 -> 0.235 Inexact Rounded
-pwsx3999 power 0.555 0.5 -> 0.745 Inexact Rounded
-pwsx4000 power 0.0555 0.5 -> 0.236 Inexact Rounded
-pwsx4001 power 0.556 0.5 -> 0.746 Inexact Rounded
-pwsx4002 power 0.0556 0.5 -> 0.236 Inexact Rounded
-pwsx4003 power 0.557 0.5 -> 0.746 Inexact Rounded
-pwsx4004 power 0.0557 0.5 -> 0.236 Inexact Rounded
-pwsx4005 power 0.558 0.5 -> 0.747 Inexact Rounded
-pwsx4006 power 0.0558 0.5 -> 0.236 Inexact Rounded
-pwsx4007 power 0.559 0.5 -> 0.748 Inexact Rounded
-pwsx4008 power 0.0559 0.5 -> 0.236 Inexact Rounded
-pwsx4009 power 0.561 0.5 -> 0.749 Inexact Rounded
-pwsx4010 power 0.0561 0.5 -> 0.237 Inexact Rounded
-pwsx4011 power 0.562 0.5 -> 0.750 Inexact Rounded
-pwsx4012 power 0.0562 0.5 -> 0.237 Inexact Rounded
-pwsx4013 power 0.563 0.5 -> 0.750 Inexact Rounded
-pwsx4014 power 0.0563 0.5 -> 0.237 Inexact Rounded
-pwsx4015 power 0.564 0.5 -> 0.751 Inexact Rounded
-pwsx4016 power 0.0564 0.5 -> 0.237 Inexact Rounded
-pwsx4017 power 0.565 0.5 -> 0.752 Inexact Rounded
-pwsx4018 power 0.0565 0.5 -> 0.238 Inexact Rounded
-pwsx4019 power 0.566 0.5 -> 0.752 Inexact Rounded
-pwsx4020 power 0.0566 0.5 -> 0.238 Inexact Rounded
-pwsx4021 power 0.567 0.5 -> 0.753 Inexact Rounded
-pwsx4022 power 0.0567 0.5 -> 0.238 Inexact Rounded
-pwsx4023 power 0.568 0.5 -> 0.754 Inexact Rounded
-pwsx4024 power 0.0568 0.5 -> 0.238 Inexact Rounded
-pwsx4025 power 0.569 0.5 -> 0.754 Inexact Rounded
-pwsx4026 power 0.0569 0.5 -> 0.239 Inexact Rounded
-pwsx4027 power 0.571 0.5 -> 0.756 Inexact Rounded
-pwsx4028 power 0.0571 0.5 -> 0.239 Inexact Rounded
-pwsx4029 power 0.572 0.5 -> 0.756 Inexact Rounded
-pwsx4030 power 0.0572 0.5 -> 0.239 Inexact Rounded
-pwsx4031 power 0.573 0.5 -> 0.757 Inexact Rounded
-pwsx4032 power 0.0573 0.5 -> 0.239 Inexact Rounded
-pwsx4033 power 0.574 0.5 -> 0.758 Inexact Rounded
-pwsx4034 power 0.0574 0.5 -> 0.240 Inexact Rounded
-pwsx4035 power 0.575 0.5 -> 0.758 Inexact Rounded
-pwsx4036 power 0.0575 0.5 -> 0.240 Inexact Rounded
-pwsx4037 power 0.576 0.5 -> 0.759 Inexact Rounded
-pwsx4038 power 0.0576 0.5 -> 0.240 Inexact Rounded
-pwsx4039 power 0.577 0.5 -> 0.760 Inexact Rounded
-pwsx4040 power 0.0577 0.5 -> 0.240 Inexact Rounded
-pwsx4041 power 0.578 0.5 -> 0.760 Inexact Rounded
-pwsx4042 power 0.0578 0.5 -> 0.240 Inexact Rounded
-pwsx4043 power 0.579 0.5 -> 0.761 Inexact Rounded
-pwsx4044 power 0.0579 0.5 -> 0.241 Inexact Rounded
-pwsx4045 power 0.581 0.5 -> 0.762 Inexact Rounded
-pwsx4046 power 0.0581 0.5 -> 0.241 Inexact Rounded
-pwsx4047 power 0.582 0.5 -> 0.763 Inexact Rounded
-pwsx4048 power 0.0582 0.5 -> 0.241 Inexact Rounded
-pwsx4049 power 0.583 0.5 -> 0.764 Inexact Rounded
-pwsx4050 power 0.0583 0.5 -> 0.241 Inexact Rounded
-pwsx4051 power 0.584 0.5 -> 0.764 Inexact Rounded
-pwsx4052 power 0.0584 0.5 -> 0.242 Inexact Rounded
-pwsx4053 power 0.585 0.5 -> 0.765 Inexact Rounded
-pwsx4054 power 0.0585 0.5 -> 0.242 Inexact Rounded
-pwsx4055 power 0.586 0.5 -> 0.766 Inexact Rounded
-pwsx4056 power 0.0586 0.5 -> 0.242 Inexact Rounded
-pwsx4057 power 0.587 0.5 -> 0.766 Inexact Rounded
-pwsx4058 power 0.0587 0.5 -> 0.242 Inexact Rounded
-pwsx4059 power 0.588 0.5 -> 0.767 Inexact Rounded
-pwsx4060 power 0.0588 0.5 -> 0.242 Inexact Rounded
-pwsx4061 power 0.589 0.5 -> 0.767 Inexact Rounded
-pwsx4062 power 0.0589 0.5 -> 0.243 Inexact Rounded
-pwsx4063 power 0.591 0.5 -> 0.769 Inexact Rounded
-pwsx4064 power 0.0591 0.5 -> 0.243 Inexact Rounded
-pwsx4065 power 0.592 0.5 -> 0.769 Inexact Rounded
-pwsx4066 power 0.0592 0.5 -> 0.243 Inexact Rounded
-pwsx4067 power 0.593 0.5 -> 0.770 Inexact Rounded
-pwsx4068 power 0.0593 0.5 -> 0.244 Inexact Rounded
-pwsx4069 power 0.594 0.5 -> 0.771 Inexact Rounded
-pwsx4070 power 0.0594 0.5 -> 0.244 Inexact Rounded
-pwsx4071 power 0.595 0.5 -> 0.771 Inexact Rounded
-pwsx4072 power 0.0595 0.5 -> 0.244 Inexact Rounded
-pwsx4073 power 0.596 0.5 -> 0.772 Inexact Rounded
-pwsx4074 power 0.0596 0.5 -> 0.244 Inexact Rounded
-pwsx4075 power 0.597 0.5 -> 0.773 Inexact Rounded
-pwsx4076 power 0.0597 0.5 -> 0.244 Inexact Rounded
-pwsx4077 power 0.598 0.5 -> 0.773 Inexact Rounded
-pwsx4078 power 0.0598 0.5 -> 0.245 Inexact Rounded
-pwsx4079 power 0.599 0.5 -> 0.774 Inexact Rounded
-pwsx4080 power 0.0599 0.5 -> 0.245 Inexact Rounded
-pwsx4081 power 0.601 0.5 -> 0.775 Inexact Rounded
-pwsx4082 power 0.0601 0.5 -> 0.245 Inexact Rounded
-pwsx4083 power 0.602 0.5 -> 0.776 Inexact Rounded
-pwsx4084 power 0.0602 0.5 -> 0.245 Inexact Rounded
-pwsx4085 power 0.603 0.5 -> 0.777 Inexact Rounded
-pwsx4086 power 0.0603 0.5 -> 0.246 Inexact Rounded
-pwsx4087 power 0.604 0.5 -> 0.777 Inexact Rounded
-pwsx4088 power 0.0604 0.5 -> 0.246 Inexact Rounded
-pwsx4089 power 0.605 0.5 -> 0.778 Inexact Rounded
-pwsx4090 power 0.0605 0.5 -> 0.246 Inexact Rounded
-pwsx4091 power 0.606 0.5 -> 0.778 Inexact Rounded
-pwsx4092 power 0.0606 0.5 -> 0.246 Inexact Rounded
-pwsx4093 power 0.607 0.5 -> 0.779 Inexact Rounded
-pwsx4094 power 0.0607 0.5 -> 0.246 Inexact Rounded
-pwsx4095 power 0.608 0.5 -> 0.780 Inexact Rounded
-pwsx4096 power 0.0608 0.5 -> 0.247 Inexact Rounded
-pwsx4097 power 0.609 0.5 -> 0.780 Inexact Rounded
-pwsx4098 power 0.0609 0.5 -> 0.247 Inexact Rounded
-pwsx4099 power 0.611 0.5 -> 0.782 Inexact Rounded
-pwsx4100 power 0.0611 0.5 -> 0.247 Inexact Rounded
-pwsx4101 power 0.612 0.5 -> 0.782 Inexact Rounded
-pwsx4102 power 0.0612 0.5 -> 0.247 Inexact Rounded
-pwsx4103 power 0.613 0.5 -> 0.783 Inexact Rounded
-pwsx4104 power 0.0613 0.5 -> 0.248 Inexact Rounded
-pwsx4105 power 0.614 0.5 -> 0.784 Inexact Rounded
-pwsx4106 power 0.0614 0.5 -> 0.248 Inexact Rounded
-pwsx4107 power 0.615 0.5 -> 0.784 Inexact Rounded
-pwsx4108 power 0.0615 0.5 -> 0.248 Inexact Rounded
-pwsx4109 power 0.616 0.5 -> 0.785 Inexact Rounded
-pwsx4110 power 0.0616 0.5 -> 0.248 Inexact Rounded
-pwsx4111 power 0.617 0.5 -> 0.785 Inexact Rounded
-pwsx4112 power 0.0617 0.5 -> 0.248 Inexact Rounded
-pwsx4113 power 0.618 0.5 -> 0.786 Inexact Rounded
-pwsx4114 power 0.0618 0.5 -> 0.249 Inexact Rounded
-pwsx4115 power 0.619 0.5 -> 0.787 Inexact Rounded
-pwsx4116 power 0.0619 0.5 -> 0.249 Inexact Rounded
-pwsx4117 power 0.621 0.5 -> 0.788 Inexact Rounded
-pwsx4118 power 0.0621 0.5 -> 0.249 Inexact Rounded
-pwsx4119 power 0.622 0.5 -> 0.789 Inexact Rounded
-pwsx4120 power 0.0622 0.5 -> 0.249 Inexact Rounded
-pwsx4121 power 0.623 0.5 -> 0.789 Inexact Rounded
-pwsx4122 power 0.0623 0.5 -> 0.250 Inexact Rounded
-pwsx4123 power 0.624 0.5 -> 0.790 Inexact Rounded
-pwsx4124 power 0.0624 0.5 -> 0.250 Inexact Rounded
-pwsx4125 power 0.625 0.5 -> 0.791 Inexact Rounded
-pwsx4126 power 0.0625 0.5 -> 0.250 Inexact Rounded
-pwsx4127 power 0.626 0.5 -> 0.791 Inexact Rounded
-pwsx4128 power 0.0626 0.5 -> 0.250 Inexact Rounded
-pwsx4129 power 0.627 0.5 -> 0.792 Inexact Rounded
-pwsx4130 power 0.0627 0.5 -> 0.250 Inexact Rounded
-pwsx4131 power 0.628 0.5 -> 0.792 Inexact Rounded
-pwsx4132 power 0.0628 0.5 -> 0.251 Inexact Rounded
-pwsx4133 power 0.629 0.5 -> 0.793 Inexact Rounded
-pwsx4134 power 0.0629 0.5 -> 0.251 Inexact Rounded
-pwsx4135 power 0.631 0.5 -> 0.794 Inexact Rounded
-pwsx4136 power 0.0631 0.5 -> 0.251 Inexact Rounded
-pwsx4137 power 0.632 0.5 -> 0.795 Inexact Rounded
-pwsx4138 power 0.0632 0.5 -> 0.251 Inexact Rounded
-pwsx4139 power 0.633 0.5 -> 0.796 Inexact Rounded
-pwsx4140 power 0.0633 0.5 -> 0.252 Inexact Rounded
-pwsx4141 power 0.634 0.5 -> 0.796 Inexact Rounded
-pwsx4142 power 0.0634 0.5 -> 0.252 Inexact Rounded
-pwsx4143 power 0.635 0.5 -> 0.797 Inexact Rounded
-pwsx4144 power 0.0635 0.5 -> 0.252 Inexact Rounded
-pwsx4145 power 0.636 0.5 -> 0.797 Inexact Rounded
-pwsx4146 power 0.0636 0.5 -> 0.252 Inexact Rounded
-pwsx4147 power 0.637 0.5 -> 0.798 Inexact Rounded
-pwsx4148 power 0.0637 0.5 -> 0.252 Inexact Rounded
-pwsx4149 power 0.638 0.5 -> 0.799 Inexact Rounded
-pwsx4150 power 0.0638 0.5 -> 0.253 Inexact Rounded
-pwsx4151 power 0.639 0.5 -> 0.799 Inexact Rounded
-pwsx4152 power 0.0639 0.5 -> 0.253 Inexact Rounded
-pwsx4153 power 0.641 0.5 -> 0.801 Inexact Rounded
-pwsx4154 power 0.0641 0.5 -> 0.253 Inexact Rounded
-pwsx4155 power 0.642 0.5 -> 0.801 Inexact Rounded
-pwsx4156 power 0.0642 0.5 -> 0.253 Inexact Rounded
-pwsx4157 power 0.643 0.5 -> 0.802 Inexact Rounded
-pwsx4158 power 0.0643 0.5 -> 0.254 Inexact Rounded
-pwsx4159 power 0.644 0.5 -> 0.802 Inexact Rounded
-pwsx4160 power 0.0644 0.5 -> 0.254 Inexact Rounded
-pwsx4161 power 0.645 0.5 -> 0.803 Inexact Rounded
-pwsx4162 power 0.0645 0.5 -> 0.254 Inexact Rounded
-pwsx4163 power 0.646 0.5 -> 0.804 Inexact Rounded
-pwsx4164 power 0.0646 0.5 -> 0.254 Inexact Rounded
-pwsx4165 power 0.647 0.5 -> 0.804 Inexact Rounded
-pwsx4166 power 0.0647 0.5 -> 0.254 Inexact Rounded
-pwsx4167 power 0.648 0.5 -> 0.805 Inexact Rounded
-pwsx4168 power 0.0648 0.5 -> 0.255 Inexact Rounded
-pwsx4169 power 0.649 0.5 -> 0.806 Inexact Rounded
-pwsx4170 power 0.0649 0.5 -> 0.255 Inexact Rounded
-pwsx4171 power 0.651 0.5 -> 0.807 Inexact Rounded
-pwsx4172 power 0.0651 0.5 -> 0.255 Inexact Rounded
-pwsx4173 power 0.652 0.5 -> 0.807 Inexact Rounded
-pwsx4174 power 0.0652 0.5 -> 0.255 Inexact Rounded
-pwsx4175 power 0.653 0.5 -> 0.808 Inexact Rounded
-pwsx4176 power 0.0653 0.5 -> 0.256 Inexact Rounded
-pwsx4177 power 0.654 0.5 -> 0.809 Inexact Rounded
-pwsx4178 power 0.0654 0.5 -> 0.256 Inexact Rounded
-pwsx4179 power 0.655 0.5 -> 0.809 Inexact Rounded
-pwsx4180 power 0.0655 0.5 -> 0.256 Inexact Rounded
-pwsx4181 power 0.656 0.5 -> 0.810 Inexact Rounded
-pwsx4182 power 0.0656 0.5 -> 0.256 Inexact Rounded
-pwsx4183 power 0.657 0.5 -> 0.811 Inexact Rounded
-pwsx4184 power 0.0657 0.5 -> 0.256 Inexact Rounded
-pwsx4185 power 0.658 0.5 -> 0.811 Inexact Rounded
-pwsx4186 power 0.0658 0.5 -> 0.257 Inexact Rounded
-pwsx4187 power 0.659 0.5 -> 0.812 Inexact Rounded
-pwsx4188 power 0.0659 0.5 -> 0.257 Inexact Rounded
-pwsx4189 power 0.661 0.5 -> 0.813 Inexact Rounded
-pwsx4190 power 0.0661 0.5 -> 0.257 Inexact Rounded
-pwsx4191 power 0.662 0.5 -> 0.814 Inexact Rounded
-pwsx4192 power 0.0662 0.5 -> 0.257 Inexact Rounded
-pwsx4193 power 0.663 0.5 -> 0.814 Inexact Rounded
-pwsx4194 power 0.0663 0.5 -> 0.257 Inexact Rounded
-pwsx4195 power 0.664 0.5 -> 0.815 Inexact Rounded
-pwsx4196 power 0.0664 0.5 -> 0.258 Inexact Rounded
-pwsx4197 power 0.665 0.5 -> 0.815 Inexact Rounded
-pwsx4198 power 0.0665 0.5 -> 0.258 Inexact Rounded
-pwsx4199 power 0.666 0.5 -> 0.816 Inexact Rounded
-pwsx4200 power 0.0666 0.5 -> 0.258 Inexact Rounded
-pwsx4201 power 0.667 0.5 -> 0.817 Inexact Rounded
-pwsx4202 power 0.0667 0.5 -> 0.258 Inexact Rounded
-pwsx4203 power 0.668 0.5 -> 0.817 Inexact Rounded
-pwsx4204 power 0.0668 0.5 -> 0.258 Inexact Rounded
-pwsx4205 power 0.669 0.5 -> 0.818 Inexact Rounded
-pwsx4206 power 0.0669 0.5 -> 0.259 Inexact Rounded
-pwsx4207 power 0.671 0.5 -> 0.819 Inexact Rounded
-pwsx4208 power 0.0671 0.5 -> 0.259 Inexact Rounded
-pwsx4209 power 0.672 0.5 -> 0.820 Inexact Rounded
-pwsx4210 power 0.0672 0.5 -> 0.259 Inexact Rounded
-pwsx4211 power 0.673 0.5 -> 0.820 Inexact Rounded
-pwsx4212 power 0.0673 0.5 -> 0.259 Inexact Rounded
-pwsx4213 power 0.674 0.5 -> 0.821 Inexact Rounded
-pwsx4214 power 0.0674 0.5 -> 0.260 Inexact Rounded
-pwsx4215 power 0.675 0.5 -> 0.822 Inexact Rounded
-pwsx4216 power 0.0675 0.5 -> 0.260 Inexact Rounded
-pwsx4217 power 0.676 0.5 -> 0.822 Inexact Rounded
-pwsx4218 power 0.0676 0.5 -> 0.260 Inexact Rounded
-pwsx4219 power 0.677 0.5 -> 0.823 Inexact Rounded
-pwsx4220 power 0.0677 0.5 -> 0.260 Inexact Rounded
-pwsx4221 power 0.678 0.5 -> 0.823 Inexact Rounded
-pwsx4222 power 0.0678 0.5 -> 0.260 Inexact Rounded
-pwsx4223 power 0.679 0.5 -> 0.824 Inexact Rounded
-pwsx4224 power 0.0679 0.5 -> 0.261 Inexact Rounded
-pwsx4225 power 0.681 0.5 -> 0.825 Inexact Rounded
-pwsx4226 power 0.0681 0.5 -> 0.261 Inexact Rounded
-pwsx4227 power 0.682 0.5 -> 0.826 Inexact Rounded
-pwsx4228 power 0.0682 0.5 -> 0.261 Inexact Rounded
-pwsx4229 power 0.683 0.5 -> 0.826 Inexact Rounded
-pwsx4230 power 0.0683 0.5 -> 0.261 Inexact Rounded
-pwsx4231 power 0.684 0.5 -> 0.827 Inexact Rounded
-pwsx4232 power 0.0684 0.5 -> 0.262 Inexact Rounded
-pwsx4233 power 0.685 0.5 -> 0.828 Inexact Rounded
-pwsx4234 power 0.0685 0.5 -> 0.262 Inexact Rounded
-pwsx4235 power 0.686 0.5 -> 0.828 Inexact Rounded
-pwsx4236 power 0.0686 0.5 -> 0.262 Inexact Rounded
-pwsx4237 power 0.687 0.5 -> 0.829 Inexact Rounded
-pwsx4238 power 0.0687 0.5 -> 0.262 Inexact Rounded
-pwsx4239 power 0.688 0.5 -> 0.829 Inexact Rounded
-pwsx4240 power 0.0688 0.5 -> 0.262 Inexact Rounded
-pwsx4241 power 0.689 0.5 -> 0.830 Inexact Rounded
-pwsx4242 power 0.0689 0.5 -> 0.262 Inexact Rounded
-pwsx4243 power 0.691 0.5 -> 0.831 Inexact Rounded
-pwsx4244 power 0.0691 0.5 -> 0.263 Inexact Rounded
-pwsx4245 power 0.692 0.5 -> 0.832 Inexact Rounded
-pwsx4246 power 0.0692 0.5 -> 0.263 Inexact Rounded
-pwsx4247 power 0.693 0.5 -> 0.832 Inexact Rounded
-pwsx4248 power 0.0693 0.5 -> 0.263 Inexact Rounded
-pwsx4249 power 0.694 0.5 -> 0.833 Inexact Rounded
-pwsx4250 power 0.0694 0.5 -> 0.263 Inexact Rounded
-pwsx4251 power 0.695 0.5 -> 0.834 Inexact Rounded
-pwsx4252 power 0.0695 0.5 -> 0.264 Inexact Rounded
-pwsx4253 power 0.696 0.5 -> 0.834 Inexact Rounded
-pwsx4254 power 0.0696 0.5 -> 0.264 Inexact Rounded
-pwsx4255 power 0.697 0.5 -> 0.835 Inexact Rounded
-pwsx4256 power 0.0697 0.5 -> 0.264 Inexact Rounded
-pwsx4257 power 0.698 0.5 -> 0.835 Inexact Rounded
-pwsx4258 power 0.0698 0.5 -> 0.264 Inexact Rounded
-pwsx4259 power 0.699 0.5 -> 0.836 Inexact Rounded
-pwsx4260 power 0.0699 0.5 -> 0.264 Inexact Rounded
-pwsx4261 power 0.701 0.5 -> 0.837 Inexact Rounded
-pwsx4262 power 0.0701 0.5 -> 0.265 Inexact Rounded
-pwsx4263 power 0.702 0.5 -> 0.838 Inexact Rounded
-pwsx4264 power 0.0702 0.5 -> 0.265 Inexact Rounded
-pwsx4265 power 0.703 0.5 -> 0.838 Inexact Rounded
-pwsx4266 power 0.0703 0.5 -> 0.265 Inexact Rounded
-pwsx4267 power 0.704 0.5 -> 0.839 Inexact Rounded
-pwsx4268 power 0.0704 0.5 -> 0.265 Inexact Rounded
-pwsx4269 power 0.705 0.5 -> 0.840 Inexact Rounded
-pwsx4270 power 0.0705 0.5 -> 0.266 Inexact Rounded
-pwsx4271 power 0.706 0.5 -> 0.840 Inexact Rounded
-pwsx4272 power 0.0706 0.5 -> 0.266 Inexact Rounded
-pwsx4273 power 0.707 0.5 -> 0.841 Inexact Rounded
-pwsx4274 power 0.0707 0.5 -> 0.266 Inexact Rounded
-pwsx4275 power 0.708 0.5 -> 0.841 Inexact Rounded
-pwsx4276 power 0.0708 0.5 -> 0.266 Inexact Rounded
-pwsx4277 power 0.709 0.5 -> 0.842 Inexact Rounded
-pwsx4278 power 0.0709 0.5 -> 0.266 Inexact Rounded
-pwsx4279 power 0.711 0.5 -> 0.843 Inexact Rounded
-pwsx4280 power 0.0711 0.5 -> 0.267 Inexact Rounded
-pwsx4281 power 0.712 0.5 -> 0.844 Inexact Rounded
-pwsx4282 power 0.0712 0.5 -> 0.267 Inexact Rounded
-pwsx4283 power 0.713 0.5 -> 0.844 Inexact Rounded
-pwsx4284 power 0.0713 0.5 -> 0.267 Inexact Rounded
-pwsx4285 power 0.714 0.5 -> 0.845 Inexact Rounded
-pwsx4286 power 0.0714 0.5 -> 0.267 Inexact Rounded
-pwsx4287 power 0.715 0.5 -> 0.846 Inexact Rounded
-pwsx4288 power 0.0715 0.5 -> 0.267 Inexact Rounded
-pwsx4289 power 0.716 0.5 -> 0.846 Inexact Rounded
-pwsx4290 power 0.0716 0.5 -> 0.268 Inexact Rounded
-pwsx4291 power 0.717 0.5 -> 0.847 Inexact Rounded
-pwsx4292 power 0.0717 0.5 -> 0.268 Inexact Rounded
-pwsx4293 power 0.718 0.5 -> 0.847 Inexact Rounded
-pwsx4294 power 0.0718 0.5 -> 0.268 Inexact Rounded
-pwsx4295 power 0.719 0.5 -> 0.848 Inexact Rounded
-pwsx4296 power 0.0719 0.5 -> 0.268 Inexact Rounded
-pwsx4297 power 0.721 0.5 -> 0.849 Inexact Rounded
-pwsx4298 power 0.0721 0.5 -> 0.269 Inexact Rounded
-pwsx4299 power 0.722 0.5 -> 0.850 Inexact Rounded
-pwsx4300 power 0.0722 0.5 -> 0.269 Inexact Rounded
-pwsx4301 power 0.723 0.5 -> 0.850 Inexact Rounded
-pwsx4302 power 0.0723 0.5 -> 0.269 Inexact Rounded
-pwsx4303 power 0.724 0.5 -> 0.851 Inexact Rounded
-pwsx4304 power 0.0724 0.5 -> 0.269 Inexact Rounded
-pwsx4305 power 0.725 0.5 -> 0.851 Inexact Rounded
-pwsx4306 power 0.0725 0.5 -> 0.269 Inexact Rounded
-pwsx4307 power 0.726 0.5 -> 0.852 Inexact Rounded
-pwsx4308 power 0.0726 0.5 -> 0.269 Inexact Rounded
-pwsx4309 power 0.727 0.5 -> 0.853 Inexact Rounded
-pwsx4310 power 0.0727 0.5 -> 0.270 Inexact Rounded
-pwsx4311 power 0.728 0.5 -> 0.853 Inexact Rounded
-pwsx4312 power 0.0728 0.5 -> 0.270 Inexact Rounded
-pwsx4313 power 0.729 0.5 -> 0.854 Inexact Rounded
-pwsx4314 power 0.0729 0.5 -> 0.270 Inexact Rounded
-pwsx4315 power 0.731 0.5 -> 0.855 Inexact Rounded
-pwsx4316 power 0.0731 0.5 -> 0.270 Inexact Rounded
-pwsx4317 power 0.732 0.5 -> 0.856 Inexact Rounded
-pwsx4318 power 0.0732 0.5 -> 0.271 Inexact Rounded
-pwsx4319 power 0.733 0.5 -> 0.856 Inexact Rounded
-pwsx4320 power 0.0733 0.5 -> 0.271 Inexact Rounded
-pwsx4321 power 0.734 0.5 -> 0.857 Inexact Rounded
-pwsx4322 power 0.0734 0.5 -> 0.271 Inexact Rounded
-pwsx4323 power 0.735 0.5 -> 0.857 Inexact Rounded
-pwsx4324 power 0.0735 0.5 -> 0.271 Inexact Rounded
-pwsx4325 power 0.736 0.5 -> 0.858 Inexact Rounded
-pwsx4326 power 0.0736 0.5 -> 0.271 Inexact Rounded
-pwsx4327 power 0.737 0.5 -> 0.858 Inexact Rounded
-pwsx4328 power 0.0737 0.5 -> 0.271 Inexact Rounded
-pwsx4329 power 0.738 0.5 -> 0.859 Inexact Rounded
-pwsx4330 power 0.0738 0.5 -> 0.272 Inexact Rounded
-pwsx4331 power 0.739 0.5 -> 0.860 Inexact Rounded
-pwsx4332 power 0.0739 0.5 -> 0.272 Inexact Rounded
-pwsx4333 power 0.741 0.5 -> 0.861 Inexact Rounded
-pwsx4334 power 0.0741 0.5 -> 0.272 Inexact Rounded
-pwsx4335 power 0.742 0.5 -> 0.861 Inexact Rounded
-pwsx4336 power 0.0742 0.5 -> 0.272 Inexact Rounded
-pwsx4337 power 0.743 0.5 -> 0.862 Inexact Rounded
-pwsx4338 power 0.0743 0.5 -> 0.273 Inexact Rounded
-pwsx4339 power 0.744 0.5 -> 0.863 Inexact Rounded
-pwsx4340 power 0.0744 0.5 -> 0.273 Inexact Rounded
-pwsx4341 power 0.745 0.5 -> 0.863 Inexact Rounded
-pwsx4342 power 0.0745 0.5 -> 0.273 Inexact Rounded
-pwsx4343 power 0.746 0.5 -> 0.864 Inexact Rounded
-pwsx4344 power 0.0746 0.5 -> 0.273 Inexact Rounded
-pwsx4345 power 0.747 0.5 -> 0.864 Inexact Rounded
-pwsx4346 power 0.0747 0.5 -> 0.273 Inexact Rounded
-pwsx4347 power 0.748 0.5 -> 0.865 Inexact Rounded
-pwsx4348 power 0.0748 0.5 -> 0.273 Inexact Rounded
-pwsx4349 power 0.749 0.5 -> 0.865 Inexact Rounded
-pwsx4350 power 0.0749 0.5 -> 0.274 Inexact Rounded
-pwsx4351 power 0.751 0.5 -> 0.867 Inexact Rounded
-pwsx4352 power 0.0751 0.5 -> 0.274 Inexact Rounded
-pwsx4353 power 0.752 0.5 -> 0.867 Inexact Rounded
-pwsx4354 power 0.0752 0.5 -> 0.274 Inexact Rounded
-pwsx4355 power 0.753 0.5 -> 0.868 Inexact Rounded
-pwsx4356 power 0.0753 0.5 -> 0.274 Inexact Rounded
-pwsx4357 power 0.754 0.5 -> 0.868 Inexact Rounded
-pwsx4358 power 0.0754 0.5 -> 0.275 Inexact Rounded
-pwsx4359 power 0.755 0.5 -> 0.869 Inexact Rounded
-pwsx4360 power 0.0755 0.5 -> 0.275 Inexact Rounded
-pwsx4361 power 0.756 0.5 -> 0.869 Inexact Rounded
-pwsx4362 power 0.0756 0.5 -> 0.275 Inexact Rounded
-pwsx4363 power 0.757 0.5 -> 0.870 Inexact Rounded
-pwsx4364 power 0.0757 0.5 -> 0.275 Inexact Rounded
-pwsx4365 power 0.758 0.5 -> 0.871 Inexact Rounded
-pwsx4366 power 0.0758 0.5 -> 0.275 Inexact Rounded
-pwsx4367 power 0.759 0.5 -> 0.871 Inexact Rounded
-pwsx4368 power 0.0759 0.5 -> 0.275 Inexact Rounded
-pwsx4369 power 0.761 0.5 -> 0.872 Inexact Rounded
-pwsx4370 power 0.0761 0.5 -> 0.276 Inexact Rounded
-pwsx4371 power 0.762 0.5 -> 0.873 Inexact Rounded
-pwsx4372 power 0.0762 0.5 -> 0.276 Inexact Rounded
-pwsx4373 power 0.763 0.5 -> 0.873 Inexact Rounded
-pwsx4374 power 0.0763 0.5 -> 0.276 Inexact Rounded
-pwsx4375 power 0.764 0.5 -> 0.874 Inexact Rounded
-pwsx4376 power 0.0764 0.5 -> 0.276 Inexact Rounded
-pwsx4377 power 0.765 0.5 -> 0.875 Inexact Rounded
-pwsx4378 power 0.0765 0.5 -> 0.277 Inexact Rounded
-pwsx4379 power 0.766 0.5 -> 0.875 Inexact Rounded
-pwsx4380 power 0.0766 0.5 -> 0.277 Inexact Rounded
-pwsx4381 power 0.767 0.5 -> 0.876 Inexact Rounded
-pwsx4382 power 0.0767 0.5 -> 0.277 Inexact Rounded
-pwsx4383 power 0.768 0.5 -> 0.876 Inexact Rounded
-pwsx4384 power 0.0768 0.5 -> 0.277 Inexact Rounded
-pwsx4385 power 0.769 0.5 -> 0.877 Inexact Rounded
-pwsx4386 power 0.0769 0.5 -> 0.277 Inexact Rounded
-pwsx4387 power 0.771 0.5 -> 0.878 Inexact Rounded
-pwsx4388 power 0.0771 0.5 -> 0.278 Inexact Rounded
-pwsx4389 power 0.772 0.5 -> 0.879 Inexact Rounded
-pwsx4390 power 0.0772 0.5 -> 0.278 Inexact Rounded
-pwsx4391 power 0.773 0.5 -> 0.879 Inexact Rounded
-pwsx4392 power 0.0773 0.5 -> 0.278 Inexact Rounded
-pwsx4393 power 0.774 0.5 -> 0.880 Inexact Rounded
-pwsx4394 power 0.0774 0.5 -> 0.278 Inexact Rounded
-pwsx4395 power 0.775 0.5 -> 0.880 Inexact Rounded
-pwsx4396 power 0.0775 0.5 -> 0.278 Inexact Rounded
-pwsx4397 power 0.776 0.5 -> 0.881 Inexact Rounded
-pwsx4398 power 0.0776 0.5 -> 0.279 Inexact Rounded
-pwsx4399 power 0.777 0.5 -> 0.881 Inexact Rounded
-pwsx4400 power 0.0777 0.5 -> 0.279 Inexact Rounded
-pwsx4401 power 0.778 0.5 -> 0.882 Inexact Rounded
-pwsx4402 power 0.0778 0.5 -> 0.279 Inexact Rounded
-pwsx4403 power 0.779 0.5 -> 0.883 Inexact Rounded
-pwsx4404 power 0.0779 0.5 -> 0.279 Inexact Rounded
-pwsx4405 power 0.781 0.5 -> 0.884 Inexact Rounded
-pwsx4406 power 0.0781 0.5 -> 0.279 Inexact Rounded
-pwsx4407 power 0.782 0.5 -> 0.884 Inexact Rounded
-pwsx4408 power 0.0782 0.5 -> 0.280 Inexact Rounded
-pwsx4409 power 0.783 0.5 -> 0.885 Inexact Rounded
-pwsx4410 power 0.0783 0.5 -> 0.280 Inexact Rounded
-pwsx4411 power 0.784 0.5 -> 0.885 Inexact Rounded
-pwsx4412 power 0.0784 0.5 -> 0.280 Inexact Rounded
-pwsx4413 power 0.785 0.5 -> 0.886 Inexact Rounded
-pwsx4414 power 0.0785 0.5 -> 0.280 Inexact Rounded
-pwsx4415 power 0.786 0.5 -> 0.887 Inexact Rounded
-pwsx4416 power 0.0786 0.5 -> 0.280 Inexact Rounded
-pwsx4417 power 0.787 0.5 -> 0.887 Inexact Rounded
-pwsx4418 power 0.0787 0.5 -> 0.281 Inexact Rounded
-pwsx4419 power 0.788 0.5 -> 0.888 Inexact Rounded
-pwsx4420 power 0.0788 0.5 -> 0.281 Inexact Rounded
-pwsx4421 power 0.789 0.5 -> 0.888 Inexact Rounded
-pwsx4422 power 0.0789 0.5 -> 0.281 Inexact Rounded
-pwsx4423 power 0.791 0.5 -> 0.889 Inexact Rounded
-pwsx4424 power 0.0791 0.5 -> 0.281 Inexact Rounded
-pwsx4425 power 0.792 0.5 -> 0.890 Inexact Rounded
-pwsx4426 power 0.0792 0.5 -> 0.281 Inexact Rounded
-pwsx4427 power 0.793 0.5 -> 0.891 Inexact Rounded
-pwsx4428 power 0.0793 0.5 -> 0.282 Inexact Rounded
-pwsx4429 power 0.794 0.5 -> 0.891 Inexact Rounded
-pwsx4430 power 0.0794 0.5 -> 0.282 Inexact Rounded
-pwsx4431 power 0.795 0.5 -> 0.892 Inexact Rounded
-pwsx4432 power 0.0795 0.5 -> 0.282 Inexact Rounded
-pwsx4433 power 0.796 0.5 -> 0.892 Inexact Rounded
-pwsx4434 power 0.0796 0.5 -> 0.282 Inexact Rounded
-pwsx4435 power 0.797 0.5 -> 0.893 Inexact Rounded
-pwsx4436 power 0.0797 0.5 -> 0.282 Inexact Rounded
-pwsx4437 power 0.798 0.5 -> 0.893 Inexact Rounded
-pwsx4438 power 0.0798 0.5 -> 0.282 Inexact Rounded
-pwsx4439 power 0.799 0.5 -> 0.894 Inexact Rounded
-pwsx4440 power 0.0799 0.5 -> 0.283 Inexact Rounded
-pwsx4441 power 0.801 0.5 -> 0.895 Inexact Rounded
-pwsx4442 power 0.0801 0.5 -> 0.283 Inexact Rounded
-pwsx4443 power 0.802 0.5 -> 0.896 Inexact Rounded
-pwsx4444 power 0.0802 0.5 -> 0.283 Inexact Rounded
-pwsx4445 power 0.803 0.5 -> 0.896 Inexact Rounded
-pwsx4446 power 0.0803 0.5 -> 0.283 Inexact Rounded
-pwsx4447 power 0.804 0.5 -> 0.897 Inexact Rounded
-pwsx4448 power 0.0804 0.5 -> 0.284 Inexact Rounded
-pwsx4449 power 0.805 0.5 -> 0.897 Inexact Rounded
-pwsx4450 power 0.0805 0.5 -> 0.284 Inexact Rounded
-pwsx4451 power 0.806 0.5 -> 0.898 Inexact Rounded
-pwsx4452 power 0.0806 0.5 -> 0.284 Inexact Rounded
-pwsx4453 power 0.807 0.5 -> 0.898 Inexact Rounded
-pwsx4454 power 0.0807 0.5 -> 0.284 Inexact Rounded
-pwsx4455 power 0.808 0.5 -> 0.899 Inexact Rounded
-pwsx4456 power 0.0808 0.5 -> 0.284 Inexact Rounded
-pwsx4457 power 0.809 0.5 -> 0.899 Inexact Rounded
-pwsx4458 power 0.0809 0.5 -> 0.284 Inexact Rounded
-pwsx4459 power 0.811 0.5 -> 0.901 Inexact Rounded
-pwsx4460 power 0.0811 0.5 -> 0.285 Inexact Rounded
-pwsx4461 power 0.812 0.5 -> 0.901 Inexact Rounded
-pwsx4462 power 0.0812 0.5 -> 0.285 Inexact Rounded
-pwsx4463 power 0.813 0.5 -> 0.902 Inexact Rounded
-pwsx4464 power 0.0813 0.5 -> 0.285 Inexact Rounded
-pwsx4465 power 0.814 0.5 -> 0.902 Inexact Rounded
-pwsx4466 power 0.0814 0.5 -> 0.285 Inexact Rounded
-pwsx4467 power 0.815 0.5 -> 0.903 Inexact Rounded
-pwsx4468 power 0.0815 0.5 -> 0.285 Inexact Rounded
-pwsx4469 power 0.816 0.5 -> 0.903 Inexact Rounded
-pwsx4470 power 0.0816 0.5 -> 0.286 Inexact Rounded
-pwsx4471 power 0.817 0.5 -> 0.904 Inexact Rounded
-pwsx4472 power 0.0817 0.5 -> 0.286 Inexact Rounded
-pwsx4473 power 0.818 0.5 -> 0.904 Inexact Rounded
-pwsx4474 power 0.0818 0.5 -> 0.286 Inexact Rounded
-pwsx4475 power 0.819 0.5 -> 0.905 Inexact Rounded
-pwsx4476 power 0.0819 0.5 -> 0.286 Inexact Rounded
-pwsx4477 power 0.821 0.5 -> 0.906 Inexact Rounded
-pwsx4478 power 0.0821 0.5 -> 0.287 Inexact Rounded
-pwsx4479 power 0.822 0.5 -> 0.907 Inexact Rounded
-pwsx4480 power 0.0822 0.5 -> 0.287 Inexact Rounded
-pwsx4481 power 0.823 0.5 -> 0.907 Inexact Rounded
-pwsx4482 power 0.0823 0.5 -> 0.287 Inexact Rounded
-pwsx4483 power 0.824 0.5 -> 0.908 Inexact Rounded
-pwsx4484 power 0.0824 0.5 -> 0.287 Inexact Rounded
-pwsx4485 power 0.825 0.5 -> 0.908 Inexact Rounded
-pwsx4486 power 0.0825 0.5 -> 0.287 Inexact Rounded
-pwsx4487 power 0.826 0.5 -> 0.909 Inexact Rounded
-pwsx4488 power 0.0826 0.5 -> 0.287 Inexact Rounded
-pwsx4489 power 0.827 0.5 -> 0.909 Inexact Rounded
-pwsx4490 power 0.0827 0.5 -> 0.288 Inexact Rounded
-pwsx4491 power 0.828 0.5 -> 0.910 Inexact Rounded
-pwsx4492 power 0.0828 0.5 -> 0.288 Inexact Rounded
-pwsx4493 power 0.829 0.5 -> 0.910 Inexact Rounded
-pwsx4494 power 0.0829 0.5 -> 0.288 Inexact Rounded
-pwsx4495 power 0.831 0.5 -> 0.912 Inexact Rounded
-pwsx4496 power 0.0831 0.5 -> 0.288 Inexact Rounded
-pwsx4497 power 0.832 0.5 -> 0.912 Inexact Rounded
-pwsx4498 power 0.0832 0.5 -> 0.288 Inexact Rounded
-pwsx4499 power 0.833 0.5 -> 0.913 Inexact Rounded
-pwsx4500 power 0.0833 0.5 -> 0.289 Inexact Rounded
-pwsx4501 power 0.834 0.5 -> 0.913 Inexact Rounded
-pwsx4502 power 0.0834 0.5 -> 0.289 Inexact Rounded
-pwsx4503 power 0.835 0.5 -> 0.914 Inexact Rounded
-pwsx4504 power 0.0835 0.5 -> 0.289 Inexact Rounded
-pwsx4505 power 0.836 0.5 -> 0.914 Inexact Rounded
-pwsx4506 power 0.0836 0.5 -> 0.289 Inexact Rounded
-pwsx4507 power 0.837 0.5 -> 0.915 Inexact Rounded
-pwsx4508 power 0.0837 0.5 -> 0.289 Inexact Rounded
-pwsx4509 power 0.838 0.5 -> 0.915 Inexact Rounded
-pwsx4510 power 0.0838 0.5 -> 0.289 Inexact Rounded
-pwsx4511 power 0.839 0.5 -> 0.916 Inexact Rounded
-pwsx4512 power 0.0839 0.5 -> 0.290 Inexact Rounded
-pwsx4513 power 0.841 0.5 -> 0.917 Inexact Rounded
-pwsx4514 power 0.0841 0.5 -> 0.290 Inexact Rounded
-pwsx4515 power 0.842 0.5 -> 0.918 Inexact Rounded
-pwsx4516 power 0.0842 0.5 -> 0.290 Inexact Rounded
-pwsx4517 power 0.843 0.5 -> 0.918 Inexact Rounded
-pwsx4518 power 0.0843 0.5 -> 0.290 Inexact Rounded
-pwsx4519 power 0.844 0.5 -> 0.919 Inexact Rounded
-pwsx4520 power 0.0844 0.5 -> 0.291 Inexact Rounded
-pwsx4521 power 0.845 0.5 -> 0.919 Inexact Rounded
-pwsx4522 power 0.0845 0.5 -> 0.291 Inexact Rounded
-pwsx4523 power 0.846 0.5 -> 0.920 Inexact Rounded
-pwsx4524 power 0.0846 0.5 -> 0.291 Inexact Rounded
-pwsx4525 power 0.847 0.5 -> 0.920 Inexact Rounded
-pwsx4526 power 0.0847 0.5 -> 0.291 Inexact Rounded
-pwsx4527 power 0.848 0.5 -> 0.921 Inexact Rounded
-pwsx4528 power 0.0848 0.5 -> 0.291 Inexact Rounded
-pwsx4529 power 0.849 0.5 -> 0.921 Inexact Rounded
-pwsx4530 power 0.0849 0.5 -> 0.291 Inexact Rounded
-pwsx4531 power 0.851 0.5 -> 0.922 Inexact Rounded
-pwsx4532 power 0.0851 0.5 -> 0.292 Inexact Rounded
-pwsx4533 power 0.852 0.5 -> 0.923 Inexact Rounded
-pwsx4534 power 0.0852 0.5 -> 0.292 Inexact Rounded
-pwsx4535 power 0.853 0.5 -> 0.924 Inexact Rounded
-pwsx4536 power 0.0853 0.5 -> 0.292 Inexact Rounded
-pwsx4537 power 0.854 0.5 -> 0.924 Inexact Rounded
-pwsx4538 power 0.0854 0.5 -> 0.292 Inexact Rounded
-pwsx4539 power 0.855 0.5 -> 0.925 Inexact Rounded
-pwsx4540 power 0.0855 0.5 -> 0.292 Inexact Rounded
-pwsx4541 power 0.856 0.5 -> 0.925 Inexact Rounded
-pwsx4542 power 0.0856 0.5 -> 0.293 Inexact Rounded
-pwsx4543 power 0.857 0.5 -> 0.926 Inexact Rounded
-pwsx4544 power 0.0857 0.5 -> 0.293 Inexact Rounded
-pwsx4545 power 0.858 0.5 -> 0.926 Inexact Rounded
-pwsx4546 power 0.0858 0.5 -> 0.293 Inexact Rounded
-pwsx4547 power 0.859 0.5 -> 0.927 Inexact Rounded
-pwsx4548 power 0.0859 0.5 -> 0.293 Inexact Rounded
-pwsx4549 power 0.861 0.5 -> 0.928 Inexact Rounded
-pwsx4550 power 0.0861 0.5 -> 0.293 Inexact Rounded
-pwsx4551 power 0.862 0.5 -> 0.928 Inexact Rounded
-pwsx4552 power 0.0862 0.5 -> 0.294 Inexact Rounded
-pwsx4553 power 0.863 0.5 -> 0.929 Inexact Rounded
-pwsx4554 power 0.0863 0.5 -> 0.294 Inexact Rounded
-pwsx4555 power 0.864 0.5 -> 0.930 Inexact Rounded
-pwsx4556 power 0.0864 0.5 -> 0.294 Inexact Rounded
-pwsx4557 power 0.865 0.5 -> 0.930 Inexact Rounded
-pwsx4558 power 0.0865 0.5 -> 0.294 Inexact Rounded
-pwsx4559 power 0.866 0.5 -> 0.931 Inexact Rounded
-pwsx4560 power 0.0866 0.5 -> 0.294 Inexact Rounded
-pwsx4561 power 0.867 0.5 -> 0.931 Inexact Rounded
-pwsx4562 power 0.0867 0.5 -> 0.294 Inexact Rounded
-pwsx4563 power 0.868 0.5 -> 0.932 Inexact Rounded
-pwsx4564 power 0.0868 0.5 -> 0.295 Inexact Rounded
-pwsx4565 power 0.869 0.5 -> 0.932 Inexact Rounded
-pwsx4566 power 0.0869 0.5 -> 0.295 Inexact Rounded
-pwsx4567 power 0.871 0.5 -> 0.933 Inexact Rounded
-pwsx4568 power 0.0871 0.5 -> 0.295 Inexact Rounded
-pwsx4569 power 0.872 0.5 -> 0.934 Inexact Rounded
-pwsx4570 power 0.0872 0.5 -> 0.295 Inexact Rounded
-pwsx4571 power 0.873 0.5 -> 0.934 Inexact Rounded
-pwsx4572 power 0.0873 0.5 -> 0.295 Inexact Rounded
-pwsx4573 power 0.874 0.5 -> 0.935 Inexact Rounded
-pwsx4574 power 0.0874 0.5 -> 0.296 Inexact Rounded
-pwsx4575 power 0.875 0.5 -> 0.935 Inexact Rounded
-pwsx4576 power 0.0875 0.5 -> 0.296 Inexact Rounded
-pwsx4577 power 0.876 0.5 -> 0.936 Inexact Rounded
-pwsx4578 power 0.0876 0.5 -> 0.296 Inexact Rounded
-pwsx4579 power 0.877 0.5 -> 0.936 Inexact Rounded
-pwsx4580 power 0.0877 0.5 -> 0.296 Inexact Rounded
-pwsx4581 power 0.878 0.5 -> 0.937 Inexact Rounded
-pwsx4582 power 0.0878 0.5 -> 0.296 Inexact Rounded
-pwsx4583 power 0.879 0.5 -> 0.938 Inexact Rounded
-pwsx4584 power 0.0879 0.5 -> 0.296 Inexact Rounded
-pwsx4585 power 0.881 0.5 -> 0.939 Inexact Rounded
-pwsx4586 power 0.0881 0.5 -> 0.297 Inexact Rounded
-pwsx4587 power 0.882 0.5 -> 0.939 Inexact Rounded
-pwsx4588 power 0.0882 0.5 -> 0.297 Inexact Rounded
-pwsx4589 power 0.883 0.5 -> 0.940 Inexact Rounded
-pwsx4590 power 0.0883 0.5 -> 0.297 Inexact Rounded
-pwsx4591 power 0.884 0.5 -> 0.940 Inexact Rounded
-pwsx4592 power 0.0884 0.5 -> 0.297 Inexact Rounded
-pwsx4593 power 0.885 0.5 -> 0.941 Inexact Rounded
-pwsx4594 power 0.0885 0.5 -> 0.297 Inexact Rounded
-pwsx4595 power 0.886 0.5 -> 0.941 Inexact Rounded
-pwsx4596 power 0.0886 0.5 -> 0.298 Inexact Rounded
-pwsx4597 power 0.887 0.5 -> 0.942 Inexact Rounded
-pwsx4598 power 0.0887 0.5 -> 0.298 Inexact Rounded
-pwsx4599 power 0.888 0.5 -> 0.942 Inexact Rounded
-pwsx4600 power 0.0888 0.5 -> 0.298 Inexact Rounded
-pwsx4601 power 0.889 0.5 -> 0.943 Inexact Rounded
-pwsx4602 power 0.0889 0.5 -> 0.298 Inexact Rounded
-pwsx4603 power 0.891 0.5 -> 0.944 Inexact Rounded
-pwsx4604 power 0.0891 0.5 -> 0.298 Inexact Rounded
-pwsx4605 power 0.892 0.5 -> 0.944 Inexact Rounded
-pwsx4606 power 0.0892 0.5 -> 0.299 Inexact Rounded
-pwsx4607 power 0.893 0.5 -> 0.945 Inexact Rounded
-pwsx4608 power 0.0893 0.5 -> 0.299 Inexact Rounded
-pwsx4609 power 0.894 0.5 -> 0.946 Inexact Rounded
-pwsx4610 power 0.0894 0.5 -> 0.299 Inexact Rounded
-pwsx4611 power 0.895 0.5 -> 0.946 Inexact Rounded
-pwsx4612 power 0.0895 0.5 -> 0.299 Inexact Rounded
-pwsx4613 power 0.896 0.5 -> 0.947 Inexact Rounded
-pwsx4614 power 0.0896 0.5 -> 0.299 Inexact Rounded
-pwsx4615 power 0.897 0.5 -> 0.947 Inexact Rounded
-pwsx4616 power 0.0897 0.5 -> 0.299 Inexact Rounded
-pwsx4617 power 0.898 0.5 -> 0.948 Inexact Rounded
-pwsx4618 power 0.0898 0.5 -> 0.300 Inexact Rounded
-pwsx4619 power 0.899 0.5 -> 0.948 Inexact Rounded
-pwsx4620 power 0.0899 0.5 -> 0.300 Inexact Rounded
-pwsx4621 power 0.901 0.5 -> 0.949 Inexact Rounded
-pwsx4622 power 0.0901 0.5 -> 0.300 Inexact Rounded
-pwsx4623 power 0.902 0.5 -> 0.950 Inexact Rounded
-pwsx4624 power 0.0902 0.5 -> 0.300 Inexact Rounded
-pwsx4625 power 0.903 0.5 -> 0.950 Inexact Rounded
-pwsx4626 power 0.0903 0.5 -> 0.300 Inexact Rounded
-pwsx4627 power 0.904 0.5 -> 0.951 Inexact Rounded
-pwsx4628 power 0.0904 0.5 -> 0.301 Inexact Rounded
-pwsx4629 power 0.905 0.5 -> 0.951 Inexact Rounded
-pwsx4630 power 0.0905 0.5 -> 0.301 Inexact Rounded
-pwsx4631 power 0.906 0.5 -> 0.952 Inexact Rounded
-pwsx4632 power 0.0906 0.5 -> 0.301 Inexact Rounded
-pwsx4633 power 0.907 0.5 -> 0.952 Inexact Rounded
-pwsx4634 power 0.0907 0.5 -> 0.301 Inexact Rounded
-pwsx4635 power 0.908 0.5 -> 0.953 Inexact Rounded
-pwsx4636 power 0.0908 0.5 -> 0.301 Inexact Rounded
-pwsx4637 power 0.909 0.5 -> 0.953 Inexact Rounded
-pwsx4638 power 0.0909 0.5 -> 0.301 Inexact Rounded
-pwsx4639 power 0.911 0.5 -> 0.954 Inexact Rounded
-pwsx4640 power 0.0911 0.5 -> 0.302 Inexact Rounded
-pwsx4641 power 0.912 0.5 -> 0.955 Inexact Rounded
-pwsx4642 power 0.0912 0.5 -> 0.302 Inexact Rounded
-pwsx4643 power 0.913 0.5 -> 0.956 Inexact Rounded
-pwsx4644 power 0.0913 0.5 -> 0.302 Inexact Rounded
-pwsx4645 power 0.914 0.5 -> 0.956 Inexact Rounded
-pwsx4646 power 0.0914 0.5 -> 0.302 Inexact Rounded
-pwsx4647 power 0.915 0.5 -> 0.957 Inexact Rounded
-pwsx4648 power 0.0915 0.5 -> 0.302 Inexact Rounded
-pwsx4649 power 0.916 0.5 -> 0.957 Inexact Rounded
-pwsx4650 power 0.0916 0.5 -> 0.303 Inexact Rounded
-pwsx4651 power 0.917 0.5 -> 0.958 Inexact Rounded
-pwsx4652 power 0.0917 0.5 -> 0.303 Inexact Rounded
-pwsx4653 power 0.918 0.5 -> 0.958 Inexact Rounded
-pwsx4654 power 0.0918 0.5 -> 0.303 Inexact Rounded
-pwsx4655 power 0.919 0.5 -> 0.959 Inexact Rounded
-pwsx4656 power 0.0919 0.5 -> 0.303 Inexact Rounded
-pwsx4657 power 0.921 0.5 -> 0.960 Inexact Rounded
-pwsx4658 power 0.0921 0.5 -> 0.303 Inexact Rounded
-pwsx4659 power 0.922 0.5 -> 0.960 Inexact Rounded
-pwsx4660 power 0.0922 0.5 -> 0.304 Inexact Rounded
-pwsx4661 power 0.923 0.5 -> 0.961 Inexact Rounded
-pwsx4662 power 0.0923 0.5 -> 0.304 Inexact Rounded
-pwsx4663 power 0.924 0.5 -> 0.961 Inexact Rounded
-pwsx4664 power 0.0924 0.5 -> 0.304 Inexact Rounded
-pwsx4665 power 0.925 0.5 -> 0.962 Inexact Rounded
-pwsx4666 power 0.0925 0.5 -> 0.304 Inexact Rounded
-pwsx4667 power 0.926 0.5 -> 0.962 Inexact Rounded
-pwsx4668 power 0.0926 0.5 -> 0.304 Inexact Rounded
-pwsx4669 power 0.927 0.5 -> 0.963 Inexact Rounded
-pwsx4670 power 0.0927 0.5 -> 0.304 Inexact Rounded
-pwsx4671 power 0.928 0.5 -> 0.963 Inexact Rounded
-pwsx4672 power 0.0928 0.5 -> 0.305 Inexact Rounded
-pwsx4673 power 0.929 0.5 -> 0.964 Inexact Rounded
-pwsx4674 power 0.0929 0.5 -> 0.305 Inexact Rounded
-pwsx4675 power 0.931 0.5 -> 0.965 Inexact Rounded
-pwsx4676 power 0.0931 0.5 -> 0.305 Inexact Rounded
-pwsx4677 power 0.932 0.5 -> 0.965 Inexact Rounded
-pwsx4678 power 0.0932 0.5 -> 0.305 Inexact Rounded
-pwsx4679 power 0.933 0.5 -> 0.966 Inexact Rounded
-pwsx4680 power 0.0933 0.5 -> 0.305 Inexact Rounded
-pwsx4681 power 0.934 0.5 -> 0.966 Inexact Rounded
-pwsx4682 power 0.0934 0.5 -> 0.306 Inexact Rounded
-pwsx4683 power 0.935 0.5 -> 0.967 Inexact Rounded
-pwsx4684 power 0.0935 0.5 -> 0.306 Inexact Rounded
-pwsx4685 power 0.936 0.5 -> 0.967 Inexact Rounded
-pwsx4686 power 0.0936 0.5 -> 0.306 Inexact Rounded
-pwsx4687 power 0.937 0.5 -> 0.968 Inexact Rounded
-pwsx4688 power 0.0937 0.5 -> 0.306 Inexact Rounded
-pwsx4689 power 0.938 0.5 -> 0.969 Inexact Rounded
-pwsx4690 power 0.0938 0.5 -> 0.306 Inexact Rounded
-pwsx4691 power 0.939 0.5 -> 0.969 Inexact Rounded
-pwsx4692 power 0.0939 0.5 -> 0.306 Inexact Rounded
-pwsx4693 power 0.941 0.5 -> 0.970 Inexact Rounded
-pwsx4694 power 0.0941 0.5 -> 0.307 Inexact Rounded
-pwsx4695 power 0.942 0.5 -> 0.971 Inexact Rounded
-pwsx4696 power 0.0942 0.5 -> 0.307 Inexact Rounded
-pwsx4697 power 0.943 0.5 -> 0.971 Inexact Rounded
-pwsx4698 power 0.0943 0.5 -> 0.307 Inexact Rounded
-pwsx4699 power 0.944 0.5 -> 0.972 Inexact Rounded
-pwsx4700 power 0.0944 0.5 -> 0.307 Inexact Rounded
-pwsx4701 power 0.945 0.5 -> 0.972 Inexact Rounded
-pwsx4702 power 0.0945 0.5 -> 0.307 Inexact Rounded
-pwsx4703 power 0.946 0.5 -> 0.973 Inexact Rounded
-pwsx4704 power 0.0946 0.5 -> 0.308 Inexact Rounded
-pwsx4705 power 0.947 0.5 -> 0.973 Inexact Rounded
-pwsx4706 power 0.0947 0.5 -> 0.308 Inexact Rounded
-pwsx4707 power 0.948 0.5 -> 0.974 Inexact Rounded
-pwsx4708 power 0.0948 0.5 -> 0.308 Inexact Rounded
-pwsx4709 power 0.949 0.5 -> 0.974 Inexact Rounded
-pwsx4710 power 0.0949 0.5 -> 0.308 Inexact Rounded
-pwsx4711 power 0.951 0.5 -> 0.975 Inexact Rounded
-pwsx4712 power 0.0951 0.5 -> 0.308 Inexact Rounded
-pwsx4713 power 0.952 0.5 -> 0.976 Inexact Rounded
-pwsx4714 power 0.0952 0.5 -> 0.309 Inexact Rounded
-pwsx4715 power 0.953 0.5 -> 0.976 Inexact Rounded
-pwsx4716 power 0.0953 0.5 -> 0.309 Inexact Rounded
-pwsx4717 power 0.954 0.5 -> 0.977 Inexact Rounded
-pwsx4718 power 0.0954 0.5 -> 0.309 Inexact Rounded
-pwsx4719 power 0.955 0.5 -> 0.977 Inexact Rounded
-pwsx4720 power 0.0955 0.5 -> 0.309 Inexact Rounded
-pwsx4721 power 0.956 0.5 -> 0.978 Inexact Rounded
-pwsx4722 power 0.0956 0.5 -> 0.309 Inexact Rounded
-pwsx4723 power 0.957 0.5 -> 0.978 Inexact Rounded
-pwsx4724 power 0.0957 0.5 -> 0.309 Inexact Rounded
-pwsx4725 power 0.958 0.5 -> 0.979 Inexact Rounded
-pwsx4726 power 0.0958 0.5 -> 0.310 Inexact Rounded
-pwsx4727 power 0.959 0.5 -> 0.979 Inexact Rounded
-pwsx4728 power 0.0959 0.5 -> 0.310 Inexact Rounded
-pwsx4729 power 0.961 0.5 -> 0.980 Inexact Rounded
-pwsx4730 power 0.0961 0.5 -> 0.310 Inexact Rounded
-pwsx4731 power 0.962 0.5 -> 0.981 Inexact Rounded
-pwsx4732 power 0.0962 0.5 -> 0.310 Inexact Rounded
-pwsx4733 power 0.963 0.5 -> 0.981 Inexact Rounded
-pwsx4734 power 0.0963 0.5 -> 0.310 Inexact Rounded
-pwsx4735 power 0.964 0.5 -> 0.982 Inexact Rounded
-pwsx4736 power 0.0964 0.5 -> 0.310 Inexact Rounded
-pwsx4737 power 0.965 0.5 -> 0.982 Inexact Rounded
-pwsx4738 power 0.0965 0.5 -> 0.311 Inexact Rounded
-pwsx4739 power 0.966 0.5 -> 0.983 Inexact Rounded
-pwsx4740 power 0.0966 0.5 -> 0.311 Inexact Rounded
-pwsx4741 power 0.967 0.5 -> 0.983 Inexact Rounded
-pwsx4742 power 0.0967 0.5 -> 0.311 Inexact Rounded
-pwsx4743 power 0.968 0.5 -> 0.984 Inexact Rounded
-pwsx4744 power 0.0968 0.5 -> 0.311 Inexact Rounded
-pwsx4745 power 0.969 0.5 -> 0.984 Inexact Rounded
-pwsx4746 power 0.0969 0.5 -> 0.311 Inexact Rounded
-pwsx4747 power 0.971 0.5 -> 0.985 Inexact Rounded
-pwsx4748 power 0.0971 0.5 -> 0.312 Inexact Rounded
-pwsx4749 power 0.972 0.5 -> 0.986 Inexact Rounded
-pwsx4750 power 0.0972 0.5 -> 0.312 Inexact Rounded
-pwsx4751 power 0.973 0.5 -> 0.986 Inexact Rounded
-pwsx4752 power 0.0973 0.5 -> 0.312 Inexact Rounded
-pwsx4753 power 0.974 0.5 -> 0.987 Inexact Rounded
-pwsx4754 power 0.0974 0.5 -> 0.312 Inexact Rounded
-pwsx4755 power 0.975 0.5 -> 0.987 Inexact Rounded
-pwsx4756 power 0.0975 0.5 -> 0.312 Inexact Rounded
-pwsx4757 power 0.976 0.5 -> 0.988 Inexact Rounded
-pwsx4758 power 0.0976 0.5 -> 0.312 Inexact Rounded
-pwsx4759 power 0.977 0.5 -> 0.988 Inexact Rounded
-pwsx4760 power 0.0977 0.5 -> 0.313 Inexact Rounded
-pwsx4761 power 0.978 0.5 -> 0.989 Inexact Rounded
-pwsx4762 power 0.0978 0.5 -> 0.313 Inexact Rounded
-pwsx4763 power 0.979 0.5 -> 0.989 Inexact Rounded
-pwsx4764 power 0.0979 0.5 -> 0.313 Inexact Rounded
-pwsx4765 power 0.981 0.5 -> 0.990 Inexact Rounded
-pwsx4766 power 0.0981 0.5 -> 0.313 Inexact Rounded
-pwsx4767 power 0.982 0.5 -> 0.991 Inexact Rounded
-pwsx4768 power 0.0982 0.5 -> 0.313 Inexact Rounded
-pwsx4769 power 0.983 0.5 -> 0.991 Inexact Rounded
-pwsx4770 power 0.0983 0.5 -> 0.314 Inexact Rounded
-pwsx4771 power 0.984 0.5 -> 0.992 Inexact Rounded
-pwsx4772 power 0.0984 0.5 -> 0.314 Inexact Rounded
-pwsx4773 power 0.985 0.5 -> 0.992 Inexact Rounded
-pwsx4774 power 0.0985 0.5 -> 0.314 Inexact Rounded
-pwsx4775 power 0.986 0.5 -> 0.993 Inexact Rounded
-pwsx4776 power 0.0986 0.5 -> 0.314 Inexact Rounded
-pwsx4777 power 0.987 0.5 -> 0.993 Inexact Rounded
-pwsx4778 power 0.0987 0.5 -> 0.314 Inexact Rounded
-pwsx4779 power 0.988 0.5 -> 0.994 Inexact Rounded
-pwsx4780 power 0.0988 0.5 -> 0.314 Inexact Rounded
-pwsx4781 power 0.989 0.5 -> 0.994 Inexact Rounded
-pwsx4782 power 0.0989 0.5 -> 0.314 Inexact Rounded
-pwsx4783 power 0.991 0.5 -> 0.995 Inexact Rounded
-pwsx4784 power 0.0991 0.5 -> 0.315 Inexact Rounded
-pwsx4785 power 0.992 0.5 -> 0.996 Inexact Rounded
-pwsx4786 power 0.0992 0.5 -> 0.315 Inexact Rounded
-pwsx4787 power 0.993 0.5 -> 0.996 Inexact Rounded
-pwsx4788 power 0.0993 0.5 -> 0.315 Inexact Rounded
-pwsx4789 power 0.994 0.5 -> 0.997 Inexact Rounded
-pwsx4790 power 0.0994 0.5 -> 0.315 Inexact Rounded
-pwsx4791 power 0.995 0.5 -> 0.997 Inexact Rounded
-pwsx4792 power 0.0995 0.5 -> 0.315 Inexact Rounded
-pwsx4793 power 0.996 0.5 -> 0.998 Inexact Rounded
-pwsx4794 power 0.0996 0.5 -> 0.316 Inexact Rounded
-pwsx4795 power 0.997 0.5 -> 0.998 Inexact Rounded
-pwsx4796 power 0.0997 0.5 -> 0.316 Inexact Rounded
-pwsx4797 power 0.998 0.5 -> 0.999 Inexact Rounded
-pwsx4798 power 0.0998 0.5 -> 0.316 Inexact Rounded
-pwsx4799 power 0.999 0.5 -> 0.999 Inexact Rounded
-pwsx4800 power 0.0999 0.5 -> 0.316 Inexact Rounded
-
--- A group of precision 4 tests where Hull & Abrham adjustments are
--- needed in some cases (both up and down) [see Hull1985b]
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-precision: 4
-pwsx5001 power 0.0118 0.5 -> 0.1086 Inexact Rounded
-pwsx5002 power 0.119 0.5 -> 0.3450 Inexact Rounded
-pwsx5003 power 0.0119 0.5 -> 0.1091 Inexact Rounded
-pwsx5004 power 0.121 0.5 -> 0.3479 Inexact Rounded
-pwsx5005 power 0.0121 0.5 -> 0.1100 Inexact Rounded
-pwsx5006 power 0.122 0.5 -> 0.3493 Inexact Rounded
-pwsx5007 power 0.0122 0.5 -> 0.1105 Inexact Rounded
-pwsx5008 power 0.123 0.5 -> 0.3507 Inexact Rounded
-pwsx5009 power 0.494 0.5 -> 0.7029 Inexact Rounded
-pwsx5010 power 0.0669 0.5 -> 0.2587 Inexact Rounded
-pwsx5011 power 0.9558 0.5 -> 0.9777 Inexact Rounded
-pwsx5012 power 0.9348 0.5 -> 0.9669 Inexact Rounded
-pwsx5013 power 0.9345 0.5 -> 0.9667 Inexact Rounded
-pwsx5014 power 0.09345 0.5 -> 0.3057 Inexact Rounded
-pwsx5015 power 0.9346 0.5 -> 0.9667 Inexact Rounded
-pwsx5016 power 0.09346 0.5 -> 0.3057 Inexact Rounded
-pwsx5017 power 0.9347 0.5 -> 0.9668 Inexact Rounded
-
--- examples from decArith
-precision: 9
-pwsx700 power 0 0.5 -> '0'
-pwsx701 power -0 0.5 -> '0'
-pwsx702 power 0.39 0.5 -> 0.624499800 Inexact Rounded
-pwsx703 power 100 0.5 -> '10.0000000' Inexact Rounded
-pwsx704 power 1.00 0.5 -> '1.00000000' Inexact Rounded
-pwsx705 power 7 0.5 -> '2.64575131' Inexact Rounded
-pwsx706 power 10 0.5 -> 3.16227766 Inexact Rounded
-
--- some one-offs
-precision: 9
-pwsx711 power 0.1 0.5 -> 0.316227766 Inexact Rounded
-pwsx712 power 0.2 0.5 -> 0.447213595 Inexact Rounded
-pwsx713 power 0.3 0.5 -> 0.547722558 Inexact Rounded
-pwsx714 power 0.4 0.5 -> 0.632455532 Inexact Rounded
-pwsx715 power 0.5 0.5 -> 0.707106781 Inexact Rounded
-pwsx716 power 0.6 0.5 -> 0.774596669 Inexact Rounded
-pwsx717 power 0.7 0.5 -> 0.836660027 Inexact Rounded
-pwsx718 power 0.8 0.5 -> 0.894427191 Inexact Rounded
-pwsx719 power 0.9 0.5 -> 0.948683298 Inexact Rounded
-precision: 10 -- note no normalizatoin here
-pwsx720 power +0.1 0.5 -> 0.3162277660 Inexact Rounded
-precision: 11
-pwsx721 power +0.1 0.5 -> 0.31622776602 Inexact Rounded
-precision: 12
-pwsx722 power +0.1 0.5 -> 0.316227766017 Inexact Rounded
-precision: 9
-pwsx723 power 0.39 0.5 -> 0.624499800 Inexact Rounded
-precision: 15
-pwsx724 power 0.39 0.5 -> 0.624499799839840 Inexact Rounded
-
--- discussion cases
-precision: 7
-pwsx731 power 9 0.5 -> 3.000000 Inexact Rounded
-pwsx732 power 100 0.5 -> 10.00000 Inexact Rounded
-pwsx733 power 123 0.5 -> 11.09054 Inexact Rounded
-pwsx734 power 144 0.5 -> 12.00000 Inexact Rounded
-pwsx735 power 156 0.5 -> 12.49000 Inexact Rounded
-pwsx736 power 10000 0.5 -> 100.0000 Inexact Rounded
-
--- values close to overflow (if there were input rounding)
-maxexponent: 99
-minexponent: -99
-precision: 5
-pwsx760 power 9.9997E+99 0.5 -> 9.9998E+49 Inexact Rounded
-pwsx761 power 9.9998E+99 0.5 -> 9.9999E+49 Inexact Rounded
-pwsx762 power 9.9999E+99 0.5 -> 9.9999E+49 Inexact Rounded
-pwsx763 power 9.99991E+99 0.5 -> 1.0000E+50 Inexact Rounded
-pwsx764 power 9.99994E+99 0.5 -> 1.0000E+50 Inexact Rounded
-pwsx765 power 9.99995E+99 0.5 -> 1.0000E+50 Inexact Rounded
-pwsx766 power 9.99999E+99 0.5 -> 1.0000E+50 Inexact Rounded
-precision: 9
-pwsx770 power 9.9997E+99 0.5 -> 9.99985000E+49 Inexact Rounded
-pwsx771 power 9.9998E+99 0.5 -> 9.99990000E+49 Inexact Rounded
-pwsx772 power 9.9999E+99 0.5 -> 9.99995000E+49 Inexact Rounded
-pwsx773 power 9.99991E+99 0.5 -> 9.99995500E+49 Inexact Rounded
-pwsx774 power 9.99994E+99 0.5 -> 9.99997000E+49 Inexact Rounded
-pwsx775 power 9.99995E+99 0.5 -> 9.99997500E+49 Inexact Rounded
-pwsx776 power 9.99999E+99 0.5 -> 9.99999500E+49 Inexact Rounded
-precision: 20
-pwsx780 power 9.9997E+99 0.5 -> '9.9998499988749831247E+49' Inexact Rounded
-pwsx781 power 9.9998E+99 0.5 -> '9.9998999994999949999E+49' Inexact Rounded
-pwsx782 power 9.9999E+99 0.5 -> '9.9999499998749993750E+49' Inexact Rounded
-pwsx783 power 9.99991E+99 0.5 -> '9.9999549998987495444E+49' Inexact Rounded
-pwsx784 power 9.99994E+99 0.5 -> '9.9999699999549998650E+49' Inexact Rounded
-pwsx785 power 9.99995E+99 0.5 -> '9.9999749999687499219E+49' Inexact Rounded
-pwsx786 power 9.99999E+99 0.5 -> '9.9999949999987499994E+49' Inexact Rounded
-
--- subnormals and underflows [these can only result when eMax is < digits+1]
--- Etiny = -(Emax + (precision-1))
--- start with subnormal operands and normal results
-maxexponent: 9
-minexponent: -9
-precision: 9 -- Etiny=-17
-pwsx800 power 1E-17 0.5 -> 3.16227766E-9 Inexact Rounded
-pwsx801 power 10E-17 0.5 -> 1.00000000E-8 Inexact Rounded
-precision: 10 -- Etiny=-18
-pwsx802 power 10E-18 0.5 -> 3.162277660E-9 Inexact Rounded
-pwsx803 power 1E-18 0.5 -> 1.000000000E-9 Inexact Rounded
-
-precision: 11 -- Etiny=-19
-pwsx804 power 1E-19 0.5 -> 3.162277660E-10 Underflow Subnormal Inexact Rounded
--- The next test should be skipped for decNumber
-pwsx805 power 10E-19 0.5 -> 1.0000000000E-9 Inexact Rounded
-precision: 12 -- Etiny=-20
-pwsx806 power 10E-20 0.5 -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded
-pwsx807 power 1E-20 0.5 -> 1.0000000000E-10 Underflow Subnormal Inexact Rounded
-
-precision: 13 -- Etiny=-21
-pwsx808 power 1E-21 0.5 -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded
-pwsx809 power 10E-21 0.5 -> 1.00000000000E-10 Underflow Subnormal Inexact Rounded
-precision: 14 -- Etiny=-22
-pwsx810 power 1E-21 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
-pwsx811 power 10E-22 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
-pwsx812 power 1E-22 0.5 -> 1.00000000000E-11 Underflow Subnormal Inexact Rounded
-
-
--- special values
-maxexponent: 999
-minexponent: -999
-pwsx820 power Inf 0.5 -> Infinity
-pwsx821 power -Inf 0.5 -> NaN Invalid_operation
-pwsx822 power NaN 0.5 -> NaN
-pwsx823 power sNaN 0.5 -> NaN Invalid_operation
--- propagating NaNs
-pwsx824 power sNaN123 0.5 -> NaN123 Invalid_operation
-pwsx825 power -sNaN321 0.5 -> -NaN321 Invalid_operation
-pwsx826 power NaN456 0.5 -> NaN456
-pwsx827 power -NaN654 0.5 -> -NaN654
-pwsx828 power NaN1 0.5 -> NaN1
-
--- Null test
-pwsx900 power # 0.5 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- powersqrt.decTest -- decimal square root, using power --
+-- Copyright (c) IBM Corporation, 2004, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- These testcases are taken from squareroot.decTest but are
+-- evaluated using the power operator. The differences in results
+-- (153 out of 2856) fall into the following categories:
+--
+-- x ** 0.5 (x>0) has no preferred exponent, and is Inexact
+-- (and hence full precision); almost all differences are
+-- in this category
+-- 0.00 ** 0.5 becomes 0 (not 0.0), etc.
+-- -0 ** 0.5 becomes 0 (never -0)
+-- Some exact subnormals become inexact and hence underflows
+
+extended: 1
+precision: 9
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- basics
+pwsx001 power 1 0.5 -> 1.00000000 Inexact Rounded
+pwsx002 power -1 0.5 -> NaN Invalid_operation
+pwsx003 power 1.00 0.5 -> 1.00000000 Inexact Rounded
+pwsx004 power -1.00 0.5 -> NaN Invalid_operation
+pwsx005 power 0 0.5 -> 0
+pwsx006 power 00.0 0.5 -> 0
+pwsx007 power 0.00 0.5 -> 0
+pwsx008 power 00.00 0.5 -> 0
+pwsx009 power 00.000 0.5 -> 0
+pwsx010 power 00.0000 0.5 -> 0
+pwsx011 power 00 0.5 -> 0
+
+pwsx012 power -2 0.5 -> NaN Invalid_operation
+pwsx013 power 2 0.5 -> 1.41421356 Inexact Rounded
+pwsx014 power -2.00 0.5 -> NaN Invalid_operation
+pwsx015 power 2.00 0.5 -> 1.41421356 Inexact Rounded
+pwsx016 power -0 0.5 -> 0
+pwsx017 power -0.0 0.5 -> 0
+pwsx018 power -00.00 0.5 -> 0
+pwsx019 power -00.000 0.5 -> 0
+pwsx020 power -0.0000 0.5 -> 0
+pwsx021 power -0E+9 0.5 -> 0
+pwsx022 power -0E+10 0.5 -> 0
+pwsx023 power -0E+11 0.5 -> 0
+pwsx024 power -0E+12 0.5 -> 0
+pwsx025 power -00 0.5 -> 0
+pwsx026 power 0E+5 0.5 -> 0
+pwsx027 power 4.0 0.5 -> 2.00000000 Inexact Rounded
+pwsx028 power 4.00 0.5 -> 2.00000000 Inexact Rounded
+
+pwsx030 power +0.1 0.5 -> 0.316227766 Inexact Rounded
+pwsx031 power -0.1 0.5 -> NaN Invalid_operation
+pwsx032 power +0.01 0.5 -> 0.100000000 Inexact Rounded
+pwsx033 power -0.01 0.5 -> NaN Invalid_operation
+pwsx034 power +0.001 0.5 -> 0.0316227766 Inexact Rounded
+pwsx035 power -0.001 0.5 -> NaN Invalid_operation
+pwsx036 power +0.000001 0.5 -> 0.00100000000 Inexact Rounded
+pwsx037 power -0.000001 0.5 -> NaN Invalid_operation
+pwsx038 power +0.000000000001 0.5 -> 0.00000100000000 Inexact Rounded
+pwsx039 power -0.000000000001 0.5 -> NaN Invalid_operation
+
+pwsx041 power 1.1 0.5 -> 1.04880885 Inexact Rounded
+pwsx042 power 1.10 0.5 -> 1.04880885 Inexact Rounded
+pwsx043 power 1.100 0.5 -> 1.04880885 Inexact Rounded
+pwsx044 power 1.110 0.5 -> 1.05356538 Inexact Rounded
+pwsx045 power -1.1 0.5 -> NaN Invalid_operation
+pwsx046 power -1.10 0.5 -> NaN Invalid_operation
+pwsx047 power -1.100 0.5 -> NaN Invalid_operation
+pwsx048 power -1.110 0.5 -> NaN Invalid_operation
+pwsx049 power 9.9 0.5 -> 3.14642654 Inexact Rounded
+pwsx050 power 9.90 0.5 -> 3.14642654 Inexact Rounded
+pwsx051 power 9.900 0.5 -> 3.14642654 Inexact Rounded
+pwsx052 power 9.990 0.5 -> 3.16069613 Inexact Rounded
+pwsx053 power -9.9 0.5 -> NaN Invalid_operation
+pwsx054 power -9.90 0.5 -> NaN Invalid_operation
+pwsx055 power -9.900 0.5 -> NaN Invalid_operation
+pwsx056 power -9.990 0.5 -> NaN Invalid_operation
+
+pwsx060 power 1 0.5 -> 1.00000000 Inexact Rounded
+pwsx061 power 1.0 0.5 -> 1.00000000 Inexact Rounded
+pwsx062 power 1.00 0.5 -> 1.00000000 Inexact Rounded
+pwsx063 power 10.0 0.5 -> 3.16227766 Inexact Rounded
+pwsx064 power 10.0 0.5 -> 3.16227766 Inexact Rounded
+pwsx065 power 10.0 0.5 -> 3.16227766 Inexact Rounded
+pwsx066 power 10.00 0.5 -> 3.16227766 Inexact Rounded
+pwsx067 power 100 0.5 -> 10.0000000 Inexact Rounded
+pwsx068 power 100.0 0.5 -> 10.0000000 Inexact Rounded
+pwsx069 power 100.00 0.5 -> 10.0000000 Inexact Rounded
+pwsx070 power 1.1000E+3 0.5 -> 33.1662479 Inexact Rounded
+pwsx071 power 1.10000E+3 0.5 -> 33.1662479 Inexact Rounded
+pwsx072 power -10.0 0.5 -> NaN Invalid_operation
+pwsx073 power -10.00 0.5 -> NaN Invalid_operation
+pwsx074 power -100.0 0.5 -> NaN Invalid_operation
+pwsx075 power -100.00 0.5 -> NaN Invalid_operation
+pwsx076 power -1.1000E+3 0.5 -> NaN Invalid_operation
+pwsx077 power -1.10000E+3 0.5 -> NaN Invalid_operation
+
+-- famous squares
+pwsx080 power 1 0.5 -> 1.00000000 Inexact Rounded
+pwsx081 power 4 0.5 -> 2.00000000 Inexact Rounded
+pwsx082 power 9 0.5 -> 3.00000000 Inexact Rounded
+pwsx083 power 16 0.5 -> 4.00000000 Inexact Rounded
+pwsx084 power 25 0.5 -> 5.00000000 Inexact Rounded
+pwsx085 power 36 0.5 -> 6.00000000 Inexact Rounded
+pwsx086 power 49 0.5 -> 7.00000000 Inexact Rounded
+pwsx087 power 64 0.5 -> 8.00000000 Inexact Rounded
+pwsx088 power 81 0.5 -> 9.00000000 Inexact Rounded
+pwsx089 power 100 0.5 -> 10.0000000 Inexact Rounded
+pwsx090 power 121 0.5 -> 11.0000000 Inexact Rounded
+pwsx091 power 144 0.5 -> 12.0000000 Inexact Rounded
+pwsx092 power 169 0.5 -> 13.0000000 Inexact Rounded
+pwsx093 power 256 0.5 -> 16.0000000 Inexact Rounded
+pwsx094 power 1024 0.5 -> 32.0000000 Inexact Rounded
+pwsx095 power 4096 0.5 -> 64.0000000 Inexact Rounded
+pwsx100 power 0.01 0.5 -> 0.100000000 Inexact Rounded
+pwsx101 power 0.04 0.5 -> 0.200000000 Inexact Rounded
+pwsx102 power 0.09 0.5 -> 0.300000000 Inexact Rounded
+pwsx103 power 0.16 0.5 -> 0.400000000 Inexact Rounded
+pwsx104 power 0.25 0.5 -> 0.500000000 Inexact Rounded
+pwsx105 power 0.36 0.5 -> 0.600000000 Inexact Rounded
+pwsx106 power 0.49 0.5 -> 0.700000000 Inexact Rounded
+pwsx107 power 0.64 0.5 -> 0.800000000 Inexact Rounded
+pwsx108 power 0.81 0.5 -> 0.900000000 Inexact Rounded
+pwsx109 power 1.00 0.5 -> 1.00000000 Inexact Rounded
+pwsx110 power 1.21 0.5 -> 1.10000000 Inexact Rounded
+pwsx111 power 1.44 0.5 -> 1.20000000 Inexact Rounded
+pwsx112 power 1.69 0.5 -> 1.30000000 Inexact Rounded
+pwsx113 power 2.56 0.5 -> 1.60000000 Inexact Rounded
+pwsx114 power 10.24 0.5 -> 3.20000000 Inexact Rounded
+pwsx115 power 40.96 0.5 -> 6.40000000 Inexact Rounded
+
+-- Precision 1 squareroot tests [exhaustive, plus exponent adjusts]
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+precision: 1
+pwsx1201 power 0.1 0.5 -> 0.3 Inexact Rounded
+pwsx1202 power 0.01 0.5 -> 0.1 Inexact Rounded
+pwsx1203 power 1.0E-1 0.5 -> 0.3 Inexact Rounded
+pwsx1204 power 1.00E-2 0.5 -> 0.1 Inexact Rounded
+pwsx1205 power 1E-3 0.5 -> 0.03 Inexact Rounded
+pwsx1206 power 1E+1 0.5 -> 3 Inexact Rounded
+pwsx1207 power 1E+2 0.5 -> 1E+1 Inexact Rounded
+pwsx1208 power 1E+3 0.5 -> 3E+1 Inexact Rounded
+pwsx1209 power 0.2 0.5 -> 0.4 Inexact Rounded
+pwsx1210 power 0.02 0.5 -> 0.1 Inexact Rounded
+pwsx1211 power 2.0E-1 0.5 -> 0.4 Inexact Rounded
+pwsx1212 power 2.00E-2 0.5 -> 0.1 Inexact Rounded
+pwsx1213 power 2E-3 0.5 -> 0.04 Inexact Rounded
+pwsx1214 power 2E+1 0.5 -> 4 Inexact Rounded
+pwsx1215 power 2E+2 0.5 -> 1E+1 Inexact Rounded
+pwsx1216 power 2E+3 0.5 -> 4E+1 Inexact Rounded
+pwsx1217 power 0.3 0.5 -> 0.5 Inexact Rounded
+pwsx1218 power 0.03 0.5 -> 0.2 Inexact Rounded
+pwsx1219 power 3.0E-1 0.5 -> 0.5 Inexact Rounded
+pwsx1220 power 3.00E-2 0.5 -> 0.2 Inexact Rounded
+pwsx1221 power 3E-3 0.5 -> 0.05 Inexact Rounded
+pwsx1222 power 3E+1 0.5 -> 5 Inexact Rounded
+pwsx1223 power 3E+2 0.5 -> 2E+1 Inexact Rounded
+pwsx1224 power 3E+3 0.5 -> 5E+1 Inexact Rounded
+pwsx1225 power 0.4 0.5 -> 0.6 Inexact Rounded
+pwsx1226 power 0.04 0.5 -> 0.2 Inexact Rounded
+pwsx1227 power 4.0E-1 0.5 -> 0.6 Inexact Rounded
+pwsx1228 power 4.00E-2 0.5 -> 0.2 Inexact Rounded
+pwsx1229 power 4E-3 0.5 -> 0.06 Inexact Rounded
+pwsx1230 power 4E+1 0.5 -> 6 Inexact Rounded
+pwsx1231 power 4E+2 0.5 -> 2E+1 Inexact Rounded
+pwsx1232 power 4E+3 0.5 -> 6E+1 Inexact Rounded
+pwsx1233 power 0.5 0.5 -> 0.7 Inexact Rounded
+pwsx1234 power 0.05 0.5 -> 0.2 Inexact Rounded
+pwsx1235 power 5.0E-1 0.5 -> 0.7 Inexact Rounded
+pwsx1236 power 5.00E-2 0.5 -> 0.2 Inexact Rounded
+pwsx1237 power 5E-3 0.5 -> 0.07 Inexact Rounded
+pwsx1238 power 5E+1 0.5 -> 7 Inexact Rounded
+pwsx1239 power 5E+2 0.5 -> 2E+1 Inexact Rounded
+pwsx1240 power 5E+3 0.5 -> 7E+1 Inexact Rounded
+pwsx1241 power 0.6 0.5 -> 0.8 Inexact Rounded
+pwsx1242 power 0.06 0.5 -> 0.2 Inexact Rounded
+pwsx1243 power 6.0E-1 0.5 -> 0.8 Inexact Rounded
+pwsx1244 power 6.00E-2 0.5 -> 0.2 Inexact Rounded
+pwsx1245 power 6E-3 0.5 -> 0.08 Inexact Rounded
+pwsx1246 power 6E+1 0.5 -> 8 Inexact Rounded
+pwsx1247 power 6E+2 0.5 -> 2E+1 Inexact Rounded
+pwsx1248 power 6E+3 0.5 -> 8E+1 Inexact Rounded
+pwsx1249 power 0.7 0.5 -> 0.8 Inexact Rounded
+pwsx1250 power 0.07 0.5 -> 0.3 Inexact Rounded
+pwsx1251 power 7.0E-1 0.5 -> 0.8 Inexact Rounded
+pwsx1252 power 7.00E-2 0.5 -> 0.3 Inexact Rounded
+pwsx1253 power 7E-3 0.5 -> 0.08 Inexact Rounded
+pwsx1254 power 7E+1 0.5 -> 8 Inexact Rounded
+pwsx1255 power 7E+2 0.5 -> 3E+1 Inexact Rounded
+pwsx1256 power 7E+3 0.5 -> 8E+1 Inexact Rounded
+pwsx1257 power 0.8 0.5 -> 0.9 Inexact Rounded
+pwsx1258 power 0.08 0.5 -> 0.3 Inexact Rounded
+pwsx1259 power 8.0E-1 0.5 -> 0.9 Inexact Rounded
+pwsx1260 power 8.00E-2 0.5 -> 0.3 Inexact Rounded
+pwsx1261 power 8E-3 0.5 -> 0.09 Inexact Rounded
+pwsx1262 power 8E+1 0.5 -> 9 Inexact Rounded
+pwsx1263 power 8E+2 0.5 -> 3E+1 Inexact Rounded
+pwsx1264 power 8E+3 0.5 -> 9E+1 Inexact Rounded
+pwsx1265 power 0.9 0.5 -> 0.9 Inexact Rounded
+pwsx1266 power 0.09 0.5 -> 0.3 Inexact Rounded
+pwsx1267 power 9.0E-1 0.5 -> 0.9 Inexact Rounded
+pwsx1268 power 9.00E-2 0.5 -> 0.3 Inexact Rounded
+pwsx1269 power 9E-3 0.5 -> 0.09 Inexact Rounded
+pwsx1270 power 9E+1 0.5 -> 9 Inexact Rounded
+pwsx1271 power 9E+2 0.5 -> 3E+1 Inexact Rounded
+pwsx1272 power 9E+3 0.5 -> 9E+1 Inexact Rounded
+
+-- Precision 2 squareroot tests [exhaustive, plus exponent adjusts]
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+precision: 2
+pwsx2201 power 0.1 0.5 -> 0.32 Inexact Rounded
+pwsx2202 power 0.01 0.5 -> 0.10 Inexact Rounded
+pwsx2203 power 1.0E-1 0.5 -> 0.32 Inexact Rounded
+pwsx2204 power 1.00E-2 0.5 -> 0.10 Inexact Rounded
+pwsx2205 power 1E-3 0.5 -> 0.032 Inexact Rounded
+pwsx2206 power 1E+1 0.5 -> 3.2 Inexact Rounded
+pwsx2207 power 1E+2 0.5 -> 10 Inexact Rounded
+pwsx2208 power 1E+3 0.5 -> 32 Inexact Rounded
+pwsx2209 power 0.2 0.5 -> 0.45 Inexact Rounded
+pwsx2210 power 0.02 0.5 -> 0.14 Inexact Rounded
+pwsx2211 power 2.0E-1 0.5 -> 0.45 Inexact Rounded
+pwsx2212 power 2.00E-2 0.5 -> 0.14 Inexact Rounded
+pwsx2213 power 2E-3 0.5 -> 0.045 Inexact Rounded
+pwsx2214 power 2E+1 0.5 -> 4.5 Inexact Rounded
+pwsx2215 power 2E+2 0.5 -> 14 Inexact Rounded
+pwsx2216 power 2E+3 0.5 -> 45 Inexact Rounded
+pwsx2217 power 0.3 0.5 -> 0.55 Inexact Rounded
+pwsx2218 power 0.03 0.5 -> 0.17 Inexact Rounded
+pwsx2219 power 3.0E-1 0.5 -> 0.55 Inexact Rounded
+pwsx2220 power 3.00E-2 0.5 -> 0.17 Inexact Rounded
+pwsx2221 power 3E-3 0.5 -> 0.055 Inexact Rounded
+pwsx2222 power 3E+1 0.5 -> 5.5 Inexact Rounded
+pwsx2223 power 3E+2 0.5 -> 17 Inexact Rounded
+pwsx2224 power 3E+3 0.5 -> 55 Inexact Rounded
+pwsx2225 power 0.4 0.5 -> 0.63 Inexact Rounded
+pwsx2226 power 0.04 0.5 -> 0.20 Inexact Rounded
+pwsx2227 power 4.0E-1 0.5 -> 0.63 Inexact Rounded
+pwsx2228 power 4.00E-2 0.5 -> 0.20 Inexact Rounded
+pwsx2229 power 4E-3 0.5 -> 0.063 Inexact Rounded
+pwsx2230 power 4E+1 0.5 -> 6.3 Inexact Rounded
+pwsx2231 power 4E+2 0.5 -> 20 Inexact Rounded
+pwsx2232 power 4E+3 0.5 -> 63 Inexact Rounded
+pwsx2233 power 0.5 0.5 -> 0.71 Inexact Rounded
+pwsx2234 power 0.05 0.5 -> 0.22 Inexact Rounded
+pwsx2235 power 5.0E-1 0.5 -> 0.71 Inexact Rounded
+pwsx2236 power 5.00E-2 0.5 -> 0.22 Inexact Rounded
+pwsx2237 power 5E-3 0.5 -> 0.071 Inexact Rounded
+pwsx2238 power 5E+1 0.5 -> 7.1 Inexact Rounded
+pwsx2239 power 5E+2 0.5 -> 22 Inexact Rounded
+pwsx2240 power 5E+3 0.5 -> 71 Inexact Rounded
+pwsx2241 power 0.6 0.5 -> 0.77 Inexact Rounded
+pwsx2242 power 0.06 0.5 -> 0.24 Inexact Rounded
+pwsx2243 power 6.0E-1 0.5 -> 0.77 Inexact Rounded
+pwsx2244 power 6.00E-2 0.5 -> 0.24 Inexact Rounded
+pwsx2245 power 6E-3 0.5 -> 0.077 Inexact Rounded
+pwsx2246 power 6E+1 0.5 -> 7.7 Inexact Rounded
+pwsx2247 power 6E+2 0.5 -> 24 Inexact Rounded
+pwsx2248 power 6E+3 0.5 -> 77 Inexact Rounded
+pwsx2249 power 0.7 0.5 -> 0.84 Inexact Rounded
+pwsx2250 power 0.07 0.5 -> 0.26 Inexact Rounded
+pwsx2251 power 7.0E-1 0.5 -> 0.84 Inexact Rounded
+pwsx2252 power 7.00E-2 0.5 -> 0.26 Inexact Rounded
+pwsx2253 power 7E-3 0.5 -> 0.084 Inexact Rounded
+pwsx2254 power 7E+1 0.5 -> 8.4 Inexact Rounded
+pwsx2255 power 7E+2 0.5 -> 26 Inexact Rounded
+pwsx2256 power 7E+3 0.5 -> 84 Inexact Rounded
+pwsx2257 power 0.8 0.5 -> 0.89 Inexact Rounded
+pwsx2258 power 0.08 0.5 -> 0.28 Inexact Rounded
+pwsx2259 power 8.0E-1 0.5 -> 0.89 Inexact Rounded
+pwsx2260 power 8.00E-2 0.5 -> 0.28 Inexact Rounded
+pwsx2261 power 8E-3 0.5 -> 0.089 Inexact Rounded
+pwsx2262 power 8E+1 0.5 -> 8.9 Inexact Rounded
+pwsx2263 power 8E+2 0.5 -> 28 Inexact Rounded
+pwsx2264 power 8E+3 0.5 -> 89 Inexact Rounded
+pwsx2265 power 0.9 0.5 -> 0.95 Inexact Rounded
+pwsx2266 power 0.09 0.5 -> 0.30 Inexact Rounded
+pwsx2267 power 9.0E-1 0.5 -> 0.95 Inexact Rounded
+pwsx2268 power 9.00E-2 0.5 -> 0.30 Inexact Rounded
+pwsx2269 power 9E-3 0.5 -> 0.095 Inexact Rounded
+pwsx2270 power 9E+1 0.5 -> 9.5 Inexact Rounded
+pwsx2271 power 9E+2 0.5 -> 30 Inexact Rounded
+pwsx2272 power 9E+3 0.5 -> 95 Inexact Rounded
+pwsx2273 power 0.10 0.5 -> 0.32 Inexact Rounded
+pwsx2274 power 0.010 0.5 -> 0.10 Inexact Rounded
+pwsx2275 power 10.0E-1 0.5 -> 1.0 Inexact Rounded
+pwsx2276 power 10.00E-2 0.5 -> 0.32 Inexact Rounded
+pwsx2277 power 10E-3 0.5 -> 0.10 Inexact Rounded
+pwsx2278 power 10E+1 0.5 -> 10 Inexact Rounded
+pwsx2279 power 10E+2 0.5 -> 32 Inexact Rounded
+pwsx2280 power 10E+3 0.5 -> 1.0E+2 Inexact Rounded
+pwsx2281 power 0.11 0.5 -> 0.33 Inexact Rounded
+pwsx2282 power 0.011 0.5 -> 0.10 Inexact Rounded
+pwsx2283 power 11.0E-1 0.5 -> 1.0 Inexact Rounded
+pwsx2284 power 11.00E-2 0.5 -> 0.33 Inexact Rounded
+pwsx2285 power 11E-3 0.5 -> 0.10 Inexact Rounded
+pwsx2286 power 11E+1 0.5 -> 10 Inexact Rounded
+pwsx2287 power 11E+2 0.5 -> 33 Inexact Rounded
+pwsx2288 power 11E+3 0.5 -> 1.0E+2 Inexact Rounded
+pwsx2289 power 0.12 0.5 -> 0.35 Inexact Rounded
+pwsx2290 power 0.012 0.5 -> 0.11 Inexact Rounded
+pwsx2291 power 12.0E-1 0.5 -> 1.1 Inexact Rounded
+pwsx2292 power 12.00E-2 0.5 -> 0.35 Inexact Rounded
+pwsx2293 power 12E-3 0.5 -> 0.11 Inexact Rounded
+pwsx2294 power 12E+1 0.5 -> 11 Inexact Rounded
+pwsx2295 power 12E+2 0.5 -> 35 Inexact Rounded
+pwsx2296 power 12E+3 0.5 -> 1.1E+2 Inexact Rounded
+pwsx2297 power 0.13 0.5 -> 0.36 Inexact Rounded
+pwsx2298 power 0.013 0.5 -> 0.11 Inexact Rounded
+pwsx2299 power 13.0E-1 0.5 -> 1.1 Inexact Rounded
+pwsx2300 power 13.00E-2 0.5 -> 0.36 Inexact Rounded
+pwsx2301 power 13E-3 0.5 -> 0.11 Inexact Rounded
+pwsx2302 power 13E+1 0.5 -> 11 Inexact Rounded
+pwsx2303 power 13E+2 0.5 -> 36 Inexact Rounded
+pwsx2304 power 13E+3 0.5 -> 1.1E+2 Inexact Rounded
+pwsx2305 power 0.14 0.5 -> 0.37 Inexact Rounded
+pwsx2306 power 0.014 0.5 -> 0.12 Inexact Rounded
+pwsx2307 power 14.0E-1 0.5 -> 1.2 Inexact Rounded
+pwsx2308 power 14.00E-2 0.5 -> 0.37 Inexact Rounded
+pwsx2309 power 14E-3 0.5 -> 0.12 Inexact Rounded
+pwsx2310 power 14E+1 0.5 -> 12 Inexact Rounded
+pwsx2311 power 14E+2 0.5 -> 37 Inexact Rounded
+pwsx2312 power 14E+3 0.5 -> 1.2E+2 Inexact Rounded
+pwsx2313 power 0.15 0.5 -> 0.39 Inexact Rounded
+pwsx2314 power 0.015 0.5 -> 0.12 Inexact Rounded
+pwsx2315 power 15.0E-1 0.5 -> 1.2 Inexact Rounded
+pwsx2316 power 15.00E-2 0.5 -> 0.39 Inexact Rounded
+pwsx2317 power 15E-3 0.5 -> 0.12 Inexact Rounded
+pwsx2318 power 15E+1 0.5 -> 12 Inexact Rounded
+pwsx2319 power 15E+2 0.5 -> 39 Inexact Rounded
+pwsx2320 power 15E+3 0.5 -> 1.2E+2 Inexact Rounded
+pwsx2321 power 0.16 0.5 -> 0.40 Inexact Rounded
+pwsx2322 power 0.016 0.5 -> 0.13 Inexact Rounded
+pwsx2323 power 16.0E-1 0.5 -> 1.3 Inexact Rounded
+pwsx2324 power 16.00E-2 0.5 -> 0.40 Inexact Rounded
+pwsx2325 power 16E-3 0.5 -> 0.13 Inexact Rounded
+pwsx2326 power 16E+1 0.5 -> 13 Inexact Rounded
+pwsx2327 power 16E+2 0.5 -> 40 Inexact Rounded
+pwsx2328 power 16E+3 0.5 -> 1.3E+2 Inexact Rounded
+pwsx2329 power 0.17 0.5 -> 0.41 Inexact Rounded
+pwsx2330 power 0.017 0.5 -> 0.13 Inexact Rounded
+pwsx2331 power 17.0E-1 0.5 -> 1.3 Inexact Rounded
+pwsx2332 power 17.00E-2 0.5 -> 0.41 Inexact Rounded
+pwsx2333 power 17E-3 0.5 -> 0.13 Inexact Rounded
+pwsx2334 power 17E+1 0.5 -> 13 Inexact Rounded
+pwsx2335 power 17E+2 0.5 -> 41 Inexact Rounded
+pwsx2336 power 17E+3 0.5 -> 1.3E+2 Inexact Rounded
+pwsx2337 power 0.18 0.5 -> 0.42 Inexact Rounded
+pwsx2338 power 0.018 0.5 -> 0.13 Inexact Rounded
+pwsx2339 power 18.0E-1 0.5 -> 1.3 Inexact Rounded
+pwsx2340 power 18.00E-2 0.5 -> 0.42 Inexact Rounded
+pwsx2341 power 18E-3 0.5 -> 0.13 Inexact Rounded
+pwsx2342 power 18E+1 0.5 -> 13 Inexact Rounded
+pwsx2343 power 18E+2 0.5 -> 42 Inexact Rounded
+pwsx2344 power 18E+3 0.5 -> 1.3E+2 Inexact Rounded
+pwsx2345 power 0.19 0.5 -> 0.44 Inexact Rounded
+pwsx2346 power 0.019 0.5 -> 0.14 Inexact Rounded
+pwsx2347 power 19.0E-1 0.5 -> 1.4 Inexact Rounded
+pwsx2348 power 19.00E-2 0.5 -> 0.44 Inexact Rounded
+pwsx2349 power 19E-3 0.5 -> 0.14 Inexact Rounded
+pwsx2350 power 19E+1 0.5 -> 14 Inexact Rounded
+pwsx2351 power 19E+2 0.5 -> 44 Inexact Rounded
+pwsx2352 power 19E+3 0.5 -> 1.4E+2 Inexact Rounded
+pwsx2353 power 0.20 0.5 -> 0.45 Inexact Rounded
+pwsx2354 power 0.020 0.5 -> 0.14 Inexact Rounded
+pwsx2355 power 20.0E-1 0.5 -> 1.4 Inexact Rounded
+pwsx2356 power 20.00E-2 0.5 -> 0.45 Inexact Rounded
+pwsx2357 power 20E-3 0.5 -> 0.14 Inexact Rounded
+pwsx2358 power 20E+1 0.5 -> 14 Inexact Rounded
+pwsx2359 power 20E+2 0.5 -> 45 Inexact Rounded
+pwsx2360 power 20E+3 0.5 -> 1.4E+2 Inexact Rounded
+pwsx2361 power 0.21 0.5 -> 0.46 Inexact Rounded
+pwsx2362 power 0.021 0.5 -> 0.14 Inexact Rounded
+pwsx2363 power 21.0E-1 0.5 -> 1.4 Inexact Rounded
+pwsx2364 power 21.00E-2 0.5 -> 0.46 Inexact Rounded
+pwsx2365 power 21E-3 0.5 -> 0.14 Inexact Rounded
+pwsx2366 power 21E+1 0.5 -> 14 Inexact Rounded
+pwsx2367 power 21E+2 0.5 -> 46 Inexact Rounded
+pwsx2368 power 21E+3 0.5 -> 1.4E+2 Inexact Rounded
+pwsx2369 power 0.22 0.5 -> 0.47 Inexact Rounded
+pwsx2370 power 0.022 0.5 -> 0.15 Inexact Rounded
+pwsx2371 power 22.0E-1 0.5 -> 1.5 Inexact Rounded
+pwsx2372 power 22.00E-2 0.5 -> 0.47 Inexact Rounded
+pwsx2373 power 22E-3 0.5 -> 0.15 Inexact Rounded
+pwsx2374 power 22E+1 0.5 -> 15 Inexact Rounded
+pwsx2375 power 22E+2 0.5 -> 47 Inexact Rounded
+pwsx2376 power 22E+3 0.5 -> 1.5E+2 Inexact Rounded
+pwsx2377 power 0.23 0.5 -> 0.48 Inexact Rounded
+pwsx2378 power 0.023 0.5 -> 0.15 Inexact Rounded
+pwsx2379 power 23.0E-1 0.5 -> 1.5 Inexact Rounded
+pwsx2380 power 23.00E-2 0.5 -> 0.48 Inexact Rounded
+pwsx2381 power 23E-3 0.5 -> 0.15 Inexact Rounded
+pwsx2382 power 23E+1 0.5 -> 15 Inexact Rounded
+pwsx2383 power 23E+2 0.5 -> 48 Inexact Rounded
+pwsx2384 power 23E+3 0.5 -> 1.5E+2 Inexact Rounded
+pwsx2385 power 0.24 0.5 -> 0.49 Inexact Rounded
+pwsx2386 power 0.024 0.5 -> 0.15 Inexact Rounded
+pwsx2387 power 24.0E-1 0.5 -> 1.5 Inexact Rounded
+pwsx2388 power 24.00E-2 0.5 -> 0.49 Inexact Rounded
+pwsx2389 power 24E-3 0.5 -> 0.15 Inexact Rounded
+pwsx2390 power 24E+1 0.5 -> 15 Inexact Rounded
+pwsx2391 power 24E+2 0.5 -> 49 Inexact Rounded
+pwsx2392 power 24E+3 0.5 -> 1.5E+2 Inexact Rounded
+pwsx2393 power 0.25 0.5 -> 0.50 Inexact Rounded
+pwsx2394 power 0.025 0.5 -> 0.16 Inexact Rounded
+pwsx2395 power 25.0E-1 0.5 -> 1.6 Inexact Rounded
+pwsx2396 power 25.00E-2 0.5 -> 0.50 Inexact Rounded
+pwsx2397 power 25E-3 0.5 -> 0.16 Inexact Rounded
+pwsx2398 power 25E+1 0.5 -> 16 Inexact Rounded
+pwsx2399 power 25E+2 0.5 -> 50 Inexact Rounded
+pwsx2400 power 25E+3 0.5 -> 1.6E+2 Inexact Rounded
+pwsx2401 power 0.26 0.5 -> 0.51 Inexact Rounded
+pwsx2402 power 0.026 0.5 -> 0.16 Inexact Rounded
+pwsx2403 power 26.0E-1 0.5 -> 1.6 Inexact Rounded
+pwsx2404 power 26.00E-2 0.5 -> 0.51 Inexact Rounded
+pwsx2405 power 26E-3 0.5 -> 0.16 Inexact Rounded
+pwsx2406 power 26E+1 0.5 -> 16 Inexact Rounded
+pwsx2407 power 26E+2 0.5 -> 51 Inexact Rounded
+pwsx2408 power 26E+3 0.5 -> 1.6E+2 Inexact Rounded
+pwsx2409 power 0.27 0.5 -> 0.52 Inexact Rounded
+pwsx2410 power 0.027 0.5 -> 0.16 Inexact Rounded
+pwsx2411 power 27.0E-1 0.5 -> 1.6 Inexact Rounded
+pwsx2412 power 27.00E-2 0.5 -> 0.52 Inexact Rounded
+pwsx2413 power 27E-3 0.5 -> 0.16 Inexact Rounded
+pwsx2414 power 27E+1 0.5 -> 16 Inexact Rounded
+pwsx2415 power 27E+2 0.5 -> 52 Inexact Rounded
+pwsx2416 power 27E+3 0.5 -> 1.6E+2 Inexact Rounded
+pwsx2417 power 0.28 0.5 -> 0.53 Inexact Rounded
+pwsx2418 power 0.028 0.5 -> 0.17 Inexact Rounded
+pwsx2419 power 28.0E-1 0.5 -> 1.7 Inexact Rounded
+pwsx2420 power 28.00E-2 0.5 -> 0.53 Inexact Rounded
+pwsx2421 power 28E-3 0.5 -> 0.17 Inexact Rounded
+pwsx2422 power 28E+1 0.5 -> 17 Inexact Rounded
+pwsx2423 power 28E+2 0.5 -> 53 Inexact Rounded
+pwsx2424 power 28E+3 0.5 -> 1.7E+2 Inexact Rounded
+pwsx2425 power 0.29 0.5 -> 0.54 Inexact Rounded
+pwsx2426 power 0.029 0.5 -> 0.17 Inexact Rounded
+pwsx2427 power 29.0E-1 0.5 -> 1.7 Inexact Rounded
+pwsx2428 power 29.00E-2 0.5 -> 0.54 Inexact Rounded
+pwsx2429 power 29E-3 0.5 -> 0.17 Inexact Rounded
+pwsx2430 power 29E+1 0.5 -> 17 Inexact Rounded
+pwsx2431 power 29E+2 0.5 -> 54 Inexact Rounded
+pwsx2432 power 29E+3 0.5 -> 1.7E+2 Inexact Rounded
+pwsx2433 power 0.30 0.5 -> 0.55 Inexact Rounded
+pwsx2434 power 0.030 0.5 -> 0.17 Inexact Rounded
+pwsx2435 power 30.0E-1 0.5 -> 1.7 Inexact Rounded
+pwsx2436 power 30.00E-2 0.5 -> 0.55 Inexact Rounded
+pwsx2437 power 30E-3 0.5 -> 0.17 Inexact Rounded
+pwsx2438 power 30E+1 0.5 -> 17 Inexact Rounded
+pwsx2439 power 30E+2 0.5 -> 55 Inexact Rounded
+pwsx2440 power 30E+3 0.5 -> 1.7E+2 Inexact Rounded
+pwsx2441 power 0.31 0.5 -> 0.56 Inexact Rounded
+pwsx2442 power 0.031 0.5 -> 0.18 Inexact Rounded
+pwsx2443 power 31.0E-1 0.5 -> 1.8 Inexact Rounded
+pwsx2444 power 31.00E-2 0.5 -> 0.56 Inexact Rounded
+pwsx2445 power 31E-3 0.5 -> 0.18 Inexact Rounded
+pwsx2446 power 31E+1 0.5 -> 18 Inexact Rounded
+pwsx2447 power 31E+2 0.5 -> 56 Inexact Rounded
+pwsx2448 power 31E+3 0.5 -> 1.8E+2 Inexact Rounded
+pwsx2449 power 0.32 0.5 -> 0.57 Inexact Rounded
+pwsx2450 power 0.032 0.5 -> 0.18 Inexact Rounded
+pwsx2451 power 32.0E-1 0.5 -> 1.8 Inexact Rounded
+pwsx2452 power 32.00E-2 0.5 -> 0.57 Inexact Rounded
+pwsx2453 power 32E-3 0.5 -> 0.18 Inexact Rounded
+pwsx2454 power 32E+1 0.5 -> 18 Inexact Rounded
+pwsx2455 power 32E+2 0.5 -> 57 Inexact Rounded
+pwsx2456 power 32E+3 0.5 -> 1.8E+2 Inexact Rounded
+pwsx2457 power 0.33 0.5 -> 0.57 Inexact Rounded
+pwsx2458 power 0.033 0.5 -> 0.18 Inexact Rounded
+pwsx2459 power 33.0E-1 0.5 -> 1.8 Inexact Rounded
+pwsx2460 power 33.00E-2 0.5 -> 0.57 Inexact Rounded
+pwsx2461 power 33E-3 0.5 -> 0.18 Inexact Rounded
+pwsx2462 power 33E+1 0.5 -> 18 Inexact Rounded
+pwsx2463 power 33E+2 0.5 -> 57 Inexact Rounded
+pwsx2464 power 33E+3 0.5 -> 1.8E+2 Inexact Rounded
+pwsx2465 power 0.34 0.5 -> 0.58 Inexact Rounded
+pwsx2466 power 0.034 0.5 -> 0.18 Inexact Rounded
+pwsx2467 power 34.0E-1 0.5 -> 1.8 Inexact Rounded
+pwsx2468 power 34.00E-2 0.5 -> 0.58 Inexact Rounded
+pwsx2469 power 34E-3 0.5 -> 0.18 Inexact Rounded
+pwsx2470 power 34E+1 0.5 -> 18 Inexact Rounded
+pwsx2471 power 34E+2 0.5 -> 58 Inexact Rounded
+pwsx2472 power 34E+3 0.5 -> 1.8E+2 Inexact Rounded
+pwsx2473 power 0.35 0.5 -> 0.59 Inexact Rounded
+pwsx2474 power 0.035 0.5 -> 0.19 Inexact Rounded
+pwsx2475 power 35.0E-1 0.5 -> 1.9 Inexact Rounded
+pwsx2476 power 35.00E-2 0.5 -> 0.59 Inexact Rounded
+pwsx2477 power 35E-3 0.5 -> 0.19 Inexact Rounded
+pwsx2478 power 35E+1 0.5 -> 19 Inexact Rounded
+pwsx2479 power 35E+2 0.5 -> 59 Inexact Rounded
+pwsx2480 power 35E+3 0.5 -> 1.9E+2 Inexact Rounded
+pwsx2481 power 0.36 0.5 -> 0.60 Inexact Rounded
+pwsx2482 power 0.036 0.5 -> 0.19 Inexact Rounded
+pwsx2483 power 36.0E-1 0.5 -> 1.9 Inexact Rounded
+pwsx2484 power 36.00E-2 0.5 -> 0.60 Inexact Rounded
+pwsx2485 power 36E-3 0.5 -> 0.19 Inexact Rounded
+pwsx2486 power 36E+1 0.5 -> 19 Inexact Rounded
+pwsx2487 power 36E+2 0.5 -> 60 Inexact Rounded
+pwsx2488 power 36E+3 0.5 -> 1.9E+2 Inexact Rounded
+pwsx2489 power 0.37 0.5 -> 0.61 Inexact Rounded
+pwsx2490 power 0.037 0.5 -> 0.19 Inexact Rounded
+pwsx2491 power 37.0E-1 0.5 -> 1.9 Inexact Rounded
+pwsx2492 power 37.00E-2 0.5 -> 0.61 Inexact Rounded
+pwsx2493 power 37E-3 0.5 -> 0.19 Inexact Rounded
+pwsx2494 power 37E+1 0.5 -> 19 Inexact Rounded
+pwsx2495 power 37E+2 0.5 -> 61 Inexact Rounded
+pwsx2496 power 37E+3 0.5 -> 1.9E+2 Inexact Rounded
+pwsx2497 power 0.38 0.5 -> 0.62 Inexact Rounded
+pwsx2498 power 0.038 0.5 -> 0.19 Inexact Rounded
+pwsx2499 power 38.0E-1 0.5 -> 1.9 Inexact Rounded
+pwsx2500 power 38.00E-2 0.5 -> 0.62 Inexact Rounded
+pwsx2501 power 38E-3 0.5 -> 0.19 Inexact Rounded
+pwsx2502 power 38E+1 0.5 -> 19 Inexact Rounded
+pwsx2503 power 38E+2 0.5 -> 62 Inexact Rounded
+pwsx2504 power 38E+3 0.5 -> 1.9E+2 Inexact Rounded
+pwsx2505 power 0.39 0.5 -> 0.62 Inexact Rounded
+pwsx2506 power 0.039 0.5 -> 0.20 Inexact Rounded
+pwsx2507 power 39.0E-1 0.5 -> 2.0 Inexact Rounded
+pwsx2508 power 39.00E-2 0.5 -> 0.62 Inexact Rounded
+pwsx2509 power 39E-3 0.5 -> 0.20 Inexact Rounded
+pwsx2510 power 39E+1 0.5 -> 20 Inexact Rounded
+pwsx2511 power 39E+2 0.5 -> 62 Inexact Rounded
+pwsx2512 power 39E+3 0.5 -> 2.0E+2 Inexact Rounded
+pwsx2513 power 0.40 0.5 -> 0.63 Inexact Rounded
+pwsx2514 power 0.040 0.5 -> 0.20 Inexact Rounded
+pwsx2515 power 40.0E-1 0.5 -> 2.0 Inexact Rounded
+pwsx2516 power 40.00E-2 0.5 -> 0.63 Inexact Rounded
+pwsx2517 power 40E-3 0.5 -> 0.20 Inexact Rounded
+pwsx2518 power 40E+1 0.5 -> 20 Inexact Rounded
+pwsx2519 power 40E+2 0.5 -> 63 Inexact Rounded
+pwsx2520 power 40E+3 0.5 -> 2.0E+2 Inexact Rounded
+pwsx2521 power 0.41 0.5 -> 0.64 Inexact Rounded
+pwsx2522 power 0.041 0.5 -> 0.20 Inexact Rounded
+pwsx2523 power 41.0E-1 0.5 -> 2.0 Inexact Rounded
+pwsx2524 power 41.00E-2 0.5 -> 0.64 Inexact Rounded
+pwsx2525 power 41E-3 0.5 -> 0.20 Inexact Rounded
+pwsx2526 power 41E+1 0.5 -> 20 Inexact Rounded
+pwsx2527 power 41E+2 0.5 -> 64 Inexact Rounded
+pwsx2528 power 41E+3 0.5 -> 2.0E+2 Inexact Rounded
+pwsx2529 power 0.42 0.5 -> 0.65 Inexact Rounded
+pwsx2530 power 0.042 0.5 -> 0.20 Inexact Rounded
+pwsx2531 power 42.0E-1 0.5 -> 2.0 Inexact Rounded
+pwsx2532 power 42.00E-2 0.5 -> 0.65 Inexact Rounded
+pwsx2533 power 42E-3 0.5 -> 0.20 Inexact Rounded
+pwsx2534 power 42E+1 0.5 -> 20 Inexact Rounded
+pwsx2535 power 42E+2 0.5 -> 65 Inexact Rounded
+pwsx2536 power 42E+3 0.5 -> 2.0E+2 Inexact Rounded
+pwsx2537 power 0.43 0.5 -> 0.66 Inexact Rounded
+pwsx2538 power 0.043 0.5 -> 0.21 Inexact Rounded
+pwsx2539 power 43.0E-1 0.5 -> 2.1 Inexact Rounded
+pwsx2540 power 43.00E-2 0.5 -> 0.66 Inexact Rounded
+pwsx2541 power 43E-3 0.5 -> 0.21 Inexact Rounded
+pwsx2542 power 43E+1 0.5 -> 21 Inexact Rounded
+pwsx2543 power 43E+2 0.5 -> 66 Inexact Rounded
+pwsx2544 power 43E+3 0.5 -> 2.1E+2 Inexact Rounded
+pwsx2545 power 0.44 0.5 -> 0.66 Inexact Rounded
+pwsx2546 power 0.044 0.5 -> 0.21 Inexact Rounded
+pwsx2547 power 44.0E-1 0.5 -> 2.1 Inexact Rounded
+pwsx2548 power 44.00E-2 0.5 -> 0.66 Inexact Rounded
+pwsx2549 power 44E-3 0.5 -> 0.21 Inexact Rounded
+pwsx2550 power 44E+1 0.5 -> 21 Inexact Rounded
+pwsx2551 power 44E+2 0.5 -> 66 Inexact Rounded
+pwsx2552 power 44E+3 0.5 -> 2.1E+2 Inexact Rounded
+pwsx2553 power 0.45 0.5 -> 0.67 Inexact Rounded
+pwsx2554 power 0.045 0.5 -> 0.21 Inexact Rounded
+pwsx2555 power 45.0E-1 0.5 -> 2.1 Inexact Rounded
+pwsx2556 power 45.00E-2 0.5 -> 0.67 Inexact Rounded
+pwsx2557 power 45E-3 0.5 -> 0.21 Inexact Rounded
+pwsx2558 power 45E+1 0.5 -> 21 Inexact Rounded
+pwsx2559 power 45E+2 0.5 -> 67 Inexact Rounded
+pwsx2560 power 45E+3 0.5 -> 2.1E+2 Inexact Rounded
+pwsx2561 power 0.46 0.5 -> 0.68 Inexact Rounded
+pwsx2562 power 0.046 0.5 -> 0.21 Inexact Rounded
+pwsx2563 power 46.0E-1 0.5 -> 2.1 Inexact Rounded
+pwsx2564 power 46.00E-2 0.5 -> 0.68 Inexact Rounded
+pwsx2565 power 46E-3 0.5 -> 0.21 Inexact Rounded
+pwsx2566 power 46E+1 0.5 -> 21 Inexact Rounded
+pwsx2567 power 46E+2 0.5 -> 68 Inexact Rounded
+pwsx2568 power 46E+3 0.5 -> 2.1E+2 Inexact Rounded
+pwsx2569 power 0.47 0.5 -> 0.69 Inexact Rounded
+pwsx2570 power 0.047 0.5 -> 0.22 Inexact Rounded
+pwsx2571 power 47.0E-1 0.5 -> 2.2 Inexact Rounded
+pwsx2572 power 47.00E-2 0.5 -> 0.69 Inexact Rounded
+pwsx2573 power 47E-3 0.5 -> 0.22 Inexact Rounded
+pwsx2574 power 47E+1 0.5 -> 22 Inexact Rounded
+pwsx2575 power 47E+2 0.5 -> 69 Inexact Rounded
+pwsx2576 power 47E+3 0.5 -> 2.2E+2 Inexact Rounded
+pwsx2577 power 0.48 0.5 -> 0.69 Inexact Rounded
+pwsx2578 power 0.048 0.5 -> 0.22 Inexact Rounded
+pwsx2579 power 48.0E-1 0.5 -> 2.2 Inexact Rounded
+pwsx2580 power 48.00E-2 0.5 -> 0.69 Inexact Rounded
+pwsx2581 power 48E-3 0.5 -> 0.22 Inexact Rounded
+pwsx2582 power 48E+1 0.5 -> 22 Inexact Rounded
+pwsx2583 power 48E+2 0.5 -> 69 Inexact Rounded
+pwsx2584 power 48E+3 0.5 -> 2.2E+2 Inexact Rounded
+pwsx2585 power 0.49 0.5 -> 0.70 Inexact Rounded
+pwsx2586 power 0.049 0.5 -> 0.22 Inexact Rounded
+pwsx2587 power 49.0E-1 0.5 -> 2.2 Inexact Rounded
+pwsx2588 power 49.00E-2 0.5 -> 0.70 Inexact Rounded
+pwsx2589 power 49E-3 0.5 -> 0.22 Inexact Rounded
+pwsx2590 power 49E+1 0.5 -> 22 Inexact Rounded
+pwsx2591 power 49E+2 0.5 -> 70 Inexact Rounded
+pwsx2592 power 49E+3 0.5 -> 2.2E+2 Inexact Rounded
+pwsx2593 power 0.50 0.5 -> 0.71 Inexact Rounded
+pwsx2594 power 0.050 0.5 -> 0.22 Inexact Rounded
+pwsx2595 power 50.0E-1 0.5 -> 2.2 Inexact Rounded
+pwsx2596 power 50.00E-2 0.5 -> 0.71 Inexact Rounded
+pwsx2597 power 50E-3 0.5 -> 0.22 Inexact Rounded
+pwsx2598 power 50E+1 0.5 -> 22 Inexact Rounded
+pwsx2599 power 50E+2 0.5 -> 71 Inexact Rounded
+pwsx2600 power 50E+3 0.5 -> 2.2E+2 Inexact Rounded
+pwsx2601 power 0.51 0.5 -> 0.71 Inexact Rounded
+pwsx2602 power 0.051 0.5 -> 0.23 Inexact Rounded
+pwsx2603 power 51.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2604 power 51.00E-2 0.5 -> 0.71 Inexact Rounded
+pwsx2605 power 51E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2606 power 51E+1 0.5 -> 23 Inexact Rounded
+pwsx2607 power 51E+2 0.5 -> 71 Inexact Rounded
+pwsx2608 power 51E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2609 power 0.52 0.5 -> 0.72 Inexact Rounded
+pwsx2610 power 0.052 0.5 -> 0.23 Inexact Rounded
+pwsx2611 power 52.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2612 power 52.00E-2 0.5 -> 0.72 Inexact Rounded
+pwsx2613 power 52E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2614 power 52E+1 0.5 -> 23 Inexact Rounded
+pwsx2615 power 52E+2 0.5 -> 72 Inexact Rounded
+pwsx2616 power 52E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2617 power 0.53 0.5 -> 0.73 Inexact Rounded
+pwsx2618 power 0.053 0.5 -> 0.23 Inexact Rounded
+pwsx2619 power 53.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2620 power 53.00E-2 0.5 -> 0.73 Inexact Rounded
+pwsx2621 power 53E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2622 power 53E+1 0.5 -> 23 Inexact Rounded
+pwsx2623 power 53E+2 0.5 -> 73 Inexact Rounded
+pwsx2624 power 53E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2625 power 0.54 0.5 -> 0.73 Inexact Rounded
+pwsx2626 power 0.054 0.5 -> 0.23 Inexact Rounded
+pwsx2627 power 54.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2628 power 54.00E-2 0.5 -> 0.73 Inexact Rounded
+pwsx2629 power 54E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2630 power 54E+1 0.5 -> 23 Inexact Rounded
+pwsx2631 power 54E+2 0.5 -> 73 Inexact Rounded
+pwsx2632 power 54E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2633 power 0.55 0.5 -> 0.74 Inexact Rounded
+pwsx2634 power 0.055 0.5 -> 0.23 Inexact Rounded
+pwsx2635 power 55.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2636 power 55.00E-2 0.5 -> 0.74 Inexact Rounded
+pwsx2637 power 55E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2638 power 55E+1 0.5 -> 23 Inexact Rounded
+pwsx2639 power 55E+2 0.5 -> 74 Inexact Rounded
+pwsx2640 power 55E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2641 power 0.56 0.5 -> 0.75 Inexact Rounded
+pwsx2642 power 0.056 0.5 -> 0.24 Inexact Rounded
+pwsx2643 power 56.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2644 power 56.00E-2 0.5 -> 0.75 Inexact Rounded
+pwsx2645 power 56E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2646 power 56E+1 0.5 -> 24 Inexact Rounded
+pwsx2647 power 56E+2 0.5 -> 75 Inexact Rounded
+pwsx2648 power 56E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2649 power 0.57 0.5 -> 0.75 Inexact Rounded
+pwsx2650 power 0.057 0.5 -> 0.24 Inexact Rounded
+pwsx2651 power 57.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2652 power 57.00E-2 0.5 -> 0.75 Inexact Rounded
+pwsx2653 power 57E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2654 power 57E+1 0.5 -> 24 Inexact Rounded
+pwsx2655 power 57E+2 0.5 -> 75 Inexact Rounded
+pwsx2656 power 57E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2657 power 0.58 0.5 -> 0.76 Inexact Rounded
+pwsx2658 power 0.058 0.5 -> 0.24 Inexact Rounded
+pwsx2659 power 58.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2660 power 58.00E-2 0.5 -> 0.76 Inexact Rounded
+pwsx2661 power 58E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2662 power 58E+1 0.5 -> 24 Inexact Rounded
+pwsx2663 power 58E+2 0.5 -> 76 Inexact Rounded
+pwsx2664 power 58E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2665 power 0.59 0.5 -> 0.77 Inexact Rounded
+pwsx2666 power 0.059 0.5 -> 0.24 Inexact Rounded
+pwsx2667 power 59.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2668 power 59.00E-2 0.5 -> 0.77 Inexact Rounded
+pwsx2669 power 59E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2670 power 59E+1 0.5 -> 24 Inexact Rounded
+pwsx2671 power 59E+2 0.5 -> 77 Inexact Rounded
+pwsx2672 power 59E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2673 power 0.60 0.5 -> 0.77 Inexact Rounded
+pwsx2674 power 0.060 0.5 -> 0.24 Inexact Rounded
+pwsx2675 power 60.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2676 power 60.00E-2 0.5 -> 0.77 Inexact Rounded
+pwsx2677 power 60E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2678 power 60E+1 0.5 -> 24 Inexact Rounded
+pwsx2679 power 60E+2 0.5 -> 77 Inexact Rounded
+pwsx2680 power 60E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2681 power 0.61 0.5 -> 0.78 Inexact Rounded
+pwsx2682 power 0.061 0.5 -> 0.25 Inexact Rounded
+pwsx2683 power 61.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2684 power 61.00E-2 0.5 -> 0.78 Inexact Rounded
+pwsx2685 power 61E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2686 power 61E+1 0.5 -> 25 Inexact Rounded
+pwsx2687 power 61E+2 0.5 -> 78 Inexact Rounded
+pwsx2688 power 61E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2689 power 0.62 0.5 -> 0.79 Inexact Rounded
+pwsx2690 power 0.062 0.5 -> 0.25 Inexact Rounded
+pwsx2691 power 62.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2692 power 62.00E-2 0.5 -> 0.79 Inexact Rounded
+pwsx2693 power 62E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2694 power 62E+1 0.5 -> 25 Inexact Rounded
+pwsx2695 power 62E+2 0.5 -> 79 Inexact Rounded
+pwsx2696 power 62E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2697 power 0.63 0.5 -> 0.79 Inexact Rounded
+pwsx2698 power 0.063 0.5 -> 0.25 Inexact Rounded
+pwsx2699 power 63.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2700 power 63.00E-2 0.5 -> 0.79 Inexact Rounded
+pwsx2701 power 63E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2702 power 63E+1 0.5 -> 25 Inexact Rounded
+pwsx2703 power 63E+2 0.5 -> 79 Inexact Rounded
+pwsx2704 power 63E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2705 power 0.64 0.5 -> 0.80 Inexact Rounded
+pwsx2706 power 0.064 0.5 -> 0.25 Inexact Rounded
+pwsx2707 power 64.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2708 power 64.00E-2 0.5 -> 0.80 Inexact Rounded
+pwsx2709 power 64E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2710 power 64E+1 0.5 -> 25 Inexact Rounded
+pwsx2711 power 64E+2 0.5 -> 80 Inexact Rounded
+pwsx2712 power 64E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2713 power 0.65 0.5 -> 0.81 Inexact Rounded
+pwsx2714 power 0.065 0.5 -> 0.25 Inexact Rounded
+pwsx2715 power 65.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2716 power 65.00E-2 0.5 -> 0.81 Inexact Rounded
+pwsx2717 power 65E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2718 power 65E+1 0.5 -> 25 Inexact Rounded
+pwsx2719 power 65E+2 0.5 -> 81 Inexact Rounded
+pwsx2720 power 65E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2721 power 0.66 0.5 -> 0.81 Inexact Rounded
+pwsx2722 power 0.066 0.5 -> 0.26 Inexact Rounded
+pwsx2723 power 66.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2724 power 66.00E-2 0.5 -> 0.81 Inexact Rounded
+pwsx2725 power 66E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2726 power 66E+1 0.5 -> 26 Inexact Rounded
+pwsx2727 power 66E+2 0.5 -> 81 Inexact Rounded
+pwsx2728 power 66E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2729 power 0.67 0.5 -> 0.82 Inexact Rounded
+pwsx2730 power 0.067 0.5 -> 0.26 Inexact Rounded
+pwsx2731 power 67.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2732 power 67.00E-2 0.5 -> 0.82 Inexact Rounded
+pwsx2733 power 67E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2734 power 67E+1 0.5 -> 26 Inexact Rounded
+pwsx2735 power 67E+2 0.5 -> 82 Inexact Rounded
+pwsx2736 power 67E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2737 power 0.68 0.5 -> 0.82 Inexact Rounded
+pwsx2738 power 0.068 0.5 -> 0.26 Inexact Rounded
+pwsx2739 power 68.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2740 power 68.00E-2 0.5 -> 0.82 Inexact Rounded
+pwsx2741 power 68E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2742 power 68E+1 0.5 -> 26 Inexact Rounded
+pwsx2743 power 68E+2 0.5 -> 82 Inexact Rounded
+pwsx2744 power 68E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2745 power 0.69 0.5 -> 0.83 Inexact Rounded
+pwsx2746 power 0.069 0.5 -> 0.26 Inexact Rounded
+pwsx2747 power 69.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2748 power 69.00E-2 0.5 -> 0.83 Inexact Rounded
+pwsx2749 power 69E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2750 power 69E+1 0.5 -> 26 Inexact Rounded
+pwsx2751 power 69E+2 0.5 -> 83 Inexact Rounded
+pwsx2752 power 69E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2753 power 0.70 0.5 -> 0.84 Inexact Rounded
+pwsx2754 power 0.070 0.5 -> 0.26 Inexact Rounded
+pwsx2755 power 70.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2756 power 70.00E-2 0.5 -> 0.84 Inexact Rounded
+pwsx2757 power 70E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2758 power 70E+1 0.5 -> 26 Inexact Rounded
+pwsx2759 power 70E+2 0.5 -> 84 Inexact Rounded
+pwsx2760 power 70E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2761 power 0.71 0.5 -> 0.84 Inexact Rounded
+pwsx2762 power 0.071 0.5 -> 0.27 Inexact Rounded
+pwsx2763 power 71.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2764 power 71.00E-2 0.5 -> 0.84 Inexact Rounded
+pwsx2765 power 71E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2766 power 71E+1 0.5 -> 27 Inexact Rounded
+pwsx2767 power 71E+2 0.5 -> 84 Inexact Rounded
+pwsx2768 power 71E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2769 power 0.72 0.5 -> 0.85 Inexact Rounded
+pwsx2770 power 0.072 0.5 -> 0.27 Inexact Rounded
+pwsx2771 power 72.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2772 power 72.00E-2 0.5 -> 0.85 Inexact Rounded
+pwsx2773 power 72E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2774 power 72E+1 0.5 -> 27 Inexact Rounded
+pwsx2775 power 72E+2 0.5 -> 85 Inexact Rounded
+pwsx2776 power 72E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2777 power 0.73 0.5 -> 0.85 Inexact Rounded
+pwsx2778 power 0.073 0.5 -> 0.27 Inexact Rounded
+pwsx2779 power 73.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2780 power 73.00E-2 0.5 -> 0.85 Inexact Rounded
+pwsx2781 power 73E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2782 power 73E+1 0.5 -> 27 Inexact Rounded
+pwsx2783 power 73E+2 0.5 -> 85 Inexact Rounded
+pwsx2784 power 73E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2785 power 0.74 0.5 -> 0.86 Inexact Rounded
+pwsx2786 power 0.074 0.5 -> 0.27 Inexact Rounded
+pwsx2787 power 74.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2788 power 74.00E-2 0.5 -> 0.86 Inexact Rounded
+pwsx2789 power 74E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2790 power 74E+1 0.5 -> 27 Inexact Rounded
+pwsx2791 power 74E+2 0.5 -> 86 Inexact Rounded
+pwsx2792 power 74E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2793 power 0.75 0.5 -> 0.87 Inexact Rounded
+pwsx2794 power 0.075 0.5 -> 0.27 Inexact Rounded
+pwsx2795 power 75.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2796 power 75.00E-2 0.5 -> 0.87 Inexact Rounded
+pwsx2797 power 75E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2798 power 75E+1 0.5 -> 27 Inexact Rounded
+pwsx2799 power 75E+2 0.5 -> 87 Inexact Rounded
+pwsx2800 power 75E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2801 power 0.76 0.5 -> 0.87 Inexact Rounded
+pwsx2802 power 0.076 0.5 -> 0.28 Inexact Rounded
+pwsx2803 power 76.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2804 power 76.00E-2 0.5 -> 0.87 Inexact Rounded
+pwsx2805 power 76E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2806 power 76E+1 0.5 -> 28 Inexact Rounded
+pwsx2807 power 76E+2 0.5 -> 87 Inexact Rounded
+pwsx2808 power 76E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2809 power 0.77 0.5 -> 0.88 Inexact Rounded
+pwsx2810 power 0.077 0.5 -> 0.28 Inexact Rounded
+pwsx2811 power 77.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2812 power 77.00E-2 0.5 -> 0.88 Inexact Rounded
+pwsx2813 power 77E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2814 power 77E+1 0.5 -> 28 Inexact Rounded
+pwsx2815 power 77E+2 0.5 -> 88 Inexact Rounded
+pwsx2816 power 77E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2817 power 0.78 0.5 -> 0.88 Inexact Rounded
+pwsx2818 power 0.078 0.5 -> 0.28 Inexact Rounded
+pwsx2819 power 78.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2820 power 78.00E-2 0.5 -> 0.88 Inexact Rounded
+pwsx2821 power 78E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2822 power 78E+1 0.5 -> 28 Inexact Rounded
+pwsx2823 power 78E+2 0.5 -> 88 Inexact Rounded
+pwsx2824 power 78E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2825 power 0.79 0.5 -> 0.89 Inexact Rounded
+pwsx2826 power 0.079 0.5 -> 0.28 Inexact Rounded
+pwsx2827 power 79.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2828 power 79.00E-2 0.5 -> 0.89 Inexact Rounded
+pwsx2829 power 79E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2830 power 79E+1 0.5 -> 28 Inexact Rounded
+pwsx2831 power 79E+2 0.5 -> 89 Inexact Rounded
+pwsx2832 power 79E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2833 power 0.80 0.5 -> 0.89 Inexact Rounded
+pwsx2834 power 0.080 0.5 -> 0.28 Inexact Rounded
+pwsx2835 power 80.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2836 power 80.00E-2 0.5 -> 0.89 Inexact Rounded
+pwsx2837 power 80E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2838 power 80E+1 0.5 -> 28 Inexact Rounded
+pwsx2839 power 80E+2 0.5 -> 89 Inexact Rounded
+pwsx2840 power 80E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2841 power 0.81 0.5 -> 0.90 Inexact Rounded
+pwsx2842 power 0.081 0.5 -> 0.28 Inexact Rounded
+pwsx2843 power 81.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2844 power 81.00E-2 0.5 -> 0.90 Inexact Rounded
+pwsx2845 power 81E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2846 power 81E+1 0.5 -> 28 Inexact Rounded
+pwsx2847 power 81E+2 0.5 -> 90 Inexact Rounded
+pwsx2848 power 81E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2849 power 0.82 0.5 -> 0.91 Inexact Rounded
+pwsx2850 power 0.082 0.5 -> 0.29 Inexact Rounded
+pwsx2851 power 82.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2852 power 82.00E-2 0.5 -> 0.91 Inexact Rounded
+pwsx2853 power 82E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2854 power 82E+1 0.5 -> 29 Inexact Rounded
+pwsx2855 power 82E+2 0.5 -> 91 Inexact Rounded
+pwsx2856 power 82E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2857 power 0.83 0.5 -> 0.91 Inexact Rounded
+pwsx2858 power 0.083 0.5 -> 0.29 Inexact Rounded
+pwsx2859 power 83.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2860 power 83.00E-2 0.5 -> 0.91 Inexact Rounded
+pwsx2861 power 83E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2862 power 83E+1 0.5 -> 29 Inexact Rounded
+pwsx2863 power 83E+2 0.5 -> 91 Inexact Rounded
+pwsx2864 power 83E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2865 power 0.84 0.5 -> 0.92 Inexact Rounded
+pwsx2866 power 0.084 0.5 -> 0.29 Inexact Rounded
+pwsx2867 power 84.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2868 power 84.00E-2 0.5 -> 0.92 Inexact Rounded
+pwsx2869 power 84E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2870 power 84E+1 0.5 -> 29 Inexact Rounded
+pwsx2871 power 84E+2 0.5 -> 92 Inexact Rounded
+pwsx2872 power 84E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2873 power 0.85 0.5 -> 0.92 Inexact Rounded
+pwsx2874 power 0.085 0.5 -> 0.29 Inexact Rounded
+pwsx2875 power 85.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2876 power 85.00E-2 0.5 -> 0.92 Inexact Rounded
+pwsx2877 power 85E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2878 power 85E+1 0.5 -> 29 Inexact Rounded
+pwsx2879 power 85E+2 0.5 -> 92 Inexact Rounded
+pwsx2880 power 85E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2881 power 0.86 0.5 -> 0.93 Inexact Rounded
+pwsx2882 power 0.086 0.5 -> 0.29 Inexact Rounded
+pwsx2883 power 86.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2884 power 86.00E-2 0.5 -> 0.93 Inexact Rounded
+pwsx2885 power 86E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2886 power 86E+1 0.5 -> 29 Inexact Rounded
+pwsx2887 power 86E+2 0.5 -> 93 Inexact Rounded
+pwsx2888 power 86E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2889 power 0.87 0.5 -> 0.93 Inexact Rounded
+pwsx2890 power 0.087 0.5 -> 0.29 Inexact Rounded
+pwsx2891 power 87.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2892 power 87.00E-2 0.5 -> 0.93 Inexact Rounded
+pwsx2893 power 87E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2894 power 87E+1 0.5 -> 29 Inexact Rounded
+pwsx2895 power 87E+2 0.5 -> 93 Inexact Rounded
+pwsx2896 power 87E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2897 power 0.88 0.5 -> 0.94 Inexact Rounded
+pwsx2898 power 0.088 0.5 -> 0.30 Inexact Rounded
+pwsx2899 power 88.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2900 power 88.00E-2 0.5 -> 0.94 Inexact Rounded
+pwsx2901 power 88E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2902 power 88E+1 0.5 -> 30 Inexact Rounded
+pwsx2903 power 88E+2 0.5 -> 94 Inexact Rounded
+pwsx2904 power 88E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2905 power 0.89 0.5 -> 0.94 Inexact Rounded
+pwsx2906 power 0.089 0.5 -> 0.30 Inexact Rounded
+pwsx2907 power 89.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2908 power 89.00E-2 0.5 -> 0.94 Inexact Rounded
+pwsx2909 power 89E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2910 power 89E+1 0.5 -> 30 Inexact Rounded
+pwsx2911 power 89E+2 0.5 -> 94 Inexact Rounded
+pwsx2912 power 89E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2913 power 0.90 0.5 -> 0.95 Inexact Rounded
+pwsx2914 power 0.090 0.5 -> 0.30 Inexact Rounded
+pwsx2915 power 90.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2916 power 90.00E-2 0.5 -> 0.95 Inexact Rounded
+pwsx2917 power 90E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2918 power 90E+1 0.5 -> 30 Inexact Rounded
+pwsx2919 power 90E+2 0.5 -> 95 Inexact Rounded
+pwsx2920 power 90E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2921 power 0.91 0.5 -> 0.95 Inexact Rounded
+pwsx2922 power 0.091 0.5 -> 0.30 Inexact Rounded
+pwsx2923 power 91.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2924 power 91.00E-2 0.5 -> 0.95 Inexact Rounded
+pwsx2925 power 91E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2926 power 91E+1 0.5 -> 30 Inexact Rounded
+pwsx2927 power 91E+2 0.5 -> 95 Inexact Rounded
+pwsx2928 power 91E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2929 power 0.92 0.5 -> 0.96 Inexact Rounded
+pwsx2930 power 0.092 0.5 -> 0.30 Inexact Rounded
+pwsx2931 power 92.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2932 power 92.00E-2 0.5 -> 0.96 Inexact Rounded
+pwsx2933 power 92E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2934 power 92E+1 0.5 -> 30 Inexact Rounded
+pwsx2935 power 92E+2 0.5 -> 96 Inexact Rounded
+pwsx2936 power 92E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2937 power 0.93 0.5 -> 0.96 Inexact Rounded
+pwsx2938 power 0.093 0.5 -> 0.30 Inexact Rounded
+pwsx2939 power 93.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2940 power 93.00E-2 0.5 -> 0.96 Inexact Rounded
+pwsx2941 power 93E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2942 power 93E+1 0.5 -> 30 Inexact Rounded
+pwsx2943 power 93E+2 0.5 -> 96 Inexact Rounded
+pwsx2944 power 93E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2945 power 0.94 0.5 -> 0.97 Inexact Rounded
+pwsx2946 power 0.094 0.5 -> 0.31 Inexact Rounded
+pwsx2947 power 94.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2948 power 94.00E-2 0.5 -> 0.97 Inexact Rounded
+pwsx2949 power 94E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2950 power 94E+1 0.5 -> 31 Inexact Rounded
+pwsx2951 power 94E+2 0.5 -> 97 Inexact Rounded
+pwsx2952 power 94E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2953 power 0.95 0.5 -> 0.97 Inexact Rounded
+pwsx2954 power 0.095 0.5 -> 0.31 Inexact Rounded
+pwsx2955 power 95.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2956 power 95.00E-2 0.5 -> 0.97 Inexact Rounded
+pwsx2957 power 95E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2958 power 95E+1 0.5 -> 31 Inexact Rounded
+pwsx2959 power 95E+2 0.5 -> 97 Inexact Rounded
+pwsx2960 power 95E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2961 power 0.96 0.5 -> 0.98 Inexact Rounded
+pwsx2962 power 0.096 0.5 -> 0.31 Inexact Rounded
+pwsx2963 power 96.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2964 power 96.00E-2 0.5 -> 0.98 Inexact Rounded
+pwsx2965 power 96E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2966 power 96E+1 0.5 -> 31 Inexact Rounded
+pwsx2967 power 96E+2 0.5 -> 98 Inexact Rounded
+pwsx2968 power 96E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2969 power 0.97 0.5 -> 0.98 Inexact Rounded
+pwsx2970 power 0.097 0.5 -> 0.31 Inexact Rounded
+pwsx2971 power 97.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2972 power 97.00E-2 0.5 -> 0.98 Inexact Rounded
+pwsx2973 power 97E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2974 power 97E+1 0.5 -> 31 Inexact Rounded
+pwsx2975 power 97E+2 0.5 -> 98 Inexact Rounded
+pwsx2976 power 97E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2977 power 0.98 0.5 -> 0.99 Inexact Rounded
+pwsx2978 power 0.098 0.5 -> 0.31 Inexact Rounded
+pwsx2979 power 98.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2980 power 98.00E-2 0.5 -> 0.99 Inexact Rounded
+pwsx2981 power 98E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2982 power 98E+1 0.5 -> 31 Inexact Rounded
+pwsx2983 power 98E+2 0.5 -> 99 Inexact Rounded
+pwsx2984 power 98E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2985 power 0.99 0.5 -> 0.99 Inexact Rounded
+pwsx2986 power 0.099 0.5 -> 0.31 Inexact Rounded
+pwsx2987 power 99.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2988 power 99.00E-2 0.5 -> 0.99 Inexact Rounded
+pwsx2989 power 99E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2990 power 99E+1 0.5 -> 31 Inexact Rounded
+pwsx2991 power 99E+2 0.5 -> 99 Inexact Rounded
+pwsx2992 power 99E+3 0.5 -> 3.1E+2 Inexact Rounded
+
+-- Precision 3 squareroot tests [exhaustive, f and f/10]
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+precision: 3
+pwsx3001 power 0.1 0.5 -> 0.316 Inexact Rounded
+pwsx3002 power 0.01 0.5 -> 0.100 Inexact Rounded
+pwsx3003 power 0.2 0.5 -> 0.447 Inexact Rounded
+pwsx3004 power 0.02 0.5 -> 0.141 Inexact Rounded
+pwsx3005 power 0.3 0.5 -> 0.548 Inexact Rounded
+pwsx3006 power 0.03 0.5 -> 0.173 Inexact Rounded
+pwsx3007 power 0.4 0.5 -> 0.632 Inexact Rounded
+pwsx3008 power 0.04 0.5 -> 0.200 Inexact Rounded
+pwsx3009 power 0.5 0.5 -> 0.707 Inexact Rounded
+pwsx3010 power 0.05 0.5 -> 0.224 Inexact Rounded
+pwsx3011 power 0.6 0.5 -> 0.775 Inexact Rounded
+pwsx3012 power 0.06 0.5 -> 0.245 Inexact Rounded
+pwsx3013 power 0.7 0.5 -> 0.837 Inexact Rounded
+pwsx3014 power 0.07 0.5 -> 0.265 Inexact Rounded
+pwsx3015 power 0.8 0.5 -> 0.894 Inexact Rounded
+pwsx3016 power 0.08 0.5 -> 0.283 Inexact Rounded
+pwsx3017 power 0.9 0.5 -> 0.949 Inexact Rounded
+pwsx3018 power 0.09 0.5 -> 0.300 Inexact Rounded
+pwsx3019 power 0.11 0.5 -> 0.332 Inexact Rounded
+pwsx3020 power 0.011 0.5 -> 0.105 Inexact Rounded
+pwsx3021 power 0.12 0.5 -> 0.346 Inexact Rounded
+pwsx3022 power 0.012 0.5 -> 0.110 Inexact Rounded
+pwsx3023 power 0.13 0.5 -> 0.361 Inexact Rounded
+pwsx3024 power 0.013 0.5 -> 0.114 Inexact Rounded
+pwsx3025 power 0.14 0.5 -> 0.374 Inexact Rounded
+pwsx3026 power 0.014 0.5 -> 0.118 Inexact Rounded
+pwsx3027 power 0.15 0.5 -> 0.387 Inexact Rounded
+pwsx3028 power 0.015 0.5 -> 0.122 Inexact Rounded
+pwsx3029 power 0.16 0.5 -> 0.400 Inexact Rounded
+pwsx3030 power 0.016 0.5 -> 0.126 Inexact Rounded
+pwsx3031 power 0.17 0.5 -> 0.412 Inexact Rounded
+pwsx3032 power 0.017 0.5 -> 0.130 Inexact Rounded
+pwsx3033 power 0.18 0.5 -> 0.424 Inexact Rounded
+pwsx3034 power 0.018 0.5 -> 0.134 Inexact Rounded
+pwsx3035 power 0.19 0.5 -> 0.436 Inexact Rounded
+pwsx3036 power 0.019 0.5 -> 0.138 Inexact Rounded
+pwsx3037 power 0.21 0.5 -> 0.458 Inexact Rounded
+pwsx3038 power 0.021 0.5 -> 0.145 Inexact Rounded
+pwsx3039 power 0.22 0.5 -> 0.469 Inexact Rounded
+pwsx3040 power 0.022 0.5 -> 0.148 Inexact Rounded
+pwsx3041 power 0.23 0.5 -> 0.480 Inexact Rounded
+pwsx3042 power 0.023 0.5 -> 0.152 Inexact Rounded
+pwsx3043 power 0.24 0.5 -> 0.490 Inexact Rounded
+pwsx3044 power 0.024 0.5 -> 0.155 Inexact Rounded
+pwsx3045 power 0.25 0.5 -> 0.500 Inexact Rounded
+pwsx3046 power 0.025 0.5 -> 0.158 Inexact Rounded
+pwsx3047 power 0.26 0.5 -> 0.510 Inexact Rounded
+pwsx3048 power 0.026 0.5 -> 0.161 Inexact Rounded
+pwsx3049 power 0.27 0.5 -> 0.520 Inexact Rounded
+pwsx3050 power 0.027 0.5 -> 0.164 Inexact Rounded
+pwsx3051 power 0.28 0.5 -> 0.529 Inexact Rounded
+pwsx3052 power 0.028 0.5 -> 0.167 Inexact Rounded
+pwsx3053 power 0.29 0.5 -> 0.539 Inexact Rounded
+pwsx3054 power 0.029 0.5 -> 0.170 Inexact Rounded
+pwsx3055 power 0.31 0.5 -> 0.557 Inexact Rounded
+pwsx3056 power 0.031 0.5 -> 0.176 Inexact Rounded
+pwsx3057 power 0.32 0.5 -> 0.566 Inexact Rounded
+pwsx3058 power 0.032 0.5 -> 0.179 Inexact Rounded
+pwsx3059 power 0.33 0.5 -> 0.574 Inexact Rounded
+pwsx3060 power 0.033 0.5 -> 0.182 Inexact Rounded
+pwsx3061 power 0.34 0.5 -> 0.583 Inexact Rounded
+pwsx3062 power 0.034 0.5 -> 0.184 Inexact Rounded
+pwsx3063 power 0.35 0.5 -> 0.592 Inexact Rounded
+pwsx3064 power 0.035 0.5 -> 0.187 Inexact Rounded
+pwsx3065 power 0.36 0.5 -> 0.600 Inexact Rounded
+pwsx3066 power 0.036 0.5 -> 0.190 Inexact Rounded
+pwsx3067 power 0.37 0.5 -> 0.608 Inexact Rounded
+pwsx3068 power 0.037 0.5 -> 0.192 Inexact Rounded
+pwsx3069 power 0.38 0.5 -> 0.616 Inexact Rounded
+pwsx3070 power 0.038 0.5 -> 0.195 Inexact Rounded
+pwsx3071 power 0.39 0.5 -> 0.624 Inexact Rounded
+pwsx3072 power 0.039 0.5 -> 0.197 Inexact Rounded
+pwsx3073 power 0.41 0.5 -> 0.640 Inexact Rounded
+pwsx3074 power 0.041 0.5 -> 0.202 Inexact Rounded
+pwsx3075 power 0.42 0.5 -> 0.648 Inexact Rounded
+pwsx3076 power 0.042 0.5 -> 0.205 Inexact Rounded
+pwsx3077 power 0.43 0.5 -> 0.656 Inexact Rounded
+pwsx3078 power 0.043 0.5 -> 0.207 Inexact Rounded
+pwsx3079 power 0.44 0.5 -> 0.663 Inexact Rounded
+pwsx3080 power 0.044 0.5 -> 0.210 Inexact Rounded
+pwsx3081 power 0.45 0.5 -> 0.671 Inexact Rounded
+pwsx3082 power 0.045 0.5 -> 0.212 Inexact Rounded
+pwsx3083 power 0.46 0.5 -> 0.678 Inexact Rounded
+pwsx3084 power 0.046 0.5 -> 0.214 Inexact Rounded
+pwsx3085 power 0.47 0.5 -> 0.686 Inexact Rounded
+pwsx3086 power 0.047 0.5 -> 0.217 Inexact Rounded
+pwsx3087 power 0.48 0.5 -> 0.693 Inexact Rounded
+pwsx3088 power 0.048 0.5 -> 0.219 Inexact Rounded
+pwsx3089 power 0.49 0.5 -> 0.700 Inexact Rounded
+pwsx3090 power 0.049 0.5 -> 0.221 Inexact Rounded
+pwsx3091 power 0.51 0.5 -> 0.714 Inexact Rounded
+pwsx3092 power 0.051 0.5 -> 0.226 Inexact Rounded
+pwsx3093 power 0.52 0.5 -> 0.721 Inexact Rounded
+pwsx3094 power 0.052 0.5 -> 0.228 Inexact Rounded
+pwsx3095 power 0.53 0.5 -> 0.728 Inexact Rounded
+pwsx3096 power 0.053 0.5 -> 0.230 Inexact Rounded
+pwsx3097 power 0.54 0.5 -> 0.735 Inexact Rounded
+pwsx3098 power 0.054 0.5 -> 0.232 Inexact Rounded
+pwsx3099 power 0.55 0.5 -> 0.742 Inexact Rounded
+pwsx3100 power 0.055 0.5 -> 0.235 Inexact Rounded
+pwsx3101 power 0.56 0.5 -> 0.748 Inexact Rounded
+pwsx3102 power 0.056 0.5 -> 0.237 Inexact Rounded
+pwsx3103 power 0.57 0.5 -> 0.755 Inexact Rounded
+pwsx3104 power 0.057 0.5 -> 0.239 Inexact Rounded
+pwsx3105 power 0.58 0.5 -> 0.762 Inexact Rounded
+pwsx3106 power 0.058 0.5 -> 0.241 Inexact Rounded
+pwsx3107 power 0.59 0.5 -> 0.768 Inexact Rounded
+pwsx3108 power 0.059 0.5 -> 0.243 Inexact Rounded
+pwsx3109 power 0.61 0.5 -> 0.781 Inexact Rounded
+pwsx3110 power 0.061 0.5 -> 0.247 Inexact Rounded
+pwsx3111 power 0.62 0.5 -> 0.787 Inexact Rounded
+pwsx3112 power 0.062 0.5 -> 0.249 Inexact Rounded
+pwsx3113 power 0.63 0.5 -> 0.794 Inexact Rounded
+pwsx3114 power 0.063 0.5 -> 0.251 Inexact Rounded
+pwsx3115 power 0.64 0.5 -> 0.800 Inexact Rounded
+pwsx3116 power 0.064 0.5 -> 0.253 Inexact Rounded
+pwsx3117 power 0.65 0.5 -> 0.806 Inexact Rounded
+pwsx3118 power 0.065 0.5 -> 0.255 Inexact Rounded
+pwsx3119 power 0.66 0.5 -> 0.812 Inexact Rounded
+pwsx3120 power 0.066 0.5 -> 0.257 Inexact Rounded
+pwsx3121 power 0.67 0.5 -> 0.819 Inexact Rounded
+pwsx3122 power 0.067 0.5 -> 0.259 Inexact Rounded
+pwsx3123 power 0.68 0.5 -> 0.825 Inexact Rounded
+pwsx3124 power 0.068 0.5 -> 0.261 Inexact Rounded
+pwsx3125 power 0.69 0.5 -> 0.831 Inexact Rounded
+pwsx3126 power 0.069 0.5 -> 0.263 Inexact Rounded
+pwsx3127 power 0.71 0.5 -> 0.843 Inexact Rounded
+pwsx3128 power 0.071 0.5 -> 0.266 Inexact Rounded
+pwsx3129 power 0.72 0.5 -> 0.849 Inexact Rounded
+pwsx3130 power 0.072 0.5 -> 0.268 Inexact Rounded
+pwsx3131 power 0.73 0.5 -> 0.854 Inexact Rounded
+pwsx3132 power 0.073 0.5 -> 0.270 Inexact Rounded
+pwsx3133 power 0.74 0.5 -> 0.860 Inexact Rounded
+pwsx3134 power 0.074 0.5 -> 0.272 Inexact Rounded
+pwsx3135 power 0.75 0.5 -> 0.866 Inexact Rounded
+pwsx3136 power 0.075 0.5 -> 0.274 Inexact Rounded
+pwsx3137 power 0.76 0.5 -> 0.872 Inexact Rounded
+pwsx3138 power 0.076 0.5 -> 0.276 Inexact Rounded
+pwsx3139 power 0.77 0.5 -> 0.877 Inexact Rounded
+pwsx3140 power 0.077 0.5 -> 0.277 Inexact Rounded
+pwsx3141 power 0.78 0.5 -> 0.883 Inexact Rounded
+pwsx3142 power 0.078 0.5 -> 0.279 Inexact Rounded
+pwsx3143 power 0.79 0.5 -> 0.889 Inexact Rounded
+pwsx3144 power 0.079 0.5 -> 0.281 Inexact Rounded
+pwsx3145 power 0.81 0.5 -> 0.900 Inexact Rounded
+pwsx3146 power 0.081 0.5 -> 0.285 Inexact Rounded
+pwsx3147 power 0.82 0.5 -> 0.906 Inexact Rounded
+pwsx3148 power 0.082 0.5 -> 0.286 Inexact Rounded
+pwsx3149 power 0.83 0.5 -> 0.911 Inexact Rounded
+pwsx3150 power 0.083 0.5 -> 0.288 Inexact Rounded
+pwsx3151 power 0.84 0.5 -> 0.917 Inexact Rounded
+pwsx3152 power 0.084 0.5 -> 0.290 Inexact Rounded
+pwsx3153 power 0.85 0.5 -> 0.922 Inexact Rounded
+pwsx3154 power 0.085 0.5 -> 0.292 Inexact Rounded
+pwsx3155 power 0.86 0.5 -> 0.927 Inexact Rounded
+pwsx3156 power 0.086 0.5 -> 0.293 Inexact Rounded
+pwsx3157 power 0.87 0.5 -> 0.933 Inexact Rounded
+pwsx3158 power 0.087 0.5 -> 0.295 Inexact Rounded
+pwsx3159 power 0.88 0.5 -> 0.938 Inexact Rounded
+pwsx3160 power 0.088 0.5 -> 0.297 Inexact Rounded
+pwsx3161 power 0.89 0.5 -> 0.943 Inexact Rounded
+pwsx3162 power 0.089 0.5 -> 0.298 Inexact Rounded
+pwsx3163 power 0.91 0.5 -> 0.954 Inexact Rounded
+pwsx3164 power 0.091 0.5 -> 0.302 Inexact Rounded
+pwsx3165 power 0.92 0.5 -> 0.959 Inexact Rounded
+pwsx3166 power 0.092 0.5 -> 0.303 Inexact Rounded
+pwsx3167 power 0.93 0.5 -> 0.964 Inexact Rounded
+pwsx3168 power 0.093 0.5 -> 0.305 Inexact Rounded
+pwsx3169 power 0.94 0.5 -> 0.970 Inexact Rounded
+pwsx3170 power 0.094 0.5 -> 0.307 Inexact Rounded
+pwsx3171 power 0.95 0.5 -> 0.975 Inexact Rounded
+pwsx3172 power 0.095 0.5 -> 0.308 Inexact Rounded
+pwsx3173 power 0.96 0.5 -> 0.980 Inexact Rounded
+pwsx3174 power 0.096 0.5 -> 0.310 Inexact Rounded
+pwsx3175 power 0.97 0.5 -> 0.985 Inexact Rounded
+pwsx3176 power 0.097 0.5 -> 0.311 Inexact Rounded
+pwsx3177 power 0.98 0.5 -> 0.990 Inexact Rounded
+pwsx3178 power 0.098 0.5 -> 0.313 Inexact Rounded
+pwsx3179 power 0.99 0.5 -> 0.995 Inexact Rounded
+pwsx3180 power 0.099 0.5 -> 0.315 Inexact Rounded
+pwsx3181 power 0.101 0.5 -> 0.318 Inexact Rounded
+pwsx3182 power 0.0101 0.5 -> 0.100 Inexact Rounded
+pwsx3183 power 0.102 0.5 -> 0.319 Inexact Rounded
+pwsx3184 power 0.0102 0.5 -> 0.101 Inexact Rounded
+pwsx3185 power 0.103 0.5 -> 0.321 Inexact Rounded
+pwsx3186 power 0.0103 0.5 -> 0.101 Inexact Rounded
+pwsx3187 power 0.104 0.5 -> 0.322 Inexact Rounded
+pwsx3188 power 0.0104 0.5 -> 0.102 Inexact Rounded
+pwsx3189 power 0.105 0.5 -> 0.324 Inexact Rounded
+pwsx3190 power 0.0105 0.5 -> 0.102 Inexact Rounded
+pwsx3191 power 0.106 0.5 -> 0.326 Inexact Rounded
+pwsx3192 power 0.0106 0.5 -> 0.103 Inexact Rounded
+pwsx3193 power 0.107 0.5 -> 0.327 Inexact Rounded
+pwsx3194 power 0.0107 0.5 -> 0.103 Inexact Rounded
+pwsx3195 power 0.108 0.5 -> 0.329 Inexact Rounded
+pwsx3196 power 0.0108 0.5 -> 0.104 Inexact Rounded
+pwsx3197 power 0.109 0.5 -> 0.330 Inexact Rounded
+pwsx3198 power 0.0109 0.5 -> 0.104 Inexact Rounded
+pwsx3199 power 0.111 0.5 -> 0.333 Inexact Rounded
+pwsx3200 power 0.0111 0.5 -> 0.105 Inexact Rounded
+pwsx3201 power 0.112 0.5 -> 0.335 Inexact Rounded
+pwsx3202 power 0.0112 0.5 -> 0.106 Inexact Rounded
+pwsx3203 power 0.113 0.5 -> 0.336 Inexact Rounded
+pwsx3204 power 0.0113 0.5 -> 0.106 Inexact Rounded
+pwsx3205 power 0.114 0.5 -> 0.338 Inexact Rounded
+pwsx3206 power 0.0114 0.5 -> 0.107 Inexact Rounded
+pwsx3207 power 0.115 0.5 -> 0.339 Inexact Rounded
+pwsx3208 power 0.0115 0.5 -> 0.107 Inexact Rounded
+pwsx3209 power 0.116 0.5 -> 0.341 Inexact Rounded
+pwsx3210 power 0.0116 0.5 -> 0.108 Inexact Rounded
+pwsx3211 power 0.117 0.5 -> 0.342 Inexact Rounded
+pwsx3212 power 0.0117 0.5 -> 0.108 Inexact Rounded
+pwsx3213 power 0.118 0.5 -> 0.344 Inexact Rounded
+pwsx3214 power 0.0118 0.5 -> 0.109 Inexact Rounded
+pwsx3215 power 0.119 0.5 -> 0.345 Inexact Rounded
+pwsx3216 power 0.0119 0.5 -> 0.109 Inexact Rounded
+pwsx3217 power 0.121 0.5 -> 0.348 Inexact Rounded
+pwsx3218 power 0.0121 0.5 -> 0.110 Inexact Rounded
+pwsx3219 power 0.122 0.5 -> 0.349 Inexact Rounded
+pwsx3220 power 0.0122 0.5 -> 0.110 Inexact Rounded
+pwsx3221 power 0.123 0.5 -> 0.351 Inexact Rounded
+pwsx3222 power 0.0123 0.5 -> 0.111 Inexact Rounded
+pwsx3223 power 0.124 0.5 -> 0.352 Inexact Rounded
+pwsx3224 power 0.0124 0.5 -> 0.111 Inexact Rounded
+pwsx3225 power 0.125 0.5 -> 0.354 Inexact Rounded
+pwsx3226 power 0.0125 0.5 -> 0.112 Inexact Rounded
+pwsx3227 power 0.126 0.5 -> 0.355 Inexact Rounded
+pwsx3228 power 0.0126 0.5 -> 0.112 Inexact Rounded
+pwsx3229 power 0.127 0.5 -> 0.356 Inexact Rounded
+pwsx3230 power 0.0127 0.5 -> 0.113 Inexact Rounded
+pwsx3231 power 0.128 0.5 -> 0.358 Inexact Rounded
+pwsx3232 power 0.0128 0.5 -> 0.113 Inexact Rounded
+pwsx3233 power 0.129 0.5 -> 0.359 Inexact Rounded
+pwsx3234 power 0.0129 0.5 -> 0.114 Inexact Rounded
+pwsx3235 power 0.131 0.5 -> 0.362 Inexact Rounded
+pwsx3236 power 0.0131 0.5 -> 0.114 Inexact Rounded
+pwsx3237 power 0.132 0.5 -> 0.363 Inexact Rounded
+pwsx3238 power 0.0132 0.5 -> 0.115 Inexact Rounded
+pwsx3239 power 0.133 0.5 -> 0.365 Inexact Rounded
+pwsx3240 power 0.0133 0.5 -> 0.115 Inexact Rounded
+pwsx3241 power 0.134 0.5 -> 0.366 Inexact Rounded
+pwsx3242 power 0.0134 0.5 -> 0.116 Inexact Rounded
+pwsx3243 power 0.135 0.5 -> 0.367 Inexact Rounded
+pwsx3244 power 0.0135 0.5 -> 0.116 Inexact Rounded
+pwsx3245 power 0.136 0.5 -> 0.369 Inexact Rounded
+pwsx3246 power 0.0136 0.5 -> 0.117 Inexact Rounded
+pwsx3247 power 0.137 0.5 -> 0.370 Inexact Rounded
+pwsx3248 power 0.0137 0.5 -> 0.117 Inexact Rounded
+pwsx3249 power 0.138 0.5 -> 0.371 Inexact Rounded
+pwsx3250 power 0.0138 0.5 -> 0.117 Inexact Rounded
+pwsx3251 power 0.139 0.5 -> 0.373 Inexact Rounded
+pwsx3252 power 0.0139 0.5 -> 0.118 Inexact Rounded
+pwsx3253 power 0.141 0.5 -> 0.375 Inexact Rounded
+pwsx3254 power 0.0141 0.5 -> 0.119 Inexact Rounded
+pwsx3255 power 0.142 0.5 -> 0.377 Inexact Rounded
+pwsx3256 power 0.0142 0.5 -> 0.119 Inexact Rounded
+pwsx3257 power 0.143 0.5 -> 0.378 Inexact Rounded
+pwsx3258 power 0.0143 0.5 -> 0.120 Inexact Rounded
+pwsx3259 power 0.144 0.5 -> 0.379 Inexact Rounded
+pwsx3260 power 0.0144 0.5 -> 0.120 Inexact Rounded
+pwsx3261 power 0.145 0.5 -> 0.381 Inexact Rounded
+pwsx3262 power 0.0145 0.5 -> 0.120 Inexact Rounded
+pwsx3263 power 0.146 0.5 -> 0.382 Inexact Rounded
+pwsx3264 power 0.0146 0.5 -> 0.121 Inexact Rounded
+pwsx3265 power 0.147 0.5 -> 0.383 Inexact Rounded
+pwsx3266 power 0.0147 0.5 -> 0.121 Inexact Rounded
+pwsx3267 power 0.148 0.5 -> 0.385 Inexact Rounded
+pwsx3268 power 0.0148 0.5 -> 0.122 Inexact Rounded
+pwsx3269 power 0.149 0.5 -> 0.386 Inexact Rounded
+pwsx3270 power 0.0149 0.5 -> 0.122 Inexact Rounded
+pwsx3271 power 0.151 0.5 -> 0.389 Inexact Rounded
+pwsx3272 power 0.0151 0.5 -> 0.123 Inexact Rounded
+pwsx3273 power 0.152 0.5 -> 0.390 Inexact Rounded
+pwsx3274 power 0.0152 0.5 -> 0.123 Inexact Rounded
+pwsx3275 power 0.153 0.5 -> 0.391 Inexact Rounded
+pwsx3276 power 0.0153 0.5 -> 0.124 Inexact Rounded
+pwsx3277 power 0.154 0.5 -> 0.392 Inexact Rounded
+pwsx3278 power 0.0154 0.5 -> 0.124 Inexact Rounded
+pwsx3279 power 0.155 0.5 -> 0.394 Inexact Rounded
+pwsx3280 power 0.0155 0.5 -> 0.124 Inexact Rounded
+pwsx3281 power 0.156 0.5 -> 0.395 Inexact Rounded
+pwsx3282 power 0.0156 0.5 -> 0.125 Inexact Rounded
+pwsx3283 power 0.157 0.5 -> 0.396 Inexact Rounded
+pwsx3284 power 0.0157 0.5 -> 0.125 Inexact Rounded
+pwsx3285 power 0.158 0.5 -> 0.397 Inexact Rounded
+pwsx3286 power 0.0158 0.5 -> 0.126 Inexact Rounded
+pwsx3287 power 0.159 0.5 -> 0.399 Inexact Rounded
+pwsx3288 power 0.0159 0.5 -> 0.126 Inexact Rounded
+pwsx3289 power 0.161 0.5 -> 0.401 Inexact Rounded
+pwsx3290 power 0.0161 0.5 -> 0.127 Inexact Rounded
+pwsx3291 power 0.162 0.5 -> 0.402 Inexact Rounded
+pwsx3292 power 0.0162 0.5 -> 0.127 Inexact Rounded
+pwsx3293 power 0.163 0.5 -> 0.404 Inexact Rounded
+pwsx3294 power 0.0163 0.5 -> 0.128 Inexact Rounded
+pwsx3295 power 0.164 0.5 -> 0.405 Inexact Rounded
+pwsx3296 power 0.0164 0.5 -> 0.128 Inexact Rounded
+pwsx3297 power 0.165 0.5 -> 0.406 Inexact Rounded
+pwsx3298 power 0.0165 0.5 -> 0.128 Inexact Rounded
+pwsx3299 power 0.166 0.5 -> 0.407 Inexact Rounded
+pwsx3300 power 0.0166 0.5 -> 0.129 Inexact Rounded
+pwsx3301 power 0.167 0.5 -> 0.409 Inexact Rounded
+pwsx3302 power 0.0167 0.5 -> 0.129 Inexact Rounded
+pwsx3303 power 0.168 0.5 -> 0.410 Inexact Rounded
+pwsx3304 power 0.0168 0.5 -> 0.130 Inexact Rounded
+pwsx3305 power 0.169 0.5 -> 0.411 Inexact Rounded
+pwsx3306 power 0.0169 0.5 -> 0.130 Inexact Rounded
+pwsx3307 power 0.171 0.5 -> 0.414 Inexact Rounded
+pwsx3308 power 0.0171 0.5 -> 0.131 Inexact Rounded
+pwsx3309 power 0.172 0.5 -> 0.415 Inexact Rounded
+pwsx3310 power 0.0172 0.5 -> 0.131 Inexact Rounded
+pwsx3311 power 0.173 0.5 -> 0.416 Inexact Rounded
+pwsx3312 power 0.0173 0.5 -> 0.132 Inexact Rounded
+pwsx3313 power 0.174 0.5 -> 0.417 Inexact Rounded
+pwsx3314 power 0.0174 0.5 -> 0.132 Inexact Rounded
+pwsx3315 power 0.175 0.5 -> 0.418 Inexact Rounded
+pwsx3316 power 0.0175 0.5 -> 0.132 Inexact Rounded
+pwsx3317 power 0.176 0.5 -> 0.420 Inexact Rounded
+pwsx3318 power 0.0176 0.5 -> 0.133 Inexact Rounded
+pwsx3319 power 0.177 0.5 -> 0.421 Inexact Rounded
+pwsx3320 power 0.0177 0.5 -> 0.133 Inexact Rounded
+pwsx3321 power 0.178 0.5 -> 0.422 Inexact Rounded
+pwsx3322 power 0.0178 0.5 -> 0.133 Inexact Rounded
+pwsx3323 power 0.179 0.5 -> 0.423 Inexact Rounded
+pwsx3324 power 0.0179 0.5 -> 0.134 Inexact Rounded
+pwsx3325 power 0.181 0.5 -> 0.425 Inexact Rounded
+pwsx3326 power 0.0181 0.5 -> 0.135 Inexact Rounded
+pwsx3327 power 0.182 0.5 -> 0.427 Inexact Rounded
+pwsx3328 power 0.0182 0.5 -> 0.135 Inexact Rounded
+pwsx3329 power 0.183 0.5 -> 0.428 Inexact Rounded
+pwsx3330 power 0.0183 0.5 -> 0.135 Inexact Rounded
+pwsx3331 power 0.184 0.5 -> 0.429 Inexact Rounded
+pwsx3332 power 0.0184 0.5 -> 0.136 Inexact Rounded
+pwsx3333 power 0.185 0.5 -> 0.430 Inexact Rounded
+pwsx3334 power 0.0185 0.5 -> 0.136 Inexact Rounded
+pwsx3335 power 0.186 0.5 -> 0.431 Inexact Rounded
+pwsx3336 power 0.0186 0.5 -> 0.136 Inexact Rounded
+pwsx3337 power 0.187 0.5 -> 0.432 Inexact Rounded
+pwsx3338 power 0.0187 0.5 -> 0.137 Inexact Rounded
+pwsx3339 power 0.188 0.5 -> 0.434 Inexact Rounded
+pwsx3340 power 0.0188 0.5 -> 0.137 Inexact Rounded
+pwsx3341 power 0.189 0.5 -> 0.435 Inexact Rounded
+pwsx3342 power 0.0189 0.5 -> 0.137 Inexact Rounded
+pwsx3343 power 0.191 0.5 -> 0.437 Inexact Rounded
+pwsx3344 power 0.0191 0.5 -> 0.138 Inexact Rounded
+pwsx3345 power 0.192 0.5 -> 0.438 Inexact Rounded
+pwsx3346 power 0.0192 0.5 -> 0.139 Inexact Rounded
+pwsx3347 power 0.193 0.5 -> 0.439 Inexact Rounded
+pwsx3348 power 0.0193 0.5 -> 0.139 Inexact Rounded
+pwsx3349 power 0.194 0.5 -> 0.440 Inexact Rounded
+pwsx3350 power 0.0194 0.5 -> 0.139 Inexact Rounded
+pwsx3351 power 0.195 0.5 -> 0.442 Inexact Rounded
+pwsx3352 power 0.0195 0.5 -> 0.140 Inexact Rounded
+pwsx3353 power 0.196 0.5 -> 0.443 Inexact Rounded
+pwsx3354 power 0.0196 0.5 -> 0.140 Inexact Rounded
+pwsx3355 power 0.197 0.5 -> 0.444 Inexact Rounded
+pwsx3356 power 0.0197 0.5 -> 0.140 Inexact Rounded
+pwsx3357 power 0.198 0.5 -> 0.445 Inexact Rounded
+pwsx3358 power 0.0198 0.5 -> 0.141 Inexact Rounded
+pwsx3359 power 0.199 0.5 -> 0.446 Inexact Rounded
+pwsx3360 power 0.0199 0.5 -> 0.141 Inexact Rounded
+pwsx3361 power 0.201 0.5 -> 0.448 Inexact Rounded
+pwsx3362 power 0.0201 0.5 -> 0.142 Inexact Rounded
+pwsx3363 power 0.202 0.5 -> 0.449 Inexact Rounded
+pwsx3364 power 0.0202 0.5 -> 0.142 Inexact Rounded
+pwsx3365 power 0.203 0.5 -> 0.451 Inexact Rounded
+pwsx3366 power 0.0203 0.5 -> 0.142 Inexact Rounded
+pwsx3367 power 0.204 0.5 -> 0.452 Inexact Rounded
+pwsx3368 power 0.0204 0.5 -> 0.143 Inexact Rounded
+pwsx3369 power 0.205 0.5 -> 0.453 Inexact Rounded
+pwsx3370 power 0.0205 0.5 -> 0.143 Inexact Rounded
+pwsx3371 power 0.206 0.5 -> 0.454 Inexact Rounded
+pwsx3372 power 0.0206 0.5 -> 0.144 Inexact Rounded
+pwsx3373 power 0.207 0.5 -> 0.455 Inexact Rounded
+pwsx3374 power 0.0207 0.5 -> 0.144 Inexact Rounded
+pwsx3375 power 0.208 0.5 -> 0.456 Inexact Rounded
+pwsx3376 power 0.0208 0.5 -> 0.144 Inexact Rounded
+pwsx3377 power 0.209 0.5 -> 0.457 Inexact Rounded
+pwsx3378 power 0.0209 0.5 -> 0.145 Inexact Rounded
+pwsx3379 power 0.211 0.5 -> 0.459 Inexact Rounded
+pwsx3380 power 0.0211 0.5 -> 0.145 Inexact Rounded
+pwsx3381 power 0.212 0.5 -> 0.460 Inexact Rounded
+pwsx3382 power 0.0212 0.5 -> 0.146 Inexact Rounded
+pwsx3383 power 0.213 0.5 -> 0.462 Inexact Rounded
+pwsx3384 power 0.0213 0.5 -> 0.146 Inexact Rounded
+pwsx3385 power 0.214 0.5 -> 0.463 Inexact Rounded
+pwsx3386 power 0.0214 0.5 -> 0.146 Inexact Rounded
+pwsx3387 power 0.215 0.5 -> 0.464 Inexact Rounded
+pwsx3388 power 0.0215 0.5 -> 0.147 Inexact Rounded
+pwsx3389 power 0.216 0.5 -> 0.465 Inexact Rounded
+pwsx3390 power 0.0216 0.5 -> 0.147 Inexact Rounded
+pwsx3391 power 0.217 0.5 -> 0.466 Inexact Rounded
+pwsx3392 power 0.0217 0.5 -> 0.147 Inexact Rounded
+pwsx3393 power 0.218 0.5 -> 0.467 Inexact Rounded
+pwsx3394 power 0.0218 0.5 -> 0.148 Inexact Rounded
+pwsx3395 power 0.219 0.5 -> 0.468 Inexact Rounded
+pwsx3396 power 0.0219 0.5 -> 0.148 Inexact Rounded
+pwsx3397 power 0.221 0.5 -> 0.470 Inexact Rounded
+pwsx3398 power 0.0221 0.5 -> 0.149 Inexact Rounded
+pwsx3399 power 0.222 0.5 -> 0.471 Inexact Rounded
+pwsx3400 power 0.0222 0.5 -> 0.149 Inexact Rounded
+pwsx3401 power 0.223 0.5 -> 0.472 Inexact Rounded
+pwsx3402 power 0.0223 0.5 -> 0.149 Inexact Rounded
+pwsx3403 power 0.224 0.5 -> 0.473 Inexact Rounded
+pwsx3404 power 0.0224 0.5 -> 0.150 Inexact Rounded
+pwsx3405 power 0.225 0.5 -> 0.474 Inexact Rounded
+pwsx3406 power 0.0225 0.5 -> 0.150 Inexact Rounded
+pwsx3407 power 0.226 0.5 -> 0.475 Inexact Rounded
+pwsx3408 power 0.0226 0.5 -> 0.150 Inexact Rounded
+pwsx3409 power 0.227 0.5 -> 0.476 Inexact Rounded
+pwsx3410 power 0.0227 0.5 -> 0.151 Inexact Rounded
+pwsx3411 power 0.228 0.5 -> 0.477 Inexact Rounded
+pwsx3412 power 0.0228 0.5 -> 0.151 Inexact Rounded
+pwsx3413 power 0.229 0.5 -> 0.479 Inexact Rounded
+pwsx3414 power 0.0229 0.5 -> 0.151 Inexact Rounded
+pwsx3415 power 0.231 0.5 -> 0.481 Inexact Rounded
+pwsx3416 power 0.0231 0.5 -> 0.152 Inexact Rounded
+pwsx3417 power 0.232 0.5 -> 0.482 Inexact Rounded
+pwsx3418 power 0.0232 0.5 -> 0.152 Inexact Rounded
+pwsx3419 power 0.233 0.5 -> 0.483 Inexact Rounded
+pwsx3420 power 0.0233 0.5 -> 0.153 Inexact Rounded
+pwsx3421 power 0.234 0.5 -> 0.484 Inexact Rounded
+pwsx3422 power 0.0234 0.5 -> 0.153 Inexact Rounded
+pwsx3423 power 0.235 0.5 -> 0.485 Inexact Rounded
+pwsx3424 power 0.0235 0.5 -> 0.153 Inexact Rounded
+pwsx3425 power 0.236 0.5 -> 0.486 Inexact Rounded
+pwsx3426 power 0.0236 0.5 -> 0.154 Inexact Rounded
+pwsx3427 power 0.237 0.5 -> 0.487 Inexact Rounded
+pwsx3428 power 0.0237 0.5 -> 0.154 Inexact Rounded
+pwsx3429 power 0.238 0.5 -> 0.488 Inexact Rounded
+pwsx3430 power 0.0238 0.5 -> 0.154 Inexact Rounded
+pwsx3431 power 0.239 0.5 -> 0.489 Inexact Rounded
+pwsx3432 power 0.0239 0.5 -> 0.155 Inexact Rounded
+pwsx3433 power 0.241 0.5 -> 0.491 Inexact Rounded
+pwsx3434 power 0.0241 0.5 -> 0.155 Inexact Rounded
+pwsx3435 power 0.242 0.5 -> 0.492 Inexact Rounded
+pwsx3436 power 0.0242 0.5 -> 0.156 Inexact Rounded
+pwsx3437 power 0.243 0.5 -> 0.493 Inexact Rounded
+pwsx3438 power 0.0243 0.5 -> 0.156 Inexact Rounded
+pwsx3439 power 0.244 0.5 -> 0.494 Inexact Rounded
+pwsx3440 power 0.0244 0.5 -> 0.156 Inexact Rounded
+pwsx3441 power 0.245 0.5 -> 0.495 Inexact Rounded
+pwsx3442 power 0.0245 0.5 -> 0.157 Inexact Rounded
+pwsx3443 power 0.246 0.5 -> 0.496 Inexact Rounded
+pwsx3444 power 0.0246 0.5 -> 0.157 Inexact Rounded
+pwsx3445 power 0.247 0.5 -> 0.497 Inexact Rounded
+pwsx3446 power 0.0247 0.5 -> 0.157 Inexact Rounded
+pwsx3447 power 0.248 0.5 -> 0.498 Inexact Rounded
+pwsx3448 power 0.0248 0.5 -> 0.157 Inexact Rounded
+pwsx3449 power 0.249 0.5 -> 0.499 Inexact Rounded
+pwsx3450 power 0.0249 0.5 -> 0.158 Inexact Rounded
+pwsx3451 power 0.251 0.5 -> 0.501 Inexact Rounded
+pwsx3452 power 0.0251 0.5 -> 0.158 Inexact Rounded
+pwsx3453 power 0.252 0.5 -> 0.502 Inexact Rounded
+pwsx3454 power 0.0252 0.5 -> 0.159 Inexact Rounded
+pwsx3455 power 0.253 0.5 -> 0.503 Inexact Rounded
+pwsx3456 power 0.0253 0.5 -> 0.159 Inexact Rounded
+pwsx3457 power 0.254 0.5 -> 0.504 Inexact Rounded
+pwsx3458 power 0.0254 0.5 -> 0.159 Inexact Rounded
+pwsx3459 power 0.255 0.5 -> 0.505 Inexact Rounded
+pwsx3460 power 0.0255 0.5 -> 0.160 Inexact Rounded
+pwsx3461 power 0.256 0.5 -> 0.506 Inexact Rounded
+pwsx3462 power 0.0256 0.5 -> 0.160 Inexact Rounded
+pwsx3463 power 0.257 0.5 -> 0.507 Inexact Rounded
+pwsx3464 power 0.0257 0.5 -> 0.160 Inexact Rounded
+pwsx3465 power 0.258 0.5 -> 0.508 Inexact Rounded
+pwsx3466 power 0.0258 0.5 -> 0.161 Inexact Rounded
+pwsx3467 power 0.259 0.5 -> 0.509 Inexact Rounded
+pwsx3468 power 0.0259 0.5 -> 0.161 Inexact Rounded
+pwsx3469 power 0.261 0.5 -> 0.511 Inexact Rounded
+pwsx3470 power 0.0261 0.5 -> 0.162 Inexact Rounded
+pwsx3471 power 0.262 0.5 -> 0.512 Inexact Rounded
+pwsx3472 power 0.0262 0.5 -> 0.162 Inexact Rounded
+pwsx3473 power 0.263 0.5 -> 0.513 Inexact Rounded
+pwsx3474 power 0.0263 0.5 -> 0.162 Inexact Rounded
+pwsx3475 power 0.264 0.5 -> 0.514 Inexact Rounded
+pwsx3476 power 0.0264 0.5 -> 0.162 Inexact Rounded
+pwsx3477 power 0.265 0.5 -> 0.515 Inexact Rounded
+pwsx3478 power 0.0265 0.5 -> 0.163 Inexact Rounded
+pwsx3479 power 0.266 0.5 -> 0.516 Inexact Rounded
+pwsx3480 power 0.0266 0.5 -> 0.163 Inexact Rounded
+pwsx3481 power 0.267 0.5 -> 0.517 Inexact Rounded
+pwsx3482 power 0.0267 0.5 -> 0.163 Inexact Rounded
+pwsx3483 power 0.268 0.5 -> 0.518 Inexact Rounded
+pwsx3484 power 0.0268 0.5 -> 0.164 Inexact Rounded
+pwsx3485 power 0.269 0.5 -> 0.519 Inexact Rounded
+pwsx3486 power 0.0269 0.5 -> 0.164 Inexact Rounded
+pwsx3487 power 0.271 0.5 -> 0.521 Inexact Rounded
+pwsx3488 power 0.0271 0.5 -> 0.165 Inexact Rounded
+pwsx3489 power 0.272 0.5 -> 0.522 Inexact Rounded
+pwsx3490 power 0.0272 0.5 -> 0.165 Inexact Rounded
+pwsx3491 power 0.273 0.5 -> 0.522 Inexact Rounded
+pwsx3492 power 0.0273 0.5 -> 0.165 Inexact Rounded
+pwsx3493 power 0.274 0.5 -> 0.523 Inexact Rounded
+pwsx3494 power 0.0274 0.5 -> 0.166 Inexact Rounded
+pwsx3495 power 0.275 0.5 -> 0.524 Inexact Rounded
+pwsx3496 power 0.0275 0.5 -> 0.166 Inexact Rounded
+pwsx3497 power 0.276 0.5 -> 0.525 Inexact Rounded
+pwsx3498 power 0.0276 0.5 -> 0.166 Inexact Rounded
+pwsx3499 power 0.277 0.5 -> 0.526 Inexact Rounded
+pwsx3500 power 0.0277 0.5 -> 0.166 Inexact Rounded
+pwsx3501 power 0.278 0.5 -> 0.527 Inexact Rounded
+pwsx3502 power 0.0278 0.5 -> 0.167 Inexact Rounded
+pwsx3503 power 0.279 0.5 -> 0.528 Inexact Rounded
+pwsx3504 power 0.0279 0.5 -> 0.167 Inexact Rounded
+pwsx3505 power 0.281 0.5 -> 0.530 Inexact Rounded
+pwsx3506 power 0.0281 0.5 -> 0.168 Inexact Rounded
+pwsx3507 power 0.282 0.5 -> 0.531 Inexact Rounded
+pwsx3508 power 0.0282 0.5 -> 0.168 Inexact Rounded
+pwsx3509 power 0.283 0.5 -> 0.532 Inexact Rounded
+pwsx3510 power 0.0283 0.5 -> 0.168 Inexact Rounded
+pwsx3511 power 0.284 0.5 -> 0.533 Inexact Rounded
+pwsx3512 power 0.0284 0.5 -> 0.169 Inexact Rounded
+pwsx3513 power 0.285 0.5 -> 0.534 Inexact Rounded
+pwsx3514 power 0.0285 0.5 -> 0.169 Inexact Rounded
+pwsx3515 power 0.286 0.5 -> 0.535 Inexact Rounded
+pwsx3516 power 0.0286 0.5 -> 0.169 Inexact Rounded
+pwsx3517 power 0.287 0.5 -> 0.536 Inexact Rounded
+pwsx3518 power 0.0287 0.5 -> 0.169 Inexact Rounded
+pwsx3519 power 0.288 0.5 -> 0.537 Inexact Rounded
+pwsx3520 power 0.0288 0.5 -> 0.170 Inexact Rounded
+pwsx3521 power 0.289 0.5 -> 0.538 Inexact Rounded
+pwsx3522 power 0.0289 0.5 -> 0.170 Inexact Rounded
+pwsx3523 power 0.291 0.5 -> 0.539 Inexact Rounded
+pwsx3524 power 0.0291 0.5 -> 0.171 Inexact Rounded
+pwsx3525 power 0.292 0.5 -> 0.540 Inexact Rounded
+pwsx3526 power 0.0292 0.5 -> 0.171 Inexact Rounded
+pwsx3527 power 0.293 0.5 -> 0.541 Inexact Rounded
+pwsx3528 power 0.0293 0.5 -> 0.171 Inexact Rounded
+pwsx3529 power 0.294 0.5 -> 0.542 Inexact Rounded
+pwsx3530 power 0.0294 0.5 -> 0.171 Inexact Rounded
+pwsx3531 power 0.295 0.5 -> 0.543 Inexact Rounded
+pwsx3532 power 0.0295 0.5 -> 0.172 Inexact Rounded
+pwsx3533 power 0.296 0.5 -> 0.544 Inexact Rounded
+pwsx3534 power 0.0296 0.5 -> 0.172 Inexact Rounded
+pwsx3535 power 0.297 0.5 -> 0.545 Inexact Rounded
+pwsx3536 power 0.0297 0.5 -> 0.172 Inexact Rounded
+pwsx3537 power 0.298 0.5 -> 0.546 Inexact Rounded
+pwsx3538 power 0.0298 0.5 -> 0.173 Inexact Rounded
+pwsx3539 power 0.299 0.5 -> 0.547 Inexact Rounded
+pwsx3540 power 0.0299 0.5 -> 0.173 Inexact Rounded
+pwsx3541 power 0.301 0.5 -> 0.549 Inexact Rounded
+pwsx3542 power 0.0301 0.5 -> 0.173 Inexact Rounded
+pwsx3543 power 0.302 0.5 -> 0.550 Inexact Rounded
+pwsx3544 power 0.0302 0.5 -> 0.174 Inexact Rounded
+pwsx3545 power 0.303 0.5 -> 0.550 Inexact Rounded
+pwsx3546 power 0.0303 0.5 -> 0.174 Inexact Rounded
+pwsx3547 power 0.304 0.5 -> 0.551 Inexact Rounded
+pwsx3548 power 0.0304 0.5 -> 0.174 Inexact Rounded
+pwsx3549 power 0.305 0.5 -> 0.552 Inexact Rounded
+pwsx3550 power 0.0305 0.5 -> 0.175 Inexact Rounded
+pwsx3551 power 0.306 0.5 -> 0.553 Inexact Rounded
+pwsx3552 power 0.0306 0.5 -> 0.175 Inexact Rounded
+pwsx3553 power 0.307 0.5 -> 0.554 Inexact Rounded
+pwsx3554 power 0.0307 0.5 -> 0.175 Inexact Rounded
+pwsx3555 power 0.308 0.5 -> 0.555 Inexact Rounded
+pwsx3556 power 0.0308 0.5 -> 0.175 Inexact Rounded
+pwsx3557 power 0.309 0.5 -> 0.556 Inexact Rounded
+pwsx3558 power 0.0309 0.5 -> 0.176 Inexact Rounded
+pwsx3559 power 0.311 0.5 -> 0.558 Inexact Rounded
+pwsx3560 power 0.0311 0.5 -> 0.176 Inexact Rounded
+pwsx3561 power 0.312 0.5 -> 0.559 Inexact Rounded
+pwsx3562 power 0.0312 0.5 -> 0.177 Inexact Rounded
+pwsx3563 power 0.313 0.5 -> 0.559 Inexact Rounded
+pwsx3564 power 0.0313 0.5 -> 0.177 Inexact Rounded
+pwsx3565 power 0.314 0.5 -> 0.560 Inexact Rounded
+pwsx3566 power 0.0314 0.5 -> 0.177 Inexact Rounded
+pwsx3567 power 0.315 0.5 -> 0.561 Inexact Rounded
+pwsx3568 power 0.0315 0.5 -> 0.177 Inexact Rounded
+pwsx3569 power 0.316 0.5 -> 0.562 Inexact Rounded
+pwsx3570 power 0.0316 0.5 -> 0.178 Inexact Rounded
+pwsx3571 power 0.317 0.5 -> 0.563 Inexact Rounded
+pwsx3572 power 0.0317 0.5 -> 0.178 Inexact Rounded
+pwsx3573 power 0.318 0.5 -> 0.564 Inexact Rounded
+pwsx3574 power 0.0318 0.5 -> 0.178 Inexact Rounded
+pwsx3575 power 0.319 0.5 -> 0.565 Inexact Rounded
+pwsx3576 power 0.0319 0.5 -> 0.179 Inexact Rounded
+pwsx3577 power 0.321 0.5 -> 0.567 Inexact Rounded
+pwsx3578 power 0.0321 0.5 -> 0.179 Inexact Rounded
+pwsx3579 power 0.322 0.5 -> 0.567 Inexact Rounded
+pwsx3580 power 0.0322 0.5 -> 0.179 Inexact Rounded
+pwsx3581 power 0.323 0.5 -> 0.568 Inexact Rounded
+pwsx3582 power 0.0323 0.5 -> 0.180 Inexact Rounded
+pwsx3583 power 0.324 0.5 -> 0.569 Inexact Rounded
+pwsx3584 power 0.0324 0.5 -> 0.180 Inexact Rounded
+pwsx3585 power 0.325 0.5 -> 0.570 Inexact Rounded
+pwsx3586 power 0.0325 0.5 -> 0.180 Inexact Rounded
+pwsx3587 power 0.326 0.5 -> 0.571 Inexact Rounded
+pwsx3588 power 0.0326 0.5 -> 0.181 Inexact Rounded
+pwsx3589 power 0.327 0.5 -> 0.572 Inexact Rounded
+pwsx3590 power 0.0327 0.5 -> 0.181 Inexact Rounded
+pwsx3591 power 0.328 0.5 -> 0.573 Inexact Rounded
+pwsx3592 power 0.0328 0.5 -> 0.181 Inexact Rounded
+pwsx3593 power 0.329 0.5 -> 0.574 Inexact Rounded
+pwsx3594 power 0.0329 0.5 -> 0.181 Inexact Rounded
+pwsx3595 power 0.331 0.5 -> 0.575 Inexact Rounded
+pwsx3596 power 0.0331 0.5 -> 0.182 Inexact Rounded
+pwsx3597 power 0.332 0.5 -> 0.576 Inexact Rounded
+pwsx3598 power 0.0332 0.5 -> 0.182 Inexact Rounded
+pwsx3599 power 0.333 0.5 -> 0.577 Inexact Rounded
+pwsx3600 power 0.0333 0.5 -> 0.182 Inexact Rounded
+pwsx3601 power 0.334 0.5 -> 0.578 Inexact Rounded
+pwsx3602 power 0.0334 0.5 -> 0.183 Inexact Rounded
+pwsx3603 power 0.335 0.5 -> 0.579 Inexact Rounded
+pwsx3604 power 0.0335 0.5 -> 0.183 Inexact Rounded
+pwsx3605 power 0.336 0.5 -> 0.580 Inexact Rounded
+pwsx3606 power 0.0336 0.5 -> 0.183 Inexact Rounded
+pwsx3607 power 0.337 0.5 -> 0.581 Inexact Rounded
+pwsx3608 power 0.0337 0.5 -> 0.184 Inexact Rounded
+pwsx3609 power 0.338 0.5 -> 0.581 Inexact Rounded
+pwsx3610 power 0.0338 0.5 -> 0.184 Inexact Rounded
+pwsx3611 power 0.339 0.5 -> 0.582 Inexact Rounded
+pwsx3612 power 0.0339 0.5 -> 0.184 Inexact Rounded
+pwsx3613 power 0.341 0.5 -> 0.584 Inexact Rounded
+pwsx3614 power 0.0341 0.5 -> 0.185 Inexact Rounded
+pwsx3615 power 0.342 0.5 -> 0.585 Inexact Rounded
+pwsx3616 power 0.0342 0.5 -> 0.185 Inexact Rounded
+pwsx3617 power 0.343 0.5 -> 0.586 Inexact Rounded
+pwsx3618 power 0.0343 0.5 -> 0.185 Inexact Rounded
+pwsx3619 power 0.344 0.5 -> 0.587 Inexact Rounded
+pwsx3620 power 0.0344 0.5 -> 0.185 Inexact Rounded
+pwsx3621 power 0.345 0.5 -> 0.587 Inexact Rounded
+pwsx3622 power 0.0345 0.5 -> 0.186 Inexact Rounded
+pwsx3623 power 0.346 0.5 -> 0.588 Inexact Rounded
+pwsx3624 power 0.0346 0.5 -> 0.186 Inexact Rounded
+pwsx3625 power 0.347 0.5 -> 0.589 Inexact Rounded
+pwsx3626 power 0.0347 0.5 -> 0.186 Inexact Rounded
+pwsx3627 power 0.348 0.5 -> 0.590 Inexact Rounded
+pwsx3628 power 0.0348 0.5 -> 0.187 Inexact Rounded
+pwsx3629 power 0.349 0.5 -> 0.591 Inexact Rounded
+pwsx3630 power 0.0349 0.5 -> 0.187 Inexact Rounded
+pwsx3631 power 0.351 0.5 -> 0.592 Inexact Rounded
+pwsx3632 power 0.0351 0.5 -> 0.187 Inexact Rounded
+pwsx3633 power 0.352 0.5 -> 0.593 Inexact Rounded
+pwsx3634 power 0.0352 0.5 -> 0.188 Inexact Rounded
+pwsx3635 power 0.353 0.5 -> 0.594 Inexact Rounded
+pwsx3636 power 0.0353 0.5 -> 0.188 Inexact Rounded
+pwsx3637 power 0.354 0.5 -> 0.595 Inexact Rounded
+pwsx3638 power 0.0354 0.5 -> 0.188 Inexact Rounded
+pwsx3639 power 0.355 0.5 -> 0.596 Inexact Rounded
+pwsx3640 power 0.0355 0.5 -> 0.188 Inexact Rounded
+pwsx3641 power 0.356 0.5 -> 0.597 Inexact Rounded
+pwsx3642 power 0.0356 0.5 -> 0.189 Inexact Rounded
+pwsx3643 power 0.357 0.5 -> 0.597 Inexact Rounded
+pwsx3644 power 0.0357 0.5 -> 0.189 Inexact Rounded
+pwsx3645 power 0.358 0.5 -> 0.598 Inexact Rounded
+pwsx3646 power 0.0358 0.5 -> 0.189 Inexact Rounded
+pwsx3647 power 0.359 0.5 -> 0.599 Inexact Rounded
+pwsx3648 power 0.0359 0.5 -> 0.189 Inexact Rounded
+pwsx3649 power 0.361 0.5 -> 0.601 Inexact Rounded
+pwsx3650 power 0.0361 0.5 -> 0.190 Inexact Rounded
+pwsx3651 power 0.362 0.5 -> 0.602 Inexact Rounded
+pwsx3652 power 0.0362 0.5 -> 0.190 Inexact Rounded
+pwsx3653 power 0.363 0.5 -> 0.602 Inexact Rounded
+pwsx3654 power 0.0363 0.5 -> 0.191 Inexact Rounded
+pwsx3655 power 0.364 0.5 -> 0.603 Inexact Rounded
+pwsx3656 power 0.0364 0.5 -> 0.191 Inexact Rounded
+pwsx3657 power 0.365 0.5 -> 0.604 Inexact Rounded
+pwsx3658 power 0.0365 0.5 -> 0.191 Inexact Rounded
+pwsx3659 power 0.366 0.5 -> 0.605 Inexact Rounded
+pwsx3660 power 0.0366 0.5 -> 0.191 Inexact Rounded
+pwsx3661 power 0.367 0.5 -> 0.606 Inexact Rounded
+pwsx3662 power 0.0367 0.5 -> 0.192 Inexact Rounded
+pwsx3663 power 0.368 0.5 -> 0.607 Inexact Rounded
+pwsx3664 power 0.0368 0.5 -> 0.192 Inexact Rounded
+pwsx3665 power 0.369 0.5 -> 0.607 Inexact Rounded
+pwsx3666 power 0.0369 0.5 -> 0.192 Inexact Rounded
+pwsx3667 power 0.371 0.5 -> 0.609 Inexact Rounded
+pwsx3668 power 0.0371 0.5 -> 0.193 Inexact Rounded
+pwsx3669 power 0.372 0.5 -> 0.610 Inexact Rounded
+pwsx3670 power 0.0372 0.5 -> 0.193 Inexact Rounded
+pwsx3671 power 0.373 0.5 -> 0.611 Inexact Rounded
+pwsx3672 power 0.0373 0.5 -> 0.193 Inexact Rounded
+pwsx3673 power 0.374 0.5 -> 0.612 Inexact Rounded
+pwsx3674 power 0.0374 0.5 -> 0.193 Inexact Rounded
+pwsx3675 power 0.375 0.5 -> 0.612 Inexact Rounded
+pwsx3676 power 0.0375 0.5 -> 0.194 Inexact Rounded
+pwsx3677 power 0.376 0.5 -> 0.613 Inexact Rounded
+pwsx3678 power 0.0376 0.5 -> 0.194 Inexact Rounded
+pwsx3679 power 0.377 0.5 -> 0.614 Inexact Rounded
+pwsx3680 power 0.0377 0.5 -> 0.194 Inexact Rounded
+pwsx3681 power 0.378 0.5 -> 0.615 Inexact Rounded
+pwsx3682 power 0.0378 0.5 -> 0.194 Inexact Rounded
+pwsx3683 power 0.379 0.5 -> 0.616 Inexact Rounded
+pwsx3684 power 0.0379 0.5 -> 0.195 Inexact Rounded
+pwsx3685 power 0.381 0.5 -> 0.617 Inexact Rounded
+pwsx3686 power 0.0381 0.5 -> 0.195 Inexact Rounded
+pwsx3687 power 0.382 0.5 -> 0.618 Inexact Rounded
+pwsx3688 power 0.0382 0.5 -> 0.195 Inexact Rounded
+pwsx3689 power 0.383 0.5 -> 0.619 Inexact Rounded
+pwsx3690 power 0.0383 0.5 -> 0.196 Inexact Rounded
+pwsx3691 power 0.384 0.5 -> 0.620 Inexact Rounded
+pwsx3692 power 0.0384 0.5 -> 0.196 Inexact Rounded
+pwsx3693 power 0.385 0.5 -> 0.620 Inexact Rounded
+pwsx3694 power 0.0385 0.5 -> 0.196 Inexact Rounded
+pwsx3695 power 0.386 0.5 -> 0.621 Inexact Rounded
+pwsx3696 power 0.0386 0.5 -> 0.196 Inexact Rounded
+pwsx3697 power 0.387 0.5 -> 0.622 Inexact Rounded
+pwsx3698 power 0.0387 0.5 -> 0.197 Inexact Rounded
+pwsx3699 power 0.388 0.5 -> 0.623 Inexact Rounded
+pwsx3700 power 0.0388 0.5 -> 0.197 Inexact Rounded
+pwsx3701 power 0.389 0.5 -> 0.624 Inexact Rounded
+pwsx3702 power 0.0389 0.5 -> 0.197 Inexact Rounded
+pwsx3703 power 0.391 0.5 -> 0.625 Inexact Rounded
+pwsx3704 power 0.0391 0.5 -> 0.198 Inexact Rounded
+pwsx3705 power 0.392 0.5 -> 0.626 Inexact Rounded
+pwsx3706 power 0.0392 0.5 -> 0.198 Inexact Rounded
+pwsx3707 power 0.393 0.5 -> 0.627 Inexact Rounded
+pwsx3708 power 0.0393 0.5 -> 0.198 Inexact Rounded
+pwsx3709 power 0.394 0.5 -> 0.628 Inexact Rounded
+pwsx3710 power 0.0394 0.5 -> 0.198 Inexact Rounded
+pwsx3711 power 0.395 0.5 -> 0.628 Inexact Rounded
+pwsx3712 power 0.0395 0.5 -> 0.199 Inexact Rounded
+pwsx3713 power 0.396 0.5 -> 0.629 Inexact Rounded
+pwsx3714 power 0.0396 0.5 -> 0.199 Inexact Rounded
+pwsx3715 power 0.397 0.5 -> 0.630 Inexact Rounded
+pwsx3716 power 0.0397 0.5 -> 0.199 Inexact Rounded
+pwsx3717 power 0.398 0.5 -> 0.631 Inexact Rounded
+pwsx3718 power 0.0398 0.5 -> 0.199 Inexact Rounded
+pwsx3719 power 0.399 0.5 -> 0.632 Inexact Rounded
+pwsx3720 power 0.0399 0.5 -> 0.200 Inexact Rounded
+pwsx3721 power 0.401 0.5 -> 0.633 Inexact Rounded
+pwsx3722 power 0.0401 0.5 -> 0.200 Inexact Rounded
+pwsx3723 power 0.402 0.5 -> 0.634 Inexact Rounded
+pwsx3724 power 0.0402 0.5 -> 0.200 Inexact Rounded
+pwsx3725 power 0.403 0.5 -> 0.635 Inexact Rounded
+pwsx3726 power 0.0403 0.5 -> 0.201 Inexact Rounded
+pwsx3727 power 0.404 0.5 -> 0.636 Inexact Rounded
+pwsx3728 power 0.0404 0.5 -> 0.201 Inexact Rounded
+pwsx3729 power 0.405 0.5 -> 0.636 Inexact Rounded
+pwsx3730 power 0.0405 0.5 -> 0.201 Inexact Rounded
+pwsx3731 power 0.406 0.5 -> 0.637 Inexact Rounded
+pwsx3732 power 0.0406 0.5 -> 0.201 Inexact Rounded
+pwsx3733 power 0.407 0.5 -> 0.638 Inexact Rounded
+pwsx3734 power 0.0407 0.5 -> 0.202 Inexact Rounded
+pwsx3735 power 0.408 0.5 -> 0.639 Inexact Rounded
+pwsx3736 power 0.0408 0.5 -> 0.202 Inexact Rounded
+pwsx3737 power 0.409 0.5 -> 0.640 Inexact Rounded
+pwsx3738 power 0.0409 0.5 -> 0.202 Inexact Rounded
+pwsx3739 power 0.411 0.5 -> 0.641 Inexact Rounded
+pwsx3740 power 0.0411 0.5 -> 0.203 Inexact Rounded
+pwsx3741 power 0.412 0.5 -> 0.642 Inexact Rounded
+pwsx3742 power 0.0412 0.5 -> 0.203 Inexact Rounded
+pwsx3743 power 0.413 0.5 -> 0.643 Inexact Rounded
+pwsx3744 power 0.0413 0.5 -> 0.203 Inexact Rounded
+pwsx3745 power 0.414 0.5 -> 0.643 Inexact Rounded
+pwsx3746 power 0.0414 0.5 -> 0.203 Inexact Rounded
+pwsx3747 power 0.415 0.5 -> 0.644 Inexact Rounded
+pwsx3748 power 0.0415 0.5 -> 0.204 Inexact Rounded
+pwsx3749 power 0.416 0.5 -> 0.645 Inexact Rounded
+pwsx3750 power 0.0416 0.5 -> 0.204 Inexact Rounded
+pwsx3751 power 0.417 0.5 -> 0.646 Inexact Rounded
+pwsx3752 power 0.0417 0.5 -> 0.204 Inexact Rounded
+pwsx3753 power 0.418 0.5 -> 0.647 Inexact Rounded
+pwsx3754 power 0.0418 0.5 -> 0.204 Inexact Rounded
+pwsx3755 power 0.419 0.5 -> 0.647 Inexact Rounded
+pwsx3756 power 0.0419 0.5 -> 0.205 Inexact Rounded
+pwsx3757 power 0.421 0.5 -> 0.649 Inexact Rounded
+pwsx3758 power 0.0421 0.5 -> 0.205 Inexact Rounded
+pwsx3759 power 0.422 0.5 -> 0.650 Inexact Rounded
+pwsx3760 power 0.0422 0.5 -> 0.205 Inexact Rounded
+pwsx3761 power 0.423 0.5 -> 0.650 Inexact Rounded
+pwsx3762 power 0.0423 0.5 -> 0.206 Inexact Rounded
+pwsx3763 power 0.424 0.5 -> 0.651 Inexact Rounded
+pwsx3764 power 0.0424 0.5 -> 0.206 Inexact Rounded
+pwsx3765 power 0.425 0.5 -> 0.652 Inexact Rounded
+pwsx3766 power 0.0425 0.5 -> 0.206 Inexact Rounded
+pwsx3767 power 0.426 0.5 -> 0.653 Inexact Rounded
+pwsx3768 power 0.0426 0.5 -> 0.206 Inexact Rounded
+pwsx3769 power 0.427 0.5 -> 0.653 Inexact Rounded
+pwsx3770 power 0.0427 0.5 -> 0.207 Inexact Rounded
+pwsx3771 power 0.428 0.5 -> 0.654 Inexact Rounded
+pwsx3772 power 0.0428 0.5 -> 0.207 Inexact Rounded
+pwsx3773 power 0.429 0.5 -> 0.655 Inexact Rounded
+pwsx3774 power 0.0429 0.5 -> 0.207 Inexact Rounded
+pwsx3775 power 0.431 0.5 -> 0.657 Inexact Rounded
+pwsx3776 power 0.0431 0.5 -> 0.208 Inexact Rounded
+pwsx3777 power 0.432 0.5 -> 0.657 Inexact Rounded
+pwsx3778 power 0.0432 0.5 -> 0.208 Inexact Rounded
+pwsx3779 power 0.433 0.5 -> 0.658 Inexact Rounded
+pwsx3780 power 0.0433 0.5 -> 0.208 Inexact Rounded
+pwsx3781 power 0.434 0.5 -> 0.659 Inexact Rounded
+pwsx3782 power 0.0434 0.5 -> 0.208 Inexact Rounded
+pwsx3783 power 0.435 0.5 -> 0.660 Inexact Rounded
+pwsx3784 power 0.0435 0.5 -> 0.209 Inexact Rounded
+pwsx3785 power 0.436 0.5 -> 0.660 Inexact Rounded
+pwsx3786 power 0.0436 0.5 -> 0.209 Inexact Rounded
+pwsx3787 power 0.437 0.5 -> 0.661 Inexact Rounded
+pwsx3788 power 0.0437 0.5 -> 0.209 Inexact Rounded
+pwsx3789 power 0.438 0.5 -> 0.662 Inexact Rounded
+pwsx3790 power 0.0438 0.5 -> 0.209 Inexact Rounded
+pwsx3791 power 0.439 0.5 -> 0.663 Inexact Rounded
+pwsx3792 power 0.0439 0.5 -> 0.210 Inexact Rounded
+pwsx3793 power 0.441 0.5 -> 0.664 Inexact Rounded
+pwsx3794 power 0.0441 0.5 -> 0.210 Inexact Rounded
+pwsx3795 power 0.442 0.5 -> 0.665 Inexact Rounded
+pwsx3796 power 0.0442 0.5 -> 0.210 Inexact Rounded
+pwsx3797 power 0.443 0.5 -> 0.666 Inexact Rounded
+pwsx3798 power 0.0443 0.5 -> 0.210 Inexact Rounded
+pwsx3799 power 0.444 0.5 -> 0.666 Inexact Rounded
+pwsx3800 power 0.0444 0.5 -> 0.211 Inexact Rounded
+pwsx3801 power 0.445 0.5 -> 0.667 Inexact Rounded
+pwsx3802 power 0.0445 0.5 -> 0.211 Inexact Rounded
+pwsx3803 power 0.446 0.5 -> 0.668 Inexact Rounded
+pwsx3804 power 0.0446 0.5 -> 0.211 Inexact Rounded
+pwsx3805 power 0.447 0.5 -> 0.669 Inexact Rounded
+pwsx3806 power 0.0447 0.5 -> 0.211 Inexact Rounded
+pwsx3807 power 0.448 0.5 -> 0.669 Inexact Rounded
+pwsx3808 power 0.0448 0.5 -> 0.212 Inexact Rounded
+pwsx3809 power 0.449 0.5 -> 0.670 Inexact Rounded
+pwsx3810 power 0.0449 0.5 -> 0.212 Inexact Rounded
+pwsx3811 power 0.451 0.5 -> 0.672 Inexact Rounded
+pwsx3812 power 0.0451 0.5 -> 0.212 Inexact Rounded
+pwsx3813 power 0.452 0.5 -> 0.672 Inexact Rounded
+pwsx3814 power 0.0452 0.5 -> 0.213 Inexact Rounded
+pwsx3815 power 0.453 0.5 -> 0.673 Inexact Rounded
+pwsx3816 power 0.0453 0.5 -> 0.213 Inexact Rounded
+pwsx3817 power 0.454 0.5 -> 0.674 Inexact Rounded
+pwsx3818 power 0.0454 0.5 -> 0.213 Inexact Rounded
+pwsx3819 power 0.455 0.5 -> 0.675 Inexact Rounded
+pwsx3820 power 0.0455 0.5 -> 0.213 Inexact Rounded
+pwsx3821 power 0.456 0.5 -> 0.675 Inexact Rounded
+pwsx3822 power 0.0456 0.5 -> 0.214 Inexact Rounded
+pwsx3823 power 0.457 0.5 -> 0.676 Inexact Rounded
+pwsx3824 power 0.0457 0.5 -> 0.214 Inexact Rounded
+pwsx3825 power 0.458 0.5 -> 0.677 Inexact Rounded
+pwsx3826 power 0.0458 0.5 -> 0.214 Inexact Rounded
+pwsx3827 power 0.459 0.5 -> 0.677 Inexact Rounded
+pwsx3828 power 0.0459 0.5 -> 0.214 Inexact Rounded
+pwsx3829 power 0.461 0.5 -> 0.679 Inexact Rounded
+pwsx3830 power 0.0461 0.5 -> 0.215 Inexact Rounded
+pwsx3831 power 0.462 0.5 -> 0.680 Inexact Rounded
+pwsx3832 power 0.0462 0.5 -> 0.215 Inexact Rounded
+pwsx3833 power 0.463 0.5 -> 0.680 Inexact Rounded
+pwsx3834 power 0.0463 0.5 -> 0.215 Inexact Rounded
+pwsx3835 power 0.464 0.5 -> 0.681 Inexact Rounded
+pwsx3836 power 0.0464 0.5 -> 0.215 Inexact Rounded
+pwsx3837 power 0.465 0.5 -> 0.682 Inexact Rounded
+pwsx3838 power 0.0465 0.5 -> 0.216 Inexact Rounded
+pwsx3839 power 0.466 0.5 -> 0.683 Inexact Rounded
+pwsx3840 power 0.0466 0.5 -> 0.216 Inexact Rounded
+pwsx3841 power 0.467 0.5 -> 0.683 Inexact Rounded
+pwsx3842 power 0.0467 0.5 -> 0.216 Inexact Rounded
+pwsx3843 power 0.468 0.5 -> 0.684 Inexact Rounded
+pwsx3844 power 0.0468 0.5 -> 0.216 Inexact Rounded
+pwsx3845 power 0.469 0.5 -> 0.685 Inexact Rounded
+pwsx3846 power 0.0469 0.5 -> 0.217 Inexact Rounded
+pwsx3847 power 0.471 0.5 -> 0.686 Inexact Rounded
+pwsx3848 power 0.0471 0.5 -> 0.217 Inexact Rounded
+pwsx3849 power 0.472 0.5 -> 0.687 Inexact Rounded
+pwsx3850 power 0.0472 0.5 -> 0.217 Inexact Rounded
+pwsx3851 power 0.473 0.5 -> 0.688 Inexact Rounded
+pwsx3852 power 0.0473 0.5 -> 0.217 Inexact Rounded
+pwsx3853 power 0.474 0.5 -> 0.688 Inexact Rounded
+pwsx3854 power 0.0474 0.5 -> 0.218 Inexact Rounded
+pwsx3855 power 0.475 0.5 -> 0.689 Inexact Rounded
+pwsx3856 power 0.0475 0.5 -> 0.218 Inexact Rounded
+pwsx3857 power 0.476 0.5 -> 0.690 Inexact Rounded
+pwsx3858 power 0.0476 0.5 -> 0.218 Inexact Rounded
+pwsx3859 power 0.477 0.5 -> 0.691 Inexact Rounded
+pwsx3860 power 0.0477 0.5 -> 0.218 Inexact Rounded
+pwsx3861 power 0.478 0.5 -> 0.691 Inexact Rounded
+pwsx3862 power 0.0478 0.5 -> 0.219 Inexact Rounded
+pwsx3863 power 0.479 0.5 -> 0.692 Inexact Rounded
+pwsx3864 power 0.0479 0.5 -> 0.219 Inexact Rounded
+pwsx3865 power 0.481 0.5 -> 0.694 Inexact Rounded
+pwsx3866 power 0.0481 0.5 -> 0.219 Inexact Rounded
+pwsx3867 power 0.482 0.5 -> 0.694 Inexact Rounded
+pwsx3868 power 0.0482 0.5 -> 0.220 Inexact Rounded
+pwsx3869 power 0.483 0.5 -> 0.695 Inexact Rounded
+pwsx3870 power 0.0483 0.5 -> 0.220 Inexact Rounded
+pwsx3871 power 0.484 0.5 -> 0.696 Inexact Rounded
+pwsx3872 power 0.0484 0.5 -> 0.220 Inexact Rounded
+pwsx3873 power 0.485 0.5 -> 0.696 Inexact Rounded
+pwsx3874 power 0.0485 0.5 -> 0.220 Inexact Rounded
+pwsx3875 power 0.486 0.5 -> 0.697 Inexact Rounded
+pwsx3876 power 0.0486 0.5 -> 0.220 Inexact Rounded
+pwsx3877 power 0.487 0.5 -> 0.698 Inexact Rounded
+pwsx3878 power 0.0487 0.5 -> 0.221 Inexact Rounded
+pwsx3879 power 0.488 0.5 -> 0.699 Inexact Rounded
+pwsx3880 power 0.0488 0.5 -> 0.221 Inexact Rounded
+pwsx3881 power 0.489 0.5 -> 0.699 Inexact Rounded
+pwsx3882 power 0.0489 0.5 -> 0.221 Inexact Rounded
+pwsx3883 power 0.491 0.5 -> 0.701 Inexact Rounded
+pwsx3884 power 0.0491 0.5 -> 0.222 Inexact Rounded
+pwsx3885 power 0.492 0.5 -> 0.701 Inexact Rounded
+pwsx3886 power 0.0492 0.5 -> 0.222 Inexact Rounded
+pwsx3887 power 0.493 0.5 -> 0.702 Inexact Rounded
+pwsx3888 power 0.0493 0.5 -> 0.222 Inexact Rounded
+pwsx3889 power 0.494 0.5 -> 0.703 Inexact Rounded
+pwsx3890 power 0.0494 0.5 -> 0.222 Inexact Rounded
+pwsx3891 power 0.495 0.5 -> 0.704 Inexact Rounded
+pwsx3892 power 0.0495 0.5 -> 0.222 Inexact Rounded
+pwsx3893 power 0.496 0.5 -> 0.704 Inexact Rounded
+pwsx3894 power 0.0496 0.5 -> 0.223 Inexact Rounded
+pwsx3895 power 0.497 0.5 -> 0.705 Inexact Rounded
+pwsx3896 power 0.0497 0.5 -> 0.223 Inexact Rounded
+pwsx3897 power 0.498 0.5 -> 0.706 Inexact Rounded
+pwsx3898 power 0.0498 0.5 -> 0.223 Inexact Rounded
+pwsx3899 power 0.499 0.5 -> 0.706 Inexact Rounded
+pwsx3900 power 0.0499 0.5 -> 0.223 Inexact Rounded
+pwsx3901 power 0.501 0.5 -> 0.708 Inexact Rounded
+pwsx3902 power 0.0501 0.5 -> 0.224 Inexact Rounded
+pwsx3903 power 0.502 0.5 -> 0.709 Inexact Rounded
+pwsx3904 power 0.0502 0.5 -> 0.224 Inexact Rounded
+pwsx3905 power 0.503 0.5 -> 0.709 Inexact Rounded
+pwsx3906 power 0.0503 0.5 -> 0.224 Inexact Rounded
+pwsx3907 power 0.504 0.5 -> 0.710 Inexact Rounded
+pwsx3908 power 0.0504 0.5 -> 0.224 Inexact Rounded
+pwsx3909 power 0.505 0.5 -> 0.711 Inexact Rounded
+pwsx3910 power 0.0505 0.5 -> 0.225 Inexact Rounded
+pwsx3911 power 0.506 0.5 -> 0.711 Inexact Rounded
+pwsx3912 power 0.0506 0.5 -> 0.225 Inexact Rounded
+pwsx3913 power 0.507 0.5 -> 0.712 Inexact Rounded
+pwsx3914 power 0.0507 0.5 -> 0.225 Inexact Rounded
+pwsx3915 power 0.508 0.5 -> 0.713 Inexact Rounded
+pwsx3916 power 0.0508 0.5 -> 0.225 Inexact Rounded
+pwsx3917 power 0.509 0.5 -> 0.713 Inexact Rounded
+pwsx3918 power 0.0509 0.5 -> 0.226 Inexact Rounded
+pwsx3919 power 0.511 0.5 -> 0.715 Inexact Rounded
+pwsx3920 power 0.0511 0.5 -> 0.226 Inexact Rounded
+pwsx3921 power 0.512 0.5 -> 0.716 Inexact Rounded
+pwsx3922 power 0.0512 0.5 -> 0.226 Inexact Rounded
+pwsx3923 power 0.513 0.5 -> 0.716 Inexact Rounded
+pwsx3924 power 0.0513 0.5 -> 0.226 Inexact Rounded
+pwsx3925 power 0.514 0.5 -> 0.717 Inexact Rounded
+pwsx3926 power 0.0514 0.5 -> 0.227 Inexact Rounded
+pwsx3927 power 0.515 0.5 -> 0.718 Inexact Rounded
+pwsx3928 power 0.0515 0.5 -> 0.227 Inexact Rounded
+pwsx3929 power 0.516 0.5 -> 0.718 Inexact Rounded
+pwsx3930 power 0.0516 0.5 -> 0.227 Inexact Rounded
+pwsx3931 power 0.517 0.5 -> 0.719 Inexact Rounded
+pwsx3932 power 0.0517 0.5 -> 0.227 Inexact Rounded
+pwsx3933 power 0.518 0.5 -> 0.720 Inexact Rounded
+pwsx3934 power 0.0518 0.5 -> 0.228 Inexact Rounded
+pwsx3935 power 0.519 0.5 -> 0.720 Inexact Rounded
+pwsx3936 power 0.0519 0.5 -> 0.228 Inexact Rounded
+pwsx3937 power 0.521 0.5 -> 0.722 Inexact Rounded
+pwsx3938 power 0.0521 0.5 -> 0.228 Inexact Rounded
+pwsx3939 power 0.522 0.5 -> 0.722 Inexact Rounded
+pwsx3940 power 0.0522 0.5 -> 0.228 Inexact Rounded
+pwsx3941 power 0.523 0.5 -> 0.723 Inexact Rounded
+pwsx3942 power 0.0523 0.5 -> 0.229 Inexact Rounded
+pwsx3943 power 0.524 0.5 -> 0.724 Inexact Rounded
+pwsx3944 power 0.0524 0.5 -> 0.229 Inexact Rounded
+pwsx3945 power 0.525 0.5 -> 0.725 Inexact Rounded
+pwsx3946 power 0.0525 0.5 -> 0.229 Inexact Rounded
+pwsx3947 power 0.526 0.5 -> 0.725 Inexact Rounded
+pwsx3948 power 0.0526 0.5 -> 0.229 Inexact Rounded
+pwsx3949 power 0.527 0.5 -> 0.726 Inexact Rounded
+pwsx3950 power 0.0527 0.5 -> 0.230 Inexact Rounded
+pwsx3951 power 0.528 0.5 -> 0.727 Inexact Rounded
+pwsx3952 power 0.0528 0.5 -> 0.230 Inexact Rounded
+pwsx3953 power 0.529 0.5 -> 0.727 Inexact Rounded
+pwsx3954 power 0.0529 0.5 -> 0.230 Inexact Rounded
+pwsx3955 power 0.531 0.5 -> 0.729 Inexact Rounded
+pwsx3956 power 0.0531 0.5 -> 0.230 Inexact Rounded
+pwsx3957 power 0.532 0.5 -> 0.729 Inexact Rounded
+pwsx3958 power 0.0532 0.5 -> 0.231 Inexact Rounded
+pwsx3959 power 0.533 0.5 -> 0.730 Inexact Rounded
+pwsx3960 power 0.0533 0.5 -> 0.231 Inexact Rounded
+pwsx3961 power 0.534 0.5 -> 0.731 Inexact Rounded
+pwsx3962 power 0.0534 0.5 -> 0.231 Inexact Rounded
+pwsx3963 power 0.535 0.5 -> 0.731 Inexact Rounded
+pwsx3964 power 0.0535 0.5 -> 0.231 Inexact Rounded
+pwsx3965 power 0.536 0.5 -> 0.732 Inexact Rounded
+pwsx3966 power 0.0536 0.5 -> 0.232 Inexact Rounded
+pwsx3967 power 0.537 0.5 -> 0.733 Inexact Rounded
+pwsx3968 power 0.0537 0.5 -> 0.232 Inexact Rounded
+pwsx3969 power 0.538 0.5 -> 0.733 Inexact Rounded
+pwsx3970 power 0.0538 0.5 -> 0.232 Inexact Rounded
+pwsx3971 power 0.539 0.5 -> 0.734 Inexact Rounded
+pwsx3972 power 0.0539 0.5 -> 0.232 Inexact Rounded
+pwsx3973 power 0.541 0.5 -> 0.736 Inexact Rounded
+pwsx3974 power 0.0541 0.5 -> 0.233 Inexact Rounded
+pwsx3975 power 0.542 0.5 -> 0.736 Inexact Rounded
+pwsx3976 power 0.0542 0.5 -> 0.233 Inexact Rounded
+pwsx3977 power 0.543 0.5 -> 0.737 Inexact Rounded
+pwsx3978 power 0.0543 0.5 -> 0.233 Inexact Rounded
+pwsx3979 power 0.544 0.5 -> 0.738 Inexact Rounded
+pwsx3980 power 0.0544 0.5 -> 0.233 Inexact Rounded
+pwsx3981 power 0.545 0.5 -> 0.738 Inexact Rounded
+pwsx3982 power 0.0545 0.5 -> 0.233 Inexact Rounded
+pwsx3983 power 0.546 0.5 -> 0.739 Inexact Rounded
+pwsx3984 power 0.0546 0.5 -> 0.234 Inexact Rounded
+pwsx3985 power 0.547 0.5 -> 0.740 Inexact Rounded
+pwsx3986 power 0.0547 0.5 -> 0.234 Inexact Rounded
+pwsx3987 power 0.548 0.5 -> 0.740 Inexact Rounded
+pwsx3988 power 0.0548 0.5 -> 0.234 Inexact Rounded
+pwsx3989 power 0.549 0.5 -> 0.741 Inexact Rounded
+pwsx3990 power 0.0549 0.5 -> 0.234 Inexact Rounded
+pwsx3991 power 0.551 0.5 -> 0.742 Inexact Rounded
+pwsx3992 power 0.0551 0.5 -> 0.235 Inexact Rounded
+pwsx3993 power 0.552 0.5 -> 0.743 Inexact Rounded
+pwsx3994 power 0.0552 0.5 -> 0.235 Inexact Rounded
+pwsx3995 power 0.553 0.5 -> 0.744 Inexact Rounded
+pwsx3996 power 0.0553 0.5 -> 0.235 Inexact Rounded
+pwsx3997 power 0.554 0.5 -> 0.744 Inexact Rounded
+pwsx3998 power 0.0554 0.5 -> 0.235 Inexact Rounded
+pwsx3999 power 0.555 0.5 -> 0.745 Inexact Rounded
+pwsx4000 power 0.0555 0.5 -> 0.236 Inexact Rounded
+pwsx4001 power 0.556 0.5 -> 0.746 Inexact Rounded
+pwsx4002 power 0.0556 0.5 -> 0.236 Inexact Rounded
+pwsx4003 power 0.557 0.5 -> 0.746 Inexact Rounded
+pwsx4004 power 0.0557 0.5 -> 0.236 Inexact Rounded
+pwsx4005 power 0.558 0.5 -> 0.747 Inexact Rounded
+pwsx4006 power 0.0558 0.5 -> 0.236 Inexact Rounded
+pwsx4007 power 0.559 0.5 -> 0.748 Inexact Rounded
+pwsx4008 power 0.0559 0.5 -> 0.236 Inexact Rounded
+pwsx4009 power 0.561 0.5 -> 0.749 Inexact Rounded
+pwsx4010 power 0.0561 0.5 -> 0.237 Inexact Rounded
+pwsx4011 power 0.562 0.5 -> 0.750 Inexact Rounded
+pwsx4012 power 0.0562 0.5 -> 0.237 Inexact Rounded
+pwsx4013 power 0.563 0.5 -> 0.750 Inexact Rounded
+pwsx4014 power 0.0563 0.5 -> 0.237 Inexact Rounded
+pwsx4015 power 0.564 0.5 -> 0.751 Inexact Rounded
+pwsx4016 power 0.0564 0.5 -> 0.237 Inexact Rounded
+pwsx4017 power 0.565 0.5 -> 0.752 Inexact Rounded
+pwsx4018 power 0.0565 0.5 -> 0.238 Inexact Rounded
+pwsx4019 power 0.566 0.5 -> 0.752 Inexact Rounded
+pwsx4020 power 0.0566 0.5 -> 0.238 Inexact Rounded
+pwsx4021 power 0.567 0.5 -> 0.753 Inexact Rounded
+pwsx4022 power 0.0567 0.5 -> 0.238 Inexact Rounded
+pwsx4023 power 0.568 0.5 -> 0.754 Inexact Rounded
+pwsx4024 power 0.0568 0.5 -> 0.238 Inexact Rounded
+pwsx4025 power 0.569 0.5 -> 0.754 Inexact Rounded
+pwsx4026 power 0.0569 0.5 -> 0.239 Inexact Rounded
+pwsx4027 power 0.571 0.5 -> 0.756 Inexact Rounded
+pwsx4028 power 0.0571 0.5 -> 0.239 Inexact Rounded
+pwsx4029 power 0.572 0.5 -> 0.756 Inexact Rounded
+pwsx4030 power 0.0572 0.5 -> 0.239 Inexact Rounded
+pwsx4031 power 0.573 0.5 -> 0.757 Inexact Rounded
+pwsx4032 power 0.0573 0.5 -> 0.239 Inexact Rounded
+pwsx4033 power 0.574 0.5 -> 0.758 Inexact Rounded
+pwsx4034 power 0.0574 0.5 -> 0.240 Inexact Rounded
+pwsx4035 power 0.575 0.5 -> 0.758 Inexact Rounded
+pwsx4036 power 0.0575 0.5 -> 0.240 Inexact Rounded
+pwsx4037 power 0.576 0.5 -> 0.759 Inexact Rounded
+pwsx4038 power 0.0576 0.5 -> 0.240 Inexact Rounded
+pwsx4039 power 0.577 0.5 -> 0.760 Inexact Rounded
+pwsx4040 power 0.0577 0.5 -> 0.240 Inexact Rounded
+pwsx4041 power 0.578 0.5 -> 0.760 Inexact Rounded
+pwsx4042 power 0.0578 0.5 -> 0.240 Inexact Rounded
+pwsx4043 power 0.579 0.5 -> 0.761 Inexact Rounded
+pwsx4044 power 0.0579 0.5 -> 0.241 Inexact Rounded
+pwsx4045 power 0.581 0.5 -> 0.762 Inexact Rounded
+pwsx4046 power 0.0581 0.5 -> 0.241 Inexact Rounded
+pwsx4047 power 0.582 0.5 -> 0.763 Inexact Rounded
+pwsx4048 power 0.0582 0.5 -> 0.241 Inexact Rounded
+pwsx4049 power 0.583 0.5 -> 0.764 Inexact Rounded
+pwsx4050 power 0.0583 0.5 -> 0.241 Inexact Rounded
+pwsx4051 power 0.584 0.5 -> 0.764 Inexact Rounded
+pwsx4052 power 0.0584 0.5 -> 0.242 Inexact Rounded
+pwsx4053 power 0.585 0.5 -> 0.765 Inexact Rounded
+pwsx4054 power 0.0585 0.5 -> 0.242 Inexact Rounded
+pwsx4055 power 0.586 0.5 -> 0.766 Inexact Rounded
+pwsx4056 power 0.0586 0.5 -> 0.242 Inexact Rounded
+pwsx4057 power 0.587 0.5 -> 0.766 Inexact Rounded
+pwsx4058 power 0.0587 0.5 -> 0.242 Inexact Rounded
+pwsx4059 power 0.588 0.5 -> 0.767 Inexact Rounded
+pwsx4060 power 0.0588 0.5 -> 0.242 Inexact Rounded
+pwsx4061 power 0.589 0.5 -> 0.767 Inexact Rounded
+pwsx4062 power 0.0589 0.5 -> 0.243 Inexact Rounded
+pwsx4063 power 0.591 0.5 -> 0.769 Inexact Rounded
+pwsx4064 power 0.0591 0.5 -> 0.243 Inexact Rounded
+pwsx4065 power 0.592 0.5 -> 0.769 Inexact Rounded
+pwsx4066 power 0.0592 0.5 -> 0.243 Inexact Rounded
+pwsx4067 power 0.593 0.5 -> 0.770 Inexact Rounded
+pwsx4068 power 0.0593 0.5 -> 0.244 Inexact Rounded
+pwsx4069 power 0.594 0.5 -> 0.771 Inexact Rounded
+pwsx4070 power 0.0594 0.5 -> 0.244 Inexact Rounded
+pwsx4071 power 0.595 0.5 -> 0.771 Inexact Rounded
+pwsx4072 power 0.0595 0.5 -> 0.244 Inexact Rounded
+pwsx4073 power 0.596 0.5 -> 0.772 Inexact Rounded
+pwsx4074 power 0.0596 0.5 -> 0.244 Inexact Rounded
+pwsx4075 power 0.597 0.5 -> 0.773 Inexact Rounded
+pwsx4076 power 0.0597 0.5 -> 0.244 Inexact Rounded
+pwsx4077 power 0.598 0.5 -> 0.773 Inexact Rounded
+pwsx4078 power 0.0598 0.5 -> 0.245 Inexact Rounded
+pwsx4079 power 0.599 0.5 -> 0.774 Inexact Rounded
+pwsx4080 power 0.0599 0.5 -> 0.245 Inexact Rounded
+pwsx4081 power 0.601 0.5 -> 0.775 Inexact Rounded
+pwsx4082 power 0.0601 0.5 -> 0.245 Inexact Rounded
+pwsx4083 power 0.602 0.5 -> 0.776 Inexact Rounded
+pwsx4084 power 0.0602 0.5 -> 0.245 Inexact Rounded
+pwsx4085 power 0.603 0.5 -> 0.777 Inexact Rounded
+pwsx4086 power 0.0603 0.5 -> 0.246 Inexact Rounded
+pwsx4087 power 0.604 0.5 -> 0.777 Inexact Rounded
+pwsx4088 power 0.0604 0.5 -> 0.246 Inexact Rounded
+pwsx4089 power 0.605 0.5 -> 0.778 Inexact Rounded
+pwsx4090 power 0.0605 0.5 -> 0.246 Inexact Rounded
+pwsx4091 power 0.606 0.5 -> 0.778 Inexact Rounded
+pwsx4092 power 0.0606 0.5 -> 0.246 Inexact Rounded
+pwsx4093 power 0.607 0.5 -> 0.779 Inexact Rounded
+pwsx4094 power 0.0607 0.5 -> 0.246 Inexact Rounded
+pwsx4095 power 0.608 0.5 -> 0.780 Inexact Rounded
+pwsx4096 power 0.0608 0.5 -> 0.247 Inexact Rounded
+pwsx4097 power 0.609 0.5 -> 0.780 Inexact Rounded
+pwsx4098 power 0.0609 0.5 -> 0.247 Inexact Rounded
+pwsx4099 power 0.611 0.5 -> 0.782 Inexact Rounded
+pwsx4100 power 0.0611 0.5 -> 0.247 Inexact Rounded
+pwsx4101 power 0.612 0.5 -> 0.782 Inexact Rounded
+pwsx4102 power 0.0612 0.5 -> 0.247 Inexact Rounded
+pwsx4103 power 0.613 0.5 -> 0.783 Inexact Rounded
+pwsx4104 power 0.0613 0.5 -> 0.248 Inexact Rounded
+pwsx4105 power 0.614 0.5 -> 0.784 Inexact Rounded
+pwsx4106 power 0.0614 0.5 -> 0.248 Inexact Rounded
+pwsx4107 power 0.615 0.5 -> 0.784 Inexact Rounded
+pwsx4108 power 0.0615 0.5 -> 0.248 Inexact Rounded
+pwsx4109 power 0.616 0.5 -> 0.785 Inexact Rounded
+pwsx4110 power 0.0616 0.5 -> 0.248 Inexact Rounded
+pwsx4111 power 0.617 0.5 -> 0.785 Inexact Rounded
+pwsx4112 power 0.0617 0.5 -> 0.248 Inexact Rounded
+pwsx4113 power 0.618 0.5 -> 0.786 Inexact Rounded
+pwsx4114 power 0.0618 0.5 -> 0.249 Inexact Rounded
+pwsx4115 power 0.619 0.5 -> 0.787 Inexact Rounded
+pwsx4116 power 0.0619 0.5 -> 0.249 Inexact Rounded
+pwsx4117 power 0.621 0.5 -> 0.788 Inexact Rounded
+pwsx4118 power 0.0621 0.5 -> 0.249 Inexact Rounded
+pwsx4119 power 0.622 0.5 -> 0.789 Inexact Rounded
+pwsx4120 power 0.0622 0.5 -> 0.249 Inexact Rounded
+pwsx4121 power 0.623 0.5 -> 0.789 Inexact Rounded
+pwsx4122 power 0.0623 0.5 -> 0.250 Inexact Rounded
+pwsx4123 power 0.624 0.5 -> 0.790 Inexact Rounded
+pwsx4124 power 0.0624 0.5 -> 0.250 Inexact Rounded
+pwsx4125 power 0.625 0.5 -> 0.791 Inexact Rounded
+pwsx4126 power 0.0625 0.5 -> 0.250 Inexact Rounded
+pwsx4127 power 0.626 0.5 -> 0.791 Inexact Rounded
+pwsx4128 power 0.0626 0.5 -> 0.250 Inexact Rounded
+pwsx4129 power 0.627 0.5 -> 0.792 Inexact Rounded
+pwsx4130 power 0.0627 0.5 -> 0.250 Inexact Rounded
+pwsx4131 power 0.628 0.5 -> 0.792 Inexact Rounded
+pwsx4132 power 0.0628 0.5 -> 0.251 Inexact Rounded
+pwsx4133 power 0.629 0.5 -> 0.793 Inexact Rounded
+pwsx4134 power 0.0629 0.5 -> 0.251 Inexact Rounded
+pwsx4135 power 0.631 0.5 -> 0.794 Inexact Rounded
+pwsx4136 power 0.0631 0.5 -> 0.251 Inexact Rounded
+pwsx4137 power 0.632 0.5 -> 0.795 Inexact Rounded
+pwsx4138 power 0.0632 0.5 -> 0.251 Inexact Rounded
+pwsx4139 power 0.633 0.5 -> 0.796 Inexact Rounded
+pwsx4140 power 0.0633 0.5 -> 0.252 Inexact Rounded
+pwsx4141 power 0.634 0.5 -> 0.796 Inexact Rounded
+pwsx4142 power 0.0634 0.5 -> 0.252 Inexact Rounded
+pwsx4143 power 0.635 0.5 -> 0.797 Inexact Rounded
+pwsx4144 power 0.0635 0.5 -> 0.252 Inexact Rounded
+pwsx4145 power 0.636 0.5 -> 0.797 Inexact Rounded
+pwsx4146 power 0.0636 0.5 -> 0.252 Inexact Rounded
+pwsx4147 power 0.637 0.5 -> 0.798 Inexact Rounded
+pwsx4148 power 0.0637 0.5 -> 0.252 Inexact Rounded
+pwsx4149 power 0.638 0.5 -> 0.799 Inexact Rounded
+pwsx4150 power 0.0638 0.5 -> 0.253 Inexact Rounded
+pwsx4151 power 0.639 0.5 -> 0.799 Inexact Rounded
+pwsx4152 power 0.0639 0.5 -> 0.253 Inexact Rounded
+pwsx4153 power 0.641 0.5 -> 0.801 Inexact Rounded
+pwsx4154 power 0.0641 0.5 -> 0.253 Inexact Rounded
+pwsx4155 power 0.642 0.5 -> 0.801 Inexact Rounded
+pwsx4156 power 0.0642 0.5 -> 0.253 Inexact Rounded
+pwsx4157 power 0.643 0.5 -> 0.802 Inexact Rounded
+pwsx4158 power 0.0643 0.5 -> 0.254 Inexact Rounded
+pwsx4159 power 0.644 0.5 -> 0.802 Inexact Rounded
+pwsx4160 power 0.0644 0.5 -> 0.254 Inexact Rounded
+pwsx4161 power 0.645 0.5 -> 0.803 Inexact Rounded
+pwsx4162 power 0.0645 0.5 -> 0.254 Inexact Rounded
+pwsx4163 power 0.646 0.5 -> 0.804 Inexact Rounded
+pwsx4164 power 0.0646 0.5 -> 0.254 Inexact Rounded
+pwsx4165 power 0.647 0.5 -> 0.804 Inexact Rounded
+pwsx4166 power 0.0647 0.5 -> 0.254 Inexact Rounded
+pwsx4167 power 0.648 0.5 -> 0.805 Inexact Rounded
+pwsx4168 power 0.0648 0.5 -> 0.255 Inexact Rounded
+pwsx4169 power 0.649 0.5 -> 0.806 Inexact Rounded
+pwsx4170 power 0.0649 0.5 -> 0.255 Inexact Rounded
+pwsx4171 power 0.651 0.5 -> 0.807 Inexact Rounded
+pwsx4172 power 0.0651 0.5 -> 0.255 Inexact Rounded
+pwsx4173 power 0.652 0.5 -> 0.807 Inexact Rounded
+pwsx4174 power 0.0652 0.5 -> 0.255 Inexact Rounded
+pwsx4175 power 0.653 0.5 -> 0.808 Inexact Rounded
+pwsx4176 power 0.0653 0.5 -> 0.256 Inexact Rounded
+pwsx4177 power 0.654 0.5 -> 0.809 Inexact Rounded
+pwsx4178 power 0.0654 0.5 -> 0.256 Inexact Rounded
+pwsx4179 power 0.655 0.5 -> 0.809 Inexact Rounded
+pwsx4180 power 0.0655 0.5 -> 0.256 Inexact Rounded
+pwsx4181 power 0.656 0.5 -> 0.810 Inexact Rounded
+pwsx4182 power 0.0656 0.5 -> 0.256 Inexact Rounded
+pwsx4183 power 0.657 0.5 -> 0.811 Inexact Rounded
+pwsx4184 power 0.0657 0.5 -> 0.256 Inexact Rounded
+pwsx4185 power 0.658 0.5 -> 0.811 Inexact Rounded
+pwsx4186 power 0.0658 0.5 -> 0.257 Inexact Rounded
+pwsx4187 power 0.659 0.5 -> 0.812 Inexact Rounded
+pwsx4188 power 0.0659 0.5 -> 0.257 Inexact Rounded
+pwsx4189 power 0.661 0.5 -> 0.813 Inexact Rounded
+pwsx4190 power 0.0661 0.5 -> 0.257 Inexact Rounded
+pwsx4191 power 0.662 0.5 -> 0.814 Inexact Rounded
+pwsx4192 power 0.0662 0.5 -> 0.257 Inexact Rounded
+pwsx4193 power 0.663 0.5 -> 0.814 Inexact Rounded
+pwsx4194 power 0.0663 0.5 -> 0.257 Inexact Rounded
+pwsx4195 power 0.664 0.5 -> 0.815 Inexact Rounded
+pwsx4196 power 0.0664 0.5 -> 0.258 Inexact Rounded
+pwsx4197 power 0.665 0.5 -> 0.815 Inexact Rounded
+pwsx4198 power 0.0665 0.5 -> 0.258 Inexact Rounded
+pwsx4199 power 0.666 0.5 -> 0.816 Inexact Rounded
+pwsx4200 power 0.0666 0.5 -> 0.258 Inexact Rounded
+pwsx4201 power 0.667 0.5 -> 0.817 Inexact Rounded
+pwsx4202 power 0.0667 0.5 -> 0.258 Inexact Rounded
+pwsx4203 power 0.668 0.5 -> 0.817 Inexact Rounded
+pwsx4204 power 0.0668 0.5 -> 0.258 Inexact Rounded
+pwsx4205 power 0.669 0.5 -> 0.818 Inexact Rounded
+pwsx4206 power 0.0669 0.5 -> 0.259 Inexact Rounded
+pwsx4207 power 0.671 0.5 -> 0.819 Inexact Rounded
+pwsx4208 power 0.0671 0.5 -> 0.259 Inexact Rounded
+pwsx4209 power 0.672 0.5 -> 0.820 Inexact Rounded
+pwsx4210 power 0.0672 0.5 -> 0.259 Inexact Rounded
+pwsx4211 power 0.673 0.5 -> 0.820 Inexact Rounded
+pwsx4212 power 0.0673 0.5 -> 0.259 Inexact Rounded
+pwsx4213 power 0.674 0.5 -> 0.821 Inexact Rounded
+pwsx4214 power 0.0674 0.5 -> 0.260 Inexact Rounded
+pwsx4215 power 0.675 0.5 -> 0.822 Inexact Rounded
+pwsx4216 power 0.0675 0.5 -> 0.260 Inexact Rounded
+pwsx4217 power 0.676 0.5 -> 0.822 Inexact Rounded
+pwsx4218 power 0.0676 0.5 -> 0.260 Inexact Rounded
+pwsx4219 power 0.677 0.5 -> 0.823 Inexact Rounded
+pwsx4220 power 0.0677 0.5 -> 0.260 Inexact Rounded
+pwsx4221 power 0.678 0.5 -> 0.823 Inexact Rounded
+pwsx4222 power 0.0678 0.5 -> 0.260 Inexact Rounded
+pwsx4223 power 0.679 0.5 -> 0.824 Inexact Rounded
+pwsx4224 power 0.0679 0.5 -> 0.261 Inexact Rounded
+pwsx4225 power 0.681 0.5 -> 0.825 Inexact Rounded
+pwsx4226 power 0.0681 0.5 -> 0.261 Inexact Rounded
+pwsx4227 power 0.682 0.5 -> 0.826 Inexact Rounded
+pwsx4228 power 0.0682 0.5 -> 0.261 Inexact Rounded
+pwsx4229 power 0.683 0.5 -> 0.826 Inexact Rounded
+pwsx4230 power 0.0683 0.5 -> 0.261 Inexact Rounded
+pwsx4231 power 0.684 0.5 -> 0.827 Inexact Rounded
+pwsx4232 power 0.0684 0.5 -> 0.262 Inexact Rounded
+pwsx4233 power 0.685 0.5 -> 0.828 Inexact Rounded
+pwsx4234 power 0.0685 0.5 -> 0.262 Inexact Rounded
+pwsx4235 power 0.686 0.5 -> 0.828 Inexact Rounded
+pwsx4236 power 0.0686 0.5 -> 0.262 Inexact Rounded
+pwsx4237 power 0.687 0.5 -> 0.829 Inexact Rounded
+pwsx4238 power 0.0687 0.5 -> 0.262 Inexact Rounded
+pwsx4239 power 0.688 0.5 -> 0.829 Inexact Rounded
+pwsx4240 power 0.0688 0.5 -> 0.262 Inexact Rounded
+pwsx4241 power 0.689 0.5 -> 0.830 Inexact Rounded
+pwsx4242 power 0.0689 0.5 -> 0.262 Inexact Rounded
+pwsx4243 power 0.691 0.5 -> 0.831 Inexact Rounded
+pwsx4244 power 0.0691 0.5 -> 0.263 Inexact Rounded
+pwsx4245 power 0.692 0.5 -> 0.832 Inexact Rounded
+pwsx4246 power 0.0692 0.5 -> 0.263 Inexact Rounded
+pwsx4247 power 0.693 0.5 -> 0.832 Inexact Rounded
+pwsx4248 power 0.0693 0.5 -> 0.263 Inexact Rounded
+pwsx4249 power 0.694 0.5 -> 0.833 Inexact Rounded
+pwsx4250 power 0.0694 0.5 -> 0.263 Inexact Rounded
+pwsx4251 power 0.695 0.5 -> 0.834 Inexact Rounded
+pwsx4252 power 0.0695 0.5 -> 0.264 Inexact Rounded
+pwsx4253 power 0.696 0.5 -> 0.834 Inexact Rounded
+pwsx4254 power 0.0696 0.5 -> 0.264 Inexact Rounded
+pwsx4255 power 0.697 0.5 -> 0.835 Inexact Rounded
+pwsx4256 power 0.0697 0.5 -> 0.264 Inexact Rounded
+pwsx4257 power 0.698 0.5 -> 0.835 Inexact Rounded
+pwsx4258 power 0.0698 0.5 -> 0.264 Inexact Rounded
+pwsx4259 power 0.699 0.5 -> 0.836 Inexact Rounded
+pwsx4260 power 0.0699 0.5 -> 0.264 Inexact Rounded
+pwsx4261 power 0.701 0.5 -> 0.837 Inexact Rounded
+pwsx4262 power 0.0701 0.5 -> 0.265 Inexact Rounded
+pwsx4263 power 0.702 0.5 -> 0.838 Inexact Rounded
+pwsx4264 power 0.0702 0.5 -> 0.265 Inexact Rounded
+pwsx4265 power 0.703 0.5 -> 0.838 Inexact Rounded
+pwsx4266 power 0.0703 0.5 -> 0.265 Inexact Rounded
+pwsx4267 power 0.704 0.5 -> 0.839 Inexact Rounded
+pwsx4268 power 0.0704 0.5 -> 0.265 Inexact Rounded
+pwsx4269 power 0.705 0.5 -> 0.840 Inexact Rounded
+pwsx4270 power 0.0705 0.5 -> 0.266 Inexact Rounded
+pwsx4271 power 0.706 0.5 -> 0.840 Inexact Rounded
+pwsx4272 power 0.0706 0.5 -> 0.266 Inexact Rounded
+pwsx4273 power 0.707 0.5 -> 0.841 Inexact Rounded
+pwsx4274 power 0.0707 0.5 -> 0.266 Inexact Rounded
+pwsx4275 power 0.708 0.5 -> 0.841 Inexact Rounded
+pwsx4276 power 0.0708 0.5 -> 0.266 Inexact Rounded
+pwsx4277 power 0.709 0.5 -> 0.842 Inexact Rounded
+pwsx4278 power 0.0709 0.5 -> 0.266 Inexact Rounded
+pwsx4279 power 0.711 0.5 -> 0.843 Inexact Rounded
+pwsx4280 power 0.0711 0.5 -> 0.267 Inexact Rounded
+pwsx4281 power 0.712 0.5 -> 0.844 Inexact Rounded
+pwsx4282 power 0.0712 0.5 -> 0.267 Inexact Rounded
+pwsx4283 power 0.713 0.5 -> 0.844 Inexact Rounded
+pwsx4284 power 0.0713 0.5 -> 0.267 Inexact Rounded
+pwsx4285 power 0.714 0.5 -> 0.845 Inexact Rounded
+pwsx4286 power 0.0714 0.5 -> 0.267 Inexact Rounded
+pwsx4287 power 0.715 0.5 -> 0.846 Inexact Rounded
+pwsx4288 power 0.0715 0.5 -> 0.267 Inexact Rounded
+pwsx4289 power 0.716 0.5 -> 0.846 Inexact Rounded
+pwsx4290 power 0.0716 0.5 -> 0.268 Inexact Rounded
+pwsx4291 power 0.717 0.5 -> 0.847 Inexact Rounded
+pwsx4292 power 0.0717 0.5 -> 0.268 Inexact Rounded
+pwsx4293 power 0.718 0.5 -> 0.847 Inexact Rounded
+pwsx4294 power 0.0718 0.5 -> 0.268 Inexact Rounded
+pwsx4295 power 0.719 0.5 -> 0.848 Inexact Rounded
+pwsx4296 power 0.0719 0.5 -> 0.268 Inexact Rounded
+pwsx4297 power 0.721 0.5 -> 0.849 Inexact Rounded
+pwsx4298 power 0.0721 0.5 -> 0.269 Inexact Rounded
+pwsx4299 power 0.722 0.5 -> 0.850 Inexact Rounded
+pwsx4300 power 0.0722 0.5 -> 0.269 Inexact Rounded
+pwsx4301 power 0.723 0.5 -> 0.850 Inexact Rounded
+pwsx4302 power 0.0723 0.5 -> 0.269 Inexact Rounded
+pwsx4303 power 0.724 0.5 -> 0.851 Inexact Rounded
+pwsx4304 power 0.0724 0.5 -> 0.269 Inexact Rounded
+pwsx4305 power 0.725 0.5 -> 0.851 Inexact Rounded
+pwsx4306 power 0.0725 0.5 -> 0.269 Inexact Rounded
+pwsx4307 power 0.726 0.5 -> 0.852 Inexact Rounded
+pwsx4308 power 0.0726 0.5 -> 0.269 Inexact Rounded
+pwsx4309 power 0.727 0.5 -> 0.853 Inexact Rounded
+pwsx4310 power 0.0727 0.5 -> 0.270 Inexact Rounded
+pwsx4311 power 0.728 0.5 -> 0.853 Inexact Rounded
+pwsx4312 power 0.0728 0.5 -> 0.270 Inexact Rounded
+pwsx4313 power 0.729 0.5 -> 0.854 Inexact Rounded
+pwsx4314 power 0.0729 0.5 -> 0.270 Inexact Rounded
+pwsx4315 power 0.731 0.5 -> 0.855 Inexact Rounded
+pwsx4316 power 0.0731 0.5 -> 0.270 Inexact Rounded
+pwsx4317 power 0.732 0.5 -> 0.856 Inexact Rounded
+pwsx4318 power 0.0732 0.5 -> 0.271 Inexact Rounded
+pwsx4319 power 0.733 0.5 -> 0.856 Inexact Rounded
+pwsx4320 power 0.0733 0.5 -> 0.271 Inexact Rounded
+pwsx4321 power 0.734 0.5 -> 0.857 Inexact Rounded
+pwsx4322 power 0.0734 0.5 -> 0.271 Inexact Rounded
+pwsx4323 power 0.735 0.5 -> 0.857 Inexact Rounded
+pwsx4324 power 0.0735 0.5 -> 0.271 Inexact Rounded
+pwsx4325 power 0.736 0.5 -> 0.858 Inexact Rounded
+pwsx4326 power 0.0736 0.5 -> 0.271 Inexact Rounded
+pwsx4327 power 0.737 0.5 -> 0.858 Inexact Rounded
+pwsx4328 power 0.0737 0.5 -> 0.271 Inexact Rounded
+pwsx4329 power 0.738 0.5 -> 0.859 Inexact Rounded
+pwsx4330 power 0.0738 0.5 -> 0.272 Inexact Rounded
+pwsx4331 power 0.739 0.5 -> 0.860 Inexact Rounded
+pwsx4332 power 0.0739 0.5 -> 0.272 Inexact Rounded
+pwsx4333 power 0.741 0.5 -> 0.861 Inexact Rounded
+pwsx4334 power 0.0741 0.5 -> 0.272 Inexact Rounded
+pwsx4335 power 0.742 0.5 -> 0.861 Inexact Rounded
+pwsx4336 power 0.0742 0.5 -> 0.272 Inexact Rounded
+pwsx4337 power 0.743 0.5 -> 0.862 Inexact Rounded
+pwsx4338 power 0.0743 0.5 -> 0.273 Inexact Rounded
+pwsx4339 power 0.744 0.5 -> 0.863 Inexact Rounded
+pwsx4340 power 0.0744 0.5 -> 0.273 Inexact Rounded
+pwsx4341 power 0.745 0.5 -> 0.863 Inexact Rounded
+pwsx4342 power 0.0745 0.5 -> 0.273 Inexact Rounded
+pwsx4343 power 0.746 0.5 -> 0.864 Inexact Rounded
+pwsx4344 power 0.0746 0.5 -> 0.273 Inexact Rounded
+pwsx4345 power 0.747 0.5 -> 0.864 Inexact Rounded
+pwsx4346 power 0.0747 0.5 -> 0.273 Inexact Rounded
+pwsx4347 power 0.748 0.5 -> 0.865 Inexact Rounded
+pwsx4348 power 0.0748 0.5 -> 0.273 Inexact Rounded
+pwsx4349 power 0.749 0.5 -> 0.865 Inexact Rounded
+pwsx4350 power 0.0749 0.5 -> 0.274 Inexact Rounded
+pwsx4351 power 0.751 0.5 -> 0.867 Inexact Rounded
+pwsx4352 power 0.0751 0.5 -> 0.274 Inexact Rounded
+pwsx4353 power 0.752 0.5 -> 0.867 Inexact Rounded
+pwsx4354 power 0.0752 0.5 -> 0.274 Inexact Rounded
+pwsx4355 power 0.753 0.5 -> 0.868 Inexact Rounded
+pwsx4356 power 0.0753 0.5 -> 0.274 Inexact Rounded
+pwsx4357 power 0.754 0.5 -> 0.868 Inexact Rounded
+pwsx4358 power 0.0754 0.5 -> 0.275 Inexact Rounded
+pwsx4359 power 0.755 0.5 -> 0.869 Inexact Rounded
+pwsx4360 power 0.0755 0.5 -> 0.275 Inexact Rounded
+pwsx4361 power 0.756 0.5 -> 0.869 Inexact Rounded
+pwsx4362 power 0.0756 0.5 -> 0.275 Inexact Rounded
+pwsx4363 power 0.757 0.5 -> 0.870 Inexact Rounded
+pwsx4364 power 0.0757 0.5 -> 0.275 Inexact Rounded
+pwsx4365 power 0.758 0.5 -> 0.871 Inexact Rounded
+pwsx4366 power 0.0758 0.5 -> 0.275 Inexact Rounded
+pwsx4367 power 0.759 0.5 -> 0.871 Inexact Rounded
+pwsx4368 power 0.0759 0.5 -> 0.275 Inexact Rounded
+pwsx4369 power 0.761 0.5 -> 0.872 Inexact Rounded
+pwsx4370 power 0.0761 0.5 -> 0.276 Inexact Rounded
+pwsx4371 power 0.762 0.5 -> 0.873 Inexact Rounded
+pwsx4372 power 0.0762 0.5 -> 0.276 Inexact Rounded
+pwsx4373 power 0.763 0.5 -> 0.873 Inexact Rounded
+pwsx4374 power 0.0763 0.5 -> 0.276 Inexact Rounded
+pwsx4375 power 0.764 0.5 -> 0.874 Inexact Rounded
+pwsx4376 power 0.0764 0.5 -> 0.276 Inexact Rounded
+pwsx4377 power 0.765 0.5 -> 0.875 Inexact Rounded
+pwsx4378 power 0.0765 0.5 -> 0.277 Inexact Rounded
+pwsx4379 power 0.766 0.5 -> 0.875 Inexact Rounded
+pwsx4380 power 0.0766 0.5 -> 0.277 Inexact Rounded
+pwsx4381 power 0.767 0.5 -> 0.876 Inexact Rounded
+pwsx4382 power 0.0767 0.5 -> 0.277 Inexact Rounded
+pwsx4383 power 0.768 0.5 -> 0.876 Inexact Rounded
+pwsx4384 power 0.0768 0.5 -> 0.277 Inexact Rounded
+pwsx4385 power 0.769 0.5 -> 0.877 Inexact Rounded
+pwsx4386 power 0.0769 0.5 -> 0.277 Inexact Rounded
+pwsx4387 power 0.771 0.5 -> 0.878 Inexact Rounded
+pwsx4388 power 0.0771 0.5 -> 0.278 Inexact Rounded
+pwsx4389 power 0.772 0.5 -> 0.879 Inexact Rounded
+pwsx4390 power 0.0772 0.5 -> 0.278 Inexact Rounded
+pwsx4391 power 0.773 0.5 -> 0.879 Inexact Rounded
+pwsx4392 power 0.0773 0.5 -> 0.278 Inexact Rounded
+pwsx4393 power 0.774 0.5 -> 0.880 Inexact Rounded
+pwsx4394 power 0.0774 0.5 -> 0.278 Inexact Rounded
+pwsx4395 power 0.775 0.5 -> 0.880 Inexact Rounded
+pwsx4396 power 0.0775 0.5 -> 0.278 Inexact Rounded
+pwsx4397 power 0.776 0.5 -> 0.881 Inexact Rounded
+pwsx4398 power 0.0776 0.5 -> 0.279 Inexact Rounded
+pwsx4399 power 0.777 0.5 -> 0.881 Inexact Rounded
+pwsx4400 power 0.0777 0.5 -> 0.279 Inexact Rounded
+pwsx4401 power 0.778 0.5 -> 0.882 Inexact Rounded
+pwsx4402 power 0.0778 0.5 -> 0.279 Inexact Rounded
+pwsx4403 power 0.779 0.5 -> 0.883 Inexact Rounded
+pwsx4404 power 0.0779 0.5 -> 0.279 Inexact Rounded
+pwsx4405 power 0.781 0.5 -> 0.884 Inexact Rounded
+pwsx4406 power 0.0781 0.5 -> 0.279 Inexact Rounded
+pwsx4407 power 0.782 0.5 -> 0.884 Inexact Rounded
+pwsx4408 power 0.0782 0.5 -> 0.280 Inexact Rounded
+pwsx4409 power 0.783 0.5 -> 0.885 Inexact Rounded
+pwsx4410 power 0.0783 0.5 -> 0.280 Inexact Rounded
+pwsx4411 power 0.784 0.5 -> 0.885 Inexact Rounded
+pwsx4412 power 0.0784 0.5 -> 0.280 Inexact Rounded
+pwsx4413 power 0.785 0.5 -> 0.886 Inexact Rounded
+pwsx4414 power 0.0785 0.5 -> 0.280 Inexact Rounded
+pwsx4415 power 0.786 0.5 -> 0.887 Inexact Rounded
+pwsx4416 power 0.0786 0.5 -> 0.280 Inexact Rounded
+pwsx4417 power 0.787 0.5 -> 0.887 Inexact Rounded
+pwsx4418 power 0.0787 0.5 -> 0.281 Inexact Rounded
+pwsx4419 power 0.788 0.5 -> 0.888 Inexact Rounded
+pwsx4420 power 0.0788 0.5 -> 0.281 Inexact Rounded
+pwsx4421 power 0.789 0.5 -> 0.888 Inexact Rounded
+pwsx4422 power 0.0789 0.5 -> 0.281 Inexact Rounded
+pwsx4423 power 0.791 0.5 -> 0.889 Inexact Rounded
+pwsx4424 power 0.0791 0.5 -> 0.281 Inexact Rounded
+pwsx4425 power 0.792 0.5 -> 0.890 Inexact Rounded
+pwsx4426 power 0.0792 0.5 -> 0.281 Inexact Rounded
+pwsx4427 power 0.793 0.5 -> 0.891 Inexact Rounded
+pwsx4428 power 0.0793 0.5 -> 0.282 Inexact Rounded
+pwsx4429 power 0.794 0.5 -> 0.891 Inexact Rounded
+pwsx4430 power 0.0794 0.5 -> 0.282 Inexact Rounded
+pwsx4431 power 0.795 0.5 -> 0.892 Inexact Rounded
+pwsx4432 power 0.0795 0.5 -> 0.282 Inexact Rounded
+pwsx4433 power 0.796 0.5 -> 0.892 Inexact Rounded
+pwsx4434 power 0.0796 0.5 -> 0.282 Inexact Rounded
+pwsx4435 power 0.797 0.5 -> 0.893 Inexact Rounded
+pwsx4436 power 0.0797 0.5 -> 0.282 Inexact Rounded
+pwsx4437 power 0.798 0.5 -> 0.893 Inexact Rounded
+pwsx4438 power 0.0798 0.5 -> 0.282 Inexact Rounded
+pwsx4439 power 0.799 0.5 -> 0.894 Inexact Rounded
+pwsx4440 power 0.0799 0.5 -> 0.283 Inexact Rounded
+pwsx4441 power 0.801 0.5 -> 0.895 Inexact Rounded
+pwsx4442 power 0.0801 0.5 -> 0.283 Inexact Rounded
+pwsx4443 power 0.802 0.5 -> 0.896 Inexact Rounded
+pwsx4444 power 0.0802 0.5 -> 0.283 Inexact Rounded
+pwsx4445 power 0.803 0.5 -> 0.896 Inexact Rounded
+pwsx4446 power 0.0803 0.5 -> 0.283 Inexact Rounded
+pwsx4447 power 0.804 0.5 -> 0.897 Inexact Rounded
+pwsx4448 power 0.0804 0.5 -> 0.284 Inexact Rounded
+pwsx4449 power 0.805 0.5 -> 0.897 Inexact Rounded
+pwsx4450 power 0.0805 0.5 -> 0.284 Inexact Rounded
+pwsx4451 power 0.806 0.5 -> 0.898 Inexact Rounded
+pwsx4452 power 0.0806 0.5 -> 0.284 Inexact Rounded
+pwsx4453 power 0.807 0.5 -> 0.898 Inexact Rounded
+pwsx4454 power 0.0807 0.5 -> 0.284 Inexact Rounded
+pwsx4455 power 0.808 0.5 -> 0.899 Inexact Rounded
+pwsx4456 power 0.0808 0.5 -> 0.284 Inexact Rounded
+pwsx4457 power 0.809 0.5 -> 0.899 Inexact Rounded
+pwsx4458 power 0.0809 0.5 -> 0.284 Inexact Rounded
+pwsx4459 power 0.811 0.5 -> 0.901 Inexact Rounded
+pwsx4460 power 0.0811 0.5 -> 0.285 Inexact Rounded
+pwsx4461 power 0.812 0.5 -> 0.901 Inexact Rounded
+pwsx4462 power 0.0812 0.5 -> 0.285 Inexact Rounded
+pwsx4463 power 0.813 0.5 -> 0.902 Inexact Rounded
+pwsx4464 power 0.0813 0.5 -> 0.285 Inexact Rounded
+pwsx4465 power 0.814 0.5 -> 0.902 Inexact Rounded
+pwsx4466 power 0.0814 0.5 -> 0.285 Inexact Rounded
+pwsx4467 power 0.815 0.5 -> 0.903 Inexact Rounded
+pwsx4468 power 0.0815 0.5 -> 0.285 Inexact Rounded
+pwsx4469 power 0.816 0.5 -> 0.903 Inexact Rounded
+pwsx4470 power 0.0816 0.5 -> 0.286 Inexact Rounded
+pwsx4471 power 0.817 0.5 -> 0.904 Inexact Rounded
+pwsx4472 power 0.0817 0.5 -> 0.286 Inexact Rounded
+pwsx4473 power 0.818 0.5 -> 0.904 Inexact Rounded
+pwsx4474 power 0.0818 0.5 -> 0.286 Inexact Rounded
+pwsx4475 power 0.819 0.5 -> 0.905 Inexact Rounded
+pwsx4476 power 0.0819 0.5 -> 0.286 Inexact Rounded
+pwsx4477 power 0.821 0.5 -> 0.906 Inexact Rounded
+pwsx4478 power 0.0821 0.5 -> 0.287 Inexact Rounded
+pwsx4479 power 0.822 0.5 -> 0.907 Inexact Rounded
+pwsx4480 power 0.0822 0.5 -> 0.287 Inexact Rounded
+pwsx4481 power 0.823 0.5 -> 0.907 Inexact Rounded
+pwsx4482 power 0.0823 0.5 -> 0.287 Inexact Rounded
+pwsx4483 power 0.824 0.5 -> 0.908 Inexact Rounded
+pwsx4484 power 0.0824 0.5 -> 0.287 Inexact Rounded
+pwsx4485 power 0.825 0.5 -> 0.908 Inexact Rounded
+pwsx4486 power 0.0825 0.5 -> 0.287 Inexact Rounded
+pwsx4487 power 0.826 0.5 -> 0.909 Inexact Rounded
+pwsx4488 power 0.0826 0.5 -> 0.287 Inexact Rounded
+pwsx4489 power 0.827 0.5 -> 0.909 Inexact Rounded
+pwsx4490 power 0.0827 0.5 -> 0.288 Inexact Rounded
+pwsx4491 power 0.828 0.5 -> 0.910 Inexact Rounded
+pwsx4492 power 0.0828 0.5 -> 0.288 Inexact Rounded
+pwsx4493 power 0.829 0.5 -> 0.910 Inexact Rounded
+pwsx4494 power 0.0829 0.5 -> 0.288 Inexact Rounded
+pwsx4495 power 0.831 0.5 -> 0.912 Inexact Rounded
+pwsx4496 power 0.0831 0.5 -> 0.288 Inexact Rounded
+pwsx4497 power 0.832 0.5 -> 0.912 Inexact Rounded
+pwsx4498 power 0.0832 0.5 -> 0.288 Inexact Rounded
+pwsx4499 power 0.833 0.5 -> 0.913 Inexact Rounded
+pwsx4500 power 0.0833 0.5 -> 0.289 Inexact Rounded
+pwsx4501 power 0.834 0.5 -> 0.913 Inexact Rounded
+pwsx4502 power 0.0834 0.5 -> 0.289 Inexact Rounded
+pwsx4503 power 0.835 0.5 -> 0.914 Inexact Rounded
+pwsx4504 power 0.0835 0.5 -> 0.289 Inexact Rounded
+pwsx4505 power 0.836 0.5 -> 0.914 Inexact Rounded
+pwsx4506 power 0.0836 0.5 -> 0.289 Inexact Rounded
+pwsx4507 power 0.837 0.5 -> 0.915 Inexact Rounded
+pwsx4508 power 0.0837 0.5 -> 0.289 Inexact Rounded
+pwsx4509 power 0.838 0.5 -> 0.915 Inexact Rounded
+pwsx4510 power 0.0838 0.5 -> 0.289 Inexact Rounded
+pwsx4511 power 0.839 0.5 -> 0.916 Inexact Rounded
+pwsx4512 power 0.0839 0.5 -> 0.290 Inexact Rounded
+pwsx4513 power 0.841 0.5 -> 0.917 Inexact Rounded
+pwsx4514 power 0.0841 0.5 -> 0.290 Inexact Rounded
+pwsx4515 power 0.842 0.5 -> 0.918 Inexact Rounded
+pwsx4516 power 0.0842 0.5 -> 0.290 Inexact Rounded
+pwsx4517 power 0.843 0.5 -> 0.918 Inexact Rounded
+pwsx4518 power 0.0843 0.5 -> 0.290 Inexact Rounded
+pwsx4519 power 0.844 0.5 -> 0.919 Inexact Rounded
+pwsx4520 power 0.0844 0.5 -> 0.291 Inexact Rounded
+pwsx4521 power 0.845 0.5 -> 0.919 Inexact Rounded
+pwsx4522 power 0.0845 0.5 -> 0.291 Inexact Rounded
+pwsx4523 power 0.846 0.5 -> 0.920 Inexact Rounded
+pwsx4524 power 0.0846 0.5 -> 0.291 Inexact Rounded
+pwsx4525 power 0.847 0.5 -> 0.920 Inexact Rounded
+pwsx4526 power 0.0847 0.5 -> 0.291 Inexact Rounded
+pwsx4527 power 0.848 0.5 -> 0.921 Inexact Rounded
+pwsx4528 power 0.0848 0.5 -> 0.291 Inexact Rounded
+pwsx4529 power 0.849 0.5 -> 0.921 Inexact Rounded
+pwsx4530 power 0.0849 0.5 -> 0.291 Inexact Rounded
+pwsx4531 power 0.851 0.5 -> 0.922 Inexact Rounded
+pwsx4532 power 0.0851 0.5 -> 0.292 Inexact Rounded
+pwsx4533 power 0.852 0.5 -> 0.923 Inexact Rounded
+pwsx4534 power 0.0852 0.5 -> 0.292 Inexact Rounded
+pwsx4535 power 0.853 0.5 -> 0.924 Inexact Rounded
+pwsx4536 power 0.0853 0.5 -> 0.292 Inexact Rounded
+pwsx4537 power 0.854 0.5 -> 0.924 Inexact Rounded
+pwsx4538 power 0.0854 0.5 -> 0.292 Inexact Rounded
+pwsx4539 power 0.855 0.5 -> 0.925 Inexact Rounded
+pwsx4540 power 0.0855 0.5 -> 0.292 Inexact Rounded
+pwsx4541 power 0.856 0.5 -> 0.925 Inexact Rounded
+pwsx4542 power 0.0856 0.5 -> 0.293 Inexact Rounded
+pwsx4543 power 0.857 0.5 -> 0.926 Inexact Rounded
+pwsx4544 power 0.0857 0.5 -> 0.293 Inexact Rounded
+pwsx4545 power 0.858 0.5 -> 0.926 Inexact Rounded
+pwsx4546 power 0.0858 0.5 -> 0.293 Inexact Rounded
+pwsx4547 power 0.859 0.5 -> 0.927 Inexact Rounded
+pwsx4548 power 0.0859 0.5 -> 0.293 Inexact Rounded
+pwsx4549 power 0.861 0.5 -> 0.928 Inexact Rounded
+pwsx4550 power 0.0861 0.5 -> 0.293 Inexact Rounded
+pwsx4551 power 0.862 0.5 -> 0.928 Inexact Rounded
+pwsx4552 power 0.0862 0.5 -> 0.294 Inexact Rounded
+pwsx4553 power 0.863 0.5 -> 0.929 Inexact Rounded
+pwsx4554 power 0.0863 0.5 -> 0.294 Inexact Rounded
+pwsx4555 power 0.864 0.5 -> 0.930 Inexact Rounded
+pwsx4556 power 0.0864 0.5 -> 0.294 Inexact Rounded
+pwsx4557 power 0.865 0.5 -> 0.930 Inexact Rounded
+pwsx4558 power 0.0865 0.5 -> 0.294 Inexact Rounded
+pwsx4559 power 0.866 0.5 -> 0.931 Inexact Rounded
+pwsx4560 power 0.0866 0.5 -> 0.294 Inexact Rounded
+pwsx4561 power 0.867 0.5 -> 0.931 Inexact Rounded
+pwsx4562 power 0.0867 0.5 -> 0.294 Inexact Rounded
+pwsx4563 power 0.868 0.5 -> 0.932 Inexact Rounded
+pwsx4564 power 0.0868 0.5 -> 0.295 Inexact Rounded
+pwsx4565 power 0.869 0.5 -> 0.932 Inexact Rounded
+pwsx4566 power 0.0869 0.5 -> 0.295 Inexact Rounded
+pwsx4567 power 0.871 0.5 -> 0.933 Inexact Rounded
+pwsx4568 power 0.0871 0.5 -> 0.295 Inexact Rounded
+pwsx4569 power 0.872 0.5 -> 0.934 Inexact Rounded
+pwsx4570 power 0.0872 0.5 -> 0.295 Inexact Rounded
+pwsx4571 power 0.873 0.5 -> 0.934 Inexact Rounded
+pwsx4572 power 0.0873 0.5 -> 0.295 Inexact Rounded
+pwsx4573 power 0.874 0.5 -> 0.935 Inexact Rounded
+pwsx4574 power 0.0874 0.5 -> 0.296 Inexact Rounded
+pwsx4575 power 0.875 0.5 -> 0.935 Inexact Rounded
+pwsx4576 power 0.0875 0.5 -> 0.296 Inexact Rounded
+pwsx4577 power 0.876 0.5 -> 0.936 Inexact Rounded
+pwsx4578 power 0.0876 0.5 -> 0.296 Inexact Rounded
+pwsx4579 power 0.877 0.5 -> 0.936 Inexact Rounded
+pwsx4580 power 0.0877 0.5 -> 0.296 Inexact Rounded
+pwsx4581 power 0.878 0.5 -> 0.937 Inexact Rounded
+pwsx4582 power 0.0878 0.5 -> 0.296 Inexact Rounded
+pwsx4583 power 0.879 0.5 -> 0.938 Inexact Rounded
+pwsx4584 power 0.0879 0.5 -> 0.296 Inexact Rounded
+pwsx4585 power 0.881 0.5 -> 0.939 Inexact Rounded
+pwsx4586 power 0.0881 0.5 -> 0.297 Inexact Rounded
+pwsx4587 power 0.882 0.5 -> 0.939 Inexact Rounded
+pwsx4588 power 0.0882 0.5 -> 0.297 Inexact Rounded
+pwsx4589 power 0.883 0.5 -> 0.940 Inexact Rounded
+pwsx4590 power 0.0883 0.5 -> 0.297 Inexact Rounded
+pwsx4591 power 0.884 0.5 -> 0.940 Inexact Rounded
+pwsx4592 power 0.0884 0.5 -> 0.297 Inexact Rounded
+pwsx4593 power 0.885 0.5 -> 0.941 Inexact Rounded
+pwsx4594 power 0.0885 0.5 -> 0.297 Inexact Rounded
+pwsx4595 power 0.886 0.5 -> 0.941 Inexact Rounded
+pwsx4596 power 0.0886 0.5 -> 0.298 Inexact Rounded
+pwsx4597 power 0.887 0.5 -> 0.942 Inexact Rounded
+pwsx4598 power 0.0887 0.5 -> 0.298 Inexact Rounded
+pwsx4599 power 0.888 0.5 -> 0.942 Inexact Rounded
+pwsx4600 power 0.0888 0.5 -> 0.298 Inexact Rounded
+pwsx4601 power 0.889 0.5 -> 0.943 Inexact Rounded
+pwsx4602 power 0.0889 0.5 -> 0.298 Inexact Rounded
+pwsx4603 power 0.891 0.5 -> 0.944 Inexact Rounded
+pwsx4604 power 0.0891 0.5 -> 0.298 Inexact Rounded
+pwsx4605 power 0.892 0.5 -> 0.944 Inexact Rounded
+pwsx4606 power 0.0892 0.5 -> 0.299 Inexact Rounded
+pwsx4607 power 0.893 0.5 -> 0.945 Inexact Rounded
+pwsx4608 power 0.0893 0.5 -> 0.299 Inexact Rounded
+pwsx4609 power 0.894 0.5 -> 0.946 Inexact Rounded
+pwsx4610 power 0.0894 0.5 -> 0.299 Inexact Rounded
+pwsx4611 power 0.895 0.5 -> 0.946 Inexact Rounded
+pwsx4612 power 0.0895 0.5 -> 0.299 Inexact Rounded
+pwsx4613 power 0.896 0.5 -> 0.947 Inexact Rounded
+pwsx4614 power 0.0896 0.5 -> 0.299 Inexact Rounded
+pwsx4615 power 0.897 0.5 -> 0.947 Inexact Rounded
+pwsx4616 power 0.0897 0.5 -> 0.299 Inexact Rounded
+pwsx4617 power 0.898 0.5 -> 0.948 Inexact Rounded
+pwsx4618 power 0.0898 0.5 -> 0.300 Inexact Rounded
+pwsx4619 power 0.899 0.5 -> 0.948 Inexact Rounded
+pwsx4620 power 0.0899 0.5 -> 0.300 Inexact Rounded
+pwsx4621 power 0.901 0.5 -> 0.949 Inexact Rounded
+pwsx4622 power 0.0901 0.5 -> 0.300 Inexact Rounded
+pwsx4623 power 0.902 0.5 -> 0.950 Inexact Rounded
+pwsx4624 power 0.0902 0.5 -> 0.300 Inexact Rounded
+pwsx4625 power 0.903 0.5 -> 0.950 Inexact Rounded
+pwsx4626 power 0.0903 0.5 -> 0.300 Inexact Rounded
+pwsx4627 power 0.904 0.5 -> 0.951 Inexact Rounded
+pwsx4628 power 0.0904 0.5 -> 0.301 Inexact Rounded
+pwsx4629 power 0.905 0.5 -> 0.951 Inexact Rounded
+pwsx4630 power 0.0905 0.5 -> 0.301 Inexact Rounded
+pwsx4631 power 0.906 0.5 -> 0.952 Inexact Rounded
+pwsx4632 power 0.0906 0.5 -> 0.301 Inexact Rounded
+pwsx4633 power 0.907 0.5 -> 0.952 Inexact Rounded
+pwsx4634 power 0.0907 0.5 -> 0.301 Inexact Rounded
+pwsx4635 power 0.908 0.5 -> 0.953 Inexact Rounded
+pwsx4636 power 0.0908 0.5 -> 0.301 Inexact Rounded
+pwsx4637 power 0.909 0.5 -> 0.953 Inexact Rounded
+pwsx4638 power 0.0909 0.5 -> 0.301 Inexact Rounded
+pwsx4639 power 0.911 0.5 -> 0.954 Inexact Rounded
+pwsx4640 power 0.0911 0.5 -> 0.302 Inexact Rounded
+pwsx4641 power 0.912 0.5 -> 0.955 Inexact Rounded
+pwsx4642 power 0.0912 0.5 -> 0.302 Inexact Rounded
+pwsx4643 power 0.913 0.5 -> 0.956 Inexact Rounded
+pwsx4644 power 0.0913 0.5 -> 0.302 Inexact Rounded
+pwsx4645 power 0.914 0.5 -> 0.956 Inexact Rounded
+pwsx4646 power 0.0914 0.5 -> 0.302 Inexact Rounded
+pwsx4647 power 0.915 0.5 -> 0.957 Inexact Rounded
+pwsx4648 power 0.0915 0.5 -> 0.302 Inexact Rounded
+pwsx4649 power 0.916 0.5 -> 0.957 Inexact Rounded
+pwsx4650 power 0.0916 0.5 -> 0.303 Inexact Rounded
+pwsx4651 power 0.917 0.5 -> 0.958 Inexact Rounded
+pwsx4652 power 0.0917 0.5 -> 0.303 Inexact Rounded
+pwsx4653 power 0.918 0.5 -> 0.958 Inexact Rounded
+pwsx4654 power 0.0918 0.5 -> 0.303 Inexact Rounded
+pwsx4655 power 0.919 0.5 -> 0.959 Inexact Rounded
+pwsx4656 power 0.0919 0.5 -> 0.303 Inexact Rounded
+pwsx4657 power 0.921 0.5 -> 0.960 Inexact Rounded
+pwsx4658 power 0.0921 0.5 -> 0.303 Inexact Rounded
+pwsx4659 power 0.922 0.5 -> 0.960 Inexact Rounded
+pwsx4660 power 0.0922 0.5 -> 0.304 Inexact Rounded
+pwsx4661 power 0.923 0.5 -> 0.961 Inexact Rounded
+pwsx4662 power 0.0923 0.5 -> 0.304 Inexact Rounded
+pwsx4663 power 0.924 0.5 -> 0.961 Inexact Rounded
+pwsx4664 power 0.0924 0.5 -> 0.304 Inexact Rounded
+pwsx4665 power 0.925 0.5 -> 0.962 Inexact Rounded
+pwsx4666 power 0.0925 0.5 -> 0.304 Inexact Rounded
+pwsx4667 power 0.926 0.5 -> 0.962 Inexact Rounded
+pwsx4668 power 0.0926 0.5 -> 0.304 Inexact Rounded
+pwsx4669 power 0.927 0.5 -> 0.963 Inexact Rounded
+pwsx4670 power 0.0927 0.5 -> 0.304 Inexact Rounded
+pwsx4671 power 0.928 0.5 -> 0.963 Inexact Rounded
+pwsx4672 power 0.0928 0.5 -> 0.305 Inexact Rounded
+pwsx4673 power 0.929 0.5 -> 0.964 Inexact Rounded
+pwsx4674 power 0.0929 0.5 -> 0.305 Inexact Rounded
+pwsx4675 power 0.931 0.5 -> 0.965 Inexact Rounded
+pwsx4676 power 0.0931 0.5 -> 0.305 Inexact Rounded
+pwsx4677 power 0.932 0.5 -> 0.965 Inexact Rounded
+pwsx4678 power 0.0932 0.5 -> 0.305 Inexact Rounded
+pwsx4679 power 0.933 0.5 -> 0.966 Inexact Rounded
+pwsx4680 power 0.0933 0.5 -> 0.305 Inexact Rounded
+pwsx4681 power 0.934 0.5 -> 0.966 Inexact Rounded
+pwsx4682 power 0.0934 0.5 -> 0.306 Inexact Rounded
+pwsx4683 power 0.935 0.5 -> 0.967 Inexact Rounded
+pwsx4684 power 0.0935 0.5 -> 0.306 Inexact Rounded
+pwsx4685 power 0.936 0.5 -> 0.967 Inexact Rounded
+pwsx4686 power 0.0936 0.5 -> 0.306 Inexact Rounded
+pwsx4687 power 0.937 0.5 -> 0.968 Inexact Rounded
+pwsx4688 power 0.0937 0.5 -> 0.306 Inexact Rounded
+pwsx4689 power 0.938 0.5 -> 0.969 Inexact Rounded
+pwsx4690 power 0.0938 0.5 -> 0.306 Inexact Rounded
+pwsx4691 power 0.939 0.5 -> 0.969 Inexact Rounded
+pwsx4692 power 0.0939 0.5 -> 0.306 Inexact Rounded
+pwsx4693 power 0.941 0.5 -> 0.970 Inexact Rounded
+pwsx4694 power 0.0941 0.5 -> 0.307 Inexact Rounded
+pwsx4695 power 0.942 0.5 -> 0.971 Inexact Rounded
+pwsx4696 power 0.0942 0.5 -> 0.307 Inexact Rounded
+pwsx4697 power 0.943 0.5 -> 0.971 Inexact Rounded
+pwsx4698 power 0.0943 0.5 -> 0.307 Inexact Rounded
+pwsx4699 power 0.944 0.5 -> 0.972 Inexact Rounded
+pwsx4700 power 0.0944 0.5 -> 0.307 Inexact Rounded
+pwsx4701 power 0.945 0.5 -> 0.972 Inexact Rounded
+pwsx4702 power 0.0945 0.5 -> 0.307 Inexact Rounded
+pwsx4703 power 0.946 0.5 -> 0.973 Inexact Rounded
+pwsx4704 power 0.0946 0.5 -> 0.308 Inexact Rounded
+pwsx4705 power 0.947 0.5 -> 0.973 Inexact Rounded
+pwsx4706 power 0.0947 0.5 -> 0.308 Inexact Rounded
+pwsx4707 power 0.948 0.5 -> 0.974 Inexact Rounded
+pwsx4708 power 0.0948 0.5 -> 0.308 Inexact Rounded
+pwsx4709 power 0.949 0.5 -> 0.974 Inexact Rounded
+pwsx4710 power 0.0949 0.5 -> 0.308 Inexact Rounded
+pwsx4711 power 0.951 0.5 -> 0.975 Inexact Rounded
+pwsx4712 power 0.0951 0.5 -> 0.308 Inexact Rounded
+pwsx4713 power 0.952 0.5 -> 0.976 Inexact Rounded
+pwsx4714 power 0.0952 0.5 -> 0.309 Inexact Rounded
+pwsx4715 power 0.953 0.5 -> 0.976 Inexact Rounded
+pwsx4716 power 0.0953 0.5 -> 0.309 Inexact Rounded
+pwsx4717 power 0.954 0.5 -> 0.977 Inexact Rounded
+pwsx4718 power 0.0954 0.5 -> 0.309 Inexact Rounded
+pwsx4719 power 0.955 0.5 -> 0.977 Inexact Rounded
+pwsx4720 power 0.0955 0.5 -> 0.309 Inexact Rounded
+pwsx4721 power 0.956 0.5 -> 0.978 Inexact Rounded
+pwsx4722 power 0.0956 0.5 -> 0.309 Inexact Rounded
+pwsx4723 power 0.957 0.5 -> 0.978 Inexact Rounded
+pwsx4724 power 0.0957 0.5 -> 0.309 Inexact Rounded
+pwsx4725 power 0.958 0.5 -> 0.979 Inexact Rounded
+pwsx4726 power 0.0958 0.5 -> 0.310 Inexact Rounded
+pwsx4727 power 0.959 0.5 -> 0.979 Inexact Rounded
+pwsx4728 power 0.0959 0.5 -> 0.310 Inexact Rounded
+pwsx4729 power 0.961 0.5 -> 0.980 Inexact Rounded
+pwsx4730 power 0.0961 0.5 -> 0.310 Inexact Rounded
+pwsx4731 power 0.962 0.5 -> 0.981 Inexact Rounded
+pwsx4732 power 0.0962 0.5 -> 0.310 Inexact Rounded
+pwsx4733 power 0.963 0.5 -> 0.981 Inexact Rounded
+pwsx4734 power 0.0963 0.5 -> 0.310 Inexact Rounded
+pwsx4735 power 0.964 0.5 -> 0.982 Inexact Rounded
+pwsx4736 power 0.0964 0.5 -> 0.310 Inexact Rounded
+pwsx4737 power 0.965 0.5 -> 0.982 Inexact Rounded
+pwsx4738 power 0.0965 0.5 -> 0.311 Inexact Rounded
+pwsx4739 power 0.966 0.5 -> 0.983 Inexact Rounded
+pwsx4740 power 0.0966 0.5 -> 0.311 Inexact Rounded
+pwsx4741 power 0.967 0.5 -> 0.983 Inexact Rounded
+pwsx4742 power 0.0967 0.5 -> 0.311 Inexact Rounded
+pwsx4743 power 0.968 0.5 -> 0.984 Inexact Rounded
+pwsx4744 power 0.0968 0.5 -> 0.311 Inexact Rounded
+pwsx4745 power 0.969 0.5 -> 0.984 Inexact Rounded
+pwsx4746 power 0.0969 0.5 -> 0.311 Inexact Rounded
+pwsx4747 power 0.971 0.5 -> 0.985 Inexact Rounded
+pwsx4748 power 0.0971 0.5 -> 0.312 Inexact Rounded
+pwsx4749 power 0.972 0.5 -> 0.986 Inexact Rounded
+pwsx4750 power 0.0972 0.5 -> 0.312 Inexact Rounded
+pwsx4751 power 0.973 0.5 -> 0.986 Inexact Rounded
+pwsx4752 power 0.0973 0.5 -> 0.312 Inexact Rounded
+pwsx4753 power 0.974 0.5 -> 0.987 Inexact Rounded
+pwsx4754 power 0.0974 0.5 -> 0.312 Inexact Rounded
+pwsx4755 power 0.975 0.5 -> 0.987 Inexact Rounded
+pwsx4756 power 0.0975 0.5 -> 0.312 Inexact Rounded
+pwsx4757 power 0.976 0.5 -> 0.988 Inexact Rounded
+pwsx4758 power 0.0976 0.5 -> 0.312 Inexact Rounded
+pwsx4759 power 0.977 0.5 -> 0.988 Inexact Rounded
+pwsx4760 power 0.0977 0.5 -> 0.313 Inexact Rounded
+pwsx4761 power 0.978 0.5 -> 0.989 Inexact Rounded
+pwsx4762 power 0.0978 0.5 -> 0.313 Inexact Rounded
+pwsx4763 power 0.979 0.5 -> 0.989 Inexact Rounded
+pwsx4764 power 0.0979 0.5 -> 0.313 Inexact Rounded
+pwsx4765 power 0.981 0.5 -> 0.990 Inexact Rounded
+pwsx4766 power 0.0981 0.5 -> 0.313 Inexact Rounded
+pwsx4767 power 0.982 0.5 -> 0.991 Inexact Rounded
+pwsx4768 power 0.0982 0.5 -> 0.313 Inexact Rounded
+pwsx4769 power 0.983 0.5 -> 0.991 Inexact Rounded
+pwsx4770 power 0.0983 0.5 -> 0.314 Inexact Rounded
+pwsx4771 power 0.984 0.5 -> 0.992 Inexact Rounded
+pwsx4772 power 0.0984 0.5 -> 0.314 Inexact Rounded
+pwsx4773 power 0.985 0.5 -> 0.992 Inexact Rounded
+pwsx4774 power 0.0985 0.5 -> 0.314 Inexact Rounded
+pwsx4775 power 0.986 0.5 -> 0.993 Inexact Rounded
+pwsx4776 power 0.0986 0.5 -> 0.314 Inexact Rounded
+pwsx4777 power 0.987 0.5 -> 0.993 Inexact Rounded
+pwsx4778 power 0.0987 0.5 -> 0.314 Inexact Rounded
+pwsx4779 power 0.988 0.5 -> 0.994 Inexact Rounded
+pwsx4780 power 0.0988 0.5 -> 0.314 Inexact Rounded
+pwsx4781 power 0.989 0.5 -> 0.994 Inexact Rounded
+pwsx4782 power 0.0989 0.5 -> 0.314 Inexact Rounded
+pwsx4783 power 0.991 0.5 -> 0.995 Inexact Rounded
+pwsx4784 power 0.0991 0.5 -> 0.315 Inexact Rounded
+pwsx4785 power 0.992 0.5 -> 0.996 Inexact Rounded
+pwsx4786 power 0.0992 0.5 -> 0.315 Inexact Rounded
+pwsx4787 power 0.993 0.5 -> 0.996 Inexact Rounded
+pwsx4788 power 0.0993 0.5 -> 0.315 Inexact Rounded
+pwsx4789 power 0.994 0.5 -> 0.997 Inexact Rounded
+pwsx4790 power 0.0994 0.5 -> 0.315 Inexact Rounded
+pwsx4791 power 0.995 0.5 -> 0.997 Inexact Rounded
+pwsx4792 power 0.0995 0.5 -> 0.315 Inexact Rounded
+pwsx4793 power 0.996 0.5 -> 0.998 Inexact Rounded
+pwsx4794 power 0.0996 0.5 -> 0.316 Inexact Rounded
+pwsx4795 power 0.997 0.5 -> 0.998 Inexact Rounded
+pwsx4796 power 0.0997 0.5 -> 0.316 Inexact Rounded
+pwsx4797 power 0.998 0.5 -> 0.999 Inexact Rounded
+pwsx4798 power 0.0998 0.5 -> 0.316 Inexact Rounded
+pwsx4799 power 0.999 0.5 -> 0.999 Inexact Rounded
+pwsx4800 power 0.0999 0.5 -> 0.316 Inexact Rounded
+
+-- A group of precision 4 tests where Hull & Abrham adjustments are
+-- needed in some cases (both up and down) [see Hull1985b]
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+precision: 4
+pwsx5001 power 0.0118 0.5 -> 0.1086 Inexact Rounded
+pwsx5002 power 0.119 0.5 -> 0.3450 Inexact Rounded
+pwsx5003 power 0.0119 0.5 -> 0.1091 Inexact Rounded
+pwsx5004 power 0.121 0.5 -> 0.3479 Inexact Rounded
+pwsx5005 power 0.0121 0.5 -> 0.1100 Inexact Rounded
+pwsx5006 power 0.122 0.5 -> 0.3493 Inexact Rounded
+pwsx5007 power 0.0122 0.5 -> 0.1105 Inexact Rounded
+pwsx5008 power 0.123 0.5 -> 0.3507 Inexact Rounded
+pwsx5009 power 0.494 0.5 -> 0.7029 Inexact Rounded
+pwsx5010 power 0.0669 0.5 -> 0.2587 Inexact Rounded
+pwsx5011 power 0.9558 0.5 -> 0.9777 Inexact Rounded
+pwsx5012 power 0.9348 0.5 -> 0.9669 Inexact Rounded
+pwsx5013 power 0.9345 0.5 -> 0.9667 Inexact Rounded
+pwsx5014 power 0.09345 0.5 -> 0.3057 Inexact Rounded
+pwsx5015 power 0.9346 0.5 -> 0.9667 Inexact Rounded
+pwsx5016 power 0.09346 0.5 -> 0.3057 Inexact Rounded
+pwsx5017 power 0.9347 0.5 -> 0.9668 Inexact Rounded
+
+-- examples from decArith
+precision: 9
+pwsx700 power 0 0.5 -> '0'
+pwsx701 power -0 0.5 -> '0'
+pwsx702 power 0.39 0.5 -> 0.624499800 Inexact Rounded
+pwsx703 power 100 0.5 -> '10.0000000' Inexact Rounded
+pwsx704 power 1.00 0.5 -> '1.00000000' Inexact Rounded
+pwsx705 power 7 0.5 -> '2.64575131' Inexact Rounded
+pwsx706 power 10 0.5 -> 3.16227766 Inexact Rounded
+
+-- some one-offs
+precision: 9
+pwsx711 power 0.1 0.5 -> 0.316227766 Inexact Rounded
+pwsx712 power 0.2 0.5 -> 0.447213595 Inexact Rounded
+pwsx713 power 0.3 0.5 -> 0.547722558 Inexact Rounded
+pwsx714 power 0.4 0.5 -> 0.632455532 Inexact Rounded
+pwsx715 power 0.5 0.5 -> 0.707106781 Inexact Rounded
+pwsx716 power 0.6 0.5 -> 0.774596669 Inexact Rounded
+pwsx717 power 0.7 0.5 -> 0.836660027 Inexact Rounded
+pwsx718 power 0.8 0.5 -> 0.894427191 Inexact Rounded
+pwsx719 power 0.9 0.5 -> 0.948683298 Inexact Rounded
+precision: 10 -- note no normalizatoin here
+pwsx720 power +0.1 0.5 -> 0.3162277660 Inexact Rounded
+precision: 11
+pwsx721 power +0.1 0.5 -> 0.31622776602 Inexact Rounded
+precision: 12
+pwsx722 power +0.1 0.5 -> 0.316227766017 Inexact Rounded
+precision: 9
+pwsx723 power 0.39 0.5 -> 0.624499800 Inexact Rounded
+precision: 15
+pwsx724 power 0.39 0.5 -> 0.624499799839840 Inexact Rounded
+
+-- discussion cases
+precision: 7
+pwsx731 power 9 0.5 -> 3.000000 Inexact Rounded
+pwsx732 power 100 0.5 -> 10.00000 Inexact Rounded
+pwsx733 power 123 0.5 -> 11.09054 Inexact Rounded
+pwsx734 power 144 0.5 -> 12.00000 Inexact Rounded
+pwsx735 power 156 0.5 -> 12.49000 Inexact Rounded
+pwsx736 power 10000 0.5 -> 100.0000 Inexact Rounded
+
+-- values close to overflow (if there were input rounding)
+maxexponent: 99
+minexponent: -99
+precision: 5
+pwsx760 power 9.9997E+99 0.5 -> 9.9998E+49 Inexact Rounded
+pwsx761 power 9.9998E+99 0.5 -> 9.9999E+49 Inexact Rounded
+pwsx762 power 9.9999E+99 0.5 -> 9.9999E+49 Inexact Rounded
+pwsx763 power 9.99991E+99 0.5 -> 1.0000E+50 Inexact Rounded
+pwsx764 power 9.99994E+99 0.5 -> 1.0000E+50 Inexact Rounded
+pwsx765 power 9.99995E+99 0.5 -> 1.0000E+50 Inexact Rounded
+pwsx766 power 9.99999E+99 0.5 -> 1.0000E+50 Inexact Rounded
+precision: 9
+pwsx770 power 9.9997E+99 0.5 -> 9.99985000E+49 Inexact Rounded
+pwsx771 power 9.9998E+99 0.5 -> 9.99990000E+49 Inexact Rounded
+pwsx772 power 9.9999E+99 0.5 -> 9.99995000E+49 Inexact Rounded
+pwsx773 power 9.99991E+99 0.5 -> 9.99995500E+49 Inexact Rounded
+pwsx774 power 9.99994E+99 0.5 -> 9.99997000E+49 Inexact Rounded
+pwsx775 power 9.99995E+99 0.5 -> 9.99997500E+49 Inexact Rounded
+pwsx776 power 9.99999E+99 0.5 -> 9.99999500E+49 Inexact Rounded
+precision: 20
+pwsx780 power 9.9997E+99 0.5 -> '9.9998499988749831247E+49' Inexact Rounded
+pwsx781 power 9.9998E+99 0.5 -> '9.9998999994999949999E+49' Inexact Rounded
+pwsx782 power 9.9999E+99 0.5 -> '9.9999499998749993750E+49' Inexact Rounded
+pwsx783 power 9.99991E+99 0.5 -> '9.9999549998987495444E+49' Inexact Rounded
+pwsx784 power 9.99994E+99 0.5 -> '9.9999699999549998650E+49' Inexact Rounded
+pwsx785 power 9.99995E+99 0.5 -> '9.9999749999687499219E+49' Inexact Rounded
+pwsx786 power 9.99999E+99 0.5 -> '9.9999949999987499994E+49' Inexact Rounded
+
+-- subnormals and underflows [these can only result when eMax is < digits+1]
+-- Etiny = -(Emax + (precision-1))
+-- start with subnormal operands and normal results
+maxexponent: 9
+minexponent: -9
+precision: 9 -- Etiny=-17
+pwsx800 power 1E-17 0.5 -> 3.16227766E-9 Inexact Rounded
+pwsx801 power 10E-17 0.5 -> 1.00000000E-8 Inexact Rounded
+precision: 10 -- Etiny=-18
+pwsx802 power 10E-18 0.5 -> 3.162277660E-9 Inexact Rounded
+pwsx803 power 1E-18 0.5 -> 1.000000000E-9 Inexact Rounded
+
+precision: 11 -- Etiny=-19
+pwsx804 power 1E-19 0.5 -> 3.162277660E-10 Underflow Subnormal Inexact Rounded
+-- The next test should be skipped for decNumber
+pwsx805 power 10E-19 0.5 -> 1.0000000000E-9 Inexact Rounded
+precision: 12 -- Etiny=-20
+pwsx806 power 10E-20 0.5 -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded
+pwsx807 power 1E-20 0.5 -> 1.0000000000E-10 Underflow Subnormal Inexact Rounded
+
+precision: 13 -- Etiny=-21
+pwsx808 power 1E-21 0.5 -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded
+pwsx809 power 10E-21 0.5 -> 1.00000000000E-10 Underflow Subnormal Inexact Rounded
+precision: 14 -- Etiny=-22
+pwsx810 power 1E-21 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
+pwsx811 power 10E-22 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
+pwsx812 power 1E-22 0.5 -> 1.00000000000E-11 Underflow Subnormal Inexact Rounded
+
+
+-- special values
+maxexponent: 999
+minexponent: -999
+pwsx820 power Inf 0.5 -> Infinity
+pwsx821 power -Inf 0.5 -> NaN Invalid_operation
+pwsx822 power NaN 0.5 -> NaN
+pwsx823 power sNaN 0.5 -> NaN Invalid_operation
+-- propagating NaNs
+pwsx824 power sNaN123 0.5 -> NaN123 Invalid_operation
+pwsx825 power -sNaN321 0.5 -> -NaN321 Invalid_operation
+pwsx826 power NaN456 0.5 -> NaN456
+pwsx827 power -NaN654 0.5 -> -NaN654
+pwsx828 power NaN1 0.5 -> NaN1
+
+-- Null test
+pwsx900 power # 0.5 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/rotate.decTest b/Lib/test/decimaltestdata/rotate.decTest
index 81ade79c22..12db821317 100644
--- a/Lib/test/decimaltestdata/rotate.decTest
+++ b/Lib/test/decimaltestdata/rotate.decTest
@@ -1,247 +1,247 @@
-------------------------------------------------------------------------
--- rotate.decTest -- rotate coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-rotx001 rotate 0 0 -> 0
-rotx002 rotate 0 2 -> 0
-rotx003 rotate 1 2 -> 100
-rotx004 rotate 34 8 -> 400000003
-rotx005 rotate 1 9 -> 1
-rotx006 rotate 1 -1 -> 100000000
-rotx007 rotate 123456789 -1 -> 912345678
-rotx008 rotate 123456789 -8 -> 234567891
-rotx009 rotate 123456789 -9 -> 123456789
-rotx010 rotate 0 -2 -> 0
-
--- rhs must be an integer
-rotx011 rotate 1 1.5 -> NaN Invalid_operation
-rotx012 rotate 1 1.0 -> NaN Invalid_operation
-rotx013 rotate 1 0.1 -> NaN Invalid_operation
-rotx014 rotate 1 0.0 -> NaN Invalid_operation
-rotx015 rotate 1 1E+1 -> NaN Invalid_operation
-rotx016 rotate 1 1E+99 -> NaN Invalid_operation
-rotx017 rotate 1 Inf -> NaN Invalid_operation
-rotx018 rotate 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-rotx020 rotate 1 -1000 -> NaN Invalid_operation
-rotx021 rotate 1 -10 -> NaN Invalid_operation
-rotx022 rotate 1 10 -> NaN Invalid_operation
-rotx023 rotate 1 1000 -> NaN Invalid_operation
-
--- full pattern
-rotx030 rotate 123456789 -9 -> 123456789
-rotx031 rotate 123456789 -8 -> 234567891
-rotx032 rotate 123456789 -7 -> 345678912
-rotx033 rotate 123456789 -6 -> 456789123
-rotx034 rotate 123456789 -5 -> 567891234
-rotx035 rotate 123456789 -4 -> 678912345
-rotx036 rotate 123456789 -3 -> 789123456
-rotx037 rotate 123456789 -2 -> 891234567
-rotx038 rotate 123456789 -1 -> 912345678
-rotx039 rotate 123456789 -0 -> 123456789
-rotx040 rotate 123456789 +0 -> 123456789
-rotx041 rotate 123456789 +1 -> 234567891
-rotx042 rotate 123456789 +2 -> 345678912
-rotx043 rotate 123456789 +3 -> 456789123
-rotx044 rotate 123456789 +4 -> 567891234
-rotx045 rotate 123456789 +5 -> 678912345
-rotx046 rotate 123456789 +6 -> 789123456
-rotx047 rotate 123456789 +7 -> 891234567
-rotx048 rotate 123456789 +8 -> 912345678
-rotx049 rotate 123456789 +9 -> 123456789
-
--- zeros
-rotx060 rotate 0E-10 +9 -> 0E-10
-rotx061 rotate 0E-10 -9 -> 0E-10
-rotx062 rotate 0.000 +9 -> 0.000
-rotx063 rotate 0.000 -9 -> 0.000
-rotx064 rotate 0E+10 +9 -> 0E+10
-rotx065 rotate 0E+10 -9 -> 0E+10
-rotx066 rotate -0E-10 +9 -> -0E-10
-rotx067 rotate -0E-10 -9 -> -0E-10
-rotx068 rotate -0.000 +9 -> -0.000
-rotx069 rotate -0.000 -9 -> -0.000
-rotx070 rotate -0E+10 +9 -> -0E+10
-rotx071 rotate -0E+10 -9 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-rotx141 rotate 9.99999999E+999 -1 -> 9.99999999E+999
-rotx142 rotate 9.99999999E+999 -8 -> 9.99999999E+999
-rotx143 rotate 9.99999999E+999 1 -> 9.99999999E+999
-rotx144 rotate 9.99999999E+999 8 -> 9.99999999E+999
-rotx145 rotate 1E-999 -1 -> 1.00000000E-991
-rotx146 rotate 1E-999 -8 -> 1.0E-998
-rotx147 rotate 1E-999 1 -> 1.0E-998
-rotx148 rotate 1E-999 8 -> 1.00000000E-991
-rotx151 rotate 1.00000000E-999 -1 -> 1.0000000E-1000
-rotx152 rotate 1.00000000E-999 -8 -> 1E-1007
-rotx153 rotate 1.00000000E-999 1 -> 1E-1007
-rotx154 rotate 1.00000000E-999 8 -> 1.0000000E-1000
-rotx155 rotate 9.00000000E-999 -1 -> 9.0000000E-1000
-rotx156 rotate 9.00000000E-999 -8 -> 9E-1007
-rotx157 rotate 9.00000000E-999 1 -> 9E-1007
-rotx158 rotate 9.00000000E-999 8 -> 9.0000000E-1000
-rotx160 rotate 1E-1007 -1 -> 1.00000000E-999
-rotx161 rotate 1E-1007 -8 -> 1.0E-1006
-rotx162 rotate 1E-1007 1 -> 1.0E-1006
-rotx163 rotate 1E-1007 8 -> 1.00000000E-999
--- negatives
-rotx171 rotate -9.99999999E+999 -1 -> -9.99999999E+999
-rotx172 rotate -9.99999999E+999 -8 -> -9.99999999E+999
-rotx173 rotate -9.99999999E+999 1 -> -9.99999999E+999
-rotx174 rotate -9.99999999E+999 8 -> -9.99999999E+999
-rotx175 rotate -1E-999 -1 -> -1.00000000E-991
-rotx176 rotate -1E-999 -8 -> -1.0E-998
-rotx177 rotate -1E-999 1 -> -1.0E-998
-rotx178 rotate -1E-999 8 -> -1.00000000E-991
-rotx181 rotate -1.00000000E-999 -1 -> -1.0000000E-1000
-rotx182 rotate -1.00000000E-999 -8 -> -1E-1007
-rotx183 rotate -1.00000000E-999 1 -> -1E-1007
-rotx184 rotate -1.00000000E-999 8 -> -1.0000000E-1000
-rotx185 rotate -9.00000000E-999 -1 -> -9.0000000E-1000
-rotx186 rotate -9.00000000E-999 -8 -> -9E-1007
-rotx187 rotate -9.00000000E-999 1 -> -9E-1007
-rotx188 rotate -9.00000000E-999 8 -> -9.0000000E-1000
-rotx190 rotate -1E-1007 -1 -> -1.00000000E-999
-rotx191 rotate -1E-1007 -8 -> -1.0E-1006
-rotx192 rotate -1E-1007 1 -> -1.0E-1006
-rotx193 rotate -1E-1007 8 -> -1.00000000E-999
-
--- more negatives (of sanities)
-rotx201 rotate -0 0 -> -0
-rotx202 rotate -0 2 -> -0
-rotx203 rotate -1 2 -> -100
-rotx204 rotate -1 8 -> -100000000
-rotx205 rotate -1 9 -> -1
-rotx206 rotate -1 -1 -> -100000000
-rotx207 rotate -123456789 -1 -> -912345678
-rotx208 rotate -123456789 -8 -> -234567891
-rotx209 rotate -123456789 -9 -> -123456789
-rotx210 rotate -0 -2 -> -0
-
--- Specials; NaNs are handled as usual
-rotx781 rotate -Inf -8 -> -Infinity
-rotx782 rotate -Inf -1 -> -Infinity
-rotx783 rotate -Inf -0 -> -Infinity
-rotx784 rotate -Inf 0 -> -Infinity
-rotx785 rotate -Inf 1 -> -Infinity
-rotx786 rotate -Inf 8 -> -Infinity
-rotx787 rotate -1000 -Inf -> NaN Invalid_operation
-rotx788 rotate -Inf -Inf -> NaN Invalid_operation
-rotx789 rotate -1 -Inf -> NaN Invalid_operation
-rotx790 rotate -0 -Inf -> NaN Invalid_operation
-rotx791 rotate 0 -Inf -> NaN Invalid_operation
-rotx792 rotate 1 -Inf -> NaN Invalid_operation
-rotx793 rotate 1000 -Inf -> NaN Invalid_operation
-rotx794 rotate Inf -Inf -> NaN Invalid_operation
-
-rotx800 rotate Inf -Inf -> NaN Invalid_operation
-rotx801 rotate Inf -8 -> Infinity
-rotx802 rotate Inf -1 -> Infinity
-rotx803 rotate Inf -0 -> Infinity
-rotx804 rotate Inf 0 -> Infinity
-rotx805 rotate Inf 1 -> Infinity
-rotx806 rotate Inf 8 -> Infinity
-rotx807 rotate Inf Inf -> NaN Invalid_operation
-rotx808 rotate -1000 Inf -> NaN Invalid_operation
-rotx809 rotate -Inf Inf -> NaN Invalid_operation
-rotx810 rotate -1 Inf -> NaN Invalid_operation
-rotx811 rotate -0 Inf -> NaN Invalid_operation
-rotx812 rotate 0 Inf -> NaN Invalid_operation
-rotx813 rotate 1 Inf -> NaN Invalid_operation
-rotx814 rotate 1000 Inf -> NaN Invalid_operation
-rotx815 rotate Inf Inf -> NaN Invalid_operation
-
-rotx821 rotate NaN -Inf -> NaN
-rotx822 rotate NaN -1000 -> NaN
-rotx823 rotate NaN -1 -> NaN
-rotx824 rotate NaN -0 -> NaN
-rotx825 rotate NaN 0 -> NaN
-rotx826 rotate NaN 1 -> NaN
-rotx827 rotate NaN 1000 -> NaN
-rotx828 rotate NaN Inf -> NaN
-rotx829 rotate NaN NaN -> NaN
-rotx830 rotate -Inf NaN -> NaN
-rotx831 rotate -1000 NaN -> NaN
-rotx832 rotate -1 NaN -> NaN
-rotx833 rotate -0 NaN -> NaN
-rotx834 rotate 0 NaN -> NaN
-rotx835 rotate 1 NaN -> NaN
-rotx836 rotate 1000 NaN -> NaN
-rotx837 rotate Inf NaN -> NaN
-
-
-
-rotx841 rotate sNaN -Inf -> NaN Invalid_operation
-rotx842 rotate sNaN -1000 -> NaN Invalid_operation
-rotx843 rotate sNaN -1 -> NaN Invalid_operation
-rotx844 rotate sNaN -0 -> NaN Invalid_operation
-rotx845 rotate sNaN 0 -> NaN Invalid_operation
-rotx846 rotate sNaN 1 -> NaN Invalid_operation
-rotx847 rotate sNaN 1000 -> NaN Invalid_operation
-rotx848 rotate sNaN NaN -> NaN Invalid_operation
-rotx849 rotate sNaN sNaN -> NaN Invalid_operation
-rotx850 rotate NaN sNaN -> NaN Invalid_operation
-rotx851 rotate -Inf sNaN -> NaN Invalid_operation
-rotx852 rotate -1000 sNaN -> NaN Invalid_operation
-rotx853 rotate -1 sNaN -> NaN Invalid_operation
-rotx854 rotate -0 sNaN -> NaN Invalid_operation
-rotx855 rotate 0 sNaN -> NaN Invalid_operation
-rotx856 rotate 1 sNaN -> NaN Invalid_operation
-rotx857 rotate 1000 sNaN -> NaN Invalid_operation
-rotx858 rotate Inf sNaN -> NaN Invalid_operation
-rotx859 rotate NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-rotx861 rotate NaN1 -Inf -> NaN1
-rotx862 rotate +NaN2 -1000 -> NaN2
-rotx863 rotate NaN3 1000 -> NaN3
-rotx864 rotate NaN4 Inf -> NaN4
-rotx865 rotate NaN5 +NaN6 -> NaN5
-rotx866 rotate -Inf NaN7 -> NaN7
-rotx867 rotate -1000 NaN8 -> NaN8
-rotx868 rotate 1000 NaN9 -> NaN9
-rotx869 rotate Inf +NaN10 -> NaN10
-rotx871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
-rotx872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
-rotx873 rotate sNaN13 1000 -> NaN13 Invalid_operation
-rotx874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
-rotx875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
-rotx876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
-rotx877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
-rotx878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
-rotx879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
-rotx880 rotate Inf sNaN23 -> NaN23 Invalid_operation
-rotx881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
-rotx882 rotate -NaN26 NaN28 -> -NaN26
-rotx883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-rotx884 rotate 1000 -NaN30 -> -NaN30
-rotx885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- payload decapitate
-precision: 5
-rotx886 rotate 11 -sNaN1234567890 -> -NaN67890 Invalid_operation
+------------------------------------------------------------------------
+-- rotate.decTest -- rotate coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+rotx001 rotate 0 0 -> 0
+rotx002 rotate 0 2 -> 0
+rotx003 rotate 1 2 -> 100
+rotx004 rotate 34 8 -> 400000003
+rotx005 rotate 1 9 -> 1
+rotx006 rotate 1 -1 -> 100000000
+rotx007 rotate 123456789 -1 -> 912345678
+rotx008 rotate 123456789 -8 -> 234567891
+rotx009 rotate 123456789 -9 -> 123456789
+rotx010 rotate 0 -2 -> 0
+
+-- rhs must be an integer
+rotx011 rotate 1 1.5 -> NaN Invalid_operation
+rotx012 rotate 1 1.0 -> NaN Invalid_operation
+rotx013 rotate 1 0.1 -> NaN Invalid_operation
+rotx014 rotate 1 0.0 -> NaN Invalid_operation
+rotx015 rotate 1 1E+1 -> NaN Invalid_operation
+rotx016 rotate 1 1E+99 -> NaN Invalid_operation
+rotx017 rotate 1 Inf -> NaN Invalid_operation
+rotx018 rotate 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+rotx020 rotate 1 -1000 -> NaN Invalid_operation
+rotx021 rotate 1 -10 -> NaN Invalid_operation
+rotx022 rotate 1 10 -> NaN Invalid_operation
+rotx023 rotate 1 1000 -> NaN Invalid_operation
+
+-- full pattern
+rotx030 rotate 123456789 -9 -> 123456789
+rotx031 rotate 123456789 -8 -> 234567891
+rotx032 rotate 123456789 -7 -> 345678912
+rotx033 rotate 123456789 -6 -> 456789123
+rotx034 rotate 123456789 -5 -> 567891234
+rotx035 rotate 123456789 -4 -> 678912345
+rotx036 rotate 123456789 -3 -> 789123456
+rotx037 rotate 123456789 -2 -> 891234567
+rotx038 rotate 123456789 -1 -> 912345678
+rotx039 rotate 123456789 -0 -> 123456789
+rotx040 rotate 123456789 +0 -> 123456789
+rotx041 rotate 123456789 +1 -> 234567891
+rotx042 rotate 123456789 +2 -> 345678912
+rotx043 rotate 123456789 +3 -> 456789123
+rotx044 rotate 123456789 +4 -> 567891234
+rotx045 rotate 123456789 +5 -> 678912345
+rotx046 rotate 123456789 +6 -> 789123456
+rotx047 rotate 123456789 +7 -> 891234567
+rotx048 rotate 123456789 +8 -> 912345678
+rotx049 rotate 123456789 +9 -> 123456789
+
+-- zeros
+rotx060 rotate 0E-10 +9 -> 0E-10
+rotx061 rotate 0E-10 -9 -> 0E-10
+rotx062 rotate 0.000 +9 -> 0.000
+rotx063 rotate 0.000 -9 -> 0.000
+rotx064 rotate 0E+10 +9 -> 0E+10
+rotx065 rotate 0E+10 -9 -> 0E+10
+rotx066 rotate -0E-10 +9 -> -0E-10
+rotx067 rotate -0E-10 -9 -> -0E-10
+rotx068 rotate -0.000 +9 -> -0.000
+rotx069 rotate -0.000 -9 -> -0.000
+rotx070 rotate -0E+10 +9 -> -0E+10
+rotx071 rotate -0E+10 -9 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+rotx141 rotate 9.99999999E+999 -1 -> 9.99999999E+999
+rotx142 rotate 9.99999999E+999 -8 -> 9.99999999E+999
+rotx143 rotate 9.99999999E+999 1 -> 9.99999999E+999
+rotx144 rotate 9.99999999E+999 8 -> 9.99999999E+999
+rotx145 rotate 1E-999 -1 -> 1.00000000E-991
+rotx146 rotate 1E-999 -8 -> 1.0E-998
+rotx147 rotate 1E-999 1 -> 1.0E-998
+rotx148 rotate 1E-999 8 -> 1.00000000E-991
+rotx151 rotate 1.00000000E-999 -1 -> 1.0000000E-1000
+rotx152 rotate 1.00000000E-999 -8 -> 1E-1007
+rotx153 rotate 1.00000000E-999 1 -> 1E-1007
+rotx154 rotate 1.00000000E-999 8 -> 1.0000000E-1000
+rotx155 rotate 9.00000000E-999 -1 -> 9.0000000E-1000
+rotx156 rotate 9.00000000E-999 -8 -> 9E-1007
+rotx157 rotate 9.00000000E-999 1 -> 9E-1007
+rotx158 rotate 9.00000000E-999 8 -> 9.0000000E-1000
+rotx160 rotate 1E-1007 -1 -> 1.00000000E-999
+rotx161 rotate 1E-1007 -8 -> 1.0E-1006
+rotx162 rotate 1E-1007 1 -> 1.0E-1006
+rotx163 rotate 1E-1007 8 -> 1.00000000E-999
+-- negatives
+rotx171 rotate -9.99999999E+999 -1 -> -9.99999999E+999
+rotx172 rotate -9.99999999E+999 -8 -> -9.99999999E+999
+rotx173 rotate -9.99999999E+999 1 -> -9.99999999E+999
+rotx174 rotate -9.99999999E+999 8 -> -9.99999999E+999
+rotx175 rotate -1E-999 -1 -> -1.00000000E-991
+rotx176 rotate -1E-999 -8 -> -1.0E-998
+rotx177 rotate -1E-999 1 -> -1.0E-998
+rotx178 rotate -1E-999 8 -> -1.00000000E-991
+rotx181 rotate -1.00000000E-999 -1 -> -1.0000000E-1000
+rotx182 rotate -1.00000000E-999 -8 -> -1E-1007
+rotx183 rotate -1.00000000E-999 1 -> -1E-1007
+rotx184 rotate -1.00000000E-999 8 -> -1.0000000E-1000
+rotx185 rotate -9.00000000E-999 -1 -> -9.0000000E-1000
+rotx186 rotate -9.00000000E-999 -8 -> -9E-1007
+rotx187 rotate -9.00000000E-999 1 -> -9E-1007
+rotx188 rotate -9.00000000E-999 8 -> -9.0000000E-1000
+rotx190 rotate -1E-1007 -1 -> -1.00000000E-999
+rotx191 rotate -1E-1007 -8 -> -1.0E-1006
+rotx192 rotate -1E-1007 1 -> -1.0E-1006
+rotx193 rotate -1E-1007 8 -> -1.00000000E-999
+
+-- more negatives (of sanities)
+rotx201 rotate -0 0 -> -0
+rotx202 rotate -0 2 -> -0
+rotx203 rotate -1 2 -> -100
+rotx204 rotate -1 8 -> -100000000
+rotx205 rotate -1 9 -> -1
+rotx206 rotate -1 -1 -> -100000000
+rotx207 rotate -123456789 -1 -> -912345678
+rotx208 rotate -123456789 -8 -> -234567891
+rotx209 rotate -123456789 -9 -> -123456789
+rotx210 rotate -0 -2 -> -0
+
+-- Specials; NaNs are handled as usual
+rotx781 rotate -Inf -8 -> -Infinity
+rotx782 rotate -Inf -1 -> -Infinity
+rotx783 rotate -Inf -0 -> -Infinity
+rotx784 rotate -Inf 0 -> -Infinity
+rotx785 rotate -Inf 1 -> -Infinity
+rotx786 rotate -Inf 8 -> -Infinity
+rotx787 rotate -1000 -Inf -> NaN Invalid_operation
+rotx788 rotate -Inf -Inf -> NaN Invalid_operation
+rotx789 rotate -1 -Inf -> NaN Invalid_operation
+rotx790 rotate -0 -Inf -> NaN Invalid_operation
+rotx791 rotate 0 -Inf -> NaN Invalid_operation
+rotx792 rotate 1 -Inf -> NaN Invalid_operation
+rotx793 rotate 1000 -Inf -> NaN Invalid_operation
+rotx794 rotate Inf -Inf -> NaN Invalid_operation
+
+rotx800 rotate Inf -Inf -> NaN Invalid_operation
+rotx801 rotate Inf -8 -> Infinity
+rotx802 rotate Inf -1 -> Infinity
+rotx803 rotate Inf -0 -> Infinity
+rotx804 rotate Inf 0 -> Infinity
+rotx805 rotate Inf 1 -> Infinity
+rotx806 rotate Inf 8 -> Infinity
+rotx807 rotate Inf Inf -> NaN Invalid_operation
+rotx808 rotate -1000 Inf -> NaN Invalid_operation
+rotx809 rotate -Inf Inf -> NaN Invalid_operation
+rotx810 rotate -1 Inf -> NaN Invalid_operation
+rotx811 rotate -0 Inf -> NaN Invalid_operation
+rotx812 rotate 0 Inf -> NaN Invalid_operation
+rotx813 rotate 1 Inf -> NaN Invalid_operation
+rotx814 rotate 1000 Inf -> NaN Invalid_operation
+rotx815 rotate Inf Inf -> NaN Invalid_operation
+
+rotx821 rotate NaN -Inf -> NaN
+rotx822 rotate NaN -1000 -> NaN
+rotx823 rotate NaN -1 -> NaN
+rotx824 rotate NaN -0 -> NaN
+rotx825 rotate NaN 0 -> NaN
+rotx826 rotate NaN 1 -> NaN
+rotx827 rotate NaN 1000 -> NaN
+rotx828 rotate NaN Inf -> NaN
+rotx829 rotate NaN NaN -> NaN
+rotx830 rotate -Inf NaN -> NaN
+rotx831 rotate -1000 NaN -> NaN
+rotx832 rotate -1 NaN -> NaN
+rotx833 rotate -0 NaN -> NaN
+rotx834 rotate 0 NaN -> NaN
+rotx835 rotate 1 NaN -> NaN
+rotx836 rotate 1000 NaN -> NaN
+rotx837 rotate Inf NaN -> NaN
+
+
+
+rotx841 rotate sNaN -Inf -> NaN Invalid_operation
+rotx842 rotate sNaN -1000 -> NaN Invalid_operation
+rotx843 rotate sNaN -1 -> NaN Invalid_operation
+rotx844 rotate sNaN -0 -> NaN Invalid_operation
+rotx845 rotate sNaN 0 -> NaN Invalid_operation
+rotx846 rotate sNaN 1 -> NaN Invalid_operation
+rotx847 rotate sNaN 1000 -> NaN Invalid_operation
+rotx848 rotate sNaN NaN -> NaN Invalid_operation
+rotx849 rotate sNaN sNaN -> NaN Invalid_operation
+rotx850 rotate NaN sNaN -> NaN Invalid_operation
+rotx851 rotate -Inf sNaN -> NaN Invalid_operation
+rotx852 rotate -1000 sNaN -> NaN Invalid_operation
+rotx853 rotate -1 sNaN -> NaN Invalid_operation
+rotx854 rotate -0 sNaN -> NaN Invalid_operation
+rotx855 rotate 0 sNaN -> NaN Invalid_operation
+rotx856 rotate 1 sNaN -> NaN Invalid_operation
+rotx857 rotate 1000 sNaN -> NaN Invalid_operation
+rotx858 rotate Inf sNaN -> NaN Invalid_operation
+rotx859 rotate NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+rotx861 rotate NaN1 -Inf -> NaN1
+rotx862 rotate +NaN2 -1000 -> NaN2
+rotx863 rotate NaN3 1000 -> NaN3
+rotx864 rotate NaN4 Inf -> NaN4
+rotx865 rotate NaN5 +NaN6 -> NaN5
+rotx866 rotate -Inf NaN7 -> NaN7
+rotx867 rotate -1000 NaN8 -> NaN8
+rotx868 rotate 1000 NaN9 -> NaN9
+rotx869 rotate Inf +NaN10 -> NaN10
+rotx871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
+rotx872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
+rotx873 rotate sNaN13 1000 -> NaN13 Invalid_operation
+rotx874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
+rotx875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
+rotx876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
+rotx877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
+rotx878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
+rotx879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
+rotx880 rotate Inf sNaN23 -> NaN23 Invalid_operation
+rotx881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
+rotx882 rotate -NaN26 NaN28 -> -NaN26
+rotx883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+rotx884 rotate 1000 -NaN30 -> -NaN30
+rotx885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- payload decapitate
+precision: 5
+rotx886 rotate 11 -sNaN1234567890 -> -NaN67890 Invalid_operation
diff --git a/Lib/test/decimaltestdata/scaleb.decTest b/Lib/test/decimaltestdata/scaleb.decTest
index 04a65d6eae..372e3dd4c3 100644
--- a/Lib/test/decimaltestdata/scaleb.decTest
+++ b/Lib/test/decimaltestdata/scaleb.decTest
@@ -1,209 +1,209 @@
-------------------------------------------------------------------------
--- scaleb.decTest -- scale a number by powers of 10 --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Max |rhs| is 2*(999+9) = 2016
-
--- Sanity checks
-scbx001 scaleb 7.50 10 -> 7.50E+10
-scbx002 scaleb 7.50 3 -> 7.50E+3
-scbx003 scaleb 7.50 2 -> 750
-scbx004 scaleb 7.50 1 -> 75.0
-scbx005 scaleb 7.50 0 -> 7.50
-scbx006 scaleb 7.50 -1 -> 0.750
-scbx007 scaleb 7.50 -2 -> 0.0750
-scbx008 scaleb 7.50 -10 -> 7.50E-10
-scbx009 scaleb -7.50 3 -> -7.50E+3
-scbx010 scaleb -7.50 2 -> -750
-scbx011 scaleb -7.50 1 -> -75.0
-scbx012 scaleb -7.50 0 -> -7.50
-scbx013 scaleb -7.50 -1 -> -0.750
-
--- Infinities
-scbx014 scaleb Infinity 1 -> Infinity
-scbx015 scaleb -Infinity 2 -> -Infinity
-scbx016 scaleb Infinity -1 -> Infinity
-scbx017 scaleb -Infinity -2 -> -Infinity
-
--- Next two are somewhat undefined in 754r; treat as non-integer
-scbx018 scaleb 10 Infinity -> NaN Invalid_operation
-scbx019 scaleb 10 -Infinity -> NaN Invalid_operation
-
--- NaNs are undefined in 754r; assume usual processing
--- NaNs, 0 payload
-scbx021 scaleb NaN 1 -> NaN
-scbx022 scaleb -NaN -1 -> -NaN
-scbx023 scaleb sNaN 1 -> NaN Invalid_operation
-scbx024 scaleb -sNaN 1 -> -NaN Invalid_operation
-scbx025 scaleb 4 NaN -> NaN
-scbx026 scaleb -Inf -NaN -> -NaN
-scbx027 scaleb 4 sNaN -> NaN Invalid_operation
-scbx028 scaleb Inf -sNaN -> -NaN Invalid_operation
-
--- non-integer RHS
-scbx030 scaleb 1.23 1 -> 12.3
-scbx031 scaleb 1.23 1.00 -> NaN Invalid_operation
-scbx032 scaleb 1.23 1.1 -> NaN Invalid_operation
-scbx033 scaleb 1.23 1.01 -> NaN Invalid_operation
-scbx034 scaleb 1.23 0.01 -> NaN Invalid_operation
-scbx035 scaleb 1.23 0.11 -> NaN Invalid_operation
-scbx036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
-scbx037 scaleb 1.23 -1 -> 0.123
-scbx038 scaleb 1.23 -1.00 -> NaN Invalid_operation
-scbx039 scaleb 1.23 -1.1 -> NaN Invalid_operation
-scbx040 scaleb 1.23 -1.01 -> NaN Invalid_operation
-scbx041 scaleb 1.23 -0.01 -> NaN Invalid_operation
-scbx042 scaleb 1.23 -0.11 -> NaN Invalid_operation
-scbx043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
-scbx044 scaleb 1.23 0.1 -> NaN Invalid_operation
-scbx045 scaleb 1.23 1E+1 -> NaN Invalid_operation
-scbx046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
-scbx047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
-
-
-scbx120 scaleb 1.23 2015 -> Infinity Overflow Inexact Rounded
-scbx121 scaleb 1.23 2016 -> Infinity Overflow Inexact Rounded
-scbx122 scaleb 1.23 2017 -> NaN Invalid_operation
-scbx123 scaleb 1.23 2018 -> NaN Invalid_operation
-scbx124 scaleb 1.23 -2015 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
-scbx125 scaleb 1.23 -2016 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
-scbx126 scaleb 1.23 -2017 -> NaN Invalid_operation
-scbx127 scaleb 1.23 -2018 -> NaN Invalid_operation
-
--- NaNs, non-0 payload
--- propagating NaNs
-scbx861 scaleb NaN01 -Inf -> NaN1
-scbx862 scaleb -NaN02 -1000 -> -NaN2
-scbx863 scaleb NaN03 1000 -> NaN3
-scbx864 scaleb NaN04 Inf -> NaN4
-scbx865 scaleb NaN05 NaN61 -> NaN5
-scbx866 scaleb -Inf -NaN71 -> -NaN71
-scbx867 scaleb -1000 NaN81 -> NaN81
-scbx868 scaleb 1000 NaN91 -> NaN91
-scbx869 scaleb Inf NaN101 -> NaN101
-scbx871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
-scbx872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
-scbx873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
-scbx874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
-scbx875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
-scbx876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
-scbx877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
-scbx878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
-scbx879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
-scbx880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
-scbx881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- finites
-scbx051 scaleb 7 -2 -> 0.07
-scbx052 scaleb -7 -2 -> -0.07
-scbx053 scaleb 75 -2 -> 0.75
-scbx054 scaleb -75 -2 -> -0.75
-scbx055 scaleb 7.50 -2 -> 0.0750
-scbx056 scaleb -7.50 -2 -> -0.0750
-scbx057 scaleb 7.500 -2 -> 0.07500
-scbx058 scaleb -7.500 -2 -> -0.07500
-scbx061 scaleb 7 -1 -> 0.7
-scbx062 scaleb -7 -1 -> -0.7
-scbx063 scaleb 75 -1 -> 7.5
-scbx064 scaleb -75 -1 -> -7.5
-scbx065 scaleb 7.50 -1 -> 0.750
-scbx066 scaleb -7.50 -1 -> -0.750
-scbx067 scaleb 7.500 -1 -> 0.7500
-scbx068 scaleb -7.500 -1 -> -0.7500
-scbx071 scaleb 7 0 -> 7
-scbx072 scaleb -7 0 -> -7
-scbx073 scaleb 75 0 -> 75
-scbx074 scaleb -75 0 -> -75
-scbx075 scaleb 7.50 0 -> 7.50
-scbx076 scaleb -7.50 0 -> -7.50
-scbx077 scaleb 7.500 0 -> 7.500
-scbx078 scaleb -7.500 0 -> -7.500
-scbx081 scaleb 7 1 -> 7E+1
-scbx082 scaleb -7 1 -> -7E+1
-scbx083 scaleb 75 1 -> 7.5E+2
-scbx084 scaleb -75 1 -> -7.5E+2
-scbx085 scaleb 7.50 1 -> 75.0
-scbx086 scaleb -7.50 1 -> -75.0
-scbx087 scaleb 7.500 1 -> 75.00
-scbx088 scaleb -7.500 1 -> -75.00
-scbx091 scaleb 7 2 -> 7E+2
-scbx092 scaleb -7 2 -> -7E+2
-scbx093 scaleb 75 2 -> 7.5E+3
-scbx094 scaleb -75 2 -> -7.5E+3
-scbx095 scaleb 7.50 2 -> 750
-scbx096 scaleb -7.50 2 -> -750
-scbx097 scaleb 7.500 2 -> 750.0
-scbx098 scaleb -7.500 2 -> -750.0
-
--- zeros
-scbx111 scaleb 0 1 -> 0E+1
-scbx112 scaleb -0 2 -> -0E+2
-scbx113 scaleb 0E+4 3 -> 0E+7
-scbx114 scaleb -0E+4 4 -> -0E+8
-scbx115 scaleb 0.0000 5 -> 0E+1
-scbx116 scaleb -0.0000 6 -> -0E+2
-scbx117 scaleb 0E-141 7 -> 0E-134
-scbx118 scaleb -0E-141 8 -> -0E-133
-
--- Nmax, Nmin, Ntiny
-scbx132 scaleb 9.99999999E+999 +999 -> Infinity Overflow Inexact Rounded
-scbx133 scaleb 9.99999999E+999 +10 -> Infinity Overflow Inexact Rounded
-scbx134 scaleb 9.99999999E+999 +1 -> Infinity Overflow Inexact Rounded
-scbx135 scaleb 9.99999999E+999 0 -> 9.99999999E+999
-scbx136 scaleb 9.99999999E+999 -1 -> 9.99999999E+998
-scbx137 scaleb 1E-999 +1 -> 1E-998
-scbx138 scaleb 1E-999 -0 -> 1E-999
-scbx139 scaleb 1E-999 -1 -> 1E-1000 Subnormal
-scbx140 scaleb 1.00000000E-999 +1 -> 1.00000000E-998
-scbx141 scaleb 1.00000000E-999 0 -> 1.00000000E-999
-scbx142 scaleb 1.00000000E-999 -1 -> 1.0000000E-1000 Subnormal Rounded
-scbx143 scaleb 1E-1007 +1 -> 1E-1006 Subnormal
-scbx144 scaleb 1E-1007 -0 -> 1E-1007 Subnormal
-scbx145 scaleb 1E-1007 -1 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
-
-scbx150 scaleb -1E-1007 +1 -> -1E-1006 Subnormal
-scbx151 scaleb -1E-1007 -0 -> -1E-1007 Subnormal
-scbx152 scaleb -1E-1007 -1 -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped
-scbx153 scaleb -1.00000000E-999 +1 -> -1.00000000E-998
-scbx154 scaleb -1.00000000E-999 +0 -> -1.00000000E-999
-scbx155 scaleb -1.00000000E-999 -1 -> -1.0000000E-1000 Subnormal Rounded
-scbx156 scaleb -1E-999 +1 -> -1E-998
-scbx157 scaleb -1E-999 -0 -> -1E-999
-scbx158 scaleb -1E-999 -1 -> -1E-1000 Subnormal
-scbx159 scaleb -9.99999999E+999 +1 -> -Infinity Overflow Inexact Rounded
-scbx160 scaleb -9.99999999E+999 +0 -> -9.99999999E+999
-scbx161 scaleb -9.99999999E+999 -1 -> -9.99999999E+998
-scbx162 scaleb -9E+999 +1 -> -Infinity Overflow Inexact Rounded
-scbx163 scaleb -1E+999 +1 -> -Infinity Overflow Inexact Rounded
-
--- Krah examples
-precision: 34
-maxExponent: 999999999
-minExponent: -999999999
--- integer overflow in 3.61 or earlier
-scbx164 scaleb 1E-999999999 -1200000000 -> NaN Invalid_operation
--- out of range
-scbx165 scaleb -1E-999999999 +1200000000 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- scaleb.decTest -- scale a number by powers of 10 --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Max |rhs| is 2*(999+9) = 2016
+
+-- Sanity checks
+scbx001 scaleb 7.50 10 -> 7.50E+10
+scbx002 scaleb 7.50 3 -> 7.50E+3
+scbx003 scaleb 7.50 2 -> 750
+scbx004 scaleb 7.50 1 -> 75.0
+scbx005 scaleb 7.50 0 -> 7.50
+scbx006 scaleb 7.50 -1 -> 0.750
+scbx007 scaleb 7.50 -2 -> 0.0750
+scbx008 scaleb 7.50 -10 -> 7.50E-10
+scbx009 scaleb -7.50 3 -> -7.50E+3
+scbx010 scaleb -7.50 2 -> -750
+scbx011 scaleb -7.50 1 -> -75.0
+scbx012 scaleb -7.50 0 -> -7.50
+scbx013 scaleb -7.50 -1 -> -0.750
+
+-- Infinities
+scbx014 scaleb Infinity 1 -> Infinity
+scbx015 scaleb -Infinity 2 -> -Infinity
+scbx016 scaleb Infinity -1 -> Infinity
+scbx017 scaleb -Infinity -2 -> -Infinity
+
+-- Next two are somewhat undefined in 754r; treat as non-integer
+scbx018 scaleb 10 Infinity -> NaN Invalid_operation
+scbx019 scaleb 10 -Infinity -> NaN Invalid_operation
+
+-- NaNs are undefined in 754r; assume usual processing
+-- NaNs, 0 payload
+scbx021 scaleb NaN 1 -> NaN
+scbx022 scaleb -NaN -1 -> -NaN
+scbx023 scaleb sNaN 1 -> NaN Invalid_operation
+scbx024 scaleb -sNaN 1 -> -NaN Invalid_operation
+scbx025 scaleb 4 NaN -> NaN
+scbx026 scaleb -Inf -NaN -> -NaN
+scbx027 scaleb 4 sNaN -> NaN Invalid_operation
+scbx028 scaleb Inf -sNaN -> -NaN Invalid_operation
+
+-- non-integer RHS
+scbx030 scaleb 1.23 1 -> 12.3
+scbx031 scaleb 1.23 1.00 -> NaN Invalid_operation
+scbx032 scaleb 1.23 1.1 -> NaN Invalid_operation
+scbx033 scaleb 1.23 1.01 -> NaN Invalid_operation
+scbx034 scaleb 1.23 0.01 -> NaN Invalid_operation
+scbx035 scaleb 1.23 0.11 -> NaN Invalid_operation
+scbx036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
+scbx037 scaleb 1.23 -1 -> 0.123
+scbx038 scaleb 1.23 -1.00 -> NaN Invalid_operation
+scbx039 scaleb 1.23 -1.1 -> NaN Invalid_operation
+scbx040 scaleb 1.23 -1.01 -> NaN Invalid_operation
+scbx041 scaleb 1.23 -0.01 -> NaN Invalid_operation
+scbx042 scaleb 1.23 -0.11 -> NaN Invalid_operation
+scbx043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
+scbx044 scaleb 1.23 0.1 -> NaN Invalid_operation
+scbx045 scaleb 1.23 1E+1 -> NaN Invalid_operation
+scbx046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
+scbx047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
+
+
+scbx120 scaleb 1.23 2015 -> Infinity Overflow Inexact Rounded
+scbx121 scaleb 1.23 2016 -> Infinity Overflow Inexact Rounded
+scbx122 scaleb 1.23 2017 -> NaN Invalid_operation
+scbx123 scaleb 1.23 2018 -> NaN Invalid_operation
+scbx124 scaleb 1.23 -2015 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
+scbx125 scaleb 1.23 -2016 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
+scbx126 scaleb 1.23 -2017 -> NaN Invalid_operation
+scbx127 scaleb 1.23 -2018 -> NaN Invalid_operation
+
+-- NaNs, non-0 payload
+-- propagating NaNs
+scbx861 scaleb NaN01 -Inf -> NaN1
+scbx862 scaleb -NaN02 -1000 -> -NaN2
+scbx863 scaleb NaN03 1000 -> NaN3
+scbx864 scaleb NaN04 Inf -> NaN4
+scbx865 scaleb NaN05 NaN61 -> NaN5
+scbx866 scaleb -Inf -NaN71 -> -NaN71
+scbx867 scaleb -1000 NaN81 -> NaN81
+scbx868 scaleb 1000 NaN91 -> NaN91
+scbx869 scaleb Inf NaN101 -> NaN101
+scbx871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
+scbx872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
+scbx873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
+scbx874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
+scbx875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
+scbx876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
+scbx877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
+scbx878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
+scbx879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
+scbx880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
+scbx881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- finites
+scbx051 scaleb 7 -2 -> 0.07
+scbx052 scaleb -7 -2 -> -0.07
+scbx053 scaleb 75 -2 -> 0.75
+scbx054 scaleb -75 -2 -> -0.75
+scbx055 scaleb 7.50 -2 -> 0.0750
+scbx056 scaleb -7.50 -2 -> -0.0750
+scbx057 scaleb 7.500 -2 -> 0.07500
+scbx058 scaleb -7.500 -2 -> -0.07500
+scbx061 scaleb 7 -1 -> 0.7
+scbx062 scaleb -7 -1 -> -0.7
+scbx063 scaleb 75 -1 -> 7.5
+scbx064 scaleb -75 -1 -> -7.5
+scbx065 scaleb 7.50 -1 -> 0.750
+scbx066 scaleb -7.50 -1 -> -0.750
+scbx067 scaleb 7.500 -1 -> 0.7500
+scbx068 scaleb -7.500 -1 -> -0.7500
+scbx071 scaleb 7 0 -> 7
+scbx072 scaleb -7 0 -> -7
+scbx073 scaleb 75 0 -> 75
+scbx074 scaleb -75 0 -> -75
+scbx075 scaleb 7.50 0 -> 7.50
+scbx076 scaleb -7.50 0 -> -7.50
+scbx077 scaleb 7.500 0 -> 7.500
+scbx078 scaleb -7.500 0 -> -7.500
+scbx081 scaleb 7 1 -> 7E+1
+scbx082 scaleb -7 1 -> -7E+1
+scbx083 scaleb 75 1 -> 7.5E+2
+scbx084 scaleb -75 1 -> -7.5E+2
+scbx085 scaleb 7.50 1 -> 75.0
+scbx086 scaleb -7.50 1 -> -75.0
+scbx087 scaleb 7.500 1 -> 75.00
+scbx088 scaleb -7.500 1 -> -75.00
+scbx091 scaleb 7 2 -> 7E+2
+scbx092 scaleb -7 2 -> -7E+2
+scbx093 scaleb 75 2 -> 7.5E+3
+scbx094 scaleb -75 2 -> -7.5E+3
+scbx095 scaleb 7.50 2 -> 750
+scbx096 scaleb -7.50 2 -> -750
+scbx097 scaleb 7.500 2 -> 750.0
+scbx098 scaleb -7.500 2 -> -750.0
+
+-- zeros
+scbx111 scaleb 0 1 -> 0E+1
+scbx112 scaleb -0 2 -> -0E+2
+scbx113 scaleb 0E+4 3 -> 0E+7
+scbx114 scaleb -0E+4 4 -> -0E+8
+scbx115 scaleb 0.0000 5 -> 0E+1
+scbx116 scaleb -0.0000 6 -> -0E+2
+scbx117 scaleb 0E-141 7 -> 0E-134
+scbx118 scaleb -0E-141 8 -> -0E-133
+
+-- Nmax, Nmin, Ntiny
+scbx132 scaleb 9.99999999E+999 +999 -> Infinity Overflow Inexact Rounded
+scbx133 scaleb 9.99999999E+999 +10 -> Infinity Overflow Inexact Rounded
+scbx134 scaleb 9.99999999E+999 +1 -> Infinity Overflow Inexact Rounded
+scbx135 scaleb 9.99999999E+999 0 -> 9.99999999E+999
+scbx136 scaleb 9.99999999E+999 -1 -> 9.99999999E+998
+scbx137 scaleb 1E-999 +1 -> 1E-998
+scbx138 scaleb 1E-999 -0 -> 1E-999
+scbx139 scaleb 1E-999 -1 -> 1E-1000 Subnormal
+scbx140 scaleb 1.00000000E-999 +1 -> 1.00000000E-998
+scbx141 scaleb 1.00000000E-999 0 -> 1.00000000E-999
+scbx142 scaleb 1.00000000E-999 -1 -> 1.0000000E-1000 Subnormal Rounded
+scbx143 scaleb 1E-1007 +1 -> 1E-1006 Subnormal
+scbx144 scaleb 1E-1007 -0 -> 1E-1007 Subnormal
+scbx145 scaleb 1E-1007 -1 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
+
+scbx150 scaleb -1E-1007 +1 -> -1E-1006 Subnormal
+scbx151 scaleb -1E-1007 -0 -> -1E-1007 Subnormal
+scbx152 scaleb -1E-1007 -1 -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped
+scbx153 scaleb -1.00000000E-999 +1 -> -1.00000000E-998
+scbx154 scaleb -1.00000000E-999 +0 -> -1.00000000E-999
+scbx155 scaleb -1.00000000E-999 -1 -> -1.0000000E-1000 Subnormal Rounded
+scbx156 scaleb -1E-999 +1 -> -1E-998
+scbx157 scaleb -1E-999 -0 -> -1E-999
+scbx158 scaleb -1E-999 -1 -> -1E-1000 Subnormal
+scbx159 scaleb -9.99999999E+999 +1 -> -Infinity Overflow Inexact Rounded
+scbx160 scaleb -9.99999999E+999 +0 -> -9.99999999E+999
+scbx161 scaleb -9.99999999E+999 -1 -> -9.99999999E+998
+scbx162 scaleb -9E+999 +1 -> -Infinity Overflow Inexact Rounded
+scbx163 scaleb -1E+999 +1 -> -Infinity Overflow Inexact Rounded
+
+-- Krah examples
+precision: 34
+maxExponent: 999999999
+minExponent: -999999999
+-- integer overflow in 3.61 or earlier
+scbx164 scaleb 1E-999999999 -1200000000 -> NaN Invalid_operation
+-- out of range
+scbx165 scaleb -1E-999999999 +1200000000 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/shift.decTest b/Lib/test/decimaltestdata/shift.decTest
index 78838cc10d..3fac72f722 100644
--- a/Lib/test/decimaltestdata/shift.decTest
+++ b/Lib/test/decimaltestdata/shift.decTest
@@ -1,250 +1,250 @@
-------------------------------------------------------------------------
--- shift.decTest -- shift coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-shix001 shift 0 0 -> 0
-shix002 shift 0 2 -> 0
-shix003 shift 1 2 -> 100
-shix004 shift 1 8 -> 100000000
-shix005 shift 1 9 -> 0
-shix006 shift 1 -1 -> 0
-shix007 shift 123456789 -1 -> 12345678
-shix008 shift 123456789 -8 -> 1
-shix009 shift 123456789 -9 -> 0
-shix010 shift 0 -2 -> 0
-
--- rhs must be an integer
-shix011 shift 1 1.5 -> NaN Invalid_operation
-shix012 shift 1 1.0 -> NaN Invalid_operation
-shix013 shift 1 0.1 -> NaN Invalid_operation
-shix014 shift 1 0.0 -> NaN Invalid_operation
-shix015 shift 1 1E+1 -> NaN Invalid_operation
-shix016 shift 1 1E+99 -> NaN Invalid_operation
-shix017 shift 1 Inf -> NaN Invalid_operation
-shix018 shift 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-shix020 shift 1 -1000 -> NaN Invalid_operation
-shix021 shift 1 -10 -> NaN Invalid_operation
-shix022 shift 1 10 -> NaN Invalid_operation
-shix023 shift 1 1000 -> NaN Invalid_operation
-
--- full shifting pattern
-shix030 shift 123456789 -9 -> 0
-shix031 shift 123456789 -8 -> 1
-shix032 shift 123456789 -7 -> 12
-shix033 shift 123456789 -6 -> 123
-shix034 shift 123456789 -5 -> 1234
-shix035 shift 123456789 -4 -> 12345
-shix036 shift 123456789 -3 -> 123456
-shix037 shift 123456789 -2 -> 1234567
-shix038 shift 123456789 -1 -> 12345678
-shix039 shift 123456789 -0 -> 123456789
-shix040 shift 123456789 +0 -> 123456789
-shix041 shift 123456789 +1 -> 234567890
-shix042 shift 123456789 +2 -> 345678900
-shix043 shift 123456789 +3 -> 456789000
-shix044 shift 123456789 +4 -> 567890000
-shix045 shift 123456789 +5 -> 678900000
-shix046 shift 123456789 +6 -> 789000000
-shix047 shift 123456789 +7 -> 890000000
-shix048 shift 123456789 +8 -> 900000000
-shix049 shift 123456789 +9 -> 0
-
--- from examples
-shix051 shift 34 8 -> '400000000'
-shix052 shift 12 9 -> '0'
-shix053 shift 123456789 -2 -> '1234567'
-shix054 shift 123456789 0 -> '123456789'
-shix055 shift 123456789 +2 -> '345678900'
-
--- zeros
-shix060 shift 0E-10 +9 -> 0E-10
-shix061 shift 0E-10 -9 -> 0E-10
-shix062 shift 0.000 +9 -> 0.000
-shix063 shift 0.000 -9 -> 0.000
-shix064 shift 0E+10 +9 -> 0E+10
-shix065 shift 0E+10 -9 -> 0E+10
-shix066 shift -0E-10 +9 -> -0E-10
-shix067 shift -0E-10 -9 -> -0E-10
-shix068 shift -0.000 +9 -> -0.000
-shix069 shift -0.000 -9 -> -0.000
-shix070 shift -0E+10 +9 -> -0E+10
-shix071 shift -0E+10 -9 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-shix141 shift 9.99999999E+999 -1 -> 9.9999999E+998
-shix142 shift 9.99999999E+999 -8 -> 9E+991
-shix143 shift 9.99999999E+999 1 -> 9.99999990E+999
-shix144 shift 9.99999999E+999 8 -> 9.00000000E+999
-shix145 shift 1E-999 -1 -> 0E-999
-shix146 shift 1E-999 -8 -> 0E-999
-shix147 shift 1E-999 1 -> 1.0E-998
-shix148 shift 1E-999 8 -> 1.00000000E-991
-shix151 shift 1.00000000E-999 -1 -> 1.0000000E-1000
-shix152 shift 1.00000000E-999 -8 -> 1E-1007
-shix153 shift 1.00000000E-999 1 -> 0E-1007
-shix154 shift 1.00000000E-999 8 -> 0E-1007
-shix155 shift 9.00000000E-999 -1 -> 9.0000000E-1000
-shix156 shift 9.00000000E-999 -8 -> 9E-1007
-shix157 shift 9.00000000E-999 1 -> 0E-1007
-shix158 shift 9.00000000E-999 8 -> 0E-1007
-shix160 shift 1E-1007 -1 -> 0E-1007
-shix161 shift 1E-1007 -8 -> 0E-1007
-shix162 shift 1E-1007 1 -> 1.0E-1006
-shix163 shift 1E-1007 8 -> 1.00000000E-999
--- negatives
-shix171 shift -9.99999999E+999 -1 -> -9.9999999E+998
-shix172 shift -9.99999999E+999 -8 -> -9E+991
-shix173 shift -9.99999999E+999 1 -> -9.99999990E+999
-shix174 shift -9.99999999E+999 8 -> -9.00000000E+999
-shix175 shift -1E-999 -1 -> -0E-999
-shix176 shift -1E-999 -8 -> -0E-999
-shix177 shift -1E-999 1 -> -1.0E-998
-shix178 shift -1E-999 8 -> -1.00000000E-991
-shix181 shift -1.00000000E-999 -1 -> -1.0000000E-1000
-shix182 shift -1.00000000E-999 -8 -> -1E-1007
-shix183 shift -1.00000000E-999 1 -> -0E-1007
-shix184 shift -1.00000000E-999 8 -> -0E-1007
-shix185 shift -9.00000000E-999 -1 -> -9.0000000E-1000
-shix186 shift -9.00000000E-999 -8 -> -9E-1007
-shix187 shift -9.00000000E-999 1 -> -0E-1007
-shix188 shift -9.00000000E-999 8 -> -0E-1007
-shix190 shift -1E-1007 -1 -> -0E-1007
-shix191 shift -1E-1007 -8 -> -0E-1007
-shix192 shift -1E-1007 1 -> -1.0E-1006
-shix193 shift -1E-1007 8 -> -1.00000000E-999
-
--- more negatives (of sanities)
-shix201 shift -0 0 -> -0
-shix202 shift -0 2 -> -0
-shix203 shift -1 2 -> -100
-shix204 shift -1 8 -> -100000000
-shix205 shift -1 9 -> -0
-shix206 shift -1 -1 -> -0
-shix207 shift -123456789 -1 -> -12345678
-shix208 shift -123456789 -8 -> -1
-shix209 shift -123456789 -9 -> -0
-shix210 shift -0 -2 -> -0
-shix211 shift -0 -0 -> -0
-
-
--- Specials; NaNs are handled as usual
-shix781 shift -Inf -8 -> -Infinity
-shix782 shift -Inf -1 -> -Infinity
-shix783 shift -Inf -0 -> -Infinity
-shix784 shift -Inf 0 -> -Infinity
-shix785 shift -Inf 1 -> -Infinity
-shix786 shift -Inf 8 -> -Infinity
-shix787 shift -1000 -Inf -> NaN Invalid_operation
-shix788 shift -Inf -Inf -> NaN Invalid_operation
-shix789 shift -1 -Inf -> NaN Invalid_operation
-shix790 shift -0 -Inf -> NaN Invalid_operation
-shix791 shift 0 -Inf -> NaN Invalid_operation
-shix792 shift 1 -Inf -> NaN Invalid_operation
-shix793 shift 1000 -Inf -> NaN Invalid_operation
-shix794 shift Inf -Inf -> NaN Invalid_operation
-
-shix800 shift Inf -Inf -> NaN Invalid_operation
-shix801 shift Inf -8 -> Infinity
-shix802 shift Inf -1 -> Infinity
-shix803 shift Inf -0 -> Infinity
-shix804 shift Inf 0 -> Infinity
-shix805 shift Inf 1 -> Infinity
-shix806 shift Inf 8 -> Infinity
-shix807 shift Inf Inf -> NaN Invalid_operation
-shix808 shift -1000 Inf -> NaN Invalid_operation
-shix809 shift -Inf Inf -> NaN Invalid_operation
-shix810 shift -1 Inf -> NaN Invalid_operation
-shix811 shift -0 Inf -> NaN Invalid_operation
-shix812 shift 0 Inf -> NaN Invalid_operation
-shix813 shift 1 Inf -> NaN Invalid_operation
-shix814 shift 1000 Inf -> NaN Invalid_operation
-shix815 shift Inf Inf -> NaN Invalid_operation
-
-shix821 shift NaN -Inf -> NaN
-shix822 shift NaN -1000 -> NaN
-shix823 shift NaN -1 -> NaN
-shix824 shift NaN -0 -> NaN
-shix825 shift NaN 0 -> NaN
-shix826 shift NaN 1 -> NaN
-shix827 shift NaN 1000 -> NaN
-shix828 shift NaN Inf -> NaN
-shix829 shift NaN NaN -> NaN
-shix830 shift -Inf NaN -> NaN
-shix831 shift -1000 NaN -> NaN
-shix832 shift -1 NaN -> NaN
-shix833 shift -0 NaN -> NaN
-shix834 shift 0 NaN -> NaN
-shix835 shift 1 NaN -> NaN
-shix836 shift 1000 NaN -> NaN
-shix837 shift Inf NaN -> NaN
-
-shix841 shift sNaN -Inf -> NaN Invalid_operation
-shix842 shift sNaN -1000 -> NaN Invalid_operation
-shix843 shift sNaN -1 -> NaN Invalid_operation
-shix844 shift sNaN -0 -> NaN Invalid_operation
-shix845 shift sNaN 0 -> NaN Invalid_operation
-shix846 shift sNaN 1 -> NaN Invalid_operation
-shix847 shift sNaN 1000 -> NaN Invalid_operation
-shix848 shift sNaN NaN -> NaN Invalid_operation
-shix849 shift sNaN sNaN -> NaN Invalid_operation
-shix850 shift NaN sNaN -> NaN Invalid_operation
-shix851 shift -Inf sNaN -> NaN Invalid_operation
-shix852 shift -1000 sNaN -> NaN Invalid_operation
-shix853 shift -1 sNaN -> NaN Invalid_operation
-shix854 shift -0 sNaN -> NaN Invalid_operation
-shix855 shift 0 sNaN -> NaN Invalid_operation
-shix856 shift 1 sNaN -> NaN Invalid_operation
-shix857 shift 1000 sNaN -> NaN Invalid_operation
-shix858 shift Inf sNaN -> NaN Invalid_operation
-shix859 shift NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-shix861 shift NaN1 -Inf -> NaN1
-shix862 shift +NaN2 -1000 -> NaN2
-shix863 shift NaN3 1000 -> NaN3
-shix864 shift NaN4 Inf -> NaN4
-shix865 shift NaN5 +NaN6 -> NaN5
-shix866 shift -Inf NaN7 -> NaN7
-shix867 shift -1000 NaN8 -> NaN8
-shix868 shift 1000 NaN9 -> NaN9
-shix869 shift Inf +NaN10 -> NaN10
-shix871 shift sNaN11 -Inf -> NaN11 Invalid_operation
-shix872 shift sNaN12 -1000 -> NaN12 Invalid_operation
-shix873 shift sNaN13 1000 -> NaN13 Invalid_operation
-shix874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
-shix875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
-shix876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
-shix877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
-shix878 shift -1000 sNaN21 -> NaN21 Invalid_operation
-shix879 shift 1000 sNaN22 -> NaN22 Invalid_operation
-shix880 shift Inf sNaN23 -> NaN23 Invalid_operation
-shix881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
-shix882 shift -NaN26 NaN28 -> -NaN26
-shix883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-shix884 shift 1000 -NaN30 -> -NaN30
-shix885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- shift.decTest -- shift coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+shix001 shift 0 0 -> 0
+shix002 shift 0 2 -> 0
+shix003 shift 1 2 -> 100
+shix004 shift 1 8 -> 100000000
+shix005 shift 1 9 -> 0
+shix006 shift 1 -1 -> 0
+shix007 shift 123456789 -1 -> 12345678
+shix008 shift 123456789 -8 -> 1
+shix009 shift 123456789 -9 -> 0
+shix010 shift 0 -2 -> 0
+
+-- rhs must be an integer
+shix011 shift 1 1.5 -> NaN Invalid_operation
+shix012 shift 1 1.0 -> NaN Invalid_operation
+shix013 shift 1 0.1 -> NaN Invalid_operation
+shix014 shift 1 0.0 -> NaN Invalid_operation
+shix015 shift 1 1E+1 -> NaN Invalid_operation
+shix016 shift 1 1E+99 -> NaN Invalid_operation
+shix017 shift 1 Inf -> NaN Invalid_operation
+shix018 shift 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+shix020 shift 1 -1000 -> NaN Invalid_operation
+shix021 shift 1 -10 -> NaN Invalid_operation
+shix022 shift 1 10 -> NaN Invalid_operation
+shix023 shift 1 1000 -> NaN Invalid_operation
+
+-- full shifting pattern
+shix030 shift 123456789 -9 -> 0
+shix031 shift 123456789 -8 -> 1
+shix032 shift 123456789 -7 -> 12
+shix033 shift 123456789 -6 -> 123
+shix034 shift 123456789 -5 -> 1234
+shix035 shift 123456789 -4 -> 12345
+shix036 shift 123456789 -3 -> 123456
+shix037 shift 123456789 -2 -> 1234567
+shix038 shift 123456789 -1 -> 12345678
+shix039 shift 123456789 -0 -> 123456789
+shix040 shift 123456789 +0 -> 123456789
+shix041 shift 123456789 +1 -> 234567890
+shix042 shift 123456789 +2 -> 345678900
+shix043 shift 123456789 +3 -> 456789000
+shix044 shift 123456789 +4 -> 567890000
+shix045 shift 123456789 +5 -> 678900000
+shix046 shift 123456789 +6 -> 789000000
+shix047 shift 123456789 +7 -> 890000000
+shix048 shift 123456789 +8 -> 900000000
+shix049 shift 123456789 +9 -> 0
+
+-- from examples
+shix051 shift 34 8 -> '400000000'
+shix052 shift 12 9 -> '0'
+shix053 shift 123456789 -2 -> '1234567'
+shix054 shift 123456789 0 -> '123456789'
+shix055 shift 123456789 +2 -> '345678900'
+
+-- zeros
+shix060 shift 0E-10 +9 -> 0E-10
+shix061 shift 0E-10 -9 -> 0E-10
+shix062 shift 0.000 +9 -> 0.000
+shix063 shift 0.000 -9 -> 0.000
+shix064 shift 0E+10 +9 -> 0E+10
+shix065 shift 0E+10 -9 -> 0E+10
+shix066 shift -0E-10 +9 -> -0E-10
+shix067 shift -0E-10 -9 -> -0E-10
+shix068 shift -0.000 +9 -> -0.000
+shix069 shift -0.000 -9 -> -0.000
+shix070 shift -0E+10 +9 -> -0E+10
+shix071 shift -0E+10 -9 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+shix141 shift 9.99999999E+999 -1 -> 9.9999999E+998
+shix142 shift 9.99999999E+999 -8 -> 9E+991
+shix143 shift 9.99999999E+999 1 -> 9.99999990E+999
+shix144 shift 9.99999999E+999 8 -> 9.00000000E+999
+shix145 shift 1E-999 -1 -> 0E-999
+shix146 shift 1E-999 -8 -> 0E-999
+shix147 shift 1E-999 1 -> 1.0E-998
+shix148 shift 1E-999 8 -> 1.00000000E-991
+shix151 shift 1.00000000E-999 -1 -> 1.0000000E-1000
+shix152 shift 1.00000000E-999 -8 -> 1E-1007
+shix153 shift 1.00000000E-999 1 -> 0E-1007
+shix154 shift 1.00000000E-999 8 -> 0E-1007
+shix155 shift 9.00000000E-999 -1 -> 9.0000000E-1000
+shix156 shift 9.00000000E-999 -8 -> 9E-1007
+shix157 shift 9.00000000E-999 1 -> 0E-1007
+shix158 shift 9.00000000E-999 8 -> 0E-1007
+shix160 shift 1E-1007 -1 -> 0E-1007
+shix161 shift 1E-1007 -8 -> 0E-1007
+shix162 shift 1E-1007 1 -> 1.0E-1006
+shix163 shift 1E-1007 8 -> 1.00000000E-999
+-- negatives
+shix171 shift -9.99999999E+999 -1 -> -9.9999999E+998
+shix172 shift -9.99999999E+999 -8 -> -9E+991
+shix173 shift -9.99999999E+999 1 -> -9.99999990E+999
+shix174 shift -9.99999999E+999 8 -> -9.00000000E+999
+shix175 shift -1E-999 -1 -> -0E-999
+shix176 shift -1E-999 -8 -> -0E-999
+shix177 shift -1E-999 1 -> -1.0E-998
+shix178 shift -1E-999 8 -> -1.00000000E-991
+shix181 shift -1.00000000E-999 -1 -> -1.0000000E-1000
+shix182 shift -1.00000000E-999 -8 -> -1E-1007
+shix183 shift -1.00000000E-999 1 -> -0E-1007
+shix184 shift -1.00000000E-999 8 -> -0E-1007
+shix185 shift -9.00000000E-999 -1 -> -9.0000000E-1000
+shix186 shift -9.00000000E-999 -8 -> -9E-1007
+shix187 shift -9.00000000E-999 1 -> -0E-1007
+shix188 shift -9.00000000E-999 8 -> -0E-1007
+shix190 shift -1E-1007 -1 -> -0E-1007
+shix191 shift -1E-1007 -8 -> -0E-1007
+shix192 shift -1E-1007 1 -> -1.0E-1006
+shix193 shift -1E-1007 8 -> -1.00000000E-999
+
+-- more negatives (of sanities)
+shix201 shift -0 0 -> -0
+shix202 shift -0 2 -> -0
+shix203 shift -1 2 -> -100
+shix204 shift -1 8 -> -100000000
+shix205 shift -1 9 -> -0
+shix206 shift -1 -1 -> -0
+shix207 shift -123456789 -1 -> -12345678
+shix208 shift -123456789 -8 -> -1
+shix209 shift -123456789 -9 -> -0
+shix210 shift -0 -2 -> -0
+shix211 shift -0 -0 -> -0
+
+
+-- Specials; NaNs are handled as usual
+shix781 shift -Inf -8 -> -Infinity
+shix782 shift -Inf -1 -> -Infinity
+shix783 shift -Inf -0 -> -Infinity
+shix784 shift -Inf 0 -> -Infinity
+shix785 shift -Inf 1 -> -Infinity
+shix786 shift -Inf 8 -> -Infinity
+shix787 shift -1000 -Inf -> NaN Invalid_operation
+shix788 shift -Inf -Inf -> NaN Invalid_operation
+shix789 shift -1 -Inf -> NaN Invalid_operation
+shix790 shift -0 -Inf -> NaN Invalid_operation
+shix791 shift 0 -Inf -> NaN Invalid_operation
+shix792 shift 1 -Inf -> NaN Invalid_operation
+shix793 shift 1000 -Inf -> NaN Invalid_operation
+shix794 shift Inf -Inf -> NaN Invalid_operation
+
+shix800 shift Inf -Inf -> NaN Invalid_operation
+shix801 shift Inf -8 -> Infinity
+shix802 shift Inf -1 -> Infinity
+shix803 shift Inf -0 -> Infinity
+shix804 shift Inf 0 -> Infinity
+shix805 shift Inf 1 -> Infinity
+shix806 shift Inf 8 -> Infinity
+shix807 shift Inf Inf -> NaN Invalid_operation
+shix808 shift -1000 Inf -> NaN Invalid_operation
+shix809 shift -Inf Inf -> NaN Invalid_operation
+shix810 shift -1 Inf -> NaN Invalid_operation
+shix811 shift -0 Inf -> NaN Invalid_operation
+shix812 shift 0 Inf -> NaN Invalid_operation
+shix813 shift 1 Inf -> NaN Invalid_operation
+shix814 shift 1000 Inf -> NaN Invalid_operation
+shix815 shift Inf Inf -> NaN Invalid_operation
+
+shix821 shift NaN -Inf -> NaN
+shix822 shift NaN -1000 -> NaN
+shix823 shift NaN -1 -> NaN
+shix824 shift NaN -0 -> NaN
+shix825 shift NaN 0 -> NaN
+shix826 shift NaN 1 -> NaN
+shix827 shift NaN 1000 -> NaN
+shix828 shift NaN Inf -> NaN
+shix829 shift NaN NaN -> NaN
+shix830 shift -Inf NaN -> NaN
+shix831 shift -1000 NaN -> NaN
+shix832 shift -1 NaN -> NaN
+shix833 shift -0 NaN -> NaN
+shix834 shift 0 NaN -> NaN
+shix835 shift 1 NaN -> NaN
+shix836 shift 1000 NaN -> NaN
+shix837 shift Inf NaN -> NaN
+
+shix841 shift sNaN -Inf -> NaN Invalid_operation
+shix842 shift sNaN -1000 -> NaN Invalid_operation
+shix843 shift sNaN -1 -> NaN Invalid_operation
+shix844 shift sNaN -0 -> NaN Invalid_operation
+shix845 shift sNaN 0 -> NaN Invalid_operation
+shix846 shift sNaN 1 -> NaN Invalid_operation
+shix847 shift sNaN 1000 -> NaN Invalid_operation
+shix848 shift sNaN NaN -> NaN Invalid_operation
+shix849 shift sNaN sNaN -> NaN Invalid_operation
+shix850 shift NaN sNaN -> NaN Invalid_operation
+shix851 shift -Inf sNaN -> NaN Invalid_operation
+shix852 shift -1000 sNaN -> NaN Invalid_operation
+shix853 shift -1 sNaN -> NaN Invalid_operation
+shix854 shift -0 sNaN -> NaN Invalid_operation
+shix855 shift 0 sNaN -> NaN Invalid_operation
+shix856 shift 1 sNaN -> NaN Invalid_operation
+shix857 shift 1000 sNaN -> NaN Invalid_operation
+shix858 shift Inf sNaN -> NaN Invalid_operation
+shix859 shift NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+shix861 shift NaN1 -Inf -> NaN1
+shix862 shift +NaN2 -1000 -> NaN2
+shix863 shift NaN3 1000 -> NaN3
+shix864 shift NaN4 Inf -> NaN4
+shix865 shift NaN5 +NaN6 -> NaN5
+shix866 shift -Inf NaN7 -> NaN7
+shix867 shift -1000 NaN8 -> NaN8
+shix868 shift 1000 NaN9 -> NaN9
+shix869 shift Inf +NaN10 -> NaN10
+shix871 shift sNaN11 -Inf -> NaN11 Invalid_operation
+shix872 shift sNaN12 -1000 -> NaN12 Invalid_operation
+shix873 shift sNaN13 1000 -> NaN13 Invalid_operation
+shix874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
+shix875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
+shix876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
+shix877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
+shix878 shift -1000 sNaN21 -> NaN21 Invalid_operation
+shix879 shift 1000 sNaN22 -> NaN22 Invalid_operation
+shix880 shift Inf sNaN23 -> NaN23 Invalid_operation
+shix881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
+shix882 shift -NaN26 NaN28 -> -NaN26
+shix883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+shix884 shift 1000 -NaN30 -> -NaN30
+shix885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/tointegralx.decTest b/Lib/test/decimaltestdata/tointegralx.decTest
index e250e3a06e..0ce0d0935e 100644
--- a/Lib/test/decimaltestdata/tointegralx.decTest
+++ b/Lib/test/decimaltestdata/tointegralx.decTest
@@ -1,255 +1,255 @@
-------------------------------------------------------------------------
--- tointegralx.decTest -- round decimal to integral value, exact --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests tests the extended specification 'round-to-integral
--- value' operation (from IEEE 854, later modified in 754r).
--- All non-zero results are defined as being those from either copy or
--- quantize, so those are assumed to have been tested.
-
--- This tests toIntegraExact, which may set Inexact
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
-intxx001 tointegralx 0 -> 0
-intxx002 tointegralx 0.0 -> 0
-intxx003 tointegralx 0.1 -> 0 Inexact Rounded
-intxx004 tointegralx 0.2 -> 0 Inexact Rounded
-intxx005 tointegralx 0.3 -> 0 Inexact Rounded
-intxx006 tointegralx 0.4 -> 0 Inexact Rounded
-intxx007 tointegralx 0.5 -> 1 Inexact Rounded
-intxx008 tointegralx 0.6 -> 1 Inexact Rounded
-intxx009 tointegralx 0.7 -> 1 Inexact Rounded
-intxx010 tointegralx 0.8 -> 1 Inexact Rounded
-intxx011 tointegralx 0.9 -> 1 Inexact Rounded
-intxx012 tointegralx 1 -> 1
-intxx013 tointegralx 1.0 -> 1 Rounded
-intxx014 tointegralx 1.1 -> 1 Inexact Rounded
-intxx015 tointegralx 1.2 -> 1 Inexact Rounded
-intxx016 tointegralx 1.3 -> 1 Inexact Rounded
-intxx017 tointegralx 1.4 -> 1 Inexact Rounded
-intxx018 tointegralx 1.5 -> 2 Inexact Rounded
-intxx019 tointegralx 1.6 -> 2 Inexact Rounded
-intxx020 tointegralx 1.7 -> 2 Inexact Rounded
-intxx021 tointegralx 1.8 -> 2 Inexact Rounded
-intxx022 tointegralx 1.9 -> 2 Inexact Rounded
--- negatives
-intxx031 tointegralx -0 -> -0
-intxx032 tointegralx -0.0 -> -0
-intxx033 tointegralx -0.1 -> -0 Inexact Rounded
-intxx034 tointegralx -0.2 -> -0 Inexact Rounded
-intxx035 tointegralx -0.3 -> -0 Inexact Rounded
-intxx036 tointegralx -0.4 -> -0 Inexact Rounded
-intxx037 tointegralx -0.5 -> -1 Inexact Rounded
-intxx038 tointegralx -0.6 -> -1 Inexact Rounded
-intxx039 tointegralx -0.7 -> -1 Inexact Rounded
-intxx040 tointegralx -0.8 -> -1 Inexact Rounded
-intxx041 tointegralx -0.9 -> -1 Inexact Rounded
-intxx042 tointegralx -1 -> -1
-intxx043 tointegralx -1.0 -> -1 Rounded
-intxx044 tointegralx -1.1 -> -1 Inexact Rounded
-intxx045 tointegralx -1.2 -> -1 Inexact Rounded
-intxx046 tointegralx -1.3 -> -1 Inexact Rounded
-intxx047 tointegralx -1.4 -> -1 Inexact Rounded
-intxx048 tointegralx -1.5 -> -2 Inexact Rounded
-intxx049 tointegralx -1.6 -> -2 Inexact Rounded
-intxx050 tointegralx -1.7 -> -2 Inexact Rounded
-intxx051 tointegralx -1.8 -> -2 Inexact Rounded
-intxx052 tointegralx -1.9 -> -2 Inexact Rounded
--- next two would be NaN using quantize(x, 0)
-intxx053 tointegralx 10E+30 -> 1.0E+31
-intxx054 tointegralx -10E+30 -> -1.0E+31
-
--- numbers around precision
-precision: 9
-intxx060 tointegralx '56267E-10' -> '0' Inexact Rounded
-intxx061 tointegralx '56267E-5' -> '1' Inexact Rounded
-intxx062 tointegralx '56267E-2' -> '563' Inexact Rounded
-intxx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
-intxx065 tointegralx '56267E-0' -> '56267'
-intxx066 tointegralx '56267E+0' -> '56267'
-intxx067 tointegralx '56267E+1' -> '5.6267E+5'
-intxx068 tointegralx '56267E+2' -> '5.6267E+6'
-intxx069 tointegralx '56267E+3' -> '5.6267E+7'
-intxx070 tointegralx '56267E+4' -> '5.6267E+8'
-intxx071 tointegralx '56267E+5' -> '5.6267E+9'
-intxx072 tointegralx '56267E+6' -> '5.6267E+10'
-intxx073 tointegralx '1.23E+96' -> '1.23E+96'
-intxx074 tointegralx '1.23E+384' -> '1.23E+384'
-intxx075 tointegralx '1.23E+999' -> '1.23E+999'
-
-intxx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
-intxx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
-intxx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
-intxx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
-intxx085 tointegralx '-56267E-0' -> '-56267'
-intxx086 tointegralx '-56267E+0' -> '-56267'
-intxx087 tointegralx '-56267E+1' -> '-5.6267E+5'
-intxx088 tointegralx '-56267E+2' -> '-5.6267E+6'
-intxx089 tointegralx '-56267E+3' -> '-5.6267E+7'
-intxx090 tointegralx '-56267E+4' -> '-5.6267E+8'
-intxx091 tointegralx '-56267E+5' -> '-5.6267E+9'
-intxx092 tointegralx '-56267E+6' -> '-5.6267E+10'
-intxx093 tointegralx '-1.23E+96' -> '-1.23E+96'
-intxx094 tointegralx '-1.23E+384' -> '-1.23E+384'
-intxx095 tointegralx '-1.23E+999' -> '-1.23E+999'
-
--- subnormal inputs
-intxx100 tointegralx 1E-999 -> 0 Inexact Rounded
-intxx101 tointegralx 0.1E-999 -> 0 Inexact Rounded
-intxx102 tointegralx 0.01E-999 -> 0 Inexact Rounded
-intxx103 tointegralx 0E-999 -> 0
-
--- specials and zeros
-intxx120 tointegralx 'Inf' -> Infinity
-intxx121 tointegralx '-Inf' -> -Infinity
-intxx122 tointegralx NaN -> NaN
-intxx123 tointegralx sNaN -> NaN Invalid_operation
-intxx124 tointegralx 0 -> 0
-intxx125 tointegralx -0 -> -0
-intxx126 tointegralx 0.000 -> 0
-intxx127 tointegralx 0.00 -> 0
-intxx128 tointegralx 0.0 -> 0
-intxx129 tointegralx 0 -> 0
-intxx130 tointegralx 0E-3 -> 0
-intxx131 tointegralx 0E-2 -> 0
-intxx132 tointegralx 0E-1 -> 0
-intxx133 tointegralx 0E-0 -> 0
-intxx134 tointegralx 0E+1 -> 0E+1
-intxx135 tointegralx 0E+2 -> 0E+2
-intxx136 tointegralx 0E+3 -> 0E+3
-intxx137 tointegralx 0E+4 -> 0E+4
-intxx138 tointegralx 0E+5 -> 0E+5
-intxx139 tointegralx -0.000 -> -0
-intxx140 tointegralx -0.00 -> -0
-intxx141 tointegralx -0.0 -> -0
-intxx142 tointegralx -0 -> -0
-intxx143 tointegralx -0E-3 -> -0
-intxx144 tointegralx -0E-2 -> -0
-intxx145 tointegralx -0E-1 -> -0
-intxx146 tointegralx -0E-0 -> -0
-intxx147 tointegralx -0E+1 -> -0E+1
-intxx148 tointegralx -0E+2 -> -0E+2
-intxx149 tointegralx -0E+3 -> -0E+3
-intxx150 tointegralx -0E+4 -> -0E+4
-intxx151 tointegralx -0E+5 -> -0E+5
--- propagating NaNs
-intxx152 tointegralx NaN808 -> NaN808
-intxx153 tointegralx sNaN080 -> NaN80 Invalid_operation
-intxx154 tointegralx -NaN808 -> -NaN808
-intxx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
-intxx156 tointegralx -NaN -> -NaN
-intxx157 tointegralx -sNaN -> -NaN Invalid_operation
-
--- examples
-rounding: half_up
-precision: 9
-intxx200 tointegralx 2.1 -> 2 Inexact Rounded
-intxx201 tointegralx 100 -> 100
-intxx202 tointegralx 100.0 -> 100 Rounded
-intxx203 tointegralx 101.5 -> 102 Inexact Rounded
-intxx204 tointegralx -101.5 -> -102 Inexact Rounded
-intxx205 tointegralx 10E+5 -> 1.0E+6
-intxx206 tointegralx 7.89E+77 -> 7.89E+77
-intxx207 tointegralx -Inf -> -Infinity
-
-
--- all rounding modes
-rounding: half_even
-
-intxx210 tointegralx 55.5 -> 56 Inexact Rounded
-intxx211 tointegralx 56.5 -> 56 Inexact Rounded
-intxx212 tointegralx 57.5 -> 58 Inexact Rounded
-intxx213 tointegralx -55.5 -> -56 Inexact Rounded
-intxx214 tointegralx -56.5 -> -56 Inexact Rounded
-intxx215 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_up
-
-intxx220 tointegralx 55.5 -> 56 Inexact Rounded
-intxx221 tointegralx 56.5 -> 57 Inexact Rounded
-intxx222 tointegralx 57.5 -> 58 Inexact Rounded
-intxx223 tointegralx -55.5 -> -56 Inexact Rounded
-intxx224 tointegralx -56.5 -> -57 Inexact Rounded
-intxx225 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_down
-
-intxx230 tointegralx 55.5 -> 55 Inexact Rounded
-intxx231 tointegralx 56.5 -> 56 Inexact Rounded
-intxx232 tointegralx 57.5 -> 57 Inexact Rounded
-intxx233 tointegralx -55.5 -> -55 Inexact Rounded
-intxx234 tointegralx -56.5 -> -56 Inexact Rounded
-intxx235 tointegralx -57.5 -> -57 Inexact Rounded
-
-rounding: up
-
-intxx240 tointegralx 55.3 -> 56 Inexact Rounded
-intxx241 tointegralx 56.3 -> 57 Inexact Rounded
-intxx242 tointegralx 57.3 -> 58 Inexact Rounded
-intxx243 tointegralx -55.3 -> -56 Inexact Rounded
-intxx244 tointegralx -56.3 -> -57 Inexact Rounded
-intxx245 tointegralx -57.3 -> -58 Inexact Rounded
-
-rounding: down
-
-intxx250 tointegralx 55.7 -> 55 Inexact Rounded
-intxx251 tointegralx 56.7 -> 56 Inexact Rounded
-intxx252 tointegralx 57.7 -> 57 Inexact Rounded
-intxx253 tointegralx -55.7 -> -55 Inexact Rounded
-intxx254 tointegralx -56.7 -> -56 Inexact Rounded
-intxx255 tointegralx -57.7 -> -57 Inexact Rounded
-
-rounding: ceiling
-
-intxx260 tointegralx 55.3 -> 56 Inexact Rounded
-intxx261 tointegralx 56.3 -> 57 Inexact Rounded
-intxx262 tointegralx 57.3 -> 58 Inexact Rounded
-intxx263 tointegralx -55.3 -> -55 Inexact Rounded
-intxx264 tointegralx -56.3 -> -56 Inexact Rounded
-intxx265 tointegralx -57.3 -> -57 Inexact Rounded
-
-rounding: floor
-
-intxx270 tointegralx 55.7 -> 55 Inexact Rounded
-intxx271 tointegralx 56.7 -> 56 Inexact Rounded
-intxx272 tointegralx 57.7 -> 57 Inexact Rounded
-intxx273 tointegralx -55.7 -> -56 Inexact Rounded
-intxx274 tointegralx -56.7 -> -57 Inexact Rounded
-intxx275 tointegralx -57.7 -> -58 Inexact Rounded
-
--- Int and uInt32 edge values for testing conversions
-precision: 16
-intxx300 tointegralx -2147483646 -> -2147483646
-intxx301 tointegralx -2147483647 -> -2147483647
-intxx302 tointegralx -2147483648 -> -2147483648
-intxx303 tointegralx -2147483649 -> -2147483649
-intxx304 tointegralx 2147483646 -> 2147483646
-intxx305 tointegralx 2147483647 -> 2147483647
-intxx306 tointegralx 2147483648 -> 2147483648
-intxx307 tointegralx 2147483649 -> 2147483649
-intxx308 tointegralx 4294967294 -> 4294967294
-intxx309 tointegralx 4294967295 -> 4294967295
-intxx310 tointegralx 4294967296 -> 4294967296
-intxx311 tointegralx 4294967297 -> 4294967297
+------------------------------------------------------------------------
+-- tointegralx.decTest -- round decimal to integral value, exact --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests tests the extended specification 'round-to-integral
+-- value' operation (from IEEE 854, later modified in 754r).
+-- All non-zero results are defined as being those from either copy or
+-- quantize, so those are assumed to have been tested.
+
+-- This tests toIntegraExact, which may set Inexact
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+intxx001 tointegralx 0 -> 0
+intxx002 tointegralx 0.0 -> 0
+intxx003 tointegralx 0.1 -> 0 Inexact Rounded
+intxx004 tointegralx 0.2 -> 0 Inexact Rounded
+intxx005 tointegralx 0.3 -> 0 Inexact Rounded
+intxx006 tointegralx 0.4 -> 0 Inexact Rounded
+intxx007 tointegralx 0.5 -> 1 Inexact Rounded
+intxx008 tointegralx 0.6 -> 1 Inexact Rounded
+intxx009 tointegralx 0.7 -> 1 Inexact Rounded
+intxx010 tointegralx 0.8 -> 1 Inexact Rounded
+intxx011 tointegralx 0.9 -> 1 Inexact Rounded
+intxx012 tointegralx 1 -> 1
+intxx013 tointegralx 1.0 -> 1 Rounded
+intxx014 tointegralx 1.1 -> 1 Inexact Rounded
+intxx015 tointegralx 1.2 -> 1 Inexact Rounded
+intxx016 tointegralx 1.3 -> 1 Inexact Rounded
+intxx017 tointegralx 1.4 -> 1 Inexact Rounded
+intxx018 tointegralx 1.5 -> 2 Inexact Rounded
+intxx019 tointegralx 1.6 -> 2 Inexact Rounded
+intxx020 tointegralx 1.7 -> 2 Inexact Rounded
+intxx021 tointegralx 1.8 -> 2 Inexact Rounded
+intxx022 tointegralx 1.9 -> 2 Inexact Rounded
+-- negatives
+intxx031 tointegralx -0 -> -0
+intxx032 tointegralx -0.0 -> -0
+intxx033 tointegralx -0.1 -> -0 Inexact Rounded
+intxx034 tointegralx -0.2 -> -0 Inexact Rounded
+intxx035 tointegralx -0.3 -> -0 Inexact Rounded
+intxx036 tointegralx -0.4 -> -0 Inexact Rounded
+intxx037 tointegralx -0.5 -> -1 Inexact Rounded
+intxx038 tointegralx -0.6 -> -1 Inexact Rounded
+intxx039 tointegralx -0.7 -> -1 Inexact Rounded
+intxx040 tointegralx -0.8 -> -1 Inexact Rounded
+intxx041 tointegralx -0.9 -> -1 Inexact Rounded
+intxx042 tointegralx -1 -> -1
+intxx043 tointegralx -1.0 -> -1 Rounded
+intxx044 tointegralx -1.1 -> -1 Inexact Rounded
+intxx045 tointegralx -1.2 -> -1 Inexact Rounded
+intxx046 tointegralx -1.3 -> -1 Inexact Rounded
+intxx047 tointegralx -1.4 -> -1 Inexact Rounded
+intxx048 tointegralx -1.5 -> -2 Inexact Rounded
+intxx049 tointegralx -1.6 -> -2 Inexact Rounded
+intxx050 tointegralx -1.7 -> -2 Inexact Rounded
+intxx051 tointegralx -1.8 -> -2 Inexact Rounded
+intxx052 tointegralx -1.9 -> -2 Inexact Rounded
+-- next two would be NaN using quantize(x, 0)
+intxx053 tointegralx 10E+30 -> 1.0E+31
+intxx054 tointegralx -10E+30 -> -1.0E+31
+
+-- numbers around precision
+precision: 9
+intxx060 tointegralx '56267E-10' -> '0' Inexact Rounded
+intxx061 tointegralx '56267E-5' -> '1' Inexact Rounded
+intxx062 tointegralx '56267E-2' -> '563' Inexact Rounded
+intxx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
+intxx065 tointegralx '56267E-0' -> '56267'
+intxx066 tointegralx '56267E+0' -> '56267'
+intxx067 tointegralx '56267E+1' -> '5.6267E+5'
+intxx068 tointegralx '56267E+2' -> '5.6267E+6'
+intxx069 tointegralx '56267E+3' -> '5.6267E+7'
+intxx070 tointegralx '56267E+4' -> '5.6267E+8'
+intxx071 tointegralx '56267E+5' -> '5.6267E+9'
+intxx072 tointegralx '56267E+6' -> '5.6267E+10'
+intxx073 tointegralx '1.23E+96' -> '1.23E+96'
+intxx074 tointegralx '1.23E+384' -> '1.23E+384'
+intxx075 tointegralx '1.23E+999' -> '1.23E+999'
+
+intxx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
+intxx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
+intxx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
+intxx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
+intxx085 tointegralx '-56267E-0' -> '-56267'
+intxx086 tointegralx '-56267E+0' -> '-56267'
+intxx087 tointegralx '-56267E+1' -> '-5.6267E+5'
+intxx088 tointegralx '-56267E+2' -> '-5.6267E+6'
+intxx089 tointegralx '-56267E+3' -> '-5.6267E+7'
+intxx090 tointegralx '-56267E+4' -> '-5.6267E+8'
+intxx091 tointegralx '-56267E+5' -> '-5.6267E+9'
+intxx092 tointegralx '-56267E+6' -> '-5.6267E+10'
+intxx093 tointegralx '-1.23E+96' -> '-1.23E+96'
+intxx094 tointegralx '-1.23E+384' -> '-1.23E+384'
+intxx095 tointegralx '-1.23E+999' -> '-1.23E+999'
+
+-- subnormal inputs
+intxx100 tointegralx 1E-999 -> 0 Inexact Rounded
+intxx101 tointegralx 0.1E-999 -> 0 Inexact Rounded
+intxx102 tointegralx 0.01E-999 -> 0 Inexact Rounded
+intxx103 tointegralx 0E-999 -> 0
+
+-- specials and zeros
+intxx120 tointegralx 'Inf' -> Infinity
+intxx121 tointegralx '-Inf' -> -Infinity
+intxx122 tointegralx NaN -> NaN
+intxx123 tointegralx sNaN -> NaN Invalid_operation
+intxx124 tointegralx 0 -> 0
+intxx125 tointegralx -0 -> -0
+intxx126 tointegralx 0.000 -> 0
+intxx127 tointegralx 0.00 -> 0
+intxx128 tointegralx 0.0 -> 0
+intxx129 tointegralx 0 -> 0
+intxx130 tointegralx 0E-3 -> 0
+intxx131 tointegralx 0E-2 -> 0
+intxx132 tointegralx 0E-1 -> 0
+intxx133 tointegralx 0E-0 -> 0
+intxx134 tointegralx 0E+1 -> 0E+1
+intxx135 tointegralx 0E+2 -> 0E+2
+intxx136 tointegralx 0E+3 -> 0E+3
+intxx137 tointegralx 0E+4 -> 0E+4
+intxx138 tointegralx 0E+5 -> 0E+5
+intxx139 tointegralx -0.000 -> -0
+intxx140 tointegralx -0.00 -> -0
+intxx141 tointegralx -0.0 -> -0
+intxx142 tointegralx -0 -> -0
+intxx143 tointegralx -0E-3 -> -0
+intxx144 tointegralx -0E-2 -> -0
+intxx145 tointegralx -0E-1 -> -0
+intxx146 tointegralx -0E-0 -> -0
+intxx147 tointegralx -0E+1 -> -0E+1
+intxx148 tointegralx -0E+2 -> -0E+2
+intxx149 tointegralx -0E+3 -> -0E+3
+intxx150 tointegralx -0E+4 -> -0E+4
+intxx151 tointegralx -0E+5 -> -0E+5
+-- propagating NaNs
+intxx152 tointegralx NaN808 -> NaN808
+intxx153 tointegralx sNaN080 -> NaN80 Invalid_operation
+intxx154 tointegralx -NaN808 -> -NaN808
+intxx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
+intxx156 tointegralx -NaN -> -NaN
+intxx157 tointegralx -sNaN -> -NaN Invalid_operation
+
+-- examples
+rounding: half_up
+precision: 9
+intxx200 tointegralx 2.1 -> 2 Inexact Rounded
+intxx201 tointegralx 100 -> 100
+intxx202 tointegralx 100.0 -> 100 Rounded
+intxx203 tointegralx 101.5 -> 102 Inexact Rounded
+intxx204 tointegralx -101.5 -> -102 Inexact Rounded
+intxx205 tointegralx 10E+5 -> 1.0E+6
+intxx206 tointegralx 7.89E+77 -> 7.89E+77
+intxx207 tointegralx -Inf -> -Infinity
+
+
+-- all rounding modes
+rounding: half_even
+
+intxx210 tointegralx 55.5 -> 56 Inexact Rounded
+intxx211 tointegralx 56.5 -> 56 Inexact Rounded
+intxx212 tointegralx 57.5 -> 58 Inexact Rounded
+intxx213 tointegralx -55.5 -> -56 Inexact Rounded
+intxx214 tointegralx -56.5 -> -56 Inexact Rounded
+intxx215 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_up
+
+intxx220 tointegralx 55.5 -> 56 Inexact Rounded
+intxx221 tointegralx 56.5 -> 57 Inexact Rounded
+intxx222 tointegralx 57.5 -> 58 Inexact Rounded
+intxx223 tointegralx -55.5 -> -56 Inexact Rounded
+intxx224 tointegralx -56.5 -> -57 Inexact Rounded
+intxx225 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_down
+
+intxx230 tointegralx 55.5 -> 55 Inexact Rounded
+intxx231 tointegralx 56.5 -> 56 Inexact Rounded
+intxx232 tointegralx 57.5 -> 57 Inexact Rounded
+intxx233 tointegralx -55.5 -> -55 Inexact Rounded
+intxx234 tointegralx -56.5 -> -56 Inexact Rounded
+intxx235 tointegralx -57.5 -> -57 Inexact Rounded
+
+rounding: up
+
+intxx240 tointegralx 55.3 -> 56 Inexact Rounded
+intxx241 tointegralx 56.3 -> 57 Inexact Rounded
+intxx242 tointegralx 57.3 -> 58 Inexact Rounded
+intxx243 tointegralx -55.3 -> -56 Inexact Rounded
+intxx244 tointegralx -56.3 -> -57 Inexact Rounded
+intxx245 tointegralx -57.3 -> -58 Inexact Rounded
+
+rounding: down
+
+intxx250 tointegralx 55.7 -> 55 Inexact Rounded
+intxx251 tointegralx 56.7 -> 56 Inexact Rounded
+intxx252 tointegralx 57.7 -> 57 Inexact Rounded
+intxx253 tointegralx -55.7 -> -55 Inexact Rounded
+intxx254 tointegralx -56.7 -> -56 Inexact Rounded
+intxx255 tointegralx -57.7 -> -57 Inexact Rounded
+
+rounding: ceiling
+
+intxx260 tointegralx 55.3 -> 56 Inexact Rounded
+intxx261 tointegralx 56.3 -> 57 Inexact Rounded
+intxx262 tointegralx 57.3 -> 58 Inexact Rounded
+intxx263 tointegralx -55.3 -> -55 Inexact Rounded
+intxx264 tointegralx -56.3 -> -56 Inexact Rounded
+intxx265 tointegralx -57.3 -> -57 Inexact Rounded
+
+rounding: floor
+
+intxx270 tointegralx 55.7 -> 55 Inexact Rounded
+intxx271 tointegralx 56.7 -> 56 Inexact Rounded
+intxx272 tointegralx 57.7 -> 57 Inexact Rounded
+intxx273 tointegralx -55.7 -> -56 Inexact Rounded
+intxx274 tointegralx -56.7 -> -57 Inexact Rounded
+intxx275 tointegralx -57.7 -> -58 Inexact Rounded
+
+-- Int and uInt32 edge values for testing conversions
+precision: 16
+intxx300 tointegralx -2147483646 -> -2147483646
+intxx301 tointegralx -2147483647 -> -2147483647
+intxx302 tointegralx -2147483648 -> -2147483648
+intxx303 tointegralx -2147483649 -> -2147483649
+intxx304 tointegralx 2147483646 -> 2147483646
+intxx305 tointegralx 2147483647 -> 2147483647
+intxx306 tointegralx 2147483648 -> 2147483648
+intxx307 tointegralx 2147483649 -> 2147483649
+intxx308 tointegralx 4294967294 -> 4294967294
+intxx309 tointegralx 4294967295 -> 4294967295
+intxx310 tointegralx 4294967296 -> 4294967296
+intxx311 tointegralx 4294967297 -> 4294967297
diff --git a/Lib/test/decimaltestdata/xor.decTest b/Lib/test/decimaltestdata/xor.decTest
index 122976e44c..cd71bbcf86 100644
--- a/Lib/test/decimaltestdata/xor.decTest
+++ b/Lib/test/decimaltestdata/xor.decTest
@@ -1,335 +1,335 @@
-------------------------------------------------------------------------
--- xor.decTest -- digitwise logical XOR --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check (truth table)
-xorx001 xor 0 0 -> 0
-xorx002 xor 0 1 -> 1
-xorx003 xor 1 0 -> 1
-xorx004 xor 1 1 -> 0
-xorx005 xor 1100 1010 -> 110
-xorx006 xor 1111 10 -> 1101
--- and at msd and msd-1
-xorx010 xor 000000000 000000000 -> 0
-xorx011 xor 000000000 100000000 -> 100000000
-xorx012 xor 100000000 000000000 -> 100000000
-xorx013 xor 100000000 100000000 -> 0
-xorx014 xor 000000000 000000000 -> 0
-xorx015 xor 000000000 010000000 -> 10000000
-xorx016 xor 010000000 000000000 -> 10000000
-xorx017 xor 010000000 010000000 -> 0
-
--- Various lengths
--- 123456789 123456789 123456789
-xorx021 xor 111111111 111111111 -> 0
-xorx022 xor 111111111111 111111111 -> 0
-xorx023 xor 11111111 11111111 -> 0
-xorx025 xor 1111111 1111111 -> 0
-xorx026 xor 111111 111111 -> 0
-xorx027 xor 11111 11111 -> 0
-xorx028 xor 1111 1111 -> 0
-xorx029 xor 111 111 -> 0
-xorx031 xor 11 11 -> 0
-xorx032 xor 1 1 -> 0
-xorx033 xor 111111111111 1111111111 -> 0
-xorx034 xor 11111111111 11111111111 -> 0
-xorx035 xor 1111111111 111111111111 -> 0
-xorx036 xor 111111111 1111111111111 -> 0
-
-xorx040 xor 111111111 111111111111 -> 0
-xorx041 xor 11111111 111111111111 -> 100000000
-xorx042 xor 11111111 111111111 -> 100000000
-xorx043 xor 1111111 100000010 -> 101111101
-xorx044 xor 111111 100000100 -> 100111011
-xorx045 xor 11111 100001000 -> 100010111
-xorx046 xor 1111 100010000 -> 100011111
-xorx047 xor 111 100100000 -> 100100111
-xorx048 xor 11 101000000 -> 101000011
-xorx049 xor 1 110000000 -> 110000001
-
-xorx050 xor 1111111111 1 -> 111111110
-xorx051 xor 111111111 1 -> 111111110
-xorx052 xor 11111111 1 -> 11111110
-xorx053 xor 1111111 1 -> 1111110
-xorx054 xor 111111 1 -> 111110
-xorx055 xor 11111 1 -> 11110
-xorx056 xor 1111 1 -> 1110
-xorx057 xor 111 1 -> 110
-xorx058 xor 11 1 -> 10
-xorx059 xor 1 1 -> 0
-
-xorx060 xor 1111111111 0 -> 111111111
-xorx061 xor 111111111 0 -> 111111111
-xorx062 xor 11111111 0 -> 11111111
-xorx063 xor 1111111 0 -> 1111111
-xorx064 xor 111111 0 -> 111111
-xorx065 xor 11111 0 -> 11111
-xorx066 xor 1111 0 -> 1111
-xorx067 xor 111 0 -> 111
-xorx068 xor 11 0 -> 11
-xorx069 xor 1 0 -> 1
-
-xorx070 xor 1 1111111111 -> 111111110
-xorx071 xor 1 111111111 -> 111111110
-xorx072 xor 1 11111111 -> 11111110
-xorx073 xor 1 1111111 -> 1111110
-xorx074 xor 1 111111 -> 111110
-xorx075 xor 1 11111 -> 11110
-xorx076 xor 1 1111 -> 1110
-xorx077 xor 1 111 -> 110
-xorx078 xor 1 11 -> 10
-xorx079 xor 1 1 -> 0
-
-xorx080 xor 0 1111111111 -> 111111111
-xorx081 xor 0 111111111 -> 111111111
-xorx082 xor 0 11111111 -> 11111111
-xorx083 xor 0 1111111 -> 1111111
-xorx084 xor 0 111111 -> 111111
-xorx085 xor 0 11111 -> 11111
-xorx086 xor 0 1111 -> 1111
-xorx087 xor 0 111 -> 111
-xorx088 xor 0 11 -> 11
-xorx089 xor 0 1 -> 1
-
-xorx090 xor 011111111 111101111 -> 100010000
-xorx091 xor 101111111 111101111 -> 10010000
-xorx092 xor 110111111 111101111 -> 1010000
-xorx093 xor 111011111 111101111 -> 110000
-xorx094 xor 111101111 111101111 -> 0
-xorx095 xor 111110111 111101111 -> 11000
-xorx096 xor 111111011 111101111 -> 10100
-xorx097 xor 111111101 111101111 -> 10010
-xorx098 xor 111111110 111101111 -> 10001
-
-xorx100 xor 111101111 011111111 -> 100010000
-xorx101 xor 111101111 101111111 -> 10010000
-xorx102 xor 111101111 110111111 -> 1010000
-xorx103 xor 111101111 111011111 -> 110000
-xorx104 xor 111101111 111101111 -> 0
-xorx105 xor 111101111 111110111 -> 11000
-xorx106 xor 111101111 111111011 -> 10100
-xorx107 xor 111101111 111111101 -> 10010
-xorx108 xor 111101111 111111110 -> 10001
-
--- non-0/1 should not be accepted, nor should signs
-xorx220 xor 111111112 111111111 -> NaN Invalid_operation
-xorx221 xor 333333333 333333333 -> NaN Invalid_operation
-xorx222 xor 555555555 555555555 -> NaN Invalid_operation
-xorx223 xor 777777777 777777777 -> NaN Invalid_operation
-xorx224 xor 999999999 999999999 -> NaN Invalid_operation
-xorx225 xor 222222222 999999999 -> NaN Invalid_operation
-xorx226 xor 444444444 999999999 -> NaN Invalid_operation
-xorx227 xor 666666666 999999999 -> NaN Invalid_operation
-xorx228 xor 888888888 999999999 -> NaN Invalid_operation
-xorx229 xor 999999999 222222222 -> NaN Invalid_operation
-xorx230 xor 999999999 444444444 -> NaN Invalid_operation
-xorx231 xor 999999999 666666666 -> NaN Invalid_operation
-xorx232 xor 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-xorx240 xor 567468689 -934981942 -> NaN Invalid_operation
-xorx241 xor 567367689 934981942 -> NaN Invalid_operation
-xorx242 xor -631917772 -706014634 -> NaN Invalid_operation
-xorx243 xor -756253257 138579234 -> NaN Invalid_operation
-xorx244 xor 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-xorx250 xor 200000000 100000000 -> NaN Invalid_operation
-xorx251 xor 700000000 100000000 -> NaN Invalid_operation
-xorx252 xor 800000000 100000000 -> NaN Invalid_operation
-xorx253 xor 900000000 100000000 -> NaN Invalid_operation
-xorx254 xor 200000000 000000000 -> NaN Invalid_operation
-xorx255 xor 700000000 000000000 -> NaN Invalid_operation
-xorx256 xor 800000000 000000000 -> NaN Invalid_operation
-xorx257 xor 900000000 000000000 -> NaN Invalid_operation
-xorx258 xor 100000000 200000000 -> NaN Invalid_operation
-xorx259 xor 100000000 700000000 -> NaN Invalid_operation
-xorx260 xor 100000000 800000000 -> NaN Invalid_operation
-xorx261 xor 100000000 900000000 -> NaN Invalid_operation
-xorx262 xor 000000000 200000000 -> NaN Invalid_operation
-xorx263 xor 000000000 700000000 -> NaN Invalid_operation
-xorx264 xor 000000000 800000000 -> NaN Invalid_operation
-xorx265 xor 000000000 900000000 -> NaN Invalid_operation
--- test MSD-1
-xorx270 xor 020000000 100000000 -> NaN Invalid_operation
-xorx271 xor 070100000 100000000 -> NaN Invalid_operation
-xorx272 xor 080010000 100000001 -> NaN Invalid_operation
-xorx273 xor 090001000 100000010 -> NaN Invalid_operation
-xorx274 xor 100000100 020010100 -> NaN Invalid_operation
-xorx275 xor 100000000 070001000 -> NaN Invalid_operation
-xorx276 xor 100000010 080010100 -> NaN Invalid_operation
-xorx277 xor 100000000 090000010 -> NaN Invalid_operation
--- test LSD
-xorx280 xor 001000002 100000000 -> NaN Invalid_operation
-xorx281 xor 000000007 100000000 -> NaN Invalid_operation
-xorx282 xor 000000008 100000000 -> NaN Invalid_operation
-xorx283 xor 000000009 100000000 -> NaN Invalid_operation
-xorx284 xor 100000000 000100002 -> NaN Invalid_operation
-xorx285 xor 100100000 001000007 -> NaN Invalid_operation
-xorx286 xor 100010000 010000008 -> NaN Invalid_operation
-xorx287 xor 100001000 100000009 -> NaN Invalid_operation
--- test Middie
-xorx288 xor 001020000 100000000 -> NaN Invalid_operation
-xorx289 xor 000070001 100000000 -> NaN Invalid_operation
-xorx290 xor 000080000 100010000 -> NaN Invalid_operation
-xorx291 xor 000090000 100001000 -> NaN Invalid_operation
-xorx292 xor 100000010 000020100 -> NaN Invalid_operation
-xorx293 xor 100100000 000070010 -> NaN Invalid_operation
-xorx294 xor 100010100 000080001 -> NaN Invalid_operation
-xorx295 xor 100001000 000090000 -> NaN Invalid_operation
--- signs
-xorx296 xor -100001000 -000000000 -> NaN Invalid_operation
-xorx297 xor -100001000 000010000 -> NaN Invalid_operation
-xorx298 xor 100001000 -000000000 -> NaN Invalid_operation
-xorx299 xor 100001000 000011000 -> 100010000
-
--- Nmax, Nmin, Ntiny
-xorx331 xor 2 9.99999999E+999 -> NaN Invalid_operation
-xorx332 xor 3 1E-999 -> NaN Invalid_operation
-xorx333 xor 4 1.00000000E-999 -> NaN Invalid_operation
-xorx334 xor 5 1E-1007 -> NaN Invalid_operation
-xorx335 xor 6 -1E-1007 -> NaN Invalid_operation
-xorx336 xor 7 -1.00000000E-999 -> NaN Invalid_operation
-xorx337 xor 8 -1E-999 -> NaN Invalid_operation
-xorx338 xor 9 -9.99999999E+999 -> NaN Invalid_operation
-xorx341 xor 9.99999999E+999 -18 -> NaN Invalid_operation
-xorx342 xor 1E-999 01 -> NaN Invalid_operation
-xorx343 xor 1.00000000E-999 -18 -> NaN Invalid_operation
-xorx344 xor 1E-1007 18 -> NaN Invalid_operation
-xorx345 xor -1E-1007 -10 -> NaN Invalid_operation
-xorx346 xor -1.00000000E-999 18 -> NaN Invalid_operation
-xorx347 xor -1E-999 10 -> NaN Invalid_operation
-xorx348 xor -9.99999999E+999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-xorx361 xor 1.0 1 -> NaN Invalid_operation
-xorx362 xor 1E+1 1 -> NaN Invalid_operation
-xorx363 xor 0.0 1 -> NaN Invalid_operation
-xorx364 xor 0E+1 1 -> NaN Invalid_operation
-xorx365 xor 9.9 1 -> NaN Invalid_operation
-xorx366 xor 9E+1 1 -> NaN Invalid_operation
-xorx371 xor 0 1.0 -> NaN Invalid_operation
-xorx372 xor 0 1E+1 -> NaN Invalid_operation
-xorx373 xor 0 0.0 -> NaN Invalid_operation
-xorx374 xor 0 0E+1 -> NaN Invalid_operation
-xorx375 xor 0 9.9 -> NaN Invalid_operation
-xorx376 xor 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-xorx780 xor -Inf -Inf -> NaN Invalid_operation
-xorx781 xor -Inf -1000 -> NaN Invalid_operation
-xorx782 xor -Inf -1 -> NaN Invalid_operation
-xorx783 xor -Inf -0 -> NaN Invalid_operation
-xorx784 xor -Inf 0 -> NaN Invalid_operation
-xorx785 xor -Inf 1 -> NaN Invalid_operation
-xorx786 xor -Inf 1000 -> NaN Invalid_operation
-xorx787 xor -1000 -Inf -> NaN Invalid_operation
-xorx788 xor -Inf -Inf -> NaN Invalid_operation
-xorx789 xor -1 -Inf -> NaN Invalid_operation
-xorx790 xor -0 -Inf -> NaN Invalid_operation
-xorx791 xor 0 -Inf -> NaN Invalid_operation
-xorx792 xor 1 -Inf -> NaN Invalid_operation
-xorx793 xor 1000 -Inf -> NaN Invalid_operation
-xorx794 xor Inf -Inf -> NaN Invalid_operation
-
-xorx800 xor Inf -Inf -> NaN Invalid_operation
-xorx801 xor Inf -1000 -> NaN Invalid_operation
-xorx802 xor Inf -1 -> NaN Invalid_operation
-xorx803 xor Inf -0 -> NaN Invalid_operation
-xorx804 xor Inf 0 -> NaN Invalid_operation
-xorx805 xor Inf 1 -> NaN Invalid_operation
-xorx806 xor Inf 1000 -> NaN Invalid_operation
-xorx807 xor Inf Inf -> NaN Invalid_operation
-xorx808 xor -1000 Inf -> NaN Invalid_operation
-xorx809 xor -Inf Inf -> NaN Invalid_operation
-xorx810 xor -1 Inf -> NaN Invalid_operation
-xorx811 xor -0 Inf -> NaN Invalid_operation
-xorx812 xor 0 Inf -> NaN Invalid_operation
-xorx813 xor 1 Inf -> NaN Invalid_operation
-xorx814 xor 1000 Inf -> NaN Invalid_operation
-xorx815 xor Inf Inf -> NaN Invalid_operation
-
-xorx821 xor NaN -Inf -> NaN Invalid_operation
-xorx822 xor NaN -1000 -> NaN Invalid_operation
-xorx823 xor NaN -1 -> NaN Invalid_operation
-xorx824 xor NaN -0 -> NaN Invalid_operation
-xorx825 xor NaN 0 -> NaN Invalid_operation
-xorx826 xor NaN 1 -> NaN Invalid_operation
-xorx827 xor NaN 1000 -> NaN Invalid_operation
-xorx828 xor NaN Inf -> NaN Invalid_operation
-xorx829 xor NaN NaN -> NaN Invalid_operation
-xorx830 xor -Inf NaN -> NaN Invalid_operation
-xorx831 xor -1000 NaN -> NaN Invalid_operation
-xorx832 xor -1 NaN -> NaN Invalid_operation
-xorx833 xor -0 NaN -> NaN Invalid_operation
-xorx834 xor 0 NaN -> NaN Invalid_operation
-xorx835 xor 1 NaN -> NaN Invalid_operation
-xorx836 xor 1000 NaN -> NaN Invalid_operation
-xorx837 xor Inf NaN -> NaN Invalid_operation
-
-xorx841 xor sNaN -Inf -> NaN Invalid_operation
-xorx842 xor sNaN -1000 -> NaN Invalid_operation
-xorx843 xor sNaN -1 -> NaN Invalid_operation
-xorx844 xor sNaN -0 -> NaN Invalid_operation
-xorx845 xor sNaN 0 -> NaN Invalid_operation
-xorx846 xor sNaN 1 -> NaN Invalid_operation
-xorx847 xor sNaN 1000 -> NaN Invalid_operation
-xorx848 xor sNaN NaN -> NaN Invalid_operation
-xorx849 xor sNaN sNaN -> NaN Invalid_operation
-xorx850 xor NaN sNaN -> NaN Invalid_operation
-xorx851 xor -Inf sNaN -> NaN Invalid_operation
-xorx852 xor -1000 sNaN -> NaN Invalid_operation
-xorx853 xor -1 sNaN -> NaN Invalid_operation
-xorx854 xor -0 sNaN -> NaN Invalid_operation
-xorx855 xor 0 sNaN -> NaN Invalid_operation
-xorx856 xor 1 sNaN -> NaN Invalid_operation
-xorx857 xor 1000 sNaN -> NaN Invalid_operation
-xorx858 xor Inf sNaN -> NaN Invalid_operation
-xorx859 xor NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-xorx861 xor NaN1 -Inf -> NaN Invalid_operation
-xorx862 xor +NaN2 -1000 -> NaN Invalid_operation
-xorx863 xor NaN3 1000 -> NaN Invalid_operation
-xorx864 xor NaN4 Inf -> NaN Invalid_operation
-xorx865 xor NaN5 +NaN6 -> NaN Invalid_operation
-xorx866 xor -Inf NaN7 -> NaN Invalid_operation
-xorx867 xor -1000 NaN8 -> NaN Invalid_operation
-xorx868 xor 1000 NaN9 -> NaN Invalid_operation
-xorx869 xor Inf +NaN10 -> NaN Invalid_operation
-xorx871 xor sNaN11 -Inf -> NaN Invalid_operation
-xorx872 xor sNaN12 -1000 -> NaN Invalid_operation
-xorx873 xor sNaN13 1000 -> NaN Invalid_operation
-xorx874 xor sNaN14 NaN17 -> NaN Invalid_operation
-xorx875 xor sNaN15 sNaN18 -> NaN Invalid_operation
-xorx876 xor NaN16 sNaN19 -> NaN Invalid_operation
-xorx877 xor -Inf +sNaN20 -> NaN Invalid_operation
-xorx878 xor -1000 sNaN21 -> NaN Invalid_operation
-xorx879 xor 1000 sNaN22 -> NaN Invalid_operation
-xorx880 xor Inf sNaN23 -> NaN Invalid_operation
-xorx881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
-xorx882 xor -NaN26 NaN28 -> NaN Invalid_operation
-xorx883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
-xorx884 xor 1000 -NaN30 -> NaN Invalid_operation
-xorx885 xor 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- xor.decTest -- digitwise logical XOR --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check (truth table)
+xorx001 xor 0 0 -> 0
+xorx002 xor 0 1 -> 1
+xorx003 xor 1 0 -> 1
+xorx004 xor 1 1 -> 0
+xorx005 xor 1100 1010 -> 110
+xorx006 xor 1111 10 -> 1101
+-- and at msd and msd-1
+xorx010 xor 000000000 000000000 -> 0
+xorx011 xor 000000000 100000000 -> 100000000
+xorx012 xor 100000000 000000000 -> 100000000
+xorx013 xor 100000000 100000000 -> 0
+xorx014 xor 000000000 000000000 -> 0
+xorx015 xor 000000000 010000000 -> 10000000
+xorx016 xor 010000000 000000000 -> 10000000
+xorx017 xor 010000000 010000000 -> 0
+
+-- Various lengths
+-- 123456789 123456789 123456789
+xorx021 xor 111111111 111111111 -> 0
+xorx022 xor 111111111111 111111111 -> 0
+xorx023 xor 11111111 11111111 -> 0
+xorx025 xor 1111111 1111111 -> 0
+xorx026 xor 111111 111111 -> 0
+xorx027 xor 11111 11111 -> 0
+xorx028 xor 1111 1111 -> 0
+xorx029 xor 111 111 -> 0
+xorx031 xor 11 11 -> 0
+xorx032 xor 1 1 -> 0
+xorx033 xor 111111111111 1111111111 -> 0
+xorx034 xor 11111111111 11111111111 -> 0
+xorx035 xor 1111111111 111111111111 -> 0
+xorx036 xor 111111111 1111111111111 -> 0
+
+xorx040 xor 111111111 111111111111 -> 0
+xorx041 xor 11111111 111111111111 -> 100000000
+xorx042 xor 11111111 111111111 -> 100000000
+xorx043 xor 1111111 100000010 -> 101111101
+xorx044 xor 111111 100000100 -> 100111011
+xorx045 xor 11111 100001000 -> 100010111
+xorx046 xor 1111 100010000 -> 100011111
+xorx047 xor 111 100100000 -> 100100111
+xorx048 xor 11 101000000 -> 101000011
+xorx049 xor 1 110000000 -> 110000001
+
+xorx050 xor 1111111111 1 -> 111111110
+xorx051 xor 111111111 1 -> 111111110
+xorx052 xor 11111111 1 -> 11111110
+xorx053 xor 1111111 1 -> 1111110
+xorx054 xor 111111 1 -> 111110
+xorx055 xor 11111 1 -> 11110
+xorx056 xor 1111 1 -> 1110
+xorx057 xor 111 1 -> 110
+xorx058 xor 11 1 -> 10
+xorx059 xor 1 1 -> 0
+
+xorx060 xor 1111111111 0 -> 111111111
+xorx061 xor 111111111 0 -> 111111111
+xorx062 xor 11111111 0 -> 11111111
+xorx063 xor 1111111 0 -> 1111111
+xorx064 xor 111111 0 -> 111111
+xorx065 xor 11111 0 -> 11111
+xorx066 xor 1111 0 -> 1111
+xorx067 xor 111 0 -> 111
+xorx068 xor 11 0 -> 11
+xorx069 xor 1 0 -> 1
+
+xorx070 xor 1 1111111111 -> 111111110
+xorx071 xor 1 111111111 -> 111111110
+xorx072 xor 1 11111111 -> 11111110
+xorx073 xor 1 1111111 -> 1111110
+xorx074 xor 1 111111 -> 111110
+xorx075 xor 1 11111 -> 11110
+xorx076 xor 1 1111 -> 1110
+xorx077 xor 1 111 -> 110
+xorx078 xor 1 11 -> 10
+xorx079 xor 1 1 -> 0
+
+xorx080 xor 0 1111111111 -> 111111111
+xorx081 xor 0 111111111 -> 111111111
+xorx082 xor 0 11111111 -> 11111111
+xorx083 xor 0 1111111 -> 1111111
+xorx084 xor 0 111111 -> 111111
+xorx085 xor 0 11111 -> 11111
+xorx086 xor 0 1111 -> 1111
+xorx087 xor 0 111 -> 111
+xorx088 xor 0 11 -> 11
+xorx089 xor 0 1 -> 1
+
+xorx090 xor 011111111 111101111 -> 100010000
+xorx091 xor 101111111 111101111 -> 10010000
+xorx092 xor 110111111 111101111 -> 1010000
+xorx093 xor 111011111 111101111 -> 110000
+xorx094 xor 111101111 111101111 -> 0
+xorx095 xor 111110111 111101111 -> 11000
+xorx096 xor 111111011 111101111 -> 10100
+xorx097 xor 111111101 111101111 -> 10010
+xorx098 xor 111111110 111101111 -> 10001
+
+xorx100 xor 111101111 011111111 -> 100010000
+xorx101 xor 111101111 101111111 -> 10010000
+xorx102 xor 111101111 110111111 -> 1010000
+xorx103 xor 111101111 111011111 -> 110000
+xorx104 xor 111101111 111101111 -> 0
+xorx105 xor 111101111 111110111 -> 11000
+xorx106 xor 111101111 111111011 -> 10100
+xorx107 xor 111101111 111111101 -> 10010
+xorx108 xor 111101111 111111110 -> 10001
+
+-- non-0/1 should not be accepted, nor should signs
+xorx220 xor 111111112 111111111 -> NaN Invalid_operation
+xorx221 xor 333333333 333333333 -> NaN Invalid_operation
+xorx222 xor 555555555 555555555 -> NaN Invalid_operation
+xorx223 xor 777777777 777777777 -> NaN Invalid_operation
+xorx224 xor 999999999 999999999 -> NaN Invalid_operation
+xorx225 xor 222222222 999999999 -> NaN Invalid_operation
+xorx226 xor 444444444 999999999 -> NaN Invalid_operation
+xorx227 xor 666666666 999999999 -> NaN Invalid_operation
+xorx228 xor 888888888 999999999 -> NaN Invalid_operation
+xorx229 xor 999999999 222222222 -> NaN Invalid_operation
+xorx230 xor 999999999 444444444 -> NaN Invalid_operation
+xorx231 xor 999999999 666666666 -> NaN Invalid_operation
+xorx232 xor 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+xorx240 xor 567468689 -934981942 -> NaN Invalid_operation
+xorx241 xor 567367689 934981942 -> NaN Invalid_operation
+xorx242 xor -631917772 -706014634 -> NaN Invalid_operation
+xorx243 xor -756253257 138579234 -> NaN Invalid_operation
+xorx244 xor 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+xorx250 xor 200000000 100000000 -> NaN Invalid_operation
+xorx251 xor 700000000 100000000 -> NaN Invalid_operation
+xorx252 xor 800000000 100000000 -> NaN Invalid_operation
+xorx253 xor 900000000 100000000 -> NaN Invalid_operation
+xorx254 xor 200000000 000000000 -> NaN Invalid_operation
+xorx255 xor 700000000 000000000 -> NaN Invalid_operation
+xorx256 xor 800000000 000000000 -> NaN Invalid_operation
+xorx257 xor 900000000 000000000 -> NaN Invalid_operation
+xorx258 xor 100000000 200000000 -> NaN Invalid_operation
+xorx259 xor 100000000 700000000 -> NaN Invalid_operation
+xorx260 xor 100000000 800000000 -> NaN Invalid_operation
+xorx261 xor 100000000 900000000 -> NaN Invalid_operation
+xorx262 xor 000000000 200000000 -> NaN Invalid_operation
+xorx263 xor 000000000 700000000 -> NaN Invalid_operation
+xorx264 xor 000000000 800000000 -> NaN Invalid_operation
+xorx265 xor 000000000 900000000 -> NaN Invalid_operation
+-- test MSD-1
+xorx270 xor 020000000 100000000 -> NaN Invalid_operation
+xorx271 xor 070100000 100000000 -> NaN Invalid_operation
+xorx272 xor 080010000 100000001 -> NaN Invalid_operation
+xorx273 xor 090001000 100000010 -> NaN Invalid_operation
+xorx274 xor 100000100 020010100 -> NaN Invalid_operation
+xorx275 xor 100000000 070001000 -> NaN Invalid_operation
+xorx276 xor 100000010 080010100 -> NaN Invalid_operation
+xorx277 xor 100000000 090000010 -> NaN Invalid_operation
+-- test LSD
+xorx280 xor 001000002 100000000 -> NaN Invalid_operation
+xorx281 xor 000000007 100000000 -> NaN Invalid_operation
+xorx282 xor 000000008 100000000 -> NaN Invalid_operation
+xorx283 xor 000000009 100000000 -> NaN Invalid_operation
+xorx284 xor 100000000 000100002 -> NaN Invalid_operation
+xorx285 xor 100100000 001000007 -> NaN Invalid_operation
+xorx286 xor 100010000 010000008 -> NaN Invalid_operation
+xorx287 xor 100001000 100000009 -> NaN Invalid_operation
+-- test Middie
+xorx288 xor 001020000 100000000 -> NaN Invalid_operation
+xorx289 xor 000070001 100000000 -> NaN Invalid_operation
+xorx290 xor 000080000 100010000 -> NaN Invalid_operation
+xorx291 xor 000090000 100001000 -> NaN Invalid_operation
+xorx292 xor 100000010 000020100 -> NaN Invalid_operation
+xorx293 xor 100100000 000070010 -> NaN Invalid_operation
+xorx294 xor 100010100 000080001 -> NaN Invalid_operation
+xorx295 xor 100001000 000090000 -> NaN Invalid_operation
+-- signs
+xorx296 xor -100001000 -000000000 -> NaN Invalid_operation
+xorx297 xor -100001000 000010000 -> NaN Invalid_operation
+xorx298 xor 100001000 -000000000 -> NaN Invalid_operation
+xorx299 xor 100001000 000011000 -> 100010000
+
+-- Nmax, Nmin, Ntiny
+xorx331 xor 2 9.99999999E+999 -> NaN Invalid_operation
+xorx332 xor 3 1E-999 -> NaN Invalid_operation
+xorx333 xor 4 1.00000000E-999 -> NaN Invalid_operation
+xorx334 xor 5 1E-1007 -> NaN Invalid_operation
+xorx335 xor 6 -1E-1007 -> NaN Invalid_operation
+xorx336 xor 7 -1.00000000E-999 -> NaN Invalid_operation
+xorx337 xor 8 -1E-999 -> NaN Invalid_operation
+xorx338 xor 9 -9.99999999E+999 -> NaN Invalid_operation
+xorx341 xor 9.99999999E+999 -18 -> NaN Invalid_operation
+xorx342 xor 1E-999 01 -> NaN Invalid_operation
+xorx343 xor 1.00000000E-999 -18 -> NaN Invalid_operation
+xorx344 xor 1E-1007 18 -> NaN Invalid_operation
+xorx345 xor -1E-1007 -10 -> NaN Invalid_operation
+xorx346 xor -1.00000000E-999 18 -> NaN Invalid_operation
+xorx347 xor -1E-999 10 -> NaN Invalid_operation
+xorx348 xor -9.99999999E+999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+xorx361 xor 1.0 1 -> NaN Invalid_operation
+xorx362 xor 1E+1 1 -> NaN Invalid_operation
+xorx363 xor 0.0 1 -> NaN Invalid_operation
+xorx364 xor 0E+1 1 -> NaN Invalid_operation
+xorx365 xor 9.9 1 -> NaN Invalid_operation
+xorx366 xor 9E+1 1 -> NaN Invalid_operation
+xorx371 xor 0 1.0 -> NaN Invalid_operation
+xorx372 xor 0 1E+1 -> NaN Invalid_operation
+xorx373 xor 0 0.0 -> NaN Invalid_operation
+xorx374 xor 0 0E+1 -> NaN Invalid_operation
+xorx375 xor 0 9.9 -> NaN Invalid_operation
+xorx376 xor 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+xorx780 xor -Inf -Inf -> NaN Invalid_operation
+xorx781 xor -Inf -1000 -> NaN Invalid_operation
+xorx782 xor -Inf -1 -> NaN Invalid_operation
+xorx783 xor -Inf -0 -> NaN Invalid_operation
+xorx784 xor -Inf 0 -> NaN Invalid_operation
+xorx785 xor -Inf 1 -> NaN Invalid_operation
+xorx786 xor -Inf 1000 -> NaN Invalid_operation
+xorx787 xor -1000 -Inf -> NaN Invalid_operation
+xorx788 xor -Inf -Inf -> NaN Invalid_operation
+xorx789 xor -1 -Inf -> NaN Invalid_operation
+xorx790 xor -0 -Inf -> NaN Invalid_operation
+xorx791 xor 0 -Inf -> NaN Invalid_operation
+xorx792 xor 1 -Inf -> NaN Invalid_operation
+xorx793 xor 1000 -Inf -> NaN Invalid_operation
+xorx794 xor Inf -Inf -> NaN Invalid_operation
+
+xorx800 xor Inf -Inf -> NaN Invalid_operation
+xorx801 xor Inf -1000 -> NaN Invalid_operation
+xorx802 xor Inf -1 -> NaN Invalid_operation
+xorx803 xor Inf -0 -> NaN Invalid_operation
+xorx804 xor Inf 0 -> NaN Invalid_operation
+xorx805 xor Inf 1 -> NaN Invalid_operation
+xorx806 xor Inf 1000 -> NaN Invalid_operation
+xorx807 xor Inf Inf -> NaN Invalid_operation
+xorx808 xor -1000 Inf -> NaN Invalid_operation
+xorx809 xor -Inf Inf -> NaN Invalid_operation
+xorx810 xor -1 Inf -> NaN Invalid_operation
+xorx811 xor -0 Inf -> NaN Invalid_operation
+xorx812 xor 0 Inf -> NaN Invalid_operation
+xorx813 xor 1 Inf -> NaN Invalid_operation
+xorx814 xor 1000 Inf -> NaN Invalid_operation
+xorx815 xor Inf Inf -> NaN Invalid_operation
+
+xorx821 xor NaN -Inf -> NaN Invalid_operation
+xorx822 xor NaN -1000 -> NaN Invalid_operation
+xorx823 xor NaN -1 -> NaN Invalid_operation
+xorx824 xor NaN -0 -> NaN Invalid_operation
+xorx825 xor NaN 0 -> NaN Invalid_operation
+xorx826 xor NaN 1 -> NaN Invalid_operation
+xorx827 xor NaN 1000 -> NaN Invalid_operation
+xorx828 xor NaN Inf -> NaN Invalid_operation
+xorx829 xor NaN NaN -> NaN Invalid_operation
+xorx830 xor -Inf NaN -> NaN Invalid_operation
+xorx831 xor -1000 NaN -> NaN Invalid_operation
+xorx832 xor -1 NaN -> NaN Invalid_operation
+xorx833 xor -0 NaN -> NaN Invalid_operation
+xorx834 xor 0 NaN -> NaN Invalid_operation
+xorx835 xor 1 NaN -> NaN Invalid_operation
+xorx836 xor 1000 NaN -> NaN Invalid_operation
+xorx837 xor Inf NaN -> NaN Invalid_operation
+
+xorx841 xor sNaN -Inf -> NaN Invalid_operation
+xorx842 xor sNaN -1000 -> NaN Invalid_operation
+xorx843 xor sNaN -1 -> NaN Invalid_operation
+xorx844 xor sNaN -0 -> NaN Invalid_operation
+xorx845 xor sNaN 0 -> NaN Invalid_operation
+xorx846 xor sNaN 1 -> NaN Invalid_operation
+xorx847 xor sNaN 1000 -> NaN Invalid_operation
+xorx848 xor sNaN NaN -> NaN Invalid_operation
+xorx849 xor sNaN sNaN -> NaN Invalid_operation
+xorx850 xor NaN sNaN -> NaN Invalid_operation
+xorx851 xor -Inf sNaN -> NaN Invalid_operation
+xorx852 xor -1000 sNaN -> NaN Invalid_operation
+xorx853 xor -1 sNaN -> NaN Invalid_operation
+xorx854 xor -0 sNaN -> NaN Invalid_operation
+xorx855 xor 0 sNaN -> NaN Invalid_operation
+xorx856 xor 1 sNaN -> NaN Invalid_operation
+xorx857 xor 1000 sNaN -> NaN Invalid_operation
+xorx858 xor Inf sNaN -> NaN Invalid_operation
+xorx859 xor NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+xorx861 xor NaN1 -Inf -> NaN Invalid_operation
+xorx862 xor +NaN2 -1000 -> NaN Invalid_operation
+xorx863 xor NaN3 1000 -> NaN Invalid_operation
+xorx864 xor NaN4 Inf -> NaN Invalid_operation
+xorx865 xor NaN5 +NaN6 -> NaN Invalid_operation
+xorx866 xor -Inf NaN7 -> NaN Invalid_operation
+xorx867 xor -1000 NaN8 -> NaN Invalid_operation
+xorx868 xor 1000 NaN9 -> NaN Invalid_operation
+xorx869 xor Inf +NaN10 -> NaN Invalid_operation
+xorx871 xor sNaN11 -Inf -> NaN Invalid_operation
+xorx872 xor sNaN12 -1000 -> NaN Invalid_operation
+xorx873 xor sNaN13 1000 -> NaN Invalid_operation
+xorx874 xor sNaN14 NaN17 -> NaN Invalid_operation
+xorx875 xor sNaN15 sNaN18 -> NaN Invalid_operation
+xorx876 xor NaN16 sNaN19 -> NaN Invalid_operation
+xorx877 xor -Inf +sNaN20 -> NaN Invalid_operation
+xorx878 xor -1000 sNaN21 -> NaN Invalid_operation
+xorx879 xor 1000 sNaN22 -> NaN Invalid_operation
+xorx880 xor Inf sNaN23 -> NaN Invalid_operation
+xorx881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
+xorx882 xor -NaN26 NaN28 -> NaN Invalid_operation
+xorx883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
+xorx884 xor 1000 -NaN30 -> NaN Invalid_operation
+xorx885 xor 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/doctest_aliases.py b/Lib/test/doctest_aliases.py
index e5e6b29fec..30cefafa83 100644
--- a/Lib/test/doctest_aliases.py
+++ b/Lib/test/doctest_aliases.py
@@ -10,4 +10,4 @@ class TwoNames:
'''
return 'f'
- g = f # define an alias for f
+ g = f # define an alias for f
diff --git a/Lib/test/encoded_modules/__init__.py b/Lib/test/encoded_modules/__init__.py
new file mode 100644
index 0000000000..ec43252aad
--- /dev/null
+++ b/Lib/test/encoded_modules/__init__.py
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+
+# This is a package that contains a number of modules that are used to
+# test import from the source files that have different encodings.
+# This file (the __init__ module of the package), is encoded in utf-8
+# and contains a list of strings from various unicode planes that are
+# encoded differently to compare them to the same strings encoded
+# differently in submodules. The following list, test_strings,
+# contains a list of tuples. The first element of each tuple is the
+# suffix that should be prepended with 'module_' to arrive at the
+# encoded submodule name, the second item is the encoding and the last
+# is the test string. The same string is assigned to the variable
+# named 'test' inside the submodule. If the decoding of modules works
+# correctly, from module_xyz import test should result in the same
+# string as listed below in the 'xyz' entry.
+
+# module, encoding, test string
+test_strings = (
+ ('iso_8859_1', 'iso-8859-1', "Les hommes ont oublié cette vérité, "
+ "dit le renard. Mais tu ne dois pas l'oublier. Tu deviens "
+ "responsable pour toujours de ce que tu as apprivoisé."),
+ ('koi8_r', 'koi8-r', "Познание беÑконечноÑти требует беÑконечного времени.")
+)
diff --git a/Lib/test/encoded_modules/module_iso_8859_1.py b/Lib/test/encoded_modules/module_iso_8859_1.py
new file mode 100644
index 0000000000..8f4a15c905
--- /dev/null
+++ b/Lib/test/encoded_modules/module_iso_8859_1.py
@@ -0,0 +1,5 @@
+# test iso-8859-1 encoding
+# -*- encoding: iso-8859-1 -*-
+test = ("Les hommes ont oublié cette vérité, "
+ "dit le renard. Mais tu ne dois pas l'oublier. Tu deviens "
+ "responsable pour toujours de ce que tu as apprivoisé.")
diff --git a/Lib/test/encoded_modules/module_koi8_r.py b/Lib/test/encoded_modules/module_koi8_r.py
new file mode 100644
index 0000000000..9b23a5a218
--- /dev/null
+++ b/Lib/test/encoded_modules/module_koi8_r.py
@@ -0,0 +1,3 @@
+# test koi8-r encoding
+# -*- encoding: koi8-r -*-
+test = "ðÏÚÎÁÎÉÅ ÂÅÓËÏÎÅÞÎÏÓÔÉ ÔÒÅÂÕÅÔ ÂÅÓËÏÎÅÞÎÏÇÏ ×ÒÅÍÅÎÉ."
diff --git a/Lib/test/exception_hierarchy.txt b/Lib/test/exception_hierarchy.txt
index 73ccb6674b..5037b335d9 100644
--- a/Lib/test/exception_hierarchy.txt
+++ b/Lib/test/exception_hierarchy.txt
@@ -47,3 +47,4 @@ BaseException
+-- ImportWarning
+-- UnicodeWarning
+-- BytesWarning
+ +-- ResourceWarning
diff --git a/Lib/test/fork_wait.py b/Lib/test/fork_wait.py
index a69653bfa9..1caab1c491 100644
--- a/Lib/test/fork_wait.py
+++ b/Lib/test/fork_wait.py
@@ -1,6 +1,6 @@
"""This test case provides support for checking forking and wait behavior.
-To test different wait behavior, overrise the wait_impl method.
+To test different wait behavior, override the wait_impl method.
We want fork1() semantics -- only the forking thread survives in the
child after a fork().
@@ -9,7 +9,9 @@ On some systems (e.g. Solaris without posix threads) we find that all
active threads survive in the child after a fork(); this is an error.
"""
-import os, sys, time, _thread, unittest
+import os, sys, time, unittest
+import test.support as support
+_thread = support.import_module('_thread')
LONGSLEEP = 2
SHORTSLEEP = 0.5
diff --git a/Lib/test/formatfloat_testcases.txt b/Lib/test/formatfloat_testcases.txt
index 4cf20aa8c9..25c07ba293 100644
--- a/Lib/test/formatfloat_testcases.txt
+++ b/Lib/test/formatfloat_testcases.txt
@@ -279,6 +279,11 @@
%.2g 0.000123 -> 0.00012
%.2g 0.0000123 -> 1.2e-05
+-- bad cases from http://bugs.python.org/issue9980
+%.12g 38210.0 -> 38210
+%.12g 37210.0 -> 37210
+%.12g 36210.0 -> 36210
+
-- alternate g formatting: always include decimal point and
-- exactly <precision> significant digits.
%#.0g 0 -> 0.
@@ -314,43 +319,37 @@
%#.5g 234.56 -> 234.56
%#.6g 234.56 -> 234.560
--- for repr formatting see the separate test_short_repr test in
--- test_float.py. Not all platforms use short repr for floats.
-
--- str formatting. Result always includes decimal point and at
+-- repr formatting. Result always includes decimal point and at
-- least one digit after the point, or an exponent.
-%s 0 -> 0.0
-%s 1 -> 1.0
-
-%s 0.01 -> 0.01
-%s 0.02 -> 0.02
-%s 0.03 -> 0.03
-%s 0.04 -> 0.04
-%s 0.05 -> 0.05
+%r 0 -> 0.0
+%r 1 -> 1.0
--- str truncates to 12 significant digits
-%s 1.234123412341 -> 1.23412341234
-%s 1.23412341234 -> 1.23412341234
-%s 1.2341234123 -> 1.2341234123
+%r 0.01 -> 0.01
+%r 0.02 -> 0.02
+%r 0.03 -> 0.03
+%r 0.04 -> 0.04
+%r 0.05 -> 0.05
--- values >= 1e11 get an exponent
-%s 10 -> 10.0
-%s 100 -> 100.0
-%s 1e10 -> 10000000000.0
-%s 9.999e10 -> 99990000000.0
-%s 99999999999 -> 99999999999.0
-%s 99999999999.9 -> 99999999999.9
-%s 99999999999.99 -> 1e+11
-%s 1e11 -> 1e+11
-%s 1e12 -> 1e+12
+-- values >= 1e16 get an exponent
+%r 10 -> 10.0
+%r 100 -> 100.0
+%r 1e15 -> 1000000000000000.0
+%r 9.999e15 -> 9999000000000000.0
+%r 9999999999999998 -> 9999999999999998.0
+%r 9999999999999999 -> 1e+16
+%r 1e16 -> 1e+16
+%r 1e17 -> 1e+17
-- as do values < 1e-4
-%s 1e-3 -> 0.001
-%s 1.001e-4 -> 0.0001001
-%s 1.000000000001e-4 -> 0.0001
-%s 1.00000000001e-4 -> 0.000100000000001
-%s 1.0000000001e-4 -> 0.00010000000001
-%s 1e-4 -> 0.0001
-%s 0.999999999999e-4 -> 9.99999999999e-05
-%s 0.999e-4 -> 9.99e-05
-%s 1e-5 -> 1e-05
+%r 1e-3 -> 0.001
+%r 1.001e-4 -> 0.0001001
+%r 1.0000000000000001e-4 -> 0.0001
+%r 1.000000000000001e-4 -> 0.0001000000000000001
+%r 1.00000000001e-4 -> 0.000100000000001
+%r 1.0000000001e-4 -> 0.00010000000001
+%r 1e-4 -> 0.0001
+%r 0.99999999999999999e-4 -> 0.0001
+%r 0.9999999999999999e-4 -> 9.999999999999999e-05
+%r 0.999999999999e-4 -> 9.99999999999e-05
+%r 0.999e-4 -> 9.99e-05
+%r 1e-5 -> 1e-05
diff --git a/Lib/test/gdb_sample.py b/Lib/test/gdb_sample.py
new file mode 100644
index 0000000000..cab13fb4da
--- /dev/null
+++ b/Lib/test/gdb_sample.py
@@ -0,0 +1,12 @@
+# Sample script for use by test_gdb.py
+
+def foo(a, b, c):
+ bar(a, b, c)
+
+def bar(a, b, c):
+ baz(a, b, c)
+
+def baz(*args):
+ id(42)
+
+foo(1, 2, 3)
diff --git a/Lib/test/ieee754.txt b/Lib/test/ieee754.txt
index 5a41c8fe50..89bb0c50a3 100644
--- a/Lib/test/ieee754.txt
+++ b/Lib/test/ieee754.txt
@@ -72,7 +72,7 @@ False
>>> NAN >= 0
False
-All operations involving a NaN return a NaN except for the power of *0* and *1*.
+All operations involving a NaN return a NaN except for nan**0 and 1**nan.
>>> 1 + NAN
nan
>>> 1 * NAN
@@ -81,8 +81,10 @@ nan
nan
>>> 1 ** NAN
1.0
+>>> NAN ** 0
+1.0
>>> 0 ** NAN
-0.0
+nan
>>> (1.0 + FI.epsilon) * NAN
nan
diff --git a/Lib/json/tests/__init__.py b/Lib/test/json_tests/__init__.py
index 1a1e3e6d5a..4977468e47 100644
--- a/Lib/json/tests/__init__.py
+++ b/Lib/test/json_tests/__init__.py
@@ -10,7 +10,7 @@ def test_suite():
loader = unittest.TestLoader()
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
- modname = "json.tests." + fn[:-3]
+ modname = "test.json_tests." + fn[:-3]
__import__(modname)
module = sys.modules[modname]
suite.addTests(loader.loadTestsFromModule(module))
diff --git a/Lib/json/tests/test_decode.py b/Lib/test/json_tests/test_decode.py
index bf65e4696c..07dadfe26f 100644
--- a/Lib/json/tests/test_decode.py
+++ b/Lib/test/json_tests/test_decode.py
@@ -1,10 +1,25 @@
import decimal
from unittest import TestCase
from io import StringIO
+from contextlib import contextmanager
import json
+import json.decoder
+import json.scanner
from collections import OrderedDict
+
+@contextmanager
+def use_python_scanner():
+ py_scanner = json.scanner.py_make_scanner
+ old_scanner = json.decoder.make_scanner
+ json.decoder.make_scanner = py_scanner
+ try:
+ yield
+ finally:
+ json.decoder.make_scanner = old_scanner
+
+
class TestDecode(TestCase):
def test_decimal(self):
rval = json.loads('1.1', parse_float=decimal.Decimal)
@@ -44,3 +59,16 @@ class TestDecode(TestCase):
# exercise the uncommon cases. The array cases are already covered.
rval = json.loads('{ "key" : "value" , "k":"v" }')
self.assertEqual(rval, {"key":"value", "k":"v"})
+
+ def check_keys_reuse(self, source, loads):
+ rval = loads(source)
+ (a, b), (c, d) = sorted(rval[0]), sorted(rval[1])
+ self.assertIs(a, c)
+ self.assertIs(b, d)
+
+ def test_keys_reuse(self):
+ s = '[{"a_key": 1, "b_\xe9": 2}, {"a_key": 3, "b_\xe9": 4}]'
+ self.check_keys_reuse(s, json.loads)
+ # Disabled: the pure Python version of json simply doesn't work
+ with use_python_scanner():
+ self.check_keys_reuse(s, json.decoder.JSONDecoder().decode)
diff --git a/Lib/json/tests/test_default.py b/Lib/test/json_tests/test_default.py
index 6a03eeb834..6a03eeb834 100644
--- a/Lib/json/tests/test_default.py
+++ b/Lib/test/json_tests/test_default.py
diff --git a/Lib/json/tests/test_dump.py b/Lib/test/json_tests/test_dump.py
index 8df234b819..8df234b819 100644
--- a/Lib/json/tests/test_dump.py
+++ b/Lib/test/json_tests/test_dump.py
diff --git a/Lib/json/tests/test_encode_basestring_ascii.py b/Lib/test/json_tests/test_encode_basestring_ascii.py
index 4fddd121c6..4fddd121c6 100644
--- a/Lib/json/tests/test_encode_basestring_ascii.py
+++ b/Lib/test/json_tests/test_encode_basestring_ascii.py
diff --git a/Lib/json/tests/test_fail.py b/Lib/test/json_tests/test_fail.py
index 9768edf19a..9768edf19a 100644
--- a/Lib/json/tests/test_fail.py
+++ b/Lib/test/json_tests/test_fail.py
diff --git a/Lib/json/tests/test_float.py b/Lib/test/json_tests/test_float.py
index ca4a506db4..ca4a506db4 100644
--- a/Lib/json/tests/test_float.py
+++ b/Lib/test/json_tests/test_float.py
diff --git a/Lib/json/tests/test_indent.py b/Lib/test/json_tests/test_indent.py
index d45aa851bd..692a494cfe 100644
--- a/Lib/json/tests/test_indent.py
+++ b/Lib/test/json_tests/test_indent.py
@@ -11,35 +11,39 @@ class TestIndent(TestCase):
expect = textwrap.dedent("""\
[
- [
- "blorpie"
- ],
- [
- "whoops"
- ],
- [],
- "d-shtaeou",
- "d-nthiouh",
- "i-vhbjkhnth",
- {
- "nifty": 87
- },
- {
- "field": "yes",
- "morefield": false
- }
+ \t[
+ \t\t"blorpie"
+ \t],
+ \t[
+ \t\t"whoops"
+ \t],
+ \t[],
+ \t"d-shtaeou",
+ \t"d-nthiouh",
+ \t"i-vhbjkhnth",
+ \t{
+ \t\t"nifty": 87
+ \t},
+ \t{
+ \t\t"field": "yes",
+ \t\t"morefield": false
+ \t}
]""")
d1 = json.dumps(h)
d2 = json.dumps(h, indent=2, sort_keys=True, separators=(',', ': '))
+ d3 = json.dumps(h, indent='\t', sort_keys=True, separators=(',', ': '))
h1 = json.loads(d1)
h2 = json.loads(d2)
+ h3 = json.loads(d3)
self.assertEqual(h1, h)
self.assertEqual(h2, h)
- self.assertEqual(d2, expect)
+ self.assertEqual(h3, h)
+ self.assertEqual(d2, expect.expandtabs(2))
+ self.assertEqual(d3, expect)
def test_indent0(self):
h = {3: 1}
diff --git a/Lib/json/tests/test_pass1.py b/Lib/test/json_tests/test_pass1.py
index 719c113759..719c113759 100644
--- a/Lib/json/tests/test_pass1.py
+++ b/Lib/test/json_tests/test_pass1.py
diff --git a/Lib/json/tests/test_pass2.py b/Lib/test/json_tests/test_pass2.py
index 379117e905..379117e905 100644
--- a/Lib/json/tests/test_pass2.py
+++ b/Lib/test/json_tests/test_pass2.py
diff --git a/Lib/json/tests/test_pass3.py b/Lib/test/json_tests/test_pass3.py
index 9151c4321c..9151c4321c 100644
--- a/Lib/json/tests/test_pass3.py
+++ b/Lib/test/json_tests/test_pass3.py
diff --git a/Lib/json/tests/test_recursion.py b/Lib/test/json_tests/test_recursion.py
index 1e9b8ab757..1e9b8ab757 100644
--- a/Lib/json/tests/test_recursion.py
+++ b/Lib/test/json_tests/test_recursion.py
diff --git a/Lib/json/tests/test_scanstring.py b/Lib/test/json_tests/test_scanstring.py
index abd325324d..abd325324d 100644
--- a/Lib/json/tests/test_scanstring.py
+++ b/Lib/test/json_tests/test_scanstring.py
diff --git a/Lib/json/tests/test_separators.py b/Lib/test/json_tests/test_separators.py
index d5b92bd65d..d5b92bd65d 100644
--- a/Lib/json/tests/test_separators.py
+++ b/Lib/test/json_tests/test_separators.py
diff --git a/Lib/json/tests/test_speedups.py b/Lib/test/json_tests/test_speedups.py
index b7c141f7f6..b7c141f7f6 100644
--- a/Lib/json/tests/test_speedups.py
+++ b/Lib/test/json_tests/test_speedups.py
diff --git a/Lib/json/tests/test_unicode.py b/Lib/test/json_tests/test_unicode.py
index e336c91fa9..e336c91fa9 100644
--- a/Lib/json/tests/test_unicode.py
+++ b/Lib/test/json_tests/test_unicode.py
diff --git a/Lib/test/keycert.pem b/Lib/test/keycert.pem
index 2f46fcf1c6..64318aa2e0 100644
--- a/Lib/test/keycert.pem
+++ b/Lib/test/keycert.pem
@@ -1,32 +1,31 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L
-opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH
-fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB
-AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU
-D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA
-IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM
-oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0
-ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/
-loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j
-oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA
-z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq
-ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV
-q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU=
------END RSA PRIVATE KEY-----
+-----BEGIN PRIVATE KEY-----
+MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm
+LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0
+ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP
+USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt
+CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq
+SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK
+UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y
+BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ
+ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5
+oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik
+eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F
+0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS
+x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/
+SPIXQuT8RMPDVNQ=
+-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
-MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD
-VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x
-IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT
-U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1
-NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl
-bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m
-dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj
-aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh
-m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8
-M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn
-fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC
-AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb
-08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx
-CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/
-iHkC6gGdBJhogs4=
+MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u
+IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw
+MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH
+Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k
+YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7
+6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt
+pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw
+FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd
+BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G
+lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1
+CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX
-----END CERTIFICATE-----
diff --git a/Lib/test/keycert2.pem b/Lib/test/keycert2.pem
new file mode 100644
index 0000000000..e8a9e082b3
--- /dev/null
+++ b/Lib/test/keycert2.pem
@@ -0,0 +1,31 @@
+-----BEGIN PRIVATE KEY-----
+MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJnsJZVrppL+W5I9
+zGQrrawWwE5QJpBK9nWw17mXrZ03R1cD9BamLGivVISbPlRlAVnZBEyh1ATpsB7d
+CUQ+WHEvALquvx4+Yw5l+fXeiYRjrLRBYZuVy8yNtXzU3iWcGObcYRkUdiXdOyP7
+sLF2YZHRvQZpzgDBKkrraeQ81w21AgMBAAECgYBEm7n07FMHWlE+0kT0sXNsLYfy
+YE+QKZnJw9WkaDN+zFEEPELkhZVt5BjsMraJr6v2fIEqF0gGGJPkbenffVq2B5dC
+lWUOxvJHufMK4sM3Cp6s/gOp3LP+QkzVnvJSfAyZU6l+4PGX5pLdUsXYjPxgzjzL
+S36tF7/2Uv1WePyLUQJBAMsPhYzUXOPRgmbhcJiqi9A9c3GO8kvSDYTCKt3VMnqz
+HBn6MQ4VQasCD1F+7jWTI0FU/3vdw8non/Fj8hhYqZcCQQDCDRdvmZqDiZnpMqDq
+L6ZSrLTVtMvZXZbgwForaAD9uHj51TME7+eYT7EG2YCgJTXJ4YvRJEnPNyskwdKt
+vTSTAkEAtaaN/vyemEJ82BIGStwONNw0ILsSr5cZ9tBHzqiA/tipY+e36HRFiXhP
+QcU9zXlxyWkDH8iz9DSAmE2jbfoqwwJANlMJ65E543cjIlitGcKLMnvtCCLcKpb7
+xSG0XJB6Lo11OKPJ66jp0gcFTSCY1Lx2CXVd+gfJrfwI1Pp562+bhwJBAJ9IfDPU
+R8OpO9v1SGd8x33Owm7uXOpB9d63/T70AD1QOXjKUC4eXYbt0WWfWuny/RNPRuyh
+w7DXSfUF+kPKolU=
+-----END PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIICXTCCAcagAwIBAgIJAIO3upAG445fMA0GCSqGSIb3DQEBBQUAMGIxCzAJBgNV
+BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u
+IFNvZnR3YXJlIEZvdW5kYXRpb24xFTATBgNVBAMTDGZha2Vob3N0bmFtZTAeFw0x
+MDEwMDkxNTAxMDBaFw0yMDEwMDYxNTAxMDBaMGIxCzAJBgNVBAYTAlhZMRcwFQYD
+VQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZv
+dW5kYXRpb24xFTATBgNVBAMTDGZha2Vob3N0bmFtZTCBnzANBgkqhkiG9w0BAQEF
+AAOBjQAwgYkCgYEAmewllWumkv5bkj3MZCutrBbATlAmkEr2dbDXuZetnTdHVwP0
+FqYsaK9UhJs+VGUBWdkETKHUBOmwHt0JRD5YcS8Auq6/Hj5jDmX59d6JhGOstEFh
+m5XLzI21fNTeJZwY5txhGRR2Jd07I/uwsXZhkdG9BmnOAMEqSutp5DzXDbUCAwEA
+AaMbMBkwFwYDVR0RBBAwDoIMZmFrZWhvc3RuYW1lMA0GCSqGSIb3DQEBBQUAA4GB
+AH+iMClLLGSaKWgwXsmdVo4FhTZZHo8Uprrtg3N9FxEeE50btpDVQysgRt5ias3K
+m+bME9zbKwvbVWD5zZdjus4pDgzwF/iHyccL8JyYhxOvS/9zmvAtFXj/APIIbZFp
+IT75d9f88ScIGEtknZQejnrdhB64tYki/EqluiuKBqKD
+-----END CERTIFICATE-----
diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py
index 22c6900592..ff30d41fb8 100644
--- a/Lib/test/lock_tests.py
+++ b/Lib/test/lock_tests.py
@@ -4,7 +4,7 @@ Various tests for synchronization primitives.
import sys
import time
-from _thread import start_new_thread, get_ident
+from _thread import start_new_thread, get_ident, TIMEOUT_MAX
import threading
import unittest
@@ -62,6 +62,14 @@ class BaseTestCase(unittest.TestCase):
support.threading_cleanup(*self._threads)
support.reap_children()
+ def assertTimeout(self, actual, expected):
+ # The waiting and/or time.time() can be imprecise, which
+ # is why comparing to the expected value would sometimes fail
+ # (especially under Windows).
+ self.assertGreaterEqual(actual, expected * 0.6)
+ # Test nothing insane happened
+ self.assertLess(actual, expected * 10.0)
+
class BaseLockTests(BaseTestCase):
"""
@@ -149,6 +157,32 @@ class BaseLockTests(BaseTestCase):
time.sleep(0.4)
self.assertEqual(n, len(threading.enumerate()))
+ def test_timeout(self):
+ lock = self.locktype()
+ # Can't set timeout if not blocking
+ self.assertRaises(ValueError, lock.acquire, 0, 1)
+ # Invalid timeout values
+ self.assertRaises(ValueError, lock.acquire, timeout=-100)
+ self.assertRaises(OverflowError, lock.acquire, timeout=1e100)
+ self.assertRaises(OverflowError, lock.acquire, timeout=TIMEOUT_MAX + 1)
+ # TIMEOUT_MAX is ok
+ lock.acquire(timeout=TIMEOUT_MAX)
+ lock.release()
+ t1 = time.time()
+ self.assertTrue(lock.acquire(timeout=5))
+ t2 = time.time()
+ # Just a sanity test that it didn't actually wait for the timeout.
+ self.assertLess(t2 - t1, 5)
+ results = []
+ def f():
+ t1 = time.time()
+ results.append(lock.acquire(timeout=0.5))
+ t2 = time.time()
+ results.append(t2 - t1)
+ Bunch(f, 1).wait_for_finished()
+ self.assertFalse(results[0])
+ self.assertTimeout(results[1], 0.5)
+
class LockTests(BaseLockTests):
"""
@@ -185,6 +219,16 @@ class LockTests(BaseLockTests):
lock.acquire()
lock.release()
+ def test_state_after_timeout(self):
+ # Issue #11618: check that lock is in a proper state after a
+ # (non-zero) timeout.
+ lock = self.locktype()
+ lock.acquire()
+ self.assertFalse(lock.acquire(timeout=0.01))
+ lock.release()
+ self.assertFalse(lock.locked())
+ self.assertTrue(lock.acquire(blocking=False))
+
class RLockTests(BaseLockTests):
"""
@@ -290,14 +334,14 @@ class EventTests(BaseTestCase):
def f():
results1.append(evt.wait(0.0))
t1 = time.time()
- r = evt.wait(0.2)
+ r = evt.wait(0.5)
t2 = time.time()
results2.append((r, t2 - t1))
Bunch(f, N).wait_for_finished()
self.assertEqual(results1, [False] * N)
for r, dt in results2:
self.assertFalse(r)
- self.assertTrue(dt >= 0.2, dt)
+ self.assertTimeout(dt, 0.5)
# The event is set
results1 = []
results2 = []
@@ -347,13 +391,13 @@ class ConditionTests(BaseTestCase):
phase_num = 0
def f():
cond.acquire()
- cond.wait()
+ result = cond.wait()
cond.release()
- results1.append(phase_num)
+ results1.append((result, phase_num))
cond.acquire()
- cond.wait()
+ result = cond.wait()
cond.release()
- results2.append(phase_num)
+ results2.append((result, phase_num))
b = Bunch(f, N)
b.wait_for_started()
_wait()
@@ -366,7 +410,7 @@ class ConditionTests(BaseTestCase):
cond.release()
while len(results1) < 3:
_wait()
- self.assertEqual(results1, [1] * 3)
+ self.assertEqual(results1, [(True, 1)] * 3)
self.assertEqual(results2, [])
# Notify 5 threads: they might be in their first or second wait
cond.acquire()
@@ -376,8 +420,8 @@ class ConditionTests(BaseTestCase):
cond.release()
while len(results1) + len(results2) < 8:
_wait()
- self.assertEqual(results1, [1] * 3 + [2] * 2)
- self.assertEqual(results2, [2] * 3)
+ self.assertEqual(results1, [(True, 1)] * 3 + [(True, 2)] * 2)
+ self.assertEqual(results2, [(True, 2)] * 3)
# Notify all threads: they are all in their second wait
cond.acquire()
cond.notify_all()
@@ -386,8 +430,8 @@ class ConditionTests(BaseTestCase):
cond.release()
while len(results2) < 5:
_wait()
- self.assertEqual(results1, [1] * 3 + [2] * 2)
- self.assertEqual(results2, [2] * 3 + [3] * 2)
+ self.assertEqual(results1, [(True, 1)] * 3 + [(True,2)] * 2)
+ self.assertEqual(results2, [(True, 2)] * 3 + [(True, 3)] * 2)
b.wait_for_finished()
def test_notify(self):
@@ -403,14 +447,60 @@ class ConditionTests(BaseTestCase):
def f():
cond.acquire()
t1 = time.time()
- cond.wait(0.2)
+ result = cond.wait(0.5)
t2 = time.time()
cond.release()
- results.append(t2 - t1)
+ results.append((t2 - t1, result))
Bunch(f, N).wait_for_finished()
- self.assertEqual(len(results), 5)
- for dt in results:
- self.assertTrue(dt >= 0.2, dt)
+ self.assertEqual(len(results), N)
+ for dt, result in results:
+ self.assertTimeout(dt, 0.5)
+ # Note that conceptually (that"s the condition variable protocol)
+ # a wait() may succeed even if no one notifies us and before any
+ # timeout occurs. Spurious wakeups can occur.
+ # This makes it hard to verify the result value.
+ # In practice, this implementation has no spurious wakeups.
+ self.assertFalse(result)
+
+ def test_waitfor(self):
+ cond = self.condtype()
+ state = 0
+ def f():
+ with cond:
+ result = cond.wait_for(lambda : state==4)
+ self.assertTrue(result)
+ self.assertEqual(state, 4)
+ b = Bunch(f, 1)
+ b.wait_for_started()
+ for i in range(5):
+ time.sleep(0.01)
+ with cond:
+ state += 1
+ cond.notify()
+ b.wait_for_finished()
+
+ def test_waitfor_timeout(self):
+ cond = self.condtype()
+ state = 0
+ success = []
+ def f():
+ with cond:
+ dt = time.time()
+ result = cond.wait_for(lambda : state==4, timeout=0.1)
+ dt = time.time() - dt
+ self.assertFalse(result)
+ self.assertTimeout(dt, 0.1)
+ success.append(None)
+ b = Bunch(f, 1)
+ b.wait_for_started()
+ # Only increment 3 times, so state == 4 is never reached.
+ for i in range(3):
+ time.sleep(0.01)
+ with cond:
+ state += 1
+ cond.notify()
+ b.wait_for_finished()
+ self.assertEqual(len(success), 1)
class BaseSemaphoreTests(BaseTestCase):
@@ -493,6 +583,19 @@ class BaseSemaphoreTests(BaseTestCase):
# ordered.
self.assertEqual(sorted(results), [False] * 7 + [True] * 3 )
+ def test_acquire_timeout(self):
+ sem = self.semtype(2)
+ self.assertRaises(ValueError, sem.acquire, False, timeout=1.0)
+ self.assertTrue(sem.acquire(timeout=0.005))
+ self.assertTrue(sem.acquire(timeout=0.005))
+ self.assertFalse(sem.acquire(timeout=0.005))
+ sem.release()
+ self.assertTrue(sem.acquire(timeout=0.005))
+ t = time.time()
+ self.assertFalse(sem.acquire(timeout=0.5))
+ dt = time.time() - t
+ self.assertTimeout(dt, 0.5)
+
def test_default_value(self):
# The default initial value is 1.
sem = self.semtype()
@@ -550,3 +653,196 @@ class BoundedSemaphoreTests(BaseSemaphoreTests):
sem.acquire()
sem.release()
self.assertRaises(ValueError, sem.release)
+
+
+class BarrierTests(BaseTestCase):
+ """
+ Tests for Barrier objects.
+ """
+ N = 5
+ defaultTimeout = 2.0
+
+ def setUp(self):
+ self.barrier = self.barriertype(self.N, timeout=self.defaultTimeout)
+ def tearDown(self):
+ self.barrier.abort()
+
+ def run_threads(self, f):
+ b = Bunch(f, self.N-1)
+ f()
+ b.wait_for_finished()
+
+ def multipass(self, results, n):
+ m = self.barrier.parties
+ self.assertEqual(m, self.N)
+ for i in range(n):
+ results[0].append(True)
+ self.assertEqual(len(results[1]), i * m)
+ self.barrier.wait()
+ results[1].append(True)
+ self.assertEqual(len(results[0]), (i + 1) * m)
+ self.barrier.wait()
+ self.assertEqual(self.barrier.n_waiting, 0)
+ self.assertFalse(self.barrier.broken)
+
+ def test_barrier(self, passes=1):
+ """
+ Test that a barrier is passed in lockstep
+ """
+ results = [[],[]]
+ def f():
+ self.multipass(results, passes)
+ self.run_threads(f)
+
+ def test_barrier_10(self):
+ """
+ Test that a barrier works for 10 consecutive runs
+ """
+ return self.test_barrier(10)
+
+ def test_wait_return(self):
+ """
+ test the return value from barrier.wait
+ """
+ results = []
+ def f():
+ r = self.barrier.wait()
+ results.append(r)
+
+ self.run_threads(f)
+ self.assertEqual(sum(results), sum(range(self.N)))
+
+ def test_action(self):
+ """
+ Test the 'action' callback
+ """
+ results = []
+ def action():
+ results.append(True)
+ barrier = self.barriertype(self.N, action)
+ def f():
+ barrier.wait()
+ self.assertEqual(len(results), 1)
+
+ self.run_threads(f)
+
+ def test_abort(self):
+ """
+ Test that an abort will put the barrier in a broken state
+ """
+ results1 = []
+ results2 = []
+ def f():
+ try:
+ i = self.barrier.wait()
+ if i == self.N//2:
+ raise RuntimeError
+ self.barrier.wait()
+ results1.append(True)
+ except threading.BrokenBarrierError:
+ results2.append(True)
+ except RuntimeError:
+ self.barrier.abort()
+ pass
+
+ self.run_threads(f)
+ self.assertEqual(len(results1), 0)
+ self.assertEqual(len(results2), self.N-1)
+ self.assertTrue(self.barrier.broken)
+
+ def test_reset(self):
+ """
+ Test that a 'reset' on a barrier frees the waiting threads
+ """
+ results1 = []
+ results2 = []
+ results3 = []
+ def f():
+ i = self.barrier.wait()
+ if i == self.N//2:
+ # Wait until the other threads are all in the barrier.
+ while self.barrier.n_waiting < self.N-1:
+ time.sleep(0.001)
+ self.barrier.reset()
+ else:
+ try:
+ self.barrier.wait()
+ results1.append(True)
+ except threading.BrokenBarrierError:
+ results2.append(True)
+ # Now, pass the barrier again
+ self.barrier.wait()
+ results3.append(True)
+
+ self.run_threads(f)
+ self.assertEqual(len(results1), 0)
+ self.assertEqual(len(results2), self.N-1)
+ self.assertEqual(len(results3), self.N)
+
+
+ def test_abort_and_reset(self):
+ """
+ Test that a barrier can be reset after being broken.
+ """
+ results1 = []
+ results2 = []
+ results3 = []
+ barrier2 = self.barriertype(self.N)
+ def f():
+ try:
+ i = self.barrier.wait()
+ if i == self.N//2:
+ raise RuntimeError
+ self.barrier.wait()
+ results1.append(True)
+ except threading.BrokenBarrierError:
+ results2.append(True)
+ except RuntimeError:
+ self.barrier.abort()
+ pass
+ # Synchronize and reset the barrier. Must synchronize first so
+ # that everyone has left it when we reset, and after so that no
+ # one enters it before the reset.
+ if barrier2.wait() == self.N//2:
+ self.barrier.reset()
+ barrier2.wait()
+ self.barrier.wait()
+ results3.append(True)
+
+ self.run_threads(f)
+ self.assertEqual(len(results1), 0)
+ self.assertEqual(len(results2), self.N-1)
+ self.assertEqual(len(results3), self.N)
+
+ def test_timeout(self):
+ """
+ Test wait(timeout)
+ """
+ def f():
+ i = self.barrier.wait()
+ if i == self.N // 2:
+ # One thread is late!
+ time.sleep(1.0)
+ # Default timeout is 2.0, so this is shorter.
+ self.assertRaises(threading.BrokenBarrierError,
+ self.barrier.wait, 0.5)
+ self.run_threads(f)
+
+ def test_default_timeout(self):
+ """
+ Test the barrier's default timeout
+ """
+ #create a barrier with a low default timeout
+ barrier = self.barriertype(self.N, timeout=0.1)
+ def f():
+ i = barrier.wait()
+ if i == self.N // 2:
+ # One thread is later than the default timeout of 0.1s.
+ time.sleep(1.0)
+ self.assertRaises(threading.BrokenBarrierError, barrier.wait)
+ self.run_threads(f)
+
+ def test_single_thread(self):
+ b = self.barriertype(1)
+ b.wait()
+ b.wait()
diff --git a/Lib/test/make_ssl_certs.py b/Lib/test/make_ssl_certs.py
new file mode 100644
index 0000000000..48d2e57f4b
--- /dev/null
+++ b/Lib/test/make_ssl_certs.py
@@ -0,0 +1,64 @@
+"""Make the custom certificate and private key files used by test_ssl
+and friends."""
+
+import os
+import sys
+import tempfile
+from subprocess import *
+
+req_template = """
+ [req]
+ distinguished_name = req_distinguished_name
+ x509_extensions = req_x509_extensions
+ prompt = no
+
+ [req_distinguished_name]
+ C = XY
+ L = Castle Anthrax
+ O = Python Software Foundation
+ CN = {hostname}
+
+ [req_x509_extensions]
+ subjectAltName = DNS:{hostname}
+ """
+
+here = os.path.abspath(os.path.dirname(__file__))
+
+def make_cert_key(hostname):
+ tempnames = []
+ for i in range(3):
+ with tempfile.NamedTemporaryFile(delete=False) as f:
+ tempnames.append(f.name)
+ req_file, cert_file, key_file = tempnames
+ try:
+ with open(req_file, 'w') as f:
+ f.write(req_template.format(hostname=hostname))
+ args = ['req', '-new', '-days', '3650', '-nodes', '-x509',
+ '-newkey', 'rsa:1024', '-keyout', key_file,
+ '-out', cert_file, '-config', req_file]
+ check_call(['openssl'] + args)
+ with open(cert_file, 'r') as f:
+ cert = f.read()
+ with open(key_file, 'r') as f:
+ key = f.read()
+ return cert, key
+ finally:
+ for name in tempnames:
+ os.remove(name)
+
+
+if __name__ == '__main__':
+ os.chdir(here)
+ cert, key = make_cert_key('localhost')
+ with open('ssl_cert.pem', 'w') as f:
+ f.write(cert)
+ with open('ssl_key.pem', 'w') as f:
+ f.write(key)
+ with open('keycert.pem', 'w') as f:
+ f.write(key)
+ f.write(cert)
+ # For certificate matching tests
+ cert, key = make_cert_key('fakehostname')
+ with open('keycert2.pem', 'w') as f:
+ f.write(key)
+ f.write(cert)
diff --git a/Lib/test/mapping_tests.py b/Lib/test/mapping_tests.py
index c34bd59e9c..d2b7a59a30 100644
--- a/Lib/test/mapping_tests.py
+++ b/Lib/test/mapping_tests.py
@@ -56,9 +56,9 @@ class BasicTestMappingProtocol(unittest.TestCase):
self.assertEqual(len(d), len(self.reference))
#__contains__
for k in self.reference:
- self.assertTrue(k in d)
+ self.assertIn(k, d)
for k in self.other:
- self.assertFalse(k in d)
+ self.assertNotIn(k, d)
#cmp
self.assertEqual(p, p)
self.assertEqual(d, d)
@@ -85,7 +85,7 @@ class BasicTestMappingProtocol(unittest.TestCase):
knownkey, knownvalue = next(iter(self.other.items()))
self.assertEqual(d.get(key, knownvalue), value)
self.assertEqual(d.get(knownkey, knownvalue), knownvalue)
- self.assertFalse(knownkey in d)
+ self.assertNotIn(knownkey, d)
def test_write(self):
# Test for write operations on mapping
@@ -115,16 +115,16 @@ class BasicTestMappingProtocol(unittest.TestCase):
self.assertEqual(d[knownkey], knownvalue)
#pop
self.assertEqual(d.pop(knownkey), knownvalue)
- self.assertFalse(knownkey in d)
+ self.assertNotIn(knownkey, d)
self.assertRaises(KeyError, d.pop, knownkey)
default = 909
d[knownkey] = knownvalue
self.assertEqual(d.pop(knownkey, default), knownvalue)
- self.assertFalse(knownkey in d)
+ self.assertNotIn(knownkey, d)
self.assertEqual(d.pop(knownkey, default), default)
#popitem
key, value = d.popitem()
- self.assertFalse(key in d)
+ self.assertNotIn(key, d)
self.assertEqual(value, self.reference[key])
p=self._empty_mapping()
self.assertRaises(KeyError, p.popitem)
@@ -142,8 +142,8 @@ class BasicTestMappingProtocol(unittest.TestCase):
d = self._empty_mapping()
self.assertEqual(list(d.keys()), [])
d = self.reference
- self.assertTrue(list(self.inmapping.keys())[0] in d.keys())
- self.assertTrue(list(self.other.keys())[0] not in d.keys())
+ self.assertIn(list(self.inmapping.keys())[0], d.keys())
+ self.assertNotIn(list(self.other.keys())[0], d.keys())
self.assertRaises(TypeError, d.keys, None)
def test_values(self):
@@ -320,9 +320,9 @@ class TestMappingProtocol(BasicTestMappingProtocol):
self.assertEqual(list(d.keys()), [])
d = self._full_mapping({'a': 1, 'b': 2})
k = d.keys()
- self.assertTrue('a' in k)
- self.assertTrue('b' in k)
- self.assertTrue('c' not in k)
+ self.assertIn('a', k)
+ self.assertIn('b', k)
+ self.assertNotIn('c', k)
def test_values(self):
BasicTestMappingProtocol.test_values(self)
@@ -337,12 +337,13 @@ class TestMappingProtocol(BasicTestMappingProtocol):
def test_contains(self):
d = self._empty_mapping()
+ self.assertNotIn('a', d)
self.assertTrue(not ('a' in d))
self.assertTrue('a' not in d)
d = self._full_mapping({'a': 1, 'b': 2})
- self.assertTrue('a' in d)
- self.assertTrue('b' in d)
- self.assertTrue('c' not in d)
+ self.assertIn('a', d)
+ self.assertIn('b', d)
+ self.assertNotIn('c', d)
self.assertRaises(TypeError, d.__contains__)
@@ -434,15 +435,13 @@ class TestMappingProtocol(BasicTestMappingProtocol):
self.assertEqual(dictlike().fromkeys('a'), {'a':None})
self.assertTrue(dictlike.fromkeys('a').__class__ is dictlike)
self.assertTrue(dictlike().fromkeys('a').__class__ is dictlike)
- # FIXME: the following won't work with UserDict, because it's an old style class
- # self.assertTrue(type(dictlike.fromkeys('a')) is dictlike)
+ self.assertTrue(type(dictlike.fromkeys('a')) is dictlike)
class mydict(self.type2test):
def __new__(cls):
return collections.UserDict()
ud = mydict.fromkeys('ab')
self.assertEqual(ud, {'a':None, 'b':None})
- # FIXME: the following won't work with UserDict, because it's an old style class
- # self.assertTrue(isinstance(ud, collections.UserDict))
+ self.assertIsInstance(ud, collections.UserDict)
self.assertRaises(TypeError, dict.fromkeys)
class Exc(Exception): pass
@@ -472,7 +471,7 @@ class TestMappingProtocol(BasicTestMappingProtocol):
self.assertEqual(d.copy(), {1:1, 2:2, 3:3})
d = self._empty_mapping()
self.assertEqual(d.copy(), d)
- self.assertTrue(isinstance(d.copy(), d.__class__))
+ self.assertIsInstance(d.copy(), d.__class__)
self.assertRaises(TypeError, d.copy, None)
def test_get(self):
@@ -528,13 +527,6 @@ class TestMappingProtocol(BasicTestMappingProtocol):
d = self._empty_mapping()
k, v = 'abc', 'def'
- # verify longs/ints get same value when key > 32 bits (for 64-bit archs)
- # see SF bug #689659
- x = 4503599627370496
- y = 4503599627370496
- h = self._full_mapping({x: 'anything', y: 'something else'})
- self.assertEqual(h[x], h[y])
-
self.assertEqual(d.pop(k, v), v)
d[k] = v
self.assertEqual(d.pop(k, 1), v)
@@ -577,7 +569,7 @@ class TestHashMappingProtocol(TestMappingProtocol):
return collections.UserDict()
ud = mydict.fromkeys('ab')
self.assertEqual(ud, {'a':None, 'b':None})
- self.assertTrue(isinstance(ud, collections.UserDict))
+ self.assertIsInstance(ud, collections.UserDict)
def test_pop(self):
TestMappingProtocol.test_pop(self)
diff --git a/Lib/test/math_testcases.txt b/Lib/test/math_testcases.txt
new file mode 100644
index 0000000000..5e24335a87
--- /dev/null
+++ b/Lib/test/math_testcases.txt
@@ -0,0 +1,519 @@
+-- Testcases for functions in math.
+--
+-- Each line takes the form:
+--
+-- <testid> <function> <input_value> -> <output_value> <flags>
+--
+-- where:
+--
+-- <testid> is a short name identifying the test,
+--
+-- <function> is the function to be tested (exp, cos, asinh, ...),
+--
+-- <input_value> is a string representing a floating-point value
+--
+-- <output_value> is the expected (ideal) output value, again
+-- represented as a string.
+--
+-- <flags> is a list of the floating-point flags required by C99
+--
+-- The possible flags are:
+--
+-- divide-by-zero : raised when a finite input gives a
+-- mathematically infinite result.
+--
+-- overflow : raised when a finite input gives a finite result that
+-- is too large to fit in the usual range of an IEEE 754 double.
+--
+-- invalid : raised for invalid inputs (e.g., sqrt(-1))
+--
+-- ignore-sign : indicates that the sign of the result is
+-- unspecified; e.g., if the result is given as inf,
+-- then both -inf and inf should be accepted as correct.
+--
+-- Flags may appear in any order.
+--
+-- Lines beginning with '--' (like this one) start a comment, and are
+-- ignored. Blank lines, or lines containing only whitespace, are also
+-- ignored.
+
+-- Many of the values below were computed with the help of
+-- version 2.4 of the MPFR library for multiple-precision
+-- floating-point computations with correct rounding. All output
+-- values in this file are (modulo yet-to-be-discovered bugs)
+-- correctly rounded, provided that each input and output decimal
+-- floating-point value below is interpreted as a representation of
+-- the corresponding nearest IEEE 754 double-precision value. See the
+-- MPFR homepage at http://www.mpfr.org for more information about the
+-- MPFR project.
+
+
+-------------------------
+-- erf: error function --
+-------------------------
+
+erf0000 erf 0.0 -> 0.0
+erf0001 erf -0.0 -> -0.0
+erf0002 erf inf -> 1.0
+erf0003 erf -inf -> -1.0
+erf0004 erf nan -> nan
+
+-- tiny values
+erf0010 erf 1e-308 -> 1.1283791670955125e-308
+erf0011 erf 5e-324 -> 4.9406564584124654e-324
+erf0012 erf 1e-10 -> 1.1283791670955126e-10
+
+-- small integers
+erf0020 erf 1 -> 0.84270079294971489
+erf0021 erf 2 -> 0.99532226501895271
+erf0022 erf 3 -> 0.99997790950300136
+erf0023 erf 4 -> 0.99999998458274209
+erf0024 erf 5 -> 0.99999999999846256
+erf0025 erf 6 -> 1.0
+
+erf0030 erf -1 -> -0.84270079294971489
+erf0031 erf -2 -> -0.99532226501895271
+erf0032 erf -3 -> -0.99997790950300136
+erf0033 erf -4 -> -0.99999998458274209
+erf0034 erf -5 -> -0.99999999999846256
+erf0035 erf -6 -> -1.0
+
+-- huge values should all go to +/-1, depending on sign
+erf0040 erf -40 -> -1.0
+erf0041 erf 1e16 -> 1.0
+erf0042 erf -1e150 -> -1.0
+erf0043 erf 1.7e308 -> 1.0
+
+-- Issue 8986: inputs x with exp(-x*x) near the underflow threshold
+-- incorrectly signalled overflow on some platforms.
+erf0100 erf 26.2 -> 1.0
+erf0101 erf 26.4 -> 1.0
+erf0102 erf 26.6 -> 1.0
+erf0103 erf 26.8 -> 1.0
+erf0104 erf 27.0 -> 1.0
+erf0105 erf 27.2 -> 1.0
+erf0106 erf 27.4 -> 1.0
+erf0107 erf 27.6 -> 1.0
+
+erf0110 erf -26.2 -> -1.0
+erf0111 erf -26.4 -> -1.0
+erf0112 erf -26.6 -> -1.0
+erf0113 erf -26.8 -> -1.0
+erf0114 erf -27.0 -> -1.0
+erf0115 erf -27.2 -> -1.0
+erf0116 erf -27.4 -> -1.0
+erf0117 erf -27.6 -> -1.0
+
+----------------------------------------
+-- erfc: complementary error function --
+----------------------------------------
+
+erfc0000 erfc 0.0 -> 1.0
+erfc0001 erfc -0.0 -> 1.0
+erfc0002 erfc inf -> 0.0
+erfc0003 erfc -inf -> 2.0
+erfc0004 erfc nan -> nan
+
+-- tiny values
+erfc0010 erfc 1e-308 -> 1.0
+erfc0011 erfc 5e-324 -> 1.0
+erfc0012 erfc 1e-10 -> 0.99999999988716204
+
+-- small integers
+erfc0020 erfc 1 -> 0.15729920705028513
+erfc0021 erfc 2 -> 0.0046777349810472662
+erfc0022 erfc 3 -> 2.2090496998585441e-05
+erfc0023 erfc 4 -> 1.541725790028002e-08
+erfc0024 erfc 5 -> 1.5374597944280349e-12
+erfc0025 erfc 6 -> 2.1519736712498913e-17
+
+erfc0030 erfc -1 -> 1.8427007929497148
+erfc0031 erfc -2 -> 1.9953222650189528
+erfc0032 erfc -3 -> 1.9999779095030015
+erfc0033 erfc -4 -> 1.9999999845827421
+erfc0034 erfc -5 -> 1.9999999999984626
+erfc0035 erfc -6 -> 2.0
+
+-- as x -> infinity, erfc(x) behaves like exp(-x*x)/x/sqrt(pi)
+erfc0040 erfc 20 -> 5.3958656116079012e-176
+erfc0041 erfc 25 -> 8.3001725711965228e-274
+erfc0042 erfc 27 -> 5.2370464393526292e-319
+erfc0043 erfc 28 -> 0.0
+
+-- huge values
+erfc0050 erfc -40 -> 2.0
+erfc0051 erfc 1e16 -> 0.0
+erfc0052 erfc -1e150 -> 2.0
+erfc0053 erfc 1.7e308 -> 0.0
+
+-- Issue 8986: inputs x with exp(-x*x) near the underflow threshold
+-- incorrectly signalled overflow on some platforms.
+erfc0100 erfc 26.2 -> 1.6432507924389461e-300
+erfc0101 erfc 26.4 -> 4.4017768588035426e-305
+erfc0102 erfc 26.6 -> 1.0885125885442269e-309
+erfc0103 erfc 26.8 -> 2.4849621571966629e-314
+erfc0104 erfc 27.0 -> 5.2370464393526292e-319
+erfc0105 erfc 27.2 -> 9.8813129168249309e-324
+erfc0106 erfc 27.4 -> 0.0
+erfc0107 erfc 27.6 -> 0.0
+
+erfc0110 erfc -26.2 -> 2.0
+erfc0111 erfc -26.4 -> 2.0
+erfc0112 erfc -26.6 -> 2.0
+erfc0113 erfc -26.8 -> 2.0
+erfc0114 erfc -27.0 -> 2.0
+erfc0115 erfc -27.2 -> 2.0
+erfc0116 erfc -27.4 -> 2.0
+erfc0117 erfc -27.6 -> 2.0
+
+---------------------------------------------------------
+-- lgamma: log of absolute value of the gamma function --
+---------------------------------------------------------
+
+-- special values
+lgam0000 lgamma 0.0 -> inf divide-by-zero
+lgam0001 lgamma -0.0 -> inf divide-by-zero
+lgam0002 lgamma inf -> inf
+lgam0003 lgamma -inf -> inf
+lgam0004 lgamma nan -> nan
+
+-- negative integers
+lgam0010 lgamma -1 -> inf divide-by-zero
+lgam0011 lgamma -2 -> inf divide-by-zero
+lgam0012 lgamma -1e16 -> inf divide-by-zero
+lgam0013 lgamma -1e300 -> inf divide-by-zero
+lgam0014 lgamma -1.79e308 -> inf divide-by-zero
+
+-- small positive integers give factorials
+lgam0020 lgamma 1 -> 0.0
+lgam0021 lgamma 2 -> 0.0
+lgam0022 lgamma 3 -> 0.69314718055994529
+lgam0023 lgamma 4 -> 1.791759469228055
+lgam0024 lgamma 5 -> 3.1780538303479458
+lgam0025 lgamma 6 -> 4.7874917427820458
+
+-- half integers
+lgam0030 lgamma 0.5 -> 0.57236494292470008
+lgam0031 lgamma 1.5 -> -0.12078223763524522
+lgam0032 lgamma 2.5 -> 0.28468287047291918
+lgam0033 lgamma 3.5 -> 1.2009736023470743
+lgam0034 lgamma -0.5 -> 1.2655121234846454
+lgam0035 lgamma -1.5 -> 0.86004701537648098
+lgam0036 lgamma -2.5 -> -0.056243716497674054
+lgam0037 lgamma -3.5 -> -1.309006684993042
+
+-- values near 0
+lgam0040 lgamma 0.1 -> 2.252712651734206
+lgam0041 lgamma 0.01 -> 4.5994798780420219
+lgam0042 lgamma 1e-8 -> 18.420680738180209
+lgam0043 lgamma 1e-16 -> 36.841361487904734
+lgam0044 lgamma 1e-30 -> 69.077552789821368
+lgam0045 lgamma 1e-160 -> 368.41361487904732
+lgam0046 lgamma 1e-308 -> 709.19620864216608
+lgam0047 lgamma 5.6e-309 -> 709.77602713741896
+lgam0048 lgamma 5.5e-309 -> 709.79404564292167
+lgam0049 lgamma 1e-309 -> 711.49879373516012
+lgam0050 lgamma 1e-323 -> 743.74692474082133
+lgam0051 lgamma 5e-324 -> 744.44007192138122
+lgam0060 lgamma -0.1 -> 2.3689613327287886
+lgam0061 lgamma -0.01 -> 4.6110249927528013
+lgam0062 lgamma -1e-8 -> 18.420680749724522
+lgam0063 lgamma -1e-16 -> 36.841361487904734
+lgam0064 lgamma -1e-30 -> 69.077552789821368
+lgam0065 lgamma -1e-160 -> 368.41361487904732
+lgam0066 lgamma -1e-308 -> 709.19620864216608
+lgam0067 lgamma -5.6e-309 -> 709.77602713741896
+lgam0068 lgamma -5.5e-309 -> 709.79404564292167
+lgam0069 lgamma -1e-309 -> 711.49879373516012
+lgam0070 lgamma -1e-323 -> 743.74692474082133
+lgam0071 lgamma -5e-324 -> 744.44007192138122
+
+-- values near negative integers
+lgam0080 lgamma -0.99999999999999989 -> 36.736800569677101
+lgam0081 lgamma -1.0000000000000002 -> 36.043653389117154
+lgam0082 lgamma -1.9999999999999998 -> 35.350506208557213
+lgam0083 lgamma -2.0000000000000004 -> 34.657359027997266
+lgam0084 lgamma -100.00000000000001 -> -331.85460524980607
+lgam0085 lgamma -99.999999999999986 -> -331.85460524980596
+
+-- large inputs
+lgam0100 lgamma 170 -> 701.43726380873704
+lgam0101 lgamma 171 -> 706.57306224578736
+lgam0102 lgamma 171.624 -> 709.78077443669895
+lgam0103 lgamma 171.625 -> 709.78591682948365
+lgam0104 lgamma 172 -> 711.71472580228999
+lgam0105 lgamma 2000 -> 13198.923448054265
+lgam0106 lgamma 2.55998332785163e305 -> 1.7976931348623099e+308
+lgam0107 lgamma 2.55998332785164e305 -> inf overflow
+lgam0108 lgamma 1.7e308 -> inf overflow
+
+-- inputs for which gamma(x) is tiny
+lgam0120 lgamma -100.5 -> -364.90096830942736
+lgam0121 lgamma -160.5 -> -656.88005261126432
+lgam0122 lgamma -170.5 -> -707.99843314507882
+lgam0123 lgamma -171.5 -> -713.14301641168481
+lgam0124 lgamma -176.5 -> -738.95247590846486
+lgam0125 lgamma -177.5 -> -744.13144651738037
+lgam0126 lgamma -178.5 -> -749.3160351186001
+
+lgam0130 lgamma -1000.5 -> -5914.4377011168517
+lgam0131 lgamma -30000.5 -> -279278.6629959144
+lgam0132 lgamma -4503599627370495.5 -> -1.5782258434492883e+17
+
+-- results close to 0: positive argument ...
+lgam0150 lgamma 0.99999999999999989 -> 6.4083812134800075e-17
+lgam0151 lgamma 1.0000000000000002 -> -1.2816762426960008e-16
+lgam0152 lgamma 1.9999999999999998 -> -9.3876980655431170e-17
+lgam0153 lgamma 2.0000000000000004 -> 1.8775396131086244e-16
+
+-- ... and negative argument
+lgam0160 lgamma -2.7476826467 -> -5.2477408147689136e-11
+lgam0161 lgamma -2.457024738 -> 3.3464637541912932e-10
+
+
+---------------------------
+-- gamma: Gamma function --
+---------------------------
+
+-- special values
+gam0000 gamma 0.0 -> inf divide-by-zero
+gam0001 gamma -0.0 -> -inf divide-by-zero
+gam0002 gamma inf -> inf
+gam0003 gamma -inf -> nan invalid
+gam0004 gamma nan -> nan
+
+-- negative integers inputs are invalid
+gam0010 gamma -1 -> nan invalid
+gam0011 gamma -2 -> nan invalid
+gam0012 gamma -1e16 -> nan invalid
+gam0013 gamma -1e300 -> nan invalid
+
+-- small positive integers give factorials
+gam0020 gamma 1 -> 1
+gam0021 gamma 2 -> 1
+gam0022 gamma 3 -> 2
+gam0023 gamma 4 -> 6
+gam0024 gamma 5 -> 24
+gam0025 gamma 6 -> 120
+
+-- half integers
+gam0030 gamma 0.5 -> 1.7724538509055161
+gam0031 gamma 1.5 -> 0.88622692545275805
+gam0032 gamma 2.5 -> 1.3293403881791370
+gam0033 gamma 3.5 -> 3.3233509704478426
+gam0034 gamma -0.5 -> -3.5449077018110322
+gam0035 gamma -1.5 -> 2.3632718012073548
+gam0036 gamma -2.5 -> -0.94530872048294190
+gam0037 gamma -3.5 -> 0.27008820585226911
+
+-- values near 0
+gam0040 gamma 0.1 -> 9.5135076986687306
+gam0041 gamma 0.01 -> 99.432585119150602
+gam0042 gamma 1e-8 -> 99999999.422784343
+gam0043 gamma 1e-16 -> 10000000000000000
+gam0044 gamma 1e-30 -> 9.9999999999999988e+29
+gam0045 gamma 1e-160 -> 1.0000000000000000e+160
+gam0046 gamma 1e-308 -> 1.0000000000000000e+308
+gam0047 gamma 5.6e-309 -> 1.7857142857142848e+308
+gam0048 gamma 5.5e-309 -> inf overflow
+gam0049 gamma 1e-309 -> inf overflow
+gam0050 gamma 1e-323 -> inf overflow
+gam0051 gamma 5e-324 -> inf overflow
+gam0060 gamma -0.1 -> -10.686287021193193
+gam0061 gamma -0.01 -> -100.58719796441078
+gam0062 gamma -1e-8 -> -100000000.57721567
+gam0063 gamma -1e-16 -> -10000000000000000
+gam0064 gamma -1e-30 -> -9.9999999999999988e+29
+gam0065 gamma -1e-160 -> -1.0000000000000000e+160
+gam0066 gamma -1e-308 -> -1.0000000000000000e+308
+gam0067 gamma -5.6e-309 -> -1.7857142857142848e+308
+gam0068 gamma -5.5e-309 -> -inf overflow
+gam0069 gamma -1e-309 -> -inf overflow
+gam0070 gamma -1e-323 -> -inf overflow
+gam0071 gamma -5e-324 -> -inf overflow
+
+-- values near negative integers
+gam0080 gamma -0.99999999999999989 -> -9007199254740992.0
+gam0081 gamma -1.0000000000000002 -> 4503599627370495.5
+gam0082 gamma -1.9999999999999998 -> 2251799813685248.5
+gam0083 gamma -2.0000000000000004 -> -1125899906842623.5
+gam0084 gamma -100.00000000000001 -> -7.5400833348831090e-145
+gam0085 gamma -99.999999999999986 -> 7.5400833348840962e-145
+
+-- large inputs
+gam0100 gamma 170 -> 4.2690680090047051e+304
+gam0101 gamma 171 -> 7.2574156153079990e+306
+gam0102 gamma 171.624 -> 1.7942117599248104e+308
+gam0103 gamma 171.625 -> inf overflow
+gam0104 gamma 172 -> inf overflow
+gam0105 gamma 2000 -> inf overflow
+gam0106 gamma 1.7e308 -> inf overflow
+
+-- inputs for which gamma(x) is tiny
+gam0120 gamma -100.5 -> -3.3536908198076787e-159
+gam0121 gamma -160.5 -> -5.2555464470078293e-286
+gam0122 gamma -170.5 -> -3.3127395215386074e-308
+gam0123 gamma -171.5 -> 1.9316265431711902e-310
+gam0124 gamma -176.5 -> -1.1956388629358166e-321
+gam0125 gamma -177.5 -> 4.9406564584124654e-324
+gam0126 gamma -178.5 -> -0.0
+gam0127 gamma -179.5 -> 0.0
+gam0128 gamma -201.0001 -> 0.0
+gam0129 gamma -202.9999 -> -0.0
+gam0130 gamma -1000.5 -> -0.0
+gam0131 gamma -1000000000.3 -> -0.0
+gam0132 gamma -4503599627370495.5 -> 0.0
+
+-- inputs that cause problems for the standard reflection formula,
+-- thanks to loss of accuracy in 1-x
+gam0140 gamma -63.349078729022985 -> 4.1777971677761880e-88
+gam0141 gamma -127.45117632943295 -> 1.1831110896236810e-214
+
+
+-----------------------------------------------------------
+-- log1p: log(1 + x), without precision loss for small x --
+-----------------------------------------------------------
+
+-- special values
+log1p0000 log1p 0.0 -> 0.0
+log1p0001 log1p -0.0 -> -0.0
+log1p0002 log1p inf -> inf
+log1p0003 log1p -inf -> nan invalid
+log1p0004 log1p nan -> nan
+
+-- singularity at -1.0
+log1p0010 log1p -1.0 -> -inf divide-by-zero
+log1p0011 log1p -0.9999999999999999 -> -36.736800569677101
+
+-- finite values < 1.0 are invalid
+log1p0020 log1p -1.0000000000000002 -> nan invalid
+log1p0021 log1p -1.1 -> nan invalid
+log1p0022 log1p -2.0 -> nan invalid
+log1p0023 log1p -1e300 -> nan invalid
+
+-- tiny x: log1p(x) ~ x
+log1p0110 log1p 5e-324 -> 5e-324
+log1p0111 log1p 1e-320 -> 1e-320
+log1p0112 log1p 1e-300 -> 1e-300
+log1p0113 log1p 1e-150 -> 1e-150
+log1p0114 log1p 1e-20 -> 1e-20
+
+log1p0120 log1p -5e-324 -> -5e-324
+log1p0121 log1p -1e-320 -> -1e-320
+log1p0122 log1p -1e-300 -> -1e-300
+log1p0123 log1p -1e-150 -> -1e-150
+log1p0124 log1p -1e-20 -> -1e-20
+
+-- some (mostly) random small and moderate-sized values
+log1p0200 log1p -0.89156889782277482 -> -2.2216403106762863
+log1p0201 log1p -0.23858496047770464 -> -0.27257668276980057
+log1p0202 log1p -0.011641726191307515 -> -0.011710021654495657
+log1p0203 log1p -0.0090126398571693817 -> -0.0090534993825007650
+log1p0204 log1p -0.00023442805985712781 -> -0.00023445554240995693
+log1p0205 log1p -1.5672870980936349e-5 -> -1.5672993801662046e-5
+log1p0206 log1p -7.9650013274825295e-6 -> -7.9650330482740401e-6
+log1p0207 log1p -2.5202948343227410e-7 -> -2.5202951519170971e-7
+log1p0208 log1p -8.2446372820745855e-11 -> -8.2446372824144559e-11
+log1p0209 log1p -8.1663670046490789e-12 -> -8.1663670046824230e-12
+log1p0210 log1p 7.0351735084656292e-18 -> 7.0351735084656292e-18
+log1p0211 log1p 5.2732161907375226e-12 -> 5.2732161907236188e-12
+log1p0212 log1p 1.0000000000000000e-10 -> 9.9999999995000007e-11
+log1p0213 log1p 2.1401273266000197e-9 -> 2.1401273243099470e-9
+log1p0214 log1p 1.2668914653979560e-8 -> 1.2668914573728861e-8
+log1p0215 log1p 1.6250007816299069e-6 -> 1.6249994613175672e-6
+log1p0216 log1p 8.3740495645839399e-6 -> 8.3740145024266269e-6
+log1p0217 log1p 3.0000000000000001e-5 -> 2.9999550008999799e-5
+log1p0218 log1p 0.0070000000000000001 -> 0.0069756137364252423
+log1p0219 log1p 0.013026235315053002 -> 0.012942123564008787
+log1p0220 log1p 0.013497160797236184 -> 0.013406885521915038
+log1p0221 log1p 0.027625599078135284 -> 0.027250897463483054
+log1p0222 log1p 0.14179687245544870 -> 0.13260322540908789
+
+-- large values
+log1p0300 log1p 1.7976931348623157e+308 -> 709.78271289338397
+log1p0301 log1p 1.0000000000000001e+300 -> 690.77552789821368
+log1p0302 log1p 1.0000000000000001e+70 -> 161.18095650958321
+log1p0303 log1p 10000000000.000000 -> 23.025850930040455
+
+-- other values transferred from testLog1p in test_math
+log1p0400 log1p -0.63212055882855767 -> -1.0000000000000000
+log1p0401 log1p 1.7182818284590451 -> 1.0000000000000000
+log1p0402 log1p 1.0000000000000000 -> 0.69314718055994529
+log1p0403 log1p 1.2379400392853803e+27 -> 62.383246250395075
+
+
+-----------------------------------------------------------
+-- expm1: exp(x) - 1, without precision loss for small x --
+-----------------------------------------------------------
+
+-- special values
+expm10000 expm1 0.0 -> 0.0
+expm10001 expm1 -0.0 -> -0.0
+expm10002 expm1 inf -> inf
+expm10003 expm1 -inf -> -1.0
+expm10004 expm1 nan -> nan
+
+-- expm1(x) ~ x for tiny x
+expm10010 expm1 5e-324 -> 5e-324
+expm10011 expm1 1e-320 -> 1e-320
+expm10012 expm1 1e-300 -> 1e-300
+expm10013 expm1 1e-150 -> 1e-150
+expm10014 expm1 1e-20 -> 1e-20
+
+expm10020 expm1 -5e-324 -> -5e-324
+expm10021 expm1 -1e-320 -> -1e-320
+expm10022 expm1 -1e-300 -> -1e-300
+expm10023 expm1 -1e-150 -> -1e-150
+expm10024 expm1 -1e-20 -> -1e-20
+
+-- moderate sized values, where direct evaluation runs into trouble
+expm10100 expm1 1e-10 -> 1.0000000000500000e-10
+expm10101 expm1 -9.9999999999999995e-08 -> -9.9999995000000163e-8
+expm10102 expm1 3.0000000000000001e-05 -> 3.0000450004500034e-5
+expm10103 expm1 -0.0070000000000000001 -> -0.0069755570667648951
+expm10104 expm1 -0.071499208740094633 -> -0.069002985744820250
+expm10105 expm1 -0.063296004180116799 -> -0.061334416373633009
+expm10106 expm1 0.02390954035597756 -> 0.024197665143819942
+expm10107 expm1 0.085637352649044901 -> 0.089411184580357767
+expm10108 expm1 0.5966174947411006 -> 0.81596588596501485
+expm10109 expm1 0.30247206212075139 -> 0.35319987035848677
+expm10110 expm1 0.74574727375889516 -> 1.1080161116737459
+expm10111 expm1 0.97767512926555711 -> 1.6582689207372185
+expm10112 expm1 0.8450154566787712 -> 1.3280137976535897
+expm10113 expm1 -0.13979260323125264 -> -0.13046144381396060
+expm10114 expm1 -0.52899322039643271 -> -0.41080213643695923
+expm10115 expm1 -0.74083261478900631 -> -0.52328317124797097
+expm10116 expm1 -0.93847766984546055 -> -0.60877704724085946
+expm10117 expm1 10.0 -> 22025.465794806718
+expm10118 expm1 27.0 -> 532048240600.79865
+expm10119 expm1 123 -> 2.6195173187490626e+53
+expm10120 expm1 -12.0 -> -0.99999385578764666
+expm10121 expm1 -35.100000000000001 -> -0.99999999999999944
+
+-- extreme negative values
+expm10201 expm1 -37.0 -> -0.99999999999999989
+expm10200 expm1 -38.0 -> -1.0
+expm10210 expm1 -710.0 -> -1.0
+-- the formula expm1(x) = 2 * sinh(x/2) * exp(x/2) doesn't work so
+-- well when exp(x/2) is subnormal or underflows to zero; check we're
+-- not using it!
+expm10211 expm1 -1420.0 -> -1.0
+expm10212 expm1 -1450.0 -> -1.0
+expm10213 expm1 -1500.0 -> -1.0
+expm10214 expm1 -1e50 -> -1.0
+expm10215 expm1 -1.79e308 -> -1.0
+
+-- extreme positive values
+expm10300 expm1 300 -> 1.9424263952412558e+130
+expm10301 expm1 700 -> 1.0142320547350045e+304
+-- the next test (expm10302) is disabled because it causes failure on
+-- OS X 10.4/Intel: apparently all values over 709.78 produce an
+-- overflow on that platform. See issue #7575.
+-- expm10302 expm1 709.78271289328393 -> 1.7976931346824240e+308
+expm10303 expm1 709.78271289348402 -> inf overflow
+expm10304 expm1 1000 -> inf overflow
+expm10305 expm1 1e50 -> inf overflow
+expm10306 expm1 1.79e308 -> inf overflow
+
+-- weaker version of expm10302
+expm10307 expm1 709.5 -> 1.3549863193146328e+308
diff --git a/Lib/test/mock_socket.py b/Lib/test/mock_socket.py
new file mode 100644
index 0000000000..803693283b
--- /dev/null
+++ b/Lib/test/mock_socket.py
@@ -0,0 +1,154 @@
+"""Mock socket module used by the smtpd and smtplib tests.
+"""
+
+# imported for _GLOBAL_DEFAULT_TIMEOUT
+import socket as socket_module
+
+# Mock socket module
+_defaulttimeout = None
+_reply_data = None
+
+# This is used to queue up data to be read through socket.makefile, typically
+# *before* the socket object is even created. It is intended to handle a single
+# line which the socket will feed on recv() or makefile().
+def reply_with(line):
+ global _reply_data
+ _reply_data = line
+
+
+class MockFile:
+ """Mock file object returned by MockSocket.makefile().
+ """
+ def __init__(self, lines):
+ self.lines = lines
+ def readline(self):
+ return self.lines.pop(0) + b'\r\n'
+ def close(self):
+ pass
+
+
+class MockSocket:
+ """Mock socket object used by smtpd and smtplib tests.
+ """
+ def __init__(self):
+ global _reply_data
+ self.output = []
+ self.lines = []
+ if _reply_data:
+ self.lines.append(_reply_data)
+ _reply_data = None
+ self.conn = None
+ self.timeout = None
+
+ def queue_recv(self, line):
+ self.lines.append(line)
+
+ def recv(self, bufsize, flags=None):
+ data = self.lines.pop(0) + b'\r\n'
+ return data
+
+ def fileno(self):
+ return 0
+
+ def settimeout(self, timeout):
+ if timeout is None:
+ self.timeout = _defaulttimeout
+ else:
+ self.timeout = timeout
+
+ def gettimeout(self):
+ return self.timeout
+
+ def setsockopt(self, level, optname, value):
+ pass
+
+ def getsockopt(self, level, optname, buflen=None):
+ return 0
+
+ def bind(self, address):
+ pass
+
+ def accept(self):
+ self.conn = MockSocket()
+ return self.conn, 'c'
+
+ def getsockname(self):
+ return ('0.0.0.0', 0)
+
+ def setblocking(self, flag):
+ pass
+
+ def listen(self, backlog):
+ pass
+
+ def makefile(self, mode='r', bufsize=-1):
+ handle = MockFile(self.lines)
+ return handle
+
+ def sendall(self, buffer, flags=None):
+ self.last = data
+ self.output.append(data)
+ return len(data)
+
+ def send(self, data, flags=None):
+ self.last = data
+ self.output.append(data)
+ return len(data)
+
+ def getpeername(self):
+ return 'peer'
+
+ def close(self):
+ pass
+
+
+def socket(family=None, type=None, proto=None):
+ return MockSocket()
+
+
+def create_connection(address, timeout=socket_module._GLOBAL_DEFAULT_TIMEOUT):
+ try:
+ int_port = int(address[1])
+ except ValueError:
+ raise error
+ ms = MockSocket()
+ if timeout is socket_module._GLOBAL_DEFAULT_TIMEOUT:
+ timeout = getdefaulttimeout()
+ ms.settimeout(timeout)
+ return ms
+
+
+def setdefaulttimeout(timeout):
+ global _defaulttimeout
+ _defaulttimeout = timeout
+
+
+def getdefaulttimeout():
+ return _defaulttimeout
+
+
+def getfqdn():
+ return ""
+
+
+def gethostname():
+ pass
+
+
+def gethostbyname(name):
+ return ""
+
+
+class gaierror(Exception):
+ pass
+
+
+class error(Exception):
+ pass
+
+
+# Constants
+AF_INET = None
+SOCK_STREAM = None
+SOL_SOCKET = None
+SO_REUSEADDR = None
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 06789cda91..a843486a42 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -30,6 +30,21 @@ def count_opcode(code, pickle):
n += 1
return n
+
+class UnseekableIO(io.BytesIO):
+ def peek(self, *args):
+ raise NotImplementedError
+
+ def seekable(self):
+ return False
+
+ def seek(self, *args):
+ raise io.UnsupportedOperation
+
+ def tell(self):
+ raise io.UnsupportedOperation
+
+
# We can't very well test the extension registry without putting known stuff
# in it, but we have to be careful to restore its original state. Code
# should do this:
@@ -841,8 +856,8 @@ class AbstractPickleTests(unittest.TestCase):
# Dump using protocol 1 for comparison.
s1 = self.dumps(x, 1)
- self.assertTrue(__name__.encode("utf-8") in s1)
- self.assertTrue(b"MyList" in s1)
+ self.assertIn(__name__.encode("utf-8"), s1)
+ self.assertIn(b"MyList", s1)
self.assertEqual(opcode_in_pickle(opcode, s1), False)
y = self.loads(s1)
@@ -851,8 +866,8 @@ class AbstractPickleTests(unittest.TestCase):
# Dump using protocol 2 for test.
s2 = self.dumps(x, 2)
- self.assertTrue(__name__.encode("utf-8") not in s2)
- self.assertTrue(b"MyList" not in s2)
+ self.assertNotIn(__name__.encode("utf-8"), s2)
+ self.assertNotIn(b"MyList", s2)
self.assertEqual(opcode_in_pickle(opcode, s2), True, repr(s2))
y = self.loads(s2)
@@ -903,7 +918,7 @@ class AbstractPickleTests(unittest.TestCase):
x = dict.fromkeys(range(n))
for proto in protocols:
s = self.dumps(x, proto)
- assert isinstance(s, bytes_types)
+ self.assertIsInstance(s, bytes_types)
y = self.loads(s)
self.assertEqual(x, y)
num_setitems = count_opcode(pickle.SETITEMS, s)
@@ -1068,6 +1083,20 @@ class AbstractPickleTests(unittest.TestCase):
dumped = self.dumps(set([3]), 2)
self.assertEqual(dumped, DATA6)
+ def test_large_pickles(self):
+ # Test the correctness of internal buffering routines when handling
+ # large data.
+ for proto in protocols:
+ data = (1, min, b'xy' * (30 * 1024), len)
+ dumped = self.dumps(data, proto)
+ loaded = self.loads(dumped)
+ self.assertEqual(len(loaded), len(data))
+ self.assertEqual(loaded, data)
+
+ def test_empty_bytestring(self):
+ # issue 11286
+ empty = self.loads(b'\x80\x03U\x00q\x00.', encoding='koi8-r')
+ self.assertEqual(empty, '')
# Test classes for reduce_ex
@@ -1112,9 +1141,6 @@ class REX_five(object):
class MyInt(int):
sample = 1
-class MyLong(int):
- sample = 1
-
class MyFloat(float):
sample = 1.0
@@ -1136,7 +1162,7 @@ class MyList(list):
class MyDict(dict):
sample = {"a": 1, "b": 2}
-myclasses = [MyInt, MyLong, MyFloat,
+myclasses = [MyInt, MyFloat,
MyComplex,
MyStr, MyUnicode,
MyTuple, MyList, MyDict]
@@ -1367,6 +1393,31 @@ class AbstractPicklerUnpicklerObjectTests(unittest.TestCase):
f.seek(0)
self.assertEqual(unpickler.load(), data2)
+ def _check_multiple_unpicklings(self, ioclass):
+ for proto in protocols:
+ data1 = [(x, str(x)) for x in range(2000)] + [b"abcde", len]
+ f = ioclass()
+ pickler = self.pickler_class(f, protocol=proto)
+ pickler.dump(data1)
+ pickled = f.getvalue()
+
+ N = 5
+ f = ioclass(pickled * N)
+ unpickler = self.unpickler_class(f)
+ for i in range(N):
+ if f.seekable():
+ pos = f.tell()
+ self.assertEqual(unpickler.load(), data1)
+ if f.seekable():
+ self.assertEqual(f.tell(), pos + len(pickled))
+ self.assertRaises(EOFError, unpickler.load)
+
+ def test_multiple_unpicklings_seekable(self):
+ self._check_multiple_unpicklings(io.BytesIO)
+
+ def test_multiple_unpicklings_unseekable(self):
+ self._check_multiple_unpicklings(UnseekableIO)
+
if __name__ == "__main__":
# Print some stuff that can be used to rewrite DATA{0,1,2}
diff --git a/Lib/test/pstats.pck b/Lib/test/pstats.pck
new file mode 100644
index 0000000000..c48ccb73a9
--- /dev/null
+++ b/Lib/test/pstats.pck
Binary files differ
diff --git a/Lib/test/pystone.py b/Lib/test/pystone.py
index 614551ff64..d7f1ec9b6c 100755
--- a/Lib/test/pystone.py
+++ b/Lib/test/pystone.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""
"PYSTONE" Benchmark Program
@@ -72,7 +72,7 @@ BoolGlob = FALSE
Char1Glob = '\0'
Char2Glob = '\0'
Array1Glob = [0]*51
-Array2Glob = list(map(lambda x: x[:], [Array1Glob]*51))
+Array2Glob = [x[:] for x in [Array1Glob]*51]
PtrGlb = None
PtrGlbNext = None
diff --git a/Lib/test/re_tests.py b/Lib/test/re_tests.py
index d314e200bb..5d16e3d183 100755
--- a/Lib/test/re_tests.py
+++ b/Lib/test/re_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- mode: python -*-
# Re test suite and benchmark suite v1.5
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 98d68bd1b4..e2e37652cc 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1,14 +1,21 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
-"""Regression test.
+"""
+Usage:
+
+python -m test [options] [test_name1 [test_name2 ...]]
+python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
+
+
+If no arguments or options are provided, finds all files matching
+the pattern "test_*" in the Lib/test subdirectory and runs
+them in alphabetical order (but see -M and -u, below, for exceptions).
+
+For more rigorous testing, it is useful to use the following
+command line:
-This will find all modules whose name is "test_*" in the test
-directory, and run them. Various command line options provide
-additional facilities.
+python -E -Wd -m test [options] [test_name1 ...]
-If non-option arguments are present, they are names for tests to run,
-unless -x is given, in which case they are names for tests not to run.
-If no test names are given, all tests are run.
Options:
@@ -18,6 +25,7 @@ Verbosity
-v/--verbose -- run tests in verbose mode with output to stdout
-w/--verbose2 -- re-run failed tests in verbose mode
+-W/--verbose3 -- re-run failed tests in verbose mode immediately
-d/--debug -- print traceback for failed tests
-q/--quiet -- no output unless one or more tests fail
-S/--slow -- print the slowest 10 tests
@@ -41,6 +49,8 @@ Special runs
-L/--runleaks -- run the leaks(1) command just before exit
-R/--huntrleaks RUNCOUNTS
-- search for reference leaks (needs debug build, v. slow)
+-j/--multiprocess PROCESSES
+ -- run PROCESSES processes at once
-T/--coverage -- turn on code coverage tracing using the trace module
-D/--coverdir DIRECTORY
-- Directory where coverage files are put
@@ -48,6 +58,7 @@ Special runs
-t/--threshold THRESHOLD
-- call gc.set_threshold(THRESHOLD)
-n/--nowindows -- suppress error message boxes on Windows
+-F/--forever -- run the specified tests in a loop, until an error happens
Additional Option Details:
@@ -56,19 +67,16 @@ Additional Option Details:
int seed value for the randomizer; this is useful for reproducing troublesome
test orders.
--T turns on code coverage tracing with the trace module.
-
--D specifies the directory where coverage files are put.
-
--N Put coverage files alongside modules.
-
--s means to run only a single test and exit. This is useful when
-doing memory analysis on the Python interpreter (which tend to consume
-too many resources to run the full regression test non-stop). The
-file /tmp/pynexttest is read to find the next test to run. If this
-file is missing, the first test_*.py file in testdir or on the command
-line is used. (actually tempfile.gettempdir() is used instead of
-/tmp).
+-s On the first invocation of regrtest using -s, the first test file found
+or the first test file given on the command line is run, and the name of
+the next test is recorded in a file named pynexttest. If run from the
+Python build directory, pynexttest is located in the 'build' subdirectory,
+otherwise it is located in tempfile.gettempdir(). On subsequent runs,
+the test in pynexttest is run, and the next test is written to pynexttest.
+When the last test has been run, pynexttest is deleted. In this way it
+is possible to single step through the test files. This is useful when
+doing memory analysis on the Python interpreter, which process tends to
+consume too many resources to run the full regression test non-stop.
-S is used to continue running tests after an aborted run. It will
maintain the order a standard run (ie, this assumes -r is not used).
@@ -145,36 +153,42 @@ example, to run all the tests except for the gui tests, give the
option '-uall,-gui'.
"""
+import builtins
import getopt
+import json
import os
import random
import re
import io
import sys
import time
-import platform
+import errno
import traceback
import warnings
import unittest
from inspect import isabstract
+import tempfile
+import platform
+import sysconfig
+import logging
+
+
+# Some times __path__ and __file__ are not absolute (e.g. while running from
+# Lib/) and, if we change the CWD to run the tests in a temporary dir, some
+# imports might fail. This affects only the modules imported before os.chdir().
+# These modules are searched first in sys.path[0] (so '' -- the CWD) and if
+# they are found in the CWD their __file__ and __path__ will be relative (this
+# happens before the chdir). All the modules imported after the chdir, are
+# not found in the CWD, and since the other paths in sys.path[1:] are absolute
+# (site.py absolutize them), the __file__ and __path__ will be absolute too.
+# Therefore it is necessary to absolutize manually the __file__ and __path__ of
+# the packages to prevent later imports to fail when the CWD is different.
+for module in sys.modules.values():
+ if hasattr(module, '__path__'):
+ module.__path__ = [os.path.abspath(path) for path in module.__path__]
+ if hasattr(module, '__file__'):
+ module.__file__ = os.path.abspath(module.__file__)
-# I see no other way to suppress these warnings;
-# putting them in test_grammar.py has no effect:
-warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning,
- ".*test.test_grammar$")
-if sys.maxsize > 0x7fffffff:
- # Also suppress them in <string>, because for 64-bit platforms,
- # that's where test_grammar.py hides them.
- warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning,
- "<string>")
-
-# Ignore ImportWarnings that only occur in the source tree,
-# (because of modules with the same name as source-directories in Modules/)
-for mod in ("ctypes", "gzip", "zipfile", "tarfile", "encodings.zlib_codec",
- "test.test_zipimport", "test.test_zlib", "test.test_zipfile",
- "test.test_codecs", "test.string_tests"):
- warnings.filterwarnings(module=".*%s$" % (mod,),
- action="ignore", category=ImportWarning)
# MacOSX (a.k.a. Darwin) has a default stack size that is too small
# for deeply recursive regular expressions. We see this as crashes in
@@ -192,11 +206,20 @@ if sys.platform == 'darwin':
newsoft = min(hard, max(soft, 1024*2048))
resource.setrlimit(resource.RLIMIT_STACK, (newsoft, hard))
+# Test result constants.
+PASSED = 1
+FAILED = 0
+ENV_CHANGED = -1
+SKIPPED = -2
+RESOURCE_DENIED = -3
+INTERRUPTED = -4
+
from test import support
RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network',
'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui')
+TEMPDIR = os.path.abspath(tempfile.gettempdir())
def usage(msg):
print(msg, file=sys.stderr)
@@ -204,11 +227,12 @@ def usage(msg):
sys.exit(2)
-def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
+def main(tests=None, testdir=None, verbose=0, quiet=False,
exclude=False, single=False, randomize=False, fromfile=None,
findleaks=False, use_resources=None, trace=False, coverdir='coverage',
runleaks=False, huntrleaks=False, verbose2=False, print_slow=False,
- random_seed=None, header=False):
+ random_seed=None, use_mp=None, verbose3=False, forever=False,
+ header=False):
"""Execute a test suite.
This also parses command-line options and modifies its behavior
@@ -225,7 +249,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
command-line will be used. If that's empty, too, then all *.py
files beginning with test_ will be used.
- The other default arguments (verbose, quiet, generate, exclude,
+ The other default arguments (verbose, quiet, exclude,
single, randomize, findleaks, use_resources, trace, coverdir,
print_slow, and random_seed) allow programmers calling main()
directly to set the values that would normally be set by flags
@@ -236,14 +260,13 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
support.record_original_stdout(sys.stdout)
try:
- opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:wM:n',
- ['help', 'verbose', 'quiet', 'exclude',
- 'single', 'slow', 'random', 'fromfile',
- 'findleaks', 'use=', 'threshold=', 'trace',
- 'coverdir=', 'nocoverdir', 'runleaks',
- 'huntrleaks=', 'verbose2', 'memlimit=',
- 'debug', 'start=', 'nowindows',
- 'randseed=', 'header'])
+ opts, args = getopt.getopt(sys.argv[1:], 'hvqxsSrf:lu:t:TD:NLR:FwWM:nj:',
+ ['help', 'verbose', 'verbose2', 'verbose3', 'quiet',
+ 'exclude', 'single', 'slow', 'random', 'fromfile', 'findleaks',
+ 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir',
+ 'runleaks', 'huntrleaks=', 'memlimit=', 'randseed=',
+ 'multiprocess=', 'coverage', 'slaveargs=', 'forever', 'debug',
+ 'start=', 'nowindows', 'header'])
except getopt.error as msg:
usage(msg)
@@ -264,6 +287,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
verbose2 = True
elif o in ('-d', '--debug'):
debug = True
+ elif o in ('-W', '--verbose3'):
+ verbose3 = True
elif o in ('-q', '--quiet'):
quiet = True;
verbose = 0
@@ -346,30 +371,39 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]:
msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE)
msvcrt.CrtSetReportFile(m, msvcrt.CRTDBG_FILE_STDERR)
+ elif o in ('-F', '--forever'):
+ forever = True
+ elif o in ('-j', '--multiprocess'):
+ use_mp = int(a)
elif o == '--header':
header = True
+ elif o == '--slaveargs':
+ args, kwargs = json.loads(a)
+ try:
+ result = runtest(*args, **kwargs)
+ except BaseException as e:
+ result = INTERRUPTED, e.__class__.__name__
+ sys.stdout.flush()
+ print() # Force a newline (just in case)
+ print(json.dumps(result))
+ sys.exit(0)
else:
print(("No handler for option {}. Please report this as a bug "
- "at http://bugs.python.org.").format(o), file=sys.stderr)
+ "at http://bugs.python.org.").format(o), file=sys.stderr)
sys.exit(1)
- if generate and verbose:
- usage("-g and -v don't go together!")
if single and fromfile:
usage("-s and -f don't go together!")
+ if use_mp and trace:
+ usage("-T and -j don't go together!")
+ if use_mp and findleaks:
+ usage("-l and -j don't go together!")
good = []
bad = []
skipped = []
resource_denieds = []
-
- # For a partial run, we do not need to clutter the output.
- if verbose or header or not (quiet or single or tests or args):
- # Print basic platform information
- print("==", platform.python_implementation(), *sys.version.split())
- print("== ", platform.platform(aliased=True),
- "%s-endian" % sys.byteorder)
- print("== ", os.getcwd())
- print("Testing with flags:", sys.flags)
+ environment_changed = []
+ interrupted = False
if findleaks:
try:
@@ -385,30 +419,29 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
found_garbage = []
if single:
- from tempfile import gettempdir
- filename = os.path.join(gettempdir(), 'pynexttest')
+ filename = os.path.join(TEMPDIR, 'pynexttest')
try:
fp = open(filename, 'r')
- next = fp.read().strip()
- tests = [next]
+ next_test = fp.read().strip()
+ tests = [next_test]
fp.close()
except IOError:
pass
if fromfile:
tests = []
- fp = open(fromfile)
+ fp = open(os.path.join(support.SAVEDCWD, fromfile))
+ count_pat = re.compile(r'\[\s*\d+/\s*\d+\]')
for line in fp:
+ line = count_pat.sub('', line)
guts = line.split() # assuming no test has whitespace in its name
if guts and not guts[0].startswith('#'):
tests.extend(guts)
fp.close()
# Strip .py extensions.
- if args:
- args = list(map(removepy, args))
- if tests:
- tests = list(map(removepy, tests))
+ removepy(args)
+ removepy(tests)
stdtests = STDTESTS[:]
nottests = NOTTESTS.copy()
@@ -418,9 +451,24 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
stdtests.remove(arg)
nottests.add(arg)
args = []
- tests = tests or args or findtests(testdir, stdtests, nottests)
+
+ # For a partial run, we do not need to clutter the output.
+ if verbose or header or not (quiet or single or tests or args):
+ # Print basic platform information
+ print("==", platform.python_implementation(), *sys.version.split())
+ print("== ", platform.platform(aliased=True),
+ "%s-endian" % sys.byteorder)
+ print("== ", os.getcwd())
+ print("Testing with flags:", sys.flags)
+
+ alltests = findtests(testdir, stdtests, nottests)
+ selected = tests or args or alltests
if single:
- tests = tests[:1]
+ selected = selected[:1]
+ try:
+ next_single_test = alltests[alltests.index(selected[0])+1]
+ except IndexError:
+ next_single_test = None
# Remove all the tests that precede start if it's set.
if start:
try:
@@ -430,73 +478,185 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
if randomize:
random.seed(random_seed)
print("Using random seed", random_seed)
- random.shuffle(tests)
+ random.shuffle(selected)
if trace:
import trace, tempfile
tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,
tempfile.gettempdir()],
trace=False, count=True)
+
test_times = []
support.verbose = verbose # Tell tests to be moderately quiet
support.use_resources = use_resources
save_modules = sys.modules.keys()
- for test in tests:
- if not quiet:
- print(test)
- sys.stdout.flush()
- if trace:
- # If we're tracing code coverage, then we don't exit with status
- # if on a false return value from main.
- tracer.runctx('runtest(test, generate, verbose, quiet,'
- ' test_times, testdir)',
- globals=globals(), locals=vars())
- else:
+
+ def accumulate_result(test, result):
+ ok, test_time = result
+ test_times.append((test_time, test))
+ if ok == PASSED:
+ good.append(test)
+ elif ok == FAILED:
+ bad.append(test)
+ elif ok == ENV_CHANGED:
+ bad.append(test)
+ environment_changed.append(test)
+ elif ok == SKIPPED:
+ skipped.append(test)
+ elif ok == RESOURCE_DENIED:
+ skipped.append(test)
+ resource_denieds.append(test)
+
+ if forever:
+ def test_forever(tests=list(selected)):
+ while True:
+ for test in tests:
+ yield test
+ if bad:
+ return
+ tests = test_forever()
+ test_count = ''
+ test_count_width = 3
+ else:
+ tests = iter(selected)
+ test_count = '/{}'.format(len(selected))
+ test_count_width = len(test_count) - 1
+
+ if use_mp:
+ try:
+ from threading import Thread
+ except ImportError:
+ print("Multiprocess option requires thread support")
+ sys.exit(2)
+ from queue import Queue
+ from subprocess import Popen, PIPE
+ debug_output_pat = re.compile(r"\[\d+ refs\]$")
+ output = Queue()
+ def tests_and_args():
+ for test in tests:
+ args_tuple = (
+ (test, verbose, quiet),
+ dict(huntrleaks=huntrleaks, use_resources=use_resources,
+ debug=debug, rerun_failed=verbose3)
+ )
+ yield (test, args_tuple)
+ pending = tests_and_args()
+ opt_args = support.args_from_interpreter_flags()
+ base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest']
+ def work():
+ # A worker thread.
try:
- ok = runtest(test, generate, verbose, quiet, test_times,
- testdir, huntrleaks)
- except KeyboardInterrupt:
- # print a newline separate from the ^C
- print()
- break
- except:
+ while True:
+ try:
+ test, args_tuple = next(pending)
+ except StopIteration:
+ output.put((None, None, None, None))
+ return
+ # -E is needed by some tests, e.g. test_import
+ popen = Popen(base_cmd + ['--slaveargs', json.dumps(args_tuple)],
+ stdout=PIPE, stderr=PIPE,
+ universal_newlines=True,
+ close_fds=(os.name != 'nt'))
+ stdout, stderr = popen.communicate()
+ # Strip last refcount output line if it exists, since it
+ # comes from the shutdown of the interpreter in the subcommand.
+ stderr = debug_output_pat.sub("", stderr)
+ stdout, _, result = stdout.strip().rpartition("\n")
+ if not result:
+ output.put((None, None, None, None))
+ return
+ result = json.loads(result)
+ output.put((test, stdout.rstrip(), stderr.rstrip(), result))
+ except BaseException:
+ output.put((None, None, None, None))
raise
- if ok > 0:
- good.append(test)
- elif ok == 0:
- bad.append(test)
+ workers = [Thread(target=work) for i in range(use_mp)]
+ for worker in workers:
+ worker.start()
+ finished = 0
+ test_index = 1
+ try:
+ while finished < use_mp:
+ test, stdout, stderr, result = output.get()
+ if test is None:
+ finished += 1
+ continue
+ if not quiet:
+ print("[{1:{0}}{2}] {3}".format(
+ test_count_width, test_index, test_count, test))
+ if stdout:
+ print(stdout)
+ if stderr:
+ print(stderr, file=sys.stderr)
+ if result[0] == INTERRUPTED:
+ assert result[1] == 'KeyboardInterrupt'
+ raise KeyboardInterrupt # What else?
+ accumulate_result(test, result)
+ test_index += 1
+ except KeyboardInterrupt:
+ interrupted = True
+ pending.close()
+ for worker in workers:
+ worker.join()
+ else:
+ for test_index, test in enumerate(tests, 1):
+ if not quiet:
+ print("[{1:{0}}{2}] {3}".format(
+ test_count_width, test_index, test_count, test))
+ sys.stdout.flush()
+ if trace:
+ # If we're tracing code coverage, then we don't exit with status
+ # if on a false return value from main.
+ tracer.runctx('runtest(test, verbose, quiet)',
+ globals=globals(), locals=vars())
else:
- skipped.append(test)
- if ok == -2:
- resource_denieds.append(test)
- if findleaks:
- gc.collect()
- if gc.garbage:
- print("Warning: test created", len(gc.garbage), end=' ')
- print("uncollectable object(s).")
- # move the uncollectable objects somewhere so we don't see
- # them again
- found_garbage.extend(gc.garbage)
- del gc.garbage[:]
- # Unload the newly imported modules (best effort finalization)
- for module in sys.modules.keys():
- if module not in save_modules and module.startswith("test."):
- support.unload(module)
-
+ try:
+ result = runtest(test, verbose, quiet, huntrleaks, debug,
+ rerun_failed=verbose3)
+ accumulate_result(test, result)
+ except KeyboardInterrupt:
+ interrupted = True
+ break
+ except:
+ raise
+ if findleaks:
+ gc.collect()
+ if gc.garbage:
+ print("Warning: test created", len(gc.garbage), end=' ')
+ print("uncollectable object(s).")
+ # move the uncollectable objects somewhere so we don't see
+ # them again
+ found_garbage.extend(gc.garbage)
+ del gc.garbage[:]
+ # Unload the newly imported modules (best effort finalization)
+ for module in sys.modules.keys():
+ if module not in save_modules and module.startswith("test."):
+ support.unload(module)
+
+ if interrupted:
+ # print a newline after ^C
+ print()
+ print("Test suite interrupted by signal SIGINT.")
+ omitted = set(selected) - set(good) - set(bad) - set(skipped)
+ print(count(len(omitted), "test"), "omitted:")
+ printlist(omitted)
if good and not quiet:
- if not bad and not skipped and len(good) > 1:
+ if not bad and not skipped and not interrupted and len(good) > 1:
print("All", end=' ')
print(count(len(good), "test"), "OK.")
- if verbose:
- print("CAUTION: stdout isn't compared in verbose mode:")
- print("a test that passes in verbose mode may fail without it.")
if print_slow:
test_times.sort(reverse=True)
print("10 slowest tests:")
for time, test in test_times[:10]:
print("%s: %.1fs" % (test, time))
if bad:
- print(count(len(bad), "test"), "failed:")
- printlist(bad)
+ bad = sorted(set(bad) - set(environment_changed))
+ if bad:
+ print(count(len(bad), "test"), "failed:")
+ printlist(bad)
+ if environment_changed:
+ print("{} altered the execution environment:".format(
+ count(len(environment_changed), "test")))
+ printlist(environment_changed)
if skipped and not quiet:
print(count(len(skipped), "test"), "skipped:")
printlist(skipped)
@@ -521,9 +681,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
print("Re-running test %r in verbose mode" % test)
sys.stdout.flush()
try:
- support.verbose = True
- ok = runtest(test, generate, True, quiet, test_times, testdir,
- huntrleaks, debug)
+ verbose = True
+ ok = runtest(test, True, quiet, huntrleaks, debug)
except KeyboardInterrupt:
# print a newline separate from the ^C
print()
@@ -532,16 +691,9 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
raise
if single:
- alltests = findtests(testdir, stdtests, nottests)
- for i in range(len(alltests)):
- if tests[0] == alltests[i]:
- if i == len(alltests) - 1:
- os.unlink(filename)
- else:
- fp = open(filename, 'w')
- fp.write(alltests[i+1] + '\n')
- fp.close()
- break
+ if next_single_test:
+ with open(filename, 'w') as fp:
+ fp.write(next_single_test + '\n')
else:
os.unlink(filename)
@@ -552,7 +704,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
if runleaks:
os.system("leaks %d" % os.getpid())
- sys.exit(len(bad) > 0)
+ sys.exit(len(bad) > 0 or interrupted)
STDTESTS = [
@@ -574,16 +726,15 @@ NOTTESTS = {
def findtests(testdir=None, stdtests=STDTESTS, nottests=NOTTESTS):
"""Return a list of all applicable test modules."""
- if not testdir: testdir = findtestdir()
+ testdir = findtestdir(testdir)
names = os.listdir(testdir)
tests = []
+ others = set(stdtests) | nottests
for name in names:
- if name[:5] == "test_" and name[-3:] == ".py":
- modname = name[:-3]
- if modname not in stdtests and modname not in nottests:
- tests.append(modname)
- tests.sort()
- return stdtests + tests
+ modname, ext = os.path.splitext(name)
+ if modname[:5] == "test_" and ext == ".py" and modname not in others:
+ tests.append(modname)
+ return stdtests + sorted(tests)
def replace_stdout():
"""Set stdout encoder error handler to backslashreplace (as stderr error
@@ -591,63 +742,237 @@ def replace_stdout():
if os.name == "nt":
# Replace sys.stdout breaks the stdout newlines on Windows: issue #8533
return
+
+ import atexit
+
stdout = sys.stdout
sys.stdout = open(stdout.fileno(), 'w',
encoding=stdout.encoding,
- errors="backslashreplace")
+ errors="backslashreplace",
+ closefd=False)
-def runtest(test, generate, verbose, quiet, test_times,
- testdir=None, huntrleaks=False, debug=False):
+ def restore_stdout():
+ sys.stdout.close()
+ sys.stdout = stdout
+ atexit.register(restore_stdout)
+
+def runtest(test, verbose, quiet,
+ huntrleaks=False, debug=False, use_resources=None,
+ rerun_failed=False):
"""Run a single test.
test -- the name of the test
verbose -- if true, print more messages
quiet -- if true, don't print 'skipped' messages (probably redundant)
test_times -- a list of (time, test_name) pairs
- testdir -- test directory
huntrleaks -- run multiple times to test for leaks; requires a debug
build; a triple corresponding to -R's three arguments
- debug -- if true, print tracebacks for failed tests regardless of
- verbose setting
- Return:
- -2 test skipped because resource denied
- -1 test skipped for some other reason
- 0 test failed
- 1 test passed
+ rerun_failed -- if true, re-run in verbose mode when failed
+
+ Returns one of the test result constants:
+ INTERRUPTED KeyboardInterrupt when run under -j
+ RESOURCE_DENIED test skipped because resource denied
+ SKIPPED test skipped for some other reason
+ ENV_CHANGED test failed because it changed the execution environment
+ FAILED test failed
+ PASSED test passed
"""
+ support.verbose = verbose # Tell tests to be moderately quiet
+ if use_resources is not None:
+ support.use_resources = use_resources
try:
- return runtest_inner(test, generate, verbose, quiet, test_times,
- testdir, huntrleaks)
+ result = runtest_inner(test, verbose, quiet, huntrleaks, debug)
+ if result[0] == FAILED and rerun_failed:
+ cleanup_test_droppings(test, verbose)
+ sys.stdout.flush()
+ sys.stderr.flush()
+ print("Re-running test {} in verbose mode".format(test))
+ runtest(test, True, quiet, huntrleaks, debug)
+ return result
finally:
cleanup_test_droppings(test, verbose)
-def runtest_inner(test, generate, verbose, quiet, test_times,
- testdir=None, huntrleaks=False, debug=False):
+# Unit tests are supposed to leave the execution environment unchanged
+# once they complete. But sometimes tests have bugs, especially when
+# tests fail, and the changes to environment go on to mess up other
+# tests. This can cause issues with buildbot stability, since tests
+# are run in random order and so problems may appear to come and go.
+# There are a few things we can save and restore to mitigate this, and
+# the following context manager handles this task.
+
+class saved_test_environment:
+ """Save bits of the test environment and restore them at block exit.
+
+ with saved_test_environment(testname, verbose, quiet):
+ #stuff
+
+ Unless quiet is True, a warning is printed to stderr if any of
+ the saved items was changed by the test. The attribute 'changed'
+ is initially False, but is set to True if a change is detected.
+
+ If verbose is more than 1, the before and after state of changed
+ items is also printed.
+ """
+
+ changed = False
+
+ def __init__(self, testname, verbose=0, quiet=False):
+ self.testname = testname
+ self.verbose = verbose
+ self.quiet = quiet
+
+ # To add things to save and restore, add a name XXX to the resources list
+ # and add corresponding get_XXX/restore_XXX functions. get_XXX should
+ # return the value to be saved and compared against a second call to the
+ # get function when test execution completes. restore_XXX should accept
+ # the saved value and restore the resource using it. It will be called if
+ # and only if a change in the value is detected.
+ #
+ # Note: XXX will have any '.' replaced with '_' characters when determining
+ # the corresponding method names.
+
+ resources = ('sys.argv', 'cwd', 'sys.stdin', 'sys.stdout', 'sys.stderr',
+ 'os.environ', 'sys.path', 'sys.path_hooks', '__import__',
+ 'warnings.filters', 'asyncore.socket_map',
+ 'logging._handlers', 'logging._handlerList',
+ 'sys.warnoptions')
+
+ def get_sys_argv(self):
+ return id(sys.argv), sys.argv, sys.argv[:]
+ def restore_sys_argv(self, saved_argv):
+ sys.argv = saved_argv[1]
+ sys.argv[:] = saved_argv[2]
+
+ def get_cwd(self):
+ return os.getcwd()
+ def restore_cwd(self, saved_cwd):
+ os.chdir(saved_cwd)
+
+ def get_sys_stdout(self):
+ return sys.stdout
+ def restore_sys_stdout(self, saved_stdout):
+ sys.stdout = saved_stdout
+
+ def get_sys_stderr(self):
+ return sys.stderr
+ def restore_sys_stderr(self, saved_stderr):
+ sys.stderr = saved_stderr
+
+ def get_sys_stdin(self):
+ return sys.stdin
+ def restore_sys_stdin(self, saved_stdin):
+ sys.stdin = saved_stdin
+
+ def get_os_environ(self):
+ return id(os.environ), os.environ, dict(os.environ)
+ def restore_os_environ(self, saved_environ):
+ os.environ = saved_environ[1]
+ os.environ.clear()
+ os.environ.update(saved_environ[2])
+
+ def get_sys_path(self):
+ return id(sys.path), sys.path, sys.path[:]
+ def restore_sys_path(self, saved_path):
+ sys.path = saved_path[1]
+ sys.path[:] = saved_path[2]
+
+ def get_sys_path_hooks(self):
+ return id(sys.path_hooks), sys.path_hooks, sys.path_hooks[:]
+ def restore_sys_path_hooks(self, saved_hooks):
+ sys.path_hooks = saved_hooks[1]
+ sys.path_hooks[:] = saved_hooks[2]
+
+ def get___import__(self):
+ return builtins.__import__
+ def restore___import__(self, import_):
+ builtins.__import__ = import_
+
+ def get_warnings_filters(self):
+ return id(warnings.filters), warnings.filters, warnings.filters[:]
+ def restore_warnings_filters(self, saved_filters):
+ warnings.filters = saved_filters[1]
+ warnings.filters[:] = saved_filters[2]
+
+ def get_asyncore_socket_map(self):
+ asyncore = sys.modules.get('asyncore')
+ # XXX Making a copy keeps objects alive until __exit__ gets called.
+ return asyncore and asyncore.socket_map.copy() or {}
+ def restore_asyncore_socket_map(self, saved_map):
+ asyncore = sys.modules.get('asyncore')
+ if asyncore is not None:
+ asyncore.close_all(ignore_all=True)
+ asyncore.socket_map.update(saved_map)
+
+ def get_logging__handlers(self):
+ # _handlers is a WeakValueDictionary
+ return id(logging._handlers), logging._handlers, logging._handlers.copy()
+ def restore_logging__handlers(self, saved_handlers):
+ # Can't easily revert the logging state
+ pass
+
+ def get_logging__handlerList(self):
+ # _handlerList is a list of weakrefs to handlers
+ return id(logging._handlerList), logging._handlerList, logging._handlerList[:]
+ def restore_logging__handlerList(self, saved_handlerList):
+ # Can't easily revert the logging state
+ pass
+
+ def get_sys_warnoptions(self):
+ return id(sys.warnoptions), sys.warnoptions, sys.warnoptions[:]
+ def restore_sys_warnoptions(self, saved_options):
+ sys.warnoptions = saved_options[1]
+ sys.warnoptions[:] = saved_options[2]
+
+ def resource_info(self):
+ for name in self.resources:
+ method_suffix = name.replace('.', '_')
+ get_name = 'get_' + method_suffix
+ restore_name = 'restore_' + method_suffix
+ yield name, getattr(self, get_name), getattr(self, restore_name)
+
+ def __enter__(self):
+ self.saved_values = dict((name, get()) for name, get, restore
+ in self.resource_info())
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ saved_values = self.saved_values
+ del self.saved_values
+ for name, get, restore in self.resource_info():
+ current = get()
+ original = saved_values.pop(name)
+ # Check for changes to the resource's value
+ if current != original:
+ self.changed = True
+ restore(original)
+ if not self.quiet:
+ print("Warning -- {} was modified by {}".format(
+ name, self.testname),
+ file=sys.stderr)
+ if self.verbose > 1:
+ print(" Before: {}\n After: {} ".format(
+ original, current),
+ file=sys.stderr)
+ return False
+
+
+def runtest_inner(test, verbose, quiet, huntrleaks=False, debug=False):
support.unload(test)
- if not testdir:
- testdir = findtestdir()
if verbose:
- cfp = None
+ capture_stdout = None
else:
- cfp = io.StringIO() # XXX Should use io.StringIO()
+ capture_stdout = io.StringIO()
+ test_time = 0.0
refleak = False # True if the test leaked references.
try:
- save_stdout = sys.stdout
- # Save various things that tests may mess up so we can restore
- # them afterward.
- save_environ = dict(os.environ)
- save_argv = sys.argv[:]
- try:
- if cfp:
- sys.stdout = cfp
- print(test) # Output file starts with test name
- if test.startswith('test.'):
- abstest = test
- else:
- # Always import it from the test package
- abstest = 'test.' + test
+ if test.startswith('test.'):
+ abstest = test
+ else:
+ # Always import it from the test package
+ abstest = 'test.' + test
+ with saved_test_environment(test, verbose, quiet) as environment:
start_time = time.time()
the_package = __import__(abstest, globals(), locals(), [])
the_module = getattr(the_package, test)
@@ -658,60 +983,36 @@ def runtest_inner(test, generate, verbose, quiet, test_times,
if indirect_test is not None:
indirect_test()
if huntrleaks:
- refleak = dash_R(the_module, test, indirect_test, huntrleaks)
+ refleak = dash_R(the_module, test, indirect_test,
+ huntrleaks)
test_time = time.time() - start_time
- test_times.append((test_time, test))
- finally:
- sys.stdout = save_stdout
- # Restore what we saved if needed, but also complain if the test
- # changed it so that the test may eventually get fixed.
- if not os.environ == save_environ:
- if not quiet:
- print("Warning: os.environ was modified by", test)
- os.environ.clear()
- os.environ.update(save_environ)
- if not sys.argv == save_argv:
- if not quiet:
- print("Warning: argv was modified by", test)
- sys.argv[:] = save_argv
except support.ResourceDenied as msg:
if not quiet:
print(test, "skipped --", msg)
sys.stdout.flush()
- return -2
+ return RESOURCE_DENIED, test_time
except unittest.SkipTest as msg:
if not quiet:
print(test, "skipped --", msg)
sys.stdout.flush()
- return -1
+ return SKIPPED, test_time
except KeyboardInterrupt:
raise
except support.TestFailed as msg:
print("test", test, "failed --", msg, file=sys.stderr)
sys.stderr.flush()
- return 0
+ return FAILED, test_time
except:
- type, value = sys.exc_info()[:2]
- print("test", test, "crashed --", str(type) + ":", value, file=sys.stderr)
+ msg = traceback.format_exc()
+ print("test", test, "crashed --", msg, file=sys.stderr)
sys.stderr.flush()
- if verbose or debug:
- traceback.print_exc(file=sys.stderr)
- sys.stderr.flush()
- return 0
+ return FAILED, test_time
else:
if refleak:
- return 0
- if not cfp:
- return 1
- output = cfp.getvalue()
- expected = test + "\n"
- if output == expected or huntrleaks:
- return 1
- print("test", test, "produced unexpected output:")
- sys.stdout.flush()
- reportdiff(expected, output)
- sys.stdout.flush()
- return 0
+ return FAILED, test_time
+ if environment.changed:
+ return ENV_CHANGED, test_time
+ return PASSED, test_time
def cleanup_test_droppings(testname, verbose):
import shutil
@@ -719,6 +1020,8 @@ def cleanup_test_droppings(testname, verbose):
import gc
# First kill any dangling references to open files etc.
+ # This can also issue some ResourceWarnings which would otherwise get
+ # triggered during the following test run, and possibly produce failures.
gc.collect()
# Try to clean up junk commonly left behind. While tests shouldn't leave
@@ -770,6 +1073,12 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
fs = warnings.filters[:]
ps = copyreg.dispatch_table.copy()
pic = sys.path_importer_cache.copy()
+ try:
+ import zipimport
+ except ImportError:
+ zdc = None # Run unmodified on platforms without zipimport support
+ else:
+ zdc = zipimport._zip_directory_cache.copy()
abcs = {}
for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]:
if not isabstract(abc):
@@ -787,29 +1096,33 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
deltas = []
nwarmup, ntracked, fname = huntrleaks
+ fname = os.path.join(support.SAVEDCWD, fname)
repcount = nwarmup + ntracked
print("beginning", repcount, "repetitions", file=sys.stderr)
print(("1234567890"*(repcount//10 + 1))[:repcount], file=sys.stderr)
- dash_R_cleanup(fs, ps, pic, abcs)
+ sys.stderr.flush()
+ dash_R_cleanup(fs, ps, pic, zdc, abcs)
for i in range(repcount):
- rc = sys.gettotalrefcount()
+ rc_before = sys.gettotalrefcount()
run_the_test()
sys.stderr.write('.')
sys.stderr.flush()
- dash_R_cleanup(fs, ps, pic, abcs)
+ dash_R_cleanup(fs, ps, pic, zdc, abcs)
+ rc_after = sys.gettotalrefcount()
if i >= nwarmup:
- deltas.append(sys.gettotalrefcount() - rc - 2)
+ deltas.append(rc_after - rc_before)
print(file=sys.stderr)
if any(deltas):
msg = '%s leaked %s references, sum=%s' % (test, deltas, sum(deltas))
print(msg, file=sys.stderr)
- refrep = open(fname, "a")
- print(msg, file=refrep)
- refrep.close()
+ sys.stderr.flush()
+ with open(fname, "a") as refrep:
+ print(msg, file=refrep)
+ refrep.flush()
return True
return False
-def dash_R_cleanup(fs, ps, pic, abcs):
+def dash_R_cleanup(fs, ps, pic, zdc, abcs):
import gc, copyreg
import _strptime, linecache
import urllib.parse, urllib.request, mimetypes, doctest
@@ -828,6 +1141,13 @@ def dash_R_cleanup(fs, ps, pic, abcs):
copyreg.dispatch_table.update(ps)
sys.path_importer_cache.clear()
sys.path_importer_cache.update(pic)
+ try:
+ import zipimport
+ except ImportError:
+ pass # Run unmodified on platforms without zipimport support
+ else:
+ zipimport._zip_directory_cache.clear()
+ zipimport._zip_directory_cache.update(zdc)
# clear type cache
sys._clear_type_cache()
@@ -841,6 +1161,12 @@ def dash_R_cleanup(fs, ps, pic, abcs):
obj._abc_cache.clear()
obj._abc_negative_cache.clear()
+ # Flush standard output, so that buffered data is sent to the OS and
+ # associated Python objects are reclaimed.
+ for stream in (sys.stdout, sys.stderr, sys.__stdout__, sys.__stderr__):
+ if stream is not None:
+ stream.flush()
+
# Clear assorted module caches.
_path_created.clear()
re.purge()
@@ -861,60 +1187,16 @@ def warm_char_cache():
for i in range(256):
s[i:i+1]
-def reportdiff(expected, output):
- import difflib
- print("*" * 70)
- a = expected.splitlines(1)
- b = output.splitlines(1)
- sm = difflib.SequenceMatcher(a=a, b=b)
- tuples = sm.get_opcodes()
-
- def pair(x0, x1):
- # x0:x1 are 0-based slice indices; convert to 1-based line indices.
- x0 += 1
- if x0 >= x1:
- return "line " + str(x0)
- else:
- return "lines %d-%d" % (x0, x1)
-
- for op, a0, a1, b0, b1 in tuples:
- if op == 'equal':
- pass
-
- elif op == 'delete':
- print("***", pair(a0, a1), "of expected output missing:")
- for line in a[a0:a1]:
- print("-", line, end='')
-
- elif op == 'replace':
- print("*** mismatch between", pair(a0, a1), "of expected", \
- "output and", pair(b0, b1), "of actual output:")
- for line in difflib.ndiff(a[a0:a1], b[b0:b1]):
- print(line, end='')
+def findtestdir(path=None):
+ return path or os.path.dirname(__file__) or os.curdir
- elif op == 'insert':
- print("***", pair(b0, b1), "of actual output doesn't appear", \
- "in expected output after line", str(a1)+":")
- for line in b[b0:b1]:
- print("+", line, end='')
-
- else:
- print("get_opcodes() returned bad tuple?!?!", (op, a0, a1, b0, b1))
-
- print("*" * 70)
-
-def findtestdir():
- if __name__ == '__main__':
- file = sys.argv[0]
- else:
- file = __file__
- testdir = os.path.dirname(file) or os.curdir
- return testdir
-
-def removepy(name):
- if name.endswith(".py"):
- name = name[:-3]
- return name
+def removepy(names):
+ if not names:
+ return
+ for idx, name in enumerate(names):
+ basename, ext = os.path.splitext(name)
+ if ext == '.py':
+ names[idx] = basename
def count(n, word):
if n == 1:
@@ -987,34 +1269,6 @@ _expectations = {
test_kqueue
test_ossaudiodev
""",
- 'mac':
- """
- test_atexit
- test_bz2
- test_crypt
- test_curses
- test_dbm
- test_fcntl
- test_fork1
- test_epoll
- test_grp
- test_ioctl
- test_largefile
- test_locale
- test_kqueue
- test_mmap
- test_openpty
- test_ossaudiodev
- test_poll
- test_popen
- test_posix
- test_pty
- test_pwd
- test_resource
- test_signal
- test_sundry
- test_tarfile
- """,
'unixware7':
"""
test_epoll
@@ -1063,6 +1317,7 @@ _expectations = {
test_curses
test_epoll
test_dbm_gnu
+ test_gdb
test_largefile
test_locale
test_minidom
@@ -1097,19 +1352,6 @@ _expectations = {
test_zipfile
test_zlib
""",
- 'atheos':
- """
- test_curses
- test_dbm_gnu
- test_epoll
- test_largefile
- test_locale
- test_kqueue
- test_mhlib
- test_mmap
- test_poll
- test_resource
- """,
'cygwin':
"""
test_curses
@@ -1237,15 +1479,17 @@ class _ExpectedSkips:
if sys.platform != "win32":
# test_sqlite is only reliable on Windows where the library
# is distributed with Python
- WIN_ONLY = ["test_unicode_file", "test_winreg",
+ WIN_ONLY = {"test_unicode_file", "test_winreg",
"test_winsound", "test_startfile",
- "test_sqlite", "test_msilib"]
- for skip in WIN_ONLY:
- self.expected.add(skip)
+ "test_sqlite", "test_msilib"}
+ self.expected |= WIN_ONLY
if sys.platform != 'sunos5':
self.expected.add('test_nis')
+ if support.python_is_optimized():
+ self.expected.add("test_gdb")
+
self.valid = True
def isvalid(self):
@@ -1261,17 +1505,54 @@ class _ExpectedSkips:
assert self.isvalid()
return self.expected
+def _make_temp_dir_for_build(TEMPDIR):
+ # When tests are run from the Python build directory, it is best practice
+ # to keep the test files in a subfolder. It eases the cleanup of leftover
+ # files using command "make distclean".
+ if sysconfig.is_python_build():
+ TEMPDIR = os.path.join(sysconfig.get_config_var('srcdir'), 'build')
+ TEMPDIR = os.path.abspath(TEMPDIR)
+ try:
+ os.mkdir(TEMPDIR)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise
+
+ # Define a writable temp dir that will be used as cwd while running
+ # the tests. The name of the dir includes the pid to allow parallel
+ # testing (see the -j option).
+ TESTCWD = 'test_python_{}'.format(os.getpid())
+
+ TESTCWD = os.path.join(TEMPDIR, TESTCWD)
+ return TEMPDIR, TESTCWD
+
if __name__ == '__main__':
- # Remove regrtest.py's own directory from the module search path. This
- # prevents relative imports from working, and relative imports will screw
- # up the testing framework. E.g. if both test.support and
- # support are imported, they will not contain the same globals, and
- # much of the testing framework relies on the globals in the
- # test.support module.
+ # Remove regrtest.py's own directory from the module search path. Despite
+ # the elimination of implicit relative imports, this is still needed to
+ # ensure that submodules of the test package do not inappropriately appear
+ # as top-level modules even when people (or buildbots!) invoke regrtest.py
+ # directly instead of using the -m switch
mydir = os.path.abspath(os.path.normpath(os.path.dirname(sys.argv[0])))
i = len(sys.path)
while i >= 0:
i -= 1
if os.path.abspath(os.path.normpath(sys.path[i])) == mydir:
del sys.path[i]
- main()
+
+ # findtestdir() gets the dirname out of __file__, so we have to make it
+ # absolute before changing the working directory.
+ # For example __file__ may be relative when running trace or profile.
+ # See issue #9323.
+ __file__ = os.path.abspath(__file__)
+
+ # sanity check
+ assert __file__ == os.path.abspath(sys.argv[0])
+
+ TEMPDIR, TESTCWD = _make_temp_dir_for_build(TEMPDIR)
+
+ # Run the tests in a context manager that temporary changes the CWD to a
+ # temporary and writable directory. If it's not possible to create or
+ # change the CWD, the original CWD will be used. The original CWD is
+ # available from support.SAVEDCWD.
+ with support.temp_cwd(TESTCWD, quiet=True):
+ main()
diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py
index 0699cf61a2..371c33d138 100644
--- a/Lib/test/script_helper.py
+++ b/Lib/test/script_helper.py
@@ -12,7 +12,8 @@ import contextlib
import shutil
import zipfile
-from test.support import strip_python_stderr
+from imp import source_from_cache
+from test.support import make_legacy_pyc, strip_python_stderr
# Executing the interpreter in a subprocess
def _assert_python(expected_success, *args, **env_vars):
@@ -90,6 +91,27 @@ def make_script(script_dir, script_basename, source):
script_file.close()
return script_name
+def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None):
+ zip_filename = zip_basename+os.extsep+'zip'
+ zip_name = os.path.join(zip_dir, zip_filename)
+ zip_file = zipfile.ZipFile(zip_name, 'w')
+ if name_in_zip is None:
+ parts = script_name.split(os.sep)
+ if len(parts) >= 2 and parts[-2] == '__pycache__':
+ legacy_pyc = make_legacy_pyc(source_from_cache(script_name))
+ name_in_zip = os.path.basename(legacy_pyc)
+ script_name = legacy_pyc
+ else:
+ name_in_zip = os.path.basename(script_name)
+ zip_file.write(script_name, name_in_zip)
+ zip_file.close()
+ #if test.support.verbose:
+ # zip_file = zipfile.ZipFile(zip_name, 'r')
+ # print 'Contents of %r:' % zip_name
+ # zip_file.printdir()
+ # zip_file.close()
+ return zip_name, os.path.join(zip_name, name_in_zip)
+
def make_pkg(pkg_dir, init_source=''):
os.mkdir(pkg_dir)
make_script(pkg_dir, '__init__', init_source)
diff --git a/Lib/test/ssl_cert.pem b/Lib/test/ssl_cert.pem
index 9d7ac238d8..47a7d7e37e 100644
--- a/Lib/test/ssl_cert.pem
+++ b/Lib/test/ssl_cert.pem
@@ -1,14 +1,15 @@
-----BEGIN CERTIFICATE-----
-MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
-VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
-bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
-dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
-DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
-EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
-dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
-EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
-MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
-L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
-BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
-9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
+MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u
+IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw
+MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH
+Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k
+YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7
+6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt
+pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw
+FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd
+BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G
+lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1
+CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX
-----END CERTIFICATE-----
diff --git a/Lib/test/ssl_key.pem b/Lib/test/ssl_key.pem
index 239ad66f99..3fd3bbd54a 100644
--- a/Lib/test/ssl_key.pem
+++ b/Lib/test/ssl_key.pem
@@ -1,9 +1,16 @@
------BEGIN RSA PRIVATE KEY-----
-MIIBPAIBAAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNwL4lYKbpzzlmC5beaQXeQ
-2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAAQJBALjkK+jc2+iihI98riEF
-oudmkNziSRTYjnwjx8mCoAjPWviB3c742eO3FG4/soi1jD9A5alihEOXfUzloenr
-8IECIQD3B5+0l+68BA/6d76iUNqAAV8djGTzvxnCxycnxPQydQIhAMXt4trUI3nc
-a+U8YL2HPFA3gmhBsSICbq2OptOCnM7hAiEA6Xi3JIQECob8YwkRj29DU3/4WYD7
-WLPgsQpwo1GuSpECICGsnWH5oaeD9t9jbFoSfhJvv0IZmxdcLpRcpslpeWBBAiEA
-6/5B8J0GHdJq89FHwEG/H2eVVUYu5y/aD6sgcm+0Avg=
------END RSA PRIVATE KEY-----
+-----BEGIN PRIVATE KEY-----
+MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm
+LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0
+ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP
+USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt
+CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq
+SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK
+UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y
+BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ
+ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5
+oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik
+eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F
+0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS
+x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/
+SPIXQuT8RMPDVNQ=
+-----END PRIVATE KEY-----
diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py
new file mode 100644
index 0000000000..77c0542610
--- /dev/null
+++ b/Lib/test/ssl_servers.py
@@ -0,0 +1,189 @@
+import os
+import sys
+import ssl
+import pprint
+import socket
+import urllib.parse
+# Rename HTTPServer to _HTTPServer so as to avoid confusion with HTTPSServer.
+from http.server import (HTTPServer as _HTTPServer,
+ SimpleHTTPRequestHandler, BaseHTTPRequestHandler)
+
+from test import support
+threading = support.import_module("threading")
+
+here = os.path.dirname(__file__)
+
+HOST = support.HOST
+CERTFILE = os.path.join(here, 'keycert.pem')
+
+# This one's based on HTTPServer, which is based on SocketServer
+
+class HTTPSServer(_HTTPServer):
+
+ def __init__(self, server_address, handler_class, context):
+ _HTTPServer.__init__(self, server_address, handler_class)
+ self.context = context
+
+ def __str__(self):
+ return ('<%s %s:%s>' %
+ (self.__class__.__name__,
+ self.server_name,
+ self.server_port))
+
+ def get_request(self):
+ # override this to wrap socket with SSL
+ try:
+ sock, addr = self.socket.accept()
+ sslconn = self.context.wrap_socket(sock, server_side=True)
+ except socket.error as e:
+ # socket errors are silenced by the caller, print them here
+ if support.verbose:
+ sys.stderr.write("Got an error:\n%s\n" % e)
+ raise
+ return sslconn, addr
+
+class RootedHTTPRequestHandler(SimpleHTTPRequestHandler):
+ # need to override translate_path to get a known root,
+ # instead of using os.curdir, since the test could be
+ # run from anywhere
+
+ server_version = "TestHTTPS/1.0"
+ root = here
+ # Avoid hanging when a request gets interrupted by the client
+ timeout = 5
+
+ def translate_path(self, path):
+ """Translate a /-separated PATH to the local filename syntax.
+
+ Components that mean special things to the local file system
+ (e.g. drive or directory names) are ignored. (XXX They should
+ probably be diagnosed.)
+
+ """
+ # abandon query parameters
+ path = urllib.parse.urlparse(path)[2]
+ path = os.path.normpath(urllib.parse.unquote(path))
+ words = path.split('/')
+ words = filter(None, words)
+ path = self.root
+ for word in words:
+ drive, word = os.path.splitdrive(word)
+ head, word = os.path.split(word)
+ path = os.path.join(path, word)
+ return path
+
+ def log_message(self, format, *args):
+ # we override this to suppress logging unless "verbose"
+ if support.verbose:
+ sys.stdout.write(" server (%s:%d %s):\n [%s] %s\n" %
+ (self.server.server_address,
+ self.server.server_port,
+ self.request.cipher(),
+ self.log_date_time_string(),
+ format%args))
+
+
+class StatsRequestHandler(BaseHTTPRequestHandler):
+ """Example HTTP request handler which returns SSL statistics on GET
+ requests.
+ """
+
+ server_version = "StatsHTTPS/1.0"
+
+ def do_GET(self, send_body=True):
+ """Serve a GET request."""
+ sock = self.rfile.raw._sock
+ context = sock.context
+ body = pprint.pformat(context.session_stats())
+ body = body.encode('utf-8')
+ self.send_response(200)
+ self.send_header("Content-type", "text/plain; charset=utf-8")
+ self.send_header("Content-Length", str(len(body)))
+ self.end_headers()
+ if send_body:
+ self.wfile.write(body)
+
+ def do_HEAD(self):
+ """Serve a HEAD request."""
+ self.do_GET(send_body=False)
+
+ def log_request(self, format, *args):
+ if support.verbose:
+ BaseHTTPRequestHandler.log_request(self, format, *args)
+
+
+class HTTPSServerThread(threading.Thread):
+
+ def __init__(self, context, host=HOST, handler_class=None):
+ self.flag = None
+ self.server = HTTPSServer((host, 0),
+ handler_class or RootedHTTPRequestHandler,
+ context)
+ self.port = self.server.server_port
+ threading.Thread.__init__(self)
+ self.daemon = True
+
+ def __str__(self):
+ return "<%s %s>" % (self.__class__.__name__, self.server)
+
+ def start(self, flag=None):
+ self.flag = flag
+ threading.Thread.start(self)
+
+ def run(self):
+ if self.flag:
+ self.flag.set()
+ try:
+ self.server.serve_forever(0.05)
+ finally:
+ self.server.server_close()
+
+ def stop(self):
+ self.server.shutdown()
+
+
+def make_https_server(case, certfile=CERTFILE, host=HOST, handler_class=None):
+ # we assume the certfile contains both private key and certificate
+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ context.load_cert_chain(certfile)
+ server = HTTPSServerThread(context, host, handler_class)
+ flag = threading.Event()
+ server.start(flag)
+ flag.wait()
+ def cleanup():
+ if support.verbose:
+ sys.stdout.write('stopping HTTPS server\n')
+ server.stop()
+ if support.verbose:
+ sys.stdout.write('joining HTTPS thread\n')
+ server.join()
+ case.addCleanup(cleanup)
+ return server
+
+
+if __name__ == "__main__":
+ import argparse
+ parser = argparse.ArgumentParser(
+ description='Run a test HTTPS server. '
+ 'By default, the current directory is served.')
+ parser.add_argument('-p', '--port', type=int, default=4433,
+ help='port to listen on (default: %(default)s)')
+ parser.add_argument('-q', '--quiet', dest='verbose', default=True,
+ action='store_false', help='be less verbose')
+ parser.add_argument('-s', '--stats', dest='use_stats_handler', default=False,
+ action='store_true', help='always return stats page')
+ args = parser.parse_args()
+
+ support.verbose = args.verbose
+ if args.use_stats_handler:
+ handler_class = StatsRequestHandler
+ else:
+ handler_class = RootedHTTPRequestHandler
+ handler_class.root = os.getcwd()
+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ context.load_cert_chain(CERTFILE)
+
+ server = HTTPSServer(("", args.port), handler_class, context)
+ if args.verbose:
+ print("Listening on https://localhost:{0.port}".format(args))
+ server.serve_forever(0.1)
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index 09622dd486..fca38c3ea0 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -172,6 +172,9 @@ class BaseTest(unittest.TestCase):
self.checkequal(-1, '', 'find', 'xx', 1, 1)
self.checkequal(-1, '', 'find', 'xx', sys.maxsize, 0)
+ # issue 7458
+ self.checkequal(-1, 'ab', 'find', 'xxx', sys.maxsize + 1, 0)
+
# For a variety of combinations,
# verify that str.find() matches __contains__
# and that the found substring is really at that location
@@ -191,8 +194,7 @@ class BaseTest(unittest.TestCase):
loc = i.find(j)
r1 = (loc != -1)
r2 = j in i
- if r1 != r2:
- self.assertEqual(r1, r2)
+ self.assertEqual(r1, r2)
if loc != -1:
self.assertEqual(i[loc:loc+len(j)], j)
@@ -216,6 +218,32 @@ class BaseTest(unittest.TestCase):
self.checkraises(TypeError, 'hello', 'rfind')
self.checkraises(TypeError, 'hello', 'rfind', 42)
+ # For a variety of combinations,
+ # verify that str.rfind() matches __contains__
+ # and that the found substring is really at that location
+ charset = ['', 'a', 'b', 'c']
+ digits = 5
+ base = len(charset)
+ teststrings = set()
+ for i in range(base ** digits):
+ entry = []
+ for j in range(digits):
+ i, m = divmod(i, base)
+ entry.append(charset[m])
+ teststrings.add(''.join(entry))
+ teststrings = [self.fixtype(ts) for ts in teststrings]
+ for i in teststrings:
+ for j in teststrings:
+ loc = i.rfind(j)
+ r1 = (loc != -1)
+ r2 = j in i
+ self.assertEqual(r1, r2)
+ if loc != -1:
+ self.assertEqual(i[loc:loc+len(j)], j)
+
+ # issue 7458
+ self.checkequal(-1, 'ab', 'rfind', 'xxx', sys.maxsize + 1, 0)
+
def test_index(self):
self.checkequal(0, 'abcdefghiabc', 'index', '')
self.checkequal(3, 'abcdefghiabc', 'index', 'def')
@@ -1071,7 +1099,6 @@ class MixinStrUnicodeUserStringTest:
longvalue = sys.maxsize + 10
slongvalue = str(longvalue)
- if slongvalue[-1] in ("L","l"): slongvalue = slongvalue[:-1]
self.checkequal(' 42', '%3ld', '__mod__', 42)
self.checkequal('42', '%d', '__mod__', 42.0)
self.checkequal(slongvalue, '%d', '__mod__', longvalue)
@@ -1086,7 +1113,7 @@ class MixinStrUnicodeUserStringTest:
self.checkraises(ValueError, '%(foo', '__mod__', {})
self.checkraises(TypeError, '%(foo)s %(bar)s', '__mod__', ('foo', 42))
self.checkraises(TypeError, '%d', '__mod__', "42") # not numeric
- self.checkraises(TypeError, '%d', '__mod__', (42+0j)) # no int/long conversion provided
+ self.checkraises(TypeError, '%d', '__mod__', (42+0j)) # no int conversion provided
# argument names with properly nested brackets are supported
self.checkequal('bar', '%((foo))s', '__mod__', {'(foo)': 'bar'})
@@ -1104,7 +1131,7 @@ class MixinStrUnicodeUserStringTest:
format = '%%.%if' % prec
value = 0.01
for x in range(60):
- value = value * 3.141592655 / 3.0 * 10.0
+ value = value * 3.14159265359 / 3.0 * 10.0
self.checkcall(format, "__mod__", value)
def test_inplace_rewrites(self):
@@ -1198,19 +1225,19 @@ class MixinStrUnicodeUserStringTest:
# issue 11828
s = 'hello'
x = 'x'
- self.assertRaisesRegexp(TypeError, r'^find\(', s.find,
+ self.assertRaisesRegex(TypeError, r'^find\(', s.find,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'^rfind\(', s.rfind,
+ self.assertRaisesRegex(TypeError, r'^rfind\(', s.rfind,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'^index\(', s.index,
+ self.assertRaisesRegex(TypeError, r'^index\(', s.index,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'^rindex\(', s.rindex,
+ self.assertRaisesRegex(TypeError, r'^rindex\(', s.rindex,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'^count\(', s.count,
+ self.assertRaisesRegex(TypeError, r'^count\(', s.count,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'^startswith\(', s.startswith,
+ self.assertRaisesRegex(TypeError, r'^startswith\(', s.startswith,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'^endswith\(', s.endswith,
+ self.assertRaisesRegex(TypeError, r'^endswith\(', s.endswith,
x, None, None, None)
diff --git a/Lib/test/subprocessdata/fd_status.py b/Lib/test/subprocessdata/fd_status.py
new file mode 100644
index 0000000000..1f61e13a34
--- /dev/null
+++ b/Lib/test/subprocessdata/fd_status.py
@@ -0,0 +1,24 @@
+"""When called as a script, print a comma-separated list of the open
+file descriptors on stdout."""
+
+import errno
+import os
+
+try:
+ _MAXFD = os.sysconf("SC_OPEN_MAX")
+except:
+ _MAXFD = 256
+
+if __name__ == "__main__":
+ fds = []
+ for fd in range(0, _MAXFD):
+ try:
+ st = os.fstat(fd)
+ except OSError as e:
+ if e.errno == errno.EBADF:
+ continue
+ raise
+ # Ignore Solaris door files
+ if st.st_mode & 0xF000 != 0xd000:
+ fds.append(fd)
+ print(','.join(map(str, fds)))
diff --git a/Lib/test/subprocessdata/input_reader.py b/Lib/test/subprocessdata/input_reader.py
new file mode 100644
index 0000000000..1dc3191ad1
--- /dev/null
+++ b/Lib/test/subprocessdata/input_reader.py
@@ -0,0 +1,7 @@
+"""When called as a script, consumes the input"""
+
+import sys
+
+if __name__ == "__main__":
+ for line in sys.stdin:
+ pass
diff --git a/Lib/test/subprocessdata/qcat.py b/Lib/test/subprocessdata/qcat.py
new file mode 100644
index 0000000000..fe6f9db25c
--- /dev/null
+++ b/Lib/test/subprocessdata/qcat.py
@@ -0,0 +1,7 @@
+"""When ran as a script, simulates cat with no arguments."""
+
+import sys
+
+if __name__ == "__main__":
+ for line in sys.stdin:
+ sys.stdout.write(line)
diff --git a/Lib/test/subprocessdata/qgrep.py b/Lib/test/subprocessdata/qgrep.py
new file mode 100644
index 0000000000..69906379a9
--- /dev/null
+++ b/Lib/test/subprocessdata/qgrep.py
@@ -0,0 +1,10 @@
+"""When called with a single argument, simulated fgrep with a single
+argument and no options."""
+
+import sys
+
+if __name__ == "__main__":
+ pattern = sys.argv[1]
+ for line in sys.stdin:
+ if pattern in line:
+ sys.stdout.write(line)
diff --git a/Lib/test/support.py b/Lib/test/support.py
index bef7161e9a..a9e1b77ce7 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -10,29 +10,41 @@ import gc
import socket
import sys
import os
-import re
import platform
import shutil
import warnings
import unittest
import importlib
import collections
+import re
+import subprocess
+import imp
+import time
+import sysconfig
+import logging.handlers
+
+try:
+ import _thread
+except ImportError:
+ _thread = None
__all__ = [
"Error", "TestFailed", "ResourceDenied", "import_module",
"verbose", "use_resources", "max_memuse", "record_original_stdout",
"get_original_stdout", "unload", "unlink", "rmtree", "forget",
"is_resource_enabled", "requires", "find_unused_port", "bind_port",
- "fcmp", "is_jython", "TESTFN", "HOST", "FUZZ", "findfile", "verify",
- "vereq", "sortdict", "check_syntax_error", "open_urlresource",
+ "fcmp", "is_jython", "TESTFN", "HOST", "FUZZ", "SAVEDCWD", "temp_cwd",
+ "findfile", "sortdict", "check_syntax_error", "open_urlresource",
"check_warnings", "CleanImport", "EnvironmentVarGuard",
"TransientResource", "captured_output", "captured_stdout",
"time_out", "socket_peer_reset", "ioerror_peer_reset",
- "run_with_locale", "transient_internet",
+ "run_with_locale", 'temp_umask', "transient_internet",
"set_memlimit", "bigmemtest", "bigaddrspacetest", "BasicTestRunner",
"run_unittest", "run_doctest", "threading_setup", "threading_cleanup",
"reap_children", "cpython_only", "check_impl_detail", "get_attribute",
- ]
+ "swap_item", "swap_attr", "requires_IEEE_754",
+ "TestHandler", "Matcher", "can_symlink", "skip_unless_symlink"]
+
class Error(Exception):
"""Base class for regression test exceptions."""
@@ -176,27 +188,50 @@ def unload(name):
def unlink(filename):
try:
os.unlink(filename)
- except OSError:
- pass
+ except OSError as error:
+ # The filename need not exist.
+ if error.errno not in (errno.ENOENT, errno.ENOTDIR):
+ raise
def rmtree(path):
try:
shutil.rmtree(path)
- except OSError as e:
+ except OSError as error:
# Unix returns ENOENT, Windows returns ESRCH.
- if e.errno not in (errno.ENOENT, errno.ESRCH):
+ if error.errno not in (errno.ENOENT, errno.ESRCH):
raise
+def make_legacy_pyc(source):
+ """Move a PEP 3147 pyc/pyo file to its legacy pyc/pyo location.
+
+ The choice of .pyc or .pyo extension is done based on the __debug__ flag
+ value.
+
+ :param source: The file system path to the source file. The source file
+ does not need to exist, however the PEP 3147 pyc file must exist.
+ :return: The file system path to the legacy pyc file.
+ """
+ pyc_file = imp.cache_from_source(source)
+ up_one = os.path.dirname(os.path.abspath(source))
+ legacy_pyc = os.path.join(up_one, source + ('c' if __debug__ else 'o'))
+ os.rename(pyc_file, legacy_pyc)
+ return legacy_pyc
+
def forget(modname):
- '''"Forget" a module was ever imported by removing it from sys.modules and
- deleting any .pyc and .pyo files.'''
+ """'Forget' a module was ever imported.
+
+ This removes the module from sys.modules and deletes any PEP 3147 or
+ legacy .pyc and .pyo files.
+ """
unload(modname)
for dirname in sys.path:
- unlink(os.path.join(dirname, modname + '.pyc'))
- # Deleting the .pyo file cannot be within the 'try' for the .pyc since
- # the chance exists that there is no .pyc (and thus the 'try' statement
- # is exited) but there is a .pyo file.
- unlink(os.path.join(dirname, modname + '.pyo'))
+ source = os.path.join(dirname, modname + '.py')
+ # It doesn't matter if they exist or not, unlink all possible
+ # combinations of PEP 3147 and legacy pyc and pyo files.
+ unlink(source + 'c')
+ unlink(source + 'o')
+ unlink(imp.cache_from_source(source, debug_override=True))
+ unlink(imp.cache_from_source(source, debug_override=False))
# On some platforms, should not run gui test even if it is allowed
# in `use_resources'.
@@ -237,7 +272,9 @@ def requires(resource, msg=None):
"""Raise ResourceDenied if the specified resource is not available.
If the caller's module is __main__ then automatically return True. The
- possibility of False being returned occurs when regrtest.py is executing."""
+ possibility of False being returned occurs when regrtest.py is
+ executing.
+ """
if resource == 'gui' and not _is_gui_available():
raise unittest.SkipTest("Cannot use the 'gui' resource")
# see if the caller's module is __main__ - if so, treat as if
@@ -362,6 +399,11 @@ def fcmp(x, y): # fuzzy comparison function
return (len(x) > len(y)) - (len(x) < len(y))
return (x > y) - (x < y)
+# decorator for skipping tests on non-IEEE 754 platforms
+requires_IEEE_754 = unittest.skipUnless(
+ float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+
is_jython = sys.platform.startswith('java')
# Filename used for testing
@@ -371,57 +413,106 @@ if os.name == 'java':
else:
TESTFN = '@test'
- # Assuming sys.getfilesystemencoding()!=sys.getdefaultencoding()
- # TESTFN_UNICODE is a filename that can be encoded using the
- # file system encoding, but *not* with the default (ascii) encoding
- TESTFN_UNICODE = "@test-\xe0\xf2"
- TESTFN_ENCODING = sys.getfilesystemencoding()
- # TESTFN_UNENCODABLE is a filename that should *not* be
- # able to be encoded by *either* the default or filesystem encoding.
- # This test really only makes sense on Windows NT platforms
- # which have special Unicode support in posixmodule.
- if (not hasattr(sys, "getwindowsversion") or
- sys.getwindowsversion()[3] < 2): # 0=win32s or 1=9x/ME
- TESTFN_UNENCODABLE = None
- else:
+# Disambiguate TESTFN for parallel testing, while letting it remain a valid
+# module name.
+TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid())
+
+
+# TESTFN_UNICODE is a non-ascii filename
+TESTFN_UNICODE = TESTFN + "-\xe0\xf2\u0258\u0141\u011f"
+if sys.platform == 'darwin':
+ # In Mac OS X's VFS API file names are, by definition, canonically
+ # decomposed Unicode, encoded using UTF-8. See QA1173:
+ # http://developer.apple.com/mac/library/qa/qa2001/qa1173.html
+ import unicodedata
+ TESTFN_UNICODE = unicodedata.normalize('NFD', TESTFN_UNICODE)
+TESTFN_ENCODING = sys.getfilesystemencoding()
+
+# TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be
+# encoded by the filesystem encoding (in strict mode). It can be None if we
+# cannot generate such filename.
+TESTFN_UNENCODABLE = None
+if os.name in ('nt', 'ce'):
+ # skip win32s (0) or Windows 9x/ME (1)
+ if sys.getwindowsversion().platform >= 2:
# Different kinds of characters from various languages to minimize the
# probability that the whole name is encodable to MBCS (issue #9819)
TESTFN_UNENCODABLE = TESTFN + "-\u5171\u0141\u2661\u0363\uDC80"
try:
- # XXX - Note - should be using TESTFN_ENCODING here - but for
- # Windows, "mbcs" currently always operates as if in
- # errors=ignore' mode - hence we get '?' characters rather than
- # the exception. 'Latin1' operates as we expect - ie, fails.
- # See [ 850997 ] mbcs encoding ignores errors
- TESTFN_UNENCODABLE.encode("Latin1")
+ TESTFN_UNENCODABLE.encode(TESTFN_ENCODING)
except UnicodeEncodeError:
pass
else:
- print('WARNING: The filename %r CAN be encoded by the filesystem. '
+ print('WARNING: The filename %r CAN be encoded by the filesystem encoding (%s). '
'Unicode filename tests may not be effective'
- % TESTFN_UNENCODABLE)
+ % (TESTFN_UNENCODABLE, TESTFN_ENCODING))
+ TESTFN_UNENCODABLE = None
+# Mac OS X denies unencodable filenames (invalid utf-8)
+elif sys.platform != 'darwin':
+ try:
+ # ascii and utf-8 cannot encode the byte 0xff
+ b'\xff'.decode(TESTFN_ENCODING)
+ except UnicodeDecodeError:
+ # 0xff will be encoded using the surrogate character u+DCFF
+ TESTFN_UNENCODABLE = TESTFN \
+ + b'-\xff'.decode(TESTFN_ENCODING, 'surrogateescape')
+ else:
+ # File system encoding (eg. ISO-8859-* encodings) can encode
+ # the byte 0xff. Skip some unicode filename tests.
+ pass
-if os.path.isdir(TESTFN):
- # a test failed (eg. test_os) without removing TESTFN directory
- shutil.rmtree(TESTFN)
+# Save the initial cwd
+SAVEDCWD = os.getcwd()
-# Make sure we can write to TESTFN, try in /tmp if we can't
-fp = None
-try:
- fp = open(TESTFN, 'w+')
-except IOError:
- TMP_TESTFN = os.path.join('/tmp', TESTFN)
+@contextlib.contextmanager
+def temp_cwd(name='tempcwd', quiet=False, path=None):
+ """
+ Context manager that temporarily changes the CWD.
+
+ An existing path may be provided as *path*, in which case this
+ function makes no changes to the file system.
+
+ Otherwise, the new CWD is created in the current directory and it's
+ named *name*. If *quiet* is False (default) and it's not possible to
+ create or change the CWD, an error is raised. If it's True, only a
+ warning is raised and the original CWD is used.
+ """
+ saved_dir = os.getcwd()
+ is_temporary = False
+ if path is None:
+ path = name
+ try:
+ os.mkdir(name)
+ is_temporary = True
+ except OSError:
+ if not quiet:
+ raise
+ warnings.warn('tests may fail, unable to create temp CWD ' + name,
+ RuntimeWarning, stacklevel=3)
+ try:
+ os.chdir(path)
+ except OSError:
+ if not quiet:
+ raise
+ warnings.warn('tests may fail, unable to change the CWD to ' + name,
+ RuntimeWarning, stacklevel=3)
try:
- fp = open(TMP_TESTFN, 'w+')
- TESTFN = TMP_TESTFN
- del TMP_TESTFN
- except IOError:
- print(('WARNING: tests will fail, unable to write to: %s or %s' %
- (TESTFN, TMP_TESTFN)))
-if fp is not None:
- fp.close()
- unlink(TESTFN)
-del fp
+ yield os.getcwd()
+ finally:
+ os.chdir(saved_dir)
+ if is_temporary:
+ rmtree(name)
+
+
+@contextlib.contextmanager
+def temp_umask(umask):
+ """Context manager that temporarily sets the process umask."""
+ oldmask = os.umask(umask)
+ try:
+ yield
+ finally:
+ os.umask(oldmask)
+
def findfile(file, here=__file__, subdir=None):
"""Try to find a file on sys.path and the working directory. If it is not
@@ -438,30 +529,6 @@ def findfile(file, here=__file__, subdir=None):
if os.path.exists(fn): return fn
return file
-def verify(condition, reason='test failed'):
- """Verify that condition is true. If not, raise TestFailed.
-
- The optional argument reason can be given to provide
- a better error text.
- """
-
- if not condition:
- raise TestFailed(reason)
-
-def vereq(a, b):
- """Raise TestFailed if a == b is false.
-
- This is better than verify(a == b) because, in case of failure, the
- error message incorporates repr(a) and repr(b) so you can see the
- inputs.
-
- Note that "not (a == b)" isn't necessarily the same as "a != b"; the
- former is tested.
- """
-
- if not (a == b):
- raise TestFailed("%r == %r" % (a, b))
-
def sortdict(dict):
"Like repr(dict), but in sorted order."
items = sorted(dict.items())
@@ -488,47 +555,131 @@ def check_syntax_error(testcase, statement):
def open_urlresource(url, *args, **kw):
import urllib.request, urllib.parse
- requires('urlfetch')
+ check = kw.pop('check', None)
+
filename = urllib.parse.urlparse(url)[2].split('/')[-1] # '/': it's URL!
- for path in [os.path.curdir, os.path.pardir]:
- fn = os.path.join(path, filename)
- if os.path.exists(fn):
- return open(fn, *args, **kw)
+ fn = os.path.join(os.path.dirname(__file__), "data", filename)
+
+ def check_valid_file(fn):
+ f = open(fn, *args, **kw)
+ if check is None:
+ return f
+ elif check(f):
+ f.seek(0)
+ return f
+ f.close()
+
+ if os.path.exists(fn):
+ f = check_valid_file(fn)
+ if f is not None:
+ return f
+ unlink(fn)
+
+ # Verify the requirement before downloading the file
+ requires('urlfetch')
print('\tfetching %s ...' % url, file=get_original_stdout())
f = urllib.request.urlopen(url, timeout=15)
try:
- with open(filename, "wb") as out:
+ with open(fn, "wb") as out:
s = f.read()
while s:
out.write(s)
s = f.read()
finally:
f.close()
- return open(filename, *args, **kw)
+
+ f = check_valid_file(fn)
+ if f is not None:
+ return f
+ raise TestFailed('invalid resource "%s"' % fn)
+
class WarningsRecorder(object):
"""Convenience wrapper for the warnings list returned on
entry to the warnings.catch_warnings() context manager.
"""
def __init__(self, warnings_list):
- self.warnings = warnings_list
+ self._warnings = warnings_list
+ self._last = 0
def __getattr__(self, attr):
- if self.warnings:
- return getattr(self.warnings[-1], attr)
+ if len(self._warnings) > self._last:
+ return getattr(self._warnings[-1], attr)
elif attr in warnings.WarningMessage._WARNING_DETAILS:
return None
raise AttributeError("%r has no attribute %r" % (self, attr))
+ @property
+ def warnings(self):
+ return self._warnings[self._last:]
+
def reset(self):
- del self.warnings[:]
+ self._last = len(self._warnings)
-@contextlib.contextmanager
-def check_warnings():
+
+def _filterwarnings(filters, quiet=False):
+ """Catch the warnings, then check if all the expected
+ warnings have been raised and re-raise unexpected warnings.
+ If 'quiet' is True, only re-raise the unexpected warnings.
+ """
+ # Clear the warning registry of the calling module
+ # in order to re-raise the warnings.
+ frame = sys._getframe(2)
+ registry = frame.f_globals.get('__warningregistry__')
+ if registry:
+ registry.clear()
with warnings.catch_warnings(record=True) as w:
+ # Set filter "always" to record all warnings. Because
+ # test_warnings swap the module, we need to look up in
+ # the sys.modules dictionary.
+ sys.modules['warnings'].simplefilter("always")
yield WarningsRecorder(w)
+ # Filter the recorded warnings
+ reraise = list(w)
+ missing = []
+ for msg, cat in filters:
+ seen = False
+ for w in reraise[:]:
+ warning = w.message
+ # Filter out the matching messages
+ if (re.match(msg, str(warning), re.I) and
+ issubclass(warning.__class__, cat)):
+ seen = True
+ reraise.remove(w)
+ if not seen and not quiet:
+ # This filter caught nothing
+ missing.append((msg, cat.__name__))
+ if reraise:
+ raise AssertionError("unhandled warning %s" % reraise[0])
+ if missing:
+ raise AssertionError("filter (%r, %s) did not catch any warning" %
+ missing[0])
+
+
+@contextlib.contextmanager
+def check_warnings(*filters, **kwargs):
+ """Context manager to silence warnings.
+
+ Accept 2-tuples as positional arguments:
+ ("message regexp", WarningCategory)
+
+ Optional argument:
+ - if 'quiet' is True, it does not fail if a filter catches nothing
+ (default True without argument,
+ default False if some filters are defined)
+
+ Without argument, it defaults to:
+ check_warnings(("", Warning), quiet=True)
+ """
+ quiet = kwargs.get('quiet')
+ if not filters:
+ filters = (("", Warning),)
+ # Preserve backward compatibility
+ if quiet is None:
+ quiet = True
+ return _filterwarnings(filters, quiet)
class CleanImport(object):
@@ -540,7 +691,7 @@ class CleanImport(object):
Use like this:
with CleanImport("foo"):
- __import__("foo") # new reference
+ importlib.import_module("foo") # new reference
"""
def __init__(self, *module_names):
@@ -613,6 +764,32 @@ class EnvironmentVarGuard(collections.MutableMapping):
del self._environ[k]
else:
self._environ[k] = v
+ os.environ = self._environ
+
+
+class DirsOnSysPath(object):
+ """Context manager to temporarily add directories to sys.path.
+
+ This makes a copy of sys.path, appends any directories given
+ as positional arguments, then reverts sys.path to the copied
+ settings when the context ends.
+
+ Note that *all* sys.path modifications in the body of the
+ context manager, including replacement of the object,
+ will be reverted at the end of the block.
+ """
+
+ def __init__(self, *paths):
+ self.original_value = sys.path[:]
+ self.original_object = sys.path
+ sys.path.extend(paths)
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *ignore_exc):
+ sys.path = self.original_object
+ sys.path[:] = self.original_value
class TransientResource(object):
@@ -662,6 +839,8 @@ def transient_internet(resource_name, *, timeout=30.0, errnos=()):
default_gai_errnos = [
('EAI_NONAME', -2),
('EAI_NODATA', -5),
+ # Encountered when trying to resolve IPv6-only hostnames
+ ('WSANO_DATA', 11004),
]
denied = ResourceDenied("Resource '%s' is not available" % resource_name)
@@ -730,6 +909,12 @@ def captured_output(stream_name):
def captured_stdout():
return captured_output("stdout")
+def captured_stderr():
+ return captured_output("stderr")
+
+def captured_stdin():
+ return captured_output("stdin")
+
def gc_collect():
"""Force as many objects as possible to be collected.
@@ -741,10 +926,22 @@ def gc_collect():
objects to disappear.
"""
gc.collect()
+ if is_jython:
+ time.sleep(0.1)
gc.collect()
gc.collect()
+def python_is_optimized():
+ """Find if Python was built with optimizations."""
+ cflags = sysconfig.get_config_var('PY_CFLAGS') or ''
+ final_opt = ""
+ for opt in cflags.split():
+ if opt.startswith('-O'):
+ final_opt = opt
+ return final_opt and final_opt != '-O0'
+
+
#=======================================================================
# Decorator for running a function in a different locale, correctly resetting
# it afterwards.
@@ -795,7 +992,6 @@ _4G = 4 * _1G
MAX_Py_ssize_t = sys.maxsize
def set_memlimit(limit):
- import re
global max_memuse
global real_max_memuse
sizes = {
@@ -1033,31 +1229,50 @@ def modules_cleanup(oldmodules):
if k.startswith('encodings.')]
sys.modules.clear()
sys.modules.update(encodings)
+ # XXX: This kind of problem can affect more than just encodings. In particular
+ # extension modules (such as _ssl) don't cope with reloading properly.
+ # Really, test modules should be cleaning out the test specific modules they
+ # know they added (ala test_runpy) rather than relying on this function (as
+ # test_importhooks and test_pkg do currently).
+ # Implicitly imported *real* modules should be left alone (see issue 10556).
sys.modules.update(oldmodules)
#=======================================================================
# Threading support to prevent reporting refleaks when running regrtest.py -R
-def threading_setup():
- import threading
- return len(threading._active), len(threading._limbo)
+# NOTE: we use thread._count() rather than threading.enumerate() (or the
+# moral equivalent thereof) because a threading.Thread object is still alive
+# until its __bootstrap() method has returned, even after it has been
+# unregistered from the threading module.
+# thread._count(), on the other hand, only gets decremented *after* the
+# __bootstrap() method has returned, which gives us reliable reference counts
+# at the end of a test run.
-def threading_cleanup(num_active, num_limbo):
- import threading
- import time
+def threading_setup():
+ if _thread:
+ return _thread._count(),
+ else:
+ return 1,
+def threading_cleanup(nb_threads):
+ if not _thread:
+ return
_MAX_COUNT = 10
- count = 0
- while len(threading._active) != num_active and count < _MAX_COUNT:
- count += 1
- time.sleep(0.1)
-
- count = 0
- while len(threading._limbo) != num_limbo and count < _MAX_COUNT:
- count += 1
+ for count in range(_MAX_COUNT):
+ n = _thread._count()
+ if n == nb_threads:
+ break
time.sleep(0.1)
+ # XXX print a warning in case of failure?
def reap_threads(func):
+ """Use this function when threads are being used. This will
+ ensure that the threads are cleaned up even when the test fails.
+ If threading is unavailable this function does nothing.
+ """
+ if not _thread:
+ return func
+
@functools.wraps(func)
def decorator(*args):
key = threading_setup()
@@ -1087,6 +1302,60 @@ def reap_children():
except:
break
+@contextlib.contextmanager
+def swap_attr(obj, attr, new_val):
+ """Temporary swap out an attribute with a new object.
+
+ Usage:
+ with swap_attr(obj, "attr", 5):
+ ...
+
+ This will set obj.attr to 5 for the duration of the with: block,
+ restoring the old value at the end of the block. If `attr` doesn't
+ exist on `obj`, it will be created and then deleted at the end of the
+ block.
+ """
+ if hasattr(obj, attr):
+ real_val = getattr(obj, attr)
+ setattr(obj, attr, new_val)
+ try:
+ yield
+ finally:
+ setattr(obj, attr, real_val)
+ else:
+ setattr(obj, attr, new_val)
+ try:
+ yield
+ finally:
+ delattr(obj, attr)
+
+@contextlib.contextmanager
+def swap_item(obj, item, new_val):
+ """Temporary swap out an item with a new object.
+
+ Usage:
+ with swap_item(obj, "item", 5):
+ ...
+
+ This will set obj["item"] to 5 for the duration of the with: block,
+ restoring the old value at the end of the block. If `item` doesn't
+ exist on `obj`, it will be created and then deleted at the end of the
+ block.
+ """
+ if item in obj:
+ real_val = obj[item]
+ obj[item] = new_val
+ try:
+ yield
+ finally:
+ obj[item] = real_val
+ else:
+ obj[item] = new_val
+ try:
+ yield
+ finally:
+ del obj[item]
+
def strip_python_stderr(stderr):
"""Strip the stderr of a Python process from potential debug output
emitted by the interpreter.
@@ -1097,6 +1366,110 @@ def strip_python_stderr(stderr):
stderr = re.sub(br"\[\d+ refs\]\r?\n?$", b"", stderr).strip()
return stderr
+def args_from_interpreter_flags():
+ """Return a list of command-line arguments reproducing the current
+ settings in sys.flags."""
+ flag_opt_map = {
+ 'bytes_warning': 'b',
+ 'dont_write_bytecode': 'B',
+ 'ignore_environment': 'E',
+ 'no_user_site': 's',
+ 'no_site': 'S',
+ 'optimize': 'O',
+ 'verbose': 'v',
+ }
+ args = []
+ for flag, opt in flag_opt_map.items():
+ v = getattr(sys.flags, flag)
+ if v > 0:
+ args.append('-' + opt * v)
+ return args
+
+#============================================================
+# Support for assertions about logging.
+#============================================================
+
+class TestHandler(logging.handlers.BufferingHandler):
+ def __init__(self, matcher):
+ # BufferingHandler takes a "capacity" argument
+ # so as to know when to flush. As we're overriding
+ # shouldFlush anyway, we can set a capacity of zero.
+ # You can call flush() manually to clear out the
+ # buffer.
+ logging.handlers.BufferingHandler.__init__(self, 0)
+ self.matcher = matcher
+
+ def shouldFlush(self):
+ return False
+
+ def emit(self, record):
+ self.format(record)
+ self.buffer.append(record.__dict__)
+
+ def matches(self, **kwargs):
+ """
+ Look for a saved dict whose keys/values match the supplied arguments.
+ """
+ result = False
+ for d in self.buffer:
+ if self.matcher.matches(d, **kwargs):
+ result = True
+ break
+ return result
+
+class Matcher(object):
+
+ _partial_matches = ('msg', 'message')
+
+ def matches(self, d, **kwargs):
+ """
+ Try to match a single dict with the supplied arguments.
+
+ Keys whose values are strings and which are in self._partial_matches
+ will be checked for partial (i.e. substring) matches. You can extend
+ this scheme to (for example) do regular expression matching, etc.
+ """
+ result = True
+ for k in kwargs:
+ v = kwargs[k]
+ dv = d.get(k)
+ if not self.match_value(k, dv, v):
+ result = False
+ break
+ return result
+
+ def match_value(self, k, dv, v):
+ """
+ Try to match a single stored value (dv) with a supplied value (v).
+ """
+ if type(v) != type(dv):
+ result = False
+ elif type(dv) is not str or k not in self._partial_matches:
+ result = (v == dv)
+ else:
+ result = dv.find(v) >= 0
+ return result
+
+
+_can_symlink = None
+def can_symlink():
+ global _can_symlink
+ if _can_symlink is not None:
+ return _can_symlink
+ try:
+ os.symlink(TESTFN, TESTFN + "can_symlink")
+ can = True
+ except (OSError, NotImplementedError):
+ can = False
+ _can_symlink = can
+ return can
+
+def skip_unless_symlink(test):
+ """Skip decorator for tests that require functional symlink"""
+ ok = can_symlink()
+ msg = "Requires functional symlink implementation"
+ return test if ok else unittest.skip(msg)(test)
+
def patch(test_instance, object_to_patch, attr_name, new_value):
"""Override 'object_to_patch'.'attr_name' with 'new_value'.
diff --git a/Lib/test/test_SimpleHTTPServer.py b/Lib/test/test_SimpleHTTPServer.py
deleted file mode 100644
index bca9bd6abb..0000000000
--- a/Lib/test/test_SimpleHTTPServer.py
+++ /dev/null
@@ -1,41 +0,0 @@
-"""
-These tests only check url parsing for now.
-We don't want to require the 'network' resource.
-"""
-
-import os, unittest
-from http.server import SimpleHTTPRequestHandler
-from test import support
-
-
-class SocketlessRequestHandler(SimpleHTTPRequestHandler):
- def __init__(self):
- pass
-
-class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
- """ Test url parsing """
- def setUp (self):
- self.translated = os.getcwd()
- self.translated = os.path.join(self.translated, 'filename')
- self.handler = SocketlessRequestHandler ()
-
- def test_queryArguments (self):
- path = self.handler.translate_path ('/filename')
- self.assertEqual (path, self.translated)
- path = self.handler.translate_path ('/filename?foo=bar')
- self.assertEqual (path, self.translated)
- path = self.handler.translate_path ('/filename?a=b&spam=eggs#zot')
- self.assertEqual (path, self.translated)
-
- def test_startWithDoubleSlash (self):
- path = self.handler.translate_path ('//filename')
- self.assertEqual (path, self.translated)
- path = self.handler.translate_path ('//filename?foo=bar')
- self.assertEqual (path, self.translated)
-
-
-def test_main():
- support.run_unittest(SimpleHTTPRequestHandlerTestCase)
-
-if __name__ == "__main__":
- test_main()
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 200db5cfa2..608ec01f14 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -2,7 +2,6 @@ import unittest
from test import support
import os
import sys
-import warnings
class NoAll(RuntimeError):
@@ -16,9 +15,10 @@ class AllTest(unittest.TestCase):
def check_all(self, modname):
names = {}
- with warnings.catch_warnings():
- warnings.filterwarnings("ignore", ".* (module|package)",
- DeprecationWarning)
+ with support.check_warnings(
+ (".* (module|package)", DeprecationWarning),
+ ("", ResourceWarning),
+ quiet=True):
try:
exec("import %s" % modname, names)
except:
diff --git a/Lib/test/test___future__.py b/Lib/test/test___future__.py
index f41b8799b4..9ae4ce40ad 100644
--- a/Lib/test/test___future__.py
+++ b/Lib/test/test___future__.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
import unittest
from test import support
import __future__
diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py
index 02942d17ba..3fadb575f2 100644
--- a/Lib/test/test__locale.py
+++ b/Lib/test/test__locale.py
@@ -1,4 +1,4 @@
-from test.support import verbose, run_unittest
+from test.support import run_unittest
from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, localeconv, Error)
try:
from _locale import (RADIXCHAR, THOUSEP, nl_langinfo)
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index 3aef4a00f2..d86f97c068 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -34,8 +34,46 @@ class TestABC(unittest.TestCase):
def foo(self): return super().foo
self.assertEqual(D().foo, 3)
+ def test_abstractclassmethod_basics(self):
+ @abc.abstractclassmethod
+ def foo(cls): pass
+ self.assertTrue(foo.__isabstractmethod__)
+ @classmethod
+ def bar(cls): pass
+ self.assertFalse(hasattr(bar, "__isabstractmethod__"))
+
+ class C(metaclass=abc.ABCMeta):
+ @abc.abstractclassmethod
+ def foo(cls): return cls.__name__
+ self.assertRaises(TypeError, C)
+ class D(C):
+ @classmethod
+ def foo(cls): return super().foo()
+ self.assertEqual(D.foo(), 'D')
+ self.assertEqual(D().foo(), 'D')
+
+ def test_abstractstaticmethod_basics(self):
+ @abc.abstractstaticmethod
+ def foo(): pass
+ self.assertTrue(foo.__isabstractmethod__)
+ @staticmethod
+ def bar(): pass
+ self.assertFalse(hasattr(bar, "__isabstractmethod__"))
+
+ class C(metaclass=abc.ABCMeta):
+ @abc.abstractstaticmethod
+ def foo(): return 3
+ self.assertRaises(TypeError, C)
+ class D(C):
+ @staticmethod
+ def foo(): return 4
+ self.assertEqual(D.foo(), 4)
+ self.assertEqual(D().foo(), 4)
+
def test_abstractmethod_integration(self):
- for abstractthing in [abc.abstractmethod, abc.abstractproperty]:
+ for abstractthing in [abc.abstractmethod, abc.abstractproperty,
+ abc.abstractclassmethod,
+ abc.abstractstaticmethod]:
class C(metaclass=abc.ABCMeta):
@abstractthing
def foo(self): pass # abstract
@@ -81,20 +119,20 @@ class TestABC(unittest.TestCase):
b = B()
self.assertFalse(issubclass(B, A))
self.assertFalse(issubclass(B, (A,)))
- self.assertEqual(isinstance(b, A), False)
- self.assertEqual(isinstance(b, (A,)), False)
+ self.assertNotIsInstance(b, A)
+ self.assertNotIsInstance(b, (A,))
A.register(B)
self.assertTrue(issubclass(B, A))
self.assertTrue(issubclass(B, (A,)))
- self.assertEqual(isinstance(b, A), True)
- self.assertEqual(isinstance(b, (A,)), True)
+ self.assertIsInstance(b, A)
+ self.assertIsInstance(b, (A,))
class C(B):
pass
c = C()
self.assertTrue(issubclass(C, A))
self.assertTrue(issubclass(C, (A,)))
- self.assertEqual(isinstance(c, A), True)
- self.assertEqual(isinstance(c, (A,)), True)
+ self.assertIsInstance(c, A)
+ self.assertIsInstance(c, (A,))
def test_isinstance_invalidation(self):
class A(metaclass=abc.ABCMeta):
@@ -112,16 +150,16 @@ class TestABC(unittest.TestCase):
class A(metaclass=abc.ABCMeta):
pass
A.register(int)
- self.assertEqual(isinstance(42, A), True)
- self.assertEqual(isinstance(42, (A,)), True)
+ self.assertIsInstance(42, A)
+ self.assertIsInstance(42, (A,))
self.assertTrue(issubclass(int, A))
self.assertTrue(issubclass(int, (A,)))
class B(A):
pass
B.register(str)
class C(str): pass
- self.assertEqual(isinstance("", A), True)
- self.assertEqual(isinstance("", (A,)), True)
+ self.assertIsInstance("", A)
+ self.assertIsInstance("", (A,))
self.assertTrue(issubclass(str, A))
self.assertTrue(issubclass(str, (A,)))
self.assertTrue(issubclass(C, A))
@@ -147,8 +185,8 @@ class TestABC(unittest.TestCase):
def test_register_non_class(self):
class A(metaclass=abc.ABCMeta):
pass
- self.assertRaisesRegexp(TypeError, "Can only register classes",
- A.register, 4)
+ self.assertRaisesRegex(TypeError, "Can only register classes",
+ A.register, 4)
def test_registration_transitiveness(self):
class A(metaclass=abc.ABCMeta):
@@ -186,8 +224,8 @@ class TestABC(unittest.TestCase):
pass
self.assertTrue(issubclass(MyInt, A))
self.assertTrue(issubclass(MyInt, (A,)))
- self.assertTrue(isinstance(42, A))
- self.assertTrue(isinstance(42, (A,)))
+ self.assertIsInstance(42, A)
+ self.assertIsInstance(42, (A,))
def test_all_new_methods_are_called(self):
class A(metaclass=abc.ABCMeta):
diff --git a/Lib/test/test_abstract_numbers.py b/Lib/test/test_abstract_numbers.py
index d0164c07b8..2a396cdad1 100644
--- a/Lib/test/test_abstract_numbers.py
+++ b/Lib/test/test_abstract_numbers.py
@@ -4,7 +4,6 @@ import math
import operator
import unittest
from numbers import Complex, Real, Rational, Integral
-from numbers import Number
from test import support
class TestNumbers(unittest.TestCase):
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
new file mode 100644
index 0000000000..5ecfdc72ea
--- /dev/null
+++ b/Lib/test/test_argparse.py
@@ -0,0 +1,4681 @@
+# Author: Steven J. Bethard <steven.bethard@gmail.com>.
+
+import codecs
+import inspect
+import os
+import shutil
+import stat
+import sys
+import textwrap
+import tempfile
+import unittest
+import argparse
+
+from io import StringIO
+
+from test import support
+class StdIOBuffer(StringIO):
+ pass
+
+class TestCase(unittest.TestCase):
+
+ def assertEqual(self, obj1, obj2):
+ if obj1 != obj2:
+ print('')
+ print(repr(obj1))
+ print(repr(obj2))
+ print(obj1)
+ print(obj2)
+ super(TestCase, self).assertEqual(obj1, obj2)
+
+ def setUp(self):
+ # The tests assume that line wrapping occurs at 80 columns, but this
+ # behaviour can be overridden by setting the COLUMNS environment
+ # variable. To ensure that this assumption is true, unset COLUMNS.
+ env = support.EnvironmentVarGuard()
+ env.unset("COLUMNS")
+ self.addCleanup(env.__exit__)
+
+
+class TempDirMixin(object):
+
+ def setUp(self):
+ self.temp_dir = tempfile.mkdtemp()
+ self.old_dir = os.getcwd()
+ os.chdir(self.temp_dir)
+
+ def tearDown(self):
+ os.chdir(self.old_dir)
+ shutil.rmtree(self.temp_dir, True)
+
+ def create_readonly_file(self, filename):
+ file_path = os.path.join(self.temp_dir, filename)
+ with open(file_path, 'w') as file:
+ file.write(filename)
+ os.chmod(file_path, stat.S_IREAD)
+
+class Sig(object):
+
+ def __init__(self, *args, **kwargs):
+ self.args = args
+ self.kwargs = kwargs
+
+
+class NS(object):
+
+ def __init__(self, **kwargs):
+ self.__dict__.update(kwargs)
+
+ def __repr__(self):
+ sorted_items = sorted(self.__dict__.items())
+ kwarg_str = ', '.join(['%s=%r' % tup for tup in sorted_items])
+ return '%s(%s)' % (type(self).__name__, kwarg_str)
+
+ def __eq__(self, other):
+ return vars(self) == vars(other)
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class ArgumentParserError(Exception):
+
+ def __init__(self, message, stdout=None, stderr=None, error_code=None):
+ Exception.__init__(self, message, stdout, stderr)
+ self.message = message
+ self.stdout = stdout
+ self.stderr = stderr
+ self.error_code = error_code
+
+
+def stderr_to_parser_error(parse_args, *args, **kwargs):
+ # if this is being called recursively and stderr or stdout is already being
+ # redirected, simply call the function and let the enclosing function
+ # catch the exception
+ if isinstance(sys.stderr, StdIOBuffer) or isinstance(sys.stdout, StdIOBuffer):
+ return parse_args(*args, **kwargs)
+
+ # if this is not being called recursively, redirect stderr and
+ # use it as the ArgumentParserError message
+ old_stdout = sys.stdout
+ old_stderr = sys.stderr
+ sys.stdout = StdIOBuffer()
+ sys.stderr = StdIOBuffer()
+ try:
+ try:
+ result = parse_args(*args, **kwargs)
+ for key in list(vars(result)):
+ if getattr(result, key) is sys.stdout:
+ setattr(result, key, old_stdout)
+ if getattr(result, key) is sys.stderr:
+ setattr(result, key, old_stderr)
+ return result
+ except SystemExit:
+ code = sys.exc_info()[1].code
+ stdout = sys.stdout.getvalue()
+ stderr = sys.stderr.getvalue()
+ raise ArgumentParserError("SystemExit", stdout, stderr, code)
+ finally:
+ sys.stdout = old_stdout
+ sys.stderr = old_stderr
+
+
+class ErrorRaisingArgumentParser(argparse.ArgumentParser):
+
+ def parse_args(self, *args, **kwargs):
+ parse_args = super(ErrorRaisingArgumentParser, self).parse_args
+ return stderr_to_parser_error(parse_args, *args, **kwargs)
+
+ def exit(self, *args, **kwargs):
+ exit = super(ErrorRaisingArgumentParser, self).exit
+ return stderr_to_parser_error(exit, *args, **kwargs)
+
+ def error(self, *args, **kwargs):
+ error = super(ErrorRaisingArgumentParser, self).error
+ return stderr_to_parser_error(error, *args, **kwargs)
+
+
+class ParserTesterMetaclass(type):
+ """Adds parser tests using the class attributes.
+
+ Classes of this type should specify the following attributes:
+
+ argument_signatures -- a list of Sig objects which specify
+ the signatures of Argument objects to be created
+ failures -- a list of args lists that should cause the parser
+ to fail
+ successes -- a list of (initial_args, options, remaining_args) tuples
+ where initial_args specifies the string args to be parsed,
+ options is a dict that should match the vars() of the options
+ parsed out of initial_args, and remaining_args should be any
+ remaining unparsed arguments
+ """
+
+ def __init__(cls, name, bases, bodydict):
+ if name == 'ParserTestCase':
+ return
+
+ # default parser signature is empty
+ if not hasattr(cls, 'parser_signature'):
+ cls.parser_signature = Sig()
+ if not hasattr(cls, 'parser_class'):
+ cls.parser_class = ErrorRaisingArgumentParser
+
+ # ---------------------------------------
+ # functions for adding optional arguments
+ # ---------------------------------------
+ def no_groups(parser, argument_signatures):
+ """Add all arguments directly to the parser"""
+ for sig in argument_signatures:
+ parser.add_argument(*sig.args, **sig.kwargs)
+
+ def one_group(parser, argument_signatures):
+ """Add all arguments under a single group in the parser"""
+ group = parser.add_argument_group('foo')
+ for sig in argument_signatures:
+ group.add_argument(*sig.args, **sig.kwargs)
+
+ def many_groups(parser, argument_signatures):
+ """Add each argument in its own group to the parser"""
+ for i, sig in enumerate(argument_signatures):
+ group = parser.add_argument_group('foo:%i' % i)
+ group.add_argument(*sig.args, **sig.kwargs)
+
+ # --------------------------
+ # functions for parsing args
+ # --------------------------
+ def listargs(parser, args):
+ """Parse the args by passing in a list"""
+ return parser.parse_args(args)
+
+ def sysargs(parser, args):
+ """Parse the args by defaulting to sys.argv"""
+ old_sys_argv = sys.argv
+ sys.argv = [old_sys_argv[0]] + args
+ try:
+ return parser.parse_args()
+ finally:
+ sys.argv = old_sys_argv
+
+ # class that holds the combination of one optional argument
+ # addition method and one arg parsing method
+ class AddTests(object):
+
+ def __init__(self, tester_cls, add_arguments, parse_args):
+ self._add_arguments = add_arguments
+ self._parse_args = parse_args
+
+ add_arguments_name = self._add_arguments.__name__
+ parse_args_name = self._parse_args.__name__
+ for test_func in [self.test_failures, self.test_successes]:
+ func_name = test_func.__name__
+ names = func_name, add_arguments_name, parse_args_name
+ test_name = '_'.join(names)
+
+ def wrapper(self, test_func=test_func):
+ test_func(self)
+ try:
+ wrapper.__name__ = test_name
+ except TypeError:
+ pass
+ setattr(tester_cls, test_name, wrapper)
+
+ def _get_parser(self, tester):
+ args = tester.parser_signature.args
+ kwargs = tester.parser_signature.kwargs
+ parser = tester.parser_class(*args, **kwargs)
+ self._add_arguments(parser, tester.argument_signatures)
+ return parser
+
+ def test_failures(self, tester):
+ parser = self._get_parser(tester)
+ for args_str in tester.failures:
+ args = args_str.split()
+ raises = tester.assertRaises
+ raises(ArgumentParserError, parser.parse_args, args)
+
+ def test_successes(self, tester):
+ parser = self._get_parser(tester)
+ for args, expected_ns in tester.successes:
+ if isinstance(args, str):
+ args = args.split()
+ result_ns = self._parse_args(parser, args)
+ tester.assertEqual(expected_ns, result_ns)
+
+ # add tests for each combination of an optionals adding method
+ # and an arg parsing method
+ for add_arguments in [no_groups, one_group, many_groups]:
+ for parse_args in [listargs, sysargs]:
+ AddTests(cls, add_arguments, parse_args)
+
+bases = TestCase,
+ParserTestCase = ParserTesterMetaclass('ParserTestCase', bases, {})
+
+# ===============
+# Optionals tests
+# ===============
+
+class TestOptionalsSingleDash(ParserTestCase):
+ """Test an Optional with a single-dash option string"""
+
+ argument_signatures = [Sig('-x')]
+ failures = ['-x', 'a', '--foo', '-x --foo', '-x -y']
+ successes = [
+ ('', NS(x=None)),
+ ('-x a', NS(x='a')),
+ ('-xa', NS(x='a')),
+ ('-x -1', NS(x='-1')),
+ ('-x-1', NS(x='-1')),
+ ]
+
+
+class TestOptionalsSingleDashCombined(ParserTestCase):
+ """Test an Optional with a single-dash option string"""
+
+ argument_signatures = [
+ Sig('-x', action='store_true'),
+ Sig('-yyy', action='store_const', const=42),
+ Sig('-z'),
+ ]
+ failures = ['a', '--foo', '-xa', '-x --foo', '-x -z', '-z -x',
+ '-yx', '-yz a', '-yyyx', '-yyyza', '-xyza']
+ successes = [
+ ('', NS(x=False, yyy=None, z=None)),
+ ('-x', NS(x=True, yyy=None, z=None)),
+ ('-za', NS(x=False, yyy=None, z='a')),
+ ('-z a', NS(x=False, yyy=None, z='a')),
+ ('-xza', NS(x=True, yyy=None, z='a')),
+ ('-xz a', NS(x=True, yyy=None, z='a')),
+ ('-x -za', NS(x=True, yyy=None, z='a')),
+ ('-x -z a', NS(x=True, yyy=None, z='a')),
+ ('-y', NS(x=False, yyy=42, z=None)),
+ ('-yyy', NS(x=False, yyy=42, z=None)),
+ ('-x -yyy -za', NS(x=True, yyy=42, z='a')),
+ ('-x -yyy -z a', NS(x=True, yyy=42, z='a')),
+ ]
+
+
+class TestOptionalsSingleDashLong(ParserTestCase):
+ """Test an Optional with a multi-character single-dash option string"""
+
+ argument_signatures = [Sig('-foo')]
+ failures = ['-foo', 'a', '--foo', '-foo --foo', '-foo -y', '-fooa']
+ successes = [
+ ('', NS(foo=None)),
+ ('-foo a', NS(foo='a')),
+ ('-foo -1', NS(foo='-1')),
+ ('-fo a', NS(foo='a')),
+ ('-f a', NS(foo='a')),
+ ]
+
+
+class TestOptionalsSingleDashSubsetAmbiguous(ParserTestCase):
+ """Test Optionals where option strings are subsets of each other"""
+
+ argument_signatures = [Sig('-f'), Sig('-foobar'), Sig('-foorab')]
+ failures = ['-f', '-foo', '-fo', '-foo b', '-foob', '-fooba', '-foora']
+ successes = [
+ ('', NS(f=None, foobar=None, foorab=None)),
+ ('-f a', NS(f='a', foobar=None, foorab=None)),
+ ('-fa', NS(f='a', foobar=None, foorab=None)),
+ ('-foa', NS(f='oa', foobar=None, foorab=None)),
+ ('-fooa', NS(f='ooa', foobar=None, foorab=None)),
+ ('-foobar a', NS(f=None, foobar='a', foorab=None)),
+ ('-foorab a', NS(f=None, foobar=None, foorab='a')),
+ ]
+
+
+class TestOptionalsSingleDashAmbiguous(ParserTestCase):
+ """Test Optionals that partially match but are not subsets"""
+
+ argument_signatures = [Sig('-foobar'), Sig('-foorab')]
+ failures = ['-f', '-f a', '-fa', '-foa', '-foo', '-fo', '-foo b']
+ successes = [
+ ('', NS(foobar=None, foorab=None)),
+ ('-foob a', NS(foobar='a', foorab=None)),
+ ('-foor a', NS(foobar=None, foorab='a')),
+ ('-fooba a', NS(foobar='a', foorab=None)),
+ ('-foora a', NS(foobar=None, foorab='a')),
+ ('-foobar a', NS(foobar='a', foorab=None)),
+ ('-foorab a', NS(foobar=None, foorab='a')),
+ ]
+
+
+class TestOptionalsNumeric(ParserTestCase):
+ """Test an Optional with a short opt string"""
+
+ argument_signatures = [Sig('-1', dest='one')]
+ failures = ['-1', 'a', '-1 --foo', '-1 -y', '-1 -1', '-1 -2']
+ successes = [
+ ('', NS(one=None)),
+ ('-1 a', NS(one='a')),
+ ('-1a', NS(one='a')),
+ ('-1-2', NS(one='-2')),
+ ]
+
+
+class TestOptionalsDoubleDash(ParserTestCase):
+ """Test an Optional with a double-dash option string"""
+
+ argument_signatures = [Sig('--foo')]
+ failures = ['--foo', '-f', '-f a', 'a', '--foo -x', '--foo --bar']
+ successes = [
+ ('', NS(foo=None)),
+ ('--foo a', NS(foo='a')),
+ ('--foo=a', NS(foo='a')),
+ ('--foo -2.5', NS(foo='-2.5')),
+ ('--foo=-2.5', NS(foo='-2.5')),
+ ]
+
+
+class TestOptionalsDoubleDashPartialMatch(ParserTestCase):
+ """Tests partial matching with a double-dash option string"""
+
+ argument_signatures = [
+ Sig('--badger', action='store_true'),
+ Sig('--bat'),
+ ]
+ failures = ['--bar', '--b', '--ba', '--b=2', '--ba=4', '--badge 5']
+ successes = [
+ ('', NS(badger=False, bat=None)),
+ ('--bat X', NS(badger=False, bat='X')),
+ ('--bad', NS(badger=True, bat=None)),
+ ('--badg', NS(badger=True, bat=None)),
+ ('--badge', NS(badger=True, bat=None)),
+ ('--badger', NS(badger=True, bat=None)),
+ ]
+
+
+class TestOptionalsDoubleDashPrefixMatch(ParserTestCase):
+ """Tests when one double-dash option string is a prefix of another"""
+
+ argument_signatures = [
+ Sig('--badger', action='store_true'),
+ Sig('--ba'),
+ ]
+ failures = ['--bar', '--b', '--ba', '--b=2', '--badge 5']
+ successes = [
+ ('', NS(badger=False, ba=None)),
+ ('--ba X', NS(badger=False, ba='X')),
+ ('--ba=X', NS(badger=False, ba='X')),
+ ('--bad', NS(badger=True, ba=None)),
+ ('--badg', NS(badger=True, ba=None)),
+ ('--badge', NS(badger=True, ba=None)),
+ ('--badger', NS(badger=True, ba=None)),
+ ]
+
+
+class TestOptionalsSingleDoubleDash(ParserTestCase):
+ """Test an Optional with single- and double-dash option strings"""
+
+ argument_signatures = [
+ Sig('-f', action='store_true'),
+ Sig('--bar'),
+ Sig('-baz', action='store_const', const=42),
+ ]
+ failures = ['--bar', '-fbar', '-fbaz', '-bazf', '-b B', 'B']
+ successes = [
+ ('', NS(f=False, bar=None, baz=None)),
+ ('-f', NS(f=True, bar=None, baz=None)),
+ ('--ba B', NS(f=False, bar='B', baz=None)),
+ ('-f --bar B', NS(f=True, bar='B', baz=None)),
+ ('-f -b', NS(f=True, bar=None, baz=42)),
+ ('-ba -f', NS(f=True, bar=None, baz=42)),
+ ]
+
+
+class TestOptionalsAlternatePrefixChars(ParserTestCase):
+ """Test an Optional with option strings with custom prefixes"""
+
+ parser_signature = Sig(prefix_chars='+:/', add_help=False)
+ argument_signatures = [
+ Sig('+f', action='store_true'),
+ Sig('::bar'),
+ Sig('/baz', action='store_const', const=42),
+ ]
+ failures = ['--bar', '-fbar', '-b B', 'B', '-f', '--bar B', '-baz', '-h', '--help', '+h', '::help', '/help']
+ successes = [
+ ('', NS(f=False, bar=None, baz=None)),
+ ('+f', NS(f=True, bar=None, baz=None)),
+ ('::ba B', NS(f=False, bar='B', baz=None)),
+ ('+f ::bar B', NS(f=True, bar='B', baz=None)),
+ ('+f /b', NS(f=True, bar=None, baz=42)),
+ ('/ba +f', NS(f=True, bar=None, baz=42)),
+ ]
+
+
+class TestOptionalsAlternatePrefixCharsAddedHelp(ParserTestCase):
+ """When ``-`` not in prefix_chars, default operators created for help
+ should use the prefix_chars in use rather than - or --
+ http://bugs.python.org/issue9444"""
+
+ parser_signature = Sig(prefix_chars='+:/', add_help=True)
+ argument_signatures = [
+ Sig('+f', action='store_true'),
+ Sig('::bar'),
+ Sig('/baz', action='store_const', const=42),
+ ]
+ failures = ['--bar', '-fbar', '-b B', 'B', '-f', '--bar B', '-baz']
+ successes = [
+ ('', NS(f=False, bar=None, baz=None)),
+ ('+f', NS(f=True, bar=None, baz=None)),
+ ('::ba B', NS(f=False, bar='B', baz=None)),
+ ('+f ::bar B', NS(f=True, bar='B', baz=None)),
+ ('+f /b', NS(f=True, bar=None, baz=42)),
+ ('/ba +f', NS(f=True, bar=None, baz=42))
+ ]
+
+
+class TestOptionalsAlternatePrefixCharsMultipleShortArgs(ParserTestCase):
+ """Verify that Optionals must be called with their defined prefixes"""
+
+ parser_signature = Sig(prefix_chars='+-', add_help=False)
+ argument_signatures = [
+ Sig('-x', action='store_true'),
+ Sig('+y', action='store_true'),
+ Sig('+z', action='store_true'),
+ ]
+ failures = ['-w',
+ '-xyz',
+ '+x',
+ '-y',
+ '+xyz',
+ ]
+ successes = [
+ ('', NS(x=False, y=False, z=False)),
+ ('-x', NS(x=True, y=False, z=False)),
+ ('+y -x', NS(x=True, y=True, z=False)),
+ ('+yz -x', NS(x=True, y=True, z=True)),
+ ]
+
+
+class TestOptionalsShortLong(ParserTestCase):
+ """Test a combination of single- and double-dash option strings"""
+
+ argument_signatures = [
+ Sig('-v', '--verbose', '-n', '--noisy', action='store_true'),
+ ]
+ failures = ['--x --verbose', '-N', 'a', '-v x']
+ successes = [
+ ('', NS(verbose=False)),
+ ('-v', NS(verbose=True)),
+ ('--verbose', NS(verbose=True)),
+ ('-n', NS(verbose=True)),
+ ('--noisy', NS(verbose=True)),
+ ]
+
+
+class TestOptionalsDest(ParserTestCase):
+ """Tests various means of setting destination"""
+
+ argument_signatures = [Sig('--foo-bar'), Sig('--baz', dest='zabbaz')]
+ failures = ['a']
+ successes = [
+ ('--foo-bar f', NS(foo_bar='f', zabbaz=None)),
+ ('--baz g', NS(foo_bar=None, zabbaz='g')),
+ ('--foo-bar h --baz i', NS(foo_bar='h', zabbaz='i')),
+ ('--baz j --foo-bar k', NS(foo_bar='k', zabbaz='j')),
+ ]
+
+
+class TestOptionalsDefault(ParserTestCase):
+ """Tests specifying a default for an Optional"""
+
+ argument_signatures = [Sig('-x'), Sig('-y', default=42)]
+ failures = ['a']
+ successes = [
+ ('', NS(x=None, y=42)),
+ ('-xx', NS(x='x', y=42)),
+ ('-yy', NS(x=None, y='y')),
+ ]
+
+
+class TestOptionalsNargsDefault(ParserTestCase):
+ """Tests not specifying the number of args for an Optional"""
+
+ argument_signatures = [Sig('-x')]
+ failures = ['a', '-x']
+ successes = [
+ ('', NS(x=None)),
+ ('-x a', NS(x='a')),
+ ]
+
+
+class TestOptionalsNargs1(ParserTestCase):
+ """Tests specifying the 1 arg for an Optional"""
+
+ argument_signatures = [Sig('-x', nargs=1)]
+ failures = ['a', '-x']
+ successes = [
+ ('', NS(x=None)),
+ ('-x a', NS(x=['a'])),
+ ]
+
+
+class TestOptionalsNargs3(ParserTestCase):
+ """Tests specifying the 3 args for an Optional"""
+
+ argument_signatures = [Sig('-x', nargs=3)]
+ failures = ['a', '-x', '-x a', '-x a b', 'a -x', 'a -x b']
+ successes = [
+ ('', NS(x=None)),
+ ('-x a b c', NS(x=['a', 'b', 'c'])),
+ ]
+
+
+class TestOptionalsNargsOptional(ParserTestCase):
+ """Tests specifying an Optional arg for an Optional"""
+
+ argument_signatures = [
+ Sig('-w', nargs='?'),
+ Sig('-x', nargs='?', const=42),
+ Sig('-y', nargs='?', default='spam'),
+ Sig('-z', nargs='?', type=int, const='42', default='84'),
+ ]
+ failures = ['2']
+ successes = [
+ ('', NS(w=None, x=None, y='spam', z=84)),
+ ('-w', NS(w=None, x=None, y='spam', z=84)),
+ ('-w 2', NS(w='2', x=None, y='spam', z=84)),
+ ('-x', NS(w=None, x=42, y='spam', z=84)),
+ ('-x 2', NS(w=None, x='2', y='spam', z=84)),
+ ('-y', NS(w=None, x=None, y=None, z=84)),
+ ('-y 2', NS(w=None, x=None, y='2', z=84)),
+ ('-z', NS(w=None, x=None, y='spam', z=42)),
+ ('-z 2', NS(w=None, x=None, y='spam', z=2)),
+ ]
+
+
+class TestOptionalsNargsZeroOrMore(ParserTestCase):
+ """Tests specifying an args for an Optional that accepts zero or more"""
+
+ argument_signatures = [
+ Sig('-x', nargs='*'),
+ Sig('-y', nargs='*', default='spam'),
+ ]
+ failures = ['a']
+ successes = [
+ ('', NS(x=None, y='spam')),
+ ('-x', NS(x=[], y='spam')),
+ ('-x a', NS(x=['a'], y='spam')),
+ ('-x a b', NS(x=['a', 'b'], y='spam')),
+ ('-y', NS(x=None, y=[])),
+ ('-y a', NS(x=None, y=['a'])),
+ ('-y a b', NS(x=None, y=['a', 'b'])),
+ ]
+
+
+class TestOptionalsNargsOneOrMore(ParserTestCase):
+ """Tests specifying an args for an Optional that accepts one or more"""
+
+ argument_signatures = [
+ Sig('-x', nargs='+'),
+ Sig('-y', nargs='+', default='spam'),
+ ]
+ failures = ['a', '-x', '-y', 'a -x', 'a -y b']
+ successes = [
+ ('', NS(x=None, y='spam')),
+ ('-x a', NS(x=['a'], y='spam')),
+ ('-x a b', NS(x=['a', 'b'], y='spam')),
+ ('-y a', NS(x=None, y=['a'])),
+ ('-y a b', NS(x=None, y=['a', 'b'])),
+ ]
+
+
+class TestOptionalsChoices(ParserTestCase):
+ """Tests specifying the choices for an Optional"""
+
+ argument_signatures = [
+ Sig('-f', choices='abc'),
+ Sig('-g', type=int, choices=range(5))]
+ failures = ['a', '-f d', '-fad', '-ga', '-g 6']
+ successes = [
+ ('', NS(f=None, g=None)),
+ ('-f a', NS(f='a', g=None)),
+ ('-f c', NS(f='c', g=None)),
+ ('-g 0', NS(f=None, g=0)),
+ ('-g 03', NS(f=None, g=3)),
+ ('-fb -g4', NS(f='b', g=4)),
+ ]
+
+
+class TestOptionalsRequired(ParserTestCase):
+ """Tests the an optional action that is required"""
+
+ argument_signatures = [
+ Sig('-x', type=int, required=True),
+ ]
+ failures = ['a', '']
+ successes = [
+ ('-x 1', NS(x=1)),
+ ('-x42', NS(x=42)),
+ ]
+
+
+class TestOptionalsActionStore(ParserTestCase):
+ """Tests the store action for an Optional"""
+
+ argument_signatures = [Sig('-x', action='store')]
+ failures = ['a', 'a -x']
+ successes = [
+ ('', NS(x=None)),
+ ('-xfoo', NS(x='foo')),
+ ]
+
+
+class TestOptionalsActionStoreConst(ParserTestCase):
+ """Tests the store_const action for an Optional"""
+
+ argument_signatures = [Sig('-y', action='store_const', const=object)]
+ failures = ['a']
+ successes = [
+ ('', NS(y=None)),
+ ('-y', NS(y=object)),
+ ]
+
+
+class TestOptionalsActionStoreFalse(ParserTestCase):
+ """Tests the store_false action for an Optional"""
+
+ argument_signatures = [Sig('-z', action='store_false')]
+ failures = ['a', '-za', '-z a']
+ successes = [
+ ('', NS(z=True)),
+ ('-z', NS(z=False)),
+ ]
+
+
+class TestOptionalsActionStoreTrue(ParserTestCase):
+ """Tests the store_true action for an Optional"""
+
+ argument_signatures = [Sig('--apple', action='store_true')]
+ failures = ['a', '--apple=b', '--apple b']
+ successes = [
+ ('', NS(apple=False)),
+ ('--apple', NS(apple=True)),
+ ]
+
+
+class TestOptionalsActionAppend(ParserTestCase):
+ """Tests the append action for an Optional"""
+
+ argument_signatures = [Sig('--baz', action='append')]
+ failures = ['a', '--baz', 'a --baz', '--baz a b']
+ successes = [
+ ('', NS(baz=None)),
+ ('--baz a', NS(baz=['a'])),
+ ('--baz a --baz b', NS(baz=['a', 'b'])),
+ ]
+
+
+class TestOptionalsActionAppendWithDefault(ParserTestCase):
+ """Tests the append action for an Optional"""
+
+ argument_signatures = [Sig('--baz', action='append', default=['X'])]
+ failures = ['a', '--baz', 'a --baz', '--baz a b']
+ successes = [
+ ('', NS(baz=['X'])),
+ ('--baz a', NS(baz=['X', 'a'])),
+ ('--baz a --baz b', NS(baz=['X', 'a', 'b'])),
+ ]
+
+
+class TestOptionalsActionAppendConst(ParserTestCase):
+ """Tests the append_const action for an Optional"""
+
+ argument_signatures = [
+ Sig('-b', action='append_const', const=Exception),
+ Sig('-c', action='append', dest='b'),
+ ]
+ failures = ['a', '-c', 'a -c', '-bx', '-b x']
+ successes = [
+ ('', NS(b=None)),
+ ('-b', NS(b=[Exception])),
+ ('-b -cx -b -cyz', NS(b=[Exception, 'x', Exception, 'yz'])),
+ ]
+
+
+class TestOptionalsActionAppendConstWithDefault(ParserTestCase):
+ """Tests the append_const action for an Optional"""
+
+ argument_signatures = [
+ Sig('-b', action='append_const', const=Exception, default=['X']),
+ Sig('-c', action='append', dest='b'),
+ ]
+ failures = ['a', '-c', 'a -c', '-bx', '-b x']
+ successes = [
+ ('', NS(b=['X'])),
+ ('-b', NS(b=['X', Exception])),
+ ('-b -cx -b -cyz', NS(b=['X', Exception, 'x', Exception, 'yz'])),
+ ]
+
+
+class TestOptionalsActionCount(ParserTestCase):
+ """Tests the count action for an Optional"""
+
+ argument_signatures = [Sig('-x', action='count')]
+ failures = ['a', '-x a', '-x b', '-x a -x b']
+ successes = [
+ ('', NS(x=None)),
+ ('-x', NS(x=1)),
+ ]
+
+
+# ================
+# Positional tests
+# ================
+
+class TestPositionalsNargsNone(ParserTestCase):
+ """Test a Positional that doesn't specify nargs"""
+
+ argument_signatures = [Sig('foo')]
+ failures = ['', '-x', 'a b']
+ successes = [
+ ('a', NS(foo='a')),
+ ]
+
+
+class TestPositionalsNargs1(ParserTestCase):
+ """Test a Positional that specifies an nargs of 1"""
+
+ argument_signatures = [Sig('foo', nargs=1)]
+ failures = ['', '-x', 'a b']
+ successes = [
+ ('a', NS(foo=['a'])),
+ ]
+
+
+class TestPositionalsNargs2(ParserTestCase):
+ """Test a Positional that specifies an nargs of 2"""
+
+ argument_signatures = [Sig('foo', nargs=2)]
+ failures = ['', 'a', '-x', 'a b c']
+ successes = [
+ ('a b', NS(foo=['a', 'b'])),
+ ]
+
+
+class TestPositionalsNargsZeroOrMore(ParserTestCase):
+ """Test a Positional that specifies unlimited nargs"""
+
+ argument_signatures = [Sig('foo', nargs='*')]
+ failures = ['-x']
+ successes = [
+ ('', NS(foo=[])),
+ ('a', NS(foo=['a'])),
+ ('a b', NS(foo=['a', 'b'])),
+ ]
+
+
+class TestPositionalsNargsZeroOrMoreDefault(ParserTestCase):
+ """Test a Positional that specifies unlimited nargs and a default"""
+
+ argument_signatures = [Sig('foo', nargs='*', default='bar')]
+ failures = ['-x']
+ successes = [
+ ('', NS(foo='bar')),
+ ('a', NS(foo=['a'])),
+ ('a b', NS(foo=['a', 'b'])),
+ ]
+
+
+class TestPositionalsNargsOneOrMore(ParserTestCase):
+ """Test a Positional that specifies one or more nargs"""
+
+ argument_signatures = [Sig('foo', nargs='+')]
+ failures = ['', '-x']
+ successes = [
+ ('a', NS(foo=['a'])),
+ ('a b', NS(foo=['a', 'b'])),
+ ]
+
+
+class TestPositionalsNargsOptional(ParserTestCase):
+ """Tests an Optional Positional"""
+
+ argument_signatures = [Sig('foo', nargs='?')]
+ failures = ['-x', 'a b']
+ successes = [
+ ('', NS(foo=None)),
+ ('a', NS(foo='a')),
+ ]
+
+
+class TestPositionalsNargsOptionalDefault(ParserTestCase):
+ """Tests an Optional Positional with a default value"""
+
+ argument_signatures = [Sig('foo', nargs='?', default=42)]
+ failures = ['-x', 'a b']
+ successes = [
+ ('', NS(foo=42)),
+ ('a', NS(foo='a')),
+ ]
+
+
+class TestPositionalsNargsOptionalConvertedDefault(ParserTestCase):
+ """Tests an Optional Positional with a default value
+ that needs to be converted to the appropriate type.
+ """
+
+ argument_signatures = [
+ Sig('foo', nargs='?', type=int, default='42'),
+ ]
+ failures = ['-x', 'a b', '1 2']
+ successes = [
+ ('', NS(foo=42)),
+ ('1', NS(foo=1)),
+ ]
+
+
+class TestPositionalsNargsNoneNone(ParserTestCase):
+ """Test two Positionals that don't specify nargs"""
+
+ argument_signatures = [Sig('foo'), Sig('bar')]
+ failures = ['', '-x', 'a', 'a b c']
+ successes = [
+ ('a b', NS(foo='a', bar='b')),
+ ]
+
+
+class TestPositionalsNargsNone1(ParserTestCase):
+ """Test a Positional with no nargs followed by one with 1"""
+
+ argument_signatures = [Sig('foo'), Sig('bar', nargs=1)]
+ failures = ['', '--foo', 'a', 'a b c']
+ successes = [
+ ('a b', NS(foo='a', bar=['b'])),
+ ]
+
+
+class TestPositionalsNargs2None(ParserTestCase):
+ """Test a Positional with 2 nargs followed by one with none"""
+
+ argument_signatures = [Sig('foo', nargs=2), Sig('bar')]
+ failures = ['', '--foo', 'a', 'a b', 'a b c d']
+ successes = [
+ ('a b c', NS(foo=['a', 'b'], bar='c')),
+ ]
+
+
+class TestPositionalsNargsNoneZeroOrMore(ParserTestCase):
+ """Test a Positional with no nargs followed by one with unlimited"""
+
+ argument_signatures = [Sig('foo'), Sig('bar', nargs='*')]
+ failures = ['', '--foo']
+ successes = [
+ ('a', NS(foo='a', bar=[])),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('a b c', NS(foo='a', bar=['b', 'c'])),
+ ]
+
+
+class TestPositionalsNargsNoneOneOrMore(ParserTestCase):
+ """Test a Positional with no nargs followed by one with one or more"""
+
+ argument_signatures = [Sig('foo'), Sig('bar', nargs='+')]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo='a', bar=['b'])),
+ ('a b c', NS(foo='a', bar=['b', 'c'])),
+ ]
+
+
+class TestPositionalsNargsNoneOptional(ParserTestCase):
+ """Test a Positional with no nargs followed by one with an Optional"""
+
+ argument_signatures = [Sig('foo'), Sig('bar', nargs='?')]
+ failures = ['', '--foo', 'a b c']
+ successes = [
+ ('a', NS(foo='a', bar=None)),
+ ('a b', NS(foo='a', bar='b')),
+ ]
+
+
+class TestPositionalsNargsZeroOrMoreNone(ParserTestCase):
+ """Test a Positional with unlimited nargs followed by one with none"""
+
+ argument_signatures = [Sig('foo', nargs='*'), Sig('bar')]
+ failures = ['', '--foo']
+ successes = [
+ ('a', NS(foo=[], bar='a')),
+ ('a b', NS(foo=['a'], bar='b')),
+ ('a b c', NS(foo=['a', 'b'], bar='c')),
+ ]
+
+
+class TestPositionalsNargsOneOrMoreNone(ParserTestCase):
+ """Test a Positional with one or more nargs followed by one with none"""
+
+ argument_signatures = [Sig('foo', nargs='+'), Sig('bar')]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo=['a'], bar='b')),
+ ('a b c', NS(foo=['a', 'b'], bar='c')),
+ ]
+
+
+class TestPositionalsNargsOptionalNone(ParserTestCase):
+ """Test a Positional with an Optional nargs followed by one with none"""
+
+ argument_signatures = [Sig('foo', nargs='?', default=42), Sig('bar')]
+ failures = ['', '--foo', 'a b c']
+ successes = [
+ ('a', NS(foo=42, bar='a')),
+ ('a b', NS(foo='a', bar='b')),
+ ]
+
+
+class TestPositionalsNargs2ZeroOrMore(ParserTestCase):
+ """Test a Positional with 2 nargs followed by one with unlimited"""
+
+ argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='*')]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo=['a', 'b'], bar=[])),
+ ('a b c', NS(foo=['a', 'b'], bar=['c'])),
+ ]
+
+
+class TestPositionalsNargs2OneOrMore(ParserTestCase):
+ """Test a Positional with 2 nargs followed by one with one or more"""
+
+ argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='+')]
+ failures = ['', '--foo', 'a', 'a b']
+ successes = [
+ ('a b c', NS(foo=['a', 'b'], bar=['c'])),
+ ]
+
+
+class TestPositionalsNargs2Optional(ParserTestCase):
+ """Test a Positional with 2 nargs followed by one optional"""
+
+ argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='?')]
+ failures = ['', '--foo', 'a', 'a b c d']
+ successes = [
+ ('a b', NS(foo=['a', 'b'], bar=None)),
+ ('a b c', NS(foo=['a', 'b'], bar='c')),
+ ]
+
+
+class TestPositionalsNargsZeroOrMore1(ParserTestCase):
+ """Test a Positional with unlimited nargs followed by one with 1"""
+
+ argument_signatures = [Sig('foo', nargs='*'), Sig('bar', nargs=1)]
+ failures = ['', '--foo', ]
+ successes = [
+ ('a', NS(foo=[], bar=['a'])),
+ ('a b', NS(foo=['a'], bar=['b'])),
+ ('a b c', NS(foo=['a', 'b'], bar=['c'])),
+ ]
+
+
+class TestPositionalsNargsOneOrMore1(ParserTestCase):
+ """Test a Positional with one or more nargs followed by one with 1"""
+
+ argument_signatures = [Sig('foo', nargs='+'), Sig('bar', nargs=1)]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo=['a'], bar=['b'])),
+ ('a b c', NS(foo=['a', 'b'], bar=['c'])),
+ ]
+
+
+class TestPositionalsNargsOptional1(ParserTestCase):
+ """Test a Positional with an Optional nargs followed by one with 1"""
+
+ argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs=1)]
+ failures = ['', '--foo', 'a b c']
+ successes = [
+ ('a', NS(foo=None, bar=['a'])),
+ ('a b', NS(foo='a', bar=['b'])),
+ ]
+
+
+class TestPositionalsNargsNoneZeroOrMore1(ParserTestCase):
+ """Test three Positionals: no nargs, unlimited nargs and 1 nargs"""
+
+ argument_signatures = [
+ Sig('foo'),
+ Sig('bar', nargs='*'),
+ Sig('baz', nargs=1),
+ ]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo='a', bar=[], baz=['b'])),
+ ('a b c', NS(foo='a', bar=['b'], baz=['c'])),
+ ]
+
+
+class TestPositionalsNargsNoneOneOrMore1(ParserTestCase):
+ """Test three Positionals: no nargs, one or more nargs and 1 nargs"""
+
+ argument_signatures = [
+ Sig('foo'),
+ Sig('bar', nargs='+'),
+ Sig('baz', nargs=1),
+ ]
+ failures = ['', '--foo', 'a', 'b']
+ successes = [
+ ('a b c', NS(foo='a', bar=['b'], baz=['c'])),
+ ('a b c d', NS(foo='a', bar=['b', 'c'], baz=['d'])),
+ ]
+
+
+class TestPositionalsNargsNoneOptional1(ParserTestCase):
+ """Test three Positionals: no nargs, optional narg and 1 nargs"""
+
+ argument_signatures = [
+ Sig('foo'),
+ Sig('bar', nargs='?', default=0.625),
+ Sig('baz', nargs=1),
+ ]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo='a', bar=0.625, baz=['b'])),
+ ('a b c', NS(foo='a', bar='b', baz=['c'])),
+ ]
+
+
+class TestPositionalsNargsOptionalOptional(ParserTestCase):
+ """Test two optional nargs"""
+
+ argument_signatures = [
+ Sig('foo', nargs='?'),
+ Sig('bar', nargs='?', default=42),
+ ]
+ failures = ['--foo', 'a b c']
+ successes = [
+ ('', NS(foo=None, bar=42)),
+ ('a', NS(foo='a', bar=42)),
+ ('a b', NS(foo='a', bar='b')),
+ ]
+
+
+class TestPositionalsNargsOptionalZeroOrMore(ParserTestCase):
+ """Test an Optional narg followed by unlimited nargs"""
+
+ argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs='*')]
+ failures = ['--foo']
+ successes = [
+ ('', NS(foo=None, bar=[])),
+ ('a', NS(foo='a', bar=[])),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('a b c', NS(foo='a', bar=['b', 'c'])),
+ ]
+
+
+class TestPositionalsNargsOptionalOneOrMore(ParserTestCase):
+ """Test an Optional narg followed by one or more nargs"""
+
+ argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs='+')]
+ failures = ['', '--foo']
+ successes = [
+ ('a', NS(foo=None, bar=['a'])),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('a b c', NS(foo='a', bar=['b', 'c'])),
+ ]
+
+
+class TestPositionalsChoicesString(ParserTestCase):
+ """Test a set of single-character choices"""
+
+ argument_signatures = [Sig('spam', choices=set('abcdefg'))]
+ failures = ['', '--foo', 'h', '42', 'ef']
+ successes = [
+ ('a', NS(spam='a')),
+ ('g', NS(spam='g')),
+ ]
+
+
+class TestPositionalsChoicesInt(ParserTestCase):
+ """Test a set of integer choices"""
+
+ argument_signatures = [Sig('spam', type=int, choices=range(20))]
+ failures = ['', '--foo', 'h', '42', 'ef']
+ successes = [
+ ('4', NS(spam=4)),
+ ('15', NS(spam=15)),
+ ]
+
+
+class TestPositionalsActionAppend(ParserTestCase):
+ """Test the 'append' action"""
+
+ argument_signatures = [
+ Sig('spam', action='append'),
+ Sig('spam', action='append', nargs=2),
+ ]
+ failures = ['', '--foo', 'a', 'a b', 'a b c d']
+ successes = [
+ ('a b c', NS(spam=['a', ['b', 'c']])),
+ ]
+
+# ========================================
+# Combined optionals and positionals tests
+# ========================================
+
+class TestOptionalsNumericAndPositionals(ParserTestCase):
+ """Tests negative number args when numeric options are present"""
+
+ argument_signatures = [
+ Sig('x', nargs='?'),
+ Sig('-4', dest='y', action='store_true'),
+ ]
+ failures = ['-2', '-315']
+ successes = [
+ ('', NS(x=None, y=False)),
+ ('a', NS(x='a', y=False)),
+ ('-4', NS(x=None, y=True)),
+ ('-4 a', NS(x='a', y=True)),
+ ]
+
+
+class TestOptionalsAlmostNumericAndPositionals(ParserTestCase):
+ """Tests negative number args when almost numeric options are present"""
+
+ argument_signatures = [
+ Sig('x', nargs='?'),
+ Sig('-k4', dest='y', action='store_true'),
+ ]
+ failures = ['-k3']
+ successes = [
+ ('', NS(x=None, y=False)),
+ ('-2', NS(x='-2', y=False)),
+ ('a', NS(x='a', y=False)),
+ ('-k4', NS(x=None, y=True)),
+ ('-k4 a', NS(x='a', y=True)),
+ ]
+
+
+class TestEmptyAndSpaceContainingArguments(ParserTestCase):
+
+ argument_signatures = [
+ Sig('x', nargs='?'),
+ Sig('-y', '--yyy', dest='y'),
+ ]
+ failures = ['-y']
+ successes = [
+ ([''], NS(x='', y=None)),
+ (['a badger'], NS(x='a badger', y=None)),
+ (['-a badger'], NS(x='-a badger', y=None)),
+ (['-y', ''], NS(x=None, y='')),
+ (['-y', 'a badger'], NS(x=None, y='a badger')),
+ (['-y', '-a badger'], NS(x=None, y='-a badger')),
+ (['--yyy=a badger'], NS(x=None, y='a badger')),
+ (['--yyy=-a badger'], NS(x=None, y='-a badger')),
+ ]
+
+
+class TestPrefixCharacterOnlyArguments(ParserTestCase):
+
+ parser_signature = Sig(prefix_chars='-+')
+ argument_signatures = [
+ Sig('-', dest='x', nargs='?', const='badger'),
+ Sig('+', dest='y', type=int, default=42),
+ Sig('-+-', dest='z', action='store_true'),
+ ]
+ failures = ['-y', '+ -']
+ successes = [
+ ('', NS(x=None, y=42, z=False)),
+ ('-', NS(x='badger', y=42, z=False)),
+ ('- X', NS(x='X', y=42, z=False)),
+ ('+ -3', NS(x=None, y=-3, z=False)),
+ ('-+-', NS(x=None, y=42, z=True)),
+ ('- ===', NS(x='===', y=42, z=False)),
+ ]
+
+
+class TestNargsZeroOrMore(ParserTestCase):
+ """Tests specifying an args for an Optional that accepts zero or more"""
+
+ argument_signatures = [Sig('-x', nargs='*'), Sig('y', nargs='*')]
+ failures = []
+ successes = [
+ ('', NS(x=None, y=[])),
+ ('-x', NS(x=[], y=[])),
+ ('-x a', NS(x=['a'], y=[])),
+ ('-x a -- b', NS(x=['a'], y=['b'])),
+ ('a', NS(x=None, y=['a'])),
+ ('a -x', NS(x=[], y=['a'])),
+ ('a -x b', NS(x=['b'], y=['a'])),
+ ]
+
+
+class TestNargsRemainder(ParserTestCase):
+ """Tests specifying a positional with nargs=REMAINDER"""
+
+ argument_signatures = [Sig('x'), Sig('y', nargs='...'), Sig('-z')]
+ failures = ['', '-z', '-z Z']
+ successes = [
+ ('X', NS(x='X', y=[], z=None)),
+ ('-z Z X', NS(x='X', y=[], z='Z')),
+ ('X A B -z Z', NS(x='X', y=['A', 'B', '-z', 'Z'], z=None)),
+ ('X Y --foo', NS(x='X', y=['Y', '--foo'], z=None)),
+ ]
+
+
+class TestOptionLike(ParserTestCase):
+ """Tests options that may or may not be arguments"""
+
+ argument_signatures = [
+ Sig('-x', type=float),
+ Sig('-3', type=float, dest='y'),
+ Sig('z', nargs='*'),
+ ]
+ failures = ['-x', '-y2.5', '-xa', '-x -a',
+ '-x -3', '-x -3.5', '-3 -3.5',
+ '-x -2.5', '-x -2.5 a', '-3 -.5',
+ 'a x -1', '-x -1 a', '-3 -1 a']
+ successes = [
+ ('', NS(x=None, y=None, z=[])),
+ ('-x 2.5', NS(x=2.5, y=None, z=[])),
+ ('-x 2.5 a', NS(x=2.5, y=None, z=['a'])),
+ ('-3.5', NS(x=None, y=0.5, z=[])),
+ ('-3-.5', NS(x=None, y=-0.5, z=[])),
+ ('-3 .5', NS(x=None, y=0.5, z=[])),
+ ('a -3.5', NS(x=None, y=0.5, z=['a'])),
+ ('a', NS(x=None, y=None, z=['a'])),
+ ('a -x 1', NS(x=1.0, y=None, z=['a'])),
+ ('-x 1 a', NS(x=1.0, y=None, z=['a'])),
+ ('-3 1 a', NS(x=None, y=1.0, z=['a'])),
+ ]
+
+
+class TestDefaultSuppress(ParserTestCase):
+ """Test actions with suppressed defaults"""
+
+ argument_signatures = [
+ Sig('foo', nargs='?', default=argparse.SUPPRESS),
+ Sig('bar', nargs='*', default=argparse.SUPPRESS),
+ Sig('--baz', action='store_true', default=argparse.SUPPRESS),
+ ]
+ failures = ['-x']
+ successes = [
+ ('', NS()),
+ ('a', NS(foo='a')),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('--baz', NS(baz=True)),
+ ('a --baz', NS(foo='a', baz=True)),
+ ('--baz a b', NS(foo='a', bar=['b'], baz=True)),
+ ]
+
+
+class TestParserDefaultSuppress(ParserTestCase):
+ """Test actions with a parser-level default of SUPPRESS"""
+
+ parser_signature = Sig(argument_default=argparse.SUPPRESS)
+ argument_signatures = [
+ Sig('foo', nargs='?'),
+ Sig('bar', nargs='*'),
+ Sig('--baz', action='store_true'),
+ ]
+ failures = ['-x']
+ successes = [
+ ('', NS()),
+ ('a', NS(foo='a')),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('--baz', NS(baz=True)),
+ ('a --baz', NS(foo='a', baz=True)),
+ ('--baz a b', NS(foo='a', bar=['b'], baz=True)),
+ ]
+
+
+class TestParserDefault42(ParserTestCase):
+ """Test actions with a parser-level default of 42"""
+
+ parser_signature = Sig(argument_default=42, version='1.0')
+ argument_signatures = [
+ Sig('foo', nargs='?'),
+ Sig('bar', nargs='*'),
+ Sig('--baz', action='store_true'),
+ ]
+ failures = ['-x']
+ successes = [
+ ('', NS(foo=42, bar=42, baz=42)),
+ ('a', NS(foo='a', bar=42, baz=42)),
+ ('a b', NS(foo='a', bar=['b'], baz=42)),
+ ('--baz', NS(foo=42, bar=42, baz=True)),
+ ('a --baz', NS(foo='a', bar=42, baz=True)),
+ ('--baz a b', NS(foo='a', bar=['b'], baz=True)),
+ ]
+
+
+class TestArgumentsFromFile(TempDirMixin, ParserTestCase):
+ """Test reading arguments from a file"""
+
+ def setUp(self):
+ super(TestArgumentsFromFile, self).setUp()
+ file_texts = [
+ ('hello', 'hello world!\n'),
+ ('recursive', '-a\n'
+ 'A\n'
+ '@hello'),
+ ('invalid', '@no-such-path\n'),
+ ]
+ for path, text in file_texts:
+ file = open(path, 'w')
+ file.write(text)
+ file.close()
+
+ parser_signature = Sig(fromfile_prefix_chars='@')
+ argument_signatures = [
+ Sig('-a'),
+ Sig('x'),
+ Sig('y', nargs='+'),
+ ]
+ failures = ['', '-b', 'X', '@invalid', '@missing']
+ successes = [
+ ('X Y', NS(a=None, x='X', y=['Y'])),
+ ('X -a A Y Z', NS(a='A', x='X', y=['Y', 'Z'])),
+ ('@hello X', NS(a=None, x='hello world!', y=['X'])),
+ ('X @hello', NS(a=None, x='X', y=['hello world!'])),
+ ('-a B @recursive Y Z', NS(a='A', x='hello world!', y=['Y', 'Z'])),
+ ('X @recursive Z -a B', NS(a='B', x='X', y=['hello world!', 'Z'])),
+ ]
+
+
+class TestArgumentsFromFileConverter(TempDirMixin, ParserTestCase):
+ """Test reading arguments from a file"""
+
+ def setUp(self):
+ super(TestArgumentsFromFileConverter, self).setUp()
+ file_texts = [
+ ('hello', 'hello world!\n'),
+ ]
+ for path, text in file_texts:
+ file = open(path, 'w')
+ file.write(text)
+ file.close()
+
+ class FromFileConverterArgumentParser(ErrorRaisingArgumentParser):
+
+ def convert_arg_line_to_args(self, arg_line):
+ for arg in arg_line.split():
+ if not arg.strip():
+ continue
+ yield arg
+ parser_class = FromFileConverterArgumentParser
+ parser_signature = Sig(fromfile_prefix_chars='@')
+ argument_signatures = [
+ Sig('y', nargs='+'),
+ ]
+ failures = []
+ successes = [
+ ('@hello X', NS(y=['hello', 'world!', 'X'])),
+ ]
+
+
+# =====================
+# Type conversion tests
+# =====================
+
+class TestFileTypeRepr(TestCase):
+
+ def test_r(self):
+ type = argparse.FileType('r')
+ self.assertEqual("FileType('r')", repr(type))
+
+ def test_wb_1(self):
+ type = argparse.FileType('wb', 1)
+ self.assertEqual("FileType('wb', 1)", repr(type))
+
+
+class RFile(object):
+ seen = {}
+
+ def __init__(self, name):
+ self.name = name
+
+ def __eq__(self, other):
+ if other in self.seen:
+ text = self.seen[other]
+ else:
+ text = self.seen[other] = other.read()
+ other.close()
+ if not isinstance(text, str):
+ text = text.decode('ascii')
+ return self.name == other.name == text
+
+
+class TestFileTypeR(TempDirMixin, ParserTestCase):
+ """Test the FileType option/argument type for reading files"""
+
+ def setUp(self):
+ super(TestFileTypeR, self).setUp()
+ for file_name in ['foo', 'bar']:
+ file = open(os.path.join(self.temp_dir, file_name), 'w')
+ file.write(file_name)
+ file.close()
+ self.create_readonly_file('readonly')
+
+ argument_signatures = [
+ Sig('-x', type=argparse.FileType()),
+ Sig('spam', type=argparse.FileType('r')),
+ ]
+ failures = ['-x', '', 'non-existent-file.txt']
+ successes = [
+ ('foo', NS(x=None, spam=RFile('foo'))),
+ ('-x foo bar', NS(x=RFile('foo'), spam=RFile('bar'))),
+ ('bar -x foo', NS(x=RFile('foo'), spam=RFile('bar'))),
+ ('-x - -', NS(x=sys.stdin, spam=sys.stdin)),
+ ('readonly', NS(x=None, spam=RFile('readonly'))),
+ ]
+
+
+class TestFileTypeRB(TempDirMixin, ParserTestCase):
+ """Test the FileType option/argument type for reading files"""
+
+ def setUp(self):
+ super(TestFileTypeRB, self).setUp()
+ for file_name in ['foo', 'bar']:
+ file = open(os.path.join(self.temp_dir, file_name), 'w')
+ file.write(file_name)
+ file.close()
+
+ argument_signatures = [
+ Sig('-x', type=argparse.FileType('rb')),
+ Sig('spam', type=argparse.FileType('rb')),
+ ]
+ failures = ['-x', '']
+ successes = [
+ ('foo', NS(x=None, spam=RFile('foo'))),
+ ('-x foo bar', NS(x=RFile('foo'), spam=RFile('bar'))),
+ ('bar -x foo', NS(x=RFile('foo'), spam=RFile('bar'))),
+ ('-x - -', NS(x=sys.stdin, spam=sys.stdin)),
+ ]
+
+
+class WFile(object):
+ seen = set()
+
+ def __init__(self, name):
+ self.name = name
+
+ def __eq__(self, other):
+ if other not in self.seen:
+ text = 'Check that file is writable.'
+ if 'b' in other.mode:
+ text = text.encode('ascii')
+ other.write(text)
+ other.close()
+ self.seen.add(other)
+ return self.name == other.name
+
+
+class TestFileTypeW(TempDirMixin, ParserTestCase):
+ """Test the FileType option/argument type for writing files"""
+
+ def setUp(self):
+ super(TestFileTypeW, self).setUp()
+ self.create_readonly_file('readonly')
+
+ argument_signatures = [
+ Sig('-x', type=argparse.FileType('w')),
+ Sig('spam', type=argparse.FileType('w')),
+ ]
+ failures = ['-x', '', 'readonly']
+ successes = [
+ ('foo', NS(x=None, spam=WFile('foo'))),
+ ('-x foo bar', NS(x=WFile('foo'), spam=WFile('bar'))),
+ ('bar -x foo', NS(x=WFile('foo'), spam=WFile('bar'))),
+ ('-x - -', NS(x=sys.stdout, spam=sys.stdout)),
+ ]
+
+
+class TestFileTypeWB(TempDirMixin, ParserTestCase):
+
+ argument_signatures = [
+ Sig('-x', type=argparse.FileType('wb')),
+ Sig('spam', type=argparse.FileType('wb')),
+ ]
+ failures = ['-x', '']
+ successes = [
+ ('foo', NS(x=None, spam=WFile('foo'))),
+ ('-x foo bar', NS(x=WFile('foo'), spam=WFile('bar'))),
+ ('bar -x foo', NS(x=WFile('foo'), spam=WFile('bar'))),
+ ('-x - -', NS(x=sys.stdout, spam=sys.stdout)),
+ ]
+
+
+class TestTypeCallable(ParserTestCase):
+ """Test some callables as option/argument types"""
+
+ argument_signatures = [
+ Sig('--eggs', type=complex),
+ Sig('spam', type=float),
+ ]
+ failures = ['a', '42j', '--eggs a', '--eggs 2i']
+ successes = [
+ ('--eggs=42 42', NS(eggs=42, spam=42.0)),
+ ('--eggs 2j -- -1.5', NS(eggs=2j, spam=-1.5)),
+ ('1024.675', NS(eggs=None, spam=1024.675)),
+ ]
+
+
+class TestTypeUserDefined(ParserTestCase):
+ """Test a user-defined option/argument type"""
+
+ class MyType(TestCase):
+
+ def __init__(self, value):
+ self.value = value
+
+ def __eq__(self, other):
+ return (type(self), self.value) == (type(other), other.value)
+
+ argument_signatures = [
+ Sig('-x', type=MyType),
+ Sig('spam', type=MyType),
+ ]
+ failures = []
+ successes = [
+ ('a -x b', NS(x=MyType('b'), spam=MyType('a'))),
+ ('-xf g', NS(x=MyType('f'), spam=MyType('g'))),
+ ]
+
+
+class TestTypeClassicClass(ParserTestCase):
+ """Test a classic class type"""
+
+ class C:
+
+ def __init__(self, value):
+ self.value = value
+
+ def __eq__(self, other):
+ return (type(self), self.value) == (type(other), other.value)
+
+ argument_signatures = [
+ Sig('-x', type=C),
+ Sig('spam', type=C),
+ ]
+ failures = []
+ successes = [
+ ('a -x b', NS(x=C('b'), spam=C('a'))),
+ ('-xf g', NS(x=C('f'), spam=C('g'))),
+ ]
+
+
+class TestTypeRegistration(TestCase):
+ """Test a user-defined type by registering it"""
+
+ def test(self):
+
+ def get_my_type(string):
+ return 'my_type{%s}' % string
+
+ parser = argparse.ArgumentParser()
+ parser.register('type', 'my_type', get_my_type)
+ parser.add_argument('-x', type='my_type')
+ parser.add_argument('y', type='my_type')
+
+ self.assertEqual(parser.parse_args('1'.split()),
+ NS(x=None, y='my_type{1}'))
+ self.assertEqual(parser.parse_args('-x 1 42'.split()),
+ NS(x='my_type{1}', y='my_type{42}'))
+
+
+# ============
+# Action tests
+# ============
+
+class TestActionUserDefined(ParserTestCase):
+ """Test a user-defined option/argument action"""
+
+ class OptionalAction(argparse.Action):
+
+ def __call__(self, parser, namespace, value, option_string=None):
+ try:
+ # check destination and option string
+ assert self.dest == 'spam', 'dest: %s' % self.dest
+ assert option_string == '-s', 'flag: %s' % option_string
+ # when option is before argument, badger=2, and when
+ # option is after argument, badger=<whatever was set>
+ expected_ns = NS(spam=0.25)
+ if value in [0.125, 0.625]:
+ expected_ns.badger = 2
+ elif value in [2.0]:
+ expected_ns.badger = 84
+ else:
+ raise AssertionError('value: %s' % value)
+ assert expected_ns == namespace, ('expected %s, got %s' %
+ (expected_ns, namespace))
+ except AssertionError:
+ e = sys.exc_info()[1]
+ raise ArgumentParserError('opt_action failed: %s' % e)
+ setattr(namespace, 'spam', value)
+
+ class PositionalAction(argparse.Action):
+
+ def __call__(self, parser, namespace, value, option_string=None):
+ try:
+ assert option_string is None, ('option_string: %s' %
+ option_string)
+ # check destination
+ assert self.dest == 'badger', 'dest: %s' % self.dest
+ # when argument is before option, spam=0.25, and when
+ # option is after argument, spam=<whatever was set>
+ expected_ns = NS(badger=2)
+ if value in [42, 84]:
+ expected_ns.spam = 0.25
+ elif value in [1]:
+ expected_ns.spam = 0.625
+ elif value in [2]:
+ expected_ns.spam = 0.125
+ else:
+ raise AssertionError('value: %s' % value)
+ assert expected_ns == namespace, ('expected %s, got %s' %
+ (expected_ns, namespace))
+ except AssertionError:
+ e = sys.exc_info()[1]
+ raise ArgumentParserError('arg_action failed: %s' % e)
+ setattr(namespace, 'badger', value)
+
+ argument_signatures = [
+ Sig('-s', dest='spam', action=OptionalAction,
+ type=float, default=0.25),
+ Sig('badger', action=PositionalAction,
+ type=int, nargs='?', default=2),
+ ]
+ failures = []
+ successes = [
+ ('-s0.125', NS(spam=0.125, badger=2)),
+ ('42', NS(spam=0.25, badger=42)),
+ ('-s 0.625 1', NS(spam=0.625, badger=1)),
+ ('84 -s2', NS(spam=2.0, badger=84)),
+ ]
+
+
+class TestActionRegistration(TestCase):
+ """Test a user-defined action supplied by registering it"""
+
+ class MyAction(argparse.Action):
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ setattr(namespace, self.dest, 'foo[%s]' % values)
+
+ def test(self):
+
+ parser = argparse.ArgumentParser()
+ parser.register('action', 'my_action', self.MyAction)
+ parser.add_argument('badger', action='my_action')
+
+ self.assertEqual(parser.parse_args(['1']), NS(badger='foo[1]'))
+ self.assertEqual(parser.parse_args(['42']), NS(badger='foo[42]'))
+
+
+# ================
+# Subparsers tests
+# ================
+
+class TestAddSubparsers(TestCase):
+ """Test the add_subparsers method"""
+
+ def assertArgumentParserError(self, *args, **kwargs):
+ self.assertRaises(ArgumentParserError, *args, **kwargs)
+
+ def _get_parser(self, subparser_help=False, prefix_chars=None,
+ aliases=False):
+ # create a parser with a subparsers argument
+ if prefix_chars:
+ parser = ErrorRaisingArgumentParser(
+ prog='PROG', description='main description', prefix_chars=prefix_chars)
+ parser.add_argument(
+ prefix_chars[0] * 2 + 'foo', action='store_true', help='foo help')
+ else:
+ parser = ErrorRaisingArgumentParser(
+ prog='PROG', description='main description')
+ parser.add_argument(
+ '--foo', action='store_true', help='foo help')
+ parser.add_argument(
+ 'bar', type=float, help='bar help')
+
+ # check that only one subparsers argument can be added
+ subparsers_kwargs = {}
+ if aliases:
+ subparsers_kwargs['metavar'] = 'COMMAND'
+ subparsers_kwargs['title'] = 'commands'
+ else:
+ subparsers_kwargs['help'] = 'command help'
+ subparsers = parser.add_subparsers(**subparsers_kwargs)
+ self.assertArgumentParserError(parser.add_subparsers)
+
+ # add first sub-parser
+ parser1_kwargs = dict(description='1 description')
+ if subparser_help:
+ parser1_kwargs['help'] = '1 help'
+ if aliases:
+ parser1_kwargs['aliases'] = ['1alias1', '1alias2']
+ parser1 = subparsers.add_parser('1', **parser1_kwargs)
+ parser1.add_argument('-w', type=int, help='w help')
+ parser1.add_argument('x', choices='abc', help='x help')
+
+ # add second sub-parser
+ parser2_kwargs = dict(description='2 description')
+ if subparser_help:
+ parser2_kwargs['help'] = '2 help'
+ parser2 = subparsers.add_parser('2', **parser2_kwargs)
+ parser2.add_argument('-y', choices='123', help='y help')
+ parser2.add_argument('z', type=complex, nargs='*', help='z help')
+
+ # return the main parser
+ return parser
+
+ def setUp(self):
+ super().setUp()
+ self.parser = self._get_parser()
+ self.command_help_parser = self._get_parser(subparser_help=True)
+
+ def test_parse_args_failures(self):
+ # check some failure cases:
+ for args_str in ['', 'a', 'a a', '0.5 a', '0.5 1',
+ '0.5 1 -y', '0.5 2 -w']:
+ args = args_str.split()
+ self.assertArgumentParserError(self.parser.parse_args, args)
+
+ def test_parse_args(self):
+ # check some non-failure cases:
+ self.assertEqual(
+ self.parser.parse_args('0.5 1 b -w 7'.split()),
+ NS(foo=False, bar=0.5, w=7, x='b'),
+ )
+ self.assertEqual(
+ self.parser.parse_args('0.25 --foo 2 -y 2 3j -- -1j'.split()),
+ NS(foo=True, bar=0.25, y='2', z=[3j, -1j]),
+ )
+ self.assertEqual(
+ self.parser.parse_args('--foo 0.125 1 c'.split()),
+ NS(foo=True, bar=0.125, w=None, x='c'),
+ )
+
+ def test_parse_known_args(self):
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 1 b -w 7'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), []),
+ )
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 -p 1 b -w 7'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), ['-p']),
+ )
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 1 b -w 7 -p'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), ['-p']),
+ )
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 1 b -q -rs -w 7'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), ['-q', '-rs']),
+ )
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 -W 1 b -X Y -w 7 Z'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), ['-W', '-X', 'Y', 'Z']),
+ )
+
+ def test_dest(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.add_argument('--foo', action='store_true')
+ subparsers = parser.add_subparsers(dest='bar')
+ parser1 = subparsers.add_parser('1')
+ parser1.add_argument('baz')
+ self.assertEqual(NS(foo=False, bar='1', baz='2'),
+ parser.parse_args('1 2'.split()))
+
+ def test_help(self):
+ self.assertEqual(self.parser.format_usage(),
+ 'usage: PROG [-h] [--foo] bar {1,2} ...\n')
+ self.assertEqual(self.parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [--foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+ {1,2} command help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo foo help
+ '''))
+
+ def test_help_extra_prefix_chars(self):
+ # Make sure - is still used for help if it is a non-first prefix char
+ parser = self._get_parser(prefix_chars='+:-')
+ self.assertEqual(parser.format_usage(),
+ 'usage: PROG [-h] [++foo] bar {1,2} ...\n')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [++foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+ {1,2} command help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ ++foo foo help
+ '''))
+
+
+ def test_help_alternate_prefix_chars(self):
+ parser = self._get_parser(prefix_chars='+:/')
+ self.assertEqual(parser.format_usage(),
+ 'usage: PROG [+h] [++foo] bar {1,2} ...\n')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [+h] [++foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+ {1,2} command help
+
+ optional arguments:
+ +h, ++help show this help message and exit
+ ++foo foo help
+ '''))
+
+ def test_parser_command_help(self):
+ self.assertEqual(self.command_help_parser.format_usage(),
+ 'usage: PROG [-h] [--foo] bar {1,2} ...\n')
+ self.assertEqual(self.command_help_parser.format_help(),
+ textwrap.dedent('''\
+ usage: PROG [-h] [--foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+ {1,2} command help
+ 1 1 help
+ 2 2 help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo foo help
+ '''))
+
+ def test_subparser_title_help(self):
+ parser = ErrorRaisingArgumentParser(prog='PROG',
+ description='main description')
+ parser.add_argument('--foo', action='store_true', help='foo help')
+ parser.add_argument('bar', help='bar help')
+ subparsers = parser.add_subparsers(title='subcommands',
+ description='command help',
+ help='additional text')
+ parser1 = subparsers.add_parser('1')
+ parser2 = subparsers.add_parser('2')
+ self.assertEqual(parser.format_usage(),
+ 'usage: PROG [-h] [--foo] bar {1,2} ...\n')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [--foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo foo help
+
+ subcommands:
+ command help
+
+ {1,2} additional text
+ '''))
+
+ def _test_subparser_help(self, args_str, expected_help):
+ try:
+ self.parser.parse_args(args_str.split())
+ except ArgumentParserError:
+ err = sys.exc_info()[1]
+ if err.stdout != expected_help:
+ print(repr(expected_help))
+ print(repr(err.stdout))
+ self.assertEqual(err.stdout, expected_help)
+
+ def test_subparser1_help(self):
+ self._test_subparser_help('5.0 1 -h', textwrap.dedent('''\
+ usage: PROG bar 1 [-h] [-w W] {a,b,c}
+
+ 1 description
+
+ positional arguments:
+ {a,b,c} x help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w W w help
+ '''))
+
+ def test_subparser2_help(self):
+ self._test_subparser_help('5.0 2 -h', textwrap.dedent('''\
+ usage: PROG bar 2 [-h] [-y {1,2,3}] [z [z ...]]
+
+ 2 description
+
+ positional arguments:
+ z z help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -y {1,2,3} y help
+ '''))
+
+ def test_alias_invocation(self):
+ parser = self._get_parser(aliases=True)
+ self.assertEqual(
+ parser.parse_known_args('0.5 1alias1 b'.split()),
+ (NS(foo=False, bar=0.5, w=None, x='b'), []),
+ )
+ self.assertEqual(
+ parser.parse_known_args('0.5 1alias2 b'.split()),
+ (NS(foo=False, bar=0.5, w=None, x='b'), []),
+ )
+
+ def test_error_alias_invocation(self):
+ parser = self._get_parser(aliases=True)
+ self.assertArgumentParserError(parser.parse_args,
+ '0.5 1alias3 b'.split())
+
+ def test_alias_help(self):
+ parser = self._get_parser(aliases=True, subparser_help=True)
+ self.maxDiff = None
+ self.assertEqual(parser.format_help(), textwrap.dedent("""\
+ usage: PROG [-h] [--foo] bar COMMAND ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo foo help
+
+ commands:
+ COMMAND
+ 1 (1alias1, 1alias2)
+ 1 help
+ 2 2 help
+ """))
+
+# ============
+# Groups tests
+# ============
+
+class TestPositionalsGroups(TestCase):
+ """Tests that order of group positionals matches construction order"""
+
+ def test_nongroup_first(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.add_argument('foo')
+ group = parser.add_argument_group('g')
+ group.add_argument('bar')
+ parser.add_argument('baz')
+ expected = NS(foo='1', bar='2', baz='3')
+ result = parser.parse_args('1 2 3'.split())
+ self.assertEqual(expected, result)
+
+ def test_group_first(self):
+ parser = ErrorRaisingArgumentParser()
+ group = parser.add_argument_group('xxx')
+ group.add_argument('foo')
+ parser.add_argument('bar')
+ parser.add_argument('baz')
+ expected = NS(foo='1', bar='2', baz='3')
+ result = parser.parse_args('1 2 3'.split())
+ self.assertEqual(expected, result)
+
+ def test_interleaved_groups(self):
+ parser = ErrorRaisingArgumentParser()
+ group = parser.add_argument_group('xxx')
+ parser.add_argument('foo')
+ group.add_argument('bar')
+ parser.add_argument('baz')
+ group = parser.add_argument_group('yyy')
+ group.add_argument('frell')
+ expected = NS(foo='1', bar='2', baz='3', frell='4')
+ result = parser.parse_args('1 2 3 4'.split())
+ self.assertEqual(expected, result)
+
+# ===================
+# Parent parser tests
+# ===================
+
+class TestParentParsers(TestCase):
+ """Tests that parsers can be created with parent parsers"""
+
+ def assertArgumentParserError(self, *args, **kwargs):
+ self.assertRaises(ArgumentParserError, *args, **kwargs)
+
+ def setUp(self):
+ super().setUp()
+ self.wxyz_parent = ErrorRaisingArgumentParser(add_help=False)
+ self.wxyz_parent.add_argument('--w')
+ x_group = self.wxyz_parent.add_argument_group('x')
+ x_group.add_argument('-y')
+ self.wxyz_parent.add_argument('z')
+
+ self.abcd_parent = ErrorRaisingArgumentParser(add_help=False)
+ self.abcd_parent.add_argument('a')
+ self.abcd_parent.add_argument('-b')
+ c_group = self.abcd_parent.add_argument_group('c')
+ c_group.add_argument('--d')
+
+ self.w_parent = ErrorRaisingArgumentParser(add_help=False)
+ self.w_parent.add_argument('--w')
+
+ self.z_parent = ErrorRaisingArgumentParser(add_help=False)
+ self.z_parent.add_argument('z')
+
+ # parents with mutually exclusive groups
+ self.ab_mutex_parent = ErrorRaisingArgumentParser(add_help=False)
+ group = self.ab_mutex_parent.add_mutually_exclusive_group()
+ group.add_argument('-a', action='store_true')
+ group.add_argument('-b', action='store_true')
+
+ self.main_program = os.path.basename(sys.argv[0])
+
+ def test_single_parent(self):
+ parser = ErrorRaisingArgumentParser(parents=[self.wxyz_parent])
+ self.assertEqual(parser.parse_args('-y 1 2 --w 3'.split()),
+ NS(w='3', y='1', z='2'))
+
+ def test_single_parent_mutex(self):
+ self._test_mutex_ab(self.ab_mutex_parent.parse_args)
+ parser = ErrorRaisingArgumentParser(parents=[self.ab_mutex_parent])
+ self._test_mutex_ab(parser.parse_args)
+
+ def test_single_granparent_mutex(self):
+ parents = [self.ab_mutex_parent]
+ parser = ErrorRaisingArgumentParser(add_help=False, parents=parents)
+ parser = ErrorRaisingArgumentParser(parents=[parser])
+ self._test_mutex_ab(parser.parse_args)
+
+ def _test_mutex_ab(self, parse_args):
+ self.assertEqual(parse_args([]), NS(a=False, b=False))
+ self.assertEqual(parse_args(['-a']), NS(a=True, b=False))
+ self.assertEqual(parse_args(['-b']), NS(a=False, b=True))
+ self.assertArgumentParserError(parse_args, ['-a', '-b'])
+ self.assertArgumentParserError(parse_args, ['-b', '-a'])
+ self.assertArgumentParserError(parse_args, ['-c'])
+ self.assertArgumentParserError(parse_args, ['-a', '-c'])
+ self.assertArgumentParserError(parse_args, ['-b', '-c'])
+
+ def test_multiple_parents(self):
+ parents = [self.abcd_parent, self.wxyz_parent]
+ parser = ErrorRaisingArgumentParser(parents=parents)
+ self.assertEqual(parser.parse_args('--d 1 --w 2 3 4'.split()),
+ NS(a='3', b=None, d='1', w='2', y=None, z='4'))
+
+ def test_multiple_parents_mutex(self):
+ parents = [self.ab_mutex_parent, self.wxyz_parent]
+ parser = ErrorRaisingArgumentParser(parents=parents)
+ self.assertEqual(parser.parse_args('-a --w 2 3'.split()),
+ NS(a=True, b=False, w='2', y=None, z='3'))
+ self.assertArgumentParserError(
+ parser.parse_args, '-a --w 2 3 -b'.split())
+ self.assertArgumentParserError(
+ parser.parse_args, '-a -b --w 2 3'.split())
+
+ def test_conflicting_parents(self):
+ self.assertRaises(
+ argparse.ArgumentError,
+ argparse.ArgumentParser,
+ parents=[self.w_parent, self.wxyz_parent])
+
+ def test_conflicting_parents_mutex(self):
+ self.assertRaises(
+ argparse.ArgumentError,
+ argparse.ArgumentParser,
+ parents=[self.abcd_parent, self.ab_mutex_parent])
+
+ def test_same_argument_name_parents(self):
+ parents = [self.wxyz_parent, self.z_parent]
+ parser = ErrorRaisingArgumentParser(parents=parents)
+ self.assertEqual(parser.parse_args('1 2'.split()),
+ NS(w=None, y=None, z='2'))
+
+ def test_subparser_parents(self):
+ parser = ErrorRaisingArgumentParser()
+ subparsers = parser.add_subparsers()
+ abcde_parser = subparsers.add_parser('bar', parents=[self.abcd_parent])
+ abcde_parser.add_argument('e')
+ self.assertEqual(parser.parse_args('bar -b 1 --d 2 3 4'.split()),
+ NS(a='3', b='1', d='2', e='4'))
+
+ def test_subparser_parents_mutex(self):
+ parser = ErrorRaisingArgumentParser()
+ subparsers = parser.add_subparsers()
+ parents = [self.ab_mutex_parent]
+ abc_parser = subparsers.add_parser('foo', parents=parents)
+ c_group = abc_parser.add_argument_group('c_group')
+ c_group.add_argument('c')
+ parents = [self.wxyz_parent, self.ab_mutex_parent]
+ wxyzabe_parser = subparsers.add_parser('bar', parents=parents)
+ wxyzabe_parser.add_argument('e')
+ self.assertEqual(parser.parse_args('foo -a 4'.split()),
+ NS(a=True, b=False, c='4'))
+ self.assertEqual(parser.parse_args('bar -b --w 2 3 4'.split()),
+ NS(a=False, b=True, w='2', y=None, z='3', e='4'))
+ self.assertArgumentParserError(
+ parser.parse_args, 'foo -a -b 4'.split())
+ self.assertArgumentParserError(
+ parser.parse_args, 'bar -b -a 4'.split())
+
+ def test_parent_help(self):
+ parents = [self.abcd_parent, self.wxyz_parent]
+ parser = ErrorRaisingArgumentParser(parents=parents)
+ parser_help = parser.format_help()
+ self.assertEqual(parser_help, textwrap.dedent('''\
+ usage: {} [-h] [-b B] [--d D] [--w W] [-y Y] a z
+
+ positional arguments:
+ a
+ z
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -b B
+ --w W
+
+ c:
+ --d D
+
+ x:
+ -y Y
+ '''.format(self.main_program)))
+
+ def test_groups_parents(self):
+ parent = ErrorRaisingArgumentParser(add_help=False)
+ g = parent.add_argument_group(title='g', description='gd')
+ g.add_argument('-w')
+ g.add_argument('-x')
+ m = parent.add_mutually_exclusive_group()
+ m.add_argument('-y')
+ m.add_argument('-z')
+ parser = ErrorRaisingArgumentParser(parents=[parent])
+
+ self.assertRaises(ArgumentParserError, parser.parse_args,
+ ['-y', 'Y', '-z', 'Z'])
+
+ parser_help = parser.format_help()
+ self.assertEqual(parser_help, textwrap.dedent('''\
+ usage: {} [-h] [-w W] [-x X] [-y Y | -z Z]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -y Y
+ -z Z
+
+ g:
+ gd
+
+ -w W
+ -x X
+ '''.format(self.main_program)))
+
+# ==============================
+# Mutually exclusive group tests
+# ==============================
+
+class TestMutuallyExclusiveGroupErrors(TestCase):
+
+ def test_invalid_add_argument_group(self):
+ parser = ErrorRaisingArgumentParser()
+ raises = self.assertRaises
+ raises(TypeError, parser.add_mutually_exclusive_group, title='foo')
+
+ def test_invalid_add_argument(self):
+ parser = ErrorRaisingArgumentParser()
+ group = parser.add_mutually_exclusive_group()
+ add_argument = group.add_argument
+ raises = self.assertRaises
+ raises(ValueError, add_argument, '--foo', required=True)
+ raises(ValueError, add_argument, 'bar')
+ raises(ValueError, add_argument, 'bar', nargs='+')
+ raises(ValueError, add_argument, 'bar', nargs=1)
+ raises(ValueError, add_argument, 'bar', nargs=argparse.PARSER)
+
+ def test_help(self):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group1 = parser.add_mutually_exclusive_group()
+ group1.add_argument('--foo', action='store_true')
+ group1.add_argument('--bar', action='store_false')
+ group2 = parser.add_mutually_exclusive_group()
+ group2.add_argument('--soup', action='store_true')
+ group2.add_argument('--nuts', action='store_false')
+ expected = '''\
+ usage: PROG [-h] [--foo | --bar] [--soup | --nuts]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo
+ --bar
+ --soup
+ --nuts
+ '''
+ self.assertEqual(parser.format_help(), textwrap.dedent(expected))
+
+class MEMixin(object):
+
+ def test_failures_when_not_required(self):
+ parse_args = self.get_parser(required=False).parse_args
+ error = ArgumentParserError
+ for args_string in self.failures:
+ self.assertRaises(error, parse_args, args_string.split())
+
+ def test_failures_when_required(self):
+ parse_args = self.get_parser(required=True).parse_args
+ error = ArgumentParserError
+ for args_string in self.failures + ['']:
+ self.assertRaises(error, parse_args, args_string.split())
+
+ def test_successes_when_not_required(self):
+ parse_args = self.get_parser(required=False).parse_args
+ successes = self.successes + self.successes_when_not_required
+ for args_string, expected_ns in successes:
+ actual_ns = parse_args(args_string.split())
+ self.assertEqual(actual_ns, expected_ns)
+
+ def test_successes_when_required(self):
+ parse_args = self.get_parser(required=True).parse_args
+ for args_string, expected_ns in self.successes:
+ actual_ns = parse_args(args_string.split())
+ self.assertEqual(actual_ns, expected_ns)
+
+ def test_usage_when_not_required(self):
+ format_usage = self.get_parser(required=False).format_usage
+ expected_usage = self.usage_when_not_required
+ self.assertEqual(format_usage(), textwrap.dedent(expected_usage))
+
+ def test_usage_when_required(self):
+ format_usage = self.get_parser(required=True).format_usage
+ expected_usage = self.usage_when_required
+ self.assertEqual(format_usage(), textwrap.dedent(expected_usage))
+
+ def test_help_when_not_required(self):
+ format_help = self.get_parser(required=False).format_help
+ help = self.usage_when_not_required + self.help
+ self.assertEqual(format_help(), textwrap.dedent(help))
+
+ def test_help_when_required(self):
+ format_help = self.get_parser(required=True).format_help
+ help = self.usage_when_required + self.help
+ self.assertEqual(format_help(), textwrap.dedent(help))
+
+
+class TestMutuallyExclusiveSimple(MEMixin, TestCase):
+
+ def get_parser(self, required=None):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('--bar', help='bar help')
+ group.add_argument('--baz', nargs='?', const='Z', help='baz help')
+ return parser
+
+ failures = ['--bar X --baz Y', '--bar X --baz']
+ successes = [
+ ('--bar X', NS(bar='X', baz=None)),
+ ('--bar X --bar Z', NS(bar='Z', baz=None)),
+ ('--baz Y', NS(bar=None, baz='Y')),
+ ('--baz', NS(bar=None, baz='Z')),
+ ]
+ successes_when_not_required = [
+ ('', NS(bar=None, baz=None)),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [--bar BAR | --baz [BAZ]]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] (--bar BAR | --baz [BAZ])
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --bar BAR bar help
+ --baz [BAZ] baz help
+ '''
+
+
+class TestMutuallyExclusiveLong(MEMixin, TestCase):
+
+ def get_parser(self, required=None):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ parser.add_argument('--abcde', help='abcde help')
+ parser.add_argument('--fghij', help='fghij help')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('--klmno', help='klmno help')
+ group.add_argument('--pqrst', help='pqrst help')
+ return parser
+
+ failures = ['--klmno X --pqrst Y']
+ successes = [
+ ('--klmno X', NS(abcde=None, fghij=None, klmno='X', pqrst=None)),
+ ('--abcde Y --klmno X',
+ NS(abcde='Y', fghij=None, klmno='X', pqrst=None)),
+ ('--pqrst X', NS(abcde=None, fghij=None, klmno=None, pqrst='X')),
+ ('--pqrst X --fghij Y',
+ NS(abcde=None, fghij='Y', klmno=None, pqrst='X')),
+ ]
+ successes_when_not_required = [
+ ('', NS(abcde=None, fghij=None, klmno=None, pqrst=None)),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [--abcde ABCDE] [--fghij FGHIJ]
+ [--klmno KLMNO | --pqrst PQRST]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] [--abcde ABCDE] [--fghij FGHIJ]
+ (--klmno KLMNO | --pqrst PQRST)
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --abcde ABCDE abcde help
+ --fghij FGHIJ fghij help
+ --klmno KLMNO klmno help
+ --pqrst PQRST pqrst help
+ '''
+
+
+class TestMutuallyExclusiveFirstSuppressed(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('-x', help=argparse.SUPPRESS)
+ group.add_argument('-y', action='store_false', help='y help')
+ return parser
+
+ failures = ['-x X -y']
+ successes = [
+ ('-x X', NS(x='X', y=True)),
+ ('-x X -x Y', NS(x='Y', y=True)),
+ ('-y', NS(x=None, y=False)),
+ ]
+ successes_when_not_required = [
+ ('', NS(x=None, y=True)),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [-y]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] -y
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -y y help
+ '''
+
+
+class TestMutuallyExclusiveManySuppressed(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group = parser.add_mutually_exclusive_group(required=required)
+ add = group.add_argument
+ add('--spam', action='store_true', help=argparse.SUPPRESS)
+ add('--badger', action='store_false', help=argparse.SUPPRESS)
+ add('--bladder', help=argparse.SUPPRESS)
+ return parser
+
+ failures = [
+ '--spam --badger',
+ '--badger --bladder B',
+ '--bladder B --spam',
+ ]
+ successes = [
+ ('--spam', NS(spam=True, badger=True, bladder=None)),
+ ('--badger', NS(spam=False, badger=False, bladder=None)),
+ ('--bladder B', NS(spam=False, badger=True, bladder='B')),
+ ('--spam --spam', NS(spam=True, badger=True, bladder=None)),
+ ]
+ successes_when_not_required = [
+ ('', NS(spam=False, badger=True, bladder=None)),
+ ]
+
+ usage_when_required = usage_when_not_required = '''\
+ usage: PROG [-h]
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ '''
+
+
+class TestMutuallyExclusiveOptionalAndPositional(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('--foo', action='store_true', help='FOO')
+ group.add_argument('--spam', help='SPAM')
+ group.add_argument('badger', nargs='*', default='X', help='BADGER')
+ return parser
+
+ failures = [
+ '--foo --spam S',
+ '--spam S X',
+ 'X --foo',
+ 'X Y Z --spam S',
+ '--foo X Y',
+ ]
+ successes = [
+ ('--foo', NS(foo=True, spam=None, badger='X')),
+ ('--spam S', NS(foo=False, spam='S', badger='X')),
+ ('X', NS(foo=False, spam=None, badger=['X'])),
+ ('X Y Z', NS(foo=False, spam=None, badger=['X', 'Y', 'Z'])),
+ ]
+ successes_when_not_required = [
+ ('', NS(foo=False, spam=None, badger='X')),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [--foo | --spam SPAM | badger [badger ...]]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] (--foo | --spam SPAM | badger [badger ...])
+ '''
+ help = '''\
+
+ positional arguments:
+ badger BADGER
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO
+ --spam SPAM SPAM
+ '''
+
+
+class TestMutuallyExclusiveOptionalsMixed(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ parser.add_argument('-x', action='store_true', help='x help')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('-a', action='store_true', help='a help')
+ group.add_argument('-b', action='store_true', help='b help')
+ parser.add_argument('-y', action='store_true', help='y help')
+ group.add_argument('-c', action='store_true', help='c help')
+ return parser
+
+ failures = ['-a -b', '-b -c', '-a -c', '-a -b -c']
+ successes = [
+ ('-a', NS(a=True, b=False, c=False, x=False, y=False)),
+ ('-b', NS(a=False, b=True, c=False, x=False, y=False)),
+ ('-c', NS(a=False, b=False, c=True, x=False, y=False)),
+ ('-a -x', NS(a=True, b=False, c=False, x=True, y=False)),
+ ('-y -b', NS(a=False, b=True, c=False, x=False, y=True)),
+ ('-x -y -c', NS(a=False, b=False, c=True, x=True, y=True)),
+ ]
+ successes_when_not_required = [
+ ('', NS(a=False, b=False, c=False, x=False, y=False)),
+ ('-x', NS(a=False, b=False, c=False, x=True, y=False)),
+ ('-y', NS(a=False, b=False, c=False, x=False, y=True)),
+ ]
+
+ usage_when_required = usage_when_not_required = '''\
+ usage: PROG [-h] [-x] [-a] [-b] [-y] [-c]
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x x help
+ -a a help
+ -b b help
+ -y y help
+ -c c help
+ '''
+
+
+class TestMutuallyExclusiveInGroup(MEMixin, TestCase):
+
+ def get_parser(self, required=None):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ titled_group = parser.add_argument_group(
+ title='Titled group', description='Group description')
+ mutex_group = \
+ titled_group.add_mutually_exclusive_group(required=required)
+ mutex_group.add_argument('--bar', help='bar help')
+ mutex_group.add_argument('--baz', help='baz help')
+ return parser
+
+ failures = ['--bar X --baz Y', '--baz X --bar Y']
+ successes = [
+ ('--bar X', NS(bar='X', baz=None)),
+ ('--baz Y', NS(bar=None, baz='Y')),
+ ]
+ successes_when_not_required = [
+ ('', NS(bar=None, baz=None)),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [--bar BAR | --baz BAZ]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] (--bar BAR | --baz BAZ)
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+ Titled group:
+ Group description
+
+ --bar BAR bar help
+ --baz BAZ baz help
+ '''
+
+
+class TestMutuallyExclusiveOptionalsAndPositionalsMixed(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ parser.add_argument('x', help='x help')
+ parser.add_argument('-y', action='store_true', help='y help')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('a', nargs='?', help='a help')
+ group.add_argument('-b', action='store_true', help='b help')
+ group.add_argument('-c', action='store_true', help='c help')
+ return parser
+
+ failures = ['X A -b', '-b -c', '-c X A']
+ successes = [
+ ('X A', NS(a='A', b=False, c=False, x='X', y=False)),
+ ('X -b', NS(a=None, b=True, c=False, x='X', y=False)),
+ ('X -c', NS(a=None, b=False, c=True, x='X', y=False)),
+ ('X A -y', NS(a='A', b=False, c=False, x='X', y=True)),
+ ('X -y -b', NS(a=None, b=True, c=False, x='X', y=True)),
+ ]
+ successes_when_not_required = [
+ ('X', NS(a=None, b=False, c=False, x='X', y=False)),
+ ('X -y', NS(a=None, b=False, c=False, x='X', y=True)),
+ ]
+
+ usage_when_required = usage_when_not_required = '''\
+ usage: PROG [-h] [-y] [-b] [-c] x [a]
+ '''
+ help = '''\
+
+ positional arguments:
+ x x help
+ a a help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -y y help
+ -b b help
+ -c c help
+ '''
+
+# =================================================
+# Mutually exclusive group in parent parser tests
+# =================================================
+
+class MEPBase(object):
+
+ def get_parser(self, required=None):
+ parent = super(MEPBase, self).get_parser(required=required)
+ parser = ErrorRaisingArgumentParser(
+ prog=parent.prog, add_help=False, parents=[parent])
+ return parser
+
+
+class TestMutuallyExclusiveGroupErrorsParent(
+ MEPBase, TestMutuallyExclusiveGroupErrors):
+ pass
+
+
+class TestMutuallyExclusiveSimpleParent(
+ MEPBase, TestMutuallyExclusiveSimple):
+ pass
+
+
+class TestMutuallyExclusiveLongParent(
+ MEPBase, TestMutuallyExclusiveLong):
+ pass
+
+
+class TestMutuallyExclusiveFirstSuppressedParent(
+ MEPBase, TestMutuallyExclusiveFirstSuppressed):
+ pass
+
+
+class TestMutuallyExclusiveManySuppressedParent(
+ MEPBase, TestMutuallyExclusiveManySuppressed):
+ pass
+
+
+class TestMutuallyExclusiveOptionalAndPositionalParent(
+ MEPBase, TestMutuallyExclusiveOptionalAndPositional):
+ pass
+
+
+class TestMutuallyExclusiveOptionalsMixedParent(
+ MEPBase, TestMutuallyExclusiveOptionalsMixed):
+ pass
+
+
+class TestMutuallyExclusiveOptionalsAndPositionalsMixedParent(
+ MEPBase, TestMutuallyExclusiveOptionalsAndPositionalsMixed):
+ pass
+
+# =================
+# Set default tests
+# =================
+
+class TestSetDefaults(TestCase):
+
+ def test_set_defaults_no_args(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(x='foo')
+ parser.set_defaults(y='bar', z=1)
+ self.assertEqual(NS(x='foo', y='bar', z=1),
+ parser.parse_args([]))
+ self.assertEqual(NS(x='foo', y='bar', z=1),
+ parser.parse_args([], NS()))
+ self.assertEqual(NS(x='baz', y='bar', z=1),
+ parser.parse_args([], NS(x='baz')))
+ self.assertEqual(NS(x='baz', y='bar', z=2),
+ parser.parse_args([], NS(x='baz', z=2)))
+
+ def test_set_defaults_with_args(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(x='foo', y='bar')
+ parser.add_argument('-x', default='xfoox')
+ self.assertEqual(NS(x='xfoox', y='bar'),
+ parser.parse_args([]))
+ self.assertEqual(NS(x='xfoox', y='bar'),
+ parser.parse_args([], NS()))
+ self.assertEqual(NS(x='baz', y='bar'),
+ parser.parse_args([], NS(x='baz')))
+ self.assertEqual(NS(x='1', y='bar'),
+ parser.parse_args('-x 1'.split()))
+ self.assertEqual(NS(x='1', y='bar'),
+ parser.parse_args('-x 1'.split(), NS()))
+ self.assertEqual(NS(x='1', y='bar'),
+ parser.parse_args('-x 1'.split(), NS(x='baz')))
+
+ def test_set_defaults_subparsers(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(x='foo')
+ subparsers = parser.add_subparsers()
+ parser_a = subparsers.add_parser('a')
+ parser_a.set_defaults(y='bar')
+ self.assertEqual(NS(x='foo', y='bar'),
+ parser.parse_args('a'.split()))
+
+ def test_set_defaults_parents(self):
+ parent = ErrorRaisingArgumentParser(add_help=False)
+ parent.set_defaults(x='foo')
+ parser = ErrorRaisingArgumentParser(parents=[parent])
+ self.assertEqual(NS(x='foo'), parser.parse_args([]))
+
+ def test_set_defaults_same_as_add_argument(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(w='W', x='X', y='Y', z='Z')
+ parser.add_argument('-w')
+ parser.add_argument('-x', default='XX')
+ parser.add_argument('y', nargs='?')
+ parser.add_argument('z', nargs='?', default='ZZ')
+
+ # defaults set previously
+ self.assertEqual(NS(w='W', x='XX', y='Y', z='ZZ'),
+ parser.parse_args([]))
+
+ # reset defaults
+ parser.set_defaults(w='WW', x='X', y='YY', z='Z')
+ self.assertEqual(NS(w='WW', x='X', y='YY', z='Z'),
+ parser.parse_args([]))
+
+ def test_set_defaults_same_as_add_argument_group(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(w='W', x='X', y='Y', z='Z')
+ group = parser.add_argument_group('foo')
+ group.add_argument('-w')
+ group.add_argument('-x', default='XX')
+ group.add_argument('y', nargs='?')
+ group.add_argument('z', nargs='?', default='ZZ')
+
+
+ # defaults set previously
+ self.assertEqual(NS(w='W', x='XX', y='Y', z='ZZ'),
+ parser.parse_args([]))
+
+ # reset defaults
+ parser.set_defaults(w='WW', x='X', y='YY', z='Z')
+ self.assertEqual(NS(w='WW', x='X', y='YY', z='Z'),
+ parser.parse_args([]))
+
+# =================
+# Get default tests
+# =================
+
+class TestGetDefault(TestCase):
+
+ def test_get_default(self):
+ parser = ErrorRaisingArgumentParser()
+ self.assertEqual(None, parser.get_default("foo"))
+ self.assertEqual(None, parser.get_default("bar"))
+
+ parser.add_argument("--foo")
+ self.assertEqual(None, parser.get_default("foo"))
+ self.assertEqual(None, parser.get_default("bar"))
+
+ parser.add_argument("--bar", type=int, default=42)
+ self.assertEqual(None, parser.get_default("foo"))
+ self.assertEqual(42, parser.get_default("bar"))
+
+ parser.set_defaults(foo="badger")
+ self.assertEqual("badger", parser.get_default("foo"))
+ self.assertEqual(42, parser.get_default("bar"))
+
+# ==========================
+# Namespace 'contains' tests
+# ==========================
+
+class TestNamespaceContainsSimple(TestCase):
+
+ def test_empty(self):
+ ns = argparse.Namespace()
+ self.assertEqual('' in ns, False)
+ self.assertEqual('' not in ns, True)
+ self.assertEqual('x' in ns, False)
+
+ def test_non_empty(self):
+ ns = argparse.Namespace(x=1, y=2)
+ self.assertEqual('x' in ns, True)
+ self.assertEqual('x' not in ns, False)
+ self.assertEqual('y' in ns, True)
+ self.assertEqual('' in ns, False)
+ self.assertEqual('xx' in ns, False)
+ self.assertEqual('z' in ns, False)
+
+# =====================
+# Help formatting tests
+# =====================
+
+class TestHelpFormattingMetaclass(type):
+
+ def __init__(cls, name, bases, bodydict):
+ if name == 'HelpTestCase':
+ return
+
+ class AddTests(object):
+
+ def __init__(self, test_class, func_suffix, std_name):
+ self.func_suffix = func_suffix
+ self.std_name = std_name
+
+ for test_func in [self.test_format,
+ self.test_print,
+ self.test_print_file]:
+ test_name = '%s_%s' % (test_func.__name__, func_suffix)
+
+ def test_wrapper(self, test_func=test_func):
+ test_func(self)
+ try:
+ test_wrapper.__name__ = test_name
+ except TypeError:
+ pass
+ setattr(test_class, test_name, test_wrapper)
+
+ def _get_parser(self, tester):
+ parser = argparse.ArgumentParser(
+ *tester.parser_signature.args,
+ **tester.parser_signature.kwargs)
+ for argument_sig in getattr(tester, 'argument_signatures', []):
+ parser.add_argument(*argument_sig.args,
+ **argument_sig.kwargs)
+ group_sigs = getattr(tester, 'argument_group_signatures', [])
+ for group_sig, argument_sigs in group_sigs:
+ group = parser.add_argument_group(*group_sig.args,
+ **group_sig.kwargs)
+ for argument_sig in argument_sigs:
+ group.add_argument(*argument_sig.args,
+ **argument_sig.kwargs)
+ subparsers_sigs = getattr(tester, 'subparsers_signatures', [])
+ if subparsers_sigs:
+ subparsers = parser.add_subparsers()
+ for subparser_sig in subparsers_sigs:
+ subparsers.add_parser(*subparser_sig.args,
+ **subparser_sig.kwargs)
+ return parser
+
+ def _test(self, tester, parser_text):
+ expected_text = getattr(tester, self.func_suffix)
+ expected_text = textwrap.dedent(expected_text)
+ if expected_text != parser_text:
+ print(repr(expected_text))
+ print(repr(parser_text))
+ for char1, char2 in zip(expected_text, parser_text):
+ if char1 != char2:
+ print('first diff: %r %r' % (char1, char2))
+ break
+ tester.assertEqual(expected_text, parser_text)
+
+ def test_format(self, tester):
+ parser = self._get_parser(tester)
+ format = getattr(parser, 'format_%s' % self.func_suffix)
+ self._test(tester, format())
+
+ def test_print(self, tester):
+ parser = self._get_parser(tester)
+ print_ = getattr(parser, 'print_%s' % self.func_suffix)
+ old_stream = getattr(sys, self.std_name)
+ setattr(sys, self.std_name, StdIOBuffer())
+ try:
+ print_()
+ parser_text = getattr(sys, self.std_name).getvalue()
+ finally:
+ setattr(sys, self.std_name, old_stream)
+ self._test(tester, parser_text)
+
+ def test_print_file(self, tester):
+ parser = self._get_parser(tester)
+ print_ = getattr(parser, 'print_%s' % self.func_suffix)
+ sfile = StdIOBuffer()
+ print_(sfile)
+ parser_text = sfile.getvalue()
+ self._test(tester, parser_text)
+
+ # add tests for {format,print}_{usage,help,version}
+ for func_suffix, std_name in [('usage', 'stdout'),
+ ('help', 'stdout'),
+ ('version', 'stderr')]:
+ AddTests(cls, func_suffix, std_name)
+
+bases = TestCase,
+HelpTestCase = TestHelpFormattingMetaclass('HelpTestCase', bases, {})
+
+
+class TestHelpBiggerOptionals(HelpTestCase):
+ """Make sure that argument help aligns when options are longer"""
+
+ parser_signature = Sig(prog='PROG', description='DESCRIPTION',
+ epilog='EPILOG', version='0.1')
+ argument_signatures = [
+ Sig('-x', action='store_true', help='X HELP'),
+ Sig('--y', help='Y HELP'),
+ Sig('foo', help='FOO HELP'),
+ Sig('bar', help='BAR HELP'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-v] [-x] [--y Y] foo bar
+ '''
+ help = usage + '''\
+
+ DESCRIPTION
+
+ positional arguments:
+ foo FOO HELP
+ bar BAR HELP
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ -x X HELP
+ --y Y Y HELP
+
+ EPILOG
+ '''
+ version = '''\
+ 0.1
+ '''
+
+
+class TestHelpBiggerOptionalGroups(HelpTestCase):
+ """Make sure that argument help aligns when options are longer"""
+
+ parser_signature = Sig(prog='PROG', description='DESCRIPTION',
+ epilog='EPILOG', version='0.1')
+ argument_signatures = [
+ Sig('-x', action='store_true', help='X HELP'),
+ Sig('--y', help='Y HELP'),
+ Sig('foo', help='FOO HELP'),
+ Sig('bar', help='BAR HELP'),
+ ]
+ argument_group_signatures = [
+ (Sig('GROUP TITLE', description='GROUP DESCRIPTION'), [
+ Sig('baz', help='BAZ HELP'),
+ Sig('-z', nargs='+', help='Z HELP')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [-v] [-x] [--y Y] [-z Z [Z ...]] foo bar baz
+ '''
+ help = usage + '''\
+
+ DESCRIPTION
+
+ positional arguments:
+ foo FOO HELP
+ bar BAR HELP
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ -x X HELP
+ --y Y Y HELP
+
+ GROUP TITLE:
+ GROUP DESCRIPTION
+
+ baz BAZ HELP
+ -z Z [Z ...] Z HELP
+
+ EPILOG
+ '''
+ version = '''\
+ 0.1
+ '''
+
+
+class TestHelpBiggerPositionals(HelpTestCase):
+ """Make sure that help aligns when arguments are longer"""
+
+ parser_signature = Sig(usage='USAGE', description='DESCRIPTION')
+ argument_signatures = [
+ Sig('-x', action='store_true', help='X HELP'),
+ Sig('--y', help='Y HELP'),
+ Sig('ekiekiekifekang', help='EKI HELP'),
+ Sig('bar', help='BAR HELP'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: USAGE
+ '''
+ help = usage + '''\
+
+ DESCRIPTION
+
+ positional arguments:
+ ekiekiekifekang EKI HELP
+ bar BAR HELP
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X HELP
+ --y Y Y HELP
+ '''
+
+ version = ''
+
+
+class TestHelpReformatting(HelpTestCase):
+ """Make sure that text after short names starts on the first line"""
+
+ parser_signature = Sig(
+ prog='PROG',
+ description=' oddly formatted\n'
+ 'description\n'
+ '\n'
+ 'that is so long that it should go onto multiple '
+ 'lines when wrapped')
+ argument_signatures = [
+ Sig('-x', metavar='XX', help='oddly\n'
+ ' formatted -x help'),
+ Sig('y', metavar='yyy', help='normal y help'),
+ ]
+ argument_group_signatures = [
+ (Sig('title', description='\n'
+ ' oddly formatted group\n'
+ '\n'
+ 'description'),
+ [Sig('-a', action='store_true',
+ help=' oddly \n'
+ 'formatted -a help \n'
+ ' again, so long that it should be wrapped over '
+ 'multiple lines')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [-x XX] [-a] yyy
+ '''
+ help = usage + '''\
+
+ oddly formatted description that is so long that it should go onto \
+multiple
+ lines when wrapped
+
+ positional arguments:
+ yyy normal y help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x XX oddly formatted -x help
+
+ title:
+ oddly formatted group description
+
+ -a oddly formatted -a help again, so long that it should \
+be wrapped
+ over multiple lines
+ '''
+ version = ''
+
+
+class TestHelpWrappingShortNames(HelpTestCase):
+ """Make sure that text after short names starts on the first line"""
+
+ parser_signature = Sig(prog='PROG', description= 'D\nD' * 30)
+ argument_signatures = [
+ Sig('-x', metavar='XX', help='XHH HX' * 20),
+ Sig('y', metavar='yyy', help='YH YH' * 20),
+ ]
+ argument_group_signatures = [
+ (Sig('ALPHAS'), [
+ Sig('-a', action='store_true', help='AHHH HHA' * 10)]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [-x XX] [-a] yyy
+ '''
+ help = usage + '''\
+
+ D DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD \
+DD DD DD
+ DD DD DD DD D
+
+ positional arguments:
+ yyy YH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH \
+YHYH YHYH
+ YHYH YHYH YHYH YHYH YHYH YHYH YHYH YH
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x XX XHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH \
+HXXHH HXXHH
+ HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HX
+
+ ALPHAS:
+ -a AHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH \
+HHAAHHH
+ HHAAHHH HHAAHHH HHA
+ '''
+ version = ''
+
+
+class TestHelpWrappingLongNames(HelpTestCase):
+ """Make sure that text after long names starts on the next line"""
+
+ parser_signature = Sig(usage='USAGE', description= 'D D' * 30,
+ version='V V'*30)
+ argument_signatures = [
+ Sig('-x', metavar='X' * 25, help='XH XH' * 20),
+ Sig('y', metavar='y' * 25, help='YH YH' * 20),
+ ]
+ argument_group_signatures = [
+ (Sig('ALPHAS'), [
+ Sig('-a', metavar='A' * 25, help='AH AH' * 20),
+ Sig('z', metavar='z' * 25, help='ZH ZH' * 20)]),
+ ]
+ usage = '''\
+ usage: USAGE
+ '''
+ help = usage + '''\
+
+ D DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD \
+DD DD DD
+ DD DD DD DD D
+
+ positional arguments:
+ yyyyyyyyyyyyyyyyyyyyyyyyy
+ YH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH \
+YHYH YHYH
+ YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YH
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ XH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH \
+XHXH XHXH
+ XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XH
+
+ ALPHAS:
+ -a AAAAAAAAAAAAAAAAAAAAAAAAA
+ AH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH \
+AHAH AHAH
+ AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AH
+ zzzzzzzzzzzzzzzzzzzzzzzzz
+ ZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH \
+ZHZH ZHZH
+ ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZH
+ '''
+ version = '''\
+ V VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV \
+VV VV VV
+ VV VV VV VV V
+ '''
+
+
+class TestHelpUsage(HelpTestCase):
+ """Test basic usage messages"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-w', nargs='+', help='w'),
+ Sig('-x', nargs='*', help='x'),
+ Sig('a', help='a'),
+ Sig('b', help='b', nargs=2),
+ Sig('c', help='c', nargs='?'),
+ ]
+ argument_group_signatures = [
+ (Sig('group'), [
+ Sig('-y', nargs='?', help='y'),
+ Sig('-z', nargs=3, help='z'),
+ Sig('d', help='d', nargs='*'),
+ Sig('e', help='e', nargs='+'),
+ ])
+ ]
+ usage = '''\
+ usage: PROG [-h] [-w W [W ...]] [-x [X [X ...]]] [-y [Y]] [-z Z Z Z]
+ a b b [c] [d [d ...]] e [e ...]
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ a a
+ b b
+ c c
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w W [W ...] w
+ -x [X [X ...]] x
+
+ group:
+ -y [Y] y
+ -z Z Z Z z
+ d d
+ e e
+ '''
+ version = ''
+
+
+class TestHelpOnlyUserGroups(HelpTestCase):
+ """Test basic usage messages"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = []
+ argument_group_signatures = [
+ (Sig('xxxx'), [
+ Sig('-x', help='x'),
+ Sig('a', help='a'),
+ ]),
+ (Sig('yyyy'), [
+ Sig('b', help='b'),
+ Sig('-y', help='y'),
+ ]),
+ ]
+ usage = '''\
+ usage: PROG [-x X] [-y Y] a b
+ '''
+ help = usage + '''\
+
+ xxxx:
+ -x X x
+ a a
+
+ yyyy:
+ b b
+ -y Y y
+ '''
+ version = ''
+
+
+class TestHelpUsageLongProg(HelpTestCase):
+ """Test usage messages where the prog is long"""
+
+ parser_signature = Sig(prog='P' * 60)
+ argument_signatures = [
+ Sig('-w', metavar='W'),
+ Sig('-x', metavar='X'),
+ Sig('a'),
+ Sig('b'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
+ [-h] [-w W] [-x X] a b
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ a
+ b
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w W
+ -x X
+ '''
+ version = ''
+
+
+class TestHelpUsageLongProgOptionsWrap(HelpTestCase):
+ """Test usage messages where the prog is long and the optionals wrap"""
+
+ parser_signature = Sig(prog='P' * 60)
+ argument_signatures = [
+ Sig('-w', metavar='W' * 25),
+ Sig('-x', metavar='X' * 25),
+ Sig('-y', metavar='Y' * 25),
+ Sig('-z', metavar='Z' * 25),
+ Sig('a'),
+ Sig('b'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
+ [-h] [-w WWWWWWWWWWWWWWWWWWWWWWWWW] \
+[-x XXXXXXXXXXXXXXXXXXXXXXXXX]
+ [-y YYYYYYYYYYYYYYYYYYYYYYYYY] [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
+ a b
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ a
+ b
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w WWWWWWWWWWWWWWWWWWWWWWWWW
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ -y YYYYYYYYYYYYYYYYYYYYYYYYY
+ -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
+ '''
+ version = ''
+
+
+class TestHelpUsageLongProgPositionalsWrap(HelpTestCase):
+ """Test usage messages where the prog is long and the positionals wrap"""
+
+ parser_signature = Sig(prog='P' * 60, add_help=False)
+ argument_signatures = [
+ Sig('a' * 25),
+ Sig('b' * 25),
+ Sig('c' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
+ aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ aaaaaaaaaaaaaaaaaaaaaaaaa
+ bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ version = ''
+
+
+class TestHelpUsageOptionalsWrap(HelpTestCase):
+ """Test usage messages where the optionals wrap"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-w', metavar='W' * 25),
+ Sig('-x', metavar='X' * 25),
+ Sig('-y', metavar='Y' * 25),
+ Sig('-z', metavar='Z' * 25),
+ Sig('a'),
+ Sig('b'),
+ Sig('c'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-w WWWWWWWWWWWWWWWWWWWWWWWWW] \
+[-x XXXXXXXXXXXXXXXXXXXXXXXXX]
+ [-y YYYYYYYYYYYYYYYYYYYYYYYYY] \
+[-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
+ a b c
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ a
+ b
+ c
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w WWWWWWWWWWWWWWWWWWWWWWWWW
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ -y YYYYYYYYYYYYYYYYYYYYYYYYY
+ -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
+ '''
+ version = ''
+
+
+class TestHelpUsagePositionalsWrap(HelpTestCase):
+ """Test usage messages where the positionals wrap"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-x'),
+ Sig('-y'),
+ Sig('-z'),
+ Sig('a' * 25),
+ Sig('b' * 25),
+ Sig('c' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-x X] [-y Y] [-z Z]
+ aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ aaaaaaaaaaaaaaaaaaaaaaaaa
+ bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X
+ -y Y
+ -z Z
+ '''
+ version = ''
+
+
+class TestHelpUsageOptionalsPositionalsWrap(HelpTestCase):
+ """Test usage messages where the optionals and positionals wrap"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-x', metavar='X' * 25),
+ Sig('-y', metavar='Y' * 25),
+ Sig('-z', metavar='Z' * 25),
+ Sig('a' * 25),
+ Sig('b' * 25),
+ Sig('c' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-x XXXXXXXXXXXXXXXXXXXXXXXXX] \
+[-y YYYYYYYYYYYYYYYYYYYYYYYYY]
+ [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
+ aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ aaaaaaaaaaaaaaaaaaaaaaaaa
+ bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ -y YYYYYYYYYYYYYYYYYYYYYYYYY
+ -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
+ '''
+ version = ''
+
+
+class TestHelpUsageOptionalsOnlyWrap(HelpTestCase):
+ """Test usage messages where there are only optionals and they wrap"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-x', metavar='X' * 25),
+ Sig('-y', metavar='Y' * 25),
+ Sig('-z', metavar='Z' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-x XXXXXXXXXXXXXXXXXXXXXXXXX] \
+[-y YYYYYYYYYYYYYYYYYYYYYYYYY]
+ [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ -y YYYYYYYYYYYYYYYYYYYYYYYYY
+ -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
+ '''
+ version = ''
+
+
+class TestHelpUsagePositionalsOnlyWrap(HelpTestCase):
+ """Test usage messages where there are only positionals and they wrap"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = [
+ Sig('a' * 25),
+ Sig('b' * 25),
+ Sig('c' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ aaaaaaaaaaaaaaaaaaaaaaaaa
+ bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ version = ''
+
+
+class TestHelpVariableExpansion(HelpTestCase):
+ """Test that variables are expanded properly in help messages"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-x', type=int,
+ help='x %(prog)s %(default)s %(type)s %%'),
+ Sig('-y', action='store_const', default=42, const='XXX',
+ help='y %(prog)s %(default)s %(const)s'),
+ Sig('--foo', choices='abc',
+ help='foo %(prog)s %(default)s %(choices)s'),
+ Sig('--bar', default='baz', choices=[1, 2], metavar='BBB',
+ help='bar %(prog)s %(default)s %(dest)s'),
+ Sig('spam', help='spam %(prog)s %(default)s'),
+ Sig('badger', default=0.5, help='badger %(prog)s %(default)s'),
+ ]
+ argument_group_signatures = [
+ (Sig('group'), [
+ Sig('-a', help='a %(prog)s %(default)s'),
+ Sig('-b', default=-1, help='b %(prog)s %(default)s'),
+ ])
+ ]
+ usage = ('''\
+ usage: PROG [-h] [-x X] [-y] [--foo {a,b,c}] [--bar BBB] [-a A] [-b B]
+ spam badger
+ ''')
+ help = usage + '''\
+
+ positional arguments:
+ spam spam PROG None
+ badger badger PROG 0.5
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X x PROG None int %
+ -y y PROG 42 XXX
+ --foo {a,b,c} foo PROG None a, b, c
+ --bar BBB bar PROG baz bar
+
+ group:
+ -a A a PROG None
+ -b B b PROG -1
+ '''
+ version = ''
+
+
+class TestHelpVariableExpansionUsageSupplied(HelpTestCase):
+ """Test that variables are expanded properly when usage= is present"""
+
+ parser_signature = Sig(prog='PROG', usage='%(prog)s FOO')
+ argument_signatures = []
+ argument_group_signatures = []
+ usage = ('''\
+ usage: PROG FOO
+ ''')
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ '''
+ version = ''
+
+
+class TestHelpVariableExpansionNoArguments(HelpTestCase):
+ """Test that variables are expanded properly with no arguments"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = []
+ argument_group_signatures = []
+ usage = ('''\
+ usage: PROG
+ ''')
+ help = usage
+ version = ''
+
+
+class TestHelpSuppressUsage(HelpTestCase):
+ """Test that items can be suppressed in usage messages"""
+
+ parser_signature = Sig(prog='PROG', usage=argparse.SUPPRESS)
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = []
+ help = '''\
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+ '''
+ usage = ''
+ version = ''
+
+
+class TestHelpSuppressOptional(HelpTestCase):
+ """Test that optional arguments can be suppressed in help messages"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = [
+ Sig('--foo', help=argparse.SUPPRESS),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam spam help
+ '''
+ version = ''
+
+
+class TestHelpSuppressOptionalGroup(HelpTestCase):
+ """Test that optional groups can be suppressed in help messages"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = [
+ (Sig('group'), [Sig('--bar', help=argparse.SUPPRESS)]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+ '''
+ version = ''
+
+
+class TestHelpSuppressPositional(HelpTestCase):
+ """Test that positional arguments can be suppressed in help messages"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help=argparse.SUPPRESS),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [--foo FOO]
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+ '''
+ version = ''
+
+
+class TestHelpRequiredOptional(HelpTestCase):
+ """Test that required options don't look optional"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('--foo', required=True, help='foo help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] --foo FOO
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+ '''
+ version = ''
+
+
+class TestHelpAlternatePrefixChars(HelpTestCase):
+ """Test that options display with different prefix characters"""
+
+ parser_signature = Sig(prog='PROG', prefix_chars='^;', add_help=False)
+ argument_signatures = [
+ Sig('^^foo', action='store_true', help='foo help'),
+ Sig(';b', ';;bar', help='bar help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [^^foo] [;b BAR]
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ ^^foo foo help
+ ;b BAR, ;;bar BAR bar help
+ '''
+ version = ''
+
+
+class TestHelpNoHelpOptional(HelpTestCase):
+ """Test that the --help argument can be suppressed help messages"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [--foo FOO] spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ --foo FOO foo help
+ '''
+ version = ''
+
+
+class TestHelpVersionOptional(HelpTestCase):
+ """Test that the --version argument can be suppressed help messages"""
+
+ parser_signature = Sig(prog='PROG', version='1.0')
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-v] [--foo FOO] spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ --foo FOO foo help
+ '''
+ version = '''\
+ 1.0
+ '''
+
+
+class TestHelpNone(HelpTestCase):
+ """Test that no errors occur if no help is specified"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('--foo'),
+ Sig('spam'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO
+ '''
+ version = ''
+
+
+class TestHelpTupleMetavar(HelpTestCase):
+ """Test specifying metavar as a tuple"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-w', help='w', nargs='+', metavar=('W1', 'W2')),
+ Sig('-x', help='x', nargs='*', metavar=('X1', 'X2')),
+ Sig('-y', help='y', nargs=3, metavar=('Y1', 'Y2', 'Y3')),
+ Sig('-z', help='z', nargs='?', metavar=('Z1', )),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] \
+[-z [Z1]]
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w W1 [W2 ...] w
+ -x [X1 [X2 ...]] x
+ -y Y1 Y2 Y3 y
+ -z [Z1] z
+ '''
+ version = ''
+
+
+class TestHelpRawText(HelpTestCase):
+ """Test the RawTextHelpFormatter"""
+
+ parser_signature = Sig(
+ prog='PROG', formatter_class=argparse.RawTextHelpFormatter,
+ description='Keep the formatting\n'
+ ' exactly as it is written\n'
+ '\n'
+ 'here\n')
+
+ argument_signatures = [
+ Sig('--foo', help=' foo help should also\n'
+ 'appear as given here'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = [
+ (Sig('title', description=' This text\n'
+ ' should be indented\n'
+ ' exactly like it is here\n'),
+ [Sig('--bar', help='bar help')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] [--bar BAR] spam
+ '''
+ help = usage + '''\
+
+ Keep the formatting
+ exactly as it is written
+
+ here
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help should also
+ appear as given here
+
+ title:
+ This text
+ should be indented
+ exactly like it is here
+
+ --bar BAR bar help
+ '''
+ version = ''
+
+
+class TestHelpRawDescription(HelpTestCase):
+ """Test the RawTextHelpFormatter"""
+
+ parser_signature = Sig(
+ prog='PROG', formatter_class=argparse.RawDescriptionHelpFormatter,
+ description='Keep the formatting\n'
+ ' exactly as it is written\n'
+ '\n'
+ 'here\n')
+
+ argument_signatures = [
+ Sig('--foo', help=' foo help should not\n'
+ ' retain this odd formatting'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = [
+ (Sig('title', description=' This text\n'
+ ' should be indented\n'
+ ' exactly like it is here\n'),
+ [Sig('--bar', help='bar help')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] [--bar BAR] spam
+ '''
+ help = usage + '''\
+
+ Keep the formatting
+ exactly as it is written
+
+ here
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help should not retain this odd formatting
+
+ title:
+ This text
+ should be indented
+ exactly like it is here
+
+ --bar BAR bar help
+ '''
+ version = ''
+
+
+class TestHelpArgumentDefaults(HelpTestCase):
+ """Test the ArgumentDefaultsHelpFormatter"""
+
+ parser_signature = Sig(
+ prog='PROG', formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ description='description')
+
+ argument_signatures = [
+ Sig('--foo', help='foo help - oh and by the way, %(default)s'),
+ Sig('--bar', action='store_true', help='bar help'),
+ Sig('spam', help='spam help'),
+ Sig('badger', nargs='?', default='wooden', help='badger help'),
+ ]
+ argument_group_signatures = [
+ (Sig('title', description='description'),
+ [Sig('--baz', type=int, default=42, help='baz help')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] [--bar] [--baz BAZ] spam [badger]
+ '''
+ help = usage + '''\
+
+ description
+
+ positional arguments:
+ spam spam help
+ badger badger help (default: wooden)
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help - oh and by the way, None
+ --bar bar help (default: False)
+
+ title:
+ description
+
+ --baz BAZ baz help (default: 42)
+ '''
+ version = ''
+
+class TestHelpVersionAction(HelpTestCase):
+ """Test the default help for the version action"""
+
+ parser_signature = Sig(prog='PROG', description='description')
+ argument_signatures = [Sig('-V', '--version', action='version', version='3.6')]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-V]
+ '''
+ help = usage + '''\
+
+ description
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -V, --version show program's version number and exit
+ '''
+ version = ''
+
+class TestHelpSubparsersOrdering(HelpTestCase):
+ """Test ordering of subcommands in help matches the code"""
+ parser_signature = Sig(prog='PROG',
+ description='display some subcommands',
+ version='0.1')
+
+ subparsers_signatures = [Sig(name=name)
+ for name in ('a', 'b', 'c', 'd', 'e')]
+
+ usage = '''\
+ usage: PROG [-h] [-v] {a,b,c,d,e} ...
+ '''
+
+ help = usage + '''\
+
+ display some subcommands
+
+ positional arguments:
+ {a,b,c,d,e}
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ '''
+
+ version = '''\
+ 0.1
+ '''
+
+class TestHelpSubparsersWithHelpOrdering(HelpTestCase):
+ """Test ordering of subcommands in help matches the code"""
+ parser_signature = Sig(prog='PROG',
+ description='display some subcommands',
+ version='0.1')
+
+ subcommand_data = (('a', 'a subcommand help'),
+ ('b', 'b subcommand help'),
+ ('c', 'c subcommand help'),
+ ('d', 'd subcommand help'),
+ ('e', 'e subcommand help'),
+ )
+
+ subparsers_signatures = [Sig(name=name, help=help)
+ for name, help in subcommand_data]
+
+ usage = '''\
+ usage: PROG [-h] [-v] {a,b,c,d,e} ...
+ '''
+
+ help = usage + '''\
+
+ display some subcommands
+
+ positional arguments:
+ {a,b,c,d,e}
+ a a subcommand help
+ b b subcommand help
+ c c subcommand help
+ d d subcommand help
+ e e subcommand help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ '''
+
+ version = '''\
+ 0.1
+ '''
+
+
+# =====================================
+# Optional/Positional constructor tests
+# =====================================
+
+class TestInvalidArgumentConstructors(TestCase):
+ """Test a bunch of invalid Argument constructors"""
+
+ def assertTypeError(self, *args, **kwargs):
+ parser = argparse.ArgumentParser()
+ self.assertRaises(TypeError, parser.add_argument,
+ *args, **kwargs)
+
+ def assertValueError(self, *args, **kwargs):
+ parser = argparse.ArgumentParser()
+ self.assertRaises(ValueError, parser.add_argument,
+ *args, **kwargs)
+
+ def test_invalid_keyword_arguments(self):
+ self.assertTypeError('-x', bar=None)
+ self.assertTypeError('-y', callback='foo')
+ self.assertTypeError('-y', callback_args=())
+ self.assertTypeError('-y', callback_kwargs={})
+
+ def test_missing_destination(self):
+ self.assertTypeError()
+ for action in ['append', 'store']:
+ self.assertTypeError(action=action)
+
+ def test_invalid_option_strings(self):
+ self.assertValueError('--')
+ self.assertValueError('---')
+
+ def test_invalid_type(self):
+ self.assertValueError('--foo', type='int')
+ self.assertValueError('--foo', type=(int, float))
+
+ def test_invalid_action(self):
+ self.assertValueError('-x', action='foo')
+ self.assertValueError('foo', action='baz')
+ self.assertValueError('--foo', action=('store', 'append'))
+ parser = argparse.ArgumentParser()
+ try:
+ parser.add_argument("--foo", action="store-true")
+ except ValueError:
+ e = sys.exc_info()[1]
+ expected = 'unknown action'
+ msg = 'expected %r, found %r' % (expected, e)
+ self.assertTrue(expected in str(e), msg)
+
+ def test_multiple_dest(self):
+ parser = argparse.ArgumentParser()
+ parser.add_argument(dest='foo')
+ try:
+ parser.add_argument('bar', dest='baz')
+ except ValueError:
+ e = sys.exc_info()[1]
+ expected = 'dest supplied twice for positional argument'
+ msg = 'expected %r, found %r' % (expected, e)
+ self.assertTrue(expected in str(e), msg)
+
+ def test_no_argument_actions(self):
+ for action in ['store_const', 'store_true', 'store_false',
+ 'append_const', 'count']:
+ for attrs in [dict(type=int), dict(nargs='+'),
+ dict(choices='ab')]:
+ self.assertTypeError('-x', action=action, **attrs)
+
+ def test_no_argument_no_const_actions(self):
+ # options with zero arguments
+ for action in ['store_true', 'store_false', 'count']:
+
+ # const is always disallowed
+ self.assertTypeError('-x', const='foo', action=action)
+
+ # nargs is always disallowed
+ self.assertTypeError('-x', nargs='*', action=action)
+
+ def test_more_than_one_argument_actions(self):
+ for action in ['store', 'append']:
+
+ # nargs=0 is disallowed
+ self.assertValueError('-x', nargs=0, action=action)
+ self.assertValueError('spam', nargs=0, action=action)
+
+ # const is disallowed with non-optional arguments
+ for nargs in [1, '*', '+']:
+ self.assertValueError('-x', const='foo',
+ nargs=nargs, action=action)
+ self.assertValueError('spam', const='foo',
+ nargs=nargs, action=action)
+
+ def test_required_const_actions(self):
+ for action in ['store_const', 'append_const']:
+
+ # nargs is always disallowed
+ self.assertTypeError('-x', nargs='+', action=action)
+
+ def test_parsers_action_missing_params(self):
+ self.assertTypeError('command', action='parsers')
+ self.assertTypeError('command', action='parsers', prog='PROG')
+ self.assertTypeError('command', action='parsers',
+ parser_class=argparse.ArgumentParser)
+
+ def test_required_positional(self):
+ self.assertTypeError('foo', required=True)
+
+ def test_user_defined_action(self):
+
+ class Success(Exception):
+ pass
+
+ class Action(object):
+
+ def __init__(self,
+ option_strings,
+ dest,
+ const,
+ default,
+ required=False):
+ if dest == 'spam':
+ if const is Success:
+ if default is Success:
+ raise Success()
+
+ def __call__(self, *args, **kwargs):
+ pass
+
+ parser = argparse.ArgumentParser()
+ self.assertRaises(Success, parser.add_argument, '--spam',
+ action=Action, default=Success, const=Success)
+ self.assertRaises(Success, parser.add_argument, 'spam',
+ action=Action, default=Success, const=Success)
+
+# ================================
+# Actions returned by add_argument
+# ================================
+
+class TestActionsReturned(TestCase):
+
+ def test_dest(self):
+ parser = argparse.ArgumentParser()
+ action = parser.add_argument('--foo')
+ self.assertEqual(action.dest, 'foo')
+ action = parser.add_argument('-b', '--bar')
+ self.assertEqual(action.dest, 'bar')
+ action = parser.add_argument('-x', '-y')
+ self.assertEqual(action.dest, 'x')
+
+ def test_misc(self):
+ parser = argparse.ArgumentParser()
+ action = parser.add_argument('--foo', nargs='?', const=42,
+ default=84, type=int, choices=[1, 2],
+ help='FOO', metavar='BAR', dest='baz')
+ self.assertEqual(action.nargs, '?')
+ self.assertEqual(action.const, 42)
+ self.assertEqual(action.default, 84)
+ self.assertEqual(action.type, int)
+ self.assertEqual(action.choices, [1, 2])
+ self.assertEqual(action.help, 'FOO')
+ self.assertEqual(action.metavar, 'BAR')
+ self.assertEqual(action.dest, 'baz')
+
+
+# ================================
+# Argument conflict handling tests
+# ================================
+
+class TestConflictHandling(TestCase):
+
+ def test_bad_type(self):
+ self.assertRaises(ValueError, argparse.ArgumentParser,
+ conflict_handler='foo')
+
+ def test_conflict_error(self):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-x')
+ self.assertRaises(argparse.ArgumentError,
+ parser.add_argument, '-x')
+ parser.add_argument('--spam')
+ self.assertRaises(argparse.ArgumentError,
+ parser.add_argument, '--spam')
+
+ def test_resolve_error(self):
+ get_parser = argparse.ArgumentParser
+ parser = get_parser(prog='PROG', conflict_handler='resolve')
+
+ parser.add_argument('-x', help='OLD X')
+ parser.add_argument('-x', help='NEW X')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [-x X]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X NEW X
+ '''))
+
+ parser.add_argument('--spam', metavar='OLD_SPAM')
+ parser.add_argument('--spam', metavar='NEW_SPAM')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [-x X] [--spam NEW_SPAM]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X NEW X
+ --spam NEW_SPAM
+ '''))
+
+
+# =============================
+# Help and Version option tests
+# =============================
+
+class TestOptionalsHelpVersionActions(TestCase):
+ """Test the help and version actions"""
+
+ def _get_error(self, func, *args, **kwargs):
+ try:
+ func(*args, **kwargs)
+ except ArgumentParserError:
+ return sys.exc_info()[1]
+ else:
+ self.assertRaises(ArgumentParserError, func, *args, **kwargs)
+
+ def assertPrintHelpExit(self, parser, args_str):
+ self.assertEqual(
+ parser.format_help(),
+ self._get_error(parser.parse_args, args_str.split()).stdout)
+
+ def assertPrintVersionExit(self, parser, args_str):
+ self.assertEqual(
+ parser.format_version(),
+ self._get_error(parser.parse_args, args_str.split()).stderr)
+
+ def assertArgumentParserError(self, parser, *args):
+ self.assertRaises(ArgumentParserError, parser.parse_args, args)
+
+ def test_version(self):
+ parser = ErrorRaisingArgumentParser(version='1.0')
+ self.assertPrintHelpExit(parser, '-h')
+ self.assertPrintHelpExit(parser, '--help')
+ self.assertPrintVersionExit(parser, '-v')
+ self.assertPrintVersionExit(parser, '--version')
+
+ def test_version_format(self):
+ parser = ErrorRaisingArgumentParser(prog='PPP', version='%(prog)s 3.5')
+ msg = self._get_error(parser.parse_args, ['-v']).stderr
+ self.assertEqual('PPP 3.5\n', msg)
+
+ def test_version_no_help(self):
+ parser = ErrorRaisingArgumentParser(add_help=False, version='1.0')
+ self.assertArgumentParserError(parser, '-h')
+ self.assertArgumentParserError(parser, '--help')
+ self.assertPrintVersionExit(parser, '-v')
+ self.assertPrintVersionExit(parser, '--version')
+
+ def test_version_action(self):
+ parser = ErrorRaisingArgumentParser(prog='XXX')
+ parser.add_argument('-V', action='version', version='%(prog)s 3.7')
+ msg = self._get_error(parser.parse_args, ['-V']).stderr
+ self.assertEqual('XXX 3.7\n', msg)
+
+ def test_no_help(self):
+ parser = ErrorRaisingArgumentParser(add_help=False)
+ self.assertArgumentParserError(parser, '-h')
+ self.assertArgumentParserError(parser, '--help')
+ self.assertArgumentParserError(parser, '-v')
+ self.assertArgumentParserError(parser, '--version')
+
+ def test_alternate_help_version(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.add_argument('-x', action='help')
+ parser.add_argument('-y', action='version')
+ self.assertPrintHelpExit(parser, '-x')
+ self.assertPrintVersionExit(parser, '-y')
+ self.assertArgumentParserError(parser, '-v')
+ self.assertArgumentParserError(parser, '--version')
+
+ def test_help_version_extra_arguments(self):
+ parser = ErrorRaisingArgumentParser(version='1.0')
+ parser.add_argument('-x', action='store_true')
+ parser.add_argument('y')
+
+ # try all combinations of valid prefixes and suffixes
+ valid_prefixes = ['', '-x', 'foo', '-x bar', 'baz -x']
+ valid_suffixes = valid_prefixes + ['--bad-option', 'foo bar baz']
+ for prefix in valid_prefixes:
+ for suffix in valid_suffixes:
+ format = '%s %%s %s' % (prefix, suffix)
+ self.assertPrintHelpExit(parser, format % '-h')
+ self.assertPrintHelpExit(parser, format % '--help')
+ self.assertPrintVersionExit(parser, format % '-v')
+ self.assertPrintVersionExit(parser, format % '--version')
+
+
+# ======================
+# str() and repr() tests
+# ======================
+
+class TestStrings(TestCase):
+ """Test str() and repr() on Optionals and Positionals"""
+
+ def assertStringEqual(self, obj, result_string):
+ for func in [str, repr]:
+ self.assertEqual(func(obj), result_string)
+
+ def test_optional(self):
+ option = argparse.Action(
+ option_strings=['--foo', '-a', '-b'],
+ dest='b',
+ type='int',
+ nargs='+',
+ default=42,
+ choices=[1, 2, 3],
+ help='HELP',
+ metavar='METAVAR')
+ string = (
+ "Action(option_strings=['--foo', '-a', '-b'], dest='b', "
+ "nargs='+', const=None, default=42, type='int', "
+ "choices=[1, 2, 3], help='HELP', metavar='METAVAR')")
+ self.assertStringEqual(option, string)
+
+ def test_argument(self):
+ argument = argparse.Action(
+ option_strings=[],
+ dest='x',
+ type=float,
+ nargs='?',
+ default=2.5,
+ choices=[0.5, 1.5, 2.5],
+ help='H HH H',
+ metavar='MV MV MV')
+ string = (
+ "Action(option_strings=[], dest='x', nargs='?', "
+ "const=None, default=2.5, type=%r, choices=[0.5, 1.5, 2.5], "
+ "help='H HH H', metavar='MV MV MV')" % float)
+ self.assertStringEqual(argument, string)
+
+ def test_namespace(self):
+ ns = argparse.Namespace(foo=42, bar='spam')
+ string = "Namespace(bar='spam', foo=42)"
+ self.assertStringEqual(ns, string)
+
+ def test_parser(self):
+ parser = argparse.ArgumentParser(prog='PROG')
+ string = (
+ "ArgumentParser(prog='PROG', usage=None, description=None, "
+ "version=None, formatter_class=%r, conflict_handler='error', "
+ "add_help=True)" % argparse.HelpFormatter)
+ self.assertStringEqual(parser, string)
+
+# ===============
+# Namespace tests
+# ===============
+
+class TestNamespace(TestCase):
+
+ def test_constructor(self):
+ ns = argparse.Namespace()
+ self.assertRaises(AttributeError, getattr, ns, 'x')
+
+ ns = argparse.Namespace(a=42, b='spam')
+ self.assertEqual(ns.a, 42)
+ self.assertEqual(ns.b, 'spam')
+
+ def test_equality(self):
+ ns1 = argparse.Namespace(a=1, b=2)
+ ns2 = argparse.Namespace(b=2, a=1)
+ ns3 = argparse.Namespace(a=1)
+ ns4 = argparse.Namespace(b=2)
+
+ self.assertEqual(ns1, ns2)
+ self.assertNotEqual(ns1, ns3)
+ self.assertNotEqual(ns1, ns4)
+ self.assertNotEqual(ns2, ns3)
+ self.assertNotEqual(ns2, ns4)
+ self.assertTrue(ns1 != ns3)
+ self.assertTrue(ns1 != ns4)
+ self.assertTrue(ns2 != ns3)
+ self.assertTrue(ns2 != ns4)
+
+
+# ===================
+# File encoding tests
+# ===================
+
+class TestEncoding(TestCase):
+
+ def _test_module_encoding(self, path):
+ path, _ = os.path.splitext(path)
+ path += ".py"
+ with codecs.open(path, 'r', 'utf8') as f:
+ f.read()
+
+ def test_argparse_module_encoding(self):
+ self._test_module_encoding(argparse.__file__)
+
+ def test_test_argparse_module_encoding(self):
+ self._test_module_encoding(__file__)
+
+# ===================
+# ArgumentError tests
+# ===================
+
+class TestArgumentError(TestCase):
+
+ def test_argument_error(self):
+ msg = "my error here"
+ error = argparse.ArgumentError(None, msg)
+ self.assertEqual(str(error), msg)
+
+# =======================
+# ArgumentTypeError tests
+# =======================
+
+class TestArgumentTypeError(TestCase):
+
+ def test_argument_type_error(self):
+
+ def spam(string):
+ raise argparse.ArgumentTypeError('spam!')
+
+ parser = ErrorRaisingArgumentParser(prog='PROG', add_help=False)
+ parser.add_argument('x', type=spam)
+ try:
+ parser.parse_args(['XXX'])
+ except ArgumentParserError:
+ expected = 'usage: PROG x\nPROG: error: argument x: spam!\n'
+ msg = sys.exc_info()[1].stderr
+ self.assertEqual(expected, msg)
+ else:
+ self.fail()
+
+# ======================
+# parse_known_args tests
+# ======================
+
+class TestParseKnownArgs(TestCase):
+
+ def test_optionals(self):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--foo')
+ args, extras = parser.parse_known_args('--foo F --bar --baz'.split())
+ self.assertEqual(NS(foo='F'), args)
+ self.assertEqual(['--bar', '--baz'], extras)
+
+ def test_mixed(self):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-v', nargs='?', const=1, type=int)
+ parser.add_argument('--spam', action='store_false')
+ parser.add_argument('badger')
+
+ argv = ["B", "C", "--foo", "-v", "3", "4"]
+ args, extras = parser.parse_known_args(argv)
+ self.assertEqual(NS(v=3, spam=True, badger="B"), args)
+ self.assertEqual(["C", "--foo", "4"], extras)
+
+# ==========================
+# add_argument metavar tests
+# ==========================
+
+class TestAddArgumentMetavar(TestCase):
+
+ EXPECTED_MESSAGE = "length of metavar tuple does not match nargs"
+
+ def do_test_no_exception(self, nargs, metavar):
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--foo", nargs=nargs, metavar=metavar)
+
+ def do_test_exception(self, nargs, metavar):
+ parser = argparse.ArgumentParser()
+ with self.assertRaises(ValueError) as cm:
+ parser.add_argument("--foo", nargs=nargs, metavar=metavar)
+ self.assertEqual(cm.exception.args[0], self.EXPECTED_MESSAGE)
+
+ # Unit tests for different values of metavar when nargs=None
+
+ def test_nargs_None_metavar_string(self):
+ self.do_test_no_exception(nargs=None, metavar="1")
+
+ def test_nargs_None_metavar_length0(self):
+ self.do_test_exception(nargs=None, metavar=tuple())
+
+ def test_nargs_None_metavar_length1(self):
+ self.do_test_no_exception(nargs=None, metavar=("1"))
+
+ def test_nargs_None_metavar_length2(self):
+ self.do_test_exception(nargs=None, metavar=("1", "2"))
+
+ def test_nargs_None_metavar_length3(self):
+ self.do_test_exception(nargs=None, metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=?
+
+ def test_nargs_optional_metavar_string(self):
+ self.do_test_no_exception(nargs="?", metavar="1")
+
+ def test_nargs_optional_metavar_length0(self):
+ self.do_test_exception(nargs="?", metavar=tuple())
+
+ def test_nargs_optional_metavar_length1(self):
+ self.do_test_no_exception(nargs="?", metavar=("1"))
+
+ def test_nargs_optional_metavar_length2(self):
+ self.do_test_exception(nargs="?", metavar=("1", "2"))
+
+ def test_nargs_optional_metavar_length3(self):
+ self.do_test_exception(nargs="?", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=*
+
+ def test_nargs_zeroormore_metavar_string(self):
+ self.do_test_no_exception(nargs="*", metavar="1")
+
+ def test_nargs_zeroormore_metavar_length0(self):
+ self.do_test_exception(nargs="*", metavar=tuple())
+
+ def test_nargs_zeroormore_metavar_length1(self):
+ self.do_test_no_exception(nargs="*", metavar=("1"))
+
+ def test_nargs_zeroormore_metavar_length2(self):
+ self.do_test_no_exception(nargs="*", metavar=("1", "2"))
+
+ def test_nargs_zeroormore_metavar_length3(self):
+ self.do_test_exception(nargs="*", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=+
+
+ def test_nargs_oneormore_metavar_string(self):
+ self.do_test_no_exception(nargs="+", metavar="1")
+
+ def test_nargs_oneormore_metavar_length0(self):
+ self.do_test_exception(nargs="+", metavar=tuple())
+
+ def test_nargs_oneormore_metavar_length1(self):
+ self.do_test_no_exception(nargs="+", metavar=("1"))
+
+ def test_nargs_oneormore_metavar_length2(self):
+ self.do_test_no_exception(nargs="+", metavar=("1", "2"))
+
+ def test_nargs_oneormore_metavar_length3(self):
+ self.do_test_exception(nargs="+", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=...
+
+ def test_nargs_remainder_metavar_string(self):
+ self.do_test_no_exception(nargs="...", metavar="1")
+
+ def test_nargs_remainder_metavar_length0(self):
+ self.do_test_no_exception(nargs="...", metavar=tuple())
+
+ def test_nargs_remainder_metavar_length1(self):
+ self.do_test_no_exception(nargs="...", metavar=("1"))
+
+ def test_nargs_remainder_metavar_length2(self):
+ self.do_test_no_exception(nargs="...", metavar=("1", "2"))
+
+ def test_nargs_remainder_metavar_length3(self):
+ self.do_test_no_exception(nargs="...", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=A...
+
+ def test_nargs_parser_metavar_string(self):
+ self.do_test_no_exception(nargs="A...", metavar="1")
+
+ def test_nargs_parser_metavar_length0(self):
+ self.do_test_exception(nargs="A...", metavar=tuple())
+
+ def test_nargs_parser_metavar_length1(self):
+ self.do_test_no_exception(nargs="A...", metavar=("1"))
+
+ def test_nargs_parser_metavar_length2(self):
+ self.do_test_exception(nargs="A...", metavar=("1", "2"))
+
+ def test_nargs_parser_metavar_length3(self):
+ self.do_test_exception(nargs="A...", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=1
+
+ def test_nargs_1_metavar_string(self):
+ self.do_test_no_exception(nargs=1, metavar="1")
+
+ def test_nargs_1_metavar_length0(self):
+ self.do_test_exception(nargs=1, metavar=tuple())
+
+ def test_nargs_1_metavar_length1(self):
+ self.do_test_no_exception(nargs=1, metavar=("1"))
+
+ def test_nargs_1_metavar_length2(self):
+ self.do_test_exception(nargs=1, metavar=("1", "2"))
+
+ def test_nargs_1_metavar_length3(self):
+ self.do_test_exception(nargs=1, metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=2
+
+ def test_nargs_2_metavar_string(self):
+ self.do_test_no_exception(nargs=2, metavar="1")
+
+ def test_nargs_2_metavar_length0(self):
+ self.do_test_exception(nargs=2, metavar=tuple())
+
+ def test_nargs_2_metavar_length1(self):
+ self.do_test_no_exception(nargs=2, metavar=("1"))
+
+ def test_nargs_2_metavar_length2(self):
+ self.do_test_no_exception(nargs=2, metavar=("1", "2"))
+
+ def test_nargs_2_metavar_length3(self):
+ self.do_test_exception(nargs=2, metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=3
+
+ def test_nargs_3_metavar_string(self):
+ self.do_test_no_exception(nargs=3, metavar="1")
+
+ def test_nargs_3_metavar_length0(self):
+ self.do_test_exception(nargs=3, metavar=tuple())
+
+ def test_nargs_3_metavar_length1(self):
+ self.do_test_no_exception(nargs=3, metavar=("1"))
+
+ def test_nargs_3_metavar_length2(self):
+ self.do_test_exception(nargs=3, metavar=("1", "2"))
+
+ def test_nargs_3_metavar_length3(self):
+ self.do_test_no_exception(nargs=3, metavar=("1", "2", "3"))
+
+# ============================
+# from argparse import * tests
+# ============================
+
+class TestImportStar(TestCase):
+
+ def test(self):
+ for name in argparse.__all__:
+ self.assertTrue(hasattr(argparse, name))
+
+ def test_all_exports_everything_but_modules(self):
+ items = [
+ name
+ for name, value in vars(argparse).items()
+ if not (name.startswith("_") or name == 'ngettext')
+ if not inspect.ismodule(value)
+ ]
+ self.assertEqual(sorted(items), sorted(argparse.__all__))
+
+def test_main():
+ # silence warnings about version argument - these are expected
+ with support.check_warnings(
+ ('The "version" argument to ArgumentParser is deprecated.',
+ DeprecationWarning),
+ ('The (format|print)_version method is deprecated',
+ DeprecationWarning)):
+ support.run_unittest(__name__)
+ # Remove global references to avoid looking like we have refleaks.
+ RFile.seen = {}
+ WFile.seen = set()
+
+
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 62997d7300..5190c357ea 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -1,21 +1,28 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Test the arraymodule.
Roger E. Masse
"""
import unittest
from test import support
-from weakref import proxy
-import array, io, math
-from pickle import loads, dumps, HIGHEST_PROTOCOL
+import weakref
+import pickle
import operator
+import io
+import math
+import struct
+import warnings
+
+import array
+from array import _array_reconstructor as array_reconstructor
+
class ArraySubclass(array.array):
pass
class ArraySubclassWithKwargs(array.array):
def __init__(self, typecode, newarg=None):
- array.array.__init__(self, typecode)
+ array.array.__init__(self)
tests = [] # list to accumulate all tests
typecodes = "ubBhHiIlLfd"
@@ -30,6 +37,137 @@ class BadConstructorTest(unittest.TestCase):
tests.append(BadConstructorTest)
+# Machine format codes.
+#
+# Search for "enum machine_format_code" in Modules/arraymodule.c to get the
+# authoritative values.
+UNKNOWN_FORMAT = -1
+UNSIGNED_INT8 = 0
+SIGNED_INT8 = 1
+UNSIGNED_INT16_LE = 2
+UNSIGNED_INT16_BE = 3
+SIGNED_INT16_LE = 4
+SIGNED_INT16_BE = 5
+UNSIGNED_INT32_LE = 6
+UNSIGNED_INT32_BE = 7
+SIGNED_INT32_LE = 8
+SIGNED_INT32_BE = 9
+UNSIGNED_INT64_LE = 10
+UNSIGNED_INT64_BE = 11
+SIGNED_INT64_LE = 12
+SIGNED_INT64_BE = 13
+IEEE_754_FLOAT_LE = 14
+IEEE_754_FLOAT_BE = 15
+IEEE_754_DOUBLE_LE = 16
+IEEE_754_DOUBLE_BE = 17
+UTF16_LE = 18
+UTF16_BE = 19
+UTF32_LE = 20
+UTF32_BE = 21
+
+class ArrayReconstructorTest(unittest.TestCase):
+
+ def test_error(self):
+ self.assertRaises(TypeError, array_reconstructor,
+ "", "b", 0, b"")
+ self.assertRaises(TypeError, array_reconstructor,
+ str, "b", 0, b"")
+ self.assertRaises(TypeError, array_reconstructor,
+ array.array, "b", '', b"")
+ self.assertRaises(TypeError, array_reconstructor,
+ array.array, "b", 0, "")
+ self.assertRaises(ValueError, array_reconstructor,
+ array.array, "?", 0, b"")
+ self.assertRaises(ValueError, array_reconstructor,
+ array.array, "b", UNKNOWN_FORMAT, b"")
+ self.assertRaises(ValueError, array_reconstructor,
+ array.array, "b", 22, b"")
+ self.assertRaises(ValueError, array_reconstructor,
+ array.array, "d", 16, b"a")
+
+ def test_numbers(self):
+ testcases = (
+ (['B', 'H', 'I', 'L'], UNSIGNED_INT8, '=BBBB',
+ [0x80, 0x7f, 0, 0xff]),
+ (['b', 'h', 'i', 'l'], SIGNED_INT8, '=bbb',
+ [-0x80, 0x7f, 0]),
+ (['H', 'I', 'L'], UNSIGNED_INT16_LE, '<HHHH',
+ [0x8000, 0x7fff, 0, 0xffff]),
+ (['H', 'I', 'L'], UNSIGNED_INT16_BE, '>HHHH',
+ [0x8000, 0x7fff, 0, 0xffff]),
+ (['h', 'i', 'l'], SIGNED_INT16_LE, '<hhh',
+ [-0x8000, 0x7fff, 0]),
+ (['h', 'i', 'l'], SIGNED_INT16_BE, '>hhh',
+ [-0x8000, 0x7fff, 0]),
+ (['I', 'L'], UNSIGNED_INT32_LE, '<IIII',
+ [1<<31, (1<<31)-1, 0, (1<<32)-1]),
+ (['I', 'L'], UNSIGNED_INT32_BE, '>IIII',
+ [1<<31, (1<<31)-1, 0, (1<<32)-1]),
+ (['i', 'l'], SIGNED_INT32_LE, '<iii',
+ [-1<<31, (1<<31)-1, 0]),
+ (['i', 'l'], SIGNED_INT32_BE, '>iii',
+ [-1<<31, (1<<31)-1, 0]),
+ (['L'], UNSIGNED_INT64_LE, '<QQQQ',
+ [1<<31, (1<<31)-1, 0, (1<<32)-1]),
+ (['L'], UNSIGNED_INT64_BE, '>QQQQ',
+ [1<<31, (1<<31)-1, 0, (1<<32)-1]),
+ (['l'], SIGNED_INT64_LE, '<qqq',
+ [-1<<31, (1<<31)-1, 0]),
+ (['l'], SIGNED_INT64_BE, '>qqq',
+ [-1<<31, (1<<31)-1, 0]),
+ # The following tests for INT64 will raise an OverflowError
+ # when run on a 32-bit machine. The tests are simply skipped
+ # in that case.
+ (['L'], UNSIGNED_INT64_LE, '<QQQQ',
+ [1<<63, (1<<63)-1, 0, (1<<64)-1]),
+ (['L'], UNSIGNED_INT64_BE, '>QQQQ',
+ [1<<63, (1<<63)-1, 0, (1<<64)-1]),
+ (['l'], SIGNED_INT64_LE, '<qqq',
+ [-1<<63, (1<<63)-1, 0]),
+ (['l'], SIGNED_INT64_BE, '>qqq',
+ [-1<<63, (1<<63)-1, 0]),
+ (['f'], IEEE_754_FLOAT_LE, '<ffff',
+ [16711938.0, float('inf'), float('-inf'), -0.0]),
+ (['f'], IEEE_754_FLOAT_BE, '>ffff',
+ [16711938.0, float('inf'), float('-inf'), -0.0]),
+ (['d'], IEEE_754_DOUBLE_LE, '<dddd',
+ [9006104071832581.0, float('inf'), float('-inf'), -0.0]),
+ (['d'], IEEE_754_DOUBLE_BE, '>dddd',
+ [9006104071832581.0, float('inf'), float('-inf'), -0.0])
+ )
+ for testcase in testcases:
+ valid_typecodes, mformat_code, struct_fmt, values = testcase
+ arraystr = struct.pack(struct_fmt, *values)
+ for typecode in valid_typecodes:
+ try:
+ a = array.array(typecode, values)
+ except OverflowError:
+ continue # Skip this test case.
+ b = array_reconstructor(
+ array.array, typecode, mformat_code, arraystr)
+ self.assertEqual(a, b,
+ msg="{0!r} != {1!r}; testcase={2!r}".format(a, b, testcase))
+
+ def test_unicode(self):
+ teststr = "Bonne Journ\xe9e \U0002030a\U00020347"
+ testcases = (
+ (UTF16_LE, "UTF-16-LE"),
+ (UTF16_BE, "UTF-16-BE"),
+ (UTF32_LE, "UTF-32-LE"),
+ (UTF32_BE, "UTF-32-BE")
+ )
+ for testcase in testcases:
+ mformat_code, encoding = testcase
+ a = array.array('u', teststr)
+ b = array_reconstructor(
+ array.array, 'u', mformat_code, teststr.encode(encoding))
+ self.assertEqual(a, b,
+ msg="{0!r} != {1!r}; testcase={2!r}".format(a, b, testcase))
+
+
+tests.append(ArrayReconstructorTest)
+
+
class BaseTest(unittest.TestCase):
# Required class attributes (provided by subclasses
# typecode: the typecode to test
@@ -64,10 +202,10 @@ class BaseTest(unittest.TestCase):
a = array.array(self.typecode, self.example)
self.assertRaises(TypeError, a.buffer_info, 42)
bi = a.buffer_info()
- self.assertTrue(isinstance(bi, tuple))
+ self.assertIsInstance(bi, tuple)
self.assertEqual(len(bi), 2)
- self.assertTrue(isinstance(bi[0], int))
- self.assertTrue(isinstance(bi[1], int))
+ self.assertIsInstance(bi[0], int)
+ self.assertIsInstance(bi[1], int)
self.assertEqual(bi[1], len(a))
def test_byteswap(self):
@@ -97,31 +235,38 @@ class BaseTest(unittest.TestCase):
self.assertNotEqual(id(a), id(b))
self.assertEqual(a, b)
+ def test_reduce_ex(self):
+ a = array.array(self.typecode, self.example)
+ for protocol in range(3):
+ self.assertIs(a.__reduce_ex__(protocol)[0], array.array)
+ for protocol in range(3, pickle.HIGHEST_PROTOCOL):
+ self.assertIs(a.__reduce_ex__(protocol)[0], array_reconstructor)
+
def test_pickle(self):
- for protocol in range(HIGHEST_PROTOCOL + 1):
+ for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
a = array.array(self.typecode, self.example)
- b = loads(dumps(a, protocol))
+ b = pickle.loads(pickle.dumps(a, protocol))
self.assertNotEqual(id(a), id(b))
self.assertEqual(a, b)
a = ArraySubclass(self.typecode, self.example)
a.x = 10
- b = loads(dumps(a, protocol))
+ b = pickle.loads(pickle.dumps(a, protocol))
self.assertNotEqual(id(a), id(b))
self.assertEqual(a, b)
self.assertEqual(a.x, b.x)
self.assertEqual(type(a), type(b))
def test_pickle_for_empty_array(self):
- for protocol in range(HIGHEST_PROTOCOL + 1):
+ for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
a = array.array(self.typecode)
- b = loads(dumps(a, protocol))
+ b = pickle.loads(pickle.dumps(a, protocol))
self.assertNotEqual(id(a), id(b))
self.assertEqual(a, b)
a = ArraySubclass(self.typecode)
a.x = 10
- b = loads(dumps(a, protocol))
+ b = pickle.loads(pickle.dumps(a, protocol))
self.assertNotEqual(id(a), id(b))
self.assertEqual(a, b)
self.assertEqual(a.x, b.x)
@@ -193,6 +338,25 @@ class BaseTest(unittest.TestCase):
f.close()
support.unlink(support.TESTFN)
+ def test_filewrite(self):
+ a = array.array(self.typecode, 2*self.example)
+ f = open(support.TESTFN, 'wb')
+ try:
+ f.write(a)
+ f.close()
+ b = array.array(self.typecode)
+ f = open(support.TESTFN, 'rb')
+ b.fromfile(f, len(self.example))
+ self.assertEqual(b, array.array(self.typecode, self.example))
+ self.assertNotEqual(a, b)
+ b.fromfile(f, len(self.example))
+ self.assertEqual(a, b)
+ f.close()
+ finally:
+ if not f.closed:
+ f.close()
+ support.unlink(support.TESTFN)
+
def test_tofromlist(self):
a = array.array(self.typecode, 2*self.example)
b = array.array(self.typecode)
@@ -204,15 +368,40 @@ class BaseTest(unittest.TestCase):
self.assertEqual(a, b)
def test_tofromstring(self):
+ nb_warnings = 4
+ with warnings.catch_warnings(record=True) as r:
+ warnings.filterwarnings("always",
+ message=r"(to|from)string\(\) is deprecated",
+ category=DeprecationWarning)
+ a = array.array(self.typecode, 2*self.example)
+ b = array.array(self.typecode)
+ self.assertRaises(TypeError, a.tostring, 42)
+ self.assertRaises(TypeError, b.fromstring)
+ self.assertRaises(TypeError, b.fromstring, 42)
+ b.fromstring(a.tostring())
+ self.assertEqual(a, b)
+ if a.itemsize>1:
+ self.assertRaises(ValueError, b.fromstring, "x")
+ nb_warnings += 1
+ self.assertEqual(len(r), nb_warnings)
+
+ def test_tofrombytes(self):
a = array.array(self.typecode, 2*self.example)
b = array.array(self.typecode)
- self.assertRaises(TypeError, a.tostring, 42)
- self.assertRaises(TypeError, b.fromstring)
- self.assertRaises(TypeError, b.fromstring, 42)
- b.fromstring(a.tostring())
+ self.assertRaises(TypeError, a.tobytes, 42)
+ self.assertRaises(TypeError, b.frombytes)
+ self.assertRaises(TypeError, b.frombytes, 42)
+ b.frombytes(a.tobytes())
+ c = array.array(self.typecode, bytearray(a.tobytes()))
self.assertEqual(a, b)
+ self.assertEqual(a, c)
if a.itemsize>1:
- self.assertRaises(ValueError, b.fromstring, "x")
+ self.assertRaises(ValueError, b.frombytes, b"x")
+
+ def test_fromarray(self):
+ a = array.array(self.typecode, self.example)
+ b = array.array(self.typecode, a)
+ self.assertEqual(a, b)
def test_repr(self):
a = array.array(self.typecode, 2*self.example)
@@ -320,6 +509,12 @@ class BaseTest(unittest.TestCase):
array.array(self.typecode)
)
+ a = 5 * array.array(self.typecode, self.example[:1])
+ self.assertEqual(
+ a,
+ array.array(self.typecode, [a[0]] * 5)
+ )
+
self.assertRaises(TypeError, a.__mul__, "bad")
def test_imul(self):
@@ -735,8 +930,8 @@ class BaseTest(unittest.TestCase):
a = array.array(self.typecode, self.example)
m = memoryview(a)
expected = m.tobytes()
- self.assertEqual(a.tostring(), expected)
- self.assertEqual(a.tostring()[0], expected[0])
+ self.assertEqual(a.tobytes(), expected)
+ self.assertEqual(a.tobytes()[0], expected[0])
# Resizing is forbidden when there are buffer exports.
# For issue 4509, we also check after each error that
# the array was not modified.
@@ -750,7 +945,7 @@ class BaseTest(unittest.TestCase):
self.assertEqual(m.tobytes(), expected)
self.assertRaises(BufferError, a.fromlist, a.tolist())
self.assertEqual(m.tobytes(), expected)
- self.assertRaises(BufferError, a.fromstring, a.tostring())
+ self.assertRaises(BufferError, a.frombytes, a.tobytes())
self.assertEqual(m.tobytes(), expected)
if self.typecode == 'u':
self.assertRaises(BufferError, a.fromunicode, a.tounicode())
@@ -768,8 +963,8 @@ class BaseTest(unittest.TestCase):
def test_weakref(self):
s = array.array(self.typecode, self.example)
- p = proxy(s)
- self.assertEqual(p.tostring(), s.tostring())
+ p = weakref.proxy(s)
+ self.assertEqual(p.tobytes(), s.tobytes())
s = None
self.assertRaises(ReferenceError, len, p)
@@ -923,6 +1118,11 @@ class NumberTest(BaseTest):
self.assertRaises(AttributeError, setattr, a, "color", "blue")
+ def test_frombytearray(self):
+ a = array.array('b', range(10))
+ b = array.array(self.typecode, a)
+ self.assertEqual(a, b)
+
class SignedNumberTest(NumberTest):
example = [-1, 0, 1, 42, 0x7f]
smallerexample = [-1, 0, 1, 42, 0x7e]
@@ -947,6 +1147,23 @@ class UnsignedNumberTest(NumberTest):
upper = int(pow(2, a.itemsize * 8)) - 1
self.check_overflow(lower, upper)
+ def test_bytes_extend(self):
+ s = bytes(self.example)
+
+ a = array.array(self.typecode, self.example)
+ a.extend(s)
+ self.assertEqual(
+ a,
+ array.array(self.typecode, self.example+self.example)
+ )
+
+ a = array.array(self.typecode, self.example)
+ a.extend(bytearray(reversed(s)))
+ self.assertEqual(
+ a,
+ array.array(self.typecode, self.example+self.example[::-1])
+ )
+
class ByteTest(SignedNumberTest):
typecode = 'b'
@@ -1009,7 +1226,7 @@ class FPTest(NumberTest):
# On alphas treating the byte swapped bit patters as
# floats/doubles results in floating point exceptions
# => compare the 8bit string values instead
- self.assertNotEqual(a.tostring(), b.tostring())
+ self.assertNotEqual(a.tobytes(), b.tobytes())
b.byteswap()
self.assertEqual(a, b)
diff --git a/Lib/test/test_ascii_formatd.py b/Lib/test/test_ascii_formatd.py
deleted file mode 100644
index 65d8608585..0000000000
--- a/Lib/test/test_ascii_formatd.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# PyOS_ascii_formatd is deprecated and not called from anywhere in
-# Python itself. So this module is the only place it gets tested.
-# Test that it works, and test that it's deprecated.
-
-import unittest
-from test.support import check_warnings, run_unittest, cpython_only, import_module
-
-import_module('ctypes')
-
-class FormatDeprecationTests(unittest.TestCase):
-
- @cpython_only
- def testFormatDeprecation(self):
- # delay importing ctypes until we know we're in CPython
- from ctypes import (pythonapi, create_string_buffer, sizeof, byref,
- c_double)
- PyOS_ascii_formatd = pythonapi.PyOS_ascii_formatd
- buf = create_string_buffer(100)
-
- with check_warnings() as w:
- PyOS_ascii_formatd(byref(buf), sizeof(buf), b'%+.10f',
- c_double(10.0))
- self.assertEqual(buf.value, b'+10.0000000000')
-
- self.assertEqual(str(w.message), 'PyOS_ascii_formatd is deprecated, '
- 'use PyOS_double_to_string instead')
-
-class FormatTests(unittest.TestCase):
- # ensure that, for the restricted set of format codes,
- # %-formatting returns the same values os PyOS_ascii_formatd
- @cpython_only
- def testFormat(self):
- # delay importing ctypes until we know we're in CPython
- from ctypes import (pythonapi, create_string_buffer, sizeof, byref,
- c_double)
- PyOS_ascii_formatd = pythonapi.PyOS_ascii_formatd
- buf = create_string_buffer(100)
-
- tests = [
- ('%f', 100.0),
- ('%g', 100.0),
- ('%#g', 100.0),
- ('%#.2g', 100.0),
- ('%#.2g', 123.4567),
- ('%#.2g', 1.234567e200),
- ('%e', 1.234567e200),
- ('%e', 1.234),
- ('%+e', 1.234),
- ('%-e', 1.234),
- ]
-
- with check_warnings():
- for format, val in tests:
- PyOS_ascii_formatd(byref(buf), sizeof(buf),
- bytes(format, 'ascii'),
- c_double(val))
- self.assertEqual(buf.value, bytes(format % val, 'ascii'))
-
-
-def test_main():
- run_unittest(FormatDeprecationTests, FormatTests)
-
-if __name__ == '__main__':
- test_main()
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index de19c8a391..da07060194 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -60,6 +60,10 @@ exec_tests = [
"break",
# Continue
"continue",
+ # for statements with naked tuples (see http://bugs.python.org/issue6704)
+ "for a,b in c: pass",
+ "[(a,b) for a,b in c]",
+ "((a,b) for a,b in c)",
]
# These are compiled through "single"
@@ -140,6 +144,16 @@ class AST_Tests(unittest.TestCase):
self.assertEqual(to_tuple(ast_tree), o)
self._assertTrueorder(ast_tree, (0, 0))
+ def test_slice(self):
+ slc = ast.parse("x[::]").body[0].value.slice
+ self.assertIsNone(slc.upper)
+ self.assertIsNone(slc.lower)
+ self.assertIsNone(slc.step)
+
+ def test_from_import(self):
+ im = ast.parse("from . import y").body[0]
+ self.assertIsNone(im.module)
+
def test_base_classes(self):
self.assertTrue(issubclass(ast.For, ast.stmt))
self.assertTrue(issubclass(ast.Name, ast.expr))
@@ -186,12 +200,9 @@ class AST_Tests(unittest.TestCase):
def test_invalid_sum(self):
pos = dict(lineno=2, col_offset=3)
m = ast.Module([ast.Expr(ast.expr(**pos), **pos)])
- try:
+ with self.assertRaises(TypeError) as cm:
compile(m, "<test>", "exec")
- except TypeError as exc:
- self.assertIn("but got <_ast.expr", str(exc))
- else:
- self.fail("needed TypeError")
+ self.assertIn("but got <_ast.expr", str(cm.exception))
class ASTHelpers_Test(unittest.TestCase):
@@ -289,13 +300,17 @@ class ASTHelpers_Test(unittest.TestCase):
self.assertEqual(ast.literal_eval('[1, 2, 3]'), [1, 2, 3])
self.assertEqual(ast.literal_eval('{"foo": 42}'), {"foo": 42})
self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None))
+ self.assertEqual(ast.literal_eval('{1, 2, 3}'), {1, 2, 3})
+ self.assertEqual(ast.literal_eval('b"hi"'), b"hi")
self.assertRaises(ValueError, ast.literal_eval, 'foo()')
+ self.assertEqual(ast.literal_eval('-6'), -6)
+ self.assertEqual(ast.literal_eval('-6j+3'), 3-6j)
+ self.assertEqual(ast.literal_eval('3.25'), 3.25)
def test_literal_eval_issue4907(self):
self.assertEqual(ast.literal_eval('2j'), 2j)
self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j)
self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j)
- self.assertRaises(ValueError, ast.literal_eval, '2 + (3 + 4j)')
def test_main():
@@ -337,6 +352,9 @@ exec_results = [
('Module', [('Pass', (1, 0))]),
('Module', [('Break', (1, 0))]),
('Module', [('Continue', (1, 0))]),
+('Module', [('For', (1, 0), ('Tuple', (1, 4), [('Name', (1, 4), 'a', ('Store',)), ('Name', (1, 6), 'b', ('Store',))], ('Store',)), ('Name', (1, 11), 'c', ('Load',)), [('Pass', (1, 14))], [])]),
+('Module', [('Expr', (1, 0), ('ListComp', (1, 1), ('Tuple', (1, 2), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [])]))]),
+('Module', [('Expr', (1, 0), ('GeneratorExp', (1, 1), ('Tuple', (1, 2), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [])]))]),
]
single_results = [
('Interactive', [('Expr', (1, 0), ('BinOp', (1, 0), ('Num', (1, 0), 1), ('Add',), ('Num', (1, 2), 2)))]),
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py
index f49701fd84..c79fe6f613 100644
--- a/Lib/test/test_asynchat.py
+++ b/Lib/test/test_asynchat.py
@@ -5,98 +5,109 @@ from test import support
# If this fails, the test will be skipped.
thread = support.import_module('_thread')
-import asyncore, asynchat, socket, threading, time
+import asyncore, asynchat, socket, time
import unittest
import sys
+try:
+ import threading
+except ImportError:
+ threading = None
HOST = support.HOST
SERVER_QUIT = b'QUIT\n'
-class echo_server(threading.Thread):
- # parameter to determine the number of bytes passed back to the
- # client each send
- chunk_size = 1
-
- def __init__(self, event):
- threading.Thread.__init__(self)
- self.event = event
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.port = support.bind_port(self.sock)
-
- def run(self):
- self.sock.listen(1)
- self.event.set()
- conn, client = self.sock.accept()
- self.buffer = b""
- # collect data until quit message is seen
- while SERVER_QUIT not in self.buffer:
- data = conn.recv(1)
- if not data:
- break
- self.buffer = self.buffer + data
-
- # remove the SERVER_QUIT message
- self.buffer = self.buffer.replace(SERVER_QUIT, b'')
-
- # re-send entire set of collected data
- try:
- # this may fail on some tests, such as test_close_when_done, since
- # the client closes the channel when it's done sending
- while self.buffer:
- n = conn.send(self.buffer[:self.chunk_size])
- time.sleep(0.001)
- self.buffer = self.buffer[n:]
- except:
- pass
-
- conn.close()
- self.sock.close()
-
-class echo_client(asynchat.async_chat):
-
- def __init__(self, terminator, server_port):
- asynchat.async_chat.__init__(self)
- self.contents = []
- self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
- self.connect((HOST, server_port))
- self.set_terminator(terminator)
- self.buffer = b""
-
- def handle_connect(self):
- pass
-
- if sys.platform == 'darwin':
- # select.poll returns a select.POLLHUP at the end of the tests
- # on darwin, so just ignore it
- def handle_expt(self):
- pass
-
- def collect_incoming_data(self, data):
- self.buffer += data
-
- def found_terminator(self):
- self.contents.append(self.buffer)
- self.buffer = b""
-
-
-def start_echo_server():
- event = threading.Event()
- s = echo_server(event)
- s.start()
- event.wait()
- event.clear()
- time.sleep(0.01) # Give server time to start accepting.
- return s, event
+if threading:
+ class echo_server(threading.Thread):
+ # parameter to determine the number of bytes passed back to the
+ # client each send
+ chunk_size = 1
+
+ def __init__(self, event):
+ threading.Thread.__init__(self)
+ self.event = event
+ self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.port = support.bind_port(self.sock)
+ # This will be set if the client wants us to wait before echoing data
+ # back.
+ self.start_resend_event = None
+
+ def run(self):
+ self.sock.listen(1)
+ self.event.set()
+ conn, client = self.sock.accept()
+ self.buffer = b""
+ # collect data until quit message is seen
+ while SERVER_QUIT not in self.buffer:
+ data = conn.recv(1)
+ if not data:
+ break
+ self.buffer = self.buffer + data
+
+ # remove the SERVER_QUIT message
+ self.buffer = self.buffer.replace(SERVER_QUIT, b'')
+
+ if self.start_resend_event:
+ self.start_resend_event.wait()
+
+ # re-send entire set of collected data
+ try:
+ # this may fail on some tests, such as test_close_when_done, since
+ # the client closes the channel when it's done sending
+ while self.buffer:
+ n = conn.send(self.buffer[:self.chunk_size])
+ time.sleep(0.001)
+ self.buffer = self.buffer[n:]
+ except:
+ pass
+
+ conn.close()
+ self.sock.close()
+
+ class echo_client(asynchat.async_chat):
+
+ def __init__(self, terminator, server_port):
+ asynchat.async_chat.__init__(self)
+ self.contents = []
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.connect((HOST, server_port))
+ self.set_terminator(terminator)
+ self.buffer = b""
+
+ def handle_connect(self):
+ pass
+
+ if sys.platform == 'darwin':
+ # select.poll returns a select.POLLHUP at the end of the tests
+ # on darwin, so just ignore it
+ def handle_expt(self):
+ pass
+
+ def collect_incoming_data(self, data):
+ self.buffer += data
+
+ def found_terminator(self):
+ self.contents.append(self.buffer)
+ self.buffer = b""
+
+ def start_echo_server():
+ event = threading.Event()
+ s = echo_server(event)
+ s.start()
+ event.wait()
+ event.clear()
+ time.sleep(0.01) # Give server time to start accepting.
+ return s, event
+@unittest.skipUnless(threading, 'Threading required for this test.')
class TestAsynchat(unittest.TestCase):
usepoll = False
def setUp (self):
- pass
+ self._threads = support.threading_setup()
def tearDown (self):
- pass
+ support.threading_cleanup(*self._threads)
def line_terminator_check(self, term, server_chunk):
event = threading.Event()
@@ -203,11 +214,18 @@ class TestAsynchat(unittest.TestCase):
def test_close_when_done(self):
s, event = start_echo_server()
+ s.start_resend_event = threading.Event()
c = echo_client(b'\n', s.port)
c.push(b"hello world\nI'm not dead yet!\n")
c.push(SERVER_QUIT)
c.close_when_done()
asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
+
+ # Only allow the server to start echoing data back to the client after
+ # the client has closed its connection. This prevents a race condition
+ # where the server echoes all of its data before we can check that it
+ # got any down below.
+ s.start_resend_event.set()
s.join()
self.assertEqual(c.contents, [])
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index fc1d1666d4..53c49a803b 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -3,9 +3,9 @@ import unittest
import select
import os
import socket
-import threading
import sys
import time
+import warnings
import errno
from test import support
@@ -13,6 +13,11 @@ from test.support import TESTFN, run_unittest, unlink
from io import BytesIO
from io import StringIO
+try:
+ import threading
+except ImportError:
+ threading = None
+
HOST = support.HOST
class dummysocket:
@@ -113,65 +118,65 @@ class HelperFunctionTests(unittest.TestCase):
# http://mail.python.org/pipermail/python-list/2001-October/109973.html)
# These constants should be present as long as poll is available
- if hasattr(select, 'poll'):
- def test_readwrite(self):
- # Check that correct methods are called by readwrite()
-
- attributes = ('read', 'expt', 'write', 'closed', 'error_handled')
-
- expected = (
- (select.POLLIN, 'read'),
- (select.POLLPRI, 'expt'),
- (select.POLLOUT, 'write'),
- (select.POLLERR, 'closed'),
- (select.POLLHUP, 'closed'),
- (select.POLLNVAL, 'closed'),
- )
-
- class testobj:
- def __init__(self):
- self.read = False
- self.write = False
- self.closed = False
- self.expt = False
- self.error_handled = False
-
- def handle_read_event(self):
- self.read = True
-
- def handle_write_event(self):
- self.write = True
-
- def handle_close(self):
- self.closed = True
-
- def handle_expt_event(self):
- self.expt = True
-
- def handle_error(self):
- self.error_handled = True
-
- for flag, expectedattr in expected:
- tobj = testobj()
- self.assertEqual(getattr(tobj, expectedattr), False)
- asyncore.readwrite(tobj, flag)
-
- # Only the attribute modified by the routine we expect to be
- # called should be True.
- for attr in attributes:
- self.assertEqual(getattr(tobj, attr), attr==expectedattr)
-
- # check that ExitNow exceptions in the object handler method
- # bubbles all the way up through asyncore readwrite call
- tr1 = exitingdummy()
- self.assertRaises(asyncore.ExitNow, asyncore.readwrite, tr1, flag)
-
- # check that an exception other than ExitNow in the object handler
- # method causes the handle_error method to get called
- tr2 = crashingdummy()
- self.assertEqual(tr2.error_handled, False)
- asyncore.readwrite(tr2, flag)
- self.assertEqual(tr2.error_handled, True)
+ @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
+ def test_readwrite(self):
+ # Check that correct methods are called by readwrite()
+
+ attributes = ('read', 'expt', 'write', 'closed', 'error_handled')
+
+ expected = (
+ (select.POLLIN, 'read'),
+ (select.POLLPRI, 'expt'),
+ (select.POLLOUT, 'write'),
+ (select.POLLERR, 'closed'),
+ (select.POLLHUP, 'closed'),
+ (select.POLLNVAL, 'closed'),
+ )
+
+ class testobj:
+ def __init__(self):
+ self.read = False
+ self.write = False
+ self.closed = False
+ self.expt = False
+ self.error_handled = False
+
+ def handle_read_event(self):
+ self.read = True
+
+ def handle_write_event(self):
+ self.write = True
+
+ def handle_close(self):
+ self.closed = True
+
+ def handle_expt_event(self):
+ self.expt = True
+
+ def handle_error(self):
+ self.error_handled = True
+
+ for flag, expectedattr in expected:
+ tobj = testobj()
+ self.assertEqual(getattr(tobj, expectedattr), False)
+ asyncore.readwrite(tobj, flag)
+
+ # Only the attribute modified by the routine we expect to be
+ # called should be True.
+ for attr in attributes:
+ self.assertEqual(getattr(tobj, attr), attr==expectedattr)
+
+ # check that ExitNow exceptions in the object handler method
+ # bubbles all the way up through asyncore readwrite call
+ tr1 = exitingdummy()
+ self.assertRaises(asyncore.ExitNow, asyncore.readwrite, tr1, flag)
+
+ # check that an exception other than ExitNow in the object handler
+ # method causes the handle_error method to get called
+ tr2 = crashingdummy()
+ self.assertEqual(tr2.error_handled, False)
+ asyncore.readwrite(tr2, flag)
+ self.assertEqual(tr2.error_handled, True)
def test_closeall(self):
self.closeall_check(False)
@@ -291,7 +296,6 @@ class DispatcherTests(unittest.TestCase):
d.handle_read()
d.handle_write()
d.handle_connect()
- d.handle_accept()
finally:
sys.stdout = stdout
@@ -299,22 +303,25 @@ class DispatcherTests(unittest.TestCase):
expected = ['warning: unhandled incoming priority event',
'warning: unhandled read event',
'warning: unhandled write event',
- 'warning: unhandled connect event',
- 'warning: unhandled accept event']
+ 'warning: unhandled connect event']
self.assertEqual(lines, expected)
def test_issue_8594(self):
+ # XXX - this test is supposed to be removed in next major Python
+ # version
d = asyncore.dispatcher(socket.socket())
# make sure the error message no longer refers to the socket
# object but the dispatcher instance instead
- try:
- d.foo
- except AttributeError as err:
- self.assertTrue('dispatcher instance' in str(err))
- else:
- self.fail("exception not raised")
- # test cheap inheritance with the underlying socket
- self.assertEqual(d.family, socket.AF_INET)
+ self.assertRaisesRegex(AttributeError, 'dispatcher instance',
+ getattr, d, 'foo')
+ # cheap inheritance with the underlying socket is supposed
+ # to still work but a DeprecationWarning is expected
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always")
+ family = d.family
+ self.assertEqual(family, socket.AF_INET)
+ self.assertEqual(len(w), 1)
+ self.assertTrue(issubclass(w[0].category, DeprecationWarning))
def test_strerror(self):
# refers to bug #8573
@@ -322,7 +329,7 @@ class DispatcherTests(unittest.TestCase):
if hasattr(os, 'strerror'):
self.assertEqual(err, os.strerror(errno.EPERM))
err = asyncore._strerror(-1)
- self.assertTrue("unknown error" in err.lower())
+ self.assertTrue(err != "")
class dispatcherwithsend_noread(asyncore.dispatcher_with_send):
@@ -341,98 +348,401 @@ class DispatcherWithSendTests(unittest.TestCase):
def tearDown(self):
asyncore.close_all()
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ @support.reap_threads
def test_send(self):
- self.evt = threading.Event()
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.sock.settimeout(3)
- self.port = support.bind_port(self.sock)
+ evt = threading.Event()
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.settimeout(3)
+ port = support.bind_port(sock)
cap = BytesIO()
- args = (self.evt, cap, self.sock)
- threading.Thread(target=capture_server, args=args).start()
-
- # wait a little longer for the server to initialize (it sometimes
- # refuses connections on slow machines without this wait)
- time.sleep(0.2)
+ args = (evt, cap, sock)
+ t = threading.Thread(target=capture_server, args=args)
+ t.start()
+ try:
+ # wait a little longer for the server to initialize (it sometimes
+ # refuses connections on slow machines without this wait)
+ time.sleep(0.2)
- data = b"Suppose there isn't a 16-ton weight?"
- d = dispatcherwithsend_noread()
- d.create_socket(socket.AF_INET, socket.SOCK_STREAM)
- d.connect((HOST, self.port))
+ data = b"Suppose there isn't a 16-ton weight?"
+ d = dispatcherwithsend_noread()
+ d.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ d.connect((HOST, port))
- # give time for socket to connect
- time.sleep(0.1)
+ # give time for socket to connect
+ time.sleep(0.1)
- d.send(data)
- d.send(data)
- d.send(b'\n')
+ d.send(data)
+ d.send(data)
+ d.send(b'\n')
- n = 1000
- while d.out_buffer and n > 0:
- asyncore.poll()
- n -= 1
+ n = 1000
+ while d.out_buffer and n > 0:
+ asyncore.poll()
+ n -= 1
- self.evt.wait()
+ evt.wait()
- self.assertEqual(cap.getvalue(), data*2)
+ self.assertEqual(cap.getvalue(), data*2)
+ finally:
+ t.join()
class DispatcherWithSendTests_UsePoll(DispatcherWithSendTests):
usepoll = True
-if hasattr(asyncore, 'file_wrapper'):
- class FileWrapperTest(unittest.TestCase):
- def setUp(self):
- self.d = b"It's not dead, it's sleeping!"
- open(TESTFN, 'wb').write(self.d)
-
- def tearDown(self):
- unlink(TESTFN)
-
- def test_recv(self):
- fd = os.open(TESTFN, os.O_RDONLY)
- w = asyncore.file_wrapper(fd)
- os.close(fd)
-
- self.assertNotEqual(w.fd, fd)
- self.assertNotEqual(w.fileno(), fd)
- self.assertEqual(w.recv(13), b"It's not dead")
- self.assertEqual(w.read(6), b", it's")
- w.close()
- self.assertRaises(OSError, w.read, 1)
-
- def test_send(self):
- d1 = b"Come again?"
- d2 = b"I want to buy some cheese."
- fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND)
- w = asyncore.file_wrapper(fd)
- os.close(fd)
-
- w.write(d1)
- w.send(d2)
- w.close()
- self.assertEqual(open(TESTFN, 'rb').read(), self.d + d1 + d2)
-
- @unittest.skipUnless(hasattr(asyncore, 'file_dispatcher'),
- ' asyncore.file_dispatcher required')
- def test_dispatcher(self):
- fd = os.open(TESTFN, os.O_RDONLY)
- data = []
- class FileDispatcher(asyncore.file_dispatcher):
- def handle_read(self):
- data.append(self.recv(29))
- s = FileDispatcher(fd)
- os.close(fd)
- asyncore.loop(timeout=0.01, use_poll=True, count=2)
- self.assertEqual(b"".join(data), self.d)
+@unittest.skipUnless(hasattr(asyncore, 'file_wrapper'),
+ 'asyncore.file_wrapper required')
+class FileWrapperTest(unittest.TestCase):
+ def setUp(self):
+ self.d = b"It's not dead, it's sleeping!"
+ with open(TESTFN, 'wb') as file:
+ file.write(self.d)
+
+ def tearDown(self):
+ unlink(TESTFN)
+
+ def test_recv(self):
+ fd = os.open(TESTFN, os.O_RDONLY)
+ w = asyncore.file_wrapper(fd)
+ os.close(fd)
+
+ self.assertNotEqual(w.fd, fd)
+ self.assertNotEqual(w.fileno(), fd)
+ self.assertEqual(w.recv(13), b"It's not dead")
+ self.assertEqual(w.read(6), b", it's")
+ w.close()
+ self.assertRaises(OSError, w.read, 1)
+
+ def test_send(self):
+ d1 = b"Come again?"
+ d2 = b"I want to buy some cheese."
+ fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND)
+ w = asyncore.file_wrapper(fd)
+ os.close(fd)
+
+ w.write(d1)
+ w.send(d2)
+ w.close()
+ with open(TESTFN, 'rb') as file:
+ self.assertEqual(file.read(), self.d + d1 + d2)
+
+ @unittest.skipUnless(hasattr(asyncore, 'file_dispatcher'),
+ 'asyncore.file_dispatcher required')
+ def test_dispatcher(self):
+ fd = os.open(TESTFN, os.O_RDONLY)
+ data = []
+ class FileDispatcher(asyncore.file_dispatcher):
+ def handle_read(self):
+ data.append(self.recv(29))
+ s = FileDispatcher(fd)
+ os.close(fd)
+ asyncore.loop(timeout=0.01, use_poll=True, count=2)
+ self.assertEqual(b"".join(data), self.d)
+
+
+class BaseTestHandler(asyncore.dispatcher):
+
+ def __init__(self, sock=None):
+ asyncore.dispatcher.__init__(self, sock)
+ self.flag = False
+
+ def handle_accept(self):
+ raise Exception("handle_accept not supposed to be called")
+
+ def handle_accepted(self):
+ raise Exception("handle_accepted not supposed to be called")
+
+ def handle_connect(self):
+ raise Exception("handle_connect not supposed to be called")
+
+ def handle_expt(self):
+ raise Exception("handle_expt not supposed to be called")
+
+ def handle_close(self):
+ raise Exception("handle_close not supposed to be called")
+
+ def handle_error(self):
+ raise
+
+
+class TCPServer(asyncore.dispatcher):
+ """A server which listens on an address and dispatches the
+ connection to a handler.
+ """
+
+ def __init__(self, handler=BaseTestHandler, host=HOST, port=0):
+ asyncore.dispatcher.__init__(self)
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.set_reuse_addr()
+ self.bind((host, port))
+ self.listen(5)
+ self.handler = handler
+
+ @property
+ def address(self):
+ return self.socket.getsockname()[:2]
+
+ def handle_accepted(self, sock, addr):
+ self.handler(sock)
+
+ def handle_error(self):
+ raise
+
+
+class BaseClient(BaseTestHandler):
+
+ def __init__(self, address):
+ BaseTestHandler.__init__(self)
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.connect(address)
+
+ def handle_connect(self):
+ pass
+
+
+class BaseTestAPI(unittest.TestCase):
+
+ def tearDown(self):
+ asyncore.close_all()
+
+ def loop_waiting_for_flag(self, instance, timeout=5):
+ timeout = float(timeout) / 100
+ count = 100
+ while asyncore.socket_map and count > 0:
+ asyncore.loop(timeout=0.01, count=1, use_poll=self.use_poll)
+ if instance.flag:
+ return
+ count -= 1
+ time.sleep(timeout)
+ self.fail("flag not set")
+
+ def test_handle_connect(self):
+ # make sure handle_connect is called on connect()
+
+ class TestClient(BaseClient):
+ def handle_connect(self):
+ self.flag = True
+
+ server = TCPServer()
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_handle_accept(self):
+ # make sure handle_accept() is called when a client connects
+
+ class TestListener(BaseTestHandler):
+
+ def __init__(self):
+ BaseTestHandler.__init__(self)
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.bind((HOST, 0))
+ self.listen(5)
+ self.address = self.socket.getsockname()[:2]
+
+ def handle_accept(self):
+ self.flag = True
+
+ server = TestListener()
+ client = BaseClient(server.address)
+ self.loop_waiting_for_flag(server)
+
+ def test_handle_accepted(self):
+ # make sure handle_accepted() is called when a client connects
+
+ class TestListener(BaseTestHandler):
+
+ def __init__(self):
+ BaseTestHandler.__init__(self)
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.bind((HOST, 0))
+ self.listen(5)
+ self.address = self.socket.getsockname()[:2]
+
+ def handle_accept(self):
+ asyncore.dispatcher.handle_accept(self)
+
+ def handle_accepted(self, sock, addr):
+ sock.close()
+ self.flag = True
+
+ server = TestListener()
+ client = BaseClient(server.address)
+ self.loop_waiting_for_flag(server)
+
+
+ def test_handle_read(self):
+ # make sure handle_read is called on data received
+
+ class TestClient(BaseClient):
+ def handle_read(self):
+ self.flag = True
+
+ class TestHandler(BaseTestHandler):
+ def __init__(self, conn):
+ BaseTestHandler.__init__(self, conn)
+ self.send(b'x' * 1024)
+
+ server = TCPServer(TestHandler)
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_handle_write(self):
+ # make sure handle_write is called
+
+ class TestClient(BaseClient):
+ def handle_write(self):
+ self.flag = True
+
+ server = TCPServer()
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_handle_close(self):
+ # make sure handle_close is called when the other end closes
+ # the connection
+
+ class TestClient(BaseClient):
+
+ def handle_read(self):
+ # in order to make handle_close be called we are supposed
+ # to make at least one recv() call
+ self.recv(1024)
+
+ def handle_close(self):
+ self.flag = True
+ self.close()
+
+ class TestHandler(BaseTestHandler):
+ def __init__(self, conn):
+ BaseTestHandler.__init__(self, conn)
+ self.close()
+
+ server = TCPServer(TestHandler)
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ @unittest.skipIf(sys.platform.startswith("sunos"),
+ "OOB support is broken on Solaris")
+ def test_handle_expt(self):
+ # Make sure handle_expt is called on OOB data received.
+ # Note: this might fail on some platforms as OOB data is
+ # tenuously supported and rarely used.
+
+ class TestClient(BaseClient):
+ def handle_expt(self):
+ self.flag = True
+
+ class TestHandler(BaseTestHandler):
+ def __init__(self, conn):
+ BaseTestHandler.__init__(self, conn)
+ self.socket.send(bytes(chr(244), 'latin-1'), socket.MSG_OOB)
+
+ server = TCPServer(TestHandler)
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_handle_error(self):
+
+ class TestClient(BaseClient):
+ def handle_write(self):
+ 1.0 / 0
+ def handle_error(self):
+ self.flag = True
+ try:
+ raise
+ except ZeroDivisionError:
+ pass
+ else:
+ raise Exception("exception not raised")
+
+ server = TCPServer()
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_connection_attributes(self):
+ server = TCPServer()
+ client = BaseClient(server.address)
+
+ # we start disconnected
+ self.assertFalse(server.connected)
+ self.assertTrue(server.accepting)
+ # this can't be taken for granted across all platforms
+ #self.assertFalse(client.connected)
+ self.assertFalse(client.accepting)
+
+ # execute some loops so that client connects to server
+ asyncore.loop(timeout=0.01, use_poll=self.use_poll, count=100)
+ self.assertFalse(server.connected)
+ self.assertTrue(server.accepting)
+ self.assertTrue(client.connected)
+ self.assertFalse(client.accepting)
+
+ # disconnect the client
+ client.close()
+ self.assertFalse(server.connected)
+ self.assertTrue(server.accepting)
+ self.assertFalse(client.connected)
+ self.assertFalse(client.accepting)
+
+ # stop serving
+ server.close()
+ self.assertFalse(server.connected)
+ self.assertFalse(server.accepting)
+
+ def test_create_socket(self):
+ s = asyncore.dispatcher()
+ s.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.assertEqual(s.socket.family, socket.AF_INET)
+ SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0)
+ self.assertEqual(s.socket.type, socket.SOCK_STREAM | SOCK_NONBLOCK)
+
+ def test_bind(self):
+ s1 = asyncore.dispatcher()
+ s1.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ s1.bind((HOST, 0))
+ s1.listen(5)
+ port = s1.socket.getsockname()[1]
+
+ s2 = asyncore.dispatcher()
+ s2.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ # EADDRINUSE indicates the socket was correctly bound
+ self.assertRaises(socket.error, s2.bind, (HOST, port))
+
+ def test_set_reuse_addr(self):
+ sock = socket.socket()
+ try:
+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ except socket.error:
+ unittest.skip("SO_REUSEADDR not supported on this platform")
+ else:
+ # if SO_REUSEADDR succeeded for sock we expect asyncore
+ # to do the same
+ s = asyncore.dispatcher(socket.socket())
+ self.assertFalse(s.socket.getsockopt(socket.SOL_SOCKET,
+ socket.SO_REUSEADDR))
+ s.socket.close()
+ s.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ s.set_reuse_addr()
+ self.assertTrue(s.socket.getsockopt(socket.SOL_SOCKET,
+ socket.SO_REUSEADDR))
+ finally:
+ sock.close()
+
+
+class TestAPI_UseSelect(BaseTestAPI):
+ use_poll = False
+
+@unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
+class TestAPI_UsePoll(BaseTestAPI):
+ use_poll = True
def test_main():
tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,
- DispatcherWithSendTests_UsePoll]
- if hasattr(asyncore, 'file_wrapper'):
- tests.append(FileWrapperTest)
-
+ DispatcherWithSendTests_UsePoll, TestAPI_UseSelect,
+ TestAPI_UsePoll, FileWrapperTest]
run_unittest(*tests)
if __name__ == "__main__":
diff --git a/Lib/test/test_atexit.py b/Lib/test/test_atexit.py
index 8a71036fde..5200af7ed9 100644
--- a/Lib/test/test_atexit.py
+++ b/Lib/test/test_atexit.py
@@ -25,8 +25,9 @@ def raise2():
class TestCase(unittest.TestCase):
def setUp(self):
+ self.save_stdout = sys.stdout
+ self.save_stderr = sys.stderr
self.stream = io.StringIO()
- self.save_stdout, self.save_stderr = sys.stderr, sys.stdout
sys.stdout = sys.stderr = self.stream
atexit._clear()
@@ -65,6 +66,14 @@ class TestCase(unittest.TestCase):
self.assertRaises(TypeError, atexit._run_exitfuncs)
+ def test_raise_unnormalized(self):
+ # Issue #10756: Make sure that an unnormalized exception is
+ # handled properly
+ atexit.register(lambda: 1 / 0)
+
+ self.assertRaises(ZeroDivisionError, atexit._run_exitfuncs)
+ self.assertIn("ZeroDivisionError", self.stream.getvalue())
+
def test_stress(self):
a = [0]
def inc():
diff --git a/Lib/test/test_augassign.py b/Lib/test/test_augassign.py
index 612666705a..9a59c58ec0 100644
--- a/Lib/test/test_augassign.py
+++ b/Lib/test/test_augassign.py
@@ -88,7 +88,7 @@ class AugAssignTest(unittest.TestCase):
y = x
x += 10
- self.assertTrue(isinstance(x, aug_test))
+ self.assertIsInstance(x, aug_test)
self.assertTrue(y is not x)
self.assertEqual(x.val, 11)
@@ -103,7 +103,7 @@ class AugAssignTest(unittest.TestCase):
y = x
x += 10
- self.assertTrue(isinstance(x, aug_test3))
+ self.assertIsInstance(x, aug_test3)
self.assertTrue(y is not x)
self.assertEqual(x.val, 13)
diff --git a/Lib/test/test_base64.py b/Lib/test/test_base64.py
index 33aacd6fab..93c623cc8a 100644
--- a/Lib/test/test_base64.py
+++ b/Lib/test/test_base64.py
@@ -138,9 +138,25 @@ class BaseXYTestCase(unittest.TestCase):
eq(base64.urlsafe_b64decode(b'01a-b_cd'), b'\xd3V\xbeo\xf7\x1d')
self.assertRaises(TypeError, base64.urlsafe_b64decode, "")
- def test_b64decode_error(self):
+ def test_b64decode_padding_error(self):
self.assertRaises(binascii.Error, base64.b64decode, b'abc')
+ def test_b64decode_invalid_chars(self):
+ # issue 1466065: Test some invalid characters.
+ tests = ((b'%3d==', b'\xdd'),
+ (b'$3d==', b'\xdd'),
+ (b'[==', b''),
+ (b'YW]3=', b'am'),
+ (b'3{d==', b'\xdd'),
+ (b'3d}==', b'\xdd'),
+ (b'@@', b''),
+ (b'!', b''),
+ (b'YWJj\nYWI=', b'abcab'))
+ for bstr, res in tests:
+ self.assertEqual(base64.b64decode(bstr), res)
+ with self.assertRaises(binascii.Error):
+ base64.b64decode(bstr, validate=True)
+
def test_b32encode(self):
eq = self.assertEqual
eq(base64.b32encode(b''), b'')
diff --git a/Lib/test/test_bigmem.py b/Lib/test/test_bigmem.py
index aec3778d53..ac6b1096e1 100644
--- a/Lib/test/test_bigmem.py
+++ b/Lib/test/test_bigmem.py
@@ -519,12 +519,12 @@ class BaseStrTest:
edge = _('-') * (size // 2)
s = _('').join([edge, SUBSTR, edge])
del edge
- self.assertTrue(SUBSTR in s)
- self.assertFalse(SUBSTR * 2 in s)
- self.assertTrue(_('-') in s)
- self.assertFalse(_('a') in s)
+ self.assertIn(SUBSTR, s)
+ self.assertNotIn(SUBSTR * 2, s)
+ self.assertIn(_('-'), s)
+ self.assertNotIn(_('a'), s)
s += _('a')
- self.assertTrue(_('a') in s)
+ self.assertIn(_('a'), s)
@bigmemtest(minsize=_2G + 10, memuse=2)
def test_compare(self, size):
@@ -622,7 +622,7 @@ class StrTest(unittest.TestCase, BaseStrTest):
@precisionbigmemtest(size=_4G // 5, memuse=character_size * (6 + 1))
def test_unicode_repr_overflow(self, size):
try:
- s = "\uAAAA"*size
+ s = "\uDCBA"*size
r = repr(s)
except MemoryError:
pass # acceptable on 32-bit
@@ -683,22 +683,24 @@ class StrTest(unittest.TestCase, BaseStrTest):
@bigmemtest(minsize=2**32 / 5, memuse=character_size * 7)
def test_unicode_repr(self, size):
- s = "\uAAAA" * size
+ # Use an assigned, but not printable code point.
+ # It is in the range of the low surrogates \uDC00-\uDFFF.
+ s = "\uDCBA" * size
for f in (repr, ascii):
r = f(s)
self.assertTrue(len(r) > size)
- self.assertTrue(r.endswith(r"\uaaaa'"), r[-10:])
+ self.assertTrue(r.endswith(r"\udcba'"), r[-10:])
del r
# The character takes 4 bytes even in UCS-2 builds because it will
# be decomposed into surrogates.
@bigmemtest(minsize=2**32 / 5, memuse=4 + character_size * 9)
def test_unicode_repr_wide(self, size):
- s = "\U0001AAAA" * size
+ s = "\U0001DCBA" * size
for f in (repr, ascii):
r = f(s)
self.assertTrue(len(r) > size)
- self.assertTrue(r.endswith(r"\U0001aaaa'"), r[-12:])
+ self.assertTrue(r.endswith(r"\U0001dcba'"), r[-12:])
del r
@@ -772,9 +774,9 @@ class TupleTest(unittest.TestCase):
def test_contains(self, size):
t = (1, 2, 3, 4, 5) * size
self.assertEqual(len(t), size * 5)
- self.assertTrue(5 in t)
- self.assertFalse((1, 2, 3, 4, 5) in t)
- self.assertFalse(0 in t)
+ self.assertIn(5, t)
+ self.assertNotIn((1, 2, 3, 4, 5), t)
+ self.assertNotIn(0, t)
@bigmemtest(minsize=_2G + 10, memuse=8)
def test_hash(self, size):
@@ -823,6 +825,7 @@ class TupleTest(unittest.TestCase):
@precisionbigmemtest(size=_1G - 1, memuse=9)
def test_from_2G_generator(self, size):
+ self.skipTest("test needs much more memory than advertised, see issue5438")
try:
t = tuple(range(size))
except MemoryError:
@@ -836,6 +839,7 @@ class TupleTest(unittest.TestCase):
@precisionbigmemtest(size=_1G - 25, memuse=9)
def test_from_almost_2G_generator(self, size):
+ self.skipTest("test needs much more memory than advertised, see issue5438")
try:
t = tuple(range(size))
count = 0
@@ -856,11 +860,11 @@ class TupleTest(unittest.TestCase):
self.assertEqual(s[-5:], '0, 0)')
self.assertEqual(s.count('0'), size)
- @bigmemtest(minsize=_2G // 3 + 2, memuse=8 + 3)
+ @bigmemtest(minsize=_2G // 3 + 2, memuse=8 + 3 * character_size)
def test_repr_small(self, size):
return self.basic_test_repr(size)
- @bigmemtest(minsize=_2G + 2, memuse=8 + 3)
+ @bigmemtest(minsize=_2G + 2, memuse=8 + 3 * character_size)
def test_repr_large(self, size):
return self.basic_test_repr(size)
@@ -921,9 +925,9 @@ class ListTest(unittest.TestCase):
def test_contains(self, size):
l = [1, 2, 3, 4, 5] * size
self.assertEqual(len(l), size * 5)
- self.assertTrue(5 in l)
- self.assertFalse([1, 2, 3, 4, 5] in l)
- self.assertFalse(0 in l)
+ self.assertIn(5, l)
+ self.assertNotIn([1, 2, 3, 4, 5], l)
+ self.assertNotIn(0, l)
@bigmemtest(minsize=_2G + 10, memuse=8)
def test_hash(self, size):
@@ -1031,11 +1035,11 @@ class ListTest(unittest.TestCase):
self.assertEqual(s[-5:], '0, 0]')
self.assertEqual(s.count('0'), size)
- @bigmemtest(minsize=_2G // 3 + 2, memuse=8 + 3)
+ @bigmemtest(minsize=_2G // 3 + 2, memuse=8 + 3 * character_size)
def test_repr_small(self, size):
return self.basic_test_repr(size)
- @bigmemtest(minsize=_2G + 2, memuse=8 + 3)
+ @bigmemtest(minsize=_2G + 2, memuse=8 + 3 * character_size)
def test_repr_large(self, size):
return self.basic_test_repr(size)
diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py
index a35ec05633..1e9e888f28 100755..100644
--- a/Lib/test/test_binascii.py
+++ b/Lib/test/test_binascii.py
@@ -3,14 +3,27 @@
from test import support
import unittest
import binascii
+import array
+
+# Note: "*_hex" functions are aliases for "(un)hexlify"
+b2a_functions = ['b2a_base64', 'b2a_hex', 'b2a_hqx', 'b2a_qp', 'b2a_uu',
+ 'hexlify', 'rlecode_hqx']
+a2b_functions = ['a2b_base64', 'a2b_hex', 'a2b_hqx', 'a2b_qp', 'a2b_uu',
+ 'unhexlify', 'rledecode_hqx']
+all_functions = a2b_functions + b2a_functions + ['crc32', 'crc_hqx']
+
class BinASCIITest(unittest.TestCase):
+ type2test = bytes
# Create binary test data
- data = b"The quick brown fox jumps over the lazy dog.\r\n"
+ rawdata = b"The quick brown fox jumps over the lazy dog.\r\n"
# Be slow so we don't depend on other modules
- data += bytes(range(256))
- data += b"\r\nHello world.\n"
+ rawdata += bytes(range(256))
+ rawdata += b"\r\nHello world.\n"
+
+ def setUp(self):
+ self.data = self.type2test(self.rawdata)
def test_exceptions(self):
# Check module exceptions
@@ -19,32 +32,47 @@ class BinASCIITest(unittest.TestCase):
def test_functions(self):
# Check presence of all functions
- funcs = []
- for suffix in "base64", "hqx", "uu", "hex":
- prefixes = ["a2b_", "b2a_"]
- if suffix == "hqx":
- prefixes.extend(["crc_", "rlecode_", "rledecode_"])
- for prefix in prefixes:
- name = prefix + suffix
- self.assertTrue(hasattr(getattr(binascii, name), '__call__'))
- self.assertRaises(TypeError, getattr(binascii, name))
- for name in ("hexlify", "unhexlify"):
+ for name in all_functions:
self.assertTrue(hasattr(getattr(binascii, name), '__call__'))
self.assertRaises(TypeError, getattr(binascii, name))
+ def test_returned_value(self):
+ # Limit to the minimum of all limits (b2a_uu)
+ MAX_ALL = 45
+ raw = self.rawdata[:MAX_ALL]
+ for fa, fb in zip(a2b_functions, b2a_functions):
+ a2b = getattr(binascii, fa)
+ b2a = getattr(binascii, fb)
+ try:
+ a = b2a(self.type2test(raw))
+ res = a2b(self.type2test(a))
+ except Exception as err:
+ self.fail("{}/{} conversion raises {!r}".format(fb, fa, err))
+ if fb == 'b2a_hqx':
+ # b2a_hqx returns a tuple
+ res, _ = res
+ self.assertEqual(res, raw, "{}/{} conversion: "
+ "{!r} != {!r}".format(fb, fa, res, raw))
+ self.assertIsInstance(res, bytes)
+ self.assertIsInstance(a, bytes)
+ self.assertLess(max(a), 128)
+ self.assertIsInstance(binascii.crc_hqx(raw, 0), int)
+ self.assertIsInstance(binascii.crc32(raw), int)
+
def test_base64valid(self):
# Test base64 with valid data
MAX_BASE64 = 57
lines = []
- for i in range(0, len(self.data), MAX_BASE64):
- b = self.data[i:i+MAX_BASE64]
+ for i in range(0, len(self.rawdata), MAX_BASE64):
+ b = self.type2test(self.rawdata[i:i+MAX_BASE64])
a = binascii.b2a_base64(b)
lines.append(a)
res = bytes()
for line in lines:
- b = binascii.a2b_base64(line)
+ a = self.type2test(line)
+ b = binascii.a2b_base64(a)
res += b
- self.assertEqual(res, self.data)
+ self.assertEqual(res, self.rawdata)
def test_base64invalid(self):
# Test base64 with random invalid characters sprinkled throughout
@@ -52,7 +80,7 @@ class BinASCIITest(unittest.TestCase):
MAX_BASE64 = 57
lines = []
for i in range(0, len(self.data), MAX_BASE64):
- b = self.data[i:i+MAX_BASE64]
+ b = self.type2test(self.rawdata[i:i+MAX_BASE64])
a = binascii.b2a_base64(b)
lines.append(a)
@@ -74,26 +102,28 @@ class BinASCIITest(unittest.TestCase):
return res + noise + line
res = bytearray()
for line in map(addnoise, lines):
- b = binascii.a2b_base64(line)
+ a = self.type2test(line)
+ b = binascii.a2b_base64(a)
res += b
- self.assertEqual(res, self.data)
+ self.assertEqual(res, self.rawdata)
# Test base64 with just invalid characters, which should return
# empty strings. TBD: shouldn't it raise an exception instead ?
- self.assertEqual(binascii.a2b_base64(fillers), b'')
+ self.assertEqual(binascii.a2b_base64(self.type2test(fillers)), b'')
def test_uu(self):
MAX_UU = 45
lines = []
for i in range(0, len(self.data), MAX_UU):
- b = self.data[i:i+MAX_UU]
+ b = self.type2test(self.rawdata[i:i+MAX_UU])
a = binascii.b2a_uu(b)
lines.append(a)
res = bytes()
for line in lines:
- b = binascii.a2b_uu(line)
+ a = self.type2test(line)
+ b = binascii.a2b_uu(a)
res += b
- self.assertEqual(res, self.data)
+ self.assertEqual(res, self.rawdata)
self.assertEqual(binascii.a2b_uu(b"\x7f"), b"\x00"*31)
self.assertEqual(binascii.a2b_uu(b"\x80"), b"\x00"*32)
@@ -107,19 +137,27 @@ class BinASCIITest(unittest.TestCase):
self.assertEqual(binascii.b2a_uu(b'x'), b'!> \n')
def test_crc32(self):
- crc = binascii.crc32(b"Test the CRC-32 of")
- crc = binascii.crc32(b" this string.", crc)
+ crc = binascii.crc32(self.type2test(b"Test the CRC-32 of"))
+ crc = binascii.crc32(self.type2test(b" this string."), crc)
self.assertEqual(crc, 1571220330)
self.assertRaises(TypeError, binascii.crc32)
- # The hqx test is in test_binhex.py
+ def test_hqx(self):
+ # Perform binhex4 style RLE-compression
+ # Then calculate the hexbin4 binary-to-ASCII translation
+ rle = binascii.rlecode_hqx(self.data)
+ a = binascii.b2a_hqx(self.type2test(rle))
+ b, _ = binascii.a2b_hqx(self.type2test(a))
+ res = binascii.rledecode_hqx(b)
+
+ self.assertEqual(res, self.rawdata)
def test_hex(self):
# test hexlification
s = b'{s\005\000\000\000worldi\002\000\000\000s\005\000\000\000helloi\001\000\000\0000'
- t = binascii.b2a_hex(s)
- u = binascii.a2b_hex(t)
+ t = binascii.b2a_hex(self.type2test(s))
+ u = binascii.a2b_hex(self.type2test(t))
self.assertEqual(s, u)
self.assertRaises(binascii.Error, binascii.a2b_hex, t[:-1])
self.assertRaises(binascii.Error, binascii.a2b_hex, t[:-1] + b'q')
@@ -129,7 +167,7 @@ class BinASCIITest(unittest.TestCase):
def test_qp(self):
# A test for SF bug 534347 (segfaults without the proper fix)
try:
- binascii.a2b_qp("", **{1:1})
+ binascii.a2b_qp(b"", **{1:1})
except TypeError:
pass
else:
@@ -141,12 +179,10 @@ class BinASCIITest(unittest.TestCase):
self.assertEqual(binascii.a2b_qp(b"=00\r\n=00"), b"\x00\r\n\x00")
self.assertEqual(
binascii.b2a_qp(b"\xff\r\n\xff\n\xff"),
- b"=FF\r\n=FF\r\n=FF"
- )
+ b"=FF\r\n=FF\r\n=FF")
self.assertEqual(
binascii.b2a_qp(b"0"*75+b"\xff\r\n\xff\r\n\xff"),
- b"0"*75+b"=\r\n=FF\r\n=FF\r\n=FF"
- )
+ b"0"*75+b"=\r\n=FF\r\n=FF\r\n=FF")
self.assertEqual(binascii.b2a_qp(b'\0\n'), b'=00\n')
self.assertEqual(binascii.b2a_qp(b'\0\n', quotetabs=True), b'=00\n')
@@ -160,27 +196,47 @@ class BinASCIITest(unittest.TestCase):
def test_empty_string(self):
# A test for SF bug #1022953. Make sure SystemError is not raised.
- for n in ['b2a_qp', 'a2b_hex', 'b2a_base64', 'a2b_uu', 'a2b_qp',
- 'b2a_hex', 'unhexlify', 'hexlify', 'crc32', 'b2a_hqx',
- 'a2b_hqx', 'a2b_base64', 'rlecode_hqx', 'b2a_uu',
- 'rledecode_hqx']:
- f = getattr(binascii, n)
+ empty = self.type2test(b'')
+ for func in all_functions:
+ if func == 'crc_hqx':
+ # crc_hqx needs 2 arguments
+ binascii.crc_hqx(empty, 0)
+ continue
+ f = getattr(binascii, func)
+ try:
+ f(empty)
+ except Exception as err:
+ self.fail("{}({!r}) raises {!r}".format(func, empty, err))
+
+ def test_unicode_strings(self):
+ # Unicode strings are not accepted.
+ for func in all_functions:
try:
- f(b'')
- except SystemError as err:
- self.fail("%s(b'') raises SystemError: %s" % (n, err))
- binascii.crc_hqx(b'', 0)
-
- def test_no_binary_strings(self):
- # b2a_ must not accept strings
- for f in (binascii.b2a_uu, binascii.b2a_base64,
- binascii.b2a_hqx, binascii.b2a_qp,
- binascii.hexlify, binascii.rlecode_hqx,
- binascii.crc_hqx, binascii.crc32):
- self.assertRaises(TypeError, f, "test")
+ self.assertRaises(TypeError, getattr(binascii, func), "test")
+ except Exception as err:
+ self.fail('{}("test") raises {!r}'.format(func, err))
+ # crc_hqx needs 2 arguments
+ self.assertRaises(TypeError, binascii.crc_hqx, "test", 0)
+
+
+class ArrayBinASCIITest(BinASCIITest):
+ def type2test(self, s):
+ return array.array('B', list(s))
+
+
+class BytearrayBinASCIITest(BinASCIITest):
+ type2test = bytearray
+
+
+class MemoryviewBinASCIITest(BinASCIITest):
+ type2test = memoryview
+
def test_main():
- support.run_unittest(BinASCIITest)
+ support.run_unittest(BinASCIITest,
+ ArrayBinASCIITest,
+ BytearrayBinASCIITest,
+ MemoryviewBinASCIITest)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_binhex.py b/Lib/test/test_binhex.py
index 06fd98aa64..a807bca639 100755
--- a/Lib/test/test_binhex.py
+++ b/Lib/test/test_binhex.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Test script for the binhex C module
Uses the mechanism of the python binhex module
@@ -15,10 +15,12 @@ class BinHexTestCase(unittest.TestCase):
def setUp(self):
self.fname1 = support.TESTFN + "1"
self.fname2 = support.TESTFN + "2"
+ self.fname3 = support.TESTFN + "very_long_filename__very_long_filename__very_long_filename__very_long_filename__"
def tearDown(self):
support.unlink(self.fname1)
support.unlink(self.fname2)
+ support.unlink(self.fname3)
DATA = b'Jack is my hero'
@@ -37,6 +39,15 @@ class BinHexTestCase(unittest.TestCase):
self.assertEqual(self.DATA, finish)
+ def test_binhex_error_on_long_filename(self):
+ """
+ The testcase fails if no exception is raised when a filename parameter provided to binhex.binhex()
+ is too long, or if the exception raised in binhex.binhex() is not an instance of binhex.Error.
+ """
+ f3 = open(self.fname3, 'wb')
+ f3.close()
+
+ self.assertRaises(binhex.Error, binhex.binhex, self.fname3, self.fname2)
def test_main():
support.run_unittest(BinHexTestCase)
diff --git a/Lib/test/test_binop.py b/Lib/test/test_binop.py
index 523ecbe298..84179167e2 100644
--- a/Lib/test/test_binop.py
+++ b/Lib/test/test_binop.py
@@ -2,6 +2,7 @@
import unittest
from test import support
+from operator import eq, ne, lt, gt, le, ge
def gcd(a, b):
"""Greatest common divisor using Euclid's algorithm."""
@@ -10,8 +11,8 @@ def gcd(a, b):
return b
def isint(x):
- """Test whether an object is an instance of int or long."""
- return isinstance(x, int) or isinstance(x, int)
+ """Test whether an object is an instance of int."""
+ return isinstance(x, int)
def isnum(x):
"""Test whether an object is an instance of a built-in numeric type."""
@@ -26,18 +27,18 @@ def isRat(x):
class Rat(object):
- """Rational number implemented as a normalized pair of longs."""
+ """Rational number implemented as a normalized pair of ints."""
__slots__ = ['_Rat__num', '_Rat__den']
def __init__(self, num=0, den=1):
"""Constructor: Rat([num[, den]]).
- The arguments must be ints or longs, and default to (0, 1)."""
+ The arguments must be ints, and default to (0, 1)."""
if not isint(num):
- raise TypeError("Rat numerator must be int or long (%r)" % num)
+ raise TypeError("Rat numerator must be int (%r)" % num)
if not isint(den):
- raise TypeError("Rat denominator must be int or long (%r)" % den)
+ raise TypeError("Rat denominator must be int (%r)" % den)
# But the zero is always on
if den == 0:
raise ZeroDivisionError("zero denominator")
@@ -219,9 +220,6 @@ class RatTestCase(unittest.TestCase):
a = Rat(10, 15)
self.assertEqual(a.num, 2)
self.assertEqual(a.den, 3)
- a = Rat(10, 15)
- self.assertEqual(a.num, 2)
- self.assertEqual(a.den, 3)
a = Rat(10, -15)
self.assertEqual(a.num, -2)
self.assertEqual(a.den, 3)
@@ -305,9 +303,78 @@ class RatTestCase(unittest.TestCase):
# XXX Ran out of steam; TO DO: divmod, div, future division
-def test_main():
- support.run_unittest(RatTestCase)
+class OperationLogger:
+ """Base class for classes with operation logging."""
+ def __init__(self, logger):
+ self.logger = logger
+ def log_operation(self, *args):
+ self.logger(*args)
+
+def op_sequence(op, *classes):
+ """Return the sequence of operations that results from applying
+ the operation `op` to instances of the given classes."""
+ log = []
+ instances = []
+ for c in classes:
+ instances.append(c(log.append))
+
+ try:
+ op(*instances)
+ except TypeError:
+ pass
+ return log
+
+class A(OperationLogger):
+ def __eq__(self, other):
+ self.log_operation('A.__eq__')
+ return NotImplemented
+ def __le__(self, other):
+ self.log_operation('A.__le__')
+ return NotImplemented
+ def __ge__(self, other):
+ self.log_operation('A.__ge__')
+ return NotImplemented
+
+class B(OperationLogger):
+ def __eq__(self, other):
+ self.log_operation('B.__eq__')
+ return NotImplemented
+ def __le__(self, other):
+ self.log_operation('B.__le__')
+ return NotImplemented
+ def __ge__(self, other):
+ self.log_operation('B.__ge__')
+ return NotImplemented
+
+class C(B):
+ def __eq__(self, other):
+ self.log_operation('C.__eq__')
+ return NotImplemented
+ def __le__(self, other):
+ self.log_operation('C.__le__')
+ return NotImplemented
+ def __ge__(self, other):
+ self.log_operation('C.__ge__')
+ return NotImplemented
+
+class OperationOrderTests(unittest.TestCase):
+ def test_comparison_orders(self):
+ self.assertEqual(op_sequence(eq, A, A), ['A.__eq__', 'A.__eq__'])
+ self.assertEqual(op_sequence(eq, A, B), ['A.__eq__', 'B.__eq__'])
+ self.assertEqual(op_sequence(eq, B, A), ['B.__eq__', 'A.__eq__'])
+ # C is a subclass of B, so C.__eq__ is called first
+ self.assertEqual(op_sequence(eq, B, C), ['C.__eq__', 'B.__eq__'])
+ self.assertEqual(op_sequence(eq, C, B), ['C.__eq__', 'B.__eq__'])
+
+ self.assertEqual(op_sequence(le, A, A), ['A.__le__', 'A.__ge__'])
+ self.assertEqual(op_sequence(le, A, B), ['A.__le__', 'B.__ge__'])
+ self.assertEqual(op_sequence(le, B, A), ['B.__le__', 'A.__ge__'])
+ self.assertEqual(op_sequence(le, B, C), ['C.__ge__', 'B.__le__'])
+ self.assertEqual(op_sequence(le, C, B), ['C.__le__', 'B.__ge__'])
+
+def test_main():
+ support.run_unittest(RatTestCase, OperationOrderTests)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index 3a68dfce22..b296870b09 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -7,12 +7,6 @@ import os
class BoolTest(unittest.TestCase):
- def assertIs(self, a, b):
- self.assertTrue(a is b)
-
- def assertIsNot(self, a, b):
- self.assertTrue(a is not b)
-
def test_subclass(self):
try:
class C(bool):
@@ -51,6 +45,12 @@ class BoolTest(unittest.TestCase):
self.assertEqual(int(True), 1)
self.assertIsNot(int(True), True)
+ def test_float(self):
+ self.assertEqual(float(False), 0.0)
+ self.assertIsNot(float(False), False)
+ self.assertEqual(float(True), 1.0)
+ self.assertIsNot(float(True), True)
+
def test_math(self):
self.assertEqual(+False, 0)
self.assertIsNot(+False, False)
@@ -174,8 +174,8 @@ class BoolTest(unittest.TestCase):
self.assertIs(hasattr([], "wobble"), False)
def test_callable(self):
- self.assertIs(hasattr(len, '__call__'), True)
- self.assertIs(hasattr(1, '__call__'), False)
+ self.assertIs(callable(len), True)
+ self.assertIs(callable(1), False)
def test_isinstance(self):
self.assertIs(isinstance(True, bool), True)
@@ -221,15 +221,15 @@ class BoolTest(unittest.TestCase):
def test_boolean(self):
self.assertEqual(True & 1, 1)
- self.assertTrue(not isinstance(True & 1, bool))
+ self.assertNotIsInstance(True & 1, bool)
self.assertIs(True & True, True)
self.assertEqual(True | 1, 1)
- self.assertTrue(not isinstance(True | 1, bool))
+ self.assertNotIsInstance(True | 1, bool)
self.assertIs(True | True, True)
self.assertEqual(True ^ 1, 0)
- self.assertTrue(not isinstance(True ^ 1, bool))
+ self.assertNotIsInstance(True ^ 1, bool)
self.assertIs(True ^ True, False)
def test_fileclosed(self):
@@ -241,6 +241,12 @@ class BoolTest(unittest.TestCase):
finally:
os.remove(support.TESTFN)
+ def test_types(self):
+ # types are always true.
+ for t in [bool, complex, dict, float, int, list, object,
+ set, str, tuple, type]:
+ self.assertIs(bool(t), True)
+
def test_operator(self):
import operator
self.assertIs(operator.truth(0), False)
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 420a17f201..1469e36847 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -1,17 +1,18 @@
# Python test set -- built-in functions
import platform
-import test.support, unittest
-from test.support import fcmp, TESTFN, unlink, run_unittest, \
- run_with_locale
+import unittest
+import sys
+import warnings
+import collections
+import io
+import ast
+import types
+import builtins
+import random
+from test.support import fcmp, TESTFN, unlink, run_unittest, check_warnings
from operator import neg
-import sys, warnings, random, collections, io, fractions
-warnings.filterwarnings("ignore", "hex../oct.. of negative int",
- FutureWarning, __name__)
-warnings.filterwarnings("ignore", "integer argument expected",
- DeprecationWarning, "unittest")
-import builtins
class Squares:
@@ -126,12 +127,18 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(abs(0.0), 0.0)
self.assertEqual(abs(3.14), 3.14)
self.assertEqual(abs(-3.14), 3.14)
- # long
- self.assertEqual(abs(0), 0)
- self.assertEqual(abs(1234), 1234)
- self.assertEqual(abs(-1234), 1234)
# str
self.assertRaises(TypeError, abs, 'a')
+ # bool
+ self.assertEqual(abs(True), 1)
+ self.assertEqual(abs(False), 0)
+ # other
+ self.assertRaises(TypeError, abs)
+ self.assertRaises(TypeError, abs, None)
+ class AbsClass(object):
+ def __abs__(self):
+ return -5
+ self.assertEqual(abs(AbsClass()), -5)
def test_all(self):
self.assertEqual(all([2, 4, 6]), True)
@@ -164,7 +171,6 @@ class BuiltinTest(unittest.TestCase):
def test_ascii(self):
self.assertEqual(ascii(''), '\'\'')
self.assertEqual(ascii(0), '0')
- self.assertEqual(ascii(0), '0')
self.assertEqual(ascii(()), '()')
self.assertEqual(ascii([]), '[]')
self.assertEqual(ascii({}), '{}')
@@ -202,22 +208,39 @@ class BuiltinTest(unittest.TestCase):
self.assertTrue(isinstance(x, int))
self.assertEqual(-x, sys.maxsize+1)
- # XXX(nnorwitz): This test case for callable should probably be removed.
def test_callable(self):
- self.assertTrue(hasattr(len, '__call__'))
+ self.assertTrue(callable(len))
+ self.assertFalse(callable("a"))
+ self.assertTrue(callable(callable))
+ self.assertTrue(callable(lambda x, y: x + y))
+ self.assertFalse(callable(__builtins__))
def f(): pass
- self.assertTrue(hasattr(f, '__call__'))
- class C:
+ self.assertTrue(callable(f))
+
+ class C1:
def meth(self): pass
- self.assertTrue(hasattr(C, '__call__'))
- x = C()
- self.assertTrue(hasattr(x.meth, '__call__'))
- self.assertTrue(not hasattr(x, '__call__'))
- class D(C):
+ self.assertTrue(callable(C1))
+ c = C1()
+ self.assertTrue(callable(c.meth))
+ self.assertFalse(callable(c))
+
+ # __call__ is looked up on the class, not the instance
+ c.__call__ = None
+ self.assertFalse(callable(c))
+ c.__call__ = lambda self: 0
+ self.assertFalse(callable(c))
+ del c.__call__
+ self.assertFalse(callable(c))
+
+ class C2(object):
def __call__(self): pass
- y = D()
- self.assertTrue(hasattr(y, '__call__'))
- y()
+ c2 = C2()
+ self.assertTrue(callable(c2))
+ c2.__call__ = None
+ self.assertTrue(callable(c2))
+ class C3(C2): pass
+ c3 = C3()
+ self.assertTrue(callable(c3))
def test_chr(self):
self.assertEqual(chr(32), ' ')
@@ -263,8 +286,35 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
self.assertRaises(ValueError, compile, str('a = 1'), 'f', 'bad')
+ # test the optimize argument
+
+ codestr = '''def f():
+ """doc"""
+ try:
+ assert False
+ except AssertionError:
+ return (True, f.__doc__)
+ else:
+ return (False, f.__doc__)
+ '''
+ def f(): """doc"""
+ values = [(-1, __debug__, f.__doc__),
+ (0, True, 'doc'),
+ (1, False, 'doc'),
+ (2, False, None)]
+ for optval, debugval, docstring in values:
+ # test both direct compilation and compilation via AST
+ codeobjs = []
+ codeobjs.append(compile(codestr, "<test>", "exec", optimize=optval))
+ tree = ast.parse(codestr)
+ codeobjs.append(compile(tree, "<test>", "exec", optimize=optval))
+ for code in codeobjs:
+ ns = {}
+ exec(code, ns)
+ rv = ns['f']()
+ self.assertEqual(rv, (debugval, docstring))
+
def test_delattr(self):
- import sys
sys.spam = 1
delattr(sys, 'spam')
self.assertRaises(TypeError, delattr)
@@ -275,22 +325,20 @@ class BuiltinTest(unittest.TestCase):
# dir() - local scope
local_var = 1
- self.assertTrue('local_var' in dir())
+ self.assertIn('local_var', dir())
# dir(module)
- import sys
- self.assertTrue('exit' in dir(sys))
+ self.assertIn('exit', dir(sys))
# dir(module_with_invalid__dict__)
- import types
class Foo(types.ModuleType):
__dict__ = 8
f = Foo("foo")
self.assertRaises(TypeError, dir, f)
# dir(type)
- self.assertTrue("strip" in dir(str))
- self.assertTrue("__mro__" not in dir(str))
+ self.assertIn("strip", dir(str))
+ self.assertNotIn("__mro__", dir(str))
# dir(obj)
class Foo(object):
@@ -299,13 +347,13 @@ class BuiltinTest(unittest.TestCase):
self.y = 8
self.z = 9
f = Foo()
- self.assertTrue("y" in dir(f))
+ self.assertIn("y", dir(f))
# dir(obj_no__dict__)
class Foo(object):
__slots__ = []
f = Foo()
- self.assertTrue("__repr__" in dir(f))
+ self.assertIn("__repr__", dir(f))
# dir(obj_no__class__with__dict__)
# (an ugly trick to cause getattr(f, "__class__") to fail)
@@ -314,8 +362,8 @@ class BuiltinTest(unittest.TestCase):
def __init__(self):
self.bar = "wow"
f = Foo()
- self.assertTrue("__repr__" not in dir(f))
- self.assertTrue("bar" in dir(f))
+ self.assertNotIn("__repr__", dir(f))
+ self.assertIn("bar", dir(f))
# dir(obj_using __dir__)
class Foo(object):
@@ -344,18 +392,7 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(divmod(12, -7), (-2, -2))
self.assertEqual(divmod(-12, -7), (1, -5))
- self.assertEqual(divmod(12, 7), (1, 5))
- self.assertEqual(divmod(-12, 7), (-2, 2))
- self.assertEqual(divmod(12, -7), (-2, -2))
- self.assertEqual(divmod(-12, -7), (1, -5))
-
- self.assertEqual(divmod(12, 7), (1, 5))
- self.assertEqual(divmod(-12, 7), (-2, 2))
- self.assertEqual(divmod(12, -7), (-2, -2))
- self.assertEqual(divmod(-12, -7), (1, -5))
-
- self.assertEqual(divmod(-sys.maxsize-1, -1),
- (sys.maxsize+1, 0))
+ self.assertEqual(divmod(-sys.maxsize-1, -1), (sys.maxsize+1, 0))
self.assertTrue(not fcmp(divmod(3.25, 1.0), (3.0, 0.25)))
self.assertTrue(not fcmp(divmod(-3.25, 1.0), (-4.0, 0.75)))
@@ -465,9 +502,10 @@ class BuiltinTest(unittest.TestCase):
g = {}
l = {}
- import warnings
- warnings.filterwarnings("ignore", "global statement", module="<string>")
- exec('global a; a = 1; b = 2', g, l)
+ with check_warnings():
+ warnings.filterwarnings("ignore", "global statement",
+ module="<string>")
+ exec('global a; a = 1; b = 2', g, l)
if '__builtins__' in g:
del g['__builtins__']
if '__builtins__' in l:
@@ -511,7 +549,6 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, list, filter(42, (1, 2)))
def test_getattr(self):
- import sys
self.assertTrue(getattr(sys, 'stdout') is sys.stdout)
self.assertRaises(TypeError, getattr, sys, 1)
self.assertRaises(TypeError, getattr, sys, 1, "foo")
@@ -521,21 +558,21 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(AttributeError, getattr, 1, "\uDAD1\uD51E")
def test_hasattr(self):
- import sys
self.assertTrue(hasattr(sys, 'stdout'))
self.assertRaises(TypeError, hasattr, sys, 1)
self.assertRaises(TypeError, hasattr)
self.assertEqual(False, hasattr(sys, chr(sys.maxunicode)))
- # Check that hasattr allows SystemExit and KeyboardInterrupts by
+ # Check that hasattr propagates all exceptions outside of
+ # AttributeError.
class A:
def __getattr__(self, what):
- raise KeyboardInterrupt
- self.assertRaises(KeyboardInterrupt, hasattr, A(), "b")
+ raise SystemExit
+ self.assertRaises(SystemExit, hasattr, A(), "b")
class B:
def __getattr__(self, what):
- raise SystemExit
- self.assertRaises(SystemExit, hasattr, B(), "b")
+ raise ValueError
+ self.assertRaises(ValueError, hasattr, B(), "b")
def test_hash(self):
hash(None)
@@ -552,10 +589,6 @@ class BuiltinTest(unittest.TestCase):
def __hash__(self):
return 2**100
self.assertEqual(type(hash(X())), int)
- class Y(object):
- def __hash__(self):
- return 2**100
- self.assertEqual(type(hash(Y())), int)
class Z(int):
def __hash__(self):
return self
@@ -563,15 +596,12 @@ class BuiltinTest(unittest.TestCase):
def test_hex(self):
self.assertEqual(hex(16), '0x10')
- self.assertEqual(hex(16), '0x10')
- self.assertEqual(hex(-16), '-0x10')
self.assertEqual(hex(-16), '-0x10')
self.assertRaises(TypeError, hex, {})
def test_id(self):
id(None)
id(1)
- id(1)
id(1.0)
id('spam')
id((0,1,2,3))
@@ -648,6 +678,8 @@ class BuiltinTest(unittest.TestCase):
def __len__(self):
return sys.maxsize + 1
self.assertRaises(OverflowError, len, HugeLen())
+ class NoLenMethod(object): pass
+ self.assertRaises(TypeError, len, NoLenMethod())
def test_map(self):
self.assertEqual(
@@ -814,8 +846,6 @@ class BuiltinTest(unittest.TestCase):
def test_oct(self):
self.assertEqual(oct(100), '0o144')
- self.assertEqual(oct(100), '0o144')
- self.assertEqual(oct(-100), '-0o144')
self.assertEqual(oct(-100), '-0o144')
self.assertRaises(TypeError, oct, ())
@@ -824,7 +854,6 @@ class BuiltinTest(unittest.TestCase):
fp = open(TESTFN, 'w')
try:
fp.write('1+1\n')
- fp.write('1+1\n')
fp.write('The quick brown fox jumps over the lazy dog')
fp.write('.\n')
fp.write('Dear John\n')
@@ -838,7 +867,6 @@ class BuiltinTest(unittest.TestCase):
fp = open(TESTFN, 'r')
try:
self.assertEqual(fp.readline(4), '1+1\n')
- self.assertEqual(fp.readline(4), '1+1\n')
self.assertEqual(fp.readline(), 'The quick brown fox jumps over the lazy dog.\n')
self.assertEqual(fp.readline(4), 'Dear')
self.assertEqual(fp.readline(100), ' John\n')
@@ -891,21 +919,6 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(pow(-2,2), 4)
self.assertEqual(pow(-2,3), -8)
- self.assertEqual(pow(0,0), 1)
- self.assertEqual(pow(0,1), 0)
- self.assertEqual(pow(1,0), 1)
- self.assertEqual(pow(1,1), 1)
-
- self.assertEqual(pow(2,0), 1)
- self.assertEqual(pow(2,10), 1024)
- self.assertEqual(pow(2,20), 1024*1024)
- self.assertEqual(pow(2,30), 1024*1024*1024)
-
- self.assertEqual(pow(-2,0), 1)
- self.assertEqual(pow(-2,1), -2)
- self.assertEqual(pow(-2,2), 4)
- self.assertEqual(pow(-2,3), -8)
-
self.assertAlmostEqual(pow(0.,0), 1.)
self.assertAlmostEqual(pow(0.,1), 0.)
self.assertAlmostEqual(pow(1.,0), 1.)
@@ -921,9 +934,9 @@ class BuiltinTest(unittest.TestCase):
self.assertAlmostEqual(pow(-2.,2), 4.)
self.assertAlmostEqual(pow(-2.,3), -8.)
- for x in 2, 2, 2.0:
- for y in 10, 10, 10.0:
- for z in 1000, 1000, 1000.0:
+ for x in 2, 2.0:
+ for y in 10, 10.0:
+ for z in 1000, 1000.0:
if isinstance(x, float) or \
isinstance(y, float) or \
isinstance(z, float):
@@ -936,93 +949,9 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, pow, -1, -2, 3)
self.assertRaises(ValueError, pow, 1, 2, 0)
- self.assertRaises(TypeError, pow, -1, -2, 3)
- self.assertRaises(ValueError, pow, 1, 2, 0)
self.assertRaises(TypeError, pow)
- def test_range(self):
- self.assertEqual(list(range(3)), [0, 1, 2])
- self.assertEqual(list(range(1, 5)), [1, 2, 3, 4])
- self.assertEqual(list(range(0)), [])
- self.assertEqual(list(range(-3)), [])
- self.assertEqual(list(range(1, 10, 3)), [1, 4, 7])
- #self.assertEqual(list(range(5, -5, -3)), [5, 2, -1, -4])
-
- #issue 6334: the internal stored range length was being
- #computed incorrectly in some cases involving large arguments.
- x = range(10**20, 10**20+10, 3)
- self.assertEqual(len(x), 4)
- self.assertEqual(len(list(x)), 4)
-
- x = range(10**20+10, 10**20, 3)
- self.assertEqual(len(x), 0)
- self.assertEqual(len(list(x)), 0)
-
- x = range(10**20, 10**20+10, -3)
- self.assertEqual(len(x), 0)
- self.assertEqual(len(list(x)), 0)
-
- x = range(10**20+10, 10**20, -3)
- self.assertEqual(len(x), 4)
- self.assertEqual(len(list(x)), 4)
-
- """ XXX(nnorwitz):
- # Now test range() with longs
- self.assertEqual(list(range(-2**100)), [])
- self.assertEqual(list(range(0, -2**100)), [])
- self.assertEqual(list(range(0, 2**100, -1)), [])
- self.assertEqual(list(range(0, 2**100, -1)), [])
-
- a = int(10 * sys.maxsize)
- b = int(100 * sys.maxsize)
- c = int(50 * sys.maxsize)
-
- self.assertEqual(list(range(a, a+2)), [a, a+1])
- self.assertEqual(list(range(a+2, a, -1)), [a+2, a+1])
- self.assertEqual(list(range(a+4, a, -2)), [a+4, a+2])
-
- seq = list(range(a, b, c))
- self.assertTrue(a in seq)
- self.assertTrue(b not in seq)
- self.assertEqual(len(seq), 2)
-
- seq = list(range(b, a, -c))
- self.assertTrue(b in seq)
- self.assertTrue(a not in seq)
- self.assertEqual(len(seq), 2)
-
- seq = list(range(-a, -b, -c))
- self.assertTrue(-a in seq)
- self.assertTrue(-b not in seq)
- self.assertEqual(len(seq), 2)
-
- self.assertRaises(TypeError, range)
- self.assertRaises(TypeError, range, 1, 2, 3, 4)
- self.assertRaises(ValueError, range, 1, 2, 0)
- self.assertRaises(ValueError, range, a, a + 1, int(0))
-
- class badzero(int):
- def __eq__(self, other):
- raise RuntimeError
- __ne__ = __lt__ = __gt__ = __le__ = __ge__ = __eq__
-
- # XXX This won't (but should!) raise RuntimeError if a is an int...
- self.assertRaises(RuntimeError, range, a, a + 1, badzero(1))
- """
-
- # Reject floats when it would require PyLongs to represent.
- # (smaller floats still accepted, but deprecated)
- self.assertRaises(TypeError, range, 1e100, 1e101, 1e101)
-
- self.assertRaises(TypeError, range, 0, "spam")
- self.assertRaises(TypeError, range, 0, 42, "spam")
-
- #NEAL self.assertRaises(OverflowError, range, -sys.maxsize, sys.maxsize)
- #NEAL self.assertRaises(OverflowError, range, 0, 2*sys.maxsize)
-
- self.assertRaises(OverflowError, len, range(0, sys.maxsize**10))
-
def test_input(self):
self.write_testfile()
fp = open(TESTFN, 'r')
@@ -1032,7 +961,6 @@ class BuiltinTest(unittest.TestCase):
sys.stdin = fp
sys.stdout = BitBucket()
self.assertEqual(input(), "1+1")
- self.assertEqual(input('testing\n'), "1+1")
self.assertEqual(input(), 'The quick brown fox jumps over the lazy dog.')
self.assertEqual(input('testing\n'), 'Dear John')
@@ -1063,7 +991,6 @@ class BuiltinTest(unittest.TestCase):
def test_repr(self):
self.assertEqual(repr(''), '\'\'')
self.assertEqual(repr(0), '0')
- self.assertEqual(repr(0), '0')
self.assertEqual(repr(()), '()')
self.assertEqual(repr([]), '[]')
self.assertEqual(repr({}), '{}')
@@ -1197,6 +1124,10 @@ class BuiltinTest(unittest.TestCase):
raise ValueError
self.assertRaises(ValueError, sum, BadSeq())
+ empty = []
+ sum(([x] for x in range(10)), empty)
+ self.assertEqual(empty, [])
+
def test_type(self):
self.assertEqual(type(''), type('123'))
self.assertNotEqual(type(''), type(()))
@@ -1214,14 +1145,19 @@ class BuiltinTest(unittest.TestCase):
b = 2
return vars()
+ class C_get_vars(object):
+ def getDict(self):
+ return {'a':2}
+ __dict__ = property(fget=getDict)
+
def test_vars(self):
self.assertEqual(set(vars()), set(dir()))
- import sys
self.assertEqual(set(vars(sys)), set(dir(sys)))
self.assertEqual(self.get_vars_f0(), {})
self.assertEqual(self.get_vars_f2(), {'a': 1, 'b': 2})
self.assertRaises(TypeError, vars, 42, 42)
self.assertRaises(TypeError, vars, 42)
+ self.assertEqual(vars(self.C_get_vars()), {'a':2})
def test_zip(self):
a = (1, 2, 3)
@@ -1267,6 +1203,116 @@ class BuiltinTest(unittest.TestCase):
return i
self.assertRaises(ValueError, list, zip(BadSeq(), BadSeq()))
+ def test_format(self):
+ # Test the basic machinery of the format() builtin. Don't test
+ # the specifics of the various formatters
+ self.assertEqual(format(3, ''), '3')
+
+ # Returns some classes to use for various tests. There's
+ # an old-style version, and a new-style version
+ def classes_new():
+ class A(object):
+ def __init__(self, x):
+ self.x = x
+ def __format__(self, format_spec):
+ return str(self.x) + format_spec
+ class DerivedFromA(A):
+ pass
+
+ class Simple(object): pass
+ class DerivedFromSimple(Simple):
+ def __init__(self, x):
+ self.x = x
+ def __format__(self, format_spec):
+ return str(self.x) + format_spec
+ class DerivedFromSimple2(DerivedFromSimple): pass
+ return A, DerivedFromA, DerivedFromSimple, DerivedFromSimple2
+
+ def class_test(A, DerivedFromA, DerivedFromSimple, DerivedFromSimple2):
+ self.assertEqual(format(A(3), 'spec'), '3spec')
+ self.assertEqual(format(DerivedFromA(4), 'spec'), '4spec')
+ self.assertEqual(format(DerivedFromSimple(5), 'abc'), '5abc')
+ self.assertEqual(format(DerivedFromSimple2(10), 'abcdef'),
+ '10abcdef')
+
+ class_test(*classes_new())
+
+ def empty_format_spec(value):
+ # test that:
+ # format(x, '') == str(x)
+ # format(x) == str(x)
+ self.assertEqual(format(value, ""), str(value))
+ self.assertEqual(format(value), str(value))
+
+ # for builtin types, format(x, "") == str(x)
+ empty_format_spec(17**13)
+ empty_format_spec(1.0)
+ empty_format_spec(3.1415e104)
+ empty_format_spec(-3.1415e104)
+ empty_format_spec(3.1415e-104)
+ empty_format_spec(-3.1415e-104)
+ empty_format_spec(object)
+ empty_format_spec(None)
+
+ # TypeError because self.__format__ returns the wrong type
+ class BadFormatResult:
+ def __format__(self, format_spec):
+ return 1.0
+ self.assertRaises(TypeError, format, BadFormatResult(), "")
+
+ # TypeError because format_spec is not unicode or str
+ self.assertRaises(TypeError, format, object(), 4)
+ self.assertRaises(TypeError, format, object(), object())
+
+ # tests for object.__format__ really belong elsewhere, but
+ # there's no good place to put them
+ x = object().__format__('')
+ self.assertTrue(x.startswith('<object object at'))
+
+ # first argument to object.__format__ must be string
+ self.assertRaises(TypeError, object().__format__, 3)
+ self.assertRaises(TypeError, object().__format__, object())
+ self.assertRaises(TypeError, object().__format__, None)
+
+ # --------------------------------------------------------------------
+ # Issue #7994: object.__format__ with a non-empty format string is
+ # pending deprecated
+ def test_deprecated_format_string(obj, fmt_str, should_raise_warning):
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always", PendingDeprecationWarning)
+ format(obj, fmt_str)
+ if should_raise_warning:
+ self.assertEqual(len(w), 1)
+ self.assertIsInstance(w[0].message, PendingDeprecationWarning)
+ self.assertIn('object.__format__ with a non-empty format '
+ 'string', str(w[0].message))
+ else:
+ self.assertEqual(len(w), 0)
+
+ fmt_strs = ['', 's']
+
+ class A:
+ def __format__(self, fmt_str):
+ return format('', fmt_str)
+
+ for fmt_str in fmt_strs:
+ test_deprecated_format_string(A(), fmt_str, False)
+
+ class B:
+ pass
+
+ class C(object):
+ pass
+
+ for cls in [object, B, C]:
+ for fmt_str in fmt_strs:
+ test_deprecated_format_string(cls(), fmt_str, len(fmt_str) != 0)
+ # --------------------------------------------------------------------
+
+ # make sure we can take a subclass of str as a format spec
+ class DerivedFromStr(str): pass
+ self.assertEqual(format(0, DerivedFromStr('10')), ' 0')
+
def test_bin(self):
self.assertEqual(bin(0), '0b0')
self.assertEqual(bin(1), '0b1')
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index a1e08cc735..5eab8f5561 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -9,15 +9,28 @@ import os
import re
import sys
import copy
-import operator
+import functools
import pickle
import tempfile
import unittest
-import warnings
import test.support
import test.string_tests
import test.buffer_tests
+
+if sys.flags.bytes_warning:
+ def check_bytes_warnings(func):
+ @functools.wraps(func)
+ def wrapper(*args, **kw):
+ with test.support.check_warnings(('', BytesWarning)):
+ return func(*args, **kw)
+ return wrapper
+else:
+ # no-op
+ def check_bytes_warnings(func):
+ return func
+
+
class Indexable:
def __init__(self, value=0):
self.value = value
@@ -27,17 +40,18 @@ class Indexable:
class BaseBytesTest(unittest.TestCase):
- def setUp(self):
- self.warning_filters = warnings.filters[:]
-
- def tearDown(self):
- warnings.filters = self.warning_filters
-
def test_basics(self):
b = self.type2test()
self.assertEqual(type(b), self.type2test)
self.assertEqual(b.__class__, self.type2test)
+ def test_copy(self):
+ a = self.type2test(b"abcd")
+ for copy_method in (copy.copy, copy.deepcopy):
+ b = copy_method(a)
+ self.assertEqual(a, b)
+ self.assertEqual(type(a), type(b))
+
def test_empty_sequence(self):
b = self.type2test()
self.assertEqual(len(b), 0)
@@ -120,14 +134,17 @@ class BaseBytesTest(unittest.TestCase):
self.assertFalse(b3 < b2)
self.assertFalse(b3 <= b2)
+ @check_bytes_warnings
def test_compare_to_str(self):
- warnings.simplefilter('ignore', BytesWarning)
# Byte comparisons with unicode should always fail!
- # Test this for all expected byte orders and Unicode character sizes
+ # Test this for all expected byte orders and Unicode character
+ # sizes.
self.assertEqual(self.type2test(b"\0a\0b\0c") == "abc", False)
- self.assertEqual(self.type2test(b"\0\0\0a\0\0\0b\0\0\0c") == "abc", False)
+ self.assertEqual(self.type2test(b"\0\0\0a\0\0\0b\0\0\0c") == "abc",
+ False)
self.assertEqual(self.type2test(b"a\0b\0c\0") == "abc", False)
- self.assertEqual(self.type2test(b"a\0\0\0b\0\0\0c\0\0\0") == "abc", False)
+ self.assertEqual(self.type2test(b"a\0\0\0b\0\0\0c\0\0\0") == "abc",
+ False)
self.assertEqual(self.type2test() == str(), False)
self.assertEqual(self.type2test() != str(), True)
@@ -187,6 +204,8 @@ class BaseBytesTest(unittest.TestCase):
b = self.type2test(sample, "latin1")
self.assertRaises(UnicodeDecodeError, b.decode, "utf8")
self.assertEqual(b.decode("utf8", "ignore"), "Hello world\n")
+ self.assertEqual(b.decode(errors="ignore", encoding="utf8"),
+ "Hello world\n")
def test_from_int(self):
b = self.type2test(0)
@@ -213,35 +232,36 @@ class BaseBytesTest(unittest.TestCase):
self.assertRaises(TypeError, lambda: b * 3.14)
self.assertRaises(TypeError, lambda: 3.14 * b)
# XXX Shouldn't bytes and bytearray agree on what to raise?
- self.assertRaises((OverflowError, MemoryError),
- lambda: b * sys.maxsize)
+ with self.assertRaises((OverflowError, MemoryError)):
+ c = b * sys.maxsize
+ with self.assertRaises((OverflowError, MemoryError)):
+ b *= sys.maxsize
def test_repeat_1char(self):
self.assertEqual(self.type2test(b'x')*100, self.type2test([ord('x')]*100))
def test_contains(self):
b = self.type2test(b"abc")
- self.assertTrue(ord('a') in b)
- self.assertTrue(int(ord('a')) in b)
- self.assertFalse(200 in b)
- self.assertFalse(200 in b)
+ self.assertIn(ord('a'), b)
+ self.assertIn(int(ord('a')), b)
+ self.assertNotIn(200, b)
self.assertRaises(ValueError, lambda: 300 in b)
self.assertRaises(ValueError, lambda: -1 in b)
self.assertRaises(TypeError, lambda: None in b)
self.assertRaises(TypeError, lambda: float(ord('a')) in b)
self.assertRaises(TypeError, lambda: "a" in b)
for f in bytes, bytearray:
- self.assertTrue(f(b"") in b)
- self.assertTrue(f(b"a") in b)
- self.assertTrue(f(b"b") in b)
- self.assertTrue(f(b"c") in b)
- self.assertTrue(f(b"ab") in b)
- self.assertTrue(f(b"bc") in b)
- self.assertTrue(f(b"abc") in b)
- self.assertFalse(f(b"ac") in b)
- self.assertFalse(f(b"d") in b)
- self.assertFalse(f(b"dab") in b)
- self.assertFalse(f(b"abd") in b)
+ self.assertIn(f(b""), b)
+ self.assertIn(f(b"a"), b)
+ self.assertIn(f(b"b"), b)
+ self.assertIn(f(b"c"), b)
+ self.assertIn(f(b"ab"), b)
+ self.assertIn(f(b"bc"), b)
+ self.assertIn(f(b"abc"), b)
+ self.assertNotIn(f(b"ac"), b)
+ self.assertNotIn(f(b"d"), b)
+ self.assertNotIn(f(b"dab"), b)
+ self.assertNotIn(f(b"abd"), b)
def test_fromhex(self):
self.assertRaises(TypeError, self.type2test.fromhex)
@@ -269,13 +289,6 @@ class BaseBytesTest(unittest.TestCase):
self.assertEqual(self.type2test(b".").join([b"ab", b"cd"]), b"ab.cd")
# XXX more...
- def test_index(self):
- b = self.type2test(b'parrot')
- self.assertEqual(b.index('p'), 0)
- self.assertEqual(b.index('rr'), 2)
- self.assertEqual(b.index('t'), 5)
- self.assertRaises(ValueError, lambda: b.index('w'))
-
def test_count(self):
b = self.type2test(b'mississippi')
self.assertEqual(b.count(b'i'), 4)
@@ -290,12 +303,9 @@ class BaseBytesTest(unittest.TestCase):
self.assertTrue(b.startswith(b"h"))
self.assertFalse(b.startswith(b"hellow"))
self.assertFalse(b.startswith(b"ha"))
- try:
+ with self.assertRaises(TypeError) as cm:
b.startswith([b'h'])
- except TypeError as err:
- exc = str(err)
- else:
- self.fail('startswith unexpectedly succeeded')
+ exc = str(cm.exception)
self.assertIn('bytes', exc)
self.assertIn('tuple', exc)
@@ -307,12 +317,9 @@ class BaseBytesTest(unittest.TestCase):
self.assertTrue(b.endswith(b"o"))
self.assertFalse(b.endswith(b"whello"))
self.assertFalse(b.endswith(b"no"))
- try:
+ with self.assertRaises(TypeError) as cm:
b.endswith([b'o'])
- except TypeError as err:
- exc = str(err)
- else:
- self.fail('endswith unexpectedly succeeded')
+ exc = str(cm.exception)
self.assertIn('bytes', exc)
self.assertIn('tuple', exc)
@@ -377,6 +384,10 @@ class BaseBytesTest(unittest.TestCase):
def test_split_string_error(self):
self.assertRaises(TypeError, self.type2test(b'a b').split, ' ')
+ def test_split_unicodewhitespace(self):
+ b = self.type2test(b"\x09\x0A\x0B\x0C\x0D\x1C\x1D\x1E\x1F")
+ self.assertEqual(b.split(), [b'\x1c\x1d\x1e\x1f'])
+
def test_rsplit(self):
b = self.type2test(b'mississippi')
self.assertEqual(b.rsplit(b'i'), [b'm', b'ss', b'ss', b'pp', b''])
@@ -400,18 +411,18 @@ class BaseBytesTest(unittest.TestCase):
def test_rsplit_unicodewhitespace(self):
b = self.type2test(b"\x09\x0A\x0B\x0C\x0D\x1C\x1D\x1E\x1F")
- self.assertEqual(b.split(), [b'\x1c\x1d\x1e\x1f'])
self.assertEqual(b.rsplit(), [b'\x1c\x1d\x1e\x1f'])
def test_partition(self):
b = self.type2test(b'mississippi')
self.assertEqual(b.partition(b'ss'), (b'mi', b'ss', b'issippi'))
- self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi'))
+ self.assertEqual(b.partition(b'w'), (b'mississippi', b'', b''))
def test_rpartition(self):
b = self.type2test(b'mississippi')
self.assertEqual(b.rpartition(b'ss'), (b'missi', b'ss', b'ippi'))
self.assertEqual(b.rpartition(b'i'), (b'mississipp', b'i', b''))
+ self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi'))
def test_pickling(self):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
@@ -522,19 +533,19 @@ class BaseBytesTest(unittest.TestCase):
# issue 11828
b = self.type2test(b'hello')
x = self.type2test(b'x')
- self.assertRaisesRegexp(TypeError, r'\bfind\b', b.find,
+ self.assertRaisesRegex(TypeError, r'\bfind\b', b.find,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'\brfind\b', b.rfind,
+ self.assertRaisesRegex(TypeError, r'\brfind\b', b.rfind,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'\bindex\b', b.index,
+ self.assertRaisesRegex(TypeError, r'\bindex\b', b.index,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'\brindex\b', b.rindex,
+ self.assertRaisesRegex(TypeError, r'\brindex\b', b.rindex,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'\bcount\b', b.count,
+ self.assertRaisesRegex(TypeError, r'\bcount\b', b.count,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'\bstartswith\b', b.startswith,
+ self.assertRaisesRegex(TypeError, r'\bstartswith\b', b.startswith,
x, None, None, None)
- self.assertRaisesRegexp(TypeError, r'\bendswith\b', b.endswith,
+ self.assertRaisesRegex(TypeError, r'\bendswith\b', b.endswith,
x, None, None, None)
@@ -558,6 +569,27 @@ class BytesTest(BaseBytesTest):
return None
self.assertRaises(TypeError, bytes, A())
+ # Test PyBytes_FromFormat()
+ def test_from_format(self):
+ test.support.import_module('ctypes')
+ from ctypes import pythonapi, py_object, c_int, c_char_p
+ PyBytes_FromFormat = pythonapi.PyBytes_FromFormat
+ PyBytes_FromFormat.restype = py_object
+
+ self.assertEqual(PyBytes_FromFormat(b'format'),
+ b'format')
+
+ self.assertEqual(PyBytes_FromFormat(b'%'), b'%')
+ self.assertEqual(PyBytes_FromFormat(b'%%'), b'%')
+ self.assertEqual(PyBytes_FromFormat(b'%%s'), b'%s')
+ self.assertEqual(PyBytes_FromFormat(b'[%%]'), b'[%]')
+ self.assertEqual(PyBytes_FromFormat(b'%%%c', c_int(ord('_'))), b'%_')
+
+ self.assertEqual(PyBytes_FromFormat(b'c:%c', c_int(255)),
+ b'c:\xff')
+ self.assertEqual(PyBytes_FromFormat(b's:%s', c_char_p(b'cstr')),
+ b's:cstr')
+
class ByteArrayTest(BaseBytesTest):
type2test = bytearray
@@ -795,7 +827,7 @@ class ByteArrayTest(BaseBytesTest):
self.assertEqual(b.pop(0), ord('w'))
self.assertEqual(b.pop(-2), ord('r'))
self.assertRaises(IndexError, lambda: b.pop(10))
- self.assertRaises(OverflowError, lambda: bytearray().pop())
+ self.assertRaises(IndexError, lambda: bytearray().pop())
# test for issue #6846
self.assertEqual(bytearray(b'\xff').pop(), 0xff)
@@ -890,27 +922,14 @@ class ByteArrayTest(BaseBytesTest):
self.assertRaises(BufferError, delslice)
self.assertEqual(b, orig)
- def test_empty_bytearray(self):
- # Issue #7561: operations on empty bytearrays could crash in many
- # situations, due to a fragile implementation of the
- # PyByteArray_AS_STRING() C macro.
- self.assertRaises(ValueError, int, bytearray(b''))
- self.assertRaises((ValueError, OSError), os.mkdir, bytearray(b''))
-
class AssortedBytesTest(unittest.TestCase):
#
# Test various combinations of bytes and bytearray
#
- def setUp(self):
- self.warning_filters = warnings.filters[:]
-
- def tearDown(self):
- warnings.filters = self.warning_filters
-
+ @check_bytes_warnings
def test_repr_str(self):
- warnings.simplefilter('ignore', BytesWarning)
for f in str, repr:
self.assertEqual(f(bytearray()), "bytearray(b'')")
self.assertEqual(f(bytearray([0])), "bytearray(b'\\x00')")
@@ -950,9 +969,9 @@ class AssortedBytesTest(unittest.TestCase):
self.assertEqual(bytes(b"abc") <= b"ab", False)
def test_doc(self):
- self.assertTrue(bytearray.__doc__ != None)
+ self.assertIsNotNone(bytearray.__doc__)
self.assertTrue(bytearray.__doc__.startswith("bytearray("), bytearray.__doc__)
- self.assertTrue(bytes.__doc__ != None)
+ self.assertIsNotNone(bytes.__doc__)
self.assertTrue(bytes.__doc__.startswith("bytes("), bytes.__doc__)
def test_from_bytearray(self):
@@ -961,8 +980,8 @@ class AssortedBytesTest(unittest.TestCase):
b = bytearray(buf)
self.assertEqual(b, bytearray(sample))
+ @check_bytes_warnings
def test_to_str(self):
- warnings.simplefilter('ignore', BytesWarning)
self.assertEqual(str(b''), "b''")
self.assertEqual(str(b'x'), "b'x'")
self.assertEqual(str(b'\x80'), "b'\\x80'")
@@ -1014,14 +1033,18 @@ class AssortedBytesTest(unittest.TestCase):
def test_compare(self):
if sys.flags.bytes_warning:
- warnings.simplefilter('error', BytesWarning)
- self.assertRaises(BytesWarning, operator.eq, b'', '')
- self.assertRaises(BytesWarning, operator.ne, b'', '')
- self.assertRaises(BytesWarning, operator.eq, bytearray(b''), '')
- self.assertRaises(BytesWarning, operator.ne, bytearray(b''), '')
+ def bytes_warning():
+ return test.support.check_warnings(('', BytesWarning))
+ with bytes_warning():
+ b'' == ''
+ with bytes_warning():
+ b'' != ''
+ with bytes_warning():
+ bytearray(b'') == ''
+ with bytes_warning():
+ bytearray(b'') != ''
else:
- # self.skipTest("BytesWarning is needed for this test: use -bb option")
- pass
+ self.skipTest("BytesWarning is needed for this test: use -bb option")
# Optimizations:
# __iter__? (optimization)
@@ -1053,7 +1076,13 @@ class BytearrayPEP3137Test(unittest.TestCase,
self.assertEqual(val, newval)
self.assertTrue(val is not newval,
methname+' returned self on a mutable object')
-
+ for expr in ('val.split()[0]', 'val.rsplit()[0]',
+ 'val.partition(b".")[0]', 'val.rpartition(b".")[2]',
+ 'val.splitlines()[0]', 'val.replace(b"", b"")'):
+ newval = eval(expr)
+ self.assertEqual(val, newval)
+ self.assertTrue(val is not newval,
+ expr+' returned val on a mutable object')
class FixedStringTest(test.string_tests.BaseTest):
@@ -1081,17 +1110,14 @@ class BytesAsStringTest(FixedStringTest):
type2test = bytes
-class ByteArraySubclass(bytearray):
- pass
-
-class ByteArraySubclassTest(unittest.TestCase):
+class SubclassTest(unittest.TestCase):
def test_basic(self):
- self.assertTrue(issubclass(ByteArraySubclass, bytearray))
- self.assertTrue(isinstance(ByteArraySubclass(), bytearray))
+ self.assertTrue(issubclass(self.subclass2test, self.type2test))
+ self.assertIsInstance(self.subclass2test(), self.type2test)
a, b = b"abcd", b"efgh"
- _a, _b = ByteArraySubclass(a), ByteArraySubclass(b)
+ _a, _b = self.subclass2test(a), self.subclass2test(b)
# test comparison operators with subclass instances
self.assertTrue(_a == _a)
@@ -1114,19 +1140,19 @@ class ByteArraySubclassTest(unittest.TestCase):
# Make sure join returns a NEW object for single item sequences
# involving a subclass.
# Make sure that it is of the appropriate type.
- s1 = ByteArraySubclass(b"abcd")
- s2 = bytearray().join([s1])
+ s1 = self.subclass2test(b"abcd")
+ s2 = self.type2test().join([s1])
self.assertTrue(s1 is not s2)
- self.assertTrue(type(s2) is bytearray, type(s2))
+ self.assertTrue(type(s2) is self.type2test, type(s2))
# Test reverse, calling join on subclass
s3 = s1.join([b"abcd"])
- self.assertTrue(type(s3) is bytearray)
+ self.assertTrue(type(s3) is self.type2test)
def test_pickle(self):
- a = ByteArraySubclass(b"abcd")
+ a = self.subclass2test(b"abcd")
a.x = 10
- a.y = ByteArraySubclass(b"efgh")
+ a.y = self.subclass2test(b"efgh")
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
b = pickle.loads(pickle.dumps(a, proto))
self.assertNotEqual(id(a), id(b))
@@ -1137,9 +1163,9 @@ class ByteArraySubclassTest(unittest.TestCase):
self.assertEqual(type(a.y), type(b.y))
def test_copy(self):
- a = ByteArraySubclass(b"abcd")
+ a = self.subclass2test(b"abcd")
a.x = 10
- a.y = ByteArraySubclass(b"efgh")
+ a.y = self.subclass2test(b"efgh")
for copy_method in (copy.copy, copy.deepcopy):
b = copy_method(a)
self.assertNotEqual(id(a), id(b))
@@ -1149,21 +1175,38 @@ class ByteArraySubclassTest(unittest.TestCase):
self.assertEqual(type(a), type(b))
self.assertEqual(type(a.y), type(b.y))
+
+class ByteArraySubclass(bytearray):
+ pass
+
+class BytesSubclass(bytes):
+ pass
+
+class ByteArraySubclassTest(SubclassTest):
+ type2test = bytearray
+ subclass2test = ByteArraySubclass
+
def test_init_override(self):
class subclass(bytearray):
- def __init__(self, newarg=1, *args, **kwargs):
- bytearray.__init__(self, *args, **kwargs)
+ def __init__(me, newarg=1, *args, **kwargs):
+ bytearray.__init__(me, *args, **kwargs)
+ x = subclass(4, b"abcd")
x = subclass(4, source=b"abcd")
self.assertEqual(x, b"abcd")
x = subclass(newarg=4, source=b"abcd")
self.assertEqual(x, b"abcd")
+class BytesSubclassTest(SubclassTest):
+ type2test = bytes
+ subclass2test = BytesSubclass
+
+
def test_main():
test.support.run_unittest(
BytesTest, AssortedBytesTest, BytesAsStringTest,
- ByteArrayTest, ByteArrayAsStringTest, ByteArraySubclassTest,
- BytearrayPEP3137Test)
+ ByteArrayTest, ByteArrayAsStringTest, BytesSubclassTest,
+ ByteArraySubclassTest, BytearrayPEP3137Test)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index fbf8fff47c..be3558050b 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
from test import support
from test.support import TESTFN
@@ -7,11 +7,14 @@ from io import BytesIO
import os
import subprocess
import sys
-import threading
+
+try:
+ import threading
+except ImportError:
+ threading = None
# Skip tests if the bz2 module doesn't exist.
bz2 = support.import_module('bz2')
-
from bz2 import BZ2File, BZ2Compressor, BZ2Decompressor
has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx")
@@ -52,76 +55,68 @@ class BZ2FileTest(BaseTest):
os.unlink(self.filename)
def createTempFile(self, crlf=0):
- f = open(self.filename, "wb")
- if crlf:
- data = self.DATA_CRLF
- else:
- data = self.DATA
- f.write(data)
- f.close()
+ with open(self.filename, "wb") as f:
+ if crlf:
+ data = self.DATA_CRLF
+ else:
+ data = self.DATA
+ f.write(data)
def testRead(self):
# "Test BZ2File.read()"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertRaises(TypeError, bz2f.read, None)
- self.assertEqual(bz2f.read(), self.TEXT)
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.read, None)
+ self.assertEqual(bz2f.read(), self.TEXT)
def testRead0(self):
# Test BBZ2File.read(0)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertRaises(TypeError, bz2f.read, None)
- self.assertEqual(bz2f.read(0), b"")
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.read, None)
+ self.assertEqual(bz2f.read(0), b"")
def testReadChunk10(self):
# "Test BZ2File.read() in chunks of 10 bytes"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- text = b''
- while 1:
- str = bz2f.read(10)
- if not str:
- break
- text += str
- self.assertEqual(text, self.TEXT)
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ text = b''
+ while 1:
+ str = bz2f.read(10)
+ if not str:
+ break
+ text += str
+ self.assertEqual(text, self.TEXT)
def testRead100(self):
# "Test BZ2File.read(100)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertEqual(bz2f.read(100), self.TEXT[:100])
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertEqual(bz2f.read(100), self.TEXT[:100])
def testReadLine(self):
# "Test BZ2File.readline()"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertRaises(TypeError, bz2f.readline, None)
- sio = BytesIO(self.TEXT)
- for line in sio.readlines():
- self.assertEqual(bz2f.readline(), line)
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.readline, None)
+ sio = BytesIO(self.TEXT)
+ for line in sio.readlines():
+ self.assertEqual(bz2f.readline(), line)
def testReadLines(self):
# "Test BZ2File.readlines()"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertRaises(TypeError, bz2f.readlines, None)
- sio = BytesIO(self.TEXT)
- self.assertEqual(bz2f.readlines(), sio.readlines())
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.readlines, None)
+ sio = BytesIO(self.TEXT)
+ self.assertEqual(bz2f.readlines(), sio.readlines())
def testIterator(self):
# "Test iter(BZ2File)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- sio = BytesIO(self.TEXT)
- self.assertEqual(list(iter(bz2f)), sio.readlines())
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ sio = BytesIO(self.TEXT)
+ self.assertEqual(list(iter(bz2f)), sio.readlines())
def testClosedIteratorDeadlock(self):
# "Test that iteration on a closed bz2file releases the lock."
@@ -136,104 +131,91 @@ class BZ2FileTest(BaseTest):
def testWrite(self):
# "Test BZ2File.write()"
- bz2f = BZ2File(self.filename, "w")
- self.assertRaises(TypeError, bz2f.write)
- bz2f.write(self.TEXT)
- bz2f.close()
- f = open(self.filename, 'rb')
- self.assertEqual(self.decompress(f.read()), self.TEXT)
- f.close()
+ with BZ2File(self.filename, "w") as bz2f:
+ self.assertRaises(TypeError, bz2f.write)
+ bz2f.write(self.TEXT)
+ with open(self.filename, 'rb') as f:
+ self.assertEqual(self.decompress(f.read()), self.TEXT)
def testWriteChunks10(self):
# "Test BZ2File.write() with chunks of 10 bytes"
- bz2f = BZ2File(self.filename, "w")
- n = 0
- while 1:
- str = self.TEXT[n*10:(n+1)*10]
- if not str:
- break
- bz2f.write(str)
- n += 1
- bz2f.close()
- f = open(self.filename, 'rb')
- self.assertEqual(self.decompress(f.read()), self.TEXT)
- f.close()
+ with BZ2File(self.filename, "w") as bz2f:
+ n = 0
+ while 1:
+ str = self.TEXT[n*10:(n+1)*10]
+ if not str:
+ break
+ bz2f.write(str)
+ n += 1
+ with open(self.filename, 'rb') as f:
+ self.assertEqual(self.decompress(f.read()), self.TEXT)
def testWriteLines(self):
# "Test BZ2File.writelines()"
- bz2f = BZ2File(self.filename, "w")
- self.assertRaises(TypeError, bz2f.writelines)
- sio = BytesIO(self.TEXT)
- bz2f.writelines(sio.readlines())
- bz2f.close()
+ with BZ2File(self.filename, "w") as bz2f:
+ self.assertRaises(TypeError, bz2f.writelines)
+ sio = BytesIO(self.TEXT)
+ bz2f.writelines(sio.readlines())
# patch #1535500
self.assertRaises(ValueError, bz2f.writelines, ["a"])
- f = open(self.filename, 'rb')
- self.assertEqual(self.decompress(f.read()), self.TEXT)
- f.close()
+ with open(self.filename, 'rb') as f:
+ self.assertEqual(self.decompress(f.read()), self.TEXT)
def testWriteMethodsOnReadOnlyFile(self):
- bz2f = BZ2File(self.filename, "w")
- bz2f.write(b"abc")
- bz2f.close()
+ with BZ2File(self.filename, "w") as bz2f:
+ bz2f.write(b"abc")
- bz2f = BZ2File(self.filename, "r")
- self.assertRaises(IOError, bz2f.write, b"a")
- self.assertRaises(IOError, bz2f.writelines, [b"a"])
+ with BZ2File(self.filename, "r") as bz2f:
+ self.assertRaises(IOError, bz2f.write, b"a")
+ self.assertRaises(IOError, bz2f.writelines, [b"a"])
def testSeekForward(self):
# "Test BZ2File.seek(150, 0)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertRaises(TypeError, bz2f.seek)
- bz2f.seek(150)
- self.assertEqual(bz2f.read(), self.TEXT[150:])
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.seek)
+ bz2f.seek(150)
+ self.assertEqual(bz2f.read(), self.TEXT[150:])
def testSeekBackwards(self):
# "Test BZ2File.seek(-150, 1)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.read(500)
- bz2f.seek(-150, 1)
- self.assertEqual(bz2f.read(), self.TEXT[500-150:])
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.read(500)
+ bz2f.seek(-150, 1)
+ self.assertEqual(bz2f.read(), self.TEXT[500-150:])
def testSeekBackwardsFromEnd(self):
# "Test BZ2File.seek(-150, 2)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.seek(-150, 2)
- self.assertEqual(bz2f.read(), self.TEXT[len(self.TEXT)-150:])
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.seek(-150, 2)
+ self.assertEqual(bz2f.read(), self.TEXT[len(self.TEXT)-150:])
def testSeekPostEnd(self):
# "Test BZ2File.seek(150000)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.seek(150000)
- self.assertEqual(bz2f.tell(), len(self.TEXT))
- self.assertEqual(bz2f.read(), b"")
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.seek(150000)
+ self.assertEqual(bz2f.tell(), len(self.TEXT))
+ self.assertEqual(bz2f.read(), b"")
def testSeekPostEndTwice(self):
# "Test BZ2File.seek(150000) twice"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.seek(150000)
- bz2f.seek(150000)
- self.assertEqual(bz2f.tell(), len(self.TEXT))
- self.assertEqual(bz2f.read(), b"")
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.seek(150000)
+ bz2f.seek(150000)
+ self.assertEqual(bz2f.tell(), len(self.TEXT))
+ self.assertEqual(bz2f.read(), b"")
def testSeekPreStart(self):
# "Test BZ2File.seek(-150, 0)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.seek(-150)
- self.assertEqual(bz2f.tell(), 0)
- self.assertEqual(bz2f.read(), self.TEXT)
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.seek(-150)
+ self.assertEqual(bz2f.tell(), 0)
+ self.assertEqual(bz2f.read(), self.TEXT)
def testOpenDel(self):
# "Test opening and deleting a file many times"
@@ -249,16 +231,13 @@ class BZ2FileTest(BaseTest):
def testBug1191043(self):
# readlines() for files containing no newline
data = b'BZh91AY&SY\xd9b\x89]\x00\x00\x00\x03\x80\x04\x00\x02\x00\x0c\x00 \x00!\x9ah3M\x13<]\xc9\x14\xe1BCe\x8a%t'
- f = open(self.filename, "wb")
- f.write(data)
- f.close()
- bz2f = BZ2File(self.filename)
- lines = bz2f.readlines()
- bz2f.close()
+ with open(self.filename, "wb") as f:
+ f.write(data)
+ with BZ2File(self.filename) as bz2f:
+ lines = bz2f.readlines()
self.assertEqual(lines, [b'Test'])
- bz2f = BZ2File(self.filename)
- xlines = list(bz2f.readlines())
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ xlines = list(bz2f.readlines())
self.assertEqual(xlines, [b'Test'])
def testContextProtocol(self):
@@ -283,12 +262,12 @@ class BZ2FileTest(BaseTest):
else:
self.fail("1/0 didn't raise an exception")
+ @unittest.skipUnless(threading, 'Threading required for this test.')
def testThreading(self):
# Using a BZ2File from several threads doesn't deadlock (issue #7205).
data = b"1" * 2**20
nthreads = 10
- f = bz2.BZ2File(self.filename, 'wb')
- try:
+ with bz2.BZ2File(self.filename, 'wb') as f:
def comp():
for i in range(5):
f.write(data)
@@ -297,27 +276,19 @@ class BZ2FileTest(BaseTest):
t.start()
for t in threads:
t.join()
- finally:
- f.close()
def testMixedIterationReads(self):
# Issue #8397: mixed iteration and reads should be forbidden.
- f = bz2.BZ2File(self.filename, 'wb')
- try:
+ with bz2.BZ2File(self.filename, 'wb') as f:
# The internal buffer size is hard-wired to 8192 bytes, we must
# write out more than that for the test to stop half through
# the buffer.
f.write(self.TEXT * 100)
- finally:
- f.close()
- f = bz2.BZ2File(self.filename, 'rb')
- try:
+ with bz2.BZ2File(self.filename, 'rb') as f:
next(f)
self.assertRaises(ValueError, f.read)
self.assertRaises(ValueError, f.readline)
self.assertRaises(ValueError, f.readlines)
- finally:
- f.close()
class BZ2CompressorTest(BaseTest):
def testCompress(self):
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index f2969e285d..4bd758b641 100644
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -2,9 +2,9 @@ import calendar
import unittest
from test import support
+import time
import locale
-
result_2004_text = """
2004
@@ -262,7 +262,7 @@ class CalendarTestCase(unittest.TestCase):
return
calendar.LocaleHTMLCalendar(locale='').formatmonthname(2010, 10)
new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
- self.assertEquals(old_october, new_october)
+ self.assertEqual(old_october, new_october)
class MonthCalendarTestCase(unittest.TestCase):
@@ -395,6 +395,13 @@ class SundayTestCase(MonthCalendarTestCase):
# A 31-day december starting on friday (2+7+7+7+7+1 days)
self.check_weeks(1995, 12, (2, 7, 7, 7, 7, 1))
+class TimegmTestCase(unittest.TestCase):
+ TIMESTAMPS = [0, 10, 100, 1000, 10000, 100000, 1000000,
+ 1234567890, 1262304000, 1275785153,]
+ def test_timegm(self):
+ for secs in self.TIMESTAMPS:
+ tuple = time.gmtime(secs)
+ self.assertEqual(secs, calendar.timegm(tuple))
class MonthRangeTestCase(unittest.TestCase):
def test_january(self):
@@ -450,6 +457,7 @@ def test_main():
CalendarTestCase,
MondayTestCase,
SundayTestCase,
+ TimegmTestCase,
MonthRangeTestCase,
LeapdaysTestCase,
)
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 3f1d63c490..327ac66501 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -2,12 +2,17 @@
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
+import os
+import random
+import subprocess
import sys
import time
-import random
import unittest
-import threading
from test import support
+try:
+ import threading
+except ImportError:
+ threading = None
import _testcapi
@@ -32,7 +37,24 @@ class CAPITest(unittest.TestCase):
self.assertEqual(testfunction.attribute, "test")
self.assertRaises(AttributeError, setattr, inst.testfunction, "attribute", "test")
-
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ def test_no_FatalError_infinite_loop(self):
+ p = subprocess.Popen([sys.executable, "-c",
+ 'import _testcapi;'
+ '_testcapi.crash_no_current_thread()'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (out, err) = p.communicate()
+ self.assertEqual(out, b'')
+ # This used to cause an infinite loop.
+ self.assertEqual(err.rstrip(),
+ b'Fatal Python error:'
+ b' PyThreadState_Get: no current thread')
+
+ def test_memoryview_from_NULL_pointer(self):
+ self.assertRaises(ValueError, _testcapi.make_memoryview_from_NULL_pointer)
+
+@unittest.skipUnless(threading, 'Threading required for this test.')
class TestPendingCalls(unittest.TestCase):
def pendingcalls_submit(self, l, n):
@@ -120,8 +142,38 @@ class Test6012(unittest.TestCase):
def test(self):
self.assertEqual(_testcapi.argparsing("Hello", "World"), 1)
+
+class EmbeddingTest(unittest.TestCase):
+
+ def test_subinterps(self):
+ # XXX only tested under Unix checkouts
+ basepath = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
+ oldcwd = os.getcwd()
+ # This is needed otherwise we get a fatal error:
+ # "Py_Initialize: Unable to get the locale encoding
+ # LookupError: no codec search functions registered: can't find encoding"
+ os.chdir(basepath)
+ try:
+ exe = os.path.join(basepath, "Modules", "_testembed")
+ if not os.path.exists(exe):
+ self.skipTest("%r doesn't exist" % exe)
+ p = subprocess.Popen([exe],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (out, err) = p.communicate()
+ self.assertEqual(p.returncode, 0,
+ "bad returncode %d, stderr is %r" %
+ (p.returncode, err))
+ if support.verbose:
+ print()
+ print(out.decode('latin1'))
+ print(err.decode('latin1'))
+ finally:
+ os.chdir(oldcwd)
+
+
def test_main():
- support.run_unittest(CAPITest)
+ support.run_unittest(CAPITest, TestPendingCalls, Test6012, EmbeddingTest)
for name in dir(_testcapi):
if name.startswith('test_'):
@@ -148,23 +200,14 @@ def test_main():
raise support.TestFailed(
"Couldn't find main thread correctly in the list")
- try:
- _testcapi._test_thread_state
- have_thread_state = True
- except AttributeError:
- have_thread_state = False
-
- if have_thread_state:
+ if threading:
import _thread
import time
TestThreadState()
- import threading
t = threading.Thread(target=TestThreadState)
t.start()
t.join()
- support.run_unittest(TestPendingCalls, Test6012)
-
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_cfgparser.py b/Lib/test/test_cfgparser.py
index 299870c4e4..1db92176f8 100644
--- a/Lib/test/test_cfgparser.py
+++ b/Lib/test/test_cfgparser.py
@@ -1,11 +1,16 @@
+import collections
import configparser
import io
+import os
+import sys
+import textwrap
import unittest
-import collections
+import warnings
from test import support
class SortedDict(collections.UserDict):
+
def items(self):
return sorted(self.data.items())
@@ -15,72 +20,230 @@ class SortedDict(collections.UserDict):
def values(self):
return [i[1] for i in self.items()]
- def iteritems(self): return iter(self.items())
- def iterkeys(self): return iter(self.keys())
+ def iteritems(self):
+ return iter(self.items())
+
+ def iterkeys(self):
+ return iter(self.keys())
+
+ def itervalues(self):
+ return iter(self.values())
+
__iter__ = iterkeys
- def itervalues(self): return iter(self.values())
-class TestCaseBase(unittest.TestCase):
+
+class CfgParserTestCaseClass(unittest.TestCase):
+ allow_no_value = False
+ delimiters = ('=', ':')
+ comment_prefixes = (';', '#')
+ inline_comment_prefixes = (';', '#')
+ empty_lines_in_values = True
+ dict_type = configparser._default_dict
+ strict = False
+ default_section = configparser.DEFAULTSECT
+ interpolation = configparser._UNSET
+
def newconfig(self, defaults=None):
- if defaults is None:
- self.cf = self.config_class()
- else:
- self.cf = self.config_class(defaults)
- return self.cf
+ arguments = dict(
+ defaults=defaults,
+ allow_no_value=self.allow_no_value,
+ delimiters=self.delimiters,
+ comment_prefixes=self.comment_prefixes,
+ inline_comment_prefixes=self.inline_comment_prefixes,
+ empty_lines_in_values=self.empty_lines_in_values,
+ dict_type=self.dict_type,
+ strict=self.strict,
+ default_section=self.default_section,
+ interpolation=self.interpolation,
+ )
+ instance = self.config_class(**arguments)
+ return instance
def fromstring(self, string, defaults=None):
cf = self.newconfig(defaults)
- sio = io.StringIO(string)
- cf.readfp(sio)
+ cf.read_string(string)
return cf
- def test_basic(self):
- cf = self.fromstring(
- "[Foo Bar]\n"
- "foo=bar\n"
- "[Spacey Bar]\n"
- "foo = bar\n"
- "[Commented Bar]\n"
- "foo: bar ; comment\n"
- "[Long Line]\n"
- "foo: this line is much, much longer than my editor\n"
- " likes it.\n"
- "[Section\\with$weird%characters[\t]\n"
- "[Internationalized Stuff]\n"
- "foo[bg]: Bulgarian\n"
- "foo=Default\n"
- "foo[en]=English\n"
- "foo[de]=Deutsch\n"
- "[Spaces]\n"
- "key with spaces : value\n"
- "another with spaces = splat!\n"
- )
+class BasicTestCase(CfgParserTestCaseClass):
+
+ def basic_test(self, cf):
+ E = ['Commented Bar',
+ 'Foo Bar',
+ 'Internationalized Stuff',
+ 'Long Line',
+ 'Section\\with$weird%characters[\t',
+ 'Spaces',
+ 'Spacey Bar',
+ 'Spacey Bar From The Beginning',
+ 'Types',
+ ]
+
+ if self.allow_no_value:
+ E.append('NoValue')
+ E.sort()
+ F = [('baz', 'qwe'), ('foo', 'bar3')]
+
+ # API access
L = cf.sections()
L.sort()
eq = self.assertEqual
- eq(L, [r'Commented Bar',
- r'Foo Bar',
- r'Internationalized Stuff',
- r'Long Line',
- r'Section\with$weird%characters[' '\t',
- r'Spaces',
- r'Spacey Bar',
- ])
+ eq(L, E)
+ L = cf.items('Spacey Bar From The Beginning')
+ L.sort()
+ eq(L, F)
+
+ # mapping access
+ L = [section for section in cf]
+ L.sort()
+ E.append(self.default_section)
+ E.sort()
+ eq(L, E)
+ L = cf['Spacey Bar From The Beginning'].items()
+ L = sorted(list(L))
+ eq(L, F)
+ L = cf.items()
+ L = sorted(list(L))
+ self.assertEqual(len(L), len(E))
+ for name, section in L:
+ eq(name, section.name)
+ eq(cf.defaults(), cf[self.default_section])
# The use of spaces in the section names serves as a
# regression test for SourceForge bug #583248:
# http://www.python.org/sf/583248
- eq(cf.get('Foo Bar', 'foo'), 'bar')
- eq(cf.get('Spacey Bar', 'foo'), 'bar')
- eq(cf.get('Commented Bar', 'foo'), 'bar')
+
+ # API access
+ eq(cf.get('Foo Bar', 'foo'), 'bar1')
+ eq(cf.get('Spacey Bar', 'foo'), 'bar2')
+ eq(cf.get('Spacey Bar From The Beginning', 'foo'), 'bar3')
+ eq(cf.get('Spacey Bar From The Beginning', 'baz'), 'qwe')
+ eq(cf.get('Commented Bar', 'foo'), 'bar4')
+ eq(cf.get('Commented Bar', 'baz'), 'qwe')
eq(cf.get('Spaces', 'key with spaces'), 'value')
eq(cf.get('Spaces', 'another with spaces'), 'splat!')
+ eq(cf.getint('Types', 'int'), 42)
+ eq(cf.get('Types', 'int'), "42")
+ self.assertAlmostEqual(cf.getfloat('Types', 'float'), 0.44)
+ eq(cf.get('Types', 'float'), "0.44")
+ eq(cf.getboolean('Types', 'boolean'), False)
+ eq(cf.get('Types', '123'), 'strange but acceptable')
+ if self.allow_no_value:
+ eq(cf.get('NoValue', 'option-without-value'), None)
- self.assertFalse('__name__' in cf.options("Foo Bar"),
- '__name__ "option" should not be exposed by the API!')
+ # test vars= and fallback=
+ eq(cf.get('Foo Bar', 'foo', fallback='baz'), 'bar1')
+ eq(cf.get('Foo Bar', 'foo', vars={'foo': 'baz'}), 'baz')
+ with self.assertRaises(configparser.NoSectionError):
+ cf.get('No Such Foo Bar', 'foo')
+ with self.assertRaises(configparser.NoOptionError):
+ cf.get('Foo Bar', 'no-such-foo')
+ eq(cf.get('No Such Foo Bar', 'foo', fallback='baz'), 'baz')
+ eq(cf.get('Foo Bar', 'no-such-foo', fallback='baz'), 'baz')
+ eq(cf.get('Spacey Bar', 'foo', fallback=None), 'bar2')
+ eq(cf.get('No Such Spacey Bar', 'foo', fallback=None), None)
+ eq(cf.getint('Types', 'int', fallback=18), 42)
+ eq(cf.getint('Types', 'no-such-int', fallback=18), 18)
+ eq(cf.getint('Types', 'no-such-int', fallback="18"), "18") # sic!
+ with self.assertRaises(configparser.NoOptionError):
+ cf.getint('Types', 'no-such-int')
+ self.assertAlmostEqual(cf.getfloat('Types', 'float',
+ fallback=0.0), 0.44)
+ self.assertAlmostEqual(cf.getfloat('Types', 'no-such-float',
+ fallback=0.0), 0.0)
+ eq(cf.getfloat('Types', 'no-such-float', fallback="0.0"), "0.0") # sic!
+ with self.assertRaises(configparser.NoOptionError):
+ cf.getfloat('Types', 'no-such-float')
+ eq(cf.getboolean('Types', 'boolean', fallback=True), False)
+ eq(cf.getboolean('Types', 'no-such-boolean', fallback="yes"),
+ "yes") # sic!
+ eq(cf.getboolean('Types', 'no-such-boolean', fallback=True), True)
+ with self.assertRaises(configparser.NoOptionError):
+ cf.getboolean('Types', 'no-such-boolean')
+ eq(cf.getboolean('No Such Types', 'boolean', fallback=True), True)
+ if self.allow_no_value:
+ eq(cf.get('NoValue', 'option-without-value', fallback=False), None)
+ eq(cf.get('NoValue', 'no-such-option-without-value',
+ fallback=False), False)
- # Make sure the right things happen for remove_option();
- # added to include check for SourceForge bug #123324:
+ # mapping access
+ eq(cf['Foo Bar']['foo'], 'bar1')
+ eq(cf['Spacey Bar']['foo'], 'bar2')
+ section = cf['Spacey Bar From The Beginning']
+ eq(section.name, 'Spacey Bar From The Beginning')
+ self.assertIs(section.parser, cf)
+ with self.assertRaises(AttributeError):
+ section.name = 'Name is read-only'
+ with self.assertRaises(AttributeError):
+ section.parser = 'Parser is read-only'
+ eq(section['foo'], 'bar3')
+ eq(section['baz'], 'qwe')
+ eq(cf['Commented Bar']['foo'], 'bar4')
+ eq(cf['Commented Bar']['baz'], 'qwe')
+ eq(cf['Spaces']['key with spaces'], 'value')
+ eq(cf['Spaces']['another with spaces'], 'splat!')
+ eq(cf['Long Line']['foo'],
+ 'this line is much, much longer than my editor\nlikes it.')
+ if self.allow_no_value:
+ eq(cf['NoValue']['option-without-value'], None)
+ # test vars= and fallback=
+ eq(cf['Foo Bar'].get('foo', 'baz'), 'bar1')
+ eq(cf['Foo Bar'].get('foo', fallback='baz'), 'bar1')
+ eq(cf['Foo Bar'].get('foo', vars={'foo': 'baz'}), 'baz')
+ with self.assertRaises(KeyError):
+ cf['No Such Foo Bar']['foo']
+ with self.assertRaises(KeyError):
+ cf['Foo Bar']['no-such-foo']
+ with self.assertRaises(KeyError):
+ cf['No Such Foo Bar'].get('foo', fallback='baz')
+ eq(cf['Foo Bar'].get('no-such-foo', 'baz'), 'baz')
+ eq(cf['Foo Bar'].get('no-such-foo', fallback='baz'), 'baz')
+ eq(cf['Foo Bar'].get('no-such-foo'), None)
+ eq(cf['Spacey Bar'].get('foo', None), 'bar2')
+ eq(cf['Spacey Bar'].get('foo', fallback=None), 'bar2')
+ with self.assertRaises(KeyError):
+ cf['No Such Spacey Bar'].get('foo', None)
+ eq(cf['Types'].getint('int', 18), 42)
+ eq(cf['Types'].getint('int', fallback=18), 42)
+ eq(cf['Types'].getint('no-such-int', 18), 18)
+ eq(cf['Types'].getint('no-such-int', fallback=18), 18)
+ eq(cf['Types'].getint('no-such-int', "18"), "18") # sic!
+ eq(cf['Types'].getint('no-such-int', fallback="18"), "18") # sic!
+ eq(cf['Types'].getint('no-such-int'), None)
+ self.assertAlmostEqual(cf['Types'].getfloat('float', 0.0), 0.44)
+ self.assertAlmostEqual(cf['Types'].getfloat('float',
+ fallback=0.0), 0.44)
+ self.assertAlmostEqual(cf['Types'].getfloat('no-such-float', 0.0), 0.0)
+ self.assertAlmostEqual(cf['Types'].getfloat('no-such-float',
+ fallback=0.0), 0.0)
+ eq(cf['Types'].getfloat('no-such-float', "0.0"), "0.0") # sic!
+ eq(cf['Types'].getfloat('no-such-float', fallback="0.0"), "0.0") # sic!
+ eq(cf['Types'].getfloat('no-such-float'), None)
+ eq(cf['Types'].getboolean('boolean', True), False)
+ eq(cf['Types'].getboolean('boolean', fallback=True), False)
+ eq(cf['Types'].getboolean('no-such-boolean', "yes"), "yes") # sic!
+ eq(cf['Types'].getboolean('no-such-boolean', fallback="yes"),
+ "yes") # sic!
+ eq(cf['Types'].getboolean('no-such-boolean', True), True)
+ eq(cf['Types'].getboolean('no-such-boolean', fallback=True), True)
+ eq(cf['Types'].getboolean('no-such-boolean'), None)
+ if self.allow_no_value:
+ eq(cf['NoValue'].get('option-without-value', False), None)
+ eq(cf['NoValue'].get('option-without-value', fallback=False), None)
+ eq(cf['NoValue'].get('no-such-option-without-value', False), False)
+ eq(cf['NoValue'].get('no-such-option-without-value',
+ fallback=False), False)
+
+ # Make sure the right things happen for remove_section() and
+ # remove_option(); added to include check for SourceForge bug #123324.
+
+ cf[self.default_section]['this_value'] = '1'
+ cf[self.default_section]['that_value'] = '2'
+
+ # API access
+ self.assertTrue(cf.remove_section('Spaces'))
+ self.assertFalse(cf.has_option('Spaces', 'key with spaces'))
+ self.assertFalse(cf.remove_section('Spaces'))
+ self.assertFalse(cf.remove_section(self.default_section))
self.assertTrue(cf.remove_option('Foo Bar', 'foo'),
"remove_option() failed to report existence of option")
self.assertFalse(cf.has_option('Foo Bar', 'foo'),
@@ -88,26 +251,199 @@ class TestCaseBase(unittest.TestCase):
self.assertFalse(cf.remove_option('Foo Bar', 'foo'),
"remove_option() failed to report non-existence of option"
" that was removed")
+ self.assertTrue(cf.has_option('Foo Bar', 'this_value'))
+ self.assertFalse(cf.remove_option('Foo Bar', 'this_value'))
+ self.assertTrue(cf.remove_option(self.default_section, 'this_value'))
+ self.assertFalse(cf.has_option('Foo Bar', 'this_value'))
+ self.assertFalse(cf.remove_option(self.default_section, 'this_value'))
- self.assertRaises(configparser.NoSectionError,
- cf.remove_option, 'No Such Section', 'foo')
+ with self.assertRaises(configparser.NoSectionError) as cm:
+ cf.remove_option('No Such Section', 'foo')
+ self.assertEqual(cm.exception.args, ('No Such Section',))
eq(cf.get('Long Line', 'foo'),
'this line is much, much longer than my editor\nlikes it.')
+ # mapping access
+ del cf['Types']
+ self.assertFalse('Types' in cf)
+ with self.assertRaises(KeyError):
+ del cf['Types']
+ with self.assertRaises(ValueError):
+ del cf[self.default_section]
+ del cf['Spacey Bar']['foo']
+ self.assertFalse('foo' in cf['Spacey Bar'])
+ with self.assertRaises(KeyError):
+ del cf['Spacey Bar']['foo']
+ self.assertTrue('that_value' in cf['Spacey Bar'])
+ with self.assertRaises(KeyError):
+ del cf['Spacey Bar']['that_value']
+ del cf[self.default_section]['that_value']
+ self.assertFalse('that_value' in cf['Spacey Bar'])
+ with self.assertRaises(KeyError):
+ del cf[self.default_section]['that_value']
+ with self.assertRaises(KeyError):
+ del cf['No Such Section']['foo']
+
+ # Don't add new asserts below in this method as most of the options
+ # and sections are now removed.
+
+ def test_basic(self):
+ config_string = """\
+[Foo Bar]
+foo{0[0]}bar1
+[Spacey Bar]
+foo {0[0]} bar2
+[Spacey Bar From The Beginning]
+ foo {0[0]} bar3
+ baz {0[0]} qwe
+[Commented Bar]
+foo{0[1]} bar4 {1[1]} comment
+baz{0[0]}qwe {1[0]}another one
+[Long Line]
+foo{0[1]} this line is much, much longer than my editor
+ likes it.
+[Section\\with$weird%characters[\t]
+[Internationalized Stuff]
+foo[bg]{0[1]} Bulgarian
+foo{0[0]}Default
+foo[en]{0[0]}English
+foo[de]{0[0]}Deutsch
+[Spaces]
+key with spaces {0[1]} value
+another with spaces {0[0]} splat!
+[Types]
+int {0[1]} 42
+float {0[0]} 0.44
+boolean {0[0]} NO
+123 {0[1]} strange but acceptable
+""".format(self.delimiters, self.comment_prefixes)
+ if self.allow_no_value:
+ config_string += (
+ "[NoValue]\n"
+ "option-without-value\n"
+ )
+ cf = self.fromstring(config_string)
+ self.basic_test(cf)
+ if self.strict:
+ with self.assertRaises(configparser.DuplicateOptionError):
+ cf.read_string(textwrap.dedent("""\
+ [Duplicate Options Here]
+ option {0[0]} with a value
+ option {0[1]} with another value
+ """.format(self.delimiters)))
+ with self.assertRaises(configparser.DuplicateSectionError):
+ cf.read_string(textwrap.dedent("""\
+ [And Now For Something]
+ completely different {0[0]} True
+ [And Now For Something]
+ the larch {0[1]} 1
+ """.format(self.delimiters)))
+ else:
+ cf.read_string(textwrap.dedent("""\
+ [Duplicate Options Here]
+ option {0[0]} with a value
+ option {0[1]} with another value
+ """.format(self.delimiters)))
+
+ cf.read_string(textwrap.dedent("""\
+ [And Now For Something]
+ completely different {0[0]} True
+ [And Now For Something]
+ the larch {0[1]} 1
+ """.format(self.delimiters)))
+
+ def test_basic_from_dict(self):
+ config = {
+ "Foo Bar": {
+ "foo": "bar1",
+ },
+ "Spacey Bar": {
+ "foo": "bar2",
+ },
+ "Spacey Bar From The Beginning": {
+ "foo": "bar3",
+ "baz": "qwe",
+ },
+ "Commented Bar": {
+ "foo": "bar4",
+ "baz": "qwe",
+ },
+ "Long Line": {
+ "foo": "this line is much, much longer than my editor\nlikes "
+ "it.",
+ },
+ "Section\\with$weird%characters[\t": {
+ },
+ "Internationalized Stuff": {
+ "foo[bg]": "Bulgarian",
+ "foo": "Default",
+ "foo[en]": "English",
+ "foo[de]": "Deutsch",
+ },
+ "Spaces": {
+ "key with spaces": "value",
+ "another with spaces": "splat!",
+ },
+ "Types": {
+ "int": 42,
+ "float": 0.44,
+ "boolean": False,
+ 123: "strange but acceptable",
+ },
+ }
+ if self.allow_no_value:
+ config.update({
+ "NoValue": {
+ "option-without-value": None,
+ }
+ })
+ cf = self.newconfig()
+ cf.read_dict(config)
+ self.basic_test(cf)
+ if self.strict:
+ with self.assertRaises(configparser.DuplicateSectionError):
+ cf.read_dict({
+ '1': {'key': 'value'},
+ 1: {'key2': 'value2'},
+ })
+ with self.assertRaises(configparser.DuplicateOptionError):
+ cf.read_dict({
+ "Duplicate Options Here": {
+ 'option': 'with a value',
+ 'OPTION': 'with another value',
+ },
+ })
+ else:
+ cf.read_dict({
+ 'section': {'key': 'value'},
+ 'SECTION': {'key2': 'value2'},
+ })
+ cf.read_dict({
+ "Duplicate Options Here": {
+ 'option': 'with a value',
+ 'OPTION': 'with another value',
+ },
+ })
+
def test_case_sensitivity(self):
cf = self.newconfig()
cf.add_section("A")
cf.add_section("a")
+ cf.add_section("B")
L = cf.sections()
L.sort()
eq = self.assertEqual
- eq(L, ["A", "a"])
+ eq(L, ["A", "B", "a"])
cf.set("a", "B", "value")
eq(cf.options("a"), ["b"])
eq(cf.get("a", "b"), "value",
"could not locate option, expecting case-insensitive option names")
+ with self.assertRaises(configparser.NoSectionError):
+ # section names are case-sensitive
+ cf.set("b", "A", "value")
self.assertTrue(cf.has_option("a", "b"))
+ self.assertFalse(cf.has_option("b", "b"))
cf.set("A", "A-B", "A-B value")
for opt in ("a-b", "A-b", "a-B", "A-B"):
self.assertTrue(
@@ -120,62 +456,125 @@ class TestCaseBase(unittest.TestCase):
# SF bug #432369:
cf = self.fromstring(
- "[MySection]\nOption: first line\n\tsecond line\n")
+ "[MySection]\nOption{} first line \n\tsecond line \n".format(
+ self.delimiters[0]))
eq(cf.options("MySection"), ["option"])
eq(cf.get("MySection", "Option"), "first line\nsecond line")
# SF bug #561822:
- cf = self.fromstring("[section]\nnekey=nevalue\n",
+ cf = self.fromstring("[section]\n"
+ "nekey{}nevalue\n".format(self.delimiters[0]),
defaults={"key":"value"})
self.assertTrue(cf.has_option("section", "Key"))
+ def test_case_sensitivity_mapping_access(self):
+ cf = self.newconfig()
+ cf["A"] = {}
+ cf["a"] = {"B": "value"}
+ cf["B"] = {}
+ L = [section for section in cf]
+ L.sort()
+ eq = self.assertEqual
+ elem_eq = self.assertCountEqual
+ eq(L, sorted(["A", "B", self.default_section, "a"]))
+ eq(cf["a"].keys(), {"b"})
+ eq(cf["a"]["b"], "value",
+ "could not locate option, expecting case-insensitive option names")
+ with self.assertRaises(KeyError):
+ # section names are case-sensitive
+ cf["b"]["A"] = "value"
+ self.assertTrue("b" in cf["a"])
+ cf["A"]["A-B"] = "A-B value"
+ for opt in ("a-b", "A-b", "a-B", "A-B"):
+ self.assertTrue(
+ opt in cf["A"],
+ "has_option() returned false for option which should exist")
+ eq(cf["A"].keys(), {"a-b"})
+ eq(cf["a"].keys(), {"b"})
+ del cf["a"]["B"]
+ elem_eq(cf["a"].keys(), {})
+
+ # SF bug #432369:
+ cf = self.fromstring(
+ "[MySection]\nOption{} first line \n\tsecond line \n".format(
+ self.delimiters[0]))
+ eq(cf["MySection"].keys(), {"option"})
+ eq(cf["MySection"]["Option"], "first line\nsecond line")
+
+ # SF bug #561822:
+ cf = self.fromstring("[section]\n"
+ "nekey{}nevalue\n".format(self.delimiters[0]),
+ defaults={"key":"value"})
+ self.assertTrue("Key" in cf["section"])
+
def test_default_case_sensitivity(self):
cf = self.newconfig({"foo": "Bar"})
self.assertEqual(
- cf.get("DEFAULT", "Foo"), "Bar",
+ cf.get(self.default_section, "Foo"), "Bar",
"could not locate option, expecting case-insensitive option names")
cf = self.newconfig({"Foo": "Bar"})
self.assertEqual(
- cf.get("DEFAULT", "Foo"), "Bar",
+ cf.get(self.default_section, "Foo"), "Bar",
"could not locate option, expecting case-insensitive defaults")
def test_parse_errors(self):
- self.newconfig()
- self.parse_error(configparser.ParsingError,
- "[Foo]\n extra-spaces: splat\n")
- self.parse_error(configparser.ParsingError,
- "[Foo]\n extra-spaces= splat\n")
- self.parse_error(configparser.ParsingError,
- "[Foo]\noption-without-value\n")
- self.parse_error(configparser.ParsingError,
- "[Foo]\n:value-without-option-name\n")
- self.parse_error(configparser.ParsingError,
- "[Foo]\n=value-without-option-name\n")
- self.parse_error(configparser.MissingSectionHeaderError,
- "No Section!\n")
-
- def parse_error(self, exc, src):
- sio = io.StringIO(src)
- self.assertRaises(exc, self.cf.readfp, sio)
+ cf = self.newconfig()
+ self.parse_error(cf, configparser.ParsingError,
+ "[Foo]\n"
+ "{}val-without-opt-name\n".format(self.delimiters[0]))
+ self.parse_error(cf, configparser.ParsingError,
+ "[Foo]\n"
+ "{}val-without-opt-name\n".format(self.delimiters[1]))
+ e = self.parse_error(cf, configparser.MissingSectionHeaderError,
+ "No Section!\n")
+ self.assertEqual(e.args, ('<???>', 1, "No Section!\n"))
+ if not self.allow_no_value:
+ e = self.parse_error(cf, configparser.ParsingError,
+ "[Foo]\n wrong-indent\n")
+ self.assertEqual(e.args, ('<???>',))
+ # read_file on a real file
+ tricky = support.findfile("cfgparser.3")
+ if self.delimiters[0] == '=':
+ error = configparser.ParsingError
+ expected = (tricky,)
+ else:
+ error = configparser.MissingSectionHeaderError
+ expected = (tricky, 1,
+ ' # INI with as many tricky parts as possible\n')
+ with open(tricky, encoding='utf-8') as f:
+ e = self.parse_error(cf, error, f)
+ self.assertEqual(e.args, expected)
+
+ def parse_error(self, cf, exc, src):
+ if hasattr(src, 'readline'):
+ sio = src
+ else:
+ sio = io.StringIO(src)
+ with self.assertRaises(exc) as cm:
+ cf.read_file(sio)
+ return cm.exception
def test_query_errors(self):
cf = self.newconfig()
self.assertEqual(cf.sections(), [],
"new ConfigParser should have no defined sections")
self.assertFalse(cf.has_section("Foo"),
- "new ConfigParser should have no acknowledged sections")
- self.assertRaises(configparser.NoSectionError,
- cf.options, "Foo")
- self.assertRaises(configparser.NoSectionError,
- cf.set, "foo", "bar", "value")
- self.get_error(configparser.NoSectionError, "foo", "bar")
+ "new ConfigParser should have no acknowledged "
+ "sections")
+ with self.assertRaises(configparser.NoSectionError):
+ cf.options("Foo")
+ with self.assertRaises(configparser.NoSectionError):
+ cf.set("foo", "bar", "value")
+ e = self.get_error(cf, configparser.NoSectionError, "foo", "bar")
+ self.assertEqual(e.args, ("foo",))
cf.add_section("foo")
- self.get_error(configparser.NoOptionError, "foo", "bar")
+ e = self.get_error(cf, configparser.NoOptionError, "foo", "bar")
+ self.assertEqual(e.args, ("bar", "foo"))
- def get_error(self, exc, section, option):
+ def get_error(self, cf, exc, section, option):
try:
- self.cf.get(section, option)
+ cf.get(section, option)
except exc as e:
return e
else:
@@ -185,21 +584,21 @@ class TestCaseBase(unittest.TestCase):
def test_boolean(self):
cf = self.fromstring(
"[BOOLTEST]\n"
- "T1=1\n"
- "T2=TRUE\n"
- "T3=True\n"
- "T4=oN\n"
- "T5=yes\n"
- "F1=0\n"
- "F2=FALSE\n"
- "F3=False\n"
- "F4=oFF\n"
- "F5=nO\n"
- "E1=2\n"
- "E2=foo\n"
- "E3=-1\n"
- "E4=0.1\n"
- "E5=FALSE AND MORE"
+ "T1{equals}1\n"
+ "T2{equals}TRUE\n"
+ "T3{equals}True\n"
+ "T4{equals}oN\n"
+ "T5{equals}yes\n"
+ "F1{equals}0\n"
+ "F2{equals}FALSE\n"
+ "F3{equals}False\n"
+ "F4{equals}oFF\n"
+ "F5{equals}nO\n"
+ "E1{equals}2\n"
+ "E2{equals}foo\n"
+ "E3{equals}-1\n"
+ "E4{equals}0.1\n"
+ "E5{equals}FALSE AND MORE".format(equals=self.delimiters[0])
)
for x in range(1, 5):
self.assertTrue(cf.getboolean('BOOLTEST', 't%d' % x))
@@ -210,35 +609,91 @@ class TestCaseBase(unittest.TestCase):
def test_weird_errors(self):
cf = self.newconfig()
cf.add_section("Foo")
- self.assertRaises(configparser.DuplicateSectionError,
- cf.add_section, "Foo")
+ with self.assertRaises(configparser.DuplicateSectionError) as cm:
+ cf.add_section("Foo")
+ e = cm.exception
+ self.assertEqual(str(e), "Section 'Foo' already exists")
+ self.assertEqual(e.args, ("Foo", None, None))
+
+ if self.strict:
+ with self.assertRaises(configparser.DuplicateSectionError) as cm:
+ cf.read_string(textwrap.dedent("""\
+ [Foo]
+ will this be added{equals}True
+ [Bar]
+ what about this{equals}True
+ [Foo]
+ oops{equals}this won't
+ """.format(equals=self.delimiters[0])), source='<foo-bar>')
+ e = cm.exception
+ self.assertEqual(str(e), "While reading from <foo-bar> [line 5]: "
+ "section 'Foo' already exists")
+ self.assertEqual(e.args, ("Foo", '<foo-bar>', 5))
+
+ with self.assertRaises(configparser.DuplicateOptionError) as cm:
+ cf.read_dict({'Bar': {'opt': 'val', 'OPT': 'is really `opt`'}})
+ e = cm.exception
+ self.assertEqual(str(e), "While reading from <dict>: option 'opt' "
+ "in section 'Bar' already exists")
+ self.assertEqual(e.args, ("Bar", "opt", "<dict>", None))
def test_write(self):
- cf = self.fromstring(
+ config_string = (
"[Long Line]\n"
- "foo: this line is much, much longer than my editor\n"
+ "foo{0[0]} this line is much, much longer than my editor\n"
" likes it.\n"
- "[DEFAULT]\n"
- "foo: another very\n"
- " long line"
+ "[{default_section}]\n"
+ "foo{0[1]} another very\n"
+ " long line\n"
+ "[Long Line - With Comments!]\n"
+ "test {0[1]} we {comment} can\n"
+ " also {comment} place\n"
+ " comments {comment} in\n"
+ " multiline {comment} values"
+ "\n".format(self.delimiters, comment=self.comment_prefixes[0],
+ default_section=self.default_section)
)
- output = io.StringIO()
- cf.write(output)
- self.assertEqual(
- output.getvalue(),
- "[DEFAULT]\n"
- "foo = another very\n"
- "\tlong line\n"
- "\n"
- "[Long Line]\n"
- "foo = this line is much, much longer than my editor\n"
- "\tlikes it.\n"
- "\n"
+ if self.allow_no_value:
+ config_string += (
+ "[Valueless]\n"
+ "option-without-value\n"
)
+ cf = self.fromstring(config_string)
+ for space_around_delimiters in (True, False):
+ output = io.StringIO()
+ cf.write(output, space_around_delimiters=space_around_delimiters)
+ delimiter = self.delimiters[0]
+ if space_around_delimiters:
+ delimiter = " {} ".format(delimiter)
+ expect_string = (
+ "[{default_section}]\n"
+ "foo{equals}another very\n"
+ "\tlong line\n"
+ "\n"
+ "[Long Line]\n"
+ "foo{equals}this line is much, much longer than my editor\n"
+ "\tlikes it.\n"
+ "\n"
+ "[Long Line - With Comments!]\n"
+ "test{equals}we\n"
+ "\talso\n"
+ "\tcomments\n"
+ "\tmultiline\n"
+ "\n".format(equals=delimiter,
+ default_section=self.default_section)
+ )
+ if self.allow_no_value:
+ expect_string += (
+ "[Valueless]\n"
+ "option-without-value\n"
+ "\n"
+ )
+ self.assertEqual(output.getvalue(), expect_string)
+
def test_set_string_types(self):
cf = self.fromstring("[sect]\n"
- "option1=foo\n")
+ "option1{eq}foo\n".format(eq=self.delimiters[0]))
# Check that we don't get an exception when setting values in
# an existing section using strings:
class mystr(str):
@@ -251,6 +706,9 @@ class TestCaseBase(unittest.TestCase):
cf.set("sect", "option2", "splat")
def test_read_returns_file_list(self):
+ if self.delimiters[0] != '=':
+ # skip reading the file if we're using an incompatible format
+ return
file1 = support.findfile("cfgparser.1")
# check when we pass a mix of readable and non-readable files:
cf = self.newconfig()
@@ -275,102 +733,237 @@ class TestCaseBase(unittest.TestCase):
def get_interpolation_config(self):
return self.fromstring(
"[Foo]\n"
- "bar=something %(with1)s interpolation (1 step)\n"
- "bar9=something %(with9)s lots of interpolation (9 steps)\n"
- "bar10=something %(with10)s lots of interpolation (10 steps)\n"
- "bar11=something %(with11)s lots of interpolation (11 steps)\n"
- "with11=%(with10)s\n"
- "with10=%(with9)s\n"
- "with9=%(with8)s\n"
- "with8=%(With7)s\n"
- "with7=%(WITH6)s\n"
- "with6=%(with5)s\n"
- "With5=%(with4)s\n"
- "WITH4=%(with3)s\n"
- "with3=%(with2)s\n"
- "with2=%(with1)s\n"
- "with1=with\n"
+ "bar{equals}something %(with1)s interpolation (1 step)\n"
+ "bar9{equals}something %(with9)s lots of interpolation (9 steps)\n"
+ "bar10{equals}something %(with10)s lots of interpolation (10 steps)\n"
+ "bar11{equals}something %(with11)s lots of interpolation (11 steps)\n"
+ "with11{equals}%(with10)s\n"
+ "with10{equals}%(with9)s\n"
+ "with9{equals}%(with8)s\n"
+ "with8{equals}%(With7)s\n"
+ "with7{equals}%(WITH6)s\n"
+ "with6{equals}%(with5)s\n"
+ "With5{equals}%(with4)s\n"
+ "WITH4{equals}%(with3)s\n"
+ "with3{equals}%(with2)s\n"
+ "with2{equals}%(with1)s\n"
+ "with1{equals}with\n"
"\n"
"[Mutual Recursion]\n"
- "foo=%(bar)s\n"
- "bar=%(foo)s\n"
+ "foo{equals}%(bar)s\n"
+ "bar{equals}%(foo)s\n"
"\n"
"[Interpolation Error]\n"
- "name=%(reference)s\n",
# no definition for 'reference'
- defaults={"getname": "%(__name__)s"})
+ "name{equals}%(reference)s\n".format(equals=self.delimiters[0]))
def check_items_config(self, expected):
- cf = self.fromstring(
- "[section]\n"
- "name = value\n"
- "key: |%(name)s| \n"
- "getdefault: |%(default)s|\n"
- "getname: |%(__name__)s|",
- defaults={"default": "<default>"})
- L = list(cf.items("section"))
+ cf = self.fromstring("""
+ [section]
+ name {0[0]} %(value)s
+ key{0[1]} |%(name)s|
+ getdefault{0[1]} |%(default)s|
+ """.format(self.delimiters), defaults={"default": "<default>"})
+ L = list(cf.items("section", vars={'value': 'value'}))
L.sort()
self.assertEqual(L, expected)
+ with self.assertRaises(configparser.NoSectionError):
+ cf.items("no such section")
+
+
+class StrictTestCase(BasicTestCase):
+ config_class = configparser.RawConfigParser
+ strict = True
-class ConfigParserTestCase(TestCaseBase):
+class ConfigParserTestCase(BasicTestCase):
config_class = configparser.ConfigParser
def test_interpolation(self):
cf = self.get_interpolation_config()
eq = self.assertEqual
- eq(cf.get("Foo", "getname"), "Foo")
eq(cf.get("Foo", "bar"), "something with interpolation (1 step)")
eq(cf.get("Foo", "bar9"),
"something with lots of interpolation (9 steps)")
eq(cf.get("Foo", "bar10"),
"something with lots of interpolation (10 steps)")
- self.get_error(configparser.InterpolationDepthError, "Foo", "bar11")
+ e = self.get_error(cf, configparser.InterpolationDepthError, "Foo", "bar11")
+ if self.interpolation == configparser._UNSET:
+ self.assertEqual(e.args, ("bar11", "Foo", "%(with1)s"))
+ elif isinstance(self.interpolation, configparser.LegacyInterpolation):
+ self.assertEqual(e.args, ("bar11", "Foo",
+ "something %(with11)s lots of interpolation (11 steps)"))
def test_interpolation_missing_value(self):
cf = self.get_interpolation_config()
- e = self.get_error(configparser.InterpolationError,
+ e = self.get_error(cf, configparser.InterpolationMissingOptionError,
"Interpolation Error", "name")
self.assertEqual(e.reference, "reference")
self.assertEqual(e.section, "Interpolation Error")
self.assertEqual(e.option, "name")
+ if self.interpolation == configparser._UNSET:
+ self.assertEqual(e.args, ('name', 'Interpolation Error',
+ '', 'reference'))
+ elif isinstance(self.interpolation, configparser.LegacyInterpolation):
+ self.assertEqual(e.args, ('name', 'Interpolation Error',
+ '%(reference)s', 'reference'))
def test_items(self):
self.check_items_config([('default', '<default>'),
('getdefault', '|<default>|'),
- ('getname', '|section|'),
('key', '|value|'),
- ('name', 'value')])
+ ('name', 'value'),
+ ('value', 'value')])
+
+ def test_safe_interpolation(self):
+ # See http://www.python.org/sf/511737
+ cf = self.fromstring("[section]\n"
+ "option1{eq}xxx\n"
+ "option2{eq}%(option1)s/xxx\n"
+ "ok{eq}%(option1)s/%%s\n"
+ "not_ok{eq}%(option2)s/%%s".format(
+ eq=self.delimiters[0]))
+ self.assertEqual(cf.get("section", "ok"), "xxx/%s")
+ if self.interpolation == configparser._UNSET:
+ self.assertEqual(cf.get("section", "not_ok"), "xxx/xxx/%s")
+ elif isinstance(self.interpolation, configparser.LegacyInterpolation):
+ with self.assertRaises(TypeError):
+ cf.get("section", "not_ok")
+
+ def test_set_malformatted_interpolation(self):
+ cf = self.fromstring("[sect]\n"
+ "option1{eq}foo\n".format(eq=self.delimiters[0]))
+
+ self.assertEqual(cf.get('sect', "option1"), "foo")
+
+ self.assertRaises(ValueError, cf.set, "sect", "option1", "%foo")
+ self.assertRaises(ValueError, cf.set, "sect", "option1", "foo%")
+ self.assertRaises(ValueError, cf.set, "sect", "option1", "f%oo")
+
+ self.assertEqual(cf.get('sect', "option1"), "foo")
+
+ # bug #5741: double percents are *not* malformed
+ cf.set("sect", "option2", "foo%%bar")
+ self.assertEqual(cf.get("sect", "option2"), "foo%bar")
def test_set_nonstring_types(self):
+ cf = self.fromstring("[sect]\n"
+ "option1{eq}foo\n".format(eq=self.delimiters[0]))
+ # Check that we get a TypeError when setting non-string values
+ # in an existing section:
+ self.assertRaises(TypeError, cf.set, "sect", "option1", 1)
+ self.assertRaises(TypeError, cf.set, "sect", "option1", 1.0)
+ self.assertRaises(TypeError, cf.set, "sect", "option1", object())
+ self.assertRaises(TypeError, cf.set, "sect", "option2", 1)
+ self.assertRaises(TypeError, cf.set, "sect", "option2", 1.0)
+ self.assertRaises(TypeError, cf.set, "sect", "option2", object())
+ self.assertRaises(TypeError, cf.set, "sect", 123, "invalid opt name!")
+ self.assertRaises(TypeError, cf.add_section, 123)
+
+ def test_add_section_default(self):
cf = self.newconfig()
- cf.add_section('non-string')
- cf.set('non-string', 'int', 1)
- cf.set('non-string', 'list', [0, 1, 1, 2, 3, 5, 8, 13, '%('])
- cf.set('non-string', 'dict', {'pi': 3.14159, '%(': 1,
- '%(list)': '%(list)'})
- cf.set('non-string', 'string_with_interpolation', '%(list)s')
- self.assertEqual(cf.get('non-string', 'int', raw=True), 1)
- self.assertRaises(TypeError, cf.get, 'non-string', 'int')
- self.assertEqual(cf.get('non-string', 'list', raw=True),
- [0, 1, 1, 2, 3, 5, 8, 13, '%('])
- self.assertRaises(TypeError, cf.get, 'non-string', 'list')
- self.assertEqual(cf.get('non-string', 'dict', raw=True),
- {'pi': 3.14159, '%(': 1, '%(list)': '%(list)'})
- self.assertRaises(TypeError, cf.get, 'non-string', 'dict')
- self.assertEqual(cf.get('non-string', 'string_with_interpolation',
- raw=True), '%(list)s')
- self.assertRaises(ValueError, cf.get, 'non-string',
- 'string_with_interpolation', raw=False)
-
-
-class RawConfigParserTestCase(TestCaseBase):
+ self.assertRaises(ValueError, cf.add_section, self.default_section)
+
+
+class ConfigParserTestCaseNoInterpolation(BasicTestCase):
+ config_class = configparser.ConfigParser
+ interpolation = None
+ ini = textwrap.dedent("""
+ [numbers]
+ one = 1
+ two = %(one)s * 2
+ three = ${common:one} * 3
+
+ [hexen]
+ sixteen = ${numbers:two} * 8
+ """).strip()
+
+ def assertMatchesIni(self, cf):
+ self.assertEqual(cf['numbers']['one'], '1')
+ self.assertEqual(cf['numbers']['two'], '%(one)s * 2')
+ self.assertEqual(cf['numbers']['three'], '${common:one} * 3')
+ self.assertEqual(cf['hexen']['sixteen'], '${numbers:two} * 8')
+
+ def test_no_interpolation(self):
+ cf = self.fromstring(self.ini)
+ self.assertMatchesIni(cf)
+
+ def test_empty_case(self):
+ cf = self.newconfig()
+ self.assertIsNone(cf.read_string(""))
+
+ def test_none_as_default_interpolation(self):
+ class CustomConfigParser(configparser.ConfigParser):
+ _DEFAULT_INTERPOLATION = None
+
+ cf = CustomConfigParser()
+ cf.read_string(self.ini)
+ self.assertMatchesIni(cf)
+
+
+class ConfigParserTestCaseLegacyInterpolation(ConfigParserTestCase):
+ config_class = configparser.ConfigParser
+ interpolation = configparser.LegacyInterpolation()
+
+ def test_set_malformatted_interpolation(self):
+ cf = self.fromstring("[sect]\n"
+ "option1{eq}foo\n".format(eq=self.delimiters[0]))
+
+ self.assertEqual(cf.get('sect', "option1"), "foo")
+
+ cf.set("sect", "option1", "%foo")
+ self.assertEqual(cf.get('sect', "option1"), "%foo")
+ cf.set("sect", "option1", "foo%")
+ self.assertEqual(cf.get('sect', "option1"), "foo%")
+ cf.set("sect", "option1", "f%oo")
+ self.assertEqual(cf.get('sect', "option1"), "f%oo")
+
+ # bug #5741: double percents are *not* malformed
+ cf.set("sect", "option2", "foo%%bar")
+ self.assertEqual(cf.get("sect", "option2"), "foo%%bar")
+
+class ConfigParserTestCaseNonStandardDelimiters(ConfigParserTestCase):
+ delimiters = (':=', '$')
+ comment_prefixes = ('//', '"')
+ inline_comment_prefixes = ('//', '"')
+
+class ConfigParserTestCaseNonStandardDefaultSection(ConfigParserTestCase):
+ default_section = 'general'
+
+class MultilineValuesTestCase(BasicTestCase):
+ config_class = configparser.ConfigParser
+ wonderful_spam = ("I'm having spam spam spam spam "
+ "spam spam spam beaked beans spam "
+ "spam spam and spam!").replace(' ', '\t\n')
+
+ def setUp(self):
+ cf = self.newconfig()
+ for i in range(100):
+ s = 'section{}'.format(i)
+ cf.add_section(s)
+ for j in range(10):
+ cf.set(s, 'lovely_spam{}'.format(j), self.wonderful_spam)
+ with open(support.TESTFN, 'w') as f:
+ cf.write(f)
+
+ def tearDown(self):
+ os.unlink(support.TESTFN)
+
+ def test_dominating_multiline_values(self):
+ # We're reading from file because this is where the code changed
+ # during performance updates in Python 3.2
+ cf_from_file = self.newconfig()
+ with open(support.TESTFN) as f:
+ cf_from_file.read_file(f)
+ self.assertEqual(cf_from_file.get('section8', 'lovely_spam4'),
+ self.wonderful_spam.replace('\t\n', '\n'))
+
+class RawConfigParserTestCase(BasicTestCase):
config_class = configparser.RawConfigParser
def test_interpolation(self):
cf = self.get_interpolation_config()
eq = self.assertEqual
- eq(cf.get("Foo", "getname"), "%(__name__)s")
eq(cf.get("Foo", "bar"),
"something %(with1)s interpolation (1 step)")
eq(cf.get("Foo", "bar9"),
@@ -383,9 +976,9 @@ class RawConfigParserTestCase(TestCaseBase):
def test_items(self):
self.check_items_config([('default', '<default>'),
('getdefault', '|%(default)s|'),
- ('getname', '|%(__name__)s|'),
('key', '|%(name)s|'),
- ('name', 'value')])
+ ('name', '%(value)s'),
+ ('value', 'value')])
def test_set_nonstring_types(self):
cf = self.newconfig()
@@ -397,72 +990,302 @@ class RawConfigParserTestCase(TestCaseBase):
self.assertEqual(cf.get('non-string', 'list'),
[0, 1, 1, 2, 3, 5, 8, 13])
self.assertEqual(cf.get('non-string', 'dict'), {'pi': 3.14159})
+ cf.add_section(123)
+ cf.set(123, 'this is sick', True)
+ self.assertEqual(cf.get(123, 'this is sick'), True)
+ if cf._dict is configparser._default_dict:
+ # would not work for SortedDict; only checking for the most common
+ # default dictionary (OrderedDict)
+ cf.optionxform = lambda x: x
+ cf.set('non-string', 1, 1)
+ self.assertEqual(cf.get('non-string', 1), 1)
+class RawConfigParserTestCaseNonStandardDelimiters(RawConfigParserTestCase):
+ delimiters = (':=', '$')
+ comment_prefixes = ('//', '"')
+ inline_comment_prefixes = ('//', '"')
-class SafeConfigParserTestCase(ConfigParserTestCase):
- config_class = configparser.SafeConfigParser
+class RawConfigParserTestSambaConf(CfgParserTestCaseClass):
+ config_class = configparser.RawConfigParser
+ comment_prefixes = ('#', ';', '----')
+ inline_comment_prefixes = ('//',)
+ empty_lines_in_values = False
- def test_safe_interpolation(self):
- # See http://www.python.org/sf/511737
- cf = self.fromstring("[section]\n"
- "option1=xxx\n"
- "option2=%(option1)s/xxx\n"
- "ok=%(option1)s/%%s\n"
- "not_ok=%(option2)s/%%s")
- self.assertEqual(cf.get("section", "ok"), "xxx/%s")
- self.assertEqual(cf.get("section", "not_ok"), "xxx/xxx/%s")
+ def test_reading(self):
+ smbconf = support.findfile("cfgparser.2")
+ # check when we pass a mix of readable and non-readable files:
+ cf = self.newconfig()
+ parsed_files = cf.read([smbconf, "nonexistent-file"], encoding='utf-8')
+ self.assertEqual(parsed_files, [smbconf])
+ sections = ['global', 'homes', 'printers',
+ 'print$', 'pdf-generator', 'tmp', 'Agustin']
+ self.assertEqual(cf.sections(), sections)
+ self.assertEqual(cf.get("global", "workgroup"), "MDKGROUP")
+ self.assertEqual(cf.getint("global", "max log size"), 50)
+ self.assertEqual(cf.get("global", "hosts allow"), "127.")
+ self.assertEqual(cf.get("tmp", "echo command"), "cat %s; rm %s")
- def test_set_malformatted_interpolation(self):
- cf = self.fromstring("[sect]\n"
- "option1=foo\n")
+class ConfigParserTestCaseExtendedInterpolation(BasicTestCase):
+ config_class = configparser.ConfigParser
+ interpolation = configparser.ExtendedInterpolation()
+ default_section = 'common'
+ strict = True
- self.assertEqual(cf.get('sect', "option1"), "foo")
+ def fromstring(self, string, defaults=None, optionxform=None):
+ cf = self.newconfig(defaults)
+ if optionxform:
+ cf.optionxform = optionxform
+ cf.read_string(string)
+ return cf
- self.assertRaises(ValueError, cf.set, "sect", "option1", "%foo")
- self.assertRaises(ValueError, cf.set, "sect", "option1", "foo%")
- self.assertRaises(ValueError, cf.set, "sect", "option1", "f%oo")
+ def test_extended_interpolation(self):
+ cf = self.fromstring(textwrap.dedent("""
+ [common]
+ favourite Beatle = Paul
+ favourite color = green
- self.assertEqual(cf.get('sect', "option1"), "foo")
+ [tom]
+ favourite band = ${favourite color} day
+ favourite pope = John ${favourite Beatle} II
+ sequel = ${favourite pope}I
- # bug #5741: double percents are *not* malformed
- cf.set("sect", "option2", "foo%%bar")
- self.assertEqual(cf.get("sect", "option2"), "foo%bar")
+ [ambv]
+ favourite Beatle = George
+ son of Edward VII = ${favourite Beatle} V
+ son of George V = ${son of Edward VII}I
- def test_set_nonstring_types(self):
- cf = self.fromstring("[sect]\n"
- "option1=foo\n")
- # Check that we get a TypeError when setting non-string values
- # in an existing section:
- self.assertRaises(TypeError, cf.set, "sect", "option1", 1)
- self.assertRaises(TypeError, cf.set, "sect", "option1", 1.0)
- self.assertRaises(TypeError, cf.set, "sect", "option1", object())
- self.assertRaises(TypeError, cf.set, "sect", "option2", 1)
- self.assertRaises(TypeError, cf.set, "sect", "option2", 1.0)
- self.assertRaises(TypeError, cf.set, "sect", "option2", object())
+ [stanley]
+ favourite Beatle = ${ambv:favourite Beatle}
+ favourite pope = ${tom:favourite pope}
+ favourite color = black
+ favourite state of mind = paranoid
+ favourite movie = soylent ${common:favourite color}
+ favourite song = ${favourite color} sabbath - ${favourite state of mind}
+ """).strip())
+
+ eq = self.assertEqual
+ eq(cf['common']['favourite Beatle'], 'Paul')
+ eq(cf['common']['favourite color'], 'green')
+ eq(cf['tom']['favourite Beatle'], 'Paul')
+ eq(cf['tom']['favourite color'], 'green')
+ eq(cf['tom']['favourite band'], 'green day')
+ eq(cf['tom']['favourite pope'], 'John Paul II')
+ eq(cf['tom']['sequel'], 'John Paul III')
+ eq(cf['ambv']['favourite Beatle'], 'George')
+ eq(cf['ambv']['favourite color'], 'green')
+ eq(cf['ambv']['son of Edward VII'], 'George V')
+ eq(cf['ambv']['son of George V'], 'George VI')
+ eq(cf['stanley']['favourite Beatle'], 'George')
+ eq(cf['stanley']['favourite color'], 'black')
+ eq(cf['stanley']['favourite state of mind'], 'paranoid')
+ eq(cf['stanley']['favourite movie'], 'soylent green')
+ eq(cf['stanley']['favourite pope'], 'John Paul II')
+ eq(cf['stanley']['favourite song'],
+ 'black sabbath - paranoid')
+
+ def test_endless_loop(self):
+ cf = self.fromstring(textwrap.dedent("""
+ [one for you]
+ ping = ${one for me:pong}
+
+ [one for me]
+ pong = ${one for you:ping}
+
+ [selfish]
+ me = ${me}
+ """).strip())
+
+ with self.assertRaises(configparser.InterpolationDepthError):
+ cf['one for you']['ping']
+ with self.assertRaises(configparser.InterpolationDepthError):
+ cf['selfish']['me']
+
+ def test_strange_options(self):
+ cf = self.fromstring("""
+ [dollars]
+ $var = $$value
+ $var2 = ${$var}
+ ${sick} = cannot interpolate me
+
+ [interpolated]
+ $other = ${dollars:$var}
+ $trying = ${dollars:${sick}}
+ """)
- def test_add_section_default_1(self):
+ self.assertEqual(cf['dollars']['$var'], '$value')
+ self.assertEqual(cf['interpolated']['$other'], '$value')
+ self.assertEqual(cf['dollars']['${sick}'], 'cannot interpolate me')
+ exception_class = configparser.InterpolationMissingOptionError
+ with self.assertRaises(exception_class) as cm:
+ cf['interpolated']['$trying']
+ self.assertEqual(cm.exception.reference, 'dollars:${sick')
+ self.assertEqual(cm.exception.args[2], '}') #rawval
+
+ def test_case_sensitivity_basic(self):
+ ini = textwrap.dedent("""
+ [common]
+ optionlower = value
+ OptionUpper = Value
+
+ [Common]
+ optionlower = a better ${common:optionlower}
+ OptionUpper = A Better ${common:OptionUpper}
+
+ [random]
+ foolower = ${common:optionlower} redefined
+ FooUpper = ${Common:OptionUpper} Redefined
+ """).strip()
+
+ cf = self.fromstring(ini)
+ eq = self.assertEqual
+ eq(cf['common']['optionlower'], 'value')
+ eq(cf['common']['OptionUpper'], 'Value')
+ eq(cf['Common']['optionlower'], 'a better value')
+ eq(cf['Common']['OptionUpper'], 'A Better Value')
+ eq(cf['random']['foolower'], 'value redefined')
+ eq(cf['random']['FooUpper'], 'A Better Value Redefined')
+
+ def test_case_sensitivity_conflicts(self):
+ ini = textwrap.dedent("""
+ [common]
+ option = value
+ Option = Value
+
+ [Common]
+ option = a better ${common:option}
+ Option = A Better ${common:Option}
+
+ [random]
+ foo = ${common:option} redefined
+ Foo = ${Common:Option} Redefined
+ """).strip()
+ with self.assertRaises(configparser.DuplicateOptionError):
+ cf = self.fromstring(ini)
+
+ # raw options
+ cf = self.fromstring(ini, optionxform=lambda opt: opt)
+ eq = self.assertEqual
+ eq(cf['common']['option'], 'value')
+ eq(cf['common']['Option'], 'Value')
+ eq(cf['Common']['option'], 'a better value')
+ eq(cf['Common']['Option'], 'A Better Value')
+ eq(cf['random']['foo'], 'value redefined')
+ eq(cf['random']['Foo'], 'A Better Value Redefined')
+
+ def test_other_errors(self):
+ cf = self.fromstring("""
+ [interpolation fail]
+ case1 = ${where's the brace
+ case2 = ${does_not_exist}
+ case3 = ${wrong_section:wrong_value}
+ case4 = ${i:like:colon:characters}
+ case5 = $100 for Fail No 5!
+ """)
+
+ with self.assertRaises(configparser.InterpolationSyntaxError):
+ cf['interpolation fail']['case1']
+ with self.assertRaises(configparser.InterpolationMissingOptionError):
+ cf['interpolation fail']['case2']
+ with self.assertRaises(configparser.InterpolationMissingOptionError):
+ cf['interpolation fail']['case3']
+ with self.assertRaises(configparser.InterpolationSyntaxError):
+ cf['interpolation fail']['case4']
+ with self.assertRaises(configparser.InterpolationSyntaxError):
+ cf['interpolation fail']['case5']
+ with self.assertRaises(ValueError):
+ cf['interpolation fail']['case6'] = "BLACK $ABBATH"
+
+
+class ConfigParserTestCaseNoValue(ConfigParserTestCase):
+ allow_no_value = True
+
+class ConfigParserTestCaseTrickyFile(CfgParserTestCaseClass):
+ config_class = configparser.ConfigParser
+ delimiters = {'='}
+ comment_prefixes = {'#'}
+ allow_no_value = True
+
+ def test_cfgparser_dot_3(self):
+ tricky = support.findfile("cfgparser.3")
cf = self.newconfig()
- self.assertRaises(ValueError, cf.add_section, "default")
+ self.assertEqual(len(cf.read(tricky, encoding='utf-8')), 1)
+ self.assertEqual(cf.sections(), ['strange',
+ 'corruption',
+ 'yeah, sections can be '
+ 'indented as well',
+ 'another one!',
+ 'no values here',
+ 'tricky interpolation',
+ 'more interpolation'])
+ self.assertEqual(cf.getint(self.default_section, 'go',
+ vars={'interpolate': '-1'}), -1)
+ with self.assertRaises(ValueError):
+ # no interpolation will happen
+ cf.getint(self.default_section, 'go', raw=True,
+ vars={'interpolate': '-1'})
+ self.assertEqual(len(cf.get('strange', 'other').split('\n')), 4)
+ self.assertEqual(len(cf.get('corruption', 'value').split('\n')), 10)
+ longname = 'yeah, sections can be indented as well'
+ self.assertFalse(cf.getboolean(longname, 'are they subsections'))
+ self.assertEqual(cf.get(longname, 'lets use some Unicode'), '片仮å')
+ self.assertEqual(len(cf.items('another one!')), 5) # 4 in section and
+ # `go` from DEFAULT
+ with self.assertRaises(configparser.InterpolationMissingOptionError):
+ cf.items('no values here')
+ self.assertEqual(cf.get('tricky interpolation', 'lets'), 'do this')
+ self.assertEqual(cf.get('tricky interpolation', 'lets'),
+ cf.get('tricky interpolation', 'go'))
+ self.assertEqual(cf.get('more interpolation', 'lets'), 'go shopping')
- def test_add_section_default_2(self):
+ def test_unicode_failure(self):
+ tricky = support.findfile("cfgparser.3")
cf = self.newconfig()
- self.assertRaises(ValueError, cf.add_section, "DEFAULT")
+ with self.assertRaises(UnicodeDecodeError):
+ cf.read(tricky, encoding='ascii')
+
+
+class Issue7005TestCase(unittest.TestCase):
+ """Test output when None is set() as a value and allow_no_value == False.
+
+ http://bugs.python.org/issue7005
+
+ """
+
+ expected_output = "[section]\noption = None\n\n"
+
+ def prepare(self, config_class):
+ # This is the default, but that's the point.
+ cp = config_class(allow_no_value=False)
+ cp.add_section("section")
+ cp.set("section", "option", None)
+ sio = io.StringIO()
+ cp.write(sio)
+ return sio.getvalue()
+
+ def test_none_as_value_stringified(self):
+ cp = configparser.ConfigParser(allow_no_value=False)
+ cp.add_section("section")
+ with self.assertRaises(TypeError):
+ cp.set("section", "option", None)
+
+ def test_none_as_value_stringified_raw(self):
+ output = self.prepare(configparser.RawConfigParser)
+ self.assertEqual(output, self.expected_output)
+
class SortedTestCase(RawConfigParserTestCase):
- def newconfig(self, defaults=None):
- self.cf = self.config_class(defaults=defaults, dict_type=SortedDict)
- return self.cf
+ dict_type = SortedDict
def test_sorted(self):
- self.fromstring("[b]\n"
- "o4=1\n"
- "o3=2\n"
- "o2=3\n"
- "o1=4\n"
- "[a]\n"
- "k=v\n")
+ cf = self.fromstring("[b]\n"
+ "o4=1\n"
+ "o3=2\n"
+ "o2=3\n"
+ "o1=4\n"
+ "[a]\n"
+ "k=v\n")
output = io.StringIO()
- self.cf.write(output)
+ cf.write(output)
self.assertEqual(output.getvalue(),
"[a]\n"
"k = v\n\n"
@@ -472,13 +1295,204 @@ class SortedTestCase(RawConfigParserTestCase):
"o3 = 2\n"
"o4 = 1\n\n")
+
+class CompatibleTestCase(CfgParserTestCaseClass):
+ config_class = configparser.RawConfigParser
+ comment_prefixes = '#;'
+ inline_comment_prefixes = ';'
+
+ def test_comment_handling(self):
+ config_string = textwrap.dedent("""\
+ [Commented Bar]
+ baz=qwe ; a comment
+ foo: bar # not a comment!
+ # but this is a comment
+ ; another comment
+ quirk: this;is not a comment
+ ; a space must precede an inline comment
+ """)
+ cf = self.fromstring(config_string)
+ self.assertEqual(cf.get('Commented Bar', 'foo'),
+ 'bar # not a comment!')
+ self.assertEqual(cf.get('Commented Bar', 'baz'), 'qwe')
+ self.assertEqual(cf.get('Commented Bar', 'quirk'),
+ 'this;is not a comment')
+
+class CopyTestCase(BasicTestCase):
+ config_class = configparser.ConfigParser
+
+ def fromstring(self, string, defaults=None):
+ cf = self.newconfig(defaults)
+ cf.read_string(string)
+ cf_copy = self.newconfig()
+ cf_copy.read_dict(cf)
+ # we have to clean up option duplicates that appeared because of
+ # the magic DEFAULTSECT behaviour.
+ for section in cf_copy.values():
+ if section.name == self.default_section:
+ continue
+ for default, value in cf[self.default_section].items():
+ if section[default] == value:
+ del section[default]
+ return cf_copy
+
+
+class FakeFile:
+ def __init__(self):
+ file_path = support.findfile("cfgparser.1")
+ with open(file_path) as f:
+ self.lines = f.readlines()
+ self.lines.reverse()
+
+ def readline(self):
+ if len(self.lines):
+ return self.lines.pop()
+ return ''
+
+
+def readline_generator(f):
+ """As advised in Doc/library/configparser.rst."""
+ line = f.readline()
+ while line:
+ yield line
+ line = f.readline()
+
+
+class ReadFileTestCase(unittest.TestCase):
+ def test_file(self):
+ file_path = support.findfile("cfgparser.1")
+ parser = configparser.ConfigParser()
+ with open(file_path) as f:
+ parser.read_file(f)
+ self.assertIn("Foo Bar", parser)
+ self.assertIn("foo", parser["Foo Bar"])
+ self.assertEqual(parser["Foo Bar"]["foo"], "newbar")
+
+ def test_iterable(self):
+ lines = textwrap.dedent("""
+ [Foo Bar]
+ foo=newbar""").strip().split('\n')
+ parser = configparser.ConfigParser()
+ parser.read_file(lines)
+ self.assertIn("Foo Bar", parser)
+ self.assertIn("foo", parser["Foo Bar"])
+ self.assertEqual(parser["Foo Bar"]["foo"], "newbar")
+
+ def test_readline_generator(self):
+ """Issue #11670."""
+ parser = configparser.ConfigParser()
+ with self.assertRaises(TypeError):
+ parser.read_file(FakeFile())
+ parser.read_file(readline_generator(FakeFile()))
+ self.assertIn("Foo Bar", parser)
+ self.assertIn("foo", parser["Foo Bar"])
+ self.assertEqual(parser["Foo Bar"]["foo"], "newbar")
+
+
+class CoverageOneHundredTestCase(unittest.TestCase):
+ """Covers edge cases in the codebase."""
+
+ def test_duplicate_option_error(self):
+ error = configparser.DuplicateOptionError('section', 'option')
+ self.assertEqual(error.section, 'section')
+ self.assertEqual(error.option, 'option')
+ self.assertEqual(error.source, None)
+ self.assertEqual(error.lineno, None)
+ self.assertEqual(error.args, ('section', 'option', None, None))
+ self.assertEqual(str(error), "Option 'option' in section 'section' "
+ "already exists")
+
+ def test_interpolation_depth_error(self):
+ error = configparser.InterpolationDepthError('option', 'section',
+ 'rawval')
+ self.assertEqual(error.args, ('option', 'section', 'rawval'))
+ self.assertEqual(error.option, 'option')
+ self.assertEqual(error.section, 'section')
+
+ def test_parsing_error(self):
+ with self.assertRaises(ValueError) as cm:
+ configparser.ParsingError()
+ self.assertEqual(str(cm.exception), "Required argument `source' not "
+ "given.")
+ with self.assertRaises(ValueError) as cm:
+ configparser.ParsingError(source='source', filename='filename')
+ self.assertEqual(str(cm.exception), "Cannot specify both `filename' "
+ "and `source'. Use `source'.")
+ error = configparser.ParsingError(filename='source')
+ self.assertEqual(error.source, 'source')
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always", DeprecationWarning)
+ self.assertEqual(error.filename, 'source')
+ error.filename = 'filename'
+ self.assertEqual(error.source, 'filename')
+ for warning in w:
+ self.assertTrue(warning.category is DeprecationWarning)
+
+ def test_interpolation_validation(self):
+ parser = configparser.ConfigParser()
+ parser.read_string("""
+ [section]
+ invalid_percent = %
+ invalid_reference = %(()
+ invalid_variable = %(does_not_exist)s
+ """)
+ with self.assertRaises(configparser.InterpolationSyntaxError) as cm:
+ parser['section']['invalid_percent']
+ self.assertEqual(str(cm.exception), "'%' must be followed by '%' or "
+ "'(', found: '%'")
+ with self.assertRaises(configparser.InterpolationSyntaxError) as cm:
+ parser['section']['invalid_reference']
+ self.assertEqual(str(cm.exception), "bad interpolation variable "
+ "reference '%(()'")
+
+ def test_readfp_deprecation(self):
+ sio = io.StringIO("""
+ [section]
+ option = value
+ """)
+ parser = configparser.ConfigParser()
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always", DeprecationWarning)
+ parser.readfp(sio, filename='StringIO')
+ for warning in w:
+ self.assertTrue(warning.category is DeprecationWarning)
+ self.assertEqual(len(parser), 2)
+ self.assertEqual(parser['section']['option'], 'value')
+
+ def test_safeconfigparser_deprecation(self):
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always", DeprecationWarning)
+ parser = configparser.SafeConfigParser()
+ for warning in w:
+ self.assertTrue(warning.category is DeprecationWarning)
+
+ def test_sectionproxy_repr(self):
+ parser = configparser.ConfigParser()
+ parser.read_string("""
+ [section]
+ key = value
+ """)
+ self.assertEqual(repr(parser['section']), '<Section: section>')
+
def test_main():
support.run_unittest(
ConfigParserTestCase,
+ ConfigParserTestCaseNonStandardDelimiters,
+ ConfigParserTestCaseNoValue,
+ ConfigParserTestCaseExtendedInterpolation,
+ ConfigParserTestCaseLegacyInterpolation,
+ ConfigParserTestCaseNoInterpolation,
+ ConfigParserTestCaseTrickyFile,
+ MultilineValuesTestCase,
RawConfigParserTestCase,
- SafeConfigParserTestCase,
- SortedTestCase
- )
-
-if __name__ == "__main__":
- test_main()
+ RawConfigParserTestCaseNonStandardDelimiters,
+ RawConfigParserTestSambaConf,
+ SortedTestCase,
+ Issue7005TestCase,
+ StrictTestCase,
+ CompatibleTestCase,
+ CopyTestCase,
+ ConfigParserTestCaseNonStandardDefaultSection,
+ ReadFileTestCase,
+ CoverageOneHundredTestCase,
+ )
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py
index 16c6204125..d745199464 100644
--- a/Lib/test/test_cgi.py
+++ b/Lib/test/test_cgi.py
@@ -1,11 +1,10 @@
-from test.support import run_unittest
+from test.support import run_unittest, check_warnings
import cgi
import os
import sys
import tempfile
import unittest
-from io import StringIO
-from warnings import catch_warnings, filterwarnings
+from io import StringIO, BytesIO
class HackedSysModule:
# The regression test will have real values in sys.argv, which
@@ -15,11 +14,6 @@ class HackedSysModule:
cgi.sys = HackedSysModule()
-try:
- from io import StringIO
-except ImportError:
- from io import StringIO
-
class ComparableException:
def __init__(self, err):
self.err = err
@@ -43,7 +37,7 @@ def do_test(buf, method):
env['REQUEST_METHOD'] = 'GET'
env['QUERY_STRING'] = buf
elif method == "POST":
- fp = StringIO(buf)
+ fp = BytesIO(buf.encode('latin-1')) # FieldStorage expects bytes
env['REQUEST_METHOD'] = 'POST'
env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'
env['CONTENT_LENGTH'] = str(len(buf))
@@ -111,13 +105,14 @@ def first_second_elts(list):
return [(p[0], p[1][0]) for p in list]
def gen_result(data, environ):
- fake_stdin = StringIO(data)
+ encoding = 'latin-1'
+ fake_stdin = BytesIO(data.encode(encoding))
fake_stdin.seek(0)
- form = cgi.FieldStorage(fp=fake_stdin, environ=environ)
+ form = cgi.FieldStorage(fp=fake_stdin, environ=environ, encoding=encoding)
result = {}
for k, v in dict(form).items():
- result[k] = type(v) is list and form.getlist(k) or v.value
+ result[k] = isinstance(v, list) and form.getlist(k) or v.value
return result
@@ -127,23 +122,23 @@ class CgiTests(unittest.TestCase):
for orig, expect in parse_strict_test_cases:
# Test basic parsing
d = do_test(orig, "GET")
- self.assertEqual(d, expect, "Error parsing %s" % repr(orig))
+ self.assertEqual(d, expect, "Error parsing %s method GET" % repr(orig))
d = do_test(orig, "POST")
- self.assertEqual(d, expect, "Error parsing %s" % repr(orig))
+ self.assertEqual(d, expect, "Error parsing %s method POST" % repr(orig))
env = {'QUERY_STRING': orig}
fs = cgi.FieldStorage(environ=env)
- if type(expect) == type({}):
+ if isinstance(expect, dict):
# test dict interface
self.assertEqual(len(expect), len(fs))
- self.assertEqual(norm(expect.keys()), norm(fs.keys()))
+ self.assertCountEqual(expect.keys(), fs.keys())
##self.assertEqual(norm(expect.values()), norm(fs.values()))
##self.assertEqual(norm(expect.items()), norm(fs.items()))
self.assertEqual(fs.getvalue("nonexistent field", "default"), "default")
# test individual fields
for key in expect.keys():
expect_val = expect[key]
- self.assertTrue(key in fs)
+ self.assertIn(key, fs)
if len(expect_val) > 1:
self.assertEqual(fs.getvalue(key), expect_val)
else:
@@ -160,6 +155,7 @@ class CgiTests(unittest.TestCase):
cgi.logfp = None
cgi.logfile = "/dev/null"
cgi.initlog("%s", "Testing log 3")
+ self.addCleanup(cgi.logfp.close)
cgi.log("Testing log 4")
def test_fieldstorage_readline(self):
@@ -186,50 +182,52 @@ class CgiTests(unittest.TestCase):
setattr(self, name, a)
return a
- f = TestReadlineFile(tempfile.TemporaryFile("w+"))
- f.write('x' * 256 * 1024)
+ f = TestReadlineFile(tempfile.TemporaryFile("wb+"))
+ self.addCleanup(f.close)
+ f.write(b'x' * 256 * 1024)
f.seek(0)
env = {'REQUEST_METHOD':'PUT'}
fs = cgi.FieldStorage(fp=f, environ=env)
+ self.addCleanup(fs.file.close)
# if we're not chunking properly, readline is only called twice
# (by read_binary); if we are chunking properly, it will be called 5 times
# as long as the chunksize is 1 << 16.
self.assertTrue(f.numcalls > 2)
+ f.close()
def test_fieldstorage_multipart(self):
#Test basic FieldStorage multipart parsing
- env = {'REQUEST_METHOD':'POST', 'CONTENT_TYPE':'multipart/form-data; boundary=---------------------------721837373350705526688164684', 'CONTENT_LENGTH':'558'}
- postdata = """-----------------------------721837373350705526688164684
-Content-Disposition: form-data; name="id"
-
-1234
------------------------------721837373350705526688164684
-Content-Disposition: form-data; name="title"
-
-
------------------------------721837373350705526688164684
-Content-Disposition: form-data; name="file"; filename="test.txt"
-Content-Type: text/plain
-
-Testing 123.
-
------------------------------721837373350705526688164684
-Content-Disposition: form-data; name="submit"
-
- Add\x20
------------------------------721837373350705526688164684--
-"""
- fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env)
+ env = {
+ 'REQUEST_METHOD': 'POST',
+ 'CONTENT_TYPE': 'multipart/form-data; boundary={}'.format(BOUNDARY),
+ 'CONTENT_LENGTH': '558'}
+ fp = BytesIO(POSTDATA.encode('latin-1'))
+ fs = cgi.FieldStorage(fp, environ=env, encoding="latin-1")
self.assertEqual(len(fs.list), 4)
expect = [{'name':'id', 'filename':None, 'value':'1234'},
{'name':'title', 'filename':None, 'value':''},
- {'name':'file', 'filename':'test.txt', 'value':'Testing 123.'},
+ {'name':'file', 'filename':'test.txt', 'value':b'Testing 123.\n'},
{'name':'submit', 'filename':None, 'value':' Add '}]
for x in range(len(fs.list)):
for k, exp in expect[x].items():
got = getattr(fs.list[x], k)
self.assertEqual(got, exp)
+ def test_fieldstorage_multipart_non_ascii(self):
+ #Test basic FieldStorage multipart parsing
+ env = {'REQUEST_METHOD':'POST',
+ 'CONTENT_TYPE': 'multipart/form-data; boundary={}'.format(BOUNDARY),
+ 'CONTENT_LENGTH':'558'}
+ for encoding in ['iso-8859-1','utf-8']:
+ fp = BytesIO(POSTDATA_NON_ASCII.encode(encoding))
+ fs = cgi.FieldStorage(fp, environ=env,encoding=encoding)
+ self.assertEqual(len(fs.list), 1)
+ expect = [{'name':'id', 'filename':None, 'value':'\xe7\xf1\x80'}]
+ for x in range(len(fs.list)):
+ for k, exp in expect[x].items():
+ got = getattr(fs.list[x], k)
+ self.assertEqual(got, exp)
+
_qs_result = {
'key1': 'value1',
'key2': ['value2x', 'value2y'],
@@ -248,8 +246,7 @@ Content-Disposition: form-data; name="submit"
self.assertEqual(self._qs_result, v)
def testQSAndFormData(self):
- data = """
----123
+ data = """---123
Content-Disposition: form-data; name="key2"
value2y
@@ -273,8 +270,7 @@ value4
self.assertEqual(self._qs_result, v)
def testQSAndFormDataFile(self):
- data = """
----123
+ data = """---123
Content-Disposition: form-data; name="key2"
value2y
@@ -302,26 +298,22 @@ this is the content of the fake file
}
result = self._qs_result.copy()
result.update({
- 'upload': 'this is the content of the fake file'
+ 'upload': b'this is the content of the fake file\n'
})
v = gen_result(data, environ)
self.assertEqual(result, v)
def test_deprecated_parse_qs(self):
- # this func is moved to urlparse, this is just a sanity check
- with catch_warnings():
- filterwarnings('ignore',
- 'cgi.parse_qs is deprecated, use urllib.parse.parse_qs instead',
- DeprecationWarning)
+ # this func is moved to urllib.parse, this is just a sanity check
+ with check_warnings(('cgi.parse_qs is deprecated, use urllib.parse.'
+ 'parse_qs instead', DeprecationWarning)):
self.assertEqual({'a': ['A1'], 'B': ['B3'], 'b': ['B2']},
cgi.parse_qs('a=A1&b=B2&B=B3'))
def test_deprecated_parse_qsl(self):
- # this func is moved to urlparse, this is just a sanity check
- with catch_warnings():
- filterwarnings('ignore',
- 'cgi.parse_qsl is deprecated, use urllib.parse.parse_qsl instead',
- DeprecationWarning)
+ # this func is moved to urllib.parse, this is just a sanity check
+ with check_warnings(('cgi.parse_qsl is deprecated, use urllib.parse.'
+ 'parse_qsl instead', DeprecationWarning)):
self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')],
cgi.parse_qsl('a=A1&b=B2&B=B3'))
@@ -351,6 +343,36 @@ this is the content of the fake file
cgi.parse_header('attachment; filename="strange;name";size=123;'),
("attachment", {"filename": "strange;name", "size": "123"}))
+BOUNDARY = "---------------------------721837373350705526688164684"
+
+POSTDATA = """-----------------------------721837373350705526688164684
+Content-Disposition: form-data; name="id"
+
+1234
+-----------------------------721837373350705526688164684
+Content-Disposition: form-data; name="title"
+
+
+-----------------------------721837373350705526688164684
+Content-Disposition: form-data; name="file"; filename="test.txt"
+Content-Type: text/plain
+
+Testing 123.
+
+-----------------------------721837373350705526688164684
+Content-Disposition: form-data; name="submit"
+
+ Add\x20
+-----------------------------721837373350705526688164684--
+"""
+
+POSTDATA_NON_ASCII = """-----------------------------721837373350705526688164684
+Content-Disposition: form-data; name="id"
+
+\xe7\xf1\x80
+-----------------------------721837373350705526688164684
+"""
+
def test_main():
run_unittest(CgiTests)
diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py
index 2ab5a78a22..4e93be47ad 100755..100644
--- a/Lib/test/test_cmath.py
+++ b/Lib/test/test_cmath.py
@@ -1,9 +1,9 @@
-from test.support import run_unittest
+from test.support import run_unittest, requires_IEEE_754
from test.test_math import parse_testfile, test_file
import unittest
-import os, sys
import cmath, math
from cmath import phase, polar, rect, pi
+import sysconfig
INF = float('inf')
NAN = float('nan')
@@ -46,37 +46,6 @@ complex_nans = [complex(x, y) for x, y in [
(INF, NAN)
]]
-def almostEqualF(a, b, rel_err=2e-15, abs_err = 5e-323):
- """Determine whether floating-point values a and b are equal to within
- a (small) rounding error. The default values for rel_err and
- abs_err are chosen to be suitable for platforms where a float is
- represented by an IEEE 754 double. They allow an error of between
- 9 and 19 ulps."""
-
- # special values testing
- if math.isnan(a):
- return math.isnan(b)
- if math.isinf(a):
- return a == b
-
- # if both a and b are zero, check whether they have the same sign
- # (in theory there are examples where it would be legitimate for a
- # and b to have opposite signs; in practice these hardly ever
- # occur).
- if not a and not b:
- return math.copysign(1., a) == math.copysign(1., b)
-
- # if a-b overflows, or b is infinite, return False. Again, in
- # theory there are examples where a is within a few ulps of the
- # max representable float, and then b could legitimately be
- # infinite. In practice these examples are rare.
- try:
- absolute_error = abs(b-a)
- except OverflowError:
- return False
- else:
- return absolute_error <= max(abs_err, rel_err * abs(a))
-
class CMathTests(unittest.TestCase):
# list of all functions in cmath
test_functions = [getattr(cmath, fname) for fname in [
@@ -93,47 +62,96 @@ class CMathTests(unittest.TestCase):
def tearDown(self):
self.test_values.close()
- def rAssertAlmostEqual(self, a, b, rel_err = 2e-15, abs_err = 5e-323):
- """Check that two floating-point numbers are almost equal."""
+ def assertFloatIdentical(self, x, y):
+ """Fail unless floats x and y are identical, in the sense that:
+ (1) both x and y are nans, or
+ (2) both x and y are infinities, with the same sign, or
+ (3) both x and y are zeros, with the same sign, or
+ (4) x and y are both finite and nonzero, and x == y
+
+ """
+ msg = 'floats {!r} and {!r} are not identical'
+
+ if math.isnan(x) or math.isnan(y):
+ if math.isnan(x) and math.isnan(y):
+ return
+ elif x == y:
+ if x != 0.0:
+ return
+ # both zero; check that signs match
+ elif math.copysign(1.0, x) == math.copysign(1.0, y):
+ return
+ else:
+ msg += ': zeros have different signs'
+ self.fail(msg.format(x, y))
+
+ def assertComplexIdentical(self, x, y):
+ """Fail unless complex numbers x and y have equal values and signs.
+
+ In particular, if x and y both have real (or imaginary) part
+ zero, but the zeros have different signs, this test will fail.
+
+ """
+ self.assertFloatIdentical(x.real, y.real)
+ self.assertFloatIdentical(x.imag, y.imag)
+
+ def rAssertAlmostEqual(self, a, b, rel_err = 2e-15, abs_err = 5e-323,
+ msg=None):
+ """Fail if the two floating-point numbers are not almost equal.
+
+ Determine whether floating-point values a and b are equal to within
+ a (small) rounding error. The default values for rel_err and
+ abs_err are chosen to be suitable for platforms where a float is
+ represented by an IEEE 754 double. They allow an error of between
+ 9 and 19 ulps.
+ """
# special values testing
if math.isnan(a):
if math.isnan(b):
return
- self.fail("%s should be nan" % repr(b))
+ self.fail(msg or '{!r} should be nan'.format(b))
if math.isinf(a):
if a == b:
return
- self.fail("finite result where infinity excpected: "
- "expected %s, got %s" % (repr(a), repr(b)))
+ self.fail(msg or 'finite result where infinity expected: '
+ 'expected {!r}, got {!r}'.format(a, b))
+ # if both a and b are zero, check whether they have the same sign
+ # (in theory there are examples where it would be legitimate for a
+ # and b to have opposite signs; in practice these hardly ever
+ # occur).
if not a and not b:
- if math.atan2(a, -1.) != math.atan2(b, -1.):
- self.fail("zero has wrong sign: expected %s, got %s" %
- (repr(a), repr(b)))
-
- # test passes if either the absolute error or the relative
- # error is sufficiently small. The defaults amount to an
- # error of between 9 ulps and 19 ulps on an IEEE-754 compliant
- # machine.
-
+ if math.copysign(1., a) != math.copysign(1., b):
+ self.fail(msg or 'zero has wrong sign: expected {!r}, '
+ 'got {!r}'.format(a, b))
+
+ # if a-b overflows, or b is infinite, return False. Again, in
+ # theory there are examples where a is within a few ulps of the
+ # max representable float, and then b could legitimately be
+ # infinite. In practice these examples are rare.
try:
absolute_error = abs(b-a)
except OverflowError:
pass
else:
+ # test passes if either the absolute error or the relative
+ # error is sufficiently small. The defaults amount to an
+ # error of between 9 ulps and 19 ulps on an IEEE-754 compliant
+ # machine.
if absolute_error <= max(abs_err, rel_err * abs(a)):
return
- self.fail("%s and %s are not sufficiently close" % (repr(a), repr(b)))
+ self.fail(msg or
+ '{!r} and {!r} are not sufficiently close'.format(a, b))
def test_constants(self):
e_expected = 2.71828182845904523536
pi_expected = 3.14159265358979323846
self.assertAlmostEqual(cmath.pi, pi_expected, places=9,
- msg="cmath.pi is %s; should be %s" % (cmath.pi, pi_expected))
+ msg="cmath.pi is {}; should be {}".format(cmath.pi, pi_expected))
self.assertAlmostEqual(cmath.e, e_expected, places=9,
- msg="cmath.e is %s; should be %s" % (cmath.e, e_expected))
+ msg="cmath.e is {}; should be {}".format(cmath.e, e_expected))
def test_user_object(self):
# Test automatic calling of __complex__ and __float__ by cmath
@@ -294,10 +312,8 @@ class CMathTests(unittest.TestCase):
self.rAssertAlmostEqual(math.log(v, base), z.real)
self.assertEqual(0., z.imag)
+ @requires_IEEE_754
def test_specific_values(self):
- if not float.__getformat__("double").startswith("IEEE"):
- return
-
def rect_complex(z):
"""Wrapped version of rect that accepts a complex number instead of
two float arguments."""
@@ -323,8 +339,8 @@ class CMathTests(unittest.TestCase):
except ValueError:
continue
else:
- test_str = "%s: %s(complex(%r, %r))" % (id, fn, ar, ai)
- self.fail('ValueError not raised in test %s' % test_str)
+ self.fail('ValueError not raised in test '
+ '{}: {}(complex({!r}, {!r}))'.format(id, fn, ar, ai))
if 'overflow' in flags:
try:
@@ -332,8 +348,8 @@ class CMathTests(unittest.TestCase):
except OverflowError:
continue
else:
- test_str = "%s: %s(complex(%r, %r))" % (id, fn, ar, ai)
- self.fail('OverflowError not raised in test %s' % test_str)
+ self.fail('OverflowError not raised in test '
+ '{}: {}(complex({!r}, {!r}))'.format(id, fn, ar, ai))
actual = function(arg)
@@ -351,17 +367,19 @@ class CMathTests(unittest.TestCase):
else:
real_abs_err = 5e-323
- if not (almostEqualF(expected.real, actual.real,
- abs_err = real_abs_err) and
- almostEqualF(expected.imag, actual.imag)):
- error_message = (
- "%s: %s(complex(%r, %r))\n" % (id, fn, ar, ai) +
- "Expected: complex(%r, %r)\n" %
- (expected.real, expected.imag) +
- "Received: complex(%r, %r)\n" %
- (actual.real, actual.imag) +
- "Received value insufficiently close to expected value.")
- self.fail(error_message)
+ error_message = (
+ '{}: {}(complex({!r}, {!r}))\n'
+ 'Expected: complex({!r}, {!r})\n'
+ 'Received: complex({!r}, {!r})\n'
+ 'Received value insufficiently close to expected value.'
+ ).format(id, fn, ar, ai,
+ expected.real, expected.imag,
+ actual.real, actual.imag)
+ self.rAssertAlmostEqual(expected.real, actual.real,
+ abs_err=real_abs_err,
+ msg=error_message)
+ self.rAssertAlmostEqual(expected.imag, actual.imag,
+ msg=error_message)
def assertCISEqual(self, a, b):
eps = 1E-7
@@ -440,9 +458,11 @@ class CMathTests(unittest.TestCase):
self.assertEqual(abs(complex(INF, NAN)), INF)
self.assertTrue(math.isnan(abs(complex(NAN, NAN))))
+
+ @requires_IEEE_754
+ def test_abs_overflows(self):
# result overflows
- if float.__getformat__("double").startswith("IEEE"):
- self.assertRaises(OverflowError, abs, complex(1.4e308, 1.4e308))
+ self.assertRaises(OverflowError, abs, complex(1.4e308, 1.4e308))
def assertCEqual(self, a, b):
eps = 1E-7
@@ -456,6 +476,15 @@ class CMathTests(unittest.TestCase):
self.assertCEqual(rect(1, pi/2), (0, 1.))
self.assertCEqual(rect(1, -pi/2), (0, -1.))
+ def test_isfinite(self):
+ real_vals = [float('-inf'), -2.3, -0.0,
+ 0.0, 2.3, float('inf'), float('nan')]
+ for x in real_vals:
+ for y in real_vals:
+ z = complex(x, y)
+ self.assertEqual(cmath.isfinite(z),
+ math.isfinite(x) and math.isfinite(y))
+
def test_isnan(self):
self.assertFalse(cmath.isnan(1))
self.assertFalse(cmath.isnan(1j))
@@ -478,6 +507,31 @@ class CMathTests(unittest.TestCase):
self.assertTrue(cmath.isinf(complex(NAN, INF)))
self.assertTrue(cmath.isinf(complex(INF, NAN)))
+ @requires_IEEE_754
+ @unittest.skipIf(sysconfig.get_config_var('TANH_PRESERVES_ZERO_SIGN') == 0,
+ "system tanh() function doesn't copy the sign")
+ def testTanhSign(self):
+ for z in complex_zeros:
+ self.assertComplexIdentical(cmath.tanh(z), z)
+
+ # The algorithm used for atan and atanh makes use of the system
+ # log1p function; If that system function doesn't respect the sign
+ # of zero, then atan and atanh will also have difficulties with
+ # the sign of complex zeros.
+ @requires_IEEE_754
+ @unittest.skipIf(sysconfig.get_config_var('LOG1P_DROPS_ZERO_SIGN'),
+ "system log1p() function doesn't preserve the sign")
+ def testAtanSign(self):
+ for z in complex_zeros:
+ self.assertComplexIdentical(cmath.atan(z), z)
+
+ @requires_IEEE_754
+ @unittest.skipIf(sysconfig.get_config_var('LOG1P_DROPS_ZERO_SIGN'),
+ "system log1p() function doesn't preserve the sign")
+ def testAtanhSign(self):
+ for z in complex_zeros:
+ self.assertComplexIdentical(cmath.atanh(z), z)
+
def test_main():
run_unittest(CMathTests)
diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py
index 7a13d27e15..a1799f915f 100644
--- a/Lib/test/test_cmd.py
+++ b/Lib/test/test_cmd.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Test script for the 'cmd' module
Original by Michael Schneider
@@ -7,10 +7,10 @@ Original by Michael Schneider
import cmd
import sys
-import trace
import re
import unittest
import io
+from test import support
class samplecmdclass(cmd.Cmd):
"""
@@ -61,15 +61,17 @@ class samplecmdclass(cmd.Cmd):
>>> mycmd.completenames("12")
[]
>>> mycmd.completenames("help")
- ['help', 'help']
+ ['help']
Test for the function complete_help():
>>> mycmd.complete_help("a")
['add']
>>> mycmd.complete_help("he")
- ['help', 'help']
+ ['help']
>>> mycmd.complete_help("12")
[]
+ >>> sorted(mycmd.complete_help(""))
+ ['add', 'exit', 'help', 'shell']
Test for the function do_help():
>>> mycmd.do_help("testet")
@@ -82,11 +84,11 @@ class samplecmdclass(cmd.Cmd):
<BLANKLINE>
Documented commands (type help <topic>):
========================================
- add
+ add help
<BLANKLINE>
Undocumented commands:
======================
- exit help shell
+ exit shell
<BLANKLINE>
Test for the function print_topics():
@@ -123,11 +125,11 @@ class samplecmdclass(cmd.Cmd):
<BLANKLINE>
Documented commands (type help <topic>):
========================================
- add
+ add help
<BLANKLINE>
Undocumented commands:
======================
- exit help shell
+ exit shell
<BLANKLINE>
help text for add
Hello from postloop
@@ -145,7 +147,7 @@ class samplecmdclass(cmd.Cmd):
def complete_command(self):
print("complete command")
- def do_shell(self):
+ def do_shell(self, s):
pass
def do_add(self, s):
@@ -191,11 +193,12 @@ class TestAlternateInput(unittest.TestCase):
def test_main(verbose=None):
- from test import support, test_cmd
+ from test import test_cmd
support.run_doctest(test_cmd, verbose)
support.run_unittest(TestAlternateInput)
def test_coverage(coverdir):
+ trace = support.import_module('trace')
tracer=trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,],
trace=0, count=1)
tracer.run('reload(cmd);test_main()')
@@ -206,5 +209,7 @@ def test_coverage(coverdir):
if __name__ == "__main__":
if "-c" in sys.argv:
test_coverage('/tmp/cmd.cover')
+ elif "-i" in sys.argv:
+ samplecmdclass().cmdloop()
else:
test_main()
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index c4b8be5f6c..c4e3adfb53 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -1,58 +1,31 @@
# Tests invocation of the interpreter with various command line arguments
-# All tests are executed with environment variables ignored
+# Most tests are executed with environment variables ignored
# See test_cmd_line_script.py for testing of script execution
-import os
import test.support, unittest
import os
import sys
import subprocess
+import tempfile
+from test.script_helper import spawn_python, kill_python, assert_python_ok, assert_python_failure
-def _spawn_python(*args):
- cmd_line = [sys.executable]
- # When testing -S, we need PYTHONPATH to work (see test_site_flag())
- if '-S' not in args:
- cmd_line.append('-E')
- cmd_line.extend(args)
- return subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
-def _kill_python(p):
- return _kill_python_and_exit_code(p)[0]
+# XXX (ncoghlan): Move to script_helper and make consistent with run_python
def _kill_python_and_exit_code(p):
- p.stdin.close()
- data = p.stdout.read()
- p.stdout.close()
- # try to cleanup the child so we don't appear to leak when running
- # with regrtest -R. This should be a no-op on Windows.
- subprocess._cleanup()
+ data = kill_python(p)
returncode = p.wait()
return data, returncode
class CmdLineTest(unittest.TestCase):
- def start_python(self, *args):
- return self.start_python_and_exit_code(*args)[0]
-
- def start_python_and_exit_code(self, *args):
- p = _spawn_python(*args)
- return _kill_python_and_exit_code(p)
-
- def exit_code(self, *args):
- cmd_line = [sys.executable, '-E']
- cmd_line.extend(args)
- with open(os.devnull, 'w') as devnull:
- return subprocess.call(cmd_line, stdout=devnull,
- stderr=subprocess.STDOUT)
-
def test_directories(self):
- self.assertNotEqual(self.exit_code('.'), 0)
- self.assertNotEqual(self.exit_code('< .'), 0)
+ assert_python_failure('.')
+ assert_python_failure('< .')
def verify_valid_flag(self, cmd_line):
- data = self.start_python(cmd_line)
- self.assertTrue(data == b'' or data.endswith(b'\n'))
- self.assertTrue(b'Traceback' not in data)
+ rc, out, err = assert_python_ok(*cmd_line)
+ self.assertTrue(out == b'' or out.endswith(b'\n'))
+ self.assertNotIn(b'Traceback', out)
+ self.assertNotIn(b'Traceback', err)
def test_optimize(self):
self.verify_valid_flag('-O')
@@ -65,84 +38,147 @@ class CmdLineTest(unittest.TestCase):
self.verify_valid_flag('-Qwarnall')
def test_site_flag(self):
- if os.name == 'posix':
- # Workaround bug #586680 by adding the extension dir to PYTHONPATH
- from distutils.util import get_platform
- s = "./build/lib.%s-%.3s" % (get_platform(), sys.version)
- if hasattr(sys, 'gettotalrefcount'):
- s += '-pydebug'
- p = os.environ.get('PYTHONPATH', '')
- if p:
- p += ':'
- os.environ['PYTHONPATH'] = p + s
self.verify_valid_flag('-S')
def test_usage(self):
- self.assertTrue(b'usage' in self.start_python('-h'))
+ rc, out, err = assert_python_ok('-h')
+ self.assertIn(b'usage', out)
def test_version(self):
version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii")
- self.assertTrue(self.start_python('-V').startswith(version))
+ rc, out, err = assert_python_ok('-V')
+ self.assertTrue(err.startswith(version))
def test_verbose(self):
# -v causes imports to write to stderr. If the write to
# stderr itself causes an import to happen (for the output
# codec), a recursion loop can occur.
- data, rc = self.start_python_and_exit_code('-v')
- self.assertEqual(rc, 0)
- self.assertTrue(b'stack overflow' not in data)
- data, rc = self.start_python_and_exit_code('-vv')
- self.assertEqual(rc, 0)
- self.assertTrue(b'stack overflow' not in data)
+ rc, out, err = assert_python_ok('-v')
+ self.assertNotIn(b'stack overflow', err)
+ rc, out, err = assert_python_ok('-vv')
+ self.assertNotIn(b'stack overflow', err)
+
+ def test_xoptions(self):
+ rc, out, err = assert_python_ok('-c', 'import sys; print(sys._xoptions)')
+ opts = eval(out.splitlines()[0])
+ self.assertEqual(opts, {})
+ rc, out, err = assert_python_ok(
+ '-Xa', '-Xb=c,d=e', '-c', 'import sys; print(sys._xoptions)')
+ opts = eval(out.splitlines()[0])
+ self.assertEqual(opts, {'a': True, 'b': 'c,d=e'})
def test_run_module(self):
# Test expected operation of the '-m' switch
# Switch needs an argument
- self.assertNotEqual(self.exit_code('-m'), 0)
+ assert_python_failure('-m')
# Check we get an error for a nonexistent module
- self.assertNotEqual(
- self.exit_code('-m', 'fnord43520xyz'),
- 0)
+ assert_python_failure('-m', 'fnord43520xyz')
# Check the runpy module also gives an error for
# a nonexistent module
- self.assertNotEqual(
- self.exit_code('-m', 'runpy', 'fnord43520xyz'),
- 0)
+ assert_python_failure('-m', 'runpy', 'fnord43520xyz'),
# All good if module is located and run successfully
- self.assertEqual(
- self.exit_code('-m', 'timeit', '-n', '1'),
- 0)
+ assert_python_ok('-m', 'timeit', '-n', '1'),
def test_run_module_bug1764407(self):
# -m and -i need to play well together
# Runs the timeit module and checks the __main__
# namespace has been populated appropriately
- p = _spawn_python('-i', '-m', 'timeit', '-n', '1')
+ p = spawn_python('-i', '-m', 'timeit', '-n', '1')
p.stdin.write(b'Timer\n')
p.stdin.write(b'exit()\n')
- data = _kill_python(p)
+ data = kill_python(p)
self.assertTrue(data.find(b'1 loop') != -1)
self.assertTrue(data.find(b'__main__.Timer') != -1)
def test_run_code(self):
# Test expected operation of the '-c' switch
# Switch needs an argument
- self.assertNotEqual(self.exit_code('-c'), 0)
+ assert_python_failure('-c')
# Check we get an error for an uncaught exception
- self.assertNotEqual(
- self.exit_code('-c', 'raise Exception'),
- 0)
+ assert_python_failure('-c', 'raise Exception')
# All good if execution is successful
- self.assertEqual(
- self.exit_code('-c', 'pass'),
- 0)
+ assert_python_ok('-c', 'pass')
+ @unittest.skipIf(sys.getfilesystemencoding() == 'ascii',
+ 'need a filesystem encoding different than ASCII')
+ def test_non_ascii(self):
# Test handling of non-ascii data
- if sys.getfilesystemencoding() != 'ascii':
- command = "assert(ord('\xe9') == 0xe9)"
- self.assertEqual(
- self.exit_code('-c', command),
- 0)
+ if test.support.verbose:
+ import locale
+ print('locale encoding = %s, filesystem encoding = %s'
+ % (locale.getpreferredencoding(), sys.getfilesystemencoding()))
+ command = "assert(ord('\xe9') == 0xe9)"
+ assert_python_ok('-c', command)
+
+ # On Windows, pass bytes to subprocess doesn't test how Python decodes the
+ # command line, but how subprocess does decode bytes to unicode. Python
+ # doesn't decode the command line because Windows provides directly the
+ # arguments as unicode (using wmain() instead of main()).
+ @unittest.skipIf(sys.platform == 'win32',
+ 'Windows has a native unicode API')
+ def test_undecodable_code(self):
+ undecodable = b"\xff"
+ env = os.environ.copy()
+ # Use C locale to get ascii for the locale encoding
+ env['LC_ALL'] = 'C'
+ code = (
+ b'import locale; '
+ b'print(ascii("' + undecodable + b'"), '
+ b'locale.getpreferredencoding())')
+ p = subprocess.Popen(
+ [sys.executable, "-c", code],
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+ env=env)
+ stdout, stderr = p.communicate()
+ if p.returncode == 1:
+ # _Py_char2wchar() decoded b'\xff' as '\udcff' (b'\xff' is not
+ # decodable from ASCII) and run_command() failed on
+ # PyUnicode_AsUTF8String(). This is the expected behaviour on
+ # Linux.
+ pattern = b"Unable to decode the command from the command line:"
+ elif p.returncode == 0:
+ # _Py_char2wchar() decoded b'\xff' as '\xff' even if the locale is
+ # C and the locale encoding is ASCII. It occurs on FreeBSD, Solaris
+ # and Mac OS X.
+ pattern = b"'\\xff' "
+ # The output is followed by the encoding name, an alias to ASCII.
+ # Examples: "US-ASCII" or "646" (ISO 646, on Solaris).
+ else:
+ raise AssertionError("Unknown exit code: %s, output=%a" % (p.returncode, stdout))
+ if not stdout.startswith(pattern):
+ raise AssertionError("%a doesn't start with %a" % (stdout, pattern))
+
+ @unittest.skipUnless(sys.platform == 'darwin', 'test specific to Mac OS X')
+ def test_osx_utf8(self):
+ def check_output(text):
+ decoded = text.decode('utf8', 'surrogateescape')
+ expected = ascii(decoded).encode('ascii') + b'\n'
+
+ env = os.environ.copy()
+ # C locale gives ASCII locale encoding, but Python uses UTF-8
+ # to parse the command line arguments on Mac OS X
+ env['LC_ALL'] = 'C'
+
+ p = subprocess.Popen(
+ (sys.executable, "-c", "import sys; print(ascii(sys.argv[1]))", text),
+ stdout=subprocess.PIPE,
+ env=env)
+ stdout, stderr = p.communicate()
+ self.assertEqual(stdout, expected)
+ self.assertEqual(p.returncode, 0)
+
+ # test valid utf-8
+ text = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8')
+ check_output(text)
+
+ # test invalid utf-8
+ text = (
+ b'\xff' # invalid byte
+ b'\xc3\xa9' # valid utf-8 character
+ b'\xc3\xff' # invalid byte sequence
+ b'\xed\xa0\x80' # lone surrogate character (invalid)
+ )
+ check_output(text)
def test_unbuffered_output(self):
# Test expected operation of the '-u' switch
@@ -150,21 +186,21 @@ class CmdLineTest(unittest.TestCase):
# Binary is unbuffered
code = ("import os, sys; sys.%s.buffer.write(b'x'); os._exit(0)"
% stream)
- data, rc = self.start_python_and_exit_code('-u', '-c', code)
- self.assertEqual(rc, 0)
+ rc, out, err = assert_python_ok('-u', '-c', code)
+ data = err if stream == 'stderr' else out
self.assertEqual(data, b'x', "binary %s not unbuffered" % stream)
# Text is line-buffered
code = ("import os, sys; sys.%s.write('x\\n'); os._exit(0)"
% stream)
- data, rc = self.start_python_and_exit_code('-u', '-c', code)
- self.assertEqual(rc, 0)
+ rc, out, err = assert_python_ok('-u', '-c', code)
+ data = err if stream == 'stderr' else out
self.assertEqual(data.strip(), b'x',
"text %s not line-buffered" % stream)
def test_unbuffered_input(self):
# sys.stdin still works with '-u'
code = ("import sys; sys.stdout.write(sys.stdin.read(1))")
- p = _spawn_python('-u', '-c', code)
+ p = spawn_python('-u', '-c', code)
p.stdin.write(b'x')
p.stdin.flush()
data, rc = _kill_python_and_exit_code(p)
@@ -172,23 +208,62 @@ class CmdLineTest(unittest.TestCase):
self.assertTrue(data.startswith(b'x'), data)
def test_large_PYTHONPATH(self):
- with test.support.EnvironmentVarGuard() as env:
- path1 = "ABCDE" * 100
- path2 = "FGHIJ" * 100
- env['PYTHONPATH'] = path1 + os.pathsep + path2
+ path1 = "ABCDE" * 100
+ path2 = "FGHIJ" * 100
+ path = path1 + os.pathsep + path2
- code = """
-import sys
-path = ":".join(sys.path)
-path = path.encode("ascii", "backslashreplace")
-sys.stdout.buffer.write(path)"""
- code = code.strip().splitlines()
- code = '; '.join(code)
- p = _spawn_python('-S', '-c', code)
- stdout, _ = p.communicate()
- p.stdout.close()
- self.assertTrue(path1.encode('ascii') in stdout)
- self.assertTrue(path2.encode('ascii') in stdout)
+ code = """if 1:
+ import sys
+ path = ":".join(sys.path)
+ path = path.encode("ascii", "backslashreplace")
+ sys.stdout.buffer.write(path)"""
+ rc, out, err = assert_python_ok('-S', '-c', code,
+ PYTHONPATH=path)
+ self.assertIn(path1.encode('ascii'), out)
+ self.assertIn(path2.encode('ascii'), out)
+
+ def test_displayhook_unencodable(self):
+ for encoding in ('ascii', 'latin1', 'utf8'):
+ env = os.environ.copy()
+ env['PYTHONIOENCODING'] = encoding
+ p = subprocess.Popen(
+ [sys.executable, '-i'],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ env=env)
+ # non-ascii, surrogate, non-BMP printable, non-BMP unprintable
+ text = "a=\xe9 b=\uDC80 c=\U00010000 d=\U0010FFFF"
+ p.stdin.write(ascii(text).encode('ascii') + b"\n")
+ p.stdin.write(b'exit()\n')
+ data = kill_python(p)
+ escaped = repr(text).encode(encoding, 'backslashreplace')
+ self.assertIn(escaped, data)
+
+ def check_input(self, code, expected):
+ with tempfile.NamedTemporaryFile("wb+") as stdin:
+ sep = os.linesep.encode('ASCII')
+ stdin.write(sep.join((b'abc', b'def')))
+ stdin.flush()
+ stdin.seek(0)
+ with subprocess.Popen(
+ (sys.executable, "-c", code),
+ stdin=stdin, stdout=subprocess.PIPE) as proc:
+ stdout, stderr = proc.communicate()
+ self.assertEqual(stdout.rstrip(), expected)
+
+ def test_stdin_readline(self):
+ # Issue #11272: check that sys.stdin.readline() replaces '\r\n' by '\n'
+ # on Windows (sys.stdin is opened in binary mode)
+ self.check_input(
+ "import sys; print(repr(sys.stdin.readline()))",
+ b"'abc\\n'")
+
+ def test_builtin_input(self):
+ # Issue #11272: check that input() strips newlines ('\n' or '\r\n')
+ self.check_input(
+ "print(repr(input()))",
+ b"'abc'")
def test_main():
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index bc87a22d6d..921c5f3df4 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -1,38 +1,17 @@
-# Tests command line execution of scripts
+# tests command line execution of scripts
import unittest
+import sys
import os
import os.path
-import sys
-import test.support
-import tempfile
-import subprocess
import py_compile
-import contextlib
-import shutil
-import zipfile
-
-verbose = test.support.verbose
-# XXX ncoghlan: Should we consider moving these to support?
-from test.test_cmd_line import _spawn_python, _kill_python
+from test import support
+from test.script_helper import (
+ make_pkg, make_script, make_zip_pkg, make_zip_script,
+ assert_python_ok, assert_python_failure, temp_dir)
-def _run_python(*args):
- if __debug__:
- p = _spawn_python(*args)
- else:
- p = _spawn_python('-O', *args)
- stdout_data = _kill_python(p)
- return p.wait(), stdout_data.decode()
-
-@contextlib.contextmanager
-def temp_dir():
- dirname = tempfile.mkdtemp()
- dirname = os.path.realpath(dirname)
- try:
- yield dirname
- finally:
- shutil.rmtree(dirname)
+verbose = support.verbose
test_source = """\
# Script may be run with optimisation enabled, so don't rely on assert
@@ -51,73 +30,26 @@ f()
assertEqual(result, ['Top level assignment', 'Lower level reference'])
# Check population of magic variables
assertEqual(__name__, '__main__')
-print('__file__==%r' % __file__)
+print('__file__==%a' % __file__)
+assertEqual(__cached__, None)
print('__package__==%r' % __package__)
# Check the sys module
import sys
assertIdentical(globals(), sys.modules[__name__].__dict__)
-print('sys.argv[0]==%r' % sys.argv[0])
+print('sys.argv[0]==%a' % sys.argv[0])
+print('sys.path[0]==%a' % sys.path[0])
+# Check the working directory
+import os
+print('cwd==%a' % os.getcwd())
"""
def _make_test_script(script_dir, script_basename, source=test_source):
- script_filename = script_basename+os.path.extsep+'py'
- script_name = os.path.join(script_dir, script_filename)
- # The script should be encoded to UTF-8, the default string encoding
- script_file = open(script_name, 'w', encoding='utf-8')
- script_file.write(source)
- script_file.close()
- return script_name
-
-def _compile_test_script(script_name):
- py_compile.compile(script_name, doraise=True)
- if __debug__:
- compiled_name = script_name + 'c'
- else:
- compiled_name = script_name + 'o'
- return compiled_name
-
-def _make_test_zip(zip_dir, zip_basename, script_name, name_in_zip=None):
- zip_filename = zip_basename+os.path.extsep+"zip"
- zip_name = os.path.join(zip_dir, zip_filename)
- zip_file = zipfile.ZipFile(zip_name, 'w')
- if name_in_zip is None:
- name_in_zip = os.path.basename(script_name)
- zip_file.write(script_name, name_in_zip)
- zip_file.close()
- #if verbose:
- # zip_file = zipfile.ZipFile(zip_name, 'r')
- # print("Contents of %r:" % zip_name)
- # zip_file.printdir()
- # zip_file.close()
- return zip_name, os.path.join(zip_name, name_in_zip)
-
-def _make_test_pkg(pkg_dir):
- os.mkdir(pkg_dir)
- _make_test_script(pkg_dir, '__init__', '')
+ return make_script(script_dir, script_basename, source)
def _make_test_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
source=test_source, depth=1):
- init_name = _make_test_script(zip_dir, '__init__', '')
- init_basename = os.path.basename(init_name)
- script_name = _make_test_script(zip_dir, script_basename, source)
- pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)]
- script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name))
- zip_filename = zip_basename+os.extsep+'zip'
- zip_name = os.path.join(zip_dir, zip_filename)
- zip_file = zipfile.ZipFile(zip_name, 'w')
- for name in pkg_names:
- init_name_in_zip = os.path.join(name, init_basename)
- zip_file.write(init_name, init_name_in_zip)
- zip_file.write(script_name, script_name_in_zip)
- zip_file.close()
- os.unlink(init_name)
- os.unlink(script_name)
- #if verbose:
- # zip_file = zipfile.ZipFile(zip_name, 'r')
- # print('Contents of %r:' % zip_name)
- # zip_file.printdir()
- # zip_file.close()
- return zip_name, os.path.join(zip_name, script_name_in_zip)
+ return make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
+ source, depth)
# There's no easy way to pass the script directory in to get
# -m to work (avoiding that is the whole point of making
@@ -135,133 +67,154 @@ def _make_launch_script(script_dir, script_basename, module_name, path=None):
else:
path = repr(path)
source = launch_source % (path, module_name)
- return _make_test_script(script_dir, script_basename, source)
+ return make_script(script_dir, script_basename, source)
class CmdLineTest(unittest.TestCase):
- def _check_script(self, script_name, expected_file,
- expected_argv0, expected_package,
- *cmd_line_switches):
- run_args = cmd_line_switches + (script_name,)
- exit_code, data = _run_python(*run_args)
- if verbose:
+ def _check_output(self, script_name, exit_code, data,
+ expected_file, expected_argv0,
+ expected_path0, expected_package):
+ if verbose > 1:
print("Output from test script %r:" % script_name)
print(data)
self.assertEqual(exit_code, 0)
- printed_file = '__file__==%r' % expected_file
- printed_argv0 = 'sys.argv[0]==%r' % expected_argv0
+ printed_file = '__file__==%a' % expected_file
printed_package = '__package__==%r' % expected_package
- if verbose:
+ printed_argv0 = 'sys.argv[0]==%a' % expected_argv0
+ printed_path0 = 'sys.path[0]==%a' % expected_path0
+ printed_cwd = 'cwd==%a' % os.getcwd()
+ if verbose > 1:
print('Expected output:')
print(printed_file)
print(printed_package)
print(printed_argv0)
- self.assertTrue(printed_file in data)
- self.assertTrue(printed_package in data)
- self.assertTrue(printed_argv0 in data)
+ print(printed_cwd)
+ self.assertIn(printed_file.encode('utf-8'), data)
+ self.assertIn(printed_package.encode('utf-8'), data)
+ self.assertIn(printed_argv0.encode('utf-8'), data)
+ self.assertIn(printed_path0.encode('utf-8'), data)
+ self.assertIn(printed_cwd.encode('utf-8'), data)
+
+ def _check_script(self, script_name, expected_file,
+ expected_argv0, expected_path0,
+ expected_package,
+ *cmd_line_switches):
+ if not __debug__:
+ cmd_line_switches += ('-' + 'O' * sys.flags.optimize,)
+ run_args = cmd_line_switches + (script_name,)
+ rc, out, err = assert_python_ok(*run_args)
+ self._check_output(script_name, rc, out + err, expected_file,
+ expected_argv0, expected_path0, expected_package)
def _check_import_error(self, script_name, expected_msg,
*cmd_line_switches):
run_args = cmd_line_switches + (script_name,)
- exit_code, data = _run_python(*run_args)
- if verbose:
+ rc, out, err = assert_python_failure(*run_args)
+ if verbose > 1:
print('Output from test script %r:' % script_name)
- print(data)
+ print(err)
print('Expected output: %r' % expected_msg)
- self.assertTrue(expected_msg in data)
+ self.assertIn(expected_msg.encode('utf-8'), err)
def test_basic_script(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, 'script')
- self._check_script(script_name, script_name, script_name, None)
+ self._check_script(script_name, script_name, script_name,
+ script_dir, None)
def test_script_compiled(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, 'script')
- compiled_name = _compile_test_script(script_name)
+ py_compile.compile(script_name, doraise=True)
os.remove(script_name)
- self._check_script(compiled_name, compiled_name, compiled_name, None)
+ pyc_file = support.make_legacy_pyc(script_name)
+ self._check_script(pyc_file, pyc_file,
+ pyc_file, script_dir, None)
def test_directory(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, '__main__')
- self._check_script(script_dir, script_name, script_dir, '')
+ self._check_script(script_dir, script_name, script_dir,
+ script_dir, '')
def test_directory_compiled(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, '__main__')
- compiled_name = _compile_test_script(script_name)
+ py_compile.compile(script_name, doraise=True)
os.remove(script_name)
- self._check_script(script_dir, compiled_name, script_dir, '')
+ pyc_file = support.make_legacy_pyc(script_name)
+ self._check_script(script_dir, pyc_file, script_dir,
+ script_dir, '')
def test_directory_error(self):
with temp_dir() as script_dir:
- msg = "can't find '__main__.py' in %r" % script_dir
+ msg = "can't find '__main__' module in %r" % script_dir
self._check_import_error(script_dir, msg)
def test_zipfile(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, '__main__')
- zip_name, run_name = _make_test_zip(script_dir, 'test_zip', script_name)
- self._check_script(zip_name, run_name, zip_name, '')
+ zip_name, run_name = make_zip_script(script_dir, 'test_zip', script_name)
+ self._check_script(zip_name, run_name, zip_name, zip_name, '')
def test_zipfile_compiled(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, '__main__')
- compiled_name = _compile_test_script(script_name)
- zip_name, run_name = _make_test_zip(script_dir, 'test_zip', compiled_name)
- self._check_script(zip_name, run_name, zip_name, '')
+ compiled_name = py_compile.compile(script_name, doraise=True)
+ zip_name, run_name = make_zip_script(script_dir, 'test_zip', compiled_name)
+ self._check_script(zip_name, run_name, zip_name, zip_name, '')
def test_zipfile_error(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, 'not_main')
- zip_name, run_name = _make_test_zip(script_dir, 'test_zip', script_name)
- msg = "can't find '__main__.py' in %r" % zip_name
+ zip_name, run_name = make_zip_script(script_dir, 'test_zip', script_name)
+ msg = "can't find '__main__' module in %r" % zip_name
self._check_import_error(zip_name, msg)
def test_module_in_package(self):
with temp_dir() as script_dir:
pkg_dir = os.path.join(script_dir, 'test_pkg')
- _make_test_pkg(pkg_dir)
+ make_pkg(pkg_dir)
script_name = _make_test_script(pkg_dir, 'script')
launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.script')
- self._check_script(launch_name, script_name, script_name, 'test_pkg')
+ self._check_script(launch_name, script_name, script_name, script_dir, 'test_pkg')
def test_module_in_package_in_zipfile(self):
with temp_dir() as script_dir:
zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script')
launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.script', zip_name)
- self._check_script(launch_name, run_name, run_name, 'test_pkg')
+ self._check_script(launch_name, run_name, run_name, zip_name, 'test_pkg')
def test_module_in_subpackage_in_zipfile(self):
with temp_dir() as script_dir:
zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script', depth=2)
launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.test_pkg.script', zip_name)
- self._check_script(launch_name, run_name, run_name, 'test_pkg.test_pkg')
+ self._check_script(launch_name, run_name, run_name, zip_name, 'test_pkg.test_pkg')
def test_package(self):
with temp_dir() as script_dir:
pkg_dir = os.path.join(script_dir, 'test_pkg')
- _make_test_pkg(pkg_dir)
+ make_pkg(pkg_dir)
script_name = _make_test_script(pkg_dir, '__main__')
launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
self._check_script(launch_name, script_name,
- script_name, 'test_pkg')
+ script_name, script_dir, 'test_pkg')
def test_package_compiled(self):
with temp_dir() as script_dir:
pkg_dir = os.path.join(script_dir, 'test_pkg')
- _make_test_pkg(pkg_dir)
+ make_pkg(pkg_dir)
script_name = _make_test_script(pkg_dir, '__main__')
- compiled_name = _compile_test_script(script_name)
+ compiled_name = py_compile.compile(script_name, doraise=True)
os.remove(script_name)
+ pyc_file = support.make_legacy_pyc(script_name)
launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
- self._check_script(launch_name, compiled_name,
- compiled_name, 'test_pkg')
+ self._check_script(launch_name, pyc_file,
+ pyc_file, script_dir, 'test_pkg')
def test_package_error(self):
with temp_dir() as script_dir:
pkg_dir = os.path.join(script_dir, 'test_pkg')
- _make_test_pkg(pkg_dir)
+ make_pkg(pkg_dir)
msg = ("'test_pkg' is a package and cannot "
"be directly executed")
launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
@@ -270,19 +223,60 @@ class CmdLineTest(unittest.TestCase):
def test_package_recursion(self):
with temp_dir() as script_dir:
pkg_dir = os.path.join(script_dir, 'test_pkg')
- _make_test_pkg(pkg_dir)
+ make_pkg(pkg_dir)
main_dir = os.path.join(pkg_dir, '__main__')
- _make_test_pkg(main_dir)
+ make_pkg(main_dir)
msg = ("Cannot use package as __main__ module; "
"'test_pkg' is a package and cannot "
"be directly executed")
launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
self._check_import_error(launch_name, msg)
+ def test_issue8202(self):
+ # Make sure package __init__ modules see "-m" in sys.argv0 while
+ # searching for the module to execute
+ with temp_dir() as script_dir:
+ with support.temp_cwd(path=script_dir):
+ pkg_dir = os.path.join(script_dir, 'test_pkg')
+ make_pkg(pkg_dir, "import sys; print('init_argv0==%r' % sys.argv[0])")
+ script_name = _make_test_script(pkg_dir, 'script')
+ rc, out, err = assert_python_ok('-m', 'test_pkg.script')
+ if verbose > 1:
+ print(data)
+ expected = "init_argv0==%r" % '-m'
+ self.assertIn(expected.encode('utf-8'), out)
+ self._check_output(script_name, rc, out,
+ script_name, script_name, '', 'test_pkg')
+
+ def test_issue8202_dash_c_file_ignored(self):
+ # Make sure a "-c" file in the current directory
+ # does not alter the value of sys.path[0]
+ with temp_dir() as script_dir:
+ with support.temp_cwd(path=script_dir):
+ with open("-c", "w") as f:
+ f.write("data")
+ rc, out, err = assert_python_ok('-c',
+ 'import sys; print("sys.path[0]==%r" % sys.path[0])')
+ if verbose > 1:
+ print(out)
+ expected = "sys.path[0]==%r" % ''
+ self.assertIn(expected.encode('utf-8'), out)
+
+ def test_issue8202_dash_m_file_ignored(self):
+ # Make sure a "-m" file in the current directory
+ # does not alter the value of sys.path[0]
+ with temp_dir() as script_dir:
+ script_name = _make_test_script(script_dir, 'other')
+ with support.temp_cwd(path=script_dir):
+ with open("-m", "w") as f:
+ f.write("data")
+ rc, out, err = assert_python_ok('-m', 'other')
+ self._check_output(script_name, rc, out,
+ script_name, script_name, '', '')
def test_main():
- test.support.run_unittest(CmdLineTest)
- test.support.reap_children()
+ support.run_unittest(CmdLineTest)
+ support.reap_children()
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index c8fa2a138b..e1c7a783de 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -102,6 +102,11 @@ consts: ('None',)
"""
+import unittest
+import weakref
+import _testcapi
+
+
def consts(t):
"""Yield a doctest-safe sequence of object reprs."""
for elt in t:
@@ -118,11 +123,47 @@ def dump(co):
print("%s: %s" % (attr, getattr(co, "co_" + attr)))
print("consts:", tuple(consts(co.co_consts)))
+
+class CodeTest(unittest.TestCase):
+
+ def test_newempty(self):
+ co = _testcapi.code_newempty("filename", "funcname", 15)
+ self.assertEqual(co.co_filename, "filename")
+ self.assertEqual(co.co_name, "funcname")
+ self.assertEqual(co.co_firstlineno, 15)
+
+
+class CodeWeakRefTest(unittest.TestCase):
+
+ def test_basic(self):
+ # Create a code object in a clean environment so that we know we have
+ # the only reference to it left.
+ namespace = {}
+ exec("def f(): pass", globals(), namespace)
+ f = namespace["f"]
+ del namespace
+
+ self.called = False
+ def callback(code):
+ self.called = True
+
+ # f is now the last reference to the function, and through it, the code
+ # object. While we hold it, check that we can create a weakref and
+ # deref it. Then delete it, and check that the callback gets called and
+ # the reference dies.
+ coderef = weakref.ref(f.__code__, callback)
+ self.assertTrue(bool(coderef()))
+ del f
+ self.assertFalse(bool(coderef()))
+ self.assertTrue(self.called)
+
+
def test_main(verbose=None):
- from test.support import run_doctest
+ from test.support import run_doctest, run_unittest
from test import test_code
run_doctest(test_code, verbose)
+ run_unittest(CodeTest, CodeWeakRefTest)
-if __name__ == '__main__':
+if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_codecencodings_cn.py b/Lib/test/test_codecencodings_cn.py
index 77bac139cf..a2d9718497 100644
--- a/Lib/test/test_codecencodings_cn.py
+++ b/Lib/test/test_codecencodings_cn.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecencodings_cn.py
# Codec encoding tests for PRC encodings.
diff --git a/Lib/test/test_codecencodings_hk.py b/Lib/test/test_codecencodings_hk.py
index b1deb715a5..ccdc0b4c55 100644
--- a/Lib/test/test_codecencodings_hk.py
+++ b/Lib/test/test_codecencodings_hk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecencodings_hk.py
# Codec encoding tests for HongKong encodings.
diff --git a/Lib/test/test_codecencodings_jp.py b/Lib/test/test_codecencodings_jp.py
index e2cd7d7020..f56a373896 100644
--- a/Lib/test/test_codecencodings_jp.py
+++ b/Lib/test/test_codecencodings_jp.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecencodings_jp.py
# Codec encoding tests for Japanese encodings.
diff --git a/Lib/test/test_codecencodings_kr.py b/Lib/test/test_codecencodings_kr.py
index 34fade923e..de4da7f5b6 100644
--- a/Lib/test/test_codecencodings_kr.py
+++ b/Lib/test/test_codecencodings_kr.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecencodings_kr.py
# Codec encoding tests for ROK encodings.
diff --git a/Lib/test/test_codecencodings_tw.py b/Lib/test/test_codecencodings_tw.py
index 6b840d36ce..12d3c9fa04 100644
--- a/Lib/test/test_codecencodings_tw.py
+++ b/Lib/test/test_codecencodings_tw.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecencodings_tw.py
# Codec encoding tests for ROC encodings.
diff --git a/Lib/test/test_codecmaps_cn.py b/Lib/test/test_codecmaps_cn.py
index 34a910d876..063919d6d8 100644
--- a/Lib/test/test_codecmaps_cn.py
+++ b/Lib/test/test_codecmaps_cn.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecmaps_cn.py
# Codec mapping tests for PRC encodings
diff --git a/Lib/test/test_codecmaps_hk.py b/Lib/test/test_codecmaps_hk.py
index ddb1208b3d..bbe1f2f905 100644
--- a/Lib/test/test_codecmaps_hk.py
+++ b/Lib/test/test_codecmaps_hk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecmaps_hk.py
# Codec mapping tests for HongKong encodings
diff --git a/Lib/test/test_codecmaps_jp.py b/Lib/test/test_codecmaps_jp.py
index 75db00c602..652bd81515 100644
--- a/Lib/test/test_codecmaps_jp.py
+++ b/Lib/test/test_codecmaps_jp.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecmaps_jp.py
# Codec mapping tests for Japanese encodings
diff --git a/Lib/test/test_codecmaps_kr.py b/Lib/test/test_codecmaps_kr.py
index 0da9d1ce95..d909c8bd58 100644
--- a/Lib/test/test_codecmaps_kr.py
+++ b/Lib/test/test_codecmaps_kr.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecmaps_kr.py
# Codec mapping tests for ROK encodings
diff --git a/Lib/test/test_codecmaps_tw.py b/Lib/test/test_codecmaps_tw.py
index e6df3a72fc..6db5091fc3 100644
--- a/Lib/test/test_codecmaps_tw.py
+++ b/Lib/test/test_codecmaps_tw.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_codecmaps_tw.py
# Codec mapping tests for ROC encodings
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index 93cdf915b8..d560d7aa46 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -29,7 +29,7 @@ class MixInCheckStateHandling:
d = codecs.getincrementaldecoder(encoding)()
part1 = d.decode(s[:i])
state = d.getstate()
- self.assertTrue(isinstance(state[1], int))
+ self.assertIsInstance(state[1], int)
# Check that the condition stated in the documentation for
# IncrementalDecoder.getstate() holds
if not state[1]:
@@ -72,7 +72,6 @@ class ReadTest(unittest.TestCase, MixInCheckStateHandling):
# check that there's nothing left in the buffers
self.assertEqual(r.read(), "")
self.assertEqual(r.bytebuffer, b"")
- self.assertEqual(r.charbuffer, "")
# do the check again, this time using a incremental decoder
d = codecs.getincrementaldecoder(self.encoding)()
@@ -545,6 +544,12 @@ class UTF16LETest(ReadTest):
self.assertRaises(UnicodeDecodeError, codecs.utf_16_le_decode,
b"\xff", "strict", True)
+ def test_nonbmp(self):
+ self.assertEqual("\U00010203".encode(self.encoding),
+ b'\x00\xd8\x03\xde')
+ self.assertEqual(b'\x00\xd8\x03\xde'.decode(self.encoding),
+ "\U00010203")
+
class UTF16BETest(ReadTest):
encoding = "utf-16-be"
@@ -567,6 +572,12 @@ class UTF16BETest(ReadTest):
self.assertRaises(UnicodeDecodeError, codecs.utf_16_be_decode,
b"\xff", "strict", True)
+ def test_nonbmp(self):
+ self.assertEqual("\U00010203".encode(self.encoding),
+ b'\xd8\x00\xde\x03')
+ self.assertEqual(b'\xd8\x00\xde\x03'.decode(self.encoding),
+ "\U00010203")
+
class UTF8Test(ReadTest):
encoding = "utf-8"
@@ -653,18 +664,6 @@ class ReadBufferTest(unittest.TestCase):
self.assertRaises(TypeError, codecs.readbuffer_encode)
self.assertRaises(TypeError, codecs.readbuffer_encode, 42)
-class CharBufferTest(unittest.TestCase):
-
- def test_string(self):
- self.assertEqual(codecs.charbuffer_encode(b"spam"), (b"spam", 4))
-
- def test_empty(self):
- self.assertEqual(codecs.charbuffer_encode(b""), (b"", 0))
-
- def test_bad_args(self):
- self.assertRaises(TypeError, codecs.charbuffer_encode)
- self.assertRaises(TypeError, codecs.charbuffer_encode, 42)
-
class UTF8SigTest(ReadTest):
encoding = "utf-8-sig"
@@ -1276,6 +1275,7 @@ all_unicode_encodings = [
"cp424",
"cp437",
"cp500",
+ "cp720",
"cp737",
"cp775",
"cp850",
@@ -1283,6 +1283,7 @@ all_unicode_encodings = [
"cp855",
"cp856",
"cp857",
+ "cp858",
"cp860",
"cp861",
"cp862",
@@ -1371,11 +1372,6 @@ broken_incremental_coders = broken_unicode_with_streams + [
"idna",
]
-# The following encodings only support "strict" mode
-only_strict_mode = [
- "idna",
-]
-
class BasicUnicodeTest(unittest.TestCase, MixInCheckStateHandling):
def test_basics(self):
s = "abc123" # all codecs should be able to encode these
@@ -1450,7 +1446,7 @@ class BasicUnicodeTest(unittest.TestCase, MixInCheckStateHandling):
result = "".join(codecs.iterdecode(codecs.iterencode("", encoding), encoding))
self.assertEqual(result, "")
- if encoding not in only_strict_mode:
+ if encoding not in ("idna", "mbcs"):
# check incremental decoder/encoder with errors argument
try:
encoder = codecs.getincrementalencoder(encoding)("ignore")
@@ -1675,6 +1671,54 @@ class BomTest(unittest.TestCase):
self.assertEqual(f.read(), data * 2)
+bytes_transform_encodings = [
+ "base64_codec",
+ "uu_codec",
+ "quopri_codec",
+ "hex_codec",
+]
+try:
+ import zlib
+except ImportError:
+ pass
+else:
+ bytes_transform_encodings.append("zlib_codec")
+try:
+ import bz2
+except ImportError:
+ pass
+else:
+ bytes_transform_encodings.append("bz2_codec")
+
+class TransformCodecTest(unittest.TestCase):
+
+ def test_basics(self):
+ binput = bytes(range(256))
+ for encoding in bytes_transform_encodings:
+ # generic codecs interface
+ (o, size) = codecs.getencoder(encoding)(binput)
+ self.assertEqual(size, len(binput))
+ (i, size) = codecs.getdecoder(encoding)(o)
+ self.assertEqual(size, len(o))
+ self.assertEqual(i, binput)
+
+ def test_read(self):
+ for encoding in bytes_transform_encodings:
+ sin = codecs.encode(b"\x80", encoding)
+ reader = codecs.getreader(encoding)(io.BytesIO(sin))
+ sout = reader.read()
+ self.assertEqual(sout, b"\x80")
+
+ def test_readline(self):
+ for encoding in bytes_transform_encodings:
+ if encoding in ['uu_codec', 'zlib_codec']:
+ continue
+ sin = codecs.encode(b"\x80", encoding)
+ reader = codecs.getreader(encoding)(io.BytesIO(sin))
+ sout = reader.readline()
+ self.assertEqual(sout, b"\x80")
+
+
def test_main():
support.run_unittest(
UTF32Test,
@@ -1688,7 +1732,6 @@ def test_main():
UTF7Test,
UTF16ExTest,
ReadBufferTest,
- CharBufferTest,
RecodingTest,
PunycodeTest,
UnicodeInternalTest,
@@ -1703,6 +1746,7 @@ def test_main():
TypesTest,
SurrogateEscapeTest,
BomTest,
+ TransformCodecTest,
)
diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py
index ffbcd34026..d096293648 100644
--- a/Lib/test/test_codeop.py
+++ b/Lib/test/test_codeop.py
@@ -295,10 +295,6 @@ class CodeopTests(unittest.TestCase):
self.assertNotEqual(compile_command("a = 1\n", "abc").co_filename,
compile("a = 1\n", "def", 'single').co_filename)
- def test_no_universal_newlines(self):
- code = compile_command("'\rfoo\r'", symbol='eval')
- self.assertEqual(eval(code), '\rfoo\r')
-
def test_main():
run_unittest(CodeopTests)
diff --git a/Lib/test/test_coding.py b/Lib/test/test_coding.py
index 9d368c5e96..f9db0b40f0 100644
--- a/Lib/test/test_coding.py
+++ b/Lib/test/test_coding.py
@@ -1,6 +1,6 @@
import test.support, unittest
-from test.support import TESTFN, unlink
+from test.support import TESTFN, unlink, unload
import os, sys
class CodingTest(unittest.TestCase):
@@ -17,9 +17,8 @@ class CodingTest(unittest.TestCase):
path = os.path.dirname(__file__)
filename = os.path.join(path, module_name + '.py')
- fp = open(filename, "rb")
- bytes = fp.read()
- fp.close()
+ with open(filename, "rb") as fp:
+ bytes = fp.read()
self.assertRaises(SyntaxError, compile, bytes, filename, 'exec')
def test_exec_valid_coding(self):
@@ -30,9 +29,8 @@ class CodingTest(unittest.TestCase):
def test_file_parse(self):
# issue1134: all encodings outside latin-1 and utf-8 fail on
# multiline strings and long lines (>512 columns)
- if TESTFN in sys.modules:
- del sys.modules[TESTFN]
- sys.path.insert(0, ".")
+ unload(TESTFN)
+ sys.path.insert(0, os.curdir)
filename = TESTFN + ".py"
f = open(filename, "w")
try:
@@ -45,21 +43,20 @@ class CodingTest(unittest.TestCase):
__import__(TESTFN)
finally:
f.close()
- unlink(TESTFN+".py")
- unlink(TESTFN+".pyc")
- sys.path.pop(0)
+ unlink(filename)
+ unlink(filename + "c")
+ unload(TESTFN)
+ del sys.path[0]
def test_error_from_string(self):
# See http://bugs.python.org/issue6289
input = "# coding: ascii\n\N{SNOWMAN}".encode('utf-8')
- try:
+ with self.assertRaises(SyntaxError) as c:
compile(input, "<string>", "exec")
- except SyntaxError as e:
- expected = "'ascii' codec can't decode byte 0xe2 in position 16: " \
- "ordinal not in range(128)"
- self.assertTrue(str(e).startswith(expected))
- else:
- self.fail("didn't raise")
+ expected = "'ascii' codec can't decode byte 0xe2 in position 16: " \
+ "ordinal not in range(128)"
+ self.assertTrue(c.exception.args[0].startswith(expected))
+
def test_main():
test.support.run_unittest(CodingTest)
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 3d6ad09170..2b7b68be88 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -3,13 +3,14 @@
import unittest, doctest, operator
import inspect
from test import support
-from collections import namedtuple, Counter, OrderedDict
+from collections import namedtuple, Counter, OrderedDict, _count_elements
from test import mapping_tests
import pickle, copy
from random import randrange, shuffle
-import operator
import keyword
import re
+import sys
+from collections import _ChainMap
from collections import Hashable, Iterable, Iterator
from collections import Sized, Container, Callable
from collections import Set, MutableSet
@@ -17,6 +18,105 @@ from collections import Mapping, MutableMapping, KeysView, ItemsView, UserDict
from collections import Sequence, MutableSequence
from collections import ByteString
+
+################################################################################
+### _ChainMap (helper class for configparser)
+################################################################################
+
+ChainMap = _ChainMap # rename to keep test code in sync with 3.3 version
+
+class TestChainMap(unittest.TestCase):
+
+ def test_basics(self):
+ c = ChainMap()
+ c['a'] = 1
+ c['b'] = 2
+ d = c.new_child()
+ d['b'] = 20
+ d['c'] = 30
+ self.assertEqual(d.maps, [{'b':20, 'c':30}, {'a':1, 'b':2}]) # check internal state
+ self.assertEqual(d.items(), dict(a=1, b=20, c=30).items()) # check items/iter/getitem
+ self.assertEqual(len(d), 3) # check len
+ for key in 'abc': # check contains
+ self.assertIn(key, d)
+ for k, v in dict(a=1, b=20, c=30, z=100).items(): # check get
+ self.assertEqual(d.get(k, 100), v)
+
+ del d['b'] # unmask a value
+ self.assertEqual(d.maps, [{'c':30}, {'a':1, 'b':2}]) # check internal state
+ self.assertEqual(d.items(), dict(a=1, b=2, c=30).items()) # check items/iter/getitem
+ self.assertEqual(len(d), 3) # check len
+ for key in 'abc': # check contains
+ self.assertIn(key, d)
+ for k, v in dict(a=1, b=2, c=30, z=100).items(): # check get
+ self.assertEqual(d.get(k, 100), v)
+ self.assertIn(repr(d), [ # check repr
+ type(d).__name__ + "({'c': 30}, {'a': 1, 'b': 2})",
+ type(d).__name__ + "({'c': 30}, {'b': 2, 'a': 1})"
+ ])
+
+ for e in d.copy(), copy.copy(d): # check shallow copies
+ self.assertEqual(d, e)
+ self.assertEqual(d.maps, e.maps)
+ self.assertIsNot(d, e)
+ self.assertIsNot(d.maps[0], e.maps[0])
+ for m1, m2 in zip(d.maps[1:], e.maps[1:]):
+ self.assertIs(m1, m2)
+
+ for e in [pickle.loads(pickle.dumps(d)),
+ copy.deepcopy(d),
+ eval(repr(d))
+ ]: # check deep copies
+ self.assertEqual(d, e)
+ self.assertEqual(d.maps, e.maps)
+ self.assertIsNot(d, e)
+ for m1, m2 in zip(d.maps, e.maps):
+ self.assertIsNot(m1, m2, e)
+
+ f = d.new_child()
+ f['b'] = 5
+ self.assertEqual(f.maps, [{'b': 5}, {'c':30}, {'a':1, 'b':2}])
+ self.assertEqual(f.parents.maps, [{'c':30}, {'a':1, 'b':2}]) # check parents
+ self.assertEqual(f['b'], 5) # find first in chain
+ self.assertEqual(f.parents['b'], 2) # look beyond maps[0]
+
+ def test_contructor(self):
+ self.assertEqual(ChainMap().maps, [{}]) # no-args --> one new dict
+ self.assertEqual(ChainMap({1:2}).maps, [{1:2}]) # 1 arg --> list
+
+ def test_bool(self):
+ self.assertFalse(ChainMap())
+ self.assertFalse(ChainMap({}, {}))
+ self.assertTrue(ChainMap({1:2}, {}))
+ self.assertTrue(ChainMap({}, {1:2}))
+
+ def test_missing(self):
+ class DefaultChainMap(ChainMap):
+ def __missing__(self, key):
+ return 999
+ d = DefaultChainMap(dict(a=1, b=2), dict(b=20, c=30))
+ for k, v in dict(a=1, b=2, c=30, d=999).items():
+ self.assertEqual(d[k], v) # check __getitem__ w/missing
+ for k, v in dict(a=1, b=2, c=30, d=77).items():
+ self.assertEqual(d.get(k, 77), v) # check get() w/ missing
+ for k, v in dict(a=True, b=True, c=True, d=False).items():
+ self.assertEqual(k in d, v) # check __contains__ w/missing
+ self.assertEqual(d.pop('a', 1001), 1, d)
+ self.assertEqual(d.pop('a', 1002), 1002) # check pop() w/missing
+ self.assertEqual(d.popitem(), ('b', 2)) # check popitem() w/missing
+ with self.assertRaises(KeyError):
+ d.popitem()
+
+ def test_dict_coercion(self):
+ d = ChainMap(dict(a=1, b=2), dict(b=20, c=30))
+ self.assertEqual(dict(d), dict(a=1, b=2, c=30))
+ self.assertEqual(dict(d.items()), dict(a=1, b=2, c=30))
+
+
+################################################################################
+### Named Tuples
+################################################################################
+
TestNT = namedtuple('TestNT', 'x y z') # type used for pickle tests
class TestNamedTuple(unittest.TestCase):
@@ -24,7 +124,6 @@ class TestNamedTuple(unittest.TestCase):
def test_factory(self):
Point = namedtuple('Point', 'x y')
self.assertEqual(Point.__name__, 'Point')
- self.assertEqual(Point.__doc__, 'Point(x, y)')
self.assertEqual(Point.__slots__, ())
self.assertEqual(Point.__module__, __name__)
self.assertEqual(Point.__getitem__, tuple.__getitem__)
@@ -44,13 +143,19 @@ class TestNamedTuple(unittest.TestCase):
namedtuple('_', 'a b c') # Test leading underscores in a typename
nt = namedtuple('nt', 'the quick brown fox') # check unicode input
- self.assertTrue("u'" not in repr(nt._fields))
+ self.assertNotIn("u'", repr(nt._fields))
nt = namedtuple('nt', ('the', 'quick')) # check unicode input
- self.assertTrue("u'" not in repr(nt._fields))
+ self.assertNotIn("u'", repr(nt._fields))
self.assertRaises(TypeError, Point._make, [11]) # catch too few args
self.assertRaises(TypeError, Point._make, [11, 22, 33]) # catch too many args
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_factory_doc_attr(self):
+ Point = namedtuple('Point', 'x y')
+ self.assertEqual(Point.__doc__, 'Point(x, y)')
+
def test_name_fixer(self):
for spec, renamed in [
[('efg', 'g%hi'), ('efg', '_1')], # field with non-alpha char
@@ -75,8 +180,8 @@ class TestNamedTuple(unittest.TestCase):
self.assertRaises(TypeError, eval, 'Point(XXX=1, y=2)', locals()) # wrong keyword argument
self.assertRaises(TypeError, eval, 'Point(x=1)', locals()) # missing keyword argument
self.assertEqual(repr(p), 'Point(x=11, y=22)')
- self.assertTrue('__dict__' not in dir(p)) # verify instance has no dict
- self.assertTrue('__weakref__' not in dir(p))
+ self.assertNotIn('__dict__', dir(p)) # verify instance has no dict
+ self.assertNotIn('__weakref__', dir(p))
self.assertEqual(p, Point._make([11, 22])) # test _make classmethod
self.assertEqual(p._fields, ('x', 'y')) # test _fields attribute
self.assertEqual(p._replace(x=1), (1, 22)) # test _replace method
@@ -103,7 +208,7 @@ class TestNamedTuple(unittest.TestCase):
Point = namedtuple('Point', 'x y')
p = Point(11, 22)
- self.assertTrue(isinstance(p, tuple))
+ self.assertIsInstance(p, tuple)
self.assertEqual(p, (11, 22)) # matches a real tuple
self.assertEqual(tuple(p), (11, 22)) # coercable to a real tuple
self.assertEqual(list(p), [11, 22]) # coercable to a list
@@ -213,6 +318,20 @@ class TestNamedTuple(unittest.TestCase):
# test __getnewargs__
self.assertEqual(t.__getnewargs__(), values)
+ def test_repr(self):
+ with support.captured_stdout() as template:
+ A = namedtuple('A', 'x', verbose=True)
+ self.assertEqual(repr(A(1)), 'A(x=1)')
+ # repr should show the name of the subclass
+ class B(A):
+ pass
+ self.assertEqual(repr(B(1)), 'B(x=1)')
+
+
+################################################################################
+### Abstract Base Classes
+################################################################################
+
class ABCTestCase(unittest.TestCase):
def validate_abstract_methods(self, abc, *names):
@@ -229,6 +348,17 @@ class ABCTestCase(unittest.TestCase):
C = type('C', (abc,), stubs)
self.assertRaises(TypeError, C, name)
+ def validate_isinstance(self, abc, name):
+ stub = lambda s, *args: 0
+
+ C = type('C', (object,), {'__hash__': None})
+ setattr(C, name, stub)
+ self.assertIsInstance(C(), abc)
+ self.assertTrue(issubclass(C, abc))
+
+ C = type('C', (object,), {'__hash__': None})
+ self.assertNotIsInstance(C(), abc)
+ self.assertFalse(issubclass(C, abc))
def validate_comparison(self, instance):
ops = ['lt', 'gt', 'le', 'ge', 'ne', 'or', 'and', 'xor', 'sub']
@@ -267,7 +397,7 @@ class TestOneTrickPonyABCs(ABCTestCase):
# Check some non-hashables
non_samples = [bytearray(), list(), set(), dict()]
for x in non_samples:
- self.assertFalse(isinstance(x, Hashable), repr(x))
+ self.assertNotIsInstance(x, Hashable)
self.assertFalse(issubclass(type(x), Hashable), repr(type(x)))
# Check some hashables
samples = [None,
@@ -277,7 +407,7 @@ class TestOneTrickPonyABCs(ABCTestCase):
int, list, object, type, bytes()
]
for x in samples:
- self.assertTrue(isinstance(x, Hashable), repr(x))
+ self.assertIsInstance(x, Hashable)
self.assertTrue(issubclass(type(x), Hashable), repr(type(x)))
self.assertRaises(TypeError, Hashable)
# Check direct subclassing
@@ -287,12 +417,13 @@ class TestOneTrickPonyABCs(ABCTestCase):
self.assertEqual(hash(H()), 0)
self.assertFalse(issubclass(int, H))
self.validate_abstract_methods(Hashable, '__hash__')
+ self.validate_isinstance(Hashable, '__hash__')
def test_Iterable(self):
# Check some non-iterables
non_samples = [None, 42, 3.14, 1j]
for x in non_samples:
- self.assertFalse(isinstance(x, Iterable), repr(x))
+ self.assertNotIsInstance(x, Iterable)
self.assertFalse(issubclass(type(x), Iterable), repr(type(x)))
# Check some iterables
samples = [bytes(), str(),
@@ -302,7 +433,7 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in samples:
- self.assertTrue(isinstance(x, Iterable), repr(x))
+ self.assertIsInstance(x, Iterable)
self.assertTrue(issubclass(type(x), Iterable), repr(type(x)))
# Check direct subclassing
class I(Iterable):
@@ -311,11 +442,12 @@ class TestOneTrickPonyABCs(ABCTestCase):
self.assertEqual(list(I()), [])
self.assertFalse(issubclass(str, I))
self.validate_abstract_methods(Iterable, '__iter__')
+ self.validate_isinstance(Iterable, '__iter__')
def test_Iterator(self):
non_samples = [None, 42, 3.14, 1j, b"", "", (), [], {}, set()]
for x in non_samples:
- self.assertFalse(isinstance(x, Iterator), repr(x))
+ self.assertNotIsInstance(x, Iterator)
self.assertFalse(issubclass(type(x), Iterator), repr(type(x)))
samples = [iter(bytes()), iter(str()),
iter(tuple()), iter(list()), iter(dict()),
@@ -326,7 +458,7 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in samples:
- self.assertTrue(isinstance(x, Iterator), repr(x))
+ self.assertIsInstance(x, Iterator)
self.assertTrue(issubclass(type(x), Iterator), repr(type(x)))
self.validate_abstract_methods(Iterator, '__next__', '__iter__')
@@ -335,7 +467,7 @@ class TestOneTrickPonyABCs(ABCTestCase):
def __next__(self):
yield 1
raise StopIteration
- self.assertFalse(isinstance(NextOnly(), Iterator))
+ self.assertNotIsInstance(NextOnly(), Iterator)
def test_Sized(self):
non_samples = [None, 42, 3.14, 1j,
@@ -343,16 +475,17 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in non_samples:
- self.assertFalse(isinstance(x, Sized), repr(x))
+ self.assertNotIsInstance(x, Sized)
self.assertFalse(issubclass(type(x), Sized), repr(type(x)))
samples = [bytes(), str(),
tuple(), list(), set(), frozenset(), dict(),
dict().keys(), dict().items(), dict().values(),
]
for x in samples:
- self.assertTrue(isinstance(x, Sized), repr(x))
+ self.assertIsInstance(x, Sized)
self.assertTrue(issubclass(type(x), Sized), repr(type(x)))
self.validate_abstract_methods(Sized, '__len__')
+ self.validate_isinstance(Sized, '__len__')
def test_Container(self):
non_samples = [None, 42, 3.14, 1j,
@@ -360,16 +493,17 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in non_samples:
- self.assertFalse(isinstance(x, Container), repr(x))
+ self.assertNotIsInstance(x, Container)
self.assertFalse(issubclass(type(x), Container), repr(type(x)))
samples = [bytes(), str(),
tuple(), list(), set(), frozenset(), dict(),
dict().keys(), dict().items(),
]
for x in samples:
- self.assertTrue(isinstance(x, Container), repr(x))
+ self.assertIsInstance(x, Container)
self.assertTrue(issubclass(type(x), Container), repr(type(x)))
self.validate_abstract_methods(Container, '__contains__')
+ self.validate_isinstance(Container, '__contains__')
def test_Callable(self):
non_samples = [None, 42, 3.14, 1j,
@@ -378,7 +512,7 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in non_samples:
- self.assertFalse(isinstance(x, Callable), repr(x))
+ self.assertNotIsInstance(x, Callable)
self.assertFalse(issubclass(type(x), Callable), repr(type(x)))
samples = [lambda: None,
type, int, object,
@@ -386,9 +520,10 @@ class TestOneTrickPonyABCs(ABCTestCase):
list.append, [].append,
]
for x in samples:
- self.assertTrue(isinstance(x, Callable), repr(x))
+ self.assertIsInstance(x, Callable)
self.assertTrue(issubclass(type(x), Callable), repr(type(x)))
self.validate_abstract_methods(Callable, '__call__')
+ self.validate_isinstance(Callable, '__call__')
def test_direct_subclassing(self):
for B in Hashable, Iterable, Iterator, Sized, Container, Callable:
@@ -433,7 +568,7 @@ class TestCollectionABCs(ABCTestCase):
def test_Set(self):
for sample in [set, frozenset]:
- self.assertTrue(isinstance(sample(), Set))
+ self.assertIsInstance(sample(), Set)
self.assertTrue(issubclass(sample, Set))
self.validate_abstract_methods(Set, '__contains__', '__iter__', '__len__')
class MySet(Set):
@@ -461,9 +596,9 @@ class TestCollectionABCs(ABCTestCase):
self.assertTrue(hash(a) == hash(b))
def test_MutableSet(self):
- self.assertTrue(isinstance(set(), MutableSet))
+ self.assertIsInstance(set(), MutableSet)
self.assertTrue(issubclass(set, MutableSet))
- self.assertFalse(isinstance(frozenset(), MutableSet))
+ self.assertNotIsInstance(frozenset(), MutableSet)
self.assertFalse(issubclass(frozenset, MutableSet))
self.validate_abstract_methods(MutableSet, '__contains__', '__iter__', '__len__',
'add', 'discard')
@@ -476,7 +611,7 @@ class TestCollectionABCs(ABCTestCase):
def test_issue_4920(self):
# MutableSet.pop() method did not work
- class MySet(collections.MutableSet):
+ class MySet(MutableSet):
__slots__=['__s']
def __init__(self,items=None):
if items is None:
@@ -518,11 +653,11 @@ class TestCollectionABCs(ABCTestCase):
def test_Mapping(self):
for sample in [dict]:
- self.assertTrue(isinstance(sample(), Mapping))
+ self.assertIsInstance(sample(), Mapping)
self.assertTrue(issubclass(sample, Mapping))
self.validate_abstract_methods(Mapping, '__contains__', '__iter__', '__len__',
'__getitem__')
- class MyMapping(collections.Mapping):
+ class MyMapping(Mapping):
def __len__(self):
return 0
def __getitem__(self, i):
@@ -533,7 +668,7 @@ class TestCollectionABCs(ABCTestCase):
def test_MutableMapping(self):
for sample in [dict]:
- self.assertTrue(isinstance(sample(), MutableMapping))
+ self.assertIsInstance(sample(), MutableMapping)
self.assertTrue(issubclass(sample, MutableMapping))
self.validate_abstract_methods(MutableMapping, '__contains__', '__iter__', '__len__',
'__getitem__', '__setitem__', '__delitem__')
@@ -542,15 +677,15 @@ class TestCollectionABCs(ABCTestCase):
# Test issue 9214
mymap = UserDict()
mymap['red'] = 5
- self.assertTrue(isinstance(mymap.keys(), Set))
- self.assertTrue(isinstance(mymap.keys(), KeysView))
- self.assertTrue(isinstance(mymap.items(), Set))
- self.assertTrue(isinstance(mymap.items(), ItemsView))
+ self.assertIsInstance(mymap.keys(), Set)
+ self.assertIsInstance(mymap.keys(), KeysView)
+ self.assertIsInstance(mymap.items(), Set)
+ self.assertIsInstance(mymap.items(), ItemsView)
mymap = UserDict()
mymap['red'] = 5
z = mymap.keys() | {'orange'}
- self.assertEqual(type(z), set)
+ self.assertIsInstance(z, set)
list(z)
mymap['blue'] = 7 # Shouldn't affect 'z'
self.assertEqual(sorted(z), ['orange', 'red'])
@@ -558,16 +693,16 @@ class TestCollectionABCs(ABCTestCase):
mymap = UserDict()
mymap['red'] = 5
z = mymap.items() | {('orange', 3)}
- self.assertEqual(type(z), set)
+ self.assertIsInstance(z, set)
list(z)
mymap['blue'] = 7 # Shouldn't affect 'z'
self.assertEqual(sorted(z), [('orange', 3), ('red', 5)])
def test_Sequence(self):
for sample in [tuple, list, bytes, str]:
- self.assertTrue(isinstance(sample(), Sequence))
+ self.assertIsInstance(sample(), Sequence)
self.assertTrue(issubclass(sample, Sequence))
- self.assertTrue(isinstance(range(10), Sequence))
+ self.assertIsInstance(range(10), Sequence)
self.assertTrue(issubclass(range, Sequence))
self.assertTrue(issubclass(str, Sequence))
self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__',
@@ -575,33 +710,38 @@ class TestCollectionABCs(ABCTestCase):
def test_ByteString(self):
for sample in [bytes, bytearray]:
- self.assertTrue(isinstance(sample(), ByteString))
+ self.assertIsInstance(sample(), ByteString)
self.assertTrue(issubclass(sample, ByteString))
for sample in [str, list, tuple]:
- self.assertFalse(isinstance(sample(), ByteString))
+ self.assertNotIsInstance(sample(), ByteString)
self.assertFalse(issubclass(sample, ByteString))
- self.assertFalse(isinstance(memoryview(b""), ByteString))
+ self.assertNotIsInstance(memoryview(b""), ByteString)
self.assertFalse(issubclass(memoryview, ByteString))
def test_MutableSequence(self):
for sample in [tuple, str, bytes]:
- self.assertFalse(isinstance(sample(), MutableSequence))
+ self.assertNotIsInstance(sample(), MutableSequence)
self.assertFalse(issubclass(sample, MutableSequence))
for sample in [list, bytearray]:
- self.assertTrue(isinstance(sample(), MutableSequence))
+ self.assertIsInstance(sample(), MutableSequence)
self.assertTrue(issubclass(sample, MutableSequence))
self.assertFalse(issubclass(str, MutableSequence))
self.validate_abstract_methods(MutableSequence, '__contains__', '__iter__',
'__len__', '__getitem__', '__setitem__', '__delitem__', 'insert')
+
+################################################################################
+### Counter
+################################################################################
+
class TestCounter(unittest.TestCase):
def test_basics(self):
c = Counter('abcaba')
self.assertEqual(c, Counter({'a':3 , 'b': 2, 'c': 1}))
self.assertEqual(c, Counter(a=3, b=2, c=1))
- self.assertTrue(isinstance(c, dict))
- self.assertTrue(isinstance(c, Mapping))
+ self.assertIsInstance(c, dict)
+ self.assertIsInstance(c, Mapping)
self.assertTrue(issubclass(Counter, dict))
self.assertTrue(issubclass(Counter, Mapping))
self.assertEqual(len(c), 3)
@@ -634,10 +774,10 @@ class TestCounter(unittest.TestCase):
self.assertEqual(c, dict(a=4, b=0, d=-2, e=-5, f=4))
self.assertEqual(''.join(sorted(c.elements())), 'aaaaffff')
self.assertEqual(c.pop('f'), 4)
- self.assertEqual('f' in c, False)
+ self.assertNotIn('f', c)
for i in range(3):
elem, cnt = c.popitem()
- self.assertEqual(elem in c, False)
+ self.assertNotIn(elem, c)
c.clear()
self.assertEqual(c, {})
self.assertEqual(repr(c), 'Counter()')
@@ -701,6 +841,7 @@ class TestCounter(unittest.TestCase):
c = Counter(a=10, b=-2, c=0)
for elem in c:
self.assertTrue(elem in c)
+ self.assertIn(elem, c)
def test_multiset_operations(self):
# Verify that adding a zero counter will strip zeros and negatives
@@ -741,6 +882,34 @@ class TestCounter(unittest.TestCase):
set_result = setop(set(p.elements()), set(q.elements()))
self.assertEqual(counter_result, dict.fromkeys(set_result, 1))
+ def test_subtract(self):
+ c = Counter(a=-5, b=0, c=5, d=10, e=15,g=40)
+ c.subtract(a=1, b=2, c=-3, d=10, e=20, f=30, h=-50)
+ self.assertEqual(c, Counter(a=-6, b=-2, c=8, d=0, e=-5, f=-30, g=40, h=50))
+ c = Counter(a=-5, b=0, c=5, d=10, e=15,g=40)
+ c.subtract(Counter(a=1, b=2, c=-3, d=10, e=20, f=30, h=-50))
+ self.assertEqual(c, Counter(a=-6, b=-2, c=8, d=0, e=-5, f=-30, g=40, h=50))
+ c = Counter('aaabbcd')
+ c.subtract('aaaabbcce')
+ self.assertEqual(c, Counter(a=-1, b=0, c=-1, d=1, e=-1))
+
+ def test_helper_function(self):
+ # two paths, one for real dicts and one for other mappings
+ elems = list('abracadabra')
+
+ d = dict()
+ _count_elements(d, elems)
+ self.assertEqual(d, {'a': 5, 'r': 2, 'b': 2, 'c': 1, 'd': 1})
+
+ m = OrderedDict()
+ _count_elements(m, elems)
+ self.assertEqual(m,
+ OrderedDict([('a', 5), ('b', 2), ('r', 2), ('c', 1), ('d', 1)]))
+
+
+################################################################################
+### OrderedDict
+################################################################################
class TestOrderedDict(unittest.TestCase):
@@ -802,7 +971,7 @@ class TestOrderedDict(unittest.TestCase):
[('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 7)])
def test_abc(self):
- self.assertTrue(isinstance(OrderedDict(), MutableMapping))
+ self.assertIsInstance(OrderedDict(), MutableMapping)
self.assertTrue(issubclass(OrderedDict, MutableMapping))
def test_clear(self):
@@ -817,7 +986,7 @@ class TestOrderedDict(unittest.TestCase):
pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
od = OrderedDict(pairs)
del od['a']
- self.assertTrue('a' not in od)
+ self.assertNotIn('a', od)
with self.assertRaises(KeyError):
del od['a']
self.assertEqual(list(od.items()), pairs[:2] + pairs[3:])
@@ -974,6 +1143,25 @@ class TestOrderedDict(unittest.TestCase):
od['a'] = 1
self.assertEqual(list(od.items()), [('b', 2), ('a', 1)])
+ def test_move_to_end(self):
+ od = OrderedDict.fromkeys('abcde')
+ self.assertEqual(list(od), list('abcde'))
+ od.move_to_end('c')
+ self.assertEqual(list(od), list('abdec'))
+ od.move_to_end('c', 0)
+ self.assertEqual(list(od), list('cabde'))
+ od.move_to_end('c', 0)
+ self.assertEqual(list(od), list('cabde'))
+ od.move_to_end('e')
+ self.assertEqual(list(od), list('cabde'))
+ with self.assertRaises(KeyError):
+ od.move_to_end('x')
+
+ def test_sizeof(self):
+ # Wimpy test: Just verify the reported size is larger than a regular dict
+ d = dict(a=1)
+ od = OrderedDict(**d)
+ self.assertGreater(sys.getsizeof(od), sys.getsizeof(d))
def test_override_update(self):
# Verify that subclasses can override update() without breaking __init__()
@@ -1001,12 +1189,16 @@ class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol):
self.assertRaises(KeyError, d.popitem)
+################################################################################
+### Run tests
+################################################################################
+
import doctest, collections
def test_main(verbose=None):
NamedTupleDocs = doctest.DocTestSuite(module=collections)
test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs,
- TestCollectionABCs, TestCounter,
+ TestCollectionABCs, TestCounter, TestChainMap,
TestOrderedDict, GeneralMappingTests, SubclassMappingTests]
support.run_unittest(*test_classes)
support.run_doctest(collections, verbose)
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 749a5517b1..58ef2979a0 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -5,6 +5,19 @@ from test import support
class TestSpecifics(unittest.TestCase):
+ def test_no_ending_newline(self):
+ compile("hi", "<test>", "exec")
+ compile("hi\r", "<test>", "exec")
+
+ def test_empty(self):
+ compile("", "<test>", "exec")
+
+ def test_other_newlines(self):
+ compile("\r\n", "<test>", "exec")
+ compile("\r", "<test>", "exec")
+ compile("hi\r\nstuff\r\ndef f():\n pass\r", "<test>", "exec")
+ compile("this_is\rreally_old_mac\rdef f():\n pass", "<test>", "exec")
+
def test_debug_assignment(self):
# catch assignments to __debug__
self.assertRaises(SyntaxError, compile, '__debug__ = 1', '?', 'single')
@@ -179,8 +192,8 @@ if 1:
self.fail("How many bits *does* this machine have???")
# Verify treatment of constant folding on -(sys.maxsize+1)
# i.e. -2147483648 on 32 bit platforms. Should return int, not long.
- self.assertTrue(isinstance(eval("%s" % (-sys.maxsize - 1)), int))
- self.assertTrue(isinstance(eval("%s" % (-sys.maxsize - 2)), int))
+ self.assertIsInstance(eval("%s" % (-sys.maxsize - 1)), int)
+ self.assertIsInstance(eval("%s" % (-sys.maxsize - 2)), int)
if sys.maxsize == 9223372036854775807:
def test_32_63_bit_values(self):
@@ -195,7 +208,7 @@ if 1:
for variable in self.test_32_63_bit_values.__code__.co_consts:
if variable is not None:
- self.assertTrue(isinstance(variable, int))
+ self.assertIsInstance(variable, int)
def test_sequence_unpacking_error(self):
# Verify sequence packing/unpacking with "or". SF bug #757818
@@ -213,6 +226,10 @@ if 1:
'(a, None) = 0, 0',
'for None in range(10): pass',
'def f(None): pass',
+ 'import None',
+ 'import x as None',
+ 'from x import None',
+ 'from x import y as None'
]
for stmt in stmts:
stmt += "\n"
@@ -275,6 +292,10 @@ if 1:
f1, f2 = f()
self.assertNotEqual(id(f1.__code__), id(f2.__code__))
+ def test_lambda_doc(self):
+ l = lambda: "foo"
+ self.assertIsNone(l.__doc__)
+
## def test_unicode_encoding(self):
## code = "# -*- coding: utf-8 -*-\npass\n"
## self.assertRaises(SyntaxError, compile, code, "tmp", "exec")
@@ -300,56 +321,56 @@ if 1:
d[1] += 1
self.assertEqual(d[1], 2)
del d[1]
- self.assertEqual(1 in d, False)
+ self.assertNotIn(1, d)
# Tuple of indices
d[1, 1] = 1
self.assertEqual(d[1, 1], 1)
d[1, 1] += 1
self.assertEqual(d[1, 1], 2)
del d[1, 1]
- self.assertEqual((1, 1) in d, False)
+ self.assertNotIn((1, 1), d)
# Simple slice
d[1:2] = 1
self.assertEqual(d[1:2], 1)
d[1:2] += 1
self.assertEqual(d[1:2], 2)
del d[1:2]
- self.assertEqual(slice(1, 2) in d, False)
+ self.assertNotIn(slice(1, 2), d)
# Tuple of simple slices
d[1:2, 1:2] = 1
self.assertEqual(d[1:2, 1:2], 1)
d[1:2, 1:2] += 1
self.assertEqual(d[1:2, 1:2], 2)
del d[1:2, 1:2]
- self.assertEqual((slice(1, 2), slice(1, 2)) in d, False)
+ self.assertNotIn((slice(1, 2), slice(1, 2)), d)
# Extended slice
d[1:2:3] = 1
self.assertEqual(d[1:2:3], 1)
d[1:2:3] += 1
self.assertEqual(d[1:2:3], 2)
del d[1:2:3]
- self.assertEqual(slice(1, 2, 3) in d, False)
+ self.assertNotIn(slice(1, 2, 3), d)
# Tuple of extended slices
d[1:2:3, 1:2:3] = 1
self.assertEqual(d[1:2:3, 1:2:3], 1)
d[1:2:3, 1:2:3] += 1
self.assertEqual(d[1:2:3, 1:2:3], 2)
del d[1:2:3, 1:2:3]
- self.assertEqual((slice(1, 2, 3), slice(1, 2, 3)) in d, False)
+ self.assertNotIn((slice(1, 2, 3), slice(1, 2, 3)), d)
# Ellipsis
d[...] = 1
self.assertEqual(d[...], 1)
d[...] += 1
self.assertEqual(d[...], 2)
del d[...]
- self.assertEqual(Ellipsis in d, False)
+ self.assertNotIn(Ellipsis, d)
# Tuple of Ellipses
d[..., ...] = 1
self.assertEqual(d[..., ...], 1)
d[..., ...] += 1
self.assertEqual(d[..., ...], 2)
del d[..., ...]
- self.assertEqual((Ellipsis, Ellipsis) in d, False)
+ self.assertNotIn((Ellipsis, Ellipsis), d)
def test_annotation_limit(self):
# 16 bits are available for # of annotations, but only 8 bits are
@@ -372,10 +393,10 @@ if 1:
import __mangled_mod
import __package__.module
- self.assertTrue("_A__mangled" in A.f.__code__.co_varnames)
- self.assertTrue("__not_mangled__" in A.f.__code__.co_varnames)
- self.assertTrue("_A__mangled_mod" in A.f.__code__.co_varnames)
- self.assertTrue("__package__" in A.f.__code__.co_varnames)
+ self.assertIn("_A__mangled", A.f.__code__.co_varnames)
+ self.assertIn("__not_mangled__", A.f.__code__.co_varnames)
+ self.assertIn("_A__mangled_mod", A.f.__code__.co_varnames)
+ self.assertIn("__package__", A.f.__code__.co_varnames)
def test_compile_ast(self):
fname = __file__
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
index fe1dcf7a72..c1dfdb376f 100644
--- a/Lib/test/test_compileall.py
+++ b/Lib/test/test_compileall.py
@@ -5,22 +5,29 @@ import os
import py_compile
import shutil
import struct
-import sys
+import subprocess
import tempfile
import time
-from test import support
import unittest
import io
+from test import support, script_helper
class CompileallTests(unittest.TestCase):
def setUp(self):
self.directory = tempfile.mkdtemp()
self.source_path = os.path.join(self.directory, '_test.py')
- self.bc_path = self.source_path + ('c' if __debug__ else 'o')
+ self.bc_path = imp.cache_from_source(self.source_path)
with open(self.source_path, 'w') as file:
file.write('x = 123\n')
+ self.source_path2 = os.path.join(self.directory, '_test2.py')
+ self.bc_path2 = imp.cache_from_source(self.source_path2)
+ shutil.copyfile(self.source_path, self.source_path2)
+ self.subdirectory = os.path.join(self.directory, '_subdir')
+ os.mkdir(self.subdirectory)
+ self.source_path3 = os.path.join(self.subdirectory, '_test3.py')
+ shutil.copyfile(self.source_path, self.source_path3)
def tearDown(self):
shutil.rmtree(self.directory)
@@ -56,9 +63,54 @@ class CompileallTests(unittest.TestCase):
# Test a change in mtime leads to a new .pyc.
self.recreation_check(b'\0\0\0\0')
+ def test_compile_files(self):
+ # Test compiling a single file, and complete directory
+ for fn in (self.bc_path, self.bc_path2):
+ try:
+ os.unlink(fn)
+ except:
+ pass
+ compileall.compile_file(self.source_path, force=False, quiet=True)
+ self.assertTrue(os.path.isfile(self.bc_path) and
+ not os.path.isfile(self.bc_path2))
+ os.unlink(self.bc_path)
+ compileall.compile_dir(self.directory, force=False, quiet=True)
+ self.assertTrue(os.path.isfile(self.bc_path) and
+ os.path.isfile(self.bc_path2))
+ os.unlink(self.bc_path)
+ os.unlink(self.bc_path2)
+
+ def test_no_pycache_in_non_package(self):
+ # Bug 8563 reported that __pycache__ directories got created by
+ # compile_file() for non-.py files.
+ data_dir = os.path.join(self.directory, 'data')
+ data_file = os.path.join(data_dir, 'file')
+ os.mkdir(data_dir)
+ # touch data/file
+ with open(data_file, 'w'):
+ pass
+ compileall.compile_file(data_file)
+ self.assertFalse(os.path.exists(os.path.join(data_dir, '__pycache__')))
+
+ def test_optimize(self):
+ # make sure compiling with different optimization settings than the
+ # interpreter's creates the correct file names
+ optimize = 1 if __debug__ else 0
+ compileall.compile_dir(self.directory, quiet=True, optimize=optimize)
+ cached = imp.cache_from_source(self.source_path,
+ debug_override=not optimize)
+ self.assertTrue(os.path.isfile(cached))
+ cached2 = imp.cache_from_source(self.source_path2,
+ debug_override=not optimize)
+ self.assertTrue(os.path.isfile(cached2))
+ cached3 = imp.cache_from_source(self.source_path3,
+ debug_override=not optimize)
+ self.assertTrue(os.path.isfile(cached3))
+
class EncodingTest(unittest.TestCase):
- 'Issue 6716: compileall should escape source code when printing errors to stdout.'
+ """Issue 6716: compileall should escape source code when printing errors
+ to stdout."""
def setUp(self):
self.directory = tempfile.mkdtemp()
@@ -78,9 +130,230 @@ class EncodingTest(unittest.TestCase):
finally:
sys.stdout = orig_stdout
+
+class CommandLineTests(unittest.TestCase):
+ """Test compileall's CLI."""
+
+ def assertRunOK(self, *args, **env_vars):
+ rc, out, err = script_helper.assert_python_ok(
+ '-S', '-m', 'compileall', *args, **env_vars)
+ self.assertEqual(b'', err)
+ return out
+
+ def assertRunNotOK(self, *args, **env_vars):
+ rc, out, err = script_helper.assert_python_failure(
+ '-S', '-m', 'compileall', *args, **env_vars)
+ return rc, out, err
+
+ def assertCompiled(self, fn):
+ self.assertTrue(os.path.exists(imp.cache_from_source(fn)))
+
+ def assertNotCompiled(self, fn):
+ self.assertFalse(os.path.exists(imp.cache_from_source(fn)))
+
+ def setUp(self):
+ self.addCleanup(self._cleanup)
+ self.directory = tempfile.mkdtemp()
+ self.pkgdir = os.path.join(self.directory, 'foo')
+ os.mkdir(self.pkgdir)
+ self.pkgdir_cachedir = os.path.join(self.pkgdir, '__pycache__')
+ # Create the __init__.py and a package module.
+ self.initfn = script_helper.make_script(self.pkgdir, '__init__', '')
+ self.barfn = script_helper.make_script(self.pkgdir, 'bar', '')
+
+ def _cleanup(self):
+ support.rmtree(self.directory)
+
+ def test_no_args_compiles_path(self):
+ # Note that -l is implied for the no args case.
+ bazfn = script_helper.make_script(self.directory, 'baz', '')
+ self.assertRunOK(PYTHONPATH=self.directory)
+ self.assertCompiled(bazfn)
+ self.assertNotCompiled(self.initfn)
+ self.assertNotCompiled(self.barfn)
+
+ # Ensure that the default behavior of compileall's CLI is to create
+ # PEP 3147 pyc/pyo files.
+ for name, ext, switch in [
+ ('normal', 'pyc', []),
+ ('optimize', 'pyo', ['-O']),
+ ('doubleoptimize', 'pyo', ['-OO']),
+ ]:
+ def f(self, ext=ext, switch=switch):
+ script_helper.assert_python_ok(*(switch +
+ ['-m', 'compileall', '-q', self.pkgdir]))
+ # Verify the __pycache__ directory contents.
+ self.assertTrue(os.path.exists(self.pkgdir_cachedir))
+ expected = sorted(base.format(imp.get_tag(), ext) for base in
+ ('__init__.{}.{}', 'bar.{}.{}'))
+ self.assertEqual(sorted(os.listdir(self.pkgdir_cachedir)), expected)
+ # Make sure there are no .pyc files in the source directory.
+ self.assertFalse([fn for fn in os.listdir(self.pkgdir)
+ if fn.endswith(ext)])
+ locals()['test_pep3147_paths_' + name] = f
+
+ def test_legacy_paths(self):
+ # Ensure that with the proper switch, compileall leaves legacy
+ # pyc/pyo files, and no __pycache__ directory.
+ self.assertRunOK('-b', '-q', self.pkgdir)
+ # Verify the __pycache__ directory contents.
+ self.assertFalse(os.path.exists(self.pkgdir_cachedir))
+ expected = sorted(['__init__.py', '__init__.pyc', 'bar.py', 'bar.pyc'])
+ self.assertEqual(sorted(os.listdir(self.pkgdir)), expected)
+
+ def test_multiple_runs(self):
+ # Bug 8527 reported that multiple calls produced empty
+ # __pycache__/__pycache__ directories.
+ self.assertRunOK('-q', self.pkgdir)
+ # Verify the __pycache__ directory contents.
+ self.assertTrue(os.path.exists(self.pkgdir_cachedir))
+ cachecachedir = os.path.join(self.pkgdir_cachedir, '__pycache__')
+ self.assertFalse(os.path.exists(cachecachedir))
+ # Call compileall again.
+ self.assertRunOK('-q', self.pkgdir)
+ self.assertTrue(os.path.exists(self.pkgdir_cachedir))
+ self.assertFalse(os.path.exists(cachecachedir))
+
+ def test_force(self):
+ self.assertRunOK('-q', self.pkgdir)
+ pycpath = imp.cache_from_source(self.barfn)
+ # set atime/mtime backward to avoid file timestamp resolution issues
+ os.utime(pycpath, (time.time()-60,)*2)
+ mtime = os.stat(pycpath).st_mtime
+ # without force, no recompilation
+ self.assertRunOK('-q', self.pkgdir)
+ mtime2 = os.stat(pycpath).st_mtime
+ self.assertEqual(mtime, mtime2)
+ # now force it.
+ self.assertRunOK('-q', '-f', self.pkgdir)
+ mtime2 = os.stat(pycpath).st_mtime
+ self.assertNotEqual(mtime, mtime2)
+
+ def test_recursion_control(self):
+ subpackage = os.path.join(self.pkgdir, 'spam')
+ os.mkdir(subpackage)
+ subinitfn = script_helper.make_script(subpackage, '__init__', '')
+ hamfn = script_helper.make_script(subpackage, 'ham', '')
+ self.assertRunOK('-q', '-l', self.pkgdir)
+ self.assertNotCompiled(subinitfn)
+ self.assertFalse(os.path.exists(os.path.join(subpackage, '__pycache__')))
+ self.assertRunOK('-q', self.pkgdir)
+ self.assertCompiled(subinitfn)
+ self.assertCompiled(hamfn)
+
+ def test_quiet(self):
+ noisy = self.assertRunOK(self.pkgdir)
+ quiet = self.assertRunOK('-q', self.pkgdir)
+ self.assertNotEqual(b'', noisy)
+ self.assertEqual(b'', quiet)
+
+ def test_regexp(self):
+ self.assertRunOK('-q', '-x', 'ba[^\/]*$', self.pkgdir)
+ self.assertNotCompiled(self.barfn)
+ self.assertCompiled(self.initfn)
+
+ def test_multiple_dirs(self):
+ pkgdir2 = os.path.join(self.directory, 'foo2')
+ os.mkdir(pkgdir2)
+ init2fn = script_helper.make_script(pkgdir2, '__init__', '')
+ bar2fn = script_helper.make_script(pkgdir2, 'bar2', '')
+ self.assertRunOK('-q', self.pkgdir, pkgdir2)
+ self.assertCompiled(self.initfn)
+ self.assertCompiled(self.barfn)
+ self.assertCompiled(init2fn)
+ self.assertCompiled(bar2fn)
+
+ def test_d_takes_exactly_one_dir(self):
+ rc, out, err = self.assertRunNotOK('-d', 'foo')
+ self.assertEqual(out, b'')
+ self.assertRegex(err, b'-d')
+ rc, out, err = self.assertRunNotOK('-d', 'foo', 'bar')
+ self.assertEqual(out, b'')
+ self.assertRegex(err, b'-d')
+
+ def test_d_compile_error(self):
+ script_helper.make_script(self.pkgdir, 'crunchyfrog', 'bad(syntax')
+ rc, out, err = self.assertRunNotOK('-q', '-d', 'dinsdale', self.pkgdir)
+ self.assertRegex(out, b'File "dinsdale')
+
+ def test_d_runtime_error(self):
+ bazfn = script_helper.make_script(self.pkgdir, 'baz', 'raise Exception')
+ self.assertRunOK('-q', '-d', 'dinsdale', self.pkgdir)
+ fn = script_helper.make_script(self.pkgdir, 'bing', 'import baz')
+ pyc = imp.cache_from_source(bazfn)
+ os.rename(pyc, os.path.join(self.pkgdir, 'baz.pyc'))
+ os.remove(bazfn)
+ rc, out, err = script_helper.assert_python_failure(fn)
+ self.assertRegex(err, b'File "dinsdale')
+
+ def test_include_bad_file(self):
+ rc, out, err = self.assertRunNotOK(
+ '-i', os.path.join(self.directory, 'nosuchfile'), self.pkgdir)
+ self.assertRegex(out, b'rror.*nosuchfile')
+ self.assertNotRegex(err, b'Traceback')
+ self.assertFalse(os.path.exists(imp.cache_from_source(
+ self.pkgdir_cachedir)))
+
+ def test_include_file_with_arg(self):
+ f1 = script_helper.make_script(self.pkgdir, 'f1', '')
+ f2 = script_helper.make_script(self.pkgdir, 'f2', '')
+ f3 = script_helper.make_script(self.pkgdir, 'f3', '')
+ f4 = script_helper.make_script(self.pkgdir, 'f4', '')
+ with open(os.path.join(self.directory, 'l1'), 'w') as l1:
+ l1.write(os.path.join(self.pkgdir, 'f1.py')+os.linesep)
+ l1.write(os.path.join(self.pkgdir, 'f2.py')+os.linesep)
+ self.assertRunOK('-i', os.path.join(self.directory, 'l1'), f4)
+ self.assertCompiled(f1)
+ self.assertCompiled(f2)
+ self.assertNotCompiled(f3)
+ self.assertCompiled(f4)
+
+ def test_include_file_no_arg(self):
+ f1 = script_helper.make_script(self.pkgdir, 'f1', '')
+ f2 = script_helper.make_script(self.pkgdir, 'f2', '')
+ f3 = script_helper.make_script(self.pkgdir, 'f3', '')
+ f4 = script_helper.make_script(self.pkgdir, 'f4', '')
+ with open(os.path.join(self.directory, 'l1'), 'w') as l1:
+ l1.write(os.path.join(self.pkgdir, 'f2.py')+os.linesep)
+ self.assertRunOK('-i', os.path.join(self.directory, 'l1'))
+ self.assertNotCompiled(f1)
+ self.assertCompiled(f2)
+ self.assertNotCompiled(f3)
+ self.assertNotCompiled(f4)
+
+ def test_include_on_stdin(self):
+ f1 = script_helper.make_script(self.pkgdir, 'f1', '')
+ f2 = script_helper.make_script(self.pkgdir, 'f2', '')
+ f3 = script_helper.make_script(self.pkgdir, 'f3', '')
+ f4 = script_helper.make_script(self.pkgdir, 'f4', '')
+ p = script_helper.spawn_python('-m', 'compileall', '-i', '-')
+ p.stdin.write((f3+os.linesep).encode('ascii'))
+ script_helper.kill_python(p)
+ self.assertNotCompiled(f1)
+ self.assertNotCompiled(f2)
+ self.assertCompiled(f3)
+ self.assertNotCompiled(f4)
+
+ def test_compiles_as_much_as_possible(self):
+ bingfn = script_helper.make_script(self.pkgdir, 'bing', 'syntax(error')
+ rc, out, err = self.assertRunNotOK('nosuchfile', self.initfn,
+ bingfn, self.barfn)
+ self.assertRegex(out, b'rror')
+ self.assertNotCompiled(bingfn)
+ self.assertCompiled(self.initfn)
+ self.assertCompiled(self.barfn)
+
+ def test_invalid_arg_produces_message(self):
+ out = self.assertRunOK('badfilename')
+ self.assertRegex(out, b"Can't list badfilename")
+
+
def test_main():
- support.run_unittest(CompileallTests,
- EncodingTest)
+ support.run_unittest(
+ CommandLineTests,
+ CompileallTests,
+ EncodingTest,
+ )
if __name__ == "__main__":
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index 5173494b59..6b34ddc0a6 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -1,8 +1,9 @@
-import unittest, os
+import unittest
from test import support
from random import random
from math import atan2, isnan, copysign
+import operator
INF = float("inf")
NAN = float("nan")
@@ -65,9 +66,6 @@ class ComplexTest(unittest.TestCase):
self.assertCloseAbs(x.real, y.real, eps)
self.assertCloseAbs(x.imag, y.imag, eps)
- def assertIs(self, a, b):
- self.assertTrue(a is b)
-
def check_div(self, x, y):
"""Compute complex z=x*y, and check that z/x==y and z/y==x."""
z = x * y
@@ -112,16 +110,47 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(TypeError, complex.__floordiv__, 3+0j, 0+0j)
def test_richcompare(self):
- self.assertRaises(OverflowError, complex.__eq__, 1+1j, 1<<10000)
- self.assertEqual(complex.__lt__(1+1j, None), NotImplemented)
+ self.assertIs(complex.__eq__(1+1j, 1<<10000), False)
+ self.assertIs(complex.__lt__(1+1j, None), NotImplemented)
self.assertIs(complex.__eq__(1+1j, 1+1j), True)
self.assertIs(complex.__eq__(1+1j, 2+2j), False)
self.assertIs(complex.__ne__(1+1j, 1+1j), False)
self.assertIs(complex.__ne__(1+1j, 2+2j), True)
- self.assertRaises(TypeError, complex.__lt__, 1+1j, 2+2j)
- self.assertRaises(TypeError, complex.__le__, 1+1j, 2+2j)
- self.assertRaises(TypeError, complex.__gt__, 1+1j, 2+2j)
- self.assertRaises(TypeError, complex.__ge__, 1+1j, 2+2j)
+ for i in range(1, 100):
+ f = i / 100.0
+ self.assertIs(complex.__eq__(f+0j, f), True)
+ self.assertIs(complex.__ne__(f+0j, f), False)
+ self.assertIs(complex.__eq__(complex(f, f), f), False)
+ self.assertIs(complex.__ne__(complex(f, f), f), True)
+ self.assertIs(complex.__lt__(1+1j, 2+2j), NotImplemented)
+ self.assertIs(complex.__le__(1+1j, 2+2j), NotImplemented)
+ self.assertIs(complex.__gt__(1+1j, 2+2j), NotImplemented)
+ self.assertIs(complex.__ge__(1+1j, 2+2j), NotImplemented)
+ self.assertRaises(TypeError, operator.lt, 1+1j, 2+2j)
+ self.assertRaises(TypeError, operator.le, 1+1j, 2+2j)
+ self.assertRaises(TypeError, operator.gt, 1+1j, 2+2j)
+ self.assertRaises(TypeError, operator.ge, 1+1j, 2+2j)
+ self.assertIs(operator.eq(1+1j, 1+1j), True)
+ self.assertIs(operator.eq(1+1j, 2+2j), False)
+ self.assertIs(operator.ne(1+1j, 1+1j), False)
+ self.assertIs(operator.ne(1+1j, 2+2j), True)
+
+ def test_richcompare_boundaries(self):
+ def check(n, deltas, is_equal, imag = 0.0):
+ for delta in deltas:
+ i = n + delta
+ z = complex(i, imag)
+ self.assertIs(complex.__eq__(z, i), is_equal(delta))
+ self.assertIs(complex.__ne__(z, i), not is_equal(delta))
+ # For IEEE-754 doubles the following should hold:
+ # x in [2 ** (52 + i), 2 ** (53 + i + 1)] -> x mod 2 ** i == 0
+ # where the interval is representable, of course.
+ for i in range(1, 10):
+ pow = 52 + i
+ mult = 2 ** i
+ check(2 ** pow, range(1, 101), lambda delta: delta % mult == 0)
+ check(2 ** pow, range(1, 101), lambda delta: False, float(i))
+ check(2 ** 53, range(-100, 0), lambda delta: True)
def test_mod(self):
# % is no longer supported on complex numbers
@@ -191,6 +220,7 @@ class ComplexTest(unittest.TestCase):
self.assertEqual(complex(NS(1+10j)), 1+10j)
self.assertRaises(TypeError, complex, OS(None))
self.assertRaises(TypeError, complex, NS(None))
+ self.assertRaises(TypeError, complex, {})
self.assertAlmostEqual(complex("1+10j"), 1+10j)
self.assertAlmostEqual(complex(10), 10+0j)
@@ -284,7 +314,6 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(ValueError, complex, "1+2j)")
self.assertRaises(ValueError, complex, "1+(2j)")
self.assertRaises(ValueError, complex, "(1+2j)123")
- self.assertRaises(ValueError, complex, "1"*500)
self.assertRaises(ValueError, complex, "x")
self.assertRaises(ValueError, complex, "1j+2")
self.assertRaises(ValueError, complex, "1e1ej")
@@ -295,6 +324,11 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(ValueError, complex, "1.11.1j")
self.assertRaises(ValueError, complex, "1e1.1j")
+ # check that complex accepts long unicode strings
+ self.assertEqual(type(complex("1"*500)), complex)
+ # check whitespace processing
+ self.assertEqual(complex('\N{EM SPACE}(\N{EN SPACE}1+1j ) '), 1+1j)
+
class EvilExc(Exception):
pass
@@ -347,28 +381,48 @@ class ComplexTest(unittest.TestCase):
for num in nums:
self.assertAlmostEqual((num.real**2 + num.imag**2) ** 0.5, abs(num))
- def test_repr(self):
- self.assertEqual(repr(1+6j), '(1+6j)')
- self.assertEqual(repr(1-6j), '(1-6j)')
+ def test_repr_str(self):
+ def test(v, expected, test_fn=self.assertEqual):
+ test_fn(repr(v), expected)
+ test_fn(str(v), expected)
+
+ test(1+6j, '(1+6j)')
+ test(1-6j, '(1-6j)')
- self.assertNotEqual(repr(-(1+0j)), '(-1+-0j)')
+ test(-(1+0j), '(-1+-0j)', test_fn=self.assertNotEqual)
+
+ test(complex(1., INF), "(1+infj)")
+ test(complex(1., -INF), "(1-infj)")
+ test(complex(INF, 1), "(inf+1j)")
+ test(complex(-INF, INF), "(-inf+infj)")
+ test(complex(NAN, 1), "(nan+1j)")
+ test(complex(1, NAN), "(1+nanj)")
+ test(complex(NAN, NAN), "(nan+nanj)")
+
+ test(complex(0, INF), "infj")
+ test(complex(0, -INF), "-infj")
+ test(complex(0, NAN), "nanj")
self.assertEqual(1-6j,complex(repr(1-6j)))
self.assertEqual(1+6j,complex(repr(1+6j)))
self.assertEqual(-6j,complex(repr(-6j)))
self.assertEqual(6j,complex(repr(6j)))
- self.assertEqual(repr(complex(1., INF)), "(1+infj)")
- self.assertEqual(repr(complex(1., -INF)), "(1-infj)")
- self.assertEqual(repr(complex(INF, 1)), "(inf+1j)")
- self.assertEqual(repr(complex(-INF, INF)), "(-inf+infj)")
- self.assertEqual(repr(complex(NAN, 1)), "(nan+1j)")
- self.assertEqual(repr(complex(1, NAN)), "(1+nanj)")
- self.assertEqual(repr(complex(NAN, NAN)), "(nan+nanj)")
+ @support.requires_IEEE_754
+ def test_negative_zero_repr_str(self):
+ def test(v, expected, test_fn=self.assertEqual):
+ test_fn(repr(v), expected)
+ test_fn(str(v), expected)
+
+ test(complex(0., 1.), "1j")
+ test(complex(-0., 1.), "(-0+1j)")
+ test(complex(0., -1.), "-1j")
+ test(complex(-0., -1.), "(-0-1j)")
- self.assertEqual(repr(complex(0, INF)), "infj")
- self.assertEqual(repr(complex(0, -INF)), "-infj")
- self.assertEqual(repr(complex(0, NAN)), "nanj")
+ test(complex(0., 0.), "0j")
+ test(complex(0., -0.), "-0j")
+ test(complex(-0., 0.), "(-0+0j)")
+ test(complex(-0., -0.), "(-0-0j)")
def test_neg(self):
self.assertEqual(-(1+6j), -1-6j)
@@ -387,10 +441,7 @@ class ComplexTest(unittest.TestCase):
finally:
if (fo is not None) and (not fo.closed):
fo.close()
- try:
- os.remove(support.TESTFN)
- except (OSError, IOError):
- pass
+ support.unlink(support.TESTFN)
def test_getnewargs(self):
self.assertEqual((1+2j).__getnewargs__(), (1.0, 2.0))
@@ -400,41 +451,36 @@ class ComplexTest(unittest.TestCase):
self.assertEqual(complex(0, INF).__getnewargs__(), (0.0, INF))
self.assertEqual(complex(INF, 0).__getnewargs__(), (INF, 0.0))
- if float.__getformat__("double").startswith("IEEE"):
- def test_plus_minus_0j(self):
- # test that -0j and 0j literals are not identified
- z1, z2 = 0j, -0j
- self.assertEqual(atan2(z1.imag, -1.), atan2(0., -1.))
- self.assertEqual(atan2(z2.imag, -1.), atan2(-0., -1.))
+ @support.requires_IEEE_754
+ def test_plus_minus_0j(self):
+ # test that -0j and 0j literals are not identified
+ z1, z2 = 0j, -0j
+ self.assertEqual(atan2(z1.imag, -1.), atan2(0., -1.))
+ self.assertEqual(atan2(z2.imag, -1.), atan2(-0., -1.))
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
+ @support.requires_IEEE_754
def test_negated_imaginary_literal(self):
z0 = -0j
z1 = -7j
z2 = -1e1000j
- # This behaviour is actually incorrect: the real part of a negated
- # imaginary literal should be -0.0, not 0.0. It's fixed in Python 3.2.
- # However, the behaviour is already out in the wild in Python 2.x and
- # Python <= 3.1.2, and it would be too disruptive to change it in a
- # bugfix release, so we call it a 'feature' of Python 3.1, and test to
- # ensure that the behaviour remains consistent across 3.1.x releases.
- self.assertFloatsAreIdentical(z0.real, 0.0)
+ # Note: In versions of Python < 3.2, a negated imaginary literal
+ # accidentally ended up with real part 0.0 instead of -0.0, thanks to a
+ # modification during CST -> AST translation (see issue #9011). That's
+ # fixed in Python 3.2.
+ self.assertFloatsAreIdentical(z0.real, -0.0)
self.assertFloatsAreIdentical(z0.imag, -0.0)
- self.assertFloatsAreIdentical(z1.real, 0.0)
+ self.assertFloatsAreIdentical(z1.real, -0.0)
self.assertFloatsAreIdentical(z1.imag, -7.0)
- self.assertFloatsAreIdentical(z2.real, 0.0)
+ self.assertFloatsAreIdentical(z2.real, -0.0)
self.assertFloatsAreIdentical(z2.imag, -INF)
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
+ @support.requires_IEEE_754
def test_overflow(self):
self.assertEqual(complex("1e500"), complex(INF, 0.0))
self.assertEqual(complex("-1e500j"), complex(0.0, -INF))
self.assertEqual(complex("-1e500+1.8e308j"), complex(-INF, INF))
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
+ @support.requires_IEEE_754
def test_repr_roundtrip(self):
vals = [0.0, 1e-500, 1e-315, 1e-200, 0.0123, 3.1415, 1e50, INF, NAN]
vals += [-v for v in vals]
@@ -529,8 +575,28 @@ class ComplexTest(unittest.TestCase):
self.assertEqual(format(1.5e21+3j, '^40,.2f'), ' 1,500,000,000,000,000,000,000.00+3.00j ')
self.assertEqual(format(1.5e21+3000j, ',.2f'), '1,500,000,000,000,000,000,000.00+3,000.00j')
- # alternate is invalid
- self.assertRaises(ValueError, (1.5+0.5j).__format__, '#f')
+ # Issue 7094: Alternate formatting (specified by #)
+ self.assertEqual(format(1+1j, '.0e'), '1e+00+1e+00j')
+ self.assertEqual(format(1+1j, '#.0e'), '1.e+00+1.e+00j')
+ self.assertEqual(format(1+1j, '.0f'), '1+1j')
+ self.assertEqual(format(1+1j, '#.0f'), '1.+1.j')
+ self.assertEqual(format(1.1+1.1j, 'g'), '1.1+1.1j')
+ self.assertEqual(format(1.1+1.1j, '#g'), '1.10000+1.10000j')
+
+ # Alternate doesn't make a difference for these, they format the same with or without it
+ self.assertEqual(format(1+1j, '.1e'), '1.0e+00+1.0e+00j')
+ self.assertEqual(format(1+1j, '#.1e'), '1.0e+00+1.0e+00j')
+ self.assertEqual(format(1+1j, '.1f'), '1.0+1.0j')
+ self.assertEqual(format(1+1j, '#.1f'), '1.0+1.0j')
+
+ # Misc. other alternate tests
+ self.assertEqual(format((-1.5+0.5j), '#f'), '-1.500000+0.500000j')
+ self.assertEqual(format((-1.5+0.5j), '#.0f'), '-2.+0.j')
+ self.assertEqual(format((-1.5+0.5j), '#e'), '-1.500000e+00+5.000000e-01j')
+ self.assertEqual(format((-1.5+0.5j), '#.0e'), '-2.e+00+5.e-01j')
+ self.assertEqual(format((-1.5+0.5j), '#g'), '-1.50000+0.500000j')
+ self.assertEqual(format((-1.5+0.5j), '.0g'), '-2+0.5j')
+ self.assertEqual(format((-1.5+0.5j), '#.0g'), '-2.+0.5j')
# zero padding is invalid
self.assertRaises(ValueError, (1.5+0.5j).__format__, '010f')
diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py
new file mode 100644
index 0000000000..2662af76cf
--- /dev/null
+++ b/Lib/test/test_concurrent_futures.py
@@ -0,0 +1,613 @@
+import test.support
+
+# Skip tests if _multiprocessing wasn't built.
+test.support.import_module('_multiprocessing')
+# Skip tests if sem_open implementation is broken.
+test.support.import_module('multiprocessing.synchronize')
+# import threading after _multiprocessing to raise a more revelant error
+# message: "No module named _multiprocessing". _multiprocessing is not compiled
+# without thread support.
+test.support.import_module('threading')
+
+from test.script_helper import assert_python_ok
+
+import sys
+import threading
+import time
+import unittest
+
+from concurrent import futures
+from concurrent.futures._base import (
+ PENDING, RUNNING, CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED, Future)
+import concurrent.futures.process
+
+
+def create_future(state=PENDING, exception=None, result=None):
+ f = Future()
+ f._state = state
+ f._exception = exception
+ f._result = result
+ return f
+
+
+PENDING_FUTURE = create_future(state=PENDING)
+RUNNING_FUTURE = create_future(state=RUNNING)
+CANCELLED_FUTURE = create_future(state=CANCELLED)
+CANCELLED_AND_NOTIFIED_FUTURE = create_future(state=CANCELLED_AND_NOTIFIED)
+EXCEPTION_FUTURE = create_future(state=FINISHED, exception=IOError())
+SUCCESSFUL_FUTURE = create_future(state=FINISHED, result=42)
+
+
+def mul(x, y):
+ return x * y
+
+
+def sleep_and_raise(t):
+ time.sleep(t)
+ raise Exception('this is an exception')
+
+def sleep_and_print(t, msg):
+ time.sleep(t)
+ print(msg)
+ sys.stdout.flush()
+
+
+class ExecutorMixin:
+ worker_count = 5
+
+ def setUp(self):
+ self.t1 = time.time()
+ try:
+ self.executor = self.executor_type(max_workers=self.worker_count)
+ except NotImplementedError as e:
+ self.skipTest(str(e))
+ self._prime_executor()
+
+ def tearDown(self):
+ self.executor.shutdown(wait=True)
+ dt = time.time() - self.t1
+ if test.support.verbose:
+ print("%.2fs" % dt, end=' ')
+ self.assertLess(dt, 60, "synchronization issue: test lasted too long")
+
+ def _prime_executor(self):
+ # Make sure that the executor is ready to do work before running the
+ # tests. This should reduce the probability of timeouts in the tests.
+ futures = [self.executor.submit(time.sleep, 0.1)
+ for _ in range(self.worker_count)]
+
+ for f in futures:
+ f.result()
+
+
+class ThreadPoolMixin(ExecutorMixin):
+ executor_type = futures.ThreadPoolExecutor
+
+
+class ProcessPoolMixin(ExecutorMixin):
+ executor_type = futures.ProcessPoolExecutor
+
+
+class ExecutorShutdownTest(unittest.TestCase):
+ def test_run_after_shutdown(self):
+ self.executor.shutdown()
+ self.assertRaises(RuntimeError,
+ self.executor.submit,
+ pow, 2, 5)
+
+ def test_interpreter_shutdown(self):
+ # Test the atexit hook for shutdown of worker threads and processes
+ rc, out, err = assert_python_ok('-c', """if 1:
+ from concurrent.futures import {executor_type}
+ from time import sleep
+ from test.test_concurrent_futures import sleep_and_print
+ t = {executor_type}(5)
+ t.submit(sleep_and_print, 1.0, "apple")
+ """.format(executor_type=self.executor_type.__name__))
+ # Errors in atexit hooks don't change the process exit code, check
+ # stderr manually.
+ self.assertFalse(err)
+ self.assertEqual(out.strip(), b"apple")
+
+
+class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest):
+ def _prime_executor(self):
+ pass
+
+ def test_threads_terminate(self):
+ self.executor.submit(mul, 21, 2)
+ self.executor.submit(mul, 6, 7)
+ self.executor.submit(mul, 3, 14)
+ self.assertEqual(len(self.executor._threads), 3)
+ self.executor.shutdown()
+ for t in self.executor._threads:
+ t.join()
+
+ def test_context_manager_shutdown(self):
+ with futures.ThreadPoolExecutor(max_workers=5) as e:
+ executor = e
+ self.assertEqual(list(e.map(abs, range(-5, 5))),
+ [5, 4, 3, 2, 1, 0, 1, 2, 3, 4])
+
+ for t in executor._threads:
+ t.join()
+
+ def test_del_shutdown(self):
+ executor = futures.ThreadPoolExecutor(max_workers=5)
+ executor.map(abs, range(-5, 5))
+ threads = executor._threads
+ del executor
+
+ for t in threads:
+ t.join()
+
+
+class ProcessPoolShutdownTest(ProcessPoolMixin, ExecutorShutdownTest):
+ def _prime_executor(self):
+ pass
+
+ def test_processes_terminate(self):
+ self.executor.submit(mul, 21, 2)
+ self.executor.submit(mul, 6, 7)
+ self.executor.submit(mul, 3, 14)
+ self.assertEqual(len(self.executor._processes), 5)
+ processes = self.executor._processes
+ self.executor.shutdown()
+
+ for p in processes:
+ p.join()
+
+ def test_context_manager_shutdown(self):
+ with futures.ProcessPoolExecutor(max_workers=5) as e:
+ processes = e._processes
+ self.assertEqual(list(e.map(abs, range(-5, 5))),
+ [5, 4, 3, 2, 1, 0, 1, 2, 3, 4])
+
+ for p in processes:
+ p.join()
+
+ def test_del_shutdown(self):
+ executor = futures.ProcessPoolExecutor(max_workers=5)
+ list(executor.map(abs, range(-5, 5)))
+ queue_management_thread = executor._queue_management_thread
+ processes = executor._processes
+ del executor
+
+ queue_management_thread.join()
+ for p in processes:
+ p.join()
+
+class WaitTests(unittest.TestCase):
+ def test_first_completed(self):
+ future1 = self.executor.submit(mul, 21, 2)
+ future2 = self.executor.submit(time.sleep, 1.5)
+
+ done, not_done = futures.wait(
+ [CANCELLED_FUTURE, future1, future2],
+ return_when=futures.FIRST_COMPLETED)
+
+ self.assertEqual(set([future1]), done)
+ self.assertEqual(set([CANCELLED_FUTURE, future2]), not_done)
+
+ def test_first_completed_some_already_completed(self):
+ future1 = self.executor.submit(time.sleep, 1.5)
+
+ finished, pending = futures.wait(
+ [CANCELLED_AND_NOTIFIED_FUTURE, SUCCESSFUL_FUTURE, future1],
+ return_when=futures.FIRST_COMPLETED)
+
+ self.assertEqual(
+ set([CANCELLED_AND_NOTIFIED_FUTURE, SUCCESSFUL_FUTURE]),
+ finished)
+ self.assertEqual(set([future1]), pending)
+
+ def test_first_exception(self):
+ future1 = self.executor.submit(mul, 2, 21)
+ future2 = self.executor.submit(sleep_and_raise, 1.5)
+ future3 = self.executor.submit(time.sleep, 3)
+
+ finished, pending = futures.wait(
+ [future1, future2, future3],
+ return_when=futures.FIRST_EXCEPTION)
+
+ self.assertEqual(set([future1, future2]), finished)
+ self.assertEqual(set([future3]), pending)
+
+ def test_first_exception_some_already_complete(self):
+ future1 = self.executor.submit(divmod, 21, 0)
+ future2 = self.executor.submit(time.sleep, 1.5)
+
+ finished, pending = futures.wait(
+ [SUCCESSFUL_FUTURE,
+ CANCELLED_FUTURE,
+ CANCELLED_AND_NOTIFIED_FUTURE,
+ future1, future2],
+ return_when=futures.FIRST_EXCEPTION)
+
+ self.assertEqual(set([SUCCESSFUL_FUTURE,
+ CANCELLED_AND_NOTIFIED_FUTURE,
+ future1]), finished)
+ self.assertEqual(set([CANCELLED_FUTURE, future2]), pending)
+
+ def test_first_exception_one_already_failed(self):
+ future1 = self.executor.submit(time.sleep, 2)
+
+ finished, pending = futures.wait(
+ [EXCEPTION_FUTURE, future1],
+ return_when=futures.FIRST_EXCEPTION)
+
+ self.assertEqual(set([EXCEPTION_FUTURE]), finished)
+ self.assertEqual(set([future1]), pending)
+
+ def test_all_completed(self):
+ future1 = self.executor.submit(divmod, 2, 0)
+ future2 = self.executor.submit(mul, 2, 21)
+
+ finished, pending = futures.wait(
+ [SUCCESSFUL_FUTURE,
+ CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ future1,
+ future2],
+ return_when=futures.ALL_COMPLETED)
+
+ self.assertEqual(set([SUCCESSFUL_FUTURE,
+ CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ future1,
+ future2]), finished)
+ self.assertEqual(set(), pending)
+
+ def test_timeout(self):
+ future1 = self.executor.submit(mul, 6, 7)
+ future2 = self.executor.submit(time.sleep, 3)
+
+ finished, pending = futures.wait(
+ [CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1, future2],
+ timeout=1.5,
+ return_when=futures.ALL_COMPLETED)
+
+ self.assertEqual(set([CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1]), finished)
+ self.assertEqual(set([future2]), pending)
+
+
+class ThreadPoolWaitTests(ThreadPoolMixin, WaitTests):
+ pass
+
+
+class ProcessPoolWaitTests(ProcessPoolMixin, WaitTests):
+ pass
+
+
+class AsCompletedTests(unittest.TestCase):
+ # TODO(brian@sweetapp.com): Should have a test with a non-zero timeout.
+ def test_no_timeout(self):
+ future1 = self.executor.submit(mul, 2, 21)
+ future2 = self.executor.submit(mul, 7, 6)
+
+ completed = set(futures.as_completed(
+ [CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1, future2]))
+ self.assertEqual(set(
+ [CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1, future2]),
+ completed)
+
+ def test_zero_timeout(self):
+ future1 = self.executor.submit(time.sleep, 2)
+ completed_futures = set()
+ try:
+ for future in futures.as_completed(
+ [CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1],
+ timeout=0):
+ completed_futures.add(future)
+ except futures.TimeoutError:
+ pass
+
+ self.assertEqual(set([CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE]),
+ completed_futures)
+
+
+class ThreadPoolAsCompletedTests(ThreadPoolMixin, AsCompletedTests):
+ pass
+
+
+class ProcessPoolAsCompletedTests(ProcessPoolMixin, AsCompletedTests):
+ pass
+
+
+class ExecutorTest(unittest.TestCase):
+ # Executor.shutdown() and context manager usage is tested by
+ # ExecutorShutdownTest.
+ def test_submit(self):
+ future = self.executor.submit(pow, 2, 8)
+ self.assertEqual(256, future.result())
+
+ def test_submit_keyword(self):
+ future = self.executor.submit(mul, 2, y=8)
+ self.assertEqual(16, future.result())
+
+ def test_map(self):
+ self.assertEqual(
+ list(self.executor.map(pow, range(10), range(10))),
+ list(map(pow, range(10), range(10))))
+
+ def test_map_exception(self):
+ i = self.executor.map(divmod, [1, 1, 1, 1], [2, 3, 0, 5])
+ self.assertEqual(i.__next__(), (0, 1))
+ self.assertEqual(i.__next__(), (0, 1))
+ self.assertRaises(ZeroDivisionError, i.__next__)
+
+ def test_map_timeout(self):
+ results = []
+ try:
+ for i in self.executor.map(time.sleep,
+ [0, 0, 3],
+ timeout=1.5):
+ results.append(i)
+ except futures.TimeoutError:
+ pass
+ else:
+ self.fail('expected TimeoutError')
+
+ self.assertEqual([None, None], results)
+
+
+class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest):
+ pass
+
+
+class ProcessPoolExecutorTest(ProcessPoolMixin, ExecutorTest):
+ pass
+
+
+class FutureTests(unittest.TestCase):
+ def test_done_callback_with_result(self):
+ callback_result = None
+ def fn(callback_future):
+ nonlocal callback_result
+ callback_result = callback_future.result()
+
+ f = Future()
+ f.add_done_callback(fn)
+ f.set_result(5)
+ self.assertEqual(5, callback_result)
+
+ def test_done_callback_with_exception(self):
+ callback_exception = None
+ def fn(callback_future):
+ nonlocal callback_exception
+ callback_exception = callback_future.exception()
+
+ f = Future()
+ f.add_done_callback(fn)
+ f.set_exception(Exception('test'))
+ self.assertEqual(('test',), callback_exception.args)
+
+ def test_done_callback_with_cancel(self):
+ was_cancelled = None
+ def fn(callback_future):
+ nonlocal was_cancelled
+ was_cancelled = callback_future.cancelled()
+
+ f = Future()
+ f.add_done_callback(fn)
+ self.assertTrue(f.cancel())
+ self.assertTrue(was_cancelled)
+
+ def test_done_callback_raises(self):
+ with test.support.captured_stderr() as stderr:
+ raising_was_called = False
+ fn_was_called = False
+
+ def raising_fn(callback_future):
+ nonlocal raising_was_called
+ raising_was_called = True
+ raise Exception('doh!')
+
+ def fn(callback_future):
+ nonlocal fn_was_called
+ fn_was_called = True
+
+ f = Future()
+ f.add_done_callback(raising_fn)
+ f.add_done_callback(fn)
+ f.set_result(5)
+ self.assertTrue(raising_was_called)
+ self.assertTrue(fn_was_called)
+ self.assertIn('Exception: doh!', stderr.getvalue())
+
+ def test_done_callback_already_successful(self):
+ callback_result = None
+ def fn(callback_future):
+ nonlocal callback_result
+ callback_result = callback_future.result()
+
+ f = Future()
+ f.set_result(5)
+ f.add_done_callback(fn)
+ self.assertEqual(5, callback_result)
+
+ def test_done_callback_already_failed(self):
+ callback_exception = None
+ def fn(callback_future):
+ nonlocal callback_exception
+ callback_exception = callback_future.exception()
+
+ f = Future()
+ f.set_exception(Exception('test'))
+ f.add_done_callback(fn)
+ self.assertEqual(('test',), callback_exception.args)
+
+ def test_done_callback_already_cancelled(self):
+ was_cancelled = None
+ def fn(callback_future):
+ nonlocal was_cancelled
+ was_cancelled = callback_future.cancelled()
+
+ f = Future()
+ self.assertTrue(f.cancel())
+ f.add_done_callback(fn)
+ self.assertTrue(was_cancelled)
+
+ def test_repr(self):
+ self.assertRegex(repr(PENDING_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=pending>')
+ self.assertRegex(repr(RUNNING_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=running>')
+ self.assertRegex(repr(CANCELLED_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=cancelled>')
+ self.assertRegex(repr(CANCELLED_AND_NOTIFIED_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=cancelled>')
+ self.assertRegex(
+ repr(EXCEPTION_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=finished raised IOError>')
+ self.assertRegex(
+ repr(SUCCESSFUL_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=finished returned int>')
+
+
+ def test_cancel(self):
+ f1 = create_future(state=PENDING)
+ f2 = create_future(state=RUNNING)
+ f3 = create_future(state=CANCELLED)
+ f4 = create_future(state=CANCELLED_AND_NOTIFIED)
+ f5 = create_future(state=FINISHED, exception=IOError())
+ f6 = create_future(state=FINISHED, result=5)
+
+ self.assertTrue(f1.cancel())
+ self.assertEqual(f1._state, CANCELLED)
+
+ self.assertFalse(f2.cancel())
+ self.assertEqual(f2._state, RUNNING)
+
+ self.assertTrue(f3.cancel())
+ self.assertEqual(f3._state, CANCELLED)
+
+ self.assertTrue(f4.cancel())
+ self.assertEqual(f4._state, CANCELLED_AND_NOTIFIED)
+
+ self.assertFalse(f5.cancel())
+ self.assertEqual(f5._state, FINISHED)
+
+ self.assertFalse(f6.cancel())
+ self.assertEqual(f6._state, FINISHED)
+
+ def test_cancelled(self):
+ self.assertFalse(PENDING_FUTURE.cancelled())
+ self.assertFalse(RUNNING_FUTURE.cancelled())
+ self.assertTrue(CANCELLED_FUTURE.cancelled())
+ self.assertTrue(CANCELLED_AND_NOTIFIED_FUTURE.cancelled())
+ self.assertFalse(EXCEPTION_FUTURE.cancelled())
+ self.assertFalse(SUCCESSFUL_FUTURE.cancelled())
+
+ def test_done(self):
+ self.assertFalse(PENDING_FUTURE.done())
+ self.assertFalse(RUNNING_FUTURE.done())
+ self.assertTrue(CANCELLED_FUTURE.done())
+ self.assertTrue(CANCELLED_AND_NOTIFIED_FUTURE.done())
+ self.assertTrue(EXCEPTION_FUTURE.done())
+ self.assertTrue(SUCCESSFUL_FUTURE.done())
+
+ def test_running(self):
+ self.assertFalse(PENDING_FUTURE.running())
+ self.assertTrue(RUNNING_FUTURE.running())
+ self.assertFalse(CANCELLED_FUTURE.running())
+ self.assertFalse(CANCELLED_AND_NOTIFIED_FUTURE.running())
+ self.assertFalse(EXCEPTION_FUTURE.running())
+ self.assertFalse(SUCCESSFUL_FUTURE.running())
+
+ def test_result_with_timeout(self):
+ self.assertRaises(futures.TimeoutError,
+ PENDING_FUTURE.result, timeout=0)
+ self.assertRaises(futures.TimeoutError,
+ RUNNING_FUTURE.result, timeout=0)
+ self.assertRaises(futures.CancelledError,
+ CANCELLED_FUTURE.result, timeout=0)
+ self.assertRaises(futures.CancelledError,
+ CANCELLED_AND_NOTIFIED_FUTURE.result, timeout=0)
+ self.assertRaises(IOError, EXCEPTION_FUTURE.result, timeout=0)
+ self.assertEqual(SUCCESSFUL_FUTURE.result(timeout=0), 42)
+
+ def test_result_with_success(self):
+ # TODO(brian@sweetapp.com): This test is timing dependant.
+ def notification():
+ # Wait until the main thread is waiting for the result.
+ time.sleep(1)
+ f1.set_result(42)
+
+ f1 = create_future(state=PENDING)
+ t = threading.Thread(target=notification)
+ t.start()
+
+ self.assertEqual(f1.result(timeout=5), 42)
+
+ def test_result_with_cancel(self):
+ # TODO(brian@sweetapp.com): This test is timing dependant.
+ def notification():
+ # Wait until the main thread is waiting for the result.
+ time.sleep(1)
+ f1.cancel()
+
+ f1 = create_future(state=PENDING)
+ t = threading.Thread(target=notification)
+ t.start()
+
+ self.assertRaises(futures.CancelledError, f1.result, timeout=5)
+
+ def test_exception_with_timeout(self):
+ self.assertRaises(futures.TimeoutError,
+ PENDING_FUTURE.exception, timeout=0)
+ self.assertRaises(futures.TimeoutError,
+ RUNNING_FUTURE.exception, timeout=0)
+ self.assertRaises(futures.CancelledError,
+ CANCELLED_FUTURE.exception, timeout=0)
+ self.assertRaises(futures.CancelledError,
+ CANCELLED_AND_NOTIFIED_FUTURE.exception, timeout=0)
+ self.assertTrue(isinstance(EXCEPTION_FUTURE.exception(timeout=0),
+ IOError))
+ self.assertEqual(SUCCESSFUL_FUTURE.exception(timeout=0), None)
+
+ def test_exception_with_success(self):
+ def notification():
+ # Wait until the main thread is waiting for the exception.
+ time.sleep(1)
+ with f1._condition:
+ f1._state = FINISHED
+ f1._exception = IOError()
+ f1._condition.notify_all()
+
+ f1 = create_future(state=PENDING)
+ t = threading.Thread(target=notification)
+ t.start()
+
+ self.assertTrue(isinstance(f1.exception(timeout=5), IOError))
+
+def test_main():
+ test.support.run_unittest(ProcessPoolExecutorTest,
+ ThreadPoolExecutorTest,
+ ProcessPoolWaitTests,
+ ThreadPoolWaitTests,
+ ProcessPoolAsCompletedTests,
+ ThreadPoolAsCompletedTests,
+ FutureTests,
+ ProcessPoolShutdownTest,
+ ThreadPoolShutdownTest)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_contains.py b/Lib/test/test_contains.py
index 622dfd46d1..a667a16d8c 100644
--- a/Lib/test/test_contains.py
+++ b/Lib/test/test_contains.py
@@ -20,19 +20,19 @@ class TestContains(unittest.TestCase):
a = base_set(1)
b = myset(1)
c = seq(1)
- self.assertTrue(1 in b)
- self.assertTrue(0 not in b)
- self.assertTrue(1 in c)
- self.assertTrue(0 not in c)
+ self.assertIn(1, b)
+ self.assertNotIn(0, b)
+ self.assertIn(1, c)
+ self.assertNotIn(0, c)
self.assertRaises(TypeError, lambda: 1 in a)
self.assertRaises(TypeError, lambda: 1 not in a)
# test char in string
- self.assertTrue('c' in 'abc')
- self.assertTrue('d' not in 'abc')
+ self.assertIn('c', 'abc')
+ self.assertNotIn('d', 'abc')
- self.assertTrue('' in '')
- self.assertTrue('' in 'abc')
+ self.assertIn('', '')
+ self.assertIn('', 'abc')
self.assertRaises(TypeError, lambda: None in 'abc')
@@ -40,15 +40,15 @@ class TestContains(unittest.TestCase):
# a collection of tests on builtin sequence types
a = range(10)
for i in a:
- self.assertTrue(i in a)
- self.assertTrue(16 not in a)
- self.assertTrue(a not in a)
+ self.assertIn(i, a)
+ self.assertNotIn(16, a)
+ self.assertNotIn(a, a)
a = tuple(a)
for i in a:
- self.assertTrue(i in a)
- self.assertTrue(16 not in a)
- self.assertTrue(a not in a)
+ self.assertIn(i, a)
+ self.assertNotIn(16, a)
+ self.assertNotIn(a, a)
class Deviant1:
"""Behaves strangely when compared
@@ -64,7 +64,7 @@ class TestContains(unittest.TestCase):
self.aList.remove(14)
return 0
- self.assertTrue(Deviant1() not in Deviant1.aList)
+ self.assertNotIn(Deviant1(), Deviant1.aList)
def test_nonreflexive(self):
# containment and equality tests involving elements that are
@@ -81,7 +81,7 @@ class TestContains(unittest.TestCase):
for constructor in constructors:
container = constructor(values)
for elem in container:
- self.assertTrue(elem in container)
+ self.assertIn(elem, container)
self.assertTrue(container == constructor(values))
self.assertTrue(container == container)
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py
index 015a0c5195..6e38305123 100644
--- a/Lib/test/test_contextlib.py
+++ b/Lib/test/test_contextlib.py
@@ -1,15 +1,15 @@
"""Unit tests for contextlib.py, and other context managers."""
-
import sys
-import os
-import decimal
import tempfile
import unittest
-import threading
from contextlib import * # Tests __all__
from test import support
-import warnings
+try:
+ import threading
+except ImportError:
+ threading = None
+
class ContextManagerTestCase(unittest.TestCase):
@@ -35,16 +35,12 @@ class ContextManagerTestCase(unittest.TestCase):
yield 42
finally:
state.append(999)
- try:
+ with self.assertRaises(ZeroDivisionError):
with woohoo() as x:
self.assertEqual(state, [1])
self.assertEqual(x, 42)
state.append(x)
raise ZeroDivisionError()
- except ZeroDivisionError:
- pass
- else:
- self.fail("Expected ZeroDivisionError")
self.assertEqual(state, [1, 42, 999])
def test_contextmanager_no_reraise(self):
@@ -86,7 +82,7 @@ class ContextManagerTestCase(unittest.TestCase):
raise ZeroDivisionError(999)
self.assertEqual(state, [1, 42, 999])
- def test_contextmanager_attribs(self):
+ def _create_contextmanager_attribs(self):
def attribs(**kw):
def decorate(func):
for k,v in kw.items():
@@ -97,131 +93,18 @@ class ContextManagerTestCase(unittest.TestCase):
@attribs(foo='bar')
def baz(spam):
"""Whee!"""
+ return baz
+
+ def test_contextmanager_attribs(self):
+ baz = self._create_contextmanager_attribs()
self.assertEqual(baz.__name__,'baz')
self.assertEqual(baz.foo, 'bar')
- self.assertEqual(baz.__doc__, "Whee!")
-
-class NestedTestCase(unittest.TestCase):
-
- # XXX This needs more work
-
- def test_nested(self):
- @contextmanager
- def a():
- yield 1
- @contextmanager
- def b():
- yield 2
- @contextmanager
- def c():
- yield 3
- with nested(a(), b(), c()) as (x, y, z):
- self.assertEqual(x, 1)
- self.assertEqual(y, 2)
- self.assertEqual(z, 3)
-
- def test_nested_cleanup(self):
- state = []
- @contextmanager
- def a():
- state.append(1)
- try:
- yield 2
- finally:
- state.append(3)
- @contextmanager
- def b():
- state.append(4)
- try:
- yield 5
- finally:
- state.append(6)
- try:
- with nested(a(), b()) as (x, y):
- state.append(x)
- state.append(y)
- 1/0
- except ZeroDivisionError:
- self.assertEqual(state, [1, 4, 2, 5, 6, 3])
- else:
- self.fail("Didn't raise ZeroDivisionError")
-
- def test_nested_right_exception(self):
- state = []
- @contextmanager
- def a():
- yield 1
- class b(object):
- def __enter__(self):
- return 2
- def __exit__(self, *exc_info):
- try:
- raise Exception()
- except:
- pass
- try:
- with nested(a(), b()) as (x, y):
- 1/0
- except ZeroDivisionError:
- self.assertEqual((x, y), (1, 2))
- except Exception:
- self.fail("Reraised wrong exception")
- else:
- self.fail("Didn't raise ZeroDivisionError")
-
- def test_nested_b_swallows(self):
- @contextmanager
- def a():
- yield
- @contextmanager
- def b():
- try:
- yield
- except:
- # Swallow the exception
- pass
- try:
- with nested(a(), b()):
- 1/0
- except ZeroDivisionError:
- self.fail("Didn't swallow ZeroDivisionError")
- def test_nested_break(self):
- @contextmanager
- def a():
- yield
- state = 0
- while True:
- state += 1
- with nested(a(), a()):
- break
- state += 10
- self.assertEqual(state, 1)
-
- def test_nested_continue(self):
- @contextmanager
- def a():
- yield
- state = 0
- while state < 3:
- state += 1
- with nested(a(), a()):
- continue
- state += 10
- self.assertEqual(state, 3)
-
- def test_nested_return(self):
- @contextmanager
- def a():
- try:
- yield
- except:
- pass
- def foo():
- with nested(a(), a()):
- return 1
- return 10
- self.assertEqual(foo(), 1)
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_contextmanager_doc_attrib(self):
+ baz = self._create_contextmanager_attribs()
+ self.assertEqual(baz.__doc__, "Whee!")
class ClosingTestCase(unittest.TestCase):
@@ -245,14 +128,11 @@ class ClosingTestCase(unittest.TestCase):
state.append(1)
x = C()
self.assertEqual(state, [])
- try:
+ with self.assertRaises(ZeroDivisionError):
with closing(x) as y:
self.assertEqual(x, y)
- 1/0
- except ZeroDivisionError:
- self.assertEqual(state, [1])
- else:
- self.fail("Didn't raise ZeroDivisionError")
+ 1 / 0
+ self.assertEqual(state, [1])
class FileContextTestCase(unittest.TestCase):
@@ -265,21 +145,16 @@ class FileContextTestCase(unittest.TestCase):
f.write("Booh\n")
self.assertTrue(f.closed)
f = None
- try:
+ with self.assertRaises(ZeroDivisionError):
with open(tfn, "r") as f:
self.assertFalse(f.closed)
self.assertEqual(f.read(), "Booh\n")
- 1/0
- except ZeroDivisionError:
- self.assertTrue(f.closed)
- else:
- self.fail("Didn't raise ZeroDivisionError")
+ 1 / 0
+ self.assertTrue(f.closed)
finally:
- try:
- os.remove(tfn)
- except os.error:
- pass
+ support.unlink(tfn)
+@unittest.skipUnless(threading, 'Threading required for this test.')
class LockContextTestCase(unittest.TestCase):
def boilerPlate(self, lock, locked):
@@ -287,14 +162,11 @@ class LockContextTestCase(unittest.TestCase):
with lock:
self.assertTrue(locked())
self.assertFalse(locked())
- try:
+ with self.assertRaises(ZeroDivisionError):
with lock:
self.assertTrue(locked())
- 1/0
- except ZeroDivisionError:
- self.assertFalse(locked())
- else:
- self.fail("Didn't raise ZeroDivisionError")
+ 1 / 0
+ self.assertFalse(locked())
def testWithLock(self):
lock = threading.Lock()
@@ -330,11 +202,177 @@ class LockContextTestCase(unittest.TestCase):
return True
self.boilerPlate(lock, locked)
+
+class mycontext(ContextDecorator):
+ started = False
+ exc = None
+ catch = False
+
+ def __enter__(self):
+ self.started = True
+ return self
+
+ def __exit__(self, *exc):
+ self.exc = exc
+ return self.catch
+
+
+class TestContextDecorator(unittest.TestCase):
+
+ def test_contextdecorator(self):
+ context = mycontext()
+ with context as result:
+ self.assertIs(result, context)
+ self.assertTrue(context.started)
+
+ self.assertEqual(context.exc, (None, None, None))
+
+
+ def test_contextdecorator_with_exception(self):
+ context = mycontext()
+
+ with self.assertRaisesRegex(NameError, 'foo'):
+ with context:
+ raise NameError('foo')
+ self.assertIsNotNone(context.exc)
+ self.assertIs(context.exc[0], NameError)
+
+ context = mycontext()
+ context.catch = True
+ with context:
+ raise NameError('foo')
+ self.assertIsNotNone(context.exc)
+ self.assertIs(context.exc[0], NameError)
+
+
+ def test_decorator(self):
+ context = mycontext()
+
+ @context
+ def test():
+ self.assertIsNone(context.exc)
+ self.assertTrue(context.started)
+ test()
+ self.assertEqual(context.exc, (None, None, None))
+
+
+ def test_decorator_with_exception(self):
+ context = mycontext()
+
+ @context
+ def test():
+ self.assertIsNone(context.exc)
+ self.assertTrue(context.started)
+ raise NameError('foo')
+
+ with self.assertRaisesRegex(NameError, 'foo'):
+ test()
+ self.assertIsNotNone(context.exc)
+ self.assertIs(context.exc[0], NameError)
+
+
+ def test_decorating_method(self):
+ context = mycontext()
+
+ class Test(object):
+
+ @context
+ def method(self, a, b, c=None):
+ self.a = a
+ self.b = b
+ self.c = c
+
+ # these tests are for argument passing when used as a decorator
+ test = Test()
+ test.method(1, 2)
+ self.assertEqual(test.a, 1)
+ self.assertEqual(test.b, 2)
+ self.assertEqual(test.c, None)
+
+ test = Test()
+ test.method('a', 'b', 'c')
+ self.assertEqual(test.a, 'a')
+ self.assertEqual(test.b, 'b')
+ self.assertEqual(test.c, 'c')
+
+ test = Test()
+ test.method(a=1, b=2)
+ self.assertEqual(test.a, 1)
+ self.assertEqual(test.b, 2)
+
+
+ def test_typo_enter(self):
+ class mycontext(ContextDecorator):
+ def __unter__(self):
+ pass
+ def __exit__(self, *exc):
+ pass
+
+ with self.assertRaises(AttributeError):
+ with mycontext():
+ pass
+
+
+ def test_typo_exit(self):
+ class mycontext(ContextDecorator):
+ def __enter__(self):
+ pass
+ def __uxit__(self, *exc):
+ pass
+
+ with self.assertRaises(AttributeError):
+ with mycontext():
+ pass
+
+
+ def test_contextdecorator_as_mixin(self):
+ class somecontext(object):
+ started = False
+ exc = None
+
+ def __enter__(self):
+ self.started = True
+ return self
+
+ def __exit__(self, *exc):
+ self.exc = exc
+
+ class mycontext(somecontext, ContextDecorator):
+ pass
+
+ context = mycontext()
+ @context
+ def test():
+ self.assertIsNone(context.exc)
+ self.assertTrue(context.started)
+ test()
+ self.assertEqual(context.exc, (None, None, None))
+
+
+ def test_contextmanager_as_decorator(self):
+ @contextmanager
+ def woohoo(y):
+ state.append(y)
+ yield
+ state.append(999)
+
+ state = []
+ @woohoo(1)
+ def test(x):
+ self.assertEqual(state, [1])
+ state.append(x)
+ test('something')
+ self.assertEqual(state, [1, 'something', 999])
+
+ # Issue #11647: Ensure the decorated function is 'reusable'
+ state = []
+ test('something else')
+ self.assertEqual(state, [1, 'something else', 999])
+
+
# This is needed to make the test actually run under regrtest.py!
def test_main():
- with warnings.catch_warnings():
- warnings.simplefilter('ignore')
- support.run_unittest(__name__)
+ support.run_unittest(__name__)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py
index f4ca6b343f..a84c109b87 100644
--- a/Lib/test/test_copy.py
+++ b/Lib/test/test_copy.py
@@ -647,7 +647,7 @@ class TestCopy(unittest.TestCase):
x, y = C(), C()
# The underlying containers are decoupled
v[x] = y
- self.assertFalse(x in u)
+ self.assertNotIn(x, u)
def test_copy_weakkeydict(self):
self._check_copy_weakdict(weakref.WeakKeyDictionary)
@@ -697,6 +697,17 @@ class TestCopy(unittest.TestCase):
del d
self.assertEqual(len(v), 1)
+ def test_deepcopy_bound_method(self):
+ class Foo(object):
+ def m(self):
+ pass
+ f = Foo()
+ f.b = f.m
+ g = copy.deepcopy(f)
+ self.assertEqual(g.m, g.b)
+ self.assertTrue(g.b.__self__ is g)
+ g.b()
+
def global_foo(x, y): return x+y
diff --git a/Lib/test/test_copyreg.py b/Lib/test/test_copyreg.py
index bb3651eb55..abe0748f85 100644
--- a/Lib/test/test_copyreg.py
+++ b/Lib/test/test_copyreg.py
@@ -54,7 +54,7 @@ class CopyRegTestCase(unittest.TestCase):
self.assertTrue(copyreg._extension_registry[mod, func] == code)
self.assertTrue(copyreg._inverted_registry[code] == (mod, func))
# Shouldn't be in the cache.
- self.assertTrue(code not in copyreg._extension_cache)
+ self.assertNotIn(code, copyreg._extension_cache)
# Redundant registration should be OK.
copyreg.add_extension(mod, func, code) # shouldn't blow up
# Conflicting code.
@@ -81,7 +81,7 @@ class CopyRegTestCase(unittest.TestCase):
e.restore()
# Shouldn't be there anymore.
- self.assertTrue((mod, func) not in copyreg._extension_registry)
+ self.assertNotIn((mod, func), copyreg._extension_registry)
# The code *may* be in copyreg._extension_registry, though, if
# we happened to pick on a registered code. So don't check for
# that.
diff --git a/Lib/test/test_cprofile.py b/Lib/test/test_cprofile.py
index 4586b36deb..ae17c2b694 100644
--- a/Lib/test/test_cprofile.py
+++ b/Lib/test/test_cprofile.py
@@ -18,15 +18,16 @@ class CProfileTest(ProfileTest):
def test_bad_counter_during_dealloc(self):
import _lsprof
# Must use a file as StringIO doesn't trigger the bug.
- sys.stderr = open(TESTFN, 'w')
- try:
- obj = _lsprof.Profiler(lambda: int)
- obj.enable()
- obj = _lsprof.Profiler(1)
- obj.disable()
- finally:
- sys.stderr = sys.__stderr__
- unlink(TESTFN)
+ with open(TESTFN, 'w') as file:
+ sys.stderr = file
+ try:
+ obj = _lsprof.Profiler(lambda: int)
+ obj.enable()
+ obj = _lsprof.Profiler(1)
+ obj.disable()
+ finally:
+ sys.stderr = sys.__stderr__
+ unlink(TESTFN)
def test_main():
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index d553a78bbc..8ca1e62c4a 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2001,2002 Python Software Foundation
# csv package unit tests
@@ -483,10 +482,10 @@ hammer and saw"
def test_null(self):
self.writerAssertEqual([], '')
- def test_single(self):
+ def test_single_writer(self):
self.writerAssertEqual([['abc']], 'abc\r\n')
- def test_simple(self):
+ def test_simple_writer(self):
self.writerAssertEqual([[1, 2, 'abc', 3, 4]], '1,2,abc,3,4\r\n')
def test_quotes(self):
@@ -511,6 +510,15 @@ class TestEscapedExcel(TestCsvBase):
def test_read_escape_fieldsep(self):
self.readerAssertEqual('abc\\,def\r\n', [['abc,def']])
+class TestDialectUnix(TestCsvBase):
+ dialect = 'unix'
+
+ def test_simple_writer(self):
+ self.writerAssertEqual([[1, 'abc def', 'abc']], '"1","abc def","abc"\n')
+
+ def test_simple_reader(self):
+ self.readerAssertEqual('"1","abc def","abc"\n', [['1', 'abc def', 'abc']])
+
class QuotedEscapedExcel(csv.excel):
quoting = csv.QUOTE_NONNUMERIC
escapechar = '\\'
@@ -530,8 +538,12 @@ class TestDictFields(unittest.TestCase):
def test_write_simple_dict(self):
with TemporaryFile("w+", newline='') as fileobj:
writer = csv.DictWriter(fileobj, fieldnames = ["f1", "f2", "f3"])
+ writer.writeheader()
+ fileobj.seek(0)
+ self.assertEqual(fileobj.readline(), "f1,f2,f3\r\n")
writer.writerow({"f1": 10, "f3": "abc"})
fileobj.seek(0)
+ fileobj.readline() # header
self.assertEqual(fileobj.read(), "10,,abc\r\n")
def test_write_no_fields(self):
@@ -806,7 +818,7 @@ Stonecutters Seafood and Chop House, Lemont, IL, 12/19/02, Week Back
# given that all three lines in sample3 are equal,
# I think that any character could have been 'guessed' as the
# delimiter, depending on dictionary order
- self.assertTrue(dialect.delimiter in self.sample3)
+ self.assertIn(dialect.delimiter, self.sample3)
dialect = sniffer.sniff(self.sample3, delimiters="?,")
self.assertEqual(dialect.delimiter, "?")
dialect = sniffer.sniff(self.sample3, delimiters="/,")
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py
index ea1e4d51b6..ded2aa93ab 100644
--- a/Lib/test/test_datetime.py
+++ b/Lib/test/test_datetime.py
@@ -1,3385 +1,42 @@
-"""Test date/time type.
-
-See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
-"""
-
-import sys
-import pickle
import unittest
-
-from operator import lt, le, gt, ge, eq, ne
-
-from test import support
-
-from datetime import MINYEAR, MAXYEAR
-from datetime import timedelta
-from datetime import tzinfo
-from datetime import time
-from datetime import date, datetime
-
-pickle_choices = [(pickle, pickle, proto) for proto in range(3)]
-assert len(pickle_choices) == 3
-
-# An arbitrary collection of objects of non-datetime types, for testing
-# mixed-type comparisons.
-OTHERSTUFF = (10, 10, 34.5, "abc", {}, [], ())
-
-
-#############################################################################
-# module tests
-
-class TestModule(unittest.TestCase):
-
- def test_constants(self):
- import datetime
- self.assertEqual(datetime.MINYEAR, 1)
- self.assertEqual(datetime.MAXYEAR, 9999)
-
-#############################################################################
-# tzinfo tests
-
-class FixedOffset(tzinfo):
- def __init__(self, offset, name, dstoffset=42):
- if isinstance(offset, int):
- offset = timedelta(minutes=offset)
- if isinstance(dstoffset, int):
- dstoffset = timedelta(minutes=dstoffset)
- self.__offset = offset
- self.__name = name
- self.__dstoffset = dstoffset
- def __repr__(self):
- return self.__name.lower()
- def utcoffset(self, dt):
- return self.__offset
- def tzname(self, dt):
- return self.__name
- def dst(self, dt):
- return self.__dstoffset
-
-class PicklableFixedOffset(FixedOffset):
- def __init__(self, offset=None, name=None, dstoffset=None):
- FixedOffset.__init__(self, offset, name, dstoffset)
-
-class TestTZInfo(unittest.TestCase):
-
- def test_non_abstractness(self):
- # In order to allow subclasses to get pickled, the C implementation
- # wasn't able to get away with having __init__ raise
- # NotImplementedError.
- useless = tzinfo()
- dt = datetime.max
- self.assertRaises(NotImplementedError, useless.tzname, dt)
- self.assertRaises(NotImplementedError, useless.utcoffset, dt)
- self.assertRaises(NotImplementedError, useless.dst, dt)
-
- def test_subclass_must_override(self):
- class NotEnough(tzinfo):
- def __init__(self, offset, name):
- self.__offset = offset
- self.__name = name
- self.assertTrue(issubclass(NotEnough, tzinfo))
- ne = NotEnough(3, "NotByALongShot")
- self.assertTrue(isinstance(ne, tzinfo))
-
- dt = datetime.now()
- self.assertRaises(NotImplementedError, ne.tzname, dt)
- self.assertRaises(NotImplementedError, ne.utcoffset, dt)
- self.assertRaises(NotImplementedError, ne.dst, dt)
-
- def test_normal(self):
- fo = FixedOffset(3, "Three")
- self.assertTrue(isinstance(fo, tzinfo))
- for dt in datetime.now(), None:
- self.assertEqual(fo.utcoffset(dt), timedelta(minutes=3))
- self.assertEqual(fo.tzname(dt), "Three")
- self.assertEqual(fo.dst(dt), timedelta(minutes=42))
-
- def test_pickling_base(self):
- # There's no point to pickling tzinfo objects on their own (they
- # carry no data), but they need to be picklable anyway else
- # concrete subclasses can't be pickled.
- orig = tzinfo.__new__(tzinfo)
- self.assertTrue(type(orig) is tzinfo)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertTrue(type(derived) is tzinfo)
-
- def test_pickling_subclass(self):
- # Make sure we can pickle/unpickle an instance of a subclass.
- offset = timedelta(minutes=-300)
- orig = PicklableFixedOffset(offset, 'cookie')
- self.assertTrue(isinstance(orig, tzinfo))
- self.assertTrue(type(orig) is PicklableFixedOffset)
- self.assertEqual(orig.utcoffset(None), offset)
- self.assertEqual(orig.tzname(None), 'cookie')
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertTrue(isinstance(derived, tzinfo))
- self.assertTrue(type(derived) is PicklableFixedOffset)
- self.assertEqual(derived.utcoffset(None), offset)
- self.assertEqual(derived.tzname(None), 'cookie')
-
-#############################################################################
-# Base clase for testing a particular aspect of timedelta, time, date and
-# datetime comparisons.
-
-class HarmlessMixedComparison:
- # Test that __eq__ and __ne__ don't complain for mixed-type comparisons.
-
- # Subclasses must define 'theclass', and theclass(1, 1, 1) must be a
- # legit constructor.
-
- def test_harmless_mixed_comparison(self):
- me = self.theclass(1, 1, 1)
-
- self.assertFalse(me == ())
- self.assertTrue(me != ())
- self.assertFalse(() == me)
- self.assertTrue(() != me)
-
- self.assertTrue(me in [1, 20, [], me])
- self.assertFalse(me not in [1, 20, [], me])
-
- self.assertTrue([] in [me, 1, 20, []])
- self.assertFalse([] not in [me, 1, 20, []])
-
- def test_harmful_mixed_comparison(self):
- me = self.theclass(1, 1, 1)
-
- self.assertRaises(TypeError, lambda: me < ())
- self.assertRaises(TypeError, lambda: me <= ())
- self.assertRaises(TypeError, lambda: me > ())
- self.assertRaises(TypeError, lambda: me >= ())
-
- self.assertRaises(TypeError, lambda: () < me)
- self.assertRaises(TypeError, lambda: () <= me)
- self.assertRaises(TypeError, lambda: () > me)
- self.assertRaises(TypeError, lambda: () >= me)
-
-#############################################################################
-# timedelta tests
-
-class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
-
- theclass = timedelta
-
- def test_constructor(self):
- eq = self.assertEqual
- td = timedelta
-
- # Check keyword args to constructor
- eq(td(), td(weeks=0, days=0, hours=0, minutes=0, seconds=0,
- milliseconds=0, microseconds=0))
- eq(td(1), td(days=1))
- eq(td(0, 1), td(seconds=1))
- eq(td(0, 0, 1), td(microseconds=1))
- eq(td(weeks=1), td(days=7))
- eq(td(days=1), td(hours=24))
- eq(td(hours=1), td(minutes=60))
- eq(td(minutes=1), td(seconds=60))
- eq(td(seconds=1), td(milliseconds=1000))
- eq(td(milliseconds=1), td(microseconds=1000))
-
- # Check float args to constructor
- eq(td(weeks=1.0/7), td(days=1))
- eq(td(days=1.0/24), td(hours=1))
- eq(td(hours=1.0/60), td(minutes=1))
- eq(td(minutes=1.0/60), td(seconds=1))
- eq(td(seconds=0.001), td(milliseconds=1))
- eq(td(milliseconds=0.001), td(microseconds=1))
-
- def test_computations(self):
- eq = self.assertEqual
- td = timedelta
-
- a = td(7) # One week
- b = td(0, 60) # One minute
- c = td(0, 0, 1000) # One millisecond
- eq(a+b+c, td(7, 60, 1000))
- eq(a-b, td(6, 24*3600 - 60))
- eq(b.__rsub__(a), td(6, 24*3600 - 60))
- eq(-a, td(-7))
- eq(+a, td(7))
- eq(-b, td(-1, 24*3600 - 60))
- eq(-c, td(-1, 24*3600 - 1, 999000))
- eq(abs(a), a)
- eq(abs(-a), a)
- eq(td(6, 24*3600), a)
- eq(td(0, 0, 60*1000000), b)
- eq(a*10, td(70))
- eq(a*10, 10*a)
- eq(a*10, 10*a)
- eq(b*10, td(0, 600))
- eq(10*b, td(0, 600))
- eq(b*10, td(0, 600))
- eq(c*10, td(0, 0, 10000))
- eq(10*c, td(0, 0, 10000))
- eq(c*10, td(0, 0, 10000))
- eq(a*-1, -a)
- eq(b*-2, -b-b)
- eq(c*-2, -c+-c)
- eq(b*(60*24), (b*60)*24)
- eq(b*(60*24), (60*b)*24)
- eq(c*1000, td(0, 1))
- eq(1000*c, td(0, 1))
- eq(a//7, td(1))
- eq(b//10, td(0, 6))
- eq(c//1000, td(0, 0, 1))
- eq(a//10, td(0, 7*24*360))
- eq(a//3600000, td(0, 0, 7*24*1000))
-
- def test_disallowed_computations(self):
- a = timedelta(42)
-
- # Add/sub ints, longs, floats should be illegal
- for i in 1, 1, 1.0:
- self.assertRaises(TypeError, lambda: a+i)
- self.assertRaises(TypeError, lambda: a-i)
- self.assertRaises(TypeError, lambda: i+a)
- self.assertRaises(TypeError, lambda: i-a)
-
- # Mul/div by float isn't supported.
- x = 2.3
- self.assertRaises(TypeError, lambda: a*x)
- self.assertRaises(TypeError, lambda: x*a)
- self.assertRaises(TypeError, lambda: a/x)
- self.assertRaises(TypeError, lambda: x/a)
- self.assertRaises(TypeError, lambda: a // x)
- self.assertRaises(TypeError, lambda: x // a)
-
- # Division of int by timedelta doesn't make sense.
- # Division by zero doesn't make sense.
- for zero in 0, 0:
- self.assertRaises(TypeError, lambda: zero // a)
- self.assertRaises(ZeroDivisionError, lambda: a // zero)
- self.assertRaises(TypeError, lambda: a / '')
-
- def test_basic_attributes(self):
- days, seconds, us = 1, 7, 31
- td = timedelta(days, seconds, us)
- self.assertEqual(td.days, days)
- self.assertEqual(td.seconds, seconds)
- self.assertEqual(td.microseconds, us)
-
- def test_carries(self):
- t1 = timedelta(days=100,
- weeks=-7,
- hours=-24*(100-49),
- minutes=-3,
- seconds=12,
- microseconds=(3*60 - 12) * 1e6 + 1)
- t2 = timedelta(microseconds=1)
- self.assertEqual(t1, t2)
-
- def test_hash_equality(self):
- t1 = timedelta(days=100,
- weeks=-7,
- hours=-24*(100-49),
- minutes=-3,
- seconds=12,
- microseconds=(3*60 - 12) * 1000000)
- t2 = timedelta()
- self.assertEqual(hash(t1), hash(t2))
-
- t1 += timedelta(weeks=7)
- t2 += timedelta(days=7*7)
- self.assertEqual(t1, t2)
- self.assertEqual(hash(t1), hash(t2))
-
- d = {t1: 1}
- d[t2] = 2
- self.assertEqual(len(d), 1)
- self.assertEqual(d[t1], 2)
-
- def test_pickling(self):
- args = 12, 34, 56
- orig = timedelta(*args)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
-
- def test_compare(self):
- t1 = timedelta(2, 3, 4)
- t2 = timedelta(2, 3, 4)
- self.assertEqual(t1, t2)
- self.assertTrue(t1 <= t2)
- self.assertTrue(t1 >= t2)
- self.assertTrue(not t1 != t2)
- self.assertTrue(not t1 < t2)
- self.assertTrue(not t1 > t2)
-
- for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
- t2 = timedelta(*args) # this is larger than t1
- self.assertTrue(t1 < t2)
- self.assertTrue(t2 > t1)
- self.assertTrue(t1 <= t2)
- self.assertTrue(t2 >= t1)
- self.assertTrue(t1 != t2)
- self.assertTrue(t2 != t1)
- self.assertTrue(not t1 == t2)
- self.assertTrue(not t2 == t1)
- self.assertTrue(not t1 > t2)
- self.assertTrue(not t2 < t1)
- self.assertTrue(not t1 >= t2)
- self.assertTrue(not t2 <= t1)
-
- for badarg in OTHERSTUFF:
- self.assertEqual(t1 == badarg, False)
- self.assertEqual(t1 != badarg, True)
- self.assertEqual(badarg == t1, False)
- self.assertEqual(badarg != t1, True)
-
- self.assertRaises(TypeError, lambda: t1 <= badarg)
- self.assertRaises(TypeError, lambda: t1 < badarg)
- self.assertRaises(TypeError, lambda: t1 > badarg)
- self.assertRaises(TypeError, lambda: t1 >= badarg)
- self.assertRaises(TypeError, lambda: badarg <= t1)
- self.assertRaises(TypeError, lambda: badarg < t1)
- self.assertRaises(TypeError, lambda: badarg > t1)
- self.assertRaises(TypeError, lambda: badarg >= t1)
-
- def test_str(self):
- td = timedelta
- eq = self.assertEqual
-
- eq(str(td(1)), "1 day, 0:00:00")
- eq(str(td(-1)), "-1 day, 0:00:00")
- eq(str(td(2)), "2 days, 0:00:00")
- eq(str(td(-2)), "-2 days, 0:00:00")
-
- eq(str(td(hours=12, minutes=58, seconds=59)), "12:58:59")
- eq(str(td(hours=2, minutes=3, seconds=4)), "2:03:04")
- eq(str(td(weeks=-30, hours=23, minutes=12, seconds=34)),
- "-210 days, 23:12:34")
-
- eq(str(td(milliseconds=1)), "0:00:00.001000")
- eq(str(td(microseconds=3)), "0:00:00.000003")
-
- eq(str(td(days=999999999, hours=23, minutes=59, seconds=59,
- microseconds=999999)),
- "999999999 days, 23:59:59.999999")
-
- def test_repr(self):
- name = 'datetime.' + self.theclass.__name__
- self.assertEqual(repr(self.theclass(1)),
- "%s(1)" % name)
- self.assertEqual(repr(self.theclass(10, 2)),
- "%s(10, 2)" % name)
- self.assertEqual(repr(self.theclass(-10, 2, 400000)),
- "%s(-10, 2, 400000)" % name)
-
- def test_roundtrip(self):
- for td in (timedelta(days=999999999, hours=23, minutes=59,
- seconds=59, microseconds=999999),
- timedelta(days=-999999999),
- timedelta(days=-999999999, seconds=1),
- timedelta(days=1, seconds=2, microseconds=3)):
-
- # Verify td -> string -> td identity.
- s = repr(td)
- self.assertTrue(s.startswith('datetime.'))
- s = s[9:]
- td2 = eval(s)
- self.assertEqual(td, td2)
-
- # Verify identity via reconstructing from pieces.
- td2 = timedelta(td.days, td.seconds, td.microseconds)
- self.assertEqual(td, td2)
-
- def test_resolution_info(self):
- self.assertTrue(isinstance(timedelta.min, timedelta))
- self.assertTrue(isinstance(timedelta.max, timedelta))
- self.assertTrue(isinstance(timedelta.resolution, timedelta))
- self.assertTrue(timedelta.max > timedelta.min)
- self.assertEqual(timedelta.min, timedelta(-999999999))
- self.assertEqual(timedelta.max, timedelta(999999999, 24*3600-1, 1e6-1))
- self.assertEqual(timedelta.resolution, timedelta(0, 0, 1))
-
- def test_overflow(self):
- tiny = timedelta.resolution
-
- td = timedelta.min + tiny
- td -= tiny # no problem
- self.assertRaises(OverflowError, td.__sub__, tiny)
- self.assertRaises(OverflowError, td.__add__, -tiny)
-
- td = timedelta.max - tiny
- td += tiny # no problem
- self.assertRaises(OverflowError, td.__add__, tiny)
- self.assertRaises(OverflowError, td.__sub__, -tiny)
-
- self.assertRaises(OverflowError, lambda: -timedelta.max)
-
- def test_microsecond_rounding(self):
- td = timedelta
- eq = self.assertEqual
-
- # Single-field rounding.
- eq(td(milliseconds=0.4/1000), td(0)) # rounds to 0
- eq(td(milliseconds=-0.4/1000), td(0)) # rounds to 0
- eq(td(milliseconds=0.6/1000), td(microseconds=1))
- eq(td(milliseconds=-0.6/1000), td(microseconds=-1))
-
- # Rounding due to contributions from more than one field.
- us_per_hour = 3600e6
- us_per_day = us_per_hour * 24
- eq(td(days=.4/us_per_day), td(0))
- eq(td(hours=.2/us_per_hour), td(0))
- eq(td(days=.4/us_per_day, hours=.2/us_per_hour), td(microseconds=1))
-
- eq(td(days=-.4/us_per_day), td(0))
- eq(td(hours=-.2/us_per_hour), td(0))
- eq(td(days=-.4/us_per_day, hours=-.2/us_per_hour), td(microseconds=-1))
-
- def test_massive_normalization(self):
- td = timedelta(microseconds=-1)
- self.assertEqual((td.days, td.seconds, td.microseconds),
- (-1, 24*3600-1, 999999))
-
- def test_bool(self):
- self.assertTrue(timedelta(1))
- self.assertTrue(timedelta(0, 1))
- self.assertTrue(timedelta(0, 0, 1))
- self.assertTrue(timedelta(microseconds=1))
- self.assertTrue(not timedelta(0))
-
- def test_subclass_timedelta(self):
-
- class T(timedelta):
- @staticmethod
- def from_td(td):
- return T(td.days, td.seconds, td.microseconds)
-
- def as_hours(self):
- sum = (self.days * 24 +
- self.seconds / 3600.0 +
- self.microseconds / 3600e6)
- return round(sum)
-
- t1 = T(days=1)
- self.assertTrue(type(t1) is T)
- self.assertEqual(t1.as_hours(), 24)
-
- t2 = T(days=-1, seconds=-3600)
- self.assertTrue(type(t2) is T)
- self.assertEqual(t2.as_hours(), -25)
-
- t3 = t1 + t2
- self.assertTrue(type(t3) is timedelta)
- t4 = T.from_td(t3)
- self.assertTrue(type(t4) is T)
- self.assertEqual(t3.days, t4.days)
- self.assertEqual(t3.seconds, t4.seconds)
- self.assertEqual(t3.microseconds, t4.microseconds)
- self.assertEqual(str(t3), str(t4))
- self.assertEqual(t4.as_hours(), -1)
-
-#############################################################################
-# date tests
-
-class TestDateOnly(unittest.TestCase):
- # Tests here won't pass if also run on datetime objects, so don't
- # subclass this to test datetimes too.
-
- def test_delta_non_days_ignored(self):
- dt = date(2000, 1, 2)
- delta = timedelta(days=1, hours=2, minutes=3, seconds=4,
- microseconds=5)
- days = timedelta(delta.days)
- self.assertEqual(days, timedelta(1))
-
- dt2 = dt + delta
- self.assertEqual(dt2, dt + days)
-
- dt2 = delta + dt
- self.assertEqual(dt2, dt + days)
-
- dt2 = dt - delta
- self.assertEqual(dt2, dt - days)
-
- delta = -delta
- days = timedelta(delta.days)
- self.assertEqual(days, timedelta(-2))
-
- dt2 = dt + delta
- self.assertEqual(dt2, dt + days)
-
- dt2 = delta + dt
- self.assertEqual(dt2, dt + days)
-
- dt2 = dt - delta
- self.assertEqual(dt2, dt - days)
-
-class SubclassDate(date):
- sub_var = 1
-
-class TestDate(HarmlessMixedComparison, unittest.TestCase):
- # Tests here should pass for both dates and datetimes, except for a
- # few tests that TestDateTime overrides.
-
- theclass = date
-
- def test_basic_attributes(self):
- dt = self.theclass(2002, 3, 1)
- self.assertEqual(dt.year, 2002)
- self.assertEqual(dt.month, 3)
- self.assertEqual(dt.day, 1)
-
- def test_roundtrip(self):
- for dt in (self.theclass(1, 2, 3),
- self.theclass.today()):
- # Verify dt -> string -> date identity.
- s = repr(dt)
- self.assertTrue(s.startswith('datetime.'))
- s = s[9:]
- dt2 = eval(s)
- self.assertEqual(dt, dt2)
-
- # Verify identity via reconstructing from pieces.
- dt2 = self.theclass(dt.year, dt.month, dt.day)
- self.assertEqual(dt, dt2)
-
- def test_ordinal_conversions(self):
- # Check some fixed values.
- for y, m, d, n in [(1, 1, 1, 1), # calendar origin
- (1, 12, 31, 365),
- (2, 1, 1, 366),
- # first example from "Calendrical Calculations"
- (1945, 11, 12, 710347)]:
- d = self.theclass(y, m, d)
- self.assertEqual(n, d.toordinal())
- fromord = self.theclass.fromordinal(n)
- self.assertEqual(d, fromord)
- if hasattr(fromord, "hour"):
- # if we're checking something fancier than a date, verify
- # the extra fields have been zeroed out
- self.assertEqual(fromord.hour, 0)
- self.assertEqual(fromord.minute, 0)
- self.assertEqual(fromord.second, 0)
- self.assertEqual(fromord.microsecond, 0)
-
- # Check first and last days of year spottily across the whole
- # range of years supported.
- for year in range(MINYEAR, MAXYEAR+1, 7):
- # Verify (year, 1, 1) -> ordinal -> y, m, d is identity.
- d = self.theclass(year, 1, 1)
- n = d.toordinal()
- d2 = self.theclass.fromordinal(n)
- self.assertEqual(d, d2)
- # Verify that moving back a day gets to the end of year-1.
- if year > 1:
- d = self.theclass.fromordinal(n-1)
- d2 = self.theclass(year-1, 12, 31)
- self.assertEqual(d, d2)
- self.assertEqual(d2.toordinal(), n-1)
-
- # Test every day in a leap-year and a non-leap year.
- dim = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
- for year, isleap in (2000, True), (2002, False):
- n = self.theclass(year, 1, 1).toordinal()
- for month, maxday in zip(range(1, 13), dim):
- if month == 2 and isleap:
- maxday += 1
- for day in range(1, maxday+1):
- d = self.theclass(year, month, day)
- self.assertEqual(d.toordinal(), n)
- self.assertEqual(d, self.theclass.fromordinal(n))
- n += 1
-
- def test_extreme_ordinals(self):
- a = self.theclass.min
- a = self.theclass(a.year, a.month, a.day) # get rid of time parts
- aord = a.toordinal()
- b = a.fromordinal(aord)
- self.assertEqual(a, b)
-
- self.assertRaises(ValueError, lambda: a.fromordinal(aord - 1))
-
- b = a + timedelta(days=1)
- self.assertEqual(b.toordinal(), aord + 1)
- self.assertEqual(b, self.theclass.fromordinal(aord + 1))
-
- a = self.theclass.max
- a = self.theclass(a.year, a.month, a.day) # get rid of time parts
- aord = a.toordinal()
- b = a.fromordinal(aord)
- self.assertEqual(a, b)
-
- self.assertRaises(ValueError, lambda: a.fromordinal(aord + 1))
-
- b = a - timedelta(days=1)
- self.assertEqual(b.toordinal(), aord - 1)
- self.assertEqual(b, self.theclass.fromordinal(aord - 1))
-
- def test_bad_constructor_arguments(self):
- # bad years
- self.theclass(MINYEAR, 1, 1) # no exception
- self.theclass(MAXYEAR, 1, 1) # no exception
- self.assertRaises(ValueError, self.theclass, MINYEAR-1, 1, 1)
- self.assertRaises(ValueError, self.theclass, MAXYEAR+1, 1, 1)
- # bad months
- self.theclass(2000, 1, 1) # no exception
- self.theclass(2000, 12, 1) # no exception
- self.assertRaises(ValueError, self.theclass, 2000, 0, 1)
- self.assertRaises(ValueError, self.theclass, 2000, 13, 1)
- # bad days
- self.theclass(2000, 2, 29) # no exception
- self.theclass(2004, 2, 29) # no exception
- self.theclass(2400, 2, 29) # no exception
- self.assertRaises(ValueError, self.theclass, 2000, 2, 30)
- self.assertRaises(ValueError, self.theclass, 2001, 2, 29)
- self.assertRaises(ValueError, self.theclass, 2100, 2, 29)
- self.assertRaises(ValueError, self.theclass, 1900, 2, 29)
- self.assertRaises(ValueError, self.theclass, 2000, 1, 0)
- self.assertRaises(ValueError, self.theclass, 2000, 1, 32)
-
- def test_hash_equality(self):
- d = self.theclass(2000, 12, 31)
- # same thing
- e = self.theclass(2000, 12, 31)
- self.assertEqual(d, e)
- self.assertEqual(hash(d), hash(e))
-
- dic = {d: 1}
- dic[e] = 2
- self.assertEqual(len(dic), 1)
- self.assertEqual(dic[d], 2)
- self.assertEqual(dic[e], 2)
-
- d = self.theclass(2001, 1, 1)
- # same thing
- e = self.theclass(2001, 1, 1)
- self.assertEqual(d, e)
- self.assertEqual(hash(d), hash(e))
-
- dic = {d: 1}
- dic[e] = 2
- self.assertEqual(len(dic), 1)
- self.assertEqual(dic[d], 2)
- self.assertEqual(dic[e], 2)
-
- def test_computations(self):
- a = self.theclass(2002, 1, 31)
- b = self.theclass(1956, 1, 31)
-
- diff = a-b
- self.assertEqual(diff.days, 46*365 + len(range(1956, 2002, 4)))
- self.assertEqual(diff.seconds, 0)
- self.assertEqual(diff.microseconds, 0)
-
- day = timedelta(1)
- week = timedelta(7)
- a = self.theclass(2002, 3, 2)
- self.assertEqual(a + day, self.theclass(2002, 3, 3))
- self.assertEqual(day + a, self.theclass(2002, 3, 3))
- self.assertEqual(a - day, self.theclass(2002, 3, 1))
- self.assertEqual(-day + a, self.theclass(2002, 3, 1))
- self.assertEqual(a + week, self.theclass(2002, 3, 9))
- self.assertEqual(a - week, self.theclass(2002, 2, 23))
- self.assertEqual(a + 52*week, self.theclass(2003, 3, 1))
- self.assertEqual(a - 52*week, self.theclass(2001, 3, 3))
- self.assertEqual((a + week) - a, week)
- self.assertEqual((a + day) - a, day)
- self.assertEqual((a - week) - a, -week)
- self.assertEqual((a - day) - a, -day)
- self.assertEqual(a - (a + week), -week)
- self.assertEqual(a - (a + day), -day)
- self.assertEqual(a - (a - week), week)
- self.assertEqual(a - (a - day), day)
-
- # Add/sub ints, longs, floats should be illegal
- for i in 1, 1, 1.0:
- self.assertRaises(TypeError, lambda: a+i)
- self.assertRaises(TypeError, lambda: a-i)
- self.assertRaises(TypeError, lambda: i+a)
- self.assertRaises(TypeError, lambda: i-a)
-
- # delta - date is senseless.
- self.assertRaises(TypeError, lambda: day - a)
- # mixing date and (delta or date) via * or // is senseless
- self.assertRaises(TypeError, lambda: day * a)
- self.assertRaises(TypeError, lambda: a * day)
- self.assertRaises(TypeError, lambda: day // a)
- self.assertRaises(TypeError, lambda: a // day)
- self.assertRaises(TypeError, lambda: a * a)
- self.assertRaises(TypeError, lambda: a // a)
- # date + date is senseless
- self.assertRaises(TypeError, lambda: a + a)
-
- def test_overflow(self):
- tiny = self.theclass.resolution
-
- for delta in [tiny, timedelta(1), timedelta(2)]:
- dt = self.theclass.min + delta
- dt -= delta # no problem
- self.assertRaises(OverflowError, dt.__sub__, delta)
- self.assertRaises(OverflowError, dt.__add__, -delta)
-
- dt = self.theclass.max - delta
- dt += delta # no problem
- self.assertRaises(OverflowError, dt.__add__, delta)
- self.assertRaises(OverflowError, dt.__sub__, -delta)
-
- def test_fromtimestamp(self):
- import time
-
- # Try an arbitrary fixed value.
- year, month, day = 1999, 9, 19
- ts = time.mktime((year, month, day, 0, 0, 0, 0, 0, -1))
- d = self.theclass.fromtimestamp(ts)
- self.assertEqual(d.year, year)
- self.assertEqual(d.month, month)
- self.assertEqual(d.day, day)
-
- def test_insane_fromtimestamp(self):
- # It's possible that some platform maps time_t to double,
- # and that this test will fail there. This test should
- # exempt such platforms (provided they return reasonable
- # results!).
- for insane in -1e200, 1e200:
- self.assertRaises(ValueError, self.theclass.fromtimestamp,
- insane)
-
- def test_today(self):
- import time
-
- # We claim that today() is like fromtimestamp(time.time()), so
- # prove it.
- for dummy in range(3):
- today = self.theclass.today()
- ts = time.time()
- todayagain = self.theclass.fromtimestamp(ts)
- if today == todayagain:
- break
- # There are several legit reasons that could fail:
- # 1. It recently became midnight, between the today() and the
- # time() calls.
- # 2. The platform time() has such fine resolution that we'll
- # never get the same value twice.
- # 3. The platform time() has poor resolution, and we just
- # happened to call today() right before a resolution quantum
- # boundary.
- # 4. The system clock got fiddled between calls.
- # In any case, wait a little while and try again.
- time.sleep(0.1)
-
- # It worked or it didn't. If it didn't, assume it's reason #2, and
- # let the test pass if they're within half a second of each other.
- self.assertTrue(today == todayagain or
- abs(todayagain - today) < timedelta(seconds=0.5))
-
- def test_weekday(self):
- for i in range(7):
- # March 4, 2002 is a Monday
- self.assertEqual(self.theclass(2002, 3, 4+i).weekday(), i)
- self.assertEqual(self.theclass(2002, 3, 4+i).isoweekday(), i+1)
- # January 2, 1956 is a Monday
- self.assertEqual(self.theclass(1956, 1, 2+i).weekday(), i)
- self.assertEqual(self.theclass(1956, 1, 2+i).isoweekday(), i+1)
-
- def test_isocalendar(self):
- # Check examples from
- # http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
- for i in range(7):
- d = self.theclass(2003, 12, 22+i)
- self.assertEqual(d.isocalendar(), (2003, 52, i+1))
- d = self.theclass(2003, 12, 29) + timedelta(i)
- self.assertEqual(d.isocalendar(), (2004, 1, i+1))
- d = self.theclass(2004, 1, 5+i)
- self.assertEqual(d.isocalendar(), (2004, 2, i+1))
- d = self.theclass(2009, 12, 21+i)
- self.assertEqual(d.isocalendar(), (2009, 52, i+1))
- d = self.theclass(2009, 12, 28) + timedelta(i)
- self.assertEqual(d.isocalendar(), (2009, 53, i+1))
- d = self.theclass(2010, 1, 4+i)
- self.assertEqual(d.isocalendar(), (2010, 1, i+1))
-
- def test_iso_long_years(self):
- # Calculate long ISO years and compare to table from
- # http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
- ISO_LONG_YEARS_TABLE = """
- 4 32 60 88
- 9 37 65 93
- 15 43 71 99
- 20 48 76
- 26 54 82
-
- 105 133 161 189
- 111 139 167 195
- 116 144 172
- 122 150 178
- 128 156 184
-
- 201 229 257 285
- 207 235 263 291
- 212 240 268 296
- 218 246 274
- 224 252 280
-
- 303 331 359 387
- 308 336 364 392
- 314 342 370 398
- 320 348 376
- 325 353 381
- """
- iso_long_years = sorted(map(int, ISO_LONG_YEARS_TABLE.split()))
- L = []
- for i in range(400):
- d = self.theclass(2000+i, 12, 31)
- d1 = self.theclass(1600+i, 12, 31)
- self.assertEqual(d.isocalendar()[1:], d1.isocalendar()[1:])
- if d.isocalendar()[1] == 53:
- L.append(i)
- self.assertEqual(L, iso_long_years)
-
- def test_isoformat(self):
- t = self.theclass(2, 3, 2)
- self.assertEqual(t.isoformat(), "0002-03-02")
-
- def test_ctime(self):
- t = self.theclass(2002, 3, 2)
- self.assertEqual(t.ctime(), "Sat Mar 2 00:00:00 2002")
-
- def test_strftime(self):
- t = self.theclass(2005, 3, 2)
- self.assertEqual(t.strftime("m:%m d:%d y:%y"), "m:03 d:02 y:05")
- self.assertEqual(t.strftime(""), "") # SF bug #761337
- self.assertEqual(t.strftime('x'*1000), 'x'*1000) # SF bug #1556784
-
- self.assertRaises(TypeError, t.strftime) # needs an arg
- self.assertRaises(TypeError, t.strftime, "one", "two") # too many args
- self.assertRaises(TypeError, t.strftime, 42) # arg wrong type
-
- # test that unicode input is allowed (issue 2782)
- self.assertEqual(t.strftime("%m"), "03")
-
- # A naive object replaces %z and %Z w/ empty strings.
- self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
-
- #make sure that invalid format specifiers are handled correctly
- #self.assertRaises(ValueError, t.strftime, "%e")
- #self.assertRaises(ValueError, t.strftime, "%")
- #self.assertRaises(ValueError, t.strftime, "%#")
-
- #oh well, some systems just ignore those invalid ones.
- #at least, excercise them to make sure that no crashes
- #are generated
- for f in ["%e", "%", "%#"]:
- try:
- t.strftime(f)
- except ValueError:
- pass
-
- #check that this standard extension works
- t.strftime("%f")
-
-
- def test_format(self):
- dt = self.theclass(2007, 9, 10)
- self.assertEqual(dt.__format__(''), str(dt))
-
- # check that a derived class's __str__() gets called
- class A(self.theclass):
- def __str__(self):
- return 'A'
- a = A(2007, 9, 10)
- self.assertEqual(a.__format__(''), 'A')
-
- # check that a derived class's strftime gets called
- class B(self.theclass):
- def strftime(self, format_spec):
- return 'B'
- b = B(2007, 9, 10)
- self.assertEqual(b.__format__(''), str(dt))
-
- for fmt in ["m:%m d:%d y:%y",
- "m:%m d:%d y:%y H:%H M:%M S:%S",
- "%z %Z",
- ]:
- self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
- self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
- self.assertEqual(b.__format__(fmt), 'B')
-
- def test_resolution_info(self):
- self.assertTrue(isinstance(self.theclass.min, self.theclass))
- self.assertTrue(isinstance(self.theclass.max, self.theclass))
- self.assertTrue(isinstance(self.theclass.resolution, timedelta))
- self.assertTrue(self.theclass.max > self.theclass.min)
-
- def test_extreme_timedelta(self):
- big = self.theclass.max - self.theclass.min
- # 3652058 days, 23 hours, 59 minutes, 59 seconds, 999999 microseconds
- n = (big.days*24*3600 + big.seconds)*1000000 + big.microseconds
- # n == 315537897599999999 ~= 2**58.13
- justasbig = timedelta(0, 0, n)
- self.assertEqual(big, justasbig)
- self.assertEqual(self.theclass.min + big, self.theclass.max)
- self.assertEqual(self.theclass.max - big, self.theclass.min)
-
- def test_timetuple(self):
- for i in range(7):
- # January 2, 1956 is a Monday (0)
- d = self.theclass(1956, 1, 2+i)
- t = d.timetuple()
- self.assertEqual(t, (1956, 1, 2+i, 0, 0, 0, i, 2+i, -1))
- # February 1, 1956 is a Wednesday (2)
- d = self.theclass(1956, 2, 1+i)
- t = d.timetuple()
- self.assertEqual(t, (1956, 2, 1+i, 0, 0, 0, (2+i)%7, 32+i, -1))
- # March 1, 1956 is a Thursday (3), and is the 31+29+1 = 61st day
- # of the year.
- d = self.theclass(1956, 3, 1+i)
- t = d.timetuple()
- self.assertEqual(t, (1956, 3, 1+i, 0, 0, 0, (3+i)%7, 61+i, -1))
- self.assertEqual(t.tm_year, 1956)
- self.assertEqual(t.tm_mon, 3)
- self.assertEqual(t.tm_mday, 1+i)
- self.assertEqual(t.tm_hour, 0)
- self.assertEqual(t.tm_min, 0)
- self.assertEqual(t.tm_sec, 0)
- self.assertEqual(t.tm_wday, (3+i)%7)
- self.assertEqual(t.tm_yday, 61+i)
- self.assertEqual(t.tm_isdst, -1)
-
- def test_pickling(self):
- args = 6, 7, 23
- orig = self.theclass(*args)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
-
- def test_compare(self):
- t1 = self.theclass(2, 3, 4)
- t2 = self.theclass(2, 3, 4)
- self.assertEqual(t1, t2)
- self.assertTrue(t1 <= t2)
- self.assertTrue(t1 >= t2)
- self.assertTrue(not t1 != t2)
- self.assertTrue(not t1 < t2)
- self.assertTrue(not t1 > t2)
-
- for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
- t2 = self.theclass(*args) # this is larger than t1
- self.assertTrue(t1 < t2)
- self.assertTrue(t2 > t1)
- self.assertTrue(t1 <= t2)
- self.assertTrue(t2 >= t1)
- self.assertTrue(t1 != t2)
- self.assertTrue(t2 != t1)
- self.assertTrue(not t1 == t2)
- self.assertTrue(not t2 == t1)
- self.assertTrue(not t1 > t2)
- self.assertTrue(not t2 < t1)
- self.assertTrue(not t1 >= t2)
- self.assertTrue(not t2 <= t1)
-
- for badarg in OTHERSTUFF:
- self.assertEqual(t1 == badarg, False)
- self.assertEqual(t1 != badarg, True)
- self.assertEqual(badarg == t1, False)
- self.assertEqual(badarg != t1, True)
-
- self.assertRaises(TypeError, lambda: t1 < badarg)
- self.assertRaises(TypeError, lambda: t1 > badarg)
- self.assertRaises(TypeError, lambda: t1 >= badarg)
- self.assertRaises(TypeError, lambda: badarg <= t1)
- self.assertRaises(TypeError, lambda: badarg < t1)
- self.assertRaises(TypeError, lambda: badarg > t1)
- self.assertRaises(TypeError, lambda: badarg >= t1)
-
- def test_mixed_compare(self):
- our = self.theclass(2000, 4, 5)
-
- # Our class can be compared for equality to other classes
- self.assertEqual(our == 1, False)
- self.assertEqual(1 == our, False)
- self.assertEqual(our != 1, True)
- self.assertEqual(1 != our, True)
-
- # But the ordering is undefined
- self.assertRaises(TypeError, lambda: our < 1)
- self.assertRaises(TypeError, lambda: 1 < our)
-
- # Repeat those tests with a different class
-
- class SomeClass:
- pass
-
- their = SomeClass()
- self.assertEqual(our == their, False)
- self.assertEqual(their == our, False)
- self.assertEqual(our != their, True)
- self.assertEqual(their != our, True)
- self.assertRaises(TypeError, lambda: our < their)
- self.assertRaises(TypeError, lambda: their < our)
-
- # However, if the other class explicitly defines ordering
- # relative to our class, it is allowed to do so
-
- class LargerThanAnything:
- def __lt__(self, other):
- return False
- def __le__(self, other):
- return isinstance(other, LargerThanAnything)
- def __eq__(self, other):
- return isinstance(other, LargerThanAnything)
- def __ne__(self, other):
- return not isinstance(other, LargerThanAnything)
- def __gt__(self, other):
- return not isinstance(other, LargerThanAnything)
- def __ge__(self, other):
- return True
-
- their = LargerThanAnything()
- self.assertEqual(our == their, False)
- self.assertEqual(their == our, False)
- self.assertEqual(our != their, True)
- self.assertEqual(their != our, True)
- self.assertEqual(our < their, True)
- self.assertEqual(their < our, False)
-
- def test_bool(self):
- # All dates are considered true.
- self.assertTrue(self.theclass.min)
- self.assertTrue(self.theclass.max)
-
- def test_strftime_out_of_range(self):
- # For nasty technical reasons, we can't handle years before 1900.
- cls = self.theclass
- self.assertEqual(cls(1900, 1, 1).strftime("%Y"), "1900")
- for y in 1, 49, 51, 99, 100, 1000, 1899:
- self.assertRaises(ValueError, cls(y, 1, 1).strftime, "%Y")
-
- def test_replace(self):
- cls = self.theclass
- args = [1, 2, 3]
- base = cls(*args)
- self.assertEqual(base, base.replace())
-
- i = 0
- for name, newval in (("year", 2),
- ("month", 3),
- ("day", 4)):
- newargs = args[:]
- newargs[i] = newval
- expected = cls(*newargs)
- got = base.replace(**{name: newval})
- self.assertEqual(expected, got)
- i += 1
-
- # Out of bounds.
- base = cls(2000, 2, 29)
- self.assertRaises(ValueError, base.replace, year=2001)
-
- def test_subclass_date(self):
-
- class C(self.theclass):
- theAnswer = 42
-
- def __new__(cls, *args, **kws):
- temp = kws.copy()
- extra = temp.pop('extra')
- result = self.theclass.__new__(cls, *args, **temp)
- result.extra = extra
- return result
-
- def newmeth(self, start):
- return start + self.year + self.month
-
- args = 2003, 4, 14
-
- dt1 = self.theclass(*args)
- dt2 = C(*args, **{'extra': 7})
-
- self.assertEqual(dt2.__class__, C)
- self.assertEqual(dt2.theAnswer, 42)
- self.assertEqual(dt2.extra, 7)
- self.assertEqual(dt1.toordinal(), dt2.toordinal())
- self.assertEqual(dt2.newmeth(-7), dt1.year + dt1.month - 7)
-
- def test_pickling_subclass_date(self):
-
- args = 6, 7, 23
- orig = SubclassDate(*args)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
-
- def test_backdoor_resistance(self):
- # For fast unpickling, the constructor accepts a pickle byte string.
- # This is a low-overhead backdoor. A user can (by intent or
- # mistake) pass a string directly, which (if it's the right length)
- # will get treated like a pickle, and bypass the normal sanity
- # checks in the constructor. This can create insane objects.
- # The constructor doesn't want to burn the time to validate all
- # fields, but does check the month field. This stops, e.g.,
- # datetime.datetime('1995-03-25') from yielding an insane object.
- base = b'1995-03-25'
- if not issubclass(self.theclass, datetime):
- base = base[:4]
- for month_byte in b'9', b'\0', b'\r', b'\xff':
- self.assertRaises(TypeError, self.theclass,
- base[:2] + month_byte + base[3:])
- for ord_byte in range(1, 13):
- # This shouldn't blow up because of the month byte alone. If
- # the implementation changes to do more-careful checking, it may
- # blow up because other fields are insane.
- self.theclass(base[:2] + bytes([ord_byte]) + base[3:])
-
-#############################################################################
-# datetime tests
-
-class SubclassDatetime(datetime):
- sub_var = 1
-
-class TestDateTime(TestDate):
-
- theclass = datetime
-
- def test_basic_attributes(self):
- dt = self.theclass(2002, 3, 1, 12, 0)
- self.assertEqual(dt.year, 2002)
- self.assertEqual(dt.month, 3)
- self.assertEqual(dt.day, 1)
- self.assertEqual(dt.hour, 12)
- self.assertEqual(dt.minute, 0)
- self.assertEqual(dt.second, 0)
- self.assertEqual(dt.microsecond, 0)
-
- def test_basic_attributes_nonzero(self):
- # Make sure all attributes are non-zero so bugs in
- # bit-shifting access show up.
- dt = self.theclass(2002, 3, 1, 12, 59, 59, 8000)
- self.assertEqual(dt.year, 2002)
- self.assertEqual(dt.month, 3)
- self.assertEqual(dt.day, 1)
- self.assertEqual(dt.hour, 12)
- self.assertEqual(dt.minute, 59)
- self.assertEqual(dt.second, 59)
- self.assertEqual(dt.microsecond, 8000)
-
- def test_roundtrip(self):
- for dt in (self.theclass(1, 2, 3, 4, 5, 6, 7),
- self.theclass.now()):
- # Verify dt -> string -> datetime identity.
- s = repr(dt)
- self.assertTrue(s.startswith('datetime.'))
- s = s[9:]
- dt2 = eval(s)
- self.assertEqual(dt, dt2)
-
- # Verify identity via reconstructing from pieces.
- dt2 = self.theclass(dt.year, dt.month, dt.day,
- dt.hour, dt.minute, dt.second,
- dt.microsecond)
- self.assertEqual(dt, dt2)
-
- def test_isoformat(self):
- t = self.theclass(2, 3, 2, 4, 5, 1, 123)
- self.assertEqual(t.isoformat(), "0002-03-02T04:05:01.000123")
- self.assertEqual(t.isoformat('T'), "0002-03-02T04:05:01.000123")
- self.assertEqual(t.isoformat(' '), "0002-03-02 04:05:01.000123")
- # str is ISO format with the separator forced to a blank.
- self.assertEqual(str(t), "0002-03-02 04:05:01.000123")
-
- t = self.theclass(2, 3, 2)
- self.assertEqual(t.isoformat(), "0002-03-02T00:00:00")
- self.assertEqual(t.isoformat('T'), "0002-03-02T00:00:00")
- self.assertEqual(t.isoformat(' '), "0002-03-02 00:00:00")
- # str is ISO format with the separator forced to a blank.
- self.assertEqual(str(t), "0002-03-02 00:00:00")
-
- def test_format(self):
- dt = self.theclass(2007, 9, 10, 4, 5, 1, 123)
- self.assertEqual(dt.__format__(''), str(dt))
-
- # check that a derived class's __str__() gets called
- class A(self.theclass):
- def __str__(self):
- return 'A'
- a = A(2007, 9, 10, 4, 5, 1, 123)
- self.assertEqual(a.__format__(''), 'A')
-
- # check that a derived class's strftime gets called
- class B(self.theclass):
- def strftime(self, format_spec):
- return 'B'
- b = B(2007, 9, 10, 4, 5, 1, 123)
- self.assertEqual(b.__format__(''), str(dt))
-
- for fmt in ["m:%m d:%d y:%y",
- "m:%m d:%d y:%y H:%H M:%M S:%S",
- "%z %Z",
- ]:
- self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
- self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
- self.assertEqual(b.__format__(fmt), 'B')
-
- def test_more_ctime(self):
- # Test fields that TestDate doesn't touch.
- import time
-
- t = self.theclass(2002, 3, 2, 18, 3, 5, 123)
- self.assertEqual(t.ctime(), "Sat Mar 2 18:03:05 2002")
- # Oops! The next line fails on Win2K under MSVC 6, so it's commented
- # out. The difference is that t.ctime() produces " 2" for the day,
- # but platform ctime() produces "02" for the day. According to
- # C99, t.ctime() is correct here.
- # self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
-
- # So test a case where that difference doesn't matter.
- t = self.theclass(2002, 3, 22, 18, 3, 5, 123)
- self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
-
- def test_tz_independent_comparing(self):
- dt1 = self.theclass(2002, 3, 1, 9, 0, 0)
- dt2 = self.theclass(2002, 3, 1, 10, 0, 0)
- dt3 = self.theclass(2002, 3, 1, 9, 0, 0)
- self.assertEqual(dt1, dt3)
- self.assertTrue(dt2 > dt3)
-
- # Make sure comparison doesn't forget microseconds, and isn't done
- # via comparing a float timestamp (an IEEE double doesn't have enough
- # precision to span microsecond resolution across years 1 thru 9999,
- # so comparing via timestamp necessarily calls some distinct values
- # equal).
- dt1 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999998)
- us = timedelta(microseconds=1)
- dt2 = dt1 + us
- self.assertEqual(dt2 - dt1, us)
- self.assertTrue(dt1 < dt2)
-
- def test_strftime_with_bad_tzname_replace(self):
- # verify ok if tzinfo.tzname().replace() returns a non-string
- class MyTzInfo(FixedOffset):
- def tzname(self, dt):
- class MyStr(str):
- def replace(self, *args):
- return None
- return MyStr('name')
- t = self.theclass(2005, 3, 2, 0, 0, 0, 0, MyTzInfo(3, 'name'))
- self.assertRaises(TypeError, t.strftime, '%Z')
-
- def test_bad_constructor_arguments(self):
- # bad years
- self.theclass(MINYEAR, 1, 1) # no exception
- self.theclass(MAXYEAR, 1, 1) # no exception
- self.assertRaises(ValueError, self.theclass, MINYEAR-1, 1, 1)
- self.assertRaises(ValueError, self.theclass, MAXYEAR+1, 1, 1)
- # bad months
- self.theclass(2000, 1, 1) # no exception
- self.theclass(2000, 12, 1) # no exception
- self.assertRaises(ValueError, self.theclass, 2000, 0, 1)
- self.assertRaises(ValueError, self.theclass, 2000, 13, 1)
- # bad days
- self.theclass(2000, 2, 29) # no exception
- self.theclass(2004, 2, 29) # no exception
- self.theclass(2400, 2, 29) # no exception
- self.assertRaises(ValueError, self.theclass, 2000, 2, 30)
- self.assertRaises(ValueError, self.theclass, 2001, 2, 29)
- self.assertRaises(ValueError, self.theclass, 2100, 2, 29)
- self.assertRaises(ValueError, self.theclass, 1900, 2, 29)
- self.assertRaises(ValueError, self.theclass, 2000, 1, 0)
- self.assertRaises(ValueError, self.theclass, 2000, 1, 32)
- # bad hours
- self.theclass(2000, 1, 31, 0) # no exception
- self.theclass(2000, 1, 31, 23) # no exception
- self.assertRaises(ValueError, self.theclass, 2000, 1, 31, -1)
- self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 24)
- # bad minutes
- self.theclass(2000, 1, 31, 23, 0) # no exception
- self.theclass(2000, 1, 31, 23, 59) # no exception
- self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, -1)
- self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 60)
- # bad seconds
- self.theclass(2000, 1, 31, 23, 59, 0) # no exception
- self.theclass(2000, 1, 31, 23, 59, 59) # no exception
- self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 59, -1)
- self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 59, 60)
- # bad microseconds
- self.theclass(2000, 1, 31, 23, 59, 59, 0) # no exception
- self.theclass(2000, 1, 31, 23, 59, 59, 999999) # no exception
- self.assertRaises(ValueError, self.theclass,
- 2000, 1, 31, 23, 59, 59, -1)
- self.assertRaises(ValueError, self.theclass,
- 2000, 1, 31, 23, 59, 59,
- 1000000)
-
- def test_hash_equality(self):
- d = self.theclass(2000, 12, 31, 23, 30, 17)
- e = self.theclass(2000, 12, 31, 23, 30, 17)
- self.assertEqual(d, e)
- self.assertEqual(hash(d), hash(e))
-
- dic = {d: 1}
- dic[e] = 2
- self.assertEqual(len(dic), 1)
- self.assertEqual(dic[d], 2)
- self.assertEqual(dic[e], 2)
-
- d = self.theclass(2001, 1, 1, 0, 5, 17)
- e = self.theclass(2001, 1, 1, 0, 5, 17)
- self.assertEqual(d, e)
- self.assertEqual(hash(d), hash(e))
-
- dic = {d: 1}
- dic[e] = 2
- self.assertEqual(len(dic), 1)
- self.assertEqual(dic[d], 2)
- self.assertEqual(dic[e], 2)
-
- def test_computations(self):
- a = self.theclass(2002, 1, 31)
- b = self.theclass(1956, 1, 31)
- diff = a-b
- self.assertEqual(diff.days, 46*365 + len(range(1956, 2002, 4)))
- self.assertEqual(diff.seconds, 0)
- self.assertEqual(diff.microseconds, 0)
- a = self.theclass(2002, 3, 2, 17, 6)
- millisec = timedelta(0, 0, 1000)
- hour = timedelta(0, 3600)
- day = timedelta(1)
- week = timedelta(7)
- self.assertEqual(a + hour, self.theclass(2002, 3, 2, 18, 6))
- self.assertEqual(hour + a, self.theclass(2002, 3, 2, 18, 6))
- self.assertEqual(a + 10*hour, self.theclass(2002, 3, 3, 3, 6))
- self.assertEqual(a - hour, self.theclass(2002, 3, 2, 16, 6))
- self.assertEqual(-hour + a, self.theclass(2002, 3, 2, 16, 6))
- self.assertEqual(a - hour, a + -hour)
- self.assertEqual(a - 20*hour, self.theclass(2002, 3, 1, 21, 6))
- self.assertEqual(a + day, self.theclass(2002, 3, 3, 17, 6))
- self.assertEqual(a - day, self.theclass(2002, 3, 1, 17, 6))
- self.assertEqual(a + week, self.theclass(2002, 3, 9, 17, 6))
- self.assertEqual(a - week, self.theclass(2002, 2, 23, 17, 6))
- self.assertEqual(a + 52*week, self.theclass(2003, 3, 1, 17, 6))
- self.assertEqual(a - 52*week, self.theclass(2001, 3, 3, 17, 6))
- self.assertEqual((a + week) - a, week)
- self.assertEqual((a + day) - a, day)
- self.assertEqual((a + hour) - a, hour)
- self.assertEqual((a + millisec) - a, millisec)
- self.assertEqual((a - week) - a, -week)
- self.assertEqual((a - day) - a, -day)
- self.assertEqual((a - hour) - a, -hour)
- self.assertEqual((a - millisec) - a, -millisec)
- self.assertEqual(a - (a + week), -week)
- self.assertEqual(a - (a + day), -day)
- self.assertEqual(a - (a + hour), -hour)
- self.assertEqual(a - (a + millisec), -millisec)
- self.assertEqual(a - (a - week), week)
- self.assertEqual(a - (a - day), day)
- self.assertEqual(a - (a - hour), hour)
- self.assertEqual(a - (a - millisec), millisec)
- self.assertEqual(a + (week + day + hour + millisec),
- self.theclass(2002, 3, 10, 18, 6, 0, 1000))
- self.assertEqual(a + (week + day + hour + millisec),
- (((a + week) + day) + hour) + millisec)
- self.assertEqual(a - (week + day + hour + millisec),
- self.theclass(2002, 2, 22, 16, 5, 59, 999000))
- self.assertEqual(a - (week + day + hour + millisec),
- (((a - week) - day) - hour) - millisec)
- # Add/sub ints, longs, floats should be illegal
- for i in 1, 1, 1.0:
- self.assertRaises(TypeError, lambda: a+i)
- self.assertRaises(TypeError, lambda: a-i)
- self.assertRaises(TypeError, lambda: i+a)
- self.assertRaises(TypeError, lambda: i-a)
-
- # delta - datetime is senseless.
- self.assertRaises(TypeError, lambda: day - a)
- # mixing datetime and (delta or datetime) via * or // is senseless
- self.assertRaises(TypeError, lambda: day * a)
- self.assertRaises(TypeError, lambda: a * day)
- self.assertRaises(TypeError, lambda: day // a)
- self.assertRaises(TypeError, lambda: a // day)
- self.assertRaises(TypeError, lambda: a * a)
- self.assertRaises(TypeError, lambda: a // a)
- # datetime + datetime is senseless
- self.assertRaises(TypeError, lambda: a + a)
-
- def test_pickling(self):
- args = 6, 7, 23, 20, 59, 1, 64**2
- orig = self.theclass(*args)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
-
- def test_more_pickling(self):
- a = self.theclass(2003, 2, 7, 16, 48, 37, 444116)
- s = pickle.dumps(a)
- b = pickle.loads(s)
- self.assertEqual(b.year, 2003)
- self.assertEqual(b.month, 2)
- self.assertEqual(b.day, 7)
-
- def test_pickling_subclass_datetime(self):
- args = 6, 7, 23, 20, 59, 1, 64**2
- orig = SubclassDatetime(*args)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
-
- def test_more_compare(self):
- # The test_compare() inherited from TestDate covers the error cases.
- # We just want to test lexicographic ordering on the members datetime
- # has that date lacks.
- args = [2000, 11, 29, 20, 58, 16, 999998]
- t1 = self.theclass(*args)
- t2 = self.theclass(*args)
- self.assertEqual(t1, t2)
- self.assertTrue(t1 <= t2)
- self.assertTrue(t1 >= t2)
- self.assertTrue(not t1 != t2)
- self.assertTrue(not t1 < t2)
- self.assertTrue(not t1 > t2)
-
- for i in range(len(args)):
- newargs = args[:]
- newargs[i] = args[i] + 1
- t2 = self.theclass(*newargs) # this is larger than t1
- self.assertTrue(t1 < t2)
- self.assertTrue(t2 > t1)
- self.assertTrue(t1 <= t2)
- self.assertTrue(t2 >= t1)
- self.assertTrue(t1 != t2)
- self.assertTrue(t2 != t1)
- self.assertTrue(not t1 == t2)
- self.assertTrue(not t2 == t1)
- self.assertTrue(not t1 > t2)
- self.assertTrue(not t2 < t1)
- self.assertTrue(not t1 >= t2)
- self.assertTrue(not t2 <= t1)
-
-
- # A helper for timestamp constructor tests.
- def verify_field_equality(self, expected, got):
- self.assertEqual(expected.tm_year, got.year)
- self.assertEqual(expected.tm_mon, got.month)
- self.assertEqual(expected.tm_mday, got.day)
- self.assertEqual(expected.tm_hour, got.hour)
- self.assertEqual(expected.tm_min, got.minute)
- self.assertEqual(expected.tm_sec, got.second)
-
- def test_fromtimestamp(self):
- import time
-
- ts = time.time()
- expected = time.localtime(ts)
- got = self.theclass.fromtimestamp(ts)
- self.verify_field_equality(expected, got)
-
- def test_utcfromtimestamp(self):
- import time
-
- ts = time.time()
- expected = time.gmtime(ts)
- got = self.theclass.utcfromtimestamp(ts)
- self.verify_field_equality(expected, got)
-
- def test_microsecond_rounding(self):
- # Test whether fromtimestamp "rounds up" floats that are less
- # than one microsecond smaller than an integer.
- self.assertEqual(self.theclass.fromtimestamp(0.9999999),
- self.theclass.fromtimestamp(1))
-
- def test_insane_fromtimestamp(self):
- # It's possible that some platform maps time_t to double,
- # and that this test will fail there. This test should
- # exempt such platforms (provided they return reasonable
- # results!).
- for insane in -1e200, 1e200:
- self.assertRaises(ValueError, self.theclass.fromtimestamp,
- insane)
-
- def test_insane_utcfromtimestamp(self):
- # It's possible that some platform maps time_t to double,
- # and that this test will fail there. This test should
- # exempt such platforms (provided they return reasonable
- # results!).
- for insane in -1e200, 1e200:
- self.assertRaises(ValueError, self.theclass.utcfromtimestamp,
- insane)
- @unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
- def test_negative_float_fromtimestamp(self):
- # The result is tz-dependent; at least test that this doesn't
- # fail (like it did before bug 1646728 was fixed).
- self.theclass.fromtimestamp(-1.05)
-
- @unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
- def test_negative_float_utcfromtimestamp(self):
- d = self.theclass.utcfromtimestamp(-1.05)
- self.assertEqual(d, self.theclass(1969, 12, 31, 23, 59, 58, 950000))
-
- def test_utcnow(self):
- import time
-
- # Call it a success if utcnow() and utcfromtimestamp() are within
- # a second of each other.
- tolerance = timedelta(seconds=1)
- for dummy in range(3):
- from_now = self.theclass.utcnow()
- from_timestamp = self.theclass.utcfromtimestamp(time.time())
- if abs(from_timestamp - from_now) <= tolerance:
- break
- # Else try again a few times.
- self.assertTrue(abs(from_timestamp - from_now) <= tolerance)
-
- def test_strptime(self):
- import _strptime
-
- string = '2004-12-01 13:02:47.197'
- format = '%Y-%m-%d %H:%M:%S.%f'
- result, frac = _strptime._strptime(string, format)
- expected = self.theclass(*(result[0:6]+(frac,)))
- got = self.theclass.strptime(string, format)
- self.assertEqual(expected, got)
-
- def test_more_timetuple(self):
- # This tests fields beyond those tested by the TestDate.test_timetuple.
- t = self.theclass(2004, 12, 31, 6, 22, 33)
- self.assertEqual(t.timetuple(), (2004, 12, 31, 6, 22, 33, 4, 366, -1))
- self.assertEqual(t.timetuple(),
- (t.year, t.month, t.day,
- t.hour, t.minute, t.second,
- t.weekday(),
- t.toordinal() - date(t.year, 1, 1).toordinal() + 1,
- -1))
- tt = t.timetuple()
- self.assertEqual(tt.tm_year, t.year)
- self.assertEqual(tt.tm_mon, t.month)
- self.assertEqual(tt.tm_mday, t.day)
- self.assertEqual(tt.tm_hour, t.hour)
- self.assertEqual(tt.tm_min, t.minute)
- self.assertEqual(tt.tm_sec, t.second)
- self.assertEqual(tt.tm_wday, t.weekday())
- self.assertEqual(tt.tm_yday, t.toordinal() -
- date(t.year, 1, 1).toordinal() + 1)
- self.assertEqual(tt.tm_isdst, -1)
-
- def test_more_strftime(self):
- # This tests fields beyond those tested by the TestDate.test_strftime.
- t = self.theclass(2004, 12, 31, 6, 22, 33, 47)
- self.assertEqual(t.strftime("%m %d %y %f %S %M %H %j"),
- "12 31 04 000047 33 22 06 366")
-
- def test_extract(self):
- dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234)
- self.assertEqual(dt.date(), date(2002, 3, 4))
- self.assertEqual(dt.time(), time(18, 45, 3, 1234))
-
- def test_combine(self):
- d = date(2002, 3, 4)
- t = time(18, 45, 3, 1234)
- expected = self.theclass(2002, 3, 4, 18, 45, 3, 1234)
- combine = self.theclass.combine
- dt = combine(d, t)
- self.assertEqual(dt, expected)
-
- dt = combine(time=t, date=d)
- self.assertEqual(dt, expected)
-
- self.assertEqual(d, dt.date())
- self.assertEqual(t, dt.time())
- self.assertEqual(dt, combine(dt.date(), dt.time()))
-
- self.assertRaises(TypeError, combine) # need an arg
- self.assertRaises(TypeError, combine, d) # need two args
- self.assertRaises(TypeError, combine, t, d) # args reversed
- self.assertRaises(TypeError, combine, d, t, 1) # too many args
- self.assertRaises(TypeError, combine, "date", "time") # wrong types
-
- def test_replace(self):
- cls = self.theclass
- args = [1, 2, 3, 4, 5, 6, 7]
- base = cls(*args)
- self.assertEqual(base, base.replace())
-
- i = 0
- for name, newval in (("year", 2),
- ("month", 3),
- ("day", 4),
- ("hour", 5),
- ("minute", 6),
- ("second", 7),
- ("microsecond", 8)):
- newargs = args[:]
- newargs[i] = newval
- expected = cls(*newargs)
- got = base.replace(**{name: newval})
- self.assertEqual(expected, got)
- i += 1
-
- # Out of bounds.
- base = cls(2000, 2, 29)
- self.assertRaises(ValueError, base.replace, year=2001)
-
- def test_astimezone(self):
- # Pretty boring! The TZ test is more interesting here. astimezone()
- # simply can't be applied to a naive object.
- dt = self.theclass.now()
- f = FixedOffset(44, "")
- self.assertRaises(TypeError, dt.astimezone) # not enough args
- self.assertRaises(TypeError, dt.astimezone, f, f) # too many args
- self.assertRaises(TypeError, dt.astimezone, dt) # arg wrong type
- self.assertRaises(ValueError, dt.astimezone, f) # naive
- self.assertRaises(ValueError, dt.astimezone, tz=f) # naive
-
- class Bogus(tzinfo):
- def utcoffset(self, dt): return None
- def dst(self, dt): return timedelta(0)
- bog = Bogus()
- self.assertRaises(ValueError, dt.astimezone, bog) # naive
-
- class AlsoBogus(tzinfo):
- def utcoffset(self, dt): return timedelta(0)
- def dst(self, dt): return None
- alsobog = AlsoBogus()
- self.assertRaises(ValueError, dt.astimezone, alsobog) # also naive
-
- def test_subclass_datetime(self):
-
- class C(self.theclass):
- theAnswer = 42
-
- def __new__(cls, *args, **kws):
- temp = kws.copy()
- extra = temp.pop('extra')
- result = self.theclass.__new__(cls, *args, **temp)
- result.extra = extra
- return result
-
- def newmeth(self, start):
- return start + self.year + self.month + self.second
-
- args = 2003, 4, 14, 12, 13, 41
-
- dt1 = self.theclass(*args)
- dt2 = C(*args, **{'extra': 7})
-
- self.assertEqual(dt2.__class__, C)
- self.assertEqual(dt2.theAnswer, 42)
- self.assertEqual(dt2.extra, 7)
- self.assertEqual(dt1.toordinal(), dt2.toordinal())
- self.assertEqual(dt2.newmeth(-7), dt1.year + dt1.month +
- dt1.second - 7)
-
-class SubclassTime(time):
- sub_var = 1
-
-class TestTime(HarmlessMixedComparison, unittest.TestCase):
-
- theclass = time
-
- def test_basic_attributes(self):
- t = self.theclass(12, 0)
- self.assertEqual(t.hour, 12)
- self.assertEqual(t.minute, 0)
- self.assertEqual(t.second, 0)
- self.assertEqual(t.microsecond, 0)
-
- def test_basic_attributes_nonzero(self):
- # Make sure all attributes are non-zero so bugs in
- # bit-shifting access show up.
- t = self.theclass(12, 59, 59, 8000)
- self.assertEqual(t.hour, 12)
- self.assertEqual(t.minute, 59)
- self.assertEqual(t.second, 59)
- self.assertEqual(t.microsecond, 8000)
-
- def test_roundtrip(self):
- t = self.theclass(1, 2, 3, 4)
-
- # Verify t -> string -> time identity.
- s = repr(t)
- self.assertTrue(s.startswith('datetime.'))
- s = s[9:]
- t2 = eval(s)
- self.assertEqual(t, t2)
-
- # Verify identity via reconstructing from pieces.
- t2 = self.theclass(t.hour, t.minute, t.second,
- t.microsecond)
- self.assertEqual(t, t2)
-
- def test_comparing(self):
- args = [1, 2, 3, 4]
- t1 = self.theclass(*args)
- t2 = self.theclass(*args)
- self.assertEqual(t1, t2)
- self.assertTrue(t1 <= t2)
- self.assertTrue(t1 >= t2)
- self.assertTrue(not t1 != t2)
- self.assertTrue(not t1 < t2)
- self.assertTrue(not t1 > t2)
-
- for i in range(len(args)):
- newargs = args[:]
- newargs[i] = args[i] + 1
- t2 = self.theclass(*newargs) # this is larger than t1
- self.assertTrue(t1 < t2)
- self.assertTrue(t2 > t1)
- self.assertTrue(t1 <= t2)
- self.assertTrue(t2 >= t1)
- self.assertTrue(t1 != t2)
- self.assertTrue(t2 != t1)
- self.assertTrue(not t1 == t2)
- self.assertTrue(not t2 == t1)
- self.assertTrue(not t1 > t2)
- self.assertTrue(not t2 < t1)
- self.assertTrue(not t1 >= t2)
- self.assertTrue(not t2 <= t1)
-
- for badarg in OTHERSTUFF:
- self.assertEqual(t1 == badarg, False)
- self.assertEqual(t1 != badarg, True)
- self.assertEqual(badarg == t1, False)
- self.assertEqual(badarg != t1, True)
-
- self.assertRaises(TypeError, lambda: t1 <= badarg)
- self.assertRaises(TypeError, lambda: t1 < badarg)
- self.assertRaises(TypeError, lambda: t1 > badarg)
- self.assertRaises(TypeError, lambda: t1 >= badarg)
- self.assertRaises(TypeError, lambda: badarg <= t1)
- self.assertRaises(TypeError, lambda: badarg < t1)
- self.assertRaises(TypeError, lambda: badarg > t1)
- self.assertRaises(TypeError, lambda: badarg >= t1)
-
- def test_bad_constructor_arguments(self):
- # bad hours
- self.theclass(0, 0) # no exception
- self.theclass(23, 0) # no exception
- self.assertRaises(ValueError, self.theclass, -1, 0)
- self.assertRaises(ValueError, self.theclass, 24, 0)
- # bad minutes
- self.theclass(23, 0) # no exception
- self.theclass(23, 59) # no exception
- self.assertRaises(ValueError, self.theclass, 23, -1)
- self.assertRaises(ValueError, self.theclass, 23, 60)
- # bad seconds
- self.theclass(23, 59, 0) # no exception
- self.theclass(23, 59, 59) # no exception
- self.assertRaises(ValueError, self.theclass, 23, 59, -1)
- self.assertRaises(ValueError, self.theclass, 23, 59, 60)
- # bad microseconds
- self.theclass(23, 59, 59, 0) # no exception
- self.theclass(23, 59, 59, 999999) # no exception
- self.assertRaises(ValueError, self.theclass, 23, 59, 59, -1)
- self.assertRaises(ValueError, self.theclass, 23, 59, 59, 1000000)
-
- def test_hash_equality(self):
- d = self.theclass(23, 30, 17)
- e = self.theclass(23, 30, 17)
- self.assertEqual(d, e)
- self.assertEqual(hash(d), hash(e))
-
- dic = {d: 1}
- dic[e] = 2
- self.assertEqual(len(dic), 1)
- self.assertEqual(dic[d], 2)
- self.assertEqual(dic[e], 2)
-
- d = self.theclass(0, 5, 17)
- e = self.theclass(0, 5, 17)
- self.assertEqual(d, e)
- self.assertEqual(hash(d), hash(e))
-
- dic = {d: 1}
- dic[e] = 2
- self.assertEqual(len(dic), 1)
- self.assertEqual(dic[d], 2)
- self.assertEqual(dic[e], 2)
-
- def test_isoformat(self):
- t = self.theclass(4, 5, 1, 123)
- self.assertEqual(t.isoformat(), "04:05:01.000123")
- self.assertEqual(t.isoformat(), str(t))
-
- t = self.theclass()
- self.assertEqual(t.isoformat(), "00:00:00")
- self.assertEqual(t.isoformat(), str(t))
-
- t = self.theclass(microsecond=1)
- self.assertEqual(t.isoformat(), "00:00:00.000001")
- self.assertEqual(t.isoformat(), str(t))
-
- t = self.theclass(microsecond=10)
- self.assertEqual(t.isoformat(), "00:00:00.000010")
- self.assertEqual(t.isoformat(), str(t))
-
- t = self.theclass(microsecond=100)
- self.assertEqual(t.isoformat(), "00:00:00.000100")
- self.assertEqual(t.isoformat(), str(t))
-
- t = self.theclass(microsecond=1000)
- self.assertEqual(t.isoformat(), "00:00:00.001000")
- self.assertEqual(t.isoformat(), str(t))
-
- t = self.theclass(microsecond=10000)
- self.assertEqual(t.isoformat(), "00:00:00.010000")
- self.assertEqual(t.isoformat(), str(t))
-
- t = self.theclass(microsecond=100000)
- self.assertEqual(t.isoformat(), "00:00:00.100000")
- self.assertEqual(t.isoformat(), str(t))
-
- def test_1653736(self):
- # verify it doesn't accept extra keyword arguments
- t = self.theclass(second=1)
- self.assertRaises(TypeError, t.isoformat, foo=3)
-
- def test_strftime(self):
- t = self.theclass(1, 2, 3, 4)
- self.assertEqual(t.strftime('%H %M %S %f'), "01 02 03 000004")
- # A naive object replaces %z and %Z with empty strings.
- self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
-
- def test_format(self):
- t = self.theclass(1, 2, 3, 4)
- self.assertEqual(t.__format__(''), str(t))
-
- # check that a derived class's __str__() gets called
- class A(self.theclass):
- def __str__(self):
- return 'A'
- a = A(1, 2, 3, 4)
- self.assertEqual(a.__format__(''), 'A')
-
- # check that a derived class's strftime gets called
- class B(self.theclass):
- def strftime(self, format_spec):
- return 'B'
- b = B(1, 2, 3, 4)
- self.assertEqual(b.__format__(''), str(t))
-
- for fmt in ['%H %M %S',
- ]:
- self.assertEqual(t.__format__(fmt), t.strftime(fmt))
- self.assertEqual(a.__format__(fmt), t.strftime(fmt))
- self.assertEqual(b.__format__(fmt), 'B')
-
- def test_str(self):
- self.assertEqual(str(self.theclass(1, 2, 3, 4)), "01:02:03.000004")
- self.assertEqual(str(self.theclass(10, 2, 3, 4000)), "10:02:03.004000")
- self.assertEqual(str(self.theclass(0, 2, 3, 400000)), "00:02:03.400000")
- self.assertEqual(str(self.theclass(12, 2, 3, 0)), "12:02:03")
- self.assertEqual(str(self.theclass(23, 15, 0, 0)), "23:15:00")
-
- def test_repr(self):
- name = 'datetime.' + self.theclass.__name__
- self.assertEqual(repr(self.theclass(1, 2, 3, 4)),
- "%s(1, 2, 3, 4)" % name)
- self.assertEqual(repr(self.theclass(10, 2, 3, 4000)),
- "%s(10, 2, 3, 4000)" % name)
- self.assertEqual(repr(self.theclass(0, 2, 3, 400000)),
- "%s(0, 2, 3, 400000)" % name)
- self.assertEqual(repr(self.theclass(12, 2, 3, 0)),
- "%s(12, 2, 3)" % name)
- self.assertEqual(repr(self.theclass(23, 15, 0, 0)),
- "%s(23, 15)" % name)
-
- def test_resolution_info(self):
- self.assertTrue(isinstance(self.theclass.min, self.theclass))
- self.assertTrue(isinstance(self.theclass.max, self.theclass))
- self.assertTrue(isinstance(self.theclass.resolution, timedelta))
- self.assertTrue(self.theclass.max > self.theclass.min)
-
- def test_pickling(self):
- args = 20, 59, 16, 64**2
- orig = self.theclass(*args)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
-
- def test_pickling_subclass_time(self):
- args = 20, 59, 16, 64**2
- orig = SubclassTime(*args)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
-
- def test_bool(self):
- cls = self.theclass
- self.assertTrue(cls(1))
- self.assertTrue(cls(0, 1))
- self.assertTrue(cls(0, 0, 1))
- self.assertTrue(cls(0, 0, 0, 1))
- self.assertTrue(not cls(0))
- self.assertTrue(not cls())
-
- def test_replace(self):
- cls = self.theclass
- args = [1, 2, 3, 4]
- base = cls(*args)
- self.assertEqual(base, base.replace())
-
- i = 0
- for name, newval in (("hour", 5),
- ("minute", 6),
- ("second", 7),
- ("microsecond", 8)):
- newargs = args[:]
- newargs[i] = newval
- expected = cls(*newargs)
- got = base.replace(**{name: newval})
- self.assertEqual(expected, got)
- i += 1
-
- # Out of bounds.
- base = cls(1)
- self.assertRaises(ValueError, base.replace, hour=24)
- self.assertRaises(ValueError, base.replace, minute=-1)
- self.assertRaises(ValueError, base.replace, second=100)
- self.assertRaises(ValueError, base.replace, microsecond=1000000)
-
- def test_subclass_time(self):
-
- class C(self.theclass):
- theAnswer = 42
-
- def __new__(cls, *args, **kws):
- temp = kws.copy()
- extra = temp.pop('extra')
- result = self.theclass.__new__(cls, *args, **temp)
- result.extra = extra
- return result
-
- def newmeth(self, start):
- return start + self.hour + self.second
-
- args = 4, 5, 6
-
- dt1 = self.theclass(*args)
- dt2 = C(*args, **{'extra': 7})
-
- self.assertEqual(dt2.__class__, C)
- self.assertEqual(dt2.theAnswer, 42)
- self.assertEqual(dt2.extra, 7)
- self.assertEqual(dt1.isoformat(), dt2.isoformat())
- self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.second - 7)
-
- def test_backdoor_resistance(self):
- # see TestDate.test_backdoor_resistance().
- base = '2:59.0'
- for hour_byte in ' ', '9', chr(24), '\xff':
- self.assertRaises(TypeError, self.theclass,
- hour_byte + base[1:])
-
-# A mixin for classes with a tzinfo= argument. Subclasses must define
-# theclass as a class atribute, and theclass(1, 1, 1, tzinfo=whatever)
-# must be legit (which is true for time and datetime).
-class TZInfoBase:
-
- def test_argument_passing(self):
- cls = self.theclass
- # A datetime passes itself on, a time passes None.
- class introspective(tzinfo):
- def tzname(self, dt): return dt and "real" or "none"
- def utcoffset(self, dt):
- return timedelta(minutes = dt and 42 or -42)
- dst = utcoffset
-
- obj = cls(1, 2, 3, tzinfo=introspective())
-
- expected = cls is time and "none" or "real"
- self.assertEqual(obj.tzname(), expected)
-
- expected = timedelta(minutes=(cls is time and -42 or 42))
- self.assertEqual(obj.utcoffset(), expected)
- self.assertEqual(obj.dst(), expected)
-
- def test_bad_tzinfo_classes(self):
- cls = self.theclass
- self.assertRaises(TypeError, cls, 1, 1, 1, tzinfo=12)
-
- class NiceTry(object):
- def __init__(self): pass
- def utcoffset(self, dt): pass
- self.assertRaises(TypeError, cls, 1, 1, 1, tzinfo=NiceTry)
-
- class BetterTry(tzinfo):
- def __init__(self): pass
- def utcoffset(self, dt): pass
- b = BetterTry()
- t = cls(1, 1, 1, tzinfo=b)
- self.assertTrue(t.tzinfo is b)
-
- def test_utc_offset_out_of_bounds(self):
- class Edgy(tzinfo):
- def __init__(self, offset):
- self.offset = timedelta(minutes=offset)
- def utcoffset(self, dt):
- return self.offset
-
- cls = self.theclass
- for offset, legit in ((-1440, False),
- (-1439, True),
- (1439, True),
- (1440, False)):
- if cls is time:
- t = cls(1, 2, 3, tzinfo=Edgy(offset))
- elif cls is datetime:
- t = cls(6, 6, 6, 1, 2, 3, tzinfo=Edgy(offset))
- else:
- assert 0, "impossible"
- if legit:
- aofs = abs(offset)
- h, m = divmod(aofs, 60)
- tag = "%c%02d:%02d" % (offset < 0 and '-' or '+', h, m)
- if isinstance(t, datetime):
- t = t.timetz()
- self.assertEqual(str(t), "01:02:03" + tag)
- else:
- self.assertRaises(ValueError, str, t)
-
- def test_tzinfo_classes(self):
- cls = self.theclass
- class C1(tzinfo):
- def utcoffset(self, dt): return None
- def dst(self, dt): return None
- def tzname(self, dt): return None
- for t in (cls(1, 1, 1),
- cls(1, 1, 1, tzinfo=None),
- cls(1, 1, 1, tzinfo=C1())):
- self.assertTrue(t.utcoffset() is None)
- self.assertTrue(t.dst() is None)
- self.assertTrue(t.tzname() is None)
-
- class C3(tzinfo):
- def utcoffset(self, dt): return timedelta(minutes=-1439)
- def dst(self, dt): return timedelta(minutes=1439)
- def tzname(self, dt): return "aname"
- t = cls(1, 1, 1, tzinfo=C3())
- self.assertEqual(t.utcoffset(), timedelta(minutes=-1439))
- self.assertEqual(t.dst(), timedelta(minutes=1439))
- self.assertEqual(t.tzname(), "aname")
-
- # Wrong types.
- class C4(tzinfo):
- def utcoffset(self, dt): return "aname"
- def dst(self, dt): return 7
- def tzname(self, dt): return 0
- t = cls(1, 1, 1, tzinfo=C4())
- self.assertRaises(TypeError, t.utcoffset)
- self.assertRaises(TypeError, t.dst)
- self.assertRaises(TypeError, t.tzname)
-
- # Offset out of range.
- class C6(tzinfo):
- def utcoffset(self, dt): return timedelta(hours=-24)
- def dst(self, dt): return timedelta(hours=24)
- t = cls(1, 1, 1, tzinfo=C6())
- self.assertRaises(ValueError, t.utcoffset)
- self.assertRaises(ValueError, t.dst)
-
- # Not a whole number of minutes.
- class C7(tzinfo):
- def utcoffset(self, dt): return timedelta(seconds=61)
- def dst(self, dt): return timedelta(microseconds=-81)
- t = cls(1, 1, 1, tzinfo=C7())
- self.assertRaises(ValueError, t.utcoffset)
- self.assertRaises(ValueError, t.dst)
-
- def test_aware_compare(self):
- cls = self.theclass
-
- # Ensure that utcoffset() gets ignored if the comparands have
- # the same tzinfo member.
- class OperandDependentOffset(tzinfo):
- def utcoffset(self, t):
- if t.minute < 10:
- # d0 and d1 equal after adjustment
- return timedelta(minutes=t.minute)
- else:
- # d2 off in the weeds
- return timedelta(minutes=59)
-
- base = cls(8, 9, 10, tzinfo=OperandDependentOffset())
- d0 = base.replace(minute=3)
- d1 = base.replace(minute=9)
- d2 = base.replace(minute=11)
- for x in d0, d1, d2:
- for y in d0, d1, d2:
- for op in lt, le, gt, ge, eq, ne:
- got = op(x, y)
- expected = op(x.minute, y.minute)
- self.assertEqual(got, expected)
-
- # However, if they're different members, uctoffset is not ignored.
- # Note that a time can't actually have an operand-depedent offset,
- # though (and time.utcoffset() passes None to tzinfo.utcoffset()),
- # so skip this test for time.
- if cls is not time:
- d0 = base.replace(minute=3, tzinfo=OperandDependentOffset())
- d1 = base.replace(minute=9, tzinfo=OperandDependentOffset())
- d2 = base.replace(minute=11, tzinfo=OperandDependentOffset())
- for x in d0, d1, d2:
- for y in d0, d1, d2:
- got = (x > y) - (x < y)
- if (x is d0 or x is d1) and (y is d0 or y is d1):
- expected = 0
- elif x is y is d2:
- expected = 0
- elif x is d2:
- expected = -1
- else:
- assert y is d2
- expected = 1
- self.assertEqual(got, expected)
-
-
-# Testing time objects with a non-None tzinfo.
-class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
- theclass = time
-
- def test_empty(self):
- t = self.theclass()
- self.assertEqual(t.hour, 0)
- self.assertEqual(t.minute, 0)
- self.assertEqual(t.second, 0)
- self.assertEqual(t.microsecond, 0)
- self.assertTrue(t.tzinfo is None)
-
- def test_zones(self):
- est = FixedOffset(-300, "EST", 1)
- utc = FixedOffset(0, "UTC", -2)
- met = FixedOffset(60, "MET", 3)
- t1 = time( 7, 47, tzinfo=est)
- t2 = time(12, 47, tzinfo=utc)
- t3 = time(13, 47, tzinfo=met)
- t4 = time(microsecond=40)
- t5 = time(microsecond=40, tzinfo=utc)
-
- self.assertEqual(t1.tzinfo, est)
- self.assertEqual(t2.tzinfo, utc)
- self.assertEqual(t3.tzinfo, met)
- self.assertTrue(t4.tzinfo is None)
- self.assertEqual(t5.tzinfo, utc)
-
- self.assertEqual(t1.utcoffset(), timedelta(minutes=-300))
- self.assertEqual(t2.utcoffset(), timedelta(minutes=0))
- self.assertEqual(t3.utcoffset(), timedelta(minutes=60))
- self.assertTrue(t4.utcoffset() is None)
- self.assertRaises(TypeError, t1.utcoffset, "no args")
-
- self.assertEqual(t1.tzname(), "EST")
- self.assertEqual(t2.tzname(), "UTC")
- self.assertEqual(t3.tzname(), "MET")
- self.assertTrue(t4.tzname() is None)
- self.assertRaises(TypeError, t1.tzname, "no args")
-
- self.assertEqual(t1.dst(), timedelta(minutes=1))
- self.assertEqual(t2.dst(), timedelta(minutes=-2))
- self.assertEqual(t3.dst(), timedelta(minutes=3))
- self.assertTrue(t4.dst() is None)
- self.assertRaises(TypeError, t1.dst, "no args")
-
- self.assertEqual(hash(t1), hash(t2))
- self.assertEqual(hash(t1), hash(t3))
- self.assertEqual(hash(t2), hash(t3))
-
- self.assertEqual(t1, t2)
- self.assertEqual(t1, t3)
- self.assertEqual(t2, t3)
- self.assertRaises(TypeError, lambda: t4 == t5) # mixed tz-aware & naive
- self.assertRaises(TypeError, lambda: t4 < t5) # mixed tz-aware & naive
- self.assertRaises(TypeError, lambda: t5 < t4) # mixed tz-aware & naive
-
- self.assertEqual(str(t1), "07:47:00-05:00")
- self.assertEqual(str(t2), "12:47:00+00:00")
- self.assertEqual(str(t3), "13:47:00+01:00")
- self.assertEqual(str(t4), "00:00:00.000040")
- self.assertEqual(str(t5), "00:00:00.000040+00:00")
-
- self.assertEqual(t1.isoformat(), "07:47:00-05:00")
- self.assertEqual(t2.isoformat(), "12:47:00+00:00")
- self.assertEqual(t3.isoformat(), "13:47:00+01:00")
- self.assertEqual(t4.isoformat(), "00:00:00.000040")
- self.assertEqual(t5.isoformat(), "00:00:00.000040+00:00")
-
- d = 'datetime.time'
- self.assertEqual(repr(t1), d + "(7, 47, tzinfo=est)")
- self.assertEqual(repr(t2), d + "(12, 47, tzinfo=utc)")
- self.assertEqual(repr(t3), d + "(13, 47, tzinfo=met)")
- self.assertEqual(repr(t4), d + "(0, 0, 0, 40)")
- self.assertEqual(repr(t5), d + "(0, 0, 0, 40, tzinfo=utc)")
-
- self.assertEqual(t1.strftime("%H:%M:%S %%Z=%Z %%z=%z"),
- "07:47:00 %Z=EST %z=-0500")
- self.assertEqual(t2.strftime("%H:%M:%S %Z %z"), "12:47:00 UTC +0000")
- self.assertEqual(t3.strftime("%H:%M:%S %Z %z"), "13:47:00 MET +0100")
-
- yuck = FixedOffset(-1439, "%z %Z %%z%%Z")
- t1 = time(23, 59, tzinfo=yuck)
- self.assertEqual(t1.strftime("%H:%M %%Z='%Z' %%z='%z'"),
- "23:59 %Z='%z %Z %%z%%Z' %z='-2359'")
-
- # Check that an invalid tzname result raises an exception.
- class Badtzname(tzinfo):
- def tzname(self, dt): return 42
- t = time(2, 3, 4, tzinfo=Badtzname())
- self.assertEqual(t.strftime("%H:%M:%S"), "02:03:04")
- self.assertRaises(TypeError, t.strftime, "%Z")
-
- def test_hash_edge_cases(self):
- # Offsets that overflow a basic time.
- t1 = self.theclass(0, 1, 2, 3, tzinfo=FixedOffset(1439, ""))
- t2 = self.theclass(0, 0, 2, 3, tzinfo=FixedOffset(1438, ""))
- self.assertEqual(hash(t1), hash(t2))
-
- t1 = self.theclass(23, 58, 6, 100, tzinfo=FixedOffset(-1000, ""))
- t2 = self.theclass(23, 48, 6, 100, tzinfo=FixedOffset(-1010, ""))
- self.assertEqual(hash(t1), hash(t2))
-
- def test_pickling(self):
- # Try one without a tzinfo.
- args = 20, 59, 16, 64**2
- orig = self.theclass(*args)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
-
- # Try one with a tzinfo.
- tinfo = PicklableFixedOffset(-300, 'cookie')
- orig = self.theclass(5, 6, 7, tzinfo=tinfo)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
- self.assertTrue(isinstance(derived.tzinfo, PicklableFixedOffset))
- self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
- self.assertEqual(derived.tzname(), 'cookie')
-
- def test_more_bool(self):
- # Test cases with non-None tzinfo.
- cls = self.theclass
-
- t = cls(0, tzinfo=FixedOffset(-300, ""))
- self.assertTrue(t)
-
- t = cls(5, tzinfo=FixedOffset(-300, ""))
- self.assertTrue(t)
-
- t = cls(5, tzinfo=FixedOffset(300, ""))
- self.assertTrue(not t)
-
- t = cls(23, 59, tzinfo=FixedOffset(23*60 + 59, ""))
- self.assertTrue(not t)
-
- # Mostly ensuring this doesn't overflow internally.
- t = cls(0, tzinfo=FixedOffset(23*60 + 59, ""))
- self.assertTrue(t)
-
- # But this should yield a value error -- the utcoffset is bogus.
- t = cls(0, tzinfo=FixedOffset(24*60, ""))
- self.assertRaises(ValueError, lambda: bool(t))
-
- # Likewise.
- t = cls(0, tzinfo=FixedOffset(-24*60, ""))
- self.assertRaises(ValueError, lambda: bool(t))
-
- def test_replace(self):
- cls = self.theclass
- z100 = FixedOffset(100, "+100")
- zm200 = FixedOffset(timedelta(minutes=-200), "-200")
- args = [1, 2, 3, 4, z100]
- base = cls(*args)
- self.assertEqual(base, base.replace())
-
- i = 0
- for name, newval in (("hour", 5),
- ("minute", 6),
- ("second", 7),
- ("microsecond", 8),
- ("tzinfo", zm200)):
- newargs = args[:]
- newargs[i] = newval
- expected = cls(*newargs)
- got = base.replace(**{name: newval})
- self.assertEqual(expected, got)
- i += 1
-
- # Ensure we can get rid of a tzinfo.
- self.assertEqual(base.tzname(), "+100")
- base2 = base.replace(tzinfo=None)
- self.assertTrue(base2.tzinfo is None)
- self.assertTrue(base2.tzname() is None)
-
- # Ensure we can add one.
- base3 = base2.replace(tzinfo=z100)
- self.assertEqual(base, base3)
- self.assertTrue(base.tzinfo is base3.tzinfo)
-
- # Out of bounds.
- base = cls(1)
- self.assertRaises(ValueError, base.replace, hour=24)
- self.assertRaises(ValueError, base.replace, minute=-1)
- self.assertRaises(ValueError, base.replace, second=100)
- self.assertRaises(ValueError, base.replace, microsecond=1000000)
-
- def test_mixed_compare(self):
- t1 = time(1, 2, 3)
- t2 = time(1, 2, 3)
- self.assertEqual(t1, t2)
- t2 = t2.replace(tzinfo=None)
- self.assertEqual(t1, t2)
- t2 = t2.replace(tzinfo=FixedOffset(None, ""))
- self.assertEqual(t1, t2)
- t2 = t2.replace(tzinfo=FixedOffset(0, ""))
- self.assertRaises(TypeError, lambda: t1 == t2)
-
- # In time w/ identical tzinfo objects, utcoffset is ignored.
- class Varies(tzinfo):
- def __init__(self):
- self.offset = timedelta(minutes=22)
- def utcoffset(self, t):
- self.offset += timedelta(minutes=1)
- return self.offset
-
- v = Varies()
- t1 = t2.replace(tzinfo=v)
- t2 = t2.replace(tzinfo=v)
- self.assertEqual(t1.utcoffset(), timedelta(minutes=23))
- self.assertEqual(t2.utcoffset(), timedelta(minutes=24))
- self.assertEqual(t1, t2)
-
- # But if they're not identical, it isn't ignored.
- t2 = t2.replace(tzinfo=Varies())
- self.assertTrue(t1 < t2) # t1's offset counter still going up
-
- def test_subclass_timetz(self):
-
- class C(self.theclass):
- theAnswer = 42
-
- def __new__(cls, *args, **kws):
- temp = kws.copy()
- extra = temp.pop('extra')
- result = self.theclass.__new__(cls, *args, **temp)
- result.extra = extra
- return result
-
- def newmeth(self, start):
- return start + self.hour + self.second
-
- args = 4, 5, 6, 500, FixedOffset(-300, "EST", 1)
-
- dt1 = self.theclass(*args)
- dt2 = C(*args, **{'extra': 7})
-
- self.assertEqual(dt2.__class__, C)
- self.assertEqual(dt2.theAnswer, 42)
- self.assertEqual(dt2.extra, 7)
- self.assertEqual(dt1.utcoffset(), dt2.utcoffset())
- self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.second - 7)
-
-
-# Testing datetime objects with a non-None tzinfo.
-
-class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
- theclass = datetime
-
- def test_trivial(self):
- dt = self.theclass(1, 2, 3, 4, 5, 6, 7)
- self.assertEqual(dt.year, 1)
- self.assertEqual(dt.month, 2)
- self.assertEqual(dt.day, 3)
- self.assertEqual(dt.hour, 4)
- self.assertEqual(dt.minute, 5)
- self.assertEqual(dt.second, 6)
- self.assertEqual(dt.microsecond, 7)
- self.assertEqual(dt.tzinfo, None)
-
- def test_even_more_compare(self):
- # The test_compare() and test_more_compare() inherited from TestDate
- # and TestDateTime covered non-tzinfo cases.
-
- # Smallest possible after UTC adjustment.
- t1 = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, ""))
- # Largest possible after UTC adjustment.
- t2 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
- tzinfo=FixedOffset(-1439, ""))
-
- # Make sure those compare correctly, and w/o overflow.
- self.assertTrue(t1 < t2)
- self.assertTrue(t1 != t2)
- self.assertTrue(t2 > t1)
-
- self.assertEqual(t1, t1)
- self.assertEqual(t2, t2)
-
- # Equal afer adjustment.
- t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""))
- t2 = self.theclass(2, 1, 1, 3, 13, tzinfo=FixedOffset(3*60+13+2, ""))
- self.assertEqual(t1, t2)
-
- # Change t1 not to subtract a minute, and t1 should be larger.
- t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(0, ""))
- self.assertTrue(t1 > t2)
-
- # Change t1 to subtract 2 minutes, and t1 should be smaller.
- t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(2, ""))
- self.assertTrue(t1 < t2)
-
- # Back to the original t1, but make seconds resolve it.
- t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
- second=1)
- self.assertTrue(t1 > t2)
-
- # Likewise, but make microseconds resolve it.
- t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
- microsecond=1)
- self.assertTrue(t1 > t2)
-
- # Make t2 naive and it should fail.
- t2 = self.theclass.min
- self.assertRaises(TypeError, lambda: t1 == t2)
- self.assertEqual(t2, t2)
-
- # It's also naive if it has tzinfo but tzinfo.utcoffset() is None.
- class Naive(tzinfo):
- def utcoffset(self, dt): return None
- t2 = self.theclass(5, 6, 7, tzinfo=Naive())
- self.assertRaises(TypeError, lambda: t1 == t2)
- self.assertEqual(t2, t2)
-
- # OTOH, it's OK to compare two of these mixing the two ways of being
- # naive.
- t1 = self.theclass(5, 6, 7)
- self.assertEqual(t1, t2)
-
- # Try a bogus uctoffset.
- class Bogus(tzinfo):
- def utcoffset(self, dt):
- return timedelta(minutes=1440) # out of bounds
- t1 = self.theclass(2, 2, 2, tzinfo=Bogus())
- t2 = self.theclass(2, 2, 2, tzinfo=FixedOffset(0, ""))
- self.assertRaises(ValueError, lambda: t1 == t2)
-
- def test_pickling(self):
- # Try one without a tzinfo.
- args = 6, 7, 23, 20, 59, 1, 64**2
- orig = self.theclass(*args)
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
-
- # Try one with a tzinfo.
- tinfo = PicklableFixedOffset(-300, 'cookie')
- orig = self.theclass(*args, **{'tzinfo': tinfo})
- derived = self.theclass(1, 1, 1, tzinfo=FixedOffset(0, "", 0))
- for pickler, unpickler, proto in pickle_choices:
- green = pickler.dumps(orig, proto)
- derived = unpickler.loads(green)
- self.assertEqual(orig, derived)
- self.assertTrue(isinstance(derived.tzinfo,
- PicklableFixedOffset))
- self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
- self.assertEqual(derived.tzname(), 'cookie')
-
- def test_extreme_hashes(self):
- # If an attempt is made to hash these via subtracting the offset
- # then hashing a datetime object, OverflowError results. The
- # Python implementation used to blow up here.
- t = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, ""))
- hash(t)
- t = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
- tzinfo=FixedOffset(-1439, ""))
- hash(t)
-
- # OTOH, an OOB offset should blow up.
- t = self.theclass(5, 5, 5, tzinfo=FixedOffset(-1440, ""))
- self.assertRaises(ValueError, hash, t)
-
- def test_zones(self):
- est = FixedOffset(-300, "EST")
- utc = FixedOffset(0, "UTC")
- met = FixedOffset(60, "MET")
- t1 = datetime(2002, 3, 19, 7, 47, tzinfo=est)
- t2 = datetime(2002, 3, 19, 12, 47, tzinfo=utc)
- t3 = datetime(2002, 3, 19, 13, 47, tzinfo=met)
- self.assertEqual(t1.tzinfo, est)
- self.assertEqual(t2.tzinfo, utc)
- self.assertEqual(t3.tzinfo, met)
- self.assertEqual(t1.utcoffset(), timedelta(minutes=-300))
- self.assertEqual(t2.utcoffset(), timedelta(minutes=0))
- self.assertEqual(t3.utcoffset(), timedelta(minutes=60))
- self.assertEqual(t1.tzname(), "EST")
- self.assertEqual(t2.tzname(), "UTC")
- self.assertEqual(t3.tzname(), "MET")
- self.assertEqual(hash(t1), hash(t2))
- self.assertEqual(hash(t1), hash(t3))
- self.assertEqual(hash(t2), hash(t3))
- self.assertEqual(t1, t2)
- self.assertEqual(t1, t3)
- self.assertEqual(t2, t3)
- self.assertEqual(str(t1), "2002-03-19 07:47:00-05:00")
- self.assertEqual(str(t2), "2002-03-19 12:47:00+00:00")
- self.assertEqual(str(t3), "2002-03-19 13:47:00+01:00")
- d = 'datetime.datetime(2002, 3, 19, '
- self.assertEqual(repr(t1), d + "7, 47, tzinfo=est)")
- self.assertEqual(repr(t2), d + "12, 47, tzinfo=utc)")
- self.assertEqual(repr(t3), d + "13, 47, tzinfo=met)")
-
- def test_combine(self):
- met = FixedOffset(60, "MET")
- d = date(2002, 3, 4)
- tz = time(18, 45, 3, 1234, tzinfo=met)
- dt = datetime.combine(d, tz)
- self.assertEqual(dt, datetime(2002, 3, 4, 18, 45, 3, 1234,
- tzinfo=met))
-
- def test_extract(self):
- met = FixedOffset(60, "MET")
- dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234, tzinfo=met)
- self.assertEqual(dt.date(), date(2002, 3, 4))
- self.assertEqual(dt.time(), time(18, 45, 3, 1234))
- self.assertEqual(dt.timetz(), time(18, 45, 3, 1234, tzinfo=met))
-
- def test_tz_aware_arithmetic(self):
- import random
-
- now = self.theclass.now()
- tz55 = FixedOffset(-330, "west 5:30")
- timeaware = now.time().replace(tzinfo=tz55)
- nowaware = self.theclass.combine(now.date(), timeaware)
- self.assertTrue(nowaware.tzinfo is tz55)
- self.assertEqual(nowaware.timetz(), timeaware)
-
- # Can't mix aware and non-aware.
- self.assertRaises(TypeError, lambda: now - nowaware)
- self.assertRaises(TypeError, lambda: nowaware - now)
-
- # And adding datetime's doesn't make sense, aware or not.
- self.assertRaises(TypeError, lambda: now + nowaware)
- self.assertRaises(TypeError, lambda: nowaware + now)
- self.assertRaises(TypeError, lambda: nowaware + nowaware)
-
- # Subtracting should yield 0.
- self.assertEqual(now - now, timedelta(0))
- self.assertEqual(nowaware - nowaware, timedelta(0))
-
- # Adding a delta should preserve tzinfo.
- delta = timedelta(weeks=1, minutes=12, microseconds=5678)
- nowawareplus = nowaware + delta
- self.assertTrue(nowaware.tzinfo is tz55)
- nowawareplus2 = delta + nowaware
- self.assertTrue(nowawareplus2.tzinfo is tz55)
- self.assertEqual(nowawareplus, nowawareplus2)
-
- # that - delta should be what we started with, and that - what we
- # started with should be delta.
- diff = nowawareplus - delta
- self.assertTrue(diff.tzinfo is tz55)
- self.assertEqual(nowaware, diff)
- self.assertRaises(TypeError, lambda: delta - nowawareplus)
- self.assertEqual(nowawareplus - nowaware, delta)
-
- # Make up a random timezone.
- tzr = FixedOffset(random.randrange(-1439, 1440), "randomtimezone")
- # Attach it to nowawareplus.
- nowawareplus = nowawareplus.replace(tzinfo=tzr)
- self.assertTrue(nowawareplus.tzinfo is tzr)
- # Make sure the difference takes the timezone adjustments into account.
- got = nowaware - nowawareplus
- # Expected: (nowaware base - nowaware offset) -
- # (nowawareplus base - nowawareplus offset) =
- # (nowaware base - nowawareplus base) +
- # (nowawareplus offset - nowaware offset) =
- # -delta + nowawareplus offset - nowaware offset
- expected = nowawareplus.utcoffset() - nowaware.utcoffset() - delta
- self.assertEqual(got, expected)
-
- # Try max possible difference.
- min = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, "min"))
- max = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
- tzinfo=FixedOffset(-1439, "max"))
- maxdiff = max - min
- self.assertEqual(maxdiff, self.theclass.max - self.theclass.min +
- timedelta(minutes=2*1439))
-
- def test_tzinfo_now(self):
- meth = self.theclass.now
- # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
- base = meth()
- # Try with and without naming the keyword.
- off42 = FixedOffset(42, "42")
- another = meth(off42)
- again = meth(tz=off42)
- self.assertTrue(another.tzinfo is again.tzinfo)
- self.assertEqual(another.utcoffset(), timedelta(minutes=42))
- # Bad argument with and w/o naming the keyword.
- self.assertRaises(TypeError, meth, 16)
- self.assertRaises(TypeError, meth, tzinfo=16)
- # Bad keyword name.
- self.assertRaises(TypeError, meth, tinfo=off42)
- # Too many args.
- self.assertRaises(TypeError, meth, off42, off42)
-
- # We don't know which time zone we're in, and don't have a tzinfo
- # class to represent it, so seeing whether a tz argument actually
- # does a conversion is tricky.
- weirdtz = FixedOffset(timedelta(hours=15, minutes=58), "weirdtz", 0)
- utc = FixedOffset(0, "utc", 0)
- for dummy in range(3):
- now = datetime.now(weirdtz)
- self.assertTrue(now.tzinfo is weirdtz)
- utcnow = datetime.utcnow().replace(tzinfo=utc)
- now2 = utcnow.astimezone(weirdtz)
- if abs(now - now2) < timedelta(seconds=30):
- break
- # Else the code is broken, or more than 30 seconds passed between
- # calls; assuming the latter, just try again.
- else:
- # Three strikes and we're out.
- self.fail("utcnow(), now(tz), or astimezone() may be broken")
-
- def test_tzinfo_fromtimestamp(self):
- import time
- meth = self.theclass.fromtimestamp
- ts = time.time()
- # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
- base = meth(ts)
- # Try with and without naming the keyword.
- off42 = FixedOffset(42, "42")
- another = meth(ts, off42)
- again = meth(ts, tz=off42)
- self.assertTrue(another.tzinfo is again.tzinfo)
- self.assertEqual(another.utcoffset(), timedelta(minutes=42))
- # Bad argument with and w/o naming the keyword.
- self.assertRaises(TypeError, meth, ts, 16)
- self.assertRaises(TypeError, meth, ts, tzinfo=16)
- # Bad keyword name.
- self.assertRaises(TypeError, meth, ts, tinfo=off42)
- # Too many args.
- self.assertRaises(TypeError, meth, ts, off42, off42)
- # Too few args.
- self.assertRaises(TypeError, meth)
-
- # Try to make sure tz= actually does some conversion.
- timestamp = 1000000000
- utcdatetime = datetime.utcfromtimestamp(timestamp)
- # In POSIX (epoch 1970), that's 2001-09-09 01:46:40 UTC, give or take.
- # But on some flavor of Mac, it's nowhere near that. So we can't have
- # any idea here what time that actually is, we can only test that
- # relative changes match.
- utcoffset = timedelta(hours=-15, minutes=39) # arbitrary, but not zero
- tz = FixedOffset(utcoffset, "tz", 0)
- expected = utcdatetime + utcoffset
- got = datetime.fromtimestamp(timestamp, tz)
- self.assertEqual(expected, got.replace(tzinfo=None))
-
- def test_tzinfo_utcnow(self):
- meth = self.theclass.utcnow
- # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
- base = meth()
- # Try with and without naming the keyword; for whatever reason,
- # utcnow() doesn't accept a tzinfo argument.
- off42 = FixedOffset(42, "42")
- self.assertRaises(TypeError, meth, off42)
- self.assertRaises(TypeError, meth, tzinfo=off42)
-
- def test_tzinfo_utcfromtimestamp(self):
- import time
- meth = self.theclass.utcfromtimestamp
- ts = time.time()
- # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
- base = meth(ts)
- # Try with and without naming the keyword; for whatever reason,
- # utcfromtimestamp() doesn't accept a tzinfo argument.
- off42 = FixedOffset(42, "42")
- self.assertRaises(TypeError, meth, ts, off42)
- self.assertRaises(TypeError, meth, ts, tzinfo=off42)
-
- def test_tzinfo_timetuple(self):
- # TestDateTime tested most of this. datetime adds a twist to the
- # DST flag.
- class DST(tzinfo):
- def __init__(self, dstvalue):
- if isinstance(dstvalue, int):
- dstvalue = timedelta(minutes=dstvalue)
- self.dstvalue = dstvalue
- def dst(self, dt):
- return self.dstvalue
-
- cls = self.theclass
- for dstvalue, flag in (-33, 1), (33, 1), (0, 0), (None, -1):
- d = cls(1, 1, 1, 10, 20, 30, 40, tzinfo=DST(dstvalue))
- t = d.timetuple()
- self.assertEqual(1, t.tm_year)
- self.assertEqual(1, t.tm_mon)
- self.assertEqual(1, t.tm_mday)
- self.assertEqual(10, t.tm_hour)
- self.assertEqual(20, t.tm_min)
- self.assertEqual(30, t.tm_sec)
- self.assertEqual(0, t.tm_wday)
- self.assertEqual(1, t.tm_yday)
- self.assertEqual(flag, t.tm_isdst)
-
- # dst() returns wrong type.
- self.assertRaises(TypeError, cls(1, 1, 1, tzinfo=DST("x")).timetuple)
-
- # dst() at the edge.
- self.assertEqual(cls(1,1,1, tzinfo=DST(1439)).timetuple().tm_isdst, 1)
- self.assertEqual(cls(1,1,1, tzinfo=DST(-1439)).timetuple().tm_isdst, 1)
-
- # dst() out of range.
- self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(1440)).timetuple)
- self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(-1440)).timetuple)
-
- def test_utctimetuple(self):
- class DST(tzinfo):
- def __init__(self, dstvalue=0):
- if isinstance(dstvalue, int):
- dstvalue = timedelta(minutes=dstvalue)
- self.dstvalue = dstvalue
- def dst(self, dt):
- return self.dstvalue
-
- cls = self.theclass
- # This can't work: DST didn't implement utcoffset.
- self.assertRaises(NotImplementedError,
- cls(1, 1, 1, tzinfo=DST(0)).utcoffset)
-
- class UOFS(DST):
- def __init__(self, uofs, dofs=None):
- DST.__init__(self, dofs)
- self.uofs = timedelta(minutes=uofs)
- def utcoffset(self, dt):
- return self.uofs
-
- # Ensure tm_isdst is 0 regardless of what dst() says: DST is never
- # in effect for a UTC time.
- for dstvalue in -33, 33, 0, None:
- d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=UOFS(-53, dstvalue))
- t = d.utctimetuple()
- self.assertEqual(d.year, t.tm_year)
- self.assertEqual(d.month, t.tm_mon)
- self.assertEqual(d.day, t.tm_mday)
- self.assertEqual(11, t.tm_hour) # 20mm + 53mm = 1hn + 13mm
- self.assertEqual(13, t.tm_min)
- self.assertEqual(d.second, t.tm_sec)
- self.assertEqual(d.weekday(), t.tm_wday)
- self.assertEqual(d.toordinal() - date(1, 1, 1).toordinal() + 1,
- t.tm_yday)
- self.assertEqual(0, t.tm_isdst)
- # For naive datetime, utctimetuple == timetuple except for isdst
- d = cls(1, 2, 3, 10, 20, 30, 40)
- t = d.utctimetuple()
- self.assertEqual(t[:-1], d.timetuple()[:-1])
- self.assertEqual(0, t.tm_isdst)
- # Same if utcoffset is None
- class NOFS(DST):
- def utcoffset(self, dt):
- return None
- d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=NOFS())
- t = d.utctimetuple()
- self.assertEqual(t[:-1], d.timetuple()[:-1])
- self.assertEqual(0, t.tm_isdst)
- # Check that bad tzinfo is detected
- class BOFS(DST):
- def utcoffset(self, dt):
- return "EST"
- d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=BOFS())
- self.assertRaises(TypeError, d.utctimetuple)
-
- # At the edges, UTC adjustment can normalize into years out-of-range
- # for a datetime object. Ensure that a correct timetuple is
- # created anyway.
- tiny = cls(MINYEAR, 1, 1, 0, 0, 37, tzinfo=UOFS(1439))
- # That goes back 1 minute less than a full day.
- t = tiny.utctimetuple()
- self.assertEqual(t.tm_year, MINYEAR-1)
- self.assertEqual(t.tm_mon, 12)
- self.assertEqual(t.tm_mday, 31)
- self.assertEqual(t.tm_hour, 0)
- self.assertEqual(t.tm_min, 1)
- self.assertEqual(t.tm_sec, 37)
- self.assertEqual(t.tm_yday, 366) # "year 0" is a leap year
- self.assertEqual(t.tm_isdst, 0)
-
- huge = cls(MAXYEAR, 12, 31, 23, 59, 37, 999999, tzinfo=UOFS(-1439))
- # That goes forward 1 minute less than a full day.
- t = huge.utctimetuple()
- self.assertEqual(t.tm_year, MAXYEAR+1)
- self.assertEqual(t.tm_mon, 1)
- self.assertEqual(t.tm_mday, 1)
- self.assertEqual(t.tm_hour, 23)
- self.assertEqual(t.tm_min, 58)
- self.assertEqual(t.tm_sec, 37)
- self.assertEqual(t.tm_yday, 1)
- self.assertEqual(t.tm_isdst, 0)
-
- def test_tzinfo_isoformat(self):
- zero = FixedOffset(0, "+00:00")
- plus = FixedOffset(220, "+03:40")
- minus = FixedOffset(-231, "-03:51")
- unknown = FixedOffset(None, "")
-
- cls = self.theclass
- datestr = '0001-02-03'
- for ofs in None, zero, plus, minus, unknown:
- for us in 0, 987001:
- d = cls(1, 2, 3, 4, 5, 59, us, tzinfo=ofs)
- timestr = '04:05:59' + (us and '.987001' or '')
- ofsstr = ofs is not None and d.tzname() or ''
- tailstr = timestr + ofsstr
- iso = d.isoformat()
- self.assertEqual(iso, datestr + 'T' + tailstr)
- self.assertEqual(iso, d.isoformat('T'))
- self.assertEqual(d.isoformat('k'), datestr + 'k' + tailstr)
- self.assertEqual(d.isoformat('\u1234'), datestr + '\u1234' + tailstr)
- self.assertEqual(str(d), datestr + ' ' + tailstr)
-
- def test_replace(self):
- cls = self.theclass
- z100 = FixedOffset(100, "+100")
- zm200 = FixedOffset(timedelta(minutes=-200), "-200")
- args = [1, 2, 3, 4, 5, 6, 7, z100]
- base = cls(*args)
- self.assertEqual(base, base.replace())
-
- i = 0
- for name, newval in (("year", 2),
- ("month", 3),
- ("day", 4),
- ("hour", 5),
- ("minute", 6),
- ("second", 7),
- ("microsecond", 8),
- ("tzinfo", zm200)):
- newargs = args[:]
- newargs[i] = newval
- expected = cls(*newargs)
- got = base.replace(**{name: newval})
- self.assertEqual(expected, got)
- i += 1
-
- # Ensure we can get rid of a tzinfo.
- self.assertEqual(base.tzname(), "+100")
- base2 = base.replace(tzinfo=None)
- self.assertTrue(base2.tzinfo is None)
- self.assertTrue(base2.tzname() is None)
-
- # Ensure we can add one.
- base3 = base2.replace(tzinfo=z100)
- self.assertEqual(base, base3)
- self.assertTrue(base.tzinfo is base3.tzinfo)
-
- # Out of bounds.
- base = cls(2000, 2, 29)
- self.assertRaises(ValueError, base.replace, year=2001)
-
- def test_more_astimezone(self):
- # The inherited test_astimezone covered some trivial and error cases.
- fnone = FixedOffset(None, "None")
- f44m = FixedOffset(44, "44")
- fm5h = FixedOffset(-timedelta(hours=5), "m300")
-
- dt = self.theclass.now(tz=f44m)
- self.assertTrue(dt.tzinfo is f44m)
- # Replacing with degenerate tzinfo raises an exception.
- self.assertRaises(ValueError, dt.astimezone, fnone)
- # Ditto with None tz.
- self.assertRaises(TypeError, dt.astimezone, None)
- # Replacing with same tzinfo makes no change.
- x = dt.astimezone(dt.tzinfo)
- self.assertTrue(x.tzinfo is f44m)
- self.assertEqual(x.date(), dt.date())
- self.assertEqual(x.time(), dt.time())
-
- # Replacing with different tzinfo does adjust.
- got = dt.astimezone(fm5h)
- self.assertTrue(got.tzinfo is fm5h)
- self.assertEqual(got.utcoffset(), timedelta(hours=-5))
- expected = dt - dt.utcoffset() # in effect, convert to UTC
- expected += fm5h.utcoffset(dt) # and from there to local time
- expected = expected.replace(tzinfo=fm5h) # and attach new tzinfo
- self.assertEqual(got.date(), expected.date())
- self.assertEqual(got.time(), expected.time())
- self.assertEqual(got.timetz(), expected.timetz())
- self.assertTrue(got.tzinfo is expected.tzinfo)
- self.assertEqual(got, expected)
-
- def test_aware_subtract(self):
- cls = self.theclass
-
- # Ensure that utcoffset() is ignored when the operands have the
- # same tzinfo member.
- class OperandDependentOffset(tzinfo):
- def utcoffset(self, t):
- if t.minute < 10:
- # d0 and d1 equal after adjustment
- return timedelta(minutes=t.minute)
- else:
- # d2 off in the weeds
- return timedelta(minutes=59)
-
- base = cls(8, 9, 10, 11, 12, 13, 14, tzinfo=OperandDependentOffset())
- d0 = base.replace(minute=3)
- d1 = base.replace(minute=9)
- d2 = base.replace(minute=11)
- for x in d0, d1, d2:
- for y in d0, d1, d2:
- got = x - y
- expected = timedelta(minutes=x.minute - y.minute)
- self.assertEqual(got, expected)
-
- # OTOH, if the tzinfo members are distinct, utcoffsets aren't
- # ignored.
- base = cls(8, 9, 10, 11, 12, 13, 14)
- d0 = base.replace(minute=3, tzinfo=OperandDependentOffset())
- d1 = base.replace(minute=9, tzinfo=OperandDependentOffset())
- d2 = base.replace(minute=11, tzinfo=OperandDependentOffset())
- for x in d0, d1, d2:
- for y in d0, d1, d2:
- got = x - y
- if (x is d0 or x is d1) and (y is d0 or y is d1):
- expected = timedelta(0)
- elif x is y is d2:
- expected = timedelta(0)
- elif x is d2:
- expected = timedelta(minutes=(11-59)-0)
- else:
- assert y is d2
- expected = timedelta(minutes=0-(11-59))
- self.assertEqual(got, expected)
-
- def test_mixed_compare(self):
- t1 = datetime(1, 2, 3, 4, 5, 6, 7)
- t2 = datetime(1, 2, 3, 4, 5, 6, 7)
- self.assertEqual(t1, t2)
- t2 = t2.replace(tzinfo=None)
- self.assertEqual(t1, t2)
- t2 = t2.replace(tzinfo=FixedOffset(None, ""))
- self.assertEqual(t1, t2)
- t2 = t2.replace(tzinfo=FixedOffset(0, ""))
- self.assertRaises(TypeError, lambda: t1 == t2)
-
- # In datetime w/ identical tzinfo objects, utcoffset is ignored.
- class Varies(tzinfo):
- def __init__(self):
- self.offset = timedelta(minutes=22)
- def utcoffset(self, t):
- self.offset += timedelta(minutes=1)
- return self.offset
-
- v = Varies()
- t1 = t2.replace(tzinfo=v)
- t2 = t2.replace(tzinfo=v)
- self.assertEqual(t1.utcoffset(), timedelta(minutes=23))
- self.assertEqual(t2.utcoffset(), timedelta(minutes=24))
- self.assertEqual(t1, t2)
-
- # But if they're not identical, it isn't ignored.
- t2 = t2.replace(tzinfo=Varies())
- self.assertTrue(t1 < t2) # t1's offset counter still going up
-
- def test_subclass_datetimetz(self):
-
- class C(self.theclass):
- theAnswer = 42
-
- def __new__(cls, *args, **kws):
- temp = kws.copy()
- extra = temp.pop('extra')
- result = self.theclass.__new__(cls, *args, **temp)
- result.extra = extra
- return result
-
- def newmeth(self, start):
- return start + self.hour + self.year
-
- args = 2002, 12, 31, 4, 5, 6, 500, FixedOffset(-300, "EST", 1)
-
- dt1 = self.theclass(*args)
- dt2 = C(*args, **{'extra': 7})
-
- self.assertEqual(dt2.__class__, C)
- self.assertEqual(dt2.theAnswer, 42)
- self.assertEqual(dt2.extra, 7)
- self.assertEqual(dt1.utcoffset(), dt2.utcoffset())
- self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.year - 7)
-
-# Pain to set up DST-aware tzinfo classes.
-
-def first_sunday_on_or_after(dt):
- days_to_go = 6 - dt.weekday()
- if days_to_go:
- dt += timedelta(days_to_go)
- return dt
-
-ZERO = timedelta(0)
-HOUR = timedelta(hours=1)
-DAY = timedelta(days=1)
-# In the US, DST starts at 2am (standard time) on the first Sunday in April.
-DSTSTART = datetime(1, 4, 1, 2)
-# and ends at 2am (DST time; 1am standard time) on the last Sunday of Oct,
-# which is the first Sunday on or after Oct 25. Because we view 1:MM as
-# being standard time on that day, there is no spelling in local time of
-# the last hour of DST (that's 1:MM DST, but 1:MM is taken as standard time).
-DSTEND = datetime(1, 10, 25, 1)
-
-class USTimeZone(tzinfo):
-
- def __init__(self, hours, reprname, stdname, dstname):
- self.stdoffset = timedelta(hours=hours)
- self.reprname = reprname
- self.stdname = stdname
- self.dstname = dstname
-
- def __repr__(self):
- return self.reprname
-
- def tzname(self, dt):
- if self.dst(dt):
- return self.dstname
- else:
- return self.stdname
-
- def utcoffset(self, dt):
- return self.stdoffset + self.dst(dt)
-
- def dst(self, dt):
- if dt is None or dt.tzinfo is None:
- # An exception instead may be sensible here, in one or more of
- # the cases.
- return ZERO
- assert dt.tzinfo is self
-
- # Find first Sunday in April.
- start = first_sunday_on_or_after(DSTSTART.replace(year=dt.year))
- assert start.weekday() == 6 and start.month == 4 and start.day <= 7
-
- # Find last Sunday in October.
- end = first_sunday_on_or_after(DSTEND.replace(year=dt.year))
- assert end.weekday() == 6 and end.month == 10 and end.day >= 25
-
- # Can't compare naive to aware objects, so strip the timezone from
- # dt first.
- if start <= dt.replace(tzinfo=None) < end:
- return HOUR
- else:
- return ZERO
-
-Eastern = USTimeZone(-5, "Eastern", "EST", "EDT")
-Central = USTimeZone(-6, "Central", "CST", "CDT")
-Mountain = USTimeZone(-7, "Mountain", "MST", "MDT")
-Pacific = USTimeZone(-8, "Pacific", "PST", "PDT")
-utc_real = FixedOffset(0, "UTC", 0)
-# For better test coverage, we want another flavor of UTC that's west of
-# the Eastern and Pacific timezones.
-utc_fake = FixedOffset(-12*60, "UTCfake", 0)
-
-class TestTimezoneConversions(unittest.TestCase):
- # The DST switch times for 2002, in std time.
- dston = datetime(2002, 4, 7, 2)
- dstoff = datetime(2002, 10, 27, 1)
-
- theclass = datetime
-
- # Check a time that's inside DST.
- def checkinside(self, dt, tz, utc, dston, dstoff):
- self.assertEqual(dt.dst(), HOUR)
-
- # Conversion to our own timezone is always an identity.
- self.assertEqual(dt.astimezone(tz), dt)
-
- asutc = dt.astimezone(utc)
- there_and_back = asutc.astimezone(tz)
-
- # Conversion to UTC and back isn't always an identity here,
- # because there are redundant spellings (in local time) of
- # UTC time when DST begins: the clock jumps from 1:59:59
- # to 3:00:00, and a local time of 2:MM:SS doesn't really
- # make sense then. The classes above treat 2:MM:SS as
- # daylight time then (it's "after 2am"), really an alias
- # for 1:MM:SS standard time. The latter form is what
- # conversion back from UTC produces.
- if dt.date() == dston.date() and dt.hour == 2:
- # We're in the redundant hour, and coming back from
- # UTC gives the 1:MM:SS standard-time spelling.
- self.assertEqual(there_and_back + HOUR, dt)
- # Although during was considered to be in daylight
- # time, there_and_back is not.
- self.assertEqual(there_and_back.dst(), ZERO)
- # They're the same times in UTC.
- self.assertEqual(there_and_back.astimezone(utc),
- dt.astimezone(utc))
- else:
- # We're not in the redundant hour.
- self.assertEqual(dt, there_and_back)
-
- # Because we have a redundant spelling when DST begins, there is
- # (unfortunately) an hour when DST ends that can't be spelled at all in
- # local time. When DST ends, the clock jumps from 1:59 back to 1:00
- # again. The hour 1:MM DST has no spelling then: 1:MM is taken to be
- # standard time. 1:MM DST == 0:MM EST, but 0:MM is taken to be
- # daylight time. The hour 1:MM daylight == 0:MM standard can't be
- # expressed in local time. Nevertheless, we want conversion back
- # from UTC to mimic the local clock's "repeat an hour" behavior.
- nexthour_utc = asutc + HOUR
- nexthour_tz = nexthour_utc.astimezone(tz)
- if dt.date() == dstoff.date() and dt.hour == 0:
- # We're in the hour before the last DST hour. The last DST hour
- # is ineffable. We want the conversion back to repeat 1:MM.
- self.assertEqual(nexthour_tz, dt.replace(hour=1))
- nexthour_utc += HOUR
- nexthour_tz = nexthour_utc.astimezone(tz)
- self.assertEqual(nexthour_tz, dt.replace(hour=1))
- else:
- self.assertEqual(nexthour_tz - dt, HOUR)
-
- # Check a time that's outside DST.
- def checkoutside(self, dt, tz, utc):
- self.assertEqual(dt.dst(), ZERO)
-
- # Conversion to our own timezone is always an identity.
- self.assertEqual(dt.astimezone(tz), dt)
-
- # Converting to UTC and back is an identity too.
- asutc = dt.astimezone(utc)
- there_and_back = asutc.astimezone(tz)
- self.assertEqual(dt, there_and_back)
-
- def convert_between_tz_and_utc(self, tz, utc):
- dston = self.dston.replace(tzinfo=tz)
- # Because 1:MM on the day DST ends is taken as being standard time,
- # there is no spelling in tz for the last hour of daylight time.
- # For purposes of the test, the last hour of DST is 0:MM, which is
- # taken as being daylight time (and 1:MM is taken as being standard
- # time).
- dstoff = self.dstoff.replace(tzinfo=tz)
- for delta in (timedelta(weeks=13),
- DAY,
- HOUR,
- timedelta(minutes=1),
- timedelta(microseconds=1)):
-
- self.checkinside(dston, tz, utc, dston, dstoff)
- for during in dston + delta, dstoff - delta:
- self.checkinside(during, tz, utc, dston, dstoff)
-
- self.checkoutside(dstoff, tz, utc)
- for outside in dston - delta, dstoff + delta:
- self.checkoutside(outside, tz, utc)
-
- def test_easy(self):
- # Despite the name of this test, the endcases are excruciating.
- self.convert_between_tz_and_utc(Eastern, utc_real)
- self.convert_between_tz_and_utc(Pacific, utc_real)
- self.convert_between_tz_and_utc(Eastern, utc_fake)
- self.convert_between_tz_and_utc(Pacific, utc_fake)
- # The next is really dancing near the edge. It works because
- # Pacific and Eastern are far enough apart that their "problem
- # hours" don't overlap.
- self.convert_between_tz_and_utc(Eastern, Pacific)
- self.convert_between_tz_and_utc(Pacific, Eastern)
- # OTOH, these fail! Don't enable them. The difficulty is that
- # the edge case tests assume that every hour is representable in
- # the "utc" class. This is always true for a fixed-offset tzinfo
- # class (lke utc_real and utc_fake), but not for Eastern or Central.
- # For these adjacent DST-aware time zones, the range of time offsets
- # tested ends up creating hours in the one that aren't representable
- # in the other. For the same reason, we would see failures in the
- # Eastern vs Pacific tests too if we added 3*HOUR to the list of
- # offset deltas in convert_between_tz_and_utc().
- #
- # self.convert_between_tz_and_utc(Eastern, Central) # can't work
- # self.convert_between_tz_and_utc(Central, Eastern) # can't work
-
- def test_tricky(self):
- # 22:00 on day before daylight starts.
- fourback = self.dston - timedelta(hours=4)
- ninewest = FixedOffset(-9*60, "-0900", 0)
- fourback = fourback.replace(tzinfo=ninewest)
- # 22:00-0900 is 7:00 UTC == 2:00 EST == 3:00 DST. Since it's "after
- # 2", we should get the 3 spelling.
- # If we plug 22:00 the day before into Eastern, it "looks like std
- # time", so its offset is returned as -5, and -5 - -9 = 4. Adding 4
- # to 22:00 lands on 2:00, which makes no sense in local time (the
- # local clock jumps from 1 to 3). The point here is to make sure we
- # get the 3 spelling.
- expected = self.dston.replace(hour=3)
- got = fourback.astimezone(Eastern).replace(tzinfo=None)
- self.assertEqual(expected, got)
-
- # Similar, but map to 6:00 UTC == 1:00 EST == 2:00 DST. In that
- # case we want the 1:00 spelling.
- sixutc = self.dston.replace(hour=6, tzinfo=utc_real)
- # Now 6:00 "looks like daylight", so the offset wrt Eastern is -4,
- # and adding -4-0 == -4 gives the 2:00 spelling. We want the 1:00 EST
- # spelling.
- expected = self.dston.replace(hour=1)
- got = sixutc.astimezone(Eastern).replace(tzinfo=None)
- self.assertEqual(expected, got)
-
- # Now on the day DST ends, we want "repeat an hour" behavior.
- # UTC 4:MM 5:MM 6:MM 7:MM checking these
- # EST 23:MM 0:MM 1:MM 2:MM
- # EDT 0:MM 1:MM 2:MM 3:MM
- # wall 0:MM 1:MM 1:MM 2:MM against these
- for utc in utc_real, utc_fake:
- for tz in Eastern, Pacific:
- first_std_hour = self.dstoff - timedelta(hours=2) # 23:MM
- # Convert that to UTC.
- first_std_hour -= tz.utcoffset(None)
- # Adjust for possibly fake UTC.
- asutc = first_std_hour + utc.utcoffset(None)
- # First UTC hour to convert; this is 4:00 when utc=utc_real &
- # tz=Eastern.
- asutcbase = asutc.replace(tzinfo=utc)
- for tzhour in (0, 1, 1, 2):
- expectedbase = self.dstoff.replace(hour=tzhour)
- for minute in 0, 30, 59:
- expected = expectedbase.replace(minute=minute)
- asutc = asutcbase.replace(minute=minute)
- astz = asutc.astimezone(tz)
- self.assertEqual(astz.replace(tzinfo=None), expected)
- asutcbase += HOUR
-
-
- def test_bogus_dst(self):
- class ok(tzinfo):
- def utcoffset(self, dt): return HOUR
- def dst(self, dt): return HOUR
-
- now = self.theclass.now().replace(tzinfo=utc_real)
- # Doesn't blow up.
- now.astimezone(ok())
-
- # Does blow up.
- class notok(ok):
- def dst(self, dt): return None
- self.assertRaises(ValueError, now.astimezone, notok())
-
- # Sometimes blow up. In the following, tzinfo.dst()
- # implementation may return None or not Nonedepending on
- # whether DST is assumed to be in effect. In this situation,
- # a ValueError should be raised by astimezone().
- class tricky_notok(ok):
- def dst(self, dt):
- if dt.year == 2000:
- return None
- else:
- return 10*HOUR
- dt = self.theclass(2001, 1, 1).replace(tzinfo=utc_real)
- self.assertRaises(ValueError, dt.astimezone, tricky_notok())
-
- def test_fromutc(self):
- self.assertRaises(TypeError, Eastern.fromutc) # not enough args
- now = datetime.utcnow().replace(tzinfo=utc_real)
- self.assertRaises(ValueError, Eastern.fromutc, now) # wrong tzinfo
- now = now.replace(tzinfo=Eastern) # insert correct tzinfo
- enow = Eastern.fromutc(now) # doesn't blow up
- self.assertEqual(enow.tzinfo, Eastern) # has right tzinfo member
- self.assertRaises(TypeError, Eastern.fromutc, now, now) # too many args
- self.assertRaises(TypeError, Eastern.fromutc, date.today()) # wrong type
-
- # Always converts UTC to standard time.
- class FauxUSTimeZone(USTimeZone):
- def fromutc(self, dt):
- return dt + self.stdoffset
- FEastern = FauxUSTimeZone(-5, "FEastern", "FEST", "FEDT")
-
- # UTC 4:MM 5:MM 6:MM 7:MM 8:MM 9:MM
- # EST 23:MM 0:MM 1:MM 2:MM 3:MM 4:MM
- # EDT 0:MM 1:MM 2:MM 3:MM 4:MM 5:MM
-
- # Check around DST start.
- start = self.dston.replace(hour=4, tzinfo=Eastern)
- fstart = start.replace(tzinfo=FEastern)
- for wall in 23, 0, 1, 3, 4, 5:
- expected = start.replace(hour=wall)
- if wall == 23:
- expected -= timedelta(days=1)
- got = Eastern.fromutc(start)
- self.assertEqual(expected, got)
-
- expected = fstart + FEastern.stdoffset
- got = FEastern.fromutc(fstart)
- self.assertEqual(expected, got)
-
- # Ensure astimezone() calls fromutc() too.
- got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
- self.assertEqual(expected, got)
-
- start += HOUR
- fstart += HOUR
-
- # Check around DST end.
- start = self.dstoff.replace(hour=4, tzinfo=Eastern)
- fstart = start.replace(tzinfo=FEastern)
- for wall in 0, 1, 1, 2, 3, 4:
- expected = start.replace(hour=wall)
- got = Eastern.fromutc(start)
- self.assertEqual(expected, got)
-
- expected = fstart + FEastern.stdoffset
- got = FEastern.fromutc(fstart)
- self.assertEqual(expected, got)
-
- # Ensure astimezone() calls fromutc() too.
- got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
- self.assertEqual(expected, got)
-
- start += HOUR
- fstart += HOUR
-
-
-#############################################################################
-# oddballs
-
-class Oddballs(unittest.TestCase):
-
- def test_bug_1028306(self):
- # Trying to compare a date to a datetime should act like a mixed-
- # type comparison, despite that datetime is a subclass of date.
- as_date = date.today()
- as_datetime = datetime.combine(as_date, time())
- self.assertTrue(as_date != as_datetime)
- self.assertTrue(as_datetime != as_date)
- self.assertTrue(not as_date == as_datetime)
- self.assertTrue(not as_datetime == as_date)
- self.assertRaises(TypeError, lambda: as_date < as_datetime)
- self.assertRaises(TypeError, lambda: as_datetime < as_date)
- self.assertRaises(TypeError, lambda: as_date <= as_datetime)
- self.assertRaises(TypeError, lambda: as_datetime <= as_date)
- self.assertRaises(TypeError, lambda: as_date > as_datetime)
- self.assertRaises(TypeError, lambda: as_datetime > as_date)
- self.assertRaises(TypeError, lambda: as_date >= as_datetime)
- self.assertRaises(TypeError, lambda: as_datetime >= as_date)
-
- # Neverthelss, comparison should work with the base-class (date)
- # projection if use of a date method is forced.
- self.assertEqual(as_date.__eq__(as_datetime), True)
- different_day = (as_date.day + 1) % 20 + 1
- as_different = as_datetime.replace(day= different_day)
- self.assertEqual(as_date.__eq__(as_different), False)
-
- # And date should compare with other subclasses of date. If a
- # subclass wants to stop this, it's up to the subclass to do so.
- date_sc = SubclassDate(as_date.year, as_date.month, as_date.day)
- self.assertEqual(as_date, date_sc)
- self.assertEqual(date_sc, as_date)
-
- # Ditto for datetimes.
- datetime_sc = SubclassDatetime(as_datetime.year, as_datetime.month,
- as_date.day, 0, 0, 0)
- self.assertEqual(as_datetime, datetime_sc)
- self.assertEqual(datetime_sc, as_datetime)
+import sys
+from test.support import import_fresh_module, run_unittest
+TESTS = 'test.datetimetester'
+# XXX: import_fresh_module() is supposed to leave sys.module cache untouched,
+# XXX: but it does not, so we have to save and restore it ourselves.
+save_sys_modules = sys.modules.copy()
+try:
+ pure_tests = import_fresh_module(TESTS, fresh=['datetime', '_strptime'],
+ blocked=['_datetime'])
+ fast_tests = import_fresh_module(TESTS, fresh=['datetime',
+ '_datetime', '_strptime'])
+finally:
+ sys.modules.clear()
+ sys.modules.update(save_sys_modules)
+test_modules = [pure_tests, fast_tests]
+test_suffixes = ["_Pure", "_Fast"]
+
+for module, suffix in zip(test_modules, test_suffixes):
+ for name, cls in module.__dict__.items():
+ if isinstance(cls, type) and issubclass(cls, unittest.TestCase):
+ name += suffix
+ cls.__name__ = name
+ globals()[name] = cls
+ def setUp(self, module=module, setup=cls.setUp):
+ self._save_sys_modules = sys.modules.copy()
+ sys.modules[TESTS] = module
+ sys.modules['datetime'] = module.datetime_module
+ sys.modules['_strptime'] = module._strptime
+ setup(self)
+ def tearDown(self, teardown=cls.tearDown):
+ teardown(self)
+ sys.modules.clear()
+ sys.modules.update(self._save_sys_modules)
+ cls.setUp = setUp
+ cls.tearDown = tearDown
def test_main():
- support.run_unittest(__name__)
+ run_unittest(__name__)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py
index ce48cfd5ce..26d4c14623 100644
--- a/Lib/test/test_dbm.py
+++ b/Lib/test/test_dbm.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Test script for the dbm.open function based on testdumbdbm.py"""
import os
@@ -101,7 +101,7 @@ class AnyDBMTestCase(unittest.TestCase):
self.init_db()
f = dbm.open(_fname, 'r')
key = "a".encode("ascii")
- assert(key in f)
+ self.assertIn(key, f)
assert(f[key] == b"Python:")
f.close()
@@ -131,7 +131,7 @@ class WhichDBTestCase(unittest.TestCase):
name = module.__name__
if name == 'dbm.dumb':
continue # whichdb can't support dbm.dumb
- test.support.unlink(_fname)
+ delete_files()
f = module.open(_fname, 'c')
f.close()
self.assertEqual(name, dbm.whichdb(_fname))
@@ -139,7 +139,7 @@ class WhichDBTestCase(unittest.TestCase):
f = module.open(_fname, 'w')
f[b"1"] = b"1"
# and test that we can find it
- self.assertTrue(b"1" in f)
+ self.assertIn(b"1", f)
# and read it
self.assertTrue(f[b"1"] == b"1")
f.close()
@@ -162,9 +162,9 @@ class WhichDBTestCase(unittest.TestCase):
self.d[k] = v
self.assertEqual(sorted(self.d.keys()), sorted(k for (k, v) in a))
for k, v in a:
- self.assertTrue(k in self.d)
+ self.assertIn(k, self.d)
self.assertEqual(self.d[k], v)
- self.assertTrue(b'xxx' not in self.d)
+ self.assertNotIn(b'xxx', self.d)
self.assertRaises(KeyError, lambda: self.d[b'xxx'])
self.d.close()
diff --git a/Lib/test/test_dbm_dumb.py b/Lib/test/test_dbm_dumb.py
index 956eec6312..6b981c429d 100644
--- a/Lib/test/test_dbm_dumb.py
+++ b/Lib/test/test_dbm_dumb.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Test script for the dumbdbm module
Original by Roger E. Masse
"""
@@ -93,7 +93,7 @@ class DumbDBMTestCase(unittest.TestCase):
def test_write_contains(self):
f = dumbdbm.open(_fname)
f[b'1'] = b'hello'
- self.assertTrue(b'1' in f)
+ self.assertIn(b'1', f)
f.close()
def test_write_write_read(self):
@@ -118,7 +118,7 @@ class DumbDBMTestCase(unittest.TestCase):
f['1'] = 'a'
f.close()
f = dumbdbm.open(_fname, 'r')
- self.assertTrue('\u00fc' in f)
+ self.assertIn('\u00fc', f)
self.assertEqual(f['\u00fc'.encode('utf-8')],
self._dict['\u00fc'.encode('utf-8')])
self.assertEqual(f[b'1'], b'a')
@@ -132,12 +132,14 @@ class DumbDBMTestCase(unittest.TestCase):
f.close()
# Mangle the file by changing the line separator to Windows or Unix
- data = io.open(_fname + '.dir', 'rb').read()
+ with io.open(_fname + '.dir', 'rb') as file:
+ data = file.read()
if os.linesep == '\n':
data = data.replace(b'\n', b'\r\n')
else:
data = data.replace(b'\r\n', b'\n')
- io.open(_fname + '.dir', 'wb').write(data)
+ with io.open(_fname + '.dir', 'wb') as file:
+ file.write(data)
f = dumbdbm.open(_fname)
self.assertEqual(f[b'1'], b'hello')
diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py
index 2173b92afa..ce96ce465e 100755
--- a/Lib/test/test_dbm_gnu.py
+++ b/Lib/test/test_dbm_gnu.py
@@ -24,14 +24,18 @@ class TestGdbm(unittest.TestCase):
self.g[b'bytes'] = b'data'
key_set = set(self.g.keys())
self.assertEqual(key_set, set([b'a', b'bytes', b'12345678910']))
- self.assertTrue(b'a' in self.g)
+ self.assertIn(b'a', self.g)
self.assertEqual(self.g[b'bytes'], b'data')
key = self.g.firstkey()
while key:
- self.assertTrue(key in key_set)
+ self.assertIn(key, key_set)
key_set.remove(key)
key = self.g.nextkey(key)
self.assertRaises(KeyError, lambda: self.g['xxx'])
+ # get() and setdefault() work as in the dict interface
+ self.assertEqual(self.g.get(b'xxx', b'foo'), b'foo')
+ self.assertEqual(self.g.setdefault(b'xxx', b'foo'), b'foo')
+ self.assertEqual(self.g[b'xxx'], b'foo')
def test_error_conditions(self):
# Try to open a non-existent database.
diff --git a/Lib/test/test_dbm_ndbm.py b/Lib/test/test_dbm_ndbm.py
index 141d4b3034..00dcbd2160 100755
--- a/Lib/test/test_dbm_ndbm.py
+++ b/Lib/test/test_dbm_ndbm.py
@@ -24,7 +24,7 @@ class DbmTestCase(unittest.TestCase):
self.d[b'bytes'] = b'data'
self.d['12345678910'] = '019237410982340912840198242'
self.d.keys()
- self.assertTrue(b'a' in self.d)
+ self.assertIn(b'a', self.d)
self.assertEqual(self.d[b'bytes'], b'data')
self.d.close()
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index ec381e4139..e46cd91e5e 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -24,14 +24,17 @@ you're working through IDLE, you can import this test module and call test_main(
with the corresponding argument.
"""
-import glob
import math
import os, sys
+import operator
+import warnings
import pickle, copy
import unittest
from decimal import *
import numbers
-from test.support import run_unittest, run_doctest, is_resource_enabled
+from test.support import (run_unittest, run_doctest, is_resource_enabled,
+ requires_IEEE_754)
+from test.support import check_warnings
import random
try:
import threading
@@ -402,7 +405,7 @@ class DecimalTest(unittest.TestCase):
def change_max_exponent(self, exp):
self.context.Emax = exp
def change_clamp(self, clamp):
- self.context._clamp = clamp
+ self.context.clamp = clamp
@@ -493,6 +496,12 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
self.assertRaises(ValueError, Decimal, (1, (4, 10, 4, 9, 1), 2) )
self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 'a', 1), 2) )
+ def test_explicit_from_bool(self):
+ self.assertIs(bool(Decimal(0)), False)
+ self.assertIs(bool(Decimal(1)), True)
+ self.assertEqual(Decimal(False), Decimal(0))
+ self.assertEqual(Decimal(True), Decimal(1))
+
def test_explicit_from_Decimal(self):
#positive
@@ -519,6 +528,27 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
self.assertEqual(str(e), '0')
self.assertNotEqual(id(d), id(e))
+ @requires_IEEE_754
+ def test_explicit_from_float(self):
+ r = Decimal(0.1)
+ self.assertEqual(type(r), Decimal)
+ self.assertEqual(str(r),
+ '0.1000000000000000055511151231257827021181583404541015625')
+ self.assertTrue(Decimal(float('nan')).is_qnan())
+ self.assertTrue(Decimal(float('inf')).is_infinite())
+ self.assertTrue(Decimal(float('-inf')).is_infinite())
+ self.assertEqual(str(Decimal(float('nan'))),
+ str(Decimal('NaN')))
+ self.assertEqual(str(Decimal(float('inf'))),
+ str(Decimal('Infinity')))
+ self.assertEqual(str(Decimal(float('-inf'))),
+ str(Decimal('-Infinity')))
+ self.assertEqual(str(Decimal(float('-0.0'))),
+ str(Decimal('-0')))
+ for i in range(200):
+ x = random.expovariate(0.01) * (random.random() * 2.0 - 1.0)
+ self.assertEqual(x, float(Decimal(x))) # roundtrip
+
def test_explicit_context_create_decimal(self):
nc = copy.copy(getcontext())
@@ -535,7 +565,7 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
# from int
d = nc.create_decimal(456)
- self.assertTrue(isinstance(d, Decimal))
+ self.assertIsInstance(d, Decimal)
self.assertEqual(nc.create_decimal(45678),
nc.create_decimal('457E+2'))
@@ -732,6 +762,7 @@ class DecimalFormatTest(unittest.TestCase):
('', '1.00', '1.00'),
# test alignment and padding
+ ('6', '123', ' 123'),
('<6', '123', '123 '),
('>6', '123', ' 123'),
('^6', '123', ' 123 '),
@@ -761,7 +792,7 @@ class DecimalFormatTest(unittest.TestCase):
(',', '-1234567', '-1,234,567'),
(',', '-123456', '-123,456'),
('7,', '123456', '123,456'),
- ('8,', '123456', '123,456 '),
+ ('8,', '123456', ' 123,456'),
('08,', '123456', '0,123,456'), # special case: extra 0 needed
('+08,', '123456', '+123,456'), # but not if there's a sign
(' 08,', '123456', ' 123,456'),
@@ -783,6 +814,18 @@ class DecimalFormatTest(unittest.TestCase):
# issue 6850
('a=-7.0', '0.12345', 'aaaa0.1'),
+
+ # Issue 7094: Alternate formatting (specified by #)
+ ('.0e', '1.0', '1e+0'),
+ ('#.0e', '1.0', '1.e+0'),
+ ('.0f', '1.0', '1'),
+ ('#.0f', '1.0', '1.'),
+ ('g', '1.1', '1.1'),
+ ('#g', '1.1', '1.1'),
+ ('.0g', '1', '1'),
+ ('#.0g', '1', '1.'),
+ ('.0%', '1.0', '100%'),
+ ('#.0%', '1.0', '100.%'),
]
for fmt, d, result in test_values:
self.assertEqual(format(Decimal(d), fmt), result)
@@ -1084,18 +1127,62 @@ class DecimalArithmeticOperatorsTest(unittest.TestCase):
self.assertEqual(abs(Decimal(45)), abs(Decimal(-45))) # abs
def test_nan_comparisons(self):
+ # comparisons involving signaling nans signal InvalidOperation
+
+ # order comparisons (<, <=, >, >=) involving only quiet nans
+ # also signal InvalidOperation
+
+ # equality comparisons (==, !=) involving only quiet nans
+ # don't signal, but return False or True respectively.
+
n = Decimal('NaN')
s = Decimal('sNaN')
i = Decimal('Inf')
f = Decimal('2')
- for x, y in [(n, n), (n, i), (i, n), (n, f), (f, n),
- (s, n), (n, s), (s, i), (i, s), (s, f), (f, s), (s, s)]:
- self.assertTrue(x != y)
- self.assertTrue(not (x == y))
- self.assertTrue(not (x < y))
- self.assertTrue(not (x <= y))
- self.assertTrue(not (x > y))
- self.assertTrue(not (x >= y))
+
+ qnan_pairs = (n, n), (n, i), (i, n), (n, f), (f, n)
+ snan_pairs = (s, n), (n, s), (s, i), (i, s), (s, f), (f, s), (s, s)
+ order_ops = operator.lt, operator.le, operator.gt, operator.ge
+ equality_ops = operator.eq, operator.ne
+
+ # results when InvalidOperation is not trapped
+ for x, y in qnan_pairs + snan_pairs:
+ for op in order_ops + equality_ops:
+ got = op(x, y)
+ expected = True if op is operator.ne else False
+ self.assertIs(expected, got,
+ "expected {0!r} for operator.{1}({2!r}, {3!r}); "
+ "got {4!r}".format(
+ expected, op.__name__, x, y, got))
+
+ # repeat the above, but this time trap the InvalidOperation
+ with localcontext() as ctx:
+ ctx.traps[InvalidOperation] = 1
+
+ for x, y in qnan_pairs:
+ for op in equality_ops:
+ got = op(x, y)
+ expected = True if op is operator.ne else False
+ self.assertIs(expected, got,
+ "expected {0!r} for "
+ "operator.{1}({2!r}, {3!r}); "
+ "got {4!r}".format(
+ expected, op.__name__, x, y, got))
+
+ for x, y in snan_pairs:
+ for op in equality_ops:
+ self.assertRaises(InvalidOperation, operator.eq, x, y)
+ self.assertRaises(InvalidOperation, operator.ne, x, y)
+
+ for x, y in qnan_pairs + snan_pairs:
+ for op in order_ops:
+ self.assertRaises(InvalidOperation, op, x, y)
+
+ def test_copy_sign(self):
+ d = Decimal(1).copy_sign(Decimal(-2))
+
+ self.assertEqual(Decimal(1).copy_sign(-2), d)
+ self.assertRaises(TypeError, Decimal(1).copy_sign, '-2')
# The following are two functions used to test threading in the next class
@@ -1168,18 +1255,18 @@ class DecimalUsabilityTest(unittest.TestCase):
dc = Decimal('45')
#two Decimals
- self.assertTrue(dc > da)
- self.assertTrue(dc >= da)
- self.assertTrue(da < dc)
- self.assertTrue(da <= dc)
+ self.assertGreater(dc, da)
+ self.assertGreaterEqual(dc, da)
+ self.assertLess(da, dc)
+ self.assertLessEqual(da, dc)
self.assertEqual(da, db)
- self.assertTrue(da != dc)
- self.assertTrue(da <= db)
- self.assertTrue(da >= db)
+ self.assertNotEqual(da, dc)
+ self.assertLessEqual(da, db)
+ self.assertGreaterEqual(da, db)
#a Decimal and an int
- self.assertTrue(dc > 23)
- self.assertTrue(23 < dc)
+ self.assertGreater(dc, 23)
+ self.assertLess(23, dc)
self.assertEqual(dc, 45)
#a Decimal and uncomparable
@@ -1195,6 +1282,23 @@ class DecimalUsabilityTest(unittest.TestCase):
a.sort()
self.assertEqual(a, b)
+ def test_decimal_float_comparison(self):
+ da = Decimal('0.25')
+ db = Decimal('3.0')
+ self.assertLess(da, 3.0)
+ self.assertLessEqual(da, 3.0)
+ self.assertGreater(db, 0.25)
+ self.assertGreaterEqual(db, 0.25)
+ self.assertNotEqual(da, 1.5)
+ self.assertEqual(da, 0.25)
+ self.assertGreater(3.0, da)
+ self.assertGreaterEqual(3.0, da)
+ self.assertLess(0.25, db)
+ self.assertLessEqual(0.25, db)
+ self.assertNotEqual(0.25, db)
+ self.assertEqual(3.0, db)
+ self.assertNotEqual(0.1, Decimal('0.1'))
+
def test_copy_and_deepcopy_methods(self):
d = Decimal('43.24')
c = copy.copy(d)
@@ -1203,15 +1307,26 @@ class DecimalUsabilityTest(unittest.TestCase):
self.assertEqual(id(dc), id(d))
def test_hash_method(self):
+ def hashit(d):
+ a = hash(d)
+ b = d.__hash__()
+ self.assertEqual(a, b)
+ return a
+
#just that it's hashable
- hash(Decimal(23))
+ hashit(Decimal(23))
+ hashit(Decimal('Infinity'))
+ hashit(Decimal('-Infinity'))
+ hashit(Decimal('nan123'))
+ hashit(Decimal('-NaN'))
test_values = [Decimal(sign*(2**m + n))
for m in [0, 14, 15, 16, 17, 30, 31,
- 32, 33, 62, 63, 64, 65, 66]
+ 32, 33, 61, 62, 63, 64, 65, 66]
for n in range(-10, 10)
for sign in [-1, 1]]
test_values.extend([
+ Decimal("-1"), # ==> -2
Decimal("-0"), # zeros
Decimal("0.00"),
Decimal("-0.000"),
@@ -1235,13 +1350,22 @@ class DecimalUsabilityTest(unittest.TestCase):
# check that hash(d) == hash(int(d)) for integral values
for value in test_values:
- self.assertEqual(hash(value), hash(int(value)))
+ self.assertEqual(hashit(value), hashit(int(value)))
#the same hash that to an int
- self.assertEqual(hash(Decimal(23)), hash(23))
- self.assertRaises(TypeError, hash, Decimal('NaN'))
- self.assertTrue(hash(Decimal('Inf')))
- self.assertTrue(hash(Decimal('-Inf')))
+ self.assertEqual(hashit(Decimal(23)), hashit(23))
+ self.assertRaises(TypeError, hash, Decimal('sNaN'))
+ self.assertTrue(hashit(Decimal('Inf')))
+ self.assertTrue(hashit(Decimal('-Inf')))
+
+ # check that the hashes of a Decimal float match when they
+ # represent exactly the same values
+ test_strings = ['inf', '-Inf', '0.0', '-.0e1',
+ '34.0', '2.5', '112390.625', '-0.515625']
+ for s in test_strings:
+ f = float(s)
+ d = Decimal(s)
+ self.assertEqual(hashit(f), hashit(d))
# check that the value of the hash doesn't depend on the
# current context (issue #1757)
@@ -1250,11 +1374,11 @@ class DecimalUsabilityTest(unittest.TestCase):
x = Decimal("123456789.1")
c.prec = 6
- h1 = hash(x)
+ h1 = hashit(x)
c.prec = 10
- h2 = hash(x)
+ h2 = hashit(x)
c.prec = 16
- h3 = hash(x)
+ h3 = hashit(x)
self.assertEqual(h1, h2)
self.assertEqual(h1, h3)
@@ -1268,16 +1392,16 @@ class DecimalUsabilityTest(unittest.TestCase):
l2 = 28
#between Decimals
- self.assertTrue(min(d1,d2) is d1)
- self.assertTrue(min(d2,d1) is d1)
- self.assertTrue(max(d1,d2) is d2)
- self.assertTrue(max(d2,d1) is d2)
+ self.assertIs(min(d1,d2), d1)
+ self.assertIs(min(d2,d1), d1)
+ self.assertIs(max(d1,d2), d2)
+ self.assertIs(max(d2,d1), d2)
#between Decimal and long
- self.assertTrue(min(d1,l2) is d1)
- self.assertTrue(min(l2,d1) is d1)
- self.assertTrue(max(l1,d2) is d2)
- self.assertTrue(max(d2,l1) is d2)
+ self.assertIs(min(d1,l2), d1)
+ self.assertIs(min(l2,d1), d1)
+ self.assertIs(max(l1,d2), d2)
+ self.assertIs(max(d2,l1), d2)
def test_as_nonzero(self):
#as false
@@ -1293,7 +1417,7 @@ class DecimalUsabilityTest(unittest.TestCase):
self.assertEqual(repr(d), "Decimal('15.32')") # repr
def test_tonum_methods(self):
- #Test float, int and long methods.
+ #Test float and int methods.
d1 = Decimal('66')
d2 = Decimal('15.32')
@@ -1302,10 +1426,6 @@ class DecimalUsabilityTest(unittest.TestCase):
self.assertEqual(int(d1), 66)
self.assertEqual(int(d2), 15)
- #long
- self.assertEqual(int(d1), 66)
- self.assertEqual(int(d2), 15)
-
#float
self.assertEqual(float(d1), 66)
self.assertEqual(float(d2), 15.32)
@@ -1538,10 +1658,10 @@ class DecimalUsabilityTest(unittest.TestCase):
d1 = MyDecimal(1)
d2 = MyDecimal(2)
d = d1 + d2
- self.assertTrue(type(d) is Decimal)
+ self.assertIs(type(d), Decimal)
d = d1.max(d2)
- self.assertTrue(type(d) is Decimal)
+ self.assertIs(type(d), Decimal)
def test_implicit_context(self):
# Check results when context given implicitly. (Issue 2478)
@@ -1601,9 +1721,9 @@ class DecimalPythonAPItests(unittest.TestCase):
def test_abc(self):
self.assertTrue(issubclass(Decimal, numbers.Number))
- self.assertTrue(not issubclass(Decimal, numbers.Real))
- self.assertTrue(isinstance(Decimal(0), numbers.Number))
- self.assertTrue(not isinstance(Decimal(0), numbers.Real))
+ self.assertFalse(issubclass(Decimal, numbers.Real))
+ self.assertIsInstance(Decimal(0), numbers.Number)
+ self.assertNotIsInstance(Decimal(0), numbers.Real)
def test_pickle(self):
d = Decimal('-3.141590000')
@@ -1696,8 +1816,8 @@ class ContextAPItests(unittest.TestCase):
self.assertEqual(v1, v2)
def test_equality_with_other_types(self):
- self.assertTrue(Decimal(10) in ['a', 1.0, Decimal(10), (1,2), {}])
- self.assertTrue(Decimal(10) not in ['a', 1.0, (1,2), {}])
+ self.assertIn(Decimal(10), ['a', 1.0, Decimal(10), (1,2), {}])
+ self.assertNotIn(Decimal(10), ['a', 1.0, (1,2), {}])
def test_copy(self):
# All copies should be deep
@@ -1707,6 +1827,458 @@ class ContextAPItests(unittest.TestCase):
self.assertNotEqual(id(c.flags), id(d.flags))
self.assertNotEqual(id(c.traps), id(d.traps))
+ def test__clamp(self):
+ # In Python 3.2, the private attribute `_clamp` was made
+ # public (issue 8540), with the old `_clamp` becoming a
+ # property wrapping `clamp`. For the duration of Python 3.2
+ # only, the attribute should be gettable/settable via both
+ # `clamp` and `_clamp`; in Python 3.3, `_clamp` should be
+ # removed.
+ c = Context(clamp = 0)
+ self.assertEqual(c.clamp, 0)
+
+ with check_warnings(("", DeprecationWarning)):
+ c._clamp = 1
+ self.assertEqual(c.clamp, 1)
+ with check_warnings(("", DeprecationWarning)):
+ self.assertEqual(c._clamp, 1)
+ c.clamp = 0
+ self.assertEqual(c.clamp, 0)
+ with check_warnings(("", DeprecationWarning)):
+ self.assertEqual(c._clamp, 0)
+
+ def test_abs(self):
+ c = Context()
+ d = c.abs(Decimal(-1))
+ self.assertEqual(c.abs(-1), d)
+ self.assertRaises(TypeError, c.abs, '-1')
+
+ def test_add(self):
+ c = Context()
+ d = c.add(Decimal(1), Decimal(1))
+ self.assertEqual(c.add(1, 1), d)
+ self.assertEqual(c.add(Decimal(1), 1), d)
+ self.assertEqual(c.add(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.add, '1', 1)
+ self.assertRaises(TypeError, c.add, 1, '1')
+
+ def test_compare(self):
+ c = Context()
+ d = c.compare(Decimal(1), Decimal(1))
+ self.assertEqual(c.compare(1, 1), d)
+ self.assertEqual(c.compare(Decimal(1), 1), d)
+ self.assertEqual(c.compare(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.compare, '1', 1)
+ self.assertRaises(TypeError, c.compare, 1, '1')
+
+ def test_compare_signal(self):
+ c = Context()
+ d = c.compare_signal(Decimal(1), Decimal(1))
+ self.assertEqual(c.compare_signal(1, 1), d)
+ self.assertEqual(c.compare_signal(Decimal(1), 1), d)
+ self.assertEqual(c.compare_signal(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.compare_signal, '1', 1)
+ self.assertRaises(TypeError, c.compare_signal, 1, '1')
+
+ def test_compare_total(self):
+ c = Context()
+ d = c.compare_total(Decimal(1), Decimal(1))
+ self.assertEqual(c.compare_total(1, 1), d)
+ self.assertEqual(c.compare_total(Decimal(1), 1), d)
+ self.assertEqual(c.compare_total(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.compare_total, '1', 1)
+ self.assertRaises(TypeError, c.compare_total, 1, '1')
+
+ def test_compare_total_mag(self):
+ c = Context()
+ d = c.compare_total_mag(Decimal(1), Decimal(1))
+ self.assertEqual(c.compare_total_mag(1, 1), d)
+ self.assertEqual(c.compare_total_mag(Decimal(1), 1), d)
+ self.assertEqual(c.compare_total_mag(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.compare_total_mag, '1', 1)
+ self.assertRaises(TypeError, c.compare_total_mag, 1, '1')
+
+ def test_copy_abs(self):
+ c = Context()
+ d = c.copy_abs(Decimal(-1))
+ self.assertEqual(c.copy_abs(-1), d)
+ self.assertRaises(TypeError, c.copy_abs, '-1')
+
+ def test_copy_decimal(self):
+ c = Context()
+ d = c.copy_decimal(Decimal(-1))
+ self.assertEqual(c.copy_decimal(-1), d)
+ self.assertRaises(TypeError, c.copy_decimal, '-1')
+
+ def test_copy_negate(self):
+ c = Context()
+ d = c.copy_negate(Decimal(-1))
+ self.assertEqual(c.copy_negate(-1), d)
+ self.assertRaises(TypeError, c.copy_negate, '-1')
+
+ def test_copy_sign(self):
+ c = Context()
+ d = c.copy_sign(Decimal(1), Decimal(-2))
+ self.assertEqual(c.copy_sign(1, -2), d)
+ self.assertEqual(c.copy_sign(Decimal(1), -2), d)
+ self.assertEqual(c.copy_sign(1, Decimal(-2)), d)
+ self.assertRaises(TypeError, c.copy_sign, '1', -2)
+ self.assertRaises(TypeError, c.copy_sign, 1, '-2')
+
+ def test_divide(self):
+ c = Context()
+ d = c.divide(Decimal(1), Decimal(2))
+ self.assertEqual(c.divide(1, 2), d)
+ self.assertEqual(c.divide(Decimal(1), 2), d)
+ self.assertEqual(c.divide(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.divide, '1', 2)
+ self.assertRaises(TypeError, c.divide, 1, '2')
+
+ def test_divide_int(self):
+ c = Context()
+ d = c.divide_int(Decimal(1), Decimal(2))
+ self.assertEqual(c.divide_int(1, 2), d)
+ self.assertEqual(c.divide_int(Decimal(1), 2), d)
+ self.assertEqual(c.divide_int(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.divide_int, '1', 2)
+ self.assertRaises(TypeError, c.divide_int, 1, '2')
+
+ def test_divmod(self):
+ c = Context()
+ d = c.divmod(Decimal(1), Decimal(2))
+ self.assertEqual(c.divmod(1, 2), d)
+ self.assertEqual(c.divmod(Decimal(1), 2), d)
+ self.assertEqual(c.divmod(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.divmod, '1', 2)
+ self.assertRaises(TypeError, c.divmod, 1, '2')
+
+ def test_exp(self):
+ c = Context()
+ d = c.exp(Decimal(10))
+ self.assertEqual(c.exp(10), d)
+ self.assertRaises(TypeError, c.exp, '10')
+
+ def test_fma(self):
+ c = Context()
+ d = c.fma(Decimal(2), Decimal(3), Decimal(4))
+ self.assertEqual(c.fma(2, 3, 4), d)
+ self.assertEqual(c.fma(Decimal(2), 3, 4), d)
+ self.assertEqual(c.fma(2, Decimal(3), 4), d)
+ self.assertEqual(c.fma(2, 3, Decimal(4)), d)
+ self.assertEqual(c.fma(Decimal(2), Decimal(3), 4), d)
+ self.assertRaises(TypeError, c.fma, '2', 3, 4)
+ self.assertRaises(TypeError, c.fma, 2, '3', 4)
+ self.assertRaises(TypeError, c.fma, 2, 3, '4')
+
+ def test_is_finite(self):
+ c = Context()
+ d = c.is_finite(Decimal(10))
+ self.assertEqual(c.is_finite(10), d)
+ self.assertRaises(TypeError, c.is_finite, '10')
+
+ def test_is_infinite(self):
+ c = Context()
+ d = c.is_infinite(Decimal(10))
+ self.assertEqual(c.is_infinite(10), d)
+ self.assertRaises(TypeError, c.is_infinite, '10')
+
+ def test_is_nan(self):
+ c = Context()
+ d = c.is_nan(Decimal(10))
+ self.assertEqual(c.is_nan(10), d)
+ self.assertRaises(TypeError, c.is_nan, '10')
+
+ def test_is_normal(self):
+ c = Context()
+ d = c.is_normal(Decimal(10))
+ self.assertEqual(c.is_normal(10), d)
+ self.assertRaises(TypeError, c.is_normal, '10')
+
+ def test_is_qnan(self):
+ c = Context()
+ d = c.is_qnan(Decimal(10))
+ self.assertEqual(c.is_qnan(10), d)
+ self.assertRaises(TypeError, c.is_qnan, '10')
+
+ def test_is_signed(self):
+ c = Context()
+ d = c.is_signed(Decimal(10))
+ self.assertEqual(c.is_signed(10), d)
+ self.assertRaises(TypeError, c.is_signed, '10')
+
+ def test_is_snan(self):
+ c = Context()
+ d = c.is_snan(Decimal(10))
+ self.assertEqual(c.is_snan(10), d)
+ self.assertRaises(TypeError, c.is_snan, '10')
+
+ def test_is_subnormal(self):
+ c = Context()
+ d = c.is_subnormal(Decimal(10))
+ self.assertEqual(c.is_subnormal(10), d)
+ self.assertRaises(TypeError, c.is_subnormal, '10')
+
+ def test_is_zero(self):
+ c = Context()
+ d = c.is_zero(Decimal(10))
+ self.assertEqual(c.is_zero(10), d)
+ self.assertRaises(TypeError, c.is_zero, '10')
+
+ def test_ln(self):
+ c = Context()
+ d = c.ln(Decimal(10))
+ self.assertEqual(c.ln(10), d)
+ self.assertRaises(TypeError, c.ln, '10')
+
+ def test_log10(self):
+ c = Context()
+ d = c.log10(Decimal(10))
+ self.assertEqual(c.log10(10), d)
+ self.assertRaises(TypeError, c.log10, '10')
+
+ def test_logb(self):
+ c = Context()
+ d = c.logb(Decimal(10))
+ self.assertEqual(c.logb(10), d)
+ self.assertRaises(TypeError, c.logb, '10')
+
+ def test_logical_and(self):
+ c = Context()
+ d = c.logical_and(Decimal(1), Decimal(1))
+ self.assertEqual(c.logical_and(1, 1), d)
+ self.assertEqual(c.logical_and(Decimal(1), 1), d)
+ self.assertEqual(c.logical_and(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.logical_and, '1', 1)
+ self.assertRaises(TypeError, c.logical_and, 1, '1')
+
+ def test_logical_invert(self):
+ c = Context()
+ d = c.logical_invert(Decimal(1000))
+ self.assertEqual(c.logical_invert(1000), d)
+ self.assertRaises(TypeError, c.logical_invert, '1000')
+
+ def test_logical_or(self):
+ c = Context()
+ d = c.logical_or(Decimal(1), Decimal(1))
+ self.assertEqual(c.logical_or(1, 1), d)
+ self.assertEqual(c.logical_or(Decimal(1), 1), d)
+ self.assertEqual(c.logical_or(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.logical_or, '1', 1)
+ self.assertRaises(TypeError, c.logical_or, 1, '1')
+
+ def test_logical_xor(self):
+ c = Context()
+ d = c.logical_xor(Decimal(1), Decimal(1))
+ self.assertEqual(c.logical_xor(1, 1), d)
+ self.assertEqual(c.logical_xor(Decimal(1), 1), d)
+ self.assertEqual(c.logical_xor(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.logical_xor, '1', 1)
+ self.assertRaises(TypeError, c.logical_xor, 1, '1')
+
+ def test_max(self):
+ c = Context()
+ d = c.max(Decimal(1), Decimal(2))
+ self.assertEqual(c.max(1, 2), d)
+ self.assertEqual(c.max(Decimal(1), 2), d)
+ self.assertEqual(c.max(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.max, '1', 2)
+ self.assertRaises(TypeError, c.max, 1, '2')
+
+ def test_max_mag(self):
+ c = Context()
+ d = c.max_mag(Decimal(1), Decimal(2))
+ self.assertEqual(c.max_mag(1, 2), d)
+ self.assertEqual(c.max_mag(Decimal(1), 2), d)
+ self.assertEqual(c.max_mag(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.max_mag, '1', 2)
+ self.assertRaises(TypeError, c.max_mag, 1, '2')
+
+ def test_min(self):
+ c = Context()
+ d = c.min(Decimal(1), Decimal(2))
+ self.assertEqual(c.min(1, 2), d)
+ self.assertEqual(c.min(Decimal(1), 2), d)
+ self.assertEqual(c.min(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.min, '1', 2)
+ self.assertRaises(TypeError, c.min, 1, '2')
+
+ def test_min_mag(self):
+ c = Context()
+ d = c.min_mag(Decimal(1), Decimal(2))
+ self.assertEqual(c.min_mag(1, 2), d)
+ self.assertEqual(c.min_mag(Decimal(1), 2), d)
+ self.assertEqual(c.min_mag(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.min_mag, '1', 2)
+ self.assertRaises(TypeError, c.min_mag, 1, '2')
+
+ def test_minus(self):
+ c = Context()
+ d = c.minus(Decimal(10))
+ self.assertEqual(c.minus(10), d)
+ self.assertRaises(TypeError, c.minus, '10')
+
+ def test_multiply(self):
+ c = Context()
+ d = c.multiply(Decimal(1), Decimal(2))
+ self.assertEqual(c.multiply(1, 2), d)
+ self.assertEqual(c.multiply(Decimal(1), 2), d)
+ self.assertEqual(c.multiply(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.multiply, '1', 2)
+ self.assertRaises(TypeError, c.multiply, 1, '2')
+
+ def test_next_minus(self):
+ c = Context()
+ d = c.next_minus(Decimal(10))
+ self.assertEqual(c.next_minus(10), d)
+ self.assertRaises(TypeError, c.next_minus, '10')
+
+ def test_next_plus(self):
+ c = Context()
+ d = c.next_plus(Decimal(10))
+ self.assertEqual(c.next_plus(10), d)
+ self.assertRaises(TypeError, c.next_plus, '10')
+
+ def test_next_toward(self):
+ c = Context()
+ d = c.next_toward(Decimal(1), Decimal(2))
+ self.assertEqual(c.next_toward(1, 2), d)
+ self.assertEqual(c.next_toward(Decimal(1), 2), d)
+ self.assertEqual(c.next_toward(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.next_toward, '1', 2)
+ self.assertRaises(TypeError, c.next_toward, 1, '2')
+
+ def test_normalize(self):
+ c = Context()
+ d = c.normalize(Decimal(10))
+ self.assertEqual(c.normalize(10), d)
+ self.assertRaises(TypeError, c.normalize, '10')
+
+ def test_number_class(self):
+ c = Context()
+ self.assertEqual(c.number_class(123), c.number_class(Decimal(123)))
+ self.assertEqual(c.number_class(0), c.number_class(Decimal(0)))
+ self.assertEqual(c.number_class(-45), c.number_class(Decimal(-45)))
+
+ def test_power(self):
+ c = Context()
+ d = c.power(Decimal(1), Decimal(4), Decimal(2))
+ self.assertEqual(c.power(1, 4, 2), d)
+ self.assertEqual(c.power(Decimal(1), 4, 2), d)
+ self.assertEqual(c.power(1, Decimal(4), 2), d)
+ self.assertEqual(c.power(1, 4, Decimal(2)), d)
+ self.assertEqual(c.power(Decimal(1), Decimal(4), 2), d)
+ self.assertRaises(TypeError, c.power, '1', 4, 2)
+ self.assertRaises(TypeError, c.power, 1, '4', 2)
+ self.assertRaises(TypeError, c.power, 1, 4, '2')
+
+ def test_plus(self):
+ c = Context()
+ d = c.plus(Decimal(10))
+ self.assertEqual(c.plus(10), d)
+ self.assertRaises(TypeError, c.plus, '10')
+
+ def test_quantize(self):
+ c = Context()
+ d = c.quantize(Decimal(1), Decimal(2))
+ self.assertEqual(c.quantize(1, 2), d)
+ self.assertEqual(c.quantize(Decimal(1), 2), d)
+ self.assertEqual(c.quantize(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.quantize, '1', 2)
+ self.assertRaises(TypeError, c.quantize, 1, '2')
+
+ def test_remainder(self):
+ c = Context()
+ d = c.remainder(Decimal(1), Decimal(2))
+ self.assertEqual(c.remainder(1, 2), d)
+ self.assertEqual(c.remainder(Decimal(1), 2), d)
+ self.assertEqual(c.remainder(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.remainder, '1', 2)
+ self.assertRaises(TypeError, c.remainder, 1, '2')
+
+ def test_remainder_near(self):
+ c = Context()
+ d = c.remainder_near(Decimal(1), Decimal(2))
+ self.assertEqual(c.remainder_near(1, 2), d)
+ self.assertEqual(c.remainder_near(Decimal(1), 2), d)
+ self.assertEqual(c.remainder_near(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.remainder_near, '1', 2)
+ self.assertRaises(TypeError, c.remainder_near, 1, '2')
+
+ def test_rotate(self):
+ c = Context()
+ d = c.rotate(Decimal(1), Decimal(2))
+ self.assertEqual(c.rotate(1, 2), d)
+ self.assertEqual(c.rotate(Decimal(1), 2), d)
+ self.assertEqual(c.rotate(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.rotate, '1', 2)
+ self.assertRaises(TypeError, c.rotate, 1, '2')
+
+ def test_sqrt(self):
+ c = Context()
+ d = c.sqrt(Decimal(10))
+ self.assertEqual(c.sqrt(10), d)
+ self.assertRaises(TypeError, c.sqrt, '10')
+
+ def test_same_quantum(self):
+ c = Context()
+ d = c.same_quantum(Decimal(1), Decimal(2))
+ self.assertEqual(c.same_quantum(1, 2), d)
+ self.assertEqual(c.same_quantum(Decimal(1), 2), d)
+ self.assertEqual(c.same_quantum(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.same_quantum, '1', 2)
+ self.assertRaises(TypeError, c.same_quantum, 1, '2')
+
+ def test_scaleb(self):
+ c = Context()
+ d = c.scaleb(Decimal(1), Decimal(2))
+ self.assertEqual(c.scaleb(1, 2), d)
+ self.assertEqual(c.scaleb(Decimal(1), 2), d)
+ self.assertEqual(c.scaleb(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.scaleb, '1', 2)
+ self.assertRaises(TypeError, c.scaleb, 1, '2')
+
+ def test_shift(self):
+ c = Context()
+ d = c.shift(Decimal(1), Decimal(2))
+ self.assertEqual(c.shift(1, 2), d)
+ self.assertEqual(c.shift(Decimal(1), 2), d)
+ self.assertEqual(c.shift(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.shift, '1', 2)
+ self.assertRaises(TypeError, c.shift, 1, '2')
+
+ def test_subtract(self):
+ c = Context()
+ d = c.subtract(Decimal(1), Decimal(2))
+ self.assertEqual(c.subtract(1, 2), d)
+ self.assertEqual(c.subtract(Decimal(1), 2), d)
+ self.assertEqual(c.subtract(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.subtract, '1', 2)
+ self.assertRaises(TypeError, c.subtract, 1, '2')
+
+ def test_to_eng_string(self):
+ c = Context()
+ d = c.to_eng_string(Decimal(10))
+ self.assertEqual(c.to_eng_string(10), d)
+ self.assertRaises(TypeError, c.to_eng_string, '10')
+
+ def test_to_sci_string(self):
+ c = Context()
+ d = c.to_sci_string(Decimal(10))
+ self.assertEqual(c.to_sci_string(10), d)
+ self.assertRaises(TypeError, c.to_sci_string, '10')
+
+ def test_to_integral_exact(self):
+ c = Context()
+ d = c.to_integral_exact(Decimal(10))
+ self.assertEqual(c.to_integral_exact(10), d)
+ self.assertRaises(TypeError, c.to_integral_exact, '10')
+
+ def test_to_integral_value(self):
+ c = Context()
+ d = c.to_integral_value(Decimal(10))
+ self.assertEqual(c.to_integral_value(10), d)
+ self.assertRaises(TypeError, c.to_integral_value, '10')
+
class WithStatementTest(unittest.TestCase):
# Can't do these as docstrings until Python 2.6
# as doctest can't handle __future__ statements
@@ -1717,9 +2289,9 @@ class WithStatementTest(unittest.TestCase):
with localcontext() as enter_ctx:
set_ctx = getcontext()
final_ctx = getcontext()
- self.assertTrue(orig_ctx is final_ctx, 'did not restore context correctly')
- self.assertTrue(orig_ctx is not set_ctx, 'did not copy the context')
- self.assertTrue(set_ctx is enter_ctx, '__enter__ returned wrong context')
+ self.assertIs(orig_ctx, final_ctx, 'did not restore context correctly')
+ self.assertIsNot(orig_ctx, set_ctx, 'did not copy the context')
+ self.assertIs(set_ctx, enter_ctx, '__enter__ returned wrong context')
def test_localcontextarg(self):
# Use a copy of the supplied context in the block
@@ -1728,10 +2300,10 @@ class WithStatementTest(unittest.TestCase):
with localcontext(new_ctx) as enter_ctx:
set_ctx = getcontext()
final_ctx = getcontext()
- self.assertTrue(orig_ctx is final_ctx, 'did not restore context correctly')
- self.assertTrue(set_ctx.prec == new_ctx.prec, 'did not set correct context')
- self.assertTrue(new_ctx is not set_ctx, 'did not copy the context')
- self.assertTrue(set_ctx is enter_ctx, '__enter__ returned wrong context')
+ self.assertIs(orig_ctx, final_ctx, 'did not restore context correctly')
+ self.assertEqual(set_ctx.prec, new_ctx.prec, 'did not set correct context')
+ self.assertIsNot(new_ctx, set_ctx, 'did not copy the context')
+ self.assertIs(set_ctx, enter_ctx, '__enter__ returned wrong context')
class ContextFlags(unittest.TestCase):
def test_flags_irrelevant(self):
diff --git a/Lib/test/test_defaultdict.py b/Lib/test/test_defaultdict.py
index e5a9bd5df7..da2608a548 100644
--- a/Lib/test/test_defaultdict.py
+++ b/Lib/test/test_defaultdict.py
@@ -32,14 +32,14 @@ class TestDefaultDict(unittest.TestCase):
self.assertEqual(d2["foo"], 1)
self.assertEqual(d2["bar"], 2)
self.assertEqual(d2[42], [])
- self.assertTrue("foo" in d2)
- self.assertTrue("foo" in d2.keys())
- self.assertTrue("bar" in d2)
- self.assertTrue("bar" in d2.keys())
- self.assertTrue(42 in d2)
- self.assertTrue(42 in d2.keys())
- self.assertTrue(12 not in d2)
- self.assertTrue(12 not in d2.keys())
+ self.assertIn("foo", d2)
+ self.assertIn("foo", d2.keys())
+ self.assertIn("bar", d2)
+ self.assertIn("bar", d2.keys())
+ self.assertIn(42, d2)
+ self.assertIn(42, d2.keys())
+ self.assertNotIn(12, d2)
+ self.assertNotIn(12, d2.keys())
d2.default_factory = None
self.assertEqual(d2.default_factory, None)
try:
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index 67e41d681a..0dcadeb3c5 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -7,7 +7,6 @@ import copy
import pickle
from io import StringIO
import random
-import os
BIG = 100000
@@ -115,6 +114,39 @@ class TestBasic(unittest.TestCase):
d = deque('abc')
d.maxlen = 10
+ def test_count(self):
+ for s in ('', 'abracadabra', 'simsalabim'*500+'abc'):
+ s = list(s)
+ d = deque(s)
+ for letter in 'abcdefghijklmnopqrstuvwxyz':
+ self.assertEqual(s.count(letter), d.count(letter), (s, d, letter))
+ self.assertRaises(TypeError, d.count) # too few args
+ self.assertRaises(TypeError, d.count, 1, 2) # too many args
+ class BadCompare:
+ def __eq__(self, other):
+ raise ArithmeticError
+ d = deque([1, 2, BadCompare(), 3])
+ self.assertRaises(ArithmeticError, d.count, 2)
+ d = deque([1, 2, 3])
+ self.assertRaises(ArithmeticError, d.count, BadCompare())
+ class MutatingCompare:
+ def __eq__(self, other):
+ self.d.pop()
+ return True
+ m = MutatingCompare()
+ d = deque([1, 2, 3, m, 4, 5])
+ m.d = d
+ self.assertRaises(RuntimeError, d.count, 3)
+
+ # test issue11004
+ # block advance failed after rotation aligned elements on right side of block
+ d = deque([None]*16)
+ for i in range(len(d)):
+ d.rotate(-1)
+ d.rotate(1)
+ self.assertEqual(d.count(1), 0)
+ self.assertEqual(d.count(None), 16)
+
def test_comparisons(self):
d = deque('xabc'); d.popleft()
for e in [d, deque('abc'), deque('ab'), deque(), list(d)]:
@@ -199,11 +231,23 @@ class TestBasic(unittest.TestCase):
self.assertEqual(len(d), n-i)
j = random.randrange(-len(d), len(d))
val = d[j]
- self.assertTrue(val in d)
+ self.assertIn(val, d)
del d[j]
- self.assertTrue(val not in d)
+ self.assertNotIn(val, d)
self.assertEqual(len(d), 0)
+ def test_reverse(self):
+ n = 500 # O(n**2) test, don't make this too big
+ data = [random.random() for i in range(n)]
+ for i in range(n):
+ d = deque(data[:i])
+ r = d.reverse()
+ self.assertEqual(list(d), list(reversed(data[:i])))
+ self.assertIs(r, None)
+ d.reverse()
+ self.assertEqual(list(d), data[:i])
+ self.assertRaises(TypeError, d.reverse, 1) # Arity is zero
+
def test_rotate(self):
s = tuple('abcde')
n = len(s)
@@ -316,7 +360,7 @@ class TestBasic(unittest.TestCase):
e = eval(repr(d))
self.assertEqual(list(d), list(e))
d.append(d)
- self.assertTrue('...' in repr(d))
+ self.assertIn('...', repr(d))
def test_print(self):
d = deque(range(200))
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index aafe428bd0..6638116394 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1,8 +1,8 @@
import builtins
import sys
import types
+import math
import unittest
-import warnings
from copy import deepcopy
from test import support
@@ -248,10 +248,6 @@ class OperatorsTest(unittest.TestCase):
else:
self.fail("NotImplemented should have caused TypeError")
- def test_longs(self):
- # Testing long operations...
- self.number_operators(100, 3)
-
def test_floats(self):
# Testing float operations...
self.number_operators(100.0, 3.0)
@@ -259,7 +255,7 @@ class OperatorsTest(unittest.TestCase):
def test_complexes(self):
# Testing complex operations...
self.number_operators(100.0j, 3.0j, skip=['lt', 'le', 'gt', 'ge',
- 'int', 'long', 'float',
+ 'int', 'float',
'divmod', 'mod'])
class Number(complex):
@@ -393,11 +389,11 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def test_python_dicts(self):
# Testing Python subclass of dict...
self.assertTrue(issubclass(dict, dict))
- self.assertTrue(isinstance({}, dict))
+ self.assertIsInstance({}, dict)
d = dict()
self.assertEqual(d, {})
self.assertTrue(d.__class__ is dict)
- self.assertTrue(isinstance(d, dict))
+ self.assertIsInstance(d, dict)
class C(dict):
state = -1
def __init__(self_local, *a, **kw):
@@ -410,7 +406,7 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def __getitem__(self, key):
return self.get(key, 0)
def __setitem__(self_local, key, value):
- self.assertTrue(isinstance(key, type(0)))
+ self.assertIsInstance(key, type(0))
dict.__setitem__(self_local, key, value)
def setstate(self, state):
self.state = state
@@ -509,7 +505,7 @@ class ClassPropertiesAndMethods(unittest.TestCase):
return 42
self.assertEqual(C.name, 'C')
self.assertEqual(C.bases, ())
- self.assertTrue('spam' in C.dict)
+ self.assertIn('spam', C.dict)
c = C()
self.assertEqual(c.spam(), 42)
@@ -633,7 +629,6 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def test_module_subclasses(self):
# Testing Python subclass of module...
log = []
- import types, sys
MT = type(sys)
class MM(MT):
def __init__(self, name):
@@ -1015,7 +1010,6 @@ order (MRO) for bases """
# Test cyclical leaks [SF bug 519621]
class F(object):
__slots__ = ['a', 'b']
- log = []
s = F()
s.a = [Counted(), s]
self.assertEqual(Counted.counter, 1)
@@ -1024,11 +1018,11 @@ order (MRO) for bases """
self.assertEqual(Counted.counter, 0)
# Test lookup leaks [SF bug 572567]
- import sys,gc
+ import gc
if hasattr(gc, 'get_objects'):
class G(object):
- def __cmp__(self, other):
- return 0
+ def __eq__(self, other):
+ return False
g = G()
orig_objects = len(gc.get_objects())
for i in range(10):
@@ -1104,7 +1098,7 @@ order (MRO) for bases """
MyABC.register(Unrelated)
u = Unrelated()
- self.assertTrue(isinstance(u, MyABC))
+ self.assertIsInstance(u, MyABC)
# This used to crash
self.assertRaises(TypeError, MyABC.a.__set__, u, 3)
@@ -1172,15 +1166,6 @@ order (MRO) for bases """
self.assertEqual(I(3)*2, 6)
self.assertEqual(I(3)*I(2), 6)
- # Test handling of long*seq and seq*long
- class L(int):
- pass
- self.assertEqual("a"*L(2), "aa")
- self.assertEqual(L(2)*"a", "aa")
- self.assertEqual(2*L(3), 6)
- self.assertEqual(L(3)*2, 6)
- self.assertEqual(L(3)*L(2), 6)
-
# Test comparison of classes with dynamic metaclasses
class dynamicmetaclass(type):
pass
@@ -1560,6 +1545,8 @@ order (MRO) for bases """
return []
def zero(self):
return 0
+ def complex_num(self):
+ return 1j
def stop(self):
raise StopIteration
def return_true(self, thing=None):
@@ -1575,6 +1562,9 @@ order (MRO) for bases """
def some_number(self_, key):
self.assertEqual(key, "hi")
return 4
+ def swallow(*args): pass
+ def format_impl(self, spec):
+ return "hello"
# It would be nice to have every special method tested here, but I'm
# only listing the ones I can remember outside of typeobject.c, since it
@@ -1590,11 +1580,13 @@ order (MRO) for bases """
set(("__class__",)), {}),
("__subclasscheck__", do_issubclass, return_true,
set(("__bases__",)), {}),
- # These two fail because the compiler generates LOAD_ATTR to look
- # them up. We'd have to add a new opcode to fix this, and it's
- # probably not worth it.
- # ("__enter__", run_context, iden),
- # ("__exit__", run_context, iden),
+ ("__enter__", run_context, iden, set(), {"__exit__" : swallow}),
+ ("__exit__", run_context, swallow, set(), {"__enter__" : iden}),
+ ("__complex__", complex, complex_num, set(), {}),
+ ("__format__", format, format_impl, set(), {}),
+ ("__floor__", math.floor, zero, set(), {}),
+ ("__trunc__", math.trunc, zero, set(), {}),
+ ("__ceil__", math.ceil, zero, set(), {}),
]
class Checker(object):
@@ -1668,10 +1660,10 @@ order (MRO) for bases """
# depending on whether this test is run standalone or from a framework.
self.assertTrue(str(c1).find('C object at ') >= 0)
self.assertEqual(str(c1), repr(c1))
- self.assertTrue(-1 not in c1)
+ self.assertNotIn(-1, c1)
for i in range(10):
- self.assertTrue(i in c1)
- self.assertFalse(10 in c1)
+ self.assertIn(i, c1)
+ self.assertNotIn(10, c1)
# Test the default behavior for dynamic classes
class D(object):
def __getitem__(self, i):
@@ -1691,10 +1683,10 @@ order (MRO) for bases """
# depending on whether this test is run standalone or from a framework.
self.assertTrue(str(d1).find('D object at ') >= 0)
self.assertEqual(str(d1), repr(d1))
- self.assertTrue(-1 not in d1)
+ self.assertNotIn(-1, d1)
for i in range(10):
- self.assertTrue(i in d1)
- self.assertFalse(10 in d1)
+ self.assertIn(i, d1)
+ self.assertNotIn(10, d1)
# Test overridden behavior
class Proxy(object):
def __init__(self, x):
@@ -1738,10 +1730,10 @@ order (MRO) for bases """
self.assertEqual(str(p0), "Proxy:0")
self.assertEqual(repr(p0), "Proxy(0)")
p10 = Proxy(range(10))
- self.assertFalse(-1 in p10)
+ self.assertNotIn(-1, p10)
for i in range(10):
- self.assertTrue(i in p10)
- self.assertFalse(10 in p10)
+ self.assertIn(i, p10)
+ self.assertNotIn(10, p10)
def test_weakrefs(self):
# Testing weak references...
@@ -1798,13 +1790,13 @@ order (MRO) for bases """
self.assertFalse(hasattr(a, "x"))
raw = C.__dict__['x']
- self.assertTrue(isinstance(raw, property))
+ self.assertIsInstance(raw, property)
attrs = dir(raw)
- self.assertTrue("__doc__" in attrs)
- self.assertTrue("fget" in attrs)
- self.assertTrue("fset" in attrs)
- self.assertTrue("fdel" in attrs)
+ self.assertIn("__doc__", attrs)
+ self.assertIn("fget", attrs)
+ self.assertIn("fset", attrs)
+ self.assertIn("fdel", attrs)
self.assertEqual(raw.__doc__, "I'm the x property.")
self.assertTrue(raw.fget is C.__dict__['getx'])
@@ -1834,6 +1826,9 @@ order (MRO) for bases """
else:
self.fail("expected ZeroDivisionError from bad property")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_properties_doc_attrib(self):
class E(object):
def getter(self):
"getter method"
@@ -1846,6 +1841,7 @@ order (MRO) for bases """
prop2 = property(fset=setter)
self.assertEqual(prop2.__doc__, None)
+ def test_testcapi_no_segfault(self):
# this segfaulted in 2.5b2
try:
import _testcapi
@@ -2029,12 +2025,12 @@ order (MRO) for bases """
c = C()
self.assertEqual(interesting(dir(c)), cstuff)
- ## self.assertTrue('__self__' in dir(C.Cmethod))
+ ## self.assertIn('__self__', dir(C.Cmethod))
c.cdata = 2
c.cmethod = lambda self: 0
self.assertEqual(interesting(dir(c)), cstuff + ['cdata', 'cmethod'])
- ## self.assertTrue('__self__' in dir(c.Cmethod))
+ ## self.assertIn('__self__', dir(c.Cmethod))
class A(C):
Adata = 1
@@ -2042,16 +2038,15 @@ order (MRO) for bases """
astuff = ['Adata', 'Amethod'] + cstuff
self.assertEqual(interesting(dir(A)), astuff)
- ## self.assertTrue('__self__' in dir(A.Amethod))
+ ## self.assertIn('__self__', dir(A.Amethod))
a = A()
self.assertEqual(interesting(dir(a)), astuff)
a.adata = 42
a.amethod = lambda self: 3
self.assertEqual(interesting(dir(a)), astuff + ['adata', 'amethod'])
- ## self.assertTrue('__self__' in dir(a.Amethod))
+ ## self.assertIn('__self__', dir(a.Amethod))
# Try a module subclass.
- import sys
class M(type(sys)):
pass
minstance = M("m")
@@ -2243,10 +2238,7 @@ order (MRO) for bases """
class octlong(int):
__slots__ = []
def __str__(self):
- s = oct(self)
- if s[-1] == 'L':
- s = s[:-1]
- return s
+ return oct(self)
def __add__(self, other):
return self.__class__(super(octlong, self).__add__(other))
__radd__ = __add__
@@ -2603,7 +2595,7 @@ order (MRO) for bases """
self.assertEqual(d[cistr('one')], 1)
self.assertEqual(d[cistr('tWo')], 2)
self.assertEqual(d[cistr('THrEE')], 3)
- self.assertTrue(cistr('ONe') in d)
+ self.assertIn(cistr('ONe'), d)
self.assertEqual(d.get(cistr('thrEE')), 3)
def test_classic_comparisons(self):
@@ -3222,7 +3214,6 @@ order (MRO) for bases """
self.fail("d.foo should be undefined now")
# Test a nasty bug in recurse_down_subclasses()
- import gc
class A(object):
pass
class B(A):
@@ -3427,10 +3418,10 @@ order (MRO) for bases """
d = D(None)
self.assertEqual(d.foo, None)
d = C(1)
- self.assertEqual(isinstance(d, D), True)
+ self.assertIsInstance(d, D)
self.assertEqual(d.foo, 1)
d = D(1)
- self.assertEqual(isinstance(d, D), True)
+ self.assertIsInstance(d, D)
self.assertEqual(d.foo, 1)
def test_imul_bug(self):
@@ -3922,29 +3913,29 @@ order (MRO) for bases """
pass
a = C()
pa = Proxy(a)
- self.assertTrue(isinstance(a, C)) # Baseline
- self.assertTrue(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
# Test with a classic subclass
class D(C):
pass
a = D()
pa = Proxy(a)
- self.assertTrue(isinstance(a, C)) # Baseline
- self.assertTrue(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
# Test with a new-style class
class C(object):
pass
a = C()
pa = Proxy(a)
- self.assertTrue(isinstance(a, C)) # Baseline
- self.assertTrue(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
# Test with a new-style subclass
class D(C):
pass
a = D()
pa = Proxy(a)
- self.assertTrue(isinstance(a, C)) # Baseline
- self.assertTrue(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
def test_proxy_super(self):
# Testing super() for a proxy object...
@@ -4012,7 +4003,7 @@ order (MRO) for bases """
def test_file_fault(self):
# Testing sys.stdout is changed in getattr...
- import sys
+ test_stdout = sys.stdout
class StdoutGuard:
def __getattr__(self, attr):
sys.stdout = sys.__stdout__
@@ -4022,6 +4013,8 @@ order (MRO) for bases """
print("Oops!")
except RuntimeError:
pass
+ finally:
+ sys.stdout = test_stdout
def test_vicious_descriptor_nonsense(self):
# Testing vicious_descriptor_nonsense...
@@ -4100,8 +4093,6 @@ order (MRO) for bases """
def test_not_implemented(self):
# Testing NotImplemented...
# all binary methods should be able to return a NotImplemented
- import sys
- import types
import operator
def specialmethod(self, other):
@@ -4184,6 +4175,15 @@ order (MRO) for bases """
x.a = 42
self.assertEqual(x.a, 42)
+ # Also check type_getattro for correctness.
+ class Meta(type):
+ pass
+ class X(object):
+ __metaclass__ = Meta
+ X.a = 42
+ Meta.a = Descr("a")
+ self.assertEqual(X.a, 42)
+
def test_getattr_hooks(self):
# issue 4230
@@ -4260,20 +4260,26 @@ class DictProxyTests(unittest.TestCase):
self.C = C
def test_iter_keys(self):
- # Testing dict-proxy iterkeys...
- keys = [ key for key in self.C.__dict__.keys() ]
+ # Testing dict-proxy keys...
+ it = self.C.__dict__.keys()
+ self.assertNotIsInstance(it, list)
+ keys = list(it)
keys.sort()
self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
'__weakref__', 'meth'])
def test_iter_values(self):
- # Testing dict-proxy itervalues...
- values = [ values for values in self.C.__dict__.values() ]
+ # Testing dict-proxy values...
+ it = self.C.__dict__.values()
+ self.assertNotIsInstance(it, list)
+ values = list(it)
self.assertEqual(len(values), 5)
def test_iter_items(self):
# Testing dict-proxy iteritems...
- keys = [ key for (key, value) in self.C.__dict__.items() ]
+ it = self.C.__dict__.items()
+ self.assertNotIsInstance(it, list)
+ keys = [item[0] for item in it]
keys.sort()
self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
'__weakref__', 'meth'])
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index d1b103787d..1507e42053 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -1,41 +1,50 @@
import unittest
from test import support
-import sys, collections, random, string
+import collections, random, string
import gc, weakref
class DictTest(unittest.TestCase):
+ def test_invalid_keyword_arguments(self):
+ class Custom(dict):
+ pass
+ for invalid in {1 : 2}, Custom({1 : 2}):
+ with self.assertRaises(TypeError):
+ dict(**invalid)
+ with self.assertRaises(TypeError):
+ {}.update(**invalid)
+
def test_constructor(self):
# calling built-in types without argument must return empty
self.assertEqual(dict(), {})
- self.assertTrue(dict() is not {})
+ self.assertIsNot(dict(), {})
def test_literal_constructor(self):
- # check literal constructor for different sized dicts (to exercise the BUILD_MAP oparg
+ # check literal constructor for different sized dicts
+ # (to exercise the BUILD_MAP oparg).
for n in (0, 1, 6, 256, 400):
- items = [(''.join([random.choice(string.ascii_letters)
- for j in range(8)]),
- i)
+ items = [(''.join(random.sample(string.ascii_letters, 8)), i)
for i in range(n)]
random.shuffle(items)
- dictliteral = '{' + ', '.join('%r: %d' % item for item in items) + '}'
+ formatted_items = ('{!r}: {:d}'.format(k, v) for k, v in items)
+ dictliteral = '{' + ', '.join(formatted_items) + '}'
self.assertEqual(eval(dictliteral), dict(items))
def test_bool(self):
- self.assertTrue(not {})
+ self.assertIs(not {}, True)
self.assertTrue({1: 2})
- self.assertTrue(bool({}) is False)
- self.assertTrue(bool({1: 2}) is True)
+ self.assertIs(bool({}), False)
+ self.assertIs(bool({1: 2}), True)
def test_keys(self):
d = {}
self.assertEqual(set(d.keys()), set())
d = {'a': 1, 'b': 2}
k = d.keys()
- self.assertTrue('a' in d)
- self.assertTrue('b' in d)
+ self.assertIn('a', d)
+ self.assertIn('b', d)
self.assertRaises(TypeError, d.keys, None)
self.assertEqual(repr(dict(a=1).keys()), "dict_keys(['a'])")
@@ -58,12 +67,13 @@ class DictTest(unittest.TestCase):
def test_contains(self):
d = {}
- self.assertTrue(not ('a' in d))
+ self.assertNotIn('a', d)
+ self.assertFalse('a' in d)
self.assertTrue('a' not in d)
d = {'a': 1, 'b': 2}
- self.assertTrue('a' in d)
- self.assertTrue('b' in d)
- self.assertTrue('c' not in d)
+ self.assertIn('a', d)
+ self.assertIn('b', d)
+ self.assertNotIn('c', d)
self.assertRaises(TypeError, d.__contains__)
@@ -197,7 +207,7 @@ class DictTest(unittest.TestCase):
def test_fromkeys(self):
self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
d = {}
- self.assertTrue(not(d.fromkeys('abc') is d))
+ self.assertIsNot(d.fromkeys('abc'), d)
self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
self.assertEqual(d.fromkeys([]), {})
@@ -208,14 +218,14 @@ class DictTest(unittest.TestCase):
class dictlike(dict): pass
self.assertEqual(dictlike.fromkeys('a'), {'a':None})
self.assertEqual(dictlike().fromkeys('a'), {'a':None})
- self.assertTrue(type(dictlike.fromkeys('a')) is dictlike)
- self.assertTrue(type(dictlike().fromkeys('a')) is dictlike)
+ self.assertIsInstance(dictlike.fromkeys('a'), dictlike)
+ self.assertIsInstance(dictlike().fromkeys('a'), dictlike)
class mydict(dict):
def __new__(cls):
return collections.UserDict()
ud = mydict.fromkeys('ab')
self.assertEqual(ud, {'a':None, 'b':None})
- self.assertTrue(isinstance(ud, collections.UserDict))
+ self.assertIsInstance(ud, collections.UserDict)
self.assertRaises(TypeError, dict.fromkeys)
class Exc(Exception): pass
@@ -252,10 +262,10 @@ class DictTest(unittest.TestCase):
def test_get(self):
d = {}
- self.assertTrue(d.get('c') is None)
+ self.assertIs(d.get('c'), None)
self.assertEqual(d.get('c', 3), 3)
- d = {'a' : 1, 'b' : 2}
- self.assertTrue(d.get('c') is None)
+ d = {'a': 1, 'b': 2}
+ self.assertIs(d.get('c'), None)
self.assertEqual(d.get('c', 3), 3)
self.assertEqual(d.get('a'), 1)
self.assertEqual(d.get('a', 3), 1)
@@ -265,9 +275,9 @@ class DictTest(unittest.TestCase):
def test_setdefault(self):
# dict.setdefault()
d = {}
- self.assertTrue(d.setdefault('key0') is None)
+ self.assertIs(d.setdefault('key0'), None)
d.setdefault('key0', [])
- self.assertTrue(d.setdefault('key0') is None)
+ self.assertIs(d.setdefault('key0'), None)
d.setdefault('key', []).append(3)
self.assertEqual(d['key'][0], 3)
d.setdefault('key', []).append(4)
@@ -309,9 +319,9 @@ class DictTest(unittest.TestCase):
self.assertEqual(va, int(ka))
kb, vb = tb = b.popitem()
self.assertEqual(vb, int(kb))
- self.assertTrue(not(copymode < 0 and ta != tb))
- self.assertTrue(not a)
- self.assertTrue(not b)
+ self.assertFalse(copymode < 0 and ta != tb)
+ self.assertFalse(a)
+ self.assertFalse(b)
d = {}
self.assertRaises(KeyError, d.popitem)
@@ -328,13 +338,6 @@ class DictTest(unittest.TestCase):
self.assertRaises(KeyError, d.pop, k)
- # verify longs/ints get same value when key > 32 bits (for 64-bit archs)
- # see SF bug #689659
- x = 4503599627370496
- y = 4503599627370496
- h = {x: 'anything', y: 'something else'}
- self.assertEqual(h[x], h[y])
-
self.assertEqual(d.pop(k, v), v)
d[k] = v
self.assertEqual(d.pop(k, 1), v)
@@ -357,15 +360,12 @@ class DictTest(unittest.TestCase):
self.assertRaises(Exc, d.pop, x)
def test_mutatingiteration(self):
+ # changing dict size during iteration
d = {}
d[1] = 1
- try:
+ with self.assertRaises(RuntimeError):
for i in d:
d[i+1] = 1
- except RuntimeError:
- pass
- else:
- self.fail("changing dict size during iteration doesn't raise Error")
def test_repr(self):
d = {}
@@ -399,12 +399,9 @@ class DictTest(unittest.TestCase):
d1 = {BadCmp(): 1}
d2 = {1: 1}
- try:
+
+ with self.assertRaises(Exc):
d1 == d2
- except Exc:
- pass
- else:
- self.fail("< didn't raise Exc")
def test_keys_contained(self):
self.helper_keys_contained(lambda x: x.keys())
@@ -458,15 +455,23 @@ class DictTest(unittest.TestCase):
class C:
def __eq__(self, other):
raise RuntimeError
+
d1 = {1: C()}
d2 = {1: C()}
- self.assertRaises(RuntimeError, lambda: d1.items() == d2.items())
- self.assertRaises(RuntimeError, lambda: d1.items() != d2.items())
- self.assertRaises(RuntimeError, lambda: d1.items() <= d2.items())
- self.assertRaises(RuntimeError, lambda: d1.items() >= d2.items())
+ with self.assertRaises(RuntimeError):
+ d1.items() == d2.items()
+ with self.assertRaises(RuntimeError):
+ d1.items() != d2.items()
+ with self.assertRaises(RuntimeError):
+ d1.items() <= d2.items()
+ with self.assertRaises(RuntimeError):
+ d1.items() >= d2.items()
+
d3 = {1: C(), 2: C()}
- self.assertRaises(RuntimeError, lambda: d2.items() < d3.items())
- self.assertRaises(RuntimeError, lambda: d3.items() > d2.items())
+ with self.assertRaises(RuntimeError):
+ d2.items() < d3.items()
+ with self.assertRaises(RuntimeError):
+ d3.items() > d2.items()
def test_dictview_set_operations_on_keys(self):
k1 = {1:1, 2:2}.keys()
@@ -512,8 +517,8 @@ class DictTest(unittest.TestCase):
def test_missing(self):
# Make sure dict doesn't have a __missing__ method
- self.assertEqual(hasattr(dict, "__missing__"), False)
- self.assertEqual(hasattr({}, "__missing__"), False)
+ self.assertFalse(hasattr(dict, "__missing__"))
+ self.assertFalse(hasattr({}, "__missing__"))
# Test several cases:
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
@@ -525,49 +530,40 @@ class DictTest(unittest.TestCase):
d = D({1: 2, 3: 4})
self.assertEqual(d[1], 2)
self.assertEqual(d[3], 4)
- self.assertTrue(2 not in d)
- self.assertTrue(2 not in d.keys())
+ self.assertNotIn(2, d)
+ self.assertNotIn(2, d.keys())
self.assertEqual(d[2], 42)
+
class E(dict):
def __missing__(self, key):
raise RuntimeError(key)
e = E()
- try:
+ with self.assertRaises(RuntimeError) as c:
e[42]
- except RuntimeError as err:
- self.assertEqual(err.args, (42,))
- else:
- self.fail("e[42] didn't raise RuntimeError")
+ self.assertEqual(c.exception.args, (42,))
+
class F(dict):
def __init__(self):
# An instance variable __missing__ should have no effect
self.__missing__ = lambda key: None
f = F()
- try:
+ with self.assertRaises(KeyError) as c:
f[42]
- except KeyError as err:
- self.assertEqual(err.args, (42,))
- else:
- self.fail("f[42] didn't raise KeyError")
+ self.assertEqual(c.exception.args, (42,))
+
class G(dict):
pass
g = G()
- try:
+ with self.assertRaises(KeyError) as c:
g[42]
- except KeyError as err:
- self.assertEqual(err.args, (42,))
- else:
- self.fail("g[42] didn't raise KeyError")
+ self.assertEqual(c.exception.args, (42,))
def test_tuple_keyerror(self):
# SF #1576657
d = {}
- try:
+ with self.assertRaises(KeyError) as c:
d[(1,)]
- except KeyError as e:
- self.assertEqual(e.args, ((1,),))
- else:
- self.fail("missing KeyError")
+ self.assertEqual(c.exception.args, ((1,),))
def test_bad_key(self):
# Dictionary lookups should fail if __eq__() raises an exception.
@@ -594,12 +590,8 @@ class DictTest(unittest.TestCase):
'd.setdefault(x2, 42)',
'd.pop(x2)',
'd.update({x2: 2})']:
- try:
+ with self.assertRaises(CustomException):
exec(stmt, locals())
- except CustomException:
- pass
- else:
- self.fail("Statement %r didn't raise exception" % stmt)
def test_resize1(self):
# Dict resizing bug, found by Jack Jansen in 2.2 CVS development.
@@ -642,11 +634,9 @@ class DictTest(unittest.TestCase):
def test_empty_presized_dict_in_freelist(self):
# Bug #3537: if an empty but presized dict with a size larger
# than 7 was in the freelist, it triggered an assertion failure
- try:
- d = {'a': 1/0, 'b': None, 'c': None, 'd': None, 'e': None,
+ with self.assertRaises(ZeroDivisionError):
+ d = {'a': 1 // 0, 'b': None, 'c': None, 'd': None, 'e': None,
'f': None, 'g': None, 'h': None}
- except ZeroDivisionError:
- pass
d = {}
def test_container_iterator(self):
@@ -663,7 +653,7 @@ class DictTest(unittest.TestCase):
obj.x = iter(obj.v)
del obj, container
gc.collect()
- self.assertTrue(ref() is None, "Cycle was not collected")
+ self.assertIs(ref(), None, "Cycle was not collected")
def _not_tracked(self, t):
# Nested containers can take several collections to untrack
@@ -677,6 +667,7 @@ class DictTest(unittest.TestCase):
gc.collect()
self.assertTrue(gc.is_tracked(t), t)
+ @support.cpython_only
def test_track_literals(self):
# Test GC-optimization of dict literals
x, y, z, w = 1.5, "a", (1, None), []
@@ -694,6 +685,7 @@ class DictTest(unittest.TestCase):
self._tracked({1: {}})
self._tracked({1: set()})
+ @support.cpython_only
def test_track_dynamic(self):
# Test GC-optimization of dynamically-created dicts
class MyObject(object):
@@ -757,6 +749,7 @@ class DictTest(unittest.TestCase):
d.update([(x, y), (z, w)])
self._tracked(d)
+ @support.cpython_only
def test_track_subtypes(self):
# Dict subtypes are always tracked
class MyDict(dict):
diff --git a/Lib/test/test_dictviews.py b/Lib/test/test_dictviews.py
index 4fee755da4..4c040796f5 100644
--- a/Lib/test/test_dictviews.py
+++ b/Lib/test/test_dictviews.py
@@ -24,10 +24,10 @@ class DictSetTest(unittest.TestCase):
self.assertNotEqual(keys, {1, "b"})
self.assertNotEqual(keys, {1})
self.assertNotEqual(keys, 42)
- self.assertTrue(1 in keys)
- self.assertTrue("a" in keys)
- self.assertTrue(10 not in keys)
- self.assertTrue("Z" not in keys)
+ self.assertIn(1, keys)
+ self.assertIn("a", keys)
+ self.assertNotIn(10, keys)
+ self.assertNotIn("Z", keys)
self.assertEqual(d.keys(), d.keys())
e = {1: 11, "a": "def"}
self.assertEqual(d.keys(), e.keys())
@@ -44,13 +44,13 @@ class DictSetTest(unittest.TestCase):
self.assertNotEqual(items, {(1, 10), ("a", "def")})
self.assertNotEqual(items, {(1, 10)})
self.assertNotEqual(items, 42)
- self.assertTrue((1, 10) in items)
- self.assertTrue(("a", "ABC") in items)
- self.assertTrue((1, 11) not in items)
- self.assertTrue(1 not in items)
- self.assertTrue(() not in items)
- self.assertTrue((1,) not in items)
- self.assertTrue((1, 2, 3) not in items)
+ self.assertIn((1, 10), items)
+ self.assertIn(("a", "ABC"), items)
+ self.assertNotIn((1, 11), items)
+ self.assertNotIn(1, items)
+ self.assertNotIn((), items)
+ self.assertNotIn((1,), items)
+ self.assertNotIn((1, 2, 3), items)
self.assertEqual(d.items(), d.items())
e = d.copy()
self.assertEqual(d.items(), e.items())
@@ -69,6 +69,117 @@ class DictSetTest(unittest.TestCase):
self.assertEqual(set(values), {10, "ABC"})
self.assertEqual(len(values), 2)
+ def test_dict_repr(self):
+ d = {1: 10, "a": "ABC"}
+ self.assertIsInstance(repr(d), str)
+ r = repr(d.items())
+ self.assertIsInstance(r, str)
+ self.assertTrue(r == "dict_items([('a', 'ABC'), (1, 10)])" or
+ r == "dict_items([(1, 10), ('a', 'ABC')])")
+ r = repr(d.keys())
+ self.assertIsInstance(r, str)
+ self.assertTrue(r == "dict_keys(['a', 1])" or
+ r == "dict_keys([1, 'a'])")
+ r = repr(d.values())
+ self.assertIsInstance(r, str)
+ self.assertTrue(r == "dict_values(['ABC', 10])" or
+ r == "dict_values([10, 'ABC'])")
+
+ def test_keys_set_operations(self):
+ d1 = {'a': 1, 'b': 2}
+ d2 = {'b': 3, 'c': 2}
+ d3 = {'d': 4, 'e': 5}
+ self.assertEqual(d1.keys() & d1.keys(), {'a', 'b'})
+ self.assertEqual(d1.keys() & d2.keys(), {'b'})
+ self.assertEqual(d1.keys() & d3.keys(), set())
+ self.assertEqual(d1.keys() & set(d1.keys()), {'a', 'b'})
+ self.assertEqual(d1.keys() & set(d2.keys()), {'b'})
+ self.assertEqual(d1.keys() & set(d3.keys()), set())
+
+ self.assertEqual(d1.keys() | d1.keys(), {'a', 'b'})
+ self.assertEqual(d1.keys() | d2.keys(), {'a', 'b', 'c'})
+ self.assertEqual(d1.keys() | d3.keys(), {'a', 'b', 'd', 'e'})
+ self.assertEqual(d1.keys() | set(d1.keys()), {'a', 'b'})
+ self.assertEqual(d1.keys() | set(d2.keys()), {'a', 'b', 'c'})
+ self.assertEqual(d1.keys() | set(d3.keys()),
+ {'a', 'b', 'd', 'e'})
+
+ self.assertEqual(d1.keys() ^ d1.keys(), set())
+ self.assertEqual(d1.keys() ^ d2.keys(), {'a', 'c'})
+ self.assertEqual(d1.keys() ^ d3.keys(), {'a', 'b', 'd', 'e'})
+ self.assertEqual(d1.keys() ^ set(d1.keys()), set())
+ self.assertEqual(d1.keys() ^ set(d2.keys()), {'a', 'c'})
+ self.assertEqual(d1.keys() ^ set(d3.keys()),
+ {'a', 'b', 'd', 'e'})
+
+ self.assertFalse(d1.keys().isdisjoint(d1.keys()))
+ self.assertFalse(d1.keys().isdisjoint(d2.keys()))
+ self.assertFalse(d1.keys().isdisjoint(list(d2.keys())))
+ self.assertFalse(d1.keys().isdisjoint(set(d2.keys())))
+ self.assertTrue(d1.keys().isdisjoint({'x', 'y', 'z'}))
+ self.assertTrue(d1.keys().isdisjoint(['x', 'y', 'z']))
+ self.assertTrue(d1.keys().isdisjoint(set(['x', 'y', 'z'])))
+ self.assertTrue(d1.keys().isdisjoint(set(['x', 'y'])))
+ self.assertTrue(d1.keys().isdisjoint(['x', 'y']))
+ self.assertTrue(d1.keys().isdisjoint({}))
+ self.assertTrue(d1.keys().isdisjoint(d3.keys()))
+
+ de = {}
+ self.assertTrue(de.keys().isdisjoint(set()))
+ self.assertTrue(de.keys().isdisjoint([]))
+ self.assertTrue(de.keys().isdisjoint(de.keys()))
+ self.assertTrue(de.keys().isdisjoint([1]))
+
+ def test_items_set_operations(self):
+ d1 = {'a': 1, 'b': 2}
+ d2 = {'a': 2, 'b': 2}
+ d3 = {'d': 4, 'e': 5}
+ self.assertEqual(
+ d1.items() & d1.items(), {('a', 1), ('b', 2)})
+ self.assertEqual(d1.items() & d2.items(), {('b', 2)})
+ self.assertEqual(d1.items() & d3.items(), set())
+ self.assertEqual(d1.items() & set(d1.items()),
+ {('a', 1), ('b', 2)})
+ self.assertEqual(d1.items() & set(d2.items()), {('b', 2)})
+ self.assertEqual(d1.items() & set(d3.items()), set())
+
+ self.assertEqual(d1.items() | d1.items(),
+ {('a', 1), ('b', 2)})
+ self.assertEqual(d1.items() | d2.items(),
+ {('a', 1), ('a', 2), ('b', 2)})
+ self.assertEqual(d1.items() | d3.items(),
+ {('a', 1), ('b', 2), ('d', 4), ('e', 5)})
+ self.assertEqual(d1.items() | set(d1.items()),
+ {('a', 1), ('b', 2)})
+ self.assertEqual(d1.items() | set(d2.items()),
+ {('a', 1), ('a', 2), ('b', 2)})
+ self.assertEqual(d1.items() | set(d3.items()),
+ {('a', 1), ('b', 2), ('d', 4), ('e', 5)})
+
+ self.assertEqual(d1.items() ^ d1.items(), set())
+ self.assertEqual(d1.items() ^ d2.items(),
+ {('a', 1), ('a', 2)})
+ self.assertEqual(d1.items() ^ d3.items(),
+ {('a', 1), ('b', 2), ('d', 4), ('e', 5)})
+
+ self.assertFalse(d1.items().isdisjoint(d1.items()))
+ self.assertFalse(d1.items().isdisjoint(d2.items()))
+ self.assertFalse(d1.items().isdisjoint(list(d2.items())))
+ self.assertFalse(d1.items().isdisjoint(set(d2.items())))
+ self.assertTrue(d1.items().isdisjoint({'x', 'y', 'z'}))
+ self.assertTrue(d1.items().isdisjoint(['x', 'y', 'z']))
+ self.assertTrue(d1.items().isdisjoint(set(['x', 'y', 'z'])))
+ self.assertTrue(d1.items().isdisjoint(set(['x', 'y'])))
+ self.assertTrue(d1.items().isdisjoint({}))
+ self.assertTrue(d1.items().isdisjoint(d3.items()))
+
+ de = {}
+ self.assertTrue(de.items().isdisjoint(set()))
+ self.assertTrue(de.items().isdisjoint([]))
+ self.assertTrue(de.items().isdisjoint(de.items()))
+ self.assertTrue(de.items().isdisjoint([1]))
+
+
def test_main():
support.run_unittest(DictSetTest)
diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py
index dc2abe874a..325449aa55 100644
--- a/Lib/test/test_difflib.py
+++ b/Lib/test/test_difflib.py
@@ -4,8 +4,64 @@ import unittest
import doctest
import sys
-class TestSFbugs(unittest.TestCase):
+class TestWithAscii(unittest.TestCase):
+ def test_one_insert(self):
+ sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100)
+ self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
+ self.assertEqual(list(sm.get_opcodes()),
+ [ ('insert', 0, 0, 0, 1),
+ ('equal', 0, 100, 1, 101)])
+ self.assertEqual(sm.bpopular, set())
+ sm = difflib.SequenceMatcher(None, 'b' * 100, 'b' * 50 + 'a' + 'b' * 50)
+ self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
+ self.assertEqual(list(sm.get_opcodes()),
+ [ ('equal', 0, 50, 0, 50),
+ ('insert', 50, 50, 50, 51),
+ ('equal', 50, 100, 51, 101)])
+ self.assertEqual(sm.bpopular, set())
+
+ def test_one_delete(self):
+ sm = difflib.SequenceMatcher(None, 'a' * 40 + 'c' + 'b' * 40, 'a' * 40 + 'b' * 40)
+ self.assertAlmostEqual(sm.ratio(), 0.994, places=3)
+ self.assertEqual(list(sm.get_opcodes()),
+ [ ('equal', 0, 40, 0, 40),
+ ('delete', 40, 41, 40, 40),
+ ('equal', 41, 81, 40, 80)])
+
+ def test_bjunk(self):
+ sm = difflib.SequenceMatcher(isjunk=lambda x: x == ' ',
+ a='a' * 40 + 'b' * 40, b='a' * 44 + 'b' * 40)
+ self.assertEqual(sm.bjunk, set())
+
+ sm = difflib.SequenceMatcher(isjunk=lambda x: x == ' ',
+ a='a' * 40 + 'b' * 40, b='a' * 44 + 'b' * 40 + ' ' * 20)
+ self.assertEqual(sm.bjunk, {' '})
+
+ sm = difflib.SequenceMatcher(isjunk=lambda x: x in [' ', 'b'],
+ a='a' * 40 + 'b' * 40, b='a' * 44 + 'b' * 40 + ' ' * 20)
+ self.assertEqual(sm.bjunk, {' ', 'b'})
+
+
+class TestAutojunk(unittest.TestCase):
+ """Tests for the autojunk parameter added in 2.7"""
+ def test_one_insert_homogenous_sequence(self):
+ # By default autojunk=True and the heuristic kicks in for a sequence
+ # of length 200+
+ seq1 = 'b' * 200
+ seq2 = 'a' + 'b' * 200
+
+ sm = difflib.SequenceMatcher(None, seq1, seq2)
+ self.assertAlmostEqual(sm.ratio(), 0, places=3)
+ self.assertEqual(sm.bpopular, {'b'})
+
+ # Now turn the heuristic off
+ sm = difflib.SequenceMatcher(None, seq1, seq2, autojunk=False)
+ self.assertAlmostEqual(sm.ratio(), 0.9975, places=3)
+ self.assertEqual(sm.bpopular, set())
+
+
+class TestSFbugs(unittest.TestCase):
def test_ratio_for_null_seqn(self):
# Check clearing of SF bug 763023
s = difflib.SequenceMatcher(None, [], [])
@@ -225,7 +281,9 @@ class TestOutputFormat(unittest.TestCase):
def test_main():
difflib.HtmlDiff._default_prefix = 0
Doctests = doctest.DocTestSuite(difflib)
- run_unittest(TestSFpatches, TestSFbugs, Doctests, TestOutputFormat)
+ run_unittest(
+ TestWithAscii, TestAutojunk, TestSFpatches, TestSFbugs,
+ TestOutputFormat, Doctests)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index d82dc5a1e2..7a61493c10 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -1,6 +1,6 @@
# Minimal tests for dis module
-from test.support import run_unittest
+from test.support import run_unittest, captured_stdout
import unittest
import sys
import dis
@@ -19,8 +19,8 @@ dis_f = """\
%-4d 10 LOAD_CONST 1 (1)
13 RETURN_VALUE
-"""%(_f.__code__.co_firstlineno + 1,
- _f.__code__.co_firstlineno + 2)
+""" % (_f.__code__.co_firstlineno + 1,
+ _f.__code__.co_firstlineno + 2)
def bug708901():
@@ -43,9 +43,9 @@ dis_bug708901 = """\
>> 25 POP_BLOCK
>> 26 LOAD_CONST 0 (None)
29 RETURN_VALUE
-"""%(bug708901.__code__.co_firstlineno + 1,
- bug708901.__code__.co_firstlineno + 2,
- bug708901.__code__.co_firstlineno + 3)
+""" % (bug708901.__code__.co_firstlineno + 1,
+ bug708901.__code__.co_firstlineno + 2,
+ bug708901.__code__.co_firstlineno + 3)
def bug1333982(x=[]):
@@ -74,9 +74,9 @@ dis_bug1333982 = """\
%-4d 40 LOAD_CONST 0 (None)
43 RETURN_VALUE
-"""%(bug1333982.__code__.co_firstlineno + 1,
- bug1333982.__code__.co_firstlineno + 2,
- bug1333982.__code__.co_firstlineno + 3)
+""" % (bug1333982.__code__.co_firstlineno + 1,
+ bug1333982.__code__.co_firstlineno + 2,
+ bug1333982.__code__.co_firstlineno + 3)
_BIG_LINENO_FORMAT = """\
%3d 0 LOAD_GLOBAL 0 (spam)
@@ -96,6 +96,46 @@ Disassembly of g:
"""
+expr_str = "x + 1"
+
+dis_expr_str = """\
+ 1 0 LOAD_NAME 0 (x)
+ 3 LOAD_CONST 0 (1)
+ 6 BINARY_ADD
+ 7 RETURN_VALUE
+"""
+
+simple_stmt_str = "x = x + 1"
+
+dis_simple_stmt_str = """\
+ 1 0 LOAD_NAME 0 (x)
+ 3 LOAD_CONST 0 (1)
+ 6 BINARY_ADD
+ 7 STORE_NAME 0 (x)
+ 10 LOAD_CONST 1 (None)
+ 13 RETURN_VALUE
+"""
+
+compound_stmt_str = """\
+x = 0
+while 1:
+ x += 1"""
+# Trailing newline has been deliberately omitted
+
+dis_compound_stmt_str = """\
+ 1 0 LOAD_CONST 0 (0)
+ 3 STORE_NAME 0 (x)
+
+ 2 6 SETUP_LOOP 13 (to 22)
+
+ 3 >> 9 LOAD_NAME 0 (x)
+ 12 LOAD_CONST 1 (1)
+ 15 INPLACE_ADD
+ 16 STORE_NAME 0 (x)
+ 19 JUMP_ABSOLUTE 9
+ >> 22 LOAD_CONST 2 (None)
+ 25 RETURN_VALUE
+"""
class DisTests(unittest.TestCase):
def do_disassembly_test(self, func, expected):
@@ -118,8 +158,8 @@ class DisTests(unittest.TestCase):
def test_opmap(self):
self.assertEqual(dis.opmap["STOP_CODE"], 0)
- self.assertEqual(dis.opmap["LOAD_CONST"] in dis.hasconst, True)
- self.assertEqual(dis.opmap["STORE_NAME"] in dis.hasname, True)
+ self.assertIn(dis.opmap["LOAD_CONST"], dis.hasconst)
+ self.assertIn(dis.opmap["STORE_NAME"], dis.hasname)
def test_opname(self):
self.assertEqual(dis.opname[dis.opmap["LOAD_FAST"]], "LOAD_FAST")
@@ -166,8 +206,165 @@ class DisTests(unittest.TestCase):
from test import dis_module
self.do_disassembly_test(dis_module, dis_module_expected_results)
+ def test_disassemble_str(self):
+ self.do_disassembly_test(expr_str, dis_expr_str)
+ self.do_disassembly_test(simple_stmt_str, dis_simple_stmt_str)
+ self.do_disassembly_test(compound_stmt_str, dis_compound_stmt_str)
+
+code_info_code_info = """\
+Name: code_info
+Filename: (.*)
+Argument count: 1
+Kw-only arguments: 0
+Number of locals: 1
+Stack size: 4
+Flags: OPTIMIZED, NEWLOCALS, NOFREE
+Constants:
+ 0: %r
+ 1: '__func__'
+ 2: '__code__'
+ 3: '<code_info>'
+ 4: 'co_code'
+ 5: "don't know how to disassemble %%s objects"
+%sNames:
+ 0: hasattr
+ 1: __func__
+ 2: __code__
+ 3: isinstance
+ 4: str
+ 5: _try_compile
+ 6: _format_code_info
+ 7: TypeError
+ 8: type
+ 9: __name__
+Variable names:
+ 0: x""" % (('Formatted details of methods, functions, or code.', ' 6: None\n')
+ if sys.flags.optimize < 2 else (None, ''))
+
+@staticmethod
+def tricky(x, y, z=True, *args, c, d, e=[], **kwds):
+ def f(c=c):
+ print(x, y, z, c, d, e, f)
+ yield x, y, z, c, d, e, f
+
+code_info_tricky = """\
+Name: tricky
+Filename: (.*)
+Argument count: 3
+Kw-only arguments: 3
+Number of locals: 8
+Stack size: 7
+Flags: OPTIMIZED, NEWLOCALS, VARARGS, VARKEYWORDS, GENERATOR
+Constants:
+ 0: None
+ 1: <code object f at (.*), file "(.*)", line (.*)>
+Variable names:
+ 0: x
+ 1: y
+ 2: z
+ 3: c
+ 4: d
+ 5: e
+ 6: args
+ 7: kwds
+Cell variables:
+ 0: e
+ 1: d
+ 2: f
+ 3: y
+ 4: x
+ 5: z"""
+
+co_tricky_nested_f = tricky.__func__.__code__.co_consts[1]
+
+code_info_tricky_nested_f = """\
+Name: f
+Filename: (.*)
+Argument count: 1
+Kw-only arguments: 0
+Number of locals: 1
+Stack size: 8
+Flags: OPTIMIZED, NEWLOCALS, NESTED
+Constants:
+ 0: None
+Names:
+ 0: print
+Variable names:
+ 0: c
+Free variables:
+ 0: e
+ 1: d
+ 2: f
+ 3: y
+ 4: x
+ 5: z"""
+
+code_info_expr_str = """\
+Name: <module>
+Filename: <code_info>
+Argument count: 0
+Kw-only arguments: 0
+Number of locals: 0
+Stack size: 2
+Flags: NOFREE
+Constants:
+ 0: 1
+Names:
+ 0: x"""
+
+code_info_simple_stmt_str = """\
+Name: <module>
+Filename: <code_info>
+Argument count: 0
+Kw-only arguments: 0
+Number of locals: 0
+Stack size: 2
+Flags: NOFREE
+Constants:
+ 0: 1
+ 1: None
+Names:
+ 0: x"""
+
+code_info_compound_stmt_str = """\
+Name: <module>
+Filename: <code_info>
+Argument count: 0
+Kw-only arguments: 0
+Number of locals: 0
+Stack size: 2
+Flags: NOFREE
+Constants:
+ 0: 0
+ 1: 1
+ 2: None
+Names:
+ 0: x"""
+
+class CodeInfoTests(unittest.TestCase):
+ test_pairs = [
+ (dis.code_info, code_info_code_info),
+ (tricky, code_info_tricky),
+ (co_tricky_nested_f, code_info_tricky_nested_f),
+ (expr_str, code_info_expr_str),
+ (simple_stmt_str, code_info_simple_stmt_str),
+ (compound_stmt_str, code_info_compound_stmt_str),
+ ]
+
+ def test_code_info(self):
+ self.maxDiff = 1000
+ for x, expected in self.test_pairs:
+ self.assertRegex(dis.code_info(x), expected)
+
+ def test_show_code(self):
+ self.maxDiff = 1000
+ for x, expected in self.test_pairs:
+ with captured_stdout() as output:
+ dis.show_code(x)
+ self.assertRegex(output.getvalue(), expected+"\n")
+
def test_main():
- run_unittest(DisTests)
+ run_unittest(DisTests, CodeInfoTests)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_distutils.py b/Lib/test/test_distutils.py
index 94e59bc58a..d613abe453 100644
--- a/Lib/test/test_distutils.py
+++ b/Lib/test/test_distutils.py
@@ -11,6 +11,7 @@ import test.support
def test_main():
test.support.run_unittest(distutils.tests.test_suite())
+ test.support.reap_children()
if __name__ == "__main__":
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index de85758ac5..13836bafa0 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -4,7 +4,8 @@ Test script for doctest.
from test import support
import doctest
-import warnings
+import os
+
# NOTE: There are some additional tests relating to interaction with
# zipimport in the test_zipimport_support test module.
@@ -372,7 +373,7 @@ We'll simulate a __file__ attr that ends in pyc:
>>> tests = finder.find(sample_func)
>>> print(tests) # doctest: +ELLIPSIS
- [<DocTest sample_func from ...:16 (1 example)>]
+ [<DocTest sample_func from ...:17 (1 example)>]
The exact name depends on how test_doctest was invoked, so allow for
leading path components.
@@ -498,6 +499,8 @@ If a single object is listed twice (under different names), then tests
will only be generated for it once:
>>> from test import doctest_aliases
+ >>> assert doctest_aliases.TwoNames.f
+ >>> assert doctest_aliases.TwoNames.g
>>> tests = excl_empty_finder.find(doctest_aliases)
>>> print(len(tests))
2
@@ -862,6 +865,77 @@ detail:
>>> doctest.DocTestRunner(verbose=False).run(test)
TestResults(failed=0, attempted=1)
+IGNORE_EXCEPTION_DETAIL also ignores difference in exception formatting
+between Python versions. For example, in Python 2.x, the module path of
+the exception is not in the output, but this will fail under Python 3:
+
+ >>> def f(x):
+ ... r'''
+ ... >>> from http.client import HTTPException
+ ... >>> raise HTTPException('message')
+ ... Traceback (most recent call last):
+ ... HTTPException: message
+ ... '''
+ >>> test = doctest.DocTestFinder().find(f)[0]
+ >>> doctest.DocTestRunner(verbose=False).run(test)
+ ... # doctest: +ELLIPSIS
+ **********************************************************************
+ File ..., line 4, in f
+ Failed example:
+ raise HTTPException('message')
+ Expected:
+ Traceback (most recent call last):
+ HTTPException: message
+ Got:
+ Traceback (most recent call last):
+ ...
+ http.client.HTTPException: message
+ TestResults(failed=1, attempted=2)
+
+But in Python 3 the module path is included, and therefore a test must look
+like the following test to succeed in Python 3. But that test will fail under
+Python 2.
+
+ >>> def f(x):
+ ... r'''
+ ... >>> from http.client import HTTPException
+ ... >>> raise HTTPException('message')
+ ... Traceback (most recent call last):
+ ... http.client.HTTPException: message
+ ... '''
+ >>> test = doctest.DocTestFinder().find(f)[0]
+ >>> doctest.DocTestRunner(verbose=False).run(test)
+ TestResults(failed=0, attempted=2)
+
+However, with IGNORE_EXCEPTION_DETAIL, the module name of the exception
+(or its unexpected absence) will be ignored:
+
+ >>> def f(x):
+ ... r'''
+ ... >>> from http.client import HTTPException
+ ... >>> raise HTTPException('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+ ... Traceback (most recent call last):
+ ... HTTPException: message
+ ... '''
+ >>> test = doctest.DocTestFinder().find(f)[0]
+ >>> doctest.DocTestRunner(verbose=False).run(test)
+ TestResults(failed=0, attempted=2)
+
+The module path will be completely ignored, so two different module paths will
+still pass if IGNORE_EXCEPTION_DETAIL is given. This is intentional, so it can
+be used when exceptions have changed module.
+
+ >>> def f(x):
+ ... r'''
+ ... >>> from http.client import HTTPException
+ ... >>> raise HTTPException('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+ ... Traceback (most recent call last):
+ ... foo.bar.HTTPException: message
+ ... '''
+ >>> test = doctest.DocTestFinder().find(f)[0]
+ >>> doctest.DocTestRunner(verbose=False).run(test)
+ TestResults(failed=0, attempted=2)
+
But IGNORE_EXCEPTION_DETAIL does not allow a mismatch in the exception type:
>>> def f(x):
@@ -1624,10 +1698,13 @@ def test_pdb_set_trace():
>>> doc = '''
... >>> x = 42
+ ... >>> raise Exception('clé')
+ ... Traceback (most recent call last):
+ ... Exception: clé
... >>> import pdb; pdb.set_trace()
... '''
>>> parser = doctest.DocTestParser()
- >>> test = parser.get_doctest(doc, {}, "foo", "foo.py", 0)
+ >>> test = parser.get_doctest(doc, {}, "foo-bar@baz", "foo-bar@baz.py", 0)
>>> runner = doctest.DocTestRunner(verbose=False)
To demonstrate this, we'll create a fake standard input that
@@ -1643,12 +1720,12 @@ def test_pdb_set_trace():
>>> try: runner.run(test)
... finally: sys.stdin = real_stdin
--Return--
- > <doctest foo[1]>(1)<module>()->None
+ > <doctest foo-bar@baz[2]>(1)<module>()->None
-> import pdb; pdb.set_trace()
(Pdb) print(x)
42
(Pdb) continue
- TestResults(failed=0, attempted=2)
+ TestResults(failed=0, attempted=3)
You can also put pdb.set_trace in a function called from a test:
@@ -1660,7 +1737,7 @@ def test_pdb_set_trace():
... >>> x=1
... >>> calls_set_trace()
... '''
- >>> test = parser.get_doctest(doc, globals(), "foo", "foo.py", 0)
+ >>> test = parser.get_doctest(doc, globals(), "foo-bar@baz", "foo-bar@baz.py", 0)
>>> real_stdin = sys.stdin
>>> sys.stdin = _FakeInput([
... 'print(y)', # print data defined in the function
@@ -1679,7 +1756,7 @@ def test_pdb_set_trace():
(Pdb) print(y)
2
(Pdb) up
- > <doctest foo[1]>(1)<module>()
+ > <doctest foo-bar@baz[1]>(1)<module>()
-> calls_set_trace()
(Pdb) print(x)
1
@@ -1697,7 +1774,7 @@ def test_pdb_set_trace():
... ... import pdb; pdb.set_trace()
... >>> f(3)
... '''
- >>> test = parser.get_doctest(doc, globals(), "foo", "foo.py", 0)
+ >>> test = parser.get_doctest(doc, globals(), "foo-bar@baz", "foo-bar@baz.py", 0)
>>> real_stdin = sys.stdin
>>> sys.stdin = _FakeInput([
... 'list', # list source from example 2
@@ -1711,7 +1788,7 @@ def test_pdb_set_trace():
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE
--Return--
- > <doctest foo[1]>(3)g()->None
+ > <doctest foo-bar@baz[1]>(3)g()->None
-> import pdb; pdb.set_trace()
(Pdb) list
1 def g(x):
@@ -1720,7 +1797,7 @@ def test_pdb_set_trace():
[EOF]
(Pdb) next
--Return--
- > <doctest foo[0]>(2)f()->None
+ > <doctest foo-bar@baz[0]>(2)f()->None
-> g(x*2)
(Pdb) list
1 def f(x):
@@ -1728,14 +1805,14 @@ def test_pdb_set_trace():
[EOF]
(Pdb) next
--Return--
- > <doctest foo[2]>(1)<module>()->None
+ > <doctest foo-bar@baz[2]>(1)<module>()->None
-> f(3)
(Pdb) list
1 -> f(3)
[EOF]
(Pdb) continue
**********************************************************************
- File "foo.py", line 7, in foo
+ File "foo-bar@baz.py", line 7, in foo-bar@baz
Failed example:
f(3)
Expected nothing
@@ -1769,7 +1846,7 @@ def test_pdb_set_trace_nested():
... '''
>>> parser = doctest.DocTestParser()
>>> runner = doctest.DocTestRunner(verbose=False)
- >>> test = parser.get_doctest(doc, globals(), "foo", "foo.py", 0)
+ >>> test = parser.get_doctest(doc, globals(), "foo-bar@baz", "foo-bar@baz.py", 0)
>>> real_stdin = sys.stdin
>>> sys.stdin = _FakeInput([
... 'print(y)', # print data defined in the function
@@ -1822,10 +1899,10 @@ def test_pdb_set_trace_nested():
(Pdb) print(y)
1
(Pdb) up
- > <doctest foo[1]>(1)<module>()
+ > <doctest foo-bar@baz[1]>(1)<module>()
-> calls_set_trace()
(Pdb) print(foo)
- *** NameError: NameError("name 'foo' is not defined",)
+ *** NameError: name 'foo' is not defined
(Pdb) continue
TestResults(failed=0, attempted=2)
"""
@@ -1840,19 +1917,19 @@ def test_DocTestSuite():
>>> import test.sample_doctest
>>> suite = doctest.DocTestSuite(test.sample_doctest)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=4>
+ <unittest.result.TestResult run=9 errors=0 failures=4>
We can also supply the module by name:
>>> suite = doctest.DocTestSuite('test.sample_doctest')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=4>
+ <unittest.result.TestResult run=9 errors=0 failures=4>
We can use the current module:
>>> suite = test.sample_doctest.test_suite()
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=4>
+ <unittest.result.TestResult run=9 errors=0 failures=4>
We can supply global variables. If we pass globs, they will be
used instead of the module globals. Here we'll pass an empty
@@ -1860,7 +1937,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest', globs={})
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=5>
+ <unittest.result.TestResult run=9 errors=0 failures=5>
Alternatively, we can provide extra globals. Here we'll make an
error go away by providing an extra global variable:
@@ -1868,7 +1945,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest',
... extraglobs={'y': 1})
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=3>
+ <unittest.result.TestResult run=9 errors=0 failures=3>
You can pass option flags. Here we'll cause an extra error
by disabling the blank-line feature:
@@ -1876,7 +1953,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest',
... optionflags=doctest.DONT_ACCEPT_BLANKLINE)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=5>
+ <unittest.result.TestResult run=9 errors=0 failures=5>
You can supply setUp and tearDown functions:
@@ -1893,7 +1970,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest',
... setUp=setUp, tearDown=tearDown)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=3>
+ <unittest.result.TestResult run=9 errors=0 failures=3>
But the tearDown restores sanity:
@@ -1911,7 +1988,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest', setUp=setUp)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=3>
+ <unittest.result.TestResult run=9 errors=0 failures=3>
Here, we didn't need to use a tearDown function because we
modified the test globals, which are a copy of the
@@ -1930,7 +2007,7 @@ def test_DocFileSuite():
... 'test_doctest2.txt',
... 'test_doctest4.txt')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=2>
+ <unittest.result.TestResult run=3 errors=0 failures=2>
The test files are looked for in the directory containing the
calling module. A package keyword argument can be provided to
@@ -1942,7 +2019,7 @@ def test_DocFileSuite():
... 'test_doctest4.txt',
... package='test')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=2>
+ <unittest.result.TestResult run=3 errors=0 failures=2>
Support for using a package's __loader__.get_data() is also
provided.
@@ -1961,14 +2038,14 @@ def test_DocFileSuite():
... finally:
... if added_loader:
... del test.__loader__
- <unittest.TestResult run=3 errors=0 failures=2>
+ <unittest.result.TestResult run=3 errors=0 failures=2>
'/' should be used as a path separator. It will be converted
to a native separator at run time:
>>> suite = doctest.DocFileSuite('../test/test_doctest.txt')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=1 errors=0 failures=1>
+ <unittest.result.TestResult run=1 errors=0 failures=1>
If DocFileSuite is used from an interactive session, then files
are resolved relative to the directory of sys.argv[0]:
@@ -1993,7 +2070,7 @@ def test_DocFileSuite():
>>> suite = doctest.DocFileSuite(test_file, module_relative=False)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=1 errors=0 failures=1>
+ <unittest.result.TestResult run=1 errors=0 failures=1>
It is an error to specify `package` when `module_relative=False`:
@@ -2009,7 +2086,7 @@ def test_DocFileSuite():
... 'test_doctest4.txt',
... globs={'favorite_color': 'blue'})
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=1>
+ <unittest.result.TestResult run=3 errors=0 failures=1>
In this case, we supplied a missing favorite color. You can
provide doctest options:
@@ -2020,7 +2097,7 @@ def test_DocFileSuite():
... optionflags=doctest.DONT_ACCEPT_BLANKLINE,
... globs={'favorite_color': 'blue'})
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=2>
+ <unittest.result.TestResult run=3 errors=0 failures=2>
And, you can provide setUp and tearDown functions:
@@ -2039,7 +2116,7 @@ def test_DocFileSuite():
... 'test_doctest4.txt',
... setUp=setUp, tearDown=tearDown)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=1>
+ <unittest.result.TestResult run=3 errors=0 failures=1>
But the tearDown restores sanity:
@@ -2058,7 +2135,7 @@ def test_DocFileSuite():
>>> suite = doctest.DocFileSuite('test_doctest.txt', setUp=setUp)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=1 errors=0 failures=0>
+ <unittest.result.TestResult run=1 errors=0 failures=0>
Here, we didn't need to use a tearDown function because we
modified the test globals. The test globals are
@@ -2070,7 +2147,7 @@ def test_DocFileSuite():
>>> suite = doctest.DocFileSuite('test_doctest3.txt')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=1 errors=0 failures=0>
+ <unittest.result.TestResult run=1 errors=0 failures=0>
If the tests contain non-ASCII characters, we have to specify which
encoding the file is encoded with. We do so by using the `encoding`
@@ -2081,7 +2158,7 @@ def test_DocFileSuite():
... 'test_doctest4.txt',
... encoding='utf-8')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=2>
+ <unittest.result.TestResult run=3 errors=0 failures=2>
"""
@@ -2357,6 +2434,39 @@ out of the binary module.
TestResults(failed=0, attempted=0)
"""
+try:
+ os.fsencode("foo-bär@baz.py")
+except UnicodeEncodeError:
+ # Skip the test: the filesystem encoding is unable to encode the filename
+ pass
+else:
+ def test_unicode(): """
+Check doctest with a non-ascii filename:
+
+ >>> doc = '''
+ ... >>> raise Exception('clé')
+ ... '''
+ ...
+ >>> parser = doctest.DocTestParser()
+ >>> test = parser.get_doctest(doc, {}, "foo-bär@baz", "foo-bär@baz.py", 0)
+ >>> test
+ <DocTest foo-bär@baz from foo-bär@baz.py:0 (1 example)>
+ >>> runner = doctest.DocTestRunner(verbose=False)
+ >>> runner.run(test) # doctest: +ELLIPSIS
+ **********************************************************************
+ File "foo-bär@baz.py", line 2, in foo-bär@baz
+ Failed example:
+ raise Exception('clé')
+ Exception raised:
+ Traceback (most recent call last):
+ File ...
+ compileflags, 1), test.globs)
+ File "<doctest foo-bär@baz[0]>", line 1, in <module>
+ raise Exception('clé')
+ Exception: clé
+ TestResults(failed=1, attempted=1)
+ """
+
######################################################################
## Main
######################################################################
@@ -2368,8 +2478,10 @@ def test_main():
from test import test_doctest
support.run_doctest(test_doctest, verbosity=True)
-import trace, sys, re, io
+import sys, re, io
+
def test_coverage(coverdir):
+ trace = support.import_module('trace')
tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,],
trace=0, count=1)
tracer.run('test_main()')
diff --git a/Lib/test/test_doctest2.py b/Lib/test/test_doctest2.py
index 86334d70d8..347a143641 100644
--- a/Lib/test/test_doctest2.py
+++ b/Lib/test/test_doctest2.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""A module to test whether doctest recognizes some 2.2 features,
like static and class methods.
@@ -12,7 +11,11 @@ the example. It should be ignored:
"""
+import sys
+import unittest
from test import support
+if sys.flags.optimize >= 2:
+ raise unittest.SkipTest("Cannot test docstrings with -O2")
class C(object):
"""Class C.
diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py
index 7bffa48388..60a69dd91f 100644
--- a/Lib/test/test_docxmlrpc.py
+++ b/Lib/test/test_docxmlrpc.py
@@ -1,12 +1,28 @@
from xmlrpc.server import DocXMLRPCServer
import http.client
+import sys
from test import support
-import threading
+threading = support.import_module('threading')
import time
+import socket
import unittest
PORT = None
+def make_request_and_skipIf(condition, reason):
+ # If we skip the test, we have to make a request because the
+ # the server created in setUp blocks expecting one to come in.
+ if not condition:
+ return lambda func: func
+ def decorator(func):
+ def make_request_and_skip(self):
+ self.client.request("GET", "/")
+ self.client.getresponse()
+ raise unittest.SkipTest(reason)
+ return make_request_and_skip
+ return decorator
+
+
def server(evt, numrequests):
serv = DocXMLRPCServer(("localhost", 0), logRequests=False)
@@ -18,8 +34,8 @@ def server(evt, numrequests):
serv.set_server_title("DocXMLRPCServer Test Documentation")
serv.set_server_name("DocXMLRPCServer Test Docs")
serv.set_server_documentation(
-"""This is an XML-RPC server's documentation, but the server can be used by
-POSTing to /RPC2. Try self.add, too.""")
+ "This is an XML-RPC server's documentation, but the server "
+ "can be used by POSTing to /RPC2. Try self.add, too.")
# Create and register classes and functions
class TestClass(object):
@@ -53,6 +69,7 @@ POSTing to /RPC2. Try self.add, too.""")
class DocXMLRPCHTTPGETServer(unittest.TestCase):
def setUp(self):
+ self._threads = support.threading_setup()
# Enable server feedback
DocXMLRPCServer._send_traceback_header = True
@@ -74,6 +91,7 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
# Disable server feedback
DocXMLRPCServer._send_traceback_header = False
+ support.threading_cleanup(*self._threads)
def test_valid_get_response(self):
self.client.request("GET", "/")
@@ -104,35 +122,65 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
self.client.request("GET", "/")
response = self.client.getresponse()
- self.assertTrue(
-b"""<dl><dt><a name="-&lt;lambda&gt;"><strong>&lt;lambda&gt;</strong></a>(x, y)</dt></dl>"""
- in response.read())
+ self.assertIn((b'<dl><dt><a name="-&lt;lambda&gt;"><strong>'
+ b'&lt;lambda&gt;</strong></a>(x, y)</dt></dl>'),
+ response.read())
+ @make_request_and_skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_autolinking(self):
- """Test that the server correctly automatically wraps references to PEPS
- and RFCs with links, and that it linkifies text starting with http or
- ftp protocol prefixes.
+ """Test that the server correctly automatically wraps references to
+ PEPS and RFCs with links, and that it linkifies text starting with
+ http or ftp protocol prefixes.
The documentation for the "add" method contains the test material.
"""
self.client.request("GET", "/")
response = self.client.getresponse().read()
- self.assertTrue( # This is ugly ... how can it be made better?
-b"""<dl><dt><a name="-add"><strong>add</strong></a>(x, y)</dt><dd><tt>Add&nbsp;two&nbsp;instances&nbsp;together.&nbsp;This&nbsp;follows&nbsp;<a href="http://www.python.org/dev/peps/pep-0008/">PEP008</a>,&nbsp;but&nbsp;has&nbsp;nothing<br>\nto&nbsp;do&nbsp;with&nbsp;<a href="http://www.rfc-editor.org/rfc/rfc1952.txt">RFC1952</a>.&nbsp;Case&nbsp;should&nbsp;matter:&nbsp;pEp008&nbsp;and&nbsp;rFC1952.&nbsp;&nbsp;Things<br>\nthat&nbsp;start&nbsp;with&nbsp;http&nbsp;and&nbsp;ftp&nbsp;should&nbsp;be&nbsp;auto-linked,&nbsp;too:<br>\n<a href="http://google.com">http://google.com</a>.</tt></dd></dl>"""
- in response, response)
-
+ self.assertIn(
+ (b'<dl><dt><a name="-add"><strong>add</strong></a>(x, y)</dt><dd>'
+ b'<tt>Add&nbsp;two&nbsp;instances&nbsp;together.&nbsp;This&nbsp;'
+ b'follows&nbsp;<a href="http://www.python.org/dev/peps/pep-0008/">'
+ b'PEP008</a>,&nbsp;but&nbsp;has&nbsp;nothing<br>\nto&nbsp;do&nbsp;'
+ b'with&nbsp;<a href="http://www.rfc-editor.org/rfc/rfc1952.txt">'
+ b'RFC1952</a>.&nbsp;Case&nbsp;should&nbsp;matter:&nbsp;pEp008&nbsp;'
+ b'and&nbsp;rFC1952.&nbsp;&nbsp;Things<br>\nthat&nbsp;start&nbsp;'
+ b'with&nbsp;http&nbsp;and&nbsp;ftp&nbsp;should&nbsp;be&nbsp;'
+ b'auto-linked,&nbsp;too:<br>\n<a href="http://google.com">'
+ b'http://google.com</a>.</tt></dd></dl>'), response)
+
+ @make_request_and_skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_system_methods(self):
"""Test the precense of three consecutive system.* methods.
- This also tests their use of parameter type recognition and the systems
- related to that process.
+ This also tests their use of parameter type recognition and the
+ systems related to that process.
"""
self.client.request("GET", "/")
response = self.client.getresponse().read()
- self.assertTrue(
-b"""<dl><dt><a name="-system.methodHelp"><strong>system.methodHelp</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodHelp">system.methodHelp</a>(\'add\')&nbsp;=&gt;&nbsp;"Adds&nbsp;two&nbsp;integers&nbsp;together"<br>\n&nbsp;<br>\nReturns&nbsp;a&nbsp;string&nbsp;containing&nbsp;documentation&nbsp;for&nbsp;the&nbsp;specified&nbsp;method.</tt></dd></dl>\n<dl><dt><a name="-system.methodSignature"><strong>system.methodSignature</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodSignature">system.methodSignature</a>(\'add\')&nbsp;=&gt;&nbsp;[double,&nbsp;int,&nbsp;int]<br>\n&nbsp;<br>\nReturns&nbsp;a&nbsp;list&nbsp;describing&nbsp;the&nbsp;signature&nbsp;of&nbsp;the&nbsp;method.&nbsp;In&nbsp;the<br>\nabove&nbsp;example,&nbsp;the&nbsp;add&nbsp;method&nbsp;takes&nbsp;two&nbsp;integers&nbsp;as&nbsp;arguments<br>\nand&nbsp;returns&nbsp;a&nbsp;double&nbsp;result.<br>\n&nbsp;<br>\nThis&nbsp;server&nbsp;does&nbsp;NOT&nbsp;support&nbsp;system.methodSignature.</tt></dd></dl>\n<dl><dt><a name="-test_method"><strong>test_method</strong></a>(arg)</dt><dd><tt>Test&nbsp;method\'s&nbsp;docs.&nbsp;This&nbsp;method&nbsp;truly&nbsp;does&nbsp;very&nbsp;little.</tt></dd></dl>""" in response)
+ self.assertIn(
+ (b'<dl><dt><a name="-system.methodHelp"><strong>system.methodHelp'
+ b'</strong></a>(method_name)</dt><dd><tt><a href="#-system.method'
+ b'Help">system.methodHelp</a>(\'add\')&nbsp;=&gt;&nbsp;"Adds&nbsp;'
+ b'two&nbsp;integers&nbsp;together"<br>\n&nbsp;<br>\nReturns&nbsp;a'
+ b'&nbsp;string&nbsp;containing&nbsp;documentation&nbsp;for&nbsp;'
+ b'the&nbsp;specified&nbsp;method.</tt></dd></dl>\n<dl><dt><a name'
+ b'="-system.methodSignature"><strong>system.methodSignature</strong>'
+ b'</a>(method_name)</dt><dd><tt><a href="#-system.methodSignature">'
+ b'system.methodSignature</a>(\'add\')&nbsp;=&gt;&nbsp;[double,&nbsp;'
+ b'int,&nbsp;int]<br>\n&nbsp;<br>\nReturns&nbsp;a&nbsp;list&nbsp;'
+ b'describing&nbsp;the&nbsp;signature&nbsp;of&nbsp;the&nbsp;method.'
+ b'&nbsp;In&nbsp;the<br>\nabove&nbsp;example,&nbsp;the&nbsp;add&nbsp;'
+ b'method&nbsp;takes&nbsp;two&nbsp;integers&nbsp;as&nbsp;arguments'
+ b'<br>\nand&nbsp;returns&nbsp;a&nbsp;double&nbsp;result.<br>\n&nbsp;'
+ b'<br>\nThis&nbsp;server&nbsp;does&nbsp;NOT&nbsp;support&nbsp;system'
+ b'.methodSignature.</tt></dd></dl>\n<dl><dt><a name="-test_method">'
+ b'<strong>test_method</strong></a>(arg)</dt><dd><tt>Test&nbsp;'
+ b'method\'s&nbsp;docs.&nbsp;This&nbsp;method&nbsp;truly&nbsp;does'
+ b'&nbsp;very&nbsp;little.</tt></dd></dl>'), response)
def test_autolink_dotted_methods(self):
"""Test that selfdot values are made strong automatically in the
@@ -140,8 +188,8 @@ b"""<dl><dt><a name="-system.methodHelp"><strong>system.methodHelp</strong></a>(
self.client.request("GET", "/")
response = self.client.getresponse()
- self.assertTrue(b"""Try&nbsp;self.<strong>add</strong>,&nbsp;too.""" in
- response.read())
+ self.assertIn(b"""Try&nbsp;self.<strong>add</strong>,&nbsp;too.""",
+ response.read())
def test_main():
support.run_unittest(DocXMLRPCHTTPGETServer)
diff --git a/Lib/test/test_dummy_thread.py b/Lib/test/test_dummy_thread.py
index 240b61ad83..c61078d620 100644
--- a/Lib/test/test_dummy_thread.py
+++ b/Lib/test/test_dummy_thread.py
@@ -92,16 +92,16 @@ class MiscTests(unittest.TestCase):
def test_ident(self):
#Test sanity of _thread.get_ident()
- self.assertTrue(isinstance(_thread.get_ident(), int),
- "_thread.get_ident() returned a non-integer")
+ self.assertIsInstance(_thread.get_ident(), int,
+ "_thread.get_ident() returned a non-integer")
self.assertTrue(_thread.get_ident() != 0,
"_thread.get_ident() returned 0")
def test_LockType(self):
#Make sure _thread.LockType is the same type as _thread.allocate_locke()
- self.assertTrue(isinstance(_thread.allocate_lock(), _thread.LockType),
- "_thread.LockType is not an instance of what is "
- "returned by _thread.allocate_lock()")
+ self.assertIsInstance(_thread.allocate_lock(), _thread.LockType,
+ "_thread.LockType is not an instance of what "
+ "is returned by _thread.allocate_lock()")
def test_interrupt_main(self):
#Calling start_new_thread with a function that executes interrupt_main
diff --git a/Lib/test/test_dynamic.py b/Lib/test/test_dynamic.py
new file mode 100644
index 0000000000..beb7b1cdf1
--- /dev/null
+++ b/Lib/test/test_dynamic.py
@@ -0,0 +1,143 @@
+# Test the most dynamic corner cases of Python's runtime semantics.
+
+import builtins
+import contextlib
+import unittest
+
+from test.support import run_unittest, swap_item, swap_attr
+
+
+class RebindBuiltinsTests(unittest.TestCase):
+
+ """Test all the ways that we can change/shadow globals/builtins."""
+
+ def configure_func(self, func, *args):
+ """Perform TestCase-specific configuration on a function before testing.
+
+ By default, this does nothing. Example usage: spinning a function so
+ that a JIT will optimize it. Subclasses should override this as needed.
+
+ Args:
+ func: function to configure.
+ *args: any arguments that should be passed to func, if calling it.
+
+ Returns:
+ Nothing. Work will be performed on func in-place.
+ """
+ pass
+
+ def test_globals_shadow_builtins(self):
+ # Modify globals() to shadow an entry in builtins.
+ def foo():
+ return len([1, 2, 3])
+ self.configure_func(foo)
+
+ self.assertEqual(foo(), 3)
+ with swap_item(globals(), "len", lambda x: 7):
+ self.assertEqual(foo(), 7)
+
+ def test_modify_builtins(self):
+ # Modify the builtins module directly.
+ def foo():
+ return len([1, 2, 3])
+ self.configure_func(foo)
+
+ self.assertEqual(foo(), 3)
+ with swap_attr(builtins, "len", lambda x: 7):
+ self.assertEqual(foo(), 7)
+
+ def test_modify_builtins_while_generator_active(self):
+ # Modify the builtins out from under a live generator.
+ def foo():
+ x = range(3)
+ yield len(x)
+ yield len(x)
+ self.configure_func(foo)
+
+ g = foo()
+ self.assertEqual(next(g), 3)
+ with swap_attr(builtins, "len", lambda x: 7):
+ self.assertEqual(next(g), 7)
+
+ def test_modify_builtins_from_leaf_function(self):
+ # Verify that modifications made by leaf functions percolate up the
+ # callstack.
+ with swap_attr(builtins, "len", len):
+ def bar():
+ builtins.len = lambda x: 4
+
+ def foo(modifier):
+ l = []
+ l.append(len(range(7)))
+ modifier()
+ l.append(len(range(7)))
+ return l
+ self.configure_func(foo, lambda: None)
+
+ self.assertEqual(foo(bar), [7, 4])
+
+ def test_cannot_change_globals_or_builtins_with_eval(self):
+ def foo():
+ return len([1, 2, 3])
+ self.configure_func(foo)
+
+ # Note that this *doesn't* change the definition of len() seen by foo().
+ builtins_dict = {"len": lambda x: 7}
+ globals_dict = {"foo": foo, "__builtins__": builtins_dict,
+ "len": lambda x: 8}
+ self.assertEqual(eval("foo()", globals_dict), 3)
+
+ self.assertEqual(eval("foo()", {"foo": foo}), 3)
+
+ def test_cannot_change_globals_or_builtins_with_exec(self):
+ def foo():
+ return len([1, 2, 3])
+ self.configure_func(foo)
+
+ globals_dict = {"foo": foo}
+ exec("x = foo()", globals_dict)
+ self.assertEqual(globals_dict["x"], 3)
+
+ # Note that this *doesn't* change the definition of len() seen by foo().
+ builtins_dict = {"len": lambda x: 7}
+ globals_dict = {"foo": foo, "__builtins__": builtins_dict,
+ "len": lambda x: 8}
+
+ exec("x = foo()", globals_dict)
+ self.assertEqual(globals_dict["x"], 3)
+
+ def test_cannot_replace_builtins_dict_while_active(self):
+ def foo():
+ x = range(3)
+ yield len(x)
+ yield len(x)
+ self.configure_func(foo)
+
+ g = foo()
+ self.assertEqual(next(g), 3)
+ with swap_item(globals(), "__builtins__", {"len": lambda x: 7}):
+ self.assertEqual(next(g), 3)
+
+ def test_cannot_replace_builtins_dict_between_calls(self):
+ def foo():
+ return len([1, 2, 3])
+ self.configure_func(foo)
+
+ self.assertEqual(foo(), 3)
+ with swap_item(globals(), "__builtins__", {"len": lambda x: 7}):
+ self.assertEqual(foo(), 3)
+
+ def test_eval_gives_lambda_custom_globals(self):
+ globals_dict = {"len": lambda x: 7}
+ foo = eval("lambda: len([])", globals_dict)
+ self.configure_func(foo)
+
+ self.assertEqual(foo(), 7)
+
+
+def test_main():
+ run_unittest(RebindBuiltinsTests)
+
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_email.py b/Lib/test/test_email.py
index f0a18e71d0..5eebba5590 100644
--- a/Lib/test/test_email.py
+++ b/Lib/test/test_email.py
@@ -3,10 +3,12 @@
# The specific tests now live in Lib/email/test
from email.test.test_email import suite
+from email.test.test_email_codecs import suite as codecs_suite
from test import support
def test_main():
support.run_unittest(suite())
+ support.run_unittest(codecs_suite())
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_enumerate.py b/Lib/test/test_enumerate.py
index 4dc9a124cf..095820b45f 100644
--- a/Lib/test/test_enumerate.py
+++ b/Lib/test/test_enumerate.py
@@ -103,6 +103,7 @@ class EnumerateTestCase(unittest.TestCase):
self.assertRaises(TypeError, self.enum, 'abc', 'a') # wrong type
self.assertRaises(TypeError, self.enum, 'abc', 2, 3) # too many arguments
+ @support.cpython_only
def test_tuple_reuse(self):
# Tests an implementation detail where tuple is reused
# whenever nothing else holds a reference to it
@@ -145,6 +146,7 @@ class TestReversed(unittest.TestCase):
x = range(1)
self.assertEqual(type(reversed(x)), type(iter(x)))
+ @support.cpython_only
def test_len(self):
# This is an implementation detail, not an interface requirement
from test.test_iterlen import len
@@ -198,6 +200,18 @@ class TestReversed(unittest.TestCase):
self.fail("non-callable __reversed__ didn't raise!")
self.assertEqual(rc, sys.getrefcount(r))
+ def test_objmethods(self):
+ # Objects must have __len__() and __getitem__() implemented.
+ class NoLen(object):
+ def __getitem__(self): return 1
+ nl = NoLen()
+ self.assertRaises(TypeError, reversed, nl)
+
+ class NoGetItem(object):
+ def __len__(self): return 2
+ ngi = NoGetItem()
+ self.assertRaises(TypeError, reversed, ngi)
+
class EnumerateStartTestCase(EnumerateTestCase):
diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py
index 4e37560a3d..fb4ac9a639 100644
--- a/Lib/test/test_eof.py
+++ b/Lib/test/test_eof.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""test script for a few new invalid token catches"""
import unittest
diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py
index 14ac2d5975..275e59834c 100644
--- a/Lib/test/test_epoll.py
+++ b/Lib/test/test_epoll.py
@@ -21,12 +21,10 @@
"""
Tests for epoll wrapper.
"""
-import os
import socket
import errno
import time
import select
-import tempfile
import unittest
from test import support
diff --git a/Lib/test/test_errno.py b/Lib/test/test_errno.py
index 80edcc680a..f414a87796 100755
--- a/Lib/test/test_errno.py
+++ b/Lib/test/test_errno.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Test the errno module
Roger E. Masse
"""
@@ -20,7 +20,8 @@ class ErrnoAttributeTests(unittest.TestCase):
def test_using_errorcode(self):
# Every key value in errno.errorcode should be on the module.
for value in errno.errorcode.values():
- self.assertTrue(hasattr(errno, value), 'no %s attr in errno' % value)
+ self.assertTrue(hasattr(errno, value),
+ 'no %s attr in errno' % value)
class ErrorcodeTests(unittest.TestCase):
@@ -28,8 +29,8 @@ class ErrorcodeTests(unittest.TestCase):
def test_attributes_in_errorcode(self):
for attribute in errno.__dict__.keys():
if attribute.isupper():
- self.assertTrue(getattr(errno, attribute) in errno.errorcode,
- 'no %s attr in errno.errorcode' % attribute)
+ self.assertIn(getattr(errno, attribute), errno.errorcode,
+ 'no %s attr in errno.errorcode' % attribute)
def test_main():
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 5b36186fa3..76f4249490 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -7,7 +7,7 @@ import pickle
import weakref
from test.support import (TESTFN, unlink, run_unittest, captured_output,
- gc_collect)
+ gc_collect, cpython_only)
# XXX This is not really enough, each *operation* should be tested!
@@ -137,6 +137,7 @@ class ExceptionTests(unittest.TestCase):
ckmsg(s, "'continue' not properly in loop")
ckmsg("continue\n", "'continue' not properly in loop")
+ @cpython_only
def testSettingException(self):
# test that setting an exception at the C level works even if the
# exception object can't be constructed.
@@ -319,25 +320,25 @@ class ExceptionTests(unittest.TestCase):
tb = sys.exc_info()[2]
e = BaseException().with_traceback(tb)
- self.assertTrue(isinstance(e, BaseException))
+ self.assertIsInstance(e, BaseException)
self.assertEqual(e.__traceback__, tb)
e = IndexError(5).with_traceback(tb)
- self.assertTrue(isinstance(e, IndexError))
+ self.assertIsInstance(e, IndexError)
self.assertEqual(e.__traceback__, tb)
class MyException(Exception):
pass
e = MyException().with_traceback(tb)
- self.assertTrue(isinstance(e, MyException))
+ self.assertIsInstance(e, MyException)
self.assertEqual(e.__traceback__, tb)
def testInvalidTraceback(self):
try:
Exception().__traceback__ = 5
except TypeError as e:
- self.assertTrue("__traceback__ must be a traceback" in str(e))
+ self.assertIn("__traceback__ must be a traceback", str(e))
else:
self.fail("No exception raised")
@@ -413,7 +414,7 @@ class ExceptionTests(unittest.TestCase):
except Exception as e:
self.assertTrue(e)
del e
- self.assertFalse('e' in locals())
+ self.assertNotIn('e', locals())
def testExceptionCleanupState(self):
# Make sure exception state is cleaned up as soon as the except
@@ -524,6 +525,17 @@ class ExceptionTests(unittest.TestCase):
obj = wr()
self.assertTrue(obj is None, "%s" % obj)
+ def test_exception_target_in_nested_scope(self):
+ # issue 4617: This used to raise a SyntaxError
+ # "can not delete variable 'e' referenced in nested scope"
+ def print_error():
+ e
+ try:
+ something
+ except Exception as e:
+ print_error()
+ # implicit "del e" here
+
def test_generator_leaking(self):
# Test that generator exception state doesn't leak into the calling
# frame
@@ -647,7 +659,7 @@ class ExceptionTests(unittest.TestCase):
return sys.exc_info()
e, v, tb = g()
self.assertTrue(isinstance(v, RuntimeError), type(v))
- self.assertTrue("maximum recursion depth exceeded" in str(v), str(v))
+ self.assertIn("maximum recursion depth exceeded", str(v))
def test_MemoryError(self):
@@ -668,6 +680,46 @@ class ExceptionTests(unittest.TestCase):
tb2 = raiseMemError()
self.assertEqual(tb1, tb2)
+ @cpython_only
+ def test_exception_with_doc(self):
+ import _testcapi
+ doc2 = "This is a test docstring."
+ doc4 = "This is another test docstring."
+
+ self.assertRaises(SystemError, _testcapi.make_exception_with_doc,
+ "error1")
+
+ # test basic usage of PyErr_NewException
+ error1 = _testcapi.make_exception_with_doc("_testcapi.error1")
+ self.assertIs(type(error1), type)
+ self.assertTrue(issubclass(error1, Exception))
+ self.assertIsNone(error1.__doc__)
+
+ # test with given docstring
+ error2 = _testcapi.make_exception_with_doc("_testcapi.error2", doc2)
+ self.assertEqual(error2.__doc__, doc2)
+
+ # test with explicit base (without docstring)
+ error3 = _testcapi.make_exception_with_doc("_testcapi.error3",
+ base=error2)
+ self.assertTrue(issubclass(error3, error2))
+
+ # test with explicit base tuple
+ class C(object):
+ pass
+ error4 = _testcapi.make_exception_with_doc("_testcapi.error4", doc4,
+ (error3, C))
+ self.assertTrue(issubclass(error4, error3))
+ self.assertTrue(issubclass(error4, C))
+ self.assertEqual(error4.__doc__, doc4)
+
+ # test with explicit dictionary
+ error5 = _testcapi.make_exception_with_doc("_testcapi.error5", "",
+ error4, {'a': 1})
+ self.assertTrue(issubclass(error5, error4))
+ self.assertEqual(error5.a, 1)
+ self.assertEqual(error5.__doc__, "")
+
def test_memory_error_cleanup(self):
# Issue #5437: preallocated MemoryError instances should not keep
# traceback objects alive.
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py
index ce9ac5ea02..1f7f63042e 100644
--- a/Lib/test/test_extcall.py
+++ b/Lib/test/test_extcall.py
@@ -1,3 +1,4 @@
+
"""Doctest for method/function calls.
We're going the use these types for extra testing
@@ -65,17 +66,17 @@ Verify clearing of SF bug #733667
>>> g()
Traceback (most recent call last):
...
- TypeError: g() takes at least 1 positional argument (0 given)
+ TypeError: g() takes at least 1 argument (0 given)
>>> g(*())
Traceback (most recent call last):
...
- TypeError: g() takes at least 1 positional argument (0 given)
+ TypeError: g() takes at least 1 argument (0 given)
>>> g(*(), **{})
Traceback (most recent call last):
...
- TypeError: g() takes at least 1 positional argument (0 given)
+ TypeError: g() takes at least 1 argument (0 given)
>>> g(1)
1 () {}
@@ -261,13 +262,37 @@ the function call setup. See <http://bugs.python.org/issue2016>.
... print(a,b)
>>> f(**x)
1 2
+
+A obscure message:
+
+ >>> def f(a, b):
+ ... pass
+ >>> f(b=1)
+ Traceback (most recent call last):
+ ...
+ TypeError: f() takes exactly 2 arguments (1 given)
+
+The number of arguments passed in includes keywords:
+
+ >>> def f(a):
+ ... pass
+ >>> f(6, a=4, *(1, 2, 3))
+ Traceback (most recent call last):
+ ...
+ TypeError: f() takes exactly 1 positional argument (5 given)
+ >>> def f(a, *, kw):
+ ... pass
+ >>> f(6, 4, kw=4)
+ Traceback (most recent call last):
+ ...
+ TypeError: f() takes exactly 1 positional argument (3 given)
"""
+import sys
from test import support
def test_main():
- from test import test_extcall # self import
- support.run_doctest(test_extcall, True)
+ support.run_doctest(sys.modules[__name__], True)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 3c18f1d66d..e8eeaaa7bf 100755..100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -16,15 +16,12 @@ fcntl = import_module('fcntl')
# TODO - Write tests for flock() and lockf().
def get_lockdata():
- if sys.platform.startswith('atheos'):
- start_len = "qq"
+ try:
+ os.O_LARGEFILE
+ except AttributeError:
+ start_len = "ll"
else:
- try:
- os.O_LARGEFILE
- except AttributeError:
- start_len = "ll"
- else:
- start_len = "qq"
+ start_len = "qq"
if sys.platform in ('netbsd1', 'netbsd2', 'netbsd3',
'Darwin1.2', 'darwin',
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 30c6ed1108..bb0da792f5 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -7,7 +7,7 @@ from weakref import proxy
import io
import _pyio as pyio
-from test.support import TESTFN, findfile, run_unittest
+from test.support import TESTFN, run_unittest
from collections import UserList
class AutoFileTests(unittest.TestCase):
@@ -44,7 +44,7 @@ class AutoFileTests(unittest.TestCase):
a = array('b', b'x'*10)
self.f = self.open(TESTFN, 'rb')
n = self.f.readinto(a)
- self.assertEqual(b'12', a.tostring()[:n])
+ self.assertEqual(b'12', a.tobytes()[:n])
def testReadinto_text(self):
# verify readinto refuses text files
@@ -106,8 +106,7 @@ class AutoFileTests(unittest.TestCase):
('writelines', ([],)),
('__iter__', ()),
]
- if not sys.platform.startswith('atheos'):
- methods.append(('truncate', ()))
+ methods.append(('truncate', ()))
# __exit__ should close the file
self.f.__exit__(None, None, None)
@@ -167,7 +166,7 @@ class OtherFileTests(unittest.TestCase):
except ValueError as msg:
if msg.args[0] != 0:
s = str(msg)
- if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
+ if TESTFN in s or bad_mode not in s:
self.fail("bad error message for invalid mode: %s" % s)
# if msg.args[0] == 0, we're probably on Windows where there may be
# no obvious way to discover why open() failed.
@@ -282,7 +281,7 @@ class OtherFileTests(unittest.TestCase):
except ValueError:
self.fail("readinto() after next() with supposedly empty "
"iteration-buffer failed anyway")
- line = buf.tostring()
+ line = buf.tobytes()
if line != testline:
self.fail("readinto() after next() with empty buffer "
"failed. Got %r, expected %r" % (line, testline))
@@ -304,6 +303,8 @@ class OtherFileTests(unittest.TestCase):
if lines != testlines:
self.fail("readlines() after next() with empty buffer "
"failed. Got %r, expected %r" % (line, testline))
+ f.close()
+
# Reading after iteration hit EOF shouldn't hurt either
f = self.open(TESTFN, 'rb')
try:
diff --git a/Lib/test/test_filecmp.py b/Lib/test/test_filecmp.py
index c71a27a5b9..9b5725d023 100644
--- a/Lib/test/test_filecmp.py
+++ b/Lib/test/test_filecmp.py
@@ -1,5 +1,5 @@
-import os, filecmp, shutil, tempfile, shutil
+import os, filecmp, shutil, tempfile
import unittest
from test import support
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py
index aae16eadfe..f312882b2a 100644
--- a/Lib/test/test_fileinput.py
+++ b/Lib/test/test_fileinput.py
@@ -231,6 +231,30 @@ class FileInputTests(unittest.TestCase):
## finally:
## remove_tempfiles(t1)
+ def test_context_manager(self):
+ try:
+ t1 = writeTmp(1, ["A\nB\nC"])
+ t2 = writeTmp(2, ["D\nE\nF"])
+ with FileInput(files=(t1, t2)) as fi:
+ lines = list(fi)
+ self.assertEqual(lines, ["A\n", "B\n", "C", "D\n", "E\n", "F"])
+ self.assertEqual(fi.filelineno(), 3)
+ self.assertEqual(fi.lineno(), 6)
+ self.assertEqual(fi._files, ())
+ finally:
+ remove_tempfiles(t1, t2)
+
+ def test_close_on_exception(self):
+ try:
+ t1 = writeTmp(1, [""])
+ with FileInput(files=t1) as fi:
+ raise IOError
+ except IOError:
+ self.assertEqual(fi._files, ())
+ finally:
+ remove_tempfiles(t1)
+
+
def test_main():
run_unittest(BufferSizesTests, FileInputTests)
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index 2a8e05de89..103365d8f2 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -8,9 +8,7 @@ from array import array
from weakref import proxy
from functools import wraps
-from test.support import (TESTFN, findfile, check_warnings, run_unittest,
- make_bad_fd)
-from collections import UserList
+from test.support import TESTFN, check_warnings, run_unittest, make_bad_fd
from _io import FileIO as _FileIO
@@ -108,8 +106,6 @@ class AutoFileTests(unittest.TestCase):
methods = ['fileno', 'isatty', 'read', 'readinto',
'seek', 'tell', 'truncate', 'write', 'seekable',
'readable', 'writable']
- if sys.platform.startswith('atheos'):
- methods.remove('truncate')
self.f.close()
self.assertTrue(self.f.closed)
@@ -324,7 +320,7 @@ class OtherFileTests(unittest.TestCase):
except ValueError as msg:
if msg.args[0] != 0:
s = str(msg)
- if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
+ if TESTFN in s or bad_mode not in s:
self.fail("bad error message for invalid mode: %s" % s)
# if msg.args[0] == 0, we're probably on Windows where there may be
# no obvious way to discover why open() failed.
@@ -395,7 +391,7 @@ class OtherFileTests(unittest.TestCase):
self.assertRaises(TypeError, _FileIO, "1", 0, 0)
def testWarnings(self):
- with check_warnings() as w:
+ with check_warnings(quiet=True) as w:
self.assertEqual(w.warnings, [])
self.assertRaises(TypeError, _FileIO, [])
self.assertEqual(w.warnings, [])
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index 2b250df75f..1968b8ae78 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -7,7 +7,6 @@ import math
from math import isinf, isnan, copysign, ldexp
import operator
import random, fractions
-import re
INF = float("inf")
NAN = float("nan")
@@ -17,83 +16,11 @@ requires_getformat = unittest.skipUnless(have_getformat,
"requires __getformat__")
requires_setformat = unittest.skipUnless(hasattr(float, "__setformat__"),
"requires __setformat__")
-# decorator for skipping tests on non-IEEE 754 platforms
-requires_IEEE_754 = unittest.skipUnless(have_getformat and
- float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
#locate file with float format test values
test_dir = os.path.dirname(__file__) or os.curdir
format_testfile = os.path.join(test_dir, 'formatfloat_testcases.txt')
-finite_decimal_parser = re.compile(r""" # A numeric string consists of:
- (?P<sign>[-+])? # an optional sign, followed by
- (?=\d|\.\d) # a number with at least one digit
- (?P<int>\d*) # having a (possibly empty) integer part
- (?:\.(?P<frac>\d*))? # followed by an optional fractional part
- (?:E(?P<exp>[-+]?\d+))? # and an optional exponent
- \Z
-""", re.VERBOSE | re.IGNORECASE | re.UNICODE).match
-
-# Pure Python version of correctly rounded string->float conversion.
-# Avoids any use of floating-point by returning the result as a hex string.
-def strtod(s, mant_dig=53, min_exp = -1021, max_exp = 1024):
- """Convert a finite decimal string to a hex string representing an
- IEEE 754 binary64 float. Return 'inf' or '-inf' on overflow.
- This function makes no use of floating-point arithmetic at any
- stage."""
-
- # parse string into a pair of integers 'a' and 'b' such that
- # abs(decimal value) = a/b, and a boolean 'negative'.
- m = finite_decimal_parser(s)
- if m is None:
- raise ValueError('invalid numeric string')
- fraction = m.group('frac') or ''
- intpart = int(m.group('int') + fraction)
- exp = int(m.group('exp') or '0') - len(fraction)
- negative = m.group('sign') == '-'
- a, b = intpart*10**max(exp, 0), 10**max(0, -exp)
-
- # quick return for zeros
- if not a:
- return '-0x0.0p+0' if negative else '0x0.0p+0'
-
- # compute exponent e for result; may be one too small in the case
- # that the rounded value of a/b lies in a different binade from a/b
- d = a.bit_length() - b.bit_length()
- d += (a >> d if d >= 0 else a << -d) >= b
- e = max(d, min_exp) - mant_dig
-
- # approximate a/b by number of the form q * 2**e; adjust e if necessary
- a, b = a << max(-e, 0), b << max(e, 0)
- q, r = divmod(a, b)
- if 2*r > b or 2*r == b and q & 1:
- q += 1
- if q.bit_length() == mant_dig+1:
- q //= 2
- e += 1
-
- # double check that (q, e) has the right form
- assert q.bit_length() <= mant_dig and e >= min_exp - mant_dig
- assert q.bit_length() == mant_dig or e == min_exp - mant_dig
-
- # check for overflow and underflow
- if e + q.bit_length() > max_exp:
- return '-inf' if negative else 'inf'
- if not q:
- return '-0x0.0p+0' if negative else '0x0.0p+0'
-
- # for hex representation, shift so # bits after point is a multiple of 4
- hexdigs = 1 + (mant_dig-2)//4
- shift = 3 - (mant_dig-2)%4
- q, e = q << shift, e - shift
- return '{}0x{:x}.{:0{}x}p{:+d}'.format(
- '-' if negative else '',
- q // 16**hexdigs,
- q % 16**hexdigs,
- hexdigs,
- e + 4*hexdigs)
-
class GeneralFloatCases(unittest.TestCase):
def test_float(self):
@@ -112,11 +39,30 @@ class GeneralFloatCases(unittest.TestCase):
self.assertRaises(ValueError, float, "+.inf")
self.assertRaises(ValueError, float, ".")
self.assertRaises(ValueError, float, "-.")
- self.assertEqual(float(b" \u0663.\u0661\u0664 ".decode('raw-unicode-escape')), 3.14)
+ self.assertRaises(ValueError, float, b"-")
+ self.assertRaises(TypeError, float, {})
+ # Lone surrogate
+ self.assertRaises(UnicodeEncodeError, float, '\uD8F0')
+ # check that we don't accept alternate exponent markers
+ self.assertRaises(ValueError, float, "-1.7d29")
+ self.assertRaises(ValueError, float, "3D-14")
+ self.assertEqual(float(" \u0663.\u0661\u0664 "), 3.14)
+ self.assertEqual(float("\N{EM SPACE}3.14\N{EN SPACE}"), 3.14)
# extra long strings should not be a problem
float(b'.' + b'1'*1000)
float('.' + '1'*1000)
+ def test_error_message(self):
+ testlist = ('\xbd', '123\xbd', ' 123 456 ')
+ for s in testlist:
+ try:
+ float(s)
+ except ValueError as e:
+ self.assertIn(s.strip(), e.args[0])
+ else:
+ self.fail("Expected int(%r) to raise a ValueError", s)
+
+
@support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
def test_float_with_comma(self):
# set locale to something that doesn't use '.' for the decimal point
@@ -218,12 +164,12 @@ class GeneralFloatCases(unittest.TestCase):
def test_float_containment(self):
floats = (INF, -INF, 0.0, 1.0, NAN)
for f in floats:
- self.assertTrue(f in [f], "'%r' not in []" % f)
- self.assertTrue(f in (f,), "'%r' not in ()" % f)
- self.assertTrue(f in {f}, "'%r' not in set()" % f)
- self.assertTrue(f in {f: None}, "'%r' not in {}" % f)
+ self.assertIn(f, [f])
+ self.assertIn(f, (f,))
+ self.assertIn(f, {f})
+ self.assertIn(f, {f: None})
self.assertEqual([f].count(f), 1, "[].count('%r') != 1" % f)
- self.assertTrue(f in floats, "'%r' not in container" % f)
+ self.assertIn(f, floats)
for f in floats:
# nonidentical containers, same type, same contents
@@ -246,7 +192,7 @@ class GeneralFloatCases(unittest.TestCase):
# distinguishes -0.0 and 0.0.
self.assertEqual((a, copysign(1.0, a)), (b, copysign(1.0, b)))
- @requires_IEEE_754
+ @support.requires_IEEE_754
def test_float_mod(self):
# Check behaviour of % operator for IEEE 754 special cases.
# In particular, check signs of zeros.
@@ -266,7 +212,209 @@ class GeneralFloatCases(unittest.TestCase):
self.assertEqualAndEqualSign(mod(1e-100, -1.0), -1.0)
self.assertEqualAndEqualSign(mod(1.0, -1.0), -0.0)
-
+ @support.requires_IEEE_754
+ def test_float_pow(self):
+ # test builtin pow and ** operator for IEEE 754 special cases.
+ # Special cases taken from section F.9.4.4 of the C99 specification
+
+ for pow_op in pow, operator.pow:
+ # x**NAN is NAN for any x except 1
+ self.assertTrue(isnan(pow_op(-INF, NAN)))
+ self.assertTrue(isnan(pow_op(-2.0, NAN)))
+ self.assertTrue(isnan(pow_op(-1.0, NAN)))
+ self.assertTrue(isnan(pow_op(-0.5, NAN)))
+ self.assertTrue(isnan(pow_op(-0.0, NAN)))
+ self.assertTrue(isnan(pow_op(0.0, NAN)))
+ self.assertTrue(isnan(pow_op(0.5, NAN)))
+ self.assertTrue(isnan(pow_op(2.0, NAN)))
+ self.assertTrue(isnan(pow_op(INF, NAN)))
+ self.assertTrue(isnan(pow_op(NAN, NAN)))
+
+ # NAN**y is NAN for any y except +-0
+ self.assertTrue(isnan(pow_op(NAN, -INF)))
+ self.assertTrue(isnan(pow_op(NAN, -2.0)))
+ self.assertTrue(isnan(pow_op(NAN, -1.0)))
+ self.assertTrue(isnan(pow_op(NAN, -0.5)))
+ self.assertTrue(isnan(pow_op(NAN, 0.5)))
+ self.assertTrue(isnan(pow_op(NAN, 1.0)))
+ self.assertTrue(isnan(pow_op(NAN, 2.0)))
+ self.assertTrue(isnan(pow_op(NAN, INF)))
+
+ # (+-0)**y raises ZeroDivisionError for y a negative odd integer
+ self.assertRaises(ZeroDivisionError, pow_op, -0.0, -1.0)
+ self.assertRaises(ZeroDivisionError, pow_op, 0.0, -1.0)
+
+ # (+-0)**y raises ZeroDivisionError for y finite and negative
+ # but not an odd integer
+ self.assertRaises(ZeroDivisionError, pow_op, -0.0, -2.0)
+ self.assertRaises(ZeroDivisionError, pow_op, -0.0, -0.5)
+ self.assertRaises(ZeroDivisionError, pow_op, 0.0, -2.0)
+ self.assertRaises(ZeroDivisionError, pow_op, 0.0, -0.5)
+
+ # (+-0)**y is +-0 for y a positive odd integer
+ self.assertEqualAndEqualSign(pow_op(-0.0, 1.0), -0.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, 1.0), 0.0)
+
+ # (+-0)**y is 0 for y finite and positive but not an odd integer
+ self.assertEqualAndEqualSign(pow_op(-0.0, 0.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-0.0, 2.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, 0.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, 2.0), 0.0)
+
+ # (-1)**+-inf is 1
+ self.assertEqualAndEqualSign(pow_op(-1.0, -INF), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, INF), 1.0)
+
+ # 1**y is 1 for any y, even if y is an infinity or nan
+ self.assertEqualAndEqualSign(pow_op(1.0, -INF), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -2.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -1.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -0.5), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 0.5), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 1.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 2.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, INF), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, NAN), 1.0)
+
+ # x**+-0 is 1 for any x, even if x is a zero, infinity, or nan
+ self.assertEqualAndEqualSign(pow_op(-INF, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-0.5, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-0.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(INF, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(NAN, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-INF, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-0.5, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-0.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(INF, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(NAN, -0.0), 1.0)
+
+ # x**y defers to complex pow for finite negative x and
+ # non-integral y.
+ self.assertEqual(type(pow_op(-2.0, -0.5)), complex)
+ self.assertEqual(type(pow_op(-2.0, 0.5)), complex)
+ self.assertEqual(type(pow_op(-1.0, -0.5)), complex)
+ self.assertEqual(type(pow_op(-1.0, 0.5)), complex)
+ self.assertEqual(type(pow_op(-0.5, -0.5)), complex)
+ self.assertEqual(type(pow_op(-0.5, 0.5)), complex)
+
+ # x**-INF is INF for abs(x) < 1
+ self.assertEqualAndEqualSign(pow_op(-0.5, -INF), INF)
+ self.assertEqualAndEqualSign(pow_op(-0.0, -INF), INF)
+ self.assertEqualAndEqualSign(pow_op(0.0, -INF), INF)
+ self.assertEqualAndEqualSign(pow_op(0.5, -INF), INF)
+
+ # x**-INF is 0 for abs(x) > 1
+ self.assertEqualAndEqualSign(pow_op(-INF, -INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(INF, -INF), 0.0)
+
+ # x**INF is 0 for abs(x) < 1
+ self.assertEqualAndEqualSign(pow_op(-0.5, INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-0.0, INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, INF), 0.0)
+
+ # x**INF is INF for abs(x) > 1
+ self.assertEqualAndEqualSign(pow_op(-INF, INF), INF)
+ self.assertEqualAndEqualSign(pow_op(-2.0, INF), INF)
+ self.assertEqualAndEqualSign(pow_op(2.0, INF), INF)
+ self.assertEqualAndEqualSign(pow_op(INF, INF), INF)
+
+ # (-INF)**y is -0.0 for y a negative odd integer
+ self.assertEqualAndEqualSign(pow_op(-INF, -1.0), -0.0)
+
+ # (-INF)**y is 0.0 for y negative but not an odd integer
+ self.assertEqualAndEqualSign(pow_op(-INF, -0.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-INF, -2.0), 0.0)
+
+ # (-INF)**y is -INF for y a positive odd integer
+ self.assertEqualAndEqualSign(pow_op(-INF, 1.0), -INF)
+
+ # (-INF)**y is INF for y positive but not an odd integer
+ self.assertEqualAndEqualSign(pow_op(-INF, 0.5), INF)
+ self.assertEqualAndEqualSign(pow_op(-INF, 2.0), INF)
+
+ # INF**y is INF for y positive
+ self.assertEqualAndEqualSign(pow_op(INF, 0.5), INF)
+ self.assertEqualAndEqualSign(pow_op(INF, 1.0), INF)
+ self.assertEqualAndEqualSign(pow_op(INF, 2.0), INF)
+
+ # INF**y is 0.0 for y negative
+ self.assertEqualAndEqualSign(pow_op(INF, -2.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(INF, -1.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(INF, -0.5), 0.0)
+
+ # basic checks not covered by the special cases above
+ self.assertEqualAndEqualSign(pow_op(-2.0, -2.0), 0.25)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -1.0), -0.5)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, 1.0), -2.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, 2.0), 4.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -2.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -1.0), -1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 1.0), -1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 2.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -2.0), 0.25)
+ self.assertEqualAndEqualSign(pow_op(2.0, -1.0), 0.5)
+ self.assertEqualAndEqualSign(pow_op(2.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, 1.0), 2.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, 2.0), 4.0)
+
+ # 1 ** large and -1 ** large; some libms apparently
+ # have problems with these
+ self.assertEqualAndEqualSign(pow_op(1.0, -1e100), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 1e100), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -1e100), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 1e100), 1.0)
+
+ # check sign for results that underflow to 0
+ self.assertEqualAndEqualSign(pow_op(-2.0, -2000.0), 0.0)
+ self.assertEqual(type(pow_op(-2.0, -2000.5)), complex)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -2001.0), -0.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -2000.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -2000.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -2001.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-0.5, 2000.0), 0.0)
+ self.assertEqual(type(pow_op(-0.5, 2000.5)), complex)
+ self.assertEqualAndEqualSign(pow_op(-0.5, 2001.0), -0.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, 2000.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, 2000.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, 2001.0), 0.0)
+
+ # check we don't raise an exception for subnormal results,
+ # and validate signs. Tests currently disabled, since
+ # they fail on systems where a subnormal result from pow
+ # is flushed to zero (e.g. Debian/ia64.)
+ #self.assertTrue(0.0 < pow_op(0.5, 1048) < 1e-315)
+ #self.assertTrue(0.0 < pow_op(-0.5, 1048) < 1e-315)
+ #self.assertTrue(0.0 < pow_op(0.5, 1047) < 1e-315)
+ #self.assertTrue(0.0 > pow_op(-0.5, 1047) > -1e-315)
+ #self.assertTrue(0.0 < pow_op(2.0, -1048) < 1e-315)
+ #self.assertTrue(0.0 < pow_op(-2.0, -1048) < 1e-315)
+ #self.assertTrue(0.0 < pow_op(2.0, -1047) < 1e-315)
+ #self.assertTrue(0.0 > pow_op(-2.0, -1047) > -1e-315)
+
+
+@requires_setformat
class FormatFunctionsTestCase(unittest.TestCase):
def setUp(self):
@@ -278,10 +426,10 @@ class FormatFunctionsTestCase(unittest.TestCase):
float.__setformat__('float', self.save_formats['float'])
def test_getformat(self):
- self.assertTrue(float.__getformat__('double') in
- ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
- self.assertTrue(float.__getformat__('float') in
- ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
+ self.assertIn(float.__getformat__('double'),
+ ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
+ self.assertIn(float.__getformat__('float'),
+ ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
self.assertRaises(ValueError, float.__getformat__, 'chicken')
self.assertRaises(TypeError, float.__getformat__, 1)
@@ -317,6 +465,7 @@ LE_FLOAT_NAN = bytes(reversed(BE_FLOAT_NAN))
# on non-IEEE platforms, attempting to unpack a bit pattern
# representing an infinity or a NaN should raise an exception.
+@requires_setformat
class UnknownFormatTestCase(unittest.TestCase):
def setUp(self):
self.save_formats = {'double':float.__getformat__('double'),
@@ -349,37 +498,25 @@ class UnknownFormatTestCase(unittest.TestCase):
# let's also try to guarantee that -0.0 and 0.0 don't get confused.
class IEEEFormatTestCase(unittest.TestCase):
- if float.__getformat__("double").startswith("IEEE"):
- def test_double_specials_do_unpack(self):
- for fmt, data in [('>d', BE_DOUBLE_INF),
- ('>d', BE_DOUBLE_NAN),
- ('<d', LE_DOUBLE_INF),
- ('<d', LE_DOUBLE_NAN)]:
- struct.unpack(fmt, data)
-
- if float.__getformat__("float").startswith("IEEE"):
- def test_float_specials_do_unpack(self):
- for fmt, data in [('>f', BE_FLOAT_INF),
- ('>f', BE_FLOAT_NAN),
- ('<f', LE_FLOAT_INF),
- ('<f', LE_FLOAT_NAN)]:
- struct.unpack(fmt, data)
-
- if float.__getformat__("double").startswith("IEEE"):
- def test_negative_zero(self):
- import math
- def pos_pos():
- return 0.0, math.atan2(0.0, -1)
- def pos_neg():
- return 0.0, math.atan2(-0.0, -1)
- def neg_pos():
- return -0.0, math.atan2(0.0, -1)
- def neg_neg():
- return -0.0, math.atan2(-0.0, -1)
- self.assertEqual(pos_pos(), neg_pos())
- self.assertEqual(pos_neg(), neg_neg())
+
+ @support.requires_IEEE_754
+ def test_double_specials_do_unpack(self):
+ for fmt, data in [('>d', BE_DOUBLE_INF),
+ ('>d', BE_DOUBLE_NAN),
+ ('<d', LE_DOUBLE_INF),
+ ('<d', LE_DOUBLE_NAN)]:
+ struct.unpack(fmt, data)
+
+ @support.requires_IEEE_754
+ def test_float_specials_do_unpack(self):
+ for fmt, data in [('>f', BE_FLOAT_INF),
+ ('>f', BE_FLOAT_NAN),
+ ('<f', LE_FLOAT_INF),
+ ('<f', LE_FLOAT_NAN)]:
+ struct.unpack(fmt, data)
class FormatTestCase(unittest.TestCase):
+
def test_format(self):
# these should be rewritten to use both format(x, spec) and
# x.__format__(spec)
@@ -433,8 +570,7 @@ class FormatTestCase(unittest.TestCase):
self.assertEqual(format(INF, 'f'), 'inf')
self.assertEqual(format(INF, 'F'), 'INF')
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
+ @support.requires_IEEE_754
def test_format_testfile(self):
with open(format_testfile) as testfile:
for line in testfile:
@@ -514,10 +650,13 @@ class ReprTestCase(unittest.TestCase):
negs = '-'+s
self.assertEqual(s, repr(float(s)))
self.assertEqual(negs, repr(float(negs)))
+ # Since Python 3.2, repr and str are identical
+ self.assertEqual(repr(float(s)), str(float(s)))
+ self.assertEqual(repr(float(negs)), str(float(negs)))
+@support.requires_IEEE_754
class RoundTestCase(unittest.TestCase):
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
+
def test_inf_nan(self):
self.assertRaises(OverflowError, round, INF)
self.assertRaises(OverflowError, round, -INF)
@@ -527,8 +666,6 @@ class RoundTestCase(unittest.TestCase):
self.assertRaises(TypeError, round, NAN, "ceci n'est pas un integer")
self.assertRaises(TypeError, round, -0.0, 1j)
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
def test_large_n(self):
for n in [324, 325, 400, 2**31-1, 2**31, 2**32, 2**100]:
self.assertEqual(round(123.456, n), 123.456)
@@ -541,8 +678,6 @@ class RoundTestCase(unittest.TestCase):
self.assertEqual(round(1e150, 309), 1e150)
self.assertEqual(round(1.4e-315, 315), 1e-315)
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
def test_small_n(self):
for n in [-308, -309, -400, 1-2**31, -2**31, -2**31-1, -2**100]:
self.assertEqual(round(123.456, n), 0.0)
@@ -550,8 +685,6 @@ class RoundTestCase(unittest.TestCase):
self.assertEqual(round(1e300, n), 0.0)
self.assertEqual(round(1e-320, n), 0.0)
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
def test_overflow(self):
self.assertRaises(OverflowError, round, 1.6e308, -308)
self.assertRaises(OverflowError, round, -1.7e308, -308)
@@ -599,6 +732,35 @@ class RoundTestCase(unittest.TestCase):
self.assertEqual(float(format(x, '.2f')), round(x, 2))
self.assertEqual(float(format(x, '.3f')), round(x, 3))
+ def test_format_specials(self):
+ # Test formatting of nans and infs.
+
+ def test(fmt, value, expected):
+ # Test with both % and format().
+ self.assertEqual(fmt % value, expected, fmt)
+ fmt = fmt[1:] # strip off the %
+ self.assertEqual(format(value, fmt), expected, fmt)
+
+ for fmt in ['%e', '%f', '%g', '%.0e', '%.6f', '%.20g',
+ '%#e', '%#f', '%#g', '%#.20e', '%#.15f', '%#.3g']:
+ pfmt = '%+' + fmt[1:]
+ sfmt = '% ' + fmt[1:]
+ test(fmt, INF, 'inf')
+ test(fmt, -INF, '-inf')
+ test(fmt, NAN, 'nan')
+ test(fmt, -NAN, 'nan')
+ # When asking for a sign, it's always provided. nans are
+ # always positive.
+ test(pfmt, INF, '+inf')
+ test(pfmt, -INF, '-inf')
+ test(pfmt, NAN, '+nan')
+ test(pfmt, -NAN, '+nan')
+ # When using ' ' for a sign code, only infs can be negative.
+ # Others have a space.
+ test(sfmt, INF, ' inf')
+ test(sfmt, -INF, '-inf')
+ test(sfmt, NAN, ' nan')
+ test(sfmt, -NAN, ' nan')
# Beginning with Python 2.6 float has cross platform compatible
@@ -1122,38 +1284,6 @@ class HexFloatTestCase(unittest.TestCase):
else:
self.identical(x, fromHex(toHex(x)))
-class StrtodTestCase(unittest.TestCase):
- def check_string(self, s):
- expected = strtod(s)
- try:
- fs = float(s)
- except OverflowError:
- got = '-inf' if s[0] == '-' else 'inf'
- else:
- got = fs.hex()
- self.assertEqual(expected, got,
- "Incorrectly rounded str->float conversion for "
- "{}: expected {}, got {}".format(s, expected, got))
-
- @unittest.skipUnless(getattr(sys, 'float_repr_style', '') == 'short',
- "applies only when using short float repr style")
- def test_bug7632(self):
- # check a few particular values that gave incorrectly rounded
- # results with previous versions of dtoa.c
- test_strings = [
- '94393431193180696942841837085033647913224148539854e-358',
- '12579816049008305546974391768996369464963024663104e-357',
- '17489628565202117263145367596028389348922981857013e-357',
- '18487398785991994634182916638542680759613590482273e-357',
- '32002864200581033134358724675198044527469366773928e-358',
- '73608278998966969345824653500136787876436005957953e-358',
- '64774478836417299491718435234611299336288082136054e-358',
- '13704940134126574534878641876947980878824688451169e-357',
- '46697445774047060960624497964425416610480524760471e-358',
- ]
- for s in test_strings:
- self.check_string(s)
-
def test_main():
support.run_unittest(
@@ -1166,7 +1296,6 @@ def test_main():
RoundTestCase,
InfNanTest,
HexFloatTestCase,
- StrtodTestCase,
)
if __name__ == '__main__':
diff --git a/Lib/test/test_fnmatch.py b/Lib/test/test_fnmatch.py
index bde4ee8097..482835d42e 100644
--- a/Lib/test/test_fnmatch.py
+++ b/Lib/test/test_fnmatch.py
@@ -3,14 +3,10 @@
from test import support
import unittest
-from fnmatch import fnmatch, fnmatchcase, _MAXCACHE, _cache, _cacheb, _purge
-
+from fnmatch import fnmatch, fnmatchcase, translate, filter
class FnmatchTestCase(unittest.TestCase):
- def tearDown(self):
- _purge()
-
def check_match(self, filename, pattern, should_match=1, fn=fnmatch):
if should_match:
self.assertTrue(fn(filename, pattern),
@@ -64,24 +60,29 @@ class FnmatchTestCase(unittest.TestCase):
self.check_match(b'test\xff', b'te*\xff')
self.check_match(b'foo\nbar', b'foo*')
- def test_cache_clearing(self):
- # check that caches do not grow too large
- # http://bugs.python.org/issue7846
+class TranslateTestCase(unittest.TestCase):
+
+ def test_translate(self):
+ self.assertEqual(translate('*'), '.*\Z(?ms)')
+ self.assertEqual(translate('?'), '.\Z(?ms)')
+ self.assertEqual(translate('a?b*'), 'a.b.*\Z(?ms)')
+ self.assertEqual(translate('[abc]'), '[abc]\Z(?ms)')
+ self.assertEqual(translate('[]]'), '[]]\Z(?ms)')
+ self.assertEqual(translate('[!x]'), '[^x]\Z(?ms)')
+ self.assertEqual(translate('[^x]'), '[\\^x]\Z(?ms)')
+ self.assertEqual(translate('[x'), '\\[x\Z(?ms)')
- # string pattern cache
- for i in range(_MAXCACHE + 1):
- fnmatch('foo', '?' * i)
- self.assertLessEqual(len(_cache), _MAXCACHE)
+class FilterTestCase(unittest.TestCase):
- # bytes pattern cache
- for i in range(_MAXCACHE + 1):
- fnmatch(b'foo', b'?' * i)
- self.assertLessEqual(len(_cacheb), _MAXCACHE)
+ def test_filter(self):
+ self.assertEqual(filter(['a', 'b'], 'a'), ['a'])
def test_main():
- support.run_unittest(FnmatchTestCase)
+ support.run_unittest(FnmatchTestCase,
+ TranslateTestCase,
+ FilterTestCase)
if __name__ == "__main__":
diff --git a/Lib/test/test_fork1.py b/Lib/test/test_fork1.py
index 88f9fe9735..8192c38a44 100644
--- a/Lib/test/test_fork1.py
+++ b/Lib/test/test_fork1.py
@@ -1,21 +1,21 @@
"""This test checks for correct fork() behavior.
"""
-import errno
import imp
import os
import signal
import sys
import time
-import threading
from test.fork_wait import ForkWait
-from test.support import run_unittest, reap_children, get_attribute
+from test.support import (run_unittest, reap_children, get_attribute,
+ import_module, verbose)
+
+threading = import_module('threading')
# Skip test if fork does not exist.
get_attribute(os, 'fork')
-
class ForkTest(ForkWait):
def wait_impl(self, cpid):
for i in range(10):
@@ -29,7 +29,8 @@ class ForkTest(ForkWait):
self.assertEqual(spid, cpid)
self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8))
- def test_import_lock_fork(self):
+ def test_threaded_import_lock_fork(self):
+ """Check fork() in main thread works while a subthread is doing an import"""
import_started = threading.Event()
fake_module_name = "fake test module"
partial_module = "partial"
@@ -46,11 +47,16 @@ class ForkTest(ForkWait):
import_started.wait()
pid = os.fork()
try:
+ # PyOS_BeforeFork should have waited for the import to complete
+ # before forking, so the child can recreate the import lock
+ # correctly, but also won't see a partially initialised module
if not pid:
m = __import__(fake_module_name)
if m == complete_module:
os._exit(0)
else:
+ if verbose > 1:
+ print("Child encountered partial module")
os._exit(1)
else:
t.join()
@@ -64,6 +70,39 @@ class ForkTest(ForkWait):
except OSError:
pass
+
+ def test_nested_import_lock_fork(self):
+ """Check fork() in main thread works while the main thread is doing an import"""
+ # Issue 9573: this used to trigger RuntimeError in the child process
+ def fork_with_import_lock(level):
+ release = 0
+ in_child = False
+ try:
+ try:
+ for i in range(level):
+ imp.acquire_lock()
+ release += 1
+ pid = os.fork()
+ in_child = not pid
+ finally:
+ for i in range(release):
+ imp.release_lock()
+ except RuntimeError:
+ if in_child:
+ if verbose > 1:
+ print("RuntimeError in child")
+ os._exit(1)
+ raise
+ if in_child:
+ os._exit(0)
+ self.wait_impl(pid)
+
+ # Check this works with various levels of nested
+ # import in the main thread
+ for level in range(5):
+ fork_with_import_lock(level)
+
+
def test_main():
run_unittest(ForkTest)
reap_children()
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index 054baf612d..7fa950d9ef 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -10,10 +10,7 @@ maxsize = support.MAX_Py_ssize_t
# they crash python)
# test on unicode strings as well
-overflowok = 1
-overflowrequired = 0
-
-def testformat(formatstr, args, output=None, limit=None):
+def testformat(formatstr, args, output=None, limit=None, overflowok=False):
if verbose:
if output:
print("%r %% %r =? %r ..." %\
@@ -28,15 +25,9 @@ def testformat(formatstr, args, output=None, limit=None):
if verbose:
print('overflow (this is fine)')
else:
- if overflowrequired:
- if verbose:
- print('no')
- print("overflow expected on %r %% %r" % (formatstr, args))
- elif output and limit is None and result != output:
+ if output and limit is None and result != output:
if verbose:
print('no')
- #print("%r %% %r == %r != %r" %\
- # (formatstr, args, result, output))
raise AssertionError("%r %% %r == %r != %r" %
(formatstr, args, result, output))
# when 'limit' is specified, it determines how many characters
@@ -58,10 +49,18 @@ def testformat(formatstr, args, output=None, limit=None):
class FormatTest(unittest.TestCase):
def test_format(self):
testformat("%.1d", (1,), "1")
- testformat("%.*d", (sys.maxsize,1)) # expect overflow
- testformat("%.100d", (1,), '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001')
- testformat("%#.117x", (1,), '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001')
- testformat("%#.118x", (1,), '0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001')
+ testformat("%.*d", (sys.maxsize,1), overflowok=True) # expect overflow
+ testformat("%.100d", (1,), '00000000000000000000000000000000000000'
+ '000000000000000000000000000000000000000000000000000000'
+ '00000001', overflowok=True)
+ testformat("%#.117x", (1,), '0x00000000000000000000000000000000000'
+ '000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000000000001',
+ overflowok=True)
+ testformat("%#.118x", (1,), '0x00000000000000000000000000000000000'
+ '000000000000000000000000000000000000000000000000000000'
+ '00000000000000000000000000001',
+ overflowok=True)
testformat("%f", (1.0,), "1.000000")
# these are trying to test the limits of the internal magic-number-length
@@ -72,15 +71,15 @@ class FormatTest(unittest.TestCase):
testformat("%#.*g", (110, -1.e+100/3.))
# test some ridiculously large precision, expect overflow
testformat('%12.*f', (123456, 1.0))
+
# check for internal overflow validation on length of precision
- overflowrequired = 1
+ # these tests should no longer cause overflow in Python
+ # 2.7/3.1 and later.
testformat("%#.*g", (110, -1.e+100/3.))
testformat("%#.*G", (110, -1.e+100/3.))
testformat("%#.*f", (110, -1.e+100/3.))
testformat("%#.*F", (110, -1.e+100/3.))
- overflowrequired = 0
# Formatting of integers. Overflow is not ok
- overflowok = 0
testformat("%x", 10, "a")
testformat("%x", 100000000000, "174876e800")
testformat("%o", 10, "12")
diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py
index 17fdb7f6ea..26e132f4e5 100644
--- a/Lib/test/test_fractions.py
+++ b/Lib/test/test_fractions.py
@@ -1,7 +1,7 @@
"""Tests for Lib/fractions.py."""
from decimal import Decimal
-from test.support import run_unittest
+from test.support import run_unittest, requires_IEEE_754
import math
import numbers
import operator
@@ -130,13 +130,33 @@ class FractionTest(unittest.TestCase):
self.assertRaisesMessage(ZeroDivisionError, "Fraction(12, 0)",
F, 12, 0)
- self.assertRaises(TypeError, F, 1.5)
self.assertRaises(TypeError, F, 1.5 + 3j)
self.assertRaises(TypeError, F, "3/2", 3)
self.assertRaises(TypeError, F, 3, 0j)
self.assertRaises(TypeError, F, 3, 1j)
+ @requires_IEEE_754
+ def testInitFromFloat(self):
+ self.assertEqual((5, 2), _components(F(2.5)))
+ self.assertEqual((0, 1), _components(F(-0.0)))
+ self.assertEqual((3602879701896397, 36028797018963968),
+ _components(F(0.1)))
+ self.assertRaises(TypeError, F, float('nan'))
+ self.assertRaises(TypeError, F, float('inf'))
+ self.assertRaises(TypeError, F, float('-inf'))
+
+ def testInitFromDecimal(self):
+ self.assertEqual((11, 10),
+ _components(F(Decimal('1.1'))))
+ self.assertEqual((7, 200),
+ _components(F(Decimal('3.5e-2'))))
+ self.assertEqual((0, 1),
+ _components(F(Decimal('.000e20'))))
+ self.assertRaises(TypeError, F, Decimal('nan'))
+ self.assertRaises(TypeError, F, Decimal('snan'))
+ self.assertRaises(TypeError, F, Decimal('inf'))
+ self.assertRaises(TypeError, F, Decimal('-inf'))
def testFromString(self):
self.assertEqual((5, 1), _components(F("5")))
@@ -216,10 +236,10 @@ class FractionTest(unittest.TestCase):
self.assertEqual((10, 1), _components(F.from_float(10.0)))
self.assertEqual((-5, 2), _components(F.from_float(-2.5)))
self.assertEqual((99999999999999991611392, 1),
- _components(F.from_float(1e23)))
+ _components(F.from_float(1e23)))
self.assertEqual(float(10**23), float(F.from_float(1e23)))
self.assertEqual((3602879701896397, 1125899906842624),
- _components(F.from_float(3.2)))
+ _components(F.from_float(3.2)))
self.assertEqual(3.2, float(F.from_float(3.2)))
inf = 1e1000
@@ -370,12 +390,11 @@ class FractionTest(unittest.TestCase):
self.assertTypedEquals(1.0 + 0j, (1.0 + 0j) ** F(1, 10))
def testMixingWithDecimal(self):
- # Decimal refuses mixed comparisons.
+ # Decimal refuses mixed arithmetic (but not mixed comparisons)
self.assertRaisesMessage(
TypeError,
"unsupported operand type(s) for +: 'Fraction' and 'Decimal'",
operator.add, F(3,11), Decimal('3.1415926'))
- self.assertNotEqual(F(5, 2), Decimal('2.5'))
def testComparisons(self):
self.assertTrue(F(1, 2) < F(2, 3))
@@ -479,8 +498,21 @@ class FractionTest(unittest.TestCase):
def testBigComplexComparisons(self):
self.assertFalse(F(10**23) == complex(10**23))
- self.assertTrue(F(10**23) > complex(10**23))
- self.assertFalse(F(10**23) <= complex(10**23))
+ self.assertRaises(TypeError, operator.gt, F(10**23), complex(10**23))
+ self.assertRaises(TypeError, operator.le, F(10**23), complex(10**23))
+
+ x = F(3, 8)
+ z = complex(0.375, 0.0)
+ w = complex(0.375, 0.2)
+ self.assertTrue(x == z)
+ self.assertFalse(x != z)
+ self.assertFalse(x == w)
+ self.assertTrue(x != w)
+ for op in operator.lt, operator.le, operator.gt, operator.ge:
+ self.assertRaises(TypeError, op, x, z)
+ self.assertRaises(TypeError, op, z, x)
+ self.assertRaises(TypeError, op, x, w)
+ self.assertRaises(TypeError, op, w, x)
def testMixedEqual(self):
self.assertTrue(0.5 == F(1, 2))
@@ -499,9 +531,9 @@ class FractionTest(unittest.TestCase):
def testStringification(self):
self.assertEqual("Fraction(7, 3)", repr(F(7, 3)))
self.assertEqual("Fraction(6283185307, 2000000000)",
- repr(F('3.1415926535')))
+ repr(F('3.1415926535')))
self.assertEqual("Fraction(-1, 100000000000000000000)",
- repr(F(1, -10**20)))
+ repr(F(1, -10**20)))
self.assertEqual("7/3", str(F(7, 3)))
self.assertEqual("7", str(F(7, 1)))
@@ -509,6 +541,9 @@ class FractionTest(unittest.TestCase):
self.assertEqual(hash(2.5), hash(F(5, 2)))
self.assertEqual(hash(10**50), hash(F(10**50)))
self.assertNotEqual(hash(float(10**23)), hash(F(10**23)))
+ # Check that __hash__ produces the same value as hash(), for
+ # consistency with int and Decimal. (See issue #10356.)
+ self.assertEqual(hash(F(-1)), F(-1).__hash__())
def testApproximatePi(self):
# Algorithm borrowed from
diff --git a/Lib/test/test_frozen.py b/Lib/test/test_frozen.py
index d0721450a1..07131af1cc 100644
--- a/Lib/test/test_frozen.py
+++ b/Lib/test/test_frozen.py
@@ -2,7 +2,7 @@
from test.support import captured_stdout, run_unittest
import unittest
-import sys, os
+import sys
class FrozenTests(unittest.TestCase):
def test_frozen(self):
@@ -11,7 +11,7 @@ class FrozenTests(unittest.TestCase):
except ImportError as x:
self.fail("import __hello__ failed:" + str(x))
self.assertEqual(__hello__.initialized, True)
- self.assertEqual(len(dir(__hello__)), 6, dir(__hello__))
+ self.assertEqual(len(dir(__hello__)), 7, dir(__hello__))
try:
import __phello__
@@ -19,9 +19,9 @@ class FrozenTests(unittest.TestCase):
self.fail("import __phello__ failed:" + str(x))
self.assertEqual(__phello__.initialized, True)
if not "__phello__.spam" in sys.modules:
- self.assertEqual(len(dir(__phello__)), 7, dir(__phello__))
- else:
self.assertEqual(len(dir(__phello__)), 8, dir(__phello__))
+ else:
+ self.assertEqual(len(dir(__phello__)), 9, dir(__phello__))
self.assertEqual(__phello__.__path__, [__phello__.__name__])
try:
@@ -29,8 +29,8 @@ class FrozenTests(unittest.TestCase):
except ImportError as x:
self.fail("import __phello__.spam failed:" + str(x))
self.assertEqual(__phello__.spam.initialized, True)
- self.assertEqual(len(dir(__phello__.spam)), 6)
- self.assertEqual(len(dir(__phello__)), 8)
+ self.assertEqual(len(dir(__phello__.spam)), 7)
+ self.assertEqual(len(dir(__phello__)), 9)
try:
import __phello__.foo
@@ -39,13 +39,12 @@ class FrozenTests(unittest.TestCase):
else:
self.fail("import __phello__.foo should have failed")
- if sys.platform != "mac": # On the Mac this import does succeed.
- try:
- import __phello__.foo
- except ImportError:
- pass
- else:
- self.fail("import __phello__.foo should have failed")
+ try:
+ import __phello__.foo
+ except ImportError:
+ pass
+ else:
+ self.fail("import __phello__.foo should have failed")
del sys.modules['__hello__']
del sys.modules['__phello__']
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index fa1079f788..9d2eab7fa3 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -1,17 +1,25 @@
"""Test script for ftplib module."""
-# Modified by Giampaolo Rodola' to test FTP class and IPv6 environment
+# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
+# environment
import ftplib
-import threading
import asyncore
import asynchat
import socket
import io
+import errno
+import os
+import time
+try:
+ import ssl
+except ImportError:
+ ssl = None
from unittest import TestCase
from test import support
from test.support import HOST
+threading = support.import_module('threading')
# the dummy data returned by server over the data channel when
# RETR, LIST and NLST commands are issued
@@ -21,6 +29,7 @@ NLST_DATA = 'foo\r\nbar\r\n'
class DummyDTPHandler(asynchat.async_chat):
+ dtp_conn_closed = False
def __init__(self, conn, baseclass):
asynchat.async_chat.__init__(self, conn)
@@ -31,15 +40,25 @@ class DummyDTPHandler(asynchat.async_chat):
self.baseclass.last_received_data += self.recv(1024).decode('ascii')
def handle_close(self):
- self.baseclass.push('226 transfer complete')
- self.close()
+ # XXX: this method can be called many times in a row for a single
+ # connection, including in clear-text (non-TLS) mode.
+ # (behaviour witnessed with test_data_connection)
+ if not self.dtp_conn_closed:
+ self.baseclass.push('226 transfer complete')
+ self.close()
+ self.dtp_conn_closed = True
def push(self, what):
super(DummyDTPHandler, self).push(what.encode('ascii'))
+ def handle_error(self):
+ raise
+
class DummyFTPHandler(asynchat.async_chat):
+ dtp_handler = DummyDTPHandler
+
def __init__(self, conn):
asynchat.async_chat.__init__(self, conn)
self.set_terminator(b"\r\n")
@@ -48,6 +67,7 @@ class DummyFTPHandler(asynchat.async_chat):
self.last_received_cmd = None
self.last_received_data = ''
self.next_response = ''
+ self.rest = None
self.push('220 welcome')
def collect_incoming_data(self, data):
@@ -83,41 +103,44 @@ class DummyFTPHandler(asynchat.async_chat):
ip = '%d.%d.%d.%d' %tuple(addr[:4])
port = (addr[4] * 256) + addr[5]
s = socket.create_connection((ip, port), timeout=10)
- self.dtp = DummyDTPHandler(s, baseclass=self)
+ self.dtp = self.dtp_handler(s, baseclass=self)
self.push('200 active data connection established')
def cmd_pasv(self, arg):
- sock = socket.socket()
- sock.bind((self.socket.getsockname()[0], 0))
- sock.listen(5)
- sock.settimeout(10)
- ip, port = sock.getsockname()[:2]
- ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256
- self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2))
- conn, addr = sock.accept()
- self.dtp = DummyDTPHandler(conn, baseclass=self)
+ with socket.socket() as sock:
+ sock.bind((self.socket.getsockname()[0], 0))
+ sock.listen(5)
+ sock.settimeout(10)
+ ip, port = sock.getsockname()[:2]
+ ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256
+ self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2))
+ conn, addr = sock.accept()
+ self.dtp = self.dtp_handler(conn, baseclass=self)
def cmd_eprt(self, arg):
af, ip, port = arg.split(arg[0])[1:-1]
port = int(port)
s = socket.create_connection((ip, port), timeout=10)
- self.dtp = DummyDTPHandler(s, baseclass=self)
+ self.dtp = self.dtp_handler(s, baseclass=self)
self.push('200 active data connection established')
def cmd_epsv(self, arg):
- sock = socket.socket(socket.AF_INET6)
- sock.bind((self.socket.getsockname()[0], 0))
- sock.listen(5)
- sock.settimeout(10)
- port = sock.getsockname()[1]
- self.push('229 entering extended passive mode (|||%d|)' %port)
- conn, addr = sock.accept()
- self.dtp = DummyDTPHandler(conn, baseclass=self)
+ with socket.socket(socket.AF_INET6) as sock:
+ sock.bind((self.socket.getsockname()[0], 0))
+ sock.listen(5)
+ sock.settimeout(10)
+ port = sock.getsockname()[1]
+ self.push('229 entering extended passive mode (|||%d|)' %port)
+ conn, addr = sock.accept()
+ self.dtp = self.dtp_handler(conn, baseclass=self)
def cmd_echo(self, arg):
# sends back the received string (used by the test suite)
self.push(arg)
+ def cmd_noop(self, arg):
+ self.push('200 noop ok')
+
def cmd_user(self, arg):
self.push('331 username ok')
@@ -161,10 +184,19 @@ class DummyFTPHandler(asynchat.async_chat):
def cmd_stor(self, arg):
self.push('125 stor ok')
+ def cmd_rest(self, arg):
+ self.rest = arg
+ self.push('350 rest ok')
+
def cmd_retr(self, arg):
self.push('125 retr ok')
- self.dtp.push(RETR_DATA)
+ if self.rest is not None:
+ offset = int(self.rest)
+ else:
+ offset = 0
+ self.dtp.push(RETR_DATA[offset:])
self.dtp.close_when_done()
+ self.rest = None
def cmd_list(self, arg):
self.push('125 list ok')
@@ -190,6 +222,7 @@ class DummyFTPServer(asyncore.dispatcher, threading.Thread):
self.active = False
self.active_lock = threading.Lock()
self.host, self.port = self.socket.getsockname()[:2]
+ self.handler_instance = None
def start(self):
assert not self.active
@@ -211,10 +244,8 @@ class DummyFTPServer(asyncore.dispatcher, threading.Thread):
self.active = False
self.join()
- def handle_accept(self):
- conn, addr = self.accept()
- self.handler = self.handler(conn)
- self.close()
+ def handle_accepted(self, conn, addr):
+ self.handler_instance = self.handler(conn)
def handle_connect(self):
self.close()
@@ -227,6 +258,154 @@ class DummyFTPServer(asyncore.dispatcher, threading.Thread):
raise
+if ssl is not None:
+
+ CERTFILE = os.path.join(os.path.dirname(__file__), "keycert.pem")
+
+ class SSLConnection(asyncore.dispatcher):
+ """An asyncore.dispatcher subclass supporting TLS/SSL."""
+
+ _ssl_accepting = False
+ _ssl_closing = False
+
+ def secure_connection(self):
+ self.del_channel()
+ socket = ssl.wrap_socket(self.socket, suppress_ragged_eofs=False,
+ certfile=CERTFILE, server_side=True,
+ do_handshake_on_connect=False,
+ ssl_version=ssl.PROTOCOL_SSLv23)
+ self.set_socket(socket)
+ self._ssl_accepting = True
+
+ def _do_ssl_handshake(self):
+ try:
+ self.socket.do_handshake()
+ except ssl.SSLError as err:
+ if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return
+ elif err.args[0] == ssl.SSL_ERROR_EOF:
+ return self.handle_close()
+ raise
+ except socket.error as err:
+ if err.args[0] == errno.ECONNABORTED:
+ return self.handle_close()
+ else:
+ self._ssl_accepting = False
+
+ def _do_ssl_shutdown(self):
+ self._ssl_closing = True
+ try:
+ self.socket = self.socket.unwrap()
+ except ssl.SSLError as err:
+ if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return
+ except socket.error as err:
+ # Any "socket error" corresponds to a SSL_ERROR_SYSCALL return
+ # from OpenSSL's SSL_shutdown(), corresponding to a
+ # closed socket condition. See also:
+ # http://www.mail-archive.com/openssl-users@openssl.org/msg60710.html
+ pass
+ self._ssl_closing = False
+ super(SSLConnection, self).close()
+
+ def handle_read_event(self):
+ if self._ssl_accepting:
+ self._do_ssl_handshake()
+ elif self._ssl_closing:
+ self._do_ssl_shutdown()
+ else:
+ super(SSLConnection, self).handle_read_event()
+
+ def handle_write_event(self):
+ if self._ssl_accepting:
+ self._do_ssl_handshake()
+ elif self._ssl_closing:
+ self._do_ssl_shutdown()
+ else:
+ super(SSLConnection, self).handle_write_event()
+
+ def send(self, data):
+ try:
+ return super(SSLConnection, self).send(data)
+ except ssl.SSLError as err:
+ if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN,
+ ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return 0
+ raise
+
+ def recv(self, buffer_size):
+ try:
+ return super(SSLConnection, self).recv(buffer_size)
+ except ssl.SSLError as err:
+ if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return b''
+ if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN):
+ self.handle_close()
+ return b''
+ raise
+
+ def handle_error(self):
+ raise
+
+ def close(self):
+ if (isinstance(self.socket, ssl.SSLSocket) and
+ self.socket._sslobj is not None):
+ self._do_ssl_shutdown()
+ else:
+ super(SSLConnection, self).close()
+
+
+ class DummyTLS_DTPHandler(SSLConnection, DummyDTPHandler):
+ """A DummyDTPHandler subclass supporting TLS/SSL."""
+
+ def __init__(self, conn, baseclass):
+ DummyDTPHandler.__init__(self, conn, baseclass)
+ if self.baseclass.secure_data_channel:
+ self.secure_connection()
+
+
+ class DummyTLS_FTPHandler(SSLConnection, DummyFTPHandler):
+ """A DummyFTPHandler subclass supporting TLS/SSL."""
+
+ dtp_handler = DummyTLS_DTPHandler
+
+ def __init__(self, conn):
+ DummyFTPHandler.__init__(self, conn)
+ self.secure_data_channel = False
+
+ def cmd_auth(self, line):
+ """Set up secure control channel."""
+ self.push('234 AUTH TLS successful')
+ self.secure_connection()
+
+ def cmd_pbsz(self, line):
+ """Negotiate size of buffer for secure data transfer.
+ For TLS/SSL the only valid value for the parameter is '0'.
+ Any other value is accepted but ignored.
+ """
+ self.push('200 PBSZ=0 successful.')
+
+ def cmd_prot(self, line):
+ """Setup un/secure data channel."""
+ arg = line.upper()
+ if arg == 'C':
+ self.push('200 Protection set to Clear')
+ self.secure_data_channel = False
+ elif arg == 'P':
+ self.push('200 Protection set to Private')
+ self.secure_data_channel = True
+ else:
+ self.push("502 Unrecognized PROT type (use C or P).")
+
+
+ class DummyTLS_FTPServer(DummyFTPServer):
+ handler = DummyTLS_FTPHandler
+
+
class TestFTPClass(TestCase):
def setUp(self):
@@ -285,12 +464,12 @@ class TestFTPClass(TestCase):
def test_rename(self):
self.client.rename('a', 'b')
- self.server.handler.next_response = '200'
+ self.server.handler_instance.next_response = '200'
self.assertRaises(ftplib.error_reply, self.client.rename, 'a', 'b')
def test_delete(self):
self.client.delete('foo')
- self.server.handler.next_response = '199'
+ self.server.handler_instance.next_response = '199'
self.assertRaises(ftplib.error_reply, self.client.delete, 'foo')
def test_size(self):
@@ -319,6 +498,17 @@ class TestFTPClass(TestCase):
self.client.retrbinary('retr', callback)
self.assertEqual(''.join(received), RETR_DATA)
+ def test_retrbinary_rest(self):
+ def callback(data):
+ received.append(data.decode('ascii'))
+ for rest in (0, 10, 20):
+ received = []
+ self.client.retrbinary('retr', callback, rest=rest)
+ self.assertEqual(''.join(received), RETR_DATA[rest:],
+ msg='rest test case %d %d %d' % (rest,
+ len(''.join(received)),
+ len(RETR_DATA[rest:])))
+
def test_retrlines(self):
received = []
self.client.retrlines('retr', received.append)
@@ -327,17 +517,24 @@ class TestFTPClass(TestCase):
def test_storbinary(self):
f = io.BytesIO(RETR_DATA.encode('ascii'))
self.client.storbinary('stor', f)
- self.assertEqual(self.server.handler.last_received_data, RETR_DATA)
+ self.assertEqual(self.server.handler_instance.last_received_data, RETR_DATA)
# test new callback arg
flag = []
f.seek(0)
self.client.storbinary('stor', f, callback=lambda x: flag.append(None))
self.assertTrue(flag)
+ def test_storbinary_rest(self):
+ f = io.BytesIO(RETR_DATA.replace('\r\n', '\n').encode('ascii'))
+ for r in (30, '30'):
+ f.seek(0)
+ self.client.storbinary('stor', f, rest=r)
+ self.assertEqual(self.server.handler_instance.rest, str(r))
+
def test_storlines(self):
f = io.BytesIO(RETR_DATA.replace('\r\n', '\n').encode('ascii'))
self.client.storlines('stor', f)
- self.assertEqual(self.server.handler.last_received_data, RETR_DATA)
+ self.assertEqual(self.server.handler_instance.last_received_data, RETR_DATA)
# test new callback arg
flag = []
f.seek(0)
@@ -354,16 +551,74 @@ class TestFTPClass(TestCase):
self.assertEqual(''.join(l), LIST_DATA.replace('\r\n', ''))
def test_makeport(self):
- self.client.makeport()
- # IPv4 is in use, just make sure send_eprt has not been used
- self.assertEqual(self.server.handler.last_received_cmd, 'port')
+ with self.client.makeport():
+ # IPv4 is in use, just make sure send_eprt has not been used
+ self.assertEqual(self.server.handler_instance.last_received_cmd,
+ 'port')
def test_makepasv(self):
host, port = self.client.makepasv()
conn = socket.create_connection((host, port), 10)
conn.close()
# IPv4 is in use, just make sure send_epsv has not been used
- self.assertEqual(self.server.handler.last_received_cmd, 'pasv')
+ self.assertEqual(self.server.handler_instance.last_received_cmd, 'pasv')
+
+ def test_with_statement(self):
+ self.client.quit()
+
+ def is_client_connected():
+ if self.client.sock is None:
+ return False
+ try:
+ self.client.sendcmd('noop')
+ except (socket.error, EOFError):
+ return False
+ return True
+
+ # base test
+ with ftplib.FTP(timeout=10) as self.client:
+ self.client.connect(self.server.host, self.server.port)
+ self.client.sendcmd('noop')
+ self.assertTrue(is_client_connected())
+ self.assertEqual(self.server.handler_instance.last_received_cmd, 'quit')
+ self.assertFalse(is_client_connected())
+
+ # QUIT sent inside the with block
+ with ftplib.FTP(timeout=10) as self.client:
+ self.client.connect(self.server.host, self.server.port)
+ self.client.sendcmd('noop')
+ self.client.quit()
+ self.assertEqual(self.server.handler_instance.last_received_cmd, 'quit')
+ self.assertFalse(is_client_connected())
+
+ # force a wrong response code to be sent on QUIT: error_perm
+ # is expected and the connection is supposed to be closed
+ try:
+ with ftplib.FTP(timeout=10) as self.client:
+ self.client.connect(self.server.host, self.server.port)
+ self.client.sendcmd('noop')
+ self.server.handler_instance.next_response = '550 error on quit'
+ except ftplib.error_perm as err:
+ self.assertEqual(str(err), '550 error on quit')
+ else:
+ self.fail('Exception not raised')
+ # needed to give the threaded server some time to set the attribute
+ # which otherwise would still be == 'noop'
+ time.sleep(0.1)
+ self.assertEqual(self.server.handler_instance.last_received_cmd, 'quit')
+ self.assertFalse(is_client_connected())
+
+ def test_parse257(self):
+ self.assertEqual(ftplib.parse257('257 "/foo/bar"'), '/foo/bar')
+ self.assertEqual(ftplib.parse257('257 "/foo/bar" created'), '/foo/bar')
+ self.assertEqual(ftplib.parse257('257 ""'), '')
+ self.assertEqual(ftplib.parse257('257 "" created'), '')
+ self.assertRaises(ftplib.error_reply, ftplib.parse257, '250 "/foo/bar"')
+ # The 257 response is supposed to include the directory
+ # name and in case it contains embedded double-quotes
+ # they must be doubled (see RFC-959, chapter 7, appendix 2).
+ self.assertEqual(ftplib.parse257('257 "/foo/b""ar"'), '/foo/b"ar')
+ self.assertEqual(ftplib.parse257('257 "/foo/b""ar" created'), '/foo/b"ar')
class TestIPv6Environment(TestCase):
@@ -382,14 +637,15 @@ class TestIPv6Environment(TestCase):
self.assertEqual(self.client.af, socket.AF_INET6)
def test_makeport(self):
- self.client.makeport()
- self.assertEqual(self.server.handler.last_received_cmd, 'eprt')
+ with self.client.makeport():
+ self.assertEqual(self.server.handler_instance.last_received_cmd,
+ 'eprt')
def test_makepasv(self):
host, port = self.client.makepasv()
conn = socket.create_connection((host, port), 10)
conn.close()
- self.assertEqual(self.server.handler.last_received_cmd, 'epsv')
+ self.assertEqual(self.server.handler_instance.last_received_cmd, 'epsv')
def test_transfer(self):
def retr():
@@ -404,6 +660,100 @@ class TestIPv6Environment(TestCase):
retr()
+class TestTLS_FTPClassMixin(TestFTPClass):
+ """Repeat TestFTPClass tests starting the TLS layer for both control
+ and data connections first.
+ """
+
+ def setUp(self):
+ self.server = DummyTLS_FTPServer((HOST, 0))
+ self.server.start()
+ self.client = ftplib.FTP_TLS(timeout=10)
+ self.client.connect(self.server.host, self.server.port)
+ # enable TLS
+ self.client.auth()
+ self.client.prot_p()
+
+
+class TestTLS_FTPClass(TestCase):
+ """Specific TLS_FTP class tests."""
+
+ def setUp(self):
+ self.server = DummyTLS_FTPServer((HOST, 0))
+ self.server.start()
+ self.client = ftplib.FTP_TLS(timeout=10)
+ self.client.connect(self.server.host, self.server.port)
+
+ def tearDown(self):
+ self.client.close()
+ self.server.stop()
+
+ def test_control_connection(self):
+ self.assertNotIsInstance(self.client.sock, ssl.SSLSocket)
+ self.client.auth()
+ self.assertIsInstance(self.client.sock, ssl.SSLSocket)
+
+ def test_data_connection(self):
+ # clear text
+ with self.client.transfercmd('list') as sock:
+ self.assertNotIsInstance(sock, ssl.SSLSocket)
+ self.assertEqual(self.client.voidresp(), "226 transfer complete")
+
+ # secured, after PROT P
+ self.client.prot_p()
+ with self.client.transfercmd('list') as sock:
+ self.assertIsInstance(sock, ssl.SSLSocket)
+ self.assertEqual(self.client.voidresp(), "226 transfer complete")
+
+ # PROT C is issued, the connection must be in cleartext again
+ self.client.prot_c()
+ with self.client.transfercmd('list') as sock:
+ self.assertNotIsInstance(sock, ssl.SSLSocket)
+ self.assertEqual(self.client.voidresp(), "226 transfer complete")
+
+ def test_login(self):
+ # login() is supposed to implicitly secure the control connection
+ self.assertNotIsInstance(self.client.sock, ssl.SSLSocket)
+ self.client.login()
+ self.assertIsInstance(self.client.sock, ssl.SSLSocket)
+ # make sure that AUTH TLS doesn't get issued again
+ self.client.login()
+
+ def test_auth_issued_twice(self):
+ self.client.auth()
+ self.assertRaises(ValueError, self.client.auth)
+
+ def test_auth_ssl(self):
+ try:
+ self.client.ssl_version = ssl.PROTOCOL_SSLv3
+ self.client.auth()
+ self.assertRaises(ValueError, self.client.auth)
+ finally:
+ self.client.ssl_version = ssl.PROTOCOL_TLSv1
+
+ def test_context(self):
+ self.client.quit()
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ self.assertRaises(ValueError, ftplib.FTP_TLS, keyfile=CERTFILE,
+ context=ctx)
+ self.assertRaises(ValueError, ftplib.FTP_TLS, certfile=CERTFILE,
+ context=ctx)
+ self.assertRaises(ValueError, ftplib.FTP_TLS, certfile=CERTFILE,
+ keyfile=CERTFILE, context=ctx)
+
+ self.client = ftplib.FTP_TLS(context=ctx, timeout=10)
+ self.client.connect(self.server.host, self.server.port)
+ self.assertNotIsInstance(self.client.sock, ssl.SSLSocket)
+ self.client.auth()
+ self.assertIs(self.client.sock.context, ctx)
+ self.assertIsInstance(self.client.sock, ssl.SSLSocket)
+
+ self.client.prot_p()
+ with self.client.transfercmd('list') as sock:
+ self.assertIs(sock.context, ctx)
+ self.assertIsInstance(sock, ssl.SSLSocket)
+
+
class TestTimeouts(TestCase):
def setUp(self):
@@ -419,6 +769,7 @@ class TestTimeouts(TestCase):
def tearDown(self):
self.evt.wait()
+ self.sock.close()
def server(self, evt, serv):
# This method sets the evt 3 times:
@@ -505,6 +856,10 @@ def test_main():
pass
else:
tests.append(TestIPv6Environment)
+
+ if ssl is not None:
+ tests.extend([TestTLS_FTPClassMixin, TestTLS_FTPClass])
+
thread_info = support.threading_setup()
try:
support.run_unittest(*tests)
diff --git a/Lib/test/test_funcattrs.py b/Lib/test/test_funcattrs.py
index d1d03a32cd..4d1936879e 100644
--- a/Lib/test/test_funcattrs.py
+++ b/Lib/test/test_funcattrs.py
@@ -35,11 +35,11 @@ class FunctionPropertiesTest(FuncAttrsTest):
def test_dir_includes_correct_attrs(self):
self.b.known_attr = 7
- self.assertTrue('known_attr' in dir(self.b),
+ self.assertIn('known_attr', dir(self.b),
"set attributes not in dir listing of method")
# Test on underlying function object of method
self.F.a.known_attr = 7
- self.assertTrue('known_attr' in dir(self.fi.a), "set attribute on function "
+ self.assertIn('known_attr', dir(self.fi.a), "set attribute on function "
"implementations, should show up in next dir")
def test_duplicate_function_equality(self):
@@ -64,7 +64,7 @@ class FunctionPropertiesTest(FuncAttrsTest):
a = 12
def f(): print(a)
c = f.__closure__
- self.assertTrue(isinstance(c, tuple))
+ self.assertIsInstance(c, tuple)
self.assertEqual(len(c), 1)
# don't have a type object handy
self.assertEqual(c[0].__class__.__name__, "cell")
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index d20bafe7dc..7d11b53a71 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -1,8 +1,11 @@
import functools
+import collections
+import sys
import unittest
from test import support
from weakref import proxy
import pickle
+from random import choice
@staticmethod
def PythonPartial(func, *args, **keywords):
@@ -44,9 +47,17 @@ class TestPartial(unittest.TestCase):
# attributes should not be writable
if not isinstance(self.thetype, type):
return
- self.assertRaises(TypeError, setattr, p, 'func', map)
- self.assertRaises(TypeError, setattr, p, 'args', (1, 2))
- self.assertRaises(TypeError, setattr, p, 'keywords', dict(a=1, b=2))
+ self.assertRaises(AttributeError, setattr, p, 'func', map)
+ self.assertRaises(AttributeError, setattr, p, 'args', (1, 2))
+ self.assertRaises(AttributeError, setattr, p, 'keywords', dict(a=1, b=2))
+
+ p = self.thetype(hex)
+ try:
+ del p.__dict__
+ except TypeError:
+ pass
+ else:
+ self.fail('partial object allowed __dict__ to be deleted')
def test_argument_checking(self):
self.assertRaises(TypeError, self.thetype) # need at least a func arg
@@ -122,15 +133,6 @@ class TestPartial(unittest.TestCase):
self.assertRaises(ZeroDivisionError, self.thetype(f), 1, 0)
self.assertRaises(ZeroDivisionError, self.thetype(f, y=0), 1)
- def test_attributes(self):
- p = self.thetype(hex)
- try:
- del p.__dict__
- except TypeError:
- pass
- else:
- self.fail('partial object allowed __dict__ to be deleted')
-
def test_weakref(self):
f = self.thetype(int, base=16)
p = proxy(f)
@@ -145,6 +147,32 @@ class TestPartial(unittest.TestCase):
join = self.thetype(''.join)
self.assertEqual(join(data), '0123456789')
+ def test_repr(self):
+ args = (object(), object())
+ args_repr = ', '.join(repr(a) for a in args)
+ kwargs = {'a': object(), 'b': object()}
+ kwargs_repr = ', '.join("%s=%r" % (k, v) for k, v in kwargs.items())
+ if self.thetype is functools.partial:
+ name = 'functools.partial'
+ else:
+ name = self.thetype.__name__
+
+ f = self.thetype(capture)
+ self.assertEqual('{}({!r})'.format(name, capture),
+ repr(f))
+
+ f = self.thetype(capture, *args)
+ self.assertEqual('{}({!r}, {})'.format(name, capture, args_repr),
+ repr(f))
+
+ f = self.thetype(capture, **kwargs)
+ self.assertEqual('{}({!r}, {})'.format(name, capture, kwargs_repr),
+ repr(f))
+
+ f = self.thetype(capture, *args, **kwargs)
+ self.assertEqual('{}({!r}, {}, {})'.format(name, capture, args_repr, kwargs_repr),
+ repr(f))
+
def test_pickle(self):
f = self.thetype(signature, 'asdf', bar=True)
f.add_something_to__dict__ = True
@@ -162,6 +190,9 @@ class TestPythonPartial(TestPartial):
thetype = PythonPartial
+ # the python version hasn't a nice repr
+ def test_repr(self): pass
+
# the python version isn't picklable
def test_pickle(self): pass
@@ -180,7 +211,7 @@ class TestUpdateWrapper(unittest.TestCase):
for key in wrapped_attr:
self.assertTrue(wrapped_attr[key] is wrapper_attr[key])
- def test_default_update(self):
+ def _default_update(self):
def f(a:'This is a new annotation'):
"""This is a test"""
pass
@@ -188,13 +219,23 @@ class TestUpdateWrapper(unittest.TestCase):
def wrapper(b:'This is the prior annotation'):
pass
functools.update_wrapper(wrapper, f)
+ return wrapper, f
+
+ def test_default_update(self):
+ wrapper, f = self._default_update()
self.check_wrapper(wrapper, f)
+ self.assertIs(wrapper.__wrapped__, f)
self.assertEqual(wrapper.__name__, 'f')
- self.assertEqual(wrapper.__doc__, 'This is a test')
self.assertEqual(wrapper.attr, 'This is also a test')
self.assertEqual(wrapper.__annotations__['a'], 'This is a new annotation')
self.assertNotIn('b', wrapper.__annotations__)
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_default_update_doc(self):
+ wrapper, f = self._default_update()
+ self.assertEqual(wrapper.__doc__, 'This is a test')
+
def test_no_update(self):
def f():
"""This is a test"""
@@ -226,6 +267,28 @@ class TestUpdateWrapper(unittest.TestCase):
self.assertEqual(wrapper.attr, 'This is a different test')
self.assertEqual(wrapper.dict_attr, f.dict_attr)
+ def test_missing_attributes(self):
+ def f():
+ pass
+ def wrapper():
+ pass
+ wrapper.dict_attr = {}
+ assign = ('attr',)
+ update = ('dict_attr',)
+ # Missing attributes on wrapped object are ignored
+ functools.update_wrapper(wrapper, f, assign, update)
+ self.assertNotIn('attr', wrapper.__dict__)
+ self.assertEqual(wrapper.dict_attr, {})
+ # Wrapper must have expected attributes for updating
+ del wrapper.dict_attr
+ with self.assertRaises(AttributeError):
+ functools.update_wrapper(wrapper, f, assign, update)
+ wrapper.dict_attr = 1
+ with self.assertRaises(AttributeError):
+ functools.update_wrapper(wrapper, f, assign, update)
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_builtin_update(self):
# Test for bug #1576241
def wrapper():
@@ -237,7 +300,7 @@ class TestUpdateWrapper(unittest.TestCase):
class TestWraps(TestUpdateWrapper):
- def test_default_update(self):
+ def _default_update(self):
def f():
"""This is a test"""
pass
@@ -246,10 +309,19 @@ class TestWraps(TestUpdateWrapper):
def wrapper():
pass
self.check_wrapper(wrapper, f)
+ return wrapper
+
+ def test_default_update(self):
+ wrapper = self._default_update()
self.assertEqual(wrapper.__name__, 'f')
- self.assertEqual(wrapper.__doc__, 'This is a test')
self.assertEqual(wrapper.attr, 'This is also a test')
+ @unittest.skipIf(not sys.flags.optimize <= 1,
+ "Docstrings are omitted with -O2 and above")
+ def test_default_update_doc(self):
+ wrapper = self._default_update()
+ self.assertEqual(wrapper.__doc__, 'This is a test')
+
def test_no_update(self):
def f():
"""This is a test"""
@@ -363,18 +435,237 @@ class TestReduce(unittest.TestCase):
d = {"one": 1, "two": 2, "three": 3}
self.assertEqual(self.func(add, d), "".join(d.keys()))
-
-
+class TestCmpToKey(unittest.TestCase):
+ def test_cmp_to_key(self):
+ def mycmp(x, y):
+ return y - x
+ self.assertEqual(sorted(range(5), key=functools.cmp_to_key(mycmp)),
+ [4, 3, 2, 1, 0])
+
+ def test_hash(self):
+ def mycmp(x, y):
+ return y - x
+ key = functools.cmp_to_key(mycmp)
+ k = key(10)
+ self.assertRaises(TypeError, hash, k)
+ self.assertFalse(isinstance(k, collections.Hashable))
+
+class TestTotalOrdering(unittest.TestCase):
+
+ def test_total_ordering_lt(self):
+ @functools.total_ordering
+ class A:
+ def __init__(self, value):
+ self.value = value
+ def __lt__(self, other):
+ return self.value < other.value
+ def __eq__(self, other):
+ return self.value == other.value
+ self.assertTrue(A(1) < A(2))
+ self.assertTrue(A(2) > A(1))
+ self.assertTrue(A(1) <= A(2))
+ self.assertTrue(A(2) >= A(1))
+ self.assertTrue(A(2) <= A(2))
+ self.assertTrue(A(2) >= A(2))
+
+ def test_total_ordering_le(self):
+ @functools.total_ordering
+ class A:
+ def __init__(self, value):
+ self.value = value
+ def __le__(self, other):
+ return self.value <= other.value
+ def __eq__(self, other):
+ return self.value == other.value
+ self.assertTrue(A(1) < A(2))
+ self.assertTrue(A(2) > A(1))
+ self.assertTrue(A(1) <= A(2))
+ self.assertTrue(A(2) >= A(1))
+ self.assertTrue(A(2) <= A(2))
+ self.assertTrue(A(2) >= A(2))
+
+ def test_total_ordering_gt(self):
+ @functools.total_ordering
+ class A:
+ def __init__(self, value):
+ self.value = value
+ def __gt__(self, other):
+ return self.value > other.value
+ def __eq__(self, other):
+ return self.value == other.value
+ self.assertTrue(A(1) < A(2))
+ self.assertTrue(A(2) > A(1))
+ self.assertTrue(A(1) <= A(2))
+ self.assertTrue(A(2) >= A(1))
+ self.assertTrue(A(2) <= A(2))
+ self.assertTrue(A(2) >= A(2))
+
+ def test_total_ordering_ge(self):
+ @functools.total_ordering
+ class A:
+ def __init__(self, value):
+ self.value = value
+ def __ge__(self, other):
+ return self.value >= other.value
+ def __eq__(self, other):
+ return self.value == other.value
+ self.assertTrue(A(1) < A(2))
+ self.assertTrue(A(2) > A(1))
+ self.assertTrue(A(1) <= A(2))
+ self.assertTrue(A(2) >= A(1))
+ self.assertTrue(A(2) <= A(2))
+ self.assertTrue(A(2) >= A(2))
+
+ def test_total_ordering_no_overwrite(self):
+ # new methods should not overwrite existing
+ @functools.total_ordering
+ class A(int):
+ pass
+ self.assertTrue(A(1) < A(2))
+ self.assertTrue(A(2) > A(1))
+ self.assertTrue(A(1) <= A(2))
+ self.assertTrue(A(2) >= A(1))
+ self.assertTrue(A(2) <= A(2))
+ self.assertTrue(A(2) >= A(2))
+
+ def test_no_operations_defined(self):
+ with self.assertRaises(ValueError):
+ @functools.total_ordering
+ class A:
+ pass
+
+ def test_bug_10042(self):
+ @functools.total_ordering
+ class TestTO:
+ def __init__(self, value):
+ self.value = value
+ def __eq__(self, other):
+ if isinstance(other, TestTO):
+ return self.value == other.value
+ return False
+ def __lt__(self, other):
+ if isinstance(other, TestTO):
+ return self.value < other.value
+ raise TypeError
+ with self.assertRaises(TypeError):
+ TestTO(8) <= ()
+
+class TestLRU(unittest.TestCase):
+
+ def test_lru(self):
+ def orig(x, y):
+ return 3*x+y
+ f = functools.lru_cache(maxsize=20)(orig)
+ hits, misses, maxsize, currsize = f.cache_info()
+ self.assertEqual(maxsize, 20)
+ self.assertEqual(currsize, 0)
+ self.assertEqual(hits, 0)
+ self.assertEqual(misses, 0)
+
+ domain = range(5)
+ for i in range(1000):
+ x, y = choice(domain), choice(domain)
+ actual = f(x, y)
+ expected = orig(x, y)
+ self.assertEqual(actual, expected)
+ hits, misses, maxsize, currsize = f.cache_info()
+ self.assertTrue(hits > misses)
+ self.assertEqual(hits + misses, 1000)
+ self.assertEqual(currsize, 20)
+
+ f.cache_clear() # test clearing
+ hits, misses, maxsize, currsize = f.cache_info()
+ self.assertEqual(hits, 0)
+ self.assertEqual(misses, 0)
+ self.assertEqual(currsize, 0)
+ f(x, y)
+ hits, misses, maxsize, currsize = f.cache_info()
+ self.assertEqual(hits, 0)
+ self.assertEqual(misses, 1)
+ self.assertEqual(currsize, 1)
+
+ # Test bypassing the cache
+ self.assertIs(f.__wrapped__, orig)
+ f.__wrapped__(x, y)
+ hits, misses, maxsize, currsize = f.cache_info()
+ self.assertEqual(hits, 0)
+ self.assertEqual(misses, 1)
+ self.assertEqual(currsize, 1)
+
+ # test size zero (which means "never-cache")
+ @functools.lru_cache(0)
+ def f():
+ nonlocal f_cnt
+ f_cnt += 1
+ return 20
+ self.assertEqual(f.cache_info().maxsize, 0)
+ f_cnt = 0
+ for i in range(5):
+ self.assertEqual(f(), 20)
+ self.assertEqual(f_cnt, 5)
+ hits, misses, maxsize, currsize = f.cache_info()
+ self.assertEqual(hits, 0)
+ self.assertEqual(misses, 5)
+ self.assertEqual(currsize, 0)
+
+ # test size one
+ @functools.lru_cache(1)
+ def f():
+ nonlocal f_cnt
+ f_cnt += 1
+ return 20
+ self.assertEqual(f.cache_info().maxsize, 1)
+ f_cnt = 0
+ for i in range(5):
+ self.assertEqual(f(), 20)
+ self.assertEqual(f_cnt, 1)
+ hits, misses, maxsize, currsize = f.cache_info()
+ self.assertEqual(hits, 4)
+ self.assertEqual(misses, 1)
+ self.assertEqual(currsize, 1)
+
+ # test size two
+ @functools.lru_cache(2)
+ def f(x):
+ nonlocal f_cnt
+ f_cnt += 1
+ return x*10
+ self.assertEqual(f.cache_info().maxsize, 2)
+ f_cnt = 0
+ for x in 7, 9, 7, 9, 7, 9, 8, 8, 8, 9, 9, 9, 8, 8, 8, 7:
+ # * * * *
+ self.assertEqual(f(x), x*10)
+ self.assertEqual(f_cnt, 4)
+ hits, misses, maxsize, currsize = f.cache_info()
+ self.assertEqual(hits, 12)
+ self.assertEqual(misses, 4)
+ self.assertEqual(currsize, 2)
+
+ def test_lru_with_maxsize_none(self):
+ @functools.lru_cache(maxsize=None)
+ def fib(n):
+ if n < 2:
+ return n
+ return fib(n-1) + fib(n-2)
+ self.assertEqual([fib(n) for n in range(16)],
+ [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610])
+ self.assertEqual(fib.cache_info(),
+ functools._CacheInfo(hits=28, misses=16, maxsize=None, currsize=16))
+ fib.cache_clear()
+ self.assertEqual(fib.cache_info(),
+ functools._CacheInfo(hits=0, misses=0, maxsize=None, currsize=0))
def test_main(verbose=None):
- import sys
test_classes = (
TestPartial,
TestPartialSubclass,
TestPythonPartial,
TestUpdateWrapper,
+ TestTotalOrdering,
+ TestCmpToKey,
TestWraps,
- TestReduce
+ TestReduce,
+ TestLRU,
)
support.run_unittest(*test_classes)
diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py
index 1cede70eeb..c6689a1a18 100644
--- a/Lib/test/test_future.py
+++ b/Lib/test/test_future.py
@@ -109,7 +109,7 @@ class FutureTest(unittest.TestCase):
def test_unicode_literals_exec(self):
scope = {}
exec("from __future__ import unicode_literals; x = ''", {}, scope)
- self.assertTrue(isinstance(scope["x"], str))
+ self.assertIsInstance(scope["x"], str)
def test_main():
diff --git a/Lib/test/test_future5.py b/Lib/test/test_future5.py
index 57cbe9f0d5..9ca3a364f7 100644
--- a/Lib/test/test_future5.py
+++ b/Lib/test/test_future5.py
@@ -9,7 +9,7 @@ from . import support
class TestMultipleFeatures(unittest.TestCase):
def test_unicode_literals(self):
- self.assertTrue(isinstance("", str))
+ self.assertIsInstance("", str)
def test_print_function(self):
with support.captured_output("stderr") as s:
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index 9788291339..100c76729c 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -1,5 +1,5 @@
import unittest
-from test.support import verbose, run_unittest
+from test.support import verbose, run_unittest, strip_python_stderr
import sys
import gc
import weakref
@@ -477,6 +477,53 @@ class GCTests(unittest.TestCase):
# would be damaged, with an empty __dict__.
self.assertEqual(x, None)
+ def test_garbage_at_shutdown(self):
+ import subprocess
+ code = """if 1:
+ import gc
+ class X:
+ def __init__(self, name):
+ self.name = name
+ def __repr__(self):
+ return "<X %%r>" %% self.name
+ def __del__(self):
+ pass
+
+ x = X('first')
+ x.x = x
+ x.y = X('second')
+ del x
+ gc.set_debug(%s)
+ """
+ def run_command(code):
+ p = subprocess.Popen([sys.executable, "-Wd", "-c", code],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ p.stdout.close()
+ p.stderr.close()
+ self.assertEqual(p.returncode, 0)
+ self.assertEqual(stdout.strip(), b"")
+ return strip_python_stderr(stderr)
+
+ stderr = run_command(code % "0")
+ self.assertIn(b"ResourceWarning: gc: 2 uncollectable objects at "
+ b"shutdown; use", stderr)
+ self.assertNotIn(b"<X 'first'>", stderr)
+ # With DEBUG_UNCOLLECTABLE, the garbage list gets printed
+ stderr = run_command(code % "gc.DEBUG_UNCOLLECTABLE")
+ self.assertIn(b"ResourceWarning: gc: 2 uncollectable objects at "
+ b"shutdown", stderr)
+ self.assertTrue(
+ (b"[<X 'first'>, <X 'second'>]" in stderr) or
+ (b"[<X 'second'>, <X 'first'>]" in stderr), stderr)
+ # With DEBUG_SAVEALL, no additional message should get printed
+ # (because gc.garbage also contains normally reclaimable cyclic
+ # references, and its elements get printed at runtime anyway).
+ stderr = run_command(code % "gc.DEBUG_SAVEALL")
+ self.assertNotIn(b"uncollectable objects at shutdown", stderr)
+
+
class GCTogglingTests(unittest.TestCase):
def setUp(self):
gc.enable()
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
new file mode 100644
index 0000000000..17b44ea354
--- /dev/null
+++ b/Lib/test/test_gdb.py
@@ -0,0 +1,681 @@
+# Verify that gdb can pretty-print the various PyObject* types
+#
+# The code for testing gdb was adapted from similar work in Unladen Swallow's
+# Lib/test/test_jit_gdb.py
+
+import os
+import re
+import subprocess
+import sys
+import unittest
+import locale
+
+from test.support import run_unittest, findfile, python_is_optimized
+
+try:
+ gdb_version, _ = subprocess.Popen(["gdb", "--version"],
+ stdout=subprocess.PIPE).communicate()
+except OSError:
+ # This is what "no gdb" looks like. There may, however, be other
+ # errors that manifest this way too.
+ raise unittest.SkipTest("Couldn't find gdb on the path")
+gdb_version_number = re.search(b"^GNU gdb [^\d]*(\d+)\.", gdb_version)
+if int(gdb_version_number.group(1)) < 7:
+ raise unittest.SkipTest("gdb versions before 7.0 didn't support python embedding"
+ " Saw:\n" + gdb_version.decode('ascii', 'replace'))
+
+# Verify that "gdb" was built with the embedded python support enabled:
+cmd = "--eval-command=python import sys; print sys.version_info"
+p = subprocess.Popen(["gdb", "--batch", cmd],
+ stdout=subprocess.PIPE)
+gdbpy_version, _ = p.communicate()
+if gdbpy_version == b'':
+ raise unittest.SkipTest("gdb not built with embedded python support")
+
+def gdb_has_frame_select():
+ # Does this build of gdb have gdb.Frame.select ?
+ cmd = "--eval-command=python print(dir(gdb.Frame))"
+ p = subprocess.Popen(["gdb", "--batch", cmd],
+ stdout=subprocess.PIPE)
+ stdout, _ = p.communicate()
+ m = re.match(br'.*\[(.*)\].*', stdout)
+ if not m:
+ raise unittest.SkipTest("Unable to parse output from gdb.Frame.select test")
+ gdb_frame_dir = m.group(1).split(b', ')
+ return b"'select'" in gdb_frame_dir
+
+HAS_PYUP_PYDOWN = gdb_has_frame_select()
+
+BREAKPOINT_FN='builtin_id'
+
+class DebuggerTests(unittest.TestCase):
+
+ """Test that the debugger can debug Python."""
+
+ def run_gdb(self, *args):
+ """Runs gdb with the command line given by *args.
+
+ Returns its stdout, stderr
+ """
+ out, err = subprocess.Popen(
+ args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ ).communicate()
+ return out.decode('utf-8', 'replace'), err.decode('utf-8', 'replace')
+
+ def get_stack_trace(self, source=None, script=None,
+ breakpoint=BREAKPOINT_FN,
+ cmds_after_breakpoint=None,
+ import_site=False):
+ '''
+ Run 'python -c SOURCE' under gdb with a breakpoint.
+
+ Support injecting commands after the breakpoint is reached
+
+ Returns the stdout from gdb
+
+ cmds_after_breakpoint: if provided, a list of strings: gdb commands
+ '''
+ # We use "set breakpoint pending yes" to avoid blocking with a:
+ # Function "foo" not defined.
+ # Make breakpoint pending on future shared library load? (y or [n])
+ # error, which typically happens python is dynamically linked (the
+ # breakpoints of interest are to be found in the shared library)
+ # When this happens, we still get:
+ # Function "textiowrapper_write" not defined.
+ # emitted to stderr each time, alas.
+
+ # Initially I had "--eval-command=continue" here, but removed it to
+ # avoid repeated print breakpoints when traversing hierarchical data
+ # structures
+
+ # Generate a list of commands in gdb's language:
+ commands = ['set breakpoint pending yes',
+ 'break %s' % breakpoint,
+ 'run']
+ if cmds_after_breakpoint:
+ commands += cmds_after_breakpoint
+ else:
+ commands += ['backtrace']
+
+ # print commands
+
+ # Use "commands" to generate the arguments with which to invoke "gdb":
+ args = ["gdb", "--batch"]
+ args += ['--eval-command=%s' % cmd for cmd in commands]
+ args += ["--args",
+ sys.executable]
+
+ if not import_site:
+ # -S suppresses the default 'import site'
+ args += ["-S"]
+
+ if source:
+ args += ["-c", source]
+ elif script:
+ args += [script]
+
+ # print args
+ # print ' '.join(args)
+
+ # Use "args" to invoke gdb, capturing stdout, stderr:
+ out, err = self.run_gdb(*args)
+
+ # Ignore some noise on stderr due to the pending breakpoint:
+ err = err.replace('Function "%s" not defined.\n' % breakpoint, '')
+ # Ignore some other noise on stderr (http://bugs.python.org/issue8600)
+ err = err.replace("warning: Unable to find libthread_db matching"
+ " inferior's thread library, thread debugging will"
+ " not be available.\n",
+ '')
+ err = err.replace("warning: Cannot initialize thread debugging"
+ " library: Debugger service failed\n",
+ '')
+
+ # Ensure no unexpected error messages:
+ self.assertEqual(err, '')
+
+ return out
+
+ def get_gdb_repr(self, source,
+ cmds_after_breakpoint=None,
+ import_site=False):
+ # Given an input python source representation of data,
+ # run "python -c'id(DATA)'" under gdb with a breakpoint on
+ # builtin_id and scrape out gdb's representation of the "op"
+ # parameter, and verify that the gdb displays the same string
+ #
+ # Verify that the gdb displays the expected string
+ #
+ # For a nested structure, the first time we hit the breakpoint will
+ # give us the top-level structure
+ gdb_output = self.get_stack_trace(source, breakpoint=BREAKPOINT_FN,
+ cmds_after_breakpoint=cmds_after_breakpoint,
+ import_site=import_site)
+ # gdb can insert additional '\n' and space characters in various places
+ # in its output, depending on the width of the terminal it's connected
+ # to (using its "wrap_here" function)
+ m = re.match('.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+Python/bltinmodule.c.*',
+ gdb_output, re.DOTALL)
+ if not m:
+ self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
+ return m.group(1), gdb_output
+
+ def assertEndsWith(self, actual, exp_end):
+ '''Ensure that the given "actual" string ends with "exp_end"'''
+ self.assertTrue(actual.endswith(exp_end),
+ msg='%r did not end with %r' % (actual, exp_end))
+
+ def assertMultilineMatches(self, actual, pattern):
+ m = re.match(pattern, actual, re.DOTALL)
+ if not m:
+ self.fail(msg='%r did not match %r' % (actual, pattern))
+
+ def get_sample_script(self):
+ return findfile('gdb_sample.py')
+
+class PrettyPrintTests(DebuggerTests):
+ def test_getting_backtrace(self):
+ gdb_output = self.get_stack_trace('id(42)')
+ self.assertTrue(BREAKPOINT_FN in gdb_output)
+
+ def assertGdbRepr(self, val, exp_repr=None, cmds_after_breakpoint=None):
+ # Ensure that gdb's rendering of the value in a debugged process
+ # matches repr(value) in this process:
+ gdb_repr, gdb_output = self.get_gdb_repr('id(' + ascii(val) + ')',
+ cmds_after_breakpoint)
+ if not exp_repr:
+ exp_repr = repr(val)
+ self.assertEqual(gdb_repr, exp_repr,
+ ('%r did not equal expected %r; full output was:\n%s'
+ % (gdb_repr, exp_repr, gdb_output)))
+
+ def test_int(self):
+ 'Verify the pretty-printing of various "int"/long values'
+ self.assertGdbRepr(42)
+ self.assertGdbRepr(0)
+ self.assertGdbRepr(-7)
+ self.assertGdbRepr(1000000000000)
+ self.assertGdbRepr(-1000000000000000)
+
+ def test_singletons(self):
+ 'Verify the pretty-printing of True, False and None'
+ self.assertGdbRepr(True)
+ self.assertGdbRepr(False)
+ self.assertGdbRepr(None)
+
+ def test_dicts(self):
+ 'Verify the pretty-printing of dictionaries'
+ self.assertGdbRepr({})
+ self.assertGdbRepr({'foo': 'bar'})
+ self.assertGdbRepr({'foo': 'bar', 'douglas':42})
+
+ def test_lists(self):
+ 'Verify the pretty-printing of lists'
+ self.assertGdbRepr([])
+ self.assertGdbRepr(list(range(5)))
+
+ def test_bytes(self):
+ 'Verify the pretty-printing of bytes'
+ self.assertGdbRepr(b'')
+ self.assertGdbRepr(b'And now for something hopefully the same')
+ self.assertGdbRepr(b'string with embedded NUL here \0 and then some more text')
+ self.assertGdbRepr(b'this is a tab:\t'
+ b' this is a slash-N:\n'
+ b' this is a slash-R:\r'
+ )
+
+ self.assertGdbRepr(b'this is byte 255:\xff and byte 128:\x80')
+
+ self.assertGdbRepr(bytes([b for b in range(255)]))
+
+ def test_strings(self):
+ 'Verify the pretty-printing of unicode strings'
+ encoding = locale.getpreferredencoding()
+ def check_repr(text):
+ try:
+ text.encode(encoding)
+ printable = True
+ except UnicodeEncodeError:
+ self.assertGdbRepr(text, ascii(text))
+ else:
+ self.assertGdbRepr(text)
+
+ self.assertGdbRepr('')
+ self.assertGdbRepr('And now for something hopefully the same')
+ self.assertGdbRepr('string with embedded NUL here \0 and then some more text')
+
+ # Test printing a single character:
+ # U+2620 SKULL AND CROSSBONES
+ check_repr('\u2620')
+
+ # Test printing a Japanese unicode string
+ # (I believe this reads "mojibake", using 3 characters from the CJK
+ # Unified Ideographs area, followed by U+3051 HIRAGANA LETTER KE)
+ check_repr('\u6587\u5b57\u5316\u3051')
+
+ # Test a character outside the BMP:
+ # U+1D121 MUSICAL SYMBOL C CLEF
+ # This is:
+ # UTF-8: 0xF0 0x9D 0x84 0xA1
+ # UTF-16: 0xD834 0xDD21
+ check_repr(chr(0x1D121))
+
+ def test_tuples(self):
+ 'Verify the pretty-printing of tuples'
+ self.assertGdbRepr(tuple())
+ self.assertGdbRepr((1,), '(1,)')
+ self.assertGdbRepr(('foo', 'bar', 'baz'))
+
+ def test_sets(self):
+ 'Verify the pretty-printing of sets'
+ self.assertGdbRepr(set())
+ self.assertGdbRepr(set(['a', 'b']))
+ self.assertGdbRepr(set([4, 5, 6]))
+
+ # Ensure that we handle sets containing the "dummy" key value,
+ # which happens on deletion:
+ gdb_repr, gdb_output = self.get_gdb_repr('''s = set(['a','b'])
+s.pop()
+id(s)''')
+ self.assertEqual(gdb_repr, "{'b'}")
+
+ def test_frozensets(self):
+ 'Verify the pretty-printing of frozensets'
+ self.assertGdbRepr(frozenset())
+ self.assertGdbRepr(frozenset(['a', 'b']))
+ self.assertGdbRepr(frozenset([4, 5, 6]))
+
+ def test_exceptions(self):
+ # Test a RuntimeError
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+try:
+ raise RuntimeError("I am an error")
+except RuntimeError as e:
+ id(e)
+''')
+ self.assertEqual(gdb_repr,
+ "RuntimeError('I am an error',)")
+
+
+ # Test division by zero:
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+try:
+ a = 1 / 0
+except ZeroDivisionError as e:
+ id(e)
+''')
+ self.assertEqual(gdb_repr,
+ "ZeroDivisionError('division by zero',)")
+
+ def test_modern_class(self):
+ 'Verify the pretty-printing of new-style class instances'
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+class Foo:
+ pass
+foo = Foo()
+foo.an_int = 42
+id(foo)''')
+ m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
+ self.assertTrue(m,
+ msg='Unexpected new-style class rendering %r' % gdb_repr)
+
+ def test_subclassing_list(self):
+ 'Verify the pretty-printing of an instance of a list subclass'
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+class Foo(list):
+ pass
+foo = Foo()
+foo += [1, 2, 3]
+foo.an_int = 42
+id(foo)''')
+ m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
+
+ self.assertTrue(m,
+ msg='Unexpected new-style class rendering %r' % gdb_repr)
+
+ def test_subclassing_tuple(self):
+ 'Verify the pretty-printing of an instance of a tuple subclass'
+ # This should exercise the negative tp_dictoffset code in the
+ # new-style class support
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+class Foo(tuple):
+ pass
+foo = Foo((1, 2, 3))
+foo.an_int = 42
+id(foo)''')
+ m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
+
+ self.assertTrue(m,
+ msg='Unexpected new-style class rendering %r' % gdb_repr)
+
+ def assertSane(self, source, corruption, exprepr=None):
+ '''Run Python under gdb, corrupting variables in the inferior process
+ immediately before taking a backtrace.
+
+ Verify that the variable's representation is the expected failsafe
+ representation'''
+ if corruption:
+ cmds_after_breakpoint=[corruption, 'backtrace']
+ else:
+ cmds_after_breakpoint=['backtrace']
+
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr(source,
+ cmds_after_breakpoint=cmds_after_breakpoint)
+ if exprepr:
+ if gdb_repr == exprepr:
+ # gdb managed to print the value in spite of the corruption;
+ # this is good (see http://bugs.python.org/issue8330)
+ return
+
+ # Match anything for the type name; 0xDEADBEEF could point to
+ # something arbitrary (see http://bugs.python.org/issue8330)
+ pattern = '<.* at remote 0x[0-9a-f]+>'
+
+ m = re.match(pattern, gdb_repr)
+ if not m:
+ self.fail('Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ def test_NULL_ptr(self):
+ 'Ensure that a NULL PyObject* is handled gracefully'
+ gdb_repr, gdb_output = (
+ self.get_gdb_repr('id(42)',
+ cmds_after_breakpoint=['set variable v=0',
+ 'backtrace'])
+ )
+
+ self.assertEqual(gdb_repr, '0x0')
+
+ def test_NULL_ob_type(self):
+ 'Ensure that a PyObject* with NULL ob_type is handled gracefully'
+ self.assertSane('id(42)',
+ 'set v->ob_type=0')
+
+ def test_corrupt_ob_type(self):
+ 'Ensure that a PyObject* with a corrupt ob_type is handled gracefully'
+ self.assertSane('id(42)',
+ 'set v->ob_type=0xDEADBEEF',
+ exprepr='42')
+
+ def test_corrupt_tp_flags(self):
+ 'Ensure that a PyObject* with a type with corrupt tp_flags is handled'
+ self.assertSane('id(42)',
+ 'set v->ob_type->tp_flags=0x0',
+ exprepr='42')
+
+ def test_corrupt_tp_name(self):
+ 'Ensure that a PyObject* with a type with corrupt tp_name is handled'
+ self.assertSane('id(42)',
+ 'set v->ob_type->tp_name=0xDEADBEEF',
+ exprepr='42')
+
+ def test_builtins_help(self):
+ 'Ensure that the new-style class _Helper in site.py can be handled'
+ # (this was the issue causing tracebacks in
+ # http://bugs.python.org/issue8032#msg100537 )
+ gdb_repr, gdb_output = self.get_gdb_repr('id(__builtins__.help)', import_site=True)
+
+ m = re.match(r'<_Helper at remote 0x[0-9a-f]+>', gdb_repr)
+ self.assertTrue(m,
+ msg='Unexpected rendering %r' % gdb_repr)
+
+ def test_selfreferential_list(self):
+ '''Ensure that a reference loop involving a list doesn't lead proxyval
+ into an infinite loop:'''
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr("a = [3, 4, 5] ; a.append(a) ; id(a)")
+ self.assertEqual(gdb_repr, '[3, 4, 5, [...]]')
+
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr("a = [3, 4, 5] ; b = [a] ; a.append(b) ; id(a)")
+ self.assertEqual(gdb_repr, '[3, 4, 5, [[...]]]')
+
+ def test_selfreferential_dict(self):
+ '''Ensure that a reference loop involving a dict doesn't lead proxyval
+ into an infinite loop:'''
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr("a = {} ; b = {'bar':a} ; a['foo'] = b ; id(a)")
+
+ self.assertEqual(gdb_repr, "{'foo': {'bar': {...}}}")
+
+ def test_selfreferential_old_style_instance(self):
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr('''
+class Foo:
+ pass
+foo = Foo()
+foo.an_attr = foo
+id(foo)''')
+ self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>',
+ gdb_repr),
+ 'Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ def test_selfreferential_new_style_instance(self):
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr('''
+class Foo(object):
+ pass
+foo = Foo()
+foo.an_attr = foo
+id(foo)''')
+ self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>',
+ gdb_repr),
+ 'Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr('''
+class Foo(object):
+ pass
+a = Foo()
+b = Foo()
+a.an_attr = b
+b.an_attr = a
+id(a)''')
+ self.assertTrue(re.match('<Foo\(an_attr=<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>\) at remote 0x[0-9a-f]+>',
+ gdb_repr),
+ 'Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ def test_truncation(self):
+ 'Verify that very long output is truncated'
+ gdb_repr, gdb_output = self.get_gdb_repr('id(list(range(1000)))')
+ self.assertEqual(gdb_repr,
+ "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, "
+ "14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, "
+ "27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, "
+ "40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, "
+ "53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, "
+ "66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, "
+ "79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, "
+ "92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, "
+ "104, 105, 106, 107, 108, 109, 110, 111, 112, 113, "
+ "114, 115, 116, 117, 118, 119, 120, 121, 122, 123, "
+ "124, 125, 126, 127, 128, 129, 130, 131, 132, 133, "
+ "134, 135, 136, 137, 138, 139, 140, 141, 142, 143, "
+ "144, 145, 146, 147, 148, 149, 150, 151, 152, 153, "
+ "154, 155, 156, 157, 158, 159, 160, 161, 162, 163, "
+ "164, 165, 166, 167, 168, 169, 170, 171, 172, 173, "
+ "174, 175, 176, 177, 178, 179, 180, 181, 182, 183, "
+ "184, 185, 186, 187, 188, 189, 190, 191, 192, 193, "
+ "194, 195, 196, 197, 198, 199, 200, 201, 202, 203, "
+ "204, 205, 206, 207, 208, 209, 210, 211, 212, 213, "
+ "214, 215, 216, 217, 218, 219, 220, 221, 222, 223, "
+ "224, 225, 226...(truncated)")
+ self.assertEqual(len(gdb_repr),
+ 1024 + len('...(truncated)'))
+
+ def test_builtin_method(self):
+ gdb_repr, gdb_output = self.get_gdb_repr('import sys; id(sys.stdout.readlines)')
+ self.assertTrue(re.match('<built-in method readlines of _io.TextIOWrapper object at remote 0x[0-9a-f]+>',
+ gdb_repr),
+ 'Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ def test_frames(self):
+ gdb_output = self.get_stack_trace('''
+def foo(a, b, c):
+ pass
+
+foo(3, 4, 5)
+id(foo.__code__)''',
+ breakpoint='builtin_id',
+ cmds_after_breakpoint=['print (PyFrameObject*)(((PyCodeObject*)v)->co_zombieframe)']
+ )
+ self.assertTrue(re.match('.*\s+\$1 =\s+Frame 0x[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*',
+ gdb_output,
+ re.DOTALL),
+ 'Unexpected gdb representation: %r\n%s' % (gdb_output, gdb_output))
+
+class PyListTests(DebuggerTests):
+ def assertListing(self, expected, actual):
+ self.assertEndsWith(actual, expected)
+
+ def test_basic_command(self):
+ 'Verify that the "py-list" command works'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-list'])
+
+ self.assertListing(' 5 \n'
+ ' 6 def bar(a, b, c):\n'
+ ' 7 baz(a, b, c)\n'
+ ' 8 \n'
+ ' 9 def baz(*args):\n'
+ ' >10 id(42)\n'
+ ' 11 \n'
+ ' 12 foo(1, 2, 3)\n',
+ bt)
+
+ def test_one_abs_arg(self):
+ 'Verify the "py-list" command with one absolute argument'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-list 9'])
+
+ self.assertListing(' 9 def baz(*args):\n'
+ ' >10 id(42)\n'
+ ' 11 \n'
+ ' 12 foo(1, 2, 3)\n',
+ bt)
+
+ def test_two_abs_args(self):
+ 'Verify the "py-list" command with two absolute arguments'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-list 1,3'])
+
+ self.assertListing(' 1 # Sample script for use by test_gdb.py\n'
+ ' 2 \n'
+ ' 3 def foo(a, b, c):\n',
+ bt)
+
+class StackNavigationTests(DebuggerTests):
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_pyup_command(self):
+ 'Verify that the "py-up" command works'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up'])
+ self.assertMultilineMatches(bt,
+ r'''^.*
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
+ baz\(a, b, c\)
+$''')
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_down_at_bottom(self):
+ 'Verify handling of "py-down" at the bottom of the stack'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-down'])
+ self.assertEndsWith(bt,
+ 'Unable to find a newer python frame\n')
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_up_at_top(self):
+ 'Verify handling of "py-up" at the top of the stack'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up'] * 4)
+ self.assertEndsWith(bt,
+ 'Unable to find an older python frame\n')
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_up_then_down(self):
+ 'Verify "py-up" followed by "py-down"'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up', 'py-down'])
+ self.assertMultilineMatches(bt,
+ r'''^.*
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
+ baz\(a, b, c\)
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 10, in baz \(args=\(1, 2, 3\)\)
+ id\(42\)
+$''')
+
+class PyBtTests(DebuggerTests):
+ def test_basic_command(self):
+ 'Verify that the "py-bt" command works'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-bt'])
+ self.assertMultilineMatches(bt,
+ r'''^.*
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
+ baz\(a, b, c\)
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\)
+ bar\(a, b, c\)
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 12, in <module> \(\)
+foo\(1, 2, 3\)
+''')
+
+class PyPrintTests(DebuggerTests):
+ def test_basic_command(self):
+ 'Verify that the "py-print" command works'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-print args'])
+ self.assertMultilineMatches(bt,
+ r".*\nlocal 'args' = \(1, 2, 3\)\n.*")
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_print_after_up(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up', 'py-print c', 'py-print b', 'py-print a'])
+ self.assertMultilineMatches(bt,
+ r".*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*")
+
+ def test_printing_global(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-print __name__'])
+ self.assertMultilineMatches(bt,
+ r".*\nglobal '__name__' = '__main__'\n.*")
+
+ def test_printing_builtin(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-print len'])
+ self.assertMultilineMatches(bt,
+ r".*\nbuiltin 'len' = <built-in method len of module object at remote 0x[0-9a-f]+>\n.*")
+
+class PyLocalsTests(DebuggerTests):
+ def test_basic_command(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-locals'])
+ self.assertMultilineMatches(bt,
+ r".*\nargs = \(1, 2, 3\)\n.*")
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_locals_after_up(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up', 'py-locals'])
+ self.assertMultilineMatches(bt,
+ r".*\na = 1\nb = 2\nc = 3\n.*")
+
+def test_main():
+ if python_is_optimized():
+ raise unittest.SkipTest("Python was compiled with optimizations")
+ run_unittest(PrettyPrintTests,
+ PyListTests,
+ StackNavigationTests,
+ PyBtTests,
+ PyPrintTests,
+ PyLocalsTests
+ )
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index 84028e8538..3ec209ba87 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -458,30 +458,30 @@ Subject: Re: PEP 255: Simple Generators
... else:
... break
A->A B->B C->C D->D E->E F->F G->G H->H I->I J->J K->K L->L M->M
-merged I into A
- A->A B->B C->C D->D E->E F->F G->G H->H I->A J->J K->K L->L M->M
-merged D into C
- A->A B->B C->C D->C E->E F->F G->G H->H I->A J->J K->K L->L M->M
-merged K into H
- A->A B->B C->C D->C E->E F->F G->G H->H I->A J->J K->H L->L M->M
-merged L into A
- A->A B->B C->C D->C E->E F->F G->G H->H I->A J->J K->H L->A M->M
-merged E into A
- A->A B->B C->C D->C E->A F->F G->G H->H I->A J->J K->H L->A M->M
-merged B into G
- A->A B->G C->C D->C E->A F->F G->G H->H I->A J->J K->H L->A M->M
+merged K into B
+ A->A B->B C->C D->D E->E F->F G->G H->H I->I J->J K->B L->L M->M
merged A into F
- A->F B->G C->C D->C E->F F->F G->G H->H I->F J->J K->H L->F M->M
-merged H into G
- A->F B->G C->C D->C E->F F->F G->G H->G I->F J->J K->G L->F M->M
-merged F into J
- A->J B->G C->C D->C E->J F->J G->G H->G I->J J->J K->G L->J M->M
+ A->F B->B C->C D->D E->E F->F G->G H->H I->I J->J K->B L->L M->M
+merged E into F
+ A->F B->B C->C D->D E->F F->F G->G H->H I->I J->J K->B L->L M->M
+merged D into C
+ A->F B->B C->C D->C E->F F->F G->G H->H I->I J->J K->B L->L M->M
merged M into C
- A->J B->G C->C D->C E->J F->J G->G H->G I->J J->J K->G L->J M->C
-merged J into G
- A->G B->G C->C D->C E->G F->G G->G H->G I->G J->G K->G L->G M->C
-merged C into G
- A->G B->G C->G D->G E->G F->G G->G H->G I->G J->G K->G L->G M->G
+ A->F B->B C->C D->C E->F F->F G->G H->H I->I J->J K->B L->L M->C
+merged J into B
+ A->F B->B C->C D->C E->F F->F G->G H->H I->I J->B K->B L->L M->C
+merged B into C
+ A->F B->C C->C D->C E->F F->F G->G H->H I->I J->C K->C L->L M->C
+merged F into G
+ A->G B->C C->C D->C E->G F->G G->G H->H I->I J->C K->C L->L M->C
+merged L into C
+ A->G B->C C->C D->C E->G F->G G->G H->H I->I J->C K->C L->C M->C
+merged G into I
+ A->I B->C C->C D->C E->I F->I G->I H->H I->I J->C K->C L->C M->C
+merged I into H
+ A->H B->C C->C D->C E->H F->H G->H H->H I->H J->C K->C L->C M->C
+merged C into H
+ A->H B->H C->H D->H E->H F->H G->H H->H I->H J->H K->H L->H M->H
"""
# Emacs turd '
@@ -960,11 +960,11 @@ Lambdas shouldn't have their usual return behavior.
# iterators have side-effects, so that which values *can* be generated at
# each slot depend on the values iterated at previous slots.
-def conjoin(gs):
+def simple_conjoin(gs):
values = [None] * len(gs)
- def gen(i, values=values):
+ def gen(i):
if i >= len(gs):
yield values
else:
@@ -989,7 +989,7 @@ def conjoin(gs):
# Do one loop nest at time recursively, until the # of loop nests
# remaining is divisible by 3.
- def gen(i, values=values):
+ def gen(i):
if i >= n:
yield values
@@ -1007,7 +1007,7 @@ def conjoin(gs):
# remain. Don't call directly: this is an internal optimization for
# gen's use.
- def _gen3(i, values=values):
+ def _gen3(i):
assert i < n and (n-i) % 3 == 0
ip1, ip2, ip3 = i+1, i+2, i+3
g, g1, g2 = gs[i : ip3]
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py
index 089477c736..50638a1cf0 100644
--- a/Lib/test/test_genericpath.py
+++ b/Lib/test/test_genericpath.py
@@ -1,41 +1,112 @@
+"""
+Tests common to genericpath, macpath, ntpath and posixpath
+"""
+
import unittest
from test import support
import os
import genericpath
+import sys
+
+
+def safe_rmdir(dirname):
+ try:
+ os.rmdir(dirname)
+ except OSError:
+ pass
+
-class AllCommonTest(unittest.TestCase):
+class GenericTest(unittest.TestCase):
+ # The path module to be tested
+ pathmodule = genericpath
+ common_attributes = ['commonprefix', 'getsize', 'getatime', 'getctime',
+ 'getmtime', 'exists', 'isdir', 'isfile']
+ attributes = []
- def assertIs(self, a, b):
- self.assertTrue(a is b)
+ def test_no_argument(self):
+ for attr in self.common_attributes + self.attributes:
+ with self.assertRaises(TypeError):
+ getattr(self.pathmodule, attr)()
+ raise self.fail("{}.{}() did not raise a TypeError"
+ .format(self.pathmodule.__name__, attr))
def test_commonprefix(self):
+ commonprefix = self.pathmodule.commonprefix
self.assertEqual(
- genericpath.commonprefix([]),
+ commonprefix([]),
""
)
self.assertEqual(
- genericpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"]),
+ commonprefix(["/home/swenson/spam", "/home/swen/spam"]),
"/home/swen"
)
self.assertEqual(
- genericpath.commonprefix(["/home/swen/spam", "/home/swen/eggs"]),
+ commonprefix(["/home/swen/spam", "/home/swen/eggs"]),
"/home/swen/"
)
self.assertEqual(
- genericpath.commonprefix(["/home/swen/spam", "/home/swen/spam"]),
+ commonprefix(["/home/swen/spam", "/home/swen/spam"]),
"/home/swen/spam"
)
+ self.assertEqual(
+ commonprefix(["home:swenson:spam", "home:swen:spam"]),
+ "home:swen"
+ )
+ self.assertEqual(
+ commonprefix([":home:swen:spam", ":home:swen:eggs"]),
+ ":home:swen:"
+ )
+ self.assertEqual(
+ commonprefix([":home:swen:spam", ":home:swen:spam"]),
+ ":home:swen:spam"
+ )
+
+ self.assertEqual(
+ commonprefix([b"/home/swenson/spam", b"/home/swen/spam"]),
+ b"/home/swen"
+ )
+ self.assertEqual(
+ commonprefix([b"/home/swen/spam", b"/home/swen/eggs"]),
+ b"/home/swen/"
+ )
+ self.assertEqual(
+ commonprefix([b"/home/swen/spam", b"/home/swen/spam"]),
+ b"/home/swen/spam"
+ )
+ self.assertEqual(
+ commonprefix([b"home:swenson:spam", b"home:swen:spam"]),
+ b"home:swen"
+ )
+ self.assertEqual(
+ commonprefix([b":home:swen:spam", b":home:swen:eggs"]),
+ b":home:swen:"
+ )
+ self.assertEqual(
+ commonprefix([b":home:swen:spam", b":home:swen:spam"]),
+ b":home:swen:spam"
+ )
+
+ testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd',
+ 'aXc', 'abd', 'ab', 'aX', 'abcX']
+ for s1 in testlist:
+ for s2 in testlist:
+ p = commonprefix([s1, s2])
+ self.assertTrue(s1.startswith(p))
+ self.assertTrue(s2.startswith(p))
+ if s1 != s2:
+ n = len(p)
+ self.assertNotEqual(s1[n:n+1], s2[n:n+1])
def test_getsize(self):
f = open(support.TESTFN, "wb")
try:
f.write(b"foo")
f.close()
- self.assertEqual(genericpath.getsize(support.TESTFN), 3)
+ self.assertEqual(self.pathmodule.getsize(support.TESTFN), 3)
finally:
if not f.closed:
f.close()
- os.remove(support.TESTFN)
+ support.unlink(support.TESTFN)
def test_time(self):
f = open(support.TESTFN, "wb")
@@ -51,134 +122,187 @@ class AllCommonTest(unittest.TestCase):
self.assertEqual(d, b"foobar")
self.assertLessEqual(
- genericpath.getctime(support.TESTFN),
- genericpath.getmtime(support.TESTFN)
+ self.pathmodule.getctime(support.TESTFN),
+ self.pathmodule.getmtime(support.TESTFN)
)
finally:
if not f.closed:
f.close()
- os.remove(support.TESTFN)
+ support.unlink(support.TESTFN)
def test_exists(self):
- self.assertIs(genericpath.exists(support.TESTFN), False)
+ self.assertIs(self.pathmodule.exists(support.TESTFN), False)
f = open(support.TESTFN, "wb")
try:
f.write(b"foo")
f.close()
- self.assertIs(genericpath.exists(support.TESTFN), True)
+ self.assertIs(self.pathmodule.exists(support.TESTFN), True)
+ if not self.pathmodule == genericpath:
+ self.assertIs(self.pathmodule.lexists(support.TESTFN),
+ True)
finally:
if not f.close():
f.close()
- try:
- os.remove(support.TESTFN)
- except os.error:
- pass
-
- self.assertRaises(TypeError, genericpath.exists)
+ support.unlink(support.TESTFN)
def test_isdir(self):
- self.assertIs(genericpath.isdir(support.TESTFN), False)
+ self.assertIs(self.pathmodule.isdir(support.TESTFN), False)
f = open(support.TESTFN, "wb")
try:
f.write(b"foo")
f.close()
- self.assertIs(genericpath.isdir(support.TESTFN), False)
+ self.assertIs(self.pathmodule.isdir(support.TESTFN), False)
os.remove(support.TESTFN)
os.mkdir(support.TESTFN)
- self.assertIs(genericpath.isdir(support.TESTFN), True)
+ self.assertIs(self.pathmodule.isdir(support.TESTFN), True)
os.rmdir(support.TESTFN)
finally:
if not f.close():
f.close()
- try:
- os.remove(support.TESTFN)
- except os.error:
- pass
- try:
- os.rmdir(support.TESTFN)
- except os.error:
- pass
-
- self.assertRaises(TypeError, genericpath.isdir)
+ support.unlink(support.TESTFN)
+ safe_rmdir(support.TESTFN)
def test_isfile(self):
- self.assertIs(genericpath.isfile(support.TESTFN), False)
+ self.assertIs(self.pathmodule.isfile(support.TESTFN), False)
f = open(support.TESTFN, "wb")
try:
f.write(b"foo")
f.close()
- self.assertIs(genericpath.isfile(support.TESTFN), True)
+ self.assertIs(self.pathmodule.isfile(support.TESTFN), True)
os.remove(support.TESTFN)
os.mkdir(support.TESTFN)
- self.assertIs(genericpath.isfile(support.TESTFN), False)
+ self.assertIs(self.pathmodule.isfile(support.TESTFN), False)
os.rmdir(support.TESTFN)
finally:
if not f.close():
f.close()
- try:
- os.remove(support.TESTFN)
- except os.error:
- pass
- try:
- os.rmdir(support.TESTFN)
- except os.error:
- pass
-
- self.assertRaises(TypeError, genericpath.isdir)
-
- def test_samefile(self):
- f = open(support.TESTFN + "1", "wb")
- try:
- f.write(b"foo")
- f.close()
- self.assertIs(
- genericpath.samefile(
- support.TESTFN + "1",
- support.TESTFN + "1"
- ),
- True
- )
- # If we don't have links, assume that os.stat doesn't return resonable
- # inode information and thus, that samefile() doesn't work
- if hasattr(os, "symlink"):
- os.symlink(
- support.TESTFN + "1",
- support.TESTFN + "2"
- )
- self.assertIs(
- genericpath.samefile(
- support.TESTFN + "1",
- support.TESTFN + "2"
- ),
- True
- )
- os.remove(support.TESTFN + "2")
- f = open(support.TESTFN + "2", "wb")
- f.write(b"bar")
- f.close()
- self.assertIs(
- genericpath.samefile(
- support.TESTFN + "1",
- support.TESTFN + "2"
- ),
- False
- )
- finally:
- if not f.close():
- f.close()
- try:
- os.remove(support.TESTFN + "1")
- except os.error:
- pass
- try:
- os.remove(support.TESTFN + "2")
- except os.error:
- pass
-
- self.assertRaises(TypeError, genericpath.samefile)
+ support.unlink(support.TESTFN)
+ safe_rmdir(support.TESTFN)
+
+
+# Following TestCase is not supposed to be run from test_genericpath.
+# It is inherited by other test modules (macpath, ntpath, posixpath).
+
+class CommonTest(GenericTest):
+ # The path module to be tested
+ pathmodule = None
+ common_attributes = GenericTest.common_attributes + [
+ # Properties
+ 'curdir', 'pardir', 'extsep', 'sep',
+ 'pathsep', 'defpath', 'altsep', 'devnull',
+ # Methods
+ 'normcase', 'splitdrive', 'expandvars', 'normpath', 'abspath',
+ 'join', 'split', 'splitext', 'isabs', 'basename', 'dirname',
+ 'lexists', 'islink', 'ismount', 'expanduser', 'normpath', 'realpath',
+ ]
+
+ def test_normcase(self):
+ normcase = self.pathmodule.normcase
+ # check that normcase() is idempotent
+ for p in ["FoO/./BaR", b"FoO/./BaR"]:
+ p = normcase(p)
+ self.assertEqual(p, normcase(p))
+
+ self.assertEqual(normcase(''), '')
+ self.assertEqual(normcase(b''), b'')
+
+ # check that normcase raises a TypeError for invalid types
+ for path in (None, True, 0, 2.5, [], bytearray(b''), {'o','o'}):
+ self.assertRaises(TypeError, normcase, path)
+
+ def test_splitdrive(self):
+ # splitdrive for non-NT paths
+ splitdrive = self.pathmodule.splitdrive
+ self.assertEqual(splitdrive("/foo/bar"), ("", "/foo/bar"))
+ self.assertEqual(splitdrive("foo:bar"), ("", "foo:bar"))
+ self.assertEqual(splitdrive(":foo:bar"), ("", ":foo:bar"))
+
+ self.assertEqual(splitdrive(b"/foo/bar"), (b"", b"/foo/bar"))
+ self.assertEqual(splitdrive(b"foo:bar"), (b"", b"foo:bar"))
+ self.assertEqual(splitdrive(b":foo:bar"), (b"", b":foo:bar"))
+
+ def test_expandvars(self):
+ if self.pathmodule.__name__ == 'macpath':
+ self.skipTest('macpath.expandvars is a stub')
+ expandvars = self.pathmodule.expandvars
+ with support.EnvironmentVarGuard() as env:
+ env.clear()
+ env["foo"] = "bar"
+ env["{foo"] = "baz1"
+ env["{foo}"] = "baz2"
+ self.assertEqual(expandvars("foo"), "foo")
+ self.assertEqual(expandvars("$foo bar"), "bar bar")
+ self.assertEqual(expandvars("${foo}bar"), "barbar")
+ self.assertEqual(expandvars("$[foo]bar"), "$[foo]bar")
+ self.assertEqual(expandvars("$bar bar"), "$bar bar")
+ self.assertEqual(expandvars("$?bar"), "$?bar")
+ self.assertEqual(expandvars("${foo}bar"), "barbar")
+ self.assertEqual(expandvars("$foo}bar"), "bar}bar")
+ self.assertEqual(expandvars("${foo"), "${foo")
+ self.assertEqual(expandvars("${{foo}}"), "baz1}")
+ self.assertEqual(expandvars("$foo$foo"), "barbar")
+ self.assertEqual(expandvars("$bar$bar"), "$bar$bar")
+
+ self.assertEqual(expandvars(b"foo"), b"foo")
+ self.assertEqual(expandvars(b"$foo bar"), b"bar bar")
+ self.assertEqual(expandvars(b"${foo}bar"), b"barbar")
+ self.assertEqual(expandvars(b"$[foo]bar"), b"$[foo]bar")
+ self.assertEqual(expandvars(b"$bar bar"), b"$bar bar")
+ self.assertEqual(expandvars(b"$?bar"), b"$?bar")
+ self.assertEqual(expandvars(b"${foo}bar"), b"barbar")
+ self.assertEqual(expandvars(b"$foo}bar"), b"bar}bar")
+ self.assertEqual(expandvars(b"${foo"), b"${foo")
+ self.assertEqual(expandvars(b"${{foo}}"), b"baz1}")
+ self.assertEqual(expandvars(b"$foo$foo"), b"barbar")
+ self.assertEqual(expandvars(b"$bar$bar"), b"$bar$bar")
+
+ def test_abspath(self):
+ self.assertIn("foo", self.pathmodule.abspath("foo"))
+ self.assertIn(b"foo", self.pathmodule.abspath(b"foo"))
+
+ # Abspath returns bytes when the arg is bytes
+ for path in (b'', b'foo', b'f\xf2\xf2', b'/foo', b'C:\\'):
+ self.assertIsInstance(self.pathmodule.abspath(path), bytes)
+
+ def test_realpath(self):
+ self.assertIn("foo", self.pathmodule.realpath("foo"))
+ self.assertIn(b"foo", self.pathmodule.realpath(b"foo"))
+
+ def test_normpath_issue5827(self):
+ # Make sure normpath preserves unicode
+ for path in ('', '.', '/', '\\', '///foo/.//bar//'):
+ self.assertIsInstance(self.pathmodule.normpath(path), str)
+
+ def test_abspath_issue3426(self):
+ # Check that abspath returns unicode when the arg is unicode
+ # with both ASCII and non-ASCII cwds.
+ abspath = self.pathmodule.abspath
+ for path in ('', 'fuu', 'f\xf9\xf9', '/fuu', 'U:\\'):
+ self.assertIsInstance(abspath(path), str)
+
+ unicwd = '\xe7w\xf0'
+ try:
+ fsencoding = support.TESTFN_ENCODING or "ascii"
+ unicwd.encode(fsencoding)
+ except (AttributeError, UnicodeEncodeError):
+ # FS encoding is probably ASCII
+ pass
+ else:
+ with support.temp_cwd(unicwd):
+ for path in ('', 'fuu', 'f\xf9\xf9', '/fuu', 'U:\\'):
+ self.assertIsInstance(abspath(path), str)
+
+ @unittest.skipIf(sys.platform == 'darwin',
+ "Mac OS X denies the creation of a directory with an invalid utf8 name")
+ def test_nonascii_abspath(self):
+ # Test non-ASCII, non-UTF8 bytes in the path.
+ with support.temp_cwd(b'\xe7w\xf0'):
+ self.test_abspath()
+
def test_main():
- support.run_unittest(AllCommonTest)
+ support.run_unittest(GenericTest)
+
if __name__=="__main__":
test_main()
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py
index 1e88a34816..3d9c06a460 100644
--- a/Lib/test/test_getargs2.py
+++ b/Lib/test/test_getargs2.py
@@ -2,16 +2,6 @@ import unittest
from test import support
from _testcapi import getargs_keywords
-import warnings
-warnings.filterwarnings("ignore",
- category=DeprecationWarning,
- message=".*integer argument expected, got float",
- module=__name__)
-warnings.filterwarnings("ignore",
- category=DeprecationWarning,
- message=".*integer argument expected, got float",
- module="unittest")
-
"""
> How about the following counterproposal. This also changes some of
> the other format codes to be a little more regular.
@@ -48,17 +38,14 @@ LARGE = 0x7FFFFFFF
VERY_LARGE = 0xFF0000121212121212121242
from _testcapi import UCHAR_MAX, USHRT_MAX, UINT_MAX, ULONG_MAX, INT_MAX, \
- INT_MIN, LONG_MIN, LONG_MAX, PY_SSIZE_T_MIN, PY_SSIZE_T_MAX
+ INT_MIN, LONG_MIN, LONG_MAX, PY_SSIZE_T_MIN, PY_SSIZE_T_MAX, \
+ SHRT_MIN, SHRT_MAX
# fake, they are not defined in Python's header files
LLONG_MAX = 2**63-1
LLONG_MIN = -2**63
ULLONG_MAX = 2**64-1
-class Long:
- def __int__(self):
- return 99
-
class Int:
def __int__(self):
return 99
@@ -68,7 +55,6 @@ class Unsigned_TestCase(unittest.TestCase):
from _testcapi import getargs_b
# b returns 'unsigned char', and does range checking (0 ... UCHAR_MAX)
self.assertRaises(TypeError, getargs_b, 3.14)
- self.assertEqual(99, getargs_b(Long()))
self.assertEqual(99, getargs_b(Int()))
self.assertRaises(OverflowError, getargs_b, -1)
@@ -77,31 +63,26 @@ class Unsigned_TestCase(unittest.TestCase):
self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1)
self.assertEqual(42, getargs_b(42))
- self.assertEqual(42, getargs_b(42))
self.assertRaises(OverflowError, getargs_b, VERY_LARGE)
def test_B(self):
from _testcapi import getargs_B
# B returns 'unsigned char', no range checking
self.assertRaises(TypeError, getargs_B, 3.14)
- self.assertEqual(99, getargs_B(Long()))
self.assertEqual(99, getargs_B(Int()))
self.assertEqual(UCHAR_MAX, getargs_B(-1))
- self.assertEqual(UCHAR_MAX, getargs_B(-1))
self.assertEqual(0, getargs_B(0))
self.assertEqual(UCHAR_MAX, getargs_B(UCHAR_MAX))
self.assertEqual(0, getargs_B(UCHAR_MAX+1))
self.assertEqual(42, getargs_B(42))
- self.assertEqual(42, getargs_B(42))
self.assertEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE))
def test_H(self):
from _testcapi import getargs_H
# H returns 'unsigned short', no range checking
self.assertRaises(TypeError, getargs_H, 3.14)
- self.assertEqual(99, getargs_H(Long()))
self.assertEqual(99, getargs_H(Int()))
self.assertEqual(USHRT_MAX, getargs_H(-1))
@@ -110,7 +91,6 @@ class Unsigned_TestCase(unittest.TestCase):
self.assertEqual(0, getargs_H(USHRT_MAX+1))
self.assertEqual(42, getargs_H(42))
- self.assertEqual(42, getargs_H(42))
self.assertEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE))
@@ -118,7 +98,6 @@ class Unsigned_TestCase(unittest.TestCase):
from _testcapi import getargs_I
# I returns 'unsigned int', no range checking
self.assertRaises(TypeError, getargs_I, 3.14)
- self.assertEqual(99, getargs_I(Long()))
self.assertEqual(99, getargs_I(Int()))
self.assertEqual(UINT_MAX, getargs_I(-1))
@@ -127,7 +106,6 @@ class Unsigned_TestCase(unittest.TestCase):
self.assertEqual(0, getargs_I(UINT_MAX+1))
self.assertEqual(42, getargs_I(42))
- self.assertEqual(42, getargs_I(42))
self.assertEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE))
@@ -136,7 +114,6 @@ class Unsigned_TestCase(unittest.TestCase):
# k returns 'unsigned long', no range checking
# it does not accept float, or instances with __int__
self.assertRaises(TypeError, getargs_k, 3.14)
- self.assertRaises(TypeError, getargs_k, Long())
self.assertRaises(TypeError, getargs_k, Int())
self.assertEqual(ULONG_MAX, getargs_k(-1))
@@ -145,16 +122,28 @@ class Unsigned_TestCase(unittest.TestCase):
self.assertEqual(0, getargs_k(ULONG_MAX+1))
self.assertEqual(42, getargs_k(42))
- self.assertEqual(42, getargs_k(42))
self.assertEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE))
class Signed_TestCase(unittest.TestCase):
+ def test_h(self):
+ from _testcapi import getargs_h
+ # h returns 'short', and does range checking (SHRT_MIN ... SHRT_MAX)
+ self.assertRaises(TypeError, getargs_h, 3.14)
+ self.assertEqual(99, getargs_h(Int()))
+
+ self.assertRaises(OverflowError, getargs_h, SHRT_MIN-1)
+ self.assertEqual(SHRT_MIN, getargs_h(SHRT_MIN))
+ self.assertEqual(SHRT_MAX, getargs_h(SHRT_MAX))
+ self.assertRaises(OverflowError, getargs_h, SHRT_MAX+1)
+
+ self.assertEqual(42, getargs_h(42))
+ self.assertRaises(OverflowError, getargs_h, VERY_LARGE)
+
def test_i(self):
from _testcapi import getargs_i
# i returns 'int', and does range checking (INT_MIN ... INT_MAX)
self.assertRaises(TypeError, getargs_i, 3.14)
- self.assertEqual(99, getargs_i(Long()))
self.assertEqual(99, getargs_i(Int()))
self.assertRaises(OverflowError, getargs_i, INT_MIN-1)
@@ -163,14 +152,12 @@ class Signed_TestCase(unittest.TestCase):
self.assertRaises(OverflowError, getargs_i, INT_MAX+1)
self.assertEqual(42, getargs_i(42))
- self.assertEqual(42, getargs_i(42))
self.assertRaises(OverflowError, getargs_i, VERY_LARGE)
def test_l(self):
from _testcapi import getargs_l
# l returns 'long', and does range checking (LONG_MIN ... LONG_MAX)
self.assertRaises(TypeError, getargs_l, 3.14)
- self.assertEqual(99, getargs_l(Long()))
self.assertEqual(99, getargs_l(Int()))
self.assertRaises(OverflowError, getargs_l, LONG_MIN-1)
@@ -179,7 +166,6 @@ class Signed_TestCase(unittest.TestCase):
self.assertRaises(OverflowError, getargs_l, LONG_MAX+1)
self.assertEqual(42, getargs_l(42))
- self.assertEqual(42, getargs_l(42))
self.assertRaises(OverflowError, getargs_l, VERY_LARGE)
def test_n(self):
@@ -187,7 +173,6 @@ class Signed_TestCase(unittest.TestCase):
# n returns 'Py_ssize_t', and does range checking
# (PY_SSIZE_T_MIN ... PY_SSIZE_T_MAX)
self.assertRaises(TypeError, getargs_n, 3.14)
- self.assertRaises(TypeError, getargs_n, Long())
self.assertRaises(TypeError, getargs_n, Int())
self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MIN-1)
@@ -196,17 +181,16 @@ class Signed_TestCase(unittest.TestCase):
self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MAX+1)
self.assertEqual(42, getargs_n(42))
- self.assertEqual(42, getargs_n(42))
self.assertRaises(OverflowError, getargs_n, VERY_LARGE)
class LongLong_TestCase(unittest.TestCase):
def test_L(self):
from _testcapi import getargs_L
- # L returns 'long long', and does range checking (LLONG_MIN ... LLONG_MAX)
+ # L returns 'long long', and does range checking (LLONG_MIN
+ # ... LLONG_MAX)
+ self.assertRaises(TypeError, getargs_L, 3.14)
self.assertRaises(TypeError, getargs_L, "Hello")
- self.assertEqual(3, getargs_L(3.14))
- self.assertEqual(99, getargs_L(Long()))
self.assertEqual(99, getargs_L(Int()))
self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1)
@@ -215,21 +199,18 @@ class LongLong_TestCase(unittest.TestCase):
self.assertRaises(OverflowError, getargs_L, LLONG_MAX+1)
self.assertEqual(42, getargs_L(42))
- self.assertEqual(42, getargs_L(42))
self.assertRaises(OverflowError, getargs_L, VERY_LARGE)
def test_K(self):
from _testcapi import getargs_K
# K return 'unsigned long long', no range checking
self.assertRaises(TypeError, getargs_K, 3.14)
- self.assertRaises(TypeError, getargs_K, Long())
self.assertRaises(TypeError, getargs_K, Int())
self.assertEqual(ULLONG_MAX, getargs_K(ULLONG_MAX))
self.assertEqual(0, getargs_K(0))
self.assertEqual(0, getargs_K(ULLONG_MAX+1))
self.assertEqual(42, getargs_K(42))
- self.assertEqual(42, getargs_K(42))
self.assertEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE))
@@ -256,24 +237,28 @@ class Keywords_TestCase(unittest.TestCase):
getargs_keywords((1,2), 3, (4,(5,6)), (7,8,9), 10),
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
)
+
def test_mixed_args(self):
# positional and keyword args
self.assertEqual(
getargs_keywords((1,2), 3, (4,(5,6)), arg4=(7,8,9), arg5=10),
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
)
+
def test_keyword_args(self):
# all keywords
self.assertEqual(
getargs_keywords(arg1=(1,2), arg2=3, arg3=(4,(5,6)), arg4=(7,8,9), arg5=10),
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
)
+
def test_optional_args(self):
# missing optional keyword args, skipping tuples
self.assertEqual(
getargs_keywords(arg1=(1,2), arg2=3, arg5=10),
(1, 2, 3, -1, -1, -1, -1, -1, -1, 10)
)
+
def test_required_args(self):
# required arg missing
try:
@@ -282,6 +267,7 @@ class Keywords_TestCase(unittest.TestCase):
self.assertEqual(str(err), "Required argument 'arg2' (pos 2) not found")
else:
self.fail('TypeError should have been raised')
+
def test_too_many_args(self):
try:
getargs_keywords((1,2),3,(4,(5,6)),(7,8,9),10,111)
@@ -289,6 +275,7 @@ class Keywords_TestCase(unittest.TestCase):
self.assertEqual(str(err), "function takes at most 5 arguments (6 given)")
else:
self.fail('TypeError should have been raised')
+
def test_invalid_keyword(self):
# extraneous keyword arg
try:
@@ -298,8 +285,156 @@ class Keywords_TestCase(unittest.TestCase):
else:
self.fail('TypeError should have been raised')
+ def test_surrogate_keyword(self):
+ try:
+ getargs_keywords((1,2), 3, (4,(5,6)), (7,8,9), **{'\uDC80': 10})
+ except TypeError as err:
+ self.assertEqual(str(err), "'\udc80' is an invalid keyword argument for this function")
+ else:
+ self.fail('TypeError should have been raised')
+
+class Bytes_TestCase(unittest.TestCase):
+ def test_s(self):
+ from _testcapi import getargs_s
+ self.assertEqual(getargs_s('abc\xe9'), b'abc\xc3\xa9')
+ self.assertRaises(TypeError, getargs_s, 'nul:\0')
+ self.assertRaises(TypeError, getargs_s, b'bytes')
+ self.assertRaises(TypeError, getargs_s, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_s, memoryview(b'memoryview'))
+ self.assertRaises(TypeError, getargs_s, None)
+
+ def test_s_star(self):
+ from _testcapi import getargs_s_star
+ self.assertEqual(getargs_s_star('abc\xe9'), b'abc\xc3\xa9')
+ self.assertEqual(getargs_s_star('nul:\0'), b'nul:\0')
+ self.assertEqual(getargs_s_star(b'bytes'), b'bytes')
+ self.assertEqual(getargs_s_star(bytearray(b'bytearray')), b'bytearray')
+ self.assertEqual(getargs_s_star(memoryview(b'memoryview')), b'memoryview')
+ self.assertRaises(TypeError, getargs_s_star, None)
+
+ def test_s_hash(self):
+ from _testcapi import getargs_s_hash
+ self.assertEqual(getargs_s_hash('abc\xe9'), b'abc\xc3\xa9')
+ self.assertEqual(getargs_s_hash('nul:\0'), b'nul:\0')
+ self.assertEqual(getargs_s_hash(b'bytes'), b'bytes')
+ self.assertRaises(TypeError, getargs_s_hash, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_s_hash, memoryview(b'memoryview'))
+ self.assertRaises(TypeError, getargs_s_hash, None)
+
+ def test_z(self):
+ from _testcapi import getargs_z
+ self.assertEqual(getargs_z('abc\xe9'), b'abc\xc3\xa9')
+ self.assertRaises(TypeError, getargs_z, 'nul:\0')
+ self.assertRaises(TypeError, getargs_z, b'bytes')
+ self.assertRaises(TypeError, getargs_z, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_z, memoryview(b'memoryview'))
+ self.assertIsNone(getargs_z(None))
+
+ def test_z_star(self):
+ from _testcapi import getargs_z_star
+ self.assertEqual(getargs_z_star('abc\xe9'), b'abc\xc3\xa9')
+ self.assertEqual(getargs_z_star('nul:\0'), b'nul:\0')
+ self.assertEqual(getargs_z_star(b'bytes'), b'bytes')
+ self.assertEqual(getargs_z_star(bytearray(b'bytearray')), b'bytearray')
+ self.assertEqual(getargs_z_star(memoryview(b'memoryview')), b'memoryview')
+ self.assertIsNone(getargs_z_star(None))
+
+ def test_z_hash(self):
+ from _testcapi import getargs_z_hash
+ self.assertEqual(getargs_z_hash('abc\xe9'), b'abc\xc3\xa9')
+ self.assertEqual(getargs_z_hash('nul:\0'), b'nul:\0')
+ self.assertEqual(getargs_z_hash(b'bytes'), b'bytes')
+ self.assertRaises(TypeError, getargs_z_hash, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_z_hash, memoryview(b'memoryview'))
+ self.assertIsNone(getargs_z_hash(None))
+
+ def test_y(self):
+ from _testcapi import getargs_y
+ self.assertRaises(TypeError, getargs_y, 'abc\xe9')
+ self.assertEqual(getargs_y(b'bytes'), b'bytes')
+ self.assertRaises(TypeError, getargs_y, b'nul:\0')
+ self.assertRaises(TypeError, getargs_y, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_y, memoryview(b'memoryview'))
+ self.assertRaises(TypeError, getargs_y, None)
+
+ def test_y_star(self):
+ from _testcapi import getargs_y_star
+ self.assertRaises(TypeError, getargs_y_star, 'abc\xe9')
+ self.assertEqual(getargs_y_star(b'bytes'), b'bytes')
+ self.assertEqual(getargs_y_star(b'nul:\0'), b'nul:\0')
+ self.assertEqual(getargs_y_star(bytearray(b'bytearray')), b'bytearray')
+ self.assertEqual(getargs_y_star(memoryview(b'memoryview')), b'memoryview')
+ self.assertRaises(TypeError, getargs_y_star, None)
+
+ def test_y_hash(self):
+ from _testcapi import getargs_y_hash
+ self.assertRaises(TypeError, getargs_y_hash, 'abc\xe9')
+ self.assertEqual(getargs_y_hash(b'bytes'), b'bytes')
+ self.assertEqual(getargs_y_hash(b'nul:\0'), b'nul:\0')
+ self.assertRaises(TypeError, getargs_y_hash, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_y_hash, memoryview(b'memoryview'))
+ self.assertRaises(TypeError, getargs_y_hash, None)
+
+ def test_w_star(self):
+ # getargs_w_star() modifies first and last byte
+ from _testcapi import getargs_w_star
+ self.assertRaises(TypeError, getargs_w_star, 'abc\xe9')
+ self.assertRaises(TypeError, getargs_w_star, b'bytes')
+ self.assertRaises(TypeError, getargs_w_star, b'nul:\0')
+ self.assertRaises(TypeError, getargs_w_star, memoryview(b'bytes'))
+ self.assertEqual(getargs_w_star(bytearray(b'bytearray')), b'[ytearra]')
+ self.assertEqual(getargs_w_star(memoryview(bytearray(b'memoryview'))),
+ b'[emoryvie]')
+ self.assertRaises(TypeError, getargs_w_star, None)
+
+
+class Unicode_TestCase(unittest.TestCase):
+ def test_u(self):
+ from _testcapi import getargs_u
+ self.assertEqual(getargs_u('abc\xe9'), 'abc\xe9')
+ self.assertRaises(TypeError, getargs_u, 'nul:\0')
+ self.assertRaises(TypeError, getargs_u, b'bytes')
+ self.assertRaises(TypeError, getargs_u, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_u, memoryview(b'memoryview'))
+ self.assertRaises(TypeError, getargs_u, None)
+
+ def test_u_hash(self):
+ from _testcapi import getargs_u_hash
+ self.assertEqual(getargs_u_hash('abc\xe9'), 'abc\xe9')
+ self.assertEqual(getargs_u_hash('nul:\0'), 'nul:\0')
+ self.assertRaises(TypeError, getargs_u_hash, b'bytes')
+ self.assertRaises(TypeError, getargs_u_hash, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_u_hash, memoryview(b'memoryview'))
+ self.assertRaises(TypeError, getargs_u_hash, None)
+
+ def test_Z(self):
+ from _testcapi import getargs_Z
+ self.assertEqual(getargs_Z('abc\xe9'), 'abc\xe9')
+ self.assertRaises(TypeError, getargs_Z, 'nul:\0')
+ self.assertRaises(TypeError, getargs_Z, b'bytes')
+ self.assertRaises(TypeError, getargs_Z, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_Z, memoryview(b'memoryview'))
+ self.assertIsNone(getargs_Z(None))
+
+ def test_Z_hash(self):
+ from _testcapi import getargs_Z_hash
+ self.assertEqual(getargs_Z_hash('abc\xe9'), 'abc\xe9')
+ self.assertEqual(getargs_Z_hash('nul:\0'), 'nul:\0')
+ self.assertRaises(TypeError, getargs_Z_hash, b'bytes')
+ self.assertRaises(TypeError, getargs_Z_hash, bytearray(b'bytearray'))
+ self.assertRaises(TypeError, getargs_Z_hash, memoryview(b'memoryview'))
+ self.assertIsNone(getargs_Z_hash(None))
+
+
def test_main():
- tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase, Keywords_TestCase]
+ tests = [
+ Signed_TestCase,
+ Unsigned_TestCase,
+ Tuple_TestCase,
+ Keywords_TestCase,
+ Bytes_TestCase,
+ Unicode_TestCase,
+ ]
try:
from _testcapi import getargs_L, getargs_K
except ImportError:
diff --git a/Lib/test/test_getopt.py b/Lib/test/test_getopt.py
index 0f47fcb38d..fa5701f310 100644
--- a/Lib/test/test_getopt.py
+++ b/Lib/test/test_getopt.py
@@ -5,7 +5,6 @@ from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard
import unittest
import getopt
-import os
sentinel = object()
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
index f92d30480c..1560a6bbf0 100644
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -1,5 +1,5 @@
import unittest
-from test.support import run_unittest, TESTFN
+from test.support import run_unittest, TESTFN, skip_unless_symlink, can_symlink
import glob
import os
import shutil
@@ -25,7 +25,7 @@ class GlobTests(unittest.TestCase):
self.mktemp('ZZZ')
self.mktemp('a', 'bcd', 'EF')
self.mktemp('a', 'bcd', 'efg', 'ha')
- if hasattr(os, 'symlink'):
+ if can_symlink():
os.symlink(self.norm('broken'), self.norm('sym1'))
os.symlink(self.norm('broken'), self.norm('sym2'))
@@ -96,14 +96,14 @@ class GlobTests(unittest.TestCase):
res = glob.glob(self.tempdir + '*' + os.sep)
self.assertEqual(len(res), 1)
# either of these results are reasonable
- self.assertTrue(res[0] in [self.tempdir, self.tempdir + os.sep])
+ self.assertIn(res[0], [self.tempdir, self.tempdir + os.sep])
+ @skip_unless_symlink
def test_glob_broken_symlinks(self):
- if hasattr(os, 'symlink'):
- eq = self.assertSequencesEqual_noorder
- eq(self.glob('sym*'), [self.norm('sym1'), self.norm('sym2')])
- eq(self.glob('sym1'), [self.norm('sym1')])
- eq(self.glob('sym2'), [self.norm('sym2')])
+ eq = self.assertSequencesEqual_noorder
+ eq(self.glob('sym*'), [self.norm('sym1'), self.norm('sym2')])
+ eq(self.glob('sym1'), [self.norm('sym1')])
+ eq(self.glob('sym2'), [self.norm('sym2')])
def test_main():
diff --git a/Lib/test/test_global.py b/Lib/test/test_global.py
index 823f2c544d..37ec67255a 100644
--- a/Lib/test/test_global.py
+++ b/Lib/test/test_global.py
@@ -1,13 +1,21 @@
"""Verify that warnings are issued for global statements following use."""
-from test.support import run_unittest, check_syntax_error
+from test.support import run_unittest, check_syntax_error, check_warnings
import unittest
-
import warnings
-warnings.filterwarnings("error", module="<test string>")
+
class GlobalTests(unittest.TestCase):
+ def setUp(self):
+ self._warnings_manager = check_warnings()
+ self._warnings_manager.__enter__()
+ warnings.filterwarnings("error", module="<test string>")
+
+ def tearDown(self):
+ self._warnings_manager.__exit__(None, None, None)
+
+
def test1(self):
prog_text_1 = """\
def wrong1():
@@ -45,7 +53,9 @@ x = 2
def test_main():
- run_unittest(GlobalTests)
+ with warnings.catch_warnings():
+ warnings.filterwarnings("error", module="<test string>")
+ run_unittest(GlobalTests)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index df224fd330..329b25807f 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -1,19 +1,13 @@
# Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
-# NOTE: When you run this test as a script from the command line, you
-# get warnings about certain hex/oct constants. Since those are
-# issued by the parser, you can't suppress them by adding a
-# filterwarnings() call to this module. Therefore, to shut up the
-# regression test, the filterwarnings() call has been added to
-# regrtest.py.
-
from test.support import run_unittest, check_syntax_error
import unittest
import sys
# testing import *
from sys import *
+
class TokenTests(unittest.TestCase):
def testBackslash(self):
@@ -307,12 +301,12 @@ class GrammarTests(unittest.TestCase):
self.assertEqual(f.__annotations__, {'b': 1, 'c': 2})
def f(a, b:1, c:2, d, e:3=4, f=5, *g:6): pass
self.assertEqual(f.__annotations__,
- {'b': 1, 'c': 2, 'e': 3, 'g': 6})
+ {'b': 1, 'c': 2, 'e': 3, 'g': 6})
def f(a, b:1, c:2, d, e:3=4, f=5, *g:6, h:7, i=8, j:9=10,
**k:11) -> 12: pass
self.assertEqual(f.__annotations__,
- {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9,
- 'k': 11, 'return': 12})
+ {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9,
+ 'k': 11, 'return': 12})
# Check for SF Bug #1697248 - mixing decorators and a return annotation
def null(x): return x
@null
@@ -915,6 +909,14 @@ class GrammarTests(unittest.TestCase):
self.assertEqual((6 / 2 if 1 else 3), 3)
self.assertEqual((6 < 4 if 0 else 2), 2)
+ def test_paren_evaluation(self):
+ self.assertEqual(16 // (4 // 2), 8)
+ self.assertEqual((16 // 4) // 2, 2)
+ self.assertEqual(16 // 4 // 2, 2)
+ self.assertTrue(False is (2 is 3))
+ self.assertFalse((False is 2) is 3)
+ self.assertFalse(False is 2 is 3)
+
def test_main():
run_unittest(TokenTests, GrammarTests)
diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py
index 8acc97c638..04a8af6ac9 100755..100644
--- a/Lib/test/test_grp.py
+++ b/Lib/test/test_grp.py
@@ -12,13 +12,13 @@ class GroupDatabaseTestCase(unittest.TestCase):
# attributes promised by the docs
self.assertEqual(len(value), 4)
self.assertEqual(value[0], value.gr_name)
- self.assertTrue(isinstance(value.gr_name, str))
+ self.assertIsInstance(value.gr_name, str)
self.assertEqual(value[1], value.gr_passwd)
- self.assertTrue(isinstance(value.gr_passwd, str))
+ self.assertIsInstance(value.gr_passwd, str)
self.assertEqual(value[2], value.gr_gid)
- self.assertTrue(isinstance(value.gr_gid, int))
+ self.assertIsInstance(value.gr_gid, int)
self.assertEqual(value[3], value.gr_mem)
- self.assertTrue(isinstance(value.gr_mem, list))
+ self.assertIsInstance(value.gr_mem, list)
def test_values(self):
entries = grp.getgrall()
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index b9923840e1..2b0ac36c23 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -1,13 +1,13 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Test script for the gzip module.
"""
import unittest
from test import support
import os
-import gzip
+import io
import struct
-
+gzip = support.import_module('gzip')
data1 = b""" int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
@@ -22,6 +22,17 @@ data2 = b"""/* zlibmodule.c -- gzip-compatible data compression */
"""
+class UnseekableIO(io.BytesIO):
+ def seekable(self):
+ return False
+
+ def tell(self):
+ raise io.UnsupportedOperation
+
+ def seek(self, *args):
+ raise io.UnsupportedOperation
+
+
class TestGzip(unittest.TestCase):
filename = support.TESTFN
@@ -33,14 +44,15 @@ class TestGzip(unittest.TestCase):
def test_write(self):
- f = gzip.GzipFile(self.filename, 'wb') ; f.write(data1 * 50)
+ with gzip.GzipFile(self.filename, 'wb') as f:
+ f.write(data1 * 50)
- # Try flush and fileno.
- f.flush()
- f.fileno()
- if hasattr(os, 'fsync'):
- os.fsync(f.fileno())
- f.close()
+ # Try flush and fileno.
+ f.flush()
+ f.fileno()
+ if hasattr(os, 'fsync'):
+ os.fsync(f.fileno())
+ f.close()
# Test multiple close() calls.
f.close()
@@ -48,7 +60,8 @@ class TestGzip(unittest.TestCase):
def test_read(self):
self.test_write()
# Try reading.
- f = gzip.GzipFile(self.filename, 'r') ; d = f.read() ; f.close()
+ with gzip.GzipFile(self.filename, 'r') as f:
+ d = f.read()
self.assertEqual(d, data1*50)
def test_io_on_closed_object(self):
@@ -76,173 +89,174 @@ class TestGzip(unittest.TestCase):
def test_append(self):
self.test_write()
# Append to the previous file
- f = gzip.GzipFile(self.filename, 'ab') ; f.write(data2 * 15) ; f.close()
+ with gzip.GzipFile(self.filename, 'ab') as f:
+ f.write(data2 * 15)
- f = gzip.GzipFile(self.filename, 'rb') ; d = f.read() ; f.close()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ d = f.read()
self.assertEqual(d, (data1*50) + (data2*15))
def test_many_append(self):
# Bug #1074261 was triggered when reading a file that contained
# many, many members. Create such a file and verify that reading it
# works.
- f = gzip.open(self.filename, 'wb', 9)
- f.write(b'a')
- f.close()
- for i in range(0, 200):
- f = gzip.open(self.filename, "ab", 9) # append
+ with gzip.open(self.filename, 'wb', 9) as f:
f.write(b'a')
- f.close()
+ for i in range(0, 200):
+ with gzip.open(self.filename, "ab", 9) as f: # append
+ f.write(b'a')
# Try reading the file
- zgfile = gzip.open(self.filename, "rb")
- contents = b""
- while 1:
- ztxt = zgfile.read(8192)
- contents += ztxt
- if not ztxt: break
- zgfile.close()
+ with gzip.open(self.filename, "rb") as zgfile:
+ contents = b""
+ while 1:
+ ztxt = zgfile.read(8192)
+ contents += ztxt
+ if not ztxt: break
self.assertEqual(contents, b'a'*201)
+ def test_buffered_reader(self):
+ # Issue #7471: a GzipFile can be wrapped in a BufferedReader for
+ # performance.
+ self.test_write()
+
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ with io.BufferedReader(f) as r:
+ lines = [line for line in r]
+
+ self.assertEqual(lines, 50 * data1.splitlines(True))
def test_readline(self):
self.test_write()
# Try .readline() with varying line lengths
- f = gzip.GzipFile(self.filename, 'rb')
- line_length = 0
- while 1:
- L = f.readline(line_length)
- if not L and line_length != 0: break
- self.assertTrue(len(L) <= line_length)
- line_length = (line_length + 1) % 50
- f.close()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ line_length = 0
+ while 1:
+ L = f.readline(line_length)
+ if not L and line_length != 0: break
+ self.assertTrue(len(L) <= line_length)
+ line_length = (line_length + 1) % 50
def test_readlines(self):
self.test_write()
# Try .readlines()
- f = gzip.GzipFile(self.filename, 'rb')
- L = f.readlines()
- f.close()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ L = f.readlines()
- f = gzip.GzipFile(self.filename, 'rb')
- while 1:
- L = f.readlines(150)
- if L == []: break
- f.close()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ while 1:
+ L = f.readlines(150)
+ if L == []: break
def test_seek_read(self):
self.test_write()
# Try seek, read test
- f = gzip.GzipFile(self.filename)
- while 1:
- oldpos = f.tell()
- line1 = f.readline()
- if not line1: break
- newpos = f.tell()
- f.seek(oldpos) # negative seek
- if len(line1)>10:
- amount = 10
- else:
- amount = len(line1)
- line2 = f.read(amount)
- self.assertEqual(line1[:amount], line2)
- f.seek(newpos) # positive seek
- f.close()
+ with gzip.GzipFile(self.filename) as f:
+ while 1:
+ oldpos = f.tell()
+ line1 = f.readline()
+ if not line1: break
+ newpos = f.tell()
+ f.seek(oldpos) # negative seek
+ if len(line1)>10:
+ amount = 10
+ else:
+ amount = len(line1)
+ line2 = f.read(amount)
+ self.assertEqual(line1[:amount], line2)
+ f.seek(newpos) # positive seek
def test_seek_whence(self):
self.test_write()
# Try seek(whence=1), read test
- f = gzip.GzipFile(self.filename)
- f.read(10)
- f.seek(10, whence=1)
- y = f.read(10)
- f.close()
+ with gzip.GzipFile(self.filename) as f:
+ f.read(10)
+ f.seek(10, whence=1)
+ y = f.read(10)
self.assertEqual(y, data1[20:30])
def test_seek_write(self):
# Try seek, write test
- f = gzip.GzipFile(self.filename, 'w')
- for pos in range(0, 256, 16):
- f.seek(pos)
- f.write(b'GZ\n')
- f.close()
+ with gzip.GzipFile(self.filename, 'w') as f:
+ for pos in range(0, 256, 16):
+ f.seek(pos)
+ f.write(b'GZ\n')
def test_mode(self):
self.test_write()
- f = gzip.GzipFile(self.filename, 'r')
- self.assertEqual(f.myfileobj.mode, 'rb')
- f.close()
+ with gzip.GzipFile(self.filename, 'r') as f:
+ self.assertEqual(f.myfileobj.mode, 'rb')
def test_1647484(self):
for mode in ('wb', 'rb'):
- f = gzip.GzipFile(self.filename, mode)
- self.assertTrue(hasattr(f, "name"))
- self.assertEqual(f.name, self.filename)
- f.close()
+ with gzip.GzipFile(self.filename, mode) as f:
+ self.assertTrue(hasattr(f, "name"))
+ self.assertEqual(f.name, self.filename)
+
+ def test_paddedfile_getattr(self):
+ self.test_write()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ self.assertTrue(hasattr(f.fileobj, "name"))
+ self.assertEqual(f.fileobj.name, self.filename)
def test_mtime(self):
mtime = 123456789
- fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime)
- fWrite.write(data1)
- fWrite.close()
- fRead = gzip.GzipFile(self.filename)
- dataRead = fRead.read()
- self.assertEqual(dataRead, data1)
- self.assertTrue(hasattr(fRead, 'mtime'))
- self.assertEqual(fRead.mtime, mtime)
- fRead.close()
+ with gzip.GzipFile(self.filename, 'w', mtime = mtime) as fWrite:
+ fWrite.write(data1)
+ with gzip.GzipFile(self.filename) as fRead:
+ dataRead = fRead.read()
+ self.assertEqual(dataRead, data1)
+ self.assertTrue(hasattr(fRead, 'mtime'))
+ self.assertEqual(fRead.mtime, mtime)
def test_metadata(self):
mtime = 123456789
- fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime)
- fWrite.write(data1)
- fWrite.close()
-
- fRead = open(self.filename, 'rb')
+ with gzip.GzipFile(self.filename, 'w', mtime = mtime) as fWrite:
+ fWrite.write(data1)
- # see RFC 1952: http://www.faqs.org/rfcs/rfc1952.html
+ with open(self.filename, 'rb') as fRead:
+ # see RFC 1952: http://www.faqs.org/rfcs/rfc1952.html
- idBytes = fRead.read(2)
- self.assertEqual(idBytes, b'\x1f\x8b') # gzip ID
+ idBytes = fRead.read(2)
+ self.assertEqual(idBytes, b'\x1f\x8b') # gzip ID
- cmByte = fRead.read(1)
- self.assertEqual(cmByte, b'\x08') # deflate
+ cmByte = fRead.read(1)
+ self.assertEqual(cmByte, b'\x08') # deflate
- flagsByte = fRead.read(1)
- self.assertEqual(flagsByte, b'\x08') # only the FNAME flag is set
+ flagsByte = fRead.read(1)
+ self.assertEqual(flagsByte, b'\x08') # only the FNAME flag is set
- mtimeBytes = fRead.read(4)
- self.assertEqual(mtimeBytes, struct.pack('<i', mtime)) # little-endian
+ mtimeBytes = fRead.read(4)
+ self.assertEqual(mtimeBytes, struct.pack('<i', mtime)) # little-endian
- xflByte = fRead.read(1)
- self.assertEqual(xflByte, b'\x02') # maximum compression
+ xflByte = fRead.read(1)
+ self.assertEqual(xflByte, b'\x02') # maximum compression
- osByte = fRead.read(1)
- self.assertEqual(osByte, b'\xff') # OS "unknown" (OS-independent)
+ osByte = fRead.read(1)
+ self.assertEqual(osByte, b'\xff') # OS "unknown" (OS-independent)
- # Since the FNAME flag is set, the zero-terminated filename follows.
- # RFC 1952 specifies that this is the name of the input file, if any.
- # However, the gzip module defaults to storing the name of the output
- # file in this field.
- expected = self.filename.encode('Latin-1') + b'\x00'
- nameBytes = fRead.read(len(expected))
- self.assertEqual(nameBytes, expected)
+ # Since the FNAME flag is set, the zero-terminated filename follows.
+ # RFC 1952 specifies that this is the name of the input file, if any.
+ # However, the gzip module defaults to storing the name of the output
+ # file in this field.
+ expected = self.filename.encode('Latin-1') + b'\x00'
+ nameBytes = fRead.read(len(expected))
+ self.assertEqual(nameBytes, expected)
- # Since no other flags were set, the header ends here.
- # Rather than process the compressed data, let's seek to the trailer.
- fRead.seek(os.stat(self.filename).st_size - 8)
+ # Since no other flags were set, the header ends here.
+ # Rather than process the compressed data, let's seek to the trailer.
+ fRead.seek(os.stat(self.filename).st_size - 8)
- crc32Bytes = fRead.read(4) # CRC32 of uncompressed data [data1]
- self.assertEqual(crc32Bytes, b'\xaf\xd7d\x83')
+ crc32Bytes = fRead.read(4) # CRC32 of uncompressed data [data1]
+ self.assertEqual(crc32Bytes, b'\xaf\xd7d\x83')
- isizeBytes = fRead.read(4)
- self.assertEqual(isizeBytes, struct.pack('<i', len(data1)))
-
- fRead.close()
+ isizeBytes = fRead.read(4)
+ self.assertEqual(isizeBytes, struct.pack('<i', len(data1)))
def test_with_open(self):
# GzipFile supports the context management protocol
@@ -265,6 +279,70 @@ class TestGzip(unittest.TestCase):
else:
self.fail("1/0 didn't raise an exception")
+ def test_zero_padded_file(self):
+ with gzip.GzipFile(self.filename, "wb") as f:
+ f.write(data1 * 50)
+
+ # Pad the file with zeroes
+ with open(self.filename, "ab") as f:
+ f.write(b"\x00" * 50)
+
+ with gzip.GzipFile(self.filename, "rb") as f:
+ d = f.read()
+ self.assertEqual(d, data1 * 50, "Incorrect data in file")
+
+ def test_non_seekable_file(self):
+ uncompressed = data1 * 50
+ buf = UnseekableIO()
+ with gzip.GzipFile(fileobj=buf, mode="wb") as f:
+ f.write(uncompressed)
+ compressed = buf.getvalue()
+ buf = UnseekableIO(compressed)
+ with gzip.GzipFile(fileobj=buf, mode="rb") as f:
+ self.assertEqual(f.read(), uncompressed)
+
+ def test_peek(self):
+ uncompressed = data1 * 200
+ with gzip.GzipFile(self.filename, "wb") as f:
+ f.write(uncompressed)
+
+ def sizes():
+ while True:
+ for n in range(5, 50, 10):
+ yield n
+
+ with gzip.GzipFile(self.filename, "rb") as f:
+ f.max_read_chunk = 33
+ nread = 0
+ for n in sizes():
+ s = f.peek(n)
+ if s == b'':
+ break
+ self.assertEqual(f.read(len(s)), s)
+ nread += len(s)
+ self.assertEqual(f.read(100), b'')
+ self.assertEqual(nread, len(uncompressed))
+
+ # Testing compress/decompress shortcut functions
+
+ def test_compress(self):
+ for data in [data1, data2]:
+ for args in [(), (1,), (6,), (9,)]:
+ datac = gzip.compress(data, *args)
+ self.assertEqual(type(datac), bytes)
+ with gzip.GzipFile(fileobj=io.BytesIO(datac), mode="rb") as f:
+ self.assertEqual(f.read(), data)
+
+ def test_decompress(self):
+ for data in (data1, data2):
+ buf = io.BytesIO()
+ with gzip.GzipFile(fileobj=buf, mode="wb") as f:
+ f.write(data)
+ self.assertEqual(gzip.decompress(buf.getvalue()), data)
+ # Roundtrip with compress
+ datac = gzip.compress(data)
+ self.assertEqual(gzip.decompress(datac), data)
+
def test_main(verbose=None):
support.run_unittest(TestGzip)
diff --git a/Lib/test/test_hash.py b/Lib/test/test_hash.py
index 569e5e054c..fea1025e91 100644
--- a/Lib/test/test_hash.py
+++ b/Lib/test/test_hash.py
@@ -91,11 +91,11 @@ class HashInheritanceTestCase(unittest.TestCase):
objects = (self.default_expected +
self.fixed_expected)
for obj in objects:
- self.assertTrue(isinstance(obj, Hashable), repr(obj))
+ self.assertIsInstance(obj, Hashable)
def test_not_hashable(self):
for obj in self.error_expected:
- self.assertFalse(isinstance(obj, Hashable), repr(obj))
+ self.assertNotIsInstance(obj, Hashable)
# Issue #4701: Check that some builtin types are correctly hashable
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index dca23cf95a..fe316fdd39 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -6,16 +6,23 @@
# Licensed to PSF under a Contributor Agreement.
#
+import array
import hashlib
-from io import StringIO
+import itertools
+import sys
try:
import threading
except ImportError:
threading = None
import unittest
+import warnings
from test import support
from test.support import _4G, precisionbigmemtest
+# Were we compiled --with-pydebug or with #define Py_DEBUG?
+COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
+
+
def hexstr(s):
assert isinstance(s, bytes), repr(s)
h = "0123456789abcdef"
@@ -30,6 +37,79 @@ class HashLibTestCase(unittest.TestCase):
'sha224', 'SHA224', 'sha256', 'SHA256',
'sha384', 'SHA384', 'sha512', 'SHA512' )
+ _warn_on_extension_import = COMPILED_WITH_PYDEBUG
+
+ def _conditional_import_module(self, module_name):
+ """Import a module and return a reference to it or None on failure."""
+ try:
+ exec('import '+module_name)
+ except ImportError as error:
+ if self._warn_on_extension_import:
+ warnings.warn('Did a C extension fail to compile? %s' % error)
+ return locals().get(module_name)
+
+ def __init__(self, *args, **kwargs):
+ algorithms = set()
+ for algorithm in self.supported_hash_names:
+ algorithms.add(algorithm.lower())
+ self.constructors_to_test = {}
+ for algorithm in algorithms:
+ self.constructors_to_test[algorithm] = set()
+
+ # For each algorithm, test the direct constructor and the use
+ # of hashlib.new given the algorithm name.
+ for algorithm, constructors in self.constructors_to_test.items():
+ constructors.add(getattr(hashlib, algorithm))
+ def _test_algorithm_via_hashlib_new(data=None, _alg=algorithm):
+ if data is None:
+ return hashlib.new(_alg)
+ return hashlib.new(_alg, data)
+ constructors.add(_test_algorithm_via_hashlib_new)
+
+ _hashlib = self._conditional_import_module('_hashlib')
+ if _hashlib:
+ # These two algorithms should always be present when this module
+ # is compiled. If not, something was compiled wrong.
+ assert hasattr(_hashlib, 'openssl_md5')
+ assert hasattr(_hashlib, 'openssl_sha1')
+ for algorithm, constructors in self.constructors_to_test.items():
+ constructor = getattr(_hashlib, 'openssl_'+algorithm, None)
+ if constructor:
+ constructors.add(constructor)
+
+ _md5 = self._conditional_import_module('_md5')
+ if _md5:
+ self.constructors_to_test['md5'].add(_md5.md5)
+ _sha1 = self._conditional_import_module('_sha1')
+ if _sha1:
+ self.constructors_to_test['sha1'].add(_sha1.sha1)
+ _sha256 = self._conditional_import_module('_sha256')
+ if _sha256:
+ self.constructors_to_test['sha224'].add(_sha256.sha224)
+ self.constructors_to_test['sha256'].add(_sha256.sha256)
+ _sha512 = self._conditional_import_module('_sha512')
+ if _sha512:
+ self.constructors_to_test['sha384'].add(_sha512.sha384)
+ self.constructors_to_test['sha512'].add(_sha512.sha512)
+
+ super(HashLibTestCase, self).__init__(*args, **kwargs)
+
+ def test_hash_array(self):
+ a = array.array("b", range(10))
+ constructors = self.constructors_to_test.values()
+ for cons in itertools.chain.from_iterable(constructors):
+ c = cons(a)
+ c.hexdigest()
+
+ def test_algorithms_guaranteed(self):
+ self.assertEqual(hashlib.algorithms_guaranteed,
+ set(_algo for _algo in self.supported_hash_names
+ if _algo.islower()))
+
+ def test_algorithms_available(self):
+ self.assertTrue(set(hashlib.algorithms_guaranteed).
+ issubset(hashlib.algorithms_available))
+
def test_unknown_hash(self):
try:
hashlib.new('spam spam spam spam spam')
@@ -61,17 +141,23 @@ class HashLibTestCase(unittest.TestCase):
self.assertEqual(m1.digest(), m2.digest())
def check(self, name, data, digest):
- # test the direct constructors
- computed = getattr(hashlib, name)(data).hexdigest()
- self.assertEqual(computed, digest)
- # test the general new() interface
- computed = hashlib.new(name, data).hexdigest()
- self.assertEqual(computed, digest)
+ constructors = self.constructors_to_test[name]
+ # 2 is for hashlib.name(...) and hashlib.new(name, ...)
+ self.assertGreaterEqual(len(constructors), 2)
+ for hash_object_constructor in constructors:
+ computed = hash_object_constructor(data).hexdigest()
+ self.assertEqual(
+ computed, digest,
+ "Hash algorithm %s constructed using %s returned hexdigest"
+ " %r for %d byte input data that should have hashed to %r."
+ % (name, hash_object_constructor,
+ computed, len(data), digest))
def check_no_unicode(self, algorithm_name):
# Unicode objects are not allowed as input.
- self.assertRaises(TypeError, getattr(hashlib, algorithm_name), 'spam')
- self.assertRaises(TypeError, hashlib.new, algorithm_name, 'spam')
+ constructors = self.constructors_to_test[algorithm_name]
+ for hash_object_constructor in constructors:
+ self.assertRaises(TypeError, hash_object_constructor, 'spam')
def test_no_unicode(self):
self.check_no_unicode('md5')
@@ -229,10 +315,9 @@ class HashLibTestCase(unittest.TestCase):
m = hashlib.md5(b'x' * gil_minsize)
self.assertEqual(m.hexdigest(), 'cfb767f225d58469c5de3632a8803958')
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ @support.reap_threads
def test_threaded_hashing(self):
- if not threading:
- raise unittest.SkipTest('No threading module.')
-
# Updating the same hash object from several threads at once
# using data chunk sizes containing the same byte sequences.
#
@@ -267,7 +352,6 @@ class HashLibTestCase(unittest.TestCase):
self.assertEqual(expected_hash, hasher.hexdigest())
-@support.reap_threads
def test_main():
support.run_unittest(HashLibTestCase)
diff --git a/Lib/test/test_heapq.py b/Lib/test/test_heapq.py
index 5e3b0ee981..b41458bb53 100644
--- a/Lib/test/test_heapq.py
+++ b/Lib/test/test_heapq.py
@@ -211,12 +211,6 @@ class TestHeapC(TestHeap):
self.assertEqual(hsort(data, LT), target)
self.assertRaises(TypeError, data, LE)
- # As an early adopter, we sanity check the
- # test.support.import_fresh_module utility function
- def test_accelerated(self):
- self.assertTrue(sys.modules['heapq'] is self.module)
- self.assertFalse(hasattr(self.module.heapify, '__code__'))
-
#==============================================================================
@@ -319,16 +313,16 @@ class TestErrorHandling(unittest.TestCase):
def test_non_sequence(self):
for f in (self.module.heapify, self.module.heappop):
- self.assertRaises(TypeError, f, 10)
+ self.assertRaises((TypeError, AttributeError), f, 10)
for f in (self.module.heappush, self.module.heapreplace,
self.module.nlargest, self.module.nsmallest):
- self.assertRaises(TypeError, f, 10, 10)
+ self.assertRaises((TypeError, AttributeError), f, 10, 10)
def test_len_only(self):
for f in (self.module.heapify, self.module.heappop):
- self.assertRaises(TypeError, f, LenOnly())
+ self.assertRaises((TypeError, AttributeError), f, LenOnly())
for f in (self.module.heappush, self.module.heapreplace):
- self.assertRaises(TypeError, f, LenOnly(), 10)
+ self.assertRaises((TypeError, AttributeError), f, LenOnly(), 10)
for f in (self.module.nlargest, self.module.nsmallest):
self.assertRaises(TypeError, f, 2, LenOnly())
@@ -353,7 +347,7 @@ class TestErrorHandling(unittest.TestCase):
for f in (self.module.heapify, self.module.heappop,
self.module.heappush, self.module.heapreplace,
self.module.nlargest, self.module.nsmallest):
- self.assertRaises(TypeError, f, 10)
+ self.assertRaises((TypeError, AttributeError), f, 10)
def test_iterable_args(self):
for f in (self.module.nlargest, self.module.nsmallest):
@@ -370,8 +364,6 @@ class TestErrorHandling(unittest.TestCase):
def test_main(verbose=None):
- from types import BuiltinFunctionType
-
test_classes = [TestHeapPython, TestHeapC, TestErrorHandling]
support.run_unittest(*test_classes)
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index fb78eba552..4de0620e1a 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -213,19 +213,13 @@ class TestVectorsTestCase(unittest.TestCase):
with warnings.catch_warnings():
warnings.simplefilter('error', RuntimeWarning)
- try:
+ with self.assertRaises(RuntimeWarning):
hmac.HMAC(b'a', b'b', digestmod=MockCrazyHash)
- except RuntimeWarning:
- pass
- else:
self.fail('Expected warning about missing block_size')
MockCrazyHash.block_size = 1
- try:
+ with self.assertRaises(RuntimeWarning):
hmac.HMAC(b'a', b'b', digestmod=MockCrazyHash)
- except RuntimeWarning:
- pass
- else:
self.fail('Expected warning about small block_size')
diff --git a/Lib/test/test_html.py b/Lib/test/test_html.py
new file mode 100644
index 0000000000..30dac58e6d
--- /dev/null
+++ b/Lib/test/test_html.py
@@ -0,0 +1,24 @@
+"""
+Tests for the html module functions.
+"""
+
+import html
+import unittest
+from test.support import run_unittest
+
+
+class HtmlTests(unittest.TestCase):
+ def test_escape(self):
+ self.assertEqual(
+ html.escape('\'<script>"&foo;"</script>\''),
+ '&#x27;&lt;script&gt;&quot;&amp;foo;&quot;&lt;/script&gt;&#x27;')
+ self.assertEqual(
+ html.escape('\'<script>"&foo;"</script>\'', False),
+ '\'&lt;script&gt;"&amp;foo;"&lt;/script&gt;\'')
+
+
+def test_main():
+ run_unittest(HtmlTests)
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py
index 661d41dce9..637ab01f12 100755..100644
--- a/Lib/test/test_htmlparser.py
+++ b/Lib/test/test_htmlparser.py
@@ -8,10 +8,10 @@ from test import support
class EventCollector(html.parser.HTMLParser):
- def __init__(self):
+ def __init__(self, *args, **kw):
self.events = []
self.append = self.events.append
- html.parser.HTMLParser.__init__(self)
+ html.parser.HTMLParser.__init__(self, *args, **kw)
def get_events(self):
# Normalize the list of events so that buffer artefacts don't
@@ -72,8 +72,10 @@ class EventCollectorExtra(EventCollector):
class TestCaseBase(unittest.TestCase):
- def _run_check(self, source, expected_events, collector=EventCollector):
- parser = collector()
+ def _run_check(self, source, expected_events, collector=None):
+ if collector is None:
+ collector = EventCollector()
+ parser = collector
for s in source:
parser.feed(s)
parser.close()
@@ -84,7 +86,7 @@ class TestCaseBase(unittest.TestCase):
"\nReceived:\n" + pprint.pformat(events))
def _run_check_extra(self, source, events):
- self._run_check(source, events, EventCollectorExtra)
+ self._run_check(source, events, EventCollectorExtra())
def _parse_error(self, source):
def parse(source=source):
@@ -215,6 +217,23 @@ DOCTYPE html [
("starttag", "a", [("href", "mailto:xyz@example.com")]),
])
+ def test_attr_nonascii(self):
+ # see issue 7311
+ self._run_check("<img src=/foo/bar.png alt=\u4e2d\u6587>", [
+ ("starttag", "img", [("src", "/foo/bar.png"),
+ ("alt", "\u4e2d\u6587")]),
+ ])
+ self._run_check("<a title='\u30c6\u30b9\u30c8' "
+ "href='\u30c6\u30b9\u30c8.html'>", [
+ ("starttag", "a", [("title", "\u30c6\u30b9\u30c8"),
+ ("href", "\u30c6\u30b9\u30c8.html")]),
+ ])
+ self._run_check('<a title="\u30c6\u30b9\u30c8" '
+ 'href="\u30c6\u30b9\u30c8.html">', [
+ ("starttag", "a", [("title", "\u30c6\u30b9\u30c8"),
+ ("href", "\u30c6\u30b9\u30c8.html")]),
+ ])
+
def test_attr_entity_replacement(self):
self._run_check("""<a b='&amp;&gt;&lt;&quot;&apos;'>""", [
("starttag", "a", [("b", "&><\"'")]),
@@ -319,6 +338,41 @@ DOCTYPE html [
self._run_check("<html foo='&euro;&amp;&#97;&#x61;&unsupported;'>", [
("starttag", "html", [("foo", "\u20AC&aa&unsupported;")])
])
+
+
+class HTMLParserTolerantTestCase(TestCaseBase):
+
+ def setUp(self):
+ self.collector = EventCollector(strict=False)
+
+ def test_tolerant_parsing(self):
+ self._run_check('<html <html>te>>xt&a<<bc</a></html>\n'
+ '<img src="URL><//img></html</html>', [
+ ('data', '<html '),
+ ('starttag', 'html', []),
+ ('data', 'te>>xt'),
+ ('entityref', 'a'),
+ ('data', '<<bc'),
+ ('endtag', 'a'),
+ ('endtag', 'html'),
+ ('data', '\n<img src="URL><//img></html'),
+ ('endtag', 'html')],
+ collector = self.collector)
+
+ def test_comma_between_attributes(self):
+ self._run_check('<form action="/xxx.php?a=1&amp;b=2&amp", '
+ 'method="post">', [
+ ('starttag', 'form',
+ [('action', '/xxx.php?a=1&b=2&amp'),
+ ('method', 'post')])],
+ collector = self.collector)
+
+ def test_weird_chars_in_unquoted_attribute_values(self):
+ self._run_check('<form action=bogus|&#()value>', [
+ ('starttag', 'form',
+ [('action', 'bogus|&#()value')])],
+ collector = self.collector)
+
def test_unescape_function(self):
p = html.parser.HTMLParser()
self.assertEqual(p.unescape('&#bad;'),'&#bad;')
@@ -326,7 +380,7 @@ DOCTYPE html [
def test_main():
- support.run_unittest(HTMLParserTestCase)
+ support.run_unittest(HTMLParserTestCase, HTMLParserTolerantTestCase)
if __name__ == "__main__":
diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py
index 3e85f62f36..712a4ae639 100644
--- a/Lib/test/test_http_cookiejar.py
+++ b/Lib/test/test_http_cookiejar.py
@@ -29,7 +29,7 @@ class DateTimeTests(unittest.TestCase):
bz = time2isoz(500000)
for text in (az, bz):
self.assertTrue(re.search(r"^\d{4}-\d\d-\d\d \d\d:\d\d:\d\dZ$", text),
- "bad time2isoz format: %s %s" % (az, bz))
+ "bad time2isoz format: %s %s" % (az, bz))
def test_http2time(self):
def parse_date(text):
@@ -100,6 +100,7 @@ class DateTimeTests(unittest.TestCase):
class HeaderTests(unittest.TestCase):
+
def test_parse_ns_headers(self):
# quotes should be stripped
expected = [[('foo', 'bar'), ('expires', 2209069412), ('version', '0')]]
@@ -109,6 +110,16 @@ class HeaderTests(unittest.TestCase):
]:
self.assertEqual(parse_ns_headers([hdr]), expected)
+ def test_parse_ns_headers_version(self):
+
+ # quotes should be stripped
+ expected = [[('foo', 'bar'), ('version', '1')]]
+ for hdr in [
+ 'foo=bar; version="1"',
+ 'foo=bar; Version="1"',
+ ]:
+ self.assertEqual(parse_ns_headers([hdr]), expected)
+
def test_parse_ns_headers_special_names(self):
# names such as 'expires' are not special in first name=value pair
# of Set-Cookie: header
@@ -252,11 +263,11 @@ class FileCookieJarTests(unittest.TestCase):
# Invalid contents of cookies file (eg. bad magic string)
# causes a LoadError.
try:
- f = open(filename, "w")
- f.write("oops\n")
- for cookiejar_class in LWPCookieJar, MozillaCookieJar:
- c = cookiejar_class()
- self.assertRaises(LoadError, c.load, filename)
+ with open(filename, "w") as f:
+ f.write("oops\n")
+ for cookiejar_class in LWPCookieJar, MozillaCookieJar:
+ c = cookiejar_class()
+ self.assertRaises(LoadError, c.load, filename)
finally:
try: os.unlink(filename)
except OSError: pass
@@ -444,8 +455,8 @@ class CookieTests(unittest.TestCase):
interact_netscape(c, "http://www.acme.com/", 'version=eggs; spam=eggs')
cookies = c._cookies["www.acme.com"]["/"]
- self.assertTrue('expires' in cookies)
- self.assertTrue('version' in cookies)
+ self.assertIn('expires', cookies)
+ self.assertIn('version', cookies)
def test_expires(self):
# if expires is in future, keep cookie...
@@ -460,7 +471,8 @@ class CookieTests(unittest.TestCase):
now)
h = interact_netscape(c, "http://www.acme.com/")
self.assertEqual(len(c), 1)
- self.assertTrue('spam="bar"' in h and "foo" not in h)
+ self.assertIn('spam="bar"', h)
+ self.assertNotIn("foo", h)
# max-age takes precedence over expires, and zero max-age is request to
# delete both new cookie and any old matching cookie
@@ -481,7 +493,7 @@ class CookieTests(unittest.TestCase):
self.assertEqual(len(c), 2)
c.clear_session_cookies()
self.assertEqual(len(c), 1)
- self.assertTrue('spam="bar"' in h)
+ self.assertIn('spam="bar"', h)
# XXX RFC 2965 expiry rules (some apply to V0 too)
@@ -491,39 +503,39 @@ class CookieTests(unittest.TestCase):
c = CookieJar(pol)
interact_2965(c, "http://www.acme.com/", 'spam="bar"; Version="1"')
- self.assertTrue("/" in c._cookies["www.acme.com"])
+ self.assertIn("/", c._cookies["www.acme.com"])
c = CookieJar(pol)
interact_2965(c, "http://www.acme.com/blah", 'eggs="bar"; Version="1"')
- self.assertTrue("/" in c._cookies["www.acme.com"])
+ self.assertIn("/", c._cookies["www.acme.com"])
c = CookieJar(pol)
interact_2965(c, "http://www.acme.com/blah/rhubarb",
'eggs="bar"; Version="1"')
- self.assertTrue("/blah/" in c._cookies["www.acme.com"])
+ self.assertIn("/blah/", c._cookies["www.acme.com"])
c = CookieJar(pol)
interact_2965(c, "http://www.acme.com/blah/rhubarb/",
'eggs="bar"; Version="1"')
- self.assertTrue("/blah/rhubarb/" in c._cookies["www.acme.com"])
+ self.assertIn("/blah/rhubarb/", c._cookies["www.acme.com"])
# Netscape
c = CookieJar()
interact_netscape(c, "http://www.acme.com/", 'spam="bar"')
- self.assertTrue("/" in c._cookies["www.acme.com"])
+ self.assertIn("/", c._cookies["www.acme.com"])
c = CookieJar()
interact_netscape(c, "http://www.acme.com/blah", 'eggs="bar"')
- self.assertTrue("/" in c._cookies["www.acme.com"])
+ self.assertIn("/", c._cookies["www.acme.com"])
c = CookieJar()
interact_netscape(c, "http://www.acme.com/blah/rhubarb", 'eggs="bar"')
- self.assertTrue("/blah" in c._cookies["www.acme.com"])
+ self.assertIn("/blah", c._cookies["www.acme.com"])
c = CookieJar()
interact_netscape(c, "http://www.acme.com/blah/rhubarb/", 'eggs="bar"')
- self.assertTrue("/blah/rhubarb" in c._cookies["www.acme.com"])
+ self.assertIn("/blah/rhubarb", c._cookies["www.acme.com"])
def test_default_path_with_query(self):
cj = CookieJar()
@@ -566,7 +578,7 @@ class CookieTests(unittest.TestCase):
"http://www.example.com/rheum/rhaponticum;"
"foo=bar;sing=song?apples=pears&spam=eggs#ni")
self.assertEqual(request_path(req),
- "/rheum/rhaponticum;foo=bar;sing=song")
+ "/rheum/rhaponticum;foo=bar;sing=song")
# without parameters
req = urllib.request.Request(
"http://www.example.com/rheum/rhaponticum?"
@@ -889,21 +901,21 @@ class CookieTests(unittest.TestCase):
url = "http://foo.bar.com/"
interact_2965(c, url, "spam=eggs; Version=1")
h = interact_2965(c, url)
- self.assertTrue("Domain" not in h,
+ self.assertNotIn("Domain", h,
"absent domain returned with domain present")
c = CookieJar(pol)
url = "http://foo.bar.com/"
interact_2965(c, url, 'spam=eggs; Version=1; Domain=.bar.com')
h = interact_2965(c, url)
- self.assertTrue('$Domain=".bar.com"' in h, "domain not returned")
+ self.assertIn('$Domain=".bar.com"', h, "domain not returned")
c = CookieJar(pol)
url = "http://foo.bar.com/"
# note missing initial dot in Domain
interact_2965(c, url, 'spam=eggs; Version=1; Domain=bar.com')
h = interact_2965(c, url)
- self.assertTrue('$Domain="bar.com"' in h, "domain not returned")
+ self.assertIn('$Domain="bar.com"', h, "domain not returned")
def test_path_mirror(self):
pol = DefaultCookiePolicy(rfc2965=True)
@@ -912,14 +924,13 @@ class CookieTests(unittest.TestCase):
url = "http://foo.bar.com/"
interact_2965(c, url, "spam=eggs; Version=1")
h = interact_2965(c, url)
- self.assertTrue("Path" not in h,
- "absent path returned with path present")
+ self.assertNotIn("Path", h, "absent path returned with path present")
c = CookieJar(pol)
url = "http://foo.bar.com/"
interact_2965(c, url, 'spam=eggs; Version=1; Path=/')
h = interact_2965(c, url)
- self.assertTrue('$Path="/"' in h, "path not returned")
+ self.assertIn('$Path="/"', h, "path not returned")
def test_port_mirror(self):
pol = DefaultCookiePolicy(rfc2965=True)
@@ -928,8 +939,7 @@ class CookieTests(unittest.TestCase):
url = "http://foo.bar.com/"
interact_2965(c, url, "spam=eggs; Version=1")
h = interact_2965(c, url)
- self.assertTrue("Port" not in h,
- "absent port returned with port present")
+ self.assertNotIn("Port", h, "absent port returned with port present")
c = CookieJar(pol)
url = "http://foo.bar.com/"
@@ -942,16 +952,16 @@ class CookieTests(unittest.TestCase):
url = "http://foo.bar.com/"
interact_2965(c, url, 'spam=eggs; Version=1; Port="80"')
h = interact_2965(c, url)
- self.assertTrue('$Port="80"' in h,
- "port with single value not returned with single value")
+ self.assertIn('$Port="80"', h,
+ "port with single value not returned with single value")
c = CookieJar(pol)
url = "http://foo.bar.com/"
interact_2965(c, url, 'spam=eggs; Version=1; Port="80,8080"')
h = interact_2965(c, url)
- self.assertTrue('$Port="80,8080"' in h,
- "port with multiple values not returned with multiple "
- "values")
+ self.assertIn('$Port="80,8080"', h,
+ "port with multiple values not returned with multiple "
+ "values")
def test_no_return_comment(self):
c = CookieJar(DefaultCookiePolicy(rfc2965=True))
@@ -1033,6 +1043,8 @@ class CookieTests(unittest.TestCase):
["Set-Cookie2: a=foo; path=/; Version=1; domain"],
# bad max-age
["Set-Cookie: b=foo; max-age=oops"],
+ # bad version
+ ["Set-Cookie: b=foo; version=spam"],
]:
c = cookiejar_from_cookie_headers(headers)
# these bad cookies shouldn't be set
@@ -1116,8 +1128,8 @@ class LWPCookieTests(unittest.TestCase):
c.add_cookie_header(req)
h = req.get_header("Cookie")
- self.assertTrue("PART_NUMBER=ROCKET_LAUNCHER_0001" in h and
- "CUSTOMER=WILE_E_COYOTE" in h)
+ self.assertIn("PART_NUMBER=ROCKET_LAUNCHER_0001", h)
+ self.assertIn("CUSTOMER=WILE_E_COYOTE", h)
headers.append('Set-Cookie: SHIPPING=FEDEX; path=/foo')
res = FakeResponse(headers, "http://www.acme.com")
@@ -1127,17 +1139,17 @@ class LWPCookieTests(unittest.TestCase):
c.add_cookie_header(req)
h = req.get_header("Cookie")
- self.assertTrue("PART_NUMBER=ROCKET_LAUNCHER_0001" in h and
- "CUSTOMER=WILE_E_COYOTE" in h and
- "SHIPPING=FEDEX" not in h)
+ self.assertIn("PART_NUMBER=ROCKET_LAUNCHER_0001", h)
+ self.assertIn("CUSTOMER=WILE_E_COYOTE", h)
+ self.assertNotIn("SHIPPING=FEDEX", h)
req = urllib.request.Request("http://www.acme.com/foo/")
c.add_cookie_header(req)
h = req.get_header("Cookie")
- self.assertTrue(("PART_NUMBER=ROCKET_LAUNCHER_0001" in h and
- "CUSTOMER=WILE_E_COYOTE" in h and
- h.startswith("SHIPPING=FEDEX;")))
+ self.assertIn("PART_NUMBER=ROCKET_LAUNCHER_0001", h)
+ self.assertIn("CUSTOMER=WILE_E_COYOTE", h)
+ self.assertTrue(h.startswith("SHIPPING=FEDEX;"))
def test_netscape_example_2(self):
# Second Example transaction sequence:
@@ -1355,8 +1367,8 @@ class LWPCookieTests(unittest.TestCase):
# the server.
cookie = interact_2965(c, "http://www.acme.com/acme/parts/")
- self.assertTrue("Rocket_Launcher_0001" in cookie and
- "Riding_Rocket_0023" not in cookie)
+ self.assertIn("Rocket_Launcher_0001", cookie)
+ self.assertNotIn("Riding_Rocket_0023", cookie)
def test_rejection(self):
# Test rejection of Set-Cookie2 responses based on domain, path, port.
@@ -1461,7 +1473,8 @@ class LWPCookieTests(unittest.TestCase):
c, "http://www.acme.com/foo%2f%25/<<%0anew\345/\346\370\345",
'bar=baz; path="/foo/"; version=1');
version_re = re.compile(r'^\$version=\"?1\"?', re.I)
- self.assertTrue("foo=bar" in cookie and version_re.search(cookie))
+ self.assertIn("foo=bar", cookie)
+ self.assertTrue(version_re.search(cookie))
cookie = interact_2965(
c, "http://www.acme.com/foo/%25/<<%0anew\345/\346\370\345")
@@ -1505,11 +1518,11 @@ class LWPCookieTests(unittest.TestCase):
new_c = save_and_restore(c, True)
self.assertEqual(len(new_c), 6) # none discarded
- self.assertTrue("name='foo1', value='bar'" in repr(new_c))
+ self.assertIn("name='foo1', value='bar'", repr(new_c))
new_c = save_and_restore(c, False)
self.assertEqual(len(new_c), 4) # 2 of them discarded on save
- self.assertTrue("name='foo1', value='bar'" in repr(new_c))
+ self.assertIn("name='foo1', value='bar'", repr(new_c))
def test_netscape_misc(self):
# Some additional Netscape cookies tests.
@@ -1531,9 +1544,8 @@ class LWPCookieTests(unittest.TestCase):
req = urllib.request.Request("http://foo.bar.acme.com/foo")
c.add_cookie_header(req)
- self.assertTrue(
- "PART_NUMBER=3,4" in req.get_header("Cookie") and
- "Customer=WILE_E_COYOTE" in req.get_header("Cookie"))
+ self.assertIn("PART_NUMBER=3,4", req.get_header("Cookie"))
+ self.assertIn("Customer=WILE_E_COYOTE",req.get_header("Cookie"))
def test_intranet_domains_2965(self):
# Test handling of local intranet hostnames without a dot.
@@ -1542,11 +1554,12 @@ class LWPCookieTests(unittest.TestCase):
"foo1=bar; PORT; Discard; Version=1;")
cookie = interact_2965(c, "http://example/",
'foo2=bar; domain=".local"; Version=1')
- self.assertTrue("foo1=bar" in cookie)
+ self.assertIn("foo1=bar", cookie)
interact_2965(c, "http://example/", 'foo3=bar; Version=1')
cookie = interact_2965(c, "http://example/")
- self.assertTrue("foo2=bar" in cookie and len(c) == 3)
+ self.assertIn("foo2=bar", cookie)
+ self.assertEqual(len(c), 3)
def test_intranet_domains_ns(self):
c = CookieJar(DefaultCookiePolicy(rfc2965 = False))
@@ -1554,10 +1567,10 @@ class LWPCookieTests(unittest.TestCase):
cookie = interact_netscape(c, "http://example/",
'foo2=bar; domain=.local')
self.assertEqual(len(c), 2)
- self.assertTrue("foo1=bar" in cookie)
+ self.assertIn("foo1=bar", cookie)
cookie = interact_netscape(c, "http://example/")
- self.assertTrue("foo2=bar" in cookie)
+ self.assertIn("foo2=bar", cookie)
self.assertEqual(len(c), 2)
def test_empty_path(self):
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py
index cc225cd49d..f9a98c4ae1 100644
--- a/Lib/test/test_http_cookies.py
+++ b/Lib/test/test_http_cookies.py
@@ -1,35 +1,39 @@
# Simple test suite for http/cookies.py
-from test.support import run_unittest, run_doctest
+from test.support import run_unittest, run_doctest, check_warnings
import unittest
from http import cookies
import warnings
-warnings.filterwarnings("ignore",
- ".* class is insecure.*",
- DeprecationWarning)
class CookieTests(unittest.TestCase):
+
+ def setUp(self):
+ self._warnings_manager = check_warnings()
+ self._warnings_manager.__enter__()
+ warnings.filterwarnings("ignore", ".* class is insecure.*",
+ DeprecationWarning)
+
+ def tearDown(self):
+ self._warnings_manager.__exit__(None, None, None)
+
def test_basic(self):
cases = [
- { 'data': 'chips=ahoy; vienna=finger',
- 'dict': {'chips':'ahoy', 'vienna':'finger'},
- 'repr': "<SimpleCookie: chips='ahoy' vienna='finger'>",
- 'output': 'Set-Cookie: chips=ahoy\nSet-Cookie: vienna=finger',
- },
-
- { 'data': 'keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"',
- 'dict': {'keebler' : 'E=mc2; L="Loves"; fudge=\012;'},
- 'repr': '''<SimpleCookie: keebler='E=mc2; L="Loves"; fudge=\\n;'>''',
- 'output': 'Set-Cookie: keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"',
- },
+ {'data': 'chips=ahoy; vienna=finger',
+ 'dict': {'chips':'ahoy', 'vienna':'finger'},
+ 'repr': "<SimpleCookie: chips='ahoy' vienna='finger'>",
+ 'output': 'Set-Cookie: chips=ahoy\nSet-Cookie: vienna=finger'},
+
+ {'data': 'keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"',
+ 'dict': {'keebler' : 'E=mc2; L="Loves"; fudge=\012;'},
+ 'repr': '''<SimpleCookie: keebler='E=mc2; L="Loves"; fudge=\\n;'>''',
+ 'output': 'Set-Cookie: keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"'},
# Check illegal cookies that have an '=' char in an unquoted value
- { 'data': 'keebler=E=mc2',
- 'dict': {'keebler' : 'E=mc2'},
- 'repr': "<SimpleCookie: keebler='E=mc2'>",
- 'output': 'Set-Cookie: keebler=E=mc2',
- }
+ {'data': 'keebler=E=mc2',
+ 'dict': {'keebler' : 'E=mc2'},
+ 'repr': "<SimpleCookie: keebler='E=mc2'>",
+ 'output': 'Set-Cookie: keebler=E=mc2'},
]
for case in cases:
@@ -111,8 +115,72 @@ class CookieTests(unittest.TestCase):
self.assertEqual(C['Customer']['version'], '1')
self.assertEqual(C['Customer']['path'], '/acme')
+ self.assertEqual(C.output(['path']),
+ 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme')
+ self.assertEqual(C.js_output(), r"""
+ <script type="text/javascript">
+ <!-- begin hiding
+ document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1";
+ // end hiding -->
+ </script>
+ """)
+ self.assertEqual(C.js_output(['path']), r"""
+ <script type="text/javascript">
+ <!-- begin hiding
+ document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme";
+ // end hiding -->
+ </script>
+ """)
+
+class MorselTests(unittest.TestCase):
+ """Tests for the Morsel object."""
+
+ def test_reserved_keys(self):
+ M = cookies.Morsel()
+ # tests valid and invalid reserved keys for Morsels
+ for i in M._reserved:
+ # Test that all valid keys are reported as reserved and set them
+ self.assertTrue(M.isReservedKey(i))
+ M[i] = '%s_value' % i
+ for i in M._reserved:
+ # Test that valid key values come out fine
+ self.assertEqual(M[i], '%s_value' % i)
+ for i in "the holy hand grenade".split():
+ # Test that invalid keys raise CookieError
+ self.assertRaises(cookies.CookieError,
+ M.__setitem__, i, '%s_value' % i)
+
+ def test_setter(self):
+ M = cookies.Morsel()
+ # tests the .set method to set keys and their values
+ for i in M._reserved:
+ # Makes sure that all reserved keys can't be set this way
+ self.assertRaises(cookies.CookieError,
+ M.set, i, '%s_value' % i, '%s_value' % i)
+ for i in "thou cast _the- !holy! ^hand| +*grenade~".split():
+ # Try typical use case. Setting decent values.
+ # Check output and js_output.
+ M['path'] = '/foo' # Try a reserved key as well
+ M.set(i, "%s_val" % i, "%s_coded_val" % i)
+ self.assertEqual(
+ M.output(),
+ "Set-Cookie: %s=%s; Path=/foo" % (i, "%s_coded_val" % i))
+ expected_js_output = """
+ <script type="text/javascript">
+ <!-- begin hiding
+ document.cookie = "%s=%s; Path=/foo";
+ // end hiding -->
+ </script>
+ """ % (i, "%s_coded_val" % i)
+ self.assertEqual(M.js_output(), expected_js_output)
+ for i in ["foo bar", "foo@bar"]:
+ # Try some illegal characters
+ self.assertRaises(cookies.CookieError,
+ M.set, i, '%s_value' % i, '%s_value' % i)
+
+
def test_main():
- run_unittest(CookieTests)
+ run_unittest(CookieTests, MorselTests)
run_doctest(cookies)
if __name__ == '__main__':
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 43985a6652..890b1b9028 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -1,13 +1,23 @@
import errno
from http import client
import io
+import os
import array
import socket
-from unittest import TestCase
+import unittest
+TestCase = unittest.TestCase
from test import support
+here = os.path.dirname(__file__)
+# Self-signed cert file for 'localhost'
+CERT_localhost = os.path.join(here, 'keycert.pem')
+# Self-signed cert file for 'fakehostname'
+CERT_fakehostname = os.path.join(here, 'keycert2.pem')
+# Root cert file (CA) for svn.python.org's cert
+CACERT_svn_python_org = os.path.join(here, 'https_svn_python_org_root.pem')
+
HOST = support.HOST
class FakeSocket:
@@ -132,6 +142,10 @@ class BasicTest(TestCase):
resp = client.HTTPResponse(sock)
self.assertRaises(client.BadStatusLine, resp.begin)
+ def test_bad_status_repr(self):
+ exc = client.BadStatusLine('')
+ self.assertEqual(repr(exc), '''BadStatusLine("\'\'",)''')
+
def test_partial_reads(self):
# if we have a lenght, the system knows when to close itself
# same behaviour than when we read the whole thing with read()
@@ -194,13 +208,13 @@ class BasicTest(TestCase):
expected = (b'GET /foo HTTP/1.1\r\nHost: example.com\r\n'
b'Accept-Encoding: identity\r\nContent-Length:')
- body = open(__file__, 'rb')
- conn = client.HTTPConnection('example.com')
- sock = FakeSocket(body)
- conn.sock = sock
- conn.request('GET', '/foo', body)
- self.assertTrue(sock.data.startswith(expected), '%r != %r' %
- (sock.data[:len(expected)], expected))
+ with open(__file__, 'rb') as body:
+ conn = client.HTTPConnection('example.com')
+ sock = FakeSocket(body)
+ conn.sock = sock
+ conn.request('GET', '/foo', body)
+ self.assertTrue(sock.data.startswith(expected), '%r != %r' %
+ (sock.data[:len(expected)], expected))
def test_send(self):
expected = b'this is a test this is only a test'
@@ -216,6 +230,22 @@ class BasicTest(TestCase):
conn.send(io.BytesIO(expected))
self.assertEqual(expected, sock.data)
+ def test_send_iter(self):
+ expected = b'GET /foo HTTP/1.1\r\nHost: example.com\r\n' \
+ b'Accept-Encoding: identity\r\nContent-Length: 11\r\n' \
+ b'\r\nonetwothree'
+
+ def body():
+ yield b"one"
+ yield b"two"
+ yield b"three"
+
+ conn = client.HTTPConnection('example.com')
+ sock = FakeSocket("")
+ conn.sock = sock
+ conn.request('GET', '/foo', body(), {'Content-Length': '11'})
+ self.assertEqual(sock.data, expected)
+
def test_chunked(self):
chunked_start = (
'HTTP/1.1 200 OK\r\n'
@@ -306,7 +336,6 @@ class BasicTest(TestCase):
# Test lines overflowing the max line size (_MAXLINE in http.client)
def test_overflowing_status_line(self):
- self.skipTest("disabled for HTTP 0.9 support")
body = "HTTP/1.1 200 Ok" + "k" * 65536 + "\r\n"
resp = client.HTTPResponse(FakeSocket(body))
self.assertRaises((client.LineTooLong, client.BadStatusLine), resp.begin)
@@ -335,6 +364,38 @@ class OfflineTest(TestCase):
def test_responses(self):
self.assertEqual(client.responses[client.NOT_FOUND], "Not Found")
+
+class SourceAddressTest(TestCase):
+ def setUp(self):
+ self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.port = support.bind_port(self.serv)
+ self.source_port = support.find_unused_port()
+ self.serv.listen(5)
+ self.conn = None
+
+ def tearDown(self):
+ if self.conn:
+ self.conn.close()
+ self.conn = None
+ self.serv.close()
+ self.serv = None
+
+ def testHTTPConnectionSourceAddress(self):
+ self.conn = client.HTTPConnection(HOST, self.port,
+ source_address=('', self.source_port))
+ self.conn.connect()
+ self.assertEqual(self.conn.sock.getsockname()[1], self.source_port)
+
+ @unittest.skipIf(not hasattr(client, 'HTTPSConnection'),
+ 'http.client.HTTPSConnection not defined')
+ def testHTTPSConnectionSourceAddress(self):
+ self.conn = client.HTTPSConnection(HOST, self.port,
+ source_address=('', self.source_port))
+ # We don't test anything here other the constructor not barfing as
+ # this code doesn't deal with setting up an active running SSL server
+ # for an ssl_wrapped connect() to actually return from.
+
+
class TimeoutTest(TestCase):
PORT = None
@@ -380,14 +441,97 @@ class TimeoutTest(TestCase):
self.assertEqual(httpConn.sock.gettimeout(), 30)
httpConn.close()
-class HTTPSTimeoutTest(TestCase):
-# XXX Here should be tests for HTTPS, there isn't any right now!
+
+class HTTPSTest(TestCase):
+
+ def setUp(self):
+ if not hasattr(client, 'HTTPSConnection'):
+ self.skipTest('ssl support required')
+
+ def make_server(self, certfile):
+ from test.ssl_servers import make_https_server
+ return make_https_server(self, certfile)
def test_attributes(self):
- # simple test to check it's storing it
- if hasattr(client, 'HTTPSConnection'):
- h = client.HTTPSConnection(HOST, TimeoutTest.PORT, timeout=30)
- self.assertEqual(h.timeout, 30)
+ # simple test to check it's storing the timeout
+ h = client.HTTPSConnection(HOST, TimeoutTest.PORT, timeout=30)
+ self.assertEqual(h.timeout, 30)
+
+ def _check_svn_python_org(self, resp):
+ # Just a simple check that everything went fine
+ server_string = resp.getheader('server')
+ self.assertIn('Apache', server_string)
+
+ def test_networked(self):
+ # Default settings: no cert verification is done
+ support.requires('network')
+ with support.transient_internet('svn.python.org'):
+ h = client.HTTPSConnection('svn.python.org', 443)
+ h.request('GET', '/')
+ resp = h.getresponse()
+ self._check_svn_python_org(resp)
+
+ def test_networked_good_cert(self):
+ # We feed a CA cert that validates the server's cert
+ import ssl
+ support.requires('network')
+ with support.transient_internet('svn.python.org'):
+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ context.verify_mode = ssl.CERT_REQUIRED
+ context.load_verify_locations(CACERT_svn_python_org)
+ h = client.HTTPSConnection('svn.python.org', 443, context=context)
+ h.request('GET', '/')
+ resp = h.getresponse()
+ self._check_svn_python_org(resp)
+
+ def test_networked_bad_cert(self):
+ # We feed a "CA" cert that is unrelated to the server's cert
+ import ssl
+ support.requires('network')
+ with support.transient_internet('svn.python.org'):
+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ context.verify_mode = ssl.CERT_REQUIRED
+ context.load_verify_locations(CERT_localhost)
+ h = client.HTTPSConnection('svn.python.org', 443, context=context)
+ with self.assertRaises(ssl.SSLError):
+ h.request('GET', '/')
+
+ def test_local_good_hostname(self):
+ # The (valid) cert validates the HTTP hostname
+ import ssl
+ from test.ssl_servers import make_https_server
+ server = make_https_server(self, CERT_localhost)
+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ context.verify_mode = ssl.CERT_REQUIRED
+ context.load_verify_locations(CERT_localhost)
+ h = client.HTTPSConnection('localhost', server.port, context=context)
+ h.request('GET', '/nonexistent')
+ resp = h.getresponse()
+ self.assertEqual(resp.status, 404)
+
+ def test_local_bad_hostname(self):
+ # The (valid) cert doesn't validate the HTTP hostname
+ import ssl
+ from test.ssl_servers import make_https_server
+ server = make_https_server(self, CERT_fakehostname)
+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ context.verify_mode = ssl.CERT_REQUIRED
+ context.load_verify_locations(CERT_fakehostname)
+ h = client.HTTPSConnection('localhost', server.port, context=context)
+ with self.assertRaises(ssl.CertificateError):
+ h.request('GET', '/')
+ # Same with explicit check_hostname=True
+ h = client.HTTPSConnection('localhost', server.port, context=context,
+ check_hostname=True)
+ with self.assertRaises(ssl.CertificateError):
+ h.request('GET', '/')
+ # With check_hostname=False, the mismatching is ignored
+ h = client.HTTPSConnection('localhost', server.port, context=context,
+ check_hostname=False)
+ h.request('GET', '/nonexistent')
+ resp = h.getresponse()
+ self.assertEqual(resp.status, 404)
+
class RequestBodyTest(TestCase):
"""Test cases where a request includes a message body."""
@@ -416,7 +560,7 @@ class RequestBodyTest(TestCase):
self.conn.request("PUT", "/url", "body")
message, f = self.get_headers_and_fp()
self.assertEqual("text/plain", message.get_content_type())
- self.assertEqual(None, message.get_charset())
+ self.assertIsNone(message.get_charset())
self.assertEqual("4", message.get("content-length"))
self.assertEqual(b'body', f.read())
@@ -424,7 +568,7 @@ class RequestBodyTest(TestCase):
self.conn.request("PUT", "/url", "body\xc1")
message, f = self.get_headers_and_fp()
self.assertEqual("text/plain", message.get_content_type())
- self.assertEqual(None, message.get_charset())
+ self.assertIsNone(message.get_charset())
self.assertEqual("5", message.get("content-length"))
self.assertEqual(b'body\xc1', f.read())
@@ -432,33 +576,31 @@ class RequestBodyTest(TestCase):
self.conn.request("PUT", "/url", b"body\xc1")
message, f = self.get_headers_and_fp()
self.assertEqual("text/plain", message.get_content_type())
- self.assertEqual(None, message.get_charset())
+ self.assertIsNone(message.get_charset())
self.assertEqual("5", message.get("content-length"))
self.assertEqual(b'body\xc1', f.read())
def test_file_body(self):
- f = open(support.TESTFN, "w")
- f.write("body")
- f.close()
- f = open(support.TESTFN)
- self.conn.request("PUT", "/url", f)
- message, f = self.get_headers_and_fp()
- self.assertEqual("text/plain", message.get_content_type())
- self.assertEqual(None, message.get_charset())
- self.assertEqual("4", message.get("content-length"))
- self.assertEqual(b'body', f.read())
+ with open(support.TESTFN, "w") as f:
+ f.write("body")
+ with open(support.TESTFN) as f:
+ self.conn.request("PUT", "/url", f)
+ message, f = self.get_headers_and_fp()
+ self.assertEqual("text/plain", message.get_content_type())
+ self.assertIsNone(message.get_charset())
+ self.assertEqual("4", message.get("content-length"))
+ self.assertEqual(b'body', f.read())
def test_binary_file_body(self):
- f = open(support.TESTFN, "wb")
- f.write(b"body\xc1")
- f.close()
- f = open(support.TESTFN, "rb")
- self.conn.request("PUT", "/url", f)
- message, f = self.get_headers_and_fp()
- self.assertEqual("text/plain", message.get_content_type())
- self.assertEqual(None, message.get_charset())
- self.assertEqual("5", message.get("content-length"))
- self.assertEqual(b'body\xc1', f.read())
+ with open(support.TESTFN, "wb") as f:
+ f.write(b"body\xc1")
+ with open(support.TESTFN, "rb") as f:
+ self.conn.request("PUT", "/url", f)
+ message, f = self.get_headers_and_fp()
+ self.assertEqual("text/plain", message.get_content_type())
+ self.assertIsNone(message.get_charset())
+ self.assertEqual("5", message.get("content-length"))
+ self.assertEqual(b'body\xc1', f.read())
class HTTPResponseTest(TestCase):
@@ -498,7 +640,8 @@ class HTTPResponseTest(TestCase):
def test_main(verbose=None):
support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest,
- HTTPSTimeoutTest, RequestBodyTest, HTTPResponseTest)
+ HTTPSTest, RequestBodyTest, SourceAddressTest,
+ HTTPResponseTest)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index 28256975a0..39ebc26338 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -16,12 +16,11 @@ import shutil
import urllib.parse
import http.client
import tempfile
-import threading
+from io import BytesIO
import unittest
-
-from io import BytesIO
from test import support
+threading = support.import_module('threading')
class NoLogRequestHandler:
def log_message(self, *args):
@@ -32,21 +31,6 @@ class NoLogRequestHandler:
return ''
-class SocketlessRequestHandler(SimpleHTTPRequestHandler):
- def __init__(self):
- self.get_called = False
- self.protocol_version = "HTTP/1.1"
-
- def do_GET(self):
- self.get_called = True
- self.send_response(200)
- self.send_header('Content-Type', 'text/html')
- self.end_headers()
- self.wfile.write(b'<html><body>Data</body></html>\r\n')
-
- def log_message(self, format, *args):
- pass
-
class TestServerThread(threading.Thread):
def __init__(self, test_object, request_handler):
threading.Thread.__init__(self)
@@ -54,8 +38,8 @@ class TestServerThread(threading.Thread):
self.test_object = test_object
def run(self):
- self.server = HTTPServer(('', 0), self.request_handler)
- self.test_object.PORT = self.server.socket.getsockname()[1]
+ self.server = HTTPServer(('localhost', 0), self.request_handler)
+ self.test_object.HOST, self.test_object.PORT = self.server.socket.getsockname()
self.test_object.server_started.set()
self.test_object = None
try:
@@ -69,6 +53,8 @@ class TestServerThread(threading.Thread):
class BaseTestCase(unittest.TestCase):
def setUp(self):
+ self._threads = support.threading_setup()
+ os.environ = support.EnvironmentVarGuard()
self.server_started = threading.Event()
self.thread = TestServerThread(self, self.request_handler)
self.thread.start()
@@ -76,81 +62,14 @@ class BaseTestCase(unittest.TestCase):
def tearDown(self):
self.thread.stop()
+ os.environ.__exit__()
+ support.threading_cleanup(*self._threads)
def request(self, uri, method='GET', body=None, headers={}):
- self.connection = http.client.HTTPConnection('localhost', self.PORT)
+ self.connection = http.client.HTTPConnection(self.HOST, self.PORT)
self.connection.request(method, uri, body, headers)
return self.connection.getresponse()
-class BaseHTTPRequestHandlerTestCase(unittest.TestCase):
- """Test the functionality of the BaseHTTPServer."""
-
- HTTPResponseMatch = re.compile(b'HTTP/1.[0-9]+ 200 OK')
-
- def setUp (self):
- self.handler = SocketlessRequestHandler()
-
- def send_typical_request(self, message):
- input = BytesIO(message)
- output = BytesIO()
- self.handler.rfile = input
- self.handler.wfile = output
- self.handler.handle_one_request()
- output.seek(0)
- return output.readlines()
-
- def verify_get_called(self):
- self.assertTrue(self.handler.get_called)
-
- def verify_expected_headers(self, headers):
- for fieldName in b'Server: ', b'Date: ', b'Content-Type: ':
- self.assertEqual(sum(h.startswith(fieldName) for h in headers), 1)
-
- def verify_http_server_response(self, response):
- match = self.HTTPResponseMatch.search(response)
- self.assertTrue(match is not None)
-
- def test_http_1_1(self):
- result = self.send_typical_request(b'GET / HTTP/1.1\r\n\r\n')
- self.verify_http_server_response(result[0])
- self.verify_expected_headers(result[1:-1])
- self.verify_get_called()
- self.assertEqual(result[-1], b'<html><body>Data</body></html>\r\n')
-
- def test_http_1_0(self):
- result = self.send_typical_request(b'GET / HTTP/1.0\r\n\r\n')
- self.verify_http_server_response(result[0])
- self.verify_expected_headers(result[1:-1])
- self.verify_get_called()
- self.assertEqual(result[-1], b'<html><body>Data</body></html>\r\n')
-
- def test_http_0_9(self):
- result = self.send_typical_request(b'GET / HTTP/0.9\r\n\r\n')
- self.assertEqual(len(result), 1)
- self.assertEqual(result[0], b'<html><body>Data</body></html>\r\n')
- self.verify_get_called()
-
- def test_with_continue_1_0(self):
- result = self.send_typical_request(b'GET / HTTP/1.0\r\nExpect: 100-continue\r\n\r\n')
- self.verify_http_server_response(result[0])
- self.verify_expected_headers(result[1:-1])
- self.verify_get_called()
- self.assertEqual(result[-1], b'<html><body>Data</body></html>\r\n')
-
- def test_request_length(self):
- # Issue #10714: huge request lines are discarded, to avoid Denial
- # of Service attacks.
- result = self.send_typical_request(b'GET ' + b'x' * 65537)
- self.assertEqual(result[0], b'HTTP/1.1 414 Request-URI Too Long\r\n')
- self.assertFalse(self.handler.get_called)
-
- def test_header_length(self):
- # Issue #6791: same for headers
- result = self.send_typical_request(
- b'GET / HTTP/1.1\r\nX-Foo: bar' + b'r' * 65537 + b'\r\n\r\n')
- self.assertEqual(result[0], b'HTTP/1.1 400 Line too long\r\n')
- self.assertFalse(self.handler.get_called)
-
class BaseHTTPServerTestCase(BaseTestCase):
class request_handler(NoLogRequestHandler, BaseHTTPRequestHandler):
@@ -178,9 +97,17 @@ class BaseHTTPServerTestCase(BaseTestCase):
self.send_header('Connection', 'close')
self.end_headers()
+ def do_LATINONEHEADER(self):
+ self.send_response(999)
+ self.send_header('X-Special', 'Dängerous Mind')
+ self.send_header('Connection', 'close')
+ self.end_headers()
+ body = self.headers['x-special-incoming'].encode('utf-8')
+ self.wfile.write(body)
+
def setUp(self):
BaseTestCase.setUp(self)
- self.con = http.client.HTTPConnection('localhost', self.PORT)
+ self.con = http.client.HTTPConnection(self.HOST, self.PORT)
self.con.connect()
def test_command(self):
@@ -263,6 +190,7 @@ class BaseHTTPServerTestCase(BaseTestCase):
res = self.con.getresponse()
self.assertEqual(res.getheader('Connection'), 'keep-alive')
self.con.request('TEST', '/')
+ self.addCleanup(self.con.close)
def test_internal_key_error(self):
self.con.request('KEYERROR', '/')
@@ -274,6 +202,14 @@ class BaseHTTPServerTestCase(BaseTestCase):
res = self.con.getresponse()
self.assertEqual(res.status, 999)
+ def test_latin1_header(self):
+ self.con.request('LATINONEHEADER', '/', headers={
+ 'X-Special-Incoming': 'Ärger mit Unicode'
+ })
+ res = self.con.getresponse()
+ self.assertEqual(res.getheader('X-Special'), 'Dängerous Mind')
+ self.assertEqual(res.read(), 'Ärger mit Unicode'.encode('utf-8'))
+
class SimpleHTTPServerTestCase(BaseTestCase):
class request_handler(NoLogRequestHandler, SimpleHTTPRequestHandler):
@@ -287,9 +223,8 @@ class SimpleHTTPServerTestCase(BaseTestCase):
self.data = b'We are the knights who say Ni!'
self.tempdir = tempfile.mkdtemp(dir=basetempdir)
self.tempdir_name = os.path.basename(self.tempdir)
- temp = open(os.path.join(self.tempdir, 'test'), 'wb')
- temp.write(self.data)
- temp.close()
+ with open(os.path.join(self.tempdir, 'test'), 'wb') as temp:
+ temp.write(self.data)
def tearDown(self):
try:
@@ -305,7 +240,7 @@ class SimpleHTTPServerTestCase(BaseTestCase):
body = response.read()
self.assertTrue(response)
self.assertEqual(response.status, status)
- self.assertTrue(response.reason != None)
+ self.assertIsNotNone(response.reason)
if data:
self.assertEqual(data, body)
@@ -321,15 +256,15 @@ class SimpleHTTPServerTestCase(BaseTestCase):
self.check_status_and_reason(response, 404)
response = self.request('/' + 'ThisDoesNotExist' + '/')
self.check_status_and_reason(response, 404)
- f = open(os.path.join(self.tempdir_name, 'index.html'), 'w')
- response = self.request('/' + self.tempdir_name + '/')
- self.check_status_and_reason(response, 200)
- if os.name == 'posix':
- # chmod won't work as expected on Windows platforms
- os.chmod(self.tempdir, 0)
- response = self.request(self.tempdir_name + '/')
- self.check_status_and_reason(response, 404)
- os.chmod(self.tempdir, 0o755)
+ with open(os.path.join(self.tempdir_name, 'index.html'), 'w') as f:
+ response = self.request('/' + self.tempdir_name + '/')
+ self.check_status_and_reason(response, 200)
+ if os.name == 'posix':
+ # chmod won't work as expected on Windows platforms
+ os.chmod(self.tempdir, 0)
+ response = self.request(self.tempdir_name + '/')
+ self.check_status_and_reason(response, 404)
+ os.chmod(self.tempdir, 0o755)
def test_head(self):
response = self.request(
@@ -366,8 +301,8 @@ print("Content-type: text/html")
print()
form = cgi.FieldStorage()
-print("%%s, %%s, %%s" %% (form.getfirst("spam"), form.getfirst("eggs"),\
- form.getfirst("bacon")))
+print("%%s, %%s, %%s" %% (form.getfirst("spam"), form.getfirst("eggs"),
+ form.getfirst("bacon")))
"""
class CGIHTTPServerTestCase(BaseTestCase):
@@ -376,29 +311,41 @@ class CGIHTTPServerTestCase(BaseTestCase):
def setUp(self):
BaseTestCase.setUp(self)
+ self.cwd = os.getcwd()
self.parent_dir = tempfile.mkdtemp()
self.cgi_dir = os.path.join(self.parent_dir, 'cgi-bin')
os.mkdir(self.cgi_dir)
+ self.file1_path = None
+ self.file2_path = None
# The shebang line should be pure ASCII: use symlink if possible.
# See issue #7668.
- if hasattr(os, 'symlink'):
+ if support.can_symlink():
self.pythonexe = os.path.join(self.parent_dir, 'python')
os.symlink(sys.executable, self.pythonexe)
else:
self.pythonexe = sys.executable
+ try:
+ # The python executable path is written as the first line of the
+ # CGI Python script. The encoding cookie cannot be used, and so the
+ # path should be encodable to the default script encoding (utf-8)
+ self.pythonexe.encode('utf-8')
+ except UnicodeEncodeError:
+ self.tearDown()
+ raise self.skipTest(
+ "Python executable path is not encodable to utf-8")
+
self.file1_path = os.path.join(self.cgi_dir, 'file1.py')
- with open(self.file1_path, 'w') as file1:
+ with open(self.file1_path, 'w', encoding='utf-8') as file1:
file1.write(cgi_file1 % self.pythonexe)
os.chmod(self.file1_path, 0o777)
self.file2_path = os.path.join(self.cgi_dir, 'file2.py')
- with open(self.file2_path, 'w') as file2:
+ with open(self.file2_path, 'w', encoding='utf-8') as file2:
file2.write(cgi_file2 % self.pythonexe)
os.chmod(self.file2_path, 0o777)
- self.cwd = os.getcwd()
os.chdir(self.parent_dir)
def tearDown(self):
@@ -406,8 +353,10 @@ class CGIHTTPServerTestCase(BaseTestCase):
os.chdir(self.cwd)
if self.pythonexe != sys.executable:
os.remove(self.pythonexe)
- os.remove(self.file1_path)
- os.remove(self.file2_path)
+ if self.file1_path:
+ os.remove(self.file1_path)
+ if self.file2_path:
+ os.remove(self.file2_path)
os.rmdir(self.cgi_dir)
os.rmdir(self.parent_dir)
finally:
@@ -449,13 +398,13 @@ class CGIHTTPServerTestCase(BaseTestCase):
else:
actual = server._url_collapse_path_split(path)
self.assertEqual(expected, actual,
- msg='path = %r\nGot: %r\nWanted: %r' % (
- path, actual, expected))
+ msg='path = %r\nGot: %r\nWanted: %r' %
+ (path, actual, expected))
def test_headers_and_content(self):
res = self.request('/cgi-bin/file1.py')
- self.assertEqual((b'Hello World\n', 'text/html', 200), \
- (res.read(), res.getheader('Content-type'), res.status))
+ self.assertEqual((b'Hello World\n', 'text/html', 200),
+ (res.read(), res.getheader('Content-type'), res.status))
def test_post(self):
params = urllib.parse.urlencode(
@@ -474,8 +423,8 @@ class CGIHTTPServerTestCase(BaseTestCase):
headers = {b'Authorization' : b'Basic ' +
base64.b64encode(b'username:pass')}
res = self.request('/cgi-bin/file1.py', 'GET', headers=headers)
- self.assertEqual((b'Hello World\n', 'text/html', 200), \
- (res.read(), res.getheader('Content-type'), res.status))
+ self.assertEqual((b'Hello World\n', 'text/html', 200),
+ (res.read(), res.getheader('Content-type'), res.status))
def test_no_leading_slash(self):
# http://bugs.python.org/issue2254
@@ -492,6 +441,161 @@ class CGIHTTPServerTestCase(BaseTestCase):
self.assertEqual(os.environ['SERVER_SOFTWARE'], signature)
+class SocketlessRequestHandler(SimpleHTTPRequestHandler):
+ def __init__(self):
+ self.get_called = False
+ self.protocol_version = "HTTP/1.1"
+
+ def do_GET(self):
+ self.get_called = True
+ self.send_response(200)
+ self.send_header('Content-Type', 'text/html')
+ self.end_headers()
+ self.wfile.write(b'<html><body>Data</body></html>\r\n')
+
+ def log_message(self, format, *args):
+ pass
+
+class RejectingSocketlessRequestHandler(SocketlessRequestHandler):
+ def handle_expect_100(self):
+ self.send_error(417)
+ return False
+
+class BaseHTTPRequestHandlerTestCase(unittest.TestCase):
+ """Test the functionality of the BaseHTTPServer.
+
+ Test the support for the Expect 100-continue header.
+ """
+
+ HTTPResponseMatch = re.compile(b'HTTP/1.[0-9]+ 200 OK')
+
+ def setUp (self):
+ self.handler = SocketlessRequestHandler()
+
+ def send_typical_request(self, message):
+ input = BytesIO(message)
+ output = BytesIO()
+ self.handler.rfile = input
+ self.handler.wfile = output
+ self.handler.handle_one_request()
+ output.seek(0)
+ return output.readlines()
+
+ def verify_get_called(self):
+ self.assertTrue(self.handler.get_called)
+
+ def verify_expected_headers(self, headers):
+ for fieldName in b'Server: ', b'Date: ', b'Content-Type: ':
+ self.assertEqual(sum(h.startswith(fieldName) for h in headers), 1)
+
+ def verify_http_server_response(self, response):
+ match = self.HTTPResponseMatch.search(response)
+ self.assertTrue(match is not None)
+
+ def test_http_1_1(self):
+ result = self.send_typical_request(b'GET / HTTP/1.1\r\n\r\n')
+ self.verify_http_server_response(result[0])
+ self.verify_expected_headers(result[1:-1])
+ self.verify_get_called()
+ self.assertEqual(result[-1], b'<html><body>Data</body></html>\r\n')
+
+ def test_http_1_0(self):
+ result = self.send_typical_request(b'GET / HTTP/1.0\r\n\r\n')
+ self.verify_http_server_response(result[0])
+ self.verify_expected_headers(result[1:-1])
+ self.verify_get_called()
+ self.assertEqual(result[-1], b'<html><body>Data</body></html>\r\n')
+
+ def test_http_0_9(self):
+ result = self.send_typical_request(b'GET / HTTP/0.9\r\n\r\n')
+ self.assertEqual(len(result), 1)
+ self.assertEqual(result[0], b'<html><body>Data</body></html>\r\n')
+ self.verify_get_called()
+
+ def test_with_continue_1_0(self):
+ result = self.send_typical_request(b'GET / HTTP/1.0\r\nExpect: 100-continue\r\n\r\n')
+ self.verify_http_server_response(result[0])
+ self.verify_expected_headers(result[1:-1])
+ self.verify_get_called()
+ self.assertEqual(result[-1], b'<html><body>Data</body></html>\r\n')
+
+ def test_with_continue_1_1(self):
+ result = self.send_typical_request(b'GET / HTTP/1.1\r\nExpect: 100-continue\r\n\r\n')
+ self.assertEqual(result[0], b'HTTP/1.1 100 Continue\r\n')
+ self.assertEqual(result[1], b'HTTP/1.1 200 OK\r\n')
+ self.verify_expected_headers(result[2:-1])
+ self.verify_get_called()
+ self.assertEqual(result[-1], b'<html><body>Data</body></html>\r\n')
+
+ def test_header_buffering(self):
+
+ def _readAndReseek(f):
+ pos = f.tell()
+ f.seek(0)
+ data = f.read()
+ f.seek(pos)
+ return data
+
+ input = BytesIO(b'GET / HTTP/1.1\r\n\r\n')
+ output = BytesIO()
+ self.handler.rfile = input
+ self.handler.wfile = output
+ self.handler.request_version = 'HTTP/1.1'
+
+ self.handler.send_header('Foo', 'foo')
+ self.handler.send_header('bar', 'bar')
+ self.assertEqual(_readAndReseek(output), b'')
+ self.handler.end_headers()
+ self.assertEqual(_readAndReseek(output),
+ b'Foo: foo\r\nbar: bar\r\n\r\n')
+
+ def test_header_unbuffered_when_continue(self):
+
+ def _readAndReseek(f):
+ pos = f.tell()
+ f.seek(0)
+ data = f.read()
+ f.seek(pos)
+ return data
+
+ input = BytesIO(b'GET / HTTP/1.1\r\nExpect: 100-continue\r\n\r\n')
+ output = BytesIO()
+ self.handler.rfile = input
+ self.handler.wfile = output
+ self.handler.request_version = 'HTTP/1.1'
+
+ self.handler.handle_one_request()
+ self.assertNotEqual(_readAndReseek(output), b'')
+ result = _readAndReseek(output).split(b'\r\n')
+ self.assertEqual(result[0], b'HTTP/1.1 100 Continue')
+ self.assertEqual(result[1], b'HTTP/1.1 200 OK')
+
+ def test_with_continue_rejected(self):
+ usual_handler = self.handler # Save to avoid breaking any subsequent tests.
+ self.handler = RejectingSocketlessRequestHandler()
+ result = self.send_typical_request(b'GET / HTTP/1.1\r\nExpect: 100-continue\r\n\r\n')
+ self.assertEqual(result[0], b'HTTP/1.1 417 Expectation Failed\r\n')
+ self.verify_expected_headers(result[1:-1])
+ # The expect handler should short circuit the usual get method by
+ # returning false here, so get_called should be false
+ self.assertFalse(self.handler.get_called)
+ self.assertEqual(sum(r == b'Connection: close\r\n' for r in result[1:-1]), 1)
+ self.handler = usual_handler # Restore to avoid breaking any subsequent tests.
+
+ def test_request_length(self):
+ # Issue #10714: huge request lines are discarded, to avoid Denial
+ # of Service attacks.
+ result = self.send_typical_request(b'GET ' + b'x' * 65537)
+ self.assertEqual(result[0], b'HTTP/1.1 414 Request-URI Too Long\r\n')
+ self.assertFalse(self.handler.get_called)
+
+ def test_header_length(self):
+ # Issue #6791: same for headers
+ result = self.send_typical_request(
+ b'GET / HTTP/1.1\r\nX-Foo: bar' + b'r' * 65537 + b'\r\n\r\n')
+ self.assertEqual(result[0], b'HTTP/1.1 400 Line too long\r\n')
+ self.assertFalse(self.handler.get_called)
+
class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
""" Test url parsing """
def setUp(self):
@@ -515,14 +619,15 @@ class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
def test_main(verbose=None):
+ cwd = os.getcwd()
try:
- cwd = os.getcwd()
- support.run_unittest(BaseHTTPRequestHandlerTestCase,
- SimpleHTTPRequestHandlerTestCase,
- BaseHTTPServerTestCase,
- SimpleHTTPServerTestCase,
- CGIHTTPServerTestCase
- )
+ support.run_unittest(
+ BaseHTTPRequestHandlerTestCase,
+ BaseHTTPServerTestCase,
+ SimpleHTTPServerTestCase,
+ CGIHTTPServerTestCase,
+ SimpleHTTPRequestHandlerTestCase,
+ )
finally:
os.chdir(cwd)
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index 6116c8bc96..80340004d7 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -7,10 +7,7 @@ threading = support.import_module('threading')
from contextlib import contextmanager
import imaplib
import os.path
-import select
-import socket
import socketserver
-import sys
import time
import calendar
@@ -76,7 +73,7 @@ class SimpleIMAPHandler(socketserver.StreamRequestHandler):
timeout = 1
def _send(self, message):
- if verbose: print("SENT:", message.strip())
+ if verbose: print("SENT: %r" % message.strip())
self.wfile.write(message)
def handle(self):
@@ -100,7 +97,7 @@ class SimpleIMAPHandler(socketserver.StreamRequestHandler):
if line.endswith(b'\r\n'):
break
- if verbose: print('GOT:', line.strip())
+ if verbose: print('GOT: %r' % line.strip())
splitline = line.split()
tag = splitline[0].decode('ASCII')
cmd = splitline[1].decode('ASCII')
@@ -151,6 +148,7 @@ class BaseThreadedNetworkedTests(unittest.TestCase):
def reap_server(self, server, thread):
if verbose: print("waiting for server")
server.shutdown()
+ server.server_close()
thread.join()
if verbose: print("done")
@@ -221,20 +219,38 @@ class RemoteIMAPTest(unittest.TestCase):
def tearDown(self):
if self.server is not None:
- self.server.logout()
+ with transient_internet(self.host):
+ self.server.logout()
def test_logincapa(self):
- self.assertTrue('LOGINDISABLED' in self.server.capabilities)
-
- def test_anonlogin(self):
- self.assertTrue('AUTH=ANONYMOUS' in self.server.capabilities)
- rs = self.server.login(self.username, self.password)
- self.assertEqual(rs[0], 'OK')
+ with transient_internet(self.host):
+ for cap in self.server.capabilities:
+ self.assertIsInstance(cap, str)
+ self.assertTrue('LOGINDISABLED' in self.server.capabilities)
+ self.assertTrue('AUTH=ANONYMOUS' in self.server.capabilities)
+ rs = self.server.login(self.username, self.password)
+ self.assertEqual(rs[0], 'OK')
def test_logout(self):
- rs = self.server.logout()
- self.server = None
- self.assertEqual(rs[0], 'BYE')
+ with transient_internet(self.host):
+ rs = self.server.logout()
+ self.server = None
+ self.assertEqual(rs[0], 'BYE')
+
+
+@unittest.skipUnless(ssl, "SSL not available")
+class RemoteIMAP_STARTTLSTest(RemoteIMAPTest):
+
+ def setUp(self):
+ super().setUp()
+ with transient_internet(self.host):
+ rs = self.server.starttls()
+ self.assertEqual(rs[0], 'OK')
+
+ def test_logincapa(self):
+ for cap in self.server.capabilities:
+ self.assertIsInstance(cap, str)
+ self.assertFalse('LOGINDISABLED' in self.server.capabilities)
@unittest.skipUnless(ssl, "SSL not available")
@@ -243,6 +259,8 @@ class RemoteIMAP_SSLTest(RemoteIMAPTest):
imap_class = IMAP4_SSL
def test_logincapa(self):
+ for cap in self.server.capabilities:
+ self.assertIsInstance(cap, str)
self.assertFalse('LOGINDISABLED' in self.server.capabilities)
self.assertTrue('AUTH=PLAIN' in self.server.capabilities)
@@ -259,7 +277,7 @@ def test_main():
raise support.TestFailed("Can't read certificate files!")
tests.extend([
ThreadedNetworkedTests, ThreadedNetworkedTestsSSL,
- RemoteIMAPTest, RemoteIMAP_SSLTest,
+ RemoteIMAPTest, RemoteIMAP_SSLTest, RemoteIMAP_STARTTLSTest,
])
support.run_unittest(*tests)
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index 1671e487d9..551ad1b85c 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -1,10 +1,11 @@
import imp
import os
import os.path
+import shutil
import sys
import unittest
from test import support
-
+import importlib
class LockTests(unittest.TestCase):
@@ -41,26 +42,40 @@ class LockTests(unittest.TestCase):
"RuntimeError")
class ImportTests(unittest.TestCase):
+ def setUp(self):
+ mod = importlib.import_module('test.encoded_modules')
+ self.test_strings = mod.test_strings
+ self.test_path = mod.__path__
+
+ def test_import_encoded_module(self):
+ for modname, encoding, teststr in self.test_strings:
+ mod = importlib.import_module('test.encoded_modules.'
+ 'module_' + modname)
+ self.assertEqual(teststr, mod.test)
def test_find_module_encoding(self):
- fd = imp.find_module("heapq")[0]
- self.assertEqual(fd.encoding, "iso-8859-1")
+ for mod, encoding, _ in self.test_strings:
+ with imp.find_module('module_' + mod, self.test_path)[0] as fd:
+ self.assertEqual(fd.encoding, encoding)
def test_issue1267(self):
- fp, filename, info = imp.find_module("pydoc")
- self.assertNotEqual(fp, None)
- self.assertEqual(fp.encoding, "iso-8859-1")
- self.assertEqual(fp.tell(), 0)
- self.assertEqual(fp.readline(), '#!/usr/bin/env python\n')
- fp.close()
+ for mod, encoding, _ in self.test_strings:
+ fp, filename, info = imp.find_module('module_' + mod,
+ self.test_path)
+ with fp:
+ self.assertNotEqual(fp, None)
+ self.assertEqual(fp.encoding, encoding)
+ self.assertEqual(fp.tell(), 0)
+ self.assertEqual(fp.readline(), '# test %s encoding\n'
+ % encoding)
fp, filename, info = imp.find_module("tokenize")
- self.assertNotEqual(fp, None)
- self.assertEqual(fp.encoding, "utf-8")
- self.assertEqual(fp.tell(), 0)
- self.assertEqual(fp.readline(),
- '"""Tokenization help for Python programs.\n')
- fp.close()
+ with fp:
+ self.assertNotEqual(fp, None)
+ self.assertEqual(fp.encoding, "utf-8")
+ self.assertEqual(fp.tell(), 0)
+ self.assertEqual(fp.readline(),
+ '"""Tokenization help for Python programs.\n')
def test_issue3594(self):
temp_mod_name = 'test_imp_helper'
@@ -86,7 +101,6 @@ class ImportTests(unittest.TestCase):
# the return encoding could be uppercase or None
fs_encoding = sys.getfilesystemencoding()
- fs_encoding = fs_encoding.lower() if fs_encoding else 'ascii'
# covers utf-8 and Windows ANSI code pages
# one non-space symbol from every page
@@ -126,20 +140,21 @@ class ImportTests(unittest.TestCase):
with open(temp_mod_name + '.py', 'w') as file:
file.write('a = 1\n')
file, filename, info = imp.find_module(temp_mod_name)
- self.assertIsNotNone(file)
- self.assertTrue(filename[:-3].endswith(temp_mod_name))
- self.assertEqual(info[0], '.py')
- self.assertEqual(info[1], 'U')
- self.assertEqual(info[2], imp.PY_SOURCE)
+ with file:
+ self.assertIsNotNone(file)
+ self.assertTrue(filename[:-3].endswith(temp_mod_name))
+ self.assertEqual(info[0], '.py')
+ self.assertEqual(info[1], 'U')
+ self.assertEqual(info[2], imp.PY_SOURCE)
- mod = imp.load_module(temp_mod_name, file, filename, info)
- self.assertEqual(mod.a, 1)
- file.close()
+ mod = imp.load_module(temp_mod_name, file, filename, info)
+ self.assertEqual(mod.a, 1)
mod = imp.load_source(temp_mod_name, temp_mod_name + '.py')
self.assertEqual(mod.a, 1)
- mod = imp.load_compiled(temp_mod_name, temp_mod_name + '.pyc')
+ mod = imp.load_compiled(
+ temp_mod_name, imp.cache_from_source(temp_mod_name + '.py'))
self.assertEqual(mod.a, 1)
if not os.path.exists(test_package_name):
@@ -155,20 +170,179 @@ class ImportTests(unittest.TestCase):
support.unlink(init_file_name + ext)
support.rmtree(test_package_name)
+ def test_issue9319(self):
+ path = os.path.dirname(__file__)
+ self.assertRaises(SyntaxError,
+ imp.find_module, "badsyntax_pep3120", [path])
+
+
+class ReloadTests(unittest.TestCase):
+
+ """Very basic tests to make sure that imp.reload() operates just like
+ reload()."""
+
+ def test_source(self):
+ # XXX (ncoghlan): It would be nice to use test.support.CleanImport
+ # here, but that breaks because the os module registers some
+ # handlers in copy_reg on import. Since CleanImport doesn't
+ # revert that registration, the module is left in a broken
+ # state after reversion. Reinitialising the module contents
+ # and just reverting os.environ to its previous state is an OK
+ # workaround
+ with support.EnvironmentVarGuard():
+ import os
+ imp.reload(os)
+
+ def test_extension(self):
+ with support.CleanImport('time'):
+ import time
+ imp.reload(time)
+
+ def test_builtin(self):
+ with support.CleanImport('marshal'):
+ import marshal
+ imp.reload(marshal)
+
+
+class PEP3147Tests(unittest.TestCase):
+ """Tests of PEP 3147."""
+
+ tag = imp.get_tag()
+
+ def test_cache_from_source(self):
+ # Given the path to a .py file, return the path to its PEP 3147
+ # defined .pyc file (i.e. under __pycache__).
+ self.assertEqual(
+ imp.cache_from_source('/foo/bar/baz/qux.py', True),
+ '/foo/bar/baz/__pycache__/qux.{}.pyc'.format(self.tag))
+
+ def test_cache_from_source_optimized(self):
+ # Given the path to a .py file, return the path to its PEP 3147
+ # defined .pyo file (i.e. under __pycache__).
+ self.assertEqual(
+ imp.cache_from_source('/foo/bar/baz/qux.py', False),
+ '/foo/bar/baz/__pycache__/qux.{}.pyo'.format(self.tag))
- def test_reload(self):
- import marshal
- imp.reload(marshal)
- import string
- imp.reload(string)
- ## import sys
- ## self.assertRaises(ImportError, reload, sys)
+ def test_cache_from_source_cwd(self):
+ self.assertEqual(imp.cache_from_source('foo.py', True),
+ os.sep.join(('__pycache__',
+ 'foo.{}.pyc'.format(self.tag))))
+
+ def test_cache_from_source_override(self):
+ # When debug_override is not None, it can be any true-ish or false-ish
+ # value.
+ self.assertEqual(
+ imp.cache_from_source('/foo/bar/baz.py', []),
+ '/foo/bar/__pycache__/baz.{}.pyo'.format(self.tag))
+ self.assertEqual(
+ imp.cache_from_source('/foo/bar/baz.py', [17]),
+ '/foo/bar/__pycache__/baz.{}.pyc'.format(self.tag))
+ # However if the bool-ishness can't be determined, the exception
+ # propagates.
+ class Bearish:
+ def __bool__(self): raise RuntimeError
+ self.assertRaises(
+ RuntimeError,
+ imp.cache_from_source, '/foo/bar/baz.py', Bearish())
+
+ @unittest.skipIf(os.altsep is None,
+ 'test meaningful only where os.altsep is defined')
+ def test_altsep_cache_from_source(self):
+ # Windows path and PEP 3147.
+ self.assertEqual(
+ imp.cache_from_source('\\foo\\bar\\baz\\qux.py', True),
+ '\\foo\\bar\\baz\\__pycache__\\qux.{}.pyc'.format(self.tag))
+
+ @unittest.skipIf(os.altsep is None,
+ 'test meaningful only where os.altsep is defined')
+ def test_altsep_and_sep_cache_from_source(self):
+ # Windows path and PEP 3147 where altsep is right of sep.
+ self.assertEqual(
+ imp.cache_from_source('\\foo\\bar/baz\\qux.py', True),
+ '\\foo\\bar/baz\\__pycache__\\qux.{}.pyc'.format(self.tag))
+
+ @unittest.skipIf(os.altsep is None,
+ 'test meaningful only where os.altsep is defined')
+ def test_sep_altsep_and_sep_cache_from_source(self):
+ # Windows path and PEP 3147 where sep is right of altsep.
+ self.assertEqual(
+ imp.cache_from_source('\\foo\\bar\\baz/qux.py', True),
+ '\\foo\\bar\\baz/__pycache__/qux.{}.pyc'.format(self.tag))
+
+ def test_source_from_cache(self):
+ # Given the path to a PEP 3147 defined .pyc file, return the path to
+ # its source. This tests the good path.
+ self.assertEqual(imp.source_from_cache(
+ '/foo/bar/baz/__pycache__/qux.{}.pyc'.format(self.tag)),
+ '/foo/bar/baz/qux.py')
+
+ def test_source_from_cache_bad_path(self):
+ # When the path to a pyc file is not in PEP 3147 format, a ValueError
+ # is raised.
+ self.assertRaises(
+ ValueError, imp.source_from_cache, '/foo/bar/bazqux.pyc')
+
+ def test_source_from_cache_no_slash(self):
+ # No slashes at all in path -> ValueError
+ self.assertRaises(
+ ValueError, imp.source_from_cache, 'foo.cpython-32.pyc')
+
+ def test_source_from_cache_too_few_dots(self):
+ # Too few dots in final path component -> ValueError
+ self.assertRaises(
+ ValueError, imp.source_from_cache, '__pycache__/foo.pyc')
+
+ def test_source_from_cache_too_many_dots(self):
+ # Too many dots in final path component -> ValueError
+ self.assertRaises(
+ ValueError, imp.source_from_cache,
+ '__pycache__/foo.cpython-32.foo.pyc')
+
+ def test_source_from_cache_no__pycache__(self):
+ # Another problem with the path -> ValueError
+ self.assertRaises(
+ ValueError, imp.source_from_cache,
+ '/foo/bar/foo.cpython-32.foo.pyc')
+
+ def test_package___file__(self):
+ # Test that a package's __file__ points to the right source directory.
+ os.mkdir('pep3147')
+ sys.path.insert(0, os.curdir)
+ def cleanup():
+ if sys.path[0] == os.curdir:
+ del sys.path[0]
+ shutil.rmtree('pep3147')
+ self.addCleanup(cleanup)
+ # Touch the __init__.py file.
+ with open('pep3147/__init__.py', 'w'):
+ pass
+ m = __import__('pep3147')
+ # Ensure we load the pyc file.
+ support.forget('pep3147')
+ m = __import__('pep3147')
+ self.assertEqual(m.__file__,
+ os.sep.join(('.', 'pep3147', '__init__.py')))
+
+
+class NullImporterTests(unittest.TestCase):
+ @unittest.skipIf(support.TESTFN_UNENCODABLE is None,
+ "Need an undecodeable filename")
+ def test_unencodeable(self):
+ name = support.TESTFN_UNENCODABLE
+ os.mkdir(name)
+ try:
+ self.assertRaises(ImportError, imp.NullImporter, name)
+ finally:
+ os.rmdir(name)
def test_main():
tests = [
ImportTests,
- ]
+ PEP3147Tests,
+ ReloadTests,
+ NullImporterTests,
+ ]
try:
import _thread
except ImportError:
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 6f935c7581..95a5f48fce 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -1,3 +1,4 @@
+import builtins
import imp
from importlib.test.import_ import test_relative_imports
from importlib.test.import_ import util as importlib_util
@@ -8,12 +9,12 @@ import random
import stat
import sys
import unittest
-import warnings
import textwrap
from test.support import (
- EnvironmentVarGuard, TESTFN, forget, is_jython,
- rmtree, run_unittest, unlink, unload)
+ EnvironmentVarGuard, TESTFN, check_warnings, forget, is_jython,
+ make_legacy_pyc, rmtree, run_unittest, swap_attr, swap_item, temp_umask,
+ unlink, unload)
from test import script_helper
@@ -29,6 +30,9 @@ def remove_files(name):
class ImportTests(unittest.TestCase):
+ def setUp(self):
+ remove_files(TESTFN)
+
def tearDown(self):
unload(TESTFN)
@@ -37,12 +41,8 @@ class ImportTests(unittest.TestCase):
def test_case_sensitivity(self):
# Brief digression to test that import is case-sensitive: if we got
# this far, we know for sure that "random" exists.
- try:
+ with self.assertRaises(ImportError):
import RAnDoM
- except ImportError:
- pass
- else:
- self.fail("import of RAnDoM should have failed (case mismatch)")
def test_double_const(self):
# Another brief digression to test the accuracy of manifest float
@@ -99,31 +99,29 @@ class ImportTests(unittest.TestCase):
def test_execute_bit_not_copied(self):
# Issue 6070: under posix .pyc files got their execute bit set if
# the .py file had the execute bit set, but they aren't executable.
- oldmask = os.umask(0o022)
- sys.path.insert(0, os.curdir)
- try:
- fname = TESTFN + os.extsep + "py"
- f = open(fname, 'w').close()
- os.chmod(fname, (stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH |
- stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH))
- __import__(TESTFN)
- fn = fname + 'c'
- if not os.path.exists(fn):
- fn = fname + 'o'
- if not os.path.exists(fn): raise TestFailed("__import__ did "
- "not result in creation of either a .pyc or .pyo file")
- s = os.stat(fn)
- self.assertEqual(stat.S_IMODE(s.st_mode),
- stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
- finally:
- os.umask(oldmask)
- remove_files(TESTFN)
- if TESTFN in sys.modules: del sys.modules[TESTFN]
- del sys.path[0]
+ with temp_umask(0o022):
+ sys.path.insert(0, os.curdir)
+ try:
+ fname = TESTFN + os.extsep + "py"
+ open(fname, 'w').close()
+ os.chmod(fname, (stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH |
+ stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH))
+ __import__(TESTFN)
+ fn = imp.cache_from_source(fname)
+ if not os.path.exists(fn):
+ self.fail("__import__ did not result in creation of "
+ "either a .pyc or .pyo file")
+ s = os.stat(fn)
+ self.assertEqual(
+ stat.S_IMODE(s.st_mode),
+ stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
+ finally:
+ del sys.path[0]
+ remove_files(TESTFN)
+ unload(TESTFN)
def test_imp_module(self):
# Verify that the imp module can correctly load and find .py files
- import imp, os
# XXX (ncoghlan): It would be nice to use support.CleanImport
# here, but that breaks because the os module registers some
# handlers in copy_reg on import. Since CleanImport doesn't
@@ -135,6 +133,7 @@ class ImportTests(unittest.TestCase):
orig_getenv = os.getenv
with EnvironmentVarGuard():
x = imp.find_module("os")
+ self.addCleanup(x[0].close)
new_os = imp.load_module("os", *x)
self.assertIs(os, new_os)
self.assertIs(orig_path, new_os.path)
@@ -153,6 +152,7 @@ class ImportTests(unittest.TestCase):
try:
# Compile & remove .py file; we only need .pyc (or .pyo).
+ # Bytecode must be relocated from the PEP 3147 bytecode-only location.
py_compile.compile(filename)
finally:
unlink(filename)
@@ -161,6 +161,7 @@ class ImportTests(unittest.TestCase):
sys.path.append('')
try:
+ make_legacy_pyc(filename)
# This used to crash.
exec('import ' + module)
finally:
@@ -199,13 +200,6 @@ class ImportTests(unittest.TestCase):
import test.support as y
self.assertTrue(y is test.support, y.__name__)
- def test_import_initless_directory_warning(self):
- with warnings.catch_warnings():
- # Just a random non-package directory we always expect to be
- # somewhere in sys.path...
- warnings.simplefilter('error', ImportWarning)
- self.assertRaises(ImportWarning, __import__, "site-packages")
-
def test_failing_reload(self):
# A failing reload should leave the module object in sys.modules.
source = TESTFN + os.extsep + "py"
@@ -256,6 +250,7 @@ class ImportTests(unittest.TestCase):
self.assertTrue(mod.__file__.endswith('.py'))
os.remove(source)
del sys.modules[TESTFN]
+ make_legacy_pyc(source)
mod = __import__(TESTFN)
base, ext = os.path.splitext(mod.__file__)
self.assertIn(ext, ('.pyc', '.pyo'))
@@ -276,15 +271,23 @@ class ImportTests(unittest.TestCase):
import test.support as y
self.assertIs(y, test.support, y.__name__)
+ def test_import_initless_directory_warning(self):
+ with check_warnings(('', ImportWarning)):
+ # Just a random non-package directory we always expect to be
+ # somewhere in sys.path...
+ self.assertRaises(ImportError, __import__, "site-packages")
+
def test_import_by_filename(self):
path = os.path.abspath(TESTFN)
+ encoding = sys.getfilesystemencoding()
try:
+ path.encode(encoding)
+ except UnicodeEncodeError:
+ self.skipTest('path is not encodable to {}'.format(encoding))
+ with self.assertRaises(ImportError) as c:
__import__(path)
- except ImportError as err:
- self.assertEqual("Import by filename is not supported.",
- err.args[0])
- else:
- self.fail("import by path didn't raise an exception")
+ self.assertEqual("Import by filename is not supported.",
+ c.exception.args[0])
def test_import_in_del_does_not_crash(self):
# Issue 4236
@@ -315,7 +318,7 @@ func_filename = func.__code__.co_filename
"""
dir_name = os.path.abspath(TESTFN)
file_name = os.path.join(dir_name, module_name) + os.extsep + "py"
- compiled_name = file_name + ("c" if __debug__ else "o")
+ compiled_name = imp.cache_from_source(file_name)
def setUp(self):
self.sys_path = sys.path[:]
@@ -362,8 +365,9 @@ func_filename = func.__code__.co_filename
target = "another_module.py"
py_compile.compile(self.file_name, dfile=target)
os.remove(self.file_name)
+ pyc_file = make_legacy_pyc(self.file_name)
mod = self.import_module()
- self.assertEqual(mod.module_filename, self.compiled_name)
+ self.assertEqual(mod.module_filename, pyc_file)
self.assertEqual(mod.code_filename, target)
self.assertEqual(mod.func_filename, target)
@@ -481,6 +485,158 @@ class RelativeImportTests(unittest.TestCase):
"implicit absolute import")
+class OverridingImportBuiltinTests(unittest.TestCase):
+ def test_override_builtin(self):
+ # Test that overriding builtins.__import__ can bypass sys.modules.
+ import os
+
+ def foo():
+ import os
+ return os
+ self.assertEqual(foo(), os) # Quick sanity check.
+
+ with swap_attr(builtins, "__import__", lambda *x: 5):
+ self.assertEqual(foo(), 5)
+
+ # Test what happens when we shadow __import__ in globals(); this
+ # currently does not impact the import process, but if this changes,
+ # other code will need to change, so keep this test as a tripwire.
+ with swap_item(globals(), "__import__", lambda *x: 5):
+ self.assertEqual(foo(), os)
+
+
+class PycacheTests(unittest.TestCase):
+ # Test the various PEP 3147 related behaviors.
+
+ tag = imp.get_tag()
+
+ def _clean(self):
+ forget(TESTFN)
+ rmtree('__pycache__')
+ unlink(self.source)
+
+ def setUp(self):
+ self.source = TESTFN + '.py'
+ self._clean()
+ with open(self.source, 'w') as fp:
+ print('# This is a test file written by test_import.py', file=fp)
+ sys.path.insert(0, os.curdir)
+
+ def tearDown(self):
+ assert sys.path[0] == os.curdir, 'Unexpected sys.path[0]'
+ del sys.path[0]
+ self._clean()
+
+ def test_import_pyc_path(self):
+ self.assertFalse(os.path.exists('__pycache__'))
+ __import__(TESTFN)
+ self.assertTrue(os.path.exists('__pycache__'))
+ self.assertTrue(os.path.exists(os.path.join(
+ '__pycache__', '{}.{}.py{}'.format(
+ TESTFN, self.tag, __debug__ and 'c' or 'o'))))
+
+ @unittest.skipUnless(os.name == 'posix',
+ "test meaningful only on posix systems")
+ def test_unwritable_directory(self):
+ # When the umask causes the new __pycache__ directory to be
+ # unwritable, the import still succeeds but no .pyc file is written.
+ with temp_umask(0o222):
+ __import__(TESTFN)
+ self.assertTrue(os.path.exists('__pycache__'))
+ self.assertFalse(os.path.exists(os.path.join(
+ '__pycache__', '{}.{}.pyc'.format(TESTFN, self.tag))))
+
+ def test_missing_source(self):
+ # With PEP 3147 cache layout, removing the source but leaving the pyc
+ # file does not satisfy the import.
+ __import__(TESTFN)
+ pyc_file = imp.cache_from_source(self.source)
+ self.assertTrue(os.path.exists(pyc_file))
+ os.remove(self.source)
+ forget(TESTFN)
+ self.assertRaises(ImportError, __import__, TESTFN)
+
+ def test_missing_source_legacy(self):
+ # Like test_missing_source() except that for backward compatibility,
+ # when the pyc file lives where the py file would have been (and named
+ # without the tag), it is importable. The __file__ of the imported
+ # module is the pyc location.
+ __import__(TESTFN)
+ # pyc_file gets removed in _clean() via tearDown().
+ pyc_file = make_legacy_pyc(self.source)
+ os.remove(self.source)
+ unload(TESTFN)
+ m = __import__(TESTFN)
+ self.assertEqual(m.__file__,
+ os.path.join(os.curdir, os.path.relpath(pyc_file)))
+
+ def test___cached__(self):
+ # Modules now also have an __cached__ that points to the pyc file.
+ m = __import__(TESTFN)
+ pyc_file = imp.cache_from_source(TESTFN + '.py')
+ self.assertEqual(m.__cached__, os.path.join(os.curdir, pyc_file))
+
+ def test___cached___legacy_pyc(self):
+ # Like test___cached__() except that for backward compatibility,
+ # when the pyc file lives where the py file would have been (and named
+ # without the tag), it is importable. The __cached__ of the imported
+ # module is the pyc location.
+ __import__(TESTFN)
+ # pyc_file gets removed in _clean() via tearDown().
+ pyc_file = make_legacy_pyc(self.source)
+ os.remove(self.source)
+ unload(TESTFN)
+ m = __import__(TESTFN)
+ self.assertEqual(m.__cached__,
+ os.path.join(os.curdir, os.path.relpath(pyc_file)))
+
+ def test_package___cached__(self):
+ # Like test___cached__ but for packages.
+ def cleanup():
+ rmtree('pep3147')
+ os.mkdir('pep3147')
+ self.addCleanup(cleanup)
+ # Touch the __init__.py
+ with open(os.path.join('pep3147', '__init__.py'), 'w'):
+ pass
+ with open(os.path.join('pep3147', 'foo.py'), 'w'):
+ pass
+ unload('pep3147.foo')
+ unload('pep3147')
+ m = __import__('pep3147.foo')
+ init_pyc = imp.cache_from_source(
+ os.path.join('pep3147', '__init__.py'))
+ self.assertEqual(m.__cached__, os.path.join(os.curdir, init_pyc))
+ foo_pyc = imp.cache_from_source(os.path.join('pep3147', 'foo.py'))
+ self.assertEqual(sys.modules['pep3147.foo'].__cached__,
+ os.path.join(os.curdir, foo_pyc))
+
+ def test_package___cached___from_pyc(self):
+ # Like test___cached__ but ensuring __cached__ when imported from a
+ # PEP 3147 pyc file.
+ def cleanup():
+ rmtree('pep3147')
+ os.mkdir('pep3147')
+ self.addCleanup(cleanup)
+ unload('pep3147.foo')
+ unload('pep3147')
+ # Touch the __init__.py
+ with open(os.path.join('pep3147', '__init__.py'), 'w'):
+ pass
+ with open(os.path.join('pep3147', 'foo.py'), 'w'):
+ pass
+ m = __import__('pep3147.foo')
+ unload('pep3147.foo')
+ unload('pep3147')
+ m = __import__('pep3147.foo')
+ init_pyc = imp.cache_from_source(
+ os.path.join('pep3147', '__init__.py'))
+ self.assertEqual(m.__cached__, os.path.join(os.curdir, init_pyc))
+ foo_pyc = imp.cache_from_source(os.path.join('pep3147', 'foo.py'))
+ self.assertEqual(sys.modules['pep3147.foo'].__cached__,
+ os.path.join(os.curdir, foo_pyc))
+
+
class RelativeImportFromImportlibTests(test_relative_imports.RelativeImports):
def setUp(self):
@@ -492,8 +648,9 @@ class RelativeImportFromImportlibTests(test_relative_imports.RelativeImports):
def test_main(verbose=None):
- run_unittest(ImportTests,
+ run_unittest(ImportTests, PycacheTests,
PycRewritingTests, PathsTests, RelativeImportTests,
+ OverridingImportBuiltinTests,
RelativeImportFromImportlibTests)
diff --git a/Lib/test/test_importhooks.py b/Lib/test/test_importhooks.py
index 1da30b7c77..ec6730e9ba 100644
--- a/Lib/test/test_importhooks.py
+++ b/Lib/test/test_importhooks.py
@@ -221,15 +221,9 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
def testBlocker(self):
mname = "exceptions" # an arbitrary harmless builtin module
- if mname in sys.modules:
- del sys.modules[mname]
+ support.unload(mname)
sys.meta_path.append(ImportBlocker(mname))
- try:
- __import__(mname)
- except ImportError:
- pass
- else:
- self.fail("'%s' was not supposed to be importable" % mname)
+ self.assertRaises(ImportError, __import__, mname)
def testImpWrapper(self):
i = ImpWrapper()
diff --git a/Lib/test/test_importlib.py b/Lib/test/test_importlib.py
index cd13e329ed..6ed05859c9 100644
--- a/Lib/test/test_importlib.py
+++ b/Lib/test/test_importlib.py
@@ -1,9 +1,4 @@
-from test.support import run_unittest
-import importlib.test
-
-
-def test_main():
- run_unittest(importlib.test.test_suite('importlib.test'))
+from importlib.test.__main__ import test_main
if __name__ == '__main__':
diff --git a/Lib/test/test_index.py b/Lib/test/test_index.py
index ae905c2663..7a94af1b0a 100644
--- a/Lib/test/test_index.py
+++ b/Lib/test/test_index.py
@@ -2,13 +2,8 @@ import unittest
from test import support
import operator
maxsize = support.MAX_Py_ssize_t
-minsize = -maxsize-1
-class oldstyle:
- def __index__(self):
- return self.ind
-
-class newstyle(object):
+class newstyle:
def __index__(self):
return self.ind
@@ -16,13 +11,9 @@ class TrapInt(int):
def __index__(self):
return self
-class TrapLong(int):
- def __index__(self):
- return self
-
class BaseTestCase(unittest.TestCase):
def setUp(self):
- self.o = oldstyle()
+ self.o = newstyle()
self.n = newstyle()
def test_basic(self):
@@ -48,13 +39,13 @@ class BaseTestCase(unittest.TestCase):
self.assertEqual(-7 .__index__(), -7)
self.assertEqual(self.o.__index__(), 4)
self.assertEqual(self.n.__index__(), 5)
+ self.assertEqual(True.__index__(), 1)
+ self.assertEqual(False.__index__(), 0)
def test_subclasses(self):
r = list(range(10))
self.assertEqual(r[TrapInt(5):TrapInt(10)], r[5:10])
- self.assertEqual(r[TrapLong(5):TrapLong(10)], r[5:10])
self.assertEqual(slice(TrapInt()).indices(0), (0,0,1))
- self.assertEqual(slice(TrapLong(0)).indices(0), (0,0,1))
def test_error(self):
self.o.ind = 'dumb'
@@ -69,9 +60,9 @@ class SeqTestCase(unittest.TestCase):
# This test case isn't run directly. It just defines common tests
# to the different sequence types below
def setUp(self):
- self.o = oldstyle()
+ self.o = newstyle()
self.n = newstyle()
- self.o2 = oldstyle()
+ self.o2 = newstyle()
self.n2 = newstyle()
def test_index(self):
@@ -88,6 +79,21 @@ class SeqTestCase(unittest.TestCase):
self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])
+ def test_slice_bug7532(self):
+ seqlen = len(self.seq)
+ self.o.ind = int(seqlen * 1.5)
+ self.n.ind = seqlen + 2
+ self.assertEqual(self.seq[self.o:], self.seq[0:0])
+ self.assertEqual(self.seq[:self.o], self.seq)
+ self.assertEqual(self.seq[self.n:], self.seq[0:0])
+ self.assertEqual(self.seq[:self.n], self.seq)
+ self.o2.ind = -seqlen - 2
+ self.n2.ind = -int(seqlen * 1.5)
+ self.assertEqual(self.seq[self.o2:], self.seq)
+ self.assertEqual(self.seq[:self.o2], self.seq[0:0])
+ self.assertEqual(self.seq[self.n2:], self.seq)
+ self.assertEqual(self.seq[:self.n2], self.seq[0:0])
+
def test_repeat(self):
self.o.ind = 3
self.n.ind = 2
@@ -108,7 +114,6 @@ class SeqTestCase(unittest.TestCase):
def test_subclasses(self):
self.assertEqual(self.seq[TrapInt()], self.seq[0])
- self.assertEqual(self.seq[TrapLong()], self.seq[0])
def test_error(self):
self.o.ind = 'dumb'
@@ -151,18 +156,56 @@ class ListTestCase(SeqTestCase):
lst = [5, 6, 7, 8, 9, 11]
l2 = lst.__imul__(self.n)
- self.assertTrue(l2 is lst)
+ self.assertIs(l2, lst)
self.assertEqual(lst, [5, 6, 7, 8, 9, 11] * 3)
+class NewSeq:
+
+ def __init__(self, iterable):
+ self._list = list(iterable)
+
+ def __repr__(self):
+ return repr(self._list)
+
+ def __eq__(self, other):
+ return self._list == other
+
+ def __len__(self):
+ return len(self._list)
+
+ def __mul__(self, n):
+ return self.__class__(self._list*n)
+ __rmul__ = __mul__
+
+ def __getitem__(self, index):
+ return self._list[index]
+
+
class TupleTestCase(SeqTestCase):
seq = (0,10,20,30,40,50)
+class ByteArrayTestCase(SeqTestCase):
+ seq = bytearray(b"this is a test")
+
+class BytesTestCase(SeqTestCase):
+ seq = b"this is a test"
+
class StringTestCase(SeqTestCase):
seq = "this is a test"
-class UnicodeTestCase(SeqTestCase):
- seq = "this is a test"
+class NewSeqTestCase(SeqTestCase):
+ seq = NewSeq((0,10,20,30,40,50))
+
+
+
+class RangeTestCase(unittest.TestCase):
+
+ def test_range(self):
+ n = newstyle()
+ n.ind = 5
+ self.assertEqual(range(1, 20)[n], 6)
+ self.assertEqual(range(1, 20).__getitem__(n), 6)
class OverflowTestCase(unittest.TestCase):
@@ -176,9 +219,9 @@ class OverflowTestCase(unittest.TestCase):
self.assertEqual(self.neg.__index__(), self.neg)
def test_getitem(self):
- class GetItem(object):
+ class GetItem:
def __len__(self):
- return sys.maxsize
+ assert False, "__len__ should not be invoked"
def __getitem__(self, key):
return key
x = GetItem()
@@ -186,6 +229,8 @@ class OverflowTestCase(unittest.TestCase):
self.assertEqual(x[self.neg], self.neg)
self.assertEqual(x[self.neg:self.pos].indices(maxsize),
(0, maxsize, 1))
+ self.assertEqual(x[self.neg:self.pos:1].indices(maxsize),
+ (0, maxsize, 1))
def test_sequence_repeat(self):
self.assertRaises(OverflowError, lambda: "a" * self.pos)
@@ -197,8 +242,11 @@ def test_main():
BaseTestCase,
ListTestCase,
TupleTestCase,
+ BytesTestCase,
+ ByteArrayTestCase,
StringTestCase,
- UnicodeTestCase,
+ NewSeqTestCase,
+ RangeTestCase,
OverflowTestCase,
)
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 34e0a9a824..f5dff1e543 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -1,3 +1,4 @@
+import re
import sys
import types
import unittest
@@ -5,9 +6,11 @@ import inspect
import linecache
import datetime
import collections
+import os
+import shutil
from os.path import normcase
-from test.support import TESTFN, run_unittest
+from test.support import run_unittest, TESTFN, DirsOnSysPath
from test import inspect_fodder as mod
from test import inspect_fodder2 as mod2
@@ -118,8 +121,8 @@ class TestPredicates(IsTestBase):
x = C()
x.a = 42
members = dict(inspect.getmembers(x))
- self.assertTrue('a' in members)
- self.assertTrue('b' not in members)
+ self.assertIn('a', members)
+ self.assertNotIn('b', members)
def test_isabstract(self):
from abc import ABCMeta, abstractmethod
@@ -193,12 +196,12 @@ class TestInterpreterStack(IsTestBase):
class GetSourceBase(unittest.TestCase):
# Subclasses must override.
- fodderFile = None
+ fodderModule = None
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
- with open(inspect.getsourcefile(self.fodderFile)) as fp:
+ with open(inspect.getsourcefile(self.fodderModule)) as fp:
self.source = fp.read()
def sourcerange(self, top, bottom):
@@ -210,7 +213,7 @@ class GetSourceBase(unittest.TestCase):
self.sourcerange(top, bottom))
class TestRetrievingSourceCode(GetSourceBase):
- fodderFile = mod
+ fodderModule = mod
def test_getclasses(self):
classes = inspect.getmembers(mod, inspect.isclass)
@@ -237,6 +240,8 @@ class TestRetrievingSourceCode(GetSourceBase):
self.assertEqual(functions, [('eggs', mod.eggs),
('spam', mod.spam)])
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_getdoc(self):
self.assertEqual(inspect.getdoc(mod), 'A module docstring.')
self.assertEqual(inspect.getdoc(mod.StupidGit),
@@ -294,7 +299,7 @@ class TestRetrievingSourceCode(GetSourceBase):
inspect.getmodule(compile('a=10','','single'))
class TestDecorators(GetSourceBase):
- fodderFile = mod2
+ fodderModule = mod2
def test_wrapped_decorator(self):
self.assertSourceEqual(mod2.wrapped, 14, 17)
@@ -303,7 +308,7 @@ class TestDecorators(GetSourceBase):
self.assertSourceEqual(mod2.gone, 9, 10)
class TestOneliners(GetSourceBase):
- fodderFile = mod2
+ fodderModule = mod2
def test_oneline_lambda(self):
# Test inspect.getsource with a one-line lambda function.
self.assertSourceEqual(mod2.oll, 25, 25)
@@ -345,7 +350,7 @@ class TestOneliners(GetSourceBase):
self.assertSourceEqual(mod2.anonymous, 55, 55)
class TestBuggyCases(GetSourceBase):
- fodderFile = mod2
+ fodderModule = mod2
def test_with_comment(self):
self.assertSourceEqual(mod2.with_comment, 58, 59)
@@ -385,6 +390,24 @@ class TestBuggyCases(GetSourceBase):
self.assertEqual(inspect.findsource(co), (lines,0))
self.assertEqual(inspect.getsource(co), lines[0])
+class TestNoEOL(GetSourceBase):
+ def __init__(self, *args, **kwargs):
+ self.tempdir = TESTFN + '_dir'
+ os.mkdir(self.tempdir)
+ with open(os.path.join(self.tempdir,
+ 'inspect_fodder3%spy' % os.extsep), 'w') as f:
+ f.write("class X:\n pass # No EOL")
+ with DirsOnSysPath(self.tempdir):
+ import inspect_fodder3 as mod3
+ self.fodderModule = mod3
+ GetSourceBase.__init__(self, *args, **kwargs)
+
+ def tearDown(self):
+ shutil.rmtree(self.tempdir)
+
+ def test_class(self):
+ self.assertSourceEqual(self.fodderModule.X, 1, 2)
+
# Helper for testing classify_class_attrs.
def attrs_wo_objs(cls):
return [t[:3] for t in inspect.classify_class_attrs(cls)]
@@ -486,25 +509,25 @@ class TestClassesAndFunctions(unittest.TestCase):
datablob = '1'
attrs = attrs_wo_objs(A)
- self.assertTrue(('s', 'static method', A) in attrs, 'missing static method')
- self.assertTrue(('c', 'class method', A) in attrs, 'missing class method')
- self.assertTrue(('p', 'property', A) in attrs, 'missing property')
- self.assertTrue(('m', 'method', A) in attrs,
- 'missing plain method: %r' % attrs)
- self.assertTrue(('m1', 'method', A) in attrs, 'missing plain method')
- self.assertTrue(('datablob', 'data', A) in attrs, 'missing data')
+ self.assertIn(('s', 'static method', A), attrs, 'missing static method')
+ self.assertIn(('c', 'class method', A), attrs, 'missing class method')
+ self.assertIn(('p', 'property', A), attrs, 'missing property')
+ self.assertIn(('m', 'method', A), attrs,
+ 'missing plain method: %r' % attrs)
+ self.assertIn(('m1', 'method', A), attrs, 'missing plain method')
+ self.assertIn(('datablob', 'data', A), attrs, 'missing data')
class B(A):
def m(self): pass
attrs = attrs_wo_objs(B)
- self.assertTrue(('s', 'static method', A) in attrs, 'missing static method')
- self.assertTrue(('c', 'class method', A) in attrs, 'missing class method')
- self.assertTrue(('p', 'property', A) in attrs, 'missing property')
- self.assertTrue(('m', 'method', B) in attrs, 'missing plain method')
- self.assertTrue(('m1', 'method', A) in attrs, 'missing plain method')
- self.assertTrue(('datablob', 'data', A) in attrs, 'missing data')
+ self.assertIn(('s', 'static method', A), attrs, 'missing static method')
+ self.assertIn(('c', 'class method', A), attrs, 'missing class method')
+ self.assertIn(('p', 'property', A), attrs, 'missing property')
+ self.assertIn(('m', 'method', B), attrs, 'missing plain method')
+ self.assertIn(('m1', 'method', A), attrs, 'missing plain method')
+ self.assertIn(('datablob', 'data', A), attrs, 'missing data')
class C(A):
@@ -513,29 +536,518 @@ class TestClassesAndFunctions(unittest.TestCase):
def c(self): pass
attrs = attrs_wo_objs(C)
- self.assertTrue(('s', 'static method', A) in attrs, 'missing static method')
- self.assertTrue(('c', 'method', C) in attrs, 'missing plain method')
- self.assertTrue(('p', 'property', A) in attrs, 'missing property')
- self.assertTrue(('m', 'method', C) in attrs, 'missing plain method')
- self.assertTrue(('m1', 'method', A) in attrs, 'missing plain method')
- self.assertTrue(('datablob', 'data', A) in attrs, 'missing data')
+ self.assertIn(('s', 'static method', A), attrs, 'missing static method')
+ self.assertIn(('c', 'method', C), attrs, 'missing plain method')
+ self.assertIn(('p', 'property', A), attrs, 'missing property')
+ self.assertIn(('m', 'method', C), attrs, 'missing plain method')
+ self.assertIn(('m1', 'method', A), attrs, 'missing plain method')
+ self.assertIn(('datablob', 'data', A), attrs, 'missing data')
class D(B, C):
def m1(self): pass
attrs = attrs_wo_objs(D)
- self.assertTrue(('s', 'static method', A) in attrs, 'missing static method')
- self.assertTrue(('c', 'method', C) in attrs, 'missing plain method')
- self.assertTrue(('p', 'property', A) in attrs, 'missing property')
- self.assertTrue(('m', 'method', B) in attrs, 'missing plain method')
- self.assertTrue(('m1', 'method', D) in attrs, 'missing plain method')
- self.assertTrue(('datablob', 'data', A) in attrs, 'missing data')
+ self.assertIn(('s', 'static method', A), attrs, 'missing static method')
+ self.assertIn(('c', 'method', C), attrs, 'missing plain method')
+ self.assertIn(('p', 'property', A), attrs, 'missing property')
+ self.assertIn(('m', 'method', B), attrs, 'missing plain method')
+ self.assertIn(('m1', 'method', D), attrs, 'missing plain method')
+ self.assertIn(('datablob', 'data', A), attrs, 'missing data')
+
+class TestGetcallargsFunctions(unittest.TestCase):
+
+ def assertEqualCallArgs(self, func, call_params_string, locs=None):
+ locs = dict(locs or {}, func=func)
+ r1 = eval('func(%s)' % call_params_string, None, locs)
+ r2 = eval('inspect.getcallargs(func, %s)' % call_params_string, None,
+ locs)
+ self.assertEqual(r1, r2)
+
+ def assertEqualException(self, func, call_param_string, locs=None):
+ locs = dict(locs or {}, func=func)
+ try:
+ eval('func(%s)' % call_param_string, None, locs)
+ except Exception as e:
+ ex1 = e
+ else:
+ self.fail('Exception not raised')
+ try:
+ eval('inspect.getcallargs(func, %s)' % call_param_string, None,
+ locs)
+ except Exception as e:
+ ex2 = e
+ else:
+ self.fail('Exception not raised')
+ self.assertIs(type(ex1), type(ex2))
+ self.assertEqual(str(ex1), str(ex2))
+ del ex1, ex2
+
+ def makeCallable(self, signature):
+ """Create a function that returns its locals()"""
+ code = "lambda %s: locals()"
+ return eval(code % signature)
+
+ def test_plain(self):
+ f = self.makeCallable('a, b=1')
+ self.assertEqualCallArgs(f, '2')
+ self.assertEqualCallArgs(f, '2, 3')
+ self.assertEqualCallArgs(f, 'a=2')
+ self.assertEqualCallArgs(f, 'b=3, a=2')
+ self.assertEqualCallArgs(f, '2, b=3')
+ # expand *iterable / **mapping
+ self.assertEqualCallArgs(f, '*(2,)')
+ self.assertEqualCallArgs(f, '*[2]')
+ self.assertEqualCallArgs(f, '*(2, 3)')
+ self.assertEqualCallArgs(f, '*[2, 3]')
+ self.assertEqualCallArgs(f, '**{"a":2}')
+ self.assertEqualCallArgs(f, 'b=3, **{"a":2}')
+ self.assertEqualCallArgs(f, '2, **{"b":3}')
+ self.assertEqualCallArgs(f, '**{"b":3, "a":2}')
+ # expand UserList / UserDict
+ self.assertEqualCallArgs(f, '*collections.UserList([2])')
+ self.assertEqualCallArgs(f, '*collections.UserList([2, 3])')
+ self.assertEqualCallArgs(f, '**collections.UserDict(a=2)')
+ self.assertEqualCallArgs(f, '2, **collections.UserDict(b=3)')
+ self.assertEqualCallArgs(f, 'b=2, **collections.UserDict(a=3)')
+
+ def test_varargs(self):
+ f = self.makeCallable('a, b=1, *c')
+ self.assertEqualCallArgs(f, '2')
+ self.assertEqualCallArgs(f, '2, 3')
+ self.assertEqualCallArgs(f, '2, 3, 4')
+ self.assertEqualCallArgs(f, '*(2,3,4)')
+ self.assertEqualCallArgs(f, '2, *[3,4]')
+ self.assertEqualCallArgs(f, '2, 3, *collections.UserList([4])')
+
+ def test_varkw(self):
+ f = self.makeCallable('a, b=1, **c')
+ self.assertEqualCallArgs(f, 'a=2')
+ self.assertEqualCallArgs(f, '2, b=3, c=4')
+ self.assertEqualCallArgs(f, 'b=3, a=2, c=4')
+ self.assertEqualCallArgs(f, 'c=4, **{"a":2, "b":3}')
+ self.assertEqualCallArgs(f, '2, c=4, **{"b":3}')
+ self.assertEqualCallArgs(f, 'b=2, **{"a":3, "c":4}')
+ self.assertEqualCallArgs(f, '**collections.UserDict(a=2, b=3, c=4)')
+ self.assertEqualCallArgs(f, '2, c=4, **collections.UserDict(b=3)')
+ self.assertEqualCallArgs(f, 'b=2, **collections.UserDict(a=3, c=4)')
+
+ def test_varkw_only(self):
+ # issue11256:
+ f = self.makeCallable('**c')
+ self.assertEqualCallArgs(f, '')
+ self.assertEqualCallArgs(f, 'a=1')
+ self.assertEqualCallArgs(f, 'a=1, b=2')
+ self.assertEqualCallArgs(f, 'c=3, **{"a": 1, "b": 2}')
+ self.assertEqualCallArgs(f, '**collections.UserDict(a=1, b=2)')
+ self.assertEqualCallArgs(f, 'c=3, **collections.UserDict(a=1, b=2)')
+
+ def test_keyword_only(self):
+ f = self.makeCallable('a=3, *, c, d=2')
+ self.assertEqualCallArgs(f, 'c=3')
+ self.assertEqualCallArgs(f, 'c=3, a=3')
+ self.assertEqualCallArgs(f, 'a=2, c=4')
+ self.assertEqualCallArgs(f, '4, c=4')
+ self.assertEqualException(f, '')
+ self.assertEqualException(f, '3')
+ self.assertEqualException(f, 'a=3')
+ self.assertEqualException(f, 'd=4')
+
+ f = self.makeCallable('*, c, d=2')
+ self.assertEqualCallArgs(f, 'c=3')
+ self.assertEqualCallArgs(f, 'c=3, d=4')
+ self.assertEqualCallArgs(f, 'd=4, c=3')
+
+ def test_multiple_features(self):
+ f = self.makeCallable('a, b=2, *f, **g')
+ self.assertEqualCallArgs(f, '2, 3, 7')
+ self.assertEqualCallArgs(f, '2, 3, x=8')
+ self.assertEqualCallArgs(f, '2, 3, x=8, *[(4,[5,6]), 7]')
+ self.assertEqualCallArgs(f, '2, x=8, *[3, (4,[5,6]), 7], y=9')
+ self.assertEqualCallArgs(f, 'x=8, *[2, 3, (4,[5,6])], y=9')
+ self.assertEqualCallArgs(f, 'x=8, *collections.UserList('
+ '[2, 3, (4,[5,6])]), **{"y":9, "z":10}')
+ self.assertEqualCallArgs(f, '2, x=8, *collections.UserList([3, '
+ '(4,[5,6])]), **collections.UserDict('
+ 'y=9, z=10)')
+
+ f = self.makeCallable('a, b=2, *f, x, y=99, **g')
+ self.assertEqualCallArgs(f, '2, 3, x=8')
+ self.assertEqualCallArgs(f, '2, 3, x=8, *[(4,[5,6]), 7]')
+ self.assertEqualCallArgs(f, '2, x=8, *[3, (4,[5,6]), 7], y=9, z=10')
+ self.assertEqualCallArgs(f, 'x=8, *[2, 3, (4,[5,6])], y=9, z=10')
+ self.assertEqualCallArgs(f, 'x=8, *collections.UserList('
+ '[2, 3, (4,[5,6])]), q=0, **{"y":9, "z":10}')
+ self.assertEqualCallArgs(f, '2, x=8, *collections.UserList([3, '
+ '(4,[5,6])]), q=0, **collections.UserDict('
+ 'y=9, z=10)')
+
+ def test_errors(self):
+ f0 = self.makeCallable('')
+ f1 = self.makeCallable('a, b')
+ f2 = self.makeCallable('a, b=1')
+ # f0 takes no arguments
+ self.assertEqualException(f0, '1')
+ self.assertEqualException(f0, 'x=1')
+ self.assertEqualException(f0, '1,x=1')
+ # f1 takes exactly 2 arguments
+ self.assertEqualException(f1, '')
+ self.assertEqualException(f1, '1')
+ self.assertEqualException(f1, 'a=2')
+ self.assertEqualException(f1, 'b=3')
+ # f2 takes at least 1 argument
+ self.assertEqualException(f2, '')
+ self.assertEqualException(f2, 'b=3')
+ for f in f1, f2:
+ # f1/f2 takes exactly/at most 2 arguments
+ self.assertEqualException(f, '2, 3, 4')
+ self.assertEqualException(f, '1, 2, 3, a=1')
+ self.assertEqualException(f, '2, 3, 4, c=5')
+ self.assertEqualException(f, '2, 3, 4, a=1, c=5')
+ # f got an unexpected keyword argument
+ self.assertEqualException(f, 'c=2')
+ self.assertEqualException(f, '2, c=3')
+ self.assertEqualException(f, '2, 3, c=4')
+ self.assertEqualException(f, '2, c=4, b=3')
+ self.assertEqualException(f, '**{u"\u03c0\u03b9": 4}')
+ # f got multiple values for keyword argument
+ self.assertEqualException(f, '1, a=2')
+ self.assertEqualException(f, '1, **{"a":2}')
+ self.assertEqualException(f, '1, 2, b=3')
+ # XXX: Python inconsistency
+ # - for functions and bound methods: unexpected keyword 'c'
+ # - for unbound methods: multiple values for keyword 'a'
+ #self.assertEqualException(f, '1, c=3, a=2')
+ # issue11256:
+ f3 = self.makeCallable('**c')
+ self.assertEqualException(f3, '1, 2')
+ self.assertEqualException(f3, '1, 2, a=1, b=2')
+ f4 = self.makeCallable('*, a, b=0')
+ self.assertEqualException(f3, '1, 2')
+ self.assertEqualException(f3, '1, 2, a=1, b=2')
+
+class TestGetcallargsMethods(TestGetcallargsFunctions):
+
+ def setUp(self):
+ class Foo(object):
+ pass
+ self.cls = Foo
+ self.inst = Foo()
+
+ def makeCallable(self, signature):
+ assert 'self' not in signature
+ mk = super(TestGetcallargsMethods, self).makeCallable
+ self.cls.method = mk('self, ' + signature)
+ return self.inst.method
+
+class TestGetcallargsUnboundMethods(TestGetcallargsMethods):
+
+ def makeCallable(self, signature):
+ super(TestGetcallargsUnboundMethods, self).makeCallable(signature)
+ return self.cls.method
+
+ def assertEqualCallArgs(self, func, call_params_string, locs=None):
+ return super(TestGetcallargsUnboundMethods, self).assertEqualCallArgs(
+ *self._getAssertEqualParams(func, call_params_string, locs))
+
+ def assertEqualException(self, func, call_params_string, locs=None):
+ return super(TestGetcallargsUnboundMethods, self).assertEqualException(
+ *self._getAssertEqualParams(func, call_params_string, locs))
+
+ def _getAssertEqualParams(self, func, call_params_string, locs=None):
+ assert 'inst' not in call_params_string
+ locs = dict(locs or {}, inst=self.inst)
+ return (func, 'inst,' + call_params_string, locs)
+
+
+class TestGetattrStatic(unittest.TestCase):
+
+ def test_basic(self):
+ class Thing(object):
+ x = object()
+
+ thing = Thing()
+ self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
+ self.assertEqual(inspect.getattr_static(thing, 'x', None), Thing.x)
+ with self.assertRaises(AttributeError):
+ inspect.getattr_static(thing, 'y')
+
+ self.assertEqual(inspect.getattr_static(thing, 'y', 3), 3)
+
+ def test_inherited(self):
+ class Thing(object):
+ x = object()
+ class OtherThing(Thing):
+ pass
+
+ something = OtherThing()
+ self.assertEqual(inspect.getattr_static(something, 'x'), Thing.x)
+
+ def test_instance_attr(self):
+ class Thing(object):
+ x = 2
+ def __init__(self, x):
+ self.x = x
+ thing = Thing(3)
+ self.assertEqual(inspect.getattr_static(thing, 'x'), 3)
+ del thing.x
+ self.assertEqual(inspect.getattr_static(thing, 'x'), 2)
+
+ def test_property(self):
+ class Thing(object):
+ @property
+ def x(self):
+ raise AttributeError("I'm pretending not to exist")
+ thing = Thing()
+ self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
+
+ def test_descriptor_raises_AttributeError(self):
+ class descriptor(object):
+ def __get__(*_):
+ raise AttributeError("I'm pretending not to exist")
+ desc = descriptor()
+ class Thing(object):
+ x = desc
+ thing = Thing()
+ self.assertEqual(inspect.getattr_static(thing, 'x'), desc)
+
+ def test_classAttribute(self):
+ class Thing(object):
+ x = object()
+
+ self.assertEqual(inspect.getattr_static(Thing, 'x'), Thing.x)
+
+ def test_inherited_classattribute(self):
+ class Thing(object):
+ x = object()
+ class OtherThing(Thing):
+ pass
+
+ self.assertEqual(inspect.getattr_static(OtherThing, 'x'), Thing.x)
+
+ def test_slots(self):
+ class Thing(object):
+ y = 'bar'
+ __slots__ = ['x']
+ def __init__(self):
+ self.x = 'foo'
+ thing = Thing()
+ self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
+ self.assertEqual(inspect.getattr_static(thing, 'y'), 'bar')
+
+ del thing.x
+ self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
+
+ def test_metaclass(self):
+ class meta(type):
+ attr = 'foo'
+ class Thing(object, metaclass=meta):
+ pass
+ self.assertEqual(inspect.getattr_static(Thing, 'attr'), 'foo')
+
+ class sub(meta):
+ pass
+ class OtherThing(object, metaclass=sub):
+ x = 3
+ self.assertEqual(inspect.getattr_static(OtherThing, 'attr'), 'foo')
+
+ class OtherOtherThing(OtherThing):
+ pass
+ # this test is odd, but it was added as it exposed a bug
+ self.assertEqual(inspect.getattr_static(OtherOtherThing, 'x'), 3)
+
+ def test_no_dict_no_slots(self):
+ self.assertEqual(inspect.getattr_static(1, 'foo', None), None)
+ self.assertNotEqual(inspect.getattr_static('foo', 'lower'), None)
+
+ def test_no_dict_no_slots_instance_member(self):
+ # returns descriptor
+ with open(__file__) as handle:
+ self.assertEqual(inspect.getattr_static(handle, 'name'), type(handle).name)
+
+ def test_inherited_slots(self):
+ # returns descriptor
+ class Thing(object):
+ __slots__ = ['x']
+ def __init__(self):
+ self.x = 'foo'
+
+ class OtherThing(Thing):
+ pass
+ # it would be nice if this worked...
+ # we get the descriptor instead of the instance attribute
+ self.assertEqual(inspect.getattr_static(OtherThing(), 'x'), Thing.x)
+
+ def test_descriptor(self):
+ class descriptor(object):
+ def __get__(self, instance, owner):
+ return 3
+ class Foo(object):
+ d = descriptor()
+
+ foo = Foo()
+
+ # for a non data descriptor we return the instance attribute
+ foo.__dict__['d'] = 1
+ self.assertEqual(inspect.getattr_static(foo, 'd'), 1)
+
+ # if the descriptor is a data-desciptor we should return the
+ # descriptor
+ descriptor.__set__ = lambda s, i, v: None
+ self.assertEqual(inspect.getattr_static(foo, 'd'), Foo.__dict__['d'])
+
+
+ def test_metaclass_with_descriptor(self):
+ class descriptor(object):
+ def __get__(self, instance, owner):
+ return 3
+ class meta(type):
+ d = descriptor()
+ class Thing(object, metaclass=meta):
+ pass
+ self.assertEqual(inspect.getattr_static(Thing, 'd'), meta.__dict__['d'])
+
+
+ def test_class_as_property(self):
+ class Base(object):
+ foo = 3
+
+ class Something(Base):
+ executed = False
+ @property
+ def __class__(self):
+ self.executed = True
+ return object
+
+ instance = Something()
+ self.assertEqual(inspect.getattr_static(instance, 'foo'), 3)
+ self.assertFalse(instance.executed)
+ self.assertEqual(inspect.getattr_static(Something, 'foo'), 3)
+
+ def test_mro_as_property(self):
+ class Meta(type):
+ @property
+ def __mro__(self):
+ return (object,)
+
+ class Base(object):
+ foo = 3
+
+ class Something(Base, metaclass=Meta):
+ pass
+
+ self.assertEqual(inspect.getattr_static(Something(), 'foo'), 3)
+ self.assertEqual(inspect.getattr_static(Something, 'foo'), 3)
+
+ def test_dict_as_property(self):
+ test = self
+ test.called = False
+
+ class Foo(dict):
+ a = 3
+ @property
+ def __dict__(self):
+ test.called = True
+ return {}
+
+ foo = Foo()
+ foo.a = 4
+ self.assertEqual(inspect.getattr_static(foo, 'a'), 3)
+ self.assertFalse(test.called)
+
+ def test_custom_object_dict(self):
+ test = self
+ test.called = False
+
+ class Custom(dict):
+ def get(self, key, default=None):
+ test.called = True
+ super().get(key, default)
+
+ class Foo(object):
+ a = 3
+ foo = Foo()
+ foo.__dict__ = Custom()
+ self.assertEqual(inspect.getattr_static(foo, 'a'), 3)
+ self.assertFalse(test.called)
+
+ def test_metaclass_dict_as_property(self):
+ class Meta(type):
+ @property
+ def __dict__(self):
+ self.executed = True
+
+ class Thing(metaclass=Meta):
+ executed = False
+
+ def __init__(self):
+ self.spam = 42
+
+ instance = Thing()
+ self.assertEqual(inspect.getattr_static(instance, "spam"), 42)
+ self.assertFalse(Thing.executed)
+
+class TestGetGeneratorState(unittest.TestCase):
+
+ def setUp(self):
+ def number_generator():
+ for number in range(5):
+ yield number
+ self.generator = number_generator()
+
+ def _generatorstate(self):
+ return inspect.getgeneratorstate(self.generator)
+
+ def test_created(self):
+ self.assertEqual(self._generatorstate(), inspect.GEN_CREATED)
+
+ def test_suspended(self):
+ next(self.generator)
+ self.assertEqual(self._generatorstate(), inspect.GEN_SUSPENDED)
+
+ def test_closed_after_exhaustion(self):
+ for i in self.generator:
+ pass
+ self.assertEqual(self._generatorstate(), inspect.GEN_CLOSED)
+
+ def test_closed_after_immediate_exception(self):
+ with self.assertRaises(RuntimeError):
+ self.generator.throw(RuntimeError)
+ self.assertEqual(self._generatorstate(), inspect.GEN_CLOSED)
+
+ def test_running(self):
+ # As mentioned on issue #10220, checking for the RUNNING state only
+ # makes sense inside the generator itself.
+ # The following generator checks for this by using the closure's
+ # reference to self and the generator state checking helper method
+ def running_check_generator():
+ for number in range(5):
+ self.assertEqual(self._generatorstate(), inspect.GEN_RUNNING)
+ yield number
+ self.assertEqual(self._generatorstate(), inspect.GEN_RUNNING)
+ self.generator = running_check_generator()
+ # Running up to the first yield
+ next(self.generator)
+ # Running after the first yield
+ next(self.generator)
+
+ def test_easy_debugging(self):
+ # repr() and str() of a generator state should contain the state name
+ names = 'GEN_CREATED GEN_RUNNING GEN_SUSPENDED GEN_CLOSED'.split()
+ for name in names:
+ state = getattr(inspect, name)
+ self.assertIn(name, repr(state))
+ self.assertIn(name, str(state))
+
def test_main():
- run_unittest(TestDecorators, TestRetrievingSourceCode, TestOneliners,
- TestBuggyCases,
- TestInterpreterStack, TestClassesAndFunctions, TestPredicates)
+ run_unittest(
+ TestDecorators, TestRetrievingSourceCode, TestOneliners, TestBuggyCases,
+ TestInterpreterStack, TestClassesAndFunctions, TestPredicates,
+ TestGetcallargsFunctions, TestGetcallargsMethods,
+ TestGetcallargsUnboundMethods, TestGetattrStatic, TestGetGeneratorState,
+ TestNoEOL
+ )
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
index f7d2318686..437e323cbc 100644
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -20,7 +20,8 @@ L = [
(' 1\02 ', ValueError),
('', ValueError),
(' ', ValueError),
- (' \t\t ', ValueError)
+ (' \t\t ', ValueError),
+ ("\u0200", ValueError)
]
class IntTestCases(unittest.TestCase):
@@ -34,6 +35,9 @@ class IntTestCases(unittest.TestCase):
self.assertEqual(int(-3.9), -3)
self.assertEqual(int(3.5), 3)
self.assertEqual(int(-3.5), -3)
+ self.assertEqual(int("-3"), -3)
+ self.assertEqual(int(" -3 "), -3)
+ self.assertEqual(int("\N{EM SPACE}-3\N{EN SPACE}"), -3)
# Different base:
self.assertEqual(int("10",16), 16)
# Test conversion from strings and various anomalies
@@ -52,15 +56,15 @@ class IntTestCases(unittest.TestCase):
s = repr(-1-sys.maxsize)
x = int(s)
self.assertEqual(x+1, -sys.maxsize)
- self.assertTrue(isinstance(x, int))
- # should return long
+ self.assertIsInstance(x, int)
+ # should return int
self.assertEqual(int(s[1:]), sys.maxsize+1)
- # should return long
+ # should return int
x = int(1e100)
- self.assertTrue(isinstance(x, int))
+ self.assertIsInstance(x, int)
x = int(-1e100)
- self.assertTrue(isinstance(x, int))
+ self.assertIsInstance(x, int)
# SF bug 434186: 0x80000000/2 != 0x80000000>>1.
@@ -78,7 +82,8 @@ class IntTestCases(unittest.TestCase):
self.assertRaises(ValueError, int, '123\x00 245', 20)
x = int('1' * 600)
- self.assertTrue(isinstance(x, int))
+ self.assertIsInstance(x, int)
+
self.assertRaises(TypeError, int, 1, 12)
@@ -300,6 +305,16 @@ class IntTestCases(unittest.TestCase):
self.fail("Failed to raise TypeError with %s" %
((base, trunc_result_base),))
+ def test_error_message(self):
+ testlist = ('\xbd', '123\xbd', ' 123 456 ')
+ for s in testlist:
+ try:
+ int(s)
+ except ValueError as e:
+ self.assertIn(s.strip(), e.args[0])
+ else:
+ self.fail("Expected int(%r) to raise a ValueError", s)
+
def test_main():
run_unittest(IntTestCases)
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 5f62494e63..b665a6cd49 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -23,22 +23,25 @@ import os
import sys
import time
import array
-import threading
import random
import unittest
-import warnings
import weakref
-import gc
import abc
import signal
import errno
-from itertools import chain, cycle, count
+import warnings
+import pickle
+from itertools import cycle, count
from collections import deque
from test import support
import codecs
import io # C implementation of io
import _pyio as pyio # Python implementation of io
+try:
+ import threading
+except ImportError:
+ threading = None
def _default_chunk_size():
@@ -189,6 +192,23 @@ class PyMockFileIO(MockFileIO, pyio.BytesIO):
pass
+class MockUnseekableIO:
+ def seekable(self):
+ return False
+
+ def seek(self, *args):
+ raise self.UnsupportedOperation("not seekable")
+
+ def tell(self, *args):
+ raise self.UnsupportedOperation("not seekable")
+
+class CMockUnseekableIO(MockUnseekableIO, io.BytesIO):
+ UnsupportedOperation = io.UnsupportedOperation
+
+class PyMockUnseekableIO(MockUnseekableIO, pyio.BytesIO):
+ UnsupportedOperation = pyio.UnsupportedOperation
+
+
class MockNonBlockWriterIO:
def __init__(self):
@@ -314,16 +334,26 @@ class IOTest(unittest.TestCase):
def test_invalid_operations(self):
# Try writing on a file opened in read mode and vice-versa.
+ exc = self.UnsupportedOperation
for mode in ("w", "wb"):
with self.open(support.TESTFN, mode) as fp:
- self.assertRaises(IOError, fp.read)
- self.assertRaises(IOError, fp.readline)
+ self.assertRaises(exc, fp.read)
+ self.assertRaises(exc, fp.readline)
+ with self.open(support.TESTFN, "wb", buffering=0) as fp:
+ self.assertRaises(exc, fp.read)
+ self.assertRaises(exc, fp.readline)
+ with self.open(support.TESTFN, "rb", buffering=0) as fp:
+ self.assertRaises(exc, fp.write, b"blah")
+ self.assertRaises(exc, fp.writelines, [b"blah\n"])
with self.open(support.TESTFN, "rb") as fp:
- self.assertRaises(IOError, fp.write, b"blah")
- self.assertRaises(IOError, fp.writelines, [b"blah\n"])
+ self.assertRaises(exc, fp.write, b"blah")
+ self.assertRaises(exc, fp.writelines, [b"blah\n"])
with self.open(support.TESTFN, "r") as fp:
- self.assertRaises(IOError, fp.write, "blah")
- self.assertRaises(IOError, fp.writelines, ["blah\n"])
+ self.assertRaises(exc, fp.write, "blah")
+ self.assertRaises(exc, fp.writelines, ["blah\n"])
+ # Non-zero seeking from current or end pos
+ self.assertRaises(exc, fp.seek, 1, self.SEEK_CUR)
+ self.assertRaises(exc, fp.seek, -1, self.SEEK_END)
def test_raw_file_io(self):
with self.open(support.TESTFN, "wb", buffering=0) as f:
@@ -432,13 +462,14 @@ class IOTest(unittest.TestCase):
def flush(self):
record.append(3)
super().flush()
- f = MyFileIO(support.TESTFN, "wb")
- f.write(b"xxx")
- del f
- support.gc_collect()
- self.assertEqual(record, [1, 2, 3])
- with self.open(support.TESTFN, "rb") as f:
- self.assertEqual(f.read(), b"xxx")
+ with support.check_warnings(('', ResourceWarning)):
+ f = MyFileIO(support.TESTFN, "wb")
+ f.write(b"xxx")
+ del f
+ support.gc_collect()
+ self.assertEqual(record, [1, 2, 3])
+ with self.open(support.TESTFN, "rb") as f:
+ self.assertEqual(f.read(), b"xxx")
def _check_base_destructor(self, base):
record = []
@@ -490,7 +521,7 @@ class IOTest(unittest.TestCase):
def test_array_writes(self):
a = array.array('i', range(10))
- n = len(a.tostring())
+ n = len(a.tobytes())
with self.open(support.TESTFN, "wb", 0) as f:
self.assertEqual(f.write(a), n)
with self.open(support.TESTFN, "wb") as f:
@@ -525,12 +556,13 @@ class IOTest(unittest.TestCase):
def test_garbage_collection(self):
# FileIO objects are collected, and collecting them flushes
# all data to disk.
- f = self.FileIO(support.TESTFN, "wb")
- f.write(b"abcxxx")
- f.f = f
- wr = weakref.ref(f)
- del f
- support.gc_collect()
+ with support.check_warnings(('', ResourceWarning)):
+ f = self.FileIO(support.TESTFN, "wb")
+ f.write(b"abcxxx")
+ f.f = f
+ wr = weakref.ref(f)
+ del f
+ support.gc_collect()
self.assertTrue(wr() is None, wr)
with self.open(support.TESTFN, "rb") as f:
self.assertEqual(f.read(), b"abcxxx")
@@ -693,6 +725,11 @@ class CommonBufferedTests:
b.close()
self.assertRaises(ValueError, b.flush)
+ def test_unseekable(self):
+ bufio = self.tp(self.MockUnseekableIO(b"A" * 10))
+ self.assertRaises(self.UnsupportedOperation, bufio.tell)
+ self.assertRaises(self.UnsupportedOperation, bufio.seek, 0)
+
def test_readonly_attributes(self):
raw = self.MockRawIO()
buf = self.tp(raw)
@@ -810,6 +847,7 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
self.assertEqual(b"abcdefg", bufio.read())
+ @unittest.skipUnless(threading, 'Threading required for this test.')
@support.requires_resource('cpu')
def test_threads(self):
try:
@@ -1078,6 +1116,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
with self.open(support.TESTFN, "rb", buffering=0) as f:
self.assertEqual(f.read(), b"abc")
+ @unittest.skipUnless(threading, 'Threading required for this test.')
@support.requires_resource('cpu')
def test_threads(self):
try:
@@ -1136,14 +1175,9 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
self.assertRaises(IOError, bufio.write, b"abcdef")
def test_max_buffer_size_deprecation(self):
- with support.check_warnings() as w:
- warnings.simplefilter("always", DeprecationWarning)
+ with support.check_warnings(("max_buffer_size is deprecated",
+ DeprecationWarning)):
self.tp(self.MockRawIO(), 8, 12)
- self.assertEqual(len(w.warnings), 1)
- warning = w.warnings[0]
- self.assertTrue(warning.category is DeprecationWarning)
- self.assertEqual(str(warning.message),
- "max_buffer_size is deprecated")
class CBufferedWriterTest(BufferedWriterTest):
@@ -1199,14 +1233,9 @@ class BufferedRWPairTest(unittest.TestCase):
self.assertRaises(self.UnsupportedOperation, pair.detach)
def test_constructor_max_buffer_size_deprecation(self):
- with support.check_warnings() as w:
- warnings.simplefilter("always", DeprecationWarning)
+ with support.check_warnings(("max_buffer_size is deprecated",
+ DeprecationWarning)):
self.tp(self.MockRawIO(), self.MockRawIO(), 8, 12)
- self.assertEqual(len(w.warnings), 1)
- warning = w.warnings[0]
- self.assertTrue(warning.category is DeprecationWarning)
- self.assertEqual(str(warning.message),
- "max_buffer_size is deprecated")
def test_constructor_with_not_readable(self):
class NotReadable(MockRawIO):
@@ -1473,6 +1502,9 @@ class BufferedRandomTest(BufferedReaderTest, BufferedWriterTest):
BufferedReaderTest.test_misbehaved_io(self)
BufferedWriterTest.test_misbehaved_io(self)
+ # You can't construct a BufferedRandom over a non-seekable stream.
+ test_unseekable = None
+
class CBufferedRandomTest(BufferedRandomTest):
tp = io.BufferedRandom
@@ -1685,9 +1717,12 @@ class TextIOWrapperTest(unittest.TestCase):
raw.name = "dummy"
self.assertEqual(repr(t),
"<%s.TextIOWrapper name='dummy' encoding='utf-8'>" % modname)
+ t.mode = "r"
+ self.assertEqual(repr(t),
+ "<%s.TextIOWrapper name='dummy' mode='r' encoding='utf-8'>" % modname)
raw.name = b"dummy"
self.assertEqual(repr(t),
- "<%s.TextIOWrapper name=b'dummy' encoding='utf-8'>" % modname)
+ "<%s.TextIOWrapper name=b'dummy' mode='r' encoding='utf-8'>" % modname)
def test_line_buffering(self):
r = self.BytesIO()
@@ -1961,26 +1996,24 @@ class TextIOWrapperTest(unittest.TestCase):
u_suffix = "\u8888\n"
suffix = bytes(u_suffix.encode("utf-8"))
line = prefix + suffix
- f = self.open(support.TESTFN, "wb")
- f.write(line*2)
- f.close()
- f = self.open(support.TESTFN, "r", encoding="utf-8")
- s = f.read(prefix_size)
- self.assertEqual(s, str(prefix, "ascii"))
- self.assertEqual(f.tell(), prefix_size)
- self.assertEqual(f.readline(), u_suffix)
+ with self.open(support.TESTFN, "wb") as f:
+ f.write(line*2)
+ with self.open(support.TESTFN, "r", encoding="utf-8") as f:
+ s = f.read(prefix_size)
+ self.assertEqual(s, str(prefix, "ascii"))
+ self.assertEqual(f.tell(), prefix_size)
+ self.assertEqual(f.readline(), u_suffix)
def test_seeking_too(self):
# Regression test for a specific bug
data = b'\xe0\xbf\xbf\n'
- f = self.open(support.TESTFN, "wb")
- f.write(data)
- f.close()
- f = self.open(support.TESTFN, "r", encoding="utf-8")
- f._CHUNK_SIZE # Just test that it exists
- f._CHUNK_SIZE = 2
- f.readline()
- f.tell()
+ with self.open(support.TESTFN, "wb") as f:
+ f.write(data)
+ with self.open(support.TESTFN, "r", encoding="utf-8") as f:
+ f._CHUNK_SIZE # Just test that it exists
+ f._CHUNK_SIZE = 2
+ f.readline()
+ f.tell()
def test_seek_and_tell(self):
#Test seek/tell using the StatefulIncrementalDecoder.
@@ -2181,7 +2214,7 @@ class TextIOWrapperTest(unittest.TestCase):
with self.open(support.TESTFN, "w", errors="replace") as f:
self.assertEqual(f.errors, "replace")
-
+ @unittest.skipUnless(threading, 'Threading required for this test.')
def test_threads_write(self):
# Issue6750: concurrent writes could duplicate data
event = threading.Event()
@@ -2217,6 +2250,11 @@ class TextIOWrapperTest(unittest.TestCase):
txt.close()
self.assertRaises(ValueError, txt.flush)
+ def test_unseekable(self):
+ txt = self.TextIOWrapper(self.MockUnseekableIO(self.testdata))
+ self.assertRaises(self.UnsupportedOperation, txt.tell)
+ self.assertRaises(self.UnsupportedOperation, txt.seek, 0)
+
def test_readonly_attributes(self):
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
buf = self.BytesIO(self.testdata)
@@ -2474,27 +2512,27 @@ class MiscIOTest(unittest.TestCase):
def test_abcs(self):
# Test the visible base classes are ABCs.
- self.assertTrue(isinstance(self.IOBase, abc.ABCMeta))
- self.assertTrue(isinstance(self.RawIOBase, abc.ABCMeta))
- self.assertTrue(isinstance(self.BufferedIOBase, abc.ABCMeta))
- self.assertTrue(isinstance(self.TextIOBase, abc.ABCMeta))
+ self.assertIsInstance(self.IOBase, abc.ABCMeta)
+ self.assertIsInstance(self.RawIOBase, abc.ABCMeta)
+ self.assertIsInstance(self.BufferedIOBase, abc.ABCMeta)
+ self.assertIsInstance(self.TextIOBase, abc.ABCMeta)
def _check_abc_inheritance(self, abcmodule):
with self.open(support.TESTFN, "wb", buffering=0) as f:
- self.assertTrue(isinstance(f, abcmodule.IOBase))
- self.assertTrue(isinstance(f, abcmodule.RawIOBase))
- self.assertFalse(isinstance(f, abcmodule.BufferedIOBase))
- self.assertFalse(isinstance(f, abcmodule.TextIOBase))
+ self.assertIsInstance(f, abcmodule.IOBase)
+ self.assertIsInstance(f, abcmodule.RawIOBase)
+ self.assertNotIsInstance(f, abcmodule.BufferedIOBase)
+ self.assertNotIsInstance(f, abcmodule.TextIOBase)
with self.open(support.TESTFN, "wb") as f:
- self.assertTrue(isinstance(f, abcmodule.IOBase))
- self.assertFalse(isinstance(f, abcmodule.RawIOBase))
- self.assertTrue(isinstance(f, abcmodule.BufferedIOBase))
- self.assertFalse(isinstance(f, abcmodule.TextIOBase))
+ self.assertIsInstance(f, abcmodule.IOBase)
+ self.assertNotIsInstance(f, abcmodule.RawIOBase)
+ self.assertIsInstance(f, abcmodule.BufferedIOBase)
+ self.assertNotIsInstance(f, abcmodule.TextIOBase)
with self.open(support.TESTFN, "w") as f:
- self.assertTrue(isinstance(f, abcmodule.IOBase))
- self.assertFalse(isinstance(f, abcmodule.RawIOBase))
- self.assertFalse(isinstance(f, abcmodule.BufferedIOBase))
- self.assertTrue(isinstance(f, abcmodule.TextIOBase))
+ self.assertIsInstance(f, abcmodule.IOBase)
+ self.assertNotIsInstance(f, abcmodule.RawIOBase)
+ self.assertNotIsInstance(f, abcmodule.BufferedIOBase)
+ self.assertIsInstance(f, abcmodule.TextIOBase)
def test_abc_inheritance(self):
# Test implementations inherit from their respective ABCs
@@ -2505,6 +2543,63 @@ class MiscIOTest(unittest.TestCase):
# baseline "io" module.
self._check_abc_inheritance(io)
+ def _check_warn_on_dealloc(self, *args, **kwargs):
+ f = open(*args, **kwargs)
+ r = repr(f)
+ with self.assertWarns(ResourceWarning) as cm:
+ f = None
+ support.gc_collect()
+ self.assertIn(r, str(cm.warning.args[0]))
+
+ def test_warn_on_dealloc(self):
+ self._check_warn_on_dealloc(support.TESTFN, "wb", buffering=0)
+ self._check_warn_on_dealloc(support.TESTFN, "wb")
+ self._check_warn_on_dealloc(support.TESTFN, "w")
+
+ def _check_warn_on_dealloc_fd(self, *args, **kwargs):
+ fds = []
+ def cleanup_fds():
+ for fd in fds:
+ try:
+ os.close(fd)
+ except EnvironmentError as e:
+ if e.errno != errno.EBADF:
+ raise
+ self.addCleanup(cleanup_fds)
+ r, w = os.pipe()
+ fds += r, w
+ self._check_warn_on_dealloc(r, *args, **kwargs)
+ # When using closefd=False, there's no warning
+ r, w = os.pipe()
+ fds += r, w
+ with warnings.catch_warnings(record=True) as recorded:
+ open(r, *args, closefd=False, **kwargs)
+ support.gc_collect()
+ self.assertEqual(recorded, [])
+
+ def test_warn_on_dealloc_fd(self):
+ self._check_warn_on_dealloc_fd("rb", buffering=0)
+ self._check_warn_on_dealloc_fd("rb")
+ self._check_warn_on_dealloc_fd("r")
+
+
+ def test_pickling(self):
+ # Pickling file objects is forbidden
+ for kwargs in [
+ {"mode": "w"},
+ {"mode": "wb"},
+ {"mode": "wb", "buffering": 0},
+ {"mode": "r"},
+ {"mode": "rb"},
+ {"mode": "rb", "buffering": 0},
+ {"mode": "w+"},
+ {"mode": "w+b"},
+ {"mode": "w+b", "buffering": 0},
+ ]:
+ for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
+ with self.open(support.TESTFN, **kwargs) as f:
+ self.assertRaises(TypeError, pickle.dumps, f, protocol)
+
class CMiscIOTest(MiscIOTest):
io = io
@@ -2527,7 +2622,8 @@ class SignalsTest(unittest.TestCase):
@unittest.skipUnless(threading, 'Threading required for this test.')
def check_interrupted_write(self, item, bytes, **fdopen_kwargs):
"""Check that a partial write, when it gets interrupted, properly
- invokes the signal handler."""
+ invokes the signal handler, and bubbles up the exception raised
+ in the latter."""
read_results = []
def _read():
s = os.read(r, 1)
@@ -2535,6 +2631,7 @@ class SignalsTest(unittest.TestCase):
t = threading.Thread(target=_read)
t.daemon = True
r, w = os.pipe()
+ fdopen_kwargs["closefd"] = False
try:
wio = self.io.open(w, **fdopen_kwargs)
t.start()
@@ -2592,6 +2689,9 @@ class SignalsTest(unittest.TestCase):
wio.flush()
# Make sure the buffer doesn't fill up and block further writes
os.read(r, len(data) * 100)
+ exc = cm.exception
+ if isinstance(exc, RuntimeError):
+ self.assertTrue(str(exc).startswith("reentrant call"), str(exc))
finally:
wio.close()
os.close(r)
@@ -2602,6 +2702,98 @@ class SignalsTest(unittest.TestCase):
def test_reentrant_write_text(self):
self.check_reentrant_write("xy", mode="w", encoding="ascii")
+ def check_interrupted_read_retry(self, decode, **fdopen_kwargs):
+ """Check that a buffered read, when it gets interrupted (either
+ returning a partial result or EINTR), properly invokes the signal
+ handler and retries if the latter returned successfully."""
+ r, w = os.pipe()
+ fdopen_kwargs["closefd"] = False
+ def alarm_handler(sig, frame):
+ os.write(w, b"bar")
+ signal.signal(signal.SIGALRM, alarm_handler)
+ try:
+ rio = self.io.open(r, **fdopen_kwargs)
+ os.write(w, b"foo")
+ signal.alarm(1)
+ # Expected behaviour:
+ # - first raw read() returns partial b"foo"
+ # - second raw read() returns EINTR
+ # - third raw read() returns b"bar"
+ self.assertEqual(decode(rio.read(6)), "foobar")
+ finally:
+ rio.close()
+ os.close(w)
+ os.close(r)
+
+ def test_interrupterd_read_retry_buffered(self):
+ self.check_interrupted_read_retry(lambda x: x.decode('latin1'),
+ mode="rb")
+
+ def test_interrupterd_read_retry_text(self):
+ self.check_interrupted_read_retry(lambda x: x,
+ mode="r")
+
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ def check_interrupted_write_retry(self, item, **fdopen_kwargs):
+ """Check that a buffered write, when it gets interrupted (either
+ returning a partial result or EINTR), properly invokes the signal
+ handler and retries if the latter returned successfully."""
+ select = support.import_module("select")
+ # A quantity that exceeds the buffer size of an anonymous pipe's
+ # write end.
+ N = 1024 * 1024
+ r, w = os.pipe()
+ fdopen_kwargs["closefd"] = False
+ # We need a separate thread to read from the pipe and allow the
+ # write() to finish. This thread is started after the SIGALRM is
+ # received (forcing a first EINTR in write()).
+ read_results = []
+ write_finished = False
+ def _read():
+ while not write_finished:
+ while r in select.select([r], [], [], 1.0)[0]:
+ s = os.read(r, 1024)
+ read_results.append(s)
+ t = threading.Thread(target=_read)
+ t.daemon = True
+ def alarm1(sig, frame):
+ signal.signal(signal.SIGALRM, alarm2)
+ signal.alarm(1)
+ def alarm2(sig, frame):
+ t.start()
+ signal.signal(signal.SIGALRM, alarm1)
+ try:
+ wio = self.io.open(w, **fdopen_kwargs)
+ signal.alarm(1)
+ # Expected behaviour:
+ # - first raw write() is partial (because of the limited pipe buffer
+ # and the first alarm)
+ # - second raw write() returns EINTR (because of the second alarm)
+ # - subsequent write()s are successful (either partial or complete)
+ self.assertEqual(N, wio.write(item * N))
+ wio.flush()
+ write_finished = True
+ t.join()
+ self.assertEqual(N, sum(len(x) for x in read_results))
+ finally:
+ write_finished = True
+ os.close(w)
+ os.close(r)
+ # This is deliberate. If we didn't close the file descriptor
+ # before closing wio, wio would try to flush its internal
+ # buffer, and could block (in case of failure).
+ try:
+ wio.close()
+ except IOError as e:
+ if e.errno != errno.EBADF:
+ raise
+
+ def test_interrupterd_write_retry_buffered(self):
+ self.check_interrupted_write_retry(b"x", mode="wb")
+
+ def test_interrupterd_write_retry_text(self):
+ self.check_interrupted_write_retry("x", mode="w", encoding="latin1")
+
class CSignalsTest(SignalsTest):
io = io
@@ -2631,7 +2823,7 @@ def test_main():
# Put the namespaces of the IO module we are testing and some useful mock
# classes in the __dict__ of each test.
mocks = (MockRawIO, MisbehavedRawIO, MockFileIO, CloseFailureIO,
- MockNonBlockWriterIO, MockRawIOWithoutRead)
+ MockNonBlockWriterIO, MockUnseekableIO, MockRawIOWithoutRead)
all_members = io.__all__ + ["IncrementalNewlineDecoder"]
c_io_ns = {name : getattr(io, name) for name in all_members}
py_io_ns = {name : getattr(pyio, name) for name in all_members}
diff --git a/Lib/test/test_ioctl.py b/Lib/test/test_ioctl.py
index 26c0d05875..d4d5a22a88 100644
--- a/Lib/test/test_ioctl.py
+++ b/Lib/test/test_ioctl.py
@@ -30,10 +30,10 @@ class IoctlTests(unittest.TestCase):
# If this process has been put into the background, TIOCGPGRP returns
# the session ID instead of the process group id.
ids = (os.getpgrp(), os.getsid(0))
- tty = open("/dev/tty", "r")
- r = fcntl.ioctl(tty, termios.TIOCGPGRP, " ")
- rpgrp = struct.unpack("i", r)[0]
- self.assertTrue(rpgrp in ids, "%s not in %s" % (rpgrp, ids))
+ with open("/dev/tty", "r") as tty:
+ r = fcntl.ioctl(tty, termios.TIOCGPGRP, " ")
+ rpgrp = struct.unpack("i", r)[0]
+ self.assertIn(rpgrp, ids)
def _check_ioctl_mutate_len(self, nbytes=None):
buf = array.array('i')
@@ -51,7 +51,7 @@ class IoctlTests(unittest.TestCase):
r = fcntl.ioctl(tty, termios.TIOCGPGRP, buf, 1)
rpgrp = buf[0]
self.assertEqual(r, 0)
- self.assertTrue(rpgrp in ids, "%s not in %s" % (rpgrp, ids))
+ self.assertIn(rpgrp, ids)
def test_ioctl_mutate(self):
self._check_ioctl_mutate_len()
diff --git a/Lib/test/test_isinstance.py b/Lib/test/test_isinstance.py
index 9482e75438..dc2d07467a 100644
--- a/Lib/test/test_isinstance.py
+++ b/Lib/test/test_isinstance.py
@@ -81,6 +81,20 @@ class TestIsInstanceExceptions(unittest.TestCase):
self.assertRaises(TypeError, isinstance, I(), C())
+ # check that we don't mask non AttributeErrors
+ # see: http://bugs.python.org/issue1574217
+ def test_isinstance_dont_mask_non_attribute_error(self):
+ class C(object):
+ def getclass(self):
+ raise RuntimeError
+ __class__ = property(getclass)
+
+ c = C()
+ self.assertRaises(RuntimeError, isinstance, c, bool)
+
+ # test another code path
+ class D: pass
+ self.assertRaises(RuntimeError, isinstance, c, D)
# These tests are similar to above, but tickle certain code paths in
diff --git a/Lib/test/test_iter.py b/Lib/test/test_iter.py
index a826598215..e424303305 100644
--- a/Lib/test/test_iter.py
+++ b/Lib/test/test_iter.py
@@ -1,7 +1,7 @@
# Test iterators.
import unittest
-from test.support import run_unittest, TESTFN, unlink
+from test.support import run_unittest, TESTFN, unlink, cpython_only
# Test result of triple loop (too big to inline)
TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2),
@@ -542,23 +542,23 @@ class TestCase(unittest.TestCase):
def test_in_and_not_in(self):
for sc5 in IteratingSequenceClass(5), SequenceClass(5):
for i in range(5):
- self.assertTrue(i in sc5)
+ self.assertIn(i, sc5)
for i in "abc", -1, 5, 42.42, (3, 4), [], {1: 1}, 3-12j, sc5:
- self.assertTrue(i not in sc5)
+ self.assertNotIn(i, sc5)
self.assertRaises(TypeError, lambda: 3 in 12)
self.assertRaises(TypeError, lambda: 3 not in map)
d = {"one": 1, "two": 2, "three": 3, 1j: 2j}
for k in d:
- self.assertTrue(k in d)
- self.assertTrue(k not in d.values())
+ self.assertIn(k, d)
+ self.assertNotIn(k, d.values())
for v in d.values():
- self.assertTrue(v in d.values())
- self.assertTrue(v not in d)
+ self.assertIn(v, d.values())
+ self.assertNotIn(v, d)
for k, v in d.items():
- self.assertTrue((k, v) in d.items())
- self.assertTrue((v, k) not in d.items())
+ self.assertIn((k, v), d.items())
+ self.assertNotIn((v, k), d.items())
f = open(TESTFN, "w")
try:
@@ -569,9 +569,9 @@ class TestCase(unittest.TestCase):
try:
for chunk in "abc":
f.seek(0, 0)
- self.assertTrue(chunk not in f)
+ self.assertNotIn(chunk, f)
f.seek(0, 0)
- self.assertTrue((chunk + "\n") in f)
+ self.assertIn((chunk + "\n"), f)
finally:
f.close()
try:
@@ -761,8 +761,9 @@ class TestCase(unittest.TestCase):
(a, b), (c,) = IteratingSequenceClass(2), {42: 24}
self.assertEqual((a, b, c), (0, 1, 42))
- # Test reference count behavior
+ @cpython_only
+ def test_ref_counting_behavior(self):
class C(object):
count = 0
def __new__(cls):
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 9ce54d0b06..8cdc597e58 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -56,6 +56,24 @@ def fact(n):
return prod(range(1, n+1))
class TestBasicOps(unittest.TestCase):
+
+ def test_accumulate(self):
+ self.assertEqual(list(accumulate(range(10))), # one positional arg
+ [0, 1, 3, 6, 10, 15, 21, 28, 36, 45])
+ self.assertEqual(list(accumulate(iterable=range(10))), # kw arg
+ [0, 1, 3, 6, 10, 15, 21, 28, 36, 45])
+ for typ in int, complex, Decimal, Fraction: # multiple types
+ self.assertEqual(
+ list(accumulate(map(typ, range(10)))),
+ list(map(typ, [0, 1, 3, 6, 10, 15, 21, 28, 36, 45])))
+ self.assertEqual(list(accumulate('abc')), ['a', 'ab', 'abc']) # works with non-numeric
+ self.assertEqual(list(accumulate([])), []) # empty iterable
+ self.assertEqual(list(accumulate([7])), [7]) # iterable of length one
+ self.assertRaises(TypeError, accumulate, range(10), 5) # too many args
+ self.assertRaises(TypeError, accumulate) # too few args
+ self.assertRaises(TypeError, accumulate, x=range(10)) # unexpected kwd arg
+ self.assertRaises(TypeError, list, accumulate([1, []])) # args that don't add
+
def test_chain(self):
def chain2(*iterables):
@@ -937,6 +955,9 @@ class TestBasicOps(unittest.TestCase):
class TestExamples(unittest.TestCase):
+ def test_accumlate(self):
+ self.assertEqual(list(accumulate([1,2,3,4,5])), [1, 3, 6, 10, 15])
+
def test_chain(self):
self.assertEqual(''.join(chain('ABC', 'DEF')), 'ABCDEF')
@@ -1024,6 +1045,10 @@ class TestGC(unittest.TestCase):
next(iterator)
del container, iterator
+ def test_accumulate(self):
+ a = []
+ self.makecycle(accumulate([1,2,a,3]), a)
+
def test_chain(self):
a = []
self.makecycle(chain(a), a)
@@ -1193,6 +1218,17 @@ def L(seqn):
class TestVariousIteratorArgs(unittest.TestCase):
+ def test_accumulate(self):
+ s = [1,2,3,4,5]
+ r = [1,3,6,10,15]
+ n = len(s)
+ for g in (G, I, Ig, L, R):
+ self.assertEqual(list(accumulate(g(s))), r)
+ self.assertEqual(list(accumulate(S(s))), [])
+ self.assertRaises(TypeError, accumulate, X(s))
+ self.assertRaises(TypeError, accumulate, N(s))
+ self.assertRaises(ZeroDivisionError, list, accumulate(E(s)))
+
def test_chain(self):
for s in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5)):
for g in (G, I, Ig, S, L, R):
@@ -1415,7 +1451,7 @@ class SubclassWithKwargsTest(unittest.TestCase):
Subclass(newarg=1)
except TypeError as err:
# we expect type errors because of wrong argument count
- self.assertFalse("does not take keyword arguments" in err.args[0])
+ self.assertNotIn("does not take keyword arguments", err.args[0])
libreftest = """ Doctest for examples in the library reference: libitertools.tex
diff --git a/Lib/test/test_json.py b/Lib/test/test_json.py
index a4b6e7a829..41ff8974fc 100644
--- a/Lib/test/test_json.py
+++ b/Lib/test/test_json.py
@@ -5,12 +5,12 @@ the test_suite() function there returns a test suite that's ready to
be run.
"""
-import json.tests
+from test import json_tests
import test.support
def test_main():
- test.support.run_unittest(json.tests.test_suite())
+ test.support.run_unittest(json_tests.test_suite())
if __name__ == "__main__":
diff --git a/Lib/test/test_keywordonlyarg.py b/Lib/test/test_keywordonlyarg.py
index e10dfce2ad..d7f7541837 100644
--- a/Lib/test/test_keywordonlyarg.py
+++ b/Lib/test/test_keywordonlyarg.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unit tests for the keyword only argument specified in PEP 3102."""
@@ -73,6 +73,14 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
fundef3 += "lastarg):\n pass\n"
compile(fundef3, "<test>", "single")
+ def testTooManyPositionalErrorMessage(self):
+ def f(a, b=None, *, c=None):
+ pass
+ with self.assertRaises(TypeError) as exc:
+ f(1, 2, 3)
+ expected = "f() takes at most 2 positional arguments (3 given)"
+ self.assertEqual(str(exc.exception), expected)
+
def testSyntaxErrorForFunctionCall(self):
self.assertRaisesSyntaxError("f(p, k=1, p2)")
self.assertRaisesSyntaxError("f(p, k1=50, *(1,2), k1=100)")
diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py
index a90f12cfe1..9cb0a85166 100644
--- a/Lib/test/test_kqueue.py
+++ b/Lib/test/test_kqueue.py
@@ -71,6 +71,17 @@ class TestKQueue(unittest.TestCase):
self.assertEqual(ev, ev)
self.assertNotEqual(ev, other)
+ bignum = sys.maxsize * 2 + 1
+ ev = select.kevent(bignum, 1, 2, 3, sys.maxsize, bignum)
+ self.assertEqual(ev.ident, bignum)
+ self.assertEqual(ev.filter, 1)
+ self.assertEqual(ev.flags, 2)
+ self.assertEqual(ev.fflags, 3)
+ self.assertEqual(ev.data, sys.maxsize)
+ self.assertEqual(ev.udata, bignum)
+ self.assertEqual(ev, ev)
+ self.assertNotEqual(ev, other)
+
def test_queue_event(self):
serverSocket = socket.socket()
serverSocket.bind(('127.0.0.1', 0))
diff --git a/Lib/test/test_linecache.py b/Lib/test/test_linecache.py
index 8e225d522b..fcc390a17b 100644
--- a/Lib/test/test_linecache.py
+++ b/Lib/test/test_linecache.py
@@ -12,7 +12,7 @@ EMPTY = ''
TESTS = 'cjkencodings_test inspect_fodder inspect_fodder2 mapping_tests'
TESTS = TESTS.split()
TEST_PATH = os.path.dirname(support.__file__)
-MODULES = "linecache unittest".split()
+MODULES = "linecache abc".split()
MODULE_PATH = os.path.dirname(FILENAME)
SOURCE_1 = '''
@@ -55,14 +55,16 @@ class LineCacheTests(unittest.TestCase):
# Check whether lines correspond to those from file iteration
for entry in TESTS:
filename = os.path.join(TEST_PATH, entry) + '.py'
- for index, line in enumerate(open(filename)):
- self.assertEqual(line, getline(filename, index + 1))
+ with open(filename) as file:
+ for index, line in enumerate(file):
+ self.assertEqual(line, getline(filename, index + 1))
# Check module loading
for entry in MODULES:
filename = os.path.join(MODULE_PATH, entry) + '.py'
- for index, line in enumerate(open(filename)):
- self.assertEqual(line, getline(filename, index + 1))
+ with open(filename) as file:
+ for index, line in enumerate(file):
+ self.assertEqual(line, getline(filename, index + 1))
# Check that bogus data isn't returned (issue #1309567)
empty = linecache.getlines('a/b/c/__init__.py')
@@ -99,6 +101,7 @@ class LineCacheTests(unittest.TestCase):
with open(source_name, 'w') as source:
source.write(SOURCE_1)
getline(source_name, 1)
+
# Keep a copy of the old contents
source_list = []
with open(source_name) as source:
@@ -123,7 +126,6 @@ class LineCacheTests(unittest.TestCase):
self.assertEqual(line, getline(source_name, index + 1))
source_list.append(line)
-
def test_main():
support.run_unittest(LineCacheTests)
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 9b36350fbe..90d293e3ab 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2011 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
@@ -18,7 +18,7 @@
"""Test harness for the logging module. Run all tests.
-Copyright (C) 2001-2010 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2011 Vinay Sajip. All Rights Reserved.
"""
import logging
@@ -26,27 +26,30 @@ import logging.handlers
import logging.config
import codecs
-import copy
+import datetime
import pickle
import io
import gc
+import json
import os
+import queue
import re
import select
import socket
from socketserver import ThreadingTCPServer, StreamRequestHandler
-import string
import struct
import sys
import tempfile
from test.support import captured_stdout, run_with_locale, run_unittest
+from test.support import TestHandler, Matcher
import textwrap
-import threading
-import time
-import types
import unittest
import warnings
import weakref
+try:
+ import threading
+except ImportError:
+ threading = None
class BaseTest(unittest.TestCase):
@@ -65,11 +68,21 @@ class BaseTest(unittest.TestCase):
try:
self.saved_handlers = logging._handlers.copy()
self.saved_handler_list = logging._handlerList[:]
- self.saved_loggers = logger_dict.copy()
+ self.saved_loggers = saved_loggers = logger_dict.copy()
self.saved_level_names = logging._levelNames.copy()
+ self.logger_states = logger_states = {}
+ for name in saved_loggers:
+ logger_states[name] = getattr(saved_loggers[name],
+ 'disabled', None)
finally:
logging._releaseLock()
+ # Set two unused loggers: one non-ASCII and one Unicode.
+ # This is to test correct operation when sorting existing
+ # loggers in the configuration code. See issue 8201.
+ self.logger1 = logging.getLogger("\xab\xd7\xbb")
+ self.logger2 = logging.getLogger("\u013f\u00d6\u0047")
+
self.root_logger = logging.getLogger("")
self.original_logging_level = self.root_logger.getEffectiveLevel()
@@ -78,13 +91,25 @@ class BaseTest(unittest.TestCase):
self.root_hdlr = logging.StreamHandler(self.stream)
self.root_formatter = logging.Formatter(self.log_format)
self.root_hdlr.setFormatter(self.root_formatter)
+ if self.logger1.hasHandlers():
+ hlist = self.logger1.handlers + self.root_logger.handlers
+ raise AssertionError('Unexpected handlers: %s' % hlist)
+ if self.logger2.hasHandlers():
+ hlist = self.logger2.handlers + self.root_logger.handlers
+ raise AssertionError('Unexpected handlers: %s' % hlist)
self.root_logger.addHandler(self.root_hdlr)
+ self.assertTrue(self.logger1.hasHandlers())
+ self.assertTrue(self.logger2.hasHandlers())
def tearDown(self):
"""Remove our logging stream, and restore the original logging
level."""
self.stream.close()
self.root_logger.removeHandler(self.root_hdlr)
+ while self.root_logger.handlers:
+ h = self.root_logger.handlers[0]
+ self.root_logger.removeHandler(h)
+ h.close()
self.root_logger.setLevel(self.original_logging_level)
logging._acquireLock()
try:
@@ -96,6 +121,10 @@ class BaseTest(unittest.TestCase):
loggerDict = logging.getLogger().manager.loggerDict
loggerDict.clear()
loggerDict.update(self.saved_loggers)
+ logger_states = self.logger_states
+ for name in self.logger_states:
+ if logger_states[name] is not None:
+ self.saved_loggers[name].disabled = logger_states[name]
finally:
logging._releaseLock()
@@ -111,7 +140,8 @@ class BaseTest(unittest.TestCase):
except AttributeError:
# StringIO.StringIO lacks a reset() method.
actual_lines = stream.getvalue().splitlines()
- self.assertEqual(len(actual_lines), len(expected_values))
+ self.assertEqual(len(actual_lines), len(expected_values),
+ '%s vs. %s' % (actual_lines, expected_values))
for actual, expected in zip(actual_lines, expected_values):
match = pat.search(actual)
if not match:
@@ -138,7 +168,7 @@ class BuiltinLevelsTest(BaseTest):
ERR = logging.getLogger("ERR")
ERR.setLevel(logging.ERROR)
- INF = logging.getLogger("INF")
+ INF = logging.LoggerAdapter(logging.getLogger("INF"), {})
INF.setLevel(logging.INFO)
DEB = logging.getLogger("DEB")
DEB.setLevel(logging.DEBUG)
@@ -292,6 +322,35 @@ class BasicFilterTest(BaseTest):
finally:
handler.removeFilter(filter_)
+ def test_callable_filter(self):
+ # Only messages satisfying the specified criteria pass through the
+ # filter.
+
+ def filterfunc(record):
+ parts = record.name.split('.')
+ prefix = '.'.join(parts[:2])
+ return prefix == 'spam.eggs'
+
+ handler = self.root_logger.handlers[0]
+ try:
+ handler.addFilter(filterfunc)
+ spam = logging.getLogger("spam")
+ spam_eggs = logging.getLogger("spam.eggs")
+ spam_eggs_fish = logging.getLogger("spam.eggs.fish")
+ spam_bakedbeans = logging.getLogger("spam.bakedbeans")
+
+ spam.info(self.next_message())
+ spam_eggs.info(self.next_message()) # Good.
+ spam_eggs_fish.info(self.next_message()) # Good.
+ spam_bakedbeans.info(self.next_message())
+
+ self.assert_log_lines([
+ ('spam.eggs', 'INFO', '2'),
+ ('spam.eggs.fish', 'INFO', '3'),
+ ])
+ finally:
+ handler.removeFilter(filterfunc)
+
#
# First, we define our levels. There can be as many as you want - the only
@@ -355,7 +414,7 @@ class CustomLevelsAndFiltersTest(BaseTest):
def setUp(self):
BaseTest.setUp(self)
- for k, v in list(my_logging_levels.items()):
+ for k, v in my_logging_levels.items():
logging.addLevelName(k, v)
def log_at_all_levels(self, logger):
@@ -702,14 +761,8 @@ class ConfigFileTest(BaseTest):
"""
def apply_config(self, conf):
- try:
- fn = tempfile.mktemp(".ini")
- f = open(fn, "w")
- f.write(textwrap.dedent(conf))
- f.close()
- logging.config.fileConfig(fn)
- finally:
- os.remove(fn)
+ file = io.StringIO(textwrap.dedent(conf))
+ logging.config.fileConfig(file)
def test_config0_ok(self):
# A simple config file which overrides the default settings.
@@ -876,6 +929,7 @@ class LogRecordSocketReceiver(ThreadingTCPServer):
self.server_close()
+@unittest.skipUnless(threading, 'Threading required for this test.')
class SocketHandlerTest(BaseTest):
"""Test for SocketHandler objects."""
@@ -944,7 +998,7 @@ class MemoryTest(BaseTest):
# Trigger cycle breaking.
gc.collect()
dead = []
- for (id_, repr_), ref in list(self._survivors.items()):
+ for (id_, repr_), ref in self._survivors.items():
if ref() is None:
dead.append(repr_)
if dead:
@@ -979,11 +1033,12 @@ class EncodingTest(BaseTest):
def test_encoding_plain_file(self):
# In Python 2.x, a plain file object is treated as having no encoding.
log = logging.getLogger("test")
- fn = tempfile.mktemp(".log")
+ fd, fn = tempfile.mkstemp(".log", "test_logging-1-")
+ os.close(fd)
# the non-ascii data we write to the log.
data = "foo\x80"
try:
- handler = logging.FileHandler(fn, encoding="utf8")
+ handler = logging.FileHandler(fn, encoding="utf-8")
log.addHandler(handler)
try:
# write non-ascii data to the log.
@@ -992,7 +1047,7 @@ class EncodingTest(BaseTest):
log.removeHandler(handler)
handler.close()
# check we wrote exactly those bytes, ignoring trailing \n etc
- f = open(fn, encoding="utf8")
+ f = open(fn, encoding="utf-8")
try:
self.assertEqual(f.read().rstrip(), data)
finally:
@@ -1051,15 +1106,1241 @@ class WarningsTest(BaseTest):
finally:
logging.captureWarnings(False)
+
+def formatFunc(format, datefmt=None):
+ return logging.Formatter(format, datefmt)
+
+def handlerFunc():
+ return logging.StreamHandler()
+
+class CustomHandler(logging.StreamHandler):
+ pass
+
+class ConfigDictTest(BaseTest):
+
+ """Reading logging config from a dictionary."""
+
+ expected_log_pat = r"^([\w]+) \+\+ ([\w]+)$"
+
+ # config0 is a standard configuration.
+ config0 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ 'handlers' : ['hand1'],
+ },
+ }
+
+ # config1 adds a little to the standard configuration.
+ config1 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ # config1a moves the handler to the root. Used with config8a
+ config1a = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ 'handlers' : ['hand1'],
+ },
+ }
+
+ # config2 has a subtle configuration error that should be reported
+ config2 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdbout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ #As config1 but with a misspelt level on a handler
+ config2a = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NTOSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+
+ #As config1 but with a misspelt level on a logger
+ config2b = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WRANING',
+ },
+ }
+
+ # config3 has a less subtle configuration error
+ config3 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'misspelled_name',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ # config4 specifies a custom formatter class to be loaded
+ config4 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ '()' : __name__ + '.ExceptionFormatter',
+ 'format' : '%(levelname)s:%(name)s:%(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'root' : {
+ 'level' : 'NOTSET',
+ 'handlers' : ['hand1'],
+ },
+ }
+
+ # As config4 but using an actual callable rather than a string
+ config4a = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ '()' : ExceptionFormatter,
+ 'format' : '%(levelname)s:%(name)s:%(message)s',
+ },
+ 'form2' : {
+ '()' : __name__ + '.formatFunc',
+ 'format' : '%(levelname)s:%(name)s:%(message)s',
+ },
+ 'form3' : {
+ '()' : formatFunc,
+ 'format' : '%(levelname)s:%(name)s:%(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ 'hand2' : {
+ '()' : handlerFunc,
+ },
+ },
+ 'root' : {
+ 'level' : 'NOTSET',
+ 'handlers' : ['hand1'],
+ },
+ }
+
+ # config5 specifies a custom handler class to be loaded
+ config5 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : __name__ + '.CustomHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ # config6 specifies a custom handler class to be loaded
+ # but has bad arguments
+ config6 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : __name__ + '.CustomHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ '9' : 'invalid parameter name',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ #config 7 does not define compiler.parser but defines compiler.lexer
+ #so compiler.parser should be disabled after applying it
+ config7 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.lexer' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ # config8 defines both compiler and compiler.lexer
+ # so compiler.parser should not be disabled (since
+ # compiler is defined)
+ config8 = {
+ 'version': 1,
+ 'disable_existing_loggers' : False,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ 'compiler.lexer' : {
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ # config8a disables existing loggers
+ config8a = {
+ 'version': 1,
+ 'disable_existing_loggers' : True,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ 'compiler.lexer' : {
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ config9 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'WARNING',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'WARNING',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'NOTSET',
+ },
+ }
+
+ config9a = {
+ 'version': 1,
+ 'incremental' : True,
+ 'handlers' : {
+ 'hand1' : {
+ 'level' : 'WARNING',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'INFO',
+ },
+ },
+ }
+
+ config9b = {
+ 'version': 1,
+ 'incremental' : True,
+ 'handlers' : {
+ 'hand1' : {
+ 'level' : 'INFO',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'INFO',
+ },
+ },
+ }
+
+ #As config1 but with a filter added
+ config10 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'filters' : {
+ 'filt1' : {
+ 'name' : 'compiler.parser',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ 'filters' : ['filt1'],
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'filters' : ['filt1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ 'handlers' : ['hand1'],
+ },
+ }
+
+ #As config1 but using cfg:// references
+ config11 = {
+ 'version': 1,
+ 'true_formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handler_configs': {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'formatters' : 'cfg://true_formatters',
+ 'handlers' : {
+ 'hand1' : 'cfg://handler_configs[hand1]',
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ #As config11 but missing the version key
+ config12 = {
+ 'true_formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handler_configs': {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'formatters' : 'cfg://true_formatters',
+ 'handlers' : {
+ 'hand1' : 'cfg://handler_configs[hand1]',
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ #As config11 but using an unsupported version
+ config13 = {
+ 'version': 2,
+ 'true_formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handler_configs': {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'formatters' : 'cfg://true_formatters',
+ 'handlers' : {
+ 'hand1' : 'cfg://handler_configs[hand1]',
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ def apply_config(self, conf):
+ logging.config.dictConfig(conf)
+
+ def test_config0_ok(self):
+ # A simple config which overrides the default settings.
+ with captured_stdout() as output:
+ self.apply_config(self.config0)
+ logger = logging.getLogger()
+ # Won't output anything
+ logger.info(self.next_message())
+ # Outputs a message
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+ def test_config1_ok(self, config=config1):
+ # A config defining a sub-parser as well.
+ with captured_stdout() as output:
+ self.apply_config(config)
+ logger = logging.getLogger("compiler.parser")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+ def test_config2_failure(self):
+ # A simple config which overrides the default settings.
+ self.assertRaises(Exception, self.apply_config, self.config2)
+
+ def test_config2a_failure(self):
+ # A simple config which overrides the default settings.
+ self.assertRaises(Exception, self.apply_config, self.config2a)
+
+ def test_config2b_failure(self):
+ # A simple config which overrides the default settings.
+ self.assertRaises(Exception, self.apply_config, self.config2b)
+
+ def test_config3_failure(self):
+ # A simple config which overrides the default settings.
+ self.assertRaises(Exception, self.apply_config, self.config3)
+
+ def test_config4_ok(self):
+ # A config specifying a custom formatter class.
+ with captured_stdout() as output:
+ self.apply_config(self.config4)
+ #logger = logging.getLogger()
+ try:
+ raise RuntimeError()
+ except RuntimeError:
+ logging.exception("just testing")
+ sys.stdout.seek(0)
+ self.assertEqual(output.getvalue(),
+ "ERROR:root:just testing\nGot a [RuntimeError]\n")
+ # Original logger output is empty
+ self.assert_log_lines([])
+
+ def test_config4a_ok(self):
+ # A config specifying a custom formatter class.
+ with captured_stdout() as output:
+ self.apply_config(self.config4a)
+ #logger = logging.getLogger()
+ try:
+ raise RuntimeError()
+ except RuntimeError:
+ logging.exception("just testing")
+ sys.stdout.seek(0)
+ self.assertEqual(output.getvalue(),
+ "ERROR:root:just testing\nGot a [RuntimeError]\n")
+ # Original logger output is empty
+ self.assert_log_lines([])
+
+ def test_config5_ok(self):
+ self.test_config1_ok(config=self.config5)
+
+ def test_config6_failure(self):
+ self.assertRaises(Exception, self.apply_config, self.config6)
+
+ def test_config7_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config1)
+ logger = logging.getLogger("compiler.parser")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+ with captured_stdout() as output:
+ self.apply_config(self.config7)
+ logger = logging.getLogger("compiler.parser")
+ self.assertTrue(logger.disabled)
+ logger = logging.getLogger("compiler.lexer")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '3'),
+ ('ERROR', '4'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+ #Same as test_config_7_ok but don't disable old loggers.
+ def test_config_8_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config1)
+ logger = logging.getLogger("compiler.parser")
+ # All will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+ with captured_stdout() as output:
+ self.apply_config(self.config8)
+ logger = logging.getLogger("compiler.parser")
+ self.assertFalse(logger.disabled)
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ logger = logging.getLogger("compiler.lexer")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '3'),
+ ('ERROR', '4'),
+ ('INFO', '5'),
+ ('ERROR', '6'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+ def test_config_8a_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config1a)
+ logger = logging.getLogger("compiler.parser")
+ # See issue #11424. compiler-hyphenated sorts
+ # between compiler and compiler.xyz and this
+ # was preventing compiler.xyz from being included
+ # in the child loggers of compiler because of an
+ # overzealous loop termination condition.
+ hyphenated = logging.getLogger('compiler-hyphenated')
+ # All will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ hyphenated.critical(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ('CRITICAL', '3'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+ with captured_stdout() as output:
+ self.apply_config(self.config8a)
+ logger = logging.getLogger("compiler.parser")
+ self.assertFalse(logger.disabled)
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ logger = logging.getLogger("compiler.lexer")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ # Will not appear
+ hyphenated.critical(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '4'),
+ ('ERROR', '5'),
+ ('INFO', '6'),
+ ('ERROR', '7'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+ def test_config_9_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config9)
+ logger = logging.getLogger("compiler.parser")
+ #Nothing will be output since both handler and logger are set to WARNING
+ logger.info(self.next_message())
+ self.assert_log_lines([], stream=output)
+ self.apply_config(self.config9a)
+ #Nothing will be output since both handler is still set to WARNING
+ logger.info(self.next_message())
+ self.assert_log_lines([], stream=output)
+ self.apply_config(self.config9b)
+ #Message should now be output
+ logger.info(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '3'),
+ ], stream=output)
+
+ def test_config_10_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config10)
+ logger = logging.getLogger("compiler.parser")
+ logger.warning(self.next_message())
+ logger = logging.getLogger('compiler')
+ #Not output, because filtered
+ logger.warning(self.next_message())
+ logger = logging.getLogger('compiler.lexer')
+ #Not output, because filtered
+ logger.warning(self.next_message())
+ logger = logging.getLogger("compiler.parser.codegen")
+ #Output, as not filtered
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('WARNING', '1'),
+ ('ERROR', '4'),
+ ], stream=output)
+
+ def test_config11_ok(self):
+ self.test_config1_ok(self.config11)
+
+ def test_config12_failure(self):
+ self.assertRaises(Exception, self.apply_config, self.config12)
+
+ def test_config13_failure(self):
+ self.assertRaises(Exception, self.apply_config, self.config13)
+
+ @unittest.skipUnless(threading, 'listen() needs threading to work')
+ def setup_via_listener(self, text):
+ text = text.encode("utf-8")
+ # Ask for a randomly assigned port (by using port 0)
+ t = logging.config.listen(0)
+ t.start()
+ t.ready.wait()
+ # Now get the port allocated
+ port = t.port
+ t.ready.clear()
+ try:
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.settimeout(2.0)
+ sock.connect(('localhost', port))
+
+ slen = struct.pack('>L', len(text))
+ s = slen + text
+ sentsofar = 0
+ left = len(s)
+ while left > 0:
+ sent = sock.send(s[sentsofar:])
+ sentsofar += sent
+ left -= sent
+ sock.close()
+ finally:
+ t.ready.wait(2.0)
+ logging.config.stopListening()
+ t.join(2.0)
+
+ def test_listen_config_10_ok(self):
+ with captured_stdout() as output:
+ self.setup_via_listener(json.dumps(self.config10))
+ logger = logging.getLogger("compiler.parser")
+ logger.warning(self.next_message())
+ logger = logging.getLogger('compiler')
+ #Not output, because filtered
+ logger.warning(self.next_message())
+ logger = logging.getLogger('compiler.lexer')
+ #Not output, because filtered
+ logger.warning(self.next_message())
+ logger = logging.getLogger("compiler.parser.codegen")
+ #Output, as not filtered
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('WARNING', '1'),
+ ('ERROR', '4'),
+ ], stream=output)
+
+ def test_listen_config_1_ok(self):
+ with captured_stdout() as output:
+ self.setup_via_listener(textwrap.dedent(ConfigFileTest.config1))
+ logger = logging.getLogger("compiler.parser")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+
+class ManagerTest(BaseTest):
+ def test_manager_loggerclass(self):
+ logged = []
+
+ class MyLogger(logging.Logger):
+ def _log(self, level, msg, args, exc_info=None, extra=None):
+ logged.append(msg)
+
+ man = logging.Manager(None)
+ self.assertRaises(TypeError, man.setLoggerClass, int)
+ man.setLoggerClass(MyLogger)
+ logger = man.getLogger('test')
+ logger.warning('should appear in logged')
+ logging.warning('should not appear in logged')
+
+ self.assertEqual(logged, ['should appear in logged'])
+
+
+class ChildLoggerTest(BaseTest):
+ def test_child_loggers(self):
+ r = logging.getLogger()
+ l1 = logging.getLogger('abc')
+ l2 = logging.getLogger('def.ghi')
+ c1 = r.getChild('xyz')
+ c2 = r.getChild('uvw.xyz')
+ self.assertTrue(c1 is logging.getLogger('xyz'))
+ self.assertTrue(c2 is logging.getLogger('uvw.xyz'))
+ c1 = l1.getChild('def')
+ c2 = c1.getChild('ghi')
+ c3 = l1.getChild('def.ghi')
+ self.assertTrue(c1 is logging.getLogger('abc.def'))
+ self.assertTrue(c2 is logging.getLogger('abc.def.ghi'))
+ self.assertTrue(c2 is c3)
+
+
+class DerivedLogRecord(logging.LogRecord):
+ pass
+
+class LogRecordFactoryTest(BaseTest):
+
+ def setUp(self):
+ class CheckingFilter(logging.Filter):
+ def __init__(self, cls):
+ self.cls = cls
+
+ def filter(self, record):
+ t = type(record)
+ if t is not self.cls:
+ msg = 'Unexpected LogRecord type %s, expected %s' % (t,
+ self.cls)
+ raise TypeError(msg)
+ return True
+
+ BaseTest.setUp(self)
+ self.filter = CheckingFilter(DerivedLogRecord)
+ self.root_logger.addFilter(self.filter)
+ self.orig_factory = logging.getLogRecordFactory()
+
+ def tearDown(self):
+ self.root_logger.removeFilter(self.filter)
+ BaseTest.tearDown(self)
+ logging.setLogRecordFactory(self.orig_factory)
+
+ def test_logrecord_class(self):
+ self.assertRaises(TypeError, self.root_logger.warning,
+ self.next_message())
+ logging.setLogRecordFactory(DerivedLogRecord)
+ self.root_logger.error(self.next_message())
+ self.assert_log_lines([
+ ('root', 'ERROR', '2'),
+ ])
+
+
+class QueueHandlerTest(BaseTest):
+ # Do not bother with a logger name group.
+ expected_log_pat = r"^[\w.]+ -> ([\w]+): ([\d]+)$"
+
+ def setUp(self):
+ BaseTest.setUp(self)
+ self.queue = queue.Queue(-1)
+ self.que_hdlr = logging.handlers.QueueHandler(self.queue)
+ self.que_logger = logging.getLogger('que')
+ self.que_logger.propagate = False
+ self.que_logger.setLevel(logging.WARNING)
+ self.que_logger.addHandler(self.que_hdlr)
+
+ def tearDown(self):
+ self.que_hdlr.close()
+ BaseTest.tearDown(self)
+
+ def test_queue_handler(self):
+ self.que_logger.debug(self.next_message())
+ self.assertRaises(queue.Empty, self.queue.get_nowait)
+ self.que_logger.info(self.next_message())
+ self.assertRaises(queue.Empty, self.queue.get_nowait)
+ msg = self.next_message()
+ self.que_logger.warning(msg)
+ data = self.queue.get_nowait()
+ self.assertTrue(isinstance(data, logging.LogRecord))
+ self.assertEqual(data.name, self.que_logger.name)
+ self.assertEqual((data.msg, data.args), (msg, None))
+
+ @unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'),
+ 'logging.handlers.QueueListener required for this test')
+ def test_queue_listener(self):
+ handler = TestHandler(Matcher())
+ listener = logging.handlers.QueueListener(self.queue, handler)
+ listener.start()
+ try:
+ self.que_logger.warning(self.next_message())
+ self.que_logger.error(self.next_message())
+ self.que_logger.critical(self.next_message())
+ finally:
+ listener.stop()
+ self.assertTrue(handler.matches(levelno=logging.WARNING, message='1'))
+ self.assertTrue(handler.matches(levelno=logging.ERROR, message='2'))
+ self.assertTrue(handler.matches(levelno=logging.CRITICAL, message='3'))
+
+
+class FormatterTest(unittest.TestCase):
+ def setUp(self):
+ self.common = {
+ 'name': 'formatter.test',
+ 'level': logging.DEBUG,
+ 'pathname': os.path.join('path', 'to', 'dummy.ext'),
+ 'lineno': 42,
+ 'exc_info': None,
+ 'func': None,
+ 'msg': 'Message with %d %s',
+ 'args': (2, 'placeholders'),
+ }
+ self.variants = {
+ }
+
+ def get_record(self, name=None):
+ result = dict(self.common)
+ if name is not None:
+ result.update(self.variants[name])
+ return logging.makeLogRecord(result)
+
+ def test_percent(self):
+ # Test %-formatting
+ r = self.get_record()
+ f = logging.Formatter('${%(message)s}')
+ self.assertEqual(f.format(r), '${Message with 2 placeholders}')
+ f = logging.Formatter('%(random)s')
+ self.assertRaises(KeyError, f.format, r)
+ self.assertFalse(f.usesTime())
+ f = logging.Formatter('%(asctime)s')
+ self.assertTrue(f.usesTime())
+ f = logging.Formatter('%(asctime)-15s')
+ self.assertTrue(f.usesTime())
+ f = logging.Formatter('asctime')
+ self.assertFalse(f.usesTime())
+
+ def test_braces(self):
+ # Test {}-formatting
+ r = self.get_record()
+ f = logging.Formatter('$%{message}%$', style='{')
+ self.assertEqual(f.format(r), '$%Message with 2 placeholders%$')
+ f = logging.Formatter('{random}', style='{')
+ self.assertRaises(KeyError, f.format, r)
+ self.assertFalse(f.usesTime())
+ f = logging.Formatter('{asctime}', style='{')
+ self.assertTrue(f.usesTime())
+ f = logging.Formatter('{asctime!s:15}', style='{')
+ self.assertTrue(f.usesTime())
+ f = logging.Formatter('{asctime:15}', style='{')
+ self.assertTrue(f.usesTime())
+ f = logging.Formatter('asctime', style='{')
+ self.assertFalse(f.usesTime())
+
+ def test_dollars(self):
+ # Test $-formatting
+ r = self.get_record()
+ f = logging.Formatter('$message', style='$')
+ self.assertEqual(f.format(r), 'Message with 2 placeholders')
+ f = logging.Formatter('$$%${message}%$$', style='$')
+ self.assertEqual(f.format(r), '$%Message with 2 placeholders%$')
+ f = logging.Formatter('${random}', style='$')
+ self.assertRaises(KeyError, f.format, r)
+ self.assertFalse(f.usesTime())
+ f = logging.Formatter('${asctime}', style='$')
+ self.assertTrue(f.usesTime())
+ f = logging.Formatter('${asctime', style='$')
+ self.assertFalse(f.usesTime())
+ f = logging.Formatter('$asctime', style='$')
+ self.assertTrue(f.usesTime())
+ f = logging.Formatter('asctime', style='$')
+ self.assertFalse(f.usesTime())
+
+class LastResortTest(BaseTest):
+ def test_last_resort(self):
+ # Test the last resort handler
+ root = self.root_logger
+ root.removeHandler(self.root_hdlr)
+ old_stderr = sys.stderr
+ old_lastresort = logging.lastResort
+ old_raise_exceptions = logging.raiseExceptions
+ try:
+ sys.stderr = sio = io.StringIO()
+ root.warning('This is your final chance!')
+ self.assertEqual(sio.getvalue(), 'This is your final chance!\n')
+ #No handlers and no last resort, so 'No handlers' message
+ logging.lastResort = None
+ sys.stderr = sio = io.StringIO()
+ root.warning('This is your final chance!')
+ self.assertEqual(sio.getvalue(), 'No handlers could be found for logger "root"\n')
+ # 'No handlers' message only printed once
+ sys.stderr = sio = io.StringIO()
+ root.warning('This is your final chance!')
+ self.assertEqual(sio.getvalue(), '')
+ root.manager.emittedNoHandlerWarning = False
+ #If raiseExceptions is False, no message is printed
+ logging.raiseExceptions = False
+ sys.stderr = sio = io.StringIO()
+ root.warning('This is your final chance!')
+ self.assertEqual(sio.getvalue(), '')
+ finally:
+ sys.stderr = old_stderr
+ root.addHandler(self.root_hdlr)
+ logging.lastResort = old_lastresort
+ logging.raiseExceptions = old_raise_exceptions
+
+
+class BaseFileTest(BaseTest):
+ "Base class for handler tests that write log files"
+
+ def setUp(self):
+ BaseTest.setUp(self)
+ fd, self.fn = tempfile.mkstemp(".log", "test_logging-2-")
+ os.close(fd)
+ self.rmfiles = []
+
+ def tearDown(self):
+ for fn in self.rmfiles:
+ os.unlink(fn)
+ if os.path.exists(self.fn):
+ os.unlink(self.fn)
+ BaseTest.tearDown(self)
+
+ def assertLogFile(self, filename):
+ "Assert a log file is there and register it for deletion"
+ self.assertTrue(os.path.exists(filename),
+ msg="Log file %r does not exist")
+ self.rmfiles.append(filename)
+
+
+class RotatingFileHandlerTest(BaseFileTest):
+ def next_rec(self):
+ return logging.LogRecord('n', logging.DEBUG, 'p', 1,
+ self.next_message(), None, None, None)
+
+ def test_should_not_rollover(self):
+ # If maxbytes is zero rollover never occurs
+ rh = logging.handlers.RotatingFileHandler(self.fn, maxBytes=0)
+ self.assertFalse(rh.shouldRollover(None))
+ rh.close()
+
+ def test_should_rollover(self):
+ rh = logging.handlers.RotatingFileHandler(self.fn, maxBytes=1)
+ self.assertTrue(rh.shouldRollover(self.next_rec()))
+ rh.close()
+
+ def test_file_created(self):
+ # checks that the file is created and assumes it was created
+ # by us
+ rh = logging.handlers.RotatingFileHandler(self.fn)
+ rh.emit(self.next_rec())
+ self.assertLogFile(self.fn)
+ rh.close()
+
+ def test_rollover_filenames(self):
+ rh = logging.handlers.RotatingFileHandler(
+ self.fn, backupCount=2, maxBytes=1)
+ rh.emit(self.next_rec())
+ self.assertLogFile(self.fn)
+ rh.emit(self.next_rec())
+ self.assertLogFile(self.fn + ".1")
+ rh.emit(self.next_rec())
+ self.assertLogFile(self.fn + ".2")
+ self.assertFalse(os.path.exists(self.fn + ".3"))
+ rh.close()
+
+class TimedRotatingFileHandlerTest(BaseFileTest):
+ # test methods added below
+ pass
+
+def secs(**kw):
+ return datetime.timedelta(**kw) // datetime.timedelta(seconds=1)
+
+for when, exp in (('S', 1),
+ ('M', 60),
+ ('H', 60 * 60),
+ ('D', 60 * 60 * 24),
+ ('MIDNIGHT', 60 * 60 * 24),
+ # current time (epoch start) is a Thursday, W0 means Monday
+ ('W0', secs(days=4, hours=24)),
+ ):
+ def test_compute_rollover(self, when=when, exp=exp):
+ rh = logging.handlers.TimedRotatingFileHandler(
+ self.fn, when=when, interval=1, backupCount=0, utc=True)
+ currentTime = 0.0
+ actual = rh.computeRollover(currentTime)
+ if exp != actual:
+ # Failures occur on some systems for MIDNIGHT and W0.
+ # Print detailed calculation for MIDNIGHT so we can try to see
+ # what's going on
+ import time
+ if when == 'MIDNIGHT':
+ try:
+ if rh.utc:
+ t = time.gmtime(currentTime)
+ else:
+ t = time.localtime(currentTime)
+ currentHour = t[3]
+ currentMinute = t[4]
+ currentSecond = t[5]
+ # r is the number of seconds left between now and midnight
+ r = logging.handlers._MIDNIGHT - ((currentHour * 60 +
+ currentMinute) * 60 +
+ currentSecond)
+ result = currentTime + r
+ print('t: %s (%s)' % (t, rh.utc), file=sys.stderr)
+ print('currentHour: %s' % currentHour, file=sys.stderr)
+ print('currentMinute: %s' % currentMinute, file=sys.stderr)
+ print('currentSecond: %s' % currentSecond, file=sys.stderr)
+ print('r: %s' % r, file=sys.stderr)
+ print('result: %s' % result, file=sys.stderr)
+ except Exception:
+ print('exception in diagnostic code: %s' % sys.exc_info()[1], file=sys.stderr)
+ self.assertEqual(exp, actual)
+ rh.close()
+ setattr(TimedRotatingFileHandlerTest, "test_compute_rollover_%s" % when, test_compute_rollover)
+
# Set the locale to the platform-dependent default. I have no idea
# why the test does this, but in any case we save the current locale
# first and restore it at the end.
@run_with_locale('LC_ALL', '')
def test_main():
run_unittest(BuiltinLevelsTest, BasicFilterTest,
- CustomLevelsAndFiltersTest, MemoryHandlerTest,
- ConfigFileTest, SocketHandlerTest, MemoryTest,
- EncodingTest, WarningsTest)
+ CustomLevelsAndFiltersTest, MemoryHandlerTest,
+ ConfigFileTest, SocketHandlerTest, MemoryTest,
+ EncodingTest, WarningsTest, ConfigDictTest, ManagerTest,
+ FormatterTest,
+ LogRecordFactoryTest, ChildLoggerTest, QueueHandlerTest,
+ RotatingFileHandlerTest,
+ LastResortTest,
+ TimedRotatingFileHandlerTest
+ )
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index 9c2bac735d..04066ec1e7 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -1,9 +1,11 @@
import unittest
from test import support
+
import sys
import random
import math
+import array
# Used for lazy formatting of failure messages
class Frm(object):
@@ -35,25 +37,41 @@ del p2
# add complements & negations
special += [~x for x in special] + [-x for x in special]
-L = [
- ('0', 0),
- ('1', 1),
- ('9', 9),
- ('10', 10),
- ('99', 99),
- ('100', 100),
- ('314', 314),
- (' 314', 314),
- ('314 ', 314),
- (' \t\t 314 \t\t ', 314),
- (repr(sys.maxsize), sys.maxsize),
- (' 1x', ValueError),
- (' 1 ', 1),
- (' 1\02 ', ValueError),
- ('', ValueError),
- (' ', ValueError),
- (' \t\t ', ValueError)
-]
+DBL_MAX = sys.float_info.max
+DBL_MAX_EXP = sys.float_info.max_exp
+DBL_MIN_EXP = sys.float_info.min_exp
+DBL_MANT_DIG = sys.float_info.mant_dig
+DBL_MIN_OVERFLOW = 2**DBL_MAX_EXP - 2**(DBL_MAX_EXP - DBL_MANT_DIG - 1)
+
+# pure Python version of correctly-rounded true division
+def truediv(a, b):
+ """Correctly-rounded true division for integers."""
+ negative = a^b < 0
+ a, b = abs(a), abs(b)
+
+ # exceptions: division by zero, overflow
+ if not b:
+ raise ZeroDivisionError("division by zero")
+ if a >= DBL_MIN_OVERFLOW * b:
+ raise OverflowError("int/int too large to represent as a float")
+
+ # find integer d satisfying 2**(d - 1) <= a/b < 2**d
+ d = a.bit_length() - b.bit_length()
+ if d >= 0 and a >= 2**d * b or d < 0 and a * 2**-d >= b:
+ d += 1
+
+ # compute 2**-exp * a / b for suitable exp
+ exp = max(d, DBL_MIN_EXP) - DBL_MANT_DIG
+ a, b = a << max(-exp, 0), b << max(exp, 0)
+ q, r = divmod(a, b)
+
+ # round-half-to-even: fractional part is r/b, which is > 0.5 iff
+ # 2*r > b, and == 0.5 iff 2*r == b.
+ if 2*r > b or 2*r == b and q % 2 == 1:
+ q += 1
+
+ result = math.ldexp(q, exp)
+ return -result if negative else result
class LongTest(unittest.TestCase):
@@ -254,7 +272,7 @@ class LongTest(unittest.TestCase):
digits = digits or [0]
return '-'[:sign] + \
{2: '0b', 8: '0o', 10: '', 16: '0x'}[base] + \
- "".join(map(lambda i: "0123456789abcdef"[i], digits))
+ "".join("0123456789abcdef"[i] for i in digits)
def check_format_1(self, x):
for base, mapper in (8, oct), (10, repr), (16, hex):
@@ -263,7 +281,7 @@ class LongTest(unittest.TestCase):
msg = Frm("%s returned %r but expected %r for %r",
mapper.__name__, got, expected, x)
self.assertEqual(got, expected, msg)
- self.assertEqual(int(got, 0), x, Frm('long("%s", 0) != %r', got, x))
+ self.assertEqual(int(got, 0), x, Frm('int("%s", 0) != %r', got, x))
# str() has to be checked a little differently since there's no
# trailing "L"
got = str(x)
@@ -281,25 +299,12 @@ class LongTest(unittest.TestCase):
self.check_format_1(x)
def test_long(self):
- self.assertEqual(int(314), 314)
- self.assertEqual(int(3.14), 3)
- self.assertEqual(int(314), 314)
- # Check that conversion from float truncates towards zero
- self.assertEqual(int(-3.14), -3)
- self.assertEqual(int(3.9), 3)
- self.assertEqual(int(-3.9), -3)
- self.assertEqual(int(3.5), 3)
- self.assertEqual(int(-3.5), -3)
- self.assertEqual(int("-3"), -3)
- # Different base:
- self.assertEqual(int("10",16), 16)
- # Check conversions from string (same test set as for int(), and then some)
+ # Check conversions from string
LL = [
('1' + '0'*20, 10**20),
('1' + '0'*100, 10**100)
]
- L2 = L[:]
- for s, v in L2 + LL:
+ for s, v in LL:
for sign in "", "+", "-":
for prefix in "", " ", "\t", " \t\t ":
ss = prefix + sign + s
@@ -307,12 +312,10 @@ class LongTest(unittest.TestCase):
if sign == "-" and v is not ValueError:
vv = -v
try:
- self.assertEqual(int(ss), int(vv))
+ self.assertEqual(int(ss), vv)
except ValueError:
pass
- self.assertRaises(ValueError, int, '123\0')
- self.assertRaises(ValueError, int, '53', 40)
# trailing L should no longer be accepted...
self.assertRaises(ValueError, int, '123L')
self.assertRaises(ValueError, int, '123l')
@@ -323,87 +326,6 @@ class LongTest(unittest.TestCase):
# ... but it's just a normal digit if base >= 22
self.assertEqual(int('1L', 22), 43)
- self.assertRaises(TypeError, int, 1, 12)
-
- # SF patch #1638879: embedded NULs were not detected with
- # explicit base
- self.assertRaises(ValueError, int, '123\0', 10)
- self.assertRaises(ValueError, int, '123\x00 245', 20)
-
- self.assertEqual(int('100000000000000000000000000000000', 2),
- 4294967296)
- self.assertEqual(int('102002022201221111211', 3), 4294967296)
- self.assertEqual(int('10000000000000000', 4), 4294967296)
- self.assertEqual(int('32244002423141', 5), 4294967296)
- self.assertEqual(int('1550104015504', 6), 4294967296)
- self.assertEqual(int('211301422354', 7), 4294967296)
- self.assertEqual(int('40000000000', 8), 4294967296)
- self.assertEqual(int('12068657454', 9), 4294967296)
- self.assertEqual(int('4294967296', 10), 4294967296)
- self.assertEqual(int('1904440554', 11), 4294967296)
- self.assertEqual(int('9ba461594', 12), 4294967296)
- self.assertEqual(int('535a79889', 13), 4294967296)
- self.assertEqual(int('2ca5b7464', 14), 4294967296)
- self.assertEqual(int('1a20dcd81', 15), 4294967296)
- self.assertEqual(int('100000000', 16), 4294967296)
- self.assertEqual(int('a7ffda91', 17), 4294967296)
- self.assertEqual(int('704he7g4', 18), 4294967296)
- self.assertEqual(int('4f5aff66', 19), 4294967296)
- self.assertEqual(int('3723ai4g', 20), 4294967296)
- self.assertEqual(int('281d55i4', 21), 4294967296)
- self.assertEqual(int('1fj8b184', 22), 4294967296)
- self.assertEqual(int('1606k7ic', 23), 4294967296)
- self.assertEqual(int('mb994ag', 24), 4294967296)
- self.assertEqual(int('hek2mgl', 25), 4294967296)
- self.assertEqual(int('dnchbnm', 26), 4294967296)
- self.assertEqual(int('b28jpdm', 27), 4294967296)
- self.assertEqual(int('8pfgih4', 28), 4294967296)
- self.assertEqual(int('76beigg', 29), 4294967296)
- self.assertEqual(int('5qmcpqg', 30), 4294967296)
- self.assertEqual(int('4q0jto4', 31), 4294967296)
- self.assertEqual(int('4000000', 32), 4294967296)
- self.assertEqual(int('3aokq94', 33), 4294967296)
- self.assertEqual(int('2qhxjli', 34), 4294967296)
- self.assertEqual(int('2br45qb', 35), 4294967296)
- self.assertEqual(int('1z141z4', 36), 4294967296)
-
- self.assertEqual(int('100000000000000000000000000000001', 2),
- 4294967297)
- self.assertEqual(int('102002022201221111212', 3), 4294967297)
- self.assertEqual(int('10000000000000001', 4), 4294967297)
- self.assertEqual(int('32244002423142', 5), 4294967297)
- self.assertEqual(int('1550104015505', 6), 4294967297)
- self.assertEqual(int('211301422355', 7), 4294967297)
- self.assertEqual(int('40000000001', 8), 4294967297)
- self.assertEqual(int('12068657455', 9), 4294967297)
- self.assertEqual(int('4294967297', 10), 4294967297)
- self.assertEqual(int('1904440555', 11), 4294967297)
- self.assertEqual(int('9ba461595', 12), 4294967297)
- self.assertEqual(int('535a7988a', 13), 4294967297)
- self.assertEqual(int('2ca5b7465', 14), 4294967297)
- self.assertEqual(int('1a20dcd82', 15), 4294967297)
- self.assertEqual(int('100000001', 16), 4294967297)
- self.assertEqual(int('a7ffda92', 17), 4294967297)
- self.assertEqual(int('704he7g5', 18), 4294967297)
- self.assertEqual(int('4f5aff67', 19), 4294967297)
- self.assertEqual(int('3723ai4h', 20), 4294967297)
- self.assertEqual(int('281d55i5', 21), 4294967297)
- self.assertEqual(int('1fj8b185', 22), 4294967297)
- self.assertEqual(int('1606k7id', 23), 4294967297)
- self.assertEqual(int('mb994ah', 24), 4294967297)
- self.assertEqual(int('hek2mgm', 25), 4294967297)
- self.assertEqual(int('dnchbnn', 26), 4294967297)
- self.assertEqual(int('b28jpdn', 27), 4294967297)
- self.assertEqual(int('8pfgih5', 28), 4294967297)
- self.assertEqual(int('76beigh', 29), 4294967297)
- self.assertEqual(int('5qmcpqh', 30), 4294967297)
- self.assertEqual(int('4q0jto5', 31), 4294967297)
- self.assertEqual(int('4000001', 32), 4294967297)
- self.assertEqual(int('3aokq95', 33), 4294967297)
- self.assertEqual(int('2qhxjlj', 34), 4294967297)
- self.assertEqual(int('2br45qc', 35), 4294967297)
- self.assertEqual(int('1z141z5', 36), 4294967297)
-
# tests with base 0
self.assertEqual(int('000', 0), 0)
self.assertEqual(int('0o123', 0), 83)
@@ -419,228 +341,34 @@ class LongTest(unittest.TestCase):
self.assertRaises(ValueError, int, '08', 0)
self.assertRaises(ValueError, int, '-012395', 0)
- def test_conversion(self):
- # Test __int__()
- class ClassicMissingMethods:
- pass
- self.assertRaises(TypeError, int, ClassicMissingMethods())
-
- class MissingMethods(object):
- pass
- self.assertRaises(TypeError, int, MissingMethods())
+ # invalid bases
+ invalid_bases = [-909,
+ 2**31-1, 2**31, -2**31, -2**31-1,
+ 2**63-1, 2**63, -2**63, -2**63-1,
+ 2**100, -2**100,
+ ]
+ for base in invalid_bases:
+ self.assertRaises(ValueError, int, '42', base)
- class Foo0:
- def __int__(self):
- return 42
- class Foo1(object):
- def __int__(self):
- return 42
+ def test_conversion(self):
- class Foo2(int):
- def __int__(self):
+ class JustLong:
+ # test that __long__ no longer used in 3.x
+ def __long__(self):
return 42
+ self.assertRaises(TypeError, int, JustLong())
- class Foo3(int):
- def __int__(self):
- return self
-
- class Foo4(int):
- def __int__(self):
+ class LongTrunc:
+ # __long__ should be ignored in 3.x
+ def __long__(self):
return 42
+ def __trunc__(self):
+ return 1729
+ self.assertEqual(int(LongTrunc()), 1729)
- class Foo5(int):
- def __int__(self):
- return 42.
-
- self.assertEqual(int(Foo0()), 42)
- self.assertEqual(int(Foo1()), 42)
- self.assertEqual(int(Foo2()), 42)
- self.assertEqual(int(Foo3()), 0)
- self.assertEqual(int(Foo4()), 42)
- self.assertRaises(TypeError, int, Foo5())
-
- class Classic:
- pass
- for base in (object, Classic):
- class IntOverridesTrunc(base):
- def __int__(self):
- return 42
- def __trunc__(self):
- return -12
- self.assertEqual(int(IntOverridesTrunc()), 42)
-
- class JustTrunc(base):
- def __trunc__(self):
- return 42
- self.assertEqual(int(JustTrunc()), 42)
-
- class JustLong(base):
- # test that __long__ no longer used in 3.x
- def __long__(self):
- return 42
- self.assertRaises(TypeError, int, JustLong())
-
- class LongTrunc(base):
- # __long__ should be ignored in 3.x
- def __long__(self):
- return 42
- def __trunc__(self):
- return 1729
- self.assertEqual(int(LongTrunc()), 1729)
-
- for trunc_result_base in (object, Classic):
- class Integral(trunc_result_base):
- def __int__(self):
- return 42
-
- class TruncReturnsNonLong(base):
- def __trunc__(self):
- return Integral()
- self.assertEqual(int(TruncReturnsNonLong()), 42)
-
- class NonIntegral(trunc_result_base):
- def __trunc__(self):
- # Check that we avoid infinite recursion.
- return NonIntegral()
-
- class TruncReturnsNonIntegral(base):
- def __trunc__(self):
- return NonIntegral()
- try:
- int(TruncReturnsNonIntegral())
- except TypeError as e:
- self.assertEqual(str(e),
- "__trunc__ returned non-Integral"
- " (type NonIntegral)")
- else:
- self.fail("Failed to raise TypeError with %s" %
- ((base, trunc_result_base),))
-
- def test_misc(self):
-
- # check the extremes in int<->long conversion
- hugepos = sys.maxsize
- hugeneg = -hugepos - 1
- hugepos_aslong = int(hugepos)
- hugeneg_aslong = int(hugeneg)
- self.assertEqual(hugepos, hugepos_aslong, "long(sys.maxsize) != sys.maxsize")
- self.assertEqual(hugeneg, hugeneg_aslong,
- "long(-sys.maxsize-1) != -sys.maxsize-1")
-
- # long -> int should not fail for hugepos_aslong or hugeneg_aslong
- x = int(hugepos_aslong)
- try:
- self.assertEqual(x, hugepos,
- "converting sys.maxsize to long and back to int fails")
- except OverflowError:
- self.fail("int(long(sys.maxsize)) overflowed!")
- if not isinstance(x, int):
- raise TestFailed("int(long(sys.maxsize)) should have returned int")
- x = int(hugeneg_aslong)
- try:
- self.assertEqual(x, hugeneg,
- "converting -sys.maxsize-1 to long and back to int fails")
- except OverflowError:
- self.fail("int(long(-sys.maxsize-1)) overflowed!")
- if not isinstance(x, int):
- raise TestFailed("int(long(-sys.maxsize-1)) should have "
- "returned int")
- # but long -> int should overflow for hugepos+1 and hugeneg-1
- x = hugepos_aslong + 1
- try:
- y = int(x)
- except OverflowError:
- self.fail("int(long(sys.maxsize) + 1) mustn't overflow")
- self.assertTrue(isinstance(y, int),
- "int(long(sys.maxsize) + 1) should have returned long")
-
- x = hugeneg_aslong - 1
- try:
- y = int(x)
- except OverflowError:
- self.fail("int(long(-sys.maxsize-1) - 1) mustn't overflow")
- self.assertTrue(isinstance(y, int),
- "int(long(-sys.maxsize-1) - 1) should have returned long")
-
- class long2(int):
- pass
- x = long2(1<<100)
- y = int(x)
- self.assertTrue(type(y) is int,
- "overflowing int conversion must return long not long subtype")
-
-# ----------------------------------- tests of auto int->long conversion
-
- def test_auto_overflow(self):
- import math, sys
-
- special = [0, 1, 2, 3, sys.maxsize-1, sys.maxsize, sys.maxsize+1]
- sqrt = int(math.sqrt(sys.maxsize))
- special.extend([sqrt-1, sqrt, sqrt+1])
- special.extend([-i for i in special])
-
- def checkit(*args):
- # Heavy use of nested scopes here!
- self.assertEqual(got, expected,
- Frm("for %r expected %r got %r", args, expected, got))
-
- for x in special:
- longx = int(x)
-
- expected = -longx
- got = -x
- checkit('-', x)
-
- for y in special:
- longy = int(y)
-
- expected = longx + longy
- got = x + y
- checkit(x, '+', y)
-
- expected = longx - longy
- got = x - y
- checkit(x, '-', y)
-
- expected = longx * longy
- got = x * y
- checkit(x, '*', y)
-
- if y:
- expected = longx / longy
- got = x / y
- checkit(x, '/', y)
-
- expected = longx // longy
- got = x // y
- checkit(x, '//', y)
-
- expected = divmod(longx, longy)
- got = divmod(longx, longy)
- checkit(x, 'divmod', y)
-
- if abs(y) < 5 and not (x == 0 and y < 0):
- expected = longx ** longy
- got = x ** y
- checkit(x, '**', y)
-
- for z in special:
- if z != 0 :
- if y >= 0:
- expected = pow(longx, longy, int(z))
- got = pow(x, y, z)
- checkit('pow', x, y, '%', z)
- else:
- self.assertRaises(TypeError, pow,longx, longy, int(z))
-
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
+ @support.requires_IEEE_754
def test_float_conversion(self):
- import sys
- DBL_MAX = sys.float_info.max
- DBL_MAX_EXP = sys.float_info.max_exp
- DBL_MANT_DIG = sys.float_info.mant_dig
exact_values = [0, 1, 2,
2**53-3,
@@ -694,8 +422,6 @@ class LongTest(unittest.TestCase):
self.assertEqual(int(float(x)), y)
def test_float_overflow(self):
- import math
-
for x in -2.0, -1.0, 0.0, 1.0, 2.0:
self.assertEqual(float(int(x)), x)
@@ -721,14 +447,12 @@ class LongTest(unittest.TestCase):
self.assertRaises(OverflowError, eval, test, namespace)
- # XXX Perhaps float(shuge) can raise OverflowError on some box?
- # The comparison should not.
- self.assertNotEqual(float(shuge), int(shuge),
- "float(shuge) should not equal int(shuge)")
+ # XXX Perhaps float(shuge) can raise OverflowError on some box?
+ # The comparison should not.
+ self.assertNotEqual(float(shuge), int(shuge),
+ "float(shuge) should not equal int(shuge)")
def test_logs(self):
- import math
-
LOG10E = math.log10(math.e)
for exp in list(range(10)) + [100, 1000, 10000]:
@@ -748,7 +472,6 @@ class LongTest(unittest.TestCase):
def test_mixed_compares(self):
eq = self.assertEqual
- import math
# We're mostly concerned with that mixing floats and longs does the
# right stuff, even when longs are too large to fit in a float.
@@ -794,7 +517,7 @@ class LongTest(unittest.TestCase):
self.d = d
assert float(n) / float(d) == value
else:
- raise TypeError("can't deal with %r" % val)
+ raise TypeError("can't deal with %r" % value)
def _cmp__(self, other):
if not isinstance(other, Rat):
@@ -821,7 +544,7 @@ class LongTest(unittest.TestCase):
cases.extend([t - 1.0, t - 0.3, t, t + 0.3, t + 1.0,
int(t-1), int(t), int(t+1)])
cases.extend([0, 1, 2, sys.maxsize, float(sys.maxsize)])
- # 1L<<20000 should exceed all double formats. long(1e200) is to
+ # 1 << 20000 should exceed all double formats. int(1e200) is to
# check that we get equality with 1e200 above.
t = int(1e200)
cases.extend([0, 1, 2, 1 << 20000, t-1, t, t+1])
@@ -945,6 +668,127 @@ class LongTest(unittest.TestCase):
for zero in ["huge / 0", "mhuge / 0"]:
self.assertRaises(ZeroDivisionError, eval, zero, namespace)
+ def check_truediv(self, a, b, skip_small=True):
+ """Verify that the result of a/b is correctly rounded, by
+ comparing it with a pure Python implementation of correctly
+ rounded division. b should be nonzero."""
+
+ # skip check for small a and b: in this case, the current
+ # implementation converts the arguments to float directly and
+ # then applies a float division. This can give doubly-rounded
+ # results on x87-using machines (particularly 32-bit Linux).
+ if skip_small and max(abs(a), abs(b)) < 2**DBL_MANT_DIG:
+ return
+
+ try:
+ # use repr so that we can distinguish between -0.0 and 0.0
+ expected = repr(truediv(a, b))
+ except OverflowError:
+ expected = 'overflow'
+ except ZeroDivisionError:
+ expected = 'zerodivision'
+
+ try:
+ got = repr(a / b)
+ except OverflowError:
+ got = 'overflow'
+ except ZeroDivisionError:
+ got = 'zerodivision'
+
+ self.assertEqual(expected, got, "Incorrectly rounded division {}/{}: "
+ "expected {}, got {}".format(a, b, expected, got))
+
+ @support.requires_IEEE_754
+ def test_correctly_rounded_true_division(self):
+ # more stringent tests than those above, checking that the
+ # result of true division of ints is always correctly rounded.
+ # This test should probably be considered CPython-specific.
+
+ # Exercise all the code paths not involving Gb-sized ints.
+ # ... divisions involving zero
+ self.check_truediv(123, 0)
+ self.check_truediv(-456, 0)
+ self.check_truediv(0, 3)
+ self.check_truediv(0, -3)
+ self.check_truediv(0, 0)
+ # ... overflow or underflow by large margin
+ self.check_truediv(671 * 12345 * 2**DBL_MAX_EXP, 12345)
+ self.check_truediv(12345, 345678 * 2**(DBL_MANT_DIG - DBL_MIN_EXP))
+ # ... a much larger or smaller than b
+ self.check_truediv(12345*2**100, 98765)
+ self.check_truediv(12345*2**30, 98765*7**81)
+ # ... a / b near a boundary: one of 1, 2**DBL_MANT_DIG, 2**DBL_MIN_EXP,
+ # 2**DBL_MAX_EXP, 2**(DBL_MIN_EXP-DBL_MANT_DIG)
+ bases = (0, DBL_MANT_DIG, DBL_MIN_EXP,
+ DBL_MAX_EXP, DBL_MIN_EXP - DBL_MANT_DIG)
+ for base in bases:
+ for exp in range(base - 15, base + 15):
+ self.check_truediv(75312*2**max(exp, 0), 69187*2**max(-exp, 0))
+ self.check_truediv(69187*2**max(exp, 0), 75312*2**max(-exp, 0))
+
+ # overflow corner case
+ for m in [1, 2, 7, 17, 12345, 7**100,
+ -1, -2, -5, -23, -67891, -41**50]:
+ for n in range(-10, 10):
+ self.check_truediv(m*DBL_MIN_OVERFLOW + n, m)
+ self.check_truediv(m*DBL_MIN_OVERFLOW + n, -m)
+
+ # check detection of inexactness in shifting stage
+ for n in range(250):
+ # (2**DBL_MANT_DIG+1)/(2**DBL_MANT_DIG) lies halfway
+ # between two representable floats, and would usually be
+ # rounded down under round-half-to-even. The tiniest of
+ # additions to the numerator should cause it to be rounded
+ # up instead.
+ self.check_truediv((2**DBL_MANT_DIG + 1)*12345*2**200 + 2**n,
+ 2**DBL_MANT_DIG*12345)
+
+ # 1/2731 is one of the smallest division cases that's subject
+ # to double rounding on IEEE 754 machines working internally with
+ # 64-bit precision. On such machines, the next check would fail,
+ # were it not explicitly skipped in check_truediv.
+ self.check_truediv(1, 2731)
+
+ # a particularly bad case for the old algorithm: gives an
+ # error of close to 3.5 ulps.
+ self.check_truediv(295147931372582273023, 295147932265116303360)
+ for i in range(1000):
+ self.check_truediv(10**(i+1), 10**i)
+ self.check_truediv(10**i, 10**(i+1))
+
+ # test round-half-to-even behaviour, normal result
+ for m in [1, 2, 4, 7, 8, 16, 17, 32, 12345, 7**100,
+ -1, -2, -5, -23, -67891, -41**50]:
+ for n in range(-10, 10):
+ self.check_truediv(2**DBL_MANT_DIG*m + n, m)
+
+ # test round-half-to-even, subnormal result
+ for n in range(-20, 20):
+ self.check_truediv(n, 2**1076)
+
+ # largeish random divisions: a/b where |a| <= |b| <=
+ # 2*|a|; |ans| is between 0.5 and 1.0, so error should
+ # always be bounded by 2**-54 with equality possible only
+ # if the least significant bit of q=ans*2**53 is zero.
+ for M in [10**10, 10**100, 10**1000]:
+ for i in range(1000):
+ a = random.randrange(1, M)
+ b = random.randrange(a, 2*a+1)
+ self.check_truediv(a, b)
+ self.check_truediv(-a, b)
+ self.check_truediv(a, -b)
+ self.check_truediv(-a, -b)
+
+ # and some (genuinely) random tests
+ for _ in range(10000):
+ a_bits = random.randrange(1000)
+ b_bits = random.randrange(1, 1000)
+ x = random.randrange(2**a_bits)
+ y = random.randrange(1, 2**b_bits)
+ self.check_truediv(x, y)
+ self.check_truediv(x, -y)
+ self.check_truediv(-x, y)
+ self.check_truediv(-x, -y)
def test_small_ints(self):
for i in range(-5, 257):
@@ -1072,6 +916,237 @@ class LongTest(unittest.TestCase):
for e in bad_exponents:
self.assertRaises(TypeError, round, 3, e)
+ def test_to_bytes(self):
+ def check(tests, byteorder, signed=False):
+ for test, expected in tests.items():
+ try:
+ self.assertEqual(
+ test.to_bytes(len(expected), byteorder, signed=signed),
+ expected)
+ except Exception as err:
+ raise AssertionError(
+ "failed to convert {0} with byteorder={1} and signed={2}"
+ .format(test, byteorder, signed)) from err
+
+ # Convert integers to signed big-endian byte arrays.
+ tests1 = {
+ 0: b'\x00',
+ 1: b'\x01',
+ -1: b'\xff',
+ -127: b'\x81',
+ -128: b'\x80',
+ -129: b'\xff\x7f',
+ 127: b'\x7f',
+ 129: b'\x00\x81',
+ -255: b'\xff\x01',
+ -256: b'\xff\x00',
+ 255: b'\x00\xff',
+ 256: b'\x01\x00',
+ 32767: b'\x7f\xff',
+ -32768: b'\xff\x80\x00',
+ 65535: b'\x00\xff\xff',
+ -65536: b'\xff\x00\x00',
+ -8388608: b'\x80\x00\x00'
+ }
+ check(tests1, 'big', signed=True)
+
+ # Convert integers to signed little-endian byte arrays.
+ tests2 = {
+ 0: b'\x00',
+ 1: b'\x01',
+ -1: b'\xff',
+ -127: b'\x81',
+ -128: b'\x80',
+ -129: b'\x7f\xff',
+ 127: b'\x7f',
+ 129: b'\x81\x00',
+ -255: b'\x01\xff',
+ -256: b'\x00\xff',
+ 255: b'\xff\x00',
+ 256: b'\x00\x01',
+ 32767: b'\xff\x7f',
+ -32768: b'\x00\x80',
+ 65535: b'\xff\xff\x00',
+ -65536: b'\x00\x00\xff',
+ -8388608: b'\x00\x00\x80'
+ }
+ check(tests2, 'little', signed=True)
+
+ # Convert integers to unsigned big-endian byte arrays.
+ tests3 = {
+ 0: b'\x00',
+ 1: b'\x01',
+ 127: b'\x7f',
+ 128: b'\x80',
+ 255: b'\xff',
+ 256: b'\x01\x00',
+ 32767: b'\x7f\xff',
+ 32768: b'\x80\x00',
+ 65535: b'\xff\xff',
+ 65536: b'\x01\x00\x00'
+ }
+ check(tests3, 'big', signed=False)
+
+ # Convert integers to unsigned little-endian byte arrays.
+ tests4 = {
+ 0: b'\x00',
+ 1: b'\x01',
+ 127: b'\x7f',
+ 128: b'\x80',
+ 255: b'\xff',
+ 256: b'\x00\x01',
+ 32767: b'\xff\x7f',
+ 32768: b'\x00\x80',
+ 65535: b'\xff\xff',
+ 65536: b'\x00\x00\x01'
+ }
+ check(tests4, 'little', signed=False)
+
+ self.assertRaises(OverflowError, (256).to_bytes, 1, 'big', signed=False)
+ self.assertRaises(OverflowError, (256).to_bytes, 1, 'big', signed=True)
+ self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=False)
+ self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=True)
+ self.assertRaises(OverflowError, (-1).to_bytes, 2, 'big', signed=False),
+ self.assertRaises(OverflowError, (-1).to_bytes, 2, 'little', signed=False)
+ self.assertEqual((0).to_bytes(0, 'big'), b'')
+ self.assertEqual((1).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x01')
+ self.assertEqual((0).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x00')
+ self.assertEqual((-1).to_bytes(5, 'big', signed=True),
+ b'\xff\xff\xff\xff\xff')
+ self.assertRaises(OverflowError, (1).to_bytes, 0, 'big')
+
+ def test_from_bytes(self):
+ def check(tests, byteorder, signed=False):
+ for test, expected in tests.items():
+ try:
+ self.assertEqual(
+ int.from_bytes(test, byteorder, signed=signed),
+ expected)
+ except Exception as err:
+ raise AssertionError(
+ "failed to convert {0} with byteorder={1!r} and signed={2}"
+ .format(test, byteorder, signed)) from err
+
+ # Convert signed big-endian byte arrays to integers.
+ tests1 = {
+ b'': 0,
+ b'\x00': 0,
+ b'\x00\x00': 0,
+ b'\x01': 1,
+ b'\x00\x01': 1,
+ b'\xff': -1,
+ b'\xff\xff': -1,
+ b'\x81': -127,
+ b'\x80': -128,
+ b'\xff\x7f': -129,
+ b'\x7f': 127,
+ b'\x00\x81': 129,
+ b'\xff\x01': -255,
+ b'\xff\x00': -256,
+ b'\x00\xff': 255,
+ b'\x01\x00': 256,
+ b'\x7f\xff': 32767,
+ b'\x80\x00': -32768,
+ b'\x00\xff\xff': 65535,
+ b'\xff\x00\x00': -65536,
+ b'\x80\x00\x00': -8388608
+ }
+ check(tests1, 'big', signed=True)
+
+ # Convert signed little-endian byte arrays to integers.
+ tests2 = {
+ b'': 0,
+ b'\x00': 0,
+ b'\x00\x00': 0,
+ b'\x01': 1,
+ b'\x00\x01': 256,
+ b'\xff': -1,
+ b'\xff\xff': -1,
+ b'\x81': -127,
+ b'\x80': -128,
+ b'\x7f\xff': -129,
+ b'\x7f': 127,
+ b'\x81\x00': 129,
+ b'\x01\xff': -255,
+ b'\x00\xff': -256,
+ b'\xff\x00': 255,
+ b'\x00\x01': 256,
+ b'\xff\x7f': 32767,
+ b'\x00\x80': -32768,
+ b'\xff\xff\x00': 65535,
+ b'\x00\x00\xff': -65536,
+ b'\x00\x00\x80': -8388608
+ }
+ check(tests2, 'little', signed=True)
+
+ # Convert unsigned big-endian byte arrays to integers.
+ tests3 = {
+ b'': 0,
+ b'\x00': 0,
+ b'\x01': 1,
+ b'\x7f': 127,
+ b'\x80': 128,
+ b'\xff': 255,
+ b'\x01\x00': 256,
+ b'\x7f\xff': 32767,
+ b'\x80\x00': 32768,
+ b'\xff\xff': 65535,
+ b'\x01\x00\x00': 65536,
+ }
+ check(tests3, 'big', signed=False)
+
+ # Convert integers to unsigned little-endian byte arrays.
+ tests4 = {
+ b'': 0,
+ b'\x00': 0,
+ b'\x01': 1,
+ b'\x7f': 127,
+ b'\x80': 128,
+ b'\xff': 255,
+ b'\x00\x01': 256,
+ b'\xff\x7f': 32767,
+ b'\x00\x80': 32768,
+ b'\xff\xff': 65535,
+ b'\x00\x00\x01': 65536,
+ }
+ check(tests4, 'little', signed=False)
+
+ class myint(int):
+ pass
+
+ self.assertTrue(type(myint.from_bytes(b'\x00', 'big')) is myint)
+ self.assertEqual(myint.from_bytes(b'\x01', 'big'), 1)
+ self.assertTrue(
+ type(myint.from_bytes(b'\x00', 'big', signed=False)) is myint)
+ self.assertEqual(myint.from_bytes(b'\x01', 'big', signed=False), 1)
+ self.assertTrue(type(myint.from_bytes(b'\x00', 'little')) is myint)
+ self.assertEqual(myint.from_bytes(b'\x01', 'little'), 1)
+ self.assertTrue(type(myint.from_bytes(
+ b'\x00', 'little', signed=False)) is myint)
+ self.assertEqual(myint.from_bytes(b'\x01', 'little', signed=False), 1)
+ self.assertEqual(
+ int.from_bytes([255, 0, 0], 'big', signed=True), -65536)
+ self.assertEqual(
+ int.from_bytes((255, 0, 0), 'big', signed=True), -65536)
+ self.assertEqual(int.from_bytes(
+ bytearray(b'\xff\x00\x00'), 'big', signed=True), -65536)
+ self.assertEqual(int.from_bytes(
+ bytearray(b'\xff\x00\x00'), 'big', signed=True), -65536)
+ self.assertEqual(int.from_bytes(
+ array.array('B', b'\xff\x00\x00'), 'big', signed=True), -65536)
+ self.assertEqual(int.from_bytes(
+ memoryview(b'\xff\x00\x00'), 'big', signed=True), -65536)
+ self.assertRaises(ValueError, int.from_bytes, [256], 'big')
+ self.assertRaises(ValueError, int.from_bytes, [0], 'big\x00')
+ self.assertRaises(ValueError, int.from_bytes, [0], 'little\x00')
+ self.assertRaises(TypeError, int.from_bytes, "", 'big')
+ self.assertRaises(TypeError, int.from_bytes, "\x00", 'big')
+ self.assertRaises(TypeError, int.from_bytes, 0, 'big')
+ self.assertRaises(TypeError, int.from_bytes, 0, 'big', True)
+ self.assertRaises(TypeError, myint.from_bytes, "", 'big')
+ self.assertRaises(TypeError, myint.from_bytes, "\x00", 'big')
+ self.assertRaises(TypeError, myint.from_bytes, 0, 'big')
+ self.assertRaises(TypeError, int.from_bytes, 0, 'big', True)
def test_main():
diff --git a/Lib/test/test_macpath.py b/Lib/test/test_macpath.py
index b5157bf6e9..d732e14a3a 100644
--- a/Lib/test/test_macpath.py
+++ b/Lib/test/test_macpath.py
@@ -1,5 +1,5 @@
import macpath
-from test import support
+from test import support, test_genericpath
import unittest
@@ -26,42 +26,25 @@ class MacPathTestCase(unittest.TestCase):
self.assertFalse(isabs(b":foo:bar"))
self.assertFalse(isabs(b":foo:bar:"))
-
- def test_commonprefix(self):
- commonprefix = macpath.commonprefix
- self.assertTrue(commonprefix(["home:swenson:spam", "home:swen:spam"])
- == "home:swen")
- self.assertTrue(commonprefix([":home:swen:spam", ":home:swen:eggs"])
- == ":home:swen:")
- self.assertTrue(commonprefix([":home:swen:spam", ":home:swen:spam"])
- == ":home:swen:spam")
-
- self.assertTrue(commonprefix([b"home:swenson:spam", b"home:swen:spam"])
- == b"home:swen")
- self.assertTrue(commonprefix([b":home:swen:spam", b":home:swen:eggs"])
- == b":home:swen:")
- self.assertTrue(commonprefix([b":home:swen:spam", b":home:swen:spam"])
- == b":home:swen:spam")
-
def test_split(self):
split = macpath.split
self.assertEqual(split("foo:bar"),
- ('foo:', 'bar'))
+ ('foo:', 'bar'))
self.assertEqual(split("conky:mountpoint:foo:bar"),
- ('conky:mountpoint:foo', 'bar'))
+ ('conky:mountpoint:foo', 'bar'))
self.assertEqual(split(":"), ('', ''))
self.assertEqual(split(":conky:mountpoint:"),
- (':conky:mountpoint', ''))
+ (':conky:mountpoint', ''))
self.assertEqual(split(b"foo:bar"),
- (b'foo:', b'bar'))
+ (b'foo:', b'bar'))
self.assertEqual(split(b"conky:mountpoint:foo:bar"),
- (b'conky:mountpoint:foo', b'bar'))
+ (b'conky:mountpoint:foo', b'bar'))
self.assertEqual(split(b":"), (b'', b''))
self.assertEqual(split(b":conky:mountpoint:"),
- (b':conky:mountpoint', b''))
+ (b':conky:mountpoint', b''))
def test_join(self):
join = macpath.join
@@ -77,14 +60,6 @@ class MacPathTestCase(unittest.TestCase):
self.assertEqual(join(b'a:b', b':c'), b'a:b:c')
self.assertEqual(join(b'a', b':b', b':c'), b':a:b:c')
- def test_splitdrive(self):
- splitdrive = macpath.splitdrive
- self.assertEqual(splitdrive("foo:bar"), ('', 'foo:bar'))
- self.assertEqual(splitdrive(":foo:bar"), ('', ':foo:bar'))
-
- self.assertEqual(splitdrive(b"foo:bar"), (b'', b'foo:bar'))
- self.assertEqual(splitdrive(b":foo:bar"), (b'', b':foo:bar'))
-
def test_splitext(self):
splitext = macpath.splitext
self.assertEqual(splitext(":foo.ext"), (':foo', '.ext'))
@@ -139,8 +114,13 @@ class MacPathTestCase(unittest.TestCase):
self.assertEqual(normpath(b"a:"), b"a:")
self.assertEqual(normpath(b"a:b:"), b"a:b")
+
+class MacCommonTest(test_genericpath.CommonTest):
+ pathmodule = macpath
+
+
def test_main():
- support.run_unittest(MacPathTestCase)
+ support.run_unittest(MacPathTestCase, MacCommonTest)
if __name__ == "__main__":
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 9be1332a33..8dc73262dd 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -7,8 +7,10 @@ import email
import email.message
import re
import io
+import tempfile
from test import support
import unittest
+import textwrap
import mailbox
import glob
try:
@@ -21,16 +23,16 @@ class TestBase(unittest.TestCase):
def _check_sample(self, msg):
# Inspect a mailbox.Message representation of the sample message
- self.assertTrue(isinstance(msg, email.message.Message))
- self.assertTrue(isinstance(msg, mailbox.Message))
+ self.assertIsInstance(msg, email.message.Message)
+ self.assertIsInstance(msg, mailbox.Message)
for key, value in _sample_headers.items():
self.assertIn(value, msg.get_all(key))
self.assertTrue(msg.is_multipart())
self.assertEqual(len(msg.get_payload()), len(_sample_payloads))
for i, payload in enumerate(_sample_payloads):
part = msg.get_payload(i)
- self.assertTrue(isinstance(part, email.message.Message))
- self.assertFalse(isinstance(part, mailbox.Message))
+ self.assertIsInstance(part, email.message.Message)
+ self.assertNotIsInstance(part, mailbox.Message)
self.assertEqual(part.get_payload(), payload)
def _delete_recursively(self, target):
@@ -48,6 +50,8 @@ class TestBase(unittest.TestCase):
class TestMailbox(TestBase):
+ maxDiff = None
+
_factory = None # Overridden by subclasses to reuse tests
_template = 'From: foo\n\n%s'
@@ -69,14 +73,124 @@ class TestMailbox(TestBase):
self.assertEqual(len(self._box), 2)
keys.append(self._box.add(email.message_from_string(_sample_message)))
self.assertEqual(len(self._box), 3)
- keys.append(self._box.add(io.StringIO(_sample_message)))
+ keys.append(self._box.add(io.BytesIO(_bytes_sample_message)))
self.assertEqual(len(self._box), 4)
keys.append(self._box.add(_sample_message))
self.assertEqual(len(self._box), 5)
+ keys.append(self._box.add(_bytes_sample_message))
+ self.assertEqual(len(self._box), 6)
+ with self.assertWarns(DeprecationWarning):
+ keys.append(self._box.add(
+ io.TextIOWrapper(io.BytesIO(_bytes_sample_message))))
+ self.assertEqual(len(self._box), 7)
self.assertEqual(self._box.get_string(keys[0]), self._template % 0)
- for i in (1, 2, 3, 4):
+ for i in (1, 2, 3, 4, 5, 6):
self._check_sample(self._box[keys[i]])
+ _nonascii_msg = textwrap.dedent("""\
+ From: foo
+ Subject: Falinaptár házhozszállítással. Már rendeltél?
+
+ 0
+ """)
+
+ def test_add_invalid_8bit_bytes_header(self):
+ key = self._box.add(self._nonascii_msg.encode('latin1'))
+ self.assertEqual(len(self._box), 1)
+ self.assertEqual(self._box.get_bytes(key),
+ self._nonascii_msg.encode('latin1'))
+
+ def test_invalid_nonascii_header_as_string(self):
+ subj = self._nonascii_msg.splitlines()[1]
+ key = self._box.add(subj.encode('latin1'))
+ self.assertEqual(self._box.get_string(key),
+ 'Subject: =?unknown-8bit?b?RmFsaW5hcHThciBo4Xpob3pzeuFsbO104XNz'
+ 'YWwuIE3hciByZW5kZWx06Ww/?=\n\n')
+
+ def test_add_nonascii_string_header_raises(self):
+ with self.assertRaisesRegex(ValueError, "ASCII-only"):
+ self._box.add(self._nonascii_msg)
+ self._box.flush()
+ self.assertEqual(len(self._box), 0)
+ self.assertMailboxEmpty()
+
+ def test_add_that_raises_leaves_mailbox_empty(self):
+ # XXX This test will start failing when Message learns to handle
+ # non-ASCII string headers, and a different internal failure will
+ # need to be found or manufactured.
+ with self.assertRaises(ValueError):
+ self._box.add(email.message_from_string("From: Alphöso"))
+ self.assertEqual(len(self._box), 0)
+ self._box.close()
+ self.assertMailboxEmpty()
+
+ _non_latin_bin_msg = textwrap.dedent("""\
+ From: foo@bar.com
+ To: báz
+ Subject: Maintenant je vous présente mon collègue, le pouf célèbre
+ \tJean de Baddie
+ Mime-Version: 1.0
+ Content-Type: text/plain; charset="utf-8"
+ Content-Transfer-Encoding: 8bit
+
+ Да, они летÑÑ‚.
+ """).encode('utf-8')
+
+ def test_add_8bit_body(self):
+ key = self._box.add(self._non_latin_bin_msg)
+ self.assertEqual(self._box.get_bytes(key),
+ self._non_latin_bin_msg)
+ with self._box.get_file(key) as f:
+ self.assertEqual(f.read(),
+ self._non_latin_bin_msg.replace(b'\n',
+ os.linesep.encode()))
+ self.assertEqual(self._box[key].get_payload(),
+ "Да, они летÑÑ‚.\n")
+
+ def test_add_binary_file(self):
+ with tempfile.TemporaryFile('wb+') as f:
+ f.write(_bytes_sample_message)
+ f.seek(0)
+ key = self._box.add(f)
+ # See issue 11062
+ if not isinstance(self._box, mailbox.Babyl):
+ self.assertEqual(self._box.get_bytes(key).split(b'\n'),
+ _bytes_sample_message.split(b'\n'))
+
+ def test_add_binary_nonascii_file(self):
+ with tempfile.TemporaryFile('wb+') as f:
+ f.write(self._non_latin_bin_msg)
+ f.seek(0)
+ key = self._box.add(f)
+ # See issue 11062
+ if not isinstance(self._box, mailbox.Babyl):
+ self.assertEqual(self._box.get_bytes(key).split(b'\n'),
+ self._non_latin_bin_msg.split(b'\n'))
+
+ def test_add_text_file_warns(self):
+ with tempfile.TemporaryFile('w+') as f:
+ f.write(_sample_message)
+ f.seek(0)
+ with self.assertWarns(DeprecationWarning):
+ key = self._box.add(f)
+ # See issue 11062
+ if not isinstance(self._box, mailbox.Babyl):
+ self.assertEqual(self._box.get_bytes(key).split(b'\n'),
+ _bytes_sample_message.split(b'\n'))
+
+ def test_add_StringIO_warns(self):
+ with self.assertWarns(DeprecationWarning):
+ key = self._box.add(io.StringIO(self._template % "0"))
+ self.assertEqual(self._box.get_string(key), self._template % "0")
+
+ def test_add_nonascii_StringIO_raises(self):
+ with self.assertWarns(DeprecationWarning):
+ with self.assertRaisesRegex(ValueError, "ASCII-only"):
+ self._box.add(io.StringIO(self._nonascii_msg))
+ self.assertEqual(len(self._box), 0)
+ self._box.close()
+ self.assertMailboxEmpty()
+
def test_remove(self):
# Remove messages using remove()
self._test_remove_or_delitem(self._box.remove)
@@ -149,27 +263,38 @@ class TestMailbox(TestBase):
key0 = self._box.add(self._template % 0)
key1 = self._box.add(_sample_message)
msg0 = self._box.get_message(key0)
- self.assertTrue(isinstance(msg0, mailbox.Message))
+ self.assertIsInstance(msg0, mailbox.Message)
self.assertEqual(msg0['from'], 'foo')
self.assertEqual(msg0.get_payload(), '0')
self._check_sample(self._box.get_message(key1))
+ def test_get_bytes(self):
+ # Get bytes representations of messages
+ key0 = self._box.add(self._template % 0)
+ key1 = self._box.add(_sample_message)
+ self.assertEqual(self._box.get_bytes(key0),
+ (self._template % 0).encode('ascii'))
+ self.assertEqual(self._box.get_bytes(key1), _bytes_sample_message)
+
def test_get_string(self):
# Get string representations of messages
key0 = self._box.add(self._template % 0)
key1 = self._box.add(_sample_message)
self.assertEqual(self._box.get_string(key0), self._template % 0)
- self.assertEqual(self._box.get_string(key1), _sample_message)
+ self.assertEqual(self._box.get_string(key1).split('\n'),
+ _sample_message.split('\n'))
def test_get_file(self):
# Get file representations of messages
key0 = self._box.add(self._template % 0)
key1 = self._box.add(_sample_message)
- data0 = self._box.get_file(key0).read()
- data1 = self._box.get_file(key1).read()
- self.assertEqual(data0.replace(os.linesep, '\n'),
+ with self._box.get_file(key0) as file:
+ data0 = file.read()
+ with self._box.get_file(key1) as file:
+ data1 = file.read()
+ self.assertEqual(data0.decode('ascii').replace(os.linesep, '\n'),
self._template % 0)
- self.assertEqual(data1.replace(os.linesep, '\n'),
+ self.assertEqual(data1.decode('ascii').replace(os.linesep, '\n'),
_sample_message)
def test_iterkeys(self):
@@ -403,11 +528,12 @@ class TestMailbox(TestBase):
def test_dump_message(self):
# Write message representations to disk
for input in (email.message_from_string(_sample_message),
- _sample_message, io.StringIO(_sample_message)):
- output = io.StringIO()
+ _sample_message, io.BytesIO(_bytes_sample_message)):
+ output = io.BytesIO()
self._box._dump_message(input, output)
- self.assertEqual(output.getvalue(), _sample_message)
- output = io.StringIO()
+ self.assertEqual(output.getvalue(),
+ _bytes_sample_message.replace(b'\n', os.linesep.encode()))
+ output = io.BytesIO()
self.assertRaises(TypeError,
lambda: self._box._dump_message(None, output))
@@ -437,6 +563,7 @@ class TestMailboxSuperclass(TestBase):
self.assertRaises(NotImplementedError, lambda: box.__getitem__(''))
self.assertRaises(NotImplementedError, lambda: box.get_message(''))
self.assertRaises(NotImplementedError, lambda: box.get_string(''))
+ self.assertRaises(NotImplementedError, lambda: box.get_bytes(''))
self.assertRaises(NotImplementedError, lambda: box.get_file(''))
self.assertRaises(NotImplementedError, lambda: '' in box)
self.assertRaises(NotImplementedError, lambda: box.__contains__(''))
@@ -460,6 +587,9 @@ class TestMaildir(TestMailbox):
if os.name in ('nt', 'os2') or sys.platform == 'cygwin':
self._box.colon = '!'
+ def assertMailboxEmpty(self):
+ self.assertEqual(os.listdir(os.path.join(self._path, 'tmp')), [])
+
def test_add_MM(self):
# Add a MaildirMessage instance
msg = mailbox.MaildirMessage(self._template % 0)
@@ -476,7 +606,7 @@ class TestMaildir(TestMailbox):
msg.set_flags('RF')
key = self._box.add(msg)
msg_returned = self._box.get_message(key)
- self.assertTrue(isinstance(msg_returned, mailbox.MaildirMessage))
+ self.assertIsInstance(msg_returned, mailbox.MaildirMessage)
self.assertEqual(msg_returned.get_subdir(), 'cur')
self.assertEqual(msg_returned.get_flags(), 'FR')
@@ -516,7 +646,7 @@ class TestMaildir(TestMailbox):
box = mailbox.Maildir(self._path, factory=FakeMessage)
box.colon = self._box.colon
msg2 = box.get_message(key)
- self.assertTrue(isinstance(msg2, FakeMessage))
+ self.assertIsInstance(msg2, FakeMessage)
def test_initialize_new(self):
# Initialize a non-existent mailbox
@@ -586,12 +716,10 @@ class TestMaildir(TestMailbox):
# Remove old files from 'tmp'
foo_path = os.path.join(self._path, 'tmp', 'foo')
bar_path = os.path.join(self._path, 'tmp', 'bar')
- f = open(foo_path, 'w')
- f.write("@")
- f.close()
- f = open(bar_path, 'w')
- f.write("@")
- f.close()
+ with open(foo_path, 'w') as f:
+ f.write("@")
+ with open(bar_path, 'w') as f:
+ f.write("@")
self._box.clean()
self.assertTrue(os.path.exists(foo_path))
self.assertTrue(os.path.exists(bar_path))
@@ -640,9 +768,9 @@ class TestMaildir(TestMailbox):
"Host name mismatch: '%s' should be '%s'" %
(groups[4], hostname))
previous_groups = groups
- tmp_file.write(_sample_message)
+ tmp_file.write(_bytes_sample_message)
tmp_file.seek(0)
- self.assertEqual(tmp_file.read(), _sample_message)
+ self.assertEqual(tmp_file.read(), _bytes_sample_message)
tmp_file.close()
file_count = len(os.listdir(os.path.join(self._path, "tmp")))
self.assertEqual(file_count, repetitions,
@@ -776,17 +904,28 @@ class TestMaildir(TestMailbox):
class _TestMboxMMDF(TestMailbox):
def tearDown(self):
+ super().tearDown()
self._box.close()
self._delete_recursively(self._path)
for lock_remnant in glob.glob(self._path + '.*'):
support.unlink(lock_remnant)
+ def assertMailboxEmpty(self):
+ with open(self._path) as f:
+ self.assertEqual(f.readlines(), [])
+
def test_add_from_string(self):
# Add a string starting with 'From ' to the mailbox
key = self._box.add('From foo@bar blah\nFrom: foo\n\n0')
self.assertEqual(self._box[key].get_from(), 'foo@bar blah')
self.assertEqual(self._box[key].get_payload(), '0')
+ def test_add_from_bytes(self):
+ # Add a byte string starting with 'From ' to the mailbox
+ key = self._box.add(b'From foo@bar blah\nFrom: foo\n\n0')
+ self.assertEqual(self._box[key].get_from(), 'foo@bar blah')
+ self.assertEqual(self._box[key].get_payload(), '0')
+
def test_add_mbox_or_mmdf_message(self):
# Add an mboxMessage or MMDFMessage
for class_ in (mailbox.mboxMessage, mailbox.MMDFMessage):
@@ -817,7 +956,8 @@ class _TestMboxMMDF(TestMailbox):
self._box._file.seek(0)
contents = self._box._file.read()
self._box.close()
- self.assertEqual(contents, open(self._path, 'r', newline='').read())
+ with open(self._path, 'rb') as f:
+ self.assertEqual(contents, f.read())
self._box = self._factory(self._path)
def test_lock_conflict(self):
@@ -896,6 +1036,9 @@ class TestMH(TestMailbox):
_factory = lambda self, path, factory=None: mailbox.MH(path, factory)
+ def assertMailboxEmpty(self):
+ self.assertEqual(os.listdir(self._path), ['.mh_sequences'])
+
def test_list_folders(self):
# List folders
self._box.add_folder('one')
@@ -969,6 +1112,13 @@ class TestMH(TestMailbox):
key0 = self._box.add(msg0)
refmsg0 = self._box.get_message(key0)
+ def test_issue7627(self):
+ msg0 = mailbox.MHMessage(self._template % 0)
+ key0 = self._box.add(msg0)
+ self._box.lock()
+ self._box.remove(key0)
+ self._box.unlock()
+
def test_pack(self):
# Pack the contents of the mailbox
msg0 = mailbox.MHMessage(self._template % 0)
@@ -1021,7 +1171,12 @@ class TestBabyl(TestMailbox):
_factory = lambda self, path, factory=None: mailbox.Babyl(path, factory)
+ def assertMailboxEmpty(self):
+ with open(self._path) as f:
+ self.assertEqual(f.readlines(), [])
+
def tearDown(self):
+ super().tearDown()
self._box.close()
self._delete_recursively(self._path)
for lock_remnant in glob.glob(self._path + '.*'):
@@ -1071,21 +1226,29 @@ class TestMessage(TestBase):
def test_initialize_with_file(self):
# Initialize based on contents of file
- f = open(self._path, 'w+')
- f.write(_sample_message)
- f.seek(0)
- msg = self._factory(f)
- self._post_initialize_hook(msg)
- self._check_sample(msg)
- f.close()
+ with open(self._path, 'w+') as f:
+ f.write(_sample_message)
+ f.seek(0)
+ msg = self._factory(f)
+ self._post_initialize_hook(msg)
+ self._check_sample(msg)
+
+ def test_initialize_with_binary_file(self):
+ # Initialize based on contents of binary file
+ with open(self._path, 'wb+') as f:
+ f.write(_bytes_sample_message)
+ f.seek(0)
+ msg = self._factory(f)
+ self._post_initialize_hook(msg)
+ self._check_sample(msg)
def test_initialize_with_nothing(self):
# Initialize without arguments
msg = self._factory()
self._post_initialize_hook(msg)
- self.assertTrue(isinstance(msg, email.message.Message))
- self.assertTrue(isinstance(msg, mailbox.Message))
- self.assertTrue(isinstance(msg, self._factory))
+ self.assertIsInstance(msg, email.message.Message)
+ self.assertIsInstance(msg, mailbox.Message)
+ self.assertIsInstance(msg, self._factory)
self.assertEqual(msg.keys(), [])
self.assertFalse(msg.is_multipart())
self.assertEqual(msg.get_payload(), None)
@@ -1355,6 +1518,14 @@ class TestMessageConversion(TestBase):
msg_plain = mailbox.Message(msg)
self._check_sample(msg_plain)
+ def test_x_from_bytes(self):
+ # Convert all formats to Message
+ for class_ in (mailbox.Message, mailbox.MaildirMessage,
+ mailbox.mboxMessage, mailbox.MHMessage,
+ mailbox.BabylMessage, mailbox.MMDFMessage):
+ msg = class_(_bytes_sample_message)
+ self._check_sample(msg)
+
def test_x_to_invalid(self):
# Convert all formats to an invalid format
for class_ in (mailbox.Message, mailbox.MaildirMessage,
@@ -1801,18 +1972,16 @@ class MaildirTestCase(unittest.TestCase):
filename = ".".join((str(t), str(pid), "myhostname", "mydomain"))
tmpname = os.path.join(self._dir, "tmp", filename)
newname = os.path.join(self._dir, dir, filename)
- fp = open(tmpname, "w")
- self._msgfiles.append(tmpname)
- if mbox:
- fp.write(FROM_)
- fp.write(DUMMY_MESSAGE)
- fp.close()
+ with open(tmpname, "w") as fp:
+ self._msgfiles.append(tmpname)
+ if mbox:
+ fp.write(FROM_)
+ fp.write(DUMMY_MESSAGE)
if hasattr(os, "link"):
os.link(tmpname, newname)
else:
- fp = open(newname, "w")
- fp.write(DUMMY_MESSAGE)
- fp.close()
+ with open(newname, "w") as fp:
+ fp.write(DUMMY_MESSAGE)
self._msgfiles.append(newname)
return tmpname
@@ -1902,6 +2071,8 @@ H4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs
--NMuMz9nt05w80d4+--
"""
+_bytes_sample_message = _sample_message.encode('ascii')
+
_sample_headers = {
"Return-Path":"<gkj@gregorykjohnson.com>",
"X-Original-To":"gkj+person@localhost",
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index 5e1cdd5052..81cf598402 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from test import support
import marshal
@@ -11,16 +11,10 @@ class HelperMixin:
new = marshal.loads(marshal.dumps(sample, *extra))
self.assertEqual(sample, new)
try:
- f = open(support.TESTFN, "wb")
- try:
+ with open(support.TESTFN, "wb") as f:
marshal.dump(sample, f, *extra)
- finally:
- f.close()
- f = open(support.TESTFN, "rb")
- try:
+ with open(support.TESTFN, "rb") as f:
new = marshal.load(f)
- finally:
- f.close()
self.assertEqual(sample, new)
finally:
support.unlink(support.TESTFN)
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index 9a87d5d307..dddc889375 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -1,12 +1,14 @@
# Python test set -- math module
# XXXX Should not do tests around zero only
-from test.support import run_unittest, verbose
+from test.support import run_unittest, verbose, requires_IEEE_754
import unittest
import math
import os
import sys
import random
+import struct
+import sysconfig
eps = 1E-05
NAN = float('nan')
@@ -24,8 +26,130 @@ if __name__ == '__main__':
else:
file = __file__
test_dir = os.path.dirname(file) or os.curdir
+math_testcases = os.path.join(test_dir, 'math_testcases.txt')
test_file = os.path.join(test_dir, 'cmath_testcases.txt')
+def to_ulps(x):
+ """Convert a non-NaN float x to an integer, in such a way that
+ adjacent floats are converted to adjacent integers. Then
+ abs(ulps(x) - ulps(y)) gives the difference in ulps between two
+ floats.
+
+ The results from this function will only make sense on platforms
+ where C doubles are represented in IEEE 754 binary64 format.
+
+ """
+ n = struct.unpack('<q', struct.pack('<d', x))[0]
+ if n < 0:
+ n = ~(n+2**63)
+ return n
+
+def ulps_check(expected, got, ulps=20):
+ """Given non-NaN floats `expected` and `got`,
+ check that they're equal to within the given number of ulps.
+
+ Returns None on success and an error message on failure."""
+
+ ulps_error = to_ulps(got) - to_ulps(expected)
+ if abs(ulps_error) <= ulps:
+ return None
+ return "error = {} ulps; permitted error = {} ulps".format(ulps_error,
+ ulps)
+
+# Here's a pure Python version of the math.factorial algorithm, for
+# documentation and comparison purposes.
+#
+# Formula:
+#
+# factorial(n) = factorial_odd_part(n) << (n - count_set_bits(n))
+#
+# where
+#
+# factorial_odd_part(n) = product_{i >= 0} product_{0 < j <= n >> i; j odd} j
+#
+# The outer product above is an infinite product, but once i >= n.bit_length,
+# (n >> i) < 1 and the corresponding term of the product is empty. So only the
+# finitely many terms for 0 <= i < n.bit_length() contribute anything.
+#
+# We iterate downwards from i == n.bit_length() - 1 to i == 0. The inner
+# product in the formula above starts at 1 for i == n.bit_length(); for each i
+# < n.bit_length() we get the inner product for i from that for i + 1 by
+# multiplying by all j in {n >> i+1 < j <= n >> i; j odd}. In Python terms,
+# this set is range((n >> i+1) + 1 | 1, (n >> i) + 1 | 1, 2).
+
+def count_set_bits(n):
+ """Number of '1' bits in binary expansion of a nonnnegative integer."""
+ return 1 + count_set_bits(n & n - 1) if n else 0
+
+def partial_product(start, stop):
+ """Product of integers in range(start, stop, 2), computed recursively.
+ start and stop should both be odd, with start <= stop.
+
+ """
+ numfactors = (stop - start) >> 1
+ if not numfactors:
+ return 1
+ elif numfactors == 1:
+ return start
+ else:
+ mid = (start + numfactors) | 1
+ return partial_product(start, mid) * partial_product(mid, stop)
+
+def py_factorial(n):
+ """Factorial of nonnegative integer n, via "Binary Split Factorial Formula"
+ described at http://www.luschny.de/math/factorial/binarysplitfact.html
+
+ """
+ inner = outer = 1
+ for i in reversed(range(n.bit_length())):
+ inner *= partial_product((n >> i + 1) + 1 | 1, (n >> i) + 1 | 1)
+ outer *= inner
+ return outer << (n - count_set_bits(n))
+
+def acc_check(expected, got, rel_err=2e-15, abs_err = 5e-323):
+ """Determine whether non-NaN floats a and b are equal to within a
+ (small) rounding error. The default values for rel_err and
+ abs_err are chosen to be suitable for platforms where a float is
+ represented by an IEEE 754 double. They allow an error of between
+ 9 and 19 ulps."""
+
+ # need to special case infinities, since inf - inf gives nan
+ if math.isinf(expected) and got == expected:
+ return None
+
+ error = got - expected
+
+ permitted_error = max(abs_err, rel_err * abs(expected))
+ if abs(error) < permitted_error:
+ return None
+ return "error = {}; permitted error = {}".format(error,
+ permitted_error)
+
+def parse_mtestfile(fname):
+ """Parse a file with test values
+
+ -- starts a comment
+ blank lines, or lines containing only a comment, are ignored
+ other lines are expected to have the form
+ id fn arg -> expected [flag]*
+
+ """
+ with open(fname) as fp:
+ for line in fp:
+ # strip comments, and skip blank lines
+ if '--' in line:
+ line = line[:line.index('--')]
+ if not line.strip():
+ continue
+
+ lhs, rhs = line.split('->')
+ id, fn, arg = lhs.split()
+ rhs_pieces = rhs.split()
+ exp = rhs_pieces[0]
+ flags = rhs_pieces[1:]
+
+ yield (id, fn, float(arg), float(exp), flags)
+
def parse_testfile(fname):
"""Parse a file with test values
@@ -209,39 +333,39 @@ class MathTests(unittest.TestCase):
self.assertRaises(TypeError, math.ceil, t)
self.assertRaises(TypeError, math.ceil, t, 0)
- if float.__getformat__("double").startswith("IEEE"):
- def testCopysign(self):
- self.assertEqual(math.copysign(1, 42), 1.0)
- self.assertEqual(math.copysign(0., 42), 0.0)
- self.assertEqual(math.copysign(1., -42), -1.0)
- self.assertEqual(math.copysign(3, 0.), 3.0)
- self.assertEqual(math.copysign(4., -0.), -4.0)
-
- self.assertRaises(TypeError, math.copysign)
- # copysign should let us distinguish signs of zeros
- self.assertEqual(math.copysign(1., 0.), 1.)
- self.assertEqual(math.copysign(1., -0.), -1.)
- self.assertEqual(math.copysign(INF, 0.), INF)
- self.assertEqual(math.copysign(INF, -0.), NINF)
- self.assertEqual(math.copysign(NINF, 0.), INF)
- self.assertEqual(math.copysign(NINF, -0.), NINF)
- # and of infinities
- self.assertEqual(math.copysign(1., INF), 1.)
- self.assertEqual(math.copysign(1., NINF), -1.)
- self.assertEqual(math.copysign(INF, INF), INF)
- self.assertEqual(math.copysign(INF, NINF), NINF)
- self.assertEqual(math.copysign(NINF, INF), INF)
- self.assertEqual(math.copysign(NINF, NINF), NINF)
- self.assertTrue(math.isnan(math.copysign(NAN, 1.)))
- self.assertTrue(math.isnan(math.copysign(NAN, INF)))
- self.assertTrue(math.isnan(math.copysign(NAN, NINF)))
- self.assertTrue(math.isnan(math.copysign(NAN, NAN)))
- # copysign(INF, NAN) may be INF or it may be NINF, since
- # we don't know whether the sign bit of NAN is set on any
- # given platform.
- self.assertTrue(math.isinf(math.copysign(INF, NAN)))
- # similarly, copysign(2., NAN) could be 2. or -2.
- self.assertEqual(abs(math.copysign(2., NAN)), 2.)
+ @requires_IEEE_754
+ def testCopysign(self):
+ self.assertEqual(math.copysign(1, 42), 1.0)
+ self.assertEqual(math.copysign(0., 42), 0.0)
+ self.assertEqual(math.copysign(1., -42), -1.0)
+ self.assertEqual(math.copysign(3, 0.), 3.0)
+ self.assertEqual(math.copysign(4., -0.), -4.0)
+
+ self.assertRaises(TypeError, math.copysign)
+ # copysign should let us distinguish signs of zeros
+ self.assertEqual(math.copysign(1., 0.), 1.)
+ self.assertEqual(math.copysign(1., -0.), -1.)
+ self.assertEqual(math.copysign(INF, 0.), INF)
+ self.assertEqual(math.copysign(INF, -0.), NINF)
+ self.assertEqual(math.copysign(NINF, 0.), INF)
+ self.assertEqual(math.copysign(NINF, -0.), NINF)
+ # and of infinities
+ self.assertEqual(math.copysign(1., INF), 1.)
+ self.assertEqual(math.copysign(1., NINF), -1.)
+ self.assertEqual(math.copysign(INF, INF), INF)
+ self.assertEqual(math.copysign(INF, NINF), NINF)
+ self.assertEqual(math.copysign(NINF, INF), INF)
+ self.assertEqual(math.copysign(NINF, NINF), NINF)
+ self.assertTrue(math.isnan(math.copysign(NAN, 1.)))
+ self.assertTrue(math.isnan(math.copysign(NAN, INF)))
+ self.assertTrue(math.isnan(math.copysign(NAN, NINF)))
+ self.assertTrue(math.isnan(math.copysign(NAN, NAN)))
+ # copysign(INF, NAN) may be INF or it may be NINF, since
+ # we don't know whether the sign bit of NAN is set on any
+ # given platform.
+ self.assertTrue(math.isinf(math.copysign(INF, NAN)))
+ # similarly, copysign(2., NAN) could be 2. or -2.
+ self.assertEqual(abs(math.copysign(2., NAN)), 2.)
def testCos(self):
self.assertRaises(TypeError, math.cos)
@@ -287,18 +411,19 @@ class MathTests(unittest.TestCase):
self.ftest('fabs(1)', math.fabs(1), 1)
def testFactorial(self):
- def fact(n):
- result = 1
- for i in range(1, int(n)+1):
- result *= i
- return result
- values = list(range(10)) + [50, 100, 500]
- random.shuffle(values)
- for x in values:
- for cast in (int, float):
- self.assertEqual(math.factorial(cast(x)), fact(x), (x, fact(x), math.factorial(x)))
+ self.assertEqual(math.factorial(0), 1)
+ self.assertEqual(math.factorial(0.0), 1)
+ total = 1
+ for i in range(1, 1000):
+ total *= i
+ self.assertEqual(math.factorial(i), total)
+ self.assertEqual(math.factorial(float(i)), total)
+ self.assertEqual(math.factorial(i), py_factorial(i))
self.assertRaises(ValueError, math.factorial, -1)
+ self.assertRaises(ValueError, math.factorial, -1.0)
self.assertRaises(ValueError, math.factorial, math.pi)
+ self.assertRaises(OverflowError, math.factorial, sys.maxsize+1)
+ self.assertRaises(OverflowError, math.factorial, 10e100)
def testFloor(self):
self.assertRaises(TypeError, math.floor)
@@ -370,8 +495,7 @@ class MathTests(unittest.TestCase):
self.assertEqual(math.frexp(NINF)[0], NINF)
self.assertTrue(math.isnan(math.frexp(NAN)[0]))
- @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
- "test requires IEEE 754 doubles")
+ @requires_IEEE_754
@unittest.skipIf(HAVE_DOUBLE_ROUNDING,
"fsum is not exact on machines with double rounding")
def testFsum(self):
@@ -513,21 +637,17 @@ class MathTests(unittest.TestCase):
self.ftest('log(32,2)', math.log(32,2), 5)
self.ftest('log(10**40, 10)', math.log(10**40, 10), 40)
self.ftest('log(10**40, 10**20)', math.log(10**40, 10**20), 2)
- self.assertEqual(math.log(INF), INF)
+ self.ftest('log(10**1000)', math.log(10**1000),
+ 2302.5850929940457)
+ self.assertRaises(ValueError, math.log, -1.5)
+ self.assertRaises(ValueError, math.log, -10**1000)
self.assertRaises(ValueError, math.log, NINF)
+ self.assertEqual(math.log(INF), INF)
self.assertTrue(math.isnan(math.log(NAN)))
def testLog1p(self):
self.assertRaises(TypeError, math.log1p)
- self.ftest('log1p(1/e -1)', math.log1p(1/math.e-1), -1)
- self.ftest('log1p(0)', math.log1p(0), 0)
- self.ftest('log1p(e-1)', math.log1p(math.e-1), 1)
- self.ftest('log1p(1)', math.log1p(1), math.log(2))
- self.assertEqual(math.log1p(INF), INF)
- self.assertRaises(ValueError, math.log1p, NINF)
- self.assertTrue(math.isnan(math.log1p(NAN)))
n= 2**90
- self.assertAlmostEqual(math.log1p(n), 62.383246250395075)
self.assertAlmostEqual(math.log1p(n), math.log1p(float(n)))
def testLog10(self):
@@ -535,8 +655,11 @@ class MathTests(unittest.TestCase):
self.ftest('log10(0.1)', math.log10(0.1), -1)
self.ftest('log10(1)', math.log10(1), 0)
self.ftest('log10(10)', math.log10(10), 1)
- self.assertEqual(math.log(INF), INF)
+ self.ftest('log10(10**1000)', math.log10(10**1000), 1000.0)
+ self.assertRaises(ValueError, math.log10, -1.5)
+ self.assertRaises(ValueError, math.log10, -10**1000)
self.assertRaises(ValueError, math.log10, NINF)
+ self.assertEqual(math.log(INF), INF)
self.assertTrue(math.isnan(math.log10(NAN)))
def testModf(self):
@@ -764,11 +887,15 @@ class MathTests(unittest.TestCase):
self.ftest('tanh(inf)', math.tanh(INF), 1)
self.ftest('tanh(-inf)', math.tanh(NINF), -1)
self.assertTrue(math.isnan(math.tanh(NAN)))
+
+ @requires_IEEE_754
+ @unittest.skipIf(sysconfig.get_config_var('TANH_PRESERVES_ZERO_SIGN') == 0,
+ "system tanh() function doesn't copy the sign")
+ def testTanhSign(self):
# check that tanh(-0.) == -0. on IEEE 754 systems
- if float.__getformat__("double").startswith("IEEE"):
- self.assertEqual(math.tanh(-0.), -0.)
- self.assertEqual(math.copysign(1., math.tanh(-0.)),
- math.copysign(1., -0.))
+ self.assertEqual(math.tanh(-0.), -0.)
+ self.assertEqual(math.copysign(1., math.tanh(-0.)),
+ math.copysign(1., -0.))
def test_trunc(self):
self.assertEqual(math.trunc(1), 1)
@@ -795,12 +922,14 @@ class MathTests(unittest.TestCase):
self.assertRaises(TypeError, math.trunc, 1, 2)
self.assertRaises(TypeError, math.trunc, TestNoTrunc())
- # XXX Doesn't work because the method is looked up on
- # the type only.
- #t = TestNoTrunc()
- #t.__trunc__ = lambda *args: args
- #self.assertEqual((), math.trunc(t))
- #self.assertRaises(TypeError, math.trunc, t, 0)
+ def testIsfinite(self):
+ self.assertTrue(math.isfinite(0.0))
+ self.assertTrue(math.isfinite(-0.0))
+ self.assertTrue(math.isfinite(1.0))
+ self.assertTrue(math.isfinite(-1.0))
+ self.assertFalse(math.isfinite(float("nan")))
+ self.assertFalse(math.isfinite(float("inf")))
+ self.assertFalse(math.isfinite(float("-inf")))
def testIsnan(self):
self.assertTrue(math.isnan(float("nan")))
@@ -856,9 +985,8 @@ class MathTests(unittest.TestCase):
else:
self.fail("sqrt(-1) didn't raise ValueError")
+ @requires_IEEE_754
def test_testfile(self):
- if not float.__getformat__("double").startswith("IEEE"):
- return
for id, fn, ar, ai, er, ei, flags in parse_testfile(test_file):
# Skip if either the input or result is complex, or if
# flags is nonempty
@@ -880,6 +1008,68 @@ class MathTests(unittest.TestCase):
self.fail(message)
self.ftest("%s:%s(%r)" % (id, fn, ar), result, er)
+ @requires_IEEE_754
+ def test_mtestfile(self):
+ ALLOWED_ERROR = 20 # permitted error, in ulps
+ fail_fmt = "{}:{}({!r}): expected {!r}, got {!r}"
+
+ failures = []
+ for id, fn, arg, expected, flags in parse_mtestfile(math_testcases):
+ func = getattr(math, fn)
+
+ if 'invalid' in flags or 'divide-by-zero' in flags:
+ expected = 'ValueError'
+ elif 'overflow' in flags:
+ expected = 'OverflowError'
+
+ try:
+ got = func(arg)
+ except ValueError:
+ got = 'ValueError'
+ except OverflowError:
+ got = 'OverflowError'
+
+ accuracy_failure = None
+ if isinstance(got, float) and isinstance(expected, float):
+ if math.isnan(expected) and math.isnan(got):
+ continue
+ if not math.isnan(expected) and not math.isnan(got):
+ if fn == 'lgamma':
+ # we use a weaker accuracy test for lgamma;
+ # lgamma only achieves an absolute error of
+ # a few multiples of the machine accuracy, in
+ # general.
+ accuracy_failure = acc_check(expected, got,
+ rel_err = 5e-15,
+ abs_err = 5e-15)
+ elif fn == 'erfc':
+ # erfc has less-than-ideal accuracy for large
+ # arguments (x ~ 25 or so), mainly due to the
+ # error involved in computing exp(-x*x).
+ #
+ # XXX Would be better to weaken this test only
+ # for large x, instead of for all x.
+ accuracy_failure = ulps_check(expected, got, 2000)
+
+ else:
+ accuracy_failure = ulps_check(expected, got, 20)
+ if accuracy_failure is None:
+ continue
+
+ if isinstance(got, str) and isinstance(expected, str):
+ if got == expected:
+ continue
+
+ fail_msg = fail_fmt.format(id, fn, arg, expected, got)
+ if accuracy_failure is not None:
+ fail_msg += ' ({})'.format(accuracy_failure)
+ failures.append(fail_msg)
+
+ if failures:
+ self.fail('Failures in test_mtestfile:\n ' +
+ '\n '.join(failures))
+
+
def test_main():
from doctest import DocFileSuite
suite = unittest.TestSuite()
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index b45845d6bf..49ca44f102 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -8,7 +8,7 @@ from test import support
import io
import _pyio as pyio
-import sys
+import pickle
class MemorySeekTestMixin:
@@ -347,8 +347,68 @@ class MemoryTestMixin:
memio = self.ioclass()
memio.foo = 1
-
-class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
+ def test_pickling(self):
+ buf = self.buftype("1234567890")
+ memio = self.ioclass(buf)
+ memio.foo = 42
+ memio.seek(2)
+
+ class PickleTestMemIO(self.ioclass):
+ def __init__(me, initvalue, foo):
+ self.ioclass.__init__(me, initvalue)
+ me.foo = foo
+ # __getnewargs__ is undefined on purpose. This checks that PEP 307
+ # is used to provide pickling support.
+
+ # Pickle expects the class to be on the module level. Here we use a
+ # little hack to allow the PickleTestMemIO class to derive from
+ # self.ioclass without having to define all combinations explictly on
+ # the module-level.
+ import __main__
+ PickleTestMemIO.__module__ = '__main__'
+ __main__.PickleTestMemIO = PickleTestMemIO
+ submemio = PickleTestMemIO(buf, 80)
+ submemio.seek(2)
+
+ # We only support pickle protocol 2 and onward since we use extended
+ # __reduce__ API of PEP 307 to provide pickling support.
+ for proto in range(2, pickle.HIGHEST_PROTOCOL):
+ for obj in (memio, submemio):
+ obj2 = pickle.loads(pickle.dumps(obj, protocol=proto))
+ self.assertEqual(obj.getvalue(), obj2.getvalue())
+ self.assertEqual(obj.__class__, obj2.__class__)
+ self.assertEqual(obj.foo, obj2.foo)
+ self.assertEqual(obj.tell(), obj2.tell())
+ obj.close()
+ self.assertRaises(ValueError, pickle.dumps, obj, proto)
+ del __main__.PickleTestMemIO
+
+
+class BytesIOMixin:
+
+ def test_getbuffer(self):
+ memio = self.ioclass(b"1234567890")
+ buf = memio.getbuffer()
+ self.assertEqual(bytes(buf), b"1234567890")
+ memio.seek(5)
+ buf = memio.getbuffer()
+ self.assertEqual(bytes(buf), b"1234567890")
+ # Trying to change the size of the BytesIO while a buffer is exported
+ # raises a BufferError.
+ self.assertRaises(BufferError, memio.write, b'x' * 100)
+ self.assertRaises(BufferError, memio.truncate)
+ # Mutating the buffer updates the BytesIO
+ buf[3:6] = b"abc"
+ self.assertEqual(bytes(buf), b"123abc7890")
+ self.assertEqual(memio.getvalue(), b"123abc7890")
+ # After the buffer gets released, we can resize the BytesIO again
+ del buf
+ support.gc_collect()
+ memio.truncate()
+
+
+class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin,
+ BytesIOMixin, unittest.TestCase):
UnsupportedOperation = pyio.UnsupportedOperation
@@ -389,7 +449,7 @@ class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
a = array.array('b', b"hello world")
memio = self.ioclass(buf)
memio.readinto(a)
- self.assertEqual(a.tostring(), b"1234567890d")
+ self.assertEqual(a.tobytes(), b"1234567890d")
memio.close()
self.assertRaises(ValueError, memio.readinto, b)
memio = self.ioclass(b"123")
@@ -435,13 +495,8 @@ class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
self.ioclass(initial_bytes=buf)
self.assertRaises(TypeError, self.ioclass, buf, foo=None)
-class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
- buftype = str
- ioclass = pyio.StringIO
- UnsupportedOperation = pyio.UnsupportedOperation
- EOF = ""
- # TextIO-specific behaviour.
+class TextIOTestMixin:
def test_newlines_property(self):
memio = self.ioclass(newline=None)
@@ -523,7 +578,6 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
def test_newline_cr(self):
# newline="\r"
memio = self.ioclass("a\nb\r\nc\rd", newline="\r")
- memio.seek(0)
self.assertEqual(memio.read(), "a\rb\r\rc\rd")
memio.seek(0)
self.assertEqual(list(memio), ["a\r", "b\r", "\r", "c\r", "d"])
@@ -531,7 +585,6 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
def test_newline_crlf(self):
# newline="\r\n"
memio = self.ioclass("a\nb\r\nc\rd", newline="\r\n")
- memio.seek(0)
self.assertEqual(memio.read(), "a\r\nb\r\r\nc\rd")
memio.seek(0)
self.assertEqual(list(memio), ["a\r\n", "b\r\r\n", "c\rd"])
@@ -549,10 +602,59 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
self.ioclass(newline=newline)
+class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin,
+ TextIOTestMixin, unittest.TestCase):
+ buftype = str
+ ioclass = pyio.StringIO
+ UnsupportedOperation = pyio.UnsupportedOperation
+ EOF = ""
+
+
+class PyStringIOPickleTest(TextIOTestMixin, unittest.TestCase):
+ """Test if pickle restores properly the internal state of StringIO.
+ """
+ buftype = str
+ UnsupportedOperation = pyio.UnsupportedOperation
+ EOF = ""
+
+ class ioclass(pyio.StringIO):
+ def __new__(cls, *args, **kwargs):
+ return pickle.loads(pickle.dumps(pyio.StringIO(*args, **kwargs)))
+ def __init__(self, *args, **kwargs):
+ pass
+
+
class CBytesIOTest(PyBytesIOTest):
ioclass = io.BytesIO
UnsupportedOperation = io.UnsupportedOperation
+ def test_getstate(self):
+ memio = self.ioclass()
+ state = memio.__getstate__()
+ self.assertEqual(len(state), 3)
+ bytearray(state[0]) # Check if state[0] supports the buffer interface.
+ self.assertIsInstance(state[1], int)
+ self.assertTrue(isinstance(state[2], dict) or state[2] is None)
+ memio.close()
+ self.assertRaises(ValueError, memio.__getstate__)
+
+ def test_setstate(self):
+ # This checks whether __setstate__ does proper input validation.
+ memio = self.ioclass()
+ memio.__setstate__((b"no error", 0, None))
+ memio.__setstate__((bytearray(b"no error"), 0, None))
+ memio.__setstate__((b"no error", 0, {'spam': 3}))
+ self.assertRaises(ValueError, memio.__setstate__, (b"", -1, None))
+ self.assertRaises(TypeError, memio.__setstate__, ("unicode", 0, None))
+ self.assertRaises(TypeError, memio.__setstate__, (b"", 0.0, None))
+ self.assertRaises(TypeError, memio.__setstate__, (b"", 0, 0))
+ self.assertRaises(TypeError, memio.__setstate__, (b"len-test", 0))
+ self.assertRaises(TypeError, memio.__setstate__)
+ self.assertRaises(TypeError, memio.__setstate__, 0)
+ memio.close()
+ self.assertRaises(ValueError, memio.__setstate__, (b"closed", 0, None))
+
+
class CStringIOTest(PyStringIOTest):
ioclass = io.StringIO
UnsupportedOperation = io.UnsupportedOperation
@@ -571,9 +673,48 @@ class CStringIOTest(PyStringIOTest):
self.assertEqual(memio.tell(), len(buf) * 2)
self.assertEqual(memio.getvalue(), buf + buf)
+ def test_getstate(self):
+ memio = self.ioclass()
+ state = memio.__getstate__()
+ self.assertEqual(len(state), 4)
+ self.assertIsInstance(state[0], str)
+ self.assertIsInstance(state[1], str)
+ self.assertIsInstance(state[2], int)
+ self.assertTrue(isinstance(state[3], dict) or state[3] is None)
+ memio.close()
+ self.assertRaises(ValueError, memio.__getstate__)
+
+ def test_setstate(self):
+ # This checks whether __setstate__ does proper input validation.
+ memio = self.ioclass()
+ memio.__setstate__(("no error", "\n", 0, None))
+ memio.__setstate__(("no error", "", 0, {'spam': 3}))
+ self.assertRaises(ValueError, memio.__setstate__, ("", "f", 0, None))
+ self.assertRaises(ValueError, memio.__setstate__, ("", "", -1, None))
+ self.assertRaises(TypeError, memio.__setstate__, (b"", "", 0, None))
+ self.assertRaises(TypeError, memio.__setstate__, ("", b"", 0, None))
+ self.assertRaises(TypeError, memio.__setstate__, ("", "", 0.0, None))
+ self.assertRaises(TypeError, memio.__setstate__, ("", "", 0, 0))
+ self.assertRaises(TypeError, memio.__setstate__, ("len-test", 0))
+ self.assertRaises(TypeError, memio.__setstate__)
+ self.assertRaises(TypeError, memio.__setstate__, 0)
+ memio.close()
+ self.assertRaises(ValueError, memio.__setstate__, ("closed", "", 0, None))
+
+
+class CStringIOPickleTest(PyStringIOPickleTest):
+ UnsupportedOperation = io.UnsupportedOperation
+
+ class ioclass(io.StringIO):
+ def __new__(cls, *args, **kwargs):
+ return pickle.loads(pickle.dumps(io.StringIO(*args, **kwargs)))
+ def __init__(self, *args, **kwargs):
+ pass
+
def test_main():
- tests = [PyBytesIOTest, PyStringIOTest, CBytesIOTest, CStringIOTest]
+ tests = [PyBytesIOTest, PyStringIOTest, CBytesIOTest, CStringIOTest,
+ PyStringIOPickleTest, CStringIOPickleTest]
support.run_unittest(*tests)
if __name__ == '__main__':
diff --git a/Lib/test/test_memoryview.py b/Lib/test/test_memoryview.py
index 52fa3a935f..0bfddd97ed 100644
--- a/Lib/test/test_memoryview.py
+++ b/Lib/test/test_memoryview.py
@@ -29,7 +29,7 @@ class AbstractMemoryTests:
oldrefcount = sys.getrefcount(b)
m = self._view(b)
self.assertEqual(m[0], item(b"a"))
- self.assertTrue(isinstance(m[0], bytes), type(m[0]))
+ self.assertIsInstance(m[0], bytes)
self.assertEqual(m[5], item(b"f"))
self.assertEqual(m[-1], item(b"f"))
self.assertEqual(m[-6], item(b"a"))
@@ -129,7 +129,7 @@ class AbstractMemoryTests:
expected = b"".join(
self.getitem_type(bytes([c])) for c in b"abcdef")
self.assertEqual(b, expected)
- self.assertTrue(isinstance(b, bytes), type(b))
+ self.assertIsInstance(b, bytes)
def test_tolist(self):
for tp in self._types:
@@ -226,6 +226,52 @@ class AbstractMemoryTests:
gc.collect()
self.assertTrue(wr() is None, wr())
+ def _check_released(self, m, tp):
+ check = self.assertRaisesRegex(ValueError, "released")
+ with check: bytes(m)
+ with check: m.tobytes()
+ with check: m.tolist()
+ with check: m[0]
+ with check: m[0] = b'x'
+ with check: len(m)
+ with check: m.format
+ with check: m.itemsize
+ with check: m.ndim
+ with check: m.readonly
+ with check: m.shape
+ with check: m.strides
+ with check:
+ with m:
+ pass
+ # str() and repr() still function
+ self.assertIn("released memory", str(m))
+ self.assertIn("released memory", repr(m))
+ self.assertEqual(m, m)
+ self.assertNotEqual(m, memoryview(tp(self._source)))
+ self.assertNotEqual(m, tp(self._source))
+
+ def test_contextmanager(self):
+ for tp in self._types:
+ b = tp(self._source)
+ m = self._view(b)
+ with m as cm:
+ self.assertIs(cm, m)
+ self._check_released(m, tp)
+ m = self._view(b)
+ # Can release explicitly inside the context manager
+ with m:
+ m.release()
+
+ def test_release(self):
+ for tp in self._types:
+ b = tp(self._source)
+ m = self._view(b)
+ m.release()
+ self._check_released(m, tp)
+ # Can be called a second time (it's a no-op)
+ m.release()
+ self._check_released(m, tp)
+
def test_writable_readonly(self):
# Issue #10451: memoryview incorrectly exposes a readonly
# buffer as writable causing a segfault if using mmap
@@ -251,7 +297,7 @@ class BaseBytesMemoryTests(AbstractMemoryTests):
class BaseArrayMemoryTests(AbstractMemoryTests):
ro_type = None
rw_type = lambda self, b: array.array('i', list(b))
- getitem_type = lambda self, b: array.array('i', list(b)).tostring()
+ getitem_type = lambda self, b: array.array('i', list(b)).tobytes()
itemsize = array.array('i').itemsize
format = 'i'
diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py
index 7918de6a57..2caa7aa21d 100644
--- a/Lib/test/test_mimetypes.py
+++ b/Lib/test/test_mimetypes.py
@@ -1,6 +1,7 @@
import mimetypes
import io
import unittest
+import sys
from test import support
@@ -62,8 +63,32 @@ class MimeTypesTestCase(unittest.TestCase):
eq(all, [])
+@unittest.skipUnless(sys.platform.startswith("win"), "Windows only")
+class Win32MimeTypesTestCase(unittest.TestCase):
+ def setUp(self):
+ # ensure all entries actually come from the Windows registry
+ self.original_types_map = mimetypes.types_map.copy()
+ mimetypes.types_map.clear()
+ mimetypes.init()
+ self.db = mimetypes.MimeTypes()
+
+ def tearDown(self):
+ # restore default settings
+ mimetypes.types_map.clear()
+ mimetypes.types_map.update(self.original_types_map)
+
+ def test_registry_parsing(self):
+ # the original, minimum contents of the MIME database in the
+ # Windows registry is undocumented AFAIK.
+ # Use file types that should *always* exist:
+ eq = self.assertEqual
+ eq(self.db.guess_type("foo.txt"), ("text/plain", None))
+
+
def test_main():
- support.run_unittest(MimeTypesTestCase)
+ support.run_unittest(MimeTypesTestCase,
+ Win32MimeTypesTestCase
+ )
if __name__ == "__main__":
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index c58d17dbd7..4c2b34a748 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -1,9 +1,7 @@
# test for xml.dom.minidom
-import os
-import sys
import pickle
-from test.support import verbose, run_unittest
+from test.support import verbose, run_unittest, findfile
import unittest
import xml.dom
@@ -14,12 +12,8 @@ from xml.dom.minidom import parse, Node, Document, parseString
from xml.dom.minidom import getDOMImplementation
-if __name__ == "__main__":
- base = sys.argv[0]
-else:
- base = __file__
-tstfile = os.path.join(os.path.dirname(base), "test.xml")
-del base
+tstfile = findfile("test.xml", subdir="xmltestdata")
+
# The tests of DocumentType importing use these helpers to construct
# the documents to work with, since not all DOM builders actually
@@ -79,9 +73,10 @@ class MinidomTest(unittest.TestCase):
self.confirm(t == s, "looking for %s, found %s" % (repr(s), repr(t)))
def testParseFromFile(self):
- dom = parse(open(tstfile))
- dom.unlink()
- self.confirm(isinstance(dom, Document))
+ with open(tstfile) as file:
+ dom = parse(file)
+ dom.unlink()
+ self.confirm(isinstance(dom, Document))
def testGetElementsByTagName(self):
dom = parse(tstfile)
@@ -234,7 +229,14 @@ class MinidomTest(unittest.TestCase):
def testUnlink(self):
dom = parse(tstfile)
+ self.assertTrue(dom.childNodes)
dom.unlink()
+ self.assertFalse(dom.childNodes)
+
+ def testContext(self):
+ with parse(tstfile) as dom:
+ self.assertTrue(dom.childNodes)
+ self.assertFalse(dom.childNodes)
def testElement(self):
dom = Document()
@@ -438,7 +440,7 @@ class MinidomTest(unittest.TestCase):
string1 = repr(el)
string2 = str(el)
self.confirm(string1 == string2)
- self.confirm(string1.find("slash:abc") != -1)
+ self.confirm("slash:abc" in string1)
dom.unlink()
def testAttributeRepr(self):
@@ -950,12 +952,20 @@ class MinidomTest(unittest.TestCase):
doc.unlink()
+ def testBug0777884(self):
+ doc = parseString("<o>text</o>")
+ text = doc.documentElement.childNodes[0]
+ self.assertEqual(text.nodeType, Node.TEXT_NODE)
+ # Should run quietly, doing nothing.
+ text.normalize()
+ doc.unlink()
+
def testBug1433694(self):
doc = parseString("<o><i/>t</o>")
node = doc.documentElement
node.childNodes[1].nodeValue = ""
node.normalize()
- self.confirm(node.childNodes[-1].nextSibling == None,
+ self.confirm(node.childNodes[-1].nextSibling is None,
"Final child's .nextSibling should be None")
def testSiblings(self):
@@ -1455,12 +1465,13 @@ class MinidomTest(unittest.TestCase):
self.confirm(len(n1.entities) == len(n2.entities)
and len(n1.notations) == len(n2.notations))
for i in range(len(n1.notations)):
+ # XXX this loop body doesn't seem to be executed?
no1 = n1.notations.item(i)
no2 = n1.notations.item(i)
self.confirm(no1.name == no2.name
and no1.publicId == no2.publicId
and no1.systemId == no2.systemId)
- statck.append((no1, no2))
+ stack.append((no1, no2))
for i in range(len(n1.entities)):
e1 = n1.entities.item(i)
e2 = n2.entities.item(i)
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index f7d6c6ff65..712378b4a6 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -1,7 +1,11 @@
from test.support import (TESTFN, run_unittest, import_module, unlink,
requires, _2G, _4G)
import unittest
-import os, re, itertools, socket, sys
+import os
+import re
+import itertools
+import socket
+import sys
# Skip test if we can't import mmap.
mmap = import_module('mmap')
@@ -117,126 +121,119 @@ class MmapTests(unittest.TestCase):
def test_access_parameter(self):
# Test for "access" keyword parameter
mapsize = 10
- open(TESTFN, "wb").write(b"a"*mapsize)
- f = open(TESTFN, "rb")
- m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_READ)
- self.assertEqual(m[:], b'a'*mapsize, "Readonly memory map data incorrect.")
+ with open(TESTFN, "wb") as fp:
+ fp.write(b"a"*mapsize)
+ with open(TESTFN, "rb") as f:
+ m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_READ)
+ self.assertEqual(m[:], b'a'*mapsize, "Readonly memory map data incorrect.")
- # Ensuring that readonly mmap can't be slice assigned
- try:
- m[:] = b'b'*mapsize
- except TypeError:
- pass
- else:
- self.fail("Able to write to readonly memory map")
+ # Ensuring that readonly mmap can't be slice assigned
+ try:
+ m[:] = b'b'*mapsize
+ except TypeError:
+ pass
+ else:
+ self.fail("Able to write to readonly memory map")
- # Ensuring that readonly mmap can't be item assigned
- try:
- m[0] = b'b'
- except TypeError:
- pass
- else:
- self.fail("Able to write to readonly memory map")
+ # Ensuring that readonly mmap can't be item assigned
+ try:
+ m[0] = b'b'
+ except TypeError:
+ pass
+ else:
+ self.fail("Able to write to readonly memory map")
- # Ensuring that readonly mmap can't be write() to
- try:
- m.seek(0,0)
- m.write(b'abc')
- except TypeError:
- pass
- else:
- self.fail("Able to write to readonly memory map")
+ # Ensuring that readonly mmap can't be write() to
+ try:
+ m.seek(0,0)
+ m.write(b'abc')
+ except TypeError:
+ pass
+ else:
+ self.fail("Able to write to readonly memory map")
- # Ensuring that readonly mmap can't be write_byte() to
- try:
- m.seek(0,0)
- m.write_byte(b'd')
- except TypeError:
- pass
- else:
- self.fail("Able to write to readonly memory map")
+ # Ensuring that readonly mmap can't be write_byte() to
+ try:
+ m.seek(0,0)
+ m.write_byte(b'd')
+ except TypeError:
+ pass
+ else:
+ self.fail("Able to write to readonly memory map")
- # Ensuring that readonly mmap can't be resized
- try:
- m.resize(2*mapsize)
- except SystemError: # resize is not universally supported
- pass
- except TypeError:
- pass
- else:
- self.fail("Able to resize readonly memory map")
- f.close()
- del m, f
- self.assertEqual(open(TESTFN, "rb").read(), b'a'*mapsize,
- "Readonly memory map data file was modified")
+ # Ensuring that readonly mmap can't be resized
+ try:
+ m.resize(2*mapsize)
+ except SystemError: # resize is not universally supported
+ pass
+ except TypeError:
+ pass
+ else:
+ self.fail("Able to resize readonly memory map")
+ with open(TESTFN, "rb") as fp:
+ self.assertEqual(fp.read(), b'a'*mapsize,
+ "Readonly memory map data file was modified")
# Opening mmap with size too big
- import sys
- f = open(TESTFN, "r+b")
- try:
- m = mmap.mmap(f.fileno(), mapsize+1)
- except ValueError:
- # we do not expect a ValueError on Windows
- # CAUTION: This also changes the size of the file on disk, and
- # later tests assume that the length hasn't changed. We need to
- # repair that.
+ with open(TESTFN, "r+b") as f:
+ try:
+ m = mmap.mmap(f.fileno(), mapsize+1)
+ except ValueError:
+ # we do not expect a ValueError on Windows
+ # CAUTION: This also changes the size of the file on disk, and
+ # later tests assume that the length hasn't changed. We need to
+ # repair that.
+ if sys.platform.startswith('win'):
+ self.fail("Opening mmap with size+1 should work on Windows.")
+ else:
+ # we expect a ValueError on Unix, but not on Windows
+ if not sys.platform.startswith('win'):
+ self.fail("Opening mmap with size+1 should raise ValueError.")
+ m.close()
if sys.platform.startswith('win'):
- self.fail("Opening mmap with size+1 should work on Windows.")
- else:
- # we expect a ValueError on Unix, but not on Windows
- if not sys.platform.startswith('win'):
- self.fail("Opening mmap with size+1 should raise ValueError.")
- m.close()
- f.close()
- if sys.platform.startswith('win'):
- # Repair damage from the resizing test.
- f = open(TESTFN, 'r+b')
- f.truncate(mapsize)
- f.close()
+ # Repair damage from the resizing test.
+ with open(TESTFN, 'r+b') as f:
+ f.truncate(mapsize)
# Opening mmap with access=ACCESS_WRITE
- f = open(TESTFN, "r+b")
- m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_WRITE)
- # Modifying write-through memory map
- m[:] = b'c'*mapsize
- self.assertEqual(m[:], b'c'*mapsize,
- "Write-through memory map memory not updated properly.")
- m.flush()
- m.close()
- f.close()
- f = open(TESTFN, 'rb')
- stuff = f.read()
- f.close()
+ with open(TESTFN, "r+b") as f:
+ m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_WRITE)
+ # Modifying write-through memory map
+ m[:] = b'c'*mapsize
+ self.assertEqual(m[:], b'c'*mapsize,
+ "Write-through memory map memory not updated properly.")
+ m.flush()
+ m.close()
+ with open(TESTFN, 'rb') as f:
+ stuff = f.read()
self.assertEqual(stuff, b'c'*mapsize,
"Write-through memory map data file not updated properly.")
# Opening mmap with access=ACCESS_COPY
- f = open(TESTFN, "r+b")
- m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_COPY)
- # Modifying copy-on-write memory map
- m[:] = b'd'*mapsize
- self.assertEqual(m[:], b'd' * mapsize,
- "Copy-on-write memory map data not written correctly.")
- m.flush()
- self.assertEqual(open(TESTFN, "rb").read(), b'c'*mapsize,
- "Copy-on-write test data file should not be modified.")
- # Ensuring copy-on-write maps cannot be resized
- self.assertRaises(TypeError, m.resize, 2*mapsize)
- f.close()
- del m, f
+ with open(TESTFN, "r+b") as f:
+ m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_COPY)
+ # Modifying copy-on-write memory map
+ m[:] = b'd'*mapsize
+ self.assertEqual(m[:], b'd' * mapsize,
+ "Copy-on-write memory map data not written correctly.")
+ m.flush()
+ with open(TESTFN, "rb") as fp:
+ self.assertEqual(fp.read(), b'c'*mapsize,
+ "Copy-on-write test data file should not be modified.")
+ # Ensuring copy-on-write maps cannot be resized
+ self.assertRaises(TypeError, m.resize, 2*mapsize)
+ m.close()
# Ensuring invalid access parameter raises exception
- f = open(TESTFN, "r+b")
- self.assertRaises(ValueError, mmap.mmap, f.fileno(), mapsize, access=4)
- f.close()
+ with open(TESTFN, "r+b") as f:
+ self.assertRaises(ValueError, mmap.mmap, f.fileno(), mapsize, access=4)
if os.name == "posix":
# Try incompatible flags, prot and access parameters.
- f = open(TESTFN, "r+b")
- self.assertRaises(ValueError, mmap.mmap, f.fileno(), mapsize,
- flags=mmap.MAP_PRIVATE,
- prot=mmap.PROT_READ, access=mmap.ACCESS_WRITE)
- f.close()
+ with open(TESTFN, "r+b") as f:
+ self.assertRaises(ValueError, mmap.mmap, f.fileno(), mapsize,
+ flags=mmap.MAP_PRIVATE,
+ prot=mmap.PROT_READ, access=mmap.ACCESS_WRITE)
# Try writing with PROT_EXEC and without PROT_WRITE
prot = mmap.PROT_READ | getattr(mmap, 'PROT_EXEC', 0)
@@ -253,14 +250,13 @@ class MmapTests(unittest.TestCase):
def test_tougher_find(self):
# Do a tougher .find() test. SF bug 515943 pointed out that, in 2.2,
# searching for data with embedded \0 bytes didn't work.
- f = open(TESTFN, 'wb+')
+ with open(TESTFN, 'wb+') as f:
- data = b'aabaac\x00deef\x00\x00aa\x00'
- n = len(data)
- f.write(data)
- f.flush()
- m = mmap.mmap(f.fileno(), n)
- f.close()
+ data = b'aabaac\x00deef\x00\x00aa\x00'
+ n = len(data)
+ f.write(data)
+ f.flush()
+ m = mmap.mmap(f.fileno(), n)
for start in range(n+1):
for finish in range(start, n+1):
@@ -344,11 +340,8 @@ class MmapTests(unittest.TestCase):
f.write((65536 * 2) * b'm') # Arbitrary character
with open(TESTFN, "rb") as f:
- mf = mmap.mmap(f.fileno(), 0, offset=65536, access=mmap.ACCESS_READ)
- try:
+ with mmap.mmap(f.fileno(), 0, offset=65536, access=mmap.ACCESS_READ) as mf:
self.assertRaises(IndexError, mf.__getitem__, 80000)
- finally:
- mf.close()
def test_length_0_large_offset(self):
# Issue #10959: test mapping of a file by passing 0 for
@@ -533,7 +526,8 @@ class MmapTests(unittest.TestCase):
if not hasattr(mmap, 'PROT_READ'):
return
mapsize = 10
- open(TESTFN, "wb").write(b"a"*mapsize)
+ with open(TESTFN, "wb") as fp:
+ fp.write(b"a"*mapsize)
f = open(TESTFN, "rb")
m = mmap.mmap(f.fileno(), mapsize, prot=mmap.PROT_READ)
self.assertRaises(TypeError, m.write, "foo")
@@ -541,11 +535,12 @@ class MmapTests(unittest.TestCase):
def test_error(self):
self.assertTrue(issubclass(mmap.error, EnvironmentError))
- self.assertTrue("mmap.error" in str(mmap.error))
+ self.assertIn("mmap.error", str(mmap.error))
def test_io_methods(self):
data = b"0123456789"
- open(TESTFN, "wb").write(b"x"*len(data))
+ with open(TESTFN, "wb") as fp:
+ fp.write(b"x"*len(data))
f = open(TESTFN, "r+b")
m = mmap.mmap(f.fileno(), len(data))
f.close()
@@ -620,7 +615,8 @@ class MmapTests(unittest.TestCase):
m.close()
# Should not crash (Issue 5385)
- open(TESTFN, "wb").write(b"x"*10)
+ with open(TESTFN, "wb") as fp:
+ fp.write(b"x"*10)
f = open(TESTFN, "r+b")
m = mmap.mmap(f.fileno(), 0)
f.close()
@@ -645,6 +641,19 @@ class MmapTests(unittest.TestCase):
finally:
s.close()
+ def test_context_manager(self):
+ with mmap.mmap(-1, 10) as m:
+ self.assertFalse(m.closed)
+ self.assertTrue(m.closed)
+
+ def test_context_manager_exception(self):
+ # Test that the IOError gets passed through
+ with self.assertRaises(Exception) as exc:
+ with mmap.mmap(-1, 10) as m:
+ raise IOError
+ self.assertIsInstance(exc.exception, IOError,
+ "wrong exception raised in context manager")
+ self.assertTrue(m.closed, "context manager failed")
class LargeMmapTests(unittest.TestCase):
@@ -670,19 +679,13 @@ class LargeMmapTests(unittest.TestCase):
def test_large_offset(self):
with self._make_test_file(0x14FFFFFFF, b" ") as f:
- m = mmap.mmap(f.fileno(), 0, offset=0x140000000, access=mmap.ACCESS_READ)
- try:
+ with mmap.mmap(f.fileno(), 0, offset=0x140000000, access=mmap.ACCESS_READ) as m:
self.assertEqual(m[0xFFFFFFF], 32)
- finally:
- m.close()
def test_large_filesize(self):
with self._make_test_file(0x17FFFFFFF, b" ") as f:
- m = mmap.mmap(f.fileno(), 0x10000, access=mmap.ACCESS_READ)
- try:
+ with mmap.mmap(f.fileno(), 0x10000, access=mmap.ACCESS_READ) as m:
self.assertEqual(m.size(), 0x180000000)
- finally:
- m.close()
# Issue 11277: mmap() with large (~4GB) sparse files crashes on OS X.
@@ -691,11 +694,8 @@ class LargeMmapTests(unittest.TestCase):
start = boundary - len(tail) // 2
end = start + len(tail)
with self._make_test_file(start, tail) as f:
- m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
- try:
+ with mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as m:
self.assertEqual(m[start:end], tail)
- finally:
- m.close()
@unittest.skipUnless(sys.maxsize > _4G, "test cannot run on 32-bit systems")
def test_around_2GB(self):
diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py
index f3c8c615c2..fe772e14bd 100644
--- a/Lib/test/test_multibytecodec.py
+++ b/Lib/test/test_multibytecodec.py
@@ -1,11 +1,10 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_multibytecodec.py
# Unit test for multibytecodec itself
#
from test import support
-from test import test_multibytecodec_support
from test.support import TESTFN
import unittest, io, codecs, sys, os
import _multibytecodec
@@ -242,7 +241,7 @@ class Test_ISO2022(unittest.TestCase):
self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni)
def test_iso2022_jp_g0(self):
- self.assertFalse(b'\x0e' in '\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
+ self.assertNotIn(b'\x0e', '\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
e = '\u3406'.encode(encoding)
self.assertFalse(any(x > 0x80 for x in e))
diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py
index d28c6530e3..ed15ce1d3d 100644
--- a/Lib/test/test_multibytecodec_support.py
+++ b/Lib/test/test_multibytecodec_support.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# test_multibytecodec_support.py
# Common Unittest Routines for CJK codecs
@@ -6,6 +6,7 @@
import sys, codecs
import unittest, re
+from http.client import HTTPException
from test import support
from io import BytesIO
@@ -278,7 +279,7 @@ class TestBase_Mapping(unittest.TestCase):
unittest.TestCase.__init__(self, *args, **kw)
try:
self.open_mapping_file().close() # test it to report the error early
- except IOError:
+ except (IOError, HTTPException):
self.skipTest("Could not retrieve "+self.mapfileurl)
def open_mapping_file(self):
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index 3e467d5ea0..2614689bca 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -1,11 +1,10 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Unit tests for the multiprocessing package
#
import unittest
-import threading
import queue as pyqueue
import time
import io
@@ -25,6 +24,10 @@ import test.support
_multiprocessing = test.support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test.support.import_module('multiprocessing.synchronize')
+# import threading after _multiprocessing to raise a more revelant error
+# message: "No module named _multiprocessing". _multiprocessing is not compiled
+# without thread support.
+import threading
import multiprocessing.dummy
import multiprocessing.connection
@@ -52,7 +55,7 @@ def latin(s):
#
LOG_LEVEL = util.SUBWARNING
-#LOG_LEVEL = logging.WARNING
+#LOG_LEVEL = logging.DEBUG
DELTA = 0.1
CHECK_TIMINGS = False # making true makes tests take a lot longer
@@ -156,7 +159,7 @@ class _TestProcess(BaseTestCase):
self.assertTrue(current.is_alive())
self.assertTrue(not current.daemon)
- self.assertTrue(isinstance(authkey, bytes))
+ self.assertIsInstance(authkey, bytes)
self.assertTrue(len(authkey) > 0)
self.assertEqual(current.ident, os.getpid())
self.assertEqual(current.exitcode, None)
@@ -187,7 +190,7 @@ class _TestProcess(BaseTestCase):
self.assertEqual(p.authkey, current.authkey)
self.assertEqual(p.is_alive(), False)
self.assertEqual(p.daemon, True)
- self.assertTrue(p not in self.active_children())
+ self.assertNotIn(p, self.active_children())
self.assertTrue(type(self.active_children()) is list)
self.assertEqual(p.exitcode, None)
@@ -195,7 +198,7 @@ class _TestProcess(BaseTestCase):
self.assertEqual(p.exitcode, None)
self.assertEqual(p.is_alive(), True)
- self.assertTrue(p in self.active_children())
+ self.assertIn(p, self.active_children())
self.assertEqual(q.get(), args[1:])
self.assertEqual(q.get(), kwargs)
@@ -208,7 +211,7 @@ class _TestProcess(BaseTestCase):
self.assertEqual(p.exitcode, 0)
self.assertEqual(p.is_alive(), False)
- self.assertTrue(p not in self.active_children())
+ self.assertNotIn(p, self.active_children())
@classmethod
def _test_terminate(cls):
@@ -223,7 +226,7 @@ class _TestProcess(BaseTestCase):
p.start()
self.assertEqual(p.is_alive(), True)
- self.assertTrue(p in self.active_children())
+ self.assertIn(p, self.active_children())
self.assertEqual(p.exitcode, None)
p.terminate()
@@ -233,7 +236,7 @@ class _TestProcess(BaseTestCase):
self.assertTimingAlmostEqual(join.elapsed, 0.0)
self.assertEqual(p.is_alive(), False)
- self.assertTrue(p not in self.active_children())
+ self.assertNotIn(p, self.active_children())
p.join()
@@ -252,13 +255,13 @@ class _TestProcess(BaseTestCase):
self.assertEqual(type(self.active_children()), list)
p = self.Process(target=time.sleep, args=(DELTA,))
- self.assertTrue(p not in self.active_children())
+ self.assertNotIn(p, self.active_children())
p.start()
- self.assertTrue(p in self.active_children())
+ self.assertIn(p, self.active_children())
p.join()
- self.assertTrue(p not in self.active_children())
+ self.assertNotIn(p, self.active_children())
@classmethod
def _test_recursion(cls, wconn, id):
@@ -754,7 +757,13 @@ class _TestCondition(BaseTestCase):
cond.release()
# check they have all woken
- time.sleep(DELTA)
+ for i in range(10):
+ try:
+ if get_value(woken) == 6:
+ break
+ except NotImplementedError:
+ break
+ time.sleep(DELTA)
self.assertReturnsIfImplemented(6, get_value, woken)
# check state is not mucked up
@@ -766,7 +775,7 @@ class _TestCondition(BaseTestCase):
cond.acquire()
res = wait(TIMEOUT1)
cond.release()
- self.assertEqual(res, None)
+ self.assertEqual(res, False)
self.assertTimingAlmostEqual(wait.elapsed, TIMEOUT1)
@@ -1026,6 +1035,7 @@ class _TestContainers(BaseTestCase):
def sqr(x, wait=0.0):
time.sleep(wait)
return x*x
+
class _TestPool(BaseTestCase):
def test_apply(self):
@@ -1100,7 +1110,86 @@ class _TestPool(BaseTestCase):
self.pool.terminate()
join = TimingWrapper(self.pool.join)
join()
- self.assertLess(join.elapsed, 0.2)
+ self.assertLess(join.elapsed, 0.5)
+
+def raising():
+ raise KeyError("key")
+
+def unpickleable_result():
+ return lambda: 42
+
+class _TestPoolWorkerErrors(BaseTestCase):
+ ALLOWED_TYPES = ('processes', )
+
+ def test_async_error_callback(self):
+ p = multiprocessing.Pool(2)
+
+ scratchpad = [None]
+ def errback(exc):
+ scratchpad[0] = exc
+
+ res = p.apply_async(raising, error_callback=errback)
+ self.assertRaises(KeyError, res.get)
+ self.assertTrue(scratchpad[0])
+ self.assertIsInstance(scratchpad[0], KeyError)
+
+ p.close()
+ p.join()
+
+ def test_unpickleable_result(self):
+ from multiprocessing.pool import MaybeEncodingError
+ p = multiprocessing.Pool(2)
+
+ # Make sure we don't lose pool processes because of encoding errors.
+ for iteration in range(20):
+
+ scratchpad = [None]
+ def errback(exc):
+ scratchpad[0] = exc
+
+ res = p.apply_async(unpickleable_result, error_callback=errback)
+ self.assertRaises(MaybeEncodingError, res.get)
+ wrapped = scratchpad[0]
+ self.assertTrue(wrapped)
+ self.assertIsInstance(scratchpad[0], MaybeEncodingError)
+ self.assertIsNotNone(wrapped.exc)
+ self.assertIsNotNone(wrapped.value)
+
+ p.close()
+ p.join()
+
+class _TestPoolWorkerLifetime(BaseTestCase):
+ ALLOWED_TYPES = ('processes', )
+
+ def test_pool_worker_lifetime(self):
+ p = multiprocessing.Pool(3, maxtasksperchild=10)
+ self.assertEqual(3, len(p._pool))
+ origworkerpids = [w.pid for w in p._pool]
+ # Run many tasks so each worker gets replaced (hopefully)
+ results = []
+ for i in range(100):
+ results.append(p.apply_async(sqr, (i, )))
+ # Fetch the results and verify we got the right answers,
+ # also ensuring all the tasks have completed.
+ for (j, res) in enumerate(results):
+ self.assertEqual(res.get(), sqr(j))
+ # Refill the pool
+ p._repopulate_pool()
+ # Wait until all workers are alive
+ # (countdown * DELTA = 5 seconds max startup process time)
+ countdown = 50
+ while countdown and not all(w.is_alive() for w in p._pool):
+ countdown -= 1
+ time.sleep(DELTA)
+ finalworkerpids = [w.pid for w in p._pool]
+ # All pids should be assigned. See issue #7805.
+ self.assertNotIn(None, origworkerpids)
+ self.assertNotIn(None, finalworkerpids)
+ # Finally, check that the worker pids have changed
+ self.assertNotEqual(sorted(origworkerpids), sorted(finalworkerpids))
+ p.close()
+ p.join()
+
#
# Test that manager has expected number of shared objects left
#
@@ -1786,6 +1875,26 @@ class _TestLogging(BaseTestCase):
root_logger.setLevel(root_level)
logger.setLevel(level=LOG_LEVEL)
+
+# class _TestLoggingProcessName(BaseTestCase):
+#
+# def handle(self, record):
+# assert record.processName == multiprocessing.current_process().name
+# self.__handled = True
+#
+# def test_logging(self):
+# handler = logging.Handler()
+# handler.handle = self.handle
+# self.__handled = False
+# # Bypass getLogger() and side-effects
+# logger = logging.getLoggerClass()(
+# 'multiprocessing.test.TestLoggingProcessName')
+# logger.addHandler(handler)
+# logger.propagate = False
+#
+# logger.warn('foo')
+# assert self.__handled
+
#
# Test to verify handle verification, see issue 3321
#
diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py
index 1fb5434dca..830c24d781 100644
--- a/Lib/test/test_nis.py
+++ b/Lib/test/test_nis.py
@@ -1,5 +1,6 @@
from test import support
import unittest
+import sys
# Skip test if nis module does not exist.
nis = support.import_module('nis')
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py
new file mode 100644
index 0000000000..a387f61f1e
--- /dev/null
+++ b/Lib/test/test_nntplib.py
@@ -0,0 +1,1243 @@
+import io
+import datetime
+import textwrap
+import unittest
+import functools
+import contextlib
+import collections
+from test import support
+from nntplib import NNTP, GroupInfo, _have_ssl
+import nntplib
+if _have_ssl:
+ import ssl
+
+TIMEOUT = 30
+
+# TODO:
+# - test the `file` arg to more commands
+# - test error conditions
+# - test auth and `usenetrc`
+
+
+class NetworkedNNTPTestsMixin:
+
+ def test_welcome(self):
+ welcome = self.server.getwelcome()
+ self.assertEqual(str, type(welcome))
+
+ def test_help(self):
+ resp, lines = self.server.help()
+ self.assertTrue(resp.startswith("100 "), resp)
+ for line in lines:
+ self.assertEqual(str, type(line))
+
+ def test_list(self):
+ resp, groups = self.server.list()
+ if len(groups) > 0:
+ self.assertEqual(GroupInfo, type(groups[0]))
+ self.assertEqual(str, type(groups[0].group))
+
+ def test_list_active(self):
+ resp, groups = self.server.list(self.GROUP_PAT)
+ if len(groups) > 0:
+ self.assertEqual(GroupInfo, type(groups[0]))
+ self.assertEqual(str, type(groups[0].group))
+
+ def test_unknown_command(self):
+ with self.assertRaises(nntplib.NNTPPermanentError) as cm:
+ self.server._shortcmd("XYZZY")
+ resp = cm.exception.response
+ self.assertTrue(resp.startswith("500 "), resp)
+
+ def test_newgroups(self):
+ # gmane gets a constant influx of new groups. In order not to stress
+ # the server too much, we choose a recent date in the past.
+ dt = datetime.date.today() - datetime.timedelta(days=7)
+ resp, groups = self.server.newgroups(dt)
+ if len(groups) > 0:
+ self.assertIsInstance(groups[0], GroupInfo)
+ self.assertIsInstance(groups[0].group, str)
+
+ def test_description(self):
+ def _check_desc(desc):
+ # Sanity checks
+ self.assertIsInstance(desc, str)
+ self.assertNotIn(self.GROUP_NAME, desc)
+ desc = self.server.description(self.GROUP_NAME)
+ _check_desc(desc)
+ # Another sanity check
+ self.assertIn("Python", desc)
+ # With a pattern
+ desc = self.server.description(self.GROUP_PAT)
+ _check_desc(desc)
+ # Shouldn't exist
+ desc = self.server.description("zk.brrtt.baz")
+ self.assertEqual(desc, '')
+
+ def test_descriptions(self):
+ resp, descs = self.server.descriptions(self.GROUP_PAT)
+ # 215 for LIST NEWSGROUPS, 282 for XGTITLE
+ self.assertTrue(
+ resp.startswith("215 ") or resp.startswith("282 "), resp)
+ self.assertIsInstance(descs, dict)
+ desc = descs[self.GROUP_NAME]
+ self.assertEqual(desc, self.server.description(self.GROUP_NAME))
+
+ def test_group(self):
+ result = self.server.group(self.GROUP_NAME)
+ self.assertEqual(5, len(result))
+ resp, count, first, last, group = result
+ self.assertEqual(group, self.GROUP_NAME)
+ self.assertIsInstance(count, int)
+ self.assertIsInstance(first, int)
+ self.assertIsInstance(last, int)
+ self.assertLessEqual(first, last)
+ self.assertTrue(resp.startswith("211 "), resp)
+
+ def test_date(self):
+ resp, date = self.server.date()
+ self.assertIsInstance(date, datetime.datetime)
+ # Sanity check
+ self.assertGreaterEqual(date.year, 1995)
+ self.assertLessEqual(date.year, 2030)
+
+ def _check_art_dict(self, art_dict):
+ # Some sanity checks for a field dictionary returned by OVER / XOVER
+ self.assertIsInstance(art_dict, dict)
+ # NNTP has 7 mandatory fields
+ self.assertGreaterEqual(art_dict.keys(),
+ {"subject", "from", "date", "message-id",
+ "references", ":bytes", ":lines"}
+ )
+ for v in art_dict.values():
+ self.assertIsInstance(v, (str, type(None)))
+
+ def test_xover(self):
+ resp, count, first, last, name = self.server.group(self.GROUP_NAME)
+ resp, lines = self.server.xover(last - 5, last)
+ if len(lines) == 0:
+ self.skipTest("no articles retrieved")
+ # The 'last' article is not necessarily part of the output (cancelled?)
+ art_num, art_dict = lines[0]
+ self.assertGreaterEqual(art_num, last - 5)
+ self.assertLessEqual(art_num, last)
+ self._check_art_dict(art_dict)
+
+ def test_over(self):
+ resp, count, first, last, name = self.server.group(self.GROUP_NAME)
+ start = last - 10
+ # The "start-" article range form
+ resp, lines = self.server.over((start, None))
+ art_num, art_dict = lines[0]
+ self._check_art_dict(art_dict)
+ # The "start-end" article range form
+ resp, lines = self.server.over((start, last))
+ art_num, art_dict = lines[-1]
+ # The 'last' article is not necessarily part of the output (cancelled?)
+ self.assertGreaterEqual(art_num, start)
+ self.assertLessEqual(art_num, last)
+ self._check_art_dict(art_dict)
+ # XXX The "message_id" form is unsupported by gmane
+ # 503 Overview by message-ID unsupported
+
+ def test_xhdr(self):
+ resp, count, first, last, name = self.server.group(self.GROUP_NAME)
+ resp, lines = self.server.xhdr('subject', last)
+ for line in lines:
+ self.assertEqual(str, type(line[1]))
+
+ def check_article_resp(self, resp, article, art_num=None):
+ self.assertIsInstance(article, nntplib.ArticleInfo)
+ if art_num is not None:
+ self.assertEqual(article.number, art_num)
+ for line in article.lines:
+ self.assertIsInstance(line, bytes)
+ # XXX this could exceptionally happen...
+ self.assertNotIn(article.lines[-1], (b".", b".\n", b".\r\n"))
+
+ def test_article_head_body(self):
+ resp, count, first, last, name = self.server.group(self.GROUP_NAME)
+ # Try to find an available article
+ for art_num in (last, first, last - 1):
+ try:
+ resp, head = self.server.head(art_num)
+ except nntplib.NNTPTemporaryError as e:
+ if not e.response.startswith("423 "):
+ raise
+ # "423 No such article" => choose another one
+ continue
+ break
+ else:
+ self.skipTest("could not find a suitable article number")
+ self.assertTrue(resp.startswith("221 "), resp)
+ self.check_article_resp(resp, head, art_num)
+ resp, body = self.server.body(art_num)
+ self.assertTrue(resp.startswith("222 "), resp)
+ self.check_article_resp(resp, body, art_num)
+ resp, article = self.server.article(art_num)
+ self.assertTrue(resp.startswith("220 "), resp)
+ self.check_article_resp(resp, article, art_num)
+ self.assertEqual(article.lines, head.lines + [b''] + body.lines)
+
+ def test_capabilities(self):
+ # The server under test implements NNTP version 2 and has a
+ # couple of well-known capabilities. Just sanity check that we
+ # got them.
+ def _check_caps(caps):
+ caps_list = caps['LIST']
+ self.assertIsInstance(caps_list, (list, tuple))
+ self.assertIn('OVERVIEW.FMT', caps_list)
+ self.assertGreaterEqual(self.server.nntp_version, 2)
+ _check_caps(self.server.getcapabilities())
+ # This re-emits the command
+ resp, caps = self.server.capabilities()
+ _check_caps(caps)
+
+ if _have_ssl:
+ def test_starttls(self):
+ file = self.server.file
+ sock = self.server.sock
+ try:
+ self.server.starttls()
+ except nntplib.NNTPPermanentError:
+ self.skipTest("STARTTLS not supported by server.")
+ else:
+ # Check that the socket and internal pseudo-file really were
+ # changed.
+ self.assertNotEqual(file, self.server.file)
+ self.assertNotEqual(sock, self.server.sock)
+ # Check that the new socket really is an SSL one
+ self.assertIsInstance(self.server.sock, ssl.SSLSocket)
+ # Check that trying starttls when it's already active fails.
+ self.assertRaises(ValueError, self.server.starttls)
+
+ def test_zlogin(self):
+ # This test must be the penultimate because further commands will be
+ # refused.
+ baduser = "notarealuser"
+ badpw = "notarealpassword"
+ # Check that bogus credentials cause failure
+ self.assertRaises(nntplib.NNTPError, self.server.login,
+ user=baduser, password=badpw, usenetrc=False)
+ # FIXME: We should check that correct credentials succeed, but that
+ # would require valid details for some server somewhere to be in the
+ # test suite, I think. Gmane is anonymous, at least as used for the
+ # other tests.
+
+ def test_zzquit(self):
+ # This test must be called last, hence the name
+ cls = type(self)
+ try:
+ self.server.quit()
+ finally:
+ cls.server = None
+
+ @classmethod
+ def wrap_methods(cls):
+ # Wrap all methods in a transient_internet() exception catcher
+ # XXX put a generic version in test.support?
+ def wrap_meth(meth):
+ @functools.wraps(meth)
+ def wrapped(self):
+ with support.transient_internet(self.NNTP_HOST):
+ meth(self)
+ return wrapped
+ for name in dir(cls):
+ if not name.startswith('test_'):
+ continue
+ meth = getattr(cls, name)
+ if not isinstance(meth, collections.Callable):
+ continue
+ # Need to use a closure so that meth remains bound to its current
+ # value
+ setattr(cls, name, wrap_meth(meth))
+
+NetworkedNNTPTestsMixin.wrap_methods()
+
+
+class NetworkedNNTPTests(NetworkedNNTPTestsMixin, unittest.TestCase):
+ # This server supports STARTTLS (gmane doesn't)
+ NNTP_HOST = 'news.trigofacile.com'
+ GROUP_NAME = 'fr.comp.lang.python'
+ GROUP_PAT = 'fr.comp.lang.*'
+
+ NNTP_CLASS = NNTP
+
+ @classmethod
+ def setUpClass(cls):
+ support.requires("network")
+ with support.transient_internet(cls.NNTP_HOST):
+ cls.server = cls.NNTP_CLASS(cls.NNTP_HOST, timeout=TIMEOUT, usenetrc=False)
+
+ @classmethod
+ def tearDownClass(cls):
+ if cls.server is not None:
+ cls.server.quit()
+
+
+if _have_ssl:
+ class NetworkedNNTP_SSLTests(NetworkedNNTPTests):
+
+ # Technical limits for this public NNTP server (see http://www.aioe.org):
+ # "Only two concurrent connections per IP address are allowed and
+ # 400 connections per day are accepted from each IP address."
+
+ NNTP_HOST = 'nntp.aioe.org'
+ GROUP_NAME = 'comp.lang.python'
+ GROUP_PAT = 'comp.lang.*'
+
+ NNTP_CLASS = nntplib.NNTP_SSL
+
+ # Disabled as it produces too much data
+ test_list = None
+
+ # Disabled as the connection will already be encrypted.
+ test_starttls = None
+
+
+#
+# Non-networked tests using a local server (or something mocking it).
+#
+
+class _NNTPServerIO(io.RawIOBase):
+ """A raw IO object allowing NNTP commands to be received and processed
+ by a handler. The handler can push responses which can then be read
+ from the IO object."""
+
+ def __init__(self, handler):
+ io.RawIOBase.__init__(self)
+ # The channel from the client
+ self.c2s = io.BytesIO()
+ # The channel to the client
+ self.s2c = io.BytesIO()
+ self.handler = handler
+ self.handler.start(self.c2s.readline, self.push_data)
+
+ def readable(self):
+ return True
+
+ def writable(self):
+ return True
+
+ def push_data(self, data):
+ """Push (buffer) some data to send to the client."""
+ pos = self.s2c.tell()
+ self.s2c.seek(0, 2)
+ self.s2c.write(data)
+ self.s2c.seek(pos)
+
+ def write(self, b):
+ """The client sends us some data"""
+ pos = self.c2s.tell()
+ self.c2s.write(b)
+ self.c2s.seek(pos)
+ self.handler.process_pending()
+ return len(b)
+
+ def readinto(self, buf):
+ """The client wants to read a response"""
+ self.handler.process_pending()
+ b = self.s2c.read(len(buf))
+ n = len(b)
+ buf[:n] = b
+ return n
+
+
+class MockedNNTPTestsMixin:
+ # Override in derived classes
+ handler_class = None
+
+ def setUp(self):
+ super().setUp()
+ self.make_server()
+
+ def tearDown(self):
+ super().tearDown()
+ del self.server
+
+ def make_server(self, *args, **kwargs):
+ self.handler = self.handler_class()
+ self.sio = _NNTPServerIO(self.handler)
+ # Using BufferedRWPair instead of BufferedRandom ensures the file
+ # isn't seekable.
+ file = io.BufferedRWPair(self.sio, self.sio)
+ self.server = nntplib._NNTPBase(file, 'test.server', *args, **kwargs)
+ return self.server
+
+
+class NNTPv1Handler:
+ """A handler for RFC 977"""
+
+ welcome = "200 NNTP mock server"
+
+ def start(self, readline, push_data):
+ self.in_body = False
+ self.allow_posting = True
+ self._readline = readline
+ self._push_data = push_data
+ # Our welcome
+ self.handle_welcome()
+
+ def _decode(self, data):
+ return str(data, "utf-8", "surrogateescape")
+
+ def process_pending(self):
+ if self.in_body:
+ while True:
+ line = self._readline()
+ if not line:
+ return
+ self.body.append(line)
+ if line == b".\r\n":
+ break
+ try:
+ meth, tokens = self.body_callback
+ meth(*tokens, body=self.body)
+ finally:
+ self.body_callback = None
+ self.body = None
+ self.in_body = False
+ while True:
+ line = self._decode(self._readline())
+ if not line:
+ return
+ if not line.endswith("\r\n"):
+ raise ValueError("line doesn't end with \\r\\n: {!r}".format(line))
+ line = line[:-2]
+ cmd, *tokens = line.split()
+ #meth = getattr(self.handler, "handle_" + cmd.upper(), None)
+ meth = getattr(self, "handle_" + cmd.upper(), None)
+ if meth is None:
+ self.handle_unknown()
+ else:
+ try:
+ meth(*tokens)
+ except Exception as e:
+ raise ValueError("command failed: {!r}".format(line)) from e
+ else:
+ if self.in_body:
+ self.body_callback = meth, tokens
+ self.body = []
+
+ def expect_body(self):
+ """Flag that the client is expected to post a request body"""
+ self.in_body = True
+
+ def push_data(self, data):
+ """Push some binary data"""
+ self._push_data(data)
+
+ def push_lit(self, lit):
+ """Push a string literal"""
+ lit = textwrap.dedent(lit)
+ lit = "\r\n".join(lit.splitlines()) + "\r\n"
+ lit = lit.encode('utf-8')
+ self.push_data(lit)
+
+ def handle_unknown(self):
+ self.push_lit("500 What?")
+
+ def handle_welcome(self):
+ self.push_lit(self.welcome)
+
+ def handle_QUIT(self):
+ self.push_lit("205 Bye!")
+
+ def handle_DATE(self):
+ self.push_lit("111 20100914001155")
+
+ def handle_GROUP(self, group):
+ if group == "fr.comp.lang.python":
+ self.push_lit("211 486 761 1265 fr.comp.lang.python")
+ else:
+ self.push_lit("411 No such group {}".format(group))
+
+ def handle_HELP(self):
+ self.push_lit("""\
+ 100 Legal commands
+ authinfo user Name|pass Password|generic <prog> <args>
+ date
+ help
+ Report problems to <root@example.org>
+ .""")
+
+ def handle_STAT(self, message_spec=None):
+ if message_spec is None:
+ self.push_lit("412 No newsgroup selected")
+ elif message_spec == "3000234":
+ self.push_lit("223 3000234 <45223423@example.com>")
+ elif message_spec == "<45223423@example.com>":
+ self.push_lit("223 0 <45223423@example.com>")
+ else:
+ self.push_lit("430 No Such Article Found")
+
+ def handle_NEXT(self):
+ self.push_lit("223 3000237 <668929@example.org> retrieved")
+
+ def handle_LAST(self):
+ self.push_lit("223 3000234 <45223423@example.com> retrieved")
+
+ def handle_LIST(self, action=None, param=None):
+ if action is None:
+ self.push_lit("""\
+ 215 Newsgroups in form "group high low flags".
+ comp.lang.python 0000052340 0000002828 y
+ comp.lang.python.announce 0000001153 0000000993 m
+ free.it.comp.lang.python 0000000002 0000000002 y
+ fr.comp.lang.python 0000001254 0000000760 y
+ free.it.comp.lang.python.learner 0000000000 0000000001 y
+ tw.bbs.comp.lang.python 0000000304 0000000304 y
+ .""")
+ elif action == "ACTIVE":
+ if param == "*distutils*":
+ self.push_lit("""\
+ 215 Newsgroups in form "group high low flags"
+ gmane.comp.python.distutils.devel 0000014104 0000000001 m
+ gmane.comp.python.distutils.cvs 0000000000 0000000001 m
+ .""")
+ else:
+ self.push_lit("""\
+ 215 Newsgroups in form "group high low flags"
+ .""")
+ elif action == "OVERVIEW.FMT":
+ self.push_lit("""\
+ 215 Order of fields in overview database.
+ Subject:
+ From:
+ Date:
+ Message-ID:
+ References:
+ Bytes:
+ Lines:
+ Xref:full
+ .""")
+ elif action == "NEWSGROUPS":
+ assert param is not None
+ if param == "comp.lang.python":
+ self.push_lit("""\
+ 215 Descriptions in form "group description".
+ comp.lang.python\tThe Python computer language.
+ .""")
+ elif param == "comp.lang.python*":
+ self.push_lit("""\
+ 215 Descriptions in form "group description".
+ comp.lang.python.announce\tAnnouncements about the Python language. (Moderated)
+ comp.lang.python\tThe Python computer language.
+ .""")
+ else:
+ self.push_lit("""\
+ 215 Descriptions in form "group description".
+ .""")
+ else:
+ self.push_lit('501 Unknown LIST keyword')
+
+ def handle_NEWNEWS(self, group, date_str, time_str):
+ # We hard code different return messages depending on passed
+ # argument and date syntax.
+ if (group == "comp.lang.python" and date_str == "20100913"
+ and time_str == "082004"):
+ # Date was passed in RFC 3977 format (NNTP "v2")
+ self.push_lit("""\
+ 230 list of newsarticles (NNTP v2) created after Mon Sep 13 08:20:04 2010 follows
+ <a4929a40-6328-491a-aaaf-cb79ed7309a2@q2g2000vbk.googlegroups.com>
+ <f30c0419-f549-4218-848f-d7d0131da931@y3g2000vbm.googlegroups.com>
+ .""")
+ elif (group == "comp.lang.python" and date_str == "100913"
+ and time_str == "082004"):
+ # Date was passed in RFC 977 format (NNTP "v1")
+ self.push_lit("""\
+ 230 list of newsarticles (NNTP v1) created after Mon Sep 13 08:20:04 2010 follows
+ <a4929a40-6328-491a-aaaf-cb79ed7309a2@q2g2000vbk.googlegroups.com>
+ <f30c0419-f549-4218-848f-d7d0131da931@y3g2000vbm.googlegroups.com>
+ .""")
+ else:
+ self.push_lit("""\
+ 230 An empty list of newsarticles follows
+ .""")
+ # (Note for experiments: many servers disable NEWNEWS.
+ # As of this writing, sicinfo3.epfl.ch doesn't.)
+
+ def handle_XOVER(self, message_spec):
+ if message_spec == "57-59":
+ self.push_lit(
+ "224 Overview information for 57-58 follows\n"
+ "57\tRe: ANN: New Plone book with strong Python (and Zope) themes throughout"
+ "\tDoug Hellmann <doug.hellmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>"
+ "\tSat, 19 Jun 2010 18:04:08 -0400"
+ "\t<4FD05F05-F98B-44DC-8111-C6009C925F0C@gmail.com>"
+ "\t<hvalf7$ort$1@dough.gmane.org>\t7103\t16"
+ "\tXref: news.gmane.org gmane.comp.python.authors:57"
+ "\n"
+ "58\tLooking for a few good bloggers"
+ "\tDoug Hellmann <doug.hellmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>"
+ "\tThu, 22 Jul 2010 09:14:14 -0400"
+ "\t<A29863FA-F388-40C3-AA25-0FD06B09B5BF@gmail.com>"
+ "\t\t6683\t16"
+ "\t"
+ "\n"
+ # An UTF-8 overview line from fr.comp.lang.python
+ "59\tRe: Message d'erreur incompréhensible (par moi)"
+ "\tEric Brunel <eric.brunel@pragmadev.nospam.com>"
+ "\tWed, 15 Sep 2010 18:09:15 +0200"
+ "\t<eric.brunel-2B8B56.18091515092010@news.wanadoo.fr>"
+ "\t<4c90ec87$0$32425$ba4acef3@reader.news.orange.fr>\t1641\t27"
+ "\tXref: saria.nerim.net fr.comp.lang.python:1265"
+ "\n"
+ ".\n")
+ else:
+ self.push_lit("""\
+ 224 No articles
+ .""")
+
+ def handle_POST(self, *, body=None):
+ if body is None:
+ if self.allow_posting:
+ self.push_lit("340 Input article; end with <CR-LF>.<CR-LF>")
+ self.expect_body()
+ else:
+ self.push_lit("440 Posting not permitted")
+ else:
+ assert self.allow_posting
+ self.push_lit("240 Article received OK")
+ self.posted_body = body
+
+ def handle_IHAVE(self, message_id, *, body=None):
+ if body is None:
+ if (self.allow_posting and
+ message_id == "<i.am.an.article.you.will.want@example.com>"):
+ self.push_lit("335 Send it; end with <CR-LF>.<CR-LF>")
+ self.expect_body()
+ else:
+ self.push_lit("435 Article not wanted")
+ else:
+ assert self.allow_posting
+ self.push_lit("235 Article transferred OK")
+ self.posted_body = body
+
+ sample_head = """\
+ From: "Demo User" <nobody@example.net>
+ Subject: I am just a test article
+ Content-Type: text/plain; charset=UTF-8; format=flowed
+ Message-ID: <i.am.an.article.you.will.want@example.com>"""
+
+ sample_body = """\
+ This is just a test article.
+ ..Here is a dot-starting line.
+
+ -- Signed by Andr\xe9."""
+
+ sample_article = sample_head + "\n\n" + sample_body
+
+ def handle_ARTICLE(self, message_spec=None):
+ if message_spec is None:
+ self.push_lit("220 3000237 <45223423@example.com>")
+ elif message_spec == "<45223423@example.com>":
+ self.push_lit("220 0 <45223423@example.com>")
+ elif message_spec == "3000234":
+ self.push_lit("220 3000234 <45223423@example.com>")
+ else:
+ self.push_lit("430 No Such Article Found")
+ return
+ self.push_lit(self.sample_article)
+ self.push_lit(".")
+
+ def handle_HEAD(self, message_spec=None):
+ if message_spec is None:
+ self.push_lit("221 3000237 <45223423@example.com>")
+ elif message_spec == "<45223423@example.com>":
+ self.push_lit("221 0 <45223423@example.com>")
+ elif message_spec == "3000234":
+ self.push_lit("221 3000234 <45223423@example.com>")
+ else:
+ self.push_lit("430 No Such Article Found")
+ return
+ self.push_lit(self.sample_head)
+ self.push_lit(".")
+
+ def handle_BODY(self, message_spec=None):
+ if message_spec is None:
+ self.push_lit("222 3000237 <45223423@example.com>")
+ elif message_spec == "<45223423@example.com>":
+ self.push_lit("222 0 <45223423@example.com>")
+ elif message_spec == "3000234":
+ self.push_lit("222 3000234 <45223423@example.com>")
+ else:
+ self.push_lit("430 No Such Article Found")
+ return
+ self.push_lit(self.sample_body)
+ self.push_lit(".")
+
+
+class NNTPv2Handler(NNTPv1Handler):
+ """A handler for RFC 3977 (NNTP "v2")"""
+
+ def handle_CAPABILITIES(self):
+ self.push_lit("""\
+ 101 Capability list:
+ VERSION 2 3
+ IMPLEMENTATION INN 2.5.1
+ AUTHINFO USER
+ HDR
+ LIST ACTIVE ACTIVE.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMT
+ OVER
+ POST
+ READER
+ .""")
+
+ def handle_OVER(self, message_spec=None):
+ return self.handle_XOVER(message_spec)
+
+
+class NNTPv1v2TestsMixin:
+
+ def setUp(self):
+ super().setUp()
+
+ def test_welcome(self):
+ self.assertEqual(self.server.welcome, self.handler.welcome)
+
+ def test_date(self):
+ resp, date = self.server.date()
+ self.assertEqual(resp, "111 20100914001155")
+ self.assertEqual(date, datetime.datetime(2010, 9, 14, 0, 11, 55))
+
+ def test_quit(self):
+ self.assertFalse(self.sio.closed)
+ resp = self.server.quit()
+ self.assertEqual(resp, "205 Bye!")
+ self.assertTrue(self.sio.closed)
+
+ def test_help(self):
+ resp, help = self.server.help()
+ self.assertEqual(resp, "100 Legal commands")
+ self.assertEqual(help, [
+ ' authinfo user Name|pass Password|generic <prog> <args>',
+ ' date',
+ ' help',
+ 'Report problems to <root@example.org>',
+ ])
+
+ def test_list(self):
+ resp, groups = self.server.list()
+ self.assertEqual(len(groups), 6)
+ g = groups[1]
+ self.assertEqual(g,
+ GroupInfo("comp.lang.python.announce", "0000001153",
+ "0000000993", "m"))
+ resp, groups = self.server.list("*distutils*")
+ self.assertEqual(len(groups), 2)
+ g = groups[0]
+ self.assertEqual(g,
+ GroupInfo("gmane.comp.python.distutils.devel", "0000014104",
+ "0000000001", "m"))
+
+ def test_stat(self):
+ resp, art_num, message_id = self.server.stat(3000234)
+ self.assertEqual(resp, "223 3000234 <45223423@example.com>")
+ self.assertEqual(art_num, 3000234)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ resp, art_num, message_id = self.server.stat("<45223423@example.com>")
+ self.assertEqual(resp, "223 0 <45223423@example.com>")
+ self.assertEqual(art_num, 0)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ with self.assertRaises(nntplib.NNTPTemporaryError) as cm:
+ self.server.stat("<non.existent.id>")
+ self.assertEqual(cm.exception.response, "430 No Such Article Found")
+ with self.assertRaises(nntplib.NNTPTemporaryError) as cm:
+ self.server.stat()
+ self.assertEqual(cm.exception.response, "412 No newsgroup selected")
+
+ def test_next(self):
+ resp, art_num, message_id = self.server.next()
+ self.assertEqual(resp, "223 3000237 <668929@example.org> retrieved")
+ self.assertEqual(art_num, 3000237)
+ self.assertEqual(message_id, "<668929@example.org>")
+
+ def test_last(self):
+ resp, art_num, message_id = self.server.last()
+ self.assertEqual(resp, "223 3000234 <45223423@example.com> retrieved")
+ self.assertEqual(art_num, 3000234)
+ self.assertEqual(message_id, "<45223423@example.com>")
+
+ def test_description(self):
+ desc = self.server.description("comp.lang.python")
+ self.assertEqual(desc, "The Python computer language.")
+ desc = self.server.description("comp.lang.pythonx")
+ self.assertEqual(desc, "")
+
+ def test_descriptions(self):
+ resp, groups = self.server.descriptions("comp.lang.python")
+ self.assertEqual(resp, '215 Descriptions in form "group description".')
+ self.assertEqual(groups, {
+ "comp.lang.python": "The Python computer language.",
+ })
+ resp, groups = self.server.descriptions("comp.lang.python*")
+ self.assertEqual(groups, {
+ "comp.lang.python": "The Python computer language.",
+ "comp.lang.python.announce": "Announcements about the Python language. (Moderated)",
+ })
+ resp, groups = self.server.descriptions("comp.lang.pythonx")
+ self.assertEqual(groups, {})
+
+ def test_group(self):
+ resp, count, first, last, group = self.server.group("fr.comp.lang.python")
+ self.assertTrue(resp.startswith("211 "), resp)
+ self.assertEqual(first, 761)
+ self.assertEqual(last, 1265)
+ self.assertEqual(count, 486)
+ self.assertEqual(group, "fr.comp.lang.python")
+ with self.assertRaises(nntplib.NNTPTemporaryError) as cm:
+ self.server.group("comp.lang.python.devel")
+ exc = cm.exception
+ self.assertTrue(exc.response.startswith("411 No such group"),
+ exc.response)
+
+ def test_newnews(self):
+ # NEWNEWS comp.lang.python [20]100913 082004
+ dt = datetime.datetime(2010, 9, 13, 8, 20, 4)
+ resp, ids = self.server.newnews("comp.lang.python", dt)
+ expected = (
+ "230 list of newsarticles (NNTP v{0}) "
+ "created after Mon Sep 13 08:20:04 2010 follows"
+ ).format(self.nntp_version)
+ self.assertEqual(resp, expected)
+ self.assertEqual(ids, [
+ "<a4929a40-6328-491a-aaaf-cb79ed7309a2@q2g2000vbk.googlegroups.com>",
+ "<f30c0419-f549-4218-848f-d7d0131da931@y3g2000vbm.googlegroups.com>",
+ ])
+ # NEWNEWS fr.comp.lang.python [20]100913 082004
+ dt = datetime.datetime(2010, 9, 13, 8, 20, 4)
+ resp, ids = self.server.newnews("fr.comp.lang.python", dt)
+ self.assertEqual(resp, "230 An empty list of newsarticles follows")
+ self.assertEqual(ids, [])
+
+ def _check_article_body(self, lines):
+ self.assertEqual(len(lines), 4)
+ self.assertEqual(lines[-1].decode('utf8'), "-- Signed by André.")
+ self.assertEqual(lines[-2], b"")
+ self.assertEqual(lines[-3], b".Here is a dot-starting line.")
+ self.assertEqual(lines[-4], b"This is just a test article.")
+
+ def _check_article_head(self, lines):
+ self.assertEqual(len(lines), 4)
+ self.assertEqual(lines[0], b'From: "Demo User" <nobody@example.net>')
+ self.assertEqual(lines[3], b"Message-ID: <i.am.an.article.you.will.want@example.com>")
+
+ def _check_article_data(self, lines):
+ self.assertEqual(len(lines), 9)
+ self._check_article_head(lines[:4])
+ self._check_article_body(lines[-4:])
+ self.assertEqual(lines[4], b"")
+
+ def test_article(self):
+ # ARTICLE
+ resp, info = self.server.article()
+ self.assertEqual(resp, "220 3000237 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 3000237)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self._check_article_data(lines)
+ # ARTICLE num
+ resp, info = self.server.article(3000234)
+ self.assertEqual(resp, "220 3000234 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 3000234)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self._check_article_data(lines)
+ # ARTICLE id
+ resp, info = self.server.article("<45223423@example.com>")
+ self.assertEqual(resp, "220 0 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 0)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self._check_article_data(lines)
+ # Non-existent id
+ with self.assertRaises(nntplib.NNTPTemporaryError) as cm:
+ self.server.article("<non-existent@example.com>")
+ self.assertEqual(cm.exception.response, "430 No Such Article Found")
+
+ def test_article_file(self):
+ # With a "file" argument
+ f = io.BytesIO()
+ resp, info = self.server.article(file=f)
+ self.assertEqual(resp, "220 3000237 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 3000237)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self.assertEqual(lines, [])
+ data = f.getvalue()
+ self.assertTrue(data.startswith(
+ b'From: "Demo User" <nobody@example.net>\r\n'
+ b'Subject: I am just a test article\r\n'
+ ), ascii(data))
+ self.assertTrue(data.endswith(
+ b'This is just a test article.\r\n'
+ b'.Here is a dot-starting line.\r\n'
+ b'\r\n'
+ b'-- Signed by Andr\xc3\xa9.\r\n'
+ ), ascii(data))
+
+ def test_head(self):
+ # HEAD
+ resp, info = self.server.head()
+ self.assertEqual(resp, "221 3000237 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 3000237)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self._check_article_head(lines)
+ # HEAD num
+ resp, info = self.server.head(3000234)
+ self.assertEqual(resp, "221 3000234 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 3000234)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self._check_article_head(lines)
+ # HEAD id
+ resp, info = self.server.head("<45223423@example.com>")
+ self.assertEqual(resp, "221 0 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 0)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self._check_article_head(lines)
+ # Non-existent id
+ with self.assertRaises(nntplib.NNTPTemporaryError) as cm:
+ self.server.head("<non-existent@example.com>")
+ self.assertEqual(cm.exception.response, "430 No Such Article Found")
+
+ def test_body(self):
+ # BODY
+ resp, info = self.server.body()
+ self.assertEqual(resp, "222 3000237 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 3000237)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self._check_article_body(lines)
+ # BODY num
+ resp, info = self.server.body(3000234)
+ self.assertEqual(resp, "222 3000234 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 3000234)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self._check_article_body(lines)
+ # BODY id
+ resp, info = self.server.body("<45223423@example.com>")
+ self.assertEqual(resp, "222 0 <45223423@example.com>")
+ art_num, message_id, lines = info
+ self.assertEqual(art_num, 0)
+ self.assertEqual(message_id, "<45223423@example.com>")
+ self._check_article_body(lines)
+ # Non-existent id
+ with self.assertRaises(nntplib.NNTPTemporaryError) as cm:
+ self.server.body("<non-existent@example.com>")
+ self.assertEqual(cm.exception.response, "430 No Such Article Found")
+
+ def check_over_xover_resp(self, resp, overviews):
+ self.assertTrue(resp.startswith("224 "), resp)
+ self.assertEqual(len(overviews), 3)
+ art_num, over = overviews[0]
+ self.assertEqual(art_num, 57)
+ self.assertEqual(over, {
+ "from": "Doug Hellmann <doug.hellmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>",
+ "subject": "Re: ANN: New Plone book with strong Python (and Zope) themes throughout",
+ "date": "Sat, 19 Jun 2010 18:04:08 -0400",
+ "message-id": "<4FD05F05-F98B-44DC-8111-C6009C925F0C@gmail.com>",
+ "references": "<hvalf7$ort$1@dough.gmane.org>",
+ ":bytes": "7103",
+ ":lines": "16",
+ "xref": "news.gmane.org gmane.comp.python.authors:57"
+ })
+ art_num, over = overviews[1]
+ self.assertEqual(over["xref"], None)
+ art_num, over = overviews[2]
+ self.assertEqual(over["subject"],
+ "Re: Message d'erreur incompréhensible (par moi)")
+
+ def test_xover(self):
+ resp, overviews = self.server.xover(57, 59)
+ self.check_over_xover_resp(resp, overviews)
+
+ def test_over(self):
+ # In NNTP "v1", this will fallback on XOVER
+ resp, overviews = self.server.over((57, 59))
+ self.check_over_xover_resp(resp, overviews)
+
+ sample_post = (
+ b'From: "Demo User" <nobody@example.net>\r\n'
+ b'Subject: I am just a test article\r\n'
+ b'Content-Type: text/plain; charset=UTF-8; format=flowed\r\n'
+ b'Message-ID: <i.am.an.article.you.will.want@example.com>\r\n'
+ b'\r\n'
+ b'This is just a test article.\r\n'
+ b'.Here is a dot-starting line.\r\n'
+ b'\r\n'
+ b'-- Signed by Andr\xc3\xa9.\r\n'
+ )
+
+ def _check_posted_body(self):
+ # Check the raw body as received by the server
+ lines = self.handler.posted_body
+ # One additional line for the "." terminator
+ self.assertEqual(len(lines), 10)
+ self.assertEqual(lines[-1], b'.\r\n')
+ self.assertEqual(lines[-2], b'-- Signed by Andr\xc3\xa9.\r\n')
+ self.assertEqual(lines[-3], b'\r\n')
+ self.assertEqual(lines[-4], b'..Here is a dot-starting line.\r\n')
+ self.assertEqual(lines[0], b'From: "Demo User" <nobody@example.net>\r\n')
+
+ def _check_post_ihave_sub(self, func, *args, file_factory):
+ # First the prepared post with CRLF endings
+ post = self.sample_post
+ func_args = args + (file_factory(post),)
+ self.handler.posted_body = None
+ resp = func(*func_args)
+ self._check_posted_body()
+ # Then the same post with "normal" line endings - they should be
+ # converted by NNTP.post and NNTP.ihave.
+ post = self.sample_post.replace(b"\r\n", b"\n")
+ func_args = args + (file_factory(post),)
+ self.handler.posted_body = None
+ resp = func(*func_args)
+ self._check_posted_body()
+ return resp
+
+ def check_post_ihave(self, func, success_resp, *args):
+ # With a bytes object
+ resp = self._check_post_ihave_sub(func, *args, file_factory=bytes)
+ self.assertEqual(resp, success_resp)
+ # With a bytearray object
+ resp = self._check_post_ihave_sub(func, *args, file_factory=bytearray)
+ self.assertEqual(resp, success_resp)
+ # With a file object
+ resp = self._check_post_ihave_sub(func, *args, file_factory=io.BytesIO)
+ self.assertEqual(resp, success_resp)
+ # With an iterable of terminated lines
+ def iterlines(b):
+ return iter(b.splitlines(True))
+ resp = self._check_post_ihave_sub(func, *args, file_factory=iterlines)
+ self.assertEqual(resp, success_resp)
+ # With an iterable of non-terminated lines
+ def iterlines(b):
+ return iter(b.splitlines(False))
+ resp = self._check_post_ihave_sub(func, *args, file_factory=iterlines)
+ self.assertEqual(resp, success_resp)
+
+ def test_post(self):
+ self.check_post_ihave(self.server.post, "240 Article received OK")
+ self.handler.allow_posting = False
+ with self.assertRaises(nntplib.NNTPTemporaryError) as cm:
+ self.server.post(self.sample_post)
+ self.assertEqual(cm.exception.response,
+ "440 Posting not permitted")
+
+ def test_ihave(self):
+ self.check_post_ihave(self.server.ihave, "235 Article transferred OK",
+ "<i.am.an.article.you.will.want@example.com>")
+ with self.assertRaises(nntplib.NNTPTemporaryError) as cm:
+ self.server.ihave("<another.message.id>", self.sample_post)
+ self.assertEqual(cm.exception.response,
+ "435 Article not wanted")
+
+
+class NNTPv1Tests(NNTPv1v2TestsMixin, MockedNNTPTestsMixin, unittest.TestCase):
+ """Tests an NNTP v1 server (no capabilities)."""
+
+ nntp_version = 1
+ handler_class = NNTPv1Handler
+
+ def test_caps(self):
+ caps = self.server.getcapabilities()
+ self.assertEqual(caps, {})
+ self.assertEqual(self.server.nntp_version, 1)
+ self.assertEqual(self.server.nntp_implementation, None)
+
+
+class NNTPv2Tests(NNTPv1v2TestsMixin, MockedNNTPTestsMixin, unittest.TestCase):
+ """Tests an NNTP v2 server (with capabilities)."""
+
+ nntp_version = 2
+ handler_class = NNTPv2Handler
+
+ def test_caps(self):
+ caps = self.server.getcapabilities()
+ self.assertEqual(caps, {
+ 'VERSION': ['2', '3'],
+ 'IMPLEMENTATION': ['INN', '2.5.1'],
+ 'AUTHINFO': ['USER'],
+ 'HDR': [],
+ 'LIST': ['ACTIVE', 'ACTIVE.TIMES', 'DISTRIB.PATS',
+ 'HEADERS', 'NEWSGROUPS', 'OVERVIEW.FMT'],
+ 'OVER': [],
+ 'POST': [],
+ 'READER': [],
+ })
+ self.assertEqual(self.server.nntp_version, 3)
+ self.assertEqual(self.server.nntp_implementation, 'INN 2.5.1')
+
+
+class MiscTests(unittest.TestCase):
+
+ def test_decode_header(self):
+ def gives(a, b):
+ self.assertEqual(nntplib.decode_header(a), b)
+ gives("" , "")
+ gives("a plain header", "a plain header")
+ gives(" with extra spaces ", " with extra spaces ")
+ gives("=?ISO-8859-15?Q?D=E9buter_en_Python?=", "Débuter en Python")
+ gives("=?utf-8?q?Re=3A_=5Bsqlite=5D_probl=C3=A8me_avec_ORDER_BY_sur_des_cha?="
+ " =?utf-8?q?=C3=AEnes_de_caract=C3=A8res_accentu=C3=A9es?=",
+ "Re: [sqlite] problème avec ORDER BY sur des chaînes de caractères accentuées")
+ gives("Re: =?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U=?=",
+ "Re: problème de matrice")
+ # A natively utf-8 header (found in the real world!)
+ gives("Re: Message d'erreur incompréhensible (par moi)",
+ "Re: Message d'erreur incompréhensible (par moi)")
+
+ def test_parse_overview_fmt(self):
+ # The minimal (default) response
+ lines = ["Subject:", "From:", "Date:", "Message-ID:",
+ "References:", ":bytes", ":lines"]
+ self.assertEqual(nntplib._parse_overview_fmt(lines),
+ ["subject", "from", "date", "message-id", "references",
+ ":bytes", ":lines"])
+ # The minimal response using alternative names
+ lines = ["Subject:", "From:", "Date:", "Message-ID:",
+ "References:", "Bytes:", "Lines:"]
+ self.assertEqual(nntplib._parse_overview_fmt(lines),
+ ["subject", "from", "date", "message-id", "references",
+ ":bytes", ":lines"])
+ # Variations in casing
+ lines = ["subject:", "FROM:", "DaTe:", "message-ID:",
+ "References:", "BYTES:", "Lines:"]
+ self.assertEqual(nntplib._parse_overview_fmt(lines),
+ ["subject", "from", "date", "message-id", "references",
+ ":bytes", ":lines"])
+ # First example from RFC 3977
+ lines = ["Subject:", "From:", "Date:", "Message-ID:",
+ "References:", ":bytes", ":lines", "Xref:full",
+ "Distribution:full"]
+ self.assertEqual(nntplib._parse_overview_fmt(lines),
+ ["subject", "from", "date", "message-id", "references",
+ ":bytes", ":lines", "xref", "distribution"])
+ # Second example from RFC 3977
+ lines = ["Subject:", "From:", "Date:", "Message-ID:",
+ "References:", "Bytes:", "Lines:", "Xref:FULL",
+ "Distribution:FULL"]
+ self.assertEqual(nntplib._parse_overview_fmt(lines),
+ ["subject", "from", "date", "message-id", "references",
+ ":bytes", ":lines", "xref", "distribution"])
+ # A classic response from INN
+ lines = ["Subject:", "From:", "Date:", "Message-ID:",
+ "References:", "Bytes:", "Lines:", "Xref:full"]
+ self.assertEqual(nntplib._parse_overview_fmt(lines),
+ ["subject", "from", "date", "message-id", "references",
+ ":bytes", ":lines", "xref"])
+
+ def test_parse_overview(self):
+ fmt = nntplib._DEFAULT_OVERVIEW_FMT + ["xref"]
+ # First example from RFC 3977
+ lines = [
+ '3000234\tI am just a test article\t"Demo User" '
+ '<nobody@example.com>\t6 Oct 1998 04:38:40 -0500\t'
+ '<45223423@example.com>\t<45454@example.net>\t1234\t'
+ '17\tXref: news.example.com misc.test:3000363',
+ ]
+ overview = nntplib._parse_overview(lines, fmt)
+ (art_num, fields), = overview
+ self.assertEqual(art_num, 3000234)
+ self.assertEqual(fields, {
+ 'subject': 'I am just a test article',
+ 'from': '"Demo User" <nobody@example.com>',
+ 'date': '6 Oct 1998 04:38:40 -0500',
+ 'message-id': '<45223423@example.com>',
+ 'references': '<45454@example.net>',
+ ':bytes': '1234',
+ ':lines': '17',
+ 'xref': 'news.example.com misc.test:3000363',
+ })
+ # Second example; here the "Xref" field is totally absent (including
+ # the header name) and comes out as None
+ lines = [
+ '3000234\tI am just a test article\t"Demo User" '
+ '<nobody@example.com>\t6 Oct 1998 04:38:40 -0500\t'
+ '<45223423@example.com>\t<45454@example.net>\t1234\t'
+ '17\t\t',
+ ]
+ overview = nntplib._parse_overview(lines, fmt)
+ (art_num, fields), = overview
+ self.assertEqual(fields['xref'], None)
+ # Third example; the "Xref" is an empty string, while "references"
+ # is a single space.
+ lines = [
+ '3000234\tI am just a test article\t"Demo User" '
+ '<nobody@example.com>\t6 Oct 1998 04:38:40 -0500\t'
+ '<45223423@example.com>\t \t1234\t'
+ '17\tXref: \t',
+ ]
+ overview = nntplib._parse_overview(lines, fmt)
+ (art_num, fields), = overview
+ self.assertEqual(fields['references'], ' ')
+ self.assertEqual(fields['xref'], '')
+
+ def test_parse_datetime(self):
+ def gives(a, b, *c):
+ self.assertEqual(nntplib._parse_datetime(a, b),
+ datetime.datetime(*c))
+ # Output of DATE command
+ gives("19990623135624", None, 1999, 6, 23, 13, 56, 24)
+ # Variations
+ gives("19990623", "135624", 1999, 6, 23, 13, 56, 24)
+ gives("990623", "135624", 1999, 6, 23, 13, 56, 24)
+ gives("090623", "135624", 2009, 6, 23, 13, 56, 24)
+
+ def test_unparse_datetime(self):
+ # Test non-legacy mode
+ # 1) with a datetime
+ def gives(y, M, d, h, m, s, date_str, time_str):
+ dt = datetime.datetime(y, M, d, h, m, s)
+ self.assertEqual(nntplib._unparse_datetime(dt),
+ (date_str, time_str))
+ self.assertEqual(nntplib._unparse_datetime(dt, False),
+ (date_str, time_str))
+ gives(1999, 6, 23, 13, 56, 24, "19990623", "135624")
+ gives(2000, 6, 23, 13, 56, 24, "20000623", "135624")
+ gives(2010, 6, 5, 1, 2, 3, "20100605", "010203")
+ # 2) with a date
+ def gives(y, M, d, date_str, time_str):
+ dt = datetime.date(y, M, d)
+ self.assertEqual(nntplib._unparse_datetime(dt),
+ (date_str, time_str))
+ self.assertEqual(nntplib._unparse_datetime(dt, False),
+ (date_str, time_str))
+ gives(1999, 6, 23, "19990623", "000000")
+ gives(2000, 6, 23, "20000623", "000000")
+ gives(2010, 6, 5, "20100605", "000000")
+
+ def test_unparse_datetime_legacy(self):
+ # Test legacy mode (RFC 977)
+ # 1) with a datetime
+ def gives(y, M, d, h, m, s, date_str, time_str):
+ dt = datetime.datetime(y, M, d, h, m, s)
+ self.assertEqual(nntplib._unparse_datetime(dt, True),
+ (date_str, time_str))
+ gives(1999, 6, 23, 13, 56, 24, "990623", "135624")
+ gives(2000, 6, 23, 13, 56, 24, "000623", "135624")
+ gives(2010, 6, 5, 1, 2, 3, "100605", "010203")
+ # 2) with a date
+ def gives(y, M, d, date_str, time_str):
+ dt = datetime.date(y, M, d)
+ self.assertEqual(nntplib._unparse_datetime(dt, True),
+ (date_str, time_str))
+ gives(1999, 6, 23, "990623", "000000")
+ gives(2000, 6, 23, "000623", "000000")
+ gives(2010, 6, 5, "100605", "000000")
+
+
+def test_main():
+ tests = [MiscTests, NNTPv1Tests, NNTPv2Tests, NetworkedNNTPTests]
+ if _have_ssl:
+ tests.append(NetworkedNNTP_SSLTests)
+ support.run_unittest(*tests)
+
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
index b6743712a7..e3e2560356 100644
--- a/Lib/test/test_normalization.py
+++ b/Lib/test/test_normalization.py
@@ -1,6 +1,7 @@
from test.support import run_unittest, open_urlresource
import unittest
+from http.client import HTTPException
import sys
import os
from unicodedata import normalize, unidata_version
@@ -8,12 +9,9 @@ from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
-if os.path.exists(TESTDATAFILE):
- f = open(TESTDATAFILE, encoding='utf-8')
- l = f.readline()
- f.close()
- if not unidata_version in l:
- os.unlink(TESTDATAFILE)
+def check_version(testfile):
+ hdr = testfile.readline()
+ return unidata_version in hdr
class RangeError(Exception):
pass
@@ -39,13 +37,16 @@ def unistr(data):
class NormalizationTest(unittest.TestCase):
def test_main(self):
+ part = None
part1_data = {}
# Hit the exception early
try:
- open_urlresource(TESTDATAURL, encoding="utf-8")
- except IOError:
+ testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
+ check=check_version)
+ except (IOError, HTTPException):
self.skipTest("Could not retrieve " + TESTDATAURL)
- for line in open_urlresource(TESTDATAURL, encoding="utf-8"):
+ self.addCleanup(testdata.close)
+ for line in testdata:
if '#' in line:
line = line.split('#')[0]
line = line.strip()
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 3d18527243..6464950982 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -1,7 +1,9 @@
import ntpath
import os
-from test.support import verbose, TestFailed
-import test.support as support
+import sys
+from test.support import TestFailed
+from test import support, test_genericpath
+from tempfile import TemporaryFile
import unittest
@@ -238,9 +240,27 @@ class TestNtpath(unittest.TestCase):
tester('ntpath.relpath("/a/b", "/a/b")', '.')
tester('ntpath.relpath("c:/foo", "C:/FOO")', '.')
+ def test_sameopenfile(self):
+ with TemporaryFile() as tf1, TemporaryFile() as tf2:
+ # Make sure the same file is really the same
+ self.assertTrue(ntpath.sameopenfile(tf1.fileno(), tf1.fileno()))
+ # Make sure different files are really different
+ self.assertFalse(ntpath.sameopenfile(tf1.fileno(), tf2.fileno()))
+ # Make sure invalid values don't cause issues on win32
+ if sys.platform == "win32":
+ with self.assertRaises(OSError):
+ # Invalid file descriptors shouldn't display assert
+ # dialogs (#4804)
+ ntpath.sameopenfile(-1, -1)
+
+
+class NtCommonTest(test_genericpath.CommonTest):
+ pathmodule = ntpath
+ attributes = ['relpath', 'splitunc']
+
def test_main():
- support.run_unittest(TestNtpath)
+ support.run_unittest(TestNtpath, NtCommonTest)
if __name__ == "__main__":
diff --git a/Lib/test/test_numeric_tower.py b/Lib/test/test_numeric_tower.py
new file mode 100644
index 0000000000..bef3d4c35d
--- /dev/null
+++ b/Lib/test/test_numeric_tower.py
@@ -0,0 +1,206 @@
+# test interactions between int, float, Decimal and Fraction
+
+import unittest
+import random
+import math
+import sys
+import operator
+from test.support import run_unittest
+
+from decimal import Decimal as D
+from fractions import Fraction as F
+
+# Constants related to the hash implementation; hash(x) is based
+# on the reduction of x modulo the prime _PyHASH_MODULUS.
+_PyHASH_MODULUS = sys.hash_info.modulus
+_PyHASH_INF = sys.hash_info.inf
+
+class HashTest(unittest.TestCase):
+ def check_equal_hash(self, x, y):
+ # check both that x and y are equal and that their hashes are equal
+ self.assertEqual(hash(x), hash(y),
+ "got different hashes for {!r} and {!r}".format(x, y))
+ self.assertEqual(x, y)
+
+ def test_bools(self):
+ self.check_equal_hash(False, 0)
+ self.check_equal_hash(True, 1)
+
+ def test_integers(self):
+ # check that equal values hash equal
+
+ # exact integers
+ for i in range(-1000, 1000):
+ self.check_equal_hash(i, float(i))
+ self.check_equal_hash(i, D(i))
+ self.check_equal_hash(i, F(i))
+
+ # the current hash is based on reduction modulo 2**n-1 for some
+ # n, so pay special attention to numbers of the form 2**n and 2**n-1.
+ for i in range(100):
+ n = 2**i - 1
+ if n == int(float(n)):
+ self.check_equal_hash(n, float(n))
+ self.check_equal_hash(-n, -float(n))
+ self.check_equal_hash(n, D(n))
+ self.check_equal_hash(n, F(n))
+ self.check_equal_hash(-n, D(-n))
+ self.check_equal_hash(-n, F(-n))
+
+ n = 2**i
+ self.check_equal_hash(n, float(n))
+ self.check_equal_hash(-n, -float(n))
+ self.check_equal_hash(n, D(n))
+ self.check_equal_hash(n, F(n))
+ self.check_equal_hash(-n, D(-n))
+ self.check_equal_hash(-n, F(-n))
+
+ # random values of various sizes
+ for _ in range(1000):
+ e = random.randrange(300)
+ n = random.randrange(-10**e, 10**e)
+ self.check_equal_hash(n, D(n))
+ self.check_equal_hash(n, F(n))
+ if n == int(float(n)):
+ self.check_equal_hash(n, float(n))
+
+ def test_binary_floats(self):
+ # check that floats hash equal to corresponding Fractions and Decimals
+
+ # floats that are distinct but numerically equal should hash the same
+ self.check_equal_hash(0.0, -0.0)
+
+ # zeros
+ self.check_equal_hash(0.0, D(0))
+ self.check_equal_hash(-0.0, D(0))
+ self.check_equal_hash(-0.0, D('-0.0'))
+ self.check_equal_hash(0.0, F(0))
+
+ # infinities and nans
+ self.check_equal_hash(float('inf'), D('inf'))
+ self.check_equal_hash(float('-inf'), D('-inf'))
+
+ for _ in range(1000):
+ x = random.random() * math.exp(random.random()*200.0 - 100.0)
+ self.check_equal_hash(x, D.from_float(x))
+ self.check_equal_hash(x, F.from_float(x))
+
+ def test_complex(self):
+ # complex numbers with zero imaginary part should hash equal to
+ # the corresponding float
+
+ test_values = [0.0, -0.0, 1.0, -1.0, 0.40625, -5136.5,
+ float('inf'), float('-inf')]
+
+ for zero in -0.0, 0.0:
+ for value in test_values:
+ self.check_equal_hash(value, complex(value, zero))
+
+ def test_decimals(self):
+ # check that Decimal instances that have different representations
+ # but equal values give the same hash
+ zeros = ['0', '-0', '0.0', '-0.0e10', '000e-10']
+ for zero in zeros:
+ self.check_equal_hash(D(zero), D(0))
+
+ self.check_equal_hash(D('1.00'), D(1))
+ self.check_equal_hash(D('1.00000'), D(1))
+ self.check_equal_hash(D('-1.00'), D(-1))
+ self.check_equal_hash(D('-1.00000'), D(-1))
+ self.check_equal_hash(D('123e2'), D(12300))
+ self.check_equal_hash(D('1230e1'), D(12300))
+ self.check_equal_hash(D('12300'), D(12300))
+ self.check_equal_hash(D('12300.0'), D(12300))
+ self.check_equal_hash(D('12300.00'), D(12300))
+ self.check_equal_hash(D('12300.000'), D(12300))
+
+ def test_fractions(self):
+ # check special case for fractions where either the numerator
+ # or the denominator is a multiple of _PyHASH_MODULUS
+ self.assertEqual(hash(F(1, _PyHASH_MODULUS)), _PyHASH_INF)
+ self.assertEqual(hash(F(-1, 3*_PyHASH_MODULUS)), -_PyHASH_INF)
+ self.assertEqual(hash(F(7*_PyHASH_MODULUS, 1)), 0)
+ self.assertEqual(hash(F(-_PyHASH_MODULUS, 1)), 0)
+
+ def test_hash_normalization(self):
+ # Test for a bug encountered while changing long_hash.
+ #
+ # Given objects x and y, it should be possible for y's
+ # __hash__ method to return hash(x) in order to ensure that
+ # hash(x) == hash(y). But hash(x) is not exactly equal to the
+ # result of x.__hash__(): there's some internal normalization
+ # to make sure that the result fits in a C long, and is not
+ # equal to the invalid hash value -1. This internal
+ # normalization must therefore not change the result of
+ # hash(x) for any x.
+
+ class HalibutProxy:
+ def __hash__(self):
+ return hash('halibut')
+ def __eq__(self, other):
+ return other == 'halibut'
+
+ x = {'halibut', HalibutProxy()}
+ self.assertEqual(len(x), 1)
+
+class ComparisonTest(unittest.TestCase):
+ def test_mixed_comparisons(self):
+
+ # ordered list of distinct test values of various types:
+ # int, float, Fraction, Decimal
+ test_values = [
+ float('-inf'),
+ D('-1e999999999'),
+ -1e308,
+ F(-22, 7),
+ -3.14,
+ -2,
+ 0.0,
+ 1e-320,
+ True,
+ F('1.2'),
+ D('1.3'),
+ float('1.4'),
+ F(275807, 195025),
+ D('1.414213562373095048801688724'),
+ F(114243, 80782),
+ F(473596569, 84615),
+ 7e200,
+ D('infinity'),
+ ]
+ for i, first in enumerate(test_values):
+ for second in test_values[i+1:]:
+ self.assertLess(first, second)
+ self.assertLessEqual(first, second)
+ self.assertGreater(second, first)
+ self.assertGreaterEqual(second, first)
+
+ def test_complex(self):
+ # comparisons with complex are special: equality and inequality
+ # comparisons should always succeed, but order comparisons should
+ # raise TypeError.
+ z = 1.0 + 0j
+ w = -3.14 + 2.7j
+
+ for v in 1, 1.0, F(1), D(1), complex(1):
+ self.assertEqual(z, v)
+ self.assertEqual(v, z)
+
+ for v in 2, 2.0, F(2), D(2), complex(2):
+ self.assertNotEqual(z, v)
+ self.assertNotEqual(v, z)
+ self.assertNotEqual(w, v)
+ self.assertNotEqual(v, w)
+
+ for v in (1, 1.0, F(1), D(1), complex(1),
+ 2, 2.0, F(2), D(2), complex(2), w):
+ for op in operator.le, operator.lt, operator.ge, operator.gt:
+ self.assertRaises(TypeError, op, z, v)
+ self.assertRaises(TypeError, op, v, z)
+
+
+def test_main():
+ run_unittest(HashTest, ComparisonTest)
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py
index 9707e84c7e..f510bac9f0 100644
--- a/Lib/test/test_opcodes.py
+++ b/Lib/test/test_opcodes.py
@@ -60,7 +60,7 @@ class OpcodeTest(unittest.TestCase):
try: raise DClass(a)
except DClass as v:
- self.assertTrue(isinstance(v, DClass))
+ self.assertIsInstance(v, DClass)
else:
self.fail("no exception")
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py
index 531f56e4a6..fa608b9a52 100644
--- a/Lib/test/test_operator.py
+++ b/Lib/test/test_operator.py
@@ -275,8 +275,7 @@ class OperatorTestCase(unittest.TestCase):
self.assertEqual(f(a), 'arthur')
f = operator.attrgetter('rank')
self.assertRaises(AttributeError, f, a)
- f = operator.attrgetter(2)
- self.assertRaises(TypeError, f, a)
+ self.assertRaises(TypeError, operator.attrgetter, 2)
self.assertRaises(TypeError, operator.attrgetter)
# multiple gets
@@ -285,7 +284,7 @@ class OperatorTestCase(unittest.TestCase):
record.y = 'Y'
record.z = 'Z'
self.assertEqual(operator.attrgetter('x','z','y')(record), ('X', 'Z', 'Y'))
- self.assertRaises(TypeError, operator.attrgetter('x', (), 'y'), record)
+ self.assertRaises(TypeError, operator.attrgetter, ('x', (), 'y'))
class C(object):
def __getattr__(self, name):
@@ -304,6 +303,10 @@ class OperatorTestCase(unittest.TestCase):
self.assertEqual(f(a), ('arthur', 'thomas'))
f = operator.attrgetter('name', 'child.name', 'child.child.name')
self.assertRaises(AttributeError, f, a)
+ f = operator.attrgetter('child.')
+ self.assertRaises(AttributeError, f, a)
+ f = operator.attrgetter('.child')
+ self.assertRaises(AttributeError, f, a)
a.child.child = A()
a.child.child.name = 'johnson'
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py
index 4ad4c0ff5e..7b95612024 100644
--- a/Lib/test/test_optparse.py
+++ b/Lib/test/test_optparse.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
#
# Test suite for Optik. Supplied by Johannes Gijsbers
# (taradino@softhome.net) -- translated from the original Optik
@@ -18,9 +16,9 @@ from io import StringIO
from test import support
-from optparse import make_option, Option, IndentedHelpFormatter, \
- TitledHelpFormatter, OptionParser, OptionContainer, OptionGroup, \
- SUPPRESS_HELP, SUPPRESS_USAGE, OptionError, OptionConflictError, \
+from optparse import make_option, Option, \
+ TitledHelpFormatter, OptionParser, OptionGroup, \
+ SUPPRESS_USAGE, OptionError, OptionConflictError, \
BadOptionError, OptionValueError, Values
from optparse import _match_abbrev
from optparse import _parse_num
@@ -338,7 +336,7 @@ class TestOptionParser(BaseTest):
def test_get_option(self):
opt1 = self.parser.get_option("-v")
- self.assertTrue(isinstance(opt1, Option))
+ self.assertIsInstance(opt1, Option)
self.assertEqual(opt1._short_opts, ["-v", "-n"])
self.assertEqual(opt1._long_opts, ["--verbose", "--noisy"])
self.assertEqual(opt1.action, "store_true")
@@ -443,7 +441,7 @@ def _check_duration(option, opt, value):
return int(value)
else:
return int(value[:-1]) * _time_units[value[-1]]
- except ValueError as IndexError:
+ except (ValueError, IndexError):
raise OptionValueError(
'option %s: invalid duration: %r' % (opt, value))
@@ -1229,7 +1227,6 @@ class TestCallbackVarArgs(BaseTest):
def variable_args(self, option, opt, value, parser):
self.assertTrue(value is None)
- done = 0
value = []
rargs = parser.rargs
while rargs:
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index cbf0c1647d..56be375b78 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -7,8 +7,14 @@ import errno
import unittest
import warnings
import sys
+import signal
+import subprocess
+import time
import shutil
from test import support
+import contextlib
+import mmap
+import uuid
# Detect whether we're on a Linux system that uses the (now outdated
# and unmaintained) linuxthreads threading library. There's an issue
@@ -54,6 +60,7 @@ class FileTests(unittest.TestCase):
os.closerange(first, first + 2)
self.assertRaises(OSError, os.write, first, b"a")
+ @support.cpython_only
def test_rename(self):
path = support.TESTFN
old = sys.getrefcount(path)
@@ -83,6 +90,25 @@ class FileTests(unittest.TestCase):
self.assertEqual(fobj.read().splitlines(),
[b"bacon", b"eggs", b"spam"])
+ def write_windows_console(self, *args):
+ retcode = subprocess.call(args,
+ # use a new console to not flood the test output
+ creationflags=subprocess.CREATE_NEW_CONSOLE,
+ # use a shell to hide the console window (SW_HIDE)
+ shell=True)
+ self.assertEqual(retcode, 0)
+
+ @unittest.skipUnless(sys.platform == 'win32',
+ 'test specific to the Windows console')
+ def test_write_windows_console(self):
+ # Issue #11395: the Windows console returns an error (12: not enough
+ # space error) on writing into stdout if stdout mode is binary and the
+ # length is greater than 66,000 bytes (or less, depending on heap
+ # usage).
+ code = "print('x' * 100000)"
+ self.write_windows_console(sys.executable, "-c", code)
+ self.write_windows_console(sys.executable, "-u", "-c", code)
+
class TemporaryFileTests(unittest.TestCase):
def setUp(self):
@@ -165,7 +191,6 @@ class TemporaryFileTests(unittest.TestCase):
self.assertTrue(s == "foobar")
def test_tmpnam(self):
- import sys
if not hasattr(os, "tmpnam"):
return
warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning,
@@ -215,19 +240,17 @@ class StatAttributeTests(unittest.TestCase):
os.unlink(self.fname)
os.rmdir(support.TESTFN)
- def test_stat_attributes(self):
+ def check_stat_attributes(self, fname):
if not hasattr(os, "stat"):
return
import stat
- result = os.stat(self.fname)
+ result = os.stat(fname)
# Make sure direct access works
self.assertEqual(result[stat.ST_SIZE], 3)
self.assertEqual(result.st_size, 3)
- import sys
-
# Make sure all the attributes are there
members = dir(result)
for name in dir(stat):
@@ -238,8 +261,8 @@ class StatAttributeTests(unittest.TestCase):
else:
def trunc(x): return x
self.assertEqual(trunc(getattr(result, attr)),
- result[getattr(stat, name)])
- self.assertTrue(attr in members)
+ result[getattr(stat, name)])
+ self.assertIn(attr, members)
try:
result[200]
@@ -279,6 +302,15 @@ class StatAttributeTests(unittest.TestCase):
except TypeError:
pass
+ def test_stat_attributes(self):
+ self.check_stat_attributes(self.fname)
+
+ def test_stat_attributes_bytes(self):
+ try:
+ fname = self.fname.encode(sys.getfilesystemencoding())
+ except UnicodeEncodeError:
+ self.skipTest("cannot encode %a for the filesystem" % self.fname)
+ self.check_stat_attributes(fname)
def test_statvfs_attributes(self):
if not hasattr(os, "statvfs"):
@@ -374,12 +406,17 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
def setUp(self):
self.__save = dict(os.environ)
+ if os.supports_bytes_environ:
+ self.__saveb = dict(os.environb)
for key, value in self._reference().items():
os.environ[key] = value
def tearDown(self):
os.environ.clear()
os.environ.update(self.__save)
+ if os.supports_bytes_environ:
+ os.environb.clear()
+ os.environb.update(self.__saveb)
def _reference(self):
return {"KEY1":"VALUE1", "KEY2":"VALUE2", "KEY3":"VALUE3"}
@@ -422,9 +459,73 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
def test___repr__(self):
"""Check that the repr() of os.environ looks like environ({...})."""
env = os.environ
- self.assertTrue(isinstance(env.data, dict))
- self.assertEqual(repr(env), 'environ({!r})'.format(env.data))
+ self.assertEqual(repr(env), 'environ({{{}}})'.format(', '.join(
+ '{!r}: {!r}'.format(key, value)
+ for key, value in env.items())))
+
+ def test_get_exec_path(self):
+ defpath_list = os.defpath.split(os.pathsep)
+ test_path = ['/monty', '/python', '', '/flying/circus']
+ test_env = {'PATH': os.pathsep.join(test_path)}
+ saved_environ = os.environ
+ try:
+ os.environ = dict(test_env)
+ # Test that defaulting to os.environ works.
+ self.assertSequenceEqual(test_path, os.get_exec_path())
+ self.assertSequenceEqual(test_path, os.get_exec_path(env=None))
+ finally:
+ os.environ = saved_environ
+
+ # No PATH environment variable
+ self.assertSequenceEqual(defpath_list, os.get_exec_path({}))
+ # Empty PATH environment variable
+ self.assertSequenceEqual(('',), os.get_exec_path({'PATH':''}))
+ # Supplied PATH environment variable
+ self.assertSequenceEqual(test_path, os.get_exec_path(test_env))
+
+ if os.supports_bytes_environ:
+ # env cannot contain 'PATH' and b'PATH' keys
+ try:
+ # ignore BytesWarning warning
+ with warnings.catch_warnings(record=True):
+ mixed_env = {'PATH': '1', b'PATH': b'2'}
+ except BytesWarning:
+ # mixed_env cannot be created with python -bb
+ pass
+ else:
+ self.assertRaises(ValueError, os.get_exec_path, mixed_env)
+
+ # bytes key and/or value
+ self.assertSequenceEqual(os.get_exec_path({b'PATH': b'abc'}),
+ ['abc'])
+ self.assertSequenceEqual(os.get_exec_path({b'PATH': 'abc'}),
+ ['abc'])
+ self.assertSequenceEqual(os.get_exec_path({'PATH': b'abc'}),
+ ['abc'])
+
+ @unittest.skipUnless(os.supports_bytes_environ,
+ "os.environb required for this test.")
+ def test_environb(self):
+ # os.environ -> os.environb
+ value = 'euro\u20ac'
+ try:
+ value_bytes = value.encode(sys.getfilesystemencoding(),
+ 'surrogateescape')
+ except UnicodeEncodeError:
+ msg = "U+20AC character is not encodable to %s" % (
+ sys.getfilesystemencoding(),)
+ self.skipTest(msg)
+ os.environ['unicode'] = value
+ self.assertEqual(os.environ['unicode'], value)
+ self.assertEqual(os.environb[b'unicode'], value_bytes)
+
+ # os.environb -> os.environ
+ value = b'\xff'
+ os.environb[b'bytes'] = value
+ self.assertEqual(os.environb[b'bytes'], value)
+ value_str = value.decode(sys.getfilesystemencoding(), 'surrogateescape')
+ self.assertEqual(os.environ['bytes'], value_str)
class WalkTests(unittest.TestCase):
"""Tests for os.walk()."""
@@ -464,7 +565,7 @@ class WalkTests(unittest.TestCase):
f = open(path, "w")
f.write("I'm " + path + " and proud of it. Blame test_os.\n")
f.close()
- if hasattr(os, "symlink"):
+ if support.can_symlink():
os.symlink(os.path.abspath(t2_path), link_path)
sub2_tree = (sub2_path, ["link"], ["tmp3"])
else:
@@ -508,7 +609,7 @@ class WalkTests(unittest.TestCase):
self.assertEqual(all[flipped + 1], (sub1_path, ["SUB11"], ["tmp2"]))
self.assertEqual(all[2 - 2 * flipped], sub2_tree)
- if hasattr(os, "symlink"):
+ if support.can_symlink():
# Walk, following symlinks.
for root, dirs, files in os.walk(walk_path, followlinks=True):
if root == link_path:
@@ -553,6 +654,28 @@ class MakedirTests(unittest.TestCase):
'dir5', 'dir6')
os.makedirs(path)
+ def test_exist_ok_existing_directory(self):
+ path = os.path.join(support.TESTFN, 'dir1')
+ mode = 0o777
+ old_mask = os.umask(0o022)
+ os.makedirs(path, mode)
+ self.assertRaises(OSError, os.makedirs, path, mode)
+ self.assertRaises(OSError, os.makedirs, path, mode, exist_ok=False)
+ self.assertRaises(OSError, os.makedirs, path, 0o776, exist_ok=True)
+ os.makedirs(path, mode=mode, exist_ok=True)
+ os.umask(old_mask)
+
+ def test_exist_ok_existing_regular_file(self):
+ base = support.TESTFN
+ path = os.path.join(support.TESTFN, 'dir1')
+ f = open(path, 'w')
+ f.write('abc')
+ f.close()
+ self.assertRaises(OSError, os.makedirs, path)
+ self.assertRaises(OSError, os.makedirs, path, exist_ok=False)
+ self.assertRaises(OSError, os.makedirs, path, exist_ok=True)
+ os.remove(path)
+
def tearDown(self):
path = os.path.join(support.TESTFN, 'dir1', 'dir2', 'dir3',
'dir4', 'dir5', 'dir6')
@@ -583,6 +706,39 @@ class URandomTests(unittest.TestCase):
except NotImplementedError:
pass
+@contextlib.contextmanager
+def _execvpe_mockup(defpath=None):
+ """
+ Stubs out execv and execve functions when used as context manager.
+ Records exec calls. The mock execv and execve functions always raise an
+ exception as they would normally never return.
+ """
+ # A list of tuples containing (function name, first arg, args)
+ # of calls to execv or execve that have been made.
+ calls = []
+
+ def mock_execv(name, *args):
+ calls.append(('execv', name, args))
+ raise RuntimeError("execv called")
+
+ def mock_execve(name, *args):
+ calls.append(('execve', name, args))
+ raise OSError(errno.ENOTDIR, "execve called")
+
+ try:
+ orig_execv = os.execv
+ orig_execve = os.execve
+ orig_defpath = os.defpath
+ os.execv = mock_execv
+ os.execve = mock_execve
+ if defpath is not None:
+ os.defpath = defpath
+ yield calls
+ finally:
+ os.execv = orig_execv
+ os.execve = orig_execve
+ os.defpath = orig_defpath
+
class ExecTests(unittest.TestCase):
@unittest.skipIf(USING_LINUXTHREADS,
"avoid triggering a linuxthreads bug: see issue #4970")
@@ -593,13 +749,60 @@ class ExecTests(unittest.TestCase):
def test_execvpe_with_bad_arglist(self):
self.assertRaises(ValueError, os.execvpe, 'notepad', [], None)
-class ArgTests(unittest.TestCase):
- def test_bytearray(self):
- # Issue #7561: posix module didn't release bytearray exports properly.
- b = bytearray(os.sep.encode('ascii'))
- self.assertRaises(OSError, os.mkdir, b)
- # Check object is still resizable.
- b[:] = b''
+ @unittest.skipUnless(hasattr(os, '_execvpe'),
+ "No internal os._execvpe function to test.")
+ def _test_internal_execvpe(self, test_type):
+ program_path = os.sep + 'absolutepath'
+ if test_type is bytes:
+ program = b'executable'
+ fullpath = os.path.join(os.fsencode(program_path), program)
+ native_fullpath = fullpath
+ arguments = [b'progname', 'arg1', 'arg2']
+ else:
+ program = 'executable'
+ arguments = ['progname', 'arg1', 'arg2']
+ fullpath = os.path.join(program_path, program)
+ if os.name != "nt":
+ native_fullpath = os.fsencode(fullpath)
+ else:
+ native_fullpath = fullpath
+ env = {'spam': 'beans'}
+
+ # test os._execvpe() with an absolute path
+ with _execvpe_mockup() as calls:
+ self.assertRaises(RuntimeError,
+ os._execvpe, fullpath, arguments)
+ self.assertEqual(len(calls), 1)
+ self.assertEqual(calls[0], ('execv', fullpath, (arguments,)))
+
+ # test os._execvpe() with a relative path:
+ # os.get_exec_path() returns defpath
+ with _execvpe_mockup(defpath=program_path) as calls:
+ self.assertRaises(OSError,
+ os._execvpe, program, arguments, env=env)
+ self.assertEqual(len(calls), 1)
+ self.assertSequenceEqual(calls[0],
+ ('execve', native_fullpath, (arguments, env)))
+
+ # test os._execvpe() with a relative path:
+ # os.get_exec_path() reads the 'PATH' variable
+ with _execvpe_mockup() as calls:
+ env_path = env.copy()
+ if test_type is bytes:
+ env_path[b'PATH'] = program_path
+ else:
+ env_path['PATH'] = program_path
+ self.assertRaises(OSError,
+ os._execvpe, program, arguments, env=env_path)
+ self.assertEqual(len(calls), 1)
+ self.assertSequenceEqual(calls[0],
+ ('execve', native_fullpath, (arguments, env_path)))
+
+ def test_internal_execvpe_str(self):
+ self._test_internal_execvpe(str)
+ if os.name != "nt":
+ self._test_internal_execvpe(bytes)
+
class Win32ErrorTests(unittest.TestCase):
def test_rename(self):
@@ -703,6 +906,42 @@ class TestInvalidFD(unittest.TestCase):
if hasattr(os, "write"):
self.check(os.write, b" ")
+
+class LinkTests(unittest.TestCase):
+ def setUp(self):
+ self.file1 = support.TESTFN
+ self.file2 = os.path.join(support.TESTFN + "2")
+
+ def tearDown(self):
+ for file in (self.file1, self.file2):
+ if os.path.exists(file):
+ os.unlink(file)
+
+ def _test_link(self, file1, file2):
+ with open(file1, "w") as f1:
+ f1.write("test")
+
+ os.link(file1, file2)
+ with open(file1, "r") as f1, open(file2, "r") as f2:
+ self.assertTrue(os.path.sameopenfile(f1.fileno(), f2.fileno()))
+
+ def test_link(self):
+ self._test_link(self.file1, self.file2)
+
+ def test_link_bytes(self):
+ self._test_link(bytes(self.file1, sys.getfilesystemencoding()),
+ bytes(self.file2, sys.getfilesystemencoding()))
+
+ def test_unicode_name(self):
+ try:
+ os.fsencode("\xf1")
+ except UnicodeError:
+ raise unittest.SkipTest("Unable to encode for this platform.")
+
+ self.file1 += "\xf1"
+ self.file2 = self.file1 + "2"
+ self._test_link(self.file1, self.file2)
+
if sys.platform != 'win32':
class Win32ErrorTests(unittest.TestCase):
pass
@@ -742,7 +981,6 @@ if sys.platform != 'win32':
def test_setreuid_neg1(self):
# Needs to accept -1. We run this in a subprocess to avoid
# altering the test runner's process state (issue8045).
- import subprocess
subprocess.check_call([
sys.executable, '-c',
'import os,sys;os.setreuid(-1,-1);sys.exit(0)'])
@@ -757,34 +995,51 @@ if sys.platform != 'win32':
def test_setregid_neg1(self):
# Needs to accept -1. We run this in a subprocess to avoid
# altering the test runner's process state (issue8045).
- import subprocess
subprocess.check_call([
sys.executable, '-c',
'import os,sys;os.setregid(-1,-1);sys.exit(0)'])
- @unittest.skipIf(sys.platform == 'darwin', "tests don't apply to OS X")
class Pep383Tests(unittest.TestCase):
- filenames = [b'foo\xf6bar', 'foo\xf6bar'.encode("utf-8")]
-
def setUp(self):
- self.fsencoding = sys.getfilesystemencoding()
- sys.setfilesystemencoding("utf-8")
- self.dir = support.TESTFN
- self.bdir = self.dir.encode("utf-8", "surrogateescape")
+ if support.TESTFN_UNENCODABLE:
+ self.dir = support.TESTFN_UNENCODABLE
+ else:
+ self.dir = support.TESTFN
+ self.bdir = os.fsencode(self.dir)
+
+ bytesfn = []
+ def add_filename(fn):
+ try:
+ fn = os.fsencode(fn)
+ except UnicodeEncodeError:
+ return
+ bytesfn.append(fn)
+ add_filename(support.TESTFN_UNICODE)
+ if support.TESTFN_UNENCODABLE:
+ add_filename(support.TESTFN_UNENCODABLE)
+ if not bytesfn:
+ self.skipTest("couldn't create any non-ascii filename")
+
+ self.unicodefn = set()
os.mkdir(self.dir)
- self.unicodefn = []
- for fn in self.filenames:
- f = open(os.path.join(self.bdir, fn), "w")
- f.close()
- self.unicodefn.append(fn.decode("utf-8", "surrogateescape"))
+ try:
+ for fn in bytesfn:
+ f = open(os.path.join(self.bdir, fn), "w")
+ f.close()
+ fn = os.fsdecode(fn)
+ if fn in self.unicodefn:
+ raise ValueError("duplicate filename")
+ self.unicodefn.add(fn)
+ except:
+ shutil.rmtree(self.dir)
+ raise
def tearDown(self):
shutil.rmtree(self.dir)
- sys.setfilesystemencoding(self.fsencoding)
def test_listdir(self):
- expected = set(self.unicodefn)
- found = set(os.listdir(support.TESTFN))
+ expected = self.unicodefn
+ found = set(os.listdir(self.dir))
self.assertEqual(found, expected)
def test_open(self):
@@ -801,9 +1056,232 @@ else:
class Pep383Tests(unittest.TestCase):
pass
+@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
+class Win32KillTests(unittest.TestCase):
+ def _kill(self, sig):
+ # Start sys.executable as a subprocess and communicate from the
+ # subprocess to the parent that the interpreter is ready. When it
+ # becomes ready, send *sig* via os.kill to the subprocess and check
+ # that the return code is equal to *sig*.
+ import ctypes
+ from ctypes import wintypes
+ import msvcrt
+
+ # Since we can't access the contents of the process' stdout until the
+ # process has exited, use PeekNamedPipe to see what's inside stdout
+ # without waiting. This is done so we can tell that the interpreter
+ # is started and running at a point where it could handle a signal.
+ PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe
+ PeekNamedPipe.restype = wintypes.BOOL
+ PeekNamedPipe.argtypes = (wintypes.HANDLE, # Pipe handle
+ ctypes.POINTER(ctypes.c_char), # stdout buf
+ wintypes.DWORD, # Buffer size
+ ctypes.POINTER(wintypes.DWORD), # bytes read
+ ctypes.POINTER(wintypes.DWORD), # bytes avail
+ ctypes.POINTER(wintypes.DWORD)) # bytes left
+ msg = "running"
+ proc = subprocess.Popen([sys.executable, "-c",
+ "import sys;"
+ "sys.stdout.write('{}');"
+ "sys.stdout.flush();"
+ "input()".format(msg)],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ stdin=subprocess.PIPE)
+ self.addCleanup(proc.stdout.close)
+ self.addCleanup(proc.stderr.close)
+ self.addCleanup(proc.stdin.close)
+
+ count, max = 0, 100
+ while count < max and proc.poll() is None:
+ # Create a string buffer to store the result of stdout from the pipe
+ buf = ctypes.create_string_buffer(len(msg))
+ # Obtain the text currently in proc.stdout
+ # Bytes read/avail/left are left as NULL and unused
+ rslt = PeekNamedPipe(msvcrt.get_osfhandle(proc.stdout.fileno()),
+ buf, ctypes.sizeof(buf), None, None, None)
+ self.assertNotEqual(rslt, 0, "PeekNamedPipe failed")
+ if buf.value:
+ self.assertEqual(msg, buf.value.decode())
+ break
+ time.sleep(0.1)
+ count += 1
+ else:
+ self.fail("Did not receive communication from the subprocess")
+
+ os.kill(proc.pid, sig)
+ self.assertEqual(proc.wait(), sig)
+
+ def test_kill_sigterm(self):
+ # SIGTERM doesn't mean anything special, but make sure it works
+ self._kill(signal.SIGTERM)
+
+ def test_kill_int(self):
+ # os.kill on Windows can take an int which gets set as the exit code
+ self._kill(100)
+
+ def _kill_with_event(self, event, name):
+ tagname = "test_os_%s" % uuid.uuid1()
+ m = mmap.mmap(-1, 1, tagname)
+ m[0] = 0
+ # Run a script which has console control handling enabled.
+ proc = subprocess.Popen([sys.executable,
+ os.path.join(os.path.dirname(__file__),
+ "win_console_handler.py"), tagname],
+ creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
+ # Let the interpreter startup before we send signals. See #3137.
+ count, max = 0, 100
+ while count < max and proc.poll() is None:
+ if m[0] == 1:
+ break
+ time.sleep(0.1)
+ count += 1
+ else:
+ # Forcefully kill the process if we weren't able to signal it.
+ os.kill(proc.pid, signal.SIGINT)
+ self.fail("Subprocess didn't finish initialization")
+ os.kill(proc.pid, event)
+ # proc.send_signal(event) could also be done here.
+ # Allow time for the signal to be passed and the process to exit.
+ time.sleep(0.5)
+ if not proc.poll():
+ # Forcefully kill the process if we weren't able to signal it.
+ os.kill(proc.pid, signal.SIGINT)
+ self.fail("subprocess did not stop on {}".format(name))
+
+ @unittest.skip("subprocesses aren't inheriting CTRL+C property")
+ def test_CTRL_C_EVENT(self):
+ from ctypes import wintypes
+ import ctypes
+
+ # Make a NULL value by creating a pointer with no argument.
+ NULL = ctypes.POINTER(ctypes.c_int)()
+ SetConsoleCtrlHandler = ctypes.windll.kernel32.SetConsoleCtrlHandler
+ SetConsoleCtrlHandler.argtypes = (ctypes.POINTER(ctypes.c_int),
+ wintypes.BOOL)
+ SetConsoleCtrlHandler.restype = wintypes.BOOL
+
+ # Calling this with NULL and FALSE causes the calling process to
+ # handle CTRL+C, rather than ignore it. This property is inherited
+ # by subprocesses.
+ SetConsoleCtrlHandler(NULL, 0)
+
+ self._kill_with_event(signal.CTRL_C_EVENT, "CTRL_C_EVENT")
+
+ def test_CTRL_BREAK_EVENT(self):
+ self._kill_with_event(signal.CTRL_BREAK_EVENT, "CTRL_BREAK_EVENT")
+
+
+@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
+@support.skip_unless_symlink
+class Win32SymlinkTests(unittest.TestCase):
+ filelink = 'filelinktest'
+ filelink_target = os.path.abspath(__file__)
+ dirlink = 'dirlinktest'
+ dirlink_target = os.path.dirname(filelink_target)
+ missing_link = 'missing link'
+
+ def setUp(self):
+ assert os.path.exists(self.dirlink_target)
+ assert os.path.exists(self.filelink_target)
+ assert not os.path.exists(self.dirlink)
+ assert not os.path.exists(self.filelink)
+ assert not os.path.exists(self.missing_link)
+
+ def tearDown(self):
+ if os.path.exists(self.filelink):
+ os.remove(self.filelink)
+ if os.path.exists(self.dirlink):
+ os.rmdir(self.dirlink)
+ if os.path.lexists(self.missing_link):
+ os.remove(self.missing_link)
+
+ def test_directory_link(self):
+ os.symlink(self.dirlink_target, self.dirlink)
+ self.assertTrue(os.path.exists(self.dirlink))
+ self.assertTrue(os.path.isdir(self.dirlink))
+ self.assertTrue(os.path.islink(self.dirlink))
+ self.check_stat(self.dirlink, self.dirlink_target)
+
+ def test_file_link(self):
+ os.symlink(self.filelink_target, self.filelink)
+ self.assertTrue(os.path.exists(self.filelink))
+ self.assertTrue(os.path.isfile(self.filelink))
+ self.assertTrue(os.path.islink(self.filelink))
+ self.check_stat(self.filelink, self.filelink_target)
+
+ def _create_missing_dir_link(self):
+ 'Create a "directory" link to a non-existent target'
+ linkname = self.missing_link
+ if os.path.lexists(linkname):
+ os.remove(linkname)
+ target = r'c:\\target does not exist.29r3c740'
+ assert not os.path.exists(target)
+ target_is_dir = True
+ os.symlink(target, linkname, target_is_dir)
+
+ def test_remove_directory_link_to_missing_target(self):
+ self._create_missing_dir_link()
+ # For compatibility with Unix, os.remove will check the
+ # directory status and call RemoveDirectory if the symlink
+ # was created with target_is_dir==True.
+ os.remove(self.missing_link)
+
+ @unittest.skip("currently fails; consider for improvement")
+ def test_isdir_on_directory_link_to_missing_target(self):
+ self._create_missing_dir_link()
+ # consider having isdir return true for directory links
+ self.assertTrue(os.path.isdir(self.missing_link))
+
+ @unittest.skip("currently fails; consider for improvement")
+ def test_rmdir_on_directory_link_to_missing_target(self):
+ self._create_missing_dir_link()
+ # consider allowing rmdir to remove directory links
+ os.rmdir(self.missing_link)
+
+ def check_stat(self, link, target):
+ self.assertEqual(os.stat(link), os.stat(target))
+ self.assertNotEqual(os.lstat(link), os.stat(link))
+
+
+class FSEncodingTests(unittest.TestCase):
+ def test_nop(self):
+ self.assertEqual(os.fsencode(b'abc\xff'), b'abc\xff')
+ self.assertEqual(os.fsdecode('abc\u0141'), 'abc\u0141')
+
+ def test_identity(self):
+ # assert fsdecode(fsencode(x)) == x
+ for fn in ('unicode\u0141', 'latin\xe9', 'ascii'):
+ try:
+ bytesfn = os.fsencode(fn)
+ except UnicodeEncodeError:
+ continue
+ self.assertEqual(os.fsdecode(bytesfn), fn)
+
+
+class PidTests(unittest.TestCase):
+ @unittest.skipUnless(hasattr(os, 'getppid'), "test needs os.getppid")
+ def test_getppid(self):
+ p = subprocess.Popen([sys.executable, '-c',
+ 'import os; print(os.getppid())'],
+ stdout=subprocess.PIPE)
+ stdout, _ = p.communicate()
+ # We are the parent of our subprocess
+ self.assertEqual(int(stdout), os.getpid())
+
+
+# The introduction of this TestCase caused at least two different errors on
+# *nix buildbots. Temporarily skip this to let the buildbots move along.
+@unittest.skip("Skip due to platform/environment differences on *NIX buildbots")
+@unittest.skipUnless(hasattr(os, 'getlogin'), "test needs os.getlogin")
+class LoginTests(unittest.TestCase):
+ def test_getlogin(self):
+ user_name = os.getlogin()
+ self.assertNotEqual(len(user_name), 0)
+
+
def test_main():
support.run_unittest(
- ArgTests,
FileTests,
StatAttributeTests,
EnvironTests,
@@ -815,7 +1293,13 @@ def test_main():
Win32ErrorTests,
TestInvalidFD,
PosixUidGidTests,
- Pep383Tests
+ Pep383Tests,
+ Win32KillTests,
+ Win32SymlinkTests,
+ FSEncodingTests,
+ PidTests,
+ LoginTests,
+ LinkTests,
)
if __name__ == "__main__":
diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py
index 5dea640d89..9cb89d69a6 100644
--- a/Lib/test/test_ossaudiodev.py
+++ b/Lib/test/test_ossaudiodev.py
@@ -162,11 +162,13 @@ class OSSAudioDevTests(unittest.TestCase):
def test_mixer_methods(self):
# Issue #8139: ossaudiodev didn't initialize its types properly,
# therefore some methods were unavailable.
- mixer = ossaudiodev.openmixer()
- try:
+ with ossaudiodev.openmixer() as mixer:
self.assertGreaterEqual(mixer.fileno(), 0)
- finally:
- mixer.close()
+
+ def test_with(self):
+ with ossaudiodev.open('w') as dsp:
+ pass
+ self.assertTrue(dsp.closed)
def test_main():
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index 9ab4171bda..020acd500f 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -1,5 +1,4 @@
import parser
-import os
import unittest
import sys
import operator
@@ -34,7 +33,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
code = suite.compile()
scope = {}
exec(code, {}, scope)
- self.assertTrue(isinstance(scope["x"], str))
+ self.assertIsInstance(scope["x"], str)
def check_suite(self, s):
self.roundtrip(parser.suite, s)
@@ -227,7 +226,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def test_position(self):
# An absolutely minimal test of position information. Better
# tests would be a big project.
- code = "def f(x):\n return x + 1\n"
+ code = "def f(x):\n return x + 1"
st1 = parser.suite(code)
st2 = st1.totuple(line_info=1, col_info=1)
@@ -261,6 +260,12 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
(0, '', 2, -1)],
terminals)
+ def test_extended_unpacking(self):
+ self.check_suite("*a = y")
+ self.check_suite("x, *b, = m")
+ self.check_suite("[*a, *b] = y")
+ self.check_suite("for [*x, b] in x: pass")
+
#
# Second, we take *invalid* trees and make sure we get ParserError
@@ -512,6 +517,16 @@ class CompileTestCase(unittest.TestCase):
st = parser.suite('a = "\\u1"')
self.assertRaises(SyntaxError, parser.compilest, st)
+ def test_issue_9011(self):
+ # Issue 9011: compilation of an unary minus expression changed
+ # the meaning of the ST, so that a second compilation produced
+ # incorrect results.
+ st = parser.expr('-3')
+ code1 = parser.compilest(st)
+ self.assertEqual(eval(code1), -3)
+ code2 = parser.compilest(st)
+ self.assertEqual(eval(code2), -3)
+
class ParserStackLimitTestCase(unittest.TestCase):
"""try to push the parser to/over its limits.
see http://bugs.python.org/issue1881 for a discussion
@@ -529,6 +544,7 @@ class ParserStackLimitTestCase(unittest.TestCase):
e = self._nested_expression(100)
print("Expecting 's_push: parser stack overflow' in next line",
file=sys.stderr)
+ sys.stderr.flush()
self.assertRaises(MemoryError, parser.expr, e)
class STObjectTestCase(unittest.TestCase):
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 2589141615..d861df52bb 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -1,11 +1,10 @@
-# A test suite for pdb; at the moment, this only validates skipping of
-# specified test modules (RFE #5142).
+# A test suite for pdb; not very comprehensive at the moment.
import imp
-import os
+import pdb
import sys
-import doctest
-import tempfile
+import unittest
+import subprocess
from test import support
# This little helper class is essential for testing pdb under doctest.
@@ -30,7 +29,7 @@ def test_pdb_displayhook():
"""This tests the custom displayhook for pdb.
>>> def test_function(foo, bar):
- ... import pdb; pdb.Pdb().set_trace()
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
... pass
>>> with PdbTestInput([
@@ -54,11 +53,122 @@ def test_pdb_displayhook():
(Pdb) continue
"""
+
+def test_pdb_basic_commands():
+ """Test the basic commands of pdb.
+
+ >>> def test_function_2(foo, bar='default'):
+ ... print(foo)
+ ... for i in range(5):
+ ... print(i)
+ ... print(bar)
+ ... for i in range(10):
+ ... never_executed
+ ... print('after for')
+ ... print('...')
+ ... return foo.upper()
+
+ >>> def test_function():
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
+ ... ret = test_function_2('baz')
+ ... print(ret)
+
+ >>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
+ ... 'step', # entering the function call
+ ... 'args', # display function args
+ ... 'list', # list function source
+ ... 'bt', # display backtrace
+ ... 'up', # step up to test_function()
+ ... 'down', # step down to test_function_2() again
+ ... 'next', # stepping to print(foo)
+ ... 'next', # stepping to the for loop
+ ... 'step', # stepping into the for loop
+ ... 'until', # continuing until out of the for loop
+ ... 'next', # executing the print(bar)
+ ... 'jump 8', # jump over second for loop
+ ... 'return', # return out of function
+ ... 'retval', # display return value
+ ... 'continue',
+ ... ]):
+ ... test_function()
+ > <doctest test.test_pdb.test_pdb_basic_commands[1]>(3)test_function()
+ -> ret = test_function_2('baz')
+ (Pdb) step
+ --Call--
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
+ -> def test_function_2(foo, bar='default'):
+ (Pdb) args
+ foo = 'baz'
+ bar = 'default'
+ (Pdb) list
+ 1 -> def test_function_2(foo, bar='default'):
+ 2 print(foo)
+ 3 for i in range(5):
+ 4 print(i)
+ 5 print(bar)
+ 6 for i in range(10):
+ 7 never_executed
+ 8 print('after for')
+ 9 print('...')
+ 10 return foo.upper()
+ [EOF]
+ (Pdb) bt
+ ...
+ <doctest test.test_pdb.test_pdb_basic_commands[2]>(18)<module>()
+ -> test_function()
+ <doctest test.test_pdb.test_pdb_basic_commands[1]>(3)test_function()
+ -> ret = test_function_2('baz')
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
+ -> def test_function_2(foo, bar='default'):
+ (Pdb) up
+ > <doctest test.test_pdb.test_pdb_basic_commands[1]>(3)test_function()
+ -> ret = test_function_2('baz')
+ (Pdb) down
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
+ -> def test_function_2(foo, bar='default'):
+ (Pdb) next
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(2)test_function_2()
+ -> print(foo)
+ (Pdb) next
+ baz
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(3)test_function_2()
+ -> for i in range(5):
+ (Pdb) step
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(4)test_function_2()
+ -> print(i)
+ (Pdb) until
+ 0
+ 1
+ 2
+ 3
+ 4
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(5)test_function_2()
+ -> print(bar)
+ (Pdb) next
+ default
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(6)test_function_2()
+ -> for i in range(10):
+ (Pdb) jump 8
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(8)test_function_2()
+ -> print('after for')
+ (Pdb) return
+ after for
+ ...
+ --Return--
+ > <doctest test.test_pdb.test_pdb_basic_commands[0]>(10)test_function_2()->'BAZ'
+ -> return foo.upper()
+ (Pdb) retval
+ 'BAZ'
+ (Pdb) continue
+ BAZ
+ """
+
+
def test_pdb_breakpoint_commands():
"""Test basic commands related to breakpoints.
>>> def test_function():
- ... import pdb; pdb.Pdb().set_trace()
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
... print(1)
... print(2)
... print(3)
@@ -106,9 +216,11 @@ def test_pdb_breakpoint_commands():
(Pdb) break 3
Breakpoint 1 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:3
(Pdb) disable 1
+ Disabled breakpoint 1 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:3
(Pdb) ignore 1 10
Will ignore next 10 crossings of breakpoint 1.
(Pdb) condition 1 1 < 2
+ New condition set for breakpoint 1.
(Pdb) break 4
Breakpoint 2 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
(Pdb) break 4
@@ -121,7 +233,7 @@ def test_pdb_breakpoint_commands():
2 breakpoint keep yes at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
3 breakpoint keep yes at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
(Pdb) clear 3
- Deleted breakpoint 3
+ Deleted breakpoint 3 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
(Pdb) break
Num Type Disp Enb Where
1 breakpoint keep no at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:3
@@ -131,8 +243,9 @@ def test_pdb_breakpoint_commands():
(Pdb) condition 1
Breakpoint 1 is now unconditional.
(Pdb) enable 1
+ Enabled breakpoint 1 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:3
(Pdb) clear 1
- Deleted breakpoint 1
+ Deleted breakpoint 1 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:3
(Pdb) commands 2
(com) print 42
(com) end
@@ -143,11 +256,12 @@ def test_pdb_breakpoint_commands():
-> print(2)
(Pdb) clear
Clear all breaks? y
+ Deleted breakpoint 2 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
(Pdb) tbreak 5
Breakpoint 4 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:5
(Pdb) continue
2
- Deleted breakpoint 4
+ Deleted breakpoint 4 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:5
> <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>(5)test_function()
-> print(3)
(Pdb) break
@@ -156,12 +270,177 @@ def test_pdb_breakpoint_commands():
4
"""
+
+def do_nothing():
+ pass
+
+def do_something():
+ print(42)
+
+def test_list_commands():
+ """Test the list and source commands of pdb.
+
+ >>> def test_function_2(foo):
+ ... import test.test_pdb
+ ... test.test_pdb.do_nothing()
+ ... 'some...'
+ ... 'more...'
+ ... 'code...'
+ ... 'to...'
+ ... 'make...'
+ ... 'a...'
+ ... 'long...'
+ ... 'listing...'
+ ... 'useful...'
+ ... '...'
+ ... '...'
+ ... return foo
+
+ >>> def test_function():
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
+ ... ret = test_function_2('baz')
+
+ >>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
+ ... 'list', # list first function
+ ... 'step', # step into second function
+ ... 'list', # list second function
+ ... 'list', # continue listing to EOF
+ ... 'list 1,3', # list specific lines
+ ... 'list x', # invalid argument
+ ... 'next', # step to import
+ ... 'next', # step over import
+ ... 'step', # step into do_nothing
+ ... 'longlist', # list all lines
+ ... 'source do_something', # list all lines of function
+ ... 'source fooxxx', # something that doesn't exit
+ ... 'continue',
+ ... ]):
+ ... test_function()
+ > <doctest test.test_pdb.test_list_commands[1]>(3)test_function()
+ -> ret = test_function_2('baz')
+ (Pdb) list
+ 1 def test_function():
+ 2 import pdb; pdb.Pdb(nosigint=True).set_trace()
+ 3 -> ret = test_function_2('baz')
+ [EOF]
+ (Pdb) step
+ --Call--
+ > <doctest test.test_pdb.test_list_commands[0]>(1)test_function_2()
+ -> def test_function_2(foo):
+ (Pdb) list
+ 1 -> def test_function_2(foo):
+ 2 import test.test_pdb
+ 3 test.test_pdb.do_nothing()
+ 4 'some...'
+ 5 'more...'
+ 6 'code...'
+ 7 'to...'
+ 8 'make...'
+ 9 'a...'
+ 10 'long...'
+ 11 'listing...'
+ (Pdb) list
+ 12 'useful...'
+ 13 '...'
+ 14 '...'
+ 15 return foo
+ [EOF]
+ (Pdb) list 1,3
+ 1 -> def test_function_2(foo):
+ 2 import test.test_pdb
+ 3 test.test_pdb.do_nothing()
+ (Pdb) list x
+ *** ...
+ (Pdb) next
+ > <doctest test.test_pdb.test_list_commands[0]>(2)test_function_2()
+ -> import test.test_pdb
+ (Pdb) next
+ > <doctest test.test_pdb.test_list_commands[0]>(3)test_function_2()
+ -> test.test_pdb.do_nothing()
+ (Pdb) step
+ --Call--
+ > ...test_pdb.py(...)do_nothing()
+ -> def do_nothing():
+ (Pdb) longlist
+ ... -> def do_nothing():
+ ... pass
+ (Pdb) source do_something
+ ... def do_something():
+ ... print(42)
+ (Pdb) source fooxxx
+ *** ...
+ (Pdb) continue
+ """
+
+
+def test_post_mortem():
+ """Test post mortem traceback debugging.
+
+ >>> def test_function_2():
+ ... try:
+ ... 1/0
+ ... finally:
+ ... print('Exception!')
+
+ >>> def test_function():
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
+ ... test_function_2()
+ ... print('Not reached.')
+
+ >>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
+ ... 'next', # step over exception-raising call
+ ... 'bt', # get a backtrace
+ ... 'list', # list code of test_function()
+ ... 'down', # step into test_function_2()
+ ... 'list', # list code of test_function_2()
+ ... 'continue',
+ ... ]):
+ ... try:
+ ... test_function()
+ ... except ZeroDivisionError:
+ ... print('Correctly reraised.')
+ > <doctest test.test_pdb.test_post_mortem[1]>(3)test_function()
+ -> test_function_2()
+ (Pdb) next
+ Exception!
+ ZeroDivisionError: division by zero
+ > <doctest test.test_pdb.test_post_mortem[1]>(3)test_function()
+ -> test_function_2()
+ (Pdb) bt
+ ...
+ <doctest test.test_pdb.test_post_mortem[2]>(10)<module>()
+ -> test_function()
+ > <doctest test.test_pdb.test_post_mortem[1]>(3)test_function()
+ -> test_function_2()
+ <doctest test.test_pdb.test_post_mortem[0]>(3)test_function_2()
+ -> 1/0
+ (Pdb) list
+ 1 def test_function():
+ 2 import pdb; pdb.Pdb(nosigint=True).set_trace()
+ 3 -> test_function_2()
+ 4 print('Not reached.')
+ [EOF]
+ (Pdb) down
+ > <doctest test.test_pdb.test_post_mortem[0]>(3)test_function_2()
+ -> 1/0
+ (Pdb) list
+ 1 def test_function_2():
+ 2 try:
+ 3 >> 1/0
+ 4 finally:
+ 5 -> print('Exception!')
+ [EOF]
+ (Pdb) continue
+ Correctly reraised.
+ """
+
+
def test_pdb_skip_modules():
"""This illustrates the simple case of module skipping.
>>> def skip_module():
... import string
- ... import pdb; pdb.Pdb(skip=['stri*']).set_trace()
+ ... import pdb; pdb.Pdb(skip=['stri*'], nosigint=True).set_trace()
... string.capwords('FOO')
>>> with PdbTestInput([
@@ -190,7 +469,7 @@ def test_pdb_skip_modules_with_callback():
>>> def skip_module():
... def callback():
... return None
- ... import pdb; pdb.Pdb(skip=['module_to_skip*']).set_trace()
+ ... import pdb; pdb.Pdb(skip=['module_to_skip*'], nosigint=True).set_trace()
... mod.foo_pony(callback)
>>> with PdbTestInput([
@@ -231,7 +510,7 @@ def test_pdb_continue_in_bottomframe():
"""Test that "continue" and "next" work properly in bottom frame (issue #5294).
>>> def test_function():
- ... import pdb, sys; inst = pdb.Pdb()
+ ... import pdb, sys; inst = pdb.Pdb(nosigint=True)
... inst.set_trace()
... inst.botframe = sys._getframe() # hackery to get the right botframe
... print(1)
@@ -239,15 +518,7 @@ def test_pdb_continue_in_bottomframe():
... print(3)
... print(4)
- First, need to clear bdb state that might be left over from previous tests.
- Otherwise, the new breakpoints might get assigned different numbers.
-
- >>> from bdb import Breakpoint
- >>> Breakpoint.next = 1
- >>> Breakpoint.bplist = {}
- >>> Breakpoint.bpbynumber = [None]
-
- >>> with PdbTestInput([
+ >>> with PdbTestInput([ # doctest: +ELLIPSIS
... 'next',
... 'break 7',
... 'continue',
@@ -262,7 +533,7 @@ def test_pdb_continue_in_bottomframe():
> <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>(5)test_function()
-> print(1)
(Pdb) break 7
- Breakpoint 1 at <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>:7
+ Breakpoint ... at <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>:7
(Pdb) continue
1
2
@@ -277,10 +548,76 @@ def test_pdb_continue_in_bottomframe():
"""
+def pdb_invoke(method, arg):
+ """Run pdb.method(arg)."""
+ import pdb
+ getattr(pdb.Pdb(nosigint=True), method)(arg)
+
+
+def test_pdb_run_with_incorrect_argument():
+ """Testing run and runeval with incorrect first argument.
+
+ >>> pti = PdbTestInput(['continue',])
+ >>> with pti:
+ ... pdb_invoke('run', lambda x: x)
+ Traceback (most recent call last):
+ TypeError: exec() arg 1 must be a string, bytes or code object
+
+ >>> with pti:
+ ... pdb_invoke('runeval', lambda x: x)
+ Traceback (most recent call last):
+ TypeError: eval() arg 1 must be a string, bytes or code object
+ """
+
+
+def test_pdb_run_with_code_object():
+ """Testing run and runeval with code object as a first argument.
+
+ >>> with PdbTestInput(['step','x', 'continue']): # doctest: +ELLIPSIS
+ ... pdb_invoke('run', compile('x=1', '<string>', 'exec'))
+ > <string>(1)<module>()...
+ (Pdb) step
+ --Return--
+ > <string>(1)<module>()->None
+ (Pdb) x
+ 1
+ (Pdb) continue
+
+ >>> with PdbTestInput(['x', 'continue']):
+ ... x=0
+ ... pdb_invoke('runeval', compile('x+1', '<string>', 'eval'))
+ > <string>(1)<module>()->None
+ (Pdb) x
+ 1
+ (Pdb) continue
+ """
+
+
+class PdbTestCase(unittest.TestCase):
+
+ def test_issue7964(self):
+ # open the file as binary so we can force \r\n newline
+ with open(support.TESTFN, 'wb') as f:
+ f.write(b'print("testing my pdb")\r\n')
+ cmd = [sys.executable, '-m', 'pdb', support.TESTFN]
+ proc = subprocess.Popen(cmd,
+ stdout=subprocess.PIPE,
+ stdin=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ )
+ self.addCleanup(proc.stdout.close)
+ stdout, stderr = proc.communicate(b'quit\n')
+ self.assertNotIn(b'SyntaxError', stdout,
+ "Got a syntax error running test script under PDB")
+
+ def tearDown(self):
+ support.unlink(support.TESTFN)
+
def test_main():
from test import test_pdb
support.run_doctest(test_pdb, verbosity=True)
+ support.run_unittest(PdbTestCase)
if __name__ == '__main__':
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index d1d5874bb7..53719d3a82 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -1,4 +1,5 @@
import dis
+import re
import sys
from io import StringIO
import unittest
@@ -25,9 +26,9 @@ class TestTranforms(unittest.TestCase):
del x
asm = disassemble(unot)
for elem in ('UNARY_NOT', 'POP_JUMP_IF_FALSE'):
- self.assertTrue(elem not in asm)
+ self.assertNotIn(elem, asm)
for elem in ('POP_JUMP_IF_TRUE',):
- self.assertTrue(elem in asm)
+ self.assertIn(elem, asm)
def test_elim_inversion_of_is_or_in(self):
for line, elem in (
@@ -37,7 +38,7 @@ class TestTranforms(unittest.TestCase):
('not a not in b', '(in)',),
):
asm = dis_single(line)
- self.assertTrue(elem in asm)
+ self.assertIn(elem, asm)
def test_global_as_constant(self):
# LOAD_GLOBAL None/True/False --> LOAD_CONST None/True/False
@@ -54,14 +55,14 @@ class TestTranforms(unittest.TestCase):
for func, name in ((f, 'None'), (g, 'True'), (h, 'False')):
asm = disassemble(func)
for elem in ('LOAD_GLOBAL',):
- self.assertTrue(elem not in asm)
+ self.assertNotIn(elem, asm)
for elem in ('LOAD_CONST', '('+name+')'):
- self.assertTrue(elem in asm)
+ self.assertIn(elem, asm)
def f():
'Adding a docstring made this test fail in Py2.5.0'
return None
- self.assertTrue('LOAD_CONST' in disassemble(f))
- self.assertTrue('LOAD_GLOBAL' not in disassemble(f))
+ self.assertIn('LOAD_CONST', disassemble(f))
+ self.assertNotIn('LOAD_GLOBAL', disassemble(f))
def test_while_one(self):
# Skip over: LOAD_CONST trueconst POP_JUMP_IF_FALSE xx
@@ -71,9 +72,9 @@ class TestTranforms(unittest.TestCase):
return list
asm = disassemble(f)
for elem in ('LOAD_CONST', 'POP_JUMP_IF_FALSE'):
- self.assertTrue(elem not in asm)
+ self.assertNotIn(elem, asm)
for elem in ('JUMP_ABSOLUTE',):
- self.assertTrue(elem in asm)
+ self.assertIn(elem, asm)
def test_pack_unpack(self):
for line, elem in (
@@ -82,9 +83,9 @@ class TestTranforms(unittest.TestCase):
('a, b, c = a, b, c', 'ROT_THREE',),
):
asm = dis_single(line)
- self.assertTrue(elem in asm)
- self.assertTrue('BUILD_TUPLE' not in asm)
- self.assertTrue('UNPACK_TUPLE' not in asm)
+ self.assertIn(elem, asm)
+ self.assertNotIn('BUILD_TUPLE', asm)
+ self.assertNotIn('UNPACK_TUPLE', asm)
def test_folding_of_tuples_of_constants(self):
for line, elem in (
@@ -95,8 +96,8 @@ class TestTranforms(unittest.TestCase):
('((1, 2), 3, 4)', '(((1, 2), 3, 4))'),
):
asm = dis_single(line)
- self.assertTrue(elem in asm)
- self.assertTrue('BUILD_TUPLE' not in asm)
+ self.assertIn(elem, asm)
+ self.assertNotIn('BUILD_TUPLE', asm)
# Bug 1053819: Tuple of constants misidentified when presented with:
# . . . opcode_with_arg 100 unary_opcode BUILD_TUPLE 1 . . .
@@ -115,6 +116,54 @@ class TestTranforms(unittest.TestCase):
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
],)
+ def test_folding_of_lists_of_constants(self):
+ for line, elem in (
+ # in/not in constants with BUILD_LIST should be folded to a tuple:
+ ('a in [1,2,3]', '(1, 2, 3)'),
+ ('a not in ["a","b","c"]', "(('a', 'b', 'c'))"),
+ ('a in [None, 1, None]', '((None, 1, None))'),
+ ('a not in [(1, 2), 3, 4]', '(((1, 2), 3, 4))'),
+ ):
+ asm = dis_single(line)
+ self.assertIn(elem, asm)
+ self.assertNotIn('BUILD_LIST', asm)
+
+ def test_folding_of_sets_of_constants(self):
+ for line, elem in (
+ # in/not in constants with BUILD_SET should be folded to a frozenset:
+ ('a in {1,2,3}', frozenset({1, 2, 3})),
+ ('a not in {"a","b","c"}', frozenset({'a', 'c', 'b'})),
+ ('a in {None, 1, None}', frozenset({1, None})),
+ ('a not in {(1, 2), 3, 4}', frozenset({(1, 2), 3, 4})),
+ ('a in {1, 2, 3, 3, 2, 1}', frozenset({1, 2, 3})),
+ ):
+ asm = dis_single(line)
+ self.assertNotIn('BUILD_SET', asm)
+
+ # Verify that the frozenset 'elem' is in the disassembly
+ # The ordering of the elements in repr( frozenset ) isn't
+ # guaranteed, so we jump through some hoops to ensure that we have
+ # the frozenset we expect:
+ self.assertIn('frozenset', asm)
+ # Extract the frozenset literal from the disassembly:
+ m = re.match(r'.*(frozenset\({.*}\)).*', asm, re.DOTALL)
+ self.assertTrue(m)
+ self.assertEqual(eval(m.group(1)), elem)
+
+ # Ensure that the resulting code actually works:
+ def f(a):
+ return a in {1, 2, 3}
+
+ def g(a):
+ return a not in {1, 2, 3}
+
+ self.assertTrue(f(3))
+ self.assertTrue(not f(4))
+
+ self.assertTrue(not g(3))
+ self.assertTrue(g(4))
+
+
def test_folding_of_binops_on_constants(self):
for line, elem in (
('a = 2+3+4', '(9)'), # chained fold
@@ -134,17 +183,17 @@ class TestTranforms(unittest.TestCase):
('a = 13 | 7', '(15)'), # binary or
):
asm = dis_single(line)
- self.assertTrue(elem in asm, asm)
- self.assertTrue('BINARY_' not in asm)
+ self.assertIn(elem, asm, asm)
+ self.assertNotIn('BINARY_', asm)
# Verify that unfoldables are skipped
asm = dis_single('a=2+"b"')
- self.assertTrue('(2)' in asm)
- self.assertTrue("('b')" in asm)
+ self.assertIn('(2)', asm)
+ self.assertIn("('b')", asm)
# Verify that large sequences do not result from folding
asm = dis_single('a="x"*1000')
- self.assertTrue('(1000)' in asm)
+ self.assertIn('(1000)', asm)
def test_binary_subscr_on_unicode(self):
# valid code get optimized
@@ -168,10 +217,11 @@ class TestTranforms(unittest.TestCase):
for line, elem in (
('-0.5', '(-0.5)'), # unary negative
('~-2', '(1)'), # unary invert
+ ('+1', '(1)'), # unary positive
):
asm = dis_single(line)
- self.assertTrue(elem in asm, asm)
- self.assertTrue('UNARY_' not in asm)
+ self.assertIn(elem, asm, asm)
+ self.assertNotIn('UNARY_', asm)
# Verify that unfoldables are skipped
for line, elem in (
@@ -179,16 +229,16 @@ class TestTranforms(unittest.TestCase):
('~"abc"', "('abc')"), # unary invert
):
asm = dis_single(line)
- self.assertTrue(elem in asm, asm)
- self.assertTrue('UNARY_' in asm)
+ self.assertIn(elem, asm, asm)
+ self.assertIn('UNARY_', asm)
def test_elim_extra_return(self):
# RETURN LOAD_CONST None RETURN --> RETURN
def f(x):
return x
asm = disassemble(f)
- self.assertTrue('LOAD_CONST' not in asm)
- self.assertTrue('(None)' not in asm)
+ self.assertNotIn('LOAD_CONST', asm)
+ self.assertNotIn('(None)', asm)
self.assertEqual(asm.split().count('RETURN_VALUE'), 1)
def test_elim_jump_to_return(self):
@@ -196,8 +246,8 @@ class TestTranforms(unittest.TestCase):
def f(cond, true_value, false_value):
return true_value if cond else false_value
asm = disassemble(f)
- self.assertTrue('JUMP_FORWARD' not in asm)
- self.assertTrue('JUMP_ABSOLUTE' not in asm)
+ self.assertNotIn('JUMP_FORWARD', asm)
+ self.assertNotIn('JUMP_ABSOLUTE', asm)
self.assertEqual(asm.split().count('RETURN_VALUE'), 2)
def test_elim_jump_after_return1(self):
@@ -212,8 +262,8 @@ class TestTranforms(unittest.TestCase):
return 5
return 6
asm = disassemble(f)
- self.assertTrue('JUMP_FORWARD' not in asm)
- self.assertTrue('JUMP_ABSOLUTE' not in asm)
+ self.assertNotIn('JUMP_FORWARD', asm)
+ self.assertNotIn('JUMP_ABSOLUTE', asm)
self.assertEqual(asm.split().count('RETURN_VALUE'), 6)
def test_elim_jump_after_return2(self):
@@ -222,7 +272,7 @@ class TestTranforms(unittest.TestCase):
while 1:
if cond1: return 4
asm = disassemble(f)
- self.assertTrue('JUMP_FORWARD' not in asm)
+ self.assertNotIn('JUMP_FORWARD', asm)
# There should be one jump for the while loop.
self.assertEqual(asm.split().count('JUMP_ABSOLUTE'), 1)
self.assertEqual(asm.split().count('RETURN_VALUE'), 2)
@@ -233,13 +283,25 @@ class TestTranforms(unittest.TestCase):
pass
return g
asm = disassemble(f)
- self.assertTrue('BINARY_ADD' not in asm)
+ self.assertNotIn('BINARY_ADD', asm)
+
+class TestBuglets(unittest.TestCase):
+
+ def test_bug_11510(self):
+ # folded constant set optimization was commingled with the tuple
+ # unpacking optimization which would fail if the set had duplicate
+ # elements so that the set length was unexpected
+ def f():
+ x, y = {1, 1}
+ return x, y
+ with self.assertRaises(ValueError):
+ f()
def test_main(verbose=None):
import sys
from test import support
- test_classes = (TestTranforms,)
+ test_classes = (TestTranforms, TestBuglets)
support.run_unittest(*test_classes)
# verify reference counting
diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py
index c159af96e6..598d980b2a 100644
--- a/Lib/test/test_pep263.py
+++ b/Lib/test/test_pep263.py
@@ -26,7 +26,7 @@ class PEP263Test(unittest.TestCase):
try:
compile(b"# coding: cp932\nprint '\x94\x4e'", "dummy", "exec")
except SyntaxError as v:
- self.assertEqual(v.text, "print '\u5e74'")
+ self.assertEqual(v.text, "print '\u5e74'\n")
else:
self.fail()
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py
index 11039acc32..6d891e541e 100644
--- a/Lib/test/test_pep277.py
+++ b/Lib/test/test_pep277.py
@@ -1,22 +1,58 @@
# Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import sys, os, unittest
+from unicodedata import normalize
from test import support
-if not os.path.supports_unicode_filenames:
- raise unittest.SkipTest("test works only on NT+")
filenames = [
- 'abc',
- 'ascii',
- 'Gr\xfc\xdf-Gott',
- '\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2',
- '\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435',
- '\u306b\u307d\u3093',
- '\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1',
- '\u66e8\u66e9\u66eb',
- '\u66e8\u05e9\u3093\u0434\u0393\xdf',
+ '1_abc',
+ '2_ascii',
+ '3_Gr\xfc\xdf-Gott',
+ '4_\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2',
+ '5_\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435',
+ '6_\u306b\u307d\u3093',
+ '7_\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1',
+ '8_\u66e8\u66e9\u66eb',
+ '9_\u66e8\u05e9\u3093\u0434\u0393\xdf',
+ # Specific code points: fn, NFC(fn) and NFKC(fn) all differents
+ '10_\u1fee\u1ffd',
]
+# Mac OS X decomposes Unicode names, using Normal Form D.
+# http://developer.apple.com/mac/library/qa/qa2001/qa1173.html
+# "However, most volume formats do not follow the exact specification for
+# these normal forms. For example, HFS Plus uses a variant of Normal Form D
+# in which U+2000 through U+2FFF, U+F900 through U+FAFF, and U+2F800 through
+# U+2FAFF are not decomposed."
+if sys.platform != 'darwin':
+ filenames.extend([
+ # Specific code points: NFC(fn), NFD(fn), NFKC(fn) and NFKD(fn) all differents
+ '11_\u0385\u03d3\u03d4',
+ '12_\u00a8\u0301\u03d2\u0301\u03d2\u0308', # == NFD('\u0385\u03d3\u03d4')
+ '13_\u0020\u0308\u0301\u038e\u03ab', # == NFKC('\u0385\u03d3\u03d4')
+ '14_\u1e9b\u1fc1\u1fcd\u1fce\u1fcf\u1fdd\u1fde\u1fdf\u1fed',
+
+ # Specific code points: fn, NFC(fn) and NFKC(fn) all differents
+ '15_\u1fee\u1ffd\ufad1',
+ '16_\u2000\u2000\u2000A',
+ '17_\u2001\u2001\u2001A',
+ '18_\u2003\u2003\u2003A', # == NFC('\u2001\u2001\u2001A')
+ '19_\u0020\u0020\u0020A', # '\u0020' == ' ' == NFKC('\u2000') ==
+ # NFKC('\u2001') == NFKC('\u2003')
+])
+
+
+# Is it Unicode-friendly?
+if not os.path.supports_unicode_filenames:
+ fsencoding = sys.getfilesystemencoding()
+ try:
+ for name in filenames:
+ name.encode(fsencoding)
+ except UnicodeEncodeError:
+ raise unittest.SkipTest("only NT+ and systems with "
+ "Unicode-friendly filesystem encoding")
+
+
# Destroy directory dirname and all files under it, to one level.
def deltree(dirname):
# Don't hide legitimate errors: if one of these suckers exists, it's
@@ -27,35 +63,45 @@ def deltree(dirname):
os.unlink(os.path.join(dirname, fname))
os.rmdir(dirname)
+
class UnicodeFileTests(unittest.TestCase):
- files = [os.path.join(support.TESTFN, f) for f in filenames]
+ files = set(filenames)
+ normal_form = None
def setUp(self):
try:
os.mkdir(support.TESTFN)
except OSError:
pass
+ files = set()
for name in self.files:
- f = open(name, 'wb')
- f.write((name+'\n').encode("utf-8"))
- f.close()
+ name = os.path.join(support.TESTFN, self.norm(name))
+ with open(name, 'wb') as f:
+ f.write((name+'\n').encode("utf-8"))
os.stat(name)
+ files.add(name)
+ self.files = files
def tearDown(self):
deltree(support.TESTFN)
+ def norm(self, s):
+ if self.normal_form:
+ return normalize(self.normal_form, s)
+ return s
+
def _apply_failure(self, fn, filename, expected_exception,
check_fn_in_exception = True):
- try:
+ with self.assertRaises(expected_exception) as c:
fn(filename)
- raise support.TestFailed("Expected to fail calling '%s(%r)'"
- % (fn.__name__, filename))
- except expected_exception as details:
- if check_fn_in_exception and details.filename != filename:
- raise support.TestFailed("Function '%s(%r) failed with "
- "bad filename in the exception: %r"
- % (fn.__name__, filename,
- details.filename))
+ exc_filename = c.exception.filename
+ # the "filename" exception attribute may be encoded
+ if isinstance(exc_filename, bytes):
+ filename = filename.encode(sys.getfilesystemencoding())
+ if check_fn_in_exception:
+ self.assertEqual(exc_filename, filename, "Function '%s(%a) failed "
+ "with bad filename in the exception: %a" %
+ (fn.__name__, filename, exc_filename))
def test_failures(self):
# Pass non-existing Unicode filenames all over the place.
@@ -76,39 +122,87 @@ class UnicodeFileTests(unittest.TestCase):
f.close()
os.stat(name)
+ # Skip the test on darwin, because darwin does normalize the filename to
+ # NFD (a variant of Unicode NFD form). Normalize the filename to NFC, NFKC,
+ # NFKD in Python is useless, because darwin will normalize it later and so
+ # open(), os.stat(), etc. don't raise any exception.
+ @unittest.skipIf(sys.platform == 'darwin', 'irrevelant test on Mac OS X')
+ def test_normalize(self):
+ files = set(self.files)
+ others = set()
+ for nf in set(['NFC', 'NFD', 'NFKC', 'NFKD']):
+ others |= set(normalize(nf, file) for file in files)
+ others -= files
+ for name in others:
+ self._apply_failure(open, name, IOError)
+ self._apply_failure(os.stat, name, OSError)
+ self._apply_failure(os.chdir, name, OSError)
+ self._apply_failure(os.rmdir, name, OSError)
+ self._apply_failure(os.remove, name, OSError)
+ # listdir may append a wildcard to the filename, so dont check
+ self._apply_failure(os.listdir, name, OSError, False)
+
+ # Skip the test on darwin, because darwin uses a normalization different
+ # than Python NFD normalization: filenames are different even if we use
+ # Python NFD normalization.
+ @unittest.skipIf(sys.platform == 'darwin', 'irrevelant test on Mac OS X')
def test_listdir(self):
- f1 = os.listdir(support.TESTFN)
- f2 = os.listdir(str(support.TESTFN.encode("utf-8"),
- sys.getfilesystemencoding()))
- sf2 = set("\\".join((str(support.TESTFN), f))
- for f in f2)
- self.assertEqual(len(f1), len(self.files))
- self.assertEqual(sf2, set(self.files))
+ sf0 = set(self.files)
+ f1 = os.listdir(support.TESTFN.encode(sys.getfilesystemencoding()))
+ f2 = os.listdir(support.TESTFN)
+ sf2 = set(os.path.join(support.TESTFN, f) for f in f2)
+ self.assertEqual(sf0, sf2, "%a != %a" % (sf0, sf2))
+ self.assertEqual(len(f1), len(f2))
def test_rename(self):
for name in self.files:
- os.rename(name,"tmp")
- os.rename("tmp",name)
+ os.rename(name, "tmp")
+ os.rename("tmp", name)
def test_directory(self):
- dirname = os.path.join(support.TESTFN,'Gr\xfc\xdf-\u66e8\u66e9\u66eb')
+ dirname = os.path.join(support.TESTFN, 'Gr\xfc\xdf-\u66e8\u66e9\u66eb')
filename = '\xdf-\u66e8\u66e9\u66eb'
oldwd = os.getcwd()
os.mkdir(dirname)
os.chdir(dirname)
- f = open(filename, 'wb')
- f.write((filename + '\n').encode("utf-8"))
- f.close()
- os.access(filename,os.R_OK)
- os.remove(filename)
- os.chdir(oldwd)
- os.rmdir(dirname)
+ try:
+ with open(filename, 'wb') as f:
+ f.write((filename + '\n').encode("utf-8"))
+ os.access(filename,os.R_OK)
+ os.remove(filename)
+ finally:
+ os.chdir(oldwd)
+ os.rmdir(dirname)
+
+
+class UnicodeNFCFileTests(UnicodeFileTests):
+ normal_form = 'NFC'
+
+
+class UnicodeNFDFileTests(UnicodeFileTests):
+ normal_form = 'NFD'
+
+
+class UnicodeNFKCFileTests(UnicodeFileTests):
+ normal_form = 'NFKC'
+
+
+class UnicodeNFKDFileTests(UnicodeFileTests):
+ normal_form = 'NFKD'
+
def test_main():
try:
- support.run_unittest(UnicodeFileTests)
+ support.run_unittest(
+ UnicodeFileTests,
+ UnicodeNFCFileTests,
+ UnicodeNFDFileTests,
+ UnicodeNFKCFileTests,
+ UnicodeNFKDFileTests,
+ )
finally:
deltree(support.TESTFN)
+
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_pep292.py b/Lib/test/test_pep292.py
index ce9b66363b..119c7ea8a1 100644
--- a/Lib/test/test_pep292.py
+++ b/Lib/test/test_pep292.py
@@ -42,6 +42,19 @@ class TestTemplate(unittest.TestCase):
s = Template('$who likes $$')
eq(s.substitute(dict(who='tim', what='ham')), 'tim likes $')
+ def test_invalid(self):
+ class MyPattern(Template):
+ pattern = r"""
+ (?:
+ (?P<invalid>) |
+ (?P<escaped>%(delim)s) |
+ @(?P<named>%(id)s) |
+ @{(?P<braced>%(id)s)}
+ )
+ """
+ s = MyPattern('$')
+ self.assertRaises(ValueError, s.substitute, dict())
+
def test_percents(self):
eq = self.assertEqual
s = Template('%(foo)s $foo ${foo}')
@@ -86,13 +99,6 @@ class TestTemplate(unittest.TestCase):
s = Template('$who likes $100')
raises(ValueError, s.substitute, dict(who='tim'))
- def test_delimiter_override(self):
- class PieDelims(Template):
- delimiter = '@'
- s = PieDelims('@who likes to eat a bag of @{what} worth $100')
- self.assertEqual(s.substitute(dict(who='tim', what='ham')),
- 'tim likes to eat a bag of ham worth $100')
-
def test_idpattern_override(self):
class PathPattern(Template):
idpattern = r'[_a-z][._a-z0-9]*'
@@ -132,6 +138,40 @@ class TestTemplate(unittest.TestCase):
self.assertRaises(ValueError, s.substitute, {})
self.assertRaises(ValueError, s.safe_substitute, {})
+ def test_braced_override(self):
+ class MyTemplate(Template):
+ pattern = r"""
+ \$(?:
+ (?P<escaped>$) |
+ (?P<named>[_a-z][_a-z0-9]*) |
+ @@(?P<braced>[_a-z][_a-z0-9]*)@@ |
+ (?P<invalid>) |
+ )
+ """
+
+ tmpl = 'PyCon in $@@location@@'
+ t = MyTemplate(tmpl)
+ self.assertRaises(KeyError, t.substitute, {})
+ val = t.substitute({'location': 'Cleveland'})
+ self.assertEqual(val, 'PyCon in Cleveland')
+
+ def test_braced_override_safe(self):
+ class MyTemplate(Template):
+ pattern = r"""
+ \$(?:
+ (?P<escaped>$) |
+ (?P<named>[_a-z][_a-z0-9]*) |
+ @@(?P<braced>[_a-z][_a-z0-9]*)@@ |
+ (?P<invalid>) |
+ )
+ """
+
+ tmpl = 'PyCon in $@@location@@'
+ t = MyTemplate(tmpl)
+ self.assertEqual(t.safe_substitute(), tmpl)
+ val = t.safe_substitute({'location': 'Cleveland'})
+ self.assertEqual(val, 'PyCon in Cleveland')
+
def test_unicode_values(self):
s = Template('$who likes $what')
d = dict(who='t\xffm', what='f\xfe\fed')
@@ -183,6 +223,12 @@ class TestTemplate(unittest.TestCase):
raises(ValueError, s.substitute, dict(gift='bud', who='you'))
eq(s.safe_substitute(), 'this &gift is for &{who} &')
+ class PieDelims(Template):
+ delimiter = '@'
+ s = PieDelims('@who likes to eat a bag of @{what} worth $100')
+ self.assertEqual(s.substitute(dict(who='tim', what='ham')),
+ 'tim likes to eat a bag of ham worth $100')
+
def test_main():
from test import support
diff --git a/Lib/test/test_pep3120.py b/Lib/test/test_pep3120.py
index 85da048a7d..09fedf0d54 100644
--- a/Lib/test/test_pep3120.py
+++ b/Lib/test/test_pep3120.py
@@ -19,7 +19,8 @@ class PEP3120Test(unittest.TestCase):
try:
import test.badsyntax_pep3120
except SyntaxError as msg:
- self.assertTrue(str(msg).find("Non-UTF-8 code starting with") >= 0)
+ msg = str(msg)
+ self.assertTrue('UTF-8' in msg or 'utf8' in msg)
else:
self.fail("expected exception didn't occur")
diff --git a/Lib/test/test_pep3131.py b/Lib/test/test_pep3131.py
index 3d09ad1f5a..9d5f217165 100644
--- a/Lib/test/test_pep3131.py
+++ b/Lib/test/test_pep3131.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
import unittest
from test import support
diff --git a/Lib/test/test_pep352.py b/Lib/test/test_pep352.py
index b9645d5cf9..558cdb56d2 100644
--- a/Lib/test/test_pep352.py
+++ b/Lib/test/test_pep352.py
@@ -38,8 +38,8 @@ class ExceptionClassTests(unittest.TestCase):
last_exc = getattr(builtins, superclass_name)
except AttributeError:
self.fail("base class %s not a built-in" % superclass_name)
- self.assertTrue(superclass_name in exc_set,
- '%s not found' % superclass_name)
+ self.assertIn(superclass_name, exc_set,
+ '%s not found' % superclass_name)
exc_set.discard(superclass_name)
superclasses = [] # Loop will insert base exception
last_depth = 0
@@ -73,7 +73,7 @@ class ExceptionClassTests(unittest.TestCase):
self.verify_instance_interface(exc())
except TypeError:
pass
- self.assertTrue(exc_name in exc_set)
+ self.assertIn(exc_name, exc_set)
exc_set.discard(exc_name)
last_exc = exc
last_depth = depth
diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py
index bb681bfb14..a3878fd62a 100644
--- a/Lib/test/test_pickle.py
+++ b/Lib/test/test_pickle.py
@@ -31,12 +31,24 @@ class PyPicklerTests(AbstractPickleTests):
f.seek(0)
return bytes(f.read())
- def loads(self, buf):
+ def loads(self, buf, **kwds):
f = io.BytesIO(buf)
- u = self.unpickler(f)
+ u = self.unpickler(f, **kwds)
return u.load()
+class InMemoryPickleTests(AbstractPickleTests):
+
+ pickler = pickle._Pickler
+ unpickler = pickle._Unpickler
+
+ def dumps(self, arg, proto=None):
+ return pickle.dumps(arg, proto)
+
+ def loads(self, buf, **kwds):
+ return pickle.loads(buf, **kwds)
+
+
class PyPersPicklerTests(AbstractPersistentPicklerTests):
pickler = pickle._Pickler
@@ -52,12 +64,12 @@ class PyPersPicklerTests(AbstractPersistentPicklerTests):
f.seek(0)
return f.read()
- def loads(self, buf):
+ def loads(self, buf, **kwds):
class PersUnpickler(self.unpickler):
def persistent_load(subself, obj):
return self.persistent_load(obj)
f = io.BytesIO(buf)
- u = PersUnpickler(f)
+ u = PersUnpickler(f, **kwds)
return u.load()
@@ -95,7 +107,8 @@ def test_main():
tests.extend([CPicklerTests, CPersPicklerTests,
CDumpPickle_LoadPickle, DumpPickle_CLoadPickle,
PyPicklerUnpicklerObjectTests,
- CPicklerUnpicklerObjectTests])
+ CPicklerUnpicklerObjectTests,
+ InMemoryPickleTests])
support.run_unittest(*tests)
support.run_doctest(pickle)
diff --git a/Lib/test/test_pickletools.py b/Lib/test/test_pickletools.py
index 823b0c2621..d37ac263c4 100644
--- a/Lib/test/test_pickletools.py
+++ b/Lib/test/test_pickletools.py
@@ -9,8 +9,8 @@ class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def dumps(self, arg, proto=None):
return pickletools.optimize(pickle.dumps(arg, proto))
- def loads(self, buf):
- return pickle.loads(buf)
+ def loads(self, buf, **kwds):
+ return pickle.loads(buf, **kwds)
# Test relies on precise output of dumps()
test_pickle_to_2x = None
diff --git a/Lib/test/test_pipes.py b/Lib/test/test_pipes.py
index b816a3b81b..f2b58d5e3d 100644
--- a/Lib/test/test_pipes.py
+++ b/Lib/test/test_pipes.py
@@ -2,7 +2,7 @@ import pipes
import os
import string
import unittest
-from test.support import TESTFN, run_unittest, unlink
+from test.support import TESTFN, run_unittest, unlink, reap_children
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
@@ -40,7 +40,11 @@ class SimplePipeTests(unittest.TestCase):
f.write('hello world #2')
t = pipes.Template()
t.append(s_command + ' < $IN', pipes.FILEIN_STDOUT)
- self.assertEqual(t.open(TESTFN, 'r').read(), 'HELLO WORLD #2')
+ f = t.open(TESTFN, 'r')
+ try:
+ self.assertEqual(f.read(), 'HELLO WORLD #2')
+ finally:
+ f.close()
def testEmptyPipeline1(self):
# copy through empty pipe
@@ -60,7 +64,11 @@ class SimplePipeTests(unittest.TestCase):
with open(TESTFN, 'w') as f:
f.write(d)
t=pipes.Template()
- self.assertEqual(t.open(TESTFN, 'r').read(), d)
+ f = t.open(TESTFN, 'r')
+ try:
+ self.assertEqual(f.read(), d)
+ finally:
+ f.close()
def testEmptyPipeline3(self):
# write through empty pipe
@@ -196,6 +204,7 @@ class SimplePipeTests(unittest.TestCase):
def test_main():
run_unittest(SimplePipeTests)
+ reap_children()
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py
index 4b48c04307..a4ddb15875 100644
--- a/Lib/test/test_pkg.py
+++ b/Lib/test/test_pkg.py
@@ -53,7 +53,8 @@ class TestPkg(unittest.TestCase):
def tearDown(self):
sys.path[:] = self.syspath
support.modules_cleanup(*self.modules_before)
- cleanout(self.root)
+ if self.root: # Only clean if the test was actually run
+ cleanout(self.root)
# delete all modules concerning the tested hierarchy
if self.pkgname:
@@ -103,9 +104,6 @@ class TestPkg(unittest.TestCase):
]
self.mkhier(hier)
- import t2
- self.assertEqual(t2.__doc__, "doc for t2")
-
import t2.sub
import t2.sub.subsub
self.assertEqual(t2.__name__, "t2")
@@ -198,14 +196,14 @@ class TestPkg(unittest.TestCase):
import t5
self.assertEqual(fixdir(dir(t5)),
- ['__doc__', '__file__', '__name__',
+ ['__cached__', '__doc__', '__file__', '__name__',
'__package__', '__path__', 'foo', 'string', 't5'])
self.assertEqual(fixdir(dir(t5.foo)),
- ['__doc__', '__file__', '__name__', '__package__',
- 'string'])
+ ['__cached__', '__doc__', '__file__', '__name__',
+ '__package__', 'string'])
self.assertEqual(fixdir(dir(t5.string)),
- ['__doc__', '__file__', '__name__','__package__',
- 'spam'])
+ ['__cached__', '__doc__', '__file__', '__name__',
+ '__package__', 'spam'])
def test_6(self):
hier = [
@@ -220,13 +218,13 @@ class TestPkg(unittest.TestCase):
import t6
self.assertEqual(fixdir(dir(t6)),
- ['__all__', '__doc__', '__file__',
+ ['__all__', '__cached__', '__doc__', '__file__',
'__name__', '__package__', '__path__'])
s = """
import t6
from t6 import *
self.assertEqual(fixdir(dir(t6)),
- ['__all__', '__doc__', '__file__',
+ ['__all__', '__cached__', '__doc__', '__file__',
'__name__', '__package__', '__path__',
'eggs', 'ham', 'spam'])
self.assertEqual(dir(), ['eggs', 'ham', 'self', 'spam', 't6'])
@@ -254,18 +252,18 @@ class TestPkg(unittest.TestCase):
t7, sub, subsub = None, None, None
import t7 as tas
self.assertEqual(fixdir(dir(tas)),
- ['__doc__', '__file__', '__name__',
+ ['__cached__', '__doc__', '__file__', '__name__',
'__package__', '__path__'])
self.assertFalse(t7)
from t7 import sub as subpar
self.assertEqual(fixdir(dir(subpar)),
- ['__doc__', '__file__', '__name__',
+ ['__cached__', '__doc__', '__file__', '__name__',
'__package__', '__path__'])
self.assertFalse(t7)
self.assertFalse(sub)
from t7.sub import subsub as subsubsub
self.assertEqual(fixdir(dir(subsubsub)),
- ['__doc__', '__file__', '__name__',
+ ['__cached__', '__doc__', '__file__', '__name__',
'__package__', '__path__', 'spam'])
self.assertFalse(t7)
self.assertFalse(sub)
@@ -276,6 +274,17 @@ class TestPkg(unittest.TestCase):
self.assertFalse(sub)
self.assertFalse(subsub)
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_8(self):
+ hier = [
+ ("t8", None),
+ ("t8 __init__"+os.extsep+"py", "'doc for t8'"),
+ ]
+ self.mkhier(hier)
+
+ import t8
+ self.assertEqual(t8.__doc__, "doc for t8")
def test_main():
support.run_unittest(__name__)
diff --git a/Lib/test/test_pkgimport.py b/Lib/test/test_pkgimport.py
index 803aa2b695..c37e9362b0 100644
--- a/Lib/test/test_pkgimport.py
+++ b/Lib/test/test_pkgimport.py
@@ -1,5 +1,12 @@
-import os, sys, string, random, tempfile, unittest
-
+import os
+import sys
+import shutil
+import string
+import random
+import tempfile
+import unittest
+
+from imp import cache_from_source
from test.support import run_unittest
class TestImport(unittest.TestCase):
@@ -26,22 +33,17 @@ class TestImport(unittest.TestCase):
self.module_path = os.path.join(self.package_dir, 'foo.py')
def tearDown(self):
- for file in os.listdir(self.package_dir):
- os.remove(os.path.join(self.package_dir, file))
- os.rmdir(self.package_dir)
- os.rmdir(self.test_dir)
+ shutil.rmtree(self.test_dir)
self.assertNotEqual(sys.path.count(self.test_dir), 0)
sys.path.remove(self.test_dir)
self.remove_modules()
def rewrite_file(self, contents):
- for extension in "co":
- compiled_path = self.module_path + extension
- if os.path.exists(compiled_path):
- os.remove(compiled_path)
- f = open(self.module_path, 'w')
- f.write(contents)
- f.close()
+ compiled_path = cache_from_source(self.module_path)
+ if os.path.exists(compiled_path):
+ os.remove(compiled_path)
+ with open(self.module_path, 'w') as f:
+ f.write(contents)
def test_package_import__semantics(self):
@@ -51,9 +53,9 @@ class TestImport(unittest.TestCase):
self.rewrite_file('for')
try: __import__(self.module_name)
except SyntaxError: pass
- else: raise RuntimeError('Failed to induce SyntaxError')
- self.assertTrue(self.module_name not in sys.modules and
- not hasattr(sys.modules[self.package_name], 'foo'))
+ else: raise RuntimeError('Failed to induce SyntaxError') # self.fail()?
+ self.assertNotIn(self.module_name, sys.modules)
+ self.assertFalse(hasattr(sys.modules[self.package_name], 'foo'))
# ...make up a variable name that isn't bound in __builtins__
var = 'a'
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index 2f688a4f18..ec134a17e0 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -10,20 +10,26 @@ class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
- if hasattr(os, "symlink"):
- def test_architecture_via_symlink(self): # issue3762
- def get(python):
- cmd = [python, '-c',
- 'import platform; print(platform.architecture())']
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- return p.communicate()
- real = os.path.realpath(sys.executable)
- link = os.path.abspath(support.TESTFN)
- os.symlink(real, link)
- try:
- self.assertEqual(get(real), get(link))
- finally:
- os.remove(link)
+ @support.skip_unless_symlink
+ def test_architecture_via_symlink(self): # issue3762
+ # On Windows, the EXE needs to know where pythonXY.dll is at so we have
+ # to add the directory to the path.
+ if sys.platform == "win32":
+ os.environ["Path"] = "{};{}".format(
+ os.path.dirname(sys.executable), os.environ["Path"])
+
+ def get(python):
+ cmd = [python, '-c',
+ 'import platform; print(platform.architecture())']
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ return p.communicate()
+ real = os.path.realpath(sys.executable)
+ link = os.path.abspath(support.TESTFN)
+ os.symlink(real, link)
+ try:
+ self.assertEqual(get(real), get(link))
+ finally:
+ os.remove(link)
def test_platform(self):
for aliased in (False, True):
@@ -131,6 +137,27 @@ class PlatformTest(unittest.TestCase):
res = platform.uname()
self.assertTrue(any(res))
+ @unittest.skipUnless(sys.platform.startswith('win'), "windows only test")
+ def test_uname_win32_ARCHITEW6432(self):
+ # Issue 7860: make sure we get architecture from the correct variable
+ # on 64 bit Windows: if PROCESSOR_ARCHITEW6432 exists we should be
+ # using it, per
+ # http://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx
+ try:
+ with support.EnvironmentVarGuard() as environ:
+ if 'PROCESSOR_ARCHITEW6432' in environ:
+ del environ['PROCESSOR_ARCHITEW6432']
+ environ['PROCESSOR_ARCHITECTURE'] = 'foo'
+ platform._uname_cache = None
+ system, node, release, version, machine, processor = platform.uname()
+ self.assertEqual(machine, 'foo')
+ environ['PROCESSOR_ARCHITEW6432'] = 'bar'
+ platform._uname_cache = None
+ system, node, release, version, machine, processor = platform.uname()
+ self.assertEqual(machine, 'bar')
+ finally:
+ platform._uname_cache = None
+
def test_java_ver(self):
res = platform.java_ver()
if sys.platform == 'java':
@@ -198,8 +225,10 @@ class PlatformTest(unittest.TestCase):
if os.path.isdir(sys.executable) and \
os.path.exists(sys.executable+'.exe'):
# Cygwin horror
- executable = executable + '.exe'
- res = platform.libc_ver(sys.executable)
+ executable = sys.executable + '.exe'
+ else:
+ executable = sys.executable
+ res = platform.libc_ver(executable)
def test_parse_release_file(self):
diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py
index b9a46b74a0..dfa4725c32 100644
--- a/Lib/test/test_plistlib.py
+++ b/Lib/test/test_plistlib.py
@@ -9,7 +9,7 @@ from test import support
# This test data was generated through Cocoa's NSDictionary class
TESTDATA = b"""<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" \
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
diff --git a/Lib/test/test_popen.py b/Lib/test/test_popen.py
index 24fb846bef..accf187b54 100644
--- a/Lib/test/test_popen.py
+++ b/Lib/test/test_popen.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Basic tests for os.popen()
Particularly useful for platforms that fake popen.
@@ -22,7 +22,8 @@ class PopenTest(unittest.TestCase):
def _do_test_commandline(self, cmdline, expected):
cmd = '%s -c "import sys; print(sys.argv)" %s'
cmd = cmd % (python, cmdline)
- data = os.popen(cmd).read()
+ with os.popen(cmd) as p:
+ data = p.read()
got = eval(data)[1:] # strip off argv[0]
self.assertEqual(got, expected)
diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
index 5659b78628..81af56989f 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -4,7 +4,6 @@
# a real test suite
import poplib
-import threading
import asyncore
import asynchat
import socket
@@ -14,6 +13,7 @@ import errno
from unittest import TestCase
from test import support as test_support
+threading = test_support.import_module('threading')
HOST = test_support.HOST
PORT = 0
@@ -122,6 +122,7 @@ class DummyPOP3Server(asyncore.dispatcher, threading.Thread):
self.active = False
self.active_lock = threading.Lock()
self.host, self.port = self.socket.getsockname()[:2]
+ self.handler_instance = None
def start(self):
assert not self.active
@@ -143,10 +144,8 @@ class DummyPOP3Server(asyncore.dispatcher, threading.Thread):
self.active = False
self.join()
- def handle_accept(self):
- conn, addr = self.accept()
- self.handler = self.handler(conn)
- self.close()
+ def handle_accepted(self, conn, addr):
+ self.handler_instance = self.handler(conn)
def handle_connect(self):
self.close()
@@ -285,7 +284,24 @@ if hasattr(poplib, 'POP3_SSL'):
self.client = poplib.POP3_SSL(self.server.host, self.server.port)
def test__all__(self):
- self.assertTrue('POP3_SSL' in poplib.__all__)
+ self.assertIn('POP3_SSL', poplib.__all__)
+
+ def test_context(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host,
+ self.server.port, keyfile=CERTFILE, context=ctx)
+ self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host,
+ self.server.port, certfile=CERTFILE, context=ctx)
+ self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host,
+ self.server.port, keyfile=CERTFILE,
+ certfile=CERTFILE, context=ctx)
+
+ self.client.quit()
+ self.client = poplib.POP3_SSL(self.server.host, self.server.port,
+ context=ctx)
+ self.assertIsInstance(self.client.sock, ssl.SSLSocket)
+ self.assertIs(self.client.sock.context, ctx)
+ self.assertTrue(self.client.noop().startswith(b'+OK'))
class TestTimeouts(TestCase):
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 51cc23ce05..45b3afc72d 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -5,16 +5,16 @@ from test import support
# Skip these tests if there is no posix module.
posix = support.import_module('posix')
+import errno
import sys
import time
import os
import pwd
import shutil
+import stat
import unittest
import warnings
-warnings.filterwarnings('ignore', '.* potential security risk .*',
- RuntimeWarning)
class PosixTester(unittest.TestCase):
@@ -22,9 +22,14 @@ class PosixTester(unittest.TestCase):
# create empty file
fp = open(support.TESTFN, 'w+')
fp.close()
+ self._warnings_manager = support.check_warnings()
+ self._warnings_manager.__enter__()
+ warnings.filterwarnings('ignore', '.* potential security risk .*',
+ RuntimeWarning)
def tearDown(self):
support.unlink(support.TESTFN)
+ self._warnings_manager.__exit__(None, None, None)
def testNoArgFunctions(self):
# test posix functions which take no arguments and have
@@ -41,6 +46,69 @@ class PosixTester(unittest.TestCase):
posix_func()
self.assertRaises(TypeError, posix_func, 1)
+ if hasattr(posix, 'getresuid'):
+ def test_getresuid(self):
+ user_ids = posix.getresuid()
+ self.assertEqual(len(user_ids), 3)
+ for val in user_ids:
+ self.assertGreaterEqual(val, 0)
+
+ if hasattr(posix, 'getresgid'):
+ def test_getresgid(self):
+ group_ids = posix.getresgid()
+ self.assertEqual(len(group_ids), 3)
+ for val in group_ids:
+ self.assertGreaterEqual(val, 0)
+
+ if hasattr(posix, 'setresuid'):
+ def test_setresuid(self):
+ current_user_ids = posix.getresuid()
+ self.assertIsNone(posix.setresuid(*current_user_ids))
+ # -1 means don't change that value.
+ self.assertIsNone(posix.setresuid(-1, -1, -1))
+
+ def test_setresuid_exception(self):
+ # Don't do this test if someone is silly enough to run us as root.
+ current_user_ids = posix.getresuid()
+ if 0 not in current_user_ids:
+ new_user_ids = (current_user_ids[0]+1, -1, -1)
+ self.assertRaises(OSError, posix.setresuid, *new_user_ids)
+
+ if hasattr(posix, 'setresgid'):
+ def test_setresgid(self):
+ current_group_ids = posix.getresgid()
+ self.assertIsNone(posix.setresgid(*current_group_ids))
+ # -1 means don't change that value.
+ self.assertIsNone(posix.setresgid(-1, -1, -1))
+
+ def test_setresgid_exception(self):
+ # Don't do this test if someone is silly enough to run us as root.
+ current_group_ids = posix.getresgid()
+ if 0 not in current_group_ids:
+ new_group_ids = (current_group_ids[0]+1, -1, -1)
+ self.assertRaises(OSError, posix.setresgid, *new_group_ids)
+
+ @unittest.skipUnless(hasattr(posix, 'initgroups'),
+ "test needs os.initgroups()")
+ def test_initgroups(self):
+ # It takes a string and an integer; check that it raises a TypeError
+ # for other argument lists.
+ self.assertRaises(TypeError, posix.initgroups)
+ self.assertRaises(TypeError, posix.initgroups, None)
+ self.assertRaises(TypeError, posix.initgroups, 3, "foo")
+ self.assertRaises(TypeError, posix.initgroups, "foo", 3, object())
+
+ # If a non-privileged user invokes it, it should fail with OSError
+ # EPERM.
+ if os.getuid() != 0:
+ name = pwd.getpwuid(posix.getuid()).pw_name
+ try:
+ posix.initgroups(name, 13)
+ except OSError as e:
+ self.assertEqual(e.errno, errno.EPERM)
+ else:
+ self.fail("Expected OSError to be raised by initgroups")
+
def test_statvfs(self):
if hasattr(posix, 'statvfs'):
self.assertTrue(posix.statvfs(os.curdir))
@@ -69,7 +137,7 @@ class PosixTester(unittest.TestCase):
fp = open(support.TESTFN)
try:
fd = posix.dup(fp.fileno())
- self.assertTrue(isinstance(fd, int))
+ self.assertIsInstance(fd, int)
os.close(fd)
finally:
fp.close()
@@ -132,6 +200,28 @@ class PosixTester(unittest.TestCase):
if hasattr(posix, 'stat'):
self.assertTrue(posix.stat(support.TESTFN))
+ @unittest.skipUnless(hasattr(posix, 'mkfifo'), "don't have mkfifo()")
+ def test_mkfifo(self):
+ support.unlink(support.TESTFN)
+ posix.mkfifo(support.TESTFN, stat.S_IRUSR | stat.S_IWUSR)
+ self.assertTrue(stat.S_ISFIFO(posix.stat(support.TESTFN).st_mode))
+
+ @unittest.skipUnless(hasattr(posix, 'mknod') and hasattr(stat, 'S_IFIFO'),
+ "don't have mknod()/S_IFIFO")
+ def test_mknod(self):
+ # Test using mknod() to create a FIFO (the only use specified
+ # by POSIX).
+ support.unlink(support.TESTFN)
+ mode = stat.S_IFIFO | stat.S_IRUSR | stat.S_IWUSR
+ try:
+ posix.mknod(support.TESTFN, mode, 0)
+ except OSError as e:
+ # Some old systems don't allow unprivileged users to use
+ # mknod(), or only support creating device nodes.
+ self.assertIn(e.errno, (errno.EPERM, errno.EINVAL))
+ else:
+ self.assertTrue(stat.S_ISFIFO(posix.stat(support.TESTFN).st_mode))
+
def _test_all_chown_common(self, chown_func, first_param):
"""Common code for chown, fchown and lchown tests."""
if os.getuid() == 0:
@@ -186,9 +276,14 @@ class PosixTester(unittest.TestCase):
posix.chdir(os.curdir)
self.assertRaises(OSError, posix.chdir, support.TESTFN)
- def test_lsdir(self):
- if hasattr(posix, 'lsdir'):
- self.assertTrue(support.TESTFN in posix.lsdir(os.curdir))
+ def test_listdir(self):
+ if hasattr(posix, 'listdir'):
+ self.assertTrue(support.TESTFN in posix.listdir(os.curdir))
+
+ def test_listdir_default(self):
+ # When listdir is called without argument, it's the same as listdir(os.curdir)
+ if hasattr(posix, 'listdir'):
+ self.assertTrue(support.TESTFN in posix.listdir())
def test_access(self):
if hasattr(posix, 'access'):
@@ -197,7 +292,7 @@ class PosixTester(unittest.TestCase):
def test_umask(self):
if hasattr(posix, 'umask'):
old_mask = posix.umask(0)
- self.assertTrue(isinstance(old_mask, int))
+ self.assertIsInstance(old_mask, int)
posix.umask(old_mask)
def test_strerror(self):
@@ -233,9 +328,13 @@ class PosixTester(unittest.TestCase):
posix.lchflags(support.TESTFN, st.st_flags)
def test_environ(self):
+ if os.name == "nt":
+ item_type = str
+ else:
+ item_type = bytes
for k, v in posix.environ.items():
- self.assertEqual(type(k), str)
- self.assertEqual(type(v), str)
+ self.assertEqual(type(k), item_type)
+ self.assertEqual(type(v), item_type)
def test_getcwd_long_pathnames(self):
if hasattr(posix, 'getcwd'):
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 14146db4b2..bb4559c4ab 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -1,14 +1,31 @@
import unittest
-from test import support
+from test import support, test_genericpath
-import posixpath, os
-from posixpath import realpath, abspath, join, dirname, basename, relpath
+import posixpath
+import os
+import sys
+from posixpath import realpath, abspath, dirname, basename
+
+try:
+ import posix
+except ImportError:
+ posix = None
# An absolute path to a temporary filename for testing. We can't rely on TESTFN
# being an absolute path, so we need this.
ABSTFN = abspath(support.TESTFN)
+def skip_if_ABSTFN_contains_backslash(test):
+ """
+ On Windows, posixpath.abspath still returns paths with backslashes
+ instead of posix forward slashes. If this is the case, several tests
+ fail, so skip them.
+ """
+ found_backslash = '\\' in ABSTFN
+ msg = "ABSTFN is not a posix path - tests fail"
+ return [test, unittest.skip(msg)(test)][found_backslash]
+
def safe_rmdir(dirname):
try:
os.rmdir(dirname)
@@ -25,19 +42,6 @@ class PosixPathTest(unittest.TestCase):
support.unlink(support.TESTFN + suffix)
safe_rmdir(support.TESTFN + suffix)
- def assertIs(self, a, b):
- self.assertTrue(a is b)
-
- def test_normcase(self):
- # Check that normcase() is idempotent
- p = "FoO/./BaR"
- self.assertEqual(p, posixpath.normcase(p))
-
- p = b"FoO/./BaR"
- self.assertEqual(p, posixpath.normcase(p))
-
- self.assertRaises(TypeError, posixpath.normcase)
-
def test_join(self):
self.assertEqual(posixpath.join("/foo", "bar", "/bar", "baz"),
"/bar/baz")
@@ -52,16 +56,9 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.join(b"/foo/", b"bar/", b"baz/"),
b"/foo/bar/baz/")
- self.assertRaises(TypeError, posixpath.join)
self.assertRaises(TypeError, posixpath.join, b"bytes", "str")
self.assertRaises(TypeError, posixpath.join, "str", b"bytes")
- def test_splitdrive(self):
- self.assertEqual(posixpath.splitdrive("/foo/bar"), ("", "/foo/bar"))
- self.assertEqual(posixpath.splitdrive(b"/foo/bar"), (b"", b"/foo/bar"))
-
- self.assertRaises(TypeError, posixpath.splitdrive)
-
def test_split(self):
self.assertEqual(posixpath.split("/foo/bar"), ("/foo", "bar"))
self.assertEqual(posixpath.split("/"), ("/", ""))
@@ -75,8 +72,6 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.split(b"////foo"), (b"////", b"foo"))
self.assertEqual(posixpath.split(b"//foo//bar"), (b"//foo", b"bar"))
- self.assertRaises(TypeError, posixpath.split)
-
def splitextTest(self, path, filename, ext):
self.assertEqual(posixpath.splitext(path), (filename, ext))
self.assertEqual(posixpath.splitext("/" + path), ("/" + filename, ext))
@@ -118,7 +113,6 @@ class PosixPathTest(unittest.TestCase):
self.splitextTest("..", "..", "")
self.splitextTest("........", "........", "")
self.splitextTest("", "", "")
- self.assertRaises(TypeError, posixpath.splitext)
def test_isabs(self):
self.assertIs(posixpath.isabs(""), False)
@@ -133,8 +127,6 @@ class PosixPathTest(unittest.TestCase):
self.assertIs(posixpath.isabs(b"/foo/bar"), True)
self.assertIs(posixpath.isabs(b"foo/bar"), False)
- self.assertRaises(TypeError, posixpath.isabs)
-
def test_basename(self):
self.assertEqual(posixpath.basename("/foo/bar"), "bar")
self.assertEqual(posixpath.basename("/"), "")
@@ -148,8 +140,6 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.basename(b"////foo"), b"foo")
self.assertEqual(posixpath.basename(b"//foo//bar"), b"bar")
- self.assertRaises(TypeError, posixpath.basename)
-
def test_dirname(self):
self.assertEqual(posixpath.dirname("/foo/bar"), "/foo")
self.assertEqual(posixpath.dirname("/"), "/")
@@ -163,88 +153,15 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.dirname(b"////foo"), b"////")
self.assertEqual(posixpath.dirname(b"//foo//bar"), b"//foo")
- self.assertRaises(TypeError, posixpath.dirname)
-
- def test_commonprefix(self):
- self.assertEqual(
- posixpath.commonprefix([]),
- ""
- )
- self.assertEqual(
- posixpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"]),
- "/home/swen"
- )
- self.assertEqual(
- posixpath.commonprefix(["/home/swen/spam", "/home/swen/eggs"]),
- "/home/swen/"
- )
- self.assertEqual(
- posixpath.commonprefix(["/home/swen/spam", "/home/swen/spam"]),
- "/home/swen/spam"
- )
-
- self.assertEqual(
- posixpath.commonprefix([b"/home/swenson/spam", b"/home/swen/spam"]),
- b"/home/swen"
- )
- self.assertEqual(
- posixpath.commonprefix([b"/home/swen/spam", b"/home/swen/eggs"]),
- b"/home/swen/"
- )
- self.assertEqual(
- posixpath.commonprefix([b"/home/swen/spam", b"/home/swen/spam"]),
- b"/home/swen/spam"
- )
-
- testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd', 'aXc', 'abd', 'ab', 'aX', 'abcX']
- for s1 in testlist:
- for s2 in testlist:
- p = posixpath.commonprefix([s1, s2])
- self.assertTrue(s1.startswith(p))
- self.assertTrue(s2.startswith(p))
- if s1 != s2:
- n = len(p)
- self.assertNotEqual(s1[n:n+1], s2[n:n+1])
-
- def test_getsize(self):
- f = open(support.TESTFN, "wb")
- try:
- f.write(b"foo")
- f.close()
- self.assertEqual(posixpath.getsize(support.TESTFN), 3)
- finally:
- if not f.closed:
- f.close()
-
- def test_time(self):
- f = open(support.TESTFN, "wb")
- try:
- f.write(b"foo")
- f.close()
- f = open(support.TESTFN, "ab")
- f.write(b"bar")
- f.close()
- f = open(support.TESTFN, "rb")
- d = f.read()
- f.close()
- self.assertEqual(d, b"foobar")
-
- self.assertLessEqual(
- posixpath.getctime(support.TESTFN),
- posixpath.getmtime(support.TESTFN)
- )
- finally:
- if not f.closed:
- f.close()
-
def test_islink(self):
self.assertIs(posixpath.islink(support.TESTFN + "1"), False)
+ self.assertIs(posixpath.lexists(support.TESTFN + "2"), False)
f = open(support.TESTFN + "1", "wb")
try:
f.write(b"foo")
f.close()
self.assertIs(posixpath.islink(support.TESTFN + "1"), False)
- if hasattr(os, "symlink"):
+ if support.can_symlink():
os.symlink(support.TESTFN + "1", support.TESTFN + "2")
self.assertIs(posixpath.islink(support.TESTFN + "2"), True)
os.remove(support.TESTFN + "1")
@@ -255,144 +172,103 @@ class PosixPathTest(unittest.TestCase):
if not f.close():
f.close()
- self.assertRaises(TypeError, posixpath.islink)
+ @staticmethod
+ def _create_file(filename):
+ with open(filename, 'wb') as f:
+ f.write(b'foo')
- def test_exists(self):
- self.assertIs(posixpath.exists(support.TESTFN), False)
- f = open(support.TESTFN, "wb")
- try:
- f.write(b"foo")
- f.close()
- self.assertIs(posixpath.exists(support.TESTFN), True)
- self.assertIs(posixpath.lexists(support.TESTFN), True)
- finally:
- if not f.close():
- f.close()
+ def test_samefile(self):
+ test_fn = support.TESTFN + "1"
+ self._create_file(test_fn)
+ self.assertTrue(posixpath.samefile(test_fn, test_fn))
+ self.assertRaises(TypeError, posixpath.samefile)
- self.assertRaises(TypeError, posixpath.exists)
+ @unittest.skipIf(
+ sys.platform.startswith('win'),
+ "posixpath.samefile does not work on links in Windows")
+ @unittest.skipUnless(hasattr(os, "symlink"),
+ "Missing symlink implementation")
+ def test_samefile_on_links(self):
+ test_fn1 = support.TESTFN + "1"
+ test_fn2 = support.TESTFN + "2"
+ self._create_file(test_fn1)
- def test_isdir(self):
- self.assertIs(posixpath.isdir(support.TESTFN), False)
- f = open(support.TESTFN, "wb")
- try:
- f.write(b"foo")
- f.close()
- self.assertIs(posixpath.isdir(support.TESTFN), False)
- os.remove(support.TESTFN)
- os.mkdir(support.TESTFN)
- self.assertIs(posixpath.isdir(support.TESTFN), True)
- os.rmdir(support.TESTFN)
- finally:
- if not f.close():
- f.close()
-
- self.assertRaises(TypeError, posixpath.isdir)
+ os.symlink(test_fn1, test_fn2)
+ self.assertTrue(posixpath.samefile(test_fn1, test_fn2))
+ os.remove(test_fn2)
- def test_isfile(self):
- self.assertIs(posixpath.isfile(support.TESTFN), False)
- f = open(support.TESTFN, "wb")
- try:
- f.write(b"foo")
- f.close()
- self.assertIs(posixpath.isfile(support.TESTFN), True)
- os.remove(support.TESTFN)
- os.mkdir(support.TESTFN)
- self.assertIs(posixpath.isfile(support.TESTFN), False)
- os.rmdir(support.TESTFN)
- finally:
- if not f.close():
- f.close()
+ self._create_file(test_fn2)
+ self.assertFalse(posixpath.samefile(test_fn1, test_fn2))
- self.assertRaises(TypeError, posixpath.isdir)
-
- def test_samefile(self):
- f = open(support.TESTFN + "1", "wb")
- try:
- f.write(b"foo")
- f.close()
- self.assertIs(
- posixpath.samefile(
- support.TESTFN + "1",
- support.TESTFN + "1"
- ),
- True
- )
- # If we don't have links, assume that os.stat doesn't return resonable
- # inode information and thus, that samefile() doesn't work
- if hasattr(os, "symlink"):
- os.symlink(
- support.TESTFN + "1",
- support.TESTFN + "2"
- )
- self.assertIs(
- posixpath.samefile(
- support.TESTFN + "1",
- support.TESTFN + "2"
- ),
- True
- )
- os.remove(support.TESTFN + "2")
- f = open(support.TESTFN + "2", "wb")
- f.write(b"bar")
- f.close()
- self.assertIs(
- posixpath.samefile(
- support.TESTFN + "1",
- support.TESTFN + "2"
- ),
- False
- )
- finally:
- if not f.close():
- f.close()
-
- self.assertRaises(TypeError, posixpath.samefile)
def test_samestat(self):
- f = open(support.TESTFN + "1", "wb")
- try:
- f.write(b"foo")
- f.close()
- self.assertIs(
- posixpath.samestat(
- os.stat(support.TESTFN + "1"),
- os.stat(support.TESTFN + "1")
- ),
- True
- )
- # If we don't have links, assume that os.stat() doesn't return resonable
- # inode information and thus, that samefile() doesn't work
- if hasattr(os, "symlink"):
- if hasattr(os, "symlink"):
- os.symlink(support.TESTFN + "1", support.TESTFN + "2")
- self.assertIs(
- posixpath.samestat(
- os.stat(support.TESTFN + "1"),
- os.stat(support.TESTFN + "2")
- ),
- True
- )
- os.remove(support.TESTFN + "2")
- f = open(support.TESTFN + "2", "wb")
- f.write(b"bar")
- f.close()
- self.assertIs(
- posixpath.samestat(
- os.stat(support.TESTFN + "1"),
- os.stat(support.TESTFN + "2")
- ),
- False
- )
- finally:
- if not f.close():
- f.close()
+ test_fn = support.TESTFN + "1"
+ self._create_file(test_fn)
+ test_fns = [test_fn]*2
+ stats = map(os.stat, test_fns)
+ self.assertTrue(posixpath.samestat(*stats))
+
+ @unittest.skipIf(
+ sys.platform.startswith('win'),
+ "posixpath.samestat does not work on links in Windows")
+ @unittest.skipUnless(hasattr(os, "symlink"),
+ "Missing symlink implementation")
+ def test_samestat_on_links(self):
+ test_fn1 = support.TESTFN + "1"
+ test_fn2 = support.TESTFN + "2"
+ self._create_file(test_fn1)
+ test_fns = (test_fn1, test_fn2)
+ os.symlink(*test_fns)
+ stats = map(os.stat, test_fns)
+ self.assertTrue(posixpath.samestat(*stats))
+ os.remove(test_fn2)
+
+ self._create_file(test_fn2)
+ stats = map(os.stat, test_fns)
+ self.assertFalse(posixpath.samestat(*stats))
self.assertRaises(TypeError, posixpath.samestat)
def test_ismount(self):
self.assertIs(posixpath.ismount("/"), True)
+ self.assertIs(posixpath.ismount(b"/"), True)
- self.assertRaises(TypeError, posixpath.ismount)
+ def test_ismount_non_existent(self):
+ # Non-existent mountpoint.
+ self.assertIs(posixpath.ismount(ABSTFN), False)
+ try:
+ os.mkdir(ABSTFN)
+ self.assertIs(posixpath.ismount(ABSTFN), False)
+ finally:
+ safe_rmdir(ABSTFN)
+
+ @unittest.skipUnless(support.can_symlink(),
+ "Test requires symlink support")
+ def test_ismount_symlinks(self):
+ # Symlinks are never mountpoints.
+ try:
+ os.symlink("/", ABSTFN)
+ self.assertIs(posixpath.ismount(ABSTFN), False)
+ finally:
+ os.unlink(ABSTFN)
+
+ @unittest.skipIf(posix is None, "Test requires posix module")
+ def test_ismount_different_device(self):
+ # Simulate the path being on a different device from its parent by
+ # mocking out st_dev.
+ save_lstat = os.lstat
+ def fake_lstat(path):
+ st_ino = 0
+ st_dev = 0
+ if path == ABSTFN:
+ st_dev = 1
+ st_ino = 1
+ return posix.stat_result((0, st_ino, st_dev, 0, 0, 0, 0, 0, 0, 0))
+ try:
+ os.lstat = fake_lstat
+ self.assertIs(posixpath.ismount(ABSTFN), True)
+ finally:
+ os.lstat = save_lstat
def test_expanduser(self):
self.assertEqual(posixpath.expanduser("foo"), "foo")
@@ -402,8 +278,8 @@ class PosixPathTest(unittest.TestCase):
except ImportError:
pass
else:
- self.assertTrue(isinstance(posixpath.expanduser("~/"), str))
- self.assertTrue(isinstance(posixpath.expanduser(b"~/"), bytes))
+ self.assertIsInstance(posixpath.expanduser("~/"), str)
+ self.assertIsInstance(posixpath.expanduser(b"~/"), bytes)
# if home directory == root directory, this test makes no sense
if posixpath.expanduser("~") != '/':
self.assertEqual(
@@ -414,49 +290,18 @@ class PosixPathTest(unittest.TestCase):
posixpath.expanduser(b"~") + b"/",
posixpath.expanduser(b"~/")
)
- self.assertTrue(isinstance(posixpath.expanduser("~root/"), str))
- self.assertTrue(isinstance(posixpath.expanduser("~foo/"), str))
- self.assertTrue(isinstance(posixpath.expanduser(b"~root/"), bytes))
- self.assertTrue(isinstance(posixpath.expanduser(b"~foo/"), bytes))
+ self.assertIsInstance(posixpath.expanduser("~root/"), str)
+ self.assertIsInstance(posixpath.expanduser("~foo/"), str)
+ self.assertIsInstance(posixpath.expanduser(b"~root/"), bytes)
+ self.assertIsInstance(posixpath.expanduser(b"~foo/"), bytes)
with support.EnvironmentVarGuard() as env:
env['HOME'] = '/'
self.assertEqual(posixpath.expanduser("~"), "/")
-
- self.assertRaises(TypeError, posixpath.expanduser)
-
- def test_expandvars(self):
- with support.EnvironmentVarGuard() as env:
- env.clear()
- env["foo"] = "bar"
- env["{foo"] = "baz1"
- env["{foo}"] = "baz2"
- self.assertEqual(posixpath.expandvars("foo"), "foo")
- self.assertEqual(posixpath.expandvars("$foo bar"), "bar bar")
- self.assertEqual(posixpath.expandvars("${foo}bar"), "barbar")
- self.assertEqual(posixpath.expandvars("$[foo]bar"), "$[foo]bar")
- self.assertEqual(posixpath.expandvars("$bar bar"), "$bar bar")
- self.assertEqual(posixpath.expandvars("$?bar"), "$?bar")
- self.assertEqual(posixpath.expandvars("${foo}bar"), "barbar")
- self.assertEqual(posixpath.expandvars("$foo}bar"), "bar}bar")
- self.assertEqual(posixpath.expandvars("${foo"), "${foo")
- self.assertEqual(posixpath.expandvars("${{foo}}"), "baz1}")
- self.assertEqual(posixpath.expandvars("$foo$foo"), "barbar")
- self.assertEqual(posixpath.expandvars("$bar$bar"), "$bar$bar")
-
- self.assertEqual(posixpath.expandvars(b"foo"), b"foo")
- self.assertEqual(posixpath.expandvars(b"$foo bar"), b"bar bar")
- self.assertEqual(posixpath.expandvars(b"${foo}bar"), b"barbar")
- self.assertEqual(posixpath.expandvars(b"$[foo]bar"), b"$[foo]bar")
- self.assertEqual(posixpath.expandvars(b"$bar bar"), b"$bar bar")
- self.assertEqual(posixpath.expandvars(b"$?bar"), b"$?bar")
- self.assertEqual(posixpath.expandvars(b"${foo}bar"), b"barbar")
- self.assertEqual(posixpath.expandvars(b"$foo}bar"), b"bar}bar")
- self.assertEqual(posixpath.expandvars(b"${foo"), b"${foo")
- self.assertEqual(posixpath.expandvars(b"${{foo}}"), b"baz1}")
- self.assertEqual(posixpath.expandvars(b"$foo$foo"), b"barbar")
- self.assertEqual(posixpath.expandvars(b"$bar$bar"), b"$bar$bar")
- self.assertRaises(TypeError, posixpath.expandvars)
+ # expanduser should fall back to using the password database
+ del env['HOME']
+ home = pwd.getpwuid(os.getuid()).pw_dir
+ self.assertEqual(posixpath.expanduser("~"), home)
def test_normpath(self):
self.assertEqual(posixpath.normpath(""), ".")
@@ -478,115 +323,127 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.normpath(b"///..//./foo/.//bar"),
b"/foo/bar")
- self.assertRaises(TypeError, posixpath.normpath)
-
- def test_abspath(self):
- self.assertTrue("foo" in posixpath.abspath("foo"))
- self.assertTrue(b"foo" in posixpath.abspath(b"foo"))
-
- self.assertRaises(TypeError, posixpath.abspath)
-
- def test_realpath(self):
- self.assertTrue("foo" in realpath("foo"))
- self.assertTrue(b"foo" in realpath(b"foo"))
- self.assertRaises(TypeError, posixpath.realpath)
-
- if hasattr(os, "symlink"):
- def test_realpath_basic(self):
- # Basic operation.
- try:
- os.symlink(ABSTFN+"1", ABSTFN)
- self.assertEqual(realpath(ABSTFN), ABSTFN+"1")
- finally:
- support.unlink(ABSTFN)
-
- def test_realpath_symlink_loops(self):
- # Bug #930024, return the path unchanged if we get into an infinite
- # symlink loop.
- try:
- old_path = abspath('.')
- os.symlink(ABSTFN, ABSTFN)
- self.assertEqual(realpath(ABSTFN), ABSTFN)
-
- os.symlink(ABSTFN+"1", ABSTFN+"2")
- os.symlink(ABSTFN+"2", ABSTFN+"1")
- self.assertEqual(realpath(ABSTFN+"1"), ABSTFN+"1")
- self.assertEqual(realpath(ABSTFN+"2"), ABSTFN+"2")
-
- # Test using relative path as well.
- os.chdir(dirname(ABSTFN))
- self.assertEqual(realpath(basename(ABSTFN)), ABSTFN)
- finally:
- os.chdir(old_path)
- support.unlink(ABSTFN)
- support.unlink(ABSTFN+"1")
- support.unlink(ABSTFN+"2")
-
- def test_realpath_resolve_parents(self):
- # We also need to resolve any symlinks in the parents of a relative
- # path passed to realpath. E.g.: current working directory is
- # /usr/doc with 'doc' being a symlink to /usr/share/doc. We call
- # realpath("a"). This should return /usr/share/doc/a/.
- try:
- old_path = abspath('.')
- os.mkdir(ABSTFN)
- os.mkdir(ABSTFN + "/y")
- os.symlink(ABSTFN + "/y", ABSTFN + "/k")
-
- os.chdir(ABSTFN + "/k")
- self.assertEqual(realpath("a"), ABSTFN + "/y/a")
- finally:
- os.chdir(old_path)
- support.unlink(ABSTFN + "/k")
- safe_rmdir(ABSTFN + "/y")
- safe_rmdir(ABSTFN)
-
- def test_realpath_resolve_before_normalizing(self):
- # Bug #990669: Symbolic links should be resolved before we
- # normalize the path. E.g.: if we have directories 'a', 'k' and 'y'
- # in the following hierarchy:
- # a/k/y
- #
- # and a symbolic link 'link-y' pointing to 'y' in directory 'a',
- # then realpath("link-y/..") should return 'k', not 'a'.
- try:
- old_path = abspath('.')
- os.mkdir(ABSTFN)
- os.mkdir(ABSTFN + "/k")
- os.mkdir(ABSTFN + "/k/y")
- os.symlink(ABSTFN + "/k/y", ABSTFN + "/link-y")
-
- # Absolute path.
- self.assertEqual(realpath(ABSTFN + "/link-y/.."), ABSTFN + "/k")
- # Relative path.
- os.chdir(dirname(ABSTFN))
- self.assertEqual(realpath(basename(ABSTFN) + "/link-y/.."), ABSTFN + "/k")
- finally:
- os.chdir(old_path)
- support.unlink(ABSTFN + "/link-y")
- safe_rmdir(ABSTFN + "/k/y")
- safe_rmdir(ABSTFN + "/k")
- safe_rmdir(ABSTFN)
-
- def test_realpath_resolve_first(self):
- # Bug #1213894: The first component of the path, if not absolute,
- # must be resolved too.
-
- try:
- old_path = abspath('.')
- os.mkdir(ABSTFN)
- os.mkdir(ABSTFN + "/k")
- os.symlink(ABSTFN, ABSTFN + "link")
- os.chdir(dirname(ABSTFN))
-
- base = basename(ABSTFN)
- self.assertEqual(realpath(base + "link"), ABSTFN)
- self.assertEqual(realpath(base + "link/k"), ABSTFN + "/k")
- finally:
- os.chdir(old_path)
- support.unlink(ABSTFN + "link")
- safe_rmdir(ABSTFN + "/k")
- safe_rmdir(ABSTFN)
+ @unittest.skipUnless(hasattr(os, "symlink"),
+ "Missing symlink implementation")
+ @skip_if_ABSTFN_contains_backslash
+ def test_realpath_basic(self):
+ # Basic operation.
+ try:
+ os.symlink(ABSTFN+"1", ABSTFN)
+ self.assertEqual(realpath(ABSTFN), ABSTFN+"1")
+ finally:
+ support.unlink(ABSTFN)
+
+ @unittest.skipUnless(hasattr(os, "symlink"),
+ "Missing symlink implementation")
+ @skip_if_ABSTFN_contains_backslash
+ def test_realpath_relative(self):
+ try:
+ os.symlink(posixpath.relpath(ABSTFN+"1"), ABSTFN)
+ self.assertEqual(realpath(ABSTFN), ABSTFN+"1")
+ finally:
+ support.unlink(ABSTFN)
+
+ @unittest.skipUnless(hasattr(os, "symlink"),
+ "Missing symlink implementation")
+ @skip_if_ABSTFN_contains_backslash
+ def test_realpath_symlink_loops(self):
+ # Bug #930024, return the path unchanged if we get into an infinite
+ # symlink loop.
+ try:
+ old_path = abspath('.')
+ os.symlink(ABSTFN, ABSTFN)
+ self.assertEqual(realpath(ABSTFN), ABSTFN)
+
+ os.symlink(ABSTFN+"1", ABSTFN+"2")
+ os.symlink(ABSTFN+"2", ABSTFN+"1")
+ self.assertEqual(realpath(ABSTFN+"1"), ABSTFN+"1")
+ self.assertEqual(realpath(ABSTFN+"2"), ABSTFN+"2")
+
+ # Test using relative path as well.
+ os.chdir(dirname(ABSTFN))
+ self.assertEqual(realpath(basename(ABSTFN)), ABSTFN)
+ finally:
+ os.chdir(old_path)
+ support.unlink(ABSTFN)
+ support.unlink(ABSTFN+"1")
+ support.unlink(ABSTFN+"2")
+
+ @unittest.skipUnless(hasattr(os, "symlink"),
+ "Missing symlink implementation")
+ @skip_if_ABSTFN_contains_backslash
+ def test_realpath_resolve_parents(self):
+ # We also need to resolve any symlinks in the parents of a relative
+ # path passed to realpath. E.g.: current working directory is
+ # /usr/doc with 'doc' being a symlink to /usr/share/doc. We call
+ # realpath("a"). This should return /usr/share/doc/a/.
+ try:
+ old_path = abspath('.')
+ os.mkdir(ABSTFN)
+ os.mkdir(ABSTFN + "/y")
+ os.symlink(ABSTFN + "/y", ABSTFN + "/k")
+
+ os.chdir(ABSTFN + "/k")
+ self.assertEqual(realpath("a"), ABSTFN + "/y/a")
+ finally:
+ os.chdir(old_path)
+ support.unlink(ABSTFN + "/k")
+ safe_rmdir(ABSTFN + "/y")
+ safe_rmdir(ABSTFN)
+
+ @unittest.skipUnless(hasattr(os, "symlink"),
+ "Missing symlink implementation")
+ @skip_if_ABSTFN_contains_backslash
+ def test_realpath_resolve_before_normalizing(self):
+ # Bug #990669: Symbolic links should be resolved before we
+ # normalize the path. E.g.: if we have directories 'a', 'k' and 'y'
+ # in the following hierarchy:
+ # a/k/y
+ #
+ # and a symbolic link 'link-y' pointing to 'y' in directory 'a',
+ # then realpath("link-y/..") should return 'k', not 'a'.
+ try:
+ old_path = abspath('.')
+ os.mkdir(ABSTFN)
+ os.mkdir(ABSTFN + "/k")
+ os.mkdir(ABSTFN + "/k/y")
+ os.symlink(ABSTFN + "/k/y", ABSTFN + "/link-y")
+
+ # Absolute path.
+ self.assertEqual(realpath(ABSTFN + "/link-y/.."), ABSTFN + "/k")
+ # Relative path.
+ os.chdir(dirname(ABSTFN))
+ self.assertEqual(realpath(basename(ABSTFN) + "/link-y/.."),
+ ABSTFN + "/k")
+ finally:
+ os.chdir(old_path)
+ support.unlink(ABSTFN + "/link-y")
+ safe_rmdir(ABSTFN + "/k/y")
+ safe_rmdir(ABSTFN + "/k")
+ safe_rmdir(ABSTFN)
+
+ @unittest.skipUnless(hasattr(os, "symlink"),
+ "Missing symlink implementation")
+ @skip_if_ABSTFN_contains_backslash
+ def test_realpath_resolve_first(self):
+ # Bug #1213894: The first component of the path, if not absolute,
+ # must be resolved too.
+
+ try:
+ old_path = abspath('.')
+ os.mkdir(ABSTFN)
+ os.mkdir(ABSTFN + "/k")
+ os.symlink(ABSTFN, ABSTFN + "link")
+ os.chdir(dirname(ABSTFN))
+
+ base = basename(ABSTFN)
+ self.assertEqual(realpath(base + "link"), ABSTFN)
+ self.assertEqual(realpath(base + "link/k"), ABSTFN + "/k")
+ finally:
+ os.chdir(old_path)
+ support.unlink(ABSTFN + "link")
+ safe_rmdir(ABSTFN + "/k")
+ safe_rmdir(ABSTFN)
def test_relpath(self):
(real_getcwd, os.getcwd) = (os.getcwd, lambda: r"/home/user/bar")
@@ -644,8 +501,20 @@ class PosixPathTest(unittest.TestCase):
finally:
os.getcwdb = real_getcwdb
+ def test_sameopenfile(self):
+ fname = support.TESTFN + "1"
+ with open(fname, "wb") as a, open(fname, "wb") as b:
+ self.assertTrue(posixpath.sameopenfile(a.fileno(), b.fileno()))
+
+
+class PosixCommonTest(test_genericpath.CommonTest):
+ pathmodule = posixpath
+ attributes = ['relpath', 'samefile', 'sameopenfile', 'samestat']
+
+
def test_main():
- support.run_unittest(PosixPathTest)
+ support.run_unittest(PosixPathTest, PosixCommonTest)
+
if __name__=="__main__":
test_main()
diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py
index ad3a19396a..4e53cd8a01 100644
--- a/Lib/test/test_pprint.py
+++ b/Lib/test/test_pprint.py
@@ -3,6 +3,8 @@ import test.support
import unittest
import test.test_set
import random
+import collections
+import itertools
# list, tuple and dict subclasses that do or don't overwrite __repr__
class list2(list):
@@ -195,6 +197,20 @@ class QueryTestCase(unittest.TestCase):
self.assertEqual(pprint.pformat({"xy\tab\n": (3,), 5: [[]], (): {}}),
r"{5: [[]], 'xy\tab\n': (3,), (): {}}")
+ def test_ordered_dict(self):
+ words = 'the quick brown fox jumped over a lazy dog'.split()
+ d = collections.OrderedDict(zip(words, itertools.count()))
+ self.assertEqual(pprint.pformat(d),
+"""\
+{'the': 0,
+ 'quick': 1,
+ 'brown': 2,
+ 'fox': 3,
+ 'jumped': 4,
+ 'over': 5,
+ 'a': 6,
+ 'lazy': 7,
+ 'dog': 8}""")
def test_subclassing(self):
o = {'names with spaces': 'should be presented using repr()',
'others.should.not.be': 'like.this'}
@@ -203,7 +219,29 @@ class QueryTestCase(unittest.TestCase):
others.should.not.be: like.this}"""
self.assertEqual(DottedPrettyPrinter().pformat(o), exp)
+ @test.support.cpython_only
def test_set_reprs(self):
+ # This test creates a complex arrangement of frozensets and
+ # compares the pretty-printed repr against a string hard-coded in
+ # the test. The hard-coded repr depends on the sort order of
+ # frozensets.
+ #
+ # However, as the docs point out: "Since sets only define
+ # partial ordering (subset relationships), the output of the
+ # list.sort() method is undefined for lists of sets."
+ #
+ # In a nutshell, the test assumes frozenset({0}) will always
+ # sort before frozenset({1}), but:
+ #
+ # >>> frozenset({0}) < frozenset({1})
+ # False
+ # >>> frozenset({1}) < frozenset({0})
+ # False
+ #
+ # Consequently, this test is fragile and
+ # implementation-dependent. Small changes to Python's sort
+ # algorithm cause the test to fail when it should pass.
+
self.assertEqual(pprint.pformat(set()), 'set()')
self.assertEqual(pprint.pformat(set(range(3))), '{0, 1, 2}')
self.assertEqual(pprint.pformat(frozenset()), 'frozenset()')
diff --git a/Lib/test/test_print.py b/Lib/test/test_print.py
index b1ace4dc2c..8d37bbc4d6 100644
--- a/Lib/test/test_print.py
+++ b/Lib/test/test_print.py
@@ -8,7 +8,6 @@ from __future__ import print_function
import unittest
from test import support
-import sys
try:
# 3.x
from io import StringIO
diff --git a/Lib/test/test_profile.py b/Lib/test/test_profile.py
index 243a322582..cd7ec58e23 100755..100644
--- a/Lib/test/test_profile.py
+++ b/Lib/test/test_profile.py
@@ -1,6 +1,5 @@
"""Test suite for the profile module."""
-import os
import sys
import pstats
import unittest
@@ -72,7 +71,7 @@ class ProfileTest(unittest.TestCase):
stats = pstats.Stats(prof, stream=s)
stats.print_stats()
res = s.getvalue()
- self.assertTrue(self.expected_max_output in res,
+ self.assertIn(self.expected_max_output, res,
"Profiling {0!r} didn't report max:\n{1}".format(stmt, res))
diff --git a/Lib/test/test_property.py b/Lib/test/test_property.py
index d9469d97d0..cc6a872179 100644
--- a/Lib/test/test_property.py
+++ b/Lib/test/test_property.py
@@ -1,6 +1,7 @@
# Test case for property
# more tests are in test_descr
+import sys
import unittest
from test.support import run_unittest
@@ -91,7 +92,6 @@ class PropertyTests(unittest.TestCase):
base.spam = 20
self.assertEqual(base.spam, 20)
self.assertEqual(base._spam, 20)
- self.assertEqual(base.__class__.spam.__doc__, "BaseClass.getter")
def test_property_decorator_subclass(self):
# see #1620
@@ -99,14 +99,27 @@ class PropertyTests(unittest.TestCase):
self.assertRaises(PropertyGet, getattr, sub, "spam")
self.assertRaises(PropertySet, setattr, sub, "spam", None)
self.assertRaises(PropertyDel, delattr, sub, "spam")
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_property_decorator_subclass_doc(self):
+ sub = SubClass()
self.assertEqual(sub.__class__.spam.__doc__, "SubClass.getter")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_property_decorator_baseclass_doc(self):
+ base = BaseClass()
+ self.assertEqual(base.__class__.spam.__doc__, "BaseClass.getter")
+
def test_property_decorator_doc(self):
base = PropertyDocBase()
sub = PropertyDocSub()
self.assertEqual(base.__class__.spam.__doc__, "spam spam spam")
self.assertEqual(sub.__class__.spam.__doc__, "spam spam spam")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_property_getter_doc_override(self):
newgettersub = PropertySubNewGetter()
self.assertEqual(newgettersub.spam, 5)
@@ -126,16 +139,6 @@ class PropertySubSlots(property):
class PropertySubclassTests(unittest.TestCase):
- def test_docstring_copy(self):
- class Foo(object):
- @PropertySub
- def spam(self):
- """spam wrapped in property subclass"""
- return 1
- self.assertEqual(
- Foo.spam.__doc__,
- "spam wrapped in property subclass")
-
def test_slots_docstring_copy_exception(self):
try:
class Foo(object):
@@ -148,6 +151,20 @@ class PropertySubclassTests(unittest.TestCase):
else:
raise Exception("AttributeError not raised")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_docstring_copy(self):
+ class Foo(object):
+ @PropertySub
+ def spam(self):
+ """spam wrapped in property subclass"""
+ return 1
+ self.assertEqual(
+ Foo.spam.__doc__,
+ "spam wrapped in property subclass")
+
+ @unittest.skipIf(sys.flags.optimize <= 2,
+ "Docstrings are omitted with -O2 and above")
def test_property_setter_copies_getter_docstring(self):
class Foo(object):
def __init__(self): self._spam = 1
@@ -179,6 +196,8 @@ class PropertySubclassTests(unittest.TestCase):
FooSub.spam.__doc__,
"spam wrapped in property subclass")
+ @unittest.skipIf(sys.flags.optimize <= 2,
+ "Docstrings are omitted with -O2 and above")
def test_property_new_getter_new_docstring(self):
class Foo(object):
diff --git a/Lib/test/test_pstats.py b/Lib/test/test_pstats.py
index 7c28465c3b..9ebeebbfee 100644
--- a/Lib/test/test_pstats.py
+++ b/Lib/test/test_pstats.py
@@ -1,5 +1,6 @@
import unittest
from test import support
+from io import StringIO
import pstats
@@ -8,8 +9,8 @@ class AddCallersTestCase(unittest.TestCase):
"""Tests for pstats.add_callers helper."""
def test_combine_results(self):
- """pstats.add_callers should combine the call results of both target
- and source by adding the call time. See issue1269."""
+ # pstats.add_callers should combine the call results of both target
+ # and source by adding the call time. See issue1269.
# new format: used by the cProfile module
target = {"a": (1, 2, 3, 4)}
source = {"a": (1, 2, 3, 4), "b": (5, 6, 7, 8)}
@@ -22,9 +23,21 @@ class AddCallersTestCase(unittest.TestCase):
self.assertEqual(new_callers, {'a': 2, 'b': 5})
+class StatsTestCase(unittest.TestCase):
+ def setUp(self):
+ stats_file = support.findfile('pstats.pck')
+ self.stats = pstats.Stats(stats_file)
+
+ def test_add(self):
+ stream = StringIO()
+ stats = pstats.Stats(stream=stream)
+ stats.add(self.stats, self.stats)
+
+
def test_main():
support.run_unittest(
- AddCallersTestCase
+ AddCallersTestCase,
+ StatsTestCase,
)
diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py
index 406578a70d..ae1c8feca6 100644
--- a/Lib/test/test_pwd.py
+++ b/Lib/test/test_pwd.py
@@ -1,3 +1,4 @@
+import sys
import unittest
from test import support
@@ -13,19 +14,19 @@ class PwdTest(unittest.TestCase):
for e in entries:
self.assertEqual(len(e), 7)
self.assertEqual(e[0], e.pw_name)
- self.assertTrue(isinstance(e.pw_name, str))
+ self.assertIsInstance(e.pw_name, str)
self.assertEqual(e[1], e.pw_passwd)
- self.assertTrue(isinstance(e.pw_passwd, str))
+ self.assertIsInstance(e.pw_passwd, str)
self.assertEqual(e[2], e.pw_uid)
- self.assertTrue(isinstance(e.pw_uid, int))
+ self.assertIsInstance(e.pw_uid, int)
self.assertEqual(e[3], e.pw_gid)
- self.assertTrue(isinstance(e.pw_gid, int))
+ self.assertIsInstance(e.pw_gid, int)
self.assertEqual(e[4], e.pw_gecos)
- self.assertTrue(isinstance(e.pw_gecos, str))
+ self.assertIsInstance(e.pw_gecos, str)
self.assertEqual(e[5], e.pw_dir)
- self.assertTrue(isinstance(e.pw_dir, str))
+ self.assertIsInstance(e.pw_dir, str)
self.assertEqual(e[6], e.pw_shell)
- self.assertTrue(isinstance(e.pw_shell, str))
+ self.assertIsInstance(e.pw_shell, str)
# The following won't work, because of duplicate entries
# for one uid
@@ -43,8 +44,8 @@ class PwdTest(unittest.TestCase):
for e in entries:
if not e[0] or e[0] == '+':
continue # skip NIS entries etc.
- self.assertTrue(pwd.getpwnam(e.pw_name) in entriesbyname[e.pw_name])
- self.assertTrue(pwd.getpwuid(e.pw_uid) in entriesbyuid[e.pw_uid])
+ self.assertIn(pwd.getpwnam(e.pw_name), entriesbyname[e.pw_name])
+ self.assertIn(pwd.getpwuid(e.pw_uid), entriesbyuid[e.pw_uid])
def test_errors(self):
self.assertRaises(TypeError, pwd.getpwuid)
@@ -83,11 +84,13 @@ class PwdTest(unittest.TestCase):
self.assertRaises(KeyError, pwd.getpwnam, fakename)
- # Choose a non-existent uid.
- fakeuid = 4127
- while fakeuid in byuids:
- fakeuid = (fakeuid * 3) % 0x10000
-
+ # In some cases, byuids isn't a complete list of all users in the
+ # system, so if we try to pick a value not in byuids (via a perturbing
+ # loop, say), pwd.getpwuid() might still be able to find data for that
+ # uid. Using sys.maxint may provoke the same problems, but hopefully
+ # it will be a more repeatable failure.
+ fakeuid = sys.maxsize
+ self.assertNotIn(fakeuid, byuids)
self.assertRaises(KeyError, pwd.getpwuid, fakeuid)
def test_main():
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index 5b6fcb0330..3082b29dbc 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -40,7 +40,7 @@ class PyclbrTest(TestCase):
if key in ignore: return
if key not in obj:
print("***",key, file=sys.stderr)
- self.assertTrue(key in obj, "%r in %r" % (key, obj))
+ self.assertIn(key, obj)
def assertEqualsOrIgnored(self, a, b, ignore):
''' succeed iff a == b or a in ignore or b in ignore '''
@@ -84,12 +84,12 @@ class PyclbrTest(TestCase):
self.assertHasattr(module, name, ignore)
py_item = getattr(module, name)
if isinstance(value, pyclbr.Function):
- self.assertTrue(isinstance(py_item, (FunctionType, BuiltinFunctionType)))
+ self.assertIsInstance(py_item, (FunctionType, BuiltinFunctionType))
if py_item.__module__ != moduleName:
continue # skip functions that came from somewhere else
self.assertEqual(py_item.__module__, value.module)
else:
- self.assertTrue(isinstance(py_item, type))
+ self.assertIsInstance(py_item, type)
if py_item.__module__ != moduleName:
continue # skip classes that came from somewhere else
@@ -141,7 +141,8 @@ class PyclbrTest(TestCase):
def test_easy(self):
self.checkModule('pyclbr')
self.checkModule('ast')
- self.checkModule('doctest', ignore=("TestResults", "_SpoofOut"))
+ self.checkModule('doctest', ignore=("TestResults", "_SpoofOut",
+ "DocTestCase"))
self.checkModule('difflib', ignore=("Match",))
def test_decorators(self):
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index fa49bb8ea0..bcddff3ec7 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -1,22 +1,30 @@
-import sys
import os
-import os.path
+import sys
import difflib
-import subprocess
-import re
-import pydoc
import inspect
+import pydoc
import keyword
-import unittest
+import re
+import string
+import subprocess
import test.support
+import time
+import unittest
import xml.etree
+import textwrap
+from io import StringIO
+from collections import namedtuple
from contextlib import contextmanager
-from test.support import TESTFN, forget, rmtree, EnvironmentVarGuard
+from test.support import TESTFN, forget, rmtree, EnvironmentVarGuard, \
+ reap_children, captured_output, captured_stdout
from test import pydoc_mod
-expected_text_pattern = \
-"""
+# Just in case sys.modules["test"] has the optional attribute __loader__.
+if hasattr(pydoc_mod, "__loader__"):
+ del pydoc_mod.__loader__
+
+expected_text_pattern = """
NAME
test.pydoc_mod - This is a test module for test_pydoc
%s
@@ -81,8 +89,7 @@ FILE
%s
""".strip()
-expected_html_pattern = \
-"""
+expected_html_pattern = """
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
@@ -178,7 +185,7 @@ war</tt></dd></dl>
\x20\x20\x20\x20
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%">Nobody</td></tr></table>
-""".strip()
+""".strip() # ' <- emacs turd
# output pattern for missing module
@@ -193,8 +200,11 @@ def run_pydoc(module_name, *args):
output of pydoc.
"""
cmd = [sys.executable, pydoc.__file__, " ".join(args), module_name]
- output = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout.read()
- return output.strip()
+ try:
+ output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
+ return output.strip()
+ finally:
+ reap_children()
def get_pydoc_html(module):
"Returns pydoc generated output as html"
@@ -214,22 +224,32 @@ def get_pydoc_text(module):
output = doc.docmodule(module)
- # cleanup the extra text formatting that pydoc preforms
+ # clean up the extra text formatting that pydoc performs
patt = re.compile('\b.')
output = patt.sub('', output)
return output.strip(), loc
def print_diffs(text1, text2):
"Prints unified diffs for two texts"
+ # XXX now obsolete, use unittest built-in support
lines1 = text1.splitlines(True)
lines2 = text2.splitlines(True)
diffs = difflib.unified_diff(lines1, lines2, n=0, fromfile='expected',
tofile='got')
print('\n' + ''.join(diffs))
+def get_html_title(text):
+ # Bit of hack, but good enough for test purposes
+ header, _, _ = text.partition("</head>")
+ _, _, title = header.partition("<title>")
+ title, _, _ = title.partition("</title>")
+ return title
-class PyDocDocTest(unittest.TestCase):
+class PydocDocTest(unittest.TestCase):
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_html_doc(self):
result, doc_loc = get_pydoc_html(pydoc_mod)
mod_file = inspect.getabsfile(pydoc_mod)
@@ -243,6 +263,8 @@ class PyDocDocTest(unittest.TestCase):
print_diffs(expected_html, result)
self.fail("outputs are not equal, see diff above")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_text_doc(self):
result, doc_loc = get_pydoc_text(pydoc_mod)
expected_text = expected_text_pattern % \
@@ -272,7 +294,8 @@ class PyDocDocTest(unittest.TestCase):
('i_am_not_here', 'i_am_not_here'),
('test.i_am_not_here_either', 'i_am_not_here_either'),
('test.i_am_not_here.neither_am_i', 'i_am_not_here.neither_am_i'),
- ('i_am_not_here.{}'.format(modname), 'i_am_not_here.{}'.format(modname)),
+ ('i_am_not_here.{}'.format(modname),
+ 'i_am_not_here.{}'.format(modname)),
('test.{}'.format(modname), modname),
)
@@ -289,9 +312,8 @@ class PyDocDocTest(unittest.TestCase):
fullmodname = os.path.join(TESTFN, modname)
sourcefn = fullmodname + os.extsep + "py"
for importstring, expectedinmsg in testpairs:
- f = open(sourcefn, 'w')
- f.write("import {}\n".format(importstring))
- f.close()
+ with open(sourcefn, 'w') as f:
+ f.write("import {}\n".format(importstring))
try:
result = run_pydoc(modname).decode("ascii")
finally:
@@ -318,6 +340,50 @@ class PyDocDocTest(unittest.TestCase):
self.assertEqual(stripid("<type 'exceptions.Exception'>"),
"<type 'exceptions.Exception'>")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ 'Docstrings are omitted with -O2 and above')
+ def test_help_output_redirect(self):
+ # issue 940286, if output is set in Helper, then all output from
+ # Helper.help should be redirected
+ old_pattern = expected_text_pattern
+ getpager_old = pydoc.getpager
+ getpager_new = lambda: (lambda x: x)
+ self.maxDiff = None
+
+ buf = StringIO()
+ helper = pydoc.Helper(output=buf)
+ unused, doc_loc = get_pydoc_text(pydoc_mod)
+ module = "test.pydoc_mod"
+ help_header = """
+ Help on module test.pydoc_mod in test:
+
+ """.lstrip()
+ help_header = textwrap.dedent(help_header)
+ expected_help_pattern = help_header + expected_text_pattern
+
+ pydoc.getpager = getpager_new
+ try:
+ with captured_output('stdout') as output, \
+ captured_output('stderr') as err:
+ helper.help(module)
+ result = buf.getvalue().strip()
+ expected_text = expected_help_pattern % \
+ (doc_loc, inspect.getabsfile(pydoc_mod))
+ self.assertEqual('', output.getvalue())
+ self.assertEqual('', err.getvalue())
+ self.assertEqual(expected_text, result)
+ finally:
+ pydoc.getpager = getpager_old
+
+ def test_namedtuple_public_underscore(self):
+ NT = namedtuple('NT', ['abc', 'def'], rename=True)
+ with captured_stdout() as help_io:
+ help(NT)
+ helptext = help_io.getvalue()
+ self.assertIn('_1', helptext)
+ self.assertIn('_replace', helptext)
+ self.assertIn('_asdict', helptext)
+
class TestDescriptions(unittest.TestCase):
@@ -325,24 +391,79 @@ class TestDescriptions(unittest.TestCase):
# Check that pydocfodder module can be described
from test import pydocfodder
doc = pydoc.render_doc(pydocfodder)
- self.assertTrue("pydocfodder" in doc)
-
- def test_classic_class(self):
- class C: "Classic class"
- c = C()
- self.assertEqual(pydoc.describe(C), 'class C')
- self.assertEqual(pydoc.describe(c), 'C')
- expected = 'C in module %s' % __name__
- self.assertTrue(expected in pydoc.render_doc(c))
+ self.assertIn("pydocfodder", doc)
def test_class(self):
- class C(object): "New-style class"
+ class C: "New-style class"
c = C()
self.assertEqual(pydoc.describe(C), 'class C')
self.assertEqual(pydoc.describe(c), 'C')
expected = 'C in module %s object' % __name__
- self.assertTrue(expected in pydoc.render_doc(c))
+ self.assertIn(expected, pydoc.render_doc(c))
+
+
+class PydocServerTest(unittest.TestCase):
+ """Tests for pydoc._start_server"""
+
+ def test_server(self):
+
+ # Minimal test that starts the server, then stops it.
+ def my_url_handler(url, content_type):
+ text = 'the URL sent was: (%s, %s)' % (url, content_type)
+ return text
+
+ serverthread = pydoc._start_server(my_url_handler, port=0)
+ starttime = time.time()
+ timeout = 1 #seconds
+
+ while serverthread.serving:
+ time.sleep(.01)
+ if serverthread.serving and time.time() - starttime > timeout:
+ serverthread.stop()
+ break
+
+ self.assertEqual(serverthread.error, None)
+
+
+class PydocUrlHandlerTest(unittest.TestCase):
+ """Tests for pydoc._url_handler"""
+
+ def test_content_type_err(self):
+ f = pydoc._url_handler
+ self.assertRaises(TypeError, f, 'A', '')
+ self.assertRaises(TypeError, f, 'B', 'foobar')
+
+ def test_url_requests(self):
+ # Test for the correct title in the html pages returned.
+ # This tests the different parts of the URL handler without
+ # getting too picky about the exact html.
+ requests = [
+ ("", "Pydoc: Index of Modules"),
+ ("get?key=", "Pydoc: Index of Modules"),
+ ("index", "Pydoc: Index of Modules"),
+ ("topics", "Pydoc: Topics"),
+ ("keywords", "Pydoc: Keywords"),
+ ("pydoc", "Pydoc: module pydoc"),
+ ("get?key=pydoc", "Pydoc: module pydoc"),
+ ("search?key=pydoc", "Pydoc: Search Results"),
+ ("topic?key=def", "Pydoc: KEYWORD def"),
+ ("topic?key=STRINGS", "Pydoc: TOPIC STRINGS"),
+ ("foobar", "Pydoc: Error - foobar"),
+ ("getfile?key=foobar", "Pydoc: Error - getfile?key=foobar"),
+ ]
+
+ for url, title in requests:
+ text = pydoc._url_handler(url, "text/html")
+ result = get_html_title(text)
+ self.assertEqual(result, title)
+
+ path = string.__file__
+ title = "Pydoc: getfile " + path
+ url = "getfile?key=" + path
+ text = pydoc._url_handler(url, "text/html")
+ result = get_html_title(text)
+ self.assertEqual(result, title)
class TestHelper(unittest.TestCase):
@@ -351,7 +472,12 @@ class TestHelper(unittest.TestCase):
sorted(keyword.kwlist))
def test_main():
- test.support.run_unittest(PyDocDocTest, TestDescriptions, TestHelper)
+ test.support.run_unittest(PydocDocTest,
+ TestDescriptions,
+ PydocServerTest,
+ PydocUrlHandlerTest,
+ TestHelper,
+ )
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
index 133c02b5ba..27eecb8d83 100644
--- a/Lib/test/test_pyexpat.py
+++ b/Lib/test/test_pyexpat.py
@@ -2,11 +2,10 @@
# handler, are obscure and unhelpful.
from io import BytesIO
-import sys
import unittest
-import pyexpat
from xml.parsers import expat
+from xml.parsers.expat import errors
from test.support import sortdict, run_unittest
@@ -38,6 +37,7 @@ data = b'''\
<!-- comment data -->
<!DOCTYPE quotations SYSTEM "quotations.dtd" [
<!ELEMENT root ANY>
+<!ATTLIST root attr1 CDATA #REQUIRED attr2 CDATA #IMPLIED>
<!NOTATION notation SYSTEM "notation.jpeg">
<!ENTITY acirc "&#226;">
<!ENTITY external_entity SYSTEM "entity.file">
@@ -51,6 +51,7 @@ data = b'''\
</myns:subelement>
<sub2><![CDATA[contents of CDATA section]]></sub2>
&external_entity;
+&skipped_entity;
</root>
'''
@@ -99,7 +100,7 @@ class ParseTest(unittest.TestCase):
entityName, base, systemId, publicId, notationName = args
self.out.append('Unparsed entity decl: %s' %(args,))
- def NotStandaloneHandler(self, userData):
+ def NotStandaloneHandler(self):
self.out.append('Not standalone')
return 1
@@ -108,6 +109,34 @@ class ParseTest(unittest.TestCase):
self.out.append('External entity ref: %s' %(args[1:],))
return 1
+ def StartDoctypeDeclHandler(self, *args):
+ self.out.append(('Start doctype', args))
+ return 1
+
+ def EndDoctypeDeclHandler(self):
+ self.out.append("End doctype")
+ return 1
+
+ def EntityDeclHandler(self, *args):
+ self.out.append(('Entity declaration', args))
+ return 1
+
+ def XmlDeclHandler(self, *args):
+ self.out.append(('XML declaration', args))
+ return 1
+
+ def ElementDeclHandler(self, *args):
+ self.out.append(('Element declaration', args))
+ return 1
+
+ def AttlistDeclHandler(self, *args):
+ self.out.append(('Attribute list declaration', args))
+ return 1
+
+ def SkippedEntityHandler(self, *args):
+ self.out.append(("Skipped entity", args))
+ return 1
+
def DefaultHandler(self, userData):
pass
@@ -115,61 +144,86 @@ class ParseTest(unittest.TestCase):
pass
handler_names = [
- 'StartElementHandler', 'EndElementHandler',
- 'CharacterDataHandler', 'ProcessingInstructionHandler',
- 'UnparsedEntityDeclHandler', 'NotationDeclHandler',
- 'StartNamespaceDeclHandler', 'EndNamespaceDeclHandler',
- 'CommentHandler', 'StartCdataSectionHandler',
- 'EndCdataSectionHandler',
- 'DefaultHandler', 'DefaultHandlerExpand',
- #'NotStandaloneHandler',
- 'ExternalEntityRefHandler'
+ 'StartElementHandler', 'EndElementHandler', 'CharacterDataHandler',
+ 'ProcessingInstructionHandler', 'UnparsedEntityDeclHandler',
+ 'NotationDeclHandler', 'StartNamespaceDeclHandler',
+ 'EndNamespaceDeclHandler', 'CommentHandler',
+ 'StartCdataSectionHandler', 'EndCdataSectionHandler', 'DefaultHandler',
+ 'DefaultHandlerExpand', 'NotStandaloneHandler',
+ 'ExternalEntityRefHandler', 'StartDoctypeDeclHandler',
+ 'EndDoctypeDeclHandler', 'EntityDeclHandler', 'XmlDeclHandler',
+ 'ElementDeclHandler', 'AttlistDeclHandler', 'SkippedEntityHandler',
]
- def _verify_parse_output(self, op):
- self.assertEqual(op[0], 'PI: \'xml-stylesheet\' \'href="stylesheet.css"\'')
- self.assertEqual(op[1], "Comment: ' comment data '")
- self.assertEqual(op[2], "Notation declared: ('notation', None, 'notation.jpeg', None)")
- self.assertEqual(op[3], "Unparsed entity decl: ('unparsed_entity', None, 'entity.file', None, 'notation')")
- self.assertEqual(op[4], "Start element: 'root' {'attr1': 'value1', 'attr2': 'value2\u1f40'}")
- self.assertEqual(op[5], "NS decl: 'myns' 'http://www.python.org/namespace'")
- self.assertEqual(op[6], "Start element: 'http://www.python.org/namespace!subelement' {}")
- self.assertEqual(op[7], "Character data: 'Contents of subelements'")
- self.assertEqual(op[8], "End element: 'http://www.python.org/namespace!subelement'")
- self.assertEqual(op[9], "End of NS decl: 'myns'")
- self.assertEqual(op[10], "Start element: 'sub2' {}")
- self.assertEqual(op[11], 'Start of CDATA section')
- self.assertEqual(op[12], "Character data: 'contents of CDATA section'")
- self.assertEqual(op[13], 'End of CDATA section')
- self.assertEqual(op[14], "End element: 'sub2'")
- self.assertEqual(op[15], "External entity ref: (None, 'entity.file', None)")
- self.assertEqual(op[16], "End element: 'root'")
-
+ def _hookup_callbacks(self, parser, handler):
+ """
+ Set each of the callbacks defined on handler and named in
+ self.handler_names on the given parser.
+ """
+ for name in self.handler_names:
+ setattr(parser, name, getattr(handler, name))
+
+ def _verify_parse_output(self, operations):
+ expected_operations = [
+ ('XML declaration', ('1.0', 'iso-8859-1', 0)),
+ 'PI: \'xml-stylesheet\' \'href="stylesheet.css"\'',
+ "Comment: ' comment data '",
+ "Not standalone",
+ ("Start doctype", ('quotations', 'quotations.dtd', None, 1)),
+ ('Element declaration', ('root', (2, 0, None, ()))),
+ ('Attribute list declaration', ('root', 'attr1', 'CDATA', None,
+ 1)),
+ ('Attribute list declaration', ('root', 'attr2', 'CDATA', None,
+ 0)),
+ "Notation declared: ('notation', None, 'notation.jpeg', None)",
+ ('Entity declaration', ('acirc', 0, '\xe2', None, None, None, None)),
+ ('Entity declaration', ('external_entity', 0, None, None,
+ 'entity.file', None, None)),
+ "Unparsed entity decl: ('unparsed_entity', None, 'entity.file', None, 'notation')",
+ "Not standalone",
+ "End doctype",
+ "Start element: 'root' {'attr1': 'value1', 'attr2': 'value2\u1f40'}",
+ "NS decl: 'myns' 'http://www.python.org/namespace'",
+ "Start element: 'http://www.python.org/namespace!subelement' {}",
+ "Character data: 'Contents of subelements'",
+ "End element: 'http://www.python.org/namespace!subelement'",
+ "End of NS decl: 'myns'",
+ "Start element: 'sub2' {}",
+ 'Start of CDATA section',
+ "Character data: 'contents of CDATA section'",
+ 'End of CDATA section',
+ "End element: 'sub2'",
+ "External entity ref: (None, 'entity.file', None)",
+ ('Skipped entity', ('skipped_entity', 0)),
+ "End element: 'root'",
+ ]
+ for operation, expected_operation in zip(operations, expected_operations):
+ self.assertEqual(operation, expected_operation)
def test_unicode(self):
# Try the parse again, this time producing Unicode output
out = self.Outputter()
parser = expat.ParserCreate(namespace_separator='!')
- for name in self.handler_names:
- setattr(parser, name, getattr(out, name))
+ self._hookup_callbacks(parser, out)
parser.Parse(data, 1)
- op = out.out
- self._verify_parse_output(op)
+ operations = out.out
+ self._verify_parse_output(operations)
+ # Issue #6697.
+ self.assertRaises(AttributeError, getattr, parser, '\uD800')
def test_parse_file(self):
# Try parsing a file
out = self.Outputter()
parser = expat.ParserCreate(namespace_separator='!')
- for name in self.handler_names:
- setattr(parser, name, getattr(out, name))
+ self._hookup_callbacks(parser, out)
file = BytesIO(data)
parser.ParseFile(file)
- op = out.out
- self._verify_parse_output(op)
+ operations = out.out
+ self._verify_parse_output(operations)
class NamespaceSeparatorTest(unittest.TestCase):
def test_legal(self):
@@ -185,7 +239,7 @@ class NamespaceSeparatorTest(unittest.TestCase):
self.fail()
except TypeError as e:
self.assertEqual(str(e),
- 'ParserCreate() argument 2 must be string or None, not int')
+ 'ParserCreate() argument 2 must be str or None, not int')
try:
expat.ParserCreate(namespace_separator='too long')
@@ -222,6 +276,25 @@ class InterningTest(unittest.TestCase):
# L should have the same string repeated over and over.
self.assertTrue(tag is entry)
+ def test_issue9402(self):
+ # create an ExternalEntityParserCreate with buffer text
+ class ExternalOutputter:
+ def __init__(self, parser):
+ self.parser = parser
+ self.parser_result = None
+
+ def ExternalEntityRefHandler(self, context, base, sysId, pubId):
+ external_parser = self.parser.ExternalEntityParserCreate("")
+ self.parser_result = external_parser.Parse("", 1)
+ return 1
+
+ parser = expat.ParserCreate(namespace_separator='!')
+ parser.buffer_text = 1
+ out = ExternalOutputter(parser)
+ parser.ExternalEntityRefHandler = out.ExternalEntityRefHandler
+ parser.Parse(data, 1)
+ self.assertEqual(out.parser_result, 1)
+
class BufferTextTest(unittest.TestCase):
def setUp(self):
@@ -510,7 +583,7 @@ class ChardataBufferTest(unittest.TestCase):
parser.Parse(xml2, 1)
self.assertEqual(self.n, 4)
-class MalformedInputText(unittest.TestCase):
+class MalformedInputTest(unittest.TestCase):
def test1(self):
xml = "\0\r\n"
parser = expat.ParserCreate()
@@ -529,6 +602,65 @@ class MalformedInputText(unittest.TestCase):
except expat.ExpatError as e:
self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14')
+class ErrorMessageTest(unittest.TestCase):
+ def test_codes(self):
+ # verify mapping of errors.codes and errors.messages
+ self.assertEqual(errors.XML_ERROR_SYNTAX,
+ errors.messages[errors.codes[errors.XML_ERROR_SYNTAX]])
+
+ def test_expaterror(self):
+ xml = '<'
+ parser = expat.ParserCreate()
+ try:
+ parser.Parse(xml, True)
+ self.fail()
+ except expat.ExpatError as e:
+ self.assertEqual(e.code,
+ errors.codes[errors.XML_ERROR_UNCLOSED_TOKEN])
+
+
+class ForeignDTDTests(unittest.TestCase):
+ """
+ Tests for the UseForeignDTD method of expat parser objects.
+ """
+ def test_use_foreign_dtd(self):
+ """
+ If UseForeignDTD is passed True and a document without an external
+ entity reference is parsed, ExternalEntityRefHandler is first called
+ with None for the public and system ids.
+ """
+ handler_call_args = []
+ def resolve_entity(context, base, system_id, public_id):
+ handler_call_args.append((public_id, system_id))
+ return 1
+
+ parser = expat.ParserCreate()
+ parser.UseForeignDTD(True)
+ parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
+ parser.ExternalEntityRefHandler = resolve_entity
+ parser.Parse("<?xml version='1.0'?><element/>")
+ self.assertEqual(handler_call_args, [(None, None)])
+
+ def test_ignore_use_foreign_dtd(self):
+ """
+ If UseForeignDTD is passed True and a document with an external
+ entity reference is parsed, ExternalEntityRefHandler is called with
+ the public and system ids from the document.
+ """
+ handler_call_args = []
+ def resolve_entity(context, base, system_id, public_id):
+ handler_call_args.append((public_id, system_id))
+ return 1
+
+ parser = expat.ParserCreate()
+ parser.UseForeignDTD(True)
+ parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
+ parser.ExternalEntityRefHandler = resolve_entity
+ parser.Parse(
+ "<?xml version='1.0'?><!DOCTYPE foo PUBLIC 'bar' 'baz'><element/>")
+ self.assertEqual(handler_call_args, [("bar", "baz")])
+
+
def test_main():
run_unittest(SetAttributeTest,
ParseTest,
@@ -539,7 +671,9 @@ def test_main():
PositionTest,
sf1296433Test,
ChardataBufferTest,
- MalformedInputText)
+ MalformedInputTest,
+ ErrorMessageTest,
+ ForeignDTDTests)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py
index c65827d942..8287a5ddf6 100644
--- a/Lib/test/test_queue.py
+++ b/Lib/test/test_queue.py
@@ -1,11 +1,10 @@
# Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
import queue
-import sys
-import threading
import time
import unittest
from test import support
+threading = support.import_module('threading')
QUEUE_SIZE = 5
@@ -91,6 +90,8 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
def simple_queue_test(self, q):
if q.qsize():
raise RuntimeError("Call this function with an empty queue")
+ self.assertTrue(q.empty())
+ self.assertFalse(q.full())
# I guess we better check things actually queue correctly a little :)
q.put(111)
q.put(333)
@@ -109,6 +110,8 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
full = 3 * 2 * QUEUE_SIZE
q.put(last)
self.assertTrue(qfull(q), "Queue should be full")
+ self.assertFalse(q.empty())
+ self.assertTrue(q.full())
try:
q.put(full, block=0)
self.fail("Didn't appear to block with a full queue")
@@ -194,6 +197,37 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
self.simple_queue_test(q)
self.simple_queue_test(q)
+ def test_negative_timeout_raises_exception(self):
+ q = self.type2test(QUEUE_SIZE)
+ with self.assertRaises(ValueError):
+ q.put(1, timeout=-1)
+ with self.assertRaises(ValueError):
+ q.get(1, timeout=-1)
+
+ def test_nowait(self):
+ q = self.type2test(QUEUE_SIZE)
+ for i in range(QUEUE_SIZE):
+ q.put_nowait(1)
+ with self.assertRaises(queue.Full):
+ q.put_nowait(1)
+
+ for i in range(QUEUE_SIZE):
+ q.get_nowait()
+ with self.assertRaises(queue.Empty):
+ q.get_nowait()
+
+ def test_shrinking_queue(self):
+ # issue 10110
+ q = self.type2test(3)
+ q.put(1)
+ q.put(2)
+ q.put(3)
+ with self.assertRaises(queue.Full):
+ q.put_nowait(4)
+ self.assertEqual(q.qsize(), 3)
+ q.maxsize = 2 # shrink the queue
+ with self.assertRaises(queue.Full):
+ q.put_nowait(4)
class QueueTest(BaseQueueTest):
type2test = queue.Queue
diff --git a/Lib/test/test_quopri.py b/Lib/test/test_quopri.py
index 2c52a3c025..583fd456a4 100644
--- a/Lib/test/test_quopri.py
+++ b/Lib/test/test_quopri.py
@@ -178,6 +178,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
(p, e) = self.STRINGS[-1]
process = subprocess.Popen([sys.executable, "-mquopri"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ self.addCleanup(process.stdout.close)
cout, cerr = process.communicate(p)
# On Windows, Python will output the result to stdout using
# CRLF, as the mode of stdout is text mode. To compare this
@@ -193,6 +194,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
(p, e) = self.STRINGS[-1]
process = subprocess.Popen([sys.executable, "-mquopri", "-d"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ self.addCleanup(process.stdout.close)
cout, cerr = process.communicate(e)
cout = cout.decode('latin-1')
p = p.decode('latin-1')
diff --git a/Lib/test/test_raise.py b/Lib/test/test_raise.py
index ff4800b954..d120dc1afa 100644
--- a/Lib/test/test_raise.py
+++ b/Lib/test/test_raise.py
@@ -28,7 +28,7 @@ class TestRaise(unittest.TestCase):
try:
raise
except RuntimeError as e:
- self.assertTrue("No active exception" in str(e))
+ self.assertIn("No active exception", str(e))
else:
self.fail("No exception raised")
@@ -127,7 +127,7 @@ class TestCause(unittest.TestCase):
try:
raise IndexError from 5
except TypeError as e:
- self.assertTrue("exception cause" in str(e))
+ self.assertIn("exception cause", str(e))
else:
self.fail("No exception raised")
@@ -135,7 +135,7 @@ class TestCause(unittest.TestCase):
try:
raise IndexError from KeyError
except IndexError as e:
- self.assertTrue(isinstance(e.__cause__, KeyError))
+ self.assertIsInstance(e.__cause__, KeyError)
else:
self.fail("No exception raised")
@@ -166,7 +166,7 @@ class TestTraceback(unittest.TestCase):
try:
raise IndexError()
except IndexError as e:
- self.assertTrue(isinstance(e.__traceback__, types.TracebackType))
+ self.assertIsInstance(e.__traceback__, types.TracebackType)
else:
self.fail("No exception raised")
@@ -203,7 +203,7 @@ class TestContext(unittest.TestCase):
raise OSError()
except OSError as e:
self.assertNotEqual(e.__context__, context)
- self.assertTrue(isinstance(e.__context__, context))
+ self.assertIsInstance(e.__context__, context)
else:
self.fail("No exception raised")
@@ -216,7 +216,7 @@ class TestContext(unittest.TestCase):
raise OSError
except OSError as e:
self.assertNotEqual(e.__context__, context)
- self.assertTrue(isinstance(e.__context__, context))
+ self.assertIsInstance(e.__context__, context)
else:
self.fail("No exception raised")
@@ -227,7 +227,7 @@ class TestContext(unittest.TestCase):
except:
raise OSError
except OSError as e:
- self.assertTrue(isinstance(e.__context__, ZeroDivisionError))
+ self.assertIsInstance(e.__context__, ZeroDivisionError)
else:
self.fail("No exception raised")
@@ -238,7 +238,7 @@ class TestContext(unittest.TestCase):
except:
xyzzy
except NameError as e:
- self.assertTrue(isinstance(e.__context__, ZeroDivisionError))
+ self.assertIsInstance(e.__context__, ZeroDivisionError)
else:
self.fail("No exception raised")
@@ -260,7 +260,7 @@ class TestContext(unittest.TestCase):
finally:
raise OSError
except OSError as e:
- self.assertTrue(isinstance(e.__context__, ZeroDivisionError))
+ self.assertIsInstance(e.__context__, ZeroDivisionError)
else:
self.fail("No exception raised")
@@ -274,7 +274,7 @@ class TestContext(unittest.TestCase):
with ContextManager():
1/0
except NameError as e:
- self.assertTrue(isinstance(e.__context__, ZeroDivisionError))
+ self.assertIsInstance(e.__context__, ZeroDivisionError)
else:
self.fail("No exception raised")
@@ -320,7 +320,7 @@ class TestContext(unittest.TestCase):
del g
raise KeyError
except Exception as e:
- self.assertTrue(isinstance(e.__context__, ValueError))
+ self.assertIsInstance(e.__context__, ValueError)
f()
@@ -344,7 +344,7 @@ class TestContext(unittest.TestCase):
raise TypeError
except Exception as e:
self.assertNotEqual(e.__context__, None)
- self.assertTrue(isinstance(e.__context__, AttributeError))
+ self.assertIsInstance(e.__context__, AttributeError)
with support.captured_output("stderr"):
f()
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index df07b76c0e..776d0c4163 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -1,11 +1,11 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import unittest
import random
import time
import pickle
import warnings
-from math import log, exp, sqrt, pi, fsum, sin
+from math import log, exp, pi, fsum, sin
from test import support
class TestBasicOps(unittest.TestCase):
@@ -39,9 +39,16 @@ class TestBasicOps(unittest.TestCase):
self.gen.seed(arg)
for arg in [list(range(3)), dict(one=1)]:
self.assertRaises(TypeError, self.gen.seed, arg)
- self.assertRaises(TypeError, self.gen.seed, 1, 2)
+ self.assertRaises(TypeError, self.gen.seed, 1, 2, 3, 4)
self.assertRaises(TypeError, type(self.gen), [])
+ def test_choice(self):
+ choice = self.gen.choice
+ with self.assertRaises(IndexError):
+ choice([])
+ self.assertEqual(choice([50]), 50)
+ self.assertIn(choice([25, 75]), [25, 75])
+
def test_sample(self):
# For the entire allowable range of 0 <= k <= N, validate that
# the sample is of the correct length and contains only unique items
@@ -121,7 +128,15 @@ class TestBasicOps(unittest.TestCase):
f = open(support.findfile(file),"rb")
r = pickle.load(f)
f.close()
- self.assertEqual(r.randrange(1000), value)
+ self.assertEqual(int(r.random()*1000), value)
+
+ def test_bug_9025(self):
+ # Had problem with an uneven distribution in int(n*random())
+ # Verify the fix by checking that distributions fall within expectations.
+ n = 100000
+ randrange = self.gen.randrange
+ k = sum(randrange(6755399441055744) % 3 == 2 for i in range(n))
+ self.assertTrue(0.30 < k/n < .37, (k/n))
class SystemRandom_TestBasicOps(TestBasicOps):
gen = random.SystemRandom()
@@ -211,7 +226,7 @@ class SystemRandom_TestBasicOps(TestBasicOps):
n += n - 1 # check 1 below the next power of two
k = int(1.00001 + _log(n, 2))
- self.assertTrue(k in [numbits, numbits+1])
+ self.assertIn(k, [numbits, numbits+1])
self.assertTrue(2**k > n > 2**(k-2))
n -= n >> 15 # check a little farther below the next power of two
@@ -223,6 +238,17 @@ class SystemRandom_TestBasicOps(TestBasicOps):
class MersenneTwister_TestBasicOps(TestBasicOps):
gen = random.Random()
+ def test_guaranteed_stable(self):
+ # These sequences are guaranteed to stay the same across versions of python
+ self.gen.seed(3456147, version=1)
+ self.assertEqual([self.gen.random().hex() for i in range(4)],
+ ['0x1.ac362300d90d2p-1', '0x1.9d16f74365005p-1',
+ '0x1.1ebb4352e4c4dp-1', '0x1.1a7422abf9c11p-1'])
+ self.gen.seed("the quick brown fox", version=2)
+ self.assertEqual([self.gen.random().hex() for i in range(4)],
+ ['0x1.1239ddfb11b7cp-3', '0x1.b3cbb5c51b120p-4',
+ '0x1.8c4f55116b60fp-1', '0x1.63eb525174a27p-1'])
+
def test_setstate_first_arg(self):
self.assertRaises(ValueError, self.gen.setstate, (1, None, None))
@@ -367,7 +393,7 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
n += n - 1 # check 1 below the next power of two
k = int(1.00001 + _log(n, 2))
- self.assertTrue(k in [numbits, numbits+1])
+ self.assertIn(k, [numbits, numbits+1])
self.assertTrue(2**k > n > 2**(k-2))
n -= n >> 15 # check a little farther below the next power of two
diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py
index c082fd1756..ede07912b0 100644
--- a/Lib/test/test_range.py
+++ b/Lib/test/test_range.py
@@ -5,10 +5,6 @@ import sys
import pickle
import itertools
-import warnings
-warnings.filterwarnings("ignore", "integer argument expected",
- DeprecationWarning, "unittest")
-
# pure Python implementations (3 args only), for comparison
def pyrange(start, stop, step):
if (start - stop) // step < 0:
@@ -63,18 +59,18 @@ class RangeTest(unittest.TestCase):
self.assertEqual(list(range(a+4, a, -2)), [a+4, a+2])
seq = list(range(a, b, c))
- self.assertTrue(a in seq)
- self.assertTrue(b not in seq)
+ self.assertIn(a, seq)
+ self.assertNotIn(b, seq)
self.assertEqual(len(seq), 2)
seq = list(range(b, a, -c))
- self.assertTrue(b in seq)
- self.assertTrue(a not in seq)
+ self.assertIn(b, seq)
+ self.assertNotIn(a, seq)
self.assertEqual(len(seq), 2)
seq = list(range(-a, -b, -c))
- self.assertTrue(-a in seq)
- self.assertTrue(-b not in seq)
+ self.assertIn(-a, seq)
+ self.assertNotIn(-b, seq)
self.assertEqual(len(seq), 2)
self.assertRaises(TypeError, range)
@@ -94,6 +90,250 @@ class RangeTest(unittest.TestCase):
r = range(-sys.maxsize, sys.maxsize, 2)
self.assertEqual(len(r), sys.maxsize)
+ def test_large_operands(self):
+ x = range(10**20, 10**20+10, 3)
+ self.assertEqual(len(x), 4)
+ self.assertEqual(len(list(x)), 4)
+
+ x = range(10**20+10, 10**20, 3)
+ self.assertEqual(len(x), 0)
+ self.assertEqual(len(list(x)), 0)
+
+ x = range(10**20, 10**20+10, -3)
+ self.assertEqual(len(x), 0)
+ self.assertEqual(len(list(x)), 0)
+
+ x = range(10**20+10, 10**20, -3)
+ self.assertEqual(len(x), 4)
+ self.assertEqual(len(list(x)), 4)
+
+ # Now test range() with longs
+ self.assertEqual(list(range(-2**100)), [])
+ self.assertEqual(list(range(0, -2**100)), [])
+ self.assertEqual(list(range(0, 2**100, -1)), [])
+ self.assertEqual(list(range(0, 2**100, -1)), [])
+
+ a = int(10 * sys.maxsize)
+ b = int(100 * sys.maxsize)
+ c = int(50 * sys.maxsize)
+
+ self.assertEqual(list(range(a, a+2)), [a, a+1])
+ self.assertEqual(list(range(a+2, a, -1)), [a+2, a+1])
+ self.assertEqual(list(range(a+4, a, -2)), [a+4, a+2])
+
+ seq = list(range(a, b, c))
+ self.assertIn(a, seq)
+ self.assertNotIn(b, seq)
+ self.assertEqual(len(seq), 2)
+ self.assertEqual(seq[0], a)
+ self.assertEqual(seq[-1], a+c)
+
+ seq = list(range(b, a, -c))
+ self.assertIn(b, seq)
+ self.assertNotIn(a, seq)
+ self.assertEqual(len(seq), 2)
+ self.assertEqual(seq[0], b)
+ self.assertEqual(seq[-1], b-c)
+
+ seq = list(range(-a, -b, -c))
+ self.assertIn(-a, seq)
+ self.assertNotIn(-b, seq)
+ self.assertEqual(len(seq), 2)
+ self.assertEqual(seq[0], -a)
+ self.assertEqual(seq[-1], -a-c)
+
+ def test_large_range(self):
+ # Check long ranges (len > sys.maxsize)
+ # len() is expected to fail due to limitations of the __len__ protocol
+ def _range_len(x):
+ try:
+ length = len(x)
+ except OverflowError:
+ step = x[1] - x[0]
+ length = 1 + ((x[-1] - x[0]) // step)
+ return length
+ a = -sys.maxsize
+ b = sys.maxsize
+ expected_len = b - a
+ x = range(a, b)
+ self.assertIn(a, x)
+ self.assertNotIn(b, x)
+ self.assertRaises(OverflowError, len, x)
+ self.assertEqual(_range_len(x), expected_len)
+ self.assertEqual(x[0], a)
+ idx = sys.maxsize+1
+ self.assertEqual(x[idx], a+idx)
+ self.assertEqual(x[idx:idx+1][0], a+idx)
+ with self.assertRaises(IndexError):
+ x[-expected_len-1]
+ with self.assertRaises(IndexError):
+ x[expected_len]
+
+ a = 0
+ b = 2 * sys.maxsize
+ expected_len = b - a
+ x = range(a, b)
+ self.assertIn(a, x)
+ self.assertNotIn(b, x)
+ self.assertRaises(OverflowError, len, x)
+ self.assertEqual(_range_len(x), expected_len)
+ self.assertEqual(x[0], a)
+ idx = sys.maxsize+1
+ self.assertEqual(x[idx], a+idx)
+ self.assertEqual(x[idx:idx+1][0], a+idx)
+ with self.assertRaises(IndexError):
+ x[-expected_len-1]
+ with self.assertRaises(IndexError):
+ x[expected_len]
+
+ a = 0
+ b = sys.maxsize**10
+ c = 2*sys.maxsize
+ expected_len = 1 + (b - a) // c
+ x = range(a, b, c)
+ self.assertIn(a, x)
+ self.assertNotIn(b, x)
+ self.assertRaises(OverflowError, len, x)
+ self.assertEqual(_range_len(x), expected_len)
+ self.assertEqual(x[0], a)
+ idx = sys.maxsize+1
+ self.assertEqual(x[idx], a+(idx*c))
+ self.assertEqual(x[idx:idx+1][0], a+(idx*c))
+ with self.assertRaises(IndexError):
+ x[-expected_len-1]
+ with self.assertRaises(IndexError):
+ x[expected_len]
+
+ a = sys.maxsize**10
+ b = 0
+ c = -2*sys.maxsize
+ expected_len = 1 + (b - a) // c
+ x = range(a, b, c)
+ self.assertIn(a, x)
+ self.assertNotIn(b, x)
+ self.assertRaises(OverflowError, len, x)
+ self.assertEqual(_range_len(x), expected_len)
+ self.assertEqual(x[0], a)
+ idx = sys.maxsize+1
+ self.assertEqual(x[idx], a+(idx*c))
+ self.assertEqual(x[idx:idx+1][0], a+(idx*c))
+ with self.assertRaises(IndexError):
+ x[-expected_len-1]
+ with self.assertRaises(IndexError):
+ x[expected_len]
+
+ def test_invalid_invocation(self):
+ self.assertRaises(TypeError, range)
+ self.assertRaises(TypeError, range, 1, 2, 3, 4)
+ self.assertRaises(ValueError, range, 1, 2, 0)
+ a = int(10 * sys.maxsize)
+ self.assertRaises(ValueError, range, a, a + 1, int(0))
+ self.assertRaises(TypeError, range, 1., 1., 1.)
+ self.assertRaises(TypeError, range, 1e100, 1e101, 1e101)
+ self.assertRaises(TypeError, range, 0, "spam")
+ self.assertRaises(TypeError, range, 0, 42, "spam")
+ # Exercise various combinations of bad arguments, to check
+ # refcounting logic
+ self.assertRaises(TypeError, range, 0.0)
+ self.assertRaises(TypeError, range, 0, 0.0)
+ self.assertRaises(TypeError, range, 0.0, 0)
+ self.assertRaises(TypeError, range, 0.0, 0.0)
+ self.assertRaises(TypeError, range, 0, 0, 1.0)
+ self.assertRaises(TypeError, range, 0, 0.0, 1)
+ self.assertRaises(TypeError, range, 0, 0.0, 1.0)
+ self.assertRaises(TypeError, range, 0.0, 0, 1)
+ self.assertRaises(TypeError, range, 0.0, 0, 1.0)
+ self.assertRaises(TypeError, range, 0.0, 0.0, 1)
+ self.assertRaises(TypeError, range, 0.0, 0.0, 1.0)
+
+ def test_index(self):
+ u = range(2)
+ self.assertEqual(u.index(0), 0)
+ self.assertEqual(u.index(1), 1)
+ self.assertRaises(ValueError, u.index, 2)
+
+ u = range(-2, 3)
+ self.assertEqual(u.count(0), 1)
+ self.assertEqual(u.index(0), 2)
+ self.assertRaises(TypeError, u.index)
+
+ class BadExc(Exception):
+ pass
+
+ class BadCmp:
+ def __eq__(self, other):
+ if other == 2:
+ raise BadExc()
+ return False
+
+ a = range(4)
+ self.assertRaises(BadExc, a.index, BadCmp())
+
+ a = range(-2, 3)
+ self.assertEqual(a.index(0), 2)
+ self.assertEqual(range(1, 10, 3).index(4), 1)
+ self.assertEqual(range(1, -10, -3).index(-5), 2)
+
+ self.assertEqual(range(10**20).index(1), 1)
+ self.assertEqual(range(10**20).index(10**20 - 1), 10**20 - 1)
+
+ self.assertRaises(ValueError, range(1, 2**100, 2).index, 2**87)
+ self.assertEqual(range(1, 2**100, 2).index(2**87+1), 2**86)
+
+ class AlwaysEqual(object):
+ def __eq__(self, other):
+ return True
+ always_equal = AlwaysEqual()
+ self.assertEqual(range(10).index(always_equal), 0)
+
+ def test_user_index_method(self):
+ bignum = 2*sys.maxsize
+ smallnum = 42
+
+ # User-defined class with an __index__ method
+ class I:
+ def __init__(self, n):
+ self.n = int(n)
+ def __index__(self):
+ return self.n
+ self.assertEqual(list(range(I(bignum), I(bignum + 1))), [bignum])
+ self.assertEqual(list(range(I(smallnum), I(smallnum + 1))), [smallnum])
+
+ # User-defined class with a failing __index__ method
+ class IX:
+ def __index__(self):
+ raise RuntimeError
+ self.assertRaises(RuntimeError, range, IX())
+
+ # User-defined class with an invalid __index__ method
+ class IN:
+ def __index__(self):
+ return "not a number"
+
+ self.assertRaises(TypeError, range, IN())
+
+ def test_count(self):
+ self.assertEqual(range(3).count(-1), 0)
+ self.assertEqual(range(3).count(0), 1)
+ self.assertEqual(range(3).count(1), 1)
+ self.assertEqual(range(3).count(2), 1)
+ self.assertEqual(range(3).count(3), 0)
+ self.assertIs(type(range(3).count(-1)), int)
+ self.assertIs(type(range(3).count(1)), int)
+ self.assertEqual(range(10**20).count(1), 1)
+ self.assertEqual(range(10**20).count(10**20), 0)
+ self.assertEqual(range(3).index(1), 1)
+ self.assertEqual(range(1, 2**100, 2).count(2**87), 0)
+ self.assertEqual(range(1, 2**100, 2).count(2**87+1), 1)
+
+ class AlwaysEqual(object):
+ def __eq__(self, other):
+ return True
+ always_equal = AlwaysEqual()
+ self.assertEqual(range(10).count(always_equal), 10)
+
+ self.assertEqual(len(range(sys.maxsize, sys.maxsize+10)), 10)
+
def test_repr(self):
self.assertEqual(repr(range(1)), 'range(0, 1)')
self.assertEqual(repr(range(1, 2)), 'range(1, 2)')
@@ -115,6 +355,62 @@ class RangeTest(unittest.TestCase):
with self.assertRaises(TypeError):
range([], 1, -1)
+ def test_types(self):
+ # Non-integer objects *equal* to any of the range's items are supposed
+ # to be contained in the range.
+ self.assertIn(1.0, range(3))
+ self.assertIn(True, range(3))
+ self.assertIn(1+0j, range(3))
+
+ class C1:
+ def __eq__(self, other): return True
+ self.assertIn(C1(), range(3))
+
+ # Objects are never coerced into other types for comparison.
+ class C2:
+ def __int__(self): return 1
+ def __index__(self): return 1
+ self.assertNotIn(C2(), range(3))
+ # ..except if explicitly told so.
+ self.assertIn(int(C2()), range(3))
+
+ # Check that the range.__contains__ optimization is only
+ # used for ints, not for instances of subclasses of int.
+ class C3(int):
+ def __eq__(self, other): return True
+ self.assertIn(C3(11), range(10))
+ self.assertIn(C3(11), list(range(10)))
+
+ def test_strided_limits(self):
+ r = range(0, 101, 2)
+ self.assertIn(0, r)
+ self.assertNotIn(1, r)
+ self.assertIn(2, r)
+ self.assertNotIn(99, r)
+ self.assertIn(100, r)
+ self.assertNotIn(101, r)
+
+ r = range(0, -20, -1)
+ self.assertIn(0, r)
+ self.assertIn(-1, r)
+ self.assertIn(-19, r)
+ self.assertNotIn(-20, r)
+
+ r = range(0, -20, -2)
+ self.assertIn(-18, r)
+ self.assertNotIn(-19, r)
+ self.assertNotIn(-20, r)
+
+ def test_empty(self):
+ r = range(0)
+ self.assertNotIn(0, r)
+ self.assertNotIn(1, r)
+
+ r = range(0, -10)
+ self.assertNotIn(0, r)
+ self.assertNotIn(-1, r)
+ self.assertNotIn(1, r)
+
def test_range_iterators(self):
# exercise 'fast' iterators, that use a rangeiterobject internally.
# see issue 7298
@@ -139,6 +435,79 @@ class RangeTest(unittest.TestCase):
test_id = "reversed(range({}, {}, {}))".format(start, end, step)
self.assert_iterators_equal(iter1, iter2, test_id, limit=100)
+ def test_slice(self):
+ def check(start, stop, step=None):
+ i = slice(start, stop, step)
+ self.assertEqual(list(r[i]), list(r)[i])
+ self.assertEqual(len(r[i]), len(list(r)[i]))
+ for r in [range(10),
+ range(0),
+ range(1, 9, 3),
+ range(8, 0, -3),
+ range(sys.maxsize+1, sys.maxsize+10),
+ ]:
+ check(0, 2)
+ check(0, 20)
+ check(1, 2)
+ check(20, 30)
+ check(-30, -20)
+ check(-1, 100, 2)
+ check(0, -1)
+ check(-1, -3, -1)
+
+ def test_contains(self):
+ r = range(10)
+ self.assertIn(0, r)
+ self.assertIn(1, r)
+ self.assertIn(5.0, r)
+ self.assertNotIn(5.1, r)
+ self.assertNotIn(-1, r)
+ self.assertNotIn(10, r)
+ self.assertNotIn("", r)
+ r = range(9, -1, -1)
+ self.assertIn(0, r)
+ self.assertIn(1, r)
+ self.assertIn(5.0, r)
+ self.assertNotIn(5.1, r)
+ self.assertNotIn(-1, r)
+ self.assertNotIn(10, r)
+ self.assertNotIn("", r)
+ r = range(0, 10, 2)
+ self.assertIn(0, r)
+ self.assertNotIn(1, r)
+ self.assertNotIn(5.0, r)
+ self.assertNotIn(5.1, r)
+ self.assertNotIn(-1, r)
+ self.assertNotIn(10, r)
+ self.assertNotIn("", r)
+ r = range(9, -1, -2)
+ self.assertNotIn(0, r)
+ self.assertIn(1, r)
+ self.assertIn(5.0, r)
+ self.assertNotIn(5.1, r)
+ self.assertNotIn(-1, r)
+ self.assertNotIn(10, r)
+ self.assertNotIn("", r)
+
+ def test_reverse_iteration(self):
+ for r in [range(10),
+ range(0),
+ range(1, 9, 3),
+ range(8, 0, -3),
+ range(sys.maxsize+1, sys.maxsize+10),
+ ]:
+ self.assertEqual(list(reversed(r)), list(r)[::-1])
+
+ def test_issue11845(self):
+ r = range(*slice(1, 18, 2).indices(20))
+ values = {None, 0, 1, -1, 2, -2, 5, -5, 19, -19,
+ 20, -20, 21, -21, 30, -30, 99, -99}
+ for i in values:
+ for j in values:
+ for k in values - {0}:
+ r[i:j:k]
+
+
def test_main():
test.support.run_unittest(RangeTest)
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 5ad44dd28b..fe8bc34039 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1,7 +1,6 @@
from test.support import verbose, run_unittest
import re
from re import Scanner
-import os
import sys
import string
import traceback
@@ -639,6 +638,27 @@ class ReTests(unittest.TestCase):
self.assertEqual(next(iter).span(), (4, 4))
self.assertRaises(StopIteration, next, iter)
+ def test_bug_6561(self):
+ # '\d' should match characters in Unicode category 'Nd'
+ # (Number, Decimal Digit), but not those in 'Nl' (Number,
+ # Letter) or 'No' (Number, Other).
+ decimal_digits = [
+ '\u0037', # '\N{DIGIT SEVEN}', category 'Nd'
+ '\u0e58', # '\N{THAI DIGIT SIX}', category 'Nd'
+ '\uff10', # '\N{FULLWIDTH DIGIT ZERO}', category 'Nd'
+ ]
+ for x in decimal_digits:
+ self.assertEqual(re.match('^\d$', x).group(0), x)
+
+ not_decimal_digits = [
+ '\u2165', # '\N{ROMAN NUMERAL SIX}', category 'Nl'
+ '\u3039', # '\N{HANGZHOU NUMERAL TWENTY}', category 'Nl'
+ '\u2082', # '\N{SUBSCRIPT TWO}', category 'No'
+ '\u32b4', # '\N{CIRCLED NUMBER THIRTY NINE}', category 'No'
+ ]
+ for x in not_decimal_digits:
+ self.assertIsNone(re.match('^\d$', x))
+
def test_empty_array(self):
# SF buf 1647541
import array
@@ -761,7 +781,7 @@ class ReTests(unittest.TestCase):
self.assertRaises(TypeError, _sre.compile, {}, 0, [])
def run_re_tests():
- from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR
+ from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
if verbose:
print('Running re_tests test suite')
else:
@@ -887,6 +907,7 @@ def run_re_tests():
if result is None:
print('=== Fails on unicode-sensitive match', t)
+
def test_main():
run_unittest(ReTests)
run_re_tests()
diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py
new file mode 100644
index 0000000000..5483dd31b8
--- /dev/null
+++ b/Lib/test/test_readline.py
@@ -0,0 +1,47 @@
+"""
+Very minimal unittests for parts of the readline module.
+
+These tests were added to check that the libedit emulation on OSX and
+the "real" readline have the same interface for history manipulation. That's
+why the tests cover only a small subset of the interface.
+"""
+import unittest
+from test.support import run_unittest, import_module
+
+# Skip tests if there is no readline module
+readline = import_module('readline')
+
+class TestHistoryManipulation (unittest.TestCase):
+
+ @unittest.skipIf(not hasattr(readline, 'clear_history'),
+ "The history update test cannot be run because the "
+ "clear_history method is not available.")
+ def testHistoryUpdates(self):
+ readline.clear_history()
+
+ readline.add_history("first line")
+ readline.add_history("second line")
+
+ self.assertEqual(readline.get_history_item(0), None)
+ self.assertEqual(readline.get_history_item(1), "first line")
+ self.assertEqual(readline.get_history_item(2), "second line")
+
+ readline.replace_history_item(0, "replaced line")
+ self.assertEqual(readline.get_history_item(0), None)
+ self.assertEqual(readline.get_history_item(1), "replaced line")
+ self.assertEqual(readline.get_history_item(2), "second line")
+
+ self.assertEqual(readline.get_current_history_length(), 2)
+
+ readline.remove_history_item(0)
+ self.assertEqual(readline.get_history_item(0), None)
+ self.assertEqual(readline.get_history_item(1), "second line")
+
+ self.assertEqual(readline.get_current_history_length(), 1)
+
+
+def test_main():
+ run_unittest(TestHistoryManipulation)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_reprlib.py b/Lib/test/test_reprlib.py
index ce6ecb67f7..b0dc4d7813 100644
--- a/Lib/test/test_reprlib.py
+++ b/Lib/test/test_reprlib.py
@@ -11,6 +11,7 @@ import unittest
from test.support import run_unittest
from reprlib import repr as r # Don't shadow builtin repr
from reprlib import Repr
+from reprlib import recursive_repr
def nestedTuple(nesting):
@@ -125,7 +126,7 @@ class ReprTests(unittest.TestCase):
s = r(ClassWithFailingRepr)
self.assertTrue(s.startswith("<class "))
self.assertTrue(s.endswith(">"))
- self.assertTrue(s.find("...") in [12, 13])
+ self.assertIn(s.find("..."), [12, 13])
def test_lambda(self):
self.assertTrue(repr(lambda x: x).startswith(
@@ -301,11 +302,38 @@ class ClassWithFailingRepr:
def __repr__(self):
raise Exception("This should be caught by Repr.repr_instance")
+class MyContainer:
+ 'Helper class for TestRecursiveRepr'
+ def __init__(self, values):
+ self.values = list(values)
+ def append(self, value):
+ self.values.append(value)
+ @recursive_repr()
+ def __repr__(self):
+ return '<' + ', '.join(map(str, self.values)) + '>'
+
+class MyContainer2(MyContainer):
+ @recursive_repr('+++')
+ def __repr__(self):
+ return '<' + ', '.join(map(str, self.values)) + '>'
+
+class TestRecursiveRepr(unittest.TestCase):
+ def test_recursive_repr(self):
+ m = MyContainer(list('abcde'))
+ m.append(m)
+ m.append('x')
+ m.append(m)
+ self.assertEqual(repr(m), '<a, b, c, d, e, ..., x, ...>')
+ m = MyContainer2(list('abcde'))
+ m.append(m)
+ m.append('x')
+ m.append(m)
+ self.assertEqual(repr(m), '<a, b, c, d, e, +++, x, +++>')
def test_main():
run_unittest(ReprTests)
- if os.name != 'mac':
- run_unittest(LongReprTest)
+ run_unittest(LongReprTest)
+ run_unittest(TestRecursiveRepr)
if __name__ == "__main__":
diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
index 454634922b..3c9b620702 100644
--- a/Lib/test/test_resource.py
+++ b/Lib/test/test_resource.py
@@ -102,6 +102,10 @@ class ResourceTest(unittest.TestCase):
usageboth = resource.getrusage(resource.RUSAGE_BOTH)
except (ValueError, AttributeError):
pass
+ try:
+ usage_thread = resource.getrusage(resource.RUSAGE_THREAD)
+ except (ValueError, AttributeError):
+ pass
def test_main(verbose=None):
support.run_unittest(ResourceTest)
diff --git a/Lib/test/test_richcmp.py b/Lib/test/test_richcmp.py
index a788c60dc4..f8f3717b64 100644
--- a/Lib/test/test_richcmp.py
+++ b/Lib/test/test_richcmp.py
@@ -192,12 +192,12 @@ class MiscTest(unittest.TestCase):
def test_misbehavin(self):
class Misb:
- def __lt__(self, other): return 0
- def __gt__(self, other): return 0
- def __eq__(self, other): return 0
- def __le__(self, other): raise TestFailed("This shouldn't happen")
- def __ge__(self, other): raise TestFailed("This shouldn't happen")
- def __ne__(self, other): raise TestFailed("This shouldn't happen")
+ def __lt__(self_, other): return 0
+ def __gt__(self_, other): return 0
+ def __eq__(self_, other): return 0
+ def __le__(self_, other): self.fail("This shouldn't happen")
+ def __ge__(self_, other): self.fail("This shouldn't happen")
+ def __ne__(self_, other): self.fail("This shouldn't happen")
a = Misb()
b = Misb()
self.assertEqual(a<b, 0)
@@ -279,9 +279,6 @@ class DictTest(unittest.TestCase):
class ListTest(unittest.TestCase):
- def assertIs(self, a, b):
- self.assertTrue(a is b)
-
def test_coverage(self):
# exercise all comparisons for lists
x = [42]
diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py
index 43141e5817..ad3ab397f4 100644
--- a/Lib/test/test_runpy.py
+++ b/Lib/test/test_runpy.py
@@ -3,10 +3,15 @@ import unittest
import os
import os.path
import sys
+import re
import tempfile
-from test.support import verbose, run_unittest, forget
-from runpy import _run_code, _run_module_code, run_module
+import py_compile
+from test.support import forget, make_legacy_pyc, run_unittest, unload, verbose
+from test.script_helper import (
+ make_pkg, make_script, make_zip_pkg, make_zip_script, temp_dir)
+
+from runpy import _run_code, _run_module_code, run_module, run_path
# Note: This module can't safely test _run_module_as_main as it
# runs its tests in the current process, which would mess with the
# real __main__ module (usually test.regrtest)
@@ -15,6 +20,7 @@ from runpy import _run_code, _run_module_code, run_module
# Set up the test code and expected results
class RunModuleCodeTest(unittest.TestCase):
+ """Unit tests for runpy._run_code and runpy._run_module_code"""
expected_result = ["Top level assignment", "Lower level reference"]
test_source = (
@@ -37,14 +43,15 @@ class RunModuleCodeTest(unittest.TestCase):
def test_run_code(self):
saved_argv0 = sys.argv[0]
d = _run_code(self.test_source, {})
- self.assertTrue(d["result"] == self.expected_result)
- self.assertTrue(d["__name__"] is None)
- self.assertTrue(d["__file__"] is None)
- self.assertTrue(d["__loader__"] is None)
- self.assertTrue(d["__package__"] is None)
- self.assertTrue(d["run_argv0"] is saved_argv0)
- self.assertTrue("run_name" not in d)
- self.assertTrue(sys.argv[0] is saved_argv0)
+ self.assertEqual(d["result"], self.expected_result)
+ self.assertIs(d["__name__"], None)
+ self.assertIs(d["__file__"], None)
+ self.assertIs(d["__cached__"], None)
+ self.assertIs(d["__loader__"], None)
+ self.assertIs(d["__package__"], None)
+ self.assertIs(d["run_argv0"], saved_argv0)
+ self.assertNotIn("run_name", d)
+ self.assertIs(sys.argv[0], saved_argv0)
def test_run_module_code(self):
initial = object()
@@ -60,22 +67,24 @@ class RunModuleCodeTest(unittest.TestCase):
file,
loader,
package)
- self.assertTrue("result" not in d1)
- self.assertTrue(d2["initial"] is initial)
+ self.assertNotIn("result", d1)
+ self.assertIs(d2["initial"], initial)
self.assertEqual(d2["result"], self.expected_result)
self.assertEqual(d2["nested"]["x"], 1)
- self.assertTrue(d2["__name__"] is name)
+ self.assertIs(d2["__name__"], name)
self.assertTrue(d2["run_name_in_sys_modules"])
self.assertTrue(d2["module_in_sys_modules"])
- self.assertTrue(d2["__file__"] is file)
- self.assertTrue(d2["run_argv0"] is file)
- self.assertTrue(d2["__loader__"] is loader)
- self.assertTrue(d2["__package__"] is package)
- self.assertTrue(sys.argv[0] is saved_argv0)
- self.assertTrue(name not in sys.modules)
+ self.assertIs(d2["__file__"], file)
+ self.assertIs(d2["__cached__"], None)
+ self.assertIs(d2["run_argv0"], file)
+ self.assertIs(d2["__loader__"], loader)
+ self.assertIs(d2["__package__"], package)
+ self.assertIs(sys.argv[0], saved_argv0)
+ self.assertNotIn(name, sys.modules)
class RunModuleTest(unittest.TestCase):
+ """Unit tests for runpy.run_module"""
def expect_import_error(self, mod_name):
try:
@@ -94,8 +103,8 @@ class RunModuleTest(unittest.TestCase):
self.expect_import_error("a.bee")
self.expect_import_error(".howard")
self.expect_import_error("..eaten")
- # Package
- self.expect_import_error("logging")
+ # Package without __main__.py
+ self.expect_import_error("multiprocessing")
def test_library_module(self):
run_module("runpy")
@@ -107,9 +116,9 @@ class RunModuleTest(unittest.TestCase):
pkg_file.close()
return pkg_fname
- def _make_pkg(self, source, depth):
+ def _make_pkg(self, source, depth, mod_base="runpy_test"):
pkg_name = "__runpy_pkg__"
- test_fname = "runpy_test.py"
+ test_fname = mod_base+os.extsep+"py"
pkg_dir = sub_dir = tempfile.mkdtemp()
if verbose: print(" Package tree in:", sub_dir)
sys.path.insert(0, pkg_dir)
@@ -124,7 +133,7 @@ class RunModuleTest(unittest.TestCase):
mod_file.write(source)
mod_file.close()
if verbose: print(" Created:", mod_fname)
- mod_name = (pkg_name+".")*depth + "runpy_test"
+ mod_name = (pkg_name+".")*depth + mod_base
return pkg_dir, mod_fname, mod_name
def _del_pkg(self, top, depth, mod_name):
@@ -159,20 +168,46 @@ class RunModuleTest(unittest.TestCase):
try:
if verbose: print("Running from source:", mod_name)
d1 = run_module(mod_name) # Read from source
- self.assertTrue("x" in d1)
+ self.assertIn("x", d1)
self.assertEqual(d1["x"], 1)
del d1 # Ensure __loader__ entry doesn't keep file open
__import__(mod_name)
os.remove(mod_fname)
+ make_legacy_pyc(mod_fname)
+ unload(mod_name) # In case loader caches paths
if verbose: print("Running from compiled:", mod_name)
d2 = run_module(mod_name) # Read from bytecode
- self.assertTrue("x" in d2)
+ self.assertIn("x", d2)
self.assertEqual(d2["x"], 1)
del d2 # Ensure __loader__ entry doesn't keep file open
finally:
self._del_pkg(pkg_dir, depth, mod_name)
if verbose: print("Module executed successfully")
+ def _check_package(self, depth):
+ pkg_dir, mod_fname, mod_name = (
+ self._make_pkg("x=1\n", depth, "__main__"))
+ pkg_name, _, _ = mod_name.rpartition(".")
+ forget(mod_name)
+ try:
+ if verbose: print("Running from source:", pkg_name)
+ d1 = run_module(pkg_name) # Read from source
+ self.assertIn("x", d1)
+ self.assertTrue(d1["x"] == 1)
+ del d1 # Ensure __loader__ entry doesn't keep file open
+ __import__(mod_name)
+ os.remove(mod_fname)
+ make_legacy_pyc(mod_fname)
+ unload(mod_name) # In case loader caches paths
+ if verbose: print("Running from compiled:", pkg_name)
+ d2 = run_module(pkg_name) # Read from bytecode
+ self.assertIn("x", d2)
+ self.assertTrue(d2["x"] == 1)
+ del d2 # Ensure __loader__ entry doesn't keep file open
+ finally:
+ self._del_pkg(pkg_dir, depth, pkg_name)
+ if verbose: print("Package executed successfully")
+
def _add_relative_modules(self, base_dir, source, depth):
if depth <= 1:
raise ValueError("Relative module test needs depth > 1")
@@ -211,19 +246,21 @@ from ..uncle.cousin import nephew
pkg_name = mod_name.rpartition('.')[0]
if verbose: print("Running from source:", mod_name)
d1 = run_module(mod_name, run_name=run_name) # Read from source
- self.assertTrue("__package__" in d1)
+ self.assertIn("__package__", d1)
self.assertTrue(d1["__package__"] == pkg_name)
- self.assertTrue("sibling" in d1)
- self.assertTrue("nephew" in d1)
+ self.assertIn("sibling", d1)
+ self.assertIn("nephew", d1)
del d1 # Ensure __loader__ entry doesn't keep file open
__import__(mod_name)
os.remove(mod_fname)
+ make_legacy_pyc(mod_fname)
+ unload(mod_name) # In case the loader caches paths
if verbose: print("Running from compiled:", mod_name)
d2 = run_module(mod_name, run_name=run_name) # Read from bytecode
- self.assertTrue("__package__" in d2)
+ self.assertIn("__package__", d2)
self.assertTrue(d2["__package__"] == pkg_name)
- self.assertTrue("sibling" in d2)
- self.assertTrue("nephew" in d2)
+ self.assertIn("sibling", d2)
+ self.assertIn("nephew", d2)
del d2 # Ensure __loader__ entry doesn't keep file open
finally:
self._del_pkg(pkg_dir, depth, mod_name)
@@ -234,6 +271,11 @@ from ..uncle.cousin import nephew
if verbose: print("Testing package depth:", depth)
self._check_module(depth)
+ def test_run_package(self):
+ for depth in range(1, 4):
+ if verbose: print("Testing package depth:", depth)
+ self._check_package(depth)
+
def test_explicit_relative_import(self):
for depth in range(2, 5):
if verbose: print("Testing relative imports at depth:", depth)
@@ -245,9 +287,132 @@ from ..uncle.cousin import nephew
self._check_relative_imports(depth, "__main__")
+class RunPathTest(unittest.TestCase):
+ """Unit tests for runpy.run_path"""
+ # Based on corresponding tests in test_cmd_line_script
+
+ test_source = """\
+# Script may be run with optimisation enabled, so don't rely on assert
+# statements being executed
+def assertEqual(lhs, rhs):
+ if lhs != rhs:
+ raise AssertionError('%r != %r' % (lhs, rhs))
+def assertIs(lhs, rhs):
+ if lhs is not rhs:
+ raise AssertionError('%r is not %r' % (lhs, rhs))
+# Check basic code execution
+result = ['Top level assignment']
+def f():
+ result.append('Lower level reference')
+f()
+assertEqual(result, ['Top level assignment', 'Lower level reference'])
+# Check the sys module
+import sys
+assertIs(globals(), sys.modules[__name__].__dict__)
+argv0 = sys.argv[0]
+"""
+
+ def _make_test_script(self, script_dir, script_basename, source=None):
+ if source is None:
+ source = self.test_source
+ return make_script(script_dir, script_basename, source)
+
+ def _check_script(self, script_name, expected_name, expected_file,
+ expected_argv0, expected_package):
+ result = run_path(script_name)
+ self.assertEqual(result["__name__"], expected_name)
+ self.assertEqual(result["__file__"], expected_file)
+ self.assertEqual(result["__cached__"], None)
+ self.assertIn("argv0", result)
+ self.assertEqual(result["argv0"], expected_argv0)
+ self.assertEqual(result["__package__"], expected_package)
+
+ def _check_import_error(self, script_name, msg):
+ msg = re.escape(msg)
+ self.assertRaisesRegex(ImportError, msg, run_path, script_name)
+
+ def test_basic_script(self):
+ with temp_dir() as script_dir:
+ mod_name = 'script'
+ script_name = self._make_test_script(script_dir, mod_name)
+ self._check_script(script_name, "<run_path>", script_name,
+ script_name, None)
+
+ def test_script_compiled(self):
+ with temp_dir() as script_dir:
+ mod_name = 'script'
+ script_name = self._make_test_script(script_dir, mod_name)
+ compiled_name = py_compile.compile(script_name, doraise=True)
+ os.remove(script_name)
+ self._check_script(compiled_name, "<run_path>", compiled_name,
+ compiled_name, None)
+
+ def test_directory(self):
+ with temp_dir() as script_dir:
+ mod_name = '__main__'
+ script_name = self._make_test_script(script_dir, mod_name)
+ self._check_script(script_dir, "<run_path>", script_name,
+ script_dir, '')
+
+ def test_directory_compiled(self):
+ with temp_dir() as script_dir:
+ mod_name = '__main__'
+ script_name = self._make_test_script(script_dir, mod_name)
+ compiled_name = py_compile.compile(script_name, doraise=True)
+ os.remove(script_name)
+ legacy_pyc = make_legacy_pyc(script_name)
+ self._check_script(script_dir, "<run_path>", legacy_pyc,
+ script_dir, '')
+
+ def test_directory_error(self):
+ with temp_dir() as script_dir:
+ mod_name = 'not_main'
+ script_name = self._make_test_script(script_dir, mod_name)
+ msg = "can't find '__main__' module in %r" % script_dir
+ self._check_import_error(script_dir, msg)
+
+ def test_zipfile(self):
+ with temp_dir() as script_dir:
+ mod_name = '__main__'
+ script_name = self._make_test_script(script_dir, mod_name)
+ zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name)
+ self._check_script(zip_name, "<run_path>", fname, zip_name, '')
+
+ def test_zipfile_compiled(self):
+ with temp_dir() as script_dir:
+ mod_name = '__main__'
+ script_name = self._make_test_script(script_dir, mod_name)
+ compiled_name = py_compile.compile(script_name, doraise=True)
+ zip_name, fname = make_zip_script(script_dir, 'test_zip',
+ compiled_name)
+ self._check_script(zip_name, "<run_path>", fname, zip_name, '')
+
+ def test_zipfile_error(self):
+ with temp_dir() as script_dir:
+ mod_name = 'not_main'
+ script_name = self._make_test_script(script_dir, mod_name)
+ zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name)
+ msg = "can't find '__main__' module in %r" % zip_name
+ self._check_import_error(zip_name, msg)
+
+ def test_main_recursion_error(self):
+ with temp_dir() as script_dir, temp_dir() as dummy_dir:
+ mod_name = '__main__'
+ source = ("import runpy\n"
+ "runpy.run_path(%r)\n") % dummy_dir
+ script_name = self._make_test_script(script_dir, mod_name, source)
+ zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name)
+ msg = "recursion depth exceeded"
+ self.assertRaisesRegex(RuntimeError, msg, run_path, zip_name)
+
+
+
def test_main():
- run_unittest(RunModuleCodeTest)
- run_unittest(RunModuleTest)
+ run_unittest(
+ RunModuleCodeTest,
+ RunModuleTest,
+ RunPathTest
+ )
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
index 6c9147a852..0f6a1ca96c 100644
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -16,7 +16,14 @@ from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl
from io import StringIO
from test.support import findfile, run_unittest
import unittest
-import os
+
+TEST_XMLFILE = findfile("test.xml", subdir="xmltestdata")
+TEST_XMLFILE_OUT = findfile("test.xml.out", subdir="xmltestdata")
+try:
+ TEST_XMLFILE.encode("utf8")
+ TEST_XMLFILE_OUT.encode("utf8")
+except UnicodeEncodeError:
+ raise unittest.SkipTest("filename is not encodable to utf8")
ns_uri = "http://www.python.org/xml-ns/saxtest/"
@@ -31,7 +38,7 @@ class XmlTestBase(unittest.TestCase):
self.assertEqual(attrs.getNames(), [])
self.assertEqual(attrs.getQNames(), [])
self.assertEqual(len(attrs), 0)
- self.assertFalse("attr" in attrs)
+ self.assertNotIn("attr", attrs)
self.assertEqual(list(attrs.keys()), [])
self.assertEqual(attrs.get("attrs"), None)
self.assertEqual(attrs.get("attrs", 25), 25)
@@ -48,7 +55,7 @@ class XmlTestBase(unittest.TestCase):
self.assertEqual(attrs.getNames(), [])
self.assertEqual(attrs.getQNames(), [])
self.assertEqual(len(attrs), 0)
- self.assertFalse((ns_uri, "attr") in attrs)
+ self.assertNotIn((ns_uri, "attr"), attrs)
self.assertEqual(list(attrs.keys()), [])
self.assertEqual(attrs.get((ns_uri, "attr")), None)
self.assertEqual(attrs.get((ns_uri, "attr"), 25), 25)
@@ -60,7 +67,7 @@ class XmlTestBase(unittest.TestCase):
self.assertEqual(attrs.getNames(), ["attr"])
self.assertEqual(attrs.getQNames(), ["attr"])
self.assertEqual(len(attrs), 1)
- self.assertTrue("attr" in attrs)
+ self.assertIn("attr", attrs)
self.assertEqual(list(attrs.keys()), ["attr"])
self.assertEqual(attrs.get("attr"), "val")
self.assertEqual(attrs.get("attr", 25), "val")
@@ -140,7 +147,7 @@ class SaxutilsTest(unittest.TestCase):
def test_single_double_quoteattr(self):
self.assertEqual(quoteattr("Includes 'single' and \"double\" quotes"),
- "\"Includes 'single' and &quot;double&quot; quotes\"")
+ "\"Includes 'single' and &quot;double&quot; quotes\"")
# ===== make_parser
def test_make_parser(self):
@@ -164,6 +171,16 @@ class XmlgenTest(unittest.TestCase):
self.assertEqual(result.getvalue(), start + "<doc></doc>")
+ def test_xmlgen_basic_empty(self):
+ result = StringIO()
+ gen = XMLGenerator(result, short_empty_elements=True)
+ gen.startDocument()
+ gen.startElement("doc", {})
+ gen.endElement("doc")
+ gen.endDocument()
+
+ self.assertEqual(result.getvalue(), start + "<doc/>")
+
def test_xmlgen_content(self):
result = StringIO()
gen = XMLGenerator(result)
@@ -176,6 +193,18 @@ class XmlgenTest(unittest.TestCase):
self.assertEqual(result.getvalue(), start + "<doc>huhei</doc>")
+ def test_xmlgen_content_empty(self):
+ result = StringIO()
+ gen = XMLGenerator(result, short_empty_elements=True)
+
+ gen.startDocument()
+ gen.startElement("doc", {})
+ gen.characters("huhei")
+ gen.endElement("doc")
+ gen.endDocument()
+
+ self.assertEqual(result.getvalue(), start + "<doc>huhei</doc>")
+
def test_xmlgen_pi(self):
result = StringIO()
gen = XMLGenerator(result)
@@ -233,6 +262,18 @@ class XmlgenTest(unittest.TestCase):
self.assertEqual(result.getvalue(), start + "<doc> </doc>")
+ def test_xmlgen_ignorable_empty(self):
+ result = StringIO()
+ gen = XMLGenerator(result, short_empty_elements=True)
+
+ gen.startDocument()
+ gen.startElement("doc", {})
+ gen.ignorableWhitespace(" ")
+ gen.endElement("doc")
+ gen.endDocument()
+
+ self.assertEqual(result.getvalue(), start + "<doc> </doc>")
+
def test_xmlgen_ns(self):
result = StringIO()
gen = XMLGenerator(result)
@@ -251,6 +292,24 @@ class XmlgenTest(unittest.TestCase):
('<ns1:doc xmlns:ns1="%s"><udoc></udoc></ns1:doc>' %
ns_uri))
+ def test_xmlgen_ns_empty(self):
+ result = StringIO()
+ gen = XMLGenerator(result, short_empty_elements=True)
+
+ gen.startDocument()
+ gen.startPrefixMapping("ns1", ns_uri)
+ gen.startElementNS((ns_uri, "doc"), "ns1:doc", {})
+ # add an unqualified name
+ gen.startElementNS((None, "udoc"), None, {})
+ gen.endElementNS((None, "udoc"), None)
+ gen.endElementNS((ns_uri, "doc"), "ns1:doc")
+ gen.endPrefixMapping("ns1")
+ gen.endDocument()
+
+ self.assertEqual(result.getvalue(), start + \
+ ('<ns1:doc xmlns:ns1="%s"><udoc/></ns1:doc>' %
+ ns_uri))
+
def test_1463026_1(self):
result = StringIO()
gen = XMLGenerator(result)
@@ -262,6 +321,17 @@ class XmlgenTest(unittest.TestCase):
self.assertEqual(result.getvalue(), start+'<a b="c"></a>')
+ def test_1463026_1_empty(self):
+ result = StringIO()
+ gen = XMLGenerator(result, short_empty_elements=True)
+
+ gen.startDocument()
+ gen.startElementNS((None, 'a'), 'a', {(None, 'b'):'c'})
+ gen.endElementNS((None, 'a'), 'a')
+ gen.endDocument()
+
+ self.assertEqual(result.getvalue(), start+'<a b="c"/>')
+
def test_1463026_2(self):
result = StringIO()
gen = XMLGenerator(result)
@@ -275,6 +345,19 @@ class XmlgenTest(unittest.TestCase):
self.assertEqual(result.getvalue(), start+'<a xmlns="qux"></a>')
+ def test_1463026_2_empty(self):
+ result = StringIO()
+ gen = XMLGenerator(result, short_empty_elements=True)
+
+ gen.startDocument()
+ gen.startPrefixMapping(None, 'qux')
+ gen.startElementNS(('qux', 'a'), 'a', {})
+ gen.endElementNS(('qux', 'a'), 'a')
+ gen.endPrefixMapping(None)
+ gen.endDocument()
+
+ self.assertEqual(result.getvalue(), start+'<a xmlns="qux"/>')
+
def test_1463026_3(self):
result = StringIO()
gen = XMLGenerator(result)
@@ -289,6 +372,20 @@ class XmlgenTest(unittest.TestCase):
self.assertEqual(result.getvalue(),
start+'<my:a xmlns:my="qux" b="c"></my:a>')
+ def test_1463026_3_empty(self):
+ result = StringIO()
+ gen = XMLGenerator(result, short_empty_elements=True)
+
+ gen.startDocument()
+ gen.startPrefixMapping('my', 'qux')
+ gen.startElementNS(('qux', 'a'), 'a', {(None, 'b'):'c'})
+ gen.endElementNS(('qux', 'a'), 'a')
+ gen.endPrefixMapping('my')
+ gen.endDocument()
+
+ self.assertEqual(result.getvalue(),
+ start+'<my:a xmlns:my="qux" b="c"/>')
+
def test_5027_1(self):
# The xml prefix (as in xml:lang below) is reserved and bound by
# definition to http://www.w3.org/XML/1998/namespace. XMLGenerator had
@@ -366,7 +463,8 @@ class XMLFilterBaseTest(unittest.TestCase):
#
# ===========================================================================
-xml_test_out = open(findfile("test.xml.out")).read()
+with open(TEST_XMLFILE_OUT) as f:
+ xml_test_out = f.read()
class ExpatReaderTest(XmlTestBase):
@@ -378,7 +476,8 @@ class ExpatReaderTest(XmlTestBase):
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
- parser.parse(open(findfile("test.xml")))
+ with open(TEST_XMLFILE) as f:
+ parser.parse(f)
self.assertEqual(result.getvalue(), xml_test_out)
@@ -491,7 +590,7 @@ class ExpatReaderTest(XmlTestBase):
self.assertTrue((attrs.getQNames() == [] or
attrs.getQNames() == ["ns:attr"]))
self.assertEqual(len(attrs), 1)
- self.assertTrue((ns_uri, "attr") in attrs)
+ self.assertIn((ns_uri, "attr"), attrs)
self.assertEqual(attrs.get((ns_uri, "attr")), "val")
self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
self.assertEqual(list(attrs.items()), [((ns_uri, "attr"), "val")])
@@ -507,7 +606,7 @@ class ExpatReaderTest(XmlTestBase):
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
- parser.parse(findfile("test.xml"))
+ parser.parse(TEST_XMLFILE)
self.assertEqual(result.getvalue(), xml_test_out)
@@ -517,7 +616,7 @@ class ExpatReaderTest(XmlTestBase):
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
- parser.parse(InputSource(findfile("test.xml")))
+ parser.parse(InputSource(TEST_XMLFILE))
self.assertEqual(result.getvalue(), xml_test_out)
@@ -528,8 +627,9 @@ class ExpatReaderTest(XmlTestBase):
parser.setContentHandler(xmlgen)
inpsrc = InputSource()
- inpsrc.setByteStream(open(findfile("test.xml")))
- parser.parse(inpsrc)
+ with open(TEST_XMLFILE) as f:
+ inpsrc.setByteStream(f)
+ parser.parse(inpsrc)
self.assertEqual(result.getvalue(), xml_test_out)
@@ -589,9 +689,9 @@ class ExpatReaderTest(XmlTestBase):
xmlgen = XMLGenerator(result)
parser = create_parser()
parser.setContentHandler(xmlgen)
- parser.parse(findfile("test.xml"))
+ parser.parse(TEST_XMLFILE)
- self.assertEqual(parser.getSystemId(), findfile("test.xml"))
+ self.assertEqual(parser.getSystemId(), TEST_XMLFILE)
self.assertEqual(parser.getPublicId(), None)
@@ -681,7 +781,7 @@ class XmlReaderTest(XmlTestBase):
self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
self.assertEqual(attrs.getQNames(), ["ns:attr"])
self.assertEqual(len(attrs), 1)
- self.assertTrue((ns_uri, "attr") in attrs)
+ self.assertIn((ns_uri, "attr"), attrs)
self.assertEqual(list(attrs.keys()), [(ns_uri, "attr")])
self.assertEqual(attrs.get((ns_uri, "attr")), "val")
self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
diff --git a/Lib/test/test_sched.py b/Lib/test/test_sched.py
new file mode 100644
index 0000000000..29fd277746
--- /dev/null
+++ b/Lib/test/test_sched.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+
+import sched
+import time
+import unittest
+from test import support
+
+
+class TestCase(unittest.TestCase):
+
+ def test_enter(self):
+ l = []
+ fun = lambda x: l.append(x)
+ scheduler = sched.scheduler(time.time, time.sleep)
+ for x in [0.05, 0.04, 0.03, 0.02, 0.01]:
+ z = scheduler.enter(x, 1, fun, (x,))
+ scheduler.run()
+ self.assertEqual(l, [0.01, 0.02, 0.03, 0.04, 0.05])
+
+ def test_enterabs(self):
+ l = []
+ fun = lambda x: l.append(x)
+ scheduler = sched.scheduler(time.time, time.sleep)
+ for x in [0.05, 0.04, 0.03, 0.02, 0.01]:
+ z = scheduler.enterabs(x, 1, fun, (x,))
+ scheduler.run()
+ self.assertEqual(l, [0.01, 0.02, 0.03, 0.04, 0.05])
+
+ def test_priority(self):
+ l = []
+ fun = lambda x: l.append(x)
+ scheduler = sched.scheduler(time.time, time.sleep)
+ for priority in [1, 2, 3, 4, 5]:
+ z = scheduler.enter(0.01, priority, fun, (priority,))
+ scheduler.run()
+ self.assertEqual(l, [1, 2, 3, 4, 5])
+
+ def test_cancel(self):
+ l = []
+ fun = lambda x: l.append(x)
+ scheduler = sched.scheduler(time.time, time.sleep)
+ event1 = scheduler.enter(0.01, 1, fun, (0.01,))
+ event2 = scheduler.enter(0.02, 1, fun, (0.02,))
+ event3 = scheduler.enter(0.03, 1, fun, (0.03,))
+ event4 = scheduler.enter(0.04, 1, fun, (0.04,))
+ event5 = scheduler.enter(0.05, 1, fun, (0.05,))
+ scheduler.cancel(event1)
+ scheduler.cancel(event5)
+ scheduler.run()
+ self.assertEqual(l, [0.02, 0.03, 0.04])
+
+ def test_empty(self):
+ l = []
+ fun = lambda x: l.append(x)
+ scheduler = sched.scheduler(time.time, time.sleep)
+ self.assertTrue(scheduler.empty())
+ for x in [0.05, 0.04, 0.03, 0.02, 0.01]:
+ z = scheduler.enterabs(x, 1, fun, (x,))
+ self.assertFalse(scheduler.empty())
+ scheduler.run()
+ self.assertTrue(scheduler.empty())
+
+ def test_queue(self):
+ l = []
+ events = []
+ fun = lambda x: l.append(x)
+ scheduler = sched.scheduler(time.time, time.sleep)
+ self.assertEqual(scheduler._queue, [])
+ for x in [0.05, 0.04, 0.03, 0.02, 0.01]:
+ events.append(scheduler.enterabs(x, 1, fun, (x,)))
+ self.assertEqual(scheduler._queue.sort(), events.sort())
+ scheduler.run()
+ self.assertEqual(scheduler._queue, [])
+
+
+def test_main():
+ support.run_unittest(TestCase)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index fb97f1b793..fbc87aa80c 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -1,9 +1,6 @@
import unittest
from test.support import check_syntax_error, run_unittest
-import warnings
-warnings.filterwarnings("ignore", r"import \*", SyntaxWarning, "<test string>")
-warnings.filterwarnings("ignore", r"import \*", SyntaxWarning, "<string>")
class ScopeTests(unittest.TestCase):
@@ -195,44 +192,37 @@ class ScopeTests(unittest.TestCase):
def testUnoptimizedNamespaces(self):
- check_syntax_error(self, """\
-def unoptimized_clash1(strip):
- def f(s):
- from sys import *
- return getrefcount(s) # ambiguity: free or local
- return f
-""")
-
- check_syntax_error(self, """\
-def unoptimized_clash2():
- from sys import *
- def f(s):
- return getrefcount(s) # ambiguity: global or local
- return f
-""")
-
- check_syntax_error(self, """\
-def unoptimized_clash2():
- from sys import *
- def g():
- def f(s):
- return getrefcount(s) # ambiguity: global or local
- return f
-""")
-
- check_syntax_error(self, """\
-def f(x):
- def g():
- return x
- del x # can't del name
-""")
-
- check_syntax_error(self, """\
-def f():
- def g():
- from sys import *
- return getrefcount # global or local?
-""")
+ check_syntax_error(self, """if 1:
+ def unoptimized_clash1(strip):
+ def f(s):
+ from sys import *
+ return getrefcount(s) # ambiguity: free or local
+ return f
+ """)
+
+ check_syntax_error(self, """if 1:
+ def unoptimized_clash2():
+ from sys import *
+ def f(s):
+ return getrefcount(s) # ambiguity: global or local
+ return f
+ """)
+
+ check_syntax_error(self, """if 1:
+ def unoptimized_clash2():
+ from sys import *
+ def g():
+ def f(s):
+ return getrefcount(s) # ambiguity: global or local
+ return f
+ """)
+
+ check_syntax_error(self, """if 1:
+ def f():
+ def g():
+ from sys import *
+ return getrefcount # global or local?
+ """)
def testLambdas(self):
@@ -275,18 +265,40 @@ def f():
self.assertRaises(UnboundLocalError, errorInOuter)
self.assertRaises(NameError, errorInInner)
+ def testUnboundLocal_AfterDel(self):
+ # #4617: It is now legal to delete a cell variable.
+ # The following functions must obviously compile,
+ # and give the correct error when accessing the deleted name.
+ def errorInOuter():
+ y = 1
+ del y
+ print(y)
+ def inner():
+ return y
+
+ def errorInInner():
+ def inner():
+ return y
+ y = 1
+ del y
+ inner()
+
+ self.assertRaises(UnboundLocalError, errorInOuter)
+ self.assertRaises(NameError, errorInInner)
+
+ def testUnboundLocal_AugAssign(self):
# test for bug #1501934: incorrect LOAD/STORE_GLOBAL generation
- exec("""
-global_x = 1
-def f():
- global_x += 1
-try:
- f()
-except UnboundLocalError:
- pass
-else:
- fail('scope of global_x not correctly determined')
-""", {'fail': self.fail})
+ exec("""if 1:
+ global_x = 1
+ def f():
+ global_x += 1
+ try:
+ f()
+ except UnboundLocalError:
+ pass
+ else:
+ fail('scope of global_x not correctly determined')
+ """, {'fail': self.fail})
def testComplexDefinitions(self):
@@ -305,88 +317,88 @@ else:
self.assertEqual(makeReturner2(a=11)()['a'], 11)
def testScopeOfGlobalStmt(self):
-# Examples posted by Samuele Pedroni to python-dev on 3/1/2001
-
- exec("""\
-# I
-x = 7
-def f():
- x = 1
- def g():
- global x
- def i():
- def h():
- return x
- return h()
- return i()
- return g()
-self.assertEqual(f(), 7)
-self.assertEqual(x, 7)
-
-# II
-x = 7
-def f():
- x = 1
- def g():
- x = 2
- def i():
- def h():
- return x
- return h()
- return i()
- return g()
-self.assertEqual(f(), 2)
-self.assertEqual(x, 7)
-
-# III
-x = 7
-def f():
- x = 1
- def g():
- global x
- x = 2
- def i():
- def h():
- return x
- return h()
- return i()
- return g()
-self.assertEqual(f(), 2)
-self.assertEqual(x, 2)
-
-# IV
-x = 7
-def f():
- x = 3
- def g():
- global x
- x = 2
- def i():
- def h():
- return x
- return h()
- return i()
- return g()
-self.assertEqual(f(), 2)
-self.assertEqual(x, 2)
-
-# XXX what about global statements in class blocks?
-# do they affect methods?
-
-x = 12
-class Global:
- global x
- x = 13
- def set(self, val):
- x = val
- def get(self):
- return x
-
-g = Global()
-self.assertEqual(g.get(), 13)
-g.set(15)
-self.assertEqual(g.get(), 13)
-""")
+ # Examples posted by Samuele Pedroni to python-dev on 3/1/2001
+
+ exec("""if 1:
+ # I
+ x = 7
+ def f():
+ x = 1
+ def g():
+ global x
+ def i():
+ def h():
+ return x
+ return h()
+ return i()
+ return g()
+ self.assertEqual(f(), 7)
+ self.assertEqual(x, 7)
+
+ # II
+ x = 7
+ def f():
+ x = 1
+ def g():
+ x = 2
+ def i():
+ def h():
+ return x
+ return h()
+ return i()
+ return g()
+ self.assertEqual(f(), 2)
+ self.assertEqual(x, 7)
+
+ # III
+ x = 7
+ def f():
+ x = 1
+ def g():
+ global x
+ x = 2
+ def i():
+ def h():
+ return x
+ return h()
+ return i()
+ return g()
+ self.assertEqual(f(), 2)
+ self.assertEqual(x, 2)
+
+ # IV
+ x = 7
+ def f():
+ x = 3
+ def g():
+ global x
+ x = 2
+ def i():
+ def h():
+ return x
+ return h()
+ return i()
+ return g()
+ self.assertEqual(f(), 2)
+ self.assertEqual(x, 2)
+
+ # XXX what about global statements in class blocks?
+ # do they affect methods?
+
+ x = 12
+ class Global:
+ global x
+ x = 13
+ def set(self, val):
+ x = val
+ def get(self):
+ return x
+
+ g = Global()
+ self.assertEqual(g.get(), 13)
+ g.set(15)
+ self.assertEqual(g.get(), 13)
+ """)
def testLeaks(self):
@@ -412,28 +424,28 @@ self.assertEqual(g.get(), 13)
def testClassAndGlobal(self):
- exec("""\
-def test(x):
- class Foo:
- global x
- def __call__(self, y):
- return x + y
- return Foo()
-
-x = 0
-self.assertEqual(test(6)(2), 8)
-x = -1
-self.assertEqual(test(3)(2), 5)
-
-looked_up_by_load_name = False
-class X:
- # Implicit globals inside classes are be looked up by LOAD_NAME, not
- # LOAD_GLOBAL.
- locals()['looked_up_by_load_name'] = True
- passed = looked_up_by_load_name
-
-self.assertTrue(X.passed)
-""")
+ exec("""if 1:
+ def test(x):
+ class Foo:
+ global x
+ def __call__(self, y):
+ return x + y
+ return Foo()
+
+ x = 0
+ self.assertEqual(test(6)(2), 8)
+ x = -1
+ self.assertEqual(test(3)(2), 5)
+
+ looked_up_by_load_name = False
+ class X:
+ # Implicit globals inside classes are be looked up by LOAD_NAME, not
+ # LOAD_GLOBAL.
+ locals()['looked_up_by_load_name'] = True
+ passed = looked_up_by_load_name
+
+ self.assertTrue(X.passed)
+ """)
def testLocalsFunction(self):
@@ -447,7 +459,7 @@ self.assertTrue(X.passed)
return g
d = f(2)(4)
- self.assertTrue('h' in d)
+ self.assertIn('h', d)
del d['h']
self.assertEqual(d, {'x': 2, 'y': 7, 'w': 6})
@@ -481,8 +493,8 @@ self.assertTrue(X.passed)
return C
varnames = f(1).z
- self.assertTrue("x" not in varnames)
- self.assertTrue("y" in varnames)
+ self.assertNotIn("x", varnames)
+ self.assertIn("y", varnames)
def testLocalsClass_WithTrace(self):
# Issue23728: after the trace function returns, the locals()
@@ -629,22 +641,22 @@ self.assertTrue(X.passed)
# function to other nested functions in the same block.
# This test verifies that a global statement in the first
# function does not affect the second function.
- CODE = """def f():
- y = 1
- def g():
- global y
- return y
- def h():
- return y + 1
- return g, h
-y = 9
-g, h = f()
-result9 = g()
-result2 = h()
-"""
local_ns = {}
global_ns = {}
- exec(CODE, local_ns, global_ns)
+ exec("""if 1:
+ def f():
+ y = 1
+ def g():
+ global y
+ return y
+ def h():
+ return y + 1
+ return g, h
+ y = 9
+ g, h = f()
+ result9 = g()
+ result2 = h()
+ """, local_ns, global_ns)
self.assertEqual(2, global_ns["result2"])
self.assertEqual(9, global_ns["result9"])
@@ -660,7 +672,7 @@ result2 = h()
c = f(0)
self.assertEqual(c.get(), 1)
- self.assertTrue("x" not in c.__class__.__dict__)
+ self.assertNotIn("x", c.__class__.__dict__)
def testNonLocalGenerator(self):
diff --git a/Lib/test/test_select.py b/Lib/test/test_select.py
index 8813c6ed1b..fe92f45145 100644
--- a/Lib/test/test_select.py
+++ b/Lib/test/test_select.py
@@ -4,7 +4,7 @@ import select
import os
import sys
-@unittest.skipIf(sys.platform[:3] in ('win', 'mac', 'os2', 'riscos'),
+@unittest.skipIf(sys.platform[:3] in ('win', 'os2', 'riscos'),
"can't easily test on this system")
class SelectTestCase(unittest.TestCase):
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 99d5c70e0a..07bfe0657e 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -5,7 +5,6 @@ import weakref
import operator
import copy
import pickle
-import os
from random import randrange, shuffle
import sys
import warnings
@@ -66,7 +65,7 @@ class TestJointOps(unittest.TestCase):
self.assertEqual(c in self.s, c in self.d)
self.assertRaises(TypeError, self.s.__contains__, [[]])
s = self.thetype([frozenset(self.letters)])
- self.assertTrue(self.thetype(self.letters) in s)
+ self.assertIn(self.thetype(self.letters), s)
def test_union(self):
u = self.s.union(self.otherword)
@@ -270,7 +269,7 @@ class TestJointOps(unittest.TestCase):
s=H()
f=set()
f.add(s)
- self.assertTrue(s in f)
+ self.assertIn(s, f)
f.remove(s)
f.add(s)
f.discard(s)
@@ -380,7 +379,7 @@ class TestSet(TestJointOps):
def test_add(self):
self.s.add('Q')
- self.assertTrue('Q' in self.s)
+ self.assertIn('Q', self.s)
dup = self.s.copy()
self.s.add('Q')
self.assertEqual(self.s, dup)
@@ -388,13 +387,13 @@ class TestSet(TestJointOps):
def test_remove(self):
self.s.remove('a')
- self.assertTrue('a' not in self.s)
+ self.assertNotIn('a', self.s)
self.assertRaises(KeyError, self.s.remove, 'Q')
self.assertRaises(TypeError, self.s.remove, [])
s = self.thetype([frozenset(self.word)])
- self.assertTrue(self.thetype(self.word) in s)
+ self.assertIn(self.thetype(self.word), s)
s.remove(self.thetype(self.word))
- self.assertTrue(self.thetype(self.word) not in s)
+ self.assertNotIn(self.thetype(self.word), s)
self.assertRaises(KeyError, self.s.remove, self.thetype(self.word))
def test_remove_keyerror_unpacking(self):
@@ -421,26 +420,26 @@ class TestSet(TestJointOps):
def test_discard(self):
self.s.discard('a')
- self.assertTrue('a' not in self.s)
+ self.assertNotIn('a', self.s)
self.s.discard('Q')
self.assertRaises(TypeError, self.s.discard, [])
s = self.thetype([frozenset(self.word)])
- self.assertTrue(self.thetype(self.word) in s)
+ self.assertIn(self.thetype(self.word), s)
s.discard(self.thetype(self.word))
- self.assertTrue(self.thetype(self.word) not in s)
+ self.assertNotIn(self.thetype(self.word), s)
s.discard(self.thetype(self.word))
def test_pop(self):
for i in range(len(self.s)):
elem = self.s.pop()
- self.assertTrue(elem not in self.s)
+ self.assertNotIn(elem, self.s)
self.assertRaises(KeyError, self.s.pop)
def test_update(self):
retval = self.s.update(self.otherword)
self.assertEqual(retval, None)
for c in (self.word + self.otherword):
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
self.assertRaises(PassThru, self.s.update, check_pass_thru())
self.assertRaises(TypeError, self.s.update, [[]])
for p, q in (('cdc', 'abcd'), ('efgfe', 'abcefg'), ('ccb', 'abc'), ('ef', 'abcef')):
@@ -458,16 +457,16 @@ class TestSet(TestJointOps):
def test_ior(self):
self.s |= set(self.otherword)
for c in (self.word + self.otherword):
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
def test_intersection_update(self):
retval = self.s.intersection_update(self.otherword)
self.assertEqual(retval, None)
for c in (self.word + self.otherword):
if c in self.otherword and c in self.word:
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
self.assertRaises(PassThru, self.s.intersection_update, check_pass_thru())
self.assertRaises(TypeError, self.s.intersection_update, [[]])
for p, q in (('cdc', 'c'), ('efgfe', ''), ('ccb', 'bc'), ('ef', '')):
@@ -485,18 +484,18 @@ class TestSet(TestJointOps):
self.s &= set(self.otherword)
for c in (self.word + self.otherword):
if c in self.otherword and c in self.word:
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
def test_difference_update(self):
retval = self.s.difference_update(self.otherword)
self.assertEqual(retval, None)
for c in (self.word + self.otherword):
if c in self.word and c not in self.otherword:
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
self.assertRaises(PassThru, self.s.difference_update, check_pass_thru())
self.assertRaises(TypeError, self.s.difference_update, [[]])
self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])
@@ -522,18 +521,18 @@ class TestSet(TestJointOps):
self.s -= set(self.otherword)
for c in (self.word + self.otherword):
if c in self.word and c not in self.otherword:
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
def test_symmetric_difference_update(self):
retval = self.s.symmetric_difference_update(self.otherword)
self.assertEqual(retval, None)
for c in (self.word + self.otherword):
if (c in self.word) ^ (c in self.otherword):
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
self.assertRaises(PassThru, self.s.symmetric_difference_update, check_pass_thru())
self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])
for p, q in (('cdc', 'abd'), ('efgfe', 'abcefg'), ('ccb', 'a'), ('ef', 'abcef')):
@@ -546,9 +545,9 @@ class TestSet(TestJointOps):
self.s ^= set(self.otherword)
for c in (self.word + self.otherword):
if (c in self.word) ^ (c in self.otherword):
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
def test_inplace_on_self(self):
t = self.s.copy()
@@ -608,7 +607,7 @@ class TestSet(TestJointOps):
# C API test only available in a debug build
if hasattr(set, "test_c_api"):
def test_c_api(self):
- self.assertEqual(set('abc').test_c_api(), True)
+ self.assertEqual(set().test_c_api(), True)
class SetSubclass(set):
pass
@@ -815,7 +814,7 @@ class TestBasicOps(unittest.TestCase):
def test_iteration(self):
for v in self.set:
- self.assertTrue(v in self.values)
+ self.assertIn(v, self.values)
setiter = iter(self.set)
# note: __length_hint__ is an internal undocumented API,
# don't rely on it in your own programs
@@ -850,10 +849,10 @@ class TestBasicOpsSingleton(TestBasicOps):
self.repr = "{3}"
def test_in(self):
- self.assertTrue(3 in self.set)
+ self.assertIn(3, self.set)
def test_not_in(self):
- self.assertTrue(2 not in self.set)
+ self.assertNotIn(2, self.set)
#------------------------------------------------------------------------------
@@ -867,10 +866,10 @@ class TestBasicOpsTuple(TestBasicOps):
self.repr = "{(0, 'zero')}"
def test_in(self):
- self.assertTrue((0, "zero") in self.set)
+ self.assertIn((0, "zero"), self.set)
def test_not_in(self):
- self.assertTrue(9 not in self.set)
+ self.assertNotIn(9, self.set)
#------------------------------------------------------------------------------
@@ -909,7 +908,8 @@ class TestBasicOpsBytes(TestBasicOps):
class TestBasicOpsMixedStringBytes(TestBasicOps):
def setUp(self):
- self.warning_filters = warnings.filters[:]
+ self._warning_filters = support.check_warnings()
+ self._warning_filters.__enter__()
warnings.simplefilter('ignore', BytesWarning)
self.case = "string and bytes set"
self.values = ["a", "b", b"a", b"b"]
@@ -919,7 +919,7 @@ class TestBasicOpsMixedStringBytes(TestBasicOps):
self.repr = "{'a', b'a', 'b', b'b'}"
def tearDown(self):
- warnings.filters = self.warning_filters
+ self._warning_filters.__exit__(None, None, None)
#==============================================================================
@@ -1187,7 +1187,7 @@ class TestMutate(unittest.TestCase):
popped[self.set.pop()] = None
self.assertEqual(len(popped), len(self.values))
for v in self.values:
- self.assertTrue(v in popped)
+ self.assertIn(v, popped)
def test_update_empty_tuple(self):
self.set.update(())
@@ -1794,7 +1794,7 @@ class TestGraphs(unittest.TestCase):
edge = vertex # Cuboctahedron vertices are edges in Cube
self.assertEqual(len(edge), 2) # Two cube vertices define an edge
for cubevert in edge:
- self.assertTrue(cubevert in g)
+ self.assertIn(cubevert, g)
#==============================================================================
diff --git a/Lib/test/test_shelve.py b/Lib/test/test_shelve.py
index 066208a1c0..3e73f52b87 100644
--- a/Lib/test/test_shelve.py
+++ b/Lib/test/test_shelve.py
@@ -122,6 +122,19 @@ class TestCase(unittest.TestCase):
self.assertEqual(len(d1), 1)
self.assertEqual(len(d2), 1)
+ def test_keyencoding(self):
+ d = {}
+ key = 'Pöp'
+ # the default keyencoding is utf-8
+ shelve.Shelf(d)[key] = [1]
+ self.assertIn(key.encode('utf-8'), d)
+ # but a different one can be given
+ shelve.Shelf(d, keyencoding='latin1')[key] = [1]
+ self.assertIn(key.encode('latin1'), d)
+ # with all consequences
+ s = shelve.Shelf(d, keyencoding='ascii')
+ self.assertRaises(UnicodeEncodeError, s.__setitem__, key, [1])
+
def test_writeback_also_writes_immediately(self):
# Issue 5754
d = {}
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 85473513d1..475a26b486 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -7,11 +7,98 @@ import sys
import stat
import os
import os.path
+import functools
from test import support
from test.support import TESTFN
+from os.path import splitdrive
+from distutils.spawn import find_executable, spawn
+from shutil import (_make_tarball, _make_zipfile, make_archive,
+ register_archive_format, unregister_archive_format,
+ get_archive_formats, Error, unpack_archive,
+ register_unpack_format, RegistryError,
+ unregister_unpack_format, get_unpack_formats)
+import tarfile
+import warnings
+
+from test import support
+from test.support import TESTFN, check_warnings, captured_stdout
+
+try:
+ import bz2
+ BZ2_SUPPORTED = True
+except ImportError:
+ BZ2_SUPPORTED = False
+
TESTFN2 = TESTFN + "2"
+try:
+ import grp
+ import pwd
+ UID_GID_SUPPORT = True
+except ImportError:
+ UID_GID_SUPPORT = False
+
+try:
+ import zlib
+except ImportError:
+ zlib = None
+
+try:
+ import zipfile
+ ZIP_SUPPORT = True
+except ImportError:
+ ZIP_SUPPORT = find_executable('zip')
+
+def _fake_rename(*args, **kwargs):
+ # Pretend the destination path is on a different filesystem.
+ raise OSError()
+
+def mock_rename(func):
+ @functools.wraps(func)
+ def wrap(*args, **kwargs):
+ try:
+ builtin_rename = os.rename
+ os.rename = _fake_rename
+ return func(*args, **kwargs)
+ finally:
+ os.rename = builtin_rename
+ return wrap
+
class TestShutil(unittest.TestCase):
+
+ def setUp(self):
+ super(TestShutil, self).setUp()
+ self.tempdirs = []
+
+ def tearDown(self):
+ super(TestShutil, self).tearDown()
+ while self.tempdirs:
+ d = self.tempdirs.pop()
+ shutil.rmtree(d, os.name in ('nt', 'cygwin'))
+
+ def write_file(self, path, content='xxx'):
+ """Writes a file in the given path.
+
+
+ path can be a string or a sequence.
+ """
+ if isinstance(path, (list, tuple)):
+ path = os.path.join(*path)
+ f = open(path, 'w')
+ try:
+ f.write(content)
+ finally:
+ f.close()
+
+ def mkdtemp(self):
+ """Create a temporary directory that will be cleaned up.
+
+ Returns the path of the directory.
+ """
+ d = tempfile.mkdtemp()
+ self.tempdirs.append(d)
+ return d
+
def test_rmtree_errors(self):
# filename is guaranteed not to exist
filename = tempfile.mktemp()
@@ -78,11 +165,12 @@ class TestShutil(unittest.TestCase):
self.assertRaises(OSError, shutil.rmtree, path)
os.remove(path)
+ def _write_data(self, path, data):
+ f = open(path, "w")
+ f.write(data)
+ f.close()
+
def test_copytree_simple(self):
- def write_data(path, data):
- f = open(path, "w")
- f.write(data)
- f.close()
def read_data(path):
f = open(path)
@@ -92,11 +180,9 @@ class TestShutil(unittest.TestCase):
src_dir = tempfile.mkdtemp()
dst_dir = os.path.join(tempfile.mkdtemp(), 'destination')
-
- write_data(os.path.join(src_dir, 'test.txt'), '123')
-
+ self._write_data(os.path.join(src_dir, 'test.txt'), '123')
os.mkdir(os.path.join(src_dir, 'test_dir'))
- write_data(os.path.join(src_dir, 'test_dir', 'test.txt'), '456')
+ self._write_data(os.path.join(src_dir, 'test_dir', 'test.txt'), '456')
try:
shutil.copytree(src_dir, dst_dir)
@@ -125,11 +211,6 @@ class TestShutil(unittest.TestCase):
def test_copytree_with_exclude(self):
- def write_data(path, data):
- f = open(path, "w")
- f.write(data)
- f.close()
-
def read_data(path):
f = open(path)
data = f.read()
@@ -142,16 +223,18 @@ class TestShutil(unittest.TestCase):
src_dir = tempfile.mkdtemp()
try:
dst_dir = join(tempfile.mkdtemp(), 'destination')
- write_data(join(src_dir, 'test.txt'), '123')
- write_data(join(src_dir, 'test.tmp'), '123')
+ self._write_data(join(src_dir, 'test.txt'), '123')
+ self._write_data(join(src_dir, 'test.tmp'), '123')
os.mkdir(join(src_dir, 'test_dir'))
- write_data(join(src_dir, 'test_dir', 'test.txt'), '456')
+ self._write_data(join(src_dir, 'test_dir', 'test.txt'), '456')
os.mkdir(join(src_dir, 'test_dir2'))
- write_data(join(src_dir, 'test_dir2', 'test.txt'), '456')
+ self._write_data(join(src_dir, 'test_dir2', 'test.txt'), '456')
os.mkdir(join(src_dir, 'test_dir2', 'subdir'))
os.mkdir(join(src_dir, 'test_dir2', 'subdir2'))
- write_data(join(src_dir, 'test_dir2', 'subdir', 'test.txt'), '456')
- write_data(join(src_dir, 'test_dir2', 'subdir2', 'test.py'), '456')
+ self._write_data(join(src_dir, 'test_dir2', 'subdir', 'test.txt'),
+ '456')
+ self._write_data(join(src_dir, 'test_dir2', 'subdir2', 'test.py'),
+ '456')
# testing glob-like patterns
@@ -204,48 +287,58 @@ class TestShutil(unittest.TestCase):
shutil.rmtree(src_dir)
shutil.rmtree(os.path.dirname(dst_dir))
- if hasattr(os, "symlink"):
- def test_dont_copy_file_onto_link_to_itself(self):
- # bug 851123.
- os.mkdir(TESTFN)
- src = os.path.join(TESTFN, 'cheese')
- dst = os.path.join(TESTFN, 'shop')
- try:
- f = open(src, 'w')
+ @unittest.skipUnless(hasattr(os, 'link'), 'requires os.link')
+ def test_dont_copy_file_onto_link_to_itself(self):
+ # Temporarily disable test on Windows.
+ if os.name == 'nt':
+ return
+ # bug 851123.
+ os.mkdir(TESTFN)
+ src = os.path.join(TESTFN, 'cheese')
+ dst = os.path.join(TESTFN, 'shop')
+ try:
+ with open(src, 'w') as f:
f.write('cheddar')
- f.close()
-
- os.link(src, dst)
- self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
- with open(src, 'r') as f:
- self.assertEqual(f.read(), 'cheddar')
- os.remove(dst)
-
- # Using `src` here would mean we end up with a symlink pointing
- # to TESTFN/TESTFN/cheese, while it should point at
- # TESTFN/cheese.
- os.symlink('cheese', dst)
- self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
- with open(src, 'r') as f:
- self.assertEqual(f.read(), 'cheddar')
- os.remove(dst)
- finally:
- try:
- shutil.rmtree(TESTFN)
- except OSError:
- pass
+ os.link(src, dst)
+ self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
+ with open(src, 'r') as f:
+ self.assertEqual(f.read(), 'cheddar')
+ os.remove(dst)
+ finally:
+ shutil.rmtree(TESTFN, ignore_errors=True)
- def test_rmtree_on_symlink(self):
- # bug 1669.
- os.mkdir(TESTFN)
- try:
- src = os.path.join(TESTFN, 'cheese')
- dst = os.path.join(TESTFN, 'shop')
- os.mkdir(src)
- os.symlink(src, dst)
- self.assertRaises(OSError, shutil.rmtree, dst)
- finally:
- shutil.rmtree(TESTFN, ignore_errors=True)
+ @support.skip_unless_symlink
+ def test_dont_copy_file_onto_symlink_to_itself(self):
+ # bug 851123.
+ os.mkdir(TESTFN)
+ src = os.path.join(TESTFN, 'cheese')
+ dst = os.path.join(TESTFN, 'shop')
+ try:
+ with open(src, 'w') as f:
+ f.write('cheddar')
+ # Using `src` here would mean we end up with a symlink pointing
+ # to TESTFN/TESTFN/cheese, while it should point at
+ # TESTFN/cheese.
+ os.symlink('cheese', dst)
+ self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
+ with open(src, 'r') as f:
+ self.assertEqual(f.read(), 'cheddar')
+ os.remove(dst)
+ finally:
+ shutil.rmtree(TESTFN, ignore_errors=True)
+
+ @support.skip_unless_symlink
+ def test_rmtree_on_symlink(self):
+ # bug 1669.
+ os.mkdir(TESTFN)
+ try:
+ src = os.path.join(TESTFN, 'cheese')
+ dst = os.path.join(TESTFN, 'shop')
+ os.mkdir(src)
+ os.symlink(src, dst)
+ self.assertRaises(OSError, shutil.rmtree, dst)
+ finally:
+ shutil.rmtree(TESTFN, ignore_errors=True)
if hasattr(os, "mkfifo"):
# Issue #3002: copyfile and copytree block indefinitely on named pipes
@@ -259,6 +352,7 @@ class TestShutil(unittest.TestCase):
finally:
os.remove(TESTFN)
+ @support.skip_unless_symlink
def test_copytree_named_pipe(self):
os.mkdir(TESTFN)
try:
@@ -279,6 +373,367 @@ class TestShutil(unittest.TestCase):
shutil.rmtree(TESTFN, ignore_errors=True)
shutil.rmtree(TESTFN2, ignore_errors=True)
+ def test_copytree_special_func(self):
+
+ src_dir = self.mkdtemp()
+ dst_dir = os.path.join(self.mkdtemp(), 'destination')
+ self._write_data(os.path.join(src_dir, 'test.txt'), '123')
+ os.mkdir(os.path.join(src_dir, 'test_dir'))
+ self._write_data(os.path.join(src_dir, 'test_dir', 'test.txt'), '456')
+
+ copied = []
+ def _copy(src, dst):
+ copied.append((src, dst))
+
+ shutil.copytree(src_dir, dst_dir, copy_function=_copy)
+ self.assertEqual(len(copied), 2)
+
+ @support.skip_unless_symlink
+ def test_copytree_dangling_symlinks(self):
+
+ # a dangling symlink raises an error at the end
+ src_dir = self.mkdtemp()
+ dst_dir = os.path.join(self.mkdtemp(), 'destination')
+ os.symlink('IDONTEXIST', os.path.join(src_dir, 'test.txt'))
+ os.mkdir(os.path.join(src_dir, 'test_dir'))
+ self._write_data(os.path.join(src_dir, 'test_dir', 'test.txt'), '456')
+ self.assertRaises(Error, shutil.copytree, src_dir, dst_dir)
+
+ # a dangling symlink is ignored with the proper flag
+ dst_dir = os.path.join(self.mkdtemp(), 'destination2')
+ shutil.copytree(src_dir, dst_dir, ignore_dangling_symlinks=True)
+ self.assertNotIn('test.txt', os.listdir(dst_dir))
+
+ # a dangling symlink is copied if symlinks=True
+ dst_dir = os.path.join(self.mkdtemp(), 'destination3')
+ shutil.copytree(src_dir, dst_dir, symlinks=True)
+ self.assertIn('test.txt', os.listdir(dst_dir))
+
+ def _copy_file(self, method):
+ fname = 'test.txt'
+ tmpdir = self.mkdtemp()
+ self.write_file([tmpdir, fname])
+ file1 = os.path.join(tmpdir, fname)
+ tmpdir2 = self.mkdtemp()
+ method(file1, tmpdir2)
+ file2 = os.path.join(tmpdir2, fname)
+ return (file1, file2)
+
+ @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.chmod')
+ def test_copy(self):
+ # Ensure that the copied file exists and has the same mode bits.
+ file1, file2 = self._copy_file(shutil.copy)
+ self.assertTrue(os.path.exists(file2))
+ self.assertEqual(os.stat(file1).st_mode, os.stat(file2).st_mode)
+
+ @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.chmod')
+ @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.utime')
+ def test_copy2(self):
+ # Ensure that the copied file exists and has the same mode and
+ # modification time bits.
+ file1, file2 = self._copy_file(shutil.copy2)
+ self.assertTrue(os.path.exists(file2))
+ file1_stat = os.stat(file1)
+ file2_stat = os.stat(file2)
+ self.assertEqual(file1_stat.st_mode, file2_stat.st_mode)
+ for attr in 'st_atime', 'st_mtime':
+ # The modification times may be truncated in the new file.
+ self.assertLessEqual(getattr(file1_stat, attr),
+ getattr(file2_stat, attr) + 1)
+ if hasattr(os, 'chflags') and hasattr(file1_stat, 'st_flags'):
+ self.assertEqual(getattr(file1_stat, 'st_flags'),
+ getattr(file2_stat, 'st_flags'))
+
+ @unittest.skipUnless(zlib, "requires zlib")
+ def test_make_tarball(self):
+ # creating something to tar
+ tmpdir = self.mkdtemp()
+ self.write_file([tmpdir, 'file1'], 'xxx')
+ self.write_file([tmpdir, 'file2'], 'xxx')
+ os.mkdir(os.path.join(tmpdir, 'sub'))
+ self.write_file([tmpdir, 'sub', 'file3'], 'xxx')
+
+ tmpdir2 = self.mkdtemp()
+ # force shutil to create the directory
+ os.rmdir(tmpdir2)
+ unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0],
+ "source and target should be on same drive")
+
+ base_name = os.path.join(tmpdir2, 'archive')
+
+ # working with relative paths to avoid tar warnings
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(splitdrive(base_name)[1], '.')
+ finally:
+ os.chdir(old_dir)
+
+ # check if the compressed tarball was created
+ tarball = base_name + '.tar.gz'
+ self.assertTrue(os.path.exists(tarball))
+
+ # trying an uncompressed one
+ base_name = os.path.join(tmpdir2, 'archive')
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(splitdrive(base_name)[1], '.', compress=None)
+ finally:
+ os.chdir(old_dir)
+ tarball = base_name + '.tar'
+ self.assertTrue(os.path.exists(tarball))
+
+ def _tarinfo(self, path):
+ tar = tarfile.open(path)
+ try:
+ names = tar.getnames()
+ names.sort()
+ return tuple(names)
+ finally:
+ tar.close()
+
+ def _create_files(self):
+ # creating something to tar
+ tmpdir = self.mkdtemp()
+ dist = os.path.join(tmpdir, 'dist')
+ os.mkdir(dist)
+ self.write_file([dist, 'file1'], 'xxx')
+ self.write_file([dist, 'file2'], 'xxx')
+ os.mkdir(os.path.join(dist, 'sub'))
+ self.write_file([dist, 'sub', 'file3'], 'xxx')
+ os.mkdir(os.path.join(dist, 'sub2'))
+ tmpdir2 = self.mkdtemp()
+ base_name = os.path.join(tmpdir2, 'archive')
+ return tmpdir, tmpdir2, base_name
+
+ @unittest.skipUnless(zlib, "Requires zlib")
+ @unittest.skipUnless(find_executable('tar') and find_executable('gzip'),
+ 'Need the tar command to run')
+ def test_tarfile_vs_tar(self):
+ tmpdir, tmpdir2, base_name = self._create_files()
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(base_name, 'dist')
+ finally:
+ os.chdir(old_dir)
+
+ # check if the compressed tarball was created
+ tarball = base_name + '.tar.gz'
+ self.assertTrue(os.path.exists(tarball))
+
+ # now create another tarball using `tar`
+ tarball2 = os.path.join(tmpdir, 'archive2.tar.gz')
+ tar_cmd = ['tar', '-cf', 'archive2.tar', 'dist']
+ gzip_cmd = ['gzip', '-f9', 'archive2.tar']
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ with captured_stdout() as s:
+ spawn(tar_cmd)
+ spawn(gzip_cmd)
+ finally:
+ os.chdir(old_dir)
+
+ self.assertTrue(os.path.exists(tarball2))
+ # let's compare both tarballs
+ self.assertEqual(self._tarinfo(tarball), self._tarinfo(tarball2))
+
+ # trying an uncompressed one
+ base_name = os.path.join(tmpdir2, 'archive')
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(base_name, 'dist', compress=None)
+ finally:
+ os.chdir(old_dir)
+ tarball = base_name + '.tar'
+ self.assertTrue(os.path.exists(tarball))
+
+ # now for a dry_run
+ base_name = os.path.join(tmpdir2, 'archive')
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(base_name, 'dist', compress=None, dry_run=True)
+ finally:
+ os.chdir(old_dir)
+ tarball = base_name + '.tar'
+ self.assertTrue(os.path.exists(tarball))
+
+ @unittest.skipUnless(zlib, "Requires zlib")
+ @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run')
+ def test_make_zipfile(self):
+ # creating something to tar
+ tmpdir = self.mkdtemp()
+ self.write_file([tmpdir, 'file1'], 'xxx')
+ self.write_file([tmpdir, 'file2'], 'xxx')
+
+ tmpdir2 = self.mkdtemp()
+ # force shutil to create the directory
+ os.rmdir(tmpdir2)
+ base_name = os.path.join(tmpdir2, 'archive')
+ _make_zipfile(base_name, tmpdir)
+
+ # check if the compressed tarball was created
+ tarball = base_name + '.zip'
+ self.assertTrue(os.path.exists(tarball))
+
+
+ def test_make_archive(self):
+ tmpdir = self.mkdtemp()
+ base_name = os.path.join(tmpdir, 'archive')
+ self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+
+ @unittest.skipUnless(zlib, "Requires zlib")
+ def test_make_archive_owner_group(self):
+ # testing make_archive with owner and group, with various combinations
+ # this works even if there's not gid/uid support
+ if UID_GID_SUPPORT:
+ group = grp.getgrgid(0)[0]
+ owner = pwd.getpwuid(0)[0]
+ else:
+ group = owner = 'root'
+
+ base_dir, root_dir, base_name = self._create_files()
+ base_name = os.path.join(self.mkdtemp() , 'archive')
+ res = make_archive(base_name, 'zip', root_dir, base_dir, owner=owner,
+ group=group)
+ self.assertTrue(os.path.exists(res))
+
+ res = make_archive(base_name, 'zip', root_dir, base_dir)
+ self.assertTrue(os.path.exists(res))
+
+ res = make_archive(base_name, 'tar', root_dir, base_dir,
+ owner=owner, group=group)
+ self.assertTrue(os.path.exists(res))
+
+ res = make_archive(base_name, 'tar', root_dir, base_dir,
+ owner='kjhkjhkjg', group='oihohoh')
+ self.assertTrue(os.path.exists(res))
+
+
+ @unittest.skipUnless(zlib, "Requires zlib")
+ @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+ def test_tarfile_root_owner(self):
+ tmpdir, tmpdir2, base_name = self._create_files()
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ group = grp.getgrgid(0)[0]
+ owner = pwd.getpwuid(0)[0]
+ try:
+ archive_name = _make_tarball(base_name, 'dist', compress=None,
+ owner=owner, group=group)
+ finally:
+ os.chdir(old_dir)
+
+ # check if the compressed tarball was created
+ self.assertTrue(os.path.exists(archive_name))
+
+ # now checks the rights
+ archive = tarfile.open(archive_name)
+ try:
+ for member in archive.getmembers():
+ self.assertEqual(member.uid, 0)
+ self.assertEqual(member.gid, 0)
+ finally:
+ archive.close()
+
+ def test_make_archive_cwd(self):
+ current_dir = os.getcwd()
+ def _breaks(*args, **kw):
+ raise RuntimeError()
+
+ register_archive_format('xxx', _breaks, [], 'xxx file')
+ try:
+ try:
+ make_archive('xxx', 'xxx', root_dir=self.mkdtemp())
+ except Exception:
+ pass
+ self.assertEqual(os.getcwd(), current_dir)
+ finally:
+ unregister_archive_format('xxx')
+
+ def test_register_archive_format(self):
+
+ self.assertRaises(TypeError, register_archive_format, 'xxx', 1)
+ self.assertRaises(TypeError, register_archive_format, 'xxx', lambda: x,
+ 1)
+ self.assertRaises(TypeError, register_archive_format, 'xxx', lambda: x,
+ [(1, 2), (1, 2, 3)])
+
+ register_archive_format('xxx', lambda: x, [(1, 2)], 'xxx file')
+ formats = [name for name, params in get_archive_formats()]
+ self.assertIn('xxx', formats)
+
+ unregister_archive_format('xxx')
+ formats = [name for name, params in get_archive_formats()]
+ self.assertNotIn('xxx', formats)
+
+ def _compare_dirs(self, dir1, dir2):
+ # check that dir1 and dir2 are equivalent,
+ # return the diff
+ diff = []
+ for root, dirs, files in os.walk(dir1):
+ for file_ in files:
+ path = os.path.join(root, file_)
+ target_path = os.path.join(dir2, os.path.split(path)[-1])
+ if not os.path.exists(target_path):
+ diff.append(file_)
+ return diff
+
+ @unittest.skipUnless(zlib, "Requires zlib")
+ def test_unpack_archive(self):
+ formats = ['tar', 'gztar', 'zip']
+ if BZ2_SUPPORTED:
+ formats.append('bztar')
+
+ for format in formats:
+ tmpdir = self.mkdtemp()
+ base_dir, root_dir, base_name = self._create_files()
+ tmpdir2 = self.mkdtemp()
+ filename = make_archive(base_name, format, root_dir, base_dir)
+
+ # let's try to unpack it now
+ unpack_archive(filename, tmpdir2)
+ diff = self._compare_dirs(tmpdir, tmpdir2)
+ self.assertEqual(diff, [])
+
+ # and again, this time with the format specified
+ tmpdir3 = self.mkdtemp()
+ unpack_archive(filename, tmpdir3, format=format)
+ diff = self._compare_dirs(tmpdir, tmpdir3)
+ self.assertEqual(diff, [])
+ self.assertRaises(shutil.ReadError, unpack_archive, TESTFN)
+ self.assertRaises(ValueError, unpack_archive, TESTFN, format='xxx')
+
+ def test_unpack_registery(self):
+
+ formats = get_unpack_formats()
+
+ def _boo(filename, extract_dir, extra):
+ self.assertEqual(extra, 1)
+ self.assertEqual(filename, 'stuff.boo')
+ self.assertEqual(extract_dir, 'xx')
+
+ register_unpack_format('Boo', ['.boo', '.b2'], _boo, [('extra', 1)])
+ unpack_archive('stuff.boo', 'xx')
+
+ # trying to register a .boo unpacker again
+ self.assertRaises(RegistryError, register_unpack_format, 'Boo2',
+ ['.boo'], _boo)
+
+ # should work now
+ unregister_unpack_format('Boo')
+ register_unpack_format('Boo2', ['.boo'], _boo)
+ self.assertIn(('Boo2', ['.boo'], ''), get_unpack_formats())
+ self.assertNotIn(('Boo', ['.boo'], ''), get_unpack_formats())
+
+ # let's leave a clean state
+ unregister_unpack_format('Boo2')
+ self.assertEqual(get_unpack_formats(), formats)
+
class TestMove(unittest.TestCase):
@@ -288,20 +743,11 @@ class TestMove(unittest.TestCase):
self.dst_dir = tempfile.mkdtemp()
self.src_file = os.path.join(self.src_dir, filename)
self.dst_file = os.path.join(self.dst_dir, filename)
- # Try to create a dir in the current directory, hoping that it is
- # not located on the same filesystem as the system tmp dir.
- try:
- self.dir_other_fs = tempfile.mkdtemp(
- dir=os.path.dirname(__file__))
- self.file_other_fs = os.path.join(self.dir_other_fs,
- filename)
- except OSError:
- self.dir_other_fs = None
with open(self.src_file, "wb") as f:
f.write(b"spam")
def tearDown(self):
- for d in (self.src_dir, self.dst_dir, self.dir_other_fs):
+ for d in (self.src_dir, self.dst_dir):
try:
if d:
shutil.rmtree(d)
@@ -330,21 +776,15 @@ class TestMove(unittest.TestCase):
# Move a file inside an existing dir on the same filesystem.
self._check_move_file(self.src_file, self.dst_dir, self.dst_file)
+ @mock_rename
def test_move_file_other_fs(self):
# Move a file to an existing dir on another filesystem.
- if not self.dir_other_fs:
- # skip
- return
- self._check_move_file(self.src_file, self.file_other_fs,
- self.file_other_fs)
+ self.test_move_file()
+ @mock_rename
def test_move_file_to_dir_other_fs(self):
# Move a file to another location on another filesystem.
- if not self.dir_other_fs:
- # skip
- return
- self._check_move_file(self.src_file, self.dir_other_fs,
- self.file_other_fs)
+ self.test_move_file_to_dir()
def test_move_dir(self):
# Move a dir to another location on the same filesystem.
@@ -357,32 +797,20 @@ class TestMove(unittest.TestCase):
except:
pass
+ @mock_rename
def test_move_dir_other_fs(self):
# Move a dir to another location on another filesystem.
- if not self.dir_other_fs:
- # skip
- return
- dst_dir = tempfile.mktemp(dir=self.dir_other_fs)
- try:
- self._check_move_dir(self.src_dir, dst_dir, dst_dir)
- finally:
- try:
- shutil.rmtree(dst_dir)
- except:
- pass
+ self.test_move_dir()
def test_move_dir_to_dir(self):
# Move a dir inside an existing dir on the same filesystem.
self._check_move_dir(self.src_dir, self.dst_dir,
os.path.join(self.dst_dir, os.path.basename(self.src_dir)))
+ @mock_rename
def test_move_dir_to_dir_other_fs(self):
# Move a dir inside an existing dir on another filesystem.
- if not self.dir_other_fs:
- # skip
- return
- self._check_move_dir(self.src_dir, self.dir_other_fs,
- os.path.join(self.dir_other_fs, os.path.basename(self.src_dir)))
+ self.test_move_dir_to_dir()
def test_existing_file_inside_dest_dir(self):
# A file with the same name inside the destination dir already exists.
@@ -419,6 +847,7 @@ class TestMove(unittest.TestCase):
finally:
shutil.rmtree(TESTFN, ignore_errors=True)
+
class TestCopyFile(unittest.TestCase):
_delete = False
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 6231a6bab1..8168d7ed92 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -6,13 +6,16 @@ executing have not been removed.
"""
import unittest
from test.support import run_unittest, TESTFN, EnvironmentVarGuard
-from test.support import captured_output
+from test.support import captured_stderr
import builtins
import os
import sys
import re
import encodings
import subprocess
+import sysconfig
+from copy import copy
+
# Need to make sure to not import 'site' if someone specified ``-S`` at the
# command-line. Detect this by just making sure 'site' has not been imported
# already.
@@ -28,19 +31,23 @@ if not os.path.isdir(site.USER_SITE):
class HelperFunctionsTests(unittest.TestCase):
"""Tests for helper functions.
-
- The setting of the encoding (set using sys.setdefaultencoding) used by
- the Unicode implementation is not tested.
-
"""
def setUp(self):
"""Save a copy of sys.path"""
self.sys_path = sys.path[:]
+ self.old_base = site.USER_BASE
+ self.old_site = site.USER_SITE
+ self.old_prefixes = site.PREFIXES
+ self.old_vars = copy(sysconfig._CONFIG_VARS)
def tearDown(self):
"""Restore sys.path"""
- sys.path = self.sys_path
+ sys.path[:] = self.sys_path
+ site.USER_BASE = self.old_base
+ site.USER_SITE = self.old_site
+ site.PREFIXES = self.old_prefixes
+ sysconfig._CONFIG_VARS = self.old_vars
def test_makepath(self):
# Test makepath() have an absolute path for its first return value
@@ -59,16 +66,16 @@ class HelperFunctionsTests(unittest.TestCase):
dir_set = site._init_pathinfo()
for entry in [site.makepath(path)[1] for path in sys.path
if path and os.path.isdir(path)]:
- self.assertTrue(entry in dir_set,
- "%s from sys.path not found in set returned "
- "by _init_pathinfo(): %s" % (entry, dir_set))
+ self.assertIn(entry, dir_set,
+ "%s from sys.path not found in set returned "
+ "by _init_pathinfo(): %s" % (entry, dir_set))
def pth_file_tests(self, pth_file):
"""Contain common code for testing results of reading a .pth file"""
- self.assertTrue(pth_file.imported in sys.modules,
- "%s not in sys.path" % pth_file.imported)
- self.assertTrue(site.makepath(pth_file.good_dir_path)[0] in sys.path)
- self.assertTrue(not os.path.exists(pth_file.bad_dir_path))
+ self.assertIn(pth_file.imported, sys.modules,
+ "%s not in sys.modules" % pth_file.imported)
+ self.assertIn(site.makepath(pth_file.good_dir_path)[0], sys.path)
+ self.assertFalse(os.path.exists(pth_file.bad_dir_path))
def test_addpackage(self):
# Make sure addpackage() imports if the line starts with 'import',
@@ -99,43 +106,43 @@ class HelperFunctionsTests(unittest.TestCase):
def test_addpackage_import_bad_syntax(self):
# Issue 10642
pth_dir, pth_fn = self.make_pth("import bad)syntax\n")
- with captured_output("stderr") as err_out:
+ with captured_stderr() as err_out:
site.addpackage(pth_dir, pth_fn, set())
- self.assertRegexpMatches(err_out.getvalue(), "line 1")
- self.assertRegexpMatches(err_out.getvalue(),
+ self.assertRegex(err_out.getvalue(), "line 1")
+ self.assertRegex(err_out.getvalue(),
re.escape(os.path.join(pth_dir, pth_fn)))
# XXX: the previous two should be independent checks so that the
# order doesn't matter. The next three could be a single check
# but my regex foo isn't good enough to write it.
- self.assertRegexpMatches(err_out.getvalue(), 'Traceback')
- self.assertRegexpMatches(err_out.getvalue(), r'import bad\)syntax')
- self.assertRegexpMatches(err_out.getvalue(), 'SyntaxError')
+ self.assertRegex(err_out.getvalue(), 'Traceback')
+ self.assertRegex(err_out.getvalue(), r'import bad\)syntax')
+ self.assertRegex(err_out.getvalue(), 'SyntaxError')
def test_addpackage_import_bad_exec(self):
# Issue 10642
pth_dir, pth_fn = self.make_pth("randompath\nimport nosuchmodule\n")
- with captured_output("stderr") as err_out:
+ with captured_stderr() as err_out:
site.addpackage(pth_dir, pth_fn, set())
- self.assertRegexpMatches(err_out.getvalue(), "line 2")
- self.assertRegexpMatches(err_out.getvalue(),
+ self.assertRegex(err_out.getvalue(), "line 2")
+ self.assertRegex(err_out.getvalue(),
re.escape(os.path.join(pth_dir, pth_fn)))
# XXX: ditto previous XXX comment.
- self.assertRegexpMatches(err_out.getvalue(), 'Traceback')
- self.assertRegexpMatches(err_out.getvalue(), 'ImportError')
+ self.assertRegex(err_out.getvalue(), 'Traceback')
+ self.assertRegex(err_out.getvalue(), 'ImportError')
@unittest.skipIf(sys.platform == "win32", "Windows does not raise an "
"error for file paths containing null characters")
def test_addpackage_import_bad_pth_file(self):
# Issue 5258
pth_dir, pth_fn = self.make_pth("abc\x00def\n")
- with captured_output("stderr") as err_out:
+ with captured_stderr() as err_out:
site.addpackage(pth_dir, pth_fn, set())
- self.assertRegexpMatches(err_out.getvalue(), "line 1")
- self.assertRegexpMatches(err_out.getvalue(),
+ self.assertRegex(err_out.getvalue(), "line 1")
+ self.assertRegex(err_out.getvalue(),
re.escape(os.path.join(pth_dir, pth_fn)))
# XXX: ditto previous XXX comment.
- self.assertRegexpMatches(err_out.getvalue(), 'Traceback')
- self.assertRegexpMatches(err_out.getvalue(), 'TypeError')
+ self.assertRegex(err_out.getvalue(), 'Traceback')
+ self.assertRegex(err_out.getvalue(), 'TypeError')
def test_addsitedir(self):
# Same tests for test_addpackage since addsitedir() essentially just
@@ -152,7 +159,7 @@ class HelperFunctionsTests(unittest.TestCase):
def test_s_option(self):
usersite = site.USER_SITE
- self.assertTrue(usersite in sys.path)
+ self.assertIn(usersite, sys.path)
env = os.environ.copy()
rc = subprocess.call([sys.executable, '-c',
@@ -180,6 +187,62 @@ class HelperFunctionsTests(unittest.TestCase):
env=env)
self.assertEqual(rc, 1)
+ def test_getuserbase(self):
+ site.USER_BASE = None
+ user_base = site.getuserbase()
+
+ # the call sets site.USER_BASE
+ self.assertEqual(site.USER_BASE, user_base)
+
+ # let's set PYTHONUSERBASE and see if it uses it
+ site.USER_BASE = None
+ import sysconfig
+ sysconfig._CONFIG_VARS = None
+
+ with EnvironmentVarGuard() as environ:
+ environ['PYTHONUSERBASE'] = 'xoxo'
+ self.assertTrue(site.getuserbase().startswith('xoxo'),
+ site.getuserbase())
+
+ def test_getusersitepackages(self):
+ site.USER_SITE = None
+ site.USER_BASE = None
+ user_site = site.getusersitepackages()
+
+ # the call sets USER_BASE *and* USER_SITE
+ self.assertEqual(site.USER_SITE, user_site)
+ self.assertTrue(user_site.startswith(site.USER_BASE), user_site)
+
+ def test_getsitepackages(self):
+ site.PREFIXES = ['xoxo']
+ dirs = site.getsitepackages()
+
+ if sys.platform in ('os2emx', 'riscos'):
+ self.assertEqual(len(dirs), 1)
+ wanted = os.path.join('xoxo', 'Lib', 'site-packages')
+ self.assertEqual(dirs[0], wanted)
+ elif os.sep == '/':
+ self.assertEqual(len(dirs), 2)
+ wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
+ 'site-packages')
+ self.assertEqual(dirs[0], wanted)
+ wanted = os.path.join('xoxo', 'lib', 'site-python')
+ self.assertEqual(dirs[1], wanted)
+ else:
+ self.assertEqual(len(dirs), 2)
+ self.assertEqual(dirs[0], 'xoxo')
+ wanted = os.path.join('xoxo', 'lib', 'site-packages')
+ self.assertEqual(dirs[1], wanted)
+
+ # let's try the specific Apple location
+ if (sys.platform == "darwin" and
+ sysconfig.get_config_var("PYTHONFRAMEWORK")):
+ site.PREFIXES = ['Python.framework']
+ dirs = site.getsitepackages()
+ self.assertEqual(len(dirs), 3)
+ wanted = os.path.join('/Library', 'Python', sys.version[:3],
+ 'site-packages')
+ self.assertEqual(dirs[2], wanted)
class PthFile(object):
"""Helper class for handling testing of .pth files"""
@@ -245,21 +308,45 @@ class ImportSideEffectTests(unittest.TestCase):
def tearDown(self):
"""Restore sys.path"""
- sys.path = self.sys_path
-
- def test_abs__file__(self):
- # Make sure all imported modules have their __file__ attribute
- # as an absolute path.
- # Handled by abs__file__()
- site.abs__file__()
- for module in (sys, os, builtins):
- try:
- self.assertTrue(os.path.isabs(module.__file__), repr(module))
- except AttributeError:
- continue
- # We could try everything in sys.modules; however, when regrtest.py
- # runs something like test_frozen before test_site, then we will
- # be testing things loaded *after* test_site did path normalization
+ sys.path[:] = self.sys_path
+
+ def test_abs_paths(self):
+ # Make sure all imported modules have their __file__ and __cached__
+ # attributes as absolute paths. Arranging to put the Lib directory on
+ # PYTHONPATH would cause the os module to have a relative path for
+ # __file__ if abs_paths() does not get run. sys and builtins (the
+ # only other modules imported before site.py runs) do not have
+ # __file__ or __cached__ because they are built-in.
+ parent = os.path.relpath(os.path.dirname(os.__file__))
+ env = os.environ.copy()
+ env['PYTHONPATH'] = parent
+ code = ('import os, sys',
+ # use ASCII to avoid locale issues with non-ASCII directories
+ 'os_file = os.__file__.encode("ascii", "backslashreplace")',
+ r'sys.stdout.buffer.write(os_file + b"\n")',
+ 'os_cached = os.__cached__.encode("ascii", "backslashreplace")',
+ r'sys.stdout.buffer.write(os_cached + b"\n")')
+ command = '\n'.join(code)
+ # First, prove that with -S (no 'import site'), the paths are
+ # relative.
+ proc = subprocess.Popen([sys.executable, '-S', '-c', command],
+ env=env,
+ stdout=subprocess.PIPE)
+ stdout, stderr = proc.communicate()
+
+ self.assertEqual(proc.returncode, 0)
+ os__file__, os__cached__ = stdout.splitlines()[:2]
+ self.assertFalse(os.path.isabs(os__file__))
+ self.assertFalse(os.path.isabs(os__cached__))
+ # Now, with 'import site', it works.
+ proc = subprocess.Popen([sys.executable, '-c', command],
+ env=env,
+ stdout=subprocess.PIPE)
+ stdout, stderr = proc.communicate()
+ self.assertEqual(proc.returncode, 0)
+ os__file__, os__cached__ = stdout.splitlines()[:2]
+ self.assertTrue(os.path.isabs(os__file__))
+ self.assertTrue(os.path.isabs(os__cached__))
def test_no_duplicate_paths(self):
# No duplicate paths should exist in sys.path
@@ -267,7 +354,7 @@ class ImportSideEffectTests(unittest.TestCase):
site.removeduppaths()
seen_paths = set()
for path in sys.path:
- self.assertTrue(path not in seen_paths)
+ self.assertNotIn(path, seen_paths)
seen_paths.add(path)
def test_add_build_dir(self):
@@ -300,10 +387,6 @@ class ImportSideEffectTests(unittest.TestCase):
else:
self.fail("did not alias mbcs")
- def test_setdefaultencoding_removed(self):
- # Make sure sys.setdefaultencoding is gone
- self.assertTrue(not hasattr(sys, "setdefaultencoding"))
-
def test_sitecustomize_executed(self):
# If sitecustomize is available, it should have been imported.
if "sitecustomize" not in sys.modules:
diff --git a/Lib/test/test_smtpd.py b/Lib/test/test_smtpd.py
new file mode 100644
index 0000000000..a4cd6707ba
--- /dev/null
+++ b/Lib/test/test_smtpd.py
@@ -0,0 +1,289 @@
+from unittest import TestCase
+from test import support, mock_socket
+import socket
+import io
+import smtpd
+import asyncore
+
+
+class DummyServer(smtpd.SMTPServer):
+ def __init__(self, localaddr, remoteaddr):
+ smtpd.SMTPServer.__init__(self, localaddr, remoteaddr)
+ self.messages = []
+
+ def process_message(self, peer, mailfrom, rcpttos, data):
+ self.messages.append((peer, mailfrom, rcpttos, data))
+ if data == 'return status':
+ return '250 Okish'
+
+
+class DummyDispatcherBroken(Exception):
+ pass
+
+
+class BrokenDummyServer(DummyServer):
+ def listen(self, num):
+ raise DummyDispatcherBroken()
+
+
+class SMTPDServerTest(TestCase):
+ def setUp(self):
+ smtpd.socket = asyncore.socket = mock_socket
+
+ def test_process_message_unimplemented(self):
+ server = smtpd.SMTPServer('a', 'b')
+ conn, addr = server.accept()
+ channel = smtpd.SMTPChannel(server, conn, addr)
+
+ def write_line(line):
+ channel.socket.queue_recv(line)
+ channel.handle_read()
+
+ write_line(b'MAIL From:eggs@example')
+ write_line(b'RCPT To:spam@example')
+ write_line(b'DATA')
+ self.assertRaises(NotImplementedError, write_line, b'spam\r\n.\r\n')
+
+ def tearDown(self):
+ asyncore.close_all()
+ asyncore.socket = smtpd.socket = socket
+
+
+class SMTPDChannelTest(TestCase):
+ def setUp(self):
+ smtpd.socket = asyncore.socket = mock_socket
+ self.debug = smtpd.DEBUGSTREAM = io.StringIO()
+ self.server = DummyServer('a', 'b')
+ conn, addr = self.server.accept()
+ self.channel = smtpd.SMTPChannel(self.server, conn, addr)
+
+ def tearDown(self):
+ asyncore.close_all()
+ asyncore.socket = smtpd.socket = socket
+
+ def write_line(self, line):
+ self.channel.socket.queue_recv(line)
+ self.channel.handle_read()
+
+ def test_broken_connect(self):
+ self.assertRaises(DummyDispatcherBroken, BrokenDummyServer, 'a', 'b')
+
+ def test_server_accept(self):
+ self.server.handle_accept()
+
+ def test_missing_data(self):
+ self.write_line(b'')
+ self.assertEqual(self.channel.socket.last,
+ b'500 Error: bad syntax\r\n')
+
+ def test_EHLO_not_implemented(self):
+ self.write_line(b'EHLO test.example')
+ self.assertEqual(self.channel.socket.last,
+ b'502 Error: command "EHLO" not implemented\r\n')
+
+ def test_HELO(self):
+ name = smtpd.socket.getfqdn()
+ self.write_line(b'HELO test.example')
+ self.assertEqual(self.channel.socket.last,
+ '250 {}\r\n'.format(name).encode('ascii'))
+
+ def test_HELO_bad_syntax(self):
+ self.write_line(b'HELO')
+ self.assertEqual(self.channel.socket.last,
+ b'501 Syntax: HELO hostname\r\n')
+
+ def test_HELO_duplicate(self):
+ self.write_line(b'HELO test.example')
+ self.write_line(b'HELO test.example')
+ self.assertEqual(self.channel.socket.last,
+ b'503 Duplicate HELO/EHLO\r\n')
+
+ def test_NOOP(self):
+ self.write_line(b'NOOP')
+ self.assertEqual(self.channel.socket.last, b'250 Ok\r\n')
+
+ def test_NOOP_bad_syntax(self):
+ self.write_line(b'NOOP hi')
+ self.assertEqual(self.channel.socket.last,
+ b'501 Syntax: NOOP\r\n')
+
+ def test_QUIT(self):
+ self.write_line(b'QUIT')
+ self.assertEqual(self.channel.socket.last, b'221 Bye\r\n')
+
+ def test_QUIT_arg_ignored(self):
+ self.write_line(b'QUIT bye bye')
+ self.assertEqual(self.channel.socket.last, b'221 Bye\r\n')
+
+ def test_bad_state(self):
+ self.channel.smtp_state = 'BAD STATE'
+ self.write_line(b'HELO')
+ self.assertEqual(self.channel.socket.last,
+ b'451 Internal confusion\r\n')
+
+ def test_command_too_long(self):
+ self.write_line(b'MAIL from ' +
+ b'a' * self.channel.command_size_limit +
+ b'@example')
+ self.assertEqual(self.channel.socket.last,
+ b'500 Error: line too long\r\n')
+
+ def test_data_too_long(self):
+ # Small hack. Setting limit to 2K octets here will save us some time.
+ self.channel.data_size_limit = 2048
+ self.write_line(b'MAIL From:eggs@example')
+ self.write_line(b'RCPT To:spam@example')
+ self.write_line(b'DATA')
+ self.write_line(b'A' * self.channel.data_size_limit +
+ b'A\r\n.')
+ self.assertEqual(self.channel.socket.last,
+ b'552 Error: Too much mail data\r\n')
+
+ def test_need_MAIL(self):
+ self.write_line(b'RCPT to:spam@example')
+ self.assertEqual(self.channel.socket.last,
+ b'503 Error: need MAIL command\r\n')
+
+ def test_MAIL_syntax(self):
+ self.write_line(b'MAIL from eggs@example')
+ self.assertEqual(self.channel.socket.last,
+ b'501 Syntax: MAIL FROM:<address>\r\n')
+
+ def test_MAIL_missing_from(self):
+ self.write_line(b'MAIL from:')
+ self.assertEqual(self.channel.socket.last,
+ b'501 Syntax: MAIL FROM:<address>\r\n')
+
+ def test_MAIL_chevrons(self):
+ self.write_line(b'MAIL from:<eggs@example>')
+ self.assertEqual(self.channel.socket.last, b'250 Ok\r\n')
+
+ def test_nested_MAIL(self):
+ self.write_line(b'MAIL from:eggs@example')
+ self.write_line(b'MAIL from:spam@example')
+ self.assertEqual(self.channel.socket.last,
+ b'503 Error: nested MAIL command\r\n')
+
+ def test_need_RCPT(self):
+ self.write_line(b'MAIL From:eggs@example')
+ self.write_line(b'DATA')
+ self.assertEqual(self.channel.socket.last,
+ b'503 Error: need RCPT command\r\n')
+
+ def test_RCPT_syntax(self):
+ self.write_line(b'MAIL From:eggs@example')
+ self.write_line(b'RCPT to eggs@example')
+ self.assertEqual(self.channel.socket.last,
+ b'501 Syntax: RCPT TO: <address>\r\n')
+
+ def test_data_dialog(self):
+ self.write_line(b'MAIL From:eggs@example')
+ self.assertEqual(self.channel.socket.last, b'250 Ok\r\n')
+ self.write_line(b'RCPT To:spam@example')
+ self.assertEqual(self.channel.socket.last, b'250 Ok\r\n')
+
+ self.write_line(b'DATA')
+ self.assertEqual(self.channel.socket.last,
+ b'354 End data with <CR><LF>.<CR><LF>\r\n')
+ self.write_line(b'data\r\nmore\r\n.')
+ self.assertEqual(self.channel.socket.last, b'250 Ok\r\n')
+ self.assertEqual(self.server.messages,
+ [('peer', 'eggs@example', ['spam@example'], 'data\nmore')])
+
+ def test_DATA_syntax(self):
+ self.write_line(b'MAIL From:eggs@example')
+ self.write_line(b'RCPT To:spam@example')
+ self.write_line(b'DATA spam')
+ self.assertEqual(self.channel.socket.last, b'501 Syntax: DATA\r\n')
+
+ def test_data_transparency_section_4_5_2(self):
+ self.write_line(b'MAIL From:eggs@example')
+ self.write_line(b'RCPT To:spam@example')
+ self.write_line(b'DATA')
+ self.write_line(b'..\r\n.\r\n')
+ self.assertEqual(self.channel.received_data, '.')
+
+ def test_multiple_RCPT(self):
+ self.write_line(b'MAIL From:eggs@example')
+ self.write_line(b'RCPT To:spam@example')
+ self.write_line(b'RCPT To:ham@example')
+ self.write_line(b'DATA')
+ self.write_line(b'data\r\n.')
+ self.assertEqual(self.server.messages,
+ [('peer', 'eggs@example', ['spam@example','ham@example'], 'data')])
+
+ def test_manual_status(self):
+ # checks that the Channel is able to return a custom status message
+ self.write_line(b'MAIL From:eggs@example')
+ self.write_line(b'RCPT To:spam@example')
+ self.write_line(b'DATA')
+ self.write_line(b'return status\r\n.')
+ self.assertEqual(self.channel.socket.last, b'250 Okish\r\n')
+
+ def test_RSET(self):
+ self.write_line(b'MAIL From:eggs@example')
+ self.write_line(b'RCPT To:spam@example')
+ self.write_line(b'RSET')
+ self.assertEqual(self.channel.socket.last, b'250 Ok\r\n')
+ self.write_line(b'MAIL From:foo@example')
+ self.write_line(b'RCPT To:eggs@example')
+ self.write_line(b'DATA')
+ self.write_line(b'data\r\n.')
+ self.assertEqual(self.server.messages,
+ [('peer', 'foo@example', ['eggs@example'], 'data')])
+
+ def test_RSET_syntax(self):
+ self.write_line(b'RSET hi')
+ self.assertEqual(self.channel.socket.last, b'501 Syntax: RSET\r\n')
+
+ def test_attribute_deprecations(self):
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__server
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__server = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__line
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__line = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__state
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__state = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__greeting
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__greeting = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__mailfrom
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__mailfrom = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__rcpttos
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__rcpttos = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__data
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__data = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__fqdn
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__fqdn = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__peer
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__peer = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__conn
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__conn = 'spam'
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ spam = self.channel._SMTPChannel__addr
+ with support.check_warnings(('', PendingDeprecationWarning)):
+ self.channel._SMTPChannel__addr = 'spam'
+
+def test_main():
+ support.run_unittest(SMTPDServerTest, SMTPDChannelTest)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index 727ef834f3..884529f542 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -1,16 +1,22 @@
import asyncore
+import email.mime.text
import email.utils
import socket
-import threading
import smtpd
import smtplib
import io
+import re
import sys
import time
import select
-from unittest import TestCase
-from test import support
+import unittest
+from test import support, mock_socket
+
+try:
+ import threading
+except ImportError:
+ threading = None
HOST = support.HOST
@@ -44,48 +50,55 @@ def server(evt, buf, serv):
serv.close()
evt.set()
-class GeneralTests(TestCase):
+class GeneralTests(unittest.TestCase):
def setUp(self):
- self.evt = threading.Event()
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.sock.settimeout(15)
- self.port = support.bind_port(self.sock)
- servargs = (self.evt, b"220 Hola mundo\n", self.sock)
- threading.Thread(target=server, args=servargs).start()
- self.evt.wait()
- self.evt.clear()
+ smtplib.socket = mock_socket
+ self.port = 25
def tearDown(self):
- self.evt.wait()
+ smtplib.socket = socket
+
+ # This method is no longer used but is retained for backward compatibility,
+ # so test to make sure it still works.
+ def testQuoteData(self):
+ teststr = "abc\n.jkl\rfoo\r\n..blue"
+ expected = "abc\r\n..jkl\r\nfoo\r\n...blue"
+ self.assertEqual(expected, smtplib.quotedata(teststr))
def testBasic1(self):
+ mock_socket.reply_with(b"220 Hola mundo")
# connects
smtp = smtplib.SMTP(HOST, self.port)
smtp.close()
def testBasic2(self):
+ mock_socket.reply_with(b"220 Hola mundo")
# connects, include port in host name
smtp = smtplib.SMTP("%s:%s" % (HOST, self.port))
smtp.close()
def testLocalHostName(self):
+ mock_socket.reply_with(b"220 Hola mundo")
# check that supplied local_hostname is used
smtp = smtplib.SMTP(HOST, self.port, local_hostname="testhost")
self.assertEqual(smtp.local_hostname, "testhost")
smtp.close()
def testTimeoutDefault(self):
- self.assertTrue(socket.getdefaulttimeout() is None)
- socket.setdefaulttimeout(30)
+ mock_socket.reply_with(b"220 Hola mundo")
+ self.assertTrue(mock_socket.getdefaulttimeout() is None)
+ mock_socket.setdefaulttimeout(30)
+ self.assertEqual(mock_socket.getdefaulttimeout(), 30)
try:
smtp = smtplib.SMTP(HOST, self.port)
finally:
- socket.setdefaulttimeout(None)
+ mock_socket.setdefaulttimeout(None)
self.assertEqual(smtp.sock.gettimeout(), 30)
smtp.close()
def testTimeoutNone(self):
+ mock_socket.reply_with(b"220 Hola mundo")
self.assertTrue(socket.getdefaulttimeout() is None)
socket.setdefaulttimeout(30)
try:
@@ -96,6 +109,7 @@ class GeneralTests(TestCase):
smtp.close()
def testTimeoutValue(self):
+ mock_socket.reply_with(b"220 Hola mundo")
smtp = smtplib.SMTP(HOST, self.port, timeout=30)
self.assertEqual(smtp.sock.gettimeout(), 30)
smtp.close()
@@ -142,34 +156,50 @@ MSG_END = '------------ END MESSAGE ------------\n'
# test server times out, causing the test to fail.
# Test behavior of smtpd.DebuggingServer
-class DebuggingServerTests(TestCase):
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class DebuggingServerTests(unittest.TestCase):
+
+ maxDiff = None
def setUp(self):
+ self.real_getfqdn = socket.getfqdn
+ socket.getfqdn = mock_socket.getfqdn
# temporarily replace sys.stdout to capture DebuggingServer output
self.old_stdout = sys.stdout
self.output = io.StringIO()
sys.stdout = self.output
+ self._threads = support.threading_setup()
self.serv_evt = threading.Event()
self.client_evt = threading.Event()
+ # Capture SMTPChannel debug output
+ self.old_DEBUGSTREAM = smtpd.DEBUGSTREAM
+ smtpd.DEBUGSTREAM = io.StringIO()
# Pick a random unused port by passing 0 for the port number
self.serv = smtpd.DebuggingServer((HOST, 0), ('nowhere', -1))
# Keep a note of what port was assigned
self.port = self.serv.socket.getsockname()[1]
serv_args = (self.serv, self.serv_evt, self.client_evt)
- threading.Thread(target=debugging_server, args=serv_args).start()
+ self.thread = threading.Thread(target=debugging_server, args=serv_args)
+ self.thread.start()
# wait until server thread has assigned a port number
self.serv_evt.wait()
self.serv_evt.clear()
def tearDown(self):
+ socket.getfqdn = self.real_getfqdn
# indicate that the client is finished
self.client_evt.set()
# wait for the server thread to terminate
self.serv_evt.wait()
+ self.thread.join()
+ support.threading_cleanup(*self._threads)
# restore sys.stdout
sys.stdout = self.old_stdout
+ # restore DEBUGSTREAM
+ smtpd.DEBUGSTREAM.close()
+ smtpd.DEBUGSTREAM = self.old_DEBUGSTREAM
def testBasic(self):
# connect
@@ -234,8 +264,100 @@ class DebuggingServerTests(TestCase):
mexpect = '%s%s\n%s' % (MSG_BEGIN, m, MSG_END)
self.assertEqual(self.output.getvalue(), mexpect)
+ def testSendBinary(self):
+ m = b'A test message'
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
+ smtp.sendmail('John', 'Sally', m)
+ # XXX (see comment in testSend)
+ time.sleep(0.01)
+ smtp.quit()
+
+ self.client_evt.set()
+ self.serv_evt.wait()
+ self.output.flush()
+ mexpect = '%s%s\n%s' % (MSG_BEGIN, m.decode('ascii'), MSG_END)
+ self.assertEqual(self.output.getvalue(), mexpect)
+
+ def testSendMessage(self):
+ m = email.mime.text.MIMEText('A test message')
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
+ smtp.send_message(m, from_addr='John', to_addrs='Sally')
+ # XXX (see comment in testSend)
+ time.sleep(0.01)
+ smtp.quit()
+
+ self.client_evt.set()
+ self.serv_evt.wait()
+ self.output.flush()
+ # Add the X-Peer header that DebuggingServer adds
+ m['X-Peer'] = socket.gethostbyname('localhost')
+ mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
+ self.assertEqual(self.output.getvalue(), mexpect)
+
+ def testSendMessageWithAddresses(self):
+ m = email.mime.text.MIMEText('A test message')
+ m['From'] = 'foo@bar.com'
+ m['To'] = 'John'
+ m['CC'] = 'Sally, Fred'
+ m['Bcc'] = 'John Root <root@localhost>, "Dinsdale" <warped@silly.walks.com>'
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
+ smtp.send_message(m)
+ # XXX (see comment in testSend)
+ time.sleep(0.01)
+ smtp.quit()
+
+ self.client_evt.set()
+ self.serv_evt.wait()
+ self.output.flush()
+ # Add the X-Peer header that DebuggingServer adds
+ m['X-Peer'] = socket.gethostbyname('localhost')
+ # The Bcc header is deleted before serialization.
+ del m['Bcc']
+ mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
+ self.assertEqual(self.output.getvalue(), mexpect)
+ debugout = smtpd.DEBUGSTREAM.getvalue()
+ sender = re.compile("^sender: foo@bar.com$", re.MULTILINE)
+ self.assertRegex(debugout, sender)
+ for addr in ('John', 'Sally', 'Fred', 'root@localhost',
+ 'warped@silly.walks.com'):
+ to_addr = re.compile(r"^recips: .*'{}'.*$".format(addr),
+ re.MULTILINE)
+ self.assertRegex(debugout, to_addr)
+
+ def testSendMessageWithSomeAddresses(self):
+ # Make sure nothing breaks if not all of the three 'to' headers exist
+ m = email.mime.text.MIMEText('A test message')
+ m['From'] = 'foo@bar.com'
+ m['To'] = 'John, Dinsdale'
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
+ smtp.send_message(m)
+ # XXX (see comment in testSend)
+ time.sleep(0.01)
+ smtp.quit()
+
+ self.client_evt.set()
+ self.serv_evt.wait()
+ self.output.flush()
+ # Add the X-Peer header that DebuggingServer adds
+ m['X-Peer'] = socket.gethostbyname('localhost')
+ mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
+ self.assertEqual(self.output.getvalue(), mexpect)
+ debugout = smtpd.DEBUGSTREAM.getvalue()
+ sender = re.compile("^sender: foo@bar.com$", re.MULTILINE)
+ self.assertRegex(debugout, sender)
+ for addr in ('John', 'Dinsdale'):
+ to_addr = re.compile(r"^recips: .*'{}'.*$".format(addr),
+ re.MULTILINE)
+ self.assertRegex(debugout, to_addr)
+
+
+class NonConnectingTests(unittest.TestCase):
-class NonConnectingTests(TestCase):
+ def setUp(self):
+ smtplib.socket = mock_socket
+
+ def tearDown(self):
+ smtplib.socket = socket
def testNotConnected(self):
# Test various operations on an unconnected SMTP object that
@@ -249,31 +371,26 @@ class NonConnectingTests(TestCase):
def testNonnumericPort(self):
# check that non-numeric port raises socket.error
- self.assertRaises(socket.error, smtplib.SMTP,
+ self.assertRaises(mock_socket.error, smtplib.SMTP,
"localhost", "bogus")
- self.assertRaises(socket.error, smtplib.SMTP,
+ self.assertRaises(mock_socket.error, smtplib.SMTP,
"localhost:bogus")
# test response of client to a non-successful HELO message
-class BadHELOServerTests(TestCase):
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class BadHELOServerTests(unittest.TestCase):
def setUp(self):
+ smtplib.socket = mock_socket
+ mock_socket.reply_with(b"199 no hello for you!")
self.old_stdout = sys.stdout
self.output = io.StringIO()
sys.stdout = self.output
-
- self.evt = threading.Event()
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.sock.settimeout(15)
- self.port = support.bind_port(self.sock)
- servargs = (self.evt, b"199 no hello for you!\n", self.sock)
- threading.Thread(target=server, args=servargs).start()
- self.evt.wait()
- self.evt.clear()
+ self.port = 25
def tearDown(self):
- self.evt.wait()
+ smtplib.socket = socket
sys.stdout = self.old_stdout
def testFailingHELO(self):
@@ -355,6 +472,9 @@ class SimSMTPChannel(smtpd.SMTPChannel):
else:
self.push('550 No access for you!')
+ def handle_error(self):
+ raise
+
class SimSMTPServer(smtpd.SMTPServer):
@@ -362,8 +482,7 @@ class SimSMTPServer(smtpd.SMTPServer):
self._extra_features = []
smtpd.SMTPServer.__init__(self, *args, **kw)
- def handle_accept(self):
- conn, addr = self.accept()
+ def handle_accepted(self, conn, addr):
self._SMTPchannel = SimSMTPChannel(self._extra_features,
self, conn, addr)
@@ -373,12 +492,19 @@ class SimSMTPServer(smtpd.SMTPServer):
def add_feature(self, feature):
self._extra_features.append(feature)
+ def handle_error(self):
+ raise
+
# Test various SMTP & ESMTP commands/behaviors that require a simulated server
# (i.e., something with more features than DebuggingServer)
-class SMTPSimTests(TestCase):
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class SMTPSimTests(unittest.TestCase):
def setUp(self):
+ self.real_getfqdn = socket.getfqdn
+ socket.getfqdn = mock_socket.getfqdn
+ self._threads = support.threading_setup()
self.serv_evt = threading.Event()
self.client_evt = threading.Event()
# Pick a random unused port by passing 0 for the port number
@@ -386,17 +512,21 @@ class SMTPSimTests(TestCase):
# Keep a note of what port was assigned
self.port = self.serv.socket.getsockname()[1]
serv_args = (self.serv, self.serv_evt, self.client_evt)
- threading.Thread(target=debugging_server, args=serv_args).start()
+ self.thread = threading.Thread(target=debugging_server, args=serv_args)
+ self.thread.start()
# wait until server thread has assigned a port number
self.serv_evt.wait()
self.serv_evt.clear()
def tearDown(self):
+ socket.getfqdn = self.real_getfqdn
# indicate that the client is finished
self.client_evt.set()
# wait for the server thread to terminate
self.serv_evt.wait()
+ self.thread.join()
+ support.threading_cleanup(*self._threads)
def testBasic(self):
# smoke test
@@ -460,6 +590,7 @@ class SMTPSimTests(TestCase):
expected_auth_ok = (235, b'plain auth ok')
self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok)
+ smtp.close()
# SimSMTPChannel doesn't fully support LOGIN or CRAM-MD5 auth because they
# require a synchronous read to obtain the credentials...so instead smtpd
@@ -474,8 +605,8 @@ class SMTPSimTests(TestCase):
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
try: smtp.login(sim_auth[0], sim_auth[1])
except smtplib.SMTPAuthenticationError as err:
- if sim_auth_login_password not in str(err):
- raise "expected encoded password not found in error message"
+ self.assertIn(sim_auth_login_password, str(err))
+ smtp.close()
def testAUTH_CRAM_MD5(self):
self.serv.add_feature("AUTH CRAM-MD5")
@@ -483,8 +614,8 @@ class SMTPSimTests(TestCase):
try: smtp.login(sim_auth[0], sim_auth[1])
except smtplib.SMTPAuthenticationError as err:
- if sim_auth_credentials['cram-md5'] not in str(err):
- raise "expected encoded credentials not found in error message"
+ self.assertIn(sim_auth_credentials['cram-md5'], str(err))
+ smtp.close()
#TODO: add tests for correct AUTH method fallback now that the
#test infrastructure can support it.
diff --git a/Lib/test/test_smtpnet.py b/Lib/test/test_smtpnet.py
index 6634df783b..f0f1edd127 100644
--- a/Lib/test/test_smtpnet.py
+++ b/Lib/test/test_smtpnet.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import unittest
from test import support
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 67c541388b..e745502fce 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1,23 +1,27 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import unittest
from test import support
import errno
+import io
import socket
import select
-import _thread as thread
-import threading
import time
import traceback
import queue
import sys
import os
import array
+import platform
import contextlib
from weakref import proxy
import signal
import math
+try:
+ import fcntl
+except ImportError:
+ fcntl = False
def try_address(host, port=0, family=socket.AF_INET):
"""Try to bind a socket on the given host:port and return True
@@ -31,10 +35,25 @@ def try_address(host, port=0, family=socket.AF_INET):
sock.close()
return True
+def linux_version():
+ try:
+ # platform.release() is something like '2.6.33.7-desktop-2mnb'
+ version_string = platform.release().split('-')[0]
+ return tuple(map(int, version_string.split('.')))
+ except ValueError:
+ return 0, 0, 0
+
HOST = support.HOST
MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf8') ## test unicode string and carriage return
SUPPORTS_IPV6 = socket.has_ipv6 and try_address('::1', family=socket.AF_INET6)
+try:
+ import _thread as thread
+ import threading
+except ImportError:
+ thread = None
+ threading = None
+
class SocketTCPTest(unittest.TestCase):
def setUp(self):
@@ -132,8 +151,8 @@ class ThreadableTest:
self.done.wait()
if self.queue.qsize():
- msg = self.queue.get()
- self.fail(msg)
+ exc = self.queue.get()
+ raise exc
def clientRun(self, test_func):
self.server_ready.wait()
@@ -143,9 +162,10 @@ class ThreadableTest:
raise TypeError("test_func must be a callable function")
try:
test_func()
- except Exception as strerror:
- self.queue.put(strerror)
- self.clientTearDown()
+ except BaseException as e:
+ self.queue.put(e)
+ finally:
+ self.clientTearDown()
def clientSetUp(self):
raise NotImplementedError("clientSetUp must be implemented.")
@@ -244,6 +264,7 @@ class GeneralModuleTests(unittest.TestCase):
def test_repr(self):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(s.close)
self.assertTrue(repr(s).startswith("<socket.socket object"))
def test_weakref(self):
@@ -517,6 +538,7 @@ class GeneralModuleTests(unittest.TestCase):
# Testing getsockname()
port = self._get_unused_port()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(sock.close)
sock.bind(("0.0.0.0", port))
name = sock.getsockname()
# XXX(nnorwitz): http://tinyurl.com/os5jz seems to indicate
@@ -527,19 +549,21 @@ class GeneralModuleTests(unittest.TestCase):
except socket.error:
# Probably name lookup wasn't set up right; skip this test
return
- self.assertTrue(name[0] in ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
+ self.assertIn(name[0], ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
self.assertEqual(name[1], port)
def testGetSockOpt(self):
# Testing getsockopt()
# We know a socket should start without reuse==0
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(sock.close)
reuse = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)
self.assertFalse(reuse != 0, "initial mode is reuse")
def testSetSockOpt(self):
# Testing setsockopt()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(sock.close)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
reuse = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)
self.assertFalse(reuse == 0, "failed to set reuse mode")
@@ -572,13 +596,17 @@ class GeneralModuleTests(unittest.TestCase):
finally:
sock.close()
+ @unittest.skipUnless(os.name == "nt", "Windows specific")
def test_sock_ioctl(self):
- if os.name != "nt":
- return
self.assertTrue(hasattr(socket.socket, 'ioctl'))
self.assertTrue(hasattr(socket, 'SIO_RCVALL'))
self.assertTrue(hasattr(socket, 'RCVALL_ON'))
self.assertTrue(hasattr(socket, 'RCVALL_OFF'))
+ self.assertTrue(hasattr(socket, 'SIO_KEEPALIVE_VALS'))
+ s = socket.socket()
+ self.addCleanup(s.close)
+ self.assertRaises(ValueError, s.ioctl, -1, None)
+ s.ioctl(socket.SIO_KEEPALIVE_VALS, (1, 100, 100))
def testGetaddrinfo(self):
try:
@@ -617,7 +645,46 @@ class GeneralModuleTests(unittest.TestCase):
# usually do this
socket.getaddrinfo(None, 0, socket.AF_UNSPEC, socket.SOCK_STREAM, 0,
socket.AI_PASSIVE)
-
+ # test keyword arguments
+ a = socket.getaddrinfo(HOST, None)
+ b = socket.getaddrinfo(host=HOST, port=None)
+ self.assertEqual(a, b)
+ a = socket.getaddrinfo(HOST, None, socket.AF_INET)
+ b = socket.getaddrinfo(HOST, None, family=socket.AF_INET)
+ self.assertEqual(a, b)
+ a = socket.getaddrinfo(HOST, None, 0, socket.SOCK_STREAM)
+ b = socket.getaddrinfo(HOST, None, type=socket.SOCK_STREAM)
+ self.assertEqual(a, b)
+ a = socket.getaddrinfo(HOST, None, 0, 0, socket.SOL_TCP)
+ b = socket.getaddrinfo(HOST, None, proto=socket.SOL_TCP)
+ self.assertEqual(a, b)
+ a = socket.getaddrinfo(HOST, None, 0, 0, 0, socket.AI_PASSIVE)
+ b = socket.getaddrinfo(HOST, None, flags=socket.AI_PASSIVE)
+ self.assertEqual(a, b)
+ a = socket.getaddrinfo(None, 0, socket.AF_UNSPEC, socket.SOCK_STREAM, 0,
+ socket.AI_PASSIVE)
+ b = socket.getaddrinfo(host=None, port=0, family=socket.AF_UNSPEC,
+ type=socket.SOCK_STREAM, proto=0,
+ flags=socket.AI_PASSIVE)
+ self.assertEqual(a, b)
+ # Issue #6697.
+ self.assertRaises(UnicodeEncodeError, socket.getaddrinfo, 'localhost', '\uD800')
+
+ def test_getnameinfo(self):
+ # only IP addresses are allowed
+ self.assertRaises(socket.error, socket.getnameinfo, ('mail.python.org',0), 0)
+
+ @unittest.skipUnless(support.is_resource_enabled('network'),
+ 'network is not enabled')
+ def test_idna(self):
+ support.requires('network')
+ # these should all be successful
+ socket.gethostbyname('иÑпытание.python.org')
+ socket.gethostbyname_ex('иÑпытание.python.org')
+ socket.getaddrinfo('иÑпытание.python.org',0,socket.AF_UNSPEC,socket.SOCK_STREAM)
+ # this may not work if the forward lookup choses the IPv6 address, as that doesn't
+ # have a reverse entry yet
+ # socket.gethostbyaddr('иÑпытание.python.org')
def check_sendall_interrupted(self, with_timeout):
# socketpair() is not stricly required, but it makes things easier.
@@ -654,7 +721,31 @@ class GeneralModuleTests(unittest.TestCase):
def test_sendall_interrupted_with_timeout(self):
self.check_sendall_interrupted(True)
-
+ def test_dealloc_warn(self):
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ r = repr(sock)
+ with self.assertWarns(ResourceWarning) as cm:
+ sock = None
+ support.gc_collect()
+ self.assertIn(r, str(cm.warning.args[0]))
+ # An open socket file object gets dereferenced after the socket
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ f = sock.makefile('rb')
+ r = repr(sock)
+ sock = None
+ support.gc_collect()
+ with self.assertWarns(ResourceWarning):
+ f = None
+ support.gc_collect()
+
+ def test_name_closed_socketio(self):
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
+ fp = sock.makefile("rb")
+ fp.close()
+ self.assertEqual(repr(fp), "<_io.BufferedReader name=-1>")
+
+
+@unittest.skipUnless(thread, 'Threading required for this test.')
class BasicTCPTest(SocketConnectedTest):
def __init__(self, methodName='runTest'):
@@ -712,10 +803,10 @@ class BasicTCPTest(SocketConnectedTest):
def testFromFd(self):
# Testing fromfd()
- if not hasattr(socket, "fromfd"):
- return # On Windows, this doesn't exist
fd = self.cli_conn.fileno()
sock = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(sock.close)
+ self.assertIsInstance(sock, socket.socket)
msg = sock.recv(1024)
self.assertEqual(msg, MSG)
@@ -725,6 +816,7 @@ class BasicTCPTest(SocketConnectedTest):
def testDup(self):
# Testing dup()
sock = self.cli_conn.dup()
+ self.addCleanup(sock.close)
msg = sock.recv(1024)
self.assertEqual(msg, MSG)
@@ -744,6 +836,25 @@ class BasicTCPTest(SocketConnectedTest):
self.serv_conn.send(MSG)
self.serv_conn.shutdown(2)
+ def testDetach(self):
+ # Testing detach()
+ fileno = self.cli_conn.fileno()
+ f = self.cli_conn.detach()
+ self.assertEqual(f, fileno)
+ # cli_conn cannot be used anymore...
+ self.assertRaises(socket.error, self.cli_conn.recv, 1024)
+ self.cli_conn.close()
+ # ...but we can create another socket using the (still open)
+ # file descriptor
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, fileno=f)
+ self.addCleanup(sock.close)
+ msg = sock.recv(1024)
+ self.assertEqual(msg, MSG)
+
+ def _testDetach(self):
+ self.serv_conn.send(MSG)
+
+@unittest.skipUnless(thread, 'Threading required for this test.')
class BasicUDPTest(ThreadedUDPSocketTest):
def __init__(self, methodName='runTest'):
@@ -772,6 +883,7 @@ class BasicUDPTest(ThreadedUDPSocketTest):
def _testRecvFromNegative(self):
self.cli.sendto(MSG, 0, (HOST, self.port))
+@unittest.skipUnless(thread, 'Threading required for this test.')
class TCPCloserTest(ThreadedTCPSocketTest):
def testClose(self):
@@ -791,11 +903,27 @@ class TCPCloserTest(ThreadedTCPSocketTest):
self.cli.connect((HOST, self.port))
time.sleep(1.0)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class BasicSocketPairTest(SocketPairTest):
def __init__(self, methodName='runTest'):
SocketPairTest.__init__(self, methodName=methodName)
+ def _check_defaults(self, sock):
+ self.assertIsInstance(sock, socket.socket)
+ if hasattr(socket, 'AF_UNIX'):
+ self.assertEqual(sock.family, socket.AF_UNIX)
+ else:
+ self.assertEqual(sock.family, socket.AF_INET)
+ self.assertEqual(sock.type, socket.SOCK_STREAM)
+ self.assertEqual(sock.proto, 0)
+
+ def _testDefaults(self):
+ self._check_defaults(self.cli)
+
+ def testDefaults(self):
+ self._check_defaults(self.serv)
+
def testRecv(self):
msg = self.serv.recv(1024)
self.assertEqual(msg, MSG)
@@ -810,6 +938,7 @@ class BasicSocketPairTest(SocketPairTest):
msg = self.cli.recv(1024)
self.assertEqual(msg, MSG)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class NonBlockingTCPTests(ThreadedTCPSocketTest):
def __init__(self, methodName='runTest'):
@@ -829,6 +958,47 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
def _testSetBlocking(self):
pass
+ if hasattr(socket, "SOCK_NONBLOCK"):
+ def testInitNonBlocking(self):
+ v = linux_version()
+ if v < (2, 6, 28):
+ self.skipTest("Linux kernel 2.6.28 or higher required, not %s"
+ % ".".join(map(str, v)))
+ # reinit server socket
+ self.serv.close()
+ self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM |
+ socket.SOCK_NONBLOCK)
+ self.port = support.bind_port(self.serv)
+ self.serv.listen(1)
+ # actual testing
+ start = time.time()
+ try:
+ self.serv.accept()
+ except socket.error:
+ pass
+ end = time.time()
+ self.assertTrue((end - start) < 1.0, "Error creating with non-blocking mode.")
+
+ def _testInitNonBlocking(self):
+ pass
+
+ def testInheritFlags(self):
+ # Issue #7995: when calling accept() on a listening socket with a
+ # timeout, the resulting socket should not be non-blocking.
+ self.serv.settimeout(10)
+ try:
+ conn, addr = self.serv.accept()
+ message = conn.recv(len(MSG))
+ finally:
+ conn.close()
+ self.serv.settimeout(None)
+
+ def _testInheritFlags(self):
+ time.sleep(0.1)
+ self.cli.connect((HOST, self.port))
+ time.sleep(0.5)
+ self.cli.send(MSG)
+
def testAccept(self):
# Testing non-blocking accept
self.serv.setblocking(0)
@@ -841,6 +1011,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
read, write, err = select.select([self.serv], [], [])
if self.serv in read:
conn, addr = self.serv.accept()
+ conn.close()
else:
self.fail("Error trying to do accept after select.")
@@ -851,6 +1022,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
def testConnect(self):
# Testing non-blocking connect
conn, addr = self.serv.accept()
+ conn.close()
def _testConnect(self):
self.cli.settimeout(10)
@@ -869,6 +1041,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
read, write, err = select.select([conn], [], [])
if conn in read:
msg = conn.recv(len(MSG))
+ conn.close()
self.assertEqual(msg, MSG)
else:
self.fail("Error during select call to non-blocking socket.")
@@ -878,6 +1051,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
time.sleep(0.1)
self.cli.send(MSG)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class FileObjectClassTestCase(SocketConnectedTest):
"""Unit tests for the object returned by socket.makefile()
@@ -904,6 +1078,8 @@ class FileObjectClassTestCase(SocketConnectedTest):
SocketConnectedTest.__init__(self, methodName=methodName)
def setUp(self):
+ self.evt1, self.evt2, self.serv_finished, self.cli_finished = [
+ threading.Event() for i in range(4)]
SocketConnectedTest.setUp(self)
self.read_file = self.cli_conn.makefile(
self.read_mode, self.bufsize,
@@ -912,6 +1088,7 @@ class FileObjectClassTestCase(SocketConnectedTest):
newline = self.newline)
def tearDown(self):
+ self.serv_finished.set()
self.read_file.close()
self.assertTrue(self.read_file.closed)
self.read_file = None
@@ -926,11 +1103,29 @@ class FileObjectClassTestCase(SocketConnectedTest):
newline = self.newline)
def clientTearDown(self):
+ self.cli_finished.set()
self.write_file.close()
self.assertTrue(self.write_file.closed)
self.write_file = None
SocketConnectedTest.clientTearDown(self)
+ def testReadAfterTimeout(self):
+ # Issue #7322: A file object must disallow further reads
+ # after a timeout has occurred.
+ self.cli_conn.settimeout(1)
+ self.read_file.read(3)
+ # First read raises a timeout
+ self.assertRaises(socket.timeout, self.read_file.read, 1)
+ # Second read is disallowed
+ with self.assertRaises(IOError) as ctx:
+ self.read_file.read(1)
+ self.assertIn("cannot read from timed out object", str(ctx.exception))
+
+ def _testReadAfterTimeout(self):
+ self.write_file.write(self.write_msg[0:3])
+ self.write_file.flush()
+ self.serv_finished.wait()
+
def testSmallRead(self):
# Performing small file read test
first_seg = self.read_file.read(len(self.read_msg)-3)
@@ -1020,6 +1215,117 @@ class FileObjectClassTestCase(SocketConnectedTest):
pass
+class FileObjectInterruptedTestCase(unittest.TestCase):
+ """Test that the file object correctly handles EINTR internally."""
+
+ class MockSocket(object):
+ def __init__(self, recv_funcs=()):
+ # A generator that returns callables that we'll call for each
+ # call to recv().
+ self._recv_step = iter(recv_funcs)
+
+ def recv_into(self, buffer):
+ data = next(self._recv_step)()
+ assert len(buffer) >= len(data)
+ buffer[:len(data)] = data
+ return len(data)
+
+ def _decref_socketios(self):
+ pass
+
+ def _textiowrap_for_test(self, buffering=-1):
+ raw = socket.SocketIO(self, "r")
+ if buffering < 0:
+ buffering = io.DEFAULT_BUFFER_SIZE
+ if buffering == 0:
+ return raw
+ buffer = io.BufferedReader(raw, buffering)
+ text = io.TextIOWrapper(buffer, None, None)
+ text.mode = "rb"
+ return text
+
+ @staticmethod
+ def _raise_eintr():
+ raise socket.error(errno.EINTR)
+
+ def _textiowrap_mock_socket(self, mock, buffering=-1):
+ raw = socket.SocketIO(mock, "r")
+ if buffering < 0:
+ buffering = io.DEFAULT_BUFFER_SIZE
+ if buffering == 0:
+ return raw
+ buffer = io.BufferedReader(raw, buffering)
+ text = io.TextIOWrapper(buffer, None, None)
+ text.mode = "rb"
+ return text
+
+ def _test_readline(self, size=-1, buffering=-1):
+ mock_sock = self.MockSocket(recv_funcs=[
+ lambda : b"This is the first line\nAnd the sec",
+ self._raise_eintr,
+ lambda : b"ond line is here\n",
+ lambda : b"",
+ lambda : b"", # XXX(gps): io library does an extra EOF read
+ ])
+ fo = mock_sock._textiowrap_for_test(buffering=buffering)
+ self.assertEqual(fo.readline(size), "This is the first line\n")
+ self.assertEqual(fo.readline(size), "And the second line is here\n")
+
+ def _test_read(self, size=-1, buffering=-1):
+ mock_sock = self.MockSocket(recv_funcs=[
+ lambda : b"This is the first line\nAnd the sec",
+ self._raise_eintr,
+ lambda : b"ond line is here\n",
+ lambda : b"",
+ lambda : b"", # XXX(gps): io library does an extra EOF read
+ ])
+ expecting = (b"This is the first line\n"
+ b"And the second line is here\n")
+ fo = mock_sock._textiowrap_for_test(buffering=buffering)
+ if buffering == 0:
+ data = b''
+ else:
+ data = ''
+ expecting = expecting.decode('utf8')
+ while len(data) != len(expecting):
+ part = fo.read(size)
+ if not part:
+ break
+ data += part
+ self.assertEqual(data, expecting)
+
+ def test_default(self):
+ self._test_readline()
+ self._test_readline(size=100)
+ self._test_read()
+ self._test_read(size=100)
+
+ def test_with_1k_buffer(self):
+ self._test_readline(buffering=1024)
+ self._test_readline(size=100, buffering=1024)
+ self._test_read(buffering=1024)
+ self._test_read(size=100, buffering=1024)
+
+ def _test_readline_no_buffer(self, size=-1):
+ mock_sock = self.MockSocket(recv_funcs=[
+ lambda : b"a",
+ lambda : b"\n",
+ lambda : b"B",
+ self._raise_eintr,
+ lambda : b"b",
+ lambda : b"",
+ ])
+ fo = mock_sock._textiowrap_for_test(buffering=0)
+ self.assertEqual(fo.readline(size), b"a\n")
+ self.assertEqual(fo.readline(size), b"Bb")
+
+ def test_no_buffer(self):
+ self._test_readline_no_buffer()
+ self._test_readline_no_buffer(size=4)
+ self._test_read(buffering=0)
+ self._test_read(size=100, buffering=0)
+
+
class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase):
"""Repeat the tests from FileObjectClassTestCase with bufsize==0.
@@ -1067,6 +1373,66 @@ class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase):
def _testMakefileCloseSocketDestroy(self):
pass
+ # Non-blocking ops
+ # NOTE: to set `read_file` as non-blocking, we must call
+ # `cli_conn.setblocking` and vice-versa (see setUp / clientSetUp).
+
+ def testSmallReadNonBlocking(self):
+ self.cli_conn.setblocking(False)
+ self.assertEqual(self.read_file.readinto(bytearray(10)), None)
+ self.assertEqual(self.read_file.read(len(self.read_msg) - 3), None)
+ self.evt1.set()
+ self.evt2.wait(1.0)
+ first_seg = self.read_file.read(len(self.read_msg) - 3)
+ if first_seg is None:
+ # Data not arrived (can happen under Windows), wait a bit
+ time.sleep(0.5)
+ first_seg = self.read_file.read(len(self.read_msg) - 3)
+ buf = bytearray(10)
+ n = self.read_file.readinto(buf)
+ self.assertEqual(n, 3)
+ msg = first_seg + buf[:n]
+ self.assertEqual(msg, self.read_msg)
+ self.assertEqual(self.read_file.readinto(bytearray(16)), None)
+ self.assertEqual(self.read_file.read(1), None)
+
+ def _testSmallReadNonBlocking(self):
+ self.evt1.wait(1.0)
+ self.write_file.write(self.write_msg)
+ self.write_file.flush()
+ self.evt2.set()
+ # Avoid cloding the socket before the server test has finished,
+ # otherwise system recv() will return 0 instead of EWOULDBLOCK.
+ self.serv_finished.wait(5.0)
+
+ def testWriteNonBlocking(self):
+ self.cli_finished.wait(5.0)
+ # The client thread can't skip directly - the SkipTest exception
+ # would appear as a failure.
+ if self.serv_skipped:
+ self.skipTest(self.serv_skipped)
+
+ def _testWriteNonBlocking(self):
+ self.serv_skipped = None
+ self.serv_conn.setblocking(False)
+ # Try to saturate the socket buffer pipe with repeated large writes.
+ BIG = b"x" * (1024 ** 2)
+ LIMIT = 10
+ # The first write() succeeds since a chunk of data can be buffered
+ n = self.write_file.write(BIG)
+ self.assertGreater(n, 0)
+ for i in range(LIMIT):
+ n = self.write_file.write(BIG)
+ if n is None:
+ # Succeeded
+ break
+ self.assertGreater(n, 0)
+ else:
+ # Let us know that this test didn't manage to establish
+ # the expected conditions. This is not a failure in itself but,
+ # if it happens repeatedly, the test should be fixed.
+ self.serv_skipped = "failed to saturate the socket buffer"
+
class LineBufferedFileObjectClassTestCase(FileObjectClassTestCase):
@@ -1140,23 +1506,18 @@ class NetworkConnectionNoServer(unittest.TestCase):
def test_connect(self):
port = support.find_unused_port()
cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- try:
+ self.addCleanup(cli.close)
+ with self.assertRaises(socket.error) as cm:
cli.connect((HOST, port))
- except socket.error as err:
- self.assertEqual(err.errno, errno.ECONNREFUSED)
- else:
- self.fail("socket.error not raised")
+ self.assertEqual(cm.exception.errno, errno.ECONNREFUSED)
def test_create_connection(self):
# Issue #9792: errors raised by create_connection() should have
# a proper errno attribute.
port = support.find_unused_port()
- try:
+ with self.assertRaises(socket.error) as cm:
socket.create_connection((HOST, port))
- except socket.error as err:
- self.assertEqual(err.errno, errno.ECONNREFUSED)
- else:
- self.fail("socket.error not raised")
+ self.assertEqual(cm.exception.errno, errno.ECONNREFUSED)
def test_create_connection_timeout(self):
# Issue #9792: create_connection() should not recast timeout errors
@@ -1166,6 +1527,7 @@ class NetworkConnectionNoServer(unittest.TestCase):
socket.create_connection((HOST, 1234))
+@unittest.skipUnless(thread, 'Threading required for this test.')
class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
def __init__(self, methodName='runTest'):
@@ -1173,7 +1535,7 @@ class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
ThreadableTest.__init__(self)
def clientSetUp(self):
- pass
+ self.source_port = support.find_unused_port()
def clientTearDown(self):
self.cli.close()
@@ -1182,12 +1544,23 @@ class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
def _justAccept(self):
conn, addr = self.serv.accept()
+ conn.close()
testFamily = _justAccept
def _testFamily(self):
self.cli = socket.create_connection((HOST, self.port), timeout=30)
+ self.addCleanup(self.cli.close)
self.assertEqual(self.cli.family, 2)
+ testSourceAddress = _justAccept
+ def _testSourceAddress(self):
+ self.cli = socket.create_connection((HOST, self.port), timeout=30,
+ source_address=('', self.source_port))
+ self.addCleanup(self.cli.close)
+ self.assertEqual(self.cli.getsockname()[1], self.source_port)
+ # The port number being used is sufficient to show that the bind()
+ # call happened.
+
testTimeoutDefault = _justAccept
def _testTimeoutDefault(self):
# passing no explicit timeout uses socket's global default
@@ -1195,6 +1568,7 @@ class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
socket.setdefaulttimeout(42)
try:
self.cli = socket.create_connection((HOST, self.port))
+ self.addCleanup(self.cli.close)
finally:
socket.setdefaulttimeout(None)
self.assertEqual(self.cli.gettimeout(), 42)
@@ -1206,6 +1580,7 @@ class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
socket.setdefaulttimeout(30)
try:
self.cli = socket.create_connection((HOST, self.port), timeout=None)
+ self.addCleanup(self.cli.close)
finally:
socket.setdefaulttimeout(None)
self.assertEqual(self.cli.gettimeout(), None)
@@ -1218,8 +1593,10 @@ class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
testTimeoutValueNonamed = _justAccept
def _testTimeoutValueNonamed(self):
self.cli = socket.create_connection((HOST, self.port), 30)
+ self.addCleanup(self.cli.close)
self.assertEqual(self.cli.gettimeout(), 30)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class NetworkConnectionBehaviourTest(SocketTCPTest, ThreadableTest):
def __init__(self, methodName='runTest'):
@@ -1236,6 +1613,7 @@ class NetworkConnectionBehaviourTest(SocketTCPTest, ThreadableTest):
def testInsideTimeout(self):
conn, addr = self.serv.accept()
+ self.addCleanup(conn.close)
time.sleep(3)
conn.send(b"done!")
testOutsideTimeout = testInsideTimeout
@@ -1344,27 +1722,28 @@ class TestLinuxAbstractNamespace(unittest.TestCase):
def testLinuxAbstractNamespace(self):
address = b"\x00python-test-hello\x00\xff"
- s1 = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- s1.bind(address)
- s1.listen(1)
- s2 = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- s2.connect(s1.getsockname())
- s1.accept()
- self.assertEqual(s1.getsockname(), address)
- self.assertEqual(s2.getpeername(), address)
+ with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s1:
+ s1.bind(address)
+ s1.listen(1)
+ with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s2:
+ s2.connect(s1.getsockname())
+ with s1.accept()[0] as s3:
+ self.assertEqual(s1.getsockname(), address)
+ self.assertEqual(s2.getpeername(), address)
def testMaxName(self):
address = b"\x00" + b"h" * (self.UNIX_PATH_MAX - 1)
- s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- s.bind(address)
- self.assertEqual(s.getsockname(), address)
+ with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
+ s.bind(address)
+ self.assertEqual(s.getsockname(), address)
def testNameOverflow(self):
address = "\x00" + "h" * self.UNIX_PATH_MAX
- s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- self.assertRaises(socket.error, s.bind, address)
+ with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
+ self.assertRaises(socket.error, s.bind, address)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class BufferIOTest(SocketConnectedTest):
"""
Test the buffer versions of socket.recv() and socket.send().
@@ -1372,28 +1751,64 @@ class BufferIOTest(SocketConnectedTest):
def __init__(self, methodName='runTest'):
SocketConnectedTest.__init__(self, methodName=methodName)
- def testRecvInto(self):
+ def testRecvIntoArray(self):
buf = bytearray(1024)
nbytes = self.cli_conn.recv_into(buf)
self.assertEqual(nbytes, len(MSG))
msg = buf[:len(MSG)]
self.assertEqual(msg, MSG)
- def _testRecvInto(self):
+ def _testRecvIntoArray(self):
buf = bytes(MSG)
self.serv_conn.send(buf)
- def testRecvFromInto(self):
+ def testRecvIntoBytearray(self):
+ buf = bytearray(1024)
+ nbytes = self.cli_conn.recv_into(buf)
+ self.assertEqual(nbytes, len(MSG))
+ msg = buf[:len(MSG)]
+ self.assertEqual(msg, MSG)
+
+ _testRecvIntoBytearray = _testRecvIntoArray
+
+ def testRecvIntoMemoryview(self):
+ buf = bytearray(1024)
+ nbytes = self.cli_conn.recv_into(memoryview(buf))
+ self.assertEqual(nbytes, len(MSG))
+ msg = buf[:len(MSG)]
+ self.assertEqual(msg, MSG)
+
+ _testRecvIntoMemoryview = _testRecvIntoArray
+
+ def testRecvFromIntoArray(self):
buf = bytearray(1024)
nbytes, addr = self.cli_conn.recvfrom_into(buf)
self.assertEqual(nbytes, len(MSG))
msg = buf[:len(MSG)]
self.assertEqual(msg, MSG)
- def _testRecvFromInto(self):
+ def _testRecvFromIntoArray(self):
buf = bytes(MSG)
self.serv_conn.send(buf)
+ def testRecvFromIntoBytearray(self):
+ buf = bytearray(1024)
+ nbytes, addr = self.cli_conn.recvfrom_into(buf)
+ self.assertEqual(nbytes, len(MSG))
+ msg = buf[:len(MSG)]
+ self.assertEqual(msg, MSG)
+
+ _testRecvFromIntoBytearray = _testRecvFromIntoArray
+
+ def testRecvFromIntoMemoryview(self):
+ buf = bytearray(1024)
+ nbytes, addr = self.cli_conn.recvfrom_into(memoryview(buf))
+ self.assertEqual(nbytes, len(MSG))
+ msg = buf[:len(MSG)]
+ self.assertEqual(msg, MSG)
+
+ _testRecvFromIntoMemoryview = _testRecvFromIntoArray
+
TIPC_STYPE = 2000
TIPC_LOWER = 200
@@ -1473,15 +1888,122 @@ class TIPCThreadableTest (unittest.TestCase, ThreadableTest):
self.cli.close()
+@unittest.skipUnless(thread, 'Threading required for this test.')
+class ContextManagersTest(ThreadedTCPSocketTest):
+
+ def _testSocketClass(self):
+ # base test
+ with socket.socket() as sock:
+ self.assertFalse(sock._closed)
+ self.assertTrue(sock._closed)
+ # close inside with block
+ with socket.socket() as sock:
+ sock.close()
+ self.assertTrue(sock._closed)
+ # exception inside with block
+ with socket.socket() as sock:
+ self.assertRaises(socket.error, sock.sendall, b'foo')
+ self.assertTrue(sock._closed)
+
+ def testCreateConnectionBase(self):
+ conn, addr = self.serv.accept()
+ self.addCleanup(conn.close)
+ data = conn.recv(1024)
+ conn.sendall(data)
+
+ def _testCreateConnectionBase(self):
+ address = self.serv.getsockname()
+ with socket.create_connection(address) as sock:
+ self.assertFalse(sock._closed)
+ sock.sendall(b'foo')
+ self.assertEqual(sock.recv(1024), b'foo')
+ self.assertTrue(sock._closed)
+
+ def testCreateConnectionClose(self):
+ conn, addr = self.serv.accept()
+ self.addCleanup(conn.close)
+ data = conn.recv(1024)
+ conn.sendall(data)
+
+ def _testCreateConnectionClose(self):
+ address = self.serv.getsockname()
+ with socket.create_connection(address) as sock:
+ sock.close()
+ self.assertTrue(sock._closed)
+ self.assertRaises(socket.error, sock.sendall, b'foo')
+
+
+@unittest.skipUnless(hasattr(socket, "SOCK_CLOEXEC"),
+ "SOCK_CLOEXEC not defined")
+@unittest.skipUnless(fcntl, "module fcntl not available")
+class CloexecConstantTest(unittest.TestCase):
+ def test_SOCK_CLOEXEC(self):
+ v = linux_version()
+ if v < (2, 6, 28):
+ self.skipTest("Linux kernel 2.6.28 or higher required, not %s"
+ % ".".join(map(str, v)))
+ with socket.socket(socket.AF_INET,
+ socket.SOCK_STREAM | socket.SOCK_CLOEXEC) as s:
+ self.assertTrue(s.type & socket.SOCK_CLOEXEC)
+ self.assertTrue(fcntl.fcntl(s, fcntl.F_GETFD) & fcntl.FD_CLOEXEC)
+
+
+@unittest.skipUnless(hasattr(socket, "SOCK_NONBLOCK"),
+ "SOCK_NONBLOCK not defined")
+class NonblockConstantTest(unittest.TestCase):
+ def checkNonblock(self, s, nonblock=True, timeout=0.0):
+ if nonblock:
+ self.assertTrue(s.type & socket.SOCK_NONBLOCK)
+ self.assertEqual(s.gettimeout(), timeout)
+ else:
+ self.assertFalse(s.type & socket.SOCK_NONBLOCK)
+ self.assertEqual(s.gettimeout(), None)
+
+ def test_SOCK_NONBLOCK(self):
+ v = linux_version()
+ if v < (2, 6, 28):
+ self.skipTest("Linux kernel 2.6.28 or higher required, not %s"
+ % ".".join(map(str, v)))
+ # a lot of it seems silly and redundant, but I wanted to test that
+ # changing back and forth worked ok
+ with socket.socket(socket.AF_INET,
+ socket.SOCK_STREAM | socket.SOCK_NONBLOCK) as s:
+ self.checkNonblock(s)
+ s.setblocking(1)
+ self.checkNonblock(s, False)
+ s.setblocking(0)
+ self.checkNonblock(s)
+ s.settimeout(None)
+ self.checkNonblock(s, False)
+ s.settimeout(2.0)
+ self.checkNonblock(s, timeout=2.0)
+ s.setblocking(1)
+ self.checkNonblock(s, False)
+ # defaulttimeout
+ t = socket.getdefaulttimeout()
+ socket.setdefaulttimeout(0.0)
+ with socket.socket() as s:
+ self.checkNonblock(s)
+ socket.setdefaulttimeout(None)
+ with socket.socket() as s:
+ self.checkNonblock(s, False)
+ socket.setdefaulttimeout(2.0)
+ with socket.socket() as s:
+ self.checkNonblock(s, timeout=2.0)
+ socket.setdefaulttimeout(None)
+ with socket.socket() as s:
+ self.checkNonblock(s, False)
+ socket.setdefaulttimeout(t)
+
+
def test_main():
tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
- TestExceptions, BufferIOTest, BasicTCPTest2]
- if sys.platform != 'mac':
- tests.extend([ BasicUDPTest, UDPTimeoutTest ])
+ TestExceptions, BufferIOTest, BasicTCPTest2, BasicUDPTest, UDPTimeoutTest ]
tests.extend([
NonBlockingTCPTests,
FileObjectClassTestCase,
+ FileObjectInterruptedTestCase,
UnbufferedFileObjectClassTestCase,
LineBufferedFileObjectClassTestCase,
SmallBufferedFileObjectClassTestCase,
@@ -1491,6 +2013,9 @@ def test_main():
NetworkConnectionNoServer,
NetworkConnectionAttributesTest,
NetworkConnectionBehaviourTest,
+ ContextManagersTest,
+ CloexecConstantTest,
+ NonblockConstantTest
])
if hasattr(socket, "socketpair"):
tests.append(BasicSocketPairTest)
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index a098edd8f1..d4c3621b79 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -3,21 +3,21 @@ Test suite for socketserver.
"""
import contextlib
-import errno
import imp
import os
import select
import signal
import socket
import tempfile
-import threading
-import time
import unittest
import socketserver
import test.support
-from test.support import reap_children, verbose
-from test.support import TESTFN as TEST_FILE
+from test.support import reap_children, reap_threads, verbose
+try:
+ import threading
+except ImportError:
+ threading = None
test.support.requires("network")
@@ -123,6 +123,8 @@ class SocketServerTest(unittest.TestCase):
self.assertEqual(server.server_address, server.socket.getsockname())
return server
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ @reap_threads
def run_server(self, svrcls, hdlrbase, testfunc):
server = self.make_server(self.pickaddr(svrcls.address_family),
svrcls, hdlrbase)
@@ -149,6 +151,7 @@ class SocketServerTest(unittest.TestCase):
if verbose: print("waiting for server")
server.shutdown()
t.join()
+ server.server_close()
if verbose: print("done")
def stream_examine(self, proto, addr):
@@ -244,6 +247,7 @@ class SocketServerTest(unittest.TestCase):
# socketserver.DatagramRequestHandler,
# self.dgram_examine)
+ @reap_threads
def test_shutdown(self):
# Issue #2302: shutdown() should always succeed in making an
# other thread leave serve_forever().
@@ -267,6 +271,7 @@ class SocketServerTest(unittest.TestCase):
s.shutdown()
for t, s in threads:
t.join()
+ s.server_close()
def test_main():
diff --git a/Lib/test/test_sort.py b/Lib/test/test_sort.py
index a7afe73d1c..55503b57a8 100644
--- a/Lib/test/test_sort.py
+++ b/Lib/test/test_sort.py
@@ -111,6 +111,12 @@ class TestBase(unittest.TestCase):
s.sort(key=CmpToKey(lambda a, b: int(random.random() * 3) - 1))
check("an insane function left some permutation", x, s)
+ if len(x) >= 2:
+ def bad_key(x):
+ raise RuntimeError
+ s = x[:]
+ self.assertRaises(RuntimeError, s.sort, key=bad_key)
+
x = [Complains(i) for i in x]
s = x[:]
random.shuffle(s)
diff --git a/Lib/test/test_sqlite.py b/Lib/test/test_sqlite.py
index ec6f634592..1086330ab0 100644
--- a/Lib/test/test_sqlite.py
+++ b/Lib/test/test_sqlite.py
@@ -1,17 +1,23 @@
-import unittest
-from test.support import run_unittest, import_module
+import test.support
# Skip test if _sqlite3 module not installed
-import_module('_sqlite3')
+test.support.import_module('_sqlite3')
+import sqlite3
from sqlite3.test import (dbapi, types, userfunctions,
factory, transactions, hooks, regression,
dump)
def test_main():
- run_unittest(dbapi.suite(), types.suite(), userfunctions.suite(),
- factory.suite(), transactions.suite(),
- hooks.suite(), regression.suite(), dump.suite())
+ if test.support.verbose:
+ print("test_sqlite: testing with version",
+ "{!r}, sqlite_version {!r}".format(sqlite3.version,
+ sqlite3.sqlite_version))
+ test.support.run_unittest(dbapi.suite(), types.suite(),
+ userfunctions.suite(),
+ factory.suite(), transactions.suite(),
+ hooks.suite(), regression.suite(),
+ dump.suite())
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index bb38890b65..ba788e4c84 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -5,39 +5,81 @@ import unittest
from test import support
import socket
import select
-import errno
-import subprocess
import time
import gc
import os
import errno
import pprint
-import urllib.parse, urllib.request
-import shutil
+import tempfile
+import urllib.request
import traceback
import asyncore
import weakref
+import platform
+import functools
-from http.server import HTTPServer, SimpleHTTPRequestHandler
+ssl = support.import_module("ssl")
-# Optionally test SSL support, if we have it in the tested platform
-skip_expected = False
-try:
- import ssl
-except ImportError:
- skip_expected = True
+PROTOCOLS = [
+ ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3,
+ ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1
+]
HOST = support.HOST
-CERTFILE = None
-SVN_PYTHON_ORG_ROOT_CERT = None
+
+data_file = lambda name: os.path.join(os.path.dirname(__file__), name)
+
+# The custom key and certificate files used in test_ssl are generated
+# using Lib/test/make_ssl_certs.py.
+# Other certificates are simply fetched from the Internet servers they
+# are meant to authenticate.
+
+CERTFILE = data_file("keycert.pem")
+BYTES_CERTFILE = os.fsencode(CERTFILE)
+ONLYCERT = data_file("ssl_cert.pem")
+ONLYKEY = data_file("ssl_key.pem")
+BYTES_ONLYCERT = os.fsencode(ONLYCERT)
+BYTES_ONLYKEY = os.fsencode(ONLYKEY)
+CAPATH = data_file("capath")
+BYTES_CAPATH = os.fsencode(CAPATH)
+
+SVN_PYTHON_ORG_ROOT_CERT = data_file("https_svn_python_org_root.pem")
+
+EMPTYCERT = data_file("nullcert.pem")
+BADCERT = data_file("badcert.pem")
+WRONGCERT = data_file("XXXnonexisting.pem")
+BADKEY = data_file("badkey.pem")
+
def handle_error(prefix):
exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
if support.verbose:
sys.stdout.write(prefix + exc_format)
+def can_clear_options():
+ # 0.9.8m or higher
+ return ssl.OPENSSL_VERSION_INFO >= (0, 9, 8, 13, 15)
+
+def no_sslv2_implies_sslv3_hello():
+ # 0.9.7h or higher
+ return ssl.OPENSSL_VERSION_INFO >= (0, 9, 7, 8, 15)
-class BasicTests(unittest.TestCase):
+
+# Issue #9415: Ubuntu hijacks their OpenSSL and forcefully disables SSLv2
+def skip_if_broken_ubuntu_ssl(func):
+ @functools.wraps(func)
+ def f(*args, **kwargs):
+ try:
+ ssl.SSLContext(ssl.PROTOCOL_SSLv2)
+ except ssl.SSLError:
+ if (ssl.OPENSSL_VERSION_INFO == (0, 9, 8, 15, 15) and
+ platform.linux_distribution() == ('debian', 'squeeze/sid', '')):
+ raise unittest.SkipTest("Patched Ubuntu OpenSSL breaks behaviour")
+ return func(*args, **kwargs)
+ return f
+
+
+class BasicSocketTests(unittest.TestCase):
def test_constants(self):
ssl.PROTOCOL_SSLv2
@@ -47,6 +89,7 @@ class BasicTests(unittest.TestCase):
ssl.CERT_NONE
ssl.CERT_OPTIONAL
ssl.CERT_REQUIRED
+ self.assertIn(ssl.HAS_SNI, {True, False})
def test_random(self):
v = ssl.RAND_status()
@@ -66,7 +109,7 @@ class BasicTests(unittest.TestCase):
# note that this uses an 'unofficial' function in _ssl.c,
# provided solely for this test, to exercise the certificate
# parsing code
- p = ssl._ssl._test_decode_cert(CERTFILE, False)
+ p = ssl._ssl._test_decode_cert(CERTFILE)
if support.verbose:
sys.stdout.write("\n" + pprint.pformat(p) + "\n")
@@ -82,6 +125,33 @@ class BasicTests(unittest.TestCase):
if not p2.endswith('\n' + ssl.PEM_FOOTER + '\n'):
self.fail("DER-to-PEM didn't include correct footer:\n%r\n" % p2)
+ def test_openssl_version(self):
+ n = ssl.OPENSSL_VERSION_NUMBER
+ t = ssl.OPENSSL_VERSION_INFO
+ s = ssl.OPENSSL_VERSION
+ self.assertIsInstance(n, int)
+ self.assertIsInstance(t, tuple)
+ self.assertIsInstance(s, str)
+ # Some sanity checks follow
+ # >= 0.9
+ self.assertGreaterEqual(n, 0x900000)
+ # < 2.0
+ self.assertLess(n, 0x20000000)
+ major, minor, fix, patch, status = t
+ self.assertGreaterEqual(major, 0)
+ self.assertLess(major, 2)
+ self.assertGreaterEqual(minor, 0)
+ self.assertLess(minor, 256)
+ self.assertGreaterEqual(fix, 0)
+ self.assertLess(fix, 256)
+ self.assertGreaterEqual(patch, 0)
+ self.assertLessEqual(patch, 26)
+ self.assertGreaterEqual(status, 0)
+ self.assertLessEqual(status, 15)
+ # Version string as returned by OpenSSL, the format might change
+ self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)),
+ (s, t))
+
@support.cpython_only
def test_refcycle(self):
# Issue #7943: an SSL object doesn't create reference cycles with
@@ -113,6 +183,262 @@ class BasicTests(unittest.TestCase):
ss = ssl.wrap_socket(s)
self.assertEqual(timeout, ss.gettimeout())
+ def test_errors(self):
+ sock = socket.socket()
+ self.assertRaisesRegex(ValueError,
+ "certfile must be specified",
+ ssl.wrap_socket, sock, keyfile=CERTFILE)
+ self.assertRaisesRegex(ValueError,
+ "certfile must be specified for server-side operations",
+ ssl.wrap_socket, sock, server_side=True)
+ self.assertRaisesRegex(ValueError,
+ "certfile must be specified for server-side operations",
+ ssl.wrap_socket, sock, server_side=True, certfile="")
+ s = ssl.wrap_socket(sock, server_side=True, certfile=CERTFILE)
+ self.assertRaisesRegex(ValueError, "can't connect in server-side mode",
+ s.connect, (HOST, 8080))
+ with self.assertRaises(IOError) as cm:
+ with socket.socket() as sock:
+ ssl.wrap_socket(sock, certfile=WRONGCERT)
+ self.assertEqual(cm.exception.errno, errno.ENOENT)
+ with self.assertRaises(IOError) as cm:
+ with socket.socket() as sock:
+ ssl.wrap_socket(sock, certfile=CERTFILE, keyfile=WRONGCERT)
+ self.assertEqual(cm.exception.errno, errno.ENOENT)
+ with self.assertRaises(IOError) as cm:
+ with socket.socket() as sock:
+ ssl.wrap_socket(sock, certfile=WRONGCERT, keyfile=WRONGCERT)
+ self.assertEqual(cm.exception.errno, errno.ENOENT)
+
+ def test_match_hostname(self):
+ def ok(cert, hostname):
+ ssl.match_hostname(cert, hostname)
+ def fail(cert, hostname):
+ self.assertRaises(ssl.CertificateError,
+ ssl.match_hostname, cert, hostname)
+
+ cert = {'subject': ((('commonName', 'example.com'),),)}
+ ok(cert, 'example.com')
+ ok(cert, 'ExAmple.cOm')
+ fail(cert, 'www.example.com')
+ fail(cert, '.example.com')
+ fail(cert, 'example.org')
+ fail(cert, 'exampleXcom')
+
+ cert = {'subject': ((('commonName', '*.a.com'),),)}
+ ok(cert, 'foo.a.com')
+ fail(cert, 'bar.foo.a.com')
+ fail(cert, 'a.com')
+ fail(cert, 'Xa.com')
+ fail(cert, '.a.com')
+
+ cert = {'subject': ((('commonName', 'a.*.com'),),)}
+ ok(cert, 'a.foo.com')
+ fail(cert, 'a..com')
+ fail(cert, 'a.com')
+
+ cert = {'subject': ((('commonName', 'f*.com'),),)}
+ ok(cert, 'foo.com')
+ ok(cert, 'f.com')
+ fail(cert, 'bar.com')
+ fail(cert, 'foo.a.com')
+ fail(cert, 'bar.foo.com')
+
+ # Slightly fake real-world example
+ cert = {'notAfter': 'Jun 26 21:41:46 2011 GMT',
+ 'subject': ((('commonName', 'linuxfrz.org'),),),
+ 'subjectAltName': (('DNS', 'linuxfr.org'),
+ ('DNS', 'linuxfr.com'),
+ ('othername', '<unsupported>'))}
+ ok(cert, 'linuxfr.org')
+ ok(cert, 'linuxfr.com')
+ # Not a "DNS" entry
+ fail(cert, '<unsupported>')
+ # When there is a subjectAltName, commonName isn't used
+ fail(cert, 'linuxfrz.org')
+
+ # A pristine real-world example
+ cert = {'notAfter': 'Dec 18 23:59:59 2011 GMT',
+ 'subject': ((('countryName', 'US'),),
+ (('stateOrProvinceName', 'California'),),
+ (('localityName', 'Mountain View'),),
+ (('organizationName', 'Google Inc'),),
+ (('commonName', 'mail.google.com'),))}
+ ok(cert, 'mail.google.com')
+ fail(cert, 'gmail.com')
+ # Only commonName is considered
+ fail(cert, 'California')
+
+ # Neither commonName nor subjectAltName
+ cert = {'notAfter': 'Dec 18 23:59:59 2011 GMT',
+ 'subject': ((('countryName', 'US'),),
+ (('stateOrProvinceName', 'California'),),
+ (('localityName', 'Mountain View'),),
+ (('organizationName', 'Google Inc'),))}
+ fail(cert, 'mail.google.com')
+
+ # No DNS entry in subjectAltName but a commonName
+ cert = {'notAfter': 'Dec 18 23:59:59 2099 GMT',
+ 'subject': ((('countryName', 'US'),),
+ (('stateOrProvinceName', 'California'),),
+ (('localityName', 'Mountain View'),),
+ (('commonName', 'mail.google.com'),)),
+ 'subjectAltName': (('othername', 'blabla'), )}
+ ok(cert, 'mail.google.com')
+
+ # No DNS entry subjectAltName and no commonName
+ cert = {'notAfter': 'Dec 18 23:59:59 2099 GMT',
+ 'subject': ((('countryName', 'US'),),
+ (('stateOrProvinceName', 'California'),),
+ (('localityName', 'Mountain View'),),
+ (('organizationName', 'Google Inc'),)),
+ 'subjectAltName': (('othername', 'blabla'),)}
+ fail(cert, 'google.com')
+
+ # Empty cert / no cert
+ self.assertRaises(ValueError, ssl.match_hostname, None, 'example.com')
+ self.assertRaises(ValueError, ssl.match_hostname, {}, 'example.com')
+
+ def test_server_side(self):
+ # server_hostname doesn't work for server sockets
+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ with socket.socket() as sock:
+ self.assertRaises(ValueError, ctx.wrap_socket, sock, True,
+ server_hostname="some.hostname")
+
+class ContextTests(unittest.TestCase):
+
+ @skip_if_broken_ubuntu_ssl
+ def test_constructor(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv2)
+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv3)
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ self.assertRaises(TypeError, ssl.SSLContext)
+ self.assertRaises(ValueError, ssl.SSLContext, -1)
+ self.assertRaises(ValueError, ssl.SSLContext, 42)
+
+ @skip_if_broken_ubuntu_ssl
+ def test_protocol(self):
+ for proto in PROTOCOLS:
+ ctx = ssl.SSLContext(proto)
+ self.assertEqual(ctx.protocol, proto)
+
+ def test_ciphers(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ ctx.set_ciphers("ALL")
+ ctx.set_ciphers("DEFAULT")
+ with self.assertRaisesRegex(ssl.SSLError, "No cipher can be selected"):
+ ctx.set_ciphers("^$:,;?*'dorothyx")
+
+ @skip_if_broken_ubuntu_ssl
+ def test_options(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ # OP_ALL is the default value
+ self.assertEqual(ssl.OP_ALL, ctx.options)
+ ctx.options |= ssl.OP_NO_SSLv2
+ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2,
+ ctx.options)
+ ctx.options |= ssl.OP_NO_SSLv3
+ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3,
+ ctx.options)
+ if can_clear_options():
+ ctx.options = (ctx.options & ~ssl.OP_NO_SSLv2) | ssl.OP_NO_TLSv1
+ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_TLSv1 | ssl.OP_NO_SSLv3,
+ ctx.options)
+ ctx.options = 0
+ self.assertEqual(0, ctx.options)
+ else:
+ with self.assertRaises(ValueError):
+ ctx.options = 0
+
+ def test_verify(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ # Default value
+ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
+ ctx.verify_mode = ssl.CERT_OPTIONAL
+ self.assertEqual(ctx.verify_mode, ssl.CERT_OPTIONAL)
+ ctx.verify_mode = ssl.CERT_REQUIRED
+ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
+ ctx.verify_mode = ssl.CERT_NONE
+ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
+ with self.assertRaises(TypeError):
+ ctx.verify_mode = None
+ with self.assertRaises(ValueError):
+ ctx.verify_mode = 42
+
+ def test_load_cert_chain(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ # Combined key and cert in a single file
+ ctx.load_cert_chain(CERTFILE)
+ ctx.load_cert_chain(CERTFILE, keyfile=CERTFILE)
+ self.assertRaises(TypeError, ctx.load_cert_chain, keyfile=CERTFILE)
+ with self.assertRaises(IOError) as cm:
+ ctx.load_cert_chain(WRONGCERT)
+ self.assertEqual(cm.exception.errno, errno.ENOENT)
+ with self.assertRaisesRegex(ssl.SSLError, "PEM lib"):
+ ctx.load_cert_chain(BADCERT)
+ with self.assertRaisesRegex(ssl.SSLError, "PEM lib"):
+ ctx.load_cert_chain(EMPTYCERT)
+ # Separate key and cert
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ ctx.load_cert_chain(ONLYCERT, ONLYKEY)
+ ctx.load_cert_chain(certfile=ONLYCERT, keyfile=ONLYKEY)
+ ctx.load_cert_chain(certfile=BYTES_ONLYCERT, keyfile=BYTES_ONLYKEY)
+ with self.assertRaisesRegex(ssl.SSLError, "PEM lib"):
+ ctx.load_cert_chain(ONLYCERT)
+ with self.assertRaisesRegex(ssl.SSLError, "PEM lib"):
+ ctx.load_cert_chain(ONLYKEY)
+ with self.assertRaisesRegex(ssl.SSLError, "PEM lib"):
+ ctx.load_cert_chain(certfile=ONLYKEY, keyfile=ONLYCERT)
+ # Mismatching key and cert
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ with self.assertRaisesRegex(ssl.SSLError, "key values mismatch"):
+ ctx.load_cert_chain(SVN_PYTHON_ORG_ROOT_CERT, ONLYKEY)
+
+ def test_load_verify_locations(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ ctx.load_verify_locations(CERTFILE)
+ ctx.load_verify_locations(cafile=CERTFILE, capath=None)
+ ctx.load_verify_locations(BYTES_CERTFILE)
+ ctx.load_verify_locations(cafile=BYTES_CERTFILE, capath=None)
+ self.assertRaises(TypeError, ctx.load_verify_locations)
+ self.assertRaises(TypeError, ctx.load_verify_locations, None, None)
+ with self.assertRaises(IOError) as cm:
+ ctx.load_verify_locations(WRONGCERT)
+ self.assertEqual(cm.exception.errno, errno.ENOENT)
+ with self.assertRaisesRegex(ssl.SSLError, "PEM lib"):
+ ctx.load_verify_locations(BADCERT)
+ ctx.load_verify_locations(CERTFILE, CAPATH)
+ ctx.load_verify_locations(CERTFILE, capath=BYTES_CAPATH)
+
+ # Issue #10989: crash if the second argument type is invalid
+ self.assertRaises(TypeError, ctx.load_verify_locations, None, True)
+
+ @skip_if_broken_ubuntu_ssl
+ def test_session_stats(self):
+ for proto in PROTOCOLS:
+ ctx = ssl.SSLContext(proto)
+ self.assertEqual(ctx.session_stats(), {
+ 'number': 0,
+ 'connect': 0,
+ 'connect_good': 0,
+ 'connect_renegotiate': 0,
+ 'accept': 0,
+ 'accept_good': 0,
+ 'accept_renegotiate': 0,
+ 'hits': 0,
+ 'misses': 0,
+ 'timeouts': 0,
+ 'cache_full': 0,
+ })
+
+ def test_set_default_verify_paths(self):
+ # There's not much we can do to test that it acts as expected,
+ # so just check it doesn't crash or raise an exception.
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ ctx.set_default_verify_paths()
+
class NetworkedTests(unittest.TestCase):
@@ -120,28 +446,133 @@ class NetworkedTests(unittest.TestCase):
with support.transient_internet("svn.python.org"):
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
cert_reqs=ssl.CERT_NONE)
- s.connect(("svn.python.org", 443))
- c = s.getpeercert()
- if c:
- self.fail("Peer cert %s shouldn't be here!")
- s.close()
+ try:
+ s.connect(("svn.python.org", 443))
+ self.assertEqual({}, s.getpeercert())
+ finally:
+ s.close()
# this should fail because we have no verification certs
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
cert_reqs=ssl.CERT_REQUIRED)
+ self.assertRaisesRegex(ssl.SSLError, "certificate verify failed",
+ s.connect, ("svn.python.org", 443))
+ s.close()
+
+ # this should succeed because we specify the root cert
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
try:
s.connect(("svn.python.org", 443))
- except ssl.SSLError:
- pass
+ self.assertTrue(s.getpeercert())
finally:
s.close()
- # this should succeed because we specify the root cert
+ def test_connect_ex(self):
+ # Issue #11326: check connect_ex() implementation
+ with support.transient_internet("svn.python.org"):
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
cert_reqs=ssl.CERT_REQUIRED,
ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
try:
+ self.assertEqual(0, s.connect_ex(("svn.python.org", 443)))
+ self.assertTrue(s.getpeercert())
+ finally:
+ s.close()
+
+ def test_non_blocking_connect_ex(self):
+ # Issue #11326: non-blocking connect_ex() should allow handshake
+ # to proceed after the socket gets ready.
+ with support.transient_internet("svn.python.org"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT,
+ do_handshake_on_connect=False)
+ try:
+ s.setblocking(False)
+ rc = s.connect_ex(('svn.python.org', 443))
+ # EWOULDBLOCK under Windows, EINPROGRESS elsewhere
+ self.assertIn(rc, (0, errno.EINPROGRESS, errno.EWOULDBLOCK))
+ # Wait for connect to finish
+ select.select([], [s], [], 5.0)
+ # Non-blocking handshake
+ while True:
+ try:
+ s.do_handshake()
+ break
+ except ssl.SSLError as err:
+ if err.args[0] == ssl.SSL_ERROR_WANT_READ:
+ select.select([s], [], [], 5.0)
+ elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
+ select.select([], [s], [], 5.0)
+ else:
+ raise
+ # SSL established
+ self.assertTrue(s.getpeercert())
+ finally:
+ s.close()
+
+ def test_connect_with_context(self):
+ with support.transient_internet("svn.python.org"):
+ # Same as test_connect, but with a separately created context
+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
+ s.connect(("svn.python.org", 443))
+ try:
+ self.assertEqual({}, s.getpeercert())
+ finally:
+ s.close()
+ # Same with a server hostname
+ s = ctx.wrap_socket(socket.socket(socket.AF_INET),
+ server_hostname="svn.python.org")
+ if ssl.HAS_SNI:
s.connect(("svn.python.org", 443))
+ s.close()
+ else:
+ self.assertRaises(ValueError, s.connect, ("svn.python.org", 443))
+ # This should fail because we have no verification certs
+ ctx.verify_mode = ssl.CERT_REQUIRED
+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
+ self.assertRaisesRegex(ssl.SSLError, "certificate verify failed",
+ s.connect, ("svn.python.org", 443))
+ s.close()
+ # This should succeed because we specify the root cert
+ ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT)
+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
+ s.connect(("svn.python.org", 443))
+ try:
+ cert = s.getpeercert()
+ self.assertTrue(cert)
+ finally:
+ s.close()
+
+ def test_connect_capath(self):
+ # Verify server certificates using the `capath` argument
+ # NOTE: the subject hashing algorithm has been changed between
+ # OpenSSL 0.9.8n and 1.0.0, as a result the capath directory must
+ # contain both versions of each certificate (same content, different
+ # filename) for this test to be portable across OpenSSL releases.
+ with support.transient_internet("svn.python.org"):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ ctx.verify_mode = ssl.CERT_REQUIRED
+ ctx.load_verify_locations(capath=CAPATH)
+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
+ s.connect(("svn.python.org", 443))
+ try:
+ cert = s.getpeercert()
+ self.assertTrue(cert)
+ finally:
+ s.close()
+ # Same with a bytes `capath` argument
+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ ctx.verify_mode = ssl.CERT_REQUIRED
+ ctx.load_verify_locations(capath=BYTES_CAPATH)
+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
+ s.connect(("svn.python.org", 443))
+ try:
+ cert = s.getpeercert()
+ self.assertTrue(cert)
finally:
s.close()
@@ -161,12 +592,9 @@ class NetworkedTests(unittest.TestCase):
# Closing the SSL socket should close the fd too
ss.close()
gc.collect()
- try:
+ with self.assertRaises(OSError) as e:
os.read(fd, 0)
- except OSError as e:
- self.assertEqual(e.errno, errno.EBADF)
- else:
- self.fail("OSError wasn't raised")
+ self.assertEqual(e.exception.errno, errno.EBADF)
def test_non_blocking_handshake(self):
with support.transient_internet("svn.python.org"):
@@ -214,19 +642,30 @@ class NetworkedTests(unittest.TestCase):
if support.verbose:
sys.stdout.write("\nVerified certificate for svn.python.org:443 is\n%s\n" % pem)
- # Test disabled: OPENSSL_VERSION* not available in Python 3.1
+ def test_ciphers(self):
+ remote = ("svn.python.org", 443)
+ with support.transient_internet(remote[0]):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_NONE, ciphers="ALL")
+ s.connect(remote)
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT")
+ s.connect(remote)
+ # Error checking can happen at instantiation or when connecting
+ with self.assertRaisesRegex(ssl.SSLError, "No cipher can be selected"):
+ with socket.socket(socket.AF_INET) as sock:
+ s = ssl.wrap_socket(sock,
+ cert_reqs=ssl.CERT_NONE, ciphers="^$:,;?*'dorothyx")
+ s.connect(remote)
+
def test_algorithms(self):
- if support.verbose:
- sys.stdout.write("test_algorithms disabled, "
- "as it fails on some old OpenSSL versions")
- return
# Issue #8484: all algorithms should be available when verifying a
# certificate.
# SHA256 was added in OpenSSL 0.9.8
if ssl.OPENSSL_VERSION_INFO < (0, 9, 8, 0, 15):
self.skipTest("SHA256 not available on %r" % ssl.OPENSSL_VERSION)
- # NOTE: https://sha256.tbs-internet.com is another possible test host
- remote = ("sha2.hboeck.de", 443)
+ # https://sha2.hboeck.de/ was used until 2011-01-08 (no route to host)
+ remote = ("sha256.tbs-internet.com", 443)
sha256_cert = os.path.join(os.path.dirname(__file__), "sha256.pem")
with support.transient_internet("sha256.tbs-internet.com"):
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
@@ -250,6 +689,8 @@ except ImportError:
else:
_have_threads = True
+ from test.ssl_servers import make_https_server
+
class ThreadedEchoServer(threading.Thread):
class ConnectionHandler(threading.Thread):
@@ -270,11 +711,8 @@ else:
def wrap_conn(self):
try:
- self.sslconn = ssl.wrap_socket(self.sock, server_side=True,
- certfile=self.server.certificate,
- ssl_version=self.server.protocol,
- ca_certs=self.server.cacerts,
- cert_reqs=self.server.certreqs)
+ self.sslconn = self.server.context.wrap_socket(
+ self.sock, server_side=True)
except ssl.SSLError:
# XXX Various errors can have happened here, for example
# a mismatching protocol version, an invalid certificate,
@@ -286,7 +724,7 @@ else:
self.close()
return False
else:
- if self.server.certreqs == ssl.CERT_REQUIRED:
+ if self.server.context.verify_mode == ssl.CERT_REQUIRED:
cert = self.sslconn.getpeercert()
if support.verbose and self.server.chatty:
sys.stdout.write(" client cert is " + pprint.pformat(cert) + "\n")
@@ -366,17 +804,24 @@ else:
# harness, we want to stop the server
self.server.stop()
- def __init__(self, certificate, ssl_version=None,
+ def __init__(self, certificate=None, ssl_version=None,
certreqs=None, cacerts=None,
- chatty=True, connectionchatty=False, starttls_server=False):
- if ssl_version is None:
- ssl_version = ssl.PROTOCOL_TLSv1
- if certreqs is None:
- certreqs = ssl.CERT_NONE
- self.certificate = certificate
- self.protocol = ssl_version
- self.certreqs = certreqs
- self.cacerts = cacerts
+ chatty=True, connectionchatty=False, starttls_server=False,
+ ciphers=None, context=None):
+ if context:
+ self.context = context
+ else:
+ self.context = ssl.SSLContext(ssl_version
+ if ssl_version is not None
+ else ssl.PROTOCOL_TLSv1)
+ self.context.verify_mode = (certreqs if certreqs is not None
+ else ssl.CERT_NONE)
+ if cacerts:
+ self.context.load_verify_locations(cacerts)
+ if certificate:
+ self.context.load_cert_chain(certificate)
+ if ciphers:
+ self.context.set_ciphers(ciphers)
self.chatty = chatty
self.connectionchatty = connectionchatty
self.starttls_server = starttls_server
@@ -415,98 +860,6 @@ else:
def stop(self):
self.active = False
- class OurHTTPSServer(threading.Thread):
-
- # This one's based on HTTPServer, which is based on SocketServer
-
- class HTTPSServer(HTTPServer):
-
- def __init__(self, server_address, RequestHandlerClass, certfile):
- HTTPServer.__init__(self, server_address, RequestHandlerClass)
- # we assume the certfile contains both private key and certificate
- self.certfile = certfile
- self.allow_reuse_address = True
-
- def __str__(self):
- return ('<%s %s:%s>' %
- (self.__class__.__name__,
- self.server_name,
- self.server_port))
-
- def get_request(self):
- # override this to wrap socket with SSL
- sock, addr = self.socket.accept()
- sslconn = ssl.wrap_socket(sock, server_side=True,
- certfile=self.certfile)
- return sslconn, addr
-
- class RootedHTTPRequestHandler(SimpleHTTPRequestHandler):
- # need to override translate_path to get a known root,
- # instead of using os.curdir, since the test could be
- # run from anywhere
-
- server_version = "TestHTTPS/1.0"
-
- root = None
-
- def translate_path(self, path):
- """Translate a /-separated PATH to the local filename syntax.
-
- Components that mean special things to the local file system
- (e.g. drive or directory names) are ignored. (XXX They should
- probably be diagnosed.)
-
- """
- # abandon query parameters
- path = urllib.parse.urlparse(path)[2]
- path = os.path.normpath(urllib.parse.unquote(path))
- words = path.split('/')
- words = filter(None, words)
- path = self.root
- for word in words:
- drive, word = os.path.splitdrive(word)
- head, word = os.path.split(word)
- if word in self.root: continue
- path = os.path.join(path, word)
- return path
-
- def log_message(self, format, *args):
- # we override this to suppress logging unless "verbose"
-
- if support.verbose:
- sys.stdout.write(" server (%s:%d %s):\n [%s] %s\n" %
- (self.server.server_address,
- self.server.server_port,
- self.request.cipher(),
- self.log_date_time_string(),
- format%args))
-
-
- def __init__(self, certfile):
- self.flag = None
- self.RootedHTTPRequestHandler.root = os.path.split(CERTFILE)[0]
- self.server = self.HTTPSServer(
- (HOST, 0), self.RootedHTTPRequestHandler, certfile)
- self.port = self.server.server_port
- threading.Thread.__init__(self)
- self.daemon = True
-
- def __str__(self):
- return "<%s %s>" % (self.__class__.__name__, self.server)
-
- def start(self, flag=None):
- self.flag = flag
- threading.Thread.start(self)
-
- def run(self):
- if self.flag:
- self.flag.set()
- self.server.serve_forever(0.05)
-
- def stop(self):
- self.server.shutdown()
-
-
class AsyncoreEchoServer(threading.Thread):
# this one's based on asyncore.dispatcher
@@ -572,8 +925,7 @@ else:
asyncore.dispatcher.__init__(self, sock)
self.listen(5)
- def handle_accept(self):
- sock_obj, addr = self.accept()
+ def handle_accepted(self, sock_obj, addr):
if support.verbose:
sys.stdout.write(" server: new connection from %s:%s\n" %addr)
self.ConnectionHandler(sock_obj, self.certfile)
@@ -626,33 +978,35 @@ else:
# try to connect
try:
try:
- s = ssl.wrap_socket(socket.socket(),
- certfile=certfile,
- ssl_version=ssl.PROTOCOL_TLSv1)
- s.connect((HOST, server.port))
+ with socket.socket() as sock:
+ s = ssl.wrap_socket(sock,
+ certfile=certfile,
+ ssl_version=ssl.PROTOCOL_TLSv1)
+ s.connect((HOST, server.port))
except ssl.SSLError as x:
if support.verbose:
sys.stdout.write("\nSSLError is %s\n" % x.args[1])
except socket.error as x:
if support.verbose:
sys.stdout.write("\nsocket.error is %s\n" % x.args[1])
+ except IOError as x:
+ if x.errno != errno.ENOENT:
+ raise
+ if support.verbose:
+ sys.stdout.write("\IOError is %s\n" % str(x))
else:
- self.fail("Use of invalid cert should have failed!")
+ raise AssertionError("Use of invalid cert should have failed!")
finally:
server.stop()
server.join()
- def server_params_test(certfile, protocol, certreqs, cacertsfile,
- client_certfile, client_protocol=None, indata=b"FOO\n",
+ def server_params_test(client_context, server_context, indata=b"FOO\n",
chatty=True, connectionchatty=False):
"""
Launch a server, connect a client to it and try various reads
and writes.
"""
- server = ThreadedEchoServer(certfile,
- certreqs=certreqs,
- ssl_version=protocol,
- cacerts=cacertsfile,
+ server = ThreadedEchoServer(context=server_context,
chatty=chatty,
connectionchatty=False)
flag = threading.Event()
@@ -660,30 +1014,24 @@ else:
# wait for it to start
flag.wait()
# try to connect
- if client_protocol is None:
- client_protocol = protocol
try:
- s = ssl.wrap_socket(socket.socket(),
- certfile=client_certfile,
- ca_certs=cacertsfile,
- cert_reqs=certreqs,
- ssl_version=client_protocol)
+ s = client_context.wrap_socket(socket.socket())
s.connect((HOST, server.port))
- arg = indata
- if connectionchatty:
- if support.verbose:
- sys.stdout.write(
- " client: sending %r...\n" % indata)
- s.write(arg)
- outdata = s.read()
- if connectionchatty:
- if support.verbose:
- sys.stdout.write(" client: read %r\n" % outdata)
- if outdata != indata.lower():
- self.fail(
- "bad data <<%r>> (%d) received; expected <<%r>> (%d)\n"
- % (outdata[:20], len(outdata),
- indata[:20].lower(), len(indata)))
+ for arg in [indata, bytearray(indata), memoryview(indata)]:
+ if connectionchatty:
+ if support.verbose:
+ sys.stdout.write(
+ " client: sending %r...\n" % indata)
+ s.write(arg)
+ outdata = s.read()
+ if connectionchatty:
+ if support.verbose:
+ sys.stdout.write(" client: read %r\n" % outdata)
+ if outdata != indata.lower():
+ raise AssertionError(
+ "bad data <<%r>> (%d) received; expected <<%r>> (%d)\n"
+ % (outdata[:20], len(outdata),
+ indata[:20].lower(), len(indata)))
s.write(b"over\n")
if connectionchatty:
if support.verbose:
@@ -693,10 +1041,8 @@ else:
server.stop()
server.join()
- def try_protocol_combo(server_protocol,
- client_protocol,
- expect_success,
- certsreqs=None):
+ def try_protocol_combo(server_protocol, client_protocol, expect_success,
+ certsreqs=None, server_options=0, client_options=0):
if certsreqs is None:
certsreqs = ssl.CERT_NONE
certtype = {
@@ -710,11 +1056,21 @@ else:
(ssl.get_protocol_name(client_protocol),
ssl.get_protocol_name(server_protocol),
certtype))
+ client_context = ssl.SSLContext(client_protocol)
+ client_context.options = ssl.OP_ALL | client_options
+ server_context = ssl.SSLContext(server_protocol)
+ server_context.options = ssl.OP_ALL | server_options
+ for ctx in (client_context, server_context):
+ ctx.verify_mode = certsreqs
+ # NOTE: we must enable "ALL" ciphers, otherwise an SSLv23 client
+ # will send an SSLv3 hello (rather than SSLv2) starting from
+ # OpenSSL 1.0.0 (see issue #8322).
+ ctx.set_ciphers("ALL")
+ ctx.load_cert_chain(CERTFILE)
+ ctx.load_verify_locations(CERTFILE)
try:
- server_params_test(CERTFILE, server_protocol, certsreqs,
- CERTFILE, CERTFILE, client_protocol,
- chatty=False,
- connectionchatty=False)
+ server_params_test(client_context, server_context,
+ chatty=False, connectionchatty=False)
# Protocol mismatch can result in either an SSLError, or a
# "Connection reset by peer" error.
except ssl.SSLError:
@@ -733,34 +1089,32 @@ else:
class ThreadedTests(unittest.TestCase):
+ @skip_if_broken_ubuntu_ssl
def test_echo(self):
"""Basic test of an SSL client connecting to a server"""
if support.verbose:
sys.stdout.write("\n")
- server_params_test(CERTFILE, ssl.PROTOCOL_TLSv1, ssl.CERT_NONE,
- CERTFILE, CERTFILE, ssl.PROTOCOL_TLSv1,
- chatty=True, connectionchatty=True)
+ for protocol in PROTOCOLS:
+ context = ssl.SSLContext(protocol)
+ context.load_cert_chain(CERTFILE)
+ server_params_test(context, context,
+ chatty=True, connectionchatty=True)
def test_getpeercert(self):
if support.verbose:
sys.stdout.write("\n")
- s2 = socket.socket()
- server = ThreadedEchoServer(CERTFILE,
- certreqs=ssl.CERT_NONE,
- ssl_version=ssl.PROTOCOL_SSLv23,
- cacerts=CERTFILE,
- chatty=False)
+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ context.verify_mode = ssl.CERT_REQUIRED
+ context.load_verify_locations(CERTFILE)
+ context.load_cert_chain(CERTFILE)
+ server = ThreadedEchoServer(context=context, chatty=False)
flag = threading.Event()
server.start(flag)
# wait for it to start
flag.wait()
# try to connect
try:
- s = ssl.wrap_socket(socket.socket(),
- certfile=CERTFILE,
- ca_certs=CERTFILE,
- cert_reqs=ssl.CERT_REQUIRED,
- ssl_version=ssl.PROTOCOL_SSLv23)
+ s = context.wrap_socket(socket.socket())
s.connect((HOST, server.port))
cert = s.getpeercert()
self.assertTrue(cert, "Can't get peer certificate.")
@@ -776,6 +1130,11 @@ else:
self.fail(
"Missing or invalid 'organizationName' field in certificate subject; "
"should be 'Python Software Foundation'.")
+ self.assertIn('notBefore', cert)
+ self.assertIn('notAfter', cert)
+ before = ssl.cert_time_to_seconds(cert['notBefore'])
+ after = ssl.cert_time_to_seconds(cert['notAfter'])
+ self.assertLess(before, after)
s.close()
finally:
server.stop()
@@ -815,21 +1174,22 @@ else:
def listener():
s.listen(5)
listener_ready.set()
- s.accept()
+ newsock, addr = s.accept()
+ newsock.close()
s.close()
listener_gone.set()
def connector():
listener_ready.wait()
- c = socket.socket()
- c.connect((HOST, port))
- listener_gone.wait()
- try:
- ssl_sock = ssl.wrap_socket(c)
- except IOError:
- pass
- else:
- self.fail('connecting to closed SSL socket should have failed')
+ with socket.socket() as c:
+ c.connect((HOST, port))
+ listener_gone.wait()
+ try:
+ ssl_sock = ssl.wrap_socket(c)
+ except IOError:
+ pass
+ else:
+ self.fail('connecting to closed SSL socket should have failed')
t = threading.Thread(target=listener)
t.start()
@@ -838,25 +1198,32 @@ else:
finally:
t.join()
+ @skip_if_broken_ubuntu_ssl
def test_protocol_sslv2(self):
"""Connecting to an SSLv2 server with various client options"""
if support.verbose:
- sys.stdout.write("\ntest_protocol_sslv2 disabled, "
- "as it fails on OpenSSL 1.0.0+")
- return
+ sys.stdout.write("\n")
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_OPTIONAL)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_REQUIRED)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, True)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False)
-
+ # SSLv23 client with specific SSL options
+ if no_sslv2_implies_sslv3_hello():
+ # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False,
+ client_options=ssl.OP_NO_SSLv2)
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, True,
+ client_options=ssl.OP_NO_SSLv3)
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, True,
+ client_options=ssl.OP_NO_TLSv1)
+
+ @skip_if_broken_ubuntu_ssl
def test_protocol_sslv23(self):
"""Connecting to an SSLv23 server with various client options"""
if support.verbose:
- sys.stdout.write("\ntest_protocol_sslv23 disabled, "
- "as it fails on OpenSSL 1.0.0+")
- return
+ sys.stdout.write("\n")
try:
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv2, True)
except (ssl.SSLError, socket.error) as x:
@@ -877,25 +1244,37 @@ else:
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True, ssl.CERT_REQUIRED)
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True, ssl.CERT_REQUIRED)
+ # Server with specific SSL options
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
+ server_options=ssl.OP_NO_SSLv3)
+ # Will choose TLSv1
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
+ server_options=ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, False,
+ server_options=ssl.OP_NO_TLSv1)
+
+
+ @skip_if_broken_ubuntu_ssl
def test_protocol_sslv3(self):
"""Connecting to an SSLv3 server with various client options"""
if support.verbose:
- sys.stdout.write("\ntest_protocol_sslv3 disabled, "
- "as it fails on OpenSSL 1.0.0+")
- return
+ sys.stdout.write("\n")
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True, ssl.CERT_OPTIONAL)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True, ssl.CERT_REQUIRED)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv2, False)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False)
+ if no_sslv2_implies_sslv3_hello():
+ # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, True,
+ client_options=ssl.OP_NO_SSLv2)
+ @skip_if_broken_ubuntu_ssl
def test_protocol_tlsv1(self):
"""Connecting to a TLSv1 server with various client options"""
if support.verbose:
- sys.stdout.write("\ntest_protocol_tlsv1 disabled, "
- "as it fails on OpenSSL 1.0.0+")
- return
+ sys.stdout.write("\n")
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True)
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True, ssl.CERT_OPTIONAL)
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True, ssl.CERT_REQUIRED)
@@ -971,22 +1350,18 @@ else:
def test_socketserver(self):
"""Using a SocketServer to create and manage SSL connections."""
- server = OurHTTPSServer(CERTFILE)
- flag = threading.Event()
- server.start(flag)
- # wait for it to start
- flag.wait()
+ server = make_https_server(self, CERTFILE)
# try to connect
+ if support.verbose:
+ sys.stdout.write('\n')
+ with open(CERTFILE, 'rb') as f:
+ d1 = f.read()
+ d2 = ''
+ # now fetch the same data from the HTTPS server
+ url = 'https://%s:%d/%s' % (
+ HOST, server.port, os.path.split(CERTFILE)[1])
+ f = urllib.request.urlopen(url)
try:
- if support.verbose:
- sys.stdout.write('\n')
- with open(CERTFILE, 'rb') as f:
- d1 = f.read()
- d2 = ''
- # now fetch the same data from the HTTPS server
- url = 'https://%s:%d/%s' % (
- HOST, server.port, os.path.split(CERTFILE)[1])
- f = urllib.request.urlopen(url)
dlen = f.info().get("content-length")
if dlen and (int(dlen) > 0):
d2 = f.read(int(dlen))
@@ -994,15 +1369,9 @@ else:
sys.stdout.write(
" client: read %d bytes from remote server '%s'\n"
% (len(d2), server))
- f.close()
- self.assertEqual(d1, d2)
finally:
- if support.verbose:
- sys.stdout.write('stopping server\n')
- server.stop()
- if support.verbose:
- sys.stdout.write('joining thread\n')
- server.join()
+ f.close()
+ self.assertEqual(d1, d2)
def test_asyncore_server(self):
"""Check the example asyncore integration."""
@@ -1037,9 +1406,17 @@ else:
if support.verbose:
sys.stdout.write(" client: closing connection.\n")
s.close()
+ if support.verbose:
+ sys.stdout.write(" client: connection closed.\n")
finally:
+ if support.verbose:
+ sys.stdout.write(" cleanup: stopping server.\n")
server.stop()
+ if support.verbose:
+ sys.stdout.write(" cleanup: joining server thread.\n")
server.join()
+ if support.verbose:
+ sys.stdout.write(" cleanup: successfully joined.\n")
def test_recv_send(self):
"""Test recv(), send() and friends."""
@@ -1096,7 +1473,7 @@ else:
send_meth(indata, *args)
outdata = s.read()
if outdata != indata.lower():
- raise support.TestFailed(
+ self.fail(
"While sending with <<{name:s}>> bad data "
"<<{outdata:r}>> ({nout:d}) received; "
"expected <<{indata:r}>> ({nin:d})\n".format(
@@ -1107,12 +1484,12 @@ else:
)
except ValueError as e:
if expect_success:
- raise support.TestFailed(
+ self.fail(
"Failed to send with method <<{name:s}>>; "
"expected to succeed.\n".format(name=meth_name)
)
if not str(e).startswith(meth_name):
- raise support.TestFailed(
+ self.fail(
"Method <<{name:s}>> failed with unexpected "
"exception message: {exp:s}\n".format(
name=meth_name, exp=e
@@ -1125,7 +1502,7 @@ else:
s.send(indata)
outdata = recv_meth(*args)
if outdata != indata.lower():
- raise support.TestFailed(
+ self.fail(
"While receiving with <<{name:s}>> bad data "
"<<{outdata:r}>> ({nout:d}) received; "
"expected <<{indata:r}>> ({nin:d})\n".format(
@@ -1136,12 +1513,12 @@ else:
)
except ValueError as e:
if expect_success:
- raise support.TestFailed(
+ self.fail(
"Failed to receive with method <<{name:s}>>; "
"expected to succeed.\n".format(name=meth_name)
)
if not str(e).startswith(meth_name):
- raise support.TestFailed(
+ self.fail(
"Method <<{name:s}>> failed with unexpected "
"exception message: {exp:s}\n".format(
name=meth_name, exp=e
@@ -1174,6 +1551,8 @@ else:
# Let the socket hang around rather than having
# it closed by garbage collection.
conns.append(server.accept()[0])
+ for sock in conns:
+ sock.close()
t = threading.Thread(target=serve)
t.start()
@@ -1185,8 +1564,8 @@ else:
c.settimeout(0.2)
c.connect((host, port))
# Will attempt handshake and time out
- self.assertRaisesRegexp(ssl.SSLError, "timed out",
- ssl.wrap_socket, c)
+ self.assertRaisesRegex(socket.timeout, "timed out",
+ ssl.wrap_socket, c)
finally:
c.close()
try:
@@ -1194,8 +1573,8 @@ else:
c = ssl.wrap_socket(c)
c.settimeout(0.2)
# Will attempt handshake and time out
- self.assertRaisesRegexp(ssl.SSLError, "timed out",
- c.connect, (host, port))
+ self.assertRaisesRegex(socket.timeout, "timed out",
+ c.connect, (host, port))
finally:
c.close()
finally:
@@ -1205,21 +1584,32 @@ else:
def test_main(verbose=False):
- if skip_expected:
- raise unittest.SkipTest("No SSL support")
-
- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT
- CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
- "keycert.pem")
- SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
- os.path.dirname(__file__) or os.curdir,
- "https_svn_python_org_root.pem")
-
- if (not os.path.exists(CERTFILE) or
- not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT)):
- raise support.TestFailed("Can't read certificate files!")
-
- tests = [BasicTests]
+ if support.verbose:
+ plats = {
+ 'Linux': platform.linux_distribution,
+ 'Mac': platform.mac_ver,
+ 'Windows': platform.win32_ver,
+ }
+ for name, func in plats.items():
+ plat = func()
+ if plat and plat[0]:
+ plat = '%s %r' % (name, plat)
+ break
+ else:
+ plat = repr(platform.platform())
+ print("test_ssl: testing with %r %r" %
+ (ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO))
+ print(" under %s" % plat)
+ print(" HAS_SNI = %r" % ssl.HAS_SNI)
+
+ for filename in [
+ CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, BYTES_CERTFILE,
+ ONLYCERT, ONLYKEY, BYTES_ONLYCERT, BYTES_ONLYKEY,
+ BADCERT, BADKEY, EMPTYCERT]:
+ if not os.path.exists(filename):
+ raise support.TestFailed("Can't read certificate file %r" % filename)
+
+ tests = [ContextTests, BasicSocketTests]
if support.is_resource_enabled('network'):
tests.append(NetworkedTests)
diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py
index 5b94bbe210..14057eb34a 100755..100644
--- a/Lib/test/test_strftime.py
+++ b/Lib/test/test_strftime.py
@@ -4,7 +4,6 @@ Unittest for time.strftime
import calendar
import sys
-import os
import re
from test import support
import time
diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py
index f46be631ed..a352ee3560 100644
--- a/Lib/test/test_string.py
+++ b/Lib/test/test_string.py
@@ -112,6 +112,30 @@ class ModuleTest(unittest.TestCase):
self.assertRaises(ValueError, fmt.format, "{0}", 10, 20, i=100)
self.assertRaises(ValueError, fmt.format, "{i}", 10, 20, i=100)
+ def test_vformat_assert(self):
+ cls = string.Formatter()
+ kwargs = {
+ "i": 100
+ }
+ self.assertRaises(ValueError, cls._vformat,
+ cls.format, "{0}", kwargs, set(), -2)
+
+ def test_convert_field(self):
+ cls = string.Formatter()
+ self.assertEqual(cls.format("{0!s}", 'foo'), 'foo')
+ self.assertRaises(ValueError, cls.format, "{0!h}", 'foo')
+
+ def test_get_field(self):
+ cls = string.Formatter()
+ class MyClass:
+ name = 'lumberjack'
+ x = MyClass()
+ self.assertEqual(cls.format("{0.name}", x), 'lumberjack')
+
+ lookup = ["eggs", "and", "spam"]
+ self.assertEqual(cls.format("{0[2]}", lookup), 'spam')
+
+
def test_main():
support.run_unittest(ModuleTest)
diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py
index f150546287..89c08ede7b 100644
--- a/Lib/test/test_strptime.py
+++ b/Lib/test/test_strptime.py
@@ -36,8 +36,8 @@ class LocaleTime_Tests(unittest.TestCase):
"""
strftime_output = time.strftime(directive, self.time_tuple).lower()
comparison = testing[self.time_tuple[tuple_position]]
- self.assertTrue(strftime_output in testing, "%s: not found in tuple" %
- error_msg)
+ self.assertIn(strftime_output, testing,
+ "%s: not found in tuple" % error_msg)
self.assertTrue(comparison == strftime_output,
"%s: position within tuple incorrect; %s != %s" %
(error_msg, comparison, strftime_output))
@@ -61,8 +61,8 @@ class LocaleTime_Tests(unittest.TestCase):
def test_am_pm(self):
# Make sure AM/PM representation done properly
strftime_output = time.strftime("%p", self.time_tuple).lower()
- self.assertTrue(strftime_output in self.LT_ins.am_pm,
- "AM/PM representation not in tuple")
+ self.assertIn(strftime_output, self.LT_ins.am_pm,
+ "AM/PM representation not in tuple")
if self.time_tuple[3] < 12: position = 0
else: position = 1
self.assertTrue(strftime_output == self.LT_ins.am_pm[position],
@@ -72,7 +72,7 @@ class LocaleTime_Tests(unittest.TestCase):
# Make sure timezone is correct
timezone = time.strftime("%Z", self.time_tuple).lower()
if timezone:
- self.assertTrue(timezone in self.LT_ins.timezone[0] or \
+ self.assertTrue(timezone in self.LT_ins.timezone[0] or
timezone in self.LT_ins.timezone[1],
"timezone %s not found in %s" %
(timezone, self.LT_ins.timezone))
@@ -133,9 +133,9 @@ class TimeRETests(unittest.TestCase):
# Make sure any characters in the format string that might be taken as
# regex syntax is escaped.
pattern_string = self.time_re.pattern("\d+")
- self.assertTrue(r"\\d\+" in pattern_string,
- "%s does not have re characters escaped properly" %
- pattern_string)
+ self.assertIn(r"\\d\+", pattern_string,
+ "%s does not have re characters escaped properly" %
+ pattern_string)
def test_compile(self):
# Check that compiled regex is correct
@@ -298,9 +298,6 @@ class StrptimeTests(unittest.TestCase):
self.assertEqual(strp_output.tm_isdst, 0)
strp_output = _strptime._strptime_time("GMT", "%Z")
self.assertEqual(strp_output.tm_isdst, 0)
- if sys.platform == "mac":
- # Timezones don't really work on MacOS9
- return
time_tuple = time.localtime()
strf_output = time.strftime("%Z") #UTC does not have a timezone
strp_output = _strptime._strptime_time(strf_output, "%Z")
@@ -317,8 +314,6 @@ class StrptimeTests(unittest.TestCase):
def test_bad_timezone(self):
# Explicitly test possibility of bad timezone;
# when time.tzname[0] == time.tzname[1] and time.daylight
- if sys.platform == "mac":
- return #MacOS9 has severely broken timezone support.
tz_name = time.tzname[0]
if tz_name.upper() in ("UTC", "GMT"):
return
diff --git a/Lib/test/test_strtod.py b/Lib/test/test_strtod.py
index e39558a2f6..7a42a893b1 100644
--- a/Lib/test/test_strtod.py
+++ b/Lib/test/test_strtod.py
@@ -2,12 +2,15 @@
# introduced in Python 2.7 and 3.1.
import random
-import struct
import unittest
import re
import sys
import test.support
+if getattr(sys, 'float_repr_style', '') != 'short':
+ raise unittest.SkipTest('correctly-rounded string->float conversions '
+ 'not available on this system')
+
# Correctly rounded str -> float in pure Python, for comparison.
strtod_parser = re.compile(r""" # A numeric string consists of:
@@ -19,6 +22,8 @@ strtod_parser = re.compile(r""" # A numeric string consists of:
\Z
""", re.VERBOSE | re.IGNORECASE).match
+# Pure Python version of correctly rounded string->float conversion.
+# Avoids any use of floating-point by returning the result as a hex string.
def strtod(s, mant_dig=53, min_exp = -1021, max_exp = 1024):
"""Convert a finite decimal string to a hex string representing an
IEEE 754 binary64 float. Return 'inf' or '-inf' on overflow.
@@ -78,8 +83,6 @@ def strtod(s, mant_dig=53, min_exp = -1021, max_exp = 1024):
TEST_SIZE = 10
-@unittest.skipUnless(getattr(sys, 'float_repr_style', '') == 'short',
- "applies only when using short float repr style")
class StrtodTests(unittest.TestCase):
def check_strtod(self, s):
"""Compare the result of Python's builtin correctly rounded
@@ -257,6 +260,10 @@ class StrtodTests(unittest.TestCase):
'18487398785991994634182916638542680759613590482273e-357',
'32002864200581033134358724675198044527469366773928e-358',
'94393431193180696942841837085033647913224148539854e-358',
+ '73608278998966969345824653500136787876436005957953e-358',
+ '64774478836417299491718435234611299336288082136054e-358',
+ '13704940134126574534878641876947980878824688451169e-357',
+ '46697445774047060960624497964425416610480524760471e-358',
# failing case for bug introduced by METD in r77451 (attempted
# fix for issue 7632, bug 2), and fixed in r77482.
'28639097178261763178489759107321392745108491825303e-311',
@@ -380,6 +387,13 @@ class StrtodTests(unittest.TestCase):
'999999999999999944488848768742172978818416595458984375e-54',
'9999999999999999444888487687421729788184165954589843749999999e-54',
'9999999999999999444888487687421729788184165954589843750000001e-54',
+ # Value found by Rick Regan that gives a result of 2**-968
+ # under Gay's dtoa.c (as of Nov 04, 2010); since fixed.
+ # (Fixed some time ago in Python's dtoa.c.)
+ '0.0000000000000000000000000000000000000000100000000' #...
+ '000000000576129113423785429971690421191214034235435' #...
+ '087147763178149762956868991692289869941246658073194' #...
+ '51982237978882039897143840789794921875',
]
for s in test_strings:
self.check_strtod(s)
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 9ed3220e8b..2ccaad29c0 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -8,6 +8,18 @@ from test.support import run_unittest
ISBIGENDIAN = sys.byteorder == "big"
IS32BIT = sys.maxsize == 0x7fffffff
+integer_codes = 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q'
+byteorders = '', '@', '=', '<', '>', '!'
+
+# Native 'q' packing isn't available on systems that don't have the C
+# long long type.
+try:
+ struct.pack('q', 5)
+except struct.error:
+ HAVE_LONG_LONG = False
+else:
+ HAVE_LONG_LONG = True
+
def string_reverse(s):
return s[::-1]
@@ -35,8 +47,8 @@ class StructTest(unittest.TestCase):
self.assertRaises(struct.error, struct.pack, 'iii', 3)
self.assertRaises(struct.error, struct.pack, 'i', 3, 3, 3)
- self.assertRaises(struct.error, struct.pack, 'i', 'foo')
- self.assertRaises(struct.error, struct.pack, 'P', 'foo')
+ self.assertRaises((TypeError, struct.error), struct.pack, 'i', 'foo')
+ self.assertRaises((TypeError, struct.error), struct.pack, 'P', 'foo')
self.assertRaises(struct.error, struct.unpack, 'd', b'flap')
s = struct.pack('ii', 1, 2)
self.assertRaises(struct.error, struct.unpack, 'iii', s)
@@ -70,177 +82,139 @@ class StructTest(unittest.TestCase):
# Test some of the new features in detail
# (format, argument, big-endian result, little-endian result, asymmetric)
tests = [
- ('c', 'a', 'a', 'a', 0),
- ('xc', 'a', '\0a', '\0a', 0),
- ('cx', 'a', 'a\0', 'a\0', 0),
- ('s', 'a', 'a', 'a', 0),
- ('0s', 'helloworld', '', '', 1),
- ('1s', 'helloworld', 'h', 'h', 1),
- ('9s', 'helloworld', 'helloworl', 'helloworl', 1),
- ('10s', 'helloworld', 'helloworld', 'helloworld', 0),
- ('11s', 'helloworld', 'helloworld\0', 'helloworld\0', 1),
- ('20s', 'helloworld', 'helloworld'+10*'\0', 'helloworld'+10*'\0', 1),
- ('b', 7, '\7', '\7', 0),
- ('b', -7, '\371', '\371', 0),
- ('B', 7, '\7', '\7', 0),
- ('B', 249, '\371', '\371', 0),
- ('h', 700, '\002\274', '\274\002', 0),
- ('h', -700, '\375D', 'D\375', 0),
- ('H', 700, '\002\274', '\274\002', 0),
- ('H', 0x10000-700, '\375D', 'D\375', 0),
- ('i', 70000000, '\004,\035\200', '\200\035,\004', 0),
- ('i', -70000000, '\373\323\342\200', '\200\342\323\373', 0),
- ('I', 70000000, '\004,\035\200', '\200\035,\004', 0),
- ('I', 0x100000000-70000000, '\373\323\342\200', '\200\342\323\373', 0),
- ('l', 70000000, '\004,\035\200', '\200\035,\004', 0),
- ('l', -70000000, '\373\323\342\200', '\200\342\323\373', 0),
- ('L', 70000000, '\004,\035\200', '\200\035,\004', 0),
- ('L', 0x100000000-70000000, '\373\323\342\200', '\200\342\323\373', 0),
- ('f', 2.0, '@\000\000\000', '\000\000\000@', 0),
- ('d', 2.0, '@\000\000\000\000\000\000\000',
- '\000\000\000\000\000\000\000@', 0),
- ('f', -2.0, '\300\000\000\000', '\000\000\000\300', 0),
- ('d', -2.0, '\300\000\000\000\000\000\000\000',
- '\000\000\000\000\000\000\000\300', 0),
- ('?', 0, '\0', '\0', 0),
- ('?', 3, '\1', '\1', 1),
- ('?', True, '\1', '\1', 0),
- ('?', [], '\0', '\0', 1),
- ('?', (1,), '\1', '\1', 1),
+ ('c', b'a', b'a', b'a', 0),
+ ('xc', b'a', b'\0a', b'\0a', 0),
+ ('cx', b'a', b'a\0', b'a\0', 0),
+ ('s', b'a', b'a', b'a', 0),
+ ('0s', b'helloworld', b'', b'', 1),
+ ('1s', b'helloworld', b'h', b'h', 1),
+ ('9s', b'helloworld', b'helloworl', b'helloworl', 1),
+ ('10s', b'helloworld', b'helloworld', b'helloworld', 0),
+ ('11s', b'helloworld', b'helloworld\0', b'helloworld\0', 1),
+ ('20s', b'helloworld', b'helloworld'+10*b'\0', b'helloworld'+10*b'\0', 1),
+ ('b', 7, b'\7', b'\7', 0),
+ ('b', -7, b'\371', b'\371', 0),
+ ('B', 7, b'\7', b'\7', 0),
+ ('B', 249, b'\371', b'\371', 0),
+ ('h', 700, b'\002\274', b'\274\002', 0),
+ ('h', -700, b'\375D', b'D\375', 0),
+ ('H', 700, b'\002\274', b'\274\002', 0),
+ ('H', 0x10000-700, b'\375D', b'D\375', 0),
+ ('i', 70000000, b'\004,\035\200', b'\200\035,\004', 0),
+ ('i', -70000000, b'\373\323\342\200', b'\200\342\323\373', 0),
+ ('I', 70000000, b'\004,\035\200', b'\200\035,\004', 0),
+ ('I', 0x100000000-70000000, b'\373\323\342\200', b'\200\342\323\373', 0),
+ ('l', 70000000, b'\004,\035\200', b'\200\035,\004', 0),
+ ('l', -70000000, b'\373\323\342\200', b'\200\342\323\373', 0),
+ ('L', 70000000, b'\004,\035\200', b'\200\035,\004', 0),
+ ('L', 0x100000000-70000000, b'\373\323\342\200', b'\200\342\323\373', 0),
+ ('f', 2.0, b'@\000\000\000', b'\000\000\000@', 0),
+ ('d', 2.0, b'@\000\000\000\000\000\000\000',
+ b'\000\000\000\000\000\000\000@', 0),
+ ('f', -2.0, b'\300\000\000\000', b'\000\000\000\300', 0),
+ ('d', -2.0, b'\300\000\000\000\000\000\000\000',
+ b'\000\000\000\000\000\000\000\300', 0),
+ ('?', 0, b'\0', b'\0', 0),
+ ('?', 3, b'\1', b'\1', 1),
+ ('?', True, b'\1', b'\1', 0),
+ ('?', [], b'\0', b'\0', 1),
+ ('?', (1,), b'\1', b'\1', 1),
]
for fmt, arg, big, lil, asy in tests:
- big = bytes(big, "latin-1")
- lil = bytes(lil, "latin-1")
for (xfmt, exp) in [('>'+fmt, big), ('!'+fmt, big), ('<'+fmt, lil),
('='+fmt, ISBIGENDIAN and big or lil)]:
res = struct.pack(xfmt, arg)
self.assertEqual(res, exp)
self.assertEqual(struct.calcsize(xfmt), len(res))
rev = struct.unpack(xfmt, res)[0]
- if isinstance(arg, str):
- # Strings are returned as bytes since you can't know the
- # encoding of the string when packed.
- arg = bytes(arg, 'latin1')
if rev != arg:
self.assertTrue(asy)
- def test_native_qQ(self):
- # can't pack -1 as unsigned regardless
- self.assertRaises((struct.error, OverflowError), struct.pack, "Q", -1)
- # can't pack string as 'q' regardless
- self.assertRaises(struct.error, struct.pack, "q", "a")
- # ditto, but 'Q'
- self.assertRaises(struct.error, struct.pack, "Q", "a")
-
- try:
- struct.pack("q", 5)
- except struct.error:
- # does not have native q/Q
- pass
- else:
- nbytes = struct.calcsize('q')
- # The expected values here are in big-endian format, primarily
- # because I'm on a little-endian machine and so this is the
- # clearest way (for me) to force the code to get exercised.
- for format, input, expected in (
- ('q', -1, '\xff' * nbytes),
- ('q', 0, '\x00' * nbytes),
- ('Q', 0, '\x00' * nbytes),
- ('q', 1, '\x00' * (nbytes-1) + '\x01'),
- ('Q', (1 << (8*nbytes))-1, '\xff' * nbytes),
- ('q', (1 << (8*nbytes-1))-1, '\x7f' + '\xff' * (nbytes - 1))):
- expected = bytes(expected, "latin-1")
- got = struct.pack(format, input)
- native_expected = bigendian_to_native(expected)
- self.assertEqual(got, native_expected)
- retrieved = struct.unpack(format, got)[0]
- self.assertEqual(retrieved, input)
-
- def test_standard_integers(self):
- # Standard integer tests (bBhHiIlLqQ).
+ def test_calcsize(self):
+ expected_size = {
+ 'b': 1, 'B': 1,
+ 'h': 2, 'H': 2,
+ 'i': 4, 'I': 4,
+ 'l': 4, 'L': 4,
+ 'q': 8, 'Q': 8,
+ }
+
+ # standard integer sizes
+ for code in integer_codes:
+ for byteorder in '=', '<', '>', '!':
+ format = byteorder+code
+ size = struct.calcsize(format)
+ self.assertEqual(size, expected_size[code])
+
+ # native integer sizes
+ native_pairs = 'bB', 'hH', 'iI', 'lL'
+ if HAVE_LONG_LONG:
+ native_pairs += 'qQ',
+ for format_pair in native_pairs:
+ for byteorder in '', '@':
+ signed_size = struct.calcsize(byteorder + format_pair[0])
+ unsigned_size = struct.calcsize(byteorder + format_pair[1])
+ self.assertEqual(signed_size, unsigned_size)
+
+ # bounds for native integer sizes
+ self.assertEqual(struct.calcsize('b'), 1)
+ self.assertLessEqual(2, struct.calcsize('h'))
+ self.assertLessEqual(4, struct.calcsize('l'))
+ self.assertLessEqual(struct.calcsize('h'), struct.calcsize('i'))
+ self.assertLessEqual(struct.calcsize('i'), struct.calcsize('l'))
+ if HAVE_LONG_LONG:
+ self.assertLessEqual(8, struct.calcsize('q'))
+ self.assertLessEqual(struct.calcsize('l'), struct.calcsize('q'))
+
+ def test_integers(self):
+ # Integer tests (bBhHiIlLqQ).
import binascii
class IntTester(unittest.TestCase):
-
- def __init__(self, formatpair, bytesize):
+ def __init__(self, format):
super(IntTester, self).__init__(methodName='test_one')
- self.assertEqual(len(formatpair), 2)
- self.formatpair = formatpair
- for direction in "<>!=":
- for code in formatpair:
- format = direction + code
- self.assertEqual(struct.calcsize(format), bytesize)
- self.bytesize = bytesize
- self.bitsize = bytesize * 8
- self.signed_code, self.unsigned_code = formatpair
- self.unsigned_min = 0
- self.unsigned_max = 2**self.bitsize - 1
- self.signed_min = -(2**(self.bitsize-1))
- self.signed_max = 2**(self.bitsize-1) - 1
+ self.format = format
+ self.code = format[-1]
+ self.byteorder = format[:-1]
+ if not self.byteorder in byteorders:
+ raise ValueError("unrecognized packing byteorder: %s" %
+ self.byteorder)
+ self.bytesize = struct.calcsize(format)
+ self.bitsize = self.bytesize * 8
+ if self.code in tuple('bhilq'):
+ self.signed = True
+ self.min_value = -(2**(self.bitsize-1))
+ self.max_value = 2**(self.bitsize-1) - 1
+ elif self.code in tuple('BHILQ'):
+ self.signed = False
+ self.min_value = 0
+ self.max_value = 2**self.bitsize - 1
+ else:
+ raise ValueError("unrecognized format code: %s" %
+ self.code)
def test_one(self, x, pack=struct.pack,
unpack=struct.unpack,
unhexlify=binascii.unhexlify):
- # Try signed.
- code = self.signed_code
- if self.signed_min <= x <= self.signed_max:
- # Try big-endian.
- expected = x
- if x < 0:
- expected += 1 << self.bitsize
- self.assertTrue(expected > 0)
- expected = hex(expected)[2:] # chop "0x"
- if len(expected) & 1:
- expected = "0" + expected
- expected = unhexlify(expected)
- expected = b"\x00" * (self.bytesize - len(expected)) + expected
-
- # Pack work?
- format = ">" + code
- got = pack(format, x)
- self.assertEqual(got, expected)
-
- # Unpack work?
- retrieved = unpack(format, got)[0]
- self.assertEqual(x, retrieved)
- # Adding any byte should cause a "too big" error.
- self.assertRaises((struct.error, TypeError),
- unpack, format, b'\x01' + got)
-
- # Try little-endian.
- format = "<" + code
- expected = string_reverse(expected)
-
- # Pack work?
- got = pack(format, x)
- self.assertEqual(got, expected)
-
- # Unpack work?
- retrieved = unpack(format, got)[0]
- self.assertEqual(x, retrieved)
-
- # Adding any byte should cause a "too big" error.
- self.assertRaises((struct.error, TypeError),
- unpack, format, b'\x01' + got)
-
- else:
- # x is out of range -- verify pack realizes that.
- self.assertRaises(struct.error, pack, ">" + code, x)
- self.assertRaises(struct.error, pack, "<" + code, x)
-
- # Much the same for unsigned.
- code = self.unsigned_code
- if self.unsigned_min <= x <= self.unsigned_max:
- # Try big-endian.
- format = ">" + code
+ format = self.format
+ if self.min_value <= x <= self.max_value:
expected = x
- expected = hex(expected)[2:] # chop "0x"
+ if self.signed and x < 0:
+ expected += 1 << self.bitsize
+ self.assertGreaterEqual(expected, 0)
+ expected = '%x' % expected
if len(expected) & 1:
expected = "0" + expected
+ expected = expected.encode('ascii')
expected = unhexlify(expected)
- expected = b"\x00" * (self.bytesize - len(expected)) + expected
+ expected = (b"\x00" * (self.bytesize - len(expected)) +
+ expected)
+ if (self.byteorder == '<' or
+ self.byteorder in ('', '@', '=') and not ISBIGENDIAN):
+ expected = string_reverse(expected)
+ self.assertEqual(len(expected), self.bytesize)
# Pack work?
got = pack(format, x)
@@ -251,29 +225,12 @@ class StructTest(unittest.TestCase):
self.assertEqual(x, retrieved)
# Adding any byte should cause a "too big" error.
- self.assertRaises((struct.error, TypeError),
- unpack, format, b'\x01' + got)
-
- # Try little-endian.
- format = "<" + code
- expected = string_reverse(expected)
-
- # Pack work?
- got = pack(format, x)
- self.assertEqual(got, expected)
-
- # Unpack work?
- retrieved = unpack(format, got)[0]
- self.assertEqual(x, retrieved)
-
- # Adding any byte should cause a "too big" error.
- self.assertRaises((struct.error, TypeError),
- unpack, format, b'\x01' + got)
-
+ self.assertRaises((struct.error, TypeError), unpack, format,
+ b'\x01' + got)
else:
# x is out of range -- verify pack realizes that.
- self.assertRaises(struct.error, pack, ">" + code, x)
- self.assertRaises(struct.error, pack, "<" + code, x)
+ self.assertRaises((OverflowError, ValueError, struct.error),
+ pack, format, x)
def run(self):
from random import randrange
@@ -290,47 +247,95 @@ class StructTest(unittest.TestCase):
val = (val << 8) | randrange(256)
values.append(val)
- # Try all those, and their negations, and +-1 from them. Note
- # that this tests all power-of-2 boundaries in range, and a few out
- # of range, plus +-(2**n +- 1).
+ # Values absorbed from other tests
+ values.extend([300, 700000, sys.maxsize*4])
+
+ # Try all those, and their negations, and +-1 from
+ # them. Note that this tests all power-of-2
+ # boundaries in range, and a few out of range, plus
+ # +-(2**n +- 1).
for base in values:
for val in -base, base:
for incr in -1, 0, 1:
x = val + incr
- try:
- x = int(x)
- except OverflowError:
- pass
self.test_one(x)
# Some error cases.
- for direction in "<>":
- for code in self.formatpair:
- for badobject in "a string", 3+42j, randrange, -1729.0:
- self.assertRaises(struct.error,
- struct.pack, direction + code,
- badobject)
-
- for args in [("bB", 1),
- ("hH", 2),
- ("iI", 4),
- ("lL", 4),
- ("qQ", 8)]:
- t = IntTester(*args)
- t.run()
+ class NotAnInt:
+ def __int__(self):
+ return 42
+
+ # Objects with an '__index__' method should be allowed
+ # to pack as integers. That is assuming the implemented
+ # '__index__' method returns and 'int' or 'long'.
+ class Indexable(object):
+ def __init__(self, value):
+ self._value = value
+
+ def __index__(self):
+ return self._value
+
+ # If the '__index__' method raises a type error, then
+ # '__int__' should be used with a deprecation warning.
+ class BadIndex(object):
+ def __index__(self):
+ raise TypeError
+
+ def __int__(self):
+ return 42
+
+ self.assertRaises((TypeError, struct.error),
+ struct.pack, self.format,
+ "a string")
+ self.assertRaises((TypeError, struct.error),
+ struct.pack, self.format,
+ randrange)
+ self.assertRaises((TypeError, struct.error),
+ struct.pack, self.format,
+ 3+42j)
+ self.assertRaises((TypeError, struct.error),
+ struct.pack, self.format,
+ NotAnInt())
+ self.assertRaises((TypeError, struct.error),
+ struct.pack, self.format,
+ BadIndex())
+
+ # Check for legitimate values from '__index__'.
+ for obj in (Indexable(0), Indexable(10), Indexable(17),
+ Indexable(42), Indexable(100), Indexable(127)):
+ try:
+ struct.pack(format, obj)
+ except:
+ self.fail("integer code pack failed on object "
+ "with '__index__' method")
+
+ # Check for bogus values from '__index__'.
+ for obj in (Indexable(b'a'), Indexable('b'), Indexable(None),
+ Indexable({'a': 1}), Indexable([1, 2, 3])):
+ self.assertRaises((TypeError, struct.error),
+ struct.pack, self.format,
+ obj)
+
+ for code in integer_codes:
+ for byteorder in byteorders:
+ if (byteorder in ('', '@') and code in ('q', 'Q') and
+ not HAVE_LONG_LONG):
+ continue
+ format = byteorder+code
+ t = IntTester(format)
+ t.run()
def test_p_code(self):
# Test p ("Pascal string") code.
for code, input, expected, expectedback in [
- ('p','abc', '\x00', b''),
- ('1p', 'abc', '\x00', b''),
- ('2p', 'abc', '\x01a', b'a'),
- ('3p', 'abc', '\x02ab', b'ab'),
- ('4p', 'abc', '\x03abc', b'abc'),
- ('5p', 'abc', '\x03abc\x00', b'abc'),
- ('6p', 'abc', '\x03abc\x00\x00', b'abc'),
- ('1000p', 'x'*1000, '\xff' + 'x'*999, b'x'*255)]:
- expected = bytes(expected, "latin-1")
+ ('p', b'abc', b'\x00', b''),
+ ('1p', b'abc', b'\x00', b''),
+ ('2p', b'abc', b'\x01a', b'a'),
+ ('3p', b'abc', b'\x02ab', b'ab'),
+ ('4p', b'abc', b'\x03abc', b'abc'),
+ ('5p', b'abc', b'\x03abc\x00', b'abc'),
+ ('6p', b'abc', b'\x03abc\x00\x00', b'abc'),
+ ('1000p', b'x'*1000, b'\xff' + b'x'*999, b'x'*255)]:
got = struct.pack(code, input)
self.assertEqual(got, expected)
(got,) = struct.unpack(code, got)
@@ -371,48 +376,29 @@ class StructTest(unittest.TestCase):
big = math.ldexp(big, 127 - 24)
self.assertRaises(OverflowError, struct.pack, ">f", big)
- def test_1229380(self):
- # SF bug 1229380. No struct.pack exception for some out of
- # range integers
- for endian in ('', '>', '<'):
- for fmt in ('B', 'H', 'I', 'L'):
- self.assertRaises((struct.error, OverflowError), struct.pack,
- endian + fmt, -1)
-
- self.assertRaises((struct.error, OverflowError), struct.pack,
- endian + 'B', 300)
- self.assertRaises((struct.error, OverflowError), struct.pack,
- endian + 'H', 70000)
-
- self.assertRaises((struct.error, OverflowError), struct.pack,
- endian + 'I', sys.maxsize * 4)
- self.assertRaises((struct.error, OverflowError), struct.pack,
- endian + 'L', sys.maxsize * 4)
-
def test_1530559(self):
- for endian in ('', '>', '<'):
- for fmt in ('B', 'H', 'I', 'L', 'Q', 'b', 'h', 'i', 'l', 'q'):
- self.assertRaises(struct.error, struct.pack, endian + fmt, 1.0)
- self.assertRaises(struct.error, struct.pack, endian + fmt, 1.5)
+ for byteorder in '', '@', '=', '<', '>', '!':
+ for code in integer_codes:
+ if (byteorder in ('', '@') and code in ('q', 'Q') and
+ not HAVE_LONG_LONG):
+ continue
+ format = byteorder + code
+ self.assertRaises(struct.error, struct.pack, format, 1.0)
+ self.assertRaises(struct.error, struct.pack, format, 1.5)
self.assertRaises(struct.error, struct.pack, 'P', 1.0)
self.assertRaises(struct.error, struct.pack, 'P', 1.5)
-
def test_unpack_from(self):
test_string = b'abcd01234'
fmt = '4s'
s = struct.Struct(fmt)
for cls in (bytes, bytearray):
data = cls(test_string)
- if not isinstance(data, (bytes, bytearray)):
- bytes_data = bytes(data, 'latin1')
- else:
- bytes_data = data
self.assertEqual(s.unpack_from(data), (b'abcd',))
self.assertEqual(s.unpack_from(data, 2), (b'cd01',))
self.assertEqual(s.unpack_from(data, 4), (b'0123',))
for i in range(6):
- self.assertEqual(s.unpack_from(data, i), (bytes_data[i:i+4],))
+ self.assertEqual(s.unpack_from(data, i), (data[i:i+4],))
for i in range(6, len(test_string) + 1):
self.assertRaises(struct.error, s.unpack_from, data, i)
for cls in (bytes, bytearray):
@@ -433,12 +419,12 @@ class StructTest(unittest.TestCase):
# Test without offset
s.pack_into(writable_buf, 0, test_string)
- from_buf = writable_buf.tostring()[:len(test_string)]
+ from_buf = writable_buf.tobytes()[:len(test_string)]
self.assertEqual(from_buf, test_string)
# Test with offset.
s.pack_into(writable_buf, 10, test_string)
- from_buf = writable_buf.tostring()[:len(test_string)+10]
+ from_buf = writable_buf.tobytes()[:len(test_string)+10]
self.assertEqual(from_buf, test_string[:10] + test_string)
# Go beyond boundaries.
@@ -450,7 +436,8 @@ class StructTest(unittest.TestCase):
# Test bogus offset (issue 3694)
sb = small_buf
- self.assertRaises(TypeError, struct.pack_into, b'1', sb, None)
+ self.assertRaises((TypeError, struct.error), struct.pack_into, b'', sb,
+ None)
def test_pack_into_fn(self):
test_string = b'Reykjavik rocks, eow!'
@@ -460,12 +447,12 @@ class StructTest(unittest.TestCase):
# Test without offset.
pack_into(writable_buf, 0, test_string)
- from_buf = writable_buf.tostring()[:len(test_string)]
+ from_buf = writable_buf.tobytes()[:len(test_string)]
self.assertEqual(from_buf, test_string)
# Test with offset.
pack_into(writable_buf, 10, test_string)
- from_buf = writable_buf.tostring()[:len(test_string)+10]
+ from_buf = writable_buf.tobytes()[:len(test_string)+10]
self.assertEqual(from_buf, test_string[:10] + test_string)
# Go beyond boundaries.
@@ -515,8 +502,13 @@ class StructTest(unittest.TestCase):
self.assertFalse(prefix, msg='encoded bool is not one byte: %r'
%packed)
- self.assertRaises(IOError, struct.pack, prefix + '?',
- ExplodingBool())
+ try:
+ struct.pack(prefix + '?', ExplodingBool())
+ except IOError:
+ pass
+ else:
+ self.fail("Expected IOError: struct.pack(%r, "
+ "ExplodingBool())" % (prefix + '?'))
for c in [b'\x01', b'\x7f', b'\xff', b'\x0f', b'\xf0']:
self.assertTrue(struct.unpack('>?', c)[0])
@@ -532,6 +524,37 @@ class StructTest(unittest.TestCase):
def test_crasher(self):
self.assertRaises(MemoryError, struct.pack, "357913941b", "a")
+ def test_trailing_counter(self):
+ store = array.array('b', b' '*100)
+
+ # format lists containing only count spec should result in an error
+ self.assertRaises(struct.error, struct.pack, '12345')
+ self.assertRaises(struct.error, struct.unpack, '12345', '')
+ self.assertRaises(struct.error, struct.pack_into, '12345', store, 0)
+ self.assertRaises(struct.error, struct.unpack_from, '12345', store, 0)
+
+ # Format lists with trailing count spec should result in an error
+ self.assertRaises(struct.error, struct.pack, 'c12345', 'x')
+ self.assertRaises(struct.error, struct.unpack, 'c12345', 'x')
+ self.assertRaises(struct.error, struct.pack_into, 'c12345', store, 0,
+ 'x')
+ self.assertRaises(struct.error, struct.unpack_from, 'c12345', store,
+ 0)
+
+ # Mixed format tests
+ self.assertRaises(struct.error, struct.pack, '14s42', 'spam and eggs')
+ self.assertRaises(struct.error, struct.unpack, '14s42',
+ 'spam and eggs')
+ self.assertRaises(struct.error, struct.pack_into, '14s42', store, 0,
+ 'spam and eggs')
+ self.assertRaises(struct.error, struct.unpack_from, '14s42', store, 0)
+
+ def test_Struct_reinitialization(self):
+ # Issue 9422: there was a memory leak when reinitializing a
+ # Struct instance. This test can be used to detect the leak
+ # when running with regrtest -L.
+ s = struct.Struct('i')
+ s.__init__('ii')
def test_main():
run_unittest(StructTest)
diff --git a/Lib/test/test_structmembers.py b/Lib/test/test_structmembers.py
index 41bcac9163..18fecc3829 100644
--- a/Lib/test/test_structmembers.py
+++ b/Lib/test/test_structmembers.py
@@ -6,7 +6,7 @@ from _testcapi import _test_structmembersType, \
LLONG_MAX, LLONG_MIN, ULLONG_MAX, \
PY_SSIZE_T_MAX, PY_SSIZE_T_MIN
-import warnings, unittest, sys
+import unittest
from test import support
ts=_test_structmembersType(False, # T_BOOL
@@ -112,39 +112,30 @@ class ReadWriteTests(unittest.TestCase):
class TestWarnings(unittest.TestCase):
- def has_warned(self, w):
- self.assertEqual(w.category, RuntimeWarning)
def test_byte_max(self):
- with support.check_warnings() as w:
+ with support.check_warnings(('', RuntimeWarning)):
ts.T_BYTE = CHAR_MAX+1
- self.has_warned(w)
def test_byte_min(self):
- with support.check_warnings() as w:
+ with support.check_warnings(('', RuntimeWarning)):
ts.T_BYTE = CHAR_MIN-1
- self.has_warned(w)
def test_ubyte_max(self):
- with support.check_warnings() as w:
+ with support.check_warnings(('', RuntimeWarning)):
ts.T_UBYTE = UCHAR_MAX+1
- self.has_warned(w)
def test_short_max(self):
- with support.check_warnings() as w:
+ with support.check_warnings(('', RuntimeWarning)):
ts.T_SHORT = SHRT_MAX+1
- self.has_warned(w)
def test_short_min(self):
- with support.check_warnings() as w:
+ with support.check_warnings(('', RuntimeWarning)):
ts.T_SHORT = SHRT_MIN-1
- self.has_warned(w)
def test_ushort_max(self):
- with support.check_warnings() as w:
+ with support.check_warnings(('', RuntimeWarning)):
ts.T_USHORT = USHRT_MAX+1
- self.has_warned(w)
-
def test_main(verbose=None):
diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py
index 7adca53400..d6c63b792f 100644
--- a/Lib/test/test_structseq.py
+++ b/Lib/test/test_structseq.py
@@ -1,12 +1,14 @@
+import os
+import time
import unittest
from test import support
-import time
class StructSeqTest(unittest.TestCase):
def test_tuple(self):
t = time.gmtime()
+ self.assertIsInstance(t, tuple)
astuple = tuple(t)
self.assertEqual(len(t), len(astuple))
self.assertEqual(t, astuple)
@@ -33,6 +35,13 @@ class StructSeqTest(unittest.TestCase):
self.assertEqual(repr(t),
"time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, "
"tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)")
+ # os.stat() gives a complicated struct sequence.
+ st = os.stat(__file__)
+ rep = repr(st)
+ self.assertTrue(rep.startswith(os.name + ".stat_result"))
+ self.assertIn("st_mode=", rep)
+ self.assertIn("st_ino=", rep)
+ self.assertIn("st_dev=", rep)
def test_concat(self):
t1 = time.gmtime()
@@ -50,8 +59,8 @@ class StructSeqTest(unittest.TestCase):
def test_contains(self):
t1 = time.gmtime()
for item in t1:
- self.assertTrue(item in t1)
- self.assertTrue(-42 not in t1)
+ self.assertIn(item, t1)
+ self.assertNotIn(-42, t1)
def test_hash(self):
t1 = time.gmtime()
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 20b72e69ce..4ec754c8aa 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -3,12 +3,20 @@ from test import support
import subprocess
import sys
import signal
+import io
import os
import errno
import tempfile
import time
import re
+import sysconfig
+import warnings
+import select
import shutil
+try:
+ import gc
+except ImportError:
+ gc = None
mswindows = (sys.platform == "win32")
@@ -22,38 +30,39 @@ if mswindows:
else:
SETBINARY = ''
-# In a debug build, stuff like "[6580 refs]" is printed to stderr at
-# shutdown time. That frustrates tests trying to check stderr produced
-# from a spawned Python process.
-def remove_stderr_debug_decorations(stderr):
- return re.sub("\[\d+ refs\]\r?\n?$", "", stderr.decode()).encode()
- #return re.sub(r"\[\d+ refs\]\r?\n?$", "", stderr)
+
+try:
+ mkstemp = tempfile.mkstemp
+except AttributeError:
+ # tempfile.mkstemp is not available
+ def mkstemp():
+ """Replacement for mkstemp, calling mktemp."""
+ fname = tempfile.mktemp()
+ return os.open(fname, os.O_RDWR|os.O_CREAT), fname
+
class BaseTestCase(unittest.TestCase):
def setUp(self):
# Try to minimize the number of children we have so this test
# doesn't crash on some buildbots (Alphas in particular).
- if hasattr(support, "reap_children"):
- support.reap_children()
+ support.reap_children()
def tearDown(self):
- # Try to minimize the number of children we have so this test
- # doesn't crash on some buildbots (Alphas in particular).
- if hasattr(support, "reap_children"):
- support.reap_children()
+ for inst in subprocess._active:
+ inst.wait()
+ subprocess._cleanup()
+ self.assertFalse(subprocess._active, "subprocess._active not empty")
+
+ def assertStderrEqual(self, stderr, expected, msg=None):
+ # In a debug build, stuff like "[6580 refs]" is printed to stderr at
+ # shutdown time. That frustrates tests trying to check stderr produced
+ # from a spawned Python process.
+ actual = support.strip_python_stderr(stderr)
+ self.assertEqual(actual, expected, msg)
- def mkstemp(self, *args, **kwargs):
- """wrapper for mkstemp, calling mktemp if mkstemp is not available"""
- if hasattr(tempfile, "mkstemp"):
- return tempfile.mkstemp(*args, **kwargs)
- else:
- fname = tempfile.mktemp(*args, **kwargs)
- return os.open(fname, os.O_RDWR|os.O_CREAT), fname
class ProcessTestCase(BaseTestCase):
- #
- # Generic tests
- #
+
def test_call_seq(self):
# call() function with sequence argument
rc = subprocess.call([sys.executable, "-c",
@@ -68,47 +77,39 @@ class ProcessTestCase(BaseTestCase):
def test_check_call_nonzero(self):
# check_call() function with non-zero return code
- try:
+ with self.assertRaises(subprocess.CalledProcessError) as c:
subprocess.check_call([sys.executable, "-c",
"import sys; sys.exit(47)"])
- except subprocess.CalledProcessError as e:
- self.assertEqual(e.returncode, 47)
- else:
- self.fail("Expected CalledProcessError")
+ self.assertEqual(c.exception.returncode, 47)
def test_check_output(self):
# check_output() function with zero return code
output = subprocess.check_output(
[sys.executable, "-c", "print('BDFL')"])
- self.assertTrue(b'BDFL' in output)
+ self.assertIn(b'BDFL', output)
def test_check_output_nonzero(self):
# check_call() function with non-zero return code
- try:
+ with self.assertRaises(subprocess.CalledProcessError) as c:
subprocess.check_output(
[sys.executable, "-c", "import sys; sys.exit(5)"])
- except subprocess.CalledProcessError as e:
- self.assertEqual(e.returncode, 5)
- else:
- self.fail("Expected CalledProcessError")
+ self.assertEqual(c.exception.returncode, 5)
def test_check_output_stderr(self):
# check_output() function stderr redirected to stdout
output = subprocess.check_output(
[sys.executable, "-c", "import sys; sys.stderr.write('BDFL')"],
stderr=subprocess.STDOUT)
- self.assertTrue(b'BDFL' in output)
+ self.assertIn(b'BDFL', output)
def test_check_output_stdout_arg(self):
# check_output() function stderr redirected to stdout
- try:
+ with self.assertRaises(ValueError) as c:
output = subprocess.check_output(
[sys.executable, "-c", "print('will not be run')"],
stdout=sys.stdout)
- except ValueError as e:
- self.assertTrue('stdout' in e.args[0])
- else:
self.fail("Expected ValueError when stdout arg supplied.")
+ self.assertIn('stdout', c.exception.args[0])
def test_call_kwargs(self):
# call() function with keyword args
@@ -124,6 +125,8 @@ class ProcessTestCase(BaseTestCase):
# .stdin is None when not redirected
p = subprocess.Popen([sys.executable, "-c", 'print("banana")'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
p.wait()
self.assertEqual(p.stdin, None)
@@ -134,6 +137,8 @@ class ProcessTestCase(BaseTestCase):
'test of stdout in a different '
'process ...")'],
stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+ self.addCleanup(p.stdin.close)
+ self.addCleanup(p.stderr.close)
p.wait()
self.assertEqual(p.stdout, None)
@@ -141,13 +146,26 @@ class ProcessTestCase(BaseTestCase):
# .stderr is None when not redirected
p = subprocess.Popen([sys.executable, "-c", 'print("banana")'],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stdin.close)
p.wait()
self.assertEqual(p.stderr, None)
- def test_executable(self):
- arg0 = os.path.join(os.path.dirname(sys.executable),
- "somethingyoudonthave")
- p = subprocess.Popen([arg0, "-c", "import sys; sys.exit(47)"],
+ def test_executable_with_cwd(self):
+ python_dir = os.path.dirname(os.path.realpath(sys.executable))
+ p = subprocess.Popen(["somethingyoudonthave", "-c",
+ "import sys; sys.exit(47)"],
+ executable=sys.executable, cwd=python_dir)
+ p.wait()
+ self.assertEqual(p.returncode, 47)
+
+ @unittest.skipIf(sysconfig.is_python_build(),
+ "need an installed Python. See #7774")
+ def test_executable_without_cwd(self):
+ # For a normal installation, it should work without 'cwd'
+ # argument. For test runs in the build directory, see #7774.
+ p = subprocess.Popen(["somethingyoudonthave", "-c",
+ "import sys; sys.exit(47)"],
executable=sys.executable)
p.wait()
self.assertEqual(p.returncode, 47)
@@ -165,6 +183,7 @@ class ProcessTestCase(BaseTestCase):
def test_stdin_filedes(self):
# stdin is set to open file descriptor
tf = tempfile.TemporaryFile()
+ self.addCleanup(tf.close)
d = tf.fileno()
os.write(d, b"pear")
os.lseek(d, 0, 0)
@@ -177,6 +196,7 @@ class ProcessTestCase(BaseTestCase):
def test_stdin_fileobj(self):
# stdin is set to open file object
tf = tempfile.TemporaryFile()
+ self.addCleanup(tf.close)
tf.write(b"pear")
tf.seek(0)
p = subprocess.Popen([sys.executable, "-c",
@@ -190,11 +210,13 @@ class ProcessTestCase(BaseTestCase):
p = subprocess.Popen([sys.executable, "-c",
'import sys; sys.stdout.write("orange")'],
stdout=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
self.assertEqual(p.stdout.read(), b"orange")
def test_stdout_filedes(self):
# stdout is set to open file descriptor
tf = tempfile.TemporaryFile()
+ self.addCleanup(tf.close)
d = tf.fileno()
p = subprocess.Popen([sys.executable, "-c",
'import sys; sys.stdout.write("orange")'],
@@ -206,6 +228,7 @@ class ProcessTestCase(BaseTestCase):
def test_stdout_fileobj(self):
# stdout is set to open file object
tf = tempfile.TemporaryFile()
+ self.addCleanup(tf.close)
p = subprocess.Popen([sys.executable, "-c",
'import sys; sys.stdout.write("orange")'],
stdout=tf)
@@ -218,31 +241,31 @@ class ProcessTestCase(BaseTestCase):
p = subprocess.Popen([sys.executable, "-c",
'import sys; sys.stderr.write("strawberry")'],
stderr=subprocess.PIPE)
- self.assertEqual(remove_stderr_debug_decorations(p.stderr.read()),
- b"strawberry")
+ self.addCleanup(p.stderr.close)
+ self.assertStderrEqual(p.stderr.read(), b"strawberry")
def test_stderr_filedes(self):
# stderr is set to open file descriptor
tf = tempfile.TemporaryFile()
+ self.addCleanup(tf.close)
d = tf.fileno()
p = subprocess.Popen([sys.executable, "-c",
'import sys; sys.stderr.write("strawberry")'],
stderr=d)
p.wait()
os.lseek(d, 0, 0)
- self.assertEqual(remove_stderr_debug_decorations(os.read(d, 1024)),
- b"strawberry")
+ self.assertStderrEqual(os.read(d, 1024), b"strawberry")
def test_stderr_fileobj(self):
# stderr is set to open file object
tf = tempfile.TemporaryFile()
+ self.addCleanup(tf.close)
p = subprocess.Popen([sys.executable, "-c",
'import sys; sys.stderr.write("strawberry")'],
stderr=tf)
p.wait()
tf.seek(0)
- self.assertEqual(remove_stderr_debug_decorations(tf.read()),
- b"strawberry")
+ self.assertStderrEqual(tf.read(), b"strawberry")
def test_stdout_stderr_pipe(self):
# capture stdout and stderr to the same pipe
@@ -253,13 +276,13 @@ class ProcessTestCase(BaseTestCase):
'sys.stderr.write("orange")'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
- output = p.stdout.read()
- stripped = remove_stderr_debug_decorations(output)
- self.assertEqual(stripped, b"appleorange")
+ self.addCleanup(p.stdout.close)
+ self.assertStderrEqual(p.stdout.read(), b"appleorange")
def test_stdout_stderr_file(self):
# capture stdout and stderr to the same open file
tf = tempfile.TemporaryFile()
+ self.addCleanup(tf.close)
p = subprocess.Popen([sys.executable, "-c",
'import sys;'
'sys.stdout.write("apple");'
@@ -269,9 +292,7 @@ class ProcessTestCase(BaseTestCase):
stderr=tf)
p.wait()
tf.seek(0)
- output = tf.read()
- stripped = remove_stderr_debug_decorations(output)
- self.assertEqual(stripped, b"appleorange")
+ self.assertStderrEqual(tf.read(), b"appleorange")
def test_stdout_filedes_of_stdout(self):
# stdout is set to 1 (#1531862).
@@ -292,6 +313,7 @@ class ProcessTestCase(BaseTestCase):
'sys.stdout.write(os.getcwd())'],
stdout=subprocess.PIPE,
cwd=tmpdir)
+ self.addCleanup(p.stdout.close)
normcase = os.path.normcase
self.assertEqual(normcase(p.stdout.read().decode("utf-8")),
normcase(tmpdir))
@@ -304,6 +326,7 @@ class ProcessTestCase(BaseTestCase):
'sys.stdout.write(os.getenv("FRUIT"))'],
stdout=subprocess.PIPE,
env=newenv)
+ self.addCleanup(p.stdout.close)
self.assertEqual(p.stdout.read(), b"orange")
def test_communicate_stdin(self):
@@ -328,9 +351,7 @@ class ProcessTestCase(BaseTestCase):
stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate()
self.assertEqual(stdout, None)
- # When running with a pydebug build, the # of references is outputted
- # to stderr, so just check if stderr at least started with "pinapple"
- self.assertEqual(remove_stderr_debug_decorations(stderr), b"pineapple")
+ self.assertStderrEqual(stderr, b"pineapple")
def test_communicate(self):
p = subprocess.Popen([sys.executable, "-c",
@@ -340,26 +361,35 @@ class ProcessTestCase(BaseTestCase):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
(stdout, stderr) = p.communicate(b"banana")
self.assertEqual(stdout, b"banana")
- self.assertEqual(remove_stderr_debug_decorations(stderr),
- b"pineapple")
-
- # This test is Linux specific for simplicity to at least have
- # some coverage. It is not a platform specific bug.
- if os.path.isdir('/proc/%d/fd' % os.getpid()):
- # Test for the fd leak reported in http://bugs.python.org/issue2791.
- def test_communicate_pipe_fd_leak(self):
- fd_directory = '/proc/%d/fd' % os.getpid()
- num_fds_before_popen = len(os.listdir(fd_directory))
- p = subprocess.Popen([sys.executable, '-c', 'print()'],
- stdout=subprocess.PIPE)
- p.communicate()
- num_fds_after_communicate = len(os.listdir(fd_directory))
- del p
- num_fds_after_destruction = len(os.listdir(fd_directory))
- self.assertEqual(num_fds_before_popen, num_fds_after_destruction)
- self.assertEqual(num_fds_before_popen, num_fds_after_communicate)
+ self.assertStderrEqual(stderr, b"pineapple")
+
+ # Test for the fd leak reported in http://bugs.python.org/issue2791.
+ def test_communicate_pipe_fd_leak(self):
+ for stdin_pipe in (False, True):
+ for stdout_pipe in (False, True):
+ for stderr_pipe in (False, True):
+ options = {}
+ if stdin_pipe:
+ options['stdin'] = subprocess.PIPE
+ if stdout_pipe:
+ options['stdout'] = subprocess.PIPE
+ if stderr_pipe:
+ options['stderr'] = subprocess.PIPE
+ if not options:
+ continue
+ p = subprocess.Popen((sys.executable, "-c", "pass"), **options)
+ p.communicate()
+ if p.stdin is not None:
+ self.assertTrue(p.stdin.closed)
+ if p.stdout is not None:
+ self.assertTrue(p.stdout.closed)
+ if p.stderr is not None:
+ self.assertTrue(p.stderr.closed)
def test_communicate_returns(self):
# communicate() should return None if no redirection is active
@@ -388,6 +418,9 @@ class ProcessTestCase(BaseTestCase):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
string_to_write = b"abc"*pipe_buf
(stdout, stderr) = p.communicate(string_to_write)
self.assertEqual(stdout, string_to_write)
@@ -400,10 +433,13 @@ class ProcessTestCase(BaseTestCase):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
p.stdin.write(b"banana")
(stdout, stderr) = p.communicate(b"split")
self.assertEqual(stdout, b"bananasplit")
- self.assertEqual(remove_stderr_debug_decorations(stderr), b"")
+ self.assertStderrEqual(stderr, b"")
def test_universal_newlines(self):
p = subprocess.Popen([sys.executable, "-c",
@@ -421,6 +457,7 @@ class ProcessTestCase(BaseTestCase):
'sys.stdout.write("\\nline6");'],
stdout=subprocess.PIPE,
universal_newlines=1)
+ self.addCleanup(p.stdout.close)
stdout = p.stdout.read()
self.assertEqual(stdout, "line1\nline2\nline3\nline4\nline5\nline6")
@@ -441,6 +478,8 @@ class ProcessTestCase(BaseTestCase):
'sys.stdout.write("\\nline6");'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=1)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
(stdout, stderr) = p.communicate()
self.assertEqual(stdout, "line1\nline2\nline3\nline4\nline5\nline6")
@@ -513,7 +552,7 @@ class ProcessTestCase(BaseTestCase):
# but, based on system scheduling we can't control, it's possible
# poll() never returned None. It "should be" very rare that it
# didn't go around at least twice.
- self.assertTrue(count >= 2)
+ self.assertGreaterEqual(count, 2)
# Subsequent invocations should just return the returncode
self.assertEqual(p.poll(), 0)
@@ -529,12 +568,8 @@ class ProcessTestCase(BaseTestCase):
def test_invalid_bufsize(self):
# an invalid type of the bufsize argument should raise
# TypeError.
- try:
+ with self.assertRaises(TypeError):
subprocess.Popen([sys.executable, "-c", "pass"], "orange")
- except TypeError:
- pass
- else:
- self.fail("Expected TypeError")
def test_bufsize_is_none(self):
# bufsize=None should be the same as bufsize=0.
@@ -551,15 +586,14 @@ class ProcessTestCase(BaseTestCase):
# value for that limit, but Windows has 2048, so we loop
# 1024 times (each call leaked two fds).
for i in range(1024):
- try:
+ # Windows raises IOError. Others raise OSError.
+ with self.assertRaises(EnvironmentError) as c:
subprocess.Popen(['nonexisting_i_hope'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
- # Windows raises IOError
- except (IOError, OSError) as err:
- # ignore errors that indicate the command was not found
- if err.errno not in (errno.ENOENT, errno.EACCES):
- raise
+ # ignore errors that indicate the command was not found
+ if c.exception.errno not in (errno.ENOENT, errno.EACCES):
+ raise c.exception
def test_issue8780(self):
# Ensure that stdout is inherited from the parent
@@ -575,9 +609,9 @@ class ProcessTestCase(BaseTestCase):
def test_handles_closed_on_exception(self):
# If CreateProcess exits with an error, ensure the
# duplicate output handles are released
- ifhandle, ifname = self.mkstemp()
- ofhandle, ofname = self.mkstemp()
- efhandle, efname = self.mkstemp()
+ ifhandle, ifname = mkstemp()
+ ofhandle, ofname = mkstemp()
+ efhandle, efname = mkstemp()
try:
subprocess.Popen (["*"], stdin=ifhandle, stdout=ofhandle,
stderr=efhandle)
@@ -611,476 +645,769 @@ class ProcessTestCase(BaseTestCase):
time.sleep(2)
p.communicate(b"x" * 2**20)
- #
- # POSIX tests
- #
- if not mswindows:
- def test_exceptions(self):
- # caught & re-raised exceptions
- try:
- p = subprocess.Popen([sys.executable, "-c", ""],
- cwd="/this/path/does/not/exist")
- except OSError as e:
- # The attribute child_traceback should contain "os.chdir"
- # somewhere.
- self.assertNotEqual(e.child_traceback.find("os.chdir"), -1)
- else:
- self.fail("Expected OSError")
-
- def _suppress_core_files(self):
- """Try to prevent core files from being created.
- Returns previous ulimit if successful, else None.
- """
- if sys.platform == 'darwin':
- # Check if the 'Crash Reporter' on OSX was configured
- # in 'Developer' mode and warn that it will get triggered
- # when it is.
- #
- # This assumes that this context manager is used in tests
- # that might trigger the next manager.
- value = subprocess.Popen(['/usr/bin/defaults', 'read',
+
+# context manager
+class _SuppressCoreFiles(object):
+ """Try to prevent core files from being created."""
+ old_limit = None
+
+ def __enter__(self):
+ """Try to save previous ulimit, then set it to (0, 0)."""
+ try:
+ import resource
+ self.old_limit = resource.getrlimit(resource.RLIMIT_CORE)
+ resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
+ except (ImportError, ValueError, resource.error):
+ pass
+
+ if sys.platform == 'darwin':
+ # Check if the 'Crash Reporter' on OSX was configured
+ # in 'Developer' mode and warn that it will get triggered
+ # when it is.
+ #
+ # This assumes that this context manager is used in tests
+ # that might trigger the next manager.
+ value = subprocess.Popen(['/usr/bin/defaults', 'read',
'com.apple.CrashReporter', 'DialogType'],
stdout=subprocess.PIPE).communicate()[0]
- if value.strip() == b'developer':
- print("this tests triggers the Crash Reporter, "
- "that is intentional", end='')
- sys.stdout.flush()
+ if value.strip() == b'developer':
+ print("this tests triggers the Crash Reporter, "
+ "that is intentional", end='')
+ sys.stdout.flush()
+
+ def __exit__(self, *args):
+ """Return core file behavior to default."""
+ if self.old_limit is None:
+ return
+ try:
+ import resource
+ resource.setrlimit(resource.RLIMIT_CORE, self.old_limit)
+ except (ImportError, ValueError, resource.error):
+ pass
- try:
- import resource
- old_limit = resource.getrlimit(resource.RLIMIT_CORE)
- resource.setrlimit(resource.RLIMIT_CORE, (0,0))
- return old_limit
- except (ImportError, ValueError, resource.error):
- return None
+@unittest.skipIf(mswindows, "POSIX specific tests")
+class POSIXProcessTestCase(BaseTestCase):
+ def test_exceptions(self):
+ nonexistent_dir = "/_this/pa.th/does/not/exist"
+ try:
+ os.chdir(nonexistent_dir)
+ except OSError as e:
+ # This avoids hard coding the errno value or the OS perror()
+ # string and instead capture the exception that we want to see
+ # below for comparison.
+ desired_exception = e
+ desired_exception.strerror += ': ' + repr(sys.executable)
+ else:
+ self.fail("chdir to nonexistant directory %s succeeded." %
+ nonexistent_dir)
- def _unsuppress_core_files(self, old_limit):
- """Return core file behavior to default."""
- if old_limit is None:
- return
- try:
- import resource
- resource.setrlimit(resource.RLIMIT_CORE, old_limit)
- except (ImportError, ValueError, resource.error):
- return
-
- def test_run_abort(self):
- # returncode handles signal termination
- old_limit = self._suppress_core_files()
- try:
- p = subprocess.Popen([sys.executable,
- "-c", "import os; os.abort()"])
- finally:
- self._unsuppress_core_files(old_limit)
- p.wait()
- self.assertEqual(-p.returncode, signal.SIGABRT)
+ # Error in the child re-raised in the parent.
+ try:
+ p = subprocess.Popen([sys.executable, "-c", ""],
+ cwd=nonexistent_dir)
+ except OSError as e:
+ # Test that the child process chdir failure actually makes
+ # it up to the parent process as the correct exception.
+ self.assertEqual(desired_exception.errno, e.errno)
+ self.assertEqual(desired_exception.strerror, e.strerror)
+ else:
+ self.fail("Expected OSError: %s" % desired_exception)
+
+ def test_restore_signals(self):
+ # Code coverage for both values of restore_signals to make sure it
+ # at least does not blow up.
+ # A test for behavior would be complex. Contributions welcome.
+ subprocess.call([sys.executable, "-c", ""], restore_signals=True)
+ subprocess.call([sys.executable, "-c", ""], restore_signals=False)
+
+ def test_start_new_session(self):
+ # For code coverage of calling setsid(). We don't care if we get an
+ # EPERM error from it depending on the test execution environment, that
+ # still indicates that it was called.
+ try:
+ output = subprocess.check_output(
+ [sys.executable, "-c",
+ "import os; print(os.getpgid(os.getpid()))"],
+ start_new_session=True)
+ except OSError as e:
+ if e.errno != errno.EPERM:
+ raise
+ else:
+ parent_pgid = os.getpgid(os.getpid())
+ child_pgid = int(output)
+ self.assertNotEqual(parent_pgid, child_pgid)
- def test_preexec(self):
- # preexec function
+ def test_run_abort(self):
+ # returncode handles signal termination
+ with _SuppressCoreFiles():
p = subprocess.Popen([sys.executable, "-c",
- 'import sys,os;'
- 'sys.stdout.write(os.getenv("FRUIT"))'],
- stdout=subprocess.PIPE,
- preexec_fn=lambda: os.putenv("FRUIT",
- "apple"))
- self.assertEqual(p.stdout.read(), b"apple")
-
- def test_args_string(self):
- # args is a string
- fd, fname = self.mkstemp()
- # reopen in text mode
- with open(fd, "w") as fobj:
- fobj.write("#!/bin/sh\n")
- fobj.write("exec '%s' -c 'import sys; sys.exit(47)'\n" %
- sys.executable)
- os.chmod(fname, 0o700)
- p = subprocess.Popen(fname)
+ 'import os; os.abort()'])
p.wait()
- os.remove(fname)
- self.assertEqual(p.returncode, 47)
-
- def test_invalid_args(self):
- # invalid arguments should raise ValueError
- self.assertRaises(ValueError, subprocess.call,
- [sys.executable,
- "-c", "import sys; sys.exit(47)"],
- startupinfo=47)
- self.assertRaises(ValueError, subprocess.call,
- [sys.executable,
- "-c", "import sys; sys.exit(47)"],
- creationflags=47)
-
- def test_shell_sequence(self):
- # Run command through the shell (sequence)
- newenv = os.environ.copy()
- newenv["FRUIT"] = "apple"
- p = subprocess.Popen(["echo $FRUIT"], shell=1,
- stdout=subprocess.PIPE,
- env=newenv)
- self.assertEqual(p.stdout.read().strip(b" \t\r\n\f"), b"apple")
-
- def test_shell_string(self):
- # Run command through the shell (string)
- newenv = os.environ.copy()
- newenv["FRUIT"] = "apple"
- p = subprocess.Popen("echo $FRUIT", shell=1,
- stdout=subprocess.PIPE,
- env=newenv)
- self.assertEqual(p.stdout.read().strip(b" \t\r\n\f"), b"apple")
-
- def test_call_string(self):
- # call() function with string argument on UNIX
- fd, fname = self.mkstemp()
- # reopen in text mode
- with open(fd, "w") as fobj:
- fobj.write("#!/bin/sh\n")
- fobj.write("exec '%s' -c 'import sys; sys.exit(47)'\n" %
- sys.executable)
- os.chmod(fname, 0o700)
- rc = subprocess.call(fname)
- os.remove(fname)
- self.assertEqual(rc, 47)
-
- def test_specific_shell(self):
- # Issue #9265: Incorrect name passed as arg[0].
- shells = []
- for prefix in ['/bin', '/usr/bin/', '/usr/local/bin']:
- for name in ['bash', 'ksh']:
- sh = os.path.join(prefix, name)
- if os.path.isfile(sh):
- shells.append(sh)
- if not shells: # Will probably work for any shell but csh.
- self.skipTest("bash or ksh required for this test")
- sh = '/bin/sh'
- if os.path.isfile(sh) and not os.path.islink(sh):
- # Test will fail if /bin/sh is a symlink to csh.
- shells.append(sh)
- for sh in shells:
- p = subprocess.Popen("echo $0", executable=sh, shell=True,
- stdout=subprocess.PIPE)
- self.assertEqual(p.stdout.read().strip(), bytes(sh, 'ascii'))
-
- def DISABLED_test_send_signal(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
-
- self.assertTrue(p.poll() is None, p.poll())
- p.send_signal(signal.SIGINT)
- self.assertNotEqual(p.wait(), 0)
-
- def DISABLED_test_kill(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
-
- self.assertTrue(p.poll() is None, p.poll())
- p.kill()
- self.assertEqual(p.wait(), -signal.SIGKILL)
-
- def DISABLED_test_terminate(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
-
- self.assertTrue(p.poll() is None, p.poll())
- p.terminate()
- self.assertEqual(p.wait(), -signal.SIGTERM)
-
- def test_undecodable_env(self):
- for key, value in (('test', 'abc\uDCFF'), ('test\uDCFF', '42')):
- value_repr = ascii(value).encode("ascii")
-
- # test str with surrogates
- script = "import os; print(ascii(os.getenv(%s)))" % repr(key)
- env = os.environ.copy()
- env[key] = value
- # Force surrogate-escaping of \xFF in the child process;
- # otherwise it can be decoded as-is if the default locale
- # is latin-1.
- env['PYTHONFSENCODING'] = 'ascii'
- stdout = subprocess.check_output(
- [sys.executable, "-c", script],
- env=env)
- stdout = stdout.rstrip(b'\n\r')
- self.assertEqual(stdout, value_repr)
-
- # test bytes
- key = key.encode("ascii", "surrogateescape")
- value = value.encode("ascii", "surrogateescape")
- script = "import os; print(ascii(os.getenv(%s)))" % repr(key)
- env = os.environ.copy()
- env[key] = value
- stdout = subprocess.check_output(
- [sys.executable, "-c", script],
- env=env)
- stdout = stdout.rstrip(b'\n\r')
- self.assertEqual(stdout, value_repr)
-
- def test_wait_when_sigchild_ignored(self):
- # NOTE: sigchild_ignore.py may not be an effective test on all OSes.
- sigchild_ignore = support.findfile("sigchild_ignore.py",
- subdir="subprocessdata")
- p = subprocess.Popen([sys.executable, sigchild_ignore],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = p.communicate()
- self.assertEqual(0, p.returncode, "sigchild_ignore.py exited"
- " non-zero with this error:\n%s" %
- stderr.decode('utf8'))
-
- def check_close_std_fds(self, fds):
- # Issue #9905: test that subprocess pipes still work properly with
- # some standard fds closed
- stdin = 0
- newfds = []
- for a in fds:
- b = os.dup(a)
- newfds.append(b)
- if a == 0:
- stdin = b
- try:
- for fd in fds:
- os.close(fd)
- out, err = subprocess.Popen([sys.executable, "-c",
- 'import sys;'
- 'sys.stdout.write("apple");'
- 'sys.stdout.flush();'
- 'sys.stderr.write("orange")'],
- stdin=stdin,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).communicate()
- err = support.strip_python_stderr(err)
- self.assertEqual((out, err), (b'apple', b'orange'))
- finally:
- for b, a in zip(newfds, fds):
- os.dup2(b, a)
- for b in newfds:
- os.close(b)
+ self.assertEqual(-p.returncode, signal.SIGABRT)
- def test_close_fd_0(self):
- self.check_close_std_fds([0])
+ def test_preexec(self):
+ # DISCLAIMER: Setting environment variables is *not* a good use
+ # of a preexec_fn. This is merely a test.
+ p = subprocess.Popen([sys.executable, "-c",
+ 'import sys,os;'
+ 'sys.stdout.write(os.getenv("FRUIT"))'],
+ stdout=subprocess.PIPE,
+ preexec_fn=lambda: os.putenv("FRUIT", "apple"))
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(p.stdout.read(), b"apple")
- def test_close_fd_1(self):
- self.check_close_std_fds([1])
+ def test_preexec_exception(self):
+ def raise_it():
+ raise ValueError("What if two swallows carried a coconut?")
+ try:
+ p = subprocess.Popen([sys.executable, "-c", ""],
+ preexec_fn=raise_it)
+ except RuntimeError as e:
+ self.assertTrue(
+ subprocess._posixsubprocess,
+ "Expected a ValueError from the preexec_fn")
+ except ValueError as e:
+ self.assertIn("coconut", e.args[0])
+ else:
+ self.fail("Exception raised by preexec_fn did not make it "
+ "to the parent process.")
+
+ @unittest.skipUnless(gc, "Requires a gc module.")
+ def test_preexec_gc_module_failure(self):
+ # This tests the code that disables garbage collection if the child
+ # process will execute any Python.
+ def raise_runtime_error():
+ raise RuntimeError("this shouldn't escape")
+ enabled = gc.isenabled()
+ orig_gc_disable = gc.disable
+ orig_gc_isenabled = gc.isenabled
+ try:
+ gc.disable()
+ self.assertFalse(gc.isenabled())
+ subprocess.call([sys.executable, '-c', ''],
+ preexec_fn=lambda: None)
+ self.assertFalse(gc.isenabled(),
+ "Popen enabled gc when it shouldn't.")
+
+ gc.enable()
+ self.assertTrue(gc.isenabled())
+ subprocess.call([sys.executable, '-c', ''],
+ preexec_fn=lambda: None)
+ self.assertTrue(gc.isenabled(), "Popen left gc disabled.")
+
+ gc.disable = raise_runtime_error
+ self.assertRaises(RuntimeError, subprocess.Popen,
+ [sys.executable, '-c', ''],
+ preexec_fn=lambda: None)
+
+ del gc.isenabled # force an AttributeError
+ self.assertRaises(AttributeError, subprocess.Popen,
+ [sys.executable, '-c', ''],
+ preexec_fn=lambda: None)
+ finally:
+ gc.disable = orig_gc_disable
+ gc.isenabled = orig_gc_isenabled
+ if not enabled:
+ gc.disable()
+
+ def test_args_string(self):
+ # args is a string
+ fd, fname = mkstemp()
+ # reopen in text mode
+ with open(fd, "w", errors="surrogateescape") as fobj:
+ fobj.write("#!/bin/sh\n")
+ fobj.write("exec '%s' -c 'import sys; sys.exit(47)'\n" %
+ sys.executable)
+ os.chmod(fname, 0o700)
+ p = subprocess.Popen(fname)
+ p.wait()
+ os.remove(fname)
+ self.assertEqual(p.returncode, 47)
- def test_close_fd_2(self):
- self.check_close_std_fds([2])
+ def test_invalid_args(self):
+ # invalid arguments should raise ValueError
+ self.assertRaises(ValueError, subprocess.call,
+ [sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ startupinfo=47)
+ self.assertRaises(ValueError, subprocess.call,
+ [sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ creationflags=47)
+
+ def test_shell_sequence(self):
+ # Run command through the shell (sequence)
+ newenv = os.environ.copy()
+ newenv["FRUIT"] = "apple"
+ p = subprocess.Popen(["echo $FRUIT"], shell=1,
+ stdout=subprocess.PIPE,
+ env=newenv)
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(p.stdout.read().strip(b" \t\r\n\f"), b"apple")
- def test_close_fds_0_1(self):
- self.check_close_std_fds([0, 1])
+ def test_shell_string(self):
+ # Run command through the shell (string)
+ newenv = os.environ.copy()
+ newenv["FRUIT"] = "apple"
+ p = subprocess.Popen("echo $FRUIT", shell=1,
+ stdout=subprocess.PIPE,
+ env=newenv)
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(p.stdout.read().strip(b" \t\r\n\f"), b"apple")
+
+ def test_call_string(self):
+ # call() function with string argument on UNIX
+ fd, fname = mkstemp()
+ # reopen in text mode
+ with open(fd, "w", errors="surrogateescape") as fobj:
+ fobj.write("#!/bin/sh\n")
+ fobj.write("exec '%s' -c 'import sys; sys.exit(47)'\n" %
+ sys.executable)
+ os.chmod(fname, 0o700)
+ rc = subprocess.call(fname)
+ os.remove(fname)
+ self.assertEqual(rc, 47)
- def test_close_fds_0_2(self):
- self.check_close_std_fds([0, 2])
+ def test_specific_shell(self):
+ # Issue #9265: Incorrect name passed as arg[0].
+ shells = []
+ for prefix in ['/bin', '/usr/bin/', '/usr/local/bin']:
+ for name in ['bash', 'ksh']:
+ sh = os.path.join(prefix, name)
+ if os.path.isfile(sh):
+ shells.append(sh)
+ if not shells: # Will probably work for any shell but csh.
+ self.skipTest("bash or ksh required for this test")
+ sh = '/bin/sh'
+ if os.path.isfile(sh) and not os.path.islink(sh):
+ # Test will fail if /bin/sh is a symlink to csh.
+ shells.append(sh)
+ for sh in shells:
+ p = subprocess.Popen("echo $0", executable=sh, shell=True,
+ stdout=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(p.stdout.read().strip(), bytes(sh, 'ascii'))
+
+ def _kill_process(self, method, *args):
+ # Do not inherit file handles from the parent.
+ # It should fix failures on some platforms.
+ p = subprocess.Popen([sys.executable, "-c", """if 1:
+ import sys, time
+ sys.stdout.write('x\\n')
+ sys.stdout.flush()
+ time.sleep(30)
+ """],
+ close_fds=True,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ # Wait for the interpreter to be completely initialized before
+ # sending any signal.
+ p.stdout.read(1)
+ getattr(p, method)(*args)
+ return p
+
+ def test_send_signal(self):
+ p = self._kill_process('send_signal', signal.SIGINT)
+ _, stderr = p.communicate()
+ self.assertIn(b'KeyboardInterrupt', stderr)
+ self.assertNotEqual(p.wait(), 0)
+
+ def test_kill(self):
+ p = self._kill_process('kill')
+ _, stderr = p.communicate()
+ self.assertStderrEqual(stderr, b'')
+ self.assertEqual(p.wait(), -signal.SIGKILL)
+
+ def test_terminate(self):
+ p = self._kill_process('terminate')
+ _, stderr = p.communicate()
+ self.assertStderrEqual(stderr, b'')
+ self.assertEqual(p.wait(), -signal.SIGTERM)
+
+ def check_close_std_fds(self, fds):
+ # Issue #9905: test that subprocess pipes still work properly with
+ # some standard fds closed
+ stdin = 0
+ newfds = []
+ for a in fds:
+ b = os.dup(a)
+ newfds.append(b)
+ if a == 0:
+ stdin = b
+ try:
+ for fd in fds:
+ os.close(fd)
+ out, err = subprocess.Popen([sys.executable, "-c",
+ 'import sys;'
+ 'sys.stdout.write("apple");'
+ 'sys.stdout.flush();'
+ 'sys.stderr.write("orange")'],
+ stdin=stdin,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE).communicate()
+ err = support.strip_python_stderr(err)
+ self.assertEqual((out, err), (b'apple', b'orange'))
+ finally:
+ for b, a in zip(newfds, fds):
+ os.dup2(b, a)
+ for b in newfds:
+ os.close(b)
- def test_close_fds_1_2(self):
- self.check_close_std_fds([1, 2])
+ def test_close_fd_0(self):
+ self.check_close_std_fds([0])
- def test_close_fds_0_1_2(self):
- # Issue #10806: test that subprocess pipes still work properly with
- # all standard fds closed.
- self.check_close_std_fds([0, 1, 2])
+ def test_close_fd_1(self):
+ self.check_close_std_fds([1])
- def test_surrogates_error_message(self):
- def prepare():
- raise ValueError("surrogate:\uDCff")
+ def test_close_fd_2(self):
+ self.check_close_std_fds([2])
- def test_select_unbuffered(self):
- # Issue #11459: bufsize=0 should really set the pipes as
- # unbuffered (and therefore let select() work properly).
- select = support.import_module("select")
- p = subprocess.Popen([sys.executable, "-c",
- 'import sys;'
- 'sys.stdout.write("apple")'],
- stdout=subprocess.PIPE,
- bufsize=0)
- f = p.stdout
- self.addCleanup(f.close)
+ def test_close_fds_0_1(self):
+ self.check_close_std_fds([0, 1])
+
+ def test_close_fds_0_2(self):
+ self.check_close_std_fds([0, 2])
+
+ def test_close_fds_1_2(self):
+ self.check_close_std_fds([1, 2])
+
+ def test_close_fds_0_1_2(self):
+ # Issue #10806: test that subprocess pipes still work properly with
+ # all standard fds closed.
+ self.check_close_std_fds([0, 1, 2])
+
+ def test_remapping_std_fds(self):
+ # open up some temporary files
+ temps = [mkstemp() for i in range(3)]
+ try:
+ temp_fds = [fd for fd, fname in temps]
+
+ # unlink the files -- we won't need to reopen them
+ for fd, fname in temps:
+ os.unlink(fname)
+
+ # write some data to what will become stdin, and rewind
+ os.write(temp_fds[1], b"STDIN")
+ os.lseek(temp_fds[1], 0, 0)
+
+ # move the standard file descriptors out of the way
+ saved_fds = [os.dup(fd) for fd in range(3)]
try:
- self.assertEqual(f.read(4), b"appl")
- self.assertIn(f, select.select([f], [], [], 0.0)[0])
- finally:
+ # duplicate the file objects over the standard fd's
+ for fd, temp_fd in enumerate(temp_fds):
+ os.dup2(temp_fd, fd)
+
+ # now use those files in the "wrong" order, so that subprocess
+ # has to rearrange them in the child
+ p = subprocess.Popen([sys.executable, "-c",
+ 'import sys; got = sys.stdin.read();'
+ 'sys.stdout.write("got %s"%got); sys.stderr.write("err")'],
+ stdin=temp_fds[1],
+ stdout=temp_fds[2],
+ stderr=temp_fds[0])
p.wait()
+ finally:
+ # restore the original fd's underneath sys.stdin, etc.
+ for std, saved in enumerate(saved_fds):
+ os.dup2(saved, std)
+ os.close(saved)
- #
- # Windows tests
- #
- if mswindows:
- def test_startupinfo(self):
- # startupinfo argument
- # We uses hardcoded constants, because we do not want to
- # depend on win32all.
- STARTF_USESHOWWINDOW = 1
- SW_MAXIMIZE = 3
- startupinfo = subprocess.STARTUPINFO()
- startupinfo.dwFlags = STARTF_USESHOWWINDOW
- startupinfo.wShowWindow = SW_MAXIMIZE
- # Since Python is a console process, it won't be affected
- # by wShowWindow, but the argument should be silently
- # ignored
- subprocess.call([sys.executable, "-c", "import sys; sys.exit(0)"],
- startupinfo=startupinfo)
+ for fd in temp_fds:
+ os.lseek(fd, 0, 0)
- def test_creationflags(self):
- # creationflags argument
- CREATE_NEW_CONSOLE = 16
- sys.stderr.write(" a DOS box should flash briefly ...\n")
- subprocess.call(sys.executable +
- ' -c "import time; time.sleep(0.25)"',
- creationflags=CREATE_NEW_CONSOLE)
-
- def test_invalid_args(self):
- # invalid arguments should raise ValueError
- self.assertRaises(ValueError, subprocess.call,
- [sys.executable,
- "-c", "import sys; sys.exit(47)"],
- preexec_fn=lambda: 1)
- self.assertRaises(ValueError, subprocess.call,
- [sys.executable,
- "-c", "import sys; sys.exit(47)"],
- stdout=subprocess.PIPE,
- close_fds=True)
+ out = os.read(temp_fds[2], 1024)
+ err = support.strip_python_stderr(os.read(temp_fds[0], 1024))
+ self.assertEqual(out, b"got STDIN")
+ self.assertEqual(err, b"err")
- def test_close_fds(self):
- # close file descriptors
- rc = subprocess.call([sys.executable, "-c",
- "import sys; sys.exit(47)"],
- close_fds=True)
- self.assertEqual(rc, 47)
-
- def test_shell_sequence(self):
- # Run command through the shell (sequence)
- newenv = os.environ.copy()
- newenv["FRUIT"] = "physalis"
- p = subprocess.Popen(["set"], shell=1,
- stdout=subprocess.PIPE,
- env=newenv)
- self.assertNotEqual(p.stdout.read().find(b"physalis"), -1)
-
- def test_shell_string(self):
- # Run command through the shell (string)
- newenv = os.environ.copy()
- newenv["FRUIT"] = "physalis"
- p = subprocess.Popen("set", shell=1,
- stdout=subprocess.PIPE,
- env=newenv)
- self.assertNotEqual(p.stdout.read().find(b"physalis"), -1)
+ finally:
+ for fd in temp_fds:
+ os.close(fd)
- def test_call_string(self):
- # call() function with string argument on Windows
- rc = subprocess.call(sys.executable +
- ' -c "import sys; sys.exit(47)"')
- self.assertEqual(rc, 47)
+ def test_surrogates_error_message(self):
+ def prepare():
+ raise ValueError("surrogate:\uDCff")
- def DISABLED_test_send_signal(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
+ try:
+ subprocess.call(
+ [sys.executable, "-c", "pass"],
+ preexec_fn=prepare)
+ except ValueError as err:
+ # Pure Python implementations keeps the message
+ self.assertIsNone(subprocess._posixsubprocess)
+ self.assertEqual(str(err), "surrogate:\uDCff")
+ except RuntimeError as err:
+ # _posixsubprocess uses a default message
+ self.assertIsNotNone(subprocess._posixsubprocess)
+ self.assertEqual(str(err), "Exception occurred in preexec_fn.")
+ else:
+ self.fail("Expected ValueError or RuntimeError")
+
+ def test_undecodable_env(self):
+ for key, value in (('test', 'abc\uDCFF'), ('test\uDCFF', '42')):
+ # test str with surrogates
+ script = "import os; print(ascii(os.getenv(%s)))" % repr(key)
+ env = os.environ.copy()
+ env[key] = value
+ # Use C locale to get ascii for the locale encoding to force
+ # surrogate-escaping of \xFF in the child process; otherwise it can
+ # be decoded as-is if the default locale is latin-1.
+ env['LC_ALL'] = 'C'
+ stdout = subprocess.check_output(
+ [sys.executable, "-c", script],
+ env=env)
+ stdout = stdout.rstrip(b'\n\r')
+ self.assertEqual(stdout.decode('ascii'), ascii(value))
+
+ # test bytes
+ key = key.encode("ascii", "surrogateescape")
+ value = value.encode("ascii", "surrogateescape")
+ script = "import os; print(ascii(os.getenvb(%s)))" % repr(key)
+ env = os.environ.copy()
+ env[key] = value
+ stdout = subprocess.check_output(
+ [sys.executable, "-c", script],
+ env=env)
+ stdout = stdout.rstrip(b'\n\r')
+ self.assertEqual(stdout.decode('ascii'), ascii(value))
+
+ def test_bytes_program(self):
+ abs_program = os.fsencode(sys.executable)
+ path, program = os.path.split(sys.executable)
+ program = os.fsencode(program)
+
+ # absolute bytes path
+ exitcode = subprocess.call([abs_program, "-c", "pass"])
+ self.assertEqual(exitcode, 0)
+
+ # bytes program, unicode PATH
+ env = os.environ.copy()
+ env["PATH"] = path
+ exitcode = subprocess.call([program, "-c", "pass"], env=env)
+ self.assertEqual(exitcode, 0)
+
+ # bytes program, bytes PATH
+ envb = os.environb.copy()
+ envb[b"PATH"] = os.fsencode(path)
+ exitcode = subprocess.call([program, "-c", "pass"], env=envb)
+ self.assertEqual(exitcode, 0)
+
+ def test_pipe_cloexec(self):
+ sleeper = support.findfile("input_reader.py", subdir="subprocessdata")
+ fd_status = support.findfile("fd_status.py", subdir="subprocessdata")
+
+ p1 = subprocess.Popen([sys.executable, sleeper],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, close_fds=False)
+
+ self.addCleanup(p1.communicate, b'')
+
+ p2 = subprocess.Popen([sys.executable, fd_status],
+ stdout=subprocess.PIPE, close_fds=False)
+
+ output, error = p2.communicate()
+ result_fds = set(map(int, output.split(b',')))
+ unwanted_fds = set([p1.stdin.fileno(), p1.stdout.fileno(),
+ p1.stderr.fileno()])
+
+ self.assertFalse(result_fds & unwanted_fds,
+ "Expected no fds from %r to be open in child, "
+ "found %r" %
+ (unwanted_fds, result_fds & unwanted_fds))
+
+ def test_pipe_cloexec_real_tools(self):
+ qcat = support.findfile("qcat.py", subdir="subprocessdata")
+ qgrep = support.findfile("qgrep.py", subdir="subprocessdata")
+
+ subdata = b'zxcvbn'
+ data = subdata * 4 + b'\n'
+
+ p1 = subprocess.Popen([sys.executable, qcat],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ close_fds=False)
+
+ p2 = subprocess.Popen([sys.executable, qgrep, subdata],
+ stdin=p1.stdout, stdout=subprocess.PIPE,
+ close_fds=False)
+
+ self.addCleanup(p1.wait)
+ self.addCleanup(p2.wait)
+ self.addCleanup(p1.terminate)
+ self.addCleanup(p2.terminate)
+
+ p1.stdin.write(data)
+ p1.stdin.close()
+
+ readfiles, ignored1, ignored2 = select.select([p2.stdout], [], [], 10)
+
+ self.assertTrue(readfiles, "The child hung")
+ self.assertEqual(p2.stdout.read(), data)
+
+ p1.stdout.close()
+ p2.stdout.close()
+
+ def test_close_fds(self):
+ fd_status = support.findfile("fd_status.py", subdir="subprocessdata")
+
+ fds = os.pipe()
+ self.addCleanup(os.close, fds[0])
+ self.addCleanup(os.close, fds[1])
+
+ open_fds = set(fds)
+
+ p = subprocess.Popen([sys.executable, fd_status],
+ stdout=subprocess.PIPE, close_fds=False)
+ output, ignored = p.communicate()
+ remaining_fds = set(map(int, output.split(b',')))
+
+ self.assertEqual(remaining_fds & open_fds, open_fds,
+ "Some fds were closed")
+
+ p = subprocess.Popen([sys.executable, fd_status],
+ stdout=subprocess.PIPE, close_fds=True)
+ output, ignored = p.communicate()
+ remaining_fds = set(map(int, output.split(b',')))
+
+ self.assertFalse(remaining_fds & open_fds,
+ "Some fds were left open")
+ self.assertIn(1, remaining_fds, "Subprocess failed")
+
+ def test_pass_fds(self):
+ fd_status = support.findfile("fd_status.py", subdir="subprocessdata")
- self.assertTrue(p.poll() is None, p.poll())
- p.send_signal(signal.SIGTERM)
- self.assertNotEqual(p.wait(), 0)
+ open_fds = set()
- def DISABLED_test_kill(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
+ for x in range(5):
+ fds = os.pipe()
+ self.addCleanup(os.close, fds[0])
+ self.addCleanup(os.close, fds[1])
+ open_fds.update(fds)
- self.assertTrue(p.poll() is None, p.poll())
- p.kill()
- self.assertNotEqual(p.wait(), 0)
+ for fd in open_fds:
+ p = subprocess.Popen([sys.executable, fd_status],
+ stdout=subprocess.PIPE, close_fds=True,
+ pass_fds=(fd, ))
+ output, ignored = p.communicate()
- def DISABLED_test_terminate(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
+ remaining_fds = set(map(int, output.split(b',')))
+ to_be_closed = open_fds - {fd}
- self.assertTrue(p.poll() is None, p.poll())
- p.terminate()
- self.assertNotEqual(p.wait(), 0)
+ self.assertIn(fd, remaining_fds, "fd to be passed not passed")
+ self.assertFalse(remaining_fds & to_be_closed,
+ "fd to be closed passed")
+ # pass_fds overrides close_fds with a warning.
+ with self.assertWarns(RuntimeWarning) as context:
+ self.assertFalse(subprocess.call(
+ [sys.executable, "-c", "import sys; sys.exit(0)"],
+ close_fds=False, pass_fds=(fd, )))
+ self.assertIn('overriding close_fds', str(context.warning))
-class CommandTests(unittest.TestCase):
-# The module says:
-# "NB This only works (and is only relevant) for UNIX."
-#
-# Actually, getoutput should work on any platform with an os.popen, but
-# I'll take the comment as given, and skip this suite.
- if os.name == 'posix':
+ def test_stdout_stdin_are_single_inout_fd(self):
+ with io.open(os.devnull, "r+") as inout:
+ p = subprocess.Popen([sys.executable, "-c", "import sys; sys.exit(0)"],
+ stdout=inout, stdin=inout)
+ p.wait()
- def test_getoutput(self):
- self.assertEqual(subprocess.getoutput('echo xyzzy'), 'xyzzy')
- self.assertEqual(subprocess.getstatusoutput('echo xyzzy'),
- (0, 'xyzzy'))
+ def test_stdout_stderr_are_single_inout_fd(self):
+ with io.open(os.devnull, "r+") as inout:
+ p = subprocess.Popen([sys.executable, "-c", "import sys; sys.exit(0)"],
+ stdout=inout, stderr=inout)
+ p.wait()
- # we use mkdtemp in the next line to create an empty directory
- # under our exclusive control; from that, we can invent a pathname
- # that we _know_ won't exist. This is guaranteed to fail.
- dir = None
- try:
- dir = tempfile.mkdtemp()
- name = os.path.join(dir, "foo")
+ def test_stderr_stdin_are_single_inout_fd(self):
+ with io.open(os.devnull, "r+") as inout:
+ p = subprocess.Popen([sys.executable, "-c", "import sys; sys.exit(0)"],
+ stderr=inout, stdin=inout)
+ p.wait()
- status, output = subprocess.getstatusoutput('cat ' + name)
- self.assertNotEqual(status, 0)
- finally:
- if dir is not None:
- os.rmdir(dir)
+ def test_wait_when_sigchild_ignored(self):
+ # NOTE: sigchild_ignore.py may not be an effective test on all OSes.
+ sigchild_ignore = support.findfile("sigchild_ignore.py",
+ subdir="subprocessdata")
+ p = subprocess.Popen([sys.executable, sigchild_ignore],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ self.assertEqual(0, p.returncode, "sigchild_ignore.py exited"
+ " non-zero with this error:\n%s" %
+ stderr.decode('utf8'))
+
+ def test_select_unbuffered(self):
+ # Issue #11459: bufsize=0 should really set the pipes as
+ # unbuffered (and therefore let select() work properly).
+ select = support.import_module("select")
+ p = subprocess.Popen([sys.executable, "-c",
+ 'import sys;'
+ 'sys.stdout.write("apple")'],
+ stdout=subprocess.PIPE,
+ bufsize=0)
+ f = p.stdout
+ self.addCleanup(f.close)
+ try:
+ self.assertEqual(f.read(4), b"appl")
+ self.assertIn(f, select.select([f], [], [], 0.0)[0])
+ finally:
+ p.wait()
-unit_tests = [ProcessTestCase, CommandTests]
+@unittest.skipUnless(mswindows, "Windows specific tests")
+class Win32ProcessTestCase(BaseTestCase):
+
+ def test_startupinfo(self):
+ # startupinfo argument
+ # We uses hardcoded constants, because we do not want to
+ # depend on win32all.
+ STARTF_USESHOWWINDOW = 1
+ SW_MAXIMIZE = 3
+ startupinfo = subprocess.STARTUPINFO()
+ startupinfo.dwFlags = STARTF_USESHOWWINDOW
+ startupinfo.wShowWindow = SW_MAXIMIZE
+ # Since Python is a console process, it won't be affected
+ # by wShowWindow, but the argument should be silently
+ # ignored
+ subprocess.call([sys.executable, "-c", "import sys; sys.exit(0)"],
+ startupinfo=startupinfo)
-if mswindows:
- class CommandsWithSpaces (BaseTestCase):
-
- def setUp(self):
- super().setUp()
- f, fname = self.mkstemp(".py", "te st")
- self.fname = fname.lower ()
- os.write(f, b"import sys;"
- b"sys.stdout.write('%d %s' % (len(sys.argv), [a.lower () for a in sys.argv]))"
- )
- os.close(f)
-
- def tearDown(self):
- os.remove(self.fname)
- super().tearDown()
-
- def with_spaces(self, *args, **kwargs):
- kwargs['stdout'] = subprocess.PIPE
- p = subprocess.Popen(*args, **kwargs)
- self.assertEqual(
- p.stdout.read ().decode("mbcs"),
- "2 [%r, 'ab cd']" % self.fname
- )
-
- def test_shell_string_with_spaces(self):
- # call() function with string argument with spaces on Windows
- self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
- "ab cd"), shell=1)
+ def test_creationflags(self):
+ # creationflags argument
+ CREATE_NEW_CONSOLE = 16
+ sys.stderr.write(" a DOS box should flash briefly ...\n")
+ subprocess.call(sys.executable +
+ ' -c "import time; time.sleep(0.25)"',
+ creationflags=CREATE_NEW_CONSOLE)
+
+ def test_invalid_args(self):
+ # invalid arguments should raise ValueError
+ self.assertRaises(ValueError, subprocess.call,
+ [sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ preexec_fn=lambda: 1)
+ self.assertRaises(ValueError, subprocess.call,
+ [sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ stdout=subprocess.PIPE,
+ close_fds=True)
+
+ def test_close_fds(self):
+ # close file descriptors
+ rc = subprocess.call([sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ close_fds=True)
+ self.assertEqual(rc, 47)
+
+ def test_shell_sequence(self):
+ # Run command through the shell (sequence)
+ newenv = os.environ.copy()
+ newenv["FRUIT"] = "physalis"
+ p = subprocess.Popen(["set"], shell=1,
+ stdout=subprocess.PIPE,
+ env=newenv)
+ self.addCleanup(p.stdout.close)
+ self.assertIn(b"physalis", p.stdout.read())
+
+ def test_shell_string(self):
+ # Run command through the shell (string)
+ newenv = os.environ.copy()
+ newenv["FRUIT"] = "physalis"
+ p = subprocess.Popen("set", shell=1,
+ stdout=subprocess.PIPE,
+ env=newenv)
+ self.addCleanup(p.stdout.close)
+ self.assertIn(b"physalis", p.stdout.read())
+
+ def test_call_string(self):
+ # call() function with string argument on Windows
+ rc = subprocess.call(sys.executable +
+ ' -c "import sys; sys.exit(47)"')
+ self.assertEqual(rc, 47)
+
+ def _kill_process(self, method, *args):
+ # Some win32 buildbot raises EOFError if stdin is inherited
+ p = subprocess.Popen([sys.executable, "-c", """if 1:
+ import sys, time
+ sys.stdout.write('x\\n')
+ sys.stdout.flush()
+ time.sleep(30)
+ """],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
+ # Wait for the interpreter to be completely initialized before
+ # sending any signal.
+ p.stdout.read(1)
+ getattr(p, method)(*args)
+ _, stderr = p.communicate()
+ self.assertStderrEqual(stderr, b'')
+ returncode = p.wait()
+ self.assertNotEqual(returncode, 0)
+
+ def test_send_signal(self):
+ self._kill_process('send_signal', signal.SIGTERM)
- def test_shell_sequence_with_spaces(self):
- # call() function with sequence argument with spaces on Windows
- self.with_spaces([sys.executable, self.fname, "ab cd"], shell=1)
+ def test_kill(self):
+ self._kill_process('kill')
- def test_noshell_string_with_spaces(self):
- # call() function with string argument with spaces on Windows
- self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
- "ab cd"))
+ def test_terminate(self):
+ self._kill_process('terminate')
- def test_noshell_sequence_with_spaces(self):
- # call() function with sequence argument with spaces on Windows
- self.with_spaces([sys.executable, self.fname, "ab cd"])
- unit_tests.append(CommandsWithSpaces)
+# The module says:
+# "NB This only works (and is only relevant) for UNIX."
+#
+# Actually, getoutput should work on any platform with an os.popen, but
+# I'll take the comment as given, and skip this suite.
+@unittest.skipUnless(os.name == 'posix', "only relevant for UNIX")
+class CommandTests(unittest.TestCase):
+ def test_getoutput(self):
+ self.assertEqual(subprocess.getoutput('echo xyzzy'), 'xyzzy')
+ self.assertEqual(subprocess.getstatusoutput('echo xyzzy'),
+ (0, 'xyzzy'))
+
+ # we use mkdtemp in the next line to create an empty directory
+ # under our exclusive control; from that, we can invent a pathname
+ # that we _know_ won't exist. This is guaranteed to fail.
+ dir = None
+ try:
+ dir = tempfile.mkdtemp()
+ name = os.path.join(dir, "foo")
+
+ status, output = subprocess.getstatusoutput('cat ' + name)
+ self.assertNotEqual(status, 0)
+ finally:
+ if dir is not None:
+ os.rmdir(dir)
-if getattr(subprocess, '_has_poll', False):
- class ProcessTestCaseNoPoll(ProcessTestCase):
- def setUp(self):
- subprocess._has_poll = False
- ProcessTestCase.setUp(self)
+@unittest.skipUnless(getattr(subprocess, '_has_poll', False),
+ "poll system call not supported")
+class ProcessTestCaseNoPoll(ProcessTestCase):
+ def setUp(self):
+ subprocess._has_poll = False
+ ProcessTestCase.setUp(self)
- def tearDown(self):
- subprocess._has_poll = True
- ProcessTestCase.tearDown(self)
+ def tearDown(self):
+ subprocess._has_poll = True
+ ProcessTestCase.tearDown(self)
- unit_tests.append(ProcessTestCaseNoPoll)
+
+@unittest.skipUnless(getattr(subprocess, '_posixsubprocess', False),
+ "_posixsubprocess extension module not found.")
+class ProcessTestCasePOSIXPurePython(ProcessTestCase, POSIXProcessTestCase):
+ def setUp(self):
+ subprocess._posixsubprocess = None
+ ProcessTestCase.setUp(self)
+ POSIXProcessTestCase.setUp(self)
+
+ def tearDown(self):
+ subprocess._posixsubprocess = sys.modules['_posixsubprocess']
+ POSIXProcessTestCase.tearDown(self)
+ ProcessTestCase.tearDown(self)
class HelperFunctionTests(unittest.TestCase):
@@ -1101,11 +1428,104 @@ class HelperFunctionTests(unittest.TestCase):
subprocess._eintr_retry_call(fake_os_func, 666))
self.assertEqual([(256, 999), (666,), (666,)], record_calls)
-unit_tests.append(HelperFunctionTests)
+
+@unittest.skipUnless(mswindows, "Windows-specific tests")
+class CommandsWithSpaces (BaseTestCase):
+
+ def setUp(self):
+ super().setUp()
+ f, fname = mkstemp(".py", "te st")
+ self.fname = fname.lower ()
+ os.write(f, b"import sys;"
+ b"sys.stdout.write('%d %s' % (len(sys.argv), [a.lower () for a in sys.argv]))"
+ )
+ os.close(f)
+
+ def tearDown(self):
+ os.remove(self.fname)
+ super().tearDown()
+
+ def with_spaces(self, *args, **kwargs):
+ kwargs['stdout'] = subprocess.PIPE
+ p = subprocess.Popen(*args, **kwargs)
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(
+ p.stdout.read ().decode("mbcs"),
+ "2 [%r, 'ab cd']" % self.fname
+ )
+
+ def test_shell_string_with_spaces(self):
+ # call() function with string argument with spaces on Windows
+ self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
+ "ab cd"), shell=1)
+
+ def test_shell_sequence_with_spaces(self):
+ # call() function with sequence argument with spaces on Windows
+ self.with_spaces([sys.executable, self.fname, "ab cd"], shell=1)
+
+ def test_noshell_string_with_spaces(self):
+ # call() function with string argument with spaces on Windows
+ self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
+ "ab cd"))
+
+ def test_noshell_sequence_with_spaces(self):
+ # call() function with sequence argument with spaces on Windows
+ self.with_spaces([sys.executable, self.fname, "ab cd"])
+
+
+class ContextManagerTests(ProcessTestCase):
+
+ def test_pipe(self):
+ with subprocess.Popen([sys.executable, "-c",
+ "import sys;"
+ "sys.stdout.write('stdout');"
+ "sys.stderr.write('stderr');"],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE) as proc:
+ self.assertEqual(proc.stdout.read(), b"stdout")
+ self.assertStderrEqual(proc.stderr.read(), b"stderr")
+
+ self.assertTrue(proc.stdout.closed)
+ self.assertTrue(proc.stderr.closed)
+
+ def test_returncode(self):
+ with subprocess.Popen([sys.executable, "-c",
+ "import sys; sys.exit(100)"]) as proc:
+ proc.wait()
+ self.assertEqual(proc.returncode, 100)
+
+ def test_communicate_stdin(self):
+ with subprocess.Popen([sys.executable, "-c",
+ "import sys;"
+ "sys.exit(sys.stdin.read() == 'context')"],
+ stdin=subprocess.PIPE) as proc:
+ proc.communicate(b"context")
+ self.assertEqual(proc.returncode, 1)
+
+ def test_invalid_args(self):
+ with self.assertRaises(EnvironmentError) as c:
+ with subprocess.Popen(['nonexisting_i_hope'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE) as proc:
+ pass
+
+ if c.exception.errno != errno.ENOENT: # ignore "no such file"
+ raise c.exception
+
def test_main():
+ unit_tests = (ProcessTestCase,
+ POSIXProcessTestCase,
+ Win32ProcessTestCase,
+ ProcessTestCasePOSIXPurePython,
+ CommandTests,
+ ProcessTestCaseNoPoll,
+ HelperFunctionTests,
+ CommandsWithSpaces,
+ ContextManagerTests)
+
support.run_unittest(*unit_tests)
support.reap_children()
if __name__ == "__main__":
- test_main()
+ unittest.main()
diff --git a/Lib/test/test_sundry.py b/Lib/test/test_sundry.py
index 919fb844cf..07802d6263 100644
--- a/Lib/test/test_sundry.py
+++ b/Lib/test/test_sundry.py
@@ -3,16 +3,13 @@
from test import support
import sys
import unittest
-import warnings
class TestUntestedModules(unittest.TestCase):
def test_at_least_import_untested_modules(self):
- with warnings.catch_warnings():
- warnings.simplefilter("ignore")
+ with support.check_warnings(quiet=True):
import bdb
import cgitb
import code
- import compileall
import distutils.bcppcompiler
import distutils.ccompiler
@@ -49,29 +46,19 @@ class TestUntestedModules(unittest.TestCase):
import html.entities
import imghdr
import keyword
- import linecache
import macurl2path
import mailcap
- import nntplib
import nturl2path
- import opcode
import os2emxpath
- import pdb
import pstats
import py_compile
- import sched
import sndhdr
- import symbol
import tabnanny
- import timeit
- import token
try:
import tty # not available on Windows
except ImportError:
if support.verbose:
print("skipping tty")
- import webbrowser
- import xml
def test_main():
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index 3e62d9628b..7fb368abc2 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -82,7 +82,7 @@ class SymtableTest(unittest.TestCase):
func = self.spam
self.assertEqual(func.get_parameters(), ("a", "b", "kw", "var"))
self.assertEqual(func.get_locals(),
- ("a", "b", "bar", "glob", "internal", "kw", "var", "x"))
+ ("a", "b", "internal", "kw", "var", "x"))
self.assertEqual(func.get_globals(), ("bar", "glob"))
self.assertEqual(self.internal.get_frees(), ("x",))
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 7faab911a7..5926b69c93 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -480,24 +480,42 @@ Traceback (most recent call last):
...
SyntaxError: keyword argument repeated
+>>> del ()
+Traceback (most recent call last):
+SyntaxError: can't delete ()
+
+>>> {1, 2, 3} = 42
+Traceback (most recent call last):
+SyntaxError: can't assign to literal
+
Corner-cases that used to fail to raise the correct error:
- >>> def f(*, x=lambda *:0): pass
+ >>> def f(*, x=lambda __debug__:0): pass
Traceback (most recent call last):
- SyntaxError: named arguments must follow bare *
+ SyntaxError: assignment to keyword
- >>> def f(*args:(lambda *:0)): pass
+ >>> def f(*args:(lambda __debug__:0)): pass
Traceback (most recent call last):
- SyntaxError: named arguments must follow bare *
+ SyntaxError: assignment to keyword
- >>> def f(**kwargs:(lambda *:0)): pass
+ >>> def f(**kwargs:(lambda __debug__:0)): pass
Traceback (most recent call last):
- SyntaxError: named arguments must follow bare *
+ SyntaxError: assignment to keyword
>>> with (lambda *:0): pass
Traceback (most recent call last):
SyntaxError: named arguments must follow bare *
+Corner-cases that used to crash:
+
+ >>> def f(**__debug__): pass
+ Traceback (most recent call last):
+ SyntaxError: assignment to keyword
+
+ >>> def f(*xx, __debug__): pass
+ Traceback (most recent call last):
+ SyntaxError: assignment to keyword
+
"""
import re
@@ -536,13 +554,13 @@ class SyntaxTestCase(unittest.TestCase):
def test_global_err_then_warn(self):
# Bug tickler: The SyntaxError raised for one global statement
# shouldn't be clobbered by a SyntaxWarning issued for a later one.
- source = re.sub('(?m)^ *:', '', """\
- :def error(a):
- : global a # SyntaxError
- :def warning():
- : b = 1
- : global b # SyntaxWarning
- :""")
+ source = """if 1:
+ def error(a):
+ global a # SyntaxError
+ def warning():
+ b = 1
+ global b # SyntaxWarning
+ """
warnings.filterwarnings(action='ignore', category=SyntaxWarning)
self._check_error(source, "global")
warnings.filters.pop(0)
@@ -550,15 +568,6 @@ class SyntaxTestCase(unittest.TestCase):
def test_break_outside_loop(self):
self._check_error("break", "outside loop")
- def test_delete_deref(self):
- source = re.sub('(?m)^ *:', '', """\
- :def foo(x):
- : def bar():
- : print(x)
- : del x
- :""")
- self._check_error(source, "nested scope")
-
def test_unexpected_indent(self):
self._check_error("foo()\n bar()\n", "unexpected indent",
subclass=IndentationError)
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 11685a4202..db27cdf347 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -1,14 +1,20 @@
-# -*- coding: iso-8859-1 -*-
import unittest, test.support
import sys, io, os
import struct
import subprocess
import textwrap
+import warnings
+import operator
+import codecs
# count the number of test runs, used to create unique
# strings to intern in test_intern()
numruns = 0
+try:
+ import threading
+except ImportError:
+ threading = None
class SysModuleTest(unittest.TestCase):
@@ -21,6 +27,7 @@ class SysModuleTest(unittest.TestCase):
sys.stdout = self.orig_stdout
sys.stderr = self.orig_stderr
sys.displayhook = self.orig_displayhook
+ test.support.reap_children()
def test_original_displayhook(self):
import builtins
@@ -138,9 +145,9 @@ class SysModuleTest(unittest.TestCase):
"raise SystemExit(47)"])
self.assertEqual(rc, 47)
- def check_exit_message(code, expected):
+ def check_exit_message(code, expected, env=None):
process = subprocess.Popen([sys.executable, "-c", code],
- stderr=subprocess.PIPE)
+ stderr=subprocess.PIPE, env=env)
stdout, stderr = process.communicate()
self.assertEqual(process.returncode, 1)
self.assertTrue(stderr.startswith(expected),
@@ -158,20 +165,46 @@ class SysModuleTest(unittest.TestCase):
r'import sys; sys.exit("surrogates:\uDCFF")',
b"surrogates:\\udcff")
+ # test that the unicode message is encoded to the stderr encoding
+ # instead of the default encoding (utf8)
+ env = os.environ.copy()
+ env['PYTHONIOENCODING'] = 'latin-1'
+ check_exit_message(
+ r'import sys; sys.exit("h\xe9")',
+ b"h\xe9", env=env)
+
def test_getdefaultencoding(self):
self.assertRaises(TypeError, sys.getdefaultencoding, 42)
# can't check more than the type, as the user might have changed it
- self.assertTrue(isinstance(sys.getdefaultencoding(), str))
+ self.assertIsInstance(sys.getdefaultencoding(), str)
# testing sys.settrace() is done in test_sys_settrace.py
# testing sys.setprofile() is done in test_sys_setprofile.py
def test_setcheckinterval(self):
- self.assertRaises(TypeError, sys.setcheckinterval)
- orig = sys.getcheckinterval()
- for n in 0, 100, 120, orig: # orig last to restore starting state
- sys.setcheckinterval(n)
- self.assertEqual(sys.getcheckinterval(), n)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore")
+ self.assertRaises(TypeError, sys.setcheckinterval)
+ orig = sys.getcheckinterval()
+ for n in 0, 100, 120, orig: # orig last to restore starting state
+ sys.setcheckinterval(n)
+ self.assertEqual(sys.getcheckinterval(), n)
+
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ def test_switchinterval(self):
+ self.assertRaises(TypeError, sys.setswitchinterval)
+ self.assertRaises(TypeError, sys.setswitchinterval, "a")
+ self.assertRaises(ValueError, sys.setswitchinterval, -1.0)
+ self.assertRaises(ValueError, sys.setswitchinterval, 0.0)
+ orig = sys.getswitchinterval()
+ # sanity check
+ self.assertTrue(orig < 0.5, orig)
+ try:
+ for n in 0.00001, 0.05, 3.0, orig:
+ sys.setswitchinterval(n)
+ self.assertAlmostEqual(sys.getswitchinterval(), n)
+ finally:
+ sys.setswitchinterval(orig)
def test_recursionlimit(self):
self.assertRaises(TypeError, sys.getrecursionlimit, 42)
@@ -182,6 +215,8 @@ class SysModuleTest(unittest.TestCase):
self.assertEqual(sys.getrecursionlimit(), 10000)
sys.setrecursionlimit(oldlimit)
+ @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
+ 'fatal error if run with a trace function')
def test_recursionlimit_recovery(self):
# NOTE: this test is slightly fragile in that it depends on the current
# recursion count when executing the test being low enough so as to
@@ -226,15 +261,34 @@ class SysModuleTest(unittest.TestCase):
err)
def test_getwindowsversion(self):
- if hasattr(sys, "getwindowsversion"):
- v = sys.getwindowsversion()
- self.assertTrue(isinstance(v, tuple))
- self.assertEqual(len(v), 5)
- self.assertTrue(isinstance(v[0], int))
- self.assertTrue(isinstance(v[1], int))
- self.assertTrue(isinstance(v[2], int))
- self.assertTrue(isinstance(v[3], int))
- self.assertTrue(isinstance(v[4], str))
+ # Raise SkipTest if sys doesn't have getwindowsversion attribute
+ test.support.get_attribute(sys, "getwindowsversion")
+ v = sys.getwindowsversion()
+ self.assertEqual(len(v), 5)
+ self.assertIsInstance(v[0], int)
+ self.assertIsInstance(v[1], int)
+ self.assertIsInstance(v[2], int)
+ self.assertIsInstance(v[3], int)
+ self.assertIsInstance(v[4], str)
+ self.assertRaises(IndexError, operator.getitem, v, 5)
+ self.assertIsInstance(v.major, int)
+ self.assertIsInstance(v.minor, int)
+ self.assertIsInstance(v.build, int)
+ self.assertIsInstance(v.platform, int)
+ self.assertIsInstance(v.service_pack, str)
+ self.assertIsInstance(v.service_pack_minor, int)
+ self.assertIsInstance(v.service_pack_major, int)
+ self.assertIsInstance(v.suite_mask, int)
+ self.assertIsInstance(v.product_type, int)
+ self.assertEqual(v[0], v.major)
+ self.assertEqual(v[1], v.minor)
+ self.assertEqual(v[2], v.build)
+ self.assertEqual(v[3], v.platform)
+ self.assertEqual(v[4], v.service_pack)
+
+ # This is how platform.py calls it. Make sure tuple
+ # still has 5 elements
+ maj, min, buildno, plat, csd = sys.getwindowsversion()
def test_call_tracing(self):
self.assertRaises(TypeError, sys.call_tracing, type, 2)
@@ -262,7 +316,7 @@ class SysModuleTest(unittest.TestCase):
del n
self.assertEqual(sys.getrefcount(None), c)
if hasattr(sys, "gettotalrefcount"):
- self.assertTrue(isinstance(sys.gettotalrefcount(), int))
+ self.assertIsInstance(sys.gettotalrefcount(), int)
def test_getframe(self):
self.assertRaises(TypeError, sys._getframe, 42, 42)
@@ -286,6 +340,7 @@ class SysModuleTest(unittest.TestCase):
self.current_frames_without_threads()
# Test sys._current_frames() in a WITH_THREADS build.
+ @test.support.reap_threads
def current_frames_with_threads(self):
import threading, _thread
import traceback
@@ -318,8 +373,8 @@ class SysModuleTest(unittest.TestCase):
d = sys._current_frames()
main_id = _thread.get_ident()
- self.assertTrue(main_id in d)
- self.assertTrue(thread_id in d)
+ self.assertIn(main_id, d)
+ self.assertIn(thread_id, d)
# Verify that the captured main-thread frame is _this_ frame.
frame = d.pop(main_id)
@@ -341,7 +396,7 @@ class SysModuleTest(unittest.TestCase):
# And the next record must be for g456().
filename, lineno, funcname, sourceline = stack[i+1]
self.assertEqual(funcname, "g456")
- self.assertTrue(sourceline in ["leave_g.wait()", "entered_g.set()"])
+ self.assertIn(sourceline, ["leave_g.wait()", "entered_g.set()"])
# Reap the spawned thread.
leave_g.set()
@@ -353,17 +408,17 @@ class SysModuleTest(unittest.TestCase):
# "thread id" 0.
d = sys._current_frames()
self.assertEqual(len(d), 1)
- self.assertTrue(0 in d)
+ self.assertIn(0, d)
self.assertTrue(d[0] is sys._getframe())
def test_attributes(self):
- self.assertTrue(isinstance(sys.api_version, int))
- self.assertTrue(isinstance(sys.argv, list))
- self.assertTrue(sys.byteorder in ("little", "big"))
- self.assertTrue(isinstance(sys.builtin_module_names, tuple))
- self.assertTrue(isinstance(sys.copyright, str))
- self.assertTrue(isinstance(sys.exec_prefix, str))
- self.assertTrue(isinstance(sys.executable, str))
+ self.assertIsInstance(sys.api_version, int)
+ self.assertIsInstance(sys.argv, list)
+ self.assertIn(sys.byteorder, ("little", "big"))
+ self.assertIsInstance(sys.builtin_module_names, tuple)
+ self.assertIsInstance(sys.copyright, str)
+ self.assertIsInstance(sys.exec_prefix, str)
+ self.assertIsInstance(sys.executable, str)
self.assertEqual(len(sys.float_info), 11)
self.assertEqual(sys.float_info.radix, 2)
self.assertEqual(len(sys.int_info), 2)
@@ -371,32 +426,52 @@ class SysModuleTest(unittest.TestCase):
self.assertTrue(sys.int_info.sizeof_digit >= 1)
self.assertEqual(type(sys.int_info.bits_per_digit), int)
self.assertEqual(type(sys.int_info.sizeof_digit), int)
- self.assertTrue(isinstance(sys.hexversion, int))
- self.assertTrue(isinstance(sys.maxsize, int))
- self.assertTrue(isinstance(sys.maxunicode, int))
- self.assertTrue(isinstance(sys.platform, str))
- self.assertTrue(isinstance(sys.prefix, str))
- self.assertTrue(isinstance(sys.version, str))
+ self.assertIsInstance(sys.hexversion, int)
+
+ self.assertEqual(len(sys.hash_info), 5)
+ self.assertLess(sys.hash_info.modulus, 2**sys.hash_info.width)
+ # sys.hash_info.modulus should be a prime; we do a quick
+ # probable primality test (doesn't exclude the possibility of
+ # a Carmichael number)
+ for x in range(1, 100):
+ self.assertEqual(
+ pow(x, sys.hash_info.modulus-1, sys.hash_info.modulus),
+ 1,
+ "sys.hash_info.modulus {} is a non-prime".format(
+ sys.hash_info.modulus)
+ )
+ self.assertIsInstance(sys.hash_info.inf, int)
+ self.assertIsInstance(sys.hash_info.nan, int)
+ self.assertIsInstance(sys.hash_info.imag, int)
+
+ self.assertIsInstance(sys.maxsize, int)
+ self.assertIsInstance(sys.maxunicode, int)
+ self.assertIsInstance(sys.platform, str)
+ self.assertIsInstance(sys.prefix, str)
+ self.assertIsInstance(sys.version, str)
vi = sys.version_info
- self.assertTrue(isinstance(vi[:], tuple))
+ self.assertIsInstance(vi[:], tuple)
self.assertEqual(len(vi), 5)
- self.assertTrue(isinstance(vi[0], int))
- self.assertTrue(isinstance(vi[1], int))
- self.assertTrue(isinstance(vi[2], int))
- self.assertTrue(vi[3] in ("alpha", "beta", "candidate", "final"))
- self.assertTrue(isinstance(vi[4], int))
- self.assertTrue(isinstance(vi.major, int))
- self.assertTrue(isinstance(vi.minor, int))
- self.assertTrue(isinstance(vi.micro, int))
- self.assertTrue(vi.releaselevel in
- ("alpha", "beta", "candidate", "final"))
- self.assertTrue(isinstance(vi.serial, int))
+ self.assertIsInstance(vi[0], int)
+ self.assertIsInstance(vi[1], int)
+ self.assertIsInstance(vi[2], int)
+ self.assertIn(vi[3], ("alpha", "beta", "candidate", "final"))
+ self.assertIsInstance(vi[4], int)
+ self.assertIsInstance(vi.major, int)
+ self.assertIsInstance(vi.minor, int)
+ self.assertIsInstance(vi.micro, int)
+ self.assertIn(vi.releaselevel, ("alpha", "beta", "candidate", "final"))
+ self.assertIsInstance(vi.serial, int)
self.assertEqual(vi[0], vi.major)
self.assertEqual(vi[1], vi.minor)
self.assertEqual(vi[2], vi.micro)
self.assertEqual(vi[3], vi.releaselevel)
self.assertEqual(vi[4], vi.serial)
self.assertTrue(vi > (1,0,0))
+ self.assertIsInstance(sys.float_repr_style, str)
+ self.assertIn(sys.float_repr_style, ('short', 'legacy'))
+ if not sys.platform.startswith('win'):
+ self.assertIsInstance(sys.abiflags, str)
def test_43581(self):
# Can't use sys.stdout, as this is a StringIO object when
@@ -423,30 +498,12 @@ class SysModuleTest(unittest.TestCase):
self.assertRaises(TypeError, sys.intern, S("abc"))
- def test_main_invalid_unicode(self):
- import locale
- non_decodable = b"\xff"
- encoding = locale.getpreferredencoding()
- try:
- non_decodable.decode(encoding)
- except UnicodeDecodeError:
- pass
- else:
- self.skipTest('%r is decodable with encoding %s'
- % (non_decodable, encoding))
- code = b'print("' + non_decodable + b'")'
- p = subprocess.Popen([sys.executable, "-c", code], stderr=subprocess.PIPE)
- stdout, stderr = p.communicate()
- self.assertEqual(p.returncode, 1)
- self.assertTrue(b"UnicodeEncodeError:" in stderr,
- "%r not in %s" % (b"UnicodeEncodeError:", ascii(stderr)))
-
def test_sys_flags(self):
self.assertTrue(sys.flags)
attrs = ("debug", "division_warning",
"inspect", "interactive", "optimize", "dont_write_bytecode",
"no_user_site", "no_site", "ignore_environment", "verbose",
- "bytes_warning")
+ "bytes_warning", "quiet")
for attr in attrs:
self.assertTrue(hasattr(sys.flags, attr), attr)
self.assertEqual(type(getattr(sys.flags, attr)), int, attr)
@@ -465,13 +522,13 @@ class SysModuleTest(unittest.TestCase):
env["PYTHONIOENCODING"] = "cp424"
p = subprocess.Popen([sys.executable, "-c", 'print(chr(0xa2))'],
stdout = subprocess.PIPE, env=env)
- out = p.stdout.read()
+ out = p.communicate()[0].strip()
self.assertEqual(out, "\xa2\n".encode("cp424"))
env["PYTHONIOENCODING"] = "ascii:replace"
p = subprocess.Popen([sys.executable, "-c", 'print(chr(0xa2))'],
stdout = subprocess.PIPE, env=env)
- out = p.stdout.read().strip()
+ out = p.communicate()[0].strip()
self.assertEqual(out, b'?')
def test_executable(self):
@@ -491,6 +548,22 @@ class SysModuleTest(unittest.TestCase):
p.wait()
self.assertIn(executable, ["b''", repr(sys.executable.encode("ascii", "backslashreplace"))])
+ def check_fsencoding(self, fs_encoding, expected=None):
+ self.assertIsNotNone(fs_encoding)
+ codecs.lookup(fs_encoding)
+ if expected:
+ self.assertEqual(fs_encoding, expected)
+
+ def test_getfilesystemencoding(self):
+ fs_encoding = sys.getfilesystemencoding()
+ if sys.platform == 'darwin':
+ expected = 'utf-8'
+ elif sys.platform == 'win32':
+ expected = 'mbcs'
+ else:
+ expected = None
+ self.check_fsencoding(fs_encoding, expected)
+
class SizeofTest(unittest.TestCase):
@@ -498,7 +571,7 @@ class SizeofTest(unittest.TestCase):
TPFLAGS_HEAPTYPE = 1<<9
def setUp(self):
- self.c = len(struct.pack('c', ' '))
+ self.c = len(struct.pack('c', b' '))
self.H = len(struct.pack('H', 0))
self.i = len(struct.pack('i', 0))
self.l = len(struct.pack('l', 0))
@@ -583,7 +656,7 @@ class SizeofTest(unittest.TestCase):
return inner
check(get_cell().__closure__[0], size(h + 'P'))
# code
- check(get_cell().__code__, size(h + '5i8Pi2P'))
+ check(get_cell().__code__, size(h + '5i8Pi3P'))
# complex
check(complex(0,1), size(h + '2d'))
# method_descriptor (descriptor object)
@@ -688,7 +761,7 @@ class SizeofTest(unittest.TestCase):
check(int(PyLong_BASE**2-1), size(vh) + 2*self.longdigit)
check(int(PyLong_BASE**2), size(vh) + 3*self.longdigit)
# memory
- check(memoryview(b''), size(h + 'P PP2P2i7P'))
+ check(memoryview(b''), size(h + 'PP2P2i7P'))
# module
check(unittest, size(h + '3P'))
# None
@@ -711,8 +784,8 @@ class SizeofTest(unittest.TestCase):
# reverse
check(reversed(''), size(h + 'PP'))
# range
- check(range(1), size(h + '3P'))
- check(range(66000), size(h + '3P'))
+ check(range(1), size(h + '4P'))
+ check(range(66000), size(h + '4P'))
# set
# frozenset
PySet_MINSIZE = 8
@@ -756,7 +829,7 @@ class SizeofTest(unittest.TestCase):
# we need to test for both sizes, because we don't know if the string
# has been cached
for s in samples:
- basicsize = size(h + 'PPliP') + usize * (len(s) + 1)
+ basicsize = size(h + 'PPPiP') + usize * (len(s) + 1)
check(s, basicsize)
# weakref
import weakref
@@ -790,47 +863,6 @@ class SizeofTest(unittest.TestCase):
# sys.flags
check(sys.flags, size(vh) + self.P * len(sys.flags))
- def test_getfilesystemencoding(self):
- import codecs
-
- def check_fsencoding(fs_encoding):
- if sys.platform == 'darwin':
- self.assertEqual(fs_encoding, 'utf-8')
- elif fs_encoding is None:
- return
- codecs.lookup(fs_encoding)
-
- fs_encoding = sys.getfilesystemencoding()
- check_fsencoding(fs_encoding)
-
- # Even in C locale
- try:
- sys.executable.encode('ascii')
- except UnicodeEncodeError:
- # Python doesn't start with ASCII locale if its path is not ASCII,
- # see issue #8611
- pass
- else:
- env = os.environ.copy()
- env['LANG'] = 'C'
- output = subprocess.check_output(
- [sys.executable, "-c",
- "import sys; print(sys.getfilesystemencoding())"],
- env=env)
- fs_encoding = output.rstrip().decode('ascii')
- check_fsencoding(fs_encoding)
-
- def test_setfilesystemencoding(self):
- old = sys.getfilesystemencoding()
- try:
- sys.setfilesystemencoding("iso-8859-1")
- self.assertEqual(sys.getfilesystemencoding(), "iso-8859-1")
- finally:
- sys.setfilesystemencoding(old)
- try:
- self.assertRaises(LookupError, sys.setfilesystemencoding, "xxx")
- finally:
- sys.setfilesystemencoding(old)
def test_main():
test.support.run_unittest(SysModuleTest, SizeofTest)
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
new file mode 100644
index 0000000000..193b5f00c4
--- /dev/null
+++ b/Lib/test/test_sysconfig.py
@@ -0,0 +1,298 @@
+"""Tests for 'site'.
+
+Tests assume the initial paths in sys.path once the interpreter has begun
+executing have not been removed.
+
+"""
+import unittest
+import sys
+import os
+import subprocess
+import shutil
+from copy import copy, deepcopy
+
+from test.support import (run_unittest, TESTFN, unlink, get_attribute,
+ captured_stdout, skip_unless_symlink)
+
+import sysconfig
+from sysconfig import (get_paths, get_platform, get_config_vars,
+ get_path, get_path_names, _INSTALL_SCHEMES,
+ _get_default_scheme, _expand_vars,
+ get_scheme_names, get_config_var, _main)
+
+class TestSysConfig(unittest.TestCase):
+
+ def setUp(self):
+ """Make a copy of sys.path"""
+ super(TestSysConfig, self).setUp()
+ self.sys_path = sys.path[:]
+ self.makefile = None
+ # patching os.uname
+ if hasattr(os, 'uname'):
+ self.uname = os.uname
+ self._uname = os.uname()
+ else:
+ self.uname = None
+ self._uname = None
+ os.uname = self._get_uname
+ # saving the environment
+ self.name = os.name
+ self.platform = sys.platform
+ self.version = sys.version
+ self.sep = os.sep
+ self.join = os.path.join
+ self.isabs = os.path.isabs
+ self.splitdrive = os.path.splitdrive
+ self._config_vars = copy(sysconfig._CONFIG_VARS)
+ self.old_environ = deepcopy(os.environ)
+
+ def tearDown(self):
+ """Restore sys.path"""
+ sys.path[:] = self.sys_path
+ if self.makefile is not None:
+ os.unlink(self.makefile)
+ self._cleanup_testfn()
+ if self.uname is not None:
+ os.uname = self.uname
+ else:
+ del os.uname
+ os.name = self.name
+ sys.platform = self.platform
+ sys.version = self.version
+ os.sep = self.sep
+ os.path.join = self.join
+ os.path.isabs = self.isabs
+ os.path.splitdrive = self.splitdrive
+ sysconfig._CONFIG_VARS = copy(self._config_vars)
+ for key, value in self.old_environ.items():
+ if os.environ.get(key) != value:
+ os.environ[key] = value
+
+ for key in list(os.environ.keys()):
+ if key not in self.old_environ:
+ del os.environ[key]
+
+ super(TestSysConfig, self).tearDown()
+
+ def _set_uname(self, uname):
+ self._uname = uname
+
+ def _get_uname(self):
+ return self._uname
+
+ def _cleanup_testfn(self):
+ path = TESTFN
+ if os.path.isfile(path):
+ os.remove(path)
+ elif os.path.isdir(path):
+ shutil.rmtree(path)
+
+ def test_get_path_names(self):
+ self.assertEqual(get_path_names(), sysconfig._SCHEME_KEYS)
+
+ def test_get_paths(self):
+ scheme = get_paths()
+ default_scheme = _get_default_scheme()
+ wanted = _expand_vars(default_scheme, None)
+ wanted = list(wanted.items())
+ wanted.sort()
+ scheme = list(scheme.items())
+ scheme.sort()
+ self.assertEqual(scheme, wanted)
+
+ def test_get_path(self):
+ # xxx make real tests here
+ for scheme in _INSTALL_SCHEMES:
+ for name in _INSTALL_SCHEMES[scheme]:
+ res = get_path(name, scheme)
+
+ def test_get_config_vars(self):
+ cvars = get_config_vars()
+ self.assertTrue(isinstance(cvars, dict))
+ self.assertTrue(cvars)
+
+ def test_get_platform(self):
+ # windows XP, 32bits
+ os.name = 'nt'
+ sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
+ '[MSC v.1310 32 bit (Intel)]')
+ sys.platform = 'win32'
+ self.assertEqual(get_platform(), 'win32')
+
+ # windows XP, amd64
+ os.name = 'nt'
+ sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
+ '[MSC v.1310 32 bit (Amd64)]')
+ sys.platform = 'win32'
+ self.assertEqual(get_platform(), 'win-amd64')
+
+ # windows XP, itanium
+ os.name = 'nt'
+ sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
+ '[MSC v.1310 32 bit (Itanium)]')
+ sys.platform = 'win32'
+ self.assertEqual(get_platform(), 'win-ia64')
+
+ # macbook
+ os.name = 'posix'
+ sys.version = ('2.5 (r25:51918, Sep 19 2006, 08:49:13) '
+ '\n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]')
+ sys.platform = 'darwin'
+ self._set_uname(('Darwin', 'macziade', '8.11.1',
+ ('Darwin Kernel Version 8.11.1: '
+ 'Wed Oct 10 18:23:28 PDT 2007; '
+ 'root:xnu-792.25.20~1/RELEASE_I386'), 'PowerPC'))
+ os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
+
+ get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
+ '-fwrapv -O3 -Wall -Wstrict-prototypes')
+
+ maxint = sys.maxsize
+ try:
+ sys.maxsize = 2147483647
+ self.assertEqual(get_platform(), 'macosx-10.3-ppc')
+ sys.maxsize = 9223372036854775807
+ self.assertEqual(get_platform(), 'macosx-10.3-ppc64')
+ finally:
+ sys.maxsize = maxint
+
+
+ self._set_uname(('Darwin', 'macziade', '8.11.1',
+ ('Darwin Kernel Version 8.11.1: '
+ 'Wed Oct 10 18:23:28 PDT 2007; '
+ 'root:xnu-792.25.20~1/RELEASE_I386'), 'i386'))
+ get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
+ os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
+
+ get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
+ '-fwrapv -O3 -Wall -Wstrict-prototypes')
+ maxint = sys.maxsize
+ try:
+ sys.maxsize = 2147483647
+ self.assertEqual(get_platform(), 'macosx-10.3-i386')
+ sys.maxsize = 9223372036854775807
+ self.assertEqual(get_platform(), 'macosx-10.3-x86_64')
+ finally:
+ sys.maxsize = maxint
+
+ # macbook with fat binaries (fat, universal or fat64)
+ os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
+ get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+
+ self.assertEqual(get_platform(), 'macosx-10.4-fat')
+
+ get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+
+ self.assertEqual(get_platform(), 'macosx-10.4-intel')
+
+ get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+ self.assertEqual(get_platform(), 'macosx-10.4-fat3')
+
+ get_config_vars()['CFLAGS'] = ('-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+ self.assertEqual(get_platform(), 'macosx-10.4-universal')
+
+ get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc64 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+
+ self.assertEqual(get_platform(), 'macosx-10.4-fat64')
+
+ for arch in ('ppc', 'i386', 'x86_64', 'ppc64'):
+ get_config_vars()['CFLAGS'] = ('-arch %s -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3'%(arch,))
+
+ self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,))
+
+ # linux debian sarge
+ os.name = 'posix'
+ sys.version = ('2.3.5 (#1, Jul 4 2007, 17:28:59) '
+ '\n[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]')
+ sys.platform = 'linux2'
+ self._set_uname(('Linux', 'aglae', '2.6.21.1dedibox-r7',
+ '#1 Mon Apr 30 17:25:38 CEST 2007', 'i686'))
+
+ self.assertEqual(get_platform(), 'linux-i686')
+
+ # XXX more platforms to tests here
+
+ def test_get_config_h_filename(self):
+ config_h = sysconfig.get_config_h_filename()
+ self.assertTrue(os.path.isfile(config_h), config_h)
+
+ @unittest.skipIf(sys.platform.startswith('win'),
+ 'Test is not Windows compatible')
+ def test_get_makefile_filename(self):
+ makefile = sysconfig.get_makefile_filename()
+ self.assertTrue(os.path.isfile(makefile), makefile)
+
+ def test_get_scheme_names(self):
+ wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user',
+ 'posix_home', 'posix_prefix', 'posix_user')
+ self.assertEqual(get_scheme_names(), wanted)
+
+ @skip_unless_symlink
+ def test_symlink(self):
+ # On Windows, the EXE needs to know where pythonXY.dll is at so we have
+ # to add the directory to the path.
+ if sys.platform == "win32":
+ os.environ["Path"] = "{};{}".format(
+ os.path.dirname(sys.executable), os.environ["Path"])
+
+ # Issue 7880
+ def get(python):
+ cmd = [python, '-c',
+ 'import sysconfig; print(sysconfig.get_platform())']
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=os.environ)
+ return p.communicate()
+ real = os.path.realpath(sys.executable)
+ link = os.path.abspath(TESTFN)
+ os.symlink(real, link)
+ try:
+ self.assertEqual(get(real), get(link))
+ finally:
+ unlink(link)
+
+ def test_user_similar(self):
+ # Issue 8759 : make sure the posix scheme for the users
+ # is similar to the global posix_prefix one
+ base = get_config_var('base')
+ user = get_config_var('userbase')
+ for name in ('stdlib', 'platstdlib', 'purelib', 'platlib'):
+ global_path = get_path(name, 'posix_prefix')
+ user_path = get_path(name, 'posix_user')
+ self.assertEqual(user_path, global_path.replace(base, user))
+
+ def test_main(self):
+ # just making sure _main() runs and returns things in the stdout
+ with captured_stdout() as output:
+ _main()
+ self.assertTrue(len(output.getvalue().split('\n')) > 0)
+
+ @unittest.skipIf(sys.platform == "win32", "Does not apply to Windows")
+ def test_ldshared_value(self):
+ ldflags = sysconfig.get_config_var('LDFLAGS')
+ ldshared = sysconfig.get_config_var('LDSHARED')
+
+ self.assertIn(ldflags, ldshared)
+
+
+def test_main():
+ run_unittest(TestSysConfig)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_syslog.py b/Lib/test/test_syslog.py
index 028dcb49aa..4e7621e5ec 100644
--- a/Lib/test/test_syslog.py
+++ b/Lib/test/test_syslog.py
@@ -11,6 +11,8 @@ class Test(unittest.TestCase):
def test_openlog(self):
syslog.openlog('python')
+ # Issue #6697.
+ self.assertRaises(UnicodeEncodeError, syslog.openlog, '\uD800')
def test_syslog(self):
syslog.openlog('python')
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 6c7db9535f..8036c5cda1 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -2,7 +2,6 @@ import sys
import os
import io
import shutil
-import tempfile
import io
from hashlib import md5
import errno
@@ -26,7 +25,7 @@ except ImportError:
def md5sum(data):
return md5(data).hexdigest()
-TEMPDIR = os.path.abspath(support.TESTFN)
+TEMPDIR = os.path.abspath(support.TESTFN) + "-tardir"
tarname = support.findfile("testtar.tar")
gzipname = os.path.join(TEMPDIR, "testtar.tar.gz")
bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
@@ -53,41 +52,50 @@ class UstarReadTest(ReadTest):
def test_fileobj_regular_file(self):
tarinfo = self.tar.getmember("ustar/regtype")
fobj = self.tar.extractfile(tarinfo)
- data = fobj.read()
- self.assertTrue((len(data), md5sum(data)) == (tarinfo.size, md5_regtype),
- "regular file extraction failed")
+ try:
+ data = fobj.read()
+ self.assertTrue((len(data), md5sum(data)) == (tarinfo.size, md5_regtype),
+ "regular file extraction failed")
+ finally:
+ fobj.close()
def test_fileobj_readlines(self):
self.tar.extract("ustar/regtype", TEMPDIR)
tarinfo = self.tar.getmember("ustar/regtype")
- fobj1 = open(os.path.join(TEMPDIR, "ustar/regtype"), "r")
- fobj2 = io.TextIOWrapper(self.tar.extractfile(tarinfo))
-
- lines1 = fobj1.readlines()
- lines2 = fobj2.readlines()
- self.assertTrue(lines1 == lines2,
- "fileobj.readlines() failed")
- self.assertTrue(len(lines2) == 114,
- "fileobj.readlines() failed")
- self.assertTrue(lines2[83] == \
- "I will gladly admit that Python is not the fastest running scripting language.\n",
- "fileobj.readlines() failed")
+ with open(os.path.join(TEMPDIR, "ustar/regtype"), "r") as fobj1:
+ lines1 = fobj1.readlines()
+
+ fobj = self.tar.extractfile(tarinfo)
+ try:
+ fobj2 = io.TextIOWrapper(fobj)
+ lines2 = fobj2.readlines()
+ self.assertTrue(lines1 == lines2,
+ "fileobj.readlines() failed")
+ self.assertTrue(len(lines2) == 114,
+ "fileobj.readlines() failed")
+ self.assertTrue(lines2[83] ==
+ "I will gladly admit that Python is not the fastest running scripting language.\n",
+ "fileobj.readlines() failed")
+ finally:
+ fobj.close()
def test_fileobj_iter(self):
self.tar.extract("ustar/regtype", TEMPDIR)
tarinfo = self.tar.getmember("ustar/regtype")
- fobj1 = open(os.path.join(TEMPDIR, "ustar/regtype"), "rU")
+ with open(os.path.join(TEMPDIR, "ustar/regtype"), "rU") as fobj1:
+ lines1 = fobj1.readlines()
fobj2 = self.tar.extractfile(tarinfo)
- lines1 = fobj1.readlines()
- lines2 = list(io.TextIOWrapper(fobj2))
- self.assertTrue(lines1 == lines2,
- "fileobj.__iter__() failed")
+ try:
+ lines2 = list(io.TextIOWrapper(fobj2))
+ self.assertTrue(lines1 == lines2,
+ "fileobj.__iter__() failed")
+ finally:
+ fobj2.close()
def test_fileobj_seek(self):
self.tar.extract("ustar/regtype", TEMPDIR)
- fobj = open(os.path.join(TEMPDIR, "ustar/regtype"), "rb")
- data = fobj.read()
- fobj.close()
+ with open(os.path.join(TEMPDIR, "ustar/regtype"), "rb") as fobj:
+ data = fobj.read()
tarinfo = self.tar.getmember("ustar/regtype")
fobj = self.tar.extractfile(tarinfo)
@@ -134,38 +142,120 @@ class UstarReadTest(ReadTest):
"read() after readline() failed")
fobj.close()
+ # Test if symbolic and hard links are resolved by extractfile(). The
+ # test link members each point to a regular member whose data is
+ # supposed to be exported.
+ def _test_fileobj_link(self, lnktype, regtype):
+ a = self.tar.extractfile(lnktype)
+ b = self.tar.extractfile(regtype)
+ try:
+ self.assertEqual(a.name, b.name)
+ finally:
+ a.close()
+ b.close()
+
+ def test_fileobj_link1(self):
+ self._test_fileobj_link("ustar/lnktype", "ustar/regtype")
+
+ def test_fileobj_link2(self):
+ self._test_fileobj_link("./ustar/linktest2/lnktype", "ustar/linktest1/regtype")
+
+ def test_fileobj_symlink1(self):
+ self._test_fileobj_link("ustar/symtype", "ustar/regtype")
+
+ def test_fileobj_symlink2(self):
+ self._test_fileobj_link("./ustar/linktest2/symtype", "ustar/linktest1/regtype")
+
+
+class CommonReadTest(ReadTest):
+
+ def test_empty_tarfile(self):
+ # Test for issue6123: Allow opening empty archives.
+ # This test checks if tarfile.open() is able to open an empty tar
+ # archive successfully. Note that an empty tar archive is not the
+ # same as an empty file!
+ with tarfile.open(tmpname, self.mode.replace("r", "w")):
+ pass
+ try:
+ tar = tarfile.open(tmpname, self.mode)
+ tar.getnames()
+ except tarfile.ReadError:
+ self.fail("tarfile.open() failed on empty archive")
+ else:
+ self.assertListEqual(tar.getmembers(), [])
+ finally:
+ tar.close()
+
+ def test_null_tarfile(self):
+ # Test for issue6123: Allow opening empty archives.
+ # This test guarantees that tarfile.open() does not treat an empty
+ # file as an empty tar archive.
+ with open(tmpname, "wb"):
+ pass
+ self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, self.mode)
+ self.assertRaises(tarfile.ReadError, tarfile.open, tmpname)
+
+ def test_ignore_zeros(self):
+ # Test TarFile's ignore_zeros option.
+ if self.mode.endswith(":gz"):
+ _open = gzip.GzipFile
+ elif self.mode.endswith(":bz2"):
+ _open = bz2.BZ2File
+ else:
+ _open = open
+
+ for char in (b'\0', b'a'):
+ # Test if EOFHeaderError ('\0') and InvalidHeaderError ('a')
+ # are ignored correctly.
+ with _open(tmpname, "wb") as fobj:
+ fobj.write(char * 1024)
+ fobj.write(tarfile.TarInfo("foo").tobuf())
+
+ tar = tarfile.open(tmpname, mode="r", ignore_zeros=True)
+ try:
+ self.assertListEqual(tar.getnames(), ["foo"],
+ "ignore_zeros=True should have skipped the %r-blocks" % char)
+ finally:
+ tar.close()
-class MiscReadTest(ReadTest):
+
+class MiscReadTest(CommonReadTest):
def test_no_name_argument(self):
- fobj = open(self.tarname, "rb")
- tar = tarfile.open(fileobj=fobj, mode=self.mode)
- self.assertEqual(tar.name, os.path.abspath(fobj.name))
+ with open(self.tarname, "rb") as fobj:
+ tar = tarfile.open(fileobj=fobj, mode=self.mode)
+ self.assertEqual(tar.name, os.path.abspath(fobj.name))
def test_no_name_attribute(self):
- data = open(self.tarname, "rb").read()
+ with open(self.tarname, "rb") as fobj:
+ data = fobj.read()
fobj = io.BytesIO(data)
self.assertRaises(AttributeError, getattr, fobj, "name")
tar = tarfile.open(fileobj=fobj, mode=self.mode)
self.assertEqual(tar.name, None)
def test_empty_name_attribute(self):
- data = open(self.tarname, "rb").read()
+ with open(self.tarname, "rb") as fobj:
+ data = fobj.read()
fobj = io.BytesIO(data)
fobj.name = ""
- tar = tarfile.open(fileobj=fobj, mode=self.mode)
- self.assertEqual(tar.name, None)
+ with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
+ self.assertEqual(tar.name, None)
def test_fileobj_with_offset(self):
# Skip the first member and store values from the second member
# of the testtar.
tar = tarfile.open(self.tarname, mode=self.mode)
- tar.next()
- t = tar.next()
- name = t.name
- offset = t.offset
- data = tar.extractfile(t).read()
- tar.close()
+ try:
+ tar.next()
+ t = tar.next()
+ name = t.name
+ offset = t.offset
+ f = tar.extractfile(t)
+ data = f.read()
+ f.close()
+ finally:
+ tar.close()
# Open the testtar and seek to the offset of the second member.
if self.mode.endswith(":gz"):
@@ -175,26 +265,30 @@ class MiscReadTest(ReadTest):
else:
_open = open
fobj = _open(self.tarname, "rb")
- fobj.seek(offset)
-
- # Test if the tarfile starts with the second member.
- tar = tar.open(self.tarname, mode="r:", fileobj=fobj)
- t = tar.next()
- self.assertEqual(t.name, name)
- # Read to the end of fileobj and test if seeking back to the
- # beginning works.
- tar.getmembers()
- self.assertEqual(tar.extractfile(t).read(), data,
- "seek back did not work")
- tar.close()
+ try:
+ fobj.seek(offset)
+
+ # Test if the tarfile starts with the second member.
+ tar = tar.open(self.tarname, mode="r:", fileobj=fobj)
+ t = tar.next()
+ self.assertEqual(t.name, name)
+ # Read to the end of fileobj and test if seeking back to the
+ # beginning works.
+ tar.getmembers()
+ self.assertEqual(tar.extractfile(t).read(), data,
+ "seek back did not work")
+ tar.close()
+ finally:
+ fobj.close()
def test_fail_comp(self):
# For Gzip and Bz2 Tests: fail with a ReadError on an uncompressed file.
if self.mode == "r:":
return
self.assertRaises(tarfile.ReadError, tarfile.open, tarname, self.mode)
- fobj = open(tarname, "rb")
- self.assertRaises(tarfile.ReadError, tarfile.open, fileobj=fobj, mode=self.mode)
+ with open(tarname, "rb") as fobj:
+ self.assertRaises(tarfile.ReadError, tarfile.open,
+ fileobj=fobj, mode=self.mode)
def test_v7_dirtype(self):
# Test old style dirtype member (bug #1336623):
@@ -226,66 +320,121 @@ class MiscReadTest(ReadTest):
self.assertTrue(self.tar.getmembers()[-1].name == "misc/eof",
"could not find all members")
+ @unittest.skipUnless(hasattr(os, "link"),
+ "Missing hardlink implementation")
+ @support.skip_unless_symlink
def test_extract_hardlink(self):
# Test hardlink extraction (e.g. bug #857297).
tar = tarfile.open(tarname, errorlevel=1, encoding="iso8859-1")
- tar.extract("ustar/regtype", TEMPDIR)
try:
- tar.extract("ustar/lnktype", TEMPDIR)
- except EnvironmentError as e:
- if e.errno == errno.ENOENT:
- self.fail("hardlink not extracted properly")
-
- data = open(os.path.join(TEMPDIR, "ustar/lnktype"), "rb").read()
- self.assertEqual(md5sum(data), md5_regtype)
+ tar.extract("ustar/regtype", TEMPDIR)
+ try:
+ tar.extract("ustar/lnktype", TEMPDIR)
+ except EnvironmentError as e:
+ if e.errno == errno.ENOENT:
+ self.fail("hardlink not extracted properly")
- try:
- tar.extract("ustar/symtype", TEMPDIR)
- except EnvironmentError as e:
- if e.errno == errno.ENOENT:
- self.fail("symlink not extracted properly")
+ with open(os.path.join(TEMPDIR, "ustar/lnktype"), "rb") as f:
+ data = f.read()
+ self.assertEqual(md5sum(data), md5_regtype)
- data = open(os.path.join(TEMPDIR, "ustar/symtype"), "rb").read()
- self.assertEqual(md5sum(data), md5_regtype)
+ try:
+ tar.extract("ustar/symtype", TEMPDIR)
+ except EnvironmentError as e:
+ if e.errno == errno.ENOENT:
+ self.fail("symlink not extracted properly")
+
+ with open(os.path.join(TEMPDIR, "ustar/symtype"), "rb") as f:
+ data = f.read()
+ self.assertEqual(md5sum(data), md5_regtype)
+ finally:
+ tar.close()
def test_extractall(self):
# Test if extractall() correctly restores directory permissions
# and times (see issue1735).
tar = tarfile.open(tarname, encoding="iso8859-1")
- directories = [t for t in tar if t.isdir()]
- tar.extractall(TEMPDIR, directories)
- for tarinfo in directories:
- path = os.path.join(TEMPDIR, tarinfo.name)
- if sys.platform != "win32":
- # Win32 has no support for fine grained permissions.
- self.assertEqual(tarinfo.mode & 0o777, os.stat(path).st_mode & 0o777)
- self.assertEqual(tarinfo.mtime, os.path.getmtime(path))
- tar.close()
+ DIR = os.path.join(TEMPDIR, "extractall")
+ os.mkdir(DIR)
+ try:
+ directories = [t for t in tar if t.isdir()]
+ tar.extractall(DIR, directories)
+ for tarinfo in directories:
+ path = os.path.join(DIR, tarinfo.name)
+ if sys.platform != "win32":
+ # Win32 has no support for fine grained permissions.
+ self.assertEqual(tarinfo.mode & 0o777, os.stat(path).st_mode & 0o777)
+ def format_mtime(mtime):
+ if isinstance(mtime, float):
+ return "{} ({})".format(mtime, mtime.hex())
+ else:
+ return "{!r} (int)".format(mtime)
+ file_mtime = os.path.getmtime(path)
+ errmsg = "tar mtime {0} != file time {1} of path {2!a}".format(
+ format_mtime(tarinfo.mtime),
+ format_mtime(file_mtime),
+ path)
+ self.assertEqual(tarinfo.mtime, file_mtime, errmsg)
+ finally:
+ tar.close()
+ shutil.rmtree(DIR)
+
+ def test_extract_directory(self):
+ dirtype = "ustar/dirtype"
+ DIR = os.path.join(TEMPDIR, "extractdir")
+ os.mkdir(DIR)
+ try:
+ with tarfile.open(tarname, encoding="iso8859-1") as tar:
+ tarinfo = tar.getmember(dirtype)
+ tar.extract(tarinfo, path=DIR)
+ extracted = os.path.join(DIR, dirtype)
+ self.assertEqual(os.path.getmtime(extracted), tarinfo.mtime)
+ if sys.platform != "win32":
+ self.assertEqual(os.stat(extracted).st_mode & 0o777, 0o755)
+ finally:
+ shutil.rmtree(DIR)
def test_init_close_fobj(self):
# Issue #7341: Close the internal file object in the TarFile
# constructor in case of an error. For the test we rely on
- # the fact that opening an invalid file raises a ReadError.
- invalid = os.path.join(TEMPDIR, "invalid")
- open(invalid, "wb").write(b"foo")
+ # the fact that opening an empty file raises a ReadError.
+ empty = os.path.join(TEMPDIR, "empty")
+ with open(empty, "wb") as fobj:
+ fobj.write(b"")
try:
tar = object.__new__(tarfile.TarFile)
try:
- tar.__init__(invalid)
+ tar.__init__(empty)
except tarfile.ReadError:
self.assertTrue(tar.fileobj.closed)
else:
self.fail("ReadError not raised")
finally:
- os.remove(invalid)
+ support.unlink(empty)
-class StreamReadTest(ReadTest):
+class StreamReadTest(CommonReadTest):
mode="r|"
+ def test_read_through(self):
+ # Issue #11224: A poorly designed _FileInFile.read() method
+ # caused seeking errors with stream tar files.
+ for tarinfo in self.tar:
+ if not tarinfo.isreg():
+ continue
+ fobj = self.tar.extractfile(tarinfo)
+ while True:
+ try:
+ buf = fobj.read(512)
+ except tarfile.StreamError:
+ self.fail("simple read-through using TarFile.extractfile() failed")
+ if not buf:
+ break
+ fobj.close()
+
def test_fileobj_regular_file(self):
tarinfo = self.tar.next() # get "regtype" (can't use getmember)
fobj = self.tar.extractfile(tarinfo)
@@ -300,42 +449,48 @@ class StreamReadTest(ReadTest):
def test_compare_members(self):
tar1 = tarfile.open(tarname, encoding="iso8859-1")
- tar2 = self.tar
-
- while True:
- t1 = tar1.next()
- t2 = tar2.next()
- if t1 is None:
- break
- self.assertTrue(t2 is not None, "stream.next() failed.")
-
- if t2.islnk() or t2.issym():
- self.assertRaises(tarfile.StreamError, tar2.extractfile, t2)
- continue
-
- v1 = tar1.extractfile(t1)
- v2 = tar2.extractfile(t2)
- if v1 is None:
- continue
- self.assertTrue(v2 is not None, "stream.extractfile() failed")
- self.assertEqual(v1.read(), v2.read(), "stream extraction failed")
-
- tar1.close()
+ try:
+ tar2 = self.tar
+
+ while True:
+ t1 = tar1.next()
+ t2 = tar2.next()
+ if t1 is None:
+ break
+ self.assertTrue(t2 is not None, "stream.next() failed.")
+
+ if t2.islnk() or t2.issym():
+ self.assertRaises(tarfile.StreamError, tar2.extractfile, t2)
+ continue
+
+ v1 = tar1.extractfile(t1)
+ v2 = tar2.extractfile(t2)
+ if v1 is None:
+ continue
+ self.assertTrue(v2 is not None, "stream.extractfile() failed")
+ self.assertEqual(v1.read(), v2.read(), "stream extraction failed")
+ finally:
+ tar1.close()
class DetectReadTest(unittest.TestCase):
def _testfunc_file(self, name, mode):
try:
- tarfile.open(name, mode)
+ tar = tarfile.open(name, mode)
except tarfile.ReadError as e:
self.fail()
+ else:
+ tar.close()
def _testfunc_fileobj(self, name, mode):
try:
- tarfile.open(name, mode, fileobj=open(name, "rb"))
+ with open(name, "rb") as f:
+ tar = tarfile.open(name, mode, fileobj=f)
except tarfile.ReadError as e:
self.fail()
+ else:
+ tar.close()
def _test_modes(self, testfunc):
testfunc(tarname, "r")
@@ -433,19 +588,36 @@ class MemberReadTest(ReadTest):
tarinfo = self.tar.getmember("ustar/sparse")
self._test_member(tarinfo, size=86016, chksum=md5_sparse)
+ def test_find_gnusparse(self):
+ tarinfo = self.tar.getmember("gnu/sparse")
+ self._test_member(tarinfo, size=86016, chksum=md5_sparse)
+
+ def test_find_gnusparse_00(self):
+ tarinfo = self.tar.getmember("gnu/sparse-0.0")
+ self._test_member(tarinfo, size=86016, chksum=md5_sparse)
+
+ def test_find_gnusparse_01(self):
+ tarinfo = self.tar.getmember("gnu/sparse-0.1")
+ self._test_member(tarinfo, size=86016, chksum=md5_sparse)
+
+ def test_find_gnusparse_10(self):
+ tarinfo = self.tar.getmember("gnu/sparse-1.0")
+ self._test_member(tarinfo, size=86016, chksum=md5_sparse)
+
def test_find_umlauts(self):
tarinfo = self.tar.getmember("ustar/umlauts-\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
self._test_member(tarinfo, size=7011, chksum=md5_regtype)
def test_find_ustar_longname(self):
name = "ustar/" + "12345/" * 39 + "1234567/longname"
- self.assertTrue(name in self.tar.getnames())
+ self.assertIn(name, self.tar.getnames())
def test_find_regtype_oldv7(self):
tarinfo = self.tar.getmember("misc/regtype-old-v7")
self._test_member(tarinfo, size=7011, chksum=md5_regtype)
def test_find_pax_umlauts(self):
+ self.tar.close()
self.tar = tarfile.open(self.tarname, mode=self.mode, encoding="iso8859-1")
tarinfo = self.tar.getmember("pax/umlauts-\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
self._test_member(tarinfo, size=7011, chksum=md5_regtype)
@@ -484,10 +656,10 @@ class LongnameTest(ReadTest):
# the preceding extended header.
longname = self.subdir + "/" + "123/" * 125 + "longname"
offset = self.tar.getmember(longname).offset
- fobj = open(tarname, "rb")
- fobj.seek(offset)
- tarinfo = tarfile.TarInfo.frombuf(fobj.read(512), "iso8859-1", "strict")
- self.assertEqual(tarinfo.type, self.longnametype)
+ with open(tarname, "rb") as fobj:
+ fobj.seek(offset)
+ tarinfo = tarfile.TarInfo.frombuf(fobj.read(512), "iso8859-1", "strict")
+ self.assertEqual(tarinfo.type, self.longnametype)
class GNUReadTest(LongnameTest):
@@ -495,13 +667,53 @@ class GNUReadTest(LongnameTest):
subdir = "gnu"
longnametype = tarfile.GNUTYPE_LONGNAME
- def test_sparse_file(self):
- tarinfo1 = self.tar.getmember("ustar/sparse")
- fobj1 = self.tar.extractfile(tarinfo1)
- tarinfo2 = self.tar.getmember("gnu/sparse")
- fobj2 = self.tar.extractfile(tarinfo2)
- self.assertEqual(fobj1.read(), fobj2.read(),
- "sparse file extraction failed")
+ # Since 3.2 tarfile is supposed to accurately restore sparse members and
+ # produce files with holes. This is what we actually want to test here.
+ # Unfortunately, not all platforms/filesystems support sparse files, and
+ # even on platforms that do it is non-trivial to make reliable assertions
+ # about holes in files. Therefore, we first do one basic test which works
+ # an all platforms, and after that a test that will work only on
+ # platforms/filesystems that prove to support sparse files.
+ def _test_sparse_file(self, name):
+ self.tar.extract(name, TEMPDIR)
+ filename = os.path.join(TEMPDIR, name)
+ with open(filename, "rb") as fobj:
+ data = fobj.read()
+ self.assertEqual(md5sum(data), md5_sparse,
+ "wrong md5sum for %s" % name)
+
+ if self._fs_supports_holes():
+ s = os.stat(filename)
+ self.assertTrue(s.st_blocks * 512 < s.st_size)
+
+ def test_sparse_file_old(self):
+ self._test_sparse_file("gnu/sparse")
+
+ def test_sparse_file_00(self):
+ self._test_sparse_file("gnu/sparse-0.0")
+
+ def test_sparse_file_01(self):
+ self._test_sparse_file("gnu/sparse-0.1")
+
+ def test_sparse_file_10(self):
+ self._test_sparse_file("gnu/sparse-1.0")
+
+ @staticmethod
+ def _fs_supports_holes():
+ # Return True if the platform knows the st_blocks stat attribute and
+ # uses st_blocks units of 512 bytes, and if the filesystem is able to
+ # store holes in files.
+ if sys.platform == "linux2":
+ # Linux evidentially has 512 byte st_blocks units.
+ name = os.path.join(TEMPDIR, "sparse-test")
+ with open(name, "wb") as fobj:
+ fobj.seek(4096)
+ fobj.truncate()
+ s = os.stat(name)
+ os.remove(name)
+ return s.st_blocks == 0
+ else:
+ return False
class PaxReadTest(LongnameTest):
@@ -511,33 +723,38 @@ class PaxReadTest(LongnameTest):
def test_pax_global_headers(self):
tar = tarfile.open(tarname, encoding="iso8859-1")
-
- tarinfo = tar.getmember("pax/regtype1")
- self.assertEqual(tarinfo.uname, "foo")
- self.assertEqual(tarinfo.gname, "bar")
- self.assertEqual(tarinfo.pax_headers.get("VENDOR.umlauts"), "\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
-
- tarinfo = tar.getmember("pax/regtype2")
- self.assertEqual(tarinfo.uname, "")
- self.assertEqual(tarinfo.gname, "bar")
- self.assertEqual(tarinfo.pax_headers.get("VENDOR.umlauts"), "\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
-
- tarinfo = tar.getmember("pax/regtype3")
- self.assertEqual(tarinfo.uname, "tarfile")
- self.assertEqual(tarinfo.gname, "tarfile")
- self.assertEqual(tarinfo.pax_headers.get("VENDOR.umlauts"), "\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
+ try:
+ tarinfo = tar.getmember("pax/regtype1")
+ self.assertEqual(tarinfo.uname, "foo")
+ self.assertEqual(tarinfo.gname, "bar")
+ self.assertEqual(tarinfo.pax_headers.get("VENDOR.umlauts"), "\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
+
+ tarinfo = tar.getmember("pax/regtype2")
+ self.assertEqual(tarinfo.uname, "")
+ self.assertEqual(tarinfo.gname, "bar")
+ self.assertEqual(tarinfo.pax_headers.get("VENDOR.umlauts"), "\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
+
+ tarinfo = tar.getmember("pax/regtype3")
+ self.assertEqual(tarinfo.uname, "tarfile")
+ self.assertEqual(tarinfo.gname, "tarfile")
+ self.assertEqual(tarinfo.pax_headers.get("VENDOR.umlauts"), "\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
+ finally:
+ tar.close()
def test_pax_number_fields(self):
# All following number fields are read from the pax header.
tar = tarfile.open(tarname, encoding="iso8859-1")
- tarinfo = tar.getmember("pax/regtype4")
- self.assertEqual(tarinfo.size, 7011)
- self.assertEqual(tarinfo.uid, 123)
- self.assertEqual(tarinfo.gid, 123)
- self.assertEqual(tarinfo.mtime, 1041808783.0)
- self.assertEqual(type(tarinfo.mtime), float)
- self.assertEqual(float(tarinfo.pax_headers["atime"]), 1041808783.0)
- self.assertEqual(float(tarinfo.pax_headers["ctime"]), 1041808783.0)
+ try:
+ tarinfo = tar.getmember("pax/regtype4")
+ self.assertEqual(tarinfo.size, 7011)
+ self.assertEqual(tarinfo.uid, 123)
+ self.assertEqual(tarinfo.gid, 123)
+ self.assertEqual(tarinfo.mtime, 1041808783.0)
+ self.assertEqual(type(tarinfo.mtime), float)
+ self.assertEqual(float(tarinfo.pax_headers["atime"]), 1041808783.0)
+ self.assertEqual(float(tarinfo.pax_headers["ctime"]), 1041808783.0)
+ finally:
+ tar.close()
class WriteTestBase(unittest.TestCase):
@@ -563,52 +780,59 @@ class WriteTest(WriteTestBase):
# a trailing '\0'.
name = "0123456789" * 10
tar = tarfile.open(tmpname, self.mode)
- t = tarfile.TarInfo(name)
- tar.addfile(t)
- tar.close()
+ try:
+ t = tarfile.TarInfo(name)
+ tar.addfile(t)
+ finally:
+ tar.close()
tar = tarfile.open(tmpname)
- self.assertTrue(tar.getnames()[0] == name,
- "failed to store 100 char filename")
- tar.close()
+ try:
+ self.assertTrue(tar.getnames()[0] == name,
+ "failed to store 100 char filename")
+ finally:
+ tar.close()
def test_tar_size(self):
# Test for bug #1013882.
tar = tarfile.open(tmpname, self.mode)
- path = os.path.join(TEMPDIR, "file")
- fobj = open(path, "wb")
- fobj.write(b"aaa")
- fobj.close()
- tar.add(path)
- tar.close()
+ try:
+ path = os.path.join(TEMPDIR, "file")
+ with open(path, "wb") as fobj:
+ fobj.write(b"aaa")
+ tar.add(path)
+ finally:
+ tar.close()
self.assertTrue(os.path.getsize(tmpname) > 0,
"tarfile is empty")
# The test_*_size tests test for bug #1167128.
def test_file_size(self):
tar = tarfile.open(tmpname, self.mode)
+ try:
+ path = os.path.join(TEMPDIR, "file")
+ with open(path, "wb"):
+ pass
+ tarinfo = tar.gettarinfo(path)
+ self.assertEqual(tarinfo.size, 0)
- path = os.path.join(TEMPDIR, "file")
- fobj = open(path, "wb")
- fobj.close()
- tarinfo = tar.gettarinfo(path)
- self.assertEqual(tarinfo.size, 0)
-
- fobj = open(path, "wb")
- fobj.write(b"aaa")
- fobj.close()
- tarinfo = tar.gettarinfo(path)
- self.assertEqual(tarinfo.size, 3)
-
- tar.close()
+ with open(path, "wb") as fobj:
+ fobj.write(b"aaa")
+ tarinfo = tar.gettarinfo(path)
+ self.assertEqual(tarinfo.size, 3)
+ finally:
+ tar.close()
def test_directory_size(self):
path = os.path.join(TEMPDIR, "directory")
os.mkdir(path)
try:
tar = tarfile.open(tmpname, self.mode)
- tarinfo = tar.gettarinfo(path)
- self.assertEqual(tarinfo.size, 0)
+ try:
+ tarinfo = tar.gettarinfo(path)
+ self.assertEqual(tarinfo.size, 0)
+ finally:
+ tar.close()
finally:
os.rmdir(path)
@@ -616,46 +840,52 @@ class WriteTest(WriteTestBase):
if hasattr(os, "link"):
link = os.path.join(TEMPDIR, "link")
target = os.path.join(TEMPDIR, "link_target")
- fobj = open(target, "wb")
- fobj.write(b"aaa")
- fobj.close()
+ with open(target, "wb") as fobj:
+ fobj.write(b"aaa")
os.link(target, link)
try:
tar = tarfile.open(tmpname, self.mode)
- # Record the link target in the inodes list.
- tar.gettarinfo(target)
- tarinfo = tar.gettarinfo(link)
- self.assertEqual(tarinfo.size, 0)
+ try:
+ # Record the link target in the inodes list.
+ tar.gettarinfo(target)
+ tarinfo = tar.gettarinfo(link)
+ self.assertEqual(tarinfo.size, 0)
+ finally:
+ tar.close()
finally:
os.remove(target)
os.remove(link)
+ @support.skip_unless_symlink
def test_symlink_size(self):
- if hasattr(os, "symlink"):
- path = os.path.join(TEMPDIR, "symlink")
- os.symlink("link_target", path)
+ path = os.path.join(TEMPDIR, "symlink")
+ os.symlink("link_target", path)
+ try:
+ tar = tarfile.open(tmpname, self.mode)
try:
- tar = tarfile.open(tmpname, self.mode)
tarinfo = tar.gettarinfo(path)
self.assertEqual(tarinfo.size, 0)
finally:
- os.remove(path)
+ tar.close()
+ finally:
+ os.remove(path)
def test_add_self(self):
# Test for #1257255.
dstname = os.path.abspath(tmpname)
-
tar = tarfile.open(tmpname, self.mode)
- self.assertTrue(tar.name == dstname, "archive name must be absolute")
-
- tar.add(dstname)
- self.assertTrue(tar.getnames() == [], "added the archive to itself")
-
- cwd = os.getcwd()
- os.chdir(TEMPDIR)
- tar.add(dstname)
- os.chdir(cwd)
- self.assertTrue(tar.getnames() == [], "added the archive to itself")
+ try:
+ self.assertTrue(tar.name == dstname, "archive name must be absolute")
+ tar.add(dstname)
+ self.assertTrue(tar.getnames() == [], "added the archive to itself")
+
+ cwd = os.getcwd()
+ os.chdir(TEMPDIR)
+ tar.add(dstname)
+ os.chdir(cwd)
+ self.assertTrue(tar.getnames() == [], "added the archive to itself")
+ finally:
+ tar.close()
def test_exclude(self):
tempdir = os.path.join(TEMPDIR, "exclude")
@@ -665,20 +895,95 @@ class WriteTest(WriteTestBase):
name = os.path.join(tempdir, name)
open(name, "wb").close()
- def exclude(name):
- return os.path.isfile(name)
+ exclude = os.path.isfile
tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
- tar.add(tempdir, arcname="empty_dir", exclude=exclude)
- tar.close()
+ try:
+ with support.check_warnings(("use the filter argument",
+ DeprecationWarning)):
+ tar.add(tempdir, arcname="empty_dir", exclude=exclude)
+ finally:
+ tar.close()
+
+ tar = tarfile.open(tmpname, "r")
+ try:
+ self.assertEqual(len(tar.getmembers()), 1)
+ self.assertEqual(tar.getnames()[0], "empty_dir")
+ finally:
+ tar.close()
+ finally:
+ shutil.rmtree(tempdir)
+
+ def test_filter(self):
+ tempdir = os.path.join(TEMPDIR, "filter")
+ os.mkdir(tempdir)
+ try:
+ for name in ("foo", "bar", "baz"):
+ name = os.path.join(tempdir, name)
+ open(name, "wb").close()
+
+ def filter(tarinfo):
+ if os.path.basename(tarinfo.name) == "bar":
+ return
+ tarinfo.uid = 123
+ tarinfo.uname = "foo"
+ return tarinfo
+
+ tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
+ try:
+ tar.add(tempdir, arcname="empty_dir", filter=filter)
+ finally:
+ tar.close()
+
+ # Verify that filter is a keyword-only argument
+ with self.assertRaises(TypeError):
+ tar.add(tempdir, "empty_dir", True, None, filter)
tar = tarfile.open(tmpname, "r")
- self.assertEqual(len(tar.getmembers()), 1)
- self.assertEqual(tar.getnames()[0], "empty_dir")
+ try:
+ for tarinfo in tar:
+ self.assertEqual(tarinfo.uid, 123)
+ self.assertEqual(tarinfo.uname, "foo")
+ self.assertEqual(len(tar.getmembers()), 3)
+ finally:
+ tar.close()
finally:
shutil.rmtree(tempdir)
- @unittest.skipUnless(hasattr(os,'symlink'), "needs os.symlink")
+ # Guarantee that stored pathnames are not modified. Don't
+ # remove ./ or ../ or double slashes. Still make absolute
+ # pathnames relative.
+ # For details see bug #6054.
+ def _test_pathname(self, path, cmp_path=None, dir=False):
+ # Create a tarfile with an empty member named path
+ # and compare the stored name with the original.
+ foo = os.path.join(TEMPDIR, "foo")
+ if not dir:
+ open(foo, "w").close()
+ else:
+ os.mkdir(foo)
+
+ tar = tarfile.open(tmpname, self.mode)
+ try:
+ tar.add(foo, arcname=path)
+ finally:
+ tar.close()
+
+ tar = tarfile.open(tmpname, "r")
+ try:
+ t = tar.next()
+ finally:
+ tar.close()
+
+ if not dir:
+ os.remove(foo)
+ else:
+ os.rmdir(foo)
+
+ self.assertEqual(t.name, cmp_path or path.replace(os.sep, "/"))
+
+
+ @support.skip_unless_symlink
def test_extractall_symlinks(self):
# Test if extractall works properly when tarfile contains symlinks
tempdir = os.path.join(TEMPDIR, "testsymlinks")
@@ -707,6 +1012,51 @@ class WriteTest(WriteTestBase):
os.unlink(temparchive)
shutil.rmtree(tempdir)
+ def test_pathnames(self):
+ self._test_pathname("foo")
+ self._test_pathname(os.path.join("foo", ".", "bar"))
+ self._test_pathname(os.path.join("foo", "..", "bar"))
+ self._test_pathname(os.path.join(".", "foo"))
+ self._test_pathname(os.path.join(".", "foo", "."))
+ self._test_pathname(os.path.join(".", "foo", ".", "bar"))
+ self._test_pathname(os.path.join(".", "foo", "..", "bar"))
+ self._test_pathname(os.path.join(".", "foo", "..", "bar"))
+ self._test_pathname(os.path.join("..", "foo"))
+ self._test_pathname(os.path.join("..", "foo", ".."))
+ self._test_pathname(os.path.join("..", "foo", ".", "bar"))
+ self._test_pathname(os.path.join("..", "foo", "..", "bar"))
+
+ self._test_pathname("foo" + os.sep + os.sep + "bar")
+ self._test_pathname("foo" + os.sep + os.sep, "foo", dir=True)
+
+ def test_abs_pathnames(self):
+ if sys.platform == "win32":
+ self._test_pathname("C:\\foo", "foo")
+ else:
+ self._test_pathname("/foo", "foo")
+ self._test_pathname("///foo", "foo")
+
+ def test_cwd(self):
+ # Test adding the current working directory.
+ cwd = os.getcwd()
+ os.chdir(TEMPDIR)
+ try:
+ tar = tarfile.open(tmpname, self.mode)
+ try:
+ tar.add(".")
+ finally:
+ tar.close()
+
+ tar = tarfile.open(tmpname, "r")
+ try:
+ for t in tar:
+ self.assertTrue(t.name == "." or t.name.startswith("./"))
+ finally:
+ tar.close()
+ finally:
+ os.chdir(cwd)
+
+
class StreamWriteTest(WriteTestBase):
mode = "w|"
@@ -717,19 +1067,18 @@ class StreamWriteTest(WriteTestBase):
tar.close()
if self.mode.endswith("gz"):
- fobj = gzip.GzipFile(tmpname)
- data = fobj.read()
- fobj.close()
+ with gzip.GzipFile(tmpname) as fobj:
+ data = fobj.read()
elif self.mode.endswith("bz2"):
dec = bz2.BZ2Decompressor()
- data = open(tmpname, "rb").read()
+ with open(tmpname, "rb") as fobj:
+ data = fobj.read()
data = dec.decompress(data)
self.assertTrue(len(dec.unused_data) == 0,
"found trailing data")
else:
- fobj = open(tmpname, "rb")
- data = fobj.read()
- fobj.close()
+ with open(tmpname, "rb") as fobj:
+ data = fobj.read()
self.assertTrue(data.count(b"\0") == tarfile.RECORDSIZE,
"incorrect zero padding")
@@ -784,21 +1133,27 @@ class GNUWriteTest(unittest.TestCase):
tarinfo.type = tarfile.LNKTYPE
tar = tarfile.open(tmpname, "w")
- tar.format = tarfile.GNU_FORMAT
- tar.addfile(tarinfo)
-
- v1 = self._calc_size(name, link)
- v2 = tar.offset
- self.assertTrue(v1 == v2, "GNU longname/longlink creation failed")
+ try:
+ tar.format = tarfile.GNU_FORMAT
+ tar.addfile(tarinfo)
- tar.close()
+ v1 = self._calc_size(name, link)
+ v2 = tar.offset
+ self.assertTrue(v1 == v2, "GNU longname/longlink creation failed")
+ finally:
+ tar.close()
tar = tarfile.open(tmpname)
- member = tar.next()
- self.assertFalse(member is None, "unable to read longname member")
- self.assertTrue(tarinfo.name == member.name and \
- tarinfo.linkname == member.linkname, \
- "unable to read longname member")
+ try:
+ member = tar.next()
+ self.assertIsNotNone(member,
+ "unable to read longname member")
+ self.assertEqual(tarinfo.name, member.name,
+ "unable to read longname member")
+ self.assertEqual(tarinfo.linkname, member.linkname,
+ "unable to read longname member")
+ finally:
+ tar.close()
def test_longname_1023(self):
self._test(("longnam/" * 127) + "longnam")
@@ -838,9 +1193,8 @@ class HardlinkTest(unittest.TestCase):
self.foo = os.path.join(TEMPDIR, "foo")
self.bar = os.path.join(TEMPDIR, "bar")
- fobj = open(self.foo, "wb")
- fobj.write(b"foo")
- fobj.close()
+ with open(self.foo, "wb") as fobj:
+ fobj.write(b"foo")
os.link(self.foo, self.bar)
@@ -849,8 +1203,8 @@ class HardlinkTest(unittest.TestCase):
def tearDown(self):
self.tar.close()
- os.remove(self.foo)
- os.remove(self.bar)
+ support.unlink(self.foo)
+ support.unlink(self.bar)
def test_add_twice(self):
# The same name will be added as a REGTYPE every
@@ -881,16 +1235,21 @@ class PaxWriteTest(GNUWriteTest):
tarinfo.type = tarfile.LNKTYPE
tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT)
- tar.addfile(tarinfo)
- tar.close()
+ try:
+ tar.addfile(tarinfo)
+ finally:
+ tar.close()
tar = tarfile.open(tmpname)
- if link:
- l = tar.getmembers()[0].linkname
- self.assertTrue(link == l, "PAX longlink creation failed")
- else:
- n = tar.getmembers()[0].name
- self.assertTrue(name == n, "PAX longname creation failed")
+ try:
+ if link:
+ l = tar.getmembers()[0].linkname
+ self.assertTrue(link == l, "PAX longlink creation failed")
+ else:
+ n = tar.getmembers()[0].name
+ self.assertTrue(name == n, "PAX longname creation failed")
+ finally:
+ tar.close()
def test_pax_global_header(self):
pax_headers = {
@@ -900,25 +1259,29 @@ class PaxWriteTest(GNUWriteTest):
"test": "\xe4\xf6\xfc",
"\xe4\xf6\xfc": "test"}
- tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT, \
+ tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT,
pax_headers=pax_headers)
- tar.addfile(tarfile.TarInfo("test"))
- tar.close()
+ try:
+ tar.addfile(tarfile.TarInfo("test"))
+ finally:
+ tar.close()
# Test if the global header was written correctly.
tar = tarfile.open(tmpname, encoding="iso8859-1")
- self.assertEqual(tar.pax_headers, pax_headers)
- self.assertEqual(tar.getmembers()[0].pax_headers, pax_headers)
-
- # Test if all the fields are strings.
- for key, val in tar.pax_headers.items():
- self.assertTrue(type(key) is not bytes)
- self.assertTrue(type(val) is not bytes)
- if key in tarfile.PAX_NUMBER_FIELDS:
- try:
- tarfile.PAX_NUMBER_FIELDS[key](val)
- except (TypeError, ValueError):
- self.fail("unable to convert pax header field")
+ try:
+ self.assertEqual(tar.pax_headers, pax_headers)
+ self.assertEqual(tar.getmembers()[0].pax_headers, pax_headers)
+ # Test if all the fields are strings.
+ for key, val in tar.pax_headers.items():
+ self.assertTrue(type(key) is not bytes)
+ self.assertTrue(type(val) is not bytes)
+ if key in tarfile.PAX_NUMBER_FIELDS:
+ try:
+ tarfile.PAX_NUMBER_FIELDS[key](val)
+ except (TypeError, ValueError):
+ self.fail("unable to convert pax header field")
+ finally:
+ tar.close()
def test_pax_extended_header(self):
# The fields from the pax header have priority over the
@@ -926,18 +1289,23 @@ class PaxWriteTest(GNUWriteTest):
pax_headers = {"path": "foo", "uid": "123"}
tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT, encoding="iso8859-1")
- t = tarfile.TarInfo()
- t.name = "\xe4\xf6\xfc" # non-ASCII
- t.uid = 8**8 # too large
- t.pax_headers = pax_headers
- tar.addfile(t)
- tar.close()
+ try:
+ t = tarfile.TarInfo()
+ t.name = "\xe4\xf6\xfc" # non-ASCII
+ t.uid = 8**8 # too large
+ t.pax_headers = pax_headers
+ tar.addfile(t)
+ finally:
+ tar.close()
tar = tarfile.open(tmpname, encoding="iso8859-1")
- t = tar.getmembers()[0]
- self.assertEqual(t.pax_headers, pax_headers)
- self.assertEqual(t.name, "foo")
- self.assertEqual(t.uid, 123)
+ try:
+ t = tar.getmembers()[0]
+ self.assertEqual(t.pax_headers, pax_headers)
+ self.assertEqual(t.name, "foo")
+ self.assertEqual(t.uid, 123)
+ finally:
+ tar.close()
class UstarUnicodeTest(unittest.TestCase):
@@ -955,13 +1323,17 @@ class UstarUnicodeTest(unittest.TestCase):
def _test_unicode_filename(self, encoding):
tar = tarfile.open(tmpname, "w", format=self.format, encoding=encoding, errors="strict")
- name = "\xe4\xf6\xfc"
- tar.addfile(tarfile.TarInfo(name))
- tar.close()
+ try:
+ name = "\xe4\xf6\xfc"
+ tar.addfile(tarfile.TarInfo(name))
+ finally:
+ tar.close()
tar = tarfile.open(tmpname, encoding=encoding)
- self.assertEqual(tar.getmembers()[0].name, name)
- tar.close()
+ try:
+ self.assertEqual(tar.getmembers()[0].name, name)
+ finally:
+ tar.close()
def test_unicode_filename_error(self):
if self.format == tarfile.PAX_FORMAT:
@@ -969,23 +1341,28 @@ class UstarUnicodeTest(unittest.TestCase):
return
tar = tarfile.open(tmpname, "w", format=self.format, encoding="ascii", errors="strict")
- tarinfo = tarfile.TarInfo()
+ try:
+ tarinfo = tarfile.TarInfo()
- tarinfo.name = "\xe4\xf6\xfc"
- self.assertRaises(UnicodeError, tar.addfile, tarinfo)
+ tarinfo.name = "\xe4\xf6\xfc"
+ self.assertRaises(UnicodeError, tar.addfile, tarinfo)
- tarinfo.name = "foo"
- tarinfo.uname = "\xe4\xf6\xfc"
- self.assertRaises(UnicodeError, tar.addfile, tarinfo)
+ tarinfo.name = "foo"
+ tarinfo.uname = "\xe4\xf6\xfc"
+ self.assertRaises(UnicodeError, tar.addfile, tarinfo)
+ finally:
+ tar.close()
def test_unicode_argument(self):
tar = tarfile.open(tarname, "r", encoding="iso8859-1", errors="strict")
- for t in tar:
- self.assertTrue(type(t.name) is str)
- self.assertTrue(type(t.linkname) is str)
- self.assertTrue(type(t.uname) is str)
- self.assertTrue(type(t.gname) is str)
- tar.close()
+ try:
+ for t in tar:
+ self.assertTrue(type(t.name) is str)
+ self.assertTrue(type(t.linkname) is str)
+ self.assertTrue(type(t.uname) is str)
+ self.assertTrue(type(t.gname) is str)
+ finally:
+ tar.close()
def test_uname_unicode(self):
t = tarfile.TarInfo("foo")
@@ -993,30 +1370,57 @@ class UstarUnicodeTest(unittest.TestCase):
t.gname = "\xe4\xf6\xfc"
tar = tarfile.open(tmpname, mode="w", format=self.format, encoding="iso8859-1")
- tar.addfile(t)
- tar.close()
+ try:
+ tar.addfile(t)
+ finally:
+ tar.close()
tar = tarfile.open(tmpname, encoding="iso8859-1")
- t = tar.getmember("foo")
- self.assertEqual(t.uname, "\xe4\xf6\xfc")
- self.assertEqual(t.gname, "\xe4\xf6\xfc")
-
- if self.format != tarfile.PAX_FORMAT:
- tar = tarfile.open(tmpname, encoding="ascii")
+ try:
t = tar.getmember("foo")
- self.assertEqual(t.uname, "\ufffd\ufffd\ufffd")
- self.assertEqual(t.gname, "\ufffd\ufffd\ufffd")
+ self.assertEqual(t.uname, "\xe4\xf6\xfc")
+ self.assertEqual(t.gname, "\xe4\xf6\xfc")
+
+ if self.format != tarfile.PAX_FORMAT:
+ tar.close()
+ tar = tarfile.open(tmpname, encoding="ascii")
+ t = tar.getmember("foo")
+ self.assertEqual(t.uname, "\udce4\udcf6\udcfc")
+ self.assertEqual(t.gname, "\udce4\udcf6\udcfc")
+ finally:
+ tar.close()
class GNUUnicodeTest(UstarUnicodeTest):
format = tarfile.GNU_FORMAT
+ def test_bad_pax_header(self):
+ # Test for issue #8633. GNU tar <= 1.23 creates raw binary fields
+ # without a hdrcharset=BINARY header.
+ for encoding, name in (("utf8", "pax/bad-pax-\udce4\udcf6\udcfc"),
+ ("iso8859-1", "pax/bad-pax-\xe4\xf6\xfc"),):
+ with tarfile.open(tarname, encoding=encoding, errors="surrogateescape") as tar:
+ try:
+ t = tar.getmember(name)
+ except KeyError:
+ self.fail("unable to read bad GNU tar pax header")
+
class PAXUnicodeTest(UstarUnicodeTest):
format = tarfile.PAX_FORMAT
+ def test_binary_header(self):
+ # Test a POSIX.1-2008 compatible header with a hdrcharset=BINARY field.
+ for encoding, name in (("utf8", "pax/hdrcharset-\udce4\udcf6\udcfc"),
+ ("iso8859-1", "pax/hdrcharset-\xe4\xf6\xfc"),):
+ with tarfile.open(tarname, encoding=encoding, errors="surrogateescape") as tar:
+ try:
+ t = tar.getmember(name)
+ except KeyError:
+ self.fail("unable to read POSIX.1-2008 binary header")
+
class AppendTest(unittest.TestCase):
# Test append mode (cp. patch #1652681).
@@ -1027,41 +1431,43 @@ class AppendTest(unittest.TestCase):
os.remove(self.tarname)
def _add_testfile(self, fileobj=None):
- tar = tarfile.open(self.tarname, "a", fileobj=fileobj)
- tar.addfile(tarfile.TarInfo("bar"))
- tar.close()
+ with tarfile.open(self.tarname, "a", fileobj=fileobj) as tar:
+ tar.addfile(tarfile.TarInfo("bar"))
def _create_testtar(self, mode="w:"):
- src = tarfile.open(tarname, encoding="iso8859-1")
- t = src.getmember("ustar/regtype")
- t.name = "foo"
- f = src.extractfile(t)
- tar = tarfile.open(self.tarname, mode)
- tar.addfile(t, f)
- tar.close()
+ with tarfile.open(tarname, encoding="iso8859-1") as src:
+ t = src.getmember("ustar/regtype")
+ t.name = "foo"
+ f = src.extractfile(t)
+ try:
+ with tarfile.open(self.tarname, mode) as tar:
+ tar.addfile(t, f)
+ finally:
+ f.close()
def _test(self, names=["bar"], fileobj=None):
- tar = tarfile.open(self.tarname, fileobj=fileobj)
- self.assertEqual(tar.getnames(), names)
+ with tarfile.open(self.tarname, fileobj=fileobj) as tar:
+ self.assertEqual(tar.getnames(), names)
def test_non_existing(self):
self._add_testfile()
self._test()
def test_empty(self):
- open(self.tarname, "w").close()
+ tarfile.open(self.tarname, "w:").close()
self._add_testfile()
self._test()
def test_empty_fileobj(self):
- fobj = io.BytesIO()
+ fobj = io.BytesIO(b"\0" * 1024)
self._add_testfile(fobj)
fobj.seek(0)
self._test(fileobj=fobj)
def test_fileobj(self):
self._create_testtar()
- data = open(self.tarname, "rb").read()
+ with open(self.tarname, "rb") as fobj:
+ data = fobj.read()
fobj = io.BytesIO(data)
self._add_testfile(fobj)
fobj.seek(0)
@@ -1084,6 +1490,30 @@ class AppendTest(unittest.TestCase):
self._create_testtar("w:bz2")
self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, "a")
+ # Append mode is supposed to fail if the tarfile to append to
+ # does not end with a zero block.
+ def _test_error(self, data):
+ with open(self.tarname, "wb") as fobj:
+ fobj.write(data)
+ self.assertRaises(tarfile.ReadError, self._add_testfile)
+
+ def test_null(self):
+ self._test_error(b"")
+
+ def test_incomplete(self):
+ self._test_error(b"\0" * 13)
+
+ def test_premature_eof(self):
+ data = tarfile.TarInfo("foo").tobuf()
+ self._test_error(data)
+
+ def test_trailing_garbage(self):
+ data = tarfile.TarInfo("foo").tobuf()
+ self._test_error(data + b"\0" * 13)
+
+ def test_invalid(self):
+ self._test_error(b"a" * 512)
+
class LimitsTest(unittest.TestCase):
@@ -1157,6 +1587,98 @@ class MiscTest(unittest.TestCase):
self.assertEqual(tarfile.itn(0xffffffff), b"\x80\x00\x00\x00\xff\xff\xff\xff")
+class ContextManagerTest(unittest.TestCase):
+
+ def test_basic(self):
+ with tarfile.open(tarname) as tar:
+ self.assertFalse(tar.closed, "closed inside runtime context")
+ self.assertTrue(tar.closed, "context manager failed")
+
+ def test_closed(self):
+ # The __enter__() method is supposed to raise IOError
+ # if the TarFile object is already closed.
+ tar = tarfile.open(tarname)
+ tar.close()
+ with self.assertRaises(IOError):
+ with tar:
+ pass
+
+ def test_exception(self):
+ # Test if the IOError exception is passed through properly.
+ with self.assertRaises(Exception) as exc:
+ with tarfile.open(tarname) as tar:
+ raise IOError
+ self.assertIsInstance(exc.exception, IOError,
+ "wrong exception raised in context manager")
+ self.assertTrue(tar.closed, "context manager failed")
+
+ def test_no_eof(self):
+ # __exit__() must not write end-of-archive blocks if an
+ # exception was raised.
+ try:
+ with tarfile.open(tmpname, "w") as tar:
+ raise Exception
+ except:
+ pass
+ self.assertEqual(os.path.getsize(tmpname), 0,
+ "context manager wrote an end-of-archive block")
+ self.assertTrue(tar.closed, "context manager failed")
+
+ def test_eof(self):
+ # __exit__() must write end-of-archive blocks, i.e. call
+ # TarFile.close() if there was no error.
+ with tarfile.open(tmpname, "w"):
+ pass
+ self.assertNotEqual(os.path.getsize(tmpname), 0,
+ "context manager wrote no end-of-archive block")
+
+ def test_fileobj(self):
+ # Test that __exit__() did not close the external file
+ # object.
+ with open(tmpname, "wb") as fobj:
+ try:
+ with tarfile.open(fileobj=fobj, mode="w") as tar:
+ raise Exception
+ except:
+ pass
+ self.assertFalse(fobj.closed, "external file object was closed")
+ self.assertTrue(tar.closed, "context manager failed")
+
+
+class LinkEmulationTest(ReadTest):
+
+ # Test for issue #8741 regression. On platforms that do not support
+ # symbolic or hard links tarfile tries to extract these types of members as
+ # the regular files they point to.
+ def _test_link_extraction(self, name):
+ self.tar.extract(name, TEMPDIR)
+ data = open(os.path.join(TEMPDIR, name), "rb").read()
+ self.assertEqual(md5sum(data), md5_regtype)
+
+ # When 8879 gets fixed, this will need to change. Currently on Windows
+ # we have os.path.islink but no os.link, so these tests fail without the
+ # following skip until link is completed.
+ @unittest.skipIf(hasattr(os.path, "islink"),
+ "Skip emulation - has os.path.islink but not os.link")
+ def test_hardlink_extraction1(self):
+ self._test_link_extraction("ustar/lnktype")
+
+ @unittest.skipIf(hasattr(os.path, "islink"),
+ "Skip emulation - has os.path.islink but not os.link")
+ def test_hardlink_extraction2(self):
+ self._test_link_extraction("./ustar/linktest2/lnktype")
+
+ @unittest.skipIf(hasattr(os, "symlink"),
+ "Skip emulation if symlink exists")
+ def test_symlink_extraction1(self):
+ self._test_link_extraction("ustar/symtype")
+
+ @unittest.skipIf(hasattr(os, "symlink"),
+ "Skip emulation if symlink exists")
+ def test_symlink_extraction2(self):
+ self._test_link_extraction("./ustar/linktest2/symtype")
+
+
class GzipMiscReadTest(MiscReadTest):
tarname = gzipname
mode = "r:gz"
@@ -1198,10 +1720,16 @@ class Bz2PartialReadTest(unittest.TestCase):
raise AssertionError("infinite loop detected in tarfile.open()")
self.hit_eof = self.tell() == len(self.getvalue())
return super(MyBytesIO, self).read(n)
+ def seek(self, *args):
+ self.hit_eof = False
+ return super(MyBytesIO, self).seek(*args)
data = bz2.compress(tarfile.TarInfo("foo").tobuf())
for x in range(len(data) + 1):
- tarfile.open(fileobj=MyBytesIO(data[:x]), mode=mode)
+ try:
+ tarfile.open(fileobj=MyBytesIO(data[:x]), mode=mode)
+ except tarfile.ReadError:
+ pass # we have no interest in ReadErrors
def test_partial_input(self):
self._test_partial_input("r")
@@ -1211,6 +1739,7 @@ class Bz2PartialReadTest(unittest.TestCase):
def test_main():
+ support.unlink(TEMPDIR)
os.makedirs(TEMPDIR)
tests = [
@@ -1231,20 +1760,22 @@ def test_main():
AppendTest,
LimitsTest,
MiscTest,
+ ContextManagerTest,
]
if hasattr(os, "link"):
tests.append(HardlinkTest)
+ else:
+ tests.append(LinkEmulationTest)
- fobj = open(tarname, "rb")
- data = fobj.read()
- fobj.close()
+ with open(tarname, "rb") as fobj:
+ data = fobj.read()
if gzip:
# Create testtar.tar.gz and add gzip-specific tests.
- tar = gzip.open(gzipname, "wb")
- tar.write(data)
- tar.close()
+ support.unlink(gzipname)
+ with gzip.open(gzipname, "wb") as tar:
+ tar.write(data)
tests += [
GzipMiscReadTest,
@@ -1256,9 +1787,12 @@ def test_main():
if bz2:
# Create testtar.tar.bz2 and add bz2-specific tests.
+ support.unlink(bz2name)
tar = bz2.BZ2File(bz2name, "wb")
- tar.write(data)
- tar.close()
+ try:
+ tar.write(data)
+ finally:
+ tar.close()
tests += [
Bz2MiscReadTest,
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index 632d5e3b50..d86246cbfb 100644
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -1,6 +1,7 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import unittest
+import sys
import os
from test import support
@@ -127,21 +128,20 @@ class TclTest(unittest.TestCase):
tcl = self.interp
self.assertRaises(TclError,tcl.eval,'package require DNE')
+ @unittest.skipUnless(sys.platform == 'win32', 'Requires Windows')
def testLoadWithUNC(self):
- import sys
- if sys.platform != 'win32':
- return
-
# Build a UNC path from the regular path.
# Something like
# \\%COMPUTERNAME%\c$\python27\python.exe
fullname = os.path.abspath(sys.executable)
if fullname[1] != ':':
- return
+ raise unittest.SkipTest('Absolute path should have drive part')
unc_name = r'\\%s\%s$\%s' % (os.environ['COMPUTERNAME'],
fullname[0],
fullname[3:])
+ if not os.path.exists(unc_name):
+ raise unittest.SkipTest('Cannot connect to UNC Path')
with support.EnvironmentVarGuard() as env:
env.unset("TCL_LIBRARY")
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index c1eea06571..a78b938b86 100644
--- a/Lib/test/test_telnetlib.py
+++ b/Lib/test/test_telnetlib.py
@@ -1,12 +1,12 @@
import socket
import select
-import threading
import telnetlib
import time
import contextlib
from unittest import TestCase
from test import support
+threading = support.import_module('threading')
HOST = support.HOST
@@ -17,9 +17,10 @@ def server(evt, serv):
conn, addr = serv.accept()
except socket.timeout:
pass
+ else:
+ conn.close()
finally:
serv.close()
- conn.close()
evt.set()
class GeneralTests(TestCase):
@@ -285,7 +286,7 @@ class OptionTests(TestCase):
txt = telnet.read_all()
cmd = nego.seen
self.assertTrue(len(cmd) > 0) # we expect at least one command
- self.assertTrue(cmd[:1] in self.cmds)
+ self.assertIn(cmd[:1], self.cmds)
self.assertEqual(cmd[1:2], tl.NOOPT)
self.assertEqual(data_len, len(txt + cmd))
nego.sb_getter = None # break the nego => telnet cycle
@@ -332,7 +333,7 @@ class OptionTests(TestCase):
telnet = test_telnet([a])
telnet.set_debuglevel(1)
txt = telnet.read_all()
- self.assertTrue(b in telnet._messages)
+ self.assertIn(b, telnet._messages)
return
def test_debuglevel_write(self):
@@ -340,7 +341,7 @@ class OptionTests(TestCase):
telnet.set_debuglevel(1)
telnet.write(b'xxx')
expected = "send b'xxx'\n"
- self.assertTrue(expected in telnet._messages)
+ self.assertIn(expected, telnet._messages)
def test_debug_accepts_str_port(self):
# Issue 10695
@@ -349,7 +350,7 @@ class OptionTests(TestCase):
telnet._messages = ''
telnet.set_debuglevel(1)
telnet.msg('test')
- self.assertRegexpMatches(telnet._messages, r'0.*test')
+ self.assertRegex(telnet._messages, r'0.*test')
def test_main(verbose=None):
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index f72b0b19c4..2d298857b2 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -3,15 +3,11 @@ import tempfile
import os
import sys
import re
-import errno
import warnings
import unittest
from test import support
-warnings.filterwarnings("ignore",
- category=RuntimeWarning,
- message="mktemp", module=__name__)
if hasattr(os, 'stat'):
import stat
@@ -24,9 +20,7 @@ has_spawnl = hasattr(os, 'spawnl')
# TEST_FILES may need to be tweaked for systems depending on the maximum
# number of files that can be opened at one time (see ulimit -n)
-if sys.platform == 'mac':
- TEST_FILES = 32
-elif sys.platform in ('openbsd3', 'openbsd4'):
+if sys.platform in ('openbsd3', 'openbsd4'):
TEST_FILES = 48
else:
TEST_FILES = 100
@@ -40,6 +34,16 @@ class TC(unittest.TestCase):
str_check = re.compile(r"[a-zA-Z0-9_-]{6}$")
+ def setUp(self):
+ self._warnings_manager = support.check_warnings()
+ self._warnings_manager.__enter__()
+ warnings.filterwarnings("ignore", category=RuntimeWarning,
+ message="mktemp", module=__name__)
+
+ def tearDown(self):
+ self._warnings_manager.__exit__(None, None, None)
+
+
def failOnException(self, what, ei=None):
if ei is None:
ei = sys.exc_info()
@@ -81,7 +85,8 @@ class test_exports(TC):
"gettempdir" : 1,
"tempdir" : 1,
"template" : 1,
- "SpooledTemporaryFile" : 1
+ "SpooledTemporaryFile" : 1,
+ "TemporaryDirectory" : 1,
}
unexp = []
@@ -99,6 +104,7 @@ class test__RandomNameSequence(TC):
def setUp(self):
self.r = tempfile._RandomNameSequence()
+ super().setUp()
def test_get_six_char_str(self):
# _RandomNameSequence returns a six-character string
@@ -113,7 +119,7 @@ class test__RandomNameSequence(TC):
for i in range(TEST_FILES):
s = next(r)
self.nameCheck(s, '', '', '')
- self.assertFalse(s in dict)
+ self.assertNotIn(s, dict)
dict[s] = 1
def supports_iter(self):
@@ -127,7 +133,7 @@ class test__RandomNameSequence(TC):
if i == 20:
break
except:
- failOnException("iteration")
+ self.failOnException("iteration")
test_classes.append(test__RandomNameSequence)
@@ -142,8 +148,7 @@ class test__candidate_tempdir_list(TC):
self.assertFalse(len(cand) == 0)
for c in cand:
- self.assertTrue(isinstance(c, str),
- "%s is not a string" % c)
+ self.assertIsInstance(c, str)
def test_wanted_dirs(self):
# _candidate_tempdir_list contains the expected directories
@@ -160,14 +165,14 @@ class test__candidate_tempdir_list(TC):
for envname in 'TMPDIR', 'TEMP', 'TMP':
dirname = os.getenv(envname)
if not dirname: raise ValueError
- self.assertTrue(dirname in cand)
+ self.assertIn(dirname, cand)
try:
dirname = os.getcwd()
except (AttributeError, os.error):
dirname = os.curdir
- self.assertTrue(dirname in cand)
+ self.assertIn(dirname, cand)
# Not practical to try to verify the presence of OS-specific
# paths in this list.
@@ -184,7 +189,7 @@ class test__get_candidate_names(TC):
def test_retval(self):
# _get_candidate_names returns a _RandomNameSequence object
obj = tempfile._get_candidate_names()
- self.assertTrue(isinstance(obj, tempfile._RandomNameSequence))
+ self.assertIsInstance(obj, tempfile._RandomNameSequence)
def test_same_thing(self):
# _get_candidate_names always returns the same object
@@ -259,7 +264,7 @@ class test__mkstemp_inner(TC):
file = self.do_create()
mode = stat.S_IMODE(os.stat(file.name).st_mode)
expected = 0o600
- if sys.platform in ('win32', 'os2emx', 'mac'):
+ if sys.platform in ('win32', 'os2emx'):
# There's no distinction among 'user', 'group' and 'world';
# replicate the 'user' bits.
user = expected >> 6
@@ -326,7 +331,7 @@ class test_gettempprefix(TC):
# gettempprefix returns a nonempty prefix string
p = tempfile.gettempprefix()
- self.assertTrue(isinstance(p, str))
+ self.assertIsInstance(p, str)
self.assertTrue(len(p) > 0)
def test_usable_template(self):
@@ -482,7 +487,7 @@ class test_mkdtemp(TC):
mode = stat.S_IMODE(os.stat(dir).st_mode)
mode &= 0o777 # Mask off sticky bits inherited from /tmp
expected = 0o700
- if sys.platform in ('win32', 'os2emx', 'mac'):
+ if sys.platform in ('win32', 'os2emx'):
# There's no distinction among 'user', 'group' and 'world';
# replicate the 'user' bits.
user = expected >> 6
@@ -501,11 +506,13 @@ class test_mktemp(TC):
# We must also suppress the RuntimeWarning it generates.
def setUp(self):
self.dir = tempfile.mkdtemp()
+ super().setUp()
def tearDown(self):
if self.dir:
os.rmdir(self.dir)
self.dir = None
+ super().tearDown()
class mktemped:
_unlink = os.unlink
@@ -900,6 +907,152 @@ class test_TemporaryFile(TC):
if tempfile.NamedTemporaryFile is not tempfile.TemporaryFile:
test_classes.append(test_TemporaryFile)
+
+# Helper for test_del_on_shutdown
+class NulledModules:
+ def __init__(self, *modules):
+ self.refs = [mod.__dict__ for mod in modules]
+ self.contents = [ref.copy() for ref in self.refs]
+
+ def __enter__(self):
+ for d in self.refs:
+ for key in d:
+ d[key] = None
+
+ def __exit__(self, *exc_info):
+ for d, c in zip(self.refs, self.contents):
+ d.clear()
+ d.update(c)
+
+class test_TemporaryDirectory(TC):
+ """Test TemporaryDirectory()."""
+
+ def do_create(self, dir=None, pre="", suf="", recurse=1):
+ if dir is None:
+ dir = tempfile.gettempdir()
+ try:
+ tmp = tempfile.TemporaryDirectory(dir=dir, prefix=pre, suffix=suf)
+ except:
+ self.failOnException("TemporaryDirectory")
+ self.nameCheck(tmp.name, dir, pre, suf)
+ # Create a subdirectory and some files
+ if recurse:
+ self.do_create(tmp.name, pre, suf, recurse-1)
+ with open(os.path.join(tmp.name, "test.txt"), "wb") as f:
+ f.write(b"Hello world!")
+ return tmp
+
+ def test_mkdtemp_failure(self):
+ # Check no additional exception if mkdtemp fails
+ # Previously would raise AttributeError instead
+ # (noted as part of Issue #10188)
+ with tempfile.TemporaryDirectory() as nonexistent:
+ pass
+ with self.assertRaises(os.error):
+ tempfile.TemporaryDirectory(dir=nonexistent)
+
+ def test_explicit_cleanup(self):
+ # A TemporaryDirectory is deleted when cleaned up
+ dir = tempfile.mkdtemp()
+ try:
+ d = self.do_create(dir=dir)
+ self.assertTrue(os.path.exists(d.name),
+ "TemporaryDirectory %s does not exist" % d.name)
+ d.cleanup()
+ self.assertFalse(os.path.exists(d.name),
+ "TemporaryDirectory %s exists after cleanup" % d.name)
+ finally:
+ os.rmdir(dir)
+
+ @support.cpython_only
+ def test_del_on_collection(self):
+ # A TemporaryDirectory is deleted when garbage collected
+ dir = tempfile.mkdtemp()
+ try:
+ d = self.do_create(dir=dir)
+ name = d.name
+ del d # Rely on refcounting to invoke __del__
+ self.assertFalse(os.path.exists(name),
+ "TemporaryDirectory %s exists after __del__" % name)
+ finally:
+ os.rmdir(dir)
+
+ @unittest.expectedFailure # See issue #10188
+ def test_del_on_shutdown(self):
+ # A TemporaryDirectory may be cleaned up during shutdown
+ # Make sure it works with the relevant modules nulled out
+ with self.do_create() as dir:
+ d = self.do_create(dir=dir)
+ # Mimic the nulling out of modules that
+ # occurs during system shutdown
+ modules = [os, os.path]
+ if has_stat:
+ modules.append(stat)
+ # Currently broken, so suppress the warning
+ # that is otherwise emitted on stdout
+ with support.captured_stderr() as err:
+ with NulledModules(*modules):
+ d.cleanup()
+ # Currently broken, so stop spurious exception by
+ # indicating the object has already been closed
+ d._closed = True
+ # And this assert will fail, as expected by the
+ # unittest decorator...
+ self.assertFalse(os.path.exists(d.name),
+ "TemporaryDirectory %s exists after cleanup" % d.name)
+
+ def test_warnings_on_cleanup(self):
+ # Two kinds of warning on shutdown
+ # Issue 10888: may write to stderr if modules are nulled out
+ # ResourceWarning will be triggered by __del__
+ with self.do_create() as dir:
+ if os.sep != '\\':
+ # Embed a backslash in order to make sure string escaping
+ # in the displayed error message is dealt with correctly
+ suffix = '\\check_backslash_handling'
+ else:
+ suffix = ''
+ d = self.do_create(dir=dir, suf=suffix)
+
+ #Check for the Issue 10888 message
+ modules = [os, os.path]
+ if has_stat:
+ modules.append(stat)
+ with support.captured_stderr() as err:
+ with NulledModules(*modules):
+ d.cleanup()
+ message = err.getvalue().replace('\\\\', '\\')
+ self.assertIn("while cleaning up", message)
+ self.assertIn(d.name, message)
+
+ # Check for the resource warning
+ with support.check_warnings(('Implicitly', ResourceWarning), quiet=False):
+ warnings.filterwarnings("always", category=ResourceWarning)
+ d.__del__()
+ self.assertFalse(os.path.exists(d.name),
+ "TemporaryDirectory %s exists after __del__" % d.name)
+
+ def test_multiple_close(self):
+ # Can be cleaned-up many times without error
+ d = self.do_create()
+ d.cleanup()
+ try:
+ d.cleanup()
+ d.cleanup()
+ except:
+ self.failOnException("cleanup")
+
+ def test_context_manager(self):
+ # Can be used as a context manager
+ d = self.do_create()
+ with d as name:
+ self.assertTrue(os.path.exists(name))
+ self.assertEqual(name, d.name)
+ self.assertFalse(os.path.exists(name))
+
+
+test_classes.append(test_TemporaryDirectory)
+
def test_main():
support.run_unittest(*test_classes)
diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py
index a86f86bd5f..894a49392e 100644
--- a/Lib/test/test_thread.py
+++ b/Lib/test/test_thread.py
@@ -2,8 +2,10 @@ import os
import unittest
import random
from test import support
-import _thread as thread
+thread = support.import_module('_thread')
import time
+import sys
+import weakref
from test import lock_tests
@@ -61,7 +63,7 @@ class ThreadRunningTests(BasicThreadTest):
def test_stack_size(self):
# Various stack size tests.
- self.assertEqual(thread.stack_size(), 0, "intial stack size is not 0")
+ self.assertEqual(thread.stack_size(), 0, "initial stack size is not 0")
thread.stack_size(0)
self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default")
@@ -100,6 +102,32 @@ class ThreadRunningTests(BasicThreadTest):
thread.stack_size(0)
+ def test__count(self):
+ # Test the _count() function.
+ orig = thread._count()
+ mut = thread.allocate_lock()
+ mut.acquire()
+ started = []
+ def task():
+ started.append(None)
+ mut.acquire()
+ mut.release()
+ thread.start_new_thread(task, ())
+ while not started:
+ time.sleep(0.01)
+ self.assertEqual(thread._count(), orig + 1)
+ # Allow the task to finish.
+ mut.release()
+ # The only reliable way to be sure that the thread ended from the
+ # interpreter's point of view is to wait for the function object to be
+ # destroyed.
+ done = []
+ wr = weakref.ref(task, lambda _: done.append(None))
+ del task
+ while not done:
+ time.sleep(0.01)
+ self.assertEqual(thread._count(), orig)
+
class Barrier:
def __init__(self, num_threads):
@@ -166,8 +194,48 @@ class LockTests(lock_tests.LockTests):
locktype = thread.allocate_lock
+class TestForkInThread(unittest.TestCase):
+ def setUp(self):
+ self.read_fd, self.write_fd = os.pipe()
+
+ @unittest.skipIf(sys.platform.startswith('win'),
+ "This test is only appropriate for POSIX-like systems.")
+ @support.reap_threads
+ def test_forkinthread(self):
+ def thread1():
+ try:
+ pid = os.fork() # fork in a thread
+ except RuntimeError:
+ os._exit(1) # exit the child
+
+ if pid == 0: # child
+ try:
+ os.close(self.read_fd)
+ os.write(self.write_fd, b"OK")
+ finally:
+ os._exit(0)
+ else: # parent
+ os.close(self.write_fd)
+
+ thread.start_new_thread(thread1, ())
+ self.assertEqual(os.read(self.read_fd, 2), b"OK",
+ "Unable to fork() in thread")
+
+ def tearDown(self):
+ try:
+ os.close(self.read_fd)
+ except OSError:
+ pass
+
+ try:
+ os.close(self.write_fd)
+ except OSError:
+ pass
+
+
def test_main():
- support.run_unittest(ThreadRunningTests, BarrierTest, LockTests)
+ support.run_unittest(ThreadRunningTests, BarrierTest, LockTests,
+ TestForkInThread)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py
index e4d1882eae..7791935fdf 100644
--- a/Lib/test/test_threaded_import.py
+++ b/Lib/test/test_threaded_import.py
@@ -10,10 +10,6 @@ import imp
import sys
import time
import shutil
-# HACK: preloading tempfile is necessary to avoid failures when test_tempfile
-# is run after test_threaded_import. This has to do with dark secrets of
-# the import machinery and phantom copies of the random module.
-import tempfile
import unittest
from test.support import verbose, import_module, run_unittest, TESTFN
thread = import_module('_thread')
diff --git a/Lib/test/test_threadedtempfile.py b/Lib/test/test_threadedtempfile.py
index 745c6022ed..2dfd3a08db 100644
--- a/Lib/test/test_threadedtempfile.py
+++ b/Lib/test/test_threadedtempfile.py
@@ -16,11 +16,10 @@ provoking a 2.0 failure under Linux.
NUM_THREADS = 20
FILES_PER_THREAD = 50
-import _thread as thread # If this fails, we can't test this module
-import threading
import tempfile
-from test.support import threading_setup, threading_cleanup, run_unittest
+from test.support import threading_setup, threading_cleanup, run_unittest, import_module
+threading = import_module('threading')
import unittest
import io
from traceback import print_exc
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index f977a7fbbe..04c3598cba 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -1,17 +1,17 @@
# Very rudimentary test of threading module
import test.support
-from test.support import verbose
-import os
+from test.support import verbose, strip_python_stderr, import_module
import random
import re
import sys
-import threading
-import _thread
+_thread = import_module('_thread')
+threading = import_module('threading')
import time
import unittest
import weakref
-import subprocess
+import os
+from test.script_helper import assert_python_ok, assert_python_failure
from test import lock_tests
@@ -59,7 +59,16 @@ class TestThread(threading.Thread):
(self.name, self.nrunning.get()))
-class ThreadTests(unittest.TestCase):
+class BaseTestCase(unittest.TestCase):
+ def setUp(self):
+ self._threads = test.support.threading_setup()
+
+ def tearDown(self):
+ test.support.threading_cleanup(*self._threads)
+ test.support.reap_children()
+
+
+class ThreadTests(BaseTestCase):
# Create a bunch of threads, let each do some work, wait until all are
# done.
@@ -89,7 +98,8 @@ class ThreadTests(unittest.TestCase):
self.assertTrue(not t.is_alive())
self.assertNotEqual(t.ident, 0)
self.assertFalse(t.ident is None)
- self.assertTrue(re.match('<TestThread\(.*, \w+ -?\d+\)>', repr(t)))
+ self.assertTrue(re.match('<TestThread\(.*, stopped -?\d+\)>',
+ repr(t)))
if verbose:
print('all tasks done')
self.assertEqual(numrunning.get(), 0)
@@ -115,9 +125,8 @@ class ThreadTests(unittest.TestCase):
try:
threading.stack_size(262144)
except _thread.error:
- if verbose:
- print('platform does not support changing thread stack size')
- return
+ raise unittest.SkipTest(
+ 'platform does not support changing thread stack size')
self.test_various_ops()
threading.stack_size(0)
@@ -128,9 +137,8 @@ class ThreadTests(unittest.TestCase):
try:
threading.stack_size(0x100000)
except _thread.error:
- if verbose:
- print('platform does not support changing thread stack size')
- return
+ raise unittest.SkipTest(
+ 'platform does not support changing thread stack size')
self.test_various_ops()
threading.stack_size(0)
@@ -147,20 +155,14 @@ class ThreadTests(unittest.TestCase):
tid = _thread.start_new_thread(f, (mutex,))
# Wait for the thread to finish.
mutex.acquire()
- self.assertTrue(tid in threading._active)
- self.assertTrue(isinstance(threading._active[tid],
- threading._DummyThread))
+ self.assertIn(tid, threading._active)
+ self.assertIsInstance(threading._active[tid], threading._DummyThread)
del threading._active[tid]
# PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently)
# exposed at the Python level. This test relies on ctypes to get at it.
def test_PyThreadState_SetAsyncExc(self):
- try:
- import ctypes
- except ImportError:
- if verbose:
- print("test_PyThreadState_SetAsyncExc can't import ctypes")
- return # can't do anything
+ ctypes = import_module("ctypes")
set_async_exc = ctypes.pythonapi.PyThreadState_SetAsyncExc
@@ -169,6 +171,27 @@ class ThreadTests(unittest.TestCase):
exception = ctypes.py_object(AsyncExc)
+ # First check it works when setting the exception from the same thread.
+ tid = _thread.get_ident()
+
+ try:
+ result = set_async_exc(ctypes.c_long(tid), exception)
+ # The exception is async, so we might have to keep the VM busy until
+ # it notices.
+ while True:
+ pass
+ except AsyncExc:
+ pass
+ else:
+ # This code is unreachable but it reflects the intent. If we wanted
+ # to be smarter the above loop wouldn't be infinite.
+ self.fail("AsyncExc not raised")
+ try:
+ self.assertEqual(result, 1) # one thread state modified
+ except UnboundLocalError:
+ # The exception was raised too quickly for us to get the result.
+ pass
+
# `worker_started` is set by the thread when it's inside a try/except
# block waiting to catch the asynchronously set AsyncExc exception.
# `worker_saw_exception` is set by the thread upon catching that
@@ -242,14 +265,9 @@ class ThreadTests(unittest.TestCase):
# Issue 1402: the PyGILState_Ensure / _Release functions may be called
# very late on python exit: on deallocation of a running thread for
# example.
- try:
- import ctypes
- except ImportError:
- if verbose:
- print("test_finalize_with_runnning_thread can't import ctypes")
- return # can't do anything
+ import_module("ctypes")
- rc = subprocess.call([sys.executable, "-c", """if 1:
+ rc, out, err = assert_python_failure("-c", """if 1:
import ctypes, sys, time, _thread
# This lock is used as a simple event variable.
@@ -273,13 +291,13 @@ class ThreadTests(unittest.TestCase):
_thread.start_new_thread(waitingThread, ())
ready.acquire() # Be sure the other thread is waiting.
sys.exit(42)
- """])
+ """)
self.assertEqual(rc, 42)
def test_finalize_with_trace(self):
# Issue1733757
# Avoid a deadlock when sys.settrace steps into threading._shutdown
- p = subprocess.Popen([sys.executable, "-c", """if 1:
+ assert_python_ok("-c", """if 1:
import sys, threading
# A deadlock-killer, to prevent the
@@ -299,19 +317,12 @@ class ThreadTests(unittest.TestCase):
return func
sys.settrace(func)
- """],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- stdout, stderr = p.communicate()
- rc = p.returncode
- self.assertFalse(rc == 2, "interpreted was blocked")
- self.assertTrue(rc == 0,
- "Unexpected error: " + ascii(stderr))
+ """)
def test_join_nondaemon_on_shutdown(self):
# Issue 1722344
# Raising SystemExit skipped threading._shutdown
- p = subprocess.Popen([sys.executable, "-c", """if 1:
+ rc, out, err = assert_python_ok("-c", """if 1:
import threading
from time import sleep
@@ -323,33 +334,27 @@ class ThreadTests(unittest.TestCase):
threading.Thread(target=child).start()
raise SystemExit
- """],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- stdout, stderr = p.communicate()
- self.assertEqual(stdout.strip(),
+ """)
+ self.assertEqual(out.strip(),
b"Woke up, sleep function is: <built-in function sleep>")
- stderr = re.sub(br"^\[\d+ refs\]", b"", stderr, re.MULTILINE).strip()
- self.assertEqual(stderr, b"")
+ self.assertEqual(err, b"")
def test_enumerate_after_join(self):
# Try hard to trigger #1703448: a thread is still returned in
# threading.enumerate() after it has been join()ed.
enum = threading.enumerate
- old_interval = sys.getcheckinterval()
+ old_interval = sys.getswitchinterval()
try:
for i in range(1, 100):
- # Try a couple times at each thread-switching interval
- # to get more interleavings.
- sys.setcheckinterval(i // 5)
+ sys.setswitchinterval(i * 0.0002)
t = threading.Thread(target=lambda: None)
t.start()
t.join()
l = enum()
- self.assertFalse(t in l,
+ self.assertNotIn(t, l,
"#1703448 triggered after %d trials: %s" % (i, l))
finally:
- sys.setcheckinterval(old_interval)
+ sys.setswitchinterval(old_interval)
def test_no_refcycle_through_target(self):
class RunSelfFunction(object):
@@ -370,7 +375,7 @@ class ThreadTests(unittest.TestCase):
weak_cyclic_object = weakref.ref(cyclic_object)
cyclic_object.thread.join()
del cyclic_object
- self.assertEqual(None, weak_cyclic_object(),
+ self.assertIsNone(weak_cyclic_object(),
msg=('%d references still around' %
sys.getrefcount(weak_cyclic_object())))
@@ -378,7 +383,7 @@ class ThreadTests(unittest.TestCase):
weak_raising_cyclic_object = weakref.ref(raising_cyclic_object)
raising_cyclic_object.thread.join()
del raising_cyclic_object
- self.assertEqual(None, weak_raising_cyclic_object(),
+ self.assertIsNone(weak_raising_cyclic_object(),
msg=('%d references still around' %
sys.getrefcount(weak_raising_cyclic_object())))
@@ -395,8 +400,14 @@ class ThreadTests(unittest.TestCase):
e.isSet()
threading.activeCount()
+ def test_repr_daemon(self):
+ t = threading.Thread()
+ self.assertFalse('daemon' in repr(t))
+ t.daemon = True
+ self.assertTrue('daemon' in repr(t))
+
-class ThreadJoinOnShutdown(unittest.TestCase):
+class ThreadJoinOnShutdown(BaseTestCase):
def _run_and_join(self, script):
script = """if 1:
@@ -411,13 +422,9 @@ class ThreadJoinOnShutdown(unittest.TestCase):
sys.stdout.flush()
\n""" + script
- p = subprocess.Popen([sys.executable, "-c", script], stdout=subprocess.PIPE)
- rc = p.wait()
- data = p.stdout.read().decode().replace('\r', '')
- p.stdout.close()
+ rc, out, err = assert_python_ok("-c", script)
+ data = out.decode().replace('\r', '')
self.assertEqual(data, "end of main\nend of thread\n")
- self.assertFalse(rc == 2, "interpreter was blocked")
- self.assertTrue(rc == 0, "Unexpected error")
def test_1_join_on_shutdown(self):
# The usual case: on exit, wait for a non-daemon thread
@@ -431,12 +438,9 @@ class ThreadJoinOnShutdown(unittest.TestCase):
"""
self._run_and_join(script)
-
+ @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
def test_2_join_in_forked_process(self):
# Like the test above, but from a forked interpreter
- import os
- if not hasattr(os, 'fork'):
- return
script = """if 1:
childpid = os.fork()
if childpid != 0:
@@ -450,19 +454,16 @@ class ThreadJoinOnShutdown(unittest.TestCase):
"""
self._run_and_join(script)
+ @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
def test_3_join_in_forked_from_thread(self):
# Like the test above, but fork() was called from a worker thread
# In the forked process, the main Thread object must be marked as stopped.
- import os
- if not hasattr(os, 'fork'):
- return
+
# Skip platforms with known problems forking from a worker thread.
# See http://bugs.python.org/issue3863.
if sys.platform in ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5',
'os2emx'):
- print('Skipping test_3_join_in_forked_from_thread'
- ' due to known OS bugs on', sys.platform, file=sys.stderr)
- return
+ raise unittest.SkipTest('due to known OS bugs on ' + sys.platform)
script = """if 1:
main_thread = threading.current_thread()
def worker():
@@ -483,11 +484,8 @@ class ThreadJoinOnShutdown(unittest.TestCase):
self._run_and_join(script)
def assertScriptHasOutput(self, script, expected_output):
- p = subprocess.Popen([sys.executable, "-c", script],
- stdout=subprocess.PIPE)
- rc = p.wait()
- data = p.stdout.read().decode().replace('\r', '')
- self.assertEqual(rc, 0, "Unexpected error")
+ rc, out, err = assert_python_ok("-c", script)
+ data = out.decode().replace('\r', '')
self.assertEqual(data, expected_output)
@unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
@@ -628,8 +626,51 @@ class ThreadJoinOnShutdown(unittest.TestCase):
output = "end of worker thread\nend of main thread\n"
self.assertScriptHasOutput(script, output)
+ def test_6_daemon_threads(self):
+ # Check that a daemon thread cannot crash the interpreter on shutdown
+ # by manipulating internal structures that are being disposed of in
+ # the main thread.
+ script = """if True:
+ import os
+ import random
+ import sys
+ import time
+ import threading
+
+ thread_has_run = set()
+
+ def random_io():
+ '''Loop for a while sleeping random tiny amounts and doing some I/O.'''
+ blank = b'x' * 200
+ while True:
+ in_f = open(os.__file__, 'r')
+ stuff = in_f.read(200)
+ null_f = open(os.devnull, 'w')
+ null_f.write(stuff)
+ time.sleep(random.random() / 1995)
+ null_f.close()
+ in_f.close()
+ thread_has_run.add(threading.current_thread())
+
+ def main():
+ count = 0
+ for _ in range(40):
+ new_thread = threading.Thread(target=random_io)
+ new_thread.daemon = True
+ new_thread.start()
+ count += 1
+ while len(thread_has_run) < count:
+ time.sleep(0.001)
+ # Trigger process shutdown
+ sys.exit(0)
-class ThreadingExceptionTests(unittest.TestCase):
+ main()
+ """
+ rc, out, err = assert_python_ok('-c', script)
+ self.assertFalse(err)
+
+
+class ThreadingExceptionTests(BaseTestCase):
# A RuntimeError should be raised if Thread.start() is called
# multiple times.
def test_start_thread_again(self):
@@ -654,8 +695,11 @@ class ThreadingExceptionTests(unittest.TestCase):
class LockTests(lock_tests.LockTests):
locktype = staticmethod(threading.Lock)
-class RLockTests(lock_tests.RLockTests):
- locktype = staticmethod(threading.RLock)
+class PyRLockTests(lock_tests.RLockTests):
+ locktype = staticmethod(threading._PyRLock)
+
+class CRLockTests(lock_tests.RLockTests):
+ locktype = staticmethod(threading._CRLock)
class EventTests(lock_tests.EventTests):
eventtype = staticmethod(threading.Event)
@@ -673,14 +717,17 @@ class SemaphoreTests(lock_tests.SemaphoreTests):
class BoundedSemaphoreTests(lock_tests.BoundedSemaphoreTests):
semtype = staticmethod(threading.BoundedSemaphore)
+class BarrierTests(lock_tests.BarrierTests):
+ barriertype = staticmethod(threading.Barrier)
def test_main():
- test.support.run_unittest(LockTests, RLockTests, EventTests,
+ test.support.run_unittest(LockTests, PyRLockTests, CRLockTests, EventTests,
ConditionAsRLockTests, ConditionTests,
SemaphoreTests, BoundedSemaphoreTests,
ThreadTests,
ThreadJoinOnShutdown,
ThreadingExceptionTests,
+ BarrierTests
)
if __name__ == "__main__":
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py
index c9d0fddf2f..c886a25d8a 100644
--- a/Lib/test/test_threading_local.py
+++ b/Lib/test/test_threading_local.py
@@ -46,7 +46,7 @@ class BaseLocalTest:
local.someothervar = None
gc.collect()
deadlist = [weak for weak in weaklist if weak() is None]
- self.assertTrue(len(deadlist) in (n-1, n), (n, len(deadlist)))
+ self.assertIn(len(deadlist), (n-1, n), (n, len(deadlist)))
def test_derived(self):
# Issue 3088: if there is a threads switch inside the __init__
@@ -112,6 +112,17 @@ class BaseLocalTest:
self.assertTrue(passed)
+ def test_arguments(self):
+ # Issue 1522237
+ class MyLocal(self._local):
+ def __init__(self, *args, **kwargs):
+ pass
+
+ MyLocal(a=1)
+ MyLocal(1)
+ self.assertRaises(TypeError, self._local, a=1)
+ self.assertRaises(TypeError, self._local, 1)
+
def _test_one_class(self, c):
self._failed = "No error message set or cleared."
obj = c()
@@ -173,11 +184,6 @@ class BaseLocalTest:
"""To test that subclasses behave properly."""
self._test_dict_attribute(LocalSubclass)
-
-class ThreadLocalTest(unittest.TestCase, BaseLocalTest):
- _local = _thread._local
-
- # Fails for the pure Python implementation
def test_cycle_collection(self):
class X:
pass
@@ -190,6 +196,10 @@ class ThreadLocalTest(unittest.TestCase, BaseLocalTest):
gc.collect()
self.assertIs(wr(), None)
+
+class ThreadLocalTest(unittest.TestCase, BaseLocalTest):
+ _local = _thread._local
+
class PyThreadingLocalTest(unittest.TestCase, BaseLocalTest):
_local = _threading_local.local
diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py
index 7959e917eb..46e405ab81 100644
--- a/Lib/test/test_threadsignals.py
+++ b/Lib/test/test_threadsignals.py
@@ -1,11 +1,12 @@
"""PyUnit testing that threads honor our signal semantics"""
import unittest
-import _thread as thread
import signal
import os
import sys
-from test.support import run_unittest
+from test.support import run_unittest, import_module
+thread = import_module('_thread')
+import time
if sys.platform[:3] in ('win', 'os2') or sys.platform=='riscos':
raise unittest.SkipTest("Can't test signal on %s" % sys.platform)
@@ -34,12 +35,12 @@ def send_signals():
signalled_all.release()
class ThreadSignals(unittest.TestCase):
- """Test signal handling semantics of threads.
- We spawn a thread, have the thread send two signals, and
- wait for it to finish. Check that we got both signals
- and that they were run by the main thread.
- """
+
def test_signals(self):
+ # Test signal handling semantics of threads.
+ # We spawn a thread, have the thread send two signals, and
+ # wait for it to finish. Check that we got both signals
+ # and that they were run by the main thread.
signalled_all.acquire()
self.spawnSignallingThread()
signalled_all.acquire()
@@ -66,6 +67,136 @@ class ThreadSignals(unittest.TestCase):
def spawnSignallingThread(self):
thread.start_new_thread(send_signals, ())
+ def alarm_interrupt(self, sig, frame):
+ raise KeyboardInterrupt
+
+ def test_lock_acquire_interruption(self):
+ # Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck
+ # in a deadlock.
+ # XXX this test can fail when the legacy (non-semaphore) implementation
+ # of locks is used in thread_pthread.h, see issue #11223.
+ oldalrm = signal.signal(signal.SIGALRM, self.alarm_interrupt)
+ try:
+ lock = thread.allocate_lock()
+ lock.acquire()
+ signal.alarm(1)
+ t1 = time.time()
+ self.assertRaises(KeyboardInterrupt, lock.acquire, timeout=5)
+ dt = time.time() - t1
+ # Checking that KeyboardInterrupt was raised is not sufficient.
+ # We want to assert that lock.acquire() was interrupted because
+ # of the signal, not that the signal handler was called immediately
+ # after timeout return of lock.acquire() (which can fool assertRaises).
+ self.assertLess(dt, 3.0)
+ finally:
+ signal.signal(signal.SIGALRM, oldalrm)
+
+ def test_rlock_acquire_interruption(self):
+ # Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck
+ # in a deadlock.
+ # XXX this test can fail when the legacy (non-semaphore) implementation
+ # of locks is used in thread_pthread.h, see issue #11223.
+ oldalrm = signal.signal(signal.SIGALRM, self.alarm_interrupt)
+ try:
+ rlock = thread.RLock()
+ # For reentrant locks, the initial acquisition must be in another
+ # thread.
+ def other_thread():
+ rlock.acquire()
+ thread.start_new_thread(other_thread, ())
+ # Wait until we can't acquire it without blocking...
+ while rlock.acquire(blocking=False):
+ rlock.release()
+ time.sleep(0.01)
+ signal.alarm(1)
+ t1 = time.time()
+ self.assertRaises(KeyboardInterrupt, rlock.acquire, timeout=5)
+ dt = time.time() - t1
+ # See rationale above in test_lock_acquire_interruption
+ self.assertLess(dt, 3.0)
+ finally:
+ signal.signal(signal.SIGALRM, oldalrm)
+
+ def acquire_retries_on_intr(self, lock):
+ self.sig_recvd = False
+ def my_handler(signal, frame):
+ self.sig_recvd = True
+ old_handler = signal.signal(signal.SIGUSR1, my_handler)
+ try:
+ def other_thread():
+ # Acquire the lock in a non-main thread, so this test works for
+ # RLocks.
+ lock.acquire()
+ # Wait until the main thread is blocked in the lock acquire, and
+ # then wake it up with this.
+ time.sleep(0.5)
+ os.kill(process_pid, signal.SIGUSR1)
+ # Let the main thread take the interrupt, handle it, and retry
+ # the lock acquisition. Then we'll let it run.
+ time.sleep(0.5)
+ lock.release()
+ thread.start_new_thread(other_thread, ())
+ # Wait until we can't acquire it without blocking...
+ while lock.acquire(blocking=False):
+ lock.release()
+ time.sleep(0.01)
+ result = lock.acquire() # Block while we receive a signal.
+ self.assertTrue(self.sig_recvd)
+ self.assertTrue(result)
+ finally:
+ signal.signal(signal.SIGUSR1, old_handler)
+
+ def test_lock_acquire_retries_on_intr(self):
+ self.acquire_retries_on_intr(thread.allocate_lock())
+
+ def test_rlock_acquire_retries_on_intr(self):
+ self.acquire_retries_on_intr(thread.RLock())
+
+ def test_interrupted_timed_acquire(self):
+ # Test to make sure we recompute lock acquisition timeouts when we
+ # receive a signal. Check this by repeatedly interrupting a lock
+ # acquire in the main thread, and make sure that the lock acquire times
+ # out after the right amount of time.
+ # NOTE: this test only behaves as expected if C signals get delivered
+ # to the main thread. Otherwise lock.acquire() itself doesn't get
+ # interrupted and the test trivially succeeds.
+ self.start = None
+ self.end = None
+ self.sigs_recvd = 0
+ done = thread.allocate_lock()
+ done.acquire()
+ lock = thread.allocate_lock()
+ lock.acquire()
+ def my_handler(signum, frame):
+ self.sigs_recvd += 1
+ old_handler = signal.signal(signal.SIGUSR1, my_handler)
+ try:
+ def timed_acquire():
+ self.start = time.time()
+ lock.acquire(timeout=0.5)
+ self.end = time.time()
+ def send_signals():
+ for _ in range(40):
+ time.sleep(0.02)
+ os.kill(process_pid, signal.SIGUSR1)
+ done.release()
+
+ # Send the signals from the non-main thread, since the main thread
+ # is the only one that can process signals.
+ thread.start_new_thread(send_signals, ())
+ timed_acquire()
+ # Wait for thread to finish
+ done.acquire()
+ # This allows for some timing and scheduling imprecision
+ self.assertLess(self.end - self.start, 2.0)
+ self.assertGreater(self.end - self.start, 0.3)
+ # If the signal is received several times before PyErr_CheckSignals()
+ # is called, the handler will get called less than 40 times. Just
+ # check it's been called at least once.
+ self.assertGreater(self.sigs_recvd, 0)
+ finally:
+ signal.signal(signal.SIGUSR1, old_handler)
+
def test_main():
global signal_blackboard
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 65b273557f..8499af8157 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -2,7 +2,9 @@ from test import support
import time
import unittest
import locale
+import sysconfig
import sys
+import warnings
class TimeTestCase(unittest.TestCase):
@@ -19,10 +21,10 @@ class TimeTestCase(unittest.TestCase):
time.clock()
def test_conversions(self):
- self.assertTrue(time.ctime(self.t)
- == time.asctime(time.localtime(self.t)))
- self.assertTrue(int(time.mktime(time.localtime(self.t)))
- == int(self.t))
+ self.assertEqual(time.ctime(self.t),
+ time.asctime(time.localtime(self.t)))
+ self.assertEqual(int(time.mktime(time.localtime(self.t))),
+ int(self.t))
def test_sleep(self):
time.sleep(1.2)
@@ -45,68 +47,61 @@ class TimeTestCase(unittest.TestCase):
with self.assertRaises(ValueError):
time.strftime('%f')
- def test_strftime_bounds_checking(self):
+ def _bounds_checking(self, func=time.strftime):
# Make sure that strftime() checks the bounds of the various parts
#of the time tuple (0 is valid for *all* values).
- # Check year [1900, max(int)]
- self.assertRaises(ValueError, time.strftime, '',
- (1899, 1, 1, 0, 0, 0, 0, 1, -1))
- if time.accept2dyear:
- self.assertRaises(ValueError, time.strftime, '',
- (-1, 1, 1, 0, 0, 0, 0, 1, -1))
- self.assertRaises(ValueError, time.strftime, '',
- (100, 1, 1, 0, 0, 0, 0, 1, -1))
+ # The year field is tested by other test cases above
+
# Check month [1, 12] + zero support
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, -1, 1, 0, 0, 0, 0, 1, -1))
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 13, 1, 0, 0, 0, 0, 1, -1))
# Check day of month [1, 31] + zero support
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, -1, 0, 0, 0, 0, 1, -1))
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 32, 0, 0, 0, 0, 1, -1))
# Check hour [0, 23]
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 1, -1, 0, 0, 0, 1, -1))
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 1, 24, 0, 0, 0, 1, -1))
# Check minute [0, 59]
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 1, 0, -1, 0, 0, 1, -1))
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 1, 0, 60, 0, 0, 1, -1))
# Check second [0, 61]
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 1, 0, 0, -1, 0, 1, -1))
# C99 only requires allowing for one leap second, but Python's docs say
# allow two leap seconds (0..61)
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 1, 0, 0, 62, 0, 1, -1))
# No check for upper-bound day of week;
# value forced into range by a ``% 7`` calculation.
# Start check at -2 since gettmarg() increments value before taking
# modulo.
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 1, 0, 0, 0, -2, 1, -1))
# Check day of the year [1, 366] + zero support
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 1, 0, 0, 0, 0, -1, -1))
- self.assertRaises(ValueError, time.strftime, '',
+ self.assertRaises(ValueError, func,
(1900, 1, 1, 0, 0, 0, 0, 367, -1))
- # Check daylight savings flag [-1, 1]
- self.assertRaises(ValueError, time.strftime, '',
- (1900, 1, 1, 0, 0, 0, 0, 1, -2))
- self.assertRaises(ValueError, time.strftime, '',
- (1900, 1, 1, 0, 0, 0, 0, 1, 2))
+
+ def test_strftime_bounding_check(self):
+ self._bounds_checking(lambda tup: time.strftime('', tup))
def test_default_values_for_zero(self):
# Make sure that using all zeros uses the proper default values.
# No test for daylight savings since strftime() does not change output
# based on its value.
expected = "2000 01 01 00 00 00 1 001"
- result = time.strftime("%Y %m %d %H %M %S %w %j", (0,)*9)
+ with support.check_warnings():
+ result = time.strftime("%Y %m %d %H %M %S %w %j", (0,)*9)
self.assertEqual(expected, result)
def test_strptime(self):
@@ -131,17 +126,34 @@ class TimeTestCase(unittest.TestCase):
def test_asctime(self):
time.asctime(time.gmtime(self.t))
+
+ # Max year is only limited by the size of C int.
+ sizeof_int = sysconfig.get_config_var('SIZEOF_INT') or 4
+ bigyear = (1 << 8 * sizeof_int - 1) - 1
+ asc = time.asctime((bigyear, 6, 1) + (0,)*6)
+ self.assertEqual(asc[-len(str(bigyear)):], str(bigyear))
+ self.assertRaises(OverflowError, time.asctime, (bigyear + 1,) + (0,)*8)
self.assertRaises(TypeError, time.asctime, 0)
self.assertRaises(TypeError, time.asctime, ())
- # XXX: Posix compiant asctime should refuse to convert
- # year > 9999, but Linux implementation does not.
- # self.assertRaises(ValueError, time.asctime,
- # (12345, 1, 0, 0, 0, 0, 0, 0, 0))
- # XXX: For now, just make sure we don't have a crash:
- try:
- time.asctime((12345, 1, 1, 0, 0, 0, 0, 1, 0))
- except ValueError:
- pass
+ self.assertRaises(TypeError, time.asctime, (0,) * 10)
+
+ def test_asctime_bounding_check(self):
+ self._bounds_checking(time.asctime)
+
+ def test_ctime(self):
+ t = time.mktime((1973, 9, 16, 1, 3, 52, 0, 0, -1))
+ self.assertEqual(time.ctime(t), 'Sun Sep 16 01:03:52 1973')
+ t = time.mktime((2000, 1, 1, 0, 0, 0, 0, 0, -1))
+ self.assertEqual(time.ctime(t), 'Sat Jan 1 00:00:00 2000')
+ for year in [-100, 100, 1000, 2000, 10000]:
+ try:
+ testval = time.mktime((year, 1, 10) + (0,)*6)
+ except (ValueError, OverflowError):
+ # If mktime fails, ctime will fail too. This may happen
+ # on some platforms.
+ pass
+ else:
+ self.assertEqual(time.ctime(testval)[20:], str(year))
@unittest.skipIf(not hasattr(time, "tzset"),
"time module has no attribute tzset")
@@ -232,24 +244,14 @@ class TimeTestCase(unittest.TestCase):
gt1 = time.gmtime(None)
t0 = time.mktime(gt0)
t1 = time.mktime(gt1)
- self.assertTrue(0 <= (t1-t0) < 0.2)
+ self.assertAlmostEqual(t1, t0, delta=0.2)
def test_localtime_without_arg(self):
lt0 = time.localtime()
lt1 = time.localtime(None)
t0 = time.mktime(lt0)
t1 = time.mktime(lt1)
- self.assertTrue(0 <= (t1-t0) < 0.2)
-
- def test_mktime(self):
- # Issue #1726687
- for t in (-2, -1, 0, 1):
- try:
- tt = time.localtime(t)
- except (OverflowError, ValueError):
- pass
- else:
- self.assertEqual(time.mktime(tt), t)
+ self.assertAlmostEqual(t1, t0, delta=0.2)
class TestLocale(unittest.TestCase):
def setUp(self):
@@ -267,8 +269,138 @@ class TestLocale(unittest.TestCase):
# This should not cause an exception
time.strftime("%B", (2009,2,1,0,0,0,0,0,0))
+
+class _BaseYearTest(unittest.TestCase):
+ accept2dyear = None
+
+ def setUp(self):
+ self.saved_accept2dyear = time.accept2dyear
+ time.accept2dyear = self.accept2dyear
+
+ def tearDown(self):
+ time.accept2dyear = self.saved_accept2dyear
+
+ def yearstr(self, y):
+ raise NotImplementedError()
+
+class _TestAsctimeYear:
+ def yearstr(self, y):
+ return time.asctime((y,) + (0,) * 8).split()[-1]
+
+ def test_large_year(self):
+ # Check that it doesn't crash for year > 9999
+ self.assertEqual(self.yearstr(12345), '12345')
+ self.assertEqual(self.yearstr(123456789), '123456789')
+
+class _TestStrftimeYear:
+ def yearstr(self, y):
+ return time.strftime('%Y', (y,) + (0,) * 8).split()[-1]
+
+ def test_large_year(self):
+ # Check that it doesn't crash for year > 9999
+ try:
+ text = self.yearstr(12345)
+ except ValueError:
+ # strftime() is limited to [1; 9999] with Visual Studio
+ return
+ self.assertEqual(text, '12345')
+ self.assertEqual(self.yearstr(123456789), '123456789')
+
+class _Test2dYear(_BaseYearTest):
+ accept2dyear = 1
+
+ def test_year(self):
+ with support.check_warnings():
+ self.assertEqual(self.yearstr(0), '2000')
+ self.assertEqual(self.yearstr(69), '1969')
+ self.assertEqual(self.yearstr(68), '2068')
+ self.assertEqual(self.yearstr(99), '1999')
+
+ def test_invalid(self):
+ self.assertRaises(ValueError, self.yearstr, -1)
+ self.assertRaises(ValueError, self.yearstr, 100)
+ self.assertRaises(ValueError, self.yearstr, 999)
+
+class _Test4dYear(_BaseYearTest):
+ accept2dyear = 0
+
+ def test_year(self):
+ self.assertIn(self.yearstr(1), ('1', '0001'))
+ self.assertIn(self.yearstr(68), ('68', '0068'))
+ self.assertIn(self.yearstr(69), ('69', '0069'))
+ self.assertIn(self.yearstr(99), ('99', '0099'))
+ self.assertIn(self.yearstr(999), ('999', '0999'))
+ self.assertEqual(self.yearstr(9999), '9999')
+
+ def test_negative(self):
+ try:
+ text = self.yearstr(-1)
+ except ValueError:
+ # strftime() is limited to [1; 9999] with Visual Studio
+ return
+ self.assertIn(text, ('-1', '-001'))
+
+ self.assertEqual(self.yearstr(-1234), '-1234')
+ self.assertEqual(self.yearstr(-123456), '-123456')
+
+
+ def test_mktime(self):
+ # Issue #1726687
+ for t in (-2, -1, 0, 1):
+ try:
+ tt = time.localtime(t)
+ except (OverflowError, ValueError):
+ pass
+ else:
+ self.assertEqual(time.mktime(tt), t)
+ # It may not be possible to reliably make mktime return error
+ # on all platfom. This will make sure that no other exception
+ # than OverflowError is raised for an extreme value.
+ try:
+ time.mktime((-1, 1, 1, 0, 0, 0, -1, -1, -1))
+ except OverflowError:
+ pass
+
+class TestAsctimeAccept2dYear(_TestAsctimeYear, _Test2dYear):
+ pass
+
+class TestStrftimeAccept2dYear(_TestStrftimeYear, _Test2dYear):
+ pass
+
+class TestAsctime4dyear(_TestAsctimeYear, _Test4dYear):
+ pass
+
+class TestStrftime4dyear(_TestStrftimeYear, _Test4dYear):
+ pass
+
+class Test2dyearBool(_TestAsctimeYear, _Test2dYear):
+ accept2dyear = True
+
+class Test4dyearBool(_TestAsctimeYear, _Test4dYear):
+ accept2dyear = False
+
+class TestAccept2YearBad(_TestAsctimeYear, _BaseYearTest):
+ class X:
+ def __bool__(self):
+ raise RuntimeError('boo')
+ accept2dyear = X()
+ def test_2dyear(self):
+ pass
+ def test_invalid(self):
+ self.assertRaises(RuntimeError, self.yearstr, 200)
+
+
def test_main():
- support.run_unittest(TimeTestCase, TestLocale)
+ support.run_unittest(
+ TimeTestCase,
+ TestLocale,
+ TestAsctimeAccept2dYear,
+ TestStrftimeAccept2dYear,
+ TestAsctime4dyear,
+ TestStrftime4dyear,
+ Test2dyearBool,
+ Test4dyearBool,
+ TestAccept2YearBad)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_timeit.py b/Lib/test/test_timeit.py
new file mode 100644
index 0000000000..eb3b1a156b
--- /dev/null
+++ b/Lib/test/test_timeit.py
@@ -0,0 +1,305 @@
+import timeit
+import unittest
+import sys
+import io
+import time
+from textwrap import dedent
+
+from test.support import run_unittest
+from test.support import captured_stdout
+from test.support import captured_stderr
+
+# timeit's default number of iterations.
+DEFAULT_NUMBER = 1000000
+
+# timeit's default number of repetitions.
+DEFAULT_REPEAT = 3
+
+# XXX: some tests are commented out that would improve the coverage but take a
+# long time to run because they test the default number of loops, which is
+# large. The tests could be enabled if there was a way to override the default
+# number of loops during testing, but this would require changing the signature
+# of some functions that use the default as a default argument.
+
+class FakeTimer:
+ BASE_TIME = 42.0
+ def __init__(self, seconds_per_increment=1.0):
+ self.count = 0
+ self.setup_calls = 0
+ self.seconds_per_increment=seconds_per_increment
+ timeit._fake_timer = self
+
+ def __call__(self):
+ return self.BASE_TIME + self.count * self.seconds_per_increment
+
+ def inc(self):
+ self.count += 1
+
+ def setup(self):
+ self.setup_calls += 1
+
+ def wrap_timer(self, timer):
+ """Records 'timer' and returns self as callable timer."""
+ self.saved_timer = timer
+ return self
+
+class TestTimeit(unittest.TestCase):
+
+ def tearDown(self):
+ try:
+ del timeit._fake_timer
+ except AttributeError:
+ pass
+
+ def test_reindent_empty(self):
+ self.assertEqual(timeit.reindent("", 0), "")
+ self.assertEqual(timeit.reindent("", 4), "")
+
+ def test_reindent_single(self):
+ self.assertEqual(timeit.reindent("pass", 0), "pass")
+ self.assertEqual(timeit.reindent("pass", 4), "pass")
+
+ def test_reindent_multi_empty(self):
+ self.assertEqual(timeit.reindent("\n\n", 0), "\n\n")
+ self.assertEqual(timeit.reindent("\n\n", 4), "\n \n ")
+
+ def test_reindent_multi(self):
+ self.assertEqual(timeit.reindent(
+ "print()\npass\nbreak", 0),
+ "print()\npass\nbreak")
+ self.assertEqual(timeit.reindent(
+ "print()\npass\nbreak", 4),
+ "print()\n pass\n break")
+
+ def test_timer_invalid_stmt(self):
+ self.assertRaises(ValueError, timeit.Timer, stmt=None)
+
+ def test_timer_invalid_setup(self):
+ self.assertRaises(ValueError, timeit.Timer, setup=None)
+
+ fake_setup = "import timeit; timeit._fake_timer.setup()"
+ fake_stmt = "import timeit; timeit._fake_timer.inc()"
+
+ def fake_callable_setup(self):
+ self.fake_timer.setup()
+
+ def fake_callable_stmt(self):
+ self.fake_timer.inc()
+
+ def timeit(self, stmt, setup, number=None):
+ self.fake_timer = FakeTimer()
+ t = timeit.Timer(stmt=stmt, setup=setup, timer=self.fake_timer)
+ kwargs = {}
+ if number is None:
+ number = DEFAULT_NUMBER
+ else:
+ kwargs['number'] = number
+ delta_time = t.timeit(**kwargs)
+ self.assertEqual(self.fake_timer.setup_calls, 1)
+ self.assertEqual(self.fake_timer.count, number)
+ self.assertEqual(delta_time, number)
+
+ # Takes too long to run in debug build.
+ #def test_timeit_default_iters(self):
+ # self.timeit(self.fake_stmt, self.fake_setup)
+
+ def test_timeit_zero_iters(self):
+ self.timeit(self.fake_stmt, self.fake_setup, number=0)
+
+ def test_timeit_few_iters(self):
+ self.timeit(self.fake_stmt, self.fake_setup, number=3)
+
+ def test_timeit_callable_stmt(self):
+ self.timeit(self.fake_callable_stmt, self.fake_setup, number=3)
+
+ def test_timeit_callable_stmt_and_setup(self):
+ self.timeit(self.fake_callable_stmt,
+ self.fake_callable_setup, number=3)
+
+ # Takes too long to run in debug build.
+ #def test_timeit_function(self):
+ # delta_time = timeit.timeit(self.fake_stmt, self.fake_setup,
+ # timer=FakeTimer())
+ # self.assertEqual(delta_time, DEFAULT_NUMBER)
+
+ def test_timeit_function_zero_iters(self):
+ delta_time = timeit.timeit(self.fake_stmt, self.fake_setup, number=0,
+ timer=FakeTimer())
+ self.assertEqual(delta_time, 0)
+
+ def repeat(self, stmt, setup, repeat=None, number=None):
+ self.fake_timer = FakeTimer()
+ t = timeit.Timer(stmt=stmt, setup=setup, timer=self.fake_timer)
+ kwargs = {}
+ if repeat is None:
+ repeat = DEFAULT_REPEAT
+ else:
+ kwargs['repeat'] = repeat
+ if number is None:
+ number = DEFAULT_NUMBER
+ else:
+ kwargs['number'] = number
+ delta_times = t.repeat(**kwargs)
+ self.assertEqual(self.fake_timer.setup_calls, repeat)
+ self.assertEqual(self.fake_timer.count, repeat * number)
+ self.assertEqual(delta_times, repeat * [float(number)])
+
+ # Takes too long to run in debug build.
+ #def test_repeat_default(self):
+ # self.repeat(self.fake_stmt, self.fake_setup)
+
+ def test_repeat_zero_reps(self):
+ self.repeat(self.fake_stmt, self.fake_setup, repeat=0)
+
+ def test_repeat_zero_iters(self):
+ self.repeat(self.fake_stmt, self.fake_setup, number=0)
+
+ def test_repeat_few_reps_and_iters(self):
+ self.repeat(self.fake_stmt, self.fake_setup, repeat=3, number=5)
+
+ def test_repeat_callable_stmt(self):
+ self.repeat(self.fake_callable_stmt, self.fake_setup,
+ repeat=3, number=5)
+
+ def test_repeat_callable_stmt_and_setup(self):
+ self.repeat(self.fake_callable_stmt, self.fake_callable_setup,
+ repeat=3, number=5)
+
+ # Takes too long to run in debug build.
+ #def test_repeat_function(self):
+ # delta_times = timeit.repeat(self.fake_stmt, self.fake_setup,
+ # timer=FakeTimer())
+ # self.assertEqual(delta_times, DEFAULT_REPEAT * [float(DEFAULT_NUMBER)])
+
+ def test_repeat_function_zero_reps(self):
+ delta_times = timeit.repeat(self.fake_stmt, self.fake_setup, repeat=0,
+ timer=FakeTimer())
+ self.assertEqual(delta_times, [])
+
+ def test_repeat_function_zero_iters(self):
+ delta_times = timeit.repeat(self.fake_stmt, self.fake_setup, number=0,
+ timer=FakeTimer())
+ self.assertEqual(delta_times, DEFAULT_REPEAT * [0.0])
+
+ def assert_exc_string(self, exc_string, expected_exc_name):
+ exc_lines = exc_string.splitlines()
+ self.assertGreater(len(exc_lines), 2)
+ self.assertTrue(exc_lines[0].startswith('Traceback'))
+ self.assertTrue(exc_lines[-1].startswith(expected_exc_name))
+
+ def test_print_exc(self):
+ s = io.StringIO()
+ t = timeit.Timer("1/0")
+ try:
+ t.timeit()
+ except:
+ t.print_exc(s)
+ self.assert_exc_string(s.getvalue(), 'ZeroDivisionError')
+
+ MAIN_DEFAULT_OUTPUT = "10 loops, best of 3: 1 sec per loop\n"
+
+ def run_main(self, seconds_per_increment=1.0, switches=None, timer=None):
+ if timer is None:
+ timer = FakeTimer(seconds_per_increment=seconds_per_increment)
+ if switches is None:
+ args = []
+ else:
+ args = switches[:]
+ args.append(self.fake_stmt)
+ # timeit.main() modifies sys.path, so save and restore it.
+ orig_sys_path = sys.path[:]
+ with captured_stdout() as s:
+ timeit.main(args=args, _wrap_timer=timer.wrap_timer)
+ sys.path[:] = orig_sys_path[:]
+ return s.getvalue()
+
+ def test_main_bad_switch(self):
+ s = self.run_main(switches=['--bad-switch'])
+ self.assertEqual(s, dedent("""\
+ option --bad-switch not recognized
+ use -h/--help for command line help
+ """))
+
+ def test_main_seconds(self):
+ s = self.run_main(seconds_per_increment=5.5)
+ self.assertEqual(s, "10 loops, best of 3: 5.5 sec per loop\n")
+
+ def test_main_milliseconds(self):
+ s = self.run_main(seconds_per_increment=0.0055)
+ self.assertEqual(s, "100 loops, best of 3: 5.5 msec per loop\n")
+
+ def test_main_microseconds(self):
+ s = self.run_main(seconds_per_increment=0.0000025, switches=['-n100'])
+ self.assertEqual(s, "100 loops, best of 3: 2.5 usec per loop\n")
+
+ def test_main_fixed_iters(self):
+ s = self.run_main(seconds_per_increment=2.0, switches=['-n35'])
+ self.assertEqual(s, "35 loops, best of 3: 2 sec per loop\n")
+
+ def test_main_setup(self):
+ s = self.run_main(seconds_per_increment=2.0,
+ switches=['-n35', '-s', 'print("CustomSetup")'])
+ self.assertEqual(s, "CustomSetup\n" * 3 +
+ "35 loops, best of 3: 2 sec per loop\n")
+
+ def test_main_fixed_reps(self):
+ s = self.run_main(seconds_per_increment=60.0, switches=['-r9'])
+ self.assertEqual(s, "10 loops, best of 9: 60 sec per loop\n")
+
+ def test_main_negative_reps(self):
+ s = self.run_main(seconds_per_increment=60.0, switches=['-r-5'])
+ self.assertEqual(s, "10 loops, best of 1: 60 sec per loop\n")
+
+ def test_main_help(self):
+ s = self.run_main(switches=['-h'])
+ # Note: It's not clear that the trailing space was intended as part of
+ # the help text, but since it's there, check for it.
+ self.assertEqual(s, timeit.__doc__ + ' ')
+
+ def test_main_using_time(self):
+ fake_timer = FakeTimer()
+ s = self.run_main(switches=['-t'], timer=fake_timer)
+ self.assertEqual(s, self.MAIN_DEFAULT_OUTPUT)
+ self.assertIs(fake_timer.saved_timer, time.time)
+
+ def test_main_using_clock(self):
+ fake_timer = FakeTimer()
+ s = self.run_main(switches=['-c'], timer=fake_timer)
+ self.assertEqual(s, self.MAIN_DEFAULT_OUTPUT)
+ self.assertIs(fake_timer.saved_timer, time.clock)
+
+ def test_main_verbose(self):
+ s = self.run_main(switches=['-v'])
+ self.assertEqual(s, dedent("""\
+ 10 loops -> 10 secs
+ raw times: 10 10 10
+ 10 loops, best of 3: 1 sec per loop
+ """))
+
+ def test_main_very_verbose(self):
+ s = self.run_main(seconds_per_increment=0.000050, switches=['-vv'])
+ self.assertEqual(s, dedent("""\
+ 10 loops -> 0.0005 secs
+ 100 loops -> 0.005 secs
+ 1000 loops -> 0.05 secs
+ 10000 loops -> 0.5 secs
+ raw times: 0.5 0.5 0.5
+ 10000 loops, best of 3: 50 usec per loop
+ """))
+
+ def test_main_exception(self):
+ with captured_stderr() as error_stringio:
+ s = self.run_main(switches=['1/0'])
+ self.assert_exc_string(error_stringio.getvalue(), 'ZeroDivisionError')
+
+ def test_main_exception_fixed_reps(self):
+ with captured_stderr() as error_stringio:
+ s = self.run_main(switches=['-n1', '1/0'])
+ self.assert_exc_string(error_stringio.getvalue(), 'ZeroDivisionError')
+
+
+def test_main():
+ run_unittest(TestTimeit)
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py
index bbcdc25672..4cad49926d 100644
--- a/Lib/test/test_timeout.py
+++ b/Lib/test/test_timeout.py
@@ -7,6 +7,7 @@ from test import support
skip_expected = not support.is_resource_enabled('network')
import time
+import errno
import socket
@@ -88,8 +89,6 @@ class CreationTestCase(unittest.TestCase):
class TimeoutTestCase(unittest.TestCase):
- """Test case for socket.socket() timeout functions"""
-
# There are a number of tests here trying to make sure that an operation
# doesn't take too much longer than expected. But competing machine
# activity makes it inevitable that such tests will fail at times.
@@ -98,10 +97,42 @@ class TimeoutTestCase(unittest.TestCase):
# solution.
fuzz = 2.0
+ localhost = '127.0.0.1'
+
+ def setUp(self):
+ raise NotImplementedError()
+
+ tearDown = setUp
+
+ def _sock_operation(self, count, timeout, method, *args):
+ """
+ Test the specified socket method.
+
+ The method is run at most `count` times and must raise a socket.timeout
+ within `timeout` + self.fuzz seconds.
+ """
+ self.sock.settimeout(timeout)
+ method = getattr(self.sock, method)
+ for i in range(count):
+ t1 = time.time()
+ try:
+ method(*args)
+ except socket.timeout as e:
+ delta = time.time() - t1
+ break
+ else:
+ self.fail('socket.timeout was not raised')
+ # These checks should account for timing unprecision
+ self.assertLess(delta, timeout + self.fuzz)
+ self.assertGreater(delta, timeout - 1.0)
+
+
+class TCPTimeoutTestCase(TimeoutTestCase):
+ """TCP test case for socket.socket() timeout functions"""
+
def setUp(self):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.addr_remote = ('www.python.org.', 80)
- self.localhost = '127.0.0.1'
def tearDown(self):
self.sock.close()
@@ -113,90 +144,73 @@ class TimeoutTestCase(unittest.TestCase):
# with the connect time. This avoids failing the assertion that
# the timeout occurred fast enough.
addr = ('10.0.0.0', 12345)
-
- # Test connect() timeout
- _timeout = 0.001
- self.sock.settimeout(_timeout)
-
- _t1 = time.time()
- self.assertRaises(socket.error, self.sock.connect, addr)
- _t2 = time.time()
-
- _delta = abs(_t1 - _t2)
- self.assertTrue(_delta < _timeout + self.fuzz,
- "timeout (%g) is more than %g seconds more than expected (%g)"
- %(_delta, self.fuzz, _timeout))
+ with support.transient_internet(addr[0]):
+ self._sock_operation(1, 0.001, 'connect', addr)
def testRecvTimeout(self):
# Test recv() timeout
- _timeout = 0.02
-
with support.transient_internet(self.addr_remote[0]):
self.sock.connect(self.addr_remote)
- self.sock.settimeout(_timeout)
-
- _t1 = time.time()
- self.assertRaises(socket.timeout, self.sock.recv, 1024)
- _t2 = time.time()
-
- _delta = abs(_t1 - _t2)
- self.assertTrue(_delta < _timeout + self.fuzz,
- "timeout (%g) is %g seconds more than expected (%g)"
- %(_delta, self.fuzz, _timeout))
+ self._sock_operation(1, 1.5, 'recv', 1024)
def testAcceptTimeout(self):
# Test accept() timeout
- _timeout = 2
- self.sock.settimeout(_timeout)
- # Prevent "Address already in use" socket exceptions
support.bind_port(self.sock, self.localhost)
self.sock.listen(5)
-
- _t1 = time.time()
- self.assertRaises(socket.error, self.sock.accept)
- _t2 = time.time()
-
- _delta = abs(_t1 - _t2)
- self.assertTrue(_delta < _timeout + self.fuzz,
- "timeout (%g) is %g seconds more than expected (%g)"
- %(_delta, self.fuzz, _timeout))
-
- def testRecvfromTimeout(self):
- # Test recvfrom() timeout
- _timeout = 2
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- self.sock.settimeout(_timeout)
- # Prevent "Address already in use" socket exceptions
- support.bind_port(self.sock, self.localhost)
-
- _t1 = time.time()
- self.assertRaises(socket.error, self.sock.recvfrom, 8192)
- _t2 = time.time()
-
- _delta = abs(_t1 - _t2)
- self.assertTrue(_delta < _timeout + self.fuzz,
- "timeout (%g) is %g seconds more than expected (%g)"
- %(_delta, self.fuzz, _timeout))
+ self._sock_operation(1, 1.5, 'accept')
def testSend(self):
# Test send() timeout
- # couldn't figure out how to test it
- pass
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as serv:
+ support.bind_port(serv, self.localhost)
+ serv.listen(5)
+ self.sock.connect(serv.getsockname())
+ # Send a lot of data in order to bypass buffering in the TCP stack.
+ self._sock_operation(100, 1.5, 'send', b"X" * 200000)
def testSendto(self):
# Test sendto() timeout
- # couldn't figure out how to test it
- pass
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as serv:
+ support.bind_port(serv, self.localhost)
+ serv.listen(5)
+ self.sock.connect(serv.getsockname())
+ # The address argument is ignored since we already connected.
+ self._sock_operation(100, 1.5, 'sendto', b"X" * 200000,
+ serv.getsockname())
def testSendall(self):
# Test sendall() timeout
- # couldn't figure out how to test it
- pass
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as serv:
+ support.bind_port(serv, self.localhost)
+ serv.listen(5)
+ self.sock.connect(serv.getsockname())
+ # Send a lot of data in order to bypass buffering in the TCP stack.
+ self._sock_operation(100, 1.5, 'sendall', b"X" * 200000)
+
+
+class UDPTimeoutTestCase(TimeoutTestCase):
+ """UDP test case for socket.socket() timeout functions"""
+
+ def setUp(self):
+ self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+
+ def tearDown(self):
+ self.sock.close()
+
+ def testRecvfromTimeout(self):
+ # Test recvfrom() timeout
+ # Prevent "Address already in use" socket exceptions
+ support.bind_port(self.sock, self.localhost)
+ self._sock_operation(1, 1.5, 'recvfrom', 1024)
def test_main():
support.requires('network')
- support.run_unittest(CreationTestCase, TimeoutTestCase)
+ support.run_unittest(
+ CreationTestCase,
+ TCPTimeoutTestCase,
+ UDPTimeoutTestCase,
+ )
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py
index 510e632565..11e6fb4596 100644
--- a/Lib/test/test_tokenize.py
+++ b/Lib/test/test_tokenize.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
doctests = """
Tests for the tokenize module.
@@ -42,7 +40,7 @@ brevity.
...
IndentationError: unindent does not match any outer indentation level
-There are some standard formattig practises that are easy to get right.
+There are some standard formatting practices that are easy to get right.
>>> roundtrip("if x == 1:\\n"
... " print(x)\\n")
@@ -566,7 +564,8 @@ Non-ascii identifiers
from test import support
from tokenize import (tokenize, _tokenize, untokenize, NUMBER, NAME, OP,
- STRING, ENDMARKER, tok_name, detect_encoding)
+ STRING, ENDMARKER, tok_name, detect_encoding,
+ open as tokenize_open)
from io import BytesIO
from unittest import TestCase
import os, sys, glob
@@ -613,11 +612,11 @@ def decistmt(s):
The format of the exponent is inherited from the platform C library.
Known cases are "e-007" (Windows) and "e-07" (not Windows). Since
- we're only showing 12 digits, and the 13th isn't close to 5, the
+ we're only showing 11 digits, and the 12th isn't close to 5, the
rest of the output should be platform-independent.
>>> exec(s) #doctest: +ELLIPSIS
- -3.21716034272e-0...7
+ -3.2171603427...e-0...7
Output from calculations with Decimal should be identical across all
platforms.
@@ -741,7 +740,7 @@ class TestDetectEncoding(TestCase):
b'do_something(else)\n'
)
encoding, consumed_lines = detect_encoding(self.get_readline(lines))
- self.assertEqual(encoding, 'utf-8')
+ self.assertEqual(encoding, 'utf-8-sig')
self.assertEqual(consumed_lines,
[b'# something\n', b'print(something)\n'])
@@ -762,7 +761,7 @@ class TestDetectEncoding(TestCase):
b'do_something(else)\n'
)
encoding, consumed_lines = detect_encoding(self.get_readline(lines))
- self.assertEqual(encoding, 'utf-8')
+ self.assertEqual(encoding, 'utf-8-sig')
self.assertEqual(consumed_lines, [b'# coding=utf-8\n'])
def test_mismatched_bom_and_cookie_first_line_raises_syntaxerror(self):
@@ -794,7 +793,7 @@ class TestDetectEncoding(TestCase):
b'do_something(else)\n'
)
encoding, consumed_lines = detect_encoding(self.get_readline(lines))
- self.assertEqual(encoding, 'utf-8')
+ self.assertEqual(encoding, 'utf-8-sig')
self.assertEqual(consumed_lines,
[b'#! something\n', b'f# coding=utf-8\n'])
@@ -848,17 +847,37 @@ class TestDetectEncoding(TestCase):
readline = self.get_readline((b'\xef\xbb\xbfprint(something)\n',))
encoding, consumed_lines = detect_encoding(readline)
- self.assertEqual(encoding, 'utf-8')
+ self.assertEqual(encoding, 'utf-8-sig')
self.assertEqual(consumed_lines, [b'print(something)\n'])
readline = self.get_readline((b'\xef\xbb\xbf',))
encoding, consumed_lines = detect_encoding(readline)
- self.assertEqual(encoding, 'utf-8')
+ self.assertEqual(encoding, 'utf-8-sig')
self.assertEqual(consumed_lines, [])
readline = self.get_readline((b'# coding: bad\n',))
self.assertRaises(SyntaxError, detect_encoding, readline)
+ def test_open(self):
+ filename = support.TESTFN + '.py'
+ self.addCleanup(support.unlink, filename)
+
+ # test coding cookie
+ for encoding in ('iso-8859-15', 'utf-8'):
+ with open(filename, 'w', encoding=encoding) as fp:
+ print("# coding: %s" % encoding, file=fp)
+ print("print('euro:\u20ac')", file=fp)
+ with tokenize_open(filename) as fp:
+ self.assertEqual(fp.encoding, encoding)
+ self.assertEqual(fp.mode, 'r')
+
+ # test BOM (no coding cookie)
+ with open(filename, 'w', encoding='utf-8-sig') as fp:
+ print("print('euro:\u20ac')", file=fp)
+ with tokenize_open(filename) as fp:
+ self.assertEqual(fp.encoding, 'utf-8-sig')
+ self.assertEqual(fp.mode, 'r')
+
class TestTokenize(TestCase):
def test_tokenize(self):
diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py
index 3697cbf5bb..461d1d8e6a 100644
--- a/Lib/test/test_trace.py
+++ b/Lib/test/test_trace.py
@@ -70,6 +70,12 @@ def traced_func_calling_generator():
def traced_doubler(num):
return num * 2
+def traced_caller_list_comprehension():
+ k = 10
+ mylist = [traced_doubler(i) for i in range(k)]
+ return mylist
+
+
class TracedClass(object):
def __init__(self, x):
self.a = x
@@ -150,6 +156,22 @@ class TestLineCounts(unittest.TestCase):
}
self.assertEqual(self.tracer.results().counts, expected)
+ def test_trace_list_comprehension(self):
+ self.tracer.runfunc(traced_caller_list_comprehension)
+
+ firstlineno_calling = get_firstlineno(traced_caller_list_comprehension)
+ firstlineno_called = get_firstlineno(traced_doubler)
+ expected = {
+ (self.my_py_filename, firstlineno_calling + 1): 1,
+ # List compehentions work differently in 3.x, so the count
+ # below changed compared to 2.x.
+ (self.my_py_filename, firstlineno_calling + 2): 12,
+ (self.my_py_filename, firstlineno_calling + 3): 1,
+ (self.my_py_filename, firstlineno_called + 1): 10,
+ }
+ self.assertEqual(self.tracer.results().counts, expected)
+
+
def test_linear_methods(self):
# XXX todo: later add 'static_method_linear' and 'class_method_linear'
# here, once issue1764286 is resolved
@@ -274,10 +296,10 @@ class TestCoverage(unittest.TestCase):
self._coverage(tracer)
stdout = stdout.getvalue()
self.assertTrue("pprint.py" in stdout)
- self.assertTrue("unittest.py" in stdout)
+ self.assertTrue("case.py" in stdout) # from unittest
files = os.listdir(TESTFN)
self.assertTrue("pprint.cover" in files)
- self.assertTrue("unittest.cover" in files)
+ self.assertTrue("unittest.case.cover" in files)
def test_coverage_ignore(self):
# Ignore all files, nothing should be traced nor printed
@@ -308,10 +330,25 @@ class TestCoverage(unittest.TestCase):
lines, cov, module = line.split()[:3]
coverage[module] = (int(lines), int(cov[:-1]))
# XXX This is needed to run regrtest.py as a script
- modname = trace.fullmodname(sys.modules[modname].__file__)
+ modname = trace._fullmodname(sys.modules[modname].__file__)
self.assertIn(modname, coverage)
self.assertEqual(coverage[modname], (5, 100))
+### Tests that don't mess with sys.settrace and can be traced
+### themselves TODO: Skip tests that do mess with sys.settrace when
+### regrtest is invoked with -T option.
+class Test_Ignore(unittest.TestCase):
+ def test_ignored(self):
+ jn = os.path.join
+ ignore = trace._Ignore(['x', 'y.z'], [jn('foo', 'bar')])
+ self.assertTrue(ignore.names('x.py', 'x'))
+ self.assertFalse(ignore.names('xy.py', 'xy'))
+ self.assertFalse(ignore.names('y.py', 'y'))
+ self.assertTrue(ignore.names(jn('foo', 'bar', 'baz.py'), 'baz'))
+ self.assertFalse(ignore.names(jn('bar', 'z.py'), 'z'))
+ # Matched before.
+ self.assertTrue(ignore.names(jn('bar', 'baz.py'), 'baz'))
+
def test_main():
run_unittest(__name__)
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index f9e4458220..4752d37e5b 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -5,7 +5,7 @@ from io import StringIO
import sys
import unittest
import re
-from test.support import run_unittest, is_jython, Error, captured_output
+from test.support import run_unittest, Error, captured_output
from test.support import TESTFN, unlink
import traceback
@@ -29,10 +29,6 @@ class SyntaxTracebackCases(unittest.TestCase):
def syntax_error_with_caret_2(self):
compile("1 +\n", "?", "exec")
- def syntax_error_without_caret(self):
- # XXX why doesn't compile raise the same traceback?
- import test.badsyntax_nocaret
-
def syntax_error_bad_indentation(self):
compile("def spam():\n print(1)\n print(2)", "?", "exec")
@@ -41,30 +37,27 @@ class SyntaxTracebackCases(unittest.TestCase):
SyntaxError)
self.assertEqual(len(err), 4)
self.assertTrue(err[1].strip() == "return x!")
- self.assertTrue("^" in err[2]) # third line has caret
+ self.assertIn("^", err[2]) # third line has caret
self.assertEqual(err[1].find("!"), err[2].find("^")) # in the right place
err = self.get_exception_format(self.syntax_error_with_caret_2,
SyntaxError)
- self.assertTrue("^" in err[2]) # third line has caret
+ self.assertIn("^", err[2]) # third line has caret
self.assertTrue(err[2].count('\n') == 1) # and no additional newline
self.assertTrue(err[1].find("+") == err[2].find("^")) # in the right place
def test_nocaret(self):
- if is_jython:
- # jython adds a caret in this case (why shouldn't it?)
- return
- err = self.get_exception_format(self.syntax_error_without_caret,
- SyntaxError)
+ exc = SyntaxError("error", ("x.py", 23, None, "bad syntax"))
+ err = traceback.format_exception_only(SyntaxError, exc)
self.assertEqual(len(err), 3)
- self.assertTrue(err[1].strip() == "[x for x in x] = x")
+ self.assertEqual(err[1].strip(), "bad syntax")
def test_bad_indentation(self):
err = self.get_exception_format(self.syntax_error_bad_indentation,
IndentationError)
self.assertEqual(len(err), 4)
self.assertEqual(err[1].strip(), "print(2)")
- self.assertTrue("^" in err[2])
+ self.assertIn("^", err[2])
self.assertEqual(err[1].find(")"), err[2].find("^"))
def test_base_exception(self):
@@ -131,7 +124,7 @@ class SyntaxTracebackCases(unittest.TestCase):
err_line = "raise RuntimeError('{0}')".format(message_ascii)
err_msg = "RuntimeError: {0}".format(message_ascii)
- self.assertTrue(("line %s" % lineno) in stdout[1],
+ self.assertIn(("line %s" % lineno), stdout[1],
"Invalid line number: {0!r} instead of {1}".format(
stdout[1], lineno))
self.assertTrue(stdout[2].endswith(err_line),
@@ -210,7 +203,7 @@ class BaseExceptionReportingTests:
def check_zero_div(self, msg):
lines = msg.splitlines()
self.assertTrue(lines[-3].startswith(' File'))
- self.assertTrue('1/0 # In zero_div' in lines[-2], lines[-2])
+ self.assertIn('1/0 # In zero_div', lines[-2])
self.assertTrue(lines[-1].startswith('ZeroDivisionError'), lines[-1])
def test_simple(self):
@@ -222,7 +215,7 @@ class BaseExceptionReportingTests:
self.assertEqual(len(lines), 4)
self.assertTrue(lines[0].startswith('Traceback'))
self.assertTrue(lines[1].startswith(' File'))
- self.assertTrue('1/0 # Marker' in lines[2])
+ self.assertIn('1/0 # Marker', lines[2])
self.assertTrue(lines[3].startswith('ZeroDivisionError'))
def test_cause(self):
@@ -237,7 +230,7 @@ class BaseExceptionReportingTests:
self.assertEqual(len(blocks), 3)
self.assertEqual(blocks[1], cause_message)
self.check_zero_div(blocks[0])
- self.assertTrue('inner_raise() # Marker' in blocks[2])
+ self.assertIn('inner_raise() # Marker', blocks[2])
def test_context(self):
def inner_raise():
@@ -251,7 +244,7 @@ class BaseExceptionReportingTests:
self.assertEqual(len(blocks), 3)
self.assertEqual(blocks[1], context_message)
self.check_zero_div(blocks[0])
- self.assertTrue('inner_raise() # Marker' in blocks[2])
+ self.assertIn('inner_raise() # Marker', blocks[2])
def test_cause_and_context(self):
# When both a cause and a context are set, only the cause should be
@@ -289,11 +282,11 @@ class BaseExceptionReportingTests:
self.assertEqual(len(blocks), 3)
self.assertEqual(blocks[1], cause_message)
# The first block is the KeyError raised from the ZeroDivisionError
- self.assertTrue('raise KeyError from e' in blocks[0])
- self.assertTrue('1/0' not in blocks[0])
+ self.assertIn('raise KeyError from e', blocks[0])
+ self.assertNotIn('1/0', blocks[0])
# The second block (apart from the boundary) is the ZeroDivisionError
# re-raised from the KeyError
- self.assertTrue('inner_raise() # Marker' in blocks[2])
+ self.assertIn('inner_raise() # Marker', blocks[2])
self.check_zero_div(blocks[2])
def test_syntax_error_offset_at_eol(self):
diff --git a/Lib/test/test_ttk_guionly.py b/Lib/test/test_ttk_guionly.py
index d70863a287..bff4fc168b 100644
--- a/Lib/test/test_ttk_guionly.py
+++ b/Lib/test/test_ttk_guionly.py
@@ -1,5 +1,4 @@
import os
-import sys
import unittest
from test import support
diff --git a/Lib/test/test_ttk_textonly.py b/Lib/test/test_ttk_textonly.py
index b99625a189..566fc9d09a 100644
--- a/Lib/test/test_ttk_textonly.py
+++ b/Lib/test/test_ttk_textonly.py
@@ -1,5 +1,4 @@
import os
-import sys
from test import support
# Skip this test if _tkinter does not exist.
diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py
index f5837479ea..75fbe45ec4 100644
--- a/Lib/test/test_tuple.py
+++ b/Lib/test/test_tuple.py
@@ -96,6 +96,7 @@ class TupleTest(seq_tests.CommonTest):
gc.collect()
self.assertTrue(gc.is_tracked(t), t)
+ @support.cpython_only
def test_track_literals(self):
# Test GC-optimization of tuple literals
x, y, z = 1.5, "a", []
@@ -136,16 +137,19 @@ class TupleTest(seq_tests.CommonTest):
self._tracked(tp(tuple([obj]) for obj in [x, y, z]))
self._tracked(tuple(tp([obj]) for obj in [x, y, z]))
+ @support.cpython_only
def test_track_dynamic(self):
# Test GC-optimization of dynamically constructed tuples.
self.check_track_dynamic(tuple, False)
+ @support.cpython_only
def test_track_subtypes(self):
# Tuple subtypes must always be tracked
class MyTuple(tuple):
pass
self.check_track_dynamic(MyTuple, True)
+ @support.cpython_only
def test_bug7466(self):
# Trying to untrack an unfinished tuple could crash Python
self._not_tracked(tuple(gc.collect() for i in range(101)))
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index d227ab1e2b..8a98a03567 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -10,17 +10,14 @@ class TypesTests(unittest.TestCase):
def test_truth_values(self):
if None: self.fail('None is true instead of false')
if 0: self.fail('0 is true instead of false')
- if 0: self.fail('0L is true instead of false')
if 0.0: self.fail('0.0 is true instead of false')
if '': self.fail('\'\' is true instead of false')
if not 1: self.fail('1 is false instead of true')
- if not 1: self.fail('1L is false instead of true')
if not 1.0: self.fail('1.0 is false instead of true')
if not 'x': self.fail('\'x\' is false instead of true')
if not {'x': 1}: self.fail('{\'x\': 1} is false instead of true')
def f(): pass
class C: pass
- import sys
x = C()
if not f: self.fail('f is false instead of true')
if not C: self.fail('C is false instead of true')
@@ -36,8 +33,6 @@ class TypesTests(unittest.TestCase):
def test_comparisons(self):
if 0 < 1 <= 1 == 1 >= 1 > 0 != 1: pass
else: self.fail('int comparisons failed')
- if 0 < 1 <= 1 == 1 >= 1 > 0 != 1: pass
- else: self.fail('long int comparisons failed')
if 0.0 < 1.0 <= 1.0 == 1.0 >= 1.0 > 0.0 != 1.0: pass
else: self.fail('float comparisons failed')
if '' < 'a' <= 'a' == 'a' < 'abc' < 'abd' < 'b': pass
@@ -75,18 +70,13 @@ class TypesTests(unittest.TestCase):
else: self.fail("5 % 0 didn't raise ZeroDivisionError")
def test_numeric_types(self):
- if 0 != 0 or 0 != 0.0 or 0 != 0.0: self.fail('mixed comparisons')
- if 1 != 1 or 1 != 1.0 or 1 != 1.0: self.fail('mixed comparisons')
- if -1 != -1 or -1 != -1.0 or -1 != -1.0:
- self.fail('int/long/float value not equal')
+ if 0 != 0.0 or 1 != 1.0 or -1 != -1.0:
+ self.fail('int/float value not equal')
# calling built-in types without argument must return 0
if int() != 0: self.fail('int() does not return 0')
- if int() != 0: self.fail('long() does not return 0')
if float() != 0.0: self.fail('float() does not return 0.0')
if int(1.9) == 1 == int(1.1) and int(-1.1) == -1 == int(-1.9): pass
else: self.fail('int() does not round properly')
- if int(1.9) == 1 == int(1.1) and int(-1.1) == -1 == int(-1.9): pass
- else: self.fail('long() does not round properly')
if float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass
else: self.fail('float() does not work properly')
@@ -141,58 +131,38 @@ class TypesTests(unittest.TestCase):
if type(prod) is not int:
self.fail("expected type(prod) to be int, not %r" %
type(prod))
- # Check for expected * overflow to long.
+ # Check for unified integral type
for divisor in 1, 2, 4, 8, 16, 32:
j = m // divisor - 1
prod = divisor * j
if type(prod) is not int:
- self.fail("expected type(%r) to be long, not %r" %
+ self.fail("expected type(%r) to be int, not %r" %
(prod, type(prod)))
- # Check for expected * overflow to long.
+ # Check for unified integral type
m = sys.maxsize
for divisor in 1, 2, 4, 8, 16, 32:
j = m // divisor + 1
prod = divisor * j
if type(prod) is not int:
- self.fail("expected type(%r) to be long, not %r" %
+ self.fail("expected type(%r) to be int, not %r" %
(prod, type(prod)))
- def test_long_integers(self):
- if 12 + 24 != 36: self.fail('long op')
- if 12 + (-24) != -12: self.fail('long op')
- if (-12) + 24 != 12: self.fail('long op')
- if (-12) + (-24) != -36: self.fail('long op')
- if not 12 < 24: self.fail('long op')
- if not -24 < -12: self.fail('long op')
x = sys.maxsize
- if int(int(x)) != x: self.fail('long op')
- try: y = int(int(x)+1)
- except OverflowError: self.fail('long op')
- if not isinstance(y, int): self.fail('long op')
- x = -x
- if int(int(x)) != x: self.fail('long op')
- x = x-1
- if int(int(x)) != x: self.fail('long op')
- try: y = int(int(x)-1)
- except OverflowError: self.fail('long op')
- if not isinstance(y, int): self.fail('long op')
+ self.assertIsInstance(x + 1, int,
+ "(sys.maxsize + 1) should have returned int")
+ self.assertIsInstance(-x - 1, int,
+ "(-sys.maxsize - 1) should have returned int")
+ self.assertIsInstance(-x - 2, int,
+ "(-sys.maxsize - 2) should have returned int")
try: 5 << -5
except ValueError: pass
else: self.fail('int negative shift <<')
- try: 5 << -5
- except ValueError: pass
- else: self.fail('long negative shift <<')
-
try: 5 >> -5
except ValueError: pass
else: self.fail('int negative shift >>')
- try: 5 >> -5
- except ValueError: pass
- else: self.fail('long negative shift >>')
-
def test_floats(self):
if 12.0 + 24.0 != 36.0: self.fail('float op')
if 12.0 + (-24.0) != -12.0: self.fail('float op')
@@ -232,7 +202,7 @@ class TypesTests(unittest.TestCase):
def test_int__format__(self):
def test(i, format_spec, result):
- # just make sure I'm not accidentally checking longs
+ # just make sure we have the unified type for integers
assert type(i) == int
assert type(format_spec) == str
self.assertEqual(i.__format__(format_spec), result)
@@ -353,6 +323,10 @@ class TypesTests(unittest.TestCase):
# issue 5782, commas with no specifier type
test(1234, '010,', '00,001,234')
+ # Unified type for integers
+ test(10**100, 'd', '1' + '0' * 100)
+ test(10**100+100, 'd', '1' + '0' * 97 + '100')
+
# make sure these are errors
# precision disallowed
@@ -393,96 +367,6 @@ class TypesTests(unittest.TestCase):
test(123456, "1=20", '11111111111111123456')
test(123456, "*=20", '**************123456')
- def test_long__format__(self):
- def test(i, format_spec, result):
- # make sure we're not accidentally checking ints
- assert type(i) == int
- assert type(format_spec) == str
- self.assertEqual(i.__format__(format_spec), result)
-
- test(10**100, 'd', '1' + '0' * 100)
- test(10**100+100, 'd', '1' + '0' * 97 + '100')
-
- test(123456789, 'd', '123456789')
- test(123456789, 'd', '123456789')
-
- # sign and aligning are interdependent
- test(1, "-", '1')
- test(-1, "-", '-1')
- test(1, "-3", ' 1')
- test(-1, "-3", ' -1')
- test(1, "+3", ' +1')
- test(-1, "+3", ' -1')
- test(1, " 3", ' 1')
- test(-1, " 3", ' -1')
- test(1, " ", ' 1')
- test(-1, " ", '-1')
-
- test(1, 'c', '\01')
-
- # hex
- test(3, "x", "3")
- test(3, "X", "3")
- test(1234, "x", "4d2")
- test(-1234, "x", "-4d2")
- test(1234, "8x", " 4d2")
- test(-1234, "8x", " -4d2")
- test(1234, "x", "4d2")
- test(-1234, "x", "-4d2")
- test(-3, "x", "-3")
- test(-3, "X", "-3")
-
- # octal
- test(3, "o", "3")
- test(-3, "o", "-3")
- test(65, "o", "101")
- test(-65, "o", "-101")
- test(1234, "o", "2322")
- test(-1234, "o", "-2322")
- test(1234, "-o", "2322")
- test(-1234, "-o", "-2322")
- test(1234, " o", " 2322")
- test(-1234, " o", "-2322")
- test(1234, "+o", "+2322")
- test(-1234, "+o", "-2322")
-
- # binary
- test(3, "b", "11")
- test(-3, "b", "-11")
- test(1234, "b", "10011010010")
- test(-1234, "b", "-10011010010")
- test(1234, "-b", "10011010010")
- test(-1234, "-b", "-10011010010")
- test(1234, " b", " 10011010010")
- test(-1234, " b", "-10011010010")
- test(1234, "+b", "+10011010010")
- test(-1234, "+b", "-10011010010")
-
- # make sure these are errors
-
- # precision disallowed
- self.assertRaises(ValueError, 3 .__format__, "1.3")
- # sign not allowed with 'c'
- self.assertRaises(ValueError, 3 .__format__, "+c")
- # format spec must be string
- self.assertRaises(TypeError, 3 .__format__, None)
- self.assertRaises(TypeError, 3 .__format__, 0)
-
- # ensure that only int and float type specifiers work
- for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] +
- [chr(x) for x in range(ord('A'), ord('Z')+1)]):
- if not format_spec in 'bcdoxXeEfFgGn%':
- self.assertRaises(ValueError, 0 .__format__, format_spec)
- self.assertRaises(ValueError, 1 .__format__, format_spec)
- self.assertRaises(ValueError, (-1) .__format__, format_spec)
-
- # ensure that float type specifiers work; format converts
- # the long to a float
- for format_spec in 'eEfFgG%':
- for value in [0, 1, -1, 100, -100, 1234567890, -1234567890]:
- self.assertEqual(value.__format__(format_spec),
- float(value).__format__(format_spec))
-
@run_with_locale('LC_NUMERIC', 'en_US.UTF8')
def test_float__format__locale(self):
# test locale support for __format__ code 'n'
@@ -512,13 +396,9 @@ class TypesTests(unittest.TestCase):
self.assertEqual(len(format(0, cfmt)), len(format(x, cfmt)))
def test_float__format__(self):
- # these should be rewritten to use both format(x, spec) and
- # x.__format__(spec)
-
def test(f, format_spec, result):
- assert type(f) == float
- assert type(format_spec) == str
self.assertEqual(f.__format__(format_spec), result)
+ self.assertEqual(format(f, format_spec), result)
test(0.0, 'f', '0.000000')
@@ -560,13 +440,13 @@ class TypesTests(unittest.TestCase):
result = f.__format__(fmt)
self.assertEqual(len(result), 98)
self.assertEqual(result[-7], '.')
- self.assertTrue(result[:12] in ('112340000000', '112339999999'))
+ self.assertIn(result[:12], ('112340000000', '112339999999'))
f = 1.1234e200
for fmt in 'f', 'F':
result = f.__format__(fmt)
self.assertEqual(len(result), 208)
self.assertEqual(result[-7], '.')
- self.assertTrue(result[:12] in ('112340000000', '112339999999'))
+ self.assertIn(result[:12], ('112340000000', '112339999999'))
test( 1.0, 'e', '1.000000e+00')
@@ -632,9 +512,27 @@ class TypesTests(unittest.TestCase):
self.assertRaises(ValueError, format, 1e-100, format_spec)
self.assertRaises(ValueError, format, -1e-100, format_spec)
- # Alternate formatting is not supported
- self.assertRaises(ValueError, format, 0.0, '#')
- self.assertRaises(ValueError, format, 0.0, '#20f')
+ # Alternate float formatting
+ test(1.0, '.0e', '1e+00')
+ test(1.0, '#.0e', '1.e+00')
+ test(1.0, '.0f', '1')
+ test(1.0, '#.0f', '1.')
+ test(1.1, 'g', '1.1')
+ test(1.1, '#g', '1.10000')
+ test(1.0, '.0%', '100%')
+ test(1.0, '#.0%', '100.%')
+
+ # Issue 7094: Alternate formatting (specified by #)
+ test(1.0, '0e', '1.000000e+00')
+ test(1.0, '#0e', '1.000000e+00')
+ test(1.0, '0f', '1.000000' )
+ test(1.0, '#0f', '1.000000')
+ test(1.0, '.1e', '1.0e+00')
+ test(1.0, '#.1e', '1.0e+00')
+ test(1.0, '.1f', '1.0')
+ test(1.0, '#.1f', '1.0')
+ test(1.0, '.1%', '100.0%')
+ test(1.0, '#.1%', '100.0%')
# Issue 6902
test(12345.6, "0<20", '12345.60000000000000')
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py
index 2d48179c59..fd620f01e4 100644
--- a/Lib/test/test_ucn.py
+++ b/Lib/test/test_ucn.py
@@ -88,9 +88,13 @@ class UnicodeNamesTest(unittest.TestCase):
self.checkletter("CJK UNIFIED IDEOGRAPH-3400", "\u3400")
self.checkletter("CJK UNIFIED IDEOGRAPH-4DB5", "\u4db5")
self.checkletter("CJK UNIFIED IDEOGRAPH-4E00", "\u4e00")
- self.checkletter("CJK UNIFIED IDEOGRAPH-9FA5", "\u9fa5")
+ self.checkletter("CJK UNIFIED IDEOGRAPH-9FCB", "\u9fCB")
self.checkletter("CJK UNIFIED IDEOGRAPH-20000", "\U00020000")
self.checkletter("CJK UNIFIED IDEOGRAPH-2A6D6", "\U0002a6d6")
+ self.checkletter("CJK UNIFIED IDEOGRAPH-2A700", "\U0002A700")
+ self.checkletter("CJK UNIFIED IDEOGRAPH-2B734", "\U0002B734")
+ self.checkletter("CJK UNIFIED IDEOGRAPH-2B740", "\U0002B740")
+ self.checkletter("CJK UNIFIED IDEOGRAPH-2B81D", "\U0002B81D")
def test_bmp_characters(self):
import unicodedata
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 772ea35d3f..97be58793f 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -11,6 +11,7 @@ import sys
import unittest
import warnings
from test import support, string_tests
+import _string
# Error handling (bad decoder return)
def search_function(encoding):
@@ -30,18 +31,11 @@ def search_function(encoding):
return None
codecs.register(search_function)
-class UnicodeTest(
- string_tests.CommonTest,
- string_tests.MixinStrUnicodeUserStringTest,
- string_tests.MixinStrUnicodeTest,
- ):
- type2test = str
-
- def setUp(self):
- self.warning_filters = warnings.filters[:]
+class UnicodeTest(string_tests.CommonTest,
+ string_tests.MixinStrUnicodeUserStringTest,
+ string_tests.MixinStrUnicodeTest):
- def tearDown(self):
- warnings.filters = self.warning_filters
+ type2test = str
def checkequalnofix(self, result, object, methodname, *args):
method = getattr(object, methodname)
@@ -282,23 +276,18 @@ class UnicodeTest(
self.assertRaises(TypeError, 'replace'.replace, "r", 42)
def test_bytes_comparison(self):
- warnings.simplefilter('ignore', BytesWarning)
- self.assertEqual('abc' == b'abc', False)
- self.assertEqual('abc' != b'abc', True)
- self.assertEqual('abc' == bytearray(b'abc'), False)
- self.assertEqual('abc' != bytearray(b'abc'), True)
+ with support.check_warnings():
+ warnings.simplefilter('ignore', BytesWarning)
+ self.assertEqual('abc' == b'abc', False)
+ self.assertEqual('abc' != b'abc', True)
+ self.assertEqual('abc' == bytearray(b'abc'), False)
+ self.assertEqual('abc' != bytearray(b'abc'), True)
def test_comparison(self):
# Comparisons:
self.assertEqual('abc', 'abc')
- self.assertEqual('abc', 'abc')
- self.assertEqual('abc', 'abc')
- self.assertTrue('abcd' > 'abc')
- self.assertTrue('abcd' > 'abc')
self.assertTrue('abcd' > 'abc')
self.assertTrue('abc' < 'abcd')
- self.assertTrue('abc' < 'abcd')
- self.assertTrue('abc' < 'abcd')
if 0:
# Move these tests to a Unicode collation module test...
@@ -435,32 +424,32 @@ class UnicodeTest(
def test_contains(self):
# Testing Unicode contains method
- self.assertTrue('a' in 'abdb')
- self.assertTrue('a' in 'bdab')
- self.assertTrue('a' in 'bdaba')
- self.assertTrue('a' in 'bdba')
- self.assertTrue('a' not in 'bdb')
- self.assertTrue('a' in 'bdba')
- self.assertTrue('a' in ('a',1,None))
- self.assertTrue('a' in (1,None,'a'))
- self.assertTrue('a' in ('a',1,None))
- self.assertTrue('a' in (1,None,'a'))
- self.assertTrue('a' not in ('x',1,'y'))
- self.assertTrue('a' not in ('x',1,None))
- self.assertTrue('abcd' not in 'abcxxxx')
- self.assertTrue('ab' in 'abcd')
- self.assertTrue('ab' in 'abc')
- self.assertTrue('ab' in (1,None,'ab'))
- self.assertTrue('' in 'abc')
- self.assertTrue('' in '')
- self.assertTrue('' in 'abc')
- self.assertTrue('\0' not in 'abc')
- self.assertTrue('\0' in '\0abc')
- self.assertTrue('\0' in 'abc\0')
- self.assertTrue('a' in '\0abc')
- self.assertTrue('asdf' in 'asdf')
- self.assertTrue('asdf' not in 'asd')
- self.assertTrue('asdf' not in '')
+ self.assertIn('a', 'abdb')
+ self.assertIn('a', 'bdab')
+ self.assertIn('a', 'bdaba')
+ self.assertIn('a', 'bdba')
+ self.assertNotIn('a', 'bdb')
+ self.assertIn('a', 'bdba')
+ self.assertIn('a', ('a',1,None))
+ self.assertIn('a', (1,None,'a'))
+ self.assertIn('a', ('a',1,None))
+ self.assertIn('a', (1,None,'a'))
+ self.assertNotIn('a', ('x',1,'y'))
+ self.assertNotIn('a', ('x',1,None))
+ self.assertNotIn('abcd', 'abcxxxx')
+ self.assertIn('ab', 'abcd')
+ self.assertIn('ab', 'abc')
+ self.assertIn('ab', (1,None,'ab'))
+ self.assertIn('', 'abc')
+ self.assertIn('', '')
+ self.assertIn('', 'abc')
+ self.assertNotIn('\0', 'abc')
+ self.assertIn('\0', '\0abc')
+ self.assertIn('\0', 'abc\0')
+ self.assertIn('a', '\0abc')
+ self.assertIn('asdf', 'asdf')
+ self.assertNotIn('asdf', 'asd')
+ self.assertNotIn('asdf', '')
self.assertRaises(TypeError, "abc".__contains__)
@@ -620,13 +609,16 @@ class UnicodeTest(
self.assertEqual('{0}'.format({}), '{}')
self.assertEqual('{0}'.format([]), '[]')
self.assertEqual('{0}'.format([1]), '[1]')
- self.assertEqual('{0}'.format(E('data')), 'E(data)')
- self.assertEqual('{0:^10}'.format(E('data')), ' E(data) ')
- self.assertEqual('{0:^10s}'.format(E('data')), ' E(data) ')
+
self.assertEqual('{0:d}'.format(G('data')), 'G(data)')
- self.assertEqual('{0:>15s}'.format(G('data')), ' string is data')
self.assertEqual('{0!s}'.format(G('data')), 'string is data')
+ msg = 'object.__format__ with a non-empty format string is deprecated'
+ with support.check_warnings((msg, PendingDeprecationWarning)):
+ self.assertEqual('{0:^10}'.format(E('data')), ' E(data) ')
+ self.assertEqual('{0:^10s}'.format(E('data')), ' E(data) ')
+ self.assertEqual('{0:>15s}'.format(G('data')), ' string is data')
+
self.assertEqual("{0:date: %Y-%m-%d}".format(I(year=2007,
month=8,
day=27)),
@@ -657,8 +649,6 @@ class UnicodeTest(
self.assertRaises(IndexError, '{1}'.format, 'abc')
self.assertRaises(KeyError, '{x}'.format)
self.assertRaises(ValueError, "}{".format)
- self.assertRaises(ValueError, "{".format)
- self.assertRaises(ValueError, "}".format)
self.assertRaises(ValueError, "abc{0:{}".format)
self.assertRaises(ValueError, "{0".format)
self.assertRaises(IndexError, "{0.}".format)
@@ -706,6 +696,46 @@ class UnicodeTest(
self.assertRaises(ValueError, format, '', '#')
self.assertRaises(ValueError, format, '', '#20')
+ def test_format_map(self):
+ self.assertEqual(''.format_map({}), '')
+ self.assertEqual('a'.format_map({}), 'a')
+ self.assertEqual('ab'.format_map({}), 'ab')
+ self.assertEqual('a{{'.format_map({}), 'a{')
+ self.assertEqual('a}}'.format_map({}), 'a}')
+ self.assertEqual('{{b'.format_map({}), '{b')
+ self.assertEqual('}}b'.format_map({}), '}b')
+ self.assertEqual('a{{b'.format_map({}), 'a{b')
+
+ # using mappings
+ class Mapping(dict):
+ def __missing__(self, key):
+ return key
+ self.assertEqual('{hello}'.format_map(Mapping()), 'hello')
+ self.assertEqual('{a} {world}'.format_map(Mapping(a='hello')), 'hello world')
+
+ class InternalMapping:
+ def __init__(self):
+ self.mapping = {'a': 'hello'}
+ def __getitem__(self, key):
+ return self.mapping[key]
+ self.assertEqual('{a}'.format_map(InternalMapping()), 'hello')
+
+
+ class C:
+ def __init__(self, x=100):
+ self._x = x
+ def __format__(self, spec):
+ return spec
+ self.assertEqual('{foo._x}'.format_map({'foo': C(20)}), '20')
+
+ # test various errors
+ self.assertRaises(TypeError, '{'.format_map)
+ self.assertRaises(TypeError, '}'.format_map)
+ self.assertRaises(TypeError, 'a{'.format_map)
+ self.assertRaises(TypeError, 'a}'.format_map)
+ self.assertRaises(TypeError, '{a'.format_map)
+ self.assertRaises(TypeError, '}a'.format_map)
+
def test_format_auto_numbering(self):
class C:
def __init__(self, x=100):
@@ -791,12 +821,9 @@ class UnicodeTest(
def test_startswith_endswith_errors(self):
for meth in ('foo'.startswith, 'foo'.endswith):
- try:
+ with self.assertRaises(TypeError) as cm:
meth(['f'])
- except TypeError as err:
- exc = str(err)
- else:
- self.fail('starts/endswith unexpectedly succeeded')
+ exc = str(cm.exception)
self.assertIn('str', exc)
self.assertIn('tuple', exc)
@@ -1117,6 +1144,10 @@ class UnicodeTest(
self.assertRaises(UnicodeError, 'Andr\202 x'.encode, 'ascii','strict')
self.assertEqual('Andr\202 x'.encode('ascii','ignore'), b"Andr x")
self.assertEqual('Andr\202 x'.encode('ascii','replace'), b"Andr? x")
+ self.assertEqual('Andr\202 x'.encode('ascii', 'replace'),
+ 'Andr\202 x'.encode('ascii', errors='replace'))
+ self.assertEqual('Andr\202 x'.encode('ascii', 'ignore'),
+ 'Andr\202 x'.encode(encoding='ascii', errors='ignore'))
# Error handling (decoding)
self.assertRaises(UnicodeError, str, b'Andr\202 x', 'ascii')
@@ -1146,8 +1177,13 @@ class UnicodeTest(
# Error handling (wrong arguments)
self.assertRaises(TypeError, "hello".encode, 42, 42, 42)
- # Error handling (PyUnicode_EncodeDecimal())
- self.assertRaises(UnicodeError, int, "\u0200")
+ # Error handling (lone surrogate in PyUnicode_TransformDecimalToASCII())
+ self.assertRaises(UnicodeError, int, "\ud800")
+ self.assertRaises(UnicodeError, int, "\udf00")
+ self.assertRaises(UnicodeError, float, "\ud800")
+ self.assertRaises(UnicodeError, float, "\udf00")
+ self.assertRaises(UnicodeError, complex, "\ud800")
+ self.assertRaises(UnicodeError, complex, "\udf00")
def test_codecs(self):
# Encoding
@@ -1200,8 +1236,8 @@ class UnicodeTest(
s = bytes(range(128))
for encoding in (
'cp037', 'cp1026',
- 'cp437', 'cp500', 'cp737', 'cp775', 'cp850',
- 'cp852', 'cp855', 'cp860', 'cp861', 'cp862',
+ 'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850',
+ 'cp852', 'cp855', 'cp858', 'cp860', 'cp861', 'cp862',
'cp863', 'cp865', 'cp866',
'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6',
@@ -1228,8 +1264,8 @@ class UnicodeTest(
s = bytes(range(128, 256))
for encoding in (
'cp037', 'cp1026',
- 'cp437', 'cp500', 'cp737', 'cp775', 'cp850',
- 'cp852', 'cp855', 'cp860', 'cp861', 'cp862',
+ 'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850',
+ 'cp852', 'cp855', 'cp858', 'cp860', 'cp861', 'cp862',
'cp863', 'cp865', 'cp866',
'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
'iso8859_2', 'iso8859_4', 'iso8859_5',
@@ -1277,21 +1313,20 @@ class UnicodeTest(
y = x.encode("raw-unicode-escape").decode("raw-unicode-escape")
self.assertEqual(x, y)
- # FIXME
- #y = r'\U00100000'
- #x = y.encode("raw-unicode-escape").decode("raw-unicode-escape")
- #self.assertEqual(x, y)
- #y = r'\U00010000'
- #x = y.encode("raw-unicode-escape").decode("raw-unicode-escape")
- #self.assertEqual(x, y)
-
- #try:
- # '\U11111111'.decode("raw-unicode-escape")
- #except UnicodeDecodeError as e:
- # self.assertEqual(e.start, 0)
- # self.assertEqual(e.end, 10)
- #else:
- # self.fail("Should have raised UnicodeDecodeError")
+ y = br'\U00100000'
+ x = y.decode("raw-unicode-escape").encode("raw-unicode-escape")
+ self.assertEqual(x, y)
+ y = br'\U00010000'
+ x = y.decode("raw-unicode-escape").encode("raw-unicode-escape")
+ self.assertEqual(x, y)
+
+ try:
+ br'\U11111111'.decode("raw-unicode-escape")
+ except UnicodeDecodeError as e:
+ self.assertEqual(e.start, 0)
+ self.assertEqual(e.end, 10)
+ else:
+ self.fail("Should have raised UnicodeDecodeError")
def test_conversion(self):
# Make sure __unicode__() works properly
@@ -1365,6 +1400,10 @@ class UnicodeTest(
self.assertEqual(repr(s1()), '\\n')
self.assertEqual(repr(s2()), '\\n')
+ def test_printable_repr(self):
+ self.assertEqual(repr('\U00010000'), "'%c'" % (0x10000,)) # printable
+ self.assertEqual(repr('\U00014000'), "'\\U00014000'") # nonprintable
+
def test_expandtabs_overflows_gracefully(self):
# This test only affects 32-bit platforms because expandtabs can only take
# an int as the max value, not a 64-bit C long. If expandtabs is changed
@@ -1393,6 +1432,165 @@ class UnicodeTest(
self.assertEqual("%s" % s, '__str__ overridden')
self.assertEqual("{}".format(s), '__str__ overridden')
+ # Test PyUnicode_FromFormat()
+ def test_from_format(self):
+ support.import_module('ctypes')
+ from ctypes import pythonapi, py_object, c_int
+ if sys.maxunicode == 65535:
+ name = "PyUnicodeUCS2_FromFormat"
+ else:
+ name = "PyUnicodeUCS4_FromFormat"
+ _PyUnicode_FromFormat = getattr(pythonapi, name)
+ _PyUnicode_FromFormat.restype = py_object
+
+ def PyUnicode_FromFormat(format, *args):
+ cargs = tuple(
+ py_object(arg) if isinstance(arg, str) else arg
+ for arg in args)
+ return _PyUnicode_FromFormat(format, *cargs)
+
+ # ascii format, non-ascii argument
+ text = PyUnicode_FromFormat(b'ascii\x7f=%U', 'unicode\xe9')
+ self.assertEqual(text, 'ascii\x7f=unicode\xe9')
+
+ # non-ascii format, ascii argument: ensure that PyUnicode_FromFormatV()
+ # raises an error
+ self.assertRaisesRegex(ValueError,
+ '^PyUnicode_FromFormatV\(\) expects an ASCII-encoded format '
+ 'string, got a non-ASCII byte: 0xe9$',
+ PyUnicode_FromFormat, b'unicode\xe9=%s', 'ascii')
+
+ self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0xabcd)), '\uabcd')
+ self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0x10ffff)), '\U0010ffff')
+
+ # other tests
+ text = PyUnicode_FromFormat(b'%%A:%A', 'abc\xe9\uabcd\U0010ffff')
+ self.assertEqual(text, r"%A:'abc\xe9\uabcd\U0010ffff'")
+
+ text = PyUnicode_FromFormat(b'repr=%V', 'abc', b'xyz')
+ self.assertEqual(text, 'repr=abc')
+
+ # Test string decode from parameter of %s using utf-8.
+ # b'\xe4\xba\xba\xe6\xb0\x91' is utf-8 encoded byte sequence of
+ # '\u4eba\u6c11'
+ text = PyUnicode_FromFormat(b'repr=%V', None, b'\xe4\xba\xba\xe6\xb0\x91')
+ self.assertEqual(text, 'repr=\u4eba\u6c11')
+
+ #Test replace error handler.
+ text = PyUnicode_FromFormat(b'repr=%V', None, b'abc\xff')
+ self.assertEqual(text, 'repr=abc\ufffd')
+
+ # Test PyUnicode_AsWideChar()
+ def test_aswidechar(self):
+ from _testcapi import unicode_aswidechar
+ support.import_module('ctypes')
+ from ctypes import c_wchar, sizeof
+
+ wchar, size = unicode_aswidechar('abcdef', 2)
+ self.assertEqual(size, 2)
+ self.assertEqual(wchar, 'ab')
+
+ wchar, size = unicode_aswidechar('abc', 3)
+ self.assertEqual(size, 3)
+ self.assertEqual(wchar, 'abc')
+
+ wchar, size = unicode_aswidechar('abc', 4)
+ self.assertEqual(size, 3)
+ self.assertEqual(wchar, 'abc\0')
+
+ wchar, size = unicode_aswidechar('abc', 10)
+ self.assertEqual(size, 3)
+ self.assertEqual(wchar, 'abc\0')
+
+ wchar, size = unicode_aswidechar('abc\0def', 20)
+ self.assertEqual(size, 7)
+ self.assertEqual(wchar, 'abc\0def\0')
+
+ nonbmp = chr(0x10ffff)
+ if sizeof(c_wchar) == 2:
+ buflen = 3
+ nchar = 2
+ else: # sizeof(c_wchar) == 4
+ buflen = 2
+ nchar = 1
+ wchar, size = unicode_aswidechar(nonbmp, buflen)
+ self.assertEqual(size, nchar)
+ self.assertEqual(wchar, nonbmp + '\0')
+
+ # Test PyUnicode_AsWideCharString()
+ def test_aswidecharstring(self):
+ from _testcapi import unicode_aswidecharstring
+ support.import_module('ctypes')
+ from ctypes import c_wchar, sizeof
+
+ wchar, size = unicode_aswidecharstring('abc')
+ self.assertEqual(size, 3)
+ self.assertEqual(wchar, 'abc\0')
+
+ wchar, size = unicode_aswidecharstring('abc\0def')
+ self.assertEqual(size, 7)
+ self.assertEqual(wchar, 'abc\0def\0')
+
+ nonbmp = chr(0x10ffff)
+ if sizeof(c_wchar) == 2:
+ nchar = 2
+ else: # sizeof(c_wchar) == 4
+ nchar = 1
+ wchar, size = unicode_aswidecharstring(nonbmp)
+ self.assertEqual(size, nchar)
+ self.assertEqual(wchar, nonbmp + '\0')
+
+
+class StringModuleTest(unittest.TestCase):
+ def test_formatter_parser(self):
+ def parse(format):
+ return list(_string.formatter_parser(format))
+
+ formatter = parse("prefix {2!s}xxx{0:^+10.3f}{obj.attr!s} {z[0]!s:10}")
+ self.assertEqual(formatter, [
+ ('prefix ', '2', '', 's'),
+ ('xxx', '0', '^+10.3f', None),
+ ('', 'obj.attr', '', 's'),
+ (' ', 'z[0]', '10', 's'),
+ ])
+
+ formatter = parse("prefix {} suffix")
+ self.assertEqual(formatter, [
+ ('prefix ', '', '', None),
+ (' suffix', None, None, None),
+ ])
+
+ formatter = parse("str")
+ self.assertEqual(formatter, [
+ ('str', None, None, None),
+ ])
+
+ formatter = parse("")
+ self.assertEqual(formatter, [])
+
+ formatter = parse("{0}")
+ self.assertEqual(formatter, [
+ ('', '0', '', None),
+ ])
+
+ self.assertRaises(TypeError, _string.formatter_parser, 1)
+
+ def test_formatter_field_name_split(self):
+ def split(name):
+ items = list(_string.formatter_field_name_split(name))
+ items[1] = list(items[1])
+ return items
+ self.assertEqual(split("obj"), ["obj", []])
+ self.assertEqual(split("obj.arg"), ["obj", [(True, 'arg')]])
+ self.assertEqual(split("obj[key]"), ["obj", [(False, 'key')]])
+ self.assertEqual(split("obj.arg[key1][key2]"), [
+ "obj",
+ [(True, 'arg'),
+ (False, 'key1'),
+ (False, 'key2'),
+ ]])
+ self.assertRaises(TypeError, _string.formatter_field_name_split, 1)
+
def test_main():
support.run_unittest(__name__)
diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py
index 59ab85e3ad..6c2011ace8 100644
--- a/Lib/test/test_unicode_file.py
+++ b/Lib/test/test_unicode_file.py
@@ -5,14 +5,16 @@ import os, glob, time, shutil
import unicodedata
import unittest
-from test.support import run_unittest, TESTFN_UNICODE, rmtree
-from test.support import TESTFN_ENCODING, TESTFN_UNENCODABLE
-try:
- TESTFN_UNICODE.encode(TESTFN_ENCODING)
-except (UnicodeError, TypeError):
- # Either the file system encoding is None, or the file name
- # cannot be encoded in the file system encoding.
- raise unittest.SkipTest("No Unicode filesystem semantics on this platform.")
+from test.support import (run_unittest, rmtree,
+ TESTFN_ENCODING, TESTFN_UNICODE, TESTFN_UNENCODABLE)
+
+if not os.path.supports_unicode_filenames:
+ try:
+ TESTFN_UNICODE.encode(TESTFN_ENCODING)
+ except (UnicodeError, TypeError):
+ # Either the file system encoding is None, or the file name
+ # cannot be encoded in the file system encoding.
+ raise unittest.SkipTest("No Unicode filesystem semantics on this platform.")
def remove_if_exists(filename):
if os.path.exists(filename):
@@ -47,23 +49,7 @@ class TestUnicodeFiles(unittest.TestCase):
base = unicodedata.normalize("NFD", base)
file_list = [unicodedata.normalize("NFD", f) for f in file_list]
- self.assertTrue(base in file_list)
-
- # Do as many "equivalancy' tests as we can - ie, check that although we
- # have different types for the filename, they refer to the same file.
- def _do_equivalent(self, filename1, filename2):
- # Note we only check "filename1 against filename2" - we don't bother
- # checking "filename2 against 1", as we assume we are called again with
- # the args reversed.
- self.assertTrue(type(filename1)!=type(filename2),
- "No point checking equivalent filenames of the same type")
- # stat and lstat should return the same results.
- self.assertEqual(os.stat(filename1),
- os.stat(filename2))
- self.assertEqual(os.lstat(filename1),
- os.lstat(filename2))
- # Copy/rename etc tests using equivalent filename
- self._do_copyish(filename1, filename2)
+ self.assertIn(base, file_list)
# Tests that copy, move, etc one file to another.
def _do_copyish(self, filename1, filename2):
@@ -89,7 +75,7 @@ class TestUnicodeFiles(unittest.TestCase):
shutil.copy2(filename1, filename2 + ".new")
os.unlink(filename1 + ".new")
- def _do_directory(self, make_name, chdir_name, encoded):
+ def _do_directory(self, make_name, chdir_name):
cwd = os.getcwdb()
if os.path.isdir(make_name):
rmtree(make_name)
@@ -97,12 +83,8 @@ class TestUnicodeFiles(unittest.TestCase):
try:
os.chdir(chdir_name)
try:
- if not encoded:
- cwd_result = os.getcwd()
- name_result = make_name
- else:
- cwd_result = os.getcwdb().decode(TESTFN_ENCODING)
- name_result = make_name.decode(TESTFN_ENCODING)
+ cwd_result = os.getcwd()
+ name_result = make_name
cwd_result = unicodedata.normalize("NFD", cwd_result)
name_result = unicodedata.normalize("NFD", name_result)
@@ -132,16 +114,6 @@ class TestUnicodeFiles(unittest.TestCase):
finally:
os.unlink(filename)
- def _test_equivalent(self, filename1, filename2):
- remove_if_exists(filename1)
- self.assertTrue(not os.path.exists(filename2))
- f = file(filename1, "w")
- f.close()
- try:
- self._do_equivalent(filename1, filename2)
- finally:
- os.unlink(filename1)
-
# The 'test' functions are unittest entry points, and simply call our
# _test functions with each of the filename combinations we wish to test
def test_single_files(self):
@@ -154,12 +126,11 @@ class TestUnicodeFiles(unittest.TestCase):
# Make dir with encoded, chdir with unicode, checkdir with encoded
# (or unicode/encoded/unicode, etc
ext = ".dir"
- self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False)
+ self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext)
# Our directory name that can't use a non-unicode name.
if TESTFN_UNENCODABLE is not None:
self._do_directory(TESTFN_UNENCODABLE+ext,
- TESTFN_UNENCODABLE+ext,
- False)
+ TESTFN_UNENCODABLE+ext)
def test_main():
run_unittest(__name__)
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
index 0862c9bef4..97442564e7 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -21,11 +21,11 @@ errors = 'surrogatepass'
class UnicodeMethodsTest(unittest.TestCase):
# update this, if the database changes
- expectedchecksum = '6ec65b65835614ec00634c674bba0e50cd32c189'
+ expectedchecksum = '21b90f1aed00081b81ca7942b22196af090015a0'
def test_method_checksum(self):
h = hashlib.sha1()
- for i in range(65536):
+ for i in range(0x10000):
char = chr(i)
data = [
# Predicates (single char)
@@ -80,8 +80,7 @@ class UnicodeDatabaseTest(unittest.TestCase):
class UnicodeFunctionsTest(UnicodeDatabaseTest):
# update this, if the database changes
- expectedchecksum = '3136d5afd787dc2bcb1bdcac95e385349fbebbca'
-
+ expectedchecksum = 'c23dfc0b5eaf3ca2aad32d733de96bb182ccda50'
def test_function_checksum(self):
data = []
h = hashlib.sha1()
@@ -90,9 +89,9 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
char = chr(i)
data = [
# Properties
- str(self.db.digit(char, -1)),
- str(self.db.numeric(char, -1)),
- str(self.db.decimal(char, -1)),
+ format(self.db.digit(char, -1), '.12g'),
+ format(self.db.numeric(char, -1), '.12g'),
+ format(self.db.decimal(char, -1), '.12g'),
self.db.category(char),
self.db.bidirectional(char),
self.db.decomposition(char),
@@ -119,6 +118,7 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
self.assertEqual(self.db.numeric('9'), 9)
self.assertEqual(self.db.numeric('\u215b'), 0.125)
self.assertEqual(self.db.numeric('\u2468'), 9.0)
+ self.assertEqual(self.db.numeric('\ua627'), 7.0)
self.assertEqual(self.db.numeric('\U00020000', None), None)
self.assertRaises(TypeError, self.db.numeric)
@@ -237,7 +237,8 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
self.assertEqual(popen.returncode, 1)
error = "SyntaxError: (unicode error) \\N escapes not supported " \
"(can't load unicodedata module)"
- self.assertTrue(error in popen.stderr.read().decode("ascii"))
+ self.assertIn(error, popen.stderr.read().decode("ascii"))
+ popen.stderr.close()
def test_decimal_numeric_consistent(self):
# Test that decimal and numeric are consistent,
@@ -296,6 +297,25 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
self.assertEqual("\u01c5".title(), "\u01c5")
self.assertEqual("\u01c6".title(), "\u01c5")
+ def test_linebreak_7643(self):
+ for i in range(0x10000):
+ lines = (chr(i) + 'A').splitlines()
+ if i in (0x0a, 0x0b, 0x0c, 0x0d, 0x85,
+ 0x1c, 0x1d, 0x1e, 0x2028, 0x2029):
+ self.assertEqual(len(lines), 2,
+ r"\u%.4x should be a linebreak" % i)
+ else:
+ self.assertEqual(len(lines), 1,
+ r"\u%.4x should not be a linebreak" % i)
+
+ def test_UCS4(self):
+ # unicodedata should work with code points outside the BMP
+ # even on a narrow Unicode build
+ self.assertEqual(self.db.category("\U0001012A"), "No")
+ self.assertEqual(self.db.numeric("\U0001012A"), 9000)
+ self.assertEqual(self.db.decimal("\U0001D7FD"), 7)
+ self.assertEqual(self.db.digit("\U0001D7FD"), 7)
+
def test_main():
test.support.run_unittest(
UnicodeMiscTest,
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py
index c4cad83cd4..bfc3ded6f1 100644
--- a/Lib/test/test_unittest.py
+++ b/Lib/test/test_unittest.py
@@ -1,3396 +1,16 @@
-"""Test script for unittest.
+import unittest.test
-By Collin Winter <collinw at gmail.com>
-
-Still need testing:
- TestCase.{assert,fail}* methods (some are tested implicitly)
-"""
-
-import re
from test import support
-import unittest
-from unittest import TestCase, TestProgram
-import types
-from copy import deepcopy
-import io
-
-### Support code
-################################################################
-
-class LoggingResult(unittest.TestResult):
- def __init__(self, log):
- self._events = log
- super().__init__()
-
- def startTest(self, test):
- self._events.append('startTest')
- super().startTest(test)
-
- def startTestRun(self):
- self._events.append('startTestRun')
- super(LoggingResult, self).startTestRun()
-
- def stopTest(self, test):
- self._events.append('stopTest')
- super().stopTest(test)
-
- def stopTestRun(self):
- self._events.append('stopTestRun')
- super(LoggingResult, self).stopTestRun()
-
- def addFailure(self, *args):
- self._events.append('addFailure')
- super().addFailure(*args)
-
- def addSuccess(self, *args):
- self._events.append('addSuccess')
- super(LoggingResult, self).addSuccess(*args)
-
- def addError(self, *args):
- self._events.append('addError')
- super().addError(*args)
-
- def addSkip(self, *args):
- self._events.append('addSkip')
- super(LoggingResult, self).addSkip(*args)
-
- def addExpectedFailure(self, *args):
- self._events.append('addExpectedFailure')
- super(LoggingResult, self).addExpectedFailure(*args)
-
- def addUnexpectedSuccess(self, *args):
- self._events.append('addUnexpectedSuccess')
- super(LoggingResult, self).addUnexpectedSuccess(*args)
-
-
-class TestEquality(object):
- """Used as a mixin for TestCase"""
-
- # Check for a valid __eq__ implementation
- def test_eq(self):
- for obj_1, obj_2 in self.eq_pairs:
- self.assertEqual(obj_1, obj_2)
- self.assertEqual(obj_2, obj_1)
-
- # Check for a valid __ne__ implementation
- def test_ne(self):
- for obj_1, obj_2 in self.ne_pairs:
- self.assertNotEqual(obj_1, obj_2)
- self.assertNotEqual(obj_2, obj_1)
-
-class TestHashing(object):
- """Used as a mixin for TestCase"""
-
- # Check for a valid __hash__ implementation
- def test_hash(self):
- for obj_1, obj_2 in self.eq_pairs:
- try:
- if not hash(obj_1) == hash(obj_2):
- self.fail("%r and %r do not hash equal" % (obj_1, obj_2))
- except KeyboardInterrupt:
- raise
- except Exception as e:
- self.fail("Problem hashing %r and %r: %s" % (obj_1, obj_2, e))
-
- for obj_1, obj_2 in self.ne_pairs:
- try:
- if hash(obj_1) == hash(obj_2):
- self.fail("%s and %s hash equal, but shouldn't" %
- (obj_1, obj_2))
- except KeyboardInterrupt:
- raise
- except Exception as e:
- self.fail("Problem hashing %s and %s: %s" % (obj_1, obj_2, e))
-
-
-# List subclass we can add attributes to.
-class MyClassSuite(list):
-
- def __init__(self, tests):
- super(MyClassSuite, self).__init__(tests)
-
-
-################################################################
-### /Support code
-
-class Test_TestLoader(TestCase):
-
- ### Tests for TestLoader.loadTestsFromTestCase
- ################################################################
-
- # "Return a suite of all tests cases contained in the TestCase-derived
- # class testCaseClass"
- def test_loadTestsFromTestCase(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
-
- tests = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
-
- loader = unittest.TestLoader()
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)
-
- # "Return a suite of all tests cases contained in the TestCase-derived
- # class testCaseClass"
- #
- # Make sure it does the right thing even if no tests were found
- def test_loadTestsFromTestCase__no_matches(self):
- class Foo(unittest.TestCase):
- def foo_bar(self): pass
-
- empty_suite = unittest.TestSuite()
-
- loader = unittest.TestLoader()
- self.assertEqual(loader.loadTestsFromTestCase(Foo), empty_suite)
-
- # "Return a suite of all tests cases contained in the TestCase-derived
- # class testCaseClass"
- #
- # What happens if loadTestsFromTestCase() is given an object
- # that isn't a subclass of TestCase? Specifically, what happens
- # if testCaseClass is a subclass of TestSuite?
- #
- # This is checked for specifically in the code, so we better add a
- # test for it.
- def test_loadTestsFromTestCase__TestSuite_subclass(self):
- class NotATestCase(unittest.TestSuite):
- pass
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromTestCase(NotATestCase)
- except TypeError:
- pass
- else:
- self.fail('Should raise TypeError')
-
- # "Return a suite of all tests cases contained in the TestCase-derived
- # class testCaseClass"
- #
- # Make sure loadTestsFromTestCase() picks up the default test method
- # name (as specified by TestCase), even though the method name does
- # not match the default TestLoader.testMethodPrefix string
- def test_loadTestsFromTestCase__default_method_name(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- loader = unittest.TestLoader()
- # This has to be false for the test to succeed
- self.assertFalse('runTest'.startswith(loader.testMethodPrefix))
-
- suite = loader.loadTestsFromTestCase(Foo)
- self.assertTrue(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [Foo('runTest')])
-
- ################################################################
- ### /Tests for TestLoader.loadTestsFromTestCase
-
- ### Tests for TestLoader.loadTestsFromModule
- ################################################################
-
- # "This method searches `module` for classes derived from TestCase"
- def test_loadTestsFromModule__TestCase_subclass(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromModule(m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- expected = [loader.suiteClass([MyTestCase('test')])]
- self.assertEqual(list(suite), expected)
-
- # "This method searches `module` for classes derived from TestCase"
- #
- # What happens if no tests are found (no TestCase instances)?
- def test_loadTestsFromModule__no_TestCase_instances(self):
- m = types.ModuleType('m')
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromModule(m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [])
-
- # "This method searches `module` for classes derived from TestCase"
- #
- # What happens if no tests are found (TestCases instances, but no tests)?
- def test_loadTestsFromModule__no_TestCase_tests(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromModule(m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- self.assertEqual(list(suite), [loader.suiteClass()])
-
- # "This method searches `module` for classes derived from TestCase"s
- #
- # What happens if loadTestsFromModule() is given something other
- # than a module?
- #
- # XXX Currently, it succeeds anyway. This flexibility
- # should either be documented or loadTestsFromModule() should
- # raise a TypeError
- #
- # XXX Certain people are using this behaviour. We'll add a test for it
- def test_loadTestsFromModule__not_a_module(self):
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
-
- class NotAModule(object):
- test_2 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromModule(NotAModule)
-
- reference = [unittest.TestSuite([MyTestCase('test')])]
- self.assertEqual(list(suite), reference)
-
- ################################################################
- ### /Tests for TestLoader.loadTestsFromModule()
-
- ### Tests for TestLoader.loadTestsFromName()
- ################################################################
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Is ValueError raised in response to an empty name?
- def test_loadTestsFromName__empty_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('')
- except ValueError as e:
- self.assertEqual(str(e), "Empty module name")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when the name contains invalid characters?
- def test_loadTestsFromName__malformed_name(self):
- loader = unittest.TestLoader()
-
- # XXX Should this raise ValueError or ImportError?
- try:
- loader.loadTestsFromName('abc () //')
- except ValueError:
- pass
- except ImportError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve ... to a
- # module"
- #
- # What happens when a module by that name can't be found?
- def test_loadTestsFromName__unknown_module_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('sdasfasfasdf')
- except ImportError as e:
- self.assertEqual(str(e), "No module named sdasfasfasdf")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise ImportError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when the module is found, but the attribute can't?
- def test_loadTestsFromName__unknown_attr_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('unittest.sdasfasfasdf')
- except AttributeError as e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when we provide the module, but the attribute can't be
- # found?
- def test_loadTestsFromName__relative_unknown_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('sdasfasfasdf', unittest)
- except AttributeError as e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # Does loadTestsFromName raise ValueError when passed an empty
- # name relative to a provided module?
- #
- # XXX Should probably raise a ValueError instead of an AttributeError
- def test_loadTestsFromName__relative_empty_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('', unittest)
- except AttributeError as e:
- pass
- else:
- self.fail("Failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens when an impossible name is given, relative to the provided
- # `module`?
- def test_loadTestsFromName__relative_malformed_name(self):
- loader = unittest.TestLoader()
-
- # XXX Should this raise AttributeError or ValueError?
- try:
- loader.loadTestsFromName('abc () //', unittest)
- except ValueError:
- pass
- except AttributeError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise ValueError")
-
- # "The method optionally resolves name relative to the given module"
- #
- # Does loadTestsFromName raise TypeError when the `module` argument
- # isn't a module object?
- #
- # XXX Accepts the not-a-module object, ignorning the object's type
- # This should raise an exception or the method name should be changed
- #
- # XXX Some people are relying on this, so keep it for now
- def test_loadTestsFromName__relative_not_a_module(self):
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
-
- class NotAModule(object):
- test_2 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('test_2', NotAModule)
-
- reference = [MyTestCase('test')]
- self.assertEqual(list(suite), reference)
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Does it raise an exception if the name resolves to an invalid
- # object?
- def test_loadTestsFromName__relative_bad_object(self):
- m = types.ModuleType('m')
- m.testcase_1 = object()
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromName('testcase_1', m)
- except TypeError:
- pass
- else:
- self.fail("Should have raised TypeError")
-
- # "The specifier name is a ``dotted name'' that may
- # resolve either to ... a test case class"
- def test_loadTestsFromName__relative_TestCase_subclass(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('testcase_1', m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [MyTestCase('test')])
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- def test_loadTestsFromName__relative_TestSuite(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testsuite = unittest.TestSuite([MyTestCase('test')])
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('testsuite', m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- self.assertEqual(list(suite), [MyTestCase('test')])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a test method within a test case class"
- def test_loadTestsFromName__relative_testmethod(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('testcase_1.test', m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- self.assertEqual(list(suite), [MyTestCase('test')])
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Does loadTestsFromName() raise the proper exception when trying to
- # resolve "a test method within a test case class" that doesn't exist
- # for the given name (relative to a provided module)?
- def test_loadTestsFromName__relative_invalid_testmethod(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromName('testcase_1.testfoo', m)
- except AttributeError as e:
- self.assertEqual(str(e), "type object 'MyTestCase' has no attribute 'testfoo'")
- else:
- self.fail("Failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a ... TestSuite instance"
- def test_loadTestsFromName__callable__TestSuite(self):
- m = types.ModuleType('m')
- testcase_1 = unittest.FunctionTestCase(lambda: None)
- testcase_2 = unittest.FunctionTestCase(lambda: None)
- def return_TestSuite():
- return unittest.TestSuite([testcase_1, testcase_2])
- m.return_TestSuite = return_TestSuite
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('return_TestSuite', m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [testcase_1, testcase_2])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase ... instance"
- def test_loadTestsFromName__callable__TestCase_instance(self):
- m = types.ModuleType('m')
- testcase_1 = unittest.FunctionTestCase(lambda: None)
- def return_TestCase():
- return testcase_1
- m.return_TestCase = return_TestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('return_TestCase', m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [testcase_1])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase or TestSuite instance"
- #
- # What happens if the callable returns something else?
- def test_loadTestsFromName__callable__wrong_type(self):
- m = types.ModuleType('m')
- def return_wrong():
- return 6
- m.return_wrong = return_wrong
-
- loader = unittest.TestLoader()
- try:
- suite = loader.loadTestsFromName('return_wrong', m)
- except TypeError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise TypeError")
-
- # "The specifier can refer to modules and packages which have not been
- # imported; they will be imported as a side-effect"
- def test_loadTestsFromName__module_not_loaded(self):
- # We're going to try to load this module as a side-effect, so it
- # better not be loaded before we try.
- #
- # Why pick audioop? Google shows it isn't used very often, so there's
- # a good chance that it won't be imported when this test is run
- module_name = 'audioop'
-
- import sys
- if module_name in sys.modules:
- del sys.modules[module_name]
-
- loader = unittest.TestLoader()
- try:
- suite = loader.loadTestsFromName(module_name)
-
- self.assertTrue(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [])
-
- # audioop should now be loaded, thanks to loadTestsFromName()
- self.assertTrue(module_name in sys.modules)
- finally:
- if module_name in sys.modules:
- del sys.modules[module_name]
-
- ################################################################
- ### Tests for TestLoader.loadTestsFromName()
-
- ### Tests for TestLoader.loadTestsFromNames()
- ################################################################
-
- # "Similar to loadTestsFromName(), but takes a sequence of names rather
- # than a single name."
- #
- # What happens if that sequence of names is empty?
- def test_loadTestsFromNames__empty_name_list(self):
- loader = unittest.TestLoader()
-
- suite = loader.loadTestsFromNames([])
- self.assertTrue(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [])
-
- # "Similar to loadTestsFromName(), but takes a sequence of names rather
- # than a single name."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens if that sequence of names is empty?
- #
- # XXX Should this raise a ValueError or just return an empty TestSuite?
- def test_loadTestsFromNames__relative_empty_name_list(self):
- loader = unittest.TestLoader()
-
- suite = loader.loadTestsFromNames([], unittest)
- self.assertTrue(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [])
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Is ValueError raised in response to an empty name?
- def test_loadTestsFromNames__empty_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames([''])
- except ValueError as e:
- self.assertEqual(str(e), "Empty module name")
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when presented with an impossible module name?
- def test_loadTestsFromNames__malformed_name(self):
- loader = unittest.TestLoader()
-
- # XXX Should this raise ValueError or ImportError?
- try:
- loader.loadTestsFromNames(['abc () //'])
- except ValueError:
- pass
- except ImportError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when no module can be found for the given name?
- def test_loadTestsFromNames__unknown_module_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames(['sdasfasfasdf'])
- except ImportError as e:
- self.assertEqual(str(e), "No module named sdasfasfasdf")
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise ImportError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when the module can be found, but not the attribute?
- def test_loadTestsFromNames__unknown_attr_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames(['unittest.sdasfasfasdf', 'unittest'])
- except AttributeError as e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens when given an unknown attribute on a specified `module`
- # argument?
- def test_loadTestsFromNames__unknown_name_relative_1(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames(['sdasfasfasdf'], unittest)
- except AttributeError as e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # Do unknown attributes (relative to a provided module) still raise an
- # exception even in the presence of valid attribute names?
- def test_loadTestsFromNames__unknown_name_relative_2(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames(['TestCase', 'sdasfasfasdf'], unittest)
- except AttributeError as e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens when faced with the empty string?
- #
- # XXX This currently raises AttributeError, though ValueError is probably
- # more appropriate
- def test_loadTestsFromNames__relative_empty_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames([''], unittest)
- except AttributeError:
- pass
- else:
- self.fail("Failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens when presented with an impossible attribute name?
- def test_loadTestsFromNames__relative_malformed_name(self):
- loader = unittest.TestLoader()
-
- # XXX Should this raise AttributeError or ValueError?
- try:
- loader.loadTestsFromNames(['abc () //'], unittest)
- except AttributeError:
- pass
- except ValueError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
-
- # "The method optionally resolves name relative to the given module"
- #
- # Does loadTestsFromNames() make sure the provided `module` is in fact
- # a module?
- #
- # XXX This validation is currently not done. This flexibility should
- # either be documented or a TypeError should be raised.
- def test_loadTestsFromNames__relative_not_a_module(self):
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
-
- class NotAModule(object):
- test_2 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['test_2'], NotAModule)
-
- reference = [unittest.TestSuite([MyTestCase('test')])]
- self.assertEqual(list(suite), reference)
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Does it raise an exception if the name resolves to an invalid
- # object?
- def test_loadTestsFromNames__relative_bad_object(self):
- m = types.ModuleType('m')
- m.testcase_1 = object()
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromNames(['testcase_1'], m)
- except TypeError:
- pass
- else:
- self.fail("Should have raised TypeError")
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a test case class"
- def test_loadTestsFromNames__relative_TestCase_subclass(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['testcase_1'], m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- expected = loader.suiteClass([MyTestCase('test')])
- self.assertEqual(list(suite), [expected])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a TestSuite instance"
- def test_loadTestsFromNames__relative_TestSuite(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testsuite = unittest.TestSuite([MyTestCase('test')])
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['testsuite'], m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- self.assertEqual(list(suite), [m.testsuite])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to ... a
- # test method within a test case class"
- def test_loadTestsFromNames__relative_testmethod(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['testcase_1.test'], m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- ref_suite = unittest.TestSuite([MyTestCase('test')])
- self.assertEqual(list(suite), [ref_suite])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to ... a
- # test method within a test case class"
- #
- # Does the method gracefully handle names that initially look like they
- # resolve to "a test method within a test case class" but don't?
- def test_loadTestsFromNames__relative_invalid_testmethod(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromNames(['testcase_1.testfoo'], m)
- except AttributeError as e:
- self.assertEqual(str(e), "type object 'MyTestCase' has no attribute 'testfoo'")
- else:
- self.fail("Failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a ... TestSuite instance"
- def test_loadTestsFromNames__callable__TestSuite(self):
- m = types.ModuleType('m')
- testcase_1 = unittest.FunctionTestCase(lambda: None)
- testcase_2 = unittest.FunctionTestCase(lambda: None)
- def return_TestSuite():
- return unittest.TestSuite([testcase_1, testcase_2])
- m.return_TestSuite = return_TestSuite
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['return_TestSuite'], m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- expected = unittest.TestSuite([testcase_1, testcase_2])
- self.assertEqual(list(suite), [expected])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase ... instance"
- def test_loadTestsFromNames__callable__TestCase_instance(self):
- m = types.ModuleType('m')
- testcase_1 = unittest.FunctionTestCase(lambda: None)
- def return_TestCase():
- return testcase_1
- m.return_TestCase = return_TestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['return_TestCase'], m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- ref_suite = unittest.TestSuite([testcase_1])
- self.assertEqual(list(suite), [ref_suite])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase or TestSuite instance"
- #
- # Are staticmethods handled correctly?
- def test_loadTestsFromNames__callable__call_staticmethod(self):
- m = types.ModuleType('m')
- class Test1(unittest.TestCase):
- def test(self):
- pass
-
- testcase_1 = Test1('test')
- class Foo(unittest.TestCase):
- @staticmethod
- def foo():
- return testcase_1
- m.Foo = Foo
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['Foo.foo'], m)
- self.assertTrue(isinstance(suite, loader.suiteClass))
-
- ref_suite = unittest.TestSuite([testcase_1])
- self.assertEqual(list(suite), [ref_suite])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase or TestSuite instance"
- #
- # What happens when the callable returns something else?
- def test_loadTestsFromNames__callable__wrong_type(self):
- m = types.ModuleType('m')
- def return_wrong():
- return 6
- m.return_wrong = return_wrong
-
- loader = unittest.TestLoader()
- try:
- suite = loader.loadTestsFromNames(['return_wrong'], m)
- except TypeError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise TypeError")
-
- # "The specifier can refer to modules and packages which have not been
- # imported; they will be imported as a side-effect"
- def test_loadTestsFromNames__module_not_loaded(self):
- # We're going to try to load this module as a side-effect, so it
- # better not be loaded before we try.
- #
- # Why pick audioop? Google shows it isn't used very often, so there's
- # a good chance that it won't be imported when this test is run
- module_name = 'audioop'
-
- import sys
- if module_name in sys.modules:
- del sys.modules[module_name]
-
- loader = unittest.TestLoader()
- try:
- suite = loader.loadTestsFromNames([module_name])
-
- self.assertTrue(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [unittest.TestSuite()])
-
- # audioop should now be loaded, thanks to loadTestsFromName()
- self.assertTrue(module_name in sys.modules)
- finally:
- if module_name in sys.modules:
- del sys.modules[module_name]
-
- ################################################################
- ### /Tests for TestLoader.loadTestsFromNames()
-
- ### Tests for TestLoader.getTestCaseNames()
- ################################################################
-
- # "Return a sorted sequence of method names found within testCaseClass"
- #
- # Test.foobar is defined to make sure getTestCaseNames() respects
- # loader.testMethodPrefix
- def test_getTestCaseNames(self):
- class Test(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foobar(self): pass
-
- loader = unittest.TestLoader()
-
- self.assertEqual(loader.getTestCaseNames(Test), ['test_1', 'test_2'])
-
- # "Return a sorted sequence of method names found within testCaseClass"
- #
- # Does getTestCaseNames() behave appropriately if no tests are found?
- def test_getTestCaseNames__no_tests(self):
- class Test(unittest.TestCase):
- def foobar(self): pass
-
- loader = unittest.TestLoader()
-
- self.assertEqual(loader.getTestCaseNames(Test), [])
-
- # "Return a sorted sequence of method names found within testCaseClass"
- #
- # Are not-TestCases handled gracefully?
- #
- # XXX This should raise a TypeError, not return a list
- #
- # XXX It's too late in the 2.5 release cycle to fix this, but it should
- # probably be revisited for 2.6
- def test_getTestCaseNames__not_a_TestCase(self):
- class BadCase(int):
- def test_foo(self):
- pass
-
- loader = unittest.TestLoader()
- names = loader.getTestCaseNames(BadCase)
-
- self.assertEqual(names, ['test_foo'])
-
- # "Return a sorted sequence of method names found within testCaseClass"
- #
- # Make sure inherited names are handled.
- #
- # TestP.foobar is defined to make sure getTestCaseNames() respects
- # loader.testMethodPrefix
- def test_getTestCaseNames__inheritance(self):
- class TestP(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foobar(self): pass
-
- class TestC(TestP):
- def test_1(self): pass
- def test_3(self): pass
-
- loader = unittest.TestLoader()
-
- names = ['test_1', 'test_2', 'test_3']
- self.assertEqual(loader.getTestCaseNames(TestC), names)
-
- ################################################################
- ### /Tests for TestLoader.getTestCaseNames()
-
- ### Tests for TestLoader.testMethodPrefix
- ################################################################
-
- # "String giving the prefix of method names which will be interpreted as
- # test methods"
- #
- # Implicit in the documentation is that testMethodPrefix is respected by
- # all loadTestsFrom* methods.
- def test_testMethodPrefix__loadTestsFromTestCase(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
-
- tests_1 = unittest.TestSuite([Foo('foo_bar')])
- tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
-
- loader = unittest.TestLoader()
- loader.testMethodPrefix = 'foo'
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests_1)
-
- loader.testMethodPrefix = 'test'
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests_2)
-
- # "String giving the prefix of method names which will be interpreted as
- # test methods"
- #
- # Implicit in the documentation is that testMethodPrefix is respected by
- # all loadTestsFrom* methods.
- def test_testMethodPrefix__loadTestsFromModule(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests_1 = [unittest.TestSuite([Foo('foo_bar')])]
- tests_2 = [unittest.TestSuite([Foo('test_1'), Foo('test_2')])]
-
- loader = unittest.TestLoader()
- loader.testMethodPrefix = 'foo'
- self.assertEqual(list(loader.loadTestsFromModule(m)), tests_1)
-
- loader.testMethodPrefix = 'test'
- self.assertEqual(list(loader.loadTestsFromModule(m)), tests_2)
-
- # "String giving the prefix of method names which will be interpreted as
- # test methods"
- #
- # Implicit in the documentation is that testMethodPrefix is respected by
- # all loadTestsFrom* methods.
- def test_testMethodPrefix__loadTestsFromName(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests_1 = unittest.TestSuite([Foo('foo_bar')])
- tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
-
- loader = unittest.TestLoader()
- loader.testMethodPrefix = 'foo'
- self.assertEqual(loader.loadTestsFromName('Foo', m), tests_1)
-
- loader.testMethodPrefix = 'test'
- self.assertEqual(loader.loadTestsFromName('Foo', m), tests_2)
-
- # "String giving the prefix of method names which will be interpreted as
- # test methods"
- #
- # Implicit in the documentation is that testMethodPrefix is respected by
- # all loadTestsFrom* methods.
- def test_testMethodPrefix__loadTestsFromNames(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests_1 = unittest.TestSuite([unittest.TestSuite([Foo('foo_bar')])])
- tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
- tests_2 = unittest.TestSuite([tests_2])
-
- loader = unittest.TestLoader()
- loader.testMethodPrefix = 'foo'
- self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests_1)
-
- loader.testMethodPrefix = 'test'
- self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests_2)
-
- # "The default value is 'test'"
- def test_testMethodPrefix__default_value(self):
- loader = unittest.TestLoader()
- self.assertEqual(loader.testMethodPrefix, 'test')
-
- ################################################################
- ### /Tests for TestLoader.testMethodPrefix
-
- ### Tests for TestLoader.sortTestMethodsUsing
- ################################################################
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames() and all the loadTestsFromX() methods"
- def test_sortTestMethodsUsing__loadTestsFromTestCase(self):
- def reversed_cmp(x, y):
- return -((x > y) - (x < y))
-
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- tests = loader.suiteClass([Foo('test_2'), Foo('test_1')])
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames() and all the loadTestsFromX() methods"
- def test_sortTestMethodsUsing__loadTestsFromModule(self):
- def reversed_cmp(x, y):
- return -((x > y) - (x < y))
-
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- m.Foo = Foo
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- tests = [loader.suiteClass([Foo('test_2'), Foo('test_1')])]
- self.assertEqual(list(loader.loadTestsFromModule(m)), tests)
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames() and all the loadTestsFromX() methods"
- def test_sortTestMethodsUsing__loadTestsFromName(self):
- def reversed_cmp(x, y):
- return -((x > y) - (x < y))
-
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- m.Foo = Foo
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- tests = loader.suiteClass([Foo('test_2'), Foo('test_1')])
- self.assertEqual(loader.loadTestsFromName('Foo', m), tests)
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames() and all the loadTestsFromX() methods"
- def test_sortTestMethodsUsing__loadTestsFromNames(self):
- def reversed_cmp(x, y):
- return -((x > y) - (x < y))
-
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- m.Foo = Foo
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- tests = [loader.suiteClass([Foo('test_2'), Foo('test_1')])]
- self.assertEqual(list(loader.loadTestsFromNames(['Foo'], m)), tests)
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames()"
- #
- # Does it actually affect getTestCaseNames()?
- def test_sortTestMethodsUsing__getTestCaseNames(self):
- def reversed_cmp(x, y):
- return -((x > y) - (x < y))
-
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- test_names = ['test_2', 'test_1']
- self.assertEqual(loader.getTestCaseNames(Foo), test_names)
-
- # "The default value is the built-in cmp() function"
- # Since cmp is now defunct, we simply verify that the results
- # occur in the same order as they would with the default sort.
- def test_sortTestMethodsUsing__default_value(self):
- loader = unittest.TestLoader()
-
- class Foo(unittest.TestCase):
- def test_2(self): pass
- def test_3(self): pass
- def test_1(self): pass
-
- test_names = ['test_2', 'test_3', 'test_1']
- self.assertEqual(loader.getTestCaseNames(Foo), sorted(test_names))
-
-
- # "it can be set to None to disable the sort."
- #
- # XXX How is this different from reassigning cmp? Are the tests returned
- # in a random order or something? This behaviour should die
- def test_sortTestMethodsUsing__None(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = None
-
- test_names = ['test_2', 'test_1']
- self.assertEqual(set(loader.getTestCaseNames(Foo)), set(test_names))
-
- ################################################################
- ### /Tests for TestLoader.sortTestMethodsUsing
-
- ### Tests for TestLoader.suiteClass
- ################################################################
-
- # "Callable object that constructs a test suite from a list of tests."
- def test_suiteClass__loadTestsFromTestCase(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
-
- tests = [Foo('test_1'), Foo('test_2')]
-
- loader = unittest.TestLoader()
- loader.suiteClass = list
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)
-
- # It is implicit in the documentation for TestLoader.suiteClass that
- # all TestLoader.loadTestsFrom* methods respect it. Let's make sure
- def test_suiteClass__loadTestsFromModule(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests = [[Foo('test_1'), Foo('test_2')]]
-
- loader = unittest.TestLoader()
- loader.suiteClass = list
- self.assertEqual(loader.loadTestsFromModule(m), tests)
-
- # It is implicit in the documentation for TestLoader.suiteClass that
- # all TestLoader.loadTestsFrom* methods respect it. Let's make sure
- def test_suiteClass__loadTestsFromName(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests = [Foo('test_1'), Foo('test_2')]
-
- loader = unittest.TestLoader()
- loader.suiteClass = list
- self.assertEqual(loader.loadTestsFromName('Foo', m), tests)
-
- # It is implicit in the documentation for TestLoader.suiteClass that
- # all TestLoader.loadTestsFrom* methods respect it. Let's make sure
- def test_suiteClass__loadTestsFromNames(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests = [[Foo('test_1'), Foo('test_2')]]
-
- loader = unittest.TestLoader()
- loader.suiteClass = list
- self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests)
-
- # "The default value is the TestSuite class"
- def test_suiteClass__default_value(self):
- loader = unittest.TestLoader()
- self.assertTrue(loader.suiteClass is unittest.TestSuite)
-
- ################################################################
- ### /Tests for TestLoader.suiteClass
-
-### Support code for Test_TestSuite
-################################################################
-
-class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def test_3(self): pass
- def runTest(self): pass
-
-def _mk_TestSuite(*names):
- return unittest.TestSuite(Foo(n) for n in names)
-
-################################################################
-### /Support code for Test_TestSuite
-
-class Test_TestSuite(TestCase, TestEquality):
-
- ### Set up attributes needed by inherited tests
- ################################################################
-
- # Used by TestEquality.test_eq
- eq_pairs = [(unittest.TestSuite(), unittest.TestSuite())
- ,(unittest.TestSuite(), unittest.TestSuite([]))
- ,(_mk_TestSuite('test_1'), _mk_TestSuite('test_1'))]
-
- # Used by TestEquality.test_ne
- ne_pairs = [(unittest.TestSuite(), _mk_TestSuite('test_1'))
- ,(unittest.TestSuite([]), _mk_TestSuite('test_1'))
- ,(_mk_TestSuite('test_1', 'test_2'), _mk_TestSuite('test_1', 'test_3'))
- ,(_mk_TestSuite('test_1'), _mk_TestSuite('test_2'))]
-
- ################################################################
- ### /Set up attributes needed by inherited tests
-
- ### Tests for TestSuite.__init__
- ################################################################
-
- # "class TestSuite([tests])"
- #
- # The tests iterable should be optional
- def test_init__tests_optional(self):
- suite = unittest.TestSuite()
-
- self.assertEqual(suite.countTestCases(), 0)
-
- # "class TestSuite([tests])"
- # ...
- # "If tests is given, it must be an iterable of individual test cases
- # or other test suites that will be used to build the suite initially"
- #
- # TestSuite should deal with empty tests iterables by allowing the
- # creation of an empty suite
- def test_init__empty_tests(self):
- suite = unittest.TestSuite([])
-
- self.assertEqual(suite.countTestCases(), 0)
-
- # "class TestSuite([tests])"
- # ...
- # "If tests is given, it must be an iterable of individual test cases
- # or other test suites that will be used to build the suite initially"
- #
- # TestSuite should allow any iterable to provide tests
- def test_init__tests_from_any_iterable(self):
- def tests():
- yield unittest.FunctionTestCase(lambda: None)
- yield unittest.FunctionTestCase(lambda: None)
-
- suite_1 = unittest.TestSuite(tests())
- self.assertEqual(suite_1.countTestCases(), 2)
-
- suite_2 = unittest.TestSuite(suite_1)
- self.assertEqual(suite_2.countTestCases(), 2)
-
- suite_3 = unittest.TestSuite(set(suite_1))
- self.assertEqual(suite_3.countTestCases(), 2)
-
- # "class TestSuite([tests])"
- # ...
- # "If tests is given, it must be an iterable of individual test cases
- # or other test suites that will be used to build the suite initially"
- #
- # Does TestSuite() also allow other TestSuite() instances to be present
- # in the tests iterable?
- def test_init__TestSuite_instances_in_tests(self):
- def tests():
- ftc = unittest.FunctionTestCase(lambda: None)
- yield unittest.TestSuite([ftc])
- yield unittest.FunctionTestCase(lambda: None)
-
- suite = unittest.TestSuite(tests())
- self.assertEqual(suite.countTestCases(), 2)
-
- ################################################################
- ### /Tests for TestSuite.__init__
-
- # Container types should support the iter protocol
- def test_iter(self):
- test1 = unittest.FunctionTestCase(lambda: None)
- test2 = unittest.FunctionTestCase(lambda: None)
- suite = unittest.TestSuite((test1, test2))
-
- self.assertEqual(list(suite), [test1, test2])
-
- # "Return the number of tests represented by the this test object.
- # ...this method is also implemented by the TestSuite class, which can
- # return larger [greater than 1] values"
- #
- # Presumably an empty TestSuite returns 0?
- def test_countTestCases_zero_simple(self):
- suite = unittest.TestSuite()
-
- self.assertEqual(suite.countTestCases(), 0)
-
- # "Return the number of tests represented by the this test object.
- # ...this method is also implemented by the TestSuite class, which can
- # return larger [greater than 1] values"
- #
- # Presumably an empty TestSuite (even if it contains other empty
- # TestSuite instances) returns 0?
- def test_countTestCases_zero_nested(self):
- class Test1(unittest.TestCase):
- def test(self):
- pass
-
- suite = unittest.TestSuite([unittest.TestSuite()])
-
- self.assertEqual(suite.countTestCases(), 0)
-
- # "Return the number of tests represented by the this test object.
- # ...this method is also implemented by the TestSuite class, which can
- # return larger [greater than 1] values"
- def test_countTestCases_simple(self):
- test1 = unittest.FunctionTestCase(lambda: None)
- test2 = unittest.FunctionTestCase(lambda: None)
- suite = unittest.TestSuite((test1, test2))
-
- self.assertEqual(suite.countTestCases(), 2)
-
- # "Return the number of tests represented by the this test object.
- # ...this method is also implemented by the TestSuite class, which can
- # return larger [greater than 1] values"
- #
- # Make sure this holds for nested TestSuite instances, too
- def test_countTestCases_nested(self):
- class Test1(unittest.TestCase):
- def test1(self): pass
- def test2(self): pass
-
- test2 = unittest.FunctionTestCase(lambda: None)
- test3 = unittest.FunctionTestCase(lambda: None)
- child = unittest.TestSuite((Test1('test2'), test2))
- parent = unittest.TestSuite((test3, child, Test1('test1')))
-
- self.assertEqual(parent.countTestCases(), 4)
-
- # "Run the tests associated with this suite, collecting the result into
- # the test result object passed as result."
- #
- # And if there are no tests? What then?
- def test_run__empty_suite(self):
- events = []
- result = LoggingResult(events)
-
- suite = unittest.TestSuite()
-
- suite.run(result)
-
- self.assertEqual(events, [])
-
- # "Note that unlike TestCase.run(), TestSuite.run() requires the
- # "result object to be passed in."
- def test_run__requires_result(self):
- suite = unittest.TestSuite()
-
- try:
- suite.run()
- except TypeError:
- pass
- else:
- self.fail("Failed to raise TypeError")
-
- # "Run the tests associated with this suite, collecting the result into
- # the test result object passed as result."
- def test_run(self):
- events = []
- result = LoggingResult(events)
-
- class LoggingCase(unittest.TestCase):
- def run(self, result):
- events.append('run %s' % self._testMethodName)
-
- def test1(self): pass
- def test2(self): pass
-
- tests = [LoggingCase('test1'), LoggingCase('test2')]
-
- unittest.TestSuite(tests).run(result)
-
- self.assertEqual(events, ['run test1', 'run test2'])
-
- # "Add a TestCase ... to the suite"
- def test_addTest__TestCase(self):
- class Foo(unittest.TestCase):
- def test(self): pass
-
- test = Foo('test')
- suite = unittest.TestSuite()
-
- suite.addTest(test)
-
- self.assertEqual(suite.countTestCases(), 1)
- self.assertEqual(list(suite), [test])
-
- # "Add a ... TestSuite to the suite"
- def test_addTest__TestSuite(self):
- class Foo(unittest.TestCase):
- def test(self): pass
-
- suite_2 = unittest.TestSuite([Foo('test')])
-
- suite = unittest.TestSuite()
- suite.addTest(suite_2)
-
- self.assertEqual(suite.countTestCases(), 1)
- self.assertEqual(list(suite), [suite_2])
-
- # "Add all the tests from an iterable of TestCase and TestSuite
- # instances to this test suite."
- #
- # "This is equivalent to iterating over tests, calling addTest() for
- # each element"
- def test_addTests(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
-
- test_1 = Foo('test_1')
- test_2 = Foo('test_2')
- inner_suite = unittest.TestSuite([test_2])
-
- def gen():
- yield test_1
- yield test_2
- yield inner_suite
-
- suite_1 = unittest.TestSuite()
- suite_1.addTests(gen())
-
- self.assertEqual(list(suite_1), list(gen()))
-
- # "This is equivalent to iterating over tests, calling addTest() for
- # each element"
- suite_2 = unittest.TestSuite()
- for t in gen():
- suite_2.addTest(t)
-
- self.assertEqual(suite_1, suite_2)
-
- # "Add all the tests from an iterable of TestCase and TestSuite
- # instances to this test suite."
- #
- # What happens if it doesn't get an iterable?
- def test_addTest__noniterable(self):
- suite = unittest.TestSuite()
-
- try:
- suite.addTests(5)
- except TypeError:
- pass
- else:
- self.fail("Failed to raise TypeError")
-
- def test_addTest__noncallable(self):
- suite = unittest.TestSuite()
- self.assertRaises(TypeError, suite.addTest, 5)
-
- def test_addTest__casesuiteclass(self):
- suite = unittest.TestSuite()
- self.assertRaises(TypeError, suite.addTest, Test_TestSuite)
- self.assertRaises(TypeError, suite.addTest, unittest.TestSuite)
-
- def test_addTests__string(self):
- suite = unittest.TestSuite()
- self.assertRaises(TypeError, suite.addTests, "foo")
-
-
-class Test_FunctionTestCase(TestCase):
-
- # "Return the number of tests represented by the this test object. For
- # TestCase instances, this will always be 1"
- def test_countTestCases(self):
- test = unittest.FunctionTestCase(lambda: None)
-
- self.assertEqual(test.countTestCases(), 1)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if setUp() raises
- # an exception.
- def test_run_call_order__error_in_setUp(self):
- events = []
- result = LoggingResult(events)
-
- def setUp():
- events.append('setUp')
- raise RuntimeError('raised by setUp')
-
- def test():
- events.append('test')
-
- def tearDown():
- events.append('tearDown')
-
- expected = ['startTest', 'setUp', 'addError', 'stopTest']
- unittest.FunctionTestCase(test, setUp, tearDown).run(result)
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if the test raises
- # an error (as opposed to a failure).
- def test_run_call_order__error_in_test(self):
- events = []
- result = LoggingResult(events)
-
- def setUp():
- events.append('setUp')
-
- def test():
- events.append('test')
- raise RuntimeError('raised by test')
-
- def tearDown():
- events.append('tearDown')
-
- expected = ['startTest', 'setUp', 'test', 'addError', 'tearDown',
- 'stopTest']
- unittest.FunctionTestCase(test, setUp, tearDown).run(result)
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if the test signals
- # a failure (as opposed to an error).
- def test_run_call_order__failure_in_test(self):
- events = []
- result = LoggingResult(events)
-
- def setUp():
- events.append('setUp')
-
- def test():
- events.append('test')
- self.fail('raised by test')
-
- def tearDown():
- events.append('tearDown')
-
- expected = ['startTest', 'setUp', 'test', 'addFailure', 'tearDown',
- 'stopTest']
- unittest.FunctionTestCase(test, setUp, tearDown).run(result)
- self.assertEqual(events, expected)
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if tearDown() raises
- # an exception.
- def test_run_call_order__error_in_tearDown(self):
- events = []
- result = LoggingResult(events)
-
- def setUp():
- events.append('setUp')
-
- def test():
- events.append('test')
-
- def tearDown():
- events.append('tearDown')
- raise RuntimeError('raised by tearDown')
-
- expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError',
- 'stopTest']
- unittest.FunctionTestCase(test, setUp, tearDown).run(result)
- self.assertEqual(events, expected)
-
- # "Return a string identifying the specific test case."
- #
- # Because of the vague nature of the docs, I'm not going to lock this
- # test down too much. Really all that can be asserted is that the id()
- # will be a string (either 8-byte or unicode -- again, because the docs
- # just say "string")
- def test_id(self):
- test = unittest.FunctionTestCase(lambda: None)
-
- self.assertTrue(isinstance(test.id(), str))
-
- # "Returns a one-line description of the test, or None if no description
- # has been provided. The default implementation of this method returns
- # the first line of the test method's docstring, if available, or None."
- def test_shortDescription__no_docstring(self):
- test = unittest.FunctionTestCase(lambda: None)
-
- self.assertEqual(test.shortDescription(), None)
-
- # "Returns a one-line description of the test, or None if no description
- # has been provided. The default implementation of this method returns
- # the first line of the test method's docstring, if available, or None."
- def test_shortDescription__singleline_docstring(self):
- desc = "this tests foo"
- test = unittest.FunctionTestCase(lambda: None, description=desc)
-
- self.assertEqual(test.shortDescription(), "this tests foo")
-
-class Test_TestResult(TestCase):
- # Note: there are not separate tests for TestResult.wasSuccessful(),
- # TestResult.errors, TestResult.failures, TestResult.testsRun or
- # TestResult.shouldStop because these only have meaning in terms of
- # other TestResult methods.
- #
- # Accordingly, tests for the aforenamed attributes are incorporated
- # in with the tests for the defining methods.
- ################################################################
-
- def test_init(self):
- result = unittest.TestResult()
-
- self.assertTrue(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 0)
- self.assertEqual(result.shouldStop, False)
-
- # "This method can be called to signal that the set of tests being
- # run should be aborted by setting the TestResult's shouldStop
- # attribute to True."
- def test_stop(self):
- result = unittest.TestResult()
-
- result.stop()
-
- self.assertEqual(result.shouldStop, True)
-
- # "Called when the test case test is about to be run. The default
- # implementation simply increments the instance's testsRun counter."
- def test_startTest(self):
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
-
- result = unittest.TestResult()
-
- result.startTest(test)
-
- self.assertTrue(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- result.stopTest(test)
-
- # "Called after the test case test has been executed, regardless of
- # the outcome. The default implementation does nothing."
- def test_stopTest(self):
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
-
- result = unittest.TestResult()
-
- result.startTest(test)
-
- self.assertTrue(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- result.stopTest(test)
-
- # Same tests as above; make sure nothing has changed
- self.assertTrue(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- # "Called before and after tests are run. The default implementation does nothing."
- def test_startTestRun_stopTestRun(self):
- result = unittest.TestResult()
- result.startTestRun()
- result.stopTestRun()
-
- # "addSuccess(test)"
- # ...
- # "Called when the test case test succeeds"
- # ...
- # "wasSuccessful() - Returns True if all tests run so far have passed,
- # otherwise returns False"
- # ...
- # "testsRun - The total number of tests run so far."
- # ...
- # "errors - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test which raised an
- # unexpected exception. Contains formatted
- # tracebacks instead of sys.exc_info() results."
- # ...
- # "failures - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test where a failure was
- # explicitly signalled using the TestCase.fail*() or TestCase.assert*()
- # methods. Contains formatted tracebacks instead
- # of sys.exc_info() results."
- def test_addSuccess(self):
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
-
- result = unittest.TestResult()
-
- result.startTest(test)
- result.addSuccess(test)
- result.stopTest(test)
-
- self.assertTrue(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- # "addFailure(test, err)"
- # ...
- # "Called when the test case test signals a failure. err is a tuple of
- # the form returned by sys.exc_info(): (type, value, traceback)"
- # ...
- # "wasSuccessful() - Returns True if all tests run so far have passed,
- # otherwise returns False"
- # ...
- # "testsRun - The total number of tests run so far."
- # ...
- # "errors - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test which raised an
- # unexpected exception. Contains formatted
- # tracebacks instead of sys.exc_info() results."
- # ...
- # "failures - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test where a failure was
- # explicitly signalled using the TestCase.fail*() or TestCase.assert*()
- # methods. Contains formatted tracebacks instead
- # of sys.exc_info() results."
- def test_addFailure(self):
- import sys
-
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
- try:
- test.fail("foo")
- except:
- exc_info_tuple = sys.exc_info()
-
- result = unittest.TestResult()
-
- result.startTest(test)
- result.addFailure(test, exc_info_tuple)
- result.stopTest(test)
-
- self.assertFalse(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 1)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- test_case, formatted_exc = result.failures[0]
- self.assertTrue(test_case is test)
- self.assertTrue(isinstance(formatted_exc, str))
-
- # "addError(test, err)"
- # ...
- # "Called when the test case test raises an unexpected exception err
- # is a tuple of the form returned by sys.exc_info():
- # (type, value, traceback)"
- # ...
- # "wasSuccessful() - Returns True if all tests run so far have passed,
- # otherwise returns False"
- # ...
- # "testsRun - The total number of tests run so far."
- # ...
- # "errors - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test which raised an
- # unexpected exception. Contains formatted
- # tracebacks instead of sys.exc_info() results."
- # ...
- # "failures - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test where a failure was
- # explicitly signalled using the TestCase.fail*() or TestCase.assert*()
- # methods. Contains formatted tracebacks instead
- # of sys.exc_info() results."
- def test_addError(self):
- import sys
-
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
- try:
- raise TypeError()
- except:
- exc_info_tuple = sys.exc_info()
-
- result = unittest.TestResult()
-
- result.startTest(test)
- result.addError(test, exc_info_tuple)
- result.stopTest(test)
-
- self.assertFalse(result.wasSuccessful())
- self.assertEqual(len(result.errors), 1)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- test_case, formatted_exc = result.errors[0]
- self.assertTrue(test_case is test)
- self.assertTrue(isinstance(formatted_exc, str))
-
-### Support code for Test_TestCase
-################################################################
-
-class Foo(unittest.TestCase):
- def runTest(self): pass
- def test1(self): pass
-
-class Bar(Foo):
- def test2(self): pass
-
-class LoggingTestCase(unittest.TestCase):
- """A test case which logs its calls."""
-
- def __init__(self, events):
- super(LoggingTestCase, self).__init__('test')
- self.events = events
-
- def setUp(self):
- self.events.append('setUp')
-
- def test(self):
- self.events.append('test')
-
- def tearDown(self):
- self.events.append('tearDown')
-
-class ResultWithNoStartTestRunStopTestRun(object):
- """An object honouring TestResult before startTestRun/stopTestRun."""
-
- def __init__(self):
- self.failures = []
- self.errors = []
- self.testsRun = 0
- self.skipped = []
- self.expectedFailures = []
- self.unexpectedSuccesses = []
- self.shouldStop = False
-
- def startTest(self, test):
- pass
-
- def stopTest(self, test):
- pass
-
- def addError(self, test):
- pass
-
- def addFailure(self, test):
- pass
-
- def addSuccess(self, test):
- pass
-
- def wasSuccessful(self):
- return True
-
-
-################################################################
-### /Support code for Test_TestCase
-
-class Test_TestCase(TestCase, TestEquality, TestHashing):
-
- ### Set up attributes used by inherited tests
- ################################################################
-
- # Used by TestHashing.test_hash and TestEquality.test_eq
- eq_pairs = [(Foo('test1'), Foo('test1'))]
-
- # Used by TestEquality.test_ne
- ne_pairs = [(Foo('test1'), Foo('runTest'))
- ,(Foo('test1'), Bar('test1'))
- ,(Foo('test1'), Bar('test2'))]
-
- ################################################################
- ### /Set up attributes used by inherited tests
-
-
- # "class TestCase([methodName])"
- # ...
- # "Each instance of TestCase will run a single test method: the
- # method named methodName."
- # ...
- # "methodName defaults to "runTest"."
- #
- # Make sure it really is optional, and that it defaults to the proper
- # thing.
- def test_init__no_test_name(self):
- class Test(unittest.TestCase):
- def runTest(self): raise MyException()
- def test(self): pass
-
- self.assertEqual(Test().id()[-13:], '.Test.runTest')
-
- # "class TestCase([methodName])"
- # ...
- # "Each instance of TestCase will run a single test method: the
- # method named methodName."
- def test_init__test_name__valid(self):
- class Test(unittest.TestCase):
- def runTest(self): raise MyException()
- def test(self): pass
-
- self.assertEqual(Test('test').id()[-10:], '.Test.test')
-
- # "class TestCase([methodName])"
- # ...
- # "Each instance of TestCase will run a single test method: the
- # method named methodName."
- def test_init__test_name__invalid(self):
- class Test(unittest.TestCase):
- def runTest(self): raise MyException()
- def test(self): pass
-
- try:
- Test('testfoo')
- except ValueError:
- pass
- else:
- self.fail("Failed to raise ValueError")
-
- # "Return the number of tests represented by the this test object. For
- # TestCase instances, this will always be 1"
- def test_countTestCases(self):
- class Foo(unittest.TestCase):
- def test(self): pass
-
- self.assertEqual(Foo('test').countTestCases(), 1)
-
- # "Return the default type of test result object to be used to run this
- # test. For TestCase instances, this will always be
- # unittest.TestResult; subclasses of TestCase should
- # override this as necessary."
- def test_defaultTestResult(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- result = Foo().defaultTestResult()
- self.assertEqual(type(result), unittest.TestResult)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if setUp() raises
- # an exception.
- def test_run_call_order__error_in_setUp(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(LoggingTestCase):
- def setUp(self):
- super(Foo, self).setUp()
- raise RuntimeError('raised by Foo.setUp')
-
- Foo(events).run(result)
- expected = ['startTest', 'setUp', 'addError', 'stopTest']
- self.assertEqual(events, expected)
-
- # "With a temporary result stopTestRun is called when setUp errors.
- def test_run_call_order__error_in_setUp_default_result(self):
- events = []
-
- class Foo(LoggingTestCase):
- def defaultTestResult(self):
- return LoggingResult(self.events)
-
- def setUp(self):
- super(Foo, self).setUp()
- raise RuntimeError('raised by Foo.setUp')
-
- Foo(events).run()
- expected = ['startTestRun', 'startTest', 'setUp', 'addError',
- 'stopTest', 'stopTestRun']
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if the test raises
- # an error (as opposed to a failure).
- def test_run_call_order__error_in_test(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(LoggingTestCase):
- def test(self):
- super(Foo, self).test()
- raise RuntimeError('raised by Foo.test')
-
- expected = ['startTest', 'setUp', 'test', 'addError', 'tearDown',
- 'stopTest']
- Foo(events).run(result)
- self.assertEqual(events, expected)
-
- # "With a default result, an error in the test still results in stopTestRun
- # being called."
- def test_run_call_order__error_in_test_default_result(self):
- events = []
-
- class Foo(LoggingTestCase):
- def defaultTestResult(self):
- return LoggingResult(self.events)
-
- def test(self):
- super(Foo, self).test()
- raise RuntimeError('raised by Foo.test')
-
- expected = ['startTestRun', 'startTest', 'setUp', 'test', 'addError',
- 'tearDown', 'stopTest', 'stopTestRun']
- Foo(events).run()
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if the test signals
- # a failure (as opposed to an error).
- def test_run_call_order__failure_in_test(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(LoggingTestCase):
- def test(self):
- super(Foo, self).test()
- self.fail('raised by Foo.test')
-
- expected = ['startTest', 'setUp', 'test', 'addFailure', 'tearDown',
- 'stopTest']
- Foo(events).run(result)
- self.assertEqual(events, expected)
-
- # "When a test fails with a default result stopTestRun is still called."
- def test_run_call_order__failure_in_test_default_result(self):
-
- class Foo(LoggingTestCase):
- def defaultTestResult(self):
- return LoggingResult(self.events)
- def test(self):
- super(Foo, self).test()
- self.fail('raised by Foo.test')
-
- expected = ['startTestRun', 'startTest', 'setUp', 'test', 'addFailure',
- 'tearDown', 'stopTest', 'stopTestRun']
- events = []
- Foo(events).run()
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if tearDown() raises
- # an exception.
- def test_run_call_order__error_in_tearDown(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(LoggingTestCase):
- def tearDown(self):
- super(Foo, self).tearDown()
- raise RuntimeError('raised by Foo.tearDown')
-
- Foo(events).run(result)
- expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError',
- 'stopTest']
- self.assertEqual(events, expected)
-
- # "When tearDown errors with a default result stopTestRun is still called."
- def test_run_call_order__error_in_tearDown_default_result(self):
-
- class Foo(LoggingTestCase):
- def defaultTestResult(self):
- return LoggingResult(self.events)
- def tearDown(self):
- super(Foo, self).tearDown()
- raise RuntimeError('raised by Foo.tearDown')
-
- events = []
- Foo(events).run()
- expected = ['startTestRun', 'startTest', 'setUp', 'test', 'tearDown',
- 'addError', 'stopTest', 'stopTestRun']
- self.assertEqual(events, expected)
-
- # "TestCase.run() still works when the defaultTestResult is a TestResult
- # that does not support startTestRun and stopTestRun.
- def test_run_call_order_default_result(self):
-
- class Foo(unittest.TestCase):
- def defaultTestResult(self):
- return ResultWithNoStartTestRunStopTestRun()
- def test(self):
- pass
-
- Foo('test').run()
-
- # "This class attribute gives the exception raised by the test() method.
- # If a test framework needs to use a specialized exception, possibly to
- # carry additional information, it must subclass this exception in
- # order to ``play fair'' with the framework. The initial value of this
- # attribute is AssertionError"
- def test_failureException__default(self):
- class Foo(unittest.TestCase):
- def test(self):
- pass
-
- self.assertTrue(Foo('test').failureException is AssertionError)
-
- # "This class attribute gives the exception raised by the test() method.
- # If a test framework needs to use a specialized exception, possibly to
- # carry additional information, it must subclass this exception in
- # order to ``play fair'' with the framework."
- #
- # Make sure TestCase.run() respects the designated failureException
- def test_failureException__subclassing__explicit_raise(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(unittest.TestCase):
- def test(self):
- raise RuntimeError()
-
- failureException = RuntimeError
-
- self.assertTrue(Foo('test').failureException is RuntimeError)
-
-
- Foo('test').run(result)
- expected = ['startTest', 'addFailure', 'stopTest']
- self.assertEqual(events, expected)
-
- # "This class attribute gives the exception raised by the test() method.
- # If a test framework needs to use a specialized exception, possibly to
- # carry additional information, it must subclass this exception in
- # order to ``play fair'' with the framework."
- #
- # Make sure TestCase.run() respects the designated failureException
- def test_failureException__subclassing__implicit_raise(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(unittest.TestCase):
- def test(self):
- self.fail("foo")
-
- failureException = RuntimeError
-
- self.assertTrue(Foo('test').failureException is RuntimeError)
-
-
- Foo('test').run(result)
- expected = ['startTest', 'addFailure', 'stopTest']
- self.assertEqual(events, expected)
-
- # "The default implementation does nothing."
- def test_setUp(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- # ... and nothing should happen
- Foo().setUp()
-
- # "The default implementation does nothing."
- def test_tearDown(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- # ... and nothing should happen
- Foo().tearDown()
-
- # "Return a string identifying the specific test case."
- #
- # Because of the vague nature of the docs, I'm not going to lock this
- # test down too much. Really all that can be asserted is that the id()
- # will be a string (either 8-byte or unicode -- again, because the docs
- # just say "string")
- def test_id(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- self.assertTrue(isinstance(Foo().id(), str))
-
- # "If result is omitted or None, a temporary result object is created
- # and used, but is not made available to the caller. As TestCase owns the
- # temporary result startTestRun and stopTestRun are called.
-
- def test_run__uses_defaultTestResult(self):
- events = []
-
- class Foo(unittest.TestCase):
- def test(self):
- events.append('test')
-
- def defaultTestResult(self):
- return LoggingResult(events)
-
- # Make run() find a result object on its own
- Foo('test').run()
-
- expected = ['startTestRun', 'startTest', 'test', 'addSuccess',
- 'stopTest', 'stopTestRun']
- self.assertEqual(events, expected)
-
- def testShortDescriptionWithoutDocstring(self):
- self.assertEqual(
- self.shortDescription(),
- 'testShortDescriptionWithoutDocstring (' + __name__ +
- '.Test_TestCase)')
-
- def testShortDescriptionWithOneLineDocstring(self):
- """Tests shortDescription() for a method with a docstring."""
- self.assertEqual(
- self.shortDescription(),
- ('testShortDescriptionWithOneLineDocstring '
- '(' + __name__ + '.Test_TestCase)\n'
- 'Tests shortDescription() for a method with a docstring.'))
-
- def testShortDescriptionWithMultiLineDocstring(self):
- """Tests shortDescription() for a method with a longer docstring.
-
- This method ensures that only the first line of a docstring is
- returned used in the short description, no matter how long the
- whole thing is.
- """
- self.assertEqual(
- self.shortDescription(),
- ('testShortDescriptionWithMultiLineDocstring '
- '(' + __name__ + '.Test_TestCase)\n'
- 'Tests shortDescription() for a method with a longer '
- 'docstring.'))
-
- def testAddTypeEqualityFunc(self):
- class SadSnake(object):
- """Dummy class for test_addTypeEqualityFunc."""
- s1, s2 = SadSnake(), SadSnake()
- self.assertFalse(s1 == s2)
- def AllSnakesCreatedEqual(a, b, msg=None):
- return type(a) == type(b) == SadSnake
- self.addTypeEqualityFunc(SadSnake, AllSnakesCreatedEqual)
- self.assertEqual(s1, s2)
- # No this doesn't clean up and remove the SadSnake equality func
- # from this TestCase instance but since its a local nothing else
- # will ever notice that.
-
- def testAssertIs(self):
- thing = object()
- self.assertIs(thing, thing)
- self.assertRaises(self.failureException, self.assertIs, thing, object())
-
- def testAssertIsNot(self):
- thing = object()
- self.assertIsNot(thing, object())
- self.assertRaises(self.failureException, self.assertIsNot, thing, thing)
-
- def testAssertIn(self):
- animals = {'monkey': 'banana', 'cow': 'grass', 'seal': 'fish'}
-
- self.assertIn('a', 'abc')
- self.assertIn(2, [1, 2, 3])
- self.assertIn('monkey', animals)
-
- self.assertNotIn('d', 'abc')
- self.assertNotIn(0, [1, 2, 3])
- self.assertNotIn('otter', animals)
-
- self.assertRaises(self.failureException, self.assertIn, 'x', 'abc')
- self.assertRaises(self.failureException, self.assertIn, 4, [1, 2, 3])
- self.assertRaises(self.failureException, self.assertIn, 'elephant',
- animals)
-
- self.assertRaises(self.failureException, self.assertNotIn, 'c', 'abc')
- self.assertRaises(self.failureException, self.assertNotIn, 1, [1, 2, 3])
- self.assertRaises(self.failureException, self.assertNotIn, 'cow',
- animals)
-
- def testAssertDictContainsSubset(self):
- self.assertDictContainsSubset({}, {})
- self.assertDictContainsSubset({}, {'a': 1})
- self.assertDictContainsSubset({'a': 1}, {'a': 1})
- self.assertDictContainsSubset({'a': 1}, {'a': 1, 'b': 2})
- self.assertDictContainsSubset({'a': 1, 'b': 2}, {'a': 1, 'b': 2})
-
- self.assertRaises(unittest.TestCase.failureException,
- self.assertDictContainsSubset, {'a': 2}, {'a': 1},
- '.*Mismatched values:.*')
-
- self.assertRaises(unittest.TestCase.failureException,
- self.assertDictContainsSubset, {'c': 1}, {'a': 1},
- '.*Missing:.*')
-
- self.assertRaises(unittest.TestCase.failureException,
- self.assertDictContainsSubset, {'a': 1, 'c': 1},
- {'a': 1}, '.*Missing:.*')
-
- self.assertRaises(unittest.TestCase.failureException,
- self.assertDictContainsSubset, {'a': 1, 'c': 1},
- {'a': 1}, '.*Missing:.*Mismatched values:.*')
-
- def testAssertEqual(self):
- equal_pairs = [
- ((), ()),
- ({}, {}),
- ([], []),
- (set(), set()),
- (frozenset(), frozenset())]
- for a, b in equal_pairs:
- # This mess of try excepts is to test the assertEqual behavior
- # itself.
- try:
- self.assertEqual(a, b)
- except self.failureException:
- self.fail('assertEqual(%r, %r) failed' % (a, b))
- try:
- self.assertEqual(a, b, msg='foo')
- except self.failureException:
- self.fail('assertEqual(%r, %r) with msg= failed' % (a, b))
- try:
- self.assertEqual(a, b, 'foo')
- except self.failureException:
- self.fail('assertEqual(%r, %r) with third parameter failed' %
- (a, b))
-
- unequal_pairs = [
- ((), []),
- ({}, set()),
- (set([4,1]), frozenset([4,2])),
- (frozenset([4,5]), set([2,3])),
- (set([3,4]), set([5,4]))]
- for a, b in unequal_pairs:
- self.assertRaises(self.failureException, self.assertEqual, a, b)
- self.assertRaises(self.failureException, self.assertEqual, a, b,
- 'foo')
- self.assertRaises(self.failureException, self.assertEqual, a, b,
- msg='foo')
-
- def testEquality(self):
- self.assertListEqual([], [])
- self.assertTupleEqual((), ())
- self.assertSequenceEqual([], ())
-
- a = [0, 'a', []]
- b = []
- self.assertRaises(unittest.TestCase.failureException,
- self.assertListEqual, a, b)
- self.assertRaises(unittest.TestCase.failureException,
- self.assertListEqual, tuple(a), tuple(b))
- self.assertRaises(unittest.TestCase.failureException,
- self.assertSequenceEqual, a, tuple(b))
-
- b.extend(a)
- self.assertListEqual(a, b)
- self.assertTupleEqual(tuple(a), tuple(b))
- self.assertSequenceEqual(a, tuple(b))
- self.assertSequenceEqual(tuple(a), b)
-
- self.assertRaises(self.failureException, self.assertListEqual,
- a, tuple(b))
- self.assertRaises(self.failureException, self.assertTupleEqual,
- tuple(a), b)
- self.assertRaises(self.failureException, self.assertListEqual, None, b)
- self.assertRaises(self.failureException, self.assertTupleEqual, None,
- tuple(b))
- self.assertRaises(self.failureException, self.assertSequenceEqual,
- None, tuple(b))
- self.assertRaises(self.failureException, self.assertListEqual, 1, 1)
- self.assertRaises(self.failureException, self.assertTupleEqual, 1, 1)
- self.assertRaises(self.failureException, self.assertSequenceEqual,
- 1, 1)
-
- self.assertDictEqual({}, {})
-
- c = { 'x': 1 }
- d = {}
- self.assertRaises(unittest.TestCase.failureException,
- self.assertDictEqual, c, d)
-
- d.update(c)
- self.assertDictEqual(c, d)
-
- d['x'] = 0
- self.assertRaises(unittest.TestCase.failureException,
- self.assertDictEqual, c, d, 'These are unequal')
-
- self.assertRaises(self.failureException, self.assertDictEqual, None, d)
- self.assertRaises(self.failureException, self.assertDictEqual, [], d)
- self.assertRaises(self.failureException, self.assertDictEqual, 1, 1)
-
- self.assertSameElements([1, 2, 3], [3, 2, 1])
- self.assertSameElements([1, 2] + [3] * 100, [1] * 100 + [2, 3])
- self.assertSameElements(['foo', 'bar', 'baz'], ['bar', 'baz', 'foo'])
- self.assertRaises(self.failureException, self.assertSameElements,
- [10], [10, 11])
- self.assertRaises(self.failureException, self.assertSameElements,
- [10, 11], [10])
-
- # Test that sequences of unhashable objects can be tested for sameness:
- self.assertSameElements([[1, 2], [3, 4]], [[3, 4], [1, 2]])
-
- self.assertSameElements([{'a': 1}, {'b': 2}], [{'b': 2}, {'a': 1}])
- self.assertRaises(self.failureException, self.assertSameElements,
- [[1]], [[2]])
- self.assertRaises(self.failureException, self.assertSameElements,
- [{'a': 1}, {'b': 2}], [{'b': 2}, {'a': 2}])
-
- def testAssertSetEqual(self):
- set1 = set()
- set2 = set()
- self.assertSetEqual(set1, set2)
-
- self.assertRaises(self.failureException, self.assertSetEqual, None, set2)
- self.assertRaises(self.failureException, self.assertSetEqual, [], set2)
- self.assertRaises(self.failureException, self.assertSetEqual, set1, None)
- self.assertRaises(self.failureException, self.assertSetEqual, set1, [])
-
- set1 = set(['a'])
- set2 = set()
- self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
-
- set1 = set(['a'])
- set2 = set(['a'])
- self.assertSetEqual(set1, set2)
-
- set1 = set(['a'])
- set2 = set(['a', 'b'])
- self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
-
- set1 = set(['a'])
- set2 = frozenset(['a', 'b'])
- self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
-
- set1 = set(['a', 'b'])
- set2 = frozenset(['a', 'b'])
- self.assertSetEqual(set1, set2)
-
- set1 = set()
- set2 = "foo"
- self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
- self.assertRaises(self.failureException, self.assertSetEqual, set2, set1)
-
- # make sure any string formatting is tuple-safe
- set1 = set([(0, 1), (2, 3)])
- set2 = set([(4, 5)])
- self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
-
- def testInequality(self):
- # Try ints
- self.assertGreater(2, 1)
- self.assertGreaterEqual(2, 1)
- self.assertGreaterEqual(1, 1)
- self.assertLess(1, 2)
- self.assertLessEqual(1, 2)
- self.assertLessEqual(1, 1)
- self.assertRaises(self.failureException, self.assertGreater, 1, 2)
- self.assertRaises(self.failureException, self.assertGreater, 1, 1)
- self.assertRaises(self.failureException, self.assertGreaterEqual, 1, 2)
- self.assertRaises(self.failureException, self.assertLess, 2, 1)
- self.assertRaises(self.failureException, self.assertLess, 1, 1)
- self.assertRaises(self.failureException, self.assertLessEqual, 2, 1)
-
- # Try Floats
- self.assertGreater(1.1, 1.0)
- self.assertGreaterEqual(1.1, 1.0)
- self.assertGreaterEqual(1.0, 1.0)
- self.assertLess(1.0, 1.1)
- self.assertLessEqual(1.0, 1.1)
- self.assertLessEqual(1.0, 1.0)
- self.assertRaises(self.failureException, self.assertGreater, 1.0, 1.1)
- self.assertRaises(self.failureException, self.assertGreater, 1.0, 1.0)
- self.assertRaises(self.failureException, self.assertGreaterEqual, 1.0, 1.1)
- self.assertRaises(self.failureException, self.assertLess, 1.1, 1.0)
- self.assertRaises(self.failureException, self.assertLess, 1.0, 1.0)
- self.assertRaises(self.failureException, self.assertLessEqual, 1.1, 1.0)
-
- # Try Strings
- self.assertGreater('bug', 'ant')
- self.assertGreaterEqual('bug', 'ant')
- self.assertGreaterEqual('ant', 'ant')
- self.assertLess('ant', 'bug')
- self.assertLessEqual('ant', 'bug')
- self.assertLessEqual('ant', 'ant')
- self.assertRaises(self.failureException, self.assertGreater, 'ant', 'bug')
- self.assertRaises(self.failureException, self.assertGreater, 'ant', 'ant')
- self.assertRaises(self.failureException, self.assertGreaterEqual, 'ant', 'bug')
- self.assertRaises(self.failureException, self.assertLess, 'bug', 'ant')
- self.assertRaises(self.failureException, self.assertLess, 'ant', 'ant')
- self.assertRaises(self.failureException, self.assertLessEqual, 'bug', 'ant')
-
- # Try bytes
- self.assertGreater(b'bug', b'ant')
- self.assertGreaterEqual(b'bug', b'ant')
- self.assertGreaterEqual(b'ant', b'ant')
- self.assertLess(b'ant', b'bug')
- self.assertLessEqual(b'ant', b'bug')
- self.assertLessEqual(b'ant', b'ant')
- self.assertRaises(self.failureException, self.assertGreater, b'ant', b'bug')
- self.assertRaises(self.failureException, self.assertGreater, b'ant', b'ant')
- self.assertRaises(self.failureException, self.assertGreaterEqual, b'ant',
- b'bug')
- self.assertRaises(self.failureException, self.assertLess, b'bug', b'ant')
- self.assertRaises(self.failureException, self.assertLess, b'ant', b'ant')
- self.assertRaises(self.failureException, self.assertLessEqual, b'bug', b'ant')
-
- def testAssertMultiLineEqual(self):
- sample_text = """\
-http://www.python.org/doc/2.3/lib/module-unittest.html
-test case
- A test case is the smallest unit of testing. [...]
-"""
- revised_sample_text = """\
-http://www.python.org/doc/2.4.1/lib/module-unittest.html
-test case
- A test case is the smallest unit of testing. [...] You may provide your
- own implementation that does not subclass from TestCase, of course.
-"""
- sample_text_error = """
-- http://www.python.org/doc/2.3/lib/module-unittest.html
-? ^
-+ http://www.python.org/doc/2.4.1/lib/module-unittest.html
-? ^^^
- test case
-- A test case is the smallest unit of testing. [...]
-+ A test case is the smallest unit of testing. [...] You may provide your
-? +++++++++++++++++++++
-+ own implementation that does not subclass from TestCase, of course.
-"""
-
- try:
- self.assertMultiLineEqual(sample_text, revised_sample_text)
- except self.failureException as e:
- # no fair testing ourself with ourself, use assertEqual..
- self.assertEqual(sample_text_error, str(e))
-
- def testAssertEqual_diffThreshold(self):
- # check threshold value
- self.assertEqual(self._diffThreshold, 2**16)
- # disable madDiff to get diff markers
- self.maxDiff = None
-
- # set a lower threshold value and add a cleanup to restore it
- old_threshold = self._diffThreshold
- self._diffThreshold = 2**8
- self.addCleanup(lambda: setattr(self, '_diffThreshold', old_threshold))
-
- # under the threshold: diff marker (^) in error message
- s = 'x' * (2**7)
- try:
- self.assertMultiLineEqual(s + 'a', s + 'b')
- except self.failureException as exc:
- err_msg = str(exc)
- else:
- self.fail('assertEqual unexpectedly succeeded')
- self.assertIn('^', err_msg)
- self.assertMultiLineEqual(s + 'a', s + 'a')
-
- # over the threshold: diff not used and marker (^) not in error message
- s = 'x' * (2**9)
- s1, s2 = s + 'a', s + 'b'
- try:
- self.assertMultiLineEqual(s1, s2)
- except self.failureException as exc:
- err_msg = str(exc)
- else:
- self.fail('assertEqual unexpectedly succeeded')
- self.assertNotIn('^', err_msg)
- self.assertEqual(err_msg, '%r != %r' % (s1, s2))
- self.assertMultiLineEqual(s + 'a', s + 'a')
-
- def testAssertIsNone(self):
- self.assertIsNone(None)
- self.assertRaises(self.failureException, self.assertIsNone, False)
- self.assertIsNotNone('DjZoPloGears on Rails')
- self.assertRaises(self.failureException, self.assertIsNotNone, None)
-
- def testAssertRegexpMatches(self):
- self.assertRegexpMatches('asdfabasdf', r'ab+')
- self.assertRaises(self.failureException, self.assertRegexpMatches,
- 'saaas', r'aaaa')
-
- def testAssertRaisesRegexp(self):
- class ExceptionMock(Exception):
- pass
-
- def Stub():
- raise ExceptionMock('We expect')
-
- self.assertRaisesRegexp(ExceptionMock, re.compile('expect$'), Stub)
- self.assertRaisesRegexp(ExceptionMock, 'expect$', Stub)
-
- def testAssertNotRaisesRegexp(self):
- self.assertRaisesRegexp(
- self.failureException, '^Exception not raised by <lambda>$',
- self.assertRaisesRegexp, Exception, re.compile('x'),
- lambda: None)
- self.assertRaisesRegexp(
- self.failureException, '^Exception not raised by <lambda>$',
- self.assertRaisesRegexp, Exception, 'x',
- lambda: None)
-
- def testAssertRaisesRegexpMismatch(self):
- def Stub():
- raise Exception('Unexpected')
-
- self.assertRaisesRegexp(
- self.failureException,
- r'"\^Expected\$" does not match "Unexpected"',
- self.assertRaisesRegexp, Exception, '^Expected$',
- Stub)
- self.assertRaisesRegexp(
- self.failureException,
- r'"\^Expected\$" does not match "Unexpected"',
- self.assertRaisesRegexp, Exception,
- re.compile('^Expected$'), Stub)
-
- def testSynonymAssertMethodNames(self):
- """Test undocumented method name synonyms.
-
- Please do not use these methods names in your own code.
-
- This test confirms their continued existence and functionality
- in order to avoid breaking existing code.
- """
- self.assertNotEquals(3, 5)
- self.assertEquals(3, 3)
- self.assertAlmostEquals(2.0, 2.0)
- self.assertNotAlmostEquals(3.0, 5.0)
- self.assert_(True)
-
- def testPendingDeprecationMethodNames(self):
- """Test fail* methods pending deprecation, they will warn in 3.2.
-
- Do not use these methods. They will go away in 3.3.
- """
- self.failIfEqual(3, 5)
- self.failUnlessEqual(3, 3)
- self.failUnlessAlmostEqual(2.0, 2.0)
- self.failIfAlmostEqual(3.0, 5.0)
- self.failUnless(True)
- self.failUnlessRaises(TypeError, lambda _: 3.14 + 'spam')
- self.failIf(False)
-
- def testDeepcopy(self):
- # Issue: 5660
- class TestableTest(TestCase):
- def testNothing(self):
- pass
-
- test = TestableTest('testNothing')
-
- # This shouldn't blow up
- deepcopy(test)
-
-
-class Test_TestSkipping(TestCase):
-
- def test_skipping(self):
- class Foo(unittest.TestCase):
- def test_skip_me(self):
- self.skipTest("skip")
- events = []
- result = LoggingResult(events)
- test = Foo("test_skip_me")
- test.run(result)
- self.assertEqual(events, ['startTest', 'addSkip', 'stopTest'])
- self.assertEqual(result.skipped, [(test, "skip")])
-
- # Try letting setUp skip the test now.
- class Foo(unittest.TestCase):
- def setUp(self):
- self.skipTest("testing")
- def test_nothing(self): pass
- events = []
- result = LoggingResult(events)
- test = Foo("test_nothing")
- test.run(result)
- self.assertEqual(events, ['startTest', 'addSkip', 'stopTest'])
- self.assertEqual(result.skipped, [(test, "testing")])
- self.assertEqual(result.testsRun, 1)
-
- def test_skipping_decorators(self):
- op_table = ((unittest.skipUnless, False, True),
- (unittest.skipIf, True, False))
- for deco, do_skip, dont_skip in op_table:
- class Foo(unittest.TestCase):
- @deco(do_skip, "testing")
- def test_skip(self): pass
-
- @deco(dont_skip, "testing")
- def test_dont_skip(self): pass
- test_do_skip = Foo("test_skip")
- test_dont_skip = Foo("test_dont_skip")
- suite = unittest.TestSuite([test_do_skip, test_dont_skip])
- events = []
- result = LoggingResult(events)
- suite.run(result)
- self.assertEqual(len(result.skipped), 1)
- expected = ['startTest', 'addSkip', 'stopTest',
- 'startTest', 'addSuccess', 'stopTest']
- self.assertEqual(events, expected)
- self.assertEqual(result.testsRun, 2)
- self.assertEqual(result.skipped, [(test_do_skip, "testing")])
- self.assertTrue(result.wasSuccessful())
-
- def test_skip_class(self):
- @unittest.skip("testing")
- class Foo(unittest.TestCase):
- def test_1(self):
- record.append(1)
- record = []
- result = unittest.TestResult()
- test = Foo("test_1")
- suite = unittest.TestSuite([test])
- suite.run(result)
- self.assertEqual(result.skipped, [(test, "testing")])
- self.assertEqual(record, [])
-
- def test_expected_failure(self):
- class Foo(unittest.TestCase):
- @unittest.expectedFailure
- def test_die(self):
- self.fail("help me!")
- events = []
- result = LoggingResult(events)
- test = Foo("test_die")
- test.run(result)
- self.assertEqual(events,
- ['startTest', 'addExpectedFailure', 'stopTest'])
- self.assertEqual(result.expectedFailures[0][0], test)
- self.assertTrue(result.wasSuccessful())
-
- def test_unexpected_success(self):
- class Foo(unittest.TestCase):
- @unittest.expectedFailure
- def test_die(self):
- pass
- events = []
- result = LoggingResult(events)
- test = Foo("test_die")
- test.run(result)
- self.assertEqual(events,
- ['startTest', 'addUnexpectedSuccess', 'stopTest'])
- self.assertFalse(result.failures)
- self.assertEqual(result.unexpectedSuccesses, [test])
- self.assertTrue(result.wasSuccessful())
-
-
-
-class Test_Assertions(TestCase):
- def test_AlmostEqual(self):
- self.assertAlmostEqual(1.00000001, 1.0)
- self.assertNotAlmostEqual(1.0000001, 1.0)
- self.assertRaises(self.failureException,
- self.assertAlmostEqual, 1.0000001, 1.0)
- self.assertRaises(self.failureException,
- self.assertNotAlmostEqual, 1.00000001, 1.0)
-
- self.assertAlmostEqual(1.1, 1.0, places=0)
- self.assertRaises(self.failureException,
- self.assertAlmostEqual, 1.1, 1.0, places=1)
-
- self.assertAlmostEqual(0, .1+.1j, places=0)
- self.assertNotAlmostEqual(0, .1+.1j, places=1)
- self.assertRaises(self.failureException,
- self.assertAlmostEqual, 0, .1+.1j, places=1)
- self.assertRaises(self.failureException,
- self.assertNotAlmostEqual, 0, .1+.1j, places=0)
-
- def test_assertRaises(self):
- def _raise(e):
- raise e
- self.assertRaises(KeyError, _raise, KeyError)
- self.assertRaises(KeyError, _raise, KeyError("key"))
- try:
- self.assertRaises(KeyError, lambda: None)
- except self.failureException as e:
- self.assertIn("KeyError not raised", str(e))
- else:
- self.fail("assertRaises() didn't fail")
- try:
- self.assertRaises(KeyError, _raise, ValueError)
- except ValueError:
- pass
- else:
- self.fail("assertRaises() didn't let exception pass through")
- with self.assertRaises(KeyError):
- raise KeyError
- with self.assertRaises(KeyError):
- raise KeyError("key")
- try:
- with self.assertRaises(KeyError):
- pass
- except self.failureException as e:
- self.assertIn("KeyError not raised", str(e))
- else:
- self.fail("assertRaises() didn't fail")
- try:
- with self.assertRaises(KeyError):
- raise ValueError
- except ValueError:
- pass
- else:
- self.fail("assertRaises() didn't let exception pass through")
-
-
-class TestLongMessage(TestCase):
- """Test that the individual asserts honour longMessage.
- This actually tests all the message behaviour for
- asserts that use longMessage."""
-
- def setUp(self):
- class TestableTestFalse(TestCase):
- longMessage = False
- failureException = self.failureException
-
- def testTest(self):
- pass
-
- class TestableTestTrue(TestCase):
- longMessage = True
- failureException = self.failureException
-
- def testTest(self):
- pass
-
- self.testableTrue = TestableTestTrue('testTest')
- self.testableFalse = TestableTestFalse('testTest')
-
- def testDefault(self):
- self.assertFalse(TestCase.longMessage)
-
- def test_formatMsg(self):
- self.assertEqual(self.testableFalse._formatMessage(None, "foo"), "foo")
- self.assertEqual(self.testableFalse._formatMessage("foo", "bar"), "foo")
-
- self.assertEqual(self.testableTrue._formatMessage(None, "foo"), "foo")
- self.assertEqual(self.testableTrue._formatMessage("foo", "bar"), "bar : foo")
-
- def assertMessages(self, methodName, args, errors):
- def getMethod(i):
- useTestableFalse = i < 2
- if useTestableFalse:
- test = self.testableFalse
- else:
- test = self.testableTrue
- return getattr(test, methodName)
-
- for i, expected_regexp in enumerate(errors):
- testMethod = getMethod(i)
- kwargs = {}
- withMsg = i % 2
- if withMsg:
- kwargs = {"msg": "oops"}
-
- with self.assertRaisesRegexp(self.failureException,
- expected_regexp=expected_regexp):
- testMethod(*args, **kwargs)
-
- def testAssertTrue(self):
- self.assertMessages('assertTrue', (False,),
- ["^False is not true$", "^oops$", "^False is not true$",
- "^False is not true : oops$"])
-
- def testAssertFalse(self):
- self.assertMessages('assertFalse', (True,),
- ["^True is not false$", "^oops$", "^True is not false$",
- "^True is not false : oops$"])
-
- def testNotEqual(self):
- self.assertMessages('assertNotEqual', (1, 1),
- ["^1 == 1$", "^oops$", "^1 == 1$",
- "^1 == 1 : oops$"])
-
- def testAlmostEqual(self):
- self.assertMessages('assertAlmostEqual', (1, 2),
- ["^1 != 2 within 7 places$", "^oops$",
- "^1 != 2 within 7 places$", "^1 != 2 within 7 places : oops$"])
-
- def testNotAlmostEqual(self):
- self.assertMessages('assertNotAlmostEqual', (1, 1),
- ["^1 == 1 within 7 places$", "^oops$",
- "^1 == 1 within 7 places$", "^1 == 1 within 7 places : oops$"])
-
- def test_baseAssertEqual(self):
- self.assertMessages('_baseAssertEqual', (1, 2),
- ["^1 != 2$", "^oops$", "^1 != 2$", "^1 != 2 : oops$"])
-
- def testAssertSequenceEqual(self):
- # Error messages are multiline so not testing on full message
- # assertTupleEqual and assertListEqual delegate to this method
- self.assertMessages('assertSequenceEqual', ([], [None]),
- ["\+ \[None\]$", "^oops$", r"\+ \[None\]$",
- r"\+ \[None\] : oops$"])
-
- def testAssertSetEqual(self):
- self.assertMessages('assertSetEqual', (set(), set([None])),
- ["None$", "^oops$", "None$",
- "None : oops$"])
-
- def testAssertIn(self):
- self.assertMessages('assertIn', (None, []),
- ['^None not found in \[\]$', "^oops$",
- '^None not found in \[\]$',
- '^None not found in \[\] : oops$'])
-
- def testAssertNotIn(self):
- self.assertMessages('assertNotIn', (None, [None]),
- ['^None unexpectedly found in \[None\]$', "^oops$",
- '^None unexpectedly found in \[None\]$',
- '^None unexpectedly found in \[None\] : oops$'])
-
- def testAssertDictEqual(self):
- self.assertMessages('assertDictEqual', ({}, {'key': 'value'}),
- [r"\+ \{'key': 'value'\}$", "^oops$",
- "\+ \{'key': 'value'\}$",
- "\+ \{'key': 'value'\} : oops$"])
-
- def testAssertDictContainsSubset(self):
- self.assertMessages('assertDictContainsSubset', ({'key': 'value'}, {}),
- ["^Missing: 'key'$", "^oops$",
- "^Missing: 'key'$",
- "^Missing: 'key' : oops$"])
-
- def testAssertSameElements(self):
- self.assertMessages('assertSameElements', ([], [None]),
- [r"\[None\]$", "^oops$",
- r"\[None\]$",
- r"\[None\] : oops$"])
-
- def testAssertMultiLineEqual(self):
- self.assertMessages('assertMultiLineEqual', ("", "foo"),
- [r"\+ foo$", "^oops$",
- r"\+ foo$",
- r"\+ foo : oops$"])
-
- def testAssertLess(self):
- self.assertMessages('assertLess', (2, 1),
- ["^2 not less than 1$", "^oops$",
- "^2 not less than 1$", "^2 not less than 1 : oops$"])
-
- def testAssertLessEqual(self):
- self.assertMessages('assertLessEqual', (2, 1),
- ["^2 not less than or equal to 1$", "^oops$",
- "^2 not less than or equal to 1$",
- "^2 not less than or equal to 1 : oops$"])
-
- def testAssertGreater(self):
- self.assertMessages('assertGreater', (1, 2),
- ["^1 not greater than 2$", "^oops$",
- "^1 not greater than 2$",
- "^1 not greater than 2 : oops$"])
-
- def testAssertGreaterEqual(self):
- self.assertMessages('assertGreaterEqual', (1, 2),
- ["^1 not greater than or equal to 2$", "^oops$",
- "^1 not greater than or equal to 2$",
- "^1 not greater than or equal to 2 : oops$"])
-
- def testAssertIsNone(self):
- self.assertMessages('assertIsNone', ('not None',),
- ["^'not None' is not None$", "^oops$",
- "^'not None' is not None$",
- "^'not None' is not None : oops$"])
-
- def testAssertIsNotNone(self):
- self.assertMessages('assertIsNotNone', (None,),
- ["^unexpectedly None$", "^oops$",
- "^unexpectedly None$",
- "^unexpectedly None : oops$"])
-
- def testAssertIs(self):
- self.assertMessages('assertIs', (None, 'foo'),
- ["^None is not 'foo'$", "^oops$",
- "^None is not 'foo'$",
- "^None is not 'foo' : oops$"])
-
- def testAssertIsNot(self):
- self.assertMessages('assertIsNot', (None, None),
- ["^unexpectedly identical: None$", "^oops$",
- "^unexpectedly identical: None$",
- "^unexpectedly identical: None : oops$"])
-
-
-class TestCleanUp(TestCase):
-
- def testCleanUp(self):
- class TestableTest(TestCase):
- def testNothing(self):
- pass
-
- test = TestableTest('testNothing')
- self.assertEqual(test._cleanups, [])
-
- cleanups = []
-
- def cleanup1(*args, **kwargs):
- cleanups.append((1, args, kwargs))
-
- def cleanup2(*args, **kwargs):
- cleanups.append((2, args, kwargs))
-
- test.addCleanup(cleanup1, 1, 2, 3, four='hello', five='goodbye')
- test.addCleanup(cleanup2)
-
- self.assertEqual(test._cleanups,
- [(cleanup1, (1, 2, 3), dict(four='hello', five='goodbye')),
- (cleanup2, (), {})])
-
- result = test.doCleanups()
- self.assertTrue(result)
-
- self.assertEqual(cleanups, [(2, (), {}), (1, (1, 2, 3), dict(four='hello', five='goodbye'))])
-
- def testCleanUpWithErrors(self):
- class TestableTest(TestCase):
- def testNothing(self):
- pass
-
- class MockResult(object):
- errors = []
- def addError(self, test, exc_info):
- self.errors.append((test, exc_info))
-
- result = MockResult()
- test = TestableTest('testNothing')
- test._resultForDoCleanups = result
-
- exc1 = Exception('foo')
- exc2 = Exception('bar')
- def cleanup1():
- raise exc1
-
- def cleanup2():
- raise exc2
-
- test.addCleanup(cleanup1)
- test.addCleanup(cleanup2)
-
- self.assertFalse(test.doCleanups())
-
- (test1, (Type1, instance1, _)), (test2, (Type2, instance2, _)) = reversed(MockResult.errors)
- self.assertEqual((test1, Type1, instance1), (test, Exception, exc1))
- self.assertEqual((test2, Type2, instance2), (test, Exception, exc2))
-
- def testCleanupInRun(self):
- blowUp = False
- ordering = []
-
- class TestableTest(TestCase):
- def setUp(self):
- ordering.append('setUp')
- if blowUp:
- raise Exception('foo')
-
- def testNothing(self):
- ordering.append('test')
-
- def tearDown(self):
- ordering.append('tearDown')
-
- test = TestableTest('testNothing')
-
- def cleanup1():
- ordering.append('cleanup1')
- def cleanup2():
- ordering.append('cleanup2')
- test.addCleanup(cleanup1)
- test.addCleanup(cleanup2)
-
- def success(some_test):
- self.assertEqual(some_test, test)
- ordering.append('success')
-
- result = unittest.TestResult()
- result.addSuccess = success
-
- test.run(result)
- self.assertEqual(ordering, ['setUp', 'test', 'tearDown',
- 'cleanup2', 'cleanup1', 'success'])
-
- blowUp = True
- ordering = []
- test = TestableTest('testNothing')
- test.addCleanup(cleanup1)
- test.run(result)
- self.assertEqual(ordering, ['setUp', 'cleanup1'])
-
-
-class Test_TestProgram(TestCase):
-
- # Horrible white box test
- def testNoExit(self):
- result = object()
- test = object()
-
- class FakeRunner(object):
- def run(self, test):
- self.test = test
- return result
-
- runner = FakeRunner()
-
- try:
- oldParseArgs = TestProgram.parseArgs
- TestProgram.parseArgs = lambda *args: None
- TestProgram.test = test
-
- program = TestProgram(testRunner=runner, exit=False)
-
- self.assertEqual(program.result, result)
- self.assertEqual(runner.test, test)
-
- finally:
- TestProgram.parseArgs = oldParseArgs
- del TestProgram.test
-
-
- class FooBar(unittest.TestCase):
- def testPass(self):
- assert True
- def testFail(self):
- assert False
-
- class FooBarLoader(unittest.TestLoader):
- """Test loader that returns a suite containing FooBar."""
- def loadTestsFromModule(self, module):
- return self.suiteClass(
- [self.loadTestsFromTestCase(Test_TestProgram.FooBar)])
-
-
- def test_NonExit(self):
- program = unittest.main(exit=False,
- argv=["foobar"],
- testRunner=unittest.TextTestRunner(stream=io.StringIO()),
- testLoader=self.FooBarLoader())
- self.assertTrue(hasattr(program, 'result'))
-
-
- def test_Exit(self):
- self.assertRaises(
- SystemExit,
- unittest.main,
- argv=["foobar"],
- testRunner=unittest.TextTestRunner(stream=io.StringIO()),
- exit=True,
- testLoader=self.FooBarLoader())
-
-
- def test_ExitAsDefault(self):
- self.assertRaises(
- SystemExit,
- unittest.main,
- argv=["foobar"],
- testRunner=unittest.TextTestRunner(stream=io.StringIO()),
- testLoader=self.FooBarLoader())
-
-
-class Test_TextTestRunner(TestCase):
- """Tests for TextTestRunner."""
-
- def test_works_with_result_without_startTestRun_stopTestRun(self):
- class OldTextResult(ResultWithNoStartTestRunStopTestRun):
- separator2 = ''
- def printErrors(self):
- pass
-
- class Runner(unittest.TextTestRunner):
- def __init__(self):
- super(Runner, self).__init__(io.StringIO())
-
- def _makeResult(self):
- return OldTextResult()
-
- runner = Runner()
- runner.run(unittest.TestSuite())
-
- def test_startTestRun_stopTestRun_called(self):
- class LoggingTextResult(LoggingResult):
- separator2 = ''
- def printErrors(self):
- pass
-
- class LoggingRunner(unittest.TextTestRunner):
- def __init__(self, events):
- super(LoggingRunner, self).__init__(io.StringIO())
- self._events = events
-
- def _makeResult(self):
- return LoggingTextResult(self._events)
-
- events = []
- runner = LoggingRunner(events)
- runner.run(unittest.TestSuite())
- expected = ['startTestRun', 'stopTestRun']
- self.assertEqual(events, expected)
-
-
-######################################################################
-## Main
-######################################################################
def test_main():
- support.run_unittest(Test_TestCase, Test_TestLoader,
- Test_TestSuite, Test_TestResult, Test_FunctionTestCase,
- Test_TestSkipping, Test_Assertions, TestLongMessage,
- Test_TestProgram, TestCleanUp)
+ # used by regrtest
+ support.run_unittest(unittest.test.suite())
+ support.reap_children()
+
+def load_tests(*_):
+ # used by unittest
+ return unittest.test.suite()
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_unpack.py b/Lib/test/test_unpack.py
index b1531f306d..b1c483d4d5 100644
--- a/Lib/test/test_unpack.py
+++ b/Lib/test/test_unpack.py
@@ -62,14 +62,14 @@ Unpacking tuple of wrong size
>>> a, b = t
Traceback (most recent call last):
...
- ValueError: too many values to unpack
+ ValueError: too many values to unpack (expected 2)
Unpacking tuple of wrong size
>>> a, b = l
Traceback (most recent call last):
...
- ValueError: too many values to unpack
+ ValueError: too many values to unpack (expected 2)
Unpacking sequence too short
@@ -83,7 +83,7 @@ Unpacking sequence too long
>>> a, b = Seq()
Traceback (most recent call last):
...
- ValueError: too many values to unpack
+ ValueError: too many values to unpack (expected 2)
Unpacking a sequence where the test for too long raises a different kind of
error
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index 4d3509ae7d..7bb8a098c7 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -11,7 +11,6 @@ from test import support
import os
import sys
import tempfile
-import warnings
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
@@ -88,19 +87,18 @@ class urlopen_FileTests(unittest.TestCase):
def test_fileno(self):
file_num = self.returned_obj.fileno()
- self.assertTrue(isinstance(file_num, int),
- "fileno() did not return an int")
+ self.assertIsInstance(file_num, int, "fileno() did not return an int")
self.assertEqual(os.read(file_num, len(self.text)), self.text,
"Reading on the file descriptor returned by fileno() "
"did not return the expected text")
def test_close(self):
- # Test close() by calling it hear and then having it be called again
+ # Test close() by calling it here and then having it be called again
# by the tearDown() method for the test
self.returned_obj.close()
def test_info(self):
- self.assertTrue(isinstance(self.returned_obj.info(), email.message.Message))
+ self.assertIsInstance(self.returned_obj.info(), email.message.Message)
def test_geturl(self):
self.assertEqual(self.returned_obj.geturl(), self.pathname)
@@ -143,8 +141,10 @@ class urlopen_HttpTests(unittest.TestCase):
def fakehttp(self, fakedata):
class FakeSocket(io.BytesIO):
+ io_refs = 1
def sendall(self, str): pass
def makefile(self, *args, **kwds):
+ self.io_refs += 1
return self
def read(self, amt=None):
if self.closed: return b""
@@ -152,6 +152,10 @@ class urlopen_HttpTests(unittest.TestCase):
def readline(self, length=None):
if self.closed: return b""
return io.BytesIO.readline(self, length)
+ def close(self):
+ self.io_refs -= 1
+ if self.io_refs == 0:
+ io.BytesIO.close(self)
class FakeHTTPConnection(http.client.HTTPConnection):
def connect(self):
self.sock = FakeSocket(fakedata)
@@ -161,8 +165,8 @@ class urlopen_HttpTests(unittest.TestCase):
def unfakehttp(self):
http.client.HTTPConnection = self._connection_class
- def test_read(self):
- self.fakehttp(b"Hello!")
+ def check_read(self, ver):
+ self.fakehttp(b"HTTP/" + ver + b" 200 OK\r\n\r\nHello!")
try:
fp = urlopen("http://python.org/")
self.assertEqual(fp.readline(), b"Hello!")
@@ -175,13 +179,32 @@ class urlopen_HttpTests(unittest.TestCase):
def test_url_fragment(self):
# Issue #11703: geturl() omits fragments in the original URL.
url = 'http://docs.python.org/library/urllib.html#OK'
- self.fakehttp(b'Hello!')
+ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello!")
try:
fp = urllib.request.urlopen(url)
self.assertEqual(fp.geturl(), url)
finally:
self.unfakehttp()
+ def test_willclose(self):
+ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello!")
+ try:
+ resp = urlopen("http://www.python.org")
+ self.assertTrue(resp.fp.will_close)
+ finally:
+ self.unfakehttp()
+
+ def test_read_0_9(self):
+ # "0.9" response accepted (but not "simple responses" without
+ # a status line)
+ self.check_read(b"0.9")
+
+ def test_read_1_0(self):
+ self.check_read(b"1.0")
+
+ def test_read_1_1(self):
+ self.check_read(b"1.1")
+
def test_read_bogus(self):
# urlopen() should raise IOError for many error codes.
self.fakehttp(b'''HTTP/1.1 401 Authentication Required
@@ -220,7 +243,7 @@ Content-Type: text/html; charset=iso-8859-1
self.unfakehttp()
def test_userpass_inurl(self):
- self.fakehttp(b"Hello!")
+ self.fakehttp(b"HTTP/1.0 200 OK\r\n\r\nHello!")
try:
fp = urlopen("http://user:pass@python.org/")
self.assertEqual(fp.readline(), b"Hello!")
@@ -261,8 +284,12 @@ class urlretrieve_FileTests(unittest.TestCase):
except: pass
def constructLocalFileUrl(self, filePath):
- return "file://%s" % urllib.request.pathname2url(
- os.path.abspath(filePath))
+ filePath = os.path.abspath(filePath)
+ try:
+ filePath.encode("utf8")
+ except UnicodeEncodeError:
+ raise unittest.SkipTest("filePath is not encodable to utf8")
+ return "file://%s" % urllib.request.pathname2url(filePath)
def createNewTempFile(self, data=b""):
"""Creates a new temporary file containing the specified data,
@@ -288,9 +315,9 @@ class urlretrieve_FileTests(unittest.TestCase):
# a headers value is returned.
result = urllib.request.urlretrieve("file:%s" % support.TESTFN)
self.assertEqual(result[0], support.TESTFN)
- self.assertTrue(isinstance(result[1], email.message.Message),
- "did not get a email.message.Message instance "
- "as second returned value")
+ self.assertIsInstance(result[1], email.message.Message,
+ "did not get a email.message.Message instance "
+ "as second returned value")
def test_copy(self):
# Test that setting the filename argument works.
@@ -313,9 +340,9 @@ class urlretrieve_FileTests(unittest.TestCase):
def test_reporthook(self):
# Make sure that the reporthook works.
def hooktester(count, block_size, total_size, count_holder=[0]):
- self.assertTrue(isinstance(count, int))
- self.assertTrue(isinstance(block_size, int))
- self.assertTrue(isinstance(total_size, int))
+ self.assertIsInstance(count, int)
+ self.assertIsInstance(block_size, int)
+ self.assertIsInstance(total_size, int)
self.assertEqual(count, count_holder[0])
count_holder[0] = count_holder[0] + 1
second_temp = "%s.2" % support.TESTFN
@@ -597,8 +624,7 @@ class UnquotingTests(unittest.TestCase):
"%s" % result)
self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, None)
self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, ())
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', BytesWarning)
+ with support.check_warnings(('', BytesWarning), quiet=True):
self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, b'')
def test_unquoting_badpercent(self):
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 62226b834c..e9fb2fc271 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -4,6 +4,7 @@ from test import support
import os
import io
import socket
+import array
import urllib.request
# The proxy bypass method imported below has logic specific to the OSX
@@ -25,11 +26,6 @@ class TrivialTests(unittest.TestCase):
# XXX Name hacking to get this to work on Windows.
fname = os.path.abspath(urllib.request.__file__).replace('\\', '/')
- # And more hacking to get it to work on MacOS. This assumes
- # urllib.pathname2url works, unfortunately...
- if os.name == 'mac':
- fname = '/' + fname.replace(':', '/')
-
if os.name == 'nt':
file_url = "file:///%s" % fname
else:
@@ -299,7 +295,7 @@ class MockHTTPClass:
def set_debuglevel(self, level):
self.level = level
- def _set_tunnel(self, host, port=None, headers=None):
+ def set_tunnel(self, host, port=None, headers=None):
self._tunnel_host = host
self._tunnel_port = port
if headers:
@@ -592,12 +588,12 @@ class OpenerDirectorTests(unittest.TestCase):
# *_request
self.assertEqual((handler, name), calls[i])
self.assertEqual(len(args), 1)
- self.assertTrue(isinstance(args[0], Request))
+ self.assertIsInstance(args[0], Request)
else:
# *_response
self.assertEqual((handler, name), calls[i])
self.assertEqual(len(args), 2)
- self.assertTrue(isinstance(args[0], Request))
+ self.assertIsInstance(args[0], Request)
# response from opener.open is None, because there's no
# handler that defines http_open to handle it
self.assertTrue(args[1] is None or
@@ -605,6 +601,10 @@ class OpenerDirectorTests(unittest.TestCase):
def sanepathname2url(path):
+ try:
+ path.encode("utf8")
+ except UnicodeEncodeError:
+ raise unittest.SkipTest("path is not encodable to utf8")
urlpath = urllib.request.pathname2url(path)
if os.name == "nt" and urlpath.startswith("///"):
urlpath = urlpath[2:]
@@ -745,11 +745,11 @@ class HandlerTests(unittest.TestCase):
# file:///blah.txt (a file)
# file://ftp.example.com/blah.txt (an ftp URL)
for url, ftp in [
- ("file://ftp.example.com//foo.txt", True),
+ ("file://ftp.example.com//foo.txt", False),
("file://ftp.example.com///foo.txt", False),
# XXXX bug: fails with OSError, should be URLError
("file://ftp.example.com/foo.txt", False),
- ("file://somehost//foo/something.txt", True),
+ ("file://somehost//foo/something.txt", False),
("file://localhost//foo/something.txt", False),
]:
req = Request(url)
@@ -769,7 +769,7 @@ class HandlerTests(unittest.TestCase):
o = h.parent = MockOpener()
url = "http://example.com/"
- for method, data in [("GET", None), ("POST", "blah")]:
+ for method, data in [("GET", None), ("POST", b"blah")]:
req = Request(url, data, {"Foo": "bar"})
req.timeout = None
req.add_unredirected_header("Spam", "eggs")
@@ -797,15 +797,19 @@ class HandlerTests(unittest.TestCase):
http.raise_on_endheaders = True
self.assertRaises(urllib.error.URLError, h.do_open, http, req)
+ # Check for TypeError on POST data which is str.
+ req = Request("http://example.com/","badpost")
+ self.assertRaises(TypeError, h.do_request_, req)
+
# check adding of standard headers
o.addheaders = [("Spam", "eggs")]
- for data in "", None: # POST, GET
+ for data in b"", None: # POST, GET
req = Request("http://example.com/", data)
r = MockResponse(200, "OK", {}, "")
newreq = h.do_request_(req)
if data is None: # GET
- self.assertTrue("Content-length" not in req.unredirected_hdrs)
- self.assertTrue("Content-type" not in req.unredirected_hdrs)
+ self.assertNotIn("Content-length", req.unredirected_hdrs)
+ self.assertNotIn("Content-type", req.unredirected_hdrs)
else: # POST
self.assertEqual(req.unredirected_hdrs["Content-length"], "0")
self.assertEqual(req.unredirected_hdrs["Content-type"],
@@ -825,6 +829,48 @@ class HandlerTests(unittest.TestCase):
self.assertEqual(req.unredirected_hdrs["Host"], "baz")
self.assertEqual(req.unredirected_hdrs["Spam"], "foo")
+ # Check iterable body support
+ def iterable_body():
+ yield b"one"
+ yield b"two"
+ yield b"three"
+
+ for headers in {}, {"Content-Length": 11}:
+ req = Request("http://example.com/", iterable_body(), headers)
+ if not headers:
+ # Having an iterable body without a Content-Length should
+ # raise an exception
+ self.assertRaises(ValueError, h.do_request_, req)
+ else:
+ newreq = h.do_request_(req)
+
+ # A file object.
+ # Test only Content-Length attribute of request.
+
+ file_obj = io.BytesIO()
+ file_obj.write(b"Something\nSomething\nSomething\n")
+
+ for headers in {}, {"Content-Length": 30}:
+ req = Request("http://example.com/", file_obj, headers)
+ if not headers:
+ # Having an iterable body without a Content-Length should
+ # raise an exception
+ self.assertRaises(ValueError, h.do_request_, req)
+ else:
+ newreq = h.do_request_(req)
+ self.assertEqual(int(newreq.get_header('Content-length')),30)
+
+ file_obj.close()
+
+ # array.array Iterable - Content Length is calculated
+
+ iterable_array = array.array("I",[1,2,3,4])
+
+ for headers in {}, {"Content-Length": 16}:
+ req = Request("http://example.com/", iterable_array, headers)
+ newreq = h.do_request_(req)
+ self.assertEqual(int(newreq.get_header('Content-length')),16)
+
def test_http_doubleslash(self):
# Checks the presence of any unnecessary double slash in url does not
# break anything. Previously, a double slash directly after the host
@@ -832,7 +878,7 @@ class HandlerTests(unittest.TestCase):
h = urllib.request.AbstractHTTPHandler()
o = h.parent = MockOpener()
- data = ""
+ data = b""
ds_urls = [
"http://example.com/foo/bar/baz.html",
"http://example.com//foo/bar/baz.html",
@@ -945,13 +991,13 @@ class HandlerTests(unittest.TestCase):
# now it's a GET, there should not be headers regarding content
# (possibly dragged from before being a POST)
headers = [x.lower() for x in o.req.headers]
- self.assertTrue("content-length" not in headers)
- self.assertTrue("content-type" not in headers)
+ self.assertNotIn("content-length", headers)
+ self.assertNotIn("content-type", headers)
self.assertEqual(o.req.headers["Nonsense"],
"viking=withhold")
- self.assertTrue("Spam" not in o.req.headers)
- self.assertTrue("Spam" not in o.req.unredirected_hdrs)
+ self.assertNotIn("Spam", o.req.headers)
+ self.assertNotIn("Spam", o.req.unredirected_hdrs)
# loop detection
req = Request(from_url)
@@ -1108,10 +1154,10 @@ class HandlerTests(unittest.TestCase):
# Verify Proxy-Authorization gets tunneled to request.
# httpsconn req_headers do not have the Proxy-Authorization header but
# the req will have.
- self.assertFalse(("Proxy-Authorization","FooBar") in
+ self.assertNotIn(("Proxy-Authorization","FooBar"),
https_handler.httpconn.req_headers)
- self.assertTrue(("User-Agent","Grail") in
- https_handler.httpconn.req_headers)
+ self.assertIn(("User-Agent","Grail"),
+ https_handler.httpconn.req_headers)
self.assertIsNotNone(req._tunnel_host)
self.assertEqual(req.get_host(), "proxy.example.com:3128")
self.assertEqual(req.get_header("Proxy-authorization"),"FooBar")
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
index fbd21d2912..9e1ce5bb9e 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -1,13 +1,21 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+import os
import email
-import threading
import urllib.parse
import urllib.request
import http.server
import unittest
import hashlib
from test import support
+threading = support.import_module('threading')
+
+
+here = os.path.dirname(__file__)
+# Self-signed cert file for 'localhost'
+CERT_localhost = os.path.join(here, 'keycert.pem')
+# Self-signed cert file for 'fakehostname'
+CERT_fakehostname = os.path.join(here, 'keycert2.pem')
# Loopback http server infrastructure
@@ -23,7 +31,7 @@ class LoopbackHttpServer(http.server.HTTPServer):
# Set the timeout of our listening socket really low so
# that we can stop the server easily.
- self.socket.settimeout(1.0)
+ self.socket.settimeout(0.1)
def get_request(self):
"""HTTPServer method, overridden."""
@@ -58,6 +66,7 @@ class LoopbackHttpServerThread(threading.Thread):
self._stop_server = True
self.join()
+ self.httpd.server_close()
def run(self):
self.ready.set()
@@ -229,6 +238,7 @@ class ProxyAuthTests(unittest.TestCase):
REALM = "TestRealm"
def setUp(self):
+ super(ProxyAuthTests, self).setUp()
self.digest_auth_handler = DigestAuthHandler()
self.digest_auth_handler.set_users({self.USER: self.PASSWD})
self.digest_auth_handler.set_realm(self.REALM)
@@ -246,6 +256,7 @@ class ProxyAuthTests(unittest.TestCase):
def tearDown(self):
self.server.stop()
+ super(ProxyAuthTests, self).tearDown()
def test_proxy_with_bad_password_raises_httperror(self):
self.proxy_digest_handler.add_password(self.REALM, self.URL,
@@ -340,15 +351,17 @@ class TestUrlopen(unittest.TestCase):
"""
def setUp(self):
+ super(TestUrlopen, self).setUp()
self.server = None
def tearDown(self):
if self.server is not None:
self.server.stop()
+ super(TestUrlopen, self).tearDown()
- def urlopen(self, url, data=None):
+ def urlopen(self, url, data=None, **kwargs):
l = []
- f = urllib.request.urlopen(url, data)
+ f = urllib.request.urlopen(url, data, **kwargs)
try:
# Exercise various methods
l.extend(f.readlines(200))
@@ -371,6 +384,17 @@ class TestUrlopen(unittest.TestCase):
handler.port = port
return handler
+ def start_https_server(self, responses=None, certfile=CERT_localhost):
+ if not hasattr(urllib.request, 'HTTPSHandler'):
+ self.skipTest('ssl support required')
+ from test.ssl_servers import make_https_server
+ if responses is None:
+ responses = [(200, [], b"we care a bit")]
+ handler = GetRequestHandler(responses)
+ server = make_https_server(self, certfile=certfile, handler_class=handler)
+ handler.port = server.port
+ return handler
+
def test_redirection(self):
expected_response = b"We got here..."
responses = [
@@ -428,6 +452,28 @@ class TestUrlopen(unittest.TestCase):
self.assertEqual(data, expected_response)
self.assertEqual(handler.requests, ["/bizarre", b"get=with_feeling"])
+ def test_https(self):
+ handler = self.start_https_server()
+ data = self.urlopen("https://localhost:%s/bizarre" % handler.port)
+ self.assertEqual(data, b"we care a bit")
+
+ def test_https_with_cafile(self):
+ handler = self.start_https_server(certfile=CERT_localhost)
+ import ssl
+ # Good cert
+ data = self.urlopen("https://localhost:%s/bizarre" % handler.port,
+ cafile=CERT_localhost)
+ self.assertEqual(data, b"we care a bit")
+ # Bad cert
+ with self.assertRaises(urllib.error.URLError) as cm:
+ self.urlopen("https://localhost:%s/bizarre" % handler.port,
+ cafile=CERT_fakehostname)
+ # Good cert, but mismatching hostname
+ handler = self.start_https_server(certfile=CERT_fakehostname)
+ with self.assertRaises(ssl.CertificateError) as cm:
+ self.urlopen("https://localhost:%s/bizarre" % handler.port,
+ cafile=CERT_fakehostname)
+
def test_sending_headers(self):
handler = self.start_server()
req = urllib.request.Request("http://localhost:%s/" % handler.port,
@@ -452,9 +498,9 @@ class TestUrlopen(unittest.TestCase):
open_url = urllib.request.urlopen(
"http://localhost:%s" % handler.port)
info_obj = open_url.info()
- self.assertTrue(isinstance(info_obj, email.message.Message),
- "object returned by 'info' is not an instance of "
- "email.message.Message")
+ self.assertIsInstance(info_obj, email.message.Message,
+ "object returned by 'info' is not an "
+ "instance of email.message.Message")
self.assertEqual(info_obj.get_content_subtype(), "plain")
finally:
self.server.stop()
@@ -509,6 +555,8 @@ class TestUrlopen(unittest.TestCase):
(index, len(lines[index]), len(line)))
self.assertEqual(index + 1, len(lines))
+
+@support.reap_threads
def test_main():
support.run_unittest(ProxyAuthTests, TestUrlopen)
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
index e6c4ec1727..7ca61195db 100644
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import unittest
from test import support
@@ -6,10 +6,13 @@ from test.test_urllib2 import sanepathname2url
import os
import socket
-import sys
import urllib.error
import urllib.request
import sys
+try:
+ import ssl
+except ImportError:
+ ssl = None
TIMEOUT = 60 # seconds
@@ -78,8 +81,6 @@ class AuthTests(unittest.TestCase):
class CloseSocketTest(unittest.TestCase):
def test_close(self):
- import socket, http.client, gc
-
# calling .close() on urllib2's response objects should close the
# underlying socket
@@ -174,7 +175,6 @@ class OtherNetworkTests(unittest.TestCase):
self.assertEqual(request.get_header('User-agent'),'Test-Agent')
def _test_urls(self, urls, handlers, retry=True):
- import socket
import time
import logging
debug = logging.getLogger("test_urllib2").debug
@@ -188,6 +188,7 @@ class OtherNetworkTests(unittest.TestCase):
url, req, expected_err = url
else:
req = expected_err = None
+
with support.transient_internet(url):
debug(url)
try:
@@ -197,7 +198,7 @@ class OtherNetworkTests(unittest.TestCase):
if expected_err:
msg = ("Didn't get expected error(s) %s for %s %s, got %s: %s" %
(expected_err, url, req, type(err), err))
- self.assertTrue(isinstance(err, expected_err), msg)
+ self.assertIsInstance(err, expected_err, msg)
except urllib.error.URLError as err:
if isinstance(err[0], socket.timeout):
print("<timeout: %s>" % url, file=sys.stderr)
@@ -263,7 +264,7 @@ class TimeoutTest(unittest.TestCase):
u = _urlopen_with_retry(url, timeout=120)
self.assertEqual(u.fp.raw._sock.gettimeout(), 120)
- FTP_HOST = "ftp://ftp.mirror.nl/pub/mirror/gnu/"
+ FTP_HOST = "ftp://ftp.mirror.nl/pub/gnu/"
def test_ftp_basic(self):
self.assertTrue(socket.getdefaulttimeout() is None)
@@ -297,13 +298,35 @@ class TimeoutTest(unittest.TestCase):
self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)
+@unittest.skipUnless(ssl, "requires SSL support")
+class HTTPSTests(unittest.TestCase):
+
+ def test_sni(self):
+ self.skipTest("test disabled - test server needed")
+ # Checks that Server Name Indication works, if supported by the
+ # OpenSSL linked to.
+ # The ssl module itself doesn't have server-side support for SNI,
+ # so we rely on a third-party test site.
+ expect_sni = ssl.HAS_SNI
+ with support.transient_internet("XXX"):
+ u = urllib.request.urlopen("XXX")
+ contents = u.readall()
+ if expect_sni:
+ self.assertIn(b"Great", contents)
+ self.assertNotIn(b"Unfortunately", contents)
+ else:
+ self.assertNotIn(b"Great", contents)
+ self.assertIn(b"Unfortunately", contents)
+
+
def test_main():
support.requires("network")
support.run_unittest(AuthTests,
- OtherNetworkTests,
- CloseSocketTest,
- TimeoutTest,
- )
+ HTTPSTests,
+ OtherNetworkTests,
+ CloseSocketTest,
+ TimeoutTest,
+ )
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py
index bac2049161..32efb2b06e 100644
--- a/Lib/test/test_urllibnet.py
+++ b/Lib/test/test_urllibnet.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import unittest
from test import support
@@ -12,8 +12,9 @@ import time
class URLTimeoutTest(unittest.TestCase):
+ # XXX this test doesn't seem to test anything useful.
- TIMEOUT = 10.0
+ TIMEOUT = 30.0
def setUp(self):
socket.setdefaulttimeout(self.TIMEOUT)
@@ -24,7 +25,7 @@ class URLTimeoutTest(unittest.TestCase):
def testURLread(self):
with support.transient_internet("www.python.org"):
f = urllib.request.urlopen("http://www.python.org/")
- x = f.read()
+ x = f.read()
class urlopenNetworkTests(unittest.TestCase):
"""Tests urllib.reqest.urlopen using the network.
@@ -43,8 +44,10 @@ class urlopenNetworkTests(unittest.TestCase):
def urlopen(self, *args, **kwargs):
resource = args[0]
- with support.transient_internet(resource):
- return urllib.request.urlopen(*args, **kwargs)
+ cm = support.transient_internet(resource)
+ cm.__enter__()
+ self.addCleanup(cm.__exit__, None, None, None)
+ return urllib.request.urlopen(*args, **kwargs)
def test_basic(self):
# Simple test expected to pass.
@@ -62,10 +65,10 @@ class urlopenNetworkTests(unittest.TestCase):
# Test both readline and readlines.
open_url = self.urlopen("http://www.python.org/")
try:
- self.assertTrue(isinstance(open_url.readline(), bytes),
- "readline did not return bytes")
- self.assertTrue(isinstance(open_url.readlines(), list),
- "readlines did not return a list")
+ self.assertIsInstance(open_url.readline(), bytes,
+ "readline did not return a string")
+ self.assertIsInstance(open_url.readlines(), list,
+ "readlines did not return a list")
finally:
open_url.close()
@@ -76,9 +79,9 @@ class urlopenNetworkTests(unittest.TestCase):
info_obj = open_url.info()
finally:
open_url.close()
- self.assertTrue(isinstance(info_obj, email.message.Message),
- "object returned by 'info' is not an instance of "
- "email.message.Message")
+ self.assertIsInstance(info_obj, email.message.Message,
+ "object returned by 'info' is not an "
+ "instance of email.message.Message")
self.assertEqual(info_obj.get_content_subtype(), "html")
def test_geturl(self):
@@ -135,8 +138,10 @@ class urlretrieveNetworkTests(unittest.TestCase):
def urlretrieve(self, *args):
resource = args[0]
- with support.transient_internet(resource):
- return urllib.request.urlretrieve(*args)
+ cm = support.transient_internet(resource)
+ cm.__enter__()
+ self.addCleanup(cm.__exit__, None, None, None)
+ return urllib.request.urlretrieve(*args)
def test_basic(self):
# Test basic functionality.
@@ -168,8 +173,8 @@ class urlretrieveNetworkTests(unittest.TestCase):
# Make sure header returned as 2nd value from urlretrieve is good.
file_location, header = self.urlretrieve("http://www.python.org/")
os.unlink(file_location)
- self.assertTrue(isinstance(header, email.message.Message),
- "header is not an instance of email.message.Message")
+ self.assertIsInstance(header, email.message.Message,
+ "header is not an instance of email.message.Message")
def test_data_header(self):
logo = "http://www.python.org/community/logos/python-logo-master-v3-TM.png"
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index 252eb138d0..c8d572cda1 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
from test import support
import unittest
@@ -24,6 +24,17 @@ parse_qsl_test_cases = [
("&a=b", [('a', 'b')]),
("a=a+b&b=b+c", [('a', 'a b'), ('b', 'b c')]),
("a=1&a=2", [('a', '1'), ('a', '2')]),
+ (b"", []),
+ (b"&", []),
+ (b"&&", []),
+ (b"=", [(b'', b'')]),
+ (b"=a", [(b'', b'a')]),
+ (b"a", [(b'a', b'')]),
+ (b"a=", [(b'a', b'')]),
+ (b"a=", [(b'a', b'')]),
+ (b"&a=b", [(b'a', b'b')]),
+ (b"a=a+b&b=b+c", [(b'a', b'a b'), (b'b', b'b c')]),
+ (b"a=1&a=2", [(b'a', b'1'), (b'a', b'2')]),
]
class UrlParseTestCase(unittest.TestCase):
@@ -86,7 +97,7 @@ class UrlParseTestCase(unittest.TestCase):
def test_roundtrips(self):
- testcases = [
+ str_cases = [
('file:///tmp/junk.txt',
('file', '', '/tmp/junk.txt', '', '', ''),
('file', '', '/tmp/junk.txt', '', '')),
@@ -110,16 +121,21 @@ class UrlParseTestCase(unittest.TestCase):
('git+ssh', 'git@github.com','/user/project.git',
'','',''),
('git+ssh', 'git@github.com','/user/project.git',
- '', ''))
+ '', '')),
]
- for url, parsed, split in testcases:
+ def _encode(t):
+ return (t[0].encode('ascii'),
+ tuple(x.encode('ascii') for x in t[1]),
+ tuple(x.encode('ascii') for x in t[2]))
+ bytes_cases = [_encode(x) for x in str_cases]
+ for url, parsed, split in str_cases + bytes_cases:
self.checkRoundtrips(url, parsed, split)
def test_http_roundtrips(self):
# urllib.parse.urlsplit treats 'http:' as an optimized special case,
# so we test both 'http:' and 'https:' in all the following.
# Three cheers for white box knowledge!
- testcases = [
+ str_cases = [
('://www.python.org',
('www.python.org', '', '', '', ''),
('www.python.org', '', '', '')),
@@ -136,19 +152,34 @@ class UrlParseTestCase(unittest.TestCase):
('a', '/b/c/d', 'p', 'q', 'f'),
('a', '/b/c/d;p', 'q', 'f')),
]
- for scheme in ('http', 'https'):
- for url, parsed, split in testcases:
- url = scheme + url
- parsed = (scheme,) + parsed
- split = (scheme,) + split
- self.checkRoundtrips(url, parsed, split)
+ def _encode(t):
+ return (t[0].encode('ascii'),
+ tuple(x.encode('ascii') for x in t[1]),
+ tuple(x.encode('ascii') for x in t[2]))
+ bytes_cases = [_encode(x) for x in str_cases]
+ str_schemes = ('http', 'https')
+ bytes_schemes = (b'http', b'https')
+ str_tests = str_schemes, str_cases
+ bytes_tests = bytes_schemes, bytes_cases
+ for schemes, test_cases in (str_tests, bytes_tests):
+ for scheme in schemes:
+ for url, parsed, split in test_cases:
+ url = scheme + url
+ parsed = (scheme,) + parsed
+ split = (scheme,) + split
+ self.checkRoundtrips(url, parsed, split)
def checkJoin(self, base, relurl, expected):
- self.assertEqual(urllib.parse.urljoin(base, relurl), expected,
- (base, relurl, expected))
+ str_components = (base, relurl, expected)
+ self.assertEqual(urllib.parse.urljoin(base, relurl), expected)
+ bytes_components = baseb, relurlb, expectedb = [
+ x.encode('ascii') for x in str_components]
+ self.assertEqual(urllib.parse.urljoin(baseb, relurlb), expectedb)
def test_unparse_parse(self):
- for u in ['Python', './Python','x-newscheme://foo.com/stuff','x://y','x:/y','x:/','/',]:
+ str_cases = ['Python', './Python','x-newscheme://foo.com/stuff','x://y','x:/y','x:/','/',]
+ bytes_cases = [x.encode('ascii') for x in str_cases]
+ for u in str_cases + bytes_cases:
self.assertEqual(urllib.parse.urlunsplit(urllib.parse.urlsplit(u)), u)
self.assertEqual(urllib.parse.urlunparse(urllib.parse.urlparse(u)), u)
@@ -204,6 +235,8 @@ class UrlParseTestCase(unittest.TestCase):
def test_RFC2396(self):
# cases from RFC 2396
+
+
self.checkJoin(RFC2396_BASE, 'g:h', 'g:h')
self.checkJoin(RFC2396_BASE, 'g', 'http://a/b/c/g')
self.checkJoin(RFC2396_BASE, './g', 'http://a/b/c/g')
@@ -273,6 +306,7 @@ class UrlParseTestCase(unittest.TestCase):
self.checkJoin(RFC3986_BASE, '../../g','http://a/g')
#Abnormal Examples
+
# The 'abnormal scenarios' are incompatible with RFC2986 parsing
# Tests are here for reference.
@@ -332,8 +366,48 @@ class UrlParseTestCase(unittest.TestCase):
self.checkJoin(SIMPLE_BASE, 'http:g?y','http://a/b/c/g?y')
self.checkJoin(SIMPLE_BASE, 'http:g?y/./x','http://a/b/c/g?y/./x')
+ def test_RFC2732(self):
+ str_cases = [
+ ('http://Test.python.org:5432/foo/', 'test.python.org', 5432),
+ ('http://12.34.56.78:5432/foo/', '12.34.56.78', 5432),
+ ('http://[::1]:5432/foo/', '::1', 5432),
+ ('http://[dead:beef::1]:5432/foo/', 'dead:beef::1', 5432),
+ ('http://[dead:beef::]:5432/foo/', 'dead:beef::', 5432),
+ ('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:5432/foo/',
+ 'dead:beef:cafe:5417:affe:8fa3:deaf:feed', 5432),
+ ('http://[::12.34.56.78]:5432/foo/', '::12.34.56.78', 5432),
+ ('http://[::ffff:12.34.56.78]:5432/foo/',
+ '::ffff:12.34.56.78', 5432),
+ ('http://Test.python.org/foo/', 'test.python.org', None),
+ ('http://12.34.56.78/foo/', '12.34.56.78', None),
+ ('http://[::1]/foo/', '::1', None),
+ ('http://[dead:beef::1]/foo/', 'dead:beef::1', None),
+ ('http://[dead:beef::]/foo/', 'dead:beef::', None),
+ ('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/',
+ 'dead:beef:cafe:5417:affe:8fa3:deaf:feed', None),
+ ('http://[::12.34.56.78]/foo/', '::12.34.56.78', None),
+ ('http://[::ffff:12.34.56.78]/foo/',
+ '::ffff:12.34.56.78', None),
+ ]
+ def _encode(t):
+ return t[0].encode('ascii'), t[1].encode('ascii'), t[2]
+ bytes_cases = [_encode(x) for x in str_cases]
+ for url, hostname, port in str_cases + bytes_cases:
+ urlparsed = urllib.parse.urlparse(url)
+ self.assertEqual((urlparsed.hostname, urlparsed.port) , (hostname, port))
+
+ str_cases = [
+ 'http://::12.34.56.78]/',
+ 'http://[::1/foo/',
+ 'ftp://[::1/foo/bad]/bad',
+ 'http://[::1/foo/bad]/bad',
+ 'http://[::ffff:12.34.56.78']
+ bytes_cases = [x.encode('ascii') for x in str_cases]
+ for invalid_url in str_cases + bytes_cases:
+ self.assertRaises(ValueError, urllib.parse.urlparse, invalid_url)
+
def test_urldefrag(self):
- for url, defrag, frag in [
+ str_cases = [
('http://python.org#frag', 'http://python.org', 'frag'),
('http://python.org', 'http://python.org', ''),
('http://python.org/#frag', 'http://python.org/', 'frag'),
@@ -344,8 +418,16 @@ class UrlParseTestCase(unittest.TestCase):
('http://python.org/p?q', 'http://python.org/p?q', ''),
(RFC1808_BASE, 'http://a/b/c/d;p?q', 'f'),
(RFC2396_BASE, 'http://a/b/c/d;p?q', ''),
- ]:
- self.assertEqual(urllib.parse.urldefrag(url), (defrag, frag))
+ ]
+ def _encode(t):
+ return type(t)(x.encode('ascii') for x in t)
+ bytes_cases = [_encode(x) for x in str_cases]
+ for url, defrag, frag in str_cases + bytes_cases:
+ result = urllib.parse.urldefrag(url)
+ self.assertEqual(result.geturl(), url)
+ self.assertEqual(result, (defrag, frag))
+ self.assertEqual(result.url, defrag)
+ self.assertEqual(result.fragment, frag)
def test_urlsplit_attributes(self):
url = "HTTP://WWW.PYTHON.ORG/doc/#frag"
@@ -361,7 +443,8 @@ class UrlParseTestCase(unittest.TestCase):
self.assertEqual(p.port, None)
# geturl() won't return exactly the original URL in this case
# since the scheme is always case-normalized
- #self.assertEqual(p.geturl(), url)
+ # We handle this by ignoring the first 4 characters of the URL
+ self.assertEqual(p.geturl()[4:], url[4:])
url = "http://User:Pass@www.python.org:080/doc/?query=yes#frag"
p = urllib.parse.urlsplit(url)
@@ -393,6 +476,45 @@ class UrlParseTestCase(unittest.TestCase):
self.assertEqual(p.port, 80)
self.assertEqual(p.geturl(), url)
+ # And check them all again, only with bytes this time
+ url = b"HTTP://WWW.PYTHON.ORG/doc/#frag"
+ p = urllib.parse.urlsplit(url)
+ self.assertEqual(p.scheme, b"http")
+ self.assertEqual(p.netloc, b"WWW.PYTHON.ORG")
+ self.assertEqual(p.path, b"/doc/")
+ self.assertEqual(p.query, b"")
+ self.assertEqual(p.fragment, b"frag")
+ self.assertEqual(p.username, None)
+ self.assertEqual(p.password, None)
+ self.assertEqual(p.hostname, b"www.python.org")
+ self.assertEqual(p.port, None)
+ self.assertEqual(p.geturl()[4:], url[4:])
+
+ url = b"http://User:Pass@www.python.org:080/doc/?query=yes#frag"
+ p = urllib.parse.urlsplit(url)
+ self.assertEqual(p.scheme, b"http")
+ self.assertEqual(p.netloc, b"User:Pass@www.python.org:080")
+ self.assertEqual(p.path, b"/doc/")
+ self.assertEqual(p.query, b"query=yes")
+ self.assertEqual(p.fragment, b"frag")
+ self.assertEqual(p.username, b"User")
+ self.assertEqual(p.password, b"Pass")
+ self.assertEqual(p.hostname, b"www.python.org")
+ self.assertEqual(p.port, 80)
+ self.assertEqual(p.geturl(), url)
+
+ url = b"http://User@example.com:Pass@www.python.org:080/doc/?query=yes#frag"
+ p = urllib.parse.urlsplit(url)
+ self.assertEqual(p.scheme, b"http")
+ self.assertEqual(p.netloc, b"User@example.com:Pass@www.python.org:080")
+ self.assertEqual(p.path, b"/doc/")
+ self.assertEqual(p.query, b"query=yes")
+ self.assertEqual(p.fragment, b"frag")
+ self.assertEqual(p.username, b"User@example.com")
+ self.assertEqual(p.password, b"Pass")
+ self.assertEqual(p.hostname, b"www.python.org")
+ self.assertEqual(p.port, 80)
+ self.assertEqual(p.geturl(), url)
def test_attributes_bad_port(self):
"""Check handling of non-integer ports."""
@@ -404,6 +526,15 @@ class UrlParseTestCase(unittest.TestCase):
self.assertEqual(p.netloc, "www.example.net:foo")
self.assertRaises(ValueError, lambda: p.port)
+ # Once again, repeat ourselves to test bytes
+ p = urllib.parse.urlsplit(b"http://www.example.net:foo")
+ self.assertEqual(p.netloc, b"www.example.net:foo")
+ self.assertRaises(ValueError, lambda: p.port)
+
+ p = urllib.parse.urlparse(b"http://www.example.net:foo")
+ self.assertEqual(p.netloc, b"www.example.net:foo")
+ self.assertRaises(ValueError, lambda: p.port)
+
def test_attributes_without_netloc(self):
# This example is straight from RFC 3261. It looks like it
# should allow the username, hostname, and port to be filled
@@ -427,10 +558,30 @@ class UrlParseTestCase(unittest.TestCase):
self.assertEqual(p.port, None)
self.assertEqual(p.geturl(), uri)
+ # You guessed it, repeating the test with bytes input
+ uri = b"sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15"
+ p = urllib.parse.urlsplit(uri)
+ self.assertEqual(p.netloc, b"")
+ self.assertEqual(p.username, None)
+ self.assertEqual(p.password, None)
+ self.assertEqual(p.hostname, None)
+ self.assertEqual(p.port, None)
+ self.assertEqual(p.geturl(), uri)
+
+ p = urllib.parse.urlparse(uri)
+ self.assertEqual(p.netloc, b"")
+ self.assertEqual(p.username, None)
+ self.assertEqual(p.password, None)
+ self.assertEqual(p.hostname, None)
+ self.assertEqual(p.port, None)
+ self.assertEqual(p.geturl(), uri)
+
def test_noslash(self):
# Issue 1637: http://foo.com?query is legal
self.assertEqual(urllib.parse.urlparse("http://example.com?blahblah=/foo"),
('http', 'example.com', '', '', 'blahblah=/foo', ''))
+ self.assertEqual(urllib.parse.urlparse(b"http://example.com?blahblah=/foo"),
+ (b'http', b'example.com', b'', b'', b'blahblah=/foo', b''))
def test_withoutscheme(self):
# Test urlparse without scheme
@@ -443,6 +594,13 @@ class UrlParseTestCase(unittest.TestCase):
('','www.python.org:80','','','',''))
self.assertEqual(urllib.parse.urlparse("http://www.python.org:80"),
('http','www.python.org:80','','','',''))
+ # Repeat for bytes input
+ self.assertEqual(urllib.parse.urlparse(b"path"),
+ (b'',b'',b'path',b'',b'',b''))
+ self.assertEqual(urllib.parse.urlparse(b"//www.python.org:80"),
+ (b'',b'www.python.org:80',b'',b'',b'',b''))
+ self.assertEqual(urllib.parse.urlparse(b"http://www.python.org:80"),
+ (b'http',b'www.python.org:80',b'',b'',b'',b''))
def test_portseparator(self):
# Issue 754016 makes changes for port separator ':' from scheme separator
@@ -452,6 +610,13 @@ class UrlParseTestCase(unittest.TestCase):
self.assertEqual(urllib.parse.urlparse("https:"),('https','','','','',''))
self.assertEqual(urllib.parse.urlparse("http://www.python.org:80"),
('http','www.python.org:80','','','',''))
+ # As usual, need to check bytes input as well
+ self.assertEqual(urllib.parse.urlparse(b"path:80"),
+ (b'',b'',b'path:80',b'',b'',b''))
+ self.assertEqual(urllib.parse.urlparse(b"http:"),(b'http',b'',b'',b'',b'',b''))
+ self.assertEqual(urllib.parse.urlparse(b"https:"),(b'https',b'',b'',b'',b'',b''))
+ self.assertEqual(urllib.parse.urlparse(b"http://www.python.org:80"),
+ (b'http',b'www.python.org:80',b'',b'',b'',b''))
def test_usingsys(self):
# Issue 3314: sys module is used in the error
@@ -463,6 +628,98 @@ class UrlParseTestCase(unittest.TestCase):
('s3', 'foo.com', '/stuff', '', '', ''))
self.assertEqual(urllib.parse.urlparse("x-newscheme://foo.com/stuff"),
('x-newscheme', 'foo.com', '/stuff', '', '', ''))
+ # And for bytes...
+ self.assertEqual(urllib.parse.urlparse(b"s3://foo.com/stuff"),
+ (b's3', b'foo.com', b'/stuff', b'', b'', b''))
+ self.assertEqual(urllib.parse.urlparse(b"x-newscheme://foo.com/stuff"),
+ (b'x-newscheme', b'foo.com', b'/stuff', b'', b'', b''))
+
+ def test_mixed_types_rejected(self):
+ # Several functions that process either strings or ASCII encoded bytes
+ # accept multiple arguments. Check they reject mixed type input
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urlparse("www.python.org", b"http")
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urlparse(b"www.python.org", "http")
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urlsplit("www.python.org", b"http")
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urlsplit(b"www.python.org", "http")
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urlunparse(( b"http", "www.python.org","","","",""))
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urlunparse(("http", b"www.python.org","","","",""))
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urlunsplit((b"http", "www.python.org","","",""))
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urlunsplit(("http", b"www.python.org","","",""))
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urljoin("http://python.org", b"http://python.org")
+ with self.assertRaisesRegex(TypeError, "Cannot mix str"):
+ urllib.parse.urljoin(b"http://python.org", "http://python.org")
+
+ def _check_result_type(self, str_type):
+ num_args = len(str_type._fields)
+ bytes_type = str_type._encoded_counterpart
+ self.assertIs(bytes_type._decoded_counterpart, str_type)
+ str_args = ('',) * num_args
+ bytes_args = (b'',) * num_args
+ str_result = str_type(*str_args)
+ bytes_result = bytes_type(*bytes_args)
+ encoding = 'ascii'
+ errors = 'strict'
+ self.assertEqual(str_result, str_args)
+ self.assertEqual(bytes_result.decode(), str_args)
+ self.assertEqual(bytes_result.decode(), str_result)
+ self.assertEqual(bytes_result.decode(encoding), str_args)
+ self.assertEqual(bytes_result.decode(encoding), str_result)
+ self.assertEqual(bytes_result.decode(encoding, errors), str_args)
+ self.assertEqual(bytes_result.decode(encoding, errors), str_result)
+ self.assertEqual(bytes_result, bytes_args)
+ self.assertEqual(str_result.encode(), bytes_args)
+ self.assertEqual(str_result.encode(), bytes_result)
+ self.assertEqual(str_result.encode(encoding), bytes_args)
+ self.assertEqual(str_result.encode(encoding), bytes_result)
+ self.assertEqual(str_result.encode(encoding, errors), bytes_args)
+ self.assertEqual(str_result.encode(encoding, errors), bytes_result)
+
+ def test_result_pairs(self):
+ # Check encoding and decoding between result pairs
+ result_types = [
+ urllib.parse.DefragResult,
+ urllib.parse.SplitResult,
+ urllib.parse.ParseResult,
+ ]
+ for result_type in result_types:
+ self._check_result_type(result_type)
+
+ def test_parse_qs_encoding(self):
+ result = urllib.parse.parse_qs("key=\u0141%E9", encoding="latin-1")
+ self.assertEqual(result, {'key': ['\u0141\xE9']})
+ result = urllib.parse.parse_qs("key=\u0141%C3%A9", encoding="utf-8")
+ self.assertEqual(result, {'key': ['\u0141\xE9']})
+ result = urllib.parse.parse_qs("key=\u0141%C3%A9", encoding="ascii")
+ self.assertEqual(result, {'key': ['\u0141\ufffd\ufffd']})
+ result = urllib.parse.parse_qs("key=\u0141%E9-", encoding="ascii")
+ self.assertEqual(result, {'key': ['\u0141\ufffd-']})
+ result = urllib.parse.parse_qs("key=\u0141%E9-", encoding="ascii",
+ errors="ignore")
+ self.assertEqual(result, {'key': ['\u0141-']})
+
+ def test_parse_qsl_encoding(self):
+ result = urllib.parse.parse_qsl("key=\u0141%E9", encoding="latin-1")
+ self.assertEqual(result, [('key', '\u0141\xE9')])
+ result = urllib.parse.parse_qsl("key=\u0141%C3%A9", encoding="utf-8")
+ self.assertEqual(result, [('key', '\u0141\xE9')])
+ result = urllib.parse.parse_qsl("key=\u0141%C3%A9", encoding="ascii")
+ self.assertEqual(result, [('key', '\u0141\ufffd\ufffd')])
+ result = urllib.parse.parse_qsl("key=\u0141%E9-", encoding="ascii")
+ self.assertEqual(result, [('key', '\u0141\ufffd-')])
+ result = urllib.parse.parse_qsl("key=\u0141%E9-", encoding="ascii",
+ errors="ignore")
+ self.assertEqual(result, [('key', '\u0141-')])
+
+
def test_main():
support.run_unittest(UrlParseTestCase)
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
index 9d0a8b118d..137c445eae 100644
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -39,8 +39,8 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
self.assertEqual(collections.UserDict.fromkeys('one two'.split(), 1), d5)
self.assertEqual(collections.UserDict().fromkeys('one two'.split(), 1), d5)
self.assertTrue(u1.fromkeys('one two'.split()) is not u1)
- self.assertTrue(isinstance(u1.fromkeys('one two'.split()), collections.UserDict))
- self.assertTrue(isinstance(u2.fromkeys('one two'.split()), collections.UserDict))
+ self.assertIsInstance(u1.fromkeys('one two'.split()), collections.UserDict)
+ self.assertIsInstance(u2.fromkeys('one two'.split()), collections.UserDict)
# Test __repr__
self.assertEqual(str(u0), str(d0))
@@ -95,7 +95,7 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
# Test "in".
for i in u2.keys():
- self.assertTrue(i in u2)
+ self.assertIn(i, u2)
self.assertEqual(i in u1, i in d1)
self.assertEqual(i in u0, i in d0)
@@ -122,7 +122,7 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
# Test setdefault
t = collections.UserDict()
self.assertEqual(t.setdefault("x", 42), 42)
- self.assertTrue("x" in t)
+ self.assertIn("x", t)
self.assertEqual(t.setdefault("x", 23), 42)
# Test pop
@@ -152,8 +152,8 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
d = D({1: 2, 3: 4})
self.assertEqual(d[1], 2)
self.assertEqual(d[3], 4)
- self.assertTrue(2 not in d)
- self.assertTrue(2 not in d.keys())
+ self.assertNotIn(2, d)
+ self.assertNotIn(2, d.keys())
self.assertEqual(d[2], 42)
class E(collections.UserDict):
def __missing__(self, key):
diff --git a/Lib/test/test_userstring.py b/Lib/test/test_userstring.py
index 05381384bf..7a8b9323f8 100755
--- a/Lib/test/test_userstring.py
+++ b/Lib/test/test_userstring.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# UserString is a wrapper around the native builtin string type.
# UserString instances should behave similar to builtin string objects.
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index 65a1a28726..dbf30e985c 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -4,7 +4,6 @@ import os
from io import StringIO
import sys
import unittest
-import tempfile
import subprocess
from test import support
from test.script_helper import assert_python_ok
@@ -508,7 +507,7 @@ class _WarningsTests(BaseTest):
with support.captured_output('stderr') as stream:
self.module.warn(text)
result = stream.getvalue()
- self.assertTrue(text in result)
+ self.assertIn(text, result)
def test_showwarning_not_callable(self):
with original_warnings.catch_warnings(module=self.module):
@@ -669,18 +668,33 @@ class CatchWarningTests(BaseTest):
def test_check_warnings(self):
# Explicit tests for the test.support convenience wrapper
wmod = self.module
- if wmod is sys.modules['warnings']:
- with support.check_warnings() as w:
- self.assertEqual(w.warnings, [])
- wmod.simplefilter("always")
+ if wmod is not sys.modules['warnings']:
+ return
+ with support.check_warnings(quiet=False) as w:
+ self.assertEqual(w.warnings, [])
+ wmod.simplefilter("always")
+ wmod.warn("foo")
+ self.assertEqual(str(w.message), "foo")
+ wmod.warn("bar")
+ self.assertEqual(str(w.message), "bar")
+ self.assertEqual(str(w.warnings[0].message), "foo")
+ self.assertEqual(str(w.warnings[1].message), "bar")
+ w.reset()
+ self.assertEqual(w.warnings, [])
+
+ with support.check_warnings():
+ # defaults to quiet=True without argument
+ pass
+ with support.check_warnings(('foo', UserWarning)):
+ wmod.warn("foo")
+
+ with self.assertRaises(AssertionError):
+ with support.check_warnings(('', RuntimeWarning)):
+ # defaults to quiet=False with argument
+ pass
+ with self.assertRaises(AssertionError):
+ with support.check_warnings(('foo', RuntimeWarning)):
wmod.warn("foo")
- self.assertEqual(str(w.message), "foo")
- wmod.warn("bar")
- self.assertEqual(str(w.message), "bar")
- self.assertEqual(str(w.warnings[0].message), "foo")
- self.assertEqual(str(w.warnings[1].message), "bar")
- w.reset()
- self.assertEqual(w.warnings, [])
class CCatchWarningTests(CatchWarningTests):
module = c_warnings
@@ -689,32 +703,76 @@ class PyCatchWarningTests(CatchWarningTests):
module = py_warnings
+class EnvironmentVariableTests(BaseTest):
+
+ def test_single_warning(self):
+ newenv = os.environ.copy()
+ newenv["PYTHONWARNINGS"] = "ignore::DeprecationWarning"
+ p = subprocess.Popen([sys.executable,
+ "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+ stdout=subprocess.PIPE, env=newenv)
+ self.assertEqual(p.communicate()[0], b"['ignore::DeprecationWarning']")
+ self.assertEqual(p.wait(), 0)
+
+ def test_comma_separated_warnings(self):
+ newenv = os.environ.copy()
+ newenv["PYTHONWARNINGS"] = ("ignore::DeprecationWarning,"
+ "ignore::UnicodeWarning")
+ p = subprocess.Popen([sys.executable,
+ "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+ stdout=subprocess.PIPE, env=newenv)
+ self.assertEqual(p.communicate()[0],
+ b"['ignore::DeprecationWarning', 'ignore::UnicodeWarning']")
+ self.assertEqual(p.wait(), 0)
+
+ def test_envvar_and_command_line(self):
+ newenv = os.environ.copy()
+ newenv["PYTHONWARNINGS"] = "ignore::DeprecationWarning"
+ p = subprocess.Popen([sys.executable, "-W" "ignore::UnicodeWarning",
+ "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+ stdout=subprocess.PIPE, env=newenv)
+ self.assertEqual(p.communicate()[0],
+ b"['ignore::UnicodeWarning', 'ignore::DeprecationWarning']")
+ self.assertEqual(p.wait(), 0)
+
+ @unittest.skipUnless(sys.getfilesystemencoding() != 'ascii',
+ 'requires non-ascii filesystemencoding')
+ def test_nonascii(self):
+ newenv = os.environ.copy()
+ newenv["PYTHONWARNINGS"] = "ignore:DeprecaciónWarning"
+ newenv["PYTHONIOENCODING"] = "utf-8"
+ p = subprocess.Popen([sys.executable,
+ "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+ stdout=subprocess.PIPE, env=newenv)
+ self.assertEqual(p.communicate()[0],
+ "['ignore:DeprecaciónWarning']".encode('utf-8'))
+ self.assertEqual(p.wait(), 0)
+
+class CEnvironmentVariableTests(EnvironmentVariableTests):
+ module = c_warnings
+
+class PyEnvironmentVariableTests(EnvironmentVariableTests):
+ module = py_warnings
+
+
class BootstrapTest(unittest.TestCase):
def test_issue_8766(self):
# "import encodings" emits a warning whereas the warnings is not loaded
# or not completely loaded (warnings imports indirectly encodings by
# importing linecache) yet
- cwd = tempfile.mkdtemp()
- try:
- encodings = os.path.join(cwd, 'encodings')
- os.mkdir(encodings)
- try:
- env = os.environ.copy()
- env['PYTHONPATH'] = cwd
-
- # encodings loaded by initfsencoding()
- retcode = subprocess.call([sys.executable, '-c', 'pass'], env=env)
- self.assertEqual(retcode, 0)
-
- # Use -W to load warnings module at startup
- retcode = subprocess.call(
- [sys.executable, '-c', 'pass', '-W', 'always'],
- env=env)
- self.assertEqual(retcode, 0)
- finally:
- os.rmdir(encodings)
- finally:
- os.rmdir(cwd)
+ with support.temp_cwd() as cwd, support.temp_cwd('encodings'):
+ env = os.environ.copy()
+ env['PYTHONPATH'] = cwd
+
+ # encodings loaded by initfsencoding()
+ retcode = subprocess.call([sys.executable, '-c', 'pass'], env=env)
+ self.assertEqual(retcode, 0)
+
+ # Use -W to load warnings module at startup
+ retcode = subprocess.call(
+ [sys.executable, '-c', 'pass', '-W', 'always'],
+ env=env)
+ self.assertEqual(retcode, 0)
def test_main():
py_warnings.onceregistry.clear()
@@ -726,6 +784,7 @@ def test_main():
_WarningsTests,
CWarningsDisplayTests, PyWarningsDisplayTests,
CCatchWarningTests, PyCatchWarningTests,
+ CEnvironmentVariableTests, PyEnvironmentVariableTests,
BootstrapTest,
)
diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py
index 1bcaa242c0..e0aace495c 100644
--- a/Lib/test/test_wave.py
+++ b/Lib/test/test_wave.py
@@ -22,11 +22,14 @@ class TestWave(unittest.TestCase):
except OSError:
pass
- def test_it(self):
+ def test_it(self, test_rounding=False):
self.f = wave.open(TESTFN, 'wb')
self.f.setnchannels(nchannels)
self.f.setsampwidth(sampwidth)
- self.f.setframerate(framerate)
+ if test_rounding:
+ self.f.setframerate(framerate - 0.1)
+ else:
+ self.f.setframerate(framerate)
self.f.setnframes(nframes)
output = b'\0' * nframes * nchannels * sampwidth
self.f.writeframes(output)
@@ -39,6 +42,13 @@ class TestWave(unittest.TestCase):
self.assertEqual(nframes, self.f.getnframes())
self.assertEqual(self.f.readframes(nframes), output)
+ def test_fractional_framerate(self):
+ """
+ Addresses [ 1512791 ] module wave does no rounding
+ Floating point framerates should be rounded, rather than truncated.
+ """
+ self.test_it(test_rounding=True)
+
def test_issue7681(self):
self.f = wave.open(TESTFN, 'wb')
self.f.setnchannels(nchannels)
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 028b418298..8b5bbc3d36 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -169,8 +169,7 @@ class ReferencesTestCase(TestBase):
p[:] = [2, 3]
self.assertEqual(len(L), 2)
self.assertEqual(len(p), 2)
- self.assertTrue(3 in p,
- "proxy didn't support __contains__() properly")
+ self.assertIn(3, p, "proxy didn't support __contains__() properly")
p[1] = 5
self.assertEqual(L[1], 5)
self.assertEqual(p[1], 5)
@@ -193,7 +192,7 @@ class ReferencesTestCase(TestBase):
def __bytes__(self):
return b"bytes"
instance = C()
- self.assertTrue("__bytes__" in dir(weakref.proxy(instance)))
+ self.assertIn("__bytes__", dir(weakref.proxy(instance)))
self.assertEqual(bytes(weakref.proxy(instance)), b"bytes")
def test_proxy_index(self):
@@ -681,6 +680,18 @@ class ReferencesTestCase(TestBase):
# No exception should be raised here
gc.collect()
+ def test_classes(self):
+ # Check that classes are weakrefable.
+ class A(object):
+ pass
+ l = []
+ weakref.ref(int)
+ a = weakref.ref(A, l.append)
+ A = None
+ gc.collect()
+ self.assertEqual(a(), None)
+ self.assertEqual(l, [a])
+
class SubclassableWeakrefTestCase(TestBase):
@@ -715,8 +726,8 @@ class SubclassableWeakrefTestCase(TestBase):
refs = weakref.getweakrefs(o)
self.assertEqual(len(refs), 3)
self.assertTrue(r2 is refs[0])
- self.assertTrue(r1 in refs[1:])
- self.assertTrue(r3 in refs[1:])
+ self.assertIn(r1, refs[1:])
+ self.assertIn(r3, refs[1:])
def test_subclass_refs_dont_conflate_callbacks(self):
class MyRef(weakref.ref):
@@ -726,8 +737,8 @@ class SubclassableWeakrefTestCase(TestBase):
r2 = MyRef(o, str)
self.assertTrue(r1 is not r2)
refs = weakref.getweakrefs(o)
- self.assertTrue(r1 in refs)
- self.assertTrue(r2 in refs)
+ self.assertIn(r1, refs)
+ self.assertIn(r2, refs)
def test_subclass_refs_with_slots(self):
class MyRef(weakref.ref):
@@ -860,8 +871,8 @@ class MappingTestCase(TestBase):
"deleting the keys did not clear the dictionary")
o = Object(42)
dict[o] = "What is the meaning of the universe?"
- self.assertTrue(o in dict)
- self.assertTrue(34 not in dict)
+ self.assertIn(o, dict)
+ self.assertNotIn(34, dict)
def test_weak_keyed_iters(self):
dict, objects = self.make_weak_keyed_dict()
@@ -873,8 +884,8 @@ class MappingTestCase(TestBase):
objects2 = list(objects)
for wr in refs:
ob = wr()
- self.assertTrue(ob in dict)
- self.assertTrue(ob in dict)
+ self.assertIn(ob, dict)
+ self.assertIn(ob, dict)
self.assertEqual(ob.arg, dict[ob])
objects2.remove(ob)
self.assertEqual(len(objects2), 0)
@@ -884,8 +895,8 @@ class MappingTestCase(TestBase):
self.assertEqual(len(list(dict.keyrefs())), len(objects))
for wr in dict.keyrefs():
ob = wr()
- self.assertTrue(ob in dict)
- self.assertTrue(ob in dict)
+ self.assertIn(ob, dict)
+ self.assertIn(ob, dict)
self.assertEqual(ob.arg, dict[ob])
objects2.remove(ob)
self.assertEqual(len(objects2), 0)
@@ -961,13 +972,13 @@ class MappingTestCase(TestBase):
# weakref'ed objects and then return a new key/value pair corresponding
# to the destroyed object.
with testcontext() as (k, v):
- self.assertFalse(k in dict)
+ self.assertNotIn(k, dict)
with testcontext() as (k, v):
self.assertRaises(KeyError, dict.__delitem__, k)
- self.assertFalse(k in dict)
+ self.assertNotIn(k, dict)
with testcontext() as (k, v):
self.assertRaises(KeyError, dict.pop, k)
- self.assertFalse(k in dict)
+ self.assertNotIn(k, dict)
with testcontext() as (k, v):
dict[k] = v
self.assertEqual(dict[k], v)
@@ -1091,13 +1102,13 @@ class MappingTestCase(TestBase):
weakdict = klass()
o = weakdict.setdefault(key, value1)
self.assertTrue(o is value1)
- self.assertTrue(key in weakdict)
+ self.assertIn(key, weakdict)
self.assertTrue(weakdict.get(key) is value1)
self.assertTrue(weakdict[key] is value1)
o = weakdict.setdefault(key, value2)
self.assertTrue(o is value1)
- self.assertTrue(key in weakdict)
+ self.assertIn(key, weakdict)
self.assertTrue(weakdict.get(key) is value1)
self.assertTrue(weakdict[key] is value1)
@@ -1118,14 +1129,12 @@ class MappingTestCase(TestBase):
weakdict.update(dict)
self.assertEqual(len(weakdict), len(dict))
for k in weakdict.keys():
- self.assertTrue(k in dict,
- "mysterious new key appeared in weak dict")
+ self.assertIn(k, dict, "mysterious new key appeared in weak dict")
v = dict.get(k)
self.assertTrue(v is weakdict[k])
self.assertTrue(v is weakdict.get(k))
for k in dict.keys():
- self.assertTrue(k in weakdict,
- "original key disappeared in weak dict")
+ self.assertIn(k, weakdict, "original key disappeared in weak dict")
v = dict[k]
self.assertTrue(v is weakdict[k])
self.assertTrue(v is weakdict.get(k))
diff --git a/Lib/test/test_weakset.py b/Lib/test/test_weakset.py
index e587898d13..58a1f8790a 100644
--- a/Lib/test/test_weakset.py
+++ b/Lib/test/test_weakset.py
@@ -35,7 +35,7 @@ class TestWeakSet(unittest.TestCase):
for method in dir(set):
if method == 'test_c_api' or method.startswith('_'):
continue
- self.assertTrue(method in weaksetmethods,
+ self.assertIn(method, weaksetmethods,
"WeakSet missing method " + method)
def test_new_or_init(self):
@@ -52,9 +52,9 @@ class TestWeakSet(unittest.TestCase):
self.assertEqual(c in self.s, c in self.d)
# 1 is not weakref'able, but that TypeError is caught by __contains__
self.assertNotIn(1, self.s)
- self.assertTrue(self.obj in self.fs)
+ self.assertIn(self.obj, self.fs)
del self.obj
- self.assertTrue(ustr('F') not in self.fs)
+ self.assertNotIn(ustr('F'), self.fs)
def test_union(self):
u = self.s.union(self.items2)
@@ -151,7 +151,7 @@ class TestWeakSet(unittest.TestCase):
s=H()
f=set()
f.add(s)
- self.assertTrue(s in f)
+ self.assertIn(s, f)
f.remove(s)
f.add(s)
f.discard(s)
@@ -186,7 +186,7 @@ class TestWeakSet(unittest.TestCase):
def test_add(self):
x = ustr('Q')
self.s.add(x)
- self.assertTrue(x in self.s)
+ self.assertIn(x, self.s)
dup = self.s.copy()
self.s.add(x)
self.assertEqual(self.s, dup)
@@ -199,66 +199,66 @@ class TestWeakSet(unittest.TestCase):
def test_remove(self):
x = ustr('a')
self.s.remove(x)
- self.assertTrue(x not in self.s)
+ self.assertNotIn(x, self.s)
self.assertRaises(KeyError, self.s.remove, x)
self.assertRaises(TypeError, self.s.remove, [])
def test_discard(self):
a, q = ustr('a'), ustr('Q')
self.s.discard(a)
- self.assertTrue(a not in self.s)
+ self.assertNotIn(a, self.s)
self.s.discard(q)
self.assertRaises(TypeError, self.s.discard, [])
def test_pop(self):
for i in range(len(self.s)):
elem = self.s.pop()
- self.assertTrue(elem not in self.s)
+ self.assertNotIn(elem, self.s)
self.assertRaises(KeyError, self.s.pop)
def test_update(self):
retval = self.s.update(self.items2)
self.assertEqual(retval, None)
for c in (self.items + self.items2):
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
self.assertRaises(TypeError, self.s.update, [[]])
def test_update_set(self):
self.s.update(set(self.items2))
for c in (self.items + self.items2):
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
def test_ior(self):
self.s |= set(self.items2)
for c in (self.items + self.items2):
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
def test_intersection_update(self):
retval = self.s.intersection_update(self.items2)
self.assertEqual(retval, None)
for c in (self.items + self.items2):
if c in self.items2 and c in self.items:
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
self.assertRaises(TypeError, self.s.intersection_update, [[]])
def test_iand(self):
self.s &= set(self.items2)
for c in (self.items + self.items2):
if c in self.items2 and c in self.items:
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
def test_difference_update(self):
retval = self.s.difference_update(self.items2)
self.assertEqual(retval, None)
for c in (self.items + self.items2):
if c in self.items and c not in self.items2:
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
self.assertRaises(TypeError, self.s.difference_update, [[]])
self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])
@@ -266,27 +266,27 @@ class TestWeakSet(unittest.TestCase):
self.s -= set(self.items2)
for c in (self.items + self.items2):
if c in self.items and c not in self.items2:
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
def test_symmetric_difference_update(self):
retval = self.s.symmetric_difference_update(self.items2)
self.assertEqual(retval, None)
for c in (self.items + self.items2):
if (c in self.items) ^ (c in self.items2):
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])
def test_ixor(self):
self.s ^= set(self.items2)
for c in (self.items + self.items2):
if (c in self.items) ^ (c in self.items2):
- self.assertTrue(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assertTrue(c not in self.s)
+ self.assertNotIn(c, self.s)
def test_inplace_on_self(self):
t = self.s.copy()
@@ -343,13 +343,13 @@ class TestWeakSet(unittest.TestCase):
it = None # should commit all removals
with testcontext() as u:
- self.assertFalse(u in s)
+ self.assertNotIn(u, s)
with testcontext() as u:
self.assertRaises(KeyError, s.remove, u)
- self.assertFalse(u in s)
+ self.assertNotIn(u, s)
with testcontext() as u:
s.add(u)
- self.assertTrue(u in s)
+ self.assertIn(u, s)
t = s.copy()
with testcontext() as u:
s.update(t)
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py
index f898bf7405..0c1bf29463 100644
--- a/Lib/test/test_winreg.py
+++ b/Lib/test/test_winreg.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
@@ -6,13 +5,32 @@ import os, sys
import unittest
from test import support
threading = support.import_module("threading")
+from platform import machine
# Do this first so test will be skipped if module doesn't exist
support.import_module('winreg')
# Now import everything
from winreg import *
+try:
+ REMOTE_NAME = sys.argv[sys.argv.index("--remote")+1]
+except (IndexError, ValueError):
+ REMOTE_NAME = None
+
+# tuple of (major, minor)
+WIN_VER = sys.getwindowsversion()[:2]
+# Some tests should only run on 64-bit architectures where WOW64 will be.
+WIN64_MACHINE = True if machine() == "AMD64" else False
+
+# Starting with Windows 7 and Windows Server 2008 R2, WOW64 no longer uses
+# registry reflection and formerly reflected keys are shared instead.
+# Windows 7 and Windows Server 2008 R2 are version 6.1. Due to this, some
+# tests are only valid up until 6.1
+HAS_REFLECTION = True if WIN_VER < (6, 1) else False
+
test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me"
+# On OS'es that support reflection we should test with a reflected key
+test_reflect_key_name = "SOFTWARE\\Classes\\Python Test Key - Delete Me"
test_data = [
("Int Value", 45, REG_DWORD),
@@ -26,8 +44,7 @@ test_data = [
("Japanese 日本", "日本語", REG_SZ),
]
-class WinregTests(unittest.TestCase):
- remote_name = None
+class BaseWinregTests(unittest.TestCase):
def setUp(self):
# Make sure that the test key is absent when the test
@@ -50,7 +67,8 @@ class WinregTests(unittest.TestCase):
CloseKey(hkey)
DeleteKey(root, subkey)
- def WriteTestData(self, root_key, subkeystr="sub_key"):
+ def _write_test_data(self, root_key, subkeystr="sub_key",
+ CreateKey=CreateKey):
# Set the default value for this key.
SetValue(root_key, test_key_name, REG_SZ, "Default value")
key = CreateKey(root_key, test_key_name)
@@ -91,7 +109,7 @@ class WinregTests(unittest.TestCase):
except EnvironmentError:
pass
- def ReadTestData(self, root_key, subkeystr="sub_key"):
+ def _read_test_data(self, root_key, subkeystr="sub_key", OpenKey=OpenKey):
# Check we can get default value for this key.
val = QueryValue(root_key, test_key_name)
self.assertEqual(val, "Default value",
@@ -131,7 +149,7 @@ class WinregTests(unittest.TestCase):
key.Close()
- def DeleteTestData(self, root_key, subkeystr="sub_key"):
+ def _delete_test_data(self, root_key, subkeystr="sub_key"):
key = OpenKey(root_key, test_key_name, 0, KEY_ALL_ACCESS)
sub_key = OpenKey(key, subkeystr, 0, KEY_ALL_ACCESS)
# It is not necessary to delete the values before deleting
@@ -161,31 +179,70 @@ class WinregTests(unittest.TestCase):
except WindowsError: # Use this error name this time
pass
- def TestAll(self, root_key, subkeystr="sub_key"):
- self.WriteTestData(root_key, subkeystr)
- self.ReadTestData(root_key, subkeystr)
- self.DeleteTestData(root_key, subkeystr)
+ def _test_all(self, root_key, subkeystr="sub_key"):
+ self._write_test_data(root_key, subkeystr)
+ self._read_test_data(root_key, subkeystr)
+ self._delete_test_data(root_key, subkeystr)
+
+ def _test_named_args(self, key, sub_key):
+ with CreateKeyEx(key=key, sub_key=sub_key, reserved=0,
+ access=KEY_ALL_ACCESS) as ckey:
+ self.assertTrue(ckey.handle != 0)
+
+ with OpenKeyEx(key=key, sub_key=sub_key, reserved=0,
+ access=KEY_ALL_ACCESS) as okey:
+ self.assertTrue(okey.handle != 0)
+
+
+class LocalWinregTests(BaseWinregTests):
+
+ def test_registry_works(self):
+ self._test_all(HKEY_CURRENT_USER)
+ self._test_all(HKEY_CURRENT_USER, "日本-subkey")
+
+ def test_registry_works_extended_functions(self):
+ # Substitute the regular CreateKey and OpenKey calls with their
+ # extended counterparts.
+ # Note: DeleteKeyEx is not used here because it is platform dependent
+ cke = lambda key, sub_key: CreateKeyEx(key, sub_key, 0, KEY_ALL_ACCESS)
+ self._write_test_data(HKEY_CURRENT_USER, CreateKey=cke)
+
+ oke = lambda key, sub_key: OpenKeyEx(key, sub_key, 0, KEY_READ)
+ self._read_test_data(HKEY_CURRENT_USER, OpenKey=oke)
+
+ self._delete_test_data(HKEY_CURRENT_USER)
- def testLocalMachineRegistryWorks(self):
- self.TestAll(HKEY_CURRENT_USER)
- self.TestAll(HKEY_CURRENT_USER, "日本-subkey")
+ def test_named_arguments(self):
+ self._test_named_args(HKEY_CURRENT_USER, test_key_name)
+ # Use the regular DeleteKey to clean up
+ # DeleteKeyEx takes named args and is tested separately
+ DeleteKey(HKEY_CURRENT_USER, test_key_name)
- def testConnectRegistryToLocalMachineWorks(self):
+ def test_connect_registry_to_local_machine_works(self):
# perform minimal ConnectRegistry test which just invokes it
h = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
+ self.assertNotEqual(h.handle, 0)
h.Close()
+ self.assertEqual(h.handle, 0)
- def testRemoteMachineRegistryWorks(self):
- if not self.remote_name:
- return # remote machine name not specified
- remote_key = ConnectRegistry(self.remote_name, HKEY_CURRENT_USER)
- self.TestAll(remote_key)
+ def test_inexistant_remote_registry(self):
+ connect = lambda: ConnectRegistry("abcdefghijkl", HKEY_CURRENT_USER)
+ self.assertRaises(WindowsError, connect)
def testExpandEnvironmentStrings(self):
r = ExpandEnvironmentStrings("%windir%\\test")
self.assertEqual(type(r), str)
self.assertEqual(r, os.environ["windir"] + "\\test")
+ def test_context_manager(self):
+ # ensure that the handle is closed if an exception occurs
+ try:
+ with ConnectRegistry(None, HKEY_LOCAL_MACHINE) as h:
+ self.assertNotEqual(h.handle, 0)
+ raise WindowsError
+ except WindowsError:
+ self.assertEqual(h.handle, 0)
+
def test_changing_value(self):
# Issue2810: A race condition in 2.6 and 3.1 may cause
# EnumValue or QueryValue to throw "WindowsError: More data is
@@ -238,15 +295,137 @@ class WinregTests(unittest.TestCase):
EnumValue(HKEY_PERFORMANCE_DATA, 0)
QueryValueEx(HKEY_PERFORMANCE_DATA, "")
+ # Reflection requires XP x64/Vista at a minimum. XP doesn't have this stuff
+ # or DeleteKeyEx so make sure their use raises NotImplementedError
+ @unittest.skipUnless(WIN_VER < (5, 2), "Requires Windows XP")
+ def test_reflection_unsupported(self):
+ try:
+ with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck:
+ self.assertNotEqual(ck.handle, 0)
+
+ key = OpenKey(HKEY_CURRENT_USER, test_key_name)
+ self.assertNotEqual(key.handle, 0)
+
+ with self.assertRaises(NotImplementedError):
+ DisableReflectionKey(key)
+ with self.assertRaises(NotImplementedError):
+ EnableReflectionKey(key)
+ with self.assertRaises(NotImplementedError):
+ QueryReflectionKey(key)
+ with self.assertRaises(NotImplementedError):
+ DeleteKeyEx(HKEY_CURRENT_USER, test_key_name)
+ finally:
+ DeleteKey(HKEY_CURRENT_USER, test_key_name)
+
+
+@unittest.skipUnless(REMOTE_NAME, "Skipping remote registry tests")
+class RemoteWinregTests(BaseWinregTests):
+
+ def test_remote_registry_works(self):
+ remote_key = ConnectRegistry(REMOTE_NAME, HKEY_CURRENT_USER)
+ self._test_all(remote_key)
+
+
+@unittest.skipUnless(WIN64_MACHINE, "x64 specific registry tests")
+class Win64WinregTests(BaseWinregTests):
+
+ def test_named_arguments(self):
+ self._test_named_args(HKEY_CURRENT_USER, test_key_name)
+ # Clean up and also exercise the named arguments
+ DeleteKeyEx(key=HKEY_CURRENT_USER, sub_key=test_key_name,
+ access=KEY_ALL_ACCESS, reserved=0)
+
+ def test_reflection_functions(self):
+ # Test that we can call the query, enable, and disable functions
+ # on a key which isn't on the reflection list with no consequences.
+ with OpenKey(HKEY_LOCAL_MACHINE, "Software") as key:
+ # HKLM\Software is redirected but not reflected in all OSes
+ self.assertTrue(QueryReflectionKey(key))
+ self.assertIsNone(EnableReflectionKey(key))
+ self.assertIsNone(DisableReflectionKey(key))
+ self.assertTrue(QueryReflectionKey(key))
+
+ @unittest.skipUnless(HAS_REFLECTION, "OS doesn't support reflection")
+ def test_reflection(self):
+ # Test that we can create, open, and delete keys in the 32-bit
+ # area. Because we are doing this in a key which gets reflected,
+ # test the differences of 32 and 64-bit keys before and after the
+ # reflection occurs (ie. when the created key is closed).
+ try:
+ with CreateKeyEx(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_ALL_ACCESS | KEY_WOW64_32KEY) as created_key:
+ self.assertNotEqual(created_key.handle, 0)
+
+ # The key should now be available in the 32-bit area
+ with OpenKey(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_ALL_ACCESS | KEY_WOW64_32KEY) as key:
+ self.assertNotEqual(key.handle, 0)
+
+ # Write a value to what currently is only in the 32-bit area
+ SetValueEx(created_key, "", 0, REG_SZ, "32KEY")
+
+ # The key is not reflected until created_key is closed.
+ # The 64-bit version of the key should not be available yet.
+ open_fail = lambda: OpenKey(HKEY_CURRENT_USER,
+ test_reflect_key_name, 0,
+ KEY_READ | KEY_WOW64_64KEY)
+ self.assertRaises(WindowsError, open_fail)
+
+ # Now explicitly open the 64-bit version of the key
+ with OpenKey(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_ALL_ACCESS | KEY_WOW64_64KEY) as key:
+ self.assertNotEqual(key.handle, 0)
+ # Make sure the original value we set is there
+ self.assertEqual("32KEY", QueryValue(key, ""))
+ # Set a new value, which will get reflected to 32-bit
+ SetValueEx(key, "", 0, REG_SZ, "64KEY")
+
+ # Reflection uses a "last-writer wins policy, so the value we set
+ # on the 64-bit key should be the same on 32-bit
+ with OpenKey(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_READ | KEY_WOW64_32KEY) as key:
+ self.assertEqual("64KEY", QueryValue(key, ""))
+ finally:
+ DeleteKeyEx(HKEY_CURRENT_USER, test_reflect_key_name,
+ KEY_WOW64_32KEY, 0)
+
+ @unittest.skipUnless(HAS_REFLECTION, "OS doesn't support reflection")
+ def test_disable_reflection(self):
+ # Make use of a key which gets redirected and reflected
+ try:
+ with CreateKeyEx(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_ALL_ACCESS | KEY_WOW64_32KEY) as created_key:
+ # QueryReflectionKey returns whether or not the key is disabled
+ disabled = QueryReflectionKey(created_key)
+ self.assertEqual(type(disabled), bool)
+ # HKCU\Software\Classes is reflected by default
+ self.assertFalse(disabled)
+
+ DisableReflectionKey(created_key)
+ self.assertTrue(QueryReflectionKey(created_key))
+
+ # The key is now closed and would normally be reflected to the
+ # 64-bit area, but let's make sure that didn't happen.
+ open_fail = lambda: OpenKeyEx(HKEY_CURRENT_USER,
+ test_reflect_key_name, 0,
+ KEY_READ | KEY_WOW64_64KEY)
+ self.assertRaises(WindowsError, open_fail)
+
+ # Make sure the 32-bit key is actually there
+ with OpenKeyEx(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_READ | KEY_WOW64_32KEY) as key:
+ self.assertNotEqual(key.handle, 0)
+ finally:
+ DeleteKeyEx(HKEY_CURRENT_USER, test_reflect_key_name,
+ KEY_WOW64_32KEY, 0)
+
def test_main():
- support.run_unittest(WinregTests)
+ support.run_unittest(LocalWinregTests, RemoteWinregTests,
+ Win64WinregTests)
if __name__ == "__main__":
- try:
- WinregTests.remote_name = sys.argv[sys.argv.index("--remote")+1]
- except (IndexError, ValueError):
+ if not REMOTE_NAME:
print("Remote registry calls can be tested using",
"'test_winreg.py --remote \\\\machine_name'")
- WinregTests.remote_name = None
test_main()
diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py
index be0e625629..34c3deaf7e 100644
--- a/Lib/test/test_winsound.py
+++ b/Lib/test/test_winsound.py
@@ -249,6 +249,7 @@ def _have_soundcard():
p = subprocess.Popen([cscript_path, check_script],
stdout=subprocess.PIPE)
__have_soundcard_cache = not p.wait()
+ p.stdout.close()
return __have_soundcard_cache
diff --git a/Lib/test/test_with.py b/Lib/test/test_with.py
index 66ff3b21f3..e8cc8c056e 100644
--- a/Lib/test/test_with.py
+++ b/Lib/test/test_with.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unit tests for the with statement specified in PEP 343."""
@@ -9,31 +9,31 @@ __email__ = "mbland at acm dot org"
import sys
import unittest
from collections import deque
-from contextlib import GeneratorContextManager, contextmanager
+from contextlib import _GeneratorContextManager, contextmanager
from test.support import run_unittest
-class MockContextManager(GeneratorContextManager):
- def __init__(self, gen):
- GeneratorContextManager.__init__(self, gen)
+class MockContextManager(_GeneratorContextManager):
+ def __init__(self, func, *args, **kwds):
+ super().__init__(func, *args, **kwds)
self.enter_called = False
self.exit_called = False
self.exit_args = None
def __enter__(self):
self.enter_called = True
- return GeneratorContextManager.__enter__(self)
+ return _GeneratorContextManager.__enter__(self)
def __exit__(self, type, value, traceback):
self.exit_called = True
self.exit_args = (type, value, traceback)
- return GeneratorContextManager.__exit__(self, type,
- value, traceback)
+ return _GeneratorContextManager.__exit__(self, type,
+ value, traceback)
def mock_contextmanager(func):
def helper(*args, **kwds):
- return MockContextManager(func(*args, **kwds))
+ return MockContextManager(func, *args, **kwds)
return helper
@@ -215,11 +215,17 @@ class ContextmanagerAssertionMixin(object):
def raiseTestException(self):
raise self.TEST_EXCEPTION
- def assertAfterWithManagerInvariantsWithError(self, mock_manager):
+ def assertAfterWithManagerInvariantsWithError(self, mock_manager,
+ exc_type=None):
self.assertTrue(mock_manager.enter_called)
self.assertTrue(mock_manager.exit_called)
- self.assertEqual(mock_manager.exit_args[0], RuntimeError)
- self.assertEqual(mock_manager.exit_args[1], self.TEST_EXCEPTION)
+ if exc_type is None:
+ self.assertEqual(mock_manager.exit_args[1], self.TEST_EXCEPTION)
+ exc_type = type(self.TEST_EXCEPTION)
+ self.assertEqual(mock_manager.exit_args[0], exc_type)
+ # Test the __exit__ arguments. Issue #7853
+ self.assertIsInstance(mock_manager.exit_args[1], exc_type)
+ self.assertIsNot(mock_manager.exit_args[2], None)
def assertAfterWithGeneratorInvariantsWithError(self, mock_generator):
self.assertTrue(mock_generator.yielded)
@@ -285,15 +291,6 @@ class NestedNonexceptionalTestCase(unittest.TestCase,
with Nested(mock_contextmanager_generator()):
pass
- def testSingleArgUnbound(self):
- mock_contextmanager = mock_contextmanager_generator()
- mock_nested = MockNested(mock_contextmanager)
- with mock_nested:
- self.assertInWithManagerInvariants(mock_contextmanager)
- self.assertInWithManagerInvariants(mock_nested)
- self.assertAfterWithManagerInvariantsNoError(mock_contextmanager)
- self.assertAfterWithManagerInvariantsNoError(mock_nested)
-
def testSingleArgBoundToNonTuple(self):
m = mock_contextmanager_generator()
# This will bind all the arguments to nested() into a single list
@@ -366,6 +363,16 @@ class ExceptionalTestCase(ContextmanagerAssertionMixin, unittest.TestCase):
self.assertAfterWithManagerInvariantsWithError(cm)
self.assertAfterWithGeneratorInvariantsWithError(self.resource)
+ def testExceptionNormalized(self):
+ cm = mock_contextmanager_generator()
+ def shouldThrow():
+ with cm as self.resource:
+ # Note this relies on the fact that 1 // 0 produces an exception
+ # that is not normalized immediately.
+ 1 // 0
+ self.assertRaises(ZeroDivisionError, shouldThrow)
+ self.assertAfterWithManagerInvariantsWithError(cm, ZeroDivisionError)
+
def testNestedSingleStatements(self):
mock_a = mock_contextmanager_generator()
mock_b = mock_contextmanager_generator()
@@ -721,6 +728,7 @@ class NestedWith(unittest.TestCase):
body_executed = True
self.assertTrue(a.enter_called)
self.assertTrue(a.exit_called)
+ self.assertTrue(body_executed)
self.assertNotEqual(a.exc_info[0], None)
def testEnterReturnsTuple(self):
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index 3450163997..a08f66b7b4 100755..100644
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -47,7 +47,7 @@ def hello_app(environ,start_response):
('Content-Type','text/plain'),
('Date','Mon, 05 Jun 2006 18:49:54 GMT')
])
- return ["Hello, world!"]
+ return [b"Hello, world!"]
def run_amock(app=hello_app, data=b"GET / HTTP/1.0\n\n"):
server = make_server("", 80, app, MockServer, MockHandler)
@@ -131,7 +131,7 @@ class IntegrationTests(TestCase):
def check_hello(self, out, has_length=True):
self.assertEqual(out,
("HTTP/1.0 200 OK\r\n"
- "Server: WSGIServer/0.1 Python/"+sys.version.split()[0]+"\r\n"
+ "Server: WSGIServer/0.2 Python/"+sys.version.split()[0]+"\r\n"
"Content-Type: text/plain\r\n"
"Date: Mon, 05 Jun 2006 18:49:54 GMT\r\n" +
(has_length and "Content-Length: 13\r\n" or "") +
@@ -165,7 +165,7 @@ class IntegrationTests(TestCase):
def test_wsgi_input(self):
def bad_app(e,s):
e["wsgi.input"].read()
- s(b"200 OK", [(b"Content-Type", b"text/plain; charset=utf-8")])
+ s("200 OK", [("Content-Type", "text/plain; charset=utf-8")])
return [b"data"]
out, err = run_amock(validator(bad_app))
self.assertTrue(out.endswith(
@@ -177,8 +177,8 @@ class IntegrationTests(TestCase):
def test_bytes_validation(self):
def app(e, s):
- s(b"200 OK", [
- (b"Content-Type", b"text/plain; charset=utf-8"),
+ s("200 OK", [
+ ("Content-Type", "text/plain; charset=utf-8"),
("Date", "Wed, 24 Dec 2008 13:29:32 GMT"),
])
return [b"data"]
@@ -187,7 +187,7 @@ class IntegrationTests(TestCase):
ver = sys.version.split()[0].encode('ascii')
self.assertEqual(
b"HTTP/1.0 200 OK\r\n"
- b"Server: WSGIServer/0.1 Python/" + ver + b"\r\n"
+ b"Server: WSGIServer/0.2 Python/" + ver + b"\r\n"
b"Content-Type: text/plain; charset=utf-8\r\n"
b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n"
b"\r\n"
@@ -211,12 +211,12 @@ class UtilityTests(TestCase):
# Check defaulting when empty
env = {}
util.setup_testing_defaults(env)
- if isinstance(value,StringIO):
- self.assertTrue(isinstance(env[key],StringIO))
+ if isinstance(value, StringIO):
+ self.assertIsInstance(env[key], StringIO)
elif isinstance(value,BytesIO):
- self.assertTrue(isinstance(env[key],BytesIO))
+ self.assertIsInstance(env[key],BytesIO)
else:
- self.assertEqual(env[key],value)
+ self.assertEqual(env[key], value)
# Check existing value
env = {key:alt}
@@ -424,29 +424,6 @@ class HeaderTests(TestCase):
'\r\n'
)
- def testBytes(self):
- h = Headers([
- (b"Content-Type", b"text/plain; charset=utf-8"),
- ])
- self.assertEqual("text/plain; charset=utf-8", h.get("Content-Type"))
-
- h[b"Foo"] = bytes(b"bar")
- self.assertEqual("bar", h.get("Foo"))
- self.assertEqual("bar", h.get(b"Foo"))
-
- h.setdefault(b"Bar", b"foo")
- self.assertEqual("foo", h.get("Bar"))
- self.assertEqual("foo", h.get(b"Bar"))
-
- h.add_header(b'content-disposition', b'attachment',
- filename=b'bud.gif')
- self.assertEqual('attachment; filename="bud.gif"',
- h.get("content-disposition"))
-
- del h['content-disposition']
- self.assertTrue(b'content-disposition' not in h)
-
-
class ErrorHandler(BaseCGIHandler):
"""Simple handler subclass for testing BaseHandler"""
@@ -497,7 +474,7 @@ class HandlerTests(TestCase):
if k not in empty:
self.assertEqual(env[k],v)
for k,v in empty.items():
- self.assertTrue(k in env)
+ self.assertIn(k, env)
def testEnviron(self):
h = TestHandler(X="Y")
@@ -510,7 +487,7 @@ class HandlerTests(TestCase):
h = BaseCGIHandler(None,None,None,{})
h.setup_environ()
for key in 'wsgi.url_scheme', 'wsgi.input', 'wsgi.errors':
- self.assertTrue(key in h.environ)
+ self.assertIn(key, h.environ)
def testScheme(self):
h=TestHandler(HTTPS="on"); h.setup_environ()
@@ -533,10 +510,10 @@ class HandlerTests(TestCase):
def trivial_app1(e,s):
s('200 OK',[])
- return [e['wsgi.url_scheme']]
+ return [e['wsgi.url_scheme'].encode('iso-8859-1')]
def trivial_app2(e,s):
- s('200 OK',[])(e['wsgi.url_scheme'])
+ s('200 OK',[])(e['wsgi.url_scheme'].encode('iso-8859-1'))
return []
def trivial_app3(e,s):
@@ -601,13 +578,13 @@ class HandlerTests(TestCase):
("Status: %s\r\n"
"Content-Type: text/plain\r\n"
"Content-Length: %d\r\n"
- "\r\n%s" % (h.error_status,len(h.error_body),h.error_body)
- ).encode("iso-8859-1"))
+ "\r\n" % (h.error_status,len(h.error_body))).encode('iso-8859-1')
+ + h.error_body)
- self.assertTrue("AssertionError" in h.stderr.getvalue())
+ self.assertIn("AssertionError", h.stderr.getvalue())
def testErrorAfterOutput(self):
- MSG = "Some output has been sent"
+ MSG = b"Some output has been sent"
def error_app(e,s):
s("200 OK",[])(MSG)
raise AssertionError("This should be caught by handler")
@@ -616,8 +593,8 @@ class HandlerTests(TestCase):
h.run(error_app)
self.assertEqual(h.stdout.getvalue(),
("Status: 200 OK\r\n"
- "\r\n"+MSG).encode("iso-8859-1"))
- self.assertTrue("AssertionError" in h.stderr.getvalue())
+ "\r\n".encode("iso-8859-1")+MSG))
+ self.assertIn("AssertionError", h.stderr.getvalue())
def testHeaderFormats(self):
@@ -665,8 +642,8 @@ class HandlerTests(TestCase):
def testBytesData(self):
def app(e, s):
- s(b"200 OK", [
- (b"Content-Type", b"text/plain; charset=utf-8"),
+ s("200 OK", [
+ ("Content-Type", "text/plain; charset=utf-8"),
])
return [b"data"]
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index f2551d6d6b..22fafa9a2e 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -1,22 +1,52 @@
# xml.etree test. This file contains enough tests to make sure that
-# all included components work as they should. For a more extensive
-# test suite, see the selftest script in the ElementTree distribution.
+# all included components work as they should.
+# Large parts are extracted from the upstream test suite.
+
+# IMPORTANT: the same doctests are run from "test_xml_etree_c" in
+# order to ensure consistency between the C implementation and the
+# Python implementation.
+#
+# For this purpose, the module-level "ET" symbol is temporarily
+# monkey-patched when running the "test_xml_etree_c" test suite.
+# Don't re-import "xml.etree.ElementTree" module in the docstring,
+# except if the test is specific to the Python implementation.
-import doctest
import sys
+import html
+import unittest
from test import support
+from test.support import findfile
+
+from xml.etree import ElementTree as ET
-SAMPLE_XML = """
+SIMPLE_XMLFILE = findfile("simple.xml", subdir="xmltestdata")
+try:
+ SIMPLE_XMLFILE.encode("utf8")
+except UnicodeEncodeError:
+ raise unittest.SkipTest("filename is not encodable to utf8")
+SIMPLE_NS_XMLFILE = findfile("simple-ns.xml", subdir="xmltestdata")
+
+SAMPLE_XML = """\
<body>
- <tag>text</tag>
- <tag />
+ <tag class='a'>text</tag>
+ <tag class='b' />
<section>
- <tag>subtext</tag>
+ <tag class='b' id='inner'>subtext</tag>
</section>
</body>
"""
+SAMPLE_SECTION = """\
+<section>
+ <tag class='b' id='inner'>subtext</tag>
+ <nexttag />
+ <nextsection>
+ <tag />
+ </nextsection>
+</section>
+"""
+
SAMPLE_XML_NS = """
<body xmlns="http://effbot.org/ns">
<tag>text</tag>
@@ -27,6 +57,7 @@ SAMPLE_XML_NS = """
</body>
"""
+
def sanity():
"""
Import sanity.
@@ -40,35 +71,110 @@ def check_method(method):
if not hasattr(method, '__call__'):
print(method, "not callable")
-def serialize(ET, elem):
+def serialize(elem, to_string=True, encoding='unicode', **options):
import io
+ if encoding != 'unicode':
+ file = io.BytesIO()
+ else:
+ file = io.StringIO()
tree = ET.ElementTree(elem)
- file = io.StringIO()
- tree.write(file)
- return file.getvalue()
+ tree.write(file, encoding=encoding, **options)
+ if to_string:
+ return file.getvalue()
+ else:
+ file.seek(0)
+ return file
def summarize(elem):
+ if elem.tag == ET.Comment:
+ return "<Comment>"
return elem.tag
def summarize_list(seq):
- return list(map(summarize, seq))
+ return [summarize(elem) for elem in seq]
+
+def normalize_crlf(tree):
+ for elem in tree.iter():
+ if elem.text:
+ elem.text = elem.text.replace("\r\n", "\n")
+ if elem.tail:
+ elem.tail = elem.tail.replace("\r\n", "\n")
+
+def normalize_exception(func, *args, **kwargs):
+ # Ignore the exception __module__
+ try:
+ func(*args, **kwargs)
+ except Exception as err:
+ print("Traceback (most recent call last):")
+ print("{}: {}".format(err.__class__.__name__, err))
+
+def check_string(string):
+ len(string)
+ for char in string:
+ if len(char) != 1:
+ print("expected one-character string, got %r" % char)
+ new_string = string + ""
+ new_string = string + " "
+ string[:0]
+
+def check_mapping(mapping):
+ len(mapping)
+ keys = mapping.keys()
+ items = mapping.items()
+ for key in keys:
+ item = mapping[key]
+ mapping["key"] = "value"
+ if mapping["key"] != "value":
+ print("expected value string, got %r" % mapping["key"])
+
+def check_element(element):
+ if not ET.iselement(element):
+ print("not an element")
+ if not hasattr(element, "tag"):
+ print("no tag member")
+ if not hasattr(element, "attrib"):
+ print("no attrib member")
+ if not hasattr(element, "text"):
+ print("no text member")
+ if not hasattr(element, "tail"):
+ print("no tail member")
+
+ check_string(element.tag)
+ check_mapping(element.attrib)
+ if element.text is not None:
+ check_string(element.text)
+ if element.tail is not None:
+ check_string(element.tail)
+ for elem in element:
+ check_element(elem)
+
+# --------------------------------------------------------------------
+# element tree tests
def interface():
"""
Test element tree interface.
- >>> from xml.etree import ElementTree as ET
+ >>> element = ET.Element("tag")
+ >>> check_element(element)
+ >>> tree = ET.ElementTree(element)
+ >>> check_element(tree.getroot())
- >>> element = ET.Element("tag", key="value")
+ >>> element = ET.Element("t\\xe4g", key="value")
>>> tree = ET.ElementTree(element)
+ >>> repr(element) # doctest: +ELLIPSIS
+ "<Element 't\\xe4g' at 0x...>"
+ >>> element = ET.Element("tag", key="value")
Make sure all standard element methods exist.
>>> check_method(element.append)
+ >>> check_method(element.extend)
>>> check_method(element.insert)
>>> check_method(element.remove)
>>> check_method(element.getchildren)
>>> check_method(element.find)
+ >>> check_method(element.iterfind)
>>> check_method(element.findall)
>>> check_method(element.findtext)
>>> check_method(element.clear)
@@ -76,112 +182,134 @@ def interface():
>>> check_method(element.set)
>>> check_method(element.keys)
>>> check_method(element.items)
+ >>> check_method(element.iter)
+ >>> check_method(element.itertext)
>>> check_method(element.getiterator)
+ These methods return an iterable. See bug 6472.
+
+ >>> check_method(element.iter("tag").__next__)
+ >>> check_method(element.iterfind("tag").__next__)
+ >>> check_method(element.iterfind("*").__next__)
+ >>> check_method(tree.iter("tag").__next__)
+ >>> check_method(tree.iterfind("tag").__next__)
+ >>> check_method(tree.iterfind("*").__next__)
+
+ These aliases are provided:
+
+ >>> assert ET.XML == ET.fromstring
+ >>> assert ET.PI == ET.ProcessingInstruction
+ >>> assert ET.XMLParser == ET.XMLTreeBuilder
+ """
+
+def simpleops():
+ """
Basic method sanity checks.
- >>> serialize(ET, element) # 1
+ >>> elem = ET.XML("<body><tag/></body>")
+ >>> serialize(elem)
+ '<body><tag /></body>'
+ >>> e = ET.Element("tag2")
+ >>> elem.append(e)
+ >>> serialize(elem)
+ '<body><tag /><tag2 /></body>'
+ >>> elem.remove(e)
+ >>> serialize(elem)
+ '<body><tag /></body>'
+ >>> elem.insert(0, e)
+ >>> serialize(elem)
+ '<body><tag2 /><tag /></body>'
+ >>> elem.remove(e)
+ >>> elem.extend([e])
+ >>> serialize(elem)
+ '<body><tag /><tag2 /></body>'
+ >>> elem.remove(e)
+
+ >>> element = ET.Element("tag", key="value")
+ >>> serialize(element) # 1
'<tag key="value" />'
>>> subelement = ET.Element("subtag")
>>> element.append(subelement)
- >>> serialize(ET, element) # 2
+ >>> serialize(element) # 2
'<tag key="value"><subtag /></tag>'
>>> element.insert(0, subelement)
- >>> serialize(ET, element) # 3
+ >>> serialize(element) # 3
'<tag key="value"><subtag /><subtag /></tag>'
>>> element.remove(subelement)
- >>> serialize(ET, element) # 4
+ >>> serialize(element) # 4
'<tag key="value"><subtag /></tag>'
>>> element.remove(subelement)
- >>> serialize(ET, element) # 5
+ >>> serialize(element) # 5
'<tag key="value" />'
>>> element.remove(subelement)
Traceback (most recent call last):
ValueError: list.remove(x): x not in list
- >>> serialize(ET, element) # 6
+ >>> serialize(element) # 6
'<tag key="value" />'
+ >>> element[0:0] = [subelement, subelement, subelement]
+ >>> serialize(element[1])
+ '<subtag />'
+ >>> element[1:9] == [element[1], element[2]]
+ True
+ >>> element[:9:2] == [element[0], element[2]]
+ True
+ >>> del element[1:2]
+ >>> serialize(element)
+ '<tag key="value"><subtag /><subtag /></tag>'
"""
-def qname():
+def cdata():
"""
- Test QName handling.
-
- 1) decorated tags
+ Test CDATA handling (etc).
- >>> from xml.etree import ElementTree as ET
- >>> elem = ET.Element("{uri}tag")
- >>> serialize(ET, elem) # 1.1
- '<ns0:tag xmlns:ns0="uri" />'
- >>> elem = ET.Element(ET.QName("{uri}tag"))
- >>> serialize(ET, elem) # 1.2
- '<ns0:tag xmlns:ns0="uri" />'
- >>> elem = ET.Element(ET.QName("uri", "tag"))
- >>> serialize(ET, elem) # 1.3
- '<ns0:tag xmlns:ns0="uri" />'
- >>> elem = ET.Element(ET.QName("uri", "tag"))
- >>> subelem = ET.SubElement(elem, ET.QName("uri", "tag1"))
- >>> subelem = ET.SubElement(elem, ET.QName("uri", "tag2"))
- >>> serialize(ET, elem) # 1.4
- '<ns0:tag xmlns:ns0="uri"><ns0:tag1 /><ns0:tag2 /></ns0:tag>'
-
- 2) decorated attributes
-
- >>> elem.clear()
- >>> elem.attrib["{uri}key"] = "value"
- >>> serialize(ET, elem) # 2.1
- '<ns0:tag ns0:key="value" xmlns:ns0="uri" />'
-
- >>> elem.clear()
- >>> elem.attrib[ET.QName("{uri}key")] = "value"
- >>> serialize(ET, elem) # 2.2
- '<ns0:tag ns0:key="value" xmlns:ns0="uri" />'
+ >>> serialize(ET.XML("<tag>hello</tag>"))
+ '<tag>hello</tag>'
+ >>> serialize(ET.XML("<tag>&#104;&#101;&#108;&#108;&#111;</tag>"))
+ '<tag>hello</tag>'
+ >>> serialize(ET.XML("<tag><![CDATA[hello]]></tag>"))
+ '<tag>hello</tag>'
+ """
- 3) decorated values are not converted by default, but the
- QName wrapper can be used for values
+# Only with Python implementation
+def simplefind():
+ """
+ Test find methods using the elementpath fallback.
- >>> elem.clear()
- >>> elem.attrib["{uri}key"] = "{uri}value"
- >>> serialize(ET, elem) # 3.1
- '<ns0:tag ns0:key="{uri}value" xmlns:ns0="uri" />'
+ >>> from xml.etree import ElementTree
- >>> elem.clear()
- >>> elem.attrib["{uri}key"] = ET.QName("{uri}value")
- >>> serialize(ET, elem) # 3.2
- '<ns0:tag ns0:key="ns0:value" xmlns:ns0="uri" />'
+ >>> CurrentElementPath = ElementTree.ElementPath
+ >>> ElementTree.ElementPath = ElementTree._SimpleElementPath()
+ >>> elem = ElementTree.XML(SAMPLE_XML)
+ >>> elem.find("tag").tag
+ 'tag'
+ >>> ElementTree.ElementTree(elem).find("tag").tag
+ 'tag'
+ >>> elem.findtext("tag")
+ 'text'
+ >>> elem.findtext("tog")
+ >>> elem.findtext("tog", "default")
+ 'default'
+ >>> ElementTree.ElementTree(elem).findtext("tag")
+ 'text'
+ >>> summarize_list(elem.findall("tag"))
+ ['tag', 'tag']
+ >>> summarize_list(elem.findall(".//tag"))
+ ['tag', 'tag', 'tag']
- >>> elem.clear()
- >>> subelem = ET.Element("tag")
- >>> subelem.attrib["{uri1}key"] = ET.QName("{uri2}value")
- >>> elem.append(subelem)
- >>> elem.append(subelem)
- >>> serialize(ET, elem) # 3.3
- '<ns0:tag xmlns:ns0="uri"><tag ns1:key="ns2:value" xmlns:ns1="uri1" xmlns:ns2="uri2" /><tag ns1:key="ns2:value" xmlns:ns1="uri1" xmlns:ns2="uri2" /></ns0:tag>'
+ Path syntax doesn't work in this case.
- 4) Direct QName tests
+ >>> elem.find("section/tag")
+ >>> elem.findtext("section/tag")
+ >>> summarize_list(elem.findall("section/tag"))
+ []
- >>> str(ET.QName('ns', 'tag'))
- '{ns}tag'
- >>> str(ET.QName('{ns}tag'))
- '{ns}tag'
- >>> q1 = ET.QName('ns', 'tag')
- >>> q2 = ET.QName('ns', 'tag')
- >>> q1 == q2
- True
- >>> q2 = ET.QName('ns', 'other-tag')
- >>> q1 == q2
- False
- >>> q1 == 'ns:tag'
- False
- >>> q1 == '{ns}tag'
- True
+ >>> ElementTree.ElementPath = CurrentElementPath
"""
def find():
"""
Test find methods (including xpath syntax).
- >>> from xml.etree import ElementTree as ET
-
>>> elem = ET.XML(SAMPLE_XML)
>>> elem.find("tag").tag
'tag'
@@ -189,39 +317,67 @@ def find():
'tag'
>>> elem.find("section/tag").tag
'tag'
+ >>> elem.find("./tag").tag
+ 'tag'
+ >>> ET.ElementTree(elem).find("./tag").tag
+ 'tag'
+ >>> ET.ElementTree(elem).find("/tag").tag
+ 'tag'
+ >>> elem[2] = ET.XML(SAMPLE_SECTION)
+ >>> elem.find("section/nexttag").tag
+ 'nexttag'
>>> ET.ElementTree(elem).find("section/tag").tag
'tag'
+ >>> ET.ElementTree(elem).find("tog")
+ >>> ET.ElementTree(elem).find("tog/foo")
>>> elem.findtext("tag")
'text'
+ >>> elem.findtext("section/nexttag")
+ ''
+ >>> elem.findtext("section/nexttag", "default")
+ ''
>>> elem.findtext("tog")
>>> elem.findtext("tog", "default")
'default'
>>> ET.ElementTree(elem).findtext("tag")
'text'
+ >>> ET.ElementTree(elem).findtext("tog/foo")
+ >>> ET.ElementTree(elem).findtext("tog/foo", "default")
+ 'default'
+ >>> ET.ElementTree(elem).findtext("./tag")
+ 'text'
+ >>> ET.ElementTree(elem).findtext("/tag")
+ 'text'
>>> elem.findtext("section/tag")
'subtext'
>>> ET.ElementTree(elem).findtext("section/tag")
'subtext'
+ >>> summarize_list(elem.findall("."))
+ ['body']
>>> summarize_list(elem.findall("tag"))
['tag', 'tag']
+ >>> summarize_list(elem.findall("tog"))
+ []
+ >>> summarize_list(elem.findall("tog/foo"))
+ []
>>> summarize_list(elem.findall("*"))
['tag', 'tag', 'section']
>>> summarize_list(elem.findall(".//tag"))
- ['tag', 'tag', 'tag']
+ ['tag', 'tag', 'tag', 'tag']
>>> summarize_list(elem.findall("section/tag"))
['tag']
>>> summarize_list(elem.findall("section//tag"))
- ['tag']
+ ['tag', 'tag']
>>> summarize_list(elem.findall("section/*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection']
>>> summarize_list(elem.findall("section//*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection', 'tag']
>>> summarize_list(elem.findall("section/.//*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection', 'tag']
>>> summarize_list(elem.findall("*/*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection']
>>> summarize_list(elem.findall("*//*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection', 'tag']
>>> summarize_list(elem.findall("*/tag"))
['tag']
>>> summarize_list(elem.findall("*/./tag"))
@@ -229,13 +385,40 @@ def find():
>>> summarize_list(elem.findall("./tag"))
['tag', 'tag']
>>> summarize_list(elem.findall(".//tag"))
- ['tag', 'tag', 'tag']
+ ['tag', 'tag', 'tag', 'tag']
>>> summarize_list(elem.findall("././tag"))
['tag', 'tag']
- >>> summarize_list(ET.ElementTree(elem).findall("/tag"))
+ >>> summarize_list(elem.findall(".//tag[@class]"))
+ ['tag', 'tag', 'tag']
+ >>> summarize_list(elem.findall(".//tag[@class='a']"))
+ ['tag']
+ >>> summarize_list(elem.findall(".//tag[@class='b']"))
+ ['tag', 'tag']
+ >>> summarize_list(elem.findall(".//tag[@id]"))
+ ['tag']
+ >>> summarize_list(elem.findall(".//section[tag]"))
+ ['section']
+ >>> summarize_list(elem.findall(".//section[element]"))
+ []
+ >>> summarize_list(elem.findall("../tag"))
+ []
+ >>> summarize_list(elem.findall("section/../tag"))
['tag', 'tag']
>>> summarize_list(ET.ElementTree(elem).findall("./tag"))
['tag', 'tag']
+
+ Following example is invalid in 1.2.
+ A leading '*' is assumed in 1.3.
+
+ >>> elem.findall("section//") == elem.findall("section//*")
+ True
+
+ ET's Path module handles this case incorrectly; this gives
+ a warning in 1.3, and the behaviour will be modified in 1.4.
+
+ >>> summarize_list(ET.ElementTree(elem).findall("/tag"))
+ ['tag', 'tag']
+
>>> elem = ET.XML(SAMPLE_XML_NS)
>>> summarize_list(elem.findall("tag"))
[]
@@ -245,21 +428,230 @@ def find():
['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag']
"""
-def parseliteral():
- r"""
+def file_init():
+ """
+ >>> import io
- >>> from xml.etree import ElementTree as ET
+ >>> stringfile = io.BytesIO(SAMPLE_XML.encode("utf-8"))
+ >>> tree = ET.ElementTree(file=stringfile)
+ >>> tree.find("tag").tag
+ 'tag'
+ >>> tree.find("section/tag").tag
+ 'tag'
+
+ >>> tree = ET.ElementTree(file=SIMPLE_XMLFILE)
+ >>> tree.find("element").tag
+ 'element'
+ >>> tree.find("element/../empty-element").tag
+ 'empty-element'
+ """
+def bad_find():
+ """
+ Check bad or unsupported path expressions.
+
+ >>> elem = ET.XML(SAMPLE_XML)
+ >>> elem.findall("/tag")
+ Traceback (most recent call last):
+ SyntaxError: cannot use absolute path on element
+ """
+
+def path_cache():
+ """
+ Check that the path cache behaves sanely.
+
+ >>> elem = ET.XML(SAMPLE_XML)
+ >>> for i in range(10): ET.ElementTree(elem).find('./'+str(i))
+ >>> cache_len_10 = len(ET.ElementPath._cache)
+ >>> for i in range(10): ET.ElementTree(elem).find('./'+str(i))
+ >>> len(ET.ElementPath._cache) == cache_len_10
+ True
+ >>> for i in range(20): ET.ElementTree(elem).find('./'+str(i))
+ >>> len(ET.ElementPath._cache) > cache_len_10
+ True
+ >>> for i in range(600): ET.ElementTree(elem).find('./'+str(i))
+ >>> len(ET.ElementPath._cache) < 500
+ True
+ """
+
+def copy():
+ """
+ Test copy handling (etc).
+
+ >>> import copy
+ >>> e1 = ET.XML("<tag>hello<foo/></tag>")
+ >>> e2 = copy.copy(e1)
+ >>> e3 = copy.deepcopy(e1)
+ >>> e1.find("foo").tag = "bar"
+ >>> serialize(e1)
+ '<tag>hello<bar /></tag>'
+ >>> serialize(e2)
+ '<tag>hello<bar /></tag>'
+ >>> serialize(e3)
+ '<tag>hello<foo /></tag>'
+
+ """
+
+def attrib():
+ """
+ Test attribute handling.
+
+ >>> elem = ET.Element("tag")
+ >>> elem.get("key") # 1.1
+ >>> elem.get("key", "default") # 1.2
+ 'default'
+ >>> elem.set("key", "value")
+ >>> elem.get("key") # 1.3
+ 'value'
+
+ >>> elem = ET.Element("tag", key="value")
+ >>> elem.get("key") # 2.1
+ 'value'
+ >>> elem.attrib # 2.2
+ {'key': 'value'}
+
+ >>> attrib = {"key": "value"}
+ >>> elem = ET.Element("tag", attrib)
+ >>> attrib.clear() # check for aliasing issues
+ >>> elem.get("key") # 3.1
+ 'value'
+ >>> elem.attrib # 3.2
+ {'key': 'value'}
+
+ >>> attrib = {"key": "value"}
+ >>> elem = ET.Element("tag", **attrib)
+ >>> attrib.clear() # check for aliasing issues
+ >>> elem.get("key") # 4.1
+ 'value'
+ >>> elem.attrib # 4.2
+ {'key': 'value'}
+
+ >>> elem = ET.Element("tag", {"key": "other"}, key="value")
+ >>> elem.get("key") # 5.1
+ 'value'
+ >>> elem.attrib # 5.2
+ {'key': 'value'}
+
+ >>> elem = ET.Element('test')
+ >>> elem.text = "aa"
+ >>> elem.set('testa', 'testval')
+ >>> elem.set('testb', 'test2')
+ >>> ET.tostring(elem)
+ b'<test testa="testval" testb="test2">aa</test>'
+ >>> sorted(elem.keys())
+ ['testa', 'testb']
+ >>> sorted(elem.items())
+ [('testa', 'testval'), ('testb', 'test2')]
+ >>> elem.attrib['testb']
+ 'test2'
+ >>> elem.attrib['testb'] = 'test1'
+ >>> elem.attrib['testc'] = 'test2'
+ >>> ET.tostring(elem)
+ b'<test testa="testval" testb="test1" testc="test2">aa</test>'
+ """
+
+def makeelement():
+ """
+ Test makeelement handling.
+
+ >>> elem = ET.Element("tag")
+ >>> attrib = {"key": "value"}
+ >>> subelem = elem.makeelement("subtag", attrib)
+ >>> if subelem.attrib is attrib:
+ ... print("attrib aliasing")
+ >>> elem.append(subelem)
+ >>> serialize(elem)
+ '<tag><subtag key="value" /></tag>'
+
+ >>> elem.clear()
+ >>> serialize(elem)
+ '<tag />'
+ >>> elem.append(subelem)
+ >>> serialize(elem)
+ '<tag><subtag key="value" /></tag>'
+ >>> elem.extend([subelem, subelem])
+ >>> serialize(elem)
+ '<tag><subtag key="value" /><subtag key="value" /><subtag key="value" /></tag>'
+ >>> elem[:] = [subelem]
+ >>> serialize(elem)
+ '<tag><subtag key="value" /></tag>'
+ >>> elem[:] = tuple([subelem])
+ >>> serialize(elem)
+ '<tag><subtag key="value" /></tag>'
+
+ """
+
+def parsefile():
+ """
+ Test parsing from file.
+
+ >>> tree = ET.parse(SIMPLE_XMLFILE)
+ >>> normalize_crlf(tree)
+ >>> tree.write(sys.stdout, encoding='unicode')
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+ >>> tree = ET.parse(SIMPLE_NS_XMLFILE)
+ >>> normalize_crlf(tree)
+ >>> tree.write(sys.stdout, encoding='unicode')
+ <ns0:root xmlns:ns0="namespace">
+ <ns0:element key="value">text</ns0:element>
+ <ns0:element>text</ns0:element>tail
+ <ns0:empty-element />
+ </ns0:root>
+
+ >>> with open(SIMPLE_XMLFILE) as f:
+ ... data = f.read()
+
+ >>> parser = ET.XMLParser()
+ >>> parser.version # doctest: +ELLIPSIS
+ 'Expat ...'
+ >>> parser.feed(data)
+ >>> print(serialize(parser.close()))
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+
+ >>> parser = ET.XMLTreeBuilder() # 1.2 compatibility
+ >>> parser.feed(data)
+ >>> print(serialize(parser.close()))
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+
+ >>> target = ET.TreeBuilder()
+ >>> parser = ET.XMLParser(target=target)
+ >>> parser.feed(data)
+ >>> print(serialize(parser.close()))
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+ """
+
+def parseliteral():
+ """
>>> element = ET.XML("<html><body>text</body></html>")
- >>> ET.ElementTree(element).write(sys.stdout)
+ >>> ET.ElementTree(element).write(sys.stdout, encoding='unicode')
<html><body>text</body></html>
>>> element = ET.fromstring("<html><body>text</body></html>")
- >>> ET.ElementTree(element).write(sys.stdout)
- <html><body>text</body></html>
- >>> print(ET.tostring(element))
+ >>> ET.ElementTree(element).write(sys.stdout, encoding='unicode')
<html><body>text</body></html>
- >>> print(repr(ET.tostring(element, "ascii")))
- b"<?xml version='1.0' encoding='ascii'?>\n<html><body>text</body></html>"
+ >>> sequence = ["<html><body>", "text</bo", "dy></html>"]
+ >>> element = ET.fromstringlist(sequence)
+ >>> ET.tostring(element)
+ b'<html><body>text</body></html>'
+ >>> b"".join(ET.tostringlist(element))
+ b'<html><body>text</body></html>'
+ >>> ET.tostring(element, "ascii")
+ b"<?xml version='1.0' encoding='ascii'?>\\n<html><body>text</body></html>"
>>> _, ids = ET.XMLID("<html><body>text</body></html>")
>>> len(ids)
0
@@ -270,30 +662,601 @@ def parseliteral():
'body'
"""
+def iterparse():
+ """
+ Test iterparse interface.
+
+ >>> iterparse = ET.iterparse
+
+ >>> context = iterparse(SIMPLE_XMLFILE)
+ >>> action, elem = next(context)
+ >>> print(action, elem.tag)
+ end element
+ >>> for action, elem in context:
+ ... print(action, elem.tag)
+ end element
+ end empty-element
+ end root
+ >>> context.root.tag
+ 'root'
+
+ >>> context = iterparse(SIMPLE_NS_XMLFILE)
+ >>> for action, elem in context:
+ ... print(action, elem.tag)
+ end {namespace}element
+ end {namespace}element
+ end {namespace}empty-element
+ end {namespace}root
+
+ >>> events = ()
+ >>> context = iterparse(SIMPLE_XMLFILE, events)
+ >>> for action, elem in context:
+ ... print(action, elem.tag)
+
+ >>> events = ()
+ >>> context = iterparse(SIMPLE_XMLFILE, events=events)
+ >>> for action, elem in context:
+ ... print(action, elem.tag)
+
+ >>> events = ("start", "end")
+ >>> context = iterparse(SIMPLE_XMLFILE, events)
+ >>> for action, elem in context:
+ ... print(action, elem.tag)
+ start root
+ start element
+ end element
+ start element
+ end element
+ start empty-element
+ end empty-element
+ end root
+
+ >>> events = ("start", "end", "start-ns", "end-ns")
+ >>> context = iterparse(SIMPLE_NS_XMLFILE, events)
+ >>> for action, elem in context:
+ ... if action in ("start", "end"):
+ ... print(action, elem.tag)
+ ... else:
+ ... print(action, elem)
+ start-ns ('', 'namespace')
+ start {namespace}root
+ start {namespace}element
+ end {namespace}element
+ start {namespace}element
+ end {namespace}element
+ start {namespace}empty-element
+ end {namespace}empty-element
+ end {namespace}root
+ end-ns None
+
+ >>> events = ("start", "end", "bogus")
+ >>> with open(SIMPLE_XMLFILE, "rb") as f:
+ ... iterparse(f, events)
+ Traceback (most recent call last):
+ ValueError: unknown event 'bogus'
+
+ >>> import io
-def check_encoding(ET, encoding):
+ >>> source = io.BytesIO(
+ ... b"<?xml version='1.0' encoding='iso-8859-1'?>\\n"
+ ... b"<body xmlns='http://&#233;ffbot.org/ns'\\n"
+ ... b" xmlns:cl\\xe9='http://effbot.org/ns'>text</body>\\n")
+ >>> events = ("start-ns",)
+ >>> context = iterparse(source, events)
+ >>> for action, elem in context:
+ ... print(action, elem)
+ start-ns ('', 'http://\\xe9ffbot.org/ns')
+ start-ns ('cl\\xe9', 'http://effbot.org/ns')
+
+ >>> source = io.StringIO("<document />junk")
+ >>> try:
+ ... for action, elem in iterparse(source):
+ ... print(action, elem.tag)
+ ... except ET.ParseError as v:
+ ... print(v)
+ junk after document element: line 1, column 12
"""
- >>> from xml.etree import ElementTree as ET
- >>> check_encoding(ET, "ascii")
- >>> check_encoding(ET, "us-ascii")
- >>> check_encoding(ET, "iso-8859-1")
- >>> check_encoding(ET, "iso-8859-15")
- >>> check_encoding(ET, "cp437")
- >>> check_encoding(ET, "mac-roman")
+def writefile():
+ """
+ >>> elem = ET.Element("tag")
+ >>> elem.text = "text"
+ >>> serialize(elem)
+ '<tag>text</tag>'
+ >>> ET.SubElement(elem, "subtag").text = "subtext"
+ >>> serialize(elem)
+ '<tag>text<subtag>subtext</subtag></tag>'
+
+ Test tag suppression
+ >>> elem.tag = None
+ >>> serialize(elem)
+ 'text<subtag>subtext</subtag>'
+ >>> elem.insert(0, ET.Comment("comment"))
+ >>> serialize(elem) # assumes 1.3
+ 'text<!--comment--><subtag>subtext</subtag>'
+ >>> elem[0] = ET.PI("key", "value")
+ >>> serialize(elem)
+ 'text<?key value?><subtag>subtext</subtag>'
+ """
+
+def custom_builder():
+ """
+ Test parser w. custom builder.
+
+ >>> with open(SIMPLE_XMLFILE) as f:
+ ... data = f.read()
+ >>> class Builder:
+ ... def start(self, tag, attrib):
+ ... print("start", tag)
+ ... def end(self, tag):
+ ... print("end", tag)
+ ... def data(self, text):
+ ... pass
+ >>> builder = Builder()
+ >>> parser = ET.XMLParser(target=builder)
+ >>> parser.feed(data)
+ start root
+ start element
+ end element
+ start element
+ end element
+ start empty-element
+ end empty-element
+ end root
+
+ >>> with open(SIMPLE_NS_XMLFILE) as f:
+ ... data = f.read()
+ >>> class Builder:
+ ... def start(self, tag, attrib):
+ ... print("start", tag)
+ ... def end(self, tag):
+ ... print("end", tag)
+ ... def data(self, text):
+ ... pass
+ ... def pi(self, target, data):
+ ... print("pi", target, repr(data))
+ ... def comment(self, data):
+ ... print("comment", repr(data))
+ >>> builder = Builder()
+ >>> parser = ET.XMLParser(target=builder)
+ >>> parser.feed(data)
+ pi pi 'data'
+ comment ' comment '
+ start {namespace}root
+ start {namespace}element
+ end {namespace}element
+ start {namespace}element
+ end {namespace}element
+ start {namespace}empty-element
+ end {namespace}empty-element
+ end {namespace}root
+
+ """
+
+def getchildren():
+ """
+ Test Element.getchildren()
+
+ >>> with open(SIMPLE_XMLFILE, "rb") as f:
+ ... tree = ET.parse(f)
+ >>> for elem in tree.getroot().iter():
+ ... summarize_list(elem.getchildren())
+ ['element', 'element', 'empty-element']
+ []
+ []
+ []
+ >>> for elem in tree.getiterator():
+ ... summarize_list(elem.getchildren())
+ ['element', 'element', 'empty-element']
+ []
+ []
+ []
+
+ >>> elem = ET.XML(SAMPLE_XML)
+ >>> len(elem.getchildren())
+ 3
+ >>> len(elem[2].getchildren())
+ 1
+ >>> elem[:] == elem.getchildren()
+ True
+ >>> child1 = elem[0]
+ >>> child2 = elem[2]
+ >>> del elem[1:2]
+ >>> len(elem.getchildren())
+ 2
+ >>> child1 == elem[0]
+ True
+ >>> child2 == elem[1]
+ True
+ >>> elem[0:2] = [child2, child1]
+ >>> child2 == elem[0]
+ True
+ >>> child1 == elem[1]
+ True
+ >>> child1 == elem[0]
+ False
+ >>> elem.clear()
+ >>> elem.getchildren()
+ []
+ """
+
+def writestring():
+ """
+ >>> elem = ET.XML("<html><body>text</body></html>")
+ >>> ET.tostring(elem)
+ b'<html><body>text</body></html>'
+ >>> elem = ET.fromstring("<html><body>text</body></html>")
+ >>> ET.tostring(elem)
+ b'<html><body>text</body></html>'
+ """
+
+def check_encoding(encoding):
+ """
+ >>> check_encoding("ascii")
+ >>> check_encoding("us-ascii")
+ >>> check_encoding("iso-8859-1")
+ >>> check_encoding("iso-8859-15")
+ >>> check_encoding("cp437")
+ >>> check_encoding("mac-roman")
"""
ET.XML("<?xml version='1.0' encoding='%s'?><xml />" % encoding)
-def check_issue6233():
+def encoding():
+ r"""
+ Test encoding issues.
+
+ >>> elem = ET.Element("tag")
+ >>> elem.text = "abc"
+ >>> serialize(elem)
+ '<tag>abc</tag>'
+ >>> serialize(elem, encoding="utf-8")
+ b'<tag>abc</tag>'
+ >>> serialize(elem, encoding="us-ascii")
+ b'<tag>abc</tag>'
+ >>> serialize(elem, encoding="iso-8859-1")
+ b"<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>abc</tag>"
+
+ >>> elem.text = "<&\"\'>"
+ >>> serialize(elem)
+ '<tag>&lt;&amp;"\'&gt;</tag>'
+ >>> serialize(elem, encoding="utf-8")
+ b'<tag>&lt;&amp;"\'&gt;</tag>'
+ >>> serialize(elem, encoding="us-ascii") # cdata characters
+ b'<tag>&lt;&amp;"\'&gt;</tag>'
+ >>> serialize(elem, encoding="iso-8859-1")
+ b'<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag>&lt;&amp;"\'&gt;</tag>'
+
+ >>> elem.attrib["key"] = "<&\"\'>"
+ >>> elem.text = None
+ >>> serialize(elem)
+ '<tag key="&lt;&amp;&quot;\'&gt;" />'
+ >>> serialize(elem, encoding="utf-8")
+ b'<tag key="&lt;&amp;&quot;\'&gt;" />'
+ >>> serialize(elem, encoding="us-ascii")
+ b'<tag key="&lt;&amp;&quot;\'&gt;" />'
+ >>> serialize(elem, encoding="iso-8859-1")
+ b'<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="&lt;&amp;&quot;\'&gt;" />'
+
+ >>> elem.text = '\xe5\xf6\xf6<>'
+ >>> elem.attrib.clear()
+ >>> serialize(elem)
+ '<tag>\xe5\xf6\xf6&lt;&gt;</tag>'
+ >>> serialize(elem, encoding="utf-8")
+ b'<tag>\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;</tag>'
+ >>> serialize(elem, encoding="us-ascii")
+ b'<tag>&#229;&#246;&#246;&lt;&gt;</tag>'
+ >>> serialize(elem, encoding="iso-8859-1")
+ b"<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>\xe5\xf6\xf6&lt;&gt;</tag>"
+
+ >>> elem.attrib["key"] = '\xe5\xf6\xf6<>'
+ >>> elem.text = None
+ >>> serialize(elem)
+ '<tag key="\xe5\xf6\xf6&lt;&gt;" />'
+ >>> serialize(elem, encoding="utf-8")
+ b'<tag key="\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;" />'
+ >>> serialize(elem, encoding="us-ascii")
+ b'<tag key="&#229;&#246;&#246;&lt;&gt;" />'
+ >>> serialize(elem, encoding="iso-8859-1")
+ b'<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="\xe5\xf6\xf6&lt;&gt;" />'
"""
- >>> from xml.etree import ElementTree as ET
- >>> e = ET.XML("<?xml version='1.0' encoding='utf-8'?><body>t\xe3g</body>")
- >>> ET.tostring(e, 'ascii')
- b"<?xml version='1.0' encoding='ascii'?>\\n<body>t&#227;g</body>"
- >>> e = ET.XML("<?xml version='1.0' encoding='iso-8859-1'?><body>t\xe3g</body>".encode('iso-8859-1')) # create byte string with the right encoding
- >>> ET.tostring(e, 'ascii')
- b"<?xml version='1.0' encoding='ascii'?>\\n<body>t&#227;g</body>"
+def methods():
+ r"""
+ Test serialization methods.
+
+ >>> e = ET.XML("<html><link/><script>1 &lt; 2</script></html>")
+ >>> e.tail = "\n"
+ >>> serialize(e)
+ '<html><link /><script>1 &lt; 2</script></html>\n'
+ >>> serialize(e, method=None)
+ '<html><link /><script>1 &lt; 2</script></html>\n'
+ >>> serialize(e, method="xml")
+ '<html><link /><script>1 &lt; 2</script></html>\n'
+ >>> serialize(e, method="html")
+ '<html><link><script>1 < 2</script></html>\n'
+ >>> serialize(e, method="text")
+ '1 < 2\n'
+ """
+
+def iterators():
+ """
+ Test iterators.
+
+ >>> e = ET.XML("<html><body>this is a <i>paragraph</i>.</body>..</html>")
+ >>> summarize_list(e.iter())
+ ['html', 'body', 'i']
+ >>> summarize_list(e.find("body").iter())
+ ['body', 'i']
+ >>> summarize(next(e.iter()))
+ 'html'
+ >>> "".join(e.itertext())
+ 'this is a paragraph...'
+ >>> "".join(e.find("body").itertext())
+ 'this is a paragraph.'
+ >>> next(e.itertext())
+ 'this is a '
+
+ Method iterparse should return an iterator. See bug 6472.
+
+ >>> sourcefile = serialize(e, to_string=False)
+ >>> next(ET.iterparse(sourcefile)) # doctest: +ELLIPSIS
+ ('end', <Element 'i' at 0x...>)
+
+ >>> tree = ET.ElementTree(None)
+ >>> tree.iter()
+ Traceback (most recent call last):
+ AttributeError: 'NoneType' object has no attribute 'iter'
+ """
+
+ENTITY_XML = """\
+<!DOCTYPE points [
+<!ENTITY % user-entities SYSTEM 'user-entities.xml'>
+%user-entities;
+]>
+<document>&entity;</document>
+"""
+
+def entity():
+ """
+ Test entity handling.
+
+ 1) good entities
+
+ >>> e = ET.XML("<document title='&#x8230;'>test</document>")
+ >>> serialize(e, encoding="us-ascii")
+ b'<document title="&#33328;">test</document>'
+ >>> serialize(e)
+ '<document title="\u8230">test</document>'
+
+ 2) bad entities
+
+ >>> normalize_exception(ET.XML, "<document>&entity;</document>")
+ Traceback (most recent call last):
+ ParseError: undefined entity: line 1, column 10
+
+ >>> normalize_exception(ET.XML, ENTITY_XML)
+ Traceback (most recent call last):
+ ParseError: undefined entity &entity;: line 5, column 10
+
+ 3) custom entity
+
+ >>> parser = ET.XMLParser()
+ >>> parser.entity["entity"] = "text"
+ >>> parser.feed(ENTITY_XML)
+ >>> root = parser.close()
+ >>> serialize(root)
+ '<document>text</document>'
+ """
+
+def error(xml):
+ """
+
+ Test error handling.
+
+ >>> issubclass(ET.ParseError, SyntaxError)
+ True
+ >>> error("foo").position
+ (1, 0)
+ >>> error("<tag>&foo;</tag>").position
+ (1, 5)
+ >>> error("foobar<").position
+ (1, 6)
+
+ """
+ try:
+ ET.XML(xml)
+ except ET.ParseError:
+ return sys.exc_info()[1]
+
+def namespace():
+ """
+ Test namespace issues.
+
+ 1) xml namespace
+
+ >>> elem = ET.XML("<tag xml:lang='en' />")
+ >>> serialize(elem) # 1.1
+ '<tag xml:lang="en" />'
+
+ 2) other "well-known" namespaces
+
+ >>> elem = ET.XML("<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' />")
+ >>> serialize(elem) # 2.1
+ '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />'
+
+ >>> elem = ET.XML("<html:html xmlns:html='http://www.w3.org/1999/xhtml' />")
+ >>> serialize(elem) # 2.2
+ '<html:html xmlns:html="http://www.w3.org/1999/xhtml" />'
+
+ >>> elem = ET.XML("<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope' />")
+ >>> serialize(elem) # 2.3
+ '<ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope" />'
+
+ 3) unknown namespaces
+ >>> elem = ET.XML(SAMPLE_XML_NS)
+ >>> print(serialize(elem))
+ <ns0:body xmlns:ns0="http://effbot.org/ns">
+ <ns0:tag>text</ns0:tag>
+ <ns0:tag />
+ <ns0:section>
+ <ns0:tag>subtext</ns0:tag>
+ </ns0:section>
+ </ns0:body>
+ """
+
+def qname():
+ """
+ Test QName handling.
+
+ 1) decorated tags
+
+ >>> elem = ET.Element("{uri}tag")
+ >>> serialize(elem) # 1.1
+ '<ns0:tag xmlns:ns0="uri" />'
+ >>> elem = ET.Element(ET.QName("{uri}tag"))
+ >>> serialize(elem) # 1.2
+ '<ns0:tag xmlns:ns0="uri" />'
+ >>> elem = ET.Element(ET.QName("uri", "tag"))
+ >>> serialize(elem) # 1.3
+ '<ns0:tag xmlns:ns0="uri" />'
+ >>> elem = ET.Element(ET.QName("uri", "tag"))
+ >>> subelem = ET.SubElement(elem, ET.QName("uri", "tag1"))
+ >>> subelem = ET.SubElement(elem, ET.QName("uri", "tag2"))
+ >>> serialize(elem) # 1.4
+ '<ns0:tag xmlns:ns0="uri"><ns0:tag1 /><ns0:tag2 /></ns0:tag>'
+
+ 2) decorated attributes
+
+ >>> elem.clear()
+ >>> elem.attrib["{uri}key"] = "value"
+ >>> serialize(elem) # 2.1
+ '<ns0:tag xmlns:ns0="uri" ns0:key="value" />'
+
+ >>> elem.clear()
+ >>> elem.attrib[ET.QName("{uri}key")] = "value"
+ >>> serialize(elem) # 2.2
+ '<ns0:tag xmlns:ns0="uri" ns0:key="value" />'
+
+ 3) decorated values are not converted by default, but the
+ QName wrapper can be used for values
+
+ >>> elem.clear()
+ >>> elem.attrib["{uri}key"] = "{uri}value"
+ >>> serialize(elem) # 3.1
+ '<ns0:tag xmlns:ns0="uri" ns0:key="{uri}value" />'
+
+ >>> elem.clear()
+ >>> elem.attrib["{uri}key"] = ET.QName("{uri}value")
+ >>> serialize(elem) # 3.2
+ '<ns0:tag xmlns:ns0="uri" ns0:key="ns0:value" />'
+
+ >>> elem.clear()
+ >>> subelem = ET.Element("tag")
+ >>> subelem.attrib["{uri1}key"] = ET.QName("{uri2}value")
+ >>> elem.append(subelem)
+ >>> elem.append(subelem)
+ >>> serialize(elem) # 3.3
+ '<ns0:tag xmlns:ns0="uri" xmlns:ns1="uri1" xmlns:ns2="uri2"><tag ns1:key="ns2:value" /><tag ns1:key="ns2:value" /></ns0:tag>'
+
+ 4) Direct QName tests
+
+ >>> str(ET.QName('ns', 'tag'))
+ '{ns}tag'
+ >>> str(ET.QName('{ns}tag'))
+ '{ns}tag'
+ >>> q1 = ET.QName('ns', 'tag')
+ >>> q2 = ET.QName('ns', 'tag')
+ >>> q1 == q2
+ True
+ >>> q2 = ET.QName('ns', 'other-tag')
+ >>> q1 == q2
+ False
+ >>> q1 == 'ns:tag'
+ False
+ >>> q1 == '{ns}tag'
+ True
+ """
+
+def doctype_public():
+ """
+ Test PUBLIC doctype.
+
+ >>> elem = ET.XML('<!DOCTYPE html PUBLIC'
+ ... ' "-//W3C//DTD XHTML 1.0 Transitional//EN"'
+ ... ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
+ ... '<html>text</html>')
+
+ """
+
+def xpath_tokenizer(p):
+ """
+ Test the XPath tokenizer.
+
+ >>> # tests from the xml specification
+ >>> xpath_tokenizer("*")
+ ['*']
+ >>> xpath_tokenizer("text()")
+ ['text', '()']
+ >>> xpath_tokenizer("@name")
+ ['@', 'name']
+ >>> xpath_tokenizer("@*")
+ ['@', '*']
+ >>> xpath_tokenizer("para[1]")
+ ['para', '[', '1', ']']
+ >>> xpath_tokenizer("para[last()]")
+ ['para', '[', 'last', '()', ']']
+ >>> xpath_tokenizer("*/para")
+ ['*', '/', 'para']
+ >>> xpath_tokenizer("/doc/chapter[5]/section[2]")
+ ['/', 'doc', '/', 'chapter', '[', '5', ']', '/', 'section', '[', '2', ']']
+ >>> xpath_tokenizer("chapter//para")
+ ['chapter', '//', 'para']
+ >>> xpath_tokenizer("//para")
+ ['//', 'para']
+ >>> xpath_tokenizer("//olist/item")
+ ['//', 'olist', '/', 'item']
+ >>> xpath_tokenizer(".")
+ ['.']
+ >>> xpath_tokenizer(".//para")
+ ['.', '//', 'para']
+ >>> xpath_tokenizer("..")
+ ['..']
+ >>> xpath_tokenizer("../@lang")
+ ['..', '/', '@', 'lang']
+ >>> xpath_tokenizer("chapter[title]")
+ ['chapter', '[', 'title', ']']
+ >>> xpath_tokenizer("employee[@secretary and @assistant]")
+ ['employee', '[', '@', 'secretary', '', 'and', '', '@', 'assistant', ']']
+
+ >>> # additional tests
+ >>> xpath_tokenizer("{http://spam}egg")
+ ['{http://spam}egg']
+ >>> xpath_tokenizer("./spam.egg")
+ ['.', '/', 'spam.egg']
+ >>> xpath_tokenizer(".//{http://spam}egg")
+ ['.', '//', '{http://spam}egg']
+ """
+ from xml.etree import ElementPath
+ out = []
+ for op, tag in ElementPath.xpath_tokenizer(p):
+ out.append(op or tag)
+ return out
+
+def processinginstruction():
+ """
+ Test ProcessingInstruction directly
+
+ >>> ET.tostring(ET.ProcessingInstruction('test', 'instruction'))
+ b'<?test instruction?>'
+ >>> ET.tostring(ET.PI('test', 'instruction'))
+ b'<?test instruction?>'
+
+ Issue #2746
+
+ >>> ET.tostring(ET.PI('test', '<testing&>'))
+ b'<?test <testing&>?>'
+ >>> ET.tostring(ET.PI('test', '<testing&>\xe3'), 'latin1')
+ b"<?xml version='1.0' encoding='latin1'?>\\n<?test <testing&>\\xe3?>"
"""
#
@@ -328,6 +1291,14 @@ XINCLUDE["C2.xml"] = """\
XINCLUDE["count.txt"] = "324387"
+XINCLUDE["C2b.xml"] = """\
+<?xml version='1.0'?>
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+ <p>This document has been <em>accessed</em>
+ <xi:include href="count.txt" parse="text"/> times.</p>
+</document>
+"""
+
XINCLUDE["C3.xml"] = """\
<?xml version='1.0'?>
<document xmlns:xi="http://www.w3.org/2001/XInclude">
@@ -360,9 +1331,9 @@ XINCLUDE["default.xml"] = """\
<?xml version='1.0'?>
<document xmlns:xi="http://www.w3.org/2001/XInclude">
<p>Example.</p>
- <xi:include href="samples/simple.xml"/>
+ <xi:include href="{}"/>
</document>
-"""
+""".format(html.escape(SIMPLE_XMLFILE, True))
def xinclude_loader(href, parse="xml", encoding=None):
try:
@@ -383,7 +1354,7 @@ def xinclude():
>>> document = xinclude_loader("C1.xml")
>>> ElementInclude.include(document, xinclude_loader)
- >>> print(serialize(ET, document)) # C1
+ >>> print(serialize(document)) # C1
<document>
<p>120 Mz is adequate for an average home user.</p>
<disclaimer>
@@ -397,17 +1368,27 @@ def xinclude():
>>> document = xinclude_loader("C2.xml")
>>> ElementInclude.include(document, xinclude_loader)
- >>> print(serialize(ET, document)) # C2
+ >>> print(serialize(document)) # C2
<document>
<p>This document has been accessed
324387 times.</p>
</document>
+ Textual inclusion after sibling element (based on modified XInclude C.2)
+
+ >>> document = xinclude_loader("C2b.xml")
+ >>> ElementInclude.include(document, xinclude_loader)
+ >>> print(serialize(document)) # C2b
+ <document>
+ <p>This document has been <em>accessed</em>
+ 324387 times.</p>
+ </document>
+
Textual inclusion of XML example (XInclude C.3)
>>> document = xinclude_loader("C3.xml")
>>> ElementInclude.include(document, xinclude_loader)
- >>> print(serialize(ET, document)) # C3
+ >>> print(serialize(document)) # C3
<document>
<p>The following is the source of the "data.xml" resource:</p>
<example>&lt;?xml version='1.0'?&gt;
@@ -424,13 +1405,510 @@ def xinclude():
>>> ElementInclude.include(document, xinclude_loader)
Traceback (most recent call last):
IOError: resource not found
- >>> # print serialize(ET, document) # C5
+ >>> # print(serialize(document)) # C5
+ """
+
+def xinclude_default():
+ """
+ >>> from xml.etree import ElementInclude
+
+ >>> document = xinclude_loader("default.xml")
+ >>> ElementInclude.include(document)
+ >>> print(serialize(document)) # default
+ <document>
+ <p>Example.</p>
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+ </document>
+ """
+
+#
+# badly formatted xi:include tags
+
+XINCLUDE_BAD = {}
+
+XINCLUDE_BAD["B1.xml"] = """\
+<?xml version='1.0'?>
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+ <p>120 Mz is adequate for an average home user.</p>
+ <xi:include href="disclaimer.xml" parse="BAD_TYPE"/>
+</document>
+"""
+
+XINCLUDE_BAD["B2.xml"] = """\
+<?xml version='1.0'?>
+<div xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:fallback></xi:fallback>
+</div>
+"""
+def xinclude_failures():
+ r"""
+ Test failure to locate included XML file.
+
+ >>> from xml.etree import ElementInclude
+
+ >>> def none_loader(href, parser, encoding=None):
+ ... return None
+
+ >>> document = ET.XML(XINCLUDE["C1.xml"])
+ >>> ElementInclude.include(document, loader=none_loader)
+ Traceback (most recent call last):
+ xml.etree.ElementInclude.FatalIncludeError: cannot load 'disclaimer.xml' as 'xml'
+
+ Test failure to locate included text file.
+
+ >>> document = ET.XML(XINCLUDE["C2.xml"])
+ >>> ElementInclude.include(document, loader=none_loader)
+ Traceback (most recent call last):
+ xml.etree.ElementInclude.FatalIncludeError: cannot load 'count.txt' as 'text'
+
+ Test bad parse type.
+
+ >>> document = ET.XML(XINCLUDE_BAD["B1.xml"])
+ >>> ElementInclude.include(document, loader=none_loader)
+ Traceback (most recent call last):
+ xml.etree.ElementInclude.FatalIncludeError: unknown parse type in xi:include tag ('BAD_TYPE')
+
+ Test xi:fallback outside xi:include.
+
+ >>> document = ET.XML(XINCLUDE_BAD["B2.xml"])
+ >>> ElementInclude.include(document, loader=none_loader)
+ Traceback (most recent call last):
+ xml.etree.ElementInclude.FatalIncludeError: xi:fallback tag must be child of xi:include ('{http://www.w3.org/2001/XInclude}fallback')
"""
-def test_main():
+# --------------------------------------------------------------------
+# reported bugs
+
+def bug_xmltoolkit21():
+ """
+
+ marshaller gives obscure errors for non-string values
+
+ >>> elem = ET.Element(123)
+ >>> serialize(elem) # tag
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+ >>> elem = ET.Element("elem")
+ >>> elem.text = 123
+ >>> serialize(elem) # text
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+ >>> elem = ET.Element("elem")
+ >>> elem.tail = 123
+ >>> serialize(elem) # tail
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+ >>> elem = ET.Element("elem")
+ >>> elem.set(123, "123")
+ >>> serialize(elem) # attribute key
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+ >>> elem = ET.Element("elem")
+ >>> elem.set("123", 123)
+ >>> serialize(elem) # attribute value
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+
+ """
+
+def bug_xmltoolkit25():
+ """
+
+ typo in ElementTree.findtext
+
+ >>> elem = ET.XML(SAMPLE_XML)
+ >>> tree = ET.ElementTree(elem)
+ >>> tree.findtext("tag")
+ 'text'
+ >>> tree.findtext("section/tag")
+ 'subtext'
+
+ """
+
+def bug_xmltoolkit28():
+ """
+
+ .//tag causes exceptions
+
+ >>> tree = ET.XML("<doc><table><tbody/></table></doc>")
+ >>> summarize_list(tree.findall(".//thead"))
+ []
+ >>> summarize_list(tree.findall(".//tbody"))
+ ['tbody']
+
+ """
+
+def bug_xmltoolkitX1():
+ """
+
+ dump() doesn't flush the output buffer
+
+ >>> tree = ET.XML("<doc><table><tbody/></table></doc>")
+ >>> ET.dump(tree); print("tail")
+ <doc><table><tbody /></table></doc>
+ tail
+
+ """
+
+def bug_xmltoolkit39():
+ """
+
+ non-ascii element and attribute names doesn't work
+
+ >>> tree = ET.XML(b"<?xml version='1.0' encoding='iso-8859-1'?><t\\xe4g />")
+ >>> ET.tostring(tree, "utf-8")
+ b'<t\\xc3\\xa4g />'
+
+ >>> tree = ET.XML(b"<?xml version='1.0' encoding='iso-8859-1'?><tag \\xe4ttr='v&#228;lue' />")
+ >>> tree.attrib
+ {'\\xe4ttr': 'v\\xe4lue'}
+ >>> ET.tostring(tree, "utf-8")
+ b'<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />'
+
+ >>> tree = ET.XML(b"<?xml version='1.0' encoding='iso-8859-1'?><t\\xe4g>text</t\\xe4g>")
+ >>> ET.tostring(tree, "utf-8")
+ b'<t\\xc3\\xa4g>text</t\\xc3\\xa4g>'
+
+ >>> tree = ET.Element("t\u00e4g")
+ >>> ET.tostring(tree, "utf-8")
+ b'<t\\xc3\\xa4g />'
+
+ >>> tree = ET.Element("tag")
+ >>> tree.set("\u00e4ttr", "v\u00e4lue")
+ >>> ET.tostring(tree, "utf-8")
+ b'<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />'
+
+ """
+
+def bug_xmltoolkit54():
+ """
+
+ problems handling internally defined entities
+
+ >>> e = ET.XML("<!DOCTYPE doc [<!ENTITY ldots '&#x8230;'>]><doc>&ldots;</doc>")
+ >>> serialize(e, encoding="us-ascii")
+ b'<doc>&#33328;</doc>'
+ >>> serialize(e)
+ '<doc>\u8230</doc>'
+
+ """
+
+def bug_xmltoolkit55():
+ """
+
+ make sure we're reporting the first error, not the last
+
+ >>> normalize_exception(ET.XML, b"<!DOCTYPE doc SYSTEM 'doc.dtd'><doc>&ldots;&ndots;&rdots;</doc>")
+ Traceback (most recent call last):
+ ParseError: undefined entity &ldots;: line 1, column 36
+
+ """
+
+class ExceptionFile:
+ def read(self, x):
+ raise IOError
+
+def xmltoolkit60():
+ """
+
+ Handle crash in stream source.
+ >>> tree = ET.parse(ExceptionFile())
+ Traceback (most recent call last):
+ IOError
+
+ """
+
+XMLTOOLKIT62_DOC = """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE patent-application-publication SYSTEM "pap-v15-2001-01-31.dtd" []>
+<patent-application-publication>
+<subdoc-abstract>
+<paragraph id="A-0001" lvl="0">A new cultivar of Begonia plant named &lsquo;BCT9801BEG&rsquo;.</paragraph>
+</subdoc-abstract>
+</patent-application-publication>"""
+
+
+def xmltoolkit62():
+ """
+
+ Don't crash when using custom entities.
+
+ >>> xmltoolkit62()
+ 'A new cultivar of Begonia plant named \u2018BCT9801BEG\u2019.'
+
+ """
+ ENTITIES = {'rsquo': '\u2019', 'lsquo': '\u2018'}
+ parser = ET.XMLTreeBuilder()
+ parser.entity.update(ENTITIES)
+ parser.feed(XMLTOOLKIT62_DOC)
+ t = parser.close()
+ return t.find('.//paragraph').text
+
+def xmltoolkit63():
+ """
+
+ Check reference leak.
+ >>> xmltoolkit63()
+ >>> count = sys.getrefcount(None)
+ >>> for i in range(1000):
+ ... xmltoolkit63()
+ >>> sys.getrefcount(None) - count
+ 0
+
+ """
+ tree = ET.TreeBuilder()
+ tree.start("tag", {})
+ tree.data("text")
+ tree.end("tag")
+
+# --------------------------------------------------------------------
+
+
+def bug_200708_newline():
+ r"""
+
+ Preserve newlines in attributes.
+
+ >>> e = ET.Element('SomeTag', text="def _f():\n return 3\n")
+ >>> ET.tostring(e)
+ b'<SomeTag text="def _f():&#10; return 3&#10;" />'
+ >>> ET.XML(ET.tostring(e)).get("text")
+ 'def _f():\n return 3\n'
+ >>> ET.tostring(ET.XML(ET.tostring(e)))
+ b'<SomeTag text="def _f():&#10; return 3&#10;" />'
+
+ """
+
+def bug_200708_close():
+ """
+
+ Test default builder.
+ >>> parser = ET.XMLParser() # default
+ >>> parser.feed("<element>some text</element>")
+ >>> summarize(parser.close())
+ 'element'
+
+ Test custom builder.
+ >>> class EchoTarget:
+ ... def close(self):
+ ... return ET.Element("element") # simulate root
+ >>> parser = ET.XMLParser(EchoTarget())
+ >>> parser.feed("<element>some text</element>")
+ >>> summarize(parser.close())
+ 'element'
+
+ """
+
+def bug_200709_default_namespace():
+ """
+
+ >>> e = ET.Element("{default}elem")
+ >>> s = ET.SubElement(e, "{default}elem")
+ >>> serialize(e, default_namespace="default") # 1
+ '<elem xmlns="default"><elem /></elem>'
+
+ >>> e = ET.Element("{default}elem")
+ >>> s = ET.SubElement(e, "{default}elem")
+ >>> s = ET.SubElement(e, "{not-default}elem")
+ >>> serialize(e, default_namespace="default") # 2
+ '<elem xmlns="default" xmlns:ns1="not-default"><elem /><ns1:elem /></elem>'
+
+ >>> e = ET.Element("{default}elem")
+ >>> s = ET.SubElement(e, "{default}elem")
+ >>> s = ET.SubElement(e, "elem") # unprefixed name
+ >>> serialize(e, default_namespace="default") # 3
+ Traceback (most recent call last):
+ ValueError: cannot use non-qualified names with default_namespace option
+
+ """
+
+def bug_200709_register_namespace():
+ """
+
+ >>> ET.tostring(ET.Element("{http://namespace.invalid/does/not/exist/}title"))
+ b'<ns0:title xmlns:ns0="http://namespace.invalid/does/not/exist/" />'
+ >>> ET.register_namespace("foo", "http://namespace.invalid/does/not/exist/")
+ >>> ET.tostring(ET.Element("{http://namespace.invalid/does/not/exist/}title"))
+ b'<foo:title xmlns:foo="http://namespace.invalid/does/not/exist/" />'
+
+ And the Dublin Core namespace is in the default list:
+
+ >>> ET.tostring(ET.Element("{http://purl.org/dc/elements/1.1/}title"))
+ b'<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/" />'
+
+ """
+
+def bug_200709_element_comment():
+ """
+
+ Not sure if this can be fixed, really (since the serializer needs
+ ET.Comment, not cET.comment).
+
+ >>> a = ET.Element('a')
+ >>> a.append(ET.Comment('foo'))
+ >>> a[0].tag == ET.Comment
+ True
+
+ >>> a = ET.Element('a')
+ >>> a.append(ET.PI('foo'))
+ >>> a[0].tag == ET.PI
+ True
+
+ """
+
+def bug_200709_element_insert():
+ """
+
+ >>> a = ET.Element('a')
+ >>> b = ET.SubElement(a, 'b')
+ >>> c = ET.SubElement(a, 'c')
+ >>> d = ET.Element('d')
+ >>> a.insert(0, d)
+ >>> summarize_list(a)
+ ['d', 'b', 'c']
+ >>> a.insert(-1, d)
+ >>> summarize_list(a)
+ ['d', 'b', 'd', 'c']
+
+ """
+
+def bug_200709_iter_comment():
+ """
+
+ >>> a = ET.Element('a')
+ >>> b = ET.SubElement(a, 'b')
+ >>> comment_b = ET.Comment("TEST-b")
+ >>> b.append(comment_b)
+ >>> summarize_list(a.iter(ET.Comment))
+ ['<Comment>']
+
+ """
+
+# --------------------------------------------------------------------
+# reported on bugs.python.org
+
+def bug_1534630():
+ """
+
+ >>> bob = ET.TreeBuilder()
+ >>> e = bob.data("data")
+ >>> e = bob.start("tag", {})
+ >>> e = bob.end("tag")
+ >>> e = bob.close()
+ >>> serialize(e)
+ '<tag />'
+
+ """
+
+def check_issue6233():
+ """
+
+ >>> e = ET.XML(b"<?xml version='1.0' encoding='utf-8'?><body>t\\xc3\\xa3g</body>")
+ >>> ET.tostring(e, 'ascii')
+ b"<?xml version='1.0' encoding='ascii'?>\\n<body>t&#227;g</body>"
+ >>> e = ET.XML(b"<?xml version='1.0' encoding='iso-8859-1'?><body>t\\xe3g</body>")
+ >>> ET.tostring(e, 'ascii')
+ b"<?xml version='1.0' encoding='ascii'?>\\n<body>t&#227;g</body>"
+
+ """
+
+def check_issue3151():
+ """
+
+ >>> e = ET.XML('<prefix:localname xmlns:prefix="${stuff}"/>')
+ >>> e.tag
+ '{${stuff}}localname'
+ >>> t = ET.ElementTree(e)
+ >>> ET.tostring(e)
+ b'<ns0:localname xmlns:ns0="${stuff}" />'
+
+ """
+
+def check_issue6565():
+ """
+
+ >>> elem = ET.XML("<body><tag/></body>")
+ >>> summarize_list(elem)
+ ['tag']
+ >>> newelem = ET.XML(SAMPLE_XML)
+ >>> elem[:] = newelem[:]
+ >>> summarize_list(elem)
+ ['tag', 'tag', 'section']
+
+ """
+
+def check_issue10777():
+ """
+ Registering a namespace twice caused a "dictionary changed size during
+ iteration" bug.
+
+ >>> ET.register_namespace('test10777', 'http://myuri/')
+ >>> ET.register_namespace('test10777', 'http://myuri/')
+ """
+
+# --------------------------------------------------------------------
+
+
+class CleanContext(object):
+ """Provide default namespace mapping and path cache."""
+ checkwarnings = None
+
+ def __init__(self, quiet=False):
+ if sys.flags.optimize >= 2:
+ # under -OO, doctests cannot be run and therefore not all warnings
+ # will be emitted
+ quiet = True
+ deprecations = (
+ # Search behaviour is broken if search path starts with "/".
+ ("This search is broken in 1.3 and earlier, and will be fixed "
+ "in a future version. If you rely on the current behaviour, "
+ "change it to '.+'", FutureWarning),
+ # Element.getchildren() and Element.getiterator() are deprecated.
+ ("This method will be removed in future versions. "
+ "Use .+ instead.", DeprecationWarning),
+ ("This method will be removed in future versions. "
+ "Use .+ instead.", PendingDeprecationWarning),
+ # XMLParser.doctype() is deprecated.
+ ("This method of XMLParser is deprecated. Define doctype.. "
+ "method on the TreeBuilder target.", DeprecationWarning))
+ self.checkwarnings = support.check_warnings(*deprecations, quiet=quiet)
+
+ def __enter__(self):
+ from xml.etree import ElementTree
+ self._nsmap = ElementTree._namespace_map
+ self._path_cache = ElementTree.ElementPath._cache
+ # Copy the default namespace mapping
+ ElementTree._namespace_map = self._nsmap.copy()
+ # Copy the path cache (should be empty)
+ ElementTree.ElementPath._cache = self._path_cache.copy()
+ self.checkwarnings.__enter__()
+
+ def __exit__(self, *args):
+ from xml.etree import ElementTree
+ # Restore mapping and path cache
+ ElementTree._namespace_map = self._nsmap
+ ElementTree.ElementPath._cache = self._path_cache
+ self.checkwarnings.__exit__(*args)
+
+
+def test_main(module_name='xml.etree.ElementTree'):
from test import test_xml_etree
- support.run_doctest(test_xml_etree, verbosity=True)
+
+ use_py_module = (module_name == 'xml.etree.ElementTree')
+
+ # The same doctests are used for both the Python and the C implementations
+ assert test_xml_etree.ET.__name__ == module_name
+
+ # XXX the C module should give the same warnings as the Python module
+ with CleanContext(quiet=not use_py_module):
+ support.run_doctest(test_xml_etree, verbosity=True)
+
+ # The module should not be changed by the tests
+ assert test_xml_etree.ET.__name__ == module_name
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py
index c48276afa3..db69e5f2c5 100644
--- a/Lib/test/test_xml_etree_c.py
+++ b/Lib/test/test_xml_etree_c.py
@@ -1,218 +1,37 @@
# xml.etree test for cElementTree
-import doctest
-import sys
-
from test import support
from test.support import precisionbigmemtest, _2G
import unittest
-ET = support.import_module('xml.etree.cElementTree')
-
-SAMPLE_XML = """
-<body>
- <tag>text</tag>
- <tag />
- <section>
- <tag>subtext</tag>
- </section>
-</body>
-"""
-
-SAMPLE_XML_NS = """
-<body xmlns="http://effbot.org/ns">
- <tag>text</tag>
- <tag />
- <section>
- <tag>subtext</tag>
- </section>
-</body>
-"""
+cET = support.import_module('xml.etree.cElementTree')
+
+
+# cElementTree specific tests
def sanity():
- """
+ r"""
Import sanity.
>>> from xml.etree import cElementTree
- """
-def check_method(method):
- if not hasattr(method, '__call__'):
- print(method, "not callable")
+ Issue #6697.
-def serialize(ET, elem):
- import io
- file = io.StringIO()
- tree = ET.ElementTree(elem)
- tree.write(file)
- return file.getvalue()
-
-def summarize(elem):
- return elem.tag
-
-def summarize_list(seq):
- return list(map(summarize, seq))
-
-def interface():
- """
- Test element tree interface.
-
- >>> element = ET.Element("tag", key="value")
- >>> tree = ET.ElementTree(element)
-
- Make sure all standard element methods exist.
-
- >>> check_method(element.append)
- >>> check_method(element.insert)
- >>> check_method(element.remove)
- >>> check_method(element.getchildren)
- >>> check_method(element.find)
- >>> check_method(element.findall)
- >>> check_method(element.findtext)
- >>> check_method(element.clear)
- >>> check_method(element.get)
- >>> check_method(element.set)
- >>> check_method(element.keys)
- >>> check_method(element.items)
- >>> check_method(element.getiterator)
-
- Basic method sanity checks.
-
- >>> serialize(ET, element) # 1
- '<tag key="value" />'
- >>> subelement = ET.Element("subtag")
- >>> element.append(subelement)
- >>> serialize(ET, element) # 2
- '<tag key="value"><subtag /></tag>'
- >>> element.insert(0, subelement)
- >>> serialize(ET, element) # 3
- '<tag key="value"><subtag /><subtag /></tag>'
- >>> element.remove(subelement)
- >>> serialize(ET, element) # 4
- '<tag key="value"><subtag /></tag>'
- >>> element.remove(subelement)
- >>> serialize(ET, element) # 5
- '<tag key="value" />'
- >>> element.remove(subelement)
+ >>> e = cElementTree.Element('a')
+ >>> getattr(e, '\uD800') # doctest: +ELLIPSIS
Traceback (most recent call last):
- ValueError: list.remove(x): x not in list
- >>> serialize(ET, element) # 6
- '<tag key="value" />'
- """
-
-def find():
- """
- Test find methods (including xpath syntax).
-
- >>> elem = ET.XML(SAMPLE_XML)
- >>> elem.find("tag").tag
- 'tag'
- >>> ET.ElementTree(elem).find("tag").tag
- 'tag'
- >>> elem.find("section/tag").tag
- 'tag'
- >>> ET.ElementTree(elem).find("section/tag").tag
- 'tag'
- >>> elem.findtext("tag")
- 'text'
- >>> elem.findtext("tog")
- >>> elem.findtext("tog", "default")
- 'default'
- >>> ET.ElementTree(elem).findtext("tag")
- 'text'
- >>> elem.findtext("section/tag")
- 'subtext'
- >>> ET.ElementTree(elem).findtext("section/tag")
- 'subtext'
- >>> summarize_list(elem.findall("tag"))
- ['tag', 'tag']
- >>> summarize_list(elem.findall("*"))
- ['tag', 'tag', 'section']
- >>> summarize_list(elem.findall(".//tag"))
- ['tag', 'tag', 'tag']
- >>> summarize_list(elem.findall("section/tag"))
- ['tag']
- >>> summarize_list(elem.findall("section//tag"))
- ['tag']
- >>> summarize_list(elem.findall("section/*"))
- ['tag']
- >>> summarize_list(elem.findall("section//*"))
- ['tag']
- >>> summarize_list(elem.findall("section/.//*"))
- ['tag']
- >>> summarize_list(elem.findall("*/*"))
- ['tag']
- >>> summarize_list(elem.findall("*//*"))
- ['tag']
- >>> summarize_list(elem.findall("*/tag"))
- ['tag']
- >>> summarize_list(elem.findall("*/./tag"))
- ['tag']
- >>> summarize_list(elem.findall("./tag"))
- ['tag', 'tag']
- >>> summarize_list(elem.findall(".//tag"))
- ['tag', 'tag', 'tag']
- >>> summarize_list(elem.findall("././tag"))
- ['tag', 'tag']
- >>> summarize_list(ET.ElementTree(elem).findall("/tag"))
- ['tag', 'tag']
- >>> summarize_list(ET.ElementTree(elem).findall("./tag"))
- ['tag', 'tag']
- >>> elem = ET.XML(SAMPLE_XML_NS)
- >>> summarize_list(elem.findall("tag"))
- []
- >>> summarize_list(elem.findall("{http://effbot.org/ns}tag"))
- ['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag']
- >>> summarize_list(elem.findall(".//{http://effbot.org/ns}tag"))
- ['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag']
- """
-
-def parseliteral():
- r"""
-
- >>> element = ET.XML("<html><body>text</body></html>")
- >>> ET.ElementTree(element).write(sys.stdout)
- <html><body>text</body></html>
- >>> element = ET.fromstring("<html><body>text</body></html>")
- >>> ET.ElementTree(element).write(sys.stdout)
- <html><body>text</body></html>
- >>> print(ET.tostring(element))
- <html><body>text</body></html>
- >>> print(repr(ET.tostring(element, "ascii")))
- b"<?xml version='1.0' encoding='ascii'?>\n<html><body>text</body></html>"
- >>> _, ids = ET.XMLID("<html><body>text</body></html>")
- >>> len(ids)
- 0
- >>> _, ids = ET.XMLID("<html><body id='body'>text</body></html>")
- >>> len(ids)
- 1
- >>> ids["body"].tag
- 'body'
- """
+ ...
+ UnicodeEncodeError: ...
-def check_encoding(encoding):
- """
- >>> check_encoding("ascii")
- >>> check_encoding("us-ascii")
- >>> check_encoding("iso-8859-1")
- >>> check_encoding("iso-8859-15")
- >>> check_encoding("cp437")
- >>> check_encoding("mac-roman")
+ >>> p = cElementTree.XMLParser()
+ >>> p.version.split()[0]
+ 'Expat'
+ >>> getattr(p, '\uD800')
+ Traceback (most recent call last):
+ ...
+ AttributeError: 'XMLParser' object has no attribute '\ud800'
"""
- ET.XML(
- "<?xml version='1.0' encoding='%s'?><xml />" % encoding
- )
-def bug_1534630():
- """
- >>> bob = ET.TreeBuilder()
- >>> e = bob.data("data")
- >>> e = bob.start("tag", {})
- >>> e = bob.end("tag")
- >>> e = bob.close()
- >>> serialize(ET, e)
- '<tag />'
- """
class MiscTests(unittest.TestCase):
# Issue #8651.
@@ -221,7 +40,7 @@ class MiscTests(unittest.TestCase):
if size < support._2G + 100:
self.skipTest("not enough free memory, need at least 2 GB")
data = b'x' * size
- parser = ET.XMLParser()
+ parser = cET.XMLParser()
try:
self.assertRaises(OverflowError, parser.feed, data)
finally:
@@ -229,10 +48,26 @@ class MiscTests(unittest.TestCase):
def test_main():
- from test import test_xml_etree_c
+ from test import test_xml_etree, test_xml_etree_c
+
+ # Run the tests specific to the C implementation
support.run_doctest(test_xml_etree_c, verbosity=True)
support.run_unittest(MiscTests)
+ # Assign the C implementation before running the doctests
+ # Patch the __name__, to prevent confusion with the pure Python test
+ pyET = test_xml_etree.ET
+ py__name__ = test_xml_etree.__name__
+ test_xml_etree.ET = cET
+ if __name__ != '__main__':
+ test_xml_etree.__name__ = __name__
+ try:
+ # Run the same test suite as xml.etree.ElementTree
+ test_xml_etree.test_main(module_name='xml.etree.cElementTree')
+ finally:
+ test_xml_etree.ET = pyET
+ test_xml_etree.__name__ = py__name__
+
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index 9833f2674f..102f892d47 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -5,13 +5,19 @@ import time
import unittest
import xmlrpc.client as xmlrpclib
import xmlrpc.server
-import threading
import http.client
import socket
import os
import re
+import io
+import contextlib
from test import support
+try:
+ import threading
+except ImportError:
+ threading = None
+
alist = [{'astring': 'foo@bar.baz.spam',
'afloat': 7283.43,
'anint': 2**20,
@@ -73,11 +79,11 @@ class XMLRPCTestCase(unittest.TestCase):
d = xmlrpclib.DateTime()
((new_d,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((d,),
methodresponse=True))
- self.assertTrue(isinstance(new_d.value, str))
+ self.assertIsInstance(new_d.value, str)
# Check that the output of dumps() is still an 8-bit string
s = xmlrpclib.dumps((new_d,), methodresponse=True)
- self.assertTrue(isinstance(s, str))
+ self.assertIsInstance(s, str)
def test_newstyle_class(self):
class T(object):
@@ -259,7 +265,7 @@ ADDR = PORT = URL = None
# The evt is set twice. First when the server is ready to serve.
# Second when the server has been shutdown. The user must clear
# the event after it has been set the first time to catch the second set.
-def http_server(evt, numrequests):
+def http_server(evt, numrequests, requestHandler=None):
class TestInstanceClass:
def div(self, x, y):
return x // y
@@ -280,7 +286,9 @@ def http_server(evt, numrequests):
s.setblocking(True)
return s, port
- serv = MyXMLRPCServer(("localhost", 0),
+ if not requestHandler:
+ requestHandler = xmlrpc.server.SimpleXMLRPCRequestHandler
+ serv = MyXMLRPCServer(("localhost", 0), requestHandler,
logRequests=False, bind_and_activate=False)
try:
serv.server_bind()
@@ -312,6 +320,66 @@ def http_server(evt, numrequests):
PORT = None
evt.set()
+def http_multi_server(evt, numrequests, requestHandler=None):
+ class TestInstanceClass:
+ def div(self, x, y):
+ return x // y
+
+ def _methodHelp(self, name):
+ if name == 'div':
+ return 'This is the div function'
+
+ def my_function():
+ '''This is my function'''
+ return True
+
+ class MyXMLRPCServer(xmlrpc.server.MultiPathXMLRPCServer):
+ def get_request(self):
+ # Ensure the socket is always non-blocking. On Linux, socket
+ # attributes are not inherited like they are on *BSD and Windows.
+ s, port = self.socket.accept()
+ s.setblocking(True)
+ return s, port
+
+ if not requestHandler:
+ requestHandler = xmlrpc.server.SimpleXMLRPCRequestHandler
+ class MyRequestHandler(requestHandler):
+ rpc_paths = []
+
+ serv = MyXMLRPCServer(("localhost", 0), MyRequestHandler,
+ logRequests=False, bind_and_activate=False)
+ serv.socket.settimeout(3)
+ serv.server_bind()
+ try:
+ global ADDR, PORT, URL
+ ADDR, PORT = serv.socket.getsockname()
+ #connect to IP address directly. This avoids socket.create_connection()
+ #trying to connect to to "localhost" using all address families, which
+ #causes slowdown e.g. on vista which supports AF_INET6. The server listens
+ #on AF_INET only.
+ URL = "http://%s:%d"%(ADDR, PORT)
+ serv.server_activate()
+ paths = ["/foo", "/foo/bar"]
+ for path in paths:
+ d = serv.add_dispatcher(path, xmlrpc.server.SimpleXMLRPCDispatcher())
+ d.register_introspection_functions()
+ d.register_multicall_functions()
+ serv.get_dispatcher(paths[0]).register_function(pow)
+ serv.get_dispatcher(paths[1]).register_function(lambda x,y: x+y, 'add')
+ evt.set()
+
+ # handle up to 'numrequests' requests
+ while numrequests > 0:
+ serv.handle_request()
+ numrequests -= 1
+
+ except socket.timeout:
+ pass
+ finally:
+ serv.socket.close()
+ PORT = None
+ evt.set()
+
# This function prevents errors like:
# <ProtocolError for localhost:57527/RPC2: 500 Internal Server Error>
def is_unavailable_exception(e):
@@ -331,15 +399,36 @@ def is_unavailable_exception(e):
if exc_mess and 'temporarily unavailable' in exc_mess.lower():
return True
-class SimpleServerTestCase(unittest.TestCase):
+def make_request_and_skipIf(condition, reason):
+ # If we skip the test, we have to make a request because the
+ # the server created in setUp blocks expecting one to come in.
+ if not condition:
+ return lambda func: func
+ def decorator(func):
+ def make_request_and_skip(self):
+ try:
+ xmlrpclib.ServerProxy(URL).my_function()
+ except (xmlrpclib.ProtocolError, socket.error) as e:
+ if not is_unavailable_exception(e):
+ raise
+ raise unittest.SkipTest(reason)
+ return make_request_and_skip
+ return decorator
+
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class BaseServerTestCase(unittest.TestCase):
+ requestHandler = None
+ request_count = 1
+ threadFunc = staticmethod(http_server)
+
def setUp(self):
# enable traceback reporting
xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = True
self.evt = threading.Event()
# start server thread to handle requests
- serv_args = (self.evt, 1)
- threading.Thread(target=http_server, args=serv_args).start()
+ serv_args = (self.evt, self.request_count, self.requestHandler)
+ threading.Thread(target=self.threadFunc, args=serv_args).start()
# wait for the server to be ready
self.evt.wait()
@@ -348,6 +437,7 @@ class SimpleServerTestCase(unittest.TestCase):
def tearDown(self):
# wait on the server thread to terminate
self.evt.wait(4.0)
+ # XXX this code does not work, and in fact stop_serving doesn't exist.
if not self.evt.is_set():
self.evt.set()
stop_serving()
@@ -356,6 +446,7 @@ class SimpleServerTestCase(unittest.TestCase):
# disable traceback reporting
xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = False
+class SimpleServerTestCase(BaseServerTestCase):
def test_simple1(self):
try:
p = xmlrpclib.ServerProxy(URL)
@@ -418,6 +509,8 @@ class SimpleServerTestCase(unittest.TestCase):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
+ @make_request_and_skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_introspection3(self):
try:
# test native doc
@@ -491,6 +584,184 @@ class SimpleServerTestCase(unittest.TestCase):
# This avoids waiting for the socket timeout.
self.test_simple1()
+class MultiPathServerTestCase(BaseServerTestCase):
+ threadFunc = staticmethod(http_multi_server)
+ request_count = 2
+ def test_path1(self):
+ p = xmlrpclib.ServerProxy(URL+"/foo")
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)
+ def test_path2(self):
+ p = xmlrpclib.ServerProxy(URL+"/foo/bar")
+ self.assertEqual(p.add(6,8), 6+8)
+ self.assertRaises(xmlrpclib.Fault, p.pow, 6, 8)
+
+#A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism
+#does indeed serve subsequent requests on the same connection
+class BaseKeepaliveServerTestCase(BaseServerTestCase):
+ #a request handler that supports keep-alive and logs requests into a
+ #class variable
+ class RequestHandler(xmlrpc.server.SimpleXMLRPCRequestHandler):
+ parentClass = xmlrpc.server.SimpleXMLRPCRequestHandler
+ protocol_version = 'HTTP/1.1'
+ myRequests = []
+ def handle(self):
+ self.myRequests.append([])
+ self.reqidx = len(self.myRequests)-1
+ return self.parentClass.handle(self)
+ def handle_one_request(self):
+ result = self.parentClass.handle_one_request(self)
+ self.myRequests[self.reqidx].append(self.raw_requestline)
+ return result
+
+ requestHandler = RequestHandler
+ def setUp(self):
+ #clear request log
+ self.RequestHandler.myRequests = []
+ return BaseServerTestCase.setUp(self)
+
+#A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism
+#does indeed serve subsequent requests on the same connection
+class KeepaliveServerTestCase1(BaseKeepaliveServerTestCase):
+ def test_two(self):
+ p = xmlrpclib.ServerProxy(URL)
+ #do three requests.
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ p("close")()
+
+ #they should have all been handled by a single request handler
+ self.assertEqual(len(self.RequestHandler.myRequests), 1)
+
+ #check that we did at least two (the third may be pending append
+ #due to thread scheduling)
+ self.assertGreaterEqual(len(self.RequestHandler.myRequests[-1]), 2)
+
+
+#test special attribute access on the serverproxy, through the __call__
+#function.
+class KeepaliveServerTestCase2(BaseKeepaliveServerTestCase):
+ #ask for two keepalive requests to be handled.
+ request_count=2
+
+ def test_close(self):
+ p = xmlrpclib.ServerProxy(URL)
+ #do some requests with close.
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ p("close")() #this should trigger a new keep-alive request
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ p("close")()
+
+ #they should have all been two request handlers, each having logged at least
+ #two complete requests
+ self.assertEqual(len(self.RequestHandler.myRequests), 2)
+ self.assertGreaterEqual(len(self.RequestHandler.myRequests[-1]), 2)
+ self.assertGreaterEqual(len(self.RequestHandler.myRequests[-2]), 2)
+
+
+ def test_transport(self):
+ p = xmlrpclib.ServerProxy(URL)
+ #do some requests with close.
+ self.assertEqual(p.pow(6,8), 6**8)
+ p("transport").close() #same as above, really.
+ self.assertEqual(p.pow(6,8), 6**8)
+ p("close")()
+ self.assertEqual(len(self.RequestHandler.myRequests), 2)
+
+#A test case that verifies that gzip encoding works in both directions
+#(for a request and the response)
+class GzipServerTestCase(BaseServerTestCase):
+ #a request handler that supports keep-alive and logs requests into a
+ #class variable
+ class RequestHandler(xmlrpc.server.SimpleXMLRPCRequestHandler):
+ parentClass = xmlrpc.server.SimpleXMLRPCRequestHandler
+ protocol_version = 'HTTP/1.1'
+
+ def do_POST(self):
+ #store content of last request in class
+ self.__class__.content_length = int(self.headers["content-length"])
+ return self.parentClass.do_POST(self)
+ requestHandler = RequestHandler
+
+ class Transport(xmlrpclib.Transport):
+ #custom transport, stores the response length for our perusal
+ fake_gzip = False
+ def parse_response(self, response):
+ self.response_length=int(response.getheader("content-length", 0))
+ return xmlrpclib.Transport.parse_response(self, response)
+
+ def send_content(self, connection, body):
+ if self.fake_gzip:
+ #add a lone gzip header to induce decode error remotely
+ connection.putheader("Content-Encoding", "gzip")
+ return xmlrpclib.Transport.send_content(self, connection, body)
+
+ def setUp(self):
+ BaseServerTestCase.setUp(self)
+
+ def test_gzip_request(self):
+ t = self.Transport()
+ t.encode_threshold = None
+ p = xmlrpclib.ServerProxy(URL, transport=t)
+ self.assertEqual(p.pow(6,8), 6**8)
+ a = self.RequestHandler.content_length
+ t.encode_threshold = 0 #turn on request encoding
+ self.assertEqual(p.pow(6,8), 6**8)
+ b = self.RequestHandler.content_length
+ self.assertTrue(a>b)
+ p("close")()
+
+ def test_bad_gzip_request(self):
+ t = self.Transport()
+ t.encode_threshold = None
+ t.fake_gzip = True
+ p = xmlrpclib.ServerProxy(URL, transport=t)
+ cm = self.assertRaisesRegex(xmlrpclib.ProtocolError,
+ re.compile(r"\b400\b"))
+ with cm:
+ p.pow(6, 8)
+ p("close")()
+
+ def test_gsip_response(self):
+ t = self.Transport()
+ p = xmlrpclib.ServerProxy(URL, transport=t)
+ old = self.requestHandler.encode_threshold
+ self.requestHandler.encode_threshold = None #no encoding
+ self.assertEqual(p.pow(6,8), 6**8)
+ a = t.response_length
+ self.requestHandler.encode_threshold = 0 #always encode
+ self.assertEqual(p.pow(6,8), 6**8)
+ p("close")()
+ b = t.response_length
+ self.requestHandler.encode_threshold = old
+ self.assertTrue(a>b)
+
+#Test special attributes of the ServerProxy object
+class ServerProxyTestCase(unittest.TestCase):
+ def setUp(self):
+ unittest.TestCase.setUp(self)
+ if threading:
+ self.url = URL
+ else:
+ # Without threading, http_server() and http_multi_server() will not
+ # be executed and URL is still equal to None. 'http://' is a just
+ # enough to choose the scheme (HTTP)
+ self.url = 'http://'
+
+ def test_close(self):
+ p = xmlrpclib.ServerProxy(self.url)
+ self.assertEqual(p('close')(), None)
+
+ def test_transport(self):
+ t = xmlrpclib.Transport()
+ p = xmlrpclib.ServerProxy(self.url, transport=t)
+ self.assertEqual(p('transport'), t)
+
# This is a contrived way to make a failure occur on the server side
# in order to test the _send_traceback_header flag on the server
class FailingMessageClass(http.client.HTTPMessage):
@@ -501,6 +772,7 @@ class FailingMessageClass(http.client.HTTPMessage):
return super().get(key, failobj)
+@unittest.skipUnless(threading, 'Threading required for this test.')
class FailingServerTestCase(unittest.TestCase):
def setUp(self):
self.evt = threading.Event()
@@ -576,6 +848,21 @@ class FailingServerTestCase(unittest.TestCase):
else:
self.fail('ProtocolError not raised')
+
+@contextlib.contextmanager
+def captured_stdout(encoding='utf-8'):
+ """A variation on support.captured_stdout() which gives a text stream
+ having a `buffer` attribute.
+ """
+ import io
+ orig_stdout = sys.stdout
+ sys.stdout = io.TextIOWrapper(io.BytesIO(), encoding=encoding)
+ try:
+ yield sys.stdout
+ finally:
+ sys.stdout = orig_stdout
+
+
class CGIHandlerTestCase(unittest.TestCase):
def setUp(self):
self.cgi = xmlrpc.server.CGIXMLRPCRequestHandler()
@@ -588,54 +875,45 @@ class CGIHandlerTestCase(unittest.TestCase):
env['REQUEST_METHOD'] = 'GET'
# if the method is GET and no request_text is given, it runs handle_get
# get sysout output
- tmp = sys.stdout
- sys.stdout = open(support.TESTFN, "w")
- self.cgi.handle_request()
- sys.stdout.close()
- sys.stdout = tmp
+ with captured_stdout(encoding=self.cgi.encoding) as data_out:
+ self.cgi.handle_request()
# parse Status header
- handle = open(support.TESTFN, "r").read()
+ data_out.seek(0)
+ handle = data_out.read()
status = handle.split()[1]
message = ' '.join(handle.split()[2:4])
self.assertEqual(status, '400')
self.assertEqual(message, 'Bad Request')
- os.remove(support.TESTFN)
def test_cgi_xmlrpc_response(self):
data = """<?xml version='1.0'?>
-<methodCall>
- <methodName>test_method</methodName>
- <params>
- <param>
- <value><string>foo</string></value>
- </param>
- <param>
- <value><string>bar</string></value>
- </param>
- </params>
-</methodCall>
-"""
- open("xmldata.txt", "w").write(data)
- tmp1 = sys.stdin
- tmp2 = sys.stdout
-
- sys.stdin = open("xmldata.txt", "r")
- sys.stdout = open(support.TESTFN, "w")
-
- with support.EnvironmentVarGuard() as env:
+ <methodCall>
+ <methodName>test_method</methodName>
+ <params>
+ <param>
+ <value><string>foo</string></value>
+ </param>
+ <param>
+ <value><string>bar</string></value>
+ </param>
+ </params>
+ </methodCall>
+ """
+
+ with support.EnvironmentVarGuard() as env, \
+ captured_stdout(encoding=self.cgi.encoding) as data_out, \
+ support.captured_stdin() as data_in:
+ data_in.write(data)
+ data_in.seek(0)
env['CONTENT_LENGTH'] = str(len(data))
self.cgi.handle_request()
-
- sys.stdin.close()
- sys.stdout.close()
- sys.stdin = tmp1
- sys.stdout = tmp2
+ data_out.seek(0)
# will respond exception, if so, our goal is achieved ;)
- handle = open(support.TESTFN, "r").read()
+ handle = data_out.read()
# start with 44th char so as not to get http header, we just
# need only xml
@@ -652,14 +930,21 @@ class CGIHandlerTestCase(unittest.TestCase):
int(re.search('Content-Length: (\d+)', handle).group(1)),
len(content))
- os.remove("xmldata.txt")
- os.remove(support.TESTFN)
-
+@support.reap_threads
def test_main():
xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase,
BinaryTestCase, FaultTestCase]
xmlrpc_tests.append(SimpleServerTestCase)
+ xmlrpc_tests.append(KeepaliveServerTestCase1)
+ xmlrpc_tests.append(KeepaliveServerTestCase2)
+ try:
+ import gzip
+ xmlrpc_tests.append(GzipServerTestCase)
+ except ImportError:
+ pass #gzip not supported in this build
+ xmlrpc_tests.append(MultiPathServerTestCase)
+ xmlrpc_tests.append(ServerProxyTestCase)
xmlrpc_tests.append(FailingServerTestCase)
xmlrpc_tests.append(CGIHandlerTestCase)
diff --git a/Lib/test/test_xmlrpc_net.py b/Lib/test/test_xmlrpc_net.py
index b8426acb5c..5df79f0fb6 100644
--- a/Lib/test/test_xmlrpc_net.py
+++ b/Lib/test/test_xmlrpc_net.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import collections
import errno
@@ -48,7 +48,7 @@ class CurrentTimeTest(unittest.TestCase):
# Perform a minimal sanity check on the result, just to be sure
# the request means what we think it means.
- self.assertTrue(isinstance(builders, collections.Sequence), type(builders))
+ self.assertIsInstance(builders, collections.Sequence)
self.assertTrue([x for x in builders if "3.x" in x], builders)
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 34d0fbcb72..90aab8689c 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -3,23 +3,35 @@ try:
import zlib
except ImportError:
zlib = None
-import zipfile, os, unittest, sys, shutil, struct, io
+
+import io
+import os
+import sys
+import imp
+import time
+import shutil
+import struct
+import zipfile
+import unittest
+
from tempfile import TemporaryFile
from random import randint, random
+from unittest import skipUnless
-import test.support as support
-from test.support import TESTFN, run_unittest, findfile
+from test.support import TESTFN, run_unittest, findfile, unlink
TESTFN2 = TESTFN + "2"
TESTFNDIR = TESTFN + "d"
FIXEDTEST_SIZE = 1000
+DATAFILES_DIR = 'zipfile_datafiles'
SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'),
('ziptest2dir/_ziptest2', 'qawsedrftg'),
('/ziptest2dir/ziptest3dir/_ziptest3', 'azsxdcfvgb'),
('ziptest2dir/ziptest3dir/ziptest4dir/_ziptest3', '6y7u8i9o0p')]
+
class TestsWithSourceFile(unittest.TestCase):
def setUp(self):
self.line_gen = (bytes("Zipfile test line %d. random float: %f" %
@@ -28,368 +40,467 @@ class TestsWithSourceFile(unittest.TestCase):
self.data = b'\n'.join(self.line_gen) + b'\n'
# Make a source file with some lines
- fp = open(TESTFN, "wb")
- fp.write(self.data)
- fp.close()
+ with open(TESTFN, "wb") as fp:
+ fp.write(self.data)
- def makeTestArchive(self, f, compression):
+ def make_test_archive(self, f, compression):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(f, "w", compression)
- zipfp.write(TESTFN, "another.name")
- zipfp.write(TESTFN, TESTFN)
- zipfp.writestr("strfile", self.data)
- zipfp.close()
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ zipfp.write(TESTFN, "another.name")
+ zipfp.write(TESTFN, TESTFN)
+ zipfp.writestr("strfile", self.data)
- def zipTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- self.assertEqual(zipfp.read(TESTFN), self.data)
- self.assertEqual(zipfp.read("another.name"), self.data)
- self.assertEqual(zipfp.read("strfile"), self.data)
-
- # Print the ZIP directory
- fp = io.StringIO()
- zipfp.printdir(file=fp)
-
- directory = fp.getvalue()
- lines = directory.splitlines()
- self.assertEqual(len(lines), 4) # Number of files + header
-
- self.assertTrue('File Name' in lines[0])
- self.assertTrue('Modified' in lines[0])
- self.assertTrue('Size' in lines[0])
-
- fn, date, time, size = lines[1].split()
- self.assertEqual(fn, 'another.name')
- # XXX: timestamp is not tested
- self.assertEqual(size, str(len(self.data)))
-
- # Check the namelist
- names = zipfp.namelist()
- self.assertEqual(len(names), 3)
- self.assertTrue(TESTFN in names)
- self.assertTrue("another.name" in names)
- self.assertTrue("strfile" in names)
-
- # Check infolist
- infos = zipfp.infolist()
- names = [ i.filename for i in infos ]
- self.assertEqual(len(names), 3)
- self.assertTrue(TESTFN in names)
- self.assertTrue("another.name" in names)
- self.assertTrue("strfile" in names)
- for i in infos:
- self.assertEqual(i.file_size, len(self.data))
-
- # check getinfo
- for nm in (TESTFN, "another.name", "strfile"):
- info = zipfp.getinfo(nm)
- self.assertEqual(info.filename, nm)
- self.assertEqual(info.file_size, len(self.data))
-
- # Check that testzip doesn't raise an exception
- zipfp.testzip()
- zipfp.close()
-
- def testStored(self):
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ self.assertEqual(zipfp.read(TESTFN), self.data)
+ self.assertEqual(zipfp.read("another.name"), self.data)
+ self.assertEqual(zipfp.read("strfile"), self.data)
+
+ # Print the ZIP directory
+ fp = io.StringIO()
+ zipfp.printdir(file=fp)
+ directory = fp.getvalue()
+ lines = directory.splitlines()
+ self.assertEqual(len(lines), 4) # Number of files + header
+
+ self.assertIn('File Name', lines[0])
+ self.assertIn('Modified', lines[0])
+ self.assertIn('Size', lines[0])
+
+ fn, date, time_, size = lines[1].split()
+ self.assertEqual(fn, 'another.name')
+ self.assertTrue(time.strptime(date, '%Y-%m-%d'))
+ self.assertTrue(time.strptime(time_, '%H:%M:%S'))
+ self.assertEqual(size, str(len(self.data)))
+
+ # Check the namelist
+ names = zipfp.namelist()
+ self.assertEqual(len(names), 3)
+ self.assertIn(TESTFN, names)
+ self.assertIn("another.name", names)
+ self.assertIn("strfile", names)
+
+ # Check infolist
+ infos = zipfp.infolist()
+ names = [i.filename for i in infos]
+ self.assertEqual(len(names), 3)
+ self.assertIn(TESTFN, names)
+ self.assertIn("another.name", names)
+ self.assertIn("strfile", names)
+ for i in infos:
+ self.assertEqual(i.file_size, len(self.data))
+
+ # check getinfo
+ for nm in (TESTFN, "another.name", "strfile"):
+ info = zipfp.getinfo(nm)
+ self.assertEqual(info.filename, nm)
+ self.assertEqual(info.file_size, len(self.data))
+
+ # Check that testzip doesn't raise an exception
+ zipfp.testzip()
+ if not isinstance(f, str):
+ f.close()
+
+ def test_stored(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipTest(f, zipfile.ZIP_STORED)
+ self.zip_test(f, zipfile.ZIP_STORED)
- def zipOpenTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_open_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- zipdata1 = []
- zipopen1 = zipfp.open(TESTFN)
- while 1:
- read_data = zipopen1.read(256)
- if not read_data:
- break
- zipdata1.append(read_data)
-
- zipdata2 = []
- zipopen2 = zipfp.open("another.name")
- while 1:
- read_data = zipopen2.read(256)
- if not read_data:
- break
- zipdata2.append(read_data)
-
- self.assertEqual(b''.join(zipdata1), self.data)
- self.assertEqual(b''.join(zipdata2), self.data)
- zipfp.close()
-
- def testOpenStored(self):
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ zipdata1 = []
+ with zipfp.open(TESTFN) as zipopen1:
+ while True:
+ read_data = zipopen1.read(256)
+ if not read_data:
+ break
+ zipdata1.append(read_data)
+
+ zipdata2 = []
+ with zipfp.open("another.name") as zipopen2:
+ while True:
+ read_data = zipopen2.read(256)
+ if not read_data:
+ break
+ zipdata2.append(read_data)
+
+ self.assertEqual(b''.join(zipdata1), self.data)
+ self.assertEqual(b''.join(zipdata2), self.data)
+ if not isinstance(f, str):
+ f.close()
+
+ def test_open_stored(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipOpenTest(f, zipfile.ZIP_STORED)
+ self.zip_open_test(f, zipfile.ZIP_STORED)
- def testOpenViaZipInfo(self):
+ def test_open_via_zip_info(self):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- zipfp.writestr("name", "foo")
- zipfp.writestr("name", "bar")
- zipfp.close()
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ zipfp.writestr("name", "foo")
+ zipfp.writestr("name", "bar")
+
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp:
+ infos = zipfp.infolist()
+ data = b""
+ for info in infos:
+ with zipfp.open(info) as zipopen:
+ data += zipopen.read()
+ self.assertTrue(data == b"foobar" or data == b"barfoo")
+ data = b""
+ for info in infos:
+ data += zipfp.read(info)
+ self.assertTrue(data == b"foobar" or data == b"barfoo")
+
+ def zip_random_open_test(self, f, compression):
+ self.make_test_archive(f, compression)
- zipfp = zipfile.ZipFile(TESTFN2, "r")
- infos = zipfp.infolist()
- data = b""
- for info in infos:
- data += zipfp.open(info).read()
- self.assertTrue(data == b"foobar" or data == b"barfoo")
- data = b""
- for info in infos:
- data += zipfp.read(info)
- self.assertTrue(data == b"foobar" or data == b"barfoo")
- zipfp.close()
+ # Read the ZIP archive
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ zipdata1 = []
+ with zipfp.open(TESTFN) as zipopen1:
+ while True:
+ read_data = zipopen1.read(randint(1, 1024))
+ if not read_data:
+ break
+ zipdata1.append(read_data)
+
+ self.assertEqual(b''.join(zipdata1), self.data)
+ if not isinstance(f, str):
+ f.close()
+
+ def test_random_open_stored(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_random_open_test(f, zipfile.ZIP_STORED)
- def zipRandomOpenTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def test_univeral_readaheads(self):
+ f = io.BytesIO()
- # Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- zipdata1 = []
- zipopen1 = zipfp.open(TESTFN)
- while 1:
- read_data = zipopen1.read(randint(1, 1024))
- if not read_data:
- break
- zipdata1.append(read_data)
-
- self.assertEqual(b''.join(zipdata1), self.data)
+ data = b'a\r\n' * 16 * 1024
+ zipfp = zipfile.ZipFile(f, 'w', zipfile.ZIP_STORED)
+ zipfp.writestr(TESTFN, data)
zipfp.close()
- def testRandomOpenStored(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipRandomOpenTest(f, zipfile.ZIP_STORED)
+ data2 = b''
+ zipfp = zipfile.ZipFile(f, 'r')
+ with zipfp.open(TESTFN, 'rU') as zipopen:
+ for line in zipopen:
+ data2 += line
+ zipfp.close()
+
+ self.assertEqual(data, data2.replace(b'\n', b'\r\n'))
- def zipReadlineTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_readline_read_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
zipfp = zipfile.ZipFile(f, "r")
- zipopen = zipfp.open(TESTFN)
- for line in self.line_gen:
- linedata = zipopen.readline()
- self.assertEqual(linedata, line + '\n')
-
+ with zipfp.open(TESTFN) as zipopen:
+ data = b''
+ while True:
+ read = zipopen.readline()
+ if not read:
+ break
+ data += read
+
+ read = zipopen.read(100)
+ if not read:
+ break
+ data += read
+
+ self.assertEqual(data, self.data)
zipfp.close()
+ if not isinstance(f, str):
+ f.close()
- def zipReadlinesTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_readline_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- ziplines = zipfp.open(TESTFN).readlines()
- for line, zipline in zip(self.line_gen, ziplines):
- self.assertEqual(zipline, line + '\n')
-
- zipfp.close()
+ with zipfile.ZipFile(f, "r") as zipfp:
+ with zipfp.open(TESTFN) as zipopen:
+ for line in self.line_gen:
+ linedata = zipopen.readline()
+ self.assertEqual(linedata, line + '\n')
+ if not isinstance(f, str):
+ f.close()
- def zipIterlinesTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_readlines_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- for line, zipline in zip(self.line_gen, zipfp.open(TESTFN)):
- self.assertEqual(zipline, line + '\n')
+ with zipfile.ZipFile(f, "r") as zipfp:
+ with zipfp.open(TESTFN) as zipopen:
+ ziplines = zipopen.readlines()
+ for line, zipline in zip(self.line_gen, ziplines):
+ self.assertEqual(zipline, line + '\n')
+ if not isinstance(f, str):
+ f.close()
- zipfp.close()
+ def zip_iterlines_test(self, f, compression):
+ self.make_test_archive(f, compression)
- def testReadlineStored(self):
+ # Read the ZIP archive
+ with zipfile.ZipFile(f, "r") as zipfp:
+ with zipfp.open(TESTFN) as zipopen:
+ for line, zipline in zip(self.line_gen, zipopen):
+ self.assertEqual(zipline, line + '\n')
+ if not isinstance(f, str):
+ f.close()
+
+ def test_readline_read_stored(self):
+ # Issue #7610: calls to readline() interleaved with calls to read().
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipReadlineTest(f, zipfile.ZIP_STORED)
+ self.zip_readline_read_test(f, zipfile.ZIP_STORED)
- def testReadlinesStored(self):
+ def test_readline_stored(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipReadlinesTest(f, zipfile.ZIP_STORED)
+ self.zip_readline_test(f, zipfile.ZIP_STORED)
- def testIterlinesStored(self):
+ def test_readlines_stored(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipIterlinesTest(f, zipfile.ZIP_STORED)
+ self.zip_readlines_test(f, zipfile.ZIP_STORED)
- if zlib:
- def testDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipTest(f, zipfile.ZIP_DEFLATED)
+ def test_iterlines_stored(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_iterlines_test(f, zipfile.ZIP_STORED)
- def testOpenDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipOpenTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_test(f, zipfile.ZIP_DEFLATED)
- def testRandomOpenDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipRandomOpenTest(f, zipfile.ZIP_DEFLATED)
- def testReadlineDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipReadlineTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_open_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_open_test(f, zipfile.ZIP_DEFLATED)
- def testReadlinesDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipReadlinesTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_random_open_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_random_open_test(f, zipfile.ZIP_DEFLATED)
- def testIterlinesDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipIterlinesTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readline_read_deflated(self):
+ # Issue #7610: calls to readline() interleaved with calls to read().
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_readline_read_test(f, zipfile.ZIP_DEFLATED)
- def testLowCompression(self):
- # Checks for cases where compressed data is larger than original
- # Create the ZIP archive
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED)
- zipfp.writestr("strfile", '12')
- zipfp.close()
+ @skipUnless(zlib, "requires zlib")
+ def test_readline_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_readline_test(f, zipfile.ZIP_DEFLATED)
- # Get an open object for strfile
- zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_DEFLATED)
- openobj = zipfp.open("strfile")
- self.assertEqual(openobj.read(1), b'1')
- self.assertEqual(openobj.read(1), b'2')
+ @skipUnless(zlib, "requires zlib")
+ def test_readlines_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_readlines_test(f, zipfile.ZIP_DEFLATED)
- def testAbsoluteArcnames(self):
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- zipfp.write(TESTFN, "/absolute")
- zipfp.close()
+ @skipUnless(zlib, "requires zlib")
+ def test_iterlines_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_iterlines_test(f, zipfile.ZIP_DEFLATED)
- zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED)
- self.assertEqual(zipfp.namelist(), ["absolute"])
- zipfp.close()
+ @skipUnless(zlib, "requires zlib")
+ def test_low_compression(self):
+ """Check for cases where compressed data is larger than original."""
+ # Create the ZIP archive
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED) as zipfp:
+ zipfp.writestr("strfile", '12')
- def testAppendToZipFile(self):
- # Test appending to an existing zipfile
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- zipfp.write(TESTFN, TESTFN)
- zipfp.close()
- zipfp = zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED)
- zipfp.writestr("strfile", self.data)
- self.assertEqual(zipfp.namelist(), [TESTFN, "strfile"])
- zipfp.close()
+ # Get an open object for strfile
+ with zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_DEFLATED) as zipfp:
+ with zipfp.open("strfile") as openobj:
+ self.assertEqual(openobj.read(1), b'1')
+ self.assertEqual(openobj.read(1), b'2')
- def testAppendToNonZipFile(self):
- # Test appending to an existing file that is not a zipfile
- # NOTE: this test fails if len(d) < 22 because of the first
- # line "fpin.seek(-22, 2)" in _EndRecData
- d = b'I am not a ZipFile!'*10
- f = open(TESTFN2, 'wb')
- f.write(d)
- f.close()
- zipfp = zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED)
- zipfp.write(TESTFN, TESTFN)
- zipfp.close()
+ def test_absolute_arcnames(self):
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ zipfp.write(TESTFN, "/absolute")
- f = open(TESTFN2, 'rb')
- f.seek(len(d))
- zipfp = zipfile.ZipFile(f, "r")
- self.assertEqual(zipfp.namelist(), [TESTFN])
- zipfp.close()
- f.close()
-
- def test_WriteDefaultName(self):
- # Check that calling ZipFile.write without arcname specified produces the expected result
- zipfp = zipfile.ZipFile(TESTFN2, "w")
- zipfp.write(TESTFN)
- self.assertEqual(zipfp.read(TESTFN), open(TESTFN, "rb").read())
- zipfp.close()
-
- def test_PerFileCompression(self):
- # Check that files within a Zip archive can have different compression options
- zipfp = zipfile.ZipFile(TESTFN2, "w")
- zipfp.write(TESTFN, 'storeme', zipfile.ZIP_STORED)
- zipfp.write(TESTFN, 'deflateme', zipfile.ZIP_DEFLATED)
- sinfo = zipfp.getinfo('storeme')
- dinfo = zipfp.getinfo('deflateme')
- self.assertEqual(sinfo.compress_type, zipfile.ZIP_STORED)
- self.assertEqual(dinfo.compress_type, zipfile.ZIP_DEFLATED)
- zipfp.close()
+ with zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) as zipfp:
+ self.assertEqual(zipfp.namelist(), ["absolute"])
- def test_WriteToReadonly(self):
- # Check that trying to call write() on a readonly ZipFile object
- # raises a RuntimeError
- zipf = zipfile.ZipFile(TESTFN2, mode="w")
- zipf.writestr("somefile.txt", "bogus")
- zipf.close()
- zipf = zipfile.ZipFile(TESTFN2, mode="r")
- self.assertRaises(RuntimeError, zipf.write, TESTFN)
- zipf.close()
+ def test_append_to_zip_file(self):
+ """Test appending to an existing zipfile."""
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ zipfp.write(TESTFN, TESTFN)
- def testExtract(self):
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- for fpath, fdata in SMALL_TEST_DATA:
- zipfp.writestr(fpath, fdata)
- zipfp.close()
+ with zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED) as zipfp:
+ zipfp.writestr("strfile", self.data)
+ self.assertEqual(zipfp.namelist(), [TESTFN, "strfile"])
- zipfp = zipfile.ZipFile(TESTFN2, "r")
- for fpath, fdata in SMALL_TEST_DATA:
- writtenfile = zipfp.extract(fpath)
+ def test_append_to_non_zip_file(self):
+ """Test appending to an existing file that is not a zipfile."""
+ # NOTE: this test fails if len(d) < 22 because of the first
+ # line "fpin.seek(-22, 2)" in _EndRecData
+ data = b'I am not a ZipFile!'*10
+ with open(TESTFN2, 'wb') as f:
+ f.write(data)
+
+ with zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED) as zipfp:
+ zipfp.write(TESTFN, TESTFN)
+
+ with open(TESTFN2, 'rb') as f:
+ f.seek(len(data))
+ with zipfile.ZipFile(f, "r") as zipfp:
+ self.assertEqual(zipfp.namelist(), [TESTFN])
+
+ def test_write_default_name(self):
+ """Check that calling ZipFile.write without arcname specified
+ produces the expected result."""
+ with zipfile.ZipFile(TESTFN2, "w") as zipfp:
+ zipfp.write(TESTFN)
+ with open(TESTFN, "rb") as f:
+ self.assertEqual(zipfp.read(TESTFN), f.read())
+
+ @skipUnless(zlib, "requires zlib")
+ def test_per_file_compression(self):
+ """Check that files within a Zip archive can have different
+ compression options."""
+ with zipfile.ZipFile(TESTFN2, "w") as zipfp:
+ zipfp.write(TESTFN, 'storeme', zipfile.ZIP_STORED)
+ zipfp.write(TESTFN, 'deflateme', zipfile.ZIP_DEFLATED)
+ sinfo = zipfp.getinfo('storeme')
+ dinfo = zipfp.getinfo('deflateme')
+ self.assertEqual(sinfo.compress_type, zipfile.ZIP_STORED)
+ self.assertEqual(dinfo.compress_type, zipfile.ZIP_DEFLATED)
+
+ def test_write_to_readonly(self):
+ """Check that trying to call write() on a readonly ZipFile object
+ raises a RuntimeError."""
+ with zipfile.ZipFile(TESTFN2, mode="w") as zipfp:
+ zipfp.writestr("somefile.txt", "bogus")
+
+ with zipfile.ZipFile(TESTFN2, mode="r") as zipfp:
+ self.assertRaises(RuntimeError, zipfp.write, TESTFN)
+
+ def test_extract(self):
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ zipfp.writestr(fpath, fdata)
+
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ writtenfile = zipfp.extract(fpath)
+
+ # make sure it was written to the right place
+ if os.path.isabs(fpath):
+ correctfile = os.path.join(os.getcwd(), fpath[1:])
+ else:
+ correctfile = os.path.join(os.getcwd(), fpath)
+ correctfile = os.path.normpath(correctfile)
+
+ self.assertEqual(writtenfile, correctfile)
+
+ # make sure correct data is in correct file
+ with open(writtenfile, "rb") as f:
+ self.assertEqual(fdata.encode(), f.read())
+
+ os.remove(writtenfile)
- # make sure it was written to the right place
- if os.path.isabs(fpath):
- correctfile = os.path.join(os.getcwd(), fpath[1:])
- else:
- correctfile = os.path.join(os.getcwd(), fpath)
- correctfile = os.path.normpath(correctfile)
+ # remove the test file subdirectories
+ shutil.rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
- self.assertEqual(writtenfile, correctfile)
+ def test_extract_all(self):
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ zipfp.writestr(fpath, fdata)
- # make sure correct data is in correct file
- self.assertEqual(fdata.encode(), open(writtenfile, "rb").read())
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp:
+ zipfp.extractall()
+ for fpath, fdata in SMALL_TEST_DATA:
+ if os.path.isabs(fpath):
+ outfile = os.path.join(os.getcwd(), fpath[1:])
+ else:
+ outfile = os.path.join(os.getcwd(), fpath)
- os.remove(writtenfile)
+ with open(outfile, "rb") as f:
+ self.assertEqual(fdata.encode(), f.read())
- zipfp.close()
+ os.remove(outfile)
# remove the test file subdirectories
shutil.rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
- def testExtractAll(self):
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- for fpath, fdata in SMALL_TEST_DATA:
- zipfp.writestr(fpath, fdata)
- zipfp.close()
-
- zipfp = zipfile.ZipFile(TESTFN2, "r")
- zipfp.extractall()
- for fpath, fdata in SMALL_TEST_DATA:
- if os.path.isabs(fpath):
- outfile = os.path.join(os.getcwd(), fpath[1:])
- else:
- outfile = os.path.join(os.getcwd(), fpath)
-
- self.assertEqual(fdata.encode(), open(outfile, "rb").read())
+ def test_writestr_compression(self):
+ zipfp = zipfile.ZipFile(TESTFN2, "w")
+ zipfp.writestr("a.txt", "hello world", compress_type=zipfile.ZIP_STORED)
+ if zlib:
+ zipfp.writestr("b.txt", "hello world", compress_type=zipfile.ZIP_DEFLATED)
- os.remove(outfile)
+ info = zipfp.getinfo('a.txt')
+ self.assertEqual(info.compress_type, zipfile.ZIP_STORED)
- zipfp.close()
+ if zlib:
+ info = zipfp.getinfo('b.txt')
+ self.assertEqual(info.compress_type, zipfile.ZIP_DEFLATED)
- # remove the test file subdirectories
- shutil.rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
def zip_test_writestr_permissions(self, f, compression):
# Make sure that writestr creates files with mode 0600,
# when it is passed a name rather than a ZipInfo instance.
- self.makeTestArchive(f, compression)
- zipfp = zipfile.ZipFile(f, "r")
- zinfo = zipfp.getinfo('strfile')
- self.assertEqual(zinfo.external_attr, 0o600 << 16)
+ self.make_test_archive(f, compression)
+ with zipfile.ZipFile(f, "r") as zipfp:
+ zinfo = zipfp.getinfo('strfile')
+ self.assertEqual(zinfo.external_attr, 0o600 << 16)
+ if not isinstance(f, str):
+ f.close()
def test_writestr_permissions(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
self.zip_test_writestr_permissions(f, zipfile.ZIP_STORED)
def test_writestr_extended_local_header_issue1202(self):
- orig_zip = zipfile.ZipFile(TESTFN2, 'w')
- for data in 'abcdefghijklmnop':
- zinfo = zipfile.ZipInfo(data)
- zinfo.flag_bits |= 0x08 # Include an extended local header.
- orig_zip.writestr(zinfo, data)
- orig_zip.close()
+ with zipfile.ZipFile(TESTFN2, 'w') as orig_zip:
+ for data in 'abcdefghijklmnop':
+ zinfo = zipfile.ZipInfo(data)
+ zinfo.flag_bits |= 0x08 # Include an extended local header.
+ orig_zip.writestr(zinfo, data)
+
+ def test_close(self):
+ """Check that the zipfile is closed after the 'with' block."""
+ with zipfile.ZipFile(TESTFN2, "w") as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ zipfp.writestr(fpath, fdata)
+ self.assertTrue(zipfp.fp is not None, 'zipfp is not open')
+ self.assertTrue(zipfp.fp is None, 'zipfp is not closed')
+
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp:
+ self.assertTrue(zipfp.fp is not None, 'zipfp is not open')
+ self.assertTrue(zipfp.fp is None, 'zipfp is not closed')
+
+ def test_close_on_exception(self):
+ """Check that the zipfile is closed if an exception is raised in the
+ 'with' block."""
+ with zipfile.ZipFile(TESTFN2, "w") as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ zipfp.writestr(fpath, fdata)
+
+ try:
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp2:
+ raise zipfile.BadZipFile()
+ except zipfile.BadZipFile:
+ self.assertTrue(zipfp2.fp is None, 'zipfp is not closed')
+
+ @skipUnless(zlib, "requires zlib")
+ def test_unicode_filenames(self):
+ # bug #10801
+ fname = findfile('zip_cp437_header.zip')
+ with zipfile.ZipFile(fname) as zipfp:
+ for name in zipfp.namelist():
+ zipfp.open(name).close()
def tearDown(self):
- os.remove(TESTFN)
- os.remove(TESTFN2)
+ unlink(TESTFN)
+ unlink(TESTFN2)
+
class TestZip64InSmallFiles(unittest.TestCase):
# These tests test the ZIP64 functionality without using large files,
@@ -404,181 +515,200 @@ class TestZip64InSmallFiles(unittest.TestCase):
self.data = b'\n'.join(line_gen)
# Make a source file with some lines
- fp = open(TESTFN, "wb")
- fp.write(self.data)
- fp.close()
-
- def largeFileExceptionTest(self, f, compression):
- zipfp = zipfile.ZipFile(f, "w", compression)
- self.assertRaises(zipfile.LargeZipFile,
- zipfp.write, TESTFN, "another.name")
- zipfp.close()
-
- def largeFileExceptionTest2(self, f, compression):
- zipfp = zipfile.ZipFile(f, "w", compression)
- self.assertRaises(zipfile.LargeZipFile,
- zipfp.writestr, "another.name", self.data)
- zipfp.close()
-
- def testLargeFileException(self):
+ with open(TESTFN, "wb") as fp:
+ fp.write(self.data)
+
+ def large_file_exception_test(self, f, compression):
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ self.assertRaises(zipfile.LargeZipFile,
+ zipfp.write, TESTFN, "another.name")
+
+ def large_file_exception_test2(self, f, compression):
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ self.assertRaises(zipfile.LargeZipFile,
+ zipfp.writestr, "another.name", self.data)
+ if not isinstance(f, str):
+ f.close()
+
+ def test_large_file_exception(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.largeFileExceptionTest(f, zipfile.ZIP_STORED)
- self.largeFileExceptionTest2(f, zipfile.ZIP_STORED)
+ self.large_file_exception_test(f, zipfile.ZIP_STORED)
+ self.large_file_exception_test2(f, zipfile.ZIP_STORED)
- def zipTest(self, f, compression):
+ def zip_test(self, f, compression):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(f, "w", compression, allowZip64=True)
- zipfp.write(TESTFN, "another.name")
- zipfp.write(TESTFN, TESTFN)
- zipfp.writestr("strfile", self.data)
- zipfp.close()
+ with zipfile.ZipFile(f, "w", compression, allowZip64=True) as zipfp:
+ zipfp.write(TESTFN, "another.name")
+ zipfp.write(TESTFN, TESTFN)
+ zipfp.writestr("strfile", self.data)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- self.assertEqual(zipfp.read(TESTFN), self.data)
- self.assertEqual(zipfp.read("another.name"), self.data)
- self.assertEqual(zipfp.read("strfile"), self.data)
-
- # Print the ZIP directory
- fp = io.StringIO()
- zipfp.printdir(fp)
-
- directory = fp.getvalue()
- lines = directory.splitlines()
- self.assertEqual(len(lines), 4) # Number of files + header
-
- self.assertTrue('File Name' in lines[0])
- self.assertTrue('Modified' in lines[0])
- self.assertTrue('Size' in lines[0])
-
- fn, date, time, size = lines[1].split()
- self.assertEqual(fn, 'another.name')
- # XXX: timestamp is not tested
- self.assertEqual(size, str(len(self.data)))
-
- # Check the namelist
- names = zipfp.namelist()
- self.assertEqual(len(names), 3)
- self.assertTrue(TESTFN in names)
- self.assertTrue("another.name" in names)
- self.assertTrue("strfile" in names)
-
- # Check infolist
- infos = zipfp.infolist()
- names = [ i.filename for i in infos ]
- self.assertEqual(len(names), 3)
- self.assertTrue(TESTFN in names)
- self.assertTrue("another.name" in names)
- self.assertTrue("strfile" in names)
- for i in infos:
- self.assertEqual(i.file_size, len(self.data))
-
- # check getinfo
- for nm in (TESTFN, "another.name", "strfile"):
- info = zipfp.getinfo(nm)
- self.assertEqual(info.filename, nm)
- self.assertEqual(info.file_size, len(self.data))
-
- # Check that testzip doesn't raise an exception
- zipfp.testzip()
-
-
- zipfp.close()
-
- def testStored(self):
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ self.assertEqual(zipfp.read(TESTFN), self.data)
+ self.assertEqual(zipfp.read("another.name"), self.data)
+ self.assertEqual(zipfp.read("strfile"), self.data)
+
+ # Print the ZIP directory
+ fp = io.StringIO()
+ zipfp.printdir(fp)
+
+ directory = fp.getvalue()
+ lines = directory.splitlines()
+ self.assertEqual(len(lines), 4) # Number of files + header
+
+ self.assertIn('File Name', lines[0])
+ self.assertIn('Modified', lines[0])
+ self.assertIn('Size', lines[0])
+
+ fn, date, time_, size = lines[1].split()
+ self.assertEqual(fn, 'another.name')
+ self.assertTrue(time.strptime(date, '%Y-%m-%d'))
+ self.assertTrue(time.strptime(time_, '%H:%M:%S'))
+ self.assertEqual(size, str(len(self.data)))
+
+ # Check the namelist
+ names = zipfp.namelist()
+ self.assertEqual(len(names), 3)
+ self.assertIn(TESTFN, names)
+ self.assertIn("another.name", names)
+ self.assertIn("strfile", names)
+
+ # Check infolist
+ infos = zipfp.infolist()
+ names = [i.filename for i in infos]
+ self.assertEqual(len(names), 3)
+ self.assertIn(TESTFN, names)
+ self.assertIn("another.name", names)
+ self.assertIn("strfile", names)
+ for i in infos:
+ self.assertEqual(i.file_size, len(self.data))
+
+ # check getinfo
+ for nm in (TESTFN, "another.name", "strfile"):
+ info = zipfp.getinfo(nm)
+ self.assertEqual(info.filename, nm)
+ self.assertEqual(info.file_size, len(self.data))
+
+ # Check that testzip doesn't raise an exception
+ zipfp.testzip()
+ if not isinstance(f, str):
+ f.close()
+
+ def test_stored(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipTest(f, zipfile.ZIP_STORED)
+ self.zip_test(f, zipfile.ZIP_STORED)
+ @skipUnless(zlib, "requires zlib")
+ def test_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_test(f, zipfile.ZIP_DEFLATED)
- if zlib:
- def testDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipTest(f, zipfile.ZIP_DEFLATED)
+ def test_absolute_arcnames(self):
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED,
+ allowZip64=True) as zipfp:
+ zipfp.write(TESTFN, "/absolute")
- def testAbsoluteArcnames(self):
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED, allowZip64=True)
- zipfp.write(TESTFN, "/absolute")
- zipfp.close()
-
- zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED)
- self.assertEqual(zipfp.namelist(), ["absolute"])
- zipfp.close()
+ with zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) as zipfp:
+ self.assertEqual(zipfp.namelist(), ["absolute"])
def tearDown(self):
zipfile.ZIP64_LIMIT = self._limit
- os.remove(TESTFN)
- os.remove(TESTFN2)
-
-class PyZipFileTests(unittest.TestCase):
- def testWritePyfile(self):
- zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
- fn = __file__
- if fn.endswith('.pyc') or fn.endswith('.pyo'):
- fn = fn[:-1]
-
- zipfp.writepy(fn)
-
- bn = os.path.basename(fn)
- self.assertTrue(bn not in zipfp.namelist())
- self.assertTrue(bn + 'o' in zipfp.namelist() or bn + 'c' in zipfp.namelist())
- zipfp.close()
+ unlink(TESTFN)
+ unlink(TESTFN2)
- zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
- fn = __file__
- if fn.endswith('.pyc') or fn.endswith('.pyo'):
- fn = fn[:-1]
+class PyZipFileTests(unittest.TestCase):
+ def test_write_pyfile(self):
+ with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
+ fn = __file__
+ if fn.endswith('.pyc') or fn.endswith('.pyo'):
+ path_split = fn.split(os.sep)
+ if os.altsep is not None:
+ path_split.extend(fn.split(os.altsep))
+ if '__pycache__' in path_split:
+ fn = imp.source_from_cache(fn)
+ else:
+ fn = fn[:-1]
+
+ zipfp.writepy(fn)
+
+ bn = os.path.basename(fn)
+ self.assertNotIn(bn, zipfp.namelist())
+ self.assertTrue(bn + 'o' in zipfp.namelist() or
+ bn + 'c' in zipfp.namelist())
+
+ with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
+ fn = __file__
+ if fn.endswith(('.pyc', '.pyo')):
+ fn = fn[:-1]
+
+ zipfp.writepy(fn, "testpackage")
+
+ bn = "%s/%s" % ("testpackage", os.path.basename(fn))
+ self.assertNotIn(bn, zipfp.namelist())
+ self.assertTrue(bn + 'o' in zipfp.namelist() or
+ bn + 'c' in zipfp.namelist())
+
+ def test_write_python_package(self):
+ import email
+ packagedir = os.path.dirname(email.__file__)
- zipfp.writepy(fn, "testpackage")
+ with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
+ zipfp.writepy(packagedir)
- bn = "%s/%s"%("testpackage", os.path.basename(fn))
- self.assertTrue(bn not in zipfp.namelist())
- self.assertTrue(bn + 'o' in zipfp.namelist() or bn + 'c' in zipfp.namelist())
- zipfp.close()
+ # Check for a couple of modules at different levels of the
+ # hierarchy
+ names = zipfp.namelist()
+ self.assertTrue('email/__init__.pyo' in names or
+ 'email/__init__.pyc' in names)
+ self.assertTrue('email/mime/text.pyo' in names or
+ 'email/mime/text.pyc' in names)
- def testWritePythonPackage(self):
+ def test_write_with_optimization(self):
import email
packagedir = os.path.dirname(email.__file__)
+ # use .pyc if running test in optimization mode,
+ # use .pyo if running test in debug mode
+ optlevel = 1 if __debug__ else 0
+ ext = '.pyo' if optlevel == 1 else '.pyc'
- zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
- zipfp.writepy(packagedir)
+ with TemporaryFile() as t, \
+ zipfile.PyZipFile(t, "w", optimize=optlevel) as zipfp:
+ zipfp.writepy(packagedir)
- # Check for a couple of modules at different levels of the hieararchy
- names = zipfp.namelist()
- self.assertTrue('email/__init__.pyo' in names or 'email/__init__.pyc' in names)
- self.assertTrue('email/mime/text.pyo' in names or 'email/mime/text.pyc' in names)
+ names = zipfp.namelist()
+ self.assertIn('email/__init__' + ext, names)
+ self.assertIn('email/mime/text' + ext, names)
- def testWritePythonDirectory(self):
+ def test_write_python_directory(self):
os.mkdir(TESTFN2)
try:
- fp = open(os.path.join(TESTFN2, "mod1.py"), "w")
- fp.write("print(42)\n")
- fp.close()
+ with open(os.path.join(TESTFN2, "mod1.py"), "w") as fp:
+ fp.write("print(42)\n")
- fp = open(os.path.join(TESTFN2, "mod2.py"), "w")
- fp.write("print(42 * 42)\n")
- fp.close()
+ with open(os.path.join(TESTFN2, "mod2.py"), "w") as fp:
+ fp.write("print(42 * 42)\n")
- fp = open(os.path.join(TESTFN2, "mod2.txt"), "w")
- fp.write("bla bla bla\n")
- fp.close()
+ with open(os.path.join(TESTFN2, "mod2.txt"), "w") as fp:
+ fp.write("bla bla bla\n")
- zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
- zipfp.writepy(TESTFN2)
+ with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
+ zipfp.writepy(TESTFN2)
- names = zipfp.namelist()
- self.assertTrue('mod1.pyc' in names or 'mod1.pyo' in names)
- self.assertTrue('mod2.pyc' in names or 'mod2.pyo' in names)
- self.assertTrue('mod2.txt' not in names)
+ names = zipfp.namelist()
+ self.assertTrue('mod1.pyc' in names or 'mod1.pyo' in names)
+ self.assertTrue('mod2.pyc' in names or 'mod2.pyo' in names)
+ self.assertNotIn('mod2.txt', names)
finally:
shutil.rmtree(TESTFN2)
- def testWriteNonPyfile(self):
- zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
- open(TESTFN, 'w').write('most definitely not a python file')
- self.assertRaises(RuntimeError, zipfp.writepy, TESTFN)
- os.remove(TESTFN)
+ def test_write_non_pyfile(self):
+ with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
+ with open(TESTFN, 'w') as f:
+ f.write('most definitely not a python file')
+ self.assertRaises(RuntimeError, zipfp.writepy, TESTFN)
+ os.remove(TESTFN)
class OtherTests(unittest.TestCase):
@@ -603,17 +733,17 @@ class OtherTests(unittest.TestCase):
b'\x01\x003\x00\x00\x003\x00\x00\x00\x00\x00'),
}
- def testUnicodeFilenames(self):
- zf = zipfile.ZipFile(TESTFN, "w")
- zf.writestr("foo.txt", "Test for unicode filename")
- zf.writestr("\xf6.txt", "Test for unicode filename")
- zf.close()
- zf = zipfile.ZipFile(TESTFN, "r")
- self.assertEqual(zf.filelist[0].filename, "foo.txt")
- self.assertEqual(zf.filelist[1].filename, "\xf6.txt")
- zf.close()
-
- def testCreateNonExistentFileForAppend(self):
+ def test_unicode_filenames(self):
+ with zipfile.ZipFile(TESTFN, "w") as zf:
+ zf.writestr("foo.txt", "Test for unicode filename")
+ zf.writestr("\xf6.txt", "Test for unicode filename")
+ self.assertIsInstance(zf.infolist()[0].filename, str)
+
+ with zipfile.ZipFile(TESTFN, "r") as zf:
+ self.assertEqual(zf.filelist[0].filename, "foo.txt")
+ self.assertEqual(zf.filelist[1].filename, "\xf6.txt")
+
+ def test_create_non_existent_file_for_append(self):
if os.path.exists(TESTFN):
os.unlink(TESTFN)
@@ -621,42 +751,38 @@ class OtherTests(unittest.TestCase):
content = b'hello, world. this is some content.'
try:
- zf = zipfile.ZipFile(TESTFN, 'a')
- zf.writestr(filename, content)
- zf.close()
+ with zipfile.ZipFile(TESTFN, 'a') as zf:
+ zf.writestr(filename, content)
except IOError:
self.fail('Could not append data to a non-existent zip file.')
self.assertTrue(os.path.exists(TESTFN))
- zf = zipfile.ZipFile(TESTFN, 'r')
- self.assertEqual(zf.read(filename), content)
- zf.close()
+ with zipfile.ZipFile(TESTFN, 'r') as zf:
+ self.assertEqual(zf.read(filename), content)
- def testCloseErroneousFile(self):
+ def test_close_erroneous_file(self):
# This test checks that the ZipFile constructor closes the file object
- # it opens if there's an error in the file. If it doesn't, the traceback
- # holds a reference to the ZipFile object and, indirectly, the file object.
+ # it opens if there's an error in the file. If it doesn't, the
+ # traceback holds a reference to the ZipFile object and, indirectly,
+ # the file object.
# On Windows, this causes the os.unlink() call to fail because the
# underlying file is still open. This is SF bug #412214.
#
- fp = open(TESTFN, "w")
- fp.write("this is not a legal zip file\n")
- fp.close()
+ with open(TESTFN, "w") as fp:
+ fp.write("this is not a legal zip file\n")
try:
zf = zipfile.ZipFile(TESTFN)
- except zipfile.BadZipfile:
+ except zipfile.BadZipFile:
pass
- def testIsZipErroneousFile(self):
- # This test checks that the is_zipfile function correctly identifies
- # a file that is not a zip file
-
+ def test_is_zip_erroneous_file(self):
+ """Check that is_zipfile() correctly identifies non-zip files."""
# - passing a filename
with open(TESTFN, "w") as fp:
fp.write("this is not a legal zip file\n")
chk = zipfile.is_zipfile(TESTFN)
- self.assertTrue(not chk)
+ self.assertFalse(chk)
# - passing a file object
with open(TESTFN, "rb") as fp:
chk = zipfile.is_zipfile(fp)
@@ -666,36 +792,34 @@ class OtherTests(unittest.TestCase):
fp.write(b"this is not a legal zip file\n")
chk = zipfile.is_zipfile(fp)
self.assertTrue(not chk)
- fp.seek(0,0)
+ fp.seek(0, 0)
chk = zipfile.is_zipfile(fp)
self.assertTrue(not chk)
- def testIsZipValidFile(self):
- # This test checks that the is_zipfile function correctly identifies
- # a file that is a zip file
-
+ def test_is_zip_valid_file(self):
+ """Check that is_zipfile() correctly identifies zip files."""
# - passing a filename
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.writestr("foo.txt", b"O, for a Muse of Fire!")
- zipf.close()
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.writestr("foo.txt", b"O, for a Muse of Fire!")
+
chk = zipfile.is_zipfile(TESTFN)
self.assertTrue(chk)
# - passing a file object
with open(TESTFN, "rb") as fp:
chk = zipfile.is_zipfile(fp)
self.assertTrue(chk)
- fp.seek(0,0)
+ fp.seek(0, 0)
zip_contents = fp.read()
# - passing a file-like object
fp = io.BytesIO()
fp.write(zip_contents)
chk = zipfile.is_zipfile(fp)
self.assertTrue(chk)
- fp.seek(0,0)
+ fp.seek(0, 0)
chk = zipfile.is_zipfile(fp)
self.assertTrue(chk)
- def testNonExistentFileRaisesIOError(self):
+ def test_non_existent_file_raises_IOError(self):
# make sure we don't raise an AttributeError when a partially-constructed
# ZipFile instance is finalized; this tests for regression on SF tracker
# bug #403871.
@@ -712,19 +836,17 @@ class OtherTests(unittest.TestCase):
def test_empty_file_raises_BadZipFile(self):
f = open(TESTFN, 'w')
f.close()
- self.assertRaises(zipfile.BadZipfile, zipfile.ZipFile, TESTFN)
+ self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, TESTFN)
- f = open(TESTFN, 'w')
- f.write("short file")
- f.close()
- self.assertRaises(zipfile.BadZipfile, zipfile.ZipFile, TESTFN)
+ with open(TESTFN, 'w') as fp:
+ fp.write("short file")
+ self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, TESTFN)
- def testClosedZipRaisesRuntimeError(self):
- # Verify that testzip() doesn't swallow inappropriate exceptions.
+ def test_closed_zip_raises_RuntimeError(self):
+ """Verify that testzip() doesn't swallow inappropriate exceptions."""
data = io.BytesIO()
- zipf = zipfile.ZipFile(data, mode="w")
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
+ with zipfile.ZipFile(data, mode="w") as zipf:
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
# This is correct; calling .read on a closed ZipFile should throw
# a RuntimeError, and so should calling .testzip. An earlier
@@ -734,150 +856,139 @@ class OtherTests(unittest.TestCase):
self.assertRaises(RuntimeError, zipf.open, "foo.txt")
self.assertRaises(RuntimeError, zipf.testzip)
self.assertRaises(RuntimeError, zipf.writestr, "bogus.txt", "bogus")
- open(TESTFN, 'w').write('zipfile test data')
+ with open(TESTFN, 'w') as f:
+ f.write('zipfile test data')
self.assertRaises(RuntimeError, zipf.write, TESTFN)
- def test_BadConstructorMode(self):
- # Check that bad modes passed to ZipFile constructor are caught
+ def test_bad_constructor_mode(self):
+ """Check that bad modes passed to ZipFile constructor are caught."""
self.assertRaises(RuntimeError, zipfile.ZipFile, TESTFN, "q")
- def test_BadOpenMode(self):
- # Check that bad modes passed to ZipFile.open are caught
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipf = zipfile.ZipFile(TESTFN, mode="r")
- # read the data to make sure the file is there
- zipf.read("foo.txt")
- self.assertRaises(RuntimeError, zipf.open, "foo.txt", "q")
- zipf.close()
+ def test_bad_open_mode(self):
+ """Check that bad modes passed to ZipFile.open are caught."""
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- def test_Read0(self):
- # Check that calling read(0) on a ZipExtFile object returns an empty
- # string and doesn't advance file pointer
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+ with zipfile.ZipFile(TESTFN, mode="r") as zipf:
# read the data to make sure the file is there
- f = zipf.open("foo.txt")
- for i in range(FIXEDTEST_SIZE):
- self.assertEqual(f.read(0), b'')
-
- self.assertEqual(f.read(), b"O, for a Muse of Fire!")
- zipf.close()
-
- def test_OpenNonexistentItem(self):
- # Check that attempting to call open() for an item that doesn't
- # exist in the archive raises a RuntimeError
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- self.assertRaises(KeyError, zipf.open, "foo.txt", "r")
-
- def test_BadCompressionMode(self):
- # Check that bad compression methods passed to ZipFile.open are caught
+ zipf.read("foo.txt")
+ self.assertRaises(RuntimeError, zipf.open, "foo.txt", "q")
+
+ def test_read0(self):
+ """Check that calling read(0) on a ZipExtFile object returns an empty
+ string and doesn't advance file pointer."""
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+ # read the data to make sure the file is there
+ with zipf.open("foo.txt") as f:
+ for i in range(FIXEDTEST_SIZE):
+ self.assertEqual(f.read(0), b'')
+
+ self.assertEqual(f.read(), b"O, for a Muse of Fire!")
+
+ def test_open_non_existent_item(self):
+ """Check that attempting to call open() for an item that doesn't
+ exist in the archive raises a RuntimeError."""
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ self.assertRaises(KeyError, zipf.open, "foo.txt", "r")
+
+ def test_bad_compression_mode(self):
+ """Check that bad compression methods passed to ZipFile.open are
+ caught."""
self.assertRaises(RuntimeError, zipfile.ZipFile, TESTFN, "w", -1)
- def test_NullByteInFilename(self):
- # Check that a filename containing a null byte is properly terminated
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.writestr("foo.txt\x00qqq", b"O, for a Muse of Fire!")
- self.assertEqual(zipf.namelist(), ['foo.txt'])
+ def test_null_byte_in_filename(self):
+ """Check that a filename containing a null byte is properly
+ terminated."""
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.writestr("foo.txt\x00qqq", b"O, for a Muse of Fire!")
+ self.assertEqual(zipf.namelist(), ['foo.txt'])
- def test_StructSizes(self):
- # check that ZIP internal structure sizes are calculated correctly
+ def test_struct_sizes(self):
+ """Check that ZIP internal structure sizes are calculated correctly."""
self.assertEqual(zipfile.sizeEndCentDir, 22)
self.assertEqual(zipfile.sizeCentralDir, 46)
self.assertEqual(zipfile.sizeEndCentDir64, 56)
self.assertEqual(zipfile.sizeEndCentDir64Locator, 20)
- def testComments(self):
- # This test checks that comments on the archive are handled properly
+ def test_comments(self):
+ """Check that comments on the archive are handled properly."""
# check default comment is empty
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- self.assertEqual(zipf.comment, b'')
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipfr = zipfile.ZipFile(TESTFN, mode="r")
- self.assertEqual(zipfr.comment, b'')
- zipfr.close()
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ self.assertEqual(zipf.comment, b'')
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+
+ with zipfile.ZipFile(TESTFN, mode="r") as zipfr:
+ self.assertEqual(zipfr.comment, b'')
# check a simple short comment
comment = b'Bravely taking to his feet, he beat a very brave retreat.'
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.comment = comment
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipfr = zipfile.ZipFile(TESTFN, mode="r")
- self.assertEqual(zipfr.comment, comment)
- zipfr.close()
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.comment = comment
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+ with zipfile.ZipFile(TESTFN, mode="r") as zipfr:
+ self.assertEqual(zipf.comment, comment)
# check a comment of max length
comment2 = ''.join(['%d' % (i**3 % 10) for i in range((1 << 16)-1)])
comment2 = comment2.encode("ascii")
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.comment = comment2
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipfr = zipfile.ZipFile(TESTFN, mode="r")
- self.assertEqual(zipfr.comment, comment2)
- zipfr.close()
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.comment = comment2
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+
+ with zipfile.ZipFile(TESTFN, mode="r") as zipfr:
+ self.assertEqual(zipfr.comment, comment2)
# check a comment that is too long is truncated
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.comment = comment2 + b'oops'
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipfr = zipfile.ZipFile(TESTFN, mode="r")
- self.assertEqual(zipfr.comment, comment2)
- zipfr.close()
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.comment = comment2 + b'oops'
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+ with zipfile.ZipFile(TESTFN, mode="r") as zipfr:
+ self.assertEqual(zipfr.comment, comment2)
def check_testzip_with_bad_crc(self, compression):
"""Tests that files with bad CRCs return their name from testzip."""
zipdata = self.zips_with_bad_crc[compression]
- zipf = zipfile.ZipFile(io.BytesIO(zipdata), mode="r")
- # testzip returns the name of the first corrupt file, or None
- self.assertEqual('afile', zipf.testzip())
- zipf.close()
+ with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
+ # testzip returns the name of the first corrupt file, or None
+ self.assertEqual('afile', zipf.testzip())
def test_testzip_with_bad_crc_stored(self):
self.check_testzip_with_bad_crc(zipfile.ZIP_STORED)
- if zlib:
- def test_testzip_with_bad_crc_deflated(self):
- self.check_testzip_with_bad_crc(zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_testzip_with_bad_crc_deflated(self):
+ self.check_testzip_with_bad_crc(zipfile.ZIP_DEFLATED)
def check_read_with_bad_crc(self, compression):
- """Tests that files with bad CRCs raise a BadZipfile exception when read."""
+ """Tests that files with bad CRCs raise a BadZipFile exception when read."""
zipdata = self.zips_with_bad_crc[compression]
# Using ZipFile.read()
- zipf = zipfile.ZipFile(io.BytesIO(zipdata), mode="r")
- self.assertRaises(zipfile.BadZipfile, zipf.read, 'afile')
- zipf.close()
+ with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
+ self.assertRaises(zipfile.BadZipFile, zipf.read, 'afile')
# Using ZipExtFile.read()
- zipf = zipfile.ZipFile(io.BytesIO(zipdata), mode="r")
- corrupt_file = zipf.open('afile', 'r')
- self.assertRaises(zipfile.BadZipfile, corrupt_file.read)
- corrupt_file.close()
- zipf.close()
+ with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
+ with zipf.open('afile', 'r') as corrupt_file:
+ self.assertRaises(zipfile.BadZipFile, corrupt_file.read)
# Same with small reads (in order to exercise the buffering logic)
- zipf = zipfile.ZipFile(io.BytesIO(zipdata), mode="r")
- corrupt_file = zipf.open('afile', 'r')
- corrupt_file.MIN_READ_SIZE = 2
- with self.assertRaises(zipfile.BadZipfile):
- while corrupt_file.read(2):
- pass
- corrupt_file.close()
- zipf.close()
+ with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
+ with zipf.open('afile', 'r') as corrupt_file:
+ corrupt_file.MIN_READ_SIZE = 2
+ with self.assertRaises(zipfile.BadZipFile):
+ while corrupt_file.read(2):
+ pass
def test_read_with_bad_crc_stored(self):
self.check_read_with_bad_crc(zipfile.ZIP_STORED)
- if zlib:
- def test_read_with_bad_crc_deflated(self):
- self.check_read_with_bad_crc(zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_read_with_bad_crc_deflated(self):
+ self.check_read_with_bad_crc(zipfile.ZIP_DEFLATED)
def check_read_return_size(self, compression):
# Issue #9837: ZipExtFile.read() shouldn't return more bytes
@@ -886,21 +997,18 @@ class OtherTests(unittest.TestCase):
file_size = test_size + 1
junk = b''.join(struct.pack('B', randint(0, 255))
for x in range(file_size))
- zipf = zipfile.ZipFile(io.BytesIO(), "w", compression)
- try:
+ with zipfile.ZipFile(io.BytesIO(), "w", compression) as zipf:
zipf.writestr('foo', junk)
- fp = zipf.open('foo', 'r')
- buf = fp.read(test_size)
- self.assertEqual(len(buf), test_size)
- finally:
- zipf.close()
+ with zipf.open('foo', 'r') as fp:
+ buf = fp.read(test_size)
+ self.assertEqual(len(buf), test_size)
def test_read_return_size_stored(self):
self.check_read_return_size(zipfile.ZIP_STORED)
- if zlib:
- def test_read_return_size_deflated(self):
- self.check_read_return_size(zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_read_return_size_deflated(self):
+ self.check_read_return_size(zipfile.ZIP_DEFLATED)
def test_empty_zipfile(self):
# Check that creating a file in 'w' or 'a' mode and closing without
@@ -909,7 +1017,7 @@ class OtherTests(unittest.TestCase):
zipf.close()
try:
zipf = zipfile.ZipFile(TESTFN, mode="r")
- except zipfile.BadZipfile:
+ except zipfile.BadZipFile:
self.fail("Unable to create empty ZIP file in 'w' mode")
zipf = zipfile.ZipFile(TESTFN, mode="a")
@@ -921,20 +1029,21 @@ class OtherTests(unittest.TestCase):
def test_open_empty_file(self):
# Issue 1710703: Check that opening a file with less than 22 bytes
- # raises a BadZipfile exception (rather than the previously unhelpful
+ # raises a BadZipFile exception (rather than the previously unhelpful
# IOError)
f = open(TESTFN, 'w')
f.close()
- self.assertRaises(zipfile.BadZipfile, zipfile.ZipFile, TESTFN, 'r')
+ self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, TESTFN, 'r')
def tearDown(self):
- support.unlink(TESTFN)
- support.unlink(TESTFN2)
+ unlink(TESTFN)
+ unlink(TESTFN2)
+
class DecryptionTests(unittest.TestCase):
- # This test checks that ZIP decryption works. Since the library does not
- # support encryption at the moment, we use a pre-generated encrypted
- # ZIP file
+ """Check that ZIP decryption works. Since the library does not
+ support encryption at the moment, we use a pre-generated encrypted
+ ZIP file."""
data = (
b'PK\x03\x04\x14\x00\x01\x00\x00\x00n\x92i.#y\xef?&\x00\x00\x00\x1a\x00'
@@ -958,13 +1067,11 @@ class DecryptionTests(unittest.TestCase):
plain2 = b'\x00'*512
def setUp(self):
- fp = open(TESTFN, "wb")
- fp.write(self.data)
- fp.close()
+ with open(TESTFN, "wb") as fp:
+ fp.write(self.data)
self.zip = zipfile.ZipFile(TESTFN, "r")
- fp = open(TESTFN2, "wb")
- fp.write(self.data2)
- fp.close()
+ with open(TESTFN2, "wb") as fp:
+ fp.write(self.data2)
self.zip2 = zipfile.ZipFile(TESTFN2, "r")
def tearDown(self):
@@ -973,19 +1080,20 @@ class DecryptionTests(unittest.TestCase):
self.zip2.close()
os.unlink(TESTFN2)
- def testNoPassword(self):
+ def test_no_password(self):
# Reading the encrypted file without password
# must generate a RunTime exception
self.assertRaises(RuntimeError, self.zip.read, "test.txt")
self.assertRaises(RuntimeError, self.zip2.read, "zero")
- def testBadPassword(self):
+ def test_bad_password(self):
self.zip.setpassword(b"perl")
self.assertRaises(RuntimeError, self.zip.read, "test.txt")
self.zip2.setpassword(b"perl")
self.assertRaises(RuntimeError, self.zip2.read, "zero")
- def testGoodPassword(self):
+ @skipUnless(zlib, "requires zlib")
+ def test_good_password(self):
self.zip.setpassword(b"python")
self.assertEqual(self.zip.read("test.txt"), self.plain)
self.zip2.setpassword(b"12345")
@@ -1005,151 +1113,163 @@ class TestsWithRandomBinaryFiles(unittest.TestCase):
for i in range(datacount))
# Make a source file with some lines
- fp = open(TESTFN, "wb")
- fp.write(self.data)
- fp.close()
+ with open(TESTFN, "wb") as fp:
+ fp.write(self.data)
def tearDown(self):
- support.unlink(TESTFN)
- support.unlink(TESTFN2)
+ unlink(TESTFN)
+ unlink(TESTFN2)
- def makeTestArchive(self, f, compression):
+ def make_test_archive(self, f, compression):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(f, "w", compression)
- zipfp.write(TESTFN, "another.name")
- zipfp.write(TESTFN, TESTFN)
- zipfp.close()
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ zipfp.write(TESTFN, "another.name")
+ zipfp.write(TESTFN, TESTFN)
- def zipTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- testdata = zipfp.read(TESTFN)
- self.assertEqual(len(testdata), len(self.data))
- self.assertEqual(testdata, self.data)
- self.assertEqual(zipfp.read("another.name"), self.data)
- zipfp.close()
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ testdata = zipfp.read(TESTFN)
+ self.assertEqual(len(testdata), len(self.data))
+ self.assertEqual(testdata, self.data)
+ self.assertEqual(zipfp.read("another.name"), self.data)
+ if not isinstance(f, str):
+ f.close()
+
+ def test_stored(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_test(f, zipfile.ZIP_STORED)
- def testStored(self):
+ @skipUnless(zlib, "requires zlib")
+ def test_deflated(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipTest(f, zipfile.ZIP_STORED)
+ self.zip_test(f, zipfile.ZIP_DEFLATED)
- def zipOpenTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_open_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- zipdata1 = []
- zipopen1 = zipfp.open(TESTFN)
- while 1:
- read_data = zipopen1.read(256)
- if not read_data:
- break
- zipdata1.append(read_data)
-
- zipdata2 = []
- zipopen2 = zipfp.open("another.name")
- while 1:
- read_data = zipopen2.read(256)
- if not read_data:
- break
- zipdata2.append(read_data)
-
- testdata1 = b''.join(zipdata1)
- self.assertEqual(len(testdata1), len(self.data))
- self.assertEqual(testdata1, self.data)
-
- testdata2 = b''.join(zipdata2)
- self.assertEqual(len(testdata1), len(self.data))
- self.assertEqual(testdata1, self.data)
- zipfp.close()
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ zipdata1 = []
+ with zipfp.open(TESTFN) as zipopen1:
+ while True:
+ read_data = zipopen1.read(256)
+ if not read_data:
+ break
+ zipdata1.append(read_data)
+
+ zipdata2 = []
+ with zipfp.open("another.name") as zipopen2:
+ while True:
+ read_data = zipopen2.read(256)
+ if not read_data:
+ break
+ zipdata2.append(read_data)
+
+ testdata1 = b''.join(zipdata1)
+ self.assertEqual(len(testdata1), len(self.data))
+ self.assertEqual(testdata1, self.data)
+
+ testdata2 = b''.join(zipdata2)
+ self.assertEqual(len(testdata2), len(self.data))
+ self.assertEqual(testdata2, self.data)
+ if not isinstance(f, str):
+ f.close()
+
+ def test_open_stored(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_open_test(f, zipfile.ZIP_STORED)
- def testOpenStored(self):
+ @skipUnless(zlib, "requires zlib")
+ def test_open_deflated(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipOpenTest(f, zipfile.ZIP_STORED)
+ self.zip_open_test(f, zipfile.ZIP_DEFLATED)
- def zipRandomOpenTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_random_open_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- zipdata1 = []
- zipopen1 = zipfp.open(TESTFN)
- while 1:
- read_data = zipopen1.read(randint(1, 1024))
- if not read_data:
- break
- zipdata1.append(read_data)
-
- testdata = b''.join(zipdata1)
- self.assertEqual(len(testdata), len(self.data))
- self.assertEqual(testdata, self.data)
- zipfp.close()
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ zipdata1 = []
+ with zipfp.open(TESTFN) as zipopen1:
+ while True:
+ read_data = zipopen1.read(randint(1, 1024))
+ if not read_data:
+ break
+ zipdata1.append(read_data)
+
+ testdata = b''.join(zipdata1)
+ self.assertEqual(len(testdata), len(self.data))
+ self.assertEqual(testdata, self.data)
+ if not isinstance(f, str):
+ f.close()
+
+ def test_random_open_stored(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_random_open_test(f, zipfile.ZIP_STORED)
- def testRandomOpenStored(self):
+ @skipUnless(zlib, "requires zlib")
+ def test_random_open_deflated(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.zipRandomOpenTest(f, zipfile.ZIP_STORED)
+ self.zip_random_open_test(f, zipfile.ZIP_DEFLATED)
+
+@skipUnless(zlib, "requires zlib")
class TestsWithMultipleOpens(unittest.TestCase):
def setUp(self):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED)
- zipfp.writestr('ones', '1'*FIXEDTEST_SIZE)
- zipfp.writestr('twos', '2'*FIXEDTEST_SIZE)
- zipfp.close()
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED) as zipfp:
+ zipfp.writestr('ones', '1'*FIXEDTEST_SIZE)
+ zipfp.writestr('twos', '2'*FIXEDTEST_SIZE)
- def testSameFile(self):
+ def test_same_file(self):
# Verify that (when the ZipFile is in control of creating file objects)
# multiple open() calls can be made without interfering with each other.
- zipf = zipfile.ZipFile(TESTFN2, mode="r")
- zopen1 = zipf.open('ones')
- zopen2 = zipf.open('ones')
- data1 = zopen1.read(500)
- data2 = zopen2.read(500)
- data1 += zopen1.read(500)
- data2 += zopen2.read(500)
- self.assertEqual(data1, data2)
- zipf.close()
-
- def testDifferentFile(self):
+ with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
+ with zipf.open('ones') as zopen1, zipf.open('ones') as zopen2:
+ data1 = zopen1.read(500)
+ data2 = zopen2.read(500)
+ data1 += zopen1.read(500)
+ data2 += zopen2.read(500)
+ self.assertEqual(data1, data2)
+
+ def test_different_file(self):
# Verify that (when the ZipFile is in control of creating file objects)
# multiple open() calls can be made without interfering with each other.
- zipf = zipfile.ZipFile(TESTFN2, mode="r")
- zopen1 = zipf.open('ones')
- zopen2 = zipf.open('twos')
- data1 = zopen1.read(500)
- data2 = zopen2.read(500)
- data1 += zopen1.read(500)
- data2 += zopen2.read(500)
- self.assertEqual(data1, b'1'*FIXEDTEST_SIZE)
- self.assertEqual(data2, b'2'*FIXEDTEST_SIZE)
- zipf.close()
-
- def testInterleaved(self):
+ with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
+ with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2:
+ data1 = zopen1.read(500)
+ data2 = zopen2.read(500)
+ data1 += zopen1.read(500)
+ data2 += zopen2.read(500)
+ self.assertEqual(data1, b'1'*FIXEDTEST_SIZE)
+ self.assertEqual(data2, b'2'*FIXEDTEST_SIZE)
+
+ def test_interleaved(self):
# Verify that (when the ZipFile is in control of creating file objects)
# multiple open() calls can be made without interfering with each other.
- zipf = zipfile.ZipFile(TESTFN2, mode="r")
- zopen1 = zipf.open('ones')
- data1 = zopen1.read(500)
- zopen2 = zipf.open('twos')
- data2 = zopen2.read(500)
- data1 += zopen1.read(500)
- data2 += zopen2.read(500)
- self.assertEqual(data1, b'1'*FIXEDTEST_SIZE)
- self.assertEqual(data2, b'2'*FIXEDTEST_SIZE)
- zipf.close()
+ with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
+ with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2:
+ data1 = zopen1.read(500)
+ data2 = zopen2.read(500)
+ data1 += zopen1.read(500)
+ data2 += zopen2.read(500)
+ self.assertEqual(data1, b'1'*FIXEDTEST_SIZE)
+ self.assertEqual(data2, b'2'*FIXEDTEST_SIZE)
def tearDown(self):
- os.remove(TESTFN2)
+ unlink(TESTFN2)
+
class TestWithDirectory(unittest.TestCase):
def setUp(self):
os.mkdir(TESTFN2)
- def testExtractDir(self):
- zipf = zipfile.ZipFile(findfile("zipdir.zip"))
- zipf.extractall(TESTFN2)
+ def test_extract_dir(self):
+ with zipfile.ZipFile(findfile("zipdir.zip")) as zipf:
+ zipf.extractall(TESTFN2)
self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a")))
self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b")))
self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c")))
@@ -1157,9 +1277,9 @@ class TestWithDirectory(unittest.TestCase):
def test_bug_6050(self):
# Extraction should succeed if directories already exist
os.mkdir(os.path.join(TESTFN2, "a"))
- self.testExtractDir()
+ self.test_extract_dir()
- def testStoreDir(self):
+ def test_store_dir(self):
os.mkdir(os.path.join(TESTFN2, "x"))
zipf = zipfile.ZipFile(TESTFN, "w")
zipf.write(os.path.join(TESTFN2, "x"), "x")
@@ -1168,7 +1288,7 @@ class TestWithDirectory(unittest.TestCase):
def tearDown(self):
shutil.rmtree(TESTFN2)
if os.path.exists(TESTFN):
- os.remove(TESTFN)
+ unlink(TESTFN)
class UniversalNewlineTests(unittest.TestCase):
@@ -1187,105 +1307,145 @@ class UniversalNewlineTests(unittest.TestCase):
finally:
f.close()
- def makeTestArchive(self, f, compression):
+ def make_test_archive(self, f, compression):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(f, "w", compression)
- for fn in self.arcfiles.values():
- zipfp.write(fn, fn)
- zipfp.close()
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ for fn in self.arcfiles.values():
+ zipfp.write(fn, fn)
- def readTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def read_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- for sep, fn in self.arcfiles.items():
- zipdata = zipfp.open(fn, "rU").read()
- self.assertEqual(self.arcdata[sep], zipdata)
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for sep, fn in self.arcfiles.items():
+ with zipfp.open(fn, "rU") as fp:
+ zipdata = fp.read()
+ self.assertEqual(self.arcdata[sep], zipdata)
+ if not isinstance(f, str):
+ f.close()
- zipfp.close()
-
- def readlineTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def readline_read_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- for sep, fn in self.arcfiles.items():
- zipopen = zipfp.open(fn, "rU")
- for line in self.line_gen:
- linedata = zipopen.readline()
- self.assertEqual(linedata, line + b'\n')
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for sep, fn in self.arcfiles.items():
+ with zipfp.open(fn, "rU") as zipopen:
+ data = b''
+ while True:
+ read = zipopen.readline()
+ if not read:
+ break
+ data += read
- zipfp.close()
+ read = zipopen.read(5)
+ if not read:
+ break
+ data += read
- def readlinesTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ self.assertEqual(data, self.arcdata['\n'])
- # Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- for sep, fn in self.arcfiles.items():
- ziplines = zipfp.open(fn, "rU").readlines()
- for line, zipline in zip(self.line_gen, ziplines):
- self.assertEqual(zipline, line + b'\n')
+ if not isinstance(f, str):
+ f.close()
- zipfp.close()
+ def readline_test(self, f, compression):
+ self.make_test_archive(f, compression)
+
+ # Read the ZIP archive
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for sep, fn in self.arcfiles.items():
+ with zipfp.open(fn, "rU") as zipopen:
+ for line in self.line_gen:
+ linedata = zipopen.readline()
+ self.assertEqual(linedata, line + b'\n')
+ if not isinstance(f, str):
+ f.close()
+
+ def readlines_test(self, f, compression):
+ self.make_test_archive(f, compression)
- def iterlinesTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ # Read the ZIP archive
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for sep, fn in self.arcfiles.items():
+ with zipfp.open(fn, "rU") as fp:
+ ziplines = fp.readlines()
+ for line, zipline in zip(self.line_gen, ziplines):
+ self.assertEqual(zipline, line + b'\n')
+ if not isinstance(f, str):
+ f.close()
+
+ def iterlines_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- for sep, fn in self.arcfiles.items():
- for line, zipline in zip(self.line_gen, zipfp.open(fn, "rU")):
- self.assertEqual(zipline, line + b'\n')
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for sep, fn in self.arcfiles.items():
+ with zipfp.open(fn, "rU") as fp:
+ for line, zipline in zip(self.line_gen, fp):
+ self.assertEqual(zipline, line + b'\n')
+ if not isinstance(f, str):
+ f.close()
+
+ def test_read_stored(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.read_test(f, zipfile.ZIP_STORED)
- zipfp.close()
+ def test_readline_read_stored(self):
+ # Issue #7610: calls to readline() interleaved with calls to read().
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.readline_read_test(f, zipfile.ZIP_STORED)
- def testReadStored(self):
+ def test_readline_stored(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.readTest(f, zipfile.ZIP_STORED)
+ self.readline_test(f, zipfile.ZIP_STORED)
- def testReadlineStored(self):
+ def test_readlines_stored(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.readlineTest(f, zipfile.ZIP_STORED)
+ self.readlines_test(f, zipfile.ZIP_STORED)
- def testReadlinesStored(self):
+ def test_iterlines_stored(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.readlinesTest(f, zipfile.ZIP_STORED)
+ self.iterlines_test(f, zipfile.ZIP_STORED)
- def testIterlinesStored(self):
+ @skipUnless(zlib, "requires zlib")
+ def test_read_deflated(self):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.iterlinesTest(f, zipfile.ZIP_STORED)
+ self.read_test(f, zipfile.ZIP_DEFLATED)
- if zlib:
- def testReadDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.readTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readline_read_deflated(self):
+ # Issue #7610: calls to readline() interleaved with calls to read().
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.readline_read_test(f, zipfile.ZIP_DEFLATED)
- def testReadlineDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.readlineTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readline_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.readline_test(f, zipfile.ZIP_DEFLATED)
- def testReadlinesDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.readlinesTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readlines_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.readlines_test(f, zipfile.ZIP_DEFLATED)
- def testIterlinesDeflated(self):
- for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
- self.iterlinesTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_iterlines_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.iterlines_test(f, zipfile.ZIP_DEFLATED)
def tearDown(self):
for sep, fn in self.arcfiles.items():
os.remove(fn)
- support.unlink(TESTFN)
- support.unlink(TESTFN2)
+ unlink(TESTFN)
+ unlink(TESTFN2)
def test_main():
run_unittest(TestsWithSourceFile, TestZip64InSmallFiles, OtherTests,
PyZipFileTests, DecryptionTests, TestsWithMultipleOpens,
- TestWithDirectory,
- UniversalNewlineTests, TestsWithRandomBinaryFiles)
+ TestWithDirectory, UniversalNewlineTests,
+ TestsWithRandomBinaryFiles)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index ebf6ad4df2..090f0f3ecc 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -6,11 +6,17 @@ import struct
import time
import unittest
-import zlib # implied prerequisite
-from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
from test import support
from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
+# some tests can be ran even without zlib
+try:
+ import zlib
+except ImportError:
+ zlib = None
+
+from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
+
import zipimport
import linecache
import doctest
@@ -42,17 +48,15 @@ NOW = time.time()
test_pyc = make_pyc(test_co, NOW)
-if __debug__:
- pyc_ext = ".pyc"
-else:
- pyc_ext = ".pyo"
-
-
TESTMOD = "ziptestmodule"
TESTPACK = "ziptestpackage"
TESTPACK2 = "ziptestpackage2"
TEMP_ZIP = os.path.abspath("junk95142.zip")
+pyc_file = imp.cache_from_source(TESTMOD + '.py')
+pyc_ext = ('.pyc' if __debug__ else '.pyo')
+
+
class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
compression = ZIP_STORED
@@ -76,14 +80,11 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
stuff = kw.get("stuff", None)
if stuff is not None:
# Prepend 'stuff' to the start of the zipfile
- f = open(TEMP_ZIP, "rb")
- data = f.read()
- f.close()
-
- f = open(TEMP_ZIP, "wb")
- f.write(stuff)
- f.write(data)
- f.close()
+ with open(TEMP_ZIP, "rb") as f:
+ data = f.read()
+ with open(TEMP_ZIP, "wb") as f:
+ f.write(stuff)
+ f.write(data)
sys.path.insert(0, TEMP_ZIP)
@@ -173,8 +174,9 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
def testBadMTime(self):
badtime_pyc = bytearray(test_pyc)
- badtime_pyc[7] ^= 0x02 # flip the second bit -- not the first as that one
- # isn't stored in the .py's mtime in the zip archive.
+ # flip the second bit -- not the first as that one isn't stored in the
+ # .py's mtime in the zip archive.
+ badtime_pyc[7] ^= 0x02
files = {TESTMOD + ".py": (NOW, test_src),
TESTMOD + pyc_ext: (NOW, badtime_pyc)}
self.doTest(".py", files, TESTMOD)
@@ -220,12 +222,13 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
mod_path = packdir2 + TESTMOD
mod_name = module_path_to_dotted_name(mod_path)
- pkg = __import__(mod_name)
+ __import__(mod_name)
mod = sys.modules[mod_name]
self.assertEqual(zi.get_source(TESTPACK), None)
self.assertEqual(zi.get_source(mod_path), None)
self.assertEqual(zi.get_filename(mod_path), mod.__file__)
- # To pass in the module name instead of the path, we must use the right importer
+ # To pass in the module name instead of the path, we must use the
+ # right importer
loader = mod.__loader__
self.assertEqual(loader.get_source(mod_name), None)
self.assertEqual(loader.get_filename(mod_name), mod.__file__)
@@ -259,17 +262,20 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
mod = zi.load_module(TESTPACK2)
self.assertEqual(zi.get_filename(TESTPACK2), mod.__file__)
- self.assertEqual(zi.is_package(TESTPACK2 + os.sep + '__init__'), False)
- self.assertEqual(zi.is_package(TESTPACK2 + os.sep + TESTMOD), False)
+ self.assertEqual(
+ zi.is_package(TESTPACK2 + os.sep + '__init__'), False)
+ self.assertEqual(
+ zi.is_package(TESTPACK2 + os.sep + TESTMOD), False)
mod_path = TESTPACK2 + os.sep + TESTMOD
mod_name = module_path_to_dotted_name(mod_path)
- pkg = __import__(mod_name)
+ __import__(mod_name)
mod = sys.modules[mod_name]
self.assertEqual(zi.get_source(TESTPACK2), None)
self.assertEqual(zi.get_source(mod_path), None)
self.assertEqual(zi.get_filename(mod_path), mod.__file__)
- # To pass in the module name instead of the path, we must use the right importer
+ # To pass in the module name instead of the path, we must use the
+ # right importer
loader = mod.__loader__
self.assertEqual(loader.get_source(mod_name), None)
self.assertEqual(loader.get_filename(mod_name), mod.__file__)
@@ -287,7 +293,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
z.close()
zi = zipimport.zipimporter(TEMP_ZIP)
self.assertEqual(data, zi.get_data(name))
- self.assertTrue('zipimporter object' in repr(zi))
+ self.assertIn('zipimporter object', repr(zi))
finally:
z.close()
os.remove(TEMP_ZIP)
@@ -354,7 +360,6 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
def testDoctestSuite(self):
self.runDoctest(self.doDoctestSuite)
-
def doTraceback(self, module):
try:
module.do_raise()
@@ -377,7 +382,22 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
files = {TESTMOD + ".py": (NOW, raise_src)}
self.doTest(None, files, TESTMOD, call=self.doTraceback)
+ @unittest.skipIf(support.TESTFN_UNENCODABLE is None,
+ "need an unencodable filename")
+ def testUnencodable(self):
+ filename = support.TESTFN_UNENCODABLE + ".zip"
+ z = ZipFile(filename, "w")
+ zinfo = ZipInfo(TESTMOD + ".py", time.localtime(NOW))
+ zinfo.compress_type = self.compression
+ z.writestr(zinfo, test_src)
+ z.close()
+ try:
+ zipimport.zipimporter(filename)
+ finally:
+ os.remove(filename)
+
+@unittest.skipUnless(zlib, "requires zlib")
class CompressedZipImportTestCase(UncompressedZipImportTestCase):
compression = ZIP_DEFLATED
diff --git a/Lib/test/test_zipimport_support.py b/Lib/test/test_zipimport_support.py
index 94a65fc7b2..610dfa0d0a 100644
--- a/Lib/test/test_zipimport_support.py
+++ b/Lib/test/test_zipimport_support.py
@@ -2,7 +2,6 @@
# for working with modules located inside zipfiles
# The tests are centralised in this fashion to make it easy to drop them
# if a platform doesn't support zipimport
-import unittest
import test.support
import os
import os.path
@@ -14,6 +13,9 @@ import doctest
import inspect
import linecache
import pdb
+import unittest
+from test.script_helper import (spawn_python, kill_python, assert_python_ok,
+ temp_dir, make_script, make_zip_script)
verbose = test.support.verbose
@@ -28,12 +30,6 @@ verbose = test.support.verbose
# Retrieve some helpers from other test cases
from test import test_doctest, sample_doctest
-from test.test_importhooks import ImportHooksBaseTestCase
-from test.test_cmd_line_script import temp_dir, _run_python, \
- _spawn_python, _kill_python, \
- _make_test_script, \
- _compile_test_script, \
- _make_test_zip, _make_test_pkg
def _run_object_doctest(obj, module):
@@ -63,30 +59,44 @@ def _run_object_doctest(obj, module):
-class ZipSupportTests(ImportHooksBaseTestCase):
- # We use the ImportHooksBaseTestCase to restore
+class ZipSupportTests(unittest.TestCase):
+ # This used to use the ImportHooksBaseTestCase to restore
# the state of the import related information
- # in the sys module after each test
+ # in the sys module after each test. However, that restores
+ # *too much* information and breaks for the invocation of
+ # of test_doctest. So we do our own thing and leave
+ # sys.modules alone.
# We also clear the linecache and zipimport cache
# just to avoid any bogus errors due to name reuse in the tests
def setUp(self):
linecache.clearcache()
zipimport._zip_directory_cache.clear()
- ImportHooksBaseTestCase.setUp(self)
+ self.path = sys.path[:]
+ self.meta_path = sys.meta_path[:]
+ self.path_hooks = sys.path_hooks[:]
+ sys.path_importer_cache.clear()
+ def tearDown(self):
+ sys.path[:] = self.path
+ sys.meta_path[:] = self.meta_path
+ sys.path_hooks[:] = self.path_hooks
+ sys.path_importer_cache.clear()
def test_inspect_getsource_issue4223(self):
test_src = "def foo(): pass\n"
with temp_dir() as d:
- init_name = _make_test_script(d, '__init__', test_src)
+ init_name = make_script(d, '__init__', test_src)
name_in_zip = os.path.join('zip_pkg',
os.path.basename(init_name))
- zip_name, run_name = _make_test_zip(d, 'test_zip',
+ zip_name, run_name = make_zip_script(d, 'test_zip',
init_name, name_in_zip)
os.remove(init_name)
sys.path.insert(0, zip_name)
import zip_pkg
- self.assertEqual(inspect.getsource(zip_pkg.foo), test_src)
+ try:
+ self.assertEqual(inspect.getsource(zip_pkg.foo), test_src)
+ finally:
+ del sys.modules["zip_pkg"]
def test_doctest_issue4197(self):
# To avoid having to keep two copies of the doctest module's
@@ -106,9 +116,9 @@ class ZipSupportTests(ImportHooksBaseTestCase):
sample_src = sample_src.replace("test.test_doctest",
"test_zipped_doctest")
with temp_dir() as d:
- script_name = _make_test_script(d, 'test_zipped_doctest',
+ script_name = make_script(d, 'test_zipped_doctest',
test_src)
- zip_name, run_name = _make_test_zip(d, 'test_zip',
+ zip_name, run_name = make_zip_script(d, 'test_zip',
script_name)
z = zipfile.ZipFile(zip_name, 'a')
z.writestr("sample_zipped_doctest.py", sample_src)
@@ -121,53 +131,56 @@ class ZipSupportTests(ImportHooksBaseTestCase):
os.remove(script_name)
sys.path.insert(0, zip_name)
import test_zipped_doctest
- # Some of the doc tests depend on the colocated text files
- # which aren't available to the zipped version (the doctest
- # module currently requires real filenames for non-embedded
- # tests). So we're forced to be selective about which tests
- # to run.
- # doctest could really use some APIs which take a text
- # string or a file object instead of a filename...
- known_good_tests = [
- test_zipped_doctest.SampleClass,
- test_zipped_doctest.SampleClass.NestedClass,
- test_zipped_doctest.SampleClass.NestedClass.__init__,
- test_zipped_doctest.SampleClass.__init__,
- test_zipped_doctest.SampleClass.a_classmethod,
- test_zipped_doctest.SampleClass.a_property,
- test_zipped_doctest.SampleClass.a_staticmethod,
- test_zipped_doctest.SampleClass.double,
- test_zipped_doctest.SampleClass.get,
- test_zipped_doctest.SampleNewStyleClass,
- test_zipped_doctest.SampleNewStyleClass.__init__,
- test_zipped_doctest.SampleNewStyleClass.double,
- test_zipped_doctest.SampleNewStyleClass.get,
- test_zipped_doctest.sample_func,
- test_zipped_doctest.test_DocTest,
- test_zipped_doctest.test_DocTestParser,
- test_zipped_doctest.test_DocTestRunner.basics,
- test_zipped_doctest.test_DocTestRunner.exceptions,
- test_zipped_doctest.test_DocTestRunner.option_directives,
- test_zipped_doctest.test_DocTestRunner.optionflags,
- test_zipped_doctest.test_DocTestRunner.verbose_flag,
- test_zipped_doctest.test_Example,
- test_zipped_doctest.test_debug,
- test_zipped_doctest.test_pdb_set_trace,
- test_zipped_doctest.test_pdb_set_trace_nested,
- test_zipped_doctest.test_testsource,
- test_zipped_doctest.test_trailing_space_in_test,
- test_zipped_doctest.test_DocTestSuite,
- test_zipped_doctest.test_DocTestFinder,
- ]
- # These remaining tests are the ones which need access
- # to the data files, so we don't run them
- fail_due_to_missing_data_files = [
- test_zipped_doctest.test_DocFileSuite,
- test_zipped_doctest.test_testfile,
- test_zipped_doctest.test_unittest_reportflags,
- ]
- for obj in known_good_tests:
- _run_object_doctest(obj, test_zipped_doctest)
+ try:
+ # Some of the doc tests depend on the colocated text files
+ # which aren't available to the zipped version (the doctest
+ # module currently requires real filenames for non-embedded
+ # tests). So we're forced to be selective about which tests
+ # to run.
+ # doctest could really use some APIs which take a text
+ # string or a file object instead of a filename...
+ known_good_tests = [
+ test_zipped_doctest.SampleClass,
+ test_zipped_doctest.SampleClass.NestedClass,
+ test_zipped_doctest.SampleClass.NestedClass.__init__,
+ test_zipped_doctest.SampleClass.__init__,
+ test_zipped_doctest.SampleClass.a_classmethod,
+ test_zipped_doctest.SampleClass.a_property,
+ test_zipped_doctest.SampleClass.a_staticmethod,
+ test_zipped_doctest.SampleClass.double,
+ test_zipped_doctest.SampleClass.get,
+ test_zipped_doctest.SampleNewStyleClass,
+ test_zipped_doctest.SampleNewStyleClass.__init__,
+ test_zipped_doctest.SampleNewStyleClass.double,
+ test_zipped_doctest.SampleNewStyleClass.get,
+ test_zipped_doctest.sample_func,
+ test_zipped_doctest.test_DocTest,
+ test_zipped_doctest.test_DocTestParser,
+ test_zipped_doctest.test_DocTestRunner.basics,
+ test_zipped_doctest.test_DocTestRunner.exceptions,
+ test_zipped_doctest.test_DocTestRunner.option_directives,
+ test_zipped_doctest.test_DocTestRunner.optionflags,
+ test_zipped_doctest.test_DocTestRunner.verbose_flag,
+ test_zipped_doctest.test_Example,
+ test_zipped_doctest.test_debug,
+ test_zipped_doctest.test_pdb_set_trace,
+ test_zipped_doctest.test_pdb_set_trace_nested,
+ test_zipped_doctest.test_testsource,
+ test_zipped_doctest.test_trailing_space_in_test,
+ test_zipped_doctest.test_DocTestSuite,
+ test_zipped_doctest.test_DocTestFinder,
+ ]
+ # These remaining tests are the ones which need access
+ # to the data files, so we don't run them
+ fail_due_to_missing_data_files = [
+ test_zipped_doctest.test_DocFileSuite,
+ test_zipped_doctest.test_testfile,
+ test_zipped_doctest.test_unittest_reportflags,
+ ]
+ for obj in known_good_tests:
+ _run_object_doctest(obj, test_zipped_doctest)
+ finally:
+ del sys.modules["test_zipped_doctest"]
def test_doctest_main_issue4197(self):
test_src = textwrap.dedent("""\
@@ -180,23 +193,23 @@ class ZipSupportTests(ImportHooksBaseTestCase):
""")
pattern = 'File "%s", line 2, in %s'
with temp_dir() as d:
- script_name = _make_test_script(d, 'script', test_src)
- exit_code, data = _run_python(script_name)
+ script_name = make_script(d, 'script', test_src)
+ rc, out, err = assert_python_ok(script_name)
expected = pattern % (script_name, "__main__.Test")
if verbose:
print ("Expected line", expected)
print ("Got stdout:")
- print (data)
- self.assertTrue(expected in data)
- zip_name, run_name = _make_test_zip(d, "test_zip",
+ print (ascii(out))
+ self.assertIn(expected.encode('utf-8'), out)
+ zip_name, run_name = make_zip_script(d, "test_zip",
script_name, '__main__.py')
- exit_code, data = _run_python(zip_name)
+ rc, out, err = assert_python_ok(zip_name)
expected = pattern % (run_name, "__main__.Test")
if verbose:
print ("Expected line", expected)
print ("Got stdout:")
- print (data)
- self.assertTrue(expected in data)
+ print (ascii(out))
+ self.assertIn(expected.encode('utf-8'), out)
def test_pdb_issue4201(self):
test_src = textwrap.dedent("""\
@@ -204,20 +217,20 @@ class ZipSupportTests(ImportHooksBaseTestCase):
pass
import pdb
- pdb.runcall(f)
+ pdb.Pdb(nosigint=True).runcall(f)
""")
with temp_dir() as d:
- script_name = _make_test_script(d, 'script', test_src)
- p = _spawn_python(script_name)
+ script_name = make_script(d, 'script', test_src)
+ p = spawn_python(script_name)
p.stdin.write(b'l\n')
- data = _kill_python(p).decode()
- self.assertTrue(script_name in data)
- zip_name, run_name = _make_test_zip(d, "test_zip",
+ data = kill_python(p)
+ self.assertIn(script_name.encode('utf-8'), data)
+ zip_name, run_name = make_zip_script(d, "test_zip",
script_name, '__main__.py')
- p = _spawn_python(zip_name)
+ p = spawn_python(zip_name)
p.stdin.write(b'l\n')
- data = _kill_python(p).decode()
- self.assertTrue(run_name in data)
+ data = kill_python(p)
+ self.assertIn(run_name.encode('utf-8'), data)
def test_main():
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index 7593c064b0..9aafffa8d2 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -66,10 +66,6 @@ class ChecksumTestCase(unittest.TestCase):
# Issue #10276 - check that inputs >=4GB are handled correctly.
class ChecksumBigBufferTestCase(unittest.TestCase):
- @unittest.skipUnless(mmap, "mmap() is not available.")
- @unittest.skipUnless(sys.maxsize > _4G, "Can't run on a 32-bit system.")
- @unittest.skipUnless(support.is_resource_enabled("largefile"),
- "May use lots of disk space.")
def setUp(self):
with open(support.TESTFN, "wb+") as f:
f.seek(_4G)
@@ -81,6 +77,10 @@ class ChecksumBigBufferTestCase(unittest.TestCase):
self.mapping.close()
support.unlink(support.TESTFN)
+ @unittest.skipUnless(mmap, "mmap() is not available.")
+ @unittest.skipUnless(sys.maxsize > _4G, "Can't run on a 32-bit system.")
+ @unittest.skipUnless(support.is_resource_enabled("largefile"),
+ "May use lots of disk space.")
def test_big_buffer(self):
self.assertEqual(zlib.crc32(self.mapping), 3058686908)
self.assertEqual(zlib.adler32(self.mapping), 82837919)
@@ -129,7 +129,7 @@ class BaseCompressTestCase(object):
# Generate 10MB worth of random, and expand it by repeating it.
# The assumption is that zlib's memory is not big enough to exploit
# such spread out redundancy.
- data = b''.join([binascii.a2b_hex(fmt % random.getrandbits(8 * _1M))
+ data = b''.join([random.getrandbits(8 * _1M).to_bytes(_1M, 'little')
for i in range(10)])
data = data * (size // len(data) + 1)
try:
@@ -171,7 +171,7 @@ class CompressTestCase(BaseCompressTestCase, unittest.TestCase):
def test_incomplete_stream(self):
# An useful error message is given
x = zlib.compress(HAMLET_SCENE)
- self.assertRaisesRegexp(zlib.error,
+ self.assertRaisesRegex(zlib.error,
"Error -5 while decompressing data: incomplete or truncated stream",
zlib.decompress, x[:-1])
@@ -186,6 +186,16 @@ class CompressTestCase(BaseCompressTestCase, unittest.TestCase):
def test_big_decompress_buffer(self, size):
self.check_big_decompress_buffer(size, zlib.decompress)
+ @precisionbigmemtest(size=_4G + 100, memuse=1)
+ def test_length_overflow(self, size):
+ if size < _4G + 100:
+ self.skipTest("not enough free memory, need at least 4 GB")
+ data = b'x' * size
+ try:
+ self.assertRaises(OverflowError, zlib.compress, data, 1)
+ finally:
+ data = None
+
class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
# Test compression object
@@ -205,8 +215,8 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
y1 = dco.decompress(v1 + v2)
y2 = dco.flush()
self.assertEqual(data, y1 + y2)
- self.assertTrue(isinstance(dco.unconsumed_tail, bytes))
- self.assertTrue(isinstance(dco.unused_data, bytes))
+ self.assertIsInstance(dco.unconsumed_tail, bytes)
+ self.assertIsInstance(dco.unused_data, bytes)
def test_compressoptions(self):
# specify lots of options to compressobj()
@@ -251,7 +261,7 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
decombuf = zlib.decompress(combuf)
# Test type of return value
- self.assertTrue(isinstance(decombuf, bytes))
+ self.assertIsInstance(decombuf, bytes)
self.assertEqual(data, decombuf)
@@ -463,7 +473,7 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
data = HAMLET_SCENE
comp = zlib.compress(data)
# Test type of return value
- self.assertTrue(isinstance(comp, bytes))
+ self.assertIsInstance(comp, bytes)
d0 = zlib.decompressobj()
bufs0 = []
diff --git a/Lib/test/testtar.tar b/Lib/test/testtar.tar
index b5bb46b16e..b93210453d 100644
--- a/Lib/test/testtar.tar
+++ b/Lib/test/testtar.tar
Binary files differ
diff --git a/Lib/test/threaded_import_hangers.py b/Lib/test/threaded_import_hangers.py
index d7508741d3..adf03e31ff 100644
--- a/Lib/test/threaded_import_hangers.py
+++ b/Lib/test/threaded_import_hangers.py
@@ -29,7 +29,7 @@ class Worker(threading.Thread):
for name, func, args in [
# Bug 147376: TemporaryFile hung on Windows, starting in Python 2.4.
- ("tempfile.TemporaryFile", tempfile.TemporaryFile, ()),
+ ("tempfile.TemporaryFile", lambda: tempfile.TemporaryFile().close(), ()),
# The real cause for bug 147376: ntpath.abspath() caused the hang.
("os.path.abspath", os.path.abspath, ('.',)),
diff --git a/Lib/test/win_console_handler.py b/Lib/test/win_console_handler.py
new file mode 100644
index 0000000000..e7779b9363
--- /dev/null
+++ b/Lib/test/win_console_handler.py
@@ -0,0 +1,49 @@
+"""Script used to test os.kill on Windows, for issue #1220212
+
+This script is started as a subprocess in test_os and is used to test the
+CTRL_C_EVENT and CTRL_BREAK_EVENT signals, which requires a custom handler
+to be written into the kill target.
+
+See http://msdn.microsoft.com/en-us/library/ms685049%28v=VS.85%29.aspx for a
+similar example in C.
+"""
+
+from ctypes import wintypes, WINFUNCTYPE
+import signal
+import ctypes
+import mmap
+import sys
+
+# Function prototype for the handler function. Returns BOOL, takes a DWORD.
+HandlerRoutine = WINFUNCTYPE(wintypes.BOOL, wintypes.DWORD)
+
+def _ctrl_handler(sig):
+ """Handle a sig event and return 0 to terminate the process"""
+ if sig == signal.CTRL_C_EVENT:
+ pass
+ elif sig == signal.CTRL_BREAK_EVENT:
+ pass
+ else:
+ print("UNKNOWN EVENT")
+ return 0
+
+ctrl_handler = HandlerRoutine(_ctrl_handler)
+
+
+SetConsoleCtrlHandler = ctypes.windll.kernel32.SetConsoleCtrlHandler
+SetConsoleCtrlHandler.argtypes = (HandlerRoutine, wintypes.BOOL)
+SetConsoleCtrlHandler.restype = wintypes.BOOL
+
+if __name__ == "__main__":
+ # Add our console control handling function with value 1
+ if not SetConsoleCtrlHandler(ctrl_handler, 1):
+ print("Unable to add SetConsoleCtrlHandler")
+ exit(-1)
+
+ # Awake main process
+ m = mmap.mmap(-1, 1, sys.argv[1])
+ m[0] = 1
+
+ # Do nothing but wait for the signal
+ while True:
+ pass
diff --git a/Lib/test/xmltestdata/simple-ns.xml b/Lib/test/xmltestdata/simple-ns.xml
new file mode 100644
index 0000000000..f1f34b2e29
--- /dev/null
+++ b/Lib/test/xmltestdata/simple-ns.xml
@@ -0,0 +1,7 @@
+<?pi data?>
+<!-- comment -->
+<root xmlns='namespace'>
+ <element key='value'>text</element>
+ <element>text</element>tail
+ <empty-element/>
+</root>
diff --git a/Lib/test/xmltestdata/simple.xml b/Lib/test/xmltestdata/simple.xml
new file mode 100644
index 0000000000..b88c2c7e69
--- /dev/null
+++ b/Lib/test/xmltestdata/simple.xml
@@ -0,0 +1,6 @@
+<!-- comment -->
+<root>
+ <element key='value'>text</element>
+ <element>text</element>tail
+ <empty-element/>
+</root>
diff --git a/Lib/test/test.xml b/Lib/test/xmltestdata/test.xml
index 9af92fb435..9af92fb435 100644
--- a/Lib/test/test.xml
+++ b/Lib/test/xmltestdata/test.xml
diff --git a/Lib/test/test.xml.out b/Lib/test/xmltestdata/test.xml.out
index d4ab1abcb6..d4ab1abcb6 100644
--- a/Lib/test/test.xml.out
+++ b/Lib/test/xmltestdata/test.xml.out
diff --git a/Lib/test/zip_cp437_header.zip b/Lib/test/zip_cp437_header.zip
new file mode 100644
index 0000000000..f7c6cf1704
--- /dev/null
+++ b/Lib/test/zip_cp437_header.zip
Binary files differ
diff --git a/Lib/threading.py b/Lib/threading.py
index c965c6f0f5..fd93f74333 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -17,24 +17,24 @@ from collections import deque
# with the multiprocessing module, which doesn't provide the old
# Java inspired names.
-
-# Rename some stuff so "from threading import *" is safe
__all__ = ['active_count', 'Condition', 'current_thread', 'enumerate', 'Event',
- 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Thread',
+ 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Thread', 'Barrier',
'Timer', 'setprofile', 'settrace', 'local', 'stack_size']
+# Rename some stuff so "from threading import *" is safe
_start_new_thread = _thread.start_new_thread
_allocate_lock = _thread.allocate_lock
_get_ident = _thread.get_ident
ThreadError = _thread.error
+try:
+ _CRLock = _thread.RLock
+except AttributeError:
+ _CRLock = None
+TIMEOUT_MAX = _thread.TIMEOUT_MAX
del _thread
# Debug support (adapted from ihooks.py).
-# All the major classes here derive from _Verbose. We force that to
-# be a new-style class so that all the major classes here are new-style.
-# This helps debugging (type(instance) is more revealing for instances
-# of new-style classes).
_VERBOSE = False
@@ -85,8 +85,12 @@ def settrace(func):
Lock = _allocate_lock
-def RLock(*args, **kwargs):
- return _RLock(*args, **kwargs)
+def RLock(verbose=None, *args, **kwargs):
+ if verbose is None:
+ verbose = _VERBOSE
+ if (__debug__ and verbose) or _CRLock is None:
+ return _PyRLock(verbose, *args, **kwargs)
+ return _CRLock(*args, **kwargs)
class _RLock(_Verbose):
@@ -105,14 +109,14 @@ class _RLock(_Verbose):
return "<%s owner=%r count=%d>" % (
self.__class__.__name__, owner, self._count)
- def acquire(self, blocking=True):
+ def acquire(self, blocking=True, timeout=-1):
me = _get_ident()
if self._owner == me:
self._count = self._count + 1
if __debug__:
self._note("%s.acquire(%s): recursive success", self, blocking)
return 1
- rc = self._block.acquire(blocking)
+ rc = self._block.acquire(blocking, timeout)
if rc:
self._owner = me
self._count = 1
@@ -162,6 +166,8 @@ class _RLock(_Verbose):
def _is_owned(self):
return self._owner == _get_ident()
+_PyRLock = _RLock
+
def Condition(*args, **kwargs):
return _Condition(*args, **kwargs)
@@ -227,25 +233,14 @@ class _Condition(_Verbose):
try: # restore state no matter what (e.g., KeyboardInterrupt)
if timeout is None:
waiter.acquire()
+ gotit = True
if __debug__:
self._note("%s.wait(): got it", self)
else:
- # Balancing act: We can't afford a pure busy loop, so we
- # have to sleep; but if we sleep the whole timeout time,
- # we'll be unresponsive. The scheme here sleeps very
- # little at first, longer as time goes on, but never longer
- # than 20 times per second (or the timeout time remaining).
- endtime = _time() + timeout
- delay = 0.0005 # 500 us -> initial delay of 1 ms
- while True:
- gotit = waiter.acquire(0)
- if gotit:
- break
- remaining = endtime - _time()
- if remaining <= 0:
- break
- delay = min(delay * 2, remaining, .05)
- _sleep(delay)
+ if timeout > 0:
+ gotit = waiter.acquire(True, timeout)
+ else:
+ gotit = waiter.acquire(False)
if not gotit:
if __debug__:
self._note("%s.wait(%s): timed out", self, timeout)
@@ -256,9 +251,36 @@ class _Condition(_Verbose):
else:
if __debug__:
self._note("%s.wait(%s): got it", self, timeout)
+ return gotit
finally:
self._acquire_restore(saved_state)
+ def wait_for(self, predicate, timeout=None):
+ endtime = None
+ waittime = timeout
+ result = predicate()
+ while not result:
+ if waittime is not None:
+ if endtime is None:
+ endtime = _time() + waittime
+ else:
+ waittime = endtime - _time()
+ if waittime <= 0:
+ if __debug__:
+ self._note("%s.wait_for(%r, %r): Timed out.",
+ self, predicate, timeout)
+ break
+ if __debug__:
+ self._note("%s.wait_for(%r, %r): Waiting with timeout=%s.",
+ self, predicate, timeout, waittime)
+ self.wait(waittime)
+ result = predicate()
+ else:
+ if __debug__:
+ self._note("%s.wait_for(%r, %r): Success.",
+ self, predicate, timeout)
+ return result
+
def notify(self, n=1):
if not self._is_owned():
raise RuntimeError("cannot notify on un-acquired lock")
@@ -297,8 +319,11 @@ class _Semaphore(_Verbose):
self._cond = Condition(Lock())
self._value = value
- def acquire(self, blocking=True):
+ def acquire(self, blocking=True, timeout=None):
+ if not blocking and timeout is not None:
+ raise ValueError("can't specify timeout for non-blocking acquire")
rc = False
+ endtime = None
self._cond.acquire()
while self._value == 0:
if not blocking:
@@ -306,7 +331,14 @@ class _Semaphore(_Verbose):
if __debug__:
self._note("%s.acquire(%s): blocked waiting, value=%s",
self, blocking, self._value)
- self._cond.wait()
+ if timeout is not None:
+ if endtime is None:
+ endtime = _time() + timeout
+ else:
+ timeout = endtime - _time()
+ if timeout <= 0:
+ break
+ self._cond.wait(timeout)
else:
self._value = self._value - 1
if __debug__:
@@ -391,6 +423,177 @@ class _Event(_Verbose):
finally:
self._cond.release()
+
+# A barrier class. Inspired in part by the pthread_barrier_* api and
+# the CyclicBarrier class from Java. See
+# http://sourceware.org/pthreads-win32/manual/pthread_barrier_init.html and
+# http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/
+# CyclicBarrier.html
+# for information.
+# We maintain two main states, 'filling' and 'draining' enabling the barrier
+# to be cyclic. Threads are not allowed into it until it has fully drained
+# since the previous cycle. In addition, a 'resetting' state exists which is
+# similar to 'draining' except that threads leave with a BrokenBarrierError,
+# and a 'broken' state in which all threads get get the exception.
+class Barrier(_Verbose):
+ """
+ Barrier. Useful for synchronizing a fixed number of threads
+ at known synchronization points. Threads block on 'wait()' and are
+ simultaneously once they have all made that call.
+ """
+ def __init__(self, parties, action=None, timeout=None, verbose=None):
+ """
+ Create a barrier, initialised to 'parties' threads.
+ 'action' is a callable which, when supplied, will be called
+ by one of the threads after they have all entered the
+ barrier and just prior to releasing them all.
+ If a 'timeout' is provided, it is uses as the default for
+ all subsequent 'wait()' calls.
+ """
+ _Verbose.__init__(self, verbose)
+ self._cond = Condition(Lock())
+ self._action = action
+ self._timeout = timeout
+ self._parties = parties
+ self._state = 0 #0 filling, 1, draining, -1 resetting, -2 broken
+ self._count = 0
+
+ def wait(self, timeout=None):
+ """
+ Wait for the barrier. When the specified number of threads have
+ started waiting, they are all simultaneously awoken. If an 'action'
+ was provided for the barrier, one of the threads will have executed
+ that callback prior to returning.
+ Returns an individual index number from 0 to 'parties-1'.
+ """
+ if timeout is None:
+ timeout = self._timeout
+ with self._cond:
+ self._enter() # Block while the barrier drains.
+ index = self._count
+ self._count += 1
+ try:
+ if index + 1 == self._parties:
+ # We release the barrier
+ self._release()
+ else:
+ # We wait until someone releases us
+ self._wait(timeout)
+ return index
+ finally:
+ self._count -= 1
+ # Wake up any threads waiting for barrier to drain.
+ self._exit()
+
+ # Block until the barrier is ready for us, or raise an exception
+ # if it is broken.
+ def _enter(self):
+ while self._state in (-1, 1):
+ # It is draining or resetting, wait until done
+ self._cond.wait()
+ #see if the barrier is in a broken state
+ if self._state < 0:
+ raise BrokenBarrierError
+ assert self._state == 0
+
+ # Optionally run the 'action' and release the threads waiting
+ # in the barrier.
+ def _release(self):
+ try:
+ if self._action:
+ self._action()
+ # enter draining state
+ self._state = 1
+ self._cond.notify_all()
+ except:
+ #an exception during the _action handler. Break and reraise
+ self._break()
+ raise
+
+ # Wait in the barrier until we are relased. Raise an exception
+ # if the barrier is reset or broken.
+ def _wait(self, timeout):
+ if not self._cond.wait_for(lambda : self._state != 0, timeout):
+ #timed out. Break the barrier
+ self._break()
+ raise BrokenBarrierError
+ if self._state < 0:
+ raise BrokenBarrierError
+ assert self._state == 1
+
+ # If we are the last thread to exit the barrier, signal any threads
+ # waiting for the barrier to drain.
+ def _exit(self):
+ if self._count == 0:
+ if self._state in (-1, 1):
+ #resetting or draining
+ self._state = 0
+ self._cond.notify_all()
+
+ def reset(self):
+ """
+ Reset the barrier to the initial state.
+ Any threads currently waiting will get the BrokenBarrier exception
+ raised.
+ """
+ with self._cond:
+ if self._count > 0:
+ if self._state == 0:
+ #reset the barrier, waking up threads
+ self._state = -1
+ elif self._state == -2:
+ #was broken, set it to reset state
+ #which clears when the last thread exits
+ self._state = -1
+ else:
+ self._state = 0
+ self._cond.notify_all()
+
+ def abort(self):
+ """
+ Place the barrier into a 'broken' state.
+ Useful in case of error. Any currently waiting threads and
+ threads attempting to 'wait()' will have BrokenBarrierError
+ raised.
+ """
+ with self._cond:
+ self._break()
+
+ def _break(self):
+ # An internal error was detected. The barrier is set to
+ # a broken state all parties awakened.
+ self._state = -2
+ self._cond.notify_all()
+
+ @property
+ def parties(self):
+ """
+ Return the number of threads required to trip the barrier.
+ """
+ return self._parties
+
+ @property
+ def n_waiting(self):
+ """
+ Return the number of threads that are currently waiting at the barrier.
+ """
+ # We don't need synchronization here since this is an ephemeral result
+ # anyway. It returns the correct value in the steady state.
+ if self._state == 0:
+ return self._count
+ return 0
+
+ @property
+ def broken(self):
+ """
+ Return True if the barrier is in a broken state
+ """
+ return self._state == -2
+
+#exception raised by the Barrier class
+class BrokenBarrierError(RuntimeError): pass
+
+
# Helper to generate new thread names
_counter = 0
def _newname(template="Thread-%d"):
@@ -881,91 +1084,3 @@ def _after_fork():
_active.clear()
_active.update(new_active)
assert len(_active) == 1
-
-
-# Self-test code
-
-def _test():
-
- class BoundedQueue(_Verbose):
-
- def __init__(self, limit):
- _Verbose.__init__(self)
- self.mon = RLock()
- self.rc = Condition(self.mon)
- self.wc = Condition(self.mon)
- self.limit = limit
- self.queue = deque()
-
- def put(self, item):
- self.mon.acquire()
- while len(self.queue) >= self.limit:
- self._note("put(%s): queue full", item)
- self.wc.wait()
- self.queue.append(item)
- self._note("put(%s): appended, length now %d",
- item, len(self.queue))
- self.rc.notify()
- self.mon.release()
-
- def get(self):
- self.mon.acquire()
- while not self.queue:
- self._note("get(): queue empty")
- self.rc.wait()
- item = self.queue.popleft()
- self._note("get(): got %s, %d left", item, len(self.queue))
- self.wc.notify()
- self.mon.release()
- return item
-
- class ProducerThread(Thread):
-
- def __init__(self, queue, quota):
- Thread.__init__(self, name="Producer")
- self.queue = queue
- self.quota = quota
-
- def run(self):
- from random import random
- counter = 0
- while counter < self.quota:
- counter = counter + 1
- self.queue.put("%s.%d" % (self.name, counter))
- _sleep(random() * 0.00001)
-
-
- class ConsumerThread(Thread):
-
- def __init__(self, queue, count):
- Thread.__init__(self, name="Consumer")
- self.queue = queue
- self.count = count
-
- def run(self):
- while self.count > 0:
- item = self.queue.get()
- print(item)
- self.count = self.count - 1
-
- NP = 3
- QL = 4
- NI = 5
-
- Q = BoundedQueue(QL)
- P = []
- for i in range(NP):
- t = ProducerThread(Q, NI)
- t.name = "Producer-%d" % (i+1)
- P.append(t)
- C = ConsumerThread(Q, NI*NP)
- for t in P:
- t.start()
- _sleep(0.000001)
- C.start()
- for t in P:
- t.join()
- C.join()
-
-if __name__ == '__main__':
- _test()
diff --git a/Lib/timeit.py b/Lib/timeit.py
index c3f6753c66..8e04645262 100644
--- a/Lib/timeit.py
+++ b/Lib/timeit.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Tool for measuring execution time of small code snippets.
@@ -232,10 +232,10 @@ def repeat(stmt="pass", setup="pass", timer=default_timer,
"""Convenience function to create Timer object and call repeat method."""
return Timer(stmt, setup, timer).repeat(repeat, number)
-def main(args=None):
+def main(args=None, *, _wrap_timer=None):
"""Main program, used when run as a script.
- The optional argument specifies the command line to be parsed,
+ The optional 'args' argument specifies the command line to be parsed,
defaulting to sys.argv[1:].
The return value is an exit code to be passed to sys.exit(); it
@@ -244,6 +244,10 @@ def main(args=None):
When an exception happens during timing, a traceback is printed to
stderr and the return value is 1. Exceptions at other times
(including the template compilation) are not caught.
+
+ '_wrap_timer' is an internal interface used for unit testing. If it
+ is not None, it must be a callable that accepts a timer function
+ and returns another timer function (used for unit testing).
"""
if args is None:
args = sys.argv[1:]
@@ -289,6 +293,8 @@ def main(args=None):
# directory)
import os
sys.path.insert(0, os.curdir)
+ if _wrap_timer is not None:
+ timer = _wrap_timer(timer)
t = Timer(stmt, setup, timer)
if number == 0:
# determine number so that 0.2 <= total time < 2.0
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 0bccbfc1f5..e54c53f18e 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -1403,6 +1403,48 @@ class CallWrapper:
self.widget._report_exception()
+class XView:
+ """Mix-in class for querying and changing the horizontal position
+ of a widget's window."""
+
+ def xview(self, *args):
+ """Query and change the horizontal position of the view."""
+ res = self.tk.call(self._w, 'xview', *args)
+ if not args:
+ return self._getdoubles(res)
+
+ def xview_moveto(self, fraction):
+ """Adjusts the view in the window so that FRACTION of the
+ total width of the canvas is off-screen to the left."""
+ self.tk.call(self._w, 'xview', 'moveto', fraction)
+
+ def xview_scroll(self, number, what):
+ """Shift the x-view according to NUMBER which is measured in "units"
+ or "pages" (WHAT)."""
+ self.tk.call(self._w, 'xview', 'scroll', number, what)
+
+
+class YView:
+ """Mix-in class for querying and changing the vertical position
+ of a widget's window."""
+
+ def yview(self, *args):
+ """Query and change the vertical position of the view."""
+ res = self.tk.call(self._w, 'yview', *args)
+ if not args:
+ return self._getdoubles(res)
+
+ def yview_moveto(self, fraction):
+ """Adjusts the view in the window so that FRACTION of the
+ total height of the canvas is off-screen to the top."""
+ self.tk.call(self._w, 'yview', 'moveto', fraction)
+
+ def yview_scroll(self, number, what):
+ """Shift the y-view according to NUMBER which is measured in
+ "units" or "pages" (WHAT)."""
+ self.tk.call(self._w, 'yview', 'scroll', number, what)
+
+
class Wm:
"""Provides functions for the communication with the window manager."""
@@ -2041,7 +2083,7 @@ def At(x, y=None):
else:
return '@%r,%r' % (x, y)
-class Canvas(Widget):
+class Canvas(Widget, XView, YView):
"""Canvas widget to display graphical elements like lines or text."""
def __init__(self, master=None, cnf={}, **kw):
"""Construct a canvas widget with the parent MASTER.
@@ -2281,30 +2323,6 @@ class Canvas(Widget):
def type(self, tagOrId):
"""Return the type of the item TAGORID."""
return self.tk.call(self._w, 'type', tagOrId) or None
- def xview(self, *args):
- """Query and change horizontal position of the view."""
- if not args:
- return self._getdoubles(self.tk.call(self._w, 'xview'))
- self.tk.call((self._w, 'xview') + args)
- def xview_moveto(self, fraction):
- """Adjusts the view in the window so that FRACTION of the
- total width of the canvas is off-screen to the left."""
- self.tk.call(self._w, 'xview', 'moveto', fraction)
- def xview_scroll(self, number, what):
- """Shift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT)."""
- self.tk.call(self._w, 'xview', 'scroll', number, what)
- def yview(self, *args):
- """Query and change vertical position of the view."""
- if not args:
- return self._getdoubles(self.tk.call(self._w, 'yview'))
- self.tk.call((self._w, 'yview') + args)
- def yview_moveto(self, fraction):
- """Adjusts the view in the window so that FRACTION of the
- total height of the canvas is off-screen to the top."""
- self.tk.call(self._w, 'yview', 'moveto', fraction)
- def yview_scroll(self, number, what):
- """Shift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT)."""
- self.tk.call(self._w, 'yview', 'scroll', number, what)
class Checkbutton(Widget):
"""Checkbutton widget which is either in on- or off-state."""
@@ -2335,7 +2353,7 @@ class Checkbutton(Widget):
"""Toggle the button."""
self.tk.call(self._w, 'toggle')
-class Entry(Widget):
+class Entry(Widget, XView):
"""Entry widget which allows to display simple text."""
def __init__(self, master=None, cnf={}, **kw):
"""Construct an entry widget with the parent MASTER.
@@ -2386,7 +2404,8 @@ class Entry(Widget):
self.tk.call(self._w, 'selection', 'from', index)
select_from = selection_from
def selection_present(self):
- """Return whether the widget has the selection."""
+ """Return True if there are characters selected in the entry, False
+ otherwise."""
return self.tk.getboolean(
self.tk.call(self._w, 'selection', 'present'))
select_present = selection_present
@@ -2398,16 +2417,6 @@ class Entry(Widget):
"""Set the variable end of a selection to INDEX."""
self.tk.call(self._w, 'selection', 'to', index)
select_to = selection_to
- def xview(self, index):
- """Query and change horizontal position of the view."""
- self.tk.call(self._w, 'xview', index)
- def xview_moveto(self, fraction):
- """Adjust the view in the window so that FRACTION of the
- total width of the entry is off-screen to the left."""
- self.tk.call(self._w, 'xview', 'moveto', fraction)
- def xview_scroll(self, number, what):
- """Shift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT)."""
- self.tk.call(self._w, 'xview', 'scroll', number, what)
class Frame(Widget):
"""Frame widget which may contain other widgets and can have a 3D border."""
@@ -2449,7 +2458,7 @@ class Label(Widget):
"""
Widget.__init__(self, master, 'label', cnf, kw)
-class Listbox(Widget):
+class Listbox(Widget, XView, YView):
"""Listbox widget which can display a list of strings."""
def __init__(self, master=None, cnf={}, **kw):
"""Construct a listbox widget with the parent MASTER.
@@ -2528,30 +2537,6 @@ class Listbox(Widget):
def size(self):
"""Return the number of elements in the listbox."""
return getint(self.tk.call(self._w, 'size'))
- def xview(self, *what):
- """Query and change horizontal position of the view."""
- if not what:
- return self._getdoubles(self.tk.call(self._w, 'xview'))
- self.tk.call((self._w, 'xview') + what)
- def xview_moveto(self, fraction):
- """Adjust the view in the window so that FRACTION of the
- total width of the entry is off-screen to the left."""
- self.tk.call(self._w, 'xview', 'moveto', fraction)
- def xview_scroll(self, number, what):
- """Shift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT)."""
- self.tk.call(self._w, 'xview', 'scroll', number, what)
- def yview(self, *what):
- """Query and change vertical position of the view."""
- if not what:
- return self._getdoubles(self.tk.call(self._w, 'yview'))
- self.tk.call((self._w, 'yview') + what)
- def yview_moveto(self, fraction):
- """Adjust the view in the window so that FRACTION of the
- total width of the entry is off-screen to the top."""
- self.tk.call(self._w, 'yview', 'moveto', fraction)
- def yview_scroll(self, number, what):
- """Shift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT)."""
- self.tk.call(self._w, 'yview', 'scroll', number, what)
def itemcget(self, index, option):
"""Return the resource value for an ITEM and an OPTION."""
return self.tk.call(
@@ -2798,7 +2783,7 @@ class Scrollbar(Widget):
-class Text(Widget):
+class Text(Widget, XView, YView):
"""Text widget which can display text in various forms."""
def __init__(self, master=None, cnf={}, **kw):
"""Construct a text widget with the parent MASTER.
@@ -3120,32 +3105,6 @@ class Text(Widget):
"""Return all names of embedded windows in this widget."""
return self.tk.splitlist(
self.tk.call(self._w, 'window', 'names'))
- def xview(self, *what):
- """Query and change horizontal position of the view."""
- if not what:
- return self._getdoubles(self.tk.call(self._w, 'xview'))
- self.tk.call((self._w, 'xview') + what)
- def xview_moveto(self, fraction):
- """Adjusts the view in the window so that FRACTION of the
- total width of the canvas is off-screen to the left."""
- self.tk.call(self._w, 'xview', 'moveto', fraction)
- def xview_scroll(self, number, what):
- """Shift the x-view according to NUMBER which is measured
- in "units" or "pages" (WHAT)."""
- self.tk.call(self._w, 'xview', 'scroll', number, what)
- def yview(self, *what):
- """Query and change vertical position of the view."""
- if not what:
- return self._getdoubles(self.tk.call(self._w, 'yview'))
- self.tk.call((self._w, 'yview') + what)
- def yview_moveto(self, fraction):
- """Adjusts the view in the window so that FRACTION of the
- total height of the canvas is off-screen to the top."""
- self.tk.call(self._w, 'yview', 'moveto', fraction)
- def yview_scroll(self, number, what):
- """Shift the y-view according to NUMBER which is measured
- in "units" or "pages" (WHAT)."""
- self.tk.call(self._w, 'yview', 'scroll', number, what)
def yview_pickplace(self, *what):
"""Obsolete function, use see."""
self.tk.call((self._w, 'yview', '-pickplace') + what)
@@ -3331,7 +3290,7 @@ def image_names(): return _default_root.tk.call('image', 'names')
def image_types(): return _default_root.tk.call('image', 'types')
-class Spinbox(Widget):
+class Spinbox(Widget, XView):
"""spinbox widget."""
def __init__(self, master=None, cnf={}, **kw):
"""Construct a spinbox widget with the parent MASTER.
diff --git a/Lib/tkinter/__main__.py b/Lib/tkinter/__main__.py
new file mode 100644
index 0000000000..757880d439
--- /dev/null
+++ b/Lib/tkinter/__main__.py
@@ -0,0 +1,7 @@
+"""Main entry point"""
+
+import sys
+if sys.argv[0].endswith("__main__.py"):
+ sys.argv[0] = "python -m tkinter"
+from . import _test as main
+main()
diff --git a/Lib/tkinter/font.py b/Lib/tkinter/font.py
index 1ec760ee88..5425b06013 100644
--- a/Lib/tkinter/font.py
+++ b/Lib/tkinter/font.py
@@ -97,7 +97,7 @@ class Font:
return self.name
def __eq__(self, other):
- return self.name == other.name and isinstance(other, Font)
+ return isinstance(other, Font) and self.name == other.name
def __getitem__(self, key):
return self.cget(key)
diff --git a/Lib/tkinter/scrolledtext.py b/Lib/tkinter/scrolledtext.py
index d9af67c1a2..9aa936ae94 100644
--- a/Lib/tkinter/scrolledtext.py
+++ b/Lib/tkinter/scrolledtext.py
@@ -27,8 +27,11 @@ class ScrolledText(Text):
self.pack(side=LEFT, fill=BOTH, expand=True)
self.vbar['command'] = self.yview
- # Copy geometry methods of self.frame -- hack!
- methods = vars(Pack).keys() + vars(Grid).keys() + vars(Place).keys()
+ # Copy geometry methods of self.frame without overriding Text
+ # methods -- hack!
+ text_meths = vars(Text).keys()
+ methods = vars(Pack).keys() | vars(Grid).keys() | vars(Place).keys()
+ methods = methods.difference(text_meths)
for m in methods:
if m[0] != '_' and m != 'config' and m != 'configure':
diff --git a/Lib/tkinter/test/test_tkinter/test_font.py b/Lib/tkinter/test/test_tkinter/test_font.py
new file mode 100644
index 0000000000..dfd630b4de
--- /dev/null
+++ b/Lib/tkinter/test/test_tkinter/test_font.py
@@ -0,0 +1,33 @@
+import unittest
+import tkinter
+from tkinter import font
+from test.support import requires, run_unittest
+import tkinter.test.support as support
+
+requires('gui')
+
+class FontTest(unittest.TestCase):
+
+ def setUp(self):
+ support.root_deiconify()
+
+ def tearDown(self):
+ support.root_withdraw()
+
+ def test_font_eq(self):
+ fontname = "TkDefaultFont"
+ try:
+ f = font.Font(name=fontname, exists=True)
+ except tkinter._tkinter.TclError:
+ f = font.Font(name=fontname, exists=False)
+ font1 = font.nametofont(fontname)
+ font2 = font.nametofont(fontname)
+ self.assertIsNot(font1, font2)
+ self.assertEqual(font1, font2)
+ self.assertNotEqual(font1, font1.copy())
+ self.assertNotEqual(font1, 0)
+
+tests_gui = (FontTest, )
+
+if __name__ == "__main__":
+ run_unittest(*tests_gui)
diff --git a/Lib/tkinter/test/test_tkinter/test_loadtk.py b/Lib/tkinter/test/test_tkinter/test_loadtk.py
index 8f1a085b6d..bab7bcd37c 100644
--- a/Lib/tkinter/test/test_tkinter/test_loadtk.py
+++ b/Lib/tkinter/test/test_tkinter/test_loadtk.py
@@ -31,7 +31,8 @@ class TkLoadTest(unittest.TestCase):
# doesn't actually carry through to the process level
# because they don't support unsetenv
# If that's the case, abort.
- display = os.popen('echo $DISPLAY').read().strip()
+ with os.popen('echo $DISPLAY') as pipe:
+ display = pipe.read().strip()
if display:
return
diff --git a/Lib/tkinter/test/test_ttk/test_widgets.py b/Lib/tkinter/test/test_ttk/test_widgets.py
index 35824eae1f..cd00a61f85 100644
--- a/Lib/tkinter/test/test_ttk/test_widgets.py
+++ b/Lib/tkinter/test/test_ttk/test_widgets.py
@@ -1,5 +1,6 @@
import unittest
import tkinter
+import os
from tkinter import ttk
from test.support import requires, run_unittest
@@ -925,7 +926,8 @@ class TreeviewTest(unittest.TestCase):
self.assertRaises(tkinter.TclError, self.tv.heading, '#0',
anchor=1)
-
+ # XXX skipping for now; should be fixed to work with newer ttk
+ @unittest.skip
def test_heading_callback(self):
def simulate_heading_click(x, y):
support.simulate_mouse_click(self.tv, x, y)
diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py
index b105278b97..be44a09e33 100644
--- a/Lib/tkinter/tix.py
+++ b/Lib/tkinter/tix.py
@@ -46,6 +46,21 @@ BALLOON = 'balloon'
AUTO = 'auto'
ACROSSTOP = 'acrosstop'
+# A few useful constants for the Grid widget
+ASCII = 'ascii'
+CELL = 'cell'
+COLUMN = 'column'
+DECREASING = 'decreasing'
+INCREASING = 'increasing'
+INTEGER = 'integer'
+MAIN = 'main'
+MAX = 'max'
+REAL = 'real'
+ROW = 'row'
+S_REGION = 's-region'
+X_REGION = 'x-region'
+Y_REGION = 'y-region'
+
# Some constants used by Tkinter dooneevent()
TCL_DONT_WAIT = 1 << 1
TCL_WINDOW_EVENTS = 1 << 2
@@ -850,7 +865,7 @@ class FileEntry(TixWidget):
# FIXME: return python object
pass
-class HList(TixWidget):
+class HList(TixWidget, XView, YView):
"""HList - Hierarchy display widget can be used to display any data
that have a hierarchical structure, for example, file system directory
trees. The list entries are indented and connected by branch lines
@@ -961,6 +976,10 @@ class HList(TixWidget):
def info_anchor(self):
return self.tk.call(self._w, 'info', 'anchor')
+ def info_bbox(self, entry):
+ return self._getints(
+ self.tk.call(self._w, 'info', 'bbox', entry)) or None
+
def info_children(self, entry=None):
c = self.tk.call(self._w, 'info', 'children', entry)
return self.tk.splitlist(c)
@@ -968,6 +987,12 @@ class HList(TixWidget):
def info_data(self, entry):
return self.tk.call(self._w, 'info', 'data', entry)
+ def info_dragsite(self):
+ return self.tk.call(self._w, 'info', 'dragsite')
+
+ def info_dropsite(self):
+ return self.tk.call(self._w, 'info', 'dropsite')
+
def info_exists(self, entry):
return self.tk.call(self._w, 'info', 'exists', entry)
@@ -1037,12 +1062,6 @@ class HList(TixWidget):
def show_entry(self, entry):
return self.tk.call(self._w, 'show', 'entry', entry)
- def xview(self, *args):
- self.tk.call(self._w, 'xview', *args)
-
- def yview(self, *args):
- self.tk.call(self._w, 'yview', *args)
-
class InputOnly(TixWidget):
"""InputOnly - Invisible widget. Unix only.
@@ -1241,11 +1260,8 @@ class PanedWindow(TixWidget):
self.tk.call(self._w, 'paneconfigure', entry, *self._options(cnf, kw))
def panes(self):
- names = self.tk.call(self._w, 'panes')
- ret = []
- for x in names:
- ret.append(self.subwidget(x))
- return ret
+ names = self.tk.splitlist(self.tk.call(self._w, 'panes'))
+ return [self.subwidget(x) for x in names]
class PopupMenu(TixWidget):
"""PopupMenu widget can be used as a replacement of the tk_popup command.
@@ -1419,7 +1435,7 @@ class StdButtonBox(TixWidget):
if name in self.subwidget_list:
self.tk.call(self._w, 'invoke', name)
-class TList(TixWidget):
+class TList(TixWidget, XView, YView):
"""TList - Hierarchy display widget which can be
used to display data in a tabular format. The list entries of a TList
widget are similar to the entries in the Tk listbox widget. The main
@@ -1502,12 +1518,6 @@ class TList(TixWidget):
def selection_set(self, first, last=None):
self.tk.call(self._w, 'selection', 'set', first, last)
- def xview(self, *args):
- self.tk.call(self._w, 'xview', *args)
-
- def yview(self, *args):
- self.tk.call(self._w, 'yview', *args)
-
class Tree(TixWidget):
"""Tree - The tixTree widget can be used to display hierarchical
data in a tree form. The user can adjust
@@ -1563,7 +1573,7 @@ class CheckList(TixWidget):
# FIXME: It should inherit -superclass tixTree
def __init__(self, master=None, cnf={}, **kw):
TixWidget.__init__(self, master, 'tixCheckList',
- ['options'], cnf, kw)
+ ['options', 'radio'], cnf, kw)
self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
@@ -1777,7 +1787,7 @@ class CObjView(TixWidget):
pass
-class Grid(TixWidget):
+class Grid(TixWidget, XView, YView):
'''The Tix Grid command creates a new window and makes it into a
tixGrid widget. Additional options, may be specified on the command
line or in the option database to configure aspects such as its cursor
@@ -1801,16 +1811,21 @@ class Grid(TixWidget):
TixWidget.__init__(self, master, 'tixGrid', static, cnf, kw)
# valid options as of Tk 8.4
- # anchor, bdtype, cget, configure, delete, dragsite, dropsite, entrycget, edit
- # entryconfigure, format, geometryinfo, info, index, move, nearest, selection
- # set, size, unset, xview, yview
- # def anchor option ?args ...?
+ # anchor, bdtype, cget, configure, delete, dragsite, dropsite, entrycget,
+ # edit, entryconfigure, format, geometryinfo, info, index, move, nearest,
+ # selection, set, size, unset, xview, yview
+ def anchor_clear(self):
+ """Removes the selection anchor."""
+ self.tk.call(self, 'anchor', 'clear')
+
def anchor_get(self):
"Get the (x,y) coordinate of the current anchor cell"
return self._getints(self.tk.call(self, 'anchor', 'get'))
- # def bdtype
- # def delete dim from ?to?
+ def anchor_set(self, x, y):
+ """Set the selection anchor to the cell at (x, y)."""
+ self.tk.call(self, 'anchor', 'set', x, y)
+
def delete_row(self, from_, to=None):
"""Delete rows between from_ and to inclusive.
If to is not provided, delete only row at from_"""
@@ -1818,6 +1833,7 @@ class Grid(TixWidget):
self.tk.call(self, 'delete', 'row', from_)
else:
self.tk.call(self, 'delete', 'row', from_, to)
+
def delete_column(self, from_, to=None):
"""Delete columns between from_ and to inclusive.
If to is not provided, delete only column at from_"""
@@ -1825,26 +1841,49 @@ class Grid(TixWidget):
self.tk.call(self, 'delete', 'column', from_)
else:
self.tk.call(self, 'delete', 'column', from_, to)
- # def edit apply
- # def edit set x y
+
+ def edit_apply(self):
+ """If any cell is being edited, de-highlight the cell and applies
+ the changes."""
+ self.tk.call(self, 'edit', 'apply')
+
+ def edit_set(self, x, y):
+ """Highlights the cell at (x, y) for editing, if the -editnotify
+ command returns True for this cell."""
+ self.tk.call(self, 'edit', 'set', x, y)
def entrycget(self, x, y, option):
"Get the option value for cell at (x,y)"
+ if option and option[0] != '-':
+ option = '-' + option
return self.tk.call(self, 'entrycget', x, y, option)
- def entryconfigure(self, x, y, **kw):
- return self.tk.call(self, 'entryconfigure', x, y, *self._options(None, kw))
+ def entryconfigure(self, x, y, cnf=None, **kw):
+ return self._configure(('entryconfigure', x, y), cnf, kw)
+
# def format
# def index
def info_exists(self, x, y):
"Return True if display item exists at (x,y)"
- return bool(int(self.tk.call(self, 'info', 'exists', x, y)))
+ return self._getboolean(self.tk.call(self, 'info', 'exists', x, y))
def info_bbox(self, x, y):
# This seems to always return '', at least for 'text' displayitems
return self.tk.call(self, 'info', 'bbox', x, y)
+ def move_column(self, from_, to, offset):
+ """Moves the the range of columns from position FROM through TO by
+ the distance indicated by OFFSET. For example, move_column(2, 4, 1)
+ moves the columns 2,3,4 to columns 3,4,5."""
+ self.tk.call(self, 'move', 'column', from_, to, offset)
+
+ def move_row(self, from_, to, offset):
+ """Moves the the range of rows from position FROM through TO by
+ the distance indicated by OFFSET.
+ For example, move_row(2, 4, 1) moves the rows 2,3,4 to rows 3,4,5."""
+ self.tk.call(self, 'move', 'row', from_, to, offset)
+
def nearest(self, x, y):
"Return coordinate of cell nearest pixel coordinate (x,y)"
return self._getints(self.tk.call(self, 'nearest', x, y))
@@ -1854,7 +1893,6 @@ class Grid(TixWidget):
# def selection includes
# def selection set
# def selection toggle
- # def move dim from to offset
def set(self, x, y, itemtype=None, **kw):
args= self._options(self.cnf, kw)
@@ -1862,24 +1900,59 @@ class Grid(TixWidget):
args= ('-itemtype', itemtype) + args
self.tk.call(self, 'set', x, y, *args)
- # def size dim index ?option value ...?
- # def unset x y
-
- def xview(self):
- return self._getdoubles(self.tk.call(self, 'xview'))
- def xview_moveto(self, fraction):
- self.tk.call(self,'xview', 'moveto', fraction)
- def xview_scroll(self, count, what="units"):
- "Scroll right (count>0) or left <count> of units|pages"
- self.tk.call(self, 'xview', 'scroll', count, what)
-
- def yview(self):
- return self._getdoubles(self.tk.call(self, 'yview'))
- def yview_moveto(self, fraction):
- self.tk.call(self,'ysview', 'moveto', fraction)
- def yview_scroll(self, count, what="units"):
- "Scroll down (count>0) or up <count> of units|pages"
- self.tk.call(self, 'yview', 'scroll', count, what)
+ def size_column(self, index, **kw):
+ """Queries or sets the size of the column given by
+ INDEX. INDEX may be any non-negative
+ integer that gives the position of a given column.
+ INDEX can also be the string "default"; in this case, this command
+ queries or sets the default size of all columns.
+ When no option-value pair is given, this command returns a tuple
+ containing the current size setting of the given column. When
+ option-value pairs are given, the corresponding options of the
+ size setting of the given column are changed. Options may be one
+ of the follwing:
+ pad0 pixels
+ Specifies the paddings to the left of a column.
+ pad1 pixels
+ Specifies the paddings to the right of a column.
+ size val
+ Specifies the width of a column .
+ Val may be: "auto" -- the width of the column is set the
+ the widest cell in the column; a valid Tk screen distance
+ unit; or a real number following by the word chars
+ (e.g. 3.4chars) that sets the width of the column to the
+ given number of characters."""
+ return self.tk.split(self.tk.call(self._w, 'size', 'column', index,
+ *self._options({}, kw)))
+
+ def size_row(self, index, **kw):
+ """Queries or sets the size of the row given by
+ INDEX. INDEX may be any non-negative
+ integer that gives the position of a given row .
+ INDEX can also be the string "default"; in this case, this command
+ queries or sets the default size of all rows.
+ When no option-value pair is given, this command returns a list con-
+ taining the current size setting of the given row . When option-value
+ pairs are given, the corresponding options of the size setting of the
+ given row are changed. Options may be one of the follwing:
+ pad0 pixels
+ Specifies the paddings to the top of a row.
+ pad1 pixels
+ Specifies the paddings to the the bottom of a row.
+ size val
+ Specifies the height of a row.
+ Val may be: "auto" -- the height of the row is set the
+ the highest cell in the row; a valid Tk screen distance
+ unit; or a real number following by the word chars
+ (e.g. 3.4chars) that sets the height of the row to the
+ given number of characters."""
+ return self.tk.split(self.tk.call(
+ self, 'size', 'row', index, *self._options({}, kw)))
+
+ def unset(self, x, y):
+ """Clears the cell at (x, y) by removing its display item."""
+ self.tk.call(self._w, 'unset', x, y)
+
class ScrolledGrid(Grid):
'''Scrolled Grid widgets'''
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index 9213b62bc7..1a6a9f46d0 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -1170,7 +1170,7 @@ class Sizegrip(Widget):
Widget.__init__(self, master, "ttk::sizegrip", kw)
-class Treeview(Widget):
+class Treeview(Widget, tkinter.XView, tkinter.YView):
"""Ttk Treeview widget displays a hierarchical collection of items.
Each item has a textual label, an optional image, and an optional list
@@ -1480,16 +1480,6 @@ class Treeview(Widget):
return self.tk.call(self._w, "tag", "has", tagname, item)
- def xview(self, *args):
- """Query or modify horizontal position of the treeview."""
- return self.tk.call(self._w, "xview", *args)
-
-
- def yview(self, *args):
- """Query or modify vertical position of the treeview."""
- return self.tk.call(self._w, "yview", *args)
-
-
# Extensions
class LabeledScale(Frame):
diff --git a/Lib/token.py b/Lib/token.py
index da4d29b326..7e2bfcfaf2 100755
--- a/Lib/token.py
+++ b/Lib/token.py
@@ -1,7 +1,7 @@
-#! /usr/bin/env python
-
"""Token constants (from "token.h")."""
+__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
+
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
@@ -68,12 +68,10 @@ N_TOKENS = 55
NT_OFFSET = 256
#--end constants--
-tok_name = {}
-for _name, _value in list(globals().items()):
- if type(_value) is type(0):
- tok_name[_value] = _name
-del _name, _value
-
+tok_name = {value: name
+ for name, value in globals().items()
+ if isinstance(value, int)}
+__all__.extend(tok_name.values())
def ISTERMINAL(x):
return x < NT_OFFSET
@@ -85,7 +83,7 @@ def ISEOF(x):
return x == ENDMARKER
-def main():
+def _main():
import re
import sys
args = sys.argv[1:]
@@ -139,4 +137,4 @@ def main():
if __name__ == "__main__":
- main()
+ _main()
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index e711a21f35..f575e9bc23 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -1,12 +1,12 @@
"""Tokenization help for Python programs.
-tokenize(readline) is a generator that breaks a stream of
-bytes into Python tokens. It decodes the bytes according to
-PEP-0263 for determining source file encoding.
+tokenize(readline) is a generator that breaks a stream of bytes into
+Python tokens. It decodes the bytes according to PEP-0263 for
+determining source file encoding.
-It accepts a readline-like method which is called
-repeatedly to get the next line of input (or b"" for EOF). It generates
-5-tuples with these members:
+It accepts a readline-like method which is called repeatedly to get the
+next line of input (or b"" for EOF). It generates 5-tuples with these
+members:
the token type (see token.py)
the token (a string)
@@ -16,22 +16,26 @@ repeatedly to get the next line of input (or b"" for EOF). It generates
It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
-operators. Aditionally, all token lists start with an ENCODING token
-which tells you which encoding was used to decode the bytes stream."""
+operators. Additionally, all token lists start with an ENCODING token
+which tells you which encoding was used to decode the bytes stream.
+"""
__author__ = 'Ka-Ping Yee <ping@lfw.org>'
__credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '
'Skip Montanaro, Raymond Hettinger, Trent Nelson, '
'Michael Foord')
-import re, string, sys
+import builtins
+import re
+import sys
from token import *
from codecs import lookup, BOM_UTF8
+import collections
+from io import TextIOWrapper
cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
import token
-__all__ = [x for x in dir(token) if not x.startswith("_")]
-__all__.extend(["COMMENT", "tokenize", "detect_encoding", "NL", "untokenize",
- "ENCODING", "TokenInfo"])
+__all__ = token.__all__ + ["COMMENT", "tokenize", "detect_encoding",
+ "NL", "untokenize", "ENCODING", "TokenInfo"]
del token
COMMENT = N_TOKENS
@@ -42,46 +46,11 @@ ENCODING = N_TOKENS + 2
tok_name[ENCODING] = 'ENCODING'
N_TOKENS += 3
-class TokenInfo(tuple):
- 'TokenInfo(type, string, start, end, line)'
-
- __slots__ = ()
-
- _fields = ('type', 'string', 'start', 'end', 'line')
-
- def __new__(cls, type, string, start, end, line):
- return tuple.__new__(cls, (type, string, start, end, line))
-
- @classmethod
- def _make(cls, iterable, new=tuple.__new__, len=len):
- 'Make a new TokenInfo object from a sequence or iterable'
- result = new(cls, iterable)
- if len(result) != 5:
- raise TypeError('Expected 5 arguments, got %d' % len(result))
- return result
-
+class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):
def __repr__(self):
- return 'TokenInfo(type=%r, string=%r, start=%r, end=%r, line=%r)' % self
-
- def _asdict(self):
- 'Return a new dict which maps field names to their values'
- return dict(zip(self._fields, self))
-
- def _replace(self, **kwds):
- 'Return a new TokenInfo object replacing specified fields with new values'
- result = self._make(map(kwds.pop, ('type', 'string', 'start', 'end', 'line'), self))
- if kwds:
- raise ValueError('Got unexpected field names: %r' % kwds.keys())
- return result
-
- def __getnewargs__(self):
- return tuple(self)
-
- type = property(lambda t: t[0])
- string = property(lambda t: t[1])
- start = property(lambda t: t[2])
- end = property(lambda t: t[3])
- line = property(lambda t: t[4])
+ annotated_type = '%d (%s)' % (self.type, tok_name[self.type])
+ return ('TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)' %
+ self._replace(type=annotated_type))
def group(*choices): return '(' + '|'.join(choices) + ')'
def any(*choices): return group(*choices) + '*'
@@ -298,22 +267,23 @@ def _get_normal_name(orig_enc):
def detect_encoding(readline):
"""
The detect_encoding() function is used to detect the encoding that should
- be used to decode a Python source file. It requires one argment, readline,
+ be used to decode a Python source file. It requires one argment, readline,
in the same way as the tokenize() generator.
It will call readline a maximum of twice, and return the encoding used
- (as a string) and a list of any lines (left as bytes) it has read
- in.
+ (as a string) and a list of any lines (left as bytes) it has read in.
It detects the encoding from the presence of a utf-8 bom or an encoding
- cookie as specified in pep-0263. If both a bom and a cookie are present,
- but disagree, a SyntaxError will be raised. If the encoding cookie is an
- invalid charset, raise a SyntaxError.
+ cookie as specified in pep-0263. If both a bom and a cookie are present,
+ but disagree, a SyntaxError will be raised. If the encoding cookie is an
+ invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found,
+ 'utf-8-sig' is returned.
If no encoding is specified, then the default of 'utf-8' will be returned.
"""
bom_found = False
encoding = None
+ default = 'utf-8'
def read_or_stop():
try:
return readline()
@@ -336,17 +306,20 @@ def detect_encoding(readline):
# This behaviour mimics the Python interpreter
raise SyntaxError("unknown encoding: " + encoding)
- if bom_found and codec.name != 'utf-8':
- # This behaviour mimics the Python interpreter
- raise SyntaxError('encoding problem: utf-8')
+ if bom_found:
+ if codec.name != 'utf-8':
+ # This behaviour mimics the Python interpreter
+ raise SyntaxError('encoding problem: utf-8')
+ encoding += '-sig'
return encoding
first = read_or_stop()
if first.startswith(BOM_UTF8):
bom_found = True
first = first[3:]
+ default = 'utf-8-sig'
if not first:
- return 'utf-8', []
+ return default, []
encoding = find_cookie(first)
if encoding:
@@ -354,20 +327,32 @@ def detect_encoding(readline):
second = read_or_stop()
if not second:
- return 'utf-8', [first]
+ return default, [first]
encoding = find_cookie(second)
if encoding:
return encoding, [first, second]
- return 'utf-8', [first, second]
+ return default, [first, second]
+
+
+def open(filename):
+ """Open a file in read only mode using the encoding detected by
+ detect_encoding().
+ """
+ buffer = builtins.open(filename, 'rb')
+ encoding, lines = detect_encoding(buffer.readline)
+ buffer.seek(0)
+ text = TextIOWrapper(buffer, encoding, line_buffering=True)
+ text.mode = 'r'
+ return text
def tokenize(readline):
"""
The tokenize() generator requires one argment, readline, which
must be a callable object which provides the same interface as the
- readline() method of built-in file objects. Each call to the function
+ readline() method of built-in file objects. Each call to the function
should return one line of input as bytes. Alternately, readline
can be a callable function terminating with StopIteration:
readline = open(myfile, 'rb').__next__ # Example of alternate readline
@@ -376,23 +361,19 @@ def tokenize(readline):
token string; a 2-tuple (srow, scol) of ints specifying the row and
column where the token begins in the source; a 2-tuple (erow, ecol) of
ints specifying the row and column where the token ends in the source;
- and the line on which the token was found. The line passed is the
+ and the line on which the token was found. The line passed is the
logical line; continuation lines are included.
The first token sequence will always be an ENCODING token
which tells you which encoding was used to decode the bytes stream.
"""
+ # This import is here to avoid problems when the itertools module is not
+ # built yet and tokenize is imported.
+ from itertools import chain, repeat
encoding, consumed = detect_encoding(readline)
- def readline_generator(consumed):
- for line in consumed:
- yield line
- while True:
- try:
- yield readline()
- except StopIteration:
- return
- chained = readline_generator(consumed)
- return _tokenize(chained.__next__, encoding)
+ rl_gen = iter(readline, b"")
+ empty = repeat(b"")
+ return _tokenize(chain(consumed, rl_gen, empty).__next__, encoding)
def _tokenize(readline, encoding):
@@ -403,6 +384,9 @@ def _tokenize(readline, encoding):
indents = [0]
if encoding is not None:
+ if encoding == "utf-8-sig":
+ # BOM will already have been stripped.
+ encoding = "utf-8"
yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')
while True: # loop over lines in stream
try:
@@ -545,3 +529,28 @@ def _tokenize(readline, encoding):
# library that expect to be able to use tokenize with strings
def generate_tokens(readline):
return _tokenize(readline, None)
+
+if __name__ == "__main__":
+ # Quick sanity check
+ s = b'''def parseline(self, line):
+ """Parse the line into a command name and a string containing
+ the arguments. Returns a tuple containing (command, args, line).
+ 'command' and 'args' may be None if the line couldn't be parsed.
+ """
+ line = line.strip()
+ if not line:
+ return None, None, line
+ elif line[0] == '?':
+ line = 'help ' + line[1:]
+ elif line[0] == '!':
+ if hasattr(self, 'do_shell'):
+ line = 'shell ' + line[1:]
+ else:
+ return None, None, line
+ i, n = 0, len(line)
+ while i < n and line[i] in self.identchars: i = i+1
+ cmd, arg = line[:i], line[i:].strip()
+ return cmd, arg, line
+ '''
+ for tok in tokenize(iter(s.splitlines()).__next__):
+ print(tok)
diff --git a/Lib/trace.py b/Lib/trace.py
index c01935f246..850369b9ff 100644
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
# err... reserved and offered to the public under the terms of the
@@ -47,7 +47,7 @@ Sample use, programmatically
r = tracer.results()
r.write_results(show_missing=True, coverdir="/tmp")
"""
-
+__all__ = ['Trace', 'CoverageResults']
import io
import linecache
import os
@@ -60,6 +60,7 @@ import inspect
import gc
import dis
import pickle
+from warnings import warn as _warn
try:
import threading
@@ -77,7 +78,7 @@ else:
sys.settrace(None)
threading.settrace(None)
-def usage(outfile):
+def _usage(outfile):
outfile.write("""Usage: %s [OPTIONS] <file> [ARGS]
Meta-options:
@@ -127,12 +128,11 @@ PRAGMA_NOCOVER = "#pragma NO COVER"
# Simple rx to find lines with no code.
rx_blank = re.compile(r'^\s*(#.*)?$')
-class Ignore:
- def __init__(self, modules = None, dirs = None):
- self._mods = modules or []
- self._dirs = dirs or []
-
- self._dirs = list(map(os.path.normpath, self._dirs))
+class _Ignore:
+ def __init__(self, modules=None, dirs=None):
+ self._mods = set() if not modules else set(modules)
+ self._dirs = [] if not dirs else [os.path.normpath(d)
+ for d in dirs]
self._ignore = { '<string>': 1 }
def names(self, filename, modulename):
@@ -140,24 +140,22 @@ class Ignore:
return self._ignore[modulename]
# haven't seen this one before, so see if the module name is
- # on the ignore list. Need to take some care since ignoring
- # "cmp" musn't mean ignoring "cmpcache" but ignoring
- # "Spam" must also mean ignoring "Spam.Eggs".
+ # on the ignore list.
+ if modulename in self._mods: # Identical names, so ignore
+ self._ignore[modulename] = 1
+ return 1
+
+ # check if the module is a proper submodule of something on
+ # the ignore list
for mod in self._mods:
- if mod == modulename: # Identical names, so ignore
- self._ignore[modulename] = 1
- return 1
- # check if the module is a proper submodule of something on
- # the ignore list
- n = len(mod)
- # (will not overflow since if the first n characters are the
- # same and the name has not already occurred, then the size
- # of "name" is greater than that of "mod")
- if mod == modulename[:n] and modulename[n] == '.':
+ # Need to take some care since ignoring
+ # "cmp" mustn't mean ignoring "cmpcache" but ignoring
+ # "Spam" must also mean ignoring "Spam.Eggs".
+ if modulename.startswith(mod + '.'):
self._ignore[modulename] = 1
return 1
- # Now check that __file__ isn't in one of the directories
+ # Now check that filename isn't in one of the directories
if filename is None:
# must be a built-in, so we must ignore
self._ignore[modulename] = 1
@@ -180,14 +178,14 @@ class Ignore:
self._ignore[modulename] = 0
return 0
-def modname(path):
+def _modname(path):
"""Return a plausible module name for the patch."""
base = os.path.basename(path)
filename, ext = os.path.splitext(base)
return filename
-def fullmodname(path):
+def _fullmodname(path):
"""Return a plausible module name for the path."""
# If the file 'path' is part of a package, then the filename isn't
@@ -258,13 +256,13 @@ class CoverageResults:
other_calledfuncs = other.calledfuncs
other_callers = other.callers
- for key in other_counts.keys():
+ for key in other_counts:
counts[key] = counts.get(key, 0) + other_counts[key]
- for key in other_calledfuncs.keys():
+ for key in other_calledfuncs:
calledfuncs[key] = 1
- for key in other_callers.keys():
+ for key in other_callers:
callers[key] = 1
def write_results(self, show_missing=True, summary=False, coverdir=None):
@@ -274,7 +272,7 @@ class CoverageResults:
if self.calledfuncs:
print()
print("functions called:")
- calls = self.calledfuncs.keys()
+ calls = self.calledfuncs
for filename, modulename, funcname in sorted(calls):
print(("filename: %s, modulename: %s, funcname: %s"
% (filename, modulename, funcname)))
@@ -284,7 +282,7 @@ class CoverageResults:
print("calling relationships:")
lastfile = lastcfile = ""
for ((pfile, pmod, pfunc), (cfile, cmod, cfunc)) \
- in sorted(self.callers.keys()):
+ in sorted(self.callers):
if pfile != lastfile:
print()
print("***", pfile, "***")
@@ -298,7 +296,7 @@ class CoverageResults:
# turn the counts data ("(filename, lineno) = count") into something
# accessible on a per-file basis
per_file = {}
- for filename, lineno in self.counts.keys():
+ for filename, lineno in self.counts:
lines_hit = per_file[filename] = per_file.get(filename, {})
lines_hit[lineno] = self.counts[(filename, lineno)]
@@ -314,32 +312,33 @@ class CoverageResults:
if coverdir is None:
dir = os.path.dirname(os.path.abspath(filename))
- modulename = modname(filename)
+ modulename = _modname(filename)
else:
dir = coverdir
if not os.path.exists(dir):
os.makedirs(dir)
- modulename = fullmodname(filename)
+ modulename = _fullmodname(filename)
# If desired, get a list of the line numbers which represent
# executable content (returned as a dict for better lookup speed)
if show_missing:
- lnotab = find_executable_linenos(filename)
+ lnotab = _find_executable_linenos(filename)
else:
lnotab = {}
source = linecache.getlines(filename)
coverpath = os.path.join(dir, modulename + ".cover")
+ with open(filename, 'rb') as fp:
+ encoding, _ = tokenize.detect_encoding(fp.readline)
n_hits, n_lines = self.write_results_file(coverpath, source,
- lnotab, count)
-
+ lnotab, count, encoding)
if summary and n_lines:
percent = int(100 * n_hits / n_lines)
sums[modulename] = n_lines, percent, modulename, filename
if summary and sums:
print("lines cov% module (path)")
- for m in sorted(sums.keys()):
+ for m in sorted(sums):
n_lines, percent, modulename, filename = sums[m]
print("%5d %3d%% %s (%s)" % sums[m])
@@ -351,11 +350,11 @@ class CoverageResults:
except IOError as err:
print("Can't save counts files because %s" % err, file=sys.stderr)
- def write_results_file(self, path, lines, lnotab, lines_hit):
+ def write_results_file(self, path, lines, lnotab, lines_hit, encoding=None):
"""Return a coverage results file in path."""
try:
- outfile = open(path, "w")
+ outfile = open(path, "w", encoding=encoding)
except IOError as err:
print(("trace: Could not open %r for writing: %s"
"- skipping" % (path, err)), file=sys.stderr)
@@ -363,8 +362,7 @@ class CoverageResults:
n_lines = 0
n_hits = 0
- for i, line in enumerate(lines):
- lineno = i + 1
+ for lineno, line in enumerate(lines, 1):
# do the blank/comment match to try to mark more lines
# (help the reader find stuff that hasn't been covered)
if lineno in lines_hit:
@@ -377,17 +375,17 @@ class CoverageResults:
# lines preceded by no marks weren't hit
# Highlight them if so indicated, unless the line contains
# #pragma: NO COVER
- if lineno in lnotab and not PRAGMA_NOCOVER in lines[i]:
+ if lineno in lnotab and not PRAGMA_NOCOVER in line:
outfile.write(">>>>>> ")
n_lines += 1
else:
outfile.write(" ")
- outfile.write(lines[i].expandtabs(8))
+ outfile.write(line.expandtabs(8))
outfile.close()
return n_hits, n_lines
-def find_lines_from_code(code, strs):
+def _find_lines_from_code(code, strs):
"""Return dict where keys are lines in the line number table."""
linenos = {}
@@ -397,19 +395,19 @@ def find_lines_from_code(code, strs):
return linenos
-def find_lines(code, strs):
+def _find_lines(code, strs):
"""Return lineno dict for all code objects reachable from code."""
# get all of the lineno information from the code of this scope level
- linenos = find_lines_from_code(code, strs)
+ linenos = _find_lines_from_code(code, strs)
# and check the constants for references to other code objects
for c in code.co_consts:
if inspect.iscode(c):
# find another code object, so recurse into it
- linenos.update(find_lines(c, strs))
+ linenos.update(_find_lines(c, strs))
return linenos
-def find_strings(filename, encoding=None):
+def _find_strings(filename, encoding=None):
"""Return a dict of possible docstring positions.
The dict maps line numbers to strings. There is an entry for
@@ -420,31 +418,31 @@ def find_strings(filename, encoding=None):
# If the first token is a string, then it's the module docstring.
# Add this special case so that the test in the loop passes.
prev_ttype = token.INDENT
- f = open(filename, encoding=encoding)
- for ttype, tstr, start, end, line in tokenize.generate_tokens(f.readline):
- if ttype == token.STRING:
- if prev_ttype == token.INDENT:
- sline, scol = start
- eline, ecol = end
- for i in range(sline, eline + 1):
- d[i] = 1
- prev_ttype = ttype
- f.close()
+ with open(filename, encoding=encoding) as f:
+ tok = tokenize.generate_tokens(f.readline)
+ for ttype, tstr, start, end, line in tok:
+ if ttype == token.STRING:
+ if prev_ttype == token.INDENT:
+ sline, scol = start
+ eline, ecol = end
+ for i in range(sline, eline + 1):
+ d[i] = 1
+ prev_ttype = ttype
return d
-def find_executable_linenos(filename):
+def _find_executable_linenos(filename):
"""Return dict where keys are line numbers in the line number table."""
try:
- with io.FileIO(filename, 'r') as file:
- encoding, lines = tokenize.detect_encoding(file.readline)
- prog = open(filename, "r", encoding=encoding).read()
+ with tokenize.open(filename) as f:
+ prog = f.read()
+ encoding = f.encoding
except IOError as err:
print(("Not printing coverage data for %r: %s"
% (filename, err)), file=sys.stderr)
return {}
code = compile(prog, filename, "exec")
- strs = find_strings(filename, encoding)
- return find_lines(code, strs)
+ strs = _find_strings(filename, encoding)
+ return _find_lines(code, strs)
class Trace:
def __init__(self, count=1, trace=1, countfuncs=0, countcallers=0,
@@ -469,9 +467,8 @@ class Trace:
"""
self.infile = infile
self.outfile = outfile
- self.ignore = Ignore(ignoremods, ignoredirs)
+ self.ignore = _Ignore(ignoremods, ignoredirs)
self.counts = {} # keys are (filename, linenumber)
- self.blabbed = {} # for debugging
self.pathtobasename = {} # for memoizing os.path.basename
self.donothing = 0
self.trace = trace
@@ -501,15 +498,7 @@ class Trace:
def run(self, cmd):
import __main__
dict = __main__.__dict__
- if not self.donothing:
- threading.settrace(self.globaltrace)
- sys.settrace(self.globaltrace)
- try:
- exec(cmd, dict, dict)
- finally:
- if not self.donothing:
- sys.settrace(None)
- threading.settrace(None)
+ self.runctx(cmd, dict, dict)
def runctx(self, cmd, globals=None, locals=None):
if globals is None: globals = {}
@@ -537,7 +526,7 @@ class Trace:
code = frame.f_code
filename = code.co_filename
if filename:
- modulename = modname(filename)
+ modulename = _modname(filename)
else:
modulename = None
@@ -604,9 +593,9 @@ class Trace:
code = frame.f_code
filename = frame.f_globals.get('__file__', None)
if filename:
- # XXX modname() doesn't work right for packages, so
+ # XXX _modname() doesn't work right for packages, so
# the ignore support won't work right for packages
- modulename = modname(filename)
+ modulename = _modname(filename)
if modulename is not None:
ignore_it = self.ignore.names(filename, modulename)
if not ignore_it:
@@ -699,7 +688,7 @@ def main(argv=None):
for opt, val in opts:
if opt == "--help":
- usage(sys.stdout)
+ _usage(sys.stdout)
sys.exit(0)
if opt == "--version":
@@ -822,5 +811,47 @@ def main(argv=None):
if not no_report:
results.write_results(missing, summary=summary, coverdir=coverdir)
+# Deprecated API
+def usage(outfile):
+ _warn("The trace.usage() function is deprecated",
+ DeprecationWarning, 2)
+ _usage(outfile)
+
+class Ignore(_Ignore):
+ def __init__(self, modules=None, dirs=None):
+ _warn("The class trace.Ignore is deprecated",
+ DeprecationWarning, 2)
+ _Ignore.__init__(self, modules, dirs)
+
+def modname(path):
+ _warn("The trace.modname() function is deprecated",
+ DeprecationWarning, 2)
+ return _modname(path)
+
+def fullmodname(path):
+ _warn("The trace.fullmodname() function is deprecated",
+ DeprecationWarning, 2)
+ return _fullmodname(path)
+
+def find_lines_from_code(code, strs):
+ _warn("The trace.find_lines_from_code() function is deprecated",
+ DeprecationWarning, 2)
+ return _find_lines_from_code(code, strs)
+
+def find_lines(code, strs):
+ _warn("The trace.find_lines() function is deprecated",
+ DeprecationWarning, 2)
+ return _find_lines(code, strs)
+
+def find_strings(filename, encoding=None):
+ _warn("The trace.find_strings() function is deprecated",
+ DeprecationWarning, 2)
+ return _find_strings(filename, encoding=None)
+
+def find_executable_linenos(filename):
+ _warn("The trace.find_executable_linenos() function is deprecated",
+ DeprecationWarning, 2)
+ return _find_executable_linenos(filename)
+
if __name__=='__main__':
main()
diff --git a/Lib/turtle.py b/Lib/turtle.py
index 0c439f1e3b..2ff54278e2 100644
--- a/Lib/turtle.py
+++ b/Lib/turtle.py
@@ -109,6 +109,7 @@ import types
import math
import time
import os
+import inspect
from os.path import isfile, split, join
from copy import deepcopy
@@ -169,9 +170,8 @@ _CFG = {"width" : 0.5, # Screen
def config_dict(filename):
"""Convert content of config-file into dictionary."""
- f = open(filename, "r")
- cfglines = f.readlines()
- f.close()
+ with open(filename, "r") as f:
+ cfglines = f.readlines()
cfgdict = {}
for line in cfglines:
line = line.strip()
@@ -3147,7 +3147,7 @@ class RawTurtle(TPen, TNavigator):
if pen is down. All other methodes for turtle movement depend
on this one.
"""
- ## Version mit undo-stuff
+ ## Version with undo-stuff
go_modes = ( self._drawing,
self._pencolor,
self._pensize,
@@ -3893,31 +3893,35 @@ except:
def getmethparlist(ob):
- "Get strings describing the arguments for the given object"
- argText1 = argText2 = ""
+ """Get strings describing the arguments for the given object
+
+ Returns a pair of strings representing function parameter lists
+ including parenthesis. The first string is suitable for use in
+ function definition and the second is suitable for use in function
+ call. The "self" parameter is not included.
+ """
+ defText = callText = ""
# bit of a hack for methods - turn it into a function
# but we drop the "self" param.
# Try and build one for Python defined functions
- argOffset = 1
- counter = ob.__code__.co_argcount
- items2 = list(ob.__code__.co_varnames[argOffset:counter])
- realArgs = ob.__code__.co_varnames[argOffset:counter]
+ args, varargs, varkw = inspect.getargs(ob.__code__)
+ items2 = args[1:]
+ realArgs = args[1:]
defaults = ob.__defaults__ or []
- defaults = list(map(lambda name: "=%s" % repr(name), defaults))
+ defaults = ["=%r" % (value,) for value in defaults]
defaults = [""] * (len(realArgs)-len(defaults)) + defaults
- items1 = list(map(lambda arg, dflt: arg+dflt, realArgs, defaults))
- if ob.__code__.co_flags & 0x4:
- items1.append("*"+ob.__code__.co_varnames[counter])
- items2.append("*"+ob.__code__.co_varnames[counter])
- counter += 1
- if ob.__code__.co_flags & 0x8:
- items1.append("**"+ob.__code__.co_varnames[counter])
- items2.append("**"+ob.__code__.co_varnames[counter])
- argText1 = ", ".join(items1)
- argText1 = "(%s)" % argText1
- argText2 = ", ".join(items2)
- argText2 = "(%s)" % argText2
- return argText1, argText2
+ items1 = [arg + dflt for arg, dflt in zip(realArgs, defaults)]
+ if varargs is not None:
+ items1.append("*" + varargs)
+ items2.append("*" + varargs)
+ if varkw is not None:
+ items1.append("**" + varkw)
+ items2.append("**" + varkw)
+ defText = ", ".join(items1)
+ defText = "(%s)" % defText
+ callText = ", ".join(items2)
+ callText = "(%s)" % callText
+ return defText, callText
def _turtle_docrevise(docstr):
"""To reduce docstrings from RawTurtle class for functions
diff --git a/Tools/modulator/Templates/copyright b/Lib/turtledemo/__init__.py
index e69de29bb2..e69de29bb2 100644
--- a/Tools/modulator/Templates/copyright
+++ b/Lib/turtledemo/__init__.py
diff --git a/Demo/turtle/turtleDemo.py b/Lib/turtledemo/__main__.py
index 36bf15c7e5..cbf3aeb692 100644..100755
--- a/Demo/turtle/turtleDemo.py
+++ b/Lib/turtledemo/__main__.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
import sys
import os
@@ -11,6 +11,8 @@ from imp import reload
import turtle
import time
+demo_dir = os.path.dirname(os.path.abspath(__file__))
+
STARTUP = 1
READY = 2
RUNNING = 3
@@ -22,37 +24,20 @@ btnfont = ("Arial", 12, 'bold')
txtfont = ('Lucida Console', 8, 'normal')
def getExampleEntries():
- cwd = os.getcwd()
- #print(cwd, os.listdir(cwd))
- if "turtleDemo.py" not in os.listdir(cwd):
- print("Directory of turtleDemo must be current working directory!")
- print("But in your case this is", cwd)
- sys.exit()
- entries1 = [entry for entry in os.listdir(cwd) if
- entry.startswith("tdemo_") and
- not entry.endswith(".pyc")]
- entries2 = []
- for entry in entries1:
- if entry.endswith(".py"):
- entries2.append(entry)
- else:
- path = os.path.join(cwd,entry)
- sys.path.append(path)
- subdir = [entry]
- scripts = [script for script in os.listdir(path) if
- script.startswith("tdemo_") and
- script.endswith(".py")]
- entries2.append(subdir+scripts)
- return entries2
+ return [entry[:-3] for entry in os.listdir(demo_dir) if
+ entry.endswith(".py") and entry[0] != '_']
def showDemoHelp():
- view_file(demo.root, "Help on turtleDemo", "demohelp.txt")
+ view_file(demo.root, "Help on turtleDemo",
+ os.path.join(demo_dir, "demohelp.txt"))
def showAboutDemo():
- view_file(demo.root, "About turtleDemo", "about_turtledemo.txt")
+ view_file(demo.root, "About turtleDemo",
+ os.path.join(demo_dir, "about_turtledemo.txt"))
def showAboutTurtle():
- view_file(demo.root, "About the new turtle module.", "about_turtle.txt")
+ view_file(demo.root, "About the new turtle module.",
+ os.path.join(demo_dir, "about_turtle.txt"))
class DemoWindow(object):
@@ -140,20 +125,20 @@ class DemoWindow(object):
self.ExamplesBtn.config(state=menu)
self.start_btn.config(state=start)
- if start==NORMAL:
+ if start == NORMAL:
self.start_btn.config(bg="#d00")
else:
self.start_btn.config(bg="#fca")
self.stop_btn.config(state=stop)
- if stop==NORMAL:
+ if stop == NORMAL:
self.stop_btn.config(bg="#d00")
else:
self.stop_btn.config(bg="#fca")
self.clear_btn.config(state=clear)
self.clear_btn.config(state=clear)
- if clear==NORMAL:
+ if clear == NORMAL:
self.clear_btn.config(bg="#d00")
else:
self.clear_btn.config(bg="#fca")
@@ -171,31 +156,23 @@ class DemoWindow(object):
def emit():
self.loadfile(x)
return emit
- if isinstance(entry,str):
- CmdBtn.menu.add_command(label=entry[6:-3], underline=0, font=menufont,
- command=loadexample(entry))
- else:
- _dir, entries = entry[0], entry[1:]
- CmdBtn.menu.choices = Menu(CmdBtn.menu)
- for e in entries:
- CmdBtn.menu.choices.add_command(label=e[6:-3], underline=0, font=menufont,
- command = loadexample(os.path.join(_dir,e)))
-
- CmdBtn.menu.add_cascade(label=_dir[6:],
- menu = CmdBtn.menu.choices, font=menufont )
+ CmdBtn.menu.add_command(label=entry, underline=0,
+ font=menufont, command=loadexample(entry))
CmdBtn['menu'] = CmdBtn.menu
return CmdBtn
-
def makeHelpMenu(self):
- CmdBtn = Menubutton(self.mBar, text='Help', underline=0, font = menufont)
+ CmdBtn = Menubutton(self.mBar, text='Help', underline=0, font=menufont)
CmdBtn.pack(side=LEFT, padx='2m')
CmdBtn.menu = Menu(CmdBtn)
- CmdBtn.menu.add_command(label='About turtle.py', font=menufont, command=showAboutTurtle)
- CmdBtn.menu.add_command(label='turtleDemo - Help', font=menufont, command=showDemoHelp)
- CmdBtn.menu.add_command(label='About turtleDemo', font=menufont, command=showAboutDemo)
+ CmdBtn.menu.add_command(label='About turtle.py', font=menufont,
+ command=showAboutTurtle)
+ CmdBtn.menu.add_command(label='turtleDemo - Help', font=menufont,
+ command=showDemoHelp)
+ CmdBtn.menu.add_command(label='About turtleDemo', font=menufont,
+ command=showAboutDemo)
CmdBtn['menu'] = CmdBtn.menu
return CmdBtn
@@ -206,22 +183,20 @@ class DemoWindow(object):
#self.screen.mode("standard")
self.dirty=False
- def loadfile(self,filename):
+ def loadfile(self, filename):
self.refreshCanvas()
- if os.path.exists(filename) and not os.path.isdir(filename):
- # load and display file text
- f = open(filename,'r')
+ modname = 'turtledemo.' + filename
+ __import__(modname)
+ self.module = sys.modules[modname]
+ with open(self.module.__file__, 'r') as f:
chars = f.read()
- f.close()
- self.text.delete("1.0", "end")
- self.text.insert("1.0",chars)
- direc, fname = os.path.split(filename)
- self.root.title(fname[6:-3]+" - a Python turtle graphics example")
- self.module = __import__(fname[:-3])
- reload(self.module)
- self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED,
- "Press start button", "red")
- self.state = READY
+ self.text.delete("1.0", "end")
+ self.text.insert("1.0", chars)
+ self.root.title(filename + " - a Python turtle graphics example")
+ reload(self.module)
+ self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED,
+ "Press start button", "red")
+ self.state = READY
def startDemo(self):
self.refreshCanvas()
diff --git a/Demo/turtle/about_turtle.txt b/Lib/turtledemo/about_turtle.txt
index e4ba217c96..e4ba217c96 100644
--- a/Demo/turtle/about_turtle.txt
+++ b/Lib/turtledemo/about_turtle.txt
diff --git a/Demo/turtle/about_turtledemo.txt b/Lib/turtledemo/about_turtledemo.txt
index 54c25a55b8..a9009bd5fb 100644
--- a/Demo/turtle/about_turtledemo.txt
+++ b/Lib/turtledemo/about_turtledemo.txt
@@ -1,9 +1,9 @@
--------------------------------------
- About turtleDemo.py
+ About this viewer
--------------------------------------
- Tiny demo Viewer to view turtle graphics example scripts.
+ Tiny demo viewer to view turtle graphics example scripts.
Quickly and dirtyly assembled by Gregor Lingl.
June, 2006
diff --git a/Demo/turtle/tdemo_bytedesign.py b/Lib/turtledemo/bytedesign.py
index 85f288742b..64b1d7d5b0 100644
--- a/Demo/turtle/tdemo_bytedesign.py
+++ b/Lib/turtledemo/bytedesign.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtle-example-suite:
tdemo_bytedesign.py
diff --git a/Demo/turtle/tdemo_chaos.py b/Lib/turtledemo/chaos.py
index d4656f8914..d4656f8914 100644
--- a/Demo/turtle/tdemo_chaos.py
+++ b/Lib/turtledemo/chaos.py
diff --git a/Demo/turtle/tdemo_clock.py b/Lib/turtledemo/clock.py
index e186c38497..a0d157ba49 100644
--- a/Demo/turtle/tdemo_clock.py
+++ b/Lib/turtledemo/clock.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
# -*- coding: cp1252 -*-
""" turtle-example-suite:
diff --git a/Demo/turtle/tdemo_colormixer.py b/Lib/turtledemo/colormixer.py
index f5d308d443..f5d308d443 100644
--- a/Demo/turtle/tdemo_colormixer.py
+++ b/Lib/turtledemo/colormixer.py
diff --git a/Demo/turtle/demohelp.txt b/Lib/turtledemo/demohelp.txt
index 568387570e..fe83bc7601 100644
--- a/Demo/turtle/demohelp.txt
+++ b/Lib/turtledemo/demohelp.txt
@@ -53,12 +53,7 @@
(2) How to add your own demos to the demo repository
- - scriptname: must begin with tdemo_ ,
- so it must have the form tdemo_<your-script-name>.py
-
- - place: same directory as turtleDemo.py or some
- subdirectory, the name of which must also begin with
- tdemo_.....
+ - place: same directory as turtledemo/__main__.py
- requirements on source code:
code must contain a main() function which will
diff --git a/Demo/turtle/tdemo_forest.py b/Lib/turtledemo/forest.py
index 01fa1863dc..a837d844c9 100644
--- a/Demo/turtle/tdemo_forest.py
+++ b/Lib/turtledemo/forest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtlegraphics-example-suite:
tdemo_forest.py
diff --git a/Demo/turtle/tdemo_fractalcurves.py b/Lib/turtledemo/fractalcurves.py
index 247f16cae2..c49f8b88ea 100644
--- a/Demo/turtle/tdemo_fractalcurves.py
+++ b/Lib/turtledemo/fractalcurves.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtle-example-suite:
tdemo_fractalCurves.py
diff --git a/Demo/turtle/tdemo_lindenmayer_indian.py b/Lib/turtledemo/lindenmayer.py
index bda5067a43..3925f25da6 100644
--- a/Demo/turtle/tdemo_lindenmayer_indian.py
+++ b/Lib/turtledemo/lindenmayer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtle-example-suite:
xtx_lindenmayer_indian.py
diff --git a/Demo/turtle/tdemo_minimal_hanoi.py b/Lib/turtledemo/minimal_hanoi.py
index a8bdca74fa..cfb78dcac1 100644
--- a/Demo/turtle/tdemo_minimal_hanoi.py
+++ b/Lib/turtledemo/minimal_hanoi.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtle-example-suite:
tdemo_minimal_hanoi.py
diff --git a/Demo/turtle/tdemo_nim.py b/Lib/turtledemo/nim.py
index 8e66d7e831..792ba51534 100644
--- a/Demo/turtle/tdemo_nim.py
+++ b/Lib/turtledemo/nim.py
@@ -1,7 +1,7 @@
""" turtle-example-suite:
tdemo_nim.py
-
+
Play nim against the computer. The player
who takes the last stick is the winner.
@@ -41,7 +41,7 @@ def computerzug(state):
return move
def randommove(state):
- m = max(state)
+ m = max(state)
while True:
z = random.randint(0,2)
if state[z] > (m > 1):
@@ -62,7 +62,7 @@ class NimModel(object):
self.winner = None
self.game.view.setup()
self.game.state = Nim.RUNNING
-
+
def move(self, row, col):
maxspalte = self.sticks[row]
self.sticks[row] = col
@@ -76,7 +76,7 @@ class NimModel(object):
row, col = computerzug(self.sticks)
self.move(row, col)
self.player = 0
-
+
def game_over(self):
return self.sticks == [0, 0, 0]
@@ -100,13 +100,13 @@ class Stick(turtle.Turtle):
self.goto(x,y)
self.color("white")
self.showturtle()
-
+
def coords(self, row, col):
packet, remainder = divmod(col, 5)
x = (3 + 11 * packet + 2 * remainder) * WUNIT
y = (2 + 3 * row) * HUNIT
return x - SCREENWIDTH // 2 + WUNIT // 2, SCREENHEIGHT // 2 - y - HUNIT // 2
-
+
def makemove(self, x, y):
if self.game.state != Nim.RUNNING:
return
@@ -142,7 +142,7 @@ class NimView(object):
self.writer.pencolor("black")
self.writer.write(msg1, align="center", font=("Courier",14,"bold"))
self.screen.tracer(True)
-
+
def setup(self):
self.screen.tracer(False)
@@ -200,18 +200,18 @@ class NimController(object):
self.BUSY = True
self.game.model.notify_move(row, col)
self.BUSY = False
-
+
class Nim(object):
CREATED = 0
RUNNING = 1
OVER = 2
def __init__(self, screen):
- self.state = Nim.CREATED
+ self.state = Nim.CREATED
self.screen = screen
self.model = NimModel(self)
self.view = NimView(self)
self.controller = NimController(self)
-
+
mainscreen = turtle.Screen()
mainscreen.mode("standard")
@@ -224,4 +224,3 @@ def main():
if __name__ == "__main__":
main()
turtle.mainloop()
-
diff --git a/Demo/turtle/tdemo_paint.py b/Lib/turtledemo/paint.py
index 337a57c59d..68058ab6ac 100644
--- a/Demo/turtle/tdemo_paint.py
+++ b/Lib/turtledemo/paint.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtle-example-suite:
tdemo_paint.py
diff --git a/Demo/turtle/tdemo_peace.py b/Lib/turtledemo/peace.py
index ea57069028..63cf7cc2e1 100644
--- a/Demo/turtle/tdemo_peace.py
+++ b/Lib/turtledemo/peace.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtle-example-suite:
tdemo_peace.py
diff --git a/Demo/turtle/tdemo_penrose.py b/Lib/turtledemo/penrose.py
index f816f66e5d..f73c864b7b 100644
--- a/Demo/turtle/tdemo_penrose.py
+++ b/Lib/turtledemo/penrose.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" xturtle-example-suite:
xtx_kites_and_darts.py
diff --git a/Demo/turtle/tdemo_planet_and_moon.py b/Lib/turtledemo/planet_and_moon.py
index 983449c096..14c4bbccc4 100644
--- a/Demo/turtle/tdemo_planet_and_moon.py
+++ b/Lib/turtledemo/planet_and_moon.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtle-example-suite:
tdemo_planets_and_moon.py
diff --git a/Demo/turtle/tdemo_round_dance.py b/Lib/turtledemo/round_dance.py
index bffc1e6d58..10383614c6 100644
--- a/Demo/turtle/tdemo_round_dance.py
+++ b/Lib/turtledemo/round_dance.py
@@ -1,7 +1,7 @@
""" turtle-example-suite:
tdemo_round_dance.py
-
+
(Needs version 1.1 of the turtle module that
comes with Python 3.1)
@@ -84,7 +84,3 @@ def main():
if __name__=='__main__':
print(main())
mainloop()
-
-
-
-
diff --git a/Demo/turtle/tdemo_tree.py b/Lib/turtledemo/tree.py
index fda653ce1e..9c0b1f7bb4 100644
--- a/Demo/turtle/tdemo_tree.py
+++ b/Lib/turtledemo/tree.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtle-example-suite:
tdemo_tree.py
diff --git a/Demo/turtle/turtle.cfg b/Lib/turtledemo/turtle.cfg
index bd89a741f9..bd89a741f9 100644
--- a/Demo/turtle/turtle.cfg
+++ b/Lib/turtledemo/turtle.cfg
diff --git a/Demo/turtle/turtledemo_two_canvases.py b/Lib/turtledemo/two_canvases.py
index 57ecb1dea6..02d89db57e 100644
--- a/Demo/turtle/turtledemo_two_canvases.py
+++ b/Lib/turtledemo/two_canvases.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
## DEMONSTRATES USE OF 2 CANVASES, SO CANNOT BE RUN IN DEMOVIEWER!
"""turtle example: Using TurtleScreen and RawTurtle
for drawing on two distinct canvases.
@@ -44,9 +44,9 @@ for t in p,q:
## Want to get some info?
-print(s1, s2)
-print(p, q)
-print(s1.turtles())
-print(s2.turtles())
+#print(s1, s2)
+#print(p, q)
+#print(s1.turtles())
+#print(s2.turtles())
TK.mainloop()
diff --git a/Demo/turtle/tdemo_wikipedia.py b/Lib/turtledemo/wikipedia.py
index 73e03d22e3..0f274420c8 100644
--- a/Demo/turtle/tdemo_wikipedia.py
+++ b/Lib/turtledemo/wikipedia.py
@@ -56,7 +56,7 @@ def main():
for t in s.turtles():
t.undo()
et = clock()
- return "Laufzeit: %.3f sec" % (z1+et-at)
+ return "runtime: %.3f sec" % (z1+et-at)
if __name__ == '__main__':
diff --git a/Demo/turtle/tdemo_yinyang.py b/Lib/turtledemo/yinyang.py
index 6508b44a54..11d1f47cae 100644
--- a/Demo/turtle/tdemo_yinyang.py
+++ b/Lib/turtledemo/yinyang.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
""" turtle-example-suite:
tdemo_yinyang.py
diff --git a/Lib/unittest.py b/Lib/unittest.py
deleted file mode 100644
index cabd857a0e..0000000000
--- a/Lib/unittest.py
+++ /dev/null
@@ -1,1630 +0,0 @@
-#!/usr/bin/env python
-'''
-Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
-Smalltalk testing framework.
-
-This module contains the core framework classes that form the basis of
-specific test cases and suites (TestCase, TestSuite etc.), and also a
-text-based utility class for running the tests and reporting the results
- (TextTestRunner).
-
-Simple usage:
-
- import unittest
-
- class IntegerArithmenticTestCase(unittest.TestCase):
- def testAdd(self): ## test method names begin 'test*'
- self.assertEqual((1 + 2), 3)
- self.assertEqual(0 + 1, 1)
- def testMultiply(self):
- self.assertEqual((0 * 10), 0)
- self.assertEqual((5 * 8), 40)
-
- if __name__ == '__main__':
- unittest.main()
-
-Further information is available in the bundled documentation, and from
-
- http://docs.python.org/library/unittest.html
-
-Copyright (c) 1999-2003 Steve Purcell
-Copyright (c) 2003-2009 Python Software Foundation
-This module is free software, and you may redistribute it and/or modify
-it under the same terms as Python itself, so long as this copyright message
-and disclaimer are retained in their original form.
-
-IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
-THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-
-THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
-AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
-SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-'''
-
-import difflib
-import functools
-import os
-import pprint
-import re
-import sys
-import time
-import traceback
-import types
-import warnings
-
-##############################################################################
-# Exported classes and functions
-##############################################################################
-__all__ = ['TestResult', 'TestCase', 'TestSuite',
- 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',
- 'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless',
- 'expectedFailure']
-
-# Expose obsolete functions for backwards compatibility
-__all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases'])
-
-
-##############################################################################
-# Test framework core
-##############################################################################
-
-def _strclass(cls):
- return "%s.%s" % (cls.__module__, cls.__name__)
-
-
-class SkipTest(Exception):
- """
- Raise this exception in a test to skip it.
-
- Usually you can use TestResult.skip() or one of the skipping decorators
- instead of raising this directly.
- """
- pass
-
-class _ExpectedFailure(Exception):
- """
- Raise this when a test is expected to fail.
-
- This is an implementation detail.
- """
-
- def __init__(self, exc_info):
- super(_ExpectedFailure, self).__init__()
- self.exc_info = exc_info
-
-class _UnexpectedSuccess(Exception):
- """
- The test was supposed to fail, but it didn't!
- """
- pass
-
-def _id(obj):
- return obj
-
-def skip(reason):
- """
- Unconditionally skip a test.
- """
- def decorator(test_item):
- if isinstance(test_item, type) and issubclass(test_item, TestCase):
- test_item.__unittest_skip__ = True
- test_item.__unittest_skip_why__ = reason
- return test_item
- @functools.wraps(test_item)
- def skip_wrapper(*args, **kwargs):
- raise SkipTest(reason)
- return skip_wrapper
- return decorator
-
-def skipIf(condition, reason):
- """
- Skip a test if the condition is true.
- """
- if condition:
- return skip(reason)
- return _id
-
-def skipUnless(condition, reason):
- """
- Skip a test unless the condition is true.
- """
- if not condition:
- return skip(reason)
- return _id
-
-
-def expectedFailure(func):
- @functools.wraps(func)
- def wrapper(*args, **kwargs):
- try:
- func(*args, **kwargs)
- except Exception:
- raise _ExpectedFailure(sys.exc_info())
- raise _UnexpectedSuccess
- return wrapper
-
-__unittest = 1
-
-class TestResult(object):
- """Holder for test result information.
-
- Test results are automatically managed by the TestCase and TestSuite
- classes, and do not need to be explicitly manipulated by writers of tests.
-
- Each instance holds the total number of tests run, and collections of
- failures and errors that occurred among those test runs. The collections
- contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
- formatted traceback of the error that occurred.
- """
- def __init__(self):
- self.failures = []
- self.errors = []
- self.testsRun = 0
- self.skipped = []
- self.expectedFailures = []
- self.unexpectedSuccesses = []
- self.shouldStop = False
-
- def startTest(self, test):
- "Called when the given test is about to be run"
- self.testsRun = self.testsRun + 1
-
- def startTestRun(self):
- """Called once before any tests are executed.
-
- See startTest for a method called before each test.
- """
-
- def stopTest(self, test):
- "Called when the given test has been run"
- pass
-
- def stopTestRun(self):
- """Called once after all tests are executed.
-
- See stopTest for a method called after each test.
- """
-
- def addError(self, test, err):
- """Called when an error has occurred. 'err' is a tuple of values as
- returned by sys.exc_info().
- """
- self.errors.append((test, self._exc_info_to_string(err, test)))
-
- def addFailure(self, test, err):
- """Called when an error has occurred. 'err' is a tuple of values as
- returned by sys.exc_info()."""
- self.failures.append((test, self._exc_info_to_string(err, test)))
-
- def addSuccess(self, test):
- "Called when a test has completed successfully"
- pass
-
- def addSkip(self, test, reason):
- """Called when a test is skipped."""
- self.skipped.append((test, reason))
-
- def addExpectedFailure(self, test, err):
- """Called when an expected failure/error occured."""
- self.expectedFailures.append(
- (test, self._exc_info_to_string(err, test)))
-
- def addUnexpectedSuccess(self, test):
- """Called when a test was expected to fail, but succeed."""
- self.unexpectedSuccesses.append(test)
-
- def wasSuccessful(self):
- "Tells whether or not this result was a success"
- return len(self.failures) == len(self.errors) == 0
-
- def stop(self):
- "Indicates that the tests should be aborted"
- self.shouldStop = True
-
- def _exc_info_to_string(self, err, test):
- """Converts a sys.exc_info()-style tuple of values into a string."""
- exctype, value, tb = err
- # Skip test runner traceback levels
- while tb and self._is_relevant_tb_level(tb):
- tb = tb.tb_next
- if exctype is test.failureException:
- # Skip assert*() traceback levels
- length = self._count_relevant_tb_levels(tb)
- return ''.join(traceback.format_exception(exctype, value,
- tb, length))
- return ''.join(traceback.format_exception(exctype, value, tb))
-
- def _is_relevant_tb_level(self, tb):
- return '__unittest' in tb.tb_frame.f_globals
-
- def _count_relevant_tb_levels(self, tb):
- length = 0
- while tb and not self._is_relevant_tb_level(tb):
- length += 1
- tb = tb.tb_next
- return length
-
- def __repr__(self):
- return "<%s run=%i errors=%i failures=%i>" % \
- (_strclass(self.__class__), self.testsRun, len(self.errors),
- len(self.failures))
-
-
-class _AssertRaisesContext(object):
- """A context manager used to implement TestCase.assertRaises* methods."""
-
-
- def __init__(self, expected, test_case, callable_obj=None,
- expected_regexp=None):
- self.expected = expected
- self.failureException = test_case.failureException
- if callable_obj is not None:
- try:
- self.obj_name = callable_obj.__name__
- except AttributeError:
- self.obj_name = str(callable_obj)
- else:
- self.obj_name = None
- self.expected_regex = expected_regexp
-
- def __enter__(self):
- pass
-
- def __exit__(self, exc_type, exc_value, tb):
- if exc_type is None:
- try:
- exc_name = self.expected.__name__
- except AttributeError:
- exc_name = str(self.expected)
- if self.obj_name:
- raise self.failureException("{0} not raised by {1}"
- .format(exc_name, self.obj_name))
- else:
- raise self.failureException("{0} not raised"
- .format(exc_name))
- if not issubclass(exc_type, self.expected):
- # let unexpected exceptions pass through
- return False
- if self.expected_regex is None:
- return True
-
- expected_regexp = self.expected_regex
- if isinstance(expected_regexp, (bytes, str)):
- expected_regexp = re.compile(expected_regexp)
- if not expected_regexp.search(str(exc_value)):
- raise self.failureException('"%s" does not match "%s"' %
- (expected_regexp.pattern, str(exc_value)))
- return True
-
-
-class _AssertWrapper(object):
- """Wrap entries in the _type_equality_funcs registry to make them deep
- copyable."""
-
- def __init__(self, function):
- self.function = function
-
- def __deepcopy__(self, memo):
- memo[id(self)] = self
-
-
-class TestCase(object):
- """A class whose instances are single test cases.
-
- By default, the test code itself should be placed in a method named
- 'runTest'.
-
- If the fixture may be used for many test cases, create as
- many test methods as are needed. When instantiating such a TestCase
- subclass, specify in the constructor arguments the name of the test method
- that the instance is to execute.
-
- Test authors should subclass TestCase for their own tests. Construction
- and deconstruction of the test's environment ('fixture') can be
- implemented by overriding the 'setUp' and 'tearDown' methods respectively.
-
- If it is necessary to override the __init__ method, the base class
- __init__ method must always be called. It is important that subclasses
- should not change the signature of their __init__ method, since instances
- of the classes are instantiated automatically by parts of the framework
- in order to be run.
- """
-
- # This attribute determines which exception will be raised when
- # the instance's assertion methods fail; test methods raising this
- # exception will be deemed to have 'failed' rather than 'errored'
-
- failureException = AssertionError
-
- # This attribute determines whether long messages (including repr of
- # objects used in assert methods) will be printed on failure in *addition*
- # to any explicit message passed.
-
- longMessage = False
-
- # If a string is longer than _diffThreshold, use normal comparison instead
- # of difflib. See #11763.
- _diffThreshold = 2**16
-
- def __init__(self, methodName='runTest'):
- """Create an instance of the class that will use the named test
- method when executed. Raises a ValueError if the instance does
- not have a method with the specified name.
- """
- self._testMethodName = methodName
- self._resultForDoCleanups = None
- try:
- testMethod = getattr(self, methodName)
- except AttributeError:
- raise ValueError("no such test method in %s: %s" % \
- (self.__class__, methodName))
- self._testMethodDoc = testMethod.__doc__
- self._cleanups = []
-
- # Map types to custom assertEqual functions that will compare
- # instances of said type in more detail to generate a more useful
- # error message.
- self._type_equality_funcs = {}
- self.addTypeEqualityFunc(dict, self.assertDictEqual)
- self.addTypeEqualityFunc(list, self.assertListEqual)
- self.addTypeEqualityFunc(tuple, self.assertTupleEqual)
- self.addTypeEqualityFunc(set, self.assertSetEqual)
- self.addTypeEqualityFunc(frozenset, self.assertSetEqual)
-
- def addTypeEqualityFunc(self, typeobj, function):
- """Add a type specific assertEqual style function to compare a type.
-
- This method is for use by TestCase subclasses that need to register
- their own type equality functions to provide nicer error messages.
-
- Args:
- typeobj: The data type to call this function on when both values
- are of the same type in assertEqual().
- function: The callable taking two arguments and an optional
- msg= argument that raises self.failureException with a
- useful error message when the two arguments are not equal.
- """
- self._type_equality_funcs[typeobj] = _AssertWrapper(function)
-
- def addCleanup(self, function, *args, **kwargs):
- """Add a function, with arguments, to be called when the test is
- completed. Functions added are called on a LIFO basis and are
- called after tearDown on test failure or success.
-
- Cleanup items are called even if setUp fails (unlike tearDown)."""
- self._cleanups.append((function, args, kwargs))
-
- def setUp(self):
- "Hook method for setting up the test fixture before exercising it."
- pass
-
- def tearDown(self):
- "Hook method for deconstructing the test fixture after testing it."
- pass
-
- def countTestCases(self):
- return 1
-
- def defaultTestResult(self):
- return TestResult()
-
- def shortDescription(self):
- """Returns both the test method name and first line of its docstring.
-
- If no docstring is given, only returns the method name.
-
- This method overrides unittest.TestCase.shortDescription(), which
- only returns the first line of the docstring, obscuring the name
- of the test upon failure.
- """
- desc = str(self)
- doc_first_line = None
-
- if self._testMethodDoc:
- doc_first_line = self._testMethodDoc.split("\n")[0].strip()
- if doc_first_line:
- desc = '\n'.join((desc, doc_first_line))
- return desc
-
- def id(self):
- return "%s.%s" % (_strclass(self.__class__), self._testMethodName)
-
- def __eq__(self, other):
- if type(self) is not type(other):
- return NotImplemented
-
- return self._testMethodName == other._testMethodName
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((type(self), self._testMethodName))
-
- def __str__(self):
- return "%s (%s)" % (self._testMethodName, _strclass(self.__class__))
-
- def __repr__(self):
- return "<%s testMethod=%s>" % \
- (_strclass(self.__class__), self._testMethodName)
-
- def run(self, result=None):
- orig_result = result
- if result is None:
- result = self.defaultTestResult()
- startTestRun = getattr(result, 'startTestRun', None)
- if startTestRun is not None:
- startTestRun()
-
- self._resultForDoCleanups = result
- result.startTest(self)
- if getattr(self.__class__, "__unittest_skip__", False):
- # If the whole class was skipped.
- try:
- result.addSkip(self, self.__class__.__unittest_skip_why__)
- finally:
- result.stopTest(self)
- return
- testMethod = getattr(self, self._testMethodName)
- try:
- success = False
- try:
- self.setUp()
- except SkipTest as e:
- result.addSkip(self, str(e))
- except Exception:
- result.addError(self, sys.exc_info())
- else:
- try:
- testMethod()
- except self.failureException:
- result.addFailure(self, sys.exc_info())
- except _ExpectedFailure as e:
- result.addExpectedFailure(self, e.exc_info)
- except _UnexpectedSuccess:
- result.addUnexpectedSuccess(self)
- except SkipTest as e:
- result.addSkip(self, str(e))
- except Exception:
- result.addError(self, sys.exc_info())
- else:
- success = True
-
- try:
- self.tearDown()
- except Exception:
- result.addError(self, sys.exc_info())
- success = False
-
- cleanUpSuccess = self.doCleanups()
- success = success and cleanUpSuccess
- if success:
- result.addSuccess(self)
- finally:
- result.stopTest(self)
- if orig_result is None:
- stopTestRun = getattr(result, 'stopTestRun', None)
- if stopTestRun is not None:
- stopTestRun()
-
- def doCleanups(self):
- """Execute all cleanup functions. Normally called for you after
- tearDown."""
- result = self._resultForDoCleanups
- ok = True
- while self._cleanups:
- function, args, kwargs = self._cleanups.pop(-1)
- try:
- function(*args, **kwargs)
- except Exception:
- ok = False
- result.addError(self, sys.exc_info())
- return ok
-
- def __call__(self, *args, **kwds):
- return self.run(*args, **kwds)
-
- def debug(self):
- """Run the test without collecting errors in a TestResult"""
- self.setUp()
- getattr(self, self._testMethodName)()
- self.tearDown()
-
- def skipTest(self, reason):
- """Skip this test."""
- raise SkipTest(reason)
-
- def fail(self, msg=None):
- """Fail immediately, with the given message."""
- raise self.failureException(msg)
-
- def assertFalse(self, expr, msg=None):
- """Check that the expression is false."""
- if expr:
- msg = self._formatMessage(msg, "%r is not false" % expr)
- raise self.failureException(msg)
-
- def assertTrue(self, expr, msg=None):
- """Check that the expression is true."""
- if not expr:
- msg = self._formatMessage(msg, "%r is not true" % expr)
- raise self.failureException(msg)
-
- def _formatMessage(self, msg, standardMsg):
- """Honour the longMessage attribute when generating failure messages.
- If longMessage is False this means:
- * Use only an explicit message if it is provided
- * Otherwise use the standard message for the assert
-
- If longMessage is True:
- * Use the standard message
- * If an explicit message is provided, plus ' : ' and the explicit message
- """
- if not self.longMessage:
- return msg or standardMsg
- if msg is None:
- return standardMsg
- return standardMsg + ' : ' + msg
-
-
- def assertRaises(self, excClass, callableObj=None, *args, **kwargs):
- """Fail unless an exception of class excClass is thrown
- by callableObj when invoked with arguments args and keyword
- arguments kwargs. If a different type of exception is
- thrown, it will not be caught, and the test case will be
- deemed to have suffered an error, exactly as for an
- unexpected exception.
-
- If called with callableObj omitted or None, will return a
- context object used like this::
-
- with self.assertRaises(some_error_class):
- do_something()
- """
- context = _AssertRaisesContext(excClass, self, callableObj)
- if callableObj is None:
- return context
- with context:
- callableObj(*args, **kwargs)
-
- def _getAssertEqualityFunc(self, first, second):
- """Get a detailed comparison function for the types of the two args.
-
- Returns: A callable accepting (first, second, msg=None) that will
- raise a failure exception if first != second with a useful human
- readable error message for those types.
- """
- #
- # NOTE(gregory.p.smith): I considered isinstance(first, type(second))
- # and vice versa. I opted for the conservative approach in case
- # subclasses are not intended to be compared in detail to their super
- # class instances using a type equality func. This means testing
- # subtypes won't automagically use the detailed comparison. Callers
- # should use their type specific assertSpamEqual method to compare
- # subclasses if the detailed comparison is desired and appropriate.
- # See the discussion in http://bugs.python.org/issue2578.
- #
- if type(first) is type(second):
- asserter = self._type_equality_funcs.get(type(first))
- if asserter is not None:
- return asserter.function
-
- return self._baseAssertEqual
-
- def _baseAssertEqual(self, first, second, msg=None):
- """The default assertEqual implementation, not type specific."""
- if not first == second:
- standardMsg = '%r != %r' % (first, second)
- msg = self._formatMessage(msg, standardMsg)
- raise self.failureException(msg)
-
- def assertEqual(self, first, second, msg=None):
- """Fail if the two objects are unequal as determined by the '=='
- operator.
- """
- assertion_func = self._getAssertEqualityFunc(first, second)
- assertion_func(first, second, msg=msg)
-
- def assertNotEqual(self, first, second, msg=None):
- """Fail if the two objects are equal as determined by the '=='
- operator.
- """
- if not first != second:
- msg = self._formatMessage(msg, '%r == %r' % (first, second))
- raise self.failureException(msg)
-
- def assertAlmostEqual(self, first, second, places=7, msg=None):
- """Fail if the two objects are unequal as determined by their
- difference rounded to the given number of decimal places
- (default 7) and comparing to zero.
-
- Note that decimal places (from zero) are usually not the same
- as significant digits (measured from the most signficant digit).
- """
- if round(abs(second-first), places) != 0:
- standardMsg = '%r != %r within %r places' % (first, second, places)
- msg = self._formatMessage(msg, standardMsg)
- raise self.failureException(msg)
-
- def assertNotAlmostEqual(self, first, second, places=7, msg=None):
- """Fail if the two objects are equal as determined by their
- difference rounded to the given number of decimal places
- (default 7) and comparing to zero.
-
- Note that decimal places (from zero) are usually not the same
- as significant digits (measured from the most signficant digit).
- """
- if round(abs(second-first), places) == 0:
- standardMsg = '%r == %r within %r places' % (first, second, places)
- msg = self._formatMessage(msg, standardMsg)
- raise self.failureException(msg)
-
- # Synonyms for assertion methods
-
- # The plurals are undocumented. Keep them that way to discourage use.
- # Do not add more. Do not remove.
- # Going through a deprecation cycle on these would annoy many people.
- assertEquals = assertEqual
- assertNotEquals = assertNotEqual
- assertAlmostEquals = assertAlmostEqual
- assertNotAlmostEquals = assertNotAlmostEqual
- assert_ = assertTrue
-
- # These fail* assertion method names are pending deprecation and will
- # be a DeprecationWarning in 3.2; http://bugs.python.org/issue2578
- def _deprecate(original_func):
- def deprecated_func(*args, **kwargs):
- warnings.warn(
- 'Please use {0} instead.'.format(original_func.__name__),
- PendingDeprecationWarning, 2)
- return original_func(*args, **kwargs)
- return deprecated_func
-
- failUnlessEqual = _deprecate(assertEqual)
- failIfEqual = _deprecate(assertNotEqual)
- failUnlessAlmostEqual = _deprecate(assertAlmostEqual)
- failIfAlmostEqual = _deprecate(assertNotAlmostEqual)
- failUnless = _deprecate(assertTrue)
- failUnlessRaises = _deprecate(assertRaises)
- failIf = _deprecate(assertFalse)
-
- def assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None):
- """An equality assertion for ordered sequences (like lists and tuples).
-
- For the purposes of this function, a valid ordered sequence type is one
- which can be indexed, has a length, and has an equality operator.
-
- Args:
- seq1: The first sequence to compare.
- seq2: The second sequence to compare.
- seq_type: The expected datatype of the sequences, or None if no
- datatype should be enforced.
- msg: Optional message to use on failure instead of a list of
- differences.
- """
- if seq_type != None:
- seq_type_name = seq_type.__name__
- if not isinstance(seq1, seq_type):
- raise self.failureException('First sequence is not a %s: %r'
- % (seq_type_name, seq1))
- if not isinstance(seq2, seq_type):
- raise self.failureException('Second sequence is not a %s: %r'
- % (seq_type_name, seq2))
- else:
- seq_type_name = "sequence"
-
- differing = None
- try:
- len1 = len(seq1)
- except (TypeError, NotImplementedError):
- differing = 'First %s has no length. Non-sequence?' % (
- seq_type_name)
-
- if differing is None:
- try:
- len2 = len(seq2)
- except (TypeError, NotImplementedError):
- differing = 'Second %s has no length. Non-sequence?' % (
- seq_type_name)
-
- if differing is None:
- if seq1 == seq2:
- return
-
- seq1_repr = repr(seq1)
- seq2_repr = repr(seq2)
- if len(seq1_repr) > 30:
- seq1_repr = seq1_repr[:30] + '...'
- if len(seq2_repr) > 30:
- seq2_repr = seq2_repr[:30] + '...'
- elements = (seq_type_name.capitalize(), seq1_repr, seq2_repr)
- differing = '%ss differ: %s != %s\n' % elements
-
- for i in range(min(len1, len2)):
- try:
- item1 = seq1[i]
- except (TypeError, IndexError, NotImplementedError):
- differing += ('\nUnable to index element %d of first %s\n' %
- (i, seq_type_name))
- break
-
- try:
- item2 = seq2[i]
- except (TypeError, IndexError, NotImplementedError):
- differing += ('\nUnable to index element %d of second %s\n' %
- (i, seq_type_name))
- break
-
- if item1 != item2:
- differing += ('\nFirst differing element %d:\n%s\n%s\n' %
- (i, item1, item2))
- break
- else:
- if (len1 == len2 and seq_type is None and
- type(seq1) != type(seq2)):
- # The sequences are the same, but have differing types.
- return
-
- if len1 > len2:
- differing += ('\nFirst %s contains %d additional '
- 'elements.\n' % (seq_type_name, len1 - len2))
- try:
- differing += ('First extra element %d:\n%s\n' %
- (len2, seq1[len2]))
- except (TypeError, IndexError, NotImplementedError):
- differing += ('Unable to index element %d '
- 'of first %s\n' % (len2, seq_type_name))
- elif len1 < len2:
- differing += ('\nSecond %s contains %d additional '
- 'elements.\n' % (seq_type_name, len2 - len1))
- try:
- differing += ('First extra element %d:\n%s\n' %
- (len1, seq2[len1]))
- except (TypeError, IndexError, NotImplementedError):
- differing += ('Unable to index element %d '
- 'of second %s\n' % (len1, seq_type_name))
- standardMsg = differing + '\n' + '\n'.join(difflib.ndiff(pprint.pformat(seq1).splitlines(),
- pprint.pformat(seq2).splitlines()))
- msg = self._formatMessage(msg, standardMsg)
- self.fail(msg)
-
- def assertListEqual(self, list1, list2, msg=None):
- """A list-specific equality assertion.
-
- Args:
- list1: The first list to compare.
- list2: The second list to compare.
- msg: Optional message to use on failure instead of a list of
- differences.
-
- """
- self.assertSequenceEqual(list1, list2, msg, seq_type=list)
-
- def assertTupleEqual(self, tuple1, tuple2, msg=None):
- """A tuple-specific equality assertion.
-
- Args:
- tuple1: The first tuple to compare.
- tuple2: The second tuple to compare.
- msg: Optional message to use on failure instead of a list of
- differences.
- """
- self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple)
-
- def assertSetEqual(self, set1, set2, msg=None):
- """A set-specific equality assertion.
-
- Args:
- set1: The first set to compare.
- set2: The second set to compare.
- msg: Optional message to use on failure instead of a list of
- differences.
-
- For more general containership equality, assertSameElements will work
- with things other than sets. This uses ducktyping to support
- different types of sets, and is optimized for sets specifically
- (parameters must support a difference method).
- """
- try:
- difference1 = set1.difference(set2)
- except TypeError as e:
- self.fail('invalid type when attempting set difference: %s' % e)
- except AttributeError as e:
- self.fail('first argument does not support set difference: %s' % e)
-
- try:
- difference2 = set2.difference(set1)
- except TypeError as e:
- self.fail('invalid type when attempting set difference: %s' % e)
- except AttributeError as e:
- self.fail('second argument does not support set difference: %s' % e)
-
- if not (difference1 or difference2):
- return
-
- lines = []
- if difference1:
- lines.append('Items in the first set but not the second:')
- for item in difference1:
- lines.append(repr(item))
- if difference2:
- lines.append('Items in the second set but not the first:')
- for item in difference2:
- lines.append(repr(item))
-
- standardMsg = '\n'.join(lines)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertIn(self, member, container, msg=None):
- """Just like self.assertTrue(a in b), but with a nicer default message."""
- if member not in container:
- standardMsg = '%r not found in %r' % (member, container)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertNotIn(self, member, container, msg=None):
- """Just like self.assertTrue(a not in b), but with a nicer default message."""
- if member in container:
- standardMsg = '%r unexpectedly found in %r' % (member, container)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertIs(self, expr1, expr2, msg=None):
- """Just like self.assertTrue(a is b), but with a nicer default message."""
- if expr1 is not expr2:
- standardMsg = '%r is not %r' % (expr1, expr2)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertIsNot(self, expr1, expr2, msg=None):
- """Just like self.assertTrue(a is not b), but with a nicer default message."""
- if expr1 is expr2:
- standardMsg = 'unexpectedly identical: %r' % (expr1,)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertDictEqual(self, d1, d2, msg=None):
- self.assertTrue(isinstance(d1, dict), 'First argument is not a dictionary')
- self.assertTrue(isinstance(d2, dict), 'Second argument is not a dictionary')
-
- if d1 != d2:
- standardMsg = ('\n' + '\n'.join(difflib.ndiff(
- pprint.pformat(d1).splitlines(),
- pprint.pformat(d2).splitlines())))
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertDictContainsSubset(self, expected, actual, msg=None):
- """Checks whether actual is a superset of expected."""
- missing = []
- mismatched = []
- for key, value in expected.items():
- if key not in actual:
- missing.append(key)
- elif value != actual[key]:
- mismatched.append('%s, expected: %s, actual: %s' % (key, value, actual[key]))
-
- if not (missing or mismatched):
- return
-
- standardMsg = ''
- if missing:
- standardMsg = 'Missing: %r' % ','.join(missing)
- if mismatched:
- if standardMsg:
- standardMsg += '; '
- standardMsg += 'Mismatched values: %s' % ','.join(mismatched)
-
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertSameElements(self, expected_seq, actual_seq, msg=None):
- """An unordered sequence specific comparison.
-
- Raises with an error message listing which elements of expected_seq
- are missing from actual_seq and vice versa if any.
- """
- try:
- expected = set(expected_seq)
- actual = set(actual_seq)
- missing = list(expected.difference(actual))
- unexpected = list(actual.difference(expected))
- missing.sort()
- unexpected.sort()
- except TypeError:
- # Fall back to slower list-compare if any of the objects are
- # not hashable.
- expected = list(expected_seq)
- actual = list(actual_seq)
- try:
- expected.sort()
- actual.sort()
- except TypeError:
- missing, unexpected = _UnorderableListDifference(expected, actual)
- else:
- missing, unexpected = _SortedListDifference(expected, actual)
- errors = []
- if missing:
- errors.append('Expected, but missing:\n %r' % missing)
- if unexpected:
- errors.append('Unexpected, but present:\n %r' % unexpected)
- if errors:
- standardMsg = '\n'.join(errors)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertMultiLineEqual(self, first, second, msg=None):
- """Assert that two multi-line strings are equal."""
- self.assertTrue(isinstance(first, str), (
- 'First argument is not a string'))
- self.assertTrue(isinstance(second, str), (
- 'Second argument is not a string'))
-
- if first != second:
- # don't use difflib if the strings are too long
- if (len(first) > self._diffThreshold or
- len(second) > self._diffThreshold):
- self._baseAssertEqual(first, second, msg)
- standardMsg = '\n' + ''.join(difflib.ndiff(first.splitlines(True), second.splitlines(True)))
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertLess(self, a, b, msg=None):
- """Just like self.assertTrue(a < b), but with a nicer default message."""
- if not a < b:
- standardMsg = '%r not less than %r' % (a, b)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertLessEqual(self, a, b, msg=None):
- """Just like self.assertTrue(a <= b), but with a nicer default message."""
- if not a <= b:
- standardMsg = '%r not less than or equal to %r' % (a, b)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertGreater(self, a, b, msg=None):
- """Just like self.assertTrue(a > b), but with a nicer default message."""
- if not a > b:
- standardMsg = '%r not greater than %r' % (a, b)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertGreaterEqual(self, a, b, msg=None):
- """Just like self.assertTrue(a >= b), but with a nicer default message."""
- if not a >= b:
- standardMsg = '%r not greater than or equal to %r' % (a, b)
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertIsNone(self, obj, msg=None):
- """Same as self.assertTrue(obj is None), with a nicer default message."""
- if obj is not None:
- standardMsg = '%r is not None' % obj
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertIsNotNone(self, obj, msg=None):
- """Included for symmetry with assertIsNone."""
- if obj is None:
- standardMsg = 'unexpectedly None'
- self.fail(self._formatMessage(msg, standardMsg))
-
- def assertRaisesRegexp(self, expected_exception, expected_regexp,
- callable_obj=None, *args, **kwargs):
- """Asserts that the message in a raised exception matches a regexp.
-
- Args:
- expected_exception: Exception class expected to be raised.
- expected_regexp: Regexp (re pattern object or string) expected
- to be found in error message.
- callable_obj: Function to be called.
- args: Extra args.
- kwargs: Extra kwargs.
- """
- context = _AssertRaisesContext(expected_exception, self, callable_obj,
- expected_regexp)
- if callable_obj is None:
- return context
- with context:
- callable_obj(*args, **kwargs)
-
- def assertRegexpMatches(self, text, expected_regex, msg=None):
- if isinstance(expected_regex, (str, bytes)):
- expected_regex = re.compile(expected_regex)
- if not expected_regex.search(text):
- msg = msg or "Regexp didn't match"
- msg = '%s: %r not found in %r' % (msg, expected_regex.pattern, text)
- raise self.failureException(msg)
-
-
-def _SortedListDifference(expected, actual):
- """Finds elements in only one or the other of two, sorted input lists.
-
- Returns a two-element tuple of lists. The first list contains those
- elements in the "expected" list but not in the "actual" list, and the
- second contains those elements in the "actual" list but not in the
- "expected" list. Duplicate elements in either input list are ignored.
- """
- i = j = 0
- missing = []
- unexpected = []
- while True:
- try:
- e = expected[i]
- a = actual[j]
- if e < a:
- missing.append(e)
- i += 1
- while expected[i] == e:
- i += 1
- elif e > a:
- unexpected.append(a)
- j += 1
- while actual[j] == a:
- j += 1
- else:
- i += 1
- try:
- while expected[i] == e:
- i += 1
- finally:
- j += 1
- while actual[j] == a:
- j += 1
- except IndexError:
- missing.extend(expected[i:])
- unexpected.extend(actual[j:])
- break
- return missing, unexpected
-
-def _UnorderableListDifference(expected, actual):
- """Same behavior as _SortedListDifference but
- for lists of unorderable items (like dicts).
-
- As it does a linear search per item (remove) it
- has O(n*n) performance."""
- missing = []
- while expected:
- item = expected.pop()
- try:
- actual.remove(item)
- except ValueError:
- missing.append(item)
-
- # anything left in actual is unexpected
- return missing, actual
-
-class TestSuite(object):
- """A test suite is a composite test consisting of a number of TestCases.
-
- For use, create an instance of TestSuite, then add test case instances.
- When all tests have been added, the suite can be passed to a test
- runner, such as TextTestRunner. It will run the individual test cases
- in the order in which they were added, aggregating the results. When
- subclassing, do not forget to call the base class constructor.
- """
- def __init__(self, tests=()):
- self._tests = []
- self.addTests(tests)
-
- def __repr__(self):
- return "<%s tests=%s>" % (_strclass(self.__class__), list(self))
-
- def __eq__(self, other):
- if not isinstance(other, self.__class__):
- return NotImplemented
- return list(self) == list(other)
-
- def __ne__(self, other):
- return not self == other
-
- def __iter__(self):
- return iter(self._tests)
-
- def countTestCases(self):
- cases = 0
- for test in self:
- cases += test.countTestCases()
- return cases
-
- def addTest(self, test):
- # sanity checks
- if not hasattr(test, '__call__'):
- raise TypeError("the test to add must be callable")
- if isinstance(test, type) and issubclass(test, (TestCase, TestSuite)):
- raise TypeError("TestCases and TestSuites must be instantiated "
- "before passing them to addTest()")
- self._tests.append(test)
-
- def addTests(self, tests):
- if isinstance(tests, str):
- raise TypeError("tests must be an iterable of tests, not a string")
- for test in tests:
- self.addTest(test)
-
- def run(self, result):
- for test in self:
- if result.shouldStop:
- break
- test(result)
- return result
-
- def __call__(self, *args, **kwds):
- return self.run(*args, **kwds)
-
- def debug(self):
- """Run the tests without collecting errors in a TestResult"""
- for test in self:
- test.debug()
-
-
-class FunctionTestCase(TestCase):
- """A test case that wraps a test function.
-
- This is useful for slipping pre-existing test functions into the
- unittest framework. Optionally, set-up and tidy-up functions can be
- supplied. As with TestCase, the tidy-up ('tearDown') function will
- always be called if the set-up ('setUp') function ran successfully.
- """
-
- def __init__(self, testFunc, setUp=None, tearDown=None, description=None):
- super(FunctionTestCase, self).__init__()
- self._setUpFunc = setUp
- self._tearDownFunc = tearDown
- self._testFunc = testFunc
- self._description = description
-
- def setUp(self):
- if self._setUpFunc is not None:
- self._setUpFunc()
-
- def tearDown(self):
- if self._tearDownFunc is not None:
- self._tearDownFunc()
-
- def runTest(self):
- self._testFunc()
-
- def id(self):
- return self._testFunc.__name__
-
- def __eq__(self, other):
- if not isinstance(other, self.__class__):
- return NotImplemented
-
- return self._setUpFunc == other._setUpFunc and \
- self._tearDownFunc == other._tearDownFunc and \
- self._testFunc == other._testFunc and \
- self._description == other._description
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((type(self), self._setUpFunc, self._tearDownFunc,
- self._testFunc, self._description))
-
- def __str__(self):
- return "%s (%s)" % (_strclass(self.__class__), self._testFunc.__name__)
-
- def __repr__(self):
- return "<%s testFunc=%s>" % (_strclass(self.__class__), self._testFunc)
-
- def shortDescription(self):
- if self._description is not None:
- return self._description
- doc = self._testFunc.__doc__
- return doc and doc.split("\n")[0].strip() or None
-
-
-
-##############################################################################
-# Locating and loading tests
-##############################################################################
-
-def CmpToKey(mycmp):
- 'Convert a cmp= function into a key= function'
- class K(object):
- def __init__(self, obj, *args):
- self.obj = obj
- def __lt__(self, other):
- return mycmp(self.obj, other.obj) == -1
- return K
-
-def three_way_cmp(x, y):
- """Return -1 if x < y, 0 if x == y and 1 if x > y"""
- return (x > y) - (x < y)
-
-class TestLoader(object):
- """
- This class is responsible for loading tests according to various criteria
- and returning them wrapped in a TestSuite
- """
- testMethodPrefix = 'test'
- sortTestMethodsUsing = staticmethod(three_way_cmp)
- suiteClass = TestSuite
-
- def loadTestsFromTestCase(self, testCaseClass):
- """Return a suite of all tests cases contained in testCaseClass"""
- if issubclass(testCaseClass, TestSuite):
- raise TypeError("Test cases should not be derived from TestSuite." \
- " Maybe you meant to derive from TestCase?")
- testCaseNames = self.getTestCaseNames(testCaseClass)
- if not testCaseNames and hasattr(testCaseClass, 'runTest'):
- testCaseNames = ['runTest']
- suite = self.suiteClass(map(testCaseClass, testCaseNames))
- return suite
-
- def loadTestsFromModule(self, module):
- """Return a suite of all tests cases contained in the given module"""
- tests = []
- for name in dir(module):
- obj = getattr(module, name)
- if isinstance(obj, type) and issubclass(obj, TestCase):
- tests.append(self.loadTestsFromTestCase(obj))
- return self.suiteClass(tests)
-
- def loadTestsFromName(self, name, module=None):
- """Return a suite of all tests cases given a string specifier.
-
- The name may resolve either to a module, a test case class, a
- test method within a test case class, or a callable object which
- returns a TestCase or TestSuite instance.
-
- The method optionally resolves the names relative to a given module.
- """
- parts = name.split('.')
- if module is None:
- parts_copy = parts[:]
- while parts_copy:
- try:
- module = __import__('.'.join(parts_copy))
- break
- except ImportError:
- del parts_copy[-1]
- if not parts_copy:
- raise
- parts = parts[1:]
- obj = module
- for part in parts:
- parent, obj = obj, getattr(obj, part)
-
- if isinstance(obj, types.ModuleType):
- return self.loadTestsFromModule(obj)
- elif isinstance(obj, type) and issubclass(obj, TestCase):
- return self.loadTestsFromTestCase(obj)
- elif (isinstance(obj, types.FunctionType) and
- isinstance(parent, type) and
- issubclass(parent, TestCase)):
- name = obj.__name__
- inst = parent(name)
- # static methods follow a different path
- if not isinstance(getattr(inst, name), types.FunctionType):
- return TestSuite([inst])
- elif isinstance(obj, TestSuite):
- return obj
-
- if hasattr(obj, '__call__'):
- test = obj()
- if isinstance(test, TestSuite):
- return test
- elif isinstance(test, TestCase):
- return TestSuite([test])
- else:
- raise TypeError("calling %s returned %s, not a test" %
- (obj, test))
- else:
- raise TypeError("don't know how to make test from: %s" % obj)
-
- def loadTestsFromNames(self, names, module=None):
- """Return a suite of all tests cases found using the given sequence
- of string specifiers. See 'loadTestsFromName()'.
- """
- suites = [self.loadTestsFromName(name, module) for name in names]
- return self.suiteClass(suites)
-
- def getTestCaseNames(self, testCaseClass):
- """Return a sorted sequence of method names found within testCaseClass
- """
- def isTestMethod(attrname, testCaseClass=testCaseClass,
- prefix=self.testMethodPrefix):
- return attrname.startswith(prefix) and \
- hasattr(getattr(testCaseClass, attrname), '__call__')
- testFnNames = list(filter(isTestMethod, dir(testCaseClass)))
- if self.sortTestMethodsUsing:
- testFnNames.sort(key=CmpToKey(self.sortTestMethodsUsing))
- return testFnNames
-
-
-
-defaultTestLoader = TestLoader()
-
-
-##############################################################################
-# Patches for old functions: these functions should be considered obsolete
-##############################################################################
-
-def _makeLoader(prefix, sortUsing, suiteClass=None):
- loader = TestLoader()
- loader.sortTestMethodsUsing = sortUsing
- loader.testMethodPrefix = prefix
- if suiteClass: loader.suiteClass = suiteClass
- return loader
-
-def getTestCaseNames(testCaseClass, prefix, sortUsing=three_way_cmp):
- return _makeLoader(prefix, sortUsing).getTestCaseNames(testCaseClass)
-
-def makeSuite(testCaseClass, prefix='test', sortUsing=three_way_cmp,
- suiteClass=TestSuite):
- return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(
- testCaseClass)
-
-def findTestCases(module, prefix='test', sortUsing=three_way_cmp,
- suiteClass=TestSuite):
- return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(
- module)
-
-
-##############################################################################
-# Text UI
-##############################################################################
-
-class _WritelnDecorator(object):
- """Used to decorate file-like objects with a handy 'writeln' method"""
- def __init__(self,stream):
- self.stream = stream
-
- def __getattr__(self, attr):
- return getattr(self.stream,attr)
-
- def writeln(self, arg=None):
- if arg:
- self.write(arg)
- self.write('\n') # text-mode streams translate to \r\n if needed
-
-
-class _TextTestResult(TestResult):
- """A test result class that can print formatted text results to a stream.
-
- Used by TextTestRunner.
- """
- separator1 = '=' * 70
- separator2 = '-' * 70
-
- def __init__(self, stream, descriptions, verbosity):
- super(_TextTestResult, self).__init__()
- self.stream = stream
- self.showAll = verbosity > 1
- self.dots = verbosity == 1
- self.descriptions = descriptions
-
- def getDescription(self, test):
- if self.descriptions:
- return test.shortDescription() or str(test)
- else:
- return str(test)
-
- def startTest(self, test):
- super(_TextTestResult, self).startTest(test)
- if self.showAll:
- self.stream.write(self.getDescription(test))
- self.stream.write(" ... ")
- self.stream.flush()
-
- def addSuccess(self, test):
- super(_TextTestResult, self).addSuccess(test)
- if self.showAll:
- self.stream.writeln("ok")
- elif self.dots:
- self.stream.write('.')
- self.stream.flush()
-
- def addError(self, test, err):
- super(_TextTestResult, self).addError(test, err)
- if self.showAll:
- self.stream.writeln("ERROR")
- elif self.dots:
- self.stream.write('E')
- self.stream.flush()
-
- def addFailure(self, test, err):
- super(_TextTestResult, self).addFailure(test, err)
- if self.showAll:
- self.stream.writeln("FAIL")
- elif self.dots:
- self.stream.write('F')
- self.stream.flush()
-
- def addSkip(self, test, reason):
- super(_TextTestResult, self).addSkip(test, reason)
- if self.showAll:
- self.stream.writeln("skipped {0!r}".format(reason))
- elif self.dots:
- self.stream.write("s")
- self.stream.flush()
-
- def addExpectedFailure(self, test, err):
- super(_TextTestResult, self).addExpectedFailure(test, err)
- if self.showAll:
- self.stream.writeln("expected failure")
- elif self.dots:
- self.stream.write("x")
- self.stream.flush()
-
- def addUnexpectedSuccess(self, test):
- super(_TextTestResult, self).addUnexpectedSuccess(test)
- if self.showAll:
- self.stream.writeln("unexpected success")
- elif self.dots:
- self.stream.write("u")
- self.stream.flush()
-
- def printErrors(self):
- if self.dots or self.showAll:
- self.stream.writeln()
- self.printErrorList('ERROR', self.errors)
- self.printErrorList('FAIL', self.failures)
-
- def printErrorList(self, flavour, errors):
- for test, err in errors:
- self.stream.writeln(self.separator1)
- self.stream.writeln("%s: %s" % (flavour,self.getDescription(test)))
- self.stream.writeln(self.separator2)
- self.stream.writeln("%s" % err)
-
-
-class TextTestRunner(object):
- """A test runner class that displays results in textual form.
-
- It prints out the names of tests as they are run, errors as they
- occur, and a summary of the results at the end of the test run.
- """
- def __init__(self, stream=sys.stderr, descriptions=1, verbosity=1):
- self.stream = _WritelnDecorator(stream)
- self.descriptions = descriptions
- self.verbosity = verbosity
-
- def _makeResult(self):
- return _TextTestResult(self.stream, self.descriptions, self.verbosity)
-
- def run(self, test):
- "Run the given test case or test suite."
- result = self._makeResult()
- startTime = time.time()
- startTestRun = getattr(result, 'startTestRun', None)
- if startTestRun is not None:
- startTestRun()
- try:
- test(result)
- finally:
- stopTestRun = getattr(result, 'stopTestRun', None)
- if stopTestRun is not None:
- stopTestRun()
- stopTime = time.time()
- timeTaken = stopTime - startTime
- result.printErrors()
- self.stream.writeln(result.separator2)
- run = result.testsRun
- self.stream.writeln("Ran %d test%s in %.3fs" %
- (run, run != 1 and "s" or "", timeTaken))
- self.stream.writeln()
- results = map(len, (result.expectedFailures,
- result.unexpectedSuccesses,
- result.skipped))
- expectedFails, unexpectedSuccesses, skipped = results
- infos = []
- if not result.wasSuccessful():
- self.stream.write("FAILED")
- failed, errored = len(result.failures), len(result.errors)
- if failed:
- infos.append("failures=%d" % failed)
- if errored:
- infos.append("errors=%d" % errored)
- else:
- self.stream.write("OK")
- if skipped:
- infos.append("skipped=%d" % skipped)
- if expectedFails:
- infos.append("expected failures=%d" % expectedFails)
- if unexpectedSuccesses:
- infos.append("unexpected successes=%d" % unexpectedSuccesses)
- if infos:
- self.stream.writeln(" (%s)" % (", ".join(infos),))
- else:
- self.stream.write("\n")
- return result
-
-
-
-##############################################################################
-# Facilities for running tests from the command line
-##############################################################################
-
-class TestProgram(object):
- """A command-line program that runs a set of tests; this is primarily
- for making test modules conveniently executable.
- """
- USAGE = """\
-Usage: %(progName)s [options] [test] [...]
-
-Options:
- -h, --help Show this message
- -v, --verbose Verbose output
- -q, --quiet Minimal output
-
-Examples:
- %(progName)s - run default set of tests
- %(progName)s MyTestSuite - run suite 'MyTestSuite'
- %(progName)s MyTestCase.testSomething - run MyTestCase.testSomething
- %(progName)s MyTestCase - run all 'test*' test methods
- in MyTestCase
-"""
- def __init__(self, module='__main__', defaultTest=None,
- argv=None, testRunner=TextTestRunner,
- testLoader=defaultTestLoader, exit=True):
- if isinstance(module, str):
- self.module = __import__(module)
- for part in module.split('.')[1:]:
- self.module = getattr(self.module, part)
- else:
- self.module = module
- if argv is None:
- argv = sys.argv
-
- self.exit = exit
- self.verbosity = 1
- self.defaultTest = defaultTest
- self.testRunner = testRunner
- self.testLoader = testLoader
- self.progName = os.path.basename(argv[0])
- self.parseArgs(argv)
- self.runTests()
-
- def usageExit(self, msg=None):
- if msg:
- print(msg)
- print(self.USAGE % self.__dict__)
- sys.exit(2)
-
- def parseArgs(self, argv):
- import getopt
- long_opts = ['help','verbose','quiet']
- try:
- options, args = getopt.getopt(argv[1:], 'hHvq', long_opts)
- for opt, value in options:
- if opt in ('-h','-H','--help'):
- self.usageExit()
- if opt in ('-q','--quiet'):
- self.verbosity = 0
- if opt in ('-v','--verbose'):
- self.verbosity = 2
- if len(args) == 0 and self.defaultTest is None:
- self.test = self.testLoader.loadTestsFromModule(self.module)
- return
- if len(args) > 0:
- self.testNames = args
- else:
- self.testNames = (self.defaultTest,)
- self.createTests()
- except getopt.error as msg:
- self.usageExit(msg)
-
- def createTests(self):
- self.test = self.testLoader.loadTestsFromNames(self.testNames,
- self.module)
-
- def runTests(self):
- if isinstance(self.testRunner, type):
- try:
- testRunner = self.testRunner(verbosity=self.verbosity)
- except TypeError:
- # didn't accept the verbosity argument
- testRunner = self.testRunner()
- else:
- # it is assumed to be a TestRunner instance
- testRunner = self.testRunner
- self.result = testRunner.run(self.test)
- if self.exit:
- sys.exit(not self.result.wasSuccessful())
-
-main = TestProgram
-
-
-##############################################################################
-# Executing this module from the command line
-##############################################################################
-
-if __name__ == "__main__":
- main(module=None)
diff --git a/Lib/unittest/__init__.py b/Lib/unittest/__init__.py
new file mode 100644
index 0000000000..201a3f0d2d
--- /dev/null
+++ b/Lib/unittest/__init__.py
@@ -0,0 +1,69 @@
+"""
+Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
+Smalltalk testing framework.
+
+This module contains the core framework classes that form the basis of
+specific test cases and suites (TestCase, TestSuite etc.), and also a
+text-based utility class for running the tests and reporting the results
+ (TextTestRunner).
+
+Simple usage:
+
+ import unittest
+
+ class IntegerArithmenticTestCase(unittest.TestCase):
+ def testAdd(self): ## test method names begin 'test*'
+ self.assertEqual((1 + 2), 3)
+ self.assertEqual(0 + 1, 1)
+ def testMultiply(self):
+ self.assertEqual((0 * 10), 0)
+ self.assertEqual((5 * 8), 40)
+
+ if __name__ == '__main__':
+ unittest.main()
+
+Further information is available in the bundled documentation, and from
+
+ http://docs.python.org/library/unittest.html
+
+Copyright (c) 1999-2003 Steve Purcell
+Copyright (c) 2003-2010 Python Software Foundation
+This module is free software, and you may redistribute it and/or modify
+it under the same terms as Python itself, so long as this copyright message
+and disclaimer are retained in their original form.
+
+IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
+AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
+SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+"""
+
+__all__ = ['TestResult', 'TestCase', 'TestSuite',
+ 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',
+ 'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless',
+ 'expectedFailure', 'TextTestResult', 'installHandler',
+ 'registerResult', 'removeResult', 'removeHandler']
+
+# Expose obsolete functions for backwards compatibility
+__all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases'])
+
+__unittest = True
+
+from .result import TestResult
+from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,
+ skipUnless, expectedFailure)
+from .suite import BaseTestSuite, TestSuite
+from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,
+ findTestCases)
+from .main import TestProgram, main
+from .runner import TextTestRunner, TextTestResult
+from .signals import installHandler, registerResult, removeResult, removeHandler
+
+# deprecated
+_TextTestResult = TextTestResult
diff --git a/Lib/unittest/__main__.py b/Lib/unittest/__main__.py
new file mode 100644
index 0000000000..7320050ae9
--- /dev/null
+++ b/Lib/unittest/__main__.py
@@ -0,0 +1,12 @@
+"""Main entry point"""
+
+import sys
+if sys.argv[0].endswith("__main__.py"):
+ sys.argv[0] = "python -m unittest"
+
+__unittest = True
+
+from .main import main, TestProgram, USAGE_AS_MAIN
+TestProgram.USAGE = USAGE_AS_MAIN
+
+main(module=None)
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
new file mode 100644
index 0000000000..3f2f37d32e
--- /dev/null
+++ b/Lib/unittest/case.py
@@ -0,0 +1,1263 @@
+"""Test case implementation"""
+
+import sys
+import functools
+import difflib
+import pprint
+import re
+import warnings
+import collections
+
+from . import result
+from .util import (strclass, safe_repr, sorted_list_difference,
+ unorderable_list_difference, _count_diff_all_purpose,
+ _count_diff_hashable)
+
+__unittest = True
+
+
+DIFF_OMITTED = ('\nDiff is %s characters long. '
+ 'Set self.maxDiff to None to see it.')
+
+class SkipTest(Exception):
+ """
+ Raise this exception in a test to skip it.
+
+ Usually you can use TestResult.skip() or one of the skipping decorators
+ instead of raising this directly.
+ """
+
+class _ExpectedFailure(Exception):
+ """
+ Raise this when a test is expected to fail.
+
+ This is an implementation detail.
+ """
+
+ def __init__(self, exc_info):
+ super(_ExpectedFailure, self).__init__()
+ self.exc_info = exc_info
+
+class _UnexpectedSuccess(Exception):
+ """
+ The test was supposed to fail, but it didn't!
+ """
+
+
+class _Outcome(object):
+ def __init__(self):
+ self.success = True
+ self.skipped = None
+ self.unexpectedSuccess = None
+ self.expectedFailure = None
+ self.errors = []
+ self.failures = []
+
+
+def _id(obj):
+ return obj
+
+def skip(reason):
+ """
+ Unconditionally skip a test.
+ """
+ def decorator(test_item):
+ if not (isinstance(test_item, type) and issubclass(test_item, TestCase)):
+ @functools.wraps(test_item)
+ def skip_wrapper(*args, **kwargs):
+ raise SkipTest(reason)
+ test_item = skip_wrapper
+
+ test_item.__unittest_skip__ = True
+ test_item.__unittest_skip_why__ = reason
+ return test_item
+ return decorator
+
+def skipIf(condition, reason):
+ """
+ Skip a test if the condition is true.
+ """
+ if condition:
+ return skip(reason)
+ return _id
+
+def skipUnless(condition, reason):
+ """
+ Skip a test unless the condition is true.
+ """
+ if not condition:
+ return skip(reason)
+ return _id
+
+
+def expectedFailure(func):
+ @functools.wraps(func)
+ def wrapper(*args, **kwargs):
+ try:
+ func(*args, **kwargs)
+ except Exception:
+ raise _ExpectedFailure(sys.exc_info())
+ raise _UnexpectedSuccess
+ return wrapper
+
+
+class _AssertRaisesBaseContext(object):
+
+ def __init__(self, expected, test_case, callable_obj=None,
+ expected_regex=None):
+ self.expected = expected
+ self.failureException = test_case.failureException
+ if callable_obj is not None:
+ try:
+ self.obj_name = callable_obj.__name__
+ except AttributeError:
+ self.obj_name = str(callable_obj)
+ else:
+ self.obj_name = None
+ if isinstance(expected_regex, (bytes, str)):
+ expected_regex = re.compile(expected_regex)
+ self.expected_regex = expected_regex
+
+
+class _AssertRaisesContext(_AssertRaisesBaseContext):
+ """A context manager used to implement TestCase.assertRaises* methods."""
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, tb):
+ if exc_type is None:
+ try:
+ exc_name = self.expected.__name__
+ except AttributeError:
+ exc_name = str(self.expected)
+ if self.obj_name:
+ raise self.failureException("{0} not raised by {1}"
+ .format(exc_name, self.obj_name))
+ else:
+ raise self.failureException("{0} not raised"
+ .format(exc_name))
+ if not issubclass(exc_type, self.expected):
+ # let unexpected exceptions pass through
+ return False
+ # store exception, without traceback, for later retrieval
+ self.exception = exc_value.with_traceback(None)
+ if self.expected_regex is None:
+ return True
+
+ expected_regex = self.expected_regex
+ if not expected_regex.search(str(exc_value)):
+ raise self.failureException('"%s" does not match "%s"' %
+ (expected_regex.pattern, str(exc_value)))
+ return True
+
+
+class _AssertWarnsContext(_AssertRaisesBaseContext):
+ """A context manager used to implement TestCase.assertWarns* methods."""
+
+ def __enter__(self):
+ # The __warningregistry__'s need to be in a pristine state for tests
+ # to work properly.
+ for v in sys.modules.values():
+ if getattr(v, '__warningregistry__', None):
+ v.__warningregistry__ = {}
+ self.warnings_manager = warnings.catch_warnings(record=True)
+ self.warnings = self.warnings_manager.__enter__()
+ warnings.simplefilter("always", self.expected)
+ return self
+
+ def __exit__(self, exc_type, exc_value, tb):
+ self.warnings_manager.__exit__(exc_type, exc_value, tb)
+ if exc_type is not None:
+ # let unexpected exceptions pass through
+ return
+ try:
+ exc_name = self.expected.__name__
+ except AttributeError:
+ exc_name = str(self.expected)
+ first_matching = None
+ for m in self.warnings:
+ w = m.message
+ if not isinstance(w, self.expected):
+ continue
+ if first_matching is None:
+ first_matching = w
+ if (self.expected_regex is not None and
+ not self.expected_regex.search(str(w))):
+ continue
+ # store warning for later retrieval
+ self.warning = w
+ self.filename = m.filename
+ self.lineno = m.lineno
+ return
+ # Now we simply try to choose a helpful failure message
+ if first_matching is not None:
+ raise self.failureException('"%s" does not match "%s"' %
+ (self.expected_regex.pattern, str(first_matching)))
+ if self.obj_name:
+ raise self.failureException("{0} not triggered by {1}"
+ .format(exc_name, self.obj_name))
+ else:
+ raise self.failureException("{0} not triggered"
+ .format(exc_name))
+
+
+class _TypeEqualityDict(object):
+
+ def __init__(self, testcase):
+ self.testcase = testcase
+ self._store = {}
+
+ def __setitem__(self, key, value):
+ self._store[key] = value
+
+ def __getitem__(self, key):
+ value = self._store[key]
+ if isinstance(value, str):
+ return getattr(self.testcase, value)
+ return value
+
+ def get(self, key, default=None):
+ if key in self._store:
+ return self[key]
+ return default
+
+
+class TestCase(object):
+ """A class whose instances are single test cases.
+
+ By default, the test code itself should be placed in a method named
+ 'runTest'.
+
+ If the fixture may be used for many test cases, create as
+ many test methods as are needed. When instantiating such a TestCase
+ subclass, specify in the constructor arguments the name of the test method
+ that the instance is to execute.
+
+ Test authors should subclass TestCase for their own tests. Construction
+ and deconstruction of the test's environment ('fixture') can be
+ implemented by overriding the 'setUp' and 'tearDown' methods respectively.
+
+ If it is necessary to override the __init__ method, the base class
+ __init__ method must always be called. It is important that subclasses
+ should not change the signature of their __init__ method, since instances
+ of the classes are instantiated automatically by parts of the framework
+ in order to be run.
+ """
+
+ # This attribute determines which exception will be raised when
+ # the instance's assertion methods fail; test methods raising this
+ # exception will be deemed to have 'failed' rather than 'errored'
+
+ failureException = AssertionError
+
+ # This attribute determines whether long messages (including repr of
+ # objects used in assert methods) will be printed on failure in *addition*
+ # to any explicit message passed.
+
+ longMessage = True
+
+ # This attribute sets the maximum length of a diff in failure messages
+ # by assert methods using difflib. It is looked up as an instance attribute
+ # so can be configured by individual tests if required.
+
+ maxDiff = 80*8
+
+ # If a string is longer than _diffThreshold, use normal comparison instead
+ # of difflib. See #11763.
+ _diffThreshold = 2**16
+
+ # Attribute used by TestSuite for classSetUp
+
+ _classSetupFailed = False
+
+ def __init__(self, methodName='runTest'):
+ """Create an instance of the class that will use the named test
+ method when executed. Raises a ValueError if the instance does
+ not have a method with the specified name.
+ """
+ self._testMethodName = methodName
+ self._outcomeForDoCleanups = None
+ self._testMethodDoc = 'No test'
+ try:
+ testMethod = getattr(self, methodName)
+ except AttributeError:
+ if methodName != 'runTest':
+ # we allow instantiation with no explicit method name
+ # but not an *incorrect* or missing method name
+ raise ValueError("no such test method in %s: %s" %
+ (self.__class__, methodName))
+ else:
+ self._testMethodDoc = testMethod.__doc__
+ self._cleanups = []
+
+ # Map types to custom assertEqual functions that will compare
+ # instances of said type in more detail to generate a more useful
+ # error message.
+ self._type_equality_funcs = _TypeEqualityDict(self)
+ self.addTypeEqualityFunc(dict, 'assertDictEqual')
+ self.addTypeEqualityFunc(list, 'assertListEqual')
+ self.addTypeEqualityFunc(tuple, 'assertTupleEqual')
+ self.addTypeEqualityFunc(set, 'assertSetEqual')
+ self.addTypeEqualityFunc(frozenset, 'assertSetEqual')
+ self.addTypeEqualityFunc(str, 'assertMultiLineEqual')
+
+ def addTypeEqualityFunc(self, typeobj, function):
+ """Add a type specific assertEqual style function to compare a type.
+
+ This method is for use by TestCase subclasses that need to register
+ their own type equality functions to provide nicer error messages.
+
+ Args:
+ typeobj: The data type to call this function on when both values
+ are of the same type in assertEqual().
+ function: The callable taking two arguments and an optional
+ msg= argument that raises self.failureException with a
+ useful error message when the two arguments are not equal.
+ """
+ self._type_equality_funcs[typeobj] = function
+
+ def addCleanup(self, function, *args, **kwargs):
+ """Add a function, with arguments, to be called when the test is
+ completed. Functions added are called on a LIFO basis and are
+ called after tearDown on test failure or success.
+
+ Cleanup items are called even if setUp fails (unlike tearDown)."""
+ self._cleanups.append((function, args, kwargs))
+
+ def setUp(self):
+ "Hook method for setting up the test fixture before exercising it."
+ pass
+
+ def tearDown(self):
+ "Hook method for deconstructing the test fixture after testing it."
+ pass
+
+ @classmethod
+ def setUpClass(cls):
+ "Hook method for setting up class fixture before running tests in the class."
+
+ @classmethod
+ def tearDownClass(cls):
+ "Hook method for deconstructing the class fixture after running all tests in the class."
+
+ def countTestCases(self):
+ return 1
+
+ def defaultTestResult(self):
+ return result.TestResult()
+
+ def shortDescription(self):
+ """Returns a one-line description of the test, or None if no
+ description has been provided.
+
+ The default implementation of this method returns the first line of
+ the specified test method's docstring.
+ """
+ doc = self._testMethodDoc
+ return doc and doc.split("\n")[0].strip() or None
+
+
+ def id(self):
+ return "%s.%s" % (strclass(self.__class__), self._testMethodName)
+
+ def __eq__(self, other):
+ if type(self) is not type(other):
+ return NotImplemented
+
+ return self._testMethodName == other._testMethodName
+
+ def __hash__(self):
+ return hash((type(self), self._testMethodName))
+
+ def __str__(self):
+ return "%s (%s)" % (self._testMethodName, strclass(self.__class__))
+
+ def __repr__(self):
+ return "<%s testMethod=%s>" % \
+ (strclass(self.__class__), self._testMethodName)
+
+ def _addSkip(self, result, reason):
+ addSkip = getattr(result, 'addSkip', None)
+ if addSkip is not None:
+ addSkip(self, reason)
+ else:
+ warnings.warn("TestResult has no addSkip method, skips not reported",
+ RuntimeWarning, 2)
+ result.addSuccess(self)
+
+ def _executeTestPart(self, function, outcome, isTest=False):
+ try:
+ function()
+ except KeyboardInterrupt:
+ raise
+ except SkipTest as e:
+ outcome.success = False
+ outcome.skipped = str(e)
+ except _UnexpectedSuccess:
+ exc_info = sys.exc_info()
+ outcome.success = False
+ if isTest:
+ outcome.unexpectedSuccess = exc_info
+ else:
+ outcome.errors.append(exc_info)
+ except _ExpectedFailure:
+ outcome.success = False
+ exc_info = sys.exc_info()
+ if isTest:
+ outcome.expectedFailure = exc_info
+ else:
+ outcome.errors.append(exc_info)
+ except self.failureException:
+ outcome.success = False
+ outcome.failures.append(sys.exc_info())
+ exc_info = sys.exc_info()
+ except:
+ outcome.success = False
+ outcome.errors.append(sys.exc_info())
+
+ def run(self, result=None):
+ orig_result = result
+ if result is None:
+ result = self.defaultTestResult()
+ startTestRun = getattr(result, 'startTestRun', None)
+ if startTestRun is not None:
+ startTestRun()
+
+ result.startTest(self)
+
+ testMethod = getattr(self, self._testMethodName)
+ if (getattr(self.__class__, "__unittest_skip__", False) or
+ getattr(testMethod, "__unittest_skip__", False)):
+ # If the class or method was skipped.
+ try:
+ skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
+ or getattr(testMethod, '__unittest_skip_why__', ''))
+ self._addSkip(result, skip_why)
+ finally:
+ result.stopTest(self)
+ return
+ try:
+ outcome = _Outcome()
+ self._outcomeForDoCleanups = outcome
+
+ self._executeTestPart(self.setUp, outcome)
+ if outcome.success:
+ self._executeTestPart(testMethod, outcome, isTest=True)
+ self._executeTestPart(self.tearDown, outcome)
+
+ self.doCleanups()
+ if outcome.success:
+ result.addSuccess(self)
+ else:
+ if outcome.skipped is not None:
+ self._addSkip(result, outcome.skipped)
+ for exc_info in outcome.errors:
+ result.addError(self, exc_info)
+ for exc_info in outcome.failures:
+ result.addFailure(self, exc_info)
+ if outcome.unexpectedSuccess is not None:
+ addUnexpectedSuccess = getattr(result, 'addUnexpectedSuccess', None)
+ if addUnexpectedSuccess is not None:
+ addUnexpectedSuccess(self)
+ else:
+ warnings.warn("TestResult has no addUnexpectedSuccess method, reporting as failures",
+ RuntimeWarning)
+ result.addFailure(self, outcome.unexpectedSuccess)
+
+ if outcome.expectedFailure is not None:
+ addExpectedFailure = getattr(result, 'addExpectedFailure', None)
+ if addExpectedFailure is not None:
+ addExpectedFailure(self, outcome.expectedFailure)
+ else:
+ warnings.warn("TestResult has no addExpectedFailure method, reporting as passes",
+ RuntimeWarning)
+ result.addSuccess(self)
+
+ finally:
+ result.stopTest(self)
+ if orig_result is None:
+ stopTestRun = getattr(result, 'stopTestRun', None)
+ if stopTestRun is not None:
+ stopTestRun()
+
+ def doCleanups(self):
+ """Execute all cleanup functions. Normally called for you after
+ tearDown."""
+ outcome = self._outcomeForDoCleanups or _Outcome()
+ while self._cleanups:
+ function, args, kwargs = self._cleanups.pop()
+ part = lambda: function(*args, **kwargs)
+ self._executeTestPart(part, outcome)
+
+ # return this for backwards compatibility
+ # even though we no longer us it internally
+ return outcome.success
+
+ def __call__(self, *args, **kwds):
+ return self.run(*args, **kwds)
+
+ def debug(self):
+ """Run the test without collecting errors in a TestResult"""
+ self.setUp()
+ getattr(self, self._testMethodName)()
+ self.tearDown()
+ while self._cleanups:
+ function, args, kwargs = self._cleanups.pop(-1)
+ function(*args, **kwargs)
+
+ def skipTest(self, reason):
+ """Skip this test."""
+ raise SkipTest(reason)
+
+ def fail(self, msg=None):
+ """Fail immediately, with the given message."""
+ raise self.failureException(msg)
+
+ def assertFalse(self, expr, msg=None):
+ """Check that the expression is false."""
+ if expr:
+ msg = self._formatMessage(msg, "%s is not false" % safe_repr(expr))
+ raise self.failureException(msg)
+
+ def assertTrue(self, expr, msg=None):
+ """Check that the expression is true."""
+ if not expr:
+ msg = self._formatMessage(msg, "%s is not true" % safe_repr(expr))
+ raise self.failureException(msg)
+
+ def _formatMessage(self, msg, standardMsg):
+ """Honour the longMessage attribute when generating failure messages.
+ If longMessage is False this means:
+ * Use only an explicit message if it is provided
+ * Otherwise use the standard message for the assert
+
+ If longMessage is True:
+ * Use the standard message
+ * If an explicit message is provided, plus ' : ' and the explicit message
+ """
+ if not self.longMessage:
+ return msg or standardMsg
+ if msg is None:
+ return standardMsg
+ try:
+ # don't switch to '{}' formatting in Python 2.X
+ # it changes the way unicode input is handled
+ return '%s : %s' % (standardMsg, msg)
+ except UnicodeDecodeError:
+ return '%s : %s' % (safe_repr(standardMsg), safe_repr(msg))
+
+
+ def assertRaises(self, excClass, callableObj=None, *args, **kwargs):
+ """Fail unless an exception of class excClass is thrown
+ by callableObj when invoked with arguments args and keyword
+ arguments kwargs. If a different type of exception is
+ thrown, it will not be caught, and the test case will be
+ deemed to have suffered an error, exactly as for an
+ unexpected exception.
+
+ If called with callableObj omitted or None, will return a
+ context object used like this::
+
+ with self.assertRaises(SomeException):
+ do_something()
+
+ The context manager keeps a reference to the exception as
+ the 'exception' attribute. This allows you to inspect the
+ exception after the assertion::
+
+ with self.assertRaises(SomeException) as cm:
+ do_something()
+ the_exception = cm.exception
+ self.assertEqual(the_exception.error_code, 3)
+ """
+ context = _AssertRaisesContext(excClass, self, callableObj)
+ if callableObj is None:
+ return context
+ with context:
+ callableObj(*args, **kwargs)
+
+ def assertWarns(self, expected_warning, callable_obj=None, *args, **kwargs):
+ """Fail unless a warning of class warnClass is triggered
+ by callableObj when invoked with arguments args and keyword
+ arguments kwargs. If a different type of warning is
+ triggered, it will not be handled: depending on the other
+ warning filtering rules in effect, it might be silenced, printed
+ out, or raised as an exception.
+
+ If called with callableObj omitted or None, will return a
+ context object used like this::
+
+ with self.assertWarns(SomeWarning):
+ do_something()
+
+ The context manager keeps a reference to the first matching
+ warning as the 'warning' attribute; similarly, the 'filename'
+ and 'lineno' attributes give you information about the line
+ of Python code from which the warning was triggered.
+ This allows you to inspect the warning after the assertion::
+
+ with self.assertWarns(SomeWarning) as cm:
+ do_something()
+ the_warning = cm.warning
+ self.assertEqual(the_warning.some_attribute, 147)
+ """
+ context = _AssertWarnsContext(expected_warning, self, callable_obj)
+ if callable_obj is None:
+ return context
+ with context:
+ callable_obj(*args, **kwargs)
+
+ def _getAssertEqualityFunc(self, first, second):
+ """Get a detailed comparison function for the types of the two args.
+
+ Returns: A callable accepting (first, second, msg=None) that will
+ raise a failure exception if first != second with a useful human
+ readable error message for those types.
+ """
+ #
+ # NOTE(gregory.p.smith): I considered isinstance(first, type(second))
+ # and vice versa. I opted for the conservative approach in case
+ # subclasses are not intended to be compared in detail to their super
+ # class instances using a type equality func. This means testing
+ # subtypes won't automagically use the detailed comparison. Callers
+ # should use their type specific assertSpamEqual method to compare
+ # subclasses if the detailed comparison is desired and appropriate.
+ # See the discussion in http://bugs.python.org/issue2578.
+ #
+ if type(first) is type(second):
+ asserter = self._type_equality_funcs.get(type(first))
+ if asserter is not None:
+ return asserter
+
+ return self._baseAssertEqual
+
+ def _baseAssertEqual(self, first, second, msg=None):
+ """The default assertEqual implementation, not type specific."""
+ if not first == second:
+ standardMsg = '%s != %s' % (safe_repr(first), safe_repr(second))
+ msg = self._formatMessage(msg, standardMsg)
+ raise self.failureException(msg)
+
+ def assertEqual(self, first, second, msg=None):
+ """Fail if the two objects are unequal as determined by the '=='
+ operator.
+ """
+ assertion_func = self._getAssertEqualityFunc(first, second)
+ assertion_func(first, second, msg=msg)
+
+ def assertNotEqual(self, first, second, msg=None):
+ """Fail if the two objects are equal as determined by the '=='
+ operator.
+ """
+ if not first != second:
+ msg = self._formatMessage(msg, '%s == %s' % (safe_repr(first),
+ safe_repr(second)))
+ raise self.failureException(msg)
+
+ def assertAlmostEqual(self, first, second, places=None, msg=None,
+ delta=None):
+ """Fail if the two objects are unequal as determined by their
+ difference rounded to the given number of decimal places
+ (default 7) and comparing to zero, or by comparing that the
+ between the two objects is more than the given delta.
+
+ Note that decimal places (from zero) are usually not the same
+ as significant digits (measured from the most signficant digit).
+
+ If the two objects compare equal then they will automatically
+ compare almost equal.
+ """
+ if first == second:
+ # shortcut
+ return
+ if delta is not None and places is not None:
+ raise TypeError("specify delta or places not both")
+
+ if delta is not None:
+ if abs(first - second) <= delta:
+ return
+
+ standardMsg = '%s != %s within %s delta' % (safe_repr(first),
+ safe_repr(second),
+ safe_repr(delta))
+ else:
+ if places is None:
+ places = 7
+
+ if round(abs(second-first), places) == 0:
+ return
+
+ standardMsg = '%s != %s within %r places' % (safe_repr(first),
+ safe_repr(second),
+ places)
+ msg = self._formatMessage(msg, standardMsg)
+ raise self.failureException(msg)
+
+ def assertNotAlmostEqual(self, first, second, places=None, msg=None,
+ delta=None):
+ """Fail if the two objects are equal as determined by their
+ difference rounded to the given number of decimal places
+ (default 7) and comparing to zero, or by comparing that the
+ between the two objects is less than the given delta.
+
+ Note that decimal places (from zero) are usually not the same
+ as significant digits (measured from the most signficant digit).
+
+ Objects that are equal automatically fail.
+ """
+ if delta is not None and places is not None:
+ raise TypeError("specify delta or places not both")
+ if delta is not None:
+ if not (first == second) and abs(first - second) > delta:
+ return
+ standardMsg = '%s == %s within %s delta' % (safe_repr(first),
+ safe_repr(second),
+ safe_repr(delta))
+ else:
+ if places is None:
+ places = 7
+ if not (first == second) and round(abs(second-first), places) != 0:
+ return
+ standardMsg = '%s == %s within %r places' % (safe_repr(first),
+ safe_repr(second),
+ places)
+
+ msg = self._formatMessage(msg, standardMsg)
+ raise self.failureException(msg)
+
+
+ def assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None):
+ """An equality assertion for ordered sequences (like lists and tuples).
+
+ For the purposes of this function, a valid ordered sequence type is one
+ which can be indexed, has a length, and has an equality operator.
+
+ Args:
+ seq1: The first sequence to compare.
+ seq2: The second sequence to compare.
+ seq_type: The expected datatype of the sequences, or None if no
+ datatype should be enforced.
+ msg: Optional message to use on failure instead of a list of
+ differences.
+ """
+ if seq_type != None:
+ seq_type_name = seq_type.__name__
+ if not isinstance(seq1, seq_type):
+ raise self.failureException('First sequence is not a %s: %s'
+ % (seq_type_name, safe_repr(seq1)))
+ if not isinstance(seq2, seq_type):
+ raise self.failureException('Second sequence is not a %s: %s'
+ % (seq_type_name, safe_repr(seq2)))
+ else:
+ seq_type_name = "sequence"
+
+ differing = None
+ try:
+ len1 = len(seq1)
+ except (TypeError, NotImplementedError):
+ differing = 'First %s has no length. Non-sequence?' % (
+ seq_type_name)
+
+ if differing is None:
+ try:
+ len2 = len(seq2)
+ except (TypeError, NotImplementedError):
+ differing = 'Second %s has no length. Non-sequence?' % (
+ seq_type_name)
+
+ if differing is None:
+ if seq1 == seq2:
+ return
+
+ seq1_repr = safe_repr(seq1)
+ seq2_repr = safe_repr(seq2)
+ if len(seq1_repr) > 30:
+ seq1_repr = seq1_repr[:30] + '...'
+ if len(seq2_repr) > 30:
+ seq2_repr = seq2_repr[:30] + '...'
+ elements = (seq_type_name.capitalize(), seq1_repr, seq2_repr)
+ differing = '%ss differ: %s != %s\n' % elements
+
+ for i in range(min(len1, len2)):
+ try:
+ item1 = seq1[i]
+ except (TypeError, IndexError, NotImplementedError):
+ differing += ('\nUnable to index element %d of first %s\n' %
+ (i, seq_type_name))
+ break
+
+ try:
+ item2 = seq2[i]
+ except (TypeError, IndexError, NotImplementedError):
+ differing += ('\nUnable to index element %d of second %s\n' %
+ (i, seq_type_name))
+ break
+
+ if item1 != item2:
+ differing += ('\nFirst differing element %d:\n%s\n%s\n' %
+ (i, item1, item2))
+ break
+ else:
+ if (len1 == len2 and seq_type is None and
+ type(seq1) != type(seq2)):
+ # The sequences are the same, but have differing types.
+ return
+
+ if len1 > len2:
+ differing += ('\nFirst %s contains %d additional '
+ 'elements.\n' % (seq_type_name, len1 - len2))
+ try:
+ differing += ('First extra element %d:\n%s\n' %
+ (len2, seq1[len2]))
+ except (TypeError, IndexError, NotImplementedError):
+ differing += ('Unable to index element %d '
+ 'of first %s\n' % (len2, seq_type_name))
+ elif len1 < len2:
+ differing += ('\nSecond %s contains %d additional '
+ 'elements.\n' % (seq_type_name, len2 - len1))
+ try:
+ differing += ('First extra element %d:\n%s\n' %
+ (len1, seq2[len1]))
+ except (TypeError, IndexError, NotImplementedError):
+ differing += ('Unable to index element %d '
+ 'of second %s\n' % (len1, seq_type_name))
+ standardMsg = differing
+ diffMsg = '\n' + '\n'.join(
+ difflib.ndiff(pprint.pformat(seq1).splitlines(),
+ pprint.pformat(seq2).splitlines()))
+
+ standardMsg = self._truncateMessage(standardMsg, diffMsg)
+ msg = self._formatMessage(msg, standardMsg)
+ self.fail(msg)
+
+ def _truncateMessage(self, message, diff):
+ max_diff = self.maxDiff
+ if max_diff is None or len(diff) <= max_diff:
+ return message + diff
+ return message + (DIFF_OMITTED % len(diff))
+
+ def assertListEqual(self, list1, list2, msg=None):
+ """A list-specific equality assertion.
+
+ Args:
+ list1: The first list to compare.
+ list2: The second list to compare.
+ msg: Optional message to use on failure instead of a list of
+ differences.
+
+ """
+ self.assertSequenceEqual(list1, list2, msg, seq_type=list)
+
+ def assertTupleEqual(self, tuple1, tuple2, msg=None):
+ """A tuple-specific equality assertion.
+
+ Args:
+ tuple1: The first tuple to compare.
+ tuple2: The second tuple to compare.
+ msg: Optional message to use on failure instead of a list of
+ differences.
+ """
+ self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple)
+
+ def assertSetEqual(self, set1, set2, msg=None):
+ """A set-specific equality assertion.
+
+ Args:
+ set1: The first set to compare.
+ set2: The second set to compare.
+ msg: Optional message to use on failure instead of a list of
+ differences.
+
+ assertSetEqual uses ducktyping to support different types of sets, and
+ is optimized for sets specifically (parameters must support a
+ difference method).
+ """
+ try:
+ difference1 = set1.difference(set2)
+ except TypeError as e:
+ self.fail('invalid type when attempting set difference: %s' % e)
+ except AttributeError as e:
+ self.fail('first argument does not support set difference: %s' % e)
+
+ try:
+ difference2 = set2.difference(set1)
+ except TypeError as e:
+ self.fail('invalid type when attempting set difference: %s' % e)
+ except AttributeError as e:
+ self.fail('second argument does not support set difference: %s' % e)
+
+ if not (difference1 or difference2):
+ return
+
+ lines = []
+ if difference1:
+ lines.append('Items in the first set but not the second:')
+ for item in difference1:
+ lines.append(repr(item))
+ if difference2:
+ lines.append('Items in the second set but not the first:')
+ for item in difference2:
+ lines.append(repr(item))
+
+ standardMsg = '\n'.join(lines)
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertIn(self, member, container, msg=None):
+ """Just like self.assertTrue(a in b), but with a nicer default message."""
+ if member not in container:
+ standardMsg = '%s not found in %s' % (safe_repr(member),
+ safe_repr(container))
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertNotIn(self, member, container, msg=None):
+ """Just like self.assertTrue(a not in b), but with a nicer default message."""
+ if member in container:
+ standardMsg = '%s unexpectedly found in %s' % (safe_repr(member),
+ safe_repr(container))
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertIs(self, expr1, expr2, msg=None):
+ """Just like self.assertTrue(a is b), but with a nicer default message."""
+ if expr1 is not expr2:
+ standardMsg = '%s is not %s' % (safe_repr(expr1),
+ safe_repr(expr2))
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertIsNot(self, expr1, expr2, msg=None):
+ """Just like self.assertTrue(a is not b), but with a nicer default message."""
+ if expr1 is expr2:
+ standardMsg = 'unexpectedly identical: %s' % (safe_repr(expr1),)
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertDictEqual(self, d1, d2, msg=None):
+ self.assertIsInstance(d1, dict, 'First argument is not a dictionary')
+ self.assertIsInstance(d2, dict, 'Second argument is not a dictionary')
+
+ if d1 != d2:
+ standardMsg = '%s != %s' % (safe_repr(d1, True), safe_repr(d2, True))
+ diff = ('\n' + '\n'.join(difflib.ndiff(
+ pprint.pformat(d1).splitlines(),
+ pprint.pformat(d2).splitlines())))
+ standardMsg = self._truncateMessage(standardMsg, diff)
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertDictContainsSubset(self, subset, dictionary, msg=None):
+ """Checks whether dictionary is a superset of subset."""
+ warnings.warn('assertDictContainsSubset is deprecated',
+ DeprecationWarning)
+ missing = []
+ mismatched = []
+ for key, value in subset.items():
+ if key not in dictionary:
+ missing.append(key)
+ elif value != dictionary[key]:
+ mismatched.append('%s, expected: %s, actual: %s' %
+ (safe_repr(key), safe_repr(value),
+ safe_repr(dictionary[key])))
+
+ if not (missing or mismatched):
+ return
+
+ standardMsg = ''
+ if missing:
+ standardMsg = 'Missing: %s' % ','.join(safe_repr(m) for m in
+ missing)
+ if mismatched:
+ if standardMsg:
+ standardMsg += '; '
+ standardMsg += 'Mismatched values: %s' % ','.join(mismatched)
+
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertSameElements(self, expected_seq, actual_seq, msg=None):
+ """An unordered sequence specific comparison.
+
+ Raises with an error message listing which elements of expected_seq
+ are missing from actual_seq and vice versa if any.
+
+ Duplicate elements are ignored when comparing *expected_seq* and
+ *actual_seq*. It is the equivalent of ``assertEqual(set(expected),
+ set(actual))`` but it works with sequences of unhashable objects as
+ well.
+ """
+ warnings.warn('assertSameElements is deprecated',
+ DeprecationWarning)
+ try:
+ expected = set(expected_seq)
+ actual = set(actual_seq)
+ missing = sorted(expected.difference(actual))
+ unexpected = sorted(actual.difference(expected))
+ except TypeError:
+ # Fall back to slower list-compare if any of the objects are
+ # not hashable.
+ expected = list(expected_seq)
+ actual = list(actual_seq)
+ try:
+ expected.sort()
+ actual.sort()
+ except TypeError:
+ missing, unexpected = unorderable_list_difference(expected,
+ actual)
+ else:
+ missing, unexpected = sorted_list_difference(expected, actual)
+ errors = []
+ if missing:
+ errors.append('Expected, but missing:\n %s' %
+ safe_repr(missing))
+ if unexpected:
+ errors.append('Unexpected, but present:\n %s' %
+ safe_repr(unexpected))
+ if errors:
+ standardMsg = '\n'.join(errors)
+ self.fail(self._formatMessage(msg, standardMsg))
+
+
+ def assertCountEqual(self, first, second, msg=None):
+ """An unordered sequence comparison asserting that the same elements,
+ regardless of order. If the same element occurs more than once,
+ it verifies that the elements occur the same number of times.
+
+ self.assertEqual(Counter(list(first)),
+ Counter(list(second)))
+
+ Example:
+ - [0, 1, 1] and [1, 0, 1] compare equal.
+ - [0, 0, 1] and [0, 1] compare unequal.
+
+ """
+ first_seq, second_seq = list(first), list(second)
+ try:
+ first = collections.Counter(first_seq)
+ second = collections.Counter(second_seq)
+ except TypeError:
+ # Handle case with unhashable elements
+ differences = _count_diff_all_purpose(first_seq, second_seq)
+ else:
+ if first == second:
+ return
+ differences = _count_diff_hashable(first_seq, second_seq)
+
+ if differences:
+ standardMsg = 'Element counts were not equal:\n'
+ lines = ['First has %d, Second has %d: %r' % diff for diff in differences]
+ diffMsg = '\n'.join(lines)
+ standardMsg = self._truncateMessage(standardMsg, diffMsg)
+ msg = self._formatMessage(msg, standardMsg)
+ self.fail(msg)
+
+ def assertMultiLineEqual(self, first, second, msg=None):
+ """Assert that two multi-line strings are equal."""
+ self.assertIsInstance(first, str, 'First argument is not a string')
+ self.assertIsInstance(second, str, 'Second argument is not a string')
+
+ if first != second:
+ # don't use difflib if the strings are too long
+ if (len(first) > self._diffThreshold or
+ len(second) > self._diffThreshold):
+ self._baseAssertEqual(first, second, msg)
+ firstlines = first.splitlines(True)
+ secondlines = second.splitlines(True)
+ if len(firstlines) == 1 and first.strip('\r\n') == first:
+ firstlines = [first + '\n']
+ secondlines = [second + '\n']
+ standardMsg = '%s != %s' % (safe_repr(first, True),
+ safe_repr(second, True))
+ diff = '\n' + ''.join(difflib.ndiff(firstlines, secondlines))
+ standardMsg = self._truncateMessage(standardMsg, diff)
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertLess(self, a, b, msg=None):
+ """Just like self.assertTrue(a < b), but with a nicer default message."""
+ if not a < b:
+ standardMsg = '%s not less than %s' % (safe_repr(a), safe_repr(b))
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertLessEqual(self, a, b, msg=None):
+ """Just like self.assertTrue(a <= b), but with a nicer default message."""
+ if not a <= b:
+ standardMsg = '%s not less than or equal to %s' % (safe_repr(a), safe_repr(b))
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertGreater(self, a, b, msg=None):
+ """Just like self.assertTrue(a > b), but with a nicer default message."""
+ if not a > b:
+ standardMsg = '%s not greater than %s' % (safe_repr(a), safe_repr(b))
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertGreaterEqual(self, a, b, msg=None):
+ """Just like self.assertTrue(a >= b), but with a nicer default message."""
+ if not a >= b:
+ standardMsg = '%s not greater than or equal to %s' % (safe_repr(a), safe_repr(b))
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertIsNone(self, obj, msg=None):
+ """Same as self.assertTrue(obj is None), with a nicer default message."""
+ if obj is not None:
+ standardMsg = '%s is not None' % (safe_repr(obj),)
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertIsNotNone(self, obj, msg=None):
+ """Included for symmetry with assertIsNone."""
+ if obj is None:
+ standardMsg = 'unexpectedly None'
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertIsInstance(self, obj, cls, msg=None):
+ """Same as self.assertTrue(isinstance(obj, cls)), with a nicer
+ default message."""
+ if not isinstance(obj, cls):
+ standardMsg = '%s is not an instance of %r' % (safe_repr(obj), cls)
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertNotIsInstance(self, obj, cls, msg=None):
+ """Included for symmetry with assertIsInstance."""
+ if isinstance(obj, cls):
+ standardMsg = '%s is an instance of %r' % (safe_repr(obj), cls)
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertRaisesRegex(self, expected_exception, expected_regex,
+ callable_obj=None, *args, **kwargs):
+ """Asserts that the message in a raised exception matches a regex.
+
+ Args:
+ expected_exception: Exception class expected to be raised.
+ expected_regex: Regex (re pattern object or string) expected
+ to be found in error message.
+ callable_obj: Function to be called.
+ args: Extra args.
+ kwargs: Extra kwargs.
+ """
+ context = _AssertRaisesContext(expected_exception, self, callable_obj,
+ expected_regex)
+ if callable_obj is None:
+ return context
+ with context:
+ callable_obj(*args, **kwargs)
+
+ def assertWarnsRegex(self, expected_warning, expected_regex,
+ callable_obj=None, *args, **kwargs):
+ """Asserts that the message in a triggered warning matches a regexp.
+ Basic functioning is similar to assertWarns() with the addition
+ that only warnings whose messages also match the regular expression
+ are considered successful matches.
+
+ Args:
+ expected_warning: Warning class expected to be triggered.
+ expected_regex: Regex (re pattern object or string) expected
+ to be found in error message.
+ callable_obj: Function to be called.
+ args: Extra args.
+ kwargs: Extra kwargs.
+ """
+ context = _AssertWarnsContext(expected_warning, self, callable_obj,
+ expected_regex)
+ if callable_obj is None:
+ return context
+ with context:
+ callable_obj(*args, **kwargs)
+
+ def assertRegex(self, text, expected_regex, msg=None):
+ """Fail the test unless the text matches the regular expression."""
+ if isinstance(expected_regex, (str, bytes)):
+ assert expected_regex, "expected_regex must not be empty."
+ expected_regex = re.compile(expected_regex)
+ if not expected_regex.search(text):
+ msg = msg or "Regex didn't match"
+ msg = '%s: %r not found in %r' % (msg, expected_regex.pattern, text)
+ raise self.failureException(msg)
+
+ def assertNotRegex(self, text, unexpected_regex, msg=None):
+ """Fail the test if the text matches the regular expression."""
+ if isinstance(unexpected_regex, (str, bytes)):
+ unexpected_regex = re.compile(unexpected_regex)
+ match = unexpected_regex.search(text)
+ if match:
+ msg = msg or "Regex matched"
+ msg = '%s: %r matches %r in %r' % (msg,
+ text[match.start():match.end()],
+ unexpected_regex.pattern,
+ text)
+ raise self.failureException(msg)
+
+
+ def _deprecate(original_func):
+ def deprecated_func(*args, **kwargs):
+ warnings.warn(
+ 'Please use {0} instead.'.format(original_func.__name__),
+ DeprecationWarning, 2)
+ return original_func(*args, **kwargs)
+ return deprecated_func
+
+ # see #9424
+ failUnlessEqual = assertEquals = _deprecate(assertEqual)
+ failIfEqual = assertNotEquals = _deprecate(assertNotEqual)
+ failUnlessAlmostEqual = assertAlmostEquals = _deprecate(assertAlmostEqual)
+ failIfAlmostEqual = assertNotAlmostEquals = _deprecate(assertNotAlmostEqual)
+ failUnless = assert_ = _deprecate(assertTrue)
+ failUnlessRaises = _deprecate(assertRaises)
+ failIf = _deprecate(assertFalse)
+ assertRaisesRegexp = _deprecate(assertRaisesRegex)
+ assertRegexpMatches = _deprecate(assertRegex)
+
+
+
+class FunctionTestCase(TestCase):
+ """A test case that wraps a test function.
+
+ This is useful for slipping pre-existing test functions into the
+ unittest framework. Optionally, set-up and tidy-up functions can be
+ supplied. As with TestCase, the tidy-up ('tearDown') function will
+ always be called if the set-up ('setUp') function ran successfully.
+ """
+
+ def __init__(self, testFunc, setUp=None, tearDown=None, description=None):
+ super(FunctionTestCase, self).__init__()
+ self._setUpFunc = setUp
+ self._tearDownFunc = tearDown
+ self._testFunc = testFunc
+ self._description = description
+
+ def setUp(self):
+ if self._setUpFunc is not None:
+ self._setUpFunc()
+
+ def tearDown(self):
+ if self._tearDownFunc is not None:
+ self._tearDownFunc()
+
+ def runTest(self):
+ self._testFunc()
+
+ def id(self):
+ return self._testFunc.__name__
+
+ def __eq__(self, other):
+ if not isinstance(other, self.__class__):
+ return NotImplemented
+
+ return self._setUpFunc == other._setUpFunc and \
+ self._tearDownFunc == other._tearDownFunc and \
+ self._testFunc == other._testFunc and \
+ self._description == other._description
+
+ def __ne__(self, other):
+ return not self == other
+
+ def __hash__(self):
+ return hash((type(self), self._setUpFunc, self._tearDownFunc,
+ self._testFunc, self._description))
+
+ def __str__(self):
+ return "%s (%s)" % (strclass(self.__class__),
+ self._testFunc.__name__)
+
+ def __repr__(self):
+ return "<%s tec=%s>" % (strclass(self.__class__),
+ self._testFunc)
+
+ def shortDescription(self):
+ if self._description is not None:
+ return self._description
+ doc = self._testFunc.__doc__
+ return doc and doc.split("\n")[0].strip() or None
diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py
new file mode 100644
index 0000000000..afdff67164
--- /dev/null
+++ b/Lib/unittest/loader.py
@@ -0,0 +1,321 @@
+"""Loading unittests."""
+
+import os
+import re
+import sys
+import traceback
+import types
+import functools
+
+from fnmatch import fnmatch
+
+from . import case, suite, util
+
+__unittest = True
+
+# what about .pyc or .pyo (etc)
+# we would need to avoid loading the same tests multiple times
+# from '.py', '.pyc' *and* '.pyo'
+VALID_MODULE_NAME = re.compile(r'[_a-z]\w*\.py$', re.IGNORECASE)
+
+
+def _make_failed_import_test(name, suiteClass):
+ message = 'Failed to import test module: %s\n%s' % (name, traceback.format_exc())
+ return _make_failed_test('ModuleImportFailure', name, ImportError(message),
+ suiteClass)
+
+def _make_failed_load_tests(name, exception, suiteClass):
+ return _make_failed_test('LoadTestsFailure', name, exception, suiteClass)
+
+def _make_failed_test(classname, methodname, exception, suiteClass):
+ def testFailure(self):
+ raise exception
+ attrs = {methodname: testFailure}
+ TestClass = type(classname, (case.TestCase,), attrs)
+ return suiteClass((TestClass(methodname),))
+
+
+class TestLoader(object):
+ """
+ This class is responsible for loading tests according to various criteria
+ and returning them wrapped in a TestSuite
+ """
+ testMethodPrefix = 'test'
+ sortTestMethodsUsing = staticmethod(util.three_way_cmp)
+ suiteClass = suite.TestSuite
+ _top_level_dir = None
+
+ def loadTestsFromTestCase(self, testCaseClass):
+ """Return a suite of all tests cases contained in testCaseClass"""
+ if issubclass(testCaseClass, suite.TestSuite):
+ raise TypeError("Test cases should not be derived from TestSuite." \
+ " Maybe you meant to derive from TestCase?")
+ testCaseNames = self.getTestCaseNames(testCaseClass)
+ if not testCaseNames and hasattr(testCaseClass, 'runTest'):
+ testCaseNames = ['runTest']
+ loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames))
+ return loaded_suite
+
+ def loadTestsFromModule(self, module, use_load_tests=True):
+ """Return a suite of all tests cases contained in the given module"""
+ tests = []
+ for name in dir(module):
+ obj = getattr(module, name)
+ if isinstance(obj, type) and issubclass(obj, case.TestCase):
+ tests.append(self.loadTestsFromTestCase(obj))
+
+ load_tests = getattr(module, 'load_tests', None)
+ tests = self.suiteClass(tests)
+ if use_load_tests and load_tests is not None:
+ try:
+ return load_tests(self, tests, None)
+ except Exception as e:
+ return _make_failed_load_tests(module.__name__, e,
+ self.suiteClass)
+ return tests
+
+ def loadTestsFromName(self, name, module=None):
+ """Return a suite of all tests cases given a string specifier.
+
+ The name may resolve either to a module, a test case class, a
+ test method within a test case class, or a callable object which
+ returns a TestCase or TestSuite instance.
+
+ The method optionally resolves the names relative to a given module.
+ """
+ parts = name.split('.')
+ if module is None:
+ parts_copy = parts[:]
+ while parts_copy:
+ try:
+ module = __import__('.'.join(parts_copy))
+ break
+ except ImportError:
+ del parts_copy[-1]
+ if not parts_copy:
+ raise
+ parts = parts[1:]
+ obj = module
+ for part in parts:
+ parent, obj = obj, getattr(obj, part)
+
+ if isinstance(obj, types.ModuleType):
+ return self.loadTestsFromModule(obj)
+ elif isinstance(obj, type) and issubclass(obj, case.TestCase):
+ return self.loadTestsFromTestCase(obj)
+ elif (isinstance(obj, types.FunctionType) and
+ isinstance(parent, type) and
+ issubclass(parent, case.TestCase)):
+ name = obj.__name__
+ inst = parent(name)
+ # static methods follow a different path
+ if not isinstance(getattr(inst, name), types.FunctionType):
+ return self.suiteClass([inst])
+ elif isinstance(obj, suite.TestSuite):
+ return obj
+ if hasattr(obj, '__call__'):
+ test = obj()
+ if isinstance(test, suite.TestSuite):
+ return test
+ elif isinstance(test, case.TestCase):
+ return self.suiteClass([test])
+ else:
+ raise TypeError("calling %s returned %s, not a test" %
+ (obj, test))
+ else:
+ raise TypeError("don't know how to make test from: %s" % obj)
+
+ def loadTestsFromNames(self, names, module=None):
+ """Return a suite of all tests cases found using the given sequence
+ of string specifiers. See 'loadTestsFromName()'.
+ """
+ suites = [self.loadTestsFromName(name, module) for name in names]
+ return self.suiteClass(suites)
+
+ def getTestCaseNames(self, testCaseClass):
+ """Return a sorted sequence of method names found within testCaseClass
+ """
+ def isTestMethod(attrname, testCaseClass=testCaseClass,
+ prefix=self.testMethodPrefix):
+ return attrname.startswith(prefix) and \
+ hasattr(getattr(testCaseClass, attrname), '__call__')
+ testFnNames = testFnNames = list(filter(isTestMethod,
+ dir(testCaseClass)))
+ if self.sortTestMethodsUsing:
+ testFnNames.sort(key=functools.cmp_to_key(self.sortTestMethodsUsing))
+ return testFnNames
+
+ def discover(self, start_dir, pattern='test*.py', top_level_dir=None):
+ """Find and return all test modules from the specified start
+ directory, recursing into subdirectories to find them and return all
+ tests found within them. Only test files that match the pattern will
+ be loaded. (Using shell style pattern matching.)
+
+ All test modules must be importable from the top level of the project.
+ If the start directory is not the top level directory then the top
+ level directory must be specified separately.
+
+ If a test package name (directory with '__init__.py') matches the
+ pattern then the package will be checked for a 'load_tests' function. If
+ this exists then it will be called with loader, tests, pattern.
+
+ If load_tests exists then discovery does *not* recurse into the package,
+ load_tests is responsible for loading all tests in the package.
+
+ The pattern is deliberately not stored as a loader attribute so that
+ packages can continue discovery themselves. top_level_dir is stored so
+ load_tests does not need to pass this argument in to loader.discover().
+ """
+ set_implicit_top = False
+ if top_level_dir is None and self._top_level_dir is not None:
+ # make top_level_dir optional if called from load_tests in a package
+ top_level_dir = self._top_level_dir
+ elif top_level_dir is None:
+ set_implicit_top = True
+ top_level_dir = start_dir
+
+ top_level_dir = os.path.abspath(top_level_dir)
+
+ if not top_level_dir in sys.path:
+ # all test modules must be importable from the top level directory
+ # should we *unconditionally* put the start directory in first
+ # in sys.path to minimise likelihood of conflicts between installed
+ # modules and development versions?
+ sys.path.insert(0, top_level_dir)
+ self._top_level_dir = top_level_dir
+
+ is_not_importable = False
+ if os.path.isdir(os.path.abspath(start_dir)):
+ start_dir = os.path.abspath(start_dir)
+ if start_dir != top_level_dir:
+ is_not_importable = not os.path.isfile(os.path.join(start_dir, '__init__.py'))
+ else:
+ # support for discovery from dotted module names
+ try:
+ __import__(start_dir)
+ except ImportError:
+ is_not_importable = True
+ else:
+ the_module = sys.modules[start_dir]
+ top_part = start_dir.split('.')[0]
+ start_dir = os.path.abspath(os.path.dirname((the_module.__file__)))
+ if set_implicit_top:
+ self._top_level_dir = self._get_directory_containing_module(top_part)
+ sys.path.remove(top_level_dir)
+
+ if is_not_importable:
+ raise ImportError('Start directory is not importable: %r' % start_dir)
+
+ tests = list(self._find_tests(start_dir, pattern))
+ return self.suiteClass(tests)
+
+ def _get_directory_containing_module(self, module_name):
+ module = sys.modules[module_name]
+ full_path = os.path.abspath(module.__file__)
+
+ if os.path.basename(full_path).lower().startswith('__init__.py'):
+ return os.path.dirname(os.path.dirname(full_path))
+ else:
+ # here we have been given a module rather than a package - so
+ # all we can do is search the *same* directory the module is in
+ # should an exception be raised instead
+ return os.path.dirname(full_path)
+
+ def _get_name_from_path(self, path):
+ path = os.path.splitext(os.path.normpath(path))[0]
+
+ _relpath = os.path.relpath(path, self._top_level_dir)
+ assert not os.path.isabs(_relpath), "Path must be within the project"
+ assert not _relpath.startswith('..'), "Path must be within the project"
+
+ name = _relpath.replace(os.path.sep, '.')
+ return name
+
+ def _get_module_from_name(self, name):
+ __import__(name)
+ return sys.modules[name]
+
+ def _match_path(self, path, full_path, pattern):
+ # override this method to use alternative matching strategy
+ return fnmatch(path, pattern)
+
+ def _find_tests(self, start_dir, pattern):
+ """Used by discovery. Yields test suites it loads."""
+ paths = os.listdir(start_dir)
+
+ for path in paths:
+ full_path = os.path.join(start_dir, path)
+ if os.path.isfile(full_path):
+ if not VALID_MODULE_NAME.match(path):
+ # valid Python identifiers only
+ continue
+ if not self._match_path(path, full_path, pattern):
+ continue
+ # if the test file matches, load it
+ name = self._get_name_from_path(full_path)
+ try:
+ module = self._get_module_from_name(name)
+ except:
+ yield _make_failed_import_test(name, self.suiteClass)
+ else:
+ mod_file = os.path.abspath(getattr(module, '__file__', full_path))
+ realpath = os.path.splitext(mod_file)[0]
+ fullpath_noext = os.path.splitext(full_path)[0]
+ if realpath.lower() != fullpath_noext.lower():
+ module_dir = os.path.dirname(realpath)
+ mod_name = os.path.splitext(os.path.basename(full_path))[0]
+ expected_dir = os.path.dirname(full_path)
+ msg = ("%r module incorrectly imported from %r. Expected %r. "
+ "Is this module globally installed?")
+ raise ImportError(msg % (mod_name, module_dir, expected_dir))
+ yield self.loadTestsFromModule(module)
+ elif os.path.isdir(full_path):
+ if not os.path.isfile(os.path.join(full_path, '__init__.py')):
+ continue
+
+ load_tests = None
+ tests = None
+ if fnmatch(path, pattern):
+ # only check load_tests if the package directory itself matches the filter
+ name = self._get_name_from_path(full_path)
+ package = self._get_module_from_name(name)
+ load_tests = getattr(package, 'load_tests', None)
+ tests = self.loadTestsFromModule(package, use_load_tests=False)
+
+ if load_tests is None:
+ if tests is not None:
+ # tests loaded from package file
+ yield tests
+ # recurse into the package
+ for test in self._find_tests(full_path, pattern):
+ yield test
+ else:
+ try:
+ yield load_tests(self, tests, pattern)
+ except Exception as e:
+ yield _make_failed_load_tests(package.__name__, e,
+ self.suiteClass)
+
+defaultTestLoader = TestLoader()
+
+
+def _makeLoader(prefix, sortUsing, suiteClass=None):
+ loader = TestLoader()
+ loader.sortTestMethodsUsing = sortUsing
+ loader.testMethodPrefix = prefix
+ if suiteClass:
+ loader.suiteClass = suiteClass
+ return loader
+
+def getTestCaseNames(testCaseClass, prefix, sortUsing=util.three_way_cmp):
+ return _makeLoader(prefix, sortUsing).getTestCaseNames(testCaseClass)
+
+def makeSuite(testCaseClass, prefix='test', sortUsing=util.three_way_cmp,
+ suiteClass=suite.TestSuite):
+ return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(
+ testCaseClass)
+
+def findTestCases(module, prefix='test', sortUsing=util.three_way_cmp,
+ suiteClass=suite.TestSuite):
+ return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(\
+ module)
diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py
new file mode 100644
index 0000000000..55d4e4be14
--- /dev/null
+++ b/Lib/unittest/main.py
@@ -0,0 +1,274 @@
+"""Unittest main program"""
+
+import sys
+import os
+import types
+
+from . import loader, runner
+from .signals import installHandler
+
+__unittest = True
+
+FAILFAST = " -f, --failfast Stop on first failure\n"
+CATCHBREAK = " -c, --catch Catch control-C and display results\n"
+BUFFEROUTPUT = " -b, --buffer Buffer stdout and stderr during test runs\n"
+
+USAGE_AS_MAIN = """\
+Usage: %(progName)s [options] [tests]
+
+Options:
+ -h, --help Show this message
+ -v, --verbose Verbose output
+ -q, --quiet Minimal output
+%(failfast)s%(catchbreak)s%(buffer)s
+Examples:
+ %(progName)s test_module - run tests from test_module
+ %(progName)s module.TestClass - run tests from module.TestClass
+ %(progName)s module.Class.test_method - run specified test method
+
+[tests] can be a list of any number of test modules, classes and test
+methods.
+
+Alternative Usage: %(progName)s discover [options]
+
+Options:
+ -v, --verbose Verbose output
+%(failfast)s%(catchbreak)s%(buffer)s -s directory Directory to start discovery ('.' default)
+ -p pattern Pattern to match test files ('test*.py' default)
+ -t directory Top level directory of project (default to
+ start directory)
+
+For test discovery all test modules must be importable from the top
+level directory of the project.
+"""
+
+USAGE_FROM_MODULE = """\
+Usage: %(progName)s [options] [test] [...]
+
+Options:
+ -h, --help Show this message
+ -v, --verbose Verbose output
+ -q, --quiet Minimal output
+%(failfast)s%(catchbreak)s%(buffer)s
+Examples:
+ %(progName)s - run default set of tests
+ %(progName)s MyTestSuite - run suite 'MyTestSuite'
+ %(progName)s MyTestCase.testSomething - run MyTestCase.testSomething
+ %(progName)s MyTestCase - run all 'test*' test methods
+ in MyTestCase
+"""
+
+def _convert_name(name):
+ # on Linux / Mac OS X 'foo.PY' is not importable, but on
+ # Windows it is. Simpler to do a case insensitive match
+ # a better check would be to check that the name is a
+ # valid Python module name.
+ if os.path.isfile(name) and name.lower().endswith('.py'):
+ if os.path.isabs(name):
+ rel_path = os.path.relpath(name, os.getcwd())
+ if os.path.isabs(rel_path) or rel_path.startswith(os.pardir):
+ return name
+ name = rel_path
+ # on Windows both '\' and '/' are used as path
+ # separators. Better to replace both than rely on os.path.sep
+ return name[:-3].replace('\\', '.').replace('/', '.')
+ return name
+
+def _convert_names(names):
+ return [_convert_name(name) for name in names]
+
+class TestProgram(object):
+ """A command-line program that runs a set of tests; this is primarily
+ for making test modules conveniently executable.
+ """
+ USAGE = USAGE_FROM_MODULE
+
+ # defaults for testing
+ failfast = catchbreak = buffer = progName = warnings = None
+
+ def __init__(self, module='__main__', defaultTest=None, argv=None,
+ testRunner=None, testLoader=loader.defaultTestLoader,
+ exit=True, verbosity=1, failfast=None, catchbreak=None,
+ buffer=None, warnings=None):
+ if isinstance(module, str):
+ self.module = __import__(module)
+ for part in module.split('.')[1:]:
+ self.module = getattr(self.module, part)
+ else:
+ self.module = module
+ if argv is None:
+ argv = sys.argv
+
+ self.exit = exit
+ self.failfast = failfast
+ self.catchbreak = catchbreak
+ self.verbosity = verbosity
+ self.buffer = buffer
+ if warnings is None and not sys.warnoptions:
+ # even if DreprecationWarnings are ignored by default
+ # print them anyway unless other warnings settings are
+ # specified by the warnings arg or the -W python flag
+ self.warnings = 'default'
+ else:
+ # here self.warnings is set either to the value passed
+ # to the warnings args or to None.
+ # If the user didn't pass a value self.warnings will
+ # be None. This means that the behavior is unchanged
+ # and depends on the values passed to -W.
+ self.warnings = warnings
+ self.defaultTest = defaultTest
+ self.testRunner = testRunner
+ self.testLoader = testLoader
+ self.progName = os.path.basename(argv[0])
+ self.parseArgs(argv)
+ self.runTests()
+
+ def usageExit(self, msg=None):
+ if msg:
+ print(msg)
+ usage = {'progName': self.progName, 'catchbreak': '', 'failfast': '',
+ 'buffer': ''}
+ if self.failfast != False:
+ usage['failfast'] = FAILFAST
+ if self.catchbreak != False:
+ usage['catchbreak'] = CATCHBREAK
+ if self.buffer != False:
+ usage['buffer'] = BUFFEROUTPUT
+ print(self.USAGE % usage)
+ sys.exit(2)
+
+ def parseArgs(self, argv):
+ if ((len(argv) > 1 and argv[1].lower() == 'discover') or
+ (len(argv) == 1 and self.module is None)):
+ self._do_discovery(argv[2:])
+ return
+
+ import getopt
+ long_opts = ['help', 'verbose', 'quiet', 'failfast', 'catch', 'buffer']
+ try:
+ options, args = getopt.getopt(argv[1:], 'hHvqfcb', long_opts)
+ except getopt.error as msg:
+ self.usageExit(msg)
+ return
+
+ for opt, value in options:
+ if opt in ('-h','-H','--help'):
+ self.usageExit()
+ if opt in ('-q','--quiet'):
+ self.verbosity = 0
+ if opt in ('-v','--verbose'):
+ self.verbosity = 2
+ if opt in ('-f','--failfast'):
+ if self.failfast is None:
+ self.failfast = True
+ # Should this raise an exception if -f is not valid?
+ if opt in ('-c','--catch'):
+ if self.catchbreak is None:
+ self.catchbreak = True
+ # Should this raise an exception if -c is not valid?
+ if opt in ('-b','--buffer'):
+ if self.buffer is None:
+ self.buffer = True
+ # Should this raise an exception if -b is not valid?
+
+ if len(args) == 0 and self.module is None:
+ # this allows "python -m unittest -v" to still work for
+ # test discovery. This means -c / -b / -v / -f options will
+ # be handled twice, which is harmless but not ideal.
+ self._do_discovery(argv[1:])
+ return
+
+ if len(args) == 0 and self.defaultTest is None:
+ # createTests will load tests from self.module
+ self.testNames = None
+ elif len(args) > 0:
+ self.testNames = _convert_names(args)
+ if __name__ == '__main__':
+ # to support python -m unittest ...
+ self.module = None
+ else:
+ self.testNames = (self.defaultTest,)
+ self.createTests()
+
+ def createTests(self):
+ if self.testNames is None:
+ self.test = self.testLoader.loadTestsFromModule(self.module)
+ else:
+ self.test = self.testLoader.loadTestsFromNames(self.testNames,
+ self.module)
+
+ def _do_discovery(self, argv, Loader=loader.TestLoader):
+ # handle command line args for test discovery
+ self.progName = '%s discover' % self.progName
+ import optparse
+ parser = optparse.OptionParser()
+ parser.prog = self.progName
+ parser.add_option('-v', '--verbose', dest='verbose', default=False,
+ help='Verbose output', action='store_true')
+ if self.failfast != False:
+ parser.add_option('-f', '--failfast', dest='failfast', default=False,
+ help='Stop on first fail or error',
+ action='store_true')
+ if self.catchbreak != False:
+ parser.add_option('-c', '--catch', dest='catchbreak', default=False,
+ help='Catch ctrl-C and display results so far',
+ action='store_true')
+ if self.buffer != False:
+ parser.add_option('-b', '--buffer', dest='buffer', default=False,
+ help='Buffer stdout and stderr during tests',
+ action='store_true')
+ parser.add_option('-s', '--start-directory', dest='start', default='.',
+ help="Directory to start discovery ('.' default)")
+ parser.add_option('-p', '--pattern', dest='pattern', default='test*.py',
+ help="Pattern to match tests ('test*.py' default)")
+ parser.add_option('-t', '--top-level-directory', dest='top', default=None,
+ help='Top level directory of project (defaults to start directory)')
+
+ options, args = parser.parse_args(argv)
+ if len(args) > 3:
+ self.usageExit()
+
+ for name, value in zip(('start', 'pattern', 'top'), args):
+ setattr(options, name, value)
+
+ # only set options from the parsing here
+ # if they weren't set explicitly in the constructor
+ if self.failfast is None:
+ self.failfast = options.failfast
+ if self.catchbreak is None:
+ self.catchbreak = options.catchbreak
+ if self.buffer is None:
+ self.buffer = options.buffer
+
+ if options.verbose:
+ self.verbosity = 2
+
+ start_dir = options.start
+ pattern = options.pattern
+ top_level_dir = options.top
+
+ loader = Loader()
+ self.test = loader.discover(start_dir, pattern, top_level_dir)
+
+ def runTests(self):
+ if self.catchbreak:
+ installHandler()
+ if self.testRunner is None:
+ self.testRunner = runner.TextTestRunner
+ if isinstance(self.testRunner, type):
+ try:
+ testRunner = self.testRunner(verbosity=self.verbosity,
+ failfast=self.failfast,
+ buffer=self.buffer,
+ warnings=self.warnings)
+ except TypeError:
+ # didn't accept the verbosity, buffer or failfast arguments
+ testRunner = self.testRunner()
+ else:
+ # it is assumed to be a TestRunner instance
+ testRunner = self.testRunner
+ self.result = testRunner.run(self.test)
+ if self.exit:
+ sys.exit(not self.result.wasSuccessful())
+
+main = TestProgram
diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py
new file mode 100644
index 0000000000..44bf1862e4
--- /dev/null
+++ b/Lib/unittest/result.py
@@ -0,0 +1,192 @@
+"""Test result object"""
+
+import os
+import io
+import sys
+import traceback
+
+from . import util
+from functools import wraps
+
+__unittest = True
+
+def failfast(method):
+ @wraps(method)
+ def inner(self, *args, **kw):
+ if getattr(self, 'failfast', False):
+ self.stop()
+ return method(self, *args, **kw)
+ return inner
+
+STDOUT_LINE = '\nStdout:\n%s'
+STDERR_LINE = '\nStderr:\n%s'
+
+
+class TestResult(object):
+ """Holder for test result information.
+
+ Test results are automatically managed by the TestCase and TestSuite
+ classes, and do not need to be explicitly manipulated by writers of tests.
+
+ Each instance holds the total number of tests run, and collections of
+ failures and errors that occurred among those test runs. The collections
+ contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
+ formatted traceback of the error that occurred.
+ """
+ _previousTestClass = None
+ _testRunEntered = False
+ _moduleSetUpFailed = False
+ def __init__(self, stream=None, descriptions=None, verbosity=None):
+ self.failfast = False
+ self.failures = []
+ self.errors = []
+ self.testsRun = 0
+ self.skipped = []
+ self.expectedFailures = []
+ self.unexpectedSuccesses = []
+ self.shouldStop = False
+ self.buffer = False
+ self._stdout_buffer = None
+ self._stderr_buffer = None
+ self._original_stdout = sys.stdout
+ self._original_stderr = sys.stderr
+ self._mirrorOutput = False
+
+ def printErrors(self):
+ "Called by TestRunner after test run"
+
+ def startTest(self, test):
+ "Called when the given test is about to be run"
+ self.testsRun += 1
+ self._mirrorOutput = False
+ self._setupStdout()
+
+ def _setupStdout(self):
+ if self.buffer:
+ if self._stderr_buffer is None:
+ self._stderr_buffer = io.StringIO()
+ self._stdout_buffer = io.StringIO()
+ sys.stdout = self._stdout_buffer
+ sys.stderr = self._stderr_buffer
+
+ def startTestRun(self):
+ """Called once before any tests are executed.
+
+ See startTest for a method called before each test.
+ """
+
+ def stopTest(self, test):
+ """Called when the given test has been run"""
+ self._restoreStdout()
+ self._mirrorOutput = False
+
+ def _restoreStdout(self):
+ if self.buffer:
+ if self._mirrorOutput:
+ output = sys.stdout.getvalue()
+ error = sys.stderr.getvalue()
+ if output:
+ if not output.endswith('\n'):
+ output += '\n'
+ self._original_stdout.write(STDOUT_LINE % output)
+ if error:
+ if not error.endswith('\n'):
+ error += '\n'
+ self._original_stderr.write(STDERR_LINE % error)
+
+ sys.stdout = self._original_stdout
+ sys.stderr = self._original_stderr
+ self._stdout_buffer.seek(0)
+ self._stdout_buffer.truncate()
+ self._stderr_buffer.seek(0)
+ self._stderr_buffer.truncate()
+
+ def stopTestRun(self):
+ """Called once after all tests are executed.
+
+ See stopTest for a method called after each test.
+ """
+
+ @failfast
+ def addError(self, test, err):
+ """Called when an error has occurred. 'err' is a tuple of values as
+ returned by sys.exc_info().
+ """
+ self.errors.append((test, self._exc_info_to_string(err, test)))
+ self._mirrorOutput = True
+
+ @failfast
+ def addFailure(self, test, err):
+ """Called when an error has occurred. 'err' is a tuple of values as
+ returned by sys.exc_info()."""
+ self.failures.append((test, self._exc_info_to_string(err, test)))
+ self._mirrorOutput = True
+
+ def addSuccess(self, test):
+ "Called when a test has completed successfully"
+ pass
+
+ def addSkip(self, test, reason):
+ """Called when a test is skipped."""
+ self.skipped.append((test, reason))
+
+ def addExpectedFailure(self, test, err):
+ """Called when an expected failure/error occured."""
+ self.expectedFailures.append(
+ (test, self._exc_info_to_string(err, test)))
+
+ @failfast
+ def addUnexpectedSuccess(self, test):
+ """Called when a test was expected to fail, but succeed."""
+ self.unexpectedSuccesses.append(test)
+
+ def wasSuccessful(self):
+ "Tells whether or not this result was a success"
+ return len(self.failures) == len(self.errors) == 0
+
+ def stop(self):
+ "Indicates that the tests should be aborted"
+ self.shouldStop = True
+
+ def _exc_info_to_string(self, err, test):
+ """Converts a sys.exc_info()-style tuple of values into a string."""
+ exctype, value, tb = err
+ # Skip test runner traceback levels
+ while tb and self._is_relevant_tb_level(tb):
+ tb = tb.tb_next
+
+ if exctype is test.failureException:
+ # Skip assert*() traceback levels
+ length = self._count_relevant_tb_levels(tb)
+ msgLines = traceback.format_exception(exctype, value, tb, length)
+ else:
+ msgLines = traceback.format_exception(exctype, value, tb)
+
+ if self.buffer:
+ output = sys.stdout.getvalue()
+ error = sys.stderr.getvalue()
+ if output:
+ if not output.endswith('\n'):
+ output += '\n'
+ msgLines.append(STDOUT_LINE % output)
+ if error:
+ if not error.endswith('\n'):
+ error += '\n'
+ msgLines.append(STDERR_LINE % error)
+ return ''.join(msgLines)
+
+
+ def _is_relevant_tb_level(self, tb):
+ return '__unittest' in tb.tb_frame.f_globals
+
+ def _count_relevant_tb_levels(self, tb):
+ length = 0
+ while tb and not self._is_relevant_tb_level(tb):
+ length += 1
+ tb = tb.tb_next
+ return length
+
+ def __repr__(self):
+ return ("<%s run=%i errors=%i failures=%i>" %
+ (util.strclass(self.__class__), self.testsRun, len(self.errors),
+ len(self.failures)))
diff --git a/Lib/unittest/runner.py b/Lib/unittest/runner.py
new file mode 100644
index 0000000000..10c4778434
--- /dev/null
+++ b/Lib/unittest/runner.py
@@ -0,0 +1,213 @@
+"""Running tests"""
+
+import sys
+import time
+import warnings
+
+from . import result
+from .signals import registerResult
+
+__unittest = True
+
+
+class _WritelnDecorator(object):
+ """Used to decorate file-like objects with a handy 'writeln' method"""
+ def __init__(self,stream):
+ self.stream = stream
+
+ def __getattr__(self, attr):
+ if attr in ('stream', '__getstate__'):
+ raise AttributeError(attr)
+ return getattr(self.stream,attr)
+
+ def writeln(self, arg=None):
+ if arg:
+ self.write(arg)
+ self.write('\n') # text-mode streams translate to \r\n if needed
+
+
+class TextTestResult(result.TestResult):
+ """A test result class that can print formatted text results to a stream.
+
+ Used by TextTestRunner.
+ """
+ separator1 = '=' * 70
+ separator2 = '-' * 70
+
+ def __init__(self, stream, descriptions, verbosity):
+ super(TextTestResult, self).__init__()
+ self.stream = stream
+ self.showAll = verbosity > 1
+ self.dots = verbosity == 1
+ self.descriptions = descriptions
+
+ def getDescription(self, test):
+ doc_first_line = test.shortDescription()
+ if self.descriptions and doc_first_line:
+ return '\n'.join((str(test), doc_first_line))
+ else:
+ return str(test)
+
+ def startTest(self, test):
+ super(TextTestResult, self).startTest(test)
+ if self.showAll:
+ self.stream.write(self.getDescription(test))
+ self.stream.write(" ... ")
+ self.stream.flush()
+
+ def addSuccess(self, test):
+ super(TextTestResult, self).addSuccess(test)
+ if self.showAll:
+ self.stream.writeln("ok")
+ elif self.dots:
+ self.stream.write('.')
+ self.stream.flush()
+
+ def addError(self, test, err):
+ super(TextTestResult, self).addError(test, err)
+ if self.showAll:
+ self.stream.writeln("ERROR")
+ elif self.dots:
+ self.stream.write('E')
+ self.stream.flush()
+
+ def addFailure(self, test, err):
+ super(TextTestResult, self).addFailure(test, err)
+ if self.showAll:
+ self.stream.writeln("FAIL")
+ elif self.dots:
+ self.stream.write('F')
+ self.stream.flush()
+
+ def addSkip(self, test, reason):
+ super(TextTestResult, self).addSkip(test, reason)
+ if self.showAll:
+ self.stream.writeln("skipped {0!r}".format(reason))
+ elif self.dots:
+ self.stream.write("s")
+ self.stream.flush()
+
+ def addExpectedFailure(self, test, err):
+ super(TextTestResult, self).addExpectedFailure(test, err)
+ if self.showAll:
+ self.stream.writeln("expected failure")
+ elif self.dots:
+ self.stream.write("x")
+ self.stream.flush()
+
+ def addUnexpectedSuccess(self, test):
+ super(TextTestResult, self).addUnexpectedSuccess(test)
+ if self.showAll:
+ self.stream.writeln("unexpected success")
+ elif self.dots:
+ self.stream.write("u")
+ self.stream.flush()
+
+ def printErrors(self):
+ if self.dots or self.showAll:
+ self.stream.writeln()
+ self.printErrorList('ERROR', self.errors)
+ self.printErrorList('FAIL', self.failures)
+
+ def printErrorList(self, flavour, errors):
+ for test, err in errors:
+ self.stream.writeln(self.separator1)
+ self.stream.writeln("%s: %s" % (flavour,self.getDescription(test)))
+ self.stream.writeln(self.separator2)
+ self.stream.writeln("%s" % err)
+
+
+class TextTestRunner(object):
+ """A test runner class that displays results in textual form.
+
+ It prints out the names of tests as they are run, errors as they
+ occur, and a summary of the results at the end of the test run.
+ """
+ resultclass = TextTestResult
+
+ def __init__(self, stream=None, descriptions=True, verbosity=1,
+ failfast=False, buffer=False, resultclass=None, warnings=None):
+ if stream is None:
+ stream = sys.stderr
+ self.stream = _WritelnDecorator(stream)
+ self.descriptions = descriptions
+ self.verbosity = verbosity
+ self.failfast = failfast
+ self.buffer = buffer
+ self.warnings = warnings
+ if resultclass is not None:
+ self.resultclass = resultclass
+
+ def _makeResult(self):
+ return self.resultclass(self.stream, self.descriptions, self.verbosity)
+
+ def run(self, test):
+ "Run the given test case or test suite."
+ result = self._makeResult()
+ registerResult(result)
+ result.failfast = self.failfast
+ result.buffer = self.buffer
+ with warnings.catch_warnings():
+ if self.warnings:
+ # if self.warnings is set, use it to filter all the warnings
+ warnings.simplefilter(self.warnings)
+ # if the filter is 'default' or 'always', special-case the
+ # warnings from the deprecated unittest methods to show them
+ # no more than once per module, because they can be fairly
+ # noisy. The -Wd and -Wa flags can be used to bypass this
+ # only when self.warnings is None.
+ if self.warnings in ['default', 'always']:
+ warnings.filterwarnings('module',
+ category=DeprecationWarning,
+ message='Please use assert\w+ instead.')
+ startTime = time.time()
+ startTestRun = getattr(result, 'startTestRun', None)
+ if startTestRun is not None:
+ startTestRun()
+ try:
+ test(result)
+ finally:
+ stopTestRun = getattr(result, 'stopTestRun', None)
+ if stopTestRun is not None:
+ stopTestRun()
+ stopTime = time.time()
+ timeTaken = stopTime - startTime
+ result.printErrors()
+ if hasattr(result, 'separator2'):
+ self.stream.writeln(result.separator2)
+ run = result.testsRun
+ self.stream.writeln("Ran %d test%s in %.3fs" %
+ (run, run != 1 and "s" or "", timeTaken))
+ self.stream.writeln()
+
+ expectedFails = unexpectedSuccesses = skipped = 0
+ try:
+ results = map(len, (result.expectedFailures,
+ result.unexpectedSuccesses,
+ result.skipped))
+ except AttributeError:
+ pass
+ else:
+ expectedFails, unexpectedSuccesses, skipped = results
+
+ infos = []
+ if not result.wasSuccessful():
+ self.stream.write("FAILED")
+ failed, errored = len(result.failures), len(result.errors)
+ if failed:
+ infos.append("failures=%d" % failed)
+ if errored:
+ infos.append("errors=%d" % errored)
+ else:
+ self.stream.write("OK")
+ if skipped:
+ infos.append("skipped=%d" % skipped)
+ if expectedFails:
+ infos.append("expected failures=%d" % expectedFails)
+ if unexpectedSuccesses:
+ infos.append("unexpected successes=%d" % unexpectedSuccesses)
+ if infos:
+ self.stream.writeln(" (%s)" % (", ".join(infos),))
+ else:
+ self.stream.write("\n")
+ return result
diff --git a/Lib/unittest/signals.py b/Lib/unittest/signals.py
new file mode 100644
index 0000000000..fc31043283
--- /dev/null
+++ b/Lib/unittest/signals.py
@@ -0,0 +1,57 @@
+import signal
+import weakref
+
+from functools import wraps
+
+__unittest = True
+
+
+class _InterruptHandler(object):
+ def __init__(self, default_handler):
+ self.called = False
+ self.default_handler = default_handler
+
+ def __call__(self, signum, frame):
+ installed_handler = signal.getsignal(signal.SIGINT)
+ if installed_handler is not self:
+ # if we aren't the installed handler, then delegate immediately
+ # to the default handler
+ self.default_handler(signum, frame)
+
+ if self.called:
+ self.default_handler(signum, frame)
+ self.called = True
+ for result in _results.keys():
+ result.stop()
+
+_results = weakref.WeakKeyDictionary()
+def registerResult(result):
+ _results[result] = 1
+
+def removeResult(result):
+ return bool(_results.pop(result, None))
+
+_interrupt_handler = None
+def installHandler():
+ global _interrupt_handler
+ if _interrupt_handler is None:
+ default_handler = signal.getsignal(signal.SIGINT)
+ _interrupt_handler = _InterruptHandler(default_handler)
+ signal.signal(signal.SIGINT, _interrupt_handler)
+
+
+def removeHandler(method=None):
+ if method is not None:
+ @wraps(method)
+ def inner(*args, **kwargs):
+ initial = signal.getsignal(signal.SIGINT)
+ removeHandler()
+ try:
+ return method(*args, **kwargs)
+ finally:
+ signal.signal(signal.SIGINT, initial)
+ return inner
+
+ global _interrupt_handler
+ if _interrupt_handler is not None:
+ signal.signal(signal.SIGINT, _interrupt_handler.default_handler)
diff --git a/Lib/unittest/suite.py b/Lib/unittest/suite.py
new file mode 100644
index 0000000000..38bd6b861d
--- /dev/null
+++ b/Lib/unittest/suite.py
@@ -0,0 +1,301 @@
+"""TestSuite"""
+
+import sys
+
+from . import case
+from . import util
+
+__unittest = True
+
+
+def _call_if_exists(parent, attr):
+ func = getattr(parent, attr, lambda: None)
+ func()
+
+
+class BaseTestSuite(object):
+ """A simple test suite that doesn't provide class or module shared fixtures.
+ """
+ def __init__(self, tests=()):
+ self._tests = []
+ self.addTests(tests)
+
+ def __repr__(self):
+ return "<%s tests=%s>" % (util.strclass(self.__class__), list(self))
+
+ def __eq__(self, other):
+ if not isinstance(other, self.__class__):
+ return NotImplemented
+ return list(self) == list(other)
+
+ def __ne__(self, other):
+ return not self == other
+
+ def __iter__(self):
+ return iter(self._tests)
+
+ def countTestCases(self):
+ cases = 0
+ for test in self:
+ cases += test.countTestCases()
+ return cases
+
+ def addTest(self, test):
+ # sanity checks
+ if not hasattr(test, '__call__'):
+ raise TypeError("{} is not callable".format(repr(test)))
+ if isinstance(test, type) and issubclass(test,
+ (case.TestCase, TestSuite)):
+ raise TypeError("TestCases and TestSuites must be instantiated "
+ "before passing them to addTest()")
+ self._tests.append(test)
+
+ def addTests(self, tests):
+ if isinstance(tests, str):
+ raise TypeError("tests must be an iterable of tests, not a string")
+ for test in tests:
+ self.addTest(test)
+
+ def run(self, result):
+ for test in self:
+ if result.shouldStop:
+ break
+ test(result)
+ return result
+
+ def __call__(self, *args, **kwds):
+ return self.run(*args, **kwds)
+
+ def debug(self):
+ """Run the tests without collecting errors in a TestResult"""
+ for test in self:
+ test.debug()
+
+
+class TestSuite(BaseTestSuite):
+ """A test suite is a composite test consisting of a number of TestCases.
+
+ For use, create an instance of TestSuite, then add test case instances.
+ When all tests have been added, the suite can be passed to a test
+ runner, such as TextTestRunner. It will run the individual test cases
+ in the order in which they were added, aggregating the results. When
+ subclassing, do not forget to call the base class constructor.
+ """
+
+ def run(self, result, debug=False):
+ topLevel = False
+ if getattr(result, '_testRunEntered', False) is False:
+ result._testRunEntered = topLevel = True
+
+ for test in self:
+ if result.shouldStop:
+ break
+
+ if _isnotsuite(test):
+ self._tearDownPreviousClass(test, result)
+ self._handleModuleFixture(test, result)
+ self._handleClassSetUp(test, result)
+ result._previousTestClass = test.__class__
+
+ if (getattr(test.__class__, '_classSetupFailed', False) or
+ getattr(result, '_moduleSetUpFailed', False)):
+ continue
+
+ if not debug:
+ test(result)
+ else:
+ test.debug()
+
+ if topLevel:
+ self._tearDownPreviousClass(None, result)
+ self._handleModuleTearDown(result)
+ result._testRunEntered = False
+ return result
+
+ def debug(self):
+ """Run the tests without collecting errors in a TestResult"""
+ debug = _DebugResult()
+ self.run(debug, True)
+
+ ################################
+
+ def _handleClassSetUp(self, test, result):
+ previousClass = getattr(result, '_previousTestClass', None)
+ currentClass = test.__class__
+ if currentClass == previousClass:
+ return
+ if result._moduleSetUpFailed:
+ return
+ if getattr(currentClass, "__unittest_skip__", False):
+ return
+
+ try:
+ currentClass._classSetupFailed = False
+ except TypeError:
+ # test may actually be a function
+ # so its class will be a builtin-type
+ pass
+
+ setUpClass = getattr(currentClass, 'setUpClass', None)
+ if setUpClass is not None:
+ _call_if_exists(result, '_setupStdout')
+ try:
+ setUpClass()
+ except Exception as e:
+ if isinstance(result, _DebugResult):
+ raise
+ currentClass._classSetupFailed = True
+ className = util.strclass(currentClass)
+ errorName = 'setUpClass (%s)' % className
+ self._addClassOrModuleLevelException(result, e, errorName)
+ finally:
+ _call_if_exists(result, '_restoreStdout')
+
+ def _get_previous_module(self, result):
+ previousModule = None
+ previousClass = getattr(result, '_previousTestClass', None)
+ if previousClass is not None:
+ previousModule = previousClass.__module__
+ return previousModule
+
+
+ def _handleModuleFixture(self, test, result):
+ previousModule = self._get_previous_module(result)
+ currentModule = test.__class__.__module__
+ if currentModule == previousModule:
+ return
+
+ self._handleModuleTearDown(result)
+
+
+ result._moduleSetUpFailed = False
+ try:
+ module = sys.modules[currentModule]
+ except KeyError:
+ return
+ setUpModule = getattr(module, 'setUpModule', None)
+ if setUpModule is not None:
+ _call_if_exists(result, '_setupStdout')
+ try:
+ setUpModule()
+ except Exception as e:
+ if isinstance(result, _DebugResult):
+ raise
+ result._moduleSetUpFailed = True
+ errorName = 'setUpModule (%s)' % currentModule
+ self._addClassOrModuleLevelException(result, e, errorName)
+ finally:
+ _call_if_exists(result, '_restoreStdout')
+
+ def _addClassOrModuleLevelException(self, result, exception, errorName):
+ error = _ErrorHolder(errorName)
+ addSkip = getattr(result, 'addSkip', None)
+ if addSkip is not None and isinstance(exception, case.SkipTest):
+ addSkip(error, str(exception))
+ else:
+ result.addError(error, sys.exc_info())
+
+ def _handleModuleTearDown(self, result):
+ previousModule = self._get_previous_module(result)
+ if previousModule is None:
+ return
+ if result._moduleSetUpFailed:
+ return
+
+ try:
+ module = sys.modules[previousModule]
+ except KeyError:
+ return
+
+ tearDownModule = getattr(module, 'tearDownModule', None)
+ if tearDownModule is not None:
+ _call_if_exists(result, '_setupStdout')
+ try:
+ tearDownModule()
+ except Exception as e:
+ if isinstance(result, _DebugResult):
+ raise
+ errorName = 'tearDownModule (%s)' % previousModule
+ self._addClassOrModuleLevelException(result, e, errorName)
+ finally:
+ _call_if_exists(result, '_restoreStdout')
+
+ def _tearDownPreviousClass(self, test, result):
+ previousClass = getattr(result, '_previousTestClass', None)
+ currentClass = test.__class__
+ if currentClass == previousClass:
+ return
+ if getattr(previousClass, '_classSetupFailed', False):
+ return
+ if getattr(result, '_moduleSetUpFailed', False):
+ return
+ if getattr(previousClass, "__unittest_skip__", False):
+ return
+
+ tearDownClass = getattr(previousClass, 'tearDownClass', None)
+ if tearDownClass is not None:
+ _call_if_exists(result, '_setupStdout')
+ try:
+ tearDownClass()
+ except Exception as e:
+ if isinstance(result, _DebugResult):
+ raise
+ className = util.strclass(previousClass)
+ errorName = 'tearDownClass (%s)' % className
+ self._addClassOrModuleLevelException(result, e, errorName)
+ finally:
+ _call_if_exists(result, '_restoreStdout')
+
+
+class _ErrorHolder(object):
+ """
+ Placeholder for a TestCase inside a result. As far as a TestResult
+ is concerned, this looks exactly like a unit test. Used to insert
+ arbitrary errors into a test suite run.
+ """
+ # Inspired by the ErrorHolder from Twisted:
+ # http://twistedmatrix.com/trac/browser/trunk/twisted/trial/runner.py
+
+ # attribute used by TestResult._exc_info_to_string
+ failureException = None
+
+ def __init__(self, description):
+ self.description = description
+
+ def id(self):
+ return self.description
+
+ def shortDescription(self):
+ return None
+
+ def __repr__(self):
+ return "<ErrorHolder description=%r>" % (self.description,)
+
+ def __str__(self):
+ return self.id()
+
+ def run(self, result):
+ # could call result.addError(...) - but this test-like object
+ # shouldn't be run anyway
+ pass
+
+ def __call__(self, result):
+ return self.run(result)
+
+ def countTestCases(self):
+ return 0
+
+def _isnotsuite(test):
+ "A crude way to tell apart testcases and suites with duck-typing"
+ try:
+ iter(test)
+ except TypeError:
+ return True
+ return False
+
+
+class _DebugResult(object):
+ "Used by the TestSuite to hold previous class when running in debug."
+ _previousTestClass = None
+ _moduleSetUpFailed = False
+ shouldStop = False
diff --git a/Lib/unittest/test/__init__.py b/Lib/unittest/test/__init__.py
new file mode 100644
index 0000000000..99b730b154
--- /dev/null
+++ b/Lib/unittest/test/__init__.py
@@ -0,0 +1,21 @@
+import os
+import sys
+import unittest
+
+
+here = os.path.dirname(__file__)
+loader = unittest.defaultTestLoader
+
+def suite():
+ suite = unittest.TestSuite()
+ for fn in os.listdir(here):
+ if fn.startswith("test") and fn.endswith(".py"):
+ modname = "unittest.test." + fn[:-3]
+ __import__(modname)
+ module = sys.modules[modname]
+ suite.addTest(loader.loadTestsFromModule(module))
+ return suite
+
+
+if __name__ == "__main__":
+ unittest.main(defaultTest="suite")
diff --git a/Lib/unittest/test/_test_warnings.py b/Lib/unittest/test/_test_warnings.py
new file mode 100644
index 0000000000..d0be18d4ad
--- /dev/null
+++ b/Lib/unittest/test/_test_warnings.py
@@ -0,0 +1,74 @@
+# helper module for test_runner.Test_TextTestRunner.test_warnings
+
+"""
+This module has a number of tests that raise different kinds of warnings.
+When the tests are run, the warnings are caught and their messages are printed
+to stdout. This module also accepts an arg that is then passed to
+unittest.main to affect the behavior of warnings.
+Test_TextTestRunner.test_warnings executes this script with different
+combinations of warnings args and -W flags and check that the output is correct.
+See #10535.
+"""
+
+import io
+import sys
+import unittest
+import warnings
+
+def warnfun():
+ warnings.warn('rw', RuntimeWarning)
+
+class TestWarnings(unittest.TestCase):
+ # unittest warnings will be printed at most once per type (max one message
+ # for the fail* methods, and one for the assert* methods)
+ def test_assert(self):
+ self.assertEquals(2+2, 4)
+ self.assertEquals(2*2, 4)
+ self.assertEquals(2**2, 4)
+
+ def test_fail(self):
+ self.failUnless(1)
+ self.failUnless(True)
+
+ def test_other_unittest(self):
+ self.assertAlmostEqual(2+2, 4)
+ self.assertNotAlmostEqual(4+4, 2)
+
+ # these warnings are normally silenced, but they are printed in unittest
+ def test_deprecation(self):
+ warnings.warn('dw', DeprecationWarning)
+ warnings.warn('dw', DeprecationWarning)
+ warnings.warn('dw', DeprecationWarning)
+
+ def test_import(self):
+ warnings.warn('iw', ImportWarning)
+ warnings.warn('iw', ImportWarning)
+ warnings.warn('iw', ImportWarning)
+
+ # user warnings should always be printed
+ def test_warning(self):
+ warnings.warn('uw')
+ warnings.warn('uw')
+ warnings.warn('uw')
+
+ # these warnings come from the same place; they will be printed
+ # only once by default or three times if the 'always' filter is used
+ def test_function(self):
+
+ warnfun()
+ warnfun()
+ warnfun()
+
+
+
+if __name__ == '__main__':
+ with warnings.catch_warnings(record=True) as ws:
+ # if an arg is provided pass it to unittest.main as 'warnings'
+ if len(sys.argv) == 2:
+ unittest.main(exit=False, warnings=sys.argv.pop())
+ else:
+ unittest.main(exit=False)
+
+ # print all the warning messages collected
+ for w in ws:
+ print(w.message)
diff --git a/Lib/unittest/test/dummy.py b/Lib/unittest/test/dummy.py
new file mode 100644
index 0000000000..e4f14e4035
--- /dev/null
+++ b/Lib/unittest/test/dummy.py
@@ -0,0 +1 @@
+# Empty module for testing the loading of modules
diff --git a/Lib/unittest/test/support.py b/Lib/unittest/test/support.py
new file mode 100644
index 0000000000..dbe4ddcd0e
--- /dev/null
+++ b/Lib/unittest/test/support.py
@@ -0,0 +1,118 @@
+import unittest
+
+
+class TestEquality(object):
+ """Used as a mixin for TestCase"""
+
+ # Check for a valid __eq__ implementation
+ def test_eq(self):
+ for obj_1, obj_2 in self.eq_pairs:
+ self.assertEqual(obj_1, obj_2)
+ self.assertEqual(obj_2, obj_1)
+
+ # Check for a valid __ne__ implementation
+ def test_ne(self):
+ for obj_1, obj_2 in self.ne_pairs:
+ self.assertNotEqual(obj_1, obj_2)
+ self.assertNotEqual(obj_2, obj_1)
+
+class TestHashing(object):
+ """Used as a mixin for TestCase"""
+
+ # Check for a valid __hash__ implementation
+ def test_hash(self):
+ for obj_1, obj_2 in self.eq_pairs:
+ try:
+ if not hash(obj_1) == hash(obj_2):
+ self.fail("%r and %r do not hash equal" % (obj_1, obj_2))
+ except KeyboardInterrupt:
+ raise
+ except Exception as e:
+ self.fail("Problem hashing %r and %r: %s" % (obj_1, obj_2, e))
+
+ for obj_1, obj_2 in self.ne_pairs:
+ try:
+ if hash(obj_1) == hash(obj_2):
+ self.fail("%s and %s hash equal, but shouldn't" %
+ (obj_1, obj_2))
+ except KeyboardInterrupt:
+ raise
+ except Exception as e:
+ self.fail("Problem hashing %s and %s: %s" % (obj_1, obj_2, e))
+
+
+class LoggingResult(unittest.TestResult):
+ def __init__(self, log):
+ self._events = log
+ super().__init__()
+
+ def startTest(self, test):
+ self._events.append('startTest')
+ super().startTest(test)
+
+ def startTestRun(self):
+ self._events.append('startTestRun')
+ super(LoggingResult, self).startTestRun()
+
+ def stopTest(self, test):
+ self._events.append('stopTest')
+ super().stopTest(test)
+
+ def stopTestRun(self):
+ self._events.append('stopTestRun')
+ super(LoggingResult, self).stopTestRun()
+
+ def addFailure(self, *args):
+ self._events.append('addFailure')
+ super().addFailure(*args)
+
+ def addSuccess(self, *args):
+ self._events.append('addSuccess')
+ super(LoggingResult, self).addSuccess(*args)
+
+ def addError(self, *args):
+ self._events.append('addError')
+ super().addError(*args)
+
+ def addSkip(self, *args):
+ self._events.append('addSkip')
+ super(LoggingResult, self).addSkip(*args)
+
+ def addExpectedFailure(self, *args):
+ self._events.append('addExpectedFailure')
+ super(LoggingResult, self).addExpectedFailure(*args)
+
+ def addUnexpectedSuccess(self, *args):
+ self._events.append('addUnexpectedSuccess')
+ super(LoggingResult, self).addUnexpectedSuccess(*args)
+
+
+class ResultWithNoStartTestRunStopTestRun(object):
+ """An object honouring TestResult before startTestRun/stopTestRun."""
+
+ def __init__(self):
+ self.failures = []
+ self.errors = []
+ self.testsRun = 0
+ self.skipped = []
+ self.expectedFailures = []
+ self.unexpectedSuccesses = []
+ self.shouldStop = False
+
+ def startTest(self, test):
+ pass
+
+ def stopTest(self, test):
+ pass
+
+ def addError(self, test):
+ pass
+
+ def addFailure(self, test):
+ pass
+
+ def addSuccess(self, test):
+ pass
+
+ def wasSuccessful(self):
+ return True
diff --git a/Lib/unittest/test/test_assertions.py b/Lib/unittest/test/test_assertions.py
new file mode 100644
index 0000000000..a1d20ebf2d
--- /dev/null
+++ b/Lib/unittest/test/test_assertions.py
@@ -0,0 +1,286 @@
+import datetime
+import warnings
+import unittest
+
+
+class Test_Assertions(unittest.TestCase):
+ def test_AlmostEqual(self):
+ self.assertAlmostEqual(1.00000001, 1.0)
+ self.assertNotAlmostEqual(1.0000001, 1.0)
+ self.assertRaises(self.failureException,
+ self.assertAlmostEqual, 1.0000001, 1.0)
+ self.assertRaises(self.failureException,
+ self.assertNotAlmostEqual, 1.00000001, 1.0)
+
+ self.assertAlmostEqual(1.1, 1.0, places=0)
+ self.assertRaises(self.failureException,
+ self.assertAlmostEqual, 1.1, 1.0, places=1)
+
+ self.assertAlmostEqual(0, .1+.1j, places=0)
+ self.assertNotAlmostEqual(0, .1+.1j, places=1)
+ self.assertRaises(self.failureException,
+ self.assertAlmostEqual, 0, .1+.1j, places=1)
+ self.assertRaises(self.failureException,
+ self.assertNotAlmostEqual, 0, .1+.1j, places=0)
+
+ self.assertAlmostEqual(float('inf'), float('inf'))
+ self.assertRaises(self.failureException, self.assertNotAlmostEqual,
+ float('inf'), float('inf'))
+
+ def test_AmostEqualWithDelta(self):
+ self.assertAlmostEqual(1.1, 1.0, delta=0.5)
+ self.assertAlmostEqual(1.0, 1.1, delta=0.5)
+ self.assertNotAlmostEqual(1.1, 1.0, delta=0.05)
+ self.assertNotAlmostEqual(1.0, 1.1, delta=0.05)
+
+ self.assertRaises(self.failureException, self.assertAlmostEqual,
+ 1.1, 1.0, delta=0.05)
+ self.assertRaises(self.failureException, self.assertNotAlmostEqual,
+ 1.1, 1.0, delta=0.5)
+
+ self.assertRaises(TypeError, self.assertAlmostEqual,
+ 1.1, 1.0, places=2, delta=2)
+ self.assertRaises(TypeError, self.assertNotAlmostEqual,
+ 1.1, 1.0, places=2, delta=2)
+
+ first = datetime.datetime.now()
+ second = first + datetime.timedelta(seconds=10)
+ self.assertAlmostEqual(first, second,
+ delta=datetime.timedelta(seconds=20))
+ self.assertNotAlmostEqual(first, second,
+ delta=datetime.timedelta(seconds=5))
+
+ def test_assertRaises(self):
+ def _raise(e):
+ raise e
+ self.assertRaises(KeyError, _raise, KeyError)
+ self.assertRaises(KeyError, _raise, KeyError("key"))
+ try:
+ self.assertRaises(KeyError, lambda: None)
+ except self.failureException as e:
+ self.assertIn("KeyError not raised", str(e))
+ else:
+ self.fail("assertRaises() didn't fail")
+ try:
+ self.assertRaises(KeyError, _raise, ValueError)
+ except ValueError:
+ pass
+ else:
+ self.fail("assertRaises() didn't let exception pass through")
+ with self.assertRaises(KeyError) as cm:
+ try:
+ raise KeyError
+ except Exception as e:
+ exc = e
+ raise
+ self.assertIs(cm.exception, exc)
+
+ with self.assertRaises(KeyError):
+ raise KeyError("key")
+ try:
+ with self.assertRaises(KeyError):
+ pass
+ except self.failureException as e:
+ self.assertIn("KeyError not raised", str(e))
+ else:
+ self.fail("assertRaises() didn't fail")
+ try:
+ with self.assertRaises(KeyError):
+ raise ValueError
+ except ValueError:
+ pass
+ else:
+ self.fail("assertRaises() didn't let exception pass through")
+
+ def testAssertNotRegex(self):
+ self.assertNotRegex('Ala ma kota', r'r+')
+ try:
+ self.assertNotRegex('Ala ma kota', r'k.t', 'Message')
+ except self.failureException as e:
+ self.assertIn("'kot'", e.args[0])
+ self.assertIn('Message', e.args[0])
+ else:
+ self.fail('assertNotRegex should have failed.')
+
+
+class TestLongMessage(unittest.TestCase):
+ """Test that the individual asserts honour longMessage.
+ This actually tests all the message behaviour for
+ asserts that use longMessage."""
+
+ def setUp(self):
+ class TestableTestFalse(unittest.TestCase):
+ longMessage = False
+ failureException = self.failureException
+
+ def testTest(self):
+ pass
+
+ class TestableTestTrue(unittest.TestCase):
+ longMessage = True
+ failureException = self.failureException
+
+ def testTest(self):
+ pass
+
+ self.testableTrue = TestableTestTrue('testTest')
+ self.testableFalse = TestableTestFalse('testTest')
+
+ def testDefault(self):
+ self.assertTrue(unittest.TestCase.longMessage)
+
+ def test_formatMsg(self):
+ self.assertEqual(self.testableFalse._formatMessage(None, "foo"), "foo")
+ self.assertEqual(self.testableFalse._formatMessage("foo", "bar"), "foo")
+
+ self.assertEqual(self.testableTrue._formatMessage(None, "foo"), "foo")
+ self.assertEqual(self.testableTrue._formatMessage("foo", "bar"), "bar : foo")
+
+ # This blows up if _formatMessage uses string concatenation
+ self.testableTrue._formatMessage(object(), 'foo')
+
+ def test_formatMessage_unicode_error(self):
+ one = ''.join(chr(i) for i in range(255))
+ # this used to cause a UnicodeDecodeError constructing msg
+ self.testableTrue._formatMessage(one, '\uFFFD')
+
+ def assertMessages(self, methodName, args, errors):
+ def getMethod(i):
+ useTestableFalse = i < 2
+ if useTestableFalse:
+ test = self.testableFalse
+ else:
+ test = self.testableTrue
+ return getattr(test, methodName)
+
+ for i, expected_regex in enumerate(errors):
+ testMethod = getMethod(i)
+ kwargs = {}
+ withMsg = i % 2
+ if withMsg:
+ kwargs = {"msg": "oops"}
+
+ with self.assertRaisesRegex(self.failureException,
+ expected_regex=expected_regex):
+ testMethod(*args, **kwargs)
+
+ def testAssertTrue(self):
+ self.assertMessages('assertTrue', (False,),
+ ["^False is not true$", "^oops$", "^False is not true$",
+ "^False is not true : oops$"])
+
+ def testAssertFalse(self):
+ self.assertMessages('assertFalse', (True,),
+ ["^True is not false$", "^oops$", "^True is not false$",
+ "^True is not false : oops$"])
+
+ def testNotEqual(self):
+ self.assertMessages('assertNotEqual', (1, 1),
+ ["^1 == 1$", "^oops$", "^1 == 1$",
+ "^1 == 1 : oops$"])
+
+ def testAlmostEqual(self):
+ self.assertMessages('assertAlmostEqual', (1, 2),
+ ["^1 != 2 within 7 places$", "^oops$",
+ "^1 != 2 within 7 places$", "^1 != 2 within 7 places : oops$"])
+
+ def testNotAlmostEqual(self):
+ self.assertMessages('assertNotAlmostEqual', (1, 1),
+ ["^1 == 1 within 7 places$", "^oops$",
+ "^1 == 1 within 7 places$", "^1 == 1 within 7 places : oops$"])
+
+ def test_baseAssertEqual(self):
+ self.assertMessages('_baseAssertEqual', (1, 2),
+ ["^1 != 2$", "^oops$", "^1 != 2$", "^1 != 2 : oops$"])
+
+ def testAssertSequenceEqual(self):
+ # Error messages are multiline so not testing on full message
+ # assertTupleEqual and assertListEqual delegate to this method
+ self.assertMessages('assertSequenceEqual', ([], [None]),
+ ["\+ \[None\]$", "^oops$", r"\+ \[None\]$",
+ r"\+ \[None\] : oops$"])
+
+ def testAssertSetEqual(self):
+ self.assertMessages('assertSetEqual', (set(), set([None])),
+ ["None$", "^oops$", "None$",
+ "None : oops$"])
+
+ def testAssertIn(self):
+ self.assertMessages('assertIn', (None, []),
+ ['^None not found in \[\]$', "^oops$",
+ '^None not found in \[\]$',
+ '^None not found in \[\] : oops$'])
+
+ def testAssertNotIn(self):
+ self.assertMessages('assertNotIn', (None, [None]),
+ ['^None unexpectedly found in \[None\]$', "^oops$",
+ '^None unexpectedly found in \[None\]$',
+ '^None unexpectedly found in \[None\] : oops$'])
+
+ def testAssertDictEqual(self):
+ self.assertMessages('assertDictEqual', ({}, {'key': 'value'}),
+ [r"\+ \{'key': 'value'\}$", "^oops$",
+ "\+ \{'key': 'value'\}$",
+ "\+ \{'key': 'value'\} : oops$"])
+
+ def testAssertDictContainsSubset(self):
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+
+ self.assertMessages('assertDictContainsSubset', ({'key': 'value'}, {}),
+ ["^Missing: 'key'$", "^oops$",
+ "^Missing: 'key'$",
+ "^Missing: 'key' : oops$"])
+
+ def testAssertMultiLineEqual(self):
+ self.assertMessages('assertMultiLineEqual', ("", "foo"),
+ [r"\+ foo$", "^oops$",
+ r"\+ foo$",
+ r"\+ foo : oops$"])
+
+ def testAssertLess(self):
+ self.assertMessages('assertLess', (2, 1),
+ ["^2 not less than 1$", "^oops$",
+ "^2 not less than 1$", "^2 not less than 1 : oops$"])
+
+ def testAssertLessEqual(self):
+ self.assertMessages('assertLessEqual', (2, 1),
+ ["^2 not less than or equal to 1$", "^oops$",
+ "^2 not less than or equal to 1$",
+ "^2 not less than or equal to 1 : oops$"])
+
+ def testAssertGreater(self):
+ self.assertMessages('assertGreater', (1, 2),
+ ["^1 not greater than 2$", "^oops$",
+ "^1 not greater than 2$",
+ "^1 not greater than 2 : oops$"])
+
+ def testAssertGreaterEqual(self):
+ self.assertMessages('assertGreaterEqual', (1, 2),
+ ["^1 not greater than or equal to 2$", "^oops$",
+ "^1 not greater than or equal to 2$",
+ "^1 not greater than or equal to 2 : oops$"])
+
+ def testAssertIsNone(self):
+ self.assertMessages('assertIsNone', ('not None',),
+ ["^'not None' is not None$", "^oops$",
+ "^'not None' is not None$",
+ "^'not None' is not None : oops$"])
+
+ def testAssertIsNotNone(self):
+ self.assertMessages('assertIsNotNone', (None,),
+ ["^unexpectedly None$", "^oops$",
+ "^unexpectedly None$",
+ "^unexpectedly None : oops$"])
+
+ def testAssertIs(self):
+ self.assertMessages('assertIs', (None, 'foo'),
+ ["^None is not 'foo'$", "^oops$",
+ "^None is not 'foo'$",
+ "^None is not 'foo' : oops$"])
+
+ def testAssertIsNot(self):
+ self.assertMessages('assertIsNot', (None, None),
+ ["^unexpectedly identical: None$", "^oops$",
+ "^unexpectedly identical: None$",
+ "^unexpectedly identical: None : oops$"])
diff --git a/Lib/unittest/test/test_break.py b/Lib/unittest/test/test_break.py
new file mode 100644
index 0000000000..77ce20143b
--- /dev/null
+++ b/Lib/unittest/test/test_break.py
@@ -0,0 +1,252 @@
+import gc
+import io
+import os
+import sys
+import signal
+import weakref
+
+import unittest
+
+
+@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
+@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
+@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
+ "if threads have been used")
+class TestBreak(unittest.TestCase):
+
+ def setUp(self):
+ self._default_handler = signal.getsignal(signal.SIGINT)
+
+ def tearDown(self):
+ signal.signal(signal.SIGINT, self._default_handler)
+ unittest.signals._results = weakref.WeakKeyDictionary()
+ unittest.signals._interrupt_handler = None
+
+
+ def testInstallHandler(self):
+ default_handler = signal.getsignal(signal.SIGINT)
+ unittest.installHandler()
+ self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler)
+
+ try:
+ pid = os.getpid()
+ os.kill(pid, signal.SIGINT)
+ except KeyboardInterrupt:
+ self.fail("KeyboardInterrupt not handled")
+
+ self.assertTrue(unittest.signals._interrupt_handler.called)
+
+ def testRegisterResult(self):
+ result = unittest.TestResult()
+ unittest.registerResult(result)
+
+ for ref in unittest.signals._results:
+ if ref is result:
+ break
+ elif ref is not result:
+ self.fail("odd object in result set")
+ else:
+ self.fail("result not found")
+
+
+ def testInterruptCaught(self):
+ default_handler = signal.getsignal(signal.SIGINT)
+
+ result = unittest.TestResult()
+ unittest.installHandler()
+ unittest.registerResult(result)
+
+ self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler)
+
+ def test(result):
+ pid = os.getpid()
+ os.kill(pid, signal.SIGINT)
+ result.breakCaught = True
+ self.assertTrue(result.shouldStop)
+
+ try:
+ test(result)
+ except KeyboardInterrupt:
+ self.fail("KeyboardInterrupt not handled")
+ self.assertTrue(result.breakCaught)
+
+
+ def testSecondInterrupt(self):
+ result = unittest.TestResult()
+ unittest.installHandler()
+ unittest.registerResult(result)
+
+ def test(result):
+ pid = os.getpid()
+ os.kill(pid, signal.SIGINT)
+ result.breakCaught = True
+ self.assertTrue(result.shouldStop)
+ os.kill(pid, signal.SIGINT)
+ self.fail("Second KeyboardInterrupt not raised")
+
+ try:
+ test(result)
+ except KeyboardInterrupt:
+ pass
+ else:
+ self.fail("Second KeyboardInterrupt not raised")
+ self.assertTrue(result.breakCaught)
+
+
+ def testTwoResults(self):
+ unittest.installHandler()
+
+ result = unittest.TestResult()
+ unittest.registerResult(result)
+ new_handler = signal.getsignal(signal.SIGINT)
+
+ result2 = unittest.TestResult()
+ unittest.registerResult(result2)
+ self.assertEqual(signal.getsignal(signal.SIGINT), new_handler)
+
+ result3 = unittest.TestResult()
+
+ def test(result):
+ pid = os.getpid()
+ os.kill(pid, signal.SIGINT)
+
+ try:
+ test(result)
+ except KeyboardInterrupt:
+ self.fail("KeyboardInterrupt not handled")
+
+ self.assertTrue(result.shouldStop)
+ self.assertTrue(result2.shouldStop)
+ self.assertFalse(result3.shouldStop)
+
+
+ def testHandlerReplacedButCalled(self):
+ # If our handler has been replaced (is no longer installed) but is
+ # called by the *new* handler, then it isn't safe to delay the
+ # SIGINT and we should immediately delegate to the default handler
+ unittest.installHandler()
+
+ handler = signal.getsignal(signal.SIGINT)
+ def new_handler(frame, signum):
+ handler(frame, signum)
+ signal.signal(signal.SIGINT, new_handler)
+
+ try:
+ pid = os.getpid()
+ os.kill(pid, signal.SIGINT)
+ except KeyboardInterrupt:
+ pass
+ else:
+ self.fail("replaced but delegated handler doesn't raise interrupt")
+
+ def testRunner(self):
+ # Creating a TextTestRunner with the appropriate argument should
+ # register the TextTestResult it creates
+ runner = unittest.TextTestRunner(stream=io.StringIO())
+
+ result = runner.run(unittest.TestSuite())
+ self.assertIn(result, unittest.signals._results)
+
+ def testWeakReferences(self):
+ # Calling registerResult on a result should not keep it alive
+ result = unittest.TestResult()
+ unittest.registerResult(result)
+
+ ref = weakref.ref(result)
+ del result
+
+ # For non-reference counting implementations
+ gc.collect();gc.collect()
+ self.assertIsNone(ref())
+
+
+ def testRemoveResult(self):
+ result = unittest.TestResult()
+ unittest.registerResult(result)
+
+ unittest.installHandler()
+ self.assertTrue(unittest.removeResult(result))
+
+ # Should this raise an error instead?
+ self.assertFalse(unittest.removeResult(unittest.TestResult()))
+
+ try:
+ pid = os.getpid()
+ os.kill(pid, signal.SIGINT)
+ except KeyboardInterrupt:
+ pass
+
+ self.assertFalse(result.shouldStop)
+
+ def testMainInstallsHandler(self):
+ failfast = object()
+ test = object()
+ verbosity = object()
+ result = object()
+ default_handler = signal.getsignal(signal.SIGINT)
+
+ class FakeRunner(object):
+ initArgs = []
+ runArgs = []
+ def __init__(self, *args, **kwargs):
+ self.initArgs.append((args, kwargs))
+ def run(self, test):
+ self.runArgs.append(test)
+ return result
+
+ class Program(unittest.TestProgram):
+ def __init__(self, catchbreak):
+ self.exit = False
+ self.verbosity = verbosity
+ self.failfast = failfast
+ self.catchbreak = catchbreak
+ self.testRunner = FakeRunner
+ self.test = test
+ self.result = None
+
+ p = Program(False)
+ p.runTests()
+
+ self.assertEqual(FakeRunner.initArgs, [((), {'buffer': None,
+ 'verbosity': verbosity,
+ 'failfast': failfast,
+ 'warnings': None})])
+ self.assertEqual(FakeRunner.runArgs, [test])
+ self.assertEqual(p.result, result)
+
+ self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
+
+ FakeRunner.initArgs = []
+ FakeRunner.runArgs = []
+ p = Program(True)
+ p.runTests()
+
+ self.assertEqual(FakeRunner.initArgs, [((), {'buffer': None,
+ 'verbosity': verbosity,
+ 'failfast': failfast,
+ 'warnings': None})])
+ self.assertEqual(FakeRunner.runArgs, [test])
+ self.assertEqual(p.result, result)
+
+ self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler)
+
+ def testRemoveHandler(self):
+ default_handler = signal.getsignal(signal.SIGINT)
+ unittest.installHandler()
+ unittest.removeHandler()
+ self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
+
+ # check that calling removeHandler multiple times has no ill-effect
+ unittest.removeHandler()
+ self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
+
+ def testRemoveHandlerAsDecorator(self):
+ default_handler = signal.getsignal(signal.SIGINT)
+ unittest.installHandler()
+
+ @unittest.removeHandler
+ def test():
+ self.assertEqual(signal.getsignal(signal.SIGINT), default_handler)
+
+ test()
+ self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler)
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py
new file mode 100644
index 0000000000..c74a539515
--- /dev/null
+++ b/Lib/unittest/test/test_case.py
@@ -0,0 +1,1270 @@
+import difflib
+import pprint
+import pickle
+import re
+import sys
+import warnings
+import inspect
+
+from copy import deepcopy
+from test import support
+
+import unittest
+
+from .support import (
+ TestEquality, TestHashing, LoggingResult,
+ ResultWithNoStartTestRunStopTestRun
+)
+
+
+class Test(object):
+ "Keep these TestCase classes out of the main namespace"
+
+ class Foo(unittest.TestCase):
+ def runTest(self): pass
+ def test1(self): pass
+
+ class Bar(Foo):
+ def test2(self): pass
+
+ class LoggingTestCase(unittest.TestCase):
+ """A test case which logs its calls."""
+
+ def __init__(self, events):
+ super(Test.LoggingTestCase, self).__init__('test')
+ self.events = events
+
+ def setUp(self):
+ self.events.append('setUp')
+
+ def test(self):
+ self.events.append('test')
+
+ def tearDown(self):
+ self.events.append('tearDown')
+
+
+class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
+
+ ### Set up attributes used by inherited tests
+ ################################################################
+
+ # Used by TestHashing.test_hash and TestEquality.test_eq
+ eq_pairs = [(Test.Foo('test1'), Test.Foo('test1'))]
+
+ # Used by TestEquality.test_ne
+ ne_pairs = [(Test.Foo('test1'), Test.Foo('runTest')),
+ (Test.Foo('test1'), Test.Bar('test1')),
+ (Test.Foo('test1'), Test.Bar('test2'))]
+
+ ################################################################
+ ### /Set up attributes used by inherited tests
+
+
+ # "class TestCase([methodName])"
+ # ...
+ # "Each instance of TestCase will run a single test method: the
+ # method named methodName."
+ # ...
+ # "methodName defaults to "runTest"."
+ #
+ # Make sure it really is optional, and that it defaults to the proper
+ # thing.
+ def test_init__no_test_name(self):
+ class Test(unittest.TestCase):
+ def runTest(self): raise MyException()
+ def test(self): pass
+
+ self.assertEqual(Test().id()[-13:], '.Test.runTest')
+
+ # test that TestCase can be instantiated with no args
+ # primarily for use at the interactive interpreter
+ test = unittest.TestCase()
+ test.assertEqual(3, 3)
+ with test.assertRaises(test.failureException):
+ test.assertEqual(3, 2)
+
+ with self.assertRaises(AttributeError):
+ test.run()
+
+ # "class TestCase([methodName])"
+ # ...
+ # "Each instance of TestCase will run a single test method: the
+ # method named methodName."
+ def test_init__test_name__valid(self):
+ class Test(unittest.TestCase):
+ def runTest(self): raise MyException()
+ def test(self): pass
+
+ self.assertEqual(Test('test').id()[-10:], '.Test.test')
+
+ # "class TestCase([methodName])"
+ # ...
+ # "Each instance of TestCase will run a single test method: the
+ # method named methodName."
+ def test_init__test_name__invalid(self):
+ class Test(unittest.TestCase):
+ def runTest(self): raise MyException()
+ def test(self): pass
+
+ try:
+ Test('testfoo')
+ except ValueError:
+ pass
+ else:
+ self.fail("Failed to raise ValueError")
+
+ # "Return the number of tests represented by the this test object. For
+ # TestCase instances, this will always be 1"
+ def test_countTestCases(self):
+ class Foo(unittest.TestCase):
+ def test(self): pass
+
+ self.assertEqual(Foo('test').countTestCases(), 1)
+
+ # "Return the default type of test result object to be used to run this
+ # test. For TestCase instances, this will always be
+ # unittest.TestResult; subclasses of TestCase should
+ # override this as necessary."
+ def test_defaultTestResult(self):
+ class Foo(unittest.TestCase):
+ def runTest(self):
+ pass
+
+ result = Foo().defaultTestResult()
+ self.assertEqual(type(result), unittest.TestResult)
+
+ # "When a setUp() method is defined, the test runner will run that method
+ # prior to each test. Likewise, if a tearDown() method is defined, the
+ # test runner will invoke that method after each test. In the example,
+ # setUp() was used to create a fresh sequence for each test."
+ #
+ # Make sure the proper call order is maintained, even if setUp() raises
+ # an exception.
+ def test_run_call_order__error_in_setUp(self):
+ events = []
+ result = LoggingResult(events)
+
+ class Foo(Test.LoggingTestCase):
+ def setUp(self):
+ super(Foo, self).setUp()
+ raise RuntimeError('raised by Foo.setUp')
+
+ Foo(events).run(result)
+ expected = ['startTest', 'setUp', 'addError', 'stopTest']
+ self.assertEqual(events, expected)
+
+ # "With a temporary result stopTestRun is called when setUp errors.
+ def test_run_call_order__error_in_setUp_default_result(self):
+ events = []
+
+ class Foo(Test.LoggingTestCase):
+ def defaultTestResult(self):
+ return LoggingResult(self.events)
+
+ def setUp(self):
+ super(Foo, self).setUp()
+ raise RuntimeError('raised by Foo.setUp')
+
+ Foo(events).run()
+ expected = ['startTestRun', 'startTest', 'setUp', 'addError',
+ 'stopTest', 'stopTestRun']
+ self.assertEqual(events, expected)
+
+ # "When a setUp() method is defined, the test runner will run that method
+ # prior to each test. Likewise, if a tearDown() method is defined, the
+ # test runner will invoke that method after each test. In the example,
+ # setUp() was used to create a fresh sequence for each test."
+ #
+ # Make sure the proper call order is maintained, even if the test raises
+ # an error (as opposed to a failure).
+ def test_run_call_order__error_in_test(self):
+ events = []
+ result = LoggingResult(events)
+
+ class Foo(Test.LoggingTestCase):
+ def test(self):
+ super(Foo, self).test()
+ raise RuntimeError('raised by Foo.test')
+
+ expected = ['startTest', 'setUp', 'test', 'tearDown',
+ 'addError', 'stopTest']
+ Foo(events).run(result)
+ self.assertEqual(events, expected)
+
+ # "With a default result, an error in the test still results in stopTestRun
+ # being called."
+ def test_run_call_order__error_in_test_default_result(self):
+ events = []
+
+ class Foo(Test.LoggingTestCase):
+ def defaultTestResult(self):
+ return LoggingResult(self.events)
+
+ def test(self):
+ super(Foo, self).test()
+ raise RuntimeError('raised by Foo.test')
+
+ expected = ['startTestRun', 'startTest', 'setUp', 'test',
+ 'tearDown', 'addError', 'stopTest', 'stopTestRun']
+ Foo(events).run()
+ self.assertEqual(events, expected)
+
+ # "When a setUp() method is defined, the test runner will run that method
+ # prior to each test. Likewise, if a tearDown() method is defined, the
+ # test runner will invoke that method after each test. In the example,
+ # setUp() was used to create a fresh sequence for each test."
+ #
+ # Make sure the proper call order is maintained, even if the test signals
+ # a failure (as opposed to an error).
+ def test_run_call_order__failure_in_test(self):
+ events = []
+ result = LoggingResult(events)
+
+ class Foo(Test.LoggingTestCase):
+ def test(self):
+ super(Foo, self).test()
+ self.fail('raised by Foo.test')
+
+ expected = ['startTest', 'setUp', 'test', 'tearDown',
+ 'addFailure', 'stopTest']
+ Foo(events).run(result)
+ self.assertEqual(events, expected)
+
+ # "When a test fails with a default result stopTestRun is still called."
+ def test_run_call_order__failure_in_test_default_result(self):
+
+ class Foo(Test.LoggingTestCase):
+ def defaultTestResult(self):
+ return LoggingResult(self.events)
+ def test(self):
+ super(Foo, self).test()
+ self.fail('raised by Foo.test')
+
+ expected = ['startTestRun', 'startTest', 'setUp', 'test',
+ 'tearDown', 'addFailure', 'stopTest', 'stopTestRun']
+ events = []
+ Foo(events).run()
+ self.assertEqual(events, expected)
+
+ # "When a setUp() method is defined, the test runner will run that method
+ # prior to each test. Likewise, if a tearDown() method is defined, the
+ # test runner will invoke that method after each test. In the example,
+ # setUp() was used to create a fresh sequence for each test."
+ #
+ # Make sure the proper call order is maintained, even if tearDown() raises
+ # an exception.
+ def test_run_call_order__error_in_tearDown(self):
+ events = []
+ result = LoggingResult(events)
+
+ class Foo(Test.LoggingTestCase):
+ def tearDown(self):
+ super(Foo, self).tearDown()
+ raise RuntimeError('raised by Foo.tearDown')
+
+ Foo(events).run(result)
+ expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError',
+ 'stopTest']
+ self.assertEqual(events, expected)
+
+ # "When tearDown errors with a default result stopTestRun is still called."
+ def test_run_call_order__error_in_tearDown_default_result(self):
+
+ class Foo(Test.LoggingTestCase):
+ def defaultTestResult(self):
+ return LoggingResult(self.events)
+ def tearDown(self):
+ super(Foo, self).tearDown()
+ raise RuntimeError('raised by Foo.tearDown')
+
+ events = []
+ Foo(events).run()
+ expected = ['startTestRun', 'startTest', 'setUp', 'test', 'tearDown',
+ 'addError', 'stopTest', 'stopTestRun']
+ self.assertEqual(events, expected)
+
+ # "TestCase.run() still works when the defaultTestResult is a TestResult
+ # that does not support startTestRun and stopTestRun.
+ def test_run_call_order_default_result(self):
+
+ class Foo(unittest.TestCase):
+ def defaultTestResult(self):
+ return ResultWithNoStartTestRunStopTestRun()
+ def test(self):
+ pass
+
+ Foo('test').run()
+
+ # "This class attribute gives the exception raised by the test() method.
+ # If a test framework needs to use a specialized exception, possibly to
+ # carry additional information, it must subclass this exception in
+ # order to ``play fair'' with the framework. The initial value of this
+ # attribute is AssertionError"
+ def test_failureException__default(self):
+ class Foo(unittest.TestCase):
+ def test(self):
+ pass
+
+ self.assertTrue(Foo('test').failureException is AssertionError)
+
+ # "This class attribute gives the exception raised by the test() method.
+ # If a test framework needs to use a specialized exception, possibly to
+ # carry additional information, it must subclass this exception in
+ # order to ``play fair'' with the framework."
+ #
+ # Make sure TestCase.run() respects the designated failureException
+ def test_failureException__subclassing__explicit_raise(self):
+ events = []
+ result = LoggingResult(events)
+
+ class Foo(unittest.TestCase):
+ def test(self):
+ raise RuntimeError()
+
+ failureException = RuntimeError
+
+ self.assertTrue(Foo('test').failureException is RuntimeError)
+
+
+ Foo('test').run(result)
+ expected = ['startTest', 'addFailure', 'stopTest']
+ self.assertEqual(events, expected)
+
+ # "This class attribute gives the exception raised by the test() method.
+ # If a test framework needs to use a specialized exception, possibly to
+ # carry additional information, it must subclass this exception in
+ # order to ``play fair'' with the framework."
+ #
+ # Make sure TestCase.run() respects the designated failureException
+ def test_failureException__subclassing__implicit_raise(self):
+ events = []
+ result = LoggingResult(events)
+
+ class Foo(unittest.TestCase):
+ def test(self):
+ self.fail("foo")
+
+ failureException = RuntimeError
+
+ self.assertTrue(Foo('test').failureException is RuntimeError)
+
+
+ Foo('test').run(result)
+ expected = ['startTest', 'addFailure', 'stopTest']
+ self.assertEqual(events, expected)
+
+ # "The default implementation does nothing."
+ def test_setUp(self):
+ class Foo(unittest.TestCase):
+ def runTest(self):
+ pass
+
+ # ... and nothing should happen
+ Foo().setUp()
+
+ # "The default implementation does nothing."
+ def test_tearDown(self):
+ class Foo(unittest.TestCase):
+ def runTest(self):
+ pass
+
+ # ... and nothing should happen
+ Foo().tearDown()
+
+ # "Return a string identifying the specific test case."
+ #
+ # Because of the vague nature of the docs, I'm not going to lock this
+ # test down too much. Really all that can be asserted is that the id()
+ # will be a string (either 8-byte or unicode -- again, because the docs
+ # just say "string")
+ def test_id(self):
+ class Foo(unittest.TestCase):
+ def runTest(self):
+ pass
+
+ self.assertIsInstance(Foo().id(), str)
+
+
+ # "If result is omitted or None, a temporary result object is created
+ # and used, but is not made available to the caller. As TestCase owns the
+ # temporary result startTestRun and stopTestRun are called.
+
+ def test_run__uses_defaultTestResult(self):
+ events = []
+
+ class Foo(unittest.TestCase):
+ def test(self):
+ events.append('test')
+
+ def defaultTestResult(self):
+ return LoggingResult(events)
+
+ # Make run() find a result object on its own
+ Foo('test').run()
+
+ expected = ['startTestRun', 'startTest', 'test', 'addSuccess',
+ 'stopTest', 'stopTestRun']
+ self.assertEqual(events, expected)
+
+ def testShortDescriptionWithoutDocstring(self):
+ self.assertIsNone(self.shortDescription())
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def testShortDescriptionWithOneLineDocstring(self):
+ """Tests shortDescription() for a method with a docstring."""
+ self.assertEqual(
+ self.shortDescription(),
+ 'Tests shortDescription() for a method with a docstring.')
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def testShortDescriptionWithMultiLineDocstring(self):
+ """Tests shortDescription() for a method with a longer docstring.
+
+ This method ensures that only the first line of a docstring is
+ returned used in the short description, no matter how long the
+ whole thing is.
+ """
+ self.assertEqual(
+ self.shortDescription(),
+ 'Tests shortDescription() for a method with a longer '
+ 'docstring.')
+
+ def testAddTypeEqualityFunc(self):
+ class SadSnake(object):
+ """Dummy class for test_addTypeEqualityFunc."""
+ s1, s2 = SadSnake(), SadSnake()
+ self.assertFalse(s1 == s2)
+ def AllSnakesCreatedEqual(a, b, msg=None):
+ return type(a) == type(b) == SadSnake
+ self.addTypeEqualityFunc(SadSnake, AllSnakesCreatedEqual)
+ self.assertEqual(s1, s2)
+ # No this doesn't clean up and remove the SadSnake equality func
+ # from this TestCase instance but since its a local nothing else
+ # will ever notice that.
+
+ def testAssertIs(self):
+ thing = object()
+ self.assertIs(thing, thing)
+ self.assertRaises(self.failureException, self.assertIs, thing, object())
+
+ def testAssertIsNot(self):
+ thing = object()
+ self.assertIsNot(thing, object())
+ self.assertRaises(self.failureException, self.assertIsNot, thing, thing)
+
+ def testAssertIsInstance(self):
+ thing = []
+ self.assertIsInstance(thing, list)
+ self.assertRaises(self.failureException, self.assertIsInstance,
+ thing, dict)
+
+ def testAssertNotIsInstance(self):
+ thing = []
+ self.assertNotIsInstance(thing, dict)
+ self.assertRaises(self.failureException, self.assertNotIsInstance,
+ thing, list)
+
+ def testAssertIn(self):
+ animals = {'monkey': 'banana', 'cow': 'grass', 'seal': 'fish'}
+
+ self.assertIn('a', 'abc')
+ self.assertIn(2, [1, 2, 3])
+ self.assertIn('monkey', animals)
+
+ self.assertNotIn('d', 'abc')
+ self.assertNotIn(0, [1, 2, 3])
+ self.assertNotIn('otter', animals)
+
+ self.assertRaises(self.failureException, self.assertIn, 'x', 'abc')
+ self.assertRaises(self.failureException, self.assertIn, 4, [1, 2, 3])
+ self.assertRaises(self.failureException, self.assertIn, 'elephant',
+ animals)
+
+ self.assertRaises(self.failureException, self.assertNotIn, 'c', 'abc')
+ self.assertRaises(self.failureException, self.assertNotIn, 1, [1, 2, 3])
+ self.assertRaises(self.failureException, self.assertNotIn, 'cow',
+ animals)
+
+ def testAssertDictContainsSubset(self):
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+
+ self.assertDictContainsSubset({}, {})
+ self.assertDictContainsSubset({}, {'a': 1})
+ self.assertDictContainsSubset({'a': 1}, {'a': 1})
+ self.assertDictContainsSubset({'a': 1}, {'a': 1, 'b': 2})
+ self.assertDictContainsSubset({'a': 1, 'b': 2}, {'a': 1, 'b': 2})
+
+ with self.assertRaises(self.failureException):
+ self.assertDictContainsSubset({1: "one"}, {})
+
+ with self.assertRaises(self.failureException):
+ self.assertDictContainsSubset({'a': 2}, {'a': 1})
+
+ with self.assertRaises(self.failureException):
+ self.assertDictContainsSubset({'c': 1}, {'a': 1})
+
+ with self.assertRaises(self.failureException):
+ self.assertDictContainsSubset({'a': 1, 'c': 1}, {'a': 1})
+
+ with self.assertRaises(self.failureException):
+ self.assertDictContainsSubset({'a': 1, 'c': 1}, {'a': 1})
+
+ one = ''.join(chr(i) for i in range(255))
+ # this used to cause a UnicodeDecodeError constructing the failure msg
+ with self.assertRaises(self.failureException):
+ self.assertDictContainsSubset({'foo': one}, {'foo': '\uFFFD'})
+
+ def testAssertEqual(self):
+ equal_pairs = [
+ ((), ()),
+ ({}, {}),
+ ([], []),
+ (set(), set()),
+ (frozenset(), frozenset())]
+ for a, b in equal_pairs:
+ # This mess of try excepts is to test the assertEqual behavior
+ # itself.
+ try:
+ self.assertEqual(a, b)
+ except self.failureException:
+ self.fail('assertEqual(%r, %r) failed' % (a, b))
+ try:
+ self.assertEqual(a, b, msg='foo')
+ except self.failureException:
+ self.fail('assertEqual(%r, %r) with msg= failed' % (a, b))
+ try:
+ self.assertEqual(a, b, 'foo')
+ except self.failureException:
+ self.fail('assertEqual(%r, %r) with third parameter failed' %
+ (a, b))
+
+ unequal_pairs = [
+ ((), []),
+ ({}, set()),
+ (set([4,1]), frozenset([4,2])),
+ (frozenset([4,5]), set([2,3])),
+ (set([3,4]), set([5,4]))]
+ for a, b in unequal_pairs:
+ self.assertRaises(self.failureException, self.assertEqual, a, b)
+ self.assertRaises(self.failureException, self.assertEqual, a, b,
+ 'foo')
+ self.assertRaises(self.failureException, self.assertEqual, a, b,
+ msg='foo')
+
+ def testEquality(self):
+ self.assertListEqual([], [])
+ self.assertTupleEqual((), ())
+ self.assertSequenceEqual([], ())
+
+ a = [0, 'a', []]
+ b = []
+ self.assertRaises(unittest.TestCase.failureException,
+ self.assertListEqual, a, b)
+ self.assertRaises(unittest.TestCase.failureException,
+ self.assertListEqual, tuple(a), tuple(b))
+ self.assertRaises(unittest.TestCase.failureException,
+ self.assertSequenceEqual, a, tuple(b))
+
+ b.extend(a)
+ self.assertListEqual(a, b)
+ self.assertTupleEqual(tuple(a), tuple(b))
+ self.assertSequenceEqual(a, tuple(b))
+ self.assertSequenceEqual(tuple(a), b)
+
+ self.assertRaises(self.failureException, self.assertListEqual,
+ a, tuple(b))
+ self.assertRaises(self.failureException, self.assertTupleEqual,
+ tuple(a), b)
+ self.assertRaises(self.failureException, self.assertListEqual, None, b)
+ self.assertRaises(self.failureException, self.assertTupleEqual, None,
+ tuple(b))
+ self.assertRaises(self.failureException, self.assertSequenceEqual,
+ None, tuple(b))
+ self.assertRaises(self.failureException, self.assertListEqual, 1, 1)
+ self.assertRaises(self.failureException, self.assertTupleEqual, 1, 1)
+ self.assertRaises(self.failureException, self.assertSequenceEqual,
+ 1, 1)
+
+ self.assertDictEqual({}, {})
+
+ c = { 'x': 1 }
+ d = {}
+ self.assertRaises(unittest.TestCase.failureException,
+ self.assertDictEqual, c, d)
+
+ d.update(c)
+ self.assertDictEqual(c, d)
+
+ d['x'] = 0
+ self.assertRaises(unittest.TestCase.failureException,
+ self.assertDictEqual, c, d, 'These are unequal')
+
+ self.assertRaises(self.failureException, self.assertDictEqual, None, d)
+ self.assertRaises(self.failureException, self.assertDictEqual, [], d)
+ self.assertRaises(self.failureException, self.assertDictEqual, 1, 1)
+
+ def testAssertSequenceEqualMaxDiff(self):
+ self.assertEqual(self.maxDiff, 80*8)
+ seq1 = 'a' + 'x' * 80**2
+ seq2 = 'b' + 'x' * 80**2
+ diff = '\n'.join(difflib.ndiff(pprint.pformat(seq1).splitlines(),
+ pprint.pformat(seq2).splitlines()))
+ # the +1 is the leading \n added by assertSequenceEqual
+ omitted = unittest.case.DIFF_OMITTED % (len(diff) + 1,)
+
+ self.maxDiff = len(diff)//2
+ try:
+
+ self.assertSequenceEqual(seq1, seq2)
+ except self.failureException as e:
+ msg = e.args[0]
+ else:
+ self.fail('assertSequenceEqual did not fail.')
+ self.assertTrue(len(msg) < len(diff))
+ self.assertIn(omitted, msg)
+
+ self.maxDiff = len(diff) * 2
+ try:
+ self.assertSequenceEqual(seq1, seq2)
+ except self.failureException as e:
+ msg = e.args[0]
+ else:
+ self.fail('assertSequenceEqual did not fail.')
+ self.assertTrue(len(msg) > len(diff))
+ self.assertNotIn(omitted, msg)
+
+ self.maxDiff = None
+ try:
+ self.assertSequenceEqual(seq1, seq2)
+ except self.failureException as e:
+ msg = e.args[0]
+ else:
+ self.fail('assertSequenceEqual did not fail.')
+ self.assertTrue(len(msg) > len(diff))
+ self.assertNotIn(omitted, msg)
+
+ def testTruncateMessage(self):
+ self.maxDiff = 1
+ message = self._truncateMessage('foo', 'bar')
+ omitted = unittest.case.DIFF_OMITTED % len('bar')
+ self.assertEqual(message, 'foo' + omitted)
+
+ self.maxDiff = None
+ message = self._truncateMessage('foo', 'bar')
+ self.assertEqual(message, 'foobar')
+
+ self.maxDiff = 4
+ message = self._truncateMessage('foo', 'bar')
+ self.assertEqual(message, 'foobar')
+
+ def testAssertDictEqualTruncates(self):
+ test = unittest.TestCase('assertEqual')
+ def truncate(msg, diff):
+ return 'foo'
+ test._truncateMessage = truncate
+ try:
+ test.assertDictEqual({}, {1: 0})
+ except self.failureException as e:
+ self.assertEqual(str(e), 'foo')
+ else:
+ self.fail('assertDictEqual did not fail')
+
+ def testAssertMultiLineEqualTruncates(self):
+ test = unittest.TestCase('assertEqual')
+ def truncate(msg, diff):
+ return 'foo'
+ test._truncateMessage = truncate
+ try:
+ test.assertMultiLineEqual('foo', 'bar')
+ except self.failureException as e:
+ self.assertEqual(str(e), 'foo')
+ else:
+ self.fail('assertMultiLineEqual did not fail')
+
+ def testAssertEqual_diffThreshold(self):
+ # check threshold value
+ self.assertEqual(self._diffThreshold, 2**16)
+ # disable madDiff to get diff markers
+ self.maxDiff = None
+
+ # set a lower threshold value and add a cleanup to restore it
+ old_threshold = self._diffThreshold
+ self._diffThreshold = 2**8
+ self.addCleanup(lambda: setattr(self, '_diffThreshold', old_threshold))
+
+ # under the threshold: diff marker (^) in error message
+ s = 'x' * (2**7)
+ with self.assertRaises(self.failureException) as cm:
+ self.assertEqual(s + 'a', s + 'b')
+ self.assertIn('^', str(cm.exception))
+ self.assertEqual(s + 'a', s + 'a')
+
+ # over the threshold: diff not used and marker (^) not in error message
+ s = 'x' * (2**9)
+ # if the path that uses difflib is taken, _truncateMessage will be
+ # called -- replace it with explodingTruncation to verify that this
+ # doesn't happen
+ def explodingTruncation(message, diff):
+ raise SystemError('this should not be raised')
+ old_truncate = self._truncateMessage
+ self._truncateMessage = explodingTruncation
+ self.addCleanup(lambda: setattr(self, '_truncateMessage', old_truncate))
+
+ s1, s2 = s + 'a', s + 'b'
+ with self.assertRaises(self.failureException) as cm:
+ self.assertEqual(s1, s2)
+ self.assertNotIn('^', str(cm.exception))
+ self.assertEqual(str(cm.exception), '%r != %r' % (s1, s2))
+ self.assertEqual(s + 'a', s + 'a')
+
+ def testAssertCountEqual(self):
+ a = object()
+ self.assertCountEqual([1, 2, 3], [3, 2, 1])
+ self.assertCountEqual(['foo', 'bar', 'baz'], ['bar', 'baz', 'foo'])
+ self.assertCountEqual([a, a, 2, 2, 3], (a, 2, 3, a, 2))
+ self.assertCountEqual([1, "2", "a", "a"], ["a", "2", True, "a"])
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [1, 2] + [3] * 100, [1] * 100 + [2, 3])
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [1, "2", "a", "a"], ["a", "2", True, 1])
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [10], [10, 11])
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [10, 11], [10])
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [10, 11, 10], [10, 11])
+
+ # Test that sequences of unhashable objects can be tested for sameness:
+ self.assertCountEqual([[1, 2], [3, 4], 0], [False, [3, 4], [1, 2]])
+ # Test that iterator of unhashable objects can be tested for sameness:
+ self.assertCountEqual(iter([1, 2, [], 3, 4]),
+ iter([1, 2, [], 3, 4]))
+
+ # hashable types, but not orderable
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [], [divmod, 'x', 1, 5j, 2j, frozenset()])
+ # comparing dicts
+ self.assertCountEqual([{'a': 1}, {'b': 2}], [{'b': 2}, {'a': 1}])
+ # comparing heterogenous non-hashable sequences
+ self.assertCountEqual([1, 'x', divmod, []], [divmod, [], 'x', 1])
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [], [divmod, [], 'x', 1, 5j, 2j, set()])
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [[1]], [[2]])
+
+ # Same elements, but not same sequence length
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [1, 1, 2], [2, 1])
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [1, 1, "2", "a", "a"], ["2", "2", True, "a"])
+ self.assertRaises(self.failureException, self.assertCountEqual,
+ [1, {'b': 2}, None, True], [{'b': 2}, True, None])
+
+ # Same elements which don't reliably compare, in
+ # different order, see issue 10242
+ a = [{2,4}, {1,2}]
+ b = a[::-1]
+ self.assertCountEqual(a, b)
+
+ # test utility functions supporting assertCountEqual()
+
+ diffs = set(unittest.util._count_diff_all_purpose('aaabccd', 'abbbcce'))
+ expected = {(3,1,'a'), (1,3,'b'), (1,0,'d'), (0,1,'e')}
+ self.assertEqual(diffs, expected)
+
+ diffs = unittest.util._count_diff_all_purpose([[]], [])
+ self.assertEqual(diffs, [(1, 0, [])])
+
+ diffs = set(unittest.util._count_diff_hashable('aaabccd', 'abbbcce'))
+ expected = {(3,1,'a'), (1,3,'b'), (1,0,'d'), (0,1,'e')}
+ self.assertEqual(diffs, expected)
+
+ def testAssertSetEqual(self):
+ set1 = set()
+ set2 = set()
+ self.assertSetEqual(set1, set2)
+
+ self.assertRaises(self.failureException, self.assertSetEqual, None, set2)
+ self.assertRaises(self.failureException, self.assertSetEqual, [], set2)
+ self.assertRaises(self.failureException, self.assertSetEqual, set1, None)
+ self.assertRaises(self.failureException, self.assertSetEqual, set1, [])
+
+ set1 = set(['a'])
+ set2 = set()
+ self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
+
+ set1 = set(['a'])
+ set2 = set(['a'])
+ self.assertSetEqual(set1, set2)
+
+ set1 = set(['a'])
+ set2 = set(['a', 'b'])
+ self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
+
+ set1 = set(['a'])
+ set2 = frozenset(['a', 'b'])
+ self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
+
+ set1 = set(['a', 'b'])
+ set2 = frozenset(['a', 'b'])
+ self.assertSetEqual(set1, set2)
+
+ set1 = set()
+ set2 = "foo"
+ self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
+ self.assertRaises(self.failureException, self.assertSetEqual, set2, set1)
+
+ # make sure any string formatting is tuple-safe
+ set1 = set([(0, 1), (2, 3)])
+ set2 = set([(4, 5)])
+ self.assertRaises(self.failureException, self.assertSetEqual, set1, set2)
+
+ def testInequality(self):
+ # Try ints
+ self.assertGreater(2, 1)
+ self.assertGreaterEqual(2, 1)
+ self.assertGreaterEqual(1, 1)
+ self.assertLess(1, 2)
+ self.assertLessEqual(1, 2)
+ self.assertLessEqual(1, 1)
+ self.assertRaises(self.failureException, self.assertGreater, 1, 2)
+ self.assertRaises(self.failureException, self.assertGreater, 1, 1)
+ self.assertRaises(self.failureException, self.assertGreaterEqual, 1, 2)
+ self.assertRaises(self.failureException, self.assertLess, 2, 1)
+ self.assertRaises(self.failureException, self.assertLess, 1, 1)
+ self.assertRaises(self.failureException, self.assertLessEqual, 2, 1)
+
+ # Try Floats
+ self.assertGreater(1.1, 1.0)
+ self.assertGreaterEqual(1.1, 1.0)
+ self.assertGreaterEqual(1.0, 1.0)
+ self.assertLess(1.0, 1.1)
+ self.assertLessEqual(1.0, 1.1)
+ self.assertLessEqual(1.0, 1.0)
+ self.assertRaises(self.failureException, self.assertGreater, 1.0, 1.1)
+ self.assertRaises(self.failureException, self.assertGreater, 1.0, 1.0)
+ self.assertRaises(self.failureException, self.assertGreaterEqual, 1.0, 1.1)
+ self.assertRaises(self.failureException, self.assertLess, 1.1, 1.0)
+ self.assertRaises(self.failureException, self.assertLess, 1.0, 1.0)
+ self.assertRaises(self.failureException, self.assertLessEqual, 1.1, 1.0)
+
+ # Try Strings
+ self.assertGreater('bug', 'ant')
+ self.assertGreaterEqual('bug', 'ant')
+ self.assertGreaterEqual('ant', 'ant')
+ self.assertLess('ant', 'bug')
+ self.assertLessEqual('ant', 'bug')
+ self.assertLessEqual('ant', 'ant')
+ self.assertRaises(self.failureException, self.assertGreater, 'ant', 'bug')
+ self.assertRaises(self.failureException, self.assertGreater, 'ant', 'ant')
+ self.assertRaises(self.failureException, self.assertGreaterEqual, 'ant', 'bug')
+ self.assertRaises(self.failureException, self.assertLess, 'bug', 'ant')
+ self.assertRaises(self.failureException, self.assertLess, 'ant', 'ant')
+ self.assertRaises(self.failureException, self.assertLessEqual, 'bug', 'ant')
+
+ # Try bytes
+ self.assertGreater(b'bug', b'ant')
+ self.assertGreaterEqual(b'bug', b'ant')
+ self.assertGreaterEqual(b'ant', b'ant')
+ self.assertLess(b'ant', b'bug')
+ self.assertLessEqual(b'ant', b'bug')
+ self.assertLessEqual(b'ant', b'ant')
+ self.assertRaises(self.failureException, self.assertGreater, b'ant', b'bug')
+ self.assertRaises(self.failureException, self.assertGreater, b'ant', b'ant')
+ self.assertRaises(self.failureException, self.assertGreaterEqual, b'ant',
+ b'bug')
+ self.assertRaises(self.failureException, self.assertLess, b'bug', b'ant')
+ self.assertRaises(self.failureException, self.assertLess, b'ant', b'ant')
+ self.assertRaises(self.failureException, self.assertLessEqual, b'bug', b'ant')
+
+ def testAssertMultiLineEqual(self):
+ sample_text = """\
+http://www.python.org/doc/2.3/lib/module-unittest.html
+test case
+ A test case is the smallest unit of testing. [...]
+"""
+ revised_sample_text = """\
+http://www.python.org/doc/2.4.1/lib/module-unittest.html
+test case
+ A test case is the smallest unit of testing. [...] You may provide your
+ own implementation that does not subclass from TestCase, of course.
+"""
+ sample_text_error = """\
+- http://www.python.org/doc/2.3/lib/module-unittest.html
+? ^
++ http://www.python.org/doc/2.4.1/lib/module-unittest.html
+? ^^^
+ test case
+- A test case is the smallest unit of testing. [...]
++ A test case is the smallest unit of testing. [...] You may provide your
+? +++++++++++++++++++++
++ own implementation that does not subclass from TestCase, of course.
+"""
+ self.maxDiff = None
+ try:
+ self.assertMultiLineEqual(sample_text, revised_sample_text)
+ except self.failureException as e:
+ # need to remove the first line of the error message
+ error = str(e).split('\n', 1)[1]
+
+ # no fair testing ourself with ourself, and assertEqual is used for strings
+ # so can't use assertEqual either. Just use assertTrue.
+ self.assertTrue(sample_text_error == error)
+
+ def testAsertEqualSingleLine(self):
+ sample_text = "laden swallows fly slowly"
+ revised_sample_text = "unladen swallows fly quickly"
+ sample_text_error = """\
+- laden swallows fly slowly
+? ^^^^
++ unladen swallows fly quickly
+? ++ ^^^^^
+"""
+ try:
+ self.assertEqual(sample_text, revised_sample_text)
+ except self.failureException as e:
+ error = str(e).split('\n', 1)[1]
+ self.assertTrue(sample_text_error == error)
+
+ def testAssertIsNone(self):
+ self.assertIsNone(None)
+ self.assertRaises(self.failureException, self.assertIsNone, False)
+ self.assertIsNotNone('DjZoPloGears on Rails')
+ self.assertRaises(self.failureException, self.assertIsNotNone, None)
+
+ def testAssertRegex(self):
+ self.assertRegex('asdfabasdf', r'ab+')
+ self.assertRaises(self.failureException, self.assertRegex,
+ 'saaas', r'aaaa')
+
+ def testAssertRaisesRegex(self):
+ class ExceptionMock(Exception):
+ pass
+
+ def Stub():
+ raise ExceptionMock('We expect')
+
+ self.assertRaisesRegex(ExceptionMock, re.compile('expect$'), Stub)
+ self.assertRaisesRegex(ExceptionMock, 'expect$', Stub)
+
+ def testAssertNotRaisesRegex(self):
+ self.assertRaisesRegex(
+ self.failureException, '^Exception not raised by <lambda>$',
+ self.assertRaisesRegex, Exception, re.compile('x'),
+ lambda: None)
+ self.assertRaisesRegex(
+ self.failureException, '^Exception not raised by <lambda>$',
+ self.assertRaisesRegex, Exception, 'x',
+ lambda: None)
+
+ def testAssertRaisesRegexMismatch(self):
+ def Stub():
+ raise Exception('Unexpected')
+
+ self.assertRaisesRegex(
+ self.failureException,
+ r'"\^Expected\$" does not match "Unexpected"',
+ self.assertRaisesRegex, Exception, '^Expected$',
+ Stub)
+ self.assertRaisesRegex(
+ self.failureException,
+ r'"\^Expected\$" does not match "Unexpected"',
+ self.assertRaisesRegex, Exception,
+ re.compile('^Expected$'), Stub)
+
+ def testAssertRaisesExcValue(self):
+ class ExceptionMock(Exception):
+ pass
+
+ def Stub(foo):
+ raise ExceptionMock(foo)
+ v = "particular value"
+
+ ctx = self.assertRaises(ExceptionMock)
+ with ctx:
+ Stub(v)
+ e = ctx.exception
+ self.assertIsInstance(e, ExceptionMock)
+ self.assertEqual(e.args[0], v)
+
+ def testAssertWarnsCallable(self):
+ def _runtime_warn():
+ warnings.warn("foo", RuntimeWarning)
+ # Success when the right warning is triggered, even several times
+ self.assertWarns(RuntimeWarning, _runtime_warn)
+ self.assertWarns(RuntimeWarning, _runtime_warn)
+ # A tuple of warning classes is accepted
+ self.assertWarns((DeprecationWarning, RuntimeWarning), _runtime_warn)
+ # *args and **kwargs also work
+ self.assertWarns(RuntimeWarning,
+ warnings.warn, "foo", category=RuntimeWarning)
+ # Failure when no warning is triggered
+ with self.assertRaises(self.failureException):
+ self.assertWarns(RuntimeWarning, lambda: 0)
+ # Failure when another warning is triggered
+ with warnings.catch_warnings():
+ # Force default filter (in case tests are run with -We)
+ warnings.simplefilter("default", RuntimeWarning)
+ with self.assertRaises(self.failureException):
+ self.assertWarns(DeprecationWarning, _runtime_warn)
+ # Filters for other warnings are not modified
+ with warnings.catch_warnings():
+ warnings.simplefilter("error", RuntimeWarning)
+ with self.assertRaises(RuntimeWarning):
+ self.assertWarns(DeprecationWarning, _runtime_warn)
+
+ def testAssertWarnsContext(self):
+ # Believe it or not, it is preferrable to duplicate all tests above,
+ # to make sure the __warningregistry__ $@ is circumvented correctly.
+ def _runtime_warn():
+ warnings.warn("foo", RuntimeWarning)
+ _runtime_warn_lineno = inspect.getsourcelines(_runtime_warn)[1]
+ with self.assertWarns(RuntimeWarning) as cm:
+ _runtime_warn()
+ # A tuple of warning classes is accepted
+ with self.assertWarns((DeprecationWarning, RuntimeWarning)) as cm:
+ _runtime_warn()
+ # The context manager exposes various useful attributes
+ self.assertIsInstance(cm.warning, RuntimeWarning)
+ self.assertEqual(cm.warning.args[0], "foo")
+ self.assertIn("test_case.py", cm.filename)
+ self.assertEqual(cm.lineno, _runtime_warn_lineno + 1)
+ # Same with several warnings
+ with self.assertWarns(RuntimeWarning):
+ _runtime_warn()
+ _runtime_warn()
+ with self.assertWarns(RuntimeWarning):
+ warnings.warn("foo", category=RuntimeWarning)
+ # Failure when no warning is triggered
+ with self.assertRaises(self.failureException):
+ with self.assertWarns(RuntimeWarning):
+ pass
+ # Failure when another warning is triggered
+ with warnings.catch_warnings():
+ # Force default filter (in case tests are run with -We)
+ warnings.simplefilter("default", RuntimeWarning)
+ with self.assertRaises(self.failureException):
+ with self.assertWarns(DeprecationWarning):
+ _runtime_warn()
+ # Filters for other warnings are not modified
+ with warnings.catch_warnings():
+ warnings.simplefilter("error", RuntimeWarning)
+ with self.assertRaises(RuntimeWarning):
+ with self.assertWarns(DeprecationWarning):
+ _runtime_warn()
+
+ def testAssertWarnsRegexCallable(self):
+ def _runtime_warn(msg):
+ warnings.warn(msg, RuntimeWarning)
+ self.assertWarnsRegex(RuntimeWarning, "o+",
+ _runtime_warn, "foox")
+ # Failure when no warning is triggered
+ with self.assertRaises(self.failureException):
+ self.assertWarnsRegex(RuntimeWarning, "o+",
+ lambda: 0)
+ # Failure when another warning is triggered
+ with warnings.catch_warnings():
+ # Force default filter (in case tests are run with -We)
+ warnings.simplefilter("default", RuntimeWarning)
+ with self.assertRaises(self.failureException):
+ self.assertWarnsRegex(DeprecationWarning, "o+",
+ _runtime_warn, "foox")
+ # Failure when message doesn't match
+ with self.assertRaises(self.failureException):
+ self.assertWarnsRegex(RuntimeWarning, "o+",
+ _runtime_warn, "barz")
+ # A little trickier: we ask RuntimeWarnings to be raised, and then
+ # check for some of them. It is implementation-defined whether
+ # non-matching RuntimeWarnings are simply re-raised, or produce a
+ # failureException.
+ with warnings.catch_warnings():
+ warnings.simplefilter("error", RuntimeWarning)
+ with self.assertRaises((RuntimeWarning, self.failureException)):
+ self.assertWarnsRegex(RuntimeWarning, "o+",
+ _runtime_warn, "barz")
+
+ def testAssertWarnsRegexContext(self):
+ # Same as above, but with assertWarnsRegex as a context manager
+ def _runtime_warn(msg):
+ warnings.warn(msg, RuntimeWarning)
+ _runtime_warn_lineno = inspect.getsourcelines(_runtime_warn)[1]
+ with self.assertWarnsRegex(RuntimeWarning, "o+") as cm:
+ _runtime_warn("foox")
+ self.assertIsInstance(cm.warning, RuntimeWarning)
+ self.assertEqual(cm.warning.args[0], "foox")
+ self.assertIn("test_case.py", cm.filename)
+ self.assertEqual(cm.lineno, _runtime_warn_lineno + 1)
+ # Failure when no warning is triggered
+ with self.assertRaises(self.failureException):
+ with self.assertWarnsRegex(RuntimeWarning, "o+"):
+ pass
+ # Failure when another warning is triggered
+ with warnings.catch_warnings():
+ # Force default filter (in case tests are run with -We)
+ warnings.simplefilter("default", RuntimeWarning)
+ with self.assertRaises(self.failureException):
+ with self.assertWarnsRegex(DeprecationWarning, "o+"):
+ _runtime_warn("foox")
+ # Failure when message doesn't match
+ with self.assertRaises(self.failureException):
+ with self.assertWarnsRegex(RuntimeWarning, "o+"):
+ _runtime_warn("barz")
+ # A little trickier: we ask RuntimeWarnings to be raised, and then
+ # check for some of them. It is implementation-defined whether
+ # non-matching RuntimeWarnings are simply re-raised, or produce a
+ # failureException.
+ with warnings.catch_warnings():
+ warnings.simplefilter("error", RuntimeWarning)
+ with self.assertRaises((RuntimeWarning, self.failureException)):
+ with self.assertWarnsRegex(RuntimeWarning, "o+"):
+ _runtime_warn("barz")
+
+ def testDeprecatedMethodNames(self):
+ """
+ Test that the deprecated methods raise a DeprecationWarning. See #9424.
+ """
+ old = (
+ (self.failIfEqual, (3, 5)),
+ (self.assertNotEquals, (3, 5)),
+ (self.failUnlessEqual, (3, 3)),
+ (self.assertEquals, (3, 3)),
+ (self.failUnlessAlmostEqual, (2.0, 2.0)),
+ (self.assertAlmostEquals, (2.0, 2.0)),
+ (self.failIfAlmostEqual, (3.0, 5.0)),
+ (self.assertNotAlmostEquals, (3.0, 5.0)),
+ (self.failUnless, (True,)),
+ (self.assert_, (True,)),
+ (self.failUnlessRaises, (TypeError, lambda _: 3.14 + 'spam')),
+ (self.failIf, (False,)),
+ (self.assertSameElements, ([1, 1, 2, 3], [1, 2, 3])),
+ (self.assertDictContainsSubset, (dict(a=1, b=2), dict(a=1, b=2, c=3))),
+ (self.assertRaisesRegexp, (KeyError, 'foo', lambda: {}['foo'])),
+ (self.assertRegexpMatches, ('bar', 'bar')),
+ )
+ for meth, args in old:
+ with self.assertWarns(DeprecationWarning):
+ meth(*args)
+
+ def testDeprecatedFailMethods(self):
+ """Test that the deprecated fail* methods get removed in 3.3"""
+ if sys.version_info[:2] < (3, 3):
+ return
+ deprecated_names = [
+ 'failIfEqual', 'failUnlessEqual', 'failUnlessAlmostEqual',
+ 'failIfAlmostEqual', 'failUnless', 'failUnlessRaises', 'failIf',
+ 'assertSameElements', 'assertDictContainsSubset',
+ ]
+ for deprecated_name in deprecated_names:
+ with self.assertRaises(AttributeError):
+ getattr(self, deprecated_name) # remove these in 3.3
+
+ def testDeepcopy(self):
+ # Issue: 5660
+ class TestableTest(unittest.TestCase):
+ def testNothing(self):
+ pass
+
+ test = TestableTest('testNothing')
+
+ # This shouldn't blow up
+ deepcopy(test)
+
+ def testPickle(self):
+ # Issue 10326
+
+ # Can't use TestCase classes defined in Test class as
+ # pickle does not work with inner classes
+ test = unittest.TestCase('run')
+ for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
+
+ # blew up prior to fix
+ pickled_test = pickle.dumps(test, protocol=protocol)
+ unpickled_test = pickle.loads(pickled_test)
+ self.assertEqual(test, unpickled_test)
+
+ # exercise the TestCase instance in a way that will invoke
+ # the type equality lookup mechanism
+ unpickled_test.assertEqual(set(), set())
+
+ def testKeyboardInterrupt(self):
+ def _raise(self=None):
+ raise KeyboardInterrupt
+ def nothing(self):
+ pass
+
+ class Test1(unittest.TestCase):
+ test_something = _raise
+
+ class Test2(unittest.TestCase):
+ setUp = _raise
+ test_something = nothing
+
+ class Test3(unittest.TestCase):
+ test_something = nothing
+ tearDown = _raise
+
+ class Test4(unittest.TestCase):
+ def test_something(self):
+ self.addCleanup(_raise)
+
+ for klass in (Test1, Test2, Test3, Test4):
+ with self.assertRaises(KeyboardInterrupt):
+ klass('test_something').run()
+
+ def testSkippingEverywhere(self):
+ def _skip(self=None):
+ raise unittest.SkipTest('some reason')
+ def nothing(self):
+ pass
+
+ class Test1(unittest.TestCase):
+ test_something = _skip
+
+ class Test2(unittest.TestCase):
+ setUp = _skip
+ test_something = nothing
+
+ class Test3(unittest.TestCase):
+ test_something = nothing
+ tearDown = _skip
+
+ class Test4(unittest.TestCase):
+ def test_something(self):
+ self.addCleanup(_skip)
+
+ for klass in (Test1, Test2, Test3, Test4):
+ result = unittest.TestResult()
+ klass('test_something').run(result)
+ self.assertEqual(len(result.skipped), 1)
+ self.assertEqual(result.testsRun, 1)
+
+ def testSystemExit(self):
+ def _raise(self=None):
+ raise SystemExit
+ def nothing(self):
+ pass
+
+ class Test1(unittest.TestCase):
+ test_something = _raise
+
+ class Test2(unittest.TestCase):
+ setUp = _raise
+ test_something = nothing
+
+ class Test3(unittest.TestCase):
+ test_something = nothing
+ tearDown = _raise
+
+ class Test4(unittest.TestCase):
+ def test_something(self):
+ self.addCleanup(_raise)
+
+ for klass in (Test1, Test2, Test3, Test4):
+ result = unittest.TestResult()
+ klass('test_something').run(result)
+ self.assertEqual(len(result.errors), 1)
+ self.assertEqual(result.testsRun, 1)
diff --git a/Lib/unittest/test/test_discovery.py b/Lib/unittest/test/test_discovery.py
new file mode 100644
index 0000000000..e688f8e35a
--- /dev/null
+++ b/Lib/unittest/test/test_discovery.py
@@ -0,0 +1,395 @@
+import os
+import re
+import sys
+
+import unittest
+
+
+class TestableTestProgram(unittest.TestProgram):
+ module = '__main__'
+ exit = True
+ defaultTest = failfast = catchbreak = buffer = None
+ verbosity = 1
+ progName = ''
+ testRunner = testLoader = None
+
+ def __init__(self):
+ pass
+
+
+class TestDiscovery(unittest.TestCase):
+
+ # Heavily mocked tests so I can avoid hitting the filesystem
+ def test_get_name_from_path(self):
+ loader = unittest.TestLoader()
+ loader._top_level_dir = '/foo'
+ name = loader._get_name_from_path('/foo/bar/baz.py')
+ self.assertEqual(name, 'bar.baz')
+
+ if not __debug__:
+ # asserts are off
+ return
+
+ with self.assertRaises(AssertionError):
+ loader._get_name_from_path('/bar/baz.py')
+
+ def test_find_tests(self):
+ loader = unittest.TestLoader()
+
+ original_listdir = os.listdir
+ def restore_listdir():
+ os.listdir = original_listdir
+ original_isfile = os.path.isfile
+ def restore_isfile():
+ os.path.isfile = original_isfile
+ original_isdir = os.path.isdir
+ def restore_isdir():
+ os.path.isdir = original_isdir
+
+ path_lists = [['test1.py', 'test2.py', 'not_a_test.py', 'test_dir',
+ 'test.foo', 'test-not-a-module.py', 'another_dir'],
+ ['test3.py', 'test4.py', ]]
+ os.listdir = lambda path: path_lists.pop(0)
+ self.addCleanup(restore_listdir)
+
+ def isdir(path):
+ return path.endswith('dir')
+ os.path.isdir = isdir
+ self.addCleanup(restore_isdir)
+
+ def isfile(path):
+ # another_dir is not a package and so shouldn't be recursed into
+ return not path.endswith('dir') and not 'another_dir' in path
+ os.path.isfile = isfile
+ self.addCleanup(restore_isfile)
+
+ loader._get_module_from_name = lambda path: path + ' module'
+ loader.loadTestsFromModule = lambda module: module + ' tests'
+
+ top_level = os.path.abspath('/foo')
+ loader._top_level_dir = top_level
+ suite = list(loader._find_tests(top_level, 'test*.py'))
+
+ expected = [name + ' module tests' for name in
+ ('test1', 'test2')]
+ expected.extend([('test_dir.%s' % name) + ' module tests' for name in
+ ('test3', 'test4')])
+ self.assertEqual(suite, expected)
+
+ def test_find_tests_with_package(self):
+ loader = unittest.TestLoader()
+
+ original_listdir = os.listdir
+ def restore_listdir():
+ os.listdir = original_listdir
+ original_isfile = os.path.isfile
+ def restore_isfile():
+ os.path.isfile = original_isfile
+ original_isdir = os.path.isdir
+ def restore_isdir():
+ os.path.isdir = original_isdir
+
+ directories = ['a_directory', 'test_directory', 'test_directory2']
+ path_lists = [directories, [], [], []]
+ os.listdir = lambda path: path_lists.pop(0)
+ self.addCleanup(restore_listdir)
+
+ os.path.isdir = lambda path: True
+ self.addCleanup(restore_isdir)
+
+ os.path.isfile = lambda path: os.path.basename(path) not in directories
+ self.addCleanup(restore_isfile)
+
+ class Module(object):
+ paths = []
+ load_tests_args = []
+
+ def __init__(self, path):
+ self.path = path
+ self.paths.append(path)
+ if os.path.basename(path) == 'test_directory':
+ def load_tests(loader, tests, pattern):
+ self.load_tests_args.append((loader, tests, pattern))
+ return 'load_tests'
+ self.load_tests = load_tests
+
+ def __eq__(self, other):
+ return self.path == other.path
+
+ loader._get_module_from_name = lambda name: Module(name)
+ def loadTestsFromModule(module, use_load_tests):
+ if use_load_tests:
+ raise self.failureException('use_load_tests should be False for packages')
+ return module.path + ' module tests'
+ loader.loadTestsFromModule = loadTestsFromModule
+
+ loader._top_level_dir = '/foo'
+ # this time no '.py' on the pattern so that it can match
+ # a test package
+ suite = list(loader._find_tests('/foo', 'test*'))
+
+ # We should have loaded tests from the test_directory package by calling load_tests
+ # and directly from the test_directory2 package
+ self.assertEqual(suite,
+ ['load_tests', 'test_directory2' + ' module tests'])
+ self.assertEqual(Module.paths, ['test_directory', 'test_directory2'])
+
+ # load_tests should have been called once with loader, tests and pattern
+ self.assertEqual(Module.load_tests_args,
+ [(loader, 'test_directory' + ' module tests', 'test*')])
+
+ def test_discover(self):
+ loader = unittest.TestLoader()
+
+ original_isfile = os.path.isfile
+ original_isdir = os.path.isdir
+ def restore_isfile():
+ os.path.isfile = original_isfile
+
+ os.path.isfile = lambda path: False
+ self.addCleanup(restore_isfile)
+
+ orig_sys_path = sys.path[:]
+ def restore_path():
+ sys.path[:] = orig_sys_path
+ self.addCleanup(restore_path)
+
+ full_path = os.path.abspath(os.path.normpath('/foo'))
+ with self.assertRaises(ImportError):
+ loader.discover('/foo/bar', top_level_dir='/foo')
+
+ self.assertEqual(loader._top_level_dir, full_path)
+ self.assertIn(full_path, sys.path)
+
+ os.path.isfile = lambda path: True
+ os.path.isdir = lambda path: True
+
+ def restore_isdir():
+ os.path.isdir = original_isdir
+ self.addCleanup(restore_isdir)
+
+ _find_tests_args = []
+ def _find_tests(start_dir, pattern):
+ _find_tests_args.append((start_dir, pattern))
+ return ['tests']
+ loader._find_tests = _find_tests
+ loader.suiteClass = str
+
+ suite = loader.discover('/foo/bar/baz', 'pattern', '/foo/bar')
+
+ top_level_dir = os.path.abspath('/foo/bar')
+ start_dir = os.path.abspath('/foo/bar/baz')
+ self.assertEqual(suite, "['tests']")
+ self.assertEqual(loader._top_level_dir, top_level_dir)
+ self.assertEqual(_find_tests_args, [(start_dir, 'pattern')])
+ self.assertIn(top_level_dir, sys.path)
+
+ def test_discover_with_modules_that_fail_to_import(self):
+ loader = unittest.TestLoader()
+
+ listdir = os.listdir
+ os.listdir = lambda _: ['test_this_does_not_exist.py']
+ isfile = os.path.isfile
+ os.path.isfile = lambda _: True
+ orig_sys_path = sys.path[:]
+ def restore():
+ os.path.isfile = isfile
+ os.listdir = listdir
+ sys.path[:] = orig_sys_path
+ self.addCleanup(restore)
+
+ suite = loader.discover('.')
+ self.assertIn(os.getcwd(), sys.path)
+ self.assertEqual(suite.countTestCases(), 1)
+ test = list(list(suite)[0])[0] # extract test from suite
+
+ with self.assertRaises(ImportError):
+ test.test_this_does_not_exist()
+
+ def test_command_line_handling_parseArgs(self):
+ program = TestableTestProgram()
+
+ args = []
+ def do_discovery(argv):
+ args.extend(argv)
+ program._do_discovery = do_discovery
+ program.parseArgs(['something', 'discover'])
+ self.assertEqual(args, [])
+
+ program.parseArgs(['something', 'discover', 'foo', 'bar'])
+ self.assertEqual(args, ['foo', 'bar'])
+
+ def test_command_line_handling_discover_by_default(self):
+ program = TestableTestProgram()
+ program.module = None
+
+ self.called = False
+ def do_discovery(argv):
+ self.called = True
+ self.assertEqual(argv, [])
+ program._do_discovery = do_discovery
+ program.parseArgs(['something'])
+ self.assertTrue(self.called)
+
+ def test_command_line_handling_discover_by_default_with_options(self):
+ program = TestableTestProgram()
+ program.module = None
+
+ args = ['something', '-v', '-b', '-v', '-c', '-f']
+ self.called = False
+ def do_discovery(argv):
+ self.called = True
+ self.assertEqual(argv, args[1:])
+ program._do_discovery = do_discovery
+ program.parseArgs(args)
+ self.assertTrue(self.called)
+
+
+ def test_command_line_handling_do_discovery_too_many_arguments(self):
+ class Stop(Exception):
+ pass
+ def usageExit():
+ raise Stop
+
+ program = TestableTestProgram()
+ program.usageExit = usageExit
+
+ with self.assertRaises(Stop):
+ # too many args
+ program._do_discovery(['one', 'two', 'three', 'four'])
+
+
+ def test_command_line_handling_do_discovery_calls_loader(self):
+ program = TestableTestProgram()
+
+ class Loader(object):
+ args = []
+ def discover(self, start_dir, pattern, top_level_dir):
+ self.args.append((start_dir, pattern, top_level_dir))
+ return 'tests'
+
+ program._do_discovery(['-v'], Loader=Loader)
+ self.assertEqual(program.verbosity, 2)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('.', 'test*.py', None)])
+
+ Loader.args = []
+ program = TestableTestProgram()
+ program._do_discovery(['--verbose'], Loader=Loader)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('.', 'test*.py', None)])
+
+ Loader.args = []
+ program = TestableTestProgram()
+ program._do_discovery([], Loader=Loader)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('.', 'test*.py', None)])
+
+ Loader.args = []
+ program = TestableTestProgram()
+ program._do_discovery(['fish'], Loader=Loader)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('fish', 'test*.py', None)])
+
+ Loader.args = []
+ program = TestableTestProgram()
+ program._do_discovery(['fish', 'eggs'], Loader=Loader)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('fish', 'eggs', None)])
+
+ Loader.args = []
+ program = TestableTestProgram()
+ program._do_discovery(['fish', 'eggs', 'ham'], Loader=Loader)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('fish', 'eggs', 'ham')])
+
+ Loader.args = []
+ program = TestableTestProgram()
+ program._do_discovery(['-s', 'fish'], Loader=Loader)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('fish', 'test*.py', None)])
+
+ Loader.args = []
+ program = TestableTestProgram()
+ program._do_discovery(['-t', 'fish'], Loader=Loader)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('.', 'test*.py', 'fish')])
+
+ Loader.args = []
+ program = TestableTestProgram()
+ program._do_discovery(['-p', 'fish'], Loader=Loader)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('.', 'fish', None)])
+ self.assertFalse(program.failfast)
+ self.assertFalse(program.catchbreak)
+
+ Loader.args = []
+ program = TestableTestProgram()
+ program._do_discovery(['-p', 'eggs', '-s', 'fish', '-v', '-f', '-c'],
+ Loader=Loader)
+ self.assertEqual(program.test, 'tests')
+ self.assertEqual(Loader.args, [('fish', 'eggs', None)])
+ self.assertEqual(program.verbosity, 2)
+ self.assertTrue(program.failfast)
+ self.assertTrue(program.catchbreak)
+
+ def test_detect_module_clash(self):
+ class Module(object):
+ __file__ = 'bar/foo.py'
+ sys.modules['foo'] = Module
+ full_path = os.path.abspath('foo')
+ original_listdir = os.listdir
+ original_isfile = os.path.isfile
+ original_isdir = os.path.isdir
+
+ def cleanup():
+ os.listdir = original_listdir
+ os.path.isfile = original_isfile
+ os.path.isdir = original_isdir
+ del sys.modules['foo']
+ if full_path in sys.path:
+ sys.path.remove(full_path)
+ self.addCleanup(cleanup)
+
+ def listdir(_):
+ return ['foo.py']
+ def isfile(_):
+ return True
+ def isdir(_):
+ return True
+ os.listdir = listdir
+ os.path.isfile = isfile
+ os.path.isdir = isdir
+
+ loader = unittest.TestLoader()
+
+ mod_dir = os.path.abspath('bar')
+ expected_dir = os.path.abspath('foo')
+ msg = re.escape(r"'foo' module incorrectly imported from %r. Expected %r. "
+ "Is this module globally installed?" % (mod_dir, expected_dir))
+ self.assertRaisesRegex(
+ ImportError, '^%s$' % msg, loader.discover,
+ start_dir='foo', pattern='foo.py'
+ )
+ self.assertEqual(sys.path[0], full_path)
+
+
+ def test_discovery_from_dotted_path(self):
+ loader = unittest.TestLoader()
+
+ tests = [self]
+ expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
+
+ self.wasRun = False
+ def _find_tests(start_dir, pattern):
+ self.wasRun = True
+ self.assertEqual(start_dir, expectedPath)
+ return tests
+ loader._find_tests = _find_tests
+ suite = loader.discover('unittest.test')
+ self.assertTrue(self.wasRun)
+ self.assertEqual(suite._tests, tests)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/Lib/unittest/test/test_functiontestcase.py b/Lib/unittest/test/test_functiontestcase.py
new file mode 100644
index 0000000000..9ce5ee3556
--- /dev/null
+++ b/Lib/unittest/test/test_functiontestcase.py
@@ -0,0 +1,144 @@
+import unittest
+
+from .support import LoggingResult
+
+
+class Test_FunctionTestCase(unittest.TestCase):
+
+ # "Return the number of tests represented by the this test object. For
+ # TestCase instances, this will always be 1"
+ def test_countTestCases(self):
+ test = unittest.FunctionTestCase(lambda: None)
+
+ self.assertEqual(test.countTestCases(), 1)
+
+ # "When a setUp() method is defined, the test runner will run that method
+ # prior to each test. Likewise, if a tearDown() method is defined, the
+ # test runner will invoke that method after each test. In the example,
+ # setUp() was used to create a fresh sequence for each test."
+ #
+ # Make sure the proper call order is maintained, even if setUp() raises
+ # an exception.
+ def test_run_call_order__error_in_setUp(self):
+ events = []
+ result = LoggingResult(events)
+
+ def setUp():
+ events.append('setUp')
+ raise RuntimeError('raised by setUp')
+
+ def test():
+ events.append('test')
+
+ def tearDown():
+ events.append('tearDown')
+
+ expected = ['startTest', 'setUp', 'addError', 'stopTest']
+ unittest.FunctionTestCase(test, setUp, tearDown).run(result)
+ self.assertEqual(events, expected)
+
+ # "When a setUp() method is defined, the test runner will run that method
+ # prior to each test. Likewise, if a tearDown() method is defined, the
+ # test runner will invoke that method after each test. In the example,
+ # setUp() was used to create a fresh sequence for each test."
+ #
+ # Make sure the proper call order is maintained, even if the test raises
+ # an error (as opposed to a failure).
+ def test_run_call_order__error_in_test(self):
+ events = []
+ result = LoggingResult(events)
+
+ def setUp():
+ events.append('setUp')
+
+ def test():
+ events.append('test')
+ raise RuntimeError('raised by test')
+
+ def tearDown():
+ events.append('tearDown')
+
+ expected = ['startTest', 'setUp', 'test', 'tearDown',
+ 'addError', 'stopTest']
+ unittest.FunctionTestCase(test, setUp, tearDown).run(result)
+ self.assertEqual(events, expected)
+
+ # "When a setUp() method is defined, the test runner will run that method
+ # prior to each test. Likewise, if a tearDown() method is defined, the
+ # test runner will invoke that method after each test. In the example,
+ # setUp() was used to create a fresh sequence for each test."
+ #
+ # Make sure the proper call order is maintained, even if the test signals
+ # a failure (as opposed to an error).
+ def test_run_call_order__failure_in_test(self):
+ events = []
+ result = LoggingResult(events)
+
+ def setUp():
+ events.append('setUp')
+
+ def test():
+ events.append('test')
+ self.fail('raised by test')
+
+ def tearDown():
+ events.append('tearDown')
+
+ expected = ['startTest', 'setUp', 'test', 'tearDown',
+ 'addFailure', 'stopTest']
+ unittest.FunctionTestCase(test, setUp, tearDown).run(result)
+ self.assertEqual(events, expected)
+
+ # "When a setUp() method is defined, the test runner will run that method
+ # prior to each test. Likewise, if a tearDown() method is defined, the
+ # test runner will invoke that method after each test. In the example,
+ # setUp() was used to create a fresh sequence for each test."
+ #
+ # Make sure the proper call order is maintained, even if tearDown() raises
+ # an exception.
+ def test_run_call_order__error_in_tearDown(self):
+ events = []
+ result = LoggingResult(events)
+
+ def setUp():
+ events.append('setUp')
+
+ def test():
+ events.append('test')
+
+ def tearDown():
+ events.append('tearDown')
+ raise RuntimeError('raised by tearDown')
+
+ expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError',
+ 'stopTest']
+ unittest.FunctionTestCase(test, setUp, tearDown).run(result)
+ self.assertEqual(events, expected)
+
+ # "Return a string identifying the specific test case."
+ #
+ # Because of the vague nature of the docs, I'm not going to lock this
+ # test down too much. Really all that can be asserted is that the id()
+ # will be a string (either 8-byte or unicode -- again, because the docs
+ # just say "string")
+ def test_id(self):
+ test = unittest.FunctionTestCase(lambda: None)
+
+ self.assertIsInstance(test.id(), str)
+
+ # "Returns a one-line description of the test, or None if no description
+ # has been provided. The default implementation of this method returns
+ # the first line of the test method's docstring, if available, or None."
+ def test_shortDescription__no_docstring(self):
+ test = unittest.FunctionTestCase(lambda: None)
+
+ self.assertEqual(test.shortDescription(), None)
+
+ # "Returns a one-line description of the test, or None if no description
+ # has been provided. The default implementation of this method returns
+ # the first line of the test method's docstring, if available, or None."
+ def test_shortDescription__singleline_docstring(self):
+ desc = "this tests foo"
+ test = unittest.FunctionTestCase(lambda: None, description=desc)
+
+ self.assertEqual(test.shortDescription(), "this tests foo")
diff --git a/Lib/unittest/test/test_loader.py b/Lib/unittest/test/test_loader.py
new file mode 100644
index 0000000000..f7e31a57f1
--- /dev/null
+++ b/Lib/unittest/test/test_loader.py
@@ -0,0 +1,1292 @@
+import sys
+import types
+
+
+import unittest
+
+
+class Test_TestLoader(unittest.TestCase):
+
+ ### Tests for TestLoader.loadTestsFromTestCase
+ ################################################################
+
+ # "Return a suite of all tests cases contained in the TestCase-derived
+ # class testCaseClass"
+ def test_loadTestsFromTestCase(self):
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foo_bar(self): pass
+
+ tests = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
+
+ loader = unittest.TestLoader()
+ self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)
+
+ # "Return a suite of all tests cases contained in the TestCase-derived
+ # class testCaseClass"
+ #
+ # Make sure it does the right thing even if no tests were found
+ def test_loadTestsFromTestCase__no_matches(self):
+ class Foo(unittest.TestCase):
+ def foo_bar(self): pass
+
+ empty_suite = unittest.TestSuite()
+
+ loader = unittest.TestLoader()
+ self.assertEqual(loader.loadTestsFromTestCase(Foo), empty_suite)
+
+ # "Return a suite of all tests cases contained in the TestCase-derived
+ # class testCaseClass"
+ #
+ # What happens if loadTestsFromTestCase() is given an object
+ # that isn't a subclass of TestCase? Specifically, what happens
+ # if testCaseClass is a subclass of TestSuite?
+ #
+ # This is checked for specifically in the code, so we better add a
+ # test for it.
+ def test_loadTestsFromTestCase__TestSuite_subclass(self):
+ class NotATestCase(unittest.TestSuite):
+ pass
+
+ loader = unittest.TestLoader()
+ try:
+ loader.loadTestsFromTestCase(NotATestCase)
+ except TypeError:
+ pass
+ else:
+ self.fail('Should raise TypeError')
+
+ # "Return a suite of all tests cases contained in the TestCase-derived
+ # class testCaseClass"
+ #
+ # Make sure loadTestsFromTestCase() picks up the default test method
+ # name (as specified by TestCase), even though the method name does
+ # not match the default TestLoader.testMethodPrefix string
+ def test_loadTestsFromTestCase__default_method_name(self):
+ class Foo(unittest.TestCase):
+ def runTest(self):
+ pass
+
+ loader = unittest.TestLoader()
+ # This has to be false for the test to succeed
+ self.assertFalse('runTest'.startswith(loader.testMethodPrefix))
+
+ suite = loader.loadTestsFromTestCase(Foo)
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [Foo('runTest')])
+
+ ################################################################
+ ### /Tests for TestLoader.loadTestsFromTestCase
+
+ ### Tests for TestLoader.loadTestsFromModule
+ ################################################################
+
+ # "This method searches `module` for classes derived from TestCase"
+ def test_loadTestsFromModule__TestCase_subclass(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testcase_1 = MyTestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromModule(m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ expected = [loader.suiteClass([MyTestCase('test')])]
+ self.assertEqual(list(suite), expected)
+
+ # "This method searches `module` for classes derived from TestCase"
+ #
+ # What happens if no tests are found (no TestCase instances)?
+ def test_loadTestsFromModule__no_TestCase_instances(self):
+ m = types.ModuleType('m')
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromModule(m)
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [])
+
+ # "This method searches `module` for classes derived from TestCase"
+ #
+ # What happens if no tests are found (TestCases instances, but no tests)?
+ def test_loadTestsFromModule__no_TestCase_tests(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ pass
+ m.testcase_1 = MyTestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromModule(m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ self.assertEqual(list(suite), [loader.suiteClass()])
+
+ # "This method searches `module` for classes derived from TestCase"s
+ #
+ # What happens if loadTestsFromModule() is given something other
+ # than a module?
+ #
+ # XXX Currently, it succeeds anyway. This flexibility
+ # should either be documented or loadTestsFromModule() should
+ # raise a TypeError
+ #
+ # XXX Certain people are using this behaviour. We'll add a test for it
+ def test_loadTestsFromModule__not_a_module(self):
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+
+ class NotAModule(object):
+ test_2 = MyTestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromModule(NotAModule)
+
+ reference = [unittest.TestSuite([MyTestCase('test')])]
+ self.assertEqual(list(suite), reference)
+
+
+ # Check that loadTestsFromModule honors (or not) a module
+ # with a load_tests function.
+ def test_loadTestsFromModule__load_tests(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testcase_1 = MyTestCase
+
+ load_tests_args = []
+ def load_tests(loader, tests, pattern):
+ self.assertIsInstance(tests, unittest.TestSuite)
+ load_tests_args.extend((loader, tests, pattern))
+ return tests
+ m.load_tests = load_tests
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromModule(m)
+ self.assertIsInstance(suite, unittest.TestSuite)
+ self.assertEqual(load_tests_args, [loader, suite, None])
+
+ load_tests_args = []
+ suite = loader.loadTestsFromModule(m, use_load_tests=False)
+ self.assertEqual(load_tests_args, [])
+
+ def test_loadTestsFromModule__faulty_load_tests(self):
+ m = types.ModuleType('m')
+
+ def load_tests(loader, tests, pattern):
+ raise TypeError('some failure')
+ m.load_tests = load_tests
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromModule(m)
+ self.assertIsInstance(suite, unittest.TestSuite)
+ self.assertEqual(suite.countTestCases(), 1)
+ test = list(suite)[0]
+
+ self.assertRaisesRegex(TypeError, "some failure", test.m)
+
+ ################################################################
+ ### /Tests for TestLoader.loadTestsFromModule()
+
+ ### Tests for TestLoader.loadTestsFromName()
+ ################################################################
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # Is ValueError raised in response to an empty name?
+ def test_loadTestsFromName__empty_name(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromName('')
+ except ValueError as e:
+ self.assertEqual(str(e), "Empty module name")
+ else:
+ self.fail("TestLoader.loadTestsFromName failed to raise ValueError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # What happens when the name contains invalid characters?
+ def test_loadTestsFromName__malformed_name(self):
+ loader = unittest.TestLoader()
+
+ # XXX Should this raise ValueError or ImportError?
+ try:
+ loader.loadTestsFromName('abc () //')
+ except ValueError:
+ pass
+ except ImportError:
+ pass
+ else:
+ self.fail("TestLoader.loadTestsFromName failed to raise ValueError")
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to a
+ # module"
+ #
+ # What happens when a module by that name can't be found?
+ def test_loadTestsFromName__unknown_module_name(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromName('sdasfasfasdf')
+ except ImportError as e:
+ self.assertEqual(str(e), "No module named sdasfasfasdf")
+ else:
+ self.fail("TestLoader.loadTestsFromName failed to raise ImportError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # What happens when the module is found, but the attribute can't?
+ def test_loadTestsFromName__unknown_attr_name(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromName('unittest.sdasfasfasdf')
+ except AttributeError as e:
+ self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
+ else:
+ self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # What happens when we provide the module, but the attribute can't be
+ # found?
+ def test_loadTestsFromName__relative_unknown_name(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromName('sdasfasfasdf', unittest)
+ except AttributeError as e:
+ self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
+ else:
+ self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ # ...
+ # "The method optionally resolves name relative to the given module"
+ #
+ # Does loadTestsFromName raise ValueError when passed an empty
+ # name relative to a provided module?
+ #
+ # XXX Should probably raise a ValueError instead of an AttributeError
+ def test_loadTestsFromName__relative_empty_name(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromName('', unittest)
+ except AttributeError as e:
+ pass
+ else:
+ self.fail("Failed to raise AttributeError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ # ...
+ # "The method optionally resolves name relative to the given module"
+ #
+ # What happens when an impossible name is given, relative to the provided
+ # `module`?
+ def test_loadTestsFromName__relative_malformed_name(self):
+ loader = unittest.TestLoader()
+
+ # XXX Should this raise AttributeError or ValueError?
+ try:
+ loader.loadTestsFromName('abc () //', unittest)
+ except ValueError:
+ pass
+ except AttributeError:
+ pass
+ else:
+ self.fail("TestLoader.loadTestsFromName failed to raise ValueError")
+
+ # "The method optionally resolves name relative to the given module"
+ #
+ # Does loadTestsFromName raise TypeError when the `module` argument
+ # isn't a module object?
+ #
+ # XXX Accepts the not-a-module object, ignorning the object's type
+ # This should raise an exception or the method name should be changed
+ #
+ # XXX Some people are relying on this, so keep it for now
+ def test_loadTestsFromName__relative_not_a_module(self):
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+
+ class NotAModule(object):
+ test_2 = MyTestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromName('test_2', NotAModule)
+
+ reference = [MyTestCase('test')]
+ self.assertEqual(list(suite), reference)
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # Does it raise an exception if the name resolves to an invalid
+ # object?
+ def test_loadTestsFromName__relative_bad_object(self):
+ m = types.ModuleType('m')
+ m.testcase_1 = object()
+
+ loader = unittest.TestLoader()
+ try:
+ loader.loadTestsFromName('testcase_1', m)
+ except TypeError:
+ pass
+ else:
+ self.fail("Should have raised TypeError")
+
+ # "The specifier name is a ``dotted name'' that may
+ # resolve either to ... a test case class"
+ def test_loadTestsFromName__relative_TestCase_subclass(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testcase_1 = MyTestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromName('testcase_1', m)
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [MyTestCase('test')])
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ def test_loadTestsFromName__relative_TestSuite(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testsuite = unittest.TestSuite([MyTestCase('test')])
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromName('testsuite', m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ self.assertEqual(list(suite), [MyTestCase('test')])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a test method within a test case class"
+ def test_loadTestsFromName__relative_testmethod(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testcase_1 = MyTestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromName('testcase_1.test', m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ self.assertEqual(list(suite), [MyTestCase('test')])
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # Does loadTestsFromName() raise the proper exception when trying to
+ # resolve "a test method within a test case class" that doesn't exist
+ # for the given name (relative to a provided module)?
+ def test_loadTestsFromName__relative_invalid_testmethod(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testcase_1 = MyTestCase
+
+ loader = unittest.TestLoader()
+ try:
+ loader.loadTestsFromName('testcase_1.testfoo', m)
+ except AttributeError as e:
+ self.assertEqual(str(e), "type object 'MyTestCase' has no attribute 'testfoo'")
+ else:
+ self.fail("Failed to raise AttributeError")
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a callable object which returns a ... TestSuite instance"
+ def test_loadTestsFromName__callable__TestSuite(self):
+ m = types.ModuleType('m')
+ testcase_1 = unittest.FunctionTestCase(lambda: None)
+ testcase_2 = unittest.FunctionTestCase(lambda: None)
+ def return_TestSuite():
+ return unittest.TestSuite([testcase_1, testcase_2])
+ m.return_TestSuite = return_TestSuite
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromName('return_TestSuite', m)
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [testcase_1, testcase_2])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a callable object which returns a TestCase ... instance"
+ def test_loadTestsFromName__callable__TestCase_instance(self):
+ m = types.ModuleType('m')
+ testcase_1 = unittest.FunctionTestCase(lambda: None)
+ def return_TestCase():
+ return testcase_1
+ m.return_TestCase = return_TestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromName('return_TestCase', m)
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [testcase_1])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a callable object which returns a TestCase ... instance"
+ #*****************************************************************
+ #Override the suiteClass attribute to ensure that the suiteClass
+ #attribute is used
+ def test_loadTestsFromName__callable__TestCase_instance_ProperSuiteClass(self):
+ class SubTestSuite(unittest.TestSuite):
+ pass
+ m = types.ModuleType('m')
+ testcase_1 = unittest.FunctionTestCase(lambda: None)
+ def return_TestCase():
+ return testcase_1
+ m.return_TestCase = return_TestCase
+
+ loader = unittest.TestLoader()
+ loader.suiteClass = SubTestSuite
+ suite = loader.loadTestsFromName('return_TestCase', m)
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [testcase_1])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a test method within a test case class"
+ #*****************************************************************
+ #Override the suiteClass attribute to ensure that the suiteClass
+ #attribute is used
+ def test_loadTestsFromName__relative_testmethod_ProperSuiteClass(self):
+ class SubTestSuite(unittest.TestSuite):
+ pass
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testcase_1 = MyTestCase
+
+ loader = unittest.TestLoader()
+ loader.suiteClass=SubTestSuite
+ suite = loader.loadTestsFromName('testcase_1.test', m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ self.assertEqual(list(suite), [MyTestCase('test')])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a callable object which returns a TestCase or TestSuite instance"
+ #
+ # What happens if the callable returns something else?
+ def test_loadTestsFromName__callable__wrong_type(self):
+ m = types.ModuleType('m')
+ def return_wrong():
+ return 6
+ m.return_wrong = return_wrong
+
+ loader = unittest.TestLoader()
+ try:
+ suite = loader.loadTestsFromName('return_wrong', m)
+ except TypeError:
+ pass
+ else:
+ self.fail("TestLoader.loadTestsFromName failed to raise TypeError")
+
+ # "The specifier can refer to modules and packages which have not been
+ # imported; they will be imported as a side-effect"
+ def test_loadTestsFromName__module_not_loaded(self):
+ # We're going to try to load this module as a side-effect, so it
+ # better not be loaded before we try.
+ #
+ module_name = 'unittest.test.dummy'
+ sys.modules.pop(module_name, None)
+
+ loader = unittest.TestLoader()
+ try:
+ suite = loader.loadTestsFromName(module_name)
+
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [])
+
+ # module should now be loaded, thanks to loadTestsFromName()
+ self.assertIn(module_name, sys.modules)
+ finally:
+ if module_name in sys.modules:
+ del sys.modules[module_name]
+
+ ################################################################
+ ### Tests for TestLoader.loadTestsFromName()
+
+ ### Tests for TestLoader.loadTestsFromNames()
+ ################################################################
+
+ # "Similar to loadTestsFromName(), but takes a sequence of names rather
+ # than a single name."
+ #
+ # What happens if that sequence of names is empty?
+ def test_loadTestsFromNames__empty_name_list(self):
+ loader = unittest.TestLoader()
+
+ suite = loader.loadTestsFromNames([])
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [])
+
+ # "Similar to loadTestsFromName(), but takes a sequence of names rather
+ # than a single name."
+ # ...
+ # "The method optionally resolves name relative to the given module"
+ #
+ # What happens if that sequence of names is empty?
+ #
+ # XXX Should this raise a ValueError or just return an empty TestSuite?
+ def test_loadTestsFromNames__relative_empty_name_list(self):
+ loader = unittest.TestLoader()
+
+ suite = loader.loadTestsFromNames([], unittest)
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [])
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # Is ValueError raised in response to an empty name?
+ def test_loadTestsFromNames__empty_name(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromNames([''])
+ except ValueError as e:
+ self.assertEqual(str(e), "Empty module name")
+ else:
+ self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # What happens when presented with an impossible module name?
+ def test_loadTestsFromNames__malformed_name(self):
+ loader = unittest.TestLoader()
+
+ # XXX Should this raise ValueError or ImportError?
+ try:
+ loader.loadTestsFromNames(['abc () //'])
+ except ValueError:
+ pass
+ except ImportError:
+ pass
+ else:
+ self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # What happens when no module can be found for the given name?
+ def test_loadTestsFromNames__unknown_module_name(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromNames(['sdasfasfasdf'])
+ except ImportError as e:
+ self.assertEqual(str(e), "No module named sdasfasfasdf")
+ else:
+ self.fail("TestLoader.loadTestsFromNames failed to raise ImportError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # What happens when the module can be found, but not the attribute?
+ def test_loadTestsFromNames__unknown_attr_name(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromNames(['unittest.sdasfasfasdf', 'unittest'])
+ except AttributeError as e:
+ self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
+ else:
+ self.fail("TestLoader.loadTestsFromNames failed to raise AttributeError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ # ...
+ # "The method optionally resolves name relative to the given module"
+ #
+ # What happens when given an unknown attribute on a specified `module`
+ # argument?
+ def test_loadTestsFromNames__unknown_name_relative_1(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromNames(['sdasfasfasdf'], unittest)
+ except AttributeError as e:
+ self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
+ else:
+ self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ # ...
+ # "The method optionally resolves name relative to the given module"
+ #
+ # Do unknown attributes (relative to a provided module) still raise an
+ # exception even in the presence of valid attribute names?
+ def test_loadTestsFromNames__unknown_name_relative_2(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromNames(['TestCase', 'sdasfasfasdf'], unittest)
+ except AttributeError as e:
+ self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
+ else:
+ self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ # ...
+ # "The method optionally resolves name relative to the given module"
+ #
+ # What happens when faced with the empty string?
+ #
+ # XXX This currently raises AttributeError, though ValueError is probably
+ # more appropriate
+ def test_loadTestsFromNames__relative_empty_name(self):
+ loader = unittest.TestLoader()
+
+ try:
+ loader.loadTestsFromNames([''], unittest)
+ except AttributeError:
+ pass
+ else:
+ self.fail("Failed to raise ValueError")
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ # ...
+ # "The method optionally resolves name relative to the given module"
+ #
+ # What happens when presented with an impossible attribute name?
+ def test_loadTestsFromNames__relative_malformed_name(self):
+ loader = unittest.TestLoader()
+
+ # XXX Should this raise AttributeError or ValueError?
+ try:
+ loader.loadTestsFromNames(['abc () //'], unittest)
+ except AttributeError:
+ pass
+ except ValueError:
+ pass
+ else:
+ self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
+
+ # "The method optionally resolves name relative to the given module"
+ #
+ # Does loadTestsFromNames() make sure the provided `module` is in fact
+ # a module?
+ #
+ # XXX This validation is currently not done. This flexibility should
+ # either be documented or a TypeError should be raised.
+ def test_loadTestsFromNames__relative_not_a_module(self):
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+
+ class NotAModule(object):
+ test_2 = MyTestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromNames(['test_2'], NotAModule)
+
+ reference = [unittest.TestSuite([MyTestCase('test')])]
+ self.assertEqual(list(suite), reference)
+
+ # "The specifier name is a ``dotted name'' that may resolve either to
+ # a module, a test case class, a TestSuite instance, a test method
+ # within a test case class, or a callable object which returns a
+ # TestCase or TestSuite instance."
+ #
+ # Does it raise an exception if the name resolves to an invalid
+ # object?
+ def test_loadTestsFromNames__relative_bad_object(self):
+ m = types.ModuleType('m')
+ m.testcase_1 = object()
+
+ loader = unittest.TestLoader()
+ try:
+ loader.loadTestsFromNames(['testcase_1'], m)
+ except TypeError:
+ pass
+ else:
+ self.fail("Should have raised TypeError")
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a test case class"
+ def test_loadTestsFromNames__relative_TestCase_subclass(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testcase_1 = MyTestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromNames(['testcase_1'], m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ expected = loader.suiteClass([MyTestCase('test')])
+ self.assertEqual(list(suite), [expected])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a TestSuite instance"
+ def test_loadTestsFromNames__relative_TestSuite(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testsuite = unittest.TestSuite([MyTestCase('test')])
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromNames(['testsuite'], m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ self.assertEqual(list(suite), [m.testsuite])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to ... a
+ # test method within a test case class"
+ def test_loadTestsFromNames__relative_testmethod(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testcase_1 = MyTestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromNames(['testcase_1.test'], m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ ref_suite = unittest.TestSuite([MyTestCase('test')])
+ self.assertEqual(list(suite), [ref_suite])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to ... a
+ # test method within a test case class"
+ #
+ # Does the method gracefully handle names that initially look like they
+ # resolve to "a test method within a test case class" but don't?
+ def test_loadTestsFromNames__relative_invalid_testmethod(self):
+ m = types.ModuleType('m')
+ class MyTestCase(unittest.TestCase):
+ def test(self):
+ pass
+ m.testcase_1 = MyTestCase
+
+ loader = unittest.TestLoader()
+ try:
+ loader.loadTestsFromNames(['testcase_1.testfoo'], m)
+ except AttributeError as e:
+ self.assertEqual(str(e), "type object 'MyTestCase' has no attribute 'testfoo'")
+ else:
+ self.fail("Failed to raise AttributeError")
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a callable object which returns a ... TestSuite instance"
+ def test_loadTestsFromNames__callable__TestSuite(self):
+ m = types.ModuleType('m')
+ testcase_1 = unittest.FunctionTestCase(lambda: None)
+ testcase_2 = unittest.FunctionTestCase(lambda: None)
+ def return_TestSuite():
+ return unittest.TestSuite([testcase_1, testcase_2])
+ m.return_TestSuite = return_TestSuite
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromNames(['return_TestSuite'], m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ expected = unittest.TestSuite([testcase_1, testcase_2])
+ self.assertEqual(list(suite), [expected])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a callable object which returns a TestCase ... instance"
+ def test_loadTestsFromNames__callable__TestCase_instance(self):
+ m = types.ModuleType('m')
+ testcase_1 = unittest.FunctionTestCase(lambda: None)
+ def return_TestCase():
+ return testcase_1
+ m.return_TestCase = return_TestCase
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromNames(['return_TestCase'], m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ ref_suite = unittest.TestSuite([testcase_1])
+ self.assertEqual(list(suite), [ref_suite])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a callable object which returns a TestCase or TestSuite instance"
+ #
+ # Are staticmethods handled correctly?
+ def test_loadTestsFromNames__callable__call_staticmethod(self):
+ m = types.ModuleType('m')
+ class Test1(unittest.TestCase):
+ def test(self):
+ pass
+
+ testcase_1 = Test1('test')
+ class Foo(unittest.TestCase):
+ @staticmethod
+ def foo():
+ return testcase_1
+ m.Foo = Foo
+
+ loader = unittest.TestLoader()
+ suite = loader.loadTestsFromNames(['Foo.foo'], m)
+ self.assertIsInstance(suite, loader.suiteClass)
+
+ ref_suite = unittest.TestSuite([testcase_1])
+ self.assertEqual(list(suite), [ref_suite])
+
+ # "The specifier name is a ``dotted name'' that may resolve ... to
+ # ... a callable object which returns a TestCase or TestSuite instance"
+ #
+ # What happens when the callable returns something else?
+ def test_loadTestsFromNames__callable__wrong_type(self):
+ m = types.ModuleType('m')
+ def return_wrong():
+ return 6
+ m.return_wrong = return_wrong
+
+ loader = unittest.TestLoader()
+ try:
+ suite = loader.loadTestsFromNames(['return_wrong'], m)
+ except TypeError:
+ pass
+ else:
+ self.fail("TestLoader.loadTestsFromNames failed to raise TypeError")
+
+ # "The specifier can refer to modules and packages which have not been
+ # imported; they will be imported as a side-effect"
+ def test_loadTestsFromNames__module_not_loaded(self):
+ # We're going to try to load this module as a side-effect, so it
+ # better not be loaded before we try.
+ #
+ module_name = 'unittest.test.dummy'
+ sys.modules.pop(module_name, None)
+
+ loader = unittest.TestLoader()
+ try:
+ suite = loader.loadTestsFromNames([module_name])
+
+ self.assertIsInstance(suite, loader.suiteClass)
+ self.assertEqual(list(suite), [unittest.TestSuite()])
+
+ # module should now be loaded, thanks to loadTestsFromName()
+ self.assertIn(module_name, sys.modules)
+ finally:
+ if module_name in sys.modules:
+ del sys.modules[module_name]
+
+ ################################################################
+ ### /Tests for TestLoader.loadTestsFromNames()
+
+ ### Tests for TestLoader.getTestCaseNames()
+ ################################################################
+
+ # "Return a sorted sequence of method names found within testCaseClass"
+ #
+ # Test.foobar is defined to make sure getTestCaseNames() respects
+ # loader.testMethodPrefix
+ def test_getTestCaseNames(self):
+ class Test(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foobar(self): pass
+
+ loader = unittest.TestLoader()
+
+ self.assertEqual(loader.getTestCaseNames(Test), ['test_1', 'test_2'])
+
+ # "Return a sorted sequence of method names found within testCaseClass"
+ #
+ # Does getTestCaseNames() behave appropriately if no tests are found?
+ def test_getTestCaseNames__no_tests(self):
+ class Test(unittest.TestCase):
+ def foobar(self): pass
+
+ loader = unittest.TestLoader()
+
+ self.assertEqual(loader.getTestCaseNames(Test), [])
+
+ # "Return a sorted sequence of method names found within testCaseClass"
+ #
+ # Are not-TestCases handled gracefully?
+ #
+ # XXX This should raise a TypeError, not return a list
+ #
+ # XXX It's too late in the 2.5 release cycle to fix this, but it should
+ # probably be revisited for 2.6
+ def test_getTestCaseNames__not_a_TestCase(self):
+ class BadCase(int):
+ def test_foo(self):
+ pass
+
+ loader = unittest.TestLoader()
+ names = loader.getTestCaseNames(BadCase)
+
+ self.assertEqual(names, ['test_foo'])
+
+ # "Return a sorted sequence of method names found within testCaseClass"
+ #
+ # Make sure inherited names are handled.
+ #
+ # TestP.foobar is defined to make sure getTestCaseNames() respects
+ # loader.testMethodPrefix
+ def test_getTestCaseNames__inheritance(self):
+ class TestP(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foobar(self): pass
+
+ class TestC(TestP):
+ def test_1(self): pass
+ def test_3(self): pass
+
+ loader = unittest.TestLoader()
+
+ names = ['test_1', 'test_2', 'test_3']
+ self.assertEqual(loader.getTestCaseNames(TestC), names)
+
+ ################################################################
+ ### /Tests for TestLoader.getTestCaseNames()
+
+ ### Tests for TestLoader.testMethodPrefix
+ ################################################################
+
+ # "String giving the prefix of method names which will be interpreted as
+ # test methods"
+ #
+ # Implicit in the documentation is that testMethodPrefix is respected by
+ # all loadTestsFrom* methods.
+ def test_testMethodPrefix__loadTestsFromTestCase(self):
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foo_bar(self): pass
+
+ tests_1 = unittest.TestSuite([Foo('foo_bar')])
+ tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
+
+ loader = unittest.TestLoader()
+ loader.testMethodPrefix = 'foo'
+ self.assertEqual(loader.loadTestsFromTestCase(Foo), tests_1)
+
+ loader.testMethodPrefix = 'test'
+ self.assertEqual(loader.loadTestsFromTestCase(Foo), tests_2)
+
+ # "String giving the prefix of method names which will be interpreted as
+ # test methods"
+ #
+ # Implicit in the documentation is that testMethodPrefix is respected by
+ # all loadTestsFrom* methods.
+ def test_testMethodPrefix__loadTestsFromModule(self):
+ m = types.ModuleType('m')
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foo_bar(self): pass
+ m.Foo = Foo
+
+ tests_1 = [unittest.TestSuite([Foo('foo_bar')])]
+ tests_2 = [unittest.TestSuite([Foo('test_1'), Foo('test_2')])]
+
+ loader = unittest.TestLoader()
+ loader.testMethodPrefix = 'foo'
+ self.assertEqual(list(loader.loadTestsFromModule(m)), tests_1)
+
+ loader.testMethodPrefix = 'test'
+ self.assertEqual(list(loader.loadTestsFromModule(m)), tests_2)
+
+ # "String giving the prefix of method names which will be interpreted as
+ # test methods"
+ #
+ # Implicit in the documentation is that testMethodPrefix is respected by
+ # all loadTestsFrom* methods.
+ def test_testMethodPrefix__loadTestsFromName(self):
+ m = types.ModuleType('m')
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foo_bar(self): pass
+ m.Foo = Foo
+
+ tests_1 = unittest.TestSuite([Foo('foo_bar')])
+ tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
+
+ loader = unittest.TestLoader()
+ loader.testMethodPrefix = 'foo'
+ self.assertEqual(loader.loadTestsFromName('Foo', m), tests_1)
+
+ loader.testMethodPrefix = 'test'
+ self.assertEqual(loader.loadTestsFromName('Foo', m), tests_2)
+
+ # "String giving the prefix of method names which will be interpreted as
+ # test methods"
+ #
+ # Implicit in the documentation is that testMethodPrefix is respected by
+ # all loadTestsFrom* methods.
+ def test_testMethodPrefix__loadTestsFromNames(self):
+ m = types.ModuleType('m')
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foo_bar(self): pass
+ m.Foo = Foo
+
+ tests_1 = unittest.TestSuite([unittest.TestSuite([Foo('foo_bar')])])
+ tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
+ tests_2 = unittest.TestSuite([tests_2])
+
+ loader = unittest.TestLoader()
+ loader.testMethodPrefix = 'foo'
+ self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests_1)
+
+ loader.testMethodPrefix = 'test'
+ self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests_2)
+
+ # "The default value is 'test'"
+ def test_testMethodPrefix__default_value(self):
+ loader = unittest.TestLoader()
+ self.assertEqual(loader.testMethodPrefix, 'test')
+
+ ################################################################
+ ### /Tests for TestLoader.testMethodPrefix
+
+ ### Tests for TestLoader.sortTestMethodsUsing
+ ################################################################
+
+ # "Function to be used to compare method names when sorting them in
+ # getTestCaseNames() and all the loadTestsFromX() methods"
+ def test_sortTestMethodsUsing__loadTestsFromTestCase(self):
+ def reversed_cmp(x, y):
+ return -((x > y) - (x < y))
+
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+
+ loader = unittest.TestLoader()
+ loader.sortTestMethodsUsing = reversed_cmp
+
+ tests = loader.suiteClass([Foo('test_2'), Foo('test_1')])
+ self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)
+
+ # "Function to be used to compare method names when sorting them in
+ # getTestCaseNames() and all the loadTestsFromX() methods"
+ def test_sortTestMethodsUsing__loadTestsFromModule(self):
+ def reversed_cmp(x, y):
+ return -((x > y) - (x < y))
+
+ m = types.ModuleType('m')
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ m.Foo = Foo
+
+ loader = unittest.TestLoader()
+ loader.sortTestMethodsUsing = reversed_cmp
+
+ tests = [loader.suiteClass([Foo('test_2'), Foo('test_1')])]
+ self.assertEqual(list(loader.loadTestsFromModule(m)), tests)
+
+ # "Function to be used to compare method names when sorting them in
+ # getTestCaseNames() and all the loadTestsFromX() methods"
+ def test_sortTestMethodsUsing__loadTestsFromName(self):
+ def reversed_cmp(x, y):
+ return -((x > y) - (x < y))
+
+ m = types.ModuleType('m')
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ m.Foo = Foo
+
+ loader = unittest.TestLoader()
+ loader.sortTestMethodsUsing = reversed_cmp
+
+ tests = loader.suiteClass([Foo('test_2'), Foo('test_1')])
+ self.assertEqual(loader.loadTestsFromName('Foo', m), tests)
+
+ # "Function to be used to compare method names when sorting them in
+ # getTestCaseNames() and all the loadTestsFromX() methods"
+ def test_sortTestMethodsUsing__loadTestsFromNames(self):
+ def reversed_cmp(x, y):
+ return -((x > y) - (x < y))
+
+ m = types.ModuleType('m')
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ m.Foo = Foo
+
+ loader = unittest.TestLoader()
+ loader.sortTestMethodsUsing = reversed_cmp
+
+ tests = [loader.suiteClass([Foo('test_2'), Foo('test_1')])]
+ self.assertEqual(list(loader.loadTestsFromNames(['Foo'], m)), tests)
+
+ # "Function to be used to compare method names when sorting them in
+ # getTestCaseNames()"
+ #
+ # Does it actually affect getTestCaseNames()?
+ def test_sortTestMethodsUsing__getTestCaseNames(self):
+ def reversed_cmp(x, y):
+ return -((x > y) - (x < y))
+
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+
+ loader = unittest.TestLoader()
+ loader.sortTestMethodsUsing = reversed_cmp
+
+ test_names = ['test_2', 'test_1']
+ self.assertEqual(loader.getTestCaseNames(Foo), test_names)
+
+ # "The default value is the built-in cmp() function"
+ # Since cmp is now defunct, we simply verify that the results
+ # occur in the same order as they would with the default sort.
+ def test_sortTestMethodsUsing__default_value(self):
+ loader = unittest.TestLoader()
+
+ class Foo(unittest.TestCase):
+ def test_2(self): pass
+ def test_3(self): pass
+ def test_1(self): pass
+
+ test_names = ['test_2', 'test_3', 'test_1']
+ self.assertEqual(loader.getTestCaseNames(Foo), sorted(test_names))
+
+
+ # "it can be set to None to disable the sort."
+ #
+ # XXX How is this different from reassigning cmp? Are the tests returned
+ # in a random order or something? This behaviour should die
+ def test_sortTestMethodsUsing__None(self):
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+
+ loader = unittest.TestLoader()
+ loader.sortTestMethodsUsing = None
+
+ test_names = ['test_2', 'test_1']
+ self.assertEqual(set(loader.getTestCaseNames(Foo)), set(test_names))
+
+ ################################################################
+ ### /Tests for TestLoader.sortTestMethodsUsing
+
+ ### Tests for TestLoader.suiteClass
+ ################################################################
+
+ # "Callable object that constructs a test suite from a list of tests."
+ def test_suiteClass__loadTestsFromTestCase(self):
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foo_bar(self): pass
+
+ tests = [Foo('test_1'), Foo('test_2')]
+
+ loader = unittest.TestLoader()
+ loader.suiteClass = list
+ self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)
+
+ # It is implicit in the documentation for TestLoader.suiteClass that
+ # all TestLoader.loadTestsFrom* methods respect it. Let's make sure
+ def test_suiteClass__loadTestsFromModule(self):
+ m = types.ModuleType('m')
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foo_bar(self): pass
+ m.Foo = Foo
+
+ tests = [[Foo('test_1'), Foo('test_2')]]
+
+ loader = unittest.TestLoader()
+ loader.suiteClass = list
+ self.assertEqual(loader.loadTestsFromModule(m), tests)
+
+ # It is implicit in the documentation for TestLoader.suiteClass that
+ # all TestLoader.loadTestsFrom* methods respect it. Let's make sure
+ def test_suiteClass__loadTestsFromName(self):
+ m = types.ModuleType('m')
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foo_bar(self): pass
+ m.Foo = Foo
+
+ tests = [Foo('test_1'), Foo('test_2')]
+
+ loader = unittest.TestLoader()
+ loader.suiteClass = list
+ self.assertEqual(loader.loadTestsFromName('Foo', m), tests)
+
+ # It is implicit in the documentation for TestLoader.suiteClass that
+ # all TestLoader.loadTestsFrom* methods respect it. Let's make sure
+ def test_suiteClass__loadTestsFromNames(self):
+ m = types.ModuleType('m')
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def foo_bar(self): pass
+ m.Foo = Foo
+
+ tests = [[Foo('test_1'), Foo('test_2')]]
+
+ loader = unittest.TestLoader()
+ loader.suiteClass = list
+ self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests)
+
+ # "The default value is the TestSuite class"
+ def test_suiteClass__default_value(self):
+ loader = unittest.TestLoader()
+ self.assertTrue(loader.suiteClass is unittest.TestSuite)
diff --git a/Lib/unittest/test/test_program.py b/Lib/unittest/test/test_program.py
new file mode 100644
index 0000000000..d5d0f5a71c
--- /dev/null
+++ b/Lib/unittest/test/test_program.py
@@ -0,0 +1,358 @@
+import io
+
+import os
+import sys
+import unittest
+
+
+class Test_TestProgram(unittest.TestCase):
+
+ def test_discovery_from_dotted_path(self):
+ loader = unittest.TestLoader()
+
+ tests = [self]
+ expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
+
+ self.wasRun = False
+ def _find_tests(start_dir, pattern):
+ self.wasRun = True
+ self.assertEqual(start_dir, expectedPath)
+ return tests
+ loader._find_tests = _find_tests
+ suite = loader.discover('unittest.test')
+ self.assertTrue(self.wasRun)
+ self.assertEqual(suite._tests, tests)
+
+ # Horrible white box test
+ def testNoExit(self):
+ result = object()
+ test = object()
+
+ class FakeRunner(object):
+ def run(self, test):
+ self.test = test
+ return result
+
+ runner = FakeRunner()
+
+ oldParseArgs = unittest.TestProgram.parseArgs
+ def restoreParseArgs():
+ unittest.TestProgram.parseArgs = oldParseArgs
+ unittest.TestProgram.parseArgs = lambda *args: None
+ self.addCleanup(restoreParseArgs)
+
+ def removeTest():
+ del unittest.TestProgram.test
+ unittest.TestProgram.test = test
+ self.addCleanup(removeTest)
+
+ program = unittest.TestProgram(testRunner=runner, exit=False, verbosity=2)
+
+ self.assertEqual(program.result, result)
+ self.assertEqual(runner.test, test)
+ self.assertEqual(program.verbosity, 2)
+
+ class FooBar(unittest.TestCase):
+ def testPass(self):
+ assert True
+ def testFail(self):
+ assert False
+
+ class FooBarLoader(unittest.TestLoader):
+ """Test loader that returns a suite containing FooBar."""
+ def loadTestsFromModule(self, module):
+ return self.suiteClass(
+ [self.loadTestsFromTestCase(Test_TestProgram.FooBar)])
+
+
+ def test_NonExit(self):
+ program = unittest.main(exit=False,
+ argv=["foobar"],
+ testRunner=unittest.TextTestRunner(stream=io.StringIO()),
+ testLoader=self.FooBarLoader())
+ self.assertTrue(hasattr(program, 'result'))
+
+
+ def test_Exit(self):
+ self.assertRaises(
+ SystemExit,
+ unittest.main,
+ argv=["foobar"],
+ testRunner=unittest.TextTestRunner(stream=io.StringIO()),
+ exit=True,
+ testLoader=self.FooBarLoader())
+
+
+ def test_ExitAsDefault(self):
+ self.assertRaises(
+ SystemExit,
+ unittest.main,
+ argv=["foobar"],
+ testRunner=unittest.TextTestRunner(stream=io.StringIO()),
+ testLoader=self.FooBarLoader())
+
+
+class InitialisableProgram(unittest.TestProgram):
+ exit = False
+ result = None
+ verbosity = 1
+ defaultTest = None
+ testRunner = None
+ testLoader = unittest.defaultTestLoader
+ module = '__main__'
+ progName = 'test'
+ test = 'test'
+ def __init__(self, *args):
+ pass
+
+RESULT = object()
+
+class FakeRunner(object):
+ initArgs = None
+ test = None
+ raiseError = False
+
+ def __init__(self, **kwargs):
+ FakeRunner.initArgs = kwargs
+ if FakeRunner.raiseError:
+ FakeRunner.raiseError = False
+ raise TypeError
+
+ def run(self, test):
+ FakeRunner.test = test
+ return RESULT
+
+class TestCommandLineArgs(unittest.TestCase):
+
+ def setUp(self):
+ self.program = InitialisableProgram()
+ self.program.createTests = lambda: None
+ FakeRunner.initArgs = None
+ FakeRunner.test = None
+ FakeRunner.raiseError = False
+
+ def testHelpAndUnknown(self):
+ program = self.program
+ def usageExit(msg=None):
+ program.msg = msg
+ program.exit = True
+ program.usageExit = usageExit
+
+ for opt in '-h', '-H', '--help':
+ program.exit = False
+ program.parseArgs([None, opt])
+ self.assertTrue(program.exit)
+ self.assertIsNone(program.msg)
+
+ program.parseArgs([None, '-$'])
+ self.assertTrue(program.exit)
+ self.assertIsNotNone(program.msg)
+
+ def testVerbosity(self):
+ program = self.program
+
+ for opt in '-q', '--quiet':
+ program.verbosity = 1
+ program.parseArgs([None, opt])
+ self.assertEqual(program.verbosity, 0)
+
+ for opt in '-v', '--verbose':
+ program.verbosity = 1
+ program.parseArgs([None, opt])
+ self.assertEqual(program.verbosity, 2)
+
+ def testBufferCatchFailfast(self):
+ program = self.program
+ for arg, attr in (('buffer', 'buffer'), ('failfast', 'failfast'),
+ ('catch', 'catchbreak')):
+ if attr == 'catch' and not hasInstallHandler:
+ continue
+
+ short_opt = '-%s' % arg[0]
+ long_opt = '--%s' % arg
+ for opt in short_opt, long_opt:
+ setattr(program, attr, None)
+
+ program.parseArgs([None, opt])
+ self.assertTrue(getattr(program, attr))
+
+ for opt in short_opt, long_opt:
+ not_none = object()
+ setattr(program, attr, not_none)
+
+ program.parseArgs([None, opt])
+ self.assertEqual(getattr(program, attr), not_none)
+
+ def testWarning(self):
+ """Test the warnings argument"""
+ # see #10535
+ class FakeTP(unittest.TestProgram):
+ def parseArgs(self, *args, **kw): pass
+ def runTests(self, *args, **kw): pass
+ warnoptions = sys.warnoptions[:]
+ try:
+ sys.warnoptions[:] = []
+ # no warn options, no arg -> default
+ self.assertEqual(FakeTP().warnings, 'default')
+ # no warn options, w/ arg -> arg value
+ self.assertEqual(FakeTP(warnings='ignore').warnings, 'ignore')
+ sys.warnoptions[:] = ['somevalue']
+ # warn options, no arg -> None
+ # warn options, w/ arg -> arg value
+ self.assertEqual(FakeTP().warnings, None)
+ self.assertEqual(FakeTP(warnings='ignore').warnings, 'ignore')
+ finally:
+ sys.warnoptions[:] = warnoptions
+
+ def testRunTestsRunnerClass(self):
+ program = self.program
+
+ program.testRunner = FakeRunner
+ program.verbosity = 'verbosity'
+ program.failfast = 'failfast'
+ program.buffer = 'buffer'
+ program.warnings = 'warnings'
+
+ program.runTests()
+
+ self.assertEqual(FakeRunner.initArgs, {'verbosity': 'verbosity',
+ 'failfast': 'failfast',
+ 'buffer': 'buffer',
+ 'warnings': 'warnings'})
+ self.assertEqual(FakeRunner.test, 'test')
+ self.assertIs(program.result, RESULT)
+
+ def testRunTestsRunnerInstance(self):
+ program = self.program
+
+ program.testRunner = FakeRunner()
+ FakeRunner.initArgs = None
+
+ program.runTests()
+
+ # A new FakeRunner should not have been instantiated
+ self.assertIsNone(FakeRunner.initArgs)
+
+ self.assertEqual(FakeRunner.test, 'test')
+ self.assertIs(program.result, RESULT)
+
+ def testRunTestsOldRunnerClass(self):
+ program = self.program
+
+ FakeRunner.raiseError = True
+ program.testRunner = FakeRunner
+ program.verbosity = 'verbosity'
+ program.failfast = 'failfast'
+ program.buffer = 'buffer'
+ program.test = 'test'
+
+ program.runTests()
+
+ # If initialising raises a type error it should be retried
+ # without the new keyword arguments
+ self.assertEqual(FakeRunner.initArgs, {})
+ self.assertEqual(FakeRunner.test, 'test')
+ self.assertIs(program.result, RESULT)
+
+ def testCatchBreakInstallsHandler(self):
+ module = sys.modules['unittest.main']
+ original = module.installHandler
+ def restore():
+ module.installHandler = original
+ self.addCleanup(restore)
+
+ self.installed = False
+ def fakeInstallHandler():
+ self.installed = True
+ module.installHandler = fakeInstallHandler
+
+ program = self.program
+ program.catchbreak = True
+
+ program.testRunner = FakeRunner
+
+ program.runTests()
+ self.assertTrue(self.installed)
+
+ def _patch_isfile(self, names, exists=True):
+ def isfile(path):
+ return path in names
+ original = os.path.isfile
+ os.path.isfile = isfile
+ def restore():
+ os.path.isfile = original
+ self.addCleanup(restore)
+
+
+ def testParseArgsFileNames(self):
+ # running tests with filenames instead of module names
+ program = self.program
+ argv = ['progname', 'foo.py', 'bar.Py', 'baz.PY', 'wing.txt']
+ self._patch_isfile(argv)
+
+ program.createTests = lambda: None
+ program.parseArgs(argv)
+
+ # note that 'wing.txt' is not a Python file so the name should
+ # *not* be converted to a module name
+ expected = ['foo', 'bar', 'baz', 'wing.txt']
+ self.assertEqual(program.testNames, expected)
+
+
+ def testParseArgsFilePaths(self):
+ program = self.program
+ argv = ['progname', 'foo/bar/baz.py', 'green\\red.py']
+ self._patch_isfile(argv)
+
+ program.createTests = lambda: None
+ program.parseArgs(argv)
+
+ expected = ['foo.bar.baz', 'green.red']
+ self.assertEqual(program.testNames, expected)
+
+
+ def testParseArgsNonExistentFiles(self):
+ program = self.program
+ argv = ['progname', 'foo/bar/baz.py', 'green\\red.py']
+ self._patch_isfile([])
+
+ program.createTests = lambda: None
+ program.parseArgs(argv)
+
+ self.assertEqual(program.testNames, argv[1:])
+
+ def testParseArgsAbsolutePathsThatCanBeConverted(self):
+ cur_dir = os.getcwd()
+ program = self.program
+ def _join(name):
+ return os.path.join(cur_dir, name)
+ argv = ['progname', _join('foo/bar/baz.py'), _join('green\\red.py')]
+ self._patch_isfile(argv)
+
+ program.createTests = lambda: None
+ program.parseArgs(argv)
+
+ expected = ['foo.bar.baz', 'green.red']
+ self.assertEqual(program.testNames, expected)
+
+ def testParseArgsAbsolutePathsThatCannotBeConverted(self):
+ program = self.program
+ # even on Windows '/...' is considered absolute by os.path.abspath
+ argv = ['progname', '/foo/bar/baz.py', '/green/red.py']
+ self._patch_isfile(argv)
+
+ program.createTests = lambda: None
+ program.parseArgs(argv)
+
+ self.assertEqual(program.testNames, argv[1:])
+
+ # it may be better to use platform specific functions to normalise paths
+ # rather than accepting '.PY' and '\' as file seprator on Linux / Mac
+ # it would also be better to check that a filename is a valid module
+ # identifier (we have a regex for this in loader.py)
+ # for invalid filenames should we raise a useful error rather than
+ # leaving the current error message (import of filename fails) in place?
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/Lib/unittest/test/test_result.py b/Lib/unittest/test/test_result.py
new file mode 100644
index 0000000000..1c58e61bb2
--- /dev/null
+++ b/Lib/unittest/test/test_result.py
@@ -0,0 +1,568 @@
+import io
+import sys
+import textwrap
+
+from test import support
+
+import traceback
+import unittest
+
+
+class Test_TestResult(unittest.TestCase):
+ # Note: there are not separate tests for TestResult.wasSuccessful(),
+ # TestResult.errors, TestResult.failures, TestResult.testsRun or
+ # TestResult.shouldStop because these only have meaning in terms of
+ # other TestResult methods.
+ #
+ # Accordingly, tests for the aforenamed attributes are incorporated
+ # in with the tests for the defining methods.
+ ################################################################
+
+ def test_init(self):
+ result = unittest.TestResult()
+
+ self.assertTrue(result.wasSuccessful())
+ self.assertEqual(len(result.errors), 0)
+ self.assertEqual(len(result.failures), 0)
+ self.assertEqual(result.testsRun, 0)
+ self.assertEqual(result.shouldStop, False)
+ self.assertIsNone(result._stdout_buffer)
+ self.assertIsNone(result._stderr_buffer)
+
+ # "This method can be called to signal that the set of tests being
+ # run should be aborted by setting the TestResult's shouldStop
+ # attribute to True."
+ def test_stop(self):
+ result = unittest.TestResult()
+
+ result.stop()
+
+ self.assertEqual(result.shouldStop, True)
+
+ # "Called when the test case test is about to be run. The default
+ # implementation simply increments the instance's testsRun counter."
+ def test_startTest(self):
+ class Foo(unittest.TestCase):
+ def test_1(self):
+ pass
+
+ test = Foo('test_1')
+
+ result = unittest.TestResult()
+
+ result.startTest(test)
+
+ self.assertTrue(result.wasSuccessful())
+ self.assertEqual(len(result.errors), 0)
+ self.assertEqual(len(result.failures), 0)
+ self.assertEqual(result.testsRun, 1)
+ self.assertEqual(result.shouldStop, False)
+
+ result.stopTest(test)
+
+ # "Called after the test case test has been executed, regardless of
+ # the outcome. The default implementation does nothing."
+ def test_stopTest(self):
+ class Foo(unittest.TestCase):
+ def test_1(self):
+ pass
+
+ test = Foo('test_1')
+
+ result = unittest.TestResult()
+
+ result.startTest(test)
+
+ self.assertTrue(result.wasSuccessful())
+ self.assertEqual(len(result.errors), 0)
+ self.assertEqual(len(result.failures), 0)
+ self.assertEqual(result.testsRun, 1)
+ self.assertEqual(result.shouldStop, False)
+
+ result.stopTest(test)
+
+ # Same tests as above; make sure nothing has changed
+ self.assertTrue(result.wasSuccessful())
+ self.assertEqual(len(result.errors), 0)
+ self.assertEqual(len(result.failures), 0)
+ self.assertEqual(result.testsRun, 1)
+ self.assertEqual(result.shouldStop, False)
+
+ # "Called before and after tests are run. The default implementation does nothing."
+ def test_startTestRun_stopTestRun(self):
+ result = unittest.TestResult()
+ result.startTestRun()
+ result.stopTestRun()
+
+ # "addSuccess(test)"
+ # ...
+ # "Called when the test case test succeeds"
+ # ...
+ # "wasSuccessful() - Returns True if all tests run so far have passed,
+ # otherwise returns False"
+ # ...
+ # "testsRun - The total number of tests run so far."
+ # ...
+ # "errors - A list containing 2-tuples of TestCase instances and
+ # formatted tracebacks. Each tuple represents a test which raised an
+ # unexpected exception. Contains formatted
+ # tracebacks instead of sys.exc_info() results."
+ # ...
+ # "failures - A list containing 2-tuples of TestCase instances and
+ # formatted tracebacks. Each tuple represents a test where a failure was
+ # explicitly signalled using the TestCase.fail*() or TestCase.assert*()
+ # methods. Contains formatted tracebacks instead
+ # of sys.exc_info() results."
+ def test_addSuccess(self):
+ class Foo(unittest.TestCase):
+ def test_1(self):
+ pass
+
+ test = Foo('test_1')
+
+ result = unittest.TestResult()
+
+ result.startTest(test)
+ result.addSuccess(test)
+ result.stopTest(test)
+
+ self.assertTrue(result.wasSuccessful())
+ self.assertEqual(len(result.errors), 0)
+ self.assertEqual(len(result.failures), 0)
+ self.assertEqual(result.testsRun, 1)
+ self.assertEqual(result.shouldStop, False)
+
+ # "addFailure(test, err)"
+ # ...
+ # "Called when the test case test signals a failure. err is a tuple of
+ # the form returned by sys.exc_info(): (type, value, traceback)"
+ # ...
+ # "wasSuccessful() - Returns True if all tests run so far have passed,
+ # otherwise returns False"
+ # ...
+ # "testsRun - The total number of tests run so far."
+ # ...
+ # "errors - A list containing 2-tuples of TestCase instances and
+ # formatted tracebacks. Each tuple represents a test which raised an
+ # unexpected exception. Contains formatted
+ # tracebacks instead of sys.exc_info() results."
+ # ...
+ # "failures - A list containing 2-tuples of TestCase instances and
+ # formatted tracebacks. Each tuple represents a test where a failure was
+ # explicitly signalled using the TestCase.fail*() or TestCase.assert*()
+ # methods. Contains formatted tracebacks instead
+ # of sys.exc_info() results."
+ def test_addFailure(self):
+ class Foo(unittest.TestCase):
+ def test_1(self):
+ pass
+
+ test = Foo('test_1')
+ try:
+ test.fail("foo")
+ except:
+ exc_info_tuple = sys.exc_info()
+
+ result = unittest.TestResult()
+
+ result.startTest(test)
+ result.addFailure(test, exc_info_tuple)
+ result.stopTest(test)
+
+ self.assertFalse(result.wasSuccessful())
+ self.assertEqual(len(result.errors), 0)
+ self.assertEqual(len(result.failures), 1)
+ self.assertEqual(result.testsRun, 1)
+ self.assertEqual(result.shouldStop, False)
+
+ test_case, formatted_exc = result.failures[0]
+ self.assertTrue(test_case is test)
+ self.assertIsInstance(formatted_exc, str)
+
+ # "addError(test, err)"
+ # ...
+ # "Called when the test case test raises an unexpected exception err
+ # is a tuple of the form returned by sys.exc_info():
+ # (type, value, traceback)"
+ # ...
+ # "wasSuccessful() - Returns True if all tests run so far have passed,
+ # otherwise returns False"
+ # ...
+ # "testsRun - The total number of tests run so far."
+ # ...
+ # "errors - A list containing 2-tuples of TestCase instances and
+ # formatted tracebacks. Each tuple represents a test which raised an
+ # unexpected exception. Contains formatted
+ # tracebacks instead of sys.exc_info() results."
+ # ...
+ # "failures - A list containing 2-tuples of TestCase instances and
+ # formatted tracebacks. Each tuple represents a test where a failure was
+ # explicitly signalled using the TestCase.fail*() or TestCase.assert*()
+ # methods. Contains formatted tracebacks instead
+ # of sys.exc_info() results."
+ def test_addError(self):
+ class Foo(unittest.TestCase):
+ def test_1(self):
+ pass
+
+ test = Foo('test_1')
+ try:
+ raise TypeError()
+ except:
+ exc_info_tuple = sys.exc_info()
+
+ result = unittest.TestResult()
+
+ result.startTest(test)
+ result.addError(test, exc_info_tuple)
+ result.stopTest(test)
+
+ self.assertFalse(result.wasSuccessful())
+ self.assertEqual(len(result.errors), 1)
+ self.assertEqual(len(result.failures), 0)
+ self.assertEqual(result.testsRun, 1)
+ self.assertEqual(result.shouldStop, False)
+
+ test_case, formatted_exc = result.errors[0]
+ self.assertTrue(test_case is test)
+ self.assertIsInstance(formatted_exc, str)
+
+ def testGetDescriptionWithoutDocstring(self):
+ result = unittest.TextTestResult(None, True, 1)
+ self.assertEqual(
+ result.getDescription(self),
+ 'testGetDescriptionWithoutDocstring (' + __name__ +
+ '.Test_TestResult)')
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def testGetDescriptionWithOneLineDocstring(self):
+ """Tests getDescription() for a method with a docstring."""
+ result = unittest.TextTestResult(None, True, 1)
+ self.assertEqual(
+ result.getDescription(self),
+ ('testGetDescriptionWithOneLineDocstring '
+ '(' + __name__ + '.Test_TestResult)\n'
+ 'Tests getDescription() for a method with a docstring.'))
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def testGetDescriptionWithMultiLineDocstring(self):
+ """Tests getDescription() for a method with a longer docstring.
+ The second line of the docstring.
+ """
+ result = unittest.TextTestResult(None, True, 1)
+ self.assertEqual(
+ result.getDescription(self),
+ ('testGetDescriptionWithMultiLineDocstring '
+ '(' + __name__ + '.Test_TestResult)\n'
+ 'Tests getDescription() for a method with a longer '
+ 'docstring.'))
+
+ def testStackFrameTrimming(self):
+ class Frame(object):
+ class tb_frame(object):
+ f_globals = {}
+ result = unittest.TestResult()
+ self.assertFalse(result._is_relevant_tb_level(Frame))
+
+ Frame.tb_frame.f_globals['__unittest'] = True
+ self.assertTrue(result._is_relevant_tb_level(Frame))
+
+ def testFailFast(self):
+ result = unittest.TestResult()
+ result._exc_info_to_string = lambda *_: ''
+ result.failfast = True
+ result.addError(None, None)
+ self.assertTrue(result.shouldStop)
+
+ result = unittest.TestResult()
+ result._exc_info_to_string = lambda *_: ''
+ result.failfast = True
+ result.addFailure(None, None)
+ self.assertTrue(result.shouldStop)
+
+ result = unittest.TestResult()
+ result._exc_info_to_string = lambda *_: ''
+ result.failfast = True
+ result.addUnexpectedSuccess(None)
+ self.assertTrue(result.shouldStop)
+
+ def testFailFastSetByRunner(self):
+ runner = unittest.TextTestRunner(stream=io.StringIO(), failfast=True)
+ def test(result):
+ self.assertTrue(result.failfast)
+ result = runner.run(test)
+
+
+classDict = dict(unittest.TestResult.__dict__)
+for m in ('addSkip', 'addExpectedFailure', 'addUnexpectedSuccess',
+ '__init__'):
+ del classDict[m]
+
+def __init__(self, stream=None, descriptions=None, verbosity=None):
+ self.failures = []
+ self.errors = []
+ self.testsRun = 0
+ self.shouldStop = False
+ self.buffer = False
+
+classDict['__init__'] = __init__
+OldResult = type('OldResult', (object,), classDict)
+
+class Test_OldTestResult(unittest.TestCase):
+
+ def assertOldResultWarning(self, test, failures):
+ with support.check_warnings(("TestResult has no add.+ method,",
+ RuntimeWarning)):
+ result = OldResult()
+ test.run(result)
+ self.assertEqual(len(result.failures), failures)
+
+ def testOldTestResult(self):
+ class Test(unittest.TestCase):
+ def testSkip(self):
+ self.skipTest('foobar')
+ @unittest.expectedFailure
+ def testExpectedFail(self):
+ raise TypeError
+ @unittest.expectedFailure
+ def testUnexpectedSuccess(self):
+ pass
+
+ for test_name, should_pass in (('testSkip', True),
+ ('testExpectedFail', True),
+ ('testUnexpectedSuccess', False)):
+ test = Test(test_name)
+ self.assertOldResultWarning(test, int(not should_pass))
+
+ def testOldTestTesultSetup(self):
+ class Test(unittest.TestCase):
+ def setUp(self):
+ self.skipTest('no reason')
+ def testFoo(self):
+ pass
+ self.assertOldResultWarning(Test('testFoo'), 0)
+
+ def testOldTestResultClass(self):
+ @unittest.skip('no reason')
+ class Test(unittest.TestCase):
+ def testFoo(self):
+ pass
+ self.assertOldResultWarning(Test('testFoo'), 0)
+
+ def testOldResultWithRunner(self):
+ class Test(unittest.TestCase):
+ def testFoo(self):
+ pass
+ runner = unittest.TextTestRunner(resultclass=OldResult,
+ stream=io.StringIO())
+ # This will raise an exception if TextTestRunner can't handle old
+ # test result objects
+ runner.run(Test('testFoo'))
+
+
+class MockTraceback(object):
+ @staticmethod
+ def format_exception(*_):
+ return ['A traceback']
+
+def restore_traceback():
+ unittest.result.traceback = traceback
+
+
+class TestOutputBuffering(unittest.TestCase):
+
+ def setUp(self):
+ self._real_out = sys.stdout
+ self._real_err = sys.stderr
+
+ def tearDown(self):
+ sys.stdout = self._real_out
+ sys.stderr = self._real_err
+
+ def testBufferOutputOff(self):
+ real_out = self._real_out
+ real_err = self._real_err
+
+ result = unittest.TestResult()
+ self.assertFalse(result.buffer)
+
+ self.assertIs(real_out, sys.stdout)
+ self.assertIs(real_err, sys.stderr)
+
+ result.startTest(self)
+
+ self.assertIs(real_out, sys.stdout)
+ self.assertIs(real_err, sys.stderr)
+
+ def testBufferOutputStartTestAddSuccess(self):
+ real_out = self._real_out
+ real_err = self._real_err
+
+ result = unittest.TestResult()
+ self.assertFalse(result.buffer)
+
+ result.buffer = True
+
+ self.assertIs(real_out, sys.stdout)
+ self.assertIs(real_err, sys.stderr)
+
+ result.startTest(self)
+
+ self.assertIsNot(real_out, sys.stdout)
+ self.assertIsNot(real_err, sys.stderr)
+ self.assertIsInstance(sys.stdout, io.StringIO)
+ self.assertIsInstance(sys.stderr, io.StringIO)
+ self.assertIsNot(sys.stdout, sys.stderr)
+
+ out_stream = sys.stdout
+ err_stream = sys.stderr
+
+ result._original_stdout = io.StringIO()
+ result._original_stderr = io.StringIO()
+
+ print('foo')
+ print('bar', file=sys.stderr)
+
+ self.assertEqual(out_stream.getvalue(), 'foo\n')
+ self.assertEqual(err_stream.getvalue(), 'bar\n')
+
+ self.assertEqual(result._original_stdout.getvalue(), '')
+ self.assertEqual(result._original_stderr.getvalue(), '')
+
+ result.addSuccess(self)
+ result.stopTest(self)
+
+ self.assertIs(sys.stdout, result._original_stdout)
+ self.assertIs(sys.stderr, result._original_stderr)
+
+ self.assertEqual(result._original_stdout.getvalue(), '')
+ self.assertEqual(result._original_stderr.getvalue(), '')
+
+ self.assertEqual(out_stream.getvalue(), '')
+ self.assertEqual(err_stream.getvalue(), '')
+
+
+ def getStartedResult(self):
+ result = unittest.TestResult()
+ result.buffer = True
+ result.startTest(self)
+ return result
+
+ def testBufferOutputAddErrorOrFailure(self):
+ unittest.result.traceback = MockTraceback
+ self.addCleanup(restore_traceback)
+
+ for message_attr, add_attr, include_error in [
+ ('errors', 'addError', True),
+ ('failures', 'addFailure', False),
+ ('errors', 'addError', True),
+ ('failures', 'addFailure', False)
+ ]:
+ result = self.getStartedResult()
+ buffered_out = sys.stdout
+ buffered_err = sys.stderr
+ result._original_stdout = io.StringIO()
+ result._original_stderr = io.StringIO()
+
+ print('foo', file=sys.stdout)
+ if include_error:
+ print('bar', file=sys.stderr)
+
+
+ addFunction = getattr(result, add_attr)
+ addFunction(self, (None, None, None))
+ result.stopTest(self)
+
+ result_list = getattr(result, message_attr)
+ self.assertEqual(len(result_list), 1)
+
+ test, message = result_list[0]
+ expectedOutMessage = textwrap.dedent("""
+ Stdout:
+ foo
+ """)
+ expectedErrMessage = ''
+ if include_error:
+ expectedErrMessage = textwrap.dedent("""
+ Stderr:
+ bar
+ """)
+
+ expectedFullMessage = 'A traceback%s%s' % (expectedOutMessage, expectedErrMessage)
+
+ self.assertIs(test, self)
+ self.assertEqual(result._original_stdout.getvalue(), expectedOutMessage)
+ self.assertEqual(result._original_stderr.getvalue(), expectedErrMessage)
+ self.assertMultiLineEqual(message, expectedFullMessage)
+
+ def testBufferSetupClass(self):
+ result = unittest.TestResult()
+ result.buffer = True
+
+ class Foo(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ 1/0
+ def test_foo(self):
+ pass
+ suite = unittest.TestSuite([Foo('test_foo')])
+ suite(result)
+ self.assertEqual(len(result.errors), 1)
+
+ def testBufferTearDownClass(self):
+ result = unittest.TestResult()
+ result.buffer = True
+
+ class Foo(unittest.TestCase):
+ @classmethod
+ def tearDownClass(cls):
+ 1/0
+ def test_foo(self):
+ pass
+ suite = unittest.TestSuite([Foo('test_foo')])
+ suite(result)
+ self.assertEqual(len(result.errors), 1)
+
+ def testBufferSetUpModule(self):
+ result = unittest.TestResult()
+ result.buffer = True
+
+ class Foo(unittest.TestCase):
+ def test_foo(self):
+ pass
+ class Module(object):
+ @staticmethod
+ def setUpModule():
+ 1/0
+
+ Foo.__module__ = 'Module'
+ sys.modules['Module'] = Module
+ self.addCleanup(sys.modules.pop, 'Module')
+ suite = unittest.TestSuite([Foo('test_foo')])
+ suite(result)
+ self.assertEqual(len(result.errors), 1)
+
+ def testBufferTearDownModule(self):
+ result = unittest.TestResult()
+ result.buffer = True
+
+ class Foo(unittest.TestCase):
+ def test_foo(self):
+ pass
+ class Module(object):
+ @staticmethod
+ def tearDownModule():
+ 1/0
+
+ Foo.__module__ = 'Module'
+ sys.modules['Module'] = Module
+ self.addCleanup(sys.modules.pop, 'Module')
+ suite = unittest.TestSuite([Foo('test_foo')])
+ suite(result)
+ self.assertEqual(len(result.errors), 1)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/Lib/unittest/test/test_runner.py b/Lib/unittest/test/test_runner.py
new file mode 100644
index 0000000000..8e95410e9e
--- /dev/null
+++ b/Lib/unittest/test/test_runner.py
@@ -0,0 +1,318 @@
+import io
+import os
+import sys
+import pickle
+import subprocess
+
+import unittest
+
+from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun
+
+
+class TestCleanUp(unittest.TestCase):
+
+ def testCleanUp(self):
+ class TestableTest(unittest.TestCase):
+ def testNothing(self):
+ pass
+
+ test = TestableTest('testNothing')
+ self.assertEqual(test._cleanups, [])
+
+ cleanups = []
+
+ def cleanup1(*args, **kwargs):
+ cleanups.append((1, args, kwargs))
+
+ def cleanup2(*args, **kwargs):
+ cleanups.append((2, args, kwargs))
+
+ test.addCleanup(cleanup1, 1, 2, 3, four='hello', five='goodbye')
+ test.addCleanup(cleanup2)
+
+ self.assertEqual(test._cleanups,
+ [(cleanup1, (1, 2, 3), dict(four='hello', five='goodbye')),
+ (cleanup2, (), {})])
+
+ self.assertTrue(test.doCleanups())
+ self.assertEqual(cleanups, [(2, (), {}), (1, (1, 2, 3), dict(four='hello', five='goodbye'))])
+
+ def testCleanUpWithErrors(self):
+ class TestableTest(unittest.TestCase):
+ def testNothing(self):
+ pass
+
+ class MockOutcome(object):
+ success = True
+ errors = []
+
+ test = TestableTest('testNothing')
+ test._outcomeForDoCleanups = MockOutcome
+
+ exc1 = Exception('foo')
+ exc2 = Exception('bar')
+ def cleanup1():
+ raise exc1
+
+ def cleanup2():
+ raise exc2
+
+ test.addCleanup(cleanup1)
+ test.addCleanup(cleanup2)
+
+ self.assertFalse(test.doCleanups())
+ self.assertFalse(MockOutcome.success)
+
+ (Type1, instance1, _), (Type2, instance2, _) = reversed(MockOutcome.errors)
+ self.assertEqual((Type1, instance1), (Exception, exc1))
+ self.assertEqual((Type2, instance2), (Exception, exc2))
+
+ def testCleanupInRun(self):
+ blowUp = False
+ ordering = []
+
+ class TestableTest(unittest.TestCase):
+ def setUp(self):
+ ordering.append('setUp')
+ if blowUp:
+ raise Exception('foo')
+
+ def testNothing(self):
+ ordering.append('test')
+
+ def tearDown(self):
+ ordering.append('tearDown')
+
+ test = TestableTest('testNothing')
+
+ def cleanup1():
+ ordering.append('cleanup1')
+ def cleanup2():
+ ordering.append('cleanup2')
+ test.addCleanup(cleanup1)
+ test.addCleanup(cleanup2)
+
+ def success(some_test):
+ self.assertEqual(some_test, test)
+ ordering.append('success')
+
+ result = unittest.TestResult()
+ result.addSuccess = success
+
+ test.run(result)
+ self.assertEqual(ordering, ['setUp', 'test', 'tearDown',
+ 'cleanup2', 'cleanup1', 'success'])
+
+ blowUp = True
+ ordering = []
+ test = TestableTest('testNothing')
+ test.addCleanup(cleanup1)
+ test.run(result)
+ self.assertEqual(ordering, ['setUp', 'cleanup1'])
+
+ def testTestCaseDebugExecutesCleanups(self):
+ ordering = []
+
+ class TestableTest(unittest.TestCase):
+ def setUp(self):
+ ordering.append('setUp')
+ self.addCleanup(cleanup1)
+
+ def testNothing(self):
+ ordering.append('test')
+
+ def tearDown(self):
+ ordering.append('tearDown')
+
+ test = TestableTest('testNothing')
+
+ def cleanup1():
+ ordering.append('cleanup1')
+ test.addCleanup(cleanup2)
+ def cleanup2():
+ ordering.append('cleanup2')
+
+ test.debug()
+ self.assertEqual(ordering, ['setUp', 'test', 'tearDown', 'cleanup1', 'cleanup2'])
+
+
+class Test_TextTestRunner(unittest.TestCase):
+ """Tests for TextTestRunner."""
+
+ def test_init(self):
+ runner = unittest.TextTestRunner()
+ self.assertFalse(runner.failfast)
+ self.assertFalse(runner.buffer)
+ self.assertEqual(runner.verbosity, 1)
+ self.assertEqual(runner.warnings, None)
+ self.assertTrue(runner.descriptions)
+ self.assertEqual(runner.resultclass, unittest.TextTestResult)
+
+
+ def testBufferAndFailfast(self):
+ class Test(unittest.TestCase):
+ def testFoo(self):
+ pass
+ result = unittest.TestResult()
+ runner = unittest.TextTestRunner(stream=io.StringIO(), failfast=True,
+ buffer=True)
+ # Use our result object
+ runner._makeResult = lambda: result
+ runner.run(Test('testFoo'))
+
+ self.assertTrue(result.failfast)
+ self.assertTrue(result.buffer)
+
+ def testRunnerRegistersResult(self):
+ class Test(unittest.TestCase):
+ def testFoo(self):
+ pass
+ originalRegisterResult = unittest.runner.registerResult
+ def cleanup():
+ unittest.runner.registerResult = originalRegisterResult
+ self.addCleanup(cleanup)
+
+ result = unittest.TestResult()
+ runner = unittest.TextTestRunner(stream=io.StringIO())
+ # Use our result object
+ runner._makeResult = lambda: result
+
+ self.wasRegistered = 0
+ def fakeRegisterResult(thisResult):
+ self.wasRegistered += 1
+ self.assertEqual(thisResult, result)
+ unittest.runner.registerResult = fakeRegisterResult
+
+ runner.run(unittest.TestSuite())
+ self.assertEqual(self.wasRegistered, 1)
+
+ def test_works_with_result_without_startTestRun_stopTestRun(self):
+ class OldTextResult(ResultWithNoStartTestRunStopTestRun):
+ separator2 = ''
+ def printErrors(self):
+ pass
+
+ class Runner(unittest.TextTestRunner):
+ def __init__(self):
+ super(Runner, self).__init__(io.StringIO())
+
+ def _makeResult(self):
+ return OldTextResult()
+
+ runner = Runner()
+ runner.run(unittest.TestSuite())
+
+ def test_startTestRun_stopTestRun_called(self):
+ class LoggingTextResult(LoggingResult):
+ separator2 = ''
+ def printErrors(self):
+ pass
+
+ class LoggingRunner(unittest.TextTestRunner):
+ def __init__(self, events):
+ super(LoggingRunner, self).__init__(io.StringIO())
+ self._events = events
+
+ def _makeResult(self):
+ return LoggingTextResult(self._events)
+
+ events = []
+ runner = LoggingRunner(events)
+ runner.run(unittest.TestSuite())
+ expected = ['startTestRun', 'stopTestRun']
+ self.assertEqual(events, expected)
+
+ def test_pickle_unpickle(self):
+ # Issue #7197: a TextTestRunner should be (un)pickleable. This is
+ # required by test_multiprocessing under Windows (in verbose mode).
+ stream = io.StringIO("foo")
+ runner = unittest.TextTestRunner(stream)
+ for protocol in range(2, pickle.HIGHEST_PROTOCOL + 1):
+ s = pickle.dumps(runner, protocol)
+ obj = pickle.loads(s)
+ # StringIO objects never compare equal, a cheap test instead.
+ self.assertEqual(obj.stream.getvalue(), stream.getvalue())
+
+ def test_resultclass(self):
+ def MockResultClass(*args):
+ return args
+ STREAM = object()
+ DESCRIPTIONS = object()
+ VERBOSITY = object()
+ runner = unittest.TextTestRunner(STREAM, DESCRIPTIONS, VERBOSITY,
+ resultclass=MockResultClass)
+ self.assertEqual(runner.resultclass, MockResultClass)
+
+ expectedresult = (runner.stream, DESCRIPTIONS, VERBOSITY)
+ self.assertEqual(runner._makeResult(), expectedresult)
+
+ def test_warnings(self):
+ """
+ Check that warnings argument of TextTestRunner correctly affects the
+ behavior of the warnings.
+ """
+ # see #10535 and the _test_warnings file for more information
+
+ def get_parse_out_err(p):
+ return [b.splitlines() for b in p.communicate()]
+ opts = dict(stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ cwd=os.path.dirname(__file__))
+ ae_msg = b'Please use assertEqual instead.'
+ at_msg = b'Please use assertTrue instead.'
+
+ # no args -> all the warnings are printed, unittest warnings only once
+ p = subprocess.Popen([sys.executable, '_test_warnings.py'], **opts)
+ out, err = get_parse_out_err(p)
+ self.assertIn(b'OK', err)
+ # check that the total number of warnings in the output is correct
+ self.assertEqual(len(out), 12)
+ # check that the numbers of the different kind of warnings is correct
+ for msg in [b'dw', b'iw', b'uw']:
+ self.assertEqual(out.count(msg), 3)
+ for msg in [ae_msg, at_msg, b'rw']:
+ self.assertEqual(out.count(msg), 1)
+
+ args_list = (
+ # passing 'ignore' as warnings arg -> no warnings
+ [sys.executable, '_test_warnings.py', 'ignore'],
+ # -W doesn't affect the result if the arg is passed
+ [sys.executable, '-Wa', '_test_warnings.py', 'ignore'],
+ # -W affects the result if the arg is not passed
+ [sys.executable, '-Wi', '_test_warnings.py']
+ )
+ # in all these cases no warnings are printed
+ for args in args_list:
+ p = subprocess.Popen(args, **opts)
+ out, err = get_parse_out_err(p)
+ self.assertIn(b'OK', err)
+ self.assertEqual(len(out), 0)
+
+
+ # passing 'always' as warnings arg -> all the warnings printed,
+ # unittest warnings only once
+ p = subprocess.Popen([sys.executable, '_test_warnings.py', 'always'],
+ **opts)
+ out, err = get_parse_out_err(p)
+ self.assertIn(b'OK', err)
+ self.assertEqual(len(out), 14)
+ for msg in [b'dw', b'iw', b'uw', b'rw']:
+ self.assertEqual(out.count(msg), 3)
+ for msg in [ae_msg, at_msg]:
+ self.assertEqual(out.count(msg), 1)
+
+ def testStdErrLookedUpAtInstantiationTime(self):
+ # see issue 10786
+ old_stderr = sys.stderr
+ f = io.StringIO()
+ sys.stderr = f
+ try:
+ runner = unittest.TextTestRunner()
+ self.assertTrue(runner.stream.stream is f)
+ finally:
+ sys.stderr = old_stderr
+
+ def testSpecifiedStreamUsed(self):
+ # see issue 10786
+ f = io.StringIO()
+ runner = unittest.TextTestRunner(f)
+ self.assertTrue(runner.stream.stream is f)
diff --git a/Lib/unittest/test/test_setups.py b/Lib/unittest/test/test_setups.py
new file mode 100644
index 0000000000..b8d5aa41e9
--- /dev/null
+++ b/Lib/unittest/test/test_setups.py
@@ -0,0 +1,507 @@
+import io
+import sys
+
+import unittest
+
+
+def resultFactory(*_):
+ return unittest.TestResult()
+
+
+class TestSetups(unittest.TestCase):
+
+ def getRunner(self):
+ return unittest.TextTestRunner(resultclass=resultFactory,
+ stream=io.StringIO())
+ def runTests(self, *cases):
+ suite = unittest.TestSuite()
+ for case in cases:
+ tests = unittest.defaultTestLoader.loadTestsFromTestCase(case)
+ suite.addTests(tests)
+
+ runner = self.getRunner()
+
+ # creating a nested suite exposes some potential bugs
+ realSuite = unittest.TestSuite()
+ realSuite.addTest(suite)
+ # adding empty suites to the end exposes potential bugs
+ suite.addTest(unittest.TestSuite())
+ realSuite.addTest(unittest.TestSuite())
+ return runner.run(realSuite)
+
+ def test_setup_class(self):
+ class Test(unittest.TestCase):
+ setUpCalled = 0
+ @classmethod
+ def setUpClass(cls):
+ Test.setUpCalled += 1
+ unittest.TestCase.setUpClass()
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ result = self.runTests(Test)
+
+ self.assertEqual(Test.setUpCalled, 1)
+ self.assertEqual(result.testsRun, 2)
+ self.assertEqual(len(result.errors), 0)
+
+ def test_teardown_class(self):
+ class Test(unittest.TestCase):
+ tearDownCalled = 0
+ @classmethod
+ def tearDownClass(cls):
+ Test.tearDownCalled += 1
+ unittest.TestCase.tearDownClass()
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ result = self.runTests(Test)
+
+ self.assertEqual(Test.tearDownCalled, 1)
+ self.assertEqual(result.testsRun, 2)
+ self.assertEqual(len(result.errors), 0)
+
+ def test_teardown_class_two_classes(self):
+ class Test(unittest.TestCase):
+ tearDownCalled = 0
+ @classmethod
+ def tearDownClass(cls):
+ Test.tearDownCalled += 1
+ unittest.TestCase.tearDownClass()
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ class Test2(unittest.TestCase):
+ tearDownCalled = 0
+ @classmethod
+ def tearDownClass(cls):
+ Test2.tearDownCalled += 1
+ unittest.TestCase.tearDownClass()
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ result = self.runTests(Test, Test2)
+
+ self.assertEqual(Test.tearDownCalled, 1)
+ self.assertEqual(Test2.tearDownCalled, 1)
+ self.assertEqual(result.testsRun, 4)
+ self.assertEqual(len(result.errors), 0)
+
+ def test_error_in_setupclass(self):
+ class BrokenTest(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ raise TypeError('foo')
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ result = self.runTests(BrokenTest)
+
+ self.assertEqual(result.testsRun, 0)
+ self.assertEqual(len(result.errors), 1)
+ error, _ = result.errors[0]
+ self.assertEqual(str(error),
+ 'setUpClass (%s.BrokenTest)' % __name__)
+
+ def test_error_in_teardown_class(self):
+ class Test(unittest.TestCase):
+ tornDown = 0
+ @classmethod
+ def tearDownClass(cls):
+ Test.tornDown += 1
+ raise TypeError('foo')
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ class Test2(unittest.TestCase):
+ tornDown = 0
+ @classmethod
+ def tearDownClass(cls):
+ Test2.tornDown += 1
+ raise TypeError('foo')
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ result = self.runTests(Test, Test2)
+ self.assertEqual(result.testsRun, 4)
+ self.assertEqual(len(result.errors), 2)
+ self.assertEqual(Test.tornDown, 1)
+ self.assertEqual(Test2.tornDown, 1)
+
+ error, _ = result.errors[0]
+ self.assertEqual(str(error),
+ 'tearDownClass (%s.Test)' % __name__)
+
+ def test_class_not_torndown_when_setup_fails(self):
+ class Test(unittest.TestCase):
+ tornDown = False
+ @classmethod
+ def setUpClass(cls):
+ raise TypeError
+ @classmethod
+ def tearDownClass(cls):
+ Test.tornDown = True
+ raise TypeError('foo')
+ def test_one(self):
+ pass
+
+ self.runTests(Test)
+ self.assertFalse(Test.tornDown)
+
+ def test_class_not_setup_or_torndown_when_skipped(self):
+ class Test(unittest.TestCase):
+ classSetUp = False
+ tornDown = False
+ @classmethod
+ def setUpClass(cls):
+ Test.classSetUp = True
+ @classmethod
+ def tearDownClass(cls):
+ Test.tornDown = True
+ def test_one(self):
+ pass
+
+ Test = unittest.skip("hop")(Test)
+ self.runTests(Test)
+ self.assertFalse(Test.classSetUp)
+ self.assertFalse(Test.tornDown)
+
+ def test_setup_teardown_order_with_pathological_suite(self):
+ results = []
+
+ class Module1(object):
+ @staticmethod
+ def setUpModule():
+ results.append('Module1.setUpModule')
+ @staticmethod
+ def tearDownModule():
+ results.append('Module1.tearDownModule')
+
+ class Module2(object):
+ @staticmethod
+ def setUpModule():
+ results.append('Module2.setUpModule')
+ @staticmethod
+ def tearDownModule():
+ results.append('Module2.tearDownModule')
+
+ class Test1(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ results.append('setup 1')
+ @classmethod
+ def tearDownClass(cls):
+ results.append('teardown 1')
+ def testOne(self):
+ results.append('Test1.testOne')
+ def testTwo(self):
+ results.append('Test1.testTwo')
+
+ class Test2(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ results.append('setup 2')
+ @classmethod
+ def tearDownClass(cls):
+ results.append('teardown 2')
+ def testOne(self):
+ results.append('Test2.testOne')
+ def testTwo(self):
+ results.append('Test2.testTwo')
+
+ class Test3(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ results.append('setup 3')
+ @classmethod
+ def tearDownClass(cls):
+ results.append('teardown 3')
+ def testOne(self):
+ results.append('Test3.testOne')
+ def testTwo(self):
+ results.append('Test3.testTwo')
+
+ Test1.__module__ = Test2.__module__ = 'Module'
+ Test3.__module__ = 'Module2'
+ sys.modules['Module'] = Module1
+ sys.modules['Module2'] = Module2
+
+ first = unittest.TestSuite((Test1('testOne'),))
+ second = unittest.TestSuite((Test1('testTwo'),))
+ third = unittest.TestSuite((Test2('testOne'),))
+ fourth = unittest.TestSuite((Test2('testTwo'),))
+ fifth = unittest.TestSuite((Test3('testOne'),))
+ sixth = unittest.TestSuite((Test3('testTwo'),))
+ suite = unittest.TestSuite((first, second, third, fourth, fifth, sixth))
+
+ runner = self.getRunner()
+ result = runner.run(suite)
+ self.assertEqual(result.testsRun, 6)
+ self.assertEqual(len(result.errors), 0)
+
+ self.assertEqual(results,
+ ['Module1.setUpModule', 'setup 1',
+ 'Test1.testOne', 'Test1.testTwo', 'teardown 1',
+ 'setup 2', 'Test2.testOne', 'Test2.testTwo',
+ 'teardown 2', 'Module1.tearDownModule',
+ 'Module2.setUpModule', 'setup 3',
+ 'Test3.testOne', 'Test3.testTwo',
+ 'teardown 3', 'Module2.tearDownModule'])
+
+ def test_setup_module(self):
+ class Module(object):
+ moduleSetup = 0
+ @staticmethod
+ def setUpModule():
+ Module.moduleSetup += 1
+
+ class Test(unittest.TestCase):
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+ Test.__module__ = 'Module'
+ sys.modules['Module'] = Module
+
+ result = self.runTests(Test)
+ self.assertEqual(Module.moduleSetup, 1)
+ self.assertEqual(result.testsRun, 2)
+ self.assertEqual(len(result.errors), 0)
+
+ def test_error_in_setup_module(self):
+ class Module(object):
+ moduleSetup = 0
+ moduleTornDown = 0
+ @staticmethod
+ def setUpModule():
+ Module.moduleSetup += 1
+ raise TypeError('foo')
+ @staticmethod
+ def tearDownModule():
+ Module.moduleTornDown += 1
+
+ class Test(unittest.TestCase):
+ classSetUp = False
+ classTornDown = False
+ @classmethod
+ def setUpClass(cls):
+ Test.classSetUp = True
+ @classmethod
+ def tearDownClass(cls):
+ Test.classTornDown = True
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ class Test2(unittest.TestCase):
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+ Test.__module__ = 'Module'
+ Test2.__module__ = 'Module'
+ sys.modules['Module'] = Module
+
+ result = self.runTests(Test, Test2)
+ self.assertEqual(Module.moduleSetup, 1)
+ self.assertEqual(Module.moduleTornDown, 0)
+ self.assertEqual(result.testsRun, 0)
+ self.assertFalse(Test.classSetUp)
+ self.assertFalse(Test.classTornDown)
+ self.assertEqual(len(result.errors), 1)
+ error, _ = result.errors[0]
+ self.assertEqual(str(error), 'setUpModule (Module)')
+
+ def test_testcase_with_missing_module(self):
+ class Test(unittest.TestCase):
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+ Test.__module__ = 'Module'
+ sys.modules.pop('Module', None)
+
+ result = self.runTests(Test)
+ self.assertEqual(result.testsRun, 2)
+
+ def test_teardown_module(self):
+ class Module(object):
+ moduleTornDown = 0
+ @staticmethod
+ def tearDownModule():
+ Module.moduleTornDown += 1
+
+ class Test(unittest.TestCase):
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+ Test.__module__ = 'Module'
+ sys.modules['Module'] = Module
+
+ result = self.runTests(Test)
+ self.assertEqual(Module.moduleTornDown, 1)
+ self.assertEqual(result.testsRun, 2)
+ self.assertEqual(len(result.errors), 0)
+
+ def test_error_in_teardown_module(self):
+ class Module(object):
+ moduleTornDown = 0
+ @staticmethod
+ def tearDownModule():
+ Module.moduleTornDown += 1
+ raise TypeError('foo')
+
+ class Test(unittest.TestCase):
+ classSetUp = False
+ classTornDown = False
+ @classmethod
+ def setUpClass(cls):
+ Test.classSetUp = True
+ @classmethod
+ def tearDownClass(cls):
+ Test.classTornDown = True
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ class Test2(unittest.TestCase):
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+ Test.__module__ = 'Module'
+ Test2.__module__ = 'Module'
+ sys.modules['Module'] = Module
+
+ result = self.runTests(Test, Test2)
+ self.assertEqual(Module.moduleTornDown, 1)
+ self.assertEqual(result.testsRun, 4)
+ self.assertTrue(Test.classSetUp)
+ self.assertTrue(Test.classTornDown)
+ self.assertEqual(len(result.errors), 1)
+ error, _ = result.errors[0]
+ self.assertEqual(str(error), 'tearDownModule (Module)')
+
+ def test_skiptest_in_setupclass(self):
+ class Test(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ raise unittest.SkipTest('foo')
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ result = self.runTests(Test)
+ self.assertEqual(result.testsRun, 0)
+ self.assertEqual(len(result.errors), 0)
+ self.assertEqual(len(result.skipped), 1)
+ skipped = result.skipped[0][0]
+ self.assertEqual(str(skipped), 'setUpClass (%s.Test)' % __name__)
+
+ def test_skiptest_in_setupmodule(self):
+ class Test(unittest.TestCase):
+ def test_one(self):
+ pass
+ def test_two(self):
+ pass
+
+ class Module(object):
+ @staticmethod
+ def setUpModule():
+ raise unittest.SkipTest('foo')
+
+ Test.__module__ = 'Module'
+ sys.modules['Module'] = Module
+
+ result = self.runTests(Test)
+ self.assertEqual(result.testsRun, 0)
+ self.assertEqual(len(result.errors), 0)
+ self.assertEqual(len(result.skipped), 1)
+ skipped = result.skipped[0][0]
+ self.assertEqual(str(skipped), 'setUpModule (Module)')
+
+ def test_suite_debug_executes_setups_and_teardowns(self):
+ ordering = []
+
+ class Module(object):
+ @staticmethod
+ def setUpModule():
+ ordering.append('setUpModule')
+ @staticmethod
+ def tearDownModule():
+ ordering.append('tearDownModule')
+
+ class Test(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ ordering.append('setUpClass')
+ @classmethod
+ def tearDownClass(cls):
+ ordering.append('tearDownClass')
+ def test_something(self):
+ ordering.append('test_something')
+
+ Test.__module__ = 'Module'
+ sys.modules['Module'] = Module
+
+ suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test)
+ suite.debug()
+ expectedOrder = ['setUpModule', 'setUpClass', 'test_something', 'tearDownClass', 'tearDownModule']
+ self.assertEqual(ordering, expectedOrder)
+
+ def test_suite_debug_propagates_exceptions(self):
+ class Module(object):
+ @staticmethod
+ def setUpModule():
+ if phase == 0:
+ raise Exception('setUpModule')
+ @staticmethod
+ def tearDownModule():
+ if phase == 1:
+ raise Exception('tearDownModule')
+
+ class Test(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ if phase == 2:
+ raise Exception('setUpClass')
+ @classmethod
+ def tearDownClass(cls):
+ if phase == 3:
+ raise Exception('tearDownClass')
+ def test_something(self):
+ if phase == 4:
+ raise Exception('test_something')
+
+ Test.__module__ = 'Module'
+ sys.modules['Module'] = Module
+
+ _suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test)
+ suite = unittest.TestSuite()
+ suite.addTest(_suite)
+
+ messages = ('setUpModule', 'tearDownModule', 'setUpClass', 'tearDownClass', 'test_something')
+ for phase, msg in enumerate(messages):
+ with self.assertRaisesRegex(Exception, msg):
+ suite.debug()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/Lib/unittest/test/test_skipping.py b/Lib/unittest/test/test_skipping.py
new file mode 100644
index 0000000000..b5924646c1
--- /dev/null
+++ b/Lib/unittest/test/test_skipping.py
@@ -0,0 +1,134 @@
+import unittest
+
+from .support import LoggingResult
+
+
+class Test_TestSkipping(unittest.TestCase):
+
+ def test_skipping(self):
+ class Foo(unittest.TestCase):
+ def test_skip_me(self):
+ self.skipTest("skip")
+ events = []
+ result = LoggingResult(events)
+ test = Foo("test_skip_me")
+ test.run(result)
+ self.assertEqual(events, ['startTest', 'addSkip', 'stopTest'])
+ self.assertEqual(result.skipped, [(test, "skip")])
+
+ # Try letting setUp skip the test now.
+ class Foo(unittest.TestCase):
+ def setUp(self):
+ self.skipTest("testing")
+ def test_nothing(self): pass
+ events = []
+ result = LoggingResult(events)
+ test = Foo("test_nothing")
+ test.run(result)
+ self.assertEqual(events, ['startTest', 'addSkip', 'stopTest'])
+ self.assertEqual(result.skipped, [(test, "testing")])
+ self.assertEqual(result.testsRun, 1)
+
+ def test_skipping_decorators(self):
+ op_table = ((unittest.skipUnless, False, True),
+ (unittest.skipIf, True, False))
+ for deco, do_skip, dont_skip in op_table:
+ class Foo(unittest.TestCase):
+ @deco(do_skip, "testing")
+ def test_skip(self): pass
+
+ @deco(dont_skip, "testing")
+ def test_dont_skip(self): pass
+ test_do_skip = Foo("test_skip")
+ test_dont_skip = Foo("test_dont_skip")
+ suite = unittest.TestSuite([test_do_skip, test_dont_skip])
+ events = []
+ result = LoggingResult(events)
+ suite.run(result)
+ self.assertEqual(len(result.skipped), 1)
+ expected = ['startTest', 'addSkip', 'stopTest',
+ 'startTest', 'addSuccess', 'stopTest']
+ self.assertEqual(events, expected)
+ self.assertEqual(result.testsRun, 2)
+ self.assertEqual(result.skipped, [(test_do_skip, "testing")])
+ self.assertTrue(result.wasSuccessful())
+
+ def test_skip_class(self):
+ @unittest.skip("testing")
+ class Foo(unittest.TestCase):
+ def test_1(self):
+ record.append(1)
+ record = []
+ result = unittest.TestResult()
+ test = Foo("test_1")
+ suite = unittest.TestSuite([test])
+ suite.run(result)
+ self.assertEqual(result.skipped, [(test, "testing")])
+ self.assertEqual(record, [])
+
+ def test_expected_failure(self):
+ class Foo(unittest.TestCase):
+ @unittest.expectedFailure
+ def test_die(self):
+ self.fail("help me!")
+ events = []
+ result = LoggingResult(events)
+ test = Foo("test_die")
+ test.run(result)
+ self.assertEqual(events,
+ ['startTest', 'addExpectedFailure', 'stopTest'])
+ self.assertEqual(result.expectedFailures[0][0], test)
+ self.assertTrue(result.wasSuccessful())
+
+ def test_unexpected_success(self):
+ class Foo(unittest.TestCase):
+ @unittest.expectedFailure
+ def test_die(self):
+ pass
+ events = []
+ result = LoggingResult(events)
+ test = Foo("test_die")
+ test.run(result)
+ self.assertEqual(events,
+ ['startTest', 'addUnexpectedSuccess', 'stopTest'])
+ self.assertFalse(result.failures)
+ self.assertEqual(result.unexpectedSuccesses, [test])
+ self.assertTrue(result.wasSuccessful())
+
+ def test_skip_doesnt_run_setup(self):
+ class Foo(unittest.TestCase):
+ wasSetUp = False
+ wasTornDown = False
+ def setUp(self):
+ Foo.wasSetUp = True
+ def tornDown(self):
+ Foo.wasTornDown = True
+ @unittest.skip('testing')
+ def test_1(self):
+ pass
+
+ result = unittest.TestResult()
+ test = Foo("test_1")
+ suite = unittest.TestSuite([test])
+ suite.run(result)
+ self.assertEqual(result.skipped, [(test, "testing")])
+ self.assertFalse(Foo.wasSetUp)
+ self.assertFalse(Foo.wasTornDown)
+
+ def test_decorated_skip(self):
+ def decorator(func):
+ def inner(*a):
+ return func(*a)
+ return inner
+
+ class Foo(unittest.TestCase):
+ @decorator
+ @unittest.skip('testing')
+ def test_1(self):
+ pass
+
+ result = unittest.TestResult()
+ test = Foo("test_1")
+ suite = unittest.TestSuite([test])
+ suite.run(result)
+ self.assertEqual(result.skipped, [(test, "testing")])
diff --git a/Lib/unittest/test/test_suite.py b/Lib/unittest/test/test_suite.py
new file mode 100644
index 0000000000..2db978ddb8
--- /dev/null
+++ b/Lib/unittest/test/test_suite.py
@@ -0,0 +1,368 @@
+import unittest
+
+import sys
+from .support import LoggingResult, TestEquality
+
+
+### Support code for Test_TestSuite
+################################################################
+
+class Test(object):
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+ def test_3(self): pass
+ def runTest(self): pass
+
+def _mk_TestSuite(*names):
+ return unittest.TestSuite(Test.Foo(n) for n in names)
+
+################################################################
+
+
+class Test_TestSuite(unittest.TestCase, TestEquality):
+
+ ### Set up attributes needed by inherited tests
+ ################################################################
+
+ # Used by TestEquality.test_eq
+ eq_pairs = [(unittest.TestSuite(), unittest.TestSuite())
+ ,(unittest.TestSuite(), unittest.TestSuite([]))
+ ,(_mk_TestSuite('test_1'), _mk_TestSuite('test_1'))]
+
+ # Used by TestEquality.test_ne
+ ne_pairs = [(unittest.TestSuite(), _mk_TestSuite('test_1'))
+ ,(unittest.TestSuite([]), _mk_TestSuite('test_1'))
+ ,(_mk_TestSuite('test_1', 'test_2'), _mk_TestSuite('test_1', 'test_3'))
+ ,(_mk_TestSuite('test_1'), _mk_TestSuite('test_2'))]
+
+ ################################################################
+ ### /Set up attributes needed by inherited tests
+
+ ### Tests for TestSuite.__init__
+ ################################################################
+
+ # "class TestSuite([tests])"
+ #
+ # The tests iterable should be optional
+ def test_init__tests_optional(self):
+ suite = unittest.TestSuite()
+
+ self.assertEqual(suite.countTestCases(), 0)
+
+ # "class TestSuite([tests])"
+ # ...
+ # "If tests is given, it must be an iterable of individual test cases
+ # or other test suites that will be used to build the suite initially"
+ #
+ # TestSuite should deal with empty tests iterables by allowing the
+ # creation of an empty suite
+ def test_init__empty_tests(self):
+ suite = unittest.TestSuite([])
+
+ self.assertEqual(suite.countTestCases(), 0)
+
+ # "class TestSuite([tests])"
+ # ...
+ # "If tests is given, it must be an iterable of individual test cases
+ # or other test suites that will be used to build the suite initially"
+ #
+ # TestSuite should allow any iterable to provide tests
+ def test_init__tests_from_any_iterable(self):
+ def tests():
+ yield unittest.FunctionTestCase(lambda: None)
+ yield unittest.FunctionTestCase(lambda: None)
+
+ suite_1 = unittest.TestSuite(tests())
+ self.assertEqual(suite_1.countTestCases(), 2)
+
+ suite_2 = unittest.TestSuite(suite_1)
+ self.assertEqual(suite_2.countTestCases(), 2)
+
+ suite_3 = unittest.TestSuite(set(suite_1))
+ self.assertEqual(suite_3.countTestCases(), 2)
+
+ # "class TestSuite([tests])"
+ # ...
+ # "If tests is given, it must be an iterable of individual test cases
+ # or other test suites that will be used to build the suite initially"
+ #
+ # Does TestSuite() also allow other TestSuite() instances to be present
+ # in the tests iterable?
+ def test_init__TestSuite_instances_in_tests(self):
+ def tests():
+ ftc = unittest.FunctionTestCase(lambda: None)
+ yield unittest.TestSuite([ftc])
+ yield unittest.FunctionTestCase(lambda: None)
+
+ suite = unittest.TestSuite(tests())
+ self.assertEqual(suite.countTestCases(), 2)
+
+ ################################################################
+ ### /Tests for TestSuite.__init__
+
+ # Container types should support the iter protocol
+ def test_iter(self):
+ test1 = unittest.FunctionTestCase(lambda: None)
+ test2 = unittest.FunctionTestCase(lambda: None)
+ suite = unittest.TestSuite((test1, test2))
+
+ self.assertEqual(list(suite), [test1, test2])
+
+ # "Return the number of tests represented by the this test object.
+ # ...this method is also implemented by the TestSuite class, which can
+ # return larger [greater than 1] values"
+ #
+ # Presumably an empty TestSuite returns 0?
+ def test_countTestCases_zero_simple(self):
+ suite = unittest.TestSuite()
+
+ self.assertEqual(suite.countTestCases(), 0)
+
+ # "Return the number of tests represented by the this test object.
+ # ...this method is also implemented by the TestSuite class, which can
+ # return larger [greater than 1] values"
+ #
+ # Presumably an empty TestSuite (even if it contains other empty
+ # TestSuite instances) returns 0?
+ def test_countTestCases_zero_nested(self):
+ class Test1(unittest.TestCase):
+ def test(self):
+ pass
+
+ suite = unittest.TestSuite([unittest.TestSuite()])
+
+ self.assertEqual(suite.countTestCases(), 0)
+
+ # "Return the number of tests represented by the this test object.
+ # ...this method is also implemented by the TestSuite class, which can
+ # return larger [greater than 1] values"
+ def test_countTestCases_simple(self):
+ test1 = unittest.FunctionTestCase(lambda: None)
+ test2 = unittest.FunctionTestCase(lambda: None)
+ suite = unittest.TestSuite((test1, test2))
+
+ self.assertEqual(suite.countTestCases(), 2)
+
+ # "Return the number of tests represented by the this test object.
+ # ...this method is also implemented by the TestSuite class, which can
+ # return larger [greater than 1] values"
+ #
+ # Make sure this holds for nested TestSuite instances, too
+ def test_countTestCases_nested(self):
+ class Test1(unittest.TestCase):
+ def test1(self): pass
+ def test2(self): pass
+
+ test2 = unittest.FunctionTestCase(lambda: None)
+ test3 = unittest.FunctionTestCase(lambda: None)
+ child = unittest.TestSuite((Test1('test2'), test2))
+ parent = unittest.TestSuite((test3, child, Test1('test1')))
+
+ self.assertEqual(parent.countTestCases(), 4)
+
+ # "Run the tests associated with this suite, collecting the result into
+ # the test result object passed as result."
+ #
+ # And if there are no tests? What then?
+ def test_run__empty_suite(self):
+ events = []
+ result = LoggingResult(events)
+
+ suite = unittest.TestSuite()
+
+ suite.run(result)
+
+ self.assertEqual(events, [])
+
+ # "Note that unlike TestCase.run(), TestSuite.run() requires the
+ # "result object to be passed in."
+ def test_run__requires_result(self):
+ suite = unittest.TestSuite()
+
+ try:
+ suite.run()
+ except TypeError:
+ pass
+ else:
+ self.fail("Failed to raise TypeError")
+
+ # "Run the tests associated with this suite, collecting the result into
+ # the test result object passed as result."
+ def test_run(self):
+ events = []
+ result = LoggingResult(events)
+
+ class LoggingCase(unittest.TestCase):
+ def run(self, result):
+ events.append('run %s' % self._testMethodName)
+
+ def test1(self): pass
+ def test2(self): pass
+
+ tests = [LoggingCase('test1'), LoggingCase('test2')]
+
+ unittest.TestSuite(tests).run(result)
+
+ self.assertEqual(events, ['run test1', 'run test2'])
+
+ # "Add a TestCase ... to the suite"
+ def test_addTest__TestCase(self):
+ class Foo(unittest.TestCase):
+ def test(self): pass
+
+ test = Foo('test')
+ suite = unittest.TestSuite()
+
+ suite.addTest(test)
+
+ self.assertEqual(suite.countTestCases(), 1)
+ self.assertEqual(list(suite), [test])
+
+ # "Add a ... TestSuite to the suite"
+ def test_addTest__TestSuite(self):
+ class Foo(unittest.TestCase):
+ def test(self): pass
+
+ suite_2 = unittest.TestSuite([Foo('test')])
+
+ suite = unittest.TestSuite()
+ suite.addTest(suite_2)
+
+ self.assertEqual(suite.countTestCases(), 1)
+ self.assertEqual(list(suite), [suite_2])
+
+ # "Add all the tests from an iterable of TestCase and TestSuite
+ # instances to this test suite."
+ #
+ # "This is equivalent to iterating over tests, calling addTest() for
+ # each element"
+ def test_addTests(self):
+ class Foo(unittest.TestCase):
+ def test_1(self): pass
+ def test_2(self): pass
+
+ test_1 = Foo('test_1')
+ test_2 = Foo('test_2')
+ inner_suite = unittest.TestSuite([test_2])
+
+ def gen():
+ yield test_1
+ yield test_2
+ yield inner_suite
+
+ suite_1 = unittest.TestSuite()
+ suite_1.addTests(gen())
+
+ self.assertEqual(list(suite_1), list(gen()))
+
+ # "This is equivalent to iterating over tests, calling addTest() for
+ # each element"
+ suite_2 = unittest.TestSuite()
+ for t in gen():
+ suite_2.addTest(t)
+
+ self.assertEqual(suite_1, suite_2)
+
+ # "Add all the tests from an iterable of TestCase and TestSuite
+ # instances to this test suite."
+ #
+ # What happens if it doesn't get an iterable?
+ def test_addTest__noniterable(self):
+ suite = unittest.TestSuite()
+
+ try:
+ suite.addTests(5)
+ except TypeError:
+ pass
+ else:
+ self.fail("Failed to raise TypeError")
+
+ def test_addTest__noncallable(self):
+ suite = unittest.TestSuite()
+ self.assertRaises(TypeError, suite.addTest, 5)
+
+ def test_addTest__casesuiteclass(self):
+ suite = unittest.TestSuite()
+ self.assertRaises(TypeError, suite.addTest, Test_TestSuite)
+ self.assertRaises(TypeError, suite.addTest, unittest.TestSuite)
+
+ def test_addTests__string(self):
+ suite = unittest.TestSuite()
+ self.assertRaises(TypeError, suite.addTests, "foo")
+
+ def test_function_in_suite(self):
+ def f(_):
+ pass
+ suite = unittest.TestSuite()
+ suite.addTest(f)
+
+ # when the bug is fixed this line will not crash
+ suite.run(unittest.TestResult())
+
+
+
+ def test_basetestsuite(self):
+ class Test(unittest.TestCase):
+ wasSetUp = False
+ wasTornDown = False
+ @classmethod
+ def setUpClass(cls):
+ cls.wasSetUp = True
+ @classmethod
+ def tearDownClass(cls):
+ cls.wasTornDown = True
+ def testPass(self):
+ pass
+ def testFail(self):
+ fail
+ class Module(object):
+ wasSetUp = False
+ wasTornDown = False
+ @staticmethod
+ def setUpModule():
+ Module.wasSetUp = True
+ @staticmethod
+ def tearDownModule():
+ Module.wasTornDown = True
+
+ Test.__module__ = 'Module'
+ sys.modules['Module'] = Module
+ self.addCleanup(sys.modules.pop, 'Module')
+
+ suite = unittest.BaseTestSuite()
+ suite.addTests([Test('testPass'), Test('testFail')])
+ self.assertEqual(suite.countTestCases(), 2)
+
+ result = unittest.TestResult()
+ suite.run(result)
+ self.assertFalse(Module.wasSetUp)
+ self.assertFalse(Module.wasTornDown)
+ self.assertFalse(Test.wasSetUp)
+ self.assertFalse(Test.wasTornDown)
+ self.assertEqual(len(result.errors), 1)
+ self.assertEqual(len(result.failures), 0)
+ self.assertEqual(result.testsRun, 2)
+
+
+ def test_overriding_call(self):
+ class MySuite(unittest.TestSuite):
+ called = False
+ def __call__(self, *args, **kw):
+ self.called = True
+ unittest.TestSuite.__call__(self, *args, **kw)
+
+ suite = MySuite()
+ result = unittest.TestResult()
+ wrapper = unittest.TestSuite()
+ wrapper.addTest(suite)
+ wrapper(result)
+ self.assertTrue(suite.called)
+
+ # reusing results should be permitted even if abominable
+ self.assertFalse(result._testRunEntered)
+
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/Lib/unittest/util.py b/Lib/unittest/util.py
new file mode 100644
index 0000000000..ccdf0b81fa
--- /dev/null
+++ b/Lib/unittest/util.py
@@ -0,0 +1,140 @@
+"""Various utility functions."""
+
+from collections import namedtuple, OrderedDict
+
+__unittest = True
+
+_MAX_LENGTH = 80
+def safe_repr(obj, short=False):
+ try:
+ result = repr(obj)
+ except Exception:
+ result = object.__repr__(obj)
+ if not short or len(result) < _MAX_LENGTH:
+ return result
+ return result[:_MAX_LENGTH] + ' [truncated]...'
+
+def strclass(cls):
+ return "%s.%s" % (cls.__module__, cls.__name__)
+
+def sorted_list_difference(expected, actual):
+ """Finds elements in only one or the other of two, sorted input lists.
+
+ Returns a two-element tuple of lists. The first list contains those
+ elements in the "expected" list but not in the "actual" list, and the
+ second contains those elements in the "actual" list but not in the
+ "expected" list. Duplicate elements in either input list are ignored.
+ """
+ i = j = 0
+ missing = []
+ unexpected = []
+ while True:
+ try:
+ e = expected[i]
+ a = actual[j]
+ if e < a:
+ missing.append(e)
+ i += 1
+ while expected[i] == e:
+ i += 1
+ elif e > a:
+ unexpected.append(a)
+ j += 1
+ while actual[j] == a:
+ j += 1
+ else:
+ i += 1
+ try:
+ while expected[i] == e:
+ i += 1
+ finally:
+ j += 1
+ while actual[j] == a:
+ j += 1
+ except IndexError:
+ missing.extend(expected[i:])
+ unexpected.extend(actual[j:])
+ break
+ return missing, unexpected
+
+
+def unorderable_list_difference(expected, actual):
+ """Same behavior as sorted_list_difference but
+ for lists of unorderable items (like dicts).
+
+ As it does a linear search per item (remove) it
+ has O(n*n) performance."""
+ missing = []
+ while expected:
+ item = expected.pop()
+ try:
+ actual.remove(item)
+ except ValueError:
+ missing.append(item)
+
+ # anything left in actual is unexpected
+ return missing, actual
+
+def three_way_cmp(x, y):
+ """Return -1 if x < y, 0 if x == y and 1 if x > y"""
+ return (x > y) - (x < y)
+
+_Mismatch = namedtuple('Mismatch', 'actual expected value')
+
+def _count_diff_all_purpose(actual, expected):
+ 'Returns list of (cnt_act, cnt_exp, elem) triples where the counts differ'
+ # elements need not be hashable
+ s, t = list(actual), list(expected)
+ m, n = len(s), len(t)
+ NULL = object()
+ result = []
+ for i, elem in enumerate(s):
+ if elem is NULL:
+ continue
+ cnt_s = cnt_t = 0
+ for j in range(i, m):
+ if s[j] == elem:
+ cnt_s += 1
+ s[j] = NULL
+ for j, other_elem in enumerate(t):
+ if other_elem == elem:
+ cnt_t += 1
+ t[j] = NULL
+ if cnt_s != cnt_t:
+ diff = _Mismatch(cnt_s, cnt_t, elem)
+ result.append(diff)
+
+ for i, elem in enumerate(t):
+ if elem is NULL:
+ continue
+ cnt_t = 0
+ for j in range(i, n):
+ if t[j] == elem:
+ cnt_t += 1
+ t[j] = NULL
+ diff = _Mismatch(0, cnt_t, elem)
+ result.append(diff)
+ return result
+
+def _ordered_count(iterable):
+ 'Return dict of element counts, in the order they were first seen'
+ c = OrderedDict()
+ for elem in iterable:
+ c[elem] = c.get(elem, 0) + 1
+ return c
+
+def _count_diff_hashable(actual, expected):
+ 'Returns list of (cnt_act, cnt_exp, elem) triples where the counts differ'
+ # elements must be hashable
+ s, t = _ordered_count(actual), _ordered_count(expected)
+ result = []
+ for elem, cnt_s in s.items():
+ cnt_t = t.get(elem, 0)
+ if cnt_s != cnt_t:
+ diff = _Mismatch(cnt_s, cnt_t, elem)
+ result.append(diff)
+ for elem, cnt_t in t.items():
+ if elem not in s:
+ diff = _Mismatch(0, cnt_t, elem)
+ result.append(diff)
+ return result
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index a20a3d4156..45ae202d5c 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -5,6 +5,9 @@ urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
+RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
+and L.Masinter, December 1999.
+
RFC 2396: "Uniform Resource Identifiers (URI)": Generic Syntax by T.
Berners-Lee, R. Fielding, and L. Masinter, August 1998.
@@ -28,8 +31,8 @@ import sys
import collections
__all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag",
- "urlsplit", "urlunsplit", "parse_qs", "parse_qsl",
- "quote", "quote_plus", "quote_from_bytes",
+ "urlsplit", "urlunsplit", "urlencode", "parse_qs",
+ "parse_qsl", "quote", "quote_plus", "quote_from_bytes",
"unquote", "unquote_plus", "unquote_to_bytes"]
# A classification of schemes ('' means apply by default)
@@ -57,6 +60,7 @@ scheme_chars = ('abcdefghijklmnopqrstuvwxyz'
'0123456789'
'+-.')
+# XXX: Consider replacing with functools.lru_cache
MAX_CACHE_SIZE = 20
_parse_cache = {}
@@ -66,64 +70,210 @@ def clear_cache():
_safe_quoters.clear()
-class ResultMixin(object):
- """Shared methods for the parsed result objects."""
+# Helpers for bytes handling
+# For 3.2, we deliberately require applications that
+# handle improperly quoted URLs to do their own
+# decoding and encoding. If valid use cases are
+# presented, we may relax this by using latin-1
+# decoding internally for 3.3
+_implicit_encoding = 'ascii'
+_implicit_errors = 'strict'
+
+def _noop(obj):
+ return obj
+
+def _encode_result(obj, encoding=_implicit_encoding,
+ errors=_implicit_errors):
+ return obj.encode(encoding, errors)
+
+def _decode_args(args, encoding=_implicit_encoding,
+ errors=_implicit_errors):
+ return tuple(x.decode(encoding, errors) if x else '' for x in args)
+
+def _coerce_args(*args):
+ # Invokes decode if necessary to create str args
+ # and returns the coerced inputs along with
+ # an appropriate result coercion function
+ # - noop for str inputs
+ # - encoding function otherwise
+ str_input = isinstance(args[0], str)
+ for arg in args[1:]:
+ # We special-case the empty string to support the
+ # "scheme=''" default argument to some functions
+ if arg and isinstance(arg, str) != str_input:
+ raise TypeError("Cannot mix str and non-str arguments")
+ if str_input:
+ return args + (_noop,)
+ return _decode_args(args) + (_encode_result,)
+
+# Result objects are more helpful than simple tuples
+class _ResultMixinStr(object):
+ """Standard approach to encoding parsed results from str to bytes"""
+ __slots__ = ()
+
+ def encode(self, encoding='ascii', errors='strict'):
+ return self._encoded_counterpart(*(x.encode(encoding, errors) for x in self))
+
+
+class _ResultMixinBytes(object):
+ """Standard approach to decoding parsed results from bytes to str"""
+ __slots__ = ()
+
+ def decode(self, encoding='ascii', errors='strict'):
+ return self._decoded_counterpart(*(x.decode(encoding, errors) for x in self))
+
+
+class _NetlocResultMixinBase(object):
+ """Shared methods for the parsed result objects containing a netloc element"""
+ __slots__ = ()
@property
def username(self):
- netloc = self.netloc
- if "@" in netloc:
- userinfo = netloc.rsplit("@", 1)[0]
- if ":" in userinfo:
- userinfo = userinfo.split(":", 1)[0]
- return userinfo
- return None
+ return self._userinfo[0]
@property
def password(self):
- netloc = self.netloc
- if "@" in netloc:
- userinfo = netloc.rsplit("@", 1)[0]
- if ":" in userinfo:
- return userinfo.split(":", 1)[1]
- return None
+ return self._userinfo[1]
@property
def hostname(self):
- netloc = self.netloc
- if "@" in netloc:
- netloc = netloc.rsplit("@", 1)[1]
- if ":" in netloc:
- netloc = netloc.split(":", 1)[0]
- return netloc.lower() or None
+ hostname = self._hostinfo[0]
+ if not hostname:
+ hostname = None
+ elif hostname is not None:
+ hostname = hostname.lower()
+ return hostname
@property
def port(self):
+ port = self._hostinfo[1]
+ if port is not None:
+ port = int(port, 10)
+ return port
+
+
+class _NetlocResultMixinStr(_NetlocResultMixinBase, _ResultMixinStr):
+ __slots__ = ()
+
+ @property
+ def _userinfo(self):
+ netloc = self.netloc
+ userinfo, have_info, hostinfo = netloc.rpartition('@')
+ if have_info:
+ username, have_password, password = userinfo.partition(':')
+ if not have_password:
+ password = None
+ else:
+ username = password = None
+ return username, password
+
+ @property
+ def _hostinfo(self):
+ netloc = self.netloc
+ _, _, hostinfo = netloc.rpartition('@')
+ _, have_open_br, bracketed = hostinfo.partition('[')
+ if have_open_br:
+ hostname, _, port = bracketed.partition(']')
+ _, have_port, port = port.partition(':')
+ else:
+ hostname, have_port, port = hostinfo.partition(':')
+ if not have_port:
+ port = None
+ return hostname, port
+
+
+class _NetlocResultMixinBytes(_NetlocResultMixinBase, _ResultMixinBytes):
+ __slots__ = ()
+
+ @property
+ def _userinfo(self):
netloc = self.netloc
- if "@" in netloc:
- netloc = netloc.rsplit("@", 1)[1]
- if ":" in netloc:
- port = netloc.split(":", 1)[1]
- return int(port, 10)
- return None
+ userinfo, have_info, hostinfo = netloc.rpartition(b'@')
+ if have_info:
+ username, have_password, password = userinfo.partition(b':')
+ if not have_password:
+ password = None
+ else:
+ username = password = None
+ return username, password
+
+ @property
+ def _hostinfo(self):
+ netloc = self.netloc
+ _, _, hostinfo = netloc.rpartition(b'@')
+ _, have_open_br, bracketed = hostinfo.partition(b'[')
+ if have_open_br:
+ hostname, _, port = bracketed.partition(b']')
+ _, have_port, port = port.partition(b':')
+ else:
+ hostname, have_port, port = hostinfo.partition(b':')
+ if not have_port:
+ port = None
+ return hostname, port
+
from collections import namedtuple
-class SplitResult(namedtuple('SplitResult', 'scheme netloc path query fragment'), ResultMixin):
+_DefragResultBase = namedtuple('DefragResult', 'url fragment')
+_SplitResultBase = namedtuple('SplitResult', 'scheme netloc path query fragment')
+_ParseResultBase = namedtuple('ParseResult', 'scheme netloc path params query fragment')
+
+# For backwards compatibility, alias _NetlocResultMixinStr
+# ResultBase is no longer part of the documented API, but it is
+# retained since deprecating it isn't worth the hassle
+ResultBase = _NetlocResultMixinStr
+# Structured result objects for string data
+class DefragResult(_DefragResultBase, _ResultMixinStr):
__slots__ = ()
+ def geturl(self):
+ if self.fragment:
+ return self.url + '#' + self.fragment
+ else:
+ return self.url
+class SplitResult(_SplitResultBase, _NetlocResultMixinStr):
+ __slots__ = ()
def geturl(self):
return urlunsplit(self)
+class ParseResult(_ParseResultBase, _NetlocResultMixinStr):
+ __slots__ = ()
+ def geturl(self):
+ return urlunparse(self)
-class ParseResult(namedtuple('ParseResult', 'scheme netloc path params query fragment'), ResultMixin):
+# Structured result objects for bytes data
+class DefragResultBytes(_DefragResultBase, _ResultMixinBytes):
+ __slots__ = ()
+ def geturl(self):
+ if self.fragment:
+ return self.url + b'#' + self.fragment
+ else:
+ return self.url
+class SplitResultBytes(_SplitResultBase, _NetlocResultMixinBytes):
__slots__ = ()
+ def geturl(self):
+ return urlunsplit(self)
+class ParseResultBytes(_ParseResultBase, _NetlocResultMixinBytes):
+ __slots__ = ()
def geturl(self):
return urlunparse(self)
+# Set up the encode/decode result pairs
+def _fix_result_transcoding():
+ _result_pairs = (
+ (DefragResult, DefragResultBytes),
+ (SplitResult, SplitResultBytes),
+ (ParseResult, ParseResultBytes),
+ )
+ for _decoded, _encoded in _result_pairs:
+ _decoded._encoded_counterpart = _encoded
+ _encoded._decoded_counterpart = _decoded
+
+_fix_result_transcoding()
+del _fix_result_transcoding
def urlparse(url, scheme='', allow_fragments=True):
"""Parse a URL into 6 components:
@@ -131,13 +281,15 @@ def urlparse(url, scheme='', allow_fragments=True):
Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) and we don't expand % escapes."""
+ url, scheme, _coerce_result = _coerce_args(url, scheme)
tuple = urlsplit(url, scheme, allow_fragments)
scheme, netloc, url, query, fragment = tuple
if scheme in uses_params and ';' in url:
url, params = _splitparams(url)
else:
params = ''
- return ParseResult(scheme, netloc, url, params, query, fragment)
+ result = ParseResult(scheme, netloc, url, params, query, fragment)
+ return _coerce_result(result)
def _splitparams(url):
if '/' in url:
@@ -162,11 +314,12 @@ def urlsplit(url, scheme='', allow_fragments=True):
Return a 5-tuple: (scheme, netloc, path, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) and we don't expand % escapes."""
+ url, scheme, _coerce_result = _coerce_args(url, scheme)
allow_fragments = bool(allow_fragments)
key = url, scheme, allow_fragments, type(url), type(scheme)
cached = _parse_cache.get(key, None)
if cached:
- return cached
+ return _coerce_result(cached)
if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth
clear_cache()
netloc = query = fragment = ''
@@ -177,13 +330,16 @@ def urlsplit(url, scheme='', allow_fragments=True):
url = url[i+1:]
if url[:2] == '//':
netloc, url = _splitnetloc(url, 2)
+ if (('[' in netloc and ']' not in netloc) or
+ (']' in netloc and '[' not in netloc)):
+ raise ValueError("Invalid IPv6 URL")
if allow_fragments and '#' in url:
url, fragment = url.split('#', 1)
if '?' in url:
url, query = url.split('?', 1)
v = SplitResult(scheme, netloc, url, query, fragment)
_parse_cache[key] = v
- return v
+ return _coerce_result(v)
for c in url[:i]:
if c not in scheme_chars:
break
@@ -197,23 +353,27 @@ def urlsplit(url, scheme='', allow_fragments=True):
if url[:2] == '//':
netloc, url = _splitnetloc(url, 2)
+ if (('[' in netloc and ']' not in netloc) or
+ (']' in netloc and '[' not in netloc)):
+ raise ValueError("Invalid IPv6 URL")
if allow_fragments and scheme in uses_fragment and '#' in url:
url, fragment = url.split('#', 1)
if scheme in uses_query and '?' in url:
url, query = url.split('?', 1)
v = SplitResult(scheme, netloc, url, query, fragment)
_parse_cache[key] = v
- return v
+ return _coerce_result(v)
def urlunparse(components):
"""Put a parsed URL back together again. This may result in a
slightly different, but equivalent URL, if the URL that was parsed
originally had redundant delimiters, e.g. a ? with an empty query
(the draft states that these are equivalent)."""
- scheme, netloc, url, params, query, fragment = components
+ scheme, netloc, url, params, query, fragment, _coerce_result = (
+ _coerce_args(*components))
if params:
url = "%s;%s" % (url, params)
- return urlunsplit((scheme, netloc, url, query, fragment))
+ return _coerce_result(urlunsplit((scheme, netloc, url, query, fragment)))
def urlunsplit(components):
"""Combine the elements of a tuple as returned by urlsplit() into a
@@ -221,7 +381,8 @@ def urlunsplit(components):
This may result in a slightly different, but equivalent URL, if the URL that
was parsed originally had unnecessary delimiters (for example, a ? with an
empty query; the RFC states that these are equivalent)."""
- scheme, netloc, url, query, fragment = components
+ scheme, netloc, url, query, fragment, _coerce_result = (
+ _coerce_args(*components))
if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'):
if url and url[:1] != '/': url = '/' + url
url = '//' + (netloc or '') + url
@@ -231,7 +392,7 @@ def urlunsplit(components):
url = url + '?' + query
if fragment:
url = url + '#' + fragment
- return url
+ return _coerce_result(url)
def urljoin(base, url, allow_fragments=True):
"""Join a base URL and a possibly relative URL to form an absolute
@@ -240,27 +401,28 @@ def urljoin(base, url, allow_fragments=True):
return url
if not url:
return base
+ base, url, _coerce_result = _coerce_args(base, url)
bscheme, bnetloc, bpath, bparams, bquery, bfragment = \
urlparse(base, '', allow_fragments)
scheme, netloc, path, params, query, fragment = \
urlparse(url, bscheme, allow_fragments)
if scheme != bscheme or scheme not in uses_relative:
- return url
+ return _coerce_result(url)
if scheme in uses_netloc:
if netloc:
- return urlunparse((scheme, netloc, path,
- params, query, fragment))
+ return _coerce_result(urlunparse((scheme, netloc, path,
+ params, query, fragment)))
netloc = bnetloc
if path[:1] == '/':
- return urlunparse((scheme, netloc, path,
- params, query, fragment))
+ return _coerce_result(urlunparse((scheme, netloc, path,
+ params, query, fragment)))
if not path and not params:
path = bpath
params = bparams
if not query:
query = bquery
- return urlunparse((scheme, netloc, path,
- params, query, fragment))
+ return _coerce_result(urlunparse((scheme, netloc, path,
+ params, query, fragment)))
segments = bpath.split('/')[:-1] + path.split('/')
# XXX The stuff below is bogus in various ways...
if segments[-1] == '.':
@@ -282,8 +444,8 @@ def urljoin(base, url, allow_fragments=True):
segments[-1] = ''
elif len(segments) >= 2 and segments[-1] == '..':
segments[-2:] = ['']
- return urlunparse((scheme, netloc, '/'.join(segments),
- params, query, fragment))
+ return _coerce_result(urlunparse((scheme, netloc, '/'.join(segments),
+ params, query, fragment)))
def urldefrag(url):
"""Removes any existing fragment from URL.
@@ -292,12 +454,14 @@ def urldefrag(url):
the URL contained no fragments, the second element is the
empty string.
"""
+ url, _coerce_result = _coerce_args(url)
if '#' in url:
s, n, p, a, q, frag = urlparse(url)
defrag = urlunparse((s, n, p, a, q, ''))
- return defrag, frag
else:
- return url, ''
+ frag = ''
+ defrag = url
+ return _coerce_result(DefragResult(defrag, frag))
def unquote_to_bytes(string):
"""unquote_to_bytes('abc%20def') -> b'abc def'."""
@@ -364,7 +528,8 @@ def unquote(string, encoding='utf-8', errors='replace'):
string += pct_sequence.decode(encoding, errors)
return string
-def parse_qs(qs, keep_blank_values=False, strict_parsing=False):
+def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
+ encoding='utf-8', errors='replace'):
"""Parse a query given as a string argument.
Arguments:
@@ -381,16 +546,22 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False):
strict_parsing: flag indicating what to do with parsing errors.
If false (the default), errors are silently ignored.
If true, errors raise a ValueError exception.
+
+ encoding and errors: specify how to decode percent-encoded sequences
+ into Unicode characters, as accepted by the bytes.decode() method.
"""
dict = {}
- for name, value in parse_qsl(qs, keep_blank_values, strict_parsing):
+ pairs = parse_qsl(qs, keep_blank_values, strict_parsing,
+ encoding=encoding, errors=errors)
+ for name, value in pairs:
if name in dict:
dict[name].append(value)
else:
dict[name] = [value]
return dict
-def parse_qsl(qs, keep_blank_values=False, strict_parsing=False):
+def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
+ encoding='utf-8', errors='replace'):
"""Parse a query given as a string argument.
Arguments:
@@ -407,8 +578,12 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False):
false (the default), errors are silently ignored. If true,
errors raise a ValueError exception.
+ encoding and errors: specify how to decode percent-encoded sequences
+ into Unicode characters, as accepted by the bytes.decode() method.
+
Returns a list, as G-d intended.
"""
+ qs, _coerce_result = _coerce_args(qs)
pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
r = []
for name_value in pairs:
@@ -424,10 +599,13 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False):
else:
continue
if len(nv[1]) or keep_blank_values:
- name = unquote(nv[0].replace('+', ' '))
- value = unquote(nv[1].replace('+', ' '))
+ name = nv[0].replace('+', ' ')
+ name = unquote(name, encoding=encoding, errors=errors)
+ name = _coerce_result(name)
+ value = nv[1].replace('+', ' ')
+ value = unquote(value, encoding=encoding, errors=errors)
+ value = _coerce_result(value)
r.append((name, value))
-
return r
def unquote_plus(string, encoding='utf-8', errors='replace'):
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 6b29901864..5325d62c40 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -94,6 +94,7 @@ import re
import socket
import sys
import time
+import collections
from urllib.error import URLError, HTTPError, ContentTooShortError
from urllib.parse import (
@@ -114,11 +115,27 @@ else:
__version__ = sys.version[:3]
_opener = None
-def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
+def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
+ *, cafile=None, capath=None):
global _opener
- if _opener is None:
- _opener = build_opener()
- return _opener.open(url, data, timeout)
+ if cafile or capath:
+ if not _have_ssl:
+ raise ValueError('SSL support not available')
+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ context.options |= ssl.OP_NO_SSLv2
+ if cafile or capath:
+ context.verify_mode = ssl.CERT_REQUIRED
+ context.load_verify_locations(cafile, capath)
+ check_hostname = True
+ else:
+ check_hostname = False
+ https_handler = HTTPSHandler(context=context, check_hostname=check_hostname)
+ opener = build_opener(https_handler)
+ elif _opener is None:
+ _opener = opener = build_opener()
+ else:
+ opener = _opener
+ return opener.open(url, data, timeout)
def install_opener(opener):
global _opener
@@ -1045,13 +1062,24 @@ class AbstractHTTPHandler(BaseHandler):
if request.data is not None: # POST
data = request.data
+ if isinstance(data, str):
+ raise TypeError("POST data should be bytes"
+ " or an iterable of bytes. It cannot be str.")
if not request.has_header('Content-type'):
request.add_unredirected_header(
'Content-type',
'application/x-www-form-urlencoded')
if not request.has_header('Content-length'):
- request.add_unredirected_header(
- 'Content-length', '%d' % len(data))
+ try:
+ mv = memoryview(data)
+ except TypeError:
+ if isinstance(data, collections.Iterable):
+ raise ValueError("Content-Length should be specified "
+ "for iterable data of type %r %r" % (type(data),
+ data))
+ else:
+ request.add_unredirected_header(
+ 'Content-length', '%d' % (len(mv) * mv.itemsize))
sel_host = host
if request.has_proxy():
@@ -1066,7 +1094,7 @@ class AbstractHTTPHandler(BaseHandler):
return request
- def do_open(self, http_class, req):
+ def do_open(self, http_class, req, **http_conn_args):
"""Return an HTTPResponse object for the request, using http_class.
http_class must implement the HTTPConnection API from http.client.
@@ -1075,7 +1103,8 @@ class AbstractHTTPHandler(BaseHandler):
if not host:
raise URLError('no host given')
- h = http_class(host, timeout=req.timeout) # will parse host:port
+ # will parse host:port
+ h = http_class(host, timeout=req.timeout, **http_conn_args)
headers = dict(req.unredirected_hdrs)
headers.update(dict((k, v) for k, v in req.headers.items()
@@ -1101,7 +1130,7 @@ class AbstractHTTPHandler(BaseHandler):
# Proxy-Authorization should not be sent to origin
# server.
del headers[proxy_auth_hdr]
- h._set_tunnel(req._tunnel_host, headers=tunnel_headers)
+ h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
try:
h.request(req.get_method(), req.selector, req.data, headers)
@@ -1127,10 +1156,18 @@ class HTTPHandler(AbstractHTTPHandler):
http_request = AbstractHTTPHandler.do_request_
if hasattr(http.client, 'HTTPSConnection'):
+ import ssl
+
class HTTPSHandler(AbstractHTTPHandler):
+ def __init__(self, debuglevel=0, context=None, check_hostname=None):
+ AbstractHTTPHandler.__init__(self, debuglevel)
+ self._context = context
+ self._check_hostname = check_hostname
+
def https_open(self, req):
- return self.do_open(http.client.HTTPSConnection, req)
+ return self.do_open(http.client.HTTPSConnection, req,
+ context=self._context, check_hostname=self._check_hostname)
https_request = AbstractHTTPHandler.do_request_
@@ -1216,8 +1253,8 @@ class FileHandler(BaseHandler):
url = req.selector
if url[:2] == '//' and url[2:3] != '/' and (req.host and
req.host != 'localhost'):
- req.type = 'ftp'
- return self.parent.open(req)
+ if not req.host is self.get_names():
+ raise URLError("file:// scheme is supported only on localhost")
else:
return self.open_local_file(req)
@@ -1378,9 +1415,7 @@ class CacheFTPHandler(FTPHandler):
MAXFTPCACHE = 10 # Trim the ftp cache beyond this size
# Helper for non-unix systems
-if os.name == 'mac':
- from macurl2path import url2pathname, pathname2url
-elif os.name == 'nt':
+if os.name == 'nt':
from nturl2path import url2pathname, pathname2url
else:
def url2pathname(pathname):
@@ -1519,7 +1554,7 @@ class URLopener:
try:
fp = self.open_local_file(url1)
hdrs = fp.info()
- del fp
+ fp.close()
return url2pathname(splithost(url1)[1]), hdrs
except IOError as msg:
pass
@@ -1563,8 +1598,6 @@ class URLopener:
tfp.close()
finally:
fp.close()
- del fp
- del tfp
# raise exception if actual size does not match content-length header
if size >= 0 and read < size:
@@ -1638,6 +1671,12 @@ class URLopener:
headers["Authorization"] = "Basic %s" % auth
if realhost:
headers["Host"] = realhost
+
+ # Add Connection:close as we don't support persistent connections yet.
+ # This helps in closing the socket and avoiding ResourceWarning
+
+ headers["Connection"] = "close"
+
for header, value in self.addheaders:
headers[header] = value
@@ -1704,7 +1743,7 @@ class URLopener:
if not isinstance(url, str):
raise URLError('file error', 'proxy support for file protocol currently not implemented')
if url[:2] == '//' and url[2:3] != '/' and url[2:12].lower() != 'localhost/':
- return self.open_ftp(url)
+ raise ValueError("file:// scheme is supported only on localhost")
else:
return self.open_local_file(url)
@@ -2127,7 +2166,7 @@ class ftpwrapper:
# Try to retrieve as a file
try:
cmd = 'RETR ' + file
- conn = self.ftp.ntransfercmd(cmd)
+ conn, retrlen = self.ftp.ntransfercmd(cmd)
except ftplib.error_perm as reason:
if str(reason)[:3] != '550':
raise URLError('ftp error', reason).with_traceback(
@@ -2148,10 +2187,14 @@ class ftpwrapper:
cmd = 'LIST ' + file
else:
cmd = 'LIST'
- conn = self.ftp.ntransfercmd(cmd)
+ conn, retrlen = self.ftp.ntransfercmd(cmd)
self.busy = 1
+
+ ftpobj = addclosehook(conn.makefile('rb'), self.endtransfer)
+ conn.close()
# Pass back both a suitably decorated object and a retrieval length
- return (addclosehook(conn[0].makefile('rb'), self.endtransfer), conn[1])
+ return (ftpobj, retrlen)
+
def endtransfer(self):
if not self.busy:
return
diff --git a/Lib/uu.py b/Lib/uu.py
index 30c1ed8728..d68d29374a 100755
--- a/Lib/uu.py
+++ b/Lib/uu.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Copyright 1994 by Lance Ellinghouse
# Cathedral City, California Republic, United States of America.
diff --git a/Lib/warnings.py b/Lib/warnings.py
index 9de2c6737b..5b5821b1c3 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -357,10 +357,10 @@ class catch_warnings(object):
# If either if the compiled regexs are None, match anything.
_warnings_defaults = False
try:
- from _warnings import (filters, default_action, once_registry,
+ from _warnings import (filters, _defaultaction, _onceregistry,
warn, warn_explicit)
- defaultaction = default_action
- onceregistry = once_registry
+ defaultaction = _defaultaction
+ onceregistry = _onceregistry
_warnings_defaults = True
except ImportError:
filters = []
@@ -371,8 +371,10 @@ except ImportError:
# Module initialization
_processoptions(sys.warnoptions)
if not _warnings_defaults:
- simplefilter("ignore", category=PendingDeprecationWarning, append=1)
- simplefilter("ignore", category=ImportWarning, append=1)
+ silence = [ImportWarning, PendingDeprecationWarning]
+ silence.append(DeprecationWarning)
+ for cls in silence:
+ simplefilter("ignore", category=cls)
bytes_warning = sys.flags.bytes_warning
if bytes_warning > 1:
bytes_action = "error"
@@ -381,4 +383,11 @@ if not _warnings_defaults:
else:
bytes_action = "ignore"
simplefilter(bytes_action, category=BytesWarning, append=1)
+ # resource usage warnings are enabled by default in pydebug mode
+ if hasattr(sys, 'gettotalrefcount'):
+ resource_action = "always"
+ else:
+ resource_action = "ignore"
+ simplefilter(resource_action, category=ResourceWarning, append=1)
+
del _warnings_defaults
diff --git a/Lib/wave.py b/Lib/wave.py
index 24839ca4ce..2877137add 100644
--- a/Lib/wave.py
+++ b/Lib/wave.py
@@ -248,7 +248,7 @@ class Wave_read:
chunk = chunk.file
chunk.size_read = chunk.size_read + nitems * self._sampwidth
data.byteswap()
- data = data.tostring()
+ data = data.tobytes()
else:
data = self._data_chunk.read(nframes * self._framesize)
if self._convert and data:
@@ -356,7 +356,7 @@ class Wave_write:
raise Error('cannot change parameters after starting to write')
if framerate <= 0:
raise Error('bad frame rate')
- self._framerate = framerate
+ self._framerate = int(round(framerate))
def getframerate(self):
if not self._framerate:
@@ -467,11 +467,11 @@ class Wave_write:
self._datalength = self._nframes * self._nchannels * self._sampwidth
self._form_length_pos = self._file.tell()
self._file.write(struct.pack('<l4s4slhhllhh4s',
- 36 + self._datalength, 'WAVE', 'fmt ', 16,
+ 36 + self._datalength, b'WAVE', b'fmt ', 16,
WAVE_FORMAT_PCM, self._nchannels, self._framerate,
self._nchannels * self._framerate * self._sampwidth,
self._nchannels * self._sampwidth,
- self._sampwidth * 8, 'data'))
+ self._sampwidth * 8, b'data'))
self._data_length_pos = self._file.tell()
self._file.write(struct.pack('<l', self._datalength))
self._headerwritten = True
diff --git a/Lib/weakref.py b/Lib/weakref.py
index 66c4dc6ffb..468f8f1029 100644
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -166,7 +166,7 @@ class WeakValueDictionary(collections.MutableMapping):
def popitem(self):
if self._pending_removals:
self._commit_removals()
- while 1:
+ while True:
key, wr = self.data.popitem()
o = wr()
if o is not None:
@@ -324,7 +324,7 @@ class WeakKeyDictionary(collections.MutableMapping):
try:
wr = ref(key)
except TypeError:
- return 0
+ return False
return wr in self.data
def items(self):
@@ -362,7 +362,7 @@ class WeakKeyDictionary(collections.MutableMapping):
return list(self.data)
def popitem(self):
- while 1:
+ while True:
key, value = self.data.popitem()
o = key()
if o is not None:
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 19079858ca..415f12ac5f 100644
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Interfaces for launching and remotely controlling Web browsers."""
# Maintained by Georg Brandl.
@@ -228,15 +228,9 @@ class UnixBrowser(BaseBrowser):
else:
# for TTY browsers, we need stdin/out
inout = None
- # if possible, put browser in separate process group, so
- # keyboard interrupts don't affect browser as well as Python
- setsid = getattr(os, 'setsid', None)
- if not setsid:
- setsid = getattr(os, 'setpgrp', None)
-
p = subprocess.Popen(cmdline, close_fds=True, stdin=inout,
stdout=(self.redirect_stdout and inout or None),
- stderr=inout, preexec_fn=setsid)
+ stderr=inout, start_new_session=True)
if remote:
# wait five secons. If the subprocess is not finished, the
# remote invocation has (hopefully) started a new instance.
@@ -536,18 +530,6 @@ if sys.platform[:3] == "win":
# Platform support for MacOS
#
-try:
- import ic
-except ImportError:
- pass
-else:
- class InternetConfig(BaseBrowser):
- def open(self, url, new=0, autoraise=True):
- ic.launchurl(url)
- return True # Any way to get status?
-
- register("internet-config", InternetConfig, update_tryorder=-1)
-
if sys.platform == 'darwin':
# Adapted from patch submitted to SourceForge by Steven J. Burr
class MacOSX(BaseBrowser):
@@ -596,9 +578,35 @@ if sys.platform == 'darwin':
rc = osapipe.close()
return not rc
+ class MacOSXOSAScript(BaseBrowser):
+ def __init__(self, name):
+ self._name = name
+
+ def open(self, url, new=0, autoraise=True):
+ if self._name == 'default':
+ script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser
+ else:
+ script = '''
+ tell application "%s"
+ activate
+ open location "%s"
+ end
+ '''%(self._name, url.replace('"', '%22'))
+
+ osapipe = os.popen("osascript", "w")
+ if osapipe is None:
+ return False
+
+ osapipe.write(script)
+ rc = osapipe.close()
+ return not rc
+
+
# Don't clear _tryorder or _browsers since OS X can use above Unix support
# (but we prefer using the OS X specific stuff)
- register("MacOSX", None, MacOSX('default'), -1)
+ register("safari", None, MacOSXOSAScript('safari'), -1)
+ register("firefox", None, MacOSXOSAScript('firefox'), -1)
+ register("MacOSX", None, MacOSXOSAScript('default'), -1)
#
diff --git a/Lib/wsgiref/handlers.py b/Lib/wsgiref/handlers.py
index 4a77137451..67064a6875 100644
--- a/Lib/wsgiref/handlers.py
+++ b/Lib/wsgiref/handlers.py
@@ -5,7 +5,10 @@ from .headers import Headers
import sys, os, time
-__all__ = ['BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler']
+__all__ = [
+ 'BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler',
+ 'IISCGIHandler', 'read_environ'
+]
# Weekday and month names for HTTP date/time formatting; always English!
_weekdayname = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
@@ -19,6 +22,73 @@ def format_date_time(timestamp):
_weekdayname[wd], day, _monthname[month], year, hh, mm, ss
)
+_is_request = {
+ 'SCRIPT_NAME', 'PATH_INFO', 'QUERY_STRING', 'REQUEST_METHOD', 'AUTH_TYPE',
+ 'CONTENT_TYPE', 'CONTENT_LENGTH', 'HTTPS', 'REMOTE_USER', 'REMOTE_IDENT',
+}.__contains__
+
+def _needs_transcode(k):
+ return _is_request(k) or k.startswith('HTTP_') or k.startswith('SSL_') \
+ or (k.startswith('REDIRECT_') and _needs_transcode(k[9:]))
+
+def read_environ():
+ """Read environment, fixing HTTP variables"""
+ enc = sys.getfilesystemencoding()
+ esc = 'surrogateescape'
+ try:
+ ''.encode('utf-8', esc)
+ except LookupError:
+ esc = 'replace'
+ environ = {}
+
+ # Take the basic environment from native-unicode os.environ. Attempt to
+ # fix up the variables that come from the HTTP request to compensate for
+ # the bytes->unicode decoding step that will already have taken place.
+ for k, v in os.environ.items():
+ if _needs_transcode(k):
+
+ # On win32, the os.environ is natively Unicode. Different servers
+ # decode the request bytes using different encodings.
+ if sys.platform == 'win32':
+ software = os.environ.get('SERVER_SOFTWARE', '').lower()
+
+ # On IIS, the HTTP request will be decoded as UTF-8 as long
+ # as the input is a valid UTF-8 sequence. Otherwise it is
+ # decoded using the system code page (mbcs), with no way to
+ # detect this has happened. Because UTF-8 is the more likely
+ # encoding, and mbcs is inherently unreliable (an mbcs string
+ # that happens to be valid UTF-8 will not be decoded as mbcs)
+ # always recreate the original bytes as UTF-8.
+ if software.startswith('microsoft-iis/'):
+ v = v.encode('utf-8').decode('iso-8859-1')
+
+ # Apache mod_cgi writes bytes-as-unicode (as if ISO-8859-1) direct
+ # to the Unicode environ. No modification needed.
+ elif software.startswith('apache/'):
+ pass
+
+ # Python 3's http.server.CGIHTTPRequestHandler decodes
+ # using the urllib.unquote default of UTF-8, amongst other
+ # issues.
+ elif (
+ software.startswith('simplehttp/')
+ and 'python/3' in software
+ ):
+ v = v.encode('utf-8').decode('iso-8859-1')
+
+ # For other servers, guess that they have written bytes to
+ # the environ using stdio byte-oriented interfaces, ending up
+ # with the system code page.
+ else:
+ v = v.encode(enc, 'replace').decode('iso-8859-1')
+
+ # Recover bytes from unicode environ, using surrogate escapes
+ # where available (Python 3.1+).
+ else:
+ v = v.encode(enc, esc).decode('iso-8859-1')
+
+ environ[k] = v
+ return environ
class BaseHandler:
@@ -37,7 +107,7 @@ class BaseHandler:
# os_environ is used to supply configuration from the OS environment:
# by default it's a copy of 'os.environ' as of import time, but you can
# override this in e.g. your __init__ method.
- os_environ = dict(os.environ.items())
+ os_environ= read_environ()
# Collaborator classes
wsgi_file_wrapper = FileWrapper # set to None to disable
@@ -45,9 +115,9 @@ class BaseHandler:
# Error handling (also per-subclass or per-instance)
traceback_limit = None # Print entire traceback to self.get_stderr()
- error_status = "500 Dude, this is whack!"
+ error_status = "500 Internal Server Error"
error_headers = [('Content-Type','text/plain')]
- error_body = "A server error occurred. Please contact the administrator."
+ error_body = b"A server error occurred. Please contact the administrator."
# State variables (don't mess with these)
status = result = None
@@ -55,13 +125,6 @@ class BaseHandler:
headers = None
bytes_sent = 0
-
-
-
-
-
-
-
def run(self, application):
"""Invoke the application"""
# Note to self: don't move the close()! Asynchronous servers shouldn't
@@ -145,7 +208,7 @@ class BaseHandler:
self.set_content_length()
def start_response(self, status, headers,exc_info=None):
- """'start_response()' callable as specified by PEP 333"""
+ """'start_response()' callable as specified by PEP 3333"""
if exc_info:
try:
@@ -157,49 +220,48 @@ class BaseHandler:
elif self.headers is not None:
raise AssertionError("Headers already set!")
+ self.status = status
+ self.headers = self.headers_class(headers)
status = self._convert_string_type(status, "Status")
assert len(status)>=4,"Status must be at least 4 characters"
assert int(status[:3]),"Status message must begin w/3-digit code"
assert status[3]==" ", "Status message must have a space after code"
- str_headers = []
- for name,val in headers:
- name = self._convert_string_type(name, "Header name")
- val = self._convert_string_type(val, "Header value")
- str_headers.append((name, val))
- assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed"
+ if __debug__:
+ for name, val in headers:
+ name = self._convert_string_type(name, "Header name")
+ val = self._convert_string_type(val, "Header value")
+ assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed"
- self.status = status
- self.headers = self.headers_class(str_headers)
return self.write
def _convert_string_type(self, value, title):
"""Convert/check value type."""
- if isinstance(value, str):
+ if type(value) is str:
return value
- assert isinstance(value, bytes), \
- "{0} must be a string or bytes object (not {1})".format(title, value)
- return str(value, "iso-8859-1")
+ raise AssertionError(
+ "{0} must be of type str (got {1})".format(title, repr(value))
+ )
def send_preamble(self):
"""Transmit version/status/date/server, via self._write()"""
if self.origin_server:
if self.client_is_modern():
- self._write('HTTP/%s %s\r\n' % (self.http_version,self.status))
+ self._write(('HTTP/%s %s\r\n' % (self.http_version,self.status)).encode('iso-8859-1'))
if 'Date' not in self.headers:
self._write(
- 'Date: %s\r\n' % format_date_time(time.time())
+ ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
)
if self.server_software and 'Server' not in self.headers:
- self._write('Server: %s\r\n' % self.server_software)
+ self._write(('Server: %s\r\n' % self.server_software).encode('iso-8859-1'))
else:
- self._write('Status: %s\r\n' % self.status)
+ self._write(('Status: %s\r\n' % self.status).encode('iso-8859-1'))
def write(self, data):
- """'write()' callable as specified by PEP 333"""
+ """'write()' callable as specified by PEP 3333"""
- assert isinstance(data, (str, bytes)), \
- "write() argument must be a string or bytes"
+ assert type(data) is bytes, \
+ "write() argument must be a bytes instance"
if not self.status:
raise AssertionError("write() before start_response()")
@@ -266,7 +328,7 @@ class BaseHandler:
self.headers_sent = True
if not self.origin_server or self.client_is_modern():
self.send_preamble()
- self._write(str(self.headers))
+ self._write(bytes(self.headers))
def result_is_file(self):
@@ -353,15 +415,6 @@ class BaseHandler:
raise NotImplementedError
-
-
-
-
-
-
-
-
-
class SimpleHandler(BaseHandler):
"""Handler that's just initialized with streams, environment, etc.
@@ -395,12 +448,6 @@ class SimpleHandler(BaseHandler):
self.environ.update(self.base_env)
def _write(self,data):
- if isinstance(data, str):
- try:
- data = data.encode("iso-8859-1")
- except UnicodeEncodeError:
- raise ValueError("Unicode data must contain only code points"
- " representable in ISO-8859-1 encoding")
self.stdout.write(data)
def _flush(self):
@@ -432,23 +479,6 @@ class BaseCGIHandler(SimpleHandler):
origin_server = False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
class CGIHandler(BaseCGIHandler):
"""CGI-based invocation via sys.stdin/stdout/stderr and os.environ
@@ -474,23 +504,42 @@ class CGIHandler(BaseCGIHandler):
def __init__(self):
BaseCGIHandler.__init__(
- self, sys.stdin, sys.stdout, sys.stderr, dict(os.environ.items()),
- multithread=False, multiprocess=True
+ self, sys.stdin.buffer, sys.stdout.buffer, sys.stderr,
+ read_environ(), multithread=False, multiprocess=True
)
+class IISCGIHandler(BaseCGIHandler):
+ """CGI-based invocation with workaround for IIS path bug
+ This handler should be used in preference to CGIHandler when deploying on
+ Microsoft IIS without having set the config allowPathInfo option (IIS>=7)
+ or metabase allowPathInfoForScriptMappings (IIS<7).
+ """
+ wsgi_run_once = True
+ os_environ = {}
+ # By default, IIS gives a PATH_INFO that duplicates the SCRIPT_NAME at
+ # the front, causing problems for WSGI applications that wish to implement
+ # routing. This handler strips any such duplicated path.
+ # IIS can be configured to pass the correct PATH_INFO, but this causes
+ # another bug where PATH_TRANSLATED is wrong. Luckily this variable is
+ # rarely used and is not guaranteed by WSGI. On IIS<7, though, the
+ # setting can only be made on a vhost level, affecting all other script
+ # mappings, many of which break when exposed to the PATH_TRANSLATED bug.
+ # For this reason IIS<7 is almost never deployed with the fix. (Even IIS7
+ # rarely uses it because there is still no UI for it.)
-
-
-
-
-
-
-
-
-
-
-#
+ # There is no way for CGI code to tell whether the option was set, so a
+ # separate handler class is provided.
+ def __init__(self):
+ environ= read_environ()
+ path = environ.get('PATH_INFO', '')
+ script = environ.get('SCRIPT_NAME', '')
+ if (path+'/').startswith(script+'/'):
+ environ['PATH_INFO'] = path[len(script):]
+ BaseCGIHandler.__init__(
+ self, sys.stdin.buffer, sys.stdout.buffer, sys.stderr,
+ environ, multithread=False, multiprocess=True
+ )
diff --git a/Lib/wsgiref/headers.py b/Lib/wsgiref/headers.py
index 025067a1ef..d93962831a 100644
--- a/Lib/wsgiref/headers.py
+++ b/Lib/wsgiref/headers.py
@@ -1,6 +1,6 @@
"""Manage HTTP Response Headers
-Much of this module is red-handedly pilfered from email.Message in the stdlib,
+Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
"""
@@ -25,38 +25,25 @@ def _formatparam(param, value=None, quote=1):
return param
-
-
-
-
-
-
-
-
-
-
-
-
class Headers:
"""Manage a collection of HTTP response headers"""
def __init__(self,headers):
- if not isinstance(headers, list):
+ if type(headers) is not list:
raise TypeError("Headers must be a list of name/value tuples")
- self._headers = []
- for k, v in headers:
- k = self._convert_string_type(k)
- v = self._convert_string_type(v)
- self._headers.append((k, v))
+ self._headers = headers
+ if __debug__:
+ for k, v in headers:
+ self._convert_string_type(k)
+ self._convert_string_type(v)
def _convert_string_type(self, value):
"""Convert/check value type."""
- if isinstance(value, str):
+ if type(value) is str:
return value
- assert isinstance(value, bytes), ("Header names/values must be"
- " a string or bytes object (not {0})".format(value))
- return str(value, "iso-8859-1")
+ raise AssertionError("Header names/values must be"
+ " of type str (got {0})".format(repr(value)))
def __len__(self):
"""Return the total number of headers, including duplicates."""
@@ -87,10 +74,6 @@ class Headers:
"""
return self.get(name)
-
-
-
-
def __contains__(self, name):
"""Return true if the message contains the header."""
return self.get(name) is not None
@@ -127,9 +110,6 @@ class Headers:
"""
return [k for k, v in self._headers]
-
-
-
def values(self):
"""Return a list of all header values.
@@ -158,6 +138,9 @@ class Headers:
suitable for direct HTTP transmission."""
return '\r\n'.join(["%s: %s" % kv for kv in self._headers]+['',''])
+ def __bytes__(self):
+ return str(self).encode('iso-8859-1')
+
def setdefault(self,name,value):
"""Return first matching header value for 'name', or 'value'
@@ -171,7 +154,6 @@ class Headers:
else:
return result
-
def add_header(self, _name, _value, **_params):
"""Extended header setting.
@@ -184,7 +166,7 @@ class Headers:
h.add_header('content-disposition', 'attachment', filename='bud.gif')
- Note that unlike the corresponding 'email.Message' method, this does
+ Note that unlike the corresponding 'email.message' method, this does
*not* handle '(charset, language, value)' tuples: all values must be
strings or None.
"""
@@ -200,19 +182,3 @@ class Headers:
v = self._convert_string_type(v)
parts.append(_formatparam(k.replace('_', '-'), v))
self._headers.append((self._convert_string_type(_name), "; ".join(parts)))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
diff --git a/Lib/wsgiref/simple_server.py b/Lib/wsgiref/simple_server.py
index da14144ad7..af82f953c5 100644
--- a/Lib/wsgiref/simple_server.py
+++ b/Lib/wsgiref/simple_server.py
@@ -1,4 +1,4 @@
-"""BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21)
+"""BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
@@ -15,7 +15,7 @@ import sys
import urllib.parse
from wsgiref.handlers import SimpleHandler
-__version__ = "0.1"
+__version__ = "0.2"
__all__ = ['WSGIServer', 'WSGIRequestHandler', 'demo_app', 'make_server']
@@ -38,8 +38,6 @@ class ServerHandler(SimpleHandler):
-
-
class WSGIServer(HTTPServer):
"""BaseHTTPServer that implements the Python WSGI protocol"""
@@ -69,18 +67,6 @@ class WSGIServer(HTTPServer):
-
-
-
-
-
-
-
-
-
-
-
-
class WSGIRequestHandler(BaseHTTPRequestHandler):
server_version = "WSGIServer/" + __version__
@@ -88,13 +74,14 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
def get_environ(self):
env = self.server.base_environ.copy()
env['SERVER_PROTOCOL'] = self.request_version
+ env['SERVER_SOFTWARE'] = self.server_version
env['REQUEST_METHOD'] = self.command
if '?' in self.path:
path,query = self.path.split('?',1)
else:
path,query = self.path,''
- env['PATH_INFO'] = urllib.parse.unquote(path)
+ env['PATH_INFO'] = urllib.parse.unquote_to_bytes(path).decode('iso-8859-1')
env['QUERY_STRING'] = query
host = self.address_string()
@@ -139,29 +126,6 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
def demo_app(environ,start_response):
from io import StringIO
stdout = StringIO()
@@ -170,7 +134,7 @@ def demo_app(environ,start_response):
h = sorted(environ.items())
for k,v in h:
print(k,'=',repr(v), file=stdout)
- start_response(b"200 OK", [(b'Content-Type',b'text/plain; charset=utf-8')])
+ start_response("200 OK", [('Content-Type','text/plain; charset=utf-8')])
return [stdout.getvalue().encode("utf-8")]
@@ -190,16 +154,3 @@ if __name__ == '__main__':
import webbrowser
webbrowser.open('http://localhost:8000/xyz?abc')
httpd.handle_request() # serve one request, then exit
-
-
-
-
-
-
-
-
-
-
-
-
-#
diff --git a/Lib/wsgiref/util.py b/Lib/wsgiref/util.py
index 06eb956fdf..1f1e6cce17 100644
--- a/Lib/wsgiref/util.py
+++ b/Lib/wsgiref/util.py
@@ -32,13 +32,6 @@ class FileWrapper:
return data
raise StopIteration
-
-
-
-
-
-
-
def guess_scheme(environ):
"""Return a guess for whether 'wsgi.url_scheme' should be 'http' or 'https'
"""
@@ -161,7 +154,6 @@ def setup_testing_defaults(environ):
-
_hoppish = {
'connection':1, 'keep-alive':1, 'proxy-authenticate':1,
'proxy-authorization':1, 'te':1, 'trailers':1, 'transfer-encoding':1,
@@ -171,35 +163,3 @@ _hoppish = {
def is_hop_by_hop(header_name):
"""Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header"""
return _hoppish(header_name.lower())
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
diff --git a/Lib/wsgiref/validate.py b/Lib/wsgiref/validate.py
index 2df3f9f7fe..05a485db7a 100644
--- a/Lib/wsgiref/validate.py
+++ b/Lib/wsgiref/validate.py
@@ -128,11 +128,10 @@ def assert_(cond, *args):
raise AssertionError(*args)
def check_string_type(value, title):
- if isinstance(value, str):
+ if type (value) is str:
return value
- assert isinstance(value, bytes), \
- "{0} must be a string or bytes object (not {1})".format(title, value)
- return str(value, "iso-8859-1")
+ raise AssertionError(
+ "{0} must be of type str (got {1})".format(title, repr(value)))
def validator(application):
@@ -197,20 +196,21 @@ class InputWrapper:
def read(self, *args):
assert_(len(args) == 1)
v = self.input.read(*args)
- assert_(isinstance(v, bytes))
+ assert_(type(v) is bytes)
return v
- def readline(self):
- v = self.input.readline()
- assert_(isinstance(v, bytes))
+ def readline(self, *args):
+ assert_(len(args) <= 1)
+ v = self.input.readline(*args)
+ assert_(type(v) is bytes)
return v
def readlines(self, *args):
assert_(len(args) <= 1)
lines = self.input.readlines(*args)
- assert_(isinstance(lines, list))
+ assert_(type(lines) is list)
for line in lines:
- assert_(isinstance(line, bytes))
+ assert_(type(line) is bytes)
return lines
def __iter__(self):
@@ -229,7 +229,7 @@ class ErrorWrapper:
self.errors = wsgi_errors
def write(self, s):
- assert_(isinstance(s, str))
+ assert_(type(s) is str)
self.errors.write(s)
def flush(self):
@@ -248,7 +248,7 @@ class WriteWrapper:
self.writer = wsgi_writer
def __call__(self, s):
- assert_(isinstance(s, (str, bytes)))
+ assert_(type(s) is bytes)
self.writer(s)
class PartialIteratorWrapper:
@@ -275,6 +275,8 @@ class IteratorWrapper:
assert_(not self.closed,
"Iterator read after closed")
v = next(self.iterator)
+ if type(v) is not bytes:
+ assert_(False, "Iterator yielded non-bytestring (%r)" % (v,))
if self.check_start_response is not None:
assert_(self.check_start_response,
"The application returns and we started iterating over its body, but start_response has not yet been called")
@@ -294,7 +296,7 @@ class IteratorWrapper:
"Iterator garbage collected without being closed")
def check_environ(environ):
- assert_(isinstance(environ, dict),
+ assert_(type(environ) is dict,
"Environment is not of the right type: %r (environment: %r)"
% (type(environ), environ))
@@ -321,11 +323,11 @@ def check_environ(environ):
if '.' in key:
# Extension, we don't care about its type
continue
- assert_(isinstance(environ[key], str),
+ assert_(type(environ[key]) is str,
"Environmental variable %s is not a string: %r (value: %r)"
% (key, type(environ[key]), environ[key]))
- assert_(isinstance(environ['wsgi.version'], tuple),
+ assert_(type(environ['wsgi.version']) is tuple,
"wsgi.version should be a tuple (%r)" % (environ['wsgi.version'],))
assert_(environ['wsgi.url_scheme'] in ('http', 'https'),
"wsgi.url_scheme unknown: %r" % environ['wsgi.url_scheme'])
@@ -385,12 +387,12 @@ def check_status(status):
% status, WSGIWarning)
def check_headers(headers):
- assert_(isinstance(headers, list),
+ assert_(type(headers) is list,
"Headers (%r) must be of type list: %r"
% (headers, type(headers)))
header_names = {}
for item in headers:
- assert_(isinstance(item, tuple),
+ assert_(type(item) is tuple,
"Individual headers (%r) must be of type tuple: %r"
% (item, type(item)))
assert_(len(item) == 2)
@@ -428,14 +430,14 @@ def check_content_type(status, headers):
assert_(0, "No Content-Type header found in headers (%s)" % headers)
def check_exc_info(exc_info):
- assert_(exc_info is None or isinstance(exc_info, tuple),
+ assert_(exc_info is None or type(exc_info) is tuple,
"exc_info (%r) is not a tuple: %r" % (exc_info, type(exc_info)))
# More exc_info checks?
def check_iterator(iterator):
- # Technically a string is legal, which is why it's a really bad
+ # Technically a bytestring is legal, which is why it's a really bad
# idea, because it may cause the response to be returned
# character-by-character
assert_(not isinstance(iterator, (str, bytes)),
"You should not return a string as your application iterator, "
- "instead return a single-item list containing that string.")
+ "instead return a single-item list containing a bytestring.")
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index d9c04d48ad..218c62ed5f 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -268,6 +268,14 @@ class Node(xml.dom.Node):
self.previousSibling = None
self.nextSibling = None
+ # A Node is its own context manager, to ensure that an unlink() call occurs.
+ # This is similar to how a file object works.
+ def __enter__(self):
+ return self
+
+ def __exit__(self, et, ev, tb):
+ self.unlink()
+
defproperty(Node, "firstChild", doc="First child node, or None.")
defproperty(Node, "lastChild", doc="Last child node, or None.")
defproperty(Node, "localName", doc="Namespace-local name of this node.")
@@ -913,6 +921,10 @@ class Childless:
raise xml.dom.NotFoundErr(
self.nodeName + " nodes do not have children")
+ def normalize(self):
+ # For childless nodes, normalize() has nothing to do.
+ pass
+
def replaceChild(self, newChild, oldChild):
raise xml.dom.HierarchyRequestErr(
self.nodeName + " nodes do not have children")
diff --git a/Lib/xml/etree/ElementInclude.py b/Lib/xml/etree/ElementInclude.py
index d7f85b3217..84fd7548b2 100644
--- a/Lib/xml/etree/ElementInclude.py
+++ b/Lib/xml/etree/ElementInclude.py
@@ -1,6 +1,6 @@
#
# ElementTree
-# $Id: ElementInclude.py 1862 2004-06-18 07:31:02Z Fredrik $
+# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
@@ -16,7 +16,7 @@
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
-# Copyright (c) 1999-2004 by Fredrik Lundh
+# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
@@ -42,7 +42,7 @@
# --------------------------------------------------------------------
# Licensed to PSF under a Contributor Agreement.
-# See http://www.python.org/2.4/license for licensing details.
+# See http://www.python.org/psf/license for licensing details.
##
# Limited XInclude support for the ElementTree package.
@@ -125,7 +125,7 @@ def include(elem, loader=None):
)
if i:
node = elem[i-1]
- node.tail = (node.tail or "") + text
+ node.tail = (node.tail or "") + text + (e.tail or "")
else:
elem.text = (elem.text or "") + text + (e.tail or "")
del elem[i]
diff --git a/Lib/xml/etree/ElementPath.py b/Lib/xml/etree/ElementPath.py
index 00dbe9d546..52e65f063d 100644
--- a/Lib/xml/etree/ElementPath.py
+++ b/Lib/xml/etree/ElementPath.py
@@ -1,6 +1,6 @@
#
# ElementTree
-# $Id: ElementPath.py 1858 2004-06-17 21:31:41Z Fredrik $
+# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
@@ -8,8 +8,13 @@
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
+# 2007-09-10 fl new selection engine
+# 2007-09-12 fl fixed parent selector
+# 2007-09-13 fl added iterfind; changed findall to return a list
+# 2007-11-30 fl added namespaces support
+# 2009-10-30 fl added child element value filter
#
-# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
+# Copyright (c) 2003-2009 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
@@ -17,7 +22,7 @@
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
-# Copyright (c) 1999-2004 by Fredrik Lundh
+# Copyright (c) 1999-2009 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
@@ -43,7 +48,7 @@
# --------------------------------------------------------------------
# Licensed to PSF under a Contributor Agreement.
-# See http://www.python.org/2.4/license for licensing details.
+# See http://www.python.org/psf/license for licensing details.
##
# Implementation module for XPath support. There's usually no reason
@@ -53,146 +58,246 @@
import re
-xpath_tokenizer = re.compile(
- "(::|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/:\[\]\(\)@=\s]+)|\s+"
- ).findall
+xpath_tokenizer_re = re.compile(
+ "("
+ "'[^']*'|\"[^\"]*\"|"
+ "::|"
+ "//?|"
+ "\.\.|"
+ "\(\)|"
+ "[/.*:\[\]\(\)@=])|"
+ "((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|"
+ "\s+"
+ )
-class xpath_descendant_or_self:
- pass
+def xpath_tokenizer(pattern, namespaces=None):
+ for token in xpath_tokenizer_re.findall(pattern):
+ tag = token[1]
+ if tag and tag[0] != "{" and ":" in tag:
+ try:
+ prefix, uri = tag.split(":", 1)
+ if not namespaces:
+ raise KeyError
+ yield token[0], "{%s}%s" % (namespaces[prefix], uri)
+ except KeyError:
+ raise SyntaxError("prefix %r not found in prefix map" % prefix)
+ else:
+ yield token
-##
-# Wrapper for a compiled XPath.
+def get_parent_map(context):
+ parent_map = context.parent_map
+ if parent_map is None:
+ context.parent_map = parent_map = {}
+ for p in context.root.iter():
+ for e in p:
+ parent_map[e] = p
+ return parent_map
-class Path:
+def prepare_child(next, token):
+ tag = token[1]
+ def select(context, result):
+ for elem in result:
+ for e in elem:
+ if e.tag == tag:
+ yield e
+ return select
- ##
- # Create an Path instance from an XPath expression.
+def prepare_star(next, token):
+ def select(context, result):
+ for elem in result:
+ for e in elem:
+ yield e
+ return select
- def __init__(self, path):
- tokens = xpath_tokenizer(path)
- # the current version supports 'path/path'-style expressions only
- self.path = []
- self.tag = None
- if tokens and tokens[0][0] == "/":
- raise SyntaxError("cannot use absolute path on element")
- while tokens:
- op, tag = tokens.pop(0)
- if tag or op == "*":
- self.path.append(tag or op)
- elif op == ".":
- pass
- elif op == "/":
- self.path.append(xpath_descendant_or_self())
- continue
- else:
- raise SyntaxError("unsupported path syntax (%s)" % op)
- if tokens:
- op, tag = tokens.pop(0)
- if op != "/":
- raise SyntaxError(
- "expected path separator (%s)" % (op or tag)
- )
- if self.path and isinstance(self.path[-1], xpath_descendant_or_self):
- raise SyntaxError("path cannot end with //")
- if len(self.path) == 1 and isinstance(self.path[0], type("")):
- self.tag = self.path[0]
-
- ##
- # Find first matching object.
-
- def find(self, element):
- tag = self.tag
- if tag is None:
- nodeset = self.findall(element)
- if not nodeset:
- return None
- return nodeset[0]
- for elem in element:
- if elem.tag == tag:
- return elem
- return None
+def prepare_self(next, token):
+ def select(context, result):
+ for elem in result:
+ yield elem
+ return select
- ##
- # Find text for first matching object.
-
- def findtext(self, element, default=None):
- tag = self.tag
- if tag is None:
- nodeset = self.findall(element)
- if not nodeset:
- return default
- return nodeset[0].text or ""
- for elem in element:
- if elem.tag == tag:
- return elem.text or ""
- return default
+def prepare_descendant(next, token):
+ token = next()
+ if token[0] == "*":
+ tag = "*"
+ elif not token[0]:
+ tag = token[1]
+ else:
+ raise SyntaxError("invalid descendant")
+ def select(context, result):
+ for elem in result:
+ for e in elem.iter(tag):
+ if e is not elem:
+ yield e
+ return select
- ##
- # Find all matching objects.
+def prepare_parent(next, token):
+ def select(context, result):
+ # FIXME: raise error if .. is applied at toplevel?
+ parent_map = get_parent_map(context)
+ result_map = {}
+ for elem in result:
+ if elem in parent_map:
+ parent = parent_map[elem]
+ if parent not in result_map:
+ result_map[parent] = None
+ yield parent
+ return select
- def findall(self, element):
- nodeset = [element]
- index = 0
- while 1:
- try:
- path = self.path[index]
- index = index + 1
- except IndexError:
- return nodeset
- set = []
- if isinstance(path, xpath_descendant_or_self):
+def prepare_predicate(next, token):
+ # FIXME: replace with real parser!!! refs:
+ # http://effbot.org/zone/simple-iterator-parser.htm
+ # http://javascript.crockford.com/tdop/tdop.html
+ signature = []
+ predicate = []
+ while 1:
+ token = next()
+ if token[0] == "]":
+ break
+ if token[0] and token[0][:1] in "'\"":
+ token = "'", token[0][1:-1]
+ signature.append(token[0] or "-")
+ predicate.append(token[1])
+ signature = "".join(signature)
+ # use signature to determine predicate type
+ if signature == "@-":
+ # [@attribute] predicate
+ key = predicate[1]
+ def select(context, result):
+ for elem in result:
+ if elem.get(key) is not None:
+ yield elem
+ return select
+ if signature == "@-='":
+ # [@attribute='value']
+ key = predicate[1]
+ value = predicate[-1]
+ def select(context, result):
+ for elem in result:
+ if elem.get(key) == value:
+ yield elem
+ return select
+ if signature == "-" and not re.match("\d+$", predicate[0]):
+ # [tag]
+ tag = predicate[0]
+ def select(context, result):
+ for elem in result:
+ if elem.find(tag) is not None:
+ yield elem
+ return select
+ if signature == "-='" and not re.match("\d+$", predicate[0]):
+ # [tag='value']
+ tag = predicate[0]
+ value = predicate[-1]
+ def select(context, result):
+ for elem in result:
+ for e in elem.findall(tag):
+ if "".join(e.itertext()) == value:
+ yield elem
+ break
+ return select
+ if signature == "-" or signature == "-()" or signature == "-()-":
+ # [index] or [last()] or [last()-index]
+ if signature == "-":
+ index = int(predicate[0]) - 1
+ else:
+ if predicate[0] != "last":
+ raise SyntaxError("unsupported function")
+ if signature == "-()-":
try:
- tag = self.path[index]
- if not isinstance(tag, type("")):
- tag = None
- else:
- index = index + 1
- except IndexError:
- tag = None # invalid path
- for node in nodeset:
- new = list(node.getiterator(tag))
- if new and new[0] is node:
- set.extend(new[1:])
- else:
- set.extend(new)
+ index = int(predicate[2]) - 1
+ except ValueError:
+ raise SyntaxError("unsupported expression")
else:
- for node in nodeset:
- for node in node:
- if path == "*" or node.tag == path:
- set.append(node)
- if not set:
- return []
- nodeset = set
+ index = -1
+ def select(context, result):
+ parent_map = get_parent_map(context)
+ for elem in result:
+ try:
+ parent = parent_map[elem]
+ # FIXME: what if the selector is "*" ?
+ elems = list(parent.findall(elem.tag))
+ if elems[index] is elem:
+ yield elem
+ except (IndexError, KeyError):
+ pass
+ return select
+ raise SyntaxError("invalid predicate")
+
+ops = {
+ "": prepare_child,
+ "*": prepare_star,
+ ".": prepare_self,
+ "..": prepare_parent,
+ "//": prepare_descendant,
+ "[": prepare_predicate,
+ }
_cache = {}
+class _SelectorContext:
+ parent_map = None
+ def __init__(self, root):
+ self.root = root
+
+# --------------------------------------------------------------------
+
##
-# (Internal) Compile path.
-
-def _compile(path):
- p = _cache.get(path)
- if p is not None:
- return p
- p = Path(path)
- if len(_cache) >= 100:
- _cache.clear()
- _cache[path] = p
- return p
+# Generate all matching objects.
+
+def iterfind(elem, path, namespaces=None):
+ # compile selector pattern
+ if path[-1:] == "/":
+ path = path + "*" # implicit all (FIXME: keep this?)
+ try:
+ selector = _cache[path]
+ except KeyError:
+ if len(_cache) > 100:
+ _cache.clear()
+ if path[:1] == "/":
+ raise SyntaxError("cannot use absolute path on element")
+ next = iter(xpath_tokenizer(path, namespaces)).__next__
+ token = next()
+ selector = []
+ while 1:
+ try:
+ selector.append(ops[token[0]](next, token))
+ except StopIteration:
+ raise SyntaxError("invalid path")
+ try:
+ token = next()
+ if token[0] == "/":
+ token = next()
+ except StopIteration:
+ break
+ _cache[path] = selector
+ # execute selector pattern
+ result = [elem]
+ context = _SelectorContext(elem)
+ for select in selector:
+ result = select(context, result)
+ return result
##
# Find first matching object.
-def find(element, path):
- return _compile(path).find(element)
+def find(elem, path, namespaces=None):
+ try:
+ return next(iterfind(elem, path, namespaces))
+ except StopIteration:
+ return None
##
-# Find text for first matching object.
+# Find all matching objects.
-def findtext(element, path, default=None):
- return _compile(path).findtext(element, default)
+def findall(elem, path, namespaces=None):
+ return list(iterfind(elem, path, namespaces))
##
-# Find all matching objects.
+# Find text for first matching object.
-def findall(element, path):
- return _compile(path).findall(element)
+def findtext(elem, path, default=None, namespaces=None):
+ try:
+ elem = next(iterfind(elem, path, namespaces))
+ return elem.text or ""
+ except StopIteration:
+ return default
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index c47573e313..ba33879784 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -1,40 +1,24 @@
#
# ElementTree
-# $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $
+# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
-# light-weight XML support for Python 1.5.2 and later.
+# light-weight XML support for Python 2.3 and later.
#
-# history:
-# 2001-10-20 fl created (from various sources)
-# 2001-11-01 fl return root from parse method
-# 2002-02-16 fl sort attributes in lexical order
-# 2002-04-06 fl TreeBuilder refactoring, added PythonDoc markup
-# 2002-05-01 fl finished TreeBuilder refactoring
-# 2002-07-14 fl added basic namespace support to ElementTree.write
-# 2002-07-25 fl added QName attribute support
-# 2002-10-20 fl fixed encoding in write
-# 2002-11-24 fl changed default encoding to ascii; fixed attribute encoding
-# 2002-11-27 fl accept file objects or file names for parse/write
-# 2002-12-04 fl moved XMLTreeBuilder back to this module
-# 2003-01-11 fl fixed entity encoding glitch for us-ascii
-# 2003-02-13 fl added XML literal factory
-# 2003-02-21 fl added ProcessingInstruction/PI factory
-# 2003-05-11 fl added tostring/fromstring helpers
-# 2003-05-26 fl added ElementPath support
-# 2003-07-05 fl added makeelement factory method
-# 2003-07-28 fl added more well-known namespace prefixes
-# 2003-08-15 fl fixed typo in ElementTree.findtext (Thomas Dartsch)
-# 2003-09-04 fl fall back on emulator if ElementPath is not installed
-# 2003-10-31 fl markup updates
-# 2003-11-15 fl fixed nested namespace bug
-# 2004-03-28 fl added XMLID helper
-# 2004-06-02 fl added default support to findtext
-# 2004-06-08 fl fixed encoding of non-ascii element/attribute names
-# 2004-08-23 fl take advantage of post-2.1 expat features
-# 2005-02-01 fl added iterparse implementation
-# 2005-03-02 fl fixed iterparse support for pre-2.2 versions
+# history (since 1.2.6):
+# 2005-11-12 fl added tostringlist/fromstringlist helpers
+# 2006-07-05 fl merged in selected changes from the 1.3 sandbox
+# 2006-07-05 fl removed support for 2.1 and earlier
+# 2007-06-21 fl added deprecation/future warnings
+# 2007-08-25 fl added doctype hook, added parser version attribute etc
+# 2007-08-26 fl added new serializer code (better namespace handling, etc)
+# 2007-08-27 fl warn for broken /tag searches on tree level
+# 2007-09-02 fl added html/text methods to serializer (experimental)
+# 2007-09-05 fl added method argument to tostring/tostringlist
+# 2007-09-06 fl improved error handling
+# 2007-09-13 fl added itertext, iterfind; assorted cleanups
+# 2007-12-15 fl added C14N hooks, copy method (experimental)
#
-# Copyright (c) 1999-2005 by Fredrik Lundh. All rights reserved.
+# Copyright (c) 1999-2008 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
@@ -42,7 +26,7 @@
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
-# Copyright (c) 1999-2005 by Fredrik Lundh
+# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
@@ -68,25 +52,28 @@
# --------------------------------------------------------------------
# Licensed to PSF under a Contributor Agreement.
-# See http://www.python.org/2.4/license for licensing details.
+# See http://www.python.org/psf/license for licensing details.
__all__ = [
# public symbols
"Comment",
"dump",
"Element", "ElementTree",
- "fromstring",
+ "fromstring", "fromstringlist",
"iselement", "iterparse",
- "parse",
+ "parse", "ParseError",
"PI", "ProcessingInstruction",
"QName",
"SubElement",
- "tostring",
+ "tostring", "tostringlist",
"TreeBuilder",
- "VERSION", "XML",
+ "VERSION",
+ "XML",
"XMLParser", "XMLTreeBuilder",
]
+VERSION = "1.3.0"
+
##
# The <b>Element</b> type is a flexible container object, designed to
# store hierarchical data structures in memory. The type can be
@@ -102,36 +89,86 @@ __all__ = [
# <li>a number of <i>child elements</i>, stored in a Python sequence</li>
# </ul>
#
-# To create an element instance, use the {@link #Element} or {@link
-# #SubElement} factory functions.
+# To create an element instance, use the {@link #Element} constructor
+# or the {@link #SubElement} factory function.
# <p>
# The {@link #ElementTree} class can be used to wrap an element
# structure, and convert it from and to XML.
##
-import sys, re
+import sys
+import re
+import warnings
+
+
+class _SimpleElementPath:
+ # emulate pre-1.2 find/findtext/findall behaviour
+ def find(self, element, tag, namespaces=None):
+ for elem in element:
+ if elem.tag == tag:
+ return elem
+ return None
+ def findtext(self, element, tag, default=None, namespaces=None):
+ elem = self.find(element, tag)
+ if elem is None:
+ return default
+ return elem.text or ""
+ def iterfind(self, element, tag, namespaces=None):
+ if tag[:3] == ".//":
+ for elem in element.iter(tag[3:]):
+ yield elem
+ for elem in element:
+ if elem.tag == tag:
+ yield elem
+ def findall(self, element, tag, namespaces=None):
+ return list(self.iterfind(element, tag, namespaces))
+
+try:
+ from . import ElementPath
+except ImportError:
+ ElementPath = _SimpleElementPath()
+
+##
+# Parser error. This is a subclass of <b>SyntaxError</b>.
+# <p>
+# In addition to the exception value, an exception instance contains a
+# specific exception code in the <b>code</b> attribute, and the line and
+# column of the error in the <b>position</b> attribute.
+
+class ParseError(SyntaxError):
+ pass
-from . import ElementPath
+# --------------------------------------------------------------------
-# TODO: add support for custom namespace resolvers/default namespaces
-# TODO: add improved support for incremental parsing
+##
+# Checks if an object appears to be a valid element object.
+#
+# @param An element instance.
+# @return A true value if this is an element object.
+# @defreturn flag
-VERSION = "1.2.6"
+def iselement(element):
+ # FIXME: not sure about this; might be a better idea to look
+ # for tag/attrib/text attributes
+ return isinstance(element, Element) or hasattr(element, "tag")
##
-# Internal element class. This class defines the Element interface,
-# and provides a reference implementation of this interface.
+# Element class. This class defines the Element interface, and
+# provides a reference implementation of this interface.
# <p>
-# You should not create instances of this class directly. Use the
-# appropriate factory functions instead, such as {@link #Element}
-# and {@link #SubElement}.
+# The element name, attribute names, and attribute values can be
+# either ASCII strings (ordinary Python strings containing only 7-bit
+# ASCII characters) or Unicode strings.
#
+# @param tag The element name.
+# @param attrib An optional dictionary, containing element attributes.
+# @param **extra Additional attributes, given as keyword arguments.
# @see Element
# @see SubElement
# @see Comment
# @see ProcessingInstruction
-class _ElementInterface:
+class Element:
# <tag attrib>text<child/>...</tag>tail
##
@@ -141,34 +178,41 @@ class _ElementInterface:
##
# (Attribute) Element attribute dictionary. Where possible, use
- # {@link #_ElementInterface.get},
- # {@link #_ElementInterface.set},
- # {@link #_ElementInterface.keys}, and
- # {@link #_ElementInterface.items} to access
+ # {@link #Element.get},
+ # {@link #Element.set},
+ # {@link #Element.keys}, and
+ # {@link #Element.items} to access
# element attributes.
attrib = None
##
# (Attribute) Text before first subelement. This is either a
- # string or the value None, if there was no text.
+ # string or the value None. Note that if there was no text, this
+ # attribute may be either None or an empty string, depending on
+ # the parser.
text = None
##
# (Attribute) Text after this element's end tag, but before the
# next sibling element's start tag. This is either a string or
- # the value None, if there was no text.
+ # the value None. Note that if there was no text, this attribute
+ # may be either None or an empty string, depending on the parser.
tail = None # text after end tag, if any
- def __init__(self, tag, attrib):
+ # constructor
+
+ def __init__(self, tag, attrib={}, **extra):
+ attrib = attrib.copy()
+ attrib.update(extra)
self.tag = tag
self.attrib = attrib
self._children = []
def __repr__(self):
- return "<Element %s at %x>" % (self.tag, id(self))
+ return "<Element %s at 0x%x>" % (repr(self.tag), id(self))
##
# Creates a new element object of the same type as this element.
@@ -178,18 +222,41 @@ class _ElementInterface:
# @return A new element instance.
def makeelement(self, tag, attrib):
- return Element(tag, attrib)
+ return self.__class__(tag, attrib)
##
- # Returns the number of subelements.
+ # (Experimental) Copies the current element. This creates a
+ # shallow copy; subelements will be shared with the original tree.
+ #
+ # @return A new element instance.
+
+ def copy(self):
+ elem = self.makeelement(self.tag, self.attrib)
+ elem.text = self.text
+ elem.tail = self.tail
+ elem[:] = self
+ return elem
+
+ ##
+ # Returns the number of subelements. Note that this only counts
+ # full elements; to check if there's any content in an element, you
+ # have to check both the length and the <b>text</b> attribute.
#
# @return The number of subelements.
def __len__(self):
return len(self._children)
+ def __bool__(self):
+ warnings.warn(
+ "The behavior of this method will change in future versions. "
+ "Use specific 'len(elem)' or 'elem is not None' test instead.",
+ FutureWarning, stacklevel=2
+ )
+ return len(self._children) != 0 # emulate old behaviour, for now
+
##
- # Returns the given subelement.
+ # Returns the given subelement, by index.
#
# @param index What subelement to return.
# @return The given subelement.
@@ -199,19 +266,22 @@ class _ElementInterface:
return self._children[index]
##
- # Replaces the given subelement.
+ # Replaces the given subelement, by index.
#
# @param index What subelement to replace.
# @param element The new element value.
# @exception IndexError If the given element does not exist.
- # @exception AssertionError If element is not a valid object.
def __setitem__(self, index, element):
- assert iselement(element)
+ # if isinstance(index, slice):
+ # for elt in element:
+ # assert iselement(elt)
+ # else:
+ # assert iselement(element)
self._children[index] = element
##
- # Deletes the given subelement.
+ # Deletes the given subelement, by index.
#
# @param index What subelement to delete.
# @exception IndexError If the given element does not exist.
@@ -220,118 +290,121 @@ class _ElementInterface:
del self._children[index]
##
- # Returns a list containing subelements in the given range.
+ # Adds a subelement to the end of this element. In document order,
+ # the new element will appear after the last existing subelement (or
+ # directly after the text, if it's the first subelement), but before
+ # the end tag for this element.
#
- # @param start The first subelement to return.
- # @param stop The first subelement that shouldn't be returned.
- # @return A sequence object containing subelements.
+ # @param element The element to add.
- def __getslice__(self, start, stop):
- return self._children[start:stop]
+ def append(self, element):
+ # assert iselement(element)
+ self._children.append(element)
##
- # Replaces a number of subelements with elements from a sequence.
+ # Appends subelements from a sequence.
#
- # @param start The first subelement to replace.
- # @param stop The first subelement that shouldn't be replaced.
# @param elements A sequence object with zero or more elements.
- # @exception AssertionError If a sequence member is not a valid object.
+ # @since 1.3
- def __setslice__(self, start, stop, elements):
- for element in elements:
- assert iselement(element)
- self._children[start:stop] = list(elements)
-
- ##
- # Deletes a number of subelements.
- #
- # @param start The first subelement to delete.
- # @param stop The first subelement to leave in there.
-
- def __delslice__(self, start, stop):
- del self._children[start:stop]
-
- ##
- # Adds a subelement to the end of this element.
- #
- # @param element The element to add.
- # @exception AssertionError If a sequence member is not a valid object.
-
- def append(self, element):
- assert iselement(element)
- self._children.append(element)
+ def extend(self, elements):
+ # for element in elements:
+ # assert iselement(element)
+ self._children.extend(elements)
##
# Inserts a subelement at the given position in this element.
#
# @param index Where to insert the new subelement.
- # @exception AssertionError If the element is not a valid object.
def insert(self, index, element):
- assert iselement(element)
+ # assert iselement(element)
self._children.insert(index, element)
##
# Removes a matching subelement. Unlike the <b>find</b> methods,
# this method compares elements based on identity, not on tag
- # value or contents.
+ # value or contents. To remove subelements by other means, the
+ # easiest way is often to use a list comprehension to select what
+ # elements to keep, and use slice assignment to update the parent
+ # element.
#
# @param element What element to remove.
# @exception ValueError If a matching element could not be found.
- # @exception AssertionError If the element is not a valid object.
def remove(self, element):
- assert iselement(element)
+ # assert iselement(element)
self._children.remove(element)
##
- # Returns all subelements. The elements are returned in document
- # order.
+ # (Deprecated) Returns all subelements. The elements are returned
+ # in document order.
#
# @return A list of subelements.
# @defreturn list of Element instances
def getchildren(self):
+ warnings.warn(
+ "This method will be removed in future versions. "
+ "Use 'list(elem)' or iteration over elem instead.",
+ DeprecationWarning, stacklevel=2
+ )
return self._children
##
# Finds the first matching subelement, by tag name or path.
#
# @param path What element to look for.
+ # @keyparam namespaces Optional namespace prefix map.
# @return The first matching element, or None if no element was found.
# @defreturn Element or None
- def find(self, path):
- return ElementPath.find(self, path)
+ def find(self, path, namespaces=None):
+ return ElementPath.find(self, path, namespaces)
##
# Finds text for the first matching subelement, by tag name or path.
#
# @param path What element to look for.
# @param default What to return if the element was not found.
+ # @keyparam namespaces Optional namespace prefix map.
# @return The text content of the first matching element, or the
# default value no element was found. Note that if the element
- # has is found, but has no text content, this method returns an
+ # is found, but has no text content, this method returns an
# empty string.
# @defreturn string
- def findtext(self, path, default=None):
- return ElementPath.findtext(self, path, default)
+ def findtext(self, path, default=None, namespaces=None):
+ return ElementPath.findtext(self, path, default, namespaces)
##
# Finds all matching subelements, by tag name or path.
#
# @param path What element to look for.
- # @return A list or iterator containing all matching elements,
+ # @keyparam namespaces Optional namespace prefix map.
+ # @return A list or other sequence containing all matching elements,
# in document order.
# @defreturn list of Element instances
- def findall(self, path):
- return ElementPath.findall(self, path)
+ def findall(self, path, namespaces=None):
+ return ElementPath.findall(self, path, namespaces)
+
+ ##
+ # Finds all matching subelements, by tag name or path.
+ #
+ # @param path What element to look for.
+ # @keyparam namespaces Optional namespace prefix map.
+ # @return An iterator or sequence containing all matching elements,
+ # in document order.
+ # @defreturn a generated sequence of Element instances
+
+ def iterfind(self, path, namespaces=None):
+ return ElementPath.iterfind(self, path, namespaces)
##
# Resets an element. This function removes all subelements, clears
- # all attributes, and sets the text and tail attributes to None.
+ # all attributes, and sets the <b>text</b> and <b>tail</b> attributes
+ # to None.
def clear(self):
self.attrib.clear()
@@ -339,7 +412,8 @@ class _ElementInterface:
self.text = self.tail = None
##
- # Gets an element attribute.
+ # Gets an element attribute. Equivalent to <b>attrib.get</b>, but
+ # some implementations may handle this a bit more efficiently.
#
# @param key What attribute to look for.
# @param default What to return if the attribute was not found.
@@ -351,7 +425,8 @@ class _ElementInterface:
return self.attrib.get(key, default)
##
- # Sets an element attribute.
+ # Sets an element attribute. Equivalent to <b>attrib[key] = value</b>,
+ # but some implementations may handle this a bit more efficiently.
#
# @param key What attribute to set.
# @param value The attribute value.
@@ -362,6 +437,7 @@ class _ElementInterface:
##
# Gets a list of attribute names. The names are returned in an
# arbitrary order (just like for an ordinary Python dictionary).
+ # Equivalent to <b>attrib.keys()</b>.
#
# @return A list of element attribute names.
# @defreturn list of strings
@@ -371,7 +447,7 @@ class _ElementInterface:
##
# Gets element attributes, as a sequence. The attributes are
- # returned in an arbitrary order.
+ # returned in an arbitrary order. Equivalent to <b>attrib.items()</b>.
#
# @return A list of (name, value) tuples for all attributes.
# @defreturn list of (string, string) tuples
@@ -384,45 +460,55 @@ class _ElementInterface:
# and all subelements, in document order, and returns all elements
# with a matching tag.
# <p>
- # If the tree structure is modified during iteration, the result
- # is undefined.
+ # If the tree structure is modified during iteration, new or removed
+ # elements may or may not be included. To get a stable set, use the
+ # list() function on the iterator, and loop over the resulting list.
#
# @param tag What tags to look for (default is to return all elements).
- # @return A list or iterator containing all the matching elements.
- # @defreturn list or iterator
+ # @return An iterator containing all the matching elements.
+ # @defreturn iterator
- def getiterator(self, tag=None):
- nodes = []
+ def iter(self, tag=None):
if tag == "*":
tag = None
if tag is None or self.tag == tag:
- nodes.append(self)
- for node in self._children:
- nodes.extend(node.getiterator(tag))
- return nodes
+ yield self
+ for e in self._children:
+ for e in e.iter(tag):
+ yield e
-# compatibility
-_Element = _ElementInterface
+ # compatibility
+ def getiterator(self, tag=None):
+ # Change for a DeprecationWarning in 1.4
+ warnings.warn(
+ "This method will be removed in future versions. "
+ "Use 'elem.iter()' or 'list(elem.iter())' instead.",
+ PendingDeprecationWarning, stacklevel=2
+ )
+ return list(self.iter(tag))
-##
-# Element factory. This function returns an object implementing the
-# standard Element interface. The exact class or type of that object
-# is implementation dependent, but it will always be compatible with
-# the {@link #_ElementInterface} class in this module.
-# <p>
-# The element name, attribute names, and attribute values can be
-# either 8-bit ASCII strings or Unicode strings.
-#
-# @param tag The element name.
-# @param attrib An optional dictionary, containing element attributes.
-# @param **extra Additional attributes, given as keyword arguments.
-# @return An element instance.
-# @defreturn Element
+ ##
+ # Creates a text iterator. The iterator loops over this element
+ # and all subelements, in document order, and returns all inner
+ # text.
+ #
+ # @return An iterator containing all inner text.
+ # @defreturn iterator
-def Element(tag, attrib={}, **extra):
- attrib = attrib.copy()
- attrib.update(extra)
- return _ElementInterface(tag, attrib)
+ def itertext(self):
+ tag = self.tag
+ if not isinstance(tag, str) and tag is not None:
+ return
+ if self.text:
+ yield self.text
+ for e in self:
+ for s in e.itertext():
+ yield s
+ if e.tail:
+ yield e.tail
+
+# compatibility
+_Element = _ElementInterface = Element
##
# Subelement factory. This function creates an element instance, and
@@ -447,7 +533,8 @@ def SubElement(parent, tag, attrib={}, **extra):
##
# Comment element factory. This factory function creates a special
-# element that will be serialized as an XML comment.
+# element that will be serialized as an XML comment by the standard
+# serializer.
# <p>
# The comment string can be either an 8-bit ASCII string or a Unicode
# string.
@@ -463,7 +550,8 @@ def Comment(text=None):
##
# PI element factory. This factory function creates a special element
-# that will be serialized as an XML processing instruction.
+# that will be serialized as an XML processing instruction by the standard
+# serializer.
#
# @param target A string containing the PI target.
# @param text A string containing the PI contents, if any.
@@ -496,6 +584,8 @@ class QName:
self.text = text_or_uri
def __str__(self):
return self.text
+ def __repr__(self):
+ return '<QName %r>' % (self.text,)
def __hash__(self):
return hash(self.text)
def __le__(self, other):
@@ -523,19 +613,21 @@ class QName:
return self.text != other.text
return self.text != other
+# --------------------------------------------------------------------
+
##
# ElementTree wrapper class. This class represents an entire element
# hierarchy, and adds some extra support for serialization to and from
# standard XML.
#
# @param element Optional root element.
-# @keyparam file Optional file handle or name. If given, the
+# @keyparam file Optional file handle or file name. If given, the
# tree is initialized with the contents of this XML file.
class ElementTree:
def __init__(self, element=None, file=None):
- assert element is None or iselement(element)
+ # assert element is None or iselement(element)
self._root = element # first node
if file:
self.parse(file)
@@ -557,30 +649,38 @@ class ElementTree:
# @param element An element instance.
def _setroot(self, element):
- assert iselement(element)
+ # assert iselement(element)
self._root = element
##
# Loads an external XML document into this element tree.
#
- # @param source A file name or file object.
- # @param parser An optional parser instance. If not given, the
- # standard {@link XMLTreeBuilder} parser is used.
+ # @param source A file name or file object. If a file object is
+ # given, it only has to implement a <b>read(n)</b> method.
+ # @keyparam parser An optional parser instance. If not given, the
+ # standard {@link XMLParser} parser is used.
# @return The document root element.
# @defreturn Element
+ # @exception ParseError If the parser fails to parse the document.
def parse(self, source, parser=None):
+ close_source = False
if not hasattr(source, "read"):
source = open(source, "rb")
- if not parser:
- parser = XMLTreeBuilder()
- while 1:
- data = source.read(32768)
- if not data:
- break
- parser.feed(data)
- self._root = parser.close()
- return self._root
+ close_source = True
+ try:
+ if not parser:
+ parser = XMLParser(target=TreeBuilder())
+ while 1:
+ data = source.read(65536)
+ if not data:
+ break
+ parser.feed(data)
+ self._root = parser.close()
+ return self._root
+ finally:
+ if close_source:
+ source.close()
##
# Creates a tree iterator for the root element. The iterator loops
@@ -590,23 +690,40 @@ class ElementTree:
# @return An iterator.
# @defreturn iterator
+ def iter(self, tag=None):
+ # assert self._root is not None
+ return self._root.iter(tag)
+
+ # compatibility
def getiterator(self, tag=None):
- assert self._root is not None
- return self._root.getiterator(tag)
+ # Change for a DeprecationWarning in 1.4
+ warnings.warn(
+ "This method will be removed in future versions. "
+ "Use 'tree.iter()' or 'list(tree.iter())' instead.",
+ PendingDeprecationWarning, stacklevel=2
+ )
+ return list(self.iter(tag))
##
# Finds the first toplevel element with given tag.
# Same as getroot().find(path).
#
# @param path What element to look for.
+ # @keyparam namespaces Optional namespace prefix map.
# @return The first matching element, or None if no element was found.
# @defreturn Element or None
- def find(self, path):
- assert self._root is not None
+ def find(self, path, namespaces=None):
+ # assert self._root is not None
if path[:1] == "/":
path = "." + path
- return self._root.find(path)
+ warnings.warn(
+ "This search is broken in 1.3 and earlier, and will be "
+ "fixed in a future version. If you rely on the current "
+ "behaviour, change it to %r" % path,
+ FutureWarning, stacklevel=2
+ )
+ return self._root.find(path, namespaces)
##
# Finds the element text for the first toplevel element with given
@@ -614,153 +731,359 @@ class ElementTree:
#
# @param path What toplevel element to look for.
# @param default What to return if the element was not found.
+ # @keyparam namespaces Optional namespace prefix map.
# @return The text content of the first matching element, or the
# default value no element was found. Note that if the element
- # has is found, but has no text content, this method returns an
+ # is found, but has no text content, this method returns an
# empty string.
# @defreturn string
- def findtext(self, path, default=None):
- assert self._root is not None
+ def findtext(self, path, default=None, namespaces=None):
+ # assert self._root is not None
if path[:1] == "/":
path = "." + path
- return self._root.findtext(path, default)
+ warnings.warn(
+ "This search is broken in 1.3 and earlier, and will be "
+ "fixed in a future version. If you rely on the current "
+ "behaviour, change it to %r" % path,
+ FutureWarning, stacklevel=2
+ )
+ return self._root.findtext(path, default, namespaces)
##
# Finds all toplevel elements with the given tag.
# Same as getroot().findall(path).
#
# @param path What element to look for.
+ # @keyparam namespaces Optional namespace prefix map.
# @return A list or iterator containing all matching elements,
# in document order.
# @defreturn list of Element instances
- def findall(self, path):
- assert self._root is not None
+ def findall(self, path, namespaces=None):
+ # assert self._root is not None
if path[:1] == "/":
path = "." + path
- return self._root.findall(path)
+ warnings.warn(
+ "This search is broken in 1.3 and earlier, and will be "
+ "fixed in a future version. If you rely on the current "
+ "behaviour, change it to %r" % path,
+ FutureWarning, stacklevel=2
+ )
+ return self._root.findall(path, namespaces)
+
+ ##
+ # Finds all matching subelements, by tag name or path.
+ # Same as getroot().iterfind(path).
+ #
+ # @param path What element to look for.
+ # @keyparam namespaces Optional namespace prefix map.
+ # @return An iterator or sequence containing all matching elements,
+ # in document order.
+ # @defreturn a generated sequence of Element instances
+
+ def iterfind(self, path, namespaces=None):
+ # assert self._root is not None
+ if path[:1] == "/":
+ path = "." + path
+ warnings.warn(
+ "This search is broken in 1.3 and earlier, and will be "
+ "fixed in a future version. If you rely on the current "
+ "behaviour, change it to %r" % path,
+ FutureWarning, stacklevel=2
+ )
+ return self._root.iterfind(path, namespaces)
##
# Writes the element tree to a file, as XML.
#
+ # @def write(file, **options)
# @param file A file name, or a file object opened for writing.
- # @param encoding Optional output encoding (default is None)
-
- def write(self, file, encoding=None):
- assert self._root is not None
- if not hasattr(file, "write"):
- if encoding:
- file = open(file, "wb")
+ # @param **options Options, given as keyword arguments.
+ # @keyparam encoding Optional output encoding (default is US-ASCII).
+ # Use "unicode" to return a Unicode string.
+ # @keyparam method Optional output method ("xml", "html", "text" or
+ # "c14n"; default is "xml").
+ # @keyparam xml_declaration Controls if an XML declaration should
+ # be added to the file. Use False for never, True for always,
+ # None for only if not US-ASCII or UTF-8 or Unicode. None is default.
+
+ def write(self, file_or_filename,
+ # keyword arguments
+ encoding=None,
+ xml_declaration=None,
+ default_namespace=None,
+ method=None):
+ # assert self._root is not None
+ if not method:
+ method = "xml"
+ elif method not in _serialize:
+ # FIXME: raise an ImportError for c14n if ElementC14N is missing?
+ raise ValueError("unknown method %r" % method)
+ if not encoding:
+ if method == "c14n":
+ encoding = "utf-8"
else:
- file = open(file, "w")
- if encoding and encoding != "utf-8":
- file.write(_encode("<?xml version='1.0' encoding='%s'?>\n" % encoding, encoding))
- self._write(file, self._root, encoding, {})
-
- def _write(self, file, node, encoding, namespaces):
- # write XML to file
- tag = node.tag
- if tag is Comment:
- file.write(b"<!-- " + _encode_cdata(node.text, encoding) + b" -->")
- elif tag is ProcessingInstruction:
- file.write(b"<?" + _encode_cdata(node.text, encoding) + b"?>")
+ encoding = "us-ascii"
+ elif encoding == str: # lxml.etree compatibility.
+ encoding = "unicode"
else:
- items = list(node.items())
- xmlns_items = [] # new namespaces in this scope
- try:
- if isinstance(tag, QName) or tag[:1] == "{":
- tag, xmlns = fixtag(tag, namespaces)
- if xmlns: xmlns_items.append(xmlns)
- except TypeError:
- _raise_serialization_error(tag)
- file.write(_encode("<" + tag, encoding))
- if items or xmlns_items:
- items.sort() # lexical order
- for k, v in items:
- try:
- if isinstance(k, QName) or k[:1] == "{":
- k, xmlns = fixtag(k, namespaces)
- if xmlns: xmlns_items.append(xmlns)
- except TypeError:
- _raise_serialization_error(k)
- try:
- if isinstance(v, QName):
- v, xmlns = fixtag(v, namespaces)
- if xmlns: xmlns_items.append(xmlns)
- except TypeError:
- _raise_serialization_error(v)
- file.write(_encode(" %s=\"%s\"" % (k, _escape_attrib(v)), encoding))
- for k, v in xmlns_items:
- file.write(_encode(" %s=\"%s\"" % (k, _escape_attrib(v)), encoding))
- if node.text or len(node):
- file.write(_encode(">", encoding))
- if node.text:
- file.write(_encode_cdata(node.text, encoding))
- for n in node:
- self._write(file, n, encoding, namespaces)
- file.write(_encode("</" + tag + ">", encoding))
+ encoding = encoding.lower()
+ if hasattr(file_or_filename, "write"):
+ file = file_or_filename
+ else:
+ if encoding != "unicode":
+ file = open(file_or_filename, "wb")
else:
- file.write(_encode(" />", encoding))
- for k, v in xmlns_items:
- del namespaces[v]
- if node.tail:
- file.write(_encode_cdata(node.tail, encoding))
+ file = open(file_or_filename, "w")
+ if encoding != "unicode":
+ def write(text):
+ try:
+ return file.write(text.encode(encoding,
+ "xmlcharrefreplace"))
+ except (TypeError, AttributeError):
+ _raise_serialization_error(text)
+ else:
+ write = file.write
+ if method == "xml" and (xml_declaration or
+ (xml_declaration is None and
+ encoding not in ("utf-8", "us-ascii", "unicode"))):
+ declared_encoding = encoding
+ if encoding == "unicode":
+ # Retrieve the default encoding for the xml declaration
+ import locale
+ declared_encoding = locale.getpreferredencoding()
+ write("<?xml version='1.0' encoding='%s'?>\n" % declared_encoding)
+ if method == "text":
+ _serialize_text(write, self._root)
+ else:
+ qnames, namespaces = _namespaces(self._root, default_namespace)
+ serialize = _serialize[method]
+ serialize(write, self._root, qnames, namespaces)
+ if file_or_filename is not file:
+ file.close()
-# --------------------------------------------------------------------
-# helpers
+ def write_c14n(self, file):
+ # lxml.etree compatibility. use output method instead
+ return self.write(file, method="c14n")
-##
-# Checks if an object appears to be a valid element object.
-#
-# @param An element instance.
-# @return A true value if this is an element object.
-# @defreturn flag
+# --------------------------------------------------------------------
+# serialization support
-def iselement(element):
- # FIXME: not sure about this; might be a better idea to look
- # for tag/attrib/text attributes
- return isinstance(element, _ElementInterface) or hasattr(element, "tag")
+def _namespaces(elem, default_namespace=None):
+ # identify namespaces used in this tree
-##
-# Writes an element tree or element structure to sys.stdout. This
-# function should be used for debugging only.
-# <p>
-# The exact output format is implementation dependent. In this
-# version, it's written as an ordinary XML file.
-#
-# @param elem An element tree or an individual element.
+ # maps qnames to *encoded* prefix:local names
+ qnames = {None: None}
-def dump(elem):
- # debugging
- if not isinstance(elem, ElementTree):
- elem = ElementTree(elem)
- elem.write(sys.stdout)
- tail = elem.getroot().tail
- if not tail or tail[-1] != "\n":
- sys.stdout.write("\n")
+ # maps uri:s to prefixes
+ namespaces = {}
+ if default_namespace:
+ namespaces[default_namespace] = ""
-def _encode(s, encoding):
- if encoding:
- return s.encode(encoding)
+ def add_qname(qname):
+ # calculate serialized qname representation
+ try:
+ if qname[:1] == "{":
+ uri, tag = qname[1:].rsplit("}", 1)
+ prefix = namespaces.get(uri)
+ if prefix is None:
+ prefix = _namespace_map.get(uri)
+ if prefix is None:
+ prefix = "ns%d" % len(namespaces)
+ if prefix != "xml":
+ namespaces[uri] = prefix
+ if prefix:
+ qnames[qname] = "%s:%s" % (prefix, tag)
+ else:
+ qnames[qname] = tag # default element
+ else:
+ if default_namespace:
+ # FIXME: can this be handled in XML 1.0?
+ raise ValueError(
+ "cannot use non-qualified names with "
+ "default_namespace option"
+ )
+ qnames[qname] = qname
+ except TypeError:
+ _raise_serialization_error(qname)
+
+ # populate qname and namespaces table
+ try:
+ iterate = elem.iter
+ except AttributeError:
+ iterate = elem.getiterator # cET compatibility
+ for elem in iterate():
+ tag = elem.tag
+ if isinstance(tag, QName):
+ if tag.text not in qnames:
+ add_qname(tag.text)
+ elif isinstance(tag, str):
+ if tag not in qnames:
+ add_qname(tag)
+ elif tag is not None and tag is not Comment and tag is not PI:
+ _raise_serialization_error(tag)
+ for key, value in elem.items():
+ if isinstance(key, QName):
+ key = key.text
+ if key not in qnames:
+ add_qname(key)
+ if isinstance(value, QName) and value.text not in qnames:
+ add_qname(value.text)
+ text = elem.text
+ if isinstance(text, QName) and text.text not in qnames:
+ add_qname(text.text)
+ return qnames, namespaces
+
+def _serialize_xml(write, elem, qnames, namespaces):
+ tag = elem.tag
+ text = elem.text
+ if tag is Comment:
+ write("<!--%s-->" % text)
+ elif tag is ProcessingInstruction:
+ write("<?%s?>" % text)
else:
- return s
-
-_escape = re.compile(r"[&<>\"\u0080-\uffff]+")
-
-_escape_map = {
- "&": "&amp;",
- "<": "&lt;",
- ">": "&gt;",
- '"': "&quot;",
+ tag = qnames[tag]
+ if tag is None:
+ if text:
+ write(_escape_cdata(text))
+ for e in elem:
+ _serialize_xml(write, e, qnames, None)
+ else:
+ write("<" + tag)
+ items = list(elem.items())
+ if items or namespaces:
+ if namespaces:
+ for v, k in sorted(namespaces.items(),
+ key=lambda x: x[1]): # sort on prefix
+ if k:
+ k = ":" + k
+ write(" xmlns%s=\"%s\"" % (
+ k,
+ _escape_attrib(v)
+ ))
+ for k, v in sorted(items): # lexical order
+ if isinstance(k, QName):
+ k = k.text
+ if isinstance(v, QName):
+ v = qnames[v.text]
+ else:
+ v = _escape_attrib(v)
+ write(" %s=\"%s\"" % (qnames[k], v))
+ if text or len(elem):
+ write(">")
+ if text:
+ write(_escape_cdata(text))
+ for e in elem:
+ _serialize_xml(write, e, qnames, None)
+ write("</" + tag + ">")
+ else:
+ write(" />")
+ if elem.tail:
+ write(_escape_cdata(elem.tail))
+
+HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr",
+ "img", "input", "isindex", "link", "meta" "param")
+
+try:
+ HTML_EMPTY = set(HTML_EMPTY)
+except NameError:
+ pass
+
+def _serialize_html(write, elem, qnames, namespaces):
+ tag = elem.tag
+ text = elem.text
+ if tag is Comment:
+ write("<!--%s-->" % _escape_cdata(text))
+ elif tag is ProcessingInstruction:
+ write("<?%s?>" % _escape_cdata(text))
+ else:
+ tag = qnames[tag]
+ if tag is None:
+ if text:
+ write(_escape_cdata(text))
+ for e in elem:
+ _serialize_html(write, e, qnames, None)
+ else:
+ write("<" + tag)
+ items = list(elem.items())
+ if items or namespaces:
+ if namespaces:
+ for v, k in sorted(namespaces.items(),
+ key=lambda x: x[1]): # sort on prefix
+ if k:
+ k = ":" + k
+ write(" xmlns%s=\"%s\"" % (
+ k,
+ _escape_attrib(v)
+ ))
+ for k, v in sorted(items): # lexical order
+ if isinstance(k, QName):
+ k = k.text
+ if isinstance(v, QName):
+ v = qnames[v.text]
+ else:
+ v = _escape_attrib_html(v)
+ # FIXME: handle boolean attributes
+ write(" %s=\"%s\"" % (qnames[k], v))
+ write(">")
+ tag = tag.lower()
+ if text:
+ if tag == "script" or tag == "style":
+ write(text)
+ else:
+ write(_escape_cdata(text))
+ for e in elem:
+ _serialize_html(write, e, qnames, None)
+ if tag not in HTML_EMPTY:
+ write("</" + tag + ">")
+ if elem.tail:
+ write(_escape_cdata(elem.tail))
+
+def _serialize_text(write, elem):
+ for part in elem.itertext():
+ write(part)
+ if elem.tail:
+ write(elem.tail)
+
+_serialize = {
+ "xml": _serialize_xml,
+ "html": _serialize_html,
+ "text": _serialize_text,
+# this optional method is imported at the end of the module
+# "c14n": _serialize_c14n,
}
+##
+# Registers a namespace prefix. The registry is global, and any
+# existing mapping for either the given prefix or the namespace URI
+# will be removed.
+#
+# @param prefix Namespace prefix.
+# @param uri Namespace uri. Tags and attributes in this namespace
+# will be serialized with the given prefix, if at all possible.
+# @exception ValueError If the prefix is reserved, or is otherwise
+# invalid.
+
+def register_namespace(prefix, uri):
+ if re.match("ns\d+$", prefix):
+ raise ValueError("Prefix format reserved for internal use")
+ for k, v in list(_namespace_map.items()):
+ if k == uri or v == prefix:
+ del _namespace_map[k]
+ _namespace_map[uri] = prefix
+
_namespace_map = {
# "well-known" namespace prefixes
"http://www.w3.org/XML/1998/namespace": "xml",
"http://www.w3.org/1999/xhtml": "html",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
"http://schemas.xmlsoap.org/wsdl/": "wsdl",
+ # xml schema
+ "http://www.w3.org/2001/XMLSchema": "xs",
+ "http://www.w3.org/2001/XMLSchema-instance": "xsi",
+ # dublin core
+ "http://purl.org/dc/elements/1.1/": "dc",
}
def _raise_serialization_error(text):
@@ -768,77 +1091,131 @@ def _raise_serialization_error(text):
"cannot serialize %r (type %s)" % (text, type(text).__name__)
)
-def _encode_entity(text, pattern=_escape):
- # map reserved and non-ascii characters to numerical entities
- def escape_entities(m, map=_escape_map):
- out = []
- append = out.append
- for char in m.group():
- text = map.get(char)
- if text is None:
- text = "&#%d;" % ord(char)
- append(text)
- return "".join(out)
+def _escape_cdata(text):
+ # escape character data
try:
- return _encode(pattern.sub(escape_entities, text), "ascii")
- except TypeError:
+ # it's worth avoiding do-nothing calls for strings that are
+ # shorter than 500 character, or so. assume that's, by far,
+ # the most common case in most applications.
+ if "&" in text:
+ text = text.replace("&", "&amp;")
+ if "<" in text:
+ text = text.replace("<", "&lt;")
+ if ">" in text:
+ text = text.replace(">", "&gt;")
+ return text
+ except (TypeError, AttributeError):
_raise_serialization_error(text)
-#
-# the following functions assume an ascii-compatible encoding
-# (or "utf-16")
-
-def _encode_cdata(text, encoding):
- # escape character data
+def _escape_attrib(text):
+ # escape attribute value
try:
- text = text.replace("&", "&amp;")
- text = text.replace("<", "&lt;")
- text = text.replace(">", "&gt;")
- if encoding:
- return text.encode(encoding, "xmlcharrefreplace")
- else:
- return text
+ if "&" in text:
+ text = text.replace("&", "&amp;")
+ if "<" in text:
+ text = text.replace("<", "&lt;")
+ if ">" in text:
+ text = text.replace(">", "&gt;")
+ if "\"" in text:
+ text = text.replace("\"", "&quot;")
+ if "\n" in text:
+ text = text.replace("\n", "&#10;")
+ return text
except (TypeError, AttributeError):
_raise_serialization_error(text)
-def _escape_attrib(text):
+def _escape_attrib_html(text):
# escape attribute value
try:
- text = text.replace("&", "&amp;")
- text = text.replace("'", "&apos;") # FIXME: overkill
- text = text.replace("\"", "&quot;")
- text = text.replace("<", "&lt;")
- text = text.replace(">", "&gt;")
+ if "&" in text:
+ text = text.replace("&", "&amp;")
+ if ">" in text:
+ text = text.replace(">", "&gt;")
+ if "\"" in text:
+ text = text.replace("\"", "&quot;")
return text
except (TypeError, AttributeError):
_raise_serialization_error(text)
-def fixtag(tag, namespaces):
- # given a decorated tag (of the form {uri}tag), return prefixed
- # tag and namespace declaration, if any
- if isinstance(tag, QName):
- tag = tag.text
- namespace_uri, tag = tag[1:].split("}", 1)
- prefix = namespaces.get(namespace_uri)
- if prefix is None:
- prefix = _namespace_map.get(namespace_uri)
- if prefix is None:
- prefix = "ns%d" % len(namespaces)
- namespaces[namespace_uri] = prefix
- if prefix == "xml":
- xmlns = None
- else:
- xmlns = ("xmlns:%s" % prefix, namespace_uri)
+# --------------------------------------------------------------------
+
+##
+# Generates a string representation of an XML element, including all
+# subelements. If encoding is "unicode", the return type is a string;
+# otherwise it is a bytes array.
+#
+# @param element An Element instance.
+# @keyparam encoding Optional output encoding (default is US-ASCII).
+# Use "unicode" to return a Unicode string.
+# @keyparam method Optional output method ("xml", "html", "text" or
+# "c14n"; default is "xml").
+# @return An (optionally) encoded string containing the XML data.
+# @defreturn string
+
+def tostring(element, encoding=None, method=None):
+ class dummy:
+ pass
+ data = []
+ file = dummy()
+ file.write = data.append
+ ElementTree(element).write(file, encoding, method=method)
+ if encoding in (str, "unicode"):
+ return "".join(data)
else:
- xmlns = None
- return "%s:%s" % (prefix, tag), xmlns
+ return b"".join(data)
+
+##
+# Generates a string representation of an XML element, including all
+# subelements. If encoding is False, the string is returned as a
+# sequence of string fragments; otherwise it is a sequence of
+# bytestrings.
+#
+# @param element An Element instance.
+# @keyparam encoding Optional output encoding (default is US-ASCII).
+# Use "unicode" to return a Unicode string.
+# @keyparam method Optional output method ("xml", "html", "text" or
+# "c14n"; default is "xml").
+# @return A sequence object containing the XML data.
+# @defreturn sequence
+# @since 1.3
+
+def tostringlist(element, encoding=None, method=None):
+ class dummy:
+ pass
+ data = []
+ file = dummy()
+ file.write = data.append
+ ElementTree(element).write(file, encoding, method=method)
+ # FIXME: merge small fragments into larger parts
+ return data
+
+##
+# Writes an element tree or element structure to sys.stdout. This
+# function should be used for debugging only.
+# <p>
+# The exact output format is implementation dependent. In this
+# version, it's written as an ordinary XML file.
+#
+# @param elem An element tree or an individual element.
+
+def dump(elem):
+ # debugging
+ if not isinstance(elem, ElementTree):
+ elem = ElementTree(elem)
+ elem.write(sys.stdout, encoding="unicode")
+ tail = elem.getroot().tail
+ if not tail or tail[-1] != "\n":
+ sys.stdout.write("\n")
+
+# --------------------------------------------------------------------
+# parsing
##
# Parses an XML document into an element tree.
#
# @param source A filename or file object containing XML data.
# @param parser An optional parser instance. If not given, the
-# standard {@link XMLTreeBuilder} parser is used.
+# standard {@link XMLParser} parser is used.
# @return An ElementTree instance
def parse(source, parser=None):
@@ -853,18 +1230,28 @@ def parse(source, parser=None):
# @param source A filename or file object containing XML data.
# @param events A list of events to report back. If omitted, only "end"
# events are reported.
+# @param parser An optional parser instance. If not given, the
+# standard {@link XMLParser} parser is used.
# @return A (event, elem) iterator.
-class iterparse:
+def iterparse(source, events=None, parser=None):
+ close_source = False
+ if not hasattr(source, "read"):
+ source = open(source, "rb")
+ close_source = True
+ if not parser:
+ parser = XMLParser(target=TreeBuilder())
+ return _IterParseIterator(source, events, parser, close_source)
- def __init__(self, source, events=None):
- if not hasattr(source, "read"):
- source = open(source, "rb")
+class _IterParseIterator:
+
+ def __init__(self, source, events, parser, close_source=False):
self._file = source
+ self._close_file = close_source
self._events = []
self._index = 0
self.root = self._root = None
- self._parser = XMLTreeBuilder()
+ self._parser = parser
# wire up the parser for event reporting
parser = self._parser._parser
append = self._events.append
@@ -891,16 +1278,14 @@ class iterparse:
parser.EndElementHandler = handler
elif event == "start-ns":
def handler(prefix, uri, event=event, append=append):
- try:
- uri = _encode(uri, "ascii")
- except UnicodeError:
- pass
- append((event, (prefix or "", uri)))
+ append((event, (prefix or "", uri or "")))
parser.StartNamespaceDeclHandler = handler
elif event == "end-ns":
def handler(prefix, event=event, append=append):
append((event, None))
parser.EndNamespaceDeclHandler = handler
+ else:
+ raise ValueError("unknown event %r" % event)
def __next__(self):
while 1:
@@ -909,10 +1294,9 @@ class iterparse:
except IndexError:
if self._parser is None:
self.root = self._root
- try:
- raise StopIteration
- except NameError:
- raise IndexError
+ if self._close_file:
+ self._file.close()
+ raise StopIteration
# load event buffer
del self._events[:]
self._index = 0
@@ -926,24 +1310,22 @@ class iterparse:
self._index = self._index + 1
return item
- try:
- iter
- def __iter__(self):
- return self
- except NameError:
- def __getitem__(self, index):
- return self.__next__()
+ def __iter__(self):
+ return self
##
# Parses an XML document from a string constant. This function can
# be used to embed "XML literals" in Python code.
#
# @param source A string containing XML data.
+# @param parser An optional parser instance. If not given, the
+# standard {@link XMLParser} parser is used.
# @return An Element instance.
# @defreturn Element
-def XML(text):
- parser = XMLTreeBuilder()
+def XML(text, parser=None):
+ if not parser:
+ parser = XMLParser(target=TreeBuilder())
parser.feed(text)
return parser.close()
@@ -952,15 +1334,18 @@ def XML(text):
# a dictionary which maps from element id:s to elements.
#
# @param source A string containing XML data.
+# @param parser An optional parser instance. If not given, the
+# standard {@link XMLParser} parser is used.
# @return A tuple containing an Element instance and a dictionary.
# @defreturn (Element, dictionary)
-def XMLID(text):
- parser = XMLTreeBuilder()
+def XMLID(text, parser=None):
+ if not parser:
+ parser = XMLParser(target=TreeBuilder())
parser.feed(text)
tree = parser.close()
ids = {}
- for elem in tree.getiterator():
+ for elem in tree.iter():
id = elem.get("id")
if id:
ids[id] = elem
@@ -977,25 +1362,23 @@ def XMLID(text):
fromstring = XML
##
-# Generates a string representation of an XML element, including all
-# subelements. If encoding is None, the return type is a string;
-# otherwise it is a bytes array.
+# Parses an XML document from a sequence of string fragments.
#
-# @param element An Element instance.
-# @return An (optionally) encoded string containing the XML data.
-# @defreturn string
+# @param sequence A list or other sequence containing XML data fragments.
+# @param parser An optional parser instance. If not given, the
+# standard {@link XMLParser} parser is used.
+# @return An Element instance.
+# @defreturn Element
+# @since 1.3
-def tostring(element, encoding=None):
- class dummy:
- pass
- data = []
- file = dummy()
- file.write = data.append
- ElementTree(element).write(file, encoding)
- if encoding:
- return b"".join(data)
- else:
- return "".join(data)
+def fromstringlist(sequence, parser=None):
+ if not parser:
+ parser = XMLParser(target=TreeBuilder())
+ for text in sequence:
+ parser.feed(text)
+ return parser.close()
+
+# --------------------------------------------------------------------
##
# Generic element structure builder. This builder converts a sequence
@@ -1016,11 +1399,11 @@ class TreeBuilder:
self._last = None # last element
self._tail = None # true if we're after an end tag
if element_factory is None:
- element_factory = _ElementInterface
+ element_factory = Element
self._factory = element_factory
##
- # Flushes the parser buffers, and returns the toplevel documen
+ # Flushes the builder buffers, and returns the toplevel document
# element.
#
# @return An Element instance.
@@ -1028,7 +1411,7 @@ class TreeBuilder:
def close(self):
assert len(self._elem) == 0, "missing end tags"
- assert self._last != None, "missing toplevel element"
+ assert self._last is not None, "missing toplevel element"
return self._last
def _flush(self):
@@ -1093,28 +1476,39 @@ class TreeBuilder:
# instance of the standard {@link #TreeBuilder} class.
# @keyparam html Predefine HTML entities. This flag is not supported
# by the current implementation.
+# @keyparam encoding Optional encoding. If given, the value overrides
+# the encoding specified in the XML file.
# @see #ElementTree
# @see #TreeBuilder
-class XMLTreeBuilder:
+class XMLParser:
- def __init__(self, html=0, target=None):
+ def __init__(self, html=0, target=None, encoding=None):
try:
from xml.parsers import expat
except ImportError:
- raise ImportError(
- "No module named expat; use SimpleXMLTreeBuilder instead"
- )
- self._parser = parser = expat.ParserCreate(None, "}")
+ try:
+ import pyexpat as expat
+ except ImportError:
+ raise ImportError(
+ "No module named expat; use SimpleXMLTreeBuilder instead"
+ )
+ parser = expat.ParserCreate(encoding, "}")
if target is None:
target = TreeBuilder()
- self._target = target
+ # underscored names are provided for compatibility only
+ self.parser = self._parser = parser
+ self.target = self._target = target
+ self._error = expat.error
self._names = {} # name memo cache
# callbacks
parser.DefaultHandlerExpand = self._default
parser.StartElementHandler = self._start
parser.EndElementHandler = self._end
parser.CharacterDataHandler = self._data
+ # optional callbacks
+ parser.CommentHandler = self._comment
+ parser.ProcessingInstructionHandler = self._pi
# let expat do the buffering, if supported
try:
self._parser.buffer_text = 1
@@ -1127,10 +1521,18 @@ class XMLTreeBuilder:
parser.StartElementHandler = self._start_list
except AttributeError:
pass
- encoding = "utf-8"
- # target.xml(encoding, None)
self._doctype = None
self.entity = {}
+ try:
+ self.version = "Expat %d.%d.%d" % expat.version_info
+ except AttributeError:
+ pass # unknown
+
+ def _raiseerror(self, value):
+ err = ParseError(value)
+ err.code = value.code
+ err.position = value.lineno, value.offset
+ raise err
def _fixname(self, key):
# expand qname, and convert name string to ascii, if possible
@@ -1149,7 +1551,7 @@ class XMLTreeBuilder:
attrib = {}
for key, value in attrib_in.items():
attrib[fixname(key)] = value
- return self._target.start(tag, attrib)
+ return self.target.start(tag, attrib)
def _start_list(self, tag, attrib_in):
fixname = self._fixname
@@ -1158,27 +1560,47 @@ class XMLTreeBuilder:
if attrib_in:
for i in range(0, len(attrib_in), 2):
attrib[fixname(attrib_in[i])] = attrib_in[i+1]
- return self._target.start(tag, attrib)
+ return self.target.start(tag, attrib)
def _data(self, text):
- return self._target.data(text)
+ return self.target.data(text)
def _end(self, tag):
- return self._target.end(self._fixname(tag))
+ return self.target.end(self._fixname(tag))
+
+ def _comment(self, data):
+ try:
+ comment = self.target.comment
+ except AttributeError:
+ pass
+ else:
+ return comment(data)
+
+ def _pi(self, target, data):
+ try:
+ pi = self.target.pi
+ except AttributeError:
+ pass
+ else:
+ return pi(target, data)
def _default(self, text):
prefix = text[:1]
if prefix == "&":
# deal with undefined entities
try:
- self._target.data(self.entity[text[1:-1]])
+ self.target.data(self.entity[text[1:-1]])
except KeyError:
from xml.parsers import expat
- raise expat.error(
+ err = expat.error(
"undefined entity %s: line %d, column %d" %
(text, self._parser.ErrorLineNumber,
self._parser.ErrorColumnNumber)
)
+ err.code = 11 # XML_ERROR_UNDEFINED_ENTITY
+ err.lineno = self._parser.ErrorLineNumber
+ err.offset = self._parser.ErrorColumnNumber
+ raise err
elif prefix == "<" and text[:9] == "<!DOCTYPE":
self._doctype = [] # inside a doctype declaration
elif self._doctype is not None:
@@ -1202,18 +1624,31 @@ class XMLTreeBuilder:
return
if pubid:
pubid = pubid[1:-1]
- self.doctype(name, pubid, system[1:-1])
+ if hasattr(self.target, "doctype"):
+ self.target.doctype(name, pubid, system[1:-1])
+ elif self.doctype is not self._XMLParser__doctype:
+ # warn about deprecated call
+ self._XMLParser__doctype(name, pubid, system[1:-1])
+ self.doctype(name, pubid, system[1:-1])
self._doctype = None
##
- # Handles a doctype declaration.
+ # (Deprecated) Handles a doctype declaration.
#
# @param name Doctype name.
# @param pubid Public identifier.
# @param system System identifier.
def doctype(self, name, pubid, system):
- pass
+ """This method of XMLParser is deprecated."""
+ warnings.warn(
+ "This method of XMLParser is deprecated. Define doctype() "
+ "method on the TreeBuilder target.",
+ DeprecationWarning,
+ )
+
+ # sentinel, if doctype is redefined in a subclass
+ __doctype = doctype
##
# Feeds data to the parser.
@@ -1221,7 +1656,10 @@ class XMLTreeBuilder:
# @param data Encoded data.
def feed(self, data):
- self._parser.Parse(data, 0)
+ try:
+ self._parser.Parse(data, 0)
+ except self._error as v:
+ self._raiseerror(v)
##
# Finishes feeding data to the parser.
@@ -1230,10 +1668,20 @@ class XMLTreeBuilder:
# @defreturn Element
def close(self):
- self._parser.Parse("", 1) # end of data
- tree = self._target.close()
- del self._target, self._parser # get rid of circular references
+ try:
+ self._parser.Parse("", 1) # end of data
+ except self._error as v:
+ self._raiseerror(v)
+ tree = self.target.close()
+ del self.target, self._parser # get rid of circular references
return tree
# compatibility
-XMLParser = XMLTreeBuilder
+XMLTreeBuilder = XMLParser
+
+# workaround circular import.
+try:
+ from ElementC14N import _serialize_c14n
+ _serialize["c14n"] = _serialize_c14n
+except ImportError:
+ pass
diff --git a/Lib/xml/etree/__init__.py b/Lib/xml/etree/__init__.py
index 3dd2c929e8..27fd8f6d4e 100644
--- a/Lib/xml/etree/__init__.py
+++ b/Lib/xml/etree/__init__.py
@@ -1,10 +1,10 @@
-# $Id: __init__.py 1821 2004-06-03 16:57:49Z fredrik $
+# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
-# Copyright (c) 1999-2004 by Fredrik Lundh
+# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
@@ -30,4 +30,4 @@
# --------------------------------------------------------------------
# Licensed to PSF under a Contributor Agreement.
-# See http://www.python.org/2.4/license for licensing details.
+# See http://www.python.org/psf/license for licensing details.
diff --git a/Lib/xml/parsers/expat.py b/Lib/xml/parsers/expat.py
index 11359a0b27..a805b828d8 100644
--- a/Lib/xml/parsers/expat.py
+++ b/Lib/xml/parsers/expat.py
@@ -1,4 +1,10 @@
"""Interface to the Expat non-validating XML parser."""
__version__ = '$Revision$'
+import sys
+
from pyexpat import *
+
+# provide pyexpat submodules as xml.parsers.expat submodules
+sys.modules['xml.parsers.expat.model'] = model
+sys.modules['xml.parsers.expat.errors'] = errors
diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py
index c9fc894cb0..a227cdab57 100644
--- a/Lib/xml/sax/expatreader.py
+++ b/Lib/xml/sax/expatreader.py
@@ -219,6 +219,9 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
self._parsing = 0
# break cycle created by expat handlers pointing to our methods
self._parser = None
+ bs = self._source.getByteStream()
+ if bs is not None:
+ bs.close()
def _reset_cont_handler(self):
self._parser.ProcessingInstructionHandler = \
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py
index b05e8150a6..625bc122ac 100644
--- a/Lib/xml/sax/saxutils.py
+++ b/Lib/xml/sax/saxutils.py
@@ -78,7 +78,7 @@ def quoteattr(data, entities={}):
class XMLGenerator(handler.ContentHandler):
- def __init__(self, out=None, encoding="iso-8859-1"):
+ def __init__(self, out=None, encoding="iso-8859-1", short_empty_elements=False):
if out is None:
import sys
out = sys.stdout
@@ -88,6 +88,8 @@ class XMLGenerator(handler.ContentHandler):
self._current_context = self._ns_contexts[-1]
self._undeclared_ns_maps = []
self._encoding = encoding
+ self._short_empty_elements = short_empty_elements
+ self._pending_start_element = False
def _write(self, text):
if isinstance(text, str):
@@ -112,6 +114,11 @@ class XMLGenerator(handler.ContentHandler):
# Return the unqualified name
return name[1]
+ def _finish_pending_start_element(self,endElement=False):
+ if self._pending_start_element:
+ self._write('>')
+ self._pending_start_element = False
+
# ContentHandler methods
def startDocument(self):
@@ -128,15 +135,24 @@ class XMLGenerator(handler.ContentHandler):
del self._ns_contexts[-1]
def startElement(self, name, attrs):
+ self._finish_pending_start_element()
self._write('<' + name)
for (name, value) in attrs.items():
self._write(' %s=%s' % (name, quoteattr(value)))
- self._write('>')
+ if self._short_empty_elements:
+ self._pending_start_element = True
+ else:
+ self._write(">")
def endElement(self, name):
- self._write('</%s>' % name)
+ if self._pending_start_element:
+ self._write('/>')
+ self._pending_start_element = False
+ else:
+ self._write('</%s>' % name)
def startElementNS(self, name, qname, attrs):
+ self._finish_pending_start_element()
self._write('<' + self._qname(name))
for prefix, uri in self._undeclared_ns_maps:
@@ -148,18 +164,30 @@ class XMLGenerator(handler.ContentHandler):
for (name, value) in attrs.items():
self._write(' %s=%s' % (self._qname(name), quoteattr(value)))
- self._write('>')
+ if self._short_empty_elements:
+ self._pending_start_element = True
+ else:
+ self._write(">")
def endElementNS(self, name, qname):
- self._write('</%s>' % self._qname(name))
+ if self._pending_start_element:
+ self._write('/>')
+ self._pending_start_element = False
+ else:
+ self._write('</%s>' % self._qname(name))
def characters(self, content):
- self._write(escape(content))
+ if content:
+ self._finish_pending_start_element()
+ self._write(escape(content))
def ignorableWhitespace(self, content):
- self._write(content)
+ if content:
+ self._finish_pending_start_element()
+ self._write(content)
def processingInstruction(self, target, data):
+ self._finish_pending_start_element()
self._write('<?%s %s?>' % (target, data))
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py
index 9357ac33e2..19d4d6986f 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -136,6 +136,13 @@ Exported functions:
import re, time, operator
import http.client
from xml.parsers import expat
+import socket
+import errno
+from io import BytesIO
+try:
+ import gzip
+except ImportError:
+ gzip = None #python can be built without zlib/gzip support
# --------------------------------------------------------------------
# Internal stuff
@@ -145,24 +152,11 @@ try:
except ImportError:
datetime = None
-def _decode(data, encoding, is8bit=re.compile("[\x80-\xff]").search):
- # decode non-ascii string (if possible)
- if encoding and is8bit(data):
- data = str(data, encoding)
- return data
-
def escape(s):
s = s.replace("&", "&amp;")
s = s.replace("<", "&lt;")
return s.replace(">", "&gt;",)
-def _stringify(string):
- # convert to 7-bit ascii if possible
- try:
- return string.decode("ascii")
- except (UnicodeError, TypeError, AttributeError):
- return string
-
__version__ = "1.0.1"
# xmlrpc integer limits
@@ -748,8 +742,8 @@ class Unmarshaller:
def end_string(self, data):
if self._encoding:
- data = _decode(data, self._encoding)
- self.append(_stringify(data))
+ data = data.decode(self._encoding)
+ self.append(data)
self._value = 0
dispatch["string"] = end_string
dispatch["name"] = end_string # struct keys are always strings
@@ -767,7 +761,7 @@ class Unmarshaller:
dict = {}
items = self._stack[mark:]
for i in range(0, len(items), 2):
- dict[_stringify(items[i])] = items[i+1]
+ dict[items[i]] = items[i+1]
self._stack[mark:] = [dict]
self._value = 0
dispatch["struct"] = end_struct
@@ -804,7 +798,7 @@ class Unmarshaller:
def end_methodName(self, data):
if self._encoding:
- data = _decode(data, self._encoding)
+ data = data.decode(self._encoding)
self._methodname = data
self._type = "methodName" # no params
dispatch["methodName"] = end_methodName
@@ -1013,6 +1007,78 @@ def loads(data, use_datetime=False):
p.close()
return u.close(), u.getmethodname()
+##
+# Encode a string using the gzip content encoding such as specified by the
+# Content-Encoding: gzip
+# in the HTTP header, as described in RFC 1952
+#
+# @param data the unencoded data
+# @return the encoded data
+
+def gzip_encode(data):
+ """data -> gzip encoded data
+
+ Encode data using the gzip content encoding as described in RFC 1952
+ """
+ if not gzip:
+ raise NotImplementedError
+ f = BytesIO()
+ gzf = gzip.GzipFile(mode="wb", fileobj=f, compresslevel=1)
+ gzf.write(data)
+ gzf.close()
+ encoded = f.getvalue()
+ f.close()
+ return encoded
+
+##
+# Decode a string using the gzip content encoding such as specified by the
+# Content-Encoding: gzip
+# in the HTTP header, as described in RFC 1952
+#
+# @param data The encoded data
+# @return the unencoded data
+# @raises ValueError if data is not correctly coded.
+
+def gzip_decode(data):
+ """gzip encoded data -> unencoded data
+
+ Decode data using the gzip content encoding as described in RFC 1952
+ """
+ if not gzip:
+ raise NotImplementedError
+ f = BytesIO(data)
+ gzf = gzip.GzipFile(mode="rb", fileobj=f)
+ try:
+ decoded = gzf.read()
+ except IOError:
+ raise ValueError("invalid data")
+ f.close()
+ gzf.close()
+ return decoded
+
+##
+# Return a decoded file-like object for the gzip encoding
+# as described in RFC 1952.
+#
+# @param response A stream supporting a read() method
+# @return a file-like object that the decoded data can be read() from
+
+class GzipDecodedResponse(gzip.GzipFile if gzip else object):
+ """a file-like object to decode a response encoded with the gzip
+ method, as described in RFC 1952.
+ """
+ def __init__(self, response):
+ #response doesn't support tell() and read(), required by
+ #GzipFile
+ if not gzip:
+ raise NotImplementedError
+ self.io = BytesIO(response.read())
+ gzip.GzipFile.__init__(self, mode="rb", fileobj=self.io)
+
+ def close(self):
+ gzip.GzipFile.close(self)
+ self.io.close()
+
# --------------------------------------------------------------------
# request dispatcher
@@ -1040,11 +1106,22 @@ class Transport:
# client identifier (may be overridden)
user_agent = "xmlrpclib.py/%s (by www.pythonware.com)" % __version__
+ #if true, we'll request gzip encoding
+ accept_gzip_encoding = True
+
+ # if positive, encode request using gzip if it exceeds this threshold
+ # note that many server will get confused, so only use it if you know
+ # that they can decode such a request
+ encode_threshold = None #None = don't encode
+
def __init__(self, use_datetime=False):
self._use_datetime = use_datetime
+ self._connection = (None, None)
+ self._extra_headers = []
##
# Send a complete request, and parse the response.
+ # Retry request if a cached connection has disconnected.
#
# @param host Target host.
# @param handler Target PRC handler.
@@ -1053,21 +1130,44 @@ class Transport:
# @return Parsed response.
def request(self, host, handler, request_body, verbose=False):
+ #retry request once if cached connection has gone cold
+ for i in (0, 1):
+ try:
+ return self.single_request(host, handler, request_body, verbose)
+ except socket.error as e:
+ if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED, errno.EPIPE):
+ raise
+ except http.client.BadStatusLine: #close after we sent request
+ if i:
+ raise
+
+ def single_request(self, host, handler, request_body, verbose=False):
# issue XML-RPC request
+ try:
+ http_conn = self.send_request(host, handler, request_body, verbose)
+ resp = http_conn.getresponse()
+ if resp.status == 200:
+ self.verbose = verbose
+ return self.parse_response(resp)
+
+ except Fault:
+ raise
+ except Exception:
+ #All unexpected errors leave connection in
+ # a strange state, so we clear it.
+ self.close()
+ raise
+
+ #We got an error response.
+ #Discard any response data and raise exception
+ if resp.getheader("content-length", ""):
+ resp.read()
+ raise ProtocolError(
+ host + handler,
+ resp.status, resp.reason,
+ dict(resp.getheaders())
+ )
- http_conn = self.send_request(host, handler, request_body, verbose)
- resp = http_conn.getresponse()
-
- if resp.status != 200:
- raise ProtocolError(
- host + handler,
- resp.status, resp.reason,
- dict(resp.getheaders())
- )
-
- self.verbose = verbose
-
- return self.parse_response(resp)
##
# Create parser.
@@ -1106,7 +1206,7 @@ class Transport:
("Authorization", "Basic " + auth)
]
else:
- extra_headers = None
+ extra_headers = []
return host, extra_headers, x509
@@ -1117,9 +1217,23 @@ class Transport:
# @return An HTTPConnection object
def make_connection(self, host):
+ #return an existing connection if possible. This allows
+ #HTTP/1.1 keep-alive.
+ if self._connection and host == self._connection[0]:
+ return self._connection[1]
# create a HTTP connection object from a host descriptor
- host, extra_headers, x509 = self.get_host_info(host)
+ chost, self._extra_headers, x509 = self.get_host_info(host)
+ self._connection = host, http.client.HTTPConnection(chost)
+ return self._connection[1]
+ ##
+ # Clear any cached connection object.
+ # Used in the event of socket errors.
+ #
+ def close(self):
+ if self._connection[1]:
+ self._connection[1].close()
+ self._connection = (None, None)
##
# Send HTTP request.
@@ -1131,39 +1245,79 @@ class Transport:
# @return An HTTPConnection.
def send_request(self, host, handler, request_body, debug):
- host, extra_headers, x509 = self.get_host_info(host)
- connection = http.client.HTTPConnection(host)
+ connection = self.make_connection(host)
+ headers = self._extra_headers[:]
if debug:
connection.set_debuglevel(1)
- headers = {}
- if extra_headers:
- for key, val in extra_headers:
- headers[key] = val
- headers["Content-Type"] = "text/xml"
- headers["User-Agent"] = self.user_agent
- connection.request("POST", handler, request_body, headers)
+ if self.accept_gzip_encoding and gzip:
+ connection.putrequest("POST", handler, skip_accept_encoding=True)
+ headers.append(("Accept-Encoding", "gzip"))
+ else:
+ connection.putrequest("POST", handler)
+ headers.append(("Content-Type", "text/xml"))
+ headers.append(("User-Agent", self.user_agent))
+ self.send_headers(connection, headers)
+ self.send_content(connection, request_body)
return connection
##
+ # Send request headers.
+ # This function provides a useful hook for subclassing
+ #
+ # @param connection httpConnection.
+ # @param headers list of key,value pairs for HTTP headers
+
+ def send_headers(self, connection, headers):
+ for key, val in headers:
+ connection.putheader(key, val)
+
+ ##
+ # Send request body.
+ # This function provides a useful hook for subclassing
+ #
+ # @param connection httpConnection.
+ # @param request_body XML-RPC request body.
+
+ def send_content(self, connection, request_body):
+ #optionally encode the request
+ if (self.encode_threshold is not None and
+ self.encode_threshold < len(request_body) and
+ gzip):
+ connection.putheader("Content-Encoding", "gzip")
+ request_body = gzip_encode(request_body)
+
+ connection.putheader("Content-Length", str(len(request_body)))
+ connection.endheaders(request_body)
+
+ ##
# Parse response.
#
# @param file Stream.
# @return Response tuple and target method.
- def parse_response(self, file):
- # read response from input file/socket, and parse it
+ def parse_response(self, response):
+ # read response data from httpresponse, and parse it
+ # Check for new http response object, otherwise it is a file object.
+ if hasattr(response, 'getheader'):
+ if response.getheader("Content-Encoding", "") == "gzip":
+ stream = GzipDecodedResponse(response)
+ else:
+ stream = response
+ else:
+ stream = response
p, u = self.getparser()
while 1:
- response = file.read(1024)
- if not response:
+ data = stream.read(1024)
+ if not data:
break
if self.verbose:
- print("body:", repr(response))
- p.feed(response)
+ print("body:", repr(data))
+ p.feed(data)
- file.close()
+ if stream is not response:
+ stream.close()
p.close()
return u.close()
@@ -1176,24 +1330,19 @@ class SafeTransport(Transport):
# FIXME: mostly untested
- def send_request(self, host, handler, request_body, debug):
- import socket
+ def make_connection(self, host):
+ if self._connection and host == self._connection[0]:
+ return self._connection[1]
+
if not hasattr(http.client, "HTTPSConnection"):
raise NotImplementedError(
- "your version of http.client doesn't support HTTPS")
-
- host, extra_headers, x509 = self.get_host_info(host)
- connection = http.client.HTTPSConnection(host, None, **(x509 or {}))
- if debug:
- connection.set_debuglevel(1)
- headers = {}
- if extra_headers:
- for key, val in extra_headers:
- headers[key] = val
- headers["Content-Type"] = "text/xml"
- headers["User-Agent"] = self.user_agent
- connection.request("POST", handler, request_body, headers)
- return connection
+ "your version of http.client doesn't support HTTPS")
+ # create a HTTPS connection object from a host descriptor
+ # host may be a string, or a (host, x509-dict) tuple
+ chost, self._extra_headers, x509 = self.get_host_info(host)
+ self._connection = host, http.client.HTTPSConnection(chost,
+ None, **(x509 or {}))
+ return self._connection[1]
##
# Standard server proxy. This class establishes a virtual connection
@@ -1258,6 +1407,9 @@ class ServerProxy:
self.__verbose = verbose
self.__allow_none = allow_none
+ def __close(self):
+ self.__transport.close()
+
def __request(self, methodname, params):
# call a method on the remote server
@@ -1291,6 +1443,16 @@ class ServerProxy:
# note: to call a remote object with an non-standard name, use
# result getattr(server, "strange-python-name")(args)
+ def __call__(self, attr):
+ """A workaround to get special attributes on the ServerProxy
+ without interfering with the magic __getattr__
+ """
+ if attr == "close":
+ return self.__close
+ elif attr == "transport":
+ return self.__transport
+ raise AttributeError("Attribute %r not found" % (attr,))
+
# compatibility
Server = ServerProxy
diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py
index 24d8a6a03e..9477309617 100644
--- a/Lib/xmlrpc/server.py
+++ b/Lib/xmlrpc/server.py
@@ -104,7 +104,7 @@ server.handle_request()
# Written by Brian Quinlan (brian@sweetapp.com).
# Based on code written by Fredrik Lundh.
-from xmlrpc.client import Fault, dumps, loads
+from xmlrpc.client import Fault, dumps, loads, gzip_encode, gzip_decode
from http.server import BaseHTTPRequestHandler
import http.server
import socketserver
@@ -155,8 +155,9 @@ class SimpleXMLRPCDispatcher:
"""Mix-in class that dispatches XML-RPC requests.
This class is used to register XML-RPC method handlers
- and then to dispatch them. There should never be any
- reason to instantiate this class directly.
+ and then to dispatch them. This class doesn't need to be
+ instanced directly when used by SimpleXMLRPCServer but it
+ can be instanced when used by the MultiPathXMLRPCServer
"""
def __init__(self, allow_none=False, encoding=None):
@@ -231,7 +232,7 @@ class SimpleXMLRPCDispatcher:
self.funcs.update({'system.multicall' : self.system_multicall})
- def _marshaled_dispatch(self, data, dispatch_method = None):
+ def _marshaled_dispatch(self, data, dispatch_method = None, path = None):
"""Dispatches an XML-RPC method from marshalled (XML) data.
XML-RPC methods are dispatched from the marshalled (XML) data
@@ -420,6 +421,31 @@ class SimpleXMLRPCRequestHandler(BaseHTTPRequestHandler):
# paths not on this list will result in a 404 error.
rpc_paths = ('/', '/RPC2')
+ #if not None, encode responses larger than this, if possible
+ encode_threshold = 1400 #a common MTU
+
+ #Override form StreamRequestHandler: full buffering of output
+ #and no Nagle.
+ wbufsize = -1
+ disable_nagle_algorithm = True
+
+ # a re to match a gzip Accept-Encoding
+ aepattern = re.compile(r"""
+ \s* ([^\s;]+) \s* #content-coding
+ (;\s* q \s*=\s* ([0-9\.]+))? #q
+ """, re.VERBOSE | re.IGNORECASE)
+
+ def accept_encodings(self):
+ r = {}
+ ae = self.headers.get("Accept-Encoding", "")
+ for e in ae.split(","):
+ match = self.aepattern.match(e)
+ if match:
+ v = match.group(3)
+ v = float(v) if v else 1.0
+ r[match.group(1)] = v
+ return r
+
def is_rpc_path_valid(self):
if self.rpc_paths:
return self.path in self.rpc_paths
@@ -453,13 +479,17 @@ class SimpleXMLRPCRequestHandler(BaseHTTPRequestHandler):
size_remaining -= len(L[-1])
data = b''.join(L)
+ data = self.decode_request_content(data)
+ if data is None:
+ return #response has been sent
+
# In previous versions of SimpleXMLRPCServer, _dispatch
# could be overridden in this class, instead of in
# SimpleXMLRPCDispatcher. To maintain backwards compatibility,
# check to see if a subclass implements _dispatch and dispatch
# using that method if present.
response = self.server._marshaled_dispatch(
- data, getattr(self, '_dispatch', None)
+ data, getattr(self, '_dispatch', None), self.path
)
except Exception as e: # This should only happen if the module is buggy
# internal error, report as HTTP server error
@@ -473,17 +503,40 @@ class SimpleXMLRPCRequestHandler(BaseHTTPRequestHandler):
trace = str(trace.encode('ASCII', 'backslashreplace'), 'ASCII')
self.send_header("X-traceback", trace)
+ self.send_header("Content-length", "0")
self.end_headers()
else:
self.send_response(200)
self.send_header("Content-type", "text/xml")
+ if self.encode_threshold is not None:
+ if len(response) > self.encode_threshold:
+ q = self.accept_encodings().get("gzip", 0)
+ if q:
+ try:
+ response = gzip_encode(response)
+ self.send_header("Content-Encoding", "gzip")
+ except NotImplementedError:
+ pass
self.send_header("Content-length", str(len(response)))
self.end_headers()
self.wfile.write(response)
- # shut down the connection
- self.wfile.flush()
- self.connection.shutdown(1)
+ def decode_request_content(self, data):
+ #support gzip encoding of request
+ encoding = self.headers.get("content-encoding", "identity").lower()
+ if encoding == "identity":
+ return data
+ if encoding == "gzip":
+ try:
+ return gzip_decode(data)
+ except NotImplementedError:
+ self.send_response(501, "encoding %r not supported" % encoding)
+ except ValueError:
+ self.send_response(400, "error decoding gzip content")
+ else:
+ self.send_response(501, "encoding %r not supported" % encoding)
+ self.send_header("Content-length", "0")
+ self.end_headers()
def report_404 (self):
# Report a 404 error
@@ -493,9 +546,6 @@ class SimpleXMLRPCRequestHandler(BaseHTTPRequestHandler):
self.send_header("Content-length", str(len(response)))
self.end_headers()
self.wfile.write(response)
- # shut down the connection
- self.wfile.flush()
- self.connection.shutdown(1)
def log_request(self, code='-', size='-'):
"""Selectively log an accepted request."""
@@ -537,6 +587,44 @@ class SimpleXMLRPCServer(socketserver.TCPServer,
flags |= fcntl.FD_CLOEXEC
fcntl.fcntl(self.fileno(), fcntl.F_SETFD, flags)
+class MultiPathXMLRPCServer(SimpleXMLRPCServer):
+ """Multipath XML-RPC Server
+ This specialization of SimpleXMLRPCServer allows the user to create
+ multiple Dispatcher instances and assign them to different
+ HTTP request paths. This makes it possible to run two or more
+ 'virtual XML-RPC servers' at the same port.
+ Make sure that the requestHandler accepts the paths in question.
+ """
+ def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler,
+ logRequests=True, allow_none=False, encoding=None, bind_and_activate=True):
+
+ SimpleXMLRPCServer.__init__(self, addr, requestHandler, logRequests, allow_none,
+ encoding, bind_and_activate)
+ self.dispatchers = {}
+ self.allow_none = allow_none
+ self.encoding = encoding
+
+ def add_dispatcher(self, path, dispatcher):
+ self.dispatchers[path] = dispatcher
+ return dispatcher
+
+ def get_dispatcher(self, path):
+ return self.dispatchers[path]
+
+ def _marshaled_dispatch(self, data, dispatch_method = None, path = None):
+ try:
+ response = self.dispatchers[path]._marshaled_dispatch(
+ data, dispatch_method, path)
+ except:
+ # report low level exception back to server
+ # (each dispatcher should have handled their own
+ # exceptions)
+ exc_type, exc_value = sys.exc_info()[:2]
+ response = xmlrpclib.dumps(
+ xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)),
+ encoding=self.encoding, allow_none=self.allow_none)
+ return response
+
class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher):
"""Simple handler for XML-RPC data passed through CGI."""
@@ -826,10 +914,6 @@ class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
self.end_headers()
self.wfile.write(response)
- # shut down the connection
- self.wfile.flush()
- self.connection.shutdown(1)
-
class DocXMLRPCServer( SimpleXMLRPCServer,
XMLRPCDocGenerator):
"""XML-RPC and HTML documentation server.
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 2ec630605f..50f484873a 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -3,8 +3,17 @@ Read and write ZIP files.
XXX references to utf-8 need further investigation.
"""
-import struct, os, time, sys, shutil
-import binascii, io, stat
+import io
+import os
+import re
+import imp
+import sys
+import time
+import stat
+import shutil
+import struct
+import binascii
+
try:
import zlib # We may need its compression method
@@ -13,10 +22,10 @@ except ImportError:
zlib = None
crc32 = binascii.crc32
-__all__ = ["BadZipfile", "error", "ZIP_STORED", "ZIP_DEFLATED", "is_zipfile",
- "ZipInfo", "ZipFile", "PyZipFile", "LargeZipFile" ]
+__all__ = ["BadZipFile", "BadZipfile", "error", "ZIP_STORED", "ZIP_DEFLATED",
+ "is_zipfile", "ZipInfo", "ZipFile", "PyZipFile", "LargeZipFile"]
-class BadZipfile(Exception):
+class BadZipFile(Exception):
pass
@@ -26,7 +35,8 @@ class LargeZipFile(Exception):
and those extensions are disabled.
"""
-error = BadZipfile # The exception raised by this module
+error = BadZipfile = BadZipFile # Pre-3.2 compatibility names
+
ZIP64_LIMIT = (1 << 31) - 1
ZIP_FILECOUNT_LIMIT = 1 << 16
@@ -171,7 +181,7 @@ def _EndRecData64(fpin, offset, endrec):
return endrec
if diskno != 0 or disks != 1:
- raise BadZipfile("zipfiles that span multiple disks are not supported")
+ raise BadZipFile("zipfiles that span multiple disks are not supported")
# Assume no 'zip64 extensible data'
fpin.seek(offset - sizeEndCentDir64Locator - sizeEndCentDir64, 2)
@@ -449,133 +459,133 @@ class _ZipDecrypter:
self._UpdateKeys(c)
return c
-class ZipExtFile:
+class ZipExtFile(io.BufferedIOBase):
"""File-like object for reading an archive member.
Is returned by ZipFile.open().
"""
- def __init__(self, fileobj, zipinfo, decrypt=None):
- self.fileobj = fileobj
- self.decrypter = decrypt
- self.bytes_read = 0
- self.rawbuffer = b''
- self.readbuffer = b''
- self.linebuffer = b''
- self.eof = False
- self.univ_newlines = False
- self.nlSeps = (b"\n", )
- self.lastdiscard = b''
-
- self.compress_type = zipinfo.compress_type
- self.compress_size = zipinfo.compress_size
-
- self.closed = False
- self.mode = "r"
- self.name = zipinfo.filename
+ # Max size supported by decompressor.
+ MAX_N = 1 << 31 - 1
- # read from compressed files in 64k blocks
- self.compreadsize = 64*1024
- if self.compress_type == ZIP_DEFLATED:
- self.dc = zlib.decompressobj(-15)
+ # Read from compressed files in 4k blocks.
+ MIN_READ_SIZE = 4096
- if hasattr(zipinfo, 'CRC'):
- self._expected_crc = zipinfo.CRC
- self._running_crc = crc32(b'') & 0xffffffff
- else:
- self._expected_crc = None
+ # Search for universal newlines or line chunks.
+ PATTERN = re.compile(br'^(?P<chunk>[^\r\n]+)|(?P<newline>\n|\r\n?)')
- def set_univ_newlines(self, univ_newlines):
- self.univ_newlines = univ_newlines
+ def __init__(self, fileobj, mode, zipinfo, decrypter=None,
+ close_fileobj=False):
+ self._fileobj = fileobj
+ self._decrypter = decrypter
+ self._close_fileobj = close_fileobj
- # pick line separator char(s) based on universal newlines flag
- self.nlSeps = (b"\n", )
- if self.univ_newlines:
- self.nlSeps = (b"\r\n", b"\r", b"\n")
+ self._compress_type = zipinfo.compress_type
+ self._compress_size = zipinfo.compress_size
+ self._compress_left = zipinfo.compress_size
- def __iter__(self):
- return self
+ if self._compress_type == ZIP_DEFLATED:
+ self._decompressor = zlib.decompressobj(-15)
+ self._unconsumed = b''
- def __next__(self):
- nextline = self.readline()
- if not nextline:
- raise StopIteration()
+ self._readbuffer = b''
+ self._offset = 0
- return nextline
+ self._universal = 'U' in mode
+ self.newlines = None
- def close(self):
- self.closed = True
-
- def _checkfornewline(self):
- nl, nllen = -1, -1
- if self.linebuffer:
- # ugly check for cases where half of an \r\n pair was
- # read on the last pass, and the \r was discarded. In this
- # case we just throw away the \n at the start of the buffer.
- if (self.lastdiscard, self.linebuffer[:1]) == (b'\r', b'\n'):
- self.linebuffer = self.linebuffer[1:]
-
- for sep in self.nlSeps:
- nl = self.linebuffer.find(sep)
- if nl >= 0:
- nllen = len(sep)
- return nl, nllen
-
- return nl, nllen
-
- def readline(self, size = -1):
- """Read a line with approx. size. If size is negative,
- read a whole line.
- """
- if size < 0:
- size = sys.maxsize
- elif size == 0:
- return b''
+ # Adjust read size for encrypted files since the first 12 bytes
+ # are for the encryption/password information.
+ if self._decrypter is not None:
+ self._compress_left -= 12
- # check for a newline already in buffer
- nl, nllen = self._checkfornewline()
+ self.mode = mode
+ self.name = zipinfo.filename
- if nl >= 0:
- # the next line was already in the buffer
- nl = min(nl, size)
+ if hasattr(zipinfo, 'CRC'):
+ self._expected_crc = zipinfo.CRC
+ self._running_crc = crc32(b'') & 0xffffffff
else:
- # no line break in buffer - try to read more
- size -= len(self.linebuffer)
- while nl < 0 and size > 0:
- buf = self.read(min(size, 100))
- if not buf:
- break
- self.linebuffer += buf
- size -= len(buf)
-
- # check for a newline in buffer
- nl, nllen = self._checkfornewline()
-
- # we either ran out of bytes in the file, or
- # met the specified size limit without finding a newline,
- # so return current buffer
- if nl < 0:
- s = self.linebuffer
- self.linebuffer = b''
- return s
-
- buf = self.linebuffer[:nl]
- self.lastdiscard = self.linebuffer[nl:nl + nllen]
- self.linebuffer = self.linebuffer[nl + nllen:]
-
- # line is always returned with \n as newline char (except possibly
- # for a final incomplete line in the file, which is handled above).
- return buf + b"\n"
-
- def readlines(self, sizehint = -1):
- """Return a list with all (following) lines. The sizehint parameter
- is ignored in this implementation.
+ self._expected_crc = None
+
+ def readline(self, limit=-1):
+ """Read and return a line from the stream.
+
+ If limit is specified, at most limit bytes will be read.
"""
- result = []
+
+ if not self._universal and limit < 0:
+ # Shortcut common case - newline found in buffer.
+ i = self._readbuffer.find(b'\n', self._offset) + 1
+ if i > 0:
+ line = self._readbuffer[self._offset: i]
+ self._offset = i
+ return line
+
+ if not self._universal:
+ return io.BufferedIOBase.readline(self, limit)
+
+ line = b''
+ while limit < 0 or len(line) < limit:
+ readahead = self.peek(2)
+ if readahead == b'':
+ return line
+
+ #
+ # Search for universal newlines or line chunks.
+ #
+ # The pattern returns either a line chunk or a newline, but not
+ # both. Combined with peek(2), we are assured that the sequence
+ # '\r\n' is always retrieved completely and never split into
+ # separate newlines - '\r', '\n' due to coincidental readaheads.
+ #
+ match = self.PATTERN.search(readahead)
+ newline = match.group('newline')
+ if newline is not None:
+ if self.newlines is None:
+ self.newlines = []
+ if newline not in self.newlines:
+ self.newlines.append(newline)
+ self._offset += len(newline)
+ return line + b'\n'
+
+ chunk = match.group('chunk')
+ if limit >= 0:
+ chunk = chunk[: limit - len(line)]
+
+ self._offset += len(chunk)
+ line += chunk
+
+ return line
+
+ def peek(self, n=1):
+ """Returns buffered bytes without advancing the position."""
+ if n > len(self._readbuffer) - self._offset:
+ chunk = self.read(n)
+ self._offset -= len(chunk)
+
+ # Return up to 512 bytes to reduce allocation overhead for tight loops.
+ return self._readbuffer[self._offset: self._offset + 512]
+
+ def readable(self):
+ return True
+
+ def read(self, n=-1):
+ """Read and return up to n bytes.
+ If the argument is omitted, None, or negative, data is read and returned until EOF is reached..
+ """
+ buf = b''
+ if n is None:
+ n = -1
while True:
- line = self.readline()
- if not line: break
- result.append(line)
- return result
+ if n < 0:
+ data = self.read1(n)
+ elif n > len(buf):
+ data = self.read1(n - len(buf))
+ else:
+ return buf
+ if len(data) == 0:
+ return buf
+ buf += data
def _update_crc(self, newdata, eof):
# Update the CRC using the given data.
@@ -585,86 +595,67 @@ class ZipExtFile:
self._running_crc = crc32(newdata, self._running_crc) & 0xffffffff
# Check the CRC if we're at the end of the file
if eof and self._running_crc != self._expected_crc:
- raise BadZipfile("Bad CRC-32 for file %r" % self.name)
-
- def read(self, size = None):
- # act like file obj and return empty string if size is 0
- if size == 0:
- return b''
-
- # determine read size
- bytesToRead = self.compress_size - self.bytes_read
-
- # adjust read size for encrypted files since the first 12 bytes
- # are for the encryption/password information
- if self.decrypter is not None:
- bytesToRead -= 12
-
- if size is not None and size >= 0:
- if self.compress_type == ZIP_STORED:
- lr = len(self.readbuffer)
- bytesToRead = min(bytesToRead, size - lr)
- elif self.compress_type == ZIP_DEFLATED:
- if len(self.readbuffer) > size:
- # the user has requested fewer bytes than we've already
- # pulled through the decompressor; don't read any more
- bytesToRead = 0
- else:
- # user will use up the buffer, so read some more
- lr = len(self.rawbuffer)
- bytesToRead = min(bytesToRead, self.compreadsize - lr)
-
- # avoid reading past end of file contents
- if bytesToRead + self.bytes_read > self.compress_size:
- bytesToRead = self.compress_size - self.bytes_read
-
- # try to read from file (if necessary)
- if bytesToRead > 0:
- data = self.fileobj.read(bytesToRead)
- self.bytes_read += len(data)
- try:
- self.rawbuffer += data
- except:
- print(repr(self.fileobj), repr(self.rawbuffer),
- repr(data))
- raise
+ raise BadZipFile("Bad CRC-32 for file %r" % self.name)
- # handle contents of raw buffer
- if self.rawbuffer:
- newdata = self.rawbuffer
- self.rawbuffer = b''
-
- # decrypt new data if we were given an object to handle that
- if newdata and self.decrypter is not None:
- newdata = bytes(map(self.decrypter, newdata))
-
- # decompress newly read data if necessary
- if newdata and self.compress_type == ZIP_DEFLATED:
- newdata = self.dc.decompress(newdata)
- self.rawbuffer = self.dc.unconsumed_tail
- if self.eof and len(self.rawbuffer) == 0:
- # we're out of raw bytes (both from the file and
- # the local buffer); flush just to make sure the
- # decompressor is done
- newdata += self.dc.flush()
- # prevent decompressor from being used again
- self.dc = None
-
- self._update_crc(newdata, eof=(
- self.compress_size == self.bytes_read and
- len(self.rawbuffer) == 0))
- self.readbuffer += newdata
-
- # return what the user asked for
- if size is None or len(self.readbuffer) <= size:
- data = self.readbuffer
- self.readbuffer = b''
- else:
- data = self.readbuffer[:size]
- self.readbuffer = self.readbuffer[size:]
+ def read1(self, n):
+ """Read up to n bytes with at most one read() system call."""
+
+ # Simplify algorithm (branching) by transforming negative n to large n.
+ if n < 0 or n is None:
+ n = self.MAX_N
+
+ # Bytes available in read buffer.
+ len_readbuffer = len(self._readbuffer) - self._offset
+
+ # Read from file.
+ if self._compress_left > 0 and n > len_readbuffer + len(self._unconsumed):
+ nbytes = n - len_readbuffer - len(self._unconsumed)
+ nbytes = max(nbytes, self.MIN_READ_SIZE)
+ nbytes = min(nbytes, self._compress_left)
+
+ data = self._fileobj.read(nbytes)
+ self._compress_left -= len(data)
+ if data and self._decrypter is not None:
+ data = bytes(map(self._decrypter, data))
+
+ if self._compress_type == ZIP_STORED:
+ self._update_crc(data, eof=(self._compress_left==0))
+ self._readbuffer = self._readbuffer[self._offset:] + data
+ self._offset = 0
+ else:
+ # Prepare deflated bytes for decompression.
+ self._unconsumed += data
+
+ # Handle unconsumed data.
+ if (len(self._unconsumed) > 0 and n > len_readbuffer and
+ self._compress_type == ZIP_DEFLATED):
+ data = self._decompressor.decompress(
+ self._unconsumed,
+ max(n - len_readbuffer, self.MIN_READ_SIZE)
+ )
+
+ self._unconsumed = self._decompressor.unconsumed_tail
+ eof = len(self._unconsumed) == 0 and self._compress_left == 0
+ if eof:
+ data += self._decompressor.flush()
+
+ self._update_crc(data, eof=eof)
+ self._readbuffer = self._readbuffer[self._offset:] + data
+ self._offset = 0
+
+ # Read from buffer.
+ data = self._readbuffer[self._offset: self._offset + n]
+ self._offset += len(data)
return data
+ def close(self):
+ try:
+ if self._close_fileobj:
+ self._fileobj.close()
+ finally:
+ super().close()
+
class ZipFile:
""" Class with methods to open, read, write, close, list zip files.
@@ -738,7 +729,7 @@ class ZipFile:
self._RealGetContents()
# seek to start of directory and overwrite
self.fp.seek(self.start_dir, 0)
- except BadZipfile:
+ except BadZipFile:
# file is not a zip file, just append
self.fp.seek(0, 2)
@@ -751,12 +742,18 @@ class ZipFile:
self.fp = None
raise RuntimeError('Mode must be "r", "w" or "a"')
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, traceback):
+ self.close()
+
def _GetContents(self):
"""Read the directory, making sure we close the file if the format
is bad."""
try:
self._RealGetContents()
- except BadZipfile:
+ except BadZipFile:
if not self._filePassed:
self.fp.close()
self.fp = None
@@ -768,9 +765,9 @@ class ZipFile:
try:
endrec = _EndRecData(fp)
except IOError:
- raise BadZipfile("File is not a zip file")
+ raise BadZipFile("File is not a zip file")
if not endrec:
- raise BadZipfile("File is not a zip file")
+ raise BadZipFile("File is not a zip file")
if self.debug > 1:
print(endrec)
size_cd = endrec[_ECD_SIZE] # bytes in central directory
@@ -795,7 +792,7 @@ class ZipFile:
while total < size_cd:
centdir = fp.read(sizeCentralDir)
if centdir[0:4] != stringCentralDir:
- raise BadZipfile("Bad magic number for central directory")
+ raise BadZipFile("Bad magic number for central directory")
centdir = struct.unpack(structCentralDir, centdir)
if self.debug > 2:
print(centdir)
@@ -866,7 +863,7 @@ class ZipFile:
f = self.open(zinfo.filename, "r")
while f.read(chunk_size): # Check CRC-32
pass
- except BadZipfile:
+ except BadZipFile:
return zinfo.filename
def getinfo(self, name):
@@ -889,7 +886,8 @@ class ZipFile:
def read(self, name, pwd=None):
"""Return file bytes (as a string) for name."""
- return self.open(name, "r", pwd).read()
+ with self.open(name, "r", pwd) as fp:
+ return fp.read()
def open(self, name, mode="r", pwd=None):
"""Return file-like object for 'name'."""
@@ -914,22 +912,34 @@ class ZipFile:
zinfo = name
else:
# Get info object for name
- zinfo = self.getinfo(name)
-
+ try:
+ zinfo = self.getinfo(name)
+ except KeyError:
+ if not self._filePassed:
+ zef_file.close()
+ raise
zef_file.seek(zinfo.header_offset, 0)
# Skip the file header:
fheader = zef_file.read(sizeFileHeader)
if fheader[0:4] != stringFileHeader:
- raise BadZipfile("Bad magic number for file header")
+ raise BadZipFile("Bad magic number for file header")
fheader = struct.unpack(structFileHeader, fheader)
fname = zef_file.read(fheader[_FH_FILENAME_LENGTH])
if fheader[_FH_EXTRA_FIELD_LENGTH]:
zef_file.read(fheader[_FH_EXTRA_FIELD_LENGTH])
- if fname != zinfo.orig_filename.encode("utf-8"):
- raise BadZipfile(
+ if zinfo.flag_bits & 0x800:
+ # UTF-8 filename
+ fname_str = fname.decode("utf-8")
+ else:
+ fname_str = fname.decode("cp437")
+
+ if fname_str != zinfo.orig_filename:
+ if not self._filePassed:
+ zef_file.close()
+ raise BadZipFile(
'File name in directory %r and header %r differ.'
% (zinfo.orig_filename, fname))
@@ -940,6 +950,8 @@ class ZipFile:
if not pwd:
pwd = self.pwd
if not pwd:
+ if not self._filePassed:
+ zef_file.close()
raise RuntimeError("File %s is encrypted, "
"password required for extraction" % name)
@@ -958,18 +970,12 @@ class ZipFile:
# compare against the CRC otherwise
check_byte = (zinfo.CRC >> 24) & 0xff
if h[11] != check_byte:
+ if not self._filePassed:
+ zef_file.close()
raise RuntimeError("Bad password for file", name)
- # build and return a ZipExtFile
- if zd is None:
- zef = ZipExtFile(zef_file, zinfo)
- else:
- zef = ZipExtFile(zef_file, zinfo, zd)
-
- # set universal newlines on ZipExtFile if necessary
- if "U" in mode:
- zef.set_univ_newlines(True)
- return zef
+ return ZipExtFile(zef_file, mode, zinfo, zd,
+ close_fileobj=not self._filePassed)
def extract(self, member, path=None, pwd=None):
"""Extract a member from the archive to the current working directory,
@@ -1138,7 +1144,7 @@ class ZipFile:
self.filelist.append(zinfo)
self.NameToInfo[zinfo.filename] = zinfo
- def writestr(self, zinfo_or_arcname, data):
+ def writestr(self, zinfo_or_arcname, data, compress_type=None):
"""Write a file into the archive. The contents is 'data', which
may be either a 'str' or a 'bytes' instance; if it is a 'str',
it is encoded as UTF-8 first.
@@ -1160,6 +1166,9 @@ class ZipFile:
zinfo.file_size = len(data) # Uncompressed size
zinfo.header_offset = self.fp.tell() # Start of header data
+ if compress_type is not None:
+ zinfo.compress_type = compress_type
+
self._writecheck(zinfo)
self._didModify = True
zinfo.CRC = crc32(data) & 0xffffffff # CRC-32 checksum
@@ -1298,6 +1307,12 @@ class ZipFile:
class PyZipFile(ZipFile):
"""Class to create ZIP archives with Python library files and packages."""
+ def __init__(self, file, mode="r", compression=ZIP_STORED,
+ allowZip64=False, optimize=-1):
+ ZipFile.__init__(self, file, mode=mode, compression=compression,
+ allowZip64=allowZip64)
+ self._optimize = optimize
+
def writepy(self, pathname, basename=""):
"""Add all files from "pathname" to the ZIP archive.
@@ -1370,25 +1385,64 @@ class PyZipFile(ZipFile):
archive name, compiling if necessary. For example, given
/python/lib/string, return (/python/lib/string.pyc, string).
"""
- file_py = pathname + ".py"
- file_pyc = pathname + ".pyc"
- file_pyo = pathname + ".pyo"
- if os.path.isfile(file_pyo) and \
- os.stat(file_pyo).st_mtime >= os.stat(file_py).st_mtime:
- fname = file_pyo # Use .pyo file
- elif not os.path.isfile(file_pyc) or \
- os.stat(file_pyc).st_mtime < os.stat(file_py).st_mtime:
+ def _compile(file, optimize=-1):
import py_compile
if self.debug:
- print("Compiling", file_py)
+ print("Compiling", file)
try:
- py_compile.compile(file_py, file_pyc, None, True)
- except py_compile.PyCompileError as err:
+ py_compile.compile(file, doraise=True, optimize=optimize)
+ except py_compile.PyCompileError as error:
print(err.msg)
- fname = file_pyc
+ return False
+ return True
+
+ file_py = pathname + ".py"
+ file_pyc = pathname + ".pyc"
+ file_pyo = pathname + ".pyo"
+ pycache_pyc = imp.cache_from_source(file_py, True)
+ pycache_pyo = imp.cache_from_source(file_py, False)
+ if self._optimize == -1:
+ # legacy mode: use whatever file is present
+ if (os.path.isfile(file_pyo) and
+ os.stat(file_pyo).st_mtime >= os.stat(file_py).st_mtime):
+ # Use .pyo file.
+ arcname = fname = file_pyo
+ elif (os.path.isfile(file_pyc) and
+ os.stat(file_pyc).st_mtime >= os.stat(file_py).st_mtime):
+ # Use .pyc file.
+ arcname = fname = file_pyc
+ elif (os.path.isfile(pycache_pyc) and
+ os.stat(pycache_pyc).st_mtime >= os.stat(file_py).st_mtime):
+ # Use the __pycache__/*.pyc file, but write it to the legacy pyc
+ # file name in the archive.
+ fname = pycache_pyc
+ arcname = file_pyc
+ elif (os.path.isfile(pycache_pyo) and
+ os.stat(pycache_pyo).st_mtime >= os.stat(file_py).st_mtime):
+ # Use the __pycache__/*.pyo file, but write it to the legacy pyo
+ # file name in the archive.
+ fname = pycache_pyo
+ arcname = file_pyo
+ else:
+ # Compile py into PEP 3147 pyc file.
+ if _compile(file_py):
+ fname = (pycache_pyc if __debug__ else pycache_pyo)
+ arcname = (file_pyc if __debug__ else file_pyo)
+ else:
+ fname = arcname = file_py
else:
- fname = file_pyc
- archivename = os.path.split(fname)[1]
+ # new mode: use given optimization level
+ if self._optimize == 0:
+ fname = pycache_pyc
+ arcname = file_pyc
+ else:
+ fname = pycache_pyo
+ arcname = file_pyo
+ if not (os.path.isfile(fname) and
+ os.stat(fname).st_mtime >= os.stat(file_py).st_mtime):
+ if not _compile(file_py, optimize=self._optimize):
+ fname = arcname = file_py
+ archivename = os.path.split(arcname)[1]
if basename:
archivename = "%s/%s" % (basename, archivename)
return (fname, archivename)
diff --git a/Mac/BuildScript/README.txt b/Mac/BuildScript/README.txt
index 0f1aeb5d2a..de2f5cb359 100644
--- a/Mac/BuildScript/README.txt
+++ b/Mac/BuildScript/README.txt
@@ -1,78 +1,147 @@
-Building a MacPython distribution
-=================================
+Building a Python Mac OS X distribution
+=======================================
-The ``build-install.py`` script creates MacPython distributions, including
-sleepycat db4, sqlite3 and readline support. It builds a complete
+The ``build-install.py`` script creates Python distributions, including
+certain third-party libraries as necessary. It builds a complete
framework-based Python out-of-tree, installs it in a funny place with
$DESTROOT, massages that installation to remove .pyc files and such, creates
an Installer package from the installation plus other files in ``resources``
and ``scripts`` and placed that on a ``.dmg`` disk image.
-Prerequisites
--------------
+As of Python 2.7.x and 3.2, PSF practice is to build two installer variants
+for each release:
-* A MacOS X 10.4 (or later)
+1. 32-bit-only, i386 and PPC universal, capable on running on all machines
+ supported by Mac OS X 10.3.9 through (at least) 10.6::
-* XCode 2.2 (or later), with the universal SDK
+ python build-installer.py \
+ --sdk-path=/Developer/SDKs/MacOSX10.4u.sdk \
+ --universal-archs=32-bit \
+ --dep-target=10.3
+ # These are the current default options
-* No Fink (in ``/sw``) or DarwinPorts (in ``/opt/local``), those could
+ - builds the following third-party libraries
+
+ * Bzip2
+ * Zlib 1.2.3
+ * GNU Readline (GPL)
+ * SQLite 3
+ * NCurses
+ * Oracle Sleepycat DB 4.8 (Python 2.x only)
+
+ - requires ActiveState ``Tcl/Tk 8.4`` (currently 8.4.19) to be installed for building
+
+ - current target build environment:
+
+ * Mac OS X 10.5.8 PPC or Intel
+ * Xcode 3.1.4 (or later)
+ * ``MacOSX10.4u`` SDK (later SDKs do not support PPC G3 processors)
+ * ``MACOSX_DEPLOYMENT_TARGET=10.3``
+ * Apple ``gcc-4.0``
+ * Python 2.n (n >= 4) for documentation build with Sphinx
+
+ - alternate build environments:
+
+ * Mac OS X 10.4.11 with Xcode 2.5
+ * Mac OS X 10.6.6 with Xcode 3.2.5
+ - need to change ``/System/Library/Frameworks/{Tcl,Tk}.framework/Version/Current`` to ``8.4``
+
+2. 64-bit / 32-bit, x86_64 and i386 universal, for OS X 10.6 (and later)::
+
+ python build-installer.py \
+ --sdk-path=/Developer/SDKs/MacOSX10.6.sdk \
+ --universal-archs=intel \
+ --dep-target=10.6
+
+ - uses system-supplied versions of third-party libraries
+
+ * readline module links with Apple BSD editline (libedit)
+ * builds Oracle Sleepycat DB 4.8 (Python 2.x only)
+
+ - requires ActiveState Tcl/Tk 8.5.9 (or later) to be installed for building
+
+ - current target build environment:
+
+ * Mac OS X 10.6.6 (or later)
+ * Xcode 3.2.5 (or later)
+ * ``MacOSX10.6`` SDK
+ * ``MACOSX_DEPLOYMENT_TARGET=10.6``
+ * Apple ``gcc-4.2``
+ * Python 2.n (n >= 4) for documentation build with Sphinx
+
+ - alternate build environments:
+
+ * none
+
+
+General Prerequisites
+---------------------
+
+* No Fink (in ``/sw``) or MacPorts (in ``/opt/local``) or other local
+ libraries or utilities (in ``/usr/local``) as they could
interfere with the build.
-* The documentation for the release must be available on python.org
+* The documentation for the release is built using Sphinx
because it is included in the installer.
+* It is safest to start each variant build with an empty source directory
+ populated with a fresh copy of the untarred source.
+
The Recipe
----------
-Here are the steps you need to follow to build a MacPython installer:
+Here are the steps you need to follow to build a Python installer:
-* Run ``./build-installer.py``. Optionally you can pass a number of arguments
- to specify locations of various files. Please see the top of
+* Run ``build-installer.py``. Optionally you can pass a number of arguments
+ to specify locations of various files. Please see the top of
``build-installer.py`` for its usage.
- Running this script takes some time, I will not only build Python itself
+ Running this script takes some time, it will not only build Python itself
but also some 3th-party libraries that are needed for extensions.
* When done the script will tell you where the DMG image is (by default
somewhere in ``/tmp/_py``).
-Building a 4-way universal installer
-....................................
+Building other universal installers
+...................................
It is also possible to build a 4-way universal installer that runs on
-OSX Leopard or later::
+OS X Leopard or later::
- $ ./build-installer.py --dep-target=10.5 --universal-archs=all --sdk=/
+ python 2.6 /build-installer.py \
+ --dep-target=10.5
+ --universal-archs=all
+ --sdk-path=/Developer/SDKs/MacOSX10.5.sdk
-This requires that the deployment target is 10.5 (or later), and hence
-also that your building on at least OSX 10.5.
-
-Testing
--------
-
-The resulting binaries should work on MacOSX 10.3.9 or later. I usually run
-the installer on a 10.3.9, a 10.4.x PPC and a 10.4.x Intel system and then
-run the testsuite to make sure.
+This requires that the deployment target is 10.5, and hence
+also that you are building on at least OS X 10.5. 4-way includes
+``i386``, ``x86_64``, ``ppc``, and ``ppc64`` (G5). ``ppc64`` executable
+variants can only be run on G5 machines running 10.5. Note that,
+while OS X 10.6 is only supported on Intel-based machines, it is possible
+to run ``ppc`` (32-bit) executables unmodified thanks to the Rosetta ppc
+emulation in OS X 10.5 and 10.6.
+Other ``--universal-archs`` options are ``64-bit`` (``x86_64``, ``ppc64``),
+and ``3-way`` (``ppc``, ``i386``, ``x86_64``). None of these options
+are regularly exercised; use at your own risk.
-Announcements
--------------
-(This is mostly of historic interest)
+Testing
+-------
-When all is done, announcements can be posted to at least the following
-places:
-- pythonmac-sig@python.org
-- python-dev@python.org
-- python-announce@python.org
-- archivist@info-mac.org
-- adcnews@apple.com
-- news@macnn.com
-- http://www.macupdate.com
-- http://guide.apple.com/usindex.lasso
-- http://www.apple.com/downloads/macosx/submit
-- http://www.versiontracker.com/ (userid Jack.Jansen@oratrix.com)
-- http://www.macshareware.net (userid jackjansen)
+Ideally, the resulting binaries should be installed and the test suite run
+on all supported OS X releases and architectures. As a practical matter,
+that is generally not possible. At a minimum, variant 1 should be run on
+at least one Intel, one PPC G4, and one PPC G3 system and one each of
+OS X 10.6, 10.5, 10.4, and 10.3.9. Not all tests run on 10.3.9.
+Variant 2 should be run on 10.6 in both 32-bit and 64-bit modes.::
+
+ arch -i386 /usr/local/bin/pythonn.n -m test.regrtest -w -u all
+ arch -X86_64 /usr/local/bin/pythonn.n -m test.regrtest -w -u all
+
+Certain tests will be skipped and some cause the interpreter to fail
+which will likely generate ``Python quit unexpectedly`` alert messages
+to be generated at several points during a test run. These can
+be ignored.
-Also, check out Stephan Deibels http://pythonology.org/market contact list
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index 02dbe1347e..ba920127c4 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -1,12 +1,14 @@
#!/usr/bin/python
"""
-This script is used to build the "official unofficial" universal build on
-Mac OS X. It requires Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK to do its
-work. 64-bit or four-way universal builds require at least OS X 10.5 and
-the 10.5 SDK.
+This script is used to build "official" universal installers on Mac OS X.
+It requires at least Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK for
+32-bit builds. 64-bit or four-way universal builds require at least
+OS X 10.5 and the 10.5 SDK.
-Please ensure that this script keeps working with Python 2.3, to avoid
-bootstrap issues (/usr/bin/python is Python 2.3 on OSX 10.4)
+Please ensure that this script keeps working with Python 2.5, to avoid
+bootstrap issues (/usr/bin/python is Python 2.5 on OSX 10.5). Sphinx,
+which is used to build the documentation, currently requires at least
+Python 2.4.
Usage: see USAGE variable in the script.
"""
@@ -144,9 +146,9 @@ def library_recipes():
if DEPTARGET < '10.5':
result.extend([
dict(
- name="Bzip2 1.0.5",
- url="http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz",
- checksum='3c15a0c8d1d3ee1c46a1634d00617b1a',
+ name="Bzip2 1.0.6",
+ url="http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz",
+ checksum='00b516f4704d4a7cb50a1d97e6e8e15b',
configure=None,
install='make install CC=%s PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
CC,
@@ -169,29 +171,33 @@ def library_recipes():
),
dict(
# Note that GNU readline is GPL'd software
- name="GNU Readline 5.1.4",
- url="http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz" ,
- checksum='7ee5a692db88b30ca48927a13fd60e46',
+ name="GNU Readline 6.1.2",
+ url="http://ftp.gnu.org/pub/gnu/readline/readline-6.1.tar.gz" ,
+ checksum='fc2f7e714fe792db1ce6ddc4c9fb4ef3',
patchlevel='0',
patches=[
# The readline maintainers don't do actual micro releases, but
# just ship a set of patches.
- 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-001',
- 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-002',
- 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-003',
- 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-004',
+ 'http://ftp.gnu.org/pub/gnu/readline/readline-6.1-patches/readline61-001',
+ 'http://ftp.gnu.org/pub/gnu/readline/readline-6.1-patches/readline61-002',
]
),
dict(
- name="SQLite 3.6.11",
- url="http://www.sqlite.org/sqlite-3.6.11.tar.gz",
- checksum='7ebb099696ab76cc6ff65dd496d17858',
+ name="SQLite 3.7.4",
+ url="http://www.sqlite.org/sqlite-autoconf-3070400.tar.gz",
+ checksum='8f0c690bfb33c3cbbc2471c3d9ba0158',
+ configure_env=('CFLAGS="-Os'
+ ' -DSQLITE_ENABLE_FTS3'
+ ' -DSQLITE_ENABLE_FTS3_PARENTHESIS'
+ ' -DSQLITE_ENABLE_RTREE'
+ ' -DSQLITE_TCL=0'
+ '"'),
configure_pre=[
'--enable-threadsafe',
- '--enable-tempstore',
'--enable-shared=no',
'--enable-static=yes',
- '--disable-tcl',
+ '--disable-readline',
+ '--disable-dependency-tracking',
]
),
dict(
@@ -199,6 +205,7 @@ def library_recipes():
url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.5.tar.gz",
checksum='e73c1ac10b4bfc46db43b2ddfd6244ef',
configure_pre=[
+ "--enable-widec",
"--without-cxx",
"--without-ada",
"--without-progs",
@@ -225,18 +232,19 @@ def library_recipes():
),
])
- result.extend([
- dict(
- name="Sleepycat DB 4.7.25",
- url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz",
- checksum='ec2b87e833779681a0c3a814aa71359e',
- buildDir="build_unix",
- configure="../dist/configure",
- configure_pre=[
- '--includedir=/usr/local/include/db4',
- ]
- ),
- ])
+ if not PYTHON_3:
+ result.extend([
+ dict(
+ name="Sleepycat DB 4.7.25",
+ url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz",
+ checksum='ec2b87e833779681a0c3a814aa71359e',
+ buildDir="build_unix",
+ configure="../dist/configure",
+ configure_pre=[
+ '--includedir=/usr/local/include/db4',
+ ]
+ ),
+ ])
return result
@@ -399,6 +407,9 @@ def checkEnvironment():
Check that we're running on a supported system.
"""
+ if sys.version_info[0:2] < (2, 4):
+ fatal("This script must be run with Python 2.4 or later")
+
if platform.system() != 'Darwin':
fatal("This script should be run on a Mac OS X 10.4 (or later) system")
@@ -418,15 +429,16 @@ def checkEnvironment():
# to install a newer patch level.
for framework in ['Tcl', 'Tk']:
- fw = dict(lower=framework.lower(),
- upper=framework.upper(),
- cap=framework.capitalize())
- fwpth = "Library/Frameworks/%(cap)s.framework/%(lower)sConfig.sh" % fw
- sysfw = os.path.join('/System', fwpth)
+ #fw = dict(lower=framework.lower(),
+ # upper=framework.upper(),
+ # cap=framework.capitalize())
+ #fwpth = "Library/Frameworks/%(cap)s.framework/%(lower)sConfig.sh" % fw
+ fwpth = 'Library/Frameworks/Tcl.framework/Versions/Current'
+ sysfw = os.path.join(SDKPATH, 'System', fwpth)
libfw = os.path.join('/', fwpth)
usrfw = os.path.join(os.getenv('HOME'), fwpth)
- version = "%(upper)s_VERSION" % fw
- if getTclTkVersion(libfw, version) != getTclTkVersion(sysfw, version):
+ #version = "%(upper)s_VERSION" % fw
+ if os.readlink(libfw) != os.readlink(sysfw):
fatal("Version of %s must match %s" % (libfw, sysfw) )
if os.path.exists(usrfw):
fatal("Please rename %s to avoid possible dynamic load issues."
@@ -696,6 +708,9 @@ def buildRecipe(recipe, basedir, archList):
configure_args.insert(0, configure)
configure_args = [ shellQuote(a) for a in configure_args ]
+ if 'configure_env' in recipe:
+ configure_args.insert(0, recipe['configure_env'])
+
print "Running configure for %s"%(name,)
runCommand(' '.join(configure_args) + ' 2>&1')
@@ -751,9 +766,9 @@ def buildPython():
shutil.rmtree(buildDir)
if os.path.exists(rootDir):
shutil.rmtree(rootDir)
- os.mkdir(buildDir)
- os.mkdir(rootDir)
- os.mkdir(os.path.join(rootDir, 'empty-dir'))
+ os.makedirs(buildDir)
+ os.makedirs(rootDir)
+ os.makedirs(os.path.join(rootDir, 'empty-dir'))
curdir = os.getcwd()
os.chdir(buildDir)
@@ -825,12 +840,33 @@ def buildPython():
os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP)
os.chown(p, -1, gid)
+ if PYTHON_3:
+ LDVERSION=None
+ VERSION=None
+ ABIFLAGS=None
+
+ fp = open(os.path.join(buildDir, 'Makefile'), 'r')
+ for ln in fp:
+ if ln.startswith('VERSION='):
+ VERSION=ln.split()[1]
+ if ln.startswith('ABIFLAGS='):
+ ABIFLAGS=ln.split()[1]
+ if ln.startswith('LDVERSION='):
+ LDVERSION=ln.split()[1]
+ fp.close()
+
+ LDVERSION = LDVERSION.replace('$(VERSION)', VERSION)
+ LDVERSION = LDVERSION.replace('$(ABIFLAGS)', ABIFLAGS)
+ config_suffix = '-' + LDVERSION
+ else:
+ config_suffix = '' # Python 2.x
+
# We added some directories to the search path during the configure
# phase. Remove those because those directories won't be there on
# the end-users system.
path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework',
'Versions', version, 'lib', 'python%s'%(version,),
- 'config', 'Makefile')
+ 'config' + config_suffix, 'Makefile')
fp = open(path, 'r')
data = fp.read()
fp.close()
@@ -866,7 +902,7 @@ def patchFile(inPath, outPath):
data = data.replace('$FULL_VERSION', getFullVersion())
data = data.replace('$VERSION', getVersion())
data = data.replace('$MACOSX_DEPLOYMENT_TARGET', ''.join((DEPTARGET, ' or later')))
- data = data.replace('$ARCHITECTURES', "i386, ppc")
+ data = data.replace('$ARCHITECTURES', ", ".join(universal_opts_map[UNIVERSALARCHS]))
data = data.replace('$INSTALL_SIZE', installSize())
# This one is not handy as a template variable
diff --git a/Mac/BuildScript/resources/ReadMe.txt b/Mac/BuildScript/resources/ReadMe.txt
index 67d4525930..f1beda0fbe 100644
--- a/Mac/BuildScript/resources/ReadMe.txt
+++ b/Mac/BuildScript/resources/ReadMe.txt
@@ -1,29 +1,36 @@
This package will install Python $FULL_VERSION for Mac OS X
-$MACOSX_DEPLOYMENT_TARGET for the following
-architecture(s): $ARCHITECTURES.
+$MACOSX_DEPLOYMENT_TARGET for the following architecture(s):
+$ARCHITECTURES.
-Separate installers are available for older versions
-of Mac OS X, see the homepage, below.
+Installation requires approximately $INSTALL_SIZE MB of disk space,
+ignore the message that it will take zero bytes.
-Installation requires approximately $INSTALL_SIZE MB of disk
-space, ignore the message that it will take zero bytes.
+You must install onto your current boot disk, even though the
+installer does not enforce this, otherwise things will not work.
-You must install onto your current boot disk, even
-though the installer does not enforce this, otherwise
-things will not work.
+Python consists of the Python programming language interpreter, plus
+a set of programs to allow easy access to it for Mac users including
+an integrated development environment, IDLE, plus a set of pre-built
+extension modules that open up specific Macintosh technologies to
+Python programs.
-Python consists of the Python programming language
-interpreter, plus a set of programs to allow easy
-access to it for Mac users including an integrated development
-environment, IDLE, plus a set of pre-built extension modules
-that open up specific Macintosh technologies to Python programs.
+ **** IMPORTANT ****
+
+Before using IDLE or other programs using the tkinter graphical user
+interface toolkit, visit http://www.python.org/download/mac/tcltk/
+for current information about supported and recommended versions
+of Tcl/Tk for this version of Python and Mac OS X.
-The installer puts the applications in "Python $VERSION"
-in your Applications folder, and the underlying machinery in
-$PYTHONFRAMEWORKINSTALLDIR. It can optionally place
-links to the command-line tools in /usr/local as well,
-by default you have to add the "bin" directory inside
-the framework to you shell's search path.
+ *******************
+
+The installer puts applications, an "Update Shell Profile" command,
+and a link to the optionally installed Python Documentation into the
+"Python $VERSION" subfolder of the system Applications folder,
+and puts the underlying machinery into the folder
+$PYTHONFRAMEWORKINSTALLDIR. It can
+optionally place links to the command-line tools in /usr/local/bin as
+well. Double-click on the "Update Shell Profile" command to add the
+"bin" directory inside the framework to your shell's search path.
More information on Python in general can be found at
http://www.python.org.
diff --git a/Mac/BuildScript/resources/Welcome.rtf b/Mac/BuildScript/resources/Welcome.rtf
index ed4643b305..d209b10cf7 100644
--- a/Mac/BuildScript/resources/Welcome.rtf
+++ b/Mac/BuildScript/resources/Welcome.rtf
@@ -1,19 +1,35 @@
-{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
-\paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0
+\paperw11904\paperh16836\margl1440\margr1440\vieww9640\viewh10620\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\f0\fs24 \cf0 This package will install
-\b MacPython $FULL_VERSION
+\b Python $FULL_VERSION
\b0 for
\b Mac OS X $MACOSX_DEPLOYMENT_TARGET
\b0 .\
\
-MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users including an integrated development environment \b IDLE\b0 plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs.\
+
+\b Python for Mac OS X
+\b0 consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac OS X users including an integrated development environment
+\b IDLE
+\b0 and a set of pre-built extension modules that open up specific Macintosh technologies to Python programs.\
\
-See the ReadMe file for more information.\
+See the ReadMe file and the Python documentation for more information.\
\
\b NOTE:
-\b0 This package will by default not update your shell profile and will also not install files in /usr/local. Double-click \b Update Shell Profile\b0 at any time to make $FULL_VERSION the default Python.}
+\b0 This package will by default not update your shell profile and will also not install files in /usr/local. Double-click
+\b Update Shell Profile
+\b0 at any time to make $FULL_VERSION the default Python.\
+\
+
+\b IMPORTANT:
+\b0
+\b IDLE
+\b0 and other programs using the
+\b tkinter
+\b0 graphical user interface toolkit require specific versions of the
+\b Tcl/Tk
+\b0 platform independent windowing toolkit. Visit {\field{\*\fldinst{HYPERLINK "http://www.python.org/download/mac/tcltk/"}}{\fldrslt http://www.python.org/download/mac/tcltk/}} for current information on supported and recommended versions of Tcl/Tk for this version of Python and Mac OS X.} \ No newline at end of file
diff --git a/Mac/BuildScript/scripts/postflight.documentation b/Mac/BuildScript/scripts/postflight.documentation
index 9f5918ed78..31fbf2feff 100755
--- a/Mac/BuildScript/scripts/postflight.documentation
+++ b/Mac/BuildScript/scripts/postflight.documentation
@@ -1,11 +1,32 @@
#!/bin/sh
PYVER="@PYVER@"
+FWK="/Library/Frameworks/Python.framework/Versions/${PYVER}"
+FWK_DOCDIR_SUBPATH="Resources/English.lproj/Documentation"
+FWK_DOCDIR="${FWK}/${FWK_DOCDIR_SUBPATH}"
+APPDIR="/Applications/Python ${PYVER}"
+DEV_DOCDIR="/Developer/Documentation"
+SHARE_DIR="${FWK}/share"
+SHARE_DOCDIR="${SHARE_DIR}/doc/python${PYVER}"
+SHARE_DOCDIR_TO_FWK="../../.."
-if [ -d /Developer/Documentation ]; then
- if [ ! -d /Developer/Documentation/Python ]; then
- mkdir -p /Developer/Documentation/Python
- fi
+# make link in /Developer/Documentation/ for Xcode users
+if [ -d "${DEV_DOCDIR}" ]; then
+ if [ ! -d "${DEV_DOCDIR}/Python" ]; then
+ mkdir -p "${DEV_DOCDIR}/Python"
+ fi
+ ln -fhs "${FWK_DOCDIR}" "${DEV_DOCDIR}/Python/Reference Documentation ${PYVER}"
+fi
+
+# make link in /Applications/Python m.n/ for Finder users
+if [ -d "${APPDIR}" ]; then
+ ln -fhs "${FWK_DOCDIR}/index.html" "${APPDIR}/Python Documentation.html"
+fi
- ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation @PYVER@"
+# make share/doc link in framework for command line users
+if [ -d "${SHARE_DIR}" ]; then
+ mkdir -p "${SHARE_DOCDIR}"
+ # make relative link to html doc directory
+ ln -fhs "${SHARE_DOCDIR_TO_FWK}/${FWK_DOCDIR_SUBPATH}" "${SHARE_DOCDIR}/html"
fi
+
diff --git a/Mac/Extras.ReadMe.txt b/Mac/Extras.ReadMe.txt
deleted file mode 100644
index 2d7fd42ac6..0000000000
--- a/Mac/Extras.ReadMe.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This folder contains examples of Python usage and useful scripts and tools.
-
-You should be aware that these are not Macintosh-specific but are shared
-among Python on all platforms, so there are some that only run on Windows
-or Unix or another platform, and/or make little sense on a Macintosh.
diff --git a/Mac/Makefile.in b/Mac/Makefile.in
index 18db6415a8..5e57b57942 100644
--- a/Mac/Makefile.in
+++ b/Mac/Makefile.in
@@ -15,6 +15,8 @@ LDFLAGS=@LDFLAGS@
FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
PYTHONFRAMEWORKIDENTIFIER=@PYTHONFRAMEWORKIDENTIFIER@
+LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
+CC=@CC@
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
export MACOSX_DEPLOYMENT_TARGET
@@ -22,7 +24,7 @@ export MACOSX_DEPLOYMENT_TARGET
# These are normally glimpsed from the previous set
bindir=$(prefix)/bin
-PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
+PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
APPINSTALLDIR=$(prefix)/Resources/Python.app
# Variables for installing the "normal" unix binaries
@@ -44,45 +46,20 @@ APPTEMPLATE=$(srcdir)/Resources/app
APPSUBDIRS=MacOS Resources
compileall=$(srcdir)/../Lib/compileall.py
-installapps: install_Python install_PythonLauncher install_IDLE \
- checkapplepython install_pythonw install_versionedtools
-
-installapps4way: install_Python4way install_PythonLauncher \
- install_IDLE4way install_pythonw4way install_versionedtools
-
+installapps: install_Python install_pythonw install_PythonLauncher install_IDLE \
+ checkapplepython
install_pythonw: pythonw
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python3"
ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw3"
-
-
-# Install 3 variants of python/pythonw:
-# - 32-bit (i386 and ppc)
-# - 64-bit (x86_64 and ppc64)
-# - all (all four architectures)
-# - Make 'python' and 'pythonw' aliases for the 32-bit variant
-install_pythonw4way: pythonw-32 pythonw-64 pythonw
- $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-64"
- $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-64"
- ln -sf python$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/python3-64"
- ln -sf pythonw$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/pythonw3-64"
-
- $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32"
- $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-32"
- ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python3-32"
- ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw3-32"
-
- $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-all"
- $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)-all"
- ln -sf python$(VERSION)-all "$(DESTDIR)$(prefix)/bin/python3-all"
- ln -sf pythonw$(VERSION)-all "$(DESTDIR)$(prefix)/bin/pythonw3-all"
-
- ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
- ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
- ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw3"
- ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python3"
+ifneq ($(LIPO_32BIT_FLAGS),)
+ lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/python$(VERSION)-32 pythonw
+ lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32 pythonw
+ ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw3-32"
+ ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python3-32"
+endif
#
# Install unix tools in /usr/local/bin. These are just aliases for the
@@ -101,10 +78,6 @@ installunixtools:
done
-# TODO: install symlinks for -32, -64 and -all as well
-installunixtools4way: installunixtools
-
-
#
# Like installunixtools, but only install links to the versioned binaries.
#
@@ -118,43 +91,8 @@ altinstallunixtools:
ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
done
-# TODO: -32, -64 and -all variants
-altinstallunixtools4way: altinstallunixtools
-
-# By default most tools are installed without a version in their basename, to
-# make it easier to install (and use) several python versions side-by-side move
-# the tools to a version-specific name and add the non-versioned name as an
-# alias.
-install_versionedtools:
- for fn in idle pydoc ;\
- do \
- if [ -h "$(DESTDIR)$(prefix)/bin/$${fn}3" ]; then \
- continue ;\
- fi ;\
- mv "$(DESTDIR)$(prefix)/bin/$${fn}3" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\
- ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}3" ;\
- done
- mv "$(DESTDIR)$(prefix)/bin/2to3" "$(DESTDIR)$(prefix)/bin/2to3-$(VERSION)"
- ln -sf "2to3-$(VERSION)" "$(DESTDIR)$(prefix)/bin/2to3"
- if [ ! -h "$(DESTDIR)$(prefix)/bin/python3-config" ]; then \
- mv "$(DESTDIR)$(prefix)/bin/python3-config" "$(DESTDIR)$(prefix)/bin/python$(VERSION)-config" ;\
- ln -sf "python$(VERSION)-config" "$(DESTDIR)$(prefix)/bin/python3-config" ; \
- fi
-
-
pythonw: $(srcdir)/Tools/pythonw.c Makefile
- $(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \
- -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"'
-
-pythonw-32: $(srcdir)/Tools/pythonw.c Makefile
- $(CC) $(LDFLAGS) -o pythonw-tmp.o $(srcdir)/Tools/pythonw.c \
- -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32"' ;\
- lipo @LIPO_32BIT_FLAGS@ -output $@ pythonw-tmp.o ; rm pythonw-tmp.o
-
-pythonw-64: $(srcdir)/Tools/pythonw.c Makefile
- $(CC) $(LDFLAGS) -o pythonw-tmp.o $(srcdir)/Tools/pythonw.c \
- -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64"' ;\
- lipo @LIPO_64BIT_FLAGS@ -output $@ pythonw-tmp.o ; rm pythonw-tmp.o
+ $(CC) $(LDFLAGS) -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' -o $@ $(srcdir)/Tools/pythonw.c -I.. -I$(srcdir)/../Include ../$(PYTHONFRAMEWORK).framework/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
install_PythonLauncher:
cd PythonLauncher && make install DESTDIR=$(DESTDIR)
@@ -210,11 +148,6 @@ install_Python:
> "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist"
rm "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in"
-install_Python4way: install_Python
- lipo @LIPO_32BIT_FLAGS@ -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
- lipo @LIPO_64BIT_FLAGS@ -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
-
-
install_IDLE:
test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
@@ -242,20 +175,13 @@ install_IDLE:
fi
touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
-install_IDLE4way: install_IDLE
- ln -sf "$(INSTALLED_PYTHONAPP)-32" "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python"
- sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)-32!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE"
- touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
-
$(INSTALLED_PYTHONAPP): install_Python
-installextras: $(srcdir)/Extras.ReadMe.txt $(srcdir)/Extras.install.py
- $(INSTALL) -d "$(DESTDIR)$(PYTHONAPPSDIR)/Extras"
- $(INSTALL) $(srcdir)/Extras.ReadMe.txt "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/ReadMe.txt"
- $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Extras.install.py $(srcdir)/../Demo \
- "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo"
- $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Extras.install.py $(srcdir)/Demo \
- "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo.Mac"
+installextras: $(srcdir)/Extras.install.py
+ $(INSTALL) -d "$(DESTDIR)$(prefix)/share/doc/python$(VERSION)/examples"
+ $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Extras.install.py $(srcdir)/../Tools \
+ "$(DESTDIR)$(prefix)/share/doc/python$(VERSION)/examples/Tools" ; \
+ chmod -R ugo+rX,go-w "$(DESTDIR)$(prefix)/share/doc/python$(VERSION)/examples/Tools"
checkapplepython: $(srcdir)/Tools/fixapplepython23.py
diff --git a/Mac/PythonLauncher/Makefile.in b/Mac/PythonLauncher/Makefile.in
index 539ed1a8d0..970b83f314 100644
--- a/Mac/PythonLauncher/Makefile.in
+++ b/Mac/PythonLauncher/Makefile.in
@@ -21,7 +21,7 @@ MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
BUNDLEBULDER=$(srcdir)/../Tools/bundlebuilder.py
-PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
+PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o
install: Python\ Launcher.app
diff --git a/Mac/README b/Mac/README
index f84e1347a6..0261127076 100644
--- a/Mac/README
+++ b/Mac/README
@@ -5,16 +5,24 @@ MacOSX Notes
This document provides a quick overview of some Mac OS X specific features in
the Python distribution.
-Mac-specific arguments to configure
-===================================
-
-* ``--enable-framework``
+* ``--enable-framework[=DIR]``
If this argument is specified the build will create a Python.framework rather
than a traditional Unix install. See the section
_`Building and using a framework-based Python on Mac OS X` for more
information on frameworks.
+ If the optional directory argument is specified the framework it installed
+ into that directory. This can be used to install a python framework into
+ your home directory::
+
+ $ configure --enable-framework=/Users/ronald/Library/Frameworks
+ $ make && make install
+
+ This will install the framework itself in ``/Users/ronald/Library/Frameworks``,
+ the applications in a subdirectory of ``/Users/ronald/Applications`` and the
+ command-line tools in ``/Users/ronald/bin``.
+
* ``--with-framework-name=NAME``
Specify the name for the python framework, defaults to ``Python``. This option
@@ -25,19 +33,18 @@ Mac-specific arguments to configure
Create a universal binary build of of Python. This can be used with both
regular and framework builds.
- The optional argument specifies with OSX SDK should be used to perform the
+ The optional argument specifies which OSX SDK should be used to perform the
build. This defaults to ``/Developer/SDKs/MacOSX.10.4u.sdk``, specify
``/`` when building on a 10.5 system, especially when building 64-bit code.
See the section _`Building and using a universal binary of Python on Mac OS X`
for more information.
-* ``--with-universal-archs=VALUE``
+* ``--with-univeral-archs=VALUE``
Specify the kind of universal binary that should be created. This option is
only valid when ``--enable-universalsdk`` is specified.
-
Building and using a universal binary of Python on Mac OS X
===========================================================
@@ -64,12 +71,6 @@ unix build. Either way you will have to build python on Mac OS X 10.4 (or later)
with Xcode 2.1 (or later). You also have to install the 10.4u SDK when
installing Xcode.
-The option ``--enable-universalsdk`` has an optional argument to specify an
-SDK, which defaults to the 10.4u SDK. When you build on OSX 10.5 or later
-you can use the system headers instead of an SDK::
-
- $ ./configure --enable-universalsdk=/
-
2.1 Flavours of universal binaries
..................................
@@ -88,10 +89,29 @@ values are available:
* ``intel``: ``i386``, ``x86_64``
-To build a universal binary that includes a 64-bit architecture you must build
-on a system running OSX 10.5 or later. The ``all`` flavour can only be build on
+To build a universal binary that includes a 64-bit architecture, you must build
+on a system running OSX 10.5 or later. The ``all`` flavour can only be built on
OSX 10.5.
+The makefile for a framework build will install ``python32`` and ``pythonw32``
+binaries when the universal architecures includes at least one 32-bit architecture
+(that is, for all flavours but ``64-bit``).
+
+Running a specific archicture
+.............................
+
+You can run code using a specific architecture using the ``arch`` command::
+
+ $ arch -i386 python
+
+Or to explicitly run in 32-bit mode, regardless of the machine hardware::
+
+ $ arch -i386 -ppc python
+
+NOTE: When you're using a framework install of Python this requires at least
+Python 2.7 or 3.2, in earlier versions the python (and pythonw) commands are
+wrapper tools that execute the real interpreter without ensuring that the
+real interpreter runs with the same architecture.
Building and using a framework-based Python on Mac OS X.
========================================================
@@ -109,7 +129,8 @@ will have to do the work yourself if you really want this.
A second reason for using frameworks is that they put Python-related items in
only two places: "/Library/Framework/Python.framework" and
-"/Applications/MacPython m.n". This simplifies matters for users installing
+"/Applications/MacPython <VERSION>" where ``<VERSION>`` can be e.g. "2.6",
+"3.1", etc.. This simplifies matters for users installing
Python from a binary distribution if they want to get rid of it again. Moreover,
due to the way frameworks work a user without admin privileges can install a
binary distribution in his or her home directory without recompilation.
@@ -136,33 +157,40 @@ PyObjC.
This directory contains a Makefile that will create a couple of python-related
applications (fullblown OSX .app applications, that is) in
-"/Applications/MacPython m.n", and a hidden helper application Python.app
+"/Applications/MacPython <VERSION>", and a hidden helper application Python.app
inside the Python.framework, and unix tools "python" and "pythonw" into
/usr/local/bin. In addition it has a target "installmacsubtree" that installs
the relevant portions of the Mac subtree into the Python.framework.
It is normally invoked indirectly through the main Makefile, as the last step
-in the sequence::
+in the sequence
+
+ 1. ./configure --enable-framework
- $ ./configure --enable-framework
- $ make
- $ make install
+ 2. make
+
+ 3. make install
This sequence will put the framework in /Library/Framework/Python.framework,
-the applications in "/Applications/MacPython m.n" and the unix tools in
+the applications in "/Applications/MacPython <VERSION>" and the unix tools in
/usr/local/bin.
-It is possible to select a different name for the framework using the configure
-option ``--with-framework-name=NAME``. This makes it possible to have several
-parallel installs of a Python framework.
-
Installing in another place, for instance $HOME/Library/Frameworks if you have
no admin privileges on your machine, has only been tested very lightly. This
can be done by configuring with --enable-framework=$HOME/Library/Frameworks.
-The other two directories, "/Applications/MacPython-m.n" and /usr/local/bin,
-will then also be deposited in $HOME. This is sub-optimal for the unix tools,
-which you would want in $HOME/bin, but there is no easy way to fix this right
-now.
+The other two directories, "/Applications/MacPython-<VERSION>" and
+/usr/local/bin, will then also be deposited in $HOME. This is sub-optimal for
+the unix tools, which you would want in $HOME/bin, but there is no easy way to
+fix this right now.
+
+If you want to install some part, but not all, read the main Makefile. The
+frameworkinstall is composed of a couple of sub-targets that install the
+framework itself, the Mac subtree, the applications and the unix tools.
+
+There is an extra target frameworkinstallextras that is not part of the
+normal frameworkinstall which installs the Tools directory into
+"/Applications/MacPython <VERSION>", this is useful for binary
+distributions.
What do all these programs do?
===============================
@@ -178,11 +206,6 @@ GUI-things. Keep the "alt" key depressed while dragging or double-clicking a
script to set runtime options. These options can be set once and for all
through PythonLauncher's preferences dialog.
-"BuildApplet.app" creates an applet from a Python script. Drop the script on it
-and out comes a full-featured MacOS application. There is much more to this,
-to be supplied later. Some useful (but outdated) info can be found in
-Mac/Demo.
-
The commandline scripts /usr/local/bin/python and pythonw can be used to run
non-GUI and GUI python scripts from the command line, respectively.
diff --git a/Mac/Tools/pythonw.c b/Mac/Tools/pythonw.c
index e70a76f846..30c82ac476 100644
--- a/Mac/Tools/pythonw.c
+++ b/Mac/Tools/pythonw.c
@@ -3,15 +3,176 @@
* application bundle inside the Python framework. This is needed to run
* GUI code: some GUI API's don't work unless the program is inside an
* application bundle.
+ *
+ * This program uses posix_spawn rather than plain execv because we need
+ * slightly more control over how the "real" interpreter is executed.
+ *
+ * On OSX 10.4 (and earlier) this falls back to using exec because the
+ * posix_spawnv functions aren't available there.
*/
+
+#pragma weak_import posix_spawnattr_init
+#pragma weak_import posix_spawnattr_setbinpref_np
+#pragma weak_import posix_spawnattr_setflags
+#pragma weak_import posix_spawn
+
+#include <Python.h>
#include <unistd.h>
+#ifdef HAVE_SPAWN_H
+#include <spawn.h>
+#endif
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
#include <err.h>
+#include <dlfcn.h>
+#include <stdlib.h>
+#include <Python.h>
+
+
+extern char** environ;
+
+/*
+ * Locate the python framework by looking for the
+ * library that contains Py_Initialize.
+ *
+ * In a regular framework the structure is:
+ *
+ * Python.framework/Versions/2.7
+ * /Python
+ * /Resources/Python.app/Contents/MacOS/Python
+ *
+ * In a virtualenv style structure the expected
+ * structure is:
+ *
+ * ROOT
+ * /bin/pythonw
+ * /.Python <- the dylib
+ * /.Resources/Python.app/Contents/MacOS/Python
+ *
+ * NOTE: virtualenv's are not an officially supported
+ * feature, support for that structure is provided as
+ * a convenience.
+ */
+static char* get_python_path(void)
+{
+ size_t len;
+ Dl_info info;
+ char* end;
+ char* g_path;
+
+ if (dladdr(Py_Initialize, &info) == 0) {
+ return NULL;
+ }
+
+ len = strlen(info.dli_fname);
+
+ g_path = malloc(len+60);
+ if (g_path == NULL) {
+ return NULL;
+ }
+
+ strcpy(g_path, info.dli_fname);
+ end = g_path + len - 1;
+ while (end != g_path && *end != '/') {
+ end --;
+ }
+ end++;
+ if (*end == '.') {
+ end++;
+ }
+ strcpy(end, "Resources/Python.app/Contents/MacOS/" PYTHONFRAMEWORK);
+
+ return g_path;
+}
+
+#ifdef HAVE_SPAWN_H
+static void
+setup_spawnattr(posix_spawnattr_t* spawnattr)
+{
+ size_t ocount;
+ size_t count;
+ cpu_type_t cpu_types[1];
+ short flags = 0;
+#ifdef __LP64__
+ int ch;
+#endif
+
+ if ((errno = posix_spawnattr_init(spawnattr)) != 0) {
+ err(2, "posix_spawnattr_int");
+ /* NOTREACHTED */
+ }
+
+ count = 1;
+
+ /* Run the real python executable using the same architecture as this
+ * executable, this allows users to control the architecture using
+ * "arch -ppc python"
+ */
+
+#if defined(__ppc64__)
+ cpu_types[0] = CPU_TYPE_POWERPC64;
+
+#elif defined(__x86_64__)
+ cpu_types[0] = CPU_TYPE_X86_64;
+
+#elif defined(__ppc__)
+ cpu_types[0] = CPU_TYPE_POWERPC;
+#elif defined(__i386__)
+ cpu_types[0] = CPU_TYPE_X86;
+#else
+# error "Unknown CPU"
+#endif
+
+ if (posix_spawnattr_setbinpref_np(spawnattr, count,
+ cpu_types, &ocount) == -1) {
+ err(1, "posix_spawnattr_setbinpref");
+ /* NOTREACHTED */
+ }
+ if (count != ocount) {
+ fprintf(stderr, "posix_spawnattr_setbinpref failed to copy\n");
+ exit(1);
+ /* NOTREACHTED */
+ }
+
+
+ /*
+ * Set flag that causes posix_spawn to behave like execv
+ */
+ flags |= POSIX_SPAWN_SETEXEC;
+ if ((errno = posix_spawnattr_setflags(spawnattr, flags)) != 0) {
+ err(1, "posix_spawnattr_setflags");
+ /* NOTREACHTED */
+ }
+}
+#endif
+
+int
+main(int argc, char **argv) {
+ char* exec_path = get_python_path();
+
+ /*
+ * Let argv[0] refer to the new interpreter. This is needed to
+ * get the effect we want on OSX 10.5 or earlier. That is, without
+ * changing argv[0] the real interpreter won't have access to
+ * the Window Server.
+ */
+ argv[0] = exec_path;
-static char Python[] = PYTHONWEXECUTABLE;
+#ifdef HAVE_SPAWN_H
+ /* We're weak-linking to posix-spawnv to ensure that
+ * an executable build on 10.5 can work on 10.4.
+ */
+ if (posix_spawn != NULL) {
+ posix_spawnattr_t spawnattr = NULL;
-int main(int argc, char **argv) {
- argv[0] = Python;
- execv(Python, argv);
- err(1, "execv: %s", Python);
- /* NOTREACHED */
+ setup_spawnattr(&spawnattr);
+ posix_spawn(NULL, exec_path, NULL,
+ &spawnattr, argv, environ);
+ err(1, "posix_spawn: %s", exec_path);
+ }
+#endif
+ execve(exec_path, argv, environ);
+ err(1, "execve: %s", argv[0]);
+ /* NOTREACHED */
}
diff --git a/Makefile.pre.in b/Makefile.pre.in
index c2fc69a792..460c7c755b 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -35,6 +35,8 @@ LINKCC= @LINKCC@
AR= @AR@
RANLIB= @RANLIB@
SVNVERSION= @SVNVERSION@
+SOABI= @SOABI@
+LDVERSION= @LDVERSION@
HGVERSION= @HGVERSION@
HGTAG= @HGTAG@
HGBRANCH= @HGBRANCH@
@@ -62,12 +64,18 @@ MAKESETUP= $(srcdir)/Modules/makesetup
# Compiler options
OPT= @OPT@
BASECFLAGS= @BASECFLAGS@
-CFLAGS= $(BASECFLAGS) @CFLAGS@ $(OPT) $(EXTRA_CFLAGS)
+CONFIGURE_CFLAGS= @CFLAGS@
+CONFIGURE_CPPFLAGS= @CPPFLAGS@
+CONFIGURE_LDFLAGS= @LDFLAGS@
+# Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the
+# command line to append to these values without stomping the pre-set
+# values.
+PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
# be able to build extension modules using the directories specified in the
# environment variables
-CPPFLAGS= -I. -IInclude -I$(srcdir)/Include @CPPFLAGS@
-LDFLAGS= @LDFLAGS@
+PY_CPPFLAGS= -I. -IInclude -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
+PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS)
LDLAST= @LDLAST@
SGI_ABI= @SGI_ABI@
CCSHARED= @CCSHARED@
@@ -76,7 +84,7 @@ ARFLAGS= @ARFLAGS@
# Extra C flags added for building the interpreter object files.
CFLAGSFORSHARED=@CFLAGSFORSHARED@
# C flags used for building the interpreter object files
-PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
+PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
# Machine-dependent subdirectories
@@ -98,18 +106,19 @@ MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
SCRIPTDIR= $(prefix)/lib
+ABIFLAGS= @ABIFLAGS@
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
-LIBP= $(LIBDIR)/python$(VERSION)
+INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION)
+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
# Symbols used for using shared libraries
SO= @SO@
-LDSHARED= @LDSHARED@
-BLDSHARED= @BLDSHARED@
+LDSHARED= @LDSHARED@ $(PY_LDFLAGS)
+BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS)
+LDCXXSHARED= @LDCXXSHARED@
DESTSHARED= $(BINLIBDEST)/lib-dynload
# Executable suffix (.exe on Windows and Mac OS X)
@@ -148,7 +157,7 @@ CONFIG_ARGS= @CONFIG_ARGS@
SRCDIRS= @SRCDIRS@
# Other subdirectories
-SUBDIRSTOO= Include Lib Misc Demo
+SUBDIRSTOO= Include Lib Misc
# Files and directories to be distributed
CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
@@ -160,6 +169,7 @@ DIST= $(DISTFILES) $(DISTDIRS)
LIBRARY= @LIBRARY@
LDLIBRARY= @LDLIBRARY@
BLDLIBRARY= @BLDLIBRARY@
+PY3LIBRARY= @PY3LIBRARY@
DLLLIBRARY= @DLLLIBRARY@
LDLIBRARYDIR= @LDLIBRARYDIR@
INSTSONAME= @INSTSONAME@
@@ -217,6 +227,8 @@ GRAMMAR_C= $(srcdir)/Python/graminit.c
GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
+LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+
##########################################################################
# Parser
PGEN= Parser/pgen$(EXE)
@@ -238,7 +250,9 @@ PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o
PGOBJS= \
Objects/obmalloc.o \
+ Python/dynamic_annotations.o \
Python/mysnprintf.o \
+ Python/pyctype.o \
Parser/tokenizer_pgen.o \
Parser/printgrammar.o \
Parser/pgenmain.o
@@ -282,6 +296,7 @@ PYTHON_OBJS= \
Python/ceval.o \
Python/compile.o \
Python/codecs.o \
+ Python/dynamic_annotations.o \
Python/errors.o \
Python/frozen.o \
Python/frozenmain.o \
@@ -305,6 +320,7 @@ PYTHON_OBJS= \
Python/pymath.o \
Python/pystate.o \
Python/pythonrun.o \
+ Python/pytime.o \
Python/structmember.o \
Python/symtable.o \
Python/sysmodule.o \
@@ -314,6 +330,7 @@ PYTHON_OBJS= \
Python/pystrtod.o \
Python/dtoa.o \
Python/formatter_unicode.o \
+ Python/fileutils.o \
Python/$(DYNLOADFILE) \
$(LIBOBJS) \
$(MACHDEP_OBJS) \
@@ -330,7 +347,6 @@ OBJECT_OBJS= \
Objects/bytesobject.o \
Objects/cellobject.o \
Objects/classobject.o \
- Objects/cobject.o \
Objects/codeobject.o \
Objects/complexobject.o \
Objects/descrobject.o \
@@ -378,7 +394,7 @@ LIBRARY_OBJS= \
# Default target
all: build_all
-build_all: $(BUILDPYTHON) oldsharedmods sharedmods
+build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed
# Compile a binary with gcc profile guided optimization.
profile-opt:
@@ -408,20 +424,18 @@ coverage:
# Build the interpreter
-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
- $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
- Modules/python.o \
- $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
+ $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
platform: $(BUILDPYTHON)
- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
+ $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
# Build the shared modules
sharedmods: $(BUILDPYTHON)
@case $$MAKEFLAGS in \
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
esac
# Build static library
@@ -436,20 +450,34 @@ $(LIBRARY): $(LIBRARY_OBJS)
$(AR) $(ARFLAGS) $@ $(MODOBJS)
$(RANLIB) $@
-libpython$(VERSION).so: $(LIBRARY_OBJS)
+libpython$(LDVERSION).so: $(LIBRARY_OBJS)
if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(BLDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
$(LN) -f $(INSTSONAME) $@; \
else \
- $(BLDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
fi
-libpython$(VERSION).dylib: $(LIBRARY_OBJS)
- $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
-
+libpython3.so: libpython$(LDVERSION).so
+ $(BLDSHARED) -o $@ -Wl,-hl$@ $^
+
+libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
+ $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+
libpython$(VERSION).sl: $(LIBRARY_OBJS)
- $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
+ $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
+
+# Copy up the gdb python hooks into a position where they can be automatically
+# loaded by gdb during Lib/test/test_gdb.py
+#
+# Distributors are likely to want to install this somewhere else e.g. relative
+# to the stripped DWARF data for the shared library.
+gdbhooks: $(BUILDPYTHON)-gdb.py
+
+SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
+$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
+ $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
# minimal framework (not including the Lib directory and such) in the current
@@ -459,7 +487,7 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
$(LIBRARY) \
$(RESSRCDIR)/Info.plist
$(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
- $(CC) -o $(LDLIBRARY) $(LDFLAGS) -dynamiclib \
+ $(CC) -o $(LDLIBRARY) $(PY_LDFLAGS) -dynamiclib \
-all_load $(LIBRARY) -Wl,-single_module \
-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
-compatibility_version $(VERSION) \
@@ -471,14 +499,13 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
$(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
- $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
$(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
# This rule builds the Cygwin Python DLL and import library if configured
# for a shared core library; otherwise, this rule is a noop.
$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
if test -n "$(DLLLIBRARY)"; then \
- $(LDSHARED) $(LDFLAGS) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
+ $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
$(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \
else true; \
fi
@@ -512,6 +539,9 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist
echo "-----------------------------------------------"; \
fi
+Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
+ $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+
############################################################################
# Special rules for object files
@@ -522,7 +552,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
$(SIGNAL_OBJS) \
$(MODOBJS) \
$(srcdir)/Modules/getbuildinfo.c
- $(CC) -c $(PY_CFLAGS) \
+ $(CC) -c $(PY_CORE_CFLAGS) \
-DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" \
-DHGVERSION="\"`LC_ALL=C $(HGVERSION)`\"" \
-DHGTAG="\"`LC_ALL=C $(HGTAG)`\"" \
@@ -530,7 +560,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
-o $@ $(srcdir)/Modules/getbuildinfo.c
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
- $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
+ $(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
-DPREFIX='"$(prefix)"' \
-DEXEC_PREFIX='"$(exec_prefix)"' \
-DVERSION='"$(VERSION)"' \
@@ -538,7 +568,17 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
-o $@ $(srcdir)/Modules/getpath.c
Modules/python.o: $(srcdir)/Modules/python.c
- $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
+ $(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Modules/python.c
+
+Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
+ $(CC) -c $(PY_CORE_CFLAGS) \
+ -DSOABI='"$(SOABI)"' \
+ -o $@ $(srcdir)/Python/dynload_shlib.c
+
+Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
+ $(CC) -c $(PY_CORE_CFLAGS) \
+ -DABIFLAGS='"$(ABIFLAGS)"' \
+ -o $@ $(srcdir)/Python/sysmodule.c
$(IO_OBJS): $(IO_H)
@@ -550,7 +590,7 @@ Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
-touch Parser/pgen.stamp
$(PGEN): $(PGENOBJS)
- $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
+ $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
Parser/grammar.o: $(srcdir)/Parser/grammar.c \
$(srcdir)/Include/token.h \
@@ -570,10 +610,10 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
Python/getplatform.o: $(srcdir)/Python/getplatform.c
- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
+ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
Python/importdl.o: $(srcdir)/Python/importdl.c
- $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
$(srcdir)/Objects/unicodetype_db.h
@@ -586,6 +626,7 @@ BYTESTR_DEPS = \
$(srcdir)/Objects/stringlib/fastsearch.h \
$(srcdir)/Objects/stringlib/find.h \
$(srcdir)/Objects/stringlib/partition.h \
+ $(srcdir)/Objects/stringlib/split.h \
$(srcdir)/Objects/stringlib/stringdefs.h \
$(srcdir)/Objects/stringlib/string_format.h \
$(srcdir)/Objects/stringlib/transmogrify.h \
@@ -594,7 +635,7 @@ BYTESTR_DEPS = \
Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
-Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS)
+Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS)
Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
$(BYTESTR_DEPS)
@@ -602,12 +643,15 @@ Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES)
$(OPCODETARGETGEN) $(OPCODETARGETS_H)
-Python/ceval.o: $(OPCODETARGETS_H)
+Python/ceval.o: $(OPCODETARGETS_H) Python/ceval_gil.h
Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
$(BYTESTR_DEPS) \
$(srcdir)/Objects/stringlib/formatter.h
+Objects/typeobject.o: $(srcdir)/Objects/typeslots.inc
+$(srcdir)/Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py
+ $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > $(srcdir)/Objects/typeslots.inc
############################################################################
# Header files
@@ -627,7 +671,6 @@ PYTHON_HEADERS= \
Include/cellobject.h \
Include/ceval.h \
Include/classobject.h \
- Include/cobject.h \
Include/code.h \
Include/codecs.h \
Include/compile.h \
@@ -635,10 +678,12 @@ PYTHON_HEADERS= \
Include/descrobject.h \
Include/dictobject.h \
Include/dtoa.h \
+ Include/dynamic_annotations.h \
Include/enumobject.h \
Include/errcode.h \
Include/eval.h \
Include/fileobject.h \
+ Include/fileutils.h \
Include/floatobject.h \
Include/frameobject.h \
Include/funcobject.h \
@@ -665,6 +710,7 @@ PYTHON_HEADERS= \
Include/pgen.h \
Include/pgenheaders.h \
Include/pyarena.h \
+ Include/pyatomic.h \
Include/pycapsule.h \
Include/pyctype.h \
Include/pydebug.h \
@@ -679,6 +725,7 @@ PYTHON_HEADERS= \
Include/pystrtod.h \
Include/pythonrun.h \
Include/pythread.h \
+ Include/pytime.h \
Include/rangeobject.h \
Include/setobject.h \
Include/sliceobject.h \
@@ -710,7 +757,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
TESTOPTS= -l $(EXTRATESTOPTS)
TESTPROG= $(srcdir)/Lib/test/regrtest.py
-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -bb $(TESTPYTHONOPTS)
+TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -E -bb $(TESTPYTHONOPTS)
test: all platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
@@ -742,7 +789,7 @@ buildbottest: all platform
-@if which pybuildbot.identify >/dev/null 2>&1; then \
pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
fi
- $(TESTPYTHON) $(TESTPROG) -uall -rw $(TESTOPTS)
+ $(TESTPYTHON) $(TESTPROG) -uall -rwW $(TESTOPTS)
QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
test_multibytecodec test_urllib2_localnet test_itertools \
@@ -797,7 +844,13 @@ altbininstall: $(BUILDPYTHON)
else true; \
fi; \
done
- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
+ $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE)
+ -if test "$(VERSION)" != "$(LDVERSION)"; then \
+ if test -f $(DESTDIR)$(BINDIR)/$(PYTHON)$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON)$(VERSION)$(EXE); \
+ then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
+ fi; \
+ (cd $(DESTDIR)$(BINDIR); $(LN) python$(LDVERSION)$(EXE) python$(VERSION)$(EXE)); \
+ fi
if test -f $(LDLIBRARY); then \
if test -n "$(DLLLIBRARY)" ; then \
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
@@ -807,6 +860,9 @@ altbininstall: $(BUILDPYTHON)
(cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
fi \
fi; \
+ if test -n "$(PY3LIBRARY)"; then \
+ $(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \
+ fi; \
else true; \
fi
@@ -816,10 +872,22 @@ bininstall: altbininstall
else true; \
fi
(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)3$(EXE))
+ -if test "$(VERSION)" != "$(LDVERSION)"; then \
+ rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config; \
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config); \
+ rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION).pc; \
+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python-$(LDVERSION).pc); \
+ fi
-rm -f $(DESTDIR)$(BINDIR)/python3-config
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config)
-rm -f $(DESTDIR)$(LIBPC)/python3.pc
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
+ -rm -f $(DESTDIR)$(BINDIR)/idle3
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
+ -rm -f $(DESTDIR)$(BINDIR)/pydoc3
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
+ -rm -f $(DESTDIR)$(BINDIR)/2to3
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
# Install the manual page
maninstall:
@@ -840,12 +908,12 @@ EXTRAPLATDIR= @EXTRAPLATDIR@
MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
- tkinter/test/test_ttk site-packages test test/data \
- test/decimaltestdata \
- test/tracedmodules \
- encodings \
+ tkinter/test/test_ttk site-packages test \
+ test/decimaltestdata test/xmltestdata test/subprocessdata \
+ test/tracedmodules test/encoded_modules \
+ concurrent concurrent/futures encodings \
email email/mime email/test email/test/data \
- html json json/tests http dbm xmlrpc \
+ html json test/json_tests http dbm xmlrpc \
sqlite3 sqlite3/test \
logging csv wsgiref urllib \
lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
@@ -855,8 +923,9 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
importlib importlib/test importlib/test/builtin \
importlib/test/extension importlib/test/frozen \
importlib/test/import_ importlib/test/source \
- setuptools setuptools/command setuptools/tests setuptools.egg-info \
+ turtledemo \
multiprocessing multiprocessing/dummy \
+ unittest unittest/test \
curses pydoc_data $(MACHDEPS)
libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
@for i in $(SCRIPTDIR) $(LIBDEST); \
@@ -878,7 +947,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
else true; \
fi; \
done
- @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
+ @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.egg-info ; \
do \
if test -x $$i; then \
$(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
@@ -945,6 +1014,11 @@ $(srcdir)/Lib/$(PLATDIR):
export EXE; EXE="$(BUILDEXE)"; \
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
+python-config: $(srcdir)/Misc/python-config.in
+ # Substitution happens here, as the completely-expanded BINDIR
+ # is not available in configure
+ sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
+
# Install the include files
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
inclinstall:
@@ -965,13 +1039,13 @@ inclinstall:
# Install the library and miscellaneous stuff needed for extending/embedding
# This goes into $(exec_prefix)
-LIBPL= $(LIBP)/config
+LIBPL= $(LIBDEST)/config-$(LDVERSION)
# pkgconfig directory
LIBPC= $(LIBDIR)/pkgconfig
-libainstall: all
- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
+libainstall: all python-config
+ @for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
do \
if test ! -d $(DESTDIR)$$i; then \
echo "Creating directory $$i"; \
@@ -1001,10 +1075,7 @@ libainstall: all
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
- # Substitution happens here, as the completely-expanded BINDIR
- # is not available in configure
- sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
+ $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
rm python-config
@if [ -s Modules/python.exp -a \
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
@@ -1062,7 +1133,7 @@ frameworkinstallstructure: $(LDLIBRARY)
else true; \
fi; \
done
- $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
+ $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
@@ -1074,31 +1145,22 @@ frameworkinstallstructure: $(LDLIBRARY)
# Install a number of symlinks to keep software that expects a normal unix
# install (which includes python-config) happy.
frameworkinstallmaclib:
- ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
- ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).dylib"
+ ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config-$(LDVERSION)/libpython$(VERSION).a"
+ ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config-$(LDVERSION)/libpython$(VERSION).dylib"
ln -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
# This installs the IDE, the Launcher and other apps into /Applications
frameworkinstallapps:
cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
-frameworkinstallapps4way:
- cd Mac && $(MAKE) installapps4way DESTDIR="$(DESTDIR)"
-
# This install the unix python and pythonw tools in /usr/local/bin
frameworkinstallunixtools:
cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
-frameworkinstallunixtools4way:
- cd Mac && $(MAKE) installunixtools4way DESTDIR="$(DESTDIR)"
-
frameworkaltinstallunixtools:
cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
-frameworkaltinstallunixtools4way:
- cd Mac && $(MAKE) altinstallunixtools4way DESTDIR="$(DESTDIR)"
-
-# This installs the Demos and Tools into the applications directory.
+# This installs the Tools into the applications directory.
# It is not part of a normal frameworkinstall
frameworkinstallextras:
cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
@@ -1124,7 +1186,7 @@ config.status: $(srcdir)/configure
# Some make's put the object file in the current directory
.c.o:
- $(CC) -c $(PY_CFLAGS) -o $@ $<
+ $(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
# Run reindent on the library
reindent:
@@ -1138,8 +1200,8 @@ recheck:
# Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
autoconf:
- (cd $(srcdir); autoconf)
- (cd $(srcdir); autoheader)
+ (cd $(srcdir); autoconf -Wall)
+ (cd $(srcdir); autoheader -Wall)
# Create a tags file for vi
tags::
@@ -1158,7 +1220,8 @@ TAGS::
# Sanitation targets -- clean leaves libraries, executables and tags
# files, which clobber removes as well
pycremoval:
- find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
+ -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
+ -find $(srcdir) -name '__pycache__' -exec rmdir {} '+'
rmtestturds:
-rm -f *BAD *GOOD *SKIPPED
@@ -1193,9 +1256,14 @@ clobber: clean profile-removal
# remove all generated files, even Makefile[.pre]
# Keep configure and Python-ast.[ch], it's possible they can't be generated
distclean: clobber
+ for file in Lib/test/data/* ; do \
+ if test "$$file" != "Lib/test/data/README"; then rm "$$file"; fi; \
+ done
-rm -f core Makefile Makefile.pre config.status \
Modules/Setup Modules/Setup.local Modules/Setup.config \
Modules/ld_so_aix Modules/python.exp Misc/python.pc
+ -rm -f python*-gdb.py
+ -rm -f pybuilddir.txt
find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
-o -name '[@,#]*' -o -name '*.old' \
-o -name '*.orig' -o -name '*.rej' \
@@ -1214,7 +1282,7 @@ funny:
-o -type d \
-o -name '*.[chs]' \
-o -name '*.py' \
- -o -name '*.doc' \
+ -o -name '*.pyw' \
-o -name '*.dat' \
-o -name '*.el' \
-o -name '*.fd' \
@@ -1226,20 +1294,18 @@ funny:
-o -name '*.xpm' \
-o -name '*.uue' \
-o -name '*.decTest' \
- -o -name '*,[vpt]' \
+ -o -name '*.tmCommand' \
+ -o -name '*.tmSnippet' \
-o -name 'Setup' \
-o -name 'Setup.*' \
-o -name regen \
-o -name README \
+ -o -name NEWS \
+ -o -name HISTORY \
-o -name Makefile \
-o -name ChangeLog \
- -o -name Repository \
- -o -name Root \
- -o -name Entries \
- -o -name Tag \
- -o -name tags \
- -o -name TAGS \
- -o -name .cvsignore \
+ -o -name .hgignore \
+ -o -name .bzrignore \
-o -name MANIFEST \
-o -print
@@ -1257,7 +1323,11 @@ Python/thread.o: @THREADHEADERS@
.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
-.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
+.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
.PHONY: smelly funny patchcheck
+.PHONY: gdbhooks
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+# Local Variables:
+# mode: makefile
+# End:
diff --git a/Misc/ACKS b/Misc/ACKS
index 59b3661539..efbd30bae9 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -12,19 +12,27 @@ PS: In the standard Python distribution, this file is encoded in UTF-8
and the list is in rough alphabetical order by last names.
David Abrahams
+Ron Adam
Jim Ahlstrom
Farhan Ahmad
+Matthew Ahrens
+Nir Aides
Yaniv Aknin
Jyrki Alakuijala
+Ray Allen
Billy G. Allie
Kevin Altis
Joe Amenta
Mark Anacker
+Shashwat Anand
Anders Andersen
John Anderson
Erik Andersén
Oliver Andrich
Ross Andrus
+Jon Anglin
+Éric Araujo
+Alicia Arlen
Jason Asbahr
David Ascher
Chris AtLee
@@ -41,6 +49,7 @@ Luigi Ballabio
Jeff Balogh
Matt Bandy
Michael J. Barber
+Nicolas Bareil
Chris Barker
Nick Barnes
Quentin Barnes
@@ -74,6 +83,7 @@ Steven Bethard
Stephen Bevan
Ron Bickers
Natalia B. Bidart
+Adrian von Bidder
David Binger
Dominic Binks
Philippe Biondi
@@ -89,19 +99,24 @@ Paul Boddie
Matthew Boedicker
David Bolen
Forest Bond
+Gawain Bolton
Gregory Bond
Jurjen Bos
Peter Bosch
Eric Bouck
Thierry Bousch
Sebastian Boving
+Jeff Bradberry
Monty Brandenberg
Georg Brandl
Christopher Brannon
Terrence Brannon
+Brian Brazil
Dave Brennan
Tom Bridgman
+Tobias Brink
Richard Brodie
+Michael Broghton
Daniel Brotsky
Jean Brouwers
Gary S. Brown
@@ -126,6 +141,7 @@ Mike Carlton
Terry Carroll
Lorenzo M. Catucci
Donn Cave
+Charles Cazabon
Per Cederqvist
Octavian Cerna
Pascal Chambon
@@ -142,6 +158,7 @@ Michael Chermside
Albert Chin-A-Young
Adal Chiriliuc
Matt Chisholm
+Anders Chrigström
Tom Christiansen
Vadim Chugunov
David Cinege
@@ -155,10 +172,14 @@ Dave Cole
Terrence Cole
Benjamin Collar
Jeffery Collins
+Robert Collins
Paul Colomiets
Denver Coneybeare
+Geremy Condra
+Juan José Conti
Matt Conway
David M. Cooke
+Jason R. Coombs
Greg Copeland
Aldo Cortesi
David Costanzo
@@ -176,6 +197,8 @@ Drew Csillag
Joaquin Cuenca Abela
John Cugini
Tom Culliton
+Antonio Cuni
+Brian Curtin
Lisandro Dalcin
Andrew Dalke
Lars Damerow
@@ -191,6 +214,7 @@ Arnaud Delobelle
Erik Demaine
Roger Dev
Raghuram Devarakonda
+Caleb Deveraux
Catherine Devlin
Scott Dial
Toby Dickenson
@@ -202,6 +226,7 @@ Yves Dionne
Daniel Dittmar
Jaromir Dolecek
Ismail Donmez
+Marcos Donolo
Dima Dorfman
Yves Dorfsman
Cesar Douady
@@ -222,10 +247,12 @@ Josip Dzolonga
Maxim Dzumanenko
Walter Dörwald
Hans Eckardt
+Rodolpho Eckhardt
Grant Edwards
John Ehresman
Eric Eisner
Andrew Eland
+Julien Élie
Lance Ellinghaus
David Ely
Jeff Epler
@@ -250,6 +277,7 @@ Troy J. Farrell
Mark Favas
Niels Ferguson
Sebastian Fernandez
+Florian Festi
Vincent Fiack
Tomer Filiba
Jeffrey Finkelstein
@@ -296,6 +324,7 @@ Dinu Gherman
Jonathan Giddy
Johannes Gijsbers
Michael Gilfix
+Christoph Gohlke
Tim Golden
Chris Gonnerman
David Goodger
@@ -303,6 +332,7 @@ Hans de Graaff
Eddy De Greef
Duncan Grisby
Fabian Groffen
+Eric Groo
Dag Gruneau
Filip Gruszczyński
Michael Guravage
@@ -324,6 +354,7 @@ Barry Hantman
Lynda Hardman
Derek Harland
Jason Harper
+Brian Harring
Larry Hastings
Shane Hathaway
Rycharde Hawkes
@@ -347,6 +378,7 @@ Kevan Heydon
Jason Hildebrand
Richie Hindle
Konrad Hinsen
+Michael Henry
David Hobley
Tim Hochberg
Joerg-Cyril Hoehle
@@ -386,8 +418,9 @@ Tony Ingraldi
John Interrante
Bob Ippolito
Atsuo Ishimoto
-Paul Jackson
+Adam Jackson
Ben Jackson
+Paul Jackson
David Jacobs
Kevin Jacobs
Kjetil Jacobsen
@@ -397,7 +430,7 @@ Jack Jansen
Bill Janssen
Drew Jenkins
Flemming Kjær Jensen
-Jiba
+MunSic Jeong
Orjan Johansen
Fredrik Johansson
Gregory K. Johnson
@@ -418,8 +451,10 @@ Bob Kahn
Kurt B. Kaiser
Tamito Kajiyama
Peter van Kampen
+Rafe Kaplan
Jacob Kaplan-Moss
-Piotr Kasprzyk
+Jan Kaliszewski
+Arkady Koplyarov
Lou Kates
Hiroaki Kawai
Sebastien Keim
@@ -437,6 +472,7 @@ Paul Kippes
Steve Kirsch
Sebastian Kirsche
Ron Klatchko
+Reid Kleckner
Bastian Kleineidam
Bob Kline
Matthias Klose
@@ -445,8 +481,10 @@ Lenny Kneler
Pat Knight
Greg Kochanski
Damon Kohler
+Vlad Korolev
Joseph Koshy
Maksim Kozyarchuk
+Stefan Krah
Bob Kras
Holger Krekel
Michael Kremer
@@ -458,6 +496,8 @@ Andrew Kuchling
Vladimir Kushnir
Ross Lagerwall
Cameron Laird
+Jean-Baptiste "Jiba" Lamy
+Torsten Landschoff
Åukasz Langa
Tino Lange
Andrew Langmead
@@ -478,6 +518,7 @@ Luc Lefebvre
Vincent Legoll
Kip Lehman
Joerg Lehmann
+Robert Lehmann
Luke Kenneth Casson Leighton
Marc-Andre Lemburg
John Lenton
@@ -522,6 +563,7 @@ David Marek
Doug Marien
Alex Martelli
Anthony Martin
+Owen Martin
Sébastien Martini
Roger Masse
Nick Mathewson
@@ -541,6 +583,7 @@ Craig McPheeters
Lambert Meertens
Bill van Melle
Lucas Prado Melo
+Ezio Melotti
Brian Merrell
Luke Mewburn
Mike Meyer
@@ -562,9 +605,11 @@ Skip Montanaro
Paul Moore
Derek Morr
James A Morrison
+Pablo Mouzo
Sjoerd Mullender
Sape Mullender
Michael Muller
+Neil Muller
R. David Murray
Piotr Meyer
John Nagle
@@ -582,6 +627,7 @@ Samuel Nicolary
Gustavo Niemeyer
Oscar Nierstrasz
Hrvoje Niksic
+Gregory Nofi
Jesse Noller
Bill Noon
Stefan Norberg
@@ -636,6 +682,7 @@ Neale Pickett
Jim St. Pierre
Dan Pierson
Martijn Pieters
+Anand B. Pillai
François Pinard
Zach Pincus
Michael Piotrowski
@@ -651,12 +698,14 @@ Donovan Preston
Steve Purcell
Fernando Pérez
Eduardo Pérez
+Pierre Quentel
Brian Quinlan
Anders Qvist
Burton Radons
Brodie Rao
Antti Rasinen
Sridhar Ratnakumar
+Ysj Ray
Eric Raymond
Edward K. Ream
Chris Rebert
@@ -664,6 +713,7 @@ Marc Recht
John Redford
Terry Reedy
Steve Reeves
+Lennart Regebro
Ofir Reichenberg
Sean Reifschneider
Michael P. Reilly
@@ -671,6 +721,7 @@ Bernhard Reiter
Steven Reiz
Roeland Rengelink
Tim Rice
+Francesco Ricciardi
Jan Pieter Riegel
Armin Rigo
Nicholas Riley
@@ -680,6 +731,7 @@ Anthony Roach
Mark Roberts
Jim Robinson
Andy Robinson
+Mark Roddy
Kevin Rodgers
Giampaolo Rodola
Mike Romberg
@@ -696,6 +748,7 @@ Craig Rowland
Clinton Roy
Paul Rubin
Sam Ruby
+Demur Rumed
Audun S. Runde
Rauli Ruohonen
Jeff Rush
@@ -707,14 +760,17 @@ Hajime Saitou
George Sakkis
Rich Salz
Kevin Samborn
+Adrian Sampson
Ilya Sandler
Mark Sapiro
Ty Sarna
Ben Sayer
+Andrew Schaaf
Michael Scharf
Andreas Schawo
Neil Schemenauer
David Scherer
+Bob Schmertz
Gregor Schmid
Ralf Schmitt
Michael Schneider
@@ -729,6 +785,7 @@ Steven Scott
Barry Scott
Nick Seidenman
Žiga Seilnach
+Yury Selivanov
Fred Sells
Jiwon Seo
Roger D. Serwy
@@ -736,6 +793,7 @@ Jerry Seutter
Denis Severson
Ian Seyer
Ha Shao
+Richard Shapiro
Bruce Sherwood
Alexander Shigin
Pete Shinners
@@ -789,6 +847,7 @@ Paul Swartz
Thenault Sylvain
Péter Szabó
Arfrever Frehtes Taifersar Arahesis
+Neil Tallim
Geoff Talvola
Musashi Tamura
William Tanksley
@@ -796,11 +855,14 @@ Christian Tanzer
Steven Taschuk
Monty Taylor
Amy Taylor
+Anatoly Techtonik
Mikhail Terekhov
Tobias Thelen
James Thomas
Robin Thomas
+Jeremy Thurgood
Eric Tiedemann
+July Tikhonov
Tracy Tims
Oren Tirosh
Jason Tishler
@@ -808,6 +870,7 @@ Christian Tismer
Frank J. Tobin
R Lindsay Todd
Bennett Todd
+Matias Torchinsky
Sandro Tosi
Richard Townsend
Laurence Tratt
@@ -815,18 +878,23 @@ John Tromp
Jason Trowbridge
Anthony Tuininga
Stephen Turner
+Theodore Turocy
Bill Tutt
Doobee R. Tzeck
Eren Türkay
Lionel Ulmer
Roger Upole
+Daniel Urban
Michael Urman
Hector Urtubia
Andi Vajda
+Case Van Horsen
Kyle VanderBeek
+Andrew Vant
Atul Varma
Dmitry Vasiliev
Alexandre Vassalotti
+Nadeem Vawda
Frank Vercruesse
Mike Verdone
Jaap Vermeulen
@@ -843,6 +911,7 @@ Wojtek Walczak
Charles Waldman
Richard Walker
Larry Wall
+Kevin Walzer
Rodrigo Steinmuller Wanderley
Greg Ward
Barry Warsaw
@@ -877,7 +946,9 @@ Collin Winter
Dik Winter
Blake Winton
Jean-Claude Wippler
+Frank Wierzbicki
Lars Wirzenius
+John Wiseman
Chris Withers
Stefan Witzel
Irek Wlizlo
@@ -890,6 +961,7 @@ Gordon Worley
Thomas Wouters
Heiko Wundram
Doug Wyatt
+Florent Xicluna
Hirokazu Yamamoto
Ka-Ping Yee
Bob Yodlowski
@@ -902,6 +974,7 @@ Milan Zamazal
Artur Zaprzala
Mike Zarnstorff
Siebren van der Zee
+Yuxiao Zeng
Uwe Zessin
Kai Zhu
Tarek Ziadé
diff --git a/Misc/NEWS b/Misc/NEWS
index 2e31693975..1f48a14d44 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2,19 +2,31 @@
Python News
+++++++++++
-What's New in Python 3.1.4?
+What's New in Python 3.2.1?
===========================
-*Release date: XXXX-XX-XX*
+*Release date: XX-XXX-20XX*
Core and Builtins
-----------------
+- Issue #1856: Avoid crashes and lockups when daemon threads run while the
+ interpreter is shutting down; instead, these threads are now killed when
+ they try to take the GIL.
+
- Issue #9756: When calling a method descriptor or a slot wrapper descriptor,
the check of the object type doesn't read the __class__ attribute anymore.
Fix a crash if a class override its __class__ attribute (e.g. a proxy of the
str type). Patch written by Andreas Stührk.
+- Issue #10914: Initialize correctly the filesystem codec when creating a new
+ subinterpreter to fix a bootstrap issue with codecs implemented in Python, as
+ the ISO-8859-15 codec.
+
+- Issue #10517: After fork(), reinitialize the TLS used by the PyGILState_*
+ APIs, to avoid a crash with the pthread implementation in RHEL 5. Patch
+ by Charles-François Natali.
+
- Issue #6780: fix starts/endswith error message to mention that tuples are
accepted too.
@@ -22,46 +34,51 @@ Core and Builtins
between narrow and wide builds while optimizing BINARY_SUBSCR on non-BMP
chars (e.g. "\U00012345"[0]).
+- Issue #11845: Fix typo in rangeobject.c that caused a crash in
+ compute_slice_indices. Patch by Daniel Urban.
+
- Issue #11650: PyOS_StdioReadline() retries fgets() if it was interrupted
(EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch
written by Charles-Francois Natali.
-- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
- doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
- (length bigger than 2^31-1 bytes).
+- Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes on
+ Windows if the file is a TTY to workaround a Windows bug. The Windows console
+ returns an error (12: not enough space error) on writing into stdout if
+ stdout mode is binary and the length is greater than 66,000 bytes (or less,
+ depending on heap usage).
+
+- Issue #11320: fix bogus memory management in Modules/getpath.c, leading to
+ a possible crash when calling Py_SetPath().
+
+- Issue #11510: Fixed optimizer bug which turned "a,b={1,1}" into "a,b=(1,1)".
+
+- Issue #11432: A bug was introduced in subprocess.Popen on posix systems with
+ 3.2.0 where the stdout or stderr file descriptor being the same as the stdin
+ file descriptor would raise an exception. webbrowser.open would fail. fixed.
- Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
there are many tags (e.g. when using mq). Patch by Nadeem Vawda.
-- Issue #10451: memoryview objects could allow to mutate a readable buffer.
- Initial patch by Ross Lagerwall.
+- Issue #11246: Fix PyUnicode_FromFormat("%V") to decode the byte string from
+ UTF-8 (with replace error handler) instead of ISO-8859-1 (in strict mode).
+ Patch written by Ray Allen.
-- Issue #10892: Don't segfault when trying to delete __abstractmethods__ from a
- class.
+- Issue #11286: Raise a ValueError from calling PyMemoryView_FromBuffer with
+ a buffer struct having a NULL data pointer.
-- Issue #8020: Avoid a crash where the small objects allocator would read
- non-Python managed memory while it is being modified by another thread.
- Patch by Matt Bandy.
-
-- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
- can now handle dates after 2038.
+- Issue #11272: On Windows, input() strips '\r' (and not only '\n'), and
+ sys.stdin uses universal newline (replace '\r\n' by '\n').
- issue #11828: startswith and endswith don't accept None as slice index.
Patch by Torsten Becker.
-- Issue #4236: PyModule_Create2 now checks the import machinery directly
- rather than the Py_IsInitialized flag, avoiding a Fatal Python
- error in certain circumstances when an import is done in __del__.
+- Issue #10830: Fix PyUnicode_FromFormatV("%c") for non-BMP characters on
+ narrow build.
-- Issue #10596: Fix float.__mod__ to have the same behaviour as
- float.__divmod__ with respect to signed zeros. -4.0 % 4.0 should be
- 0.0, not -0.0.
+- Check for NULL result in PyType_FromSpec.
-- Issue #5587: add a repr to dict_proxy objects. Patch by David Stanek and
- Daniel Urban.
-
-- Issue #11506: Trying to assign to a bytes literal should result in a
- SyntaxError.
+- Issue #11386: bytearray.pop() now throws IndexError when the bytearray is
+ empty, instead of OverflowError.
Library
-------
@@ -70,13 +87,29 @@ Library
detect mtime changes by comparing to the system clock instead of to the
previous value of the mtime.
-- Issue #10684: shutil.move used to delete a folder on case insensitive
- filesystems when the source and destination name where the same except
- for the case.
+- ntpath.samefile failed to notice that "a.txt" and "A.TXT" refer to the same
+ file on Windows XP. As noticed in issue #10684.
+
+- Issue #12000: When a SSL certificate has a subjectAltName without any
+ dNSName entry, ssl.match_hostname() should use the subject's commonName.
+ Patch by Nicolas Bareil.
+
+- Issue #11647: objects created using contextlib.contextmanager now support
+ more than one call to the function when used as a decorator. Initial patch
+ by Ysj Ray.
+
+- logging: don't define QueueListener if Python has no thread support.
+
+- functools.cmp_to_key() now works with collections.Hashable().
- Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get
around a mmap bug with sparse files. Patch written by Steffen Daode Nurpmeso.
+- Issue #11858: configparser.ExtendedInterpolation expected lower-case section
+ names.
+
+- Issue #11324: ConfigParser(interpolation=None) now works correctly.
+
- Issue #11763: don't use difflib in TestCase.assertMultiLineEqual if the
strings are too long.
@@ -86,18 +119,25 @@ Library
Py_AddPendingCall() for the first signal to fix a deadlock on reentrant or
parallel calls. PyErr_SetInterrupt() writes also into the wake up file.
-- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
- specific part only digits. Patch by Santoso Wijaya.
+- Issue #11492: fix several issues with header folding in the email package.
+
+- Issue #11852: Add missing imports and update tests.
- Issue #11875: collections.OrderedDict's __reduce__ was temporarily
mutating the object instead of just working on a copy.
+- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
+ specific part only digits. Patch by Santoso Wijaya.
+
- collections.Counter().copy() now works correctly for subclasses.
- Issue #11474: Fix the bug with url2pathname() handling of '/C|/' on Windows.
Patch by Santoso Wijaya.
-- Issue #9233: Fix json to work properly even when _json is not available.
+- Issue #9233: Fix json.loads('{}') to return a dict (instead of a list), when
+ _json is not available.
+
+- Issue #11830: Remove unnecessary introspection code in the decimal module.
- Issue #11703: urllib2.geturl() does not return correct url when the original
url contains #fragment.
@@ -108,8 +148,33 @@ Library
- Issue #5162: Treat services like frozen executables to allow child spawning
from multiprocessing.forking on Windows.
+- Issue #11814: Fix likely typo in multiprocessing.Pool._terminate().
+
+- Issue #11747: Fix range formatting in difflib.context_diff() and
+ difflib.unified_diff().
+
+- Issue #8428: Fix a race condition in multiprocessing.Pool when terminating
+ worker processes: new processes would be spawned while the pool is being
+ shut down. Patch by Charles-François Natali.
+
+- Issue #7311: fix html.parser to accept non-ASCII attribute values.
+
+- Issue #11605: email.parser.BytesFeedParser was incorrectly converting multipart
+ subpararts with an 8bit CTE into unicode instead of preserving the bytes.
+
- Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.
+- Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve
+ private keys.
+
+- sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not
+ called yet: detect bootstrap (startup) issues earlier.
+
+- Issue #11618: Fix the timeout logic in threading.Lock.acquire() under Windows.
+
+- Issue #11256: Fix inspect.getcallargs on functions that take only keyword
+ arguments.
+
- Issue #11696: Fix ID generation in msilib.
- Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when
@@ -119,23 +184,43 @@ Library
are now zeroed on creation. This matches the behaviour specified by the
documentation.
-- Issue #7639: Fix short file name generation in bdist_msi.
+- Issue #7639: Fix short file name generation in bdist_msi
- Issue #11659: Fix ResourceWarning in test_subprocess introduced by #11459.
Patch by Ben Hayden.
+- Issue #11635: Don't use polling in worker threads and processes launched by
+ concurrent.futures.
+
+- Issue #11628: cmp_to_key generated class should use __slots__
+
+- Issue #11666: let help() display named tuple attributes and methods
+ that start with a leading underscore.
+
- Issue #11662: Make urllib and urllib2 ignore redirections if the
scheme is not HTTP, HTTPS or FTP (CVE-2011-1521).
- Issue #5537: Fix time2isoz() and time2netscape() functions of
httplib.cookiejar for expiration year greater than 2038 on 32-bit systems.
+- Issue #11563: Connection:close header is sent by requests using URLOpener
+ class which helps in closing of sockets after connection is over. Patch
+ contributions by Jeff McNeil and Nadeem Vawda.
+
- Issue #11459: A ``bufsize`` value of 0 in subprocess.Popen() really creates
unbuffered pipes, such that select() works properly on them.
- Issue #5421: Fix misleading error message when one of socket.sendto()'s
arguments has the wrong type. Patch by Nikita Vetoshkin.
+- Issue #10979: unittest stdout buffering now works with class and module
+ setup and teardown.
+
+- Issue #11577: fix ResourceWarning triggered by improved binhex test coverage
+
+- Issue #11243: fix the parameter querying methods of Message to work if
+ the headers contain un-encoded non-ASCII data.
+
- Issue #11401: fix handling of headers with no value; this fixes a regression
relative to Python2 and the result is now the same as it was in Python2.
@@ -143,6 +228,12 @@ Library
which was a regression relative to Python2. Unlike Python2, the last line
of the folded body now ends with a carriage return.
+- Issue #11560: shutil.unpack_archive now correctly handles the format
+ parameter. Patch by Evan Dandrea.
+
+- Issue #11133: fix two cases where inspect.getattr_static can trigger code
+ execution. Patch by Andreas Stührk.
+
- Issue #11569: use absolute path to the sysctl command in multiprocessing to
ensure that it will be found regardless of the shell PATH. This ensures
that multiprocessing.cpu_count works on default installs of MacOSX.
@@ -151,6 +242,12 @@ Library
not installed. Instead, the zipfile.ZIP_STORED compression is used to create
the ZipFile. Patch by Natalia B. Bidart.
+- Issue #11554: Fixed support for Japanese codecs; previously the body output
+ encoding was not done if euc-jp or shift-jis was specified as the charset.
+
+- Issue #11500: Fixed a bug in the os x proxy bypass code for fully qualified
+ IP addresses in the proxy exception list.
+
- Issue #11491: dbm.error is no longer raised when dbm.open is called with
the "n" as the flag argument and the file exists. The behavior matches
the documentation and general logic.
@@ -165,49 +262,265 @@ Library
``mmap.PROT_READ|mmap.PROT_EXEC`` would segfault instead of raising a
TypeError. Patch by Charles-François Natali.
+- Issue #11306: mailbox in certain cases adapts to an inability to open
+ certain files in read-write mode. Previously it detected this by
+ checking for EACCES, now it also checks for EROFS.
+
- Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors
on accept(), send() and recv().
-- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
- larger than 4GB. Patch by Nadeem Vawda.
+- Issue #11326: Add the missing connect_ex() implementation for SSL sockets,
+ and make it work for non-blocking connects.
+
+- Issue #7322: Trying to read from a socket's file-like object after a timeout
+ occurred now raises an error instead of silently losing data.
+
+- Issue #10956: Buffered I/O classes retry reading or writing after a signal
+ has arrived and the handler returned successfully.
+
+- Issue #11224: Fixed a regression in tarfile that affected the file-like
+ objects returned by TarFile.extractfile() regarding performance, memory
+ consumption and failures with the stream interface.
+
+- Issue #11074: Make 'tokenize' so it can be reloaded.
- Issue #4681: Allow mmap() to work on file sizes and offsets larger than
4GB, even on 32-bit builds. Initial patch by Ross Lagerwall, adapted for
32-bit Windows.
-- email.header.Header was incorrectly encoding folding white space when
- rfc2047-encoding header values with embedded newlines, leaving them
- without folding whitespace. It now uses the continuation_ws, as it
- does for continuation lines that it creates itself.
+- Issue #11089: Fix performance issue limiting the use of ConfigParser()
+ with large config files.
-- Issue #10360: In WeakSet, do not raise TypeErrors when testing for
- membership of non-weakrefable objects.
+- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
+ larger than 4GB. Patch by Nadeem Vawda.
-- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
+- Issue #9348: Raise an early error if argparse nargs and metavar don't match.
-- Issue #11110: Fix _sqlite to not deref a NULL when module creation fails.
+- Issue #8982: Improve the documentation for the argparse Namespace object.
-- Issue #11089: Fix performance issue limiting the use of ConfigParser()
- with large config files.
+- Issue #9343: Document that argparse parent parsers must be configured before
+ their children.
+
+- Issue #9026: Fix order of argparse sub-commands in help messages.
+
+- Issue #9347: Fix formatting for tuples in argparse type= error messages.
+
+Build
+-----
+
+- Issue #11411: Fix 'make DESTDIR=' with a relative destination.
+
+- Issue #11268: Prevent Mac OS X Installer failure if Documentation
+ package had previously been installed.
+
+IDLE
+----
+
+- Issue #11718: IDLE's open module dialog couldn't find the __init__.py
+ file in a package.
+
+Tools/Demos
+-----------
+
+- Issue #11179: Make ccbench work under Python 3.1 and 2.7 again.
+
+Extensions
+----------
+
+- Issue #1838: Prevent segfault in ctypes, when _as_parameter_ on a class is set
+ to an instance of the class.
+
+Tests
+-----
+
+- Issue #11873: Change regex in test_compileall to fix occasional failures when
+ when the randomly generated temporary path happened to match the regex.
+
+- Issue #10914: Add a minimal embedding test to test_capi.
-- Issue #8275: Fix passing of callback arguments with ctypes under Win64.
- Patch by Stan Mihai.
+- Issue #11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition.
+
+- Fix possible "file already exists" error when running the tests in parallel.
+
+- Issue #11719: Fix message about unexpected test_msilib skip on non-Windows
+ platforms. Patch by Nadeem Vawda.
+
+- Issue #11653: fix -W with -j in regrtest.
+
+- Issue #11577: improve test coverage of binhex.py. Patch by Arkady Koplyarov.
+
+- Issue #11578: added test for the timeit module. Patch Michael Henry.
+
+- Issue #11503: improve test coverage of posixpath.py. Patch by Evan Dandrea.
+
+- Issue #11505: improves test coverage of string.py. Patch by Alicia
+ Arlen.
+
+- Issue #11548: Improve test coverage of the shutil module. Patch by
+ Evan Dandrea.
+
+- Issue #11554: Reactivated test_email_codecs.
+
+- Issue #11490: test_subprocess:test_leaking_fds_on_error no longer gives a
+ false positive if the last directory in the path is inaccessible.
+
+- Issue #11223: Fix test_threadsignals to fail, not hang, when the
+ non-semaphore implementation of locks is used under POSIX.
+
+- Issue #10911: Add tests on CGI with non-ASCII characters. Patch written by
+ Pierre Quentel.
+
+- Issue #9931: Fix hangs in GUI tests under Windows in certain conditions.
+ Patch by Hirokazu Yamamoto.
+
+- Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
+ to open door files.
+
+Documentation
+-------------
+
+- Issue #11818: Fix tempfile examples for Python 3.
+
+
+What's New in Python 3.2?
+=========================
+
+*Release date: 20-Feb-2011*
+
+Core and Builtins
+-----------------
+
+- Issue #11249: Fix potential crashes when using the limited API.
+
+Build
+-----
+
+- Issue #11222: Fix non-framework shared library build on Mac OS X.
+
+- Issue #11184: Fix large-file support on AIX.
+
+- Issue #941346: Fix broken shared library build on AIX.
+
+Documentation
+-------------
+
+- Issue #10709: Add updated AIX notes in Misc/README.AIX.
+
+
+What's New in Python 3.2 Release Candidate 3?
+=============================================
+
+*Release date: 13-Feb-2011*
+
+Core and Builtins
+-----------------
+
+- Issue #11134: Add missing fields to typeslots.h.
+
+- Issue #11135: Remove redundant doc field from PyType_Spec.
+
+- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check in the limited
+ ABI.
+
+- Issue #11118: Fix bogus export of None in python3.dll.
+
+Library
+-------
+
+- Issue #11116: any error during addition of a message to a mailbox now causes a
+ rollback, instead of leaving the mailbox partially modified.
+
+- Issue #11132: Fix passing of "optimize" parameter when recursing in
+ compileall.compile_dir().
+
+- Issue #11110: Fix a potential decref of a NULL in sqlite3.
+
+- Issue #8275: Fix passing of callback arguments with ctypes under Win64. Patch
+ by Stan Mihai.
+
+Build
+-----
+
+- Issue #11079: The /Applications/Python x.x folder created by the Mac OS X
+ installers now includes a link to the installed documentation and no longer
+ includes an Extras directory. The Tools directory is now installed in the
+ framework under share/doc.
+
+- Issue #11121: Fix building with --enable-shared.
+
+Tests
+-----
+
+- Issue #10971: test_zipimport_support is once again compatible with the refleak
+ hunter feature of test.regrtest.
+
+
+What's New in Python 3.2 Release Candidate 2?
+=============================================
+
+*Release date: 30-Jan-2011*
+
+Core and Builtins
+-----------------
+
+- Issue #10451: memoryview objects could allow to mutate a readable buffer.
+ Initial patch by Ross Lagerwall.
+
+Library
+-------
+
+- Issue #9124: mailbox now accepts binary input and reads and writes mailbox
+ files in binary mode, using the email package's binary support to parse
+ arbitrary email messages. StringIO and text file input is deprecated,
+ and string input fails early if non-ASCII characters are used, where
+ previously it would fail when the email was processed in a later step.
+
+- Issue #10845: Mitigate the incompatibility between the multiprocessing
+ module on Windows and the use of package, zipfile or directory execution
+ by special casing main modules that actually *are* called __main__.py.
+
+- Issue #11045: Protect logging call against None argument.
+
+- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
+ commands.
- Issue #11053: Fix IDLE "Syntax Error" windows to behave as in 2.x,
preventing a confusing hung appearance on OS X with the windows
obscured.
-- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
- commands.
+- Issue #10940: Workaround an IDLE hang on Mac OS X 10.6 when using the
+ menu accelerators for Open Module, Go to Line, and New Indent Width.
+ The accelerators still work but no longer appear in the menu items.
+
+- Issue #10989: Fix a crash on SSLContext.load_verify_locations(None, True).
- Issue #11020: Command-line pyclbr was broken because of missing 2-to-3
conversion.
+- Issue #11019: Fixed BytesGenerator so that it correctly handles a Message
+ with a None body.
+
+- Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
+ keyword-only argument. The preceding positional argument was deprecated,
+ so it made no sense to add filter as a positional argument.
+
+- Issue #11004: Repaired edge case in deque.count().
+
- Issue #10974: IDLE no longer crashes if its recent files list includes files
with non-ASCII characters in their path names.
+- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
+ return sets instead of one returning a tuple and the other a frozenset.
+
- Issue #10987: Fix the recursion limit handling in the _pickle module.
+- Issue #10983: Fix several bugs making tunnel requests in http.client.
+
+- Issue #10955: zipimport uses ASCII encoding instead of cp437 to decode
+ filenames, at bootstrap, if the codec registry is not ready yet. It is still
+ possible to have non-ASCII filenames using the Unicode flag (UTF-8 encoding)
+ for all file entries in the ZIP file.
+
- Issue #10949: Improved robustness of rotating file handlers.
- Issue #10955: Fix a potential crash when trying to mmap() a file past its
@@ -216,24 +529,137 @@ Library
- Issue #10898: Allow compiling the posix module when the C library defines
a symbol named FSTAT.
-- Issue #10916: mmap should not segfault when a file is mapped using 0 as
- length and a non-zero offset, and an attempt to read past the end of file
- is made (IndexError is raised instead). Patch by Ross Lagerwall.
+- Issue #10980: the HTTP server now encodes headers with iso-8859-1 (latin1)
+ encoding. This is the preferred encoding of PEP 3333 and the base encoding
+ of HTTP 1.1.
-- Issue #10899: No function type annotations in the standard library.
- Removed function type annotations from _pyio.py.
+- To match the behaviour of HTTP server, the HTTP client library now also
+ encodes headers with iso-8859-1 (latin1) encoding. It was already doing
+ that for incoming headers which makes this behaviour now consistent in
+ both incoming and outgoing direction.
+
+- Issue #9509: argparse now properly handles IOErrors raised by
+ argparse.FileType.
+
+- Issue #10961: The new pydoc server now better handles exceptions raised
+ during request handling.
+
+- Issue #10680: Fix mutually exclusive arguments for argument groups in
+ argparse.
+
+Build
+-----
+
+- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
+ the system-provided Python.
+
+
+What's New in Python 3.2 Release Candidate 1
+============================================
+
+*Release date: 16-Jan-2011*
+
+Core and Builtins
+-----------------
+
+- Issue #10889: range indexing and slicing now works correctly on ranges with
+ a length that exceeds sys.maxsize.
+
+- Issue #10892: Don't segfault when trying to delete __abstractmethods__ from a
+ class.
+
+- Issue #8020: Avoid a crash where the small objects allocator would read
+ non-Python managed memory while it is being modified by another thread. Patch
+ by Matt Bandy.
+
+- Issue #10841: On Windows, set the binary mode on stdin, stdout, stderr and all
+ io.FileIO objects (to not translate newlines, \r\n <=> \n). The Python parser
+ translates newlines (\r\n => \n).
+
+- Remove buffer API from stable ABI for now, see #10181.
+
+- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
+ doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
+ (length bigger than 2^31-1 bytes).
+
+- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
+ stdprinter.write() clamp the length to 2^31-1 on Windows.
+
+- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
+ can now handle dates after 2038.
+
+- Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
+ PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the
+ filesystem encoding instead of UTF-8.
+
+- Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
+ encoding instead of UTF-8.
+
+- Add sys.flags attribute for the new -q command-line option.
+
+- Issue #11506: Trying to assign to a bytes literal should result in a
+ SyntaxError.
+
+Library
+-------
+
+- Issue #10916: mmap should not segfault when a file is mapped using 0 as length
+ and a non-zero offset, and an attempt to read past the end of file is made
+ (IndexError is raised instead). Patch by Ross Lagerwall.
+
+- Issue #10684: shutil.move used to delete a folder on case insensitive
+ filesystems when the source and destination name where the same except
+ for the case.
+
+- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5, rather
+ than the currently problematic Apple-supplied one, when running with the
+ 64-/32-bit installer variant.
+
+- Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
+ as unicode, and accept binary files. Add encoding and errors attributes to
+ cgi.FieldStorage. Patch written by Pierre Quentel (with many inputs by Glenn
+ Linderman).
+
+- Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl().
+
+- Issue #10899: No function type annotations in the standard library. Removed
+ function type annotations from _pyio.py.
- Issue #10875: Update Regular Expression HOWTO; patch by 'SilentGhost'.
-- Issue #10869: Fixed bug where ast.increment_lineno modified the root
- node twice.
+- Issue #10872: The repr() of TextIOWrapper objects now includes the mode
+ if available.
+
+- Issue #10869: Fixed bug where ast.increment_lineno modified the root node
+ twice.
- Issue #5871: email.header.Header.encode now raises an error if any
- continuation line in the formatted value has no leading white space
- and looks like a header. Since Generator uses Header to format all
- headers, this check is made for all headers in any serialized message
- at serialization time. This provides protection against header
- injection attacks.
+ continuation line in the formatted value has no leading white space and looks
+ like a header. Since Generator uses Header to format all headers, this check
+ is made for all headers in any serialized message at serialization time. This
+ provides protection against header injection attacks.
+
+- Issue #10859: Make ``contextlib.GeneratorContextManager`` officially
+ private by renaming it to ``_GeneratorContextManager``.
+
+- Issue #10042: Fixed the total_ordering decorator to handle cross-type
+ comparisons that could lead to infinite recursion.
+
+- Issue #10686: the email package now :rfc:`2047`\ -encodes headers with
+ non-ASCII bytes (parsed by a Bytes Parser) when doing conversion to 7bit-clean
+ presentation, instead of replacing them with ?s.
+
+- email.header.Header was incorrectly encoding folding white space when
+ rfc2047-encoding header values with embedded newlines, leaving them without
+ folding whitespace. It now uses the continuation_ws, as it does for
+ continuation lines that it creates itself.
+
+- Issue #1777412, #10827: Changed the rules for 2-digit years. The
+ time.asctime(), time.ctime() and time.strftime() functions will now format
+ any year when ``time.accept2dyear`` is False and will accept years >= 1000
+ otherwise. ``time.mktime`` and ``time.strftime`` now accept full range
+ supported by the OS. With Visual Studio or on Solaris, the year is limited to
+ the range [1; 9999]. Conversion of 2-digit years to 4-digit is deprecated.
- Issue #7858: Raise an error properly when os.utime() fails under Windows
on an existing file.
@@ -241,43 +667,224 @@ Library
- Issue #3839: wsgiref should not override a Content-Length header set by
the application. Initial patch by Clovis Fabricio.
+- Issue #10492: bdb.Bdb.run() only traces the execution of the code, not the
+ compilation (if the input is a string).
+
+- Issue #7995: When calling accept() on a socket with a timeout, the returned
+ socket is now always blocking, regardless of the operating system.
+
+- Issue #10756: atexit normalizes the exception before displaying it. Patch by
+ Andreas Stührk.
+
- Issue #10790: email.header.Header.append's charset logic now works correctly
for charsets whose output codec is different from its input codec.
-- Issue #6643: Reinitialize locks held within the threading module after fork
- to avoid a potential rare deadlock or crash on some platforms.
+- Issue #10819: SocketIO.name property returns -1 when its closed, instead of
+ raising a ValueError, to fix repr().
+
+- Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
+ the input buffer length doesn't fit into an unsigned int (length bigger than
+ 2^32-1 bytes).
-- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard
- file descriptors (0, 1, 2) are closed in the parent process. Initial
- patch by Ross Lagerwall.
+- Issue #6643: Reinitialize locks held within the threading module after fork to
+ avoid a potential rare deadlock or crash on some platforms.
-- Issue #10753 - Characters ';', '=' and ',' in the PATH_INFO environment
- variable won't be quoted when the URI is constructed by the wsgiref.util's
- request_uri method. According to RFC 3986, these characters can be a part of
- params in PATH component of URI and need not be quoted.
+- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard file
+ descriptors (0, 1, 2) are closed in the parent process. Initial patch by Ross
+ Lagerwall.
-- Issue #10738: Fix webbrowser.Opera.raise_opts
+- `unittest.TestCase` can be instantiated without a method name; for simpler
+ exploration from the interactive interpreter.
+
+- Issue #10798: Reject supporting concurrent.futures if the system has too
+ few POSIX semaphores.
+
+- Issue #10807: Remove base64, bz2, hex, quopri, rot13, uu and zlib codecs from
+ the codec aliases. They are still accessible via codecs.lookup().
+
+- Issue #10801: In zipfile, support different encodings for the header and the
+ filenames.
+
+- Issue #6285: IDLE no longer crashes on missing help file; patch by Scott
+ David Daniels.
+
+- Fix collections.OrderedDict.setdefault() so that it works in subclasses that
+ define __missing__().
+
+- Issue #10786: unittest.TextTestRunner default stream no longer bound at import
+ time. `sys.stderr` now looked up at instantiation time. Fix contributed by
+ Mark Roddy.
+
+- Issue #10753: Characters ';', '=' and ',' in the PATH_INFO environment variable
+ won't be quoted when the URI is constructed by the wsgiref.util's request_uri
+ method. According to RFC 3986, these characters can be a part of params in
+ PATH component of URI and need not be quoted.
+
+- Issue #10738: Fix webbrowser.Opera.raise_opts.
- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how
browsers actually parse cookies.
+- Issue #9333: os.symlink now available regardless of user privileges. The
+ function now raises OSError on Windows >=6.0 when the user is unable to create
+ symbolic links. XP and 2003 still raise NotImplementedError.
+
+- Issue #10783: struct.pack() no longer implicitly encodes unicode to UTF-8.
+
+- Issue #10730: Add SVG mime types to mimetypes module.
+
+- Issue #10768: Make the Tkinter ScrolledText widget work again.
+
+- Issue #10777: Fix "dictionary changed size during iteration" bug in
+ ElementTree register_namespace().
+
+- Issue #10626: test_logging now preserves logger disabled states.
+
+- Issue #10774: test_logging now removes temp files created during tests.
+
- Issue #5258/#10642: if site.py encounters a .pth file that generates an error,
it now prints the filename, line number, and traceback to stderr and skips
the rest of that individual file, instead of stopping processing entirely.
+- Issue #10763: subprocess.communicate() closes stdout and stderr if both are
+ pipes (bug specific to Windows).
+
+- Issue #1693546: fix email.message RFC 2231 parameter encoding to be in better
+ compliance (no "s around encoded values).
+
+- Improved the diff message in the unittest module's assertCountEqual().
+
+- Issue #1155362: email.utils.parsedate_tz now handles a missing space before
+ the '-' of a timezone field as well as before a '+'.
+
- Issue #4871: The zipfile module now gives a more useful error message if
an attempt is made to use a string to specify the archive password.
- Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only.
+- Deprecated assertDictContainsSubset() in the unittest module.
+
+C-API
+-----
+
+- Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
+ PyEval_ReleaseLock(). The thread-state aware APIs should be used instead.
+
+- Issue #10333: Remove ancient GC API, which has been deprecated since Python
+ 2.2.
+
+Build
+-----
+
+- Issue #10843: Update third-party library versions used in OS X 32-bit
+ installer builds: bzip2 1.0.6, readline 6.1.2, SQLite 3.7.4 (with FTS3/FTS4
+ and RTREE enabled), and ncursesw 5.5 (wide-char support enabled).
+
+- Issue #10820: Fix OS X framework installs to support version-specific
+ scripts (#10679).
+
+- Issue #7716: Under Solaris, don't assume existence of /usr/xpg4/bin/grep in
+ the configure script but use $GREP instead. Patch by Fabian Groffen.
+
+- Issue #10475: Don't hardcode compilers for LDSHARED/LDCXXSHARED on NetBSD
+ and DragonFly BSD. Patch by Nicolas Joly.
+
+- Issue #10679: The "idle", "pydoc" and "2to3" scripts are now installed with
+ a version-specific suffix on "make altinstall".
+
+- Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
+ timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
+ support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
+ only be present on OS X; the former is the correct one for Linux with GCC.
+
+- Issue #1099: Fix the build on MacOSX when building a framework with pydebug
+ using GCC 4.0.
+
+Tools/Demos
+-----------
+
+- Issue #10843: Install the Tools directory on OS X in the applications Extras
+ (/Applications/Python 3.n/Extras/) where the Demo directory had previous been
+ installed.
+
+- Issue #7962: The Demo directory is gone. Most of the old and unmaintained
+ demos have been removed, others integrated in documentation or a new
+ Tools/demo subdirectory.
+
+- Issue #10502: Addition of the unittestgui tool. Originally by Steve Purcell.
+ Updated for test discovery by Mark Roddy and Python 3 compatibility by Brian
+ Curtin.
+
+Tests
+-----
+
+- Fix test_startfile to wait for child process to terminate before finishing.
+
+- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
+ by Ross Lagerwall.
+
+- Make the --coverage flag work for test.regrtest.
+
+- Issue #1677694: Refactor and improve test_timeout. Original patch by
+ Björn Lindqvist.
+
+- Issue #5485: Add tests for the UseForeignDTD method of expat parser objects.
+ Patch by Jean-Paul Calderone and Sandro Tosi.
+
+- Issue #6293: Have regrtest.py echo back sys.flags. This is done by default in
+ whole runs and enabled selectively using ``--header`` when running an explicit
+ list of tests. Original patch by Collin Winter.
+
+
+What's New in Python 3.2 Beta 2?
+================================
+
+*Release date: 19-Dec-2010*
+
+Core and Builtins
+-----------------
+
+- Issue #8844: Regular and recursive lock acquisitions can now be interrupted
+ by signals on platforms using pthreads. Patch by Reid Kleckner.
+
+- Issue #4236: PyModule_Create2 now checks the import machinery directly
+ rather than the Py_IsInitialized flag, avoiding a Fatal Python
+ error in certain circumstances when an import is done in __del__.
+
+- Issue #5587: add a repr to dict_proxy objects. Patch by David Stanek and
+ Daniel Urban.
+
+Library
+-------
+
+- Issue #3243: Support iterable bodies in httplib. Patch Contributions by
+ Xuanji Li and Chris AtLee.
+
+- Issue #10611: SystemExit exception will no longer kill a unittest run.
+
+- Issue #9857: It is now possible to skip a test in a setUp, tearDown or clean
+ up function.
+
+- Issue #10573: use actual/expected consistently in unittest methods.
+ The order of the args of assertCountEqual is also changed.
+
+- Issue #9286: email.utils.parseaddr no longer concatenates blank-separated
+ words in the local part of email addresses, thereby preserving the input.
+
- Issue #6791: Limit header line length (to 65535 bytes) in http.client
and http.server, to avoid denial of services from the other party.
- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle.
+- Issue #9907: Fix tab handling on OSX when using editline by calling
+ rl_initialize first, then setting our custom defaults, then reading .editrc.
+
- Issue #4188: Avoid creating dummy thread objects when logging operations
from the threading module (with the internal verbose flag activated).
+- Issue #10711: Remove HTTP 0.9 support from http.client. The ``strict``
+ parameter to HTTPConnection and friends is deprecated.
+
- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
';' character. Patch by Wes Chow.
@@ -286,126 +893,240 @@ Library
- Issue #9558: Fix distutils.command.build_ext with VS 8.0.
+- Issue #10667: Fast path for collections.Counter().
+
- Issue #10695: passing the port as a string value to telnetlib no longer
causes debug mode to fail.
- Issue #1078919: add_header now automatically RFC2231 encodes parameters
that contain non-ascii values.
-- Issue #10107: Warn about unsaved files in IDLE on OSX.
+- Issue #10188 (partial resolution): tempfile.TemporaryDirectory emits
+ a warning on sys.stderr rather than throwing a misleading exception
+ if cleanup fails due to nulling out of modules during shutdown.
+ Also avoids an AttributeError when mkdtemp call fails and issues
+ a ResourceWarning on implicit cleanup via __del__.
-- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
- RFC3986. Anything before :// is considered a scheme and is followed by an
- authority (or netloc) and by '/' led path, which is optional.
+- Issue #10107: Warn about unsaved files in IDLE on OSX.
-- Issue #10478: Reentrant calls inside buffered IO objects (for example by
- way of a signal handler) now raise a RuntimeError instead of freezing the
- current process.
+- Issue #7213: subprocess.Popen's default for close_fds has been changed.
+ It is now True in most cases other than on Windows when input, output or
+ error handles are provided.
-- Issue #10464: netrc now correctly handles lines with embedded '#' characters.
+- Issue #6559: subprocess.Popen has a new pass_fds parameter (actually
+ added in 3.2beta1) to allow specifying a specific list of file descriptors
+ to keep open in the child process.
- Issue #1731717: Fixed the problem where subprocess.wait() could cause an
OSError exception when The OS had been told to ignore SIGCLD in our process
or otherwise not wait for exiting child processes.
-- Issue #11500: Fixed a bug in the os x proxy bypass code for fully qualified
- IP addresses in the proxy exception list.
+Tests
+-----
-Extensions
-----------
+- Issue #775964: test_grp now skips YP/NIS entries instead of failing when
+ encountering them.
-- Issue #1838: Prevent segfault in ctypes, when _as_parameter_ on a class is set
- to an instance of the class.
+Tools/Demos
+-----------
-- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
+- Issue #6075: IDLE on Mac OS X now works with both Carbon AquaTk and
+ Cocoa AquaTk.
+
+- Issue #10710: ``Misc/setuid-prog.c`` is removed from the source tree.
+
+- Issue #10706: Remove outdated script runtests.sh. Either ``make test``
+ or ``python -m test`` should be used instead.
Build
-----
-- Issue #11411: Fix 'make DESTDIR=' with a relative destination.
+- The Windows build now uses Tcl/Tk 8.5.9 and sqlite3 3.7.4.
-- Issue #11184: Fix large-file support on AIX.
+- Issue #9234: argparse supports alias names for subparsers.
-- Issue #941346: Fix broken shared library build on AIX.
-- Issue #7716: Under Solaris, don't assume existence of /usr/xpg4/bin/grep in
- the configure script but use $GREP instead. Patch by Fabian Groffen.
+What's New in Python 3.2 Beta 1?
+================================
-- Issue #10475: Don't hardcode compilers for LDSHARED/LDCXXSHARED on NetBSD
- and DragonFly BSD. Patch by Nicolas Joly.
+*Release date: 05-Dec-2010*
-- Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
- timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
- support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
- only be present on OS X; the former is the correct one for Linux with GCC.
+Core and Builtins
+-----------------
-- Issue #1099: Fix the build on MacOSX when building a framework with pydebug
- using GCC 4.0.
+- Issue #10630: Return dict views from the dict proxy keys()/values()/items()
+ methods.
-Tests
------
+- Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__
+ with respect to signed zeros. -4.0 % 4.0 should be 0.0, not -0.0.
-- Fix test_startfile to wait for child process to terminate before finishing.
+- Issue #1772833: Add the -q command-line option to suppress copyright and
+ version output in interactive mode.
-- Issue #11719: Fix message about unexpected test_msilib skip on non-Windows
- platforms. Patch by Nadeem Vawda.
+- Provide an *optimize* parameter in the built-in compile() function.
-- Issue #11490: test_subprocess:test_leaking_fds_on_error no longer gives a
- false positive if the last directory in the path is inaccessible.
+- Fixed several corner case issues on Windows in os.stat/os.lstat related to
+ reparse points.
-- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
- by Ross Lagerwall.
+- PEP 384 (Defining a Stable ABI) is implemented.
-- Issue #6293: Have regrtest.py echo back sys.flags. This is done by default
- in whole runs and enabled selectively using ``--header`` when running an
- explicit list of tests. Original patch by Collin Winter.
+- Issue #2690: Range objects support negative indices and slicing.
-- Issue #775964: test_grp now skips YP/NIS entries instead of failing when
- encountering them.
+- Issue #9915: Speed up sorting with a key.
-- Issue #7110: regrtest now sends test failure reports and single-failure
- tracebacks to stderr rather than stdout.
+- Issue #8685: Speed up set difference ``a - b`` when source set ``a`` is much
+ larger than operand ``b``. Patch by Andrew Bennetts.
+- Issue #10518: Bring back the callable() builtin.
-What's New in Python 3.1.3?
-===========================
+- Issue #7094: Added alternate formatting (specified by '#') to ``__format__``
+ method of float, complex, and Decimal. This allows more precise control over
+ when decimal points are displayed.
-*Release date: 2010-11-27*
+- Issue #10474: range.count() should return integers.
-Core and Builtins
------------------
+- Issue #1574217: isinstance now catches only AttributeError, rather than
+ masking all errors.
+
+Library
+-------
+
+- logging: added "handler of last resort". See http://bit.ly/last-resort-handler
+
+- test.support: Added TestHandler and Matcher classes for better support of
+ assertions about logging.
+
+- Issue #4391: Use proper plural forms in argparse.
+
+- Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
+ UnicodeEncodeError.
+
+- Add the "display" and "undisplay" pdb commands.
+
+- Issue #7245: Add a SIGINT handler in pdb that allows to break a program again
+ after a "continue" command.
+
+- Add the "interact" pdb command.
+
+- Issue #7905: Actually respect the keyencoding parameter to shelve.Shelf.
+
+- Issue #1569291: Speed up array.repeat().
+
+- Provide an interface to set the optimization level of compilation in
+ py_compile, compileall and zipfile.PyZipFile.
+
+- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
+ RFC3986. Anything before :// is considered a scheme and is followed by an
+ authority (or netloc) and by '/' led path, which is optional.
+
+- Issue #6045: dbm.gnu databases now support get() and setdefault() methods.
+
+- Issue #10620: `python -m unittest` can accept file paths instead of module
+ names for running specific tests.
+
+- Issue #9424: Deprecate the `unittest.TestCase` methods `assertEquals`,
+ `assertNotEquals`, `assertAlmostEquals`, `assertNotAlmostEquals` and `assert_`
+ and replace them with the correct methods in the Python test suite.
+
+- Issue #10272: The ssl module now raises socket.timeout instead of a generic
+ SSLError on socket timeouts.
+
+- Issue #10528: Allow translators to reorder placeholders in localizable
+ messages from argparse.
+
+- Issue #10497: Fix incorrect use of gettext in argparse.
+
+- Issue #10478: Reentrant calls inside buffered IO objects (for example by
+ way of a signal handler) now raise a RuntimeError instead of freezing the
+ current process.
+
+- logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests.
+
+- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
+
+- Issue #2001: New HTML server with enhanced Web page features. Patch by Ron
+ Adam.
+
+- Issue #10360: In WeakSet, do not raise TypeErrors when testing for membership
+ of non-weakrefable objects.
+
+- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
+
+- Issue #1745035: Add a command size and data size limit to smtpd.py, to prevent
+ DoS attacks. Patch by Savio Sena.
+
+- Issue #4925: Add filename to error message when executable can't be found in
+ subprocess.
- Issue #10391: Don't dereference invalid memory in error messages in the ast
module.
-Library
--------
+- Issue #10027: st_nlink was not being set on Windows calls to os.stat or
+ os.lstat. Patch by Hirokazu Yamamoto.
-- Issue #2236: distutils' mkpath ignored the mode parameter.
+- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege is
+ held by the user's account, i.e., when the function can actually be used.
-- Fix typo in one sdist option (medata-check).
+- Issue #8879: Add os.link support for Windows.
-- Issue #10323: itertools.islice() now consumes the minimum number of
- inputs before stopping. Formerly, the final state of the underlying
- iterator was undefined.
+- Issue #7911: ``unittest.TestCase.longMessage`` defaults to True for improved
+ failure messages by default. Patch by Mark Roddy.
-- Issue #10565: The collections.Iterator ABC now checks for both
- __iter__ and __next__.
+- Issue #1486713: HTMLParser now has an optional tolerant mode where it tries to
+ guess at the correct parsing of invalid html.
-- Issue #10561: In pdb, clear the breakpoints by the breakpoint number.
+- Issue #10554: Add context manager support to subprocess.Popen objects.
-- Issue #10459: Update CJK character names to Unicode 5.1.
+- Issue #8989: email.utils.make_msgid now has a domain parameter that can
+ override the domain name used in the generated msgid.
-- Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
+- Issue #9299: Add exist_ok parameter to os.makedirs to suppress the 'File
+ exists' exception when a target directory already exists with the specified
+ mode. Patch by Ray Allen.
-- Issue #6098: Don't claim DOM level 3 conformance in minidom.
+- Issue #9573: os.fork() now works correctly when triggered as a side effect of
+ a module import.
-- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
- XML namespace attribute is encountered.
+- Issue #10464: netrc now correctly handles lines with embedded '#' characters.
-- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
- created in modes 'a' or 'w' and then closed without adding any files. Raise
- BadZipfile (rather than IOError) when opening small non-ZIP files.
+- Added itertools.accumulate().
+
+- Issue #4113: Added custom ``__repr__`` method to ``functools.partial``.
+ Original patch by Daniel Urban.
+
+- Issue #10273: Rename `assertRegexpMatches` and `assertRaisesRegexp` to
+ `assertRegex` and `assertRaisesRegex`.
+
+- Issue #10535: Enable silenced warnings in unittest by default.
+
+- Issue #9873: The URL parsing functions in urllib.parse now accept ASCII byte
+ sequences as input in addition to character strings.
+
+- Issue #10586: The statistics API for the new functools.lru_cache has been
+ changed to a single cache_info() method returning a named tuple.
+
+- Issue #10323: itertools.islice() now consumes the minimum number of inputs
+ before stopping. Formerly, the final state of the underlying iterator was
+ undefined.
+
+- Issue #10565: The collections.Iterator ABC now checks for both __iter__ and
+ __next__.
+
+- Issue #10242: Fixed implementation of unittest.ItemsEqual and gave it a new
+ more informative name, unittest.CountEqual.
+
+- Issue #10561: In pdb, clear the breakpoints by the breakpoint number.
+
+- Issue #2986: difflib.SequenceMatcher gets a new parameter, autojunk, which can
+ be set to False to turn off the previously undocumented 'popularity'
+ heuristic. Patch by Terry Reedy and Eli Bendersky.
+
+- Issue #10534: in difflib, expose bjunk and bpopular sets; deprecate
+ undocumented and now redundant isbjunk and isbpopular methods.
+
+- Issue #9846: zipfile is now correctly closing underlying file objects.
+
+- Issue #10459: Update CJK character names to Unicode 6.0.
- Issue #4493: urllib.request adds '/' in front of path components which does not
start with '/. Common behavior exhibited by browsers and other clients.
@@ -413,33 +1134,122 @@ Library
- Issue #6378: idle.bat now runs with the appropriate Python version rather than
the system default. Patch by Sridhar Ratnakumar.
+- Issue #10470: 'python -m unittest' will now run test discovery by default,
+ when no extra arguments have been provided.
+
+- Issue #3709: BaseHTTPRequestHandler will buffer the headers and write to
+ output stream only when end_headers is invoked. This is a speedup and an
+ internal optimization. Patch by endian.
+
+- Issue #10220: Added inspect.getgeneratorstate. Initial patch by Rodolpho
+ Eckhardt.
+
+- Issue #10453: compileall now uses argparse instead of getopt, and thus
+ provides clean output when called with '-h'.
+
+- Issue #8078: Add constants for higher baud rates in the termios module. Patch
+ by Rodolpho Eckhardt.
+
- Issue #10407: Fix two NameErrors in distutils.
-- Issue #10198: fix duplicate header written to wave files when writeframes()
- is called without data.
+- Issue #10371: Deprecated undocumented functions in the trace module.
- Issue #10467: Fix BytesIO.readinto() after seeking into a position after the
end of the file.
+- configparser: 100% test coverage.
+
+- Issue #10499: configparser supports pluggable interpolation handlers. The
+ default classic interpolation handler is called BasicInterpolation. Another
+ interpolation handler added (ExtendedInterpolation) which supports the syntax
+ used by zc.buildout (e.g. interpolation between sections).
+
+- configparser: the SafeConfigParser class has been renamed to ConfigParser.
+ The legacy ConfigParser class has been removed but its interpolation mechanism
+ is still available as LegacyInterpolation.
+
+- configparser: Usage of RawConfigParser is now discouraged for new projects
+ in favor of ConfigParser(interpolation=None).
+
- Issue #1682942: configparser supports alternative option/value delimiters.
-Build
+- Issue #5412: configparser supports mapping protocol access.
+
+- Issue #9411: configparser supports specifying encoding for read operations.
+
+- Issue #9421: configparser's getint(), getfloat() and getboolean() methods
+ accept vars and default arguments just like get() does.
+
+- Issue #9452: configparser supports reading from strings and dictionaries
+ (thanks to the mapping protocol API, the latter can be used to copy data
+ between parsers).
+
+- configparser: accepted INI file structure is now customizable, including
+ comment prefixes, name of the DEFAULT section, empty lines in multiline
+ values, and indentation.
+
+- Issue #10326: unittest.TestCase instances can be pickled.
+
+- Issue #9926: Wrapped TestSuite subclass does not get __call__ executed.
+
+- Issue #9920: Skip tests for cmath.atan and cmath.atanh applied to complex
+ zeros on systems where the log1p function fails to respect the sign of zero.
+ This fixes a test failure on AIX.
+
+- Issue #9732: Addition of getattr_static to the inspect module.
+
+- Issue #10446: Module documentation generated by pydoc now links to a
+ version-specific online reference manual.
+
+- Make the 'No module named' exception message from importlib consistent.
+
+- Issue #10443: Add the SSLContext.set_default_verify_paths() method.
+
+- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
+ Patch by Robert Collins.
+
+- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects, rather
+ than strings.
+
+C-API
-----
-- Don't run pgen twice when using make -j.
+- Issue #10557: Added a new API function, PyUnicode_TransformDecimalToASCII(),
+ which transforms non-ASCII decimal digits in a Unicode string to their ASCII
+ equivalents.
-- Backport r83399 to allow test_distutils to pass on installed versions.
+- Issue #9518: Extend the PyModuleDef_HEAD_INIT macro to explicitly
+ zero-initialize all fields, fixing compiler warnings seen when building
+ extension modules with gcc with "-Wmissing-field-initializers" (implied by
+ "-W").
-- Issue #1303434: Generate ZIP file containing all PDBs (already done for rc1).
+- Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil
+ Schemenauer.
-- Stop packaging versioncheck tool (already done for rc1).
+- structseq.h is now included in Python.h.
-- Accept Oracle Berkeley DB 4.8, 5.0 and 5.1 as backend for the dbm extension.
+- Loosen PyArg_ValidateKeywordArguments to allow dict subclasses.
Tests
-----
-- Issue #9424: Replace deprecated assert* methods in the Python test suite.
+- regrtest.py once again ensures the test directory is removed from sys.path
+ when it is invoked directly as the __main__ module.
+
+- `python -m test` can be used to run the test suite as well as `python -m
+ test.regrtest`.
+
+- Do not fail test_socket when the IP address of the local hostname cannot be
+ looked up.
+
+- Issue #8886: Use context managers throughout test_zipfile. Patch by Eric
+ Carstensen.
+
+Build
+-----
+
+- Issue #10325: Fix two issues in the fallback definitions for PY_ULLONG_MAX and
+ PY_LLONG_MAX that made them unsuitable for use in preprocessor conditionals.
Documentation
-------------
@@ -447,874 +1257,1448 @@ Documentation
- Issue #10299: List the built-in functions in a table in functions.rst.
-What's New in Python 3.1.3 release candidate 1?
-===============================================
+What's New in Python 3.2 Alpha 4?
+=================================
-*Release date: 2010-11-13*
+*Release date: 13-Nov-2010*
Core and Builtins
-----------------
+- Issue #10372: Import the warnings module only after the IO library is
+ initialized, so as to avoid bootstrap issues with the '-W' option.
+
+- Issue #10293: Remove obsolete field in the PyMemoryView structure, unused
+ undocumented value PyBUF_SHADOW, and strangely-looking code in
+ PyMemoryView_GetContiguous.
+
+- Issue #6081: Add str.format_map(), similar to ``str.format(**mapping)``.
+
+- If FileIO.__init__ fails, close the file descriptor.
+
- Issue #10221: dict.pop(k) now has a key error message that includes the
missing key (same message d[k] returns for missing keys).
-- Issue #5437: A preallocated MemoryError instance should not hold traceback
+- Issue #5437: A preallocated MemoryError instance should not keep traceback
data (including local variables caught in the stack trace) alive infinitely.
-- Issue #10077: Fix logging of site module errors at startup.
-
- Issue #10186: Fix the SyntaxError caret when the offset is equal to the length
of the offending line.
-- Issue #9713, #10114: Parser functions (eg. PyParser_ASTFromFile) expects
- filenames encoded to the filesystem encoding with surrogateescape error
- handler (to support undecodable bytes), instead of UTF-8 in strict mode.
+- Issue #10089: Add support for arbitrary -X options on the command line. They
+ can be retrieved through a new attribute ``sys._xoptions``.
-- Issue #10006: type.__abstractmethods__ now raises an AttributeError. As a
- result metaclasses can now be ABCs (see #9533).
+- Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
+ the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment
+ variable is not set, the locale encoding is ISO-8859-1, whereas most programs
+ (including Python) expect UTF-8. Python already uses UTF-8 for the filesystem
+ encoding and to encode command line arguments on this OS.
+
+- Issue #9713, #10114: Parser functions (e.g. PyParser_ASTFromFile) expect
+ filenames encoded to the filesystem encoding with the surrogateescape error
+ handler (to support undecodable bytes), instead of UTF-8 in strict mode.
- Issue #9997: Don't let the name "top" have special significance in scope
resolution.
-- Issue #9930: Remove bogus subtype check that was causing (e.g.)
- float.__rdiv__(2.0, 3) to return NotImplemented instead of the
- expected 1.5.
+- Issue #9862: Compensate for broken PIPE_BUF in AIX by hard coding its value as
+ the default 512 when compiling on AIX.
-- Issue #9804: ascii() now always represents unicode surrogate pairs as
- a single ``\UXXXXXXXX``, regardless of whether the character is printable
- or not. Also, the "backslashreplace" error handler now joins surrogate
- pairs into a single character on UCS-2 builds.
+- Use locale encoding instead of UTF-8 to encode and decode filenames if
+ Py_FileSystemDefaultEncoding is not set.
-- Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
- thread-local storage key.
+- Issue #10095: fp_setreadl() doesn't reopen the file, instead reuse the file
+ descriptor.
-- Issue #9737: Fix a crash when trying to delete a slice or an item from
- a memoryview object.
+- Issue #9418: Moved private string methods ``_formatter_parser`` and
+ ``_formatter_field_name_split`` into a new ``_string`` module.
-- Issue #7415: PyUnicode_FromEncodedObject() now uses the new buffer API
- properly. Patch by Stefan Behnel.
-
-- Restore GIL in nis_cat in case of error.
-
-- Issue #9712: Fix tokenize on identifiers that start with non-ascii names.
+- Issue #9992: Remove PYTHONFSENCODING environment variable.
-- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t.
+Library
+-------
-- Issue #5319: Print an error if flushing stdout fails at interpreter
- shutdown.
+- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
-- Issue #8814: function annotations (the ``__annotations__`` attribute)
- are now included in the set of attributes copied by default by
- functools.wraps and functools.update_wrapper. Patch by Terrence Cole.
+- Issue #10356: Decimal.__hash__(-1) should return -2.
-- Issue #83755: Implicit set-to-frozenset conversion was not thread-safe.
+- Issue #1553375: logging: Added stack_info kwarg to display stack information.
-- Issue #10068: Global objects which have reference cycles with their module's
- dict are now cleared again. This causes issue #7140 to appear again.
+- Issue #5111: IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru.
-- Issue #9416: Fix some issues with complex formatting where the
- output with no type specifier failed to match the str output:
+- Fix Fraction.__hash__ so that Fraction.__hash__(-1) is -2. (See also issue
+ #10356.)
- - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
- - format(complex(0.0, 2.0), '-') included a sign and parentheses.
+- Issue #4471: Add the IMAP.starttls() method to enable encryption on standard
+ IMAP4 connections. Original patch by Lorenzo M. Catucci.
-- Issue #7616: Fix copying of overlapping memoryview slices with the Intel
- compiler.
+- Issue #1466065: Add 'validate' option to base64.b64decode to raise an error if
+ there are non-base64 alphabet characters in the input.
-- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
- start byte and the continuation byte(s) are now considered invalid, instead
- of the number of bytes specified by the start byte.
- E.g.: '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and
- replaces with U+FFFD only the start byte ('\xf1') and the continuation byte
- ('\x80') even if '\xf1' is the start byte of a 4-bytes sequence.
- Previous versions returned a single u'\ufffd'.
+- Issue #10386: Add __all__ to token module; this simplifies importing in
+ tokenize module and prevents leaking of private names through ``import *``.
-- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
- Fix the encoding of the modules filename. Patch written by Amaury Forgeot
- d'Arc.
+- Issue #4471: Properly shutdown socket in IMAP.shutdown(). Patch by Lorenzo
+ M. Catucci.
-- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
+- Fix IMAP.login() to work properly.
-- Issue #8941: decoding big endian UTF-32 data in UCS-2 builds could crash
- the interpreter with characters outside the Basic Multilingual Plane
- (higher than 0x10000).
+- Issue #9244: multiprocessing pool worker processes could terminate
+ unexpectedly if the return value of a task could not be pickled. Only the
+ ``repr`` of such errors are now sent back, wrapped in an
+ ``MaybeEncodingError`` exception.
-- In the str.format(), raise a ValueError when indexes to arguments are too
- large.
+- Issue #9244: The ``apply_async()`` and ``map_async()`` methods of
+ ``multiprocessing.Pool`` now accepts a ``error_callback`` argument. This can
+ be a callback with the signature ``callback(exc)``, which will be called if
+ the target raises an exception.
-- Issue #8766: Initialize _warnings module before importing the first module.
- Fix a crash if an empty directory called "encodings" exists in sys.path.
+- Issue #10022: The dictionary returned by the ``getpeercert()`` method of SSL
+ sockets now has additional items such as ``issuer`` and ``notBefore``.
-- PyObject_Dump() encodes unicode objects to utf8 with backslashreplace
- (instead of strict) error handler to escape surrogates
+- ``usenetrc`` is now false by default for NNTP objects.
-- Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't execute
- indirectly Python signal handlers anymore because mywrite() ignores
- exceptions (KeyboardInterrupt)
+- Issue #1926: Add support for NNTP over SSL on port 563, as well as STARTTLS.
+ Patch by Andrew Vant.
-- Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing
- unicode string (eg. backslashreplace)
+- Issue #10335: Add tokenize.open(), detect the file encoding using
+ tokenize.detect_encoding() and open it in read only mode.
-- Issue #8014: Setting a T_UINT or T_PYSSIZET attribute of an object with
- PyMemberDefs could produce an internal error; raise TypeError instead.
+- Issue #10321: Add support for binary data to smtplib.SMTP.sendmail, and a new
+ method send_message to send an email.message.Message object.
-- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
- passed to bytes or bytearray.
+- Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
+ handler to parse the Makefile file. Avoid a UnicodeDecodeError if the source
+ code directory name contains a non-ASCII character and the locale encoding is
+ ASCII.
-- Issue #8329: Don't return the same lists from select.select when no fds are
- changed.
+- Issue #10329: The trace module writes reports using the input Python script
+ encoding, instead of the locale encoding. Patch written by Alexander
+ Belopolsky.
-- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
+- Issue #10126: Fix distutils' test_build when Python was built with
+ --enable-shared.
-- Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
- is unknown
+- Issue #9281: Prevent race condition with mkdir in distutils. Patch by
+ Arfrever.
-- Issue #1583863: An str subclass can now override the __str__ method
+- Issue #10229: Fix caching error in gettext.
-- Issue #7072: isspace(0xa0) is true on Mac OS X
+- Issue #10252: Close file objects in a timely manner in distutils code and
+ tests. Patch by Brian Brazil, completed by Éric Araujo.
-C-API
------
+- Issue #10180: Pickling file objects is now explicitly forbidden, since
+ unpickling them produced nonsensical results.
-- Issue #9834: Don't segfault in PySequence_GetSlice, PySequence_SetSlice, or
- PySequence_DelSlice when the object doesn't have any mapping operations
- defined.
+- Issue #10311: The signal module now restores errno before returning from its
+ low-level signal handler. Patch by Hallvard B Furuseth.
-- Issue #5753: A new C API function, :cfunc:`PySys_SetArgvEx`, allows
- embedders of the interpreter to set sys.argv without also modifying
- sys.path. This helps fix `CVE-2008-5983
- <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
+- Issue #10282: Add a ``nntp_implementation`` attribute to NNTP objects.
-Library
--------
+- Issue #10283: Add a ``group_pattern`` argument to NNTP.list().
-- Issue #5111: IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru.
+- Issue #10155: Add IISCGIHandler to wsgiref.handlers to support IIS CGI
+ environment better, and to correct unicode environment values for WSGI 1.0.1.
-- Issue #4471: Properly shutdown socket in IMAP.shutdown(). Patch by
- Lorenzo M. Catucci.
+- Issue #10281: nntplib now returns None for absent fields in the OVER/XOVER
+ response, instead of raising an exception.
-- Fix IMAP.login() to work properly.
+- wsgiref now implements and validates PEP 3333, rather than an experimental
+ extension of PEP 333. (Note: earlier versions of Python 3.x may have
+ incorrectly validated some non-compliant applications as WSGI compliant; if
+ your app validates with Python <3.2b1+, but not on this version, it is likely
+ the case that your app was not compliant.)
-- Issue #10126: Fix distutils' test_build when Python was built with
- --enable-shared.
+- Issue #10280: NNTP.nntp_version should reflect the highest version advertised
+ by the server.
-- Fix typo in one sdist option (medata-check).
+- Issue #10184: Touch directories only once when extracting a tarfile.
-- Issue #9199: Fix incorrect use of distutils.cmd.Command.announce.
+- Issue #10199: New package, ``turtledemo`` now contains selected demo scripts
+ that were formerly found under Demo/turtle.
-- Issue #1718574: Fix options that were supposed to accept arguments but did
- not in build_clib.
+- Issue #10265: Close file objects explicitly in sunau. Patch by Brian Brazil.
-- Issue #9281: Prevent race condition with mkdir in distutils. Patch by
- Arfrever.
+- Issue #10266: uu.decode didn't close in_file explicitly when it was given as a
+ filename. Patch by Brian Brazil.
-- Issue #10229: Fix caching error in gettext.
+- Issue #10110: Queue objects didn't recognize full queues when the maxsize
+ parameter had been reduced.
-- Issue #10252: Close file objects in a timely manner in distutils code and
- tests. Patch by Brian Brazil, completed by Éric Araujo.
+- Issue #10160: Speed up operator.attrgetter. Patch by Christos Georgiou.
-- Issue #10311: The signal module now restores errno before returning from
- its low-level signal handler. Patch by Hallvard B Furuseth.
+- logging: Added style option to basicConfig() to allow %, {} or $-formatting.
-- The keyword only restriction for the places argument in
- unittest.TestCase.assert[Not]AlmostEqual methods has been removed.
+- Issue #5729: json.dumps() now supports using a string such as '\t' for
+ pretty-printing multilevel objects.
-- Issue #6706: asyncore accept() method no longer raises EWOULDBLOCK/ECONNABORTED
- on incomplete connection attempt but returns None instead.
+- Issue #10253: FileIO leaks a file descriptor when trying to open a file for
+ append that isn't seekable. Patch by Brian Brazil.
-- Issue #10266: uu.decode didn't close in_file explicitly when it was given
- as a filename. Patch by Brian Brazil.
+- Support context manager protocol for file-like objects returned by mailbox
+ ``get_file()`` methods.
- Issue #10246: uu.encode didn't close file objects explicitly when filenames
were given to it. Patch by Brian Brazil.
-- Issue #10253: FileIO leaks a file descriptor when trying to open a file
- for append that isn't seekable. Patch by Brian Brazil.
+- Issue #10198: fix duplicate header written to wave files when writeframes() is
+ called without data.
+
+- Close file objects in modulefinder in a timely manner.
+
+- Close a io.TextIOWrapper object in email.parser in a timely manner.
+
+- Close a file object in distutils.sysconfig in a timely manner.
+
+- Close a file object in pkgutil in a timely manner.
+
+- Issue #10233: Close file objects in a timely manner in the tarfile module and
+ its test suite.
+
+- Issue #10093: ResourceWarnings are now issued when files and sockets are
+ deallocated without explicit closing. These warnings are silenced by default,
+ except in pydebug mode.
+
+- tarfile.py: Add support for all missing variants of the GNU sparse extensions
+ and create files with holes when extracting sparse members.
+
+- Issue #10218: Return timeout status from ``Condition.wait`` in threading.
+
+- Issue #7351: Add ``zipfile.BadZipFile`` spelling of the exception name and
+ deprecate the old name ``zipfile.BadZipfile``.
- Issue #5027: The standard ``xml`` namespace is now understood by
xml.sax.saxutils.XMLGenerator as being bound to
http://www.w3.org/XML/1998/namespace. Patch by Troy J. Farrell.
+- Issue #5975: Add csv.unix_dialect class.
+
- Issue #7761: telnetlib.interact failures on Windows fixed.
-- Issue #5117: Case normalization was needed on ntpath.relpath(). And
- fixed root directory issue on posixpath.relpath(). (Ported working fixes
- from ntpath)
+- logging: Added style option to Formatter to allow %, {} or $-formatting.
+
+- Issue #5178: Added tempfile.TemporaryDirectory class that can be used as a
+ context manager.
+
+- Issue #1349106: Generator (and BytesGenerator) flatten method and Header
+ encode method now support a 'linesep' argument.
+
+- Issue #5639: Add a *server_hostname* argument to ``SSLContext.wrap_socket`` in
+ order to support the TLS SNI extension. ``HTTPSConnection`` and ``urlopen()``
+ also use this argument, so that HTTPS virtual hosts are now supported.
+
+- Issue #10166: Avoid recursion in pstats Stats.add() for many stats items.
+
+- Issue #10163: Skip unreadable registry keys during mimetypes initialization.
+
+- logging: Made StreamHandler terminator configurable.
+
+- logging: Allowed filters to be just callables.
+
+- logging: Added tests for _logRecordClass changes.
+
+- Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
+
+- logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to
+ increase flexibility of LogRecord creation.
+
+- Issue #5117: Case normalization was needed on ntpath.relpath(). Also fixed
+ root directory issue on posixpath.relpath(). (Ported working fixes from
+ ntpath.)
+
+- Issue #1343: xml.sax.saxutils.XMLGenerator now has an option
+ short_empty_elements to direct it to use self-closing tags when appropriate.
+
+- Issue #9807 (part 1): Expose the ABI flags in sys.abiflags. Add --abiflags
+ switch to python-config for command line access.
+
+- Issue #6098: Don't claim DOM level 3 conformance in minidom.
+
+- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
+ XML namespace attribute is encountered.
+
+- Issue #2830: Add the ``html.escape()`` function, which quotes all problematic
+ characters by default. Deprecate ``cgi.escape()``.
+
+- Issue #9409: Fix the regex to match all kind of filenames, for interactive
+ debugging in doctests.
+
+- Issue #9183: ``datetime.timezone(datetime.timedelta(0))`` will now return the
+ same instance as ``datetime.timezone.utc``.
+
+- Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module, where
+ supported by the system. Patch by Nikita Vetoshkin.
+
+- Issue #10063: file:// scheme will stop accessing remote hosts via ftp
+ protocol. file:// urls had fallback to access remote hosts via ftp. This was
+ not correct, change is made to raise a URLError when a remote host is tried to
+ access via file:// scheme.
+
+- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
+ created in modes 'a' or 'w' and then closed without adding any files. Raise
+ BadZipfile (rather than IOError) when opening small non-ZIP files.
+
+- Issue #10041: The signature of optional arguments in socket.makefile() didn't
+ match that of io.open(), and they also didn't get forwarded properly to
+ TextIOWrapper in text mode. Patch by Kai Zhu.
-- Issue #10041: The signature of optional arguments in socket.makefile()
- didn't match that of io.open(), and they also didn't get forwarded
- properly to TextIOWrapper in text mode. Patch by Kai Zhu.
+- Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler and
+ urllib.request.urlopen now take optional arguments to allow for server
+ certificate checking, as recommended in public uses of HTTPS.
- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
current directory was deleted. Patch written by W. Trevor King.
+- Issue #3873: Speed up unpickling from file objects that have a peek() method.
+
+- Issue #10075: Add a session_stats() method to SSLContext objects.
+
+- Issue #9948: Fixed problem of losing filename case information.
+
+Extension Modules
+-----------------
+
+- Issue #5109: array.array constructor will now use fast code when
+ initial data is provided in an array object with correct type.
+
+- Issue #6317: Now winsound.PlaySound only accepts unicode.
+
+- Issue #6317: Now winsound.PlaySound can accept non ascii filename.
+
+- Issue #9377: Use Unicode API for gethostname on Windows.
+
+- Issue #10143: Update "os.pathconf" values.
+
+- Issue #6518: Support context manager protcol for ossaudiodev types.
+
+- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
+
+- Issue #9054: Fix a crash occurring when using the pyexpat module with expat
+ version 2.0.1.
+
+- Issue #5355: Provide mappings from Expat error numbers to string descriptions
+ and backwards, in order to actually make it possible to analyze error codes
+ provided by ExpatError.
+
+- The Unicode database was updated to 6.0.0.
+
+C-API
+-----
+
+- Issue #10288: The deprecated family of "char"-handling macros
+ (ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc instead.
+
+- Issue #9778: Hash values are now always the size of pointers. A new Py_hash_t
+ type has been introduced.
+
+Tools/Demos
+-----------
+
+- Issue #10117: Tools/scripts/reindent.py now accepts source files that use
+ encoding other than ASCII or UTF-8. Source encoding is preserved when
+ reindented code is written to a file.
+
+- Issue #7287: Demo/imputil/knee.py was removed.
+
+Tests
+-----
+
+- Issue #3699: Fix test_bigaddrspace and extend it to test bytestrings as well
+ as unicode strings. Initial patch by Sandro Tosi.
+
+- Issue #10294: Remove dead code form test_unicode_file.
+
+- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a new
+ test specific to unicode (non-ascii name and filename).
+
+Build
+-----
+
+- Issue #10268: Add a --enable-loadable-sqlite-extensions option to configure.
+
+- Issue #8852: Allow the socket module to build on OpenSolaris.
+
+- Drop -OPT:Olimit compiler option.
+
+- Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd.
+
+- Accept Oracle Berkeley DB 5.0 and 5.1 as backend for the dbm extension.
+
+- Issue #7473: avoid link errors when building a framework with a different set
+ of architectures than the one that is currently installed.
+
+
+What's New in Python 3.2 Alpha 3?
+=================================
+
+*Release date: 09-Oct-2010*
+
+Core and Builtins
+-----------------
+
+- Issue #10068: Global objects which have reference cycles with their module's
+ dict are now cleared again. This causes issue #7140 to appear again.
+
+- Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
+ encodings.
+
+- ast.literal_eval() can now handle negative numbers. It is also a little more
+ liberal in what it accepts without compromising the safety of the evaluation.
+ For example, 3j+4 and 3+4+5 are both accepted.
+
+- Issue #10006: type.__abstractmethods__ now raises an AttributeError. As a
+ result metaclasses can now be ABCs (see #9533).
+
+- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
+
+- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
+ UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE and
+ 32 bits wchar_t (eg. Linux in narrow build).
+
+- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
+ introduced by issue #9324.
+
+- Issue #9979: Create function PyUnicode_AsWideCharString().
+
+- Issue #7397: Mention that importlib.import_module() is probably what someone
+ really wants to be using in __import__'s docstring.
+
+- Issue #8521: Allow CreateKeyEx, OpenKeyEx, and DeleteKeyEx functions of winreg
+ to use named arguments.
+
+- Issue #9930: Remove bogus subtype check that was causing (e.g.)
+ float.__rdiv__(2.0, 3) to return NotImplemented instead of the expected 1.5.
+
+- Issue #9808: Implement os.getlogin for Windows. Patch by Jon Anglin.
+
+- Issue #9901: Destroying the GIL in Py_Finalize() can fail if some other
+ threads are still running. Instead, reinitialize the GIL on a second call to
+ Py_Initialize().
+
+- All SyntaxErrors now have a column offset and therefore a caret when the error
+ is printed.
+
+- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
+ module that was imported, but instead gets the module from sys.modules.
+
+- Issue #9213: The range type_items now provides index() and count() methods, to
+ conform to the Sequence ABC. Patch by Daniel Urban and Daniel Stutzbach.
+
+- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ is called
+ with a non-empty format string. This is an effort to future-proof user
+ code. If a derived class does not currently implement __format__ but later
+ adds its own __format__, it would most likely break user code that had
+ supplied a format string. This will be changed to a DeprecationWaring in
+ Python 3.3 and it will be an error in Python 3.4.
+
+- Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
+ re-created on a subsequent call to Py_Initialize(). The problem (a crash)
+ wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
+
+- Issue #9210: Configure option --with-wctype-functions was removed. Using the
+ functions from the libc caused the methods .upper() and lower() to become
+ locale aware and created subtly wrong results.
+
+- Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on a
+ non-ASCII byte in the format string.
+
+- Issue #4617: Previously it was illegal to delete a name from the local
+ namespace if it occurs as a free variable in a nested block. This limitation
+ of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
+
+- Issue #9804: ascii() now always represents unicode surrogate pairs as a single
+ ``\UXXXXXXXX``, regardless of whether the character is printable or not.
+ Also, the "backslashreplace" error handler now joins surrogate pairs into a
+ single character on UCS-2 builds.
+
+- Issue #9757: memoryview objects get a release() method to release the
+ underlying buffer (previously this was only done when deallocating the
+ memoryview), and gain support for the context management protocol.
+
+- Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
+ thread-local storage key.
+
+Library
+-------
+
+- Issue #2236: distutils' mkpath ignored the mode parameter.
+
+- Fix typo in one sdist option (medata-check).
+
+- Issue #9199: Fix incorrect use of distutils.cmd.Command.announce.
+
+- Issue #1718574: Fix options that were supposed to accept arguments but did
+ not in build_clib.
+
+- Issue #9437: Fix building C extensions with non-default LDFLAGS.
+
+- Issue #4661: email can now parse bytes input and generate either converted
+ 7bit output or bytes output. Email version bumped to 5.1.0.
+
+- Issue #1589: Add ssl.match_hostname(), to help implement server identity
+ verification for higher-level protocols.
+
- Issue #9759: GzipFile now raises ValueError when an operation is attempted
after the file is closed. Patch by Jeffrey Finkelstein.
- Issue #9042: Fix interaction of custom translation classes and caching in
gettext.
+- Issue #6706: asyncore.dispatcher now provides a handle_accepted() method
+ returning a (sock, addr) pair which is called when a connection has been
+ established with a new remote endpoint. This is supposed to be used as a
+ replacement for old handle_accept() and avoids the user to call accept()
+ directly.
+
- Issue #9065: tarfile no longer uses "root" as the default for the uname and
gname field.
-- Issue #8980: Fixed a failure in distutils.command check that was shadowed
- by an environment that does not have docutils. Patch by Arfrever.
+- Issue #8980: Fixed a failure in distutils.command check that was shadowed by
+ an environment that does not have docutils. Patch by Arfrever.
- Issue #1050268: parseaddr now correctly quotes double quote and backslash
characters that appear inside quoted strings in email addresses.
-- Issue #10004: quoprimime no longer generates a traceback when confronted
- with invalid characters after '=' in a Q-encoded word.
+- Issue #10004: quoprimime no longer generates a traceback when confronted with
+ invalid characters after '=' in a Q-encoded word.
+
+- Issue #1491: BaseHTTPServer nows send a ``100 Continue`` response before
+ sending a 200 OK for the Expect: 100-continue request header.
+
+- Issue #9360: Cleanup and improvements to the nntplib module. The API now
+ conforms to the philosophy of bytes and unicode separation in Python 3. A
+ test suite has also been added.
+
+- Issue #9962: GzipFile now has the peek() method.
+
+- Issue #9090: When a socket with a timeout fails with EWOULDBLOCK or EAGAIN,
+ retry the select() loop instead of bailing out. This is because select() can
+ incorrectly report a socket as ready for reading (for example, if it received
+ some data with an invalid checksum).
+
+- Issue #3612: Added new types to ctypes.wintypes. (CHAR and pointers)
- Issue #9950: Fix socket.sendall() crash or misbehaviour when a signal is
- received. Now sendall() properly calls signal handlers if necessary,
- and retries sending if these returned successfully, including on sockets
- with a timeout.
+ received. Now sendall() properly calls signal handlers if necessary, and
+ retries sending if these returned successfully, including on sockets with a
+ timeout.
+
+- Issue #9947: logging: Fixed locking bug in stopListening.
+
+- Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
- Issue #9936: Fixed executable lines' search in the trace module.
+- Issue #9790: Rework imports necessary for samefile and sameopenfile
+ in ntpath.
+
- Issue #9928: Properly initialize the types exported by the bz2 module.
-- Issue #9854: The default read() implementation in io.RawIOBase now
- handles non-blocking readinto() returning None correctly.
+- Issue #1675951: Allow GzipFile to work with unseekable file objects. Patch by
+ Florian Festi.
-- Issue #9853: Fix the signature of SSLSocket.recvfrom() and
- SSLSocket.sendto() to match the corresponding socket methods.
+- Logging: Added QueueListener class to facilitate logging usage for
+ performance-critical threads.
-- Issue #9792: In case of connection failure, socket.create_connection()
- would swallow the exception and raise a new one, making it impossible
- to fetch the original errno, or to filter timeout errors. Now the
- original error is re-raised.
+- Issue #9916: Add some missing errno symbols.
-- Issue #9826: OrderedDict.__repr__ can now handle self-referential
- values: d['x'] = d.
+- Issue #9877: Expose sysconfig.get_makefile_filename()
-- Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True,
- and the passed buffer was exactly 1024 bytes long, the buffer wouldn't
- be updated back after the system call. Original patch by Brian Brazil.
+- logging: Added hasHandlers() method to Logger and LoggerAdapter.
-- Issue #6656: fix locale.format_string to handle escaped percents
- and mappings.
+- Issue #9908: Fix os.stat() on bytes paths under Windows 7.
-- Issue #1100562: Fix deep-copying of objects derived from the list and
- dict types. Patch by Michele Orrù and Björn Lindqvist.
+- Issue #2643: msync() is not called anymore when deallocating an open mmap
+ object, only munmap().
-- Issue #9753: Fixed socket.dup, which did not always work correctly
- on Windows.
+- logging: Changed LoggerAdapter implementation internally, to make it easier to
+ subclass in a useful way.
-- Issue #1868: Eliminate subtle timing issues in thread-local objects by
- getting rid of the cached copy of thread-local attribute dictionary.
+- logging: hasHandlers method was added to Logger, and isEnabledFor,
+ getEffectiveLevel, hasHandlers and setLevel were added to LoggerAdapter.
+ LoggerAdapter was introduced into the unit tests for logging.
-- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
- falling into recursion.
+- Issue #1686: Fix string.Template when overriding the pattern attribute.
-- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
- character years even if the message contains RFC822 two character years.
+- Issue #9854: SocketIO objects now observe the RawIOBase interface in
+ non-blocking mode: they return None when an operation would block (instead of
+ raising an exception).
-- Issue #8750: Fixed MutableSet's methods to correctly handle
- reflexive operations, namely x -= x and x ^= x.
+- Issue #1730136: Fix the comparison between a tk.font.Font and an object of
+ another kind.
-- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing
- error handling when accepting a new connection.
+- Issue #9441: logging has better coverage for rotating file handlers.
-- Issue #658749: asyncore's connect() method now correctly interprets winsock
- errors.
+- Issue #9865: collections.OrderedDict now has a __sizeof__ method.
-- Issue #9214: Set operations on KeysView or ItemsView in the collections
- module now correctly return a set. (Patch by Eli Bendersky.)
+- Issue #9854: The default read() implementation in io.RawIOBase now handles
+ non-blocking readinto() returning None correctly.
-- Issue #9617: Signals received during a low-level write operation aren't
- ignored by the buffered IO layer anymore.
+- Issue #1552: socket.socketpair() now returns regular socket.socket objects
+ supporting the whole socket API (rather than the "raw" _socket.socket
+ objects).
-- Issue #9605: posix.getlogin() decodes the username with file filesystem
- encoding and surrogateescape error handler. Patch written by David Watson.
+- Issue #9853: Fix the signature of SSLSocket.recvfrom() and SSLSocket.sendto()
+ to match the corresponding socket methods.
-- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
- using the filesystem encoding and surrogateescape error handler. Patch
- written by David Watson.
+- Issue #9840: Added a decorator to reprlib for wrapping __repr__ methods to make
+ them handle recursive calls within the same thread.
-- Issue #8688: MANIFEST files created by distutils now include a magic
- comment indicating they are generated. Manually maintained MANIFESTs
- without this marker will not be overwritten or removed.
+- logging: Enhanced HTTPHandler with secure and credentials initializers.
-- Issue #7467: when reading a file from a ZIP archive, its CRC is checked
- and a BadZipfile error is raised if it doesn't match (as used to be the
- case in Python 2.5 and earlier).
+- Issue #767645: Set os.path.supports_unicode_filenames to True on Mac OS X.
-- Issue #9550: a BufferedReader could issue an additional read when the
- original read request had been satisfied, which could block indefinitely
- when the underlying raw IO channel was e.g. a socket. Report and original
- patch by Jason V. Miller.
+- Issue #9837: The read() method of ZipExtFile objects (as returned by
+ ZipFile.open()) could return more bytes than requested.
-- Issue #6915: Under Windows, os.listdir() didn't release the Global
- Interpreter Lock around all system calls. Original patch by Ryan Kelly.
+- Issue #9826: OrderedDict.__repr__ can now handle self-referential values:
+ d['x'] = d.
-- Issue #3757: thread-local objects now support cyclic garbage collection.
- Thread-local objects involved in reference cycles will be deallocated
- timely by the cyclic GC, even if the underlying thread is still running.
+- Issue #9825: Using __del__ in the definition of collections.OrderedDict made
+ it possible for the user to create self-referencing ordered dictionaries which
+ become permanently uncollectable GC garbage. Reinstated the Python 3.1
+ approach of using weakref proxies so that reference cycles never get created
+ in the first place.
-- Fix Issue8280 - urllib2's Request method will remove fragements in the url.
- This is how it is supposed to work, wget and curl do the same. Previous
- behavior was wrong.
+- Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and
+ encode the value with filesystem encoding and surrogateescape (instead of
+ utf-8 in strict mode) . Patch written by David Watson.
-- Issue #2944: asyncore doesn't handle connection refused correctly.
+- Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
+ environment variable to set the filesystem encoding at Python startup.
+ sys.setfilesystemencoding() creates inconsistencies because it is unable to
+ reencode all filenames in all objects.
-- Issue #3196: email header decoding is now forgiving if an RFC2047
- encoded word encoded in base64 is lacking padding.
+- Issue #9410: Various optimizations to the pickle module, leading to speedups
+ up to 4x (depending on the benchmark). Mostly ported from Unladen Swallow;
+ initial patch by Alexandre Vassalotti.
-- Issue #8447: Make distutils.sysconfig follow symlinks in the path to
- the interpreter executable. This fixes a failure of test_httpservers
- on OS X.
+- The pprint module now supports printing OrderedDicts in their given order
+ (formerly, it would sort the keys).
-- Issue #7372: Fix pstats regression when stripping paths from profile
- data generated with the profile module.
+- Logging: Added QueueHandler class to facilitate logging usage with
+ multiprocessing.
-- Issue #4108: In urllib.robotparser, if there are multiple 'User-agent: *'
- entries, consider the first one.
+- Issue #9707: Rewritten reference implementation of threading.local which is
+ friendlier towards reference cycles. This change is not normally visible
+ since an optimized C implementation (_thread._local) is used instead.
-- Issue #8397: Raise an error when attempting to mix iteration and regular
- reads on a BZ2File object, rather than returning incorrect results.
+- Issue #6394: os.getppid() is now supported on Windows. Note that it will
+ still return the id of the parent process after it has exited. This process
+ id may even have been reused by another unrelated process.
-- Issue #7909: Do not touch paths with the special prefixes ``\\.\``
- or ``\\?\`` in ntpath.normpath().
+- Issue #9792: In case of connection failure, socket.create_connection() would
+ swallow the exception and raise a new one, making it impossible to fetch the
+ original errno, or to filter timeout errors. Now the original error is
+ re-raised.
-- Issue #5294: Fix the behavior of pdb's "continue" command when called
- in the top-level debugged frame.
+- Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True, and
+ the passed buffer was exactly 1024 bytes long, the buffer wouldn't be updated
+ back after the system call. Original patch by Brian Brazil.
-- Issue #5727: Restore the ability to use readline when calling into pdb
- in doctests.
+- Updates to the random module:
-- Issue #6719: In pdb, do not stop somewhere in the encodings machinery
- if the source file to be debugged is in a non-builtin encoding.
+ * Document which parts of the module are guaranteed to stay the same across
+ versions and which parts are subject to change.
-- Issue #8048: Prevent doctests from failing when sys.displayhook has
- been reassigned.
+ * Update the seed() method to use all of the bits in a string instead of just
+ the hash value. This makes better use of the seed value and assures the
+ seeding is platform independent. Issue #7889.
-- Issue #8015: In pdb, do not crash when an empty line is entered as
- a breakpoint command.
+ * Improved the random()-->integer algorithm used in choice(), shuffle(),
+ sample(), randrange(), and randint(). Formerly, it used int(n*random())
+ which has a slight bias whenever n is not a power of two. Issue #9025.
-- Issue #5146: Handle UID THREAD command correctly in imaplib.
+ * Improved documentation of arguments to randrange(). Issue #9379.
-- Issue #5147: Fix the header generated for cookie files written by
- http.cookiejar.MozillaCookieJar.
+- collections.OrderedDict now supports a new method for repositioning keys to
+ either end.
-- Issue #8198: In pydoc, output all help text to the correct stream
- when sys.stdout is reassigned.
+- Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest test
+ cases now also have assertWarns and assertWarnsRegexp methods to check that a
+ given warning type was triggered by the code under test.
-- Issue #8230: Fix Lib/test/sortperf.py.
+- Issue #5506: BytesIO objects now have a getbuffer() method exporting a view of
+ their contents without duplicating them. The view is both readable and
+ writable.
-- Issue #7395: Fix tracebacks in pstats interactive browser.
+- Issue #7566: Implement os.path.sameopenfile for Windows.
-- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
- across devices.
+- Issue #9293: I/O streams now raise ``io.UnsupportedOperation`` when an
+ unsupported operation is attempted (for example, writing to a file open only
+ for reading).
-- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
+- hashlib has two new constant attributes: algorithms_guaranteed and
+ algorithms_avaiable that respectively list the names of hash algorithms
+ guaranteed to exist in all Python implementations and the names of hash
+ algorithms available in the current process.
-- Issue #1690103: Fix initial namespace for code run with trace.main().
+- A new package ``concurrent.futures`` as defined by PEP 3148.
-- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
+C-API
+-----
-- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
- re-initializing a buffered IO object by calling its ``__init__`` method.
+- Add PyErr_SyntaxLocationEx, which supports passing a column offset.
-- Issue #8620: when a Cmd is fed input that reaches EOF without a final
- newline, it no longer truncates the last character of the last command line.
+- Issue #9834: Don't segfault in PySequence_GetSlice, PySequence_SetSlice, or
+ PySequence_DelSlice when the object doesn't have any mapping operations
+ defined.
-- Issue #3704: http.cookiejar was not properly handling URLs with a / in the
- parameters.
+Tools/Demos
+-----------
-- Issue #4629: getopt raises an error if an argument ends with = whereas getopt
- doesn't except a value (eg. --help= is rejected if getopt uses ['help='] long
- options).
+- Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well as
+ wide (UCS4) unicode builds for both the host interpreter (embedded inside gdb)
+ and the interpreter under test.
-- Issue #7895: platform.mac_ver() no longer crashes after calling os.fork()
+Tests
+-----
-- Issue #9323: Fixed a bug in trace.py that resulted in loosing the
- name of the script being traced. Patch by Eli Bendersky.
+- Issue #9308: Added tests for importing encoded modules that do not
+ depend on specific stdlib modules being encoded in a certain way.
-- Issue #9282: Fixed --listfuncs option of trace.py. Thanks Eli
- Bendersky for the patch.
+- Issue #1051: Add a script (Lib/test/make_ssl_certs.py) to generate the custom
+ certificate and private key files used by SSL-related certs.
-- Issue #1555570: email no longer inserts extra blank lines when a \r\n
- combo crosses an 8192 byte boundary.
+- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
+ in test_os)
-- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
+- Issue #7110: regrtest now sends test failure reports and single-failure
+ tracebacks to stderr rather than stdout.
-- Issue #9137: Fix issue in MutableMapping.update, which incorrectly
- treated keyword arguments called 'self' or 'other' specially.
+- Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
-- Issue #7646: The fnmatch pattern cache no longer grows without bound.
+- Issue #9899: Fix test_tkinter.test_font on various platforms. Patch by Ned
+ Deily.
-- Issue #9136: Fix 'dictionary changed size during iteration'
- RuntimeError produced when profiling the decimal module. This was
- due to a dangerous iteration over 'locals()' in Context.__init__.
+- Issue #9894: Do not hardcode ENOENT in test_subprocess.
-- Fix extreme speed issue in Decimal.pow when the base is an exact
- power of 10 and the exponent is tiny (for example,
- Decimal(10) ** Decimal('1e-999999999')).
+- Issue #9315: Added tests for the trace module. Patch by Eli Bendersky.
-- Issue #9130: Fix validation of relative imports in parser module.
+- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
+ case when running profile or trace, for example.
-- Issue #9128: Fix validation of class decorators in parser module.
+- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
-- Issue #5468: urlencode to handle bytes type and other encodings in its query
- parameter. Patch by Dan Mahn.
+Build
+-----
-- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop
- module, ensure that the input string length is a multiple of the frame size
+- Issue #10062: Allow building on platforms which do not have sem_timedwait.
-- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
- raises an exception.
+- Issue #10054: Some platforms provide uintptr_t in inttypes.h. Patch by Akira
+ Kitada.
-- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag
- on an OpenSSL structure.
+- Issue #10055: Make json C89-compliant in UCS4 mode.
-- Issue #8682: The ssl module now temporary increments the reference count of
- a socket object got through ``PyWeakref_GetObject``, so as to avoid possible
- deallocation while the object is still being used.
+- Issue #9552: Avoid unnecessary rebuild of OpenSSL. (Windows)
-- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
- password instead of presenting an interactive prompt. Older behavior can be
- obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
+- Issue #1633863: Don't ignore $CC under AIX.
-- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
+- Issue #9810: Compile bzip2 source files in Python's project file directly. It
+ used to be built with bzip2's makefile.
-- Issue #8720: fix regression caused by fix for #4050 by making getsourcefile
- smart enough to find source files in the linecache.
+- Issue #9848: Stopping trying to build _weakref in setup.py as it is a built-in
+ module.
-- Issue #5610: feedparser no longer eats extra characters at the end of
- a body part if the body part ends with a \r\n.
+- Issue #9806: python-config now has an ``--extension-suffix`` option that
+ outputs the suffix for dynamic libraries including the ABI version name
+ defined by PEP 3149.
-- Fix codecs.escape_encode to return the correct consumed size.
+- Issue #941346: Improve the build process under AIX and allow Python to be
+ built as a shared library. Patch by Sébastien Sablé.
-- Issue #8897: Fix sunau module, use bytes to write the header. Patch written
- by Thomas Jollans.
+- Issue #4026: Make the fcntl extension build under AIX. Patch by Sébastien
+ Sablé.
-- Issue #6470: Drop UNC prefix in FixTk.
+- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
+ the "bin" directory inside the framework is on the shell's search path. This
+ feature now also supports the ZSH shell.
-- Issue #4768: base64 encoded email body parts were incorrectly stored as
- binary strings. They are now correctly converted to strings.
-- Issue #8833: tarfile created hard link entries with a size field != 0 by
- mistake.
+What's New in Python 3.2 Alpha 2?
+=================================
-- Charset.body_encode now correctly handles base64 encoding by encoding
- with the output_charset before calling base64mime.encode. Passes the
- tests from 2.x issue #1368247.
+*Release date: 05-Sep-2010*
-- Issue #7150: Raise OverflowError if the result of adding or subtracting
- timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
+Core and Builtins
+-----------------
-- Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer
- and sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes
- API
+- Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced by
+ the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but our
+ bytecode is a bit simplified. Patch by Demur Rumed.
-- Issue #6662: Fix parsing of malformatted charref (&#bad;), patch written by
- Fredrik Håård
+- Issue #9766: Rename poorly named variables exposed by _warnings to prevent
+ confusion with the proper variables names from 'warnings' itself.
-- Issue #6268: Fix seek() method of codecs.open(), don't read or write the BOM
- twice after seek(0). Fix also reset() method of codecs, UTF-16, UTF-32 and
- StreamWriter classes.
+- Issue #9212: dict_keys and dict_items now provide the isdisjoint() method, to
+ conform to the Set ABC. Patch by Daniel Urban.
-- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
- of files without one.
+- Issue #9737: Fix a crash when trying to delete a slice or an item from a
+ memoryview object.
-- Issue #8729: Return NotImplemented from collections.Mapping.__eq__ when
- comparing to a non-mapping.
+- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding() are
+ now removed, since their effect was inexistent in 3.x (the default encoding is
+ hardcoded to utf-8 and cannot be changed).
-- Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
- correct encoding
+- Issue #7415: PyUnicode_FromEncodedObject() now uses the new buffer API
+ properly. Patch by Stefan Behnel.
-- Issue #7507: Quote "!" in pipes.quote(); it is special to some shells.
+- Issue #5553: The Py_LOCAL_INLINE macro now results in inlining on most
+ platforms. Previously, it inlined only when using Microsoft Visual C.
-- Issue #8663: distutils.log emulates backslashreplace error handler. Fix
- compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if
- stdout is not a TTY).
+- Issue #9712: Fix tokenize on identifiers that start with non-ascii names.
-- Issue #1285086: Speed up urllib.parse functions: quote, quote_from_bytes,
- unquote, unquote_to_bytes.
+- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t.
-- Issue #8688: Distutils now recalculates MANIFEST everytime.
+- Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h, to match
+ the pyconfig.h generated by configure on other systems.
-- Issue #5099: subprocess.Popen.__del__ no longer references global objects
- to prevent issues during interpreter shutdown.
+- Issue #9666: Only catch AttributeError in hasattr(). All other exceptions that
+ occur during attribute lookup are now propagated to the caller.
-- Issue #8681: Make the zlib module's error messages more informative when
- the zlib itself doesn't give any detailed explanation.
+- Issue #8622: Add PYTHONFSENCODING environment variable to override the
+ filesystem encoding.
-- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
- overflow checks in the audioop module.
+- Issue #5127: The C functions that access the Unicode Database now accept and
+ return characters from the full Unicode range, even on narrow unicode builds
+ (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others). A visible difference
+ in Python is that unicodedata.numeric() now returns the correct value for
+ large code points, and repr() may consider more characters as printable.
-- Issue #8571: Fix an internal error when compressing or decompressing a
- chunk larger than 1GB with the zlib module's compressor and decompressor
- objects.
+- Issue #9425: Create PyModule_GetFilenameObject() function to get the filename
+ as a unicode object, instead of a byte string. Function needed to support
+ unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new
+ function.
-- Issue #8573: asyncore _strerror() function might throw ValueError.
+- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
-- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing
- error messages when accessing undefined class attributes because of the cheap
- inheritance with the underlying socket object.
+- Issue #9612: The set object is now 64-bit clean under Windows.
-- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
- character sets will now consistently use a Content-Transfer-Encoding of
- 7bit rather than sometimes being marked as 8bit.
+- Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching for
+ the module file to be executed with the -m command line option.
-- Issue #4265: shutil.copyfile() was leaking file descriptors when disk fills.
- Patch by Tres Seaver.
+- Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr() functions to
+ write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
+ sys.stderr.
-- Issue #7755: Use an unencumbered audio file for tests.
+- Issue #9542: Create PyUnicode_FSDecoder() function, a ParseTuple converter:
+ decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str
+ objects are output as-is.
-- Issue #8621: uuid.uuid4() returned the same sequence of values in the
- parent and any children created using ``os.fork`` on MacOS X 10.6.
+- Issue #9203: Computed gotos are now enabled by default on supported compilers
+ (which are detected by the configure script). They can still be disable
+ selectively by specifying --without-computed-gotos.
-- Issue #8567: Fix precedence of signals in Decimal module: when a
- Decimal operation raises multiple signals and more than one of those
- signals is trapped, the specification determines the order in which
- the signals should be handled. In many cases this order wasn't
- being followed, leading to the wrong Python exception being raised.
+- Issue #9425: Create PyErr_WarnFormat() function, similar to PyErr_WarnEx() but
+ use PyUnicode_FromFormatV() to format the warning message.
-- Issue #7865: The close() method of :mod:`io` objects should not swallow
- exceptions raised by the implicit flush(). Also ensure that calling
- close() several times is supported. Patch by Pascal Chambon.
+- Issue #8530: Prevent stringlib fastsearch from reading beyond the front of an
+ array.
-- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
- gc.DEBUG_STATS.
+- Issue #5319: Print an error if flushing stdout fails at interpreter shutdown.
+
+- Issue #9337: The str() of a float or complex number is now identical to its
+ repr().
-- Issue #8354: The siginterrupt setting is now preserved for all signals,
- not just SIGCHLD.
+- Issue #9416: Fix some issues with complex formatting where the output with no
+ type specifier failed to match the str output:
-- Issue #8464: tarfile no longer creates files with execute permissions set
- when mode="w|" is used.
+ - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
+ - format(complex(0.0, 2.0), '-') included a sign and parentheses.
-- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions
- of the Linux kernel. Patch by Yaniv Aknin.
+Extension Modules
+-----------------
-- Issue #6312: Fixed http HEAD request when the transfer encoding is chunked.
- It should correctly return an empty response now.
+- Issue #8013: time.asctime and time.ctime no longer call system
+ asctime and ctime functions. The year range for time.asctime is now
+ 1900 through maxint. The range for time.ctime is the same as for
+ time.localtime. The string produced by these functions is longer
+ than 24 characters when year is greater than 9999.
-- Issue #8549: Fix compiling the _ssl extension under AIX. Patch by
- Sridhar Ratnakumar.
+- Issue #6608: time.asctime is now checking struct tm fields its input
+ before passing it to the system asctime. Patch by MunSic Jeong.
-- Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates
- and bytes strings for environment keys and values, and use
- sys.getfilesystemencoding() instead of sys.getdefautltencoding()
+- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
+ descriptor is provided. Patch by Pascal Chambon.
-- Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown,
- where the method could block indefinitely if called just before the
- event loop started running. This also fixes the occasional freezes
- witnessed in test_httpservers.
+- Issue #7736: Release the GIL around calls to opendir() and closedir() in the
+ posix module. Patch by Marcin Bachry.
-- Issue #8524: When creating an SSL socket, the timeout value of the
- original socket wasn't retained (instead, a socket with a positive timeout
- would be turned into a non-blocking SSL socket).
+- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private to the
+ socket module, and fix the width of socket descriptors to be correctly
+ detected under 64-bit Windows.
-- Issue #5103: SSL handshake would ignore the socket timeout and block
- indefinitely if the other end didn't respond.
+- Issue #1027206: Support IDNA in gethostbyname, gethostbyname_ex, getaddrinfo
+ and gethostbyaddr. getnameinfo is now restricted to numeric addresses as
+ input.
-- The do_handshake() method of SSL objects now adjusts the blocking mode of
- the SSL structure if necessary (as other methods already do).
+- Issue #9214: Set operations on a KeysView or ItemsView in collections now
+ correctly return a set. Patch by Eli Bendersky.
-- Issue #8108: Fix the unwrap() method of SSL objects when the socket has
- a non-infinite timeout. Also make that method friendlier with applications
- wanting to continue using the socket in clear-text mode, by disabling
- OpenSSL's internal readahead. Thanks to Darryl Miles for guidance.
+- Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
+ Matthew Ahrens.
-- Issue #8468: bz2.BZ2File() accepts str with surrogates and bytes filenames
+- Restore GIL in nis_cat in case of error. Decode NIS data to fs encoding, using
+ the surrogate error handler.
-- Issue #8496: make mailcap.lookup() always return a list, rather than an
- iterator. Patch by Gregory Nofi.
+- Issue #665761: ``functools.reduce()`` will no longer mask exceptions other
+ than ``TypeError`` raised by the iterator argument.
-- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
- collation name contains a surrogate character.
+- Issue #9570: Use PEP 383 decoding in os.mknod and os.mkfifo.
-- Issue #8484: Load all ciphers and digest algorithms when initializing
- the _ssl extension, such that verification of some SSL certificates
- doesn't fail because of an "unknown algorithm".
+- Issue #6915: Under Windows, os.listdir() didn't release the Global Interpreter
+ Lock around all system calls. Original patch by Ryan Kelly.
-- Issue #4814: timeout parameter is now applied also for connections resulting
- from PORT/EPRT commands.
+- Issue #8524: Add a detach() method to socket objects, so as to put the socket
+ into the closed state without closing the underlying file descriptor.
-- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response
- code as stated in RFC-959 at chapter 5.4.
+- Issue #477863: Emit a ResourceWarning at shutdown if gc.garbage is not empty.
-- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
- surrogates.
+- Issue #6869: Fix a refcount problem in the _ctypes extension.
-- Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
- using backslashreplace error handler
+- Issue #5504: ctypes should now work with systems where mmap can't be
+ PROT_WRITE and PROT_EXEC.
-- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
+- Issue #9507: Named tuple repr will now automatically display the right name in
+ a tuple subclass.
-- Issue #8383: pickle and pickletools use surrogatepass error handler when
- encoding unicode as utf8 to support lone surrogates and stay compatible with
- Python 2.x and 3.0
+- Issue #9324: Add parameter validation to signal.signal on Windows in order to
+ prevent crashes.
-- Issue #8179: Fix macpath.realpath() on a non-existing path.
+- Issue #9526: Remove some outdated (int) casts that were preventing the array
+ module from working correctly with arrays of more than 2**31 elements.
-- Issue #8139: ossaudiodev didn't initialize its types properly, therefore
- some methods (such as oss_mixer_device.fileno()) were not available.
- Initial patch by Bertrand Janin.
+- Fix memory leak in ssl._ssl._test_decode_cert.
-- Issue #7512: shutil.copystat() could raise an OSError when the filesystem
- didn't support chflags() (for example ZFS under FreeBSD). The error is
- now silenced.
+- Issue #8065: Fix memory leak in readline module (from failure to free the
+ result of history_get_history_state()).
-- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
- Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
- reads and writes are always retried by OpenSSL itself.
+- Issue #9450: Fix memory leak in readline.replace_history_item and
+ readline.remove_history_item for readline version >= 5.0.
-- Issue #6716/2: Backslash-replace error output in compilall.
+- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
-Extension Modules
------------------
+- Issue #8046: Add context manager protocol support and .closed property to mmap
+ objects.
-- Issue #6317: Now winsound.PlaySound can accept non ascii filename.
+Library
+-------
-- Issue #9054: Fix a crash occurring when using the pyexpat module
- with expat version 2.0.1.
+- Issue #7451: Improve decoding performance of JSON objects, and reduce the
+ memory consumption of said decoded objects when they use the same strings as
+ keys.
-- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
- introduced by issue #9324.
+- Issue #1100562: Fix deep-copying of objects derived from the list and dict
+ types. Patch by Michele Orrù and Björn Lindqvist.
-- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
- descriptor is provided. Patch by Pascal Chambon.
+- Issue #9753: Fixed socket.dup, which did not always work correctly on Windows.
-- Issue #7736: Release the GIL around calls to opendir() and closedir()
- in the posix module. Patch by Marcin Bachry.
+- Issue #9421: Made the get<type> methods consistently accept the vars and
+ default arguments on all parser classes.
-- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private
- to the socket module, and fix the width of socket descriptors to be
- correctly detected under 64-bit Windows.
+- Issue #7005: Fixed output of None values for RawConfigParser.write and
+ ConfigParser.write.
-- Issue #665761: ``functools.reduce()`` will no longer mask exceptions
- other than ``TypeError`` raised by the iterator argument.
+- Issue #8990: array.fromstring() and array.tostring() get renamed to
+ frombytes() and tobytes(), respectively, to avoid confusion. Furthermore,
+ array.frombytes(), array.extend() as well as the array.array() constructor now
+ accept bytearray objects. Patch by Thomas Jollans.
-- Issue #9570: Use PEP 383 decoding in os.mknod and os.mkfifo.
+- Issue #808164: Fixed socket.close to avoid references to globals, to avoid
+ issues when socket.close is called from a __del__ method.
-- Issue #9324: Add parameter validation to signal.signal on Windows in order
- to prevent crashes.
+- Issue #9706: ssl module provides a better error handling in various
+ circumstances.
-- Issue #9526: Remove some outdated (int) casts that were preventing
- the array module from working correctly with arrays of more than
- 2**31 elements.
+- Issue #1868: Eliminate subtle timing issues in thread-local objects by getting
+ rid of the cached copy of thread-local attribute dictionary.
-- Fix memory leak in ssl._ssl._test_decode_cert.
+- Issue #1512791: In setframerate() in the wave module, non-integral frame rates
+ are rounded to the nearest integer.
-- Issue #8065: Fix memory leak in readline module (from failure to
- free the result of history_get_history_state()).
+- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
+ falling into recursion.
-- Issue #9450: Fix memory leak in readline.replace_history_item and
- readline.remove_history_item for readline version >= 5.0.
+- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
+ character years even if the message contains RFC822 two character years.
-- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
+- Issue #8750: Fixed MutableSet's methods to correctly handle reflexive
+ operations on its self, namely x -= x and x ^= x.
-- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
+- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing error
+ handling when accepting a new connection.
-- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
- compared to other unix systems. In particular, os.getgroups() does
- not reflect any changes made using os.setgroups() but basicly always
- returns the same information as the id command.
+- Issue #9601: ftplib now provides a workaround for non-compliant
+ implementations such as IIS shipped with Windows server 2003 returning invalid
+ response codes for MKD and PWD commands.
- os.getgroups() can now return more than 16 groups on MacOSX.
+- Issue #658749: asyncore's connect() method now correctly interprets winsock
+ errors.
-- Issue #7384: If the system readline library is linked against
- ncurses, do not link the readline module against ncursesw. The
- additional restriction of linking the readline and curses modules
- against the same curses library is currently not enabled.
+- Issue #9501: Fixed logging regressions in cleanup code.
-- Issue #8973: Add __all__ to struct module; this ensures that
- help(struct) includes documentation for the struct.Struct class.
+- Fix functools.total_ordering() to skip methods inherited from object.
-- Issue #2810: Fix cases where the Windows registry API returns
- ERROR_MORE_DATA, requiring a re-try in order to get the complete result.
+- Issue #9572: Importlib should not raise an exception if a directory it thought
+ it needed to create was done concurrently by another process.
-Build
------
+- Issue #9617: Signals received during a low-level write operation aren't
+ ignored by the buffered IO layer anymore.
-- Issue #8852: Allow the socket module to build on OpenSolaris.
+- Issue #843590: Make "macintosh" an alias to the "mac_roman" encoding.
-- Issue #10054: Some platforms provide uintptr_t in inttypes.h. Patch by
- Akira Kitada.
+- Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
+ error handler, or strict error handler on Windows.
-- Issue #10055: Make json C89-compliant in UCS4 mode.
+- Issue #3488: Provide convenient shorthand functions ``gzip.compress`` and
+ ``gzip.decompress``. Original patch by Anand B. Pillai.
-- Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
+- Issue #8807: poplib.POP3_SSL class now accepts a context parameter, which is a
+ ssl.SSLContext object allowing bundling SSL configuration options,
+ certificates and private keys into a single (potentially long-lived)
+ structure.
-- Issue #1633863: Don't ignore $CC under AIX.
+- Issue #8866: parameters passed to socket.getaddrinfo can now be specified as
+ single keyword arguments.
-- Issue #9810: Compile bzip2 source files in python's project file
- directly. It used to be built with bzip2's makefile.
+- Address XXX comment in dis.py by having inspect.py prefer to reuse the dis.py
+ compiler flag values over defining its own.
-- Issue #941346: Improve the build process under AIX and allow Python to
- be built as a shared library. Patch by Sébastien Sablé.
+- Issue #9147: Added dis.code_info() which is similar to show_code() but returns
+ formatted code information in a string rather than displaying on screen.
-- Issue #4026: Make the fcntl extension build under AIX. Patch by Sébastien
- Sablé.
+- Issue #9567: functools.update_wrapper now adds a __wrapped__ attribute
+ pointing to the original callable.
-- Issue #3101: Helper functions _add_one_to_index_C() and
- _add_one_to_index_F() become _Py_add_one_to_index_C() and
- _Py_add_one_to_index_F(), respectively.
+- Issue #3445: functools.update_wrapper now tolerates missing attributes on
+ wrapped callables.
-- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x. Patch by
- Sébastien Sablé.
+- Issue #5867: Add abc.abstractclassmethod and abc.abstractstaticmethod.
-- Issue #3928: os.mknod() now available in Solaris, also.
+- Issue #9605: posix.getlogin() decodes the username with file filesystem
+ encoding and surrogateescape error handler. Patch written by David Watson.
-- Issue #6716: Quote -x arguments of compileall in MSI installer.
- Exclude 2to3 tests from compileall.
+- Issue #9604: posix.initgroups() encodes the username using the fileystem
+ encoding and surrogateescape error handler. Patch written by David Watson.
-- Issue #1628484: The Makefile doesn't ignore the CFLAGS environment
- variable anymore. It also forwards the LDFLAGS settings to the linker
- when building a shared library.
+- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
+ using the filesystem encoding and surrogateescape error handler. Patch written
+ by David Watson.
-- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
- the "bin" directory inside the framework is on the shell's search path. This
- feature now also supports the ZSH shell.
+- Issue #7647: The posix module now has the ST_RDONLY and ST_NOSUID constants,
+ for use with the statvfs() function. Patch by Adam Jackson.
-- Issue #7473: avoid link errors when building a framework with a different
- set of architectures than the one that is currently installed.
+- Issue #8688: MANIFEST files created by distutils now include a magic comment
+ indicating they are generated. Manually maintained MANIFESTs without this
+ marker will not be overwritten or removed.
-Tests
------
+- Issue #7467: when reading a file from a ZIP archive, its CRC is checked and a
+ BadZipfile error is raised if it doesn't match (as used to be the case in
+ Python 2.5 and earlier).
-- Issue #3699: Fix test_bigaddrspace and extend it to test bytestrings
- as well as unicode strings. Initial patch by Sandro Tosi.
+- Issue #9550: a BufferedReader could issue an additional read when the original
+ read request had been satisfied, which could block indefinitely when the
+ underlying raw IO channel was e.g. a socket. Report and original patch by
+ Jason V. Miller.
-- Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
+- Issue #3757: thread-local objects now support cyclic garbage collection.
+ Thread-local objects involved in reference cycles will be deallocated timely
+ by the cyclic GC, even if the underlying thread is still running.
-- Issue #9894: Do not hardcode ENOENT in test_subprocess.
+- Issue #9452: Add read_file, read_string, and read_dict to the configparser
+ API; new source attribute to exceptions.
-- Issue #9315: Added tests for the trace module. Patch by Eli Bendersky.
+- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the current
+ node.
-- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
+- Issue #8047: Fix the xml.etree serializer to return bytes by default. Use
+ ``encoding="unicode"`` to generate a Unicode string.
-- Issue #8857: Provide a test case for socket.getaddrinfo.
+- Issue #8280: urllib2's Request method will remove fragments in the url. This
+ is how it is supposed to work, wget and curl do the same. Previous behavior
+ was wrong.
-- Issue #8433: Fix test_curses failure with newer versions of ncurses.
+- Issue #6683: For SMTP logins we now try all authentication methods advertised
+ by the server. Many servers are buggy and advertise authentication methods
+ they do not support in reality.
-- Issue #9496: Provide a test suite for the rlcompleter module. Patch by
- Michele Orrù.
+- Issue #8814: function annotations (the ``__annotations__`` attribute) are now
+ included in the set of attributes copied by default by functools.wraps and
+ functools.update_wrapper. Patch by Terrence Cole.
-- Issue #9251: test_threaded_import didn't fail when run through regrtest
- if the import lock was disabled.
+- Issue #2944: asyncore doesn't handle connection refused correctly.
-- Issue #7449: Skip test_socketserver if threading support is disabled
+- Issue #4184: Private attributes on smtpd.SMTPChannel made public and deprecate
+ the private attributes. Add tests for smtpd module.
-- Issue #8672: Add a zlib test ensuring that an incomplete stream can be
- handled by a decompressor object without errors (it returns incomplete
- uncompressed data).
+- Issue #3196: email header decoding is now forgiving if an RFC2047 encoded word
+ encoded in base64 is lacking padding.
-- Issue #8629: Disable some test_ssl tests, since they give different
- results with OpenSSL 1.0.0 and higher.
+- Issue #9444: Argparse now uses the first element of prefix_chars as the option
+ character for the added 'h/help' option if prefix_chars does not contain a
+ '-', instead of raising an error.
-- Issue #8533: regrtest uses backslashreplace error handler for stdout to avoid
- UnicodeEncodeError (write non-ASCII character to stdout using ASCII encoding)
+- Issue #7372: Fix pstats regression when stripping paths from profile data
+ generated with the profile module.
-- Issue #8576: Remove use of find_unused_port() in test_smtplib and
- test_multiprocessing. Patch by Paul Moore.
+- Issue #9428: Fix running scripts with the profile/cProfile modules from the
+ command line.
-- Issue #8531: Skip test_ascii_formatd if ctypes module is missing
+- Issue #7781: Fix restricting stats by entry counts in the pstats interactive
+ browser.
-- Issue #3864: Skip three test_signal tests on freebsd6 because they fail
- if any thread was previously started, most likely due to a platform bug.
+- Issue #9209: Do not crash in the pstats interactive browser on invalid regular
+ expressions.
-- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
+- Update collections.OrderedDict to match the implementation in Py2.7 (based on
+ lists instead of weakly referenced Link objects).
-- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
+- Issue #8397: Raise an error when attempting to mix iteration and regular reads
+ on a BZ2File object, rather than returning incorrect results.
-Documentation
--------------
+- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
+ re-initializing a buffered IO object by calling its ``__init__`` method.
-- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
- to Doc/license.rst.
+- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
+ across devices.
-- Issue #9255: Document that the 'test' package is meant for interal Python use
- only.
+- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
+
+- Issue #1690103: Fix initial namespace for code run with trace.main().
+
+- Issue #7395: Fix tracebacks in pstats interactive browser.
+
+- Issue #8230: Fix Lib/test/sortperf.py.
+
+- Issue #8620: when a cmd.Cmd() is fed input that reaches EOF without a final
+ newline, it no longer truncates the last character of the last command line.
+
+- Issue #5146: Handle UID THREAD command correctly in imaplib.
+
+- Issue #5147: Fix the header generated for cookie files written by
+ http.cookiejar.MozillaCookieJar.
+
+- Issue #8198: In pydoc, output all help text to the correct stream when
+ sys.stdout is reassigned.
+
+- Issue #7909: Do not touch paths with the special prefixes ``\\.\`` or ``\\?\``
+ in ntpath.normpath().
-- Issue #7829: Document in dis that bytecode is an implementation detail.
+- Issue #1286: Allow using fileinput.FileInput as a context manager.
+
+- Add lru_cache() decorator to the functools module.
Tools/Demos
-----------
-- Issue #7287: Demo/imputil/knee.py was removed.
+- Fix ``Tools/scripts/checkpyc.py`` after PEP 3147.
+- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
+ non-ASCII content.
+Tests
+-----
-What's New in Python 3.1.2?
-===========================
+- Issue #9601: Provide a test case for ftplib.parse257.
-*Release date: 2010-03-20*
+- Issue #8857: Provide a test case for socket.getaddrinfo.
-Core and Builtins
------------------
+- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
-- Issue #7173: Generator finalization could invalidate sys.exc_info().
+- Issue #8433: Fix test_curses failure with newer versions of ncurses.
-Library
--------
+- Issue #9496: Provide a test suite for the rlcompleter module. Patch by
+ Michele Orrù.
-- Issue #2698: The --compiler ignored was ignored for distutils' build_ext.
+- Issue #8687: provide a test suite for sched.py module.
-- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
- with Tcl/Tk-8.5.
+Build
+-----
+
+- Issue #1303434: Generate ZIP file containing all PDBs.
+
+- Issue #9193: PEP 3149 is accepted.
+
+- Issue #3101: Helper functions _add_one_to_index_C() and _add_one_to_index_F()
+ become _Py_add_one_to_index_C() and _Py_add_one_to_index_F(), respectively.
-- Issue #7356: ctypes.util: Make parsing of ldconfig output independent of
- the locale.
+- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x. Patch by
+ Sébastien Sablé.
+- Don't run pgen twice when using make -j.
-What's New in Python 3.1.2 release candidate 1?
-===============================================
-*Release date: 2010-03-06*
+What's New in Python 3.2 Alpha 1?
+=================================
+
+*Release date: 01-Aug-2010*
Core and Builtins
-----------------
-- Issue #7544: Preallocate thread memory before creating the thread to avoid
- a fatal error in low memory condition.
+- Issue #8991: convertbuffer() rejects discontigious buffers.
+
+- Issue #7616: Fix copying of overlapping memoryview slices with the Intel
+ compiler.
+
+- Issue #8413: structsequence now subclasses tuple.
+
+- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
+ start byte and the continuation byte(s) are now considered invalid, instead of
+ the number of bytes specified by the start byte. E.g.:
+ '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and replaces
+ with U+FFFD only the start byte ('\xf1') and the continuation byte ('\x80')
+ even if '\xf1' is the start byte of a 4-bytes sequence. Previous versions
+ returned a single u'\ufffd'.
+
+- Issue #9011: A negated imaginary literal (e.g., "-7j") now has real part -0.0
+ rather than 0.0. So "-7j" is now exactly equivalent to "-(7j)".
+
+- Be more specific in error messages about positional arguments.
-- Issue #7820: The parser tokenizer restores all bytes in the right if
- the BOM check fails.
+- Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
+ objects, as described in the documentation.
+
+- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
+ Fix the encoding of the modules filename. Patch written by Amaury Forgeot
+ d'Arc.
+
+- Issue #9011: Remove buggy and unnecessary (in 3.x) ST->AST compilation code
+ dealing with unary minus applied to a constant. The removed code was mutating
+ the ST, causing a second compilation to fail.
+
+- Issue #850997: mbcs encoding (Windows only) handles errors argument: strict
+ mode raises unicode errors. The encoder only supports "strict" and "replace"
+ error handlers, the decoder only supports "strict" and "ignore" error
+ handlers. Patch written by Mark Hammond.
+
+- Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
+ "w*" format instead. Add tests for "w*" format.
+
+- Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"
+ formats if the string contains a null byte/character. Write unit tests for
+ string formats.
+
+- Issue #7490: To facilitate sharing of doctests between 2.x and 3.x test
+ suites, the IGNORE_EXCEPTION_DETAIL directive now also ignores the module
+ location of the raised exception.
+
+- Issue #8969: On Windows, use mbcs codec in strict mode to encode and decode
+ filenames and enable os.fsencode().
+
+- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
+
+- Issue #8941: Decoding big endian UTF-32 data in UCS-2 builds could crash the
+ interpreter with characters outside the Basic Multilingual Plane (higher than
+ 0x10000).
+
+- Issue #8950: (See also issue #5080). Py_ArgParse*() functions now raise
+ TypeError instead of giving a DeprecationWarning when a float is parsed using
+ the 'L' code (for long long). (All other integer codes already raise
+ TypeError in this case.)
+
+- Issue #8922: Normalize the encoding name in PyUnicode_AsEncodedString() to
+ enable shortcuts for upper case encoding name. Add also a shortcut for
+ "iso-8859-1" in PyUnicode_AsEncodedString() and PyUnicode_Decode().
+
+- Issue #8838: Remove codecs.charbuffer_encode() function. The buffer protocol
+ doesn't support "char buffer" anymore in Python 3.
+
+- Issue #8339: Remove "t#" format of PyArg_Parse*() functions, use "s#" or "s*"
+ instead. codecs.charbuffer_encode() now accepts modifiable buffer objects
+ like bytearray.
+
+- Issue #8837: Remove "O?" format of PyArg_Parse*() functions. The format is no
+ used anymore and it was never documented.
+
+- In str.format(), raise a ValueError when indexes to arguments are too large.
+
+- Issue #2844: Make int('42', n) consistently raise ValueError for invalid
+ integers n (including n = -909).
+
+- Issue #8188: Introduce a new scheme for computing hashes of numbers (instances
+ of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it
+ easy to maintain the invariant that hash(x) == hash(y) whenever x and y have
+ equal value.
+
+- Issue #8748: Fix two issues with comparisons between complex and integer
+ objects. (1) The comparison could incorrectly return True in some cases
+ (2**53+1 == complex(2**53) == 2**53), breaking transitivity of equality.
+ (2) The comparison raised an OverflowError for large integers, leading to
+ unpredictable exceptions when combining integers and complex objects in sets
+ or dicts.
+
+- Issue #8766: Initialize _warnings module before importing the first module.
+ Fix a crash if an empty directory called "encodings" exists in sys.path.
+
+- Issue #8589: Decode PYTHONWARNINGS environment variable with the file system
+ encoding and surrogateescape error handler instead of the locale encoding to
+ be consistent with os.environ. Add PySys_AddWarnOptionUnicode() function.
+
+- PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead
+ of strict) error handler to escape surrogates.
+
+- Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
+ object to Py_FileSystemDefaultEncoding with the "surrogateescape" error
+ handler, and return bytes. If Py_FileSystemDefaultEncoding is not set, fall
+ back to UTF-8.
+
+- Enable shortcuts for common encodings in PyUnicode_AsEncodedString() for any
+ error handler, not only the default error handler (strict).
+
+- Issue #8610: Load file system codec at startup, and display a fatal error on
+ failure. Set the file system encoding to utf-8 (instead of None) if getting
+ the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
+
+- PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
+ PyUnicode_FromString() to support surrogates in the filename and use the right
+ encoding.
+
+- Issue #7507: Quote "!" in pipes.quote(); it is special to some shells.
+
+- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler.
+
+- Issue #8419: Prevent the dict constructor from accepting non-string keyword
+ arguments.
+
+- Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't execute
+ indirectly Python signal handlers anymore because mywrite() ignores exceptions
+ (KeyboardInterrupt).
+
+- Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing
+ unicode string (eg. backslashreplace).
+
+- Issue #8485: PyUnicode_FSConverter() doesn't accept byteearray objects
+ anymore, you have to convert your bytearray filenames to bytes.
+
+- Issue #7332: Remove the 16KB stack-based buffer in
+ PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit
+ compared to the dynamic memory allocation fallback. Patch by Charles-François
+ Natali.
+
+- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
+ passed to bytes or bytearray.
+
+- Issue #7301: Add environment variable $PYTHONWARNINGS.
+
+- Issue #8329: Don't return the same lists from select.select when no fds are
+ changed.
+
+- Issue #8259: 1L << (2**31) no longer produces an 'outrageous shift error' on
+ 64-bit machines. The shift count for either left or right shift is permitted
+ to be up to sys.maxsize.
+
+- Ensure that tokenization of identifiers is not affected by locale.
+
+- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
+
+- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
+
+- Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it
+ is set.
+
+- Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
+ is unknown.
+
+- Issue #1583863: A str subclass can now override the __str__ method.
+
+- Issue #8014: Setting a T_UINT or T_PYSSIZET attribute of an object with
+ PyMemberDefs could produce an internal error; raise TypeError instead.
+
+- Issue #7845: Rich comparison methods on the complex type now return
+ NotImplemented rather than raising a TypeError when comparing with an
+ incompatible type; this allows user-defined classes to implement their own
+ comparisons with complex.
+
+- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
+ (SIGINT). If an error occurs while importing the site module, the error is
+ printed and Python exits. Initialize the GIL before importing the site module.
+
+- Issue #7173: Generator finalization could invalidate sys.exc_info().
+
+- Issue #7544: Preallocate thread memory before creating the thread to avoid a
+ fatal error in low memory condition.
+
+- Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
+ check fails.
- Handle errors from looking up __prepare__ correctly.
-- Issue #5939: Add additional runtime checking to ensure a valid capsule
- in Modules/_ctypes/callproc.c.
+- Issue #5939: Add additional runtime checking to ensure a valid capsule in
+ Modules/_ctypes/callproc.c.
- Issue #7309: Fix unchecked attribute access when converting
- UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to
- strings.
+ UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
-- Issue #6902: Fix problem with built-in types format incorrectly with
- 0 padding.
+- Issue #6902: Fix problem with built-in types format incorrectly with 0
+ padding.
-- Issue #7988: Fix default alignment to be right aligned for
- complex.__format__. Now it matches other numeric types.
+- Issue #7988: Fix default alignment to be right aligned for complex.__format__.
+ Now it matches other numeric types.
-- Issue #7385: Fix a crash in `MemoryView_FromObject` when
- `PyObject_GetBuffer` fails. Patch by Florent Xicluna.
+- Issue #5988: Remove deprecated functions PyOS_ascii_formatd,
+ PyOS_ascii_strtod, and PyOS_ascii_atof. Use PyOS_double_to_string and
+ PyOS_string_to_double instead. See issue #5835 for the original deprecations.
-- Issue #7788: Fix an interpreter crash produced by deleting a list
- slice with very large step value.
+- Issue #7385: Fix a crash in `MemoryView_FromObject` when `PyObject_GetBuffer`
+ fails. Patch by Florent Xicluna.
-- Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`)
- could crash in many places because of the PyByteArray_AS_STRING() macro
- returning NULL. The macro now returns a statically allocated empty
- string instead.
+- Issue #7788: Fix an interpreter crash produced by deleting a list slice with
+ very large step value.
-- Issue #7632: Fix various str -> float conversion bugs present in 2.7
- alpha 2, including: (1) a serious 'wrong output' bug that could
- occur for long (> 40 digit) input strings, (2) a crash in dtoa.c
- that occurred in debug builds when parsing certain long numeric
- strings corresponding to subnormal values, (3) a memory leak for
- some values large enough to cause overflow, and (4) a number of
- flaws that could lead to incorrectly rounded results.
+- Issue #7766: Change sys.getwindowsversion() return value to a named tuple and
+ add the additional members returned in an OSVERSIONINFOEX structure. The new
+ members are service_pack_major, service_pack_minor, suite_mask, and
+ product_type.
+
+- Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`) could
+ crash in many places because of the PyByteArray_AS_STRING() macro returning
+ NULL. The macro now returns a statically allocated empty string instead.
+
+- Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
+ where the right hand operand is a set of constants, by turning the set into a
+ frozenset and pre-building it as a constant. The comparison operation is made
+ against the constant instead of building a new set each time it is executed (a
+ similar optimization already existed which turned a list of constants into a
+ pre-built tuple). Patch and additional tests by Dave Malcolm.
+
+- Issue #7622: Improve the split(), rsplit(), splitlines() and replace() methods
+ of bytes, bytearray and unicode objects by using a common implementation based
+ on stringlib's fast search. Patch by Florent Xicluna.
+
+- Issue #7632: Fix various str -> float conversion bugs present in 2.7 alpha 2,
+ including: (1) a serious 'wrong output' bug that could occur for long (> 40
+ digit) input strings, (2) a crash in dtoa.c that occurred in debug builds when
+ parsing certain long numeric strings corresponding to subnormal values, (3) a
+ memory leak for some values large enough to cause overflow, and (4) a number
+ of flaws that could lead to incorrectly rounded results.
+
+- The __complex__ method is now looked up on the class of instances to make it
+ consistent with other special methods.
+
+- Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
+ `rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna.
- Issue #7604: Deleting an unset slotted attribute did not raise an
AttributeError.
-- Issue #7466: segmentation fault when the garbage collector is called
- in the middle of populating a tuple. Patch by Florent Xicluna.
+- Issue #7534: Fix handling of IEEE specials (infinities, nans, negative zero)
+ in ** operator. The behaviour now conforms to that described in C99 Annex F.
+
+- Issue #1811: improve accuracy and cross-platform consistency for true division
+ of integers: the result of a/b is now correctly rounded for ints a and b (at
+ least on IEEE 754 platforms), and in particular does not depend on the
+ internal representation of an int.
+
+- Issue #6834: replace the implementation for the 'python' and 'pythonw'
+ executables on OSX.
+
+ These executables now work properly with the arch(1) command: ``arch -ppc
+ python`` will start a universal binary version of python in PPC mode (unlike
+ previous releases).
+
+- Issue #7466: Segmentation fault when the garbage collector is called in the
+ middle of populating a tuple. Patch by Florent Xicluna.
- Issue #7419: setlocale() could crash the interpreter on Windows when called
with invalid values.
@@ -1322,65 +2706,776 @@ Core and Builtins
- Issue #6077: On Windows, files opened with tempfile.TemporaryFile in "wt+"
mode would appear truncated on the first '0x1a' byte (aka. Ctrl+Z).
-- Issue #7085: Fix crash when importing some extensions in a thread
- on MacOSX 10.6.
+- Issue #7085: Fix crash when importing some extensions in a thread on MacOSX
+ 10.6.
-- Issue #7298: fixes for range and reversed(range(...)). Iteration
- over range(a, b, c) incorrectly gave an empty iterator when a, b and
- c fit in C long but the length of the range did not. Also fix
- several cases where reversed(range(a, b, c)) gave wrong results, and
- fix a refleak for reversed(range(a, b, c)) with large arguments.
+- Issue #1757126: Fix the cyrillic-asian alias for the ptcp154 encoding.
-- Issue #7244: itertools.izip_longest() no longer ignores exceptions
- raised during the formation of an output tuple.
+- Issue #6970: Remove redundant calls when comparing objects that don't
+ implement the relevant rich comparison methods.
+
+- Issue #7298: Fixes for range and reversed(range(...)). Iteration over
+ range(a, b, c) incorrectly gave an empty iterator when a, b and c fit in C
+ long but the length of the range did not. Also fix several cases where
+ reversed(range(a, b, c)) gave wrong results, and fix a refleak for
+ reversed(range(a, b, c)) with large arguments.
+
+- Issue #7244: itertools.izip_longest() no longer ignores exceptions raised
+ during the formation of an output tuple.
- Issue #3297: On wide unicode builds, do not split unicode characters into
surrogates.
+- Remove length limitation when constructing a complex number from a string.
+
+- Issue #1087418: Boost performance of bitwise operations for longs.
+
+- Support for AtheOS has been completely removed from the code base. It was
+ disabled since Python 3.0.
+
+- Support for several legacy threading libraries has been disabled. These
+ libraries are: Mach C threads, SunOS LWP, GNU pth, Irix threads. Support code
+ will be entirely removed in 3.3.
+
+- Support for OSF* has been disabled. If nobody stands up, support will be
+ removed in 3.3. See <http://bugs.python.org/issue8606>.
+
+- Peephole constant folding had missed UNARY_POSITIVE.
+
- Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which
fixes the problem of some exceptions being thrown at shutdown when the
interpreter is killed. Patch by Adam Olsen.
-- Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when
- using byte values greater than 127. Patch by Derk Drukker.
+- Issue #7147: Remove support for compiling Python without complex number
+ support.
+
+- Issue #7120: logging: Removed import of multiprocessing which is causing crash
+ in GAE.
+
+- Issue #1754094: Improve the stack depth calculation in the compiler. There
+ should be no other effect than a small decrease in memory use. Patch by
+ Christopher Tur Lesniewski-Laas.
-- Issue #7019: Raise ValueError when unmarshalling bad long data, instead
- of producing internally inconsistent Python longs.
+- Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when using
+ byte values greater than 127. Patch by Derk Drukker.
-- Issue #6990: Fix threading.local subclasses leaving old state around
- after a reference cycle GC which could be recycled by new locals.
+- Issue #1571184: The Unicode database contains properties for more characters.
+ The tables for code points representing numeric values, white spaces or line
+ breaks are now generated from the official Unicode Character Database files,
+ and include information from the Unihan.txt file.
+
+- Issue #7019: Raise ValueError when unmarshalling bad long data, instead of
+ producing internally inconsistent Python longs.
+
+- Issue #6990: Fix threading.local subclasses leaving old state around after a
+ reference cycle GC which could be recycled by new locals.
+
+- Issue #5460: Fix an ambiguity in the grammar.
+
+- Issue #1766304: Improve performance of membership tests on range objects.
+
+- Issue #6713: Improve performance of integer -> string conversions.
- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
-- Issue #6750: A text file opened with io.open() could duplicate its output
- when writing from multiple threads at the same time.
+- Issue #6750: A text file opened with io.open() could duplicate its output when
+ writing from multiple threads at the same time.
+
+- Issue #6707: dir() on an uninitialized module caused a crash.
+
+- Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
+
+- Issue #6573: set.union() stopped processing inputs if an instance of self
+ occurred in the argument chain.
+
+- Issue #6070: On posix platforms import no longer copies the execute bit from
+ the .py file to the .pyc file if it is set.
+
+- Issue #1616979: Added the cp720 (Arabic DOS) encoding.
+
+- Issue #6428: Since Python 3.0, the __bool__ method must return a bool object,
+ and not an int. Fix the corresponding error message, and the documentation.
+
+- The deprecated PyCObject has been removed.
+
+- Issue #6347: Include inttypes.h as well as stdint.h in pyport.h. This fixes a
+ build failure on HP-UX: int32_t and uint32_t are defined in inttypes.h instead
+ of stdint.h on that platform.
+
+- Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and the
+ 'surrogateescape' error handler, a string which contains unpaired surrogates.
+
+- Issue #4856: Remove checks for win NT.
+
+- Issue #6687: PyBytes_FromObject() no longer accepts an integer as its argument
+ to construct a null-initialized bytes object.
+
+- Issue #1023290: Add from_bytes() and to_bytes() methods to integers. These
+ methods allow the conversion of integers to bytes, and vice-versa.
+
+- Issue #7382: Fix bug in bytes.__getnewargs__ that prevented bytes instances
+ from being copied with copy.copy(), and bytes subclasses from being pickled
+ properly.
+
+- Code objects now support weak references.
+
+- Issue #7072: isspace(0xa0) is true on Mac OS X.
+
+- Issue #8084: PEP 370 now conforms to system conventions for framework builds
+ on MacOS X. That is, "python setup.py install --user" will install into
+ "~/Library/Python/2.7" instead of "~/.local".
+
+C-API
+-----
+
+- Issue #2443: A new macro, `Py_VA_COPY`, copies the state of the
+ variable argument list. `Py_VA_COPY` is equivalent to C99
+ `va_copy`, but available on all python platforms.
+
+- PySlice_GetIndicesEx now clips the step to [-PY_SSIZE_T_MAX, PY_SSIZE_T_MAX]
+ instead of [-PY_SSIZE_T_MAX-1, PY_SSIZE_T_MAX]. This makes it safe to do
+ "step = -step" when reversing a slice.
+
+- Issue #5753: A new C API function, `PySys_SetArgvEx`, allows embedders of the
+ interpreter to set sys.argv without also modifying sys.path. This helps fix
+ `CVE-2008-5983
+ <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
+
+- Add PyArg_ValidateKeywordArguments, which checks if all keyword arguments are
+ strings in an efficient manner.
+
+- Issue #8276: PyEval_CallObject() is now only available in macro form. The
+ function declaration, which was kept for backwards compatibility reasons, is
+ now removed (the macro was introduced in 1997!).
+
+- Issue #7767: New function PyLong_AsLongLongAndOverflow added, analogous to
+ PyLong_AsLongAndOverflow.
+
+- Make PyUnicode_CompareWithASCIIString return not equal if the Python string
+ has '\0' at the end.
+
+- Issue #5080: The argument parsing functions PyArg_ParseTuple,
+ PyArg_ParseTupleAndKeywords, PyArg_VaParse, PyArg_VaParseTupleAndKeywords and
+ PyArg_Parse now raise a DeprecationWarning for float arguments passed with the
+ 'L' format code. This will become a TypeError in a future version of Python,
+ to match the behaviour of the other integer format codes.
+
+- Issue #7033: Function ``PyErr_NewExceptionWithDoc()`` added.
+
+- Issue #7414: 'C' code wasn't being skipped properly (for keyword arguments) in
+ PyArg_ParseTupleAndKeywords.
+
+- Issue #7228: Add '%lld' and '%llu' support to PyString_FromFormat(V) and
+ PyErr_Format, on machines with HAVE_LONG_LONG defined.
+
+- Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in
+ PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be should used for
+ accessing the d_type and d_name members of structures using PyDescr_COMMON.
+
+- Issue #6405: Remove duplicate type declarations in descrobject.h.
+
+- The code flags for old __future__ features are now available again.
+
+- Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of
+ PyCode_Addr2Line().
+
+- Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code
+ object at a specified file, function, and line number.
+
+- Issue #1419652: Change the first argument to PyImport_AppendInittab() to
+ ``const char *`` as the string is stored beyond the call.
+
+- Issue #2422: When compiled with the ``--with-valgrind`` option, the pymalloc
+ allocator will be automatically disabled when running under Valgrind. This
+ gives improved memory leak detection when running under Valgrind, while taking
+ advantage of pymalloc at other times.
Library
-------
-- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6
- (as long as the user didn't specify 'automatic proxy configuration').
+- In pdb, when Ctrl-C is entered while defining commands for a breakpoint, the
+ old commands are restored.
+
+- For traceback debugging, the pdb listing now also shows the locations where
+ the exception was originally (re)raised, if it differs from the last line
+ executed (e.g. in case of finally clauses).
+
+- The pdb command "source" has been added. It displays the source code for a
+ given object, if possible.
+
+- The pdb command "longlist" has been added. It displays the whole source code
+ for the current function.
+
+- Issue #1503502: Make pdb.Pdb easier to subclass by putting message and error
+ output into methods.
+
+- Issue #809887: Make the output of pdb's breakpoint deletions more consistent;
+ emit a message when a breakpoint is enabled or disabled.
+
+- Issue #5294: Fix the behavior of pdb's "continue" command when called in the
+ top-level debugged frame.
+
+- Issue #5727: Restore the ability to use readline when calling into pdb in
+ doctests.
+
+- Issue #6719: In pdb, do not stop somewhere in the encodings machinery if the
+ source file to be debugged is in a non-builtin encoding.
+
+- Issue #8048: Prevent doctests from failing when sys.displayhook has been
+ reassigned.
+
+- Issue #8015: In pdb, do not crash when an empty line is entered as a
+ breakpoint command.
+
+- In pdb, allow giving a line number to the "until" command.
+
+- Issue #1437051: For pdb, allow "continue" and related commands in .pdbrc
+ files. Also, add a command-line option "-c" that runs a command as if given
+ in .pdbrc.
+
+- Issue #4179: In pdb, allow "list ." as a command to return to the currently
+ debugged line.
+
+- Issue #4108: In urllib.robotparser, if there are multiple ``User-agent: *``
+ entries, consider the first one.
+
+- Issue #6630: Allow customizing regex flags when subclassing the
+ string.Template class.
+
+- Issue #9411: Allow specifying an encoding for config files in the configparser
+ module.
+
+- Issue #1682942: Improvements to configparser: support alternate delimiters,
+ alternate comment prefixes and empty lines in values.
+
+- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
+
+- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
+
+- Issue #9378: python -m pickle <pickle file> will now load and display the
+ first object in the pickle file.
+
+- Issue #4770: Restrict binascii module to accept only bytes (as specified).
+ And fix the email package to encode to ASCII instead of ``raw-unicode-escape``
+ before ASCII-to-binary decoding.
+
+- Issue #9384: ``python -m tkinter`` will now display a simple demo applet.
+
+- The default size of the re module's compiled regular expression cache has been
+ increased from 100 to 500 and the cache replacement policy has changed from
+ simply clearing the entire cache on overflow to forgetting the least recently
+ used cached compiled regular expressions. This is a performance win for
+ applications that use a lot of regular expressions and limits the impact of
+ the performance hit anytime the cache is exceeded.
+
+- Issue #7113: Speed up loading in configparser. Patch by Åukasz Langa.
+
+- Issue #9032: XML-RPC client retries the request on EPIPE error. The EPIPE
+ error occurs when the server closes the socket and the client sends a big
+ XML-RPC request.
+
+- Issue #4629: getopt raises an error if an argument ends with "=", whereas
+ getopt doesn't accept a value (eg. --help= is rejected if getopt uses
+ ['help='] long options).
+
+- Issue #7989: Added pure python implementation of the `datetime` module. The C
+ module is renamed to `_datetime` and if available, overrides all classes
+ defined in datetime with fast C impementation. Python implementation is based
+ on the original python prototype for the datetime module by Tim Peters with
+ minor modifications by the PyPy project. The test suite now tests `datetime`
+ module with and without `_datetime` acceleration using the same test cases.
+
+- Issue #7895: platform.mac_ver() no longer crashes after calling os.fork().
+
+- Issue #9323: Fixed a bug in trace.py that resulted in loosing the name of the
+ script being traced. Patch by Eli Bendersky.
+
+- Issue #9282: Fixed --listfuncs option of trace.py. Thanks Eli Bendersky for
+ the patch.
+
+- Issue #3704: http.cookiejar was not properly handling URLs with a / in the
+ parameters.
+
+- Issue #9268: ``pickletools.dis()`` now has an optional *annotate* argument
+ which controls printing of opcode descriptions in ``dis()`` output.
+
+- Issue #1555570: email no longer inserts extra blank lines when a \r\n combo
+ crosses an 8192 byte boundary.
+
+- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
+
+- ``ast.literal_eval()`` now allows byte literals.
+
+- Issue #9137: Fix issue in MutableMapping.update, which incorrectly treated
+ keyword arguments called 'self' or 'other' specially.
+
+- ``ast.literal_eval()`` now allows set literals.
+
+- Issue #9164: Ensure that sysconfig handles duplicate -arch flags in CFLAGS.
+
+- Issue #7646: The fnmatch pattern cache no longer grows without bound.
+
+- Issue #9136: Fix 'dictionary changed size during iteration' RuntimeError
+ produced when profiling the decimal module. This was due to a dangerous
+ iteration over 'locals()' in Context.__init__.
+
+- Fix extreme speed issue in Decimal.pow when the base is an exact power of 10
+ and the exponent is tiny (for example, ``Decimal(10) **
+ Decimal('1e-999999999')``).
+
+- Issue #9186: Fix math.log1p(-1.0) to raise ValueError, not OverflowError.
+
+- Issue #9130: Fix validation of relative imports in parser module.
+
+- Issue #9128: Fix validation of class decorators in parser module.
+
+- Issue #9094: python -m pickletools will now disassemble pickle files listed in
+ the command line arguments. See output of python -m pickletools -h for more
+ details.
+
+- Issue #5468: urlencode to handle bytes type and other encodings in its query
+ parameter. Patch by Dan Mahn.
+
+- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
+ ensure that the input string length is a multiple of the frame size.
+
+- Issue #6507: Accept source strings in dis.dis(). Original patch by Daniel
+ Urban.
+
+- Issue #7829: Clearly document that the dis module is exposing an
+ implementation detail that is not stable between Python VMs or releases.
+
+- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
+ raises an exception.
+
+- Issue #9110: Addition of ContextDecorator to contextlib, for creating APIs
+ that act as both context managers and decorators. contextmanager changes to
+ use ContextDecorator.
+
+- Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader
+ for removal in Python 3.4.
+
+- Issue #9064: pdb's "up" and "down" commands now accept an optional argument
+ giving the number of frames to go.
+
+- Issue #9018: os.path.normcase() now raises a TypeError if the argument is not
+ ``str`` or ``bytes``.
+
+- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag on an
+ OpenSSL structure.
+
+- Issue #8682: The ssl module now temporary increments the reference count of a
+ socket object got through ``PyWeakref_GetObject``, so as to avoid possible
+ deallocation while the object is still being used.
+
+- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
+ password instead of presenting an interactive prompt. Older behavior can be
+ obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
+
+- Issue #8720: Fix regression caused by fix for #4050 by making getsourcefile
+ smart enough to find source files in the linecache.
+
+- Issue #5610: feedparser no longer eats extra characters at the end of a body
+ part if the body part ends with a ``\r\n``.
+
+- Issue #8986: math.erfc was incorrectly raising OverflowError for values
+ between -27.3 and -30.0 on some platforms.
+
+- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
+
+- Issue #8966: If a ctypes structure field is an array of c_char, convert its
+ value to bytes instead of str (as done for c_char and c_char_p).
+
+- Issue #8188: Comparisons between Decimal and Fraction objects are now
+ permitted, returning a result based on the exact numerical values of the
+ operands. This builds on issue #2531, which allowed Decimal-to-float
+ comparisons; all comparisons involving numeric types (bool, int, float,
+ complex, Decimal, Fraction) should now act as expected.
+
+- Issue #8897: Fix sunau module, use bytes to write the header. Patch written by
+ Thomas Jollans.
+
+- Issue #8899: time.struct_time now has class and attribute docstrings.
+
+- Issue #6470: Drop UNC prefix in FixTk.
+
+- Issue #4768: base64 encoded email body parts were incorrectly stored as binary
+ strings. They are now correctly converted to strings.
+
+- Issue #8833: tarfile created hard link entries with a size field != 0 by
+ mistake.
+
+- Charset.body_encode now correctly handles base64 encoding by encoding with the
+ output_charset before calling base64mime.encode. Passes the tests from 2.x
+ issue #1368247.
+
+- Issue #8845: sqlite3 Connection objects now have a read-only in_transaction
+ attribute that is True iff there are uncommitted changes.
+
+- Issue #1289118: datetime.timedelta objects can now be multiplied by float and
+ divided by float and int objects. Results are rounded to the nearest multiple
+ of timedelta.resolution with ties resolved using round-half-to-even method.
+
+- Issue #7150: Raise OverflowError if the result of adding or subtracting
+ timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
+
+- Issue #8806: add SSL contexts support to ftplib.
+
+- Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer
+ and sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes
+ API.
+
+- Issue #8770: Now sysconfig displays information when it's called as a script.
+ Initial idea by Sridhar Ratnakumar.
+
+- Issue #6662: Fix parsing of malformatted charref (&#bad;), patch written by
+ Fredrik Håård.
+
+- Issue #8540: Decimal module: rename the Context._clamp attribute to
+ Context.clamp and make it public. This is useful in creating contexts that
+ correspond to the decimal interchange formats specified in IEEE 754.
+
+- Issue #6268: Fix seek() method of codecs.open(), don't read or write the BOM
+ twice after seek(0). Fix also reset() method of codecs, UTF-16, UTF-32 and
+ StreamWriter classes.
+
+- Issue #3798: sys.exit(message) writes the message to sys.stderr file, instead
+ of the C file stderr, to use stderr encoding and error handler.
+
+- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
+ of files without one.
+
+- Issue #8729: Return NotImplemented from collections.Mapping.__eq__ when
+ comparing to a non-mapping.
+
+- Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
+ correct encoding.
+
+- Issue #4870: Add an `options` attribute to SSL contexts, as well as several
+ ``OP_*`` constants to the `ssl` module. This allows to selectively disable
+ protocol versions, when used in combination with `PROTOCOL_SSLv23`.
+
+- Issue #8759: Fixed user paths in sysconfig for posix and os2 schemes.
+
+- Issue #8663: distutils.log emulates backslashreplace error handler. Fix
+ compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if
+ stdout is not a TTY).
+
+- Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
+ subprocess.Popen() and os._execvpe() support bytes program name. Add
+ os.supports_bytes_environ flag: True if the native OS type of the environment
+ is bytes (eg. False on Windows).
+
+- Issue #8633: tarfile is now able to read and write archives with "raw" binary
+ pax headers as described in POSIX.1-2008.
+
+- Issue #1285086: Speed up urllib.parse functions: quote, quote_from_bytes,
+ unquote, unquote_to_bytes.
+
+- Issue #8688: Distutils now recalculates MANIFEST everytime.
+
+- Issue #8477: ssl.RAND_egd() and ssl._test_decode_cert() support str with
+ surrogates and bytes for the filename.
+
+- Issue #8550: Add first class ``SSLContext`` objects to the ssl module.
+
+- Issue #8681: Make the zlib module's error messages more informative when the
+ zlib itself doesn't give any detailed explanation.
+
+- The audioop module now supports sound fragments of length greater than 2**31
+ bytes on 64-bit machines, and is PY_SSIZE_T_CLEAN.
+
+- Issue #4972: Add support for the context manager protocol to the ftplib.FTP
+ class.
+
+- Issue #8664: In py_compile, create __pycache__ when the compiled path is
+ given.
+
+- Issue #8514: Add os.fsencode() function (Unix only): encode a string to bytes
+ for use in the file system, environment variables or the command line.
+
+- Issue #8571: Fix an internal error when compressing or decompressing a chunk
+ larger than 1GB with the zlib module's compressor and decompressor objects.
+
+- Issue #8603: Support bytes environmental variables on Unix: Add os.environb
+ mapping and os.getenvb() function. os.unsetenv() encodes str argument to the
+ file system encoding with the surrogateescape error handler (instead of
+ utf8/strict) and accepts bytes. posix.environ keys and values are now bytes.
+
+- Issue #8573: asyncore _strerror() function might throw ValueError.
+
+- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing error
+ messages when accessing undefined class attributes because of the cheap
+ inheritance with the underlying socket object. The cheap inheritance has been
+ deprecated.
+
+- Issue #4265: shutil.copyfile() was leaking file descriptors when disk fills.
+ Patch by Tres Seaver.
+
+- Issue #8390: tarfile uses surrogateescape as the default error handler
+ (instead of replace in read mode or strict in write mode).
+
+- Issue #7755: Use an unencumbered audio file for tests.
+
+- Issue #8621: uuid.uuid4() returned the same sequence of values in the parent
+ and any children created using ``os.fork`` on MacOS X 10.6.
+
+- Issue #8567: Fix precedence of signals in Decimal module: when a Decimal
+ operation raises multiple signals and more than one of those signals is
+ trapped, the specification determines the order in which the signals should be
+ handled. In many cases this order wasn't being followed, leading to the wrong
+ Python exception being raised.
+
+- Issue #7865: The close() method of :mod:`io` objects should not swallow
+ exceptions raised by the implicit flush(). Also qensure that calling close()
+ several times is supported. Patch by Pascal Chambon.
+
+- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
+ gc.DEBUG_STATS.
+
+- Issue #8354: The siginterrupt setting is now preserved for all signals, not
+ just SIGCHLD.
+
+- Issue #7192: webbrowser.get("firefox") now works on Mac OS X, as does
+ webbrowser.get("safari").
+
+- Issue #8464: tarfile no longer creates files with execute permissions set when
+ mode="w|" is used.
+
+- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions of
+ the Linux kernel. Patch by Yaniv Aknin.
+
+- Issue #8295: Added shutil.unpack_archive.
+
+- Issue #6312: Fixed http HEAD request when the transfer encoding is chunked.
+ It should correctly return an empty response now.
+
+- Issue #8546: Reject None given as the buffering argument to _pyio.open.
+
+- Issue #8549: Fix compiling the _ssl extension under AIX. Patch by
+ Sridhar Ratnakumar.
+
+- Issue #6656: fix locale.format_string to handle escaped percents
+ and mappings.
+
+- Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown, where
+ the method could block indefinitely if called just before the event loop
+ started running. This also fixes the occasional freezes witnessed in
+ test_httpservers.
+
+- Issue #8524: When creating an SSL socket, the timeout value of the original
+ socket wasn't retained (instead, a socket with a positive timeout would be
+ turned into a non-blocking SSL socket).
+
+- Issue #5103: SSL handshake would ignore the socket timeout and block
+ indefinitely if the other end didn't respond.
+
+- The do_handshake() method of SSL objects now adjusts the blocking mode of the
+ SSL structure if necessary (as other methods already do).
+
+- Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and
+ bytes strings for environment keys and values.
+
+- Issue #8467: Pure Python implementation of subprocess encodes the error
+ message using surrogatepass error handler to support surrogates in the
+ message.
-- Issue #8412: os.system() now accepts bytes, bytearray and str with
+- Issue #8468: bz2.BZ2File() accepts str with surrogates and bytes filenames.
+
+- Issue #8451: Syslog module now uses basename(sys.argv[0]) instead of the
+ string "python" as the *ident*. openlog() arguments are all optional and
+ keywords.
+
+- Issue #8108: Fix the unwrap() method of SSL objects when the socket has a
+ non-infinite timeout. Also make that method friendlier with applications
+ wanting to continue using the socket in clear-text mode, by disabling
+ OpenSSL's internal readahead. Thanks to Darryl Miles for guidance.
+
+- Issue #8496: make mailcap.lookup() always return a list, rather than an
+ iterator. Patch by Gregory Nofi.
+
+- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
+ collation name contains a surrogate character.
+
+- Issue #8484: Load all ciphers and digest algorithms when initializing the _ssl
+ extension, such that verification of some SSL certificates doesn't fail
+ because of an "unknown algorithm".
+
+- Issue #6547: Added the ignore_dangling_symlinks option to shutil.copytree.
+
+- Issue #1540112: Now allowing the choice of a copy function in shutil.copytree.
+
+- Issue #4814: timeout parameter is now applied also for connections resulting
+ from PORT/EPRT commands.
+
+- Issue #8463: added missing reference to bztar in shutil's documentation.
+
+- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6 (as
+ long as the user didn't specify 'automatic proxy configuration').
+
+- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response code
+ as stated in RFC-959 at chapter 5.4.
+
+- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
surrogates.
+- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
+ `threading.Semaphore` objects. Original patch by Torsten Landschoff.
+
+- Issue #8322: Add a *ciphers* argument to SSL sockets, so as to change the
+ available cipher list. Helps fix test_ssl with OpenSSL 1.0.0.
+
+- Issue #8393: subprocess accepts bytes, bytearray and str with surrogates for
+ the current working directory.
+
+- Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
+ using backslashreplace error handler.
+
+- Issue #8412: os.system() now accepts bytes, bytearray and str with surrogates.
+
+- Issue #2987: RFC2732 support for urlparse (IPv6 addresses). Patch by Tony
+ Locke and Hans Ulrich Niedermann.
+
+- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
+
+- Issue #7316: The acquire() method of lock objects in the :mod:`threading`
+ module now takes an optional timeout argument in seconds. Timeout support
+ relies on the system threading library, so as to avoid a semi-busy wait loop.
+
+- Issue #8383: pickle and pickletools use surrogatepass error handler when
+ encoding unicode as utf8 to support lone surrogates and stay compatible with
+ Python 2.x and 3.x.
+
+- Issue #7585: difflib context and unified diffs now place a tab between
+ filename and date, conforming to the 'standards' they were originally designed
+ to follow. This improves compatibility with patch tools.
+
+- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
+ character sets will now consistently use a Content-Transfer-Encoding of 7bit
+ rather than sometimes being marked as 8bit.
+
+- Issue #8375: test_distutils now checks if the temporary directory are still
+ present before it cleans them.
+
+- Issue #8374: Update the internal alias table in the :mod:`locale` module to
+ cover recent locale changes and additions.
+
+- Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
+ using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO` and
+ `ssl.OPENSSL_VERSION_NUMBER`.
+
+- Add functools.total_ordering() and functools.cmp_to_key().
+
+- Issue #8257: The Decimal construct now accepts a float instance directly,
+ converting that float to a Decimal of equal value:
+
+ >>> Decimal(1.1)
+ Decimal('1.100000000000000088817841970012523233890533447265625')
+
+- Issue #8294: The Fraction constructor now accepts Decimal and float instances
+ directly.
+
+- Issue #7279: Comparisons involving a Decimal signaling NaN now signal
+ InvalidOperation instead of returning False. (Comparisons involving a quiet
+ NaN are unchanged.) Also, Decimal quiet NaNs are now hashable; Decimal
+ signaling NaNs remain unhashable.
+
+- Issue #2531: Comparison operations between floats and Decimal instances now
+ return a result based on the numeric values of the operands; previously they
+ returned an arbitrary result based on the relative ordering of id(float) and
+ id(Decimal). See also issue #8188, which adds Decimal-to-Fraction
+ comparisons.
+
+- Added a subtract() method to collections.Counter().
+
+- Issue #8233: When run as a script, py_compile.py optionally takes a single
+ argument `-` which tells it to read files to compile from stdin. Each line is
+ read on demand and the named file is compiled immediately. (Original patch by
+ Piotr Ożarowski).
+
+- Backwards incompatible change: Unicode codepoints line tabulation (0x0B) and
+ form feed (0x0C) are now considered linebreaks, as specified in Unicode
+ Standard Annex #14. See issue #7643. http://www.unicode.org/reports/tr14/
+
+- Comparisons using one of <, <=, >, >= between a complex instance and a
+ Fractions instance now raise TypeError instead of returning True/False. This
+ makes Fraction <=> complex comparisons consistent with int <=> complex, float
+ <=> complex, and complex <=> complex comparisons.
+
+- Issue #8139: ossaudiodev didn't initialize its types properly, therefore some
+ methods (such as oss_mixer_device.fileno()) were not available. Initial patch
+ by Bertrand Janin.
+
+- Issue #8205: Remove the "Modules" directory from sys.path when Python is
+ running from the build directory (POSIX only).
+
+- Issue #7512: shutil.copystat() could raise an OSError when the filesystem
+ didn't support chflags() (for example ZFS under FreeBSD). The error is now
+ silenced.
+
+- Issue #7860: platform.uname now reports the correct 'machine' type when Python
+ is running in WOW64 mode on 64 bit Windows.
+
+- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
+ Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
+ reads and writes are always retried by OpenSSL itself.
+
- Issue #4282: Fix the main function of the profile module for a non-ASCII
script, open the file in binary mode and not in text mode with the default
(utf8) encoding.
+- Issue #8179: Fix macpath.realpath() on a non-existing path.
+
+- Issue #8024: Update the Unicode database to 5.2.
+
+- Issue #8168: py_compile now handles files with utf-8 BOMS.
+
+- ``tokenize.detect_encoding`` now returns ``'utf-8-sig'`` when a UTF-8 BOM is
+ detected.
+
+- Issue #6716/2: Backslash-replace error output in compilall.
+
+- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
+ with Tcl/Tk-8.5.
+
+- Issue #8140: extend compileall to compile single files. Add -i option.
+
+- Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
+ locale.
+
+- The internals of the subprocess module on POSIX systems have been replaced by
+ an extension module (_posixsubprocess) so that the fork()+exec() can be done
+ safely without the possibility of deadlock in multithreaded applications.
+
+- subprocess.Popen now has restore_signals and start_new_session features. The
+ default of restore_signals=True is a new behavior compared to earlier Python
+ versions. This means that signals such as SIGPIPE are not ignored by default
+ in subprocesses launched by Python (Issue #1652).
+
+- Issue #6472: The xml.etree package is updated to ElementTree 1.3. The
+ cElementTree module is updated too.
+
- Issue #7774: Set sys.executable to an empty string if argv[0] has been set to
- an non existent program name and Python is unable to retrieve the real
- program name
+ an non existent program name and Python is unable to retrieve the real program
+ name.
+
+- Issue #7880: Fix sysconfig when the python executable is a symbolic link.
-- Issue #6509: fix re.sub to work properly when the pattern, the string, and
- the replacement were all bytes. Patch by Antoine Pitrou.
+- Issue #6509: fix re.sub to work properly when the pattern, the string, and the
+ replacement were all bytes. Patch by Antoine Pitrou.
-- Issue #1054943: Fix unicodedata.normalize('NFC', text) for the Public Review
- Issue #29
+- The sqlite3 module was updated to pysqlite 2.6.0. This fixes several obscure
+ bugs and allows loading SQLite extensions from shared libraries.
+
+- Issue #1054943: Fix ``unicodedata.normalize('NFC', text)`` for the Public
+ Review Issue #29 (http://unicode.org/review/pr-29.html).
- Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
reset also the pointer to the current pointer context.
+- Issue #7232: Add support for the context manager protocol to the TarFile
+ class.
+
- Issue #7250: Fix info leak of os.environ across multi-run uses of
wsgiref.handlers.CGIHandler.
@@ -1389,59 +3484,101 @@ Library
- Issue #691291: codecs.open() should not convert end of lines on reading and
writing.
-- Issue #7959: ctypes callback functions are now registered correctly
- with the cycle garbage collector.
+- Issue #7869: logging: improved diagnostic for format-time errors.
-- Issue #6666: fix bug in trace.py that applied the list of directories
- to be ignored only to the first file. Noted by Bogdan Opanchuk.
+- Issue #7868: logging: added loggerClass attribute to Manager.
-- Issue #7597: curses.use_env() can now be called before initscr().
- Noted by Kan-Ru Chen.
+- logging: Implemented PEP 391.
+
+- Issue #1537721: Add a writeheader() method to csv.DictWriter.
+
+- Issue #7959: ctypes callback functions are now registered correctly with the
+ cycle garbage collector.
+
+- Issue #5801: removed spurious empty lines in wsgiref.
+
+- Issue #6666: fix bug in trace.py that applied the list of directories to be
+ ignored only to the first file. Noted by Bogdan Opanchuk.
+
+- Issue #7597: curses.use_env() can now be called before initscr(). Noted by
+ Kan-Ru Chen.
- Issue #7310: fix the __repr__ of os.environ to show the environment variables.
- Issue #7970: email.Generator.flatten now correctly flattens message/rfc822
messages parsed by email.Parser.HeaderParser.
-- Issue #7361: Importlib was not handling bytecode files less than 8 bytes in
- length properly.
+- Issue #7361: Importlib was not properly checking the number of bytes in
+ bytecode file when it was less then 8 bytes.
+
+- Issue #7633: In the decimal module, Context class methods (with the exception
+ of canonical and is_canonical) now accept instances of int and long wherever a
+ Decimal instance is accepted, and implicitly convert that argument to Decimal.
+ Previously only some arguments were converted.
- Issue #7835: shelve should no longer produce mysterious warnings during
interpreter shutdown.
-- Issue #6233: ElementTree failed converting unicode characters to XML
- entities when they could't be represented in the requested output
- encoding. Patch by Jerry Chen.
+- Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">") in XML
+ processing instructions and comments. These raw characters are allowed by the
+ XML specification, and are necessary when outputting e.g. PHP code in a
+ processing instruction. Patch by Neil Muller.
+
+- Issue #6233: ElementTree failed converting unicode characters to XML entities
+ when they could't be represented in the requested output encoding. Patch by
+ Jerry Chen.
+
+- Issue #6003: add an argument to ``zipfile.Zipfile.writestr`` to specify the
+ compression type.
- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
specified, rather than fall through to AF_PACKET (in the `socket` module).
- Also, raise ValueError rather than TypeError when an unknown TIPC address
- type is specified. Patch by Brian Curtin.
+ Also, raise ValueError rather than TypeError when an unknown TIPC address type
+ is specified. Patch by Brian Curtin.
-- Issue #6939: Fix file I/O objects in the `io` module to keep the original
- file position when calling `truncate()`. It would previously change the
- file position to the given argument, which goes against the tradition of
+- Issue #6939: Fix file I/O objects in the `io` module to keep the original file
+ position when calling `truncate()`. It would previously change the file
+ position to the given argument, which goes against the tradition of
ftruncate() and other truncation APIs. Patch by Pascal Chambon.
+- Issue #7610: Reworked implementation of the internal
+ :class:`zipfile.ZipExtFile` class used to represent files stored inside an
+ archive. The new implementation is significantly faster and can be wrapped in
+ a :class:`io.BufferedReader` object for more speedups. It also solves an
+ issue where interleaved calls to `read()` and `readline()` give wrong results.
+ Patch by Nir Aides.
+
+- Issue #6963: Added "maxtasksperchild" argument to multiprocessing.Pool,
+ allowing for a maximum number of tasks within the pool to be completed by the
+ worker before that worker is terminated, and a new one created to replace it.
+
- Issue #7792: Registering non-classes to ABCs raised an obscure error.
- Issue #7785: Don't accept bytes in FileIO.write().
+- Removed the functions 'verify' and 'vereq' from Lib/test/support.py.
+
- Issue #7773: Fix an UnboundLocalError in platform.linux_distribution() when
the release file is empty.
- Issue #7561: Fix crashes when using bytearray objects with the posix
module.
-- Issue #1670765: Prevent email.generator.Generator from re-wrapping
- headers in multipart/signed MIME parts, which fixes one of the sources of
- invalid modifications to such parts by Generator.
+- Issue #1670765: Prevent email.generator.Generator from re-wrapping headers in
+ multipart/signed MIME parts, which fixes one of the sources of invalid
+ modifications to such parts by Generator.
+
+- Issue #7703: Add support for the new buffer API to `binascii.a2bhqx`. Patch
+ by Florent Xicluna, along with some additional tests.
+
+- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a 1-byte
+ argument. Patch by Victor Stinner.
-- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a
- 1-byte argument. Patch by Victor Stinner.
+- Issue #3299: Fix possible crash in the _sre module when given bad argument
+ values in debug mode. Patch by Victor Stinner.
-- Issue #3299: Fix possible crash in the _sre module when given bad
- argument values in debug mode. Patch by Victor Stinner.
+- Issue #2846: Add support for gzip.GzipFile reading zero-padded files. Patch
+ by Brian Curtin.
- Issue #7681: Use floor division in appropiate places in the wave module.
@@ -1449,84 +3586,153 @@ Library
Extension extra options may change the output without changing the .c
file). Initial patch by Collin Winter.
-- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes
- gcc when it has a fully qualified configuration prefix. Initial patch
- by Arfrever.
+- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes gcc
+ when it has a fully qualified configuration prefix. Initial patch by Arfrever.
-- Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against
- the destruction of weakref'ed objects while iterating.
+- Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against the
+ destruction of weakref'ed objects while iterating.
-- Issue #7455: Fix possible crash in cPickle on invalid input. Patch by
- Victor Stinner.
+- Issue #7455: Fix possible crash in cPickle on invalid input. Patch by Victor
+ Stinner.
-- Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when
- opening an empty or very small file.
+- Issue #1628205: Socket file objects returned by socket.socket.makefile() now
+ properly handles EINTR within the read, readline, write & flush methods. The
+ socket.sendall() method now properly handles interrupted system calls.
+
+- Issue #7471: Improve the performance of GzipFile's buffering mechanism, and
+ make it implement the `io.BufferedIOBase` ABC to allow for further speedups by
+ wrapping it in an `io.BufferedReader`. Patch by Nir Aides.
+
+- Issue #3972: http.client.HTTPConnection now accepts an optional source_address
+ parameter to allow specifying where your connections come from.
-- Issue #7556: Make sure Distutils' msvc9compile reads and writes the
- MSVC XML Manifest file in text mode so string patterns can be used
- in regular expressions.
+- socket.create_connection now accepts an optional source_address parameter.
-- Issue #7552: Removed line feed in the base64 Authorization header in
- the Distutils upload command to avoid an error when PyPI reads it.
- This occurs on long passwords. Initial patch by JP St. Pierre.
+- Issue #5511: now zipfile.ZipFile can be used as a context manager. Initial
+ patch by Brian Curtin.
+
+- Issue #7556: Make sure Distutils' msvc9compile reads and writes the MSVC XML
+ Manifest file in text mode so string patterns can be used in regular
+ expressions.
+
+- Issue #7552: Removed line feed in the base64 Authorization header in the
+ Distutils upload command to avoid an error when PyPI reads it. This occurs on
+ long passwords. Initial patch by JP St. Pierre.
- Issue #7231: urllib2 cannot handle https with proxy requiring auth. Patch by
Tatsuhiro Tsujikawa.
-- Issue #4757: `zlib.compress` and other methods in the zlib module now
- raise a TypeError when given an `str` object (rather than a `bytes`-like
- object). Patch by Victor Stinner and Florent Xicluna.
+- Issue #4757: `zlib.compress` and other methods in the zlib module now raise a
+ TypeError when given an `str` object (rather than a `bytes`-like object).
+ Patch by Victor Stinner and Florent Xicluna.
- Issue #7349: Make methods of file objects in the io module accept None as an
argument where file-like objects (ie StringIO and BytesIO) accept them to mean
the same as passing no argument.
-- Issue #5949: added check for correct lineends in input from IMAP server
- in imaplib.
+- Issue #7357: tarfile no longer suppresses fatal extraction errors by default.
+
+- Issue #5949: added check for correct lineends in input from IMAP server in
+ imaplib.
+
+- Add count() and reverse() methods to collections.deque().
- Fix variations of extending deques: d.extend(d) d.extendleft(d) d+=d
-- Issue #6986: Fix crash in the JSON C accelerator when called with the
- wrong parameter types. Patch by Victor Stinner.
+- Issue #6986: Fix crash in the JSON C accelerator when called with the wrong
+ parameter types. Patch by Victor Stinner.
+
+- Issue #7457: added a read_pkg_file method to
+ distutils.dist.DistributionMetadata.
+
+- logging: Added optional `secure` parameter to SMTPHandler, to enable use of
+ TLS with authentication credentials.
-- Issue #1923: Fixed the removal of meaningful spaces when PKG-INFO is
- generated in Distutils. Patch by Stephen Emslie.
+- Issue #1923: Fixed the removal of meaningful spaces when PKG-INFO is generated
+ in Distutils. Patch by Stephen Emslie.
- Issue #4120: Drop reference to CRT from manifest when building extensions with
msvc9compiler.
-- Issue #7410: deepcopy of itertools.count was resetting the count.
+- Issue #7333: The `posix` module gains an `initgroups()` function providing
+ access to the initgroups(3) C library call on Unix systems which implement it.
+ Patch by Jean-Paul Calderone.
+
+- Issue #7408: Fixed distutils.tests.sdist so it doesn't check for group
+ ownership when the group is not forced, because the group may be different
+ from the user's group and inherit from its container when the test is run.
- Issue #4486: When an exception has an explicit cause, do not print its
- implicit context too. This affects the `traceback` module as well as
- built-in exception printing.
+ implicit context too. This affects the `traceback` module as well as built-in
+ exception printing.
+
+- Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert
+ Collins.
+
+- Issue #7403: logging: Fixed possible race condition in lock creation.
-- Issue #1488943: difflib.Differ() doesn't always add hints for tab characters
+- Issue #6845: Add restart support for binary upload in ftplib. The
+ `storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
+ argument. Patch by Pablo Mouzo.
-- Issue #7354: distutils.tests.test_msvc9compiler - dragfullwindows can
- be 2.
+- Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method
+ returning the total number of seconds in the duration. Patch by Brian
+ Quinlan.
-- Issue #3976: pprint for sets, frozensets, and dicts now succeed when
- they contain unorderable types.
+- Issue #7133: SSL objects now support the new buffer API.
+
+- Issue #1488943: difflib.Differ() doesn't always add hints for tab characters.
+
+- Issue #6123: tarfile now opens empty archives correctly and consistently
+ raises ReadError on empty files.
+
+- Issue #7354: distutils.tests.test_msvc9compiler - dragfullwindows can be 2.
- Issue #5037: Proxy the __bytes__ special method instead to __bytes__ instead
of __str__.
-- Issue #7341: Close the internal file object in the TarFile constructor in
- case of an error.
+- Issue #7341: Close the internal file object in the TarFile constructor in case
+ of an error.
- Issue #7293: distutils.test_msvc9compiler is fixed to work on any fresh
Windows box. Help provided by David Bolen.
-- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch
+- Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using TLS
+ or SSL. Patch by Giampaolo Rodola'.
+
+- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch.
+
+- Issue #4969: The mimetypes module now reads the MIME database from the
+ registry under Windows. Patch by Gabriel Genellina.
+
+- Issue #6816: runpy now provides a run_path function that allows Python code to
+ execute file paths that refer to source or compiled Python files as well as
+ zipfiles, directories and other valid sys.path entries that contain a
+ __main__.py file. This allows applications that run other Python scripts to
+ support the same flexibility as the CPython command line itself.
+
+- Issue #7318: multiprocessing now uses a timeout when it fails to establish a
+ connection with another process, rather than looping endlessly. The default
+ timeout is 20 seconds, which should be amply sufficient for local connections.
-- Issue #7318: multiprocessing now uses a timeout when it fails to establish
- a connection with another process, rather than looping endlessly. The
- default timeout is 20 seconds, which should be amply sufficient for
- local connections.
+- Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
+ unpickled. This fixes crashes under Windows when trying to run
+ test_multiprocessing in verbose mode.
-- Issue #7282: Fix a memory leak when an RLock was used in a thread other
- than those started through `threading.Thread` (for example, using
+- Issue #7893: ``unittest.TextTestResult`` is made public and a ``resultclass``
+ argument added to the TextTestRunner constructor allowing a different result
+ class to be used without having to subclass.
+
+- Issue #7588: ``unittest.TextTestResult.getDescription`` now includes the test
+ name in failure reports even if the test has a docstring.
+
+- Issue #3001: Add a C implementation of recursive locks which is used by
+ default when instantiating a `threading.RLock` object. This makes recursive
+ locks as fast as regular non-recursive locks (previously, they were slower by
+ 10x to 15x).
+
+- Issue #7282: Fix a memory leak when an RLock was used in a thread other than
+ those started through `threading.Thread` (for example, using
`_thread.start_new_thread()`).
- Issue #7187: Importlib would not silence the IOError raised when trying to
@@ -1535,28 +3741,36 @@ Library
- Issue #7264: Fix a possible deadlock when deallocating thread-local objects
which are part of a reference cycle.
-- Issue #6896: mailbox.Maildir now invalidates its internal cache each time
- a modification is done through it. This fixes inconsistencies and test
- failures on systems with slightly bogus mtime behaviour.
+- Issue #7211: Allow 64-bit values for the `ident` and `data` fields of kevent
+ objects on 64-bit systems. Patch by Michael Broghton.
-- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
+- Issue #6896: mailbox.Maildir now invalidates its internal cache each time a
+ modification is done through it. This fixes inconsistencies and test failures
+ on systems with slightly bogus mtime behaviour.
+
+- Issue #7246 & Issue #7208: getpass now properly flushes input before reading
+ from stdin so that existing input does not confuse it and lead to incorrect
+ entry or an IOError. It also properly flushes it afterwards to avoid the
+ terminal echoing the input afterwards on OSes such as Solaris.
+
+- Issue #7233: Fix a number of two-argument Decimal methods to make sure that
+ they accept an int or long as the second argument. Also fix buggy handling of
+ large arguments (those with coefficient longer than the current precision) in
+ shift and rotate.
-- Issue #7246 & Issue #7208: getpass now properly flushes input before
- reading from stdin so that existing input does not confuse it and
- lead to incorrect entry or an IOError. It also properly flushes it
- afterwards to avoid the terminal echoing the input afterwards on
- OSes such as Solaris.
+- Issue #4750: Store the basename of the original filename in the gzip FNAME
+ header as required by RFC 1952.
-- Issue #7233: Fix a number of two-argument Decimal methods to make
- sure that they accept an int or long as the second argument. Also
- fix buggy handling of large arguments (those with coefficient longer
- than the current precision) in shift and rotate.
+- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
+ Distutils.
+
+- Issue #7218: Fix test_site for win32, the directory comparison was done with
+ an uppercase.
- Issue #7205: Fix a possible deadlock when using a BZ2File object from
several threads at once.
-- Issue #7071: byte-compilation in Distutils is now done with respect to
- sys.dont_write_bytecode.
+- Issue #7077: logging: SysLogHandler now treats Unicode as per RFC 5424.
- Issue #7099: Decimal.is_normal now returns True for numbers with exponent
larger than emax.
@@ -1564,69 +3778,159 @@ Library
- Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
platforms, and assorted locale fixes by Derk Drukker.
-- Issue #5833: Fix extra space character in readline completion with the
- GNU readline library version 6.0.
+- Issue #5833: Fix extra space character in readline completion with the GNU
+ readline library version 6.0.
+
+- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment.
-- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment
+- Issue #7086: Added TCP support to SysLogHandler, and tidied up some
+ anachronisms in the code which were a relic of 1.5.2 compatibility.
-- Issue #7082: When falling back to the MIME 'name' parameter, the
- correct place to look for it is the Content-Type header.
+- Issue #7082: When falling back to the MIME 'name' parameter, the correct place
+ to look for it is the Content-Type header.
- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
builtin tokenizer.
-- Issue #7048: Force Decimal.logb to round its result when that result
- is too large to fit in the current precision.
+- Issue #7048: Force Decimal.logb to round its result when that result is too
+ large to fit in the current precision.
-- Issue #6236, #6348: Fix various failures in the I/O library under AIX
- and other platforms, when using a non-gcc compiler. Patch by Derk Drukker.
+- Issue #6236, #6348: Fix various failures in the I/O library under AIX and
+ other platforms, when using a non-gcc compiler. Patch by Derk Drukker.
-- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
-
-- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...)
- does now always result in NULL.
+- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...) does now
+ always result in NULL.
-- Issue #5042: Structure sub-subclass does now initialize correctly
- with base class positional arguments.
+- Issue #5042: Structure sub-subclass does now initialize correctly with base
+ class positional arguments.
- Issue #6882: Import uuid creates zombies processes.
- Issue #6635: Fix profiler printing usage message.
+- Issue #6856: Add a filter keyword argument to TarFile.add().
+
- Issue #6888: pdb's alias command was broken when no arguments were given.
-- Issue #6795: int(Decimal('nan')) now raises ValueError instead of
- returning NaN or raising InvalidContext. Also, fix infinite recursion
- in long(Decimal('nan')).
+- Issue #6857: Default format() alignment should be '>' for Decimal instances.
-- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats
- with no type specifier.
+- Issue #6795: int(Decimal('nan')) now raises ValueError instead of returning
+ NaN or raising InvalidContext. Also, fix infinite recursion in
+ long(Decimal('nan')).
+
+- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no
+ type specifier.
- Issue #6239: ctypes.c_char_p return value must return bytes.
-- Issue #6838: Use a list to accumulate the value instead of
- repeatedly concatenating strings in http.client's
- HTTPResponse._read_chunked providing a significant speed increase
- when downloading large files servend with a Transfer-Encoding of 'chunked'.
+- Issue #6838: Use a list to accumulate the value instead of repeatedly
+ concatenating strings in http.client's HTTPResponse._read_chunked providing a
+ significant speed increase when downloading large files servend with a
+ Transfer-Encoding of 'chunked'.
-- Have importlib raise ImportError if None is found in sys.modules for a
- module.
+- Trying to import a submodule from a module that is not a package, ImportError
+ should be raised, not AttributeError.
+
+- When the globals past to importlib.__import__() has __package__ set to None,
+ fall back to computing what __package__ should be instead of giving up.
+
+- Raise a TypeError when the name of a module to be imported for
+ importlib.__import__ is not a string (was raising an AttributeError before).
+
+- Allow the fromlist passed into importlib.__import__ to be any iterable.
+
+- Have importlib raise ImportError if None is found in sys.modules.
+
+- Issue #6054: Do not normalize stored pathnames in tarfile.
- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
payloads are now ordered by integer value rather than lexicographically.
-- Issue #6163: Fixed HP-UX runtime library dir options in
- distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
- Michael Haubenwallner.
+- Issue #1356969: Add missing info methods in tix.HList.
-- Issue #7066: archive_util.make_archive now restores the cwd if an error is
- raised. Initial patch by Ezio Melotti.
+- Issue #1522587: New constants and methods for the tix.Grid widget.
+
+- Issue #1250469: Fix the return value of tix.PanedWindow.panes.
+
+- Issue #1119673: Do not override tkinter.Text methods when creating a
+ ScrolledText.
+
+- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
+
+- Issue #1135: Add the XView and YView mix-ins to avoid duplicating the xview*
+ and yview* methods.
+
+- Issue #6629: Fix a data corruption issue in the new I/O library, which could
+ occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
+ "wb+" mode) after having buffered a certain amount of data for reading. This
+ bug was not present in the pure Python implementation.
+
+- Issue #6622: Fix "local variable 'secret' referenced before assignment" bug in
+ POP3.apop.
+
+- Issue #2715: Remove remnants of Carbon.File from binhex module.
+
+- Issue #6595: The Decimal constructor now allows arbitrary Unicode decimal
+ digits in input, as recommended by the standard. Previously it was restricted
+ to accepting [0-9].
+
+- Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT
+ DO/DONT correctly.
+
+- Issue #1424152: Fix for http.client, urllib.request to support SSL while
+ working through proxy. Original patch by Christopher Li, changes made by
+ Senthil Kumaran.
+
+- Add importlib.abc.ExecutionLoader to represent the PEP 302 protocol for
+ loaders that allow for modules to be executed. Both importlib.abc.PyLoader and
+ PyPycLoader inherit from this class and provide implementations in relation to
+ other methods required by the ABCs.
+
+- importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like
+ the documentation said it did even though the code in PyLoader relied on the
+ abstract method required by ResourceLoader.
+
+- Issue #6431: Make Fraction type return NotImplemented when it doesn't know how
+ to handle a comparison without loss of precision. Also add correct handling
+ of infinities and nans for comparisons with float.
+
+- Issue #6415: Fixed warnings.warn segfault on bad formatted string.
+
+- Issue #6358: The exit status of a command started with os.popen() was reported
+ differently than it did with python 2.x.
+
+- Issue #6323: The pdb debugger did not exit when running a script with a syntax
+ error.
+
+- Issue #3392: The subprocess communicate() method no longer fails in select()
+ when file descriptors are large; communicate() now uses poll() when possible.
+
+- Issue #6369: Fix an RLE decompression bug in the binhex module.
+
+- Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
+
+- The deprecated function string.maketrans has been removed.
+
+- Issue #4005: Fixed a crash of pydoc when there was a zip file present in
+ sys.path.
+
+- Issue #6218: io.StringIO and io.BytesIO instances are now picklable.
+
+- The os.get_exec_path() function to return the list of directories that will be
+ searched for an executable when launching a subprocess was added.
- Issue #7481: When a threading.Thread failed to start it would leave the
instance stuck in initial state and present in threading.enumerate().
-- Issue #1068268: The subprocess module now handles EINTR in internal
- os.waitpid and os.read system calls where appropriate.
+- Issue #1068268: The subprocess module now handles EINTR in internal os.waitpid
+ and os.read system calls where appropriate.
+
+- Issue #6729: Added ctypes.c_ssize_t to represent ssize_t.
+
+- Issue #6247: The argparse module has been added to the standard library.
+
+- Issue #8235: _socket: Add the constant ``SO_SETFIB``. SO_SETFIB is a socket
+ option available on FreeBSD 7.1 and newer.
- Issue #9315: Fix for the trace module to record correct class name
for tracing methods.
@@ -1634,127 +3938,254 @@ Library
Extension Modules
-----------------
-- Issue #9277: Fix bug in struct.pack for bools in standard mode
- (e.g., struct.pack('>?')): if conversion to bool raised an exception
- then that exception wasn't properly propagated on machines where
- char is unsigned.
+- Issue #9959: Tweak formula used for computing math.log of an integer,
+ making it marginally more accurate for exact powers of 2.
+
+- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
+
+- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
+ compared to other unix systems. In particular, os.getgroups() does not reflect
+ any changes made using os.setgroups() but basicly always returns the same
+ information as the id command. os.getgroups() can now return more than 16
+ groups on MacOSX.
+
+- Issue #6095: Make directory argument to os.listdir optional.
+
+- Issue #9277: Fix bug in struct.pack for bools in standard mode (e.g.,
+ struct.pack('>?')): if conversion to bool raised an exception then that
+ exception wasn't properly propagated on machines where char is unsigned.
+
+- Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x python when
+ they contain instances of old-style classes.
+
+- Issue #9165: Add new functions math.isfinite and cmath.isfinite, to accompany
+ existing isinf and isnan functions.
+
+- Issue #1578269: Implement os.symlink for Windows 6.0+. Patch by Jason
+ R. Coombs.
+
+- In struct.pack, correctly propogate exceptions from computing the truth of an
+ object in the '?' format.
+
+- Issue #9000: datetime.timezone objects now have eval-friendly repr.
+
+- In the math module, correctly lookup __trunc__, __ceil__, and __floor__ as
+ special methods.
+
+- Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000.
+ Prior to this change, timezone adjustment in utctimetuple() could produce
+ tm_year value of 0 or 10,000. Now an OverflowError is raised in these edge
+ cases.
+
+- Issue #6641: The ``datetime.strptime`` method now supports the ``%z``
+ directive. When the ``%z`` directive is present in the format string, an
+ aware ``datetime`` object is returned with ``tzinfo`` bound to a
+ ``datetime.timezone`` instance constructed from the parsed offset. If both
+ ``%z`` and ``%Z`` are present, the data in ``%Z`` field is used for timezone
+ name, but ``%Z`` data without ``%z`` is discarded.
+
+- Issue #5094: The ``datetime`` module now has a simple concrete class
+ implementing ``datetime.tzinfo`` interface. Instances of the new class,
+ ``datetime.timezone``, return fixed name and UTC offset from their
+ ``tzname(dt)`` and ``utcoffset(dt)`` methods. The ``dst(dt)`` method always
+ returns ``None``. A class attribute, ``utc`` contains an instance
+ representing the UTC timezone. Original patch by Rafe Kaplan.
+
+- Issue #8973: Add __all__ to struct module; this ensures that help(struct)
+ includes documentation for the struct.Struct class.
-- Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x
- python when they contain instances of old-style classes.
+- Issue #3129: Trailing digits in struct format string are no longer ignored.
+ For example, "1" or "ilib123" are now invalid formats and cause
+ ``struct.error`` to be raised. Patch by Caleb Deveraux.
-- Issue #7670: sqlite3: Fixed crashes when operating on closed connections.
+- Issue #7384: If the system readline library is linked against ncurses, the
+ curses module must be linked against ncurses as well. Otherwise it is not safe
+ to load both the readline and curses modules in an application.
+
+- Issue #2810: Fix cases where the Windows registry API returns ERROR_MORE_DATA,
+ requiring a re-try in order to get the complete result.
+
+- Issue #8692: Optimize math.factorial: replace the previous naive algorithm
+ with an improved 'binary-split' algorithm that uses fewer multiplications and
+ allows many of the multiplications to be performed using plain C integer
+ arithmetic instead of PyLong arithmetic. Also uses a lookup table for small
+ arguments.
+
+- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
+ overflow checks in the audioop module.
+
+- Issue #8644: The accuracy of td.total_seconds() has been improved (by
+ calculating with integer arithmetic instead of float arithmetic internally):
+ the result is now always correctly rounded, and is equivalent to ``td /
+ timedelta(seconds=1)``.
+
+- Issue #2706: Allow division of a timedelta by another timedelta: timedelta /
+ timedelta, timedelta % timedelta, timedelta // timedelta and divmod(timedelta,
+ timedelta) are all supported.
+
+- Issue #8314: Fix unsigned long long bug in libffi on Sparc v8.
+
+- Issue #8300: When passing a non-integer argument to struct.pack with any
+ integer format code, struct.pack first attempts to convert the non-integer
+ using its __index__ method. If that method is non-existent or raises
+ TypeError it goes on to try the __int__ method, as described below.
+
+- Issue #8142: Update libffi to the 3.0.9 release.
+
+- Issue #6949: Allow the _dbm extension to be built with db 4.8.x.
+
+- Issue #6544: Fix a reference leak in the kqueue implementation's error
+ handling.
- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
msvcr100.dll is not a platform assembly anymore.
+- Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}.
+
- Issue #7078: Set struct.__doc__ from _struct.__doc__.
+- Issue #3366: Add erf, erfc, expm1, gamma, lgamma functions to math module.
+
+- Issue #6877: It is now possible to link the readline extension to the libedit
+ readline emulation on OSX 10.5 or later.
+
- Issue #6848: Fix curses module build failure on OS X 10.6.
+- Fix a segfault that could be triggered by expat with specially formed input.
+
+- Issue #6561: '\d' in a regex now matches only characters with Unicode category
+ 'Nd' (Number, Decimal Digit). Previously it also matched characters with
+ category 'No'.
+
+- Issue #4509: Array objects are no longer modified after an operation failing
+ due to the resize restriction in-place when the object has exported buffers.
+
+- Issue #2389: Array objects are now pickled in a portable manner.
+
- Expat: Fix DoS via XML document with malformed UTF-8 sequences
(CVE_2009_3560).
+- Issue #7242: On Solaris 9 and earlier calling os.fork() from within a thread
+ could raise an incorrect RuntimeError about not holding the import lock. The
+ import lock is now reinitialized after fork.
+
- Issue #7999: os.setreuid() and os.setregid() would refuse to accept a -1
parameter on some platforms such as OS X.
-Tests
------
+- Build the ossaudio extension on GNU/kFreeBSD.
-- Issue #7924: Fix an intermittent 'XXX undetected error' failure in
- test_capi (only seen so far on platforms where the curses module
- wasn't built), due to an uncleared exception.
+- Issue #7347: winreg: Add CreateKeyEx and DeleteKeyEx, as well as fix a bug in
+ the return value of QueryReflectionKey.
-- issue #7728: test_timeout was changed to use test.support.bind_port
- instead of a hard coded port.
+- Issue #7567: PyCurses_setupterm: Don't call ``setupterm`` twice.
-- Issue #7376: instead of running a self-test (which was failing) when called
- with no arguments, doctest.py now gives a usage message.
+Build
+-----
-- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
- instead of a hardcoded port number in test_rapid_restart.
+- Use OpenSSL 1.0.0a on Windows.
-- Issue #7431: use TESTFN in test_linecache instead of trying to create a
- file in the Lib/test directory, which might be read-only for the
- user running the tests.
+- Issue #9280: Make sharedinstall depend on sharedmods.
-- Issue #7324: add a sanity check to regrtest argument parsing to
- catch the case of an option with no handler.
+- Issue #9189: Make a user-specified CFLAGS, CPPFLAGS, or LDFLAGS setting
+ override the configure and makefile defaults, without deleting options the
+ user didn't intend to override. Developers should no longer need to specify
+ OPT or EXTRA_CFLAGS, although those variables are still present for
+ backward-compatibility.
-- Issue #6551: test_zipimport could import and then destroy some modules of
- the encodings package, which would make other tests fail further down
- the road because the internally cached encoders and decoders would point
- to empty global variables.
+- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
-- Issue #7295: Do not use a hardcoded file name in test_tarfile.
+- Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
+ multiprocessing only.
-- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
- primitives such as Lock, RLock, Condition, Event and Semaphore.
+- Issue #8625: Turn off optimization in --with-pydebug builds with gcc.
+ (Optimization was unintentionally turned on in gcc --with-pydebug builds as a
+ result of the issue #1628484 fix, combined with autoconf's strange choice of
+ default CFLAGS produced by AC_PROG_CC for gcc.)
-- Issue #7248 (part 2): Use a unique temporary directory for importlib source
- tests instead of tempfile.tempdir. This prevents the tests from sharing state
- between concurrent executions on the same system.
+- Issue #3646: It is now easily possible to install a Python framework into your
+ home directory on MacOSX, see Mac/README for more information.
-- Issue #7248: In importlib.test.source.util a try/finally block did not make
- sure that some referenced objects actually were created in the block before
- calling methods on the object.
+- Issue #3928: os.mknod() now available in Solaris, also.
-- Issue #7055: test___all__ now greedily detects all modules which have an
- __all__ attribute, rather than using a hardcoded and incomplete list.
+- Issue #3326: Build Python without -fno-strict-aliasing when the gcc does not
+ give false warnings.
-- Issue #7058: Added save/restore for argv and os.environ to runtest_inner
- in regrtest, with warnings if the called test modifies them.
+- Issue #1628484: The Makefile doesn't ignore the CFLAGS environment variable
+ anymore. It also forwards the LDFLAGS settings to the linker when building a
+ shared library.
-- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
+- Issue #6716: Quote -x arguments of compileall in MSI installer. Exclude 2to3
+ tests from compileall.
-C-API
------
+- Issue #3920, #7903: Define _BSD_SOURCE on OpenBSD 4.4 through 4.9.
-- Make PyUnicode_CompareWithASCIIString return not equal if the Python string
- has '\0' at the end.
+- Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the private
+ memory allocation scheme in dtoa.c and use PyMem_Malloc and PyMem_Free
+ instead. Also disable caching of powers of 5.
-- Issue #7414: 'C' code wasn't being skipped properly (for keyword arguments)
- in PyArg_ParseTupleAndKeywords.
+- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
-Build
------
+- Issue #6943: Use pkg-config to find the libffi headers when the
+ --with-system-ffi flag is used.
-- Issue #9280: Make sharedinstall depend on sharedmods.
+- Issue #7609: Add a --with-system-expat option that causes the system's expat
+ library to be used for the pyexpat module instead of the one included with
+ Python.
-- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
+- Issue #7589: Only build the nis module when the correct header files are
+ found.
-- Issue #3920, #7903: Define _BSD_SOURCE on OpenBSD 4.4 through 4.9.
+- Switch to OpenSSL 0.9.8l and sqlite 3.6.21 on Windows.
-- Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the
- private memory allocation scheme in dtoa.c and use PyMem_Malloc and
- PyMem_Free instead. Also disable caching of powers of 5.
+- Issue #5792: Extend the short float repr support to x86 systems using
+ icc or suncc.
-- Switch to OpenSSL 0.9.8l on Windows.
+- Issue #6603: Change READ_TIMESTAMP macro in ceval.c so that it compiles
+ correctly under gcc on x86-64. This fixes a reported problem with the
+ --with-tsc build on x86-64.
-- Issue #6603: Change READ_TIMESTAMP macro in ceval.c so that it
- compiles correctly under gcc on x86-64. This fixes a reported
- problem with the --with-tsc build on x86-64.
+- Issue #6802: Fix build issues on MacOSX 10.6.
-- Issue #6802: Fix build issues on MacOSX 10.6
+- Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
-- Issue #6801 : symmetric_difference_update also accepts |.
- Thanks to Carl Chenet.
+- Issue #4601: 'make install' did not set the appropriate permissions on
+ directories.
+
+- Issue #5390: Add uninstall icon independent of whether file extensions are
+ installed.
-- Issue #7541: when using ``python-config`` with a framework install the
+- Issue #7541: When using ``python-config`` with a framework install the
compiler might use the wrong library.
-- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
+- python-config now supports multiple options on the same command line.
-- Issue #7589: Only build the nis module when the correct header files are
- found.
+- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
+
+- Issue #8510: Update to autoconf2.65.
Documentation
-------------
-- Updating `Using Python` documentation to include description of CPython's
- -J and -X options.
+- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
+ to Doc/license.rst.
+
+- Issue #9524: Document that two CTRL* signals are meant for use only
+ with os.kill.
-- Issue #6556: Fixed the Distutils configuration files location explanation
- for Windows.
+- Issue #9255: Document that the 'test' package is meant for internal Python use
+ only.
+
+- A small WSGI server was added as Tools/scripts/serve.py, and is used to
+ implement a local documentation server via 'make serve' in the doc directory.
+
+- Updating `Using Python` documentation to include description of CPython's -J
+ and -X options.
+
+- Document that importing a module that has None in sys.modules triggers an
+ ImportError.
+
+- Issue #6556: Fixed the Distutils configuration files location explanation for
+ Windows.
- Update python manual page (options -B, -O0, -s, environment variables
PYTHONDONTWRITEBYTECODE, PYTHONNOUSERSITE).
@@ -1762,130 +4193,146 @@ Documentation
- Issue #8909: Added the size of the bitmap used in the installer created by
distutils' bdist_wininst. Patch by Anatoly Techtonik.
+Tests
+-----
-What's New in Python 3.1.1?
-===========================
+- Issue #9251: test_threaded_import didn't fail when run through regrtest if the
+ import lock was disabled.
-*Release date: 2009-08-13*
+- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
-Core and Builtins
------------------
+- Issue #7449: Skip test_socketserver if threading support is disabled.
-- Issue #6707: dir() on an uninitialized module caused a crash.
+- Issue #8672: Add a zlib test ensuring that an incomplete stream can be handled
+ by a decompressor object without errors (it returns incomplete uncompressed
+ data).
-- Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
+- Issue #8533: regrtest uses backslashreplace error handler for stdout to avoid
+ UnicodeEncodeError (write non-ASCII character to stdout using ASCII encoding).
-- Issue #6573: set.union() stopped processing inputs if an instance of self
- occurred in the argument chain.
+- Issue #8576: Remove use of find_unused_port() in test_smtplib and
+ test_multiprocessing. Patch by Paul Moore.
-- Issue #6070: On posix platforms import no longer copies the execute bit
- from the .py file to the .pyc file if it is set.
+- Issue #7449: Fix many tests to support Python compiled without thread
+ support. Patches written by Jerry Seutter.
-- Issue #6428: Since Python 3.0, the __bool__ method must return a bool
- object, and not an int. Fix the corresponding error message, and the
- documentation.
+- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling of
+ SSL shutdowns.
-- Issue #6347: Include inttypes.h as well as stdint.h in pyport.h.
- This fixes a build failure on HP-UX: int32_t and uint32_t are
- defined in inttypes.h instead of stdint.h on that platform.
+- Issues #8279, #8330, #8437, #8480, #8495: Fix test_gdb failures, patch written
+ by Dave Malcolm.
-- Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and
- the 'surrogateescape' error handler, a string which contains unpaired
- surrogates.
+- Issue #3864: Skip three test_signal tests on freebsd6 because they fail if any
+ thread was previously started, most likely due to a platform bug.
-C-API
------
+- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
-- Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
- NUL: Bogus TypeError detail string.
+- Issue #8248: Add some tests for the bool type. Patch by Gregory Nofi.
-- Issue #6405: Remove duplicate type declarations in descrobject.h.
+- Issue #8263: Now regrtest.py will report a failure if it receives a
+ KeyboardInterrupt (SIGINT).
-- The code flags for old __future__ features are now available again.
+- Issue #8180 and #8207: Fix test_pep277 on OS X and add more tests for special
+ Unicode normalization cases.
-Library
--------
+- Issue #7783: test.support.open_urlresource invalidates the outdated files from
+ the local cache.
-- Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT
- DO/DONT correctly.
+- Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are
+ effectively raised.
-- Issue #6126: Fixed pdb command-line usage.
+- The four path modules (genericpath, macpath, ntpath, posixpath) share a common
+ TestCase for some tests: test_genericpath.CommonTest.
-- Issue #6629: Fix a data corruption issue in the new I/O library, which could
- occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
- "wb+" mode) after having buffered a certain amount of data for reading. This
- bug was not present in the pure Python implementation.
+- Print platform information when running the whole test suite, or using the
+ --verbose flag.
-- Issue #6622: Fix "local variable 'secret' referenced before
- assignment" bug in POP3.apop.
+- Issue #767675: enable test_pep277 on POSIX platforms with Unicode-friendly
+ filesystem encoding.
-- Issue #6637: defaultdict.copy() did not work when the default factory
- was left unspecified. Also, the eval/repr round-trip would fail when
- the default_factory was None.
+- Issue #6292: for the moment at least, the test suite runs cleanly if python is
+ run with the -OO flag. Tests requiring docstrings are skipped.
-- Issue #2715: Remove remnants of Carbon.File from binhex module.
+- Issue #7712: test.support gained a new `temp_cwd` context manager which is now
+ also used by regrtest to run all the tests in a temporary directory. The
+ original CWD is saved in `support.SAVEDCWD`. Thanks to Florent Xicluna who
+ helped with the patch.
-- Issue #6595: The Decimal constructor now allows arbitrary Unicode
-decimal digits in input, as recommended by the standard. Previously
-it was restricted to accepting [0-9].
+- Issue #7924: Fix an intermittent 'XXX undetected error' failure in test_capi
+ (only seen so far on platforms where the curses module wasn't built), due to
+ an uncleared exception.
-- Issues #5155, #5313, #5331: multiprocessing.Process._bootstrap was
-unconditionally calling "os.close(sys.stdin.fileno())" resulting in file
-descriptor errors
+- Issue #7728: test_timeout was changed to use support.bind_port instead of a
+ hard coded port.
-- Issue #1424152: Fix for http.client, urllib.request to support SSL while
-working through proxy. Original patch by Christopher Li, changes made by
-Senthil Kumaran
+- Issue #7376: Instead of running a self-test (which was failing) when called
+ with no arguments, doctest.py now gives a usage message.
-- importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like
-the documentation said it did even though the code in PyLoader relied on the
-abstract method required by ResourceLoader.
+- Issue #7396: fix regrtest -s, which was broken by the -j enhancement.
-- Issue #6431: Make Fraction type return NotImplemented when it doesn't
-know how to handle a comparison without loss of precision. Also add
-correct handling of infinities and nans for comparisons with float.
+- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
+ instead of a hardcoded port number in test_rapid_restart.
-- Issue #6415: Fixed warnings.warn segfault on bad formatted string.
+- Issue #7431: Use TESTFN in test_linecache instead of trying to create a file
+ in the Lib/test directory, which might be read-only for the user running the
+ tests.
-- Issue #6358: The exit status of a command started with os.popen() was
-reported differently than it did with python 2.x.
+- Issue #7324: Add a sanity check to regrtest argument parsing to catch the case
+ of an option with no handler.
-- Issue #6323: The pdb debugger did not exit when running a script with a
-syntax error.
+- Issue #7312: Add a -F flag to run the selected tests in a loop until a test
+ fails. Can be combined with -j.
-- Issue #3392: The subprocess communicate() method no longer fails in select()
- when file descriptors are large; communicate() now uses poll() when possible.
+- Issue #6551: test_zipimport could import and then destroy some modules of the
+ encodings package, which would make other tests fail further down the road
+ because the internally cached encoders and decoders would point to empty
+ global variables.
-- Issue #6369: Fix an RLE decompression bug in the binhex module.
+- Issue #7295: Do not use a hardcoded file name in test_tarfile.
-- Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
+- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
+ primitives such as Lock, RLock, Condition, Event and Semaphore.
-- Issue #4005: Fixed a crash of pydoc when there was a zip file present in
- sys.path.
+- Issue #7248 (part 2): Use a unique temporary directory for importlib source
+ tests instead of tempfile.tempdir. This prevents the tests from sharing state
+ between concurrent executions on the same system.
-Extension Modules
------------------
+- Issue #7248: In importlib.test.source.util a try/finally block did not make
+ sure that some referenced objects actually were created in the block before
+ calling methods on the object.
-- Fix a segfault in expat.
+- Issue #7222: Make thread "reaping" more reliable so that reference
+ leak-chasing test runs give sensible results. The previous method of reaping
+ threads could return successfully while some Thread objects were still
+ referenced. This also introduces a new private function:
+ :func:`_thread._count()`.
-- Issue #4509: array.array objects are no longer modified after an operation
- failing due to the resize restriction in-place when the object has exported
- buffers.
+- Issue #7151: Fixed regrtest -j so that output to stderr from a test no longer
+ runs the risk of causing the worker thread to fail.
-Build
------
+- Issue #7055: test___all__ now greedily detects all modules which have an
+ __all__ attribute, rather than using a hardcoded and incomplete list.
-- Issue #4601: 'make install' did not set the appropriate permissions on
-directories.
+- Issue #7058: Added save/restore for things like sys.argv and cwd to
+ runtest_inner in regrtest, with warnings if the called test modifies them, and
+ a new section in the summary report at the end.
+
+- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
-- Issue #5390: Add uninstall icon independent of whether file
-extensions are installed.
+- Fixed tests in importlib.test.source.test_abc_loader that were masking the
+ proper exceptions that should be raised for missing or improper code object
+ bytecode.
-Test
-----
+- Removed importlib's custom test discovery code and switched to
+ unittest.TestLoader.discover().
-- Fix a test in importlib.test.source.test_abc_loader that was incorrectly
-testing when a .pyc file lacked an code object bytecode.
+Tools/Demos
+-----------
+
+- Issue #5464, #8974: Implement plural forms in msgfmt.py.
+
+- iobench (a file I/O benchmark) and ccbench (a concurrency benchmark) were
+ added to the `Tools/` directory. They were previously living in the sandbox.
What's New in Python 3.1?
@@ -1897,27 +4344,28 @@ Core and Builtins
-----------------
- Issue #6334: Fix bug in range length calculation for ranges with
-large arguments.
+ large arguments.
- Issue #6329: Fixed iteration for memoryview objects (it was being blocked
-because it wasn't recognized as a sequence).
+ because it wasn't recognized as a sequence).
Library
-------
-- Issue #6314: logging.basicConfig() performs extra checks on the "level"
-argument.
+- Issue #6126: Fixed pdb command-line usage.
+
+- Issue #6314: logging: performs extra checks on the "level" argument.
- Issue #6274: Fixed possible file descriptors leak in subprocess.py
- Accessing io.StringIO.buffer now raises an AttributeError instead of
-io.UnsupportedOperation.
+ io.UnsupportedOperation.
- Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
-(On Unix)
+ (On Unix)
- Issue #1202: zipfile module would cause a struct.error when attempting to
-store files with a CRC32 > 2**31-1.
+ store files with a CRC32 > 2**31-1.
Extension Modules
-----------------
@@ -1936,10 +4384,10 @@ Core and Builtins
- Fixed SystemError triggered by "range([], 1, -1)".
- Issue #5924: On Windows, a large PYTHONPATH environment variable
-(more than 255 characters) would be completely ignored.
+ (more than 255 characters) would be completely ignored.
- Issue #4547: When debugging a very large function, it was not always
-possible to update the lineno attribute of the current frame.
+ possible to update the lineno attribute of the current frame.
- Issue #5330: C functions called with keyword arguments were not reported by
the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
@@ -1948,38 +4396,38 @@ Library
-------
- Issue #6438: Fixed distutils.cygwinccompiler.get_versions : the regular
-expression string pattern was trying to match against a bytes returned by
-Popen. Tested under win32 to build the py-postgresql project.
+ expression string pattern was trying to match against a bytes returned by
+ Popen. Tested under win32 to build the py-postgresql project.
- Issue #6258: Support AMD64 in bdist_msi.
- Issue #6195: fixed doctest to no longer try to read 'source' data from
-binary files.
+ binary files.
- Issue #5262: Fixed bug in next rollover time computation in
-TimedRotatingFileHandler.
+ TimedRotatingFileHandler.
- Issue #6217: The C implementation of io.TextIOWrapper didn't include the
-errors property. Additionally, the errors and encoding properties of StringIO
-are always None now.
+ errors property. Additionally, the errors and encoding properties of StringIO
+ are always None now.
- Issue #6137: The pickle module now translates module names when loading
-or dumping pickles with a 2.x-compatible protocol, in order to make data
-sharing and migration easier. This behaviour can be disabled using the
-new `fix_imports` optional argument.
+ or dumping pickles with a 2.x-compatible protocol, in order to make data
+ sharing and migration easier. This behaviour can be disabled using the
+ new `fix_imports` optional argument.
- Removed the ipaddr module.
- Issue #3613: base64.{encode,decode}string are now called
-base64.{encode,decode}bytes which reflects what type they accept and return.
-The old names are still there as deprecated aliases.
+ base64.{encode,decode}bytes which reflects what type they accept and return.
+ The old names are still there as deprecated aliases.
- Issue #5767: Remove sgmlop support from xmlrpc.client.
- Issue #6150: Fix test_unicode on wide-unicode builds.
- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
-parameters.
+ parameters.
Windows
-------
@@ -2262,7 +4710,7 @@ Core and Builtins
- Issue #2170: refactored xml.dom.minidom.normalize, increasing both
its clarity and its speed.
-- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add `do { ... } while (0)'
+- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add ``do { ... } while (0)``
to avoid compiler warnings.
- Issue #3739: The unicode-internal encoder now reports the number of characters
@@ -2276,6 +4724,8 @@ Installation
Library
-------
+- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
+
- Issue #5311: bdist_msi can now build packages that do not depend on a
specific Python version.
@@ -2584,7 +5034,7 @@ Core and Builtins
optional module state data.
- Issue #4910: Rename nb_long slot to nb_reserved, and change its
- type to (void *).
+ type to ``(void *)``.
- Issue #4935: The overflow checking code in the expandtabs() method common
to str, bytes and bytearray could be optimized away by the compiler, letting
@@ -2639,8 +5089,8 @@ Core and Builtins
- Issue #4747: When the terminal does not use utf-8, executing a script with
non-ascii characters in its name could fail with a "SyntaxError: None" error.
-- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open
- file with `bytes' filename on Windows.
+- Issue #4797: IOError.filename was not set when ``_fileio.FileIO`` failed
+ to open file with a bytes filename on Windows.
- Issue #3680: Reference cycles created through a dict, set or deque iterator
did not get collected.
@@ -2707,23 +5157,65 @@ Core and Builtins
Library
-------
+- Issue #7071: byte-compilation in Distutils is now done with respect to
+ sys.dont_write_bytecode.
+
+- Issue #7066: archive_util.make_archive now restores the cwd if an error is
+ raised. Initial patch by Ezio Melotti.
+
+- Issue #6516: Added owner/group support when creating tar archives in
+ Distutils.
+
+- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
+
+- Issue #6163: Fixed HP-UX runtime library dir options in
+ distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
+ Michael Haubenwallner.
+
+- Issue #6693: New functions in site.py to get user/global site packages paths.
+
+- Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when
+ opening an empty or very small file.
+
- Issue #6545: Removed assert statements in distutils.Extension, so the
behavior is similar when used with -O.
-- Issue #6459: distutils.command.build_ext.get_export_symbols now uses the
- "PyInit" prefix, rather than "init".
+- unittest has been split up into a package. All old names should still work.
+
+- Issue #6466: now distutils.cygwinccompiler and distutils.emxccompiler
+ uses the same refactored function to get gcc/ld/dllwrap versions numbers.
+ It's `distutils.util.get_compiler_versions`. Added deprecation warnings
+ for the obsolete get_versions() functions.
- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
+- Issue #6314: logging: Extra checks on the "level" argument in more places.
+
+- Issue #2622: Fixed an ImportError when importing email.message from a
+ standalone application built with py2exe or py2app.
+
- Issue #6455: Fixed test_build_ext under win32.
+- Issue #6377: Enabled the compiler option, and deprecate its usage as an
+ attribute.
+
- Issue #6413: Fixed the log level in distutils.dist for announce.
- Issue #6403: Fixed package path usage in build_ext.
+- Issues #5155, 5313, 5331: multiprocessing.Process._bootstrap was
+ unconditionally calling "os.close(sys.stdin.fileno())" resulting in file
+ descriptor errors
+
- Issue #6365: Distutils build_ext inplace mode was copying the compiled
extension in a subdirectory if the extension name had dots.
+- Issue #6164: Added an AIX specific linker argument in Distutils
+ unixcompiler. Original patch by Sridhar Ratnakumar.
+
+- Issue #6286: Now Distutils upload command is based on urllib2 instead of
+ httplib, allowing the usage of http_proxy.
+
- Issue #6287: Added the license field in Distutils documentation.
- Issue #6263: Fixed syntax error in distutils.cygwincompiler.
@@ -2849,7 +5341,7 @@ Library
- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
overrun.
-- Issue #1533164: Installed but not listed *.pyo was breaking Distutils
+- Issue #1533164: Installed but not listed ``*.pyo`` was breaking Distutils
bdist_rpm command.
- Issue #5378: added --quiet option to Distutils bdist_rpm command.
@@ -3002,8 +5494,8 @@ Library
- Issue #4959: inspect.formatargspec now works for keyword only arguments
without defaults.
-- Issue #3321: _multiprocessing.Connection() doesn't check handle; added checks
- for *nix machines for negative handles and large int handles. Without this check
+- Issue #3321: ``_multiprocessing.Connection()`` doesn't check handle; added checks
+ for Unix machines for negative handles and large int handles. Without this check
it is possible to segfault the interpreter.
- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
@@ -3209,6 +5701,9 @@ Build
C-API
-----
+- Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
+ NUL: Bogus TypeError detail string.
+
- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError
for negative arguments. Previously, it raised TypeError.
@@ -3259,6 +5754,9 @@ Extension Modules
Tests
-----
+- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running
+ regression tests in parallel, shortening the total runtime.
+
- Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
Lib/tkinter/test/test_tkinter/test_loadtk. With this, these tests demonstrate
the same behaviour as test_ttkguionly (and now also test_tk) which is to
diff --git a/Misc/Porting b/Misc/Porting
index ec9cf1f441..51f73e63d1 100644
--- a/Misc/Porting
+++ b/Misc/Porting
@@ -31,7 +31,7 @@ target platform. Forget about the posix module for now -- simply take
it out of the config.c file.
Bang on it until you get a >>> prompt. (You may have to disable the
-importing of "site.py" by passing the -S options.)
+importing of "site.py" by passing the -S option.)
Then bang on it until it executes very simple Python statements.
diff --git a/Misc/README b/Misc/README
index e7a59c7182..b239cee706 100644
--- a/Misc/README
+++ b/Misc/README
@@ -8,32 +8,19 @@ Files found here
----------------
ACKS Acknowledgements
-AIX-NOTES Notes for building Python on AIX
build.sh Script to build and test latest Python from the repository
-cheatsheet Quick summary of Python by Ken Manheimer
-developers.txt A history of who got developer permissions, and why
gdbinit Handy stuff to put in your .gdbinit file, if you use gdb
HISTORY News from previous releases -- oldest last
indent.pro GNU indent profile approximating my C style
-maintainers.rst A list of maintainers for library modules
NEWS News for this release (for some meaning of "this")
-NEWS.help How to edit NEWS
Porting Mini-FAQ on porting to new platforms
-PURIFY.README Information for Purify users
-pymemcompat.h Memory interface compatibility file.
python-config.in Python script template for python-config
python.man UNIX man page for the python interpreter
-python-mode.el Emacs mode for editing Python programs
python.pc.in Package configuration info template for pkg-config
-python-wing.wpr Wing IDE project file
+python-wing*.wpr Wing IDE project file
README The file you're reading now
-README.coverity Information about running Coverity's Prevent on Python
-README.klocwork Information about running Klocwork's K7 on Python
-README.OpenBSD Help for building problems on OpenBSD
README.valgrind Information for Valgrind users, see valgrind-python.supp
-RFD Request For Discussion about a Python newsgroup
RPM (Old) tools to build RPMs
-setuid-prog.c C helper program for set-uid Python scripts
SpecialBuilds.txt Describes extra symbols you can set for debug builds
TextMate A TextMate bundle for Python development
valgrind-python.supp Valgrind suppression file, see README.valgrind
diff --git a/Misc/README.Emacs b/Misc/README.Emacs
deleted file mode 100644
index 68bb1dbd3f..0000000000
--- a/Misc/README.Emacs
+++ /dev/null
@@ -1,32 +0,0 @@
-=============
-Emacs support
-=============
-
-If you want to edit Python code in Emacs, you should download python-mode.el
-and install it somewhere on your load-path. See the project page to download:
-
- https://launchpad.net/python-mode
-
-While Emacs comes with a python.el file, it is not recommended.
-python-mode.el is maintained by core Python developers and is generally
-considered more Python programmer friendly. For example, python-mode.el
-includes a killer feature called `pdbtrack` which allows you to set a pdb
-breakpoint in your code, run your program in an Emacs shell buffer, and do gud
-style debugging when the breakpoint is hit.
-
-python-mode.el is compatible with both GNU Emacs from the FSF, and XEmacs.
-
-For more information and bug reporting, see the above project page. For help,
-development, or discussions, see the python-mode mailing list:
-
- http://mail.python.org/mailman/listinfo/python-mode
-
-
-..
- Local Variables:
- mode: indented-text
- indent-tabs-mode: nil
- sentence-end-double-space: t
- fill-column: 78
- coding: utf-8
- End:
diff --git a/Misc/README.OpenBSD b/Misc/README.OpenBSD
deleted file mode 100644
index b417ecc76f..0000000000
--- a/Misc/README.OpenBSD
+++ /dev/null
@@ -1,38 +0,0 @@
-
-2005-01-08
-
-If you are have a problem building on OpenBSD and see output like this
-while running configure:
-
-checking curses.h presence... yes
-configure: WARNING: curses.h: present but cannot be compiled
-configure: WARNING: curses.h: check for missing prerequisite headers?
-configure: WARNING: curses.h: see the Autoconf documentation
-configure: WARNING: curses.h: section "Present But Cannot Be Compiled"
-configure: WARNING: curses.h: proceeding with the preprocessor's result
-configure: WARNING: curses.h: in the future, the compiler will take precedence
-
-there is likely a problem that will prevent building python.
-If you see the messages above and are able to completely build python,
-please tell python-dev@python.org indicating your version of OpenBSD
-and any other relevant system configuration.
-
-The build error that occurs while making may look something like this:
-
- /usr/include/sys/event.h:53: error: syntax error before "u_int"
- /usr/include/sys/event.h:55: error: syntax error before "u_short"
-
-To fix this problem, you will probably need update Python's configure
-script to disable certain options. Search for a line that looks like:
-
- OpenBSD/2.* | OpenBSD/3.@<:@012345678@:>@)
-
-If your version is not in that list, e.g., 3.9, add the version
-number. In this case, you would just need to add a 9 after the 8.
-If you modify configure.in, you will need to regenerate configure
-with autoconf.
-
-If your version is already in the list, this is not a known problem.
-Please submit a bug report here:
-
- http://sourceforge.net/tracker/?group_id=5470&atid=105470
diff --git a/Misc/README.klocwork b/Misc/README.klocwork
deleted file mode 100644
index 6d2f57fc73..0000000000
--- a/Misc/README.klocwork
+++ /dev/null
@@ -1,30 +0,0 @@
-
-Klocwork has a static analysis tool (K7) which is similar to Coverity.
-They will run their tool on the Python source code on demand.
-The results are available at:
-
- https://opensource.klocwork.com/
-
-Currently, only Neal Norwitz has access to the analysis reports. Other
-people can be added by request.
-
-K7 was first run on the Python 2.5 source code in mid-July 2006.
-This is after Coverity had been making their results available.
-There were originally 175 defects reported. Most of these
-were false positives. However, there were numerous real issues
-also uncovered.
-
-Each warning has a unique id and comments that can be made on it.
-When checking in changes due to a K7 report, the unique id
-as reported by the tool was added to the SVN commit message.
-A comment was added to the K7 warning indicating the SVN revision
-in addition to any analysis.
-
-False positives were also annotated so that the comments can
-be reviewed and reversed if the analysis was incorrect.
-
-A second run was performed on 10-Aug-2006. The tool was tuned to remove
-some false positives and perform some additional checks. ~150 new
-warnings were produced, primarily related to dereferencing NULL pointers.
-
-Contact python-dev@python.org for more information.
diff --git a/Misc/RFD b/Misc/RFD
deleted file mode 100644
index fd278c4fa5..0000000000
--- a/Misc/RFD
+++ /dev/null
@@ -1,114 +0,0 @@
-To: python-list
-Subject: comp.lang.python RFD again
-From: Guido.van.Rossum@cwi.nl
-
-I've followed the recent discussion and trimmed the blurb RFD down a bit
-(and added the word "object-oriented" to the blurb).
-
-I don't think it's too early to *try* to create the newsgroup --
-whether we will succeed may depend on how many Python supporters there
-are outside the mailing list.
-
-I'm personally not worried about moderation, and anyway I haven't
-heard from any volunteers for moderation (and I won't volunteer
-myself) so I suggest that we'll continue to ask for one unmoderated
-newsgroup.
-
-My next action will be to post an updated FAQ (which will hint at the
-upcoming RFD) to comp.lang.misc; then finalize the 1.0.0 release and
-put it on the ftp site. I'll also try to get it into
-comp.sources.unix or .misc. And all this before the end of January!
-
---Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
-URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>
-
-======================================================================
-
-These are the steps required (in case you don't know about the
-newsgroup creation process):
-
-First, we need to draw up an RFD (Request For Discussion). This is a
-document that tells what the purpose of the group is, and gives a case
-for its creation. We post this to relevant groups (comp.lang.misc,
-the mailing list, news.groups, etc.) Discussion is held on
-news.groups.
-
-Then, after a few weeks, we run the official CFV (Call For Votes).
-The votes are then collected over a period of weeks. We need 100 more
-yes votes than no votes, and a 2/3 majority, to get the group.
-
-There are some restrictions on the vote taker: [s]he cannot actively
-campaign for/against the group during the vote process. So the main
-benefit to Steve instead of me running the vote is that I will be free
-to campaign for its creation!
-
-The following is our current draft for the RFD.
-
-======================================================================
-
-Request For Discussion: comp.lang.python
-
-
-Purpose
--------
-
-The newsgroup will be for discussion on the Python computer language.
-Possible topics include requests for information, general programming,
-development, and bug reports. The group will be unmoderated.
-
-
-What is Python?
----------------
-
-Python is a relatively new very-high-level language developed in
-Amsterdam. Python is a simple, object-oriented procedural language,
-with features taken from ABC, Icon, Modula-3, and C/C++.
-
-Its central goal is to provide the best of both worlds: the dynamic
-nature of scripting languages like Perl/TCL/REXX, but also support for
-general programming found in the more traditional languages like Icon,
-C, Modula,...
-
-Python may be FTP'd from the following sites:
-
- ftp.cwi.nl in directory /pub/python (its "home site", also has a FAQ)
- ftp.uu.net in directory /languages/python
- gatekeeper.dec.com in directory /pub/plan/python/cwi
-
-
-Rationale
----------
-
-Currently there is a mailing list with over 130 subscribers.
-The activity of this list is high, and to make handling the
-traffic more reasonable, a newsgroup is being proposed. We
-also feel that comp.lang.misc would not be a suitable forum
-for this volume of discussion on a particular language.
-
-
-Charter
--------
-
-Comp.lang.python is an unmoderated newsgroup which will serve
-as a forum for discussing the Python computer language. The
-group will serve both those who just program in Python and
-those who work on developing the language. Topics that
-may be discussed include:
-
- - announcements of new versions of the language and
- applications written in Python.
-
- - discussion on the internals of the Python language.
-
- - general information about the language.
-
- - discussion on programming in Python.
-
-
-Discussion
-----------
-
-Any objections to this RFD will be considered and, if determined
-to be appropriate, will be incorporated. The discussion period
-will be for a period of 21 days after which the first CFV will be
-issued.
diff --git a/Misc/RPM/README b/Misc/RPM/README
index f3a25575f7..d883c95e85 100644
--- a/Misc/RPM/README
+++ b/Misc/RPM/README
@@ -2,11 +2,6 @@ This directory contains support file used to build RPM releases of
Python. Its contents are maintained by Sean Reifschneider
<jafo@tummy.com>.
-It is recommended that RPM builders use the python*.src.rpm file
-downloaded from the "ftp.python.org:/pub/python/<version>/rpms". These
-may be more up to date than the files included in the base Python
-release tar-file.
-
If you wish to build RPMs from the base Python release tar-file, note
that you will have to download the
"doc/<version>/html-<version>.tar.bz2"
@@ -14,3 +9,25 @@ file from python.org and place it into your "SOURCES" directory for
the build to complete. This is the same directory that you place the
Python-2.3.1 release tar-file in. You can then use the ".spec" file in
this directory to build RPMs.
+
+You may also wish to pursue RPMs provided by distribution makers to see if
+they have one suitable for your uses. If, for example, you just want a
+slightly newer version of Python than what the distro provides, you could
+pick up the closest SRPM your distro provides, and then modify it to
+the newer version, and build that. It may be as simple as just changing
+the "version" information in the spec file (or it may require fixing
+patches).
+
+NOTE: I am *NOT* recommending just using the binary RPM, and never do an
+install with "--force" or "--nodeps".
+
+Also worth pursuing may be newer versions provided by similar distros. For
+example, a Python 3 SRPM from Fedora may be a good baseline to try building
+on CentOS.
+
+Many newer SRPMs won't install on older distros because of format changes.
+You can manually extract these SRPMS with:
+
+ mkdir foo
+ cd foo
+ rpm2cpio <../python3-*.src.rpm | cpio -ivd
diff --git a/Misc/RPM/python-3.1.spec b/Misc/RPM/python-3.2.spec
index 0f24a41762..a5ecdc703a 100644
--- a/Misc/RPM/python-3.1.spec
+++ b/Misc/RPM/python-3.2.spec
@@ -25,6 +25,11 @@
%define config_ipv6 yes
%define config_ipv6 no
+# Build shared libraries or .a library?
+#WARNING: Commenting out doesn't work. Last line is what's used.
+%define config_sharedlib no
+%define config_sharedlib yes
+
# Location of the HTML directory.
%define config_htmldir /var/www/html/python
@@ -34,8 +39,8 @@
%define name python
#--start constants--
-%define version 3.1.3
-%define libvers 3.1
+%define version 3.2
+%define libvers 3.2
#--end constants--
%define release 1pydotorg
%define __prefix /usr
@@ -46,6 +51,8 @@
%define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi)
%define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi)
%define libdirname %(( uname -m | egrep -q '_64$' && [ -d /usr/lib64 ] && echo lib64 ) || echo lib)
+%define sharedlib %(if [ "%{config_sharedlib}" = yes ]; then echo --enable-shared; else echo ; fi)
+%define include_sharedlib %(if [ "%{config_sharedlib}" = yes ]; then echo 1; else echo 0; fi)
# detect if documentation is available
%define include_docs %(if [ -f "%{_sourcedir}/html-%{version}.tar.bz2" ]; then echo 1; else echo 0; fi)
@@ -223,7 +230,14 @@ formats.
# BUILD
########
%build
-./configure --enable-unicode=ucs4 %{ipv6} %{pymalloc} --prefix=%{__prefix}
+echo "Setting for ipv6: %{ipv6}"
+echo "Setting for pymalloc: %{pymalloc}"
+echo "Setting for binsuffix: %{binsuffix}"
+echo "Setting for include_tkinter: %{include_tkinter}"
+echo "Setting for libdirname: %{libdirname}"
+echo "Setting for sharedlib: %{sharedlib}"
+echo "Setting for include_sharedlib: %{include_sharedlib}"
+./configure --enable-unicode=ucs4 %{sharedlib} %{ipv6} %{pymalloc} --prefix=%{__prefix}
make
##########
@@ -254,11 +268,10 @@ fi
# add the binsuffix
if [ ! -z "%{binsuffix}" ]
then
- ( cd $RPM_BUILD_ROOT%{__prefix}/bin; rm -f python[0-9a-zA-Z]*;
- mv -f python python"%{binsuffix}" )
- ( cd $RPM_BUILD_ROOT%{__prefix}/share/man/man1; mv python.1 python%{binsuffix}.1 )
- ( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f pydoc pydoc"%{binsuffix}" )
- ( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f idle idle"%{binsuffix}" )
+ rm -f $RPM_BUILD_ROOT%{__prefix}/bin/python[0-9a-zA-Z]*
+ ( cd $RPM_BUILD_ROOT%{__prefix}/bin;
+ for file in *; do mv "$file" "$file"%{binsuffix}; done )
+ ( cd $RPM_BUILD_ROOT%{_mandir}/man1; mv python.1 python%{binsuffix}.1 )
fi
########
@@ -273,17 +286,23 @@ cp -a Tools $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers}
# MAKE FILE LISTS
rm -f mainpkg.files
-find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/lib-dynload -type f |
+find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers} -type f |
sed "s|^${RPM_BUILD_ROOT}|/|" |
- grep -v -e '_tkinter.so$' >mainpkg.files
-find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f |
+ grep -v -e '/python%{libvers}/config$' -e '_tkinter.so$' >mainpkg.files
+find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f -o -type l |
sed "s|^${RPM_BUILD_ROOT}|/|" |
+ grep -v -e '/bin/2to3%{binsuffix}$' |
+ grep -v -e '/bin/pydoc%{binsuffix}$' |
+ grep -v -e '/bin/smtpd.py%{binsuffix}$' |
grep -v -e '/bin/idle%{binsuffix}$' >>mainpkg.files
rm -f tools.files
find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/idlelib \
"$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/Tools -type f |
sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files
+echo "%{__prefix}"/bin/2to3%{binsuffix} >>tools.files
+echo "%{__prefix}"/bin/pydoc%{binsuffix} >>tools.files
+echo "%{__prefix}"/bin/smtpd.py%{binsuffix} >>tools.files
echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files
######
@@ -341,27 +360,13 @@ rm -f mainpkg.files tools.files
%defattr(-,root,root)
%doc Misc/README Misc/cheatsheet Misc/Porting
%doc LICENSE Misc/ACKS Misc/HISTORY Misc/NEWS
-%{__prefix}/share/man/man1/python%{binsuffix}.1*
+%{_mandir}/man1/python%{binsuffix}.1*
%attr(755,root,root) %dir %{__prefix}/include/python%{libvers}
%attr(755,root,root) %dir %{__prefix}/%{libdirname}/python%{libvers}/
-%{__prefix}/%{libdirname}/python%{libvers}/*.txt
-%{__prefix}/%{libdirname}/python%{libvers}/*.py*
-%{__prefix}/%{libdirname}/python%{libvers}/pdb.doc
-%{__prefix}/%{libdirname}/python%{libvers}/curses
-%{__prefix}/%{libdirname}/python%{libvers}/distutils
-%{__prefix}/%{libdirname}/python%{libvers}/encodings
-%{__prefix}/%{libdirname}/python%{libvers}/plat-linux2
-%{__prefix}/%{libdirname}/python%{libvers}/site-packages
-%{__prefix}/%{libdirname}/python%{libvers}/test
-%{__prefix}/%{libdirname}/python%{libvers}/xml
-%{__prefix}/%{libdirname}/python%{libvers}/email
-%{__prefix}/%{libdirname}/python%{libvers}/email/mime
-%{__prefix}/%{libdirname}/python%{libvers}/sqlite3
-%{__prefix}/%{libdirname}/python%{libvers}/compiler
-%{__prefix}/%{libdirname}/python%{libvers}/hotshot
-%{__prefix}/%{libdirname}/python%{libvers}/logging
-%{__prefix}/%{libdirname}/python%{libvers}/lib-old
+%if %{include_sharedlib}
+%{__prefix}/%{libdirname}/libpython*
+%endif
%files devel
%defattr(-,root,root)
diff --git a/Misc/Vim/vimrc b/Misc/Vim/vimrc
index 2013bf30e6..c398cca696 100644
--- a/Misc/Vim/vimrc
+++ b/Misc/Vim/vimrc
@@ -15,38 +15,35 @@
" Only basic settings needed to enforce the style guidelines are set.
" Some suggested options are listed but commented out at the end of this file.
-
-" Number of spaces to use for an indent.
-" This will affect Ctrl-T and 'autoindent'.
-" Python: 4 spaces
-" C: 4 spaces
-au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
-au BufRead *.c,*.h set shiftwidth=8
-au BufNewFile *.c,*.h set shiftwidth=4
-
" Number of spaces that a pre-existing tab is equal to.
" For the amount of space used for a new tab use shiftwidth.
-" Python: 8
-" C: 8
au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=8
-" Replace tabs with the equivalent number of spaces.
-" Also have an autocmd for Makefiles since they require hard tabs.
-" Python: yes
-" C: yes
-" Makefile: no
-au BufRead,BufNewFile *.py,*.pyw,*.c,*.h set expandtab
+" What to use for an indent.
+" This will affect Ctrl-T and 'autoindent'.
+" Python: 4 spaces
+" C: tabs (pre-existing files) or 4 spaces (new files)
+au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
+au BufRead,BufNewFile *.py,*.pyw set expandtab
+fu Select_c_style()
+ if search('^\t', 'n', 150)
+ set shiftwidth=8
+ set noexpandtab
+ el
+ set shiftwidth=4
+ set expandtab
+ en
+endf
+au BufRead,BufNewFile *.c,*.h call Select_c_style()
au BufRead,BufNewFile Makefile* set noexpandtab
-" Use the below highlight group when displaying bad whitespace is desired
+" Use the below highlight group when displaying bad whitespace is desired.
highlight BadWhitespace ctermbg=red guibg=red
" Display tabs at the beginning of a line in Python mode as bad.
-" Should be done for C code, but not until all code has been moved to 4-space
-" indents.
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
" Make trailing whitespace be flagged as bad.
-au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
+au BufRead,BufNewFile *.py,*.pyw,*.c,*.h,*.rst match BadWhitespace /\s\+$/
" Wrap text after a certain number of characters
" Python: 79
diff --git a/Misc/build.sh b/Misc/build.sh
index 03c0d7b43e..ecbe57970f 100755
--- a/Misc/build.sh
+++ b/Misc/build.sh
@@ -52,9 +52,9 @@ FAILURE_MAILTO="python-checkins@python.org"
#FAILURE_CC="optional--uncomment and set to desired address"
REMOTE_SYSTEM="neal@dinsdale.python.org"
-REMOTE_DIR="/data/ftp.python.org/pub/www.python.org/doc/3.1"
+REMOTE_DIR="/data/ftp.python.org/pub/docs.python.org/dev/py3k"
RESULT_FILE="$DIR/build/index.html"
-INSTALL_DIR="/tmp/python-test-3.1/local"
+INSTALL_DIR="/tmp/python-test-3.2/local"
RSYNC_OPTS="-C -e ssh -rlogD"
# Always run the installed version of Python.
@@ -214,7 +214,7 @@ if [ $err = 0 -a "$BUILD_DISABLED" != "yes" ]; then
## make and run basic tests
F=make-test.out
start=`current_time`
- $PYTHON $REGRTEST_ARGS -u urlfetch >& build/$F
+ $PYTHON $REGRTEST_ARGS -W -u urlfetch >& build/$F
NUM_FAILURES=`count_failures build/$F`
place_summary_first build/$F
update_status "Testing basics ($NUM_FAILURES failures)" "$F" $start
@@ -222,7 +222,7 @@ if [ $err = 0 -a "$BUILD_DISABLED" != "yes" ]; then
F=make-test-opt.out
start=`current_time`
- $PYTHON -O $REGRTEST_ARGS -u urlfetch >& build/$F
+ $PYTHON -O $REGRTEST_ARGS -W -u urlfetch >& build/$F
NUM_FAILURES=`count_failures build/$F`
place_summary_first build/$F
update_status "Testing opt ($NUM_FAILURES failures)" "$F" $start
@@ -245,7 +245,7 @@ if [ $err = 0 -a "$BUILD_DISABLED" != "yes" ]; then
start=`current_time`
## skip curses when running from cron since there's no terminal
## skip sound since it's not setup on the PSF box (/dev/dsp)
- $PYTHON $REGRTEST_ARGS -uall -x test_curses test_linuxaudiodev test_ossaudiodev $_ALWAYS_SKIP >& build/$F
+ $PYTHON $REGRTEST_ARGS -W -uall -x test_curses test_linuxaudiodev test_ossaudiodev &_ALWAYS_SKIP >& build/$F
NUM_FAILURES=`count_failures build/$F`
place_summary_first build/$F
update_status "Testing all except curses and sound ($NUM_FAILURES failures)" "$F" $start
diff --git a/Misc/cheatsheet b/Misc/cheatsheet
deleted file mode 100644
index 8c5ddcb457..0000000000
--- a/Misc/cheatsheet
+++ /dev/null
@@ -1,2181 +0,0 @@
- Python 2.3 Quick Reference
-
-
- 25 Jan 2003 upgraded by Raymond Hettinger for Python 2.3
- 16 May 2001 upgraded by Richard Gruet and Simon Brunning for Python 2.0
- 2000/07/18 upgraded by Richard Gruet, rgruet@intraware.com for Python 1.5.2
-from V1.3 ref
-1995/10/30, by Chris Hoffmann, choffman@vicorp.com
-
-Based on:
- Python Bestiary, Author: Ken Manheimer, ken.manheimer@nist.gov
- Python manuals, Authors: Guido van Rossum and Fred Drake
- What's new in Python 2.0, Authors: A.M. Kuchling and Moshe Zadka
- python-mode.el, Author: Tim Peters, tim_one@email.msn.com
-
- and the readers of comp.lang.python
-
-Python's nest: http://www.python.org Developement: http://
-python.sourceforge.net/ ActivePython : http://www.ActiveState.com/ASPN/
-Python/
-newsgroup: comp.lang.python Help desk: help@python.org
-Resources: http://starship.python.net/
- http://www.vex.net/parnassus/
- http://aspn.activestate.com/ASPN/Cookbook/Python
-FAQ: http://www.python.org/cgi-bin/faqw.py
-Full documentation: http://www.python.org/doc/
-Excellent reference books:
- Python Essential Reference by David Beazley (New Riders)
- Python Pocket Reference by Mark Lutz (O'Reilly)
-
-
-Invocation Options
-
-python [-diOStuUvxX?] [-c command | script | - ] [args]
-
- Invocation Options
-Option Effect
--c cmd program passed in as string (terminates option list)
--d Outputs parser debugging information (also PYTHONDEBUG=x)
--E ignore environment variables (such as PYTHONPATH)
--h print this help message and exit
--i Inspect interactively after running script (also PYTHONINSPECT=x) and
- force prompts, even if stdin appears not to be a terminal
--m mod run library module as a script (terminates option list
--O optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)
--OO remove doc-strings in addition to the -O optimizations
--Q arg division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew
--S Don't perform 'import site' on initialization
--u Unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x).
--v Verbose (trace import statements) (also PYTHONVERBOSE=x)
--W arg : warning control (arg is action:message:category:module:lineno)
--x Skip first line of source, allowing use of non-unix Forms of #!cmd
--? Help!
--c Specify the command to execute (see next section). This terminates the
-command option list (following options are passed as arguments to the command).
- the name of a python file (.py) to execute read from stdin.
-script Anything afterward is passed as options to python script or command,
- not interpreted as an option to interpreter itself.
-args passed to script or command (in sys.argv[1:])
- If no script or command, Python enters interactive mode.
-
- * Available IDEs in std distrib: IDLE (tkinter based, portable), Pythonwin
- (Windows).
-
-
-
-Environment variables
-
- Environment variables
- Variable Effect
-PYTHONHOME Alternate prefix directory (or prefix;exec_prefix). The
- default module search path uses prefix/lib
- Augments the default search path for module files. The format
- is the same as the shell's $PATH: one or more directory
- pathnames separated by ':' or ';' without spaces around
- (semi-)colons!
-PYTHONPATH On Windows first search for Registry key HKEY_LOCAL_MACHINE\
- Software\Python\PythonCore\x.y\PythonPath (default value). You
- may also define a key named after your application with a
- default string value giving the root directory path of your
- app.
- If this is the name of a readable file, the Python commands in
-PYTHONSTARTUP that file are executed before the first prompt is displayed in
- interactive mode (no default).
-PYTHONDEBUG If non-empty, same as -d option
-PYTHONINSPECT If non-empty, same as -i option
-PYTHONSUPPRESS If non-empty, same as -s option
-PYTHONUNBUFFERED If non-empty, same as -u option
-PYTHONVERBOSE If non-empty, same as -v option
-PYTHONCASEOK If non-empty, ignore case in file/module names (imports)
-
-
-
-
-Notable lexical entities
-
-Keywords
-
- and del for is raise
- assert elif from lambda return
- break else global not try
- class except if or while
- continue exec import pass yield
- def finally in print
-
- * (list of keywords in std module: keyword)
- * Illegitimate Tokens (only valid in strings): @ $ ?
- * A statement must all be on a single line. To break a statement over
- multiple lines use "\", as with the C preprocessor.
- Exception: can always break when inside any (), [], or {} pair, or in
- triple-quoted strings.
- * More than one statement can appear on a line if they are separated with
- semicolons (";").
- * Comments start with "#" and continue to end of line.
-
-Identifiers
-
- (letter | "_") (letter | digit | "_")*
-
- * Python identifiers keywords, attributes, etc. are case-sensitive.
- * Special forms: _ident (not imported by 'from module import *'); __ident__
- (system defined name);
- __ident (class-private name mangling)
-
-Strings
-
- "a string enclosed by double quotes"
- 'another string delimited by single quotes and with a " inside'
- '''a string containing embedded newlines and quote (') marks, can be
- delimited with triple quotes.'''
- """ may also use 3- double quotes as delimiters """
- u'a unicode string' U"Another unicode string"
- r'a raw string where \ are kept (literalized): handy for regular
- expressions and windows paths!'
- R"another raw string" -- raw strings cannot end with a \
- ur'a unicode raw string' UR"another raw unicode"
-
- Use \ at end of line to continue a string on next line.
- adjacent strings are concatened, e.g. 'Monty' ' Python' is the same as
- 'Monty Python'.
- u'hello' + ' world' --> u'hello world' (coerced to unicode)
-
- String Literal Escapes
-
- \newline Ignored (escape newline)
- \\ Backslash (\) \e Escape (ESC) \v Vertical Tab (VT)
- \' Single quote (') \f Formfeed (FF) \OOO char with octal value OOO
- \" Double quote (") \n Linefeed (LF)
- \a Bell (BEL) \r Carriage Return (CR) \xHH char with hex value HH
- \b Backspace (BS) \t Horizontal Tab (TAB)
- \uHHHH unicode char with hex value HHHH, can only be used in unicode string
- \UHHHHHHHH unicode char with hex value HHHHHHHH, can only be used in unicode string
- \AnyOtherChar is left as-is
-
- * NUL byte (\000) is NOT an end-of-string marker; NULs may be embedded in
- strings.
- * Strings (and tuples) are immutable: they cannot be modified.
-
-Numbers
-
- Decimal integer: 1234, 1234567890546378940L (or l)
- Octal integer: 0177, 0177777777777777777 (begin with a 0)
- Hex integer: 0xFF, 0XFFFFffffFFFFFFFFFF (begin with 0x or 0X)
- Long integer (unlimited precision): 1234567890123456
- Float (double precision): 3.14e-10, .001, 10., 1E3
- Complex: 1J, 2+3J, 4+5j (ends with J or j, + separates (float) real and
- imaginary parts)
-
-Sequences
-
- * String of length 0, 1, 2 (see above)
- '', '1', "12", 'hello\n'
- * Tuple of length 0, 1, 2, etc:
- () (1,) (1,2) # parentheses are optional if len > 0
- * List of length 0, 1, 2, etc:
- [] [1] [1,2]
-
-Indexing is 0-based. Negative indices (usually) mean count backwards from end
-of sequence.
-
-Sequence slicing [starting-at-index : but-less-than-index]. Start defaults to
-'0'; End defaults to 'sequence-length'.
-
-a = (0,1,2,3,4,5,6,7)
- a[3] ==> 3
- a[-1] ==> 7
- a[2:4] ==> (2, 3)
- a[1:] ==> (1, 2, 3, 4, 5, 6, 7)
- a[:3] ==> (0, 1, 2)
- a[:] ==> (0,1,2,3,4,5,6,7) # makes a copy of the sequence.
-
-Dictionaries (Mappings)
-
- {} # Zero length empty dictionary
- {1 : 'first'} # Dictionary with one (key, value) pair
- {1 : 'first', 'next': 'second'}
- dict([('one',1),('two',2)]) # Construct a dict from an item list
- dict('one'=1, 'two'=2) # Construct a dict using keyword args
- dict.fromkeys(['one', 'keys']) # Construct a dict from a sequence
-
-Operators and their evaluation order
-
- Operators and their evaluation order
-Highest Operator Comment
- (...) [...] {...} `...` Tuple, list & dict. creation; string
- conv.
- s[i] s[i:j] s.attr f(...) indexing & slicing; attributes, fct
- calls
- +x, -x, ~x Unary operators
- x**y Power
- x*y x/y x%y x//y mult, division, modulo, floor division
- x+y x-y addition, subtraction
- x<<y x>>y Bit shifting
- x&y Bitwise and
- x^y Bitwise exclusive or
- x|y Bitwise or
- x<y x<=y x>y x>=y x==y x!=y Comparison,
- x is y x is not y membership
- x in s x not in s
- not x boolean negation
- x and y boolean and
- x or y boolean or
-Lowest lambda args: expr anonymous function
-
-Alternate names are defined in module operator (e.g. __add__ and add for +)
-Most operators are overridable.
-
-Many binary operators also support augmented assignment:
- x += 1 # Same as x = x + 1
-
-
-Basic Types and Their Operations
-
-Comparisons (defined between *any* types)
-
- Comparisons
-Comparison Meaning Notes
-< strictly less than (1)
-<= less than or equal to
-> strictly greater than
->= greater than or equal to
-== equal to
-!= not equal to
-is object identity (2)
-is not negated object identity (2)
-
-Notes :
- Comparison behavior can be overridden for a given class by defining special
-method __cmp__.
- The above comparisons return True or False which are of type bool
-(a subclass of int) and behave exactly as 1 or 0 except for their type and
-that they print as True or False instead of 1 or 0.
- (1) X < Y < Z < W has expected meaning, unlike C
- (2) Compare object identities (i.e. id(object)), not object values.
-
-Boolean values and operators
-
- Boolean values and operators
- Value or Operator Returns Notes
-None, numeric zeros, empty sequences and False
-mappings
-all other values True
-not x True if x is False, else
- True
-x or y if x is False then y, else (1)
- x
-x and y if x is False then x, else (1)
- y
-
-Notes :
- Truth testing behavior can be overridden for a given class by defining
-special method __bool__.
- (1) Evaluate second arg only if necessary to determine outcome.
-
-None
-
- None is used as default return value on functions. Built-in single object
- with type NoneType.
- Input that evaluates to None does not print when running Python
- interactively.
-
-Numeric types
-
-Floats and integers.
-
- Floats are implemented with C doubles.
- Integers have unlimited size (only limit is system resources)
-
-Operators on all numeric types
-
- Operators on all numeric types
- Operation Result
-abs(x) the absolute value of x
-int(x) x converted to integer
-float(x) x converted to floating point
--x x negated
-+x x unchanged
-x + y the sum of x and y
-x - y difference of x and y
-x * y product of x and y
-x / y quotient of x and y
-x % y remainder of x / y
-divmod(x, y) the tuple (x/y, x%y)
-x ** y x to the power y (the same as pow(x, y))
-
-Bit operators on integers
-
- Bit operators
-Operation >Result
-~x the bits of x inverted
-x ^ y bitwise exclusive or of x and y
-x & y bitwise and of x and y
-x | y bitwise or of x and y
-x << n x shifted left by n bits
-x >> n x shifted right by n bits
-
-Complex Numbers
-
- * represented as a pair of machine-level double precision floating point
- numbers.
- * The real and imaginary value of a complex number z can be retrieved through
- the attributes z.real and z.imag.
-
-Numeric exceptions
-
-TypeError
- raised on application of arithmetic operation to non-number
-OverflowError
- numeric bounds exceeded
-ZeroDivisionError
- raised when zero second argument of div or modulo op
-FloatingPointError
- raised when a floating point operation fails
-
-Operations on all sequence types (lists, tuples, strings)
-
- Operations on all sequence types
-Operation Result Notes
-x in s True if an item of s is equal to x, else False
-x not in s False if an item of s is equal to x, else True
-for x in s: loops over the sequence
-s + t the concatenation of s and t
-s * n, n*s n copies of s concatenated
-s[i] i'th item of s, origin 0 (1)
-s[i:j] slice of s from i (included) to j (excluded) (1), (2)
-len(s) length of s
-min(s) smallest item of s
-max(s) largest item of (s)
-iter(s) returns an iterator over s. iterators define __iter__ and next()
-
-Notes :
- (1) if i or j is negative, the index is relative to the end of the string,
-ie len(s)+ i or len(s)+j is
- substituted. But note that -0 is still 0.
- (2) The slice of s from i to j is defined as the sequence of items with
-index k such that i <= k < j.
- If i or j is greater than len(s), use len(s). If i is omitted, use
-len(s). If i is greater than or
- equal to j, the slice is empty.
-
-Operations on mutable (=modifiable) sequences (lists)
-
- Operations on mutable sequences
- Operation Result Notes
-s[i] =x item i of s is replaced by x
-s[i:j] = t slice of s from i to j is replaced by t
-del s[i:j] same as s[i:j] = []
-s.append(x) same as s[len(s) : len(s)] = [x]
-s.count(x) return number of i's for which s[i] == x
-s.extend(x) same as s[len(s):len(s)]= x
-s.index(x) return smallest i such that s[i] == x (1)
-s.insert(i, x) same as s[i:i] = [x] if i >= 0
-s.pop([i]) same as x = s[i]; del s[i]; return x (4)
-s.remove(x) same as del s[s.index(x)] (1)
-s.reverse() reverse the items of s in place (3)
-s.sort([cmpFct]) sort the items of s in place (2), (3)
-
-Notes :
- (1) raise a ValueError exception when x is not found in s (i.e. out of
-range).
- (2) The sort() method takes an optional argument specifying a comparison
-fct of 2 arguments (list items) which should
- return -1, 0, or 1 depending on whether the 1st argument is
-considered smaller than, equal to, or larger than the 2nd
- argument. Note that this slows the sorting process down considerably.
- (3) The sort() and reverse() methods modify the list in place for economy
-of space when sorting or reversing a large list.
- They don't return the sorted or reversed list to remind you of this
-side effect.
- (4) [New 1.5.2] The optional argument i defaults to -1, so that by default the last
-item is removed and returned.
-
-
-
-Operations on mappings (dictionaries)
-
- Operations on mappings
- Operation Result Notes
-len(d) the number of items in d
-d[k] the item of d with key k (1)
-d[k] = x set d[k] to x
-del d[k] remove d[k] from d (1)
-d.clear() remove all items from d
-d.copy() a shallow copy of d
-d.get(k,defaultval) the item of d with key k (4)
-d.has_key(k) True if d has key k, else False
-d.items() a copy of d's list of (key, item) pairs (2)
-d.iteritems() an iterator over (key, value) pairs (7)
-d.iterkeys() an iterator over the keys of d (7)
-d.itervalues() an iterator over the values of d (7)
-d.keys() a copy of d's list of keys (2)
-d1.update(d2) for k, v in d2.items(): d1[k] = v (3)
-d.values() a copy of d's list of values (2)
-d.pop(k) remove d[k] and return its value
-d.popitem() remove and return an arbitrary (6)
- (key, item) pair
-d.setdefault(k,defaultval) the item of d with key k (5)
-
- Notes :
- TypeError is raised if key is not acceptable
- (1) KeyError is raised if key k is not in the map
- (2) Keys and values are listed in random order
- (3) d2 must be of the same type as d1
- (4) Never raises an exception if k is not in the map, instead it returns
- defaultVal.
- defaultVal is optional, when not provided and k is not in the map,
- None is returned.
- (5) Never raises an exception if k is not in the map, instead it returns
- defaultVal, and adds k to map with value defaultVal. defaultVal is
- optional. When not provided and k is not in the map, None is returned and
- added to map.
- (6) Raises a KeyError if the dictionary is emtpy.
- (7) While iterating over a dictionary, the values may be updated but
- the keys cannot be changed.
-
-Operations on strings
-
-Note that these string methods largely (but not completely) supersede the
-functions available in the string module.
-
-
- Operations on strings
- Operation Result Notes
-s.capitalize() return a copy of s with only its first character
- capitalized.
-s.center(width) return a copy of s centered in a string of length width (1)
- .
-s.count(sub[ return the number of occurrences of substring sub in (2)
-,start[,end]]) string s.
-s.decode(([ return a decoded version of s. (3)
- encoding
- [,errors]])
-s.encode([ return an encoded version of s. Default encoding is the
- encoding current default string encoding. (3)
- [,errors]])
-s.endswith(suffix return true if s ends with the specified suffix, (2)
- [,start[,end]]) otherwise return False.
-s.expandtabs([ return a copy of s where all tab characters are (4)
-tabsize]) expanded using spaces.
-s.find(sub[,start return the lowest index in s where substring sub is (2)
-[,end]]) found. Return -1 if sub is not found.
-s.index(sub[ like find(), but raise ValueError when the substring is (2)
-,start[,end]]) not found.
-s.isalnum() return True if all characters in s are alphanumeric, (5)
- False otherwise.
-s.isalpha() return True if all characters in s are alphabetic, (5)
- False otherwise.
-s.isdigit() return True if all characters in s are digit (5)
- characters, False otherwise.
-s.islower() return True if all characters in s are lowercase, False (6)
- otherwise.
-s.isspace() return True if all characters in s are whitespace (5)
- characters, False otherwise.
-s.istitle() return True if string s is a titlecased string, False (7)
- otherwise.
-s.isupper() return True if all characters in s are uppercase, False (6)
- otherwise.
-s.join(seq) return a concatenation of the strings in the sequence
- seq, separated by 's's.
-s.ljust(width) return s left justified in a string of length width. (1),
- (8)
-s.lower() return a copy of s converted to lowercase.
-s.lstrip() return a copy of s with leading whitespace removed.
-s.replace(old, return a copy of s with all occurrences of substring (9)
-new[, maxsplit]) old replaced by new.
-s.rfind(sub[ return the highest index in s where substring sub is (2)
-,start[,end]]) found. Return -1 if sub is not found.
-s.rindex(sub[ like rfind(), but raise ValueError when the substring (2)
-,start[,end]]) is not found.
-s.rjust(width) return s right justified in a string of length width. (1),
- (8)
-s.rstrip() return a copy of s with trailing whitespace removed.
-s.split([sep[ return a list of the words in s, using sep as the (10)
-,maxsplit]]) delimiter string.
-s.splitlines([ return a list of the lines in s, breaking at line (11)
-keepends]) boundaries.
-s.startswith return true if s starts with the specified prefix,
-(prefix[,start[ otherwise return false. (2)
-,end]])
-s.strip() return a copy of s with leading and trailing whitespace
- removed.
-s.swapcase() return a copy of s with uppercase characters converted
- to lowercase and vice versa.
- return a titlecased copy of s, i.e. words start with
-s.title() uppercase characters, all remaining cased characters
- are lowercase.
-s.translate(table return a copy of s mapped through translation table (12)
-[,deletechars]) table.
-s.upper() return a copy of s converted to uppercase.
-s.zfill(width) return a string padded with zeroes on the left side and
- sliding a minus sign left if necessary. never truncates.
-
-Notes :
- (1) Padding is done using spaces.
- (2) If optional argument start is supplied, substring s[start:] is
-processed. If optional arguments start and end are supplied, substring s[start:
-end] is processed.
- (3) Optional argument errors may be given to set a different error handling
-scheme. The default for errors is 'strict', meaning that encoding errors raise
-a ValueError. Other possible values are 'ignore' and 'replace'.
- (4) If optional argument tabsize is not given, a tab size of 8 characters
-is assumed.
- (5) Returns false if string s does not contain at least one character.
- (6) Returns false if string s does not contain at least one cased
-character.
- (7) A titlecased string is a string in which uppercase characters may only
-follow uncased characters and lowercase characters only cased ones.
- (8) s is returned if width is less than len(s).
- (9) If the optional argument maxsplit is given, only the first maxsplit
-occurrences are replaced.
- (10) If sep is not specified or None, any whitespace string is a separator.
-If maxsplit is given, at most maxsplit splits are done.
- (11) Line breaks are not included in the resulting list unless keepends is
-given and true.
- (12) table must be a string of length 256. All characters occurring in the
-optional argument deletechars are removed prior to translation.
-
-String formatting with the % operator
-
-formatString % args--> evaluates to a string
-
- * formatString uses C printf format codes : %, c, s, i, d, u, o, x, X, e, E,
- f, g, G, r (details below).
- * Width and precision may be a * to specify that an integer argument gives
- the actual width or precision.
- * The flag characters -, +, blank, # and 0 are understood. (details below)
- * %s will convert any type argument to string (uses str() function)
- * args may be a single arg or a tuple of args
-
- '%s has %03d quote types.' % ('Python', 2) # => 'Python has 002 quote types.'
-
- * Right-hand-side can also be a mapping:
-
- a = '%(lang)s has %(c)03d quote types.' % {'c':2, 'lang':'Python}
-(vars() function very handy to use on right-hand-side.)
-
- Format codes
-Conversion Meaning
-d Signed integer decimal.
-i Signed integer decimal.
-o Unsigned octal.
-u Unsigned decimal.
-x Unsigned hexadecimal (lowercase).
-X Unsigned hexadecimal (uppercase).
-e Floating point exponential format (lowercase).
-E Floating point exponential format (uppercase).
-f Floating point decimal format.
-F Floating point decimal format.
-g Same as "e" if exponent is greater than -4 or less than precision,
- "f" otherwise.
-G Same as "E" if exponent is greater than -4 or less than precision,
- "F" otherwise.
-c Single character (accepts integer or single character string).
-r String (converts any python object using repr()).
-s String (converts any python object using str()).
-% No argument is converted, results in a "%" character in the result.
- (The complete specification is %%.)
-
- Conversion flag characters
-Flag Meaning
-# The value conversion will use the ``alternate form''.
-0 The conversion will be zero padded.
-- The converted value is left adjusted (overrides "-").
- (a space) A blank should be left before a positive number (or empty
- string) produced by a signed conversion.
-+ A sign character ("+" or "-") will precede the conversion (overrides a
- "space" flag).
-
-File Objects
-
-Created with built-in function open; may be created by other modules' functions
-as well.
-
-Operators on file objects
-
- File operations
- Operation Result
-f.close() Close file f.
-f.fileno() Get fileno (fd) for file f.
-f.flush() Flush file f's internal buffer.
-f.isatty() True if file f is connected to a tty-like dev, else False.
-f.read([size]) Read at most size bytes from file f and return as a string
- object. If size omitted, read to EOF.
-f.readline() Read one entire line from file f.
-f.readlines() Read until EOF with readline() and return list of lines read.
- Set file f's position, like "stdio's fseek()".
-f.seek(offset[, whence == 0 then use absolute indexing.
-whence=0]) whence == 1 then offset relative to current pos.
- whence == 2 then offset relative to file end.
-f.tell() Return file f's current position (byte offset).
-f.write(str) Write string to file f.
-f.writelines(list Write list of strings to file f.
-)
-
-File Exceptions
-
- EOFError
- End-of-file hit when reading (may be raised many times, e.g. if f is a
- tty).
- IOError
- Other I/O-related I/O operation failure.
- OSError
- OS system call failed.
-
-
- Advanced Types
-
- -See manuals for more details -
- + Module objects
- + Class objects
- + Class instance objects
- + Type objects (see module: types)
- + File objects (see above)
- + Slice objects
- + XRange objects
- + Callable types:
- o User-defined (written in Python):
- # User-defined Function objects
- # User-defined Method objects
- o Built-in (written in C):
- # Built-in Function objects
- # Built-in Method objects
- + Internal Types:
- o Code objects (byte-compile executable Python code: bytecode)
- o Frame objects (execution frames)
- o Traceback objects (stack trace of an exception)
-
-
- Statements
-
- pass -- Null statement
- del name[,name]* -- Unbind name(s) from object. Object will be indirectly
- (and automatically) deleted only if no longer referenced.
- print [>> fileobject,] [s1 [, s2 ]* [,]
- -- Writes to sys.stdout, or to fileobject if supplied.
- Puts spaces between arguments. Puts newline at end
- unless statement ends with comma.
- Print is not required when running interactively,
- simply typing an expression will print its value,
- unless the value is None.
- exec x [in globals [,locals]]
- -- Executes x in namespaces provided. Defaults
- to current namespaces. x can be a string, file
- object or a function object.
- callable(value,... [id=value], [*args], [**kw])
- -- Call function callable with parameters. Parameters can
- be passed by name or be omitted if function
- defines default values. E.g. if callable is defined as
- "def callable(p1=1, p2=2)"
- "callable()" <=> "callable(1, 2)"
- "callable(10)" <=> "callable(10, 2)"
- "callable(p2=99)" <=> "callable(1, 99)"
- *args is a tuple of positional arguments.
- **kw is a dictionary of keyword arguments.
-
- Assignment operators
-
- Caption
- Operator Result Notes
- a = b Basic assignment - assign object b to label a (1)
- a += b Roughly equivalent to a = a + b (2)
- a -= b Roughly equivalent to a = a - b (2)
- a *= b Roughly equivalent to a = a * b (2)
- a /= b Roughly equivalent to a = a / b (2)
- a %= b Roughly equivalent to a = a % b (2)
- a **= b Roughly equivalent to a = a ** b (2)
- a &= b Roughly equivalent to a = a & b (2)
- a |= b Roughly equivalent to a = a | b (2)
- a ^= b Roughly equivalent to a = a ^ b (2)
- a >>= b Roughly equivalent to a = a >> b (2)
- a <<= b Roughly equivalent to a = a << b (2)
-
- Notes :
- (1) Can unpack tuples, lists, and strings.
- first, second = a[0:2]; [f, s] = range(2); c1,c2,c3='abc'
- Tip: x,y = y,x swaps x and y.
- (2) Not exactly equivalent - a is evaluated only once. Also, where
- possible, operation performed in-place - a is modified rather than
- replaced.
-
- Control Flow
-
- if condition: suite
- [elif condition: suite]*
- [else: suite] -- usual if/else_if/else statement
- while condition: suite
- [else: suite]
- -- usual while statement. "else" suite is executed
- after loop exits, unless the loop is exited with
- "break"
- for element in sequence: suite
- [else: suite]
- -- iterates over sequence, assigning each element to element.
- Use built-in range function to iterate a number of times.
- "else" suite executed at end unless loop exited
- with "break"
- break -- immediately exits "for" or "while" loop
- continue -- immediately does next iteration of "for" or "while" loop
- return [result] -- Exits from function (or method) and returns result (use a tuple to
- return more than one value). If no result given, then returns None.
- yield result -- Freezes the execution frame of a generator and returns the result
- to the iterator's .__next__() method. Upon the next call to __next__(),
- resumes execution at the frozen point with all of the local variables
- still intact.
-
- Exception Statements
-
- assert expr[, message]
- -- expr is evaluated. if false, raises exception AssertionError
- with message. Inhibited if __debug__ is 0.
- try: suite1
- [except [exception [, value]: suite2]+
- [else: suite3]
- -- statements in suite1 are executed. If an exception occurs, look
- in "except" clauses for matching <exception>. If matches or bare
- "except" execute suite of that clause. If no exception happens
- suite in "else" clause is executed after suite1.
- If exception has a value, it is put in value.
- exception can also be tuple of exceptions, e.g.
- "except (KeyError, NameError), val: print val"
- try: suite1
- finally: suite2
- -- statements in suite1 are executed. If no
- exception, execute suite2 (even if suite1 is
- exited with a "return", "break" or "continue"
- statement). If exception did occur, executes
- suite2 and then immediately reraises exception.
- raise exception [,value [, traceback]]
- -- raises exception with optional value
- value. Arg traceback specifies a traceback object to
- use when printing the exception's backtrace.
- raise -- a raise statement without arguments re-raises
- the last exception raised in the current function
-An exception is either a string (object) or a class instance.
- Can create a new one simply by creating a new string:
-
- my_exception = 'You did something wrong'
- try:
- if bad:
- raise my_exception, bad
- except my_exception, value:
- print 'Oops', value
-
-Exception classes must be derived from the predefined class: Exception, e.g.:
- class text_exception(Exception): pass
- try:
- if bad:
- raise text_exception()
- # This is a shorthand for the form
- # "raise <class>, <instance>"
- except Exception:
- print 'Oops'
- # This will be printed because
- # text_exception is a subclass of Exception
-When an error message is printed for an unhandled exception which is a
-class, the class name is printed, then a colon and a space, and
-finally the instance converted to a string using the built-in function
-str().
-All built-in exception classes derives from Exception, itself
-derived from BaseException.
-
-Name Space Statements
-
-[1.51: On Mac & Windows, the case of module file names must now match the case
-as used
- in the import statement]
-Packages (>1.5): a package is a name space which maps to a directory including
- module(s) and the special initialization module '__init__.py'
- (possibly empty). Packages/dirs can be nested. You address a
- module's symbol via '[package.[package...]module.symbol's.
-import module1 [as name1] [, module2]*
- -- imports modules. Members of module must be
- referred to by qualifying with [package.]module name:
- "import sys; print sys.argv:"
- "import package1.subpackage.module; package1.subpackage.module.foo()"
- module1 renamed as name1, if supplied.
-from module import name1 [as othername1] [, name2]*
- -- imports names from module module in current namespace.
- "from sys import argv; print argv"
- "from package1 import module; module.foo()"
- "from package1.module import foo; foo()"
- name1 renamed as othername1, if supplied.
-from module import *
- -- imports all names in module, except those starting with "_";
- *to be used sparsely, beware of name clashes* :
- "from sys import *; print argv"
- "from package.module import *; print x'
- NB: "from package import *" only imports the symbols defined
- in the package's __init__.py file, not those in the
- template modules!
-global name1 [, name2]*
- -- names are from global scope (usually meaning from module)
- rather than local (usually meaning only in function).
- -- E.g. in fct without "global" statements, assuming
- "a" is name that hasn't been used in fct or module
- so far:
- -Try to read from "a" -> NameError
- -Try to write to "a" -> creates "a" local to fcn
- -If "a" not defined in fct, but is in module, then
- -Try to read from "a", gets value from module
- -Try to write to "a", creates "a" local to fct
- But note "a[0]=3" starts with search for "a",
- will use to global "a" if no local "a".
-
-Function Definition
-
-def func_id ([param_list]): suite
- -- Creates a function object & binds it to name func_id.
-
- param_list ::= [id [, id]*]
- id ::= value | id = value | *id | **id
- [Args are passed by value.Thus only args representing a mutable object
- can be modified (are inout parameters). Use a tuple to return more than
- one value]
-
-Example:
- def test (p1, p2 = 1+1, *rest, **keywords):
- -- Parameters with "=" have default value (v is
- evaluated when function defined).
- If list has "*id" then id is assigned a tuple of
- all remaining args passed to function (like C vararg)
- If list has "**id" then id is assigned a dictionary of
- all extra arguments passed as keywords.
-
-Class Definition
-
-class <class_id> [(<super_class1> [,<super_class2>]*)]: <suite>
- -- Creates a class object and assigns it name <class_id>
- <suite> may contain local "defs" of class methods and
- assignments to class attributes.
-Example:
- class my_class (class1, class_list[3]): ...
- Creates a class object inheriting from both "class1" and whatever
- class object "class_list[3]" evaluates to. Assigns new
- class object to name "my_class".
- - First arg to class methods is always instance object, called 'self'
- by convention.
- - Special method __init__() is called when instance is created.
- - Special method __del__() called when no more reference to object.
- - Create instance by "calling" class object, possibly with arg
- (thus instance=apply(aClassObject, args...) creates an instance!)
- - In current implementation, can't subclass off built-in
- classes. But can "wrap" them, see UserDict & UserList modules,
- and see __getattr__() below.
-Example:
- class c (c_parent):
- def __init__(self, name): self.name = name
- def print_name(self): print "I'm", self.name
- def call_parent(self): c_parent.print_name(self)
- instance = c('tom')
- print instance.name
- 'tom'
- instance.print_name()
- "I'm tom"
- Call parent's super class by accessing parent's method
- directly and passing "self" explicitly (see "call_parent"
- in example above).
- Many other special methods available for implementing
- arithmetic operators, sequence, mapping indexing, etc.
-
-Documentation Strings
-
-Modules, classes and functions may be documented by placing a string literal by
-itself as the first statement in the suite. The documentation can be retrieved
-by getting the '__doc__' attribute from the module, class or function.
-Example:
- class C:
- "A description of C"
- def __init__(self):
- "A description of the constructor"
- # etc.
-Then c.__doc__ == "A description of C".
-Then c.__init__.__doc__ == "A description of the constructor".
-
-Others
-
-lambda [param_list]: returnedExpr
- -- Creates an anonymous function. returnedExpr must be
- an expression, not a statement (e.g., not "if xx:...",
- "print xxx", etc.) and thus can't contain newlines.
- Used mostly for filter(), map() functions, and GUI callbacks..
-List comprehensions
-result = [expression for item1 in sequence1 [if condition1]
- [for item2 in sequence2 ... for itemN in sequenceN]
- ]
-is equivalent to:
-result = []
-for item1 in sequence1:
- for item2 in sequence2:
- ...
- for itemN in sequenceN:
- if (condition1) and furthur conditions:
- result.append(expression)
-
-
-
-Built-In Functions
-
- Built-In Functions
- Function Result
-__import__(name[, Imports module within the given context (see lib ref for
-globals[, locals[, more details)
-fromlist]]])
-abs(x) Return the absolute value of number x.
-bool(x) Returns True when the argument x is true and False otherwise.
-buffer(obj) Creates a buffer reference to an object.
-chr(i) Returns one-character string whose ASCII code isinteger i
-classmethod(f) Converts a function f, into a method with the class as the
- first argument. Useful for creating alternative constructors.
-cmp(x,y) Returns negative, 0, positive if x <, ==, > to y
-compile(string, from which the code was read, or eg. '<string>'if not read
-filename, kind) from file.kind can be 'eval' if string is a single stmt, or
- 'single' which prints the output of expression statements
- that evaluate to something else than None, or be 'exec'.
-complex(real[, Builds a complex object (can also be done using J or j
-image]) suffix,e.g. 1+3J)
-delattr(obj, name) deletes attribute named name of object obj <=> del obj.name
- If no args, returns the list of names in current
-dict([items]) Create a new dictionary from the specified item list.
-dir([object]) local symbol table. With a module, class or class
- instance object as arg, returns list of names in its attr.
- dict.
-divmod(a,b) Returns tuple of (a/b, a%b)
-enumerate(seq) Return a iterator giving: (0, seq[0]), (1, seq[1]), ...
-eval(s[, globals[, Eval string s in (optional) globals, locals contexts.s must
-locals]]) have no NUL's or newlines. s can also be acode object.
- Example: x = 1; incr_x = eval('x + 1')
-filter(function, Constructs a list from those elements of sequence for which
-sequence) function returns true. function takes one parameter.
-float(x) Converts a number or a string to floating point.
-getattr(object, [<default> arg added in 1.5.2]Gets attribute called name
-name[, default])) from object,e.g. getattr(x, 'f') <=> x.f). If not found,
- raises AttributeError or returns default if specified.
-globals() Returns a dictionary containing current global variables.
-hasattr(object, Returns true if object has attr called name.
-name)
-hash(object) Returns the hash value of the object (if it has one)
-help(f) Display documentation on object f.
-hex(x) Converts a number x to a hexadecimal string.
-id(object) Returns a unique 'identity' integer for an object.
-int(x[, base]) base paramenter specifies base from which to convert string
- values.
-isinstance(obj, Returns true if obj is an instance of class. Ifissubclass
-class) (A,B) then isinstance(x,A) => isinstance(x,B)
-issubclass(class1, returns true if class1 is derived from class2
-class2)
- Returns the length (the number of items) of an object
-iter(collection) Returns an iterator over the collection.
-len(obj) (sequence, dictionary, or instance of class implementing
- __len__).
-list(sequence) Converts sequence into a list. If already a list,returns a
- copy of it.
-locals() Returns a dictionary containing current local variables.
- Applies function to every item of list and returns a listof
-map(function, list, the results. If additional arguments are passed,function
-...) must take that many arguments and it is givento function on
- each call.
-max(seq) Returns the largest item of the non-empty sequence seq.
-min(seq) Returns the smallest item of a non-empty sequence seq.
-oct(x) Converts a number to an octal string.
-open(filename [, Returns a new file object. First two args are same asthose
-mode='r', [bufsize= for C's "stdio open" function. bufsize is 0for unbuffered,
-implementation 1 for line-buffered, negative forsys-default, all else, of
-dependent]]) (about) given size.
-ord(c) Returns integer ASCII value of c (a string of len 1). Works
- with Unicode char.
-object() Create a base type. Used as a superclass for new-style objects.
-open(name Open a file.
- [, mode
- [, buffering]])
-pow(x, y [, z]) Returns x to power y [modulo z]. See also ** operator.
-property() Created a property with access controlled by functions.
-range(start [,end Returns list of ints from >= start and < end. With 1 arg,
-[, step]]) list from 0..arg-1. With 2 args, list from start..end-1.
- With 3 args, list from start up to end by step
- after fixing it.
-repr(object) Returns a string containing a printable and if possible
- evaluable representation of an object.
- Class redefinable (__repr__). See also str().
-round(x, n=0) Returns the floating point value x rounded to n digitsafter
- the decimal point.
-setattr(object, This is the counterpart of getattr(). setattr(o, 'foobar',
-name, value) 3) <=> o.foobar = 3. Creates attribute if it doesn't exist!
-slice([start,] stop Returns a slice object representing a range, with R/
-[, step]) O attributes: start, stop, step.
-staticmethod() Convert a function to method with no self or class
- argument. Useful for methods associated with a class that
- do not need access to an object's internal state.
-str(object) Returns a string containing a nicely
- printable representation of an object. Class overridable
- (__str__).See also repr().
-super(type) Create an unbound super object. Used to call cooperative
- superclass methods.
-sum(sequence, Add the values in the sequence and return the sum.
- [start])
-tuple(sequence) Creates a tuple with same elements as sequence. If already
- a tuple, return itself (not a copy).
- Returns a type object [see module types] representing
- thetype of obj. Example: import typesif type(x) ==
-type(obj) types.StringType: print 'It is a string'NB: it is
- recommanded to use the following form:if isinstance(x,
- types.StringType): etc...
-unichr(code) code.
-unicode(string[, Creates a Unicode string from a 8-bit string, using
-encoding[, error thegiven encoding name and error treatment ('strict',
-]]]) 'ignore',or 'replace'}.
- Without arguments, returns a dictionary correspondingto the
- current local symbol table. With a module,class or class
-vars([object]) instance object as argumentreturns a dictionary
- corresponding to the object'ssymbol table. Useful with "%"
- formatting operator.
-zip(seq1[, seq2, Returns an iterator of tuples where each tuple contains
-...]) the nth element of each of the argument sequences.
-
-
-
-Built-In Exceptions
-
-Exception>
- Root class for all exceptions
- SystemExit
- On 'sys.exit()'
- StopIteration
- Signal the end from iterator.__next__()
- ArithmeticError
- Base class for OverflowError, ZeroDivisionError,
- FloatingPointError
- FloatingPointError
- When a floating point operation fails.
- OverflowError
- On excessively large arithmetic operation
- ZeroDivisionError
- On division or modulo operation with 0 as 2nd arg
- AssertionError
- When an assert statement fails.
- AttributeError
- On attribute reference or assignment failure
- EnvironmentError [new in 1.5.2]
- On error outside Python; error arg tuple is (errno, errMsg...)
- IOError [changed in 1.5.2]
- I/O-related operation failure
- OSError [new in 1.5.2]
- used by the os module's os.error exception.
- EOFError
- Immediate end-of-file hit by input() or raw_input()
- ImportError
- On failure of `import' to find module or name
- KeyboardInterrupt
- On user entry of the interrupt key (often `Control-C')
- LookupError
- base class for IndexError, KeyError
- IndexError
- On out-of-range sequence subscript
- KeyError
- On reference to a non-existent mapping (dict) key
- MemoryError
- On recoverable memory exhaustion
- NameError
- On failure to find a local or global (unqualified) name
- RuntimeError
- Obsolete catch-all; define a suitable error instead
- NotImplementedError [new in 1.5.2]
- On method not implemented
- SyntaxError
- On parser encountering a syntax error
- IndentationError
- On parser encountering an indentation syntax error
- TabError
- On parser encountering an indentation syntax error
- SystemError
- On non-fatal interpreter error - bug - report it
- TypeError
- On passing inappropriate type to built-in op or func
- ValueError
- On arg error not covered by TypeError or more precise
- Warning
- UserWarning
- DeprecationWarning
- PendingDeprecationWarning
- SyntaxWarning
- RuntimeWarning
- FutureWarning
-
-
-
-Standard methods & operators redefinition in classes
-
-Standard methods & operators map to special '__methods__' and thus may be
- redefined (mostly in user-defined classes), e.g.:
- class x:
- def __init__(self, v): self.value = v
- def __add__(self, r): return self.value + r
- a = x(3) # sort of like calling x.__init__(a, 3)
- a + 4 # is equivalent to a.__add__(4)
-
-Special methods for any class
-
-(s: self, o: other)
- __init__(s, args) instance initialization (on construction)
- __del__(s) called on object demise (refcount becomes 0)
- __repr__(s) repr() and `...` conversions
- __str__(s) str() and 'print' statement
- __cmp__(s, o) Compares s to o and returns <0, 0, or >0.
- Implements >, <, == etc...
- __hash__(s) Compute a 32 bit hash code; hash() and dictionary ops
- __bool__(s) Returns False or True for truth value testing
- __getattr__(s, name) called when attr lookup doesn't find <name>
- __setattr__(s, name, val) called when setting an attr
- (inside, don't use "self.name = value"
- use "self.__dict__[name] = val")
- __delattr__(s, name) called to delete attr <name>
- __call__(self, *args) called when an instance is called as function.
-
-Operators
-
- See list in the operator module. Operator function names are provided with
- 2 variants, with or without
- ading & trailing '__' (eg. __add__ or add).
-
- Numeric operations special methods
- (s: self, o: other)
-
- s+o = __add__(s,o) s-o = __sub__(s,o)
- s*o = __mul__(s,o) s/o = __div__(s,o)
- s%o = __mod__(s,o) divmod(s,o) = __divmod__(s,o)
- s**o = __pow__(s,o)
- s&o = __and__(s,o)
- s^o = __xor__(s,o) s|o = __or__(s,o)
- s<<o = __lshift__(s,o) s>>o = __rshift__(s,o)
- bool(s) = __bool__(s) (used in boolean testing)
- -s = __neg__(s) +s = __pos__(s)
- abs(s) = __abs__(s) ~s = __invert__(s) (bitwise)
- s+=o = __iadd__(s,o) s-=o = __isub__(s,o)
- s*=o = __imul__(s,o) s/=o = __idiv__(s,o)
- s%=o = __imod__(s,o)
- s**=o = __ipow__(s,o)
- s&=o = __iand__(s,o)
- s^=o = __ixor__(s,o) s|=o = __ior__(s,o)
- s<<=o = __ilshift__(s,o) s>>=o = __irshift__(s,o)
- Conversions
- int(s) = __int__(s)
- float(s) = __float__(s) complex(s) = __complex__(s)
- oct(s) = __oct__(s) hex(s) = __hex__(s)
- Right-hand-side equivalents for all binary operators exist;
- are called when class instance is on r-h-s of operator:
- a + 3 calls __add__(a, 3)
- 3 + a calls __radd__(a, 3)
-
- All seqs and maps, general operations plus:
- (s: self, i: index or key)
-
- len(s) = __len__(s) length of object, >= 0. Length 0 == false
- s[i] = __getitem__(s,i) Element at index/key i, origin 0
-
- Sequences, general methods, plus:
- s[i]=v = __setitem__(s,i,v)
- del s[i] = __delitem__(s,i)
- s[i:j] = __getslice__(s,i,j)
- s[i:j]=seq = __setslice__(s,i,j,seq)
- del s[i:j] = __delslice__(s,i,j) == s[i:j] = []
- seq * n = __repeat__(seq, n)
- s1 + s2 = __concat__(s1, s2)
- i in s = __contains__(s, i)
- Mappings, general methods, plus
- hash(s) = __hash__(s) - hash value for dictionary references
- s[k]=v = __setitem__(s,k,v)
- del s[k] = __delitem__(s,k)
-
-Special informative state attributes for some types:
-
- Modules:
- __doc__ (string/None, R/O): doc string (<=> __dict__['__doc__'])
- __name__(string, R/O): module name (also in __dict__['__name__'])
- __dict__ (dict, R/O): module's name space
- __file__(string/undefined, R/O): pathname of .pyc, .pyo or .pyd (undef for
- modules statically linked to the interpreter)
-
- Classes: [in bold: writable since 1.5.2]
- __doc__ (string/None, R/W): doc string (<=> __dict__['__doc__'])
- __module__ is the module name in which the class was defined
- __name__(string, R/W): class name (also in __dict__['__name__'])
- __bases__ (tuple, R/W): parent classes
- __dict__ (dict, R/W): attributes (class name space)
-
- Instances:
- __class__ (class, R/W): instance's class
- __dict__ (dict, R/W): attributes
-
- User-defined functions: [bold: writable since 1.5.2]
- __doc__ (string/None, R/W): doc string
- __name__(string, R/O): function name
- func_doc (R/W): same as __doc__
- func_name (R/O): same as __name__
- func_defaults (tuple/None, R/W): default args values if any
- func_code (code, R/W): code object representing the compiled function body
- func_globals (dict, R/O): ref to dictionary of func global variables
- func_dict (dict, R/W): same as __dict__ contains the namespace supporting
- arbitrary function attributes
- func_closure (R/O): None or a tuple of cells that contain bindings
- for the function's free variables.
-
-
- User-defined Methods:
- __doc__ (string/None, R/O): doc string
- __name__(string, R/O): method name (same as im_func.__name__)
- im_class (class, R/O): class defining the method (may be a base class)
- im_self (instance/None, R/O): target instance object (None if unbound)
- im_func (function, R/O): function object
-
- Built-in Functions & methods:
- __doc__ (string/None, R/O): doc string
- __name__ (string, R/O): function name
- __self__ : [methods only] target object
-
- Codes:
- co_name (string, R/O): function name
- co_argcount (int, R/0): number of positional args
- co_nlocals (int, R/O): number of local vars (including args)
- co_varnames (tuple, R/O): names of local vars (starting with args)
- co_cellvars (tuple, R/O)) the names of local variables referenced by
- nested functions
- co_freevars (tuple, R/O)) names of free variables
- co_code (string, R/O): sequence of bytecode instructions
- co_consts (tuple, R/O): litterals used by the bytecode, 1st one is
- fct doc (or None)
- co_names (tuple, R/O): names used by the bytecode
- co_filename (string, R/O): filename from which the code was compiled
- co_firstlineno (int, R/O): first line number of the function
- co_lnotab (string, R/O): string encoding bytecode offsets to line numbers.
- co_stacksize (int, R/O): required stack size (including local vars)
- co_flags (int, R/O): flags for the interpreter
- bit 2 set if fct uses "*arg" syntax
- bit 3 set if fct uses '**keywords' syntax
- Frames:
- f_back (frame/None, R/O): previous stack frame (toward the caller)
- f_code (code, R/O): code object being executed in this frame
- f_locals (dict, R/O): local vars
- f_globals (dict, R/O): global vars
- f_builtins (dict, R/O): built-in (intrinsic) names
- f_restricted (int, R/O): flag indicating whether fct is executed in
- restricted mode
- f_lineno (int, R/O): current line number
- f_lasti (int, R/O): precise instruction (index into bytecode)
- f_trace (function/None, R/W): debug hook called at start of each source line
- Tracebacks:
- tb_next (frame/None, R/O): next level in stack trace (toward the frame where
- the exception occurred)
- tb_frame (frame, R/O): execution frame of the current level
- tb_lineno (int, R/O): line number where the exception occurred
- tb_lasti (int, R/O): precise instruction (index into bytecode)
-
- Slices:
- start (any/None, R/O): lowerbound
- stop (any/None, R/O): upperbound
- step (any/None, R/O): step value
-
- Complex numbers:
- real (float, R/O): real part
- imag (float, R/O): imaginary part
-
-
-Important Modules
-
- sys
-
- Some sys variables
- Variable Content
-argv The list of command line arguments passed to aPython
- script. sys.argv[0] is the script name.
-builtin_module_names A list of strings giving the names of all moduleswritten
- in C that are linked into this interpreter.
-check_interval How often to check for thread switches or signals(measured
- in number of virtual machine instructions)
-last_type, Set only when an exception not handled andinterpreter
-last_value, prints an error. Used by debuggers.
-last_traceback
-maxint maximum positive value for integers
-modules Dictionary of modules that have already been loaded.
-path Search path for external modules. Can be modifiedby
- program. sys.path[0] == dir of script executing
-platform The current platform, e.g. "sunos5", "win32"
-ps1, ps2 prompts to use in interactive mode.
- File objects used for I/O. One can redirect byassigning a
-stdin, stdout, new file object to them (or any object:.with a method
-stderr write(string) for stdout/stderr,.with a method readline()
- for stdin)
-version string containing version info about Python interpreter.
- (and also: copyright, dllhandle, exec_prefix, prefix)
-version_info tuple containing Python version info - (major, minor,
- micro, level, serial).
-
- Some sys functions
- Function Result
-exit(n) Exits with status n. Raises SystemExit exception.(Hence can
- be caught and ignored by program)
-getrefcount(object Returns the reference count of the object. Generally one
-) higher than you might expect, because of object arg temp
- reference.
-setcheckinterval( Sets the interpreter's thread switching interval (in number
-interval) of virtual code instructions, default:100).
-settrace(func) Sets a trace function: called before each line ofcode is
- exited.
-setprofile(func) Sets a profile function for performance profiling.
- Info on exception currently being handled; this is atuple
- (exc_type, exc_value, exc_traceback).Warning: assigning the
-exc_info() traceback return value to a local variable in a
- function handling an exception will cause a circular
- reference.
-setdefaultencoding Change default Unicode encoding - defaults to 7-bit ASCII.
-(encoding)
-getrecursionlimit Retrieve maximum recursion depth.
-()
-setrecursionlimit Set maximum recursion depth. (Defaults to 1000.)
-()
-
-
-
- os
-"synonym" for whatever O/S-specific module is proper for current environment.
-this module uses posix whenever possible.
-(see also M.A. Lemburg's utility http://www.lemburg.com/files/python/
-platform.py)
-
- Some os variables
- Variable Meaning
-name name of O/S-specific module (e.g. "posix", "mac", "nt")
-path O/S-specific module for path manipulations.
- On Unix, os.path.split() <=> posixpath.split()
-curdir string used to represent current directory ('.')
-pardir string used to represent parent directory ('..')
-sep string used to separate directories ('/' or '\'). Tip: use
- os.path.join() to build portable paths.
-altsep Alternate sep
-if applicable (None
-otherwise)
-pathsep character used to separate search path components (as in
- $PATH), eg. ';' for windows.
-linesep line separator as used in binary files, ie '\n' on Unix, '\
- r\n' on Dos/Win, '\r'
-
- Some os functions
- Function Result
-makedirs(path[, Recursive directory creation (create required intermediary
-mode=0777]) dirs); os.error if fails.
-removedirs(path) Recursive directory delete (delete intermediary empty
- dirs); if fails.
-renames(old, new) Recursive directory or file renaming; os.error if fails.
-
-
-
- posix
-don't import this module directly, import os instead !
-(see also module: shutil for file copy & remove fcts)
-
- posix Variables
-Variable Meaning
-environ dictionary of environment variables, e.g.posix.environ['HOME'].
-error exception raised on POSIX-related error.
- Corresponding value is tuple of errno code and perror() string.
-
- Some posix functions
- Function Result
-chdir(path) Changes current directory to path.
-chmod(path, Changes the mode of path to the numeric mode
-mode)
-close(fd) Closes file descriptor fd opened with posix.open.
-_exit(n) Immediate exit, with no cleanups, no SystemExit,etc. Should use
- this to exit a child process.
-execv(p, args) "Become" executable p with args args
-getcwd() Returns a string representing the current working directory
-getpid() Returns the current process id
-fork() Like C's fork(). Returns 0 to child, child pid to parent.[Not
- on Windows]
-kill(pid, Like C's kill [Not on Windows]
-signal)
-listdir(path) Lists (base)names of entries in directory path, excluding '.'
- and '..'
-lseek(fd, pos, Sets current position in file fd to position pos, expressedas
-how) an offset relative to beginning of file (how=0), tocurrent
- position (how=1), or to end of file (how=2)
-mkdir(path[, Creates a directory named path with numeric mode (default 0777)
-mode])
-open(file, Like C's open(). Returns file descriptor. Use file object
-flags, mode) fctsrather than this low level ones.
-pipe() Creates a pipe. Returns pair of file descriptors (r, w) [Not on
- Windows].
-popen(command, Opens a pipe to or from command. Result is a file object to
-mode='r', read to orwrite from, as indicated by mode being 'r' or 'w'.
-bufSize=0) Use it to catch acommand output ('r' mode) or to feed it ('w'
- mode).
-remove(path) See unlink.
-rename(src, dst Renames/moves the file or directory src to dst. [error iftarget
-) name already exists]
-rmdir(path) Removes the empty directory path
-read(fd, n) Reads n bytes from file descriptor fd and return as string.
- Returns st_mode, st_ino, st_dev, st_nlink, st_uid,st_gid,
-stat(path) st_size, st_atime, st_mtime, st_ctime.[st_ino, st_uid, st_gid
- are dummy on Windows]
-system(command) Executes string command in a subshell. Returns exitstatus of
- subshell (usually 0 means OK).
- Returns accumulated CPU times in sec (user, system, children's
-times() user,children's sys, elapsed real time). [3 last not on
- Windows]
-unlink(path) Unlinks ("deletes") the file (not dir!) path. same as: remove
-utime(path, ( Sets the access & modified time of the file to the given tuple
-aTime, mTime)) of values.
-wait() Waits for child process completion. Returns tuple ofpid,
- exit_status [Not on Windows]
-waitpid(pid, Waits for process pid to complete. Returns tuple ofpid,
-options) exit_status [Not on Windows]
-write(fd, str) Writes str to file fd. Returns nb of bytes written.
-
-
-
- posixpath
-Do not import this module directly, import os instead and refer to this module
-as os.path. (e.g. os.path.exists(p)) !
-
- Some posixpath functions
- Function Result
-abspath(p) Returns absolute path for path p, taking current working dir in
- account.
-dirname/
-basename(p directory and name parts of the path p. See also split.
-)
-exists(p) True if string p is an existing path (file or directory)
-expanduser Returns string that is (a copy of) p with "~" expansion done.
-(p)
-expandvars Returns string that is (a copy of) p with environment vars expanded.
-(p) [Windows: case significant; must use Unix: $var notation, not %var%]
-getsize( return the size in bytes of filename. raise os.error.
-filename)
-getmtime( return last modification time of filename (integer nb of seconds
-filename) since epoch).
-getatime( return last access time of filename (integer nb of seconds since
-filename) epoch).
-isabs(p) True if string p is an absolute path.
-isdir(p) True if string p is a directory.
-islink(p) True if string p is a symbolic link.
-ismount(p) True if string p is a mount point [true for all dirs on Windows].
-join(p[,q Joins one or more path components intelligently.
-[,...]])
- Splits p into (head, tail) where tail is lastpathname component and
-split(p) <head> is everything leadingup to that. <=> (dirname(p), basename
- (p))
-splitdrive Splits path p in a pair ('drive:', tail) [Windows]
-(p)
-splitext(p Splits into (root, ext) where last comp of root contains no periods
-) and ext is empty or startswith a period.
- Calls the function visit with arguments(arg, dirname, names) for
- each directory recursively inthe directory tree rooted at p
-walk(p, (including p itself if it's a dir)The argument dirname specifies the
-visit, arg visited directory, the argumentnames lists the files in the
-) directory. The visit function maymodify names to influence the set
- of directories visited belowdirname, e.g., to avoid visiting certain
- parts of the tree.
-
-
-
- shutil
-high-level file operations (copying, deleting).
-
- Main shutil functions
- Function Result
-copy(src, dst) Copies the contents of file src to file dst, retaining file
- permissions.
-copytree(src, dst Recursively copies an entire directory tree rooted at src
-[, symlinks]) into dst (which should not already exist). If symlinks is
- true, links insrc are kept as such in dst.
-rmtree(path[, Deletes an entire directory tree, ignoring errors if
-ignore_errors[, ignore_errors true,or calling onerror(func, path,
-onerror]]) sys.exc_info()) if supplied with
-
-(and also: copyfile, copymode, copystat, copy2)
-
-time
-
- Variables
-Variable Meaning
-altzone signed offset of local DST timezone in sec west of the 0th meridian.
-daylight nonzero if a DST timezone is specified
-
- Functions
- Function Result
-time() return a float representing UTC time in seconds since the epoch.
-gmtime(secs), return a tuple representing time : (year aaaa, month(1-12),day
-localtime( (1-31), hour(0-23), minute(0-59), second(0-59), weekday(0-6, 0 is
-secs) monday), Julian day(1-366), daylight flag(-1,0 or 1))
-asctime(
-timeTuple),
-strftime(
-format, return a formatted string representing time.
-timeTuple)
-mktime(tuple) inverse of localtime(). Return a float.
-strptime( parse a formatted string representing time, return tuple as in
-string[, gmtime().
-format])
-sleep(secs) Suspend execution for <secs> seconds. <secs> can be a float.
-
-and also: clock, ctime.
-
- string
-
-As of Python 2.0, much (though not all) of the functionality provided by the
-string module have been superseded by built-in string methods - see Operations
-on strings for details.
-
- Some string variables
- Variable Meaning
-digits The string '0123456789'
-hexdigits, octdigits legal hexadecimal & octal digits
-letters, uppercase, lowercase, Strings containing the appropriate
-whitespace characters
-index_error Exception raised by index() if substr not
- found.
-
- Some string functions
- Function Result
-expandtabs(s, returns a copy of string <s> with tabs expanded.
-tabSize)
-find/rfind(s, sub Return the lowest/highest index in <s> where the substring
-[, start=0[, end= <sub> is found such that <sub> is wholly contained ins
-0]) [start:end]. Return -1 if <sub> not found.
-ljust/rjust/center Return a copy of string <s> left/right justified/centerd in
-(s, width) afield of given width, padded with spaces. <s> is
- nevertruncated.
-lower/upper(s) Return a string that is (a copy of) <s> in lowercase/
- uppercase
-split(s[, sep= Return a list containing the words of the string <s>,using
-whitespace[, the string <sep> as a separator.
-maxsplit=0]])
-join(words[, sep=' Concatenate a list or tuple of words with
-']) interveningseparators; inverse of split.
-replace(s, old, Returns a copy of string <s> with all occurrences of
-new[, maxsplit=0] substring<old> replaced by <new>. Limits to <maxsplit>
- firstsubstitutions if specified.
-strip(s) Return a string that is (a copy of) <s> without leadingand
- trailing whitespace. see also lstrip, rstrip.
-
-
-
- re (sre)
-
-Handles Unicode strings. Implemented in new module sre, re now a mere front-end
-for compatibility.
-Patterns are specified as strings. Tip: Use raw strings (e.g. r'\w*') to
-litteralize backslashes.
-
-
- Regular expression syntax
- Form Description
-. matches any character (including newline if DOTALL flag specified)
-^ matches start of the string (of every line in MULTILINE mode)
-$ matches end of the string (of every line in MULTILINE mode)
-* 0 or more of preceding regular expression (as many as possible)
-+ 1 or more of preceding regular expression (as many as possible)
-? 0 or 1 occurrence of preceding regular expression
-*?, +?, ?? Same as *, + and ? but matches as few characters as possible
-{m,n} matches from m to n repetitions of preceding RE
-{m,n}? idem, attempting to match as few repetitions as possible
-[ ] defines character set: e.g. '[a-zA-Z]' to match all letters(see also
- \w \S)
-[^ ] defines complemented character set: matches if char is NOT in set
- escapes special chars '*?+&$|()' and introduces special sequences
-\ (see below). Due to Python string rules, write as '\\' orr'\' in the
- pattern string.
-\\ matches a litteral '\'; due to Python string rules, write as '\\\\
- 'in pattern string, or better using raw string: r'\\'.
-| specifies alternative: 'foo|bar' matches 'foo' or 'bar'
-(...) matches any RE inside (), and delimits a group.
-(?:...) idem but doesn't delimit a group.
- matches if ... matches next, but doesn't consume any of the string
-(?=...) e.g. 'Isaac (?=Asimov)' matches 'Isaac' only if followed by
- 'Asimov'.
-(?!...) matches if ... doesn't match next. Negative of (?=...)
-(?P<name matches any RE inside (), and delimits a named group. (e.g. r'(?P
->...) <id>[a-zA-Z_]\w*)' defines a group named id)
-(?P=name) matches whatever text was matched by the earlier group named name.
-(?#...) A comment; ignored.
-(?letter) letter is one of 'i','L', 'm', 's', 'x'. Set the corresponding flags
- (re.I, re.L, re.M, re.S, re.X) for the entire RE.
-
- Special sequences
-Sequence Description
-number matches content of the group of the same number; groups are numbered
- starting from 1
-\A matches only at the start of the string
-\b empty str at beg or end of word: '\bis\b' matches 'is', but not 'his'
-\B empty str NOT at beginning or end of word
-\d any decimal digit (<=> [0-9])
-\D any non-decimal digit char (<=> [^O-9])
-\s any whitespace char (<=> [ \t\n\r\f\v])
-\S any non-whitespace char (<=> [^ \t\n\r\f\v])
-\w any alphaNumeric char (depends on LOCALE flag)
-\W any non-alphaNumeric char (depends on LOCALE flag)
-\Z matches only at the end of the string
-
- Variables
-Variable Meaning
-error Exception when pattern string isn't a valid regexp.
-
- Functions
- Function Result
- Compile a RE pattern string into a regular expression object.
- Flags (combinable by |):
-
- I or IGNORECASE or (?i)
- case insensitive matching
-compile( L or LOCALE or (?L)
-pattern[, make \w, \W, \b, \B dependent on thecurrent locale
-flags=0]) M or MULTILINE or (?m)
- matches every new line and not onlystart/end of the whole
- string
- S or DOTALL or (?s)
- '.' matches ALL chars, including newline
- X or VERBOSE or (?x)
- Ignores whitespace outside character sets
-escape(string) return (a copy of) string with all non-alphanumerics
- backslashed.
-match(pattern, if 0 or more chars at beginning of <string> match the RE pattern
-string[, flags string,return a corresponding MatchObject instance, or None if
-]) no match.
-search(pattern scan thru <string> for a location matching <pattern>, return
-, string[, acorresponding MatchObject instance, or None if no match.
-flags])
-split(pattern, split <string> by occurrences of <pattern>. If capturing () are
-string[, used inpattern, then occurrences of patterns or subpatterns are
-maxsplit=0]) also returned.
-findall( return a list of non-overlapping matches in <pattern>, either a
-pattern, list ofgroups or a list of tuples if the pattern has more than 1
-string) group.
- return string obtained by replacing the (<count> first) lefmost
-sub(pattern, non-overlapping occurrences of <pattern> (a string or a RE
-repl, string[, object) in <string>by <repl>; <repl> can be a string or a fct
-count=0]) called with a single MatchObj arg, which must return the
- replacement string.
-subn(pattern,
-repl, string[, same as sub(), but returns a tuple (newString, numberOfSubsMade)
-count=0])
-
-Regular Expression Objects
-
-
-(RE objects are returned by the compile fct)
-
- re object attributes
-Attribute Descrition
-flags flags arg used when RE obj was compiled, or 0 if none provided
-groupindex dictionary of {group name: group number} in pattern
-pattern pattern string from which RE obj was compiled
-
- re object methods
- Method Result
- If zero or more characters at the beginning of string match this
- regular expression, return a corresponding MatchObject instance.
- Return None if the string does not match the pattern; note that
- this is different from a zero-length match.
- The optional second parameter pos gives an index in the string
-match( where the search is to start; it defaults to 0. This is not
-string[, completely equivalent to slicing the string; the '' pattern
-pos][, character matches at the real beginning of the string and at
-endpos]) positions just after a newline, but not necessarily at the index
- where the search is to start.
- The optional parameter endpos limits how far the string will be
- searched; it will be as if the string is endpos characters long, so
- only the characters from pos to endpos will be searched for a
- match.
- Scan through string looking for a location where this regular
-search( expression produces a match, and return a corresponding MatchObject
-string[, instance. Return None if no position in the string matches the
-pos][, pattern; note that this is different from finding a zero-length
-endpos]) match at some point in the string.
- The optional pos and endpos parameters have the same meaning as for
- the match() method.
-split(
-string[, Identical to the split() function, using the compiled pattern.
-maxsplit=
-0])
-findall( Identical to the findall() function, using the compiled pattern.
-string)
-sub(repl,
-string[, Identical to the sub() function, using the compiled pattern.
-count=0])
-subn(repl,
-string[, Identical to the subn() function, using the compiled pattern.
-count=0])
-
-Match Objects
-
-
-(Match objects are returned by the match & search functions)
-
- Match object attributes
-Attribute Description
-pos value of pos passed to search or match functions; index intostring at
- which RE engine started search.
-endpos value of endpos passed to search or match functions; index intostring
- beyond which RE engine won't go.
-re RE object whose match or search fct produced this MatchObj instance
-string string passed to match() or search()
-
- Match object functions
-Function Result
- returns one or more groups of the match. If one arg, result is a
-group([g1 string;if multiple args, result is a tuple with one item per arg. If
-, g2, gi is 0,return value is entire matching string; if 1 <= gi <= 99,
-...]) returnstring matching group #gi (or None if no such group); gi may
- also bea group name.
- returns a tuple of all groups of the match; groups not
-groups() participatingto the match have a value of None. Returns a string
- instead of tupleif len(tuple)=1
-start(
-group), returns indices of start & end of substring matched by group (or
-end(group Noneif group exists but doesn't contribute to the match)
-)
-span( returns the 2-tuple (start(group), end(group)); can be (None, None)if
-group) group didn't contibute to the match.
-
-
-
- math
-
-Variables:
-pi
-e
-Functions (see ordinary C man pages for info):
-acos(x)
-asin(x)
-atan(x)
-atan2(x, y)
-ceil(x)
-cos(x)
-cosh(x)
-degrees(x)
-exp(x)
-fabs(x)
-floor(x)
-fmod(x, y)
-frexp(x) -- Unlike C: (float, int) = frexp(float)
-ldexp(x, y)
-log(x [,base])
-log10(x)
-modf(x) -- Unlike C: (float, float) = modf(float)
-pow(x, y)
-radians(x)
-sin(x)
-sinh(x)
-sqrt(x)
-tan(x)
-tanh(x)
-
- getopt
-
-Functions:
-getopt(list, optstr) -- Similar to C. <optstr> is option
- letters to look for. Put ':' after letter
- if option takes arg. E.g.
- # invocation was "python test.py -c hi -a arg1 arg2"
- opts, args = getopt.getopt(sys.argv[1:], 'ab:c:')
- # opts would be
- [('-c', 'hi'), ('-a', '')]
- # args would be
- ['arg1', 'arg2']
-
-
-List of modules and packages in base distribution
-
-(built-ins and content of python Lib directory)
-(Python NT distribution, may be slightly different in other distributions)
-
- Standard library modules
- Operation Result
-aifc Stuff to parse AIFF-C and AIFF files.
-asynchat Support for 'chat' style protocols
-asyncore Asynchronous File I/O (in select style)
-atexit Register functions to be called at exit of Python interpreter.
-base64 Conversions to/from base64 RFC-MIME transport encoding .
-bdb A generic Python debugger base class.
-binhex Macintosh binhex compression/decompression.
-bisect List bisection algorithms.
-bz2 Support for bz2 compression/decompression.
-calendar Calendar printing functions.
-cgi Wraps the WWW Forms Common Gateway Interface (CGI).
-cgitb Utility for handling CGI tracebacks.
-cmd A generic class to build line-oriented command interpreters.
-datetime Basic date and time types.
-code Utilities needed to emulate Python's interactive interpreter
-codecs Lookup existing Unicode encodings and register new ones.
-colorsys Conversion functions between RGB and other color systems.
-compileall Force "compilation" of all .py files in a directory.
-configparser Configuration file parser (much like windows .ini files)
-copy Generic shallow and deep copying operations.
-copyreg Helper to provide extensibility for pickle/cPickle.
-csv Read and write files with comma separated values.
-dbm Generic interface to all dbm clones (dbm.bsd, dbm.gnu,
- dbm.ndbm, dbm.dumb).
-dircache Sorted list of files in a dir, using a cache.
-difflib Tool for creating delta between sequences.
-dis Bytecode disassembler.
-distutils Package installation system.
-doctest Tool for running and verifying tests inside doc strings.
-dospath Common operations on DOS pathnames.
-email Comprehensive support for internet email.
-filecmp File comparison.
-fileinput Helper class to quickly write a loop over all standard input
- files.
-fnmatch Filename matching with shell patterns.
-formatter A test formatter.
-fpformat General floating point formatting functions.
-ftplib An FTP client class. Based on RFC 959.
-gc Perform garbacge collection, obtain GC debug stats, and tune
- GC parameters.
-getopt Standard command line processing. See also ftp://
- www.pauahtun.org/pub/getargspy.zip
-getpass Utilities to get a password and/or the current user name.
-glob filename globbing.
-gzip Read & write gzipped files.
-heapq Priority queue implemented using lists organized as heaps.
-hmac Keyed-Hashing for Message Authentication -- RFC 2104.
-html.entities HTML entity definitions.
-html.parser A parser for HTML and XHTML.
-http.client HTTP client class.
-http.server HTTP server services.
-ihooks Hooks into the "import" mechanism.
-imaplib IMAP4 client.Based on RFC 2060.
-imghdr Recognizing image files based on their first few bytes.
-imputil Privides a way of writing customised import hooks.
-inspect Tool for probing live Python objects.
-keyword List of Python keywords.
-linecache Cache lines from files.
-locale Support for number formatting using the current locale
- settings.
-logging Python logging facility.
-macpath Pathname (or related) operations for the Macintosh.
-macurl2path Mac specific module for conversion between pathnames and URLs.
-mailbox A class to handle a unix-style or mmdf-style mailbox.
-mailcap Mailcap file handling (RFC 1524).
-mhlib MH (mailbox) interface.
-mimetypes Guess the MIME type of a file.
-mmap Interface to memory-mapped files - they behave like mutable
- strings./font>
-multifile Class to make multi-file messages easier to handle.
-mutex Mutual exclusion -- for use with module sched.
-netrc
-nntplib An NNTP client class. Based on RFC 977.
-ntpath Common operations on DOS pathnames.
-nturl2path Mac specific module for conversion between pathnames and URLs.
-optparse A comprehensive tool for processing command line options.
-os Either mac, dos or posix depending system.
-pdb A Python debugger.
-pickle Pickling (save and restore) of Python objects (a faster
- Cimplementation exists in built-in module: cPickle).
-pipes Conversion pipeline templates.
-pkgunil Utilities for working with Python packages.
-poplib A POP3 client class. Based on the J. Myers POP3 draft.
-posixpath Common operations on POSIX pathnames.
-pprint Support to pretty-print lists, tuples, & dictionaries
- recursively.
-profile Class for profiling python code.
-pstats Class for printing reports on profiled python code.
-pydoc Utility for generating documentation from source files.
-pty Pseudo terminal utilities.
-pyexpat Interface to the Expay XML parser.
-py_compile Routine to "compile" a .py file to a .pyc file.
-pyclbr Parse a Python file and retrieve classes and methods.
-queue A multi-producer, multi-consumer queue.
-quopri Conversions to/from quoted-printable transport encoding.
-random Random variable generators
-re Regular Expressions.
-reprlib Redo repr() but with limits on most sizes.
-rlcompleter Word completion for GNU readline 2.0.
-sched A generally useful event scheduler class.
-shelve Manage shelves of pickled objects.
-shlex Lexical analyzer class for simple shell-like syntaxes.
-shutil Utility functions usable in a shell-like program.
-site Append module search paths for third-party packages to
- sys.path.
-smtplib SMTP Client class (RFC 821)
-sndhdr Several routines that help recognizing sound.
-socketserver Generic socket server classes.
-stat Constants and functions for interpreting stat/lstat struct.
-statvfs Constants for interpreting statvfs struct as returned by
- os.statvfs()and os.fstatvfs() (if they exist).
-string A collection of string operations.
-sunau Stuff to parse Sun and NeXT audio files.
-sunaudio Interpret sun audio headers.
-symbol Non-terminal symbols of Python grammar (from "graminit.h").
-tabnanny Check Python source for ambiguous indentation.
-tarfile Facility for reading and writing to the *nix tarfile format.
-telnetlib TELNET client class. Based on RFC 854.
-tempfile Temporary file name allocation.
-textwrap Object for wrapping and filling text.
-threading Proposed new higher-level threading interfaces
-token Tokens (from "token.h").
-tokenize Compiles a regular expression that recognizes Python tokens.
-traceback Format and print Python stack traces.
-tty Terminal utilities.
-turtle LogoMation-like turtle graphics
-types Define names for all type symbols in the std interpreter.
-tzparse Parse a timezone specification.
-unicodedata Interface to unicode properties.
-urllib.parse Parse URLs according to latest draft of standard.
-urllib.request Open an arbitrary URL.
-urllib.robotparser Parse robots.txt files, useful for web spiders.
-user Hook to allow user-specified customization code to run.
-uu UUencode/UUdecode.
-unittest Utilities for implementing unit testing.
-wave Stuff to parse WAVE files.
-weakref Tools for creating and managing weakly referenced objects.
-webbrowser Platform independent URL launcher.
-xdrlib Implements (a subset of) Sun XDR (eXternal Data
- Representation).
-xml.dom Classes for processing XML using the Document Object Model.
-xml.sax Classes for processing XML using the SAX API.
-xmlrpc.client Support for remote procedure calls using XML.
-xmlrpc.server Create XMLRPC servers.
-zipfile Read & write PK zipped files.
-
-
-
-* Built-ins *
-
- sys Interpreter state vars and functions
- __built-in__ Access to all built-in python identifiers
- __main__ Scope of the interpreters main program, script or stdin
- array Obj efficiently representing arrays of basic values
- math Math functions of C standard
- time Time-related functions (also the newer datetime module)
- marshal Read and write some python values in binary format
- struct Convert between python values and C structs
-
-* Standard *
-
- getopt Parse cmd line args in sys.argv. A la UNIX 'getopt'.
- os A more portable interface to OS dependent functionality
- re Functions useful for working with regular expressions
- string Useful string and characters functions and exceptions
- random Mersenne Twister pseudo-random number generator
- _thread Low-level primitives for working with process threads
- threading idem, new recommended interface.
-
-* Unix/Posix *
-
- dbm Interface to Unix dbm databases
- grp Interface to Unix group database
- posix OS functionality standardized by C and POSIX standards
- posixpath POSIX pathname functions
- pwd Access to the Unix password database
- select Access to Unix select multiplex file synchronization
- socket Access to BSD socket interface
-
-* Tk User-interface Toolkit *
-
- tkinter Main interface to Tk
-
-* Multimedia *
-
- audioop Useful operations on sound fragments
- imageop Useful operations on images
- jpeg Access to jpeg image compressor and decompressor
- rgbimg Access SGI imglib image files
-
-* Cryptographic Extensions *
-
- md5 Interface to RSA's MD5 message digest algorithm
- sha Interface to the SHA message digest algorithm
- HMAC Keyed-Hashing for Message Authentication -- RFC 2104.
-
-* SGI IRIX * (4 & 5)
-
- al SGI audio facilities
- AL al constants
- fl Interface to FORMS library
- FL fl constants
- flp Functions for form designer
- fm Access to font manager library
- gl Access to graphics library
- GL Constants for gl
- DEVICE More constants for gl
- imgfile Imglib image file interface
-
-
-Workspace exploration and idiom hints
-
- dir(<module>) list functions, variables in <module>
- dir() get object keys, defaults to local name space
- if __name__ == '__main__': main() invoke main if running as script
- map(None, lst1, lst2, ...) merge lists
- b = a[:] create copy of seq structure
- _ in interactive mode, is last value printed
-
-
-
-
-
-
-
-Python Mode for Emacs
-
-(Not revised, possibly not up to date)
-Type C-c ? when in python-mode for extensive help.
-INDENTATION
-Primarily for entering new code:
- TAB indent line appropriately
- LFD insert newline, then indent
- DEL reduce indentation, or delete single character
-Primarily for reindenting existing code:
- C-c : guess py-indent-offset from file content; change locally
- C-u C-c : ditto, but change globally
- C-c TAB reindent region to match its context
- C-c < shift region left by py-indent-offset
- C-c > shift region right by py-indent-offset
-MARKING & MANIPULATING REGIONS OF CODE
-C-c C-b mark block of lines
-M-C-h mark smallest enclosing def
-C-u M-C-h mark smallest enclosing class
-C-c # comment out region of code
-C-u C-c # uncomment region of code
-MOVING POINT
-C-c C-p move to statement preceding point
-C-c C-n move to statement following point
-C-c C-u move up to start of current block
-M-C-a move to start of def
-C-u M-C-a move to start of class
-M-C-e move to end of def
-C-u M-C-e move to end of class
-EXECUTING PYTHON CODE
-C-c C-c sends the entire buffer to the Python interpreter
-C-c | sends the current region
-C-c ! starts a Python interpreter window; this will be used by
- subsequent C-c C-c or C-c | commands
-C-c C-w runs PyChecker
-
-VARIABLES
-py-indent-offset indentation increment
-py-block-comment-prefix comment string used by py-comment-region
-py-python-command shell command to invoke Python interpreter
-py-scroll-process-buffer t means always scroll Python process buffer
-py-temp-directory directory used for temp files (if needed)
-py-beep-if-tab-change ring the bell if tab-width is changed
-
-
-The Python Debugger
-
-(Not revised, possibly not up to date, see 1.5.2 Library Ref section 9.1; in 1.5.2, you may also use debugger integrated in IDLE)
-
-Accessing
-
-import pdb (it's a module written in Python)
- -- defines functions :
- run(statement[,globals[, locals]])
- -- execute statement string under debugger control, with optional
- global & local environment.
- runeval(expression[,globals[, locals]])
- -- same as run, but evaluate expression and return value.
- runcall(function[, argument, ...])
- -- run function object with given arg(s)
- pm() -- run postmortem on last exception (like debugging a core file)
- post_mortem(t)
- -- run postmortem on traceback object <t>
-
- -- defines class Pdb :
- use Pdb to create reusable debugger objects. Object
- preserves state (i.e. break points) between calls.
-
- runs until a breakpoint hit, exception, or end of program
- If exception, variable '__exception__' holds (exception,value).
-
-Commands
-
-h, help
- brief reminder of commands
-b, break [<arg>]
- if <arg> numeric, break at line <arg> in current file
- if <arg> is function object, break on entry to fcn <arg>
- if no arg, list breakpoints
-cl, clear [<arg>]
- if <arg> numeric, clear breakpoint at <arg> in current file
- if no arg, clear all breakpoints after confirmation
-w, where
- print current call stack
-u, up
- move up one stack frame (to top-level caller)
-d, down
- move down one stack frame
-s, step
- advance one line in the program, stepping into calls
-n, next
- advance one line, stepping over calls
-r, return
- continue execution until current function returns
- (return value is saved in variable "__return__", which
- can be printed or manipulated from debugger)
-c, continue
- continue until next breakpoint
-j, jump lineno
- Set the next line that will be executed
-a, args
- print args to current function
-rv, retval
- prints return value from last function that returned
-p, print <arg>
- prints value of <arg> in current stack frame
-l, list [<first> [, <last>]]
- List source code for the current file.
- Without arguments, list 11 lines around the current line
- or continue the previous listing.
- With one argument, list 11 lines starting at that line.
- With two arguments, list the given range;
- if the second argument is less than the first, it is a count.
-whatis <arg>
- prints type of <arg>
-!
- executes rest of line as a Python statement in the current stack frame
-q quit
- immediately stop execution and leave debugger
-<return>
- executes last command again
-Any input debugger doesn't recognize as a command is assumed to be a
-Python statement to execute in the current stack frame, the same way
-the exclamation mark ("!") command does.
-
-Example
-
-(1394) python
-Python 1.0.3 (Sep 26 1994)
-Copyright 1991-1994 Stichting Mathematisch Centrum, Amsterdam
->>> import rm
->>> rm.run()
-Traceback (innermost last):
- File "<stdin>", line 1
- File "./rm.py", line 7
- x = div(3)
- File "./rm.py", line 2
- return a / r
-ZeroDivisionError: integer division or modulo
->>> import pdb
->>> pdb.pm()
-> ./rm.py(2)div: return a / r
-(Pdb) list
- 1 def div(a):
- 2 -> return a / r
- 3
- 4 def run():
- 5 global r
- 6 r = 0
- 7 x = div(3)
- 8 print x
-[EOF]
-(Pdb) print r
-0
-(Pdb) q
->>> pdb.runcall(rm.run)
-etc.
-
-Quirks
-
-Breakpoints are stored as filename, line number tuples. If a module is reloaded
-after editing, any remembered breakpoints are likely to be wrong.
-
-Always single-steps through top-most stack frame. That is, "c" acts like "n".
diff --git a/Misc/developers.txt b/Misc/developers.txt
deleted file mode 100644
index 0c34613bb0..0000000000
--- a/Misc/developers.txt
+++ /dev/null
@@ -1,346 +0,0 @@
-Developer Log
-=============
-
-This file is a running log of developers given permissions on SourceForge.
-
-The purpose is to provide some institutional memory of who was given access
-and why.
-
-The first entry starts in April 2005. In keeping with the style of
-Misc/NEWS, newer entries should be added to the top. Any markup should
-be in the form of ReST. Entries should include the initials of the
-project admin who made the change or granted access. Feel free to revise
-the format to accommodate documentation needs as they arise.
-
-Note, when giving new commit permissions, be sure to get a contributor
-agreement from the committer. See http://www.python.org/psf/contrib/
-for details. When the agreement is signed, please note it in this log.
-
-This file is encoded in UTF-8. If the usual form for a name is not in
-a Latin or extended Latin alphabet, make sure to include an ASCII
-transliteration too.
-
-Permissions History
--------------------
-
-- David Malcolm was given commit access on Oct 27 2010 by GFB,
- at recommendation by Antoine Pitrou and Raymond Hettinger.
-
-- Tal Einat was given commit access on Oct 4 2010 by MvL,
- for improving IDLE.
-
-- Åukasz Langa was given commit access on Sep 08 2010 by GFB,
- at suggestion of Antoine Pitrou, for general bug fixing.
-
-- Daniel Stutzbach was given commit access on Aug 22 2010 by MvL,
- for general bug fixing.
-
-- Ask Solem was given commit access on Aug 17 2010 by MvL,
- on recommendation by Jesse Noller, for work on the multiprocessing
- library.
-
-- George Boutsioukis was given commit access on Aug 10 2010
- by MvL, for work on 2to3.
-
-- Éric Araujo was given commit access on Aug 10 2010 by BAC,
- at suggestion of Tarek Ziadé.
-
-- Terry Reedy was given commit access on Aug 04 2010 by MvL,
- at suggestion of Nick Coghlan.
-
-- Brian Quinlan was given commit access on Jul 26 2010 by GFB,
- for work related to PEP 3148.
-
-- Reid Kleckner was given commit access on Jul 11 2010 by GFB,
- for work on the py3k-jit branch, at suggestion of the Unladen
- Swallow team.
-
-- Alexander Belopolsky was given commit access on May 25 2010
- by MvL at suggestion of Mark Dickinson.
-
-- Tim Golden was given commit access on April 21 2010 by MvL,
- at suggestion of Michael Foord.
-
-- Giampaolo Rodolà was given commit access on April 17 2010 by
- MvL, at suggestion of R. David Murray.
-
-- Jean-Paul Calderone was given commit access on April 6 2010 by
- GFB, at suggestion of Michael Foord and others.
-
-- Brian Curtin was given commit access on March 24 2010 by MvL.
-
-- Florent Xicluna was given commit access on February 25 2010 by
- MvL, based on Antoine Pitrou's recommendation.
-
-- Dino Viehland was given SVN access on February 23 2010 by Brett
- Cannon, for backporting tests from IronPython.
-
-- Larry Hastings was given SVN access on February 22 2010 by
- Andrew Kuchling, based on Brett Cannon's recommendation.
-
-- Victor Stinner was given SVN access on January 30 2010 by MvL,
- at recommendation by Mark Dickinson and Amaury Forgeot d'Arc.
-
-- Stefan Krah was given SVN access on January 5 2010 by GFB, at
- suggestion of Mark Dickinson, for work on the decimal module.
-
-- Doug Hellmann was given SVN access on September 19 2009 by GFB, at
- suggestion of Jesse Noller, for documentation work.
-
-- Ezio Melotti was given SVN access on June 7 2009 by GFB, for work on and
- fixes to the documentation.
-
-- Paul Kippes was given commit privileges at PyCon 2009 by BAC to work on 3to2.
-
-- Ron DuPlain was given commit privileges at PyCon 2009 by BAC to work on 3to2.
-
-- Several developers of alternative Python implementations where
- given access for test suite and library adaptions by MvL:
- Allison Randal (Parrot), Michael Foord (IronPython),
- Jim Baker, Philip Jenvey, and Frank Wierzbicki (all Jython).
-
-- R. David Murray was given SVN access on March 30 2009 by MvL, after
- recommendation by BAC.
-
-- Chris Withers was given SVN access on March 8 2009 by MvL,
- after recommendation by GvR.
-
-- Tarek Ziadé was given SVN access on December 21 2008 by NCN,
- for maintenance of distutils.
-
-- Hirokazu Yamamoto was given SVN access on August 12 2008 by MvL,
- for contributions to the Windows build.
-
-- Antoine Pitrou was given SVN access on July 16 2008, by recommendation
- from GvR, for general contributions to Python.
-
-- Jesse Noller was given SVN access on 16 June 2008 by GFB,
- for work on the multiprocessing module.
-
-- Gregor Lingl was given SVN access on 10 June 2008 by MvL,
- for work on the turtle module.
-
-- Robert Schuppenies was given SVN access on 21 May 2008 by MvL,
- for GSoC contributions.
-
-- Rodrigo Bernardo Pimentel was given SVN access on 29 April 2008 by MvL,
- for GSoC contributions.
-
-- Heiko Weinen was given SVN access on 29 April 2008 by MvL,
- for GSoC contributions.
-
-- Jesus Cea was given SVN access on 24 April 2008 by MvL,
- for maintenance of bsddb.
-
-- Guilherme Polo was given SVN access on 24 April 2008 by MvL,
- for GSoC contributions.
-
-- Thomas Lee was given SVN access on 21 April 2008 by NCN,
- for work on branches (ast/optimizer related).
-
-- Jeroen Ruigrok van der Werven was given SVN access on 12 April 2008
- by GFB, for documentation work.
-
-- Josiah Carlson was given SVN access on 26 March 2008 by GFB,
- for work on asyncore/asynchat.
-
-- Benjamin Peterson was given SVN access on 25 March 2008 by GFB,
- for bug triage work.
-
-- Jerry Seutter was given SVN access on 20 March 2008 by BAC, for
- general contributions to Python.
-
-- Jeff Rush was given SVN access on 18 March 2008 by AMK, for Distutils work.
-
-- David Wolever was given SVN access on 17 March 2008 by MvL,
- for 2to3 work.
-
-- Trent Nelson was given SVN access on 17 March 2008 by MvL,
- for general contributions to Python.
-
-- Mark Dickinson was given SVN access on 6 January 2008 by Facundo
- Batista for his work on mathemathics and number related issues.
-
-- Amaury Forgeot d'Arc was given SVN access on 9 November 2007 by MvL,
- for general contributions to Python.
-
-- Christian Heimes was given SVN access on 31 October 2007 by MvL,
- for general contributions to Python.
-
-- Chris Monson was given SVN access on 20 October 2007 by NCN,
- for his work on editing PEPs.
-
-- Bill Janssen was given SVN access on 28 August 2007 by NCN,
- for his work on the SSL module and other things related to (SSL) sockets.
-
-- Jeffrey Yasskin was given SVN access on 9 August 2007 by NCN,
- for his work on PEPs and other general patches.
-
-- Mark Summerfield was given SVN access on 1 August 2007 by GFB,
- for work on documentation.
-
-- Armin Ronacher was given SVN access on 23 July 2007 by GFB,
- for work on the documentation toolset. He now maintains the
- ast module.
-
-- Senthil Kumaran was given SVN access on 16 June 2007 by MvL,
- for his Summer-of-Code project, mentored by Skip Montanaro.
-
-- Alexandre Vassalotti was given SVN access on 21 May 2007 by MvL,
- for his Summer-of-Code project, mentored by Brett Cannon.
-
-- Travis Oliphant was given SVN access on 17 Apr 2007 by MvL,
- for implementing the extended buffer protocol.
-
-- Ziga Seilnacht was given SVN access on 09 Mar 2007 by MvL,
- for general maintenance.
-
-- Pete Shinners was given SVN access on 04 Mar 2007 by NCN,
- for PEP 3101 work in the sandbox.
-
-- Pat Maupin and Eric V. Smith were given SVN access on 28 Feb 2007 by NCN,
- for PEP 3101 work in the sandbox.
-
-- Steven Bethard (SF name "bediviere") added to the SourceForge Python
- project 26 Feb 2007, by NCN, as a tracker tech.
-
-- Josiah Carlson (SF name "josiahcarlson") added to the SourceForge Python
- project 06 Jan 2007, by NCN, as a tracker tech. He will maintain asyncore.
-
-- Collin Winter was given SVN access on 05 Jan 2007 by NCN, for PEP
- update access.
-
-- Lars Gustaebel was given SVN access on 20 Dec 2006 by NCN, for tarfile.py
- related work.
-
-- 2006 Summer of Code entries: SoC developers are expected to work
- primarily in nondist/sandbox or on a branch of their own, and will
- have their work reviewed before changes are accepted into the trunk.
-
- - Matt Fleming was added on 25 May 2006 by AMK; he'll be working on
- enhancing the Python debugger.
-
- - Jackilyn Hoxworth was added on 25 May 2006 by AMK; she'll be adding logging
- to the standard library.
-
- - Mateusz Rukowicz was added on 30 May 2006 by AMK; he'll be
- translating the decimal module into C.
-
-- SVN access granted to the "Need for Speed" Iceland sprint attendees,
- between May 17 and 21, 2006, by Tim Peters. All work is to be done
- in new sandbox projects or on new branches, with merging to the
- trunk as approved:
-
- Andrew Dalke
- Christian Tismer
- Jack Diederich
- John Benediktsson
- Kristján V. Jónsson
- Martin Blais
- Richard Emslie
- Richard Jones
- Runar Petursson
- Steve Holden
- Richard M. Tew
-
-- Steven Bethard was given SVN access on 27 Apr 2006 by DJG, for PEP
- update access.
-
-- Talin was given SVN access on 27 Apr 2006 by DJG, for PEP update
- access.
-
-- George Yoshida (SF name "quiver") added to the SourceForge Python
- project 14 Apr 2006, by Tim Peters, as a tracker admin. See
- contemporaneous python-checkins thread with the unlikely Subject:
-
- r45329 - python/trunk/Doc/whatsnew/whatsnew25.tex
-
-- Ronald Oussoren was given SVN access on 3 Mar 2006 by NCN, for Mac
- related work.
-
-- Bob Ippolito was given SVN access on 2 Mar 2006 by NCN, for Mac
- related work.
-
-- Nick Coghlan requested CVS access so he could update his PEP directly.
- Granted by GvR on 16 Oct 2005.
-
-- Added two new developers for the Summer of Code project. 8 July 2005
- by RDH. Andrew Kuchling will be mentoring Gregory K Johnson for a
- project to enhance mailbox. Brett Cannon requested access for Flovis
- Bruynooghe (sirolf) to work on pstats, profile, and hotshot. Both users
- are expected to work primarily in nondist/sandbox and have their work
- reviewed before making updates to active code.
-
-- Georg Brandl was given SF tracker permissions on 28 May 2005
- by RDH. Since the beginning of 2005, he has been active in discussions
- on python-dev and has submitted a dozen patch reviews. The permissions
- add the ability to change tracker status and to attach patches. On
- 3 June 2005, this was expanded by RDH to include checkin permissions.
-
-- Terry Reedy was given SF tracker permissions on 7 Apr 2005 by RDH.
-
-- Nick Coghlan was given SF tracker permissions on 5 Apr 2005 by RDH.
- For several months, he has been active in reviewing and contributing
- patches. The added permissions give him greater flexibility in
- working with the tracker.
-
-- Eric Price was made a developer on 2 May 2003 by TGP. This was
- specifically to work on the new ``decimal`` package, which lived in
- ``nondist/sandbox/decimal/`` at the time.
-
-- Eric S. Raymond was made a developer on 2 Jul 2000 by TGP, for general
- library work. His request is archived here:
-
- http://mail.python.org/pipermail/python-dev/2000-July/005314.html
-
-
-Permissions Dropped on Request
-------------------------------
-
-- Roy Smith, Matt Fleming and Richard Emslie sent drop requests.
- 4 Aug 2008 GFB
-
-- Per note from Andrew Kuchling, the permissions for Gregory K Johnson
- and the Summer Of Code project are no longer needed. 4 Aug 2008 GFB
-
-- Per note from Andrew Kuchling, the permissions for Gregory K Johnson
- and the Summer Of Code project are no longer needed. AMK will make
- any future checkins directly. 16 Oct 2005 RDH
-
-- Johannes Gijsbers sent a drop request. 27 July 2005 RDH
-
-- Flovis Bruynooghe sent a drop request. 14 July 2005 RDH
-
-- Paul Prescod sent a drop request. 30 Apr 2005 RDH
-
-- Finn Bock sent a drop request. 13 Apr 2005 RDH
-
-- Eric Price sent a drop request. 10 Apr 2005 RDH
-
-- Irmen de Jong requested dropping CVS access while keeping tracker
- access. 10 Apr 2005 RDH
-
-- Moshe Zadka and Ken Manheimer sent drop requests. 8 Apr 2005 by RDH
-
-- Steve Holden, Gerhard Haring, and David Cole sent email stating that
- they no longer use their access. 7 Apr 2005 RDH
-
-
-Permissions Dropped after Loss of Contact
------------------------------------------
-
-- Several unsuccessful efforts were made to contact Charles G Waldman.
- Removed on 8 Apr 2005 by RDH.
-
-
-Initials of Project Admins
---------------------------
-
-TGP: Tim Peters
-GFB: Georg Brandl
-BAC: Brett Cannon
-NCN: Neal Norwitz
-DJG: David Goodger
-MvL: Martin v. Loewis
-GvR: Guido van Rossum
-RDH: Raymond Hettinger
diff --git a/Misc/gdbinit b/Misc/gdbinit
index 2c89a7abf6..9484b51824 100644
--- a/Misc/gdbinit
+++ b/Misc/gdbinit
@@ -12,8 +12,7 @@
#
# NOTE: If you have gdb 7 or later, it supports debugging of Python directly
# with embedded macros that you may find superior to what is in here.
-# See https://fedoraproject.org/wiki/Features/EasierPythonDebugging
-# and http://bugs.python.org/issue8032 for more gdb 7 python information.
+# See Tools/gdb/libpython.py and http://bugs.python.org/issue8032.
# Prints a representation of the object to stderr, along with the
# number of reference counts it current has and the hex address the
@@ -119,12 +118,18 @@ end
# interpreter, but the test can be extended by an interested party). If
# Py_Main <= $pc <= Py_GetArgcArv is true, $pc is in Py_Main(), so the while
# tests succeeds as long as it's not true. In a similar fashion the if
-# statement tests to see if we are in PyEval_EvalFrame().
+# statement tests to see if we are in PyEval_EvalFrameEx().
+
+# Note: The name of the main interpreter function and the function which
+# follow it has changed over time. This version of pystack works with this
+# version of Python. If you try using it with older or newer versions of
+# the interpreter you may will have to change the functions you compare with
+# $pc.
# print the entire Python call stack
define pystack
while $pc < Py_Main || $pc > Py_GetArgcArgv
- if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx
+ if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
pyframe
end
up-silently 1
@@ -135,7 +140,7 @@ end
# print the entire Python call stack - verbose mode
define pystackv
while $pc < Py_Main || $pc > Py_GetArgcArgv
- if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx
+ if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
pyframev
end
up-silently 1
diff --git a/Misc/maintainers.rst b/Misc/maintainers.rst
deleted file mode 100644
index 3a91e4baf8..0000000000
--- a/Misc/maintainers.rst
+++ /dev/null
@@ -1,314 +0,0 @@
-Maintainers Index
-=================
-
-.. warning::
-
- This document is out of date and replaced by another version in the
- developer's guide at http://docs.python.org/devguide/experts
-
-This document has tables that list Python Modules, Tools, Platforms and
-Interest Areas and names for each item that indicate a maintainer or an
-expert in the field. This list is intended to be used by issue submitters,
-issue triage people, and other issue participants to find people to add to
-the nosy list or to contact directly by email for help and decisions on
-feature requests and bug fixes. People on this list may be asked to render
-final judgement on a feature or bug. If no active maintainer is listed for
-a given module, then questionable changes should go to python-dev, while
-any other issues can and should be decided by any committer.
-
-Unless a name is followed by a '*', you should never assign an issue to
-that person, only make them nosy. Names followed by a '*' may be assigned
-issues involving the module or topic.
-
-The Platform and Interest Area tables list broader fields in which various
-people have expertise. These people can also be contacted for help,
-opinions, and decisions when issues involve their areas.
-
-If a listed maintainer does not respond to requests for comment for an
-extended period (three weeks or more), they should be marked as inactive
-in this list by placing the word 'inactive' in parenthesis behind their
-tracker id. They are of course free to remove that inactive mark at
-any time.
-
-Committers should update these tables as their areas of expertise widen.
-New topics may be added to the Interest Area table at will.
-
-The existence of this list is not meant to indicate that these people
-*must* be contacted for decisions; it is, rather, a resource to be used
-by non-committers to find responsible parties, and by committers who do
-not feel qualified to make a decision in a particular context.
-
-See also `PEP 291`_ and `PEP 360`_ for information about certain modules
-with special rules.
-
-.. _`PEP 291`: http://www.python.org/dev/peps/pep-0291/
-.. _`PEP 360`: http://www.python.org/dev/peps/pep-0360/
-
-
-================== ===========
-Module Maintainers
-================== ===========
-__future__
-__main__ gvanrossum
-_dummy_thread brett.cannon
-_thread pitrou
-abc
-aifc r.david.murray
-argparse bethard
-array
-ast
-asynchat josiahcarlson, giampaolo.rodola, stutzbach
-asyncore josiahcarlson, giampaolo.rodola, stutzbach
-atexit
-audioop
-base64
-bdb
-binascii
-binhex
-bisect rhettinger
-builtins
-bz2
-calendar rhettinger
-cgi
-cgitb
-chunk
-cmath mark.dickinson
-cmd
-code
-codecs lemburg, doerwalter
-codeop
-collections rhettinger
-collections._abcoll rhettinger, stutzbach
-colorsys
-compileall
-configparser lukasz.langa
-contextlib ncoghlan
-copy alexandre.vassalotti
-copyreg alexandre.vassalotti
-cProfile
-crypt jafo*
-csv skip.montanaro
-ctypes theller
-curses
-datetime belopolsky
-dbm
-decimal facundobatista, rhettinger, mark.dickinson
-difflib tim_one (inactive)
-dis
-distutils tarek*, eric.araujo*
-doctest tim_one (inactive)
-dummy_threading brett.cannon
-email barry, r.david.murray*
-encodings lemburg, loewis
-errno
-exceptions
-fcntl
-filecmp
-fileinput
-fnmatch
-formatter
-fpectl
-fractions mark.dickinson, rhettinger
-ftplib giampaolo.rodola
-functools ncoghlan, rhettinger
-gc pitrou
-getopt
-getpass
-gettext loewis
-glob
-grp
-gzip
-hashlib
-heapq rhettinger, stutzbach
-hmac
-html
-http
-idlelib kbk
-imaplib
-imghdr
-imp
-importlib brett.cannon
-inspect
-io pitrou, benjamin.peterson, stutzbach
-itertools rhettinger
-json bob.ippolito (inactive), rhettinger
-keyword
-lib2to3 benjamin.peterson
-linecache
-locale loewis, lemburg
-logging vinay.sajip
-macpath
-mailbox
-mailcap
-marshal
-math mark.dickinson, rhettinger, stutzbach
-mimetypes
-mmap
-modulefinder theller, jvr
-msilib loewis
-msvcrt
-multiprocessing jnoller
-netrc
-nis
-nntplib pitrou
-numbers
-operator
-optparse aronacher
-os loewis
-ossaudiodev
-parser
-pdb georg.brandl*
-pickle alexandre.vassalotti, pitrou
-pickletools alexandre.vassalotti
-pipes
-pkgutil
-platform lemburg
-plistlib
-poplib
-posix
-pprint fdrake
-profile georg.brandl
-pstats georg.brandl
-pty
-pwd
-py_compile
-pybench lemburg, pitrou
-pyclbr
-pydoc
-queue rhettinger
-quopri
-random rhettinger
-re effbot (inactive), pitrou, ezio.melotti
-readline
-reprlib
-resource
-rlcompleter
-runpy ncoghlan
-sched
-select
-shelve
-shlex
-shutil tarek
-signal
-site
-smtpd
-smtplib
-sndhdr
-socket
-socketserver
-spwd
-sqlite3 ghaering
-ssl janssen, pitrou, giampaolo.rodola
-stat
-string georg.brandl*
-stringprep
-struct mark.dickinson
-subprocess astrand (inactive)
-sunau
-symbol
-symtable benjamin.peterson
-sys
-sysconfig tarek
-syslog jafo*
-tabnanny tim_one (inactive)
-tarfile lars.gustaebel
-telnetlib
-tempfile georg.brandl
-termios
-test
-textwrap georg.brandl
-threading pitrou
-time belopolsky
-timeit georg.brandl
-tkinter gpolo
-token georg.brandl
-tokenize
-trace belopolsky
-traceback georg.brandl*
-tty
-turtle gregorlingl
-types
-unicodedata loewis, lemburg, ezio.melotti
-unittest michael.foord, ezio.melotti
-urllib orsenthil
-uu
-uuid
-warnings brett.cannon
-wave
-weakref fdrake, pitrou
-webbrowser georg.brandl
-winreg brian.curtin*, stutzbach
-winsound effbot (inactive)
-wsgiref pje
-xdrlib
-xml.dom
-xml.dom.minidom
-xml.dom.pulldom
-xml.etree effbot (inactive)
-xml.parsers.expat
-xml.sax
-xml.sax.handler
-xml.sax.saxutils
-xml.sax.xmlreader
-xmlrpc loewis
-zipfile alanmcintyre
-zipimport
-zlib
-================== ===========
-
-
-================== ===========
-Tool Maintainers
------------------- -----------
-pybench lemburg
-================== ===========
-
-
-================== ===========
-Platform Maintainers
------------------- -----------
-AIX
-Cygwin jlt63, stutzbach
-FreeBSD
-HP-UX
-Linux
-Mac ronaldoussoren, ned.deily
-NetBSD1
-OS2/EMX aimacintyre
-Solaris
-Windows tim.golden, brian.curtin
-================== ===========
-
-
-================== ===========
-Interest Area Maintainers
------------------- -----------
-algorithms
-ast/compiler ncoghlan, benjamin.peterson, brett.cannon, georg.brandl
-autoconf/makefiles
-bsd
-bug tracker ezio.melotti
-buildbots
-bytecode pitrou
-data formats mark.dickinson, georg.brandl
-database lemburg
-documentation georg.brandl, ezio.melotti
-GUI
-i18n lemburg
-import machinery brett.cannon, ncoghlan
-io pitrou, benjamin.peterson, stutzbach
-locale lemburg, loewis
-mathematics mark.dickinson, eric.smith, lemburg, stutzbach
-memory management tim_one, lemburg
-networking giampaolo.rodola
-packaging tarek, lemburg
-py3 transition benjamin.peterson
-release management tarek, lemburg, benjamin.peterson, barry, loewis,
- gvanrossum, anthonybaxter
-str.format eric.smith
-testing michael.foord, pitrou, giampaolo.rodola, ezio.melotti
-threads pitrou
-time and dates lemburg, belopolsky
-unicode lemburg, ezio.melotti, haypo
-version control
-================== ===========
diff --git a/Misc/pymemcompat.h b/Misc/pymemcompat.h
deleted file mode 100644
index 2757e3acdd..0000000000
--- a/Misc/pymemcompat.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* The idea of this file is that you bundle it with your extension,
- #include it, program to Python 2.3's memory API and have your
- extension build with any version of Python from 1.5.2 through to
- 2.3 (and hopefully beyond). */
-
-#ifndef Py_PYMEMCOMPAT_H
-#define Py_PYMEMCOMPAT_H
-
-#include "Python.h"
-
-/* There are three "families" of memory API: the "raw memory", "object
- memory" and "object" families. (This is ignoring the matter of the
- cycle collector, about which more is said below).
-
- Raw Memory:
-
- PyMem_Malloc, PyMem_Realloc, PyMem_Free
-
- Object Memory:
-
- PyObject_Malloc, PyObject_Realloc, PyObject_Free
-
- Object:
-
- PyObject_New, PyObject_NewVar, PyObject_Del
-
- The raw memory and object memory allocators both mimic the
- malloc/realloc/free interface from ANSI C, but the object memory
- allocator can (and, since 2.3, does by default) use a different
- allocation strategy biased towards lots of "small" allocations.
-
- The object family is used for allocating Python objects, and the
- initializers take care of some basic initialization (setting the
- refcount to 1 and filling out the ob_type field) as well as having
- a somewhat different interface.
-
- Do not mix the families! E.g. do not allocate memory with
- PyMem_Malloc and free it with PyObject_Free. You may get away with
- it quite a lot of the time, but there *are* scenarios where this
- will break. You Have Been Warned.
-
- Also, in many versions of Python there are an insane amount of
- memory interfaces to choose from. Use the ones described above. */
-
-#if PY_VERSION_HEX < 0x01060000
-/* raw memory interface already present */
-
-/* there is no object memory interface in 1.5.2 */
-#define PyObject_Malloc PyMem_Malloc
-#define PyObject_Realloc PyMem_Realloc
-#define PyObject_Free PyMem_Free
-
-/* the object interface is there, but the names have changed */
-#define PyObject_New PyObject_NEW
-#define PyObject_NewVar PyObject_NEW_VAR
-#define PyObject_Del PyMem_Free
-#endif
-
-/* If your object is a container you probably want to support the
- cycle collector, which was new in Python 2.0.
-
- Unfortunately, the interface to the collector that was present in
- Python 2.0 and 2.1 proved to be tricky to use, and so changed in
- 2.2 -- in a way that can't easily be papered over with macros.
-
- This file contains macros that let you program to the 2.2 GC API.
- Your module will compile against any Python since version 1.5.2,
- but the type will only participate in the GC in versions 2.2 and
- up. Some work is still necessary on your part to only fill out the
- tp_traverse and tp_clear fields when they exist and set tp_flags
- appropriately.
-
- It is possible to support both the 2.0 and 2.2 GC APIs, but it's
- not pretty and this comment block is too narrow to contain a
- desciption of what's required... */
-
-#if PY_VERSION_HEX < 0x020200B1
-#define PyObject_GC_New PyObject_New
-#define PyObject_GC_NewVar PyObject_NewVar
-#define PyObject_GC_Del PyObject_Del
-#define PyObject_GC_Track(op)
-#define PyObject_GC_UnTrack(op)
-#endif
-
-#endif /* !Py_PYMEMCOMPAT_H */
diff --git a/Misc/python-config.in b/Misc/python-config.in
index 47ea669bd5..1d4a81d850 100644
--- a/Misc/python-config.in
+++ b/Misc/python-config.in
@@ -1,12 +1,13 @@
#!@EXENAME@
+# -*- python -*-
-import sys
-import os
import getopt
-from distutils import sysconfig
+import os
+import sys
+import sysconfig
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
- 'ldflags', 'help']
+ 'ldflags', 'extension-suffix', 'help', 'abiflags']
def exit_with_usage(code=1):
print("Usage: {0} [{1}]".format(
@@ -21,33 +22,41 @@ except getopt.error:
if not opts:
exit_with_usage()
-opt = opts[0][0]
-
pyver = sysconfig.get_config_var('VERSION')
getvar = sysconfig.get_config_var
-if opt == '--help':
- exit_with_usage(0)
-
-elif opt == '--prefix':
- print(sysconfig.PREFIX)
-
-elif opt == '--exec-prefix':
- print(sysconfig.EXEC_PREFIX)
-
-elif opt in ('--includes', '--cflags'):
- flags = ['-I' + sysconfig.get_python_inc(),
- '-I' + sysconfig.get_python_inc(plat_specific=True)]
- if opt == '--cflags':
- flags.extend(getvar('CFLAGS').split())
- print(' '.join(flags))
-
-elif opt in ('--libs', '--ldflags'):
- libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
- libs.append('-lpython'+pyver)
- # add the prefix/lib/pythonX.Y/config dir, but only if there is no
- # shared library in prefix/lib/.
- if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
- libs.insert(0, '-L' + getvar('LIBPL'))
- print(' '.join(libs))
-
+opt_flags = [flag for (flag, val) in opts]
+
+if '--help' in opt_flags:
+ exit_with_usage(code=0)
+
+for opt in opt_flags:
+ if opt == '--prefix':
+ print(sysconfig.get_config_var('prefix'))
+
+ elif opt == '--exec-prefix':
+ print(sysconfig.get_config_var('exec_prefix'))
+
+ elif opt in ('--includes', '--cflags'):
+ flags = ['-I' + sysconfig.get_path('include'),
+ '-I' + sysconfig.get_path('platinclude')]
+ if opt == '--cflags':
+ flags.extend(getvar('CFLAGS').split())
+ print(' '.join(flags))
+
+ elif opt in ('--libs', '--ldflags'):
+ libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
+ libs.append('-lpython' + pyver + sys.abiflags)
+ # add the prefix/lib/pythonX.Y/config dir, but only if there is no
+ # shared library in prefix/lib/.
+ if opt == '--ldflags':
+ if not getvar('Py_ENABLE_SHARED'):
+ libs.insert(0, '-L' + getvar('LIBPL'))
+ libs.extend(getvar('LINKFORSHARED').split())
+ print(' '.join(libs))
+
+ elif opt == '--extension-suffix':
+ print(sysconfig.get_config_var('SO'))
+
+ elif opt == '--abiflags':
+ print(sys.abiflags)
diff --git a/Misc/python-wing.wpr b/Misc/python-wing3.wpr
index b1d905d60d..abe789412d 100644
--- a/Misc/python-wing.wpr
+++ b/Misc/python-wing3.wpr
@@ -5,7 +5,7 @@
##################################################################
[project attributes]
proj.directory-list = [{'dirloc': loc('..'),
- 'excludes': (),
+ 'excludes': [u'Lib/__pycache__'],
'filter': '*',
'include_hidden': False,
'recursive': True,
diff --git a/Misc/python-wing4.wpr b/Misc/python-wing4.wpr
new file mode 100644
index 0000000000..7adfdbdacf
--- /dev/null
+++ b/Misc/python-wing4.wpr
@@ -0,0 +1,18 @@
+#!wing
+#!version=4.0
+##################################################################
+# Wing IDE project file #
+##################################################################
+[project attributes]
+proj.directory-list = [{'dirloc': loc('..'),
+ 'excludes': [u'.hg',
+ u'Lib/unittest/__pycache__',
+ u'Lib/unittest/test/__pycache__',
+ u'Lib/__pycache__',
+ u'build',
+ u'Doc/build'],
+ 'filter': '*',
+ 'include_hidden': False,
+ 'recursive': True,
+ 'watch_for_changes': True}]
+proj.file-type = 'shared'
diff --git a/Misc/python.man b/Misc/python.man
index 411a43a3e7..0921e4c0c4 100644
--- a/Misc/python.man
+++ b/Misc/python.man
@@ -26,6 +26,9 @@ python \- an interpreted, interactive, object-oriented programming language
.B \-m
.I module-name
]
+[
+.B \-q
+]
.br
[
.B \-O
@@ -145,6 +148,10 @@ to \fI.pyo\fP. Given twice, causes docstrings to be discarded.
.B \-OO
Discard docstrings in addition to the \fB-O\fP optimizations.
.TP
+.B \-q
+Do not print the version and copyright messages. These messages are
+also suppressed in non-interactive mode.
+.TP
.BI "\-Q " argument
Division control; see PEP 238. The argument must be one of "old" (the
default, int/int and long/long return an int or long), "new" (new
@@ -403,6 +410,9 @@ the \fB\-u\fP option.
If this is set to a non-empty string it is equivalent to specifying
the \fB\-v\fP option. If set to an integer, it is equivalent to
specifying \fB\-v\fP multiple times.
+.IP PYTHONWARNINGS
+If this is set to a comma-separated string it is equivalent to
+specifying the \fB\-W\fP option for each separate value.
.SH AUTHOR
The Python Software Foundation: http://www.python.org/psf
.SH INTERNET RESOURCES
diff --git a/Misc/python.pc.in b/Misc/python.pc.in
index 08481a9580..ae698674bb 100644
--- a/Misc/python.pc.in
+++ b/Misc/python.pc.in
@@ -1,3 +1,4 @@
+# See: man pkg-config
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
@@ -8,6 +9,5 @@ Description: Python library
Requires:
Version: @VERSION@
Libs.private: @LIBS@
-Libs: -L${libdir} -lpython@VERSION@
-Cflags: -I${includedir}/python@VERSION@
-
+Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@
+Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@
diff --git a/Misc/setuid-prog.c b/Misc/setuid-prog.c
deleted file mode 100644
index 3785d99d7f..0000000000
--- a/Misc/setuid-prog.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- Template for a setuid program that calls a script.
-
- The script should be in an unwritable directory and should itself
- be unwritable. In fact all parent directories up to the root
- should be unwritable. The script must not be setuid, that's what
- this program is for.
-
- This is a template program. You need to fill in the name of the
- script that must be executed. This is done by changing the
- definition of FULL_PATH below.
-
- There are also some rules that should be adhered to when writing
- the script itself.
-
- The first and most important rule is to never, ever trust that the
- user of the program will behave properly. Program defensively.
- Check your arguments for reasonableness. If the user is allowed to
- create files, check the names of the files. If the program depends
- on argv[0] for the action it should perform, check it.
-
- Assuming the script is a Bourne shell script, the first line of the
- script should be
- #!/bin/sh -
- The - is important, don't omit it. If you're using esh, the first
- line should be
- #!/usr/local/bin/esh -f
- and for ksh, the first line should be
- #!/usr/local/bin/ksh -p
- The script should then set the variable IFS to the string
- consisting of <space>, <tab>, and <newline>. After this (*not*
- before!), the PATH variable should be set to a reasonable value and
- exported. Do not expect the PATH to have a reasonable value, so do
- not trust the old value of PATH. You should then set the umask of
- the program by calling
- umask 077 # or 022 if you want the files to be readable
- If you plan to change directories, you should either unset CDPATH
- or set it to a good value. Setting CDPATH to just ``.'' (dot) is a
- good idea.
- If, for some reason, you want to use csh, the first line should be
- #!/bin/csh -fb
- You should then set the path variable to something reasonable,
- without trusting the inherited path. Here too, you should set the
- umask using the command
- umask 077 # or 022 if you want the files to be readable
-*/
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-
-/* CONFIGURATION SECTION */
-
-#ifndef FULL_PATH /* so that this can be specified from the Makefile */
-/* Uncomment the following line:
-#define FULL_PATH "/full/path/of/script"
-* Then comment out the #error line. */
-#error "You must define FULL_PATH somewhere"
-#endif
-#ifndef UMASK
-#define UMASK 077
-#endif
-
-/* END OF CONFIGURATION SECTION */
-
-#if defined(__STDC__) && defined(__sgi)
-#define environ _environ
-#endif
-
-/* don't change def_IFS */
-char def_IFS[] = "IFS= \t\n";
-/* you may want to change def_PATH, but you should really change it in */
-/* your script */
-#ifdef __sgi
-char def_PATH[] = "PATH=/usr/bsd:/usr/bin:/bin:/usr/local/bin:/usr/sbin";
-#else
-char def_PATH[] = "PATH=/usr/ucb:/usr/bin:/bin:/usr/local/bin";
-#endif
-/* don't change def_CDPATH */
-char def_CDPATH[] = "CDPATH=.";
-/* don't change def_ENV */
-char def_ENV[] = "ENV=:";
-
-/*
- This function changes all environment variables that start with LD_
- into variables that start with XD_. This is important since we
- don't want the script that is executed to use any funny shared
- libraries.
-
- The other changes to the environment are, strictly speaking, not
- needed here. They can safely be done in the script. They are done
- here because we don't trust the script writer (just like the script
- writer shouldn't trust the user of the script).
- If IFS is set in the environment, set it to space,tab,newline.
- If CDPATH is set in the environment, set it to ``.''.
- Set PATH to a reasonable default.
-*/
-void
-clean_environ(void)
-{
- char **p;
- extern char **environ;
-
- for (p = environ; *p; p++) {
- if (strncmp(*p, "LD_", 3) == 0)
- **p = 'X';
- else if (strncmp(*p, "_RLD", 4) == 0)
- **p = 'X';
- else if (strncmp(*p, "PYTHON", 6) == 0)
- **p = 'X';
- else if (strncmp(*p, "IFS=", 4) == 0)
- *p = def_IFS;
- else if (strncmp(*p, "CDPATH=", 7) == 0)
- *p = def_CDPATH;
- else if (strncmp(*p, "ENV=", 4) == 0)
- *p = def_ENV;
- }
- putenv(def_PATH);
-}
-
-int
-main(int argc, char **argv)
-{
- struct stat statb;
- gid_t egid = getegid();
- uid_t euid = geteuid();
-
- /*
- Sanity check #1.
- This check should be made compile-time, but that's not possible.
- If you're sure that you specified a full path name for FULL_PATH,
- you can omit this check.
- */
- if (FULL_PATH[0] != '/') {
- fprintf(stderr, "%s: %s is not a full path name\n", argv[0],
- FULL_PATH);
- fprintf(stderr, "You can only use this wrapper if you\n");
- fprintf(stderr, "compile it with an absolute path.\n");
- exit(1);
- }
-
- /*
- Sanity check #2.
- Check that the owner of the script is equal to either the
- effective uid or the super user.
- */
- if (stat(FULL_PATH, &statb) < 0) {
- perror("stat");
- exit(1);
- }
- if (statb.st_uid != 0 && statb.st_uid != euid) {
- fprintf(stderr, "%s: %s has the wrong owner\n", argv[0],
- FULL_PATH);
- fprintf(stderr, "The script should be owned by root,\n");
- fprintf(stderr, "and shouldn't be writable by anyone.\n");
- exit(1);
- }
-
- if (setregid(egid, egid) < 0)
- perror("setregid");
- if (setreuid(euid, euid) < 0)
- perror("setreuid");
-
- clean_environ();
-
- umask(UMASK);
-
- while (**argv == '-') /* don't let argv[0] start with '-' */
- (*argv)++;
- execv(FULL_PATH, argv);
- fprintf(stderr, "%s: could not execute the script\n", argv[0]);
- exit(1);
-}
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index 9f189deb4c..e1c8fe48f8 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -113,6 +113,9 @@ _sre _sre.c # Fredrik Lundh's new regular expressions
_codecs _codecsmodule.c # access to the builtin codecs and codec registry
_weakref _weakref.c # weak references
_functools _functoolsmodule.c # Tools for working with functions and callable objects
+operator operator.c # operator.add() and similar goodies
+_collections _collectionsmodule.c # Container types
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
# access to ISO C locale support
_locale _localemodule.c # -lintl
@@ -157,20 +160,17 @@ _symtable symtablemodule.c
# Modules that should always be present (non UNIX dependent):
#array arraymodule.c # array objects
-#cmath cmathmodule.c # -lm # complex math library functions
-#math mathmodule.c # -lm # math library functions, e.g. sin()
+#cmath cmathmodule.c _math.c # -lm # complex math library functions
+#math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
#_struct _struct.c # binary structure packing/unpacking
#time timemodule.c # -lm # time operations and variables
-#operator operator.c # operator.add() and similar goodies
#_weakref _weakref.c # basic weak reference support
#_testcapi _testcapimodule.c # Python C API test module
#_random _randommodule.c # Random number generator
-#_collections _collectionsmodule.c # Container types
-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
#atexit atexitmodule.c # Register functions to be run at interpreter-shutdown
#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
#_pickle _pickle.c # pickle accelerator
-#datetime datetimemodule.c # date/time type
+#_datetime _datetimemodule.c # datetime accelerator
#_bisect _bisectmodule.c # Bisection algorithms
#_heapq _heapqmodule.c # Heap queue algorithm
@@ -217,6 +217,7 @@ _symtable symtablemodule.c
#termios termios.c # Steen Lumholt's termios module
#resource resource.c # Jeremy Hylton's rlimit interface
+#_posixsubprocess _posixsubprocess.c # POSIX subprocess module helper
# Multimedia modules -- off by default.
# These don't work for 64-bit platforms!!!
diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c
index f65a583720..7fecfc6937 100644
--- a/Modules/_bisectmodule.c
+++ b/Modules/_bisectmodule.c
@@ -86,8 +86,7 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw)
if (PyList_Insert(list, index, item) < 0)
return NULL;
} else {
- result = PyObject_CallMethod(list, "insert", "nO",
- index, item);
+ result = PyObject_CallMethod(list, "insert", "nO", index, item);
if (result == NULL)
return NULL;
Py_DECREF(result);
@@ -187,8 +186,7 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw)
if (PyList_Insert(list, index, item) < 0)
return NULL;
} else {
- result = PyObject_CallMethod(list, "insert", "iO",
- index, item);
+ result = PyObject_CallMethod(list, "insert", "iO", index, item);
if (result == NULL)
return NULL;
Py_DECREF(result);
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c
index aac44703ad..eb740f95fd 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -639,21 +639,6 @@ readbuffer_encode(PyObject *self,
}
static PyObject *
-charbuffer_encode(PyObject *self,
- PyObject *args)
-{
- const char *data;
- Py_ssize_t size;
- const char *errors = NULL;
-
- if (!PyArg_ParseTuple(args, "t#|z:charbuffer_encode",
- &data, &size, &errors))
- return NULL;
-
- return codec_tuple(PyBytes_FromStringAndSize(data, size), size);
-}
-
-static PyObject *
unicode_internal_encode(PyObject *self,
PyObject *args)
{
@@ -1116,7 +1101,6 @@ static PyMethodDef _codecs_functions[] = {
{"charmap_decode", charmap_decode, METH_VARARGS},
{"charmap_build", charmap_build, METH_VARARGS},
{"readbuffer_encode", readbuffer_encode, METH_VARARGS},
- {"charbuffer_encode", charbuffer_encode, METH_VARARGS},
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
{"mbcs_encode", mbcs_encode, METH_VARARGS},
{"mbcs_decode", mbcs_decode, METH_VARARGS},
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index b5f2a693af..5545d1eff2 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -462,6 +462,91 @@ deque_rotate(dequeobject *deque, PyObject *args)
PyDoc_STRVAR(rotate_doc,
"Rotate the deque n steps to the right (default n=1). If n is negative, rotates left.");
+static PyObject *
+deque_reverse(dequeobject *deque, PyObject *unused)
+{
+ block *leftblock = deque->leftblock;
+ block *rightblock = deque->rightblock;
+ Py_ssize_t leftindex = deque->leftindex;
+ Py_ssize_t rightindex = deque->rightindex;
+ Py_ssize_t n = (deque->len)/2;
+ Py_ssize_t i;
+ PyObject *tmp;
+
+ for (i=0 ; i<n ; i++) {
+ /* Validate that pointers haven't met in the middle */
+ assert(leftblock != rightblock || leftindex < rightindex);
+
+ /* Swap */
+ tmp = leftblock->data[leftindex];
+ leftblock->data[leftindex] = rightblock->data[rightindex];
+ rightblock->data[rightindex] = tmp;
+
+ /* Advance left block/index pair */
+ leftindex++;
+ if (leftindex == BLOCKLEN) {
+ if (leftblock->rightlink == NULL)
+ break;
+ leftblock = leftblock->rightlink;
+ leftindex = 0;
+ }
+
+ /* Step backwards with the right block/index pair */
+ rightindex--;
+ if (rightindex == -1) {
+ if (rightblock->leftlink == NULL)
+ break;
+ rightblock = rightblock->leftlink;
+ rightindex = BLOCKLEN - 1;
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(reverse_doc,
+"D.reverse() -- reverse *IN PLACE*");
+
+static PyObject *
+deque_count(dequeobject *deque, PyObject *v)
+{
+ block *leftblock = deque->leftblock;
+ Py_ssize_t leftindex = deque->leftindex;
+ Py_ssize_t n = deque->len;
+ Py_ssize_t i;
+ Py_ssize_t count = 0;
+ PyObject *item;
+ long start_state = deque->state;
+ int cmp;
+
+ for (i=0 ; i<n ; i++) {
+ item = leftblock->data[leftindex];
+ cmp = PyObject_RichCompareBool(item, v, Py_EQ);
+ if (cmp > 0)
+ count++;
+ else if (cmp < 0)
+ return NULL;
+
+ if (start_state != deque->state) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "deque mutated during iteration");
+ return NULL;
+ }
+
+ /* Advance left block/index pair */
+ leftindex++;
+ if (leftindex == BLOCKLEN) {
+ if (leftblock->rightlink == NULL) /* can occur when i==n-1 */
+ break;
+ leftblock = leftblock->rightlink;
+ leftindex = 0;
+ }
+ }
+ return PyLong_FromSsize_t(count);
+}
+
+PyDoc_STRVAR(count_doc,
+"D.count(value) -> integer -- return number of occurrences of value");
+
static Py_ssize_t
deque_len(dequeobject *deque)
{
@@ -891,6 +976,8 @@ static PyMethodDef deque_methods[] = {
METH_NOARGS, clear_doc},
{"__copy__", (PyCFunction)deque_copy,
METH_NOARGS, copy_doc},
+ {"count", (PyCFunction)deque_count,
+ METH_O, count_doc},
{"extend", (PyCFunction)deque_extend,
METH_O, extend_doc},
{"extendleft", (PyCFunction)deque_extendleft,
@@ -905,6 +992,8 @@ static PyMethodDef deque_methods[] = {
METH_O, remove_doc},
{"__reversed__", (PyCFunction)deque_reviter,
METH_NOARGS, reversed_doc},
+ {"reverse", (PyCFunction)deque_reverse,
+ METH_NOARGS, reverse_doc},
{"rotate", (PyCFunction)deque_rotate,
METH_VARARGS, rotate_doc},
{NULL, NULL} /* sentinel */
@@ -930,24 +1019,24 @@ static PyTypeObject deque_type = {
0, /* tp_as_number */
&deque_as_sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
- (hashfunc)PyObject_HashNotImplemented, /* tp_hash */
+ PyObject_HashNotImplemented, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
- /* tp_flags */
+ /* tp_flags */
deque_doc, /* tp_doc */
(traverseproc)deque_traverse, /* tp_traverse */
(inquiry)deque_clear, /* tp_clear */
(richcmpfunc)deque_richcompare, /* tp_richcompare */
- offsetof(dequeobject, weakreflist), /* tp_weaklistoffset*/
+ offsetof(dequeobject, weakreflist), /* tp_weaklistoffset*/
(getiterfunc)deque_iter, /* tp_iter */
0, /* tp_iternext */
deque_methods, /* tp_methods */
0, /* tp_members */
- deque_getset, /* tp_getset */
+ deque_getset, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
@@ -1432,6 +1521,95 @@ static PyTypeObject defdict_type = {
PyObject_GC_Del, /* tp_free */
};
+/* helper function for Counter *********************************************/
+
+PyDoc_STRVAR(_count_elements_doc,
+"_count_elements(mapping, iterable) -> None\n\
+\n\
+Count elements in the iterable, updating the mappping");
+
+static PyObject *
+_count_elements(PyObject *self, PyObject *args)
+{
+ PyObject *it, *iterable, *mapping, *oldval;
+ PyObject *newval = NULL;
+ PyObject *key = NULL;
+ PyObject *one = NULL;
+
+ if (!PyArg_UnpackTuple(args, "_count_elements", 2, 2, &mapping, &iterable))
+ return NULL;
+
+ it = PyObject_GetIter(iterable);
+ if (it == NULL)
+ return NULL;
+
+ one = PyLong_FromLong(1);
+ if (one == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+
+ if (PyDict_CheckExact(mapping)) {
+ while (1) {
+ key = PyIter_Next(it);
+ if (key == NULL) {
+ if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration))
+ PyErr_Clear();
+ else
+ break;
+ }
+ oldval = PyDict_GetItem(mapping, key);
+ if (oldval == NULL) {
+ if (PyDict_SetItem(mapping, key, one) == -1)
+ break;
+ } else {
+ newval = PyNumber_Add(oldval, one);
+ if (newval == NULL)
+ break;
+ if (PyDict_SetItem(mapping, key, newval) == -1)
+ break;
+ Py_CLEAR(newval);
+ }
+ Py_DECREF(key);
+ }
+ } else {
+ while (1) {
+ key = PyIter_Next(it);
+ if (key == NULL) {
+ if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration))
+ PyErr_Clear();
+ else
+ break;
+ }
+ oldval = PyObject_GetItem(mapping, key);
+ if (oldval == NULL) {
+ if (!PyErr_Occurred() || !PyErr_ExceptionMatches(PyExc_KeyError))
+ break;
+ PyErr_Clear();
+ Py_INCREF(one);
+ newval = one;
+ } else {
+ newval = PyNumber_Add(oldval, one);
+ Py_DECREF(oldval);
+ if (newval == NULL)
+ break;
+ }
+ if (PyObject_SetItem(mapping, key, newval) == -1)
+ break;
+ Py_CLEAR(newval);
+ Py_DECREF(key);
+ }
+ }
+
+ Py_DECREF(it);
+ Py_XDECREF(key);
+ Py_XDECREF(newval);
+ Py_DECREF(one);
+ if (PyErr_Occurred())
+ return NULL;
+ Py_RETURN_NONE;
+}
+
/* module level code ********************************************************/
PyDoc_STRVAR(module_doc,
@@ -1440,13 +1618,17 @@ PyDoc_STRVAR(module_doc,
- defaultdict: dict subclass with a default value factory\n\
");
+static struct PyMethodDef module_functions[] = {
+ {"_count_elements", _count_elements, METH_VARARGS, _count_elements_doc},
+ {NULL, NULL} /* sentinel */
+};
static struct PyModuleDef _collectionsmodule = {
PyModuleDef_HEAD_INIT,
"_collections",
module_doc,
-1,
- NULL,
+ module_functions,
NULL,
NULL,
NULL,
diff --git a/Modules/_csv.c b/Modules/_csv.c
index 4584abc0a8..a749cec0a5 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -248,7 +248,7 @@ _set_str(const char *name, PyObject **target, PyObject *src, const char *dflt)
static int
dialect_check_quoting(int quoting)
{
- StyleDesc *qs = quote_styles;
+ StyleDesc *qs;
for (qs = quote_styles; qs->name; qs++) {
if (qs->style == quoting)
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index bdf7ab4f45..8e8598002d 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -132,8 +132,6 @@ static PyTypeObject Simple_Type;
/* a callable object used for unpickling */
static PyObject *_unpickle;
-char *_ctypes_conversion_encoding = NULL;
-char *_ctypes_conversion_errors = NULL;
/****************************************************************/
@@ -1096,13 +1094,7 @@ CharArray_set_value(CDataObject *self, PyObject *value)
return -1;
}
- if (PyUnicode_Check(value)) {
- value = PyUnicode_AsEncodedString(value,
- _ctypes_conversion_encoding,
- _ctypes_conversion_errors);
- if (!value)
- return -1;
- } else if (!PyBytes_Check(value)) {
+ if (!PyBytes_Check(value)) {
PyErr_Format(PyExc_TypeError,
"str/bytes expected instead of %s instance",
Py_TYPE(value)->tp_name);
@@ -1156,13 +1148,7 @@ WCharArray_set_value(CDataObject *self, PyObject *value)
"can't delete attribute");
return -1;
}
- if (PyBytes_Check(value)) {
- value = PyUnicode_FromEncodedObject(value,
- _ctypes_conversion_encoding,
- _ctypes_conversion_errors);
- if (!value)
- return -1;
- } else if (!PyUnicode_Check(value)) {
+ if (!PyUnicode_Check(value)) {
PyErr_Format(PyExc_TypeError,
"unicode string expected instead of %s instance",
Py_TYPE(value)->tp_name);
@@ -1175,7 +1161,7 @@ WCharArray_set_value(CDataObject *self, PyObject *value)
result = -1;
goto done;
}
- result = PyUnicode_AsWideChar((PyUnicodeObject *)value,
+ result = PyUnicode_AsWideChar(value,
(wchar_t *)self->b_ptr,
self->b_size/sizeof(wchar_t));
if (result >= 0 && (size_t)result < self->b_size/sizeof(wchar_t))
@@ -1521,7 +1507,7 @@ c_char_p_from_param(PyObject *type, PyObject *value)
Py_INCREF(Py_None);
return Py_None;
}
- if (PyBytes_Check(value) || PyUnicode_Check(value)) {
+ if (PyBytes_Check(value)) {
PyCArgObject *parg;
struct fielddesc *fd = _ctypes_get_fielddesc("z");
@@ -2519,7 +2505,7 @@ static PyBufferProcs PyCData_as_buffer = {
/*
* CData objects are mutable, so they cannot be hashable!
*/
-static long
+static Py_hash_t
PyCData_nohash(PyObject *self)
{
PyErr_SetString(PyExc_TypeError, "unhashable type");
@@ -3398,7 +3384,7 @@ PyCFuncPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
self->callable = callable;
self->thunk = thunk;
- *(void **)self->b_ptr = (void *)thunk->pcl;
+ *(void **)self->b_ptr = (void *)thunk->pcl_exec;
Py_INCREF((PyObject *)thunk); /* for KeepRef */
if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
@@ -3970,14 +3956,14 @@ PyTypeObject PyCFuncPtr_Type = {
Returns -1 on error, or the index of next argument on success.
*/
-static int
+static Py_ssize_t
_init_pos_args(PyObject *self, PyTypeObject *type,
PyObject *args, PyObject *kwds,
- int index)
+ Py_ssize_t index)
{
StgDictObject *dict;
PyObject *fields;
- int i;
+ Py_ssize_t i;
if (PyType_stgdict((PyObject *)type->tp_base)) {
index = _init_pos_args(self, type->tp_base,
@@ -4219,7 +4205,7 @@ Array_subscript(PyObject *_self, PyObject *item)
PyObject *np;
Py_ssize_t start, stop, step, slicelen, cur, i;
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
self->b_length, &start, &stop,
&step, &slicelen) < 0) {
return NULL;
@@ -4353,7 +4339,7 @@ Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value)
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelen, otherlen, i, cur;
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
self->b_length, &start, &stop,
&step, &slicelen) < 0) {
return -1;
@@ -4498,7 +4484,7 @@ PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length)
#endif
result = PyObject_CallFunction((PyObject *)&PyCArrayType_Type,
- "U(O){s:n,s:O}",
+ "s(O){s:n,s:O}",
name,
&PyCArray_Type,
"_length_",
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index 490ada6248..d23509fbe2 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -16,8 +16,8 @@ CThunkObject_dealloc(PyObject *_self)
Py_XDECREF(self->converters);
Py_XDECREF(self->callable);
Py_XDECREF(self->restype);
- if (self->pcl)
- _ctypes_free_closure(self->pcl);
+ if (self->pcl_write)
+ ffi_closure_free(self->pcl_write);
PyObject_GC_Del(self);
}
@@ -94,41 +94,13 @@ PrintError(char *msg, ...)
/* after code that pyrex generates */
void _ctypes_add_traceback(char *funcname, char *filename, int lineno)
{
- PyObject *py_srcfile = 0;
- PyObject *py_funcname = 0;
PyObject *py_globals = 0;
- PyObject *empty_tuple = 0;
- PyObject *empty_string = 0;
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
- py_srcfile = PyUnicode_DecodeFSDefault(filename);
- if (!py_srcfile) goto bad;
- py_funcname = PyUnicode_FromString(funcname);
- if (!py_funcname) goto bad;
py_globals = PyDict_New();
if (!py_globals) goto bad;
- empty_tuple = PyTuple_New(0);
- if (!empty_tuple) goto bad;
- empty_string = PyBytes_FromString("");
- if (!empty_string) goto bad;
- py_code = PyCode_New(
- 0, /*int argcount,*/
- 0, /*int kwonlyargcount,*/
- 0, /*int nlocals,*/
- 0, /*int stacksize,*/
- 0, /*int flags,*/
- empty_string, /*PyObject *code,*/
- empty_tuple, /*PyObject *consts,*/
- empty_tuple, /*PyObject *names,*/
- empty_tuple, /*PyObject *varnames,*/
- empty_tuple, /*PyObject *freevars,*/
- empty_tuple, /*PyObject *cellvars,*/
- py_srcfile, /*PyObject *filename,*/
- py_funcname, /*PyObject *name,*/
- lineno, /*int firstlineno,*/
- empty_string /*PyObject *lnotab*/
- );
+ py_code = PyCode_NewEmpty(filename, funcname, lineno);
if (!py_code) goto bad;
py_frame = PyFrame_New(
PyThreadState_Get(), /*PyThreadState *tstate,*/
@@ -141,10 +113,6 @@ void _ctypes_add_traceback(char *funcname, char *filename, int lineno)
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_globals);
- Py_XDECREF(py_srcfile);
- Py_XDECREF(py_funcname);
- Py_XDECREF(empty_tuple);
- Py_XDECREF(empty_string);
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
@@ -370,7 +338,8 @@ static CThunkObject* CThunkObject_new(Py_ssize_t nArgs)
return NULL;
}
- p->pcl = NULL;
+ p->pcl_exec = NULL;
+ p->pcl_write = NULL;
memset(&p->cif, 0, sizeof(p->cif));
p->converters = NULL;
p->callable = NULL;
@@ -400,8 +369,9 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
assert(CThunk_CheckExact((PyObject *)p));
- p->pcl = _ctypes_alloc_closure();
- if (p->pcl == NULL) {
+ p->pcl_write = ffi_closure_alloc(sizeof(ffi_closure),
+ &p->pcl_exec);
+ if (p->pcl_write == NULL) {
PyErr_NoMemory();
goto error;
}
@@ -446,7 +416,13 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
"ffi_prep_cif failed with %d", result);
goto error;
}
- result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
+#if defined(X86_DARWIN) || defined(POWERPC_DARWIN)
+ result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
+#else
+ result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
+ p,
+ p->pcl_exec);
+#endif
if (result != FFI_OK) {
PyErr_Format(PyExc_RuntimeError,
"ffi_prep_closure failed with %d", result);
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 41a90f6647..1f3c1c0185 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -658,31 +658,22 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
#ifdef CTYPES_UNICODE
if (PyUnicode_Check(obj)) {
-#ifdef HAVE_USABLE_WCHAR_T
+#if Py_UNICODE_SIZE == SIZEOF_WCHAR_T
pa->ffi_type = &ffi_type_pointer;
pa->value.p = PyUnicode_AS_UNICODE(obj);
Py_INCREF(obj);
pa->keep = obj;
return 0;
#else
- int size = PyUnicode_GET_SIZE(obj);
pa->ffi_type = &ffi_type_pointer;
- size += 1; /* terminating NUL */
- size *= sizeof(wchar_t);
- pa->value.p = PyMem_Malloc(size);
- if (!pa->value.p) {
- PyErr_NoMemory();
+ pa->value.p = PyUnicode_AsWideCharString(obj, NULL);
+ if (pa->value.p == NULL)
return -1;
- }
- memset(pa->value.p, 0, size);
pa->keep = PyCapsule_New(pa->value.p, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
if (!pa->keep) {
PyMem_Free(pa->value.p);
return -1;
}
- if (-1 == PyUnicode_AsWideChar((PyUnicodeObject *)obj,
- pa->value.p, PyUnicode_GET_SIZE(obj)))
- return -1;
return 0;
#endif
}
@@ -814,7 +805,7 @@ static int _call_function_pointer(int flags,
#endif
delta =
#endif
- ffi_call(&cif, (void *)pProc, resmem, avalues);
+ ffi_call(&cif, (void *)pProc, resmem, avalues);
#ifdef MS_WIN32
#ifndef DONT_USE_SEH
}
@@ -849,29 +840,29 @@ static int _call_function_pointer(int flags,
#ifdef MS_WIN64
if (delta != 0) {
PyErr_Format(PyExc_RuntimeError,
- "ffi_call failed with code %d",
- delta);
+ "ffi_call failed with code %d",
+ delta);
return -1;
}
#else
if (delta < 0) {
if (flags & FUNCFLAG_CDECL)
PyErr_Format(PyExc_ValueError,
- "Procedure called with not enough "
- "arguments (%d bytes missing) "
- "or wrong calling convention",
- -delta);
+ "Procedure called with not enough "
+ "arguments (%d bytes missing) "
+ "or wrong calling convention",
+ -delta);
else
PyErr_Format(PyExc_ValueError,
- "Procedure probably called with not enough "
- "arguments (%d bytes missing)",
- -delta);
+ "Procedure probably called with not enough "
+ "arguments (%d bytes missing)",
+ -delta);
return -1;
} else if (delta > 0) {
PyErr_Format(PyExc_ValueError,
- "Procedure probably called with too many "
- "arguments (%d bytes in excess)",
- delta);
+ "Procedure probably called with too many "
+ "arguments (%d bytes in excess)",
+ delta);
return -1;
}
#endif
@@ -1641,37 +1632,6 @@ My_Py_DECREF(PyObject *self, PyObject *arg)
return arg;
}
-#ifdef CTYPES_UNICODE
-
-static char set_conversion_mode_doc[] =
-"set_conversion_mode(encoding, errors) -> (previous-encoding, previous-errors)\n\
-\n\
-Set the encoding and error handling ctypes uses when converting\n\
-between unicode and strings. Returns the previous values.\n";
-
-static PyObject *
-set_conversion_mode(PyObject *self, PyObject *args)
-{
- char *coding, *mode;
- PyObject *result;
-
- if (!PyArg_ParseTuple(args, "zs:set_conversion_mode", &coding, &mode))
- return NULL;
- result = Py_BuildValue("(zz)", _ctypes_conversion_encoding, _ctypes_conversion_errors);
- if (coding) {
- PyMem_Free(_ctypes_conversion_encoding);
- _ctypes_conversion_encoding = PyMem_Malloc(strlen(coding) + 1);
- strcpy(_ctypes_conversion_encoding, coding);
- } else {
- _ctypes_conversion_encoding = NULL;
- }
- PyMem_Free(_ctypes_conversion_errors);
- _ctypes_conversion_errors = PyMem_Malloc(strlen(mode) + 1);
- strcpy(_ctypes_conversion_errors, mode);
- return result;
-}
-#endif
-
static PyObject *
resize(PyObject *self, PyObject *args)
{
@@ -1852,9 +1812,6 @@ PyMethodDef _ctypes_module_methods[] = {
{"_unpickle", unpickle, METH_VARARGS },
{"buffer_info", buffer_info, METH_O, "Return buffer interface information"},
{"resize", resize, METH_VARARGS, "Resize the memory buffer of a ctypes instance"},
-#ifdef CTYPES_UNICODE
- {"set_conversion_mode", set_conversion_mode, METH_VARARGS, set_conversion_mode_doc},
-#endif
#ifdef MS_WIN32
{"get_last_error", get_last_error, METH_NOARGS},
{"set_last_error", set_last_error, METH_VARARGS},
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index 441ed9e447..ccaa3c9d70 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -9,6 +9,7 @@
#define CTYPES_CFIELD_CAPSULE_NAME_PYMEM "_ctypes/cfield.c pymem"
+#if Py_UNICODE_SIZE != SIZEOF_WCHAR_T
static void pymem_destructor(PyObject *ptr)
{
void *p = PyCapsule_GetPointer(ptr, CTYPES_CFIELD_CAPSULE_NAME_PYMEM);
@@ -16,6 +17,7 @@ static void pymem_destructor(PyObject *ptr)
PyMem_Free(p);
}
}
+#endif
/******************************************************************/
@@ -1168,20 +1170,6 @@ O_set(void *ptr, PyObject *value, Py_ssize_t size)
static PyObject *
c_set(void *ptr, PyObject *value, Py_ssize_t size)
{
- if (PyUnicode_Check(value)) {
- value = PyUnicode_AsEncodedString(value,
- _ctypes_conversion_encoding,
- _ctypes_conversion_errors);
- if (value == NULL)
- return NULL;
- if (PyBytes_GET_SIZE(value) != 1) {
- Py_DECREF(value);
- goto error;
- }
- *(char *)ptr = PyBytes_AS_STRING(value)[0];
- Py_DECREF(value);
- _RET(value);
- }
if (PyBytes_Check(value) && PyBytes_GET_SIZE(value) == 1) {
*(char *)ptr = PyBytes_AS_STRING(value)[0];
_RET(value);
@@ -1217,13 +1205,8 @@ static PyObject *
u_set(void *ptr, PyObject *value, Py_ssize_t size)
{
Py_ssize_t len;
- if (PyBytes_Check(value)) {
- value = PyUnicode_FromEncodedObject(value,
- _ctypes_conversion_encoding,
- _ctypes_conversion_errors);
- if (!value)
- return NULL;
- } else if (!PyUnicode_Check(value)) {
+ wchar_t chars[2];
+ if (!PyUnicode_Check(value)) {
PyErr_Format(PyExc_TypeError,
"unicode string expected instead of %s instance",
value->ob_type->tp_name);
@@ -1231,7 +1214,7 @@ u_set(void *ptr, PyObject *value, Py_ssize_t size)
} else
Py_INCREF(value);
- len = PyUnicode_GET_SIZE(value);
+ len = PyUnicode_AsWideChar(value, chars, 2);
if (len != 1) {
Py_DECREF(value);
PyErr_SetString(PyExc_TypeError,
@@ -1239,7 +1222,7 @@ u_set(void *ptr, PyObject *value, Py_ssize_t size)
return NULL;
}
- *(wchar_t *)ptr = PyUnicode_AS_UNICODE(value)[0];
+ *(wchar_t *)ptr = chars[0];
Py_DECREF(value);
_RET(value);
@@ -1292,13 +1275,7 @@ U_set(void *ptr, PyObject *value, Py_ssize_t length)
/* It's easier to calculate in characters than in bytes */
length /= sizeof(wchar_t);
- if (PyBytes_Check(value)) {
- value = PyUnicode_FromEncodedObject(value,
- _ctypes_conversion_encoding,
- _ctypes_conversion_errors);
- if (!value)
- return NULL;
- } else if (!PyUnicode_Check(value)) {
+ if (!PyUnicode_Check(value)) {
PyErr_Format(PyExc_TypeError,
"unicode string expected instead of %s instance",
value->ob_type->tp_name);
@@ -1315,7 +1292,7 @@ U_set(void *ptr, PyObject *value, Py_ssize_t length)
} else if (size < length-1)
/* copy terminating NUL character if there is space */
size += 1;
- PyUnicode_AsWideChar((PyUnicodeObject *)value, (wchar_t *)ptr, size);
+ PyUnicode_AsWideChar(value, (wchar_t *)ptr, size);
return value;
}
@@ -1333,7 +1310,7 @@ s_get(void *ptr, Py_ssize_t size)
break;
}
- return PyUnicode_FromStringAndSize((char *)ptr, (Py_ssize_t)i);
+ return PyBytes_FromStringAndSize((char *)ptr, (Py_ssize_t)i);
}
static PyObject *
@@ -1342,14 +1319,7 @@ s_set(void *ptr, PyObject *value, Py_ssize_t length)
char *data;
Py_ssize_t size;
- if (PyUnicode_Check(value)) {
- value = PyUnicode_AsEncodedString(value,
- _ctypes_conversion_encoding,
- _ctypes_conversion_errors);
- if (value == NULL)
- return NULL;
- assert(PyBytes_Check(value));
- } else if(PyBytes_Check(value)) {
+ if(PyBytes_Check(value)) {
Py_INCREF(value);
} else {
PyErr_Format(PyExc_TypeError,
@@ -1393,14 +1363,6 @@ z_set(void *ptr, PyObject *value, Py_ssize_t size)
*(char **)ptr = PyBytes_AsString(value);
Py_INCREF(value);
return value;
- } else if (PyUnicode_Check(value)) {
- PyObject *str = PyUnicode_AsEncodedString(value,
- _ctypes_conversion_encoding,
- _ctypes_conversion_errors);
- if (str == NULL)
- return NULL;
- *(char **)ptr = PyBytes_AS_STRING(str);
- return str;
} else if (PyLong_Check(value)) {
#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
*(char **)ptr = (char *)PyLong_AsUnsignedLongLongMask(value);
@@ -1454,25 +1416,18 @@ Z_set(void *ptr, PyObject *value, Py_ssize_t size)
Py_INCREF(Py_None);
return Py_None;
}
- if (PyBytes_Check(value)) {
- value = PyUnicode_FromEncodedObject(value,
- _ctypes_conversion_encoding,
- _ctypes_conversion_errors);
- if (!value)
- return NULL;
- } else if (!PyUnicode_Check(value)) {
+ if (!PyUnicode_Check(value)) {
PyErr_Format(PyExc_TypeError,
"unicode string or integer address expected instead of %s instance",
value->ob_type->tp_name);
return NULL;
} else
Py_INCREF(value);
-#ifdef HAVE_USABLE_WCHAR_T
- /* HAVE_USABLE_WCHAR_T means that Py_UNICODE and wchar_t is the same
- type. So we can copy directly. Hm, are unicode objects always NUL
+#if Py_UNICODE_SIZE == SIZEOF_WCHAR_T
+ /* We can copy directly. Hm, are unicode objects always NUL
terminated in Python, internally?
*/
- *(wchar_t **)ptr = PyUnicode_AS_UNICODE(value);
+ *(wchar_t **)ptr = (wchar_t *) PyUnicode_AS_UNICODE(value);
return value;
#else
{
@@ -1481,15 +1436,11 @@ Z_set(void *ptr, PyObject *value, Py_ssize_t size)
PyObject *keep;
wchar_t *buffer;
- int size = PyUnicode_GET_SIZE(value);
- size += 1; /* terminating NUL */
- size *= sizeof(wchar_t);
- buffer = (wchar_t *)PyMem_Malloc(size);
+ buffer = PyUnicode_AsWideCharString(value, NULL);
if (!buffer) {
Py_DECREF(value);
- return PyErr_NoMemory();
+ return NULL;
}
- memset(buffer, 0, size);
keep = PyCapsule_New(buffer, CTYPES_CFIELD_CAPSULE_NAME_PYMEM, pymem_destructor);
if (!keep) {
Py_DECREF(value);
@@ -1497,12 +1448,6 @@ Z_set(void *ptr, PyObject *value, Py_ssize_t size)
return NULL;
}
*(wchar_t **)ptr = (wchar_t *)buffer;
- if (-1 == PyUnicode_AsWideChar((PyUnicodeObject *)value,
- buffer, PyUnicode_GET_SIZE(value))) {
- Py_DECREF(value);
- Py_DECREF(keep);
- return NULL;
- }
Py_DECREF(value);
return keep;
}
@@ -1540,12 +1485,6 @@ BSTR_set(void *ptr, PyObject *value, Py_ssize_t size)
/* convert value into a PyUnicodeObject or NULL */
if (Py_None == value) {
value = NULL;
- } else if (PyBytes_Check(value)) {
- value = PyUnicode_FromEncodedObject(value,
- _ctypes_conversion_encoding,
- _ctypes_conversion_errors);
- if (!value)
- return NULL;
} else if (PyUnicode_Check(value)) {
Py_INCREF(value); /* for the descref below */
} else {
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
index 0af5fa1ddf..27abe65145 100644
--- a/Modules/_ctypes/ctypes.h
+++ b/Modules/_ctypes/ctypes.h
@@ -58,7 +58,8 @@ struct tagCDataObject {
typedef struct {
PyObject_VAR_HEAD
- ffi_closure *pcl; /* the C callable */
+ ffi_closure *pcl_write; /* the C callable, writeable */
+ void *pcl_exec; /* the C callable, executable */
ffi_cif cif;
int flags;
PyObject *converters;
diff --git a/Modules/_ctypes/libffi.diff b/Modules/_ctypes/libffi.diff
index 6765902ed0..7afa0ed1f9 100644
--- a/Modules/_ctypes/libffi.diff
+++ b/Modules/_ctypes/libffi.diff
@@ -1,43 +1,17 @@
-This file contains the diffs between the files in the libffi
-subdirectory and the 'official' source files from
-ftp://sourceware.org/pub/libffi/libffi-3.0.5.tar.gz
-
-Index: libffi/aclocal.m4
-===================================================================
---- libffi/aclocal.m4 (working copy)
-+++ libffi/aclocal.m4 (revision 72475)
-@@ -1155,7 +1155,7 @@
- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-- # We can hardcode non-existant directories.
-+ # We can hardcode non-existent directories.
- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
-Index: libffi/configure.ac
-===================================================================
---- libffi/configure.ac (working copy)
-+++ libffi/configure.ac (revision 72475)
-@@ -1,4 +1,7 @@
- dnl Process this with autoconf to create configure
-+#
-+# file from libffi - slightly patched for ctypes
-+#
-
- AC_PREREQ(2.59)
-
-@@ -83,6 +86,9 @@
- i?86-*-solaris2.1[[0-9]]*)
+diff -urN libffi.orig/configure libffi/configure
+--- libffi.orig/configure 2010-03-19 18:29:54.588499862 +0100
++++ libffi/configure 2010-03-19 18:32:09.113499479 +0100
+@@ -11228,6 +11228,9 @@
+ i?86-*-solaris2.1[0-9]*)
TARGET=X86_64; TARGETDIR=x86
;;
-+ i*86-*-nto-qnx*)
++ i*86-*-nto-qnx*)
+ TARGET=X86; TARGETDIR=x86
+ ;;
i?86-*-*)
TARGET=X86; TARGETDIR=x86
;;
-@@ -100,10 +106,10 @@
+@@ -11245,12 +11248,12 @@
;;
mips-sgi-irix5.* | mips-sgi-irix6.*)
@@ -45,83 +19,66 @@ Index: libffi/configure.ac
+ TARGET=MIPS_IRIX; TARGETDIR=mips
;;
mips*-*-linux*)
+ # Support 128-bit long double for NewABI.
+ HAVE_LONG_DOUBLE='defined(__mips64)'
- TARGET=MIPS; TARGETDIR=mips
-+ TARGET=MIPS_LINUX; TARGETDIR=mips
++ TARGET=MIPS_IRIX; TARGETDIR=mips
;;
powerpc*-*-linux* | powerpc-*-sysv*)
-@@ -156,7 +162,7 @@
- AC_MSG_ERROR(["libffi has not been ported to $host."])
+@@ -11307,7 +11310,7 @@
+ as_fn_error "\"libffi has not been ported to $host.\"" "$LINENO" 5
fi
--AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
-+AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null])
- AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
- AM_CONDITIONAL(X86, test x$TARGET = xX86)
- AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD)
-@@ -360,6 +366,10 @@
-
- AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
+- if test x$TARGET = xMIPS; then
++ if expr x$TARGET : 'xMIPS' > /dev/null; then
+ MIPS_TRUE=
+ MIPS_FALSE='#'
+ else
+@@ -12422,6 +12425,12 @@
+ ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
--AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
-+AC_CONFIG_FILES(include/ffi.h)
-+AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h)
++ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h"
+
-+AC_CONFIG_FILES(fficonfig.py)
+
- AC_OUTPUT
-Index: libffi/configure
-===================================================================
---- libffi/configure (working copy)
-+++ libffi/configure (revision 72475)
-@@ -9546,7 +9546,7 @@
- test -n "$runpath_var" || \
- test "X$hardcode_automatic" = "Xyes" ; then
-
-- # We can hardcode non-existant directories.
-+ # We can hardcode non-existent directories.
- if test "$hardcode_direct" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
-@@ -13514,7 +13514,7 @@
- test -n "$runpath_var_CXX" || \
- test "X$hardcode_automatic_CXX" = "Xyes" ; then
++ac_config_files="$ac_config_files fficonfig.py"
++
++
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+ # tests run on this system so they can be shared between configure
+@@ -13521,6 +13530,8 @@
+ "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
+ "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+ "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
++ "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
++ "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
-- # We can hardcode non-existant directories.
-+ # We can hardcode non-existent directories.
- if test "$hardcode_direct_CXX" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
-@@ -16117,7 +16117,7 @@
- test -n "$runpath_var_F77" || \
- test "X$hardcode_automatic_F77" = "Xyes" ; then
+ *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+diff -urN libffi.orig/configure.ac libffi/configure.ac
+--- libffi.orig/configure.ac 2010-03-19 18:27:44.988498585 +0100
++++ libffi/configure.ac 2010-03-19 18:31:29.252505178 +0100
+@@ -1,4 +1,7 @@
+ dnl Process this with autoconf to create configure
++#
++# file from libffi - slightly patched for ctypes
++#
-- # We can hardcode non-existant directories.
-+ # We can hardcode non-existent directories.
- if test "$hardcode_direct_F77" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
-@@ -18720,7 +18720,7 @@
- test -n "$runpath_var_GCJ" || \
- test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+ AC_PREREQ(2.63)
-- # We can hardcode non-existant directories.
-+ # We can hardcode non-existent directories.
- if test "$hardcode_direct_GCJ" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
-@@ -20406,6 +20406,9 @@
- i?86-*-solaris2.1[0-9]*)
+@@ -91,6 +94,9 @@
+ i?86-*-solaris2.1[[0-9]]*)
TARGET=X86_64; TARGETDIR=x86
;;
-+ i*86-*-nto-qnx*)
++ i*86-*-nto-qnx*)
+ TARGET=X86; TARGETDIR=x86
+ ;;
i?86-*-*)
TARGET=X86; TARGETDIR=x86
;;
-@@ -20423,10 +20426,10 @@
+@@ -108,12 +114,12 @@
;;
mips-sgi-irix5.* | mips-sgi-irix6.*)
@@ -129,79 +86,28 @@ Index: libffi/configure
+ TARGET=MIPS_IRIX; TARGETDIR=mips
;;
mips*-*-linux*)
+ # Support 128-bit long double for NewABI.
+ HAVE_LONG_DOUBLE='defined(__mips64)'
- TARGET=MIPS; TARGETDIR=mips
-+ TARGET=MIPS_LINUX; TARGETDIR=mips
++ TARGET=MIPS_IRIX; TARGETDIR=mips
;;
powerpc*-*-linux* | powerpc-*-sysv*)
-@@ -20481,7 +20484,7 @@
- { (exit 1); exit 1; }; }
+@@ -170,7 +176,7 @@
+ AC_MSG_ERROR(["libffi has not been ported to $host."])
fi
-- if test x$TARGET = xMIPS; then
-+ if expr x$TARGET : 'xMIPS' > /dev/null; then
- MIPS_TRUE=
- MIPS_FALSE='#'
- else
-@@ -22712,9 +22715,15 @@
- ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h"
-
-
--ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
-+ac_config_files="$ac_config_files include/ffi.h"
+-AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
++AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null])
+ AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
+ AM_CONDITIONAL(X86, test x$TARGET = xX86)
+ AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD)
+@@ -401,4 +407,8 @@
+ AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
-+ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h"
-+
-+
-+ac_config_files="$ac_config_files fficonfig.py"
++AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h)
+
++AC_CONFIG_FILES(fficonfig.py)
+
- cat >confcache <<\_ACEOF
- # This file is a shell script that caches the results of configure
- # tests run on this system so they can be shared between configure
-@@ -23498,12 +23507,9 @@
- "include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;;
- "src") CONFIG_COMMANDS="$CONFIG_COMMANDS src" ;;
- "include/ffitarget.h") CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ;;
-- "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
- "include/ffi.h") CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;;
-- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-- "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
-- "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
-- "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
-+ "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
-+ "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
-
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
- echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-Index: libffi/src/x86/ffi.c
-===================================================================
---- libffi/src/x86/ffi.c (working copy)
-+++ libffi/src/x86/ffi.c (revision 72475)
-@@ -388,10 +388,10 @@
- return FFI_BAD_ABI;
- }
-
-- // we currently don't support certain kinds of arguments for raw
-+ /* we currently don't support certain kinds of arguments for raw
- // closures. This should be implemented by a separate assembly language
- // routine, since it would require argument processing, something we
-- // don't do now for performance.
-+ // don't do now for performance. */
-
- for (i = cif->nargs-1; i >= 0; i--)
- {
-Index: libffi/src/x86/ffi64.c
-===================================================================
---- libffi/src/x86/ffi64.c (working copy)
-+++ libffi/src/x86/ffi64.c (revision 72475)
-@@ -52,7 +52,7 @@
- /* Register class used for passing given 64bit part of the argument.
- These represent classes as documented by the PS ABI, with the exception
- of SSESF, SSEDF classes, that are basically SSE class, just gcc will
-- use SF or DFmode move instead of DImode to avoid reformating penalties.
-+ use SF or DFmode move instead of DImode to avoid reformatting penalties.
-
- Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves
- whenever possible (upper half does contain padding). */
+ AC_OUTPUT
diff --git a/Modules/_ctypes/libffi/ChangeLog b/Modules/_ctypes/libffi/ChangeLog
new file mode 100644
index 0000000000..00ba7efc1d
--- /dev/null
+++ b/Modules/_ctypes/libffi/ChangeLog
@@ -0,0 +1,4145 @@
+2010-03-14 Matthias Klose <doko@ubuntu.com>
+
+ * src/x86/ffi64.c: Fix typo in comment.
+ * src/x86/ffi.c: Use /* ... */ comment style.
+
+2010-01-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR libffi/40701
+ * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRIdLL,
+ PRIuLL, PRId64, PRIu64, PRIuPTR): Define.
+ * testsuite/libffi.call/cls_align_sint64.c: Add -Wno-format on
+ alpha*-dec-osf*.
+ * testsuite/libffi.call/cls_align_uint64.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/return_ll1.c: Likewise.
+ * testsuite/libffi.call/stret_medium2.c: Likewise.
+ * testsuite/libffi.special/ffitestcxx.h (allocate_mmap): Cast
+ MAP_FAILED to char *.
+
+2010-01-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__.
+
+2009-12-31 Anthony Green <green@redhat.com>
+
+ * README: Update for libffi 3.0.9.
+
+2009-12-27 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac (HAVE_LONG_DOUBLE): Define for mips when
+ appropriate.
+ * configure: Rebuilt.
+
+2009-12-26 Anthony Green <green@redhat.com>
+
+ * testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for
+ avr32*-*-*.
+ * testsuite/libffi.call/cls_double_va.c: Ditto.
+
+2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
+
+ * testsuite/libffi.call/ffitest.h: Conditionally include stdint.h
+ and inttypes.h.
+ * testsuite/libffi.special/unwindtest.cc: Ditto.
+
+2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
+
+ * configure.ac: Add amd64-*-openbsd*.
+ * configure: Rebuilt.
+ * testsuite/lib/libffi-dg.exp (libffi_target_compile): Link
+ openbsd programs with -lpthread.
+
+2009-12-26 Anthony Green <green@redhat.com>
+
+ * testsuite/libffi.call/cls_double_va.c,
+ testsuite/libffi.call/cls_longdouble.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_pointer.c,
+ testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for
+ mips*-*-* and arm*-*-*.
+ * testsuite/libffi.call/cls_align_longdouble_split.c,
+ testsuite/libffi.call/cls_align_longdouble_split2.c,
+ testsuite/libffi.call/stret_medium2.c,
+ testsuite/libffi.call/stret_medium.c,
+ testsuite/libffi.call/stret_large.c,
+ testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*.
+
+2009-12-31 Kay Tietz <ktietz70@googlemail.com>
+
+ * testsuite/libffi.call/ffitest.h,
+ testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix
+ definitions.
+
+2009-12-31 Carlo Bramini <carlo.bramix@libero.it>
+
+ * configure.ac (AM_LTLDFLAGS): Define for windows hosts.
+ * Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS.
+ * configure: Rebuilt.
+ * Makefile.in: Rebuilt.
+
+2009-12-31 Anthony Green <green@redhat.com>
+ Blake Chaffin.
+
+ * testsuite/libffi.call/huge_struct.c: New test case from Blake
+ Chaffin @ Apple.
+
+2009-12-28 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to
+ local variables.
+ (aix_adjust_aggregate_sizes): New function.
+ (ffi_prep_cif_machdep): Call it.
+
+2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
+
+ * configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets.
+ * configure: Regenerate.
+ * fficonfig.h.in: Likewise.
+ * src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for
+ Solaris/x86.
+
+2009-12-26 Andreas Schwab <schwab@linux-m68k.org>
+
+ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count
+ when a float arguments is passed in memory.
+ (ffi_closure_helper_SYSV): Mark general registers as used up when
+ a 64bit or soft-float long double argument is passed in memory.
+
+2009-12-25 Matthias Klose <doko@ubuntu.com>
+
+ * man/ffi_call.3: Fix #include in examples.
+ * doc/libffi.texi: Add dircategory.
+
+2009-12-25 Frank Everdij <f.p.x.everdij@tudelft.nl>
+
+ * include/ffi.h.in: Placed '__GNUC__' ifdef around
+ '__attribute__((aligned(8)))' in ffi_closure, fixes compile for
+ IRIX MIPSPro c99.
+ * include/ffi_common.h: Added '__sgi' define to non
+ '__attribute__((__mode__()))' integer typedefs.
+ * src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32,
+ ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check.
+ (ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added
+ FFI_LONGDOUBLE support and alignment(N32 only).
+ * src/mips/ffitarget.h: Corrected '#include <sgidefs.h>' for IRIX and
+ fixed non '__attribute__((__mode__()))' integer typedefs.
+ * src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame'
+ since they are Linux/GNU Assembler specific.
+
+2009-12-25 Bradley Smith <brad@brad-smith.co.uk>
+
+ * configure.ac, Makefile.am, src/avr32/ffi.c,
+ src/avr32/ffitarget.h,
+ src/avr32/sysv.S: Add AVR32 port.
+ * configure, Makefile.in: Rebuilt.
+
+2009-12-21 Andreas Tobler <a.tobler@schweiz.org>
+
+ * configure.ac: Make i?86 build on FreeBSD and OpenBSD.
+ * configure: Regenerate.
+
+2009-12-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * testsuite/libffi.call/ffitest.h: Define PRIuPTR on PA HP-UX.
+
+2009-12-13 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE
+ type on HP-UX.
+
+2009-12-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long
+ double' arguments.
+
+2009-12-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10.
+
+2009-12-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR libffi/40700
+ * src/closures.c [X86_64 && __sun__ && __svr4__]
+ (FFI_MMAP_EXEC_WRIT): Define.
+
+2009-12-08 David Daney <ddaney@caviumnetworks.com>
+
+ * testsuite/libffi.call/stret_medium.c: Remove xfail for mips*-*-*
+ * testsuite/libffi.call/cls_align_longdouble_split2.c: Same.
+ * testsuite/libffi.call/stret_large.c: Same.
+ * testsuite/libffi.call/cls_align_longdouble_split.c: Same.
+ * testsuite/libffi.call/stret_large2.c: Same.
+ * testsuite/libffi.call/stret_medium2.c: Same.
+
+2009-12-07 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump
+ typo.
+
+2009-12-05 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64
+ code.
+ * src/powerpc/aix_closure.S: Same.
+
+2009-12-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * Makefile.in: Regenerate.
+ * configure: Regenerate.
+ * include/Makefile.in: Regenerate.
+ * man/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+
+2009-12-04 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/aix_closure.S: Reorganize 64-bit code to match
+ linux64_closure.S.
+
+2009-12-04 Uros Bizjak <ubizjak@gmail.com>
+
+ PR libffi/41908
+ * src/x86/ffi64.c (classify_argument): Update from
+ gcc/config/i386/i386.c.
+ (ffi_closure_unix64_inner): Do not use the address of two consecutive
+ SSE registers directly.
+ * testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail
+ for x86_64 linux targets.
+
+2009-12-04 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment
+ pfr for long double split between fpr13 and stack.
+
+2009-12-03 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and
+ fparg_count twice for long double.
+
+2009-12-03 David Edelsohn <edelsohn@gnu.org>
+
+ PR libffi/42243
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses.
+
+2009-12-03 Uros Bizjak <ubizjak@gmail.com>
+
+ * testsuite/libffi.call/cls_longdouble_va.c (main): Fix format string.
+ Remove xfails for x86 linux targets.
+
+2009-12-02 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64
+ case.
+
+2009-12-01 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/aix.S (ffi_call_AIX): Convert to more standard
+ register usage. Call ffi_prep_args directly. Add long double
+ return value support.
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment
+ applies to FFI_TYPE_DOUBLE. Correct fpr_base increment typo.
+ Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases.
+ (ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit
+ mode.
+ (ffi_closure_helper_DARWIN): Remove nf and ng counters. Move temp
+ into case.
+ * src/powerpc/aix_closure.S: Maintain 16 byte stack alignment.
+ Allocate result area between params and FPRs.
+
+2009-11-30 David Edelsohn <edelsohn@gnu.org>
+
+ PR target/35484
+ * src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and
+ AIX64.
+ * src/powerpc/aix.S: Implement AIX64 version.
+ * src/powerpc/aix_closure.S: Implement AIX64 version.
+ (ffi_closure_ASM): Use extsb, lha and displament addresses.
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64
+ support.
+ (ffi_prep_cif_machdep): Same.
+ (ffi_call): Same.
+ (ffi_closure_helper_DARWIN): Same.
+
+2009-11-02 Andreas Tobler <a.tobler@schweiz.org>
+
+ PR libffi/41908
+ * testsuite/libffi.call/testclosure.c: New test.
+
+2009-09-28 Kai Tietz <kai.tietz@onevision.com>
+
+ * src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu
+ assembly version use of ___chkstk.
+
+2009-09-23 Matthias Klose <doko@ubuntu.com>
+
+ PR libffi/40242, PR libffi/41443
+ * src/arm/sysv.S (__ARM_ARCH__): Define for processors
+ __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
+ __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
+ Change the conditionals to __SOFTFP__ || __ARM_EABI__
+ for -mfloat-abi=softfp to work.
+
+2009-09-17 Loren J. Rittle <ljrittle@acm.org>
+
+ PR testsuite/32843 (strikes again)
+ * src/x86/ffi.c (ffi_prep_cif_machdep): Add X86_FREEBSD to
+ enable proper extension on char and short.
+
+2009-09-15 David Daney <ddaney@caviumnetworks.com>
+
+ * src/java_raw_api.c (ffi_java_raw_to_rvalue): Remove special
+ handling for FFI_TYPE_POINTER.
+ * src/mips/ffitarget.h (FFI_TYPE_STRUCT_D_SOFT,
+ FFI_TYPE_STRUCT_F_SOFT, FFI_TYPE_STRUCT_DD_SOFT,
+ FFI_TYPE_STRUCT_FF_SOFT, FFI_TYPE_STRUCT_FD_SOFT,
+ FFI_TYPE_STRUCT_DF_SOFT, FFI_TYPE_STRUCT_SOFT): New defines.
+ (FFI_N32_SOFT_FLOAT, FFI_N64_SOFT_FLOAT): New ffi_abi enumerations.
+ (enum ffi_abi): Set FFI_DEFAULT_ABI for soft-float.
+ * src/mips/n32.S (ffi_call_N32): Add handling for soft-float
+ structure and pointer returns.
+ (ffi_closure_N32): Add handling for pointer returns.
+ * src/mips/ffi.c (ffi_prep_args, calc_n32_struct_flags,
+ calc_n32_return_struct_flags): Handle soft-float.
+ (ffi_prep_cif_machdep): Handle soft-float, fix pointer handling.
+ (ffi_call_N32): Declare proper argument types.
+ (ffi_call, copy_struct_N32, ffi_closure_mips_inner_N32): Handle
+ soft-float.
+
+2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * configure.ac (AC_PREREQ): Bump to 2.64.
+
+2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * Makefile.am (install-html, install-pdf): Remove.
+ * Makefile.in: Regenerate.
+
+ * Makefile.in: Regenerate.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * fficonfig.h.in: Regenerate.
+ * include/Makefile.in: Regenerate.
+ * man/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+
+2009-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
+2009-07-24 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR libffi/40807
+ * src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending
+ return types for X86_WIN32.
+ * src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types.
+ (_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV,
+ _ffi_closure_STDCALL): Likewise.
+
+ * src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin.
+ (dlmmap, dlmunmap): Also use these functions on Cygwin.
+
+2009-07-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ PR testsuite/40699
+ PR testsuite/40707
+ PR testsuite/40709
+ * testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and
+ 2009-06-30 commits.
+
+2009-07-01 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * testsuite/lib/libffi-dg.exp (libffi-init): Set ld_library_path
+ to "" before adding paths. (This reinstates an assignment that
+ was removed by my 2009-06-30 commit, but changes the initial
+ value from "." to "".)
+
+2009-07-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR testsuite/40601
+ * testsuite/lib/libffi-dg.exp (libffi-init): Properly set
+ gccdir. Adjust ld_library_path for gcc only if gccdir isn't
+ empty.
+
+2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * testsuite/lib/libffi-dg.exp (libffi-init): Don't add "."
+ to ld_library_path. Use add_path. Add just find_libgcc_s
+ to ld_library_path, not every libgcc multilib directory.
+
+2009-06-16 Wim Lewis <wiml@hhhh.org>
+
+ * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
+ supposed to be callee-saved.
+ * src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
+ return buffer for odd-size structs.
+
+2009-06-16 Andreas Tobler <a.tobler@schweiz.org>
+
+ PR libffi/40444
+ * testsuite/lib/libffi-dg.exp (libffi_target_compile): Add
+ allow_stack_execute for Darwin.
+
+2009-06-16 Andrew Haley <aph@redhat.com>
+
+ * configure.ac (TARGETDIR): Add missing blank lines.
+ * configure: Regenerate.
+
+2009-06-16 Andrew Haley <aph@redhat.com>
+
+ * testsuite/libffi.call/cls_align_sint64.c,
+ testsuite/libffi.call/cls_align_uint64.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_ulonglong.c,
+ testsuite/libffi.call/return_ll1.c,
+ testsuite/libffi.call/stret_medium2.c: Fix printf format
+ specifiers.
+ * testsuite/libffi.call/ffitest.h,
+ testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
+
+2009-06-15 Andrew Haley <aph@redhat.com>
+
+ * testsuite/libffi.call/err_bad_typedef.c: xfail everywhere.
+ * testsuite/libffi.call/err_bad_abi.c: Likewise.
+
+2009-06-12 Andrew Haley <aph@redhat.com>
+
+ * Makefile.am: Remove info_TEXINFOS.
+
+2009-06-12 Andrew Haley <aph@redhat.com>
+
+ * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
+ testsuite/libffi.call/cls_align_uint64.c,
+ testsuite/libffi.call/cls_ulonglong.c,
+ testsuite/libffi.call/return_ll1.c,
+ testsuite/libffi.call/stret_medium2.c: Fix printf format
+ specifiers.
+ testsuite/libffi.special/unwindtest.cc: include stdint.h.
+
+2009-06-11 Timothy Wall <twall@users.sf.net>
+
+ * Makefile.am,
+ configure.ac,
+ include/ffi.h.in,
+ include/ffi_common.h,
+ src/closures.c,
+ src/dlmalloc.c,
+ src/x86/ffi.c,
+ src/x86/ffitarget.h,
+ src/x86/win64.S (new),
+ README: Added win64 support (mingw or MSVC)
+ * Makefile.in,
+ include/Makefile.in,
+ man/Makefile.in,
+ testsuite/Makefile.in,
+ configure,
+ aclocal.m4: Regenerated
+ * ltcf-c.sh: properly escape cygwin/w32 path
+ * man/ffi_call.3: Clarify size requirements for return value.
+ * src/x86/ffi64.c: Fix filename in comment.
+ * src/x86/win32.S: Remove unused extern.
+
+ * testsuite/libffi.call/closure_fn0.c,
+ testsuite/libffi.call/closure_fn1.c,
+ testsuite/libffi.call/closure_fn2.c,
+ testsuite/libffi.call/closure_fn3.c,
+ testsuite/libffi.call/closure_fn4.c,
+ testsuite/libffi.call/closure_fn5.c,
+ testsuite/libffi.call/closure_fn6.c,
+ testsuite/libffi.call/closure_stdcall.c,
+ testsuite/libffi.call/cls_12byte.c,
+ testsuite/libffi.call/cls_16byte.c,
+ testsuite/libffi.call/cls_18byte.c,
+ testsuite/libffi.call/cls_19byte.c,
+ testsuite/libffi.call/cls_1_1byte.c,
+ testsuite/libffi.call/cls_20byte.c,
+ testsuite/libffi.call/cls_20byte1.c,
+ testsuite/libffi.call/cls_24byte.c,
+ testsuite/libffi.call/cls_2byte.c,
+ testsuite/libffi.call/cls_3_1byte.c,
+ testsuite/libffi.call/cls_3byte1.c,
+ testsuite/libffi.call/cls_3byte2.c,
+ testsuite/libffi.call/cls_4_1byte.c,
+ testsuite/libffi.call/cls_4byte.c,
+ testsuite/libffi.call/cls_5_1_byte.c,
+ testsuite/libffi.call/cls_5byte.c,
+ testsuite/libffi.call/cls_64byte.c,
+ testsuite/libffi.call/cls_6_1_byte.c,
+ testsuite/libffi.call/cls_6byte.c,
+ testsuite/libffi.call/cls_7_1_byte.c,
+ testsuite/libffi.call/cls_7byte.c,
+ testsuite/libffi.call/cls_8byte.c,
+ testsuite/libffi.call/cls_9byte1.c,
+ testsuite/libffi.call/cls_9byte2.c,
+ testsuite/libffi.call/cls_align_double.c,
+ testsuite/libffi.call/cls_align_float.c,
+ testsuite/libffi.call/cls_align_longdouble.c,
+ testsuite/libffi.call/cls_align_longdouble_split.c,
+ testsuite/libffi.call/cls_align_longdouble_split2.c,
+ testsuite/libffi.call/cls_align_pointer.c,
+ testsuite/libffi.call/cls_align_sint16.c,
+ testsuite/libffi.call/cls_align_sint32.c,
+ testsuite/libffi.call/cls_align_sint64.c,
+ testsuite/libffi.call/cls_align_uint16.c,
+ testsuite/libffi.call/cls_align_uint32.c,
+ testsuite/libffi.call/cls_align_uint64.c,
+ testsuite/libffi.call/cls_dbls_struct.c,
+ testsuite/libffi.call/cls_double.c,
+ testsuite/libffi.call/cls_double_va.c,
+ testsuite/libffi.call/cls_float.c,
+ testsuite/libffi.call/cls_longdouble.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_multi_schar.c,
+ testsuite/libffi.call/cls_multi_sshort.c,
+ testsuite/libffi.call/cls_multi_sshortchar.c,
+ testsuite/libffi.call/cls_multi_uchar.c,
+ testsuite/libffi.call/cls_multi_ushort.c,
+ testsuite/libffi.call/cls_multi_ushortchar.c,
+ testsuite/libffi.call/cls_pointer.c,
+ testsuite/libffi.call/cls_pointer_stack.c,
+ testsuite/libffi.call/cls_schar.c,
+ testsuite/libffi.call/cls_sint.c,
+ testsuite/libffi.call/cls_sshort.c,
+ testsuite/libffi.call/cls_uchar.c,
+ testsuite/libffi.call/cls_uint.c,
+ testsuite/libffi.call/cls_ulonglong.c,
+ testsuite/libffi.call/cls_ushort.c,
+ testsuite/libffi.call/err_bad_abi.c,
+ testsuite/libffi.call/err_bad_typedef.c,
+ testsuite/libffi.call/float2.c,
+ testsuite/libffi.call/huge_struct.c,
+ testsuite/libffi.call/nested_struct.c,
+ testsuite/libffi.call/nested_struct1.c,
+ testsuite/libffi.call/nested_struct10.c,
+ testsuite/libffi.call/nested_struct2.c,
+ testsuite/libffi.call/nested_struct3.c,
+ testsuite/libffi.call/nested_struct4.c,
+ testsuite/libffi.call/nested_struct5.c,
+ testsuite/libffi.call/nested_struct6.c,
+ testsuite/libffi.call/nested_struct7.c,
+ testsuite/libffi.call/nested_struct8.c,
+ testsuite/libffi.call/nested_struct9.c,
+ testsuite/libffi.call/problem1.c,
+ testsuite/libffi.call/return_ldl.c,
+ testsuite/libffi.call/return_ll1.c,
+ testsuite/libffi.call/stret_large.c,
+ testsuite/libffi.call/stret_large2.c,
+ testsuite/libffi.call/stret_medium.c,
+ testsuite/libffi.call/stret_medium2.c,
+ testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead
+ of checking for MMAP. Use intptr_t instead of long casts.
+
+2009-06-11 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*.
+ * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*.
+ * testsuite/libffi.call/err_bad_typedef.c: Likewise.
+
+2009-06-09 Andrew Haley <aph@redhat.com>
+
+ * src/x86/freebsd.S: Add missing file.
+
+2009-06-08 Andrew Haley <aph@redhat.com>
+
+ Import from libffi 3.0.8:
+
+ * doc/libffi.texi: New file.
+ * doc/libffi.info: Likewise.
+ * doc/stamp-vti: Likewise.
+ * man/Makefile.am: New file.
+ * man/ffi_call.3: New file.
+
+ * Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S,
+ src/dlmalloc.c.
+ (nodist_libffi_la_SOURCES): Add X86_FREEBSD.
+
+ * configure.ac: Bump version to 3.0.8.
+ parisc*-*-linux*: Add.
+ i386-*-freebsd* | i386-*-openbsd*: Add.
+ powerpc-*-beos*: Add.
+ AM_CONDITIONAL X86_FREEBSD: Add.
+ AC_CONFIG_FILES: Add man/Makefile.
+
+ * include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void).
+
+2009-06-08 Andrew Haley <aph@redhat.com>
+
+ * README: Import from libffi 3.0.8.
+
+2009-06-08 Andrew Haley <aph@redhat.com>
+
+ * testsuite/libffi.call/err_bad_abi.c: Add xfails.
+ * testsuite/libffi.call/cls_longdouble_va.c: Add xfails.
+ * testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*.
+ * testsuite/libffi.call/err_bad_typedef.c: Add xfails.
+
+ * testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args.
+ * testsuite/libffi.call/stret_medium.c: Likewise.
+ * testsuite/libffi.call/stret_large2.c: Likewise.
+ * testsuite/libffi.call/stret_large.c: Likewise.
+
+2008-12-26 Timothy Wall <twall@users.sf.net>
+
+ * testsuite/libffi.call/cls_longdouble.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_align_longdouble.c,
+ testsuite/libffi.call/cls_align_longdouble_split.c,
+ testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected
+ failures on x86_64 cygwin/mingw.
+
+2008-12-22 Timothy Wall <twall@users.sf.net>
+
+ * testsuite/libffi.call/closure_fn0.c,
+ testsuite/libffi.call/closure_fn1.c,
+ testsuite/libffi.call/closure_fn2.c,
+ testsuite/libffi.call/closure_fn3.c,
+ testsuite/libffi.call/closure_fn4.c,
+ testsuite/libffi.call/closure_fn5.c,
+ testsuite/libffi.call/closure_fn6.c,
+ testsuite/libffi.call/closure_loc_fn0.c,
+ testsuite/libffi.call/closure_stdcall.c,
+ testsuite/libffi.call/cls_align_pointer.c,
+ testsuite/libffi.call/cls_pointer.c,
+ testsuite/libffi.call/cls_pointer_stack.c: use portable cast from
+ pointer to integer (intptr_t).
+ * testsuite/libffi.call/cls_longdouble.c: disable for win64.
+
+2008-07-24 Anthony Green <green@redhat.com>
+
+ * testsuite/libffi.call/cls_dbls_struct.c,
+ testsuite/libffi.call/cls_double_va.c,
+ testsuite/libffi.call/cls_longdouble.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_pointer.c,
+ testsuite/libffi.call/cls_pointer_stack.c,
+ testsuite/libffi.call/err_bad_abi.c: Clean up failures from
+ compiler warnings.
+
+2008-03-04 Anthony Green <green@redhat.com>
+ Blake Chaffin
+ hos@tamanegi.org
+
+ * testsuite/libffi.call/cls_align_longdouble_split2.c
+ testsuite/libffi.call/cls_align_longdouble_split.c
+ testsuite/libffi.call/cls_dbls_struct.c
+ testsuite/libffi.call/cls_double_va.c
+ testsuite/libffi.call/cls_longdouble.c
+ testsuite/libffi.call/cls_longdouble_va.c
+ testsuite/libffi.call/cls_pointer.c
+ testsuite/libffi.call/cls_pointer_stack.c
+ testsuite/libffi.call/err_bad_abi.c
+ testsuite/libffi.call/err_bad_typedef.c
+ testsuite/libffi.call/stret_large2.c
+ testsuite/libffi.call/stret_large.c
+ testsuite/libffi.call/stret_medium2.c
+ testsuite/libffi.call/stret_medium.c: New tests from Apple.
+
+2009-06-05 Andrew Haley <aph@redhat.com>
+
+ * src/x86/ffitarget.h, src/x86/ffi.c: Merge stdcall changes from
+ libffi.
+
+2009-06-04 Andrew Haley <aph@redhat.com>
+
+ * src/x86/ffitarget.h, src/x86/win32.S, src/x86/ffi.c: Back out
+ stdcall changes.
+
+2008-02-26 Anthony Green <green@redhat.com>
+ Thomas Heller <theller@ctypes.org>
+
+ * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
+ comment.
+
+2008-02-03 Timothy Wall <twall@users.sf.net>
+
+ * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return
+ offset based on code pointer, not data pointer.
+
+2008-01-31 Timothy Wall <twall@users.sf.net>
+
+ * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall
+ closures.
+ * src/x86/ffitarget.h: Increase size of trampoline for stdcall
+ closures.
+ * src/x86/win32.S: Add assembly for stdcall closure.
+ * src/x86/ffi.c: Initialize stdcall closure trampoline.
+
+2009-06-04 Andrew Haley <aph@redhat.com>
+
+ * include/ffi.h.in: Change void (*)() to void (*)(void).
+ * src/x86/ffi.c: Likewise.
+
+2009-06-04 Andrew Haley <aph@redhat.com>
+
+ * src/powerpc/ppc_closure.S: Insert licence header.
+ * src/powerpc/linux64_closure.S: Likewise.
+ * src/m68k/sysv.S: Likewise.
+
+ * src/sh64/ffi.c: Change void (*)() to void (*)(void).
+ * src/powerpc/ffi.c: Likewise.
+ * src/powerpc/ffi_darwin.c: Likewise.
+ * src/m32r/ffi.c: Likewise.
+ * src/sh64/ffi.c: Likewise.
+ * src/x86/ffi64.c: Likewise.
+ * src/alpha/ffi.c: Likewise.
+ * src/alpha/osf.S: Likewise.
+ * src/frv/ffi.c: Likewise.
+ * src/s390/ffi.c: Likewise.
+ * src/pa/ffi.c: Likewise.
+ * src/pa/hpux32.S: Likewise.
+ * src/ia64/unix.S: Likewise.
+ * src/ia64/ffi.c: Likewise.
+ * src/sparc/ffi.c: Likewise.
+ * src/mips/ffi.c: Likewise.
+ * src/sh/ffi.c: Likewise.
+
+2008-02-15 David Daney <ddaney@avtrex.com>
+
+ * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
+ Define (conditionally), and use it to include cachectl.h.
+ (ffi_prep_closure_loc): Fix cache flushing.
+ * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
+
+2009-06-04 Andrew Haley <aph@redhat.com>
+
+ include/ffi.h.in,
+ src/arm/ffitarget.h,
+ src/arm/ffi.c,
+ src/arm/sysv.S,
+ src/powerpc/ffitarget.h,
+ src/closures.c,
+ src/sh64/ffitarget.h,
+ src/sh64/ffi.c,
+ src/sh64/sysv.S,
+ src/types.c,
+ src/x86/ffi64.c,
+ src/x86/ffitarget.h,
+ src/x86/win32.S,
+ src/x86/darwin.S,
+ src/x86/ffi.c,
+ src/x86/sysv.S,
+ src/x86/unix64.S,
+ src/alpha/ffitarget.h,
+ src/alpha/ffi.c,
+ src/alpha/osf.S,
+ src/m68k/ffitarget.h,
+ src/frv/ffitarget.h,
+ src/frv/ffi.c,
+ src/s390/ffitarget.h,
+ src/s390/sysv.S,
+ src/cris/ffitarget.h,
+ src/pa/linux.S,
+ src/pa/ffitarget.h,
+ src/pa/ffi.c,
+ src/raw_api.c,
+ src/ia64/ffitarget.h,
+ src/ia64/unix.S,
+ src/ia64/ffi.c,
+ src/ia64/ia64_flags.h,
+ src/java_raw_api.c,
+ src/debug.c,
+ src/sparc/v9.S,
+ src/sparc/ffitarget.h,
+ src/sparc/ffi.c,
+ src/sparc/v8.S,
+ src/mips/ffitarget.h,
+ src/mips/n32.S,
+ src/mips/o32.S,
+ src/mips/ffi.c,
+ src/prep_cif.c,
+ src/sh/ffitarget.h,
+ src/sh/ffi.c,
+ src/sh/sysv.S: Update license text.
+
+2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * src/x86/win32.S (_ffi_closure_STDCALL): New function.
+ (.eh_frame): Add FDE for it.
+
+2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * configure.ac: Also check if assembler supports pc-relative
+ relocs on X86_WIN32 targets.
+ * configure: Regenerate.
+ * src/x86/win32.S (ffi_prep_args): Declare extern, not global.
+ (_ffi_call_SYSV): Add missing function type symbol .def and
+ add EH markup labels.
+ (_ffi_call_STDCALL): Likewise.
+ (_ffi_closure_SYSV): Likewise.
+ (_ffi_closure_raw_SYSV): Likewise.
+ (.eh_frame): Add hand-crafted EH data.
+
+2009-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ * testsuite/lib/libffi-dg.exp: Change copyright header to refer to
+ version 3 of the GNU General Public License and to point readers
+ at the COPYING3 file and the FSF's license web page.
+ * testsuite/libffi.call/call.exp: Likewise.
+ * testsuite/libffi.special/special.exp: Likewise.
+
+2009-03-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * configure: Regenerate.
+
+2008-12-18 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ PR libffi/26048
+ * configure.ac (HAVE_AS_X86_PCREL): New test.
+ * configure: Regenerate.
+ * fficonfig.h.in: Regenerate.
+ * src/x86/sysv.S [!FFI_NO_RAW_API]: Precalculate
+ RAW_CLOSURE_CIF_OFFSET, RAW_CLOSURE_FUN_OFFSET,
+ RAW_CLOSURE_USER_DATA_OFFSET for the Solaris 10/x86 assembler.
+ (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL.
+ * src/x86/unix64.S (.Lstore_table): Move to .text section.
+ (.Lload_table): Likewise.
+ (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL.
+
+2008-12-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * configure: Regenerate.
+
+2008-11-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
+ signed/unsigned int8/16 return values.
+ * src/sparc/v8.S (ffi_call_v8): Likewise.
+ (ffi_closure_v8): Likewise.
+
+2008-09-26 Peter O'Gorman <pogma@thewrittenword.com>
+ Steve Ellcey <sje@cup.hp.com>
+
+ * configure: Regenerate for new libtool.
+ * Makefile.in: Ditto.
+ * include/Makefile.in: Ditto.
+ * aclocal.m4: Ditto.
+
+2008-08-25 Andreas Tobler <a.tobler@schweiz.org>
+
+ * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and
+ FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum.
+ Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT.
+ Adjust copyright notice.
+ * src/powerpc/ffi.c: Add two new flags to indicate if we have one
+ register or two register to use for FFI_SYSV structs.
+ (ffi_prep_cif_machdep): Pass the right register flag introduced above.
+ (ffi_closure_helper_SYSV): Fix the return type for
+ FFI_SYSV_TYPE_SMALL_STRUCT. Comment.
+ Adjust copyright notice.
+
+2008-07-16 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned
+ int.
+
+2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * configure: Regenerate.
+ * include/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+
+2008-06-07 Joseph Myers <joseph@codesourcery.com>
+
+ * configure.ac (parisc*-*-linux*, powerpc-*-sysv*,
+ powerpc-*-beos*): Remove.
+ * configure: Regenerate.
+
+2008-05-09 Julian Brown <julian@codesourcery.com>
+
+ * Makefile.am (LTLDFLAGS): New.
+ (libffi_la_LDFLAGS): Use above.
+ * Makefile.in: Regenerate.
+
+2008-04-18 Paolo Bonzini <bonzini@gnu.org>
+
+ PR bootstrap/35457
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2008-03-26 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/sysv.S: Add .note.GNU-stack on Linux.
+ * src/sh64/sysv.S: Likewise.
+
+2008-03-26 Daniel Jacobowitz <dan@debian.org>
+
+ * src/arm/sysv.S: Fix ARM comment marker.
+
+2008-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ * src/alpha/osf.S: Add .note.GNU-stack on Linux.
+ * src/s390/sysv.S: Likewise.
+ * src/powerpc/ppc_closure.S: Likewise.
+ * src/powerpc/sysv.S: Likewise.
+ * src/x86/unix64.S: Likewise.
+ * src/x86/sysv.S: Likewise.
+ * src/sparc/v8.S: Likewise.
+ * src/sparc/v9.S: Likewise.
+ * src/m68k/sysv.S: Likewise.
+ * src/arm/sysv.S: Likewise.
+
+2008-03-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * aclocal.m4: Regenerate.
+ * configure: Likewise.
+ * Makefile.in: Likewise.
+ * include/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+
+2008-02-12 Bjoern Koenig <bkoenig@alpha-tierchen.de>
+ Andreas Tobler <a.tobler@schweiz.org>
+
+ * configure.ac: Add amd64-*-freebsd* target.
+ * configure: Regenerate.
+
+2008-01-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR libffi/34612
+ * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when
+ returning struct.
+
+ * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer"
+ tests.
+
+2008-01-24 David Edelsohn <edelsohn@gnu.org>
+
+ * configure: Regenerate.
+
+2008-01-06 Andreas Tobler <a.tobler@schweiz.org>
+
+ * src/x86/ffi.c (ffi_prep_cif_machdep): Fix thinko.
+
+2008-01-05 Andreas Tobler <a.tobler@schweiz.org>
+
+ PR testsuite/32843
+ * src/x86/ffi.c (ffi_prep_cif_machdep): Add code for
+ signed/unsigned int8/16 for X86_DARWIN.
+ Updated copyright info.
+ Handle one and two byte structs with special cif->flags.
+ * src/x86/ffitarget.h: Add special types for one and two byte structs.
+ Updated copyright info.
+ * src/x86/darwin.S (ffi_call_SYSV): Rewrite to use a jump table like
+ sysv.S
+ Remove code to pop args from the stack after call.
+ Special-case signed/unsigned for int8/16, one and two byte structs.
+ (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8,
+ FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32,
+ FFI_TYPE_SINT32.
+ Updated copyright info.
+
+2007-12-08 David Daney <ddaney@avtrex.com>
+
+ * src/mips/n32.S (ffi_call_N32): Replace dadd with ADDU, dsub with
+ SUBU, add with ADDU and use smaller code sequences.
+
+2007-12-07 David Daney <ddaney@avtrex.com>
+
+ * src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return
+ type.
+
+2007-12-06 David Daney <ddaney@avtrex.com>
+
+ * include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already
+ defined.
+ (ffi_java_raw): New typedef.
+ (ffi_java_raw_call, ffi_java_ptrarray_to_raw,
+ ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to
+ ffi_java_raw.
+ (ffi_java_raw_closure) : Same.
+ (ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change
+ parameter types.
+ * src/java_raw_api.c (ffi_java_raw_size): Replace FFI_SIZEOF_ARG with
+ FFI_SIZEOF_JAVA_RAW.
+ (ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw.
+ Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use
+ sizeof(ffi_java_raw) for alignment calculations.
+ (ffi_java_ptrarray_to_raw): Same.
+ (ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER
+ if FFI_SIZEOF_JAVA_RAW == 4.
+ (ffi_java_raw_to_rvalue): Same.
+ (ffi_java_raw_call): Change type of raw to ffi_java_raw.
+ (ffi_java_translate_args): Same.
+ (ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change
+ parameter types.
+ * src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI.
+
+2007-12-06 David Daney <ddaney@avtrex.com>
+
+ * src/mips/n32.S (ffi_closure_N32): Use 64-bit add instruction on
+ pointer values.
+
+2007-12-01 Andreas Tobler <a.tobler@schweiz.org>
+
+ PR libffi/31937
+ * src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT.
+ Add local FFI_TYPE_UINT128 to handle soft-float long-double-128.
+ * src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and
+ set the NUM_FPR_ARG_REGISTERS according to.
+ Add support for potential soft-float support under hard-float
+ architecture.
+ (ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of
+ FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according
+ to the FFI_LINUX_SOFT_FLOAT ABI.
+ (ffi_prep_cif_machdep): Likewise.
+ (ffi_closure_helper_SYSV): Likewise.
+ * src/powerpc/ppc_closure.S: Make sure not to store float/double
+ on archs where __NO_FPRS__ is true.
+ Add FFI_TYPE_UINT128 support.
+ * src/powerpc/sysv.S: Add support for soft-float long-double-128.
+ Adjust copyright notice.
+
+2007-11-25 Andreas Tobler <a.tobler@schweiz.org>
+
+ * src/closures.c: Move defintion of MAYBE_UNUSED from here to ...
+ * include/ffi_common.h: ... here.
+ Update copyright.
+
+2007-11-17 Andreas Tobler <a.tobler@schweiz.org>
+
+ * src/powerpc/sysv.S: Load correct cr to compare if we have long double.
+ * src/powerpc/linux64.S: Likewise.
+ * src/powerpc/ffi.c: Add a comment to show which part goes into cr6.
+ * testsuite/libffi.call/return_ldl.c: New test.
+
+2007-09-04 <aph@redhat.com>
+
+ * src/arm/sysv.S (UNWIND): New.
+ (Whole file): Conditionally compile unwinder directives.
+ * src/arm/sysv.S: Add unwinder directives.
+
+ * src/arm/ffi.c (ffi_prep_args): Align structs by at least 4 bytes.
+ Only treat r0 as a struct address if we're actually returning a
+ struct by address.
+ Only copy the bytes that are actually within a struct.
+ (ffi_prep_cif_machdep): A Composite Type not larger than 4 bytes
+ is returned in r0, not passed by address.
+ (ffi_call): Allocate a word-sized temporary for the case where
+ a composite is returned in r0.
+ (ffi_prep_incoming_args_SYSV): Align as necessary.
+
+2007-08-05 Steven Newbury <s_j_newbury@yahoo.co.uk>
+
+ * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use __clear_cache instead of
+ directly using the sys_cacheflush syscall.
+
+2007-07-27 Andrew Haley <aph@redhat.com>
+
+ * src/arm/sysv.S (ffi_closure_SYSV): Add soft-float.
+
+2007-09-03 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * Makefile.am: Unify MIPS_IRIX and MIPS_LINUX into MIPS.
+ * configure.ac: Likewise.
+ * Makefile.in: Regenerate.
+ * include/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+ * configure: Likewise.
+
+2007-08-24 David Daney <ddaney@avtrex.com>
+
+ * testsuite/libffi.call/return_sl.c: New test.
+
+2007-08-10 David Daney <ddaney@avtrex.com>
+
+ * testsuite/libffi.call/cls_multi_ushort.c,
+ testsuite/libffi.call/cls_align_uint16.c,
+ testsuite/libffi.call/nested_struct1.c,
+ testsuite/libffi.call/nested_struct3.c,
+ testsuite/libffi.call/cls_7_1_byte.c,
+ testsuite/libffi.call/nested_struct5.c,
+ testsuite/libffi.call/cls_double.c,
+ testsuite/libffi.call/nested_struct7.c,
+ testsuite/libffi.call/cls_sint.c,
+ testsuite/libffi.call/nested_struct9.c,
+ testsuite/libffi.call/cls_20byte1.c,
+ testsuite/libffi.call/cls_multi_sshortchar.c,
+ testsuite/libffi.call/cls_align_sint64.c,
+ testsuite/libffi.call/cls_3byte2.c,
+ testsuite/libffi.call/cls_multi_schar.c,
+ testsuite/libffi.call/cls_multi_uchar.c,
+ testsuite/libffi.call/cls_19byte.c,
+ testsuite/libffi.call/cls_9byte1.c,
+ testsuite/libffi.call/cls_align_float.c,
+ testsuite/libffi.call/closure_fn1.c,
+ testsuite/libffi.call/problem1.c,
+ testsuite/libffi.call/closure_fn3.c,
+ testsuite/libffi.call/cls_sshort.c,
+ testsuite/libffi.call/closure_fn5.c,
+ testsuite/libffi.call/cls_align_double.c,
+ testsuite/libffi.call/nested_struct.c,
+ testsuite/libffi.call/cls_2byte.c,
+ testsuite/libffi.call/nested_struct10.c,
+ testsuite/libffi.call/cls_4byte.c,
+ testsuite/libffi.call/cls_6byte.c,
+ testsuite/libffi.call/cls_8byte.c,
+ testsuite/libffi.call/cls_multi_sshort.c,
+ testsuite/libffi.call/cls_align_sint16.c,
+ testsuite/libffi.call/cls_align_uint32.c,
+ testsuite/libffi.call/cls_20byte.c,
+ testsuite/libffi.call/cls_float.c,
+ testsuite/libffi.call/nested_struct2.c,
+ testsuite/libffi.call/cls_5_1_byte.c,
+ testsuite/libffi.call/nested_struct4.c,
+ testsuite/libffi.call/cls_24byte.c,
+ testsuite/libffi.call/nested_struct6.c,
+ testsuite/libffi.call/cls_64byte.c,
+ testsuite/libffi.call/nested_struct8.c,
+ testsuite/libffi.call/cls_uint.c,
+ testsuite/libffi.call/cls_multi_ushortchar.c,
+ testsuite/libffi.call/cls_schar.c,
+ testsuite/libffi.call/cls_uchar.c,
+ testsuite/libffi.call/cls_align_uint64.c,
+ testsuite/libffi.call/cls_ulonglong.c,
+ testsuite/libffi.call/cls_align_longdouble.c,
+ testsuite/libffi.call/cls_1_1byte.c,
+ testsuite/libffi.call/cls_12byte.c,
+ testsuite/libffi.call/cls_3_1byte.c,
+ testsuite/libffi.call/cls_3byte1.c,
+ testsuite/libffi.call/cls_4_1byte.c,
+ testsuite/libffi.call/cls_6_1_byte.c,
+ testsuite/libffi.call/cls_16byte.c,
+ testsuite/libffi.call/cls_18byte.c,
+ testsuite/libffi.call/closure_fn0.c,
+ testsuite/libffi.call/cls_9byte2.c,
+ testsuite/libffi.call/closure_fn2.c,
+ testsuite/libffi.call/closure_fn4.c,
+ testsuite/libffi.call/cls_ushort.c,
+ testsuite/libffi.call/closure_fn6.c,
+ testsuite/libffi.call/cls_5byte.c,
+ testsuite/libffi.call/cls_align_pointer.c,
+ testsuite/libffi.call/cls_7byte.c,
+ testsuite/libffi.call/cls_align_sint32.c,
+ testsuite/libffi.special/unwindtest_ffi_call.cc,
+ testsuite/libffi.special/unwindtest.cc: Remove xfail for mips64*-*-*.
+
+2007-08-10 David Daney <ddaney@avtrex.com>
+
+ PR libffi/28313
+ * configure.ac: Don't treat mips64 as a special case.
+ * Makefile.am (nodist_libffi_la_SOURCES): Add n32.S.
+ * configure: Regenerate
+ * Makefile.in: Ditto.
+ * fficonfig.h.in: Ditto.
+ * src/mips/ffitarget.h (REG_L, REG_S, SUBU, ADDU, SRL, LI): Indent.
+ (LA, EH_FRAME_ALIGN, FDE_ADDR_BYTES): New preprocessor macros.
+ (FFI_DEFAULT_ABI): Set for n64 case.
+ (FFI_CLOSURES, FFI_TRAMPOLINE_SIZE): Define for n32 and n64 cases.
+ * src/mips/n32.S (ffi_call_N32): Add debug macros and labels for FDE.
+ (ffi_closure_N32): New function.
+ (.eh_frame): New section
+ * src/mips/o32.S: Clean up comments.
+ (ffi_closure_O32): Pass ffi_closure parameter in $12.
+ * src/mips/ffi.c: Use FFI_MIPS_N32 instead of
+ _MIPS_SIM == _ABIN32 throughout.
+ (FFI_MIPS_STOP_HERE): New, use in place of
+ ffi_stop_here.
+ (ffi_prep_args): Use unsigned long to hold pointer values. Rewrite
+ to support n32/n64 ABIs.
+ (calc_n32_struct_flags): Rewrite.
+ (calc_n32_return_struct_flags): Remove unused variable. Reverse
+ position of flag bits.
+ (ffi_prep_cif_machdep): Rewrite n32 portion.
+ (ffi_call): Enable for n64. Add special handling for small structure
+ return values.
+ (ffi_prep_closure_loc): Add n32 and n64 support.
+ (ffi_closure_mips_inner_O32): Add cast to silence warning.
+ (copy_struct_N32, ffi_closure_mips_inner_N32): New functions.
+
+2007-08-08 David Daney <ddaney@avtrex.com>
+
+ * testsuite/libffi.call/ffitest.h (ffi_type_mylong): Remove definition.
+ * testsuite/libffi.call/cls_align_uint16.c (main): Use correct type
+ specifiers.
+ * testsuite/libffi.call/nested_struct1.c (main): Ditto.
+ * testsuite/libffi.call/cls_sint.c (main): Ditto.
+ * testsuite/libffi.call/nested_struct9.c (main): Ditto.
+ * testsuite/libffi.call/cls_20byte1.c (main): Ditto.
+ * testsuite/libffi.call/cls_9byte1.c (main): Ditto.
+ * testsuite/libffi.call/closure_fn1.c (main): Ditto.
+ * testsuite/libffi.call/closure_fn3.c (main): Ditto.
+ * testsuite/libffi.call/return_dbl2.c (main): Ditto.
+ * testsuite/libffi.call/cls_sshort.c (main): Ditto.
+ * testsuite/libffi.call/return_fl3.c (main): Ditto.
+ * testsuite/libffi.call/closure_fn5.c (main): Ditto.
+ * testsuite/libffi.call/nested_struct.c (main): Ditto.
+ * testsuite/libffi.call/nested_struct10.c (main): Ditto.
+ * testsuite/libffi.call/return_ll1.c (main): Ditto.
+ * testsuite/libffi.call/cls_8byte.c (main): Ditto.
+ * testsuite/libffi.call/cls_align_uint32.c (main): Ditto.
+ * testsuite/libffi.call/cls_align_sint16.c (main): Ditto.
+ * testsuite/libffi.call/cls_20byte.c (main): Ditto.
+ * testsuite/libffi.call/nested_struct2.c (main): Ditto.
+ * testsuite/libffi.call/cls_24byte.c (main): Ditto.
+ * testsuite/libffi.call/nested_struct6.c (main): Ditto.
+ * testsuite/libffi.call/cls_uint.c (main): Ditto.
+ * testsuite/libffi.call/cls_12byte.c (main): Ditto.
+ * testsuite/libffi.call/cls_16byte.c (main): Ditto.
+ * testsuite/libffi.call/closure_fn0.c (main): Ditto.
+ * testsuite/libffi.call/cls_9byte2.c (main): Ditto.
+ * testsuite/libffi.call/closure_fn2.c (main): Ditto.
+ * testsuite/libffi.call/return_dbl1.c (main): Ditto.
+ * testsuite/libffi.call/closure_fn4.c (main): Ditto.
+ * testsuite/libffi.call/closure_fn6.c (main): Ditto.
+ * testsuite/libffi.call/cls_align_sint32.c (main): Ditto.
+
+2007-08-07 Andrew Haley <aph@redhat.com>
+
+ * src/x86/sysv.S (ffi_closure_raw_SYSV): Fix typo in previous
+ checkin.
+
+2007-08-06 Andrew Haley <aph@redhat.com>
+
+ PR testsuite/32843
+ * src/x86/sysv.S (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8,
+ FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32,
+ FFI_TYPE_SINT32.
+
+2007-08-02 David Daney <ddaney@avtrex.com>
+
+ * testsuite/libffi.call/return_ul.c (main): Define return type as
+ ffi_arg. Use proper printf conversion specifier.
+
+2007-07-30 Andrew Haley <aph@redhat.com>
+
+ PR testsuite/32843
+ * src/x86/ffi.c (ffi_prep_cif_machdep): in x86 case, add code for
+ signed/unsigned int8/16.
+ * src/x86/sysv.S (ffi_call_SYSV): Rewrite to:
+ Use a jump table.
+ Remove code to pop args from the stack after call.
+ Special-case signed/unsigned int8/16.
+ * testsuite/libffi.call/return_sc.c (main): Revert.
+
+2007-07-26 Richard Guenther <rguenther@suse.de>
+
+ PR testsuite/32843
+ * testsuite/libffi.call/return_sc.c (main): Verify call
+ result as signed char, not ffi_arg.
+
+2007-07-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.ac (i?86-*-solaris2.1[0-9]): Set TARGET to X86_64.
+ * configure: Regenerate.
+
+2007-07-11 David Daney <ddaney@avtrex.com>
+
+ * src/mips/ffi.c: Don't include sys/cachectl.h.
+ (ffi_prep_closure_loc): Use __builtin___clear_cache() instead of
+ cacheflush().
+
+2007-05-18 Aurelien Jarno <aurelien@aurel32.net>
+
+ * src/arm/ffi.c (ffi_prep_closure_loc): Renamed and ajusted
+ from (ffi_prep_closure): ... this.
+ (FFI_INIT_TRAMPOLINE): Adjust.
+
+2005-12-31 Phil Blundell <pb@reciva.com>
+
+ * src/arm/ffi.c (ffi_prep_incoming_args_SYSV,
+ ffi_closure_SYSV_inner, ffi_prep_closure): New, add closure support.
+ * src/arm/sysv.S(ffi_closure_SYSV): Likewise.
+ * src/arm/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
+ (FFI_CLOSURES): Enable closure support.
+
+2007-07-03 Andrew Haley <aph@hedges.billgatliff.com>
+
+ * testsuite/libffi.call/cls_multi_ushort.c,
+ testsuite/libffi.call/cls_align_uint16.c,
+ testsuite/libffi.call/nested_struct1.c,
+ testsuite/libffi.call/nested_struct3.c,
+ testsuite/libffi.call/cls_7_1_byte.c,
+ testsuite/libffi.call/cls_double.c,
+ testsuite/libffi.call/nested_struct5.c,
+ testsuite/libffi.call/nested_struct7.c,
+ testsuite/libffi.call/cls_sint.c,
+ testsuite/libffi.call/nested_struct9.c,
+ testsuite/libffi.call/cls_20byte1.c,
+ testsuite/libffi.call/cls_multi_sshortchar.c,
+ testsuite/libffi.call/cls_align_sint64.c,
+ testsuite/libffi.call/cls_3byte2.c,
+ testsuite/libffi.call/cls_multi_schar.c,
+ testsuite/libffi.call/cls_multi_uchar.c,
+ testsuite/libffi.call/cls_19byte.c,
+ testsuite/libffi.call/cls_9byte1.c,
+ testsuite/libffi.call/cls_align_float.c,
+ testsuite/libffi.call/closure_fn1.c,
+ testsuite/libffi.call/problem1.c,
+ testsuite/libffi.call/closure_fn3.c,
+ testsuite/libffi.call/cls_sshort.c,
+ testsuite/libffi.call/closure_fn5.c,
+ testsuite/libffi.call/cls_align_double.c,
+ testsuite/libffi.call/cls_2byte.c,
+ testsuite/libffi.call/nested_struct.c,
+ testsuite/libffi.call/nested_struct10.c,
+ testsuite/libffi.call/cls_4byte.c,
+ testsuite/libffi.call/cls_6byte.c,
+ testsuite/libffi.call/cls_8byte.c,
+ testsuite/libffi.call/cls_multi_sshort.c,
+ testsuite/libffi.call/cls_align_uint32.c,
+ testsuite/libffi.call/cls_align_sint16.c,
+ testsuite/libffi.call/cls_float.c,
+ testsuite/libffi.call/cls_20byte.c,
+ testsuite/libffi.call/cls_5_1_byte.c,
+ testsuite/libffi.call/nested_struct2.c,
+ testsuite/libffi.call/cls_24byte.c,
+ testsuite/libffi.call/nested_struct4.c,
+ testsuite/libffi.call/nested_struct6.c,
+ testsuite/libffi.call/cls_64byte.c,
+ testsuite/libffi.call/nested_struct8.c,
+ testsuite/libffi.call/cls_uint.c,
+ testsuite/libffi.call/cls_multi_ushortchar.c,
+ testsuite/libffi.call/cls_schar.c,
+ testsuite/libffi.call/cls_uchar.c,
+ testsuite/libffi.call/cls_align_uint64.c,
+ testsuite/libffi.call/cls_ulonglong.c,
+ testsuite/libffi.call/cls_align_longdouble.c,
+ testsuite/libffi.call/cls_1_1byte.c,
+ testsuite/libffi.call/cls_12byte.c,
+ testsuite/libffi.call/cls_3_1byte.c,
+ testsuite/libffi.call/cls_3byte1.c,
+ testsuite/libffi.call/cls_4_1byte.c,
+ testsuite/libffi.call/cls_6_1_byte.c,
+ testsuite/libffi.call/cls_16byte.c,
+ testsuite/libffi.call/cls_18byte.c,
+ testsuite/libffi.call/closure_fn0.c,
+ testsuite/libffi.call/cls_9byte2.c,
+ testsuite/libffi.call/closure_fn2.c,
+ testsuite/libffi.call/closure_fn4.c,
+ testsuite/libffi.call/cls_ushort.c,
+ testsuite/libffi.call/closure_fn6.c,
+ testsuite/libffi.call/cls_5byte.c,
+ testsuite/libffi.call/cls_align_pointer.c,
+ testsuite/libffi.call/cls_7byte.c,
+ testsuite/libffi.call/cls_align_sint32.c,
+ testsuite/libffi.special/unwindtest_ffi_call.cc,
+ testsuite/libffi.special/unwindtest.cc: Enable for ARM.
+
+2007-07-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * aclocal.m4: Regenerated.
+
+2007-06-02 Paolo Bonzini <bonzini@gnu.org>
+
+ * configure: Regenerate.
+
+2007-05-23 Steve Ellcey <sje@cup.hp.com>
+
+ * Makefile.in: Regenerate.
+ * configure: Regenerate.
+ * aclocal.m4: Regenerate.
+ * include/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+
+2007-05-10 Roman Zippel <zippel@linux-m68k.org>
+
+ * src/m68k/ffi.c (ffi_prep_incoming_args_SYSV,
+ ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support.
+ * src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise.
+ * src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
+ (FFI_CLOSURES): Enable closure support.
+
+2007-05-10 Roman Zippel <zippel@linux-m68k.org>
+
+ * configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test.
+ * configure: Regenerate.
+ * fficonfig.h.in: Regenerate.
+ * src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC,
+ CFI_OFFSET,CFI_DEF_CFA): New macros.
+ (ffi_call_SYSV): Add callframe annotation.
+
+2007-05-10 Roman Zippel <zippel@linux-m68k.org>
+
+ * src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix
+ numerous test suite failures.
+ * src/m68k/sysv.S (ffi_call_SYSV): Likewise.
+
+2007-04-11 Paolo Bonzini <bonzini@gnu.org>
+
+ * Makefile.am (EXTRA_DIST): Bring up to date.
+ * Makefile.in: Regenerate.
+ * src/frv/eabi.S: Remove RCS keyword.
+
+2007-04-06 Richard Henderson <rth@redhat.com>
+
+ * configure.ac: Tidy target case.
+ (HAVE_LONG_DOUBLE): Allow the target to override.
+ * configure: Regenerate.
+ * include/ffi.h.in: Don't define ffi_type_foo if
+ LIBFFI_HIDE_BASIC_TYPES is defined.
+ (ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define
+ to ffi_type_double.
+ * types.c (LIBFFI_HIDE_BASIC_TYPES): Define.
+ (FFI_TYPEDEF, ffi_type_void): Mark the data const.
+ (ffi_type_longdouble): Special case for Alpha. Don't define
+ if long double == double.
+
+ * src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value.
+ (ffi_prep_cif_machdep): Handle it as the 128-bit type.
+ (ffi_call, ffi_closure_osf_inner): Likewise.
+ (ffi_closure_osf_inner): Likewise. Mark hidden.
+ (ffi_call_osf, ffi_closure_osf): Mark hidden.
+ * src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition.
+ * src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden.
+ (load_table): Handle 128-bit long double.
+
+ * testsuite/libffi.call/float4.c: Add -mieee for alpha.
+
+2007-04-06 Tom Tromey <tromey@redhat.com>
+
+ PR libffi/31491:
+ * README: Fixed bug in example.
+
+2007-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ * src/closures.c: Include sys/statfs.h.
+ (_GNU_SOURCE): Define on Linux.
+ (FFI_MMAP_EXEC_SELINUX): Define.
+ (selinux_enabled): New variable.
+ (selinux_enabled_check): New function.
+ (is_selinux_enabled): Define.
+ (dlmmap): Use it.
+
+2007-03-24 Uros Bizjak <ubizjak@gmail.com>
+
+ * testsuite/libffi.call/return_fl2.c (return_fl): Mark as static.
+ Use 'volatile float sum' to create sum of floats to avoid false
+ negative due to excess precision on ix86 targets.
+ (main): Ditto.
+
+2007-03-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * src/powerpc/ffi.c (flush_icache): Fix left-over from previous
+ patch.
+ (ffi_prep_closure_loc): Remove unneeded casts. Add needed ones.
+
+2007-03-07 Alexandre Oliva <aoliva@redhat.com>
+
+ * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New.
+ (ffi_prep_closure_loc): New.
+ (ffi_prep_raw_closure_loc): New.
+ (ffi_prep_java_raw_closure_loc): New.
+ * src/closures.c: New file.
+ * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment):
+ Replace sflags with exec_offset.
+ [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset,
+ sub_segment_exec_offset): New macros.
+ (get_segment_flags, set_segment_flags, check_segment_merge): New
+ macros.
+ (is_mmapped_segment, is_extern_segment): Use get_segment_flags.
+ (add_segment, sys_alloc, create_mspace, create_mspace_with_base,
+ destroy_mspace): Use new macros.
+ (sys_alloc): Silence warning.
+ * Makefile.am (libffi_la_SOURCES): Add src/closures.c.
+ * Makefile.in: Rebuilt.
+ * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in
+ terms of ffi_prep_closure_loc.
+ * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted
+ from...
+ (ffi_prep_raw_closure): ... this. Re-implement in terms of the
+ renamed version.
+ * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and
+ adjusted from...
+ (ffi_prep_java_raw_closure): ... this. Re-implement in terms of
+ the renamed version.
+ * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from
+ (ffi_prep_closure): ... this.
+ * src/pa/ffi.c: Likewise.
+ * src/cris/ffi.c: Likewise. Adjust.
+ * src/frv/ffi.c: Likewise.
+ * src/ia64/ffi.c: Likewise.
+ * src/mips/ffi.c: Likewise.
+ * src/powerpc/ffi_darwin.c: Likewise.
+ * src/s390/ffi.c: Likewise.
+ * src/sh/ffi.c: Likewise.
+ * src/sh64/ffi.c: Likewise.
+ * src/sparc/ffi.c: Likewise.
+ * src/x86/ffi64.c: Likewise.
+ * src/x86/ffi.c: Likewise.
+ (FFI_INIT_TRAMPOLINE): Adjust.
+ (ffi_prep_raw_closure_loc): Renamed and adjusted from...
+ (ffi_prep_raw_closure): ... this.
+ * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from
+ (ffi_prep_closure): ... this.
+ (flush_icache): Adjust.
+
+2007-03-07 Alexandre Oliva <aoliva@redhat.com>
+
+ * src/dlmalloc.c: New file, imported version 2.8.3 of Doug
+ Lea's malloc.
+
+2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
+
+ * Makefile.am: Add dummy install-pdf target.
+ * Makefile.in: Regenerate
+
+2007-02-13 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep,
+ ffi_closure_helper_SYSV): Add long double handling.
+
+2007-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ * src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2
+ immediately after bctrl instruction.
+
+2007-01-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.am (all-recursive, install-recursive,
+ mostlyclean-recursive, clean-recursive, distclean-recursive,
+ maintainer-clean-recursive): Add missing targets.
+ * Makefile.in: Rebuilt.
+
+2006-12-14 Andreas Tobler <a.tobler@schweiz.org>
+
+ * configure.ac: Add TARGET for x86_64-*-darwin*.
+ * Makefile.am (nodist_libffi_la_SOURCES): Add rules for 64-bit sources
+ for X86_DARWIN.
+ * src/x86/ffitarget.h: Set trampoline size for x86_64-*-darwin*.
+ * src/x86/darwin64.S: New file for x86_64-*-darwin* support.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+ * include/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+ * testsuite/libffi.special/unwindtest_ffi_call.cc: New test case for
+ ffi_call only.
+
+2006-12-13 Andreas Tobler <a.tobler@schweiz.org>
+
+ * aclocal.m4: Regenerate with aclocal -I .. as written in the
+ Makefile.am.
+
+2006-10-31 Geoffrey Keating <geoffk@apple.com>
+
+ * src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New.
+ (ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for
+ Darwin.
+ * testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL.
+ * testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL.
+
+2006-10-10 Paolo Bonzini <bonzini@gnu.org>
+ Sandro Tolaini <tolaini@libero.it>
+
+ * configure.ac [i*86-*-darwin*]: Set X86_DARWIN symbol and
+ conditional.
+ * configure: Regenerated.
+ * Makefile.am (nodist_libffi_la_SOURCES) [X86_DARWIN]: New case.
+ (EXTRA_DIST): Add src/x86/darwin.S.
+ * Makefile.in: Regenerated.
+ * include/Makefile.in: Regenerated.
+ * testsuite/Makefile.in: Regenerated.
+
+ * src/x86/ffi.c (ffi_prep_cif_machdep) [X86_DARWIN]: Treat like
+ X86_WIN32, and additionally align stack to 16 bytes.
+ * src/x86/darwin.S: New, based on sysv.S.
+ * src/prep_cif.c (ffi_prep_cif) [X86_DARWIN]: Align > 8-byte structs.
+
+2006-09-12 David Daney <ddaney@avtrex.com>
+
+ PR libffi/23935
+ * include/Makefile.am: Install both ffi.h and ffitarget.h in
+ $(libdir)/gcc/$(target_alias)/$(gcc_version)/include.
+ * aclocal.m4: Regenerated for automake 1.9.6.
+ * Makefile.in: Regenerated.
+ * include/Makefile.in: Regenerated.
+ * testsuite/Makefile.in: Regenerated.
+
+2006-08-17 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * include/ffi_common.h (struct): Revert accidental commit.
+
+2006-08-15 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * include/ffi_common.h: Remove lint directives.
+ * include/ffi.h.in: Likewise.
+
+2006-07-25 Torsten Schoenfeld <kaffeetisch@gmx.de>
+
+ * include/ffi.h.in (ffi_type_ulong, ffi_type_slong): Define correctly
+ for 32-bit architectures.
+ * testsuite/libffi.call/return_ul.c: New test case.
+
+2006-07-19 David Daney <ddaney@avtrex.com>
+
+ * testsuite/libffi.call/closure_fn6.c: Remove xfail for mips,
+ xfail remains for mips64.
+
+2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
+
+ * Makefile.am: Add install-html target. Add install-html to .PHONY
+ * Makefile.in: Regenerate.
+ * aclocal.m4: Regenerate.
+ * include/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+
+2006-05-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from
+ stack slot.
+
+2006-04-22 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * README: Remove notice about 'Crazy Comments'.
+ * src/debug.c: Remove lint directives. Cleanup white spaces.
+ * src/java_raw_api.c: Likewise.
+ * src/prep_cif.c: Likewise.
+ * src/raw_api.c: Likewise.
+ * src/ffitest.c: Delete. No longer needed, all test cases migrated
+ to the testsuite.
+ * src/arm/ffi.c: Remove lint directives.
+ * src/m32r/ffi.c: Likewise.
+ * src/pa/ffi.c: Likewise.
+ * src/powerpc/ffi.c: Likewise.
+ * src/powerpc/ffi_darwin.c: Likewise.
+ * src/sh/ffi.c: Likewise.
+ * src/sh64/ffi.c: Likewise.
+ * src/x86/ffi.c: Likewise.
+ * testsuite/libffi.call/float2.c: Likewise.
+ * testsuite/libffi.call/promotion.c: Likewise.
+ * testsuite/libffi.call/struct1.c: Likewise.
+
+2006-04-13 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/pa/hpux32.S: Correct unwind offset calculation for
+ ffi_closure_pa32.
+ * src/pa/linux.S: Likewise.
+
+2006-04-12 James E Wilson <wilson@specifix.com>
+
+ PR libgcj/26483
+ * src/ia64/ffi.c (stf_spill, ldf_fill): Rewrite as macros.
+ (hfa_type_load): Call stf_spill.
+ (hfa_type_store): Call ldf_fill.
+ (ffi_call): Adjust calls to above routines. Add local temps for
+ macro result.
+
+2006-04-10 Matthias Klose <doko@debian.org>
+
+ * testsuite/lib/libffi-dg.exp (libffi-init): Recognize multilib
+ directory names containing underscores.
+
+2006-04-07 James E Wilson <wilson@specifix.com>
+
+ * testsuite/libffi.call/float4.c: New testcase.
+
+2006-04-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+ Andreas Tobler <a.tobler@schweiz.ch>
+
+ * Makefile.am: Add PA_HPUX port.
+ * Makefile.in: Regenerate.
+ * include/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+ * configure.ac: Add PA_HPUX rules.
+ * configure: Regenerate.
+ * src/pa/ffitarget.h: Rename linux target to PA_LINUX.
+ Add PA_HPUX and PA64_HPUX.
+ Rename FFI_LINUX ABI to FFI_PA32 ABI.
+ (FFI_TRAMPOLINE_SIZE): Define for 32-bit HP-UX targets.
+ (FFI_TYPE_SMALL_STRUCT2): Define.
+ (FFI_TYPE_SMALL_STRUCT4): Likewise.
+ (FFI_TYPE_SMALL_STRUCT8): Likewise.
+ (FFI_TYPE_SMALL_STRUCT3): Redefine.
+ (FFI_TYPE_SMALL_STRUCT5): Likewise.
+ (FFI_TYPE_SMALL_STRUCT6): Likewise.
+ (FFI_TYPE_SMALL_STRUCT7): Likewise.
+ * src/pa/ffi.c (ROUND_DOWN): Delete.
+ (fldw, fstw, fldd, fstd): Use '__asm__'.
+ (ffi_struct_type): Add support for FFI_TYPE_SMALL_STRUCT2,
+ FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8.
+ (ffi_prep_args_LINUX): Rename to ffi_prep_args_pa32. Update comment.
+ Simplify incrementing of stack slot variable. Change type of local
+ 'n' to unsigned int.
+ (ffi_size_stack_LINUX): Rename to ffi_size_stack_pa32. Handle long
+ double on PA_HPUX.
+ (ffi_prep_cif_machdep): Likewise.
+ (ffi_call): Likewise.
+ (ffi_closure_inner_LINUX): Rename to ffi_closure_inner_pa32. Change
+ return type to ffi_status. Simplify incrementing of stack slot
+ variable. Only copy floating point argument registers when PA_LINUX
+ is true. Reformat debug statement.
+ Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and
+ FFI_TYPE_SMALL_STRUCT8.
+ (ffi_closure_LINUX): Rename to ffi_closure_pa32. Add 'extern' to
+ declaration.
+ (ffi_prep_closure): Make linux trampoline conditional on PA_LINUX.
+ Add nops to cache flush. Add trampoline for PA_HPUX.
+ * src/pa/hpux32.S: New file.
+ * src/pa/linux.S (ffi_call_LINUX): Rename to ffi_call_pa32. Rename
+ ffi_prep_args_LINUX to ffi_prep_args_pa32.
+ Localize labels. Add support for 2, 4 and 8-byte small structs. Handle
+ unaligned destinations in 3, 5, 6 and 7-byte small structs. Order
+ argument type checks so that common argument types appear first.
+ (ffi_closure_LINUX): Rename to ffi_closure_pa32. Rename
+ ffi_closure_inner_LINUX to ffi_closure_inner_pa32.
+
+2006-03-24 Alan Modra <amodra@bigpond.net.au>
+
+ * src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX. Default
+ for 32-bit using IBM extended double format. Fix FFI_LAST_ABI.
+ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of
+ FFI_TYPE_LONGDOUBLE.
+ (ffi_prep_args64): Assert using IBM extended double.
+ (ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type.
+ Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args.
+ (ffi_call): Handle FFI_LINUX.
+ (ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs
+ gpr3 return pointer as for struct return. Handle FFI_LINUX
+ FFI_TYPE_LONGDOUBLE return and args. Don't increment "nf"
+ unnecessarily.
+ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2
+ for FFI_TYPE_LONGDOUBLE. Move epilogue insns into case table.
+ Don't use r6 as pointer to results, instead use sp offset. Don't
+ make a special call to load lr with case table address, instead
+ use offset from previous call.
+ * src/powerpc/sysv.S (ffi_call_SYSV): Save long double return.
+ * src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double
+ return.
+
+2006-03-15 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh64/ffi.c (ffi_prep_cif_machdep): Handle float arguments
+ passed with FP registers correctly.
+ (ffi_closure_helper_SYSV): Likewise.
+ * src/sh64/sysv.S: Likewise.
+
+2006-03-01 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.special/unwindtest.cc (closure_test_fn): Mark cif,
+ args and userdata unused.
+ (closure_test_fn1): Mark cif and userdata unused.
+ (main): Remove unused res.
+
+2006-02-28 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for
+ -O2, -O3, -Os and the warning flags -W -Wall.
+ * testsuite/libffi.special/special.exp: Likewise.
+ * testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark
+ unused parameter unused for gcc or else do nothing.
+ * testsuite/libffi.special/ffitestcxx.h: Likewise.
+ * testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif
+ and userdata unused.
+ * testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise.
+ * testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise.
+ * testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise.
+ * testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise.
+ * testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise.
+ * testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise.
+ * testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise.
+ * testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise.
+ * testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise.
+ * testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise.
+ * testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise.
+ * testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise.
+ * testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise.
+ * testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise.
+ * testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise.
+ * testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise.
+ * testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise.
+ * testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise.
+ * testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise.
+ * testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise.
+ * testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn):
+ Likewise.
+ * testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn):
+ Likewise.
+ * testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn):
+ Likewise.
+ * testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast
+ void* to avoid compiler warning.
+ (main): Likewise.
+ (cls_struct_align_gn): Mark cif and userdata unused.
+ * testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn):
+ Likewise.
+ * testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn):
+ Likewise.
+ * testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn):
+ Likewise.
+ * testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn):
+ Likewise.
+ * testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn):
+ Likewise.
+ * testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise.
+ * testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise.
+ * testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and
+ data unused.
+ (main): Cast res_call to silence gcc.
+ * testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and
+ data unused.
+ (main): Cast res_call to silence gcc.
+ * testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif
+ and data unused.
+ (main): Cast res_call to silence gcc.
+ * testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and
+ data unused.
+ (main): Cast res_call to silence gcc.
+ * testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and
+ data unused.
+ (main): Cast res_call to silence gcc.
+ * testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif
+ and data unused.
+ (main): Cast res_call to silence gcc.
+ * testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and
+ userdata unused.
+ (cls_ret_schar_fn): Cast printf parameter to silence gcc.
+ * testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and
+ userdata unused.
+ (cls_ret_sint_fn): Cast printf parameter to silence gcc.
+ * testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and
+ userdata unused.
+ (cls_ret_sshort_fn): Cast printf parameter to silence gcc.
+ * testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn): Mark cif and
+ userdata unused.
+ (cls_ret_uchar_fn): Cast printf parameter to silence gcc.
+ * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and
+ userdata unused.
+ (cls_ret_uint_fn): Cast printf parameter to silence gcc.
+ * testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif
+ and userdata unused.
+ * testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and
+ userdata unused.
+ (cls_ret_ushort_fn): Cast printf parameter to silence gcc.
+ * testsuite/libffi.call/float.c (floating): Remove unused parameter e.
+ * testsuite/libffi.call/float1.c (main): Remove unused variable i.
+ Cleanup white spaces.
+ * testsuite/libffi.call/negint.c (checking): Remove unused variable i.
+ * testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark
+ cif and userdata unused.
+ * testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn):
+ Likewise.
+ * testsuite/libffi.call/nested_struct10.c (B_gn): Likewise.
+ * testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf
+ formatters to silence gcc.
+ (B_gn): Mark cif and userdata unused.
+ * testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata
+ unused.
+ * testsuite/libffi.call/nested_struct4.c: Mention related PR.
+ (B_gn): Mark cif and userdata unused.
+ * testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata
+ unused.
+ * testsuite/libffi.call/nested_struct6.c: Mention related PR.
+ (B_gn): Mark cif and userdata unused.
+ * testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata
+ unused.
+ * testsuite/libffi.call/nested_struct8.c (B_gn): Likewise.
+ * testsuite/libffi.call/nested_struct9.c (B_gn): Likewise.
+ * testsuite/libffi.call/problem1.c (stub): Likewise.
+ * testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence
+ gcc.
+ * testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned
+ in the last commit for this test case in the test case itself.
+ * testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as
+ unused.
+ * testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise.
+ * testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise.
+ * testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise.
+ * testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise.
+ * testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise.
+ * testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise.
+
+2006-02-22 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/sysv.S: Fix register numbers in the FDE for
+ ffi_closure_SYSV.
+
+2006-02-20 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/return_fl2.c (return_fl): Remove static
+ declaration to avoid a false negative on ix86. See PR323.
+
+2006-02-18 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (ffi_closure_helper_SYSV): Remove unused variable
+ and cast integer to void * if needed. Update the pointer to
+ the FP register saved area correctly.
+
+2006-02-17 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/nested_struct6.c: XFAIL this test until PR25630
+ is fixed.
+ * testsuite/libffi.call/nested_struct4.c: Likewise.
+
+2006-02-16 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/return_dbl.c: New test case.
+ * testsuite/libffi.call/return_dbl1.c: Likewise.
+ * testsuite/libffi.call/return_dbl2.c: Likewise.
+ * testsuite/libffi.call/return_fl.c: Likewise.
+ * testsuite/libffi.call/return_fl1.c: Likewise.
+ * testsuite/libffi.call/return_fl2.c: Likewise.
+ * testsuite/libffi.call/return_fl3.c: Likewise.
+ * testsuite/libffi.call/closure_fn6.c: Likewise.
+
+ * testsuite/libffi.call/nested_struct2.c: Remove ffi_type_mylong
+ definition.
+ * testsuite/libffi.call/ffitest.h: Add ffi_type_mylong definition
+ here to be used by other test cases too.
+
+ * testsuite/libffi.call/nested_struct10.c: New test case.
+ * testsuite/libffi.call/nested_struct9.c: Likewise.
+ * testsuite/libffi.call/nested_struct8.c: Likewise.
+ * testsuite/libffi.call/nested_struct7.c: Likewise.
+ * testsuite/libffi.call/nested_struct6.c: Likewise.
+ * testsuite/libffi.call/nested_struct5.c: Likewise.
+ * testsuite/libffi.call/nested_struct4.c: Likewise.
+
+2006-01-21 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * configure.ac: Enable libffi for sparc64-*-freebsd*.
+ * configure: Rebuilt.
+
+2006-01-18 Jakub Jelinek <jakub@redhat.com>
+
+ * src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3,
+ instead do the shifting inline.
+ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5
+ shift count unconditionally. Simplify load sequences for 1, 2, 3, 4
+ and 8 byte structs, for the remaining struct sizes don't call
+ __lshrdi3, instead do the shifting inline.
+
+2005-12-07 Thiemo Seufer <ths@networkno.de>
+
+ * src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add
+ missing parentheses.
+ * src/mips/o32.S (ffi_call_O32): Code formatting. Define
+ and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations.
+ (ffi_closure_O32): Likewise, but with newly defined A3_OFF2,
+ A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2,
+ V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2,
+ FA_0_0_OFF2.
+ * src/mips/ffi.c (ffi_prep_args): Code formatting. Fix
+ endianness bugs.
+ (ffi_prep_closure): Improve trampoline instruction scheduling.
+ (ffi_closure_mips_inner_O32): Fix endianness bugs.
+
+2005-12-03 Alan Modra <amodra@bigpond.net.au>
+
+ * src/powerpc/ffi.c: Formatting.
+ (ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions.
+ (ffi_prep_args64): Likewise.
+
+2005-09-30 Geoffrey Keating <geoffk@apple.com>
+
+ * testsuite/lib/libffi-dg.exp (libffi_target_compile): For
+ darwin, use -shared-libgcc not -lgcc_s, and explain why.
+
+2005-09-26 Tom Tromey <tromey@redhat.com>
+
+ * testsuite/libffi.call/float1.c (value_type): New typedef.
+ (CANARY): New define.
+ (main): Check for result buffer overflow.
+ * src/powerpc/linux64.S: Handle linux64 long double returns.
+ * src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant.
+ (ffi_prep_cif_machdep): Handle linux64 long double returns.
+
+2005-08-25 Alan Modra <amodra@bigpond.net.au>
+
+ PR target/23404
+ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack
+ homed fp args.
+ (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same.
+
+2005-08-11 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test.
+ (AH_BOTTOM): Add FFI_HIDDEN definition.
+ * configure: Rebuilt.
+ * fficonfig.h.in: Rebuilt.
+ * src/powerpc/ffi.c (hidden): Remove.
+ (ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64,
+ ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden.
+ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64,
+ .ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden.
+ * src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove,
+ add FFI_HIDDEN to its prototype.
+ (ffi_closure_SYSV_inner): New.
+ * src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New.
+ * src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New.
+
+2005-08-10 Alfred M. Szmidt <ams@gnu.org>
+
+ PR libffi/21819:
+ * configure: Rebuilt.
+ * configure.ac: Handle i*86-*-gnu*.
+
+2005-08-09 Jakub Jelinek <jakub@redhat.com>
+
+ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use
+ DW_CFA_offset_extended_sf rather than
+ DW_CFA_GNU_negative_offset_extended.
+ * src/powerpc/sysv.S (ffi_call_SYSV): Likewise.
+
+2005-07-22 SUGIOKA Toshinobu <sugioka@itonet.co.jp>
+
+ * src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly
+ on sh3.
+ (ffi_closure_SYSV): Change the stack layout for sh3 struct argument.
+ * src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is
+ partially on register.
+ (ffi_closure_helper_SYSV): Likewise.
+ (ffi_prep_cif_machdep): Don't set too many cif->flags.
+
+2005-07-20 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (ffi_call): Handle small structures correctly.
+ Remove empty line.
+ * src/sh64/ffi.c (simple_type): Remove.
+ (return_type): Handle small structures correctly.
+ (ffi_prep_args): Likewise.
+ (ffi_call): Likewise.
+ (ffi_closure_helper_SYSV): Likewise.
+ * src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return.
+ Emit position independent code if PIC and remove wrong datalabel
+ prefixes from EH data.
+
+2005-07-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD.
+ * Makefile.in: Regenerate.
+ * include/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+ * configure.ac: Add POWERPC_FREEBSD rules.
+ * configure: Regenerate.
+ * src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules.
+ (FFI_SYSV_TYPE_SMALL_STRUCT): Define.
+ * src/powerpc/ffi.c: Add flags to handle small structure returns
+ in ffi_call_SYSV.
+ (ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI.
+ Aka FFI_SYSV.
+ (ffi_closure_helper_SYSV): Likewise.
+ * src/powerpc/ppc_closure.S: Add return types for small structures.
+ * src/powerpc/sysv.S: Add bits to handle small structures for
+ final SYSV 4 ABI.
+
+2005-07-10 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/cls_5_1_byte.c: New test file.
+ * testsuite/libffi.call/cls_6_1_byte.c: Likewise.
+ * testsuite/libffi.call/cls_7_1_byte.c: Likewise.
+
+2005-07-05 Randolph Chung <tausq@debian.org>
+
+ * src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1
+ as FFI_TYPE_SMALL_STRUCT3. Break out handling for 5-7 byte
+ structures. Kill compilation warnings.
+ (ffi_closure_inner_LINUX): Print return values as hex in debug
+ message. Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3.
+ Properly handle 5-7 byte structure returns.
+ * src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1)
+ (FFI_TYPE_SMALL_STRUCT2): Remove.
+ (FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5)
+ (FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define.
+ * src/pa/linux.S: Mark source file as using PA1.1 assembly.
+ (checksmst1, checksmst2): Remove.
+ (checksmst3): Optimize handling of 3-byte struct returns.
+ (checksmst567): Properly handle 5-7 byte struct returns.
+
+2005-06-15 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ PR libgcj/21943
+ * src/mips/n32.S: Enforce PIC code.
+ * src/mips/o32.S: Likewise.
+
+2005-06-15 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.ac: Treat i*86-*-solaris2.10 and up as X86_64.
+ * configure: Regenerate.
+
+2005-06-01 Alan Modra <amodra@bigpond.net.au>
+
+ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET
+ to call ffi_closure_helper_SYSV. Append @local instead.
+ * src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV.
+
+2005-05-17 Kelley Cook <kcook@gcc.gnu.org>
+
+ * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
+ Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
+ * Makefile.am (ACLOCAL_AMFLAGS): Remove -I ../config.
+ * aclocal.m4, configure, fficonfig.h.in, Makefile.in,
+ include/Makefile.in, testsuite/Makefile.in: Regenerate.
+
+2005-05-09 Mike Stump <mrs@apple.com>
+
+ * configure: Regenerate.
+
+2005-05-08 Richard Henderson <rth@redhat.com>
+
+ PR libffi/21285
+ * src/alpha/osf.S: Update unwind into to match code.
+
+2005-05-04 Andreas Degert <ad@papyrus-gmbh.de>
+ Richard Henderson <rth@redhat.com>
+
+ * src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in
+ bit 11 of flags.
+ (ffi_call): Mask return type field. Pass ssecount to ffi_call_unix64.
+ (ffi_prep_closure): Set carry bit if sse-used flag set.
+ * src/x86/unix64.S (ffi_call_unix64): Add ssecount argument.
+ Only load sse registers if ssecount non-zero.
+ (ffi_closure_unix64): Only save sse registers if carry set on entry.
+
+2005-04-29 Ralf Corsepius <ralf.corsepius@rtems.org>
+
+ * configure.ac: Add i*86-*-rtems*, sparc*-*-rtems*,
+ powerpc-*rtems*, arm*-*-rtems*, sh-*-rtems*.
+ * configure: Regenerate.
+
+2005-04-20 Hans-Peter Nilsson <hp@axis.com>
+
+ * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): In regsub use,
+ have Tcl8.3-compatible intermediate variable.
+
+2005-04-18 Simon Posnjak <simon.posnjak@siol.net>
+ Hans-Peter Nilsson <hp@axis.com>
+
+ * Makefile.am: Add CRIS support.
+ * configure.ac: Likewise.
+ * Makefile.in, configure, testsuite/Makefile.in,
+ include/Makefile.in: Regenerate.
+ * src/cris: New directory.
+ * src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files.
+ * src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__.
+
+ * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with
+ \r?\n in output tests.
+
+2005-04-12 Mike Stump <mrs@apple.com>
+
+ * configure: Regenerate.
+
+2005-03-30 Hans Boehm <Hans.Boehm@hp.com>
+
+ * src/ia64/ffitarget.h (ffi_arg): Use long long instead of DI.
+
+2005-03-30 Steve Ellcey <sje@cup.hp.com>
+
+ * src/ia64/ffitarget.h (ffi_arg) ADD DI attribute.
+ (ffi_sarg) Ditto.
+ * src/ia64/unix.S (ffi_closure_unix): Extend gp
+ to 64 bits in ILP32 mode.
+ Load 64 bits even for short data.
+
+2005-03-23 Mike Stump <mrs@apple.com>
+
+ * src/powerpc/darwin.S: Update for -m64 multilib.
+ * src/powerpc/darwin_closure.S: Likewise.
+
+2005-03-21 Zack Weinberg <zack@codesourcery.com>
+
+ * configure.ac: Do not invoke TL_AC_GCC_VERSION.
+ Do not set tool_include_dir.
+ * aclocal.m4, configure, Makefile.in, testsuite/Makefile.in:
+ Regenerate.
+ * include/Makefile.am: Set gcc_version and toollibffidir.
+ * include/Makefile.in: Regenerate.
+
+2005-02-22 Andrew Haley <aph@redhat.com>
+
+ * src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to
+ odd-numbered register pairs for 64-bit integer types.
+
+2005-02-23 Andreas Tobler <a.tobler@schweiz.ch>
+
+ PR libffi/20104
+ * testsuite/libffi.call/return_ll1.c: New test case.
+
+2005-02-11 Janis Johnson <janis187@us.ibm.com>
+
+ * testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options.
+ * testsuite/libffi.call/float.c: Ditto.
+ * testsuite/libffi.call/float2.c: Ditto.
+ * testsuite/libffi.call/float3.c: Ditto.
+
+2005-02-08 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv.
+
+2005-01-12 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * testsuite/libffi.special/special.exp (cxx_options): Add
+ -shared-libgcc.
+
+2004-12-31 Richard Henderson <rth@redhat.com>
+
+ * src/types.c (FFI_AGGREGATE_TYPEDEF): Remove.
+ (FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF. Replace size and
+ offset parameters with a type parameter; deduce size and structure
+ alignment. Update all users.
+
+2004-12-31 Richard Henderson <rth@redhat.com>
+
+ * src/types.c (FFI_TYPE_POINTER): Define with sizeof.
+ (FFI_TYPE_LONGDOUBLE): Fix for ia64.
+ * src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move
+ into ffi_prep_closure.
+ * src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite
+ from scratch.
+
+2004-12-27 Richard Henderson <rth@redhat.com>
+
+ * src/x86/unix64.S: Fix typo in unwind info.
+
+2004-12-25 Richard Henderson <rth@redhat.com>
+
+ * src/x86/ffi64.c (struct register_args): Rename from stackLayout.
+ (enum x86_64_reg_class): Add X86_64_COMPLEX_X87_CLASS.
+ (merge_classes): Check for it.
+ (SSE_CLASS_P): New.
+ (classify_argument): Pass byte_offset by value; perform all updates
+ inside struct case.
+ (examine_argument): Add classes argument; handle
+ X86_64_COMPLEX_X87_CLASS.
+ (ffi_prep_args): Merge into ...
+ (ffi_call): ... here. Share stack frame with ffi_call_unix64.
+ (ffi_prep_cif_machdep): Setup cif->flags for proper structure return.
+ (ffi_fill_return_value): Remove.
+ (ffi_prep_closure): Remove dead assert.
+ (ffi_closure_unix64_inner): Rename from ffi_closure_UNIX64_inner.
+ Rewrite to use struct register_args instead of va_list. Create
+ flags for handling structure returns.
+ * src/x86/unix64.S: Remove dead strings.
+ (ffi_call_unix64): Rename from ffi_call_UNIX64. Rewrite to share
+ stack frame with ffi_call. Handle structure returns properly.
+ (float2sse, floatfloat2sse, double2sse): Remove.
+ (sse2float, sse2double, sse2floatfloat): Remove.
+ (ffi_closure_unix64): Rename from ffi_closure_UNIX64. Rewrite
+ to handle structure returns properly.
+
+2004-12-08 David Edelsohn <edelsohn@gnu.org>
+
+ * Makefile.am (AM_MAKEFLAGS): Remove duplicate LIBCFLAGS and
+ PICFLAG.
+ * Makefile.in: Regenerated.
+
+2004-12-02 Richard Sandiford <rsandifo@redhat.com>
+
+ * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version.
+ * configure, aclocal.m4, Makefile.in: Regenerate.
+ * include/Makefile.in, testsuite/Makefile.in: Regenerate.
+
+2004-11-29 Kelley Cook <kcook@gcc.gnu.org>
+
+ * configure: Regenerate for libtool change.
+
+2004-11-25 Kelley Cook <kcook@gcc.gnu.org>
+
+ * configure: Regenerate for libtool reversion.
+
+2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
+
+ * configure: Regenerate for libtool change.
+
+2004-11-23 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp.
+
+2004-11-23 Richard Sandiford <rsandifo@redhat.com>
+
+ * src/mips/o32.S (ffi_call_O32, ffi_closure_O32): Use jalr instead
+ of jal. Use an absolute encoding for the frame information.
+
+2004-11-23 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.am: Remove no-dependencies. Add ACLOCAL_AMFLAGS.
+ * acinclude.m4: Delete logic for sincludes.
+ * aclocal.m4, Makefile.in, configure: Regenerate.
+ * include/Makefile: Likewise.
+ * testsuite/Makefile: Likewise.
+
+2004-11-22 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * src/sparc/ffi.c (ffi_prep_closure): Align doubles and 64-bit integers
+ on a 8-byte boundary.
+ * src/sparc/v8.S (ffi_closure_v8): Reserve frame space for arguments.
+
+2004-10-27 Richard Earnshaw <rearnsha@arm.com>
+
+ * src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return
+ long long values. Round stack allocation to a multiple of 8 bytes
+ for ATPCS compatibility.
+ * src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register
+ names. Handle returning long long types. Add Thumb and interworking
+ support. Improve soft-float code.
+
+2004-10-27 Richard Earnshaw <rearnsha@arm.com>
+
+ * testsuite/lib/libffi-db.exp (load_gcc_lib): New function.
+ (libffi_exit): New function.
+ (libffi_init): Build the testglue wrapper if needed.
+
+2004-10-25 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR other/18138
+ * testsuite/lib/libffi-dg.exp: Accept more than one multilib libgcc.
+
+2004-10-25 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * src/m32r/libffitarget.h (FFI_CLOSURES): Set to 0.
+
+2004-10-20 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/sysv.S (ffi_call_SYSV): Don't align for double data.
+ * testsuite/libffi.call/float3.c: New test case.
+
+2004-10-18 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (ffi_prep_closure): Set T bit in trampoline for
+ the function returning a structure pointed with R2.
+ * src/sh/sysv.S (ffi_closure_SYSV): Use R2 as the pointer to
+ the structure return value if T bit set. Emit position
+ independent code and EH data if PIC.
+
+2004-10-13 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * Makefile.am: Add m32r support.
+ * configure.ac: Likewise.
+ * Makefile.in: Regenerate.
+ * confiugre: Regenerate.
+ * src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF
+ (uint64, sint64, double, longdouble)
+ * src/m32r: New directory.
+ * src/m32r/ffi.c: New file.
+ * src/m32r/sysv.S: Likewise.
+ * src/m32r/ffitarget.h: Likewise.
+
+2004-10-02 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * testsuite/libffi.call/negint.c: New test case.
+
+2004-09-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR libgcj/17465
+ * testsuite/lib/libffi-dg.exp: Don't use global ld_library_path.
+ Set up LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH,
+ LD_LIBRARY64_PATH, LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64 and
+ DYLD_LIBRARY_PATH.
+
+2004-09-05 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/many_win32.c: Remove whitespaces.
+ * testsuite/libffi.call/promotion.c: Likewise.
+ * testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup
+ whitespaces.
+ * testsuite/libffi.call/return_sc.c: Likewise.
+ * testsuite/libffi.call/return_uc.c: Likewise.
+
+2004-09-05 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/darwin.S: Fix comments and identation.
+ * src/powerpc/darwin_closure.S: Likewise.
+
+2004-09-02 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/ffi_darwin.c: Add flag for longdouble return values.
+ (ffi_prep_args): Handle longdouble arguments.
+ (ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for
+ longdouble.
+ (ffi_closure_helper_DARWIN): Add closure handling for longdouble.
+ * src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble
+ values.
+ * src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise.
+ * src/types.c: Defined longdouble size and alignment for darwin.
+
+2004-09-02 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/aix.S: Remove whitespaces.
+ * src/powerpc/aix_closure.S: Likewise.
+ * src/powerpc/asm.h: Likewise.
+ * src/powerpc/ffi.c: Likewise.
+ * src/powerpc/ffitarget.h: Likewise.
+ * src/powerpc/linux64.S: Likewise.
+ * src/powerpc/linux64_closure.S: Likewise.
+ * src/powerpc/ppc_closure.S: Likewise.
+ * src/powerpc/sysv.S: Likewise.
+
+2004-08-30 Anthony Green <green@redhat.com>
+
+ * Makefile.am: Add frv support.
+ * Makefile.in, testsuite/Makefile.in: Rebuilt.
+ * configure.ac: Read configure.host.
+ * configure.in: Read configure.host.
+ * configure.host: New file. frv-elf needs libgloss.
+ * include/ffi.h.in: Force ffi_closure to have a nice big (8)
+ alignment. This is needed to frv and shouldn't harm the others.
+ * include/ffi_common.h (ALIGN_DOWN): New macro.
+ * src/frv/ffi.c, src/frv/ffitarget.h, src/frv/eabi.S: New files.
+
+2004-08-24 David Daney <daney@avtrex.com>
+
+ * testsuite/libffi.call/closure_fn0.c: Xfail mips64* instead of mips*.
+ * testsuite/libffi.call/closure_fn1.c: Likewise.
+ * testsuite/libffi.call/closure_fn2.c Likewise.
+ * testsuite/libffi.call/closure_fn3.c: Likewise.
+ * testsuite/libffi.call/closure_fn4.c: Likewise.
+ * testsuite/libffi.call/closure_fn5.c: Likewise.
+ * testsuite/libffi.call/cls_18byte.c: Likewise.
+ * testsuite/libffi.call/cls_19byte.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte1.c: Likewise.
+ * testsuite/libffi.call/cls_24byte.c: Likewise.
+ * testsuite/libffi.call/cls_2byte.c: Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_3byte1.c: Likewise.
+ * testsuite/libffi.call/cls_3byte2.c: Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_4byte.c: Likewise.
+ * testsuite/libffi.call/cls_64byte.c: Likewise.
+ * testsuite/libffi.call/cls_6byte.c: Likewise.
+ * testsuite/libffi.call/cls_7byte.c: Likewise.
+ * testsuite/libffi.call/cls_8byte.c: Likewise.
+ * testsuite/libffi.call/cls_9byte1.c: Likewise.
+ * testsuite/libffi.call/cls_9byte2.c: Likewise.
+ * testsuite/libffi.call/cls_align_double.c: Likewise.
+ * testsuite/libffi.call/cls_align_float.c: Likewise.
+ * testsuite/libffi.call/cls_align_longdouble.c: Likewise.
+ * testsuite/libffi.call/cls_align_pointer.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint16.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint32.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint64.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint16.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint32.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint64.c: Likewise.
+ * testsuite/libffi.call/cls_double.c: Likewise.
+ * testsuite/libffi.call/cls_float.c: Likewise.
+ * testsuite/libffi.call/cls_multi_schar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_sshort.c: Likewise.
+ * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_ushort.c: Likewise.
+ * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise.
+ * testsuite/libffi.call/cls_schar.c: Likewise.
+ * testsuite/libffi.call/cls_sint.c: Likewise.
+ * testsuite/libffi.call/cls_sshort.c: Likewise.
+ * testsuite/libffi.call/cls_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_uint.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/cls_ushort.c: Likewise.
+ * testsuite/libffi.call/nested_struct.c: Likewise.
+ * testsuite/libffi.call/nested_struct1.c: Likewise.
+ * testsuite/libffi.call/nested_struct2.c: Likewise.
+ * testsuite/libffi.call/nested_struct3.c: Likewise.
+ * testsuite/libffi.call/problem1.c: Likewise.
+ * testsuite/libffi.special/unwindtest.cc: Likewise.
+ * testsuite/libffi.call/cls_12byte.c: Likewise and set return value
+ to zero.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_5byte.c: Likewise.
+
+2004-08-23 David Daney <daney@avtrex.com>
+
+ PR libgcj/13141
+ * src/mips/ffitarget.h (FFI_O32_SOFT_FLOAT): New ABI.
+ * src/mips/ffi.c (ffi_prep_args): Fix alignment calculation.
+ (ffi_prep_cif_machdep): Handle FFI_O32_SOFT_FLOAT floating point
+ parameters and return types.
+ (ffi_call): Handle FFI_O32_SOFT_FLOAT ABI.
+ (ffi_prep_closure): Ditto.
+ (ffi_closure_mips_inner_O32): Handle FFI_O32_SOFT_FLOAT ABI, fix
+ alignment calculations.
+ * src/mips/o32.S (ffi_closure_O32): Don't use floating point
+ instructions if FFI_O32_SOFT_FLOAT, make stack frame ABI compliant.
+
+2004-08-14 Casey Marshall <csm@gnu.org>
+
+ * src/mips/ffi.c (ffi_pref_cif_machdep): set `cif->flags' to
+ contain `FFI_TYPE_UINT64' as return type for any 64-bit
+ integer (O32 ABI only).
+ (ffi_prep_closure): new function.
+ (ffi_closure_mips_inner_O32): new function.
+ * src/mips/ffitarget.h: Define `FFI_CLOSURES' and
+ `FFI_TRAMPOLINE_SIZE' appropriately if the ABI is o32.
+ * src/mips/o32.S (ffi_call_O32): add labels for .eh_frame. Return
+ 64 bit integers correctly.
+ (ffi_closure_O32): new function.
+ Added DWARF-2 unwind info for both functions.
+
+2004-08-10 Andrew Haley <aph@redhat.com>
+
+ * src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments.
+
+2004-08-01 Robert Millan <robertmh@gnu.org>
+
+ * configure.ac: Detect knetbsd-gnu and kfreebsd-gnu.
+ * configure: Regenerate.
+
+2004-07-30 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h>
+ and mmap() explicitly instead of relying on preset autoconf cache
+ variables.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2004-07-11 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation.
+ (ffi_check_float_struct): Remove unused prototype.
+
+2004-06-30 Geoffrey Keating <geoffk@apple.com>
+
+ * src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment
+ character on Darwin, use '\n\t' instead.
+
+2004-06-26 Matthias Klose <doko@debian.org>
+
+ * libtool-version: Fix typo in revision/age.
+
+2004-06-17 Matthias Klose <doko@debian.org>
+
+ * libtool-version: New.
+ * Makefile.am (libffi_la_LDFLAGS): Use -version-info for soname.
+ * Makefile.in: Regenerate.
+
+2004-06-15 Paolo Bonzini <bonzini@gnu.org>
+
+ * Makefile.am: Remove useless multilib rules.
+ * Makefile.in: Regenerate.
+ * aclocal.m4: Regenerate with automake 1.8.5.
+ * configure.ac: Remove useless multilib configury.
+ * configure: Regenerate.
+
+2004-06-15 Paolo Bonzini <bonzini@gnu.org>
+
+ * .cvsignore: New file.
+
+2004-06-10 Jakub Jelinek <jakub@redhat.com>
+
+ * src/ia64/unix.S (ffi_call_unix): Insert group barrier break
+ fp_done.
+ (ffi_closure_UNIX): Fix f14/f15 adjustment if FLOAT_SZ is ever
+ changed from 8.
+
+2004-06-06 Sean McNeil <sean@mcneil.com>
+
+ * configure.ac: Add x86_64-*-freebsd* support.
+ * configure: Regenerate.
+
+2004-04-26 Joe Buck <jbuck@welsh-buck.org>
+
+ Bug 15093
+ * configure.ac: Test for existence of mmap and sys/mman.h before
+ checking blacklist. Fix suggested by Jim Wilson.
+ * configure: Regenerate.
+
+2004-04-26 Matt Austern <austern@apple.com>
+
+ * src/powerpc/darwin.S: Go through a non-lazy pointer for initial
+ FDE location.
+ * src/powerpc/darwin_closure.S: Likewise.
+
+2004-04-24 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/cls_multi_schar.c (main): Fix initialization
+ error. Reported by Thomas Heller <theller@python.net>.
+ * testsuite/libffi.call/cls_multi_sshort.c (main): Likewise.
+ * testsuite/libffi.call/cls_multi_ushort.c (main): Likewise.
+
+2004-03-20 Matthias Klose <doko@debian.org>
+
+ * src/pa/linux.S: Fix typo.
+
+2004-03-19 Matthias Klose <doko@debian.org>
+
+ * Makefile.am: Update.
+ * Makefile.in: Regenerate.
+ * src/pa/ffi.h.in: Remove.
+ * src/pa/ffitarget.h: New file.
+
+2004-02-10 Randolph Chung <tausq@debian.org>
+
+ * Makefile.am: Add PA support.
+ * Makefile.in: Regenerate.
+ * include/Makefile.in: Regenerate.
+ * configure.ac: Add PA target.
+ * configure: Regenerate.
+ * src/pa/ffi.c: New file.
+ * src/pa/ffi.h.in: Add PA support.
+ * src/pa/linux.S: New file.
+ * prep_cif.c: Add PA support.
+
+2004-03-16 Hosaka Yuji <hos@tamanegi.org>
+
+ * src/types.c: Fix alignment size of X86_WIN32 case int64 and
+ double.
+ * src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type
+ with ecif->cif->flags.
+ (ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type
+ with cif->flags.
+ (ffi_prep_cif_machdep): Add X86_WIN32 struct case.
+ (ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32.
+ * src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b,
+ sc_retstruct2b): Add for 1 or 2-bytes struct case.
+
+2004-03-15 Kelley Cook <kcook@gcc.gnu.org>
+
+ * configure.in: Rename file to ...
+ * configure.ac: ... this.
+ * fficonfig.h.in: Regenerate.
+ * Makefile.in: Regenerate.
+ * include/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+
+2004-03-12 Matt Austern <austern@apple.com>
+
+ * src/powerpc/darwin.S: Fix EH information so it corresponds to
+ changes in EH format resulting from addition of linkonce support.
+ * src/powerpc/darwin_closure.S: Likewise.
+
+2004-03-11 Andreas Tobler <a.tobler@schweiz.ch>
+ Paolo Bonzini <bonzini@gnu.org>
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Set them.
+ Remove VPATH. Remove rules for object files. Remove multilib support.
+ (AM_CCASFLAGS): Add.
+ * configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER.
+ (AC_PREREQ): Bump version to 2.59.
+ (AC_INIT): Fill with version info and bug address.
+ (ORIGINAL_LD_FOR_MULTILIBS): Remove.
+ (AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE.
+ De-precious CC so that the right flags are passed down to multilibs.
+ (AC_MSG_ERROR): Replace obsolete macro AC_ERROR.
+ (AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES.
+ (AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS.
+ * configure: Rebuilt.
+ * aclocal.m4: Likewise.
+ * Makefile.in, include/Makefile.in, testsuite/Makefile.in: Likewise.
+ * fficonfig.h.in: Likewise.
+
+2004-03-11 Andreas Schwab <schwab@suse.de>
+
+ * src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point
+ arguments from fp registers only for the first 8 parameter slots.
+ Don't convert a float parameter when passed in memory.
+
+2004-03-09 Hans-Peter Nilsson <hp@axis.com>
+
+ * configure: Regenerate for config/accross.m4 correction.
+
+2004-02-25 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Change
+ ecif->cif->bytes to bytes.
+ (ffi_prep_cif_machdep): Add braces around nested if statement.
+
+2004-02-09 Alan Modra <amodra@bigpond.net.au>
+
+ * src/types.c (pointer): POWERPC64 has 8 byte pointers.
+
+ * src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling.
+ (ffi_closure_helper_LINUX64): Fix typo.
+ * testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128
+ for powerpc64-*-*.
+ * testsuite/libffi.call/float.c: Likewise.
+ * testsuite/libffi.call/float2.c: Likewise.
+
+2004-02-08 Alan Modra <amodra@bigpond.net.au>
+
+ * src/powerpc/ffi.c (ffi_prep_cif_machdep <FFI_LINUX64>): Correct
+ long double function return and long double arg handling.
+ (ffi_closure_helper_LINUX64): Formatting. Delete unused "ng" var.
+ Use "end_pfr" instead of "nf". Correct long double handling.
+ Localise "temp".
+ * src/powerpc/linux64.S (ffi_call_LINUX64): Save f2 long double
+ return value.
+ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Allocate
+ space for long double return value. Adjust stack frame and offsets.
+ Load f2 long double return.
+
+2004-02-07 Alan Modra <amodra@bigpond.net.au>
+
+ * src/types.c: Use 16 byte long double for POWERPC64.
+
+2004-01-25 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * src/sparc/ffi.c (ffi_prep_args_v9): Shift the parameter array
+ when the structure return address is passed in %o0.
+ (ffi_V9_return_struct): Rename into ffi_v9_layout_struct.
+ (ffi_v9_layout_struct): Align the field following a nested structure
+ on a word boundary. Use memmove instead of memcpy.
+ (ffi_call): Update call to ffi_V9_return_struct.
+ (ffi_prep_closure): Define 'ctx' only for V8.
+ (ffi_closure_sparc_inner): Clone into ffi_closure_sparc_inner_v8
+ and ffi_closure_sparc_inner_v9.
+ (ffi_closure_sparc_inner_v8): Return long doubles by reference.
+ Always skip the structure return address. For structures and long
+ doubles, copy the argument directly.
+ (ffi_closure_sparc_inner_v9): Skip the structure return address only
+ if required. Shift the maximum floating-point slot accordingly. For
+ big structures, copy the argument directly; otherwise, left-justify the
+ argument and call ffi_v9_layout_struct to lay out the structure on
+ the stack.
+ * src/sparc/v8.S: Undef STACKFRAME before defining it.
+ (ffi_closure_v8): Pass the structure return address. Update call to
+ ffi_closure_sparc_inner_v8. Short-circuit FFI_TYPE_INT handling.
+ Skip the 'unimp' insn when returning long doubles and structures.
+ * src/sparc/v9.S: Undef STACKFRAME before defining it.
+ (ffi_closure_v9): Increase the frame size by 2 words. Short-circuit
+ FFI_TYPE_INT handling. Load structures both in integers and
+ floating-point registers on return.
+ * README: Update status of the SPARC port.
+
+2004-01-24 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/pyobjc-tc.c (main): Treat result value
+ as of type ffi_arg.
+ * testsuite/libffi.call/struct3.c (main): Fix CHECK.
+
+2004-01-22 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result
+ value as of type ffi_arg, not unsigned int.
+
+2004-01-21 Michael Ritzert <ritzert@t-online.de>
+
+ * ffi64.c (ffi_prep_args): Cast the RHS of an assignment instead
+ of the LHS.
+
+2004-01-12 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_32 for
+ Solaris.
+
+2004-01-08 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * testsuite/libffi.call/ffitest.h (allocate_mmap): Cast MAP_FAILED
+ to void *.
+
+2003-12-10 Richard Henderson <rth@redhat.com>
+
+ * testsuite/libffi.call/cls_align_pointer.c: Cast pointers to
+ size_t instead of int.
+
+2003-12-04 Hosaka Yuji <hos@tamanegi.org>
+
+ * testsuite/libffi.call/many_win32.c: Include <float.h>.
+ * testsuite/libffi.call/many_win32.c (main): Replace variable
+ int i with unsigned long ul.
+
+ * testsuite/libffi.call/cls_align_uint64.c: New test case.
+ * testsuite/libffi.call/cls_align_sint64.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint32.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint32.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint16.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint16.c: Likewise.
+ * testsuite/libffi.call/cls_align_float.c: Likewise.
+ * testsuite/libffi.call/cls_align_double.c: Likewise.
+ * testsuite/libffi.call/cls_align_longdouble.c: Likewise.
+ * testsuite/libffi.call/cls_align_pointer.c: Likewise.
+
+2003-12-02 Hosaka Yuji <hos@tamanegi.org>
+
+ PR other/13221
+ * src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV):
+ Align arguments to 32 bits.
+
+2003-12-01 Andreas Tobler <a.tobler@schweiz.ch>
+
+ PR other/13221
+ * testsuite/libffi.call/cls_multi_sshort.c: New test case.
+ * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_schar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_ushort.c: Likewise.
+
+ * testsuite/libffi.special/unwindtest.cc: Cosmetics.
+
+2003-11-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * testsuite/libffi.call/ffitest.h: Include <fcntl.h>.
+ * testsuite/libffi.special/ffitestcxx.h: Likewise.
+
+2003-11-22 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * Makefile.in: Rebuilt.
+ * configure: Likewise.
+ * testsuite/libffi.special/unwindtest.cc: Convert the mmap to
+ the right type.
+
+2003-11-21 Andreas Jaeger <aj@suse.de>
+ Andreas Tobler <a.tobler@schweiz.ch>
+
+ * acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST.
+ * configure.in: Call AC_FUNC_MMAP_BLACKLIST.
+ * Makefile.in: Rebuilt.
+ * aclocal.m4: Likewise.
+ * configure: Likewise.
+ * fficonfig.h.in: Likewise.
+ * testsuite/lib/libffi-dg.exp: Add include dir.
+ * testsuite/libffi.call/ffitest.h: Add MMAP definitions.
+ * testsuite/libffi.special/ffitestcxx.h: Likewise.
+ * testsuite/libffi.call/closure_fn0.c: Use MMAP functionality
+ for ffi_closure if available.
+ * testsuite/libffi.call/closure_fn1.c: Likewise.
+ * testsuite/libffi.call/closure_fn2.c: Likewise.
+ * testsuite/libffi.call/closure_fn3.c: Likewise.
+ * testsuite/libffi.call/closure_fn4.c: Likewise.
+ * testsuite/libffi.call/closure_fn5.c: Likewise.
+ * testsuite/libffi.call/cls_12byte.c: Likewise.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_18byte.c: Likewise.
+ * testsuite/libffi.call/cls_19byte.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte1.c: Likewise.
+ * testsuite/libffi.call/cls_24byte.c: Likewise.
+ * testsuite/libffi.call/cls_2byte.c: Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_3byte1.c: Likewise.
+ * testsuite/libffi.call/cls_3byte2.c: Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_4byte.c: Likewise.
+ * testsuite/libffi.call/cls_5byte.c: Likewise.
+ * testsuite/libffi.call/cls_64byte.c: Likewise.
+ * testsuite/libffi.call/cls_6byte.c: Likewise.
+ * testsuite/libffi.call/cls_7byte.c: Likewise.
+ * testsuite/libffi.call/cls_8byte.c: Likewise.
+ * testsuite/libffi.call/cls_9byte1.c: Likewise.
+ * testsuite/libffi.call/cls_9byte2.c: Likewise.
+ * testsuite/libffi.call/cls_double.c: Likewise.
+ * testsuite/libffi.call/cls_float.c: Likewise.
+ * testsuite/libffi.call/cls_schar.c: Likewise.
+ * testsuite/libffi.call/cls_sint.c: Likewise.
+ * testsuite/libffi.call/cls_sshort.c: Likewise.
+ * testsuite/libffi.call/cls_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_uint.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/cls_ushort.c: Likewise.
+ * testsuite/libffi.call/nested_struct.c: Likewise.
+ * testsuite/libffi.call/nested_struct1.c: Likewise.
+ * testsuite/libffi.call/nested_struct2.c: Likewise.
+ * testsuite/libffi.call/nested_struct3.c: Likewise.
+ * testsuite/libffi.call/problem1.c: Likewise.
+ * testsuite/libffi.special/unwindtest.cc: Likewise.
+
+2003-11-20 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional.
+
+2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin.
+ Add -lgcc_s to additional flags.
+
+2003-11-12 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * configure.in, include/Makefile.am: PR libgcj/11147, install
+ the ffitarget.h header file in a gcc versioned and target
+ dependent place.
+ * configure: Regenerated.
+ * Makefile.in, include/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+
+2003-11-09 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/closure_fn0.c: Print result and check
+ with dg-output to make debugging easier.
+ * testsuite/libffi.call/closure_fn1.c: Likewise.
+ * testsuite/libffi.call/closure_fn2.c: Likewise.
+ * testsuite/libffi.call/closure_fn3.c: Likewise.
+ * testsuite/libffi.call/closure_fn4.c: Likewise.
+ * testsuite/libffi.call/closure_fn5.c: Likewise.
+ * testsuite/libffi.call/cls_12byte.c: Likewise.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_18byte.c: Likewise.
+ * testsuite/libffi.call/cls_19byte.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte1.c: Likewise.
+ * testsuite/libffi.call/cls_24byte.c: Likewise.
+ * testsuite/libffi.call/cls_2byte.c: Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_3byte1.c: Likewise.
+ * testsuite/libffi.call/cls_3byte2.c: Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_4byte.c: Likewise.
+ * testsuite/libffi.call/cls_5byte.c: Likewise.
+ * testsuite/libffi.call/cls_64byte.c: Likewise.
+ * testsuite/libffi.call/cls_6byte.c: Likewise.
+ * testsuite/libffi.call/cls_7byte.c: Likewise.
+ * testsuite/libffi.call/cls_8byte.c: Likewise.
+ * testsuite/libffi.call/cls_9byte1.c: Likewise.
+ * testsuite/libffi.call/cls_9byte2.c: Likewise.
+ * testsuite/libffi.call/cls_double.c: Likewise.
+ * testsuite/libffi.call/cls_float.c: Likewise.
+ * testsuite/libffi.call/cls_schar.c: Likewise.
+ * testsuite/libffi.call/cls_sint.c: Likewise.
+ * testsuite/libffi.call/cls_sshort.c: Likewise.
+ * testsuite/libffi.call/cls_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_uint.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/cls_ushort.c: Likewise.
+ * testsuite/libffi.call/problem1.c: Likewise.
+
+ * testsuite/libffi.special/unwindtest.cc: Make ffi_closure
+ static.
+
+2003-11-08 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/cls_9byte2.c: New test case.
+ * testsuite/libffi.call/cls_9byte1.c: Likewise.
+ * testsuite/libffi.call/cls_64byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte1.c: Likewise.
+ * testsuite/libffi.call/cls_19byte.c: Likewise.
+ * testsuite/libffi.call/cls_18byte.c: Likewise.
+ * testsuite/libffi.call/closure_fn4.c: Likewise.
+ * testsuite/libffi.call/closure_fn5.c: Likewise.
+ * testsuite/libffi.call/cls_schar.c: Likewise.
+ * testsuite/libffi.call/cls_sint.c: Likewise.
+ * testsuite/libffi.call/cls_sshort.c: Likewise.
+ * testsuite/libffi.call/nested_struct2.c: Likewise.
+ * testsuite/libffi.call/nested_struct3.c: Likewise.
+
+2003-11-08 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/cls_double.c: Do a check on the result.
+ * testsuite/libffi.call/cls_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_uint.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/cls_ushort.c: Likewise.
+ * testsuite/libffi.call/return_sc.c: Cleanup whitespaces.
+
+2003-11-06 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/prep_cif.c (ffi_prep_cif): Move the validity check after
+ the initialization.
+
+2003-10-23 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace
+ FFI_ASSERT(FALSE) with FFI_ASSERT(0).
+
+2003-10-22 David Daney <ddaney@avtrex.com>
+
+ * src/mips/ffitarget.h: Replace undefined UINT32 and friends with
+ __attribute__((__mode__(__SI__))) and friends.
+
+2003-10-22 Andreas Schwab <schwab@suse.de>
+
+ * src/ia64/ffi.c: Replace FALSE/TRUE with false/true.
+
+2003-10-21 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * configure.in: AC_LINK_FILES(ffitarget.h).
+ * configure: Regenerate.
+ * Makefile.in: Likewise.
+ * include/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+ * fficonfig.h.in: Likewise.
+
+2003-10-21 Paolo Bonzini <bonzini@gnu.org>
+ Richard Henderson <rth@redhat.com>
+
+ Avoid that ffi.h includes fficonfig.h.
+
+ * Makefile.am (EXTRA_DIST): Include ffitarget.h files
+ (TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
+ (TARGET_SRC_MIPS_SGI): Removed.
+ (MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
+ (MIPS_SGI): Removed.
+ (CLEANFILES): Removed.
+ (mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New
+ targets.
+ * acconfig.h: Removed.
+ * configure.in: Compute sizeofs only for double and long double.
+ Use them to define and subst HAVE_LONG_DOUBLE. Include comments
+ into AC_DEFINE instead of using acconfig.h. Create
+ include/ffitarget.h instead of include/fficonfig.h. Rename
+ MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree.
+ AC_DEFINE EH_FRAME_FLAGS.
+ * include/Makefile.am (DISTCLEANFILES): New automake macro.
+ (hack_DATA): Add ffitarget.h.
+ * include/ffi.h.in: Remove all system specific definitions.
+ Declare raw API even if it is not installed, why bother?
+ Use limits.h instead of SIZEOF_* to define ffi_type_*. Do
+ not define EH_FRAME_FLAGS, it is in fficonfig.h now. Include
+ ffitarget.h instead of fficonfig.h. Remove ALIGN macro.
+ (UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead.
+ * include/ffi_common.h (bool): Do not define.
+ (ffi_assert): Accept failed assertion.
+ (ffi_type_test): Return void and accept file/line.
+ (FFI_ASSERT): Pass stringized failed assertion.
+ (FFI_ASSERT_AT): New macro.
+ (FFI_ASSERT_VALID_TYPE): New macro.
+ (UINT8, SINT8, UINT16, SINT16, UINT32, SINT32,
+ UINT64, SINT64): Define here with gcc's __attribute__ macro
+ instead of in ffi.h
+ (FLOAT32, ALIGN): Define here instead of in ffi.h
+ * include/ffi-mips.h: Removed. Its content moved to
+ src/mips/ffitarget.h after separating assembly and C sections.
+ * src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c
+ src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c,
+ src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S,
+ src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c:
+ SIZEOF_ARG -> FFI_SIZEOF_ARG.
+ * src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+).
+ * src/debug.c (ffi_assert): Accept stringized failed assertion.
+ (ffi_type_test): Rewritten.
+ * src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call
+ FFI_ASSERT_VALID_TYPE.
+ * src/alpha/ffitarget.h, src/arm/ffitarget.h,
+ src/ia64/ffitarget.h, src/m68k/ffitarget.h,
+ src/mips/ffitarget.h, src/powerpc/ffitarget.h,
+ src/s390/ffitarget.h, src/sh/ffitarget.h,
+ src/sh64/ffitarget.h, src/sparc/ffitarget.h,
+ src/x86/ffitarget.h: New files.
+ * src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S,
+ src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S,
+ src/powerpc/aix.S, src/powerpc/darwin.S,
+ src/powerpc/ffi_darwin.c, src/powerpc/linux64.S,
+ src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S,
+ src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S,
+ src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S,
+ src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S:
+ include fficonfig.h
+
+2003-10-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external
+ _MIPS_SIM_NABI32, _MIPS_SIM_ABI32.
+
+2003-10-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Declare bytes again.
+ Used when FFI_DEBUG = 1.
+
+2003-10-14 Alan Modra <amodra@bigpond.net.au>
+
+ * src/types.c (double, longdouble): Default POWERPC64 to 8 byte size
+ and align.
+
+2003-10-06 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs,
+ FFI_MIPS_O32 for O32 ABI.
+
+2003-10-01 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for
+ SPARC64. Cleanup whitespaces.
+
+2003-09-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/closure_fn0.c: Xfail mips, arm,
+ strongarm, xscale. Cleanup whitespaces.
+ * testsuite/libffi.call/closure_fn1.c: Likewise.
+ * testsuite/libffi.call/closure_fn2.c: Likewise.
+ * testsuite/libffi.call/closure_fn3.c: Likewise.
+ * testsuite/libffi.call/cls_12byte.c: Likewise.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.c: Likewise.
+ * testsuite/libffi.call/cls_24byte.c: Likewise.
+ * testsuite/libffi.call/cls_2byte.c: Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_3byte1.c: Likewise.
+ * testsuite/libffi.call/cls_3byte2.c: Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_4byte.c: Likewise.
+ * testsuite/libffi.call/cls_5byte.c: Likewise.
+ * testsuite/libffi.call/cls_6byte.c: Likewise.
+ * testsuite/libffi.call/cls_7byte.c: Likewise.
+ * testsuite/libffi.call/cls_8byte.c: Likewise.
+ * testsuite/libffi.call/cls_double.c: Likewise.
+ * testsuite/libffi.call/cls_float.c: Likewise.
+ * testsuite/libffi.call/cls_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_uint.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/cls_ushort.c: Likewise.
+ * testsuite/libffi.call/nested_struct.c: Likewise.
+ * testsuite/libffi.call/nested_struct1.c: Likewise.
+ * testsuite/libffi.call/problem1.c: Likewise.
+ * testsuite/libffi.special/unwindtest.cc: Likewise.
+ * testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces.
+
+2003-09-18 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/aix.S: Cleanup whitespaces.
+ * src/powerpc/aix_closure.S: Likewise.
+
+2003-09-18 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/darwin.S: Cleanup whitespaces, comment formatting.
+ * src/powerpc/darwin_closure.S: Likewise.
+ * src/powerpc/ffi_darwin.c: Likewise.
+
+2003-09-18 Andreas Tobler <a.tobler@schweiz.ch>
+ David Edelsohn <edelsohn@gnu.org>
+
+ * src/types.c (double): Add AIX and Darwin to the right TYPEDEF.
+ * src/powerpc/aix_closure.S: Remove the pointer to the outgoing
+ parameter stack.
+ * src/powerpc/darwin_closure.S: Likewise.
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures
+ according to the Darwin/AIX ABI.
+ (ffi_prep_cif_machdep): Likewise.
+ (ffi_closure_helper_DARWIN): Likewise.
+ Remove the outgoing parameter stack logic. Simplify the evaluation
+ of the different CASE types.
+ (ffi_prep_clousure): Avoid the casts on lvalues. Change the branch
+ statement in the trampoline code.
+
+2003-09-18 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (ffi_prep_args): Take account into the alignement
+ for the register size.
+ (ffi_closure_helper_SYSV): Handle the structure return value
+ address correctly.
+ (ffi_closure_helper_SYSV): Return the appropriate type when
+ the registers are used for the structure return value.
+ * src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for
+ the 64-bit return value. Update copyright years.
+
+2003-09-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in
+ srcdir for ffi_mips.h.
+
+2003-09-12 Alan Modra <amodra@bigpond.net.au>
+
+ * src/prep_cif.c (initialize_aggregate): Include tail padding in
+ structure size.
+ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct
+ placement of float result.
+ * testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct
+ cast of "resp" for big-endian 64 bit machines.
+
+2003-09-11 Alan Modra <amodra@bigpond.net.au>
+
+ * src/types.c (double, longdouble): Merge identical SH and ARM
+ typedefs, and add POWERPC64.
+ * src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for
+ struct split over gpr and rest.
+ (ffi_prep_cif_machdep): Correct intarg_count for structures.
+ * src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets.
+
+2003-09-09 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct
+ passing correctly.
+
+2003-09-09 Alan Modra <amodra@bigpond.net.au>
+
+ * configure: Regenerate.
+
+2003-09-04 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * Makefile.am: Remove build rules for ffitest.
+ * Makefile.in: Rebuilt.
+
+2003-09-04 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/java_raw_api.c: Include <stdlib.h> to fix compiler warning
+ about implicit declaration of abort().
+
+2003-09-04 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * Makefile.am: Add dejagnu test framework. Fixes PR other/11411.
+ * Makefile.in: Rebuilt.
+ * configure.in: Add dejagnu test framework.
+ * configure: Rebuilt.
+
+ * testsuite/Makefile.am: New file.
+ * testsuite/Makefile.in: Built
+ * testsuite/lib/libffi-dg.exp: New file.
+ * testsuite/config/default.exp: Likewise.
+ * testsuite/libffi.call/call.exp: Likewise.
+ * testsuite/libffi.call/ffitest.h: Likewise.
+ * testsuite/libffi.call/closure_fn0.c: Likewise.
+ * testsuite/libffi.call/closure_fn1.c: Likewise.
+ * testsuite/libffi.call/closure_fn2.c: Likewise.
+ * testsuite/libffi.call/closure_fn3.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_2byte.c: Likewise.
+ * testsuite/libffi.call/cls_3byte1.c: Likewise.
+ * testsuite/libffi.call/cls_3byte2.c: Likewise.
+ * testsuite/libffi.call/cls_4byte.c: Likewise.
+ * testsuite/libffi.call/cls_5byte.c: Likewise.
+ * testsuite/libffi.call/cls_6byte.c: Likewise.
+ * testsuite/libffi.call/cls_7byte.c: Likewise.
+ * testsuite/libffi.call/cls_8byte.c: Likewise.
+ * testsuite/libffi.call/cls_12byte.c: Likewise.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.c: Likewise.
+ * testsuite/libffi.call/cls_24byte.c: Likewise.
+ * testsuite/libffi.call/cls_double.c: Likewise.
+ * testsuite/libffi.call/cls_float.c: Likewise.
+ * testsuite/libffi.call/cls_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_uint.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/cls_ushort.c: Likewise.
+ * testsuite/libffi.call/float.c: Likewise.
+ * testsuite/libffi.call/float1.c: Likewise.
+ * testsuite/libffi.call/float2.c: Likewise.
+ * testsuite/libffi.call/many.c: Likewise.
+ * testsuite/libffi.call/many_win32.c: Likewise.
+ * testsuite/libffi.call/nested_struct.c: Likewise.
+ * testsuite/libffi.call/nested_struct1.c: Likewise.
+ * testsuite/libffi.call/pyobjc-tc.c: Likewise.
+ * testsuite/libffi.call/problem1.c: Likewise.
+ * testsuite/libffi.call/promotion.c: Likewise.
+ * testsuite/libffi.call/return_ll.c: Likewise.
+ * testsuite/libffi.call/return_sc.c: Likewise.
+ * testsuite/libffi.call/return_uc.c: Likewise.
+ * testsuite/libffi.call/strlen.c: Likewise.
+ * testsuite/libffi.call/strlen_win32.c: Likewise.
+ * testsuite/libffi.call/struct1.c: Likewise.
+ * testsuite/libffi.call/struct2.c: Likewise.
+ * testsuite/libffi.call/struct3.c: Likewise.
+ * testsuite/libffi.call/struct4.c: Likewise.
+ * testsuite/libffi.call/struct5.c: Likewise.
+ * testsuite/libffi.call/struct6.c: Likewise.
+ * testsuite/libffi.call/struct7.c: Likewise.
+ * testsuite/libffi.call/struct8.c: Likewise.
+ * testsuite/libffi.call/struct9.c: Likewise.
+ * testsuite/libffi.special/special.exp: New file.
+ * testsuite/libffi.special/ffitestcxx.h: Likewise.
+ * testsuite/libffi.special/unwindtest.cc: Likewise.
+
+
+2003-08-13 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (OFS_INT16): Set 0 for little endian case. Update
+ copyright years.
+
+2003-08-02 Alan Modra <amodra@bigpond.net.au>
+
+ * src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc
+ structure passing.
+ (ffi_closure_helper_LINUX64): Likewise.
+ * src/powerpc/linux64.S: Remove code writing to parm save area.
+ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return
+ address in lr from ffi_closure_helper_LINUX64 call to calculate
+ table address. Optimize function tail.
+
+2003-07-28 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/sparc/ffi.c: Handle all floating point registers.
+ * src/sparc/v9.S: Likewise. Fixes second part of PR target/11410.
+
+2003-07-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * README: Note that libffi is not part of GCC. Update the project
+ URL and status.
+
+2003-06-19 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * src/powerpc/ppc_closure.S: Include ffi.h.
+
+2003-06-13 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives.
+ Use C style comments.
+
+2003-06-13 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * Makefile.am: Add SHmedia support. Fix a typo of SH support.
+ * Makefile.in: Regenerate.
+ * configure.in (sh64-*-linux*, sh5*-*-linux*): Add target.
+ * configure: Regenerate.
+ * include/ffi.h.in: Add SHmedia support.
+ * src/sh64/ffi.c: New file.
+ * src/sh64/sysv.S: New file.
+
+2003-05-16 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section
+ should be read-only.
+ * configure: Rebuilt.
+ * fficonfig.h.in: Rebuilt.
+ * include/ffi.h.in (EH_FRAME_FLAGS): Define.
+ * src/alpha/osf.S: Use EH_FRAME_FLAGS.
+ * src/powerpc/linux64.S: Likewise.
+ * src/powerpc/linux64_closure.S: Likewise. Include ffi.h.
+ * src/powerpc/sysv.S: Use EH_FRAME_FLAGS. Use pcrel encoding
+ if -fpic/-fPIC/-mrelocatable.
+ * src/powerpc/powerpc_closure.S: Likewise.
+ * src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include
+ #write in .eh_frame flags.
+ * src/sparc/v9.S: Likewise.
+ * src/x86/unix64.S: Use EH_FRAME_FLAGS.
+ * src/x86/sysv.S: Likewise. Use pcrel encoding if -fpic/-fPIC.
+ * src/s390/sysv.S: Use EH_FRAME_FLAGS. Include ffi.h.
+
+2003-05-07 Jeff Sturm <jsturm@one-point.com>
+
+ Fixes PR bootstrap/10656
+ * configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler
+ support for .register pseudo-op.
+ * src/sparc/v8.S: Use it.
+ * fficonfig.h.in: Rebuilt.
+ * configure: Rebuilt.
+
+2003-04-18 Jakub Jelinek <jakub@redhat.com>
+
+ * include/ffi.h.in (POWERPC64): Define if 64-bit.
+ (enum ffi_abi): Add FFI_LINUX64 on POWERPC.
+ Make it the default on POWERPC64.
+ (FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64.
+ * configure.in: Change powerpc-*-linux* into powerpc*-*-linux*.
+ * configure: Rebuilt.
+ * src/powerpc/ffi.c (hidden): Define.
+ (ffi_prep_args_SYSV): Renamed from
+ ffi_prep_args. Cast pointers to unsigned long to shut up warnings.
+ (NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64,
+ ASM_NEEDS_REGISTERS64): New.
+ (ffi_prep_args64): New function.
+ (ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI.
+ (ffi_call): Likewise.
+ (ffi_prep_closure): Likewise.
+ (flush_icache): Surround by #ifndef POWERPC64.
+ (ffi_dblfl): New union type.
+ (ffi_closure_helper_SYSV): Use it to avoid aliasing problems.
+ (ffi_closure_helper_LINUX64): New function.
+ * src/powerpc/ppc_closure.S: Surround whole file by #ifndef
+ __powerpc64__.
+ * src/powerpc/sysv.S: Likewise.
+ (ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV.
+ * src/powerpc/linux64.S: New file.
+ * src/powerpc/linux64_closure.S: New file.
+ * Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and
+ src/powerpc/linux64_closure.S.
+ (TARGET_SRC_POWERPC): Likewise.
+
+ * src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2,
+ closure_test_fn3): Fix result printing on big-endian 64-bit
+ machines.
+ (main): Print tst2_arg instead of uninitialized tst2_result.
+
+ * src/ffitest.c (main): Hide what closure pointer really points to
+ from the compiler.
+
+2003-04-16 Richard Earnshaw <rearnsha@arm.com>
+
+ * configure.in (arm-*-netbsdelf*): Add configuration.
+ (configure): Regenerated.
+
+2003-04-04 Loren J. Rittle <ljrittle@acm.org>
+
+ * include/Makefile.in: Regenerate.
+
+2003-03-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32
+ bit mode.
+ * libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV):
+ Receive closure pointer through parameter, read args using
+ __builtin_dwarf_cfa.
+ (FFI_INIT_TRAMPOLINE): Send closure reference through eax.
+
+2003-03-12 Andreas Schwab <schwab@suse.de>
+
+ * configure.in: Avoid trailing /. in toolexeclibdir.
+ * configure: Rebuilt.
+
+2003-03-03 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/darwin_closure.S: Recode to fit dynamic libraries.
+
+2003-02-06 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * libffi/src/powerpc/darwin_closure.S:
+ Fix alignement bug, allocate 8 bytes for the result.
+ * libffi/src/powerpc/aix_closure.S:
+ Likewise.
+ * libffi/src/powerpc/ffi_darwin.c:
+ Update stackframe description for aix/darwin_closure.S.
+
+2003-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ * src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility
+ attribute.
+
+2003-01-31 Christian Cornelssen <ccorn@cs.tu-berlin.de>,
+ Andreas Schwab <schwab@suse.de>
+
+ * configure.in: Adjust command to source config-ml.in to account
+ for changes to the libffi_basedir definition.
+ (libffi_basedir): Remove ${srcdir} from value and include trailing
+ slash if nonempty.
+
+ * configure: Regenerate.
+
+2003-01-29 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * src/powerpc/ppc_closure.S: Recode to fit shared libs.
+
+2003-01-28 Andrew Haley <aph@redhat.com>
+
+ * include/ffi.h.in: Enable FFI_CLOSURES for x86_64.
+ * src/x86/ffi64.c (ffi_prep_closure): New.
+ (ffi_closure_UNIX64_inner): New.
+ * src/x86/unix64.S (ffi_closure_UNIX64): New.
+
+2003-01-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST.
+ Remove USE_LIBDIR conditional.
+ * Makefile.am (toolexecdir, toolexeclibdir): Don't override.
+ * Makefile.in, configure: Rebuilt.
+
+2003-01027 David Edelsohn <edelsohn@gnu.org>
+
+ * Makefile.am (TARGET_SRC_POWERPC_AIX): Fix typo.
+ * Makefile.in: Regenerate.
+
+2003-01-22 Andrew Haley <aph@redhat.com>
+
+ * src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to
+ unwind info.
+
+2003-01-21 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/darwin.S: Add unwind info.
+ * src/powerpc/darwin_closure.S: Likewise.
+
+2003-01-14 Andrew Haley <aph@redhat.com>
+
+ * src/x86/ffi64.c (ffi_prep_args): Check for void retval.
+ (ffi_prep_cif_machdep): Likewise.
+ * src/x86/unix64.S: Add unwind info.
+
+2003-01-14 Andreas Jaeger <aj@suse.de>
+
+ * src/ffitest.c (main): Only use ffi_closures if those are
+ supported.
+
+2003-01-13 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * libffi/src/ffitest.c
+ add closure testcases
+
+2003-01-13 Kevin B. Hendricks <khendricks@ivey.uwo.ca>
+
+ * libffi/src/powerpc/ffi.c
+ fix alignment bug for float (4 byte aligned iso 8 byte)
+
+2003-01-09 Geoffrey Keating <geoffk@apple.com>
+
+ * src/powerpc/ffi_darwin.c: Remove RCS version string.
+ * src/powerpc/darwin.S: Remove RCS version string.
+
+2003-01-03 Jeff Sturm <jsturm@one-point.com>
+
+ * include/ffi.h.in: Add closure defines for SPARC, SPARC64.
+ * src/ffitest.c (main): Use static storage for closure.
+ * src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New.
+ * src/sparc/v8.S (ffi_closure_v8): New.
+ * src/sparc/v9.S (ffi_closure_v9): New.
+
+2002-11-10 Ranjit Mathew <rmathew@hotmail.com>
+
+ * include/ffi.h.in: Added FFI_STDCALL ffi_type
+ enumeration for X86_WIN32.
+ * src/x86/win32.S: Added ffi_call_STDCALL function
+ definition.
+ * src/x86/ffi.c (ffi_call/ffi_raw_call): Added
+ switch cases for recognising FFI_STDCALL and
+ calling ffi_call_STDCALL if target is X86_WIN32.
+ * src/ffitest.c (my_stdcall_strlen/stdcall_many):
+ stdcall versions of the "my_strlen" and "many"
+ test functions (for X86_WIN32).
+ Added test cases to test stdcall invocation using
+ these functions.
+
+2002-12-02 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/sysv.S: Add DWARF2 unwind info.
+
+2002-11-27 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * src/s390/sysv.S (.eh_frame section): Make section read-only.
+
+2002-11-26 Jim Wilson <wilson@redhat.com>
+
+ * src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64.
+
+2002-11-23 H.J. Lu <hjl@gnu.org>
+
+ * acinclude.m4: Add dummy AM_PROG_LIBTOOL.
+ Include ../config/accross.m4.
+ * aclocal.m4; Rebuild.
+ * configure: Likewise.
+
+2002-11-15 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding.
+
+2002-11-11 DJ Delorie <dj@redhat.com>
+
+ * configure.in: Look for common files in the right place.
+
+2002-10-08 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret
+ raw data as _Jv_word values, not ffi_raw.
+ (ffi_java_ptrarray_to_raw): Likewise.
+ (ffi_java_rvalue_to_raw): New function.
+ (ffi_java_raw_call): Call it.
+ (ffi_java_raw_to_rvalue): New function.
+ (ffi_java_translate_args): Call it.
+ * src/ffitest.c (closure_test_fn): Interpret return value
+ as ffi_arg, not int.
+ * src/s390/ffi.c (ffi_prep_cif_machdep): Add missing
+ FFI_TYPE_POINTER case.
+ (ffi_closure_helper_SYSV): Likewise. Also, assume return
+ values extended to word size.
+
+2002-10-02 Andreas Jaeger <aj@suse.de>
+
+ * src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output.
+
+2002-10-01 Bo Thorsen <bo@smetana.suse.de>
+
+ * include/ffi.h.in: Fix i386 win32 compilation.
+
+2002-09-30 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * configure.in: Add s390x-*-linux-* target.
+ * configure: Regenerate.
+ * include/ffi.h.in: Define S390X for s390x targets.
+ (FFI_CLOSURES): Define for s390/s390x.
+ (FFI_TRAMPOLINE_SIZE): Likewise.
+ (FFI_NATIVE_RAW_API): Likewise.
+ * src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390.
+ * src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x.
+ * src/s390/ffi.c: Major rework of existing code. Add support for
+ s390x targets. Add closure support.
+ * src/s390/sysv.S: Likewise.
+
+2002-09-29 Richard Earnshaw <rearnsha@arm.com>
+
+ * src/arm/sysv.S: Fix typo.
+
+2002-09-28 Richard Earnshaw <rearnsha@arm.com>
+
+ * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor
+ has defined __USER_LABEL_PREFIX__, then use it in CNAME.
+ (ffi_call_SYSV): Handle soft-float.
+
+2002-09-27 Bo Thorsen <bo@suse.de>
+
+ * include/ffi.h.in: Fix multilib x86-64 support.
+
+2002-09-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.am (all-multi): Fix multilib parallel build.
+
+2002-07-19 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * configure.in (sh[34]*-*-linux*): Add brackets.
+ * configure: Regenerate.
+
+2002-07-18 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * Makefile.am: Add SH support.
+ * Makefile.in: Regenerate.
+ * configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target.
+ * configure: Regenerate.
+ * include/ffi.h.in: Add SH support.
+ * src/sh/ffi.c: New file.
+ * src/sh/sysv.S: New file.
+ * src/types.c: Add SH support.
+
+2002-07-16 Bo Thorsen <bo@suse.de>
+
+ * src/x86/ffi64.c: New file that adds x86-64 support.
+ * src/x86/unix64.S: New file that handles argument setup for
+ x86-64.
+ * src/x86/sysv.S: Don't use this on x86-64.
+ * src/x86/ffi.c: Don't use this on x86-64.
+ Remove unused vars.
+ * src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation
+ for x86-64.
+ * src/ffitest.c (struct6): New test that tests a special case in
+ the x86-64 ABI.
+ (struct7): Likewise.
+ (struct8): Likewise.
+ (struct9): Likewise.
+ (closure_test_fn): Silence warning about this when it's not used.
+ (main): Add the new tests.
+ (main): Fix a couple of wrong casts and silence some compiler warnings.
+ * include/ffi.h.in: Add x86-64 ABI definition.
+ * fficonfig.h.in: Regenerate.
+ * Makefile.am: Add x86-64 support.
+ * configure.in: Likewise.
+ * Makefile.in: Regenerate.
+ * configure: Likewise.
+
+2002-06-24 Bo Thorsen <bo@suse.de>
+
+ * src/types.c: Merge settings for similar architectures.
+ Add x86-64 sizes and alignments.
+
+2002-06-23 Bo Thorsen <bo@suse.de>
+
+ * src/arm/ffi.c (ffi_prep_args): Remove unused vars.
+ * src/sparc/ffi.c (ffi_prep_args_v8): Likewise.
+ * src/mips/ffi.c (ffi_prep_args): Likewise.
+ * src/m68k/ffi.c (ffi_prep_args): Likewise.
+
+2002-07-18 H.J. Lu (hjl@gnu.org)
+
+ * Makefile.am (TARGET_SRC_MIPS_LINUX): New.
+ (libffi_la_SOURCES): Support MIPS_LINUX.
+ (libffi_convenience_la_SOURCES): Likewise.
+ * Makefile.in: Regenerated.
+
+ * configure.in (mips64*-*): Skip.
+ (mips*-*-linux*): New.
+ * configure: Regenerated.
+
+ * src/mips/ffi.c: Include <sgidefs.h>.
+
+2002-06-06 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * src/s390/sysv.S: Save/restore %r6. Add DWARF-2 unwind info.
+
+2002-05-27 Roger Sayle <roger@eyesopen.com>
+
+ * src/x86/ffi.c (ffi_prep_args): Remove reference to avn.
+
+2002-05-27 Bo Thorsen <bo@suse.de>
+
+ * src/x86/ffi.c (ffi_prep_args): Remove unused variable and
+ fix formatting.
+
+2002-05-13 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at
+ beginning of function (for older apple cc).
+
+2002-05-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at
+ script entry, and set LD to it when configuring multilibs.
+ * configure: Rebuilt.
+
+2002-05-05 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * configure.in (sparc64-*-netbsd*): Add target.
+ (sparc-*-netbsdelf*): Likewise.
+ * configure: Regenerate.
+
+2002-04-28 David S. Miller <davem@redhat.com>
+
+ * configure.in, configure: Fix SPARC test in previous change.
+
+2002-04-29 Gerhard Tonn <GerhardTonn@swol.de>
+
+ * Makefile.am: Add Linux for S/390 support.
+ * Makefile.in: Regenerate.
+ * configure.in: Add Linux for S/390 support.
+ * configure: Regenerate.
+ * include/ffi.h.in: Add Linux for S/390 support.
+ * src/s390/ffi.c: New file from libffi CVS tree.
+ * src/s390/sysv.S: New file from libffi CVS tree.
+
+2002-04-28 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working
+ %r_disp32().
+ * src/sparc/v8.S: Use it.
+ * src/sparc/v9.S: Likewise.
+ * fficonfig.h.in: Rebuilt.
+ * configure: Rebuilt.
+
+2002-04-08 Hans Boehm <Hans_Boehm@hp.com>
+
+ * src/java_raw_api.c (ffi_java_raw_size): Handle FFI_TYPE_DOUBLE
+ correctly.
+ * src/ia64/unix.S: Add unwind information. Fix comments.
+ Save sp in a way that's compatible with unwind info.
+ (ffi_call_unix): Correctly restore sp in all cases.
+ * src/ia64/ffi.c: Add, fix comments.
+
+2002-04-08 Jakub Jelinek <jakub@redhat.com>
+
+ * src/sparc/v8.S: Make .eh_frame dependent on target word size.
+
+2002-04-06 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * configure.in (alpha*-*-netbsd*): Add target.
+ * configure: Regenerate.
+
+2002-04-04 Jeff Sturm <jsturm@one-point.com>
+
+ * src/sparc/v8.S: Add unwind info.
+ * src/sparc/v9.S: Likewise.
+
+2002-03-30 Krister Walfridsson <cato@df.lth.se>
+
+ * configure.in: Enable i*86-*-netbsdelf*.
+ * configure: Rebuilt.
+
+2002-03-29 David Billinghurst <David.Billinghurst@riotinto.com>
+
+ PR other/2620
+ * src/mips/n32.s: Delete
+ * src/mips/o32.s: Delete
+
+2002-03-21 Loren J. Rittle <ljrittle@acm.org>
+
+ * configure.in: Enable alpha*-*-freebsd*.
+ * configure: Rebuilt.
+
+2002-03-17 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * Makefile.am: libfficonvenience -> libffi_convenience.
+ * Makefile.in: Rebuilt.
+
+ * Makefile.am: Define ffitest_OBJECTS.
+ * Makefile.in: Rebuilt.
+
+2002-03-07 Andreas Tobler <toa@pop.agri.ch>
+ David Edelsohn <edelsohn@gnu.org>
+
+ * Makefile.am (EXTRA_DIST): Add Darwin and AIX closure files.
+ (TARGET_SRC_POWERPC_AIX): Add aix_closure.S.
+ (TARGET_SRC_POWERPC_DARWIN): Add darwin_closure.S.
+ * Makefile.in: Regenerate.
+ * include/ffi.h.in: Add AIX and Darwin closure definitions.
+ * src/powerpc/ffi_darwin.c (ffi_prep_closure): New function.
+ (flush_icache, flush_range): New functions.
+ (ffi_closure_helper_DARWIN): New function.
+ * src/powerpc/aix_closure.S: New file.
+ * src/powerpc/darwin_closure.S: New file.
+
+2002-02-24 Jeff Sturm <jsturm@one-point.com>
+
+ * include/ffi.h.in: Add typedef for ffi_arg.
+ * src/ffitest.c (main): Declare rint with ffi_arg.
+
+2002-02-21 Andreas Tobler <toa@pop.agri.ch>
+
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate
+ number of GPRs for floating-point arguments.
+
+2002-01-31 Anthony Green <green@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in: Replace CHECK_SIZEOF and endian tests with
+ cross-compiler friendly macros.
+ * aclocal.m4 (AC_COMPILE_CHECK_SIZEOF, AC_C_BIGENDIAN_CROSS): New
+ macros.
+
+2002-01-18 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/darwin.S (_ffi_call_AIX): New.
+ * src/powerpc/aix.S (ffi_call_DARWIN): New.
+
+2002-01-17 David Edelsohn <edelsohn@gnu.org>
+
+ * Makefile.am (EXTRA_DIST): Add Darwin and AIX files.
+ (TARGET_SRC_POWERPC_AIX): New.
+ (POWERPC_AIX): New stanza.
+ * Makefile.in: Regenerate.
+ * configure.in: Add AIX case.
+ * configure: Regenerate.
+ * include/ffi.h.in (ffi_abi): Add FFI_AIX.
+ * src/powerpc/ffi_darwin.c (ffi_status): Use "long" to scale frame
+ size. Fix "long double" support.
+ (ffi_call): Add FFI_AIX case.
+ * src/powerpc/aix.S: New.
+
+2001-10-09 John Hornkvist <john@toastedmarshmallow.com>
+
+ Implement Darwin PowerPC ABI.
+ * configure.in: Handle powerpc-*-darwin*.
+ * Makefile.am: Set source files for POWERPC_DARWIN.
+ * configure: Rebuilt.
+ * Makefile.in: Rebuilt.
+ * include/ffi.h.in: Define FFI_DARWIN and FFI_DEFAULT_ABI for
+ POWERPC_DARWIN.
+ * src/powerpc/darwin.S: New file.
+ * src/powerpc/ffi_darwin.c: New file.
+
+2001-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * src/x86/ffi.c: Fix spelling error of "separate" as "seperate".
+
+2001-07-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * src/x86/sysv.S: Avoid gas-only .balign directive.
+ Use C style comments.
+
+2001-07-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic.
+ Fixes PR bootstrap/3563.
+
+2001-06-26 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF.
+
+2001-06-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Recognize sparc*-sun-* host.
+ * configure: Regenerate.
+
+2001-06-06 Andrew Haley <aph@redhat.com>
+
+ * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF.
+
+2001-06-03 Andrew Haley <aph@redhat.com>
+
+ * src/alpha/osf.S: Add unwind info.
+ * src/powerpc/sysv.S: Add unwind info.
+ * src/powerpc/ppc_closure.S: Likewise.
+
+2000-05-31 Jeff Sturm <jsturm@one-point.com>
+
+ * configure.in: Fix AC_ARG_ENABLE usage.
+ * configure: Rebuilt.
+
+2001-05-06 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * configure.in: Remove warning about beta code.
+ * configure: Rebuilt.
+
+2001-04-25 Hans Boehm <Hans_Boehm@hp.com>
+
+ * src/ia64/unix.S: Restore stack pointer when returning from
+ ffi_closure_UNIX.
+ * src/ia64/ffi.c: Fix typo in comment.
+
+2001-04-18 Jim Wilson <wilson@redhat.com>
+
+ * src/ia64/unix.S: Delete unnecessary increment and decrement of loc2
+ to eliminate RAW DV.
+
+2001-04-12 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * Makefile.am: Make a libtool convenience library.
+ * Makefile.in: Rebuilt.
+
+2001-03-29 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * configure.in: Use different syntax for subdirectory creation.
+ * configure: Rebuilt.
+
+2001-03-27 Jon Beniston <jon@beniston.com>
+
+ * configure.in: Added X86_WIN32 target (Win32, CygWin, MingW).
+ * configure: Rebuilt.
+ * Makefile.am: Added X86_WIN32 target support.
+ * Makefile.in: Rebuilt.
+
+ * include/ffi.h.in: Added X86_WIN32 target support.
+
+ * src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets.
+ * src/types.c: Added X86_WIN32 target support.
+
+ * src/x86/win32.S: New file. Based on sysv.S, but with EH
+ stuff removed and made to work with CygWin's gas.
+
+2001-03-26 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * configure.in: Make target subdirectory in build dir.
+ * Makefile.am: Override suffix based rules to specify correct output
+ subdirectory.
+ * Makefile.in: Rebuilt.
+ * configure: Rebuilt.
+
+2001-03-23 Kevin B Hendricks <khendricks@ivey.uwo.ca>
+
+ * src/powerpc/ppc_closure.S: New file.
+ * src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug
+ involving long long and register pairs.
+ (ffi_prep_closure): New function.
+ (flush_icache): Likewise.
+ (ffi_closure_helper_SYSV): Likewise.
+ * include/ffi.h.in (FFI_CLOSURES): Define on PPC.
+ (FFI_TRAMPOLINE_SIZE): Likewise.
+ (FFI_NATIVE_RAW_API): Likewise.
+ * Makefile.in: Rebuilt.
+ * Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S.
+ (TARGET_SRC_POWERPC): Likewise.
+
+2001-03-19 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (ffitest_LDFLAGS): New macro.
+
+2001-03-02 Nick Clifton <nickc@redhat.com>
+
+ * include/ffi.h.in: Remove RCS ident string.
+ * include/ffi_mips.h: Remove RCS ident string.
+ * src/debug.c: Remove RCS ident string.
+ * src/ffitest.c: Remove RCS ident string.
+ * src/prep_cif.c: Remove RCS ident string.
+ * src/types.c: Remove RCS ident string.
+ * src/alpha/ffi.c: Remove RCS ident string.
+ * src/alpha/osf.S: Remove RCS ident string.
+ * src/arm/ffi.c: Remove RCS ident string.
+ * src/arm/sysv.S: Remove RCS ident string.
+ * src/mips/ffi.c: Remove RCS ident string.
+ * src/mips/n32.S: Remove RCS ident string.
+ * src/mips/o32.S: Remove RCS ident string.
+ * src/sparc/ffi.c: Remove RCS ident string.
+ * src/sparc/v8.S: Remove RCS ident string.
+ * src/sparc/v9.S: Remove RCS ident string.
+ * src/x86/ffi.c: Remove RCS ident string.
+ * src/x86/sysv.S: Remove RCS ident string.
+
+2001-02-08 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * include/ffi.h.in: Change sourceware.cygnus.com references to
+ gcc.gnu.org.
+
+2000-12-09 Richard Henderson <rth@redhat.com>
+
+ * src/alpha/ffi.c (ffi_call): Simplify struct return test.
+ (ffi_closure_osf_inner): Index rather than increment avalue
+ and arg_types. Give ffi_closure_osf the raw return value type.
+ * src/alpha/osf.S (ffi_closure_osf): Handle return value type
+ promotion.
+
+2000-12-07 Richard Henderson <rth@redhat.com>
+
+ * src/raw_api.c (ffi_translate_args): Fix typo.
+ (ffi_prep_closure): Likewise.
+
+ * include/ffi.h.in [ALPHA]: Define FFI_CLOSURES and
+ FFI_TRAMPOLINE_SIZE.
+ * src/alpha/ffi.c (ffi_prep_cif_machdep): Adjust minimal
+ cif->bytes for new ffi_call_osf implementation.
+ (ffi_prep_args): Absorb into ...
+ (ffi_call): ... here. Do all stack allocation here and
+ avoid a callback function.
+ (ffi_prep_closure, ffi_closure_osf_inner): New.
+ * src/alpha/osf.S (ffi_call_osf): Reimplement with no callback.
+ (ffi_closure_osf): New.
+
+2000-09-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * config.guess, config.sub, install-sh: Removed.
+ * ltconfig, ltmain.sh, missing, mkinstalldirs: Likewise.
+ * Makefile.in: Rebuilt.
+
+ * acinclude.m4: Include libtool macros from the top level.
+ * aclocal.m4, configure: Rebuilt.
+
+2000-08-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in [i*86-*-freebsd*] (TARGET, TARGETDIR): Set.
+ * configure: Rebuilt.
+
+2000-05-11 Scott Bambrough <scottb@netwinder.org>
+
+ * libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to
+ memory correctly. Use conditional instructions, not branches where
+ possible.
+
+2000-05-04 Tom Tromey <tromey@cygnus.com>
+
+ * configure: Rebuilt.
+ * configure.in: Match `arm*-*-linux-*'.
+ From Chris Dornan <cdornan@arm.com>.
+
+2000-04-28 Jakub Jelinek <jakub@redhat.com>
+
+ * Makefile.am (SUBDIRS): Define.
+ (AM_MAKEFLAGS): Likewise.
+ (Multilib support.): Add section.
+ * Makefile.in: Rebuilt.
+ * ltconfig (extra_compiler_flags, extra_compiler_flags_value):
+ New variables. Set for gcc using -print-multi-lib. Export them
+ to libtool.
+ (sparc64-*-linux-gnu*): Use libsuff 64 for search paths.
+ * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options
+ for -shared links.
+ (extra_compiler_flags_value, extra_compiler_flags): Check these
+ for extra compiler options which need to be passed down in
+ compiler_flags.
+
+2000-04-16 Anthony Green <green@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in: Change i*86-pc-linux* to i*86-*-linux*.
+
+2000-04-14 Jakub Jelinek <jakub@redhat.com>
+
+ * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds.
+ Set SPARC FFI_DEFAULT_ABI based on SPARC64 define.
+ * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args.
+ Replace all void * sizeofs with sizeof(int).
+ Only compare type with FFI_TYPE_LONGDOUBLE if LONGDOUBLE is
+ different than DOUBLE.
+ Remove FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases (handled elsewhere).
+ (ffi_prep_args_v9): New function.
+ (ffi_prep_cif_machdep): Handle V9 ABI and long long on V8.
+ (ffi_V9_return_struct): New function.
+ (ffi_call): Handle FFI_V9 ABI from 64bit code and FFI_V8 ABI from
+ 32bit code (not yet cross-arch calls).
+ * src/sparc/v8.S: Add struct return delay nop.
+ Handle long long.
+ * src/sparc/v9.S: New file.
+ * src/prep_cif.c (ffi_prep_cif): Return structure pointer
+ is used on sparc64 only for structures larger than 32 bytes.
+ Pass by reference for structures is done for structure arguments
+ larger than 16 bytes.
+ * src/ffitest.c (main): Use 64bit rint on sparc64.
+ Run long long tests on sparc.
+ * src/types.c (FFI_TYPE_POINTER): Pointer is 64bit on alpha and
+ sparc64.
+ (FFI_TYPE_LONGDOUBLE): long double is 128 bit aligned to 128 bits
+ on sparc64.
+ * configure.in (sparc-*-linux*): New supported target.
+ (sparc64-*-linux*): Likewise.
+ * configure: Rebuilt.
+ * Makefile.am: Add v9.S to SPARC files.
+ * Makefile.in: Likewise.
+ (LINK): Surround $(CCLD) into double quotes, so that multilib
+ compiles work correctly.
+
+2000-04-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * configure: Rebuilt.
+ * configure.in: (i*86-*-solaris*): New libffi target. Patch
+ proposed by Bryce McKinlay.
+
+2000-03-20 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in: Hand edit for java_raw_api.lo.
+
+2000-03-08 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * config.guess, config.sub: Update from the gcc tree.
+ Fix for PR libgcj/168.
+
+2000-03-03 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in: Fixed ia64 by hand.
+
+ * configure: Rebuilt.
+ * configure.in (--enable-multilib): New option.
+ (libffi_basedir): New subst.
+ (AC_OUTPUT): Added multilib code.
+
+2000-03-02 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (TARGET_SRC_IA64): Use `ia64', not `alpha', as
+ directory name.
+
+2000-02-25 Hans Boehm <boehm@acm.org>
+
+ * src/ia64/ffi.c, src/ia64/ia64_flags.h, src/ia64/unix.S: New
+ files.
+ * src/raw_api.c (ffi_translate_args): Fixed typo in argument
+ list.
+ (ffi_prep_raw_closure): Use ffi_translate_args, not
+ ffi_closure_translate.
+ * src/java_raw_api.c: New file.
+ * src/ffitest.c (closure_test_fn): New function.
+ (main): Define `rint' as long long on IA64. Added new test when
+ FFI_CLOSURES is defined.
+ * include/ffi.h.in (ALIGN): Use size_t, not unsigned.
+ (ffi_abi): Recognize IA64.
+ (ffi_raw): Added `flt' field.
+ Added "Java raw API" code.
+ * configure.in: Recognize ia64.
+ * Makefile.am (TARGET_SRC_IA64): New macro.
+ (libffi_la_common_SOURCES): Added java_raw_api.c.
+ (libffi_la_SOURCES): Define in IA64 case.
+
+2000-01-04 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in: Rebuilt with newer automake.
+
+1999-12-31 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.am (INCLUDES): Added -I$(top_srcdir)/src.
+
+1999-09-01 Tom Tromey <tromey@cygnus.com>
+
+ * include/ffi.h.in: Removed PACKAGE and VERSION defines and
+ undefs.
+ * fficonfig.h.in: Rebuilt.
+ * configure: Rebuilt.
+ * configure.in: Pass 3rd argument to AM_INIT_AUTOMAKE.
+ Use AM_PROG_LIBTOOL (automake 1.4 compatibility).
+ * acconfig.h: Don't #undef PACKAGE or VERSION.
+
+1999-08-09 Anthony Green <green@cygnus.com>
+
+ * include/ffi.h.in: Try to work around messy header problem
+ with PACKAGE and VERSION.
+
+ * configure: Rebuilt.
+ * configure.in: Change version to 2.00-beta.
+
+ * fficonfig.h.in: Rebuilt.
+ * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.
+
+ * src/x86/ffi.c (ffi_raw_call): Rename.
+
+1999-08-02 Kresten Krab Thorup <krab@dominiq.is.s.u-tokyo.ac.jp>
+
+ * src/x86/ffi.c (ffi_closure_SYSV): New function.
+ (ffi_prep_incoming_args_SYSV): Ditto.
+ (ffi_prep_closure): Ditto.
+ (ffi_closure_raw_SYSV): Ditto.
+ (ffi_prep_raw_closure): More ditto.
+ (ffi_call_raw): Final ditto.
+
+ * include/ffi.h.in: Add definitions for closure and raw API.
+
+ * src/x86/ffi.c (ffi_prep_cif_machdep): Added case for
+ FFI_TYPE_UINT64.
+
+ * Makefile.am (libffi_la_common_SOURCES): Added raw_api.c
+
+ * src/raw_api.c: New file.
+
+ * include/ffi.h.in (ffi_raw): New type.
+ (UINT_ARG, SINT_ARG): New defines.
+ (ffi_closure, ffi_raw_closure): New types.
+ (ffi_prep_closure, ffi_prep_raw_closure): New declarations.
+
+ * configure.in: Add check for endianness and sizeof void*.
+
+ * src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument,
+ instead of directly.
+
+ * configure: Rebuilt.
+
+Thu Jul 8 14:28:42 1999 Anthony Green <green@cygnus.com>
+
+ * configure.in: Add x86 and powerpc BeOS configurations.
+ From Makoto Kato <m_kato@ga2.so-net.ne.jp>.
+
+1999-05-09 Anthony Green <green@cygnus.com>
+
+ * configure.in: Add warning about this being beta code.
+ Remove src/Makefile.am from the picture.
+ * configure: Rebuilt.
+
+ * Makefile.am: Move logic from src/Makefile.am. Add changes
+ to support libffi as a target library.
+ * Makefile.in: Rebuilt.
+
+ * aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh:
+ Upgraded to new autoconf, automake, libtool.
+
+ * README: Tweaks.
+
+ * LICENSE: Update copyright date.
+
+ * src/Makefile.am, src/Makefile.in: Removed.
+
+1998-11-29 Anthony Green <green@cygnus.com>
+
+ * include/ChangeLog: Removed.
+ * src/ChangeLog: Removed.
+ * src/mips/ChangeLog: Removed.
+ * src/sparc/ChangeLog: Remboved.
+ * src/x86/ChangeLog: Removed.
+
+ * ChangeLog.v1: Created.
diff --git a/Modules/_ctypes/libffi/ChangeLog.libffi b/Modules/_ctypes/libffi/ChangeLog.libffi
new file mode 100644
index 0000000000..5272f3360a
--- /dev/null
+++ b/Modules/_ctypes/libffi/ChangeLog.libffi
@@ -0,0 +1,613 @@
+2010-01-15 Anthony Green <green@redhat.com>
+
+ * README: Add notes on building with Microsoft Visual C++.
+
+2010-01-15 Daniel Witte <dwitte@mozilla.com>
+
+ * msvcc.sh: New file.
+
+ * src/x86/win32.S: Port assembly routines to MSVC and #ifdef.
+ * src/x86/ffi.c: Tweak function declaration and remove excess
+ parens.
+ * include/ffi.h.in: Add __declspec(align(8)) to typedef struct
+ ffi_closure.
+
+ * src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new
+ function ffi_call_win32 on X86_WIN32.
+ * src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32.
+ (ffi_call_STDCALL): Remove.
+
+ * src/prep_cif.c (ffi_prep_cif): Move stack space allocation code
+ to ffi_prep_cif_machdep for x86.
+ * src/x86/ffi.c (ffi_prep_cif_machdep): To here.
+
+2010-01-15 Oliver Kiddle <okiddle@yahoo.co.uk>
+
+ * src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for
+ Sun Studio compiler compatibility.
+
+2010-01-12 Conrad Irwin <conrad.irwin@gmail.com>
+
+ * doc/libffi.texi: Add closure example.
+ * doc/libffi.info: Rebuilt.
+
+2009-12-25 Samuli Suominen <ssuominen@gentoo.org>
+
+ * configure.ac: Undefine _AC_ARG_VAR_PRECIOUS for autoconf 2.64.
+ * configure: Rebuilt.
+ * fficonfig.h.in: Rebuilt.
+
+2009-06-16 Andrew Haley <aph@redhat.com>
+
+ * testsuite/libffi.call/cls_align_sint64.c,
+ testsuite/libffi.call/cls_align_uint64.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_ulonglong.c,
+ testsuite/libffi.call/return_ll1.c,
+ testsuite/libffi.call/stret_medium2.c: Fix printf format
+ specifiers.
+ * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs.
+ * testsuite/libffi.call/float2.c: Fix dg-excess-errors.
+ * testsuite/libffi.call/ffitest.h,
+ testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
+
+2009-06-12 Andrew Haley <aph@redhat.com>
+
+ * testsuite/libffi.call/cls_align_sint64.c,
+ testsuite/libffi.call/cls_align_uint64.c,
+ testsuite/libffi.call/cls_ulonglong.c,
+ testsuite/libffi.call/return_ll1.c,
+ testsuite/libffi.call/stret_medium2.c: Fix printf format
+ specifiers.
+ testsuite/libffi.special/unwindtest.cc: include stdint.h.
+
+2009-06-11 Timothy Wall <twall@users.sf.net>
+
+ * Makefile.am,
+ configure.ac,
+ include/ffi.h.in,
+ include/ffi_common.h,
+ src/closures.c,
+ src/dlmalloc.c,
+ src/x86/ffi.c,
+ src/x86/ffitarget.h,
+ src/x86/win64.S (new),
+ README: Added win64 support (mingw or MSVC)
+ * Makefile.in,
+ include/Makefile.in,
+ man/Makefile.in,
+ testsuite/Makefile.in,
+ configure,
+ aclocal.m4: Regenerated
+ * ltcf-c.sh: properly escape cygwin/w32 path
+ * man/ffi_call.3: Clarify size requirements for return value.
+ * src/x86/ffi64.c: Fix filename in comment.
+ * src/x86/win32.S: Remove unused extern.
+
+ * testsuite/libffi.call/closure_fn0.c,
+ testsuite/libffi.call/closure_fn1.c,
+ testsuite/libffi.call/closure_fn2.c,
+ testsuite/libffi.call/closure_fn3.c,
+ testsuite/libffi.call/closure_fn4.c,
+ testsuite/libffi.call/closure_fn5.c,
+ testsuite/libffi.call/closure_fn6.c,
+ testsuite/libffi.call/closure_stdcall.c,
+ testsuite/libffi.call/cls_12byte.c,
+ testsuite/libffi.call/cls_16byte.c,
+ testsuite/libffi.call/cls_18byte.c,
+ testsuite/libffi.call/cls_19byte.c,
+ testsuite/libffi.call/cls_1_1byte.c,
+ testsuite/libffi.call/cls_20byte.c,
+ testsuite/libffi.call/cls_20byte1.c,
+ testsuite/libffi.call/cls_24byte.c,
+ testsuite/libffi.call/cls_2byte.c,
+ testsuite/libffi.call/cls_3_1byte.c,
+ testsuite/libffi.call/cls_3byte1.c,
+ testsuite/libffi.call/cls_3byte2.c,
+ testsuite/libffi.call/cls_4_1byte.c,
+ testsuite/libffi.call/cls_4byte.c,
+ testsuite/libffi.call/cls_5_1_byte.c,
+ testsuite/libffi.call/cls_5byte.c,
+ testsuite/libffi.call/cls_64byte.c,
+ testsuite/libffi.call/cls_6_1_byte.c,
+ testsuite/libffi.call/cls_6byte.c,
+ testsuite/libffi.call/cls_7_1_byte.c,
+ testsuite/libffi.call/cls_7byte.c,
+ testsuite/libffi.call/cls_8byte.c,
+ testsuite/libffi.call/cls_9byte1.c,
+ testsuite/libffi.call/cls_9byte2.c,
+ testsuite/libffi.call/cls_align_double.c,
+ testsuite/libffi.call/cls_align_float.c,
+ testsuite/libffi.call/cls_align_longdouble.c,
+ testsuite/libffi.call/cls_align_longdouble_split.c,
+ testsuite/libffi.call/cls_align_longdouble_split2.c,
+ testsuite/libffi.call/cls_align_pointer.c,
+ testsuite/libffi.call/cls_align_sint16.c,
+ testsuite/libffi.call/cls_align_sint32.c,
+ testsuite/libffi.call/cls_align_sint64.c,
+ testsuite/libffi.call/cls_align_uint16.c,
+ testsuite/libffi.call/cls_align_uint32.c,
+ testsuite/libffi.call/cls_align_uint64.c,
+ testsuite/libffi.call/cls_dbls_struct.c,
+ testsuite/libffi.call/cls_double.c,
+ testsuite/libffi.call/cls_double_va.c,
+ testsuite/libffi.call/cls_float.c,
+ testsuite/libffi.call/cls_longdouble.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_multi_schar.c,
+ testsuite/libffi.call/cls_multi_sshort.c,
+ testsuite/libffi.call/cls_multi_sshortchar.c,
+ testsuite/libffi.call/cls_multi_uchar.c,
+ testsuite/libffi.call/cls_multi_ushort.c,
+ testsuite/libffi.call/cls_multi_ushortchar.c,
+ testsuite/libffi.call/cls_pointer.c,
+ testsuite/libffi.call/cls_pointer_stack.c,
+ testsuite/libffi.call/cls_schar.c,
+ testsuite/libffi.call/cls_sint.c,
+ testsuite/libffi.call/cls_sshort.c,
+ testsuite/libffi.call/cls_uchar.c,
+ testsuite/libffi.call/cls_uint.c,
+ testsuite/libffi.call/cls_ulonglong.c,
+ testsuite/libffi.call/cls_ushort.c,
+ testsuite/libffi.call/err_bad_abi.c,
+ testsuite/libffi.call/err_bad_typedef.c,
+ testsuite/libffi.call/float2.c,
+ testsuite/libffi.call/huge_struct.c,
+ testsuite/libffi.call/nested_struct.c,
+ testsuite/libffi.call/nested_struct1.c,
+ testsuite/libffi.call/nested_struct10.c,
+ testsuite/libffi.call/nested_struct2.c,
+ testsuite/libffi.call/nested_struct3.c,
+ testsuite/libffi.call/nested_struct4.c,
+ testsuite/libffi.call/nested_struct5.c,
+ testsuite/libffi.call/nested_struct6.c,
+ testsuite/libffi.call/nested_struct7.c,
+ testsuite/libffi.call/nested_struct8.c,
+ testsuite/libffi.call/nested_struct9.c,
+ testsuite/libffi.call/problem1.c,
+ testsuite/libffi.call/return_ldl.c,
+ testsuite/libffi.call/return_ll1.c,
+ testsuite/libffi.call/stret_large.c,
+ testsuite/libffi.call/stret_large2.c,
+ testsuite/libffi.call/stret_medium.c,
+ testsuite/libffi.call/stret_medium2.c,
+ testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead
+ of checking for MMAP. Use intptr_t instead of long casts.
+
+2009-06-04 Andrew Haley <aph@redhat.com>
+
+ * src/powerpc/ffitarget.h: Fix misapplied merge from gcc.
+
+2009-06-04 Andrew Haley <aph@redhat.com>
+
+ * src/mips/o32.S,
+ src/mips/n32.S: Fix licence formatting.
+
+2009-06-04 Andrew Haley <aph@redhat.com>
+
+ * src/x86/darwin.S: Fix licence formatting.
+ src/x86/win32.S: Likewise.
+ src/sh64/sysv.S: Likewise.
+ src/sh/sysv.S: Likewise.
+
+2009-06-04 Andrew Haley <aph@redhat.com>
+
+ * src/sh64/ffi.c: Remove lint directives. Was missing from merge
+ of Andreas Tobler's patch from 2006-04-22.
+
+2009-06-04 Andrew Haley <aph@redhat.com>
+
+ * src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
+ 2007-03-07.
+
+2008-12-26 Timothy Wall <twall@users.sf.net>
+
+ * testsuite/libffi.call/cls_longdouble.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_align_longdouble.c,
+ testsuite/libffi.call/cls_align_longdouble_split.c,
+ testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected
+ failures on x86_64 cygwin/mingw.
+
+2008-12-22 Timothy Wall <twall@users.sf.net>
+
+ * testsuite/libffi.call/closure_fn0.c,
+ testsuite/libffi.call/closure_fn1.c,
+ testsuite/libffi.call/closure_fn2.c,
+ testsuite/libffi.call/closure_fn3.c,
+ testsuite/libffi.call/closure_fn4.c,
+ testsuite/libffi.call/closure_fn5.c,
+ testsuite/libffi.call/closure_fn6.c,
+ testsuite/libffi.call/closure_loc_fn0.c,
+ testsuite/libffi.call/closure_stdcall.c,
+ testsuite/libffi.call/cls_align_pointer.c,
+ testsuite/libffi.call/cls_pointer.c,
+ testsuite/libffi.call/cls_pointer_stack.c: use portable cast from
+ pointer to integer (intptr_t).
+ * testsuite/libffi.call/cls_longdouble.c: disable for win64.
+
+2008-12-19 Anthony Green <green@redhat.com>
+
+ * configure.ac: Bump version to 3.0.8.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+ * libtool-version: Increment revision.
+ * README: Update for new release.
+
+2008-11-11 Anthony Green <green@redhat.com>
+
+ * configure.ac: Bump version to 3.0.7.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+ * libtool-version: Increment revision.
+ * README: Update for new release.
+
+2008-08-25 Andreas Tobler <a.tobler@schweiz.org>
+
+ * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and
+ FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum.
+ Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT.
+ Adjust copyright notice.
+ * src/powerpc/ffi.c: Add two new flags to indicate if we have one
+ register or two register to use for FFI_SYSV structs.
+ (ffi_prep_cif_machdep): Pass the right register flag introduced above.
+ (ffi_closure_helper_SYSV): Fix the return type for
+ FFI_SYSV_TYPE_SMALL_STRUCT. Comment.
+ Adjust copyright notice.
+
+2008-07-24 Anthony Green <green@redhat.com>
+
+ * testsuite/libffi.call/cls_dbls_struct.c,
+ testsuite/libffi.call/cls_double_va.c,
+ testsuite/libffi.call/cls_longdouble.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_pointer.c,
+ testsuite/libffi.call/cls_pointer_stack.c,
+ testsuite/libffi.call/err_bad_abi.c: Clean up failures from
+ compiler warnings.
+
+2008-07-17 Anthony Green <green@redhat.com>
+
+ * configure.ac: Bump version to 3.0.6.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+ * libtool-version: Increment revision. Add documentation.
+ * README: Update for new release.
+
+2008-07-16 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned
+ int.
+
+2008-07-16 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/sysv.S: Add .note.GNU-stack on Linux.
+ * src/sh64/sysv.S: Likewise.
+
+2008-04-03 Anthony Green <green@redhat.com>
+
+ * libffi.pc.in (Libs): Add -L${libdir}.
+ * configure.ac: Bump version to 3.0.5.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+ * libtool-version: Increment revision.
+ * README: Update for new release.
+
+2008-04-03 Anthony Green <green@redhat.com>
+ Xerces Ranby <xerxes@zafena.se>
+
+ * include/ffi.h.in: Wrap definition of target architecture to
+ protect from double definitions.
+
+2008-03-22 Moriyoshi Koizumi <moriyoshi@gmail.com>
+
+ * src/x86/ffi.c (ffi_prep_closure_loc): Fix for bug revealed in
+ closure_loc_fn0.c.
+ * testsuite/libffi.call/closure_loc_fn0.c (closure_loc_test_fn0):
+ New test.
+
+2008-03-04 Anthony Green <green@redhat.com>
+ Blake Chaffin
+ hos@tamanegi.org
+
+ * testsuite/libffi.call/cls_align_longdouble_split2.c
+ testsuite/libffi.call/cls_align_longdouble_split.c
+ testsuite/libffi.call/cls_dbls_struct.c
+ testsuite/libffi.call/cls_double_va.c
+ testsuite/libffi.call/cls_longdouble.c
+ testsuite/libffi.call/cls_longdouble_va.c
+ testsuite/libffi.call/cls_pointer.c
+ testsuite/libffi.call/cls_pointer_stack.c
+ testsuite/libffi.call/err_bad_abi.c
+ testsuite/libffi.call/err_bad_typedef.c
+ testsuite/libffi.call/huge_struct.c
+ testsuite/libffi.call/stret_large2.c
+ testsuite/libffi.call/stret_large.c
+ testsuite/libffi.call/stret_medium2.c
+ testsuite/libffi.call/stret_medium.c: New tests from Apple.
+
+2008-02-26 Jakub Jelinek <jakub@redhat.com>
+ Anthony Green <green@redhat.com>
+
+ * src/alpha/osf.S: Add .note.GNU-stack on Linux.
+ * src/s390/sysv.S: Likewise.
+ * src/powerpc/linux64.S: Likewise.
+ * src/powerpc/linux64_closure.S: Likewise.
+ * src/powerpc/ppc_closure.S: Likewise.
+ * src/powerpc/sysv.S: Likewise.
+ * src/x86/unix64.S: Likewise.
+ * src/x86/sysv.S: Likewise.
+ * src/sparc/v8.S: Likewise.
+ * src/sparc/v9.S: Likewise.
+ * src/m68k/sysv.S: Likewise.
+ * src/ia64/unix.S: Likewise.
+ * src/arm/sysv.S: Likewise.
+
+2008-02-26 Anthony Green <green@redhat.com>
+ Thomas Heller <theller@ctypes.org>
+
+ * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
+ comment.
+
+2008-02-26 Anthony Green <green@redhat.org>
+ Thomas Heller <theller@ctypes.org>
+
+ * include/ffi.h.in: Change void (*)() to void (*)(void).
+
+2008-02-26 Anthony Green <green@redhat.org>
+ Thomas Heller <theller@ctypes.org>
+
+ * src/alpha/ffi.c: Change void (*)() to void (*)(void).
+ src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c,
+ src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c,
+ src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S,
+ src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c,
+ src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c,
+ src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S,
+ src/x86/ffi64.c: Ditto.
+
+2008-02-24 Anthony Green <green@redhat.org>
+
+ * configure.ac: Accept openbsd*, not just openbsd.
+ Bump version to 3.0.4.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+ * libtool-version: Increment revision.
+ * README: Update for new release.
+
+2008-02-22 Anthony Green <green@redhat.com>
+
+ * README: Clean up list of tested platforms.
+
+2008-02-22 Anthony Green <green@redhat.com>
+
+ * configure.ac: Bump version to 3.0.3.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+ * libtool-version: Increment revision.
+ * README: Update for new release. Clean up test docs.
+
+2008-02-22 Bjoern Koenig <bkoenig@alpha-tierchen.de>
+ Andreas Tobler <a.tobler@schweiz.org>
+
+ * configure.ac: Add amd64-*-freebsd* target.
+ * configure: Regenerate.
+
+2008-02-22 Thomas Heller <theller@ctypes.org>
+
+ * configure.ac: Add x86 OpenBSD support.
+ * configure: Rebuilt.
+
+2008-02-21 Thomas Heller <theller@ctypes.org>
+
+ * README: Change "make test" to "make check".
+
+2008-02-21 Anthony Green <green@redhat.com>
+
+ * configure.ac: Bump version to 3.0.2.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+ * libtool-version: Increment revision.
+ * README: Update for new release.
+
+2008-02-21 Björn König <bkoenig@alpha-tierchen.de>
+
+ * src/x86/freebsd.S: New file.
+ * configure.ac: Add x86 FreeBSD support.
+ * Makefile.am: Ditto.
+
+2008-02-15 Anthony Green <green@redhat.com>
+
+ * configure.ac: Bump version to 3.0.1.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+ * libtool-version: Increment revision.
+ * README: Update for new release.
+
+2008-02-15 David Daney <ddaney@avtrex.com>
+
+ * src/mips/ffi.c: Remove extra '>' from include directive.
+ (ffi_prep_closure_loc): Use clear_location instead of tramp.
+
+2008-02-15 Anthony Green <green@redhat.com>
+
+ * configure.ac: Bump version to 3.0.0.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+
+2008-02-15 David Daney <ddaney@avtrex.com>
+
+ * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
+ Define (conditionally), and use it to include cachectl.h.
+ (ffi_prep_closure_loc): Fix cache flushing.
+ * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
+
+2008-02-15 Anthony Green <green@redhat.com>
+
+ * man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3:
+ Update dates and remove all references to ffi_prep_closure.
+ * configure.ac: Bump version to 2.99.9.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+
+2008-02-15 Anthony Green <green@redhat.com>
+
+ * man/ffi_prep_closure.3: Delete.
+ * man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3.
+ (man_MANS): Ditto.
+ * man/Makefile.in: Rebuilt.
+ * configure.ac: Bump version to 2.99.8.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * configure.ac: Bump version to 2.99.7.
+ * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+ * include/ffi.h.in LICENSE src/debug.c src/closures.c
+ src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h
+ src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c
+ src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S
+ src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c
+ src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c
+ src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S
+ src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h
+ src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c
+ src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S
+ src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h
+ src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h
+ src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S
+ src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h
+ src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S
+ src/arm/ffitarget.h src/prep_cif.c: Update license text.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * README: Update tested platforms.
+ * configure.ac: Bump version to 2.99.6.
+ * configure: Rebuilt.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * configure.ac: Bump version to 2.99.5.
+ * configure: Rebuilt.
+ * Makefile.am (EXTRA_DIST): Add darwin64.S
+ * Makefile.in: Rebuilt.
+ * testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree.
+ * LICENSE: Update WARRANTY.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * libffi.pc.in (libdir): Fix libdir definition.
+ * configure.ac: Bump version to 2.99.4.
+ * configure: Rebuilt.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * README: Update.
+ * libffi.info: New file.
+ * doc/stamp-vti: New file.
+ * configure.ac: Bump version to 2.99.3.
+ * configure: Rebuilt.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * Makefile.am (SUBDIRS): Add man dir.
+ * Makefile.in: Rebuilt.
+ * configure.ac: Create Makefile.
+ * configure: Rebuilt.
+ * man/ffi_call.3 man/ffi_prep_cif.3 man/ffi_prep_closure.3
+ man/Makefile.am man/Makefile.in: New files.
+
+2008-02-14 Tom Tromey <tromey@redhat.com>
+
+ * aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt.
+ * mdate-sh, texinfo.tex: New files.
+ * Makefile.am (info_TEXINFOS): New variable.
+ * doc/libffi.texi: New file.
+ * doc/version.texi: Likewise.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * Makefile.am (AM_CFLAGS): Don't compile with -D$(TARGET).
+ (lib_LTLIBRARIES): Define.
+ (toolexeclib_LIBRARIES): Undefine.
+ * Makefile.in: Rebuilt.
+ * configure.ac: Reset version to 2.99.1.
+ * configure.in: Rebuilt.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * libffi.pc.in: Use @PACKAGE_NAME@ and @PACKAGE_VERSION@.
+ * configure.ac: Reset version to 2.99.1.
+ * configure.in: Rebuilt.
+ * Makefile.am (EXTRA_DIST): Add ChangeLog.libffi.
+ * Makefile.in: Rebuilt.
+ * LICENSE: Update copyright notice.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * include/Makefile.am (nodist_includes_HEADERS): Define. Don't
+ distribute ffitarget.h or ffi.h from the build include dir.
+ * Makefile.in: Rebuilt.
+
+2008-02-14 Anthony Green <green@redhat.com>
+
+ * include/Makefile.am (includesdir): Install headers under libdir.
+ (pkgconfigdir): Define. Install libffi.pc.
+ * include/Makefile.in: Rebuilt.
+ * libffi.pc.in: Create.
+ * libtool-version: Increment CURRENT
+ * configure.ac: Add libffi.pc.in
+ * configure: Rebuilt.
+
+2008-02-03 Anthony Green <green@redhat.com>
+
+ * include/Makefile.am (includesdir): Fix header install with
+ DESTDIR.
+ * include/Makefile.in: Rebuilt.
+
+2008-02-03 Timothy Wall <twall@users.sf.net>
+
+ * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return
+ offset based on code pointer, not data pointer.
+
+2008-02-01 Anthony Green <green@redhat.com>
+
+ * include/Makefile.am: Fix header installs.
+ * Makefile.am: Ditto.
+ * include/Makefile.in: Rebuilt.
+ * Makefile.in: Ditto.
+
+2008-02-01 Anthony Green <green@redhat.com>
+
+ * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL,
+ FFI_INIT_TRAMPOLINE): Revert my broken changes to twall's last
+ patch.
+
+2008-01-31 Anthony Green <green@redhat.com>
+
+ * Makefile.am (EXTRA_DIST): Add missing files.
+ * testsuite/Makefile.am: Ditto.
+ * Makefile.in, testsuite/Makefile.in: Rebuilt.
+
+2008-01-31 Timothy Wall <twall@users.sf.net>
+
+ * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall
+ closures.
+ * src/x86/ffitarget.h: Increase size of trampoline for stdcall
+ closures.
+ * src/x86/win32.S: Add assembly for stdcall closure.
+ * src/x86/ffi.c: Initialize stdcall closure trampoline.
+
+2008-01-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR libffi/34612
+ * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when
+ returning struct.
+
+ * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer"
+ tests.
+
+2008-01-30 Anthony Green <green@redhat.com>
+
+ * Makefile.am, include/Makefile.am: Move headers to
+ libffi_la_SOURCES for new automake.
+ * Makefile.in, include/Makefile.in: Rebuilt.
+
+ * testsuite/lib/wrapper.exp: Copied from gcc tree to allow for
+ execution outside of gcc tree.
+ * testsuite/lib/target-libpath.exp: Ditto.
+
+ * testsuite/lib/libffi-dg.exp: Many changes to allow for execution
+ outside of gcc tree.
+
diff --git a/Modules/_ctypes/libffi/ChangeLog.libgcj b/Modules/_ctypes/libffi/ChangeLog.libgcj
new file mode 100644
index 0000000000..ea5d02f19b
--- /dev/null
+++ b/Modules/_ctypes/libffi/ChangeLog.libgcj
@@ -0,0 +1,40 @@
+2004-01-14 Kelley Cook <kcook@gcc.gnu.org>
+
+ * configure.in: Add in AC_PREREQ(2.13)
+
+2003-02-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to
+ config.status.
+ * configure: Rebuilt.
+
+2002-01-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST.
+ Remove USE_LIBDIR conditional.
+ * Makefile.am (toolexecdir, toolexeclibdir): Don't override.
+ * Makefile.in, configure: Rebuilt.
+
+Mon Aug 9 18:33:38 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * include/Makefile.in: Rebuilt.
+ * Makefile.in: Rebuilt
+ * Makefile.am (toolexeclibdir): Add $(MULTISUBDIR) even for native
+ builds.
+ Use USE_LIBDIR.
+
+ * configure: Rebuilt.
+ * configure.in (USE_LIBDIR): Define for native builds.
+ Use lowercase in configure --help explanations.
+
+1999-08-08 Anthony Green <green@cygnus.com>
+
+ * include/ffi.h.in (FFI_FN): Remove `...'.
+
+1999-08-08 Anthony Green <green@cygnus.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (AM_CFLAGS): Compile with -fexceptions.
+
+ * src/x86/sysv.S: Add exception handling metadata.
+
diff --git a/Modules/_ctypes/libffi/ChangeLog.v1 b/Modules/_ctypes/libffi/ChangeLog.v1
new file mode 100644
index 0000000000..369820cbdb
--- /dev/null
+++ b/Modules/_ctypes/libffi/ChangeLog.v1
@@ -0,0 +1,764 @@
+The libffi version 1 ChangeLog archive.
+
+Version 1 of libffi had per-directory ChangeLogs. Current and future
+versions have a single ChangeLog file in the root directory. The
+version 1 ChangeLogs have all been concatonated into this file for
+future reference only.
+
+--- libffi ----------------------------------------------------------------
+
+Mon Oct 5 02:17:50 1998 Anthony Green <green@cygnus.com>
+
+ * configure.in: Boosted rev.
+ * configure, Makefile.in, aclocal.m4: Rebuilt.
+ * README: Boosted rev and updated release notes.
+
+Mon Oct 5 01:03:03 1998 Anthony Green <green@cygnus.com>
+
+ * configure.in: Boosted rev.
+ * configure, Makefile.in, aclocal.m4: Rebuilt.
+ * README: Boosted rev and updated release notes.
+
+1998-07-25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * m68k/ffi.c (ffi_prep_cif_machdep): Use bitmask for cif->flags.
+ Correctly handle small structures.
+ (ffi_prep_args): Also handle small structures.
+ (ffi_call): Pass size of return type to ffi_call_SYSV.
+ * m68k/sysv.S: Adjust for above changes. Correctly align small
+ structures in the return value.
+
+ * types.c (uint64, sint64) [M68K]: Change alignment to 4.
+
+Fri Apr 17 17:26:58 1998 Anthony Green <green@hoser.cygnus.com>
+
+ * configure.in: Boosted rev.
+ * configure,Makefile.in,aclocal.m4: Rebuilt.
+ * README: Boosted rev and added release notes.
+
+Sun Feb 22 00:50:41 1998 Geoff Keating <geoffk@ozemail.com.au>
+
+ * configure.in: Add PowerPC config bits.
+
+1998-02-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * configure.in: Add m68k config bits. Change AC_CANONICAL_SYSTEM
+ to AC_CANONICAL_HOST, this is not a compiler. Use $host instead
+ of $target. Remove AC_CHECK_SIZEOF(char), we already know the
+ result. Fix argument of AC_ARG_ENABLE.
+ * configure, fficonfig.h.in: Rebuilt.
+
+Tue Feb 10 20:53:40 1998 Richard Henderson <rth@cygnus.com>
+
+ * configure.in: Add Alpha config bits.
+
+Tue May 13 13:39:20 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * README: Updated dates and reworded Irix comments.
+
+ * configure.in: Removed AC_PROG_RANLIB.
+
+ * Makefile.in, aclocal.m4, config.guess, config.sub, configure,
+ ltmain.sh, */Makefile.in: libtoolized again and rebuilt with
+ automake and autoconf.
+
+Sat May 10 18:44:50 1997 Tom Tromey <tromey@cygnus.com>
+
+ * configure, aclocal.m4: Rebuilt.
+ * configure.in: Don't compute EXTRADIST; now handled in
+ src/Makefile.in. Removed macros implied by AM_INIT_AUTOMAKE.
+ Don't run AM_MAINTAINER_MODE.
+
+Thu May 8 14:34:05 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * missing, ltmain.sh, ltconfig.sh: Created. These are new files
+ required by automake and libtool.
+
+ * README: Boosted rev to 1.14. Added notes.
+
+ * acconfig.h: Moved PACKAGE and VERSION for new automake.
+
+ * configure.in: Changes for libtool.
+
+ * Makefile.am (check): make test now make check. Uses libtool now.
+
+ * Makefile.in, configure.in, aclocal.h, fficonfig.h.in: Rebuilt.
+
+Thu May 1 16:27:07 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * missing: Added file required by new automake.
+
+Tue Nov 26 14:10:42 1996 Anthony Green <green@csk3.cygnus.com>
+
+ * acconfig.h: Added USING_PURIFY flag. This is defined when
+ --enable-purify-safety was used at configure time.
+
+ * configure.in (allsources): Added --enable-purify-safety switch.
+ (VERSION): Boosted rev to 1.13.
+ * configure: Rebuilt.
+
+Fri Nov 22 06:46:12 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * configure.in (VERSION): Boosted rev to 1.12.
+ Removed special CFLAGS hack for gcc.
+ * configure: Rebuilt.
+
+ * README: Boosted rev to 1.12. Added notes.
+
+ * Many files: Cygnus Support changed to Cygnus Solutions.
+
+Wed Oct 30 11:15:25 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * configure.in (VERSION): Boosted rev to 1.11.
+ * configure: Rebuilt.
+
+ * README: Boosted rev to 1.11. Added notes about GNU make.
+
+Tue Oct 29 12:25:12 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * configure.in: Fixed -Wall trick.
+ (VERSION): Boosted rev.
+ * configure: Rebuilt
+
+ * acconfig.h: Needed for --enable-debug configure switch.
+
+ * README: Boosted rev to 1.09. Added more notes on building
+ libffi, and LCLint.
+
+ * configure.in: Added --enable-debug switch. Boosted rev to
+ 1.09.
+ * configure: Rebuilt
+
+Tue Oct 15 13:11:28 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * configure.in (VERSION): Boosted rev to 1.08
+ * configure: Rebuilt.
+
+ * README: Added n32 bug fix notes.
+
+ * Makefile.am: Added "make lint" production.
+ * Makefile.in: Rebuilt.
+
+Mon Oct 14 10:54:46 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * README: Added web page reference.
+
+ * configure.in, README: Boosted rev to 1.05
+ * configure: Rebuilt.
+
+ * README: Fixed n32 sample code.
+
+Fri Oct 11 17:09:28 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * README: Added sparc notes.
+
+ * configure.in, README: Boosted rev to 1.04.
+ * configure: Rebuilt.
+
+Thu Oct 10 10:31:03 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * configure.in, README: Boosted rev to 1.03.
+ * configure: Rebuilt.
+
+ * README: Added struct notes.
+
+ * Makefile.am (EXTRA_DIST): Added LICENSE to distribution.
+ * Makefile.in: Rebuilt.
+
+ * README: Removed Linux section. No special notes now
+ because aggregates arg/return types work.
+
+Wed Oct 9 16:16:42 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * README, configure.in (VERSION): Boosted rev to 1.02
+ * configure: Rebuilt.
+
+Tue Oct 8 11:56:33 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * README (NOTE): Added n32 notes.
+
+ * Makefile.am: Added test production.
+ * Makefile: Rebuilt
+
+ * README: spell checked!
+
+ * configure.in (VERSION): Boosted rev to 1.01
+ * configure: Rebuilt.
+
+Mon Oct 7 15:50:22 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * configure.in: Added nasty bit to support SGI tools.
+ * configure: Rebuilt.
+
+ * README: Added SGI notes. Added note about automake bug.
+
+Mon Oct 7 11:00:28 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * README: Rewrote intro, and fixed examples.
+
+Fri Oct 4 10:19:55 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * configure.in: -D$TARGET is no longer used as a compiler switch.
+ It is now inserted into ffi.h at configure time.
+ * configure: Rebuilt.
+
+ * FFI_ABI and FFI_STATUS are now ffi_abi and ffi_status.
+
+Thu Oct 3 13:47:34 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * README, LICENSE: Created. Wrote some docs.
+
+ * configure.in: Don't barf on i586-unknown-linuxaout.
+ Added EXTRADIST code for "make dist".
+ * configure: Rebuilt.
+
+ * */Makefile.in: Rebuilt with patched automake.
+
+Tue Oct 1 17:12:25 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * Makefile.am, aclocal.m4, config.guess, config.sub,
+ configure.in, fficonfig.h.in, install-sh, mkinstalldirs,
+ stamp-h.in: Created
+ * Makefile.in, configure: Generated
+
+--- libffi/include --------------------------------------------------------
+
+Tue Feb 24 13:09:36 1998 Anthony Green <green@gerbil.cygnus.com>
+
+ * ffi_mips.h: Updated FFI_TYPE_STRUCT_* values based on
+ ffi.h.in changes. This is a work-around for SGI's "simple"
+ assembler.
+
+Sun Feb 22 00:51:55 1998 Geoff Keating <geoffk@ozemail.com.au>
+
+ * ffi.h.in: PowerPC support.
+
+1998-02-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * ffi.h.in: Add m68k support.
+ (FFI_TYPE_LONGDOUBLE): Make it a separate value.
+
+Tue Feb 10 20:55:16 1998 Richard Henderson <rth@cygnus.com>
+
+ * ffi.h.in (SIZEOF_ARG): Use a pointer type by default.
+
+ * ffi.h.in: Alpha support.
+
+Fri Nov 22 06:48:45 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.h.in, ffi_common.h: Cygnus Support -> Cygnus Solutions.
+
+Wed Nov 20 22:31:01 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.h.in: Added ffi_type_void definition.
+
+Tue Oct 29 12:22:40 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * Makefile.am (hack_DATA): Always install ffi_mips.h.
+
+ * ffi.h.in: Removed FFI_DEBUG. It's now in the correct
+ place (acconfig.h).
+ Added #include <stddef.h> for size_t definition.
+
+Tue Oct 15 17:23:35 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.h.in, ffi_common.h, ffi_mips.h: More clean up.
+ Commented out #define of FFI_DEBUG.
+
+Tue Oct 15 13:01:06 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi_common.h: Added bool definition.
+
+ * ffi.h.in, ffi_common.h: Clean up based on LCLint output.
+ Added funny /*@...@*/ comments to annotate source.
+
+Mon Oct 14 12:29:23 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.h.in: Interface changes based on feedback from Jim
+ Blandy.
+
+Fri Oct 11 16:49:35 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.h.in: Small change for sparc support.
+
+Thu Oct 10 14:53:37 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi_mips.h: Added FFI_TYPE_STRUCT_* definitions for
+ special structure return types.
+
+Wed Oct 9 13:55:57 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.h.in: Added SIZEOF_ARG definition for X86
+
+Tue Oct 8 11:40:36 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.h.in (FFI_FN): Added macro for eliminating compiler warnings.
+ Use it to case your function pointers to the proper type.
+
+ * ffi_mips.h (SIZEOF_ARG): Added magic to fix type promotion bug.
+
+ * Makefile.am (EXTRA_DIST): Added ffi_mips.h to EXTRA_DIST.
+ * Makefile: Rebuilt.
+
+ * ffi_mips.h: Created. Moved all common mips definitions here.
+
+Mon Oct 7 10:58:12 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.h.in: The SGI assember is very picky about parens. Redefined
+ some macros to avoid problems.
+
+ * ffi.h.in: Added FFI_DEFAULT_ABI definitions. Also added
+ externs for pointer, and 64bit integral ffi_types.
+
+Fri Oct 4 09:51:37 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.h.in: Added FFI_ABI member to ffi_cif and changed
+ function prototypes accordingly.
+ Added #define @TARGET@. Now programs including ffi.h don't
+ have to specify this themselves.
+
+Thu Oct 3 15:36:44 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.h.in: Changed ffi_prep_cif's values from void* to void**
+
+ * Makefile.am (EXTRA_DIST): Added EXTRA_DIST for "make dist"
+ to work.
+ * Makefile.in: Regenerated.
+
+Wed Oct 2 10:16:59 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * Makefile.am: Created
+ * Makefile.in: Generated
+
+ * ffi_common.h: Added rcsid comment
+
+Tue Oct 1 17:13:51 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.h.in, ffi_common.h: Created
+
+--- libffi/src ------------------------------------------------------------
+
+Mon Oct 5 02:17:50 1998 Anthony Green <green@cygnus.com>
+
+ * arm/ffi.c, arm/sysv.S: Created.
+
+ * Makefile.am: Added arm files.
+ * Makefile.in: Rebuilt.
+
+Mon Oct 5 01:41:38 1998 Anthony Green <green@rtl.cygnus.com>
+
+ * Makefile.am (libffi_la_LDFLAGS): Incremented revision.
+
+Sun Oct 4 16:27:17 1998 Anthony Green <green@cygnus.com>
+
+ * alpha/osf.S (ffi_call_osf): Patch for DU assembler.
+
+ * ffitest.c (main): long long and long double return values work
+ for x86.
+
+Fri Apr 17 11:50:58 1998 Anthony Green <green@hoser.cygnus.com>
+
+ * Makefile.in: Rebuilt.
+
+ * ffitest.c (main): Floating point tests not executed for systems
+ with broken lond double (SunOS 4 w/ GCC).
+
+ * types.c: Fixed x86 alignment info for long long types.
+
+Thu Apr 16 07:15:28 1998 Anthony Green <green@ada.cygnus.com>
+
+ * ffitest.c: Added more notes about GCC bugs under Irix 6.
+
+Wed Apr 15 08:42:22 1998 Anthony Green <green@hoser.cygnus.com>
+
+ * ffitest.c (struct5): New test function.
+ (main): New test with struct5.
+
+Thu Mar 5 10:48:11 1998 Anthony Green <green@tootie.to.cygnus.com>
+
+ * prep_cif.c (initialize_aggregate): Fix assertion for
+ nested structures.
+
+Tue Feb 24 16:33:41 1998 Anthony Green <green@hoser.cygnus.com>
+
+ * prep_cif.c (ffi_prep_cif): Added long double support for sparc.
+
+Sun Feb 22 00:52:18 1998 Geoff Keating <geoffk@ozemail.com.au>
+
+ * powerpc/asm.h: New file.
+ * powerpc/ffi.c: New file.
+ * powerpc/sysv.S: New file.
+ * Makefile.am: PowerPC port.
+ * ffitest.c (main): Allow all tests to run even in presence of gcc
+ bug on PowerPC.
+
+1998-02-17 Anthony Green <green@hoser.cygnus.com>
+
+ * mips/ffi.c: Fixed comment typo.
+
+ * x86/ffi.c (ffi_prep_cif_machdep), x86/sysv.S (retfloat):
+ Fixed x86 long double return handling.
+
+ * types.c: Fixed x86 long double alignment info.
+
+1998-02-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * types.c: Add m68k support.
+
+ * ffitest.c (floating): Add long double parameter.
+ (return_ll, ldblit): New functions to test long long and long
+ double return value.
+ (main): Fix type error in assignment of ts[1-4]_type.elements.
+ Add tests for long long and long double arguments and return
+ values.
+
+ * prep_cif.c (ffi_prep_cif) [M68K]: Don't allocate argument for
+ struct value pointer.
+
+ * m68k/ffi.c, m68k/sysv.S: New files.
+ * Makefile.am: Add bits for m68k port. Add kludge to work around
+ automake deficiency.
+ (test): Don't require "." in $PATH.
+ * Makefile.in: Rebuilt.
+
+Wed Feb 11 07:36:50 1998 Anthony Green <green@hoser.cygnus.com>
+
+ * Makefile.in: Rebuilt.
+
+Tue Feb 10 20:56:00 1998 Richard Henderson <rth@cygnus.com>
+
+ * alpha/ffi.c, alpha/osf.S: New files.
+ * Makefile.am: Alpha port.
+
+Tue Nov 18 14:12:07 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * mips/ffi.c (ffi_prep_cif_machdep): Initialize rstruct_flag
+ for n32.
+
+Tue Jun 3 17:18:20 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * ffitest.c (main): Added hack to get structure tests working
+ correctly.
+
+Sat May 10 19:06:42 1997 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (EXTRA_DIST): Explicitly list all distributable
+ files in subdirs.
+ (VERSION, CC): Removed.
+
+Thu May 8 17:19:01 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * Makefile.am: Many changes for new automake and libtool.
+ * Makefile.in: Rebuilt.
+
+Fri Nov 22 06:57:56 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffitest.c (main): Fixed test case for non mips machines.
+
+Wed Nov 20 22:31:59 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * types.c: Added ffi_type_void declaration.
+
+Tue Oct 29 13:07:19 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffitest.c (main): Fixed character constants.
+ (main): Emit warning for structure test 3 failure on Sun.
+
+ * Makefile.am (VPATH): Fixed VPATH def'n so automake won't
+ strip it out.
+ Moved distdir hack from libffi to automake.
+ (ffitest): Added missing -c for $(COMPILE) (change in automake).
+ * Makefile.in: Rebuilt.
+
+Tue Oct 15 13:08:20 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * Makefile.am: Added "make lint" production.
+ * Makefile.in: Rebuilt.
+
+ * prep_cif.c (STACK_ARG_SIZE): Improved STACK_ARG_SIZE macro.
+ Clean up based on LCLint output. Added funny /*@...@*/ comments to
+ annotate source.
+
+ * ffitest.c, debug.c: Cleaned up code.
+
+Mon Oct 14 12:26:56 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffitest.c: Changes based on interface changes.
+
+ * prep_cif.c (ffi_prep_cif): Cleaned up interface based on
+ feedback from Jim Blandy.
+
+Fri Oct 11 15:53:18 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffitest.c: Reordered tests while porting to sparc.
+ Made changes to handle lame structure passing for sparc.
+ Removed calls to fflush().
+
+ * prep_cif.c (ffi_prep_cif): Added special case for sparc
+ aggregate type arguments.
+
+Thu Oct 10 09:56:51 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffitest.c (main): Added structure passing/returning tests.
+
+ * prep_cif.c (ffi_prep_cif): Perform proper initialization
+ of structure return types if needed.
+ (initialize_aggregate): Bug fix
+
+Wed Oct 9 16:04:20 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * types.c: Added special definitions for x86 (double doesn't
+ need double word alignment).
+
+ * ffitest.c: Added many tests
+
+Tue Oct 8 09:19:22 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * prep_cif.c (ffi_prep_cif): Fixed assertion.
+
+ * debug.c (ffi_assert): Must return a non void now.
+
+ * Makefile.am: Added test production.
+ * Makefile: Rebuilt.
+
+ * ffitest.c (main): Created.
+
+ * types.c: Created. Stripped common code out of */ffi.c.
+
+ * prep_cif.c: Added missing stdlib.h include.
+
+ * debug.c (ffi_type_test): Used "a" to eliminate compiler
+ warnings in non-debug builds. Included ffi_common.h.
+
+Mon Oct 7 15:36:42 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * Makefile.am: Added a rule for .s -> .o
+ This is required by the SGI compiler.
+ * Makefile: Rebuilt.
+
+Fri Oct 4 09:51:08 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * prep_cif.c (initialize_aggregate): Moved abi specification
+ to ffi_prep_cif().
+
+Thu Oct 3 15:37:37 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * prep_cif.c (ffi_prep_cif): Changed values from void* to void**.
+ (initialize_aggregate): Fixed aggregate type initialization.
+
+ * Makefile.am (EXTRA_DIST): Added support code for "make dist".
+ * Makefile.in: Regenerated.
+
+Wed Oct 2 11:41:57 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * debug.c, prep_cif: Created.
+
+ * Makefile.am: Added debug.o and prep_cif.o to OBJ.
+ * Makefile.in: Regenerated.
+
+ * Makefile.am (INCLUDES): Added missing -I../include
+ * Makefile.in: Regenerated.
+
+Tue Oct 1 17:11:51 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * error.c, Makefile.am: Created.
+ * Makefile.in: Generated.
+
+--- libffi/src/x86 --------------------------------------------------------
+
+Sun Oct 4 16:27:17 1998 Anthony Green <green@cygnus.com>
+
+ * sysv.S (retlongdouble): Fixed long long return value support.
+ * ffi.c (ffi_prep_cif_machdep): Ditto.
+
+Wed May 13 04:30:33 1998 Anthony Green <green@raft.ppp.tsoft.net>
+
+ * ffi.c (ffi_prep_cif_machdep): Fixed long double return value
+ support.
+
+Wed Apr 15 08:43:20 1998 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.c (ffi_prep_args): small struct support was missing.
+
+Thu May 8 16:53:58 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * objects.mak: Removed.
+
+Mon Dec 2 15:12:58 1996 Tom Tromey <tromey@cygnus.com>
+
+ * sysv.S: Use .balign, for a.out Linux boxes.
+
+Tue Oct 15 13:06:50 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.c: Clean up based on LCLint output.
+ Added funny /*@...@*/ comments to annotate source.
+
+Fri Oct 11 16:43:38 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.c (ffi_call): Added assertion for bad ABIs.
+
+Wed Oct 9 13:57:27 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * sysv.S (retdouble): Fixed double return problems.
+
+ * ffi.c (ffi_call): Corrected fn arg definition.
+ (ffi_prep_cif_machdep): Fixed double return problems
+
+Tue Oct 8 12:12:49 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.c: Moved ffi_type definitions to types.c.
+ (ffi_prep_args): Fixed type promotion bug.
+
+Mon Oct 7 15:53:06 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.c (FFI_*_TYPEDEF): Removed redundant ';'
+
+Fri Oct 4 09:54:53 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped
+ remaining args.
+
+Wed Oct 2 10:07:05 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.c, sysv.S, objects.mak: Created.
+ (ffi_prep_cif): cif->rvalue no longer initialized to NULL.
+ (ffi_prep_cif_machdep): Moved machine independent cif processing
+ to src/prep_cif.c. Introduced ffi_prep_cif_machdep().
+
+--- libffi/src/mips -------------------------------------------------------
+
+Tue Feb 17 17:18:07 1998 Anthony Green <green@hoser.cygnus.com>
+
+ * o32.S: Fixed typo in comment.
+
+ * ffi.c (ffi_prep_cif_machdep): Fixed argument processing.
+
+Thu May 8 16:53:58 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * o32.s, n32.s: Wrappers for SGI tool support.
+
+ * objects.mak: Removed.
+
+Tue Oct 29 14:37:45 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.c (ffi_prep_args): Changed int z to size_t z.
+
+Tue Oct 15 13:17:25 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * n32.S: Fixed bad stack munging.
+
+ * ffi.c: Moved prototypes for ffi_call_?32() to here from
+ ffi_mips.h because extended_cif is not defined in ffi_mips.h.
+
+Mon Oct 14 12:42:02 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.c: Interface changes based on feedback from Jim Blandy.
+
+Thu Oct 10 11:22:16 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * n32.S, ffi.c: Lots of changes to support passing and
+ returning structures with the n32 calling convention.
+
+ * n32.S: Fixed fn pointer bug.
+
+ * ffi.c (ffi_prep_cif_machdep): Fix for o32 structure
+ return values.
+ (ffi_prep_args): Fixed n32 structure passing when structures
+ partially fit in registers.
+
+Wed Oct 9 13:49:25 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * objects.mak: Added n32.o.
+
+ * n32.S: Created.
+
+ * ffi.c (ffi_prep_args): Added magic to support proper
+ n32 processing.
+
+Tue Oct 8 10:37:35 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.c: Moved ffi_type definitions to types.c.
+ (ffi_prep_args): Fixed type promotion bug.
+
+ * o32.S: This code is only built for o32 compiles.
+ A lot of the #define cruft has moved to ffi_mips.h.
+
+ * ffi.c (ffi_prep_cif_machdep): Fixed arg flags. Second arg
+ is only processed if the first is either a float or double.
+
+Mon Oct 7 15:33:59 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * o32.S: Modified to compile under each of o32, n32 and n64.
+
+ * ffi.c (FFI_*_TYPEDEF): Removed redundant ';'
+
+Fri Oct 4 09:53:25 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped
+ remaining args.
+
+Wed Oct 2 17:41:22 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * o32.S: Removed crufty definitions.
+
+Wed Oct 2 12:53:42 1996 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.c (ffi_prep_cif): cif->rvalue no longer initialized to NULL.
+ (ffi_prep_cif_machdep): Moved all machine independent cif processing
+ to src/prep_cif.c. Introduced ffi_prep_cif_machdep. Return types
+ of FFI_TYPE_STRUCT are no different than FFI_TYPE_INT.
+
+Tue Oct 1 17:11:02 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.c, o32.S, object.mak: Created
+
+--- libffi/src/sparc ------------------------------------------------------
+
+Tue Feb 24 16:33:18 1998 Anthony Green <green@hoser.cygnus.com>
+
+ * ffi.c (ffi_prep_args): Added long double support.
+
+Thu May 8 16:53:58 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * objects.mak: Removed.
+
+Thu May 1 16:07:56 1997 Anthony Green <green@hoser.cygnus.com>
+
+ * v8.S: Fixed minor portability problem reported by
+ Russ McManus <mcmanr@eq.gs.com>.
+
+Tue Nov 26 14:12:43 1996 Anthony Green <green@csk3.cygnus.com>
+
+ * v8.S: Used STACKFRAME define elsewhere.
+
+ * ffi.c (ffi_prep_args): Zero out space when USING_PURIFY
+ is set.
+ (ffi_prep_cif_machdep): Allocate the correct stack frame
+ space for functions with < 6 args.
+
+Tue Oct 29 15:08:55 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.c (ffi_prep_args): int z is now size_t z.
+
+Mon Oct 14 13:31:24 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * v8.S (ffi_call_V8): Gordon rewrites this again. It looks
+ great now.
+
+ * ffi.c (ffi_call): The comment about hijacked registers
+ is no longer valid after gordoni hacked v8.S.
+
+ * v8.S (ffi_call_V8): Rewrote with gordoni. Much simpler.
+
+ * v8.S, ffi.c: ffi_call() had changed to accept more than
+ two args, so v8.S had to change (because it hijacks incoming
+ arg registers).
+
+ * ffi.c: Interface changes based on feedback from Jim Blandy.
+
+Thu Oct 10 17:48:16 1996 Anthony Green <green@rtl.cygnus.com>
+
+ * ffi.c, v8.S, objects.mak: Created.
+
+
diff --git a/Modules/_ctypes/libffi/LICENSE b/Modules/_ctypes/libffi/LICENSE
index 064f4fa6e1..ec2fd69487 100644
--- a/Modules/_ctypes/libffi/LICENSE
+++ b/Modules/_ctypes/libffi/LICENSE
@@ -1,4 +1,4 @@
-libffi - Copyright (c) 1996-2008 Red Hat, Inc and others.
+libffi - Copyright (c) 1996-2009 Anthony Green, Red Hat, Inc and others.
See source files for details.
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/Modules/_ctypes/libffi/Makefile.am b/Modules/_ctypes/libffi/Makefile.am
index 0db52ca758..f47dd1a549 100644
--- a/Modules/_ctypes/libffi/Makefile.am
+++ b/Modules/_ctypes/libffi/Makefile.am
@@ -7,6 +7,7 @@ SUBDIRS = include testsuite man
EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \
+ src/avr32/ffi.c src/avr32/sysv.S src/avr32/ffitarget.h \
src/cris/ffi.c src/cris/sysv.S src/cris/ffitarget.h \
src/ia64/ffi.c src/ia64/ffitarget.h src/ia64/ia64_flags.h \
src/ia64/unix.S \
@@ -25,12 +26,13 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \
src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \
src/sparc/ffi.c src/x86/darwin64.S \
- src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/darwin.S \
- src/x86/freebsd.S \
+ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/win64.S \
+ src/x86/darwin.S src/x86/freebsd.S \
src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \
src/pa/ffitarget.h src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \
src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c \
- libtool-version ChangeLog.libffi
+ libtool-version ChangeLog.libffi m4/libtool.m4 \
+ m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
info_TEXINFOS = doc/libffi.texi
@@ -79,6 +81,8 @@ AM_MAKEFLAGS = \
MAKEOVERRIDES=
+ACLOCAL_AMFLAGS=$(ACLOCAL_AMFLAGS) -I m4
+
lib_LTLIBRARIES = libffi.la
noinst_LTLIBRARIES = libffi_convenience.la
@@ -102,6 +106,9 @@ endif
if X86_WIN32
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
endif
+if X86_WIN64
+nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win64.S
+endif
if X86_DARWIN
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
endif
@@ -135,6 +142,9 @@ endif
if ARM
nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
endif
+if AVR32
+nodist_libffi_la_SOURCES += src/avr32/sysv.S src/avr32/ffi.c
+endif
if LIBFFI_CRIS
nodist_libffi_la_SOURCES += src/cris/sysv.S src/cris/ffi.c
endif
@@ -165,7 +175,7 @@ nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
AM_CFLAGS = -Wall -g -fexceptions
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
AM_CCASFLAGS = $(AM_CPPFLAGS)
@@ -174,4 +184,3 @@ AM_CCASFLAGS = $(AM_CPPFLAGS)
.PHONY: install-html install-pdf
install-html:
install-pdf:
-
diff --git a/Modules/_ctypes/libffi/Makefile.in b/Modules/_ctypes/libffi/Makefile.in
index 90523fbbdc..49afcc1e78 100644
--- a/Modules/_ctypes/libffi/Makefile.in
+++ b/Modules/_ctypes/libffi/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -17,8 +18,9 @@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -38,33 +40,34 @@ target_triplet = @target@
@X86_TRUE@am__append_2 = src/x86/ffi.c src/x86/sysv.S
@X86_FREEBSD_TRUE@am__append_3 = src/x86/ffi.c src/x86/freebsd.S
@X86_WIN32_TRUE@am__append_4 = src/x86/ffi.c src/x86/win32.S
-@X86_DARWIN_TRUE@am__append_5 = src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
-@SPARC_TRUE@am__append_6 = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
-@ALPHA_TRUE@am__append_7 = src/alpha/ffi.c src/alpha/osf.S
-@IA64_TRUE@am__append_8 = src/ia64/ffi.c src/ia64/unix.S
-@M32R_TRUE@am__append_9 = src/m32r/sysv.S src/m32r/ffi.c
-@M68K_TRUE@am__append_10 = src/m68k/ffi.c src/m68k/sysv.S
-@POWERPC_TRUE@am__append_11 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
-@POWERPC_AIX_TRUE@am__append_12 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
-@POWERPC_DARWIN_TRUE@am__append_13 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
-@POWERPC_FREEBSD_TRUE@am__append_14 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
-@ARM_TRUE@am__append_15 = src/arm/sysv.S src/arm/ffi.c
-@LIBFFI_CRIS_TRUE@am__append_16 = src/cris/sysv.S src/cris/ffi.c
-@FRV_TRUE@am__append_17 = src/frv/eabi.S src/frv/ffi.c
-@S390_TRUE@am__append_18 = src/s390/sysv.S src/s390/ffi.c
-@X86_64_TRUE@am__append_19 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
-@SH_TRUE@am__append_20 = src/sh/sysv.S src/sh/ffi.c
-@SH64_TRUE@am__append_21 = src/sh64/sysv.S src/sh64/ffi.c
-@PA_LINUX_TRUE@am__append_22 = src/pa/linux.S src/pa/ffi.c
-@PA_HPUX_TRUE@am__append_23 = src/pa/hpux32.S src/pa/ffi.c
+@X86_WIN64_TRUE@am__append_5 = src/x86/ffi.c src/x86/win64.S
+@X86_DARWIN_TRUE@am__append_6 = src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
+@SPARC_TRUE@am__append_7 = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
+@ALPHA_TRUE@am__append_8 = src/alpha/ffi.c src/alpha/osf.S
+@IA64_TRUE@am__append_9 = src/ia64/ffi.c src/ia64/unix.S
+@M32R_TRUE@am__append_10 = src/m32r/sysv.S src/m32r/ffi.c
+@M68K_TRUE@am__append_11 = src/m68k/ffi.c src/m68k/sysv.S
+@POWERPC_TRUE@am__append_12 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
+@POWERPC_AIX_TRUE@am__append_13 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
+@POWERPC_DARWIN_TRUE@am__append_14 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
+@POWERPC_FREEBSD_TRUE@am__append_15 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
+@ARM_TRUE@am__append_16 = src/arm/sysv.S src/arm/ffi.c
+@AVR32_TRUE@am__append_17 = src/avr32/sysv.S src/avr32/ffi.c
+@LIBFFI_CRIS_TRUE@am__append_18 = src/cris/sysv.S src/cris/ffi.c
+@FRV_TRUE@am__append_19 = src/frv/eabi.S src/frv/ffi.c
+@S390_TRUE@am__append_20 = src/s390/sysv.S src/s390/ffi.c
+@X86_64_TRUE@am__append_21 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
+@SH_TRUE@am__append_22 = src/sh/sysv.S src/sh/ffi.c
+@SH64_TRUE@am__append_23 = src/sh64/sysv.S src/sh64/ffi.c
+@PA_LINUX_TRUE@am__append_24 = src/pa/linux.S src/pa/ffi.c
+@PA_HPUX_TRUE@am__append_25 = src/pa/hpux32.S src/pa/ffi.c
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/doc/stamp-vti \
$(srcdir)/doc/version.texi $(srcdir)/fficonfig.h.in \
- $(srcdir)/libffi.pc.in $(top_srcdir)/configure ChangeLog TODO \
- compile config.guess config.sub depcomp install-sh ltcf-c.sh \
- ltcf-cxx.sh ltcf-gcj.sh ltconfig ltmain.sh mdate-sh missing \
- mkinstalldirs texinfo.tex
+ $(srcdir)/libffi.pc.in $(top_srcdir)/configure ChangeLog \
+ compile config.guess config.sub depcomp install-sh ltmain.sh \
+ mdate-sh missing texinfo.tex
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
@@ -72,18 +75,33 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = fficonfig.h
CONFIG_CLEAN_FILES = libffi.pc
+CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(infodir)" \
"$(DESTDIR)$(pkgconfigdir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
libffi_la_LIBADD =
am__dirstamp = $(am__leading_dot)dirstamp
@@ -94,37 +112,39 @@ am_libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
@X86_TRUE@am__objects_2 = src/x86/ffi.lo src/x86/sysv.lo
@X86_FREEBSD_TRUE@am__objects_3 = src/x86/ffi.lo src/x86/freebsd.lo
@X86_WIN32_TRUE@am__objects_4 = src/x86/ffi.lo src/x86/win32.lo
-@X86_DARWIN_TRUE@am__objects_5 = src/x86/ffi.lo src/x86/darwin.lo \
+@X86_WIN64_TRUE@am__objects_5 = src/x86/ffi.lo src/x86/win64.lo
+@X86_DARWIN_TRUE@am__objects_6 = src/x86/ffi.lo src/x86/darwin.lo \
@X86_DARWIN_TRUE@ src/x86/ffi64.lo src/x86/darwin64.lo
-@SPARC_TRUE@am__objects_6 = src/sparc/ffi.lo src/sparc/v8.lo \
+@SPARC_TRUE@am__objects_7 = src/sparc/ffi.lo src/sparc/v8.lo \
@SPARC_TRUE@ src/sparc/v9.lo
-@ALPHA_TRUE@am__objects_7 = src/alpha/ffi.lo src/alpha/osf.lo
-@IA64_TRUE@am__objects_8 = src/ia64/ffi.lo src/ia64/unix.lo
-@M32R_TRUE@am__objects_9 = src/m32r/sysv.lo src/m32r/ffi.lo
-@M68K_TRUE@am__objects_10 = src/m68k/ffi.lo src/m68k/sysv.lo
-@POWERPC_TRUE@am__objects_11 = src/powerpc/ffi.lo src/powerpc/sysv.lo \
+@ALPHA_TRUE@am__objects_8 = src/alpha/ffi.lo src/alpha/osf.lo
+@IA64_TRUE@am__objects_9 = src/ia64/ffi.lo src/ia64/unix.lo
+@M32R_TRUE@am__objects_10 = src/m32r/sysv.lo src/m32r/ffi.lo
+@M68K_TRUE@am__objects_11 = src/m68k/ffi.lo src/m68k/sysv.lo
+@POWERPC_TRUE@am__objects_12 = src/powerpc/ffi.lo src/powerpc/sysv.lo \
@POWERPC_TRUE@ src/powerpc/ppc_closure.lo \
@POWERPC_TRUE@ src/powerpc/linux64.lo \
@POWERPC_TRUE@ src/powerpc/linux64_closure.lo
-@POWERPC_AIX_TRUE@am__objects_12 = src/powerpc/ffi_darwin.lo \
+@POWERPC_AIX_TRUE@am__objects_13 = src/powerpc/ffi_darwin.lo \
@POWERPC_AIX_TRUE@ src/powerpc/aix.lo \
@POWERPC_AIX_TRUE@ src/powerpc/aix_closure.lo
-@POWERPC_DARWIN_TRUE@am__objects_13 = src/powerpc/ffi_darwin.lo \
+@POWERPC_DARWIN_TRUE@am__objects_14 = src/powerpc/ffi_darwin.lo \
@POWERPC_DARWIN_TRUE@ src/powerpc/darwin.lo \
@POWERPC_DARWIN_TRUE@ src/powerpc/darwin_closure.lo
-@POWERPC_FREEBSD_TRUE@am__objects_14 = src/powerpc/ffi.lo \
+@POWERPC_FREEBSD_TRUE@am__objects_15 = src/powerpc/ffi.lo \
@POWERPC_FREEBSD_TRUE@ src/powerpc/sysv.lo \
@POWERPC_FREEBSD_TRUE@ src/powerpc/ppc_closure.lo
-@ARM_TRUE@am__objects_15 = src/arm/sysv.lo src/arm/ffi.lo
-@LIBFFI_CRIS_TRUE@am__objects_16 = src/cris/sysv.lo src/cris/ffi.lo
-@FRV_TRUE@am__objects_17 = src/frv/eabi.lo src/frv/ffi.lo
-@S390_TRUE@am__objects_18 = src/s390/sysv.lo src/s390/ffi.lo
-@X86_64_TRUE@am__objects_19 = src/x86/ffi64.lo src/x86/unix64.lo \
+@ARM_TRUE@am__objects_16 = src/arm/sysv.lo src/arm/ffi.lo
+@AVR32_TRUE@am__objects_17 = src/avr32/sysv.lo src/avr32/ffi.lo
+@LIBFFI_CRIS_TRUE@am__objects_18 = src/cris/sysv.lo src/cris/ffi.lo
+@FRV_TRUE@am__objects_19 = src/frv/eabi.lo src/frv/ffi.lo
+@S390_TRUE@am__objects_20 = src/s390/sysv.lo src/s390/ffi.lo
+@X86_64_TRUE@am__objects_21 = src/x86/ffi64.lo src/x86/unix64.lo \
@X86_64_TRUE@ src/x86/ffi.lo src/x86/sysv.lo
-@SH_TRUE@am__objects_20 = src/sh/sysv.lo src/sh/ffi.lo
-@SH64_TRUE@am__objects_21 = src/sh64/sysv.lo src/sh64/ffi.lo
-@PA_LINUX_TRUE@am__objects_22 = src/pa/linux.lo src/pa/ffi.lo
-@PA_HPUX_TRUE@am__objects_23 = src/pa/hpux32.lo src/pa/ffi.lo
+@SH_TRUE@am__objects_22 = src/sh/sysv.lo src/sh/ffi.lo
+@SH64_TRUE@am__objects_23 = src/sh64/sysv.lo src/sh64/ffi.lo
+@PA_LINUX_TRUE@am__objects_24 = src/pa/linux.lo src/pa/ffi.lo
+@PA_HPUX_TRUE@am__objects_25 = src/pa/hpux32.lo src/pa/ffi.lo
nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
$(am__objects_3) $(am__objects_4) $(am__objects_5) \
$(am__objects_6) $(am__objects_7) $(am__objects_8) \
@@ -132,30 +152,33 @@ nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
$(am__objects_12) $(am__objects_13) $(am__objects_14) \
$(am__objects_15) $(am__objects_16) $(am__objects_17) \
$(am__objects_18) $(am__objects_19) $(am__objects_20) \
- $(am__objects_21) $(am__objects_22) $(am__objects_23)
+ $(am__objects_21) $(am__objects_22) $(am__objects_23) \
+ $(am__objects_24) $(am__objects_25)
libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) \
$(nodist_libffi_la_OBJECTS)
libffi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libffi_la_LDFLAGS) $(LDFLAGS) -o $@
libffi_convenience_la_LIBADD =
-am__objects_24 = src/debug.lo src/prep_cif.lo src/types.lo \
+am__objects_26 = src/debug.lo src/prep_cif.lo src/types.lo \
src/raw_api.lo src/java_raw_api.lo src/closures.lo
-am_libffi_convenience_la_OBJECTS = $(am__objects_24)
-am__objects_25 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
+am_libffi_convenience_la_OBJECTS = $(am__objects_26)
+am__objects_27 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
$(am__objects_4) $(am__objects_5) $(am__objects_6) \
$(am__objects_7) $(am__objects_8) $(am__objects_9) \
$(am__objects_10) $(am__objects_11) $(am__objects_12) \
$(am__objects_13) $(am__objects_14) $(am__objects_15) \
$(am__objects_16) $(am__objects_17) $(am__objects_18) \
$(am__objects_19) $(am__objects_20) $(am__objects_21) \
- $(am__objects_22) $(am__objects_23)
-nodist_libffi_convenience_la_OBJECTS = $(am__objects_25)
+ $(am__objects_22) $(am__objects_23) $(am__objects_24) \
+ $(am__objects_25)
+nodist_libffi_convenience_la_OBJECTS = $(am__objects_27)
libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \
$(nodist_libffi_convenience_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -193,10 +216,12 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
-pkgconfigDATA_INSTALL = $(INSTALL_DATA)
DATA = $(pkgconfig_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
@@ -204,9 +229,34 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
- { test ! -d $(distdir) \
- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr $(distdir); }; }
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(distdir)"; }; }
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
@@ -214,6 +264,7 @@ distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
+AM_LTLDFLAGS = @AM_LTLDFLAGS@
AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
AR = @AR@
AUTOCONF = @AUTOCONF@
@@ -228,21 +279,17 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
GREP = @GREP@
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
INSTALL = @INSTALL@
@@ -250,16 +297,23 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -280,8 +334,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -312,6 +365,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -330,6 +384,7 @@ target_os = @target_os@
target_vendor = @target_vendor@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign subdir-objects
@@ -337,6 +392,7 @@ SUBDIRS = include testsuite man
EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \
+ src/avr32/ffi.c src/avr32/sysv.S src/avr32/ffitarget.h \
src/cris/ffi.c src/cris/sysv.S src/cris/ffitarget.h \
src/ia64/ffi.c src/ia64/ffitarget.h src/ia64/ia64_flags.h \
src/ia64/unix.S \
@@ -355,12 +411,13 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \
src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \
src/sparc/ffi.c src/x86/darwin64.S \
- src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/darwin.S \
- src/x86/freebsd.S \
+ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/win64.S \
+ src/x86/darwin.S src/x86/freebsd.S \
src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \
src/pa/ffitarget.h src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \
src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c \
- libtool-version ChangeLog.libffi
+ libtool-version ChangeLog.libffi m4/libtool.m4 \
+ m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
info_TEXINFOS = doc/libffi.texi
@@ -402,6 +459,7 @@ AM_MAKEFLAGS = \
"DESTDIR=$(DESTDIR)"
MAKEOVERRIDES =
+ACLOCAL_AMFLAGS = $(ACLOCAL_AMFLAGS) -I m4
lib_LTLIBRARIES = libffi.la
noinst_LTLIBRARIES = libffi_convenience.la
libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c \
@@ -416,11 +474,12 @@ nodist_libffi_la_SOURCES = $(am__append_1) $(am__append_2) \
$(am__append_12) $(am__append_13) $(am__append_14) \
$(am__append_15) $(am__append_16) $(am__append_17) \
$(am__append_18) $(am__append_19) $(am__append_20) \
- $(am__append_21) $(am__append_22) $(am__append_23)
+ $(am__append_21) $(am__append_22) $(am__append_23) \
+ $(am__append_24) $(am__append_25)
libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
AM_CFLAGS = -Wall -g -fexceptions
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(AM_LTLDFLAGS)
AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
AM_CCASFLAGS = $(AM_CPPFLAGS)
all: fficonfig.h
@@ -434,15 +493,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -458,9 +517,10 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
fficonfig.h: stamp-h1
@if test ! -f $@; then \
@@ -472,7 +532,7 @@ stamp-h1: $(srcdir)/fficonfig.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status fficonfig.h
$(srcdir)/fficonfig.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
@@ -483,20 +543,24 @@ libffi.pc: $(top_builddir)/config.status $(srcdir)/libffi.pc.in
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
if test -f $$p; then \
- f=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ list2="$$list2 $$p"; \
else :; fi; \
- done
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- p=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
- $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
@@ -554,6 +618,8 @@ src/x86/freebsd.lo: src/x86/$(am__dirstamp) \
src/x86/$(DEPDIR)/$(am__dirstamp)
src/x86/win32.lo: src/x86/$(am__dirstamp) \
src/x86/$(DEPDIR)/$(am__dirstamp)
+src/x86/win64.lo: src/x86/$(am__dirstamp) \
+ src/x86/$(DEPDIR)/$(am__dirstamp)
src/x86/darwin.lo: src/x86/$(am__dirstamp) \
src/x86/$(DEPDIR)/$(am__dirstamp)
src/x86/ffi64.lo: src/x86/$(am__dirstamp) \
@@ -648,6 +714,16 @@ src/arm/sysv.lo: src/arm/$(am__dirstamp) \
src/arm/$(DEPDIR)/$(am__dirstamp)
src/arm/ffi.lo: src/arm/$(am__dirstamp) \
src/arm/$(DEPDIR)/$(am__dirstamp)
+src/avr32/$(am__dirstamp):
+ @$(MKDIR_P) src/avr32
+ @: > src/avr32/$(am__dirstamp)
+src/avr32/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/avr32/$(DEPDIR)
+ @: > src/avr32/$(DEPDIR)/$(am__dirstamp)
+src/avr32/sysv.lo: src/avr32/$(am__dirstamp) \
+ src/avr32/$(DEPDIR)/$(am__dirstamp)
+src/avr32/ffi.lo: src/avr32/$(am__dirstamp) \
+ src/avr32/$(DEPDIR)/$(am__dirstamp)
src/cris/$(am__dirstamp):
@$(MKDIR_P) src/cris
@: > src/cris/$(am__dirstamp)
@@ -725,6 +801,10 @@ mostlyclean-compile:
-rm -f src/arm/ffi.lo
-rm -f src/arm/sysv.$(OBJEXT)
-rm -f src/arm/sysv.lo
+ -rm -f src/avr32/ffi.$(OBJEXT)
+ -rm -f src/avr32/ffi.lo
+ -rm -f src/avr32/sysv.$(OBJEXT)
+ -rm -f src/avr32/sysv.lo
-rm -f src/closures.$(OBJEXT)
-rm -f src/closures.lo
-rm -f src/cris/ffi.$(OBJEXT)
@@ -823,6 +903,8 @@ mostlyclean-compile:
-rm -f src/x86/unix64.lo
-rm -f src/x86/win32.$(OBJEXT)
-rm -f src/x86/win32.lo
+ -rm -f src/x86/win64.$(OBJEXT)
+ -rm -f src/x86/win64.lo
distclean-compile:
-rm -f *.tab.c
@@ -837,6 +919,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/osf.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/ffi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/sysv.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/avr32/$(DEPDIR)/ffi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/avr32/$(DEPDIR)/sysv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/cris/$(DEPDIR)/ffi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/cris/$(DEPDIR)/sysv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/frv/$(DEPDIR)/eabi.Plo@am__quote@
@@ -880,11 +964,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/sysv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/unix64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/win32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/win64.Plo@am__quote@
.S.o:
@am__fastdepCCAS_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCCAS_TRUE@ mv -f $$depbase.Tpo $$depbase.Po
+@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ $<
@@ -892,7 +977,7 @@ distclean-compile:
.S.obj:
@am__fastdepCCAS_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCCAS_TRUE@ mv -f $$depbase.Tpo $$depbase.Po
+@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
@@ -900,7 +985,7 @@ distclean-compile:
.S.lo:
@am__fastdepCCAS_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCCAS_TRUE@ mv -f $$depbase.Tpo $$depbase.Plo
+@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(LTCPPASCOMPILE) -c -o $@ $<
@@ -908,7 +993,7 @@ distclean-compile:
.c.o:
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Po
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $<
@@ -916,7 +1001,7 @@ distclean-compile:
.c.obj:
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Po
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
@@ -924,7 +1009,7 @@ distclean-compile:
.c.lo:
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Plo
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
@@ -937,6 +1022,7 @@ clean-libtool:
-rm -rf src/.libs src/_libs
-rm -rf src/alpha/.libs src/alpha/_libs
-rm -rf src/arm/.libs src/arm/_libs
+ -rm -rf src/avr32/.libs src/avr32/_libs
-rm -rf src/cris/.libs src/cris/_libs
-rm -rf src/frv/.libs src/frv/_libs
-rm -rf src/ia64/.libs src/ia64/_libs
@@ -952,14 +1038,14 @@ clean-libtool:
-rm -rf src/x86/.libs src/x86/_libs
distclean-libtool:
- -rm -f libtool
+ -rm -f libtool config.lt
doc/$(am__dirstamp):
@$(MKDIR_P) doc
@: > doc/$(am__dirstamp)
$(srcdir)/doc/libffi.info: doc/libffi.texi $(srcdir)/doc/version.texi
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
- am__cwd=`pwd` && cd $(srcdir) && \
+ am__cwd=`pwd` && $(am__cd) $(srcdir) && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
@@ -971,10 +1057,10 @@ $(srcdir)/doc/libffi.info: doc/libffi.texi $(srcdir)/doc/version.texi
-o $@ $(srcdir)/doc/libffi.texi; \
then \
rc=0; \
- cd $(srcdir); \
+ $(am__cd) $(srcdir); \
else \
rc=$$?; \
- cd $(srcdir) && \
+ $(am__cd) $(srcdir) && \
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
fi; \
rm -rf $$backupdir; exit $$rc
@@ -1028,16 +1114,18 @@ maintainer-clean-vti:
uninstall-dvi-am:
@$(NORMAL_UNINSTALL)
- @list='$(DVIS)'; for p in $$list; do \
- f=$(am__strip_dir) \
+ @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
rm -f "$(DESTDIR)$(dvidir)/$$f"; \
done
uninstall-html-am:
@$(NORMAL_UNINSTALL)
- @list='$(HTMLS)'; for p in $$list; do \
- f=$(am__strip_dir) \
+ @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
done
@@ -1051,7 +1139,8 @@ uninstall-info-am:
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
- install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
+ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
+ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
done; \
else :; fi
@$(NORMAL_UNINSTALL)
@@ -1067,16 +1156,18 @@ uninstall-info-am:
uninstall-pdf-am:
@$(NORMAL_UNINSTALL)
- @list='$(PDFS)'; for p in $$list; do \
- f=$(am__strip_dir) \
+ @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
done
uninstall-ps-am:
@$(NORMAL_UNINSTALL)
- @list='$(PSS)'; for p in $$list; do \
- f=$(am__strip_dir) \
+ @list='$(PSS)'; test -n "$(psdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
rm -f "$(DESTDIR)$(psdir)/$$f"; \
done
@@ -1093,16 +1184,19 @@ dist-info: $(INFO_DEPS)
for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
if test -f $$file; then \
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
- test -f $(distdir)/$$relfile || \
- cp -p $$file $(distdir)/$$relfile; \
+ test -f "$(distdir)/$$relfile" || \
+ cp -p $$file "$(distdir)/$$relfile"; \
else :; fi; \
done; \
done
mostlyclean-aminfo:
-rm -rf libffi.aux libffi.cp libffi.cps libffi.fn libffi.ky libffi.log \
- libffi.pg libffi.tmp libffi.toc libffi.tp libffi.vr \
- doc/libffi.dvi doc/libffi.pdf doc/libffi.ps doc/libffi.html
+ libffi.pg libffi.tmp libffi.toc libffi.tp libffi.vr
+
+clean-aminfo:
+ -test -z "doc/libffi.dvi doc/libffi.pdf doc/libffi.ps doc/libffi.html" \
+ || rm -rf doc/libffi.dvi doc/libffi.pdf doc/libffi.ps doc/libffi.html
maintainer-clean-aminfo:
@list='$(INFO_DEPS)'; for i in $$list; do \
@@ -1113,20 +1207,23 @@ maintainer-clean-aminfo:
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
- @list='$(pkgconfig_DATA)'; for p in $$list; do \
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
- $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
done
uninstall-pkgconfigDATA:
@$(NORMAL_UNINSTALL)
- @list='$(pkgconfig_DATA)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
- rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
- done
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -1152,7 +1249,7 @@ $(RECURSIVE_TARGETS):
else \
local_target="$$target"; \
fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
@@ -1186,16 +1283,16 @@ $(RECURSIVE_CLEAN_TARGETS):
else \
local_target="$$target"; \
fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -1203,14 +1300,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
@@ -1222,46 +1319,50 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) fficonfig.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) fficonfig.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
- test -d $(distdir) || mkdir $(distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -1277,29 +1378,44 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
- distdir=`$(am__cd) $(distdir) && pwd`; \
- top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
- (cd $$subdir && \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$top_distdir" \
- distdir="$$distdir/$$subdir" \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
+ am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
@@ -1307,11 +1423,12 @@ distdir: $(DISTFILES)
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-info
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r $(distdir)
+ || chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
@@ -1320,6 +1437,14 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
@@ -1346,6 +1471,10 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
@@ -1357,9 +1486,11 @@ distcheck: dist
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && cd $(distdir)/_build \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
@@ -1381,13 +1512,15 @@ distcheck: dist
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
- @cd $(distuninstallcheck_dir) \
+ @$(am__cd) '$(distuninstallcheck_dir)' \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
@@ -1432,6 +1565,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f doc/$(am__dirstamp)
-rm -f src/$(DEPDIR)/$(am__dirstamp)
-rm -f src/$(am__dirstamp)
@@ -1439,6 +1573,8 @@ distclean-generic:
-rm -f src/alpha/$(am__dirstamp)
-rm -f src/arm/$(DEPDIR)/$(am__dirstamp)
-rm -f src/arm/$(am__dirstamp)
+ -rm -f src/avr32/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/avr32/$(am__dirstamp)
-rm -f src/cris/$(DEPDIR)/$(am__dirstamp)
-rm -f src/cris/$(am__dirstamp)
-rm -f src/frv/$(DEPDIR)/$(am__dirstamp)
@@ -1471,12 +1607,12 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- clean-noinstLTLIBRARIES mostlyclean-am
+clean-am: clean-aminfo clean-generic clean-libLTLIBRARIES \
+ clean-libtool clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf src/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/mips/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/x86/$(DEPDIR)
+ -rm -rf src/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/mips/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/x86/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
@@ -1500,37 +1636,45 @@ install-dvi: install-dvi-recursive
install-dvi-am: $(DVIS)
@$(NORMAL_INSTALL)
test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)"
- @list='$(DVIS)'; for p in $$list; do \
+ @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/$$f"; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
done
install-exec-am: install-libLTLIBRARIES
install-html-am: $(HTMLS)
@$(NORMAL_INSTALL)
test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
- @list='$(HTMLS)'; for p in $$list; do \
+ @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
+ $(am__strip_dir) \
if test -d "$$d$$p"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
$(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+ $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
else \
- echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+ list2="$$list2 $$d$$p"; \
fi; \
- done
+ done; \
+ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done; }
install-info: install-info-recursive
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- list='$(INFO_DEPS)'; \
+ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
@@ -1538,18 +1682,19 @@ install-info-am: $(INFO_DEPS)
if test -f $$file; then d=.; else d=$(srcdir); fi; \
file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
- $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
+ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
if test -f $$ifile; then \
- relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
- echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
- $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
+ echo "$$ifile"; \
else : ; fi; \
done; \
- done
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
@$(POST_INSTALL)
@if (install-info --version && \
install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
- list='$(INFO_DEPS)'; \
+ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
@@ -1561,29 +1706,33 @@ install-man:
install-pdf-am: $(PDFS)
@$(NORMAL_INSTALL)
test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
- @list='$(PDFS)'; for p in $$list; do \
+ @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \
- done
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
install-ps: install-ps-recursive
install-ps-am: $(PSS)
@$(NORMAL_INSTALL)
test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)"
- @list='$(PSS)'; for p in $$list; do \
+ @list='$(PSS)'; test -n "$(psdir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(psdir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(psdir)/$$f"; \
- done
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf src/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/mips/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/x86/$(DEPDIR)
+ -rm -rf src/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/mips/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/x86/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti
@@ -1605,36 +1754,38 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
uninstall-libLTLIBRARIES uninstall-pdf-am \
uninstall-pkgconfigDATA uninstall-ps-am
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
- install-strip
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
+ ctags-recursive install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am am--refresh check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
- ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
- dist-info dist-shar dist-tarZ dist-zip distcheck distclean \
- distclean-compile distclean-generic distclean-hdr \
- distclean-libtool distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am \
- install-libLTLIBRARIES install-man install-pdf install-pdf-am \
- install-pkgconfigDATA install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-aminfo \
- maintainer-clean-generic maintainer-clean-vti mostlyclean \
- mostlyclean-aminfo mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool mostlyclean-vti pdf pdf-am ps ps-am tags \
- tags-recursive uninstall uninstall-am uninstall-dvi-am \
- uninstall-html-am uninstall-info-am uninstall-libLTLIBRARIES \
- uninstall-pdf-am uninstall-pkgconfigDATA uninstall-ps-am
+ all all-am am--refresh check check-am clean clean-aminfo \
+ clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstLTLIBRARIES ctags ctags-recursive dist dist-all \
+ dist-bzip2 dist-gzip dist-info dist-lzma dist-shar dist-tarZ \
+ dist-xz dist-zip distcheck distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-libLTLIBRARIES \
+ install-man install-pdf install-pdf-am install-pkgconfigDATA \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-aminfo maintainer-clean-generic \
+ maintainer-clean-vti mostlyclean mostlyclean-aminfo \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-vti pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-dvi-am uninstall-html-am \
+ uninstall-info-am uninstall-libLTLIBRARIES uninstall-pdf-am \
+ uninstall-pkgconfigDATA uninstall-ps-am
# No install-html or install-pdf support in automake yet
.PHONY: install-html install-pdf
install-html:
install-pdf:
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/Modules/_ctypes/libffi/README b/Modules/_ctypes/libffi/README
index a936962f3f..167de42461 100644
--- a/Modules/_ctypes/libffi/README
+++ b/Modules/_ctypes/libffi/README
@@ -1,7 +1,7 @@
Status
======
-libffi-3.0.5 was released on April 3, 2008. Check the libffi web
+libffi-3.0.10 was released on XXXXXXXXXX, 2010. Check the libffi web
page for updates: <URL:http://sourceware.org/libffi/>.
@@ -9,27 +9,27 @@ What is libffi?
===============
Compilers for high level languages generate code that follow certain
-conventions. These conventions are necessary, in part, for separate
-compilation to work. One such convention is the "calling convention".
-The "calling convention" is a set of assumptions made by the compiler
-about where function arguments will be found on entry to a function.
-A "calling convention" also specifies where the return value for a
-function is found.
+conventions. These conventions are necessary, in part, for separate
+compilation to work. One such convention is the "calling
+convention". The "calling convention" is essentially a set of
+assumptions made by the compiler about where function arguments will
+be found on entry to a function. A "calling convention" also specifies
+where the return value for a function is found.
Some programs may not know at the time of compilation what arguments
-are to be passed to a function. For instance, an interpreter may be
+are to be passed to a function. For instance, an interpreter may be
told at run-time about the number and types of arguments used to call
-a given function. Libffi can be used in such programs to provide a
+a given function. Libffi can be used in such programs to provide a
bridge from the interpreter program to compiled code.
The libffi library provides a portable, high level programming
-interface to various calling conventions. This allows a programmer to
+interface to various calling conventions. This allows a programmer to
call any function specified by a call interface description at run
-time.
+time.
FFI stands for Foreign Function Interface. A foreign function
interface is the popular name for the interface that allows code
-written in one language to call code written in another language. The
+written in one language to call code written in another language. The
libffi library really only provides the lowest, machine dependent
layer of a fully featured foreign function interface. A layer must
exist above libffi that handles type conversions for values passed
@@ -39,36 +39,58 @@ between the two languages.
Supported Platforms
===================
-Libffi has been ported to many different platforms, although this
-release was only tested on:
-
- arm oabi linux
- arm eabi linux
- hppa linux
- mips o32 linux (little endian)
- powerpc darwin
- powerpc64 linux
- sparc solaris
- sparc64 solaris
- x86 cygwin
- x86 darwin
- x86 freebsd
- x86 linux
- x86 openbsd
- x86-64 darwin
- x86-64 linux
- x86-64 OS X
- x86-64 freebsd
-
+Libffi has been ported to many different platforms.
+For specific configuration details and testing status, please
+refer to the wiki page here:
+
+ http://www.moxielogic.org/wiki/index.php?title=Libffi_3.0.10
+
+At the time of release, the following basic configurations have been
+tested:
+
+|--------------+------------------|
+| Architecture | Operating System |
+|--------------+------------------|
+| Alpha | Linux |
+| Alpha | Tru64 |
+| ARM | Linux |
+| AVR32 | Linux |
+| HPPA | HPUX |
+| IA-64 | Linux |
+| MIPS | IRIX |
+| MIPS | Linux |
+| MIPS64 | Linux |
+| PowerPC | Linux |
+| PowerPC | Mac OSX |
+| PowerPC | FreeBSD |
+| PowerPC64 | Linux |
+| S390 | Linux |
+| S390X | Linux |
+| SPARC | Linux |
+| SPARC | Solaris |
+| SPARC64 | Linux |
+| SPARC64 | FreeBSD |
+| X86 | FreeBSD |
+| X86 | kFreeBSD |
+| X86 | Linux |
+| X86 | Mac OSX |
+| X86 | OpenBSD |
+| X86 | Solaris |
+| X86 | Windows/Cygwin |
+| X86 | Windows/MingW |
+| X86-64 | FreeBSD |
+| X86-64 | Linux |
+| X86-64 | OpenBSD |
+| X86-64 | Windows/MingW |
+|--------------+------------------|
+
Please send additional platform test results to
-libffi-discuss@sourceware.org.
+libffi-discuss@sourceware.org and feel free to update the wiki page
+above.
Installing libffi
=================
-[Note: before actually performing any of these installation steps,
- you may wish to read the "Platform Specific Notes" below.]
-
First you must configure the distribution for your particular
system. Go to the directory you wish to build libffi in and run the
"configure" program found in the root directory of the libffi source
@@ -87,6 +109,14 @@ will add some extra code which will suppress certain warnings when you
are using Purify with libffi. Only use this switch when using
Purify, as it will slow down the library.
+It's also possible to build libffi on Windows platforms with
+Microsoft's Visual C++ compiler. In this case, use the msvcc.sh
+wrapper script during configuration like so:
+
+path/to/configure --enable-shared --enable-static \
+ CC=path/to/msvcc.sh LD=link \
+ CPP=\"cl -nologo -EP\"
+
Configure has many other options. Use "configure --help" to see them all.
Once configure has finished, type "make". Note that you must be using
@@ -98,65 +128,34 @@ This will require that you have DejaGNU installed.
To install the library and header files, type "make install".
-Platform Specific Notes
-=======================
-
- MIPS - Irix 5.3 & 6.x
- ---------------------
-
-Irix 6.2 and better supports three different calling conventions: o32,
-n32 and n64. Currently, libffi only supports both o32 and n32 under
-Irix 6.x, but only o32 under Irix 5.3. Libffi will automatically be
-configured for whichever calling convention it was built for.
-
-By default, the configure script will try to build libffi with the GNU
-development tools. To build libffi with the SGI development tools, set
-the environment variable CC to either "cc -32" or "cc -n32" before
-running configure under Irix 6.x (depending on whether you want an o32
-or n32 library), or just "cc" for Irix 5.3.
-
-With the n32 calling convention, when returning structures smaller
-than 16 bytes, be sure to provide an RVALUE that is 8 byte aligned.
-Here's one way of forcing this:
-
- double struct_storage[2];
- my_small_struct *s = (my_small_struct *) struct_storage;
- /* Use s for RVALUE */
-
-If you don't do this you are liable to get spurious bus errors.
-
-"long long" values are not supported yet.
-
-You must use GNU Make to build libffi on SGI platforms.
-
-
- PowerPC System V ABI
- --------------------
+History
+=======
-There are two `System V ABI's which libffi implements for PowerPC.
-They differ only in how small structures are returned from functions.
+See the ChangeLog files for details.
-In the FFI_SYSV version, structures that are 8 bytes or smaller are
-returned in registers. This is what GCC does when it is configured
-for solaris, and is what the System V ABI I have (dated September
-1995) says.
+3.0.10 ???-??-??
+ Fix the N64 build on mips-sgi-irix6.5.
+ Testsuite fixes for Tru64 Unix.
+ Enable builds with Microsoft's compiler.
+ Enable x86 builds with Sun's compiler.
-In the FFI_GCC_SYSV version, all structures are returned the same way:
-by passing a pointer as the first argument to the function. This is
-what GCC does when it is configured for linux or a generic sysv
-target.
+3.0.9 Dec-31-09
+ Add AVR32 and win64 ports. Add ARM softfp support.
+ Many fixes for AIX, Solaris, HP-UX, *BSD.
+ Several PowerPC and x86-64 bug fixes.
+ Build DLL for windows.
-EGCS 1.0.1 (and probably other versions of EGCS/GCC) also has a
-inconsistency with the SysV ABI: When a procedure is called with many
-floating-point arguments, some of them get put on the stack. They are
-all supposed to be stored in double-precision format, even if they are
-only single-precision, but EGCS stores single-precision arguments as
-single-precision anyway. This causes one test to fail (the `many
-arguments' test).
+3.0.8 Dec-19-08
+ Add *BSD, BeOS, and PA-Linux support.
+3.0.7 Nov-11-08
+ Fix for ppc FreeBSD.
+ (thanks to Andreas Tobler)
-History
-=======
+3.0.6 Jul-17-08
+ Fix for closures on sh.
+ Mark the sh/sh64 stack as non-executable.
+ (both thanks to Kaz Kojima)
3.0.5 Apr-3-08
Fix libffi.pc file.
diff --git a/Modules/_ctypes/libffi/aclocal.m4 b/Modules/_ctypes/libffi/aclocal.m4
index 6b38324ec3..c8e526fbd0 100644
--- a/Modules/_ctypes/libffi/aclocal.m4
+++ b/Modules/_ctypes/libffi/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,6580 +11,15 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-m4_if(m4_PACKAGE_VERSION, [2.61],,
-[m4_fatal([this file was generated for autoconf 2.61.
-You have another version of autoconf. If you want to use that,
-you should regenerate the build system entirely.], [63])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-
-# serial 51 AC_PROG_LIBTOOL
-
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
- [],
- [m4_define([AC_PROVIDE_IFELSE],
- [m4_ifdef([AC_PROVIDE_$1],
- [$2], [$3])])])
-
-
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
- AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [AC_LIBTOOL_CXX],
- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
- ])])
-dnl And a similar setup for Fortran 77 support
- AC_PROVIDE_IFELSE([AC_PROG_F77],
- [AC_LIBTOOL_F77],
- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
- AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [ifdef([AC_PROG_GCJ],
- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([A][M_PROG_GCJ],
- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([LT_AC_PROG_GCJ],
- [define([LT_AC_PROG_GCJ],
- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
-
-
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
-
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
-
-# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- AC_PATH_MAGIC
- fi
- ;;
-esac
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
- [AC_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
- [AC_HELP_STRING([--with-pic],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
- [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_LINKER_BOILERPLATE
-
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
-
-
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
- [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
-
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
- ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X[$]1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-[$]*
-EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "[$]0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
- fi
- fi
- fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
-
-
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AC_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- libsuff=64
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
- ])
-esac
-
-need_locks="$enable_libtool_lock"
-
-])# _LT_AC_LOCK
-
-
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$5], , :, [$5])
-else
- ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$4], , :, [$4])
-else
- ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
-
-# _LT_AC_CHECK_DLFCN
-# ------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
-
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ---------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}]
-EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-
-# AC_LIBTOOL_DLOPEN_SELF
-# ----------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
-
-
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
-
-hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-
-
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
-
-
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_AC_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_AC_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
-
-
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
-fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
-
-
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-m4_if($1,[],[
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
- else
- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[[lt_foo]]++; }
- if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
- sys_lib_search_path_spec=`echo $lt_search_path_spec`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[[123]]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[[3-9]]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_ARG_WITH([tags],
- [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
- [include additional configurations @<:@automatic@:>@])],
- [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- AC_MSG_WARN([output file `$ofile' does not exist])
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
- else
- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
- "") ;;
- *) AC_MSG_ERROR([invalid tag name: $tagname])
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- AC_MSG_ERROR([tag name \"$tagname\" already exists])
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_LIBTOOL_LANG_CXX_CONFIG
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
- AC_LIBTOOL_LANG_F77_CONFIG
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
- AC_LIBTOOL_LANG_GCJ_CONFIG
- else
- tagname=""
- fi
- ;;
-
- RC)
- AC_LIBTOOL_LANG_RC_CONFIG
- ;;
-
- *)
- AC_MSG_ERROR([Unsupported tag name: $tagname])
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- AC_MSG_ERROR([unable to update list of available tagged configurations.])
- fi
-fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
- [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-# set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
- [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
- [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognize shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognize a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# AC_PATH_MAGIC
-
-
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
- [AC_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- if ( file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[[3-9]]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-])# AC_DEPLIBS_CHECK_METHOD
-
-
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
-
-
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-])# AC_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!). If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- case $enable_ltdl_convenience in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
- esac
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!). If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- AC_CHECK_LIB(ltdl, lt_dlinit,
- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
- [if test x"$enable_ltdl_install" = xno; then
- AC_MSG_WARN([libltdl not installed, but installation disabled])
- else
- enable_ltdl_install=yes
- fi
- ])
- if test x"$enable_ltdl_install" = x"yes"; then
- ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- else
- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
- LIBLTDL="-lltdl"
- LTDLINCL=
- fi
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ------------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# -------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF
-
-# Report which library types will actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- AC_PROG_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- freebsd[[12]]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- freebsd-elf*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*) ;;
- *)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- interix[[3-9]]*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
- _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
- _LT_AC_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
- _LT_AC_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-interix[[3-9]]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_AC_TAGVAR(predep_objects,$1)=
- _LT_AC_TAGVAR(postdep_objects,$1)=
- _LT_AC_TAGVAR(postdeps,$1)=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- #
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
- if test "$solaris_use_stlport4" != yes; then
- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
- program t
- end
-"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# -------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars. Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- _LT_AC_TAGVAR(compiler, $1) \
- _LT_AC_TAGVAR(CC, $1) \
- _LT_AC_TAGVAR(LD, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
- _LT_AC_TAGVAR(old_archive_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
- _LT_AC_TAGVAR(predep_objects, $1) \
- _LT_AC_TAGVAR(postdep_objects, $1) \
- _LT_AC_TAGVAR(predeps, $1) \
- _LT_AC_TAGVAR(postdeps, $1) \
- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
- _LT_AC_TAGVAR(archive_cmds, $1) \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
- _LT_AC_TAGVAR(postinstall_cmds, $1) \
- _LT_AC_TAGVAR(postuninstall_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
- _LT_AC_TAGVAR(allow_undefined_flag, $1) \
- _LT_AC_TAGVAR(no_undefined_flag, $1) \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
- _LT_AC_TAGVAR(hardcode_automatic, $1) \
- _LT_AC_TAGVAR(module_cmds, $1) \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) \
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
- _LT_AC_TAGVAR(fix_srcfile_path, $1) \
- _LT_AC_TAGVAR(exclude_expsyms, $1) \
- _LT_AC_TAGVAR(include_expsyms, $1); do
-
- case $var in
- _LT_AC_TAGVAR(old_archive_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
- _LT_AC_TAGVAR(archive_cmds, $1) | \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(module_cmds, $1) | \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\[$]0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
- ;;
- esac
-
-ifelse([$1], [],
- [cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- AC_MSG_NOTICE([creating $ofile])],
- [cfgfile="$ofile"])
-
- cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-])
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([LT_AC_PROG_SED])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux* | k*bsd*-gnu)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDGIRSTW]]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris*)
- symcode='[[BDRT]]'
- ;;
-sco3.2v5*)
- symcode='[[DT]]'
- ;;
-sysv4.2uw2*)
- symcode='[[DT]]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[[ABDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
- ;;
- esac
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- rdos*)
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-])
-
-
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
- ;;
- *)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-],[
- runpath_var=
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)=
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_AC_TAGVAR(hardcode_automatic, $1)=no
- _LT_AC_TAGVAR(module_cmds, $1)=
- _LT_AC_TAGVAR(module_expsym_cmds, $1)=
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_AC_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- _LT_CC_BASENAME([$compiler])
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- interix[[3-9]]*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- # see comment about different semantics on the GNU ld section
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- bsdi[[45]]*)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- freebsd1*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- os2*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_AC_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_MSG_CHECKING([whether -lc should be explicitly linked in])
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
- then
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
- ;;
- esac
- fi
- ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
-
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# # ifdef __CYGWIN32__
-# # define __CYGWIN__ __CYGWIN32__
-# # endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-# __hDllInstance_base = hInst;
-# return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
-
-
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
-
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)
-])
-
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
-
-
-# Cheap backport of AS_EXECUTABLE_P and required macros
-# from Autoconf 2.59; we should not use $as_executable_p directly.
-
-# _AS_TEST_PREPARE
-# ----------------
-m4_ifndef([_AS_TEST_PREPARE],
-[m4_defun([_AS_TEST_PREPARE],
-[if test -x / >/dev/null 2>&1; then
- as_executable_p='test -x'
-else
- as_executable_p='test -f'
-fi
-])])# _AS_TEST_PREPARE
-
-# AS_EXECUTABLE_P
-# ---------------
-# Check whether a file is executable.
-m4_ifndef([AS_EXECUTABLE_P],
-[m4_defun([AS_EXECUTABLE_P],
-[AS_REQUIRE([_AS_TEST_PREPARE])dnl
-$as_executable_p $1[]dnl
-])])# AS_EXECUTABLE_P
-
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])
-
-# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -6596,10 +31,10 @@ AC_MSG_RESULT([$SED])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.10'
+[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.10], [],
+m4_if([$1], [1.11.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -6613,10 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10])dnl
-_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# Figure out how to run the assembler. -*- Autoconf -*-
@@ -6695,14 +132,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 8
+# serial 9
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
@@ -6715,6 +152,7 @@ AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
@@ -6728,14 +166,14 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 9
+# serial 10
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
@@ -6792,6 +230,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
@@ -6809,7 +257,17 @@ AC_CACHE_CHECK([dependency style of $depcc],
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
@@ -6819,19 +277,23 @@ AC_CACHE_CHECK([dependency style of $depcc],
break
fi
;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
none) break ;;
esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
@@ -6888,57 +350,68 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-#serial 3
+#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
done
-done
+}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@@ -6958,13 +431,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 12
+# serial 16
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
@@ -6981,7 +454,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.60])dnl
+[AC_PREREQ([2.62])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -7032,8 +505,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
@@ -7041,24 +514,37 @@ AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
])
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
@@ -7069,18 +555,19 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
+_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $1 | $1:* )
+ $_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -7091,7 +578,14 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
@@ -7118,27 +612,38 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 4
+# serial 5
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
-[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode is disabled by default
- AC_ARG_ENABLE(maintainer-mode,
-[ --enable-maintainer-mode enable make rules and dependencies not useful
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
- USE_MAINTAINER_MODE=$enableval,
- USE_MAINTAINER_MODE=no)
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
- AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST(MAINT)dnl
+ AC_SUBST([MAINT])dnl
]
)
@@ -7146,13 +651,13 @@ AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 3
+# serial 4
# AM_MAKE_INCLUDE()
# -----------------
@@ -7161,7 +666,7 @@ AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
- @echo done
+ @echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
@@ -7171,24 +676,24 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
@@ -7196,14 +701,14 @@ AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
+# serial 6
# AM_PROG_CC_C_O
# --------------
@@ -7215,8 +720,9 @@ AC_REQUIRE_AUX_FILE([compile])dnl
# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
-ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
@@ -7232,14 +738,14 @@ m4_define([AC_PROG_CC],
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
+# serial 6
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
@@ -7256,7 +762,14 @@ AC_SUBST($1)])
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
@@ -7294,13 +807,13 @@ esac
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 3
+# serial 4
# _AM_MANGLE_OPTION(NAME)
# -----------------------
@@ -7317,7 +830,7 @@ AC_DEFUN([_AM_SET_OPTION],
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
@@ -7327,14 +840,14 @@ AC_DEFUN([_AM_IF_OPTION],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 4
+# serial 5
# AM_SANITY_CHECK
# ---------------
@@ -7343,16 +856,29 @@ AC_DEFUN([AM_SANITY_CHECK],
# Just in case
sleep 1
echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
+ set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
@@ -7405,18 +931,25 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
+# serial 2
+
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
-# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
@@ -7513,4 +1046,9 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
m4_include([acinclude.m4])
diff --git a/Modules/_ctypes/libffi/compile b/Modules/_ctypes/libffi/compile
new file mode 100755
index 0000000000..1b1d232169
--- /dev/null
+++ b/Modules/_ctypes/libffi/compile
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we strip `-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no `-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # `.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/Modules/_ctypes/libffi/config.guess b/Modules/_ctypes/libffi/config.guess
index 951383e355..d53e309f4b 100755
--- a/Modules/_ctypes/libffi/config.guess
+++ b/Modules/_ctypes/libffi/config.guess
@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
-timestamp='2007-05-17'
+timestamp='2009-11-19'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -27,16 +27,16 @@ timestamp='2007-05-17'
# the same distribution terms that you use for the rest of that program.
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -56,8 +56,8 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
+ | grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
@@ -324,14 +324,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
- i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
@@ -532,7 +548,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[45])
+ *:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -640,7 +656,7 @@ EOF
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
+ grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
@@ -791,18 +807,24 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
- *:Interix*:[3456]*)
+ *:Interix*:*)
case ${UNAME_MACHINE} in
- x86)
+ x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
- EM64T | authenticamd)
+ authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -832,8 +854,29 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -847,6 +890,17 @@ EOF
frv:Linux:*:*)
echo frv-unknown-linux-gnu
exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
@@ -856,74 +910,33 @@ EOF
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
- mips:Linux:*:*)
+ mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
- #undef mips
- #undef mipsel
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
+ CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
+ CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
@@ -933,8 +946,11 @@ EOF
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
@@ -954,72 +970,9 @@ EOF
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
- xtensa:Linux:*:*)
- echo xtensa-unknown-linux-gnu
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
@@ -1048,7 +1001,7 @@ EOF
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
@@ -1092,8 +1045,11 @@ EOF
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
@@ -1131,6 +1087,16 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
@@ -1143,7 +1109,7 @@ EOF
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
@@ -1206,6 +1172,9 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1233,6 +1202,16 @@ EOF
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1314,6 +1293,9 @@ EOF
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1474,9 +1456,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
diff --git a/Modules/_ctypes/libffi/config.sub b/Modules/_ctypes/libffi/config.sub
index c060f44833..17c91458a8 100755
--- a/Modules/_ctypes/libffi/config.sub
+++ b/Modules/_ctypes/libffi/config.sub
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
-timestamp='2007-04-29'
+timestamp='2009-11-07'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -32,13 +32,16 @@ timestamp='2007-04-29'
# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
@@ -72,8 +75,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -122,6 +125,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -148,10 +152,13 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
+ -apple | -axis | -knuth | -cray | -microblaze)
os=
basic_machine=$1
;;
+ -bluegene*)
+ os=-cnk
+ ;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
@@ -249,13 +256,16 @@ case $basic_machine in
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep \
+ | maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
- | mips64vr | mips64vrel \
+ | mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
@@ -268,6 +278,7 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | moxie \
| mt \
| msp430 \
| nios | nios2 \
@@ -276,20 +287,22 @@ case $basic_machine in
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
+ | rx \
| score \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
+ | ubicom32 \
| v850 | v850e \
| we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
+ | z8k | z80)
basic_machine=$basic_machine-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12)
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
@@ -329,14 +342,17 @@ case $basic_machine in
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
+ | mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
@@ -357,21 +373,26 @@ case $basic_machine in
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
| tron-* \
+ | ubicom32-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
+ | xstormy16-* | xtensa*-* \
| ymp-* \
- | z8k-*)
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -435,6 +456,10 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-bsd
;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -443,10 +468,26 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -475,8 +516,8 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16c)
- basic_machine=cr16c-unknown
+ cr16)
+ basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
@@ -514,6 +555,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
@@ -668,6 +713,14 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
m88k-omron*)
basic_machine=m88k-omron
;;
@@ -679,6 +732,9 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
mingw32)
basic_machine=i386-pc
os=-mingw32
@@ -813,6 +869,14 @@ case $basic_machine in
basic_machine=i860-intel
os=-osf
;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
pbd)
basic_machine=sparc-tti
;;
@@ -1021,6 +1085,10 @@ case $basic_machine in
basic_machine=tic6x-unknown
os=-coff
;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -1096,6 +1164,10 @@ case $basic_machine in
basic_machine=z8k-unknown
os=-sim
;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
none)
basic_machine=none-none
os=-none
@@ -1134,7 +1206,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1204,10 +1276,11 @@ case $os in
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
+ | -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1216,7 +1289,7 @@ case $os in
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
@@ -1226,7 +1299,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1356,6 +1429,9 @@ case $os in
-zvmoe)
os=-zvmoe
;;
+ -dicos*)
+ os=-dicos
+ ;;
-none)
;;
*)
@@ -1553,7 +1629,7 @@ case $basic_machine in
-sunos*)
vendor=sun
;;
- -aix*)
+ -cnk*|-aix*)
vendor=ibm
;;
-beos*)
diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
index 6984fc67fb..c5c70b19a6 100755
--- a/Modules/_ctypes/libffi/configure
+++ b/Modules/_ctypes/libffi/configure
@@ -1,62 +1,85 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for libffi 3.0.5.
+# Generated by GNU Autoconf 2.65 for libffi 3.0.10rc0.
#
# Report bugs to <http://gcc.gnu.org/bugs.html>.
#
+#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+#
+#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
esac
-
fi
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
fi
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
@@ -65,20 +88,18 @@ fi
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
+case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
IFS=$as_save_IFS
;;
@@ -89,354 +110,322 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
fi
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
# CDPATH.
-$as_unset CDPATH
-
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
else
- as_have_required=no
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
fi
-
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
else
- exitcode=1
- echo positional parameters were not saved.
+ as_have_required=no
fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- case $as_dir in
+ as_found=:
+ case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
done;;
esac
+ as_found=false
done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
IFS=$as_save_IFS
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
fi
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: http://gcc.gnu.org/bugs.html about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
-
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
}
+as_unset=as_fn_unset
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
-if as_func_ret_success; then
- :
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ fi
+ $as_echo "$as_me: error: $1" >&2
+ as_fn_exit $as_status
+} # as_fn_error
-exitcode=0
-if as_func_success; then
- :
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
+ as_expr=false
fi
-if as_func_ret_success; then
- :
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
+ as_basename=false
fi
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
else
- exitcode=1
- echo positional parameters were not saved.
+ as_dirname=false
fi
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
@@ -453,8 +442,7 @@ test \$exitcode = 0") || {
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
@@ -464,49 +452,40 @@ test \$exitcode = 0") || {
exit
}
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
-n*)
- case `echo 'x\c'` in
+ case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ fi
else
as_ln_s='cp -p'
fi
@@ -514,7 +493,7 @@ rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
+ as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
@@ -531,12 +510,12 @@ else
as_test_x='
eval sh -c '\''
if test -d "$1"; then
- test -d "$1/.";
+ test -d "$1/.";
else
- case $1 in
- -*)set "./$1";;
+ case $1 in #(
+ -*)set "./$1";;
esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
@@ -551,26 +530,25 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
-case X$ECHO in
+case X$lt_ECHO in
X*--fallback-echo)
# Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
;;
esac
-echo=${ECHO-echo}
+ECHO=${lt_ECHO-echo}
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X$1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
:
else
# Restart under the correct shell.
@@ -580,9 +558,9 @@ fi
if test "X$1" = X--fallback-echo; then
# used as fallback echo
shift
- cat <<EOF
+ cat <<_LT_EOF
$*
-EOF
+_LT_EOF
exit 0
fi
@@ -590,122 +568,118 @@ fi
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL $0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL $0 --fallback-echo"
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
else
- # maybe with a smaller string...
- prev=:
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
- for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
- if test "$prev" != 'sed 50q "$0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
fi
fi
fi
fi
-fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
fi
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
-
-exec 7<&0 </dev/null 6>&1
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@@ -723,14 +697,14 @@ cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='libffi'
PACKAGE_TARNAME='libffi'
-PACKAGE_VERSION='3.0.5'
-PACKAGE_STRING='libffi 3.0.5'
+PACKAGE_VERSION='3.0.10rc0'
+PACKAGE_STRING='libffi 3.0.10rc0'
PACKAGE_BUGREPORT='http://gcc.gnu.org/bugs.html'
+PACKAGE_URL=''
# Factoring default headers for most tests.
ac_includes_default="\
@@ -768,200 +742,219 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-target
-target_cpu
-target_vendor
-target_os
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-am__isrc
-CYGPATH_W
-PACKAGE
-VERSION
-ACLOCAL
-AUTOCONF
-AUTOMAKE
-AUTOHEADER
-MAKEINFO
-install_sh
-STRIP
-INSTALL_STRIP_PROGRAM
-mkdir_p
-AWK
-SET_MAKE
-am__leading_dot
-AMTAR
-am__tar
-am__untar
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-DEPDIR
-am__include
-am__quote
-AMDEP_TRUE
-AMDEP_FALSE
-AMDEPBACKSLASH
-CCDEPMODE
-am__fastdepCC_TRUE
-am__fastdepCC_FALSE
-CCAS
-CCASFLAGS
-CCASDEPMODE
-am__fastdepCCAS_TRUE
-am__fastdepCCAS_FALSE
-SED
-GREP
-EGREP
-LN_S
-ECHO
-AR
-RANLIB
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+toolexeclibdir
+toolexecdir
+TARGETDIR
+TARGET
+HAVE_LONG_DOUBLE
+ALLOCA
+PA64_HPUX_FALSE
+PA64_HPUX_TRUE
+PA_HPUX_FALSE
+PA_HPUX_TRUE
+PA_LINUX_FALSE
+PA_LINUX_TRUE
+SH64_FALSE
+SH64_TRUE
+SH_FALSE
+SH_TRUE
+X86_64_FALSE
+X86_64_TRUE
+S390_FALSE
+S390_TRUE
+FRV_FALSE
+FRV_TRUE
+LIBFFI_CRIS_FALSE
+LIBFFI_CRIS_TRUE
+AVR32_FALSE
+AVR32_TRUE
+ARM_FALSE
+ARM_TRUE
+POWERPC_FREEBSD_FALSE
+POWERPC_FREEBSD_TRUE
+POWERPC_DARWIN_FALSE
+POWERPC_DARWIN_TRUE
+POWERPC_AIX_FALSE
+POWERPC_AIX_TRUE
+POWERPC_FALSE
+POWERPC_TRUE
+M68K_FALSE
+M68K_TRUE
+M32R_FALSE
+M32R_TRUE
+IA64_FALSE
+IA64_TRUE
+ALPHA_FALSE
+ALPHA_TRUE
+X86_DARWIN_FALSE
+X86_DARWIN_TRUE
+X86_WIN64_FALSE
+X86_WIN64_TRUE
+X86_WIN32_FALSE
+X86_WIN32_TRUE
+X86_FREEBSD_FALSE
+X86_FREEBSD_TRUE
+X86_FALSE
+X86_TRUE
+SPARC_FALSE
+SPARC_TRUE
+MIPS_FALSE
+MIPS_TRUE
+AM_LTLDFLAGS
+AM_RUNTESTFLAGS
+TESTSUBDIR_FALSE
+TESTSUBDIR_TRUE
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
CPP
-CXX
-CXXFLAGS
-ac_ct_CXX
-CXXDEPMODE
-am__fastdepCXX_TRUE
-am__fastdepCXX_FALSE
-CXXCPP
-F77
-FFLAGS
-ac_ct_F77
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+lt_ECHO
+RANLIB
+AR
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
LIBTOOL
-MAINTAINER_MODE_TRUE
-MAINTAINER_MODE_FALSE
-MAINT
-TESTSUBDIR_TRUE
-TESTSUBDIR_FALSE
-AM_RUNTESTFLAGS
-MIPS_TRUE
-MIPS_FALSE
-SPARC_TRUE
-SPARC_FALSE
-X86_TRUE
-X86_FALSE
-X86_FREEBSD_TRUE
-X86_FREEBSD_FALSE
-X86_WIN32_TRUE
-X86_WIN32_FALSE
-X86_DARWIN_TRUE
-X86_DARWIN_FALSE
-ALPHA_TRUE
-ALPHA_FALSE
-IA64_TRUE
-IA64_FALSE
-M32R_TRUE
-M32R_FALSE
-M68K_TRUE
-M68K_FALSE
-POWERPC_TRUE
-POWERPC_FALSE
-POWERPC_AIX_TRUE
-POWERPC_AIX_FALSE
-POWERPC_DARWIN_TRUE
-POWERPC_DARWIN_FALSE
-POWERPC_FREEBSD_TRUE
-POWERPC_FREEBSD_FALSE
-ARM_TRUE
-ARM_FALSE
-LIBFFI_CRIS_TRUE
-LIBFFI_CRIS_FALSE
-FRV_TRUE
-FRV_FALSE
-S390_TRUE
-S390_FALSE
-X86_64_TRUE
-X86_64_FALSE
-SH_TRUE
-SH_FALSE
-SH64_TRUE
-SH64_FALSE
-PA_LINUX_TRUE
-PA_LINUX_FALSE
-PA_HPUX_TRUE
-PA_HPUX_FALSE
-PA64_HPUX_TRUE
-PA64_HPUX_FALSE
-ALLOCA
-HAVE_LONG_DOUBLE
-TARGET
-TARGETDIR
-toolexecdir
-toolexeclibdir
-LIBOBJS
-LTLIBOBJS'
+am__fastdepCCAS_FALSE
+am__fastdepCCAS_TRUE
+CCASDEPMODE
+CCASFLAGS
+CCAS
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+enable_maintainer_mode
+enable_debug
+enable_structs
+enable_raw_api
+enable_purify_safety
+'
ac_precious_vars='build_alias
host_alias
target_alias
CCAS
CCASFLAGS
CPP
-CPPFLAGS
-CXX
-CXXFLAGS
-LDFLAGS
-LIBS
-CCC
-CXXCPP
-F77
-FFLAGS'
+CPPFLAGS'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
@@ -1060,13 +1053,20 @@ do
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
@@ -1079,13 +1079,20 @@ do
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1276,22 +1283,36 @@ do
ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
@@ -1311,25 +1332,25 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
+ -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+ esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
@@ -1338,23 +1359,36 @@ done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
fi
-# Be sure to have absolute directory names.
+# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
do
eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1368,7 +1402,7 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used." >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
@@ -1384,23 +1418,21 @@ test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error "pwd does not report name of working directory"
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -1427,13 +1459,11 @@ else
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1459,7 +1489,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libffi 3.0.5 to adapt to many kinds of systems.
+\`configure' configures libffi 3.0.10rc0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1481,9 +1511,9 @@ Configuration:
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
@@ -1493,25 +1523,25 @@ for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/libffi]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/libffi]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
@@ -1530,11 +1560,12 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libffi 3.0.5:";;
+ short | recursive ) echo "Configuration of libffi 3.0.10rc0:";;
esac
cat <<\_ACEOF
Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
@@ -1554,10 +1585,9 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-pic try to use only PIC/non-PIC objects [default=use
both]
- --with-tags[=TAGS] include additional configurations [automatic]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
Some influential environment variables:
CC C compiler command
@@ -1565,16 +1595,11 @@ Some influential environment variables:
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CCAS assembler compiler command (defaults to CC)
CCASFLAGS assembler compiler flags (defaults to CFLAGS)
CPP C preprocessor
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- CXXCPP C++ preprocessor
- F77 Fortran 77 compiler command
- FFLAGS Fortran 77 compiler flags
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1587,15 +1612,17 @@ fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1631,7 +1658,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
@@ -1640,22 +1667,557 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libffi configure 3.0.5
-generated by GNU Autoconf 2.61
+libffi configure 3.0.10rc0
+generated by GNU Autoconf 2.65
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( cat <<\_ASBOX
+## ------------------------------------------- ##
+## Report this to http://gcc.gnu.org/bugs.html ##
+## ------------------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libffi $as_me 3.0.5, which was
-generated by GNU Autoconf 2.61. Invocation command line was
+It was created by libffi $as_me 3.0.10rc0, which was
+generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
@@ -1691,8 +2253,8 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
+ $as_echo "PATH: $as_dir"
+ done
IFS=$as_save_IFS
} >&5
@@ -1726,12 +2288,12 @@ do
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
@@ -1747,13 +2309,13 @@ do
-* ) ac_must_keep_next=true ;;
esac
fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
+ as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
@@ -1778,12 +2340,13 @@ _ASBOX
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
@@ -1812,9 +2375,9 @@ _ASBOX
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- echo "$ac_var='\''$ac_val'\''"
+ $as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
@@ -1829,9 +2392,9 @@ _ASBOX
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- echo "$ac_var='\''$ac_val'\''"
+ $as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
@@ -1847,83 +2410,88 @@ _ASBOX
echo
fi
test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
+$as_echo "/* confdefs.h */" > confdefs.h
+
# Predefined preprocessor variables.
cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
+ ac_site_file1=$CONFIG_SITE
elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
fi
-shift
-for ac_site_file
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
@@ -1937,68 +2505,56 @@ for ac_var in $ac_precious_vars; do
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -2012,24 +2568,16 @@ ac_config_headers="$ac_config_headers fficonfig.h"
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
+ for ac_t in install-sh install.sh shtool; do
+ if test -f "$ac_dir/$ac_t"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/$ac_t -c"
+ break 2
+ fi
+ done
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
@@ -2043,35 +2591,27 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
- { (exit 1); exit 1; }; };;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
@@ -2087,28 +2627,24 @@ IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
- { (exit 1); exit 1; }; };;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
@@ -2124,28 +2660,24 @@ IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-{ echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
-if test "${ac_cv_target+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test "x$target_alias" = x; then
ac_cv_target=$ac_cv_host
else
ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
case $ac_cv_target in
*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
-echo "$as_me: error: invalid value of canonical target" >&2;}
- { (exit 1); exit 1; }; };;
+*) as_fn_error "invalid value of canonical target" "$LINENO" 5;;
esac
target=$ac_cv_target
ac_save_IFS=$IFS; IFS='-'
@@ -2167,11 +2699,12 @@ test -n "$target_alias" &&
test "$program_prefix$program_suffix$program_transform_name" = \
NONENONEs,x,x, &&
program_prefix=${target_alias}-
+
target_alias=${target_alias-$host_alias}
. ${srcdir}/configure.host
-am__api_version='1.10'
+am__api_version='1.11'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -2186,22 +2719,23 @@ am__api_version='1.10'
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test "${ac_cv_path_install+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
@@ -2219,17 +2753,29 @@ case $as_dir/ in
# program-specific install script used by HP pwplus--don't use.
:
else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
fi
fi
done
done
;;
esac
-done
+
+ done
IFS=$as_save_IFS
+rm -rf conftest.one conftest.two conftest.dir
fi
if test "${ac_cv_path_install+set}" = set; then
@@ -2242,8 +2788,8 @@ fi
INSTALL=$ac_install_sh
fi
fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -2253,21 +2799,34 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
# Just in case
sleep 1
echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
+ set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$*" != "X $srcdir/configure conftest.file" \
@@ -2277,11 +2836,8 @@ if (
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
fi
test "$2" = conftest.file
@@ -2290,52 +2846,162 @@ then
# Ok.
:
else
- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
test "$program_prefix" != NONE &&
program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $. echo might interpret backslashes.
+# Double any \ or $.
# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm -f conftest.sed
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
- if test "${ac_cv_path_mkdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test "${ac_cv_path_mkdir+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
+ for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
{ test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
@@ -2347,11 +3013,12 @@ do
esac
done
done
-done
+ done
IFS=$as_save_IFS
fi
+ test -d ./--version && rmdir ./--version
if test "${ac_cv_path_mkdir+set}" = set; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
@@ -2359,12 +3026,11 @@ fi
# value for MKDIR_P within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
- test -d ./--version && rmdir ./--version
MKDIR_P="$ac_install_sh -d"
fi
fi
-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
-echo "${ECHO_T}$MKDIR_P" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
mkdir_p="$MKDIR_P"
case $mkdir_p in
@@ -2376,10 +3042,10 @@ for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -2389,36 +3055,37 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
test -n "$AWK" && break
done
-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
@@ -2435,12 +3102,12 @@ esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
SET_MAKE=
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -2459,9 +3126,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then
am__isrc=' -I$(srcdir)'
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
fi
fi
@@ -2477,7 +3142,7 @@ fi
# Define the identity of the package.
PACKAGE='libffi'
- VERSION='3.0.5'
+ VERSION='3.0.10rc0'
cat >>confdefs.h <<_ACEOF
@@ -2505,112 +3170,6 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# Always define AMTAR for backward compatibility.
@@ -2639,10 +3198,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2652,25 +3211,25 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2679,10 +3238,10 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2692,25 +3251,25 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
@@ -2718,12 +3277,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -2736,10 +3291,10 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2749,25 +3304,25 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2776,10 +3331,10 @@ fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2790,18 +3345,18 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
@@ -2820,11 +3375,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2835,10 +3390,10 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2848,25 +3403,25 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2879,10 +3434,10 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2892,25 +3447,25 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2922,12 +3477,8 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -2937,51 +3488,37 @@ fi
fi
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -2993,42 +3530,38 @@ main ()
}
_ACEOF
ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
rm -f $ac_rmfiles
-if { (ac_try="$ac_link_default"
+if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
@@ -3038,14 +3571,14 @@ for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
@@ -3064,78 +3597,42 @@ test "$ac_cv_exeext" = no && ac_cv_exeext=
else
ac_file=''
fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -3143,37 +3640,90 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3185,51 +3735,46 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
+if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
fi
-
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3243,54 +3788,34 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
+ ac_compiler_gnu=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3301,34 +3826,11 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3339,35 +3841,12 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_compile "$LINENO"; then :
- ac_c_werror_flag=$ac_save_c_werror_flag
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3378,42 +3857,18 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
@@ -3429,18 +3884,14 @@ else
CFLAGS=
fi
fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
@@ -3497,31 +3948,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
rm -f core conftest.err conftest.$ac_objext
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
@@ -3532,17 +3961,19 @@ fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -3557,44 +3988,44 @@ ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
- @echo done
+ @echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
fi
-{ echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
rm -f confinc confmf
# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
+if test "${enable_dependency_tracking+set}" = set; then :
enableval=$enable_dependency_tracking;
fi
@@ -3614,10 +4045,10 @@ fi
depcc="$CC" am_compiler_list=
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
@@ -3642,6 +4073,11 @@ else
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
@@ -3659,7 +4095,17 @@ else
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
@@ -3669,19 +4115,23 @@ else
break
fi
;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
none) break ;;
esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
@@ -3705,8 +4155,8 @@ else
fi
fi
-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
if
@@ -3724,6 +4174,7 @@ fi
+
# By default we simply use the C compiler to build assembly code.
test "${CCAS+set}" = set || CCAS=$CC
@@ -3733,10 +4184,10 @@ test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
depcc="$CCAS" am_compiler_list=
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
@@ -3761,6 +4212,9 @@ else
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
+ am__universal=false
+
+
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
@@ -3778,7 +4232,17 @@ else
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
@@ -3788,19 +4252,23 @@ else
break
fi
;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
none) break ;;
esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
@@ -3824,8 +4292,8 @@ else
fi
fi
-{ echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CCAS_dependencies_compiler_type" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
if
@@ -3840,22 +4308,18 @@ fi
if test "x$CC" != xcc; then
- { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
-echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
else
- { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
-echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
fi
-set dummy $CC; ac_cc=`echo $2 |
+set dummy $CC; ac_cc=`$as_echo "$2" |
sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3871,58 +4335,63 @@ _ACEOF
# existing .o file with -o, though they will create one.
ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
-if { (case "(($ac_try" in
+if { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- test -f conftest2.$ac_objext && { (case "(($ac_try" in
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); };
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
if test "x$CC" != xcc; then
# Test first that cc exists at all.
if { ac_try='cc -c conftest.$ac_ext >&5'
- { (case "(($ac_try" in
+ { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
- if { (case "(($ac_try" in
+ if { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- test -f conftest2.$ac_objext && { (case "(($ac_try" in
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); };
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
then
# cc works too.
:
@@ -3939,23 +4408,22 @@ rm -f core conftest*
fi
if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
-cat >>confdefs.h <<\_ACEOF
-#define NO_MINUS_C_MINUS_O 1
-_ACEOF
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
fi
# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
-ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
@@ -3965,176 +4433,147 @@ if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
fi
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_shared=yes
-fi
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_static=yes
-fi
+macro_version='2.2.6'
+macro_revision='1.3012'
-# Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
-if test "${lt_cv_path_SED+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
+ for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
done
done
-done
+ done
IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5
fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
+else
+ ac_cv_path_SED=$SED
+fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
-SED=$lt_cv_path_SED
-{ echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6; }
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
+ if test -z "$GREP"; then
ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
- # Check for GNU ac_path_GREP and select it if it is found.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ $as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- echo 'GREP' >> "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
@@ -4146,77 +4585,61 @@ case `"$ac_path_GREP" --version 2>&1` in
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
-
- $ac_path_GREP_found && break 3
+ $ac_path_GREP_found && break 3
+ done
+ done
done
-done
-
-done
IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
else
ac_cv_path_GREP=$GREP
fi
-
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+ if test -z "$EGREP"; then
ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
- # Check for GNU ac_path_EGREP and select it if it is found.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ $as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- echo 'EGREP' >> "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_EGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP="$ac_path_EGREP"
@@ -4228,39 +4651,114 @@ case `"$ac_path_EGREP" --version 2>&1` in
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
-
- $ac_path_EGREP_found && break 3
+ $ac_path_EGREP_found && break 3
+ done
+ done
done
-done
-
-done
IFS=$as_save_IFS
-
-
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
fi
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
+ fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- ac_cv_path_EGREP=$EGREP
-fi
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
+if test "${with_gnu_ld+set}" = set; then :
withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
else
with_gnu_ld=no
@@ -4269,8 +4767,8 @@ fi
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -4283,9 +4781,9 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
[\\/]* | ?:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
# Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
@@ -4299,14 +4797,14 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
;;
esac
elif test "$with_gnu_ld" = yes; then
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test "${lt_cv_path_LD+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -z "$LD"; then
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
@@ -4336,19 +4834,17 @@ fi
LD="$lt_cv_path_LD"
if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in
@@ -4360,40 +4856,22 @@ case `$LD -v 2>&1 </dev/null` in
;;
esac
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
with_gnu_ld=$lt_cv_prog_gnu_ld
-{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_ld_reload_flag='-r'
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
-if test "${lt_cv_path_NM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$NM"; then
# Let the user override the test.
@@ -4436,28 +4914,493 @@ else
done
IFS="$lt_save_ifs"
done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
fi
+
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:5045: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:5048: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:5051: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6; }
-NM="$lt_cv_path_NM"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
else
- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
fi
-{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
-echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
@@ -4474,7 +5417,7 @@ lt_cv_deplibs_check_method='unknown'
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
-aix4* | aix5*)
+aix[4-9]*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -4507,12 +5450,18 @@ mingw* | pw32*)
fi
;;
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
@@ -4570,7 +5519,7 @@ linux* | k*bsd*-gnu)
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
@@ -4583,12 +5532,12 @@ newos6*)
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
;;
openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -4607,6 +5556,10 @@ solaris*)
lt_cv_deplibs_check_method=pass_all
;;
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
sysv4 | sysv4.3*)
case $host_vendor in
motorola)
@@ -4634,14 +5587,14 @@ sysv4 | sysv4.3*)
esac
;;
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+tpf*)
lt_cv_deplibs_check_method=pass_all
;;
esac
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -4649,6 +5602,367 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
@@ -4659,8 +5973,258 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
compiler=$CC
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
+if test "${enable_libtool_lock+set}" = set; then :
enableval=$enable_libtool_lock;
fi
@@ -4672,108 +6236,107 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
esac
fi
rm -rf conftest*
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4693 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ echo '#line 6257 "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
fi
rm -rf conftest*
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|sparc*-*linux*)
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- libsuff=64
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
esac
fi
rm -rf conftest*
@@ -4783,10 +6346,10 @@ s390*-*linux*|sparc*-*linux*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
- { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -4794,11 +6357,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -4809,34 +6368,13 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
lt_cv_cc_needs_belf=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- lt_cv_cc_needs_belf=no
+ lt_cv_cc_needs_belf=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4844,8 +6382,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
@@ -4854,43 +6392,629 @@ echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
sparc*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
esac
;;
esac
fi
rm -rf conftest*
;;
+esac
+
+need_locks="$enable_libtool_lock"
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
-need_locks="$enable_libtool_lock"
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test "${ac_cv_prog_CPP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -4904,11 +7028,7 @@ do
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
@@ -4917,76 +7037,34 @@ cat >>conftest.$ac_ext <<_ACEOF
#endif
Syntax error
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
+else
# Broken: fails on valid input.
continue
fi
-
rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
# Passes both tests.
ac_preproc_ok=:
break
fi
-
rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+if $ac_preproc_ok; then :
break
fi
@@ -4998,8 +7076,8 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
@@ -5009,11 +7087,7 @@ do
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
@@ -5022,83 +7096,40 @@ cat >>conftest.$ac_ext <<_ACEOF
#endif
Syntax error
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
+else
# Broken: fails on valid input.
continue
fi
-
rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
# Passes both tests.
ac_preproc_ok=:
break
fi
-
rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
+if $ac_preproc_ok; then :
+
else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
fi
ac_ext=c
@@ -5108,16 +7139,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
@@ -5132,47 +7159,23 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_header_stdc=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
+ ac_cv_header_stdc=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <string.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
else
ac_cv_header_stdc=no
fi
@@ -5182,18 +7185,14 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
+ $EGREP "free" >/dev/null 2>&1; then :
+
else
ac_cv_header_stdc=no
fi
@@ -5203,14 +7202,10 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then :
:
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ctype.h>
#include <stdlib.h>
@@ -5237,113 +7232,36 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_run "$LINENO"; then :
-( exit $ac_status )
-ac_cv_header_stdc=no
+else
+ ac_cv_header_stdc=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
fi
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -5351,1476 +7269,230 @@ fi
done
-
for ac_header in dlfcn.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------------------- ##
-## Report this to http://gcc.gnu.org/bugs.html ##
-## ------------------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_DLFCN_H 1
_ACEOF
fi
done
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+# Set options
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+ enable_dlopen=no
- test -n "$ac_ct_CXX" && break
-done
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CXX=$ac_ct_CXX
- fi
-fi
+ enable_win32_dll=no
- fi
-fi
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
+ enable_shared=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
-GXX=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cxx_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- CXXFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cxx_g=yes
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+ enable_static=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-depcc="$CXX" am_compiler_list=
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
- am_cv_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
-fi
-fi
-{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; pic_mode="$withval"
else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
+ pic_mode=default
fi
+test -z "$pic_mode" && pic_mode=default
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
-if test -z "$CXXCPP"; then
- if test "${ac_cv_prog_CXXCPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
else
- ac_cv_prog_CXXCPP=$CXXCPP
+ enable_fast_install=yes
fi
-{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-fi
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$F77"; then
- ac_cv_prog_F77="$F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-fi
-fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
- { echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
- test -n "$F77" && break
- done
-fi
-if test -z "$F77"; then
- ac_ct_F77=$F77
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_F77"; then
- ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_F77="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-fi
-fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
- { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
- test -n "$ac_ct_F77" && break
-done
- if test "x$ac_ct_F77" = x; then
- F77=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- F77=$ac_ct_F77
- fi
-fi
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-rm -f a.out
-
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
- program main
-#ifndef __GNUC__
- choke me
-#endif
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_f77_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
- program main
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_f77_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_prog_f77_g=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
- FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-g -O2"
- else
- FFLAGS="-g"
- fi
-else
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-O2"
- else
- FFLAGS=
- fi
-fi
-G77=`test $ac_compiler_gnu = yes && echo yes`
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-# find the maximum length of command line arguments
-{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- i=0
- teststring="ABCD"
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
- cygwin* | mingw*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
+test -z "$LN_S" && LN_S="ln -s"
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-fi
-if test -n $lt_cv_sys_max_cmd_len ; then
- { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
-else
- { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
-fi
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[ABCDEGRST]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux* | k*bsd*-gnu)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDGIRSTW]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
- ;;
-irix* | nonstopux*)
- symcode='[BCDEGRST]'
- ;;
-osf*)
- symcode='[BCDEGQRST]'
- ;;
-solaris*)
- symcode='[BDRT]'
- ;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
-sysv4)
- symcode='[DFNSTU]'
- ;;
-esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
- # Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
- # Check to see that the pipe works correctly.
- pipe_works=no
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
- (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&5
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
-else
- { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
-fi
-{ echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
-if test "${lt_cv_objdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
@@ -6840,360 +7512,41 @@ esac
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
# Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'
-# Constants:
-rm="rm -f"
-
# Global variables:
-default_ofile=libtool
+ofile=libtool
can_build_shared=yes
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-else
- AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
+with_gnu_ld="$lt_cv_prog_gnu_ld"
old_CC="$CC"
old_CFLAGS="$CFLAGS"
# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
for cc_temp in $compiler""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
@@ -7202,17 +7555,18 @@ for cc_temp in $compiler""; do
*) break;;
esac
done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
@@ -7236,7 +7590,7 @@ else
$EGREP "$file_magic_regex" > /dev/null; then
:
else
- cat <<EOF 1>&2
+ cat <<_LT_EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -7247,7 +7601,7 @@ else
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
-EOF
+_LT_EOF
fi ;;
esac
fi
@@ -7262,19 +7616,23 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+
+
+
+
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
- { echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
@@ -7298,7 +7656,7 @@ else
$EGREP "$file_magic_regex" > /dev/null; then
:
else
- cat <<EOF 1>&2
+ cat <<_LT_EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -7309,7 +7667,7 @@ else
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
-EOF
+_LT_EOF
fi ;;
esac
fi
@@ -7324,13 +7682,14 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+
else
MAGIC_CMD=:
fi
@@ -7340,28 +7699,8 @@ fi
;;
esac
-enable_dlopen=no
-enable_win32_dll=no
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then
- withval=$with_pic; pic_mode="$withval"
-else
- pic_mode=default
-fi
-
-test -z "$pic_mode" && pic_mode=default
-
# Use C for the default configuration in the libtool script
-tagname=
+
lt_save_CC="$CC"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7384,6 +7723,11 @@ lt_simple_compile_test_code="int some_variable = 0;"
lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
@@ -7393,35 +7737,42 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
compiler=$CC
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM conftest*
ac_outfile=conftest.$ac_objext
echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM -r conftest*
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
lt_prog_compiler_no_builtin_flag=
if test "$GCC" = yes; then
lt_prog_compiler_no_builtin_flag=' -fno-builtin'
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
+ ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -7433,25 +7784,25 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7436: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7787: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7440: \$? = $ac_status" >&5
+ echo "$as_me:7791: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_rtti_exceptions=yes
fi
fi
- $rm conftest*
+ $RM conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
@@ -7461,12 +7812,17 @@ fi
fi
-lt_prog_compiler_wl=
+
+
+
+
+
+ lt_prog_compiler_wl=
lt_prog_compiler_pic=
lt_prog_compiler_static=
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
if test "$GCC" = yes; then
lt_prog_compiler_wl='-Wl,'
@@ -7482,17 +7838,25 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
;;
amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
;;
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -7506,6 +7870,20 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
lt_prog_compiler_pic='-fno-common'
;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
@@ -7518,25 +7896,18 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
enable_shared=no
;;
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
sysv4*MP*)
if test -d /usr/nec; then
lt_prog_compiler_pic=-Kconform_pic
fi
;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
*)
lt_prog_compiler_pic='-fPIC'
;;
@@ -7553,18 +7924,8 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
fi
;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic='-qnocommon'
- lt_prog_compiler_wl='-Wl,'
- ;;
- esac
- ;;
- mingw* | cygwin* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -7592,18 +7953,27 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
lt_prog_compiler_static='-non_shared'
;;
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
linux* | k*bsd*-gnu)
case $cc_basename in
- icc* | ecc*)
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
pgcc* | pgf77* | pgf90* | pgf95*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
@@ -7616,8 +7986,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
# All Alpha code is PIC.
lt_prog_compiler_static='-non_shared'
;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C 5.9
lt_prog_compiler_pic='-KPIC'
@@ -7635,6 +8011,17 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
esac
;;
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
osf3* | osf4* | osf5*)
lt_prog_compiler_wl='-Wl,'
# All OSF/1 code is PIC.
@@ -7697,21 +8084,34 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
esac
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- lt_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -7723,27 +8123,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7726: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8126: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7730: \$? = $ac_status" >&5
+ echo "$as_me:8130: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works=yes
+ lt_cv_prog_compiler_pic_works=yes
fi
fi
- $rm conftest*
+ $RM conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-if test x"$lt_prog_compiler_pic_works" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -7754,26 +8154,22 @@ else
fi
fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
+
+
+
+
+
#
# Check to make sure the static flag actually works.
#
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- lt_prog_compiler_static_works=no
+ lt_cv_prog_compiler_static_works=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
@@ -7783,36 +8179,41 @@ else
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
else
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
fi
- $rm conftest*
+ $RM -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-if test x"$lt_prog_compiler_static_works" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
:
else
lt_prog_compiler_static=
fi
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_c_o=no
- $rm -r conftest 2>/dev/null
+ $RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
@@ -7827,83 +8228,148 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7830: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8231: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7834: \$? = $ac_status" >&5
+ echo "$as_me:8235: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
fi
fi
chmod u+w . 2>&5
- $rm conftest*
+ $RM conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
cd ..
- rmdir conftest
- $rm conftest*
+ $RM -r conftest
+ $RM conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:8286: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:8290: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
hard_links="nottested"
if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
# do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
hard_links=yes
- $rm conftest*
+ $RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
need_locks=no
fi
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
runpath_var=
allow_undefined_flag=
- enable_shared_with_static_runtimes=no
+ always_export_symbols=no
archive_cmds=
archive_expsym_cmds=
- old_archive_From_new_cmds=
- old_archive_from_expsyms_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
export_dynamic_flag_spec=
- whole_archive_flag_spec=
- thread_safe_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
hardcode_libdir_flag_spec=
hardcode_libdir_flag_spec_ld=
hardcode_libdir_separator=
- hardcode_direct=no
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
link_all_deplibs=unknown
- hardcode_automatic=no
module_cmds=
module_expsym_cmds=
- always_export_symbols=no
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
@@ -7911,26 +8377,17 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
case $host_os in
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -7956,16 +8413,16 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
export_dynamic_flag_spec='${wl}--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec=
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
fi
supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
+ case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -7975,11 +8432,11 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
- cat <<EOF 1>&2
+ cat <<_LT_EOF 1>&2
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
@@ -7987,26 +8444,27 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
*** really care for shared libraries, you may want to modify your PATH
*** so that a non-GNU linker is found, and then restart.
-EOF
+_LT_EOF
fi
;;
amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs=no
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
allow_undefined_flag=unsupported
# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
@@ -8016,16 +8474,16 @@ EOF
fi
;;
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
@@ -8056,48 +8514,78 @@ EOF
archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
tmp_addflag=
+ tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
tmp_addflag=' -i_dynamic -nofor_main' ;;
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
esac
archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
else
- ld_shlibs=no
+ ld_shlibs=no
fi
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
@@ -8107,9 +8595,9 @@ EOF
;;
solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
- cat <<EOF 1>&2
+ cat <<_LT_EOF 1>&2
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
@@ -8118,8 +8606,8 @@ EOF
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
@@ -8143,10 +8631,14 @@ EOF
_LT_EOF
;;
*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -8162,7 +8654,7 @@ _LT_EOF
;;
*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
@@ -8194,7 +8686,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -8204,22 +8696,22 @@ _LT_EOF
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
done
;;
esac
@@ -8236,28 +8728,30 @@ _LT_EOF
archive_cmds=''
hardcode_direct=yes
+ hardcode_direct_absolute=yes
hardcode_libdir_separator=':'
link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
- # We have reworked collect2
- :
+ # We have reworked collect2
+ :
else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
fi
;;
esac
@@ -8268,8 +8762,8 @@ _LT_EOF
else
# not using gcc
if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
if test "$aix_use_runtimelinking" = yes; then
@@ -8280,6 +8774,7 @@ _LT_EOF
fi
fi
+ export_dynamic_flag_spec='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
always_export_symbols=yes
@@ -8287,12 +8782,9 @@ _LT_EOF
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -8303,24 +8795,7 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -8334,31 +8809,22 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpat
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -8369,24 +8835,7 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -8400,15 +8849,9 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpat
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
@@ -8426,18 +8869,25 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
bsdi[45]*)
export_dynamic_flag_spec=-rdynamic
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -8449,9 +8899,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds='true'
+ old_archive_from_new_cmds='true'
# FIXME: Should let the user specify the lib program.
old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path='`cygpath -w "$srcfile"`'
@@ -8459,53 +8909,30 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- whole_archive_flag_spec=''
- link_all_deplibs=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
- fi
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec=''
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
;;
dgux*)
@@ -8547,9 +8974,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hpux9*)
if test "$GCC" = yes; then
- archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
- archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
@@ -8569,11 +8996,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
hardcode_libdir_separator=:
-
hardcode_direct=yes
+ hardcode_direct_absolute=yes
export_dynamic_flag_spec='${wl}-E'
-
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
@@ -8587,7 +9014,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
@@ -8612,12 +9039,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_cpu in
hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld='+b $libdir'
hardcode_direct=no
hardcode_shlibpath_var=no
;;
*)
hardcode_direct=yes
+ hardcode_direct_absolute=yes
export_dynamic_flag_spec='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
@@ -8630,18 +9057,36 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo(void) {}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
else
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
fi
+ archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
+ inherit_rpath=yes
link_all_deplibs=yes
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
@@ -8659,11 +9104,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_shlibpath_var=no
;;
+ *nto* | *qnx*)
+ ;;
+
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
hardcode_shlibpath_var=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@@ -8679,7 +9128,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
- fi
+ fi
else
ld_shlibs=no
fi
@@ -8689,18 +9138,19 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
fi
+ archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
@@ -8708,32 +9158,43 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
+ archive_cmds_need_lc='no'
hardcode_libdir_separator=:
;;
solaris*)
- no_undefined_flag=' -z text'
+ no_undefined_flag=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
- archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
- wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
@@ -8743,7 +9204,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The compiler driver will combine and reorder linker options,
# but understands `-z linker_flag'. GCC discards it without `$wl',
# but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
if test "$GCC" = yes; then
whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
else
@@ -8832,18 +9293,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
allow_undefined_flag='${wl}-z,nodefs'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
hardcode_libdir_separator=':'
link_all_deplibs=yes
export_dynamic_flag_spec='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
@@ -8857,12 +9318,36 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
ld_shlibs=no
;;
esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
fi
-{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
test "$ld_shlibs" = no && can_build_shared=no
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#
# Do we need to explicitly link libc?
#
@@ -8880,16 +9365,16 @@ x|xyes)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
soname=conftest
lib=conftest
libobjs=conftest.$ac_objext
@@ -8903,11 +9388,11 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
libname=conftest
lt_save_allow_undefined_flag=$allow_undefined_flag
allow_undefined_flag=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
then
archive_cmds_need_lc=no
else
@@ -8917,30 +9402,173 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
else
cat conftest.err 1>&5
fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
+ $RM conftest*
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
+$as_echo "$archive_cmds_need_lc" >&6; }
;;
esac
fi
;;
esac
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
if test "$GCC" = yes; then
case $host_os in
@@ -8948,14 +9576,14 @@ if test "$GCC" = yes; then
*) lt_awk_arg="/^libraries:/" ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
else
- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
@@ -8969,7 +9597,7 @@ if test "$GCC" = yes; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
fi
done
- lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
BEGIN {RS=" "; FS="/|\n";} {
lt_foo="";
lt_count=0;
@@ -8989,10 +9617,23 @@ BEGIN {RS=" "; FS="/|\n";} {
if (lt_foo != "") { lt_freq[lt_foo]++; }
if (lt_freq[lt_foo] == 1) { print lt_foo; }
}'`
- sys_lib_search_path_spec=`echo $lt_search_path_spec`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -9010,7 +9651,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -9029,7 +9670,7 @@ aix4* | aix5*)
aix4 | aix4.[01] | aix4.[01].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
@@ -9055,9 +9696,18 @@ aix4* | aix5*)
;;
amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
;;
beos*)
@@ -9080,25 +9730,28 @@ bsdi[45]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
shrext_cmds=".dll"
need_version=no
need_lib_prefix=no
case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
- $rm \$dlpath'
+ $RM \$dlpath'
shlibpath_overrides_runpath=yes
case $host_os in
@@ -9107,20 +9760,20 @@ cygwin* | mingw* | pw32*)
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
;;
- mingw*)
+ mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
# It is most probably a Windows format PATH printed by
# mingw gcc, but we are running on Cygwin. Gcc prints its search
# path with ; separators, and with drive letters. We can handle the
# drive letters (cygwin fileutils understands them), so leave them,
# especially as we might pass files found there to a mingw objdump,
# which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
;;
pw32*)
@@ -9144,7 +9797,7 @@ darwin* | rhapsody*)
version_type=darwin
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
@@ -9243,18 +9896,18 @@ hpux9* | hpux10* | hpux11*)
fi
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
shrext_cmds='.sl'
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
@@ -9331,16 +9984,43 @@ linux* | k*bsd*-gnu)
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fi
@@ -9357,7 +10037,7 @@ netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
@@ -9378,14 +10058,16 @@ newsos6)
shlibpath_overrides_runpath=yes
;;
-nto-qnx*)
- version_type=linux
+*nto* | *qnx*)
+ version_type=qnx
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
;;
openbsd*)
@@ -9394,13 +10076,13 @@ openbsd*)
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
openbsd2.[89] | openbsd2.[89].*)
shlibpath_overrides_runpath=no
@@ -9472,7 +10154,6 @@ sysv4 | sysv4.3*)
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
runpath_var=LD_RUN_PATH
;;
siemens)
@@ -9503,13 +10184,12 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
if test "$with_gnu_ld" = yes; then
sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
case $host_os in
sco3.2v5*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
@@ -9519,6 +10199,17 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
sys_lib_dlsearch_path_spec='/usr/lib'
;;
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -9530,8 +10221,8 @@ uts4*)
dynamic_linker=no
;;
esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
test "$dynamic_linker" = no && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
@@ -9539,11 +10230,104 @@ if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
- test -n "$runpath_var" || \
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
test "X$hardcode_automatic" = "Xyes" ; then
# We can hardcode non-existent directories.
@@ -9551,7 +10335,7 @@ if test -n "$hardcode_libdir_flag_spec" || \
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
test "$hardcode_minus_L" != no; then
# Linking always hardcodes the temporary library directory.
hardcode_action=relink
@@ -9564,10 +10348,11 @@ else
# directories.
hardcode_action=unsupported
fi
-{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
-if test "$hardcode_action" = relink; then
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
@@ -9576,37 +10361,12 @@ elif test "$shlibpath_overrides_runpath" = yes ||
enable_fast_install=needless
fi
-striplib=
-old_striplib=
-{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
- ;;
- *)
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- ;;
- esac
-fi
-if test "x$enable_dlopen" != xyes; then
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
@@ -9621,30 +10381,26 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32*)
+ mingw* | pw32* | cegcc*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
- ;;
+ ;;
cygwin*)
lt_cv_dlopen="dlopen"
lt_cv_dlopen_libs=
- ;;
+ ;;
darwin*)
# if libdl is installed we need to link against it
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -9662,39 +10418,18 @@ return dlopen ();
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_dlopen=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dl_dlopen=no
+ ac_cv_lib_dl_dlopen=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
@@ -9704,105 +10439,21 @@ else
fi
- ;;
+ ;;
*)
- { echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
-if test "${ac_cv_func_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char shl_load (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shl_load
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_shl_load || defined __stub___shl_load
-choke me
-#endif
-
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
-if test $ac_cv_func_shl_load = yes; then
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = x""yes; then :
lt_cv_dlopen="shl_load"
else
- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -9820,137 +10471,32 @@ return shl_load ();
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dld_shl_load=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_shl_load=no
+ ac_cv_lib_dld_shl_load=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
- { echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
-if test "${ac_cv_func_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define dlopen innocuous_dlopen
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dlopen (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef dlopen
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_dlopen || defined __stub___dlopen
-choke me
-#endif
-
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_dlopen=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
-if test $ac_cv_func_dlopen = yes; then
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = x""yes; then :
lt_cv_dlopen="dlopen"
else
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -9968,53 +10514,28 @@ return dlopen ();
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_dlopen=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dl_dlopen=no
+ ac_cv_lib_dl_dlopen=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
- { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -10032,53 +10553,28 @@ return dlopen ();
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_svld_dlopen=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_svld_dlopen=no
+ ac_cv_lib_svld_dlopen=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
-if test $ac_cv_lib_svld_dlopen = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
- { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -10096,40 +10592,19 @@ return dld_link ();
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dld_dld_link=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_dld_link=no
+ ac_cv_lib_dld_dld_link=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
-if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
fi
@@ -10167,18 +10642,18 @@ fi
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
- { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
-if test "${lt_cv_dlopen_self+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 10181 "configure"
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 10656 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10219,10 +10694,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -10238,14 +10709,14 @@ int main ()
else
puts (dlerror ());
- exit (status);
+ return status;
}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -10262,23 +10733,23 @@ rm -fr conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
if test "x$lt_cv_dlopen_self" = xyes; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
-if test "${lt_cv_dlopen_self_static+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self_static=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 10281 "configure"
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 10752 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10319,10 +10790,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -10338,14 +10805,14 @@ int main ()
else
puts (dlerror ());
- exit (status);
+ return status;
}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -10362,8 +10829,8 @@ rm -fr conftest*
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
fi
CPPFLAGS="$save_CPPFLAGS"
@@ -10384,9263 +10851,103 @@ echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
fi
-# Report which library types will actually be built
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler \
- CC \
- LD \
- lt_prog_compiler_wl \
- lt_prog_compiler_pic \
- lt_prog_compiler_static \
- lt_prog_compiler_no_builtin_flag \
- export_dynamic_flag_spec \
- thread_safe_flag_spec \
- whole_archive_flag_spec \
- enable_shared_with_static_runtimes \
- old_archive_cmds \
- old_archive_from_new_cmds \
- predep_objects \
- postdep_objects \
- predeps \
- postdeps \
- compiler_lib_search_path \
- archive_cmds \
- archive_expsym_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- old_archive_from_expsyms_cmds \
- allow_undefined_flag \
- no_undefined_flag \
- export_symbols_cmds \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
- hardcode_automatic \
- module_cmds \
- module_expsym_cmds \
- lt_cv_prog_compiler_c_o \
- fix_srcfile_path \
- exclude_expsyms \
- include_expsyms; do
-
- case $var in
- old_archive_cmds | \
- old_archive_from_new_cmds | \
- archive_cmds | \
- archive_expsym_cmds | \
- module_cmds | \
- module_expsym_cmds | \
- old_archive_from_expsyms_cmds | \
- export_symbols_cmds | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- { echo "$as_me:$LINENO: creating $ofile" >&5
-echo "$as_me: creating $ofile" >&6;}
-
- cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# ### END LIBTOOL CONFIG
-
-__EOF__
-
-
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-
-# Check whether --with-tags was given.
-if test "${with_tags+set}" = set; then
- withval=$with_tags; tagnames="$withval"
-fi
-
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
- else
- { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
- "") ;;
- *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
-echo "$as_me: error: invalid tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-else
- lt_prog_compiler_no_builtin_flag_CXX=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
-else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_CXX=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-ld_shlibs_CXX=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_CXX=''
- hardcode_direct_CXX=yes
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct_CXX=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_CXX=yes
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- hardcode_libdir_separator_CXX=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_CXX=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_CXX='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_CXX=' ${wl}-bernotok'
- allow_undefined_flag_CXX=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX='$convenience'
- archive_cmds_need_lc_CXX=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_CXX=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=no
- enable_shared_with_static_runtimes_CXX=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_direct_CXX=no
- hardcode_automatic_CXX=yes
- hardcode_shlibpath_var_CXX=unsupported
- whole_archive_flag_spec_CXX=''
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_CXX=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- freebsd[12]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- ld_shlibs_CXX=no
- ;;
- freebsd-elf*)
- archive_cmds_need_lc_CXX=no
- ;;
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- ld_shlibs_CXX=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- export_dynamic_flag_spec_CXX='${wl}-E'
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- case $host_cpu in
- hppa*64*|ia64*) ;;
- *)
- export_dynamic_flag_spec_CXX='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- ;;
- *)
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- interix[3-9]*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- link_all_deplibs_CXX=yes
- ;;
- esac
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- ld_shlibs_CXX=no
- ;;
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' -expect_unresolved \*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- archive_cmds_need_lc_CXX=yes
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_shlibpath_var_CXX=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
- ;;
- esac
- link_all_deplibs_CXX=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_CXX='${wl}-z,text'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- no_undefined_flag_CXX='${wl}-z,text'
- allow_undefined_flag_CXX='${wl}-z,nodefs'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- export_dynamic_flag_spec_CXX='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-GCC_CXX="$GXX"
-LD_CXX="$LD"
-
-
-cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_path_CXX="${prev}${p}"
- else
- compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$postdeps_CXX"; then
- postdeps_CXX="${prev}${p}"
- else
- postdeps_CXX="${postdeps_CXX} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$predep_objects_CXX"; then
- predep_objects_CXX="$p"
- else
- predep_objects_CXX="$predep_objects_CXX $p"
- fi
- else
- if test -z "$postdep_objects_CXX"; then
- postdep_objects_CXX="$p"
- else
- postdep_objects_CXX="$postdep_objects_CXX $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix[3-9]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- predep_objects_CXX=
- postdep_objects_CXX=
- postdeps_CXX=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- #
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
- if test "$solaris_use_stlport4" != yes; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
-
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- fi
- ;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_CXX='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- lt_prog_compiler_pic_CXX=
- ;;
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_CXX=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- else
- lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_CXX='-qnocommon'
- lt_prog_compiler_wl_CXX='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- lt_prog_compiler_pic_CXX='+Z'
- fi
- ;;
- aCC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_CXX='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fpic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- lt_prog_compiler_pic_CXX='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- lt_prog_compiler_wl_CXX='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- lt_prog_compiler_pic_CXX='-pic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- lcc*)
- # Lucid
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- lt_prog_compiler_can_build_shared_CXX=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works_CXX=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12701: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:12705: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_CXX=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
- case $lt_prog_compiler_pic_CXX in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
- esac
-else
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_CXX=
- ;;
- *)
- lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_CXX=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_CXX=yes
- fi
- else
- lt_prog_compiler_static_works_CXX=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
- :
-else
- lt_prog_compiler_static_CXX=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12805: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:12809: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- export_symbols_cmds_CXX="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_CXX=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_CXX in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_CXX
- pic_flag=$lt_prog_compiler_pic_CXX
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
- allow_undefined_flag_CXX=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_CXX=no
- else
- archive_cmds_need_lc_CXX=yes
- fi
- allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[3-9]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
- test -n "$runpath_var_CXX" || \
- test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$hardcode_direct_CXX" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
- test "$hardcode_minus_L_CXX" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_CXX=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_CXX=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_CXX=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_CXX \
- CC_CXX \
- LD_CXX \
- lt_prog_compiler_wl_CXX \
- lt_prog_compiler_pic_CXX \
- lt_prog_compiler_static_CXX \
- lt_prog_compiler_no_builtin_flag_CXX \
- export_dynamic_flag_spec_CXX \
- thread_safe_flag_spec_CXX \
- whole_archive_flag_spec_CXX \
- enable_shared_with_static_runtimes_CXX \
- old_archive_cmds_CXX \
- old_archive_from_new_cmds_CXX \
- predep_objects_CXX \
- postdep_objects_CXX \
- predeps_CXX \
- postdeps_CXX \
- compiler_lib_search_path_CXX \
- archive_cmds_CXX \
- archive_expsym_cmds_CXX \
- postinstall_cmds_CXX \
- postuninstall_cmds_CXX \
- old_archive_from_expsyms_cmds_CXX \
- allow_undefined_flag_CXX \
- no_undefined_flag_CXX \
- export_symbols_cmds_CXX \
- hardcode_libdir_flag_spec_CXX \
- hardcode_libdir_flag_spec_ld_CXX \
- hardcode_libdir_separator_CXX \
- hardcode_automatic_CXX \
- module_cmds_CXX \
- module_expsym_cmds_CXX \
- lt_cv_prog_compiler_c_o_CXX \
- fix_srcfile_path_CXX \
- exclude_expsyms_CXX \
- include_expsyms_CXX; do
-
- case $var in
- old_archive_cmds_CXX | \
- old_archive_from_new_cmds_CXX | \
- archive_cmds_CXX | \
- archive_expsym_cmds_CXX | \
- module_cmds_CXX | \
- module_expsym_cmds_CXX | \
- old_archive_from_expsyms_cmds_CXX | \
- export_symbols_cmds_CXX | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
- program t
- end
-"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-GCC_F77="$G77"
-LD_F77="$LD"
-
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_static_F77='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_F77='-fno-common'
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_F77=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_F77=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_F77='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- else
- lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_F77='-qnocommon'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-fpic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- lt_prog_compiler_wl_F77=''
- ;;
- esac
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_F77='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_F77='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_F77='-Qoption ld '
- lt_prog_compiler_pic_F77='-PIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_F77='-Kconform_pic'
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_can_build_shared_F77=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_F77='-pic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_F77=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works_F77=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_F77"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14369: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:14373: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_F77=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
- case $lt_prog_compiler_pic_F77 in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
- esac
-else
- lt_prog_compiler_pic_F77=
- lt_prog_compiler_can_build_shared_F77=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_F77=
- ;;
- *)
- lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_F77=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_F77=yes
- fi
- else
- lt_prog_compiler_static_works_F77=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
- :
-else
- lt_prog_compiler_static_F77=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_F77=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14473: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:14477: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_F77=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag_F77=
- enable_shared_with_static_runtimes_F77=no
- archive_cmds_F77=
- archive_expsym_cmds_F77=
- old_archive_From_new_cmds_F77=
- old_archive_from_expsyms_cmds_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- thread_safe_flag_spec_F77=
- hardcode_libdir_flag_spec_F77=
- hardcode_libdir_flag_spec_ld_F77=
- hardcode_libdir_separator_F77=
- hardcode_direct_F77=no
- hardcode_minus_L_F77=no
- hardcode_shlibpath_var_F77=unsupported
- link_all_deplibs_F77=unknown
- hardcode_automatic_F77=no
- module_cmds_F77=
- module_expsym_cmds_F77=
- always_export_symbols_F77=no
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_F77=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_F77=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_F77='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_F77=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_F77=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_F77=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_F77='-L$libdir'
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=no
- enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- interix[3-9]*)
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_F77=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_F77" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=yes
- archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_F77=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_F77=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_F77=''
- hardcode_direct_F77=yes
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct_F77=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_F77=yes
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_libdir_separator_F77=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_F77=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_F77='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_F77="-z nodefs"
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_F77=' ${wl}-bernotok'
- allow_undefined_flag_F77=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_F77='$convenience'
- archive_cmds_need_lc_F77=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_F77=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_F77=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_F77=' '
- allow_undefined_flag_F77=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_F77='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_F77=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_F77=no
- hardcode_direct_F77=no
- hardcode_automatic_F77=yes
- hardcode_shlibpath_var_F77=unsupported
- whole_archive_flag_spec_F77=''
- link_all_deplibs_F77=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- freebsd1*)
- ld_shlibs_F77=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_direct_F77=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_F77='+b $libdir'
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- ;;
- *)
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- link_all_deplibs_F77=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- newsos6)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_shlibpath_var_F77=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- ;;
- *)
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- allow_undefined_flag_F77=unsupported
- archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_F77='-rpath $libdir'
- fi
- hardcode_libdir_separator_F77=:
- ;;
-
- solaris*)
- no_undefined_flag_F77=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_shlibpath_var_F77=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs_F77=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_F77='$CC -r -o $output$reload_objs'
- hardcode_direct_F77=no
- ;;
- motorola)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4.3*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- export_dynamic_flag_spec_F77='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_F77=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_F77='${wl}-z,text'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_F77='${wl}-z,text'
- allow_undefined_flag_F77='${wl}-z,nodefs'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
- export_dynamic_flag_spec_F77='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6; }
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_F77=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_F77 in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_F77
- pic_flag=$lt_prog_compiler_pic_F77
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_F77
- allow_undefined_flag_F77=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_F77=no
- else
- archive_cmds_need_lc_F77=yes
- fi
- allow_undefined_flag_F77=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
+# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[3-9]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
;;
*)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
;;
esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
- test -n "$runpath_var_F77" || \
- test "X$hardcode_automatic_F77" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$hardcode_direct_F77" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
- test "$hardcode_minus_L_F77" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_F77=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_F77=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_F77=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6; }
-
-if test "$hardcode_action_F77" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
fi
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_F77 \
- CC_F77 \
- LD_F77 \
- lt_prog_compiler_wl_F77 \
- lt_prog_compiler_pic_F77 \
- lt_prog_compiler_static_F77 \
- lt_prog_compiler_no_builtin_flag_F77 \
- export_dynamic_flag_spec_F77 \
- thread_safe_flag_spec_F77 \
- whole_archive_flag_spec_F77 \
- enable_shared_with_static_runtimes_F77 \
- old_archive_cmds_F77 \
- old_archive_from_new_cmds_F77 \
- predep_objects_F77 \
- postdep_objects_F77 \
- predeps_F77 \
- postdeps_F77 \
- compiler_lib_search_path_F77 \
- archive_cmds_F77 \
- archive_expsym_cmds_F77 \
- postinstall_cmds_F77 \
- postuninstall_cmds_F77 \
- old_archive_from_expsyms_cmds_F77 \
- allow_undefined_flag_F77 \
- no_undefined_flag_F77 \
- export_symbols_cmds_F77 \
- hardcode_libdir_flag_spec_F77 \
- hardcode_libdir_flag_spec_ld_F77 \
- hardcode_libdir_separator_F77 \
- hardcode_automatic_F77 \
- module_cmds_F77 \
- module_expsym_cmds_F77 \
- lt_cv_prog_compiler_c_o_F77 \
- fix_srcfile_path_F77 \
- exclude_expsyms_F77 \
- include_expsyms_F77; do
-
- case $var in
- old_archive_cmds_F77 | \
- old_archive_from_new_cmds_F77 | \
- archive_cmds_F77 | \
- archive_expsym_cmds_F77 | \
- module_cmds_F77 | \
- module_expsym_cmds_F77 | \
- old_archive_from_expsyms_cmds_F77 | \
- export_symbols_cmds_F77 | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-cfgfile="$ofile"
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_F77
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_F77
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_F77
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
-
-old_archive_cmds_GCJ=$old_archive_cmds
-
-
-lt_prog_compiler_no_builtin_flag_GCJ=
-
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16662: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:16666: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_static_GCJ='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_GCJ='-fno-common'
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_GCJ=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_GCJ=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- else
- lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_GCJ='-qnocommon'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-fpic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- lt_prog_compiler_wl_GCJ=''
- ;;
- esac
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_GCJ='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_GCJ='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_GCJ='-Qoption ld '
- lt_prog_compiler_pic_GCJ='-PIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_GCJ='-Kconform_pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_GCJ='-pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works_GCJ=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16952: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:16956: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_GCJ=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
- case $lt_prog_compiler_pic_GCJ in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
- esac
-else
- lt_prog_compiler_pic_GCJ=
- lt_prog_compiler_can_build_shared_GCJ=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_GCJ=
- ;;
- *)
- lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_GCJ=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_GCJ=yes
- fi
- else
- lt_prog_compiler_static_works_GCJ=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
- :
-else
- lt_prog_compiler_static_GCJ=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_GCJ=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17056: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:17060: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_GCJ=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag_GCJ=
- enable_shared_with_static_runtimes_GCJ=no
- archive_cmds_GCJ=
- archive_expsym_cmds_GCJ=
- old_archive_From_new_cmds_GCJ=
- old_archive_from_expsyms_cmds_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- thread_safe_flag_spec_GCJ=
- hardcode_libdir_flag_spec_GCJ=
- hardcode_libdir_flag_spec_ld_GCJ=
- hardcode_libdir_separator_GCJ=
- hardcode_direct_GCJ=no
- hardcode_minus_L_GCJ=no
- hardcode_shlibpath_var_GCJ=unsupported
- link_all_deplibs_GCJ=unknown
- hardcode_automatic_GCJ=no
- module_cmds_GCJ=
- module_expsym_cmds_GCJ=
- always_export_symbols_GCJ=no
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_GCJ=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_GCJ=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_GCJ=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_GCJ=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_GCJ=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=no
- enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- interix[3-9]*)
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_GCJ=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_GCJ" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=yes
- archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_GCJ=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_GCJ=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_GCJ=''
- hardcode_direct_GCJ=yes
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct_GCJ=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_libdir_separator_GCJ=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_GCJ=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_GCJ='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_GCJ="-z nodefs"
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_GCJ=' ${wl}-bernotok'
- allow_undefined_flag_GCJ=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_GCJ='$convenience'
- archive_cmds_need_lc_GCJ=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_GCJ=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_GCJ=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ=' '
- allow_undefined_flag_GCJ=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_GCJ='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_GCJ=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_GCJ=no
- hardcode_direct_GCJ=no
- hardcode_automatic_GCJ=yes
- hardcode_shlibpath_var_GCJ=unsupported
- whole_archive_flag_spec_GCJ=''
- link_all_deplibs_GCJ=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- freebsd1*)
- ld_shlibs_GCJ=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_direct_GCJ=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- ;;
- *)
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- link_all_deplibs_GCJ=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- newsos6)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- allow_undefined_flag_GCJ=unsupported
- archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_separator_GCJ=:
- ;;
-
- solaris*)
- no_undefined_flag_GCJ=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_shlibpath_var_GCJ=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs_GCJ=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_GCJ='$CC -r -o $output$reload_objs'
- hardcode_direct_GCJ=no
- ;;
- motorola)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4.3*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- export_dynamic_flag_spec_GCJ='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_GCJ=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_GCJ='${wl}-z,text'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_GCJ='${wl}-z,text'
- allow_undefined_flag_GCJ='${wl}-z,nodefs'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_GCJ=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_GCJ in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_GCJ
- pic_flag=$lt_prog_compiler_pic_GCJ
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
- allow_undefined_flag_GCJ=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_GCJ=no
- else
- archive_cmds_need_lc_GCJ=yes
- fi
- allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[3-9]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
;;
esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
- fi
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
- test -n "$runpath_var_GCJ" || \
- test "X$hardcode_automatic_GCJ" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$hardcode_direct_GCJ" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
- test "$hardcode_minus_L_GCJ" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_GCJ=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_GCJ=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_GCJ=unsupported
fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
-
-if test "$hardcode_action_GCJ" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_GCJ \
- CC_GCJ \
- LD_GCJ \
- lt_prog_compiler_wl_GCJ \
- lt_prog_compiler_pic_GCJ \
- lt_prog_compiler_static_GCJ \
- lt_prog_compiler_no_builtin_flag_GCJ \
- export_dynamic_flag_spec_GCJ \
- thread_safe_flag_spec_GCJ \
- whole_archive_flag_spec_GCJ \
- enable_shared_with_static_runtimes_GCJ \
- old_archive_cmds_GCJ \
- old_archive_from_new_cmds_GCJ \
- predep_objects_GCJ \
- postdep_objects_GCJ \
- predeps_GCJ \
- postdeps_GCJ \
- compiler_lib_search_path_GCJ \
- archive_cmds_GCJ \
- archive_expsym_cmds_GCJ \
- postinstall_cmds_GCJ \
- postuninstall_cmds_GCJ \
- old_archive_from_expsyms_cmds_GCJ \
- allow_undefined_flag_GCJ \
- no_undefined_flag_GCJ \
- export_symbols_cmds_GCJ \
- hardcode_libdir_flag_spec_GCJ \
- hardcode_libdir_flag_spec_ld_GCJ \
- hardcode_libdir_separator_GCJ \
- hardcode_automatic_GCJ \
- module_cmds_GCJ \
- module_expsym_cmds_GCJ \
- lt_cv_prog_compiler_c_o_GCJ \
- fix_srcfile_path_GCJ \
- exclude_expsyms_GCJ \
- include_expsyms_GCJ; do
-
- case $var in
- old_archive_cmds_GCJ | \
- old_archive_from_new_cmds_GCJ | \
- archive_cmds_GCJ | \
- archive_expsym_cmds_GCJ | \
- module_cmds_GCJ | \
- module_expsym_cmds_GCJ | \
- old_archive_from_expsyms_cmds_GCJ | \
- export_symbols_cmds_GCJ | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_GCJ
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_GCJ
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- RC)
-
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_RC \
- CC_RC \
- LD_RC \
- lt_prog_compiler_wl_RC \
- lt_prog_compiler_pic_RC \
- lt_prog_compiler_static_RC \
- lt_prog_compiler_no_builtin_flag_RC \
- export_dynamic_flag_spec_RC \
- thread_safe_flag_spec_RC \
- whole_archive_flag_spec_RC \
- enable_shared_with_static_runtimes_RC \
- old_archive_cmds_RC \
- old_archive_from_new_cmds_RC \
- predep_objects_RC \
- postdep_objects_RC \
- predeps_RC \
- postdeps_RC \
- compiler_lib_search_path_RC \
- archive_cmds_RC \
- archive_expsym_cmds_RC \
- postinstall_cmds_RC \
- postuninstall_cmds_RC \
- old_archive_from_expsyms_cmds_RC \
- allow_undefined_flag_RC \
- no_undefined_flag_RC \
- export_symbols_cmds_RC \
- hardcode_libdir_flag_spec_RC \
- hardcode_libdir_flag_spec_ld_RC \
- hardcode_libdir_separator_RC \
- hardcode_automatic_RC \
- module_cmds_RC \
- module_expsym_cmds_RC \
- lt_cv_prog_compiler_c_o_RC \
- fix_srcfile_path_RC \
- exclude_expsyms_RC \
- include_expsyms_RC; do
-
- case $var in
- old_archive_cmds_RC | \
- old_archive_from_new_cmds_RC | \
- archive_cmds_RC | \
- archive_expsym_cmds_RC | \
- module_cmds_RC | \
- module_expsym_cmds_RC | \
- old_archive_from_expsyms_cmds_RC | \
- export_symbols_cmds_RC | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_RC
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -19649,44 +10956,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
CC="$lt_save_CC"
- ;;
-
- *)
- { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Prevent multiple expansion
@@ -19699,26 +10968,28 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+ ac_config_commands="$ac_config_commands libtool"
+# Only expand once:
-{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then
+if test "${enable_maintainer_mode+set}" = set; then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
else
USE_MAINTAINER_MODE=no
fi
- { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
@@ -19731,465 +11002,40 @@ fi
-
for ac_header in sys/mman.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------------------- ##
-## Report this to http://gcc.gnu.org/bugs.html ##
-## ------------------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_mman_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_SYS_MMAN_H 1
_ACEOF
fi
done
-
for ac_func in mmap
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+do :
+ ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_MMAP 1
_ACEOF
fi
done
-if test "${ac_cv_header_sys_mman_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for sys/mman.h" >&5
-echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_mman_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/mman.h usability" >&5
-echo $ECHO_N "checking sys/mman.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <sys/mman.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking sys/mman.h presence" >&5
-echo $ECHO_N "checking sys/mman.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/mman.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sys/mman.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: sys/mman.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/mman.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mman.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/mman.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mman.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sys/mman.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mman.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sys/mman.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------------------- ##
-## Report this to http://gcc.gnu.org/bugs.html ##
-## ------------------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for sys/mman.h" >&5
-echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_mman_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_sys_mman_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6; }
-
-fi
-if test $ac_cv_header_sys_mman_h = yes; then
+ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_mman_h" = x""yes; then :
libffi_header_sys_mman_h=yes
else
libffi_header_sys_mman_h=no
fi
-{ echo "$as_me:$LINENO: checking for mmap" >&5
-echo $ECHO_N "checking for mmap... $ECHO_C" >&6; }
-if test "${ac_cv_func_mmap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define mmap to an innocuous variant, in case <limits.h> declares mmap.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define mmap innocuous_mmap
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char mmap (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef mmap
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char mmap ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_mmap || defined __stub___mmap
-choke me
-#endif
-
-int
-main ()
-{
-return mmap ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_mmap=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_mmap=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5
-echo "${ECHO_T}$ac_cv_func_mmap" >&6; }
-if test $ac_cv_func_mmap = yes; then
+ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = x""yes; then :
libffi_func_mmap=yes
else
libffi_func_mmap=no
@@ -20201,10 +11047,10 @@ if test "$libffi_header_sys_mman_h" != yes \
ac_cv_func_mmap_dev_zero=no
ac_cv_func_mmap_anon=no
else
- { echo "$as_me:$LINENO: checking whether read-only mmap of a plain file works" >&5
-echo $ECHO_N "checking whether read-only mmap of a plain file works... $ECHO_C" >&6; }
-if test "${ac_cv_func_mmap_file+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether read-only mmap of a plain file works" >&5
+$as_echo_n "checking whether read-only mmap of a plain file works... " >&6; }
+if test "${ac_cv_func_mmap_file+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
# Add a system to this blacklist if
# mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
@@ -20218,12 +11064,12 @@ else
ac_cv_func_mmap_file=yes;;
esac
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_file" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_file" >&6; }
- { echo "$as_me:$LINENO: checking whether mmap from /dev/zero works" >&5
-echo $ECHO_N "checking whether mmap from /dev/zero works... $ECHO_C" >&6; }
-if test "${ac_cv_func_mmap_dev_zero+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_file" >&5
+$as_echo "$ac_cv_func_mmap_file" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mmap from /dev/zero works" >&5
+$as_echo_n "checking whether mmap from /dev/zero works... " >&6; }
+if test "${ac_cv_func_mmap_dev_zero+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
# Add a system to this blacklist if it has mmap() but /dev/zero
# does not exist, or if mmapping /dev/zero does not give anonymous
@@ -20242,20 +11088,16 @@ else
ac_cv_func_mmap_dev_zero=yes;;
esac
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_dev_zero" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_dev_zero" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_dev_zero" >&5
+$as_echo "$ac_cv_func_mmap_dev_zero" >&6; }
# Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
- { echo "$as_me:$LINENO: checking for MAP_ANON(YMOUS)" >&5
-echo $ECHO_N "checking for MAP_ANON(YMOUS)... $ECHO_C" >&6; }
-if test "${ac_cv_decl_map_anon+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANON(YMOUS)" >&5
+$as_echo_n "checking for MAP_ANON(YMOUS)... " >&6; }
+if test "${ac_cv_decl_map_anon+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/mman.h>
@@ -20273,43 +11115,23 @@ int n = MAP_ANONYMOUS;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_decl_map_anon=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_decl_map_anon=no
+ ac_cv_decl_map_anon=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_decl_map_anon" >&5
-echo "${ECHO_T}$ac_cv_decl_map_anon" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_decl_map_anon" >&5
+$as_echo "$ac_cv_decl_map_anon" >&6; }
if test $ac_cv_decl_map_anon = no; then
ac_cv_func_mmap_anon=no
else
- { echo "$as_me:$LINENO: checking whether mmap with MAP_ANON(YMOUS) works" >&5
-echo $ECHO_N "checking whether mmap with MAP_ANON(YMOUS) works... $ECHO_C" >&6; }
-if test "${ac_cv_func_mmap_anon+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mmap with MAP_ANON(YMOUS) works" >&5
+$as_echo_n "checking whether mmap with MAP_ANON(YMOUS) works... " >&6; }
+if test "${ac_cv_func_mmap_anon+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
# Add a system to this blacklist if it has mmap() and MAP_ANON or
# MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
@@ -20323,30 +11145,24 @@ else
ac_cv_func_mmap_anon=yes;;
esac
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_anon" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_anon" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_anon" >&5
+$as_echo "$ac_cv_func_mmap_anon" >&6; }
fi
fi
if test $ac_cv_func_mmap_file = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP_FILE 1
-_ACEOF
+$as_echo "#define HAVE_MMAP_FILE 1" >>confdefs.h
fi
if test $ac_cv_func_mmap_dev_zero = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP_DEV_ZERO 1
-_ACEOF
+$as_echo "#define HAVE_MMAP_DEV_ZERO 1" >>confdefs.h
fi
if test $ac_cv_func_mmap_anon = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP_ANON 1
-_ACEOF
+$as_echo "#define HAVE_MMAP_ANON 1" >>confdefs.h
fi
@@ -20372,10 +11188,18 @@ case "$host" in
TARGET=ARM; TARGETDIR=arm
;;
- amd64-*-freebsd*)
+ amd64-*-freebsd* | amd64-*-openbsd*)
TARGET=X86_64; TARGETDIR=x86
;;
+ amd64-*-freebsd*)
+ TARGET=X86_64; TARGETDIR=x86
+ ;;
+
+ avr32*-*-*)
+ TARGET=AVR32; TARGETDIR=avr32
+ ;;
+
cris-*-*)
TARGET=LIBFFI_CRIS; TARGETDIR=cris
;;
@@ -20394,11 +11218,13 @@ case "$host" in
TARGET=PA_HPUX; TARGETDIR=pa
;;
- i386-*-freebsd* | i386-*-openbsd*)
+ i?86-*-freebsd* | i?86-*-openbsd*)
TARGET=X86_FREEBSD; TARGETDIR=x86
;;
i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*)
TARGET=X86_WIN32; TARGETDIR=x86
+ # All mingw/cygwin/win32 builds require this for sharedlib
+ AM_LTLDFLAGS="-no-undefined"
;;
i?86-*-darwin*)
TARGET=X86_DARWIN; TARGETDIR=x86
@@ -20429,7 +11255,9 @@ case "$host" in
TARGET=MIPS_IRIX; TARGETDIR=mips
;;
mips*-*-linux*)
- TARGET=MIPS_LINUX; TARGETDIR=mips
+ # Support 128-bit long double for NewABI.
+ HAVE_LONG_DOUBLE='defined(__mips64)'
+ TARGET=MIPS_IRIX; TARGETDIR=mips
;;
powerpc*-*-linux* | powerpc-*-sysv*)
@@ -20469,8 +11297,11 @@ case "$host" in
x86_64-*-darwin*)
TARGET=X86_DARWIN; TARGETDIR=x86
;;
+
x86_64-*-cygwin* | x86_64-*-mingw*)
+ TARGET=X86_WIN64; TARGETDIR=x86
;;
+
x86_64-*-*)
TARGET=X86_64; TARGETDIR=x86
;;
@@ -20478,10 +11309,9 @@ esac
+
if test $TARGETDIR = unknown; then
- { { echo "$as_me:$LINENO: error: \"libffi has not been ported to $host.\"" >&5
-echo "$as_me: error: \"libffi has not been ported to $host.\"" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "\"libffi has not been ported to $host.\"" "$LINENO" 5
fi
if expr x$TARGET : 'xMIPS' > /dev/null; then
@@ -20524,6 +11354,14 @@ else
X86_WIN32_FALSE=
fi
+ if test x$TARGET = xX86_WIN64; then
+ X86_WIN64_TRUE=
+ X86_WIN64_FALSE='#'
+else
+ X86_WIN64_TRUE='#'
+ X86_WIN64_FALSE=
+fi
+
if test x$TARGET = xX86_DARWIN; then
X86_DARWIN_TRUE=
X86_DARWIN_FALSE='#'
@@ -20604,6 +11442,14 @@ else
ARM_FALSE=
fi
+ if test x$TARGET = xAVR32; then
+ AVR32_TRUE=
+ AVR32_FALSE='#'
+else
+ AVR32_TRUE='#'
+ AVR32_FALSE=
+fi
+
if test x$TARGET = xLIBFFI_CRIS; then
LIBFFI_CRIS_TRUE=
LIBFFI_CRIS_FALSE='#'
@@ -20677,16 +11523,12 @@ else
fi
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
@@ -20701,47 +11543,23 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_header_stdc=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
+ ac_cv_header_stdc=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <string.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
else
ac_cv_header_stdc=no
fi
@@ -20751,18 +11569,14 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
+ $EGREP "free" >/dev/null 2>&1; then :
+
else
ac_cv_header_stdc=no
fi
@@ -20772,14 +11586,10 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then :
:
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ctype.h>
#include <stdlib.h>
@@ -20806,140 +11616,31 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_run "$LINENO"; then :
-( exit $ac_status )
-ac_cv_header_stdc=no
+else
+ ac_cv_header_stdc=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
fi
-
for ac_func in memcpy
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+do :
+ ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy"
+if test "x$ac_cv_func_memcpy" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_MEMCPY 1
_ACEOF
fi
@@ -20947,16 +11648,12 @@ done
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
-{ echo "$as_me:$LINENO: checking for working alloca.h" >&5
-echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if test "${ac_cv_working_alloca_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <alloca.h>
int
@@ -20968,55 +11665,28 @@ char *p = (char *) alloca (2 * sizeof (int));
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_working_alloca_h=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_working_alloca_h=no
+ ac_cv_working_alloca_h=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
-echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
if test $ac_cv_working_alloca_h = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA_H 1
-_ACEOF
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
fi
-{ echo "$as_me:$LINENO: checking for alloca" >&5
-echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if test "${ac_cv_func_alloca_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __GNUC__
# define alloca __builtin_alloca
@@ -21048,43 +11718,20 @@ char *p = (char *) alloca (1);
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_func_alloca_works=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_alloca_works=no
+ ac_cv_func_alloca_works=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
-echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
if test $ac_cv_func_alloca_works = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA 1
-_ACEOF
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
else
# The SVR3 libPW and SVR4 libucb both contain incompatible functions
@@ -21094,21 +11741,15 @@ else
ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
-cat >>confdefs.h <<\_ACEOF
-#define C_ALLOCA 1
-_ACEOF
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
-{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
-echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }
-if test "${ac_cv_os_cray+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if test "${ac_cv_os_cray+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined CRAY && ! defined CRAY2
webecray
@@ -21118,7 +11759,7 @@ wenotbecray
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "webecray" >/dev/null 2>&1; then
+ $EGREP "webecray" >/dev/null 2>&1; then :
ac_cv_os_cray=yes
else
ac_cv_os_cray=no
@@ -21126,94 +11767,14 @@ fi
rm -f conftest*
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
-echo "${ECHO_T}$ac_cv_os_cray" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
- as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define CRAY_STACKSEG_END $ac_func
@@ -21225,19 +11786,15 @@ fi
done
fi
-{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
-echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if test "${ac_cv_c_stack_direction+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then :
ac_cv_c_stack_direction=0
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
@@ -21260,43 +11817,18 @@ main ()
return find_stack_direction () < 0;
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
ac_cv_c_stack_direction=1
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_stack_direction=-1
+ ac_cv_c_stack_direction=-1
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
-echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
_ACEOF
@@ -21305,403 +11837,32 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for double" >&5
-echo $ECHO_N "checking for double... $ECHO_C" >&6; }
-if test "${ac_cv_type_double+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef double ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_double=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_double=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5
-echo "${ECHO_T}$ac_cv_type_double" >&6; }
-
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of double" >&5
-echo $ECHO_N "checking size of double... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_double+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
+$as_echo_n "checking size of double... " >&6; }
+if test "${ac_cv_sizeof_double+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then :
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_double=$ac_lo;;
-'') if test "$ac_cv_type_double" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (double)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_double=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef double ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_double=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_double" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (double)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
+ if test "$ac_cv_type_double" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (double)
+See \`config.log' for more details." "$LINENO" 5; }; }
else
ac_cv_sizeof_double=0
fi
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
+
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5
-echo "${ECHO_T}$ac_cv_sizeof_double" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5
+$as_echo "$ac_cv_sizeof_double" >&6; }
@@ -21710,403 +11871,32 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-{ echo "$as_me:$LINENO: checking for long double" >&5
-echo $ECHO_N "checking for long double... $ECHO_C" >&6; }
-if test "${ac_cv_type_long_double+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef long double ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_long_double=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_long_double=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5
-echo "${ECHO_T}$ac_cv_type_long_double" >&6; }
-
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long double" >&5
-echo $ECHO_N "checking size of long double... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long_double+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
+$as_echo_n "checking size of long double... " >&6; }
+if test "${ac_cv_sizeof_long_double+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long double ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then :
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_double=$ac_lo;;
-'') if test "$ac_cv_type_long_double" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long double)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long_double=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long double ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_long_double=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_long_double" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long double)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
+ if test "$ac_cv_type_long_double" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (long double)
+See \`config.log' for more details." "$LINENO" 5; }; }
else
ac_cv_sizeof_long_double=0
fi
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
+
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
+$as_echo "$ac_cv_sizeof_long_double" >&6; }
@@ -22123,264 +11913,246 @@ if test -z "$HAVE_LONG_DOUBLE"; then
if test $ac_cv_sizeof_long_double != 0; then
HAVE_LONG_DOUBLE=1
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LONG_DOUBLE 1
-_ACEOF
+$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
fi
fi
fi
-{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- # See if sys/param.h defines the BYTE_ORDER macro.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
-#include <sys/param.h>
+ #include <sys/param.h>
int
main ()
{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
- && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
- bogus endian macros
-#endif
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
# It does; now see whether it defined to BIG_ENDIAN or not.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
-#include <sys/param.h>
+ #include <sys/param.h>
int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
+ not big endian
+ #endif
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_c_bigendian=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_c_bigendian=no
+ ac_cv_c_bigendian=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
- # It does not; compile a test program.
-if test "$cross_compiling" = yes; then
- # try to guess the endianness by grepping values into an object file
- ac_cv_c_bigendian=unknown
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+#include <limits.h>
+
int
main ()
{
- _ascii (); _ebcdic ();
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
fi
-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
;
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
ac_cv_c_bigendian=no
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_bigendian=yes
+ ac_cv_c_bigendian=yes
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
+ fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
-case $ac_cv_c_bigendian in
- yes)
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
-_ACEOF
- ;;
- no)
- ;;
- *)
- { { echo "$as_me:$LINENO: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
+ ;; #(
+ *)
+ as_fn_error "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
-{ echo "$as_me:$LINENO: checking assembler .cfi pseudo-op support" >&5
-echo $ECHO_N "checking assembler .cfi pseudo-op support... $ECHO_C" >&6; }
-if test "${libffi_cv_as_cfi_pseudo_op+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .cfi pseudo-op support" >&5
+$as_echo_n "checking assembler .cfi pseudo-op support... " >&6; }
+if test "${libffi_cv_as_cfi_pseudo_op+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
libffi_cv_as_cfi_pseudo_op=unknown
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
asm (".cfi_startproc\n\t.cfi_endproc");
int
@@ -22391,60 +12163,34 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
libffi_cv_as_cfi_pseudo_op=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- libffi_cv_as_cfi_pseudo_op=no
+ libffi_cv_as_cfi_pseudo_op=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $libffi_cv_as_cfi_pseudo_op" >&5
-echo "${ECHO_T}$libffi_cv_as_cfi_pseudo_op" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_cfi_pseudo_op" >&5
+$as_echo "$libffi_cv_as_cfi_pseudo_op" >&6; }
if test "x$libffi_cv_as_cfi_pseudo_op" = xyes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_AS_CFI_PSEUDO_OP 1
-_ACEOF
+$as_echo "#define HAVE_AS_CFI_PSEUDO_OP 1" >>confdefs.h
fi
if test x$TARGET = xSPARC; then
- { echo "$as_me:$LINENO: checking assembler and linker support unaligned pc related relocs" >&5
-echo $ECHO_N "checking assembler and linker support unaligned pc related relocs... $ECHO_C" >&6; }
-if test "${libffi_cv_as_sparc_ua_pcrel+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler and linker support unaligned pc related relocs" >&5
+$as_echo_n "checking assembler and linker support unaligned pc related relocs... " >&6; }
+if test "${libffi_cv_as_sparc_ua_pcrel+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS -fpic"
LDFLAGS="$LDFLAGS -shared"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
int
@@ -22455,60 +12201,33 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
libffi_cv_as_sparc_ua_pcrel=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- libffi_cv_as_sparc_ua_pcrel=no
+ libffi_cv_as_sparc_ua_pcrel=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
fi
-{ echo "$as_me:$LINENO: result: $libffi_cv_as_sparc_ua_pcrel" >&5
-echo "${ECHO_T}$libffi_cv_as_sparc_ua_pcrel" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_sparc_ua_pcrel" >&5
+$as_echo "$libffi_cv_as_sparc_ua_pcrel" >&6; }
if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_AS_SPARC_UA_PCREL 1
-_ACEOF
+$as_echo "#define HAVE_AS_SPARC_UA_PCREL 1" >>confdefs.h
fi
- { echo "$as_me:$LINENO: checking assembler .register pseudo-op support" >&5
-echo $ECHO_N "checking assembler .register pseudo-op support... $ECHO_C" >&6; }
-if test "${libffi_cv_as_register_pseudo_op+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .register pseudo-op support" >&5
+$as_echo_n "checking assembler .register pseudo-op support... " >&6; }
+if test "${libffi_cv_as_register_pseudo_op+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
libffi_cv_as_register_pseudo_op=unknown
# Check if we have .register
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
asm (".register %g2, #scratch");
int
@@ -22519,49 +12238,58 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
libffi_cv_as_register_pseudo_op=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- libffi_cv_as_register_pseudo_op=no
+ libffi_cv_as_register_pseudo_op=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $libffi_cv_as_register_pseudo_op" >&5
-echo "${ECHO_T}$libffi_cv_as_register_pseudo_op" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_register_pseudo_op" >&5
+$as_echo "$libffi_cv_as_register_pseudo_op" >&6; }
if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_AS_REGISTER_PSEUDO_OP 1
-_ACEOF
+$as_echo "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h
+
+ fi
+fi
+
+if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports pc related relocs" >&5
+$as_echo_n "checking assembler supports pc related relocs... " >&6; }
+if test "${libffi_cv_as_x86_pcrel+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ libffi_cv_as_x86_pcrel=yes
+ echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
+ if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
+ libffi_cv_as_x86_pcrel=no
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_pcrel" >&5
+$as_echo "$libffi_cv_as_x86_pcrel" >&6; }
+ if test "x$libffi_cv_as_x86_pcrel" = xyes; then
+
+$as_echo "#define HAVE_AS_X86_PCREL 1" >>confdefs.h
fi
fi
-{ echo "$as_me:$LINENO: checking whether .eh_frame section should be read-only" >&5
-echo $ECHO_N "checking whether .eh_frame section should be read-only... $ECHO_C" >&6; }
-if test "${libffi_cv_ro_eh_frame+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+case "$target" in
+ *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
+
+$as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
+
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether .eh_frame section should be read-only" >&5
+$as_echo_n "checking whether .eh_frame section should be read-only... " >&6; }
+if test "${libffi_cv_ro_eh_frame+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
libffi_cv_ro_eh_frame=no
@@ -22577,41 +12305,35 @@ else
rm -f conftest.*
fi
-{ echo "$as_me:$LINENO: result: $libffi_cv_ro_eh_frame" >&5
-echo "${ECHO_T}$libffi_cv_ro_eh_frame" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_ro_eh_frame" >&5
+$as_echo "$libffi_cv_ro_eh_frame" >&6; }
if test "x$libffi_cv_ro_eh_frame" = xyes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_RO_EH_FRAME 1
-_ACEOF
+$as_echo "#define HAVE_RO_EH_FRAME 1" >>confdefs.h
-cat >>confdefs.h <<\_ACEOF
-#define EH_FRAME_FLAGS "a"
-_ACEOF
+$as_echo "#define EH_FRAME_FLAGS \"a\"" >>confdefs.h
else
-cat >>confdefs.h <<\_ACEOF
-#define EH_FRAME_FLAGS "aw"
-_ACEOF
+$as_echo "#define EH_FRAME_FLAGS \"aw\"" >>confdefs.h
fi
-{ echo "$as_me:$LINENO: checking for __attribute__((visibility(\"hidden\")))" >&5
-echo $ECHO_N "checking for __attribute__((visibility(\"hidden\")))... $ECHO_C" >&6; }
-if test "${libffi_cv_hidden_visibility_attribute+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__((visibility(\"hidden\")))" >&5
+$as_echo_n "checking for __attribute__((visibility(\"hidden\")))... " >&6; }
+if test "${libffi_cv_hidden_visibility_attribute+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }' > conftest.c
libffi_cv_hidden_visibility_attribute=no
if { ac_try='${CC-cc} -Werror -S conftest.c -o conftest.s 1>&5'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
if grep '\.hidden.*foo' conftest.s >/dev/null; then
libffi_cv_hidden_visibility_attribute=yes
fi
@@ -22619,13 +12341,11 @@ else
rm -f conftest.*
fi
-{ echo "$as_me:$LINENO: result: $libffi_cv_hidden_visibility_attribute" >&5
-echo "${ECHO_T}$libffi_cv_hidden_visibility_attribute" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_hidden_visibility_attribute" >&5
+$as_echo "$libffi_cv_hidden_visibility_attribute" >&6; }
if test $libffi_cv_hidden_visibility_attribute = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1
-_ACEOF
+$as_echo "#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1" >>confdefs.h
fi
@@ -22636,50 +12356,41 @@ fi
-
# Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then
+if test "${enable_debug+set}" = set; then :
enableval=$enable_debug; if test "$enable_debug" = "yes"; then
-cat >>confdefs.h <<\_ACEOF
-#define FFI_DEBUG 1
-_ACEOF
+$as_echo "#define FFI_DEBUG 1" >>confdefs.h
fi
fi
# Check whether --enable-structs was given.
-if test "${enable_structs+set}" = set; then
+if test "${enable_structs+set}" = set; then :
enableval=$enable_structs; if test "$enable_structs" = "no"; then
-cat >>confdefs.h <<\_ACEOF
-#define FFI_NO_STRUCTS 1
-_ACEOF
+$as_echo "#define FFI_NO_STRUCTS 1" >>confdefs.h
fi
fi
# Check whether --enable-raw-api was given.
-if test "${enable_raw_api+set}" = set; then
+if test "${enable_raw_api+set}" = set; then :
enableval=$enable_raw_api; if test "$enable_raw_api" = "no"; then
-cat >>confdefs.h <<\_ACEOF
-#define FFI_NO_RAW_API 1
-_ACEOF
+$as_echo "#define FFI_NO_RAW_API 1" >>confdefs.h
fi
fi
# Check whether --enable-purify-safety was given.
-if test "${enable_purify_safety+set}" = set; then
+if test "${enable_purify_safety+set}" = set; then :
enableval=$enable_purify_safety; if test "$enable_purify_safety" = "yes"; then
-cat >>confdefs.h <<\_ACEOF
-#define USING_PURIFY 1
-_ACEOF
+$as_echo "#define USING_PURIFY 1" >>confdefs.h
fi
fi
@@ -22715,7 +12426,7 @@ ac_config_commands="$ac_config_commands src"
ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h"
-ac_config_files="$ac_config_files include/ffi.h"
+ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h"
@@ -22751,12 +12462,13 @@ _ACEOF
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
@@ -22764,8 +12476,8 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
@@ -22788,12 +12500,12 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
cat confcache >$cache_file
else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -22809,234 +12521,159 @@ ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"am__fastdepCCAS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${TESTSUBDIR_TRUE}" && test -z "${TESTSUBDIR_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"TESTSUBDIR\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"TESTSUBDIR\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"TESTSUBDIR\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MIPS_TRUE}" && test -z "${MIPS_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"MIPS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MIPS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"MIPS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${SPARC_TRUE}" && test -z "${SPARC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"SPARC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"SPARC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"SPARC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${X86_TRUE}" && test -z "${X86_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"X86\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"X86\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"X86\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${X86_FREEBSD_TRUE}" && test -z "${X86_FREEBSD_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"X86_FREEBSD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"X86_FREEBSD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"X86_FREEBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${X86_WIN32_TRUE}" && test -z "${X86_WIN32_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"X86_WIN32\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"X86_WIN32\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"X86_WIN32\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${X86_WIN64_TRUE}" && test -z "${X86_WIN64_FALSE}"; then
+ as_fn_error "conditional \"X86_WIN64\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${X86_DARWIN_TRUE}" && test -z "${X86_DARWIN_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"X86_DARWIN\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"X86_DARWIN\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"X86_DARWIN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ALPHA_TRUE}" && test -z "${ALPHA_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"ALPHA\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"ALPHA\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"ALPHA\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${IA64_TRUE}" && test -z "${IA64_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"IA64\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"IA64\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"IA64\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${M32R_TRUE}" && test -z "${M32R_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"M32R\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"M32R\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"M32R\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${M68K_TRUE}" && test -z "${M68K_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"M68K\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"M68K\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"M68K\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${POWERPC_TRUE}" && test -z "${POWERPC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"POWERPC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"POWERPC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"POWERPC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${POWERPC_AIX_TRUE}" && test -z "${POWERPC_AIX_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"POWERPC_AIX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"POWERPC_AIX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"POWERPC_AIX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${POWERPC_DARWIN_TRUE}" && test -z "${POWERPC_DARWIN_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"POWERPC_DARWIN\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"POWERPC_DARWIN\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"POWERPC_DARWIN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${POWERPC_FREEBSD_TRUE}" && test -z "${POWERPC_FREEBSD_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"POWERPC_FREEBSD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"POWERPC_FREEBSD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"POWERPC_FREEBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ARM_TRUE}" && test -z "${ARM_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"ARM\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"ARM\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"ARM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AVR32_TRUE}" && test -z "${AVR32_FALSE}"; then
+ as_fn_error "conditional \"AVR32\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${LIBFFI_CRIS_TRUE}" && test -z "${LIBFFI_CRIS_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"LIBFFI_CRIS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"LIBFFI_CRIS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"LIBFFI_CRIS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${FRV_TRUE}" && test -z "${FRV_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"FRV\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"FRV\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"FRV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${S390_TRUE}" && test -z "${S390_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"S390\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"S390\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"S390\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${X86_64_TRUE}" && test -z "${X86_64_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"X86_64\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"X86_64\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"X86_64\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${SH_TRUE}" && test -z "${SH_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"SH\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"SH\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"SH\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${SH64_TRUE}" && test -z "${SH64_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"SH64\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"SH64\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"SH64\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${PA_LINUX_TRUE}" && test -z "${PA_LINUX_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"PA_LINUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"PA_LINUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"PA_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${PA_HPUX_TRUE}" && test -z "${PA_HPUX_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"PA_HPUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"PA_HPUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"PA_HPUX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${PA64_HPUX_TRUE}" && test -z "${PA64_HPUX_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"PA64_HPUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"PA64_HPUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "conditional \"PA64_HPUX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+
: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
@@ -23046,59 +12683,79 @@ cat >$CONFIG_STATUS <<_ACEOF
debug=false
ac_cs_recheck=false
ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
esac
-
fi
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
fi
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
@@ -23107,20 +12764,18 @@ fi
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
+case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
IFS=$as_save_IFS
;;
@@ -23131,32 +12786,111 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
fi
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
fi
-done
+ $as_echo "$as_me: error: $1" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
-# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
@@ -23170,13 +12904,17 @@ else
as_basename=false
fi
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
-# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -23191,104 +12929,103 @@ echo X/"$0" |
}
s/.*/./; q'`
-# CDPATH.
-$as_unset CDPATH
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
-n*)
- case `echo 'x\c'` in
+ case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ fi
else
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
+ as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
@@ -23305,12 +13042,12 @@ else
as_test_x='
eval sh -c '\''
if test -d "$1"; then
- test -d "$1/.";
+ test -d "$1/.";
else
- case $1 in
- -*)set "./$1";;
+ case $1 in #(
+ -*)set "./$1";;
esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
@@ -23325,13 +13062,19 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-# Save the log message, to keep $[0] and so on meaningful, and to
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libffi $as_me 3.0.5, which was
-generated by GNU Autoconf 2.61. Invocation command line was
+This file was extended by libffi $as_me 3.0.10rc0, which was
+generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -23344,7 +13087,16 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q`
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
@@ -23353,22 +13105,25 @@ config_commands="$ac_config_commands"
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
- -q, --quiet do not print progress messages
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
Configuration files:
$config_files
@@ -23382,16 +13137,17 @@ $config_links
Configuration commands:
$config_commands
-Report bugs to <bug-autoconf@gnu.org>."
+Report bugs to <http://gcc.gnu.org/bugs.html>."
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libffi config.status 3.0.5
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+libffi config.status 3.0.10rc0
+configured by $0, generated by GNU Autoconf 2.65,
+ with options \\"\$ac_cs_config\\"
-Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -23399,11 +13155,12 @@ ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
@@ -23425,34 +13182,40 @@ do
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; };;
+ as_fn_error "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
--help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
+ $as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
+ -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
- *) ac_config_targets="$ac_config_targets $1"
+ *) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
@@ -23467,36 +13230,293 @@ if $ac_cs_silent; then
fi
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ exec "\$@"
fi
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
- echo "$ac_log"
+ $as_echo "$ac_log"
} >&5
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
+enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
+host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
+host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
+host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
+build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
+build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
+build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
+SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
+Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
+GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
+EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
+FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
+LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
+NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
+LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
+exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
+AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
+GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
+SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
+ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
+need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
+LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
+libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
+version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
+striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+SHELL \
+ECHO \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
+ ;;
+esac
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
TARGETDIR="$TARGETDIR"
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
@@ -23504,16 +13524,20 @@ do
case $ac_config_target in
"fficonfig.h") CONFIG_HEADERS="$CONFIG_HEADERS fficonfig.h" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;;
"src") CONFIG_COMMANDS="$CONFIG_COMMANDS src" ;;
"include/ffitarget.h") CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ;;
+ "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"include/ffi.h") CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
+ "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+ "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
"include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
"fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
+ *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -23541,7 +13565,7 @@ $debug ||
trap 'exit_status=$?
{ test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
+ trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
@@ -23552,281 +13576,140 @@ $debug ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
-_ACEOF
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-target!$target$ac_delim
-target_cpu!$target_cpu$ac_delim
-target_vendor!$target_vendor$ac_delim
-target_os!$target_os$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-am__isrc!$am__isrc$ac_delim
-CYGPATH_W!$CYGPATH_W$ac_delim
-PACKAGE!$PACKAGE$ac_delim
-VERSION!$VERSION$ac_delim
-ACLOCAL!$ACLOCAL$ac_delim
-AUTOCONF!$AUTOCONF$ac_delim
-AUTOMAKE!$AUTOMAKE$ac_delim
-AUTOHEADER!$AUTOHEADER$ac_delim
-MAKEINFO!$MAKEINFO$ac_delim
-install_sh!$install_sh$ac_delim
-STRIP!$STRIP$ac_delim
-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
-mkdir_p!$mkdir_p$ac_delim
-AWK!$AWK$ac_delim
-SET_MAKE!$SET_MAKE$ac_delim
-am__leading_dot!$am__leading_dot$ac_delim
-AMTAR!$AMTAR$ac_delim
-am__tar!$am__tar$ac_delim
-am__untar!$am__untar$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-DEPDIR!$DEPDIR$ac_delim
-am__include!$am__include$ac_delim
-am__quote!$am__quote$ac_delim
-AMDEP_TRUE!$AMDEP_TRUE$ac_delim
-AMDEP_FALSE!$AMDEP_FALSE$ac_delim
-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
-CCDEPMODE!$CCDEPMODE$ac_delim
-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
-CCAS!$CCAS$ac_delim
-CCASFLAGS!$CCASFLAGS$ac_delim
-CCASDEPMODE!$CCASDEPMODE$ac_delim
-am__fastdepCCAS_TRUE!$am__fastdepCCAS_TRUE$ac_delim
-am__fastdepCCAS_FALSE!$am__fastdepCCAS_FALSE$ac_delim
-SED!$SED$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-LN_S!$LN_S$ac_delim
-ECHO!$ECHO$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\r'
+else
+ ac_cs_awk_cr=$ac_cr
fi
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
_ACEOF
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-AR!$AR$ac_delim
-RANLIB!$RANLIB$ac_delim
-CPP!$CPP$ac_delim
-CXX!$CXX$ac_delim
-CXXFLAGS!$CXXFLAGS$ac_delim
-ac_ct_CXX!$ac_ct_CXX$ac_delim
-CXXDEPMODE!$CXXDEPMODE$ac_delim
-am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
-am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
-CXXCPP!$CXXCPP$ac_delim
-F77!$F77$ac_delim
-FFLAGS!$FFLAGS$ac_delim
-ac_ct_F77!$ac_ct_F77$ac_delim
-LIBTOOL!$LIBTOOL$ac_delim
-MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
-MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
-MAINT!$MAINT$ac_delim
-TESTSUBDIR_TRUE!$TESTSUBDIR_TRUE$ac_delim
-TESTSUBDIR_FALSE!$TESTSUBDIR_FALSE$ac_delim
-AM_RUNTESTFLAGS!$AM_RUNTESTFLAGS$ac_delim
-MIPS_TRUE!$MIPS_TRUE$ac_delim
-MIPS_FALSE!$MIPS_FALSE$ac_delim
-SPARC_TRUE!$SPARC_TRUE$ac_delim
-SPARC_FALSE!$SPARC_FALSE$ac_delim
-X86_TRUE!$X86_TRUE$ac_delim
-X86_FALSE!$X86_FALSE$ac_delim
-X86_FREEBSD_TRUE!$X86_FREEBSD_TRUE$ac_delim
-X86_FREEBSD_FALSE!$X86_FREEBSD_FALSE$ac_delim
-X86_WIN32_TRUE!$X86_WIN32_TRUE$ac_delim
-X86_WIN32_FALSE!$X86_WIN32_FALSE$ac_delim
-X86_DARWIN_TRUE!$X86_DARWIN_TRUE$ac_delim
-X86_DARWIN_FALSE!$X86_DARWIN_FALSE$ac_delim
-ALPHA_TRUE!$ALPHA_TRUE$ac_delim
-ALPHA_FALSE!$ALPHA_FALSE$ac_delim
-IA64_TRUE!$IA64_TRUE$ac_delim
-IA64_FALSE!$IA64_FALSE$ac_delim
-M32R_TRUE!$M32R_TRUE$ac_delim
-M32R_FALSE!$M32R_FALSE$ac_delim
-M68K_TRUE!$M68K_TRUE$ac_delim
-M68K_FALSE!$M68K_FALSE$ac_delim
-POWERPC_TRUE!$POWERPC_TRUE$ac_delim
-POWERPC_FALSE!$POWERPC_FALSE$ac_delim
-POWERPC_AIX_TRUE!$POWERPC_AIX_TRUE$ac_delim
-POWERPC_AIX_FALSE!$POWERPC_AIX_FALSE$ac_delim
-POWERPC_DARWIN_TRUE!$POWERPC_DARWIN_TRUE$ac_delim
-POWERPC_DARWIN_FALSE!$POWERPC_DARWIN_FALSE$ac_delim
-POWERPC_FREEBSD_TRUE!$POWERPC_FREEBSD_TRUE$ac_delim
-POWERPC_FREEBSD_FALSE!$POWERPC_FREEBSD_FALSE$ac_delim
-ARM_TRUE!$ARM_TRUE$ac_delim
-ARM_FALSE!$ARM_FALSE$ac_delim
-LIBFFI_CRIS_TRUE!$LIBFFI_CRIS_TRUE$ac_delim
-LIBFFI_CRIS_FALSE!$LIBFFI_CRIS_FALSE$ac_delim
-FRV_TRUE!$FRV_TRUE$ac_delim
-FRV_FALSE!$FRV_FALSE$ac_delim
-S390_TRUE!$S390_TRUE$ac_delim
-S390_FALSE!$S390_FALSE$ac_delim
-X86_64_TRUE!$X86_64_TRUE$ac_delim
-X86_64_FALSE!$X86_64_FALSE$ac_delim
-SH_TRUE!$SH_TRUE$ac_delim
-SH_FALSE!$SH_FALSE$ac_delim
-SH64_TRUE!$SH64_TRUE$ac_delim
-SH64_FALSE!$SH64_FALSE$ac_delim
-PA_LINUX_TRUE!$PA_LINUX_TRUE$ac_delim
-PA_LINUX_FALSE!$PA_LINUX_FALSE$ac_delim
-PA_HPUX_TRUE!$PA_HPUX_TRUE$ac_delim
-PA_HPUX_FALSE!$PA_HPUX_FALSE$ac_delim
-PA64_HPUX_TRUE!$PA64_HPUX_TRUE$ac_delim
-PA64_HPUX_FALSE!$PA64_HPUX_FALSE$ac_delim
-ALLOCA!$ALLOCA$ac_delim
-HAVE_LONG_DOUBLE!$HAVE_LONG_DOUBLE$ac_delim
-TARGET!$TARGET$ac_delim
-TARGETDIR!$TARGETDIR$ac_delim
-toolexecdir!$toolexecdir$ac_delim
-toolexeclibdir!$toolexeclibdir$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
+ . ./conf$$subs.sh ||
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 76; then
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACAWK
_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || as_fn_error "could not setup config files machinery" "$LINENO" 5
_ACEOF
-
# VPATH may cause trouble with some makes, so we remove $(srcdir),
# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
@@ -23842,20 +13725,128 @@ s/^[^=]*=[ ]*$//
}'
fi
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_t"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
+ :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -23883,26 +13874,34 @@ echo "$as_me: error: Invalid tag $ac_tag." >&2;}
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
+ as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
- ac_file_inputs="$ac_file_inputs $ac_f"
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -23912,7 +13911,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
+$as_echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -23930,55 +13929,15 @@ echo X"$ac_file" |
q
}
s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
+ as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -24023,12 +13982,12 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
esac
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
+ac_sed_dataroot='
+/datarootdir/ {
p
q
}
@@ -24036,36 +13995,37 @@ case `sed -n '/datarootdir/ {
/@docdir@/p
/@infodir@/p
/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
+ s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
+s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
@@ -24076,135 +14036,65 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined." >&2;}
rm -f "$tmp/stdin"
case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
;;
:H)
#
# CONFIG_HEADER
#
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+ } >"$tmp/config.h" \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
- rm -f $ac_file
- mv "$tmp/config.h" $ac_file
+ rm -f "$ac_file"
+ mv "$tmp/config.h" "$ac_file" \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
fi
else
- echo "/* $configure_input */"
- cat "$ac_result"
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error "could not create -" "$LINENO" 5
fi
- rm -f "$tmp/out12"
-# Compute $ac_file's index in $config_headers.
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $ac_file | $ac_file:* )
+ $_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X$ac_file : 'X\(//\)[^/]' \| \
- X$ac_file : 'X\(//\)$' \| \
- X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
-echo X$ac_file |
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -24228,52 +14118,67 @@ echo X$ac_file |
# CONFIG_LINK
#
- { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5
-echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;}
+ if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
+ :
+ else
+ # Prefer the file from the source tree if names are identical.
+ if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
+ ac_source=$srcdir/$ac_source
+ fi
- if test ! -r "$srcdir/$ac_source"; then
- { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5
-echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;}
- { (exit 1); exit 1; }; }
- fi
- rm -f "$ac_file"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
+$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
- # Try a relative symlink, then a hard link, then a copy.
- case $srcdir in
- [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;;
- *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;;
- esac
- ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
- ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null ||
- cp -p "$srcdir/$ac_source" "$ac_file" ||
- { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5
-echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;}
- { (exit 1); exit 1; }; }
+ if test ! -r "$ac_source"; then
+ as_fn_error "$ac_source: file not found" "$LINENO" 5
+ fi
+ rm -f "$ac_file"
+
+ # Try a relative symlink, then a hard link, then a copy.
+ case $srcdir in
+ [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
+ *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
+ esac
+ ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
+ ln "$ac_source" "$ac_file" 2>/dev/null ||
+ cp -p "$ac_source" "$ac_file" ||
+ as_fn_error "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
+ fi
;;
- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
;;
esac
case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$mf" |
+$as_echo X"$mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -24291,33 +14196,33 @@ echo X"$mf" |
q
}
s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$file" |
+$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -24335,51 +14240,647 @@ echo X"$file" |
q
}
s/.*/./; q'`
- { as_dir=$dirpart/$fdir
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
done
-done
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that does not interpret backslashes.
+ECHO=$lt_ECHO
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1+=\$2"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+ ;;
+ esac
+
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
;;
"include":C) test -d include || mkdir include ;;
"src":C)
@@ -24391,11 +14892,13 @@ test -d src/$TARGETDIR || mkdir src/$TARGETDIR
done # for ac_tag
-{ (exit 0); exit 0; }
+as_fn_exit 0
_ACEOF
-chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
+test $ac_write_fail = 0 ||
+ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
@@ -24415,6 +14918,10 @@ if test "$no_create" != yes; then
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
+ $ac_cs_success || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
diff --git a/Modules/_ctypes/libffi/configure.ac b/Modules/_ctypes/libffi/configure.ac
index 947053690e..87c63e12bf 100644
--- a/Modules/_ctypes/libffi/configure.ac
+++ b/Modules/_ctypes/libffi/configure.ac
@@ -3,9 +3,9 @@ dnl Process this with autoconf to create configure
# file from libffi - slightly patched for ctypes
#
-AC_PREREQ(2.59)
+AC_PREREQ(2.63)
-AC_INIT([libffi], [3.0.5], [http://gcc.gnu.org/bugs.html])
+AC_INIT([libffi], [3.0.10rc0], [http://gcc.gnu.org/bugs.html])
AC_CONFIG_HEADERS([fficonfig.h])
AC_CANONICAL_SYSTEM
@@ -23,6 +23,7 @@ AM_INIT_AUTOMAKE
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
m4_define([_AC_ARG_VAR_PRECIOUS],[])
AC_PROG_CC
+m4_undefine([_AC_ARG_VAR_PRECIOUS])
m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
AC_SUBST(CFLAGS)
@@ -30,6 +31,7 @@ AC_SUBST(CFLAGS)
AM_PROG_AS
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
+AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
@@ -52,10 +54,18 @@ case "$host" in
TARGET=ARM; TARGETDIR=arm
;;
- amd64-*-freebsd*)
+ amd64-*-freebsd* | amd64-*-openbsd*)
TARGET=X86_64; TARGETDIR=x86
;;
+ amd64-*-freebsd*)
+ TARGET=X86_64; TARGETDIR=x86
+ ;;
+
+ avr32*-*-*)
+ TARGET=AVR32; TARGETDIR=avr32
+ ;;
+
cris-*-*)
TARGET=LIBFFI_CRIS; TARGETDIR=cris
;;
@@ -74,11 +84,13 @@ case "$host" in
TARGET=PA_HPUX; TARGETDIR=pa
;;
- i386-*-freebsd* | i386-*-openbsd*)
+ i?86-*-freebsd* | i?86-*-openbsd*)
TARGET=X86_FREEBSD; TARGETDIR=x86
;;
i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*)
TARGET=X86_WIN32; TARGETDIR=x86
+ # All mingw/cygwin/win32 builds require this for sharedlib
+ AM_LTLDFLAGS="-no-undefined"
;;
i?86-*-darwin*)
TARGET=X86_DARWIN; TARGETDIR=x86
@@ -109,7 +121,9 @@ case "$host" in
TARGET=MIPS_IRIX; TARGETDIR=mips
;;
mips*-*-linux*)
- TARGET=MIPS_LINUX; TARGETDIR=mips
+ # Support 128-bit long double for NewABI.
+ HAVE_LONG_DOUBLE='defined(__mips64)'
+ TARGET=MIPS_IRIX; TARGETDIR=mips
;;
powerpc*-*-linux* | powerpc-*-sysv*)
@@ -149,14 +163,18 @@ case "$host" in
x86_64-*-darwin*)
TARGET=X86_DARWIN; TARGETDIR=x86
;;
+
x86_64-*-cygwin* | x86_64-*-mingw*)
+ TARGET=X86_WIN64; TARGETDIR=x86
;;
+
x86_64-*-*)
TARGET=X86_64; TARGETDIR=x86
;;
esac
AC_SUBST(AM_RUNTESTFLAGS)
+AC_SUBST(AM_LTLDFLAGS)
if test $TARGETDIR = unknown; then
AC_MSG_ERROR(["libffi has not been ported to $host."])
@@ -167,6 +185,7 @@ AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
AM_CONDITIONAL(X86, test x$TARGET = xX86)
AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD)
AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
+AM_CONDITIONAL(X86_WIN64, test x$TARGET = xX86_WIN64)
AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN)
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
@@ -177,6 +196,7 @@ AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
AM_CONDITIONAL(POWERPC_FREEBSD, test x$TARGET = xPOWERPC_FREEBSD)
AM_CONDITIONAL(ARM, test x$TARGET = xARM)
+AM_CONDITIONAL(AVR32, test x$TARGET = xAVR32)
AM_CONDITIONAL(LIBFFI_CRIS, test x$TARGET = xLIBFFI_CRIS)
AM_CONDITIONAL(FRV, test x$TARGET = xFRV)
AM_CONDITIONAL(S390, test x$TARGET = xS390)
@@ -251,6 +271,29 @@ if test x$TARGET = xSPARC; then
fi
fi
+if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
+ AC_CACHE_CHECK([assembler supports pc related relocs],
+ libffi_cv_as_x86_pcrel, [
+ libffi_cv_as_x86_pcrel=yes
+ echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
+ if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
+ libffi_cv_as_x86_pcrel=no
+ fi
+ ])
+ if test "x$libffi_cv_as_x86_pcrel" = xyes; then
+ AC_DEFINE(HAVE_AS_X86_PCREL, 1,
+ [Define if your assembler supports PC relative relocs.])
+ fi
+fi
+
+case "$target" in
+ *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
+ AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
+ [Cannot use malloc on this target, so, we revert to
+ alternative means])
+ ;;
+esac
+
AC_CACHE_CHECK([whether .eh_frame section should be read-only],
libffi_cv_ro_eh_frame, [
libffi_cv_ro_eh_frame=no
@@ -366,7 +409,7 @@ test -d src/$TARGETDIR || mkdir src/$TARGETDIR
AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
-AC_CONFIG_FILES(include/ffi.h)
+AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h)
diff --git a/Modules/_ctypes/libffi/depcomp b/Modules/_ctypes/libffi/depcomp
new file mode 100755
index 0000000000..ca5ea4e1ef
--- /dev/null
+++ b/Modules/_ctypes/libffi/depcomp
@@ -0,0 +1,584 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2006-10-15.18
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+ stat=$?
+
+ if test -f "$tmpdepfile"; then :
+ else
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
+ tmpdepfile="$stripped.u"
+ fi
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ outname="$stripped.o"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/Modules/_ctypes/libffi/doc/libffi.info b/Modules/_ctypes/libffi/doc/libffi.info
new file mode 100644
index 0000000000..896a5ec0f1
--- /dev/null
+++ b/Modules/_ctypes/libffi/doc/libffi.info
@@ -0,0 +1,591 @@
+This is ../libffi/doc/libffi.info, produced by makeinfo version 4.13
+from ../libffi/doc/libffi.texi.
+
+This manual is for Libffi, a portable foreign-function interface
+library.
+
+ Copyright (C) 2008, 2010 Red Hat, Inc.
+
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or
+ (at your option) any later version. A copy of the license is
+ included in the section entitled "GNU General Public License".
+
+
+INFO-DIR-SECTION Development
+START-INFO-DIR-ENTRY
+* libffi: (libffi). Portable foreign-function interface library.
+END-INFO-DIR-ENTRY
+
+
+File: libffi.info, Node: Top, Next: Introduction, Up: (dir)
+
+libffi
+******
+
+This manual is for Libffi, a portable foreign-function interface
+library.
+
+ Copyright (C) 2008, 2010 Red Hat, Inc.
+
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or
+ (at your option) any later version. A copy of the license is
+ included in the section entitled "GNU General Public License".
+
+
+* Menu:
+
+* Introduction:: What is libffi?
+* Using libffi:: How to use libffi.
+* Missing Features:: Things libffi can't do.
+* Index:: Index.
+
+
+File: libffi.info, Node: Introduction, Next: Using libffi, Prev: Top, Up: Top
+
+1 What is libffi?
+*****************
+
+Compilers for high level languages generate code that follow certain
+conventions. These conventions are necessary, in part, for separate
+compilation to work. One such convention is the "calling convention".
+The calling convention is a set of assumptions made by the compiler
+about where function arguments will be found on entry to a function. A
+calling convention also specifies where the return value for a function
+is found. The calling convention is also sometimes called the "ABI" or
+"Application Binary Interface".
+
+ Some programs may not know at the time of compilation what arguments
+are to be passed to a function. For instance, an interpreter may be
+told at run-time about the number and types of arguments used to call a
+given function. `Libffi' can be used in such programs to provide a
+bridge from the interpreter program to compiled code.
+
+ The `libffi' library provides a portable, high level programming
+interface to various calling conventions. This allows a programmer to
+call any function specified by a call interface description at run time.
+
+ FFI stands for Foreign Function Interface. A foreign function
+interface is the popular name for the interface that allows code
+written in one language to call code written in another language. The
+`libffi' library really only provides the lowest, machine dependent
+layer of a fully featured foreign function interface. A layer must
+exist above `libffi' that handles type conversions for values passed
+between the two languages.
+
+
+File: libffi.info, Node: Using libffi, Next: Missing Features, Prev: Introduction, Up: Top
+
+2 Using libffi
+**************
+
+* Menu:
+
+* The Basics:: The basic libffi API.
+* Simple Example:: A simple example.
+* Types:: libffi type descriptions.
+* Multiple ABIs:: Different passing styles on one platform.
+* The Closure API:: Writing a generic function.
+* Closure Example:: A closure example.
+
+
+File: libffi.info, Node: The Basics, Next: Simple Example, Up: Using libffi
+
+2.1 The Basics
+==============
+
+`Libffi' assumes that you have a pointer to the function you wish to
+call and that you know the number and types of arguments to pass it, as
+well as the return type of the function.
+
+ The first thing you must do is create an `ffi_cif' object that
+matches the signature of the function you wish to call. This is a
+separate step because it is common to make multiple calls using a
+single `ffi_cif'. The "cif" in `ffi_cif' stands for Call InterFace.
+To prepare a call interface object, use the function `ffi_prep_cif'.
+
+ -- Function: ffi_status ffi_prep_cif (ffi_cif *CIF, ffi_abi ABI,
+ unsigned int NARGS, ffi_type *RTYPE, ffi_type **ARGTYPES)
+ This initializes CIF according to the given parameters.
+
+ ABI is the ABI to use; normally `FFI_DEFAULT_ABI' is what you
+ want. *note Multiple ABIs:: for more information.
+
+ NARGS is the number of arguments that this function accepts.
+ `libffi' does not yet handle varargs functions; see *note Missing
+ Features:: for more information.
+
+ RTYPE is a pointer to an `ffi_type' structure that describes the
+ return type of the function. *Note Types::.
+
+ ARGTYPES is a vector of `ffi_type' pointers. ARGTYPES must have
+ NARGS elements. If NARGS is 0, this argument is ignored.
+
+ `ffi_prep_cif' returns a `libffi' status code, of type
+ `ffi_status'. This will be either `FFI_OK' if everything worked
+ properly; `FFI_BAD_TYPEDEF' if one of the `ffi_type' objects is
+ incorrect; or `FFI_BAD_ABI' if the ABI parameter is invalid.
+
+ To call a function using an initialized `ffi_cif', use the
+`ffi_call' function:
+
+ -- Function: void ffi_call (ffi_cif *CIF, void *FN, void *RVALUE, void
+ **AVALUES)
+ This calls the function FN according to the description given in
+ CIF. CIF must have already been prepared using `ffi_prep_cif'.
+
+ RVALUE is a pointer to a chunk of memory that will hold the result
+ of the function call. This must be large enough to hold the
+ result and must be suitably aligned; it is the caller's
+ responsibility to ensure this. If CIF declares that the function
+ returns `void' (using `ffi_type_void'), then RVALUE is ignored.
+ If RVALUE is `NULL', then the return value is discarded.
+
+ AVALUES is a vector of `void *' pointers that point to the memory
+ locations holding the argument values for a call. If CIF declares
+ that the function has no arguments (i.e., NARGS was 0), then
+ AVALUES is ignored.
+
+
+File: libffi.info, Node: Simple Example, Next: Types, Prev: The Basics, Up: Using libffi
+
+2.2 Simple Example
+==================
+
+Here is a trivial example that calls `puts' a few times.
+
+ #include <stdio.h>
+ #include <ffi.h>
+
+ int main()
+ {
+ ffi_cif cif;
+ ffi_type *args[1];
+ void *values[1];
+ char *s;
+ int rc;
+
+ /* Initialize the argument info vectors */
+ args[0] = &ffi_type_pointer;
+ values[0] = &s;
+
+ /* Initialize the cif */
+ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_uint, args) == FFI_OK)
+ {
+ s = "Hello World!";
+ ffi_call(&cif, puts, &rc, values);
+ /* rc now holds the result of the call to puts */
+
+ /* values holds a pointer to the function's arg, so to
+ call puts() again all we need to do is change the
+ value of s */
+ s = "This is cool!";
+ ffi_call(&cif, puts, &rc, values);
+ }
+
+ return 0;
+ }
+
+
+File: libffi.info, Node: Types, Next: Multiple ABIs, Prev: Simple Example, Up: Using libffi
+
+2.3 Types
+=========
+
+* Menu:
+
+* Primitive Types:: Built-in types.
+* Structures:: Structure types.
+* Type Example:: Structure type example.
+
+
+File: libffi.info, Node: Primitive Types, Next: Structures, Up: Types
+
+2.3.1 Primitive Types
+---------------------
+
+`Libffi' provides a number of built-in type descriptors that can be
+used to describe argument and return types:
+
+`ffi_type_void'
+ The type `void'. This cannot be used for argument types, only for
+ return values.
+
+`ffi_type_uint8'
+ An unsigned, 8-bit integer type.
+
+`ffi_type_sint8'
+ A signed, 8-bit integer type.
+
+`ffi_type_uint16'
+ An unsigned, 16-bit integer type.
+
+`ffi_type_sint16'
+ A signed, 16-bit integer type.
+
+`ffi_type_uint32'
+ An unsigned, 32-bit integer type.
+
+`ffi_type_sint32'
+ A signed, 32-bit integer type.
+
+`ffi_type_uint64'
+ An unsigned, 64-bit integer type.
+
+`ffi_type_sint64'
+ A signed, 64-bit integer type.
+
+`ffi_type_float'
+ The C `float' type.
+
+`ffi_type_double'
+ The C `double' type.
+
+`ffi_type_uchar'
+ The C `unsigned char' type.
+
+`ffi_type_schar'
+ The C `signed char' type. (Note that there is not an exact
+ equivalent to the C `char' type in `libffi'; ordinarily you should
+ either use `ffi_type_schar' or `ffi_type_uchar' depending on
+ whether `char' is signed.)
+
+`ffi_type_ushort'
+ The C `unsigned short' type.
+
+`ffi_type_sshort'
+ The C `short' type.
+
+`ffi_type_uint'
+ The C `unsigned int' type.
+
+`ffi_type_sint'
+ The C `int' type.
+
+`ffi_type_ulong'
+ The C `unsigned long' type.
+
+`ffi_type_slong'
+ The C `long' type.
+
+`ffi_type_longdouble'
+ On platforms that have a C `long double' type, this is defined.
+ On other platforms, it is not.
+
+`ffi_type_pointer'
+ A generic `void *' pointer. You should use this for all pointers,
+ regardless of their real type.
+
+ Each of these is of type `ffi_type', so you must take the address
+when passing to `ffi_prep_cif'.
+
+
+File: libffi.info, Node: Structures, Next: Type Example, Prev: Primitive Types, Up: Types
+
+2.3.2 Structures
+----------------
+
+Although `libffi' has no special support for unions or bit-fields, it
+is perfectly happy passing structures back and forth. You must first
+describe the structure to `libffi' by creating a new `ffi_type' object
+for it.
+
+ -- ffi_type:
+ The `ffi_type' has the following members:
+ `size_t size'
+ This is set by `libffi'; you should initialize it to zero.
+
+ `unsigned short alignment'
+ This is set by `libffi'; you should initialize it to zero.
+
+ `unsigned short type'
+ For a structure, this should be set to `FFI_TYPE_STRUCT'.
+
+ `ffi_type **elements'
+ This is a `NULL'-terminated array of pointers to `ffi_type'
+ objects. There is one element per field of the struct.
+
+
+File: libffi.info, Node: Type Example, Prev: Structures, Up: Types
+
+2.3.3 Type Example
+------------------
+
+The following example initializes a `ffi_type' object representing the
+`tm' struct from Linux's `time.h'.
+
+ Here is how the struct is defined:
+
+ 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;
+ /* Those are for future use. */
+ long int __tm_gmtoff__;
+ __const char *__tm_zone__;
+ };
+
+ Here is the corresponding code to describe this struct to `libffi':
+
+ {
+ ffi_type tm_type;
+ ffi_type *tm_type_elements[12];
+ int i;
+
+ tm_type.size = tm_type.alignment = 0;
+ tm_type.elements = &tm_type_elements;
+
+ for (i = 0; i < 9; i++)
+ tm_type_elements[i] = &ffi_type_sint;
+
+ tm_type_elements[9] = &ffi_type_slong;
+ tm_type_elements[10] = &ffi_type_pointer;
+ tm_type_elements[11] = NULL;
+
+ /* tm_type can now be used to represent tm argument types and
+ return types for ffi_prep_cif() */
+ }
+
+
+File: libffi.info, Node: Multiple ABIs, Next: The Closure API, Prev: Types, Up: Using libffi
+
+2.4 Multiple ABIs
+=================
+
+A given platform may provide multiple different ABIs at once. For
+instance, the x86 platform has both `stdcall' and `fastcall' functions.
+
+ `libffi' provides some support for this. However, this is
+necessarily platform-specific.
+
+
+File: libffi.info, Node: The Closure API, Next: Closure Example, Prev: Multiple ABIs, Up: Using libffi
+
+2.5 The Closure API
+===================
+
+`libffi' also provides a way to write a generic function - a function
+that can accept and decode any combination of arguments. This can be
+useful when writing an interpreter, or to provide wrappers for
+arbitrary functions.
+
+ This facility is called the "closure API". Closures are not
+supported on all platforms; you can check the `FFI_CLOSURES' define to
+determine whether they are supported on the current platform.
+
+ Because closures work by assembling a tiny function at runtime, they
+require special allocation on platforms that have a non-executable
+heap. Memory management for closures is handled by a pair of functions:
+
+ -- Function: void *ffi_closure_alloc (size_t SIZE, void **CODE)
+ Allocate a chunk of memory holding SIZE bytes. This returns a
+ pointer to the writable address, and sets *CODE to the
+ corresponding executable address.
+
+ SIZE should be sufficient to hold a `ffi_closure' object.
+
+ -- Function: void ffi_closure_free (void *WRITABLE)
+ Free memory allocated using `ffi_closure_alloc'. The argument is
+ the writable address that was returned.
+
+ Once you have allocated the memory for a closure, you must construct
+a `ffi_cif' describing the function call. Finally you can prepare the
+closure function:
+
+ -- Function: ffi_status ffi_prep_closure_loc (ffi_closure *CLOSURE,
+ ffi_cif *CIF, void (*FUN) (ffi_cif *CIF, void *RET, void
+ **ARGS, void *USER_DATA), void *USER_DATA, void *CODELOC)
+ Prepare a closure function.
+
+ CLOSURE is the address of a `ffi_closure' object; this is the
+ writable address returned by `ffi_closure_alloc'.
+
+ CIF is the `ffi_cif' describing the function parameters.
+
+ USER_DATA is an arbitrary datum that is passed, uninterpreted, to
+ your closure function.
+
+ CODELOC is the executable address returned by `ffi_closure_alloc'.
+
+ FUN is the function which will be called when the closure is
+ invoked. It is called with the arguments:
+ CIF
+ The `ffi_cif' passed to `ffi_prep_closure_loc'.
+
+ RET
+ A pointer to the memory used for the function's return value.
+ FUN must fill this, unless the function is declared as
+ returning `void'.
+
+ ARGS
+ A vector of pointers to memory holding the arguments to the
+ function.
+
+ USER_DATA
+ The same USER_DATA that was passed to `ffi_prep_closure_loc'.
+
+ `ffi_prep_closure_loc' will return `FFI_OK' if everything went ok,
+ and something else on error.
+
+ After calling `ffi_prep_closure_loc', you can cast CODELOC to the
+ appropriate pointer-to-function type.
+
+ You may see old code referring to `ffi_prep_closure'. This function
+is deprecated, as it cannot handle the need for separate writable and
+executable addresses.
+
+
+File: libffi.info, Node: Closure Example, Prev: The Closure API, Up: Using libffi
+
+2.6 Closure Example
+===================
+
+A trivial example that creates a new `puts' by binding `fputs' with
+`stdin'.
+
+ #include <stdio.h>
+ #include <ffi.h>
+
+ /* Acts like puts with the file given at time of enclosure. */
+ void puts_binding(ffi_cif *cif, unsigned int *ret, void* args[],
+ FILE *stream)
+ {
+ *ret = fputs(*(char **)args[0], stream);
+ }
+
+ int main()
+ {
+ ffi_cif cif;
+ ffi_type *args[1];
+ ffi_closure *closure;
+
+ int (*bound_puts)(char *);
+ int rc;
+
+ /* Allocate closure and bound_puts */
+ closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
+
+ if (closure)
+ {
+ /* Initialize the argument info vectors */
+ args[0] = &ffi_type_pointer;
+
+ /* Initialize the cif */
+ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_uint, args) == FFI_OK)
+ {
+ /* Initialize the closure, setting stream to stdout */
+ if (ffi_prep_closure_loc(closure, &cif, puts_binding,
+ stdout, bound_puts) == FFI_OK)
+ {
+ rc = bound_puts("Hello World!");
+ /* rc now holds the result of the call to fputs */
+ }
+ }
+ }
+
+ /* Deallocate both closure, and bound_puts */
+ ffi_closure_free(closure);
+
+ return 0;
+ }
+
+
+File: libffi.info, Node: Missing Features, Next: Index, Prev: Using libffi, Up: Top
+
+3 Missing Features
+******************
+
+`libffi' is missing a few features. We welcome patches to add support
+for these.
+
+ * There is no support for calling varargs functions. This may work
+ on some platforms, depending on how the ABI is defined, but it is
+ not reliable.
+
+ * There is no support for bit fields in structures.
+
+ * The closure API is
+
+ * The "raw" API is undocumented.
+
+
+File: libffi.info, Node: Index, Prev: Missing Features, Up: Top
+
+Index
+*****
+
+
+* Menu:
+
+* : Structures. (line 12)
+* ABI: Introduction. (line 13)
+* Application Binary Interface: Introduction. (line 13)
+* calling convention: Introduction. (line 13)
+* cif: The Basics. (line 14)
+* closure API: The Closure API. (line 13)
+* closures: The Closure API. (line 13)
+* FFI: Introduction. (line 31)
+* ffi_call: The Basics. (line 41)
+* ffi_closure_alloca: The Closure API. (line 19)
+* ffi_closure_free: The Closure API. (line 26)
+* FFI_CLOSURES: The Closure API. (line 13)
+* ffi_prep_cif: The Basics. (line 16)
+* ffi_prep_closure_loc: The Closure API. (line 34)
+* ffi_status <1>: The Closure API. (line 37)
+* ffi_status: The Basics. (line 18)
+* ffi_type: Structures. (line 11)
+* ffi_type_double: Primitive Types. (line 41)
+* ffi_type_float: Primitive Types. (line 38)
+* ffi_type_longdouble: Primitive Types. (line 71)
+* ffi_type_pointer: Primitive Types. (line 75)
+* ffi_type_schar: Primitive Types. (line 47)
+* ffi_type_sint: Primitive Types. (line 62)
+* ffi_type_sint16: Primitive Types. (line 23)
+* ffi_type_sint32: Primitive Types. (line 29)
+* ffi_type_sint64: Primitive Types. (line 35)
+* ffi_type_sint8: Primitive Types. (line 17)
+* ffi_type_slong: Primitive Types. (line 68)
+* ffi_type_sshort: Primitive Types. (line 56)
+* ffi_type_uchar: Primitive Types. (line 44)
+* ffi_type_uint: Primitive Types. (line 59)
+* ffi_type_uint16: Primitive Types. (line 20)
+* ffi_type_uint32: Primitive Types. (line 26)
+* ffi_type_uint64: Primitive Types. (line 32)
+* ffi_type_uint8: Primitive Types. (line 14)
+* ffi_type_ulong: Primitive Types. (line 65)
+* ffi_type_ushort: Primitive Types. (line 53)
+* ffi_type_void: Primitive Types. (line 10)
+* Foreign Function Interface: Introduction. (line 31)
+* void <1>: The Closure API. (line 20)
+* void: The Basics. (line 43)
+
+
+
+Tag Table:
+Node: Top706
+Node: Introduction1448
+Node: Using libffi3084
+Node: The Basics3570
+Node: Simple Example6177
+Node: Types7204
+Node: Primitive Types7487
+Node: Structures9307
+Node: Type Example10167
+Node: Multiple ABIs11390
+Node: The Closure API11761
+Node: Closure Example14705
+Node: Missing Features16264
+Node: Index16757
+
+End Tag Table
diff --git a/Modules/_ctypes/libffi/doc/libffi.texi b/Modules/_ctypes/libffi/doc/libffi.texi
new file mode 100644
index 0000000000..9fa5b17c4e
--- /dev/null
+++ b/Modules/_ctypes/libffi/doc/libffi.texi
@@ -0,0 +1,598 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename libffi.info
+@settitle libffi
+@setchapternewpage off
+@c %**end of header
+
+@c Merge the standard indexes into a single one.
+@syncodeindex fn cp
+@syncodeindex vr cp
+@syncodeindex ky cp
+@syncodeindex pg cp
+@syncodeindex tp cp
+
+@include version.texi
+
+@copying
+
+This manual is for Libffi, a portable foreign-function interface
+library.
+
+Copyright @copyright{} 2008, 2010 Red Hat, Inc.
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version. A copy of the license is included in the
+section entitled ``GNU General Public License''.
+
+@end quotation
+@end copying
+
+@dircategory Development
+@direntry
+* libffi: (libffi). Portable foreign-function interface library.
+@end direntry
+
+@titlepage
+@title Libffi
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+
+@ifnottex
+@node Top
+@top libffi
+
+@insertcopying
+
+@menu
+* Introduction:: What is libffi?
+* Using libffi:: How to use libffi.
+* Missing Features:: Things libffi can't do.
+* Index:: Index.
+@end menu
+
+@end ifnottex
+
+
+@node Introduction
+@chapter What is libffi?
+
+Compilers for high level languages generate code that follow certain
+conventions. These conventions are necessary, in part, for separate
+compilation to work. One such convention is the @dfn{calling
+convention}. The calling convention is a set of assumptions made by
+the compiler about where function arguments will be found on entry to
+a function. A calling convention also specifies where the return
+value for a function is found. The calling convention is also
+sometimes called the @dfn{ABI} or @dfn{Application Binary Interface}.
+@cindex calling convention
+@cindex ABI
+@cindex Application Binary Interface
+
+Some programs may not know at the time of compilation what arguments
+are to be passed to a function. For instance, an interpreter may be
+told at run-time about the number and types of arguments used to call
+a given function. @samp{Libffi} can be used in such programs to
+provide a bridge from the interpreter program to compiled code.
+
+The @samp{libffi} library provides a portable, high level programming
+interface to various calling conventions. This allows a programmer to
+call any function specified by a call interface description at run
+time.
+
+@acronym{FFI} stands for Foreign Function Interface. A foreign
+function interface is the popular name for the interface that allows
+code written in one language to call code written in another language.
+The @samp{libffi} library really only provides the lowest, machine
+dependent layer of a fully featured foreign function interface. A
+layer must exist above @samp{libffi} that handles type conversions for
+values passed between the two languages.
+@cindex FFI
+@cindex Foreign Function Interface
+
+
+@node Using libffi
+@chapter Using libffi
+
+@menu
+* The Basics:: The basic libffi API.
+* Simple Example:: A simple example.
+* Types:: libffi type descriptions.
+* Multiple ABIs:: Different passing styles on one platform.
+* The Closure API:: Writing a generic function.
+* Closure Example:: A closure example.
+@end menu
+
+
+@node The Basics
+@section The Basics
+
+@samp{Libffi} assumes that you have a pointer to the function you wish
+to call and that you know the number and types of arguments to pass
+it, as well as the return type of the function.
+
+The first thing you must do is create an @code{ffi_cif} object that
+matches the signature of the function you wish to call. This is a
+separate step because it is common to make multiple calls using a
+single @code{ffi_cif}. The @dfn{cif} in @code{ffi_cif} stands for
+Call InterFace. To prepare a call interface object, use the function
+@code{ffi_prep_cif}.
+@cindex cif
+
+@findex ffi_prep_cif
+@defun ffi_status ffi_prep_cif (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes})
+This initializes @var{cif} according to the given parameters.
+
+@var{abi} is the ABI to use; normally @code{FFI_DEFAULT_ABI} is what
+you want. @ref{Multiple ABIs} for more information.
+
+@var{nargs} is the number of arguments that this function accepts.
+@samp{libffi} does not yet handle varargs functions; see @ref{Missing
+Features} for more information.
+
+@var{rtype} is a pointer to an @code{ffi_type} structure that
+describes the return type of the function. @xref{Types}.
+
+@var{argtypes} is a vector of @code{ffi_type} pointers.
+@var{argtypes} must have @var{nargs} elements. If @var{nargs} is 0,
+this argument is ignored.
+
+@code{ffi_prep_cif} returns a @code{libffi} status code, of type
+@code{ffi_status}. This will be either @code{FFI_OK} if everything
+worked properly; @code{FFI_BAD_TYPEDEF} if one of the @code{ffi_type}
+objects is incorrect; or @code{FFI_BAD_ABI} if the @var{abi} parameter
+is invalid.
+@end defun
+
+
+To call a function using an initialized @code{ffi_cif}, use the
+@code{ffi_call} function:
+
+@findex ffi_call
+@defun void ffi_call (ffi_cif *@var{cif}, void *@var{fn}, void *@var{rvalue}, void **@var{avalues})
+This calls the function @var{fn} according to the description given in
+@var{cif}. @var{cif} must have already been prepared using
+@code{ffi_prep_cif}.
+
+@var{rvalue} is a pointer to a chunk of memory that will hold the
+result of the function call. This must be large enough to hold the
+result and must be suitably aligned; it is the caller's responsibility
+to ensure this. If @var{cif} declares that the function returns
+@code{void} (using @code{ffi_type_void}), then @var{rvalue} is
+ignored. If @var{rvalue} is @samp{NULL}, then the return value is
+discarded.
+
+@var{avalues} is a vector of @code{void *} pointers that point to the
+memory locations holding the argument values for a call. If @var{cif}
+declares that the function has no arguments (i.e., @var{nargs} was 0),
+then @var{avalues} is ignored.
+@end defun
+
+
+@node Simple Example
+@section Simple Example
+
+Here is a trivial example that calls @code{puts} a few times.
+
+@example
+#include <stdio.h>
+#include <ffi.h>
+
+int main()
+@{
+ ffi_cif cif;
+ ffi_type *args[1];
+ void *values[1];
+ char *s;
+ int rc;
+
+ /* Initialize the argument info vectors */
+ args[0] = &ffi_type_pointer;
+ values[0] = &s;
+
+ /* Initialize the cif */
+ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_uint, args) == FFI_OK)
+ @{
+ s = "Hello World!";
+ ffi_call(&cif, puts, &rc, values);
+ /* rc now holds the result of the call to puts */
+
+ /* values holds a pointer to the function's arg, so to
+ call puts() again all we need to do is change the
+ value of s */
+ s = "This is cool!";
+ ffi_call(&cif, puts, &rc, values);
+ @}
+
+ return 0;
+@}
+@end example
+
+
+@node Types
+@section Types
+
+@menu
+* Primitive Types:: Built-in types.
+* Structures:: Structure types.
+* Type Example:: Structure type example.
+@end menu
+
+@node Primitive Types
+@subsection Primitive Types
+
+@code{Libffi} provides a number of built-in type descriptors that can
+be used to describe argument and return types:
+
+@table @code
+@item ffi_type_void
+@tindex ffi_type_void
+The type @code{void}. This cannot be used for argument types, only
+for return values.
+
+@item ffi_type_uint8
+@tindex ffi_type_uint8
+An unsigned, 8-bit integer type.
+
+@item ffi_type_sint8
+@tindex ffi_type_sint8
+A signed, 8-bit integer type.
+
+@item ffi_type_uint16
+@tindex ffi_type_uint16
+An unsigned, 16-bit integer type.
+
+@item ffi_type_sint16
+@tindex ffi_type_sint16
+A signed, 16-bit integer type.
+
+@item ffi_type_uint32
+@tindex ffi_type_uint32
+An unsigned, 32-bit integer type.
+
+@item ffi_type_sint32
+@tindex ffi_type_sint32
+A signed, 32-bit integer type.
+
+@item ffi_type_uint64
+@tindex ffi_type_uint64
+An unsigned, 64-bit integer type.
+
+@item ffi_type_sint64
+@tindex ffi_type_sint64
+A signed, 64-bit integer type.
+
+@item ffi_type_float
+@tindex ffi_type_float
+The C @code{float} type.
+
+@item ffi_type_double
+@tindex ffi_type_double
+The C @code{double} type.
+
+@item ffi_type_uchar
+@tindex ffi_type_uchar
+The C @code{unsigned char} type.
+
+@item ffi_type_schar
+@tindex ffi_type_schar
+The C @code{signed char} type. (Note that there is not an exact
+equivalent to the C @code{char} type in @code{libffi}; ordinarily you
+should either use @code{ffi_type_schar} or @code{ffi_type_uchar}
+depending on whether @code{char} is signed.)
+
+@item ffi_type_ushort
+@tindex ffi_type_ushort
+The C @code{unsigned short} type.
+
+@item ffi_type_sshort
+@tindex ffi_type_sshort
+The C @code{short} type.
+
+@item ffi_type_uint
+@tindex ffi_type_uint
+The C @code{unsigned int} type.
+
+@item ffi_type_sint
+@tindex ffi_type_sint
+The C @code{int} type.
+
+@item ffi_type_ulong
+@tindex ffi_type_ulong
+The C @code{unsigned long} type.
+
+@item ffi_type_slong
+@tindex ffi_type_slong
+The C @code{long} type.
+
+@item ffi_type_longdouble
+@tindex ffi_type_longdouble
+On platforms that have a C @code{long double} type, this is defined.
+On other platforms, it is not.
+
+@item ffi_type_pointer
+@tindex ffi_type_pointer
+A generic @code{void *} pointer. You should use this for all
+pointers, regardless of their real type.
+@end table
+
+Each of these is of type @code{ffi_type}, so you must take the address
+when passing to @code{ffi_prep_cif}.
+
+
+@node Structures
+@subsection Structures
+
+Although @samp{libffi} has no special support for unions or
+bit-fields, it is perfectly happy passing structures back and forth.
+You must first describe the structure to @samp{libffi} by creating a
+new @code{ffi_type} object for it.
+
+@tindex ffi_type
+@deftp ffi_type
+The @code{ffi_type} has the following members:
+@table @code
+@item size_t size
+This is set by @code{libffi}; you should initialize it to zero.
+
+@item unsigned short alignment
+This is set by @code{libffi}; you should initialize it to zero.
+
+@item unsigned short type
+For a structure, this should be set to @code{FFI_TYPE_STRUCT}.
+
+@item ffi_type **elements
+This is a @samp{NULL}-terminated array of pointers to @code{ffi_type}
+objects. There is one element per field of the struct.
+@end table
+@end deftp
+
+
+@node Type Example
+@subsection Type Example
+
+The following example initializes a @code{ffi_type} object
+representing the @code{tm} struct from Linux's @file{time.h}.
+
+Here is how the struct is defined:
+
+@example
+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;
+ /* Those are for future use. */
+ long int __tm_gmtoff__;
+ __const char *__tm_zone__;
+@};
+@end example
+
+Here is the corresponding code to describe this struct to
+@code{libffi}:
+
+@example
+ @{
+ ffi_type tm_type;
+ ffi_type *tm_type_elements[12];
+ int i;
+
+ tm_type.size = tm_type.alignment = 0;
+ tm_type.elements = &tm_type_elements;
+
+ for (i = 0; i < 9; i++)
+ tm_type_elements[i] = &ffi_type_sint;
+
+ tm_type_elements[9] = &ffi_type_slong;
+ tm_type_elements[10] = &ffi_type_pointer;
+ tm_type_elements[11] = NULL;
+
+ /* tm_type can now be used to represent tm argument types and
+ return types for ffi_prep_cif() */
+ @}
+@end example
+
+
+@node Multiple ABIs
+@section Multiple ABIs
+
+A given platform may provide multiple different ABIs at once. For
+instance, the x86 platform has both @samp{stdcall} and @samp{fastcall}
+functions.
+
+@code{libffi} provides some support for this. However, this is
+necessarily platform-specific.
+
+@c FIXME: document the platforms
+
+@node The Closure API
+@section The Closure API
+
+@code{libffi} also provides a way to write a generic function -- a
+function that can accept and decode any combination of arguments.
+This can be useful when writing an interpreter, or to provide wrappers
+for arbitrary functions.
+
+This facility is called the @dfn{closure API}. Closures are not
+supported on all platforms; you can check the @code{FFI_CLOSURES}
+define to determine whether they are supported on the current
+platform.
+@cindex closures
+@cindex closure API
+@findex FFI_CLOSURES
+
+Because closures work by assembling a tiny function at runtime, they
+require special allocation on platforms that have a non-executable
+heap. Memory management for closures is handled by a pair of
+functions:
+
+@findex ffi_closure_alloca
+@defun void *ffi_closure_alloc (size_t @var{size}, void **@var{code})
+Allocate a chunk of memory holding @var{size} bytes. This returns a
+pointer to the writable address, and sets *@var{code} to the
+corresponding executable address.
+
+@var{size} should be sufficient to hold a @code{ffi_closure} object.
+@end defun
+
+@findex ffi_closure_free
+@defun void ffi_closure_free (void *@var{writable})
+Free memory allocated using @code{ffi_closure_alloc}. The argument is
+the writable address that was returned.
+@end defun
+
+
+Once you have allocated the memory for a closure, you must construct a
+@code{ffi_cif} describing the function call. Finally you can prepare
+the closure function:
+
+@findex ffi_prep_closure_loc
+@defun ffi_status ffi_prep_closure_loc (ffi_closure *@var{closure}, ffi_cif *@var{cif}, void (*@var{fun}) (ffi_cif *@var{cif}, void *@var{ret}, void **@var{args}, void *@var{user_data}), void *@var{user_data}, void *@var{codeloc})
+Prepare a closure function.
+
+@var{closure} is the address of a @code{ffi_closure} object; this is
+the writable address returned by @code{ffi_closure_alloc}.
+
+@var{cif} is the @code{ffi_cif} describing the function parameters.
+
+@var{user_data} is an arbitrary datum that is passed, uninterpreted,
+to your closure function.
+
+@var{codeloc} is the executable address returned by
+@code{ffi_closure_alloc}.
+
+@var{fun} is the function which will be called when the closure is
+invoked. It is called with the arguments:
+@table @var
+@item cif
+The @code{ffi_cif} passed to @code{ffi_prep_closure_loc}.
+
+@item ret
+A pointer to the memory used for the function's return value.
+@var{fun} must fill this, unless the function is declared as returning
+@code{void}.
+@c FIXME: is this NULL for void-returning functions?
+
+@item args
+A vector of pointers to memory holding the arguments to the function.
+
+@item user_data
+The same @var{user_data} that was passed to
+@code{ffi_prep_closure_loc}.
+@end table
+
+@code{ffi_prep_closure_loc} will return @code{FFI_OK} if everything
+went ok, and something else on error.
+@c FIXME: what?
+
+After calling @code{ffi_prep_closure_loc}, you can cast @var{codeloc}
+to the appropriate pointer-to-function type.
+@end defun
+
+You may see old code referring to @code{ffi_prep_closure}. This
+function is deprecated, as it cannot handle the need for separate
+writable and executable addresses.
+
+@node Closure Example
+@section Closure Example
+
+A trivial example that creates a new @code{puts} by binding
+@code{fputs} with @code{stdin}.
+
+@example
+#include <stdio.h>
+#include <ffi.h>
+
+/* Acts like puts with the file given at time of enclosure. */
+void puts_binding(ffi_cif *cif, unsigned int *ret, void* args[],
+ FILE *stream)
+@{
+ *ret = fputs(*(char **)args[0], stream);
+@}
+
+int main()
+@{
+ ffi_cif cif;
+ ffi_type *args[1];
+ ffi_closure *closure;
+
+ int (*bound_puts)(char *);
+ int rc;
+
+ /* Allocate closure and bound_puts */
+ closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
+
+ if (closure)
+ @{
+ /* Initialize the argument info vectors */
+ args[0] = &ffi_type_pointer;
+
+ /* Initialize the cif */
+ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_uint, args) == FFI_OK)
+ @{
+ /* Initialize the closure, setting stream to stdout */
+ if (ffi_prep_closure_loc(closure, &cif, puts_binding,
+ stdout, bound_puts) == FFI_OK)
+ @{
+ rc = bound_puts("Hello World!");
+ /* rc now holds the result of the call to fputs */
+ @}
+ @}
+ @}
+
+ /* Deallocate both closure, and bound_puts */
+ ffi_closure_free(closure);
+
+ return 0;
+@}
+
+@end example
+
+
+@node Missing Features
+@chapter Missing Features
+
+@code{libffi} is missing a few features. We welcome patches to add
+support for these.
+
+@itemize @bullet
+@item
+There is no support for calling varargs functions. This may work on
+some platforms, depending on how the ABI is defined, but it is not
+reliable.
+
+@item
+There is no support for bit fields in structures.
+
+@item
+The closure API is
+
+@c FIXME: ...
+
+@item
+The ``raw'' API is undocumented.
+@c argument promotion?
+@c unions?
+@c anything else?
+@end itemize
+
+
+@node Index
+@unnumbered Index
+
+@printindex cp
+
+@bye
diff --git a/Modules/_ctypes/libffi/doc/stamp-vti b/Modules/_ctypes/libffi/doc/stamp-vti
new file mode 100644
index 0000000000..81d0b79d2d
--- /dev/null
+++ b/Modules/_ctypes/libffi/doc/stamp-vti
@@ -0,0 +1,4 @@
+@set UPDATED 14 February 2008
+@set UPDATED-MONTH February 2008
+@set EDITION 3.0.8
+@set VERSION 3.0.8
diff --git a/Modules/_ctypes/libffi/doc/version.texi b/Modules/_ctypes/libffi/doc/version.texi
new file mode 100644
index 0000000000..81d0b79d2d
--- /dev/null
+++ b/Modules/_ctypes/libffi/doc/version.texi
@@ -0,0 +1,4 @@
+@set UPDATED 14 February 2008
+@set UPDATED-MONTH February 2008
+@set EDITION 3.0.8
+@set VERSION 3.0.8
diff --git a/Modules/_ctypes/libffi/fficonfig.h.in b/Modules/_ctypes/libffi/fficonfig.h.in
index 07fa53787d..e03bbf90b2 100644
--- a/Modules/_ctypes/libffi/fficonfig.h.in
+++ b/Modules/_ctypes/libffi/fficonfig.h.in
@@ -1,5 +1,8 @@
/* fficonfig.h.in. Generated from configure.ac by autoheader. */
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
@@ -14,6 +17,9 @@
/* Define this if you want extra debugging. */
#undef FFI_DEBUG
+/* Cannot use malloc on this target, so, we revert to alternative means */
+#undef FFI_MMAP_EXEC_WRIT
+
/* Define this is you do not want support for the raw API. */
#undef FFI_NO_RAW_API
@@ -37,6 +43,9 @@
*/
#undef HAVE_AS_SPARC_UA_PCREL
+/* Define if your assembler supports PC relative relocs. */
+#undef HAVE_AS_X86_PCREL
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -94,6 +103,10 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
@@ -112,6 +125,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@@ -139,9 +155,17 @@
/* Version number of package */
#undef VERSION
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
diff --git a/Modules/_ctypes/libffi/fficonfig.py.in b/Modules/_ctypes/libffi/fficonfig.py.in
index 1029327358..27c971f86f 100644
--- a/Modules/_ctypes/libffi/fficonfig.py.in
+++ b/Modules/_ctypes/libffi/fficonfig.py.in
@@ -1,12 +1,14 @@
ffi_sources = """
src/prep_cif.c
+src/closures.c
+src/dlmalloc.c
""".split()
ffi_platforms = {
'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'],
'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'],
'X86': ['src/x86/ffi.c', 'src/x86/sysv.S'],
- 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/sysv.S'],
+ 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'],
'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'],
'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'],
'ALPHA': ['src/alpha/ffi.c', 'src/alpha/osf.S'],
@@ -28,8 +30,6 @@ ffi_platforms = {
'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'],
}
-ffi_srcdir = '@srcdir@'
ffi_sources += ffi_platforms['@TARGET@']
-ffi_sources = [os.path.join('@srcdir@', f) for f in ffi_sources]
ffi_cflags = '@CFLAGS@'
diff --git a/Modules/_ctypes/libffi/include/Makefile.am b/Modules/_ctypes/libffi/include/Makefile.am
index 6b71318cf0..fd28024973 100644
--- a/Modules/_ctypes/libffi/include/Makefile.am
+++ b/Modules/_ctypes/libffi/include/Makefile.am
@@ -6,4 +6,4 @@ DISTCLEANFILES=ffitarget.h
EXTRA_DIST=ffi.h.in ffi_common.h
includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
-nodist_includes_HEADERS = ffi.h ffitarget.h
+nodist_includes_HEADERS = ffi.h ffitarget.h
diff --git a/Modules/_ctypes/libffi/include/Makefile.in b/Modules/_ctypes/libffi/include/Makefile.in
index f0c9fe259c..136f36cdb4 100644
--- a/Modules/_ctypes/libffi/include/Makefile.in
+++ b/Modules/_ctypes/libffi/include/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,8 +17,9 @@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -41,9 +43,10 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/fficonfig.h
CONFIG_CLEAN_FILES = ffi.h ffitarget.h
+CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -51,9 +54,23 @@ am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(includesdir)"
-nodist_includesHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(nodist_includes_HEADERS)
ETAGS = etags
CTAGS = ctags
@@ -75,21 +92,17 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
GREP = @GREP@
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
INSTALL = @INSTALL@
@@ -97,16 +110,23 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -127,8 +147,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -159,6 +178,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -177,13 +197,14 @@ target_os = @target_os@
target_vendor = @target_vendor@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
DISTCLEANFILES = ffitarget.h
EXTRA_DIST = ffi.h.in ffi_common.h
includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
-nodist_includes_HEADERS = ffi.h ffitarget.h
+nodist_includes_HEADERS = ffi.h ffitarget.h
all: all-am
.SUFFIXES:
@@ -191,14 +212,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign include/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -216,6 +237,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
ffi.h: $(top_builddir)/config.status $(srcdir)/ffi.h.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
@@ -227,65 +249,72 @@ clean-libtool:
install-nodist_includesHEADERS: $(nodist_includes_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)"
- @list='$(nodist_includes_HEADERS)'; for p in $$list; do \
+ @list='$(nodist_includes_HEADERS)'; test -n "$(includesdir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(nodist_includesHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includesdir)/$$f'"; \
- $(nodist_includesHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includesdir)/$$f"; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
done
uninstall-nodist_includesHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(nodist_includes_HEADERS)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(includesdir)/$$f'"; \
- rm -f "$(DESTDIR)$(includesdir)/$$f"; \
- done
+ @list='$(nodist_includes_HEADERS)'; test -n "$(includesdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(includesdir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -306,13 +335,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -343,6 +376,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@@ -362,6 +396,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -370,18 +406,28 @@ install-data-am: install-nodist_includesHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -417,6 +463,7 @@ uninstall-am: uninstall-nodist_includesHEADERS
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-nodist_includesHEADERS
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/Modules/_ctypes/libffi/include/ffi.h.in b/Modules/_ctypes/libffi/include/ffi.h.in
index 7df3b06e15..df7d2cd78b 100644
--- a/Modules/_ctypes/libffi/include/ffi.h.in
+++ b/Modules/_ctypes/libffi/include/ffi.h.in
@@ -57,9 +57,7 @@ extern "C" {
#endif
/* Specify which architecture libffi is configured for. */
-#ifndef @TARGET@
#define @TARGET@
-#endif
/* ---- System configuration information --------------------------------- */
@@ -67,6 +65,10 @@ extern "C" {
#ifndef LIBFFI_ASM
+#ifdef _MSC_VER
+#define __attribute__(X)
+#endif
+
#include <stddef.h>
#include <limits.h>
@@ -249,12 +251,19 @@ size_t ffi_java_raw_size (ffi_cif *cif);
#if FFI_CLOSURES
+#ifdef _MSC_VER
+__declspec(align(8))
+#endif
typedef struct {
char tramp[FFI_TRAMPOLINE_SIZE];
ffi_cif *cif;
void (*fun)(ffi_cif*,void*,void**,void*);
void *user_data;
+#ifdef __GNUC__
} ffi_closure __attribute__((aligned (8)));
+#else
+} ffi_closure;
+#endif
void *ffi_closure_alloc (size_t size, void **code);
void ffi_closure_free (void *);
diff --git a/Modules/_ctypes/libffi/include/ffi_common.h b/Modules/_ctypes/libffi/include/ffi_common.h
index 6af4b5f21f..42cace9150 100644
--- a/Modules/_ctypes/libffi/include/ffi_common.h
+++ b/Modules/_ctypes/libffi/include/ffi_common.h
@@ -18,7 +18,10 @@ extern "C" {
/* Do not move this. Some versions of AIX are very picky about where
this is positioned. */
#ifdef __GNUC__
+/* mingw64 defines this already in malloc.h. */
+#ifndef alloca
# define alloca __builtin_alloca
+#endif
# define MAYBE_UNUSED __attribute__((__unused__))
#else
# define MAYBE_UNUSED
@@ -29,7 +32,11 @@ extern "C" {
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
+# ifdef _MSC_VER
+# define alloca _alloca
+# else
char *alloca ();
+# endif
# endif
# endif
# endif
@@ -77,6 +84,22 @@ typedef struct
} extended_cif;
/* Terse sized type definitions. */
+#if defined(_MSC_VER) || defined(__sgi)
+typedef unsigned char UINT8;
+typedef signed char SINT8;
+typedef unsigned short UINT16;
+typedef signed short SINT16;
+typedef unsigned int UINT32;
+typedef signed int SINT32;
+# ifdef _MSC_VER
+typedef unsigned __int64 UINT64;
+typedef signed __int64 SINT64;
+# else
+# include <inttypes.h>
+typedef uint64_t UINT64;
+typedef int64_t SINT64;
+# endif
+#else
typedef unsigned int UINT8 __attribute__((__mode__(__QI__)));
typedef signed int SINT8 __attribute__((__mode__(__QI__)));
typedef unsigned int UINT16 __attribute__((__mode__(__HI__)));
@@ -85,6 +108,7 @@ typedef unsigned int UINT32 __attribute__((__mode__(__SI__)));
typedef signed int SINT32 __attribute__((__mode__(__SI__)));
typedef unsigned int UINT64 __attribute__((__mode__(__DI__)));
typedef signed int SINT64 __attribute__((__mode__(__DI__)));
+#endif
typedef float FLOAT32;
diff --git a/Modules/_ctypes/libffi/libffi.pc.in b/Modules/_ctypes/libffi/libffi.pc.in
new file mode 100644
index 0000000000..c2e1c7b33c
--- /dev/null
+++ b/Modules/_ctypes/libffi/libffi.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+
+Name: @PACKAGE_NAME@
+Description: Library supporting Foreign Function Interfaces
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lffi
+Cflags: -I${includedir}
diff --git a/Modules/_ctypes/libffi/libtool-version b/Modules/_ctypes/libffi/libtool-version
new file mode 100644
index 0000000000..b8b80e09ac
--- /dev/null
+++ b/Modules/_ctypes/libffi/libtool-version
@@ -0,0 +1,29 @@
+# This file is used to maintain libtool version info for libffi. See
+# the libtool manual to understand the meaning of the fields. This is
+# a separate file so that version updates don't involve re-running
+# automake.
+#
+# Here are a set of rules to help you update your library version
+# information:
+#
+# 1. Start with version information of `0:0:0' for each libtool library.
+#
+# 2. Update the version information only immediately before a public
+# release of your software. More frequent updates are unnecessary,
+# and only guarantee that the current interface number gets larger
+# faster.
+#
+# 3. If the library source code has changed at all since the last
+# update, then increment revision (`c:r:a' becomes `c:r+1:a').
+#
+# 4. If any interfaces have been added, removed, or changed since the
+# last update, increment current, and set revision to 0.
+#
+# 5. If any interfaces have been added since the last public release,
+# then increment age.
+#
+# 6. If any interfaces have been removed since the last public
+# release, then set age to 0.
+#
+# CURRENT:REVISION:AGE
+5:10:0
diff --git a/Modules/_ctypes/libffi/ltmain.sh b/Modules/_ctypes/libffi/ltmain.sh
new file mode 100755
index 0000000000..6939dcc4a6
--- /dev/null
+++ b/Modules/_ctypes/libffi/ltmain.sh
@@ -0,0 +1,8406 @@
+# Generated from ltmain.m4sh.
+
+# ltmain.sh (GNU libtool) 2.2.6
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print informational messages (default)
+# --version print version information
+# -h, --help print short or long help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.2.6
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=2.2.6
+TIMESTAMP=""
+package_revision=1.3012
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# NLS nuisances: We save the old values to restore during execute mode.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+
+$lt_unset CDPATH
+
+
+
+
+
+: ${CP="cp -f"}
+: ${ECHO="echo"}
+: ${EGREP="/bin/grep -E"}
+: ${FGREP="/bin/grep -F"}
+: ${GREP="/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/bin/sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+# Generated shell functions inserted here.
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+# In the unlikely event $progname began with a '-', it would play havoc with
+# func_echo (imagine progname=-n), so we prepend ./ in that case:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+case $progname in
+ -*) progname=./$progname ;;
+esac
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=:
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname${mode+: }$mode: $*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "X$my_tmpdir" | $Xsed
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "X$1" | $Xsed \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $SED -n '/^# Usage:/,/# -h/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ $ECHO
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ func_error "missing argument for $1"
+ exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+# Check that we have a working $ECHO.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell, and then maybe $ECHO will work.
+ exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit $EXIT_SUCCESS
+fi
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ $ECHO "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $ECHO "enable shared libraries"
+ else
+ $ECHO "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $ECHO "enable static libraries"
+ else
+ $ECHO "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# Parse options once, thoroughly. This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
+
+ # Shorthand for --mode=foo, only valid as the first argument
+ case $1 in
+ clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+ compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+ execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+ finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+ link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+ esac
+
+ # Parse non-mode specific arguments:
+ while test "$#" -gt 0; do
+ opt="$1"
+ shift
+
+ case $opt in
+ --config) func_config ;;
+
+ --debug) preserve_args="$preserve_args $opt"
+ func_echo "enabling shell trace mode"
+ opt_debug='set -x'
+ $opt_debug
+ ;;
+
+ -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ execute_dlfiles="$execute_dlfiles $1"
+ shift
+ ;;
+
+ --dry-run | -n) opt_dry_run=: ;;
+ --features) func_features ;;
+ --finish) mode="finish" ;;
+
+ --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ case $1 in
+ # Valid mode arguments:
+ clean) ;;
+ compile) ;;
+ execute) ;;
+ finish) ;;
+ install) ;;
+ link) ;;
+ relink) ;;
+ uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+ esac
+
+ mode="$1"
+ shift
+ ;;
+
+ --preserve-dup-deps)
+ opt_duplicate_deps=: ;;
+
+ --quiet|--silent) preserve_args="$preserve_args $opt"
+ opt_silent=:
+ ;;
+
+ --verbose| -v) preserve_args="$preserve_args $opt"
+ opt_silent=false
+ ;;
+
+ --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ preserve_args="$preserve_args $opt $1"
+ func_enable_tag "$1" # tagname is set here
+ shift
+ ;;
+
+ # Separate optargs to long options:
+ -dlopen=*|--mode=*|--tag=*)
+ func_opt_split "$opt"
+ set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) opt_help=: ;;
+ --version) func_version ;;
+
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+
+ *) nonopt="$opt"
+ break
+ ;;
+ esac
+ done
+
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+ ;;
+ esac
+
+ # Having warned about all mis-specified options, bail out if
+ # anything was wrong.
+ $exit_cmd $EXIT_FAILURE
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+$opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$mode' for more information."
+}
+
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_ltwrapper_scriptname_result=""
+ if func_ltwrapper_executable_p "$1"; then
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+ fi
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_quote_for_eval "$arg"
+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ done
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_quote_for_eval "$arg"
+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ done
+ case "$@ " in
+ " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ pie_flag="$pie_flag $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ later="$later $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$arg"
+ lastarg="$lastarg $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_quote_for_eval "$lastarg"
+ base_compile="$base_compile $func_quote_for_eval_result"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ removelist="$removelist $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ removelist="$removelist $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$mode'"
+ ;;
+ esac
+
+ $ECHO
+ $ECHO "Try \`$progname --help' for more information about other modes."
+
+ exit $?
+}
+
+ # Now that we've collected a possible --mode arg, show help if necessary
+ $opt_help && func_mode_help
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_quote_for_eval "$file"
+ args="$args $func_quote_for_eval_result"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ $ECHO "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ $ECHO "X----------------------------------------------------------------------" | $Xsed
+ $ECHO "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ $ECHO
+ $ECHO "If you ever happen to want to link against installed libraries"
+ $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
+ $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $ECHO "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $ECHO " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
+ $ECHO " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $ECHO
+
+ $ECHO "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ $ECHO "pages."
+ ;;
+ *)
+ $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ $ECHO "X----------------------------------------------------------------------" | $Xsed
+ exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ install_prog="$install_prog$func_quote_for_eval_result"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ case " $install_prog " in
+ *[\\\ /]cp\ *) ;;
+ *) prev=$arg ;;
+ esac
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ install_prog="$install_prog $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_verbose "extracting global C symbols from \`$progfile'"
+ $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+ runtime relocations are performed -- see ld's documentation
+ on pseudo-relocs. */"
+ lt_dlsym_const= ;;
+ *osf5*)
+ echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+ lt_dlsym_const= ;;
+ *)
+ lt_dlsym_const=const ;;
+ esac
+
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) symtab_cflags="$symtab_cflags $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+
+# func_emit_wrapper_part1 [arg=no]
+#
+# Emit the first part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part1 ()
+{
+ func_emit_wrapper_part1_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_part1_arg1=$1
+ fi
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ ECHO=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$ECHO works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$ECHO will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $ECHO "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+"
+}
+# end: func_emit_wrapper_part1
+
+# func_emit_wrapper_part2 [arg=no]
+#
+# Emit the second part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part2 ()
+{
+ func_emit_wrapper_part2_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_part2_arg1=$1
+ fi
+
+ $ECHO "\
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+# end: func_emit_wrapper_part2
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_arg1=$1
+ fi
+
+ # split this up so that func_emit_cwrapperexe_src
+ # can call each part independently.
+ func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+ func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+# $build $host
+# mingw (msys) mingw [e.g. native]
+# cygwin mingw
+# *nix + wine mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin. Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+ func_to_host_path_result="$1"
+ if test -n "$1" ; then
+ case $host in
+ *mingw* )
+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+ case $build in
+ *mingw* ) # actually, msys
+ # awkward: cmd appends spaces to result
+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+ func_to_host_path_tmp1=`( cmd //c echo "$1" |\
+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ *cygwin* )
+ func_to_host_path_tmp1=`cygpath -w "$1"`
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ * )
+ # Unfortunately, winepath does not exit with a non-zero
+ # error code, so we are forced to check the contents of
+ # stdout. On the other hand, if the command is not
+ # found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both
+ # error code of zero AND non-empty stdout, which explains
+ # the odd construction:
+ func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ # Allow warning below.
+ func_to_host_path_result=""
+ fi
+ ;;
+ esac
+ if test -z "$func_to_host_path_result" ; then
+ func_error "Could not determine host path corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_path_result="$1"
+ fi
+ ;;
+ esac
+ fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+# $build $host
+# mingw (msys) mingw [e.g. native]
+# cygwin mingw
+# *nix + wine mingw
+#
+# Path separators are also converted from $build format to
+# $host format. If ARG begins or ends with a path separator
+# character, it is preserved (but converted to $host format)
+# on output.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+ func_to_host_pathlist_result="$1"
+ if test -n "$1" ; then
+ case $host in
+ *mingw* )
+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_to_host_pathlist_tmp2="$1"
+ # Once set for this call, this variable should not be
+ # reassigned. It is used in tha fallback case.
+ func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e 's|^:*||' -e 's|:*$||'`
+ case $build in
+ *mingw* ) # Actually, msys.
+ # Awkward: cmd appends spaces to result.
+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+ func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ *cygwin* )
+ func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ * )
+ # unfortunately, winepath doesn't convert pathlists
+ func_to_host_pathlist_result=""
+ func_to_host_pathlist_oldIFS=$IFS
+ IFS=:
+ for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+ IFS=$func_to_host_pathlist_oldIFS
+ if test -n "$func_to_host_pathlist_f" ; then
+ func_to_host_path "$func_to_host_pathlist_f"
+ if test -n "$func_to_host_path_result" ; then
+ if test -z "$func_to_host_pathlist_result" ; then
+ func_to_host_pathlist_result="$func_to_host_path_result"
+ else
+ func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
+ fi
+ fi
+ fi
+ IFS=:
+ done
+ IFS=$func_to_host_pathlist_oldIFS
+ ;;
+ esac
+ if test -z "$func_to_host_pathlist_result" ; then
+ func_error "Could not determine the host path(s) corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This may break if $1 contains DOS-style drive
+ # specifications. The fix is not to complicate the expression
+ # below, but for the user to provide a working wine installation
+ # with winepath so that path translation in the cross-to-mingw
+ # case works properly.
+ lt_replace_pathsep_nix_to_dos="s|:|;|g"
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+ $SED -e "$lt_replace_pathsep_nix_to_dos"`
+ fi
+ # Now, add the leading and trailing path separators back
+ case "$1" in
+ :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+ ;;
+ esac
+ case "$1" in
+ *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "$SHELL $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat <<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+# define setmode _setmode
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# define HAVE_SETENV
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+#ifdef _MSC_VER
+# define S_IXUSR _S_IEXEC
+# define stat _stat
+# ifndef _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifdef __CYGWIN__
+# define FOPEN_WB "wb"
+#endif
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#undef LTWRAPPER_DEBUGPRINTF
+#if defined DEBUGWRAPPER
+# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+static void
+ltwrapper_debugprintf (const char *fmt, ...)
+{
+ va_list args;
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+}
+#else
+# define LTWRAPPER_DEBUGPRINTF(args)
+#endif
+
+const char *program_name = NULL;
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_opt_process_env_set (const char *arg);
+void lt_opt_process_env_prepend (const char *arg);
+void lt_opt_process_env_append (const char *arg);
+int lt_split_name_value (const char *arg, char** name, char** value);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+
+static const char *script_text_part1 =
+EOF
+
+ func_emit_wrapper_part1 yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ "/' -e 's/$/\\n"/'
+ echo ";"
+ cat <<EOF
+
+static const char *script_text_part2 =
+EOF
+ func_emit_wrapper_part2 yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ "/' -e 's/$/\\n"/'
+ echo ";"
+
+ cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_pathlist "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_pathlist "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
+
+static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+
+static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
+ /* argument is putenv-style "foo=bar", value of foo is set to bar */
+
+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
+ /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+
+static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
+ /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+
+ /* very simple arg parsing; don't want to rely on getopt */
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ printf ("%s", script_text_part1);
+ printf ("%s", script_text_part2);
+ return 0;
+ }
+ }
+
+ newargz = XMALLOC (char *, argc + 1);
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal ("Couldn't find %s", argv[0]);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+ tmp_pathspec));
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+ actual_cwrapper_path));
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+ target_name));
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+ {
+ if (argv[i][env_set_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_set_opt_len + 1;
+ lt_opt_process_env_set (p);
+ }
+ else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_set (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_set_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+ {
+ if (argv[i][env_prepend_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_prepend_opt_len + 1;
+ lt_opt_process_env_prepend (p);
+ }
+ else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_prepend_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+ {
+ if (argv[i][env_append_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_append_opt_len + 1;
+ lt_opt_process_env_append (p);
+ }
+ else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_append (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_append_opt);
+ continue;
+ }
+ if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal ("Unrecognized option in %s namespace: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+ for (i = 0; i < newargc; i++)
+ {
+ LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
+ path ? (*path ? path : "EMPTY!") : "NULL!"));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
+ path ? (*path ? path : "EMPTY!") : "NULL!"));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
+ wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+ tmp_pathspec));
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ char *errstr = strerror (errno);
+ lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal ("Could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+int
+lt_split_name_value (const char *arg, char** name, char** value)
+{
+ const char *p;
+ int len;
+ if (!arg || !*arg)
+ return 1;
+
+ p = strchr (arg, (int)'=');
+
+ if (!p)
+ return 1;
+
+ *value = xstrdup (++p);
+
+ len = strlen (arg) - strlen (*value);
+ *name = XMALLOC (char, len);
+ strncpy (*name, arg, len-1);
+ (*name)[len - 1] = '\0';
+
+ return 0;
+}
+
+void
+lt_opt_process_env_set (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
+ }
+
+ lt_setenv (name, value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_opt_process_env_prepend (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+ char *new_value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
+ }
+
+ new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_opt_process_env_append (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+ char *new_value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
+ }
+
+ new_value = lt_extend_str (getenv (name), value, 1);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ weak_libs="$weak_libs $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname '-L' '' "$arg"
+ dir=$func_stripname_result
+ if test -z "$dir"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot)
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ arg="$arg $wl$func_quote_for_eval_result"
+ compiler_flags="$compiler_flags $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ arg="$arg $wl$func_quote_for_eval_result"
+ compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+ linker_flags="$linker_flags $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+ # -r[0-9][0-9]* specifies the processor on the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+ # +DA*, +DD* enable 64-bit mode on the HP compiler
+ # -q* pass through compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* pass through architecture-specific
+ # compiler args for GCC
+ # -F/path gives path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+ # @file GCC response files
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ compiler_flags="$compiler_flags $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ dlfiles="$dlfiles $arg"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_duplicate_deps ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ libs="$libs $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ case $lib in
+ *.la) func_source "$lib" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) deplibs="$deplibs $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ dir=$func_stripname_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ $ECHO
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because the file extensions .$libext of this argument makes me believe"
+ $ECHO "*** that it is just a static archive that I should not use here."
+ else
+ $ECHO
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) temp_rpath="$temp_rpath$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ $ECHO
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $ECHO
+ $ECHO "*** And there doesn't seem to be a static archive available"
+ $ECHO "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ $ECHO
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ $ECHO "*** But as you try to build a module library, libtool will still create "
+ $ECHO "*** a static module, that should work as long as the dlopening application"
+ $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ $ECHO
+ $ECHO "*** However, this would only work if libtool was able to extract symbol"
+ $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $ECHO "*** not find such a program. So, this module is probably useless."
+ $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ *) temp_deplibs="$temp_deplibs $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ newlib_search_path="$newlib_search_path $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_dirname "$deplib" "" "."
+ dir="$func_dirname_result"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ objs="$objs$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ $ECHO
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ libobjs="$libobjs $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
+ # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ deplibs="$deplibs System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which I believe you do not have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+ $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+ $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ $ECHO "*** make it link in! You will probably need to install it or some"
+ $ECHO "*** library that it depends on before this library will be fully"
+ $ECHO "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
+ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
+ done
+ fi
+ if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
+ $GREP . >/dev/null; then
+ $ECHO
+ if test "X$deplibs_check_method" = "Xnone"; then
+ $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ $ECHO "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ $ECHO "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ $ECHO
+ $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ $ECHO "*** a static module, that should work as long as the dlopening"
+ $ECHO "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ $ECHO
+ $ECHO "*** However, this would only work if libtool was able to extract symbol"
+ $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $ECHO "*** not find such a program. So, this module is probably useless."
+ $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ $ECHO "*** The inter-library dependencies that have been dropped here will be"
+ $ECHO "*** automatically added whenever a program is linked with this library"
+ $ECHO "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ $ECHO
+ $ECHO "*** Since this library must not contain undefined symbols,"
+ $ECHO "*** because either the platform does not support them or"
+ $ECHO "*** it was explicitly requested with -no-undefined,"
+ $ECHO "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ dep_rpath="$dep_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ delfiles="$delfiles $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ func_len " $cmd"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ libobjs="$libobjs $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linker_flags="$linker_flags $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ $ECHO 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ $ECHO "$obj" >> $output
+ done
+ $ECHO ')' >> $output
+ delfiles="$delfiles $output"
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ $ECHO "$obj" >> $output
+ done
+ delfiles="$delfiles $output"
+ output=$firstobj\"$file_list_spec$output\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=$obj
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ delfiles="$delfiles $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ libobjs="$libobjs $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *cegcc)
+ # Disable wrappers for cegcc, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $ECHO for shipping.
+ if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
+ case $progpath in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+ esac
+ qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ oldobjs="$oldobjs $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $addlibs
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $ECHO "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ oldobjs="$oldobjs $gentop/$newobj"
+ ;;
+ *) oldobjs="$oldobjs $obj" ;;
+ esac
+ done
+ fi
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ newdependency_libs="$newdependency_libs $libdir/$name"
+ ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ newdlfiles="$newdlfiles $libdir/$name"
+ ;;
+ *) newdlfiles="$newdlfiles $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlfiles="$newdlfiles $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlprefiles="$newdlprefiles $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$mode" = link || test "$mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) RM="$RM $arg"; rmforce=yes ;;
+ -*) RM="$RM $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$mode" = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test "$mode" = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+ case "$mode" in
+ clean)
+ case " $library_names " in
+ # " " in the beginning catches empty $dlname
+ *" $dlname "*) ;;
+ *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ esac
+ test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+ objdir="$origobjdir"
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/Modules/_ctypes/libffi/m4/libtool.m4 b/Modules/_ctypes/libffi/m4/libtool.m4
new file mode 100644
index 0000000000..671cde117d
--- /dev/null
+++ b/Modules/_ctypes/libffi/m4/libtool.m4
@@ -0,0 +1,7360 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 56 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+ lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+ ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+ lt_cl_success=:
+ test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+ exec AS_MESSAGE_LOG_FD>/dev/null
+ $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+ exec AS_MESSAGE_LOG_FD>>config.log
+ $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_XSI_SHELLFNS
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<_LT_EOF
+[$]*
+_LT_EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
+
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
+ fi
+ fi
+ fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+ [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC*)
+ # IBM XL 8.0 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(int foo(void) {},
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ )
+ LDFLAGS="$save_LDFLAGS"
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+ [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 will use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ xl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=echo
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${F77-"f77"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${FC-"f95"}
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]+=\$[2]"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+ ;;
+ esac
+])
diff --git a/Modules/_ctypes/libffi/m4/ltoptions.m4 b/Modules/_ctypes/libffi/m4/ltoptions.m4
new file mode 100644
index 0000000000..34151a3ba6
--- /dev/null
+++ b/Modules/_ctypes/libffi/m4/ltoptions.m4
@@ -0,0 +1,368 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/Modules/_ctypes/libffi/m4/ltsugar.m4 b/Modules/_ctypes/libffi/m4/ltsugar.m4
new file mode 100644
index 0000000000..9000a057d3
--- /dev/null
+++ b/Modules/_ctypes/libffi/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/Modules/_ctypes/libffi/m4/ltversion.m4 b/Modules/_ctypes/libffi/m4/ltversion.m4
new file mode 100644
index 0000000000..b8e154fe6e
--- /dev/null
+++ b/Modules/_ctypes/libffi/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3012 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6])
+m4_define([LT_PACKAGE_REVISION], [1.3012])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6'
+macro_revision='1.3012'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/Modules/_ctypes/libffi/m4/lt~obsolete.m4 b/Modules/_ctypes/libffi/m4/lt~obsolete.m4
new file mode 100644
index 0000000000..637bb2066c
--- /dev/null
+++ b/Modules/_ctypes/libffi/m4/lt~obsolete.m4
@@ -0,0 +1,92 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
diff --git a/Modules/_ctypes/libffi/man/Makefile.am b/Modules/_ctypes/libffi/man/Makefile.am
new file mode 100644
index 0000000000..2519277488
--- /dev/null
+++ b/Modules/_ctypes/libffi/man/Makefile.am
@@ -0,0 +1,8 @@
+## Process this with automake to create Makefile.in
+
+AUTOMAKE_OPTIONS=foreign
+
+EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3
+
+man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3
+
diff --git a/Modules/_ctypes/libffi/man/Makefile.in b/Modules/_ctypes/libffi/man/Makefile.in
new file mode 100644
index 0000000000..3e40be2fc6
--- /dev/null
+++ b/Modules/_ctypes/libffi/man/Makefile.in
@@ -0,0 +1,448 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = man
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/fficonfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man3dir = $(mandir)/man3
+am__installdirs = "$(DESTDIR)$(man3dir)"
+NROFF = nroff
+MANS = $(man_MANS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TARGET = @TARGET@
+TARGETDIR = @TARGETDIR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+toolexecdir = @toolexecdir@
+toolexeclibdir = @toolexeclibdir@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign
+EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3
+man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign man/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man3: $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)"
+ @list=''; test -n "$(man3dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.3[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man3:
+ @$(NORMAL_UNINSTALL)
+ @list=''; test -n "$(man3dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.3[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man3dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man3dir)" && rm -f $$files; }
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS)
+installdirs:
+ for dir in "$(DESTDIR)$(man3dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man3
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man
+
+uninstall-man: uninstall-man3
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-man3 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am uninstall-man uninstall-man3
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Modules/_ctypes/libffi/man/ffi.3 b/Modules/_ctypes/libffi/man/ffi.3
new file mode 100644
index 0000000000..18b5d5d2d4
--- /dev/null
+++ b/Modules/_ctypes/libffi/man/ffi.3
@@ -0,0 +1,31 @@
+.Dd February 15, 2008
+.Dt FFI 3
+.Sh NAME
+.Nm FFI
+.Nd Foreign Function Interface
+.Sh LIBRARY
+libffi, -lffi
+.Sh SYNOPSIS
+.In ffi.h
+.Ft ffi_status
+.Fo ffi_prep_cif
+.Fa "ffi_cif *cif"
+.Fa "ffi_abi abi"
+.Fa "unsigned int nargs"
+.Fa "ffi_type *rtype"
+.Fa "ffi_type **atypes"
+.Fc
+.Ft void
+.Fo ffi_call
+.Fa "ffi_cif *cif"
+.Fa "void (*fn)(void)"
+.Fa "void *rvalue"
+.Fa "void **avalue"
+.Fc
+.Sh DESCRIPTION
+The foreign function interface provides a mechanism by which a function can
+generate a call to another function at runtime without requiring knowledge of
+the called function's interface at compile time.
+.Sh SEE ALSO
+.Xr ffi_prep_cif 3 ,
+.Xr ffi_call 3
diff --git a/Modules/_ctypes/libffi/man/ffi_call.3 b/Modules/_ctypes/libffi/man/ffi_call.3
new file mode 100644
index 0000000000..5351513f90
--- /dev/null
+++ b/Modules/_ctypes/libffi/man/ffi_call.3
@@ -0,0 +1,103 @@
+.Dd February 15, 2008
+.Dt ffi_call 3
+.Sh NAME
+.Nm ffi_call
+.Nd Invoke a foreign function.
+.Sh SYNOPSIS
+.In ffi.h
+.Ft void
+.Fo ffi_call
+.Fa "ffi_cif *cif"
+.Fa "void (*fn)(void)"
+.Fa "void *rvalue"
+.Fa "void **avalue"
+.Fc
+.Sh DESCRIPTION
+The
+.Nm ffi_call
+function provides a simple mechanism for invoking a function without
+requiring knowledge of the function's interface at compile time.
+.Fa fn
+is called with the values retrieved from the pointers in the
+.Fa avalue
+array. The return value from
+.Fa fn
+is placed in storage pointed to by
+.Fa rvalue .
+.Fa cif
+contains information describing the data types, sizes and alignments of the
+arguments to and return value from
+.Fa fn ,
+and must be initialized with
+.Nm ffi_prep_cif
+before it is used with
+.Nm ffi_call .
+.Pp
+.Fa rvalue
+must point to storage that is sizeof(ffi_arg) or larger for non-floating point
+types. For smaller-sized return value types, the
+.Nm ffi_arg
+or
+.Nm ffi_sarg
+integral type must be used to hold
+the return value.
+.Sh EXAMPLES
+.Bd -literal
+#include <ffi.h>
+#include <stdio.h>
+
+unsigned char
+foo(unsigned int, float);
+
+int
+main(int argc, const char **argv)
+{
+ ffi_cif cif;
+ ffi_type *arg_types[2];
+ void *arg_values[2];
+ ffi_status status;
+
+ // Because the return value from foo() is smaller than sizeof(long), it
+ // must be passed as ffi_arg or ffi_sarg.
+ ffi_arg result;
+
+ // Specify the data type of each argument. Available types are defined
+ // in <ffi/ffi.h>.
+ arg_types[0] = &ffi_type_uint;
+ arg_types[1] = &ffi_type_float;
+
+ // Prepare the ffi_cif structure.
+ if ((status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI,
+ 2, &ffi_type_uint8, arg_types)) != FFI_OK)
+ {
+ // Handle the ffi_status error.
+ }
+
+ // Specify the values of each argument.
+ unsigned int arg1 = 42;
+ float arg2 = 5.1;
+
+ arg_values[0] = &arg1;
+ arg_values[1] = &arg2;
+
+ // Invoke the function.
+ ffi_call(&cif, FFI_FN(foo), &result, arg_values);
+
+ // The ffi_arg 'result' now contains the unsigned char returned from foo(),
+ // which can be accessed by a typecast.
+ printf("result is %hhu", (unsigned char)result);
+
+ return 0;
+}
+
+// The target function.
+unsigned char
+foo(unsigned int x, float y)
+{
+ unsigned char result = x - y;
+ return result;
+}
+.Ed
+.Sh SEE ALSO
+.Xr ffi 3 ,
+.Xr ffi_prep_cif 3
diff --git a/Modules/_ctypes/libffi/man/ffi_prep_cif.3 b/Modules/_ctypes/libffi/man/ffi_prep_cif.3
new file mode 100644
index 0000000000..9436b31191
--- /dev/null
+++ b/Modules/_ctypes/libffi/man/ffi_prep_cif.3
@@ -0,0 +1,66 @@
+.Dd February 15, 2008
+.Dt ffi_prep_cif 3
+.Sh NAME
+.Nm ffi_prep_cif
+.Nd Prepare a
+.Nm ffi_cif
+structure for use with
+.Nm ffi_call
+.
+.Sh SYNOPSIS
+.In ffi.h
+.Ft ffi_status
+.Fo ffi_prep_cif
+.Fa "ffi_cif *cif"
+.Fa "ffi_abi abi"
+.Fa "unsigned int nargs"
+.Fa "ffi_type *rtype"
+.Fa "ffi_type **atypes"
+.Fc
+.Sh DESCRIPTION
+The
+.Nm ffi_prep_cif
+function prepares a
+.Nm ffi_cif
+structure for use with
+.Nm ffi_call
+.
+.Fa abi
+specifies a set of calling conventions to use.
+.Fa atypes
+is an array of
+.Fa nargs
+pointers to
+.Nm ffi_type
+structs that describe the data type, size and alignment of each argument.
+.Fa rtype
+points to an
+.Nm ffi_type
+that describes the data type, size and alignment of the
+return value.
+.Sh RETURN VALUES
+Upon successful completion,
+.Nm ffi_prep_cif
+returns
+.Nm FFI_OK .
+It will return
+.Nm FFI_BAD_TYPEDEF
+if
+.Fa cif
+is
+.Nm NULL
+or
+.Fa atypes
+or
+.Fa rtype
+is malformed. If
+.Fa abi
+does not refer to a valid ABI,
+.Nm FFI_BAD_ABI
+will be returned. Available ABIs are
+defined in
+.Nm <ffitarget.h>
+.
+.Sh SEE ALSO
+.Xr ffi 3 ,
+.Xr ffi_call 3
diff --git a/Modules/_ctypes/libffi/mdate-sh b/Modules/_ctypes/libffi/mdate-sh
new file mode 100755
index 0000000000..cd916c0a34
--- /dev/null
+++ b/Modules/_ctypes/libffi/mdate-sh
@@ -0,0 +1,201 @@
+#!/bin/sh
+# Get modification time of a file or directory and pretty-print it.
+
+scriptversion=2005-06-29.22
+
+# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
+# Foundation, Inc.
+# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+ '')
+ echo "$0: No file. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: mdate-sh [--help] [--version] FILE
+
+Pretty-print the modification time of FILE.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "mdate-sh $scriptversion"
+ exit $?
+ ;;
+esac
+
+# Prevent date giving response in another language.
+LANG=C
+export LANG
+LC_ALL=C
+export LC_ALL
+LC_TIME=C
+export LC_TIME
+
+# GNU ls changes its time format in response to the TIME_STYLE
+# variable. Since we cannot assume `unset' works, revert this
+# variable to its documented default.
+if test "${TIME_STYLE+set}" = set; then
+ TIME_STYLE=posix-long-iso
+ export TIME_STYLE
+fi
+
+save_arg1=$1
+
+# Find out how to get the extended ls output of a file or directory.
+if ls -L /dev/null 1>/dev/null 2>&1; then
+ ls_command='ls -L -l -d'
+else
+ ls_command='ls -l -d'
+fi
+
+# A `ls -l' line looks as follows on OS/2.
+# drwxrwx--- 0 Aug 11 2001 foo
+# This differs from Unix, which adds ownership information.
+# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
+#
+# To find the date, we split the line on spaces and iterate on words
+# until we find a month. This cannot work with files whose owner is a
+# user named `Jan', or `Feb', etc. However, it's unlikely that `/'
+# will be owned by a user whose name is a month. So we first look at
+# the extended ls output of the root directory to decide how many
+# words should be skipped to get the date.
+
+# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
+set x`ls -l -d /`
+
+# Find which argument is the month.
+month=
+command=
+until test $month
+do
+ shift
+ # Add another shift to the command.
+ command="$command shift;"
+ case $1 in
+ Jan) month=January; nummonth=1;;
+ Feb) month=February; nummonth=2;;
+ Mar) month=March; nummonth=3;;
+ Apr) month=April; nummonth=4;;
+ May) month=May; nummonth=5;;
+ Jun) month=June; nummonth=6;;
+ Jul) month=July; nummonth=7;;
+ Aug) month=August; nummonth=8;;
+ Sep) month=September; nummonth=9;;
+ Oct) month=October; nummonth=10;;
+ Nov) month=November; nummonth=11;;
+ Dec) month=December; nummonth=12;;
+ esac
+done
+
+# Get the extended ls output of the file or directory.
+set dummy x`eval "$ls_command \"\$save_arg1\""`
+
+# Remove all preceding arguments
+eval $command
+
+# Because of the dummy argument above, month is in $2.
+#
+# On a POSIX system, we should have
+#
+# $# = 5
+# $1 = file size
+# $2 = month
+# $3 = day
+# $4 = year or time
+# $5 = filename
+#
+# On Darwin 7.7.0 and 7.6.0, we have
+#
+# $# = 4
+# $1 = day
+# $2 = month
+# $3 = year or time
+# $4 = filename
+
+# Get the month.
+case $2 in
+ Jan) month=January; nummonth=1;;
+ Feb) month=February; nummonth=2;;
+ Mar) month=March; nummonth=3;;
+ Apr) month=April; nummonth=4;;
+ May) month=May; nummonth=5;;
+ Jun) month=June; nummonth=6;;
+ Jul) month=July; nummonth=7;;
+ Aug) month=August; nummonth=8;;
+ Sep) month=September; nummonth=9;;
+ Oct) month=October; nummonth=10;;
+ Nov) month=November; nummonth=11;;
+ Dec) month=December; nummonth=12;;
+esac
+
+case $3 in
+ ???*) day=$1;;
+ *) day=$3; shift;;
+esac
+
+# Here we have to deal with the problem that the ls output gives either
+# the time of day or the year.
+case $3 in
+ *:*) set `date`; eval year=\$$#
+ case $2 in
+ Jan) nummonthtod=1;;
+ Feb) nummonthtod=2;;
+ Mar) nummonthtod=3;;
+ Apr) nummonthtod=4;;
+ May) nummonthtod=5;;
+ Jun) nummonthtod=6;;
+ Jul) nummonthtod=7;;
+ Aug) nummonthtod=8;;
+ Sep) nummonthtod=9;;
+ Oct) nummonthtod=10;;
+ Nov) nummonthtod=11;;
+ Dec) nummonthtod=12;;
+ esac
+ # For the first six month of the year the time notation can also
+ # be used for files modified in the last year.
+ if (expr $nummonth \> $nummonthtod) > /dev/null;
+ then
+ year=`expr $year - 1`
+ fi;;
+ *) year=$3;;
+esac
+
+# The result.
+echo $day $month $year
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/Modules/_ctypes/libffi/missing b/Modules/_ctypes/libffi/missing
index 64b5f901dd..894e786e16 100755
--- a/Modules/_ctypes/libffi/missing
+++ b/Modules/_ctypes/libffi/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2004-09-07.08
+scriptversion=2005-06-08.21
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
@@ -19,8 +19,8 @@ scriptversion=2004-09-07.08
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -87,12 +87,12 @@ Supported PROGRAM values:
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
- exit 0
+ exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
- exit 0
+ exit $?
;;
-*)
@@ -288,11 +288,18 @@ WARNING: \`$1' is $msg. You should only need it if
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
touch $file
;;
diff --git a/Modules/_ctypes/libffi/msvcc.sh b/Modules/_ctypes/libffi/msvcc.sh
new file mode 100644
index 0000000000..83018397f0
--- /dev/null
+++ b/Modules/_ctypes/libffi/msvcc.sh
@@ -0,0 +1,185 @@
+#!/bin/sh
+
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the MSVC wrappificator.
+#
+# The Initial Developer of the Original Code is
+# Timothy Wall <twalljava@dev.java.net>.
+# Portions created by the Initial Developer are Copyright (C) 2009
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+# Daniel Witte <dwitte@mozilla.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+#
+# GCC-compatible wrapper for cl.exe and ml.exe. Arguments are given in GCC
+# format and translated into something sensible for cl or ml.
+#
+
+# Disable specific warnings, and enable warnings-as-errors so we catch any
+# mistranslated args.
+nowarn="-wd4127 -wd4820 -wd4706 -wd4100 -wd4255 -wd4668 -wd4053 -wd4324"
+args="-nologo -W3 -WX $nowarn"
+md=-MD
+cl="cl"
+ml="ml"
+output=
+
+while [ $# -gt 0 ]
+do
+ case $1
+ in
+ -fexceptions)
+ # Don't enable exceptions for now.
+ #args="$args -EHac"
+ shift 1
+ ;;
+ -m32)
+ shift 1
+ ;;
+ -m64)
+ cl="cl" # "$MSVC/x86_amd64/cl"
+ ml="ml64" # "$MSVC/x86_amd64/ml64"
+ shift 1
+ ;;
+ -O*)
+ args="$args $1"
+ shift 1
+ ;;
+ -g)
+ # Can't specify -RTC1 or -Zi in opt. -Gy is ok. Use -OPT:REF?
+ args="$args -D_DEBUG -RTC1 -Zi"
+ md=-MDd
+ shift 1
+ ;;
+ -c)
+ args="$args -c"
+ args="$(echo $args | sed 's%/Fe%/Fo%g')"
+ single="-c"
+ shift 1
+ ;;
+ -D*=*)
+ name="$(echo $1|sed 's/-D\([^=][^=]*\)=.*/\1/g')"
+ value="$(echo $1|sed 's/-D[^=][^=]*=//g')"
+ args="$args -D${name}='$value'"
+ defines="$defines -D${name}='$value'"
+ shift 1
+ ;;
+ -D*)
+ args="$args $1"
+ defines="$defines $1"
+ shift 1
+ ;;
+ -I)
+ args="$args -I$2"
+ includes="$includes -I$2"
+ shift 2
+ ;;
+ -I*)
+ args="$args $1"
+ includes="$includes $1"
+ shift 1
+ ;;
+ -W|-Wextra)
+ # TODO map extra warnings
+ shift 1
+ ;;
+ -Wall)
+ args="$args -Wall"
+ shift 1
+ ;;
+ -Werror)
+ args="$args -WX"
+ shift 1
+ ;;
+ -W*)
+ # TODO map specific warnings
+ shift 1
+ ;;
+ -S)
+ args="$args -FAs"
+ shift 1
+ ;;
+ -o)
+ outdir="$(dirname $2)"
+ base="$(basename $2|sed 's/\.[^.]*//g')"
+ if [ -n "$single" ]; then
+ output="-Fo$2"
+ else
+ output="-Fe$2"
+ fi
+ if [ -n "$assembly" ]; then
+ args="$args $output"
+ else
+ args="$args $output -Fd$outdir/$base -Fp$outdir/$base -Fa$outdir/$base"
+ fi
+ shift 2
+ ;;
+ *.S)
+ src=$1
+ assembly="true"
+ shift 1
+ ;;
+ *.c)
+ args="$args $1"
+ shift 1
+ ;;
+ *)
+ # Assume it's an MSVC argument, and pass it through.
+ args="$args $1"
+ shift 1
+ ;;
+ esac
+done
+
+if [ -n "$assembly" ]; then
+ if [ -z "$outdir" ]; then
+ outdir="."
+ fi
+ ppsrc="$outdir/$(basename $src|sed 's/.S$/.asm/g')"
+ echo "$cl -nologo -EP $includes $defines $src > $ppsrc"
+ "$cl" -nologo -EP $includes $defines $src > $ppsrc || exit $?
+ output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')"
+ args="-nologo -safeseh $single $output $ppsrc"
+
+ echo "$ml $args"
+ eval "\"$ml\" $args"
+ result=$?
+
+ # required to fix ml64 broken output?
+ #mv *.obj $outdir
+else
+ args="$md $args"
+ echo "$cl $args"
+ eval "\"$cl\" $args"
+ result=$?
+fi
+
+exit $result
+
diff --git a/Modules/_ctypes/libffi/src/arm/sysv.S b/Modules/_ctypes/libffi/src/arm/sysv.S
index 34481c8c46..90643185c7 100644
--- a/Modules/_ctypes/libffi/src/arm/sysv.S
+++ b/Modules/_ctypes/libffi/src/arm/sysv.S
@@ -67,11 +67,19 @@
#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
|| defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
- || defined(__ARM_ARCH_6ZK__)
+ || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
+ || defined(__ARM_ARCH_6M__)
# undef __ARM_ARCH__
# define __ARM_ARCH__ 6
#endif
+#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
+ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
+ || defined(__ARM_ARCH_7EM__)
+# undef __ARM_ARCH__
+# define __ARM_ARCH__ 7
+#endif
+
#if __ARM_ARCH__ >= 5
# define call_reg(x) blx x
#elif defined (__ARM_ARCH_4T__)
@@ -189,7 +197,7 @@ ARM_FUNC_START ffi_call_SYSV
@ return INT
cmp r3, #FFI_TYPE_INT
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
cmpne r3, #FFI_TYPE_FLOAT
#endif
streq r0, [r2]
@@ -197,12 +205,12 @@ ARM_FUNC_START ffi_call_SYSV
@ return INT64
cmp r3, #FFI_TYPE_SINT64
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
cmpne r3, #FFI_TYPE_DOUBLE
#endif
stmeqia r2, {r0, r1}
-#ifndef __SOFTFP__
+#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
beq LSYM(Lepilogue)
@ return FLOAT
@@ -245,21 +253,21 @@ ARM_FUNC_START ffi_closure_SYSV
beq .Lretint
cmp r0, #FFI_TYPE_FLOAT
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
beq .Lretint
#else
beq .Lretfloat
#endif
cmp r0, #FFI_TYPE_DOUBLE
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
beq .Lretlonglong
#else
beq .Lretdouble
#endif
cmp r0, #FFI_TYPE_LONGDOUBLE
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
beq .Lretlonglong
#else
beq .Lretlongdouble
@@ -278,7 +286,7 @@ ARM_FUNC_START ffi_closure_SYSV
ldr r1, [sp, #4]
b .Lclosure_epilogue
-#ifndef __SOFTFP__
+#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
.Lretfloat:
ldfs f0, [sp]
b .Lclosure_epilogue
diff --git a/Modules/_ctypes/libffi/src/avr32/ffi.c b/Modules/_ctypes/libffi/src/avr32/ffi.c
new file mode 100644
index 0000000000..39fba2b03b
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/avr32/ffi.c
@@ -0,0 +1,421 @@
+/* -----------------------------------------------------------------------
+ ffi.c - Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
+
+ AVR32 Foreign Function Interface
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+#include <ffi.h>
+#include <ffi_common.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <asm/unistd.h>
+
+/* #define DEBUG */
+
+extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
+ unsigned int, unsigned int, unsigned int*, unsigned int,
+ void (*fn)(void));
+extern void ffi_closure_SYSV (ffi_closure *);
+
+unsigned int pass_struct_on_stack(ffi_type *type)
+{
+ if(type->type != FFI_TYPE_STRUCT)
+ return 0;
+
+ if(type->alignment < type->size &&
+ !(type->size == 4 || type->size == 8) &&
+ !(type->size == 8 && type->alignment >= 4))
+ return 1;
+
+ if(type->size == 3 || type->size == 5 || type->size == 6 ||
+ type->size == 7)
+ return 1;
+
+ return 0;
+}
+
+/* ffi_prep_args is called by the assembly routine once stack space
+ * has been allocated for the function's arguments
+ *
+ * This is annoyingly complex since we need to keep track of used
+ * registers.
+ */
+
+void ffi_prep_args(char *stack, extended_cif *ecif)
+{
+ unsigned int i;
+ void **p_argv;
+ ffi_type **p_arg;
+ char *reg_base = stack;
+ char *stack_base = stack + 20;
+ unsigned int stack_offset = 0;
+ unsigned int reg_mask = 0;
+
+ p_argv = ecif->avalue;
+
+ /* If cif->flags is struct then we know it's not passed in registers */
+ if(ecif->cif->flags == FFI_TYPE_STRUCT)
+ {
+ *(void**)reg_base = ecif->rvalue;
+ reg_mask |= 1;
+ }
+
+ for(i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs;
+ i++, p_arg++)
+ {
+ size_t z = (*p_arg)->size;
+ int alignment = (*p_arg)->alignment;
+ int type = (*p_arg)->type;
+ char *addr = 0;
+
+ if(z % 4 != 0)
+ z += (4 - z % 4);
+
+ if(reg_mask != 0x1f)
+ {
+ if(pass_struct_on_stack(*p_arg))
+ {
+ addr = stack_base + stack_offset;
+ stack_offset += z;
+ }
+ else if(z == sizeof(int))
+ {
+ char index = 0;
+
+ while((reg_mask >> index) & 1)
+ index++;
+
+ addr = reg_base + (index * 4);
+ reg_mask |= (1 << index);
+ }
+ else if(z == 2 * sizeof(int))
+ {
+ if(!((reg_mask >> 1) & 1))
+ {
+ addr = reg_base + 4;
+ reg_mask |= (3 << 1);
+ }
+ else if(!((reg_mask >> 3) & 1))
+ {
+ addr = reg_base + 12;
+ reg_mask |= (3 << 3);
+ }
+ }
+ }
+
+ if(!addr)
+ {
+ addr = stack_base + stack_offset;
+ stack_offset += z;
+ }
+
+ if(type == FFI_TYPE_STRUCT && (*p_arg)->elements[1] == NULL)
+ type = (*p_arg)->elements[0]->type;
+
+ switch(type)
+ {
+ case FFI_TYPE_UINT8:
+ *(unsigned int *)addr = (unsigned int)*(UINT8 *)(*p_argv);
+ break;
+ case FFI_TYPE_SINT8:
+ *(signed int *)addr = (signed int)*(SINT8 *)(*p_argv);
+ break;
+ case FFI_TYPE_UINT16:
+ *(unsigned int *)addr = (unsigned int)*(UINT16 *)(*p_argv);
+ break;
+ case FFI_TYPE_SINT16:
+ *(signed int *)addr = (signed int)*(SINT16 *)(*p_argv);
+ break;
+ default:
+ memcpy(addr, *p_argv, z);
+ }
+
+ p_argv++;
+ }
+
+#ifdef DEBUG
+ /* Debugging */
+ for(i = 0; i < 5; i++)
+ {
+ if((reg_mask & (1 << i)) == 0)
+ printf("r%d: (unused)\n", 12 - i);
+ else
+ printf("r%d: 0x%08x\n", 12 - i, ((unsigned int*)reg_base)[i]);
+ }
+
+ for(i = 0; i < stack_offset / 4; i++)
+ {
+ printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack_base)[i]);
+ }
+#endif
+}
+
+/* Perform machine dependent cif processing */
+ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
+{
+ /* Round the stack up to a multiple of 8 bytes. This isn't needed
+ * everywhere, but it is on some platforms, and it doesn't harm
+ * anything when it isn't needed. */
+ cif->bytes = (cif->bytes + 7) & ~7;
+
+ /* Flag to indicate that he return value is in fact a struct */
+ cif->rstruct_flag = 0;
+
+ /* Set the return type flag */
+ switch(cif->rtype->type)
+ {
+ case FFI_TYPE_SINT8:
+ case FFI_TYPE_UINT8:
+ cif->flags = (unsigned)FFI_TYPE_UINT8;
+ break;
+ case FFI_TYPE_SINT16:
+ case FFI_TYPE_UINT16:
+ cif->flags = (unsigned)FFI_TYPE_UINT16;
+ break;
+ case FFI_TYPE_FLOAT:
+ case FFI_TYPE_SINT32:
+ case FFI_TYPE_UINT32:
+ case FFI_TYPE_POINTER:
+ cif->flags = (unsigned)FFI_TYPE_UINT32;
+ break;
+ case FFI_TYPE_DOUBLE:
+ case FFI_TYPE_SINT64:
+ case FFI_TYPE_UINT64:
+ cif->flags = (unsigned)FFI_TYPE_UINT64;
+ break;
+ case FFI_TYPE_STRUCT:
+ cif->rstruct_flag = 1;
+ if(!pass_struct_on_stack(cif->rtype))
+ {
+ if(cif->rtype->size <= 1)
+ cif->flags = (unsigned)FFI_TYPE_UINT8;
+ else if(cif->rtype->size <= 2)
+ cif->flags = (unsigned)FFI_TYPE_UINT16;
+ else if(cif->rtype->size <= 4)
+ cif->flags = (unsigned)FFI_TYPE_UINT32;
+ else if(cif->rtype->size <= 8)
+ cif->flags = (unsigned)FFI_TYPE_UINT64;
+ else
+ cif->flags = (unsigned)cif->rtype->type;
+ }
+ else
+ cif->flags = (unsigned)cif->rtype->type;
+ break;
+ default:
+ cif->flags = (unsigned)cif->rtype->type;
+ break;
+ }
+
+ return FFI_OK;
+}
+
+void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
+{
+ extended_cif ecif;
+
+ unsigned int size = 0, i = 0;
+ ffi_type **p_arg;
+
+ ecif.cif = cif;
+ ecif.avalue = avalue;
+
+ for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++)
+ size += (*p_arg)->size + (4 - (*p_arg)->size % 4);
+
+ /* If the return value is a struct and we don't have a return value
+ * address then we need to make one */
+
+ /* If cif->flags is struct then it's not suitable for registers */
+ if((rvalue == NULL) && (cif->flags == FFI_TYPE_STRUCT))
+ ecif.rvalue = alloca(cif->rtype->size);
+ else
+ ecif.rvalue = rvalue;
+
+ switch(cif->abi)
+ {
+ case FFI_SYSV:
+ ffi_call_SYSV(ffi_prep_args, &ecif, size, cif->flags,
+ ecif.rvalue, cif->rstruct_flag, fn);
+ break;
+ default:
+ FFI_ASSERT(0);
+ break;
+ }
+}
+
+static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
+ void **avalue, ffi_cif *cif)
+{
+ register unsigned int i, reg_mask = 0;
+ register void **p_argv;
+ register ffi_type **p_arg;
+ register char *reg_base = stack;
+ register char *stack_base = stack + 20;
+ register unsigned int stack_offset = 0;
+
+#ifdef DEBUG
+ /* Debugging */
+ for(i = 0; i < cif->nargs + 7; i++)
+ {
+ printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack)[i]);
+ }
+#endif
+
+ /* If cif->flags is struct then we know it's not passed in registers */
+ if(cif->flags == FFI_TYPE_STRUCT)
+ {
+ *rvalue = *(void **)reg_base;
+ reg_mask |= 1;
+ }
+
+ p_argv = avalue;
+
+ for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++)
+ {
+ size_t z = (*p_arg)->size;
+ int alignment = (*p_arg)->alignment;
+
+ *p_argv = 0;
+
+ if(z % 4 != 0)
+ z += (4 - z % 4);
+
+ if(reg_mask != 0x1f)
+ {
+ if(pass_struct_on_stack(*p_arg))
+ {
+ *p_argv = (void*)stack_base + stack_offset;
+ stack_offset += z;
+ }
+ else if(z <= sizeof(int))
+ {
+ char index = 0;
+
+ while((reg_mask >> index) & 1)
+ index++;
+
+ *p_argv = (void*)reg_base + (index * 4);
+ reg_mask |= (1 << index);
+ }
+ else if(z == 2 * sizeof(int))
+ {
+ if(!((reg_mask >> 1) & 1))
+ {
+ *p_argv = (void*)reg_base + 4;
+ reg_mask |= (3 << 1);
+ }
+ else if(!((reg_mask >> 3) & 1))
+ {
+ *p_argv = (void*)reg_base + 12;
+ reg_mask |= (3 << 3);
+ }
+ }
+ }
+
+ if(!*p_argv)
+ {
+ *p_argv = (void*)stack_base + stack_offset;
+ stack_offset += z;
+ }
+
+ if((*p_arg)->type != FFI_TYPE_STRUCT ||
+ (*p_arg)->elements[1] == NULL)
+ {
+ if(alignment == 1)
+ **(unsigned int**)p_argv <<= 24;
+ else if(alignment == 2)
+ **(unsigned int**)p_argv <<= 16;
+ }
+
+ p_argv++;
+ }
+
+#ifdef DEBUG
+ /* Debugging */
+ for(i = 0; i < cif->nargs; i++)
+ {
+ printf("sp+%d: 0x%08x\n", i*4, *(((unsigned int**)avalue)[i]));
+ }
+#endif
+}
+
+/* This function is jumped to by the trampoline */
+
+unsigned int ffi_closure_SYSV_inner(ffi_closure *closure, void **respp,
+ void *args)
+{
+ ffi_cif *cif;
+ void **arg_area;
+ unsigned int i, size = 0;
+ ffi_type **p_arg;
+
+ cif = closure->cif;
+
+ for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++)
+ size += (*p_arg)->size + (4 - (*p_arg)->size % 4);
+
+ arg_area = (void **)alloca(size);
+
+ /* this call will initialize ARG_AREA, such that each element in that
+ * array points to the corresponding value on the stack; and if the
+ * function returns a structure, it will re-set RESP to point to the
+ * structure return address. */
+
+ ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif);
+
+ (closure->fun)(cif, *respp, arg_area, closure->user_data);
+
+ return cif->flags;
+}
+
+ffi_status ffi_prep_closure_loc(ffi_closure* closure, ffi_cif* cif,
+ void (*fun)(ffi_cif*, void*, void**, void*), void *user_data,
+ void *codeloc)
+{
+ FFI_ASSERT(cif->abi == FFI_SYSV);
+
+ unsigned char *__tramp = (unsigned char*)(&closure->tramp[0]);
+ unsigned int __fun = (unsigned int)(&ffi_closure_SYSV);
+ unsigned int __ctx = (unsigned int)(codeloc);
+ unsigned int __rstruct_flag = (unsigned int)(cif->rstruct_flag);
+ unsigned int __inner = (unsigned int)(&ffi_closure_SYSV_inner);
+ *(unsigned int*) &__tramp[0] = 0xebcd1f00; /* pushm r8-r12 */
+ *(unsigned int*) &__tramp[4] = 0xfefc0010; /* ld.w r12, pc[16] */
+ *(unsigned int*) &__tramp[8] = 0xfefb0010; /* ld.w r11, pc[16] */
+ *(unsigned int*) &__tramp[12] = 0xfefa0010; /* ld.w r10, pc[16] */
+ *(unsigned int*) &__tramp[16] = 0xfeff0010; /* ld.w pc, pc[16] */
+ *(unsigned int*) &__tramp[20] = __ctx;
+ *(unsigned int*) &__tramp[24] = __rstruct_flag;
+ *(unsigned int*) &__tramp[28] = __inner;
+ *(unsigned int*) &__tramp[32] = __fun;
+ syscall(__NR_cacheflush, 0, (&__tramp[0]), 36);
+
+ closure->cif = cif;
+ closure->user_data = user_data;
+ closure->fun = fun;
+
+ return FFI_OK;
+}
+
diff --git a/Modules/_ctypes/libffi/src/avr32/ffitarget.h b/Modules/_ctypes/libffi/src/avr32/ffitarget.h
new file mode 100644
index 0000000000..1c799b1de7
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/avr32/ffitarget.h
@@ -0,0 +1,50 @@
+/* -----------------------------------------------------------------*-C-*-
+ ffitarget.h - Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
+ Target configuration macros for AVR32.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ ----------------------------------------------------------------------- */
+
+#ifndef LIBFFI_TARGET_H
+#define LIBFFI_TARGET_H
+
+#ifndef LIBFFI_ASM
+typedef unsigned long ffi_arg;
+typedef signed long ffi_sarg;
+
+typedef enum ffi_abi {
+ FFI_FIRST_ABI = 0,
+ FFI_SYSV,
+ FFI_DEFAULT_ABI = FFI_SYSV,
+ FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+} ffi_abi;
+#endif
+
+#define FFI_EXTRA_CIF_FIELDS unsigned int rstruct_flag
+
+/* Definitions for closures */
+
+#define FFI_CLOSURES 1
+#define FFI_TRAMPOLINE_SIZE 36
+#define FFI_NATIVE_RAW_API 0
+
+#endif
diff --git a/Modules/_ctypes/libffi/src/avr32/sysv.S b/Modules/_ctypes/libffi/src/avr32/sysv.S
new file mode 100644
index 0000000000..a984b3c88a
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/avr32/sysv.S
@@ -0,0 +1,208 @@
+/* -----------------------------------------------------------------------
+ sysv.S - Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
+
+ AVR32 Foreign Function Interface
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ --------------------------------------------------------------------- */
+
+#define LIBFFI_ASM
+#include <fficonfig.h>
+#include <ffi.h>
+
+ /* r12: ffi_prep_args
+ * r11: &ecif
+ * r10: size
+ * r9: cif->flags
+ * r8: ecif.rvalue
+ * sp+0: cif->rstruct_flag
+ * sp+4: fn */
+
+ .text
+ .align 1
+ .globl ffi_call_SYSV
+ .type ffi_call_SYSV, @function
+ffi_call_SYSV:
+ stm --sp, r0,r1,lr
+ stm --sp, r8-r12
+ mov r0, sp
+
+ /* Make room for all of the new args. */
+ sub sp, r10
+ /* Pad to make way for potential skipped registers */
+ sub sp, 20
+
+ /* Call ffi_prep_args(stack, &ecif). */
+ /* r11 already set */
+ mov r1, r12
+ mov r12, sp
+ icall r1
+
+ /* Save new argument size */
+ mov r1, r12
+
+ /* Move first 5 parameters in registers. */
+ ldm sp++, r8-r12
+
+ /* call (fn) (...). */
+ ld.w r1, r0[36]
+ icall r1
+
+ /* Remove the space we pushed for the args. */
+ mov sp, r0
+
+ /* Load r1 with the rstruct flag. */
+ ld.w r1, sp[32]
+
+ /* Load r9 with the return type code. */
+ ld.w r9, sp[12]
+
+ /* Load r8 with the return value pointer. */
+ ld.w r8, sp[16]
+
+ /* If the return value pointer is NULL, assume no return value. */
+ cp.w r8, 0
+ breq .Lend
+
+ /* Check if return type is actually a struct */
+ cp.w r1, 0
+ breq 1f
+
+ /* Return 8bit */
+ cp.w r9, FFI_TYPE_UINT8
+ breq .Lstore8
+
+ /* Return 16bit */
+ cp.w r9, FFI_TYPE_UINT16
+ breq .Lstore16
+
+1:
+ /* Return 32bit */
+ cp.w r9, FFI_TYPE_UINT32
+ breq .Lstore32
+ cp.w r9, FFI_TYPE_UINT16
+ breq .Lstore32
+ cp.w r9, FFI_TYPE_UINT8
+ breq .Lstore32
+
+ /* Return 64bit */
+ cp.w r9, FFI_TYPE_UINT64
+ breq .Lstore64
+
+ /* Didn't match anything */
+ bral .Lend
+
+.Lstore64:
+ st.w r8[0], r11
+ st.w r8[4], r10
+ bral .Lend
+
+.Lstore32:
+ st.w r8[0], r12
+ bral .Lend
+
+.Lstore16:
+ st.h r8[0], r12
+ bral .Lend
+
+.Lstore8:
+ st.b r8[0], r12
+ bral .Lend
+
+.Lend:
+ sub sp, -20
+ ldm sp++, r0,r1,pc
+
+ .size ffi_call_SYSV, . - ffi_call_SYSV
+
+
+ /* r12: __ctx
+ * r11: __rstruct_flag
+ * r10: __inner */
+
+ .align 1
+ .globl ffi_closure_SYSV
+ .type ffi_closure_SYSV, @function
+ffi_closure_SYSV:
+ stm --sp, r0,lr
+ mov r0, r11
+ mov r8, r10
+ sub r10, sp, -8
+ sub sp, 12
+ st.w sp[8], sp
+ sub r11, sp, -8
+ icall r8
+
+ /* Check if return type is actually a struct */
+ cp.w r0, 0
+ breq 1f
+
+ /* Return 8bit */
+ cp.w r12, FFI_TYPE_UINT8
+ breq .Lget8
+
+ /* Return 16bit */
+ cp.w r12, FFI_TYPE_UINT16
+ breq .Lget16
+
+1:
+ /* Return 32bit */
+ cp.w r12, FFI_TYPE_UINT32
+ breq .Lget32
+ cp.w r12, FFI_TYPE_UINT16
+ breq .Lget32
+ cp.w r12, FFI_TYPE_UINT8
+ breq .Lget32
+
+ /* Return 64bit */
+ cp.w r12, FFI_TYPE_UINT64
+ breq .Lget64
+
+ /* Didn't match anything */
+ bral .Lclend
+
+.Lget64:
+ ld.w r11, sp[0]
+ ld.w r10, sp[4]
+ bral .Lclend
+
+.Lget32:
+ ld.w r12, sp[0]
+ bral .Lclend
+
+.Lget16:
+ ld.uh r12, sp[0]
+ bral .Lclend
+
+.Lget8:
+ ld.ub r12, sp[0]
+ bral .Lclend
+
+.Lclend:
+ sub sp, -12
+ ldm sp++, r0,lr
+ sub sp, -20
+ mov pc, lr
+
+ .size ffi_closure_SYSV, . - ffi_closure_SYSV
+
+#if defined __ELF__ && defined __linux__
+ .section .note.GNU-stack,"",@progbits
+#endif
diff --git a/Modules/_ctypes/libffi/src/closures.c b/Modules/_ctypes/libffi/src/closures.c
new file mode 100644
index 0000000000..0b156e0f00
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/closures.c
@@ -0,0 +1,610 @@
+/* -----------------------------------------------------------------------
+ closures.c - Copyright (c) 2007 Red Hat, Inc.
+ Copyright (C) 2007, 2009 Free Software Foundation, Inc
+
+ Code to allocate and deallocate memory for closures.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+#if defined __linux__ && !defined _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+
+#include <ffi.h>
+#include <ffi_common.h>
+
+#ifndef FFI_MMAP_EXEC_WRIT
+# if __gnu_linux__
+/* This macro indicates it may be forbidden to map anonymous memory
+ with both write and execute permission. Code compiled when this
+ option is defined will attempt to map such pages once, but if it
+ fails, it falls back to creating a temporary file in a writable and
+ executable filesystem and mapping pages from it into separate
+ locations in the virtual memory space, one location writable and
+ another executable. */
+# define FFI_MMAP_EXEC_WRIT 1
+# define HAVE_MNTENT 1
+# endif
+# if defined(X86_WIN32) || defined(X86_WIN64)
+/* Windows systems may have Data Execution Protection (DEP) enabled,
+ which requires the use of VirtualMalloc/VirtualFree to alloc/free
+ executable memory. */
+# define FFI_MMAP_EXEC_WRIT 1
+# endif
+#endif
+
+#if FFI_MMAP_EXEC_WRIT && !defined FFI_MMAP_EXEC_SELINUX
+# ifdef __linux__
+/* When defined to 1 check for SELinux and if SELinux is active,
+ don't attempt PROT_EXEC|PROT_WRITE mapping at all, as that
+ might cause audit messages. */
+# define FFI_MMAP_EXEC_SELINUX 1
+# endif
+#endif
+
+#if FFI_CLOSURES
+
+# if FFI_MMAP_EXEC_WRIT
+
+#define USE_LOCKS 1
+#define USE_DL_PREFIX 1
+#ifdef __GNUC__
+#ifndef USE_BUILTIN_FFS
+#define USE_BUILTIN_FFS 1
+#endif
+#endif
+
+/* We need to use mmap, not sbrk. */
+#define HAVE_MORECORE 0
+
+/* We could, in theory, support mremap, but it wouldn't buy us anything. */
+#define HAVE_MREMAP 0
+
+/* We have no use for this, so save some code and data. */
+#define NO_MALLINFO 1
+
+/* We need all allocations to be in regular segments, otherwise we
+ lose track of the corresponding code address. */
+#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
+
+/* Don't allocate more than a page unless needed. */
+#define DEFAULT_GRANULARITY ((size_t)malloc_getpagesize)
+
+#if FFI_CLOSURE_TEST
+/* Don't release single pages, to avoid a worst-case scenario of
+ continuously allocating and releasing single pages, but release
+ pairs of pages, which should do just as well given that allocations
+ are likely to be small. */
+#define DEFAULT_TRIM_THRESHOLD ((size_t)malloc_getpagesize)
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+#include <string.h>
+#include <stdio.h>
+#if !defined(X86_WIN32) && !defined(X86_WIN64)
+#ifdef HAVE_MNTENT
+#include <mntent.h>
+#endif /* HAVE_MNTENT */
+#include <sys/param.h>
+#include <pthread.h>
+
+/* We don't want sys/mman.h to be included after we redefine mmap and
+ dlmunmap. */
+#include <sys/mman.h>
+#define LACKS_SYS_MMAN_H 1
+
+#if FFI_MMAP_EXEC_SELINUX
+#include <sys/statfs.h>
+#include <stdlib.h>
+
+static int selinux_enabled = -1;
+
+static int
+selinux_enabled_check (void)
+{
+ struct statfs sfs;
+ FILE *f;
+ char *buf = NULL;
+ size_t len = 0;
+
+ if (statfs ("/selinux", &sfs) >= 0
+ && (unsigned int) sfs.f_type == 0xf97cff8cU)
+ return 1;
+ f = fopen ("/proc/mounts", "r");
+ if (f == NULL)
+ return 0;
+ while (getline (&buf, &len, f) >= 0)
+ {
+ char *p = strchr (buf, ' ');
+ if (p == NULL)
+ break;
+ p = strchr (p + 1, ' ');
+ if (p == NULL)
+ break;
+ if (strncmp (p + 1, "selinuxfs ", 10) != 0)
+ {
+ free (buf);
+ fclose (f);
+ return 1;
+ }
+ }
+ free (buf);
+ fclose (f);
+ return 0;
+}
+
+#define is_selinux_enabled() (selinux_enabled >= 0 ? selinux_enabled \
+ : (selinux_enabled = selinux_enabled_check ()))
+
+#else
+
+#define is_selinux_enabled() 0
+
+#endif /* !FFI_MMAP_EXEC_SELINUX */
+
+#elif defined (__CYGWIN__)
+
+#include <sys/mman.h>
+
+/* Cygwin is Linux-like, but not quite that Linux-like. */
+#define is_selinux_enabled() 0
+
+#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
+
+/* Declare all functions defined in dlmalloc.c as static. */
+static void *dlmalloc(size_t);
+static void dlfree(void*);
+static void *dlcalloc(size_t, size_t) MAYBE_UNUSED;
+static void *dlrealloc(void *, size_t) MAYBE_UNUSED;
+static void *dlmemalign(size_t, size_t) MAYBE_UNUSED;
+static void *dlvalloc(size_t) MAYBE_UNUSED;
+static int dlmallopt(int, int) MAYBE_UNUSED;
+static size_t dlmalloc_footprint(void) MAYBE_UNUSED;
+static size_t dlmalloc_max_footprint(void) MAYBE_UNUSED;
+static void** dlindependent_calloc(size_t, size_t, void**) MAYBE_UNUSED;
+static void** dlindependent_comalloc(size_t, size_t*, void**) MAYBE_UNUSED;
+static void *dlpvalloc(size_t) MAYBE_UNUSED;
+static int dlmalloc_trim(size_t) MAYBE_UNUSED;
+static size_t dlmalloc_usable_size(void*) MAYBE_UNUSED;
+static void dlmalloc_stats(void) MAYBE_UNUSED;
+
+#if !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__)
+/* Use these for mmap and munmap within dlmalloc.c. */
+static void *dlmmap(void *, size_t, int, int, int, off_t);
+static int dlmunmap(void *, size_t);
+#endif /* !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__) */
+
+#define mmap dlmmap
+#define munmap dlmunmap
+
+#include "dlmalloc.c"
+
+#undef mmap
+#undef munmap
+
+#if !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__)
+
+/* A mutex used to synchronize access to *exec* variables in this file. */
+static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* A file descriptor of a temporary file from which we'll map
+ executable pages. */
+static int execfd = -1;
+
+/* The amount of space already allocated from the temporary file. */
+static size_t execsize = 0;
+
+/* Open a temporary file name, and immediately unlink it. */
+static int
+open_temp_exec_file_name (char *name)
+{
+ int fd = mkstemp (name);
+
+ if (fd != -1)
+ unlink (name);
+
+ return fd;
+}
+
+/* Open a temporary file in the named directory. */
+static int
+open_temp_exec_file_dir (const char *dir)
+{
+ static const char suffix[] = "/ffiXXXXXX";
+ int lendir = strlen (dir);
+ char *tempname = __builtin_alloca (lendir + sizeof (suffix));
+
+ if (!tempname)
+ return -1;
+
+ memcpy (tempname, dir, lendir);
+ memcpy (tempname + lendir, suffix, sizeof (suffix));
+
+ return open_temp_exec_file_name (tempname);
+}
+
+/* Open a temporary file in the directory in the named environment
+ variable. */
+static int
+open_temp_exec_file_env (const char *envvar)
+{
+ const char *value = getenv (envvar);
+
+ if (!value)
+ return -1;
+
+ return open_temp_exec_file_dir (value);
+}
+
+#ifdef HAVE_MNTENT
+/* Open a temporary file in an executable and writable mount point
+ listed in the mounts file. Subsequent calls with the same mounts
+ keep searching for mount points in the same file. Providing NULL
+ as the mounts file closes the file. */
+static int
+open_temp_exec_file_mnt (const char *mounts)
+{
+ static const char *last_mounts;
+ static FILE *last_mntent;
+
+ if (mounts != last_mounts)
+ {
+ if (last_mntent)
+ endmntent (last_mntent);
+
+ last_mounts = mounts;
+
+ if (mounts)
+ last_mntent = setmntent (mounts, "r");
+ else
+ last_mntent = NULL;
+ }
+
+ if (!last_mntent)
+ return -1;
+
+ for (;;)
+ {
+ int fd;
+ struct mntent mnt;
+ char buf[MAXPATHLEN * 3];
+
+ if (getmntent_r (last_mntent, &mnt, buf, sizeof (buf)))
+ return -1;
+
+ if (hasmntopt (&mnt, "ro")
+ || hasmntopt (&mnt, "noexec")
+ || access (mnt.mnt_dir, W_OK))
+ continue;
+
+ fd = open_temp_exec_file_dir (mnt.mnt_dir);
+
+ if (fd != -1)
+ return fd;
+ }
+}
+#endif /* HAVE_MNTENT */
+
+/* Instructions to look for a location to hold a temporary file that
+ can be mapped in for execution. */
+static struct
+{
+ int (*func)(const char *);
+ const char *arg;
+ int repeat;
+} open_temp_exec_file_opts[] = {
+ { open_temp_exec_file_env, "TMPDIR", 0 },
+ { open_temp_exec_file_dir, "/tmp", 0 },
+ { open_temp_exec_file_dir, "/var/tmp", 0 },
+ { open_temp_exec_file_dir, "/dev/shm", 0 },
+ { open_temp_exec_file_env, "HOME", 0 },
+#ifdef HAVE_MNTENT
+ { open_temp_exec_file_mnt, "/etc/mtab", 1 },
+ { open_temp_exec_file_mnt, "/proc/mounts", 1 },
+#endif /* HAVE_MNTENT */
+};
+
+/* Current index into open_temp_exec_file_opts. */
+static int open_temp_exec_file_opts_idx = 0;
+
+/* Reset a current multi-call func, then advances to the next entry.
+ If we're at the last, go back to the first and return nonzero,
+ otherwise return zero. */
+static int
+open_temp_exec_file_opts_next (void)
+{
+ if (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat)
+ open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func (NULL);
+
+ open_temp_exec_file_opts_idx++;
+ if (open_temp_exec_file_opts_idx
+ == (sizeof (open_temp_exec_file_opts)
+ / sizeof (*open_temp_exec_file_opts)))
+ {
+ open_temp_exec_file_opts_idx = 0;
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Return a file descriptor of a temporary zero-sized file in a
+ writable and exexutable filesystem. */
+static int
+open_temp_exec_file (void)
+{
+ int fd;
+
+ do
+ {
+ fd = open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func
+ (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].arg);
+
+ if (!open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat
+ || fd == -1)
+ {
+ if (open_temp_exec_file_opts_next ())
+ break;
+ }
+ }
+ while (fd == -1);
+
+ return fd;
+}
+
+/* Map in a chunk of memory from the temporary exec file into separate
+ locations in the virtual memory address space, one writable and one
+ executable. Returns the address of the writable portion, after
+ storing an offset to the corresponding executable portion at the
+ last word of the requested chunk. */
+static void *
+dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset)
+{
+ void *ptr;
+
+ if (execfd == -1)
+ {
+ open_temp_exec_file_opts_idx = 0;
+ retry_open:
+ execfd = open_temp_exec_file ();
+ if (execfd == -1)
+ return MFAIL;
+ }
+
+ offset = execsize;
+
+ if (ftruncate (execfd, offset + length))
+ return MFAIL;
+
+ flags &= ~(MAP_PRIVATE | MAP_ANONYMOUS);
+ flags |= MAP_SHARED;
+
+ ptr = mmap (NULL, length, (prot & ~PROT_WRITE) | PROT_EXEC,
+ flags, execfd, offset);
+ if (ptr == MFAIL)
+ {
+ if (!offset)
+ {
+ close (execfd);
+ goto retry_open;
+ }
+ ftruncate (execfd, offset);
+ return MFAIL;
+ }
+ else if (!offset
+ && open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat)
+ open_temp_exec_file_opts_next ();
+
+ start = mmap (start, length, prot, flags, execfd, offset);
+
+ if (start == MFAIL)
+ {
+ munmap (ptr, length);
+ ftruncate (execfd, offset);
+ return start;
+ }
+
+ mmap_exec_offset ((char *)start, length) = (char*)ptr - (char*)start;
+
+ execsize += length;
+
+ return start;
+}
+
+/* Map in a writable and executable chunk of memory if possible.
+ Failing that, fall back to dlmmap_locked. */
+static void *
+dlmmap (void *start, size_t length, int prot,
+ int flags, int fd, off_t offset)
+{
+ void *ptr;
+
+ assert (start == NULL && length % malloc_getpagesize == 0
+ && prot == (PROT_READ | PROT_WRITE)
+ && flags == (MAP_PRIVATE | MAP_ANONYMOUS)
+ && fd == -1 && offset == 0);
+
+#if FFI_CLOSURE_TEST
+ printf ("mapping in %zi\n", length);
+#endif
+
+ if (execfd == -1 && !is_selinux_enabled ())
+ {
+ ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset);
+
+ if (ptr != MFAIL || (errno != EPERM && errno != EACCES))
+ /* Cool, no need to mess with separate segments. */
+ return ptr;
+
+ /* If MREMAP_DUP is ever introduced and implemented, try mmap
+ with ((prot & ~PROT_WRITE) | PROT_EXEC) and mremap with
+ MREMAP_DUP and prot at this point. */
+ }
+
+ if (execsize == 0 || execfd == -1)
+ {
+ pthread_mutex_lock (&open_temp_exec_file_mutex);
+ ptr = dlmmap_locked (start, length, prot, flags, offset);
+ pthread_mutex_unlock (&open_temp_exec_file_mutex);
+
+ return ptr;
+ }
+
+ return dlmmap_locked (start, length, prot, flags, offset);
+}
+
+/* Release memory at the given address, as well as the corresponding
+ executable page if it's separate. */
+static int
+dlmunmap (void *start, size_t length)
+{
+ /* We don't bother decreasing execsize or truncating the file, since
+ we can't quite tell whether we're unmapping the end of the file.
+ We don't expect frequent deallocation anyway. If we did, we
+ could locate pages in the file by writing to the pages being
+ deallocated and checking that the file contents change.
+ Yuck. */
+ msegmentptr seg = segment_holding (gm, start);
+ void *code;
+
+#if FFI_CLOSURE_TEST
+ printf ("unmapping %zi\n", length);
+#endif
+
+ if (seg && (code = add_segment_exec_offset (start, seg)) != start)
+ {
+ int ret = munmap (code, length);
+ if (ret)
+ return ret;
+ }
+
+ return munmap (start, length);
+}
+
+#if FFI_CLOSURE_FREE_CODE
+/* Return segment holding given code address. */
+static msegmentptr
+segment_holding_code (mstate m, char* addr)
+{
+ msegmentptr sp = &m->seg;
+ for (;;) {
+ if (addr >= add_segment_exec_offset (sp->base, sp)
+ && addr < add_segment_exec_offset (sp->base, sp) + sp->size)
+ return sp;
+ if ((sp = sp->next) == 0)
+ return 0;
+ }
+}
+#endif
+
+#endif /* !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__) */
+
+/* Allocate a chunk of memory with the given size. Returns a pointer
+ to the writable address, and sets *CODE to the executable
+ corresponding virtual address. */
+void *
+ffi_closure_alloc (size_t size, void **code)
+{
+ void *ptr;
+
+ if (!code)
+ return NULL;
+
+ ptr = dlmalloc (size);
+
+ if (ptr)
+ {
+ msegmentptr seg = segment_holding (gm, ptr);
+
+ *code = add_segment_exec_offset (ptr, seg);
+ }
+
+ return ptr;
+}
+
+/* Release a chunk of memory allocated with ffi_closure_alloc. If
+ FFI_CLOSURE_FREE_CODE is nonzero, the given address can be the
+ writable or the executable address given. Otherwise, only the
+ writable address can be provided here. */
+void
+ffi_closure_free (void *ptr)
+{
+#if FFI_CLOSURE_FREE_CODE
+ msegmentptr seg = segment_holding_code (gm, ptr);
+
+ if (seg)
+ ptr = sub_segment_exec_offset (ptr, seg);
+#endif
+
+ dlfree (ptr);
+}
+
+
+#if FFI_CLOSURE_TEST
+/* Do some internal sanity testing to make sure allocation and
+ deallocation of pages are working as intended. */
+int main ()
+{
+ void *p[3];
+#define GET(idx, len) do { p[idx] = dlmalloc (len); printf ("allocated %zi for p[%i]\n", (len), (idx)); } while (0)
+#define PUT(idx) do { printf ("freeing p[%i]\n", (idx)); dlfree (p[idx]); } while (0)
+ GET (0, malloc_getpagesize / 2);
+ GET (1, 2 * malloc_getpagesize - 64 * sizeof (void*));
+ PUT (1);
+ GET (1, 2 * malloc_getpagesize);
+ GET (2, malloc_getpagesize / 2);
+ PUT (1);
+ PUT (0);
+ PUT (2);
+ return 0;
+}
+#endif /* FFI_CLOSURE_TEST */
+# else /* ! FFI_MMAP_EXEC_WRIT */
+
+/* On many systems, memory returned by malloc is writable and
+ executable, so just use it. */
+
+#include <stdlib.h>
+
+void *
+ffi_closure_alloc (size_t size, void **code)
+{
+ if (!code)
+ return NULL;
+
+ return *code = malloc (size);
+}
+
+void
+ffi_closure_free (void *ptr)
+{
+ free (ptr);
+}
+
+# endif /* ! FFI_MMAP_EXEC_WRIT */
+#endif /* FFI_CLOSURES */
diff --git a/Modules/_ctypes/libffi/src/darwin/ffitarget.h b/Modules/_ctypes/libffi/src/darwin/ffitarget.h
deleted file mode 100644
index 2dc308ac3e..0000000000
--- a/Modules/_ctypes/libffi/src/darwin/ffitarget.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * This file is for MacOSX only. Dispatch to the right architecture include
- * file based on the current archictecture (instead of relying on a symlink
- * created by configure). This makes is possible to build a univeral binary
- * of ctypes in one go.
- */
-#if defined(__i386__)
-
-#ifndef X86_DARWIN
-#define X86_DARWIN
-#endif
-#undef POWERPC_DARWIN
-
-#include "../src/x86/ffitarget.h"
-
-#elif defined(__ppc__)
-
-#ifndef POWERPC_DARWIN
-#define POWERPC_DARWIN
-#endif
-#undef X86_DARWIN
-
-#include "../src/powerpc/ffitarget.h"
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/debug.c b/Modules/_ctypes/libffi/src/debug.c
new file mode 100644
index 0000000000..51dcfcf229
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/debug.c
@@ -0,0 +1,59 @@
+/* -----------------------------------------------------------------------
+ debug.c - Copyright (c) 1996 Red Hat, Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+#include <ffi.h>
+#include <ffi_common.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+/* General debugging routines */
+
+void ffi_stop_here(void)
+{
+ /* This function is only useful for debugging purposes.
+ Place a breakpoint on ffi_stop_here to be notified of
+ significant events. */
+}
+
+/* This function should only be called via the FFI_ASSERT() macro */
+
+void ffi_assert(char *expr, char *file, int line)
+{
+ fprintf(stderr, "ASSERTION FAILURE: %s at %s:%d\n", expr, file, line);
+ ffi_stop_here();
+ abort();
+}
+
+/* Perform a sanity check on an ffi_type structure */
+
+void ffi_type_test(ffi_type *a, char *file, int line)
+{
+ FFI_ASSERT_AT(a != NULL, file, line);
+
+ FFI_ASSERT_AT(a->type <= FFI_TYPE_LAST, file, line);
+ FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->size > 0, file, line);
+ FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->alignment > 0, file, line);
+ FFI_ASSERT_AT(a->type != FFI_TYPE_STRUCT || a->elements != NULL, file, line);
+
+}
diff --git a/Modules/_ctypes/libffi/src/dlmalloc.c b/Modules/_ctypes/libffi/src/dlmalloc.c
new file mode 100644
index 0000000000..783c5c2a6f
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/dlmalloc.c
@@ -0,0 +1,5099 @@
+/*
+ This is a version (aka dlmalloc) of malloc/free/realloc written by
+ Doug Lea and released to the public domain, as explained at
+ http://creativecommons.org/licenses/publicdomain. Send questions,
+ comments, complaints, performance data, etc to dl@cs.oswego.edu
+
+* Version 2.8.3 Thu Sep 22 11:16:15 2005 Doug Lea (dl at gee)
+
+ Note: There may be an updated version of this malloc obtainable at
+ ftp://gee.cs.oswego.edu/pub/misc/malloc.c
+ Check before installing!
+
+* Quickstart
+
+ This library is all in one file to simplify the most common usage:
+ ftp it, compile it (-O3), and link it into another program. All of
+ the compile-time options default to reasonable values for use on
+ most platforms. You might later want to step through various
+ compile-time and dynamic tuning options.
+
+ For convenience, an include file for code using this malloc is at:
+ ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h
+ You don't really need this .h file unless you call functions not
+ defined in your system include files. The .h file contains only the
+ excerpts from this file needed for using this malloc on ANSI C/C++
+ systems, so long as you haven't changed compile-time options about
+ naming and tuning parameters. If you do, then you can create your
+ own malloc.h that does include all settings by cutting at the point
+ indicated below. Note that you may already by default be using a C
+ library containing a malloc that is based on some version of this
+ malloc (for example in linux). You might still want to use the one
+ in this file to customize settings or to avoid overheads associated
+ with library versions.
+
+* Vital statistics:
+
+ Supported pointer/size_t representation: 4 or 8 bytes
+ size_t MUST be an unsigned type of the same width as
+ pointers. (If you are using an ancient system that declares
+ size_t as a signed type, or need it to be a different width
+ than pointers, you can use a previous release of this malloc
+ (e.g. 2.7.2) supporting these.)
+
+ Alignment: 8 bytes (default)
+ This suffices for nearly all current machines and C compilers.
+ However, you can define MALLOC_ALIGNMENT to be wider than this
+ if necessary (up to 128bytes), at the expense of using more space.
+
+ Minimum overhead per allocated chunk: 4 or 8 bytes (if 4byte sizes)
+ 8 or 16 bytes (if 8byte sizes)
+ Each malloced chunk has a hidden word of overhead holding size
+ and status information, and additional cross-check word
+ if FOOTERS is defined.
+
+ Minimum allocated size: 4-byte ptrs: 16 bytes (including overhead)
+ 8-byte ptrs: 32 bytes (including overhead)
+
+ Even a request for zero bytes (i.e., malloc(0)) returns a
+ pointer to something of the minimum allocatable size.
+ The maximum overhead wastage (i.e., number of extra bytes
+ allocated than were requested in malloc) is less than or equal
+ to the minimum size, except for requests >= mmap_threshold that
+ are serviced via mmap(), where the worst case wastage is about
+ 32 bytes plus the remainder from a system page (the minimal
+ mmap unit); typically 4096 or 8192 bytes.
+
+ Security: static-safe; optionally more or less
+ The "security" of malloc refers to the ability of malicious
+ code to accentuate the effects of errors (for example, freeing
+ space that is not currently malloc'ed or overwriting past the
+ ends of chunks) in code that calls malloc. This malloc
+ guarantees not to modify any memory locations below the base of
+ heap, i.e., static variables, even in the presence of usage
+ errors. The routines additionally detect most improper frees
+ and reallocs. All this holds as long as the static bookkeeping
+ for malloc itself is not corrupted by some other means. This
+ is only one aspect of security -- these checks do not, and
+ cannot, detect all possible programming errors.
+
+ If FOOTERS is defined nonzero, then each allocated chunk
+ carries an additional check word to verify that it was malloced
+ from its space. These check words are the same within each
+ execution of a program using malloc, but differ across
+ executions, so externally crafted fake chunks cannot be
+ freed. This improves security by rejecting frees/reallocs that
+ could corrupt heap memory, in addition to the checks preventing
+ writes to statics that are always on. This may further improve
+ security at the expense of time and space overhead. (Note that
+ FOOTERS may also be worth using with MSPACES.)
+
+ By default detected errors cause the program to abort (calling
+ "abort()"). You can override this to instead proceed past
+ errors by defining PROCEED_ON_ERROR. In this case, a bad free
+ has no effect, and a malloc that encounters a bad address
+ caused by user overwrites will ignore the bad address by
+ dropping pointers and indices to all known memory. This may
+ be appropriate for programs that should continue if at all
+ possible in the face of programming errors, although they may
+ run out of memory because dropped memory is never reclaimed.
+
+ If you don't like either of these options, you can define
+ CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything
+ else. And if if you are sure that your program using malloc has
+ no errors or vulnerabilities, you can define INSECURE to 1,
+ which might (or might not) provide a small performance improvement.
+
+ Thread-safety: NOT thread-safe unless USE_LOCKS defined
+ When USE_LOCKS is defined, each public call to malloc, free,
+ etc is surrounded with either a pthread mutex or a win32
+ spinlock (depending on WIN32). This is not especially fast, and
+ can be a major bottleneck. It is designed only to provide
+ minimal protection in concurrent environments, and to provide a
+ basis for extensions. If you are using malloc in a concurrent
+ program, consider instead using ptmalloc, which is derived from
+ a version of this malloc. (See http://www.malloc.de).
+
+ System requirements: Any combination of MORECORE and/or MMAP/MUNMAP
+ This malloc can use unix sbrk or any emulation (invoked using
+ the CALL_MORECORE macro) and/or mmap/munmap or any emulation
+ (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system
+ memory. On most unix systems, it tends to work best if both
+ MORECORE and MMAP are enabled. On Win32, it uses emulations
+ based on VirtualAlloc. It also uses common C library functions
+ like memset.
+
+ Compliance: I believe it is compliant with the Single Unix Specification
+ (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably
+ others as well.
+
+* Overview of algorithms
+
+ This is not the fastest, most space-conserving, most portable, or
+ most tunable malloc ever written. However it is among the fastest
+ while also being among the most space-conserving, portable and
+ tunable. Consistent balance across these factors results in a good
+ general-purpose allocator for malloc-intensive programs.
+
+ In most ways, this malloc is a best-fit allocator. Generally, it
+ chooses the best-fitting existing chunk for a request, with ties
+ broken in approximately least-recently-used order. (This strategy
+ normally maintains low fragmentation.) However, for requests less
+ than 256bytes, it deviates from best-fit when there is not an
+ exactly fitting available chunk by preferring to use space adjacent
+ to that used for the previous small request, as well as by breaking
+ ties in approximately most-recently-used order. (These enhance
+ locality of series of small allocations.) And for very large requests
+ (>= 256Kb by default), it relies on system memory mapping
+ facilities, if supported. (This helps avoid carrying around and
+ possibly fragmenting memory used only for large chunks.)
+
+ All operations (except malloc_stats and mallinfo) have execution
+ times that are bounded by a constant factor of the number of bits in
+ a size_t, not counting any clearing in calloc or copying in realloc,
+ or actions surrounding MORECORE and MMAP that have times
+ proportional to the number of non-contiguous regions returned by
+ system allocation routines, which is often just 1.
+
+ The implementation is not very modular and seriously overuses
+ macros. Perhaps someday all C compilers will do as good a job
+ inlining modular code as can now be done by brute-force expansion,
+ but now, enough of them seem not to.
+
+ Some compilers issue a lot of warnings about code that is
+ dead/unreachable only on some platforms, and also about intentional
+ uses of negation on unsigned types. All known cases of each can be
+ ignored.
+
+ For a longer but out of date high-level description, see
+ http://gee.cs.oswego.edu/dl/html/malloc.html
+
+* MSPACES
+ If MSPACES is defined, then in addition to malloc, free, etc.,
+ this file also defines mspace_malloc, mspace_free, etc. These
+ are versions of malloc routines that take an "mspace" argument
+ obtained using create_mspace, to control all internal bookkeeping.
+ If ONLY_MSPACES is defined, only these versions are compiled.
+ So if you would like to use this allocator for only some allocations,
+ and your system malloc for others, you can compile with
+ ONLY_MSPACES and then do something like...
+ static mspace mymspace = create_mspace(0,0); // for example
+ #define mymalloc(bytes) mspace_malloc(mymspace, bytes)
+
+ (Note: If you only need one instance of an mspace, you can instead
+ use "USE_DL_PREFIX" to relabel the global malloc.)
+
+ You can similarly create thread-local allocators by storing
+ mspaces as thread-locals. For example:
+ static __thread mspace tlms = 0;
+ void* tlmalloc(size_t bytes) {
+ if (tlms == 0) tlms = create_mspace(0, 0);
+ return mspace_malloc(tlms, bytes);
+ }
+ void tlfree(void* mem) { mspace_free(tlms, mem); }
+
+ Unless FOOTERS is defined, each mspace is completely independent.
+ You cannot allocate from one and free to another (although
+ conformance is only weakly checked, so usage errors are not always
+ caught). If FOOTERS is defined, then each chunk carries around a tag
+ indicating its originating mspace, and frees are directed to their
+ originating spaces.
+
+ ------------------------- Compile-time options ---------------------------
+
+Be careful in setting #define values for numerical constants of type
+size_t. On some systems, literal values are not automatically extended
+to size_t precision unless they are explicitly casted.
+
+WIN32 default: defined if _WIN32 defined
+ Defining WIN32 sets up defaults for MS environment and compilers.
+ Otherwise defaults are for unix.
+
+MALLOC_ALIGNMENT default: (size_t)8
+ Controls the minimum alignment for malloc'ed chunks. It must be a
+ power of two and at least 8, even on machines for which smaller
+ alignments would suffice. It may be defined as larger than this
+ though. Note however that code and data structures are optimized for
+ the case of 8-byte alignment.
+
+MSPACES default: 0 (false)
+ If true, compile in support for independent allocation spaces.
+ This is only supported if HAVE_MMAP is true.
+
+ONLY_MSPACES default: 0 (false)
+ If true, only compile in mspace versions, not regular versions.
+
+USE_LOCKS default: 0 (false)
+ Causes each call to each public routine to be surrounded with
+ pthread or WIN32 mutex lock/unlock. (If set true, this can be
+ overridden on a per-mspace basis for mspace versions.)
+
+FOOTERS default: 0
+ If true, provide extra checking and dispatching by placing
+ information in the footers of allocated chunks. This adds
+ space and time overhead.
+
+INSECURE default: 0
+ If true, omit checks for usage errors and heap space overwrites.
+
+USE_DL_PREFIX default: NOT defined
+ Causes compiler to prefix all public routines with the string 'dl'.
+ This can be useful when you only want to use this malloc in one part
+ of a program, using your regular system malloc elsewhere.
+
+ABORT default: defined as abort()
+ Defines how to abort on failed checks. On most systems, a failed
+ check cannot die with an "assert" or even print an informative
+ message, because the underlying print routines in turn call malloc,
+ which will fail again. Generally, the best policy is to simply call
+ abort(). It's not very useful to do more than this because many
+ errors due to overwriting will show up as address faults (null, odd
+ addresses etc) rather than malloc-triggered checks, so will also
+ abort. Also, most compilers know that abort() does not return, so
+ can better optimize code conditionally calling it.
+
+PROCEED_ON_ERROR default: defined as 0 (false)
+ Controls whether detected bad addresses cause them to bypassed
+ rather than aborting. If set, detected bad arguments to free and
+ realloc are ignored. And all bookkeeping information is zeroed out
+ upon a detected overwrite of freed heap space, thus losing the
+ ability to ever return it from malloc again, but enabling the
+ application to proceed. If PROCEED_ON_ERROR is defined, the
+ static variable malloc_corruption_error_count is compiled in
+ and can be examined to see if errors have occurred. This option
+ generates slower code than the default abort policy.
+
+DEBUG default: NOT defined
+ The DEBUG setting is mainly intended for people trying to modify
+ this code or diagnose problems when porting to new platforms.
+ However, it may also be able to better isolate user errors than just
+ using runtime checks. The assertions in the check routines spell
+ out in more detail the assumptions and invariants underlying the
+ algorithms. The checking is fairly extensive, and will slow down
+ execution noticeably. Calling malloc_stats or mallinfo with DEBUG
+ set will attempt to check every non-mmapped allocated and free chunk
+ in the course of computing the summaries.
+
+ABORT_ON_ASSERT_FAILURE default: defined as 1 (true)
+ Debugging assertion failures can be nearly impossible if your
+ version of the assert macro causes malloc to be called, which will
+ lead to a cascade of further failures, blowing the runtime stack.
+ ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(),
+ which will usually make debugging easier.
+
+MALLOC_FAILURE_ACTION default: sets errno to ENOMEM, or no-op on win32
+ The action to take before "return 0" when malloc fails to be able to
+ return memory because there is none available.
+
+HAVE_MORECORE default: 1 (true) unless win32 or ONLY_MSPACES
+ True if this system supports sbrk or an emulation of it.
+
+MORECORE default: sbrk
+ The name of the sbrk-style system routine to call to obtain more
+ memory. See below for guidance on writing custom MORECORE
+ functions. The type of the argument to sbrk/MORECORE varies across
+ systems. It cannot be size_t, because it supports negative
+ arguments, so it is normally the signed type of the same width as
+ size_t (sometimes declared as "intptr_t"). It doesn't much matter
+ though. Internally, we only call it with arguments less than half
+ the max value of a size_t, which should work across all reasonable
+ possibilities, although sometimes generating compiler warnings. See
+ near the end of this file for guidelines for creating a custom
+ version of MORECORE.
+
+MORECORE_CONTIGUOUS default: 1 (true)
+ If true, take advantage of fact that consecutive calls to MORECORE
+ with positive arguments always return contiguous increasing
+ addresses. This is true of unix sbrk. It does not hurt too much to
+ set it true anyway, since malloc copes with non-contiguities.
+ Setting it false when definitely non-contiguous saves time
+ and possibly wasted space it would take to discover this though.
+
+MORECORE_CANNOT_TRIM default: NOT defined
+ True if MORECORE cannot release space back to the system when given
+ negative arguments. This is generally necessary only if you are
+ using a hand-crafted MORECORE function that cannot handle negative
+ arguments.
+
+HAVE_MMAP default: 1 (true)
+ True if this system supports mmap or an emulation of it. If so, and
+ HAVE_MORECORE is not true, MMAP is used for all system
+ allocation. If set and HAVE_MORECORE is true as well, MMAP is
+ primarily used to directly allocate very large blocks. It is also
+ used as a backup strategy in cases where MORECORE fails to provide
+ space from system. Note: A single call to MUNMAP is assumed to be
+ able to unmap memory that may have be allocated using multiple calls
+ to MMAP, so long as they are adjacent.
+
+HAVE_MREMAP default: 1 on linux, else 0
+ If true realloc() uses mremap() to re-allocate large blocks and
+ extend or shrink allocation spaces.
+
+MMAP_CLEARS default: 1 on unix
+ True if mmap clears memory so calloc doesn't need to. This is true
+ for standard unix mmap using /dev/zero.
+
+USE_BUILTIN_FFS default: 0 (i.e., not used)
+ Causes malloc to use the builtin ffs() function to compute indices.
+ Some compilers may recognize and intrinsify ffs to be faster than the
+ supplied C version. Also, the case of x86 using gcc is special-cased
+ to an asm instruction, so is already as fast as it can be, and so
+ this setting has no effect. (On most x86s, the asm version is only
+ slightly faster than the C version.)
+
+malloc_getpagesize default: derive from system includes, or 4096.
+ The system page size. To the extent possible, this malloc manages
+ memory from the system in page-size units. This may be (and
+ usually is) a function rather than a constant. This is ignored
+ if WIN32, where page size is determined using getSystemInfo during
+ initialization.
+
+USE_DEV_RANDOM default: 0 (i.e., not used)
+ Causes malloc to use /dev/random to initialize secure magic seed for
+ stamping footers. Otherwise, the current time is used.
+
+NO_MALLINFO default: 0
+ If defined, don't compile "mallinfo". This can be a simple way
+ of dealing with mismatches between system declarations and
+ those in this file.
+
+MALLINFO_FIELD_TYPE default: size_t
+ The type of the fields in the mallinfo struct. This was originally
+ defined as "int" in SVID etc, but is more usefully defined as
+ size_t. The value is used only if HAVE_USR_INCLUDE_MALLOC_H is not set
+
+REALLOC_ZERO_BYTES_FREES default: not defined
+ This should be set if a call to realloc with zero bytes should
+ be the same as a call to free. Some people think it should. Otherwise,
+ since this malloc returns a unique pointer for malloc(0), so does
+ realloc(p, 0).
+
+LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H
+LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H, LACKS_ERRNO_H
+LACKS_STDLIB_H default: NOT defined unless on WIN32
+ Define these if your system does not have these header files.
+ You might need to manually insert some of the declarations they provide.
+
+DEFAULT_GRANULARITY default: page size if MORECORE_CONTIGUOUS,
+ system_info.dwAllocationGranularity in WIN32,
+ otherwise 64K.
+ Also settable using mallopt(M_GRANULARITY, x)
+ The unit for allocating and deallocating memory from the system. On
+ most systems with contiguous MORECORE, there is no reason to
+ make this more than a page. However, systems with MMAP tend to
+ either require or encourage larger granularities. You can increase
+ this value to prevent system allocation functions to be called so
+ often, especially if they are slow. The value must be at least one
+ page and must be a power of two. Setting to 0 causes initialization
+ to either page size or win32 region size. (Note: In previous
+ versions of malloc, the equivalent of this option was called
+ "TOP_PAD")
+
+DEFAULT_TRIM_THRESHOLD default: 2MB
+ Also settable using mallopt(M_TRIM_THRESHOLD, x)
+ The maximum amount of unused top-most memory to keep before
+ releasing via malloc_trim in free(). Automatic trimming is mainly
+ useful in long-lived programs using contiguous MORECORE. Because
+ trimming via sbrk can be slow on some systems, and can sometimes be
+ wasteful (in cases where programs immediately afterward allocate
+ more large chunks) the value should be high enough so that your
+ overall system performance would improve by releasing this much
+ memory. As a rough guide, you might set to a value close to the
+ average size of a process (program) running on your system.
+ Releasing this much memory would allow such a process to run in
+ memory. Generally, it is worth tuning trim thresholds when a
+ program undergoes phases where several large chunks are allocated
+ and released in ways that can reuse each other's storage, perhaps
+ mixed with phases where there are no such chunks at all. The trim
+ value must be greater than page size to have any useful effect. To
+ disable trimming completely, you can set to MAX_SIZE_T. Note that the trick
+ some people use of mallocing a huge space and then freeing it at
+ program startup, in an attempt to reserve system memory, doesn't
+ have the intended effect under automatic trimming, since that memory
+ will immediately be returned to the system.
+
+DEFAULT_MMAP_THRESHOLD default: 256K
+ Also settable using mallopt(M_MMAP_THRESHOLD, x)
+ The request size threshold for using MMAP to directly service a
+ request. Requests of at least this size that cannot be allocated
+ using already-existing space will be serviced via mmap. (If enough
+ normal freed space already exists it is used instead.) Using mmap
+ segregates relatively large chunks of memory so that they can be
+ individually obtained and released from the host system. A request
+ serviced through mmap is never reused by any other request (at least
+ not directly; the system may just so happen to remap successive
+ requests to the same locations). Segregating space in this way has
+ the benefits that: Mmapped space can always be individually released
+ back to the system, which helps keep the system level memory demands
+ of a long-lived program low. Also, mapped memory doesn't become
+ `locked' between other chunks, as can happen with normally allocated
+ chunks, which means that even trimming via malloc_trim would not
+ release them. However, it has the disadvantage that the space
+ cannot be reclaimed, consolidated, and then used to service later
+ requests, as happens with normal chunks. The advantages of mmap
+ nearly always outweigh disadvantages for "large" chunks, but the
+ value of "large" may vary across systems. The default is an
+ empirically derived value that works well in most systems. You can
+ disable mmap by setting to MAX_SIZE_T.
+
+*/
+
+#ifndef WIN32
+#ifdef _WIN32
+#define WIN32 1
+#endif /* _WIN32 */
+#endif /* WIN32 */
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#define HAVE_MMAP 1
+#define HAVE_MORECORE 0
+#define LACKS_UNISTD_H
+#define LACKS_SYS_PARAM_H
+#define LACKS_SYS_MMAN_H
+#define LACKS_STRING_H
+#define LACKS_STRINGS_H
+#define LACKS_SYS_TYPES_H
+#define LACKS_ERRNO_H
+#define MALLOC_FAILURE_ACTION
+#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
+#endif /* WIN32 */
+
+#if defined(DARWIN) || defined(_DARWIN)
+/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */
+#ifndef HAVE_MORECORE
+#define HAVE_MORECORE 0
+#define HAVE_MMAP 1
+#endif /* HAVE_MORECORE */
+#endif /* DARWIN */
+
+#ifndef LACKS_SYS_TYPES_H
+#include <sys/types.h> /* For size_t */
+#endif /* LACKS_SYS_TYPES_H */
+
+/* The maximum possible size_t value has all bits set */
+#define MAX_SIZE_T (~(size_t)0)
+
+#ifndef ONLY_MSPACES
+#define ONLY_MSPACES 0
+#endif /* ONLY_MSPACES */
+#ifndef MSPACES
+#if ONLY_MSPACES
+#define MSPACES 1
+#else /* ONLY_MSPACES */
+#define MSPACES 0
+#endif /* ONLY_MSPACES */
+#endif /* MSPACES */
+#ifndef MALLOC_ALIGNMENT
+#define MALLOC_ALIGNMENT ((size_t)8U)
+#endif /* MALLOC_ALIGNMENT */
+#ifndef FOOTERS
+#define FOOTERS 0
+#endif /* FOOTERS */
+#ifndef ABORT
+#define ABORT abort()
+#endif /* ABORT */
+#ifndef ABORT_ON_ASSERT_FAILURE
+#define ABORT_ON_ASSERT_FAILURE 1
+#endif /* ABORT_ON_ASSERT_FAILURE */
+#ifndef PROCEED_ON_ERROR
+#define PROCEED_ON_ERROR 0
+#endif /* PROCEED_ON_ERROR */
+#ifndef USE_LOCKS
+#define USE_LOCKS 0
+#endif /* USE_LOCKS */
+#ifndef INSECURE
+#define INSECURE 0
+#endif /* INSECURE */
+#ifndef HAVE_MMAP
+#define HAVE_MMAP 1
+#endif /* HAVE_MMAP */
+#ifndef MMAP_CLEARS
+#define MMAP_CLEARS 1
+#endif /* MMAP_CLEARS */
+#ifndef HAVE_MREMAP
+#ifdef linux
+#define HAVE_MREMAP 1
+#else /* linux */
+#define HAVE_MREMAP 0
+#endif /* linux */
+#endif /* HAVE_MREMAP */
+#ifndef MALLOC_FAILURE_ACTION
+#define MALLOC_FAILURE_ACTION errno = ENOMEM;
+#endif /* MALLOC_FAILURE_ACTION */
+#ifndef HAVE_MORECORE
+#if ONLY_MSPACES
+#define HAVE_MORECORE 0
+#else /* ONLY_MSPACES */
+#define HAVE_MORECORE 1
+#endif /* ONLY_MSPACES */
+#endif /* HAVE_MORECORE */
+#if !HAVE_MORECORE
+#define MORECORE_CONTIGUOUS 0
+#else /* !HAVE_MORECORE */
+#ifndef MORECORE
+#define MORECORE sbrk
+#endif /* MORECORE */
+#ifndef MORECORE_CONTIGUOUS
+#define MORECORE_CONTIGUOUS 1
+#endif /* MORECORE_CONTIGUOUS */
+#endif /* HAVE_MORECORE */
+#ifndef DEFAULT_GRANULARITY
+#if MORECORE_CONTIGUOUS
+#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */
+#else /* MORECORE_CONTIGUOUS */
+#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U)
+#endif /* MORECORE_CONTIGUOUS */
+#endif /* DEFAULT_GRANULARITY */
+#ifndef DEFAULT_TRIM_THRESHOLD
+#ifndef MORECORE_CANNOT_TRIM
+#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U)
+#else /* MORECORE_CANNOT_TRIM */
+#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T
+#endif /* MORECORE_CANNOT_TRIM */
+#endif /* DEFAULT_TRIM_THRESHOLD */
+#ifndef DEFAULT_MMAP_THRESHOLD
+#if HAVE_MMAP
+#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U)
+#else /* HAVE_MMAP */
+#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
+#endif /* HAVE_MMAP */
+#endif /* DEFAULT_MMAP_THRESHOLD */
+#ifndef USE_BUILTIN_FFS
+#define USE_BUILTIN_FFS 0
+#endif /* USE_BUILTIN_FFS */
+#ifndef USE_DEV_RANDOM
+#define USE_DEV_RANDOM 0
+#endif /* USE_DEV_RANDOM */
+#ifndef NO_MALLINFO
+#define NO_MALLINFO 0
+#endif /* NO_MALLINFO */
+#ifndef MALLINFO_FIELD_TYPE
+#define MALLINFO_FIELD_TYPE size_t
+#endif /* MALLINFO_FIELD_TYPE */
+
+/*
+ mallopt tuning options. SVID/XPG defines four standard parameter
+ numbers for mallopt, normally defined in malloc.h. None of these
+ are used in this malloc, so setting them has no effect. But this
+ malloc does support the following options.
+*/
+
+#define M_TRIM_THRESHOLD (-1)
+#define M_GRANULARITY (-2)
+#define M_MMAP_THRESHOLD (-3)
+
+/* ------------------------ Mallinfo declarations ------------------------ */
+
+#if !NO_MALLINFO
+/*
+ This version of malloc supports the standard SVID/XPG mallinfo
+ routine that returns a struct containing usage properties and
+ statistics. It should work on any system that has a
+ /usr/include/malloc.h defining struct mallinfo. The main
+ declaration needed is the mallinfo struct that is returned (by-copy)
+ by mallinfo(). The malloinfo struct contains a bunch of fields that
+ are not even meaningful in this version of malloc. These fields are
+ are instead filled by mallinfo() with other numbers that might be of
+ interest.
+
+ HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
+ /usr/include/malloc.h file that includes a declaration of struct
+ mallinfo. If so, it is included; else a compliant version is
+ declared below. These must be precisely the same for mallinfo() to
+ work. The original SVID version of this struct, defined on most
+ systems with mallinfo, declares all fields as ints. But some others
+ define as unsigned long. If your system defines the fields using a
+ type of different width than listed here, you MUST #include your
+ system version and #define HAVE_USR_INCLUDE_MALLOC_H.
+*/
+
+/* #define HAVE_USR_INCLUDE_MALLOC_H */
+
+#ifdef HAVE_USR_INCLUDE_MALLOC_H
+#include "/usr/include/malloc.h"
+#else /* HAVE_USR_INCLUDE_MALLOC_H */
+
+struct mallinfo {
+ MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */
+ MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */
+ MALLINFO_FIELD_TYPE smblks; /* always 0 */
+ MALLINFO_FIELD_TYPE hblks; /* always 0 */
+ MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */
+ MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */
+ MALLINFO_FIELD_TYPE fsmblks; /* always 0 */
+ MALLINFO_FIELD_TYPE uordblks; /* total allocated space */
+ MALLINFO_FIELD_TYPE fordblks; /* total free space */
+ MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */
+};
+
+#endif /* HAVE_USR_INCLUDE_MALLOC_H */
+#endif /* NO_MALLINFO */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#if !ONLY_MSPACES
+
+/* ------------------- Declarations of public routines ------------------- */
+
+#ifndef USE_DL_PREFIX
+#define dlcalloc calloc
+#define dlfree free
+#define dlmalloc malloc
+#define dlmemalign memalign
+#define dlrealloc realloc
+#define dlvalloc valloc
+#define dlpvalloc pvalloc
+#define dlmallinfo mallinfo
+#define dlmallopt mallopt
+#define dlmalloc_trim malloc_trim
+#define dlmalloc_stats malloc_stats
+#define dlmalloc_usable_size malloc_usable_size
+#define dlmalloc_footprint malloc_footprint
+#define dlmalloc_max_footprint malloc_max_footprint
+#define dlindependent_calloc independent_calloc
+#define dlindependent_comalloc independent_comalloc
+#endif /* USE_DL_PREFIX */
+
+
+/*
+ malloc(size_t n)
+ Returns a pointer to a newly allocated chunk of at least n bytes, or
+ null if no space is available, in which case errno is set to ENOMEM
+ on ANSI C systems.
+
+ If n is zero, malloc returns a minimum-sized chunk. (The minimum
+ size is 16 bytes on most 32bit systems, and 32 bytes on 64bit
+ systems.) Note that size_t is an unsigned type, so calls with
+ arguments that would be negative if signed are interpreted as
+ requests for huge amounts of space, which will often fail. The
+ maximum supported value of n differs across systems, but is in all
+ cases less than the maximum representable value of a size_t.
+*/
+void* dlmalloc(size_t);
+
+/*
+ free(void* p)
+ Releases the chunk of memory pointed to by p, that had been previously
+ allocated using malloc or a related routine such as realloc.
+ It has no effect if p is null. If p was not malloced or already
+ freed, free(p) will by default cause the current program to abort.
+*/
+void dlfree(void*);
+
+/*
+ calloc(size_t n_elements, size_t element_size);
+ Returns a pointer to n_elements * element_size bytes, with all locations
+ set to zero.
+*/
+void* dlcalloc(size_t, size_t);
+
+/*
+ realloc(void* p, size_t n)
+ Returns a pointer to a chunk of size n that contains the same data
+ as does chunk p up to the minimum of (n, p's size) bytes, or null
+ if no space is available.
+
+ The returned pointer may or may not be the same as p. The algorithm
+ prefers extending p in most cases when possible, otherwise it
+ employs the equivalent of a malloc-copy-free sequence.
+
+ If p is null, realloc is equivalent to malloc.
+
+ If space is not available, realloc returns null, errno is set (if on
+ ANSI) and p is NOT freed.
+
+ if n is for fewer bytes than already held by p, the newly unused
+ space is lopped off and freed if possible. realloc with a size
+ argument of zero (re)allocates a minimum-sized chunk.
+
+ The old unix realloc convention of allowing the last-free'd chunk
+ to be used as an argument to realloc is not supported.
+*/
+
+void* dlrealloc(void*, size_t);
+
+/*
+ memalign(size_t alignment, size_t n);
+ Returns a pointer to a newly allocated chunk of n bytes, aligned
+ in accord with the alignment argument.
+
+ The alignment argument should be a power of two. If the argument is
+ not a power of two, the nearest greater power is used.
+ 8-byte alignment is guaranteed by normal malloc calls, so don't
+ bother calling memalign with an argument of 8 or less.
+
+ Overreliance on memalign is a sure way to fragment space.
+*/
+void* dlmemalign(size_t, size_t);
+
+/*
+ valloc(size_t n);
+ Equivalent to memalign(pagesize, n), where pagesize is the page
+ size of the system. If the pagesize is unknown, 4096 is used.
+*/
+void* dlvalloc(size_t);
+
+/*
+ mallopt(int parameter_number, int parameter_value)
+ Sets tunable parameters The format is to provide a
+ (parameter-number, parameter-value) pair. mallopt then sets the
+ corresponding parameter to the argument value if it can (i.e., so
+ long as the value is meaningful), and returns 1 if successful else
+ 0. SVID/XPG/ANSI defines four standard param numbers for mallopt,
+ normally defined in malloc.h. None of these are use in this malloc,
+ so setting them has no effect. But this malloc also supports other
+ options in mallopt. See below for details. Briefly, supported
+ parameters are as follows (listed defaults are for "typical"
+ configurations).
+
+ Symbol param # default allowed param values
+ M_TRIM_THRESHOLD -1 2*1024*1024 any (MAX_SIZE_T disables)
+ M_GRANULARITY -2 page size any power of 2 >= page size
+ M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support)
+*/
+int dlmallopt(int, int);
+
+/*
+ malloc_footprint();
+ Returns the number of bytes obtained from the system. The total
+ number of bytes allocated by malloc, realloc etc., is less than this
+ value. Unlike mallinfo, this function returns only a precomputed
+ result, so can be called frequently to monitor memory consumption.
+ Even if locks are otherwise defined, this function does not use them,
+ so results might not be up to date.
+*/
+size_t dlmalloc_footprint(void);
+
+/*
+ malloc_max_footprint();
+ Returns the maximum number of bytes obtained from the system. This
+ value will be greater than current footprint if deallocated space
+ has been reclaimed by the system. The peak number of bytes allocated
+ by malloc, realloc etc., is less than this value. Unlike mallinfo,
+ this function returns only a precomputed result, so can be called
+ frequently to monitor memory consumption. Even if locks are
+ otherwise defined, this function does not use them, so results might
+ not be up to date.
+*/
+size_t dlmalloc_max_footprint(void);
+
+#if !NO_MALLINFO
+/*
+ mallinfo()
+ Returns (by copy) a struct containing various summary statistics:
+
+ arena: current total non-mmapped bytes allocated from system
+ ordblks: the number of free chunks
+ smblks: always zero.
+ hblks: current number of mmapped regions
+ hblkhd: total bytes held in mmapped regions
+ usmblks: the maximum total allocated space. This will be greater
+ than current total if trimming has occurred.
+ fsmblks: always zero
+ uordblks: current total allocated space (normal or mmapped)
+ fordblks: total free space
+ keepcost: the maximum number of bytes that could ideally be released
+ back to system via malloc_trim. ("ideally" means that
+ it ignores page restrictions etc.)
+
+ Because these fields are ints, but internal bookkeeping may
+ be kept as longs, the reported values may wrap around zero and
+ thus be inaccurate.
+*/
+struct mallinfo dlmallinfo(void);
+#endif /* NO_MALLINFO */
+
+/*
+ independent_calloc(size_t n_elements, size_t element_size, void* chunks[]);
+
+ independent_calloc is similar to calloc, but instead of returning a
+ single cleared space, it returns an array of pointers to n_elements
+ independent elements that can hold contents of size elem_size, each
+ of which starts out cleared, and can be independently freed,
+ realloc'ed etc. The elements are guaranteed to be adjacently
+ allocated (this is not guaranteed to occur with multiple callocs or
+ mallocs), which may also improve cache locality in some
+ applications.
+
+ The "chunks" argument is optional (i.e., may be null, which is
+ probably the most typical usage). If it is null, the returned array
+ is itself dynamically allocated and should also be freed when it is
+ no longer needed. Otherwise, the chunks array must be of at least
+ n_elements in length. It is filled in with the pointers to the
+ chunks.
+
+ In either case, independent_calloc returns this pointer array, or
+ null if the allocation failed. If n_elements is zero and "chunks"
+ is null, it returns a chunk representing an array with zero elements
+ (which should be freed if not wanted).
+
+ Each element must be individually freed when it is no longer
+ needed. If you'd like to instead be able to free all at once, you
+ should instead use regular calloc and assign pointers into this
+ space to represent elements. (In this case though, you cannot
+ independently free elements.)
+
+ independent_calloc simplifies and speeds up implementations of many
+ kinds of pools. It may also be useful when constructing large data
+ structures that initially have a fixed number of fixed-sized nodes,
+ but the number is not known at compile time, and some of the nodes
+ may later need to be freed. For example:
+
+ struct Node { int item; struct Node* next; };
+
+ struct Node* build_list() {
+ struct Node** pool;
+ int n = read_number_of_nodes_needed();
+ if (n <= 0) return 0;
+ pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);
+ if (pool == 0) die();
+ // organize into a linked list...
+ struct Node* first = pool[0];
+ for (i = 0; i < n-1; ++i)
+ pool[i]->next = pool[i+1];
+ free(pool); // Can now free the array (or not, if it is needed later)
+ return first;
+ }
+*/
+void** dlindependent_calloc(size_t, size_t, void**);
+
+/*
+ independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);
+
+ independent_comalloc allocates, all at once, a set of n_elements
+ chunks with sizes indicated in the "sizes" array. It returns
+ an array of pointers to these elements, each of which can be
+ independently freed, realloc'ed etc. The elements are guaranteed to
+ be adjacently allocated (this is not guaranteed to occur with
+ multiple callocs or mallocs), which may also improve cache locality
+ in some applications.
+
+ The "chunks" argument is optional (i.e., may be null). If it is null
+ the returned array is itself dynamically allocated and should also
+ be freed when it is no longer needed. Otherwise, the chunks array
+ must be of at least n_elements in length. It is filled in with the
+ pointers to the chunks.
+
+ In either case, independent_comalloc returns this pointer array, or
+ null if the allocation failed. If n_elements is zero and chunks is
+ null, it returns a chunk representing an array with zero elements
+ (which should be freed if not wanted).
+
+ Each element must be individually freed when it is no longer
+ needed. If you'd like to instead be able to free all at once, you
+ should instead use a single regular malloc, and assign pointers at
+ particular offsets in the aggregate space. (In this case though, you
+ cannot independently free elements.)
+
+ independent_comallac differs from independent_calloc in that each
+ element may have a different size, and also that it does not
+ automatically clear elements.
+
+ independent_comalloc can be used to speed up allocation in cases
+ where several structs or objects must always be allocated at the
+ same time. For example:
+
+ struct Head { ... }
+ struct Foot { ... }
+
+ void send_message(char* msg) {
+ int msglen = strlen(msg);
+ size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };
+ void* chunks[3];
+ if (independent_comalloc(3, sizes, chunks) == 0)
+ die();
+ struct Head* head = (struct Head*)(chunks[0]);
+ char* body = (char*)(chunks[1]);
+ struct Foot* foot = (struct Foot*)(chunks[2]);
+ // ...
+ }
+
+ In general though, independent_comalloc is worth using only for
+ larger values of n_elements. For small values, you probably won't
+ detect enough difference from series of malloc calls to bother.
+
+ Overuse of independent_comalloc can increase overall memory usage,
+ since it cannot reuse existing noncontiguous small chunks that
+ might be available for some of the elements.
+*/
+void** dlindependent_comalloc(size_t, size_t*, void**);
+
+
+/*
+ pvalloc(size_t n);
+ Equivalent to valloc(minimum-page-that-holds(n)), that is,
+ round up n to nearest pagesize.
+ */
+void* dlpvalloc(size_t);
+
+/*
+ malloc_trim(size_t pad);
+
+ If possible, gives memory back to the system (via negative arguments
+ to sbrk) if there is unused memory at the `high' end of the malloc
+ pool or in unused MMAP segments. You can call this after freeing
+ large blocks of memory to potentially reduce the system-level memory
+ requirements of a program. However, it cannot guarantee to reduce
+ memory. Under some allocation patterns, some large free blocks of
+ memory will be locked between two used chunks, so they cannot be
+ given back to the system.
+
+ The `pad' argument to malloc_trim represents the amount of free
+ trailing space to leave untrimmed. If this argument is zero, only
+ the minimum amount of memory to maintain internal data structures
+ will be left. Non-zero arguments can be supplied to maintain enough
+ trailing space to service future expected allocations without having
+ to re-obtain memory from the system.
+
+ Malloc_trim returns 1 if it actually released any memory, else 0.
+*/
+int dlmalloc_trim(size_t);
+
+/*
+ malloc_usable_size(void* p);
+
+ Returns the number of bytes you can actually use in
+ an allocated chunk, which may be more than you requested (although
+ often not) due to alignment and minimum size constraints.
+ You can use this many bytes without worrying about
+ overwriting other allocated objects. This is not a particularly great
+ programming practice. malloc_usable_size can be more useful in
+ debugging and assertions, for example:
+
+ p = malloc(n);
+ assert(malloc_usable_size(p) >= 256);
+*/
+size_t dlmalloc_usable_size(void*);
+
+/*
+ malloc_stats();
+ Prints on stderr the amount of space obtained from the system (both
+ via sbrk and mmap), the maximum amount (which may be more than
+ current if malloc_trim and/or munmap got called), and the current
+ number of bytes allocated via malloc (or realloc, etc) but not yet
+ freed. Note that this is the number of bytes allocated, not the
+ number requested. It will be larger than the number requested
+ because of alignment and bookkeeping overhead. Because it includes
+ alignment wastage as being in use, this figure may be greater than
+ zero even when no user-level chunks are allocated.
+
+ The reported current and maximum system memory can be inaccurate if
+ a program makes other calls to system memory allocation functions
+ (normally sbrk) outside of malloc.
+
+ malloc_stats prints only the most commonly interesting statistics.
+ More information can be obtained by calling mallinfo.
+*/
+void dlmalloc_stats(void);
+
+#endif /* ONLY_MSPACES */
+
+#if MSPACES
+
+/*
+ mspace is an opaque type representing an independent
+ region of space that supports mspace_malloc, etc.
+*/
+typedef void* mspace;
+
+/*
+ create_mspace creates and returns a new independent space with the
+ given initial capacity, or, if 0, the default granularity size. It
+ returns null if there is no system memory available to create the
+ space. If argument locked is non-zero, the space uses a separate
+ lock to control access. The capacity of the space will grow
+ dynamically as needed to service mspace_malloc requests. You can
+ control the sizes of incremental increases of this space by
+ compiling with a different DEFAULT_GRANULARITY or dynamically
+ setting with mallopt(M_GRANULARITY, value).
+*/
+mspace create_mspace(size_t capacity, int locked);
+
+/*
+ destroy_mspace destroys the given space, and attempts to return all
+ of its memory back to the system, returning the total number of
+ bytes freed. After destruction, the results of access to all memory
+ used by the space become undefined.
+*/
+size_t destroy_mspace(mspace msp);
+
+/*
+ create_mspace_with_base uses the memory supplied as the initial base
+ of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this
+ space is used for bookkeeping, so the capacity must be at least this
+ large. (Otherwise 0 is returned.) When this initial space is
+ exhausted, additional memory will be obtained from the system.
+ Destroying this space will deallocate all additionally allocated
+ space (if possible) but not the initial base.
+*/
+mspace create_mspace_with_base(void* base, size_t capacity, int locked);
+
+/*
+ mspace_malloc behaves as malloc, but operates within
+ the given space.
+*/
+void* mspace_malloc(mspace msp, size_t bytes);
+
+/*
+ mspace_free behaves as free, but operates within
+ the given space.
+
+ If compiled with FOOTERS==1, mspace_free is not actually needed.
+ free may be called instead of mspace_free because freed chunks from
+ any space are handled by their originating spaces.
+*/
+void mspace_free(mspace msp, void* mem);
+
+/*
+ mspace_realloc behaves as realloc, but operates within
+ the given space.
+
+ If compiled with FOOTERS==1, mspace_realloc is not actually
+ needed. realloc may be called instead of mspace_realloc because
+ realloced chunks from any space are handled by their originating
+ spaces.
+*/
+void* mspace_realloc(mspace msp, void* mem, size_t newsize);
+
+/*
+ mspace_calloc behaves as calloc, but operates within
+ the given space.
+*/
+void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);
+
+/*
+ mspace_memalign behaves as memalign, but operates within
+ the given space.
+*/
+void* mspace_memalign(mspace msp, size_t alignment, size_t bytes);
+
+/*
+ mspace_independent_calloc behaves as independent_calloc, but
+ operates within the given space.
+*/
+void** mspace_independent_calloc(mspace msp, size_t n_elements,
+ size_t elem_size, void* chunks[]);
+
+/*
+ mspace_independent_comalloc behaves as independent_comalloc, but
+ operates within the given space.
+*/
+void** mspace_independent_comalloc(mspace msp, size_t n_elements,
+ size_t sizes[], void* chunks[]);
+
+/*
+ mspace_footprint() returns the number of bytes obtained from the
+ system for this space.
+*/
+size_t mspace_footprint(mspace msp);
+
+/*
+ mspace_max_footprint() returns the peak number of bytes obtained from the
+ system for this space.
+*/
+size_t mspace_max_footprint(mspace msp);
+
+
+#if !NO_MALLINFO
+/*
+ mspace_mallinfo behaves as mallinfo, but reports properties of
+ the given space.
+*/
+struct mallinfo mspace_mallinfo(mspace msp);
+#endif /* NO_MALLINFO */
+
+/*
+ mspace_malloc_stats behaves as malloc_stats, but reports
+ properties of the given space.
+*/
+void mspace_malloc_stats(mspace msp);
+
+/*
+ mspace_trim behaves as malloc_trim, but
+ operates within the given space.
+*/
+int mspace_trim(mspace msp, size_t pad);
+
+/*
+ An alias for mallopt.
+*/
+int mspace_mallopt(int, int);
+
+#endif /* MSPACES */
+
+#ifdef __cplusplus
+}; /* end of extern "C" */
+#endif /* __cplusplus */
+
+/*
+ ========================================================================
+ To make a fully customizable malloc.h header file, cut everything
+ above this line, put into file malloc.h, edit to suit, and #include it
+ on the next line, as well as in programs that use this malloc.
+ ========================================================================
+*/
+
+/* #include "malloc.h" */
+
+/*------------------------------ internal #includes ---------------------- */
+
+#ifdef _MSC_VER
+#pragma warning( disable : 4146 ) /* no "unsigned" warnings */
+#endif /* _MSC_VER */
+
+#include <stdio.h> /* for printing in malloc_stats */
+
+#ifndef LACKS_ERRNO_H
+#include <errno.h> /* for MALLOC_FAILURE_ACTION */
+#endif /* LACKS_ERRNO_H */
+#if FOOTERS
+#include <time.h> /* for magic initialization */
+#endif /* FOOTERS */
+#ifndef LACKS_STDLIB_H
+#include <stdlib.h> /* for abort() */
+#endif /* LACKS_STDLIB_H */
+#ifdef DEBUG
+#if ABORT_ON_ASSERT_FAILURE
+#define assert(x) if(!(x)) ABORT
+#else /* ABORT_ON_ASSERT_FAILURE */
+#include <assert.h>
+#endif /* ABORT_ON_ASSERT_FAILURE */
+#else /* DEBUG */
+#define assert(x)
+#endif /* DEBUG */
+#ifndef LACKS_STRING_H
+#include <string.h> /* for memset etc */
+#endif /* LACKS_STRING_H */
+#if USE_BUILTIN_FFS
+#ifndef LACKS_STRINGS_H
+#include <strings.h> /* for ffs */
+#endif /* LACKS_STRINGS_H */
+#endif /* USE_BUILTIN_FFS */
+#if HAVE_MMAP
+#ifndef LACKS_SYS_MMAN_H
+#include <sys/mman.h> /* for mmap */
+#endif /* LACKS_SYS_MMAN_H */
+#ifndef LACKS_FCNTL_H
+#include <fcntl.h>
+#endif /* LACKS_FCNTL_H */
+#endif /* HAVE_MMAP */
+#if HAVE_MORECORE
+#ifndef LACKS_UNISTD_H
+#include <unistd.h> /* for sbrk */
+#else /* LACKS_UNISTD_H */
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
+extern void* sbrk(ptrdiff_t);
+#endif /* FreeBSD etc */
+#endif /* LACKS_UNISTD_H */
+#endif /* HAVE_MMAP */
+
+#ifndef WIN32
+#ifndef malloc_getpagesize
+# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */
+# ifndef _SC_PAGE_SIZE
+# define _SC_PAGE_SIZE _SC_PAGESIZE
+# endif
+# endif
+# ifdef _SC_PAGE_SIZE
+# define malloc_getpagesize sysconf(_SC_PAGE_SIZE)
+# else
+# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
+ extern size_t getpagesize();
+# define malloc_getpagesize getpagesize()
+# else
+# ifdef WIN32 /* use supplied emulation of getpagesize */
+# define malloc_getpagesize getpagesize()
+# else
+# ifndef LACKS_SYS_PARAM_H
+# include <sys/param.h>
+# endif
+# ifdef EXEC_PAGESIZE
+# define malloc_getpagesize EXEC_PAGESIZE
+# else
+# ifdef NBPG
+# ifndef CLSIZE
+# define malloc_getpagesize NBPG
+# else
+# define malloc_getpagesize (NBPG * CLSIZE)
+# endif
+# else
+# ifdef NBPC
+# define malloc_getpagesize NBPC
+# else
+# ifdef PAGESIZE
+# define malloc_getpagesize PAGESIZE
+# else /* just guess */
+# define malloc_getpagesize ((size_t)4096U)
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+#endif
+#endif
+
+/* ------------------- size_t and alignment properties -------------------- */
+
+/* The byte and bit size of a size_t */
+#define SIZE_T_SIZE (sizeof(size_t))
+#define SIZE_T_BITSIZE (sizeof(size_t) << 3)
+
+/* Some constants coerced to size_t */
+/* Annoying but necessary to avoid errors on some plaftorms */
+#define SIZE_T_ZERO ((size_t)0)
+#define SIZE_T_ONE ((size_t)1)
+#define SIZE_T_TWO ((size_t)2)
+#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1)
+#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2)
+#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)
+#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U)
+
+/* The bit mask value corresponding to MALLOC_ALIGNMENT */
+#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE)
+
+/* True if address a has acceptable alignment */
+#define is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0)
+
+/* the number of bytes to offset an address to align it */
+#define align_offset(A)\
+ ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\
+ ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK))
+
+/* -------------------------- MMAP preliminaries ------------------------- */
+
+/*
+ If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and
+ checks to fail so compiler optimizer can delete code rather than
+ using so many "#if"s.
+*/
+
+
+/* MORECORE and MMAP must return MFAIL on failure */
+#define MFAIL ((void*)(MAX_SIZE_T))
+#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */
+
+#if !HAVE_MMAP
+#define IS_MMAPPED_BIT (SIZE_T_ZERO)
+#define USE_MMAP_BIT (SIZE_T_ZERO)
+#define CALL_MMAP(s) MFAIL
+#define CALL_MUNMAP(a, s) (-1)
+#define DIRECT_MMAP(s) MFAIL
+
+#else /* HAVE_MMAP */
+#define IS_MMAPPED_BIT (SIZE_T_ONE)
+#define USE_MMAP_BIT (SIZE_T_ONE)
+
+#ifndef WIN32
+#define CALL_MUNMAP(a, s) munmap((a), (s))
+#define MMAP_PROT (PROT_READ|PROT_WRITE)
+#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
+#define MAP_ANONYMOUS MAP_ANON
+#endif /* MAP_ANON */
+#ifdef MAP_ANONYMOUS
+#define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS)
+#define CALL_MMAP(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0)
+#else /* MAP_ANONYMOUS */
+/*
+ Nearly all versions of mmap support MAP_ANONYMOUS, so the following
+ is unlikely to be needed, but is supplied just in case.
+*/
+#define MMAP_FLAGS (MAP_PRIVATE)
+static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
+#define CALL_MMAP(s) ((dev_zero_fd < 0) ? \
+ (dev_zero_fd = open("/dev/zero", O_RDWR), \
+ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \
+ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0))
+#endif /* MAP_ANONYMOUS */
+
+#define DIRECT_MMAP(s) CALL_MMAP(s)
+#else /* WIN32 */
+
+/* Win32 MMAP via VirtualAlloc */
+static void* win32mmap(size_t size) {
+ void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE);
+ return (ptr != 0)? ptr: MFAIL;
+}
+
+/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */
+static void* win32direct_mmap(size_t size) {
+ void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN,
+ PAGE_EXECUTE_READWRITE);
+ return (ptr != 0)? ptr: MFAIL;
+}
+
+/* This function supports releasing coalesed segments */
+static int win32munmap(void* ptr, size_t size) {
+ MEMORY_BASIC_INFORMATION minfo;
+ char* cptr = ptr;
+ while (size) {
+ if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0)
+ return -1;
+ if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr ||
+ minfo.State != MEM_COMMIT || minfo.RegionSize > size)
+ return -1;
+ if (VirtualFree(cptr, 0, MEM_RELEASE) == 0)
+ return -1;
+ cptr += minfo.RegionSize;
+ size -= minfo.RegionSize;
+ }
+ return 0;
+}
+
+#define CALL_MMAP(s) win32mmap(s)
+#define CALL_MUNMAP(a, s) win32munmap((a), (s))
+#define DIRECT_MMAP(s) win32direct_mmap(s)
+#endif /* WIN32 */
+#endif /* HAVE_MMAP */
+
+#if HAVE_MMAP && HAVE_MREMAP
+#define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv))
+#else /* HAVE_MMAP && HAVE_MREMAP */
+#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL
+#endif /* HAVE_MMAP && HAVE_MREMAP */
+
+#if HAVE_MORECORE
+#define CALL_MORECORE(S) MORECORE(S)
+#else /* HAVE_MORECORE */
+#define CALL_MORECORE(S) MFAIL
+#endif /* HAVE_MORECORE */
+
+/* mstate bit set if continguous morecore disabled or failed */
+#define USE_NONCONTIGUOUS_BIT (4U)
+
+/* segment bit set in create_mspace_with_base */
+#define EXTERN_BIT (8U)
+
+
+/* --------------------------- Lock preliminaries ------------------------ */
+
+#if USE_LOCKS
+
+/*
+ When locks are defined, there are up to two global locks:
+
+ * If HAVE_MORECORE, morecore_mutex protects sequences of calls to
+ MORECORE. In many cases sys_alloc requires two calls, that should
+ not be interleaved with calls by other threads. This does not
+ protect against direct calls to MORECORE by other threads not
+ using this lock, so there is still code to cope the best we can on
+ interference.
+
+ * magic_init_mutex ensures that mparams.magic and other
+ unique mparams values are initialized only once.
+*/
+
+#ifndef WIN32
+/* By default use posix locks */
+#include <pthread.h>
+#define MLOCK_T pthread_mutex_t
+#define INITIAL_LOCK(l) pthread_mutex_init(l, NULL)
+#define ACQUIRE_LOCK(l) pthread_mutex_lock(l)
+#define RELEASE_LOCK(l) pthread_mutex_unlock(l)
+
+#if HAVE_MORECORE
+static MLOCK_T morecore_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* HAVE_MORECORE */
+
+static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+#else /* WIN32 */
+/*
+ Because lock-protected regions have bounded times, and there
+ are no recursive lock calls, we can use simple spinlocks.
+*/
+
+#define MLOCK_T long
+static int win32_acquire_lock (MLOCK_T *sl) {
+ for (;;) {
+#ifdef InterlockedCompareExchangePointer
+ if (!InterlockedCompareExchange(sl, 1, 0))
+ return 0;
+#else /* Use older void* version */
+ if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0))
+ return 0;
+#endif /* InterlockedCompareExchangePointer */
+ Sleep (0);
+ }
+}
+
+static void win32_release_lock (MLOCK_T *sl) {
+ InterlockedExchange (sl, 0);
+}
+
+#define INITIAL_LOCK(l) *(l)=0
+#define ACQUIRE_LOCK(l) win32_acquire_lock(l)
+#define RELEASE_LOCK(l) win32_release_lock(l)
+#if HAVE_MORECORE
+static MLOCK_T morecore_mutex;
+#endif /* HAVE_MORECORE */
+static MLOCK_T magic_init_mutex;
+#endif /* WIN32 */
+
+#define USE_LOCK_BIT (2U)
+#else /* USE_LOCKS */
+#define USE_LOCK_BIT (0U)
+#define INITIAL_LOCK(l)
+#endif /* USE_LOCKS */
+
+#if USE_LOCKS && HAVE_MORECORE
+#define ACQUIRE_MORECORE_LOCK() ACQUIRE_LOCK(&morecore_mutex);
+#define RELEASE_MORECORE_LOCK() RELEASE_LOCK(&morecore_mutex);
+#else /* USE_LOCKS && HAVE_MORECORE */
+#define ACQUIRE_MORECORE_LOCK()
+#define RELEASE_MORECORE_LOCK()
+#endif /* USE_LOCKS && HAVE_MORECORE */
+
+#if USE_LOCKS
+#define ACQUIRE_MAGIC_INIT_LOCK() ACQUIRE_LOCK(&magic_init_mutex);
+#define RELEASE_MAGIC_INIT_LOCK() RELEASE_LOCK(&magic_init_mutex);
+#else /* USE_LOCKS */
+#define ACQUIRE_MAGIC_INIT_LOCK()
+#define RELEASE_MAGIC_INIT_LOCK()
+#endif /* USE_LOCKS */
+
+
+/* ----------------------- Chunk representations ------------------------ */
+
+/*
+ (The following includes lightly edited explanations by Colin Plumb.)
+
+ The malloc_chunk declaration below is misleading (but accurate and
+ necessary). It declares a "view" into memory allowing access to
+ necessary fields at known offsets from a given base.
+
+ Chunks of memory are maintained using a `boundary tag' method as
+ originally described by Knuth. (See the paper by Paul Wilson
+ ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such
+ techniques.) Sizes of free chunks are stored both in the front of
+ each chunk and at the end. This makes consolidating fragmented
+ chunks into bigger chunks fast. The head fields also hold bits
+ representing whether chunks are free or in use.
+
+ Here are some pictures to make it clearer. They are "exploded" to
+ show that the state of a chunk can be thought of as extending from
+ the high 31 bits of the head field of its header through the
+ prev_foot and PINUSE_BIT bit of the following chunk header.
+
+ A chunk that's in use looks like:
+
+ chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of previous chunk (if P = 1) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
+ | Size of this chunk 1| +-+
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ +- -+
+ | |
+ +- -+
+ | :
+ +- size - sizeof(size_t) available payload bytes -+
+ : |
+ chunk-> +- -+
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1|
+ | Size of next chunk (may or may not be in use) | +-+
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ And if it's free, it looks like this:
+
+ chunk-> +- -+
+ | User payload (must be in use, or we would have merged!) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
+ | Size of this chunk 0| +-+
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Next pointer |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Prev pointer |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | :
+ +- size - sizeof(struct chunk) unused bytes -+
+ : |
+ chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of this chunk |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0|
+ | Size of next chunk (must be in use, or we would have merged)| +-+
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | :
+ +- User payload -+
+ : |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |0|
+ +-+
+ Note that since we always merge adjacent free chunks, the chunks
+ adjacent to a free chunk must be in use.
+
+ Given a pointer to a chunk (which can be derived trivially from the
+ payload pointer) we can, in O(1) time, find out whether the adjacent
+ chunks are free, and if so, unlink them from the lists that they
+ are on and merge them with the current chunk.
+
+ Chunks always begin on even word boundaries, so the mem portion
+ (which is returned to the user) is also on an even word boundary, and
+ thus at least double-word aligned.
+
+ The P (PINUSE_BIT) bit, stored in the unused low-order bit of the
+ chunk size (which is always a multiple of two words), is an in-use
+ bit for the *previous* chunk. If that bit is *clear*, then the
+ word before the current chunk size contains the previous chunk
+ size, and can be used to find the front of the previous chunk.
+ The very first chunk allocated always has this bit set, preventing
+ access to non-existent (or non-owned) memory. If pinuse is set for
+ any given chunk, then you CANNOT determine the size of the
+ previous chunk, and might even get a memory addressing fault when
+ trying to do so.
+
+ The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of
+ the chunk size redundantly records whether the current chunk is
+ inuse. This redundancy enables usage checks within free and realloc,
+ and reduces indirection when freeing and consolidating chunks.
+
+ Each freshly allocated chunk must have both cinuse and pinuse set.
+ That is, each allocated chunk borders either a previously allocated
+ and still in-use chunk, or the base of its memory arena. This is
+ ensured by making all allocations from the the `lowest' part of any
+ found chunk. Further, no free chunk physically borders another one,
+ so each free chunk is known to be preceded and followed by either
+ inuse chunks or the ends of memory.
+
+ Note that the `foot' of the current chunk is actually represented
+ as the prev_foot of the NEXT chunk. This makes it easier to
+ deal with alignments etc but can be very confusing when trying
+ to extend or adapt this code.
+
+ The exceptions to all this are
+
+ 1. The special chunk `top' is the top-most available chunk (i.e.,
+ the one bordering the end of available memory). It is treated
+ specially. Top is never included in any bin, is used only if
+ no other chunk is available, and is released back to the
+ system if it is very large (see M_TRIM_THRESHOLD). In effect,
+ the top chunk is treated as larger (and thus less well
+ fitting) than any other available chunk. The top chunk
+ doesn't update its trailing size field since there is no next
+ contiguous chunk that would have to index off it. However,
+ space is still allocated for it (TOP_FOOT_SIZE) to enable
+ separation or merging when space is extended.
+
+ 3. Chunks allocated via mmap, which have the lowest-order bit
+ (IS_MMAPPED_BIT) set in their prev_foot fields, and do not set
+ PINUSE_BIT in their head fields. Because they are allocated
+ one-by-one, each must carry its own prev_foot field, which is
+ also used to hold the offset this chunk has within its mmapped
+ region, which is needed to preserve alignment. Each mmapped
+ chunk is trailed by the first two fields of a fake next-chunk
+ for sake of usage checks.
+
+*/
+
+struct malloc_chunk {
+ size_t prev_foot; /* Size of previous chunk (if free). */
+ size_t head; /* Size and inuse bits. */
+ struct malloc_chunk* fd; /* double links -- used only if free. */
+ struct malloc_chunk* bk;
+};
+
+typedef struct malloc_chunk mchunk;
+typedef struct malloc_chunk* mchunkptr;
+typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */
+typedef unsigned int bindex_t; /* Described below */
+typedef unsigned int binmap_t; /* Described below */
+typedef unsigned int flag_t; /* The type of various bit flag sets */
+
+/* ------------------- Chunks sizes and alignments ----------------------- */
+
+#define MCHUNK_SIZE (sizeof(mchunk))
+
+#if FOOTERS
+#define CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
+#else /* FOOTERS */
+#define CHUNK_OVERHEAD (SIZE_T_SIZE)
+#endif /* FOOTERS */
+
+/* MMapped chunks need a second word of overhead ... */
+#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
+/* ... and additional padding for fake next-chunk at foot */
+#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES)
+
+/* The smallest size we can malloc is an aligned minimal chunk */
+#define MIN_CHUNK_SIZE\
+ ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
+
+/* conversion from malloc headers to user pointers, and back */
+#define chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES))
+#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES))
+/* chunk associated with aligned address A */
+#define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A)))
+
+/* Bounds on request (not chunk) sizes. */
+#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2)
+#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)
+
+/* pad request bytes into a usable size */
+#define pad_request(req) \
+ (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
+
+/* pad request, checking for minimum (but not maximum) */
+#define request2size(req) \
+ (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))
+
+
+/* ------------------ Operations on head and foot fields ----------------- */
+
+/*
+ The head field of a chunk is or'ed with PINUSE_BIT when previous
+ adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in
+ use. If the chunk was obtained with mmap, the prev_foot field has
+ IS_MMAPPED_BIT set, otherwise holding the offset of the base of the
+ mmapped region to the base of the chunk.
+*/
+
+#define PINUSE_BIT (SIZE_T_ONE)
+#define CINUSE_BIT (SIZE_T_TWO)
+#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT)
+
+/* Head value for fenceposts */
+#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE)
+
+/* extraction of fields from head words */
+#define cinuse(p) ((p)->head & CINUSE_BIT)
+#define pinuse(p) ((p)->head & PINUSE_BIT)
+#define chunksize(p) ((p)->head & ~(INUSE_BITS))
+
+#define clear_pinuse(p) ((p)->head &= ~PINUSE_BIT)
+#define clear_cinuse(p) ((p)->head &= ~CINUSE_BIT)
+
+/* Treat space at ptr +/- offset as a chunk */
+#define chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s)))
+#define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s)))
+
+/* Ptr to next or previous physical malloc_chunk. */
+#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS)))
+#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) ))
+
+/* extract next chunk's pinuse bit */
+#define next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT)
+
+/* Get/set size at footer */
+#define get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot)
+#define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s))
+
+/* Set size, pinuse bit, and foot */
+#define set_size_and_pinuse_of_free_chunk(p, s)\
+ ((p)->head = (s|PINUSE_BIT), set_foot(p, s))
+
+/* Set size, pinuse bit, foot, and clear next pinuse */
+#define set_free_with_pinuse(p, s, n)\
+ (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s))
+
+#define is_mmapped(p)\
+ (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT))
+
+/* Get the internal overhead associated with chunk p */
+#define overhead_for(p)\
+ (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD)
+
+/* Return true if malloced space is not necessarily cleared */
+#if MMAP_CLEARS
+#define calloc_must_clear(p) (!is_mmapped(p))
+#else /* MMAP_CLEARS */
+#define calloc_must_clear(p) (1)
+#endif /* MMAP_CLEARS */
+
+/* ---------------------- Overlaid data structures ----------------------- */
+
+/*
+ When chunks are not in use, they are treated as nodes of either
+ lists or trees.
+
+ "Small" chunks are stored in circular doubly-linked lists, and look
+ like this:
+
+ chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of previous chunk |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ `head:' | Size of chunk, in bytes |P|
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Forward pointer to next chunk in list |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Back pointer to previous chunk in list |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Unused space (may be 0 bytes long) .
+ . .
+ . |
+nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ `foot:' | Size of chunk, in bytes |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Larger chunks are kept in a form of bitwise digital trees (aka
+ tries) keyed on chunksizes. Because malloc_tree_chunks are only for
+ free chunks greater than 256 bytes, their size doesn't impose any
+ constraints on user chunk sizes. Each node looks like:
+
+ chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of previous chunk |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ `head:' | Size of chunk, in bytes |P|
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Forward pointer to next chunk of same size |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Back pointer to previous chunk of same size |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Pointer to left child (child[0]) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Pointer to right child (child[1]) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Pointer to parent |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | bin index of this chunk |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Unused space .
+ . |
+nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ `foot:' | Size of chunk, in bytes |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Each tree holding treenodes is a tree of unique chunk sizes. Chunks
+ of the same size are arranged in a circularly-linked list, with only
+ the oldest chunk (the next to be used, in our FIFO ordering)
+ actually in the tree. (Tree members are distinguished by a non-null
+ parent pointer.) If a chunk with the same size an an existing node
+ is inserted, it is linked off the existing node using pointers that
+ work in the same way as fd/bk pointers of small chunks.
+
+ Each tree contains a power of 2 sized range of chunk sizes (the
+ smallest is 0x100 <= x < 0x180), which is is divided in half at each
+ tree level, with the chunks in the smaller half of the range (0x100
+ <= x < 0x140 for the top nose) in the left subtree and the larger
+ half (0x140 <= x < 0x180) in the right subtree. This is, of course,
+ done by inspecting individual bits.
+
+ Using these rules, each node's left subtree contains all smaller
+ sizes than its right subtree. However, the node at the root of each
+ subtree has no particular ordering relationship to either. (The
+ dividing line between the subtree sizes is based on trie relation.)
+ If we remove the last chunk of a given size from the interior of the
+ tree, we need to replace it with a leaf node. The tree ordering
+ rules permit a node to be replaced by any leaf below it.
+
+ The smallest chunk in a tree (a common operation in a best-fit
+ allocator) can be found by walking a path to the leftmost leaf in
+ the tree. Unlike a usual binary tree, where we follow left child
+ pointers until we reach a null, here we follow the right child
+ pointer any time the left one is null, until we reach a leaf with
+ both child pointers null. The smallest chunk in the tree will be
+ somewhere along that path.
+
+ The worst case number of steps to add, find, or remove a node is
+ bounded by the number of bits differentiating chunks within
+ bins. Under current bin calculations, this ranges from 6 up to 21
+ (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case
+ is of course much better.
+*/
+
+struct malloc_tree_chunk {
+ /* The first four fields must be compatible with malloc_chunk */
+ size_t prev_foot;
+ size_t head;
+ struct malloc_tree_chunk* fd;
+ struct malloc_tree_chunk* bk;
+
+ struct malloc_tree_chunk* child[2];
+ struct malloc_tree_chunk* parent;
+ bindex_t index;
+};
+
+typedef struct malloc_tree_chunk tchunk;
+typedef struct malloc_tree_chunk* tchunkptr;
+typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */
+
+/* A little helper macro for trees */
+#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1])
+
+/* ----------------------------- Segments -------------------------------- */
+
+/*
+ Each malloc space may include non-contiguous segments, held in a
+ list headed by an embedded malloc_segment record representing the
+ top-most space. Segments also include flags holding properties of
+ the space. Large chunks that are directly allocated by mmap are not
+ included in this list. They are instead independently created and
+ destroyed without otherwise keeping track of them.
+
+ Segment management mainly comes into play for spaces allocated by
+ MMAP. Any call to MMAP might or might not return memory that is
+ adjacent to an existing segment. MORECORE normally contiguously
+ extends the current space, so this space is almost always adjacent,
+ which is simpler and faster to deal with. (This is why MORECORE is
+ used preferentially to MMAP when both are available -- see
+ sys_alloc.) When allocating using MMAP, we don't use any of the
+ hinting mechanisms (inconsistently) supported in various
+ implementations of unix mmap, or distinguish reserving from
+ committing memory. Instead, we just ask for space, and exploit
+ contiguity when we get it. It is probably possible to do
+ better than this on some systems, but no general scheme seems
+ to be significantly better.
+
+ Management entails a simpler variant of the consolidation scheme
+ used for chunks to reduce fragmentation -- new adjacent memory is
+ normally prepended or appended to an existing segment. However,
+ there are limitations compared to chunk consolidation that mostly
+ reflect the fact that segment processing is relatively infrequent
+ (occurring only when getting memory from system) and that we
+ don't expect to have huge numbers of segments:
+
+ * Segments are not indexed, so traversal requires linear scans. (It
+ would be possible to index these, but is not worth the extra
+ overhead and complexity for most programs on most platforms.)
+ * New segments are only appended to old ones when holding top-most
+ memory; if they cannot be prepended to others, they are held in
+ different segments.
+
+ Except for the top-most segment of an mstate, each segment record
+ is kept at the tail of its segment. Segments are added by pushing
+ segment records onto the list headed by &mstate.seg for the
+ containing mstate.
+
+ Segment flags control allocation/merge/deallocation policies:
+ * If EXTERN_BIT set, then we did not allocate this segment,
+ and so should not try to deallocate or merge with others.
+ (This currently holds only for the initial segment passed
+ into create_mspace_with_base.)
+ * If IS_MMAPPED_BIT set, the segment may be merged with
+ other surrounding mmapped segments and trimmed/de-allocated
+ using munmap.
+ * If neither bit is set, then the segment was obtained using
+ MORECORE so can be merged with surrounding MORECORE'd segments
+ and deallocated/trimmed using MORECORE with negative arguments.
+*/
+
+struct malloc_segment {
+ char* base; /* base address */
+ size_t size; /* allocated size */
+ struct malloc_segment* next; /* ptr to next segment */
+#if FFI_MMAP_EXEC_WRIT
+ /* The mmap magic is supposed to store the address of the executable
+ segment at the very end of the requested block. */
+
+# define mmap_exec_offset(b,s) (*(ptrdiff_t*)((b)+(s)-sizeof(ptrdiff_t)))
+
+ /* We can only merge segments if their corresponding executable
+ segments are at identical offsets. */
+# define check_segment_merge(S,b,s) \
+ (mmap_exec_offset((b),(s)) == (S)->exec_offset)
+
+# define add_segment_exec_offset(p,S) ((char*)(p) + (S)->exec_offset)
+# define sub_segment_exec_offset(p,S) ((char*)(p) - (S)->exec_offset)
+
+ /* The removal of sflags only works with HAVE_MORECORE == 0. */
+
+# define get_segment_flags(S) (IS_MMAPPED_BIT)
+# define set_segment_flags(S,v) \
+ (((v) != IS_MMAPPED_BIT) ? (ABORT, (v)) : \
+ (((S)->exec_offset = \
+ mmap_exec_offset((S)->base, (S)->size)), \
+ (mmap_exec_offset((S)->base + (S)->exec_offset, (S)->size) != \
+ (S)->exec_offset) ? (ABORT, (v)) : \
+ (mmap_exec_offset((S)->base, (S)->size) = 0), (v)))
+
+ /* We use an offset here, instead of a pointer, because then, when
+ base changes, we don't have to modify this. On architectures
+ with segmented addresses, this might not work. */
+ ptrdiff_t exec_offset;
+#else
+
+# define get_segment_flags(S) ((S)->sflags)
+# define set_segment_flags(S,v) ((S)->sflags = (v))
+# define check_segment_merge(S,b,s) (1)
+
+ flag_t sflags; /* mmap and extern flag */
+#endif
+};
+
+#define is_mmapped_segment(S) (get_segment_flags(S) & IS_MMAPPED_BIT)
+#define is_extern_segment(S) (get_segment_flags(S) & EXTERN_BIT)
+
+typedef struct malloc_segment msegment;
+typedef struct malloc_segment* msegmentptr;
+
+/* ---------------------------- malloc_state ----------------------------- */
+
+/*
+ A malloc_state holds all of the bookkeeping for a space.
+ The main fields are:
+
+ Top
+ The topmost chunk of the currently active segment. Its size is
+ cached in topsize. The actual size of topmost space is
+ topsize+TOP_FOOT_SIZE, which includes space reserved for adding
+ fenceposts and segment records if necessary when getting more
+ space from the system. The size at which to autotrim top is
+ cached from mparams in trim_check, except that it is disabled if
+ an autotrim fails.
+
+ Designated victim (dv)
+ This is the preferred chunk for servicing small requests that
+ don't have exact fits. It is normally the chunk split off most
+ recently to service another small request. Its size is cached in
+ dvsize. The link fields of this chunk are not maintained since it
+ is not kept in a bin.
+
+ SmallBins
+ An array of bin headers for free chunks. These bins hold chunks
+ with sizes less than MIN_LARGE_SIZE bytes. Each bin contains
+ chunks of all the same size, spaced 8 bytes apart. To simplify
+ use in double-linked lists, each bin header acts as a malloc_chunk
+ pointing to the real first node, if it exists (else pointing to
+ itself). This avoids special-casing for headers. But to avoid
+ waste, we allocate only the fd/bk pointers of bins, and then use
+ repositioning tricks to treat these as the fields of a chunk.
+
+ TreeBins
+ Treebins are pointers to the roots of trees holding a range of
+ sizes. There are 2 equally spaced treebins for each power of two
+ from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything
+ larger.
+
+ Bin maps
+ There is one bit map for small bins ("smallmap") and one for
+ treebins ("treemap). Each bin sets its bit when non-empty, and
+ clears the bit when empty. Bit operations are then used to avoid
+ bin-by-bin searching -- nearly all "search" is done without ever
+ looking at bins that won't be selected. The bit maps
+ conservatively use 32 bits per map word, even if on 64bit system.
+ For a good description of some of the bit-based techniques used
+ here, see Henry S. Warren Jr's book "Hacker's Delight" (and
+ supplement at http://hackersdelight.org/). Many of these are
+ intended to reduce the branchiness of paths through malloc etc, as
+ well as to reduce the number of memory locations read or written.
+
+ Segments
+ A list of segments headed by an embedded malloc_segment record
+ representing the initial space.
+
+ Address check support
+ The least_addr field is the least address ever obtained from
+ MORECORE or MMAP. Attempted frees and reallocs of any address less
+ than this are trapped (unless INSECURE is defined).
+
+ Magic tag
+ A cross-check field that should always hold same value as mparams.magic.
+
+ Flags
+ Bits recording whether to use MMAP, locks, or contiguous MORECORE
+
+ Statistics
+ Each space keeps track of current and maximum system memory
+ obtained via MORECORE or MMAP.
+
+ Locking
+ If USE_LOCKS is defined, the "mutex" lock is acquired and released
+ around every public call using this mspace.
+*/
+
+/* Bin types, widths and sizes */
+#define NSMALLBINS (32U)
+#define NTREEBINS (32U)
+#define SMALLBIN_SHIFT (3U)
+#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT)
+#define TREEBIN_SHIFT (8U)
+#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT)
+#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE)
+#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)
+
+struct malloc_state {
+ binmap_t smallmap;
+ binmap_t treemap;
+ size_t dvsize;
+ size_t topsize;
+ char* least_addr;
+ mchunkptr dv;
+ mchunkptr top;
+ size_t trim_check;
+ size_t magic;
+ mchunkptr smallbins[(NSMALLBINS+1)*2];
+ tbinptr treebins[NTREEBINS];
+ size_t footprint;
+ size_t max_footprint;
+ flag_t mflags;
+#if USE_LOCKS
+ MLOCK_T mutex; /* locate lock among fields that rarely change */
+#endif /* USE_LOCKS */
+ msegment seg;
+};
+
+typedef struct malloc_state* mstate;
+
+/* ------------- Global malloc_state and malloc_params ------------------- */
+
+/*
+ malloc_params holds global properties, including those that can be
+ dynamically set using mallopt. There is a single instance, mparams,
+ initialized in init_mparams.
+*/
+
+struct malloc_params {
+ size_t magic;
+ size_t page_size;
+ size_t granularity;
+ size_t mmap_threshold;
+ size_t trim_threshold;
+ flag_t default_mflags;
+};
+
+static struct malloc_params mparams;
+
+/* The global malloc_state used for all non-"mspace" calls */
+static struct malloc_state _gm_;
+#define gm (&_gm_)
+#define is_global(M) ((M) == &_gm_)
+#define is_initialized(M) ((M)->top != 0)
+
+/* -------------------------- system alloc setup ------------------------- */
+
+/* Operations on mflags */
+
+#define use_lock(M) ((M)->mflags & USE_LOCK_BIT)
+#define enable_lock(M) ((M)->mflags |= USE_LOCK_BIT)
+#define disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT)
+
+#define use_mmap(M) ((M)->mflags & USE_MMAP_BIT)
+#define enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT)
+#define disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT)
+
+#define use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT)
+#define disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT)
+
+#define set_lock(M,L)\
+ ((M)->mflags = (L)?\
+ ((M)->mflags | USE_LOCK_BIT) :\
+ ((M)->mflags & ~USE_LOCK_BIT))
+
+/* page-align a size */
+#define page_align(S)\
+ (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE))
+
+/* granularity-align a size */
+#define granularity_align(S)\
+ (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE))
+
+#define is_page_aligned(S)\
+ (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0)
+#define is_granularity_aligned(S)\
+ (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0)
+
+/* True if segment S holds address A */
+#define segment_holds(S, A)\
+ ((char*)(A) >= S->base && (char*)(A) < S->base + S->size)
+
+/* Return segment holding given address */
+static msegmentptr segment_holding(mstate m, char* addr) {
+ msegmentptr sp = &m->seg;
+ for (;;) {
+ if (addr >= sp->base && addr < sp->base + sp->size)
+ return sp;
+ if ((sp = sp->next) == 0)
+ return 0;
+ }
+}
+
+/* Return true if segment contains a segment link */
+static int has_segment_link(mstate m, msegmentptr ss) {
+ msegmentptr sp = &m->seg;
+ for (;;) {
+ if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size)
+ return 1;
+ if ((sp = sp->next) == 0)
+ return 0;
+ }
+}
+
+#ifndef MORECORE_CANNOT_TRIM
+#define should_trim(M,s) ((s) > (M)->trim_check)
+#else /* MORECORE_CANNOT_TRIM */
+#define should_trim(M,s) (0)
+#endif /* MORECORE_CANNOT_TRIM */
+
+/*
+ TOP_FOOT_SIZE is padding at the end of a segment, including space
+ that may be needed to place segment records and fenceposts when new
+ noncontiguous segments are added.
+*/
+#define TOP_FOOT_SIZE\
+ (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)
+
+
+/* ------------------------------- Hooks -------------------------------- */
+
+/*
+ PREACTION should be defined to return 0 on success, and nonzero on
+ failure. If you are not using locking, you can redefine these to do
+ anything you like.
+*/
+
+#if USE_LOCKS
+
+/* Ensure locks are initialized */
+#define GLOBALLY_INITIALIZE() (mparams.page_size == 0 && init_mparams())
+
+#define PREACTION(M) ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0)
+#define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); }
+#else /* USE_LOCKS */
+
+#ifndef PREACTION
+#define PREACTION(M) (0)
+#endif /* PREACTION */
+
+#ifndef POSTACTION
+#define POSTACTION(M)
+#endif /* POSTACTION */
+
+#endif /* USE_LOCKS */
+
+/*
+ CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses.
+ USAGE_ERROR_ACTION is triggered on detected bad frees and
+ reallocs. The argument p is an address that might have triggered the
+ fault. It is ignored by the two predefined actions, but might be
+ useful in custom actions that try to help diagnose errors.
+*/
+
+#if PROCEED_ON_ERROR
+
+/* A count of the number of corruption errors causing resets */
+int malloc_corruption_error_count;
+
+/* default corruption action */
+static void reset_on_error(mstate m);
+
+#define CORRUPTION_ERROR_ACTION(m) reset_on_error(m)
+#define USAGE_ERROR_ACTION(m, p)
+
+#else /* PROCEED_ON_ERROR */
+
+#ifndef CORRUPTION_ERROR_ACTION
+#define CORRUPTION_ERROR_ACTION(m) ABORT
+#endif /* CORRUPTION_ERROR_ACTION */
+
+#ifndef USAGE_ERROR_ACTION
+#define USAGE_ERROR_ACTION(m,p) ABORT
+#endif /* USAGE_ERROR_ACTION */
+
+#endif /* PROCEED_ON_ERROR */
+
+/* -------------------------- Debugging setup ---------------------------- */
+
+#if ! DEBUG
+
+#define check_free_chunk(M,P)
+#define check_inuse_chunk(M,P)
+#define check_malloced_chunk(M,P,N)
+#define check_mmapped_chunk(M,P)
+#define check_malloc_state(M)
+#define check_top_chunk(M,P)
+
+#else /* DEBUG */
+#define check_free_chunk(M,P) do_check_free_chunk(M,P)
+#define check_inuse_chunk(M,P) do_check_inuse_chunk(M,P)
+#define check_top_chunk(M,P) do_check_top_chunk(M,P)
+#define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N)
+#define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P)
+#define check_malloc_state(M) do_check_malloc_state(M)
+
+static void do_check_any_chunk(mstate m, mchunkptr p);
+static void do_check_top_chunk(mstate m, mchunkptr p);
+static void do_check_mmapped_chunk(mstate m, mchunkptr p);
+static void do_check_inuse_chunk(mstate m, mchunkptr p);
+static void do_check_free_chunk(mstate m, mchunkptr p);
+static void do_check_malloced_chunk(mstate m, void* mem, size_t s);
+static void do_check_tree(mstate m, tchunkptr t);
+static void do_check_treebin(mstate m, bindex_t i);
+static void do_check_smallbin(mstate m, bindex_t i);
+static void do_check_malloc_state(mstate m);
+static int bin_find(mstate m, mchunkptr x);
+static size_t traverse_and_check(mstate m);
+#endif /* DEBUG */
+
+/* ---------------------------- Indexing Bins ---------------------------- */
+
+#define is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS)
+#define small_index(s) ((s) >> SMALLBIN_SHIFT)
+#define small_index2size(i) ((i) << SMALLBIN_SHIFT)
+#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE))
+
+/* addressing by index. See above about smallbin repositioning */
+#define smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1])))
+#define treebin_at(M,i) (&((M)->treebins[i]))
+
+/* assign tree index for size S to variable I */
+#if defined(__GNUC__) && defined(i386)
+#define compute_tree_index(S, I)\
+{\
+ size_t X = S >> TREEBIN_SHIFT;\
+ if (X == 0)\
+ I = 0;\
+ else if (X > 0xFFFF)\
+ I = NTREEBINS-1;\
+ else {\
+ unsigned int K;\
+ __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm" (X));\
+ I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\
+ }\
+}
+#else /* GNUC */
+#define compute_tree_index(S, I)\
+{\
+ size_t X = S >> TREEBIN_SHIFT;\
+ if (X == 0)\
+ I = 0;\
+ else if (X > 0xFFFF)\
+ I = NTREEBINS-1;\
+ else {\
+ unsigned int Y = (unsigned int)X;\
+ unsigned int N = ((Y - 0x100) >> 16) & 8;\
+ unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\
+ N += K;\
+ N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\
+ K = 14 - N + ((Y <<= K) >> 15);\
+ I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\
+ }\
+}
+#endif /* GNUC */
+
+/* Bit representing maximum resolved size in a treebin at i */
+#define bit_for_tree_index(i) \
+ (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2)
+
+/* Shift placing maximum resolved bit in a treebin at i as sign bit */
+#define leftshift_for_tree_index(i) \
+ ((i == NTREEBINS-1)? 0 : \
+ ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))
+
+/* The size of the smallest chunk held in bin with index i */
+#define minsize_for_tree_index(i) \
+ ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \
+ (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1)))
+
+
+/* ------------------------ Operations on bin maps ----------------------- */
+
+/* bit corresponding to given index */
+#define idx2bit(i) ((binmap_t)(1) << (i))
+
+/* Mark/Clear bits with given index */
+#define mark_smallmap(M,i) ((M)->smallmap |= idx2bit(i))
+#define clear_smallmap(M,i) ((M)->smallmap &= ~idx2bit(i))
+#define smallmap_is_marked(M,i) ((M)->smallmap & idx2bit(i))
+
+#define mark_treemap(M,i) ((M)->treemap |= idx2bit(i))
+#define clear_treemap(M,i) ((M)->treemap &= ~idx2bit(i))
+#define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i))
+
+/* index corresponding to given bit */
+
+#if defined(__GNUC__) && defined(i386)
+#define compute_bit2idx(X, I)\
+{\
+ unsigned int J;\
+ __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\
+ I = (bindex_t)J;\
+}
+
+#else /* GNUC */
+#if USE_BUILTIN_FFS
+#define compute_bit2idx(X, I) I = ffs(X)-1
+
+#else /* USE_BUILTIN_FFS */
+#define compute_bit2idx(X, I)\
+{\
+ unsigned int Y = X - 1;\
+ unsigned int K = Y >> (16-4) & 16;\
+ unsigned int N = K; Y >>= K;\
+ N += K = Y >> (8-3) & 8; Y >>= K;\
+ N += K = Y >> (4-2) & 4; Y >>= K;\
+ N += K = Y >> (2-1) & 2; Y >>= K;\
+ N += K = Y >> (1-0) & 1; Y >>= K;\
+ I = (bindex_t)(N + Y);\
+}
+#endif /* USE_BUILTIN_FFS */
+#endif /* GNUC */
+
+/* isolate the least set bit of a bitmap */
+#define least_bit(x) ((x) & -(x))
+
+/* mask with all bits to left of least bit of x on */
+#define left_bits(x) ((x<<1) | -(x<<1))
+
+/* mask with all bits to left of or equal to least bit of x on */
+#define same_or_left_bits(x) ((x) | -(x))
+
+
+/* ----------------------- Runtime Check Support ------------------------- */
+
+/*
+ For security, the main invariant is that malloc/free/etc never
+ writes to a static address other than malloc_state, unless static
+ malloc_state itself has been corrupted, which cannot occur via
+ malloc (because of these checks). In essence this means that we
+ believe all pointers, sizes, maps etc held in malloc_state, but
+ check all of those linked or offsetted from other embedded data
+ structures. These checks are interspersed with main code in a way
+ that tends to minimize their run-time cost.
+
+ When FOOTERS is defined, in addition to range checking, we also
+ verify footer fields of inuse chunks, which can be used guarantee
+ that the mstate controlling malloc/free is intact. This is a
+ streamlined version of the approach described by William Robertson
+ et al in "Run-time Detection of Heap-based Overflows" LISA'03
+ http://www.usenix.org/events/lisa03/tech/robertson.html The footer
+ of an inuse chunk holds the xor of its mstate and a random seed,
+ that is checked upon calls to free() and realloc(). This is
+ (probablistically) unguessable from outside the program, but can be
+ computed by any code successfully malloc'ing any chunk, so does not
+ itself provide protection against code that has already broken
+ security through some other means. Unlike Robertson et al, we
+ always dynamically check addresses of all offset chunks (previous,
+ next, etc). This turns out to be cheaper than relying on hashes.
+*/
+
+#if !INSECURE
+/* Check if address a is at least as high as any from MORECORE or MMAP */
+#define ok_address(M, a) ((char*)(a) >= (M)->least_addr)
+/* Check if address of next chunk n is higher than base chunk p */
+#define ok_next(p, n) ((char*)(p) < (char*)(n))
+/* Check if p has its cinuse bit on */
+#define ok_cinuse(p) cinuse(p)
+/* Check if p has its pinuse bit on */
+#define ok_pinuse(p) pinuse(p)
+
+#else /* !INSECURE */
+#define ok_address(M, a) (1)
+#define ok_next(b, n) (1)
+#define ok_cinuse(p) (1)
+#define ok_pinuse(p) (1)
+#endif /* !INSECURE */
+
+#if (FOOTERS && !INSECURE)
+/* Check if (alleged) mstate m has expected magic field */
+#define ok_magic(M) ((M)->magic == mparams.magic)
+#else /* (FOOTERS && !INSECURE) */
+#define ok_magic(M) (1)
+#endif /* (FOOTERS && !INSECURE) */
+
+
+/* In gcc, use __builtin_expect to minimize impact of checks */
+#if !INSECURE
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define RTCHECK(e) __builtin_expect(e, 1)
+#else /* GNUC */
+#define RTCHECK(e) (e)
+#endif /* GNUC */
+#else /* !INSECURE */
+#define RTCHECK(e) (1)
+#endif /* !INSECURE */
+
+/* macros to set up inuse chunks with or without footers */
+
+#if !FOOTERS
+
+#define mark_inuse_foot(M,p,s)
+
+/* Set cinuse bit and pinuse bit of next chunk */
+#define set_inuse(M,p,s)\
+ ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
+ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
+
+/* Set cinuse and pinuse of this chunk and pinuse of next chunk */
+#define set_inuse_and_pinuse(M,p,s)\
+ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
+ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
+
+/* Set size, cinuse and pinuse bit of this chunk */
+#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
+ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT))
+
+#else /* FOOTERS */
+
+/* Set foot of inuse chunk to be xor of mstate and seed */
+#define mark_inuse_foot(M,p,s)\
+ (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic))
+
+#define get_mstate_for(p)\
+ ((mstate)(((mchunkptr)((char*)(p) +\
+ (chunksize(p))))->prev_foot ^ mparams.magic))
+
+#define set_inuse(M,p,s)\
+ ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
+ (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \
+ mark_inuse_foot(M,p,s))
+
+#define set_inuse_and_pinuse(M,p,s)\
+ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
+ (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\
+ mark_inuse_foot(M,p,s))
+
+#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
+ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
+ mark_inuse_foot(M, p, s))
+
+#endif /* !FOOTERS */
+
+/* ---------------------------- setting mparams -------------------------- */
+
+/* Initialize mparams */
+static int init_mparams(void) {
+ if (mparams.page_size == 0) {
+ size_t s;
+
+ mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD;
+ mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD;
+#if MORECORE_CONTIGUOUS
+ mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT;
+#else /* MORECORE_CONTIGUOUS */
+ mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT;
+#endif /* MORECORE_CONTIGUOUS */
+
+#if (FOOTERS && !INSECURE)
+ {
+#if USE_DEV_RANDOM
+ int fd;
+ unsigned char buf[sizeof(size_t)];
+ /* Try to use /dev/urandom, else fall back on using time */
+ if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 &&
+ read(fd, buf, sizeof(buf)) == sizeof(buf)) {
+ s = *((size_t *) buf);
+ close(fd);
+ }
+ else
+#endif /* USE_DEV_RANDOM */
+ s = (size_t)(time(0) ^ (size_t)0x55555555U);
+
+ s |= (size_t)8U; /* ensure nonzero */
+ s &= ~(size_t)7U; /* improve chances of fault for bad values */
+
+ }
+#else /* (FOOTERS && !INSECURE) */
+ s = (size_t)0x58585858U;
+#endif /* (FOOTERS && !INSECURE) */
+ ACQUIRE_MAGIC_INIT_LOCK();
+ if (mparams.magic == 0) {
+ mparams.magic = s;
+ /* Set up lock for main malloc area */
+ INITIAL_LOCK(&gm->mutex);
+ gm->mflags = mparams.default_mflags;
+ }
+ RELEASE_MAGIC_INIT_LOCK();
+
+#ifndef WIN32
+ mparams.page_size = malloc_getpagesize;
+ mparams.granularity = ((DEFAULT_GRANULARITY != 0)?
+ DEFAULT_GRANULARITY : mparams.page_size);
+#else /* WIN32 */
+ {
+ SYSTEM_INFO system_info;
+ GetSystemInfo(&system_info);
+ mparams.page_size = system_info.dwPageSize;
+ mparams.granularity = system_info.dwAllocationGranularity;
+ }
+#endif /* WIN32 */
+
+ /* Sanity-check configuration:
+ size_t must be unsigned and as wide as pointer type.
+ ints must be at least 4 bytes.
+ alignment must be at least 8.
+ Alignment, min chunk size, and page size must all be powers of 2.
+ */
+ if ((sizeof(size_t) != sizeof(char*)) ||
+ (MAX_SIZE_T < MIN_CHUNK_SIZE) ||
+ (sizeof(int) < 4) ||
+ (MALLOC_ALIGNMENT < (size_t)8U) ||
+ ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) ||
+ ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) ||
+ ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) ||
+ ((mparams.page_size & (mparams.page_size-SIZE_T_ONE)) != 0))
+ ABORT;
+ }
+ return 0;
+}
+
+/* support for mallopt */
+static int change_mparam(int param_number, int value) {
+ size_t val = (size_t)value;
+ init_mparams();
+ switch(param_number) {
+ case M_TRIM_THRESHOLD:
+ mparams.trim_threshold = val;
+ return 1;
+ case M_GRANULARITY:
+ if (val >= mparams.page_size && ((val & (val-1)) == 0)) {
+ mparams.granularity = val;
+ return 1;
+ }
+ else
+ return 0;
+ case M_MMAP_THRESHOLD:
+ mparams.mmap_threshold = val;
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+#if DEBUG
+/* ------------------------- Debugging Support --------------------------- */
+
+/* Check properties of any chunk, whether free, inuse, mmapped etc */
+static void do_check_any_chunk(mstate m, mchunkptr p) {
+ assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
+ assert(ok_address(m, p));
+}
+
+/* Check properties of top chunk */
+static void do_check_top_chunk(mstate m, mchunkptr p) {
+ msegmentptr sp = segment_holding(m, (char*)p);
+ size_t sz = chunksize(p);
+ assert(sp != 0);
+ assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
+ assert(ok_address(m, p));
+ assert(sz == m->topsize);
+ assert(sz > 0);
+ assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE);
+ assert(pinuse(p));
+ assert(!next_pinuse(p));
+}
+
+/* Check properties of (inuse) mmapped chunks */
+static void do_check_mmapped_chunk(mstate m, mchunkptr p) {
+ size_t sz = chunksize(p);
+ size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD);
+ assert(is_mmapped(p));
+ assert(use_mmap(m));
+ assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
+ assert(ok_address(m, p));
+ assert(!is_small(sz));
+ assert((len & (mparams.page_size-SIZE_T_ONE)) == 0);
+ assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD);
+ assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0);
+}
+
+/* Check properties of inuse chunks */
+static void do_check_inuse_chunk(mstate m, mchunkptr p) {
+ do_check_any_chunk(m, p);
+ assert(cinuse(p));
+ assert(next_pinuse(p));
+ /* If not pinuse and not mmapped, previous chunk has OK offset */
+ assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p);
+ if (is_mmapped(p))
+ do_check_mmapped_chunk(m, p);
+}
+
+/* Check properties of free chunks */
+static void do_check_free_chunk(mstate m, mchunkptr p) {
+ size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);
+ mchunkptr next = chunk_plus_offset(p, sz);
+ do_check_any_chunk(m, p);
+ assert(!cinuse(p));
+ assert(!next_pinuse(p));
+ assert (!is_mmapped(p));
+ if (p != m->dv && p != m->top) {
+ if (sz >= MIN_CHUNK_SIZE) {
+ assert((sz & CHUNK_ALIGN_MASK) == 0);
+ assert(is_aligned(chunk2mem(p)));
+ assert(next->prev_foot == sz);
+ assert(pinuse(p));
+ assert (next == m->top || cinuse(next));
+ assert(p->fd->bk == p);
+ assert(p->bk->fd == p);
+ }
+ else /* markers are always of size SIZE_T_SIZE */
+ assert(sz == SIZE_T_SIZE);
+ }
+}
+
+/* Check properties of malloced chunks at the point they are malloced */
+static void do_check_malloced_chunk(mstate m, void* mem, size_t s) {
+ if (mem != 0) {
+ mchunkptr p = mem2chunk(mem);
+ size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);
+ do_check_inuse_chunk(m, p);
+ assert((sz & CHUNK_ALIGN_MASK) == 0);
+ assert(sz >= MIN_CHUNK_SIZE);
+ assert(sz >= s);
+ /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */
+ assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE));
+ }
+}
+
+/* Check a tree and its subtrees. */
+static void do_check_tree(mstate m, tchunkptr t) {
+ tchunkptr head = 0;
+ tchunkptr u = t;
+ bindex_t tindex = t->index;
+ size_t tsize = chunksize(t);
+ bindex_t idx;
+ compute_tree_index(tsize, idx);
+ assert(tindex == idx);
+ assert(tsize >= MIN_LARGE_SIZE);
+ assert(tsize >= minsize_for_tree_index(idx));
+ assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1))));
+
+ do { /* traverse through chain of same-sized nodes */
+ do_check_any_chunk(m, ((mchunkptr)u));
+ assert(u->index == tindex);
+ assert(chunksize(u) == tsize);
+ assert(!cinuse(u));
+ assert(!next_pinuse(u));
+ assert(u->fd->bk == u);
+ assert(u->bk->fd == u);
+ if (u->parent == 0) {
+ assert(u->child[0] == 0);
+ assert(u->child[1] == 0);
+ }
+ else {
+ assert(head == 0); /* only one node on chain has parent */
+ head = u;
+ assert(u->parent != u);
+ assert (u->parent->child[0] == u ||
+ u->parent->child[1] == u ||
+ *((tbinptr*)(u->parent)) == u);
+ if (u->child[0] != 0) {
+ assert(u->child[0]->parent == u);
+ assert(u->child[0] != u);
+ do_check_tree(m, u->child[0]);
+ }
+ if (u->child[1] != 0) {
+ assert(u->child[1]->parent == u);
+ assert(u->child[1] != u);
+ do_check_tree(m, u->child[1]);
+ }
+ if (u->child[0] != 0 && u->child[1] != 0) {
+ assert(chunksize(u->child[0]) < chunksize(u->child[1]));
+ }
+ }
+ u = u->fd;
+ } while (u != t);
+ assert(head != 0);
+}
+
+/* Check all the chunks in a treebin. */
+static void do_check_treebin(mstate m, bindex_t i) {
+ tbinptr* tb = treebin_at(m, i);
+ tchunkptr t = *tb;
+ int empty = (m->treemap & (1U << i)) == 0;
+ if (t == 0)
+ assert(empty);
+ if (!empty)
+ do_check_tree(m, t);
+}
+
+/* Check all the chunks in a smallbin. */
+static void do_check_smallbin(mstate m, bindex_t i) {
+ sbinptr b = smallbin_at(m, i);
+ mchunkptr p = b->bk;
+ unsigned int empty = (m->smallmap & (1U << i)) == 0;
+ if (p == b)
+ assert(empty);
+ if (!empty) {
+ for (; p != b; p = p->bk) {
+ size_t size = chunksize(p);
+ mchunkptr q;
+ /* each chunk claims to be free */
+ do_check_free_chunk(m, p);
+ /* chunk belongs in bin */
+ assert(small_index(size) == i);
+ assert(p->bk == b || chunksize(p->bk) == chunksize(p));
+ /* chunk is followed by an inuse chunk */
+ q = next_chunk(p);
+ if (q->head != FENCEPOST_HEAD)
+ do_check_inuse_chunk(m, q);
+ }
+ }
+}
+
+/* Find x in a bin. Used in other check functions. */
+static int bin_find(mstate m, mchunkptr x) {
+ size_t size = chunksize(x);
+ if (is_small(size)) {
+ bindex_t sidx = small_index(size);
+ sbinptr b = smallbin_at(m, sidx);
+ if (smallmap_is_marked(m, sidx)) {
+ mchunkptr p = b;
+ do {
+ if (p == x)
+ return 1;
+ } while ((p = p->fd) != b);
+ }
+ }
+ else {
+ bindex_t tidx;
+ compute_tree_index(size, tidx);
+ if (treemap_is_marked(m, tidx)) {
+ tchunkptr t = *treebin_at(m, tidx);
+ size_t sizebits = size << leftshift_for_tree_index(tidx);
+ while (t != 0 && chunksize(t) != size) {
+ t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
+ sizebits <<= 1;
+ }
+ if (t != 0) {
+ tchunkptr u = t;
+ do {
+ if (u == (tchunkptr)x)
+ return 1;
+ } while ((u = u->fd) != t);
+ }
+ }
+ }
+ return 0;
+}
+
+/* Traverse each chunk and check it; return total */
+static size_t traverse_and_check(mstate m) {
+ size_t sum = 0;
+ if (is_initialized(m)) {
+ msegmentptr s = &m->seg;
+ sum += m->topsize + TOP_FOOT_SIZE;
+ while (s != 0) {
+ mchunkptr q = align_as_chunk(s->base);
+ mchunkptr lastq = 0;
+ assert(pinuse(q));
+ while (segment_holds(s, q) &&
+ q != m->top && q->head != FENCEPOST_HEAD) {
+ sum += chunksize(q);
+ if (cinuse(q)) {
+ assert(!bin_find(m, q));
+ do_check_inuse_chunk(m, q);
+ }
+ else {
+ assert(q == m->dv || bin_find(m, q));
+ assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */
+ do_check_free_chunk(m, q);
+ }
+ lastq = q;
+ q = next_chunk(q);
+ }
+ s = s->next;
+ }
+ }
+ return sum;
+}
+
+/* Check all properties of malloc_state. */
+static void do_check_malloc_state(mstate m) {
+ bindex_t i;
+ size_t total;
+ /* check bins */
+ for (i = 0; i < NSMALLBINS; ++i)
+ do_check_smallbin(m, i);
+ for (i = 0; i < NTREEBINS; ++i)
+ do_check_treebin(m, i);
+
+ if (m->dvsize != 0) { /* check dv chunk */
+ do_check_any_chunk(m, m->dv);
+ assert(m->dvsize == chunksize(m->dv));
+ assert(m->dvsize >= MIN_CHUNK_SIZE);
+ assert(bin_find(m, m->dv) == 0);
+ }
+
+ if (m->top != 0) { /* check top chunk */
+ do_check_top_chunk(m, m->top);
+ assert(m->topsize == chunksize(m->top));
+ assert(m->topsize > 0);
+ assert(bin_find(m, m->top) == 0);
+ }
+
+ total = traverse_and_check(m);
+ assert(total <= m->footprint);
+ assert(m->footprint <= m->max_footprint);
+}
+#endif /* DEBUG */
+
+/* ----------------------------- statistics ------------------------------ */
+
+#if !NO_MALLINFO
+static struct mallinfo internal_mallinfo(mstate m) {
+ struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ if (!PREACTION(m)) {
+ check_malloc_state(m);
+ if (is_initialized(m)) {
+ size_t nfree = SIZE_T_ONE; /* top always free */
+ size_t mfree = m->topsize + TOP_FOOT_SIZE;
+ size_t sum = mfree;
+ msegmentptr s = &m->seg;
+ while (s != 0) {
+ mchunkptr q = align_as_chunk(s->base);
+ while (segment_holds(s, q) &&
+ q != m->top && q->head != FENCEPOST_HEAD) {
+ size_t sz = chunksize(q);
+ sum += sz;
+ if (!cinuse(q)) {
+ mfree += sz;
+ ++nfree;
+ }
+ q = next_chunk(q);
+ }
+ s = s->next;
+ }
+
+ nm.arena = sum;
+ nm.ordblks = nfree;
+ nm.hblkhd = m->footprint - sum;
+ nm.usmblks = m->max_footprint;
+ nm.uordblks = m->footprint - mfree;
+ nm.fordblks = mfree;
+ nm.keepcost = m->topsize;
+ }
+
+ POSTACTION(m);
+ }
+ return nm;
+}
+#endif /* !NO_MALLINFO */
+
+static void internal_malloc_stats(mstate m) {
+ if (!PREACTION(m)) {
+ size_t maxfp = 0;
+ size_t fp = 0;
+ size_t used = 0;
+ check_malloc_state(m);
+ if (is_initialized(m)) {
+ msegmentptr s = &m->seg;
+ maxfp = m->max_footprint;
+ fp = m->footprint;
+ used = fp - (m->topsize + TOP_FOOT_SIZE);
+
+ while (s != 0) {
+ mchunkptr q = align_as_chunk(s->base);
+ while (segment_holds(s, q) &&
+ q != m->top && q->head != FENCEPOST_HEAD) {
+ if (!cinuse(q))
+ used -= chunksize(q);
+ q = next_chunk(q);
+ }
+ s = s->next;
+ }
+ }
+
+ fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp));
+ fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp));
+ fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used));
+
+ POSTACTION(m);
+ }
+}
+
+/* ----------------------- Operations on smallbins ----------------------- */
+
+/*
+ Various forms of linking and unlinking are defined as macros. Even
+ the ones for trees, which are very long but have very short typical
+ paths. This is ugly but reduces reliance on inlining support of
+ compilers.
+*/
+
+/* Link a free chunk into a smallbin */
+#define insert_small_chunk(M, P, S) {\
+ bindex_t I = small_index(S);\
+ mchunkptr B = smallbin_at(M, I);\
+ mchunkptr F = B;\
+ assert(S >= MIN_CHUNK_SIZE);\
+ if (!smallmap_is_marked(M, I))\
+ mark_smallmap(M, I);\
+ else if (RTCHECK(ok_address(M, B->fd)))\
+ F = B->fd;\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ B->fd = P;\
+ F->bk = P;\
+ P->fd = F;\
+ P->bk = B;\
+}
+
+/* Unlink a chunk from a smallbin */
+#define unlink_small_chunk(M, P, S) {\
+ mchunkptr F = P->fd;\
+ mchunkptr B = P->bk;\
+ bindex_t I = small_index(S);\
+ assert(P != B);\
+ assert(P != F);\
+ assert(chunksize(P) == small_index2size(I));\
+ if (F == B)\
+ clear_smallmap(M, I);\
+ else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\
+ (B == smallbin_at(M,I) || ok_address(M, B)))) {\
+ F->bk = B;\
+ B->fd = F;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+}
+
+/* Unlink the first chunk from a smallbin */
+#define unlink_first_small_chunk(M, B, P, I) {\
+ mchunkptr F = P->fd;\
+ assert(P != B);\
+ assert(P != F);\
+ assert(chunksize(P) == small_index2size(I));\
+ if (B == F)\
+ clear_smallmap(M, I);\
+ else if (RTCHECK(ok_address(M, F))) {\
+ B->fd = F;\
+ F->bk = B;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+}
+
+/* Replace dv node, binning the old one */
+/* Used only when dvsize known to be small */
+#define replace_dv(M, P, S) {\
+ size_t DVS = M->dvsize;\
+ if (DVS != 0) {\
+ mchunkptr DV = M->dv;\
+ assert(is_small(DVS));\
+ insert_small_chunk(M, DV, DVS);\
+ }\
+ M->dvsize = S;\
+ M->dv = P;\
+}
+
+/* ------------------------- Operations on trees ------------------------- */
+
+/* Insert chunk into tree */
+#define insert_large_chunk(M, X, S) {\
+ tbinptr* H;\
+ bindex_t I;\
+ compute_tree_index(S, I);\
+ H = treebin_at(M, I);\
+ X->index = I;\
+ X->child[0] = X->child[1] = 0;\
+ if (!treemap_is_marked(M, I)) {\
+ mark_treemap(M, I);\
+ *H = X;\
+ X->parent = (tchunkptr)H;\
+ X->fd = X->bk = X;\
+ }\
+ else {\
+ tchunkptr T = *H;\
+ size_t K = S << leftshift_for_tree_index(I);\
+ for (;;) {\
+ if (chunksize(T) != S) {\
+ tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\
+ K <<= 1;\
+ if (*C != 0)\
+ T = *C;\
+ else if (RTCHECK(ok_address(M, C))) {\
+ *C = X;\
+ X->parent = T;\
+ X->fd = X->bk = X;\
+ break;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ break;\
+ }\
+ }\
+ else {\
+ tchunkptr F = T->fd;\
+ if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\
+ T->fd = F->bk = X;\
+ X->fd = F;\
+ X->bk = T;\
+ X->parent = 0;\
+ break;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ break;\
+ }\
+ }\
+ }\
+ }\
+}
+
+/*
+ Unlink steps:
+
+ 1. If x is a chained node, unlink it from its same-sized fd/bk links
+ and choose its bk node as its replacement.
+ 2. If x was the last node of its size, but not a leaf node, it must
+ be replaced with a leaf node (not merely one with an open left or
+ right), to make sure that lefts and rights of descendents
+ correspond properly to bit masks. We use the rightmost descendent
+ of x. We could use any other leaf, but this is easy to locate and
+ tends to counteract removal of leftmosts elsewhere, and so keeps
+ paths shorter than minimally guaranteed. This doesn't loop much
+ because on average a node in a tree is near the bottom.
+ 3. If x is the base of a chain (i.e., has parent links) relink
+ x's parent and children to x's replacement (or null if none).
+*/
+
+#define unlink_large_chunk(M, X) {\
+ tchunkptr XP = X->parent;\
+ tchunkptr R;\
+ if (X->bk != X) {\
+ tchunkptr F = X->fd;\
+ R = X->bk;\
+ if (RTCHECK(ok_address(M, F))) {\
+ F->bk = R;\
+ R->fd = F;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ }\
+ else {\
+ tchunkptr* RP;\
+ if (((R = *(RP = &(X->child[1]))) != 0) ||\
+ ((R = *(RP = &(X->child[0]))) != 0)) {\
+ tchunkptr* CP;\
+ while ((*(CP = &(R->child[1])) != 0) ||\
+ (*(CP = &(R->child[0])) != 0)) {\
+ R = *(RP = CP);\
+ }\
+ if (RTCHECK(ok_address(M, RP)))\
+ *RP = 0;\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ }\
+ }\
+ if (XP != 0) {\
+ tbinptr* H = treebin_at(M, X->index);\
+ if (X == *H) {\
+ if ((*H = R) == 0) \
+ clear_treemap(M, X->index);\
+ }\
+ else if (RTCHECK(ok_address(M, XP))) {\
+ if (XP->child[0] == X) \
+ XP->child[0] = R;\
+ else \
+ XP->child[1] = R;\
+ }\
+ else\
+ CORRUPTION_ERROR_ACTION(M);\
+ if (R != 0) {\
+ if (RTCHECK(ok_address(M, R))) {\
+ tchunkptr C0, C1;\
+ R->parent = XP;\
+ if ((C0 = X->child[0]) != 0) {\
+ if (RTCHECK(ok_address(M, C0))) {\
+ R->child[0] = C0;\
+ C0->parent = R;\
+ }\
+ else\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ if ((C1 = X->child[1]) != 0) {\
+ if (RTCHECK(ok_address(M, C1))) {\
+ R->child[1] = C1;\
+ C1->parent = R;\
+ }\
+ else\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ }\
+ else\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ }\
+}
+
+/* Relays to large vs small bin operations */
+
+#define insert_chunk(M, P, S)\
+ if (is_small(S)) insert_small_chunk(M, P, S)\
+ else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }
+
+#define unlink_chunk(M, P, S)\
+ if (is_small(S)) unlink_small_chunk(M, P, S)\
+ else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }
+
+
+/* Relays to internal calls to malloc/free from realloc, memalign etc */
+
+#if ONLY_MSPACES
+#define internal_malloc(m, b) mspace_malloc(m, b)
+#define internal_free(m, mem) mspace_free(m,mem);
+#else /* ONLY_MSPACES */
+#if MSPACES
+#define internal_malloc(m, b)\
+ (m == gm)? dlmalloc(b) : mspace_malloc(m, b)
+#define internal_free(m, mem)\
+ if (m == gm) dlfree(mem); else mspace_free(m,mem);
+#else /* MSPACES */
+#define internal_malloc(m, b) dlmalloc(b)
+#define internal_free(m, mem) dlfree(mem)
+#endif /* MSPACES */
+#endif /* ONLY_MSPACES */
+
+/* ----------------------- Direct-mmapping chunks ----------------------- */
+
+/*
+ Directly mmapped chunks are set up with an offset to the start of
+ the mmapped region stored in the prev_foot field of the chunk. This
+ allows reconstruction of the required argument to MUNMAP when freed,
+ and also allows adjustment of the returned chunk to meet alignment
+ requirements (especially in memalign). There is also enough space
+ allocated to hold a fake next chunk of size SIZE_T_SIZE to maintain
+ the PINUSE bit so frees can be checked.
+*/
+
+/* Malloc using mmap */
+static void* mmap_alloc(mstate m, size_t nb) {
+ size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
+ if (mmsize > nb) { /* Check for wrap around 0 */
+ char* mm = (char*)(DIRECT_MMAP(mmsize));
+ if (mm != CMFAIL) {
+ size_t offset = align_offset(chunk2mem(mm));
+ size_t psize = mmsize - offset - MMAP_FOOT_PAD;
+ mchunkptr p = (mchunkptr)(mm + offset);
+ p->prev_foot = offset | IS_MMAPPED_BIT;
+ (p)->head = (psize|CINUSE_BIT);
+ mark_inuse_foot(m, p, psize);
+ chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD;
+ chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0;
+
+ if (mm < m->least_addr)
+ m->least_addr = mm;
+ if ((m->footprint += mmsize) > m->max_footprint)
+ m->max_footprint = m->footprint;
+ assert(is_aligned(chunk2mem(p)));
+ check_mmapped_chunk(m, p);
+ return chunk2mem(p);
+ }
+ }
+ return 0;
+}
+
+/* Realloc using mmap */
+static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) {
+ size_t oldsize = chunksize(oldp);
+ if (is_small(nb)) /* Can't shrink mmap regions below small size */
+ return 0;
+ /* Keep old chunk if big enough but not too big */
+ if (oldsize >= nb + SIZE_T_SIZE &&
+ (oldsize - nb) <= (mparams.granularity << 1))
+ return oldp;
+ else {
+ size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT;
+ size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD;
+ size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES +
+ CHUNK_ALIGN_MASK);
+ char* cp = (char*)CALL_MREMAP((char*)oldp - offset,
+ oldmmsize, newmmsize, 1);
+ if (cp != CMFAIL) {
+ mchunkptr newp = (mchunkptr)(cp + offset);
+ size_t psize = newmmsize - offset - MMAP_FOOT_PAD;
+ newp->head = (psize|CINUSE_BIT);
+ mark_inuse_foot(m, newp, psize);
+ chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD;
+ chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0;
+
+ if (cp < m->least_addr)
+ m->least_addr = cp;
+ if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint)
+ m->max_footprint = m->footprint;
+ check_mmapped_chunk(m, newp);
+ return newp;
+ }
+ }
+ return 0;
+}
+
+/* -------------------------- mspace management -------------------------- */
+
+/* Initialize top chunk and its size */
+static void init_top(mstate m, mchunkptr p, size_t psize) {
+ /* Ensure alignment */
+ size_t offset = align_offset(chunk2mem(p));
+ p = (mchunkptr)((char*)p + offset);
+ psize -= offset;
+
+ m->top = p;
+ m->topsize = psize;
+ p->head = psize | PINUSE_BIT;
+ /* set size of fake trailing chunk holding overhead space only once */
+ chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE;
+ m->trim_check = mparams.trim_threshold; /* reset on each update */
+}
+
+/* Initialize bins for a new mstate that is otherwise zeroed out */
+static void init_bins(mstate m) {
+ /* Establish circular links for smallbins */
+ bindex_t i;
+ for (i = 0; i < NSMALLBINS; ++i) {
+ sbinptr bin = smallbin_at(m,i);
+ bin->fd = bin->bk = bin;
+ }
+}
+
+#if PROCEED_ON_ERROR
+
+/* default corruption action */
+static void reset_on_error(mstate m) {
+ int i;
+ ++malloc_corruption_error_count;
+ /* Reinitialize fields to forget about all memory */
+ m->smallbins = m->treebins = 0;
+ m->dvsize = m->topsize = 0;
+ m->seg.base = 0;
+ m->seg.size = 0;
+ m->seg.next = 0;
+ m->top = m->dv = 0;
+ for (i = 0; i < NTREEBINS; ++i)
+ *treebin_at(m, i) = 0;
+ init_bins(m);
+}
+#endif /* PROCEED_ON_ERROR */
+
+/* Allocate chunk and prepend remainder with chunk in successor base. */
+static void* prepend_alloc(mstate m, char* newbase, char* oldbase,
+ size_t nb) {
+ mchunkptr p = align_as_chunk(newbase);
+ mchunkptr oldfirst = align_as_chunk(oldbase);
+ size_t psize = (char*)oldfirst - (char*)p;
+ mchunkptr q = chunk_plus_offset(p, nb);
+ size_t qsize = psize - nb;
+ set_size_and_pinuse_of_inuse_chunk(m, p, nb);
+
+ assert((char*)oldfirst > (char*)q);
+ assert(pinuse(oldfirst));
+ assert(qsize >= MIN_CHUNK_SIZE);
+
+ /* consolidate remainder with first chunk of old base */
+ if (oldfirst == m->top) {
+ size_t tsize = m->topsize += qsize;
+ m->top = q;
+ q->head = tsize | PINUSE_BIT;
+ check_top_chunk(m, q);
+ }
+ else if (oldfirst == m->dv) {
+ size_t dsize = m->dvsize += qsize;
+ m->dv = q;
+ set_size_and_pinuse_of_free_chunk(q, dsize);
+ }
+ else {
+ if (!cinuse(oldfirst)) {
+ size_t nsize = chunksize(oldfirst);
+ unlink_chunk(m, oldfirst, nsize);
+ oldfirst = chunk_plus_offset(oldfirst, nsize);
+ qsize += nsize;
+ }
+ set_free_with_pinuse(q, qsize, oldfirst);
+ insert_chunk(m, q, qsize);
+ check_free_chunk(m, q);
+ }
+
+ check_malloced_chunk(m, chunk2mem(p), nb);
+ return chunk2mem(p);
+}
+
+
+/* Add a segment to hold a new noncontiguous region */
+static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) {
+ /* Determine locations and sizes of segment, fenceposts, old top */
+ char* old_top = (char*)m->top;
+ msegmentptr oldsp = segment_holding(m, old_top);
+ char* old_end = oldsp->base + oldsp->size;
+ size_t ssize = pad_request(sizeof(struct malloc_segment));
+ char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
+ size_t offset = align_offset(chunk2mem(rawsp));
+ char* asp = rawsp + offset;
+ char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp;
+ mchunkptr sp = (mchunkptr)csp;
+ msegmentptr ss = (msegmentptr)(chunk2mem(sp));
+ mchunkptr tnext = chunk_plus_offset(sp, ssize);
+ mchunkptr p = tnext;
+ int nfences = 0;
+
+ /* reset top to new space */
+ init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);
+
+ /* Set up segment record */
+ assert(is_aligned(ss));
+ set_size_and_pinuse_of_inuse_chunk(m, sp, ssize);
+ *ss = m->seg; /* Push current record */
+ m->seg.base = tbase;
+ m->seg.size = tsize;
+ set_segment_flags(&m->seg, mmapped);
+ m->seg.next = ss;
+
+ /* Insert trailing fenceposts */
+ for (;;) {
+ mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE);
+ p->head = FENCEPOST_HEAD;
+ ++nfences;
+ if ((char*)(&(nextp->head)) < old_end)
+ p = nextp;
+ else
+ break;
+ }
+ assert(nfences >= 2);
+
+ /* Insert the rest of old top into a bin as an ordinary free chunk */
+ if (csp != old_top) {
+ mchunkptr q = (mchunkptr)old_top;
+ size_t psize = csp - old_top;
+ mchunkptr tn = chunk_plus_offset(q, psize);
+ set_free_with_pinuse(q, psize, tn);
+ insert_chunk(m, q, psize);
+ }
+
+ check_top_chunk(m, m->top);
+}
+
+/* -------------------------- System allocation -------------------------- */
+
+/* Get memory from system using MORECORE or MMAP */
+static void* sys_alloc(mstate m, size_t nb) {
+ char* tbase = CMFAIL;
+ size_t tsize = 0;
+ flag_t mmap_flag = 0;
+
+ init_mparams();
+
+ /* Directly map large chunks */
+ if (use_mmap(m) && nb >= mparams.mmap_threshold) {
+ void* mem = mmap_alloc(m, nb);
+ if (mem != 0)
+ return mem;
+ }
+
+ /*
+ Try getting memory in any of three ways (in most-preferred to
+ least-preferred order):
+ 1. A call to MORECORE that can normally contiguously extend memory.
+ (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or
+ or main space is mmapped or a previous contiguous call failed)
+ 2. A call to MMAP new space (disabled if not HAVE_MMAP).
+ Note that under the default settings, if MORECORE is unable to
+ fulfill a request, and HAVE_MMAP is true, then mmap is
+ used as a noncontiguous system allocator. This is a useful backup
+ strategy for systems with holes in address spaces -- in this case
+ sbrk cannot contiguously expand the heap, but mmap may be able to
+ find space.
+ 3. A call to MORECORE that cannot usually contiguously extend memory.
+ (disabled if not HAVE_MORECORE)
+ */
+
+ if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) {
+ char* br = CMFAIL;
+ msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top);
+ size_t asize = 0;
+ ACQUIRE_MORECORE_LOCK();
+
+ if (ss == 0) { /* First time through or recovery */
+ char* base = (char*)CALL_MORECORE(0);
+ if (base != CMFAIL) {
+ asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE);
+ /* Adjust to end on a page boundary */
+ if (!is_page_aligned(base))
+ asize += (page_align((size_t)base) - (size_t)base);
+ /* Can't call MORECORE if size is negative when treated as signed */
+ if (asize < HALF_MAX_SIZE_T &&
+ (br = (char*)(CALL_MORECORE(asize))) == base) {
+ tbase = base;
+ tsize = asize;
+ }
+ }
+ }
+ else {
+ /* Subtract out existing available top space from MORECORE request. */
+ asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + SIZE_T_ONE);
+ /* Use mem here only if it did continuously extend old space */
+ if (asize < HALF_MAX_SIZE_T &&
+ (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) {
+ tbase = br;
+ tsize = asize;
+ }
+ }
+
+ if (tbase == CMFAIL) { /* Cope with partial failure */
+ if (br != CMFAIL) { /* Try to use/extend the space we did get */
+ if (asize < HALF_MAX_SIZE_T &&
+ asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) {
+ size_t esize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE - asize);
+ if (esize < HALF_MAX_SIZE_T) {
+ char* end = (char*)CALL_MORECORE(esize);
+ if (end != CMFAIL)
+ asize += esize;
+ else { /* Can't use; try to release */
+ (void)CALL_MORECORE(-asize);
+ br = CMFAIL;
+ }
+ }
+ }
+ }
+ if (br != CMFAIL) { /* Use the space we did get */
+ tbase = br;
+ tsize = asize;
+ }
+ else
+ disable_contiguous(m); /* Don't try contiguous path in the future */
+ }
+
+ RELEASE_MORECORE_LOCK();
+ }
+
+ if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */
+ size_t req = nb + TOP_FOOT_SIZE + SIZE_T_ONE;
+ size_t rsize = granularity_align(req);
+ if (rsize > nb) { /* Fail if wraps around zero */
+ char* mp = (char*)(CALL_MMAP(rsize));
+ if (mp != CMFAIL) {
+ tbase = mp;
+ tsize = rsize;
+ mmap_flag = IS_MMAPPED_BIT;
+ }
+ }
+ }
+
+ if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */
+ size_t asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE);
+ if (asize < HALF_MAX_SIZE_T) {
+ char* br = CMFAIL;
+ char* end = CMFAIL;
+ ACQUIRE_MORECORE_LOCK();
+ br = (char*)(CALL_MORECORE(asize));
+ end = (char*)(CALL_MORECORE(0));
+ RELEASE_MORECORE_LOCK();
+ if (br != CMFAIL && end != CMFAIL && br < end) {
+ size_t ssize = end - br;
+ if (ssize > nb + TOP_FOOT_SIZE) {
+ tbase = br;
+ tsize = ssize;
+ }
+ }
+ }
+ }
+
+ if (tbase != CMFAIL) {
+
+ if ((m->footprint += tsize) > m->max_footprint)
+ m->max_footprint = m->footprint;
+
+ if (!is_initialized(m)) { /* first-time initialization */
+ m->seg.base = m->least_addr = tbase;
+ m->seg.size = tsize;
+ set_segment_flags(&m->seg, mmap_flag);
+ m->magic = mparams.magic;
+ init_bins(m);
+ if (is_global(m))
+ init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);
+ else {
+ /* Offset top by embedded malloc_state */
+ mchunkptr mn = next_chunk(mem2chunk(m));
+ init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE);
+ }
+ }
+
+ else {
+ /* Try to merge with an existing segment */
+ msegmentptr sp = &m->seg;
+ while (sp != 0 && tbase != sp->base + sp->size)
+ sp = sp->next;
+ if (sp != 0 &&
+ !is_extern_segment(sp) &&
+ check_segment_merge(sp, tbase, tsize) &&
+ (get_segment_flags(sp) & IS_MMAPPED_BIT) == mmap_flag &&
+ segment_holds(sp, m->top)) { /* append */
+ sp->size += tsize;
+ init_top(m, m->top, m->topsize + tsize);
+ }
+ else {
+ if (tbase < m->least_addr)
+ m->least_addr = tbase;
+ sp = &m->seg;
+ while (sp != 0 && sp->base != tbase + tsize)
+ sp = sp->next;
+ if (sp != 0 &&
+ !is_extern_segment(sp) &&
+ check_segment_merge(sp, tbase, tsize) &&
+ (get_segment_flags(sp) & IS_MMAPPED_BIT) == mmap_flag) {
+ char* oldbase = sp->base;
+ sp->base = tbase;
+ sp->size += tsize;
+ return prepend_alloc(m, tbase, oldbase, nb);
+ }
+ else
+ add_segment(m, tbase, tsize, mmap_flag);
+ }
+ }
+
+ if (nb < m->topsize) { /* Allocate from new or extended top space */
+ size_t rsize = m->topsize -= nb;
+ mchunkptr p = m->top;
+ mchunkptr r = m->top = chunk_plus_offset(p, nb);
+ r->head = rsize | PINUSE_BIT;
+ set_size_and_pinuse_of_inuse_chunk(m, p, nb);
+ check_top_chunk(m, m->top);
+ check_malloced_chunk(m, chunk2mem(p), nb);
+ return chunk2mem(p);
+ }
+ }
+
+ MALLOC_FAILURE_ACTION;
+ return 0;
+}
+
+/* ----------------------- system deallocation -------------------------- */
+
+/* Unmap and unlink any mmapped segments that don't contain used chunks */
+static size_t release_unused_segments(mstate m) {
+ size_t released = 0;
+ msegmentptr pred = &m->seg;
+ msegmentptr sp = pred->next;
+ while (sp != 0) {
+ char* base = sp->base;
+ size_t size = sp->size;
+ msegmentptr next = sp->next;
+ if (is_mmapped_segment(sp) && !is_extern_segment(sp)) {
+ mchunkptr p = align_as_chunk(base);
+ size_t psize = chunksize(p);
+ /* Can unmap if first chunk holds entire segment and not pinned */
+ if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) {
+ tchunkptr tp = (tchunkptr)p;
+ assert(segment_holds(sp, (char*)sp));
+ if (p == m->dv) {
+ m->dv = 0;
+ m->dvsize = 0;
+ }
+ else {
+ unlink_large_chunk(m, tp);
+ }
+ if (CALL_MUNMAP(base, size) == 0) {
+ released += size;
+ m->footprint -= size;
+ /* unlink obsoleted record */
+ sp = pred;
+ sp->next = next;
+ }
+ else { /* back out if cannot unmap */
+ insert_large_chunk(m, tp, psize);
+ }
+ }
+ }
+ pred = sp;
+ sp = next;
+ }
+ return released;
+}
+
+static int sys_trim(mstate m, size_t pad) {
+ size_t released = 0;
+ if (pad < MAX_REQUEST && is_initialized(m)) {
+ pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */
+
+ if (m->topsize > pad) {
+ /* Shrink top space in granularity-size units, keeping at least one */
+ size_t unit = mparams.granularity;
+ size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit -
+ SIZE_T_ONE) * unit;
+ msegmentptr sp = segment_holding(m, (char*)m->top);
+
+ if (!is_extern_segment(sp)) {
+ if (is_mmapped_segment(sp)) {
+ if (HAVE_MMAP &&
+ sp->size >= extra &&
+ !has_segment_link(m, sp)) { /* can't shrink if pinned */
+ size_t newsize = sp->size - extra;
+ /* Prefer mremap, fall back to munmap */
+ if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) ||
+ (CALL_MUNMAP(sp->base + newsize, extra) == 0)) {
+ released = extra;
+ }
+ }
+ }
+ else if (HAVE_MORECORE) {
+ if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */
+ extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit;
+ ACQUIRE_MORECORE_LOCK();
+ {
+ /* Make sure end of memory is where we last set it. */
+ char* old_br = (char*)(CALL_MORECORE(0));
+ if (old_br == sp->base + sp->size) {
+ char* rel_br = (char*)(CALL_MORECORE(-extra));
+ char* new_br = (char*)(CALL_MORECORE(0));
+ if (rel_br != CMFAIL && new_br < old_br)
+ released = old_br - new_br;
+ }
+ }
+ RELEASE_MORECORE_LOCK();
+ }
+ }
+
+ if (released != 0) {
+ sp->size -= released;
+ m->footprint -= released;
+ init_top(m, m->top, m->topsize - released);
+ check_top_chunk(m, m->top);
+ }
+ }
+
+ /* Unmap any unused mmapped segments */
+ if (HAVE_MMAP)
+ released += release_unused_segments(m);
+
+ /* On failure, disable autotrim to avoid repeated failed future calls */
+ if (released == 0)
+ m->trim_check = MAX_SIZE_T;
+ }
+
+ return (released != 0)? 1 : 0;
+}
+
+/* ---------------------------- malloc support --------------------------- */
+
+/* allocate a large request from the best fitting chunk in a treebin */
+static void* tmalloc_large(mstate m, size_t nb) {
+ tchunkptr v = 0;
+ size_t rsize = -nb; /* Unsigned negation */
+ tchunkptr t;
+ bindex_t idx;
+ compute_tree_index(nb, idx);
+
+ if ((t = *treebin_at(m, idx)) != 0) {
+ /* Traverse tree for this bin looking for node with size == nb */
+ size_t sizebits = nb << leftshift_for_tree_index(idx);
+ tchunkptr rst = 0; /* The deepest untaken right subtree */
+ for (;;) {
+ tchunkptr rt;
+ size_t trem = chunksize(t) - nb;
+ if (trem < rsize) {
+ v = t;
+ if ((rsize = trem) == 0)
+ break;
+ }
+ rt = t->child[1];
+ t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
+ if (rt != 0 && rt != t)
+ rst = rt;
+ if (t == 0) {
+ t = rst; /* set t to least subtree holding sizes > nb */
+ break;
+ }
+ sizebits <<= 1;
+ }
+ }
+
+ if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */
+ binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap;
+ if (leftbits != 0) {
+ bindex_t i;
+ binmap_t leastbit = least_bit(leftbits);
+ compute_bit2idx(leastbit, i);
+ t = *treebin_at(m, i);
+ }
+ }
+
+ while (t != 0) { /* find smallest of tree or subtree */
+ size_t trem = chunksize(t) - nb;
+ if (trem < rsize) {
+ rsize = trem;
+ v = t;
+ }
+ t = leftmost_child(t);
+ }
+
+ /* If dv is a better fit, return 0 so malloc will use it */
+ if (v != 0 && rsize < (size_t)(m->dvsize - nb)) {
+ if (RTCHECK(ok_address(m, v))) { /* split */
+ mchunkptr r = chunk_plus_offset(v, nb);
+ assert(chunksize(v) == rsize + nb);
+ if (RTCHECK(ok_next(v, r))) {
+ unlink_large_chunk(m, v);
+ if (rsize < MIN_CHUNK_SIZE)
+ set_inuse_and_pinuse(m, v, (rsize + nb));
+ else {
+ set_size_and_pinuse_of_inuse_chunk(m, v, nb);
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ insert_chunk(m, r, rsize);
+ }
+ return chunk2mem(v);
+ }
+ }
+ CORRUPTION_ERROR_ACTION(m);
+ }
+ return 0;
+}
+
+/* allocate a small request from the best fitting chunk in a treebin */
+static void* tmalloc_small(mstate m, size_t nb) {
+ tchunkptr t, v;
+ size_t rsize;
+ bindex_t i;
+ binmap_t leastbit = least_bit(m->treemap);
+ compute_bit2idx(leastbit, i);
+
+ v = t = *treebin_at(m, i);
+ rsize = chunksize(t) - nb;
+
+ while ((t = leftmost_child(t)) != 0) {
+ size_t trem = chunksize(t) - nb;
+ if (trem < rsize) {
+ rsize = trem;
+ v = t;
+ }
+ }
+
+ if (RTCHECK(ok_address(m, v))) {
+ mchunkptr r = chunk_plus_offset(v, nb);
+ assert(chunksize(v) == rsize + nb);
+ if (RTCHECK(ok_next(v, r))) {
+ unlink_large_chunk(m, v);
+ if (rsize < MIN_CHUNK_SIZE)
+ set_inuse_and_pinuse(m, v, (rsize + nb));
+ else {
+ set_size_and_pinuse_of_inuse_chunk(m, v, nb);
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ replace_dv(m, r, rsize);
+ }
+ return chunk2mem(v);
+ }
+ }
+
+ CORRUPTION_ERROR_ACTION(m);
+ return 0;
+}
+
+/* --------------------------- realloc support --------------------------- */
+
+static void* internal_realloc(mstate m, void* oldmem, size_t bytes) {
+ if (bytes >= MAX_REQUEST) {
+ MALLOC_FAILURE_ACTION;
+ return 0;
+ }
+ if (!PREACTION(m)) {
+ mchunkptr oldp = mem2chunk(oldmem);
+ size_t oldsize = chunksize(oldp);
+ mchunkptr next = chunk_plus_offset(oldp, oldsize);
+ mchunkptr newp = 0;
+ void* extra = 0;
+
+ /* Try to either shrink or extend into top. Else malloc-copy-free */
+
+ if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) &&
+ ok_next(oldp, next) && ok_pinuse(next))) {
+ size_t nb = request2size(bytes);
+ if (is_mmapped(oldp))
+ newp = mmap_resize(m, oldp, nb);
+ else if (oldsize >= nb) { /* already big enough */
+ size_t rsize = oldsize - nb;
+ newp = oldp;
+ if (rsize >= MIN_CHUNK_SIZE) {
+ mchunkptr remainder = chunk_plus_offset(newp, nb);
+ set_inuse(m, newp, nb);
+ set_inuse(m, remainder, rsize);
+ extra = chunk2mem(remainder);
+ }
+ }
+ else if (next == m->top && oldsize + m->topsize > nb) {
+ /* Expand into top */
+ size_t newsize = oldsize + m->topsize;
+ size_t newtopsize = newsize - nb;
+ mchunkptr newtop = chunk_plus_offset(oldp, nb);
+ set_inuse(m, oldp, nb);
+ newtop->head = newtopsize |PINUSE_BIT;
+ m->top = newtop;
+ m->topsize = newtopsize;
+ newp = oldp;
+ }
+ }
+ else {
+ USAGE_ERROR_ACTION(m, oldmem);
+ POSTACTION(m);
+ return 0;
+ }
+
+ POSTACTION(m);
+
+ if (newp != 0) {
+ if (extra != 0) {
+ internal_free(m, extra);
+ }
+ check_inuse_chunk(m, newp);
+ return chunk2mem(newp);
+ }
+ else {
+ void* newmem = internal_malloc(m, bytes);
+ if (newmem != 0) {
+ size_t oc = oldsize - overhead_for(oldp);
+ memcpy(newmem, oldmem, (oc < bytes)? oc : bytes);
+ internal_free(m, oldmem);
+ }
+ return newmem;
+ }
+ }
+ return 0;
+}
+
+/* --------------------------- memalign support -------------------------- */
+
+static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {
+ if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */
+ return internal_malloc(m, bytes);
+ if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */
+ alignment = MIN_CHUNK_SIZE;
+ if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */
+ size_t a = MALLOC_ALIGNMENT << 1;
+ while (a < alignment) a <<= 1;
+ alignment = a;
+ }
+
+ if (bytes >= MAX_REQUEST - alignment) {
+ if (m != 0) { /* Test isn't needed but avoids compiler warning */
+ MALLOC_FAILURE_ACTION;
+ }
+ }
+ else {
+ size_t nb = request2size(bytes);
+ size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD;
+ char* mem = (char*)internal_malloc(m, req);
+ if (mem != 0) {
+ void* leader = 0;
+ void* trailer = 0;
+ mchunkptr p = mem2chunk(mem);
+
+ if (PREACTION(m)) return 0;
+ if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */
+ /*
+ Find an aligned spot inside chunk. Since we need to give
+ back leading space in a chunk of at least MIN_CHUNK_SIZE, if
+ the first calculation places us at a spot with less than
+ MIN_CHUNK_SIZE leader, we can move to the next aligned spot.
+ We've allocated enough total room so that this is always
+ possible.
+ */
+ char* br = (char*)mem2chunk((size_t)(((size_t)(mem +
+ alignment -
+ SIZE_T_ONE)) &
+ -alignment));
+ char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)?
+ br : br+alignment;
+ mchunkptr newp = (mchunkptr)pos;
+ size_t leadsize = pos - (char*)(p);
+ size_t newsize = chunksize(p) - leadsize;
+
+ if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */
+ newp->prev_foot = p->prev_foot + leadsize;
+ newp->head = (newsize|CINUSE_BIT);
+ }
+ else { /* Otherwise, give back leader, use the rest */
+ set_inuse(m, newp, newsize);
+ set_inuse(m, p, leadsize);
+ leader = chunk2mem(p);
+ }
+ p = newp;
+ }
+
+ /* Give back spare room at the end */
+ if (!is_mmapped(p)) {
+ size_t size = chunksize(p);
+ if (size > nb + MIN_CHUNK_SIZE) {
+ size_t remainder_size = size - nb;
+ mchunkptr remainder = chunk_plus_offset(p, nb);
+ set_inuse(m, p, nb);
+ set_inuse(m, remainder, remainder_size);
+ trailer = chunk2mem(remainder);
+ }
+ }
+
+ assert (chunksize(p) >= nb);
+ assert((((size_t)(chunk2mem(p))) % alignment) == 0);
+ check_inuse_chunk(m, p);
+ POSTACTION(m);
+ if (leader != 0) {
+ internal_free(m, leader);
+ }
+ if (trailer != 0) {
+ internal_free(m, trailer);
+ }
+ return chunk2mem(p);
+ }
+ }
+ return 0;
+}
+
+/* ------------------------ comalloc/coalloc support --------------------- */
+
+static void** ialloc(mstate m,
+ size_t n_elements,
+ size_t* sizes,
+ int opts,
+ void* chunks[]) {
+ /*
+ This provides common support for independent_X routines, handling
+ all of the combinations that can result.
+
+ The opts arg has:
+ bit 0 set if all elements are same size (using sizes[0])
+ bit 1 set if elements should be zeroed
+ */
+
+ size_t element_size; /* chunksize of each element, if all same */
+ size_t contents_size; /* total size of elements */
+ size_t array_size; /* request size of pointer array */
+ void* mem; /* malloced aggregate space */
+ mchunkptr p; /* corresponding chunk */
+ size_t remainder_size; /* remaining bytes while splitting */
+ void** marray; /* either "chunks" or malloced ptr array */
+ mchunkptr array_chunk; /* chunk for malloced ptr array */
+ flag_t was_enabled; /* to disable mmap */
+ size_t size;
+ size_t i;
+
+ /* compute array length, if needed */
+ if (chunks != 0) {
+ if (n_elements == 0)
+ return chunks; /* nothing to do */
+ marray = chunks;
+ array_size = 0;
+ }
+ else {
+ /* if empty req, must still return chunk representing empty array */
+ if (n_elements == 0)
+ return (void**)internal_malloc(m, 0);
+ marray = 0;
+ array_size = request2size(n_elements * (sizeof(void*)));
+ }
+
+ /* compute total element size */
+ if (opts & 0x1) { /* all-same-size */
+ element_size = request2size(*sizes);
+ contents_size = n_elements * element_size;
+ }
+ else { /* add up all the sizes */
+ element_size = 0;
+ contents_size = 0;
+ for (i = 0; i != n_elements; ++i)
+ contents_size += request2size(sizes[i]);
+ }
+
+ size = contents_size + array_size;
+
+ /*
+ Allocate the aggregate chunk. First disable direct-mmapping so
+ malloc won't use it, since we would not be able to later
+ free/realloc space internal to a segregated mmap region.
+ */
+ was_enabled = use_mmap(m);
+ disable_mmap(m);
+ mem = internal_malloc(m, size - CHUNK_OVERHEAD);
+ if (was_enabled)
+ enable_mmap(m);
+ if (mem == 0)
+ return 0;
+
+ if (PREACTION(m)) return 0;
+ p = mem2chunk(mem);
+ remainder_size = chunksize(p);
+
+ assert(!is_mmapped(p));
+
+ if (opts & 0x2) { /* optionally clear the elements */
+ memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size);
+ }
+
+ /* If not provided, allocate the pointer array as final part of chunk */
+ if (marray == 0) {
+ size_t array_chunk_size;
+ array_chunk = chunk_plus_offset(p, contents_size);
+ array_chunk_size = remainder_size - contents_size;
+ marray = (void**) (chunk2mem(array_chunk));
+ set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size);
+ remainder_size = contents_size;
+ }
+
+ /* split out elements */
+ for (i = 0; ; ++i) {
+ marray[i] = chunk2mem(p);
+ if (i != n_elements-1) {
+ if (element_size != 0)
+ size = element_size;
+ else
+ size = request2size(sizes[i]);
+ remainder_size -= size;
+ set_size_and_pinuse_of_inuse_chunk(m, p, size);
+ p = chunk_plus_offset(p, size);
+ }
+ else { /* the final element absorbs any overallocation slop */
+ set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size);
+ break;
+ }
+ }
+
+#if DEBUG
+ if (marray != chunks) {
+ /* final element must have exactly exhausted chunk */
+ if (element_size != 0) {
+ assert(remainder_size == element_size);
+ }
+ else {
+ assert(remainder_size == request2size(sizes[i]));
+ }
+ check_inuse_chunk(m, mem2chunk(marray));
+ }
+ for (i = 0; i != n_elements; ++i)
+ check_inuse_chunk(m, mem2chunk(marray[i]));
+
+#endif /* DEBUG */
+
+ POSTACTION(m);
+ return marray;
+}
+
+
+/* -------------------------- public routines ---------------------------- */
+
+#if !ONLY_MSPACES
+
+void* dlmalloc(size_t bytes) {
+ /*
+ Basic algorithm:
+ If a small request (< 256 bytes minus per-chunk overhead):
+ 1. If one exists, use a remainderless chunk in associated smallbin.
+ (Remainderless means that there are too few excess bytes to
+ represent as a chunk.)
+ 2. If it is big enough, use the dv chunk, which is normally the
+ chunk adjacent to the one used for the most recent small request.
+ 3. If one exists, split the smallest available chunk in a bin,
+ saving remainder in dv.
+ 4. If it is big enough, use the top chunk.
+ 5. If available, get memory from system and use it
+ Otherwise, for a large request:
+ 1. Find the smallest available binned chunk that fits, and use it
+ if it is better fitting than dv chunk, splitting if necessary.
+ 2. If better fitting than any binned chunk, use the dv chunk.
+ 3. If it is big enough, use the top chunk.
+ 4. If request size >= mmap threshold, try to directly mmap this chunk.
+ 5. If available, get memory from system and use it
+
+ The ugly goto's here ensure that postaction occurs along all paths.
+ */
+
+ if (!PREACTION(gm)) {
+ void* mem;
+ size_t nb;
+ if (bytes <= MAX_SMALL_REQUEST) {
+ bindex_t idx;
+ binmap_t smallbits;
+ nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);
+ idx = small_index(nb);
+ smallbits = gm->smallmap >> idx;
+
+ if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */
+ mchunkptr b, p;
+ idx += ~smallbits & 1; /* Uses next bin if idx empty */
+ b = smallbin_at(gm, idx);
+ p = b->fd;
+ assert(chunksize(p) == small_index2size(idx));
+ unlink_first_small_chunk(gm, b, p, idx);
+ set_inuse_and_pinuse(gm, p, small_index2size(idx));
+ mem = chunk2mem(p);
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+
+ else if (nb > gm->dvsize) {
+ if (smallbits != 0) { /* Use chunk in next nonempty smallbin */
+ mchunkptr b, p, r;
+ size_t rsize;
+ bindex_t i;
+ binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));
+ binmap_t leastbit = least_bit(leftbits);
+ compute_bit2idx(leastbit, i);
+ b = smallbin_at(gm, i);
+ p = b->fd;
+ assert(chunksize(p) == small_index2size(i));
+ unlink_first_small_chunk(gm, b, p, i);
+ rsize = small_index2size(i) - nb;
+ /* Fit here cannot be remainderless if 4byte sizes */
+ if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
+ set_inuse_and_pinuse(gm, p, small_index2size(i));
+ else {
+ set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
+ r = chunk_plus_offset(p, nb);
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ replace_dv(gm, r, rsize);
+ }
+ mem = chunk2mem(p);
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+
+ else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) {
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+ }
+ }
+ else if (bytes >= MAX_REQUEST)
+ nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */
+ else {
+ nb = pad_request(bytes);
+ if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) {
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+ }
+
+ if (nb <= gm->dvsize) {
+ size_t rsize = gm->dvsize - nb;
+ mchunkptr p = gm->dv;
+ if (rsize >= MIN_CHUNK_SIZE) { /* split dv */
+ mchunkptr r = gm->dv = chunk_plus_offset(p, nb);
+ gm->dvsize = rsize;
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
+ }
+ else { /* exhaust dv */
+ size_t dvs = gm->dvsize;
+ gm->dvsize = 0;
+ gm->dv = 0;
+ set_inuse_and_pinuse(gm, p, dvs);
+ }
+ mem = chunk2mem(p);
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+
+ else if (nb < gm->topsize) { /* Split top */
+ size_t rsize = gm->topsize -= nb;
+ mchunkptr p = gm->top;
+ mchunkptr r = gm->top = chunk_plus_offset(p, nb);
+ r->head = rsize | PINUSE_BIT;
+ set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
+ mem = chunk2mem(p);
+ check_top_chunk(gm, gm->top);
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+
+ mem = sys_alloc(gm, nb);
+
+ postaction:
+ POSTACTION(gm);
+ return mem;
+ }
+
+ return 0;
+}
+
+void dlfree(void* mem) {
+ /*
+ Consolidate freed chunks with preceeding or succeeding bordering
+ free chunks, if they exist, and then place in a bin. Intermixed
+ with special cases for top, dv, mmapped chunks, and usage errors.
+ */
+
+ if (mem != 0) {
+ mchunkptr p = mem2chunk(mem);
+#if FOOTERS
+ mstate fm = get_mstate_for(p);
+ if (!ok_magic(fm)) {
+ USAGE_ERROR_ACTION(fm, p);
+ return;
+ }
+#else /* FOOTERS */
+#define fm gm
+#endif /* FOOTERS */
+ if (!PREACTION(fm)) {
+ check_inuse_chunk(fm, p);
+ if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
+ size_t psize = chunksize(p);
+ mchunkptr next = chunk_plus_offset(p, psize);
+ if (!pinuse(p)) {
+ size_t prevsize = p->prev_foot;
+ if ((prevsize & IS_MMAPPED_BIT) != 0) {
+ prevsize &= ~IS_MMAPPED_BIT;
+ psize += prevsize + MMAP_FOOT_PAD;
+ if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)
+ fm->footprint -= psize;
+ goto postaction;
+ }
+ else {
+ mchunkptr prev = chunk_minus_offset(p, prevsize);
+ psize += prevsize;
+ p = prev;
+ if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */
+ if (p != fm->dv) {
+ unlink_chunk(fm, p, prevsize);
+ }
+ else if ((next->head & INUSE_BITS) == INUSE_BITS) {
+ fm->dvsize = psize;
+ set_free_with_pinuse(p, psize, next);
+ goto postaction;
+ }
+ }
+ else
+ goto erroraction;
+ }
+ }
+
+ if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
+ if (!cinuse(next)) { /* consolidate forward */
+ if (next == fm->top) {
+ size_t tsize = fm->topsize += psize;
+ fm->top = p;
+ p->head = tsize | PINUSE_BIT;
+ if (p == fm->dv) {
+ fm->dv = 0;
+ fm->dvsize = 0;
+ }
+ if (should_trim(fm, tsize))
+ sys_trim(fm, 0);
+ goto postaction;
+ }
+ else if (next == fm->dv) {
+ size_t dsize = fm->dvsize += psize;
+ fm->dv = p;
+ set_size_and_pinuse_of_free_chunk(p, dsize);
+ goto postaction;
+ }
+ else {
+ size_t nsize = chunksize(next);
+ psize += nsize;
+ unlink_chunk(fm, next, nsize);
+ set_size_and_pinuse_of_free_chunk(p, psize);
+ if (p == fm->dv) {
+ fm->dvsize = psize;
+ goto postaction;
+ }
+ }
+ }
+ else
+ set_free_with_pinuse(p, psize, next);
+ insert_chunk(fm, p, psize);
+ check_free_chunk(fm, p);
+ goto postaction;
+ }
+ }
+ erroraction:
+ USAGE_ERROR_ACTION(fm, p);
+ postaction:
+ POSTACTION(fm);
+ }
+ }
+#if !FOOTERS
+#undef fm
+#endif /* FOOTERS */
+}
+
+void* dlcalloc(size_t n_elements, size_t elem_size) {
+ void* mem;
+ size_t req = 0;
+ if (n_elements != 0) {
+ req = n_elements * elem_size;
+ if (((n_elements | elem_size) & ~(size_t)0xffff) &&
+ (req / n_elements != elem_size))
+ req = MAX_SIZE_T; /* force downstream failure on overflow */
+ }
+ mem = dlmalloc(req);
+ if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
+ memset(mem, 0, req);
+ return mem;
+}
+
+void* dlrealloc(void* oldmem, size_t bytes) {
+ if (oldmem == 0)
+ return dlmalloc(bytes);
+#ifdef REALLOC_ZERO_BYTES_FREES
+ if (bytes == 0) {
+ dlfree(oldmem);
+ return 0;
+ }
+#endif /* REALLOC_ZERO_BYTES_FREES */
+ else {
+#if ! FOOTERS
+ mstate m = gm;
+#else /* FOOTERS */
+ mstate m = get_mstate_for(mem2chunk(oldmem));
+ if (!ok_magic(m)) {
+ USAGE_ERROR_ACTION(m, oldmem);
+ return 0;
+ }
+#endif /* FOOTERS */
+ return internal_realloc(m, oldmem, bytes);
+ }
+}
+
+void* dlmemalign(size_t alignment, size_t bytes) {
+ return internal_memalign(gm, alignment, bytes);
+}
+
+void** dlindependent_calloc(size_t n_elements, size_t elem_size,
+ void* chunks[]) {
+ size_t sz = elem_size; /* serves as 1-element array */
+ return ialloc(gm, n_elements, &sz, 3, chunks);
+}
+
+void** dlindependent_comalloc(size_t n_elements, size_t sizes[],
+ void* chunks[]) {
+ return ialloc(gm, n_elements, sizes, 0, chunks);
+}
+
+void* dlvalloc(size_t bytes) {
+ size_t pagesz;
+ init_mparams();
+ pagesz = mparams.page_size;
+ return dlmemalign(pagesz, bytes);
+}
+
+void* dlpvalloc(size_t bytes) {
+ size_t pagesz;
+ init_mparams();
+ pagesz = mparams.page_size;
+ return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE));
+}
+
+int dlmalloc_trim(size_t pad) {
+ int result = 0;
+ if (!PREACTION(gm)) {
+ result = sys_trim(gm, pad);
+ POSTACTION(gm);
+ }
+ return result;
+}
+
+size_t dlmalloc_footprint(void) {
+ return gm->footprint;
+}
+
+size_t dlmalloc_max_footprint(void) {
+ return gm->max_footprint;
+}
+
+#if !NO_MALLINFO
+struct mallinfo dlmallinfo(void) {
+ return internal_mallinfo(gm);
+}
+#endif /* NO_MALLINFO */
+
+void dlmalloc_stats() {
+ internal_malloc_stats(gm);
+}
+
+size_t dlmalloc_usable_size(void* mem) {
+ if (mem != 0) {
+ mchunkptr p = mem2chunk(mem);
+ if (cinuse(p))
+ return chunksize(p) - overhead_for(p);
+ }
+ return 0;
+}
+
+int dlmallopt(int param_number, int value) {
+ return change_mparam(param_number, value);
+}
+
+#endif /* !ONLY_MSPACES */
+
+/* ----------------------------- user mspaces ---------------------------- */
+
+#if MSPACES
+
+static mstate init_user_mstate(char* tbase, size_t tsize) {
+ size_t msize = pad_request(sizeof(struct malloc_state));
+ mchunkptr mn;
+ mchunkptr msp = align_as_chunk(tbase);
+ mstate m = (mstate)(chunk2mem(msp));
+ memset(m, 0, msize);
+ INITIAL_LOCK(&m->mutex);
+ msp->head = (msize|PINUSE_BIT|CINUSE_BIT);
+ m->seg.base = m->least_addr = tbase;
+ m->seg.size = m->footprint = m->max_footprint = tsize;
+ m->magic = mparams.magic;
+ m->mflags = mparams.default_mflags;
+ disable_contiguous(m);
+ init_bins(m);
+ mn = next_chunk(mem2chunk(m));
+ init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE);
+ check_top_chunk(m, m->top);
+ return m;
+}
+
+mspace create_mspace(size_t capacity, int locked) {
+ mstate m = 0;
+ size_t msize = pad_request(sizeof(struct malloc_state));
+ init_mparams(); /* Ensure pagesize etc initialized */
+
+ if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
+ size_t rs = ((capacity == 0)? mparams.granularity :
+ (capacity + TOP_FOOT_SIZE + msize));
+ size_t tsize = granularity_align(rs);
+ char* tbase = (char*)(CALL_MMAP(tsize));
+ if (tbase != CMFAIL) {
+ m = init_user_mstate(tbase, tsize);
+ set_segment_flags(&m->seg, IS_MMAPPED_BIT);
+ set_lock(m, locked);
+ }
+ }
+ return (mspace)m;
+}
+
+mspace create_mspace_with_base(void* base, size_t capacity, int locked) {
+ mstate m = 0;
+ size_t msize = pad_request(sizeof(struct malloc_state));
+ init_mparams(); /* Ensure pagesize etc initialized */
+
+ if (capacity > msize + TOP_FOOT_SIZE &&
+ capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
+ m = init_user_mstate((char*)base, capacity);
+ set_segment_flags(&m->seg, EXTERN_BIT);
+ set_lock(m, locked);
+ }
+ return (mspace)m;
+}
+
+size_t destroy_mspace(mspace msp) {
+ size_t freed = 0;
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ msegmentptr sp = &ms->seg;
+ while (sp != 0) {
+ char* base = sp->base;
+ size_t size = sp->size;
+ flag_t flag = get_segment_flags(sp);
+ sp = sp->next;
+ if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) &&
+ CALL_MUNMAP(base, size) == 0)
+ freed += size;
+ }
+ }
+ else {
+ USAGE_ERROR_ACTION(ms,ms);
+ }
+ return freed;
+}
+
+/*
+ mspace versions of routines are near-clones of the global
+ versions. This is not so nice but better than the alternatives.
+*/
+
+
+void* mspace_malloc(mspace msp, size_t bytes) {
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ if (!PREACTION(ms)) {
+ void* mem;
+ size_t nb;
+ if (bytes <= MAX_SMALL_REQUEST) {
+ bindex_t idx;
+ binmap_t smallbits;
+ nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);
+ idx = small_index(nb);
+ smallbits = ms->smallmap >> idx;
+
+ if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */
+ mchunkptr b, p;
+ idx += ~smallbits & 1; /* Uses next bin if idx empty */
+ b = smallbin_at(ms, idx);
+ p = b->fd;
+ assert(chunksize(p) == small_index2size(idx));
+ unlink_first_small_chunk(ms, b, p, idx);
+ set_inuse_and_pinuse(ms, p, small_index2size(idx));
+ mem = chunk2mem(p);
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+
+ else if (nb > ms->dvsize) {
+ if (smallbits != 0) { /* Use chunk in next nonempty smallbin */
+ mchunkptr b, p, r;
+ size_t rsize;
+ bindex_t i;
+ binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));
+ binmap_t leastbit = least_bit(leftbits);
+ compute_bit2idx(leastbit, i);
+ b = smallbin_at(ms, i);
+ p = b->fd;
+ assert(chunksize(p) == small_index2size(i));
+ unlink_first_small_chunk(ms, b, p, i);
+ rsize = small_index2size(i) - nb;
+ /* Fit here cannot be remainderless if 4byte sizes */
+ if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
+ set_inuse_and_pinuse(ms, p, small_index2size(i));
+ else {
+ set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
+ r = chunk_plus_offset(p, nb);
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ replace_dv(ms, r, rsize);
+ }
+ mem = chunk2mem(p);
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+
+ else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) {
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+ }
+ }
+ else if (bytes >= MAX_REQUEST)
+ nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */
+ else {
+ nb = pad_request(bytes);
+ if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) {
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+ }
+
+ if (nb <= ms->dvsize) {
+ size_t rsize = ms->dvsize - nb;
+ mchunkptr p = ms->dv;
+ if (rsize >= MIN_CHUNK_SIZE) { /* split dv */
+ mchunkptr r = ms->dv = chunk_plus_offset(p, nb);
+ ms->dvsize = rsize;
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
+ }
+ else { /* exhaust dv */
+ size_t dvs = ms->dvsize;
+ ms->dvsize = 0;
+ ms->dv = 0;
+ set_inuse_and_pinuse(ms, p, dvs);
+ }
+ mem = chunk2mem(p);
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+
+ else if (nb < ms->topsize) { /* Split top */
+ size_t rsize = ms->topsize -= nb;
+ mchunkptr p = ms->top;
+ mchunkptr r = ms->top = chunk_plus_offset(p, nb);
+ r->head = rsize | PINUSE_BIT;
+ set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
+ mem = chunk2mem(p);
+ check_top_chunk(ms, ms->top);
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+
+ mem = sys_alloc(ms, nb);
+
+ postaction:
+ POSTACTION(ms);
+ return mem;
+ }
+
+ return 0;
+}
+
+void mspace_free(mspace msp, void* mem) {
+ if (mem != 0) {
+ mchunkptr p = mem2chunk(mem);
+#if FOOTERS
+ mstate fm = get_mstate_for(p);
+#else /* FOOTERS */
+ mstate fm = (mstate)msp;
+#endif /* FOOTERS */
+ if (!ok_magic(fm)) {
+ USAGE_ERROR_ACTION(fm, p);
+ return;
+ }
+ if (!PREACTION(fm)) {
+ check_inuse_chunk(fm, p);
+ if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
+ size_t psize = chunksize(p);
+ mchunkptr next = chunk_plus_offset(p, psize);
+ if (!pinuse(p)) {
+ size_t prevsize = p->prev_foot;
+ if ((prevsize & IS_MMAPPED_BIT) != 0) {
+ prevsize &= ~IS_MMAPPED_BIT;
+ psize += prevsize + MMAP_FOOT_PAD;
+ if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)
+ fm->footprint -= psize;
+ goto postaction;
+ }
+ else {
+ mchunkptr prev = chunk_minus_offset(p, prevsize);
+ psize += prevsize;
+ p = prev;
+ if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */
+ if (p != fm->dv) {
+ unlink_chunk(fm, p, prevsize);
+ }
+ else if ((next->head & INUSE_BITS) == INUSE_BITS) {
+ fm->dvsize = psize;
+ set_free_with_pinuse(p, psize, next);
+ goto postaction;
+ }
+ }
+ else
+ goto erroraction;
+ }
+ }
+
+ if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
+ if (!cinuse(next)) { /* consolidate forward */
+ if (next == fm->top) {
+ size_t tsize = fm->topsize += psize;
+ fm->top = p;
+ p->head = tsize | PINUSE_BIT;
+ if (p == fm->dv) {
+ fm->dv = 0;
+ fm->dvsize = 0;
+ }
+ if (should_trim(fm, tsize))
+ sys_trim(fm, 0);
+ goto postaction;
+ }
+ else if (next == fm->dv) {
+ size_t dsize = fm->dvsize += psize;
+ fm->dv = p;
+ set_size_and_pinuse_of_free_chunk(p, dsize);
+ goto postaction;
+ }
+ else {
+ size_t nsize = chunksize(next);
+ psize += nsize;
+ unlink_chunk(fm, next, nsize);
+ set_size_and_pinuse_of_free_chunk(p, psize);
+ if (p == fm->dv) {
+ fm->dvsize = psize;
+ goto postaction;
+ }
+ }
+ }
+ else
+ set_free_with_pinuse(p, psize, next);
+ insert_chunk(fm, p, psize);
+ check_free_chunk(fm, p);
+ goto postaction;
+ }
+ }
+ erroraction:
+ USAGE_ERROR_ACTION(fm, p);
+ postaction:
+ POSTACTION(fm);
+ }
+ }
+}
+
+void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) {
+ void* mem;
+ size_t req = 0;
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ if (n_elements != 0) {
+ req = n_elements * elem_size;
+ if (((n_elements | elem_size) & ~(size_t)0xffff) &&
+ (req / n_elements != elem_size))
+ req = MAX_SIZE_T; /* force downstream failure on overflow */
+ }
+ mem = internal_malloc(ms, req);
+ if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
+ memset(mem, 0, req);
+ return mem;
+}
+
+void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) {
+ if (oldmem == 0)
+ return mspace_malloc(msp, bytes);
+#ifdef REALLOC_ZERO_BYTES_FREES
+ if (bytes == 0) {
+ mspace_free(msp, oldmem);
+ return 0;
+ }
+#endif /* REALLOC_ZERO_BYTES_FREES */
+ else {
+#if FOOTERS
+ mchunkptr p = mem2chunk(oldmem);
+ mstate ms = get_mstate_for(p);
+#else /* FOOTERS */
+ mstate ms = (mstate)msp;
+#endif /* FOOTERS */
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ return internal_realloc(ms, oldmem, bytes);
+ }
+}
+
+void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) {
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ return internal_memalign(ms, alignment, bytes);
+}
+
+void** mspace_independent_calloc(mspace msp, size_t n_elements,
+ size_t elem_size, void* chunks[]) {
+ size_t sz = elem_size; /* serves as 1-element array */
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ return ialloc(ms, n_elements, &sz, 3, chunks);
+}
+
+void** mspace_independent_comalloc(mspace msp, size_t n_elements,
+ size_t sizes[], void* chunks[]) {
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ return ialloc(ms, n_elements, sizes, 0, chunks);
+}
+
+int mspace_trim(mspace msp, size_t pad) {
+ int result = 0;
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ if (!PREACTION(ms)) {
+ result = sys_trim(ms, pad);
+ POSTACTION(ms);
+ }
+ }
+ else {
+ USAGE_ERROR_ACTION(ms,ms);
+ }
+ return result;
+}
+
+void mspace_malloc_stats(mspace msp) {
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ internal_malloc_stats(ms);
+ }
+ else {
+ USAGE_ERROR_ACTION(ms,ms);
+ }
+}
+
+size_t mspace_footprint(mspace msp) {
+ size_t result;
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ result = ms->footprint;
+ }
+ USAGE_ERROR_ACTION(ms,ms);
+ return result;
+}
+
+
+size_t mspace_max_footprint(mspace msp) {
+ size_t result;
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ result = ms->max_footprint;
+ }
+ USAGE_ERROR_ACTION(ms,ms);
+ return result;
+}
+
+
+#if !NO_MALLINFO
+struct mallinfo mspace_mallinfo(mspace msp) {
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ }
+ return internal_mallinfo(ms);
+}
+#endif /* NO_MALLINFO */
+
+int mspace_mallopt(int param_number, int value) {
+ return change_mparam(param_number, value);
+}
+
+#endif /* MSPACES */
+
+/* -------------------- Alternative MORECORE functions ------------------- */
+
+/*
+ Guidelines for creating a custom version of MORECORE:
+
+ * For best performance, MORECORE should allocate in multiples of pagesize.
+ * MORECORE may allocate more memory than requested. (Or even less,
+ but this will usually result in a malloc failure.)
+ * MORECORE must not allocate memory when given argument zero, but
+ instead return one past the end address of memory from previous
+ nonzero call.
+ * For best performance, consecutive calls to MORECORE with positive
+ arguments should return increasing addresses, indicating that
+ space has been contiguously extended.
+ * Even though consecutive calls to MORECORE need not return contiguous
+ addresses, it must be OK for malloc'ed chunks to span multiple
+ regions in those cases where they do happen to be contiguous.
+ * MORECORE need not handle negative arguments -- it may instead
+ just return MFAIL when given negative arguments.
+ Negative arguments are always multiples of pagesize. MORECORE
+ must not misinterpret negative args as large positive unsigned
+ args. You can suppress all such calls from even occurring by defining
+ MORECORE_CANNOT_TRIM,
+
+ As an example alternative MORECORE, here is a custom allocator
+ kindly contributed for pre-OSX macOS. It uses virtually but not
+ necessarily physically contiguous non-paged memory (locked in,
+ present and won't get swapped out). You can use it by uncommenting
+ this section, adding some #includes, and setting up the appropriate
+ defines above:
+
+ #define MORECORE osMoreCore
+
+ There is also a shutdown routine that should somehow be called for
+ cleanup upon program exit.
+
+ #define MAX_POOL_ENTRIES 100
+ #define MINIMUM_MORECORE_SIZE (64 * 1024U)
+ static int next_os_pool;
+ void *our_os_pools[MAX_POOL_ENTRIES];
+
+ void *osMoreCore(int size)
+ {
+ void *ptr = 0;
+ static void *sbrk_top = 0;
+
+ if (size > 0)
+ {
+ if (size < MINIMUM_MORECORE_SIZE)
+ size = MINIMUM_MORECORE_SIZE;
+ if (CurrentExecutionLevel() == kTaskLevel)
+ ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0);
+ if (ptr == 0)
+ {
+ return (void *) MFAIL;
+ }
+ // save ptrs so they can be freed during cleanup
+ our_os_pools[next_os_pool] = ptr;
+ next_os_pool++;
+ ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK);
+ sbrk_top = (char *) ptr + size;
+ return ptr;
+ }
+ else if (size < 0)
+ {
+ // we don't currently support shrink behavior
+ return (void *) MFAIL;
+ }
+ else
+ {
+ return sbrk_top;
+ }
+ }
+
+ // cleanup any allocated memory pools
+ // called as last thing before shutting down driver
+
+ void osCleanupMem(void)
+ {
+ void **ptr;
+
+ for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++)
+ if (*ptr)
+ {
+ PoolDeallocate(*ptr);
+ *ptr = 0;
+ }
+ }
+
+*/
+
+
+/* -----------------------------------------------------------------------
+History:
+ V2.8.3 Thu Sep 22 11:16:32 2005 Doug Lea (dl at gee)
+ * Add max_footprint functions
+ * Ensure all appropriate literals are size_t
+ * Fix conditional compilation problem for some #define settings
+ * Avoid concatenating segments with the one provided
+ in create_mspace_with_base
+ * Rename some variables to avoid compiler shadowing warnings
+ * Use explicit lock initialization.
+ * Better handling of sbrk interference.
+ * Simplify and fix segment insertion, trimming and mspace_destroy
+ * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x
+ * Thanks especially to Dennis Flanagan for help on these.
+
+ V2.8.2 Sun Jun 12 16:01:10 2005 Doug Lea (dl at gee)
+ * Fix memalign brace error.
+
+ V2.8.1 Wed Jun 8 16:11:46 2005 Doug Lea (dl at gee)
+ * Fix improper #endif nesting in C++
+ * Add explicit casts needed for C++
+
+ V2.8.0 Mon May 30 14:09:02 2005 Doug Lea (dl at gee)
+ * Use trees for large bins
+ * Support mspaces
+ * Use segments to unify sbrk-based and mmap-based system allocation,
+ removing need for emulation on most platforms without sbrk.
+ * Default safety checks
+ * Optional footer checks. Thanks to William Robertson for the idea.
+ * Internal code refactoring
+ * Incorporate suggestions and platform-specific changes.
+ Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas,
+ Aaron Bachmann, Emery Berger, and others.
+ * Speed up non-fastbin processing enough to remove fastbins.
+ * Remove useless cfree() to avoid conflicts with other apps.
+ * Remove internal memcpy, memset. Compilers handle builtins better.
+ * Remove some options that no one ever used and rename others.
+
+ V2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee)
+ * Fix malloc_state bitmap array misdeclaration
+
+ V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee)
+ * Allow tuning of FIRST_SORTED_BIN_SIZE
+ * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.
+ * Better detection and support for non-contiguousness of MORECORE.
+ Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger
+ * Bypass most of malloc if no frees. Thanks To Emery Berger.
+ * Fix freeing of old top non-contiguous chunk im sysmalloc.
+ * Raised default trim and map thresholds to 256K.
+ * Fix mmap-related #defines. Thanks to Lubos Lunak.
+ * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield.
+ * Branch-free bin calculation
+ * Default trim and mmap thresholds now 256K.
+
+ V2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee)
+ * Introduce independent_comalloc and independent_calloc.
+ Thanks to Michael Pachos for motivation and help.
+ * Make optional .h file available
+ * Allow > 2GB requests on 32bit systems.
+ * new WIN32 sbrk, mmap, munmap, lock code from <Walter@GeNeSys-e.de>.
+ Thanks also to Andreas Mueller <a.mueller at paradatec.de>,
+ and Anonymous.
+ * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for
+ helping test this.)
+ * memalign: check alignment arg
+ * realloc: don't try to shift chunks backwards, since this
+ leads to more fragmentation in some programs and doesn't
+ seem to help in any others.
+ * Collect all cases in malloc requiring system memory into sysmalloc
+ * Use mmap as backup to sbrk
+ * Place all internal state in malloc_state
+ * Introduce fastbins (although similar to 2.5.1)
+ * Many minor tunings and cosmetic improvements
+ * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK
+ * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS
+ Thanks to Tony E. Bennett <tbennett@nvidia.com> and others.
+ * Include errno.h to support default failure action.
+
+ V2.6.6 Sun Dec 5 07:42:19 1999 Doug Lea (dl at gee)
+ * return null for negative arguments
+ * Added Several WIN32 cleanups from Martin C. Fong <mcfong at yahoo.com>
+ * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h'
+ (e.g. WIN32 platforms)
+ * Cleanup header file inclusion for WIN32 platforms
+ * Cleanup code to avoid Microsoft Visual C++ compiler complaints
+ * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing
+ memory allocation routines
+ * Set 'malloc_getpagesize' for WIN32 platforms (needs more work)
+ * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to
+ usage of 'assert' in non-WIN32 code
+ * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to
+ avoid infinite loop
+ * Always call 'fREe()' rather than 'free()'
+
+ V2.6.5 Wed Jun 17 15:57:31 1998 Doug Lea (dl at gee)
+ * Fixed ordering problem with boundary-stamping
+
+ V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee)
+ * Added pvalloc, as recommended by H.J. Liu
+ * Added 64bit pointer support mainly from Wolfram Gloger
+ * Added anonymously donated WIN32 sbrk emulation
+ * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen
+ * malloc_extend_top: fix mask error that caused wastage after
+ foreign sbrks
+ * Add linux mremap support code from HJ Liu
+
+ V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee)
+ * Integrated most documentation with the code.
+ * Add support for mmap, with help from
+ Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
+ * Use last_remainder in more cases.
+ * Pack bins using idea from colin@nyx10.cs.du.edu
+ * Use ordered bins instead of best-fit threshhold
+ * Eliminate block-local decls to simplify tracing and debugging.
+ * Support another case of realloc via move into top
+ * Fix error occuring when initial sbrk_base not word-aligned.
+ * Rely on page size for units instead of SBRK_UNIT to
+ avoid surprises about sbrk alignment conventions.
+ * Add mallinfo, mallopt. Thanks to Raymond Nijssen
+ (raymond@es.ele.tue.nl) for the suggestion.
+ * Add `pad' argument to malloc_trim and top_pad mallopt parameter.
+ * More precautions for cases where other routines call sbrk,
+ courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
+ * Added macros etc., allowing use in linux libc from
+ H.J. Lu (hjl@gnu.ai.mit.edu)
+ * Inverted this history list
+
+ V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee)
+ * Re-tuned and fixed to behave more nicely with V2.6.0 changes.
+ * Removed all preallocation code since under current scheme
+ the work required to undo bad preallocations exceeds
+ the work saved in good cases for most test programs.
+ * No longer use return list or unconsolidated bins since
+ no scheme using them consistently outperforms those that don't
+ given above changes.
+ * Use best fit for very large chunks to prevent some worst-cases.
+ * Added some support for debugging
+
+ V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee)
+ * Removed footers when chunks are in use. Thanks to
+ Paul Wilson (wilson@cs.texas.edu) for the suggestion.
+
+ V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee)
+ * Added malloc_trim, with help from Wolfram Gloger
+ (wmglo@Dent.MED.Uni-Muenchen.DE).
+
+ V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g)
+
+ V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g)
+ * realloc: try to expand in both directions
+ * malloc: swap order of clean-bin strategy;
+ * realloc: only conditionally expand backwards
+ * Try not to scavenge used bins
+ * Use bin counts as a guide to preallocation
+ * Occasionally bin return list chunks in first scan
+ * Add a few optimizations from colin@nyx10.cs.du.edu
+
+ V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g)
+ * faster bin computation & slightly different binning
+ * merged all consolidations to one part of malloc proper
+ (eliminating old malloc_find_space & malloc_clean_bin)
+ * Scan 2 returns chunks (not just 1)
+ * Propagate failure in realloc if malloc returns 0
+ * Add stuff to allow compilation on non-ANSI compilers
+ from kpv@research.att.com
+
+ V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu)
+ * removed potential for odd address access in prev_chunk
+ * removed dependency on getpagesize.h
+ * misc cosmetics and a bit more internal documentation
+ * anticosmetics: mangled names in macros to evade debugger strangeness
+ * tested on sparc, hp-700, dec-mips, rs6000
+ with gcc & native cc (hp, dec only) allowing
+ Detlefs & Zorn comparison study (in SIGPLAN Notices.)
+
+ Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu)
+ * Based loosely on libg++-1.2X malloc. (It retains some of the overall
+ structure of old version, but most details differ.)
+
+*/
diff --git a/Modules/_ctypes/libffi/src/frv/ffi.c b/Modules/_ctypes/libffi/src/frv/ffi.c
index cec578163f..5698c89c35 100644
--- a/Modules/_ctypes/libffi/src/frv/ffi.c
+++ b/Modules/_ctypes/libffi/src/frv/ffi.c
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
ffi.c - Copyright (C) 2004 Anthony Green
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 2008 Red Hat, Inc.
FR-V Foreign Function Interface
diff --git a/Modules/_ctypes/libffi/src/java_raw_api.c b/Modules/_ctypes/libffi/src/java_raw_api.c
new file mode 100644
index 0000000000..9c5383e6d5
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/java_raw_api.c
@@ -0,0 +1,356 @@
+/* -----------------------------------------------------------------------
+ java_raw_api.c - Copyright (c) 1999, 2007, 2008 Red Hat, Inc.
+
+ Cloned from raw_api.c
+
+ Raw_api.c author: Kresten Krab Thorup <krab@gnu.org>
+ Java_raw_api.c author: Hans-J. Boehm <hboehm@hpl.hp.com>
+
+ $Id $
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+/* This defines a Java- and 64-bit specific variant of the raw API. */
+/* It assumes that "raw" argument blocks look like Java stacks on a */
+/* 64-bit machine. Arguments that can be stored in a single stack */
+/* stack slots (longs, doubles) occupy 128 bits, but only the first */
+/* 64 bits are actually used. */
+
+#include <ffi.h>
+#include <ffi_common.h>
+#include <stdlib.h>
+
+#if !defined(NO_JAVA_RAW_API) && !defined(FFI_NO_RAW_API)
+
+size_t
+ffi_java_raw_size (ffi_cif *cif)
+{
+ size_t result = 0;
+ int i;
+
+ ffi_type **at = cif->arg_types;
+
+ for (i = cif->nargs-1; i >= 0; i--, at++)
+ {
+ switch((*at) -> type) {
+ case FFI_TYPE_UINT64:
+ case FFI_TYPE_SINT64:
+ case FFI_TYPE_DOUBLE:
+ result += 2 * FFI_SIZEOF_JAVA_RAW;
+ break;
+ case FFI_TYPE_STRUCT:
+ /* No structure parameters in Java. */
+ abort();
+ default:
+ result += FFI_SIZEOF_JAVA_RAW;
+ }
+ }
+
+ return result;
+}
+
+
+void
+ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args)
+{
+ unsigned i;
+ ffi_type **tp = cif->arg_types;
+
+#if WORDS_BIGENDIAN
+
+ for (i = 0; i < cif->nargs; i++, tp++, args++)
+ {
+ switch ((*tp)->type)
+ {
+ case FFI_TYPE_UINT8:
+ case FFI_TYPE_SINT8:
+ *args = (void*) ((char*)(raw++) + 3);
+ break;
+
+ case FFI_TYPE_UINT16:
+ case FFI_TYPE_SINT16:
+ *args = (void*) ((char*)(raw++) + 2);
+ break;
+
+#if FFI_SIZEOF_JAVA_RAW == 8
+ case FFI_TYPE_UINT64:
+ case FFI_TYPE_SINT64:
+ case FFI_TYPE_DOUBLE:
+ *args = (void *)raw;
+ raw += 2;
+ break;
+#endif
+
+ case FFI_TYPE_POINTER:
+ *args = (void*) &(raw++)->ptr;
+ break;
+
+ default:
+ *args = raw;
+ raw +=
+ ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
+ }
+ }
+
+#else /* WORDS_BIGENDIAN */
+
+#if !PDP
+
+ /* then assume little endian */
+ for (i = 0; i < cif->nargs; i++, tp++, args++)
+ {
+#if FFI_SIZEOF_JAVA_RAW == 8
+ switch((*tp)->type) {
+ case FFI_TYPE_UINT64:
+ case FFI_TYPE_SINT64:
+ case FFI_TYPE_DOUBLE:
+ *args = (void*) raw;
+ raw += 2;
+ break;
+ default:
+ *args = (void*) raw++;
+ }
+#else /* FFI_SIZEOF_JAVA_RAW != 8 */
+ *args = (void*) raw;
+ raw +=
+ ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
+#endif /* FFI_SIZEOF_JAVA_RAW == 8 */
+ }
+
+#else
+#error "pdp endian not supported"
+#endif /* ! PDP */
+
+#endif /* WORDS_BIGENDIAN */
+}
+
+void
+ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw)
+{
+ unsigned i;
+ ffi_type **tp = cif->arg_types;
+
+ for (i = 0; i < cif->nargs; i++, tp++, args++)
+ {
+ switch ((*tp)->type)
+ {
+ case FFI_TYPE_UINT8:
+#if WORDS_BIGENDIAN
+ *(UINT32*)(raw++) = *(UINT8*) (*args);
+#else
+ (raw++)->uint = *(UINT8*) (*args);
+#endif
+ break;
+
+ case FFI_TYPE_SINT8:
+#if WORDS_BIGENDIAN
+ *(SINT32*)(raw++) = *(SINT8*) (*args);
+#else
+ (raw++)->sint = *(SINT8*) (*args);
+#endif
+ break;
+
+ case FFI_TYPE_UINT16:
+#if WORDS_BIGENDIAN
+ *(UINT32*)(raw++) = *(UINT16*) (*args);
+#else
+ (raw++)->uint = *(UINT16*) (*args);
+#endif
+ break;
+
+ case FFI_TYPE_SINT16:
+#if WORDS_BIGENDIAN
+ *(SINT32*)(raw++) = *(SINT16*) (*args);
+#else
+ (raw++)->sint = *(SINT16*) (*args);
+#endif
+ break;
+
+ case FFI_TYPE_UINT32:
+#if WORDS_BIGENDIAN
+ *(UINT32*)(raw++) = *(UINT32*) (*args);
+#else
+ (raw++)->uint = *(UINT32*) (*args);
+#endif
+ break;
+
+ case FFI_TYPE_SINT32:
+#if WORDS_BIGENDIAN
+ *(SINT32*)(raw++) = *(SINT32*) (*args);
+#else
+ (raw++)->sint = *(SINT32*) (*args);
+#endif
+ break;
+
+ case FFI_TYPE_FLOAT:
+ (raw++)->flt = *(FLOAT32*) (*args);
+ break;
+
+#if FFI_SIZEOF_JAVA_RAW == 8
+ case FFI_TYPE_UINT64:
+ case FFI_TYPE_SINT64:
+ case FFI_TYPE_DOUBLE:
+ raw->uint = *(UINT64*) (*args);
+ raw += 2;
+ break;
+#endif
+
+ case FFI_TYPE_POINTER:
+ (raw++)->ptr = **(void***) args;
+ break;
+
+ default:
+#if FFI_SIZEOF_JAVA_RAW == 8
+ FFI_ASSERT(0); /* Should have covered all cases */
+#else
+ memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
+ raw +=
+ ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
+#endif
+ }
+ }
+}
+
+#if !FFI_NATIVE_RAW_API
+
+static void
+ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue)
+{
+#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8
+ switch (cif->rtype->type)
+ {
+ case FFI_TYPE_UINT8:
+ case FFI_TYPE_UINT16:
+ case FFI_TYPE_UINT32:
+ *(UINT64 *)rvalue <<= 32;
+ break;
+
+ case FFI_TYPE_SINT8:
+ case FFI_TYPE_SINT16:
+ case FFI_TYPE_SINT32:
+ case FFI_TYPE_INT:
+#if FFI_SIZEOF_JAVA_RAW == 4
+ case FFI_TYPE_POINTER:
+#endif
+ *(SINT64 *)rvalue <<= 32;
+ break;
+
+ default:
+ break;
+ }
+#endif
+}
+
+static void
+ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue)
+{
+#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8
+ switch (cif->rtype->type)
+ {
+ case FFI_TYPE_UINT8:
+ case FFI_TYPE_UINT16:
+ case FFI_TYPE_UINT32:
+ *(UINT64 *)rvalue >>= 32;
+ break;
+
+ case FFI_TYPE_SINT8:
+ case FFI_TYPE_SINT16:
+ case FFI_TYPE_SINT32:
+ case FFI_TYPE_INT:
+ *(SINT64 *)rvalue >>= 32;
+ break;
+
+ default:
+ break;
+ }
+#endif
+}
+
+/* This is a generic definition of ffi_raw_call, to be used if the
+ * native system does not provide a machine-specific implementation.
+ * Having this, allows code to be written for the raw API, without
+ * the need for system-specific code to handle input in that format;
+ * these following couple of functions will handle the translation forth
+ * and back automatically. */
+
+void ffi_java_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue,
+ ffi_java_raw *raw)
+{
+ void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
+ ffi_java_raw_to_ptrarray (cif, raw, avalue);
+ ffi_call (cif, fn, rvalue, avalue);
+ ffi_java_rvalue_to_raw (cif, rvalue);
+}
+
+#if FFI_CLOSURES /* base system provides closures */
+
+static void
+ffi_java_translate_args (ffi_cif *cif, void *rvalue,
+ void **avalue, void *user_data)
+{
+ ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
+ ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
+
+ ffi_java_ptrarray_to_raw (cif, avalue, raw);
+ (*cl->fun) (cif, rvalue, raw, cl->user_data);
+ ffi_java_raw_to_rvalue (cif, rvalue);
+}
+
+ffi_status
+ffi_prep_java_raw_closure_loc (ffi_java_raw_closure* cl,
+ ffi_cif *cif,
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
+ void *user_data,
+ void *codeloc)
+{
+ ffi_status status;
+
+ status = ffi_prep_closure_loc ((ffi_closure*) cl,
+ cif,
+ &ffi_java_translate_args,
+ codeloc,
+ codeloc);
+ if (status == FFI_OK)
+ {
+ cl->fun = fun;
+ cl->user_data = user_data;
+ }
+
+ return status;
+}
+
+/* Again, here is the generic version of ffi_prep_raw_closure, which
+ * will install an intermediate "hub" for translation of arguments from
+ * the pointer-array format, to the raw format */
+
+ffi_status
+ffi_prep_java_raw_closure (ffi_java_raw_closure* cl,
+ ffi_cif *cif,
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
+ void *user_data)
+{
+ return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl);
+}
+
+#endif /* FFI_CLOSURES */
+#endif /* !FFI_NATIVE_RAW_API */
+#endif /* !FFI_NO_RAW_API */
diff --git a/Modules/_ctypes/libffi/src/mips/ffi.c b/Modules/_ctypes/libffi/src/mips/ffi.c
index b6887be839..d714cc9e99 100644
--- a/Modules/_ctypes/libffi/src/mips/ffi.c
+++ b/Modules/_ctypes/libffi/src/mips/ffi.c
@@ -99,7 +99,7 @@ static void ffi_prep_args(char *stack,
p_argv = ecif->avalue;
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
+ for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs; i++, p_arg++)
{
size_t z;
unsigned int a;
@@ -123,9 +123,25 @@ static void ffi_prep_args(char *stack,
/* The size of a pointer depends on the ABI */
if (type == FFI_TYPE_POINTER)
- type =
- (ecif->cif->abi == FFI_N64) ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
+ type = (ecif->cif->abi == FFI_N64
+ || ecif->cif->abi == FFI_N64_SOFT_FLOAT)
+ ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
+ if (i < 8 && (ecif->cif->abi == FFI_N32_SOFT_FLOAT
+ || ecif->cif->abi == FFI_N64_SOFT_FLOAT))
+ {
+ switch (type)
+ {
+ case FFI_TYPE_FLOAT:
+ type = FFI_TYPE_UINT32;
+ break;
+ case FFI_TYPE_DOUBLE:
+ type = FFI_TYPE_UINT64;
+ break;
+ default:
+ break;
+ }
+ }
switch (type)
{
case FFI_TYPE_SINT8:
@@ -205,13 +221,17 @@ static void ffi_prep_args(char *stack,
definitions and generates the appropriate flags. */
static unsigned
-calc_n32_struct_flags(ffi_type *arg, unsigned *loc, unsigned *arg_reg)
+calc_n32_struct_flags(int soft_float, ffi_type *arg,
+ unsigned *loc, unsigned *arg_reg)
{
unsigned flags = 0;
unsigned index = 0;
ffi_type *e;
+ if (soft_float)
+ return 0;
+
while ((e = arg->elements[index]))
{
/* Align this object. */
@@ -236,7 +256,7 @@ calc_n32_struct_flags(ffi_type *arg, unsigned *loc, unsigned *arg_reg)
}
static unsigned
-calc_n32_return_struct_flags(ffi_type *arg)
+calc_n32_return_struct_flags(int soft_float, ffi_type *arg)
{
unsigned flags = 0;
unsigned small = FFI_TYPE_SMALLSTRUCT;
@@ -256,6 +276,7 @@ calc_n32_return_struct_flags(ffi_type *arg)
small = FFI_TYPE_SMALLSTRUCT2;
e = arg->elements[0];
+
if (e->type == FFI_TYPE_DOUBLE)
flags = FFI_TYPE_DOUBLE;
else if (e->type == FFI_TYPE_FLOAT)
@@ -276,6 +297,8 @@ calc_n32_return_struct_flags(ffi_type *arg)
floats! This must be passed the old way. */
return small;
}
+ if (soft_float)
+ flags += FFI_TYPE_STRUCT_SOFT;
}
else
if (!flags)
@@ -382,16 +405,19 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
#ifdef FFI_MIPS_N32
/* Set the flags necessary for N32 processing */
{
+ int type;
unsigned arg_reg = 0;
unsigned loc = 0;
unsigned count = (cif->nargs < 8) ? cif->nargs : 8;
unsigned index = 0;
unsigned struct_flags = 0;
+ int soft_float = (cif->abi == FFI_N32_SOFT_FLOAT
+ || cif->abi == FFI_N64_SOFT_FLOAT);
if (cif->rtype->type == FFI_TYPE_STRUCT)
{
- struct_flags = calc_n32_return_struct_flags(cif->rtype);
+ struct_flags = calc_n32_return_struct_flags(soft_float, cif->rtype);
if (struct_flags == 0)
{
@@ -411,7 +437,22 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
while (count-- > 0 && arg_reg < 8)
{
- switch ((cif->arg_types)[index]->type)
+ type = (cif->arg_types)[index]->type;
+ if (soft_float)
+ {
+ switch (type)
+ {
+ case FFI_TYPE_FLOAT:
+ type = FFI_TYPE_UINT32;
+ break;
+ case FFI_TYPE_DOUBLE:
+ type = FFI_TYPE_UINT64;
+ break;
+ default:
+ break;
+ }
+ }
+ switch (type)
{
case FFI_TYPE_FLOAT:
case FFI_TYPE_DOUBLE:
@@ -423,17 +464,25 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
/* Align it. */
arg_reg = ALIGN(arg_reg, 2);
/* Treat it as two adjacent doubles. */
- cif->flags +=
- (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS));
- arg_reg++;
- cif->flags +=
- (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS));
- arg_reg++;
+ if (soft_float)
+ {
+ arg_reg += 2;
+ }
+ else
+ {
+ cif->flags +=
+ (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS));
+ arg_reg++;
+ cif->flags +=
+ (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS));
+ arg_reg++;
+ }
break;
case FFI_TYPE_STRUCT:
loc = arg_reg * FFI_SIZEOF_ARG;
- cif->flags += calc_n32_struct_flags((cif->arg_types)[index],
+ cif->flags += calc_n32_struct_flags(soft_float,
+ (cif->arg_types)[index],
&loc, &arg_reg);
break;
@@ -469,17 +518,43 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
case FFI_TYPE_VOID:
/* Do nothing, 'cause FFI_TYPE_VOID is 0 */
break;
-
+
+ case FFI_TYPE_POINTER:
+ if (cif->abi == FFI_N32_SOFT_FLOAT || cif->abi == FFI_N32)
+ cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8);
+ else
+ cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
+ break;
+
case FFI_TYPE_FLOAT:
+ if (soft_float)
+ {
+ cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8);
+ break;
+ }
+ /* else fall through */
case FFI_TYPE_DOUBLE:
- cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8);
+ if (soft_float)
+ cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
+ else
+ cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8);
break;
+
case FFI_TYPE_LONGDOUBLE:
/* Long double is returned as if it were a struct containing
two doubles. */
- cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
- cif->flags += (FFI_TYPE_DOUBLE + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS))
- << (4 + (FFI_FLAG_BITS * 8));
+ if (soft_float)
+ {
+ cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
+ cif->flags += FFI_TYPE_SMALLSTRUCT2 << (4 + (FFI_FLAG_BITS * 8));
+ }
+ else
+ {
+ cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
+ cif->flags += (FFI_TYPE_DOUBLE
+ + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS))
+ << (4 + (FFI_FLAG_BITS * 8));
+ }
break;
default:
cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
@@ -499,7 +574,7 @@ extern int ffi_call_O32(void (*)(char *, extended_cif *, int, int),
/* Low level routine for calling N32 functions */
extern int ffi_call_N32(void (*)(char *, extended_cif *, int, int),
extended_cif *, unsigned,
- unsigned, unsigned *, void (*)(void));
+ unsigned, void *, void (*)(void));
void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{
@@ -529,10 +604,13 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
#ifdef FFI_MIPS_N32
case FFI_N32:
+ case FFI_N32_SOFT_FLOAT:
case FFI_N64:
+ case FFI_N64_SOFT_FLOAT:
{
int copy_rvalue = 0;
- void *rvalue_copy = ecif.rvalue;
+ int copy_offset = 0;
+ char *rvalue_copy = ecif.rvalue;
if (cif->rtype->type == FFI_TYPE_STRUCT && cif->rtype->size < 16)
{
/* For structures smaller than 16 bytes we clobber memory
@@ -541,10 +619,20 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
rvalue_copy = alloca(16);
copy_rvalue = 1;
}
+ else if (cif->rtype->type == FFI_TYPE_FLOAT
+ && (cif->abi == FFI_N64_SOFT_FLOAT
+ || cif->abi == FFI_N32_SOFT_FLOAT))
+ {
+ rvalue_copy = alloca (8);
+ copy_rvalue = 1;
+#if defined(__MIPSEB__) || defined(_MIPSEB)
+ copy_offset = 4;
+#endif
+ }
ffi_call_N32(ffi_prep_args, &ecif, cif->bytes,
cif->flags, rvalue_copy, fn);
if (copy_rvalue)
- memcpy(ecif.rvalue, rvalue_copy, cif->rtype->size);
+ memcpy(ecif.rvalue, rvalue_copy + copy_offset, cif->rtype->size);
}
break;
#endif
@@ -684,9 +772,10 @@ ffi_closure_mips_inner_O32 (ffi_closure *closure,
{
if (i < 2 && !seen_int &&
(arg_types[i]->type == FFI_TYPE_FLOAT ||
- arg_types[i]->type == FFI_TYPE_DOUBLE))
+ arg_types[i]->type == FFI_TYPE_DOUBLE ||
+ arg_types[i]->type == FFI_TYPE_LONGDOUBLE))
{
-#ifdef __MIPSEB__
+#if defined(__MIPSEB__) || defined(_MIPSEB)
if (arg_types[i]->type == FFI_TYPE_FLOAT)
avaluep[i] = ((char *) &fpr[i]) + sizeof (float);
else
@@ -755,7 +844,7 @@ ffi_closure_mips_inner_O32 (ffi_closure *closure,
static void
copy_struct_N32(char *target, unsigned offset, ffi_abi abi, ffi_type *type,
int argn, unsigned arg_offset, ffi_arg *ar,
- ffi_arg *fpr)
+ ffi_arg *fpr, int soft_float)
{
ffi_type **elt_typep = type->elements;
while(*elt_typep)
@@ -777,7 +866,7 @@ copy_struct_N32(char *target, unsigned offset, ffi_abi abi, ffi_type *type,
tp = target + offset;
- if (elt_type->type == FFI_TYPE_DOUBLE)
+ if (elt_type->type == FFI_TYPE_DOUBLE && !soft_float)
*(double *)tp = *(double *)fpp;
else
memcpy(tp, argp + arg_offset, elt_type->size);
@@ -815,8 +904,12 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
ffi_arg *avalue;
ffi_type **arg_types;
int i, avn, argn;
+ int soft_float;
+ ffi_arg *argp;
cif = closure->cif;
+ soft_float = cif->abi == FFI_N64_SOFT_FLOAT
+ || cif->abi == FFI_N32_SOFT_FLOAT;
avalue = alloca (cif->nargs * sizeof (ffi_arg));
avaluep = alloca (cif->nargs * sizeof (ffi_arg));
@@ -839,10 +932,16 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
while (i < avn)
{
if (arg_types[i]->type == FFI_TYPE_FLOAT
- || arg_types[i]->type == FFI_TYPE_DOUBLE)
+ || arg_types[i]->type == FFI_TYPE_DOUBLE
+ || arg_types[i]->type == FFI_TYPE_LONGDOUBLE)
{
- ffi_arg *argp = argn >= 8 ? ar + argn : fpr + argn;
-#ifdef __MIPSEB__
+ argp = (argn >= 8 || soft_float) ? ar + argn : fpr + argn;
+ if ((arg_types[i]->type == FFI_TYPE_LONGDOUBLE) && ((unsigned)argp & (arg_types[i]->alignment-1)))
+ {
+ argp=(ffi_arg*)ALIGN(argp,arg_types[i]->alignment);
+ argn++;
+ }
+#if defined(__MIPSEB__) || defined(_MIPSEB)
if (arg_types[i]->type == FFI_TYPE_FLOAT && argn < 8)
avaluep[i] = ((char *) argp) + sizeof (float);
else
@@ -856,11 +955,15 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
if (arg_types[i]->alignment > sizeof(ffi_arg))
argn = ALIGN(argn, arg_types[i]->alignment / sizeof(ffi_arg));
- ffi_arg *argp = ar + argn;
+ argp = ar + argn;
/* The size of a pointer depends on the ABI */
if (type == FFI_TYPE_POINTER)
- type = (cif->abi == FFI_N64) ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
+ type = (cif->abi == FFI_N64 || cif->abi == FFI_N64_SOFT_FLOAT)
+ ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
+
+ if (soft_float && type == FFI_TYPE_FLOAT)
+ type = FFI_TYPE_UINT32;
switch (type)
{
@@ -901,7 +1004,7 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
it was passed in registers. */
avaluep[i] = alloca(arg_types[i]->size);
copy_struct_N32(avaluep[i], 0, cif->abi, arg_types[i],
- argn, 0, ar, fpr);
+ argn, 0, ar, fpr, soft_float);
break;
}
diff --git a/Modules/_ctypes/libffi/src/mips/ffitarget.h b/Modules/_ctypes/libffi/src/mips/ffitarget.h
index 214afe4656..c5f4e05684 100644
--- a/Modules/_ctypes/libffi/src/mips/ffitarget.h
+++ b/Modules/_ctypes/libffi/src/mips/ffitarget.h
@@ -28,7 +28,10 @@
#define LIBFFI_TARGET_H
#ifdef linux
-#include <asm/sgidefs.h>
+# include <asm/sgidefs.h>
+#else
+# include <sgidefs.h>
+#endif
# ifndef _ABIN32
# define _ABIN32 _MIPS_SIM_NABI32
# endif
@@ -38,7 +41,6 @@
# ifndef _ABIO32
# define _ABIO32 _MIPS_SIM_ABI32
# endif
-#endif
#if !defined(_MIPS_SIM)
-- something is very wrong --
@@ -95,6 +97,15 @@
#define FFI_TYPE_STRUCT_DF 189
#define FFI_TYPE_STRUCT_SMALL 93
#define FFI_TYPE_STRUCT_SMALL2 109
+
+/* and for n32 soft float, add 16 * 2^4 */
+#define FFI_TYPE_STRUCT_D_SOFT 317
+#define FFI_TYPE_STRUCT_F_SOFT 301
+#define FFI_TYPE_STRUCT_DD_SOFT 509
+#define FFI_TYPE_STRUCT_FF_SOFT 429
+#define FFI_TYPE_STRUCT_FD_SOFT 493
+#define FFI_TYPE_STRUCT_DF_SOFT 445
+#define FFI_TYPE_STRUCT_SOFT 16
#endif
#ifdef LIBFFI_ASM
@@ -145,7 +156,8 @@
# endif /* _MIPS_SIM==_ABI64 */
#endif /* !FFI_MIPS_O32 */
#else /* !LIBFFI_ASM */
-#ifdef FFI_MIPS_O32
+# ifdef __GNUC__
+# ifdef FFI_MIPS_O32
/* O32 stack frames have 32bit integer args */
typedef unsigned int ffi_arg __attribute__((__mode__(__SI__)));
typedef signed int ffi_sarg __attribute__((__mode__(__SI__)));
@@ -153,7 +165,18 @@ typedef signed int ffi_sarg __attribute__((__mode__(__SI__)));
/* N32 and N64 frames have 64bit integer args */
typedef unsigned int ffi_arg __attribute__((__mode__(__DI__)));
typedef signed int ffi_sarg __attribute__((__mode__(__DI__)));
-#endif
+# endif
+# else
+# ifdef FFI_MIPS_O32
+/* O32 stack frames have 32bit integer args */
+typedef __uint32_t ffi_arg;
+typedef __int32_t ffi_sarg;
+# else
+/* N32 and N64 frames have 64bit integer args */
+typedef __uint64_t ffi_arg;
+typedef __int64_t ffi_sarg;
+# endif
+# endif /* __GNUC__ */
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
@@ -161,6 +184,8 @@ typedef enum ffi_abi {
FFI_N32,
FFI_N64,
FFI_O32_SOFT_FLOAT,
+ FFI_N32_SOFT_FLOAT,
+ FFI_N64_SOFT_FLOAT,
#ifdef FFI_MIPS_O32
#ifdef __mips_soft_float
@@ -170,9 +195,17 @@ typedef enum ffi_abi {
#endif
#else
# if _MIPS_SIM==_ABI64
+# ifdef __mips_soft_float
+ FFI_DEFAULT_ABI = FFI_N64_SOFT_FLOAT,
+# else
FFI_DEFAULT_ABI = FFI_N64,
+# endif
# else
+# ifdef __mips_soft_float
+ FFI_DEFAULT_ABI = FFI_N32_SOFT_FLOAT,
+# else
FFI_DEFAULT_ABI = FFI_N32,
+# endif
# endif
#endif
diff --git a/Modules/_ctypes/libffi/src/mips/n32.S b/Modules/_ctypes/libffi/src/mips/n32.S
index 28607b06d7..ae23094667 100644
--- a/Modules/_ctypes/libffi/src/mips/n32.S
+++ b/Modules/_ctypes/libffi/src/mips/n32.S
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- n32.S - Copyright (c) 1996, 1998, 2005 Red Hat, Inc.
+ n32.S - Copyright (c) 1996, 1998, 2005, 2007, 2009, 2010 Red Hat, Inc.
MIPS Foreign Function Interface
@@ -14,14 +14,14 @@
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
#define LIBFFI_ASM
@@ -40,7 +40,9 @@
#define SIZEOF_FRAME ( 8 * FFI_SIZEOF_ARG )
+#ifdef __GNUC__
.abicalls
+#endif
.text
.align 2
.globl ffi_call_N32
@@ -217,8 +219,10 @@ callit:
# Shift the return type flag over
SRL t6, 8*FFI_FLAG_BITS
-
+
+ beq t6, FFI_TYPE_SINT32, retint
bne t6, FFI_TYPE_INT, retfloat
+retint:
jal t9
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
REG_S v0, 0(t4)
@@ -277,12 +281,58 @@ retstruct_d_f:
b epilogue
retstruct_f_d:
- bne t6, FFI_TYPE_STRUCT_FD, retstruct_small
+ bne t6, FFI_TYPE_STRUCT_FD, retstruct_d_soft
jal t9
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
s.s $f0, 0(t4)
s.d $f2, 8(t4)
b epilogue
+
+retstruct_d_soft:
+ bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
+ jal t9
+ REG_L t4, 4*FFI_SIZEOF_ARG($fp)
+ sd v0, 0(t4)
+ b epilogue
+
+retstruct_f_soft:
+ bne t6, FFI_TYPE_STRUCT_F_SOFT, retstruct_d_d_soft
+ jal t9
+ REG_L t4, 4*FFI_SIZEOF_ARG($fp)
+ sw v0, 0(t4)
+ b epilogue
+
+retstruct_d_d_soft:
+ bne t6, FFI_TYPE_STRUCT_DD_SOFT, retstruct_f_f_soft
+ jal t9
+ REG_L t4, 4*FFI_SIZEOF_ARG($fp)
+ sd v0, 0(t4)
+ sd v1, 8(t4)
+ b epilogue
+
+retstruct_f_f_soft:
+ bne t6, FFI_TYPE_STRUCT_FF_SOFT, retstruct_d_f_soft
+ jal t9
+ REG_L t4, 4*FFI_SIZEOF_ARG($fp)
+ sw v0, 0(t4)
+ sw v1, 4(t4)
+ b epilogue
+
+retstruct_d_f_soft:
+ bne t6, FFI_TYPE_STRUCT_DF_SOFT, retstruct_f_d_soft
+ jal t9
+ REG_L t4, 4*FFI_SIZEOF_ARG($fp)
+ sd v0, 0(t4)
+ sw v1, 8(t4)
+ b epilogue
+
+retstruct_f_d_soft:
+ bne t6, FFI_TYPE_STRUCT_FD_SOFT, retstruct_small
+ jal t9
+ REG_L t4, 4*FFI_SIZEOF_ARG($fp)
+ sw v0, 0(t4)
+ sd v1, 8(t4)
+ b epilogue
retstruct_small:
bne t6, FFI_TYPE_STRUCT_SMALL, retstruct_small2
@@ -413,6 +463,11 @@ ffi_closure_N32:
jalr t9
# Return flags are in v0
+ bne v0, FFI_TYPE_SINT32, cls_retint
+ lw v0, V0_OFF2($sp)
+ b cls_epilogue
+
+cls_retint:
bne v0, FFI_TYPE_INT, cls_retfloat
REG_L v0, V0_OFF2($sp)
b cls_epilogue
@@ -474,6 +529,7 @@ cls_epilogue:
.LFE2:
.end ffi_closure_N32
+#ifdef __GNUC__
.section .eh_frame,"aw",@progbits
.Lframe1:
.4byte .LECIE1-.LSCIE1 # length
@@ -530,5 +586,6 @@ cls_epilogue:
.uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4
.align EH_FRAME_ALIGN
.LEFDE3:
+#endif /* __GNUC__ */
#endif
diff --git a/Modules/_ctypes/libffi/src/mips/o32.S b/Modules/_ctypes/libffi/src/mips/o32.S
index 2e80e9c592..eb279813a7 100644
--- a/Modules/_ctypes/libffi/src/mips/o32.S
+++ b/Modules/_ctypes/libffi/src/mips/o32.S
@@ -14,14 +14,14 @@
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
#define LIBFFI_ASM
diff --git a/Modules/_ctypes/libffi/src/moxie/eabi.S b/Modules/_ctypes/libffi/src/moxie/eabi.S
new file mode 100644
index 0000000000..379ea4bb0a
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/moxie/eabi.S
@@ -0,0 +1,128 @@
+/* -----------------------------------------------------------------------
+ eabi.S - Copyright (c) 2004 Anthony Green
+
+ FR-V Assembly glue.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+#define LIBFFI_ASM
+#include <fficonfig.h>
+#include <ffi.h>
+
+ .globl ffi_prep_args_EABI
+
+ .text
+ .p2align 4
+ .globl ffi_call_EABI
+ .type ffi_call_EABI, @function
+
+ # gr8 : ffi_prep_args
+ # gr9 : &ecif
+ # gr10: cif->bytes
+ # gr11: fig->flags
+ # gr12: ecif.rvalue
+ # gr13: fn
+
+ffi_call_EABI:
+ addi sp, #-80, sp
+ sti fp, @(sp, #24)
+ addi sp, #24, fp
+ movsg lr, gr5
+
+ /* Make room for the new arguments. */
+ /* subi sp, fp, gr10 */
+
+ /* Store return address and incoming args on stack. */
+ sti gr5, @(fp, #8)
+ sti gr8, @(fp, #-4)
+ sti gr9, @(fp, #-8)
+ sti gr10, @(fp, #-12)
+ sti gr11, @(fp, #-16)
+ sti gr12, @(fp, #-20)
+ sti gr13, @(fp, #-24)
+
+ sub sp, gr10, sp
+
+ /* Call ffi_prep_args. */
+ ldi @(fp, #-4), gr4
+ addi sp, #0, gr8
+ ldi @(fp, #-8), gr9
+#ifdef __FRV_FDPIC__
+ ldd @(gr4, gr0), gr14
+ calll @(gr14, gr0)
+#else
+ calll @(gr4, gr0)
+#endif
+
+ /* ffi_prep_args returns the new stack pointer. */
+ mov gr8, gr4
+
+ ldi @(sp, #0), gr8
+ ldi @(sp, #4), gr9
+ ldi @(sp, #8), gr10
+ ldi @(sp, #12), gr11
+ ldi @(sp, #16), gr12
+ ldi @(sp, #20), gr13
+
+ /* Always copy the return value pointer into the hidden
+ parameter register. This is only strictly necessary
+ when we're returning an aggregate type, but it doesn't
+ hurt to do this all the time, and it saves a branch. */
+ ldi @(fp, #-20), gr3
+
+ /* Use the ffi_prep_args return value for the new sp. */
+ mov gr4, sp
+
+ /* Call the target function. */
+ ldi @(fp, -24), gr4
+#ifdef __FRV_FDPIC__
+ ldd @(gr4, gr0), gr14
+ calll @(gr14, gr0)
+#else
+ calll @(gr4, gr0)
+#endif
+
+ /* Store the result. */
+ ldi @(fp, #-16), gr10 /* fig->flags */
+ ldi @(fp, #-20), gr4 /* ecif.rvalue */
+
+ /* Is the return value stored in two registers? */
+ cmpi gr10, #8, icc0
+ bne icc0, 0, .L2
+ /* Yes, save them. */
+ sti gr8, @(gr4, #0)
+ sti gr9, @(gr4, #4)
+ bra .L3
+.L2:
+ /* Is the return value a structure? */
+ cmpi gr10, #-1, icc0
+ beq icc0, 0, .L3
+ /* No, save a 4 byte return value. */
+ sti gr8, @(gr4, #0)
+.L3:
+
+ /* Restore the stack, and return. */
+ ldi @(fp, 8), gr5
+ ld @(fp, gr0), fp
+ addi sp,#80,sp
+ jmpl @(gr5,gr0)
+ .size ffi_call_EABI, .-ffi_call_EABI
+
diff --git a/Modules/_ctypes/libffi/src/moxie/ffi.c b/Modules/_ctypes/libffi/src/moxie/ffi.c
new file mode 100644
index 0000000000..54cbbb9e4a
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/moxie/ffi.c
@@ -0,0 +1,276 @@
+/* -----------------------------------------------------------------------
+ ffi.c - Copyright (C) 2009 Anthony Green
+
+ Moxie Foreign Function Interface
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+#include <ffi.h>
+#include <ffi_common.h>
+
+#include <stdlib.h>
+
+/* ffi_prep_args is called by the assembly routine once stack space
+ has been allocated for the function's arguments */
+
+void *ffi_prep_args(char *stack, extended_cif *ecif)
+{
+ register unsigned int i;
+ register void **p_argv;
+ register char *argp;
+ register ffi_type **p_arg;
+ register int count = 0;
+
+ p_argv = ecif->avalue;
+ argp = stack;
+
+ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
+ (i != 0);
+ i--, p_arg++)
+ {
+ size_t z;
+
+ z = (*p_arg)->size;
+
+ if ((*p_arg)->type == FFI_TYPE_STRUCT)
+ {
+ z = sizeof(void*);
+ *(void **) argp = *p_argv;
+ }
+ /* if ((*p_arg)->type == FFI_TYPE_FLOAT)
+ {
+ if (count > 24)
+ {
+ // This is going on the stack. Turn it into a double.
+ *(double *) argp = (double) *(float*)(* p_argv);
+ z = sizeof(double);
+ }
+ else
+ *(void **) argp = *(void **)(* p_argv);
+ } */
+ else if (z < sizeof(int))
+ {
+ z = sizeof(int);
+ switch ((*p_arg)->type)
+ {
+ case FFI_TYPE_SINT8:
+ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
+ break;
+
+ case FFI_TYPE_UINT8:
+ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
+ break;
+
+ case FFI_TYPE_SINT16:
+ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
+ break;
+
+ case FFI_TYPE_UINT16:
+ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
+ break;
+
+ default:
+ FFI_ASSERT(0);
+ }
+ }
+ else if (z == sizeof(int))
+ {
+ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
+ }
+ else
+ {
+ memcpy(argp, *p_argv, z);
+ }
+ p_argv++;
+ argp += z;
+ count += z;
+ }
+
+ return (stack + ((count > 24) ? 24 : ALIGN_DOWN(count, 8)));
+}
+
+/* Perform machine dependent cif processing */
+ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
+{
+ if (cif->rtype->type == FFI_TYPE_STRUCT)
+ cif->flags = -1;
+ else
+ cif->flags = cif->rtype->size;
+
+ cif->bytes = ALIGN (cif->bytes, 8);
+
+ return FFI_OK;
+}
+
+extern void ffi_call_EABI(void *(*)(char *, extended_cif *),
+ extended_cif *,
+ unsigned, unsigned,
+ unsigned *,
+ void (*fn)(void));
+
+void ffi_call(ffi_cif *cif,
+ void (*fn)(void),
+ void *rvalue,
+ void **avalue)
+{
+ extended_cif ecif;
+
+ ecif.cif = cif;
+ ecif.avalue = avalue;
+
+ /* If the return value is a struct and we don't have a return */
+ /* value address then we need to make one */
+
+ if ((rvalue == NULL) &&
+ (cif->rtype->type == FFI_TYPE_STRUCT))
+ {
+ ecif.rvalue = alloca(cif->rtype->size);
+ }
+ else
+ ecif.rvalue = rvalue;
+
+
+ switch (cif->abi)
+ {
+ case FFI_EABI:
+ ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes,
+ cif->flags, ecif.rvalue, fn);
+ break;
+ default:
+ FFI_ASSERT(0);
+ break;
+ }
+}
+
+void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
+ unsigned arg4, unsigned arg5, unsigned arg6)
+{
+ /* This function is called by a trampoline. The trampoline stows a
+ pointer to the ffi_closure object in gr7. We must save this
+ pointer in a place that will persist while we do our work. */
+ register ffi_closure *creg __asm__ ("gr7");
+ ffi_closure *closure = creg;
+
+ /* Arguments that don't fit in registers are found on the stack
+ at a fixed offset above the current frame pointer. */
+ register char *frame_pointer __asm__ ("fp");
+ char *stack_args = frame_pointer + 16;
+
+ /* Lay the register arguments down in a continuous chunk of memory. */
+ unsigned register_args[6] =
+ { arg1, arg2, arg3, arg4, arg5, arg6 };
+
+ ffi_cif *cif = closure->cif;
+ ffi_type **arg_types = cif->arg_types;
+ void **avalue = alloca (cif->nargs * sizeof(void *));
+ char *ptr = (char *) register_args;
+ int i;
+
+ /* Find the address of each argument. */
+ for (i = 0; i < cif->nargs; i++)
+ {
+ switch (arg_types[i]->type)
+ {
+ case FFI_TYPE_SINT8:
+ case FFI_TYPE_UINT8:
+ avalue[i] = ptr + 3;
+ break;
+ case FFI_TYPE_SINT16:
+ case FFI_TYPE_UINT16:
+ avalue[i] = ptr + 2;
+ break;
+ case FFI_TYPE_SINT32:
+ case FFI_TYPE_UINT32:
+ case FFI_TYPE_FLOAT:
+ avalue[i] = ptr;
+ break;
+ case FFI_TYPE_STRUCT:
+ avalue[i] = *(void**)ptr;
+ break;
+ default:
+ /* This is an 8-byte value. */
+ avalue[i] = ptr;
+ ptr += 4;
+ break;
+ }
+ ptr += 4;
+
+ /* If we've handled more arguments than fit in registers,
+ start looking at the those passed on the stack. */
+ if (ptr == ((char *)register_args + (6*4)))
+ ptr = stack_args;
+ }
+
+ /* Invoke the closure. */
+ if (cif->rtype->type == FFI_TYPE_STRUCT)
+ {
+ /* The caller allocates space for the return structure, and
+ passes a pointer to this space in gr3. Use this value directly
+ as the return value. */
+ register void *return_struct_ptr __asm__("gr3");
+ (closure->fun) (cif, return_struct_ptr, avalue, closure->user_data);
+ }
+ else
+ {
+ /* Allocate space for the return value and call the function. */
+ long long rvalue;
+ (closure->fun) (cif, &rvalue, avalue, closure->user_data);
+
+ /* Functions return 4-byte or smaller results in gr8. 8-byte
+ values also use gr9. We fill the both, even for small return
+ values, just to avoid a branch. */
+ asm ("ldi @(%0, #0), gr8" : : "r" (&rvalue));
+ asm ("ldi @(%0, #0), gr9" : : "r" (&((int *) &rvalue)[1]));
+ }
+}
+
+ffi_status
+ffi_prep_closure_loc (ffi_closure* closure,
+ ffi_cif* cif,
+ void (*fun)(ffi_cif*, void*, void**, void*),
+ void *user_data,
+ void *codeloc)
+{
+ unsigned int *tramp = (unsigned int *) &closure->tramp[0];
+ unsigned long fn = (long) ffi_closure_eabi;
+ unsigned long cls = (long) codeloc;
+ int i;
+
+ fn = (unsigned long) ffi_closure_eabi;
+
+ tramp[0] = 0x8cfc0000 + (fn & 0xffff); /* setlos lo(fn), gr6 */
+ tramp[1] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7 */
+ tramp[2] = 0x8cf80000 + (fn >> 16); /* sethi hi(fn), gr6 */
+ tramp[3] = 0x8ef80000 + (cls >> 16); /* sethi hi(cls), gr7 */
+ tramp[4] = 0x80300006; /* jmpl @(gr0, gr6) */
+
+ closure->cif = cif;
+ closure->fun = fun;
+ closure->user_data = user_data;
+
+ /* Cache flushing. */
+ for (i = 0; i < FFI_TRAMPOLINE_SIZE; i++)
+ __asm__ volatile ("dcf @(%0,%1)\n\tici @(%2,%1)" :: "r" (tramp), "r" (i),
+ "r" (codeloc));
+
+ return FFI_OK;
+}
diff --git a/Modules/_ctypes/libffi/src/moxie/ffitarget.h b/Modules/_ctypes/libffi/src/moxie/ffitarget.h
new file mode 100644
index 0000000000..f5305d1a5f
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/moxie/ffitarget.h
@@ -0,0 +1,56 @@
+/* -----------------------------------------------------------------*-C-*-
+ ffitarget.h - Copyright (c) 2009 Anthony Green
+ Target configuration macros for Moxie
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ ----------------------------------------------------------------------- */
+
+#ifndef LIBFFI_TARGET_H
+#define LIBFFI_TARGET_H
+
+/* ---- System specific configurations ----------------------------------- */
+
+#ifndef LIBFFI_ASM
+typedef unsigned long ffi_arg;
+typedef signed long ffi_sarg;
+
+typedef enum ffi_abi {
+ FFI_FIRST_ABI = 0,
+
+#ifdef MOXIE
+ FFI_EABI,
+ FFI_DEFAULT_ABI = FFI_EABI,
+#endif
+
+ FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+} ffi_abi;
+#endif
+
+/* ---- Definitions for closures ----------------------------------------- */
+
+#define FFI_CLOSURES 0
+#define FFI_NATIVE_RAW_API 0
+
+/* Trampolines are 5 4-byte instructions long. */
+#define FFI_TRAMPOLINE_SIZE (5*4)
+
+#endif
diff --git a/Modules/_ctypes/libffi/src/pa/ffi.c b/Modules/_ctypes/libffi/src/pa/ffi.c
index c7a14359a0..6d7606f89b 100644
--- a/Modules/_ctypes/libffi/src/pa/ffi.c
+++ b/Modules/_ctypes/libffi/src/pa/ffi.c
@@ -492,6 +492,13 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
avalue[i] = (void *)(stack - slot);
break;
+#ifdef PA_HPUX
+ case FFI_TYPE_LONGDOUBLE:
+ /* Long doubles are treated like a big structure. */
+ avalue[i] = (void *) *(stack - slot);
+ break;
+#endif
+
case FFI_TYPE_STRUCT:
/* Structs smaller or equal than 4 bytes are passed in one
register. Structs smaller or equal 8 bytes are passed in two
diff --git a/Modules/_ctypes/libffi/src/powerpc/aix.S b/Modules/_ctypes/libffi/src/powerpc/aix.S
index 45502f7963..c6f87644d9 100644
--- a/Modules/_ctypes/libffi/src/powerpc/aix.S
+++ b/Modules/_ctypes/libffi/src/powerpc/aix.S
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- aix.S - Copyright (c) 2002 Free Software Foundation, Inc.
+ aix.S - Copyright (c) 2002,2009 Free Software Foundation, Inc.
based on darwin.S by John Hornkvist
PowerPC Assembly glue.
@@ -86,9 +86,13 @@
#define L(x) x
.file "aix.S"
.toc
- .csect .text[PR]
- .align 2
-.globl ffi_prep_args
+
+ /* void ffi_call_AIX(extended_cif *ecif, unsigned long bytes,
+ * unsigned int flags, unsigned int *rvalue,
+ * void (*fn)(),
+ * void (*prep_args)(extended_cif*, unsigned *const));
+ * r3=ecif, r4=bytes, r5=flags, r6=rvalue, r7=fn, r8=prep_args
+ */
.csect .text[PR]
.align 2
@@ -96,61 +100,151 @@
.globl .ffi_call_AIX
.csect ffi_call_AIX[DS]
ffi_call_AIX:
- .long .ffi_call_AIX, TOC[tc0], 0
+#ifdef __64BIT__
+ .llong .ffi_call_AIX, TOC[tc0], 0
.csect .text[PR]
.ffi_call_AIX:
- mr r12,r8 // We only need r12 until the call, so it doesn't have to be saved...
- /* Save the old stack pointer as AP. */
- mr r8,r1
-
- /* Allocate the stack space we need. */
- stwux r1,r1,r4
-
/* Save registers we use. */
- mflr r9
+ mflr r0
- stw r28,-16(r8)
- stw r29,-12(r8)
- stw r30, -8(r8)
- stw r31, -4(r8)
+ std r28,-32(r1)
+ std r29,-24(r1)
+ std r30,-16(r1)
+ std r31, -8(r1)
- stw r9, 8(r8)
- stw r2, 20(r1)
+ std r0, 16(r1)
+ mr r28, r1 /* our AP. */
+ stdux r1, r1, r4
/* Save arguments over call... */
- mr r31,r5 /* flags, */
- mr r30,r6 /* rvalue, */
- mr r29,r7 /* function address, */
- mr r28,r8 /* our AP. */
+ mr r31, r5 /* flags, */
+ mr r30, r6 /* rvalue, */
+ mr r29, r7 /* function address. */
+ std r2, 40(r1)
/* Call ffi_prep_args. */
- mr r4,r1
- li r9,0
+ mr r4, r1
+ bl .ffi_prep_args
+
+ /* Now do the call. */
+ ld r0, 0(r29)
+ ld r2, 8(r29)
+ ld r11, 16(r29)
+ /* Set up cr1 with bits 4-7 of the flags. */
+ mtcrf 0x40, r31
+ mtctr r0
+ /* Load all those argument registers. */
+ // We have set up a nice stack frame, just load it into registers.
+ ld r3, 40+(1*8)(r1)
+ ld r4, 40+(2*8)(r1)
+ ld r5, 40+(3*8)(r1)
+ ld r6, 40+(4*8)(r1)
+ nop
+ ld r7, 40+(5*8)(r1)
+ ld r8, 40+(6*8)(r1)
+ ld r9, 40+(7*8)(r1)
+ ld r10,40+(8*8)(r1)
+
+L1:
+ /* Load all the FP registers. */
+ bf 6,L2 // 2f + 0x18
+ lfd f1,-32-(13*8)(r28)
+ lfd f2,-32-(12*8)(r28)
+ lfd f3,-32-(11*8)(r28)
+ lfd f4,-32-(10*8)(r28)
+ nop
+ lfd f5,-32-(9*8)(r28)
+ lfd f6,-32-(8*8)(r28)
+ lfd f7,-32-(7*8)(r28)
+ lfd f8,-32-(6*8)(r28)
+ nop
+ lfd f9,-32-(5*8)(r28)
+ lfd f10,-32-(4*8)(r28)
+ lfd f11,-32-(3*8)(r28)
+ lfd f12,-32-(2*8)(r28)
+ nop
+ lfd f13,-32-(1*8)(r28)
- lwz r2,4(r12)
- lwz r12,0(r12)
- mtctr r12 // r12 holds address of _ffi_prep_args
+L2:
+ /* Make the call. */
bctrl
- lwz r2,20(r1)
+ ld r2, 40(r1)
+
+ /* Now, deal with the return value. */
+ mtcrf 0x01, r31
+
+ bt 30, L(done_return_value)
+ bt 29, L(fp_return_value)
+ std r3, 0(r30)
+
+ /* Fall through... */
+
+L(done_return_value):
+ /* Restore the registers we used and return. */
+ mr r1, r28
+ ld r0, 16(r28)
+ ld r28, -32(r1)
+ mtlr r0
+ ld r29, -24(r1)
+ ld r30, -16(r1)
+ ld r31, -8(r1)
+ blr
+
+L(fp_return_value):
+ bf 28, L(float_return_value)
+ stfd f1, 0(r30)
+ bf 31, L(done_return_value)
+ stfd f2, 8(r30)
+ b L(done_return_value)
+L(float_return_value):
+ stfs f1, 0(r30)
+ b L(done_return_value)
+
+#else /* ! __64BIT__ */
+
+ .long .ffi_call_AIX, TOC[tc0], 0
+ .csect .text[PR]
+.ffi_call_AIX:
+ /* Save registers we use. */
+ mflr r0
+
+ stw r28,-16(r1)
+ stw r29,-12(r1)
+ stw r30, -8(r1)
+ stw r31, -4(r1)
+
+ stw r0, 8(r1)
+ mr r28, r1 /* out AP. */
+ stwux r1, r1, r4
+
+ /* Save arguments over call... */
+ mr r31, r5 /* flags, */
+ mr r30, r6 /* rvalue, */
+ mr r29, r7 /* function address, */
+ stw r2, 20(r1)
+
+ /* Call ffi_prep_args. */
+ mr r4, r1
+ bl .ffi_prep_args
/* Now do the call. */
- lwz r12,0(r29)
+ lwz r0, 0(r29)
+ lwz r2, 4(r29)
+ lwz r11, 8(r29)
/* Set up cr1 with bits 4-7 of the flags. */
- mtcrf 0x40,r31
- stw r2,20(r1)
- mtctr r12
- lwz r2,4(r29)
+ mtcrf 0x40, r31
+ mtctr r0
/* Load all those argument registers. */
// We have set up a nice stack frame, just load it into registers.
- lwz r3, 20+(1*4)(r1)
- lwz r4, 20+(2*4)(r1)
- lwz r5, 20+(3*4)(r1)
- lwz r6, 20+(4*4)(r1)
+ lwz r3, 20+(1*4)(r1)
+ lwz r4, 20+(2*4)(r1)
+ lwz r5, 20+(3*4)(r1)
+ lwz r6, 20+(4*4)(r1)
nop
- lwz r7, 20+(5*4)(r1)
- lwz r8, 20+(6*4)(r1)
- lwz r9, 20+(7*4)(r1)
- lwz r10,20+(8*4)(r1)
+ lwz r7, 20+(5*4)(r1)
+ lwz r8, 20+(6*4)(r1)
+ lwz r9, 20+(7*4)(r1)
+ lwz r10,20+(8*4)(r1)
L1:
/* Load all the FP registers. */
@@ -165,47 +259,48 @@ L1:
lfd f7,-16-(7*8)(r28)
lfd f8,-16-(6*8)(r28)
nop
- lfd f9,-16-(5*8)(r28)
- lfd f10,-16-(4*8)(r28)
- lfd f11,-16-(3*8)(r28)
- lfd f12,-16-(2*8)(r28)
+ lfd f9,-16-(5*8)(r28)
+ lfd f10,-16-(4*8)(r28)
+ lfd f11,-16-(3*8)(r28)
+ lfd f12,-16-(2*8)(r28)
nop
- lfd f13,-16-(1*8)(r28)
+ lfd f13,-16-(1*8)(r28)
L2:
/* Make the call. */
bctrl
- lwz r2,20(r1)
+ lwz r2, 20(r1)
/* Now, deal with the return value. */
- mtcrf 0x01,r31
+ mtcrf 0x01, r31
- bt 30,L(done_return_value)
- bt 29,L(fp_return_value)
- stw r3,0(r30)
- bf 28,L(done_return_value)
- stw r4,4(r30)
+ bt 30, L(done_return_value)
+ bt 29, L(fp_return_value)
+ stw r3, 0(r30)
+ bf 28, L(done_return_value)
+ stw r4, 4(r30)
/* Fall through... */
L(done_return_value):
/* Restore the registers we used and return. */
- lwz r9, 8(r28)
- lwz r31, -4(r28)
- mtlr r9
- lwz r30, -8(r28)
- lwz r29,-12(r28)
- lwz r28,-16(r28)
- lwz r1,0(r1)
+ mr r1, r28
+ lwz r0, 8(r28)
+ lwz r28,-16(r1)
+ mtlr r0
+ lwz r29,-12(r1)
+ lwz r30, -8(r1)
+ lwz r31, -4(r1)
blr
L(fp_return_value):
- bf 28,L(float_return_value)
- stfd f1,0(r30)
+ bf 28, L(float_return_value)
+ stfd f1, 0(r30)
b L(done_return_value)
L(float_return_value):
- stfs f1,0(r30)
+ stfs f1, 0(r30)
b L(done_return_value)
+#endif
.long 0
.byte 0,0,0,1,128,4,0,0
//END(ffi_call_AIX)
@@ -216,7 +311,11 @@ L(float_return_value):
.globl .ffi_call_DARWIN
.csect ffi_call_DARWIN[DS]
ffi_call_DARWIN:
+#ifdef __64BIT__
+ .llong .ffi_call_DARWIN, TOC[tc0], 0
+#else
.long .ffi_call_DARWIN, TOC[tc0], 0
+#endif
.csect .text[PR]
.ffi_call_DARWIN:
blr
diff --git a/Modules/_ctypes/libffi/src/powerpc/aix_closure.S b/Modules/_ctypes/libffi/src/powerpc/aix_closure.S
index 7bf5c65606..5c74448f2b 100644
--- a/Modules/_ctypes/libffi/src/powerpc/aix_closure.S
+++ b/Modules/_ctypes/libffi/src/powerpc/aix_closure.S
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- aix_closure.S - Copyright (c) 2002 2003 Free Software Foundation, Inc.
+ aix_closure.S - Copyright (c) 2002, 2003, 2009 Free Software Foundation, Inc.
based on darwin_closure.S
PowerPC Assembly glue.
@@ -94,65 +94,238 @@ LC..60:
.globl ffi_closure_ASM
.globl .ffi_closure_ASM
.csect ffi_closure_ASM[DS]
-
ffi_closure_ASM:
- .long .ffi_closure_ASM, TOC[tc0], 0
+#ifdef __64BIT__
+ .llong .ffi_closure_ASM, TOC[tc0], 0
.csect .text[PR]
.ffi_closure_ASM:
+/* we want to build up an area for the parameters passed */
+/* in registers (both floating point and integer) */
- mflr r0 /* extract return address */
- stw r0, 8(r1) /* save the return address */
-
- /* 24 Bytes (Linkage Area) */
- /* 32 Bytes (params) */
+ /* we store gpr 3 to gpr 10 (aligned to 4)
+ in the parents outgoing area */
+ std r3, 48+(0*8)(r1)
+ std r4, 48+(1*8)(r1)
+ std r5, 48+(2*8)(r1)
+ std r6, 48+(3*8)(r1)
+ mflr r0
+
+ std r7, 48+(4*8)(r1)
+ std r8, 48+(5*8)(r1)
+ std r9, 48+(6*8)(r1)
+ std r10, 48+(7*8)(r1)
+ std r0, 16(r1) /* save the return address */
+
+
+ /* 48 Bytes (Linkage Area) */
+ /* 64 Bytes (params) */
+ /* 16 Bytes (result) */
/* 104 Bytes (13*8 from FPR) */
- /* 8 Bytes (result) */
- /* 168 Bytes */
+ /* 8 Bytes (alignment) */
+ /* 240 Bytes */
+
+ stdu r1, -240(r1) /* skip over caller save area
+ keep stack aligned to 16 */
+
+ /* next save fpr 1 to fpr 13 (aligned to 8) */
+ stfd f1, 128+(0*8)(r1)
+ stfd f2, 128+(1*8)(r1)
+ stfd f3, 128+(2*8)(r1)
+ stfd f4, 128+(3*8)(r1)
+ stfd f5, 128+(4*8)(r1)
+ stfd f6, 128+(5*8)(r1)
+ stfd f7, 128+(6*8)(r1)
+ stfd f8, 128+(7*8)(r1)
+ stfd f9, 128+(8*8)(r1)
+ stfd f10, 128+(9*8)(r1)
+ stfd f11, 128+(10*8)(r1)
+ stfd f12, 128+(11*8)(r1)
+ stfd f13, 128+(12*8)(r1)
+
+ /* set up registers for the routine that actually does the work */
+ /* get the context pointer from the trampoline */
+ mr r3, r11
+
+ /* now load up the pointer to the result storage */
+ addi r4, r1, 112
+
+ /* now load up the pointer to the saved gpr registers */
+ addi r5, r1, 288
+
+ /* now load up the pointer to the saved fpr registers */
+ addi r6, r1, 128
+
+ /* make the call */
+ bl .ffi_closure_helper_DARWIN
+ nop
+
+ /* now r3 contains the return type */
+ /* so use it to look up in a table */
+ /* so we know how to deal with each type */
+
+ /* look up the proper starting point in table */
+ /* by using return type as offset */
+ ld r4, LC..60(2) /* get address of jump table */
+ sldi r3, r3, 4 /* now multiply return type by 16 */
+ ld r0, 240+16(r1) /* load return address */
+ add r3, r3, r4 /* add contents of table to table address */
+ mtctr r3
+ bctr /* jump to it */
+
+/* Each fragment must be exactly 16 bytes long (4 instructions).
+ Align to 16 byte boundary for cache and dispatch efficiency. */
+ .align 4
+
+L..60:
+/* case FFI_TYPE_VOID */
+ mtlr r0
+ addi r1, r1, 240
+ blr
+ nop
+
+/* case FFI_TYPE_INT */
+ lwa r3, 112+4(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
+
+/* case FFI_TYPE_FLOAT */
+ lfs f1, 112+0(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
- stwu r1,-176(r1) /* skip over caller save area
- keep stack aligned to 16 */
+/* case FFI_TYPE_DOUBLE */
+ lfd f1, 112+0(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
+
+/* case FFI_TYPE_LONGDOUBLE */
+ lfd f1, 112+0(r1)
+ mtlr r0
+ lfd f2, 112+8(r1)
+ b L..finish
+
+/* case FFI_TYPE_UINT8 */
+ lbz r3, 112+7(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
+
+/* case FFI_TYPE_SINT8 */
+ lbz r3, 112+7(r1)
+ mtlr r0
+ extsb r3, r3
+ b L..finish
+
+/* case FFI_TYPE_UINT16 */
+ lhz r3, 112+6(r1)
+ mtlr r0
+L..finish:
+ addi r1, r1, 240
+ blr
+/* case FFI_TYPE_SINT16 */
+ lha r3, 112+6(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
+
+/* case FFI_TYPE_UINT32 */
+ lwz r3, 112+4(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
+
+/* case FFI_TYPE_SINT32 */
+ lwa r3, 112+4(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
+
+/* case FFI_TYPE_UINT64 */
+ ld r3, 112+0(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
+
+/* case FFI_TYPE_SINT64 */
+ ld r3, 112+0(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
+
+/* case FFI_TYPE_STRUCT */
+ mtlr r0
+ addi r1, r1, 240
+ blr
+ nop
+
+/* case FFI_TYPE_POINTER */
+ ld r3, 112+0(r1)
+ mtlr r0
+ addi r1, r1, 240
+ blr
+
+#else /* ! __64BIT__ */
+
+ .long .ffi_closure_ASM, TOC[tc0], 0
+ .csect .text[PR]
+.ffi_closure_ASM:
/* we want to build up an area for the parameters passed */
/* in registers (both floating point and integer) */
/* we store gpr 3 to gpr 10 (aligned to 4)
in the parents outgoing area */
- stw r3, 200(r1)
- stw r4, 204(r1)
- stw r5, 208(r1)
- stw r6, 212(r1)
- stw r7, 216(r1)
- stw r8, 220(r1)
- stw r9, 224(r1)
- stw r10, 228(r1)
+ stw r3, 24+(0*4)(r1)
+ stw r4, 24+(1*4)(r1)
+ stw r5, 24+(2*4)(r1)
+ stw r6, 24+(3*4)(r1)
+ mflr r0
+
+ stw r7, 24+(4*4)(r1)
+ stw r8, 24+(5*4)(r1)
+ stw r9, 24+(6*4)(r1)
+ stw r10, 24+(7*4)(r1)
+ stw r0, 8(r1)
+
+ /* 24 Bytes (Linkage Area) */
+ /* 32 Bytes (params) */
+ /* 16 Bytes (result) */
+ /* 104 Bytes (13*8 from FPR) */
+ /* 176 Bytes */
+
+ stwu r1, -176(r1) /* skip over caller save area
+ keep stack aligned to 16 */
/* next save fpr 1 to fpr 13 (aligned to 8) */
- stfd f1, 56(r1)
- stfd f2, 64(r1)
- stfd f3, 72(r1)
- stfd f4, 80(r1)
- stfd f5, 88(r1)
- stfd f6, 96(r1)
- stfd f7, 104(r1)
- stfd f8, 112(r1)
- stfd f9, 120(r1)
- stfd f10, 128(r1)
- stfd f11, 136(r1)
- stfd f12, 144(r1)
- stfd f13, 152(r1)
+ stfd f1, 72+(0*8)(r1)
+ stfd f2, 72+(1*8)(r1)
+ stfd f3, 72+(2*8)(r1)
+ stfd f4, 72+(3*8)(r1)
+ stfd f5, 72+(4*8)(r1)
+ stfd f6, 72+(5*8)(r1)
+ stfd f7, 72+(6*8)(r1)
+ stfd f8, 72+(7*8)(r1)
+ stfd f9, 72+(8*8)(r1)
+ stfd f10, 72+(9*8)(r1)
+ stfd f11, 72+(10*8)(r1)
+ stfd f12, 72+(11*8)(r1)
+ stfd f13, 72+(12*8)(r1)
/* set up registers for the routine that actually does the work */
/* get the context pointer from the trampoline */
- mr r3,r11
+ mr r3, r11
/* now load up the pointer to the result storage */
- addi r4,r1,160
+ addi r4, r1, 56
/* now load up the pointer to the saved gpr registers */
- addi r5,r1,200
+ addi r5, r1, 200
/* now load up the pointer to the saved fpr registers */
- addi r6,r1,56
+ addi r6, r1, 72
/* make the call */
bl .ffi_closure_helper_DARWIN
@@ -164,84 +337,107 @@ ffi_closure_ASM:
/* look up the proper starting point in table */
/* by using return type as offset */
- addi r5,r1,160 /* get pointer to results area */
- lwz r4,LC..60(2) /* get address of jump table */
- slwi r3,r3,2 /* now multiply return type by 4 */
- lwzx r3,r4,r3 /* get the contents of that table value */
- add r3,r3,r4 /* add contents of table to table address */
- mtctr r3
+ lwz r4, LC..60(2) /* get address of jump table */
+ slwi r3, r3, 4 /* now multiply return type by 4 */
+ lwz r0, 176+8(r1) /* load return address */
+ add r3, r3, r4 /* add contents of table to table address */
+ mtctr r3
bctr /* jump to it */
+/* Each fragment must be exactly 16 bytes long (4 instructions).
+ Align to 16 byte boundary for cache and dispatch efficiency. */
+ .align 4
+
L..60:
- .long L..44-L..60 /* FFI_TYPE_VOID */
- .long L..50-L..60 /* FFI_TYPE_INT */
- .long L..47-L..60 /* FFI_TYPE_FLOAT */
- .long L..46-L..60 /* FFI_TYPE_DOUBLE */
- .long L..46-L..60 /* FFI_TYPE_LONGDOUBLE */
- .long L..56-L..60 /* FFI_TYPE_UINT8 */
- .long L..55-L..60 /* FFI_TYPE_SINT8 */
- .long L..58-L..60 /* FFI_TYPE_UINT16 */
- .long L..57-L..60 /* FFI_TYPE_SINT16 */
- .long L..50-L..60 /* FFI_TYPE_UINT32 */
- .long L..50-L..60 /* FFI_TYPE_SINT32 */
- .long L..48-L..60 /* FFI_TYPE_UINT64 */
- .long L..48-L..60 /* FFI_TYPE_SINT64 */
- .long L..44-L..60 /* FFI_TYPE_STRUCT */
- .long L..50-L..60 /* FFI_TYPE_POINTER */
-
-
-/* case double */
-L..46:
- lfd f1,0(r5)
- b L..44
-
-/* case float */
-L..47:
- lfs f1,0(r5)
- b L..44
-
-/* case long long */
-L..48:
- lwz r3,0(r5)
- lwz r4,4(r5)
- b L..44
-
-/* case default / int32 / pointer */
-L..50:
- lwz r3,0(r5)
- b L..44
-
-/* case signed int8 */
-L..55:
- addi r5,r5,3
- lbz r3,0(r5)
- slwi r3,r3,24
- srawi r3,r3,24
- b L..44
-
-/* case unsigned int8 */
-L..56:
- addi r5,r5,3
- lbz r3,0(r5)
- b L..44
-
-/* case signed int16 */
-L..57:
- addi r5,r5,2
- lhz r3,0(r5)
- extsh r3,r3
- b L..44
-
-/* case unsigned int16 */
-L..58:
- addi r5,r5,2
- lhz r3,0(r5)
-
-/* case void / done */
-L..44:
- addi r1,r1,176 /* restore stack pointer */
- lwz r0,8(r1) /* get return address */
- mtlr r0 /* reset link register */
+/* case FFI_TYPE_VOID */
+ mtlr r0
+ addi r1, r1, 176
blr
+ nop
+
+/* case FFI_TYPE_INT */
+ lwz r3, 56+0(r1)
+ mtlr r0
+ addi r1, r1, 176
+ blr
+
+/* case FFI_TYPE_FLOAT */
+ lfs f1, 56+0(r1)
+ mtlr r0
+ addi r1, r1, 176
+ blr
+
+/* case FFI_TYPE_DOUBLE */
+ lfd f1, 56+0(r1)
+ mtlr r0
+ addi r1, r1, 176
+ blr
+
+/* case FFI_TYPE_LONGDOUBLE */
+ lfd f1, 56+0(r1)
+ mtlr r0
+ lfd f2, 56+8(r1)
+ b L..finish
+
+/* case FFI_TYPE_UINT8 */
+ lbz r3, 56+3(r1)
+ mtlr r0
+ addi r1, r1, 176
+ blr
+
+/* case FFI_TYPE_SINT8 */
+ lbz r3, 56+3(r1)
+ mtlr r0
+ extsb r3, r3
+ b L..finish
+/* case FFI_TYPE_UINT16 */
+ lhz r3, 56+2(r1)
+ mtlr r0
+ addi r1, r1, 176
+ blr
+
+/* case FFI_TYPE_SINT16 */
+ lha r3, 56+2(r1)
+ mtlr r0
+ addi r1, r1, 176
+ blr
+
+/* case FFI_TYPE_UINT32 */
+ lwz r3, 56+0(r1)
+ mtlr r0
+ addi r1, r1, 176
+ blr
+
+/* case FFI_TYPE_SINT32 */
+ lwz r3, 56+0(r1)
+ mtlr r0
+ addi r1, r1, 176
+ blr
+
+/* case FFI_TYPE_UINT64 */
+ lwz r3, 56+0(r1)
+ mtlr r0
+ lwz r4, 56+4(r1)
+ b L..finish
+
+/* case FFI_TYPE_SINT64 */
+ lwz r3, 56+0(r1)
+ mtlr r0
+ lwz r4, 56+4(r1)
+ b L..finish
+
+/* case FFI_TYPE_STRUCT */
+ mtlr r0
+ addi r1, r1, 176
+ blr
+ nop
+
+/* case FFI_TYPE_POINTER */
+ lwz r3, 56+0(r1)
+ mtlr r0
+L..finish:
+ addi r1, r1, 176
+ blr
+#endif
/* END(ffi_closure_ASM) */
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi.c b/Modules/_ctypes/libffi/src/powerpc/ffi.c
index c2d253089e..75784a96d3 100644
--- a/Modules/_ctypes/libffi/src/powerpc/ffi.c
+++ b/Modules/_ctypes/libffi/src/powerpc/ffi.c
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
ffi.c - Copyright (c) 1998 Geoffrey Keating
- Copyright (C) 2007 Free Software Foundation, Inc
+ Copyright (C) 2007, 2008 Free Software Foundation, Inc
Copyright (C) 2008 Red Hat, Inc
PowerPC Foreign Function Interface
@@ -43,6 +43,11 @@ enum {
FLAG_RETURNS_64BITS = 1 << (31-28),
FLAG_RETURNS_128BITS = 1 << (31-27), /* cr6 */
+ FLAG_SYSV_SMST_R4 = 1 << (31-26), /* use r4 for FFI_SYSV 8 byte
+ structs. */
+ FLAG_SYSV_SMST_R3 = 1 << (31-25), /* use r3 for FFI_SYSV 4 byte
+ structs. */
+ /* Bits (31-24) through (31-19) store shift value for SMST */
FLAG_ARG_NEEDS_COPY = 1 << (31- 7),
FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
@@ -180,6 +185,7 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
{
*next_arg.f = (float) double_tmp;
next_arg.u += 1;
+ intarg_count++;
}
else
*fpr_base.d++ = double_tmp;
@@ -680,15 +686,15 @@ ffi_prep_cif_machdep (ffi_cif *cif)
The same applies for the structs returned in r3/r4. */
if (size <= 4)
{
- flags |= 1 << (31 - FFI_SYSV_TYPE_SMALL_STRUCT - 1);
- flags |= 8 * (4 - size) << 4;
+ flags |= FLAG_SYSV_SMST_R3;
+ flags |= 8 * (4 - size) << 8;
break;
}
/* These structs are returned in r3 and r4. See above. */
if (size <= 8)
{
- flags |= 1 << (31 - FFI_SYSV_TYPE_SMALL_STRUCT - 2);
- flags |= 8 * (8 - size) << 4;
+ flags |= FLAG_SYSV_SMST_R3 | FLAG_SYSV_SMST_R4;
+ flags |= 8 * (8 - size) << 8;
break;
}
}
@@ -1144,6 +1150,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
pst++;
avalue[i] = pst;
pst += 2;
+ ng = 8;
}
break;
@@ -1217,6 +1224,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
{
avalue[i] = pst;
pst += 4;
+ ng = 8;
}
break;
}
@@ -1249,10 +1257,15 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
/* Tell ffi_closure_SYSV how to perform return type promotions.
Because the FFI_SYSV ABI returns the structures <= 8 bytes in r3/r4
- we have to tell ffi_closure_SYSV how to treat them. */
+ we have to tell ffi_closure_SYSV how to treat them. We combine the base
+ type FFI_SYSV_TYPE_SMALL_STRUCT - 1 with the size of the struct.
+ So a one byte struct gets the return type 16. Return type 1 to 15 are
+ already used and we never have a struct with size zero. That is the reason
+ for the subtraction of 1. See the comment in ffitarget.h about ordering.
+ */
if (cif->abi == FFI_SYSV && cif->rtype->type == FFI_TYPE_STRUCT
&& size <= 8)
- return FFI_SYSV_TYPE_SMALL_STRUCT + size;
+ return (FFI_SYSV_TYPE_SMALL_STRUCT - 1) + size;
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
else if (cif->rtype->type == FFI_TYPE_LONGDOUBLE
&& cif->abi != FFI_LINUX && cif->abi != FFI_LINUX_SOFT_FLOAT)
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c b/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
index 501035d75d..d84f1c393a 100644
--- a/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
+++ b/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
@@ -3,7 +3,7 @@
Copyright (C) 1998 Geoffrey Keating
Copyright (C) 2001 John Hornkvist
- Copyright (C) 2002, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006, 2007, 2009 Free Software Foundation, Inc.
FFI support for Darwin and AIX.
@@ -32,7 +32,7 @@
#include <stdlib.h>
-extern void ffi_closure_ASM(void);
+extern void ffi_closure_ASM (void);
enum {
/* The assembly depends on these exact flags. */
@@ -80,34 +80,37 @@ enum { ASM_NEEDS_REGISTERS = 4 };
*/
-void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
+void
+ffi_prep_args (extended_cif *ecif, unsigned long *const stack)
{
const unsigned bytes = ecif->cif->bytes;
const unsigned flags = ecif->cif->flags;
+ const unsigned nargs = ecif->cif->nargs;
+ const ffi_abi abi = ecif->cif->abi;
/* 'stacktop' points at the previous backchain pointer. */
- unsigned *const stacktop = stack + (bytes / sizeof(unsigned));
+ unsigned long *const stacktop = stack + (bytes / sizeof(unsigned long));
/* 'fpr_base' points at the space for fpr1, and grows upwards as
we use FPR registers. */
- double *fpr_base = (double*) (stacktop - ASM_NEEDS_REGISTERS) - NUM_FPR_ARG_REGISTERS;
+ double *fpr_base = (double *) (stacktop - ASM_NEEDS_REGISTERS) - NUM_FPR_ARG_REGISTERS;
int fparg_count = 0;
/* 'next_arg' grows up as we put parameters in it. */
- unsigned *next_arg = stack + 6; /* 6 reserved positions. */
+ unsigned long *next_arg = stack + 6; /* 6 reserved positions. */
- int i = ecif->cif->nargs;
+ int i;
double double_tmp;
void **p_argv = ecif->avalue;
- unsigned gprvalue;
+ unsigned long gprvalue;
ffi_type** ptr = ecif->cif->arg_types;
char *dest_cpy;
unsigned size_al = 0;
/* Check that everything starts aligned properly. */
- FFI_ASSERT(((unsigned)(char *)stack & 0xF) == 0);
- FFI_ASSERT(((unsigned)(char *)stacktop & 0xF) == 0);
+ FFI_ASSERT(((unsigned) (char *) stack & 0xF) == 0);
+ FFI_ASSERT(((unsigned) (char *) stacktop & 0xF) == 0);
FFI_ASSERT((bytes & 0xF) == 0);
/* Deal with return values that are actually pass-by-reference.
@@ -115,12 +118,10 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
Return values are referenced by r3, so r4 is the first parameter. */
if (flags & FLAG_RETVAL_REFERENCE)
- *next_arg++ = (unsigned)(char *)ecif->rvalue;
+ *next_arg++ = (unsigned long) (char *) ecif->rvalue;
/* Now for the arguments. */
- for (;
- i > 0;
- i--, ptr++, p_argv++)
+ for (i = nargs; i > 0; i--, ptr++, p_argv++)
{
switch ((*ptr)->type)
{
@@ -128,7 +129,7 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
purpose registers are filled, the corresponding GPRs that match
the size of the floating-point parameter are skipped. */
case FFI_TYPE_FLOAT:
- double_tmp = *(float *)*p_argv;
+ double_tmp = *(float *) *p_argv;
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
*(double *)next_arg = double_tmp;
else
@@ -139,12 +140,16 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
break;
case FFI_TYPE_DOUBLE:
- double_tmp = *(double *)*p_argv;
+ double_tmp = *(double *) *p_argv;
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
*(double *)next_arg = double_tmp;
else
*fpr_base++ = double_tmp;
+#ifdef POWERPC64
+ next_arg++;
+#else
next_arg += 2;
+#endif
fparg_count++;
FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
break;
@@ -152,42 +157,71 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
case FFI_TYPE_LONGDOUBLE:
- double_tmp = ((double *)*p_argv)[0];
- if (fparg_count >= NUM_FPR_ARG_REGISTERS)
- *(double *)next_arg = double_tmp;
+#ifdef POWERPC64
+ if (fparg_count < NUM_FPR_ARG_REGISTERS)
+ *(long double *) fpr_base++ = *(long double *) *p_argv;
else
+ *(long double *) next_arg = *(long double *) *p_argv;
+ next_arg += 2;
+ fparg_count += 2;
+#else
+ double_tmp = ((double *) *p_argv)[0];
+ if (fparg_count < NUM_FPR_ARG_REGISTERS)
*fpr_base++ = double_tmp;
+ else
+ *(double *) next_arg = double_tmp;
next_arg += 2;
fparg_count++;
- double_tmp = ((double *)*p_argv)[1];
- if (fparg_count >= NUM_FPR_ARG_REGISTERS)
- *(double *)next_arg = double_tmp;
- else
+
+ double_tmp = ((double *) *p_argv)[1];
+ if (fparg_count < NUM_FPR_ARG_REGISTERS)
*fpr_base++ = double_tmp;
+ else
+ *(double *) next_arg = double_tmp;
next_arg += 2;
fparg_count++;
+#endif
FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
break;
#endif
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
- *(long long *)next_arg = *(long long *)*p_argv;
- next_arg+=2;
+#ifdef POWERPC64
+ gprvalue = *(long long *) *p_argv;
+ goto putgpr;
+#else
+ *(long long *) next_arg = *(long long *) *p_argv;
+ next_arg += 2;
+#endif
break;
+ case FFI_TYPE_POINTER:
+ gprvalue = *(unsigned long *) *p_argv;
+ goto putgpr;
case FFI_TYPE_UINT8:
- gprvalue = *(unsigned char *)*p_argv;
+ gprvalue = *(unsigned char *) *p_argv;
goto putgpr;
case FFI_TYPE_SINT8:
- gprvalue = *(signed char *)*p_argv;
+ gprvalue = *(signed char *) *p_argv;
goto putgpr;
case FFI_TYPE_UINT16:
- gprvalue = *(unsigned short *)*p_argv;
+ gprvalue = *(unsigned short *) *p_argv;
goto putgpr;
case FFI_TYPE_SINT16:
- gprvalue = *(signed short *)*p_argv;
+ gprvalue = *(signed short *) *p_argv;
goto putgpr;
case FFI_TYPE_STRUCT:
+#ifdef POWERPC64
+ dest_cpy = (char *) next_arg;
+ size_al = (*ptr)->size;
+ if ((*ptr)->elements[0]->type == 3)
+ size_al = ALIGN((*ptr)->size, 8);
+ if (size_al < 3 && abi == FFI_DARWIN)
+ dest_cpy += 4 - size_al;
+
+ memcpy ((char *) dest_cpy, (char *) *p_argv, size_al);
+ next_arg += (size_al + 7) / 8;
+#else
dest_cpy = (char *) next_arg;
/* Structures that match the basic modes (QI 1 byte, HI 2 bytes,
@@ -195,22 +229,24 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
Structures with 3 byte in size are padded upwards. */
size_al = (*ptr)->size;
/* If the first member of the struct is a double, then align
- the struct to double-word.
- Type 3 is defined in include/ffi.h. #define FFI_TYPE_DOUBLE 3. */
- if ((*ptr)->elements[0]->type == 3)
+ the struct to double-word. */
+ if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE)
size_al = ALIGN((*ptr)->size, 8);
- if (size_al < 3 && ecif->cif->abi == FFI_DARWIN)
+ if (size_al < 3 && abi == FFI_DARWIN)
dest_cpy += 4 - size_al;
- memcpy((char *)dest_cpy, (char *)*p_argv, size_al);
+ memcpy((char *) dest_cpy, (char *) *p_argv, size_al);
next_arg += (size_al + 3) / 4;
+#endif
break;
case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
case FFI_TYPE_SINT32:
- case FFI_TYPE_POINTER:
- gprvalue = *(unsigned *)*p_argv;
+ gprvalue = *(signed int *) *p_argv;
+ goto putgpr;
+
+ case FFI_TYPE_UINT32:
+ gprvalue = *(unsigned int *) *p_argv;
putgpr:
*next_arg++ = gprvalue;
break;
@@ -268,8 +304,44 @@ darwin_adjust_aggregate_sizes (ffi_type *s)
/* Do not add additional tail padding. */
}
+/* Adjust the size of S to be correct for AIX.
+ Word-align double unless it is the first member of a structure. */
+
+static void
+aix_adjust_aggregate_sizes (ffi_type *s)
+{
+ int i;
+
+ if (s->type != FFI_TYPE_STRUCT)
+ return;
+
+ s->size = 0;
+ for (i = 0; s->elements[i] != NULL; i++)
+ {
+ ffi_type *p;
+ int align;
+
+ p = s->elements[i];
+ aix_adjust_aggregate_sizes (p);
+ align = p->alignment;
+ if (i != 0 && p->type == FFI_TYPE_DOUBLE)
+ align = 4;
+ s->size = ALIGN(s->size, align) + p->size;
+ }
+
+ s->size = ALIGN(s->size, s->alignment);
+
+ if (s->elements[0]->type == FFI_TYPE_UINT64
+ || s->elements[0]->type == FFI_TYPE_SINT64
+ || s->elements[0]->type == FFI_TYPE_DOUBLE
+ || s->elements[0]->alignment == 8)
+ s->alignment = s->alignment > 8 ? s->alignment : 8;
+ /* Do not add additional tail padding. */
+}
+
/* Perform machine dependent cif processing. */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
+ffi_status
+ffi_prep_cif_machdep (ffi_cif *cif)
{
/* All this is for the DARWIN ABI. */
int i;
@@ -290,6 +362,13 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
darwin_adjust_aggregate_sizes (cif->arg_types[i]);
}
+ if (cif->abi == FFI_AIX)
+ {
+ aix_adjust_aggregate_sizes (cif->rtype);
+ for (i = 0; i < cif->nargs; i++)
+ aix_adjust_aggregate_sizes (cif->arg_types[i]);
+ }
+
/* Space for the frame pointer, callee's LR, CR, etc, and for
the asm's temp regs. */
@@ -324,6 +403,9 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
+#ifdef POWERPC64
+ case FFI_TYPE_POINTER:
+#endif
flags |= FLAG_RETURNS_64BITS;
break;
@@ -387,11 +469,14 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
case FFI_TYPE_STRUCT:
size_al = (*ptr)->size;
/* If the first member of the struct is a double, then align
- the struct to double-word.
- Type 3 is defined in include/ffi.h. #define FFI_TYPE_DOUBLE 3. */
- if ((*ptr)->elements[0]->type == 3)
+ the struct to double-word. */
+ if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE)
size_al = ALIGN((*ptr)->size, 8);
+#ifdef POWERPC64
+ intarg_count += (size_al + 7) / 8;
+#else
intarg_count += (size_al + 3) / 4;
+#endif
break;
default:
@@ -410,8 +495,13 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
bytes += NUM_FPR_ARG_REGISTERS * sizeof(double);
/* Stack space. */
+#ifdef POWERPC64
+ if ((intarg_count + fparg_count) > NUM_GPR_ARG_REGISTERS)
+ bytes += (intarg_count + fparg_count) * sizeof(long);
+#else
if ((intarg_count + 2 * fparg_count) > NUM_GPR_ARG_REGISTERS)
bytes += (intarg_count + 2 * fparg_count) * sizeof(long);
+#endif
else
bytes += NUM_GPR_ARG_REGISTERS * sizeof(long);
@@ -424,12 +514,13 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
return FFI_OK;
}
-extern void ffi_call_AIX(extended_cif *, unsigned, unsigned, unsigned *,
+extern void ffi_call_AIX(extended_cif *, long, unsigned, unsigned *,
void (*fn)(void), void (*fn2)(void));
-extern void ffi_call_DARWIN(extended_cif *, unsigned, unsigned, unsigned *,
+extern void ffi_call_DARWIN(extended_cif *, long, unsigned, unsigned *,
void (*fn)(void), void (*fn2)(void));
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
+void
+ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{
extended_cif ecif;
@@ -442,7 +533,7 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
if ((rvalue == NULL) &&
(cif->rtype->type == FFI_TYPE_STRUCT))
{
- ecif.rvalue = alloca(cif->rtype->size);
+ ecif.rvalue = alloca (cif->rtype->size);
}
else
ecif.rvalue = rvalue;
@@ -450,11 +541,11 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
switch (cif->abi)
{
case FFI_AIX:
- ffi_call_AIX(&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn,
+ ffi_call_AIX(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn,
ffi_prep_args);
break;
case FFI_DARWIN:
- ffi_call_DARWIN(&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn,
+ ffi_call_DARWIN(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn,
ffi_prep_args);
break;
default:
@@ -617,8 +708,9 @@ typedef union
double d;
} ffi_dblfl;
-int ffi_closure_helper_DARWIN (ffi_closure*, void*,
- unsigned long*, ffi_dblfl*);
+int
+ffi_closure_helper_DARWIN (ffi_closure *, void *,
+ unsigned long *, ffi_dblfl *);
/* Basically the trampoline invokes ffi_closure_ASM, and on
entry, r11 holds the address of the closure.
@@ -627,8 +719,9 @@ int ffi_closure_helper_DARWIN (ffi_closure*, void*,
up space for a return value, ffi_closure_ASM invokes the
following helper function to do most of the work. */
-int ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
- unsigned long * pgr, ffi_dblfl * pfr)
+int
+ffi_closure_helper_DARWIN (ffi_closure *closure, void *rvalue,
+ unsigned long *pgr, ffi_dblfl *pfr)
{
/* rvalue is the pointer to space for return value in closure assembly
pgr is the pointer to where r3-r10 are stored in ffi_closure_ASM
@@ -645,18 +738,12 @@ int ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
void ** avalue;
ffi_type ** arg_types;
long i, avn;
- long nf; /* number of floating registers already used. */
- long ng; /* number of general registers already used. */
ffi_cif * cif;
- double temp;
+ ffi_dblfl * end_pfr = pfr + NUM_FPR_ARG_REGISTERS;
unsigned size_al;
- union ldu temp_ld;
cif = closure->cif;
- avalue = alloca(cif->nargs * sizeof(void *));
-
- nf = 0;
- ng = 0;
+ avalue = alloca (cif->nargs * sizeof(void *));
/* Copy the caller's structure return value address so that the closure
returns the data directly to the caller. */
@@ -664,7 +751,6 @@ int ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
{
rvalue = (void *) *pgr;
pgr++;
- ng++;
}
i = 0;
@@ -678,58 +764,82 @@ int ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
{
case FFI_TYPE_SINT8:
case FFI_TYPE_UINT8:
+#ifdef POWERPC64
+ avalue[i] = (char *) pgr + 7;
+#else
avalue[i] = (char *) pgr + 3;
- ng++;
+#endif
pgr++;
break;
case FFI_TYPE_SINT16:
case FFI_TYPE_UINT16:
+#ifdef POWERPC64
+ avalue[i] = (char *) pgr + 6;
+#else
avalue[i] = (char *) pgr + 2;
- ng++;
+#endif
pgr++;
break;
case FFI_TYPE_SINT32:
case FFI_TYPE_UINT32:
+#ifdef POWERPC64
+ avalue[i] = (char *) pgr + 4;
+#else
case FFI_TYPE_POINTER:
avalue[i] = pgr;
- ng++;
+#endif
pgr++;
break;
case FFI_TYPE_STRUCT:
+#ifdef POWERPC64
+ size_al = arg_types[i]->size;
+ if (arg_types[i]->elements[0]->type == FFI_TYPE_DOUBLE)
+ size_al = ALIGN (arg_types[i]->size, 8);
+ if (size_al < 3 && cif->abi == FFI_DARWIN)
+ avalue[i] = (void *) pgr + 8 - size_al;
+ else
+ avalue[i] = (void *) pgr;
+ pgr += (size_al + 7) / 8;
+#else
/* Structures that match the basic modes (QI 1 byte, HI 2 bytes,
SI 4 bytes) are aligned as if they were those modes. */
size_al = arg_types[i]->size;
/* If the first member of the struct is a double, then align
- the struct to double-word.
- Type 3 is defined in include/ffi.h. #define FFI_TYPE_DOUBLE 3. */
- if (arg_types[i]->elements[0]->type == 3)
+ the struct to double-word. */
+ if (arg_types[i]->elements[0]->type == FFI_TYPE_DOUBLE)
size_al = ALIGN(arg_types[i]->size, 8);
if (size_al < 3 && cif->abi == FFI_DARWIN)
avalue[i] = (void*) pgr + 4 - size_al;
else
avalue[i] = (void*) pgr;
- ng += (size_al + 3) / 4;
pgr += (size_al + 3) / 4;
+#endif
break;
case FFI_TYPE_SINT64:
case FFI_TYPE_UINT64:
+#ifdef POWERPC64
+ case FFI_TYPE_POINTER:
+ avalue[i] = pgr;
+ pgr++;
+ break;
+#else
/* Long long ints are passed in two gpr's. */
avalue[i] = pgr;
- ng += 2;
pgr += 2;
break;
+#endif
case FFI_TYPE_FLOAT:
/* A float value consumes a GPR.
There are 13 64bit floating point registers. */
- if (nf < NUM_FPR_ARG_REGISTERS)
+ if (pfr < end_pfr)
{
- temp = pfr->d;
- pfr->f = (float)temp;
+ double temp = pfr->d;
+ pfr->f = (float) temp;
avalue[i] = pfr;
pfr++;
}
@@ -737,15 +847,13 @@ int ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
{
avalue[i] = pgr;
}
- nf++;
- ng++;
pgr++;
break;
case FFI_TYPE_DOUBLE:
/* A double value consumes two GPRs.
There are 13 64bit floating point registers. */
- if (nf < NUM_FPR_ARG_REGISTERS)
+ if (pfr < end_pfr)
{
avalue[i] = pfr;
pfr++;
@@ -754,17 +862,36 @@ int ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
{
avalue[i] = pgr;
}
- nf++;
- ng += 2;
+#ifdef POWERPC64
+ pgr++;
+#else
pgr += 2;
+#endif
break;
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
case FFI_TYPE_LONGDOUBLE:
+#ifdef POWERPC64
+ if (pfr + 1 < end_pfr)
+ {
+ avalue[i] = pfr;
+ pfr += 2;
+ }
+ else
+ {
+ if (pfr < end_pfr)
+ {
+ *pgr = *(unsigned long *) pfr;
+ pfr++;
+ }
+ avalue[i] = pgr;
+ }
+ pgr += 2;
+#else /* POWERPC64 */
/* A long double value consumes four GPRs and two FPRs.
There are 13 64bit floating point registers. */
- if (nf < NUM_FPR_ARG_REGISTERS - 1)
+ if (pfr + 1 < end_pfr)
{
avalue[i] = pfr;
pfr += 2;
@@ -772,19 +899,20 @@ int ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
/* Here we have the situation where one part of the long double
is stored in fpr13 and the other part is already on the stack.
We use a union to pass the long double to avalue[i]. */
- else if (nf == NUM_FPR_ARG_REGISTERS - 1)
+ else if (pfr + 1 == end_pfr)
{
+ union ldu temp_ld;
memcpy (&temp_ld.lb[0], pfr, sizeof(ldbits));
memcpy (&temp_ld.lb[1], pgr + 2, sizeof(ldbits));
avalue[i] = &temp_ld.ld;
+ pfr++;
}
else
{
avalue[i] = pgr;
}
- nf += 2;
- ng += 4;
pgr += 4;
+#endif /* POWERPC64 */
break;
#endif
default:
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffitarget.h b/Modules/_ctypes/libffi/src/powerpc/ffitarget.h
index f499ac36c1..b4f992e6df 100644
--- a/Modules/_ctypes/libffi/src/powerpc/ffitarget.h
+++ b/Modules/_ctypes/libffi/src/powerpc/ffitarget.h
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------*-C-*-
ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc.
- Copyright (C) 2007 Free Software Foundation, Inc
+ Copyright (C) 2007, 2008 Free Software Foundation, Inc
Target configuration macros for PowerPC.
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,7 +30,11 @@
/* ---- System specific configurations ----------------------------------- */
-#if defined (POWERPC) && defined (__powerpc64__)
+#if defined (POWERPC) && defined (__powerpc64__) /* linux64 */
+#define POWERPC64
+#elif defined (POWERPC_DARWIN) && defined (__ppc64__) /* Darwin */
+#define POWERPC64
+#elif defined (POWERPC_AIX) && defined (__64BIT__) /* AIX64 */
#define POWERPC64
#endif
@@ -78,6 +82,8 @@ typedef enum ffi_abi {
FFI_SYSV,
FFI_GCC_SYSV,
FFI_LINUX64,
+ FFI_LINUX,
+ FFI_LINUX_SOFT_FLOAT,
FFI_DEFAULT_ABI = FFI_SYSV,
#endif
@@ -96,7 +102,9 @@ typedef enum ffi_abi {
/* Needed for soft-float long-double-128 support. */
#define FFI_TYPE_UINT128 (FFI_TYPE_LAST + 1)
-/* Needed for FFI_SYSV small structure returns. */
+/* Needed for FFI_SYSV small structure returns.
+ We use two flag bits, (FLAG_SYSV_SMST_R3, FLAG_SYSV_SMST_R4) which are
+ defined in ffi.c, to determine the exact return type and its size. */
#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 2)
#if defined(POWERPC64) || defined(POWERPC_AIX)
diff --git a/Modules/_ctypes/libffi/src/powerpc/sysv.S b/Modules/_ctypes/libffi/src/powerpc/sysv.S
index c06311fd59..96ea22b0b4 100644
--- a/Modules/_ctypes/libffi/src/powerpc/sysv.S
+++ b/Modules/_ctypes/libffi/src/powerpc/sysv.S
@@ -136,29 +136,18 @@ L(float_return_value):
b L(done_return_value)
L(small_struct_return_value):
- mtcrf 0x10,%r31 /* cr3 */
- bt- 15,L(smst_one_register)
- mtcrf 0x08,%r31 /* cr4 */
- bt- 16,L(smst_two_register)
- b L(done_return_value)
-
-L(smst_one_register):
- rlwinm %r5,%r31,5+23,32-5,31 /* Extract the value to shift. */
- slw %r3,%r3,%r5
- stw %r3,0(%r30)
- b L(done_return_value)
-L(smst_two_register):
- rlwinm %r5,%r31,5+23,32-5,31 /* Extract the value to shift. */
- cmpwi %r5,0
- subfic %r9,%r5,32
- slw %r29,%r3,%r5
- srw %r9,%r4,%r9
- beq- L(smst_8byte)
- or %r3,%r9,%r29
- slw %r4,%r4,%r5
-L(smst_8byte):
- stw %r3,0(%r30)
- stw %r4,4(%r30)
+ extrwi %r6,%r31,2,19 /* number of bytes padding = shift/8 */
+ mtcrf 0x02,%r31 /* copy flags to cr[24:27] (cr6) */
+ extrwi %r5,%r31,5,19 /* r5 <- number of bits of padding */
+ subfic %r6,%r6,4 /* r6 <- number of useful bytes in r3 */
+ bf- 25,L(done_return_value) /* struct in r3 ? if not, done. */
+/* smst_one_register: */
+ slw %r3,%r3,%r5 /* Left-justify value in r3 */
+ mtxer %r6 /* move byte count to XER ... */
+ stswx %r3,0,%r30 /* ... and store that many bytes */
+ bf+ 26,L(done_return_value) /* struct in r3:r4 ? */
+ add %r6,%r6,%r30 /* adjust pointer */
+ stswi %r4,%r6,4 /* store last four bytes */
b L(done_return_value)
.LFE1:
diff --git a/Modules/_ctypes/libffi/src/prep_cif.c b/Modules/_ctypes/libffi/src/prep_cif.c
index eb78f9a2ed..c1c3b9a6c8 100644
--- a/Modules/_ctypes/libffi/src/prep_cif.c
+++ b/Modules/_ctypes/libffi/src/prep_cif.c
@@ -109,16 +109,13 @@ ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs,
/* Perform a sanity check on the return type */
FFI_ASSERT_VALID_TYPE(cif->rtype);
- /* x86-64 and s390 stack space allocation is handled in prep_machdep. */
-#if !defined M68K && !defined __x86_64__ && !defined S390 && !defined PA
+ /* x86, x86-64 and s390 stack space allocation is handled in prep_machdep. */
+#if !defined M68K && !defined __i386__ && !defined __x86_64__ && !defined S390 && !defined PA
/* Make space for the return structure pointer */
if (cif->rtype->type == FFI_TYPE_STRUCT
#ifdef SPARC
&& (cif->abi != FFI_V9 || cif->rtype->size > 32)
#endif
-#ifdef X86_DARWIN
- && (cif->rtype->size > 8)
-#endif
)
bytes = STACK_ARG_SIZE(sizeof(void*));
#endif
@@ -134,7 +131,7 @@ ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs,
check after the initialization. */
FFI_ASSERT_VALID_TYPE(*ptr);
-#if !defined __x86_64__ && !defined S390 && !defined PA
+#if !defined __i386__ && !defined __x86_64__ && !defined S390 && !defined PA
#ifdef SPARC
if (((*ptr)->type == FFI_TYPE_STRUCT
&& ((*ptr)->size > 16 || cif->abi != FFI_V9))
diff --git a/Modules/_ctypes/libffi/src/raw_api.c b/Modules/_ctypes/libffi/src/raw_api.c
new file mode 100644
index 0000000000..ce21372e29
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/raw_api.c
@@ -0,0 +1,254 @@
+/* -----------------------------------------------------------------------
+ raw_api.c - Copyright (c) 1999, 2008 Red Hat, Inc.
+
+ Author: Kresten Krab Thorup <krab@gnu.org>
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+/* This file defines generic functions for use with the raw api. */
+
+#include <ffi.h>
+#include <ffi_common.h>
+
+#if !FFI_NO_RAW_API
+
+size_t
+ffi_raw_size (ffi_cif *cif)
+{
+ size_t result = 0;
+ int i;
+
+ ffi_type **at = cif->arg_types;
+
+ for (i = cif->nargs-1; i >= 0; i--, at++)
+ {
+#if !FFI_NO_STRUCTS
+ if ((*at)->type == FFI_TYPE_STRUCT)
+ result += ALIGN (sizeof (void*), FFI_SIZEOF_ARG);
+ else
+#endif
+ result += ALIGN ((*at)->size, FFI_SIZEOF_ARG);
+ }
+
+ return result;
+}
+
+
+void
+ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
+{
+ unsigned i;
+ ffi_type **tp = cif->arg_types;
+
+#if WORDS_BIGENDIAN
+
+ for (i = 0; i < cif->nargs; i++, tp++, args++)
+ {
+ switch ((*tp)->type)
+ {
+ case FFI_TYPE_UINT8:
+ case FFI_TYPE_SINT8:
+ *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 1);
+ break;
+
+ case FFI_TYPE_UINT16:
+ case FFI_TYPE_SINT16:
+ *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 2);
+ break;
+
+#if FFI_SIZEOF_ARG >= 4
+ case FFI_TYPE_UINT32:
+ case FFI_TYPE_SINT32:
+ *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 4);
+ break;
+#endif
+
+#if !FFI_NO_STRUCTS
+ case FFI_TYPE_STRUCT:
+ *args = (raw++)->ptr;
+ break;
+#endif
+
+ case FFI_TYPE_POINTER:
+ *args = (void*) &(raw++)->ptr;
+ break;
+
+ default:
+ *args = raw;
+ raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+ }
+ }
+
+#else /* WORDS_BIGENDIAN */
+
+#if !PDP
+
+ /* then assume little endian */
+ for (i = 0; i < cif->nargs; i++, tp++, args++)
+ {
+#if !FFI_NO_STRUCTS
+ if ((*tp)->type == FFI_TYPE_STRUCT)
+ {
+ *args = (raw++)->ptr;
+ }
+ else
+#endif
+ {
+ *args = (void*) raw;
+ raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*);
+ }
+ }
+
+#else
+#error "pdp endian not supported"
+#endif /* ! PDP */
+
+#endif /* WORDS_BIGENDIAN */
+}
+
+void
+ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
+{
+ unsigned i;
+ ffi_type **tp = cif->arg_types;
+
+ for (i = 0; i < cif->nargs; i++, tp++, args++)
+ {
+ switch ((*tp)->type)
+ {
+ case FFI_TYPE_UINT8:
+ (raw++)->uint = *(UINT8*) (*args);
+ break;
+
+ case FFI_TYPE_SINT8:
+ (raw++)->sint = *(SINT8*) (*args);
+ break;
+
+ case FFI_TYPE_UINT16:
+ (raw++)->uint = *(UINT16*) (*args);
+ break;
+
+ case FFI_TYPE_SINT16:
+ (raw++)->sint = *(SINT16*) (*args);
+ break;
+
+#if FFI_SIZEOF_ARG >= 4
+ case FFI_TYPE_UINT32:
+ (raw++)->uint = *(UINT32*) (*args);
+ break;
+
+ case FFI_TYPE_SINT32:
+ (raw++)->sint = *(SINT32*) (*args);
+ break;
+#endif
+
+#if !FFI_NO_STRUCTS
+ case FFI_TYPE_STRUCT:
+ (raw++)->ptr = *args;
+ break;
+#endif
+
+ case FFI_TYPE_POINTER:
+ (raw++)->ptr = **(void***) args;
+ break;
+
+ default:
+ memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
+ raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+ }
+ }
+}
+
+#if !FFI_NATIVE_RAW_API
+
+
+/* This is a generic definition of ffi_raw_call, to be used if the
+ * native system does not provide a machine-specific implementation.
+ * Having this, allows code to be written for the raw API, without
+ * the need for system-specific code to handle input in that format;
+ * these following couple of functions will handle the translation forth
+ * and back automatically. */
+
+void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *raw)
+{
+ void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
+ ffi_raw_to_ptrarray (cif, raw, avalue);
+ ffi_call (cif, fn, rvalue, avalue);
+}
+
+#if FFI_CLOSURES /* base system provides closures */
+
+static void
+ffi_translate_args (ffi_cif *cif, void *rvalue,
+ void **avalue, void *user_data)
+{
+ ffi_raw *raw = (ffi_raw*)alloca (ffi_raw_size (cif));
+ ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
+
+ ffi_ptrarray_to_raw (cif, avalue, raw);
+ (*cl->fun) (cif, rvalue, raw, cl->user_data);
+}
+
+ffi_status
+ffi_prep_raw_closure_loc (ffi_raw_closure* cl,
+ ffi_cif *cif,
+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
+ void *user_data,
+ void *codeloc)
+{
+ ffi_status status;
+
+ status = ffi_prep_closure_loc ((ffi_closure*) cl,
+ cif,
+ &ffi_translate_args,
+ codeloc,
+ codeloc);
+ if (status == FFI_OK)
+ {
+ cl->fun = fun;
+ cl->user_data = user_data;
+ }
+
+ return status;
+}
+
+#endif /* FFI_CLOSURES */
+#endif /* !FFI_NATIVE_RAW_API */
+
+#if FFI_CLOSURES
+
+/* Again, here is the generic version of ffi_prep_raw_closure, which
+ * will install an intermediate "hub" for translation of arguments from
+ * the pointer-array format, to the raw format */
+
+ffi_status
+ffi_prep_raw_closure (ffi_raw_closure* cl,
+ ffi_cif *cif,
+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
+ void *user_data)
+{
+ return ffi_prep_raw_closure_loc (cl, cif, fun, user_data, cl);
+}
+
+#endif /* FFI_CLOSURES */
+
+#endif /* !FFI_NO_RAW_API */
diff --git a/Modules/_ctypes/libffi/src/s390/sysv.S b/Modules/_ctypes/libffi/src/s390/sysv.S
index b4c1dd54c1..4731a3177b 100644
--- a/Modules/_ctypes/libffi/src/s390/sysv.S
+++ b/Modules/_ctypes/libffi/src/s390/sysv.S
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
sysv.S - Copyright (c) 2000 Software AG
Copyright (c) 2008 Red Hat, Inc.
-
+
S390 Foreign Function Interface
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/Modules/_ctypes/libffi/src/sh/ffi.c b/Modules/_ctypes/libffi/src/sh/ffi.c
index d7fa1d4e3a..69bd025fb8 100644
--- a/Modules/_ctypes/libffi/src/sh/ffi.c
+++ b/Modules/_ctypes/libffi/src/sh/ffi.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Kaz Kojima
+ ffi.c - Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Kaz Kojima
Copyright (c) 2008 Red Hat, Inc.
SuperH Foreign Function Interface
@@ -461,7 +461,7 @@ ffi_prep_closure_loc (ffi_closure* closure,
void *codeloc)
{
unsigned int *tramp;
- unsigned short insn;
+ unsigned int insn;
FFI_ASSERT (cif->abi == FFI_GCC_SYSV);
diff --git a/Modules/_ctypes/libffi/src/sh/sysv.S b/Modules/_ctypes/libffi/src/sh/sysv.S
index ea798f700d..5be7516d65 100644
--- a/Modules/_ctypes/libffi/src/sh/sysv.S
+++ b/Modules/_ctypes/libffi/src/sh/sysv.S
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2002, 2003, 2004, 2006 Kaz Kojima
+ sysv.S - Copyright (c) 2002, 2003, 2004, 2006, 2008 Kaz Kojima
SuperH Foreign Function Interface
@@ -14,14 +14,14 @@
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
#define LIBFFI_ASM
@@ -702,6 +702,10 @@ L_case_v:
.ffi_closure_SYSV_end:
.size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
+#if defined __ELF__ && defined __linux__
+ .section .note.GNU-stack,"",@progbits
+#endif
+
.section ".eh_frame","aw",@progbits
__FRAME_BEGIN__:
.4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */
diff --git a/Modules/_ctypes/libffi/src/sh64/ffi.c b/Modules/_ctypes/libffi/src/sh64/ffi.c
index b17cf2c674..8fbc05ca6e 100644
--- a/Modules/_ctypes/libffi/src/sh64/ffi.c
+++ b/Modules/_ctypes/libffi/src/sh64/ffi.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2003, 2004 Kaz Kojima
+ ffi.c - Copyright (c) 2003, 2004, 2006, 2007 Kaz Kojima
Copyright (c) 2008 Anthony Green
SuperH SHmedia Foreign Function Interface
@@ -56,9 +56,7 @@ return_type (ffi_type *arg)
/* ffi_prep_args is called by the assembly routine once stack space
has been allocated for the function's arguments */
-/*@-exportheader@*/
void ffi_prep_args(char *stack, extended_cif *ecif)
-/*@=exportheader@*/
{
register unsigned int i;
register unsigned int avn;
@@ -162,6 +160,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
int n, m;
int greg;
int freg;
+ int fpair = -1;
greg = (return_type (cif->rtype) == FFI_TYPE_STRUCT ? 1 : 0);
freg = 0;
@@ -177,7 +176,13 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
cif->bytes += sizeof (UINT64) - sizeof (float);
if (freg >= NFREGARG - 1)
continue;
- freg++;
+ if (fpair < 0)
+ {
+ fpair = freg;
+ freg += 2;
+ }
+ else
+ fpair = -1;
cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++);
break;
@@ -186,7 +191,6 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
continue;
if ((freg + 1) < NFREGARG)
{
- freg = (freg + 1) & ~1;
freg += 2;
cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++);
}
@@ -264,9 +268,7 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif,
else if ((rvalue == NULL) &&
(cif->rtype->type == FFI_TYPE_STRUCT))
{
- /*@-sysunrecog@*/
ecif.rvalue = alloca(cif->rtype->size);
- /*@=sysunrecog@*/
}
else
ecif.rvalue = rvalue;
@@ -274,10 +276,8 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif,
switch (cif->abi)
{
case FFI_SYSV:
- /*@-usedef@*/
- ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes,
- cif->flags, cif->flags2, ecif.rvalue, fn);
- /*@=usedef@*/
+ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, cif->flags2,
+ ecif.rvalue, fn);
break;
default:
FFI_ASSERT(0);
@@ -294,10 +294,11 @@ extern void ffi_closure_SYSV (void);
extern void __ic_invalidate (void *line);
ffi_status
-ffi_prep_closure (ffi_closure *closure,
- ffi_cif *cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data)
+ffi_prep_closure_loc (ffi_closure *closure,
+ ffi_cif *cif,
+ void (*fun)(ffi_cif*, void*, void**, void*),
+ void *user_data,
+ void *codeloc)
{
unsigned int *tramp;
@@ -321,8 +322,8 @@ ffi_prep_closure (ffi_closure *closure,
tramp[2] = 0xcc000010 | (((UINT32) ffi_closure_SYSV) >> 16) << 10;
tramp[3] = 0xc8000010 | (((UINT32) ffi_closure_SYSV) & 0xffff) << 10;
tramp[4] = 0x6bf10600;
- tramp[5] = 0xcc000010 | (((UINT32) closure) >> 16) << 10;
- tramp[6] = 0xc8000010 | (((UINT32) closure) & 0xffff) << 10;
+ tramp[5] = 0xcc000010 | (((UINT32) codeloc) >> 16) << 10;
+ tramp[6] = 0xc8000010 | (((UINT32) codeloc) & 0xffff) << 10;
tramp[7] = 0x4401fff0;
closure->cif = cif;
@@ -330,7 +331,8 @@ ffi_prep_closure (ffi_closure *closure,
closure->user_data = user_data;
/* Flush the icache. */
- asm volatile ("ocbwb %0,0; synco; icbi %0,0; synci" : : "r" (tramp));
+ asm volatile ("ocbwb %0,0; synco; icbi %1,0; synci" : : "r" (tramp),
+ "r"(codeloc));
return FFI_OK;
}
@@ -352,6 +354,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue,
int i, avn;
int greg, freg;
ffi_cif *cif;
+ int fpair = -1;
cif = closure->cif;
avalue = alloca (cif->nargs * sizeof (void *));
@@ -360,7 +363,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue,
returns the data directly to the caller. */
if (return_type (cif->rtype) == FFI_TYPE_STRUCT)
{
- rvalue = *pgr;
+ rvalue = (UINT64 *) *pgr;
greg = 1;
}
else
@@ -404,11 +407,24 @@ ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue,
if ((*p_arg)->type == FFI_TYPE_FLOAT)
{
if (freg < NFREGARG - 1)
+ {
+ if (fpair >= 0)
+ {
+ avalue[i] = (UINT32 *) pfr + fpair;
+ fpair = -1;
+ }
+ else
+ {
#ifdef __LITTLE_ENDIAN__
- avalue[i] = (UINT32 *) pfr + (1 ^ freg++);
+ fpair = freg;
+ avalue[i] = (UINT32 *) pfr + (1 ^ freg);
#else
- avalue[i] = (UINT32 *) pfr + freg++;
+ fpair = 1 ^ freg;
+ avalue[i] = (UINT32 *) pfr + freg;
#endif
+ freg += 2;
+ }
+ }
else
#ifdef __LITTLE_ENDIAN__
avalue[i] = pgr + greg;
@@ -430,7 +446,6 @@ ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue,
avalue[i] = pgr + greg;
else
{
- freg = (freg + 1) & ~1;
avalue[i] = pfr + (freg >> 1);
freg += 2;
}
diff --git a/Modules/_ctypes/libffi/src/sh64/sysv.S b/Modules/_ctypes/libffi/src/sh64/sysv.S
index b6a248d920..c4587d5f3e 100644
--- a/Modules/_ctypes/libffi/src/sh64/sysv.S
+++ b/Modules/_ctypes/libffi/src/sh64/sysv.S
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2003, 2004 Kaz Kojima
+ sysv.S - Copyright (c) 2003, 2004, 2006, 2008 Kaz Kojima
SuperH SHmedia Foreign Function Interface
@@ -14,14 +14,15 @@
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
#define LIBFFI_ASM
@@ -85,6 +86,7 @@ ENTRY(ffi_call_SYSV)
addi r15, 64, r22
movi 0, r0
movi 0, r1
+ movi -1, r23
pt/l 1f, tr1
bnei/l r29, FFI_TYPE_STRUCT, tr1
@@ -107,9 +109,6 @@ ENTRY(ffi_call_SYSV)
.L_pass_d:
addi r0, 1, r0
- addi r1, 1, r1
- andi r1, ~1, r1
-
pt/l 3f, tr0
movi 12, r20
bge/l r1, r20, tr0
@@ -159,13 +158,23 @@ ENTRY(ffi_call_SYSV)
addi.l r15, 8, r15
3:
pt/l .L_pass, tr0
- addi r1, 1, r1
blink tr0, r63
.L_pop_f:
pt/l .L_pop_f_tbl, tr1
+ pt/l 5f, tr2
gettr tr1, r20
+ bge/l r23, r63, tr2
+ add r1, r63, r23
shlli r1, 3, r21
+ addi r1, 2, r1
+ add r20, r21, r20
+ ptabs/l r20, tr1
+ blink tr1, r63
+5:
+ addi r23, 1, r21
+ movi -1, r23
+ shlli r21, 3, r21
add r20, r21, r20
ptabs/l r20, tr1
blink tr1, r63
@@ -430,6 +439,10 @@ ENTRY(ffi_closure_SYSV)
.ffi_closure_SYSV_end:
.size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
+#if defined __ELF__ && defined __linux__
+ .section .note.GNU-stack,"",@progbits
+#endif
+
.section ".eh_frame","aw",@progbits
__FRAME_BEGIN__:
.4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */
diff --git a/Modules/_ctypes/libffi/src/sparc/ffi.c b/Modules/_ctypes/libffi/src/sparc/ffi.c
index 4cdd1b93cc..1d01f59ec2 100644
--- a/Modules/_ctypes/libffi/src/sparc/ffi.c
+++ b/Modules/_ctypes/libffi/src/sparc/ffi.c
@@ -308,14 +308,24 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
cif->flags = FFI_TYPE_STRUCT;
break;
+ case FFI_TYPE_SINT8:
+ case FFI_TYPE_UINT8:
+ case FFI_TYPE_SINT16:
+ case FFI_TYPE_UINT16:
+ if (cif->abi == FFI_V9)
+ cif->flags = FFI_TYPE_INT;
+ else
+ cif->flags = cif->rtype->type;
+ break;
+
case FFI_TYPE_SINT64:
case FFI_TYPE_UINT64:
- if (cif->abi != FFI_V9)
- {
- cif->flags = FFI_TYPE_SINT64;
- break;
- }
- /* FALLTHROUGH */
+ if (cif->abi == FFI_V9)
+ cif->flags = FFI_TYPE_INT;
+ else
+ cif->flags = FFI_TYPE_SINT64;
+ break;
+
default:
cif->flags = FFI_TYPE_INT;
break;
@@ -589,6 +599,11 @@ ffi_closure_sparc_inner_v9(ffi_closure *closure,
/* Right-justify. */
argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+ /* Align on a 16-byte boundary. */
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+ if (arg_types[i]->type == FFI_TYPE_LONGDOUBLE && (argn % 2) != 0)
+ argn++;
+#endif
if (i < fp_slot_max
&& (arg_types[i]->type == FFI_TYPE_FLOAT
|| arg_types[i]->type == FFI_TYPE_DOUBLE
diff --git a/Modules/_ctypes/libffi/src/sparc/v8.S b/Modules/_ctypes/libffi/src/sparc/v8.S
index 9eb5467565..bef1b681ee 100644
--- a/Modules/_ctypes/libffi/src/sparc/v8.S
+++ b/Modules/_ctypes/libffi/src/sparc/v8.S
@@ -73,21 +73,63 @@ _ffi_call_v8:
be,a done
st %f0, [%i4+0] ! (delay)
+ cmp %i3, FFI_TYPE_DOUBLE
+ be,a double
+ st %f0, [%i4+0] ! (delay)
+
+ cmp %i3, FFI_TYPE_SINT8
+ be,a sint8
+ sll %o0, 24, %o0 ! (delay)
+
+ cmp %i3, FFI_TYPE_UINT8
+ be,a uint8
+ sll %o0, 24, %o0 ! (delay)
+
+ cmp %i3, FFI_TYPE_SINT16
+ be,a sint16
+ sll %o0, 16, %o0 ! (delay)
+
+ cmp %i3, FFI_TYPE_UINT16
+ be,a uint16
+ sll %o0, 16, %o0 ! (delay)
+
cmp %i3, FFI_TYPE_SINT64
- be longlong
+ be,a longlong
+ st %o0, [%i4+0] ! (delay)
+done:
+ ret
+ restore
- cmp %i3, FFI_TYPE_DOUBLE
- bne done
- nop
- st %f0, [%i4+0]
+double:
st %f1, [%i4+4]
-
-done:
ret
restore
-longlong:
+sint8:
+ sra %o0, 24, %o0
+ st %o0, [%i4+0]
+ ret
+ restore
+
+uint8:
+ srl %o0, 24, %o0
+ st %o0, [%i4+0]
+ ret
+ restore
+
+sint16:
+ sra %o0, 16, %o0
+ st %o0, [%i4+0]
+ ret
+ restore
+
+uint16:
+ srl %o0, 16, %o0
st %o0, [%i4+0]
+ ret
+ restore
+
+longlong:
st %o1, [%i4+4]
ret
restore
@@ -148,7 +190,8 @@ ffi_closure_v8:
be done1
cmp %o0, FFI_TYPE_INT
- be integer
+ be done1
+ ld [%fp-8], %i0
cmp %o0, FFI_TYPE_FLOAT
be,a done1
@@ -166,13 +209,15 @@ ffi_closure_v8:
cmp %o0, FFI_TYPE_STRUCT
be done2
- ! FFI_TYPE_SINT64
- ! FFI_TYPE_UINT64
- ld [%fp-4], %i1
+ cmp %o0, FFI_TYPE_SINT64
+ be,a done1
+ ldd [%fp-8], %i0
-integer:
- ld [%fp-8], %i0
+ cmp %o0, FFI_TYPE_UINT64
+ be,a done1
+ ldd [%fp-8], %i0
+ ld [%fp-8], %i0
done1:
jmp %i7+8
restore
diff --git a/Modules/_ctypes/libffi/src/types.c b/Modules/_ctypes/libffi/src/types.c
new file mode 100644
index 0000000000..0a11eb0fb4
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/types.c
@@ -0,0 +1,77 @@
+/* -----------------------------------------------------------------------
+ types.c - Copyright (c) 1996, 1998 Red Hat, Inc.
+
+ Predefined ffi_types needed by libffi.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+/* Hide the basic type definitions from the header file, so that we
+ can redefine them here as "const". */
+#define LIBFFI_HIDE_BASIC_TYPES
+
+#include <ffi.h>
+#include <ffi_common.h>
+
+/* Type definitions */
+
+#define FFI_TYPEDEF(name, type, id) \
+struct struct_align_##name { \
+ char c; \
+ type x; \
+}; \
+const ffi_type ffi_type_##name = { \
+ sizeof(type), \
+ offsetof(struct struct_align_##name, x), \
+ id, NULL \
+}
+
+/* Size and alignment are fake here. They must not be 0. */
+const ffi_type ffi_type_void = {
+ 1, 1, FFI_TYPE_VOID, NULL
+};
+
+FFI_TYPEDEF(uint8, UINT8, FFI_TYPE_UINT8);
+FFI_TYPEDEF(sint8, SINT8, FFI_TYPE_SINT8);
+FFI_TYPEDEF(uint16, UINT16, FFI_TYPE_UINT16);
+FFI_TYPEDEF(sint16, SINT16, FFI_TYPE_SINT16);
+FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32);
+FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32);
+FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64);
+FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64);
+
+FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER);
+
+FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT);
+FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE);
+
+#ifdef __alpha__
+/* Even if we're not configured to default to 128-bit long double,
+ maintain binary compatibility, as -mlong-double-128 can be used
+ at any time. */
+/* Validate the hard-coded number below. */
+# if defined(__LONG_DOUBLE_128__) && FFI_TYPE_LONGDOUBLE != 4
+# error FFI_TYPE_LONGDOUBLE out of date
+# endif
+const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL };
+#elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE);
+#endif
diff --git a/Modules/_ctypes/libffi/src/x86/darwin.S b/Modules/_ctypes/libffi/src/x86/darwin.S
index b0b8cdf7af..8f0f0707aa 100644
--- a/Modules/_ctypes/libffi/src/x86/darwin.S
+++ b/Modules/_ctypes/libffi/src/x86/darwin.S
@@ -15,15 +15,16 @@
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ -----------------------------------------------------------------------
+ */
#ifndef __x86_64__
diff --git a/Modules/_ctypes/libffi/src/x86/ffi.c b/Modules/_ctypes/libffi/src/x86/ffi.c
index 60d7f47030..80496532a3 100644
--- a/Modules/_ctypes/libffi/src/x86/ffi.c
+++ b/Modules/_ctypes/libffi/src/x86/ffi.c
@@ -3,7 +3,7 @@
Copyright (c) 2002 Ranjit Mathew
Copyright (c) 2002 Bo Thorsen
Copyright (c) 2002 Roger Sayle
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008 Free Software Foundation, Inc.
x86 Foreign Function Interface
@@ -28,7 +28,11 @@
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
-#ifndef __x86_64__
+#if !defined(__x86_64__) || defined(_WIN64)
+
+#ifdef _WIN64
+#include <windows.h>
+#endif
#include <ffi.h>
#include <ffi_common.h>
@@ -47,10 +51,15 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
argp = stack;
- if (ecif->cif->flags == FFI_TYPE_STRUCT)
+ if (ecif->cif->flags == FFI_TYPE_STRUCT
+#ifdef X86_WIN64
+ && (ecif->cif->rtype->size != 1 && ecif->cif->rtype->size != 2
+ && ecif->cif->rtype->size != 4 && ecif->cif->rtype->size != 8)
+#endif
+ )
{
*(void **) argp = ecif->rvalue;
- argp += 4;
+ argp += sizeof(void*);
}
p_argv = ecif->avalue;
@@ -62,53 +71,75 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
size_t z;
/* Align if necessary */
- if ((sizeof(int) - 1) & (unsigned) argp)
- argp = (char *) ALIGN(argp, sizeof(int));
+ if ((sizeof(void*) - 1) & (size_t) argp)
+ argp = (char *) ALIGN(argp, sizeof(void*));
z = (*p_arg)->size;
- if (z < sizeof(int))
- {
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT32:
- *(signed int *) argp = (signed int)*(SINT32 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT32:
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- break;
-
- case FFI_TYPE_STRUCT:
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- }
+#ifdef X86_WIN64
+ if (z > sizeof(ffi_arg)
+ || ((*p_arg)->type == FFI_TYPE_STRUCT
+ && (z != 1 && z != 2 && z != 4 && z != 8))
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
+ || ((*p_arg)->type == FFI_TYPE_LONGDOUBLE)
+#endif
+ )
+ {
+ z = sizeof(ffi_arg);
+ *(void **)argp = *p_argv;
+ }
+ else if ((*p_arg)->type == FFI_TYPE_FLOAT)
+ {
+ memcpy(argp, *p_argv, z);
+ }
else
- {
- memcpy(argp, *p_argv, z);
- }
+#endif
+ if (z < sizeof(ffi_arg))
+ {
+ z = sizeof(ffi_arg);
+ switch ((*p_arg)->type)
+ {
+ case FFI_TYPE_SINT8:
+ *(ffi_sarg *) argp = (ffi_sarg)*(SINT8 *)(* p_argv);
+ break;
+
+ case FFI_TYPE_UINT8:
+ *(ffi_arg *) argp = (ffi_arg)*(UINT8 *)(* p_argv);
+ break;
+
+ case FFI_TYPE_SINT16:
+ *(ffi_sarg *) argp = (ffi_sarg)*(SINT16 *)(* p_argv);
+ break;
+
+ case FFI_TYPE_UINT16:
+ *(ffi_arg *) argp = (ffi_arg)*(UINT16 *)(* p_argv);
+ break;
+
+ case FFI_TYPE_SINT32:
+ *(ffi_sarg *) argp = (ffi_sarg)*(SINT32 *)(* p_argv);
+ break;
+
+ case FFI_TYPE_UINT32:
+ *(ffi_arg *) argp = (ffi_arg)*(UINT32 *)(* p_argv);
+ break;
+
+ case FFI_TYPE_STRUCT:
+ *(ffi_arg *) argp = *(ffi_arg *)(* p_argv);
+ break;
+
+ default:
+ FFI_ASSERT(0);
+ }
+ }
+ else
+ {
+ memcpy(argp, *p_argv, z);
+ }
p_argv++;
+#ifdef X86_WIN64
+ argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
+#else
argp += z;
+#endif
}
return;
@@ -117,33 +148,43 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
/* Perform machine dependent cif processing */
ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
{
+ unsigned int i;
+ ffi_type **ptr;
+
/* Set the return type flag */
switch (cif->rtype->type)
{
case FFI_TYPE_VOID:
-#ifdef X86
- case FFI_TYPE_STRUCT:
-#endif
-#if defined(X86) || defined(X86_DARWIN)
+#if defined(X86) || defined (X86_WIN32) || defined(X86_FREEBSD) || defined(X86_DARWIN) || defined(X86_WIN64)
case FFI_TYPE_UINT8:
case FFI_TYPE_UINT16:
case FFI_TYPE_SINT8:
case FFI_TYPE_SINT16:
#endif
-
+#ifdef X86_WIN64
+ case FFI_TYPE_UINT32:
+ case FFI_TYPE_SINT32:
+#endif
case FFI_TYPE_SINT64:
case FFI_TYPE_FLOAT:
case FFI_TYPE_DOUBLE:
+#ifndef X86_WIN64
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
case FFI_TYPE_LONGDOUBLE:
+#endif
+#endif
cif->flags = (unsigned) cif->rtype->type;
break;
case FFI_TYPE_UINT64:
+#ifdef X86_WIN64
+ case FFI_TYPE_POINTER:
+#endif
cif->flags = FFI_TYPE_SINT64;
break;
-#ifndef X86
case FFI_TYPE_STRUCT:
+#ifndef X86
if (cif->rtype->size == 1)
{
cif->flags = FFI_TYPE_SMALL_STRUCT_1B; /* same as char size */
@@ -154,24 +195,49 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
}
else if (cif->rtype->size == 4)
{
+#ifdef X86_WIN64
+ cif->flags = FFI_TYPE_SMALL_STRUCT_4B;
+#else
cif->flags = FFI_TYPE_INT; /* same as int type */
+#endif
}
else if (cif->rtype->size == 8)
{
cif->flags = FFI_TYPE_SINT64; /* same as int64 type */
}
else
+#endif
{
cif->flags = FFI_TYPE_STRUCT;
+ // allocate space for return value pointer
+ cif->bytes += ALIGN(sizeof(void*), FFI_SIZEOF_ARG);
}
break;
-#endif
default:
+#ifdef X86_WIN64
+ cif->flags = FFI_TYPE_SINT64;
+ break;
+ case FFI_TYPE_INT:
+ cif->flags = FFI_TYPE_SINT32;
+#else
cif->flags = FFI_TYPE_INT;
+#endif
break;
}
+ for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
+ {
+ if (((*ptr)->alignment - 1) & cif->bytes)
+ cif->bytes = ALIGN(cif->bytes, (*ptr)->alignment);
+ cif->bytes += ALIGN((*ptr)->size, FFI_SIZEOF_ARG);
+ }
+
+#ifdef X86_WIN64
+ // ensure space for storing four registers
+ cif->bytes += 4 * sizeof(ffi_arg);
+#endif
+
#ifdef X86_DARWIN
cif->bytes = (cif->bytes + 15) & ~0xF;
#endif
@@ -179,14 +245,18 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
return FFI_OK;
}
+#ifdef X86_WIN64
+extern int
+ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *,
+ unsigned, unsigned, unsigned *, void (*fn)(void));
+#elif defined(X86_WIN32)
+extern void
+ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *,
+ unsigned, unsigned, unsigned *, void (*fn)(void));
+#else
extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
- unsigned, unsigned, unsigned *, void (*fn)(void));
-
-#ifdef X86_WIN32
-extern void ffi_call_STDCALL(void (*)(char *, extended_cif *), extended_cif *,
- unsigned, unsigned, unsigned *, void (*fn)(void));
-
-#endif /* X86_WIN32 */
+ unsigned, unsigned, unsigned *, void (*fn)(void));
+#endif
void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{
@@ -195,30 +265,66 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
ecif.cif = cif;
ecif.avalue = avalue;
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
- if ((rvalue == NULL) &&
- (cif->flags == FFI_TYPE_STRUCT))
+ /* If the return value is a struct and we don't have a return */
+ /* value address then we need to make one */
+
+#ifdef X86_WIN64
+ if (rvalue == NULL
+ && cif->flags == FFI_TYPE_STRUCT
+ && cif->rtype->size != 1 && cif->rtype->size != 2
+ && cif->rtype->size != 4 && cif->rtype->size != 8)
+ {
+ ecif.rvalue = alloca((cif->rtype->size + 0xF) & ~0xF);
+ }
+#else
+ if (rvalue == NULL
+ && cif->flags == FFI_TYPE_STRUCT)
{
ecif.rvalue = alloca(cif->rtype->size);
}
+#endif
else
ecif.rvalue = rvalue;
switch (cif->abi)
{
- case FFI_SYSV:
- ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
- fn);
+#ifdef X86_WIN64
+ case FFI_WIN64:
+ {
+ // Make copies of all struct arguments
+ // NOTE: not sure if responsibility should be here or in caller
+ unsigned int i;
+ for (i=0; i < cif->nargs;i++) {
+ size_t size = cif->arg_types[i]->size;
+ if ((cif->arg_types[i]->type == FFI_TYPE_STRUCT
+ && (size != 1 && size != 2 && size != 4 && size != 8))
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+ || cif->arg_types[i]->type == FFI_TYPE_LONGDOUBLE
+#endif
+ )
+ {
+ void *local = alloca(size);
+ memcpy(local, avalue[i], size);
+ avalue[i] = local;
+ }
+ }
+ ffi_call_win64(ffi_prep_args, &ecif, cif->bytes,
+ cif->flags, ecif.rvalue, fn);
+ }
break;
-#ifdef X86_WIN32
+#elif defined(X86_WIN32)
+ case FFI_SYSV:
case FFI_STDCALL:
- ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, cif->flags,
- ecif.rvalue, fn);
+ ffi_call_win32(ffi_prep_args, &ecif, cif->bytes, cif->flags,
+ ecif.rvalue, fn);
break;
-#endif /* X86_WIN32 */
+#else
+ case FFI_SYSV:
+ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
+ fn);
+ break;
+#endif
default:
FFI_ASSERT(0);
break;
@@ -228,8 +334,10 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
/** private members **/
+/* The following __attribute__((regparm(1))) decorations will have no effect
+ on MSVC - standard cdecl convention applies. */
static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
- void** args, ffi_cif* cif);
+ void** args, ffi_cif* cif);
void FFI_HIDDEN ffi_closure_SYSV (ffi_closure *)
__attribute__ ((regparm(1)));
unsigned int FFI_HIDDEN ffi_closure_SYSV_inner (ffi_closure *, void **, void *)
@@ -240,14 +348,44 @@ void FFI_HIDDEN ffi_closure_raw_SYSV (ffi_raw_closure *)
void FFI_HIDDEN ffi_closure_STDCALL (ffi_closure *)
__attribute__ ((regparm(1)));
#endif
+#ifdef X86_WIN64
+void FFI_HIDDEN ffi_closure_win64 (ffi_closure *);
+#endif
/* This function is jumped to by the trampoline */
-unsigned int FFI_HIDDEN
-ffi_closure_SYSV_inner (closure, respp, args)
- ffi_closure *closure;
- void **respp;
- void *args;
+#ifdef X86_WIN64
+void * FFI_HIDDEN
+ffi_closure_win64_inner (ffi_closure *closure, void *args) {
+ ffi_cif *cif;
+ void **arg_area;
+ void *result;
+ void *resp = &result;
+
+ cif = closure->cif;
+ arg_area = (void**) alloca (cif->nargs * sizeof (void*));
+
+ /* this call will initialize ARG_AREA, such that each
+ * element in that array points to the corresponding
+ * value on the stack; and if the function returns
+ * a structure, it will change RESP to point to the
+ * structure return address. */
+
+ ffi_prep_incoming_args_SYSV(args, &resp, arg_area, cif);
+
+ (closure->fun) (cif, resp, arg_area, closure->user_data);
+
+ /* The result is returned in rax. This does the right thing for
+ result types except for floats; we have to 'mov xmm0, rax' in the
+ caller to correct this.
+ TODO: structure sizes of 3 5 6 7 are returned by reference, too!!!
+ */
+ return cif->rtype->size > sizeof(void *) ? resp : *(void **)resp;
+}
+
+#else
+unsigned int FFI_HIDDEN __attribute__ ((regparm(1)))
+ffi_closure_SYSV_inner (ffi_closure *closure, void **respp, void *args)
{
/* our various things... */
ffi_cif *cif;
@@ -259,7 +397,7 @@ ffi_closure_SYSV_inner (closure, respp, args)
/* this call will initialize ARG_AREA, such that each
* element in that array points to the corresponding
* value on the stack; and if the function returns
- * a structure, it will re-set RESP to point to the
+ * a structure, it will change RESP to point to the
* structure return address. */
ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif);
@@ -268,10 +406,11 @@ ffi_closure_SYSV_inner (closure, respp, args)
return cif->flags;
}
+#endif /* !X86_WIN64 */
static void
ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
- ffi_cif *cif)
+ ffi_cif *cif)
{
register unsigned int i;
register void **p_argv;
@@ -280,10 +419,20 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
argp = stack;
+#ifdef X86_WIN64
+ if (cif->rtype->size > sizeof(ffi_arg)
+ || (cif->flags == FFI_TYPE_STRUCT
+ && (cif->rtype->size != 1 && cif->rtype->size != 2
+ && cif->rtype->size != 4 && cif->rtype->size != 8))) {
+ *rvalue = *(void **) argp;
+ argp += sizeof(void *);
+ }
+#else
if ( cif->flags == FFI_TYPE_STRUCT ) {
*rvalue = *(void **) argp;
- argp += 4;
+ argp += sizeof(void *);
}
+#endif
p_argv = avalue;
@@ -292,38 +441,73 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
size_t z;
/* Align if necessary */
- if ((sizeof(int) - 1) & (unsigned) argp) {
- argp = (char *) ALIGN(argp, sizeof(int));
+ if ((sizeof(void*) - 1) & (size_t) argp) {
+ argp = (char *) ALIGN(argp, sizeof(void*));
}
- z = (*p_arg)->size;
-
- /* because we're little endian, this is what it turns into. */
-
- *p_argv = (void*) argp;
-
+#ifdef X86_WIN64
+ if ((*p_arg)->size > sizeof(ffi_arg)
+ || ((*p_arg)->type == FFI_TYPE_STRUCT
+ && ((*p_arg)->size != 1 && (*p_arg)->size != 2
+ && (*p_arg)->size != 4 && (*p_arg)->size != 8)))
+ {
+ z = sizeof(void *);
+ *p_argv = *(void **)argp;
+ }
+ else
+#endif
+ {
+ z = (*p_arg)->size;
+
+ /* because we're little endian, this is what it turns into. */
+
+ *p_argv = (void*) argp;
+ }
+
p_argv++;
+#ifdef X86_WIN64
+ argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
+#else
argp += z;
+#endif
}
return;
}
+#define FFI_INIT_TRAMPOLINE_WIN64(TRAMP,FUN,CTX,MASK) \
+{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
+ void* __fun = (void*)(FUN); \
+ void* __ctx = (void*)(CTX); \
+ *(unsigned char*) &__tramp[0] = 0x41; \
+ *(unsigned char*) &__tramp[1] = 0xbb; \
+ *(unsigned int*) &__tramp[2] = MASK; /* mov $mask, %r11 */ \
+ *(unsigned char*) &__tramp[6] = 0x48; \
+ *(unsigned char*) &__tramp[7] = 0xb8; \
+ *(void**) &__tramp[8] = __ctx; /* mov __ctx, %rax */ \
+ *(unsigned char *) &__tramp[16] = 0x49; \
+ *(unsigned char *) &__tramp[17] = 0xba; \
+ *(void**) &__tramp[18] = __fun; /* mov __fun, %r10 */ \
+ *(unsigned char *) &__tramp[26] = 0x41; \
+ *(unsigned char *) &__tramp[27] = 0xff; \
+ *(unsigned char *) &__tramp[28] = 0xe2; /* jmp %r10 */ \
+ }
+
/* How to make a trampoline. Derived from gcc/config/i386/i386.c. */
#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
-({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
+{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
unsigned int __fun = (unsigned int)(FUN); \
unsigned int __ctx = (unsigned int)(CTX); \
- unsigned int __dis = __fun - (__ctx + 10); \
+ unsigned int __dis = __fun - (__ctx + 10); \
*(unsigned char*) &__tramp[0] = 0xb8; \
*(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
*(unsigned char *) &__tramp[5] = 0xe9; \
*(unsigned int*) &__tramp[6] = __dis; /* jmp __fun */ \
- })
+ }
#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX,SIZE) \
-({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
+{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
unsigned int __fun = (unsigned int)(FUN); \
unsigned int __ctx = (unsigned int)(CTX); \
unsigned int __dis = __fun - (__ctx + 10); \
@@ -334,17 +518,29 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
*(unsigned int*) &__tramp[6] = __dis; /* call __fun */ \
*(unsigned char *) &__tramp[10] = 0xc2; \
*(unsigned short*) &__tramp[11] = __size; /* ret __size */ \
- })
+ }
/* the cif must already be prep'ed */
ffi_status
ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void *codeloc)
+ ffi_cif* cif,
+ void (*fun)(ffi_cif*,void*,void**,void*),
+ void *user_data,
+ void *codeloc)
{
+#ifdef X86_WIN64
+#define ISFLOAT(IDX) (cif->arg_types[IDX]->type == FFI_TYPE_FLOAT || cif->arg_types[IDX]->type == FFI_TYPE_DOUBLE)
+#define FLAG(IDX) (cif->nargs>(IDX)&&ISFLOAT(IDX)?(1<<(IDX)):0)
+ if (cif->abi == FFI_WIN64)
+ {
+ int mask = FLAG(0)|FLAG(1)|FLAG(2)|FLAG(3);
+ FFI_INIT_TRAMPOLINE_WIN64 (&closure->tramp[0],
+ &ffi_closure_win64,
+ codeloc, mask);
+ /* make sure we can execute here */
+ }
+#else
if (cif->abi == FFI_SYSV)
{
FFI_INIT_TRAMPOLINE (&closure->tramp[0],
@@ -358,7 +554,8 @@ ffi_prep_closure_loc (ffi_closure* closure,
&ffi_closure_STDCALL,
(void*)codeloc, cif->bytes);
}
-#endif
+#endif /* X86_WIN32 */
+#endif /* !X86_WIN64 */
else
{
return FFI_BAD_ABI;
@@ -377,10 +574,10 @@ ffi_prep_closure_loc (ffi_closure* closure,
ffi_status
ffi_prep_raw_closure_loc (ffi_raw_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
- void *user_data,
- void *codeloc)
+ ffi_cif* cif,
+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
+ void *user_data,
+ void *codeloc)
{
int i;
@@ -389,9 +586,9 @@ ffi_prep_raw_closure_loc (ffi_raw_closure* closure,
}
/* we currently don't support certain kinds of arguments for raw
- // closures. This should be implemented by a separate assembly language
- // routine, since it would require argument processing, something we
- // don't do now for performance. */
+ closures. This should be implemented by a separate assembly
+ language routine, since it would require argument processing,
+ something we don't do now for performance. */
for (i = cif->nargs-1; i >= 0; i--)
{
@@ -401,7 +598,7 @@ ffi_prep_raw_closure_loc (ffi_raw_closure* closure,
FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV,
- codeloc);
+ codeloc);
closure->cif = cif;
closure->user_data = user_data;
@@ -421,16 +618,6 @@ ffi_prep_args_raw(char *stack, extended_cif *ecif)
* libffi-1.20, this is not the case.)
*/
-extern void
-ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, unsigned,
- unsigned, unsigned *, void (*fn)(void));
-
-#ifdef X86_WIN32
-extern void
-ffi_call_STDCALL(void (*)(char *, extended_cif *), extended_cif *, unsigned,
- unsigned, unsigned *, void (*fn)(void));
-#endif /* X86_WIN32 */
-
void
ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
{
@@ -440,8 +627,8 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
ecif.cif = cif;
ecif.avalue = avalue;
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
+ /* If the return value is a struct and we don't have a return */
+ /* value address then we need to make one */
if ((rvalue == NULL) &&
(cif->rtype->type == FFI_TYPE_STRUCT))
@@ -454,16 +641,18 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
switch (cif->abi)
{
- case FFI_SYSV:
- ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
- ecif.rvalue, fn);
- break;
#ifdef X86_WIN32
+ case FFI_SYSV:
case FFI_STDCALL:
- ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
- ecif.rvalue, fn);
+ ffi_call_win32(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
+ ecif.rvalue, fn);
break;
-#endif /* X86_WIN32 */
+#else
+ case FFI_SYSV:
+ ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
+ ecif.rvalue, fn);
+ break;
+#endif
default:
FFI_ASSERT(0);
break;
@@ -472,4 +661,5 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
#endif
-#endif /* __x86_64__ */
+#endif /* !__x86_64__ || X86_WIN64 */
+
diff --git a/Modules/_ctypes/libffi/src/x86/ffi64.c b/Modules/_ctypes/libffi/src/x86/ffi64.c
index fa992552ca..07a2627b1f 100644
--- a/Modules/_ctypes/libffi/src/x86/ffi64.c
+++ b/Modules/_ctypes/libffi/src/x86/ffi64.c
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de>
- Copyright (c) 2008 Red Hat, Inc.
+ ffi64.c - Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de>
+ Copyright (c) 2008 Red Hat, Inc.
x86-64 Foreign Function Interface
@@ -50,9 +50,10 @@ extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
gcc/config/i386/i386.c. Do *not* change one without the other. */
/* Register class used for passing given 64bit part of the argument.
- These represent classes as documented by the PS ABI, with the exception
- of SSESF, SSEDF classes, that are basically SSE class, just gcc will
- use SF or DFmode move instead of DImode to avoid reformatting penalties.
+ These represent classes as documented by the PS ABI, with the
+ exception of SSESF, SSEDF classes, that are basically SSE class,
+ just gcc will use SF or DFmode move instead of DImode to avoid
+ reformatting penalties.
Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves
whenever possible (upper half does contain padding). */
@@ -145,13 +146,35 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
case FFI_TYPE_POINTER:
- if (byte_offset + type->size <= 4)
- classes[0] = X86_64_INTEGERSI_CLASS;
- else
- classes[0] = X86_64_INTEGER_CLASS;
- return 1;
+ {
+ int size = byte_offset + type->size;
+
+ if (size <= 4)
+ {
+ classes[0] = X86_64_INTEGERSI_CLASS;
+ return 1;
+ }
+ else if (size <= 8)
+ {
+ classes[0] = X86_64_INTEGER_CLASS;
+ return 1;
+ }
+ else if (size <= 12)
+ {
+ classes[0] = X86_64_INTEGER_CLASS;
+ classes[1] = X86_64_INTEGERSI_CLASS;
+ return 2;
+ }
+ else if (size <= 16)
+ {
+ classes[0] = classes[1] = X86_64_INTEGERSI_CLASS;
+ return 2;
+ }
+ else
+ FFI_ASSERT (0);
+ }
case FFI_TYPE_FLOAT:
- if (byte_offset == 0)
+ if (!(byte_offset % 8))
classes[0] = X86_64_SSESF_CLASS;
else
classes[0] = X86_64_SSE_CLASS;
@@ -171,13 +194,21 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
int i;
enum x86_64_reg_class subclasses[MAX_CLASSES];
- /* If the struct is larger than 16 bytes, pass it on the stack. */
- if (type->size > 16)
+ /* If the struct is larger than 32 bytes, pass it on the stack. */
+ if (type->size > 32)
return 0;
for (i = 0; i < words; i++)
classes[i] = X86_64_NO_CLASS;
+ /* Zero sized arrays or structures are NO_CLASS. We return 0 to
+ signalize memory class, so handle it as special case. */
+ if (!words)
+ {
+ classes[0] = X86_64_NO_CLASS;
+ return 1;
+ }
+
/* Merge the fields of structure. */
for (ptr = type->elements; *ptr != NULL; ptr++)
{
@@ -198,6 +229,20 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
byte_offset += (*ptr)->size;
}
+ if (words > 2)
+ {
+ /* When size > 16 bytes, if the first one isn't
+ X86_64_SSE_CLASS or any other ones aren't
+ X86_64_SSEUP_CLASS, everything should be passed in
+ memory. */
+ if (classes[0] != X86_64_SSE_CLASS)
+ return 0;
+
+ for (i = 1; i < words; i++)
+ if (classes[i] != X86_64_SSEUP_CLASS)
+ return 0;
+ }
+
/* Final merger cleanup. */
for (i = 0; i < words; i++)
{
@@ -207,15 +252,25 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
return 0;
/* The X86_64_SSEUP_CLASS should be always preceded by
- X86_64_SSE_CLASS. */
+ X86_64_SSE_CLASS or X86_64_SSEUP_CLASS. */
if (classes[i] == X86_64_SSEUP_CLASS
- && (i == 0 || classes[i - 1] != X86_64_SSE_CLASS))
- classes[i] = X86_64_SSE_CLASS;
+ && classes[i - 1] != X86_64_SSE_CLASS
+ && classes[i - 1] != X86_64_SSEUP_CLASS)
+ {
+ /* The first one should never be X86_64_SSEUP_CLASS. */
+ FFI_ASSERT (i != 0);
+ classes[i] = X86_64_SSE_CLASS;
+ }
- /* X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS. */
+ /* If X86_64_X87UP_CLASS isn't preceded by X86_64_X87_CLASS,
+ everything should be passed in memory. */
if (classes[i] == X86_64_X87UP_CLASS
- && (i == 0 || classes[i - 1] != X86_64_X87_CLASS))
- classes[i] = X86_64_SSE_CLASS;
+ && (classes[i - 1] != X86_64_X87_CLASS))
+ {
+ /* The first one should never be X86_64_X87UP_CLASS. */
+ FFI_ASSERT (i != 0);
+ return 0;
+ }
}
return words;
}
@@ -528,10 +583,10 @@ ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue,
argp += arg_types[i]->size;
}
/* If the argument is in a single register, or two consecutive
- registers, then we can use that address directly. */
+ integer registers, then we can use that address directly. */
else if (n == 1
- || (n == 2
- && SSE_CLASS_P (classes[0]) == SSE_CLASS_P (classes[1])))
+ || (n == 2 && !(SSE_CLASS_P (classes[0])
+ || SSE_CLASS_P (classes[1]))))
{
/* The argument is in a single register. */
if (SSE_CLASS_P (classes[0]))
diff --git a/Modules/_ctypes/libffi/src/x86/ffitarget.h b/Modules/_ctypes/libffi/src/x86/ffitarget.h
index 8178d06482..89a8983da9 100644
--- a/Modules/_ctypes/libffi/src/x86/ffitarget.h
+++ b/Modules/_ctypes/libffi/src/x86/ffitarget.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc.
+ ffitarget.h - Copyright (c) 1996-2003, 2010 Red Hat, Inc.
Copyright (C) 2008 Free Software Foundation, Inc.
Target configuration macros for x86 and x86-64.
@@ -36,11 +36,26 @@
#define X86
#endif
+#ifdef X86_WIN64
+#define FFI_SIZEOF_ARG 8
+#define USE_BUILTIN_FFS 0 // not yet implemented in mingw-64
+#endif
+
/* ---- Generic type definitions ----------------------------------------- */
#ifndef LIBFFI_ASM
+#ifdef X86_WIN64
+#ifdef _MSC_VER
+typedef unsigned __int64 ffi_arg;
+typedef __int64 ffi_sarg;
+#else
+typedef unsigned long long ffi_arg;
+typedef long long ffi_sarg;
+#endif
+#else
typedef unsigned long ffi_arg;
typedef signed long ffi_sarg;
+#endif
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
@@ -53,16 +68,22 @@ typedef enum ffi_abi {
FFI_DEFAULT_ABI = FFI_SYSV,
#endif
+#ifdef X86_WIN64
+ FFI_WIN64,
+ FFI_DEFAULT_ABI = FFI_WIN64,
+#else
+
/* ---- Intel x86 and AMD x86-64 - */
-#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__))
+#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__) || defined(__i386) || defined(__amd64))
FFI_SYSV,
FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */
-#ifdef __i386__
+#if defined(__i386__) || defined(__i386)
FFI_DEFAULT_ABI = FFI_SYSV,
#else
FFI_DEFAULT_ABI = FFI_UNIX64,
#endif
#endif
+#endif /* X86_WIN64 */
FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
} ffi_abi;
@@ -73,6 +94,7 @@ typedef enum ffi_abi {
#define FFI_CLOSURES 1
#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1)
#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2)
+#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3)
#if defined (X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
#define FFI_TRAMPOLINE_SIZE 24
@@ -81,10 +103,18 @@ typedef enum ffi_abi {
#ifdef X86_WIN32
#define FFI_TRAMPOLINE_SIZE 13
#else
+#ifdef X86_WIN64
+#define FFI_TRAMPOLINE_SIZE 29
+#define FFI_NATIVE_RAW_API 0
+#define FFI_NO_RAW_API 1
+#else
#define FFI_TRAMPOLINE_SIZE 10
#endif
+#endif
+#ifndef X86_WIN64
#define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */
#endif
+#endif
#endif
diff --git a/Modules/_ctypes/libffi/src/x86/sysv.S b/Modules/_ctypes/libffi/src/x86/sysv.S
index 2711fdeddf..f4b6c1e441 100644
--- a/Modules/_ctypes/libffi/src/x86/sysv.S
+++ b/Modules/_ctypes/libffi/src/x86/sysv.S
@@ -242,9 +242,20 @@ ffi_closure_SYSV:
#if !FFI_NO_RAW_API
+/* Precalculate for e.g. the Solaris 10/x86 assembler. */
+#if FFI_TRAMPOLINE_SIZE == 10
+#define RAW_CLOSURE_CIF_OFFSET 12
+#define RAW_CLOSURE_FUN_OFFSET 16
+#define RAW_CLOSURE_USER_DATA_OFFSET 20
+#elif FFI_TRAMPOLINE_SIZE == 24
+#define RAW_CLOSURE_CIF_OFFSET 24
+#define RAW_CLOSURE_FUN_OFFSET 28
+#define RAW_CLOSURE_USER_DATA_OFFSET 32
+#else
#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
+#endif
#define CIF_FLAGS_OFFSET 20
.align 4
@@ -343,10 +354,12 @@ ffi_closure_raw_SYSV:
.long .LEFDE1-.LASFDE1 /* FDE Length */
.LASFDE1:
.long .LASFDE1-.Lframe1 /* FDE CIE offset */
-#ifdef __PIC__
+#if defined __PIC__ && defined HAVE_AS_X86_PCREL
.long .LFB1-. /* FDE initial location */
+#elif defined __PIC__
+ .long .LFB1@rel
#else
- .long .LFB1 /* FDE initial location */
+ .long .LFB1
#endif
.long .LFE1-.LFB1 /* FDE address range */
#ifdef __PIC__
@@ -368,8 +381,10 @@ ffi_closure_raw_SYSV:
.long .LEFDE2-.LASFDE2 /* FDE Length */
.LASFDE2:
.long .LASFDE2-.Lframe1 /* FDE CIE offset */
-#ifdef __PIC__
+#if defined __PIC__ && defined HAVE_AS_X86_PCREL
.long .LFB2-. /* FDE initial location */
+#elif defined __PIC__
+ .long .LFB2@rel
#else
.long .LFB2
#endif
@@ -402,8 +417,10 @@ ffi_closure_raw_SYSV:
.long .LEFDE3-.LASFDE3 /* FDE Length */
.LASFDE3:
.long .LASFDE3-.Lframe1 /* FDE CIE offset */
-#ifdef __PIC__
+#if defined __PIC__ && defined HAVE_AS_X86_PCREL
.long .LFB3-. /* FDE initial location */
+#elif defined __PIC__
+ .long .LFB3@rel
#else
.long .LFB3
#endif
diff --git a/Modules/_ctypes/libffi/src/x86/unix64.S b/Modules/_ctypes/libffi/src/x86/unix64.S
index 046564d1b3..fe3f4fd622 100644
--- a/Modules/_ctypes/libffi/src/x86/unix64.S
+++ b/Modules/_ctypes/libffi/src/x86/unix64.S
@@ -89,7 +89,6 @@ ffi_call_unix64:
addq %r11, %r10
jmp *%r10
- .section .rodata
.Lstore_table:
.long .Lst_void-.Lstore_table /* FFI_TYPE_VOID */
.long .Lst_sint32-.Lstore_table /* FFI_TYPE_INT */
@@ -107,7 +106,6 @@ ffi_call_unix64:
.long .Lst_struct-.Lstore_table /* FFI_TYPE_STRUCT */
.long .Lst_int64-.Lstore_table /* FFI_TYPE_POINTER */
- .text
.align 2
.Lst_void:
ret
@@ -240,7 +238,6 @@ ffi_closure_unix64:
addq %r11, %r10
jmp *%r10
- .section .rodata
.Lload_table:
.long .Lld_void-.Lload_table /* FFI_TYPE_VOID */
.long .Lld_int32-.Lload_table /* FFI_TYPE_INT */
@@ -258,7 +255,6 @@ ffi_closure_unix64:
.long .Lld_struct-.Lload_table /* FFI_TYPE_STRUCT */
.long .Lld_int64-.Lload_table /* FFI_TYPE_POINTER */
- .text
.align 2
.Lld_void:
ret
@@ -351,7 +347,11 @@ ffi_closure_unix64:
.long .LEFDE1-.LASFDE1 /* FDE Length */
.LASFDE1:
.long .LASFDE1-.Lframe1 /* FDE CIE offset */
+#if HAVE_AS_X86_PCREL
.long .LUW0-. /* FDE initial location */
+#else
+ .long .LUW0@rel
+#endif
.long .LUW4-.LUW0 /* FDE address range */
.uleb128 0x0 /* Augmentation size */
@@ -389,7 +389,11 @@ ffi_closure_unix64:
.long .LEFDE3-.LASFDE3 /* FDE Length */
.LASFDE3:
.long .LASFDE3-.Lframe1 /* FDE CIE offset */
+#if HAVE_AS_X86_PCREL
.long .LUW5-. /* FDE initial location */
+#else
+ .long .LUW5@rel
+#endif
.long .LUW9-.LUW5 /* FDE address range */
.uleb128 0x0 /* Augmentation size */
diff --git a/Modules/_ctypes/libffi/src/x86/win32.S b/Modules/_ctypes/libffi/src/x86/win32.S
index eba11c1647..ac1ed6f942 100644
--- a/Modules/_ctypes/libffi/src/x86/win32.S
+++ b/Modules/_ctypes/libffi/src/x86/win32.S
@@ -1,7 +1,8 @@
/* -----------------------------------------------------------------------
- win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc.
+ win32.S - Copyright (c) 1996, 1998, 2001, 2002, 2009 Red Hat, Inc.
Copyright (c) 2001 John Beniton
Copyright (c) 2002 Ranjit Mathew
+ Copyright (c) 2009 Daniel Witte
X86 Foreign Function Interface
@@ -17,32 +18,390 @@
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ -----------------------------------------------------------------------
+ */
#define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h>
-
-.text
-
-.globl ffi_prep_args
+
+#ifdef _MSC_VER
+
+.386
+.MODEL FLAT, C
+
+EXTRN ffi_closure_SYSV_inner:NEAR
+
+_TEXT SEGMENT
+
+ffi_call_win32 PROC NEAR,
+ ffi_prep_args : NEAR PTR DWORD,
+ ecif : NEAR PTR DWORD,
+ cif_bytes : DWORD,
+ cif_flags : DWORD,
+ rvalue : NEAR PTR DWORD,
+ fn : NEAR PTR DWORD
+
+ ;; Make room for all of the new args.
+ mov ecx, cif_bytes
+ sub esp, ecx
+
+ mov eax, esp
+
+ ;; Place all of the ffi_prep_args in position
+ push ecif
+ push eax
+ call ffi_prep_args
+
+ ;; Return stack to previous state and call the function
+ add esp, 8
+
+ call fn
+
+ ;; cdecl: we restore esp in the epilogue, so there's no need to
+ ;; remove the space we pushed for the args.
+ ;; stdcall: the callee has already cleaned the stack.
+
+ ;; Load ecx with the return type code
+ mov ecx, cif_flags
+
+ ;; If the return value pointer is NULL, assume no return value.
+ cmp rvalue, 0
+ jne ca_jumptable
+
+ ;; Even if there is no space for the return value, we are
+ ;; obliged to handle floating-point values.
+ cmp ecx, FFI_TYPE_FLOAT
+ jne ca_epilogue
+ fstp st(0)
+
+ jmp ca_epilogue
+
+ca_jumptable:
+ jmp [ca_jumpdata + 4 * ecx]
+ca_jumpdata:
+ ;; Do not insert anything here between label and jump table.
+ dd offset ca_epilogue ;; FFI_TYPE_VOID
+ dd offset ca_retint ;; FFI_TYPE_INT
+ dd offset ca_retfloat ;; FFI_TYPE_FLOAT
+ dd offset ca_retdouble ;; FFI_TYPE_DOUBLE
+ dd offset ca_retlongdouble ;; FFI_TYPE_LONGDOUBLE
+ dd offset ca_retint8 ;; FFI_TYPE_UINT8
+ dd offset ca_retint8 ;; FFI_TYPE_SINT8
+ dd offset ca_retint16 ;; FFI_TYPE_UINT16
+ dd offset ca_retint16 ;; FFI_TYPE_SINT16
+ dd offset ca_retint ;; FFI_TYPE_UINT32
+ dd offset ca_retint ;; FFI_TYPE_SINT32
+ dd offset ca_retint64 ;; FFI_TYPE_UINT64
+ dd offset ca_retint64 ;; FFI_TYPE_SINT64
+ dd offset ca_epilogue ;; FFI_TYPE_STRUCT
+ dd offset ca_retint ;; FFI_TYPE_POINTER
+ dd offset ca_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B
+ dd offset ca_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B
+ dd offset ca_retint ;; FFI_TYPE_SMALL_STRUCT_4B
+
+ca_retint8:
+ ;; Load %ecx with the pointer to storage for the return value
+ mov ecx, rvalue
+ mov [ecx + 0], al
+ jmp ca_epilogue
+
+ca_retint16:
+ ;; Load %ecx with the pointer to storage for the return value
+ mov ecx, rvalue
+ mov [ecx + 0], ax
+ jmp ca_epilogue
+
+ca_retint:
+ ;; Load %ecx with the pointer to storage for the return value
+ mov ecx, rvalue
+ mov [ecx + 0], eax
+ jmp ca_epilogue
+
+ca_retint64:
+ ;; Load %ecx with the pointer to storage for the return value
+ mov ecx, rvalue
+ mov [ecx + 0], eax
+ mov [ecx + 4], edx
+ jmp ca_epilogue
+
+ca_retfloat:
+ ;; Load %ecx with the pointer to storage for the return value
+ mov ecx, rvalue
+ fstp DWORD PTR [ecx]
+ jmp ca_epilogue
+
+ca_retdouble:
+ ;; Load %ecx with the pointer to storage for the return value
+ mov ecx, rvalue
+ fstp QWORD PTR [ecx]
+ jmp ca_epilogue
+
+ca_retlongdouble:
+ ;; Load %ecx with the pointer to storage for the return value
+ mov ecx, rvalue
+ fstp TBYTE PTR [ecx]
+ jmp ca_epilogue
+
+ca_epilogue:
+ ;; Epilogue code is autogenerated.
+ ret
+ffi_call_win32 ENDP
+
+ffi_closure_SYSV PROC NEAR FORCEFRAME
+ ;; the ffi_closure ctx is passed in eax by the trampoline.
+
+ sub esp, 40
+ lea edx, [ebp - 24]
+ mov [ebp - 12], edx ;; resp
+ lea edx, [ebp + 8]
+ mov [esp + 8], edx ;; args
+ lea edx, [ebp - 12]
+ mov [esp + 4], edx ;; &resp
+ mov [esp], eax ;; closure
+ call ffi_closure_SYSV_inner
+ mov ecx, [ebp - 12]
+
+cs_jumptable:
+ jmp [cs_jumpdata + 4 * eax]
+cs_jumpdata:
+ ;; Do not insert anything here between the label and jump table.
+ dd offset cs_epilogue ;; FFI_TYPE_VOID
+ dd offset cs_retint ;; FFI_TYPE_INT
+ dd offset cs_retfloat ;; FFI_TYPE_FLOAT
+ dd offset cs_retdouble ;; FFI_TYPE_DOUBLE
+ dd offset cs_retlongdouble ;; FFI_TYPE_LONGDOUBLE
+ dd offset cs_retint8 ;; FFI_TYPE_UINT8
+ dd offset cs_retint8 ;; FFI_TYPE_SINT8
+ dd offset cs_retint16 ;; FFI_TYPE_UINT16
+ dd offset cs_retint16 ;; FFI_TYPE_SINT16
+ dd offset cs_retint ;; FFI_TYPE_UINT32
+ dd offset cs_retint ;; FFI_TYPE_SINT32
+ dd offset cs_retint64 ;; FFI_TYPE_UINT64
+ dd offset cs_retint64 ;; FFI_TYPE_SINT64
+ dd offset cs_retstruct ;; FFI_TYPE_STRUCT
+ dd offset cs_retint ;; FFI_TYPE_POINTER
+ dd offset cs_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B
+ dd offset cs_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B
+ dd offset cs_retint ;; FFI_TYPE_SMALL_STRUCT_4B
+
+cs_retint8:
+ mov al, [ecx]
+ jmp cs_epilogue
+
+cs_retint16:
+ mov ax, [ecx]
+ jmp cs_epilogue
+
+cs_retint:
+ mov eax, [ecx]
+ jmp cs_epilogue
+
+cs_retint64:
+ mov eax, [ecx + 0]
+ mov edx, [ecx + 4]
+ jmp cs_epilogue
+
+cs_retfloat:
+ fld DWORD PTR [ecx]
+ jmp cs_epilogue
+
+cs_retdouble:
+ fld QWORD PTR [ecx]
+ jmp cs_epilogue
+
+cs_retlongdouble:
+ fld TBYTE PTR [ecx]
+ jmp cs_epilogue
+
+cs_retstruct:
+ ;; Caller expects us to pop struct return value pointer hidden arg.
+ ;; Epilogue code is autogenerated.
+ ret 4
+
+cs_epilogue:
+ ;; Epilogue code is autogenerated.
+ ret
+ffi_closure_SYSV ENDP
+
+#if !FFI_NO_RAW_API
+
+#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3)
+#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
+#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
+#define CIF_FLAGS_OFFSET 20
+
+ffi_closure_raw_SYSV PROC NEAR USES esi
+ ;; the ffi_closure ctx is passed in eax by the trampoline.
+
+ sub esp, 40
+ mov esi, [eax + RAW_CLOSURE_CIF_OFFSET] ;; closure->cif
+ mov edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET] ;; closure->user_data
+ mov [esp + 12], edx ;; user_data
+ lea edx, [ebp + 8]
+ mov [esp + 8], edx ;; raw_args
+ lea edx, [ebp - 24]
+ mov [esp + 4], edx ;; &res
+ mov [esp], esi ;; cif
+ call DWORD PTR [eax + RAW_CLOSURE_FUN_OFFSET] ;; closure->fun
+ mov eax, [esi + CIF_FLAGS_OFFSET] ;; cif->flags
+ lea ecx, [ebp - 24]
+
+cr_jumptable:
+ jmp [cr_jumpdata + 4 * eax]
+cr_jumpdata:
+ ;; Do not insert anything here between the label and jump table.
+ dd offset cr_epilogue ;; FFI_TYPE_VOID
+ dd offset cr_retint ;; FFI_TYPE_INT
+ dd offset cr_retfloat ;; FFI_TYPE_FLOAT
+ dd offset cr_retdouble ;; FFI_TYPE_DOUBLE
+ dd offset cr_retlongdouble ;; FFI_TYPE_LONGDOUBLE
+ dd offset cr_retint8 ;; FFI_TYPE_UINT8
+ dd offset cr_retint8 ;; FFI_TYPE_SINT8
+ dd offset cr_retint16 ;; FFI_TYPE_UINT16
+ dd offset cr_retint16 ;; FFI_TYPE_SINT16
+ dd offset cr_retint ;; FFI_TYPE_UINT32
+ dd offset cr_retint ;; FFI_TYPE_SINT32
+ dd offset cr_retint64 ;; FFI_TYPE_UINT64
+ dd offset cr_retint64 ;; FFI_TYPE_SINT64
+ dd offset cr_epilogue ;; FFI_TYPE_STRUCT
+ dd offset cr_retint ;; FFI_TYPE_POINTER
+ dd offset cr_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B
+ dd offset cr_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B
+ dd offset cr_retint ;; FFI_TYPE_SMALL_STRUCT_4B
+
+cr_retint8:
+ mov al, [ecx]
+ jmp cr_epilogue
+
+cr_retint16:
+ mov ax, [ecx]
+ jmp cr_epilogue
+
+cr_retint:
+ mov eax, [ecx]
+ jmp cr_epilogue
+
+cr_retint64:
+ mov eax, [ecx + 0]
+ mov edx, [ecx + 4]
+ jmp cr_epilogue
+
+cr_retfloat:
+ fld DWORD PTR [ecx]
+ jmp cr_epilogue
+
+cr_retdouble:
+ fld QWORD PTR [ecx]
+ jmp cr_epilogue
+
+cr_retlongdouble:
+ fld TBYTE PTR [ecx]
+ jmp cr_epilogue
+
+cr_epilogue:
+ ;; Epilogue code is autogenerated.
+ ret
+ffi_closure_raw_SYSV ENDP
+
+#endif /* !FFI_NO_RAW_API */
+
+ffi_closure_STDCALL PROC NEAR FORCEFRAME
+ ;; the ffi_closure ctx is passed in eax by the trampoline.
+
+ sub esp, 40
+ lea edx, [ebp - 24]
+ mov [ebp - 12], edx ;; resp
+ lea edx, [ebp + 12] ;; account for stub return address on stack
+ mov [esp + 8], edx ;; args
+ lea edx, [ebp - 12]
+ mov [esp + 4], edx ;; &resp
+ mov [esp], eax ;; closure
+ call ffi_closure_SYSV_inner
+ mov ecx, [ebp - 12]
+
+cd_jumptable:
+ jmp [cd_jumpdata + 4 * eax]
+cd_jumpdata:
+ ;; Do not insert anything here between the label and jump table.
+ dd offset cd_epilogue ;; FFI_TYPE_VOID
+ dd offset cd_retint ;; FFI_TYPE_INT
+ dd offset cd_retfloat ;; FFI_TYPE_FLOAT
+ dd offset cd_retdouble ;; FFI_TYPE_DOUBLE
+ dd offset cd_retlongdouble ;; FFI_TYPE_LONGDOUBLE
+ dd offset cd_retint8 ;; FFI_TYPE_UINT8
+ dd offset cd_retint8 ;; FFI_TYPE_SINT8
+ dd offset cd_retint16 ;; FFI_TYPE_UINT16
+ dd offset cd_retint16 ;; FFI_TYPE_SINT16
+ dd offset cd_retint ;; FFI_TYPE_UINT32
+ dd offset cd_retint ;; FFI_TYPE_SINT32
+ dd offset cd_retint64 ;; FFI_TYPE_UINT64
+ dd offset cd_retint64 ;; FFI_TYPE_SINT64
+ dd offset cd_epilogue ;; FFI_TYPE_STRUCT
+ dd offset cd_retint ;; FFI_TYPE_POINTER
+ dd offset cd_retint8 ;; FFI_TYPE_SMALL_STRUCT_1B
+ dd offset cd_retint16 ;; FFI_TYPE_SMALL_STRUCT_2B
+ dd offset cd_retint ;; FFI_TYPE_SMALL_STRUCT_4B
+
+cd_retint8:
+ mov al, [ecx]
+ jmp cd_epilogue
+
+cd_retint16:
+ mov ax, [ecx]
+ jmp cd_epilogue
+
+cd_retint:
+ mov eax, [ecx]
+ jmp cd_epilogue
+
+cd_retint64:
+ mov eax, [ecx + 0]
+ mov edx, [ecx + 4]
+ jmp cd_epilogue
+
+cd_retfloat:
+ fld DWORD PTR [ecx]
+ jmp cd_epilogue
+
+cd_retdouble:
+ fld QWORD PTR [ecx]
+ jmp cd_epilogue
+
+cd_retlongdouble:
+ fld TBYTE PTR [ecx]
+ jmp cd_epilogue
+
+cd_epilogue:
+ ;; Epilogue code is autogenerated.
+ ret
+ffi_closure_STDCALL ENDP
+
+_TEXT ENDS
+END
+
+#else
+
+ .text
# This assumes we are using gas.
.balign 16
-.globl _ffi_call_SYSV
-
-_ffi_call_SYSV:
+ .globl _ffi_call_win32
+ .def _ffi_call_win32; .scl 2; .type 32; .endef
+_ffi_call_win32:
+.LFB1:
pushl %ebp
+.LCFI0:
movl %esp,%ebp
-
+.LCFI1:
# Make room for all of the new args.
movl 16(%ebp),%ecx
subl %ecx,%esp
@@ -60,225 +419,141 @@ _ffi_call_SYSV:
# FIXME: Align the stack to a 128-bit boundary to avoid
# potential performance hits.
- call *28(%ebp)
-
- # Remove the space we pushed for the args
- movl 16(%ebp),%ecx
- addl %ecx,%esp
+ call *28(%ebp)
+ # stdcall functions pop arguments off the stack themselves
+
# Load %ecx with the return type code
movl 20(%ebp),%ecx
# If the return value pointer is NULL, assume no return value.
cmpl $0,24(%ebp)
- jne retint
+ jne 0f
# Even if there is no space for the return value, we are
# obliged to handle floating-point values.
cmpl $FFI_TYPE_FLOAT,%ecx
- jne noretval
+ jne .Lnoretval
fstp %st(0)
- jmp epilogue
-
-retint:
- cmpl $FFI_TYPE_INT,%ecx
- jne retfloat
+ jmp .Lepilogue
+
+0:
+ call 1f
+ # Do not insert anything here between the call and the jump table.
+.Lstore_table:
+ .long .Lnoretval /* FFI_TYPE_VOID */
+ .long .Lretint /* FFI_TYPE_INT */
+ .long .Lretfloat /* FFI_TYPE_FLOAT */
+ .long .Lretdouble /* FFI_TYPE_DOUBLE */
+ .long .Lretlongdouble /* FFI_TYPE_LONGDOUBLE */
+ .long .Lretuint8 /* FFI_TYPE_UINT8 */
+ .long .Lretsint8 /* FFI_TYPE_SINT8 */
+ .long .Lretuint16 /* FFI_TYPE_UINT16 */
+ .long .Lretsint16 /* FFI_TYPE_SINT16 */
+ .long .Lretint /* FFI_TYPE_UINT32 */
+ .long .Lretint /* FFI_TYPE_SINT32 */
+ .long .Lretint64 /* FFI_TYPE_UINT64 */
+ .long .Lretint64 /* FFI_TYPE_SINT64 */
+ .long .Lretstruct /* FFI_TYPE_STRUCT */
+ .long .Lretint /* FFI_TYPE_POINTER */
+ .long .Lretstruct1b /* FFI_TYPE_SMALL_STRUCT_1B */
+ .long .Lretstruct2b /* FFI_TYPE_SMALL_STRUCT_2B */
+ .long .Lretstruct4b /* FFI_TYPE_SMALL_STRUCT_4B */
+1:
+ add %ecx, %ecx
+ add %ecx, %ecx
+ add (%esp),%ecx
+ add $4, %esp
+ jmp *(%ecx)
+
+ /* Sign/zero extend as appropriate. */
+.Lretsint8:
+ movsbl %al, %eax
+ jmp .Lretint
+
+.Lretsint16:
+ movswl %ax, %eax
+ jmp .Lretint
+
+.Lretuint8:
+ movzbl %al, %eax
+ jmp .Lretint
+
+.Lretuint16:
+ movzwl %ax, %eax
+ jmp .Lretint
+
+.Lretint:
# Load %ecx with the pointer to storage for the return value
movl 24(%ebp),%ecx
movl %eax,0(%ecx)
- jmp epilogue
+ jmp .Lepilogue
-retfloat:
- cmpl $FFI_TYPE_FLOAT,%ecx
- jne retdouble
+.Lretfloat:
# Load %ecx with the pointer to storage for the return value
movl 24(%ebp),%ecx
fstps (%ecx)
- jmp epilogue
+ jmp .Lepilogue
-retdouble:
- cmpl $FFI_TYPE_DOUBLE,%ecx
- jne retlongdouble
+.Lretdouble:
# Load %ecx with the pointer to storage for the return value
movl 24(%ebp),%ecx
fstpl (%ecx)
- jmp epilogue
+ jmp .Lepilogue
-retlongdouble:
- cmpl $FFI_TYPE_LONGDOUBLE,%ecx
- jne retint64
+.Lretlongdouble:
# Load %ecx with the pointer to storage for the return value
movl 24(%ebp),%ecx
fstpt (%ecx)
- jmp epilogue
+ jmp .Lepilogue
-retint64:
- cmpl $FFI_TYPE_SINT64,%ecx
- jne retstruct1b
+.Lretint64:
# Load %ecx with the pointer to storage for the return value
movl 24(%ebp),%ecx
movl %eax,0(%ecx)
movl %edx,4(%ecx)
-
-retstruct1b:
- cmpl $FFI_TYPE_SINT8,%ecx
- jne retstruct2b
+ jmp .Lepilogue
+
+.Lretstruct1b:
# Load %ecx with the pointer to storage for the return value
movl 24(%ebp),%ecx
movb %al,0(%ecx)
- jmp epilogue
+ jmp .Lepilogue
-retstruct2b:
- cmpl $FFI_TYPE_SINT16,%ecx
- jne retstruct
+.Lretstruct2b:
# Load %ecx with the pointer to storage for the return value
movl 24(%ebp),%ecx
movw %ax,0(%ecx)
- jmp epilogue
-
-retstruct:
- # Nothing to do!
-
-noretval:
-epilogue:
- movl %ebp,%esp
- popl %ebp
- ret
-
-.ffi_call_SYSV_end:
-
- # This assumes we are using gas.
- .balign 16
-.globl _ffi_call_STDCALL
-
-_ffi_call_STDCALL:
- pushl %ebp
- movl %esp,%ebp
-
- # Make room for all of the new args.
- movl 16(%ebp),%ecx
- subl %ecx,%esp
-
- movl %esp,%eax
-
- # Place all of the ffi_prep_args in position
- pushl 12(%ebp)
- pushl %eax
- call *8(%ebp)
-
- # Return stack to previous state and call the function
- addl $8,%esp
-
- # FIXME: Align the stack to a 128-bit boundary to avoid
- # potential performance hits.
-
- call *28(%ebp)
-
- # stdcall functions pop arguments off the stack themselves
+ jmp .Lepilogue
- # Load %ecx with the return type code
- movl 20(%ebp),%ecx
-
- # If the return value pointer is NULL, assume no return value.
- cmpl $0,24(%ebp)
- jne sc_retint
-
- # Even if there is no space for the return value, we are
- # obliged to handle floating-point values.
- cmpl $FFI_TYPE_FLOAT,%ecx
- jne sc_noretval
- fstp %st(0)
-
- jmp sc_epilogue
-
-sc_retint:
- cmpl $FFI_TYPE_INT,%ecx
- jne sc_retfloat
- # Load %ecx with the pointer to storage for the return value
- movl 24(%ebp),%ecx
- movl %eax,0(%ecx)
- jmp sc_epilogue
-
-sc_retfloat:
- cmpl $FFI_TYPE_FLOAT,%ecx
- jne sc_retdouble
- # Load %ecx with the pointer to storage for the return value
- movl 24(%ebp),%ecx
- fstps (%ecx)
- jmp sc_epilogue
-
-sc_retdouble:
- cmpl $FFI_TYPE_DOUBLE,%ecx
- jne sc_retlongdouble
- # Load %ecx with the pointer to storage for the return value
- movl 24(%ebp),%ecx
- fstpl (%ecx)
- jmp sc_epilogue
-
-sc_retlongdouble:
- cmpl $FFI_TYPE_LONGDOUBLE,%ecx
- jne sc_retint64
- # Load %ecx with the pointer to storage for the return value
- movl 24(%ebp),%ecx
- fstpt (%ecx)
- jmp sc_epilogue
-
-sc_retint64:
- cmpl $FFI_TYPE_SINT64,%ecx
- jne sc_retstruct1b
+.Lretstruct4b:
# Load %ecx with the pointer to storage for the return value
movl 24(%ebp),%ecx
movl %eax,0(%ecx)
- movl %edx,4(%ecx)
+ jmp .Lepilogue
-sc_retstruct1b:
- cmpl $FFI_TYPE_SINT8,%ecx
- jne sc_retstruct2b
- # Load %ecx with the pointer to storage for the return value
- movl 24(%ebp),%ecx
- movb %al,0(%ecx)
- jmp sc_epilogue
-
-sc_retstruct2b:
- cmpl $FFI_TYPE_SINT16,%ecx
- jne sc_retstruct
- # Load %ecx with the pointer to storage for the return value
- movl 24(%ebp),%ecx
- movw %ax,0(%ecx)
- jmp sc_epilogue
-
-sc_retstruct:
+.Lretstruct:
# Nothing to do!
-
-sc_noretval:
-sc_epilogue:
+
+.Lnoretval:
+.Lepilogue:
movl %ebp,%esp
popl %ebp
ret
+.ffi_call_win32_end:
+.LFE1:
-.ffi_call_STDCALL_end:
-
- .globl _ffi_closure_STDCALL
-_ffi_closure_STDCALL:
- pushl %ebp
- movl %esp, %ebp
- subl $40, %esp
- leal -24(%ebp), %edx
- movl %edx, -12(%ebp) /* resp */
- leal 12(%ebp), %edx /* account for stub return address on stack */
- movl %edx, 4(%esp) /* args */
- leal -12(%ebp), %edx
- movl %edx, (%esp) /* &resp */
- call _ffi_closure_SYSV_inner
- movl -12(%ebp), %ecx
- jmp .Lcls_return_result
-.ffi_closure_STDCALL_end:
-
- .globl _ffi_closure_SYSV
+ # This assumes we are using gas.
+ .balign 16
+ .globl _ffi_closure_SYSV
+ .def _ffi_closure_SYSV; .scl 2; .type 32; .endef
_ffi_closure_SYSV:
+.LFB3:
pushl %ebp
+.LCFI4:
movl %esp, %ebp
+.LCFI5:
subl $40, %esp
leal -24(%ebp), %edx
movl %edx, -12(%ebp) /* resp */
@@ -288,48 +563,100 @@ _ffi_closure_SYSV:
movl %edx, (%esp) /* &resp */
call _ffi_closure_SYSV_inner
movl -12(%ebp), %ecx
-.Lcls_return_result:
- cmpl $FFI_TYPE_INT, %eax
- je .Lcls_retint
- cmpl $FFI_TYPE_FLOAT, %eax
- je .Lcls_retfloat
- cmpl $FFI_TYPE_DOUBLE, %eax
- je .Lcls_retdouble
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
- je .Lcls_retldouble
- cmpl $FFI_TYPE_SINT64, %eax
- je .Lcls_retllong
- cmpl $FFI_TYPE_SINT8, %eax /* 1-byte struct */
- je .Lcls_retstruct1
- cmpl $FFI_TYPE_SINT16, %eax /* 2-bytes struct */
- je .Lcls_retstruct2
-.Lcls_epilogue:
- movl %ebp, %esp
- popl %ebp
- ret
+
+0:
+ call 1f
+ # Do not insert anything here between the call and the jump table.
+.Lcls_store_table:
+ .long .Lcls_noretval /* FFI_TYPE_VOID */
+ .long .Lcls_retint /* FFI_TYPE_INT */
+ .long .Lcls_retfloat /* FFI_TYPE_FLOAT */
+ .long .Lcls_retdouble /* FFI_TYPE_DOUBLE */
+ .long .Lcls_retldouble /* FFI_TYPE_LONGDOUBLE */
+ .long .Lcls_retuint8 /* FFI_TYPE_UINT8 */
+ .long .Lcls_retsint8 /* FFI_TYPE_SINT8 */
+ .long .Lcls_retuint16 /* FFI_TYPE_UINT16 */
+ .long .Lcls_retsint16 /* FFI_TYPE_SINT16 */
+ .long .Lcls_retint /* FFI_TYPE_UINT32 */
+ .long .Lcls_retint /* FFI_TYPE_SINT32 */
+ .long .Lcls_retllong /* FFI_TYPE_UINT64 */
+ .long .Lcls_retllong /* FFI_TYPE_SINT64 */
+ .long .Lcls_retstruct /* FFI_TYPE_STRUCT */
+ .long .Lcls_retint /* FFI_TYPE_POINTER */
+ .long .Lcls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */
+ .long .Lcls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */
+ .long .Lcls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */
+
+1:
+ add %eax, %eax
+ add %eax, %eax
+ add (%esp),%eax
+ add $4, %esp
+ jmp *(%eax)
+
+ /* Sign/zero extend as appropriate. */
+.Lcls_retsint8:
+ movsbl (%ecx), %eax
+ jmp .Lcls_epilogue
+
+.Lcls_retsint16:
+ movswl (%ecx), %eax
+ jmp .Lcls_epilogue
+
+.Lcls_retuint8:
+ movzbl (%ecx), %eax
+ jmp .Lcls_epilogue
+
+.Lcls_retuint16:
+ movzwl (%ecx), %eax
+ jmp .Lcls_epilogue
+
.Lcls_retint:
movl (%ecx), %eax
jmp .Lcls_epilogue
+
.Lcls_retfloat:
flds (%ecx)
jmp .Lcls_epilogue
+
.Lcls_retdouble:
fldl (%ecx)
jmp .Lcls_epilogue
+
.Lcls_retldouble:
fldt (%ecx)
jmp .Lcls_epilogue
+
.Lcls_retllong:
movl (%ecx), %eax
movl 4(%ecx), %edx
jmp .Lcls_epilogue
+
.Lcls_retstruct1:
movsbl (%ecx), %eax
jmp .Lcls_epilogue
+
.Lcls_retstruct2:
movswl (%ecx), %eax
jmp .Lcls_epilogue
+
+.Lcls_retstruct4:
+ movl (%ecx), %eax
+ jmp .Lcls_epilogue
+
+.Lcls_retstruct:
+ # Caller expects us to pop struct return value pointer hidden arg.
+ movl %ebp, %esp
+ popl %ebp
+ ret $0x4
+
+.Lcls_noretval:
+.Lcls_epilogue:
+ movl %ebp, %esp
+ popl %ebp
+ ret
.ffi_closure_SYSV_end:
+.LFE3:
#if !FFI_NO_RAW_API
@@ -338,12 +665,18 @@ _ffi_closure_SYSV:
#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
#define CIF_FLAGS_OFFSET 20
- .balign 16
- .globl _ffi_closure_raw_SYSV
+ # This assumes we are using gas.
+ .balign 16
+ .globl _ffi_closure_raw_SYSV
+ .def _ffi_closure_raw_SYSV; .scl 2; .type 32; .endef
_ffi_closure_raw_SYSV:
+.LFB4:
pushl %ebp
+.LCFI6:
movl %esp, %ebp
+.LCFI7:
pushl %esi
+.LCFI8:
subl $36, %esp
movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */
movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
@@ -355,37 +688,368 @@ _ffi_closure_raw_SYSV:
movl %esi, (%esp) /* cif */
call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */
movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */
- cmpl $FFI_TYPE_INT, %eax
- je .Lrcls_retint
- cmpl $FFI_TYPE_FLOAT, %eax
- je .Lrcls_retfloat
- cmpl $FFI_TYPE_DOUBLE, %eax
- je .Lrcls_retdouble
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
- je .Lrcls_retldouble
- cmpl $FFI_TYPE_SINT64, %eax
- je .Lrcls_retllong
-.Lrcls_epilogue:
- addl $36, %esp
- popl %esi
- popl %ebp
- ret
+0:
+ call 1f
+ # Do not insert anything here between the call and the jump table.
+.Lrcls_store_table:
+ .long .Lrcls_noretval /* FFI_TYPE_VOID */
+ .long .Lrcls_retint /* FFI_TYPE_INT */
+ .long .Lrcls_retfloat /* FFI_TYPE_FLOAT */
+ .long .Lrcls_retdouble /* FFI_TYPE_DOUBLE */
+ .long .Lrcls_retldouble /* FFI_TYPE_LONGDOUBLE */
+ .long .Lrcls_retuint8 /* FFI_TYPE_UINT8 */
+ .long .Lrcls_retsint8 /* FFI_TYPE_SINT8 */
+ .long .Lrcls_retuint16 /* FFI_TYPE_UINT16 */
+ .long .Lrcls_retsint16 /* FFI_TYPE_SINT16 */
+ .long .Lrcls_retint /* FFI_TYPE_UINT32 */
+ .long .Lrcls_retint /* FFI_TYPE_SINT32 */
+ .long .Lrcls_retllong /* FFI_TYPE_UINT64 */
+ .long .Lrcls_retllong /* FFI_TYPE_SINT64 */
+ .long .Lrcls_retstruct /* FFI_TYPE_STRUCT */
+ .long .Lrcls_retint /* FFI_TYPE_POINTER */
+ .long .Lrcls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */
+ .long .Lrcls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */
+ .long .Lrcls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */
+1:
+ add %eax, %eax
+ add %eax, %eax
+ add (%esp),%eax
+ add $4, %esp
+ jmp *(%eax)
+
+ /* Sign/zero extend as appropriate. */
+.Lrcls_retsint8:
+ movsbl -24(%ebp), %eax
+ jmp .Lrcls_epilogue
+
+.Lrcls_retsint16:
+ movswl -24(%ebp), %eax
+ jmp .Lrcls_epilogue
+
+.Lrcls_retuint8:
+ movzbl -24(%ebp), %eax
+ jmp .Lrcls_epilogue
+
+.Lrcls_retuint16:
+ movzwl -24(%ebp), %eax
+ jmp .Lrcls_epilogue
+
.Lrcls_retint:
movl -24(%ebp), %eax
jmp .Lrcls_epilogue
+
.Lrcls_retfloat:
flds -24(%ebp)
jmp .Lrcls_epilogue
+
.Lrcls_retdouble:
fldl -24(%ebp)
jmp .Lrcls_epilogue
+
.Lrcls_retldouble:
fldt -24(%ebp)
jmp .Lrcls_epilogue
+
.Lrcls_retllong:
movl -24(%ebp), %eax
movl -20(%ebp), %edx
jmp .Lrcls_epilogue
+
+.Lrcls_retstruct1:
+ movsbl -24(%ebp), %eax
+ jmp .Lrcls_epilogue
+
+.Lrcls_retstruct2:
+ movswl -24(%ebp), %eax
+ jmp .Lrcls_epilogue
+
+.Lrcls_retstruct4:
+ movl -24(%ebp), %eax
+ jmp .Lrcls_epilogue
+
+.Lrcls_retstruct:
+ # Nothing to do!
+
+.Lrcls_noretval:
+.Lrcls_epilogue:
+ addl $36, %esp
+ popl %esi
+ popl %ebp
+ ret
.ffi_closure_raw_SYSV_end:
+.LFE4:
+
+#endif /* !FFI_NO_RAW_API */
+
+ # This assumes we are using gas.
+ .balign 16
+ .globl _ffi_closure_STDCALL
+ .def _ffi_closure_STDCALL; .scl 2; .type 32; .endef
+_ffi_closure_STDCALL:
+.LFB5:
+ pushl %ebp
+.LCFI9:
+ movl %esp, %ebp
+.LCFI10:
+ subl $40, %esp
+ leal -24(%ebp), %edx
+ movl %edx, -12(%ebp) /* resp */
+ leal 12(%ebp), %edx /* account for stub return address on stack */
+ movl %edx, 4(%esp) /* args */
+ leal -12(%ebp), %edx
+ movl %edx, (%esp) /* &resp */
+ call _ffi_closure_SYSV_inner
+ movl -12(%ebp), %ecx
+0:
+ call 1f
+ # Do not insert anything here between the call and the jump table.
+.Lscls_store_table:
+ .long .Lscls_noretval /* FFI_TYPE_VOID */
+ .long .Lscls_retint /* FFI_TYPE_INT */
+ .long .Lscls_retfloat /* FFI_TYPE_FLOAT */
+ .long .Lscls_retdouble /* FFI_TYPE_DOUBLE */
+ .long .Lscls_retldouble /* FFI_TYPE_LONGDOUBLE */
+ .long .Lscls_retuint8 /* FFI_TYPE_UINT8 */
+ .long .Lscls_retsint8 /* FFI_TYPE_SINT8 */
+ .long .Lscls_retuint16 /* FFI_TYPE_UINT16 */
+ .long .Lscls_retsint16 /* FFI_TYPE_SINT16 */
+ .long .Lscls_retint /* FFI_TYPE_UINT32 */
+ .long .Lscls_retint /* FFI_TYPE_SINT32 */
+ .long .Lscls_retllong /* FFI_TYPE_UINT64 */
+ .long .Lscls_retllong /* FFI_TYPE_SINT64 */
+ .long .Lscls_retstruct /* FFI_TYPE_STRUCT */
+ .long .Lscls_retint /* FFI_TYPE_POINTER */
+ .long .Lscls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */
+ .long .Lscls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */
+ .long .Lscls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */
+1:
+ add %eax, %eax
+ add %eax, %eax
+ add (%esp),%eax
+ add $4, %esp
+ jmp *(%eax)
+
+ /* Sign/zero extend as appropriate. */
+.Lscls_retsint8:
+ movsbl (%ecx), %eax
+ jmp .Lscls_epilogue
+
+.Lscls_retsint16:
+ movswl (%ecx), %eax
+ jmp .Lscls_epilogue
+
+.Lscls_retuint8:
+ movzbl (%ecx), %eax
+ jmp .Lscls_epilogue
+
+.Lscls_retuint16:
+ movzwl (%ecx), %eax
+ jmp .Lscls_epilogue
+
+.Lscls_retint:
+ movl (%ecx), %eax
+ jmp .Lscls_epilogue
+
+.Lscls_retfloat:
+ flds (%ecx)
+ jmp .Lscls_epilogue
+
+.Lscls_retdouble:
+ fldl (%ecx)
+ jmp .Lscls_epilogue
+
+.Lscls_retldouble:
+ fldt (%ecx)
+ jmp .Lscls_epilogue
+
+.Lscls_retllong:
+ movl (%ecx), %eax
+ movl 4(%ecx), %edx
+ jmp .Lscls_epilogue
+
+.Lscls_retstruct1:
+ movsbl (%ecx), %eax
+ jmp .Lscls_epilogue
+
+.Lscls_retstruct2:
+ movswl (%ecx), %eax
+ jmp .Lscls_epilogue
+.Lscls_retstruct4:
+ movl (%ecx), %eax
+ jmp .Lscls_epilogue
+
+.Lscls_retstruct:
+ # Nothing to do!
+
+.Lscls_noretval:
+.Lscls_epilogue:
+ movl %ebp, %esp
+ popl %ebp
+ ret
+.ffi_closure_STDCALL_end:
+.LFE5:
+
+ .section .eh_frame,"w"
+.Lframe1:
+.LSCIE1:
+ .long .LECIE1-.LASCIE1 /* Length of Common Information Entry */
+.LASCIE1:
+ .long 0x0 /* CIE Identifier Tag */
+ .byte 0x1 /* CIE Version */
+#ifdef __PIC__
+ .ascii "zR\0" /* CIE Augmentation */
+#else
+ .ascii "\0" /* CIE Augmentation */
+#endif
+ .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */
+ .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */
+ .byte 0x8 /* CIE RA Column */
+#ifdef __PIC__
+ .byte 0x1 /* .uleb128 0x1; Augmentation size */
+ .byte 0x1b /* FDE Encoding (pcrel sdata4) */
+#endif
+ .byte 0xc /* DW_CFA_def_cfa CFA = r4 + 4 = 4(%esp) */
+ .byte 0x4 /* .uleb128 0x4 */
+ .byte 0x4 /* .uleb128 0x4 */
+ .byte 0x88 /* DW_CFA_offset, column 0x8 %eip at CFA + 1 * -4 */
+ .byte 0x1 /* .uleb128 0x1 */
+ .align 4
+.LECIE1:
+
+.LSFDE1:
+ .long .LEFDE1-.LASFDE1 /* FDE Length */
+.LASFDE1:
+ .long .LASFDE1-.Lframe1 /* FDE CIE offset */
+#if defined __PIC__ && defined HAVE_AS_X86_PCREL
+ .long .LFB1-. /* FDE initial location */
+#else
+ .long .LFB1
+#endif
+ .long .LFE1-.LFB1 /* FDE address range */
+#ifdef __PIC__
+ .byte 0x0 /* .uleb128 0x0; Augmentation size */
+#endif
+ /* DW_CFA_xxx CFI instructions go here. */
+
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .long .LCFI0-.LFB1
+ .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
+ .byte 0x8 /* .uleb128 0x8 */
+ .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
+ .byte 0x2 /* .uleb128 0x2 */
+
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .long .LCFI1-.LCFI0
+ .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */
+ .byte 0x5 /* .uleb128 0x5 */
+
+ /* End of DW_CFA_xxx CFI instructions. */
+ .align 4
+.LEFDE1:
+
+
+.LSFDE3:
+ .long .LEFDE3-.LASFDE3 /* FDE Length */
+.LASFDE3:
+ .long .LASFDE3-.Lframe1 /* FDE CIE offset */
+#if defined __PIC__ && defined HAVE_AS_X86_PCREL
+ .long .LFB3-. /* FDE initial location */
+#else
+ .long .LFB3
+#endif
+ .long .LFE3-.LFB3 /* FDE address range */
+#ifdef __PIC__
+ .byte 0x0 /* .uleb128 0x0; Augmentation size */
+#endif
+ /* DW_CFA_xxx CFI instructions go here. */
+
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .long .LCFI4-.LFB3
+ .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
+ .byte 0x8 /* .uleb128 0x8 */
+ .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
+ .byte 0x2 /* .uleb128 0x2 */
+
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .long .LCFI5-.LCFI4
+ .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */
+ .byte 0x5 /* .uleb128 0x5 */
+
+ /* End of DW_CFA_xxx CFI instructions. */
+ .align 4
+.LEFDE3:
+
+#if !FFI_NO_RAW_API
+
+.LSFDE4:
+ .long .LEFDE4-.LASFDE4 /* FDE Length */
+.LASFDE4:
+ .long .LASFDE4-.Lframe1 /* FDE CIE offset */
+#if defined __PIC__ && defined HAVE_AS_X86_PCREL
+ .long .LFB4-. /* FDE initial location */
+#else
+ .long .LFB4
+#endif
+ .long .LFE4-.LFB4 /* FDE address range */
+#ifdef __PIC__
+ .byte 0x0 /* .uleb128 0x0; Augmentation size */
+#endif
+ /* DW_CFA_xxx CFI instructions go here. */
+
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .long .LCFI6-.LFB4
+ .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
+ .byte 0x8 /* .uleb128 0x8 */
+ .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
+ .byte 0x2 /* .uleb128 0x2 */
+
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .long .LCFI7-.LCFI6
+ .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */
+ .byte 0x5 /* .uleb128 0x5 */
+
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .long .LCFI8-.LCFI7
+ .byte 0x86 /* DW_CFA_offset, column 0x6 %esi at CFA + 3 * -4 */
+ .byte 0x3 /* .uleb128 0x3 */
+
+ /* End of DW_CFA_xxx CFI instructions. */
+ .align 4
+.LEFDE4:
+
+#endif /* !FFI_NO_RAW_API */
+
+.LSFDE5:
+ .long .LEFDE5-.LASFDE5 /* FDE Length */
+.LASFDE5:
+ .long .LASFDE5-.Lframe1 /* FDE CIE offset */
+#if defined __PIC__ && defined HAVE_AS_X86_PCREL
+ .long .LFB5-. /* FDE initial location */
+#else
+ .long .LFB5
+#endif
+ .long .LFE5-.LFB5 /* FDE address range */
+#ifdef __PIC__
+ .byte 0x0 /* .uleb128 0x0; Augmentation size */
#endif
+ /* DW_CFA_xxx CFI instructions go here. */
+
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .long .LCFI9-.LFB5
+ .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
+ .byte 0x8 /* .uleb128 0x8 */
+ .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
+ .byte 0x2 /* .uleb128 0x2 */
+
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .long .LCFI10-.LCFI9
+ .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */
+ .byte 0x5 /* .uleb128 0x5 */
+
+ /* End of DW_CFA_xxx CFI instructions. */
+ .align 4
+.LEFDE5:
+
+#endif /* !_MSC_VER */
+
diff --git a/Modules/_ctypes/libffi/src/x86/win64.S b/Modules/_ctypes/libffi/src/x86/win64.S
new file mode 100644
index 0000000000..6e9181867d
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/x86/win64.S
@@ -0,0 +1,460 @@
+#define LIBFFI_ASM
+#include <fficonfig.h>
+#include <ffi.h>
+
+/* Constants for ffi_call_win64 */
+#define STACK 0
+#define PREP_ARGS_FN 32
+#define ECIF 40
+#define CIF_BYTES 48
+#define CIF_FLAGS 56
+#define RVALUE 64
+#define FN 72
+
+/* ffi_call_win64 (void (*prep_args_fn)(char *, extended_cif *),
+ extended_cif *ecif, unsigned bytes, unsigned flags,
+ unsigned *rvalue, void (*fn)());
+ */
+
+#ifdef _MSC_VER
+PUBLIC ffi_call_win64
+
+EXTRN __chkstk:NEAR
+EXTRN ffi_closure_win64_inner:NEAR
+
+_TEXT SEGMENT
+
+;;; ffi_closure_win64 will be called with these registers set:
+;;; rax points to 'closure'
+;;; r11 contains a bit mask that specifies which of the
+;;; first four parameters are float or double
+;;;
+;;; It must move the parameters passed in registers to their stack location,
+;;; call ffi_closure_win64_inner for the actual work, then return the result.
+;;;
+ffi_closure_win64 PROC FRAME
+ ;; copy register arguments onto stack
+ test r11, 1
+ jne first_is_float
+ mov QWORD PTR [rsp+8], rcx
+ jmp second
+first_is_float:
+ movlpd QWORD PTR [rsp+8], xmm0
+
+second:
+ test r11, 2
+ jne second_is_float
+ mov QWORD PTR [rsp+16], rdx
+ jmp third
+second_is_float:
+ movlpd QWORD PTR [rsp+16], xmm1
+
+third:
+ test r11, 4
+ jne third_is_float
+ mov QWORD PTR [rsp+24], r8
+ jmp fourth
+third_is_float:
+ movlpd QWORD PTR [rsp+24], xmm2
+
+fourth:
+ test r11, 8
+ jne fourth_is_float
+ mov QWORD PTR [rsp+32], r9
+ jmp done
+fourth_is_float:
+ movlpd QWORD PTR [rsp+32], xmm3
+
+done:
+ .ALLOCSTACK 40
+ sub rsp, 40
+ .ENDPROLOG
+ mov rcx, rax ; context is first parameter
+ mov rdx, rsp ; stack is second parameter
+ add rdx, 48 ; point to start of arguments
+ mov rax, ffi_closure_win64_inner
+ call rax ; call the real closure function
+ add rsp, 40
+ movd xmm0, rax ; If the closure returned a float,
+ ; ffi_closure_win64_inner wrote it to rax
+ ret 0
+ffi_closure_win64 ENDP
+
+ffi_call_win64 PROC FRAME
+ ;; copy registers onto stack
+ mov QWORD PTR [rsp+32], r9
+ mov QWORD PTR [rsp+24], r8
+ mov QWORD PTR [rsp+16], rdx
+ mov QWORD PTR [rsp+8], rcx
+ .PUSHREG rbp
+ push rbp
+ .ALLOCSTACK 48
+ sub rsp, 48 ; 00000030H
+ .SETFRAME rbp, 32
+ lea rbp, QWORD PTR [rsp+32]
+ .ENDPROLOG
+
+ mov eax, DWORD PTR CIF_BYTES[rbp]
+ add rax, 15
+ and rax, -16
+ call __chkstk
+ sub rsp, rax
+ lea rax, QWORD PTR [rsp+32]
+ mov QWORD PTR STACK[rbp], rax
+
+ mov rdx, QWORD PTR ECIF[rbp]
+ mov rcx, QWORD PTR STACK[rbp]
+ call QWORD PTR PREP_ARGS_FN[rbp]
+
+ mov rsp, QWORD PTR STACK[rbp]
+
+ movlpd xmm3, QWORD PTR [rsp+24]
+ movd r9, xmm3
+
+ movlpd xmm2, QWORD PTR [rsp+16]
+ movd r8, xmm2
+
+ movlpd xmm1, QWORD PTR [rsp+8]
+ movd rdx, xmm1
+
+ movlpd xmm0, QWORD PTR [rsp]
+ movd rcx, xmm0
+
+ call QWORD PTR FN[rbp]
+ret_struct4b$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_4B
+ jne ret_struct2b$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ mov DWORD PTR [rcx], eax
+ jmp ret_void$
+
+ret_struct2b$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_2B
+ jne ret_struct1b$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ mov WORD PTR [rcx], ax
+ jmp ret_void$
+
+ret_struct1b$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_1B
+ jne ret_uint8$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ mov BYTE PTR [rcx], al
+ jmp ret_void$
+
+ret_uint8$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT8
+ jne ret_sint8$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ movzx rax, al
+ mov QWORD PTR [rcx], rax
+ jmp ret_void$
+
+ret_sint8$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT8
+ jne ret_uint16$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ movsx rax, al
+ mov QWORD PTR [rcx], rax
+ jmp ret_void$
+
+ret_uint16$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT16
+ jne ret_sint16$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ movzx rax, ax
+ mov QWORD PTR [rcx], rax
+ jmp SHORT ret_void$
+
+ret_sint16$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT16
+ jne ret_uint32$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ movsx rax, ax
+ mov QWORD PTR [rcx], rax
+ jmp SHORT ret_void$
+
+ret_uint32$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT32
+ jne ret_sint32$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ mov eax, eax
+ mov QWORD PTR [rcx], rax
+ jmp SHORT ret_void$
+
+ret_sint32$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT32
+ jne ret_float$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ cdqe
+ mov QWORD PTR [rcx], rax
+ jmp SHORT ret_void$
+
+ret_float$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_FLOAT
+ jne SHORT ret_double$
+
+ mov rax, QWORD PTR RVALUE[rbp]
+ movss DWORD PTR [rax], xmm0
+ jmp SHORT ret_void$
+
+ret_double$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_DOUBLE
+ jne SHORT ret_sint64$
+
+ mov rax, QWORD PTR RVALUE[rbp]
+ movlpd QWORD PTR [rax], xmm0
+ jmp SHORT ret_void$
+
+ret_sint64$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT64
+ jne ret_void$
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ mov QWORD PTR [rcx], rax
+ jmp SHORT ret_void$
+
+ret_void$:
+ xor rax, rax
+
+ lea rsp, QWORD PTR [rbp+16]
+ pop rbp
+ ret 0
+ffi_call_win64 ENDP
+_TEXT ENDS
+END
+#else
+.text
+
+.extern _ffi_closure_win64_inner
+
+# ffi_closure_win64 will be called with these registers set:
+# rax points to 'closure'
+# r11 contains a bit mask that specifies which of the
+# first four parameters are float or double
+#
+# It must move the parameters passed in registers to their stack location,
+# call ffi_closure_win64_inner for the actual work, then return the result.
+#
+ .balign 16
+ .globl _ffi_closure_win64
+_ffi_closure_win64:
+ # copy register arguments onto stack
+ test $1,%r11
+ jne .Lfirst_is_float
+ mov %rcx, 8(%rsp)
+ jmp .Lsecond
+.Lfirst_is_float:
+ movlpd %xmm0, 8(%rsp)
+
+.Lsecond:
+ test $2, %r11
+ jne .Lsecond_is_float
+ mov %rdx, 16(%rsp)
+ jmp .Lthird
+.Lsecond_is_float:
+ movlpd %xmm1, 16(%rsp)
+
+.Lthird:
+ test $4, %r11
+ jne .Lthird_is_float
+ mov %r8,24(%rsp)
+ jmp .Lfourth
+.Lthird_is_float:
+ movlpd %xmm2, 24(%rsp)
+
+.Lfourth:
+ test $8, %r11
+ jne .Lfourth_is_float
+ mov %r9, 32(%rsp)
+ jmp .Ldone
+.Lfourth_is_float:
+ movlpd %xmm3, 32(%rsp)
+
+.Ldone:
+#.ALLOCSTACK 40
+ sub $40, %rsp
+#.ENDPROLOG
+ mov %rax, %rcx # context is first parameter
+ mov %rsp, %rdx # stack is second parameter
+ add $48, %rdx # point to start of arguments
+ mov $_ffi_closure_win64_inner, %rax
+ callq *%rax # call the real closure function
+ add $40, %rsp
+ movq %rax, %xmm0 # If the closure returned a float,
+ # ffi_closure_win64_inner wrote it to rax
+ retq
+.ffi_closure_win64_end:
+
+ .balign 16
+ .globl _ffi_call_win64
+_ffi_call_win64:
+ # copy registers onto stack
+ mov %r9,32(%rsp)
+ mov %r8,24(%rsp)
+ mov %rdx,16(%rsp)
+ mov %rcx,8(%rsp)
+ #.PUSHREG rbp
+ push %rbp
+ #.ALLOCSTACK 48
+ sub $48,%rsp
+ #.SETFRAME rbp, 32
+ lea 32(%rsp),%rbp
+ #.ENDPROLOG
+
+ mov CIF_BYTES(%rbp),%eax
+ add $15, %rax
+ and $-16, %rax
+ cmpq $0x1000, %rax
+ jb Lch_done
+Lch_probe:
+ subq $0x1000,%rsp
+ orl $0x0, (%rsp)
+ subq $0x1000,%rax
+ cmpq $0x1000,%rax
+ ja Lch_probe
+Lch_done:
+ subq %rax, %rsp
+ orl $0x0, (%rsp)
+ lea 32(%rsp), %rax
+ mov %rax, STACK(%rbp)
+
+ mov ECIF(%rbp), %rdx
+ mov STACK(%rbp), %rcx
+ callq *PREP_ARGS_FN(%rbp)
+
+ mov STACK(%rbp), %rsp
+
+ movlpd 24(%rsp), %xmm3
+ movd %xmm3, %r9
+
+ movlpd 16(%rsp), %xmm2
+ movd %xmm2, %r8
+
+ movlpd 8(%rsp), %xmm1
+ movd %xmm1, %rdx
+
+ movlpd (%rsp), %xmm0
+ movd %xmm0, %rcx
+
+ callq *FN(%rbp)
+.Lret_struct4b:
+ cmpl $FFI_TYPE_SMALL_STRUCT_4B, CIF_FLAGS(%rbp)
+ jne .Lret_struct2b
+
+ mov RVALUE(%rbp), %rcx
+ mov %eax, (%rcx)
+ jmp .Lret_void
+
+.Lret_struct2b:
+ cmpl $FFI_TYPE_SMALL_STRUCT_2B, CIF_FLAGS(%rbp)
+ jne .Lret_struct1b
+
+ mov RVALUE(%rbp), %rcx
+ mov %ax, (%rcx)
+ jmp .Lret_void
+
+.Lret_struct1b:
+ cmpl $FFI_TYPE_SMALL_STRUCT_1B, CIF_FLAGS(%rbp)
+ jne .Lret_uint8
+
+ mov RVALUE(%rbp), %rcx
+ mov %al, (%rcx)
+ jmp .Lret_void
+
+.Lret_uint8:
+ cmpl $FFI_TYPE_UINT8, CIF_FLAGS(%rbp)
+ jne .Lret_sint8
+
+ mov RVALUE(%rbp), %rcx
+ movzbq %al, %rax
+ movq %rax, (%rcx)
+ jmp .Lret_void
+
+.Lret_sint8:
+ cmpl $FFI_TYPE_SINT8, CIF_FLAGS(%rbp)
+ jne .Lret_uint16
+
+ mov RVALUE(%rbp), %rcx
+ movsbq %al, %rax
+ movq %rax, (%rcx)
+ jmp .Lret_void
+
+.Lret_uint16:
+ cmpl $FFI_TYPE_UINT16, CIF_FLAGS(%rbp)
+ jne .Lret_sint16
+
+ mov RVALUE(%rbp), %rcx
+ movzwq %ax, %rax
+ movq %rax, (%rcx)
+ jmp .Lret_void
+
+.Lret_sint16:
+ cmpl $FFI_TYPE_SINT16, CIF_FLAGS(%rbp)
+ jne .Lret_uint32
+
+ mov RVALUE(%rbp), %rcx
+ movswq %ax, %rax
+ movq %rax, (%rcx)
+ jmp .Lret_void
+
+.Lret_uint32:
+ cmpl $FFI_TYPE_UINT32, CIF_FLAGS(%rbp)
+ jne .Lret_sint32
+
+ mov RVALUE(%rbp), %rcx
+ movl %eax, %eax
+ movq %rax, (%rcx)
+ jmp .Lret_void
+
+.Lret_sint32:
+ cmpl $FFI_TYPE_SINT32, CIF_FLAGS(%rbp)
+ jne .Lret_float
+
+ mov RVALUE(%rbp), %rcx
+ cltq
+ movq %rax, (%rcx)
+ jmp .Lret_void
+
+.Lret_float:
+ cmpl $FFI_TYPE_FLOAT, CIF_FLAGS(%rbp)
+ jne .Lret_double
+
+ mov RVALUE(%rbp), %rax
+ movss %xmm0, (%rax)
+ jmp .Lret_void
+
+.Lret_double:
+ cmpl $FFI_TYPE_DOUBLE, CIF_FLAGS(%rbp)
+ jne .Lret_sint64
+
+ mov RVALUE(%rbp), %rax
+ movlpd %xmm0, (%rax)
+ jmp .Lret_void
+
+.Lret_sint64:
+ cmpl $FFI_TYPE_SINT64, CIF_FLAGS(%rbp)
+ jne .Lret_void
+
+ mov RVALUE(%rbp), %rcx
+ mov %rax, (%rcx)
+ jmp .Lret_void
+
+.Lret_void:
+ xor %rax, %rax
+
+ lea 16(%rbp), %rsp
+ pop %rbp
+ retq
+.ffi_call_win64_end:
+#endif /* !_MSC_VER */
+
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.am b/Modules/_ctypes/libffi/testsuite/Makefile.am
new file mode 100644
index 0000000000..eae3d74fdb
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/Makefile.am
@@ -0,0 +1,80 @@
+## Process this file with automake to produce Makefile.in.
+
+AUTOMAKE_OPTIONS = foreign dejagnu
+
+# Setup the testing framework, if you have one
+EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
+ echo $(top_builddir)/../expect/expect ; \
+ else echo expect ; fi`
+
+RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
+ echo $(top_srcdir)/../dejagnu/runtest ; \
+ else echo runtest; fi`
+
+AM_RUNTESTFLAGS =
+
+CLEANFILES = *.exe core* *.log *.sum
+
+EXTRA_DIST = libffi.special/special.exp \
+libffi.special/unwindtest_ffi_call.cc libffi.special/unwindtest.cc \
+libffi.special/ffitestcxx.h config/default.exp lib/target-libpath.exp \
+lib/libffi-dg.exp lib/wrapper.exp libffi.call/float.c \
+libffi.call/cls_multi_schar.c libffi.call/float3.c \
+libffi.call/cls_3_1byte.c libffi.call/stret_large2.c \
+libffi.call/cls_5_1_byte.c libffi.call/stret_medium.c \
+libffi.call/promotion.c libffi.call/cls_dbls_struct.c \
+libffi.call/nested_struct.c libffi.call/closure_fn1.c \
+libffi.call/cls_4_1byte.c libffi.call/cls_float.c \
+libffi.call/cls_2byte.c libffi.call/closure_fn4.c \
+libffi.call/return_fl2.c libffi.call/nested_struct7.c \
+libffi.call/cls_uint.c libffi.call/cls_align_sint64.c \
+libffi.call/float1.c libffi.call/cls_19byte.c \
+libffi.call/nested_struct1.c libffi.call/cls_4byte.c \
+libffi.call/return_fl1.c libffi.call/cls_align_pointer.c \
+libffi.call/nested_struct4.c libffi.call/nested_struct3.c \
+libffi.call/struct7.c libffi.call/nested_struct9.c \
+libffi.call/cls_sshort.c libffi.call/cls_ulonglong.c \
+libffi.call/cls_pointer_stack.c libffi.call/cls_multi_uchar.c \
+libffi.call/testclosure.c libffi.call/cls_3byte1.c \
+libffi.call/struct6.c libffi.call/return_uc.c libffi.call/return_ll1.c \
+libffi.call/cls_ushort.c libffi.call/stret_medium2.c \
+libffi.call/cls_multi_ushortchar.c libffi.call/return_dbl2.c \
+libffi.call/closure_loc_fn0.c libffi.call/return_sc.c \
+libffi.call/nested_struct8.c libffi.call/cls_7_1_byte.c \
+libffi.call/return_ll.c libffi.call/cls_pointer.c \
+libffi.call/err_bad_abi.c libffi.call/return_dbl1.c \
+libffi.call/call.exp libffi.call/ffitest.h libffi.call/strlen.c \
+libffi.call/return_sl.c libffi.call/cls_1_1byte.c \
+libffi.call/struct1.c libffi.call/cls_64byte.c libffi.call/return_ul.c \
+libffi.call/cls_double.c libffi.call/many_win32.c \
+libffi.call/cls_16byte.c libffi.call/cls_align_double.c \
+libffi.call/cls_align_uint16.c libffi.call/cls_9byte1.c \
+libffi.call/cls_multi_sshortchar.c libffi.call/cls_multi_ushort.c \
+libffi.call/closure_stdcall.c libffi.call/return_fl.c \
+libffi.call/strlen_win32.c libffi.call/return_ldl.c \
+libffi.call/cls_align_float.c libffi.call/struct3.c \
+libffi.call/cls_uchar.c libffi.call/cls_sint.c libffi.call/float2.c \
+libffi.call/cls_align_longdouble_split.c \
+libffi.call/cls_longdouble_va.c libffi.call/cls_multi_sshort.c \
+libffi.call/stret_large.c libffi.call/cls_align_sint16.c \
+libffi.call/nested_struct6.c libffi.call/cls_5byte.c \
+libffi.call/return_dbl.c libffi.call/cls_20byte.c \
+libffi.call/cls_8byte.c libffi.call/pyobjc-tc.c \
+libffi.call/cls_24byte.c libffi.call/cls_align_longdouble_split2.c \
+libffi.call/cls_6_1_byte.c libffi.call/cls_schar.c \
+libffi.call/cls_18byte.c libffi.call/closure_fn3.c \
+libffi.call/err_bad_typedef.c libffi.call/closure_fn2.c \
+libffi.call/struct2.c libffi.call/cls_3byte2.c \
+libffi.call/cls_align_longdouble.c libffi.call/cls_20byte1.c \
+libffi.call/return_fl3.c libffi.call/cls_align_uint32.c \
+libffi.call/problem1.c libffi.call/float4.c \
+libffi.call/cls_align_uint64.c libffi.call/struct9.c \
+libffi.call/closure_fn5.c libffi.call/cls_align_sint32.c \
+libffi.call/closure_fn0.c libffi.call/closure_fn6.c \
+libffi.call/struct4.c libffi.call/nested_struct2.c \
+libffi.call/cls_6byte.c libffi.call/cls_7byte.c libffi.call/many.c \
+libffi.call/struct8.c libffi.call/negint.c libffi.call/struct5.c \
+libffi.call/cls_12byte.c libffi.call/cls_double_va.c \
+libffi.call/cls_longdouble.c libffi.call/cls_9byte2.c \
+libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
+libffi.call/huge_struct.c
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.in b/Modules/_ctypes/libffi/testsuite/Makefile.in
new file mode 100644
index 0000000000..698c461f66
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/Makefile.in
@@ -0,0 +1,482 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = testsuite
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/fficonfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+DEJATOOL = $(PACKAGE)
+RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_RUNTESTFLAGS =
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TARGET = @TARGET@
+TARGETDIR = @TARGETDIR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+toolexecdir = @toolexecdir@
+toolexeclibdir = @toolexeclibdir@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign dejagnu
+
+# Setup the testing framework, if you have one
+EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
+ echo $(top_builddir)/../expect/expect ; \
+ else echo expect ; fi`
+
+RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
+ echo $(top_srcdir)/../dejagnu/runtest ; \
+ else echo runtest; fi`
+
+CLEANFILES = *.exe core* *.log *.sum
+EXTRA_DIST = libffi.special/special.exp \
+libffi.special/unwindtest_ffi_call.cc libffi.special/unwindtest.cc \
+libffi.special/ffitestcxx.h config/default.exp lib/target-libpath.exp \
+lib/libffi-dg.exp lib/wrapper.exp libffi.call/float.c \
+libffi.call/cls_multi_schar.c libffi.call/float3.c \
+libffi.call/cls_3_1byte.c libffi.call/stret_large2.c \
+libffi.call/cls_5_1_byte.c libffi.call/stret_medium.c \
+libffi.call/promotion.c libffi.call/cls_dbls_struct.c \
+libffi.call/nested_struct.c libffi.call/closure_fn1.c \
+libffi.call/cls_4_1byte.c libffi.call/cls_float.c \
+libffi.call/cls_2byte.c libffi.call/closure_fn4.c \
+libffi.call/return_fl2.c libffi.call/nested_struct7.c \
+libffi.call/cls_uint.c libffi.call/cls_align_sint64.c \
+libffi.call/float1.c libffi.call/cls_19byte.c \
+libffi.call/nested_struct1.c libffi.call/cls_4byte.c \
+libffi.call/return_fl1.c libffi.call/cls_align_pointer.c \
+libffi.call/nested_struct4.c libffi.call/nested_struct3.c \
+libffi.call/struct7.c libffi.call/nested_struct9.c \
+libffi.call/cls_sshort.c libffi.call/cls_ulonglong.c \
+libffi.call/cls_pointer_stack.c libffi.call/cls_multi_uchar.c \
+libffi.call/testclosure.c libffi.call/cls_3byte1.c \
+libffi.call/struct6.c libffi.call/return_uc.c libffi.call/return_ll1.c \
+libffi.call/cls_ushort.c libffi.call/stret_medium2.c \
+libffi.call/cls_multi_ushortchar.c libffi.call/return_dbl2.c \
+libffi.call/closure_loc_fn0.c libffi.call/return_sc.c \
+libffi.call/nested_struct8.c libffi.call/cls_7_1_byte.c \
+libffi.call/return_ll.c libffi.call/cls_pointer.c \
+libffi.call/err_bad_abi.c libffi.call/return_dbl1.c \
+libffi.call/call.exp libffi.call/ffitest.h libffi.call/strlen.c \
+libffi.call/return_sl.c libffi.call/cls_1_1byte.c \
+libffi.call/struct1.c libffi.call/cls_64byte.c libffi.call/return_ul.c \
+libffi.call/cls_double.c libffi.call/many_win32.c \
+libffi.call/cls_16byte.c libffi.call/cls_align_double.c \
+libffi.call/cls_align_uint16.c libffi.call/cls_9byte1.c \
+libffi.call/cls_multi_sshortchar.c libffi.call/cls_multi_ushort.c \
+libffi.call/closure_stdcall.c libffi.call/return_fl.c \
+libffi.call/strlen_win32.c libffi.call/return_ldl.c \
+libffi.call/cls_align_float.c libffi.call/struct3.c \
+libffi.call/cls_uchar.c libffi.call/cls_sint.c libffi.call/float2.c \
+libffi.call/cls_align_longdouble_split.c \
+libffi.call/cls_longdouble_va.c libffi.call/cls_multi_sshort.c \
+libffi.call/stret_large.c libffi.call/cls_align_sint16.c \
+libffi.call/nested_struct6.c libffi.call/cls_5byte.c \
+libffi.call/return_dbl.c libffi.call/cls_20byte.c \
+libffi.call/cls_8byte.c libffi.call/pyobjc-tc.c \
+libffi.call/cls_24byte.c libffi.call/cls_align_longdouble_split2.c \
+libffi.call/cls_6_1_byte.c libffi.call/cls_schar.c \
+libffi.call/cls_18byte.c libffi.call/closure_fn3.c \
+libffi.call/err_bad_typedef.c libffi.call/closure_fn2.c \
+libffi.call/struct2.c libffi.call/cls_3byte2.c \
+libffi.call/cls_align_longdouble.c libffi.call/cls_20byte1.c \
+libffi.call/return_fl3.c libffi.call/cls_align_uint32.c \
+libffi.call/problem1.c libffi.call/float4.c \
+libffi.call/cls_align_uint64.c libffi.call/struct9.c \
+libffi.call/closure_fn5.c libffi.call/cls_align_sint32.c \
+libffi.call/closure_fn0.c libffi.call/closure_fn6.c \
+libffi.call/struct4.c libffi.call/nested_struct2.c \
+libffi.call/cls_6byte.c libffi.call/cls_7byte.c libffi.call/many.c \
+libffi.call/struct8.c libffi.call/negint.c libffi.call/struct5.c \
+libffi.call/cls_12byte.c libffi.call/cls_double_va.c \
+libffi.call/cls_longdouble.c libffi.call/cls_9byte2.c \
+libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
+libffi.call/huge_struct.c
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign testsuite/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+check-DEJAGNU: site.exp
+ srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
+ EXPECT=$(EXPECT); export EXPECT; \
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
+ if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
+ then :; else exit_status=1; fi; \
+ done; \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi; \
+ exit $$exit_status
+site.exp: Makefile
+ @echo 'Making a new site.exp file...'
+ @echo '## these variables are automatically generated by make ##' >site.tmp
+ @echo '# Do not edit here. If you wish to override these values' >>site.tmp
+ @echo '# edit the last section' >>site.tmp
+ @echo 'set srcdir $(srcdir)' >>site.tmp
+ @echo "set objdir `pwd`" >>site.tmp
+ @echo 'set build_alias "$(build_alias)"' >>site.tmp
+ @echo 'set build_triplet $(build_triplet)' >>site.tmp
+ @echo 'set host_alias "$(host_alias)"' >>site.tmp
+ @echo 'set host_triplet $(host_triplet)' >>site.tmp
+ @echo 'set target_alias "$(target_alias)"' >>site.tmp
+ @echo 'set target_triplet $(target_triplet)' >>site.tmp
+ @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
+ @test ! -f site.exp || \
+ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
+ @-rm -f site.bak
+ @test ! -f site.exp || mv site.exp site.bak
+ @mv site.tmp site.exp
+
+distclean-DEJAGNU:
+ -rm -f site.exp site.bak
+ -l='$(DEJATOOL)'; for tool in $$l; do \
+ rm -f $$tool.sum $$tool.log; \
+ done
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-DEJAGNU distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
+ clean-libtool distclean distclean-DEJAGNU distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Modules/_ctypes/libffi/testsuite/config/default.exp b/Modules/_ctypes/libffi/testsuite/config/default.exp
new file mode 100644
index 0000000000..90967cccc1
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/config/default.exp
@@ -0,0 +1 @@
+load_lib "standard.exp"
diff --git a/Modules/_ctypes/libffi/testsuite/lib/libffi-dg.exp b/Modules/_ctypes/libffi/testsuite/lib/libffi-dg.exp
new file mode 100644
index 0000000000..838a306d96
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/lib/libffi-dg.exp
@@ -0,0 +1,300 @@
+# Copyright (C) 2003, 2005, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+proc load_gcc_lib { filename } {
+ global srcdir
+ load_file $srcdir/lib/$filename
+}
+
+load_lib dg.exp
+load_lib libgloss.exp
+load_gcc_lib target-libpath.exp
+load_gcc_lib wrapper.exp
+
+
+# Define libffi callbacks for dg.exp.
+
+proc libffi-dg-test-1 { target_compile prog do_what extra_tool_flags } {
+
+ # To get all \n in dg-output test strings to match printf output
+ # in a system that outputs it as \015\012 (i.e. not just \012), we
+ # need to change all \n into \r?\n. As there is no dejagnu flag
+ # or hook to do that, we simply change the text being tested.
+ # Unfortunately, we have to know that the variable is called
+ # dg-output-text and lives in the caller of libffi-dg-test, which
+ # is two calls up. Overriding proc dg-output would be longer and
+ # would necessarily have the same assumption.
+ upvar 2 dg-output-text output_match
+
+ if { [llength $output_match] > 1 } {
+ regsub -all "\n" [lindex $output_match 1] "\r?\n" x
+ set output_match [lreplace $output_match 1 1 $x]
+ }
+
+ # Set up the compiler flags, based on what we're going to do.
+
+ set options [list]
+ switch $do_what {
+ "compile" {
+ set compile_type "assembly"
+ set output_file "[file rootname [file tail $prog]].s"
+ }
+ "link" {
+ set compile_type "executable"
+ set output_file "[file rootname [file tail $prog]].exe"
+ # The following line is needed for targets like the i960 where
+ # the default output file is b.out. Sigh.
+ }
+ "run" {
+ set compile_type "executable"
+ # FIXME: "./" is to cope with "." not being in $PATH.
+ # Should this be handled elsewhere?
+ # YES.
+ set output_file "./[file rootname [file tail $prog]].exe"
+ # This is the only place where we care if an executable was
+ # created or not. If it was, dg.exp will try to run it.
+ remote_file build delete $output_file;
+ }
+ default {
+ perror "$do_what: not a valid dg-do keyword"
+ return ""
+ }
+ }
+
+ if { $extra_tool_flags != "" } {
+ lappend options "additional_flags=$extra_tool_flags"
+ }
+
+ set comp_output [libffi_target_compile "$prog" "$output_file" "$compile_type" $options];
+
+
+ return [list $comp_output $output_file]
+}
+
+
+proc libffi-dg-test { prog do_what extra_tool_flags } {
+ return [libffi-dg-test-1 target_compile $prog $do_what $extra_tool_flags]
+}
+
+proc libffi-init { args } {
+ global gluefile wrap_flags;
+ global srcdir
+ global blddirffi
+ global objdir
+ global TOOL_OPTIONS
+ global tool
+ global libffi_include
+ global libffi_link_flags
+ global tool_root_dir
+ global ld_library_path
+
+ set blddirffi [pwd]/..
+ verbose "libffi $blddirffi"
+
+ set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+ if {$gccdir != ""} {
+ set gccdir [file dirname $gccdir]
+ }
+ verbose "gccdir $gccdir"
+
+ set ld_library_path "."
+ append ld_library_path ":${gccdir}"
+
+ set compiler "${gccdir}/xgcc"
+ if { [is_remote host] == 0 && [which $compiler] != 0 } {
+ foreach i "[exec $compiler --print-multi-lib]" {
+ set mldir ""
+ regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
+ set mldir [string trimright $mldir "\;@"]
+ if { "$mldir" == "." } {
+ continue
+ }
+ if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
+ append ld_library_path ":${gccdir}/${mldir}"
+ }
+ }
+ }
+ # add the library path for libffi.
+ append ld_library_path ":${blddirffi}/.libs"
+
+ verbose "ld_library_path: $ld_library_path"
+
+ # Point to the Libffi headers in libffi.
+ set libffi_include "${blddirffi}/include"
+ verbose "libffi_include $libffi_include"
+
+ set libffi_dir "${blddirffi}/.libs"
+ verbose "libffi_dir $libffi_dir"
+ if { $libffi_dir != "" } {
+ set libffi_dir [file dirname ${libffi_dir}]
+ set libffi_link_flags "-L${libffi_dir}/.libs"
+ }
+
+ set_ld_library_path_env_vars
+ libffi_maybe_build_wrapper "${objdir}/testglue.o"
+}
+
+proc libffi_exit { } {
+ global gluefile;
+
+ if [info exists gluefile] {
+ file_on_build delete $gluefile;
+ unset gluefile;
+ }
+}
+
+proc libffi_target_compile { source dest type options } {
+ global gluefile wrap_flags;
+ global srcdir
+ global blddirffi
+ global TOOL_OPTIONS
+ global libffi_link_flags
+ global libffi_include
+ global target_triplet
+
+
+ if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
+ lappend options "libs=${gluefile}"
+ lappend options "ldflags=$wrap_flags"
+ }
+
+ # TOOL_OPTIONS must come first, so that it doesn't override testcase
+ # specific options.
+ if [info exists TOOL_OPTIONS] {
+ lappend options [concat "additional_flags=$TOOL_OPTIONS" $options];
+ }
+
+ # search for ffi_mips.h in srcdir, too
+ lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include -I${libffi_include}/.."
+ lappend options "additional_flags=${libffi_link_flags}"
+
+ # Darwin needs a stack execution allowed flag.
+
+ if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"]
+ || [istarget "*-*-darwin2*"] } {
+ lappend options "additional_flags=-Wl,-allow_stack_execute"
+ }
+
+ # If you're building the compiler with --prefix set to a place
+ # where it's not yet installed, then the linker won't be able to
+ # find the libgcc used by libffi.dylib. We could pass the
+ # -dylib_file option, but that's complicated, and it's much easier
+ # to just make the linker find libgcc using -L options.
+ if { [string match "*-*-darwin*" $target_triplet] } {
+ lappend options "libs= -shared-libgcc"
+ }
+
+ if { [string match "*-*-openbsd*" $target_triplet] } {
+ lappend options "libs= -lpthread"
+ }
+
+ lappend options "libs= -lffi"
+
+ verbose "options: $options"
+ return [target_compile $source $dest $type $options]
+}
+
+# Utility routines.
+
+#
+# search_for -- looks for a string match in a file
+#
+proc search_for { file pattern } {
+ set fd [open $file r]
+ while { [gets $fd cur_line]>=0 } {
+ if [string match "*$pattern*" $cur_line] then {
+ close $fd
+ return 1
+ }
+ }
+ close $fd
+ return 0
+}
+
+# Modified dg-runtest that can cycle through a list of optimization options
+# as c-torture does.
+proc libffi-dg-runtest { testcases default-extra-flags } {
+ global runtests
+
+ foreach test $testcases {
+ # If we're only testing specific files and this isn't one of
+ # them, skip it.
+ if ![runtest_file_p $runtests $test] {
+ continue
+ }
+
+ # Look for a loop within the source code - if we don't find one,
+ # don't pass -funroll[-all]-loops.
+ global torture_with_loops torture_without_loops
+ if [expr [search_for $test "for*("]+[search_for $test "while*("]] {
+ set option_list $torture_with_loops
+ } else {
+ set option_list $torture_without_loops
+ }
+
+ set nshort [file tail [file dirname $test]]/[file tail $test]
+
+ foreach flags $option_list {
+ verbose "Testing $nshort, $flags" 1
+ dg-test $test $flags ${default-extra-flags}
+ }
+ }
+}
+
+
+# Like check_conditional_xfail, but callable from a dg test.
+
+proc dg-xfail-if { args } {
+ set args [lreplace $args 0 0]
+ set selector "target [join [lindex $args 1]]"
+ if { [dg-process-target $selector] == "S" } {
+ global compiler_conditional_xfail_data
+ set compiler_conditional_xfail_data $args
+ }
+}
+
+
+# We need to make sure that additional_files and additional_sources
+# are both cleared out after every test. It is not enough to clear
+# them out *before* the next test run because gcc-target-compile gets
+# run directly from some .exp files (outside of any test). (Those
+# uses should eventually be eliminated.)
+
+# Because the DG framework doesn't provide a hook that is run at the
+# end of a test, we must replace dg-test with a wrapper.
+
+if { [info procs saved-dg-test] == [list] } {
+ rename dg-test saved-dg-test
+
+ proc dg-test { args } {
+ global additional_files
+ global additional_sources
+ global errorInfo
+
+ if { [ catch { eval saved-dg-test $args } errmsg ] } {
+ set saved_info $errorInfo
+ set additional_files ""
+ set additional_sources ""
+ error $errmsg $saved_info
+ }
+ set additional_files ""
+ set additional_sources ""
+ }
+}
+
+# Local Variables:
+# tcl-indent-level:4
+# End:
diff --git a/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp b/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp
new file mode 100644
index 0000000000..8999aa4798
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp
@@ -0,0 +1,263 @@
+# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# This file was contributed by John David Anglin (dave.anglin@nrc-cnrc.gc.ca)
+
+set orig_environment_saved 0
+set orig_ld_library_path_saved 0
+set orig_ld_run_path_saved 0
+set orig_shlib_path_saved 0
+set orig_ld_libraryn32_path_saved 0
+set orig_ld_library64_path_saved 0
+set orig_ld_library_path_32_saved 0
+set orig_ld_library_path_64_saved 0
+set orig_dyld_library_path_saved 0
+
+
+#######################################
+# proc set_ld_library_path_env_vars { }
+#######################################
+
+proc set_ld_library_path_env_vars { } {
+ global ld_library_path
+ global orig_environment_saved
+ global orig_ld_library_path_saved
+ global orig_ld_run_path_saved
+ global orig_shlib_path_saved
+ global orig_ld_libraryn32_path_saved
+ global orig_ld_library64_path_saved
+ global orig_ld_library_path_32_saved
+ global orig_ld_library_path_64_saved
+ global orig_dyld_library_path_saved
+ global orig_ld_library_path
+ global orig_ld_run_path
+ global orig_shlib_path
+ global orig_ld_libraryn32_path
+ global orig_ld_library64_path
+ global orig_ld_library_path_32
+ global orig_ld_library_path_64
+ global orig_dyld_library_path
+ global GCC_EXEC_PREFIX
+
+ # Set the relocated compiler prefix, but only if the user hasn't specified one.
+ if { [info exists GCC_EXEC_PREFIX] && ![info exists env(GCC_EXEC_PREFIX)] } {
+ setenv GCC_EXEC_PREFIX "$GCC_EXEC_PREFIX"
+ }
+
+ # Setting the ld library path causes trouble when testing cross-compilers.
+ if { [is_remote target] } {
+ return
+ }
+
+ if { $orig_environment_saved == 0 } {
+ global env
+
+ set orig_environment_saved 1
+
+ # Save the original environment.
+ if [info exists env(LD_LIBRARY_PATH)] {
+ set orig_ld_library_path "$env(LD_LIBRARY_PATH)"
+ set orig_ld_library_path_saved 1
+ }
+ if [info exists env(LD_RUN_PATH)] {
+ set orig_ld_run_path "$env(LD_RUN_PATH)"
+ set orig_ld_run_path_saved 1
+ }
+ if [info exists env(SHLIB_PATH)] {
+ set orig_shlib_path "$env(SHLIB_PATH)"
+ set orig_shlib_path_saved 1
+ }
+ if [info exists env(LD_LIBRARYN32_PATH)] {
+ set orig_ld_libraryn32_path "$env(LD_LIBRARYN32_PATH)"
+ set orig_ld_libraryn32_path_saved 1
+ }
+ if [info exists env(LD_LIBRARY64_PATH)] {
+ set orig_ld_library64_path "$env(LD_LIBRARY64_PATH)"
+ set orig_ld_library64_path_saved 1
+ }
+ if [info exists env(LD_LIBRARY_PATH_32)] {
+ set orig_ld_library_path_32 "$env(LD_LIBRARY_PATH_32)"
+ set orig_ld_library_path_32_saved 1
+ }
+ if [info exists env(LD_LIBRARY_PATH_64)] {
+ set orig_ld_library_path_64 "$env(LD_LIBRARY_PATH_64)"
+ set orig_ld_library_path_64_saved 1
+ }
+ if [info exists env(DYLD_LIBRARY_PATH)] {
+ set orig_dyld_library_path "$env(DYLD_LIBRARY_PATH)"
+ set orig_dyld_library_path_saved 1
+ }
+ }
+
+ # We need to set ld library path in the environment. Currently,
+ # unix.exp doesn't set the environment correctly for all systems.
+ # It only sets SHLIB_PATH and LD_LIBRARY_PATH when it executes a
+ # program. We also need the environment set for compilations, etc.
+ #
+ # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
+ # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
+ # (for the 64-bit ABI). The same applies to Darwin (DYLD_LIBRARY_PATH),
+ # Solaris 32 bit (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64),
+ # and HP-UX (SHLIB_PATH). In some cases, the variables are independent
+ # of LD_LIBRARY_PATH, and in other cases LD_LIBRARY_PATH is used if the
+ # variable is not defined.
+ #
+ # Doing this is somewhat of a hack as ld_library_path gets repeated in
+ # SHLIB_PATH and LD_LIBRARY_PATH when unix_load sets these variables.
+ if { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY_PATH "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARY_PATH "$ld_library_path"
+ }
+ if { $orig_ld_run_path_saved } {
+ setenv LD_RUN_PATH "$ld_library_path:$orig_ld_run_path"
+ } else {
+ setenv LD_RUN_PATH "$ld_library_path"
+ }
+ # The default shared library dynamic path search for 64-bit
+ # HP-UX executables searches LD_LIBRARY_PATH before SHLIB_PATH.
+ # LD_LIBRARY_PATH isn't used for 32-bit executables. Thus, we
+ # set LD_LIBRARY_PATH and SHLIB_PATH as if they were independent.
+ if { $orig_shlib_path_saved } {
+ setenv SHLIB_PATH "$ld_library_path:$orig_shlib_path"
+ } else {
+ setenv SHLIB_PATH "$ld_library_path"
+ }
+ if { $orig_ld_libraryn32_path_saved } {
+ setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_libraryn32_path"
+ } elseif { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARYN32_PATH "$ld_library_path"
+ }
+ if { $orig_ld_library64_path_saved } {
+ setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library64_path"
+ } elseif { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARY64_PATH "$ld_library_path"
+ }
+ if { $orig_ld_library_path_32_saved } {
+ setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path_32"
+ } elseif { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARY_PATH_32 "$ld_library_path"
+ }
+ if { $orig_ld_library_path_64_saved } {
+ setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path_64"
+ } elseif { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARY_PATH_64 "$ld_library_path"
+ }
+ if { $orig_dyld_library_path_saved } {
+ setenv DYLD_LIBRARY_PATH "$ld_library_path:$orig_dyld_library_path"
+ } else {
+ setenv DYLD_LIBRARY_PATH "$ld_library_path"
+ }
+
+ verbose -log "set_ld_library_path_env_vars: ld_library_path=$ld_library_path"
+}
+
+#######################################
+# proc restore_ld_library_path_env_vars { }
+#######################################
+
+proc restore_ld_library_path_env_vars { } {
+ global orig_environment_saved
+ global orig_ld_library_path_saved
+ global orig_ld_run_path_saved
+ global orig_shlib_path_saved
+ global orig_ld_libraryn32_path_saved
+ global orig_ld_library64_path_saved
+ global orig_ld_library_path_32_saved
+ global orig_ld_library_path_64_saved
+ global orig_dyld_library_path_saved
+ global orig_ld_library_path
+ global orig_ld_run_path
+ global orig_shlib_path
+ global orig_ld_libraryn32_path
+ global orig_ld_library64_path
+ global orig_ld_library_path_32
+ global orig_ld_library_path_64
+ global orig_dyld_library_path
+
+ if { $orig_environment_saved == 0 } {
+ return
+ }
+
+ if { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY_PATH "$orig_ld_library_path"
+ } elseif [info exists env(LD_LIBRARY_PATH)] {
+ unsetenv LD_LIBRARY_PATH
+ }
+ if { $orig_ld_run_path_saved } {
+ setenv LD_RUN_PATH "$orig_ld_run_path"
+ } elseif [info exists env(LD_RUN_PATH)] {
+ unsetenv LD_RUN_PATH
+ }
+ if { $orig_shlib_path_saved } {
+ setenv SHLIB_PATH "$orig_shlib_path"
+ } elseif [info exists env(SHLIB_PATH)] {
+ unsetenv SHLIB_PATH
+ }
+ if { $orig_ld_libraryn32_path_saved } {
+ setenv LD_LIBRARYN32_PATH "$orig_ld_libraryn32_path"
+ } elseif [info exists env(LD_LIBRARYN32_PATH)] {
+ unsetenv LD_LIBRARYN32_PATH
+ }
+ if { $orig_ld_library64_path_saved } {
+ setenv LD_LIBRARY64_PATH "$orig_ld_library64_path"
+ } elseif [info exists env(LD_LIBRARY64_PATH)] {
+ unsetenv LD_LIBRARY64_PATH
+ }
+ if { $orig_ld_library_path_32_saved } {
+ setenv LD_LIBRARY_PATH_32 "$orig_ld_library_path_32"
+ } elseif [info exists env(LD_LIBRARY_PATH_32)] {
+ unsetenv LD_LIBRARY_PATH_32
+ }
+ if { $orig_ld_library_path_64_saved } {
+ setenv LD_LIBRARY_PATH_64 "$orig_ld_library_path_64"
+ } elseif [info exists env(LD_LIBRARY_PATH_64)] {
+ unsetenv LD_LIBRARY_PATH_64
+ }
+ if { $orig_dyld_library_path_saved } {
+ setenv DYLD_LIBRARY_PATH "$orig_dyld_library_path"
+ } elseif [info exists env(DYLD_LIBRARY_PATH)] {
+ unsetenv DYLD_LIBRARY_PATH
+ }
+}
+
+#######################################
+# proc get_shlib_extension { }
+#######################################
+
+proc get_shlib_extension { } {
+ global shlib_ext
+
+ if { [ istarget *-*-darwin* ] } {
+ set shlib_ext "dylib"
+ } elseif { [ istarget *-*-cygwin* ] || [ istarget *-*-mingw* ] } {
+ set shlib_ext "dll"
+ } elseif { [ istarget hppa*-*-hpux* ] } {
+ set shlib_ext "sl"
+ } else {
+ set shlib_ext "so"
+ }
+ return $shlib_ext
+}
+
diff --git a/Modules/_ctypes/libffi/testsuite/lib/wrapper.exp b/Modules/_ctypes/libffi/testsuite/lib/wrapper.exp
new file mode 100644
index 0000000000..4e5ae435a1
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/lib/wrapper.exp
@@ -0,0 +1,45 @@
+# Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# This file contains GCC-specifics for status wrappers for test programs.
+
+# ${tool}_maybe_build_wrapper -- Build wrapper object if the target
+# needs it. FILENAME is the path to the wrapper file. If there are
+# additional arguments, they are command-line options to provide to
+# the compiler when compiling FILENAME.
+
+proc ${tool}_maybe_build_wrapper { filename args } {
+ global gluefile wrap_flags
+
+ if { [target_info needs_status_wrapper] != "" \
+ && [target_info needs_status_wrapper] != "0" \
+ && ![info exists gluefile] } {
+ set saved_wrap_compile_flags [target_info wrap_compile_flags]
+ set flags [join $args " "]
+ # The wrapper code may contain code that gcc objects on. This
+ # became true for dejagnu-1.4.4. The set of warnings and code
+ # that gcc objects on may change, so just make sure -w is always
+ # passed to turn off all warnings.
+ set_currtarget_info wrap_compile_flags \
+ "$saved_wrap_compile_flags -w $flags"
+ set result [build_wrapper $filename]
+ set_currtarget_info wrap_compile_flags "$saved_wrap_compile_flags"
+ if { $result != "" } {
+ set gluefile [lindex $result 0]
+ set wrap_flags [lindex $result 1]
+ }
+ }
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp b/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp
new file mode 100644
index 0000000000..1e9985e3ad
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp
@@ -0,0 +1,36 @@
+# Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# libffi testsuite that uses the 'dg.exp' driver.
+
+load_lib libffi-dg.exp
+
+dg-init
+libffi-init
+
+global srcdir subdir
+
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" ""
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2" ""
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O3" ""
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-Os" ""
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2 -fomit-frame-pointer" ""
+
+dg-finish
+
+# Local Variables:
+# tcl-indent-level:4
+# End:
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn0.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn0.c
new file mode 100644
index 0000000000..a579ff6c97
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn0.c
@@ -0,0 +1,89 @@
+/* Area: closure_call
+ Purpose: Check multiple values passing from different type.
+ Also, exceed the limit of gpr and fpr registers on PowerPC
+ Darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+
+
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void
+closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
+ (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] +
+ (int)(*(signed short *)args[4]) +
+ (int)(*(unsigned long long *)args[5]) +
+ (int)*(int *)args[6] + (int)(*(int *)args[7]) +
+ (int)(*(double *)args[8]) + (int)*(int *)args[9] +
+ (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
+ (int)*(int *)args[12] + (int)(*(int *)args[13]) +
+ (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]),
+ (int)(*(unsigned long long *)args[2]),
+ (int)*(int *)args[3], (int)(*(signed short *)args[4]),
+ (int)(*(unsigned long long *)args[5]),
+ (int)*(int *)args[6], (int)(*(int *)args[7]),
+ (int)(*(double *)args[8]), (int)*(int *)args[9],
+ (int)(*(int *)args[10]), (int)(*(float *)args[11]),
+ (int)*(int *)args[12], (int)(*(int *)args[13]),
+ (int)(*(int *)args[14]),*(int *)args[15],
+ (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
+
+}
+
+typedef int (*closure_test_type0)(unsigned long long, int, unsigned long long,
+ int, signed short, unsigned long long, int,
+ int, double, int, int, float, int, int,
+ int, int);
+
+int main (void)
+{
+ ffi_cif cif;
+ void * code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[17];
+ int res;
+
+ cl_arg_types[0] = &ffi_type_uint64;
+ cl_arg_types[1] = &ffi_type_sint;
+ cl_arg_types[2] = &ffi_type_uint64;
+ cl_arg_types[3] = &ffi_type_sint;
+ cl_arg_types[4] = &ffi_type_sshort;
+ cl_arg_types[5] = &ffi_type_uint64;
+ cl_arg_types[6] = &ffi_type_sint;
+ cl_arg_types[7] = &ffi_type_sint;
+ cl_arg_types[8] = &ffi_type_double;
+ cl_arg_types[9] = &ffi_type_sint;
+ cl_arg_types[10] = &ffi_type_sint;
+ cl_arg_types[11] = &ffi_type_float;
+ cl_arg_types[12] = &ffi_type_sint;
+ cl_arg_types[13] = &ffi_type_sint;
+ cl_arg_types[14] = &ffi_type_sint;
+ cl_arg_types[15] = &ffi_type_sint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0,
+ (void *) 3 /* userdata */, code) == FFI_OK);
+
+ res = (*((closure_test_type0)code))
+ (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
+ 19, 21, 1);
+ /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 680" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn1.c
new file mode 100644
index 0000000000..91231738c1
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn1.c
@@ -0,0 +1,81 @@
+/* Area: closure_call.
+ Purpose: Check multiple values passing from different type.
+ Also, exceed the limit of gpr and fpr registers on PowerPC
+ Darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+
+static void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(float *)args[0] +(int)(*(float *)args[1]) +
+ (int)(*(float *)args[2]) + (int)*(float *)args[3] +
+ (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) +
+ (int)*(float *)args[6] + (int)(*(int *)args[7]) +
+ (int)(*(double*)args[8]) + (int)*(int *)args[9] +
+ (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
+ (int)*(int *)args[12] + (int)(*(int *)args[13]) +
+ (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(float *)args[0], (int)(*(float *)args[1]),
+ (int)(*(float *)args[2]), (int)*(float *)args[3],
+ (int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
+ (int)*(float *)args[6], (int)(*(int *)args[7]),
+ (int)(*(double *)args[8]), (int)*(int *)args[9],
+ (int)(*(int *)args[10]), (int)(*(float *)args[11]),
+ (int)*(int *)args[12], (int)(*(int *)args[13]),
+ (int)(*(int *)args[14]), *(int *)args[15],
+ (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
+}
+
+typedef int (*closure_test_type1)(float, float, float, float, signed short,
+ float, float, int, double, int, int, float,
+ int, int, int, int);
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[17];
+ int res;
+
+ cl_arg_types[0] = &ffi_type_float;
+ cl_arg_types[1] = &ffi_type_float;
+ cl_arg_types[2] = &ffi_type_float;
+ cl_arg_types[3] = &ffi_type_float;
+ cl_arg_types[4] = &ffi_type_sshort;
+ cl_arg_types[5] = &ffi_type_float;
+ cl_arg_types[6] = &ffi_type_float;
+ cl_arg_types[7] = &ffi_type_sint;
+ cl_arg_types[8] = &ffi_type_double;
+ cl_arg_types[9] = &ffi_type_sint;
+ cl_arg_types[10] = &ffi_type_sint;
+ cl_arg_types[11] = &ffi_type_float;
+ cl_arg_types[12] = &ffi_type_sint;
+ cl_arg_types[13] = &ffi_type_sint;
+ cl_arg_types[14] = &ffi_type_sint;
+ cl_arg_types[15] = &ffi_type_sint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1,
+ (void *) 3 /* userdata */, code) == FFI_OK);
+
+ res = (*((closure_test_type1)code))
+ (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
+ 19, 21, 1);
+ /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 255" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn2.c
new file mode 100644
index 0000000000..08ff9d9227
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn2.c
@@ -0,0 +1,81 @@
+/* Area: closure_call
+ Purpose: Check multiple values passing from different type.
+ Also, exceed the limit of gpr and fpr registers on PowerPC
+ Darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void closure_test_fn2(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(double *)args[0] +(int)(*(double *)args[1]) +
+ (int)(*(double *)args[2]) + (int)*(double *)args[3] +
+ (int)(*(signed short *)args[4]) + (int)(*(double *)args[5]) +
+ (int)*(double *)args[6] + (int)(*(int *)args[7]) +
+ (int)(*(double *)args[8]) + (int)*(int *)args[9] +
+ (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
+ (int)*(int *)args[12] + (int)(*(float *)args[13]) +
+ (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(double *)args[0], (int)(*(double *)args[1]),
+ (int)(*(double *)args[2]), (int)*(double *)args[3],
+ (int)(*(signed short *)args[4]), (int)(*(double *)args[5]),
+ (int)*(double *)args[6], (int)(*(int *)args[7]),
+ (int)(*(double*)args[8]), (int)*(int *)args[9],
+ (int)(*(int *)args[10]), (int)(*(float *)args[11]),
+ (int)*(int *)args[12], (int)(*(float *)args[13]),
+ (int)(*(int *)args[14]), *(int *)args[15], (int)(intptr_t)userdata,
+ (int)*(ffi_arg *)resp);
+}
+
+typedef int (*closure_test_type2)(double, double, double, double, signed short,
+ double, double, int, double, int, int, float,
+ int, float, int, int);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[17];
+ int res;
+
+ cl_arg_types[0] = &ffi_type_double;
+ cl_arg_types[1] = &ffi_type_double;
+ cl_arg_types[2] = &ffi_type_double;
+ cl_arg_types[3] = &ffi_type_double;
+ cl_arg_types[4] = &ffi_type_sshort;
+ cl_arg_types[5] = &ffi_type_double;
+ cl_arg_types[6] = &ffi_type_double;
+ cl_arg_types[7] = &ffi_type_sint;
+ cl_arg_types[8] = &ffi_type_double;
+ cl_arg_types[9] = &ffi_type_sint;
+ cl_arg_types[10] = &ffi_type_sint;
+ cl_arg_types[11] = &ffi_type_float;
+ cl_arg_types[12] = &ffi_type_sint;
+ cl_arg_types[13] = &ffi_type_float;
+ cl_arg_types[14] = &ffi_type_sint;
+ cl_arg_types[15] = &ffi_type_sint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn2,
+ (void *) 3 /* userdata */, code) == FFI_OK);
+
+ res = (*((closure_test_type2)code))
+ (1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13,
+ 19.0, 21, 1);
+ /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 255" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn3.c
new file mode 100644
index 0000000000..9b54d805c8
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn3.c
@@ -0,0 +1,82 @@
+/* Area: closure_call
+ Purpose: Check multiple values passing from different type.
+ Also, exceed the limit of gpr and fpr registers on PowerPC
+ Darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void closure_test_fn3(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata)
+ {
+ *(ffi_arg*)resp =
+ (int)*(float *)args[0] +(int)(*(float *)args[1]) +
+ (int)(*(float *)args[2]) + (int)*(float *)args[3] +
+ (int)(*(float *)args[4]) + (int)(*(float *)args[5]) +
+ (int)*(float *)args[6] + (int)(*(float *)args[7]) +
+ (int)(*(double *)args[8]) + (int)*(int *)args[9] +
+ (int)(*(float *)args[10]) + (int)(*(float *)args[11]) +
+ (int)*(int *)args[12] + (int)(*(float *)args[13]) +
+ (int)(*(float *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(float *)args[0], (int)(*(float *)args[1]),
+ (int)(*(float *)args[2]), (int)*(float *)args[3],
+ (int)(*(float *)args[4]), (int)(*(float *)args[5]),
+ (int)*(float *)args[6], (int)(*(float *)args[7]),
+ (int)(*(double *)args[8]), (int)*(int *)args[9],
+ (int)(*(float *)args[10]), (int)(*(float *)args[11]),
+ (int)*(int *)args[12], (int)(*(float *)args[13]),
+ (int)(*(float *)args[14]), *(int *)args[15], (int)(intptr_t)userdata,
+ (int)*(ffi_arg *)resp);
+
+ }
+
+typedef int (*closure_test_type3)(float, float, float, float, float, float,
+ float, float, double, int, float, float, int,
+ float, float, int);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[17];
+ int res;
+
+ cl_arg_types[0] = &ffi_type_float;
+ cl_arg_types[1] = &ffi_type_float;
+ cl_arg_types[2] = &ffi_type_float;
+ cl_arg_types[3] = &ffi_type_float;
+ cl_arg_types[4] = &ffi_type_float;
+ cl_arg_types[5] = &ffi_type_float;
+ cl_arg_types[6] = &ffi_type_float;
+ cl_arg_types[7] = &ffi_type_float;
+ cl_arg_types[8] = &ffi_type_double;
+ cl_arg_types[9] = &ffi_type_sint;
+ cl_arg_types[10] = &ffi_type_float;
+ cl_arg_types[11] = &ffi_type_float;
+ cl_arg_types[12] = &ffi_type_sint;
+ cl_arg_types[13] = &ffi_type_float;
+ cl_arg_types[14] = &ffi_type_float;
+ cl_arg_types[15] = &ffi_type_sint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn3,
+ (void *) 3 /* userdata */, code) == FFI_OK);
+
+ res = (*((closure_test_type3)code))
+ (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
+ 19.19, 21.21, 1);
+ /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 19 21 1 3: 135" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 135" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn4.c
new file mode 100644
index 0000000000..d4a1530b06
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn4.c
@@ -0,0 +1,89 @@
+/* Area: closure_call
+ Purpose: Check multiple long long values passing.
+ Also, exceed the limit of gpr and fpr registers on PowerPC
+ Darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031026 */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+static void
+closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
+ (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] +
+ (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] +
+ (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] +
+ (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] +
+ (int)*(unsigned long long *)args[10] +
+ (int)*(unsigned long long *)args[11] +
+ (int)*(unsigned long long *)args[12] +
+ (int)*(unsigned long long *)args[13] +
+ (int)*(unsigned long long *)args[14] +
+ *(int *)args[15] + (intptr_t)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(unsigned long long *)args[0],
+ (int)*(unsigned long long *)args[1],
+ (int)*(unsigned long long *)args[2],
+ (int)*(unsigned long long *)args[3],
+ (int)*(unsigned long long *)args[4],
+ (int)*(unsigned long long *)args[5],
+ (int)*(unsigned long long *)args[6],
+ (int)*(unsigned long long *)args[7],
+ (int)*(unsigned long long *)args[8],
+ (int)*(unsigned long long *)args[9],
+ (int)*(unsigned long long *)args[10],
+ (int)*(unsigned long long *)args[11],
+ (int)*(unsigned long long *)args[12],
+ (int)*(unsigned long long *)args[13],
+ (int)*(unsigned long long *)args[14],
+ *(int *)args[15],
+ (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
+
+}
+
+typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, int);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[17];
+ int i, res;
+
+ for (i = 0; i < 15; i++) {
+ cl_arg_types[i] = &ffi_type_uint64;
+ }
+ cl_arg_types[15] = &ffi_type_sint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0,
+ (void *) 3 /* userdata */, code) == FFI_OK);
+
+ res = (*((closure_test_type0)code))
+ (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11LL, 12LL,
+ 13LL, 19LL, 21LL, 1);
+ /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 680" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn5.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn5.c
new file mode 100644
index 0000000000..99074426c6
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn5.c
@@ -0,0 +1,92 @@
+/* Area: closure_call
+ Purpose: Check multiple long long values passing.
+ Exceed the limit of gpr registers on PowerPC
+ Darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031026 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void
+closure_test_fn5(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
+ (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] +
+ (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] +
+ (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] +
+ (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] +
+ (int)*(int *)args[10] +
+ (int)*(unsigned long long *)args[11] +
+ (int)*(unsigned long long *)args[12] +
+ (int)*(unsigned long long *)args[13] +
+ (int)*(unsigned long long *)args[14] +
+ *(int *)args[15] + (intptr_t)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(unsigned long long *)args[0],
+ (int)*(unsigned long long *)args[1],
+ (int)*(unsigned long long *)args[2],
+ (int)*(unsigned long long *)args[3],
+ (int)*(unsigned long long *)args[4],
+ (int)*(unsigned long long *)args[5],
+ (int)*(unsigned long long *)args[6],
+ (int)*(unsigned long long *)args[7],
+ (int)*(unsigned long long *)args[8],
+ (int)*(unsigned long long *)args[9],
+ (int)*(int *)args[10],
+ (int)*(unsigned long long *)args[11],
+ (int)*(unsigned long long *)args[12],
+ (int)*(unsigned long long *)args[13],
+ (int)*(unsigned long long *)args[14],
+ *(int *)args[15],
+ (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
+
+}
+
+typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ int, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, int);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[17];
+ int i, res;
+
+ for (i = 0; i < 10; i++) {
+ cl_arg_types[i] = &ffi_type_uint64;
+ }
+ cl_arg_types[10] = &ffi_type_sint;
+ for (i = 11; i < 15; i++) {
+ cl_arg_types[i] = &ffi_type_uint64;
+ }
+ cl_arg_types[15] = &ffi_type_sint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn5,
+ (void *) 3 /* userdata */, code) == FFI_OK);
+
+ res = (*((closure_test_type0)code))
+ (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11, 12LL,
+ 13LL, 19LL, 21LL, 1);
+ /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 680" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn6.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn6.c
new file mode 100644
index 0000000000..73c54fd6b1
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn6.c
@@ -0,0 +1,90 @@
+/* Area: closure_call
+ Purpose: Check multiple values passing from different type.
+ Also, exceed the limit of gpr and fpr registers on PowerPC.
+ Limitations: none.
+ PR: PR23404
+ Originator: <andreast@gcc.gnu.org> 20050830 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void
+closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(unsigned long long *)args[0] +
+ (int)(*(unsigned long long *)args[1]) +
+ (int)(*(unsigned long long *)args[2]) +
+ (int)*(unsigned long long *)args[3] +
+ (int)(*(int *)args[4]) + (int)(*(double *)args[5]) +
+ (int)*(double *)args[6] + (int)(*(float *)args[7]) +
+ (int)(*(double *)args[8]) + (int)*(double *)args[9] +
+ (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
+ (int)*(int *)args[12] + (int)(*(int *)args[13]) +
+ (int)(*(double *)args[14]) + (int)*(double *)args[15] +
+ (intptr_t)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(unsigned long long *)args[0],
+ (int)(*(unsigned long long *)args[1]),
+ (int)(*(unsigned long long *)args[2]),
+ (int)*(unsigned long long *)args[3],
+ (int)(*(int *)args[4]), (int)(*(double *)args[5]),
+ (int)*(double *)args[6], (int)(*(float *)args[7]),
+ (int)(*(double *)args[8]), (int)*(double *)args[9],
+ (int)(*(int *)args[10]), (int)(*(float *)args[11]),
+ (int)*(int *)args[12], (int)(*(int *)args[13]),
+ (int)(*(double *)args[14]), (int)(*(double *)args[15]),
+ (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
+
+}
+
+typedef int (*closure_test_type0)(unsigned long long,
+ unsigned long long,
+ unsigned long long,
+ unsigned long long,
+ int, double, double, float, double, double,
+ int, float, int, int, double, double);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[17];
+ int res;
+
+ cl_arg_types[0] = &ffi_type_uint64;
+ cl_arg_types[1] = &ffi_type_uint64;
+ cl_arg_types[2] = &ffi_type_uint64;
+ cl_arg_types[3] = &ffi_type_uint64;
+ cl_arg_types[4] = &ffi_type_sint;
+ cl_arg_types[5] = &ffi_type_double;
+ cl_arg_types[6] = &ffi_type_double;
+ cl_arg_types[7] = &ffi_type_float;
+ cl_arg_types[8] = &ffi_type_double;
+ cl_arg_types[9] = &ffi_type_double;
+ cl_arg_types[10] = &ffi_type_sint;
+ cl_arg_types[11] = &ffi_type_float;
+ cl_arg_types[12] = &ffi_type_sint;
+ cl_arg_types[13] = &ffi_type_sint;
+ cl_arg_types[14] = &ffi_type_double;
+ cl_arg_types[15] = &ffi_type_double;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0,
+ (void *) 3 /* userdata */, code) == FFI_OK);
+
+ res = (*((closure_test_type0)code))
+ (1, 2, 3, 4, 127, 429., 7., 8., 9.5, 10., 11, 12., 13,
+ 19, 21., 1.);
+ /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 680" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c
new file mode 100644
index 0000000000..b3afa0bbdf
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c
@@ -0,0 +1,95 @@
+/* Area: closure_call
+ Purpose: Check multiple values passing from different type.
+ Also, exceed the limit of gpr and fpr registers on PowerPC
+ Darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+
+
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void
+closure_loc_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
+ (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] +
+ (int)(*(signed short *)args[4]) +
+ (int)(*(unsigned long long *)args[5]) +
+ (int)*(int *)args[6] + (int)(*(int *)args[7]) +
+ (int)(*(double *)args[8]) + (int)*(int *)args[9] +
+ (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
+ (int)*(int *)args[12] + (int)(*(int *)args[13]) +
+ (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]),
+ (int)(*(unsigned long long *)args[2]),
+ (int)*(int *)args[3], (int)(*(signed short *)args[4]),
+ (int)(*(unsigned long long *)args[5]),
+ (int)*(int *)args[6], (int)(*(int *)args[7]),
+ (int)(*(double *)args[8]), (int)*(int *)args[9],
+ (int)(*(int *)args[10]), (int)(*(float *)args[11]),
+ (int)*(int *)args[12], (int)(*(int *)args[13]),
+ (int)(*(int *)args[14]),*(int *)args[15],
+ (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
+
+}
+
+typedef int (*closure_loc_test_type0)(unsigned long long, int, unsigned long long,
+ int, signed short, unsigned long long, int,
+ int, double, int, int, float, int, int,
+ int, int);
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_closure *pcl;
+ ffi_type * cl_arg_types[17];
+ int res;
+ void *codeloc;
+
+ cl_arg_types[0] = &ffi_type_uint64;
+ cl_arg_types[1] = &ffi_type_sint;
+ cl_arg_types[2] = &ffi_type_uint64;
+ cl_arg_types[3] = &ffi_type_sint;
+ cl_arg_types[4] = &ffi_type_sshort;
+ cl_arg_types[5] = &ffi_type_uint64;
+ cl_arg_types[6] = &ffi_type_sint;
+ cl_arg_types[7] = &ffi_type_sint;
+ cl_arg_types[8] = &ffi_type_double;
+ cl_arg_types[9] = &ffi_type_sint;
+ cl_arg_types[10] = &ffi_type_sint;
+ cl_arg_types[11] = &ffi_type_float;
+ cl_arg_types[12] = &ffi_type_sint;
+ cl_arg_types[13] = &ffi_type_sint;
+ cl_arg_types[14] = &ffi_type_sint;
+ cl_arg_types[15] = &ffi_type_sint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ pcl = ffi_closure_alloc(sizeof(ffi_closure), &codeloc);
+ CHECK(pcl != NULL);
+ CHECK(codeloc != NULL);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_loc_test_fn0,
+ (void *) 3 /* userdata */, codeloc) == FFI_OK);
+
+ CHECK(memcmp(pcl, codeloc, sizeof(*pcl)) == 0);
+
+ res = (*((closure_loc_test_type0)codeloc))
+ (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
+ 19, 21, 1);
+ /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 680" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c
new file mode 100644
index 0000000000..6bfcc1fbb5
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c
@@ -0,0 +1,64 @@
+/* Area: closure_call (stdcall convention)
+ Purpose: Check handling when caller expects stdcall callee
+ Limitations: none.
+ PR: none.
+ Originator: <twalljava@dev.java.net> */
+
+/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
+#include "ffitest.h"
+
+static void
+closure_test_stdcall(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(int *)args[0] + (int)(*(int *)args[1])
+ + (int)(*(int *)args[2]) + (int)(*(int *)args[3])
+ + (int)(intptr_t)userdata;
+
+ printf("%d %d %d %d: %d\n",
+ (int)*(int *)args[0], (int)(*(int *)args[1]),
+ (int)(*(int *)args[2]), (int)(*(int *)args[3]),
+ (int)*(ffi_arg *)resp);
+
+}
+
+typedef int (__stdcall *closure_test_type0)(int, int, int, int);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[17];
+ int res;
+ void* sp_pre;
+ void* sp_post;
+ char buf[1024];
+
+ cl_arg_types[0] = &ffi_type_uint;
+ cl_arg_types[1] = &ffi_type_uint;
+ cl_arg_types[2] = &ffi_type_uint;
+ cl_arg_types[3] = &ffi_type_uint;
+ cl_arg_types[4] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 4,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_stdcall,
+ (void *) 3 /* userdata */, code) == FFI_OK);
+
+ asm volatile (" movl %%esp,%0" : "=g" (sp_pre));
+ res = (*(closure_test_type0)code)(0, 1, 2, 3);
+ asm volatile (" movl %%esp,%0" : "=g" (sp_post));
+ /* { dg-output "0 1 2 3: 9" } */
+
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 9" } */
+
+ sprintf(buf, "mismatch: pre=%p vs post=%p", sp_pre, sp_post);
+ printf("stack pointer %s\n", (sp_pre == sp_post ? "match" : buf));
+ /* { dg-output "\nstack pointer match" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_12byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_12byte.c
new file mode 100644
index 0000000000..f0a334fa79
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_12byte.c
@@ -0,0 +1,94 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_12byte {
+ int a;
+ int b;
+ int c;
+} cls_struct_12byte;
+
+cls_struct_12byte cls_struct_12byte_fn(struct cls_struct_12byte b1,
+ struct cls_struct_12byte b2)
+{
+ struct cls_struct_12byte result;
+
+ result.a = b1.a + b2.a;
+ result.b = b1.b + b2.b;
+ result.c = b1.c + b2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c,
+ result.a, result.b, result.c);
+
+ return result;
+}
+
+static void cls_struct_12byte_gn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args , void* userdata __UNUSED__)
+{
+ struct cls_struct_12byte b1, b2;
+
+ b1 = *(struct cls_struct_12byte*)(args[0]);
+ b2 = *(struct cls_struct_12byte*)(args[1]);
+
+ *(cls_struct_12byte*)resp = cls_struct_12byte_fn(b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_12byte h_dbl = { 7, 4, 9 };
+ struct cls_struct_12byte j_dbl = { 1, 5, 3 };
+ struct cls_struct_12byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_sint;
+ cls_struct_fields[1] = &ffi_type_sint;
+ cls_struct_fields[2] = &ffi_type_sint;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &h_dbl;
+ args_dbl[1] = &j_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_12byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "7 4 9 1 5 3: 8 9 12" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 8 9 12" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_12byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl.a = 0;
+ res_dbl.b = 0;
+ res_dbl.c = 0;
+
+ res_dbl = ((cls_struct_12byte(*)(cls_struct_12byte, cls_struct_12byte))(code))(h_dbl, j_dbl);
+ /* { dg-output "\n7 4 9 1 5 3: 8 9 12" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 8 9 12" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_16byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_16byte.c
new file mode 100644
index 0000000000..9b9292ab05
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_16byte.c
@@ -0,0 +1,95 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_16byte {
+ int a;
+ double b;
+ int c;
+} cls_struct_16byte;
+
+cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1,
+ struct cls_struct_16byte b2)
+{
+ struct cls_struct_16byte result;
+
+ result.a = b1.a + b2.a;
+ result.b = b1.b + b2.b;
+ result.c = b1.c + b2.c;
+
+ printf("%d %g %d %d %g %d: %d %g %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c,
+ result.a, result.b, result.c);
+
+ return result;
+}
+
+static void cls_struct_16byte_gn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+{
+ struct cls_struct_16byte b1, b2;
+
+ b1 = *(struct cls_struct_16byte*)(args[0]);
+ b2 = *(struct cls_struct_16byte*)(args[1]);
+
+ *(cls_struct_16byte*)resp = cls_struct_16byte_fn(b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_16byte h_dbl = { 7, 8.0, 9 };
+ struct cls_struct_16byte j_dbl = { 1, 9.0, 3 };
+ struct cls_struct_16byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_sint;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_sint;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &h_dbl;
+ args_dbl[1] = &j_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_16byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "7 8 9 1 9 3: 8 17 12" } */
+ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 8 17 12" } */
+
+ res_dbl.a = 0;
+ res_dbl.b = 0.0;
+ res_dbl.c = 0;
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_16byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_16byte(*)(cls_struct_16byte, cls_struct_16byte))(code))(h_dbl, j_dbl);
+ /* { dg-output "\n7 8 9 1 9 3: 8 17 12" } */
+ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 8 17 12" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_18byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_18byte.c
new file mode 100644
index 0000000000..40c8c6d96a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_18byte.c
@@ -0,0 +1,96 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Double alignment check on darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030915 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_18byte {
+ double a;
+ unsigned char b;
+ unsigned char c;
+ double d;
+} cls_struct_18byte;
+
+cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1,
+ struct cls_struct_18byte a2)
+{
+ struct cls_struct_18byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+
+
+ printf("%g %d %d %g %g %d %d %g: %g %d %d %g\n", a1.a, a1.b, a1.c, a1.d,
+ a2.a, a2.b, a2.c, a2.d,
+ result.a, result.b, result.c, result.d);
+ return result;
+}
+
+static void
+cls_struct_18byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_18byte a1, a2;
+
+ a1 = *(struct cls_struct_18byte*)(args[0]);
+ a2 = *(struct cls_struct_18byte*)(args[1]);
+
+ *(cls_struct_18byte*)resp = cls_struct_18byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[5];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_18byte g_dbl = { 1.0, 127, 126, 3.0 };
+ struct cls_struct_18byte f_dbl = { 4.0, 125, 124, 5.0 };
+ struct cls_struct_18byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_18byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 127 126 3 4 125 124 5: 5 252 250 8" } */
+ printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 5 252 250 8" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_18byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_18byte(*)(cls_struct_18byte, cls_struct_18byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n1 127 126 3 4 125 124 5: 5 252 250 8" } */
+ printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 5 252 250 8" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_19byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_19byte.c
new file mode 100644
index 0000000000..aa6424818f
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_19byte.c
@@ -0,0 +1,102 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Double alignment check on darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030915 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_19byte {
+ double a;
+ unsigned char b;
+ unsigned char c;
+ double d;
+ unsigned char e;
+} cls_struct_19byte;
+
+cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1,
+ struct cls_struct_19byte a2)
+{
+ struct cls_struct_19byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+ result.e = a1.e + a2.e;
+
+
+ printf("%g %d %d %g %d %g %d %d %g %d: %g %d %d %g %d\n",
+ a1.a, a1.b, a1.c, a1.d, a1.e,
+ a2.a, a2.b, a2.c, a2.d, a2.e,
+ result.a, result.b, result.c, result.d, result.e);
+ return result;
+}
+
+static void
+cls_struct_19byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_19byte a1, a2;
+
+ a1 = *(struct cls_struct_19byte*)(args[0]);
+ a2 = *(struct cls_struct_19byte*)(args[1]);
+
+ *(cls_struct_19byte*)resp = cls_struct_19byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[6];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_19byte g_dbl = { 1.0, 127, 126, 3.0, 120 };
+ struct cls_struct_19byte f_dbl = { 4.0, 125, 124, 5.0, 119 };
+ struct cls_struct_19byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = &ffi_type_uchar;
+ cls_struct_fields[5] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_19byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
+ printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e);
+ /* { dg-output "\nres: 5 252 250 8 239" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_19byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_19byte(*)(cls_struct_19byte, cls_struct_19byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
+ printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e);
+ /* { dg-output "\nres: 5 252 250 8 239" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c
new file mode 100644
index 0000000000..b9402d678a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c
@@ -0,0 +1,89 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Especially with small structures which may fit in one
+ register. Depending on the ABI.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030902 */
+
+
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_1_1byte {
+ unsigned char a;
+} cls_struct_1_1byte;
+
+cls_struct_1_1byte cls_struct_1_1byte_fn(struct cls_struct_1_1byte a1,
+ struct cls_struct_1_1byte a2)
+{
+ struct cls_struct_1_1byte result;
+
+ result.a = a1.a + a2.a;
+
+ printf("%d %d: %d\n", a1.a, a2.a, result.a);
+
+ return result;
+}
+
+static void
+cls_struct_1_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_1_1byte a1, a2;
+
+ a1 = *(struct cls_struct_1_1byte*)(args[0]);
+ a2 = *(struct cls_struct_1_1byte*)(args[1]);
+
+ *(cls_struct_1_1byte*)resp = cls_struct_1_1byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[2];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_1_1byte g_dbl = { 12 };
+ struct cls_struct_1_1byte f_dbl = { 178 };
+ struct cls_struct_1_1byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_1_1byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 178: 190" } */
+ printf("res: %d\n", res_dbl.a);
+ /* { dg-output "\nres: 190" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_1_1byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_1_1byte(*)(cls_struct_1_1byte, cls_struct_1_1byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 178: 190" } */
+ printf("res: %d\n", res_dbl.a);
+ /* { dg-output "\nres: 190" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte.c
new file mode 100644
index 0000000000..80dd7ac931
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte.c
@@ -0,0 +1,91 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_20byte {
+ double a;
+ double b;
+ int c;
+} cls_struct_20byte;
+
+cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
+ struct cls_struct_20byte a2)
+{
+ struct cls_struct_20byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%g %g %d %g %g %d: %g %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
+ result.a, result.b, result.c);
+ return result;
+}
+
+static void
+cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_20byte a1, a2;
+
+ a1 = *(struct cls_struct_20byte*)(args[0]);
+ a2 = *(struct cls_struct_20byte*)(args[1]);
+
+ *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_20byte g_dbl = { 1.0, 2.0, 3 };
+ struct cls_struct_20byte f_dbl = { 4.0, 5.0, 7 };
+ struct cls_struct_20byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_sint;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 2 3 4 5 7: 5 7 10" } */
+ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 5 7 10" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
+ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 5 7 10" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte1.c
new file mode 100644
index 0000000000..50bcbbf831
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte1.c
@@ -0,0 +1,93 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_20byte {
+ int a;
+ double b;
+ double c;
+} cls_struct_20byte;
+
+cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
+ struct cls_struct_20byte a2)
+{
+ struct cls_struct_20byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %g %g %d %g %g: %d %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
+ result.a, result.b, result.c);
+ return result;
+}
+
+static void
+cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_20byte a1, a2;
+
+ a1 = *(struct cls_struct_20byte*)(args[0]);
+ a2 = *(struct cls_struct_20byte*)(args[1]);
+
+ *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_20byte g_dbl = { 1, 2.0, 3.0 };
+ struct cls_struct_20byte f_dbl = { 4, 5.0, 7.0 };
+ struct cls_struct_20byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_sint;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_double;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 2 3 4 5 7: 5 7 10" } */
+ printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 5 7 10" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
+ printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 5 7 10" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_24byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_24byte.c
new file mode 100644
index 0000000000..46a6eb4d31
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_24byte.c
@@ -0,0 +1,113 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_24byte {
+ double a;
+ double b;
+ int c;
+ float d;
+} cls_struct_24byte;
+
+cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0,
+ struct cls_struct_24byte b1,
+ struct cls_struct_24byte b2,
+ struct cls_struct_24byte b3)
+{
+ struct cls_struct_24byte result;
+
+ result.a = b0.a + b1.a + b2.a + b3.a;
+ result.b = b0.b + b1.b + b2.b + b3.b;
+ result.c = b0.c + b1.c + b2.c + b3.c;
+ result.d = b0.d + b1.d + b2.d + b3.d;
+
+ printf("%g %g %d %g %g %g %d %g %g %g %d %g %g %g %d %g: %g %g %d %g\n",
+ b0.a, b0.b, b0.c, b0.d,
+ b1.a, b1.b, b1.c, b1.d,
+ b2.a, b2.b, b2.c, b2.d,
+ b3.a, b3.b, b3.c, b2.d,
+ result.a, result.b, result.c, result.d);
+
+ return result;
+}
+
+static void
+cls_struct_24byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_24byte b0, b1, b2, b3;
+
+ b0 = *(struct cls_struct_24byte*)(args[0]);
+ b1 = *(struct cls_struct_24byte*)(args[1]);
+ b2 = *(struct cls_struct_24byte*)(args[2]);
+ b3 = *(struct cls_struct_24byte*)(args[3]);
+
+ *(cls_struct_24byte*)resp = cls_struct_24byte_fn(b0, b1, b2, b3);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[5];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_24byte e_dbl = { 9.0, 2.0, 6, 5.0 };
+ struct cls_struct_24byte f_dbl = { 1.0, 2.0, 3, 7.0 };
+ struct cls_struct_24byte g_dbl = { 4.0, 5.0, 7, 9.0 };
+ struct cls_struct_24byte h_dbl = { 8.0, 6.0, 1, 4.0 };
+ struct cls_struct_24byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_sint;
+ cls_struct_fields[3] = &ffi_type_float;
+ cls_struct_fields[4] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = &cls_struct_type;
+ dbl_arg_types[3] = &cls_struct_type;
+ dbl_arg_types[4] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = &h_dbl;
+ args_dbl[4] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
+ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 22 15 17 25" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_24byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_24byte(*)(cls_struct_24byte,
+ cls_struct_24byte,
+ cls_struct_24byte,
+ cls_struct_24byte))
+ (code))(e_dbl, f_dbl, g_dbl, h_dbl);
+ /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
+ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 22 15 17 25" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_2byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_2byte.c
new file mode 100644
index 0000000000..101e130a1f
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_2byte.c
@@ -0,0 +1,90 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Especially with small structures which may fit in one
+ register. Depending on the ABI.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_2byte {
+ unsigned char a;
+ unsigned char b;
+} cls_struct_2byte;
+
+cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1,
+ struct cls_struct_2byte a2)
+{
+ struct cls_struct_2byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+
+ printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
+
+ return result;
+}
+
+static void
+cls_struct_2byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_2byte a1, a2;
+
+ a1 = *(struct cls_struct_2byte*)(args[0]);
+ a2 = *(struct cls_struct_2byte*)(args[1]);
+
+ *(cls_struct_2byte*)resp = cls_struct_2byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_2byte g_dbl = { 12, 127 };
+ struct cls_struct_2byte f_dbl = { 1, 13 };
+ struct cls_struct_2byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_2byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 127 1 13: 13 140" } */
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 13 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_2byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_2byte(*)(cls_struct_2byte, cls_struct_2byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 127 1 13: 13 140" } */
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 13 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c
new file mode 100644
index 0000000000..fc780c30d6
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c
@@ -0,0 +1,95 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Especially with small structures which may fit in one
+ register. Depending on the ABI.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030902 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_3_1byte {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+} cls_struct_3_1byte;
+
+cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1,
+ struct cls_struct_3_1byte a2)
+{
+ struct cls_struct_3_1byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c,
+ a2.a, a2.b, a2.c,
+ result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_3_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_3_1byte a1, a2;
+
+ a1 = *(struct cls_struct_3_1byte*)(args[0]);
+ a2 = *(struct cls_struct_3_1byte*)(args[1]);
+
+ *(cls_struct_3_1byte*)resp = cls_struct_3_1byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_3_1byte g_dbl = { 12, 13, 14 };
+ struct cls_struct_3_1byte f_dbl = { 178, 179, 180 };
+ struct cls_struct_3_1byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_3_1byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 13 14 178 179 180: 190 192 194" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 190 192 194" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3_1byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_3_1byte(*)(cls_struct_3_1byte, cls_struct_3_1byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 13 14 178 179 180: 190 192 194" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 190 192 194" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte1.c
new file mode 100644
index 0000000000..5705ce3879
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte1.c
@@ -0,0 +1,90 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Especially with small structures which may fit in one
+ register. Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_3byte {
+ unsigned short a;
+ unsigned char b;
+} cls_struct_3byte;
+
+cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1,
+ struct cls_struct_3byte a2)
+{
+ struct cls_struct_3byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+
+ printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
+
+ return result;
+}
+
+static void
+cls_struct_3byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_3byte a1, a2;
+
+ a1 = *(struct cls_struct_3byte*)(args[0]);
+ a2 = *(struct cls_struct_3byte*)(args[1]);
+
+ *(cls_struct_3byte*)resp = cls_struct_3byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_3byte g_dbl = { 12, 119 };
+ struct cls_struct_3byte f_dbl = { 1, 15 };
+ struct cls_struct_3byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_ushort;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_3byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 119 1 15: 13 134" } */
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 13 134" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_3byte(*)(cls_struct_3byte, cls_struct_3byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 119 1 15: 13 134" } */
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 13 134" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte2.c
new file mode 100644
index 0000000000..01770a0750
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte2.c
@@ -0,0 +1,90 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Especially with small structures which may fit in one
+ register. Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_3byte_1 {
+ unsigned char a;
+ unsigned short b;
+} cls_struct_3byte_1;
+
+cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1,
+ struct cls_struct_3byte_1 a2)
+{
+ struct cls_struct_3byte_1 result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+
+ printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
+
+ return result;
+}
+
+static void
+cls_struct_3byte_gn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_3byte_1 a1, a2;
+
+ a1 = *(struct cls_struct_3byte_1*)(args[0]);
+ a2 = *(struct cls_struct_3byte_1*)(args[1]);
+
+ *(cls_struct_3byte_1*)resp = cls_struct_3byte_fn1(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_3byte_1 g_dbl = { 15, 125 };
+ struct cls_struct_3byte_1 f_dbl = { 9, 19 };
+ struct cls_struct_3byte_1 res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_ushort;
+ cls_struct_fields[2] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_3byte_fn1), &res_dbl, args_dbl);
+ /* { dg-output "15 125 9 19: 24 144" } */
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 24 144" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn1, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_3byte_1(*)(cls_struct_3byte_1, cls_struct_3byte_1))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n15 125 9 19: 24 144" } */
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 24 144" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c
new file mode 100644
index 0000000000..f3806d7ba1
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Especially with small structures which may fit in one
+ register. Depending on the ABI.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030902 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_4_1byte {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+} cls_struct_4_1byte;
+
+cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1,
+ struct cls_struct_4_1byte a2)
+{
+ struct cls_struct_4_1byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+
+ printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
+ a2.a, a2.b, a2.c, a2.d,
+ result.a, result.b, result.c, result.d);
+
+ return result;
+}
+
+static void
+cls_struct_4_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_4_1byte a1, a2;
+
+ a1 = *(struct cls_struct_4_1byte*)(args[0]);
+ a2 = *(struct cls_struct_4_1byte*)(args[1]);
+
+ *(cls_struct_4_1byte*)resp = cls_struct_4_1byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[5];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_4_1byte g_dbl = { 12, 13, 14, 15 };
+ struct cls_struct_4_1byte f_dbl = { 178, 179, 180, 181 };
+ struct cls_struct_4_1byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_uchar;
+ cls_struct_fields[4] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_4_1byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 190 192 194 196" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4_1byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_4_1byte(*)(cls_struct_4_1byte, cls_struct_4_1byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 190 192 194 196" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4byte.c
new file mode 100644
index 0000000000..a1aba3c09d
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4byte.c
@@ -0,0 +1,90 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+typedef struct cls_struct_4byte {
+ unsigned short a;
+ unsigned short b;
+} cls_struct_4byte;
+
+cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1,
+ struct cls_struct_4byte a2)
+{
+ struct cls_struct_4byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+
+ printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
+
+ return result;
+}
+
+static void
+cls_struct_4byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_4byte a1, a2;
+
+ a1 = *(struct cls_struct_4byte*)(args[0]);
+ a2 = *(struct cls_struct_4byte*)(args[1]);
+
+ *(cls_struct_4byte*)resp = cls_struct_4byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_4byte g_dbl = { 127, 120 };
+ struct cls_struct_4byte f_dbl = { 12, 128 };
+ struct cls_struct_4byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_ushort;
+ cls_struct_fields[1] = &ffi_type_ushort;
+ cls_struct_fields[2] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_4byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "127 120 12 128: 139 248" } */
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 139 248" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_4byte(*)(cls_struct_4byte, cls_struct_4byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n127 120 12 128: 139 248" } */
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 139 248" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c
new file mode 100644
index 0000000000..2ceba3ddb2
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c
@@ -0,0 +1,109 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050708 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_5byte {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+} cls_struct_5byte;
+
+cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
+ struct cls_struct_5byte a2)
+{
+ struct cls_struct_5byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+ result.e = a1.e + a2.e;
+
+ printf("%d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d\n",
+ a1.a, a1.b, a1.c, a1.d, a1.e,
+ a2.a, a2.b, a2.c, a2.d, a2.e,
+ result.a, result.b, result.c, result.d, result.e);
+
+ return result;
+}
+
+static void
+cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_5byte a1, a2;
+
+ a1 = *(struct cls_struct_5byte*)(args[0]);
+ a2 = *(struct cls_struct_5byte*)(args[1]);
+
+ *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[6];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_5byte g_dbl = { 127, 120, 1, 3, 4 };
+ struct cls_struct_5byte f_dbl = { 12, 128, 9, 3, 4 };
+ struct cls_struct_5byte res_dbl = { 0, 0, 0, 0, 0 };
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_uchar;
+ cls_struct_fields[4] = &ffi_type_uchar;
+ cls_struct_fields[5] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */
+ printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e);
+ /* { dg-output "\nres: 139 248 10 6 8" } */
+
+ res_dbl.a = 0;
+ res_dbl.b = 0;
+ res_dbl.c = 0;
+ res_dbl.d = 0;
+ res_dbl.e = 0;
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_5byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */
+ printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e);
+ /* { dg-output "\nres: 139 248 10 6 8" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5byte.c
new file mode 100644
index 0000000000..61d595c2bf
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5byte.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_5byte {
+ unsigned short a;
+ unsigned short b;
+ unsigned char c;
+} cls_struct_5byte;
+
+cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
+ struct cls_struct_5byte a2)
+{
+ struct cls_struct_5byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c,
+ a2.a, a2.b, a2.c,
+ result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_5byte a1, a2;
+
+ a1 = *(struct cls_struct_5byte*)(args[0]);
+ a2 = *(struct cls_struct_5byte*)(args[1]);
+
+ *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_5byte g_dbl = { 127, 120, 1 };
+ struct cls_struct_5byte f_dbl = { 12, 128, 9 };
+ struct cls_struct_5byte res_dbl = { 0, 0, 0 };
+
+ cls_struct_fields[0] = &ffi_type_ushort;
+ cls_struct_fields[1] = &ffi_type_ushort;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "127 120 1 12 128 9: 139 248 10" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 139 248 10" } */
+
+ res_dbl.a = 0;
+ res_dbl.b = 0;
+ res_dbl.c = 0;
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_5byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 139 248 10" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_64byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_64byte.c
new file mode 100644
index 0000000000..576ebe0cc2
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_64byte.c
@@ -0,0 +1,124 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check bigger struct which overlaps
+ the gp and fp register count on Darwin/AIX/ppc64.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_64byte {
+ double a;
+ double b;
+ double c;
+ double d;
+ double e;
+ double f;
+ double g;
+ double h;
+} cls_struct_64byte;
+
+cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0,
+ struct cls_struct_64byte b1,
+ struct cls_struct_64byte b2,
+ struct cls_struct_64byte b3)
+{
+ struct cls_struct_64byte result;
+
+ result.a = b0.a + b1.a + b2.a + b3.a;
+ result.b = b0.b + b1.b + b2.b + b3.b;
+ result.c = b0.c + b1.c + b2.c + b3.c;
+ result.d = b0.d + b1.d + b2.d + b3.d;
+ result.e = b0.e + b1.e + b2.e + b3.e;
+ result.f = b0.f + b1.f + b2.f + b3.f;
+ result.g = b0.g + b1.g + b2.g + b3.g;
+ result.h = b0.h + b1.h + b2.h + b3.h;
+
+ printf("%g %g %g %g %g %g %g %g\n", result.a, result.b, result.c,
+ result.d, result.e, result.f, result.g, result.h);
+
+ return result;
+}
+
+static void
+cls_struct_64byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_64byte b0, b1, b2, b3;
+
+ b0 = *(struct cls_struct_64byte*)(args[0]);
+ b1 = *(struct cls_struct_64byte*)(args[1]);
+ b2 = *(struct cls_struct_64byte*)(args[2]);
+ b3 = *(struct cls_struct_64byte*)(args[3]);
+
+ *(cls_struct_64byte*)resp = cls_struct_64byte_fn(b0, b1, b2, b3);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[9];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_64byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0 };
+ struct cls_struct_64byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0 };
+ struct cls_struct_64byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0 };
+ struct cls_struct_64byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0 };
+ struct cls_struct_64byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_double;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = &ffi_type_double;
+ cls_struct_fields[5] = &ffi_type_double;
+ cls_struct_fields[6] = &ffi_type_double;
+ cls_struct_fields[7] = &ffi_type_double;
+ cls_struct_fields[8] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = &cls_struct_type;
+ dbl_arg_types[3] = &cls_struct_type;
+ dbl_arg_types[4] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = &h_dbl;
+ args_dbl[4] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_64byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "22 15 17 25 6 13 19 18" } */
+ printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_64byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_64byte(*)(cls_struct_64byte,
+ cls_struct_64byte,
+ cls_struct_64byte,
+ cls_struct_64byte))
+ (code))(e_dbl, f_dbl, g_dbl, h_dbl);
+ /* { dg-output "\n22 15 17 25 6 13 19 18" } */
+ printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c
new file mode 100644
index 0000000000..9f2eff68c1
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c
@@ -0,0 +1,113 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050708 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_6byte {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+} cls_struct_6byte;
+
+cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
+ struct cls_struct_6byte a2)
+{
+ struct cls_struct_6byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+ result.e = a1.e + a2.e;
+ result.f = a1.f + a2.f;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d\n",
+ a1.a, a1.b, a1.c, a1.d, a1.e, a1.f,
+ a2.a, a2.b, a2.c, a2.d, a2.e, a2.f,
+ result.a, result.b, result.c, result.d, result.e, result.f);
+
+ return result;
+}
+
+static void
+cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_6byte a1, a2;
+
+ a1 = *(struct cls_struct_6byte*)(args[0]);
+ a2 = *(struct cls_struct_6byte*)(args[1]);
+
+ *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[7];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_6byte g_dbl = { 127, 120, 1, 3, 4, 5 };
+ struct cls_struct_6byte f_dbl = { 12, 128, 9, 3, 4, 5 };
+ struct cls_struct_6byte res_dbl = { 0, 0, 0, 0, 0, 0 };
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_uchar;
+ cls_struct_fields[4] = &ffi_type_uchar;
+ cls_struct_fields[5] = &ffi_type_uchar;
+ cls_struct_fields[6] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */
+ printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f);
+ /* { dg-output "\nres: 139 248 10 6 8 10" } */
+
+ res_dbl.a = 0;
+ res_dbl.b = 0;
+ res_dbl.c = 0;
+ res_dbl.d = 0;
+ res_dbl.e = 0;
+ res_dbl.f = 0;
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */
+ printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f);
+ /* { dg-output "\nres: 139 248 10 6 8 10" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6byte.c
new file mode 100644
index 0000000000..73257b0989
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6byte.c
@@ -0,0 +1,99 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_6byte {
+ unsigned short a;
+ unsigned short b;
+ unsigned char c;
+ unsigned char d;
+} cls_struct_6byte;
+
+cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
+ struct cls_struct_6byte a2)
+{
+ struct cls_struct_6byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+
+ printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
+ a2.a, a2.b, a2.c, a2.d,
+ result.a, result.b, result.c, result.d);
+
+ return result;
+}
+
+static void
+cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_6byte a1, a2;
+
+ a1 = *(struct cls_struct_6byte*)(args[0]);
+ a2 = *(struct cls_struct_6byte*)(args[1]);
+
+ *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[5];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_6byte g_dbl = { 127, 120, 1, 128 };
+ struct cls_struct_6byte f_dbl = { 12, 128, 9, 127 };
+ struct cls_struct_6byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_ushort;
+ cls_struct_fields[1] = &ffi_type_ushort;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_uchar;
+ cls_struct_fields[4] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 139 248 10 255" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 139 248 10 255" } */
+
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c
new file mode 100644
index 0000000000..50d09c9da7
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c
@@ -0,0 +1,117 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050708 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_7byte {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+} cls_struct_7byte;
+
+cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
+ struct cls_struct_7byte a2)
+{
+ struct cls_struct_7byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+ result.e = a1.e + a2.e;
+ result.f = a1.f + a2.f;
+ result.g = a1.g + a2.g;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d %d\n",
+ a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
+ a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
+ result.a, result.b, result.c, result.d, result.e, result.f, result.g);
+
+ return result;
+}
+
+static void
+cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_7byte a1, a2;
+
+ a1 = *(struct cls_struct_7byte*)(args[0]);
+ a2 = *(struct cls_struct_7byte*)(args[1]);
+
+ *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[8];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_7byte g_dbl = { 127, 120, 1, 3, 4, 5, 6 };
+ struct cls_struct_7byte f_dbl = { 12, 128, 9, 3, 4, 5, 6 };
+ struct cls_struct_7byte res_dbl = { 0, 0, 0, 0, 0, 0, 0 };
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_uchar;
+ cls_struct_fields[4] = &ffi_type_uchar;
+ cls_struct_fields[5] = &ffi_type_uchar;
+ cls_struct_fields[6] = &ffi_type_uchar;
+ cls_struct_fields[7] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */
+ printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
+ /* { dg-output "\nres: 139 248 10 6 8 10 12" } */
+
+ res_dbl.a = 0;
+ res_dbl.b = 0;
+ res_dbl.c = 0;
+ res_dbl.d = 0;
+ res_dbl.e = 0;
+ res_dbl.f = 0;
+ res_dbl.g = 0;
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */
+ printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
+ /* { dg-output "\nres: 139 248 10 6 8 10 12" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7byte.c
new file mode 100644
index 0000000000..f5c0000315
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7byte.c
@@ -0,0 +1,97 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_7byte {
+ unsigned short a;
+ unsigned short b;
+ unsigned char c;
+ unsigned short d;
+} cls_struct_7byte;
+
+cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
+ struct cls_struct_7byte a2)
+{
+ struct cls_struct_7byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+
+ printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
+ a2.a, a2.b, a2.c, a2.d,
+ result.a, result.b, result.c, result.d);
+
+ return result;
+}
+
+static void
+cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_7byte a1, a2;
+
+ a1 = *(struct cls_struct_7byte*)(args[0]);
+ a2 = *(struct cls_struct_7byte*)(args[1]);
+
+ *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[5];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_7byte g_dbl = { 127, 120, 1, 254 };
+ struct cls_struct_7byte f_dbl = { 12, 128, 9, 255 };
+ struct cls_struct_7byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_ushort;
+ cls_struct_fields[1] = &ffi_type_ushort;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_ushort;
+ cls_struct_fields[4] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 139 248 10 509" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 139 248 10 509" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_8byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_8byte.c
new file mode 100644
index 0000000000..4aa99d12e4
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_8byte.c
@@ -0,0 +1,88 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_8byte {
+ int a;
+ float b;
+} cls_struct_8byte;
+
+cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1,
+ struct cls_struct_8byte a2)
+{
+ struct cls_struct_8byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+
+ printf("%d %g %d %g: %d %g\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
+
+ return result;
+}
+
+static void
+cls_struct_8byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_8byte a1, a2;
+
+ a1 = *(struct cls_struct_8byte*)(args[0]);
+ a2 = *(struct cls_struct_8byte*)(args[1]);
+
+ *(cls_struct_8byte*)resp = cls_struct_8byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_8byte g_dbl = { 1, 2.0 };
+ struct cls_struct_8byte f_dbl = { 4, 5.0 };
+ struct cls_struct_8byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_sint;
+ cls_struct_fields[1] = &ffi_type_float;
+ cls_struct_fields[2] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_8byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 2 4 5: 5 7" } */
+ printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 5 7" } */
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_8byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_8byte(*)(cls_struct_8byte, cls_struct_8byte))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n1 2 4 5: 5 7" } */
+ printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 5 7" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte1.c
new file mode 100644
index 0000000000..cc5e9d6c4e
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte1.c
@@ -0,0 +1,90 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Darwin/AIX do double-word
+ alignment of the struct if the first element is a double.
+ Check that it does not here.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030914 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_9byte {
+ int a;
+ double b;
+} cls_struct_9byte;
+
+cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
+ struct cls_struct_9byte b2)
+{
+ struct cls_struct_9byte result;
+
+ result.a = b1.a + b2.a;
+ result.b = b1.b + b2.b;
+
+ printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b,
+ result.a, result.b);
+
+ return result;
+}
+
+static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+{
+ struct cls_struct_9byte b1, b2;
+
+ b1 = *(struct cls_struct_9byte*)(args[0]);
+ b2 = *(struct cls_struct_9byte*)(args[1]);
+
+ *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_9byte h_dbl = { 7, 8.0};
+ struct cls_struct_9byte j_dbl = { 1, 9.0};
+ struct cls_struct_9byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_sint;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &h_dbl;
+ args_dbl[1] = &j_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "7 8 1 9: 8 17" } */
+ printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 8 17" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(code))(h_dbl, j_dbl);
+ /* { dg-output "\n7 8 1 9: 8 17" } */
+ printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 8 17" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte2.c
new file mode 100644
index 0000000000..5c0ba0d4b8
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte2.c
@@ -0,0 +1,91 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Darwin/AIX do double-word
+ alignment of the struct if the first element is a double.
+ Check that it does here.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030914 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_9byte {
+ double a;
+ int b;
+} cls_struct_9byte;
+
+cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
+ struct cls_struct_9byte b2)
+{
+ struct cls_struct_9byte result;
+
+ result.a = b1.a + b2.a;
+ result.b = b1.b + b2.b;
+
+ printf("%g %d %g %d: %g %d\n", b1.a, b1.b, b2.a, b2.b,
+ result.a, result.b);
+
+ return result;
+}
+
+static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+{
+ struct cls_struct_9byte b1, b2;
+
+ b1 = *(struct cls_struct_9byte*)(args[0]);
+ b2 = *(struct cls_struct_9byte*)(args[1]);
+
+ *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_9byte h_dbl = { 7.0, 8};
+ struct cls_struct_9byte j_dbl = { 1.0, 9};
+ struct cls_struct_9byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_sint;
+ cls_struct_fields[2] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &h_dbl;
+ args_dbl[1] = &j_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "7 8 1 9: 8 17" } */
+ printf("res: %g %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 8 17" } */
+
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(code))(h_dbl, j_dbl);
+ /* { dg-output "\n7 8 1 9: 8 17" } */
+ printf("res: %g %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 8 17" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_double.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_double.c
new file mode 100644
index 0000000000..22b94d5a09
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_double.c
@@ -0,0 +1,93 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of double.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ double b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_float.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_float.c
new file mode 100644
index 0000000000..62637f21d1
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_float.c
@@ -0,0 +1,91 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of float.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ float b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_float;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c
new file mode 100644
index 0000000000..af380603c9
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c
@@ -0,0 +1,92 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of long double.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ long double b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_longdouble;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c
new file mode 100644
index 0000000000..4274af108a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c
@@ -0,0 +1,134 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of long double.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
+/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ long double a;
+ long double b;
+ long double c;
+ long double d;
+ long double e;
+ long double f;
+ long double g;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(
+ cls_struct_align a1,
+ cls_struct_align a2)
+{
+ struct cls_struct_align r;
+
+ r.a = a1.a + a2.a;
+ r.b = a1.b + a2.b;
+ r.c = a1.c + a2.c;
+ r.d = a1.d + a2.d;
+ r.e = a1.e + a2.e;
+ r.f = a1.f + a2.f;
+ r.g = a1.g + a2.g;
+
+ printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: "
+ "%Lg %Lg %Lg %Lg %Lg %Lg %Lg\n",
+ a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
+ a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
+ r.a, r.b, r.c, r.d, r.e, r.f, r.g);
+
+ return r;
+}
+
+cls_struct_align cls_struct_align_fn2(
+ cls_struct_align a1)
+{
+ struct cls_struct_align r;
+
+ r.a = a1.a + 1;
+ r.b = a1.b + 1;
+ r.c = a1.c + 1;
+ r.d = a1.d + 1;
+ r.e = a1.e + 1;
+ r.f = a1.f + 1;
+ r.g = a1.g + 1;
+
+ printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg: "
+ "%Lg %Lg %Lg %Lg %Lg %Lg %Lg\n",
+ a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
+ r.a, r.b, r.c, r.d, r.e, r.f, r.g);
+
+ return r;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[8];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 1, 2, 3, 4, 5, 6, 7 };
+ struct cls_struct_align f_dbl = { 8, 9, 10, 11, 12, 13, 14 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_longdouble;
+ cls_struct_fields[1] = &ffi_type_longdouble;
+ cls_struct_fields[2] = &ffi_type_longdouble;
+ cls_struct_fields[3] = &ffi_type_longdouble;
+ cls_struct_fields[4] = &ffi_type_longdouble;
+ cls_struct_fields[5] = &ffi_type_longdouble;
+ cls_struct_fields[6] = &ffi_type_longdouble;
+ cls_struct_fields[7] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
+ printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b,
+ res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
+ /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
+ printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b,
+ res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
+ /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c
new file mode 100644
index 0000000000..088f0d30ab
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c
@@ -0,0 +1,117 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of long double.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/18/2007
+*/
+
+/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+/* { dg-do run { xfail strongarm*-*-* } } */
+/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
+/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ long double a;
+ long double b;
+ long double c;
+ long double d;
+ long double e;
+ double f;
+ long double g;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(
+ cls_struct_align a1,
+ cls_struct_align a2)
+{
+ struct cls_struct_align r;
+
+ r.a = a1.a + a2.a;
+ r.b = a1.b + a2.b;
+ r.c = a1.c + a2.c;
+ r.d = a1.d + a2.d;
+ r.e = a1.e + a2.e;
+ r.f = a1.f + a2.f;
+ r.g = a1.g + a2.g;
+
+ printf("%Lg %Lg %Lg %Lg %Lg %g %Lg %Lg %Lg %Lg %Lg %Lg %g %Lg: "
+ "%Lg %Lg %Lg %Lg %Lg %g %Lg\n",
+ a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
+ a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
+ r.a, r.b, r.c, r.d, r.e, r.f, r.g);
+
+ return r;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[8];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 1, 2, 3, 4, 5, 6, 7 };
+ struct cls_struct_align f_dbl = { 8, 9, 10, 11, 12, 13, 14 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_longdouble;
+ cls_struct_fields[1] = &ffi_type_longdouble;
+ cls_struct_fields[2] = &ffi_type_longdouble;
+ cls_struct_fields[3] = &ffi_type_longdouble;
+ cls_struct_fields[4] = &ffi_type_longdouble;
+ cls_struct_fields[5] = &ffi_type_double;
+ cls_struct_fields[6] = &ffi_type_longdouble;
+ cls_struct_fields[7] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
+ printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b,
+ res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
+ /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
+ printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b,
+ res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
+ /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
+
+ exit(0);
+}
+
+
+
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c
new file mode 100644
index 0000000000..cbc4f953ff
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c
@@ -0,0 +1,95 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of pointer.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ void *b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = (void *)((uintptr_t)a1.b + (uintptr_t)a2.b);
+ result.c = a1.c + a2.c;
+
+ printf("%d %" PRIuPTR " %d %d %" PRIuPTR " %d: %d %" PRIuPTR " %d\n",
+ a1.a, (uintptr_t)a1.b, a1.c,
+ a2.a, (uintptr_t)a2.b, a2.c,
+ result.a, (uintptr_t)result.b,
+ result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, (void *)4951, 127 };
+ struct cls_struct_align f_dbl = { 1, (void *)9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_pointer;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c
new file mode 100644
index 0000000000..383ea41d5a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c
@@ -0,0 +1,91 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of sint16.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ signed short b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_sshort;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c
new file mode 100644
index 0000000000..705d78cfa8
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c
@@ -0,0 +1,91 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of sint32.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ signed int b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_sint;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c
new file mode 100644
index 0000000000..31d53aff05
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c
@@ -0,0 +1,92 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of sint64.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run } */
+/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ signed long long b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_sint64;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c
new file mode 100644
index 0000000000..cb6b74821e
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c
@@ -0,0 +1,91 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of uint16.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ unsigned short b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_ushort;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c
new file mode 100644
index 0000000000..e453d3e5d9
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c
@@ -0,0 +1,91 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of uint32.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ unsigned int b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uint;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c
new file mode 100644
index 0000000000..495c79f4ea
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c
@@ -0,0 +1,93 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of uint64.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+
+/* { dg-do run } */
+/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ unsigned long long b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uint64;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c
new file mode 100644
index 0000000000..660dabb883
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c
@@ -0,0 +1,66 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check double arguments in structs.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/23/2007 */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+typedef struct Dbls {
+ double x;
+ double y;
+} Dbls;
+
+void
+closure_test_fn(Dbls p)
+{
+ printf("%.1f %.1f\n", p.x, p.y);
+}
+
+void
+closure_test_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
+ void** args, void* userdata __UNUSED__)
+{
+ closure_test_fn(*(Dbls*)args[0]);
+}
+
+int main(int argc __UNUSED__, char** argv __UNUSED__)
+{
+ ffi_cif cif;
+
+ void *code;
+ ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type* cl_arg_types[1];
+
+ ffi_type ts1_type;
+ ffi_type* ts1_type_elements[4];
+
+ ts1_type.size = 0;
+ ts1_type.alignment = 0;
+ ts1_type.type = FFI_TYPE_STRUCT;
+ ts1_type.elements = ts1_type_elements;
+
+ ts1_type_elements[0] = &ffi_type_double;
+ ts1_type_elements[1] = &ffi_type_double;
+ ts1_type_elements[2] = NULL;
+
+ cl_arg_types[0] = &ts1_type;
+
+ Dbls arg = { 1.0, 2.0 };
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_void, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_gn, NULL, code) == FFI_OK);
+
+ ((void*(*)(Dbls))(code))(arg);
+ /* { dg-output "1.0 2.0\n" } */
+
+ closure_test_fn(arg);
+ /* { dg-output "1.0 2.0\n" } */
+
+ return 0;
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double.c
new file mode 100644
index 0000000000..84ad4cb7d9
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double.c
@@ -0,0 +1,43 @@
+/* Area: closure_call
+ Purpose: Check return value double.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void cls_ret_double_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+ {
+ *(double *)resp = *(double *)args[0];
+
+ printf("%f: %f\n",*(double *)args[0],
+ *(double *)resp);
+ }
+typedef double (*cls_ret_double)(double);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[2];
+ double res;
+
+ cl_arg_types[0] = &ffi_type_double;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_double, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_double_fn, NULL, code) == FFI_OK);
+
+ res = (*((cls_ret_double)code))(21474.789);
+ /* { dg-output "21474.789000: 21474.789000" } */
+ printf("res: %.6f\n", res);
+ /* { dg-output "\nres: 21474.789000" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c
new file mode 100644
index 0000000000..0695874b3c
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c
@@ -0,0 +1,57 @@
+/* Area: ffi_call, closure_call
+ Purpose: Test doubles passed in variable argument lists.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/6/2007 */
+
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+/* { dg-output "" { xfail avr32*-*-* } } */
+#include "ffitest.h"
+
+static void
+cls_double_va_fn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+{
+ char* format = *(char**)args[0];
+ double doubleValue = *(double*)args[1];
+
+ *(ffi_arg*)resp = printf(format, doubleValue);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args[3];
+ ffi_type* arg_types[3];
+
+ char* format = "%.1f\n";
+ double doubleArg = 7;
+ ffi_arg res = 0;
+
+ arg_types[0] = &ffi_type_pointer;
+ arg_types[1] = &ffi_type_double;
+ arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sint,
+ arg_types) == FFI_OK);
+
+ args[0] = &format;
+ args[1] = &doubleArg;
+ args[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(printf), &res, args);
+ // { dg-output "7.0" }
+ printf("res: %d\n", (int) res);
+ // { dg-output "\nres: 4" }
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL, code) == FFI_OK);
+
+ res = ((int(*)(char*, double))(code))(format, doubleArg);
+ // { dg-output "\n7.0" }
+ printf("res: %d\n", (int) res);
+ // { dg-output "\nres: 4" }
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_float.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_float.c
new file mode 100644
index 0000000000..0090fed906
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_float.c
@@ -0,0 +1,42 @@
+/* Area: closure_call
+ Purpose: Check return value float.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void cls_ret_float_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+ {
+ *(float *)resp = *(float *)args[0];
+
+ printf("%g: %g\n",*(float *)args[0],
+ *(float *)resp);
+ }
+
+typedef float (*cls_ret_float)(float);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[2];
+ float res;
+
+ cl_arg_types[0] = &ffi_type_float;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_float, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_float_fn, NULL, code) == FFI_OK);
+ res = ((((cls_ret_float)code)(-2122.12)));
+ /* { dg-output "\\-2122.12: \\-2122.12" } */
+ printf("res: %.6f\n", res);
+ /* { dg-output "\nres: \-2122.120117" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
new file mode 100644
index 0000000000..52af6cf328
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
@@ -0,0 +1,105 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check long double arguments.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin */
+
+/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+/* { dg-do run { xfail arm*-*-* strongarm*-*-* xscale*-*-* } } */
+/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
+/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+
+#include "ffitest.h"
+
+long double cls_ldouble_fn(
+ long double a1,
+ long double a2,
+ long double a3,
+ long double a4,
+ long double a5,
+ long double a6,
+ long double a7,
+ long double a8)
+{
+ long double r = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
+
+ printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: %Lg\n",
+ a1, a2, a3, a4, a5, a6, a7, a8, r);
+
+ return r;
+}
+
+static void
+cls_ldouble_gn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+{
+ long double a1 = *(long double*)args[0];
+ long double a2 = *(long double*)args[1];
+ long double a3 = *(long double*)args[2];
+ long double a4 = *(long double*)args[3];
+ long double a5 = *(long double*)args[4];
+ long double a6 = *(long double*)args[5];
+ long double a7 = *(long double*)args[6];
+ long double a8 = *(long double*)args[7];
+
+ *(long double*)resp = cls_ldouble_fn(
+ a1, a2, a3, a4, a5, a6, a7, a8);
+}
+
+int main(void)
+{
+ ffi_cif cif;
+ void* code;
+ ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args[9];
+ ffi_type* arg_types[9];
+ long double res = 0;
+
+ long double arg1 = 1;
+ long double arg2 = 2;
+ long double arg3 = 3;
+ long double arg4 = 4;
+ long double arg5 = 5;
+ long double arg6 = 6;
+ long double arg7 = 7;
+ long double arg8 = 8;
+
+ arg_types[0] = &ffi_type_longdouble;
+ arg_types[1] = &ffi_type_longdouble;
+ arg_types[2] = &ffi_type_longdouble;
+ arg_types[3] = &ffi_type_longdouble;
+ arg_types[4] = &ffi_type_longdouble;
+ arg_types[5] = &ffi_type_longdouble;
+ arg_types[6] = &ffi_type_longdouble;
+ arg_types[7] = &ffi_type_longdouble;
+ arg_types[8] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 8, &ffi_type_longdouble,
+ arg_types) == FFI_OK);
+
+ args[0] = &arg1;
+ args[1] = &arg2;
+ args[2] = &arg3;
+ args[3] = &arg4;
+ args[4] = &arg5;
+ args[5] = &arg6;
+ args[6] = &arg7;
+ args[7] = &arg8;
+ args[8] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_ldouble_fn), &res, args);
+ /* { dg-output "1 2 3 4 5 6 7 8: 36" } */
+ printf("res: %Lg\n", res);
+ /* { dg-output "\nres: 36" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ldouble_gn, NULL, code) == FFI_OK);
+
+ res = ((long double(*)(long double, long double, long double, long double,
+ long double, long double, long double, long double))(code))(arg1, arg2,
+ arg3, arg4, arg5, arg6, arg7, arg8);
+ /* { dg-output "\n1 2 3 4 5 6 7 8: 36" } */
+ printf("res: %Lg\n", res);
+ /* { dg-output "\nres: 36" } */
+
+ return 0;
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
new file mode 100644
index 0000000000..38564cb086
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
@@ -0,0 +1,57 @@
+/* Area: ffi_call, closure_call
+ Purpose: Test long doubles passed in variable argument lists.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/6/2007 */
+
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+/* { dg-output "" { xfail avr32*-*-* x86_64-*-mingw* } } */
+#include "ffitest.h"
+
+static void
+cls_longdouble_va_fn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+{
+ char* format = *(char**)args[0];
+ long double ldValue = *(long double*)args[1];
+
+ *(ffi_arg*)resp = printf(format, ldValue);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args[3];
+ ffi_type* arg_types[3];
+
+ char* format = "%.1Lf\n";
+ long double ldArg = 7;
+ ffi_arg res = 0;
+
+ arg_types[0] = &ffi_type_pointer;
+ arg_types[1] = &ffi_type_longdouble;
+ arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sint,
+ arg_types) == FFI_OK);
+
+ args[0] = &format;
+ args[1] = &ldArg;
+ args[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(printf), &res, args);
+ // { dg-output "7.0" }
+ printf("res: %d\n", (int) res);
+ // { dg-output "\nres: 4" }
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL, code) == FFI_OK);
+
+ res = ((int(*)(char*, long double))(code))(format, ldArg);
+ // { dg-output "\n7.0" }
+ printf("res: %d\n", (int) res);
+ // { dg-output "\nres: 4" }
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c
new file mode 100644
index 0000000000..71df7b6516
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c
@@ -0,0 +1,74 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple signed char values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <hos@tamanegi.org> 20031129 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+signed char test_func_fn(signed char a1, signed char a2)
+{
+ signed char result;
+
+ result = a1 + a2;
+
+ printf("%d %d: %d\n", a1, a2, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+ void *data __UNUSED__)
+{
+ signed char a1, a2;
+
+ a1 = *(signed char *)avals[0];
+ a2 = *(signed char *)avals[1];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2);
+
+}
+
+typedef signed char (*test_type)(signed char, signed char);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void * args_dbl[3];
+ ffi_type * cl_arg_types[3];
+ ffi_arg res_call;
+ signed char a, b, res_closure;
+
+ a = 2;
+ b = 125;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[2] = NULL;
+
+ cl_arg_types[0] = &ffi_type_schar;
+ cl_arg_types[1] = &ffi_type_schar;
+ cl_arg_types[2] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
+ &ffi_type_schar, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "2 125: 127" } */
+ printf("res: %d\n", (signed char)res_call);
+ /* { dg-output "\nres: 127" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
+
+ res_closure = (*((test_type)code))(2, 125);
+ /* { dg-output "\n2 125: 127" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 127" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c
new file mode 100644
index 0000000000..4c39153266
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c
@@ -0,0 +1,74 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple signed short values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+signed short test_func_fn(signed short a1, signed short a2)
+{
+ signed short result;
+
+ result = a1 + a2;
+
+ printf("%d %d: %d\n", a1, a2, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+ void *data __UNUSED__)
+{
+ signed short a1, a2;
+
+ a1 = *(signed short *)avals[0];
+ a2 = *(signed short *)avals[1];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2);
+
+}
+
+typedef signed short (*test_type)(signed short, signed short);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void * args_dbl[3];
+ ffi_type * cl_arg_types[3];
+ ffi_arg res_call;
+ unsigned short a, b, res_closure;
+
+ a = 2;
+ b = 32765;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[2] = NULL;
+
+ cl_arg_types[0] = &ffi_type_sshort;
+ cl_arg_types[1] = &ffi_type_sshort;
+ cl_arg_types[2] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
+ &ffi_type_sshort, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "2 32765: 32767" } */
+ printf("res: %d\n", (unsigned short)res_call);
+ /* { dg-output "\nres: 32767" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
+
+ res_closure = (*((test_type)code))(2, 32765);
+ /* { dg-output "\n2 32765: 32767" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 32767" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
new file mode 100644
index 0000000000..1c3aeb5a66
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
@@ -0,0 +1,86 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple signed short/char values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+signed short test_func_fn(signed char a1, signed short a2,
+ signed char a3, signed short a4)
+{
+ signed short result;
+
+ result = a1 + a2 + a3 + a4;
+
+ printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+ void *data __UNUSED__)
+{
+ signed char a1, a3;
+ signed short a2, a4;
+
+ a1 = *(signed char *)avals[0];
+ a2 = *(signed short *)avals[1];
+ a3 = *(signed char *)avals[2];
+ a4 = *(signed short *)avals[3];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
+
+}
+
+typedef signed short (*test_type)(signed char, signed short,
+ signed char, signed short);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void * args_dbl[5];
+ ffi_type * cl_arg_types[5];
+ ffi_arg res_call;
+ signed char a, c;
+ signed short b, d, res_closure;
+
+ a = 1;
+ b = 32765;
+ c = 127;
+ d = -128;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[2] = &c;
+ args_dbl[3] = &d;
+ args_dbl[4] = NULL;
+
+ cl_arg_types[0] = &ffi_type_schar;
+ cl_arg_types[1] = &ffi_type_sshort;
+ cl_arg_types[2] = &ffi_type_schar;
+ cl_arg_types[3] = &ffi_type_sshort;
+ cl_arg_types[4] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_sshort, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "1 32765 127 -128: 32765" } */
+ printf("res: %d\n", (signed short)res_call);
+ /* { dg-output "\nres: 32765" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
+
+ res_closure = (*((test_type)code))(1, 32765, 127, -128);
+ /* { dg-output "\n1 32765 127 -128: 32765" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 32765" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c
new file mode 100644
index 0000000000..009c02c72b
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c
@@ -0,0 +1,91 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple unsigned char values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+unsigned char test_func_fn(unsigned char a1, unsigned char a2,
+ unsigned char a3, unsigned char a4)
+{
+ unsigned char result;
+
+ result = a1 + a2 + a3 + a4;
+
+ printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+ void *data __UNUSED__)
+{
+ unsigned char a1, a2, a3, a4;
+
+ a1 = *(unsigned char *)avals[0];
+ a2 = *(unsigned char *)avals[1];
+ a3 = *(unsigned char *)avals[2];
+ a4 = *(unsigned char *)avals[3];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
+
+}
+
+typedef unsigned char (*test_type)(unsigned char, unsigned char,
+ unsigned char, unsigned char);
+
+void test_func(ffi_cif *cif __UNUSED__, void *rval __UNUSED__, void **avals,
+ void *data __UNUSED__)
+{
+ printf("%d %d %d %d\n", *(unsigned char *)avals[0],
+ *(unsigned char *)avals[1], *(unsigned char *)avals[2],
+ *(unsigned char *)avals[3]);
+}
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void * args_dbl[5];
+ ffi_type * cl_arg_types[5];
+ ffi_arg res_call;
+ unsigned char a, b, c, d, res_closure;
+
+ a = 1;
+ b = 2;
+ c = 127;
+ d = 125;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[2] = &c;
+ args_dbl[3] = &d;
+ args_dbl[4] = NULL;
+
+ cl_arg_types[0] = &ffi_type_uchar;
+ cl_arg_types[1] = &ffi_type_uchar;
+ cl_arg_types[2] = &ffi_type_uchar;
+ cl_arg_types[3] = &ffi_type_uchar;
+ cl_arg_types[4] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_uchar, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "1 2 127 125: 255" } */
+ printf("res: %d\n", (unsigned char)res_call);
+ /* { dg-output "\nres: 255" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
+
+ res_closure = (*((test_type)code))(1, 2, 127, 125);
+ /* { dg-output "\n1 2 127 125: 255" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 255" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c
new file mode 100644
index 0000000000..dd10ca7346
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c
@@ -0,0 +1,74 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple unsigned short values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+unsigned short test_func_fn(unsigned short a1, unsigned short a2)
+{
+ unsigned short result;
+
+ result = a1 + a2;
+
+ printf("%d %d: %d\n", a1, a2, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+ void *data __UNUSED__)
+{
+ unsigned short a1, a2;
+
+ a1 = *(unsigned short *)avals[0];
+ a2 = *(unsigned short *)avals[1];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2);
+
+}
+
+typedef unsigned short (*test_type)(unsigned short, unsigned short);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void * args_dbl[3];
+ ffi_type * cl_arg_types[3];
+ ffi_arg res_call;
+ unsigned short a, b, res_closure;
+
+ a = 2;
+ b = 32765;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[2] = NULL;
+
+ cl_arg_types[0] = &ffi_type_ushort;
+ cl_arg_types[1] = &ffi_type_ushort;
+ cl_arg_types[2] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
+ &ffi_type_ushort, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "2 32765: 32767" } */
+ printf("res: %d\n", (unsigned short)res_call);
+ /* { dg-output "\nres: 32767" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
+
+ res_closure = (*((test_type)code))(2, 32765);
+ /* { dg-output "\n2 32765: 32767" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 32767" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
new file mode 100644
index 0000000000..2588e97f98
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
@@ -0,0 +1,86 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple unsigned short/char values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+unsigned short test_func_fn(unsigned char a1, unsigned short a2,
+ unsigned char a3, unsigned short a4)
+{
+ unsigned short result;
+
+ result = a1 + a2 + a3 + a4;
+
+ printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+ void *data __UNUSED__)
+{
+ unsigned char a1, a3;
+ unsigned short a2, a4;
+
+ a1 = *(unsigned char *)avals[0];
+ a2 = *(unsigned short *)avals[1];
+ a3 = *(unsigned char *)avals[2];
+ a4 = *(unsigned short *)avals[3];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
+
+}
+
+typedef unsigned short (*test_type)(unsigned char, unsigned short,
+ unsigned char, unsigned short);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void * args_dbl[5];
+ ffi_type * cl_arg_types[5];
+ ffi_arg res_call;
+ unsigned char a, c;
+ unsigned short b, d, res_closure;
+
+ a = 1;
+ b = 2;
+ c = 127;
+ d = 128;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[2] = &c;
+ args_dbl[3] = &d;
+ args_dbl[4] = NULL;
+
+ cl_arg_types[0] = &ffi_type_uchar;
+ cl_arg_types[1] = &ffi_type_ushort;
+ cl_arg_types[2] = &ffi_type_uchar;
+ cl_arg_types[3] = &ffi_type_ushort;
+ cl_arg_types[4] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_ushort, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "1 2 127 128: 258" } */
+ printf("res: %d\n", (unsigned short)res_call);
+ /* { dg-output "\nres: 258" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
+
+ res_closure = (*((test_type)code))(1, 2, 127, 128);
+ /* { dg-output "\n1 2 127 128: 258" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 258" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer.c
new file mode 100644
index 0000000000..fadd35355c
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer.c
@@ -0,0 +1,74 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check pointer arguments.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/6/2007 */
+
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+void* cls_pointer_fn(void* a1, void* a2)
+{
+ void* result = (void*)((intptr_t)a1 + (intptr_t)a2);
+
+ printf("0x%08x 0x%08x: 0x%08x\n",
+ (unsigned int)(uintptr_t) a1,
+ (unsigned int)(uintptr_t) a2,
+ (unsigned int)(uintptr_t) result);
+
+ return result;
+}
+
+static void
+cls_pointer_gn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+{
+ void* a1 = *(void**)(args[0]);
+ void* a2 = *(void**)(args[1]);
+
+ *(void**)resp = cls_pointer_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args[3];
+// ffi_type cls_pointer_type;
+ ffi_type* arg_types[3];
+
+/* cls_pointer_type.size = sizeof(void*);
+ cls_pointer_type.alignment = 0;
+ cls_pointer_type.type = FFI_TYPE_POINTER;
+ cls_pointer_type.elements = NULL;*/
+
+ void* arg1 = (void*)0x12345678;
+ void* arg2 = (void*)0x89abcdef;
+ ffi_arg res = 0;
+
+ arg_types[0] = &ffi_type_pointer;
+ arg_types[1] = &ffi_type_pointer;
+ arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_pointer,
+ arg_types) == FFI_OK);
+
+ args[0] = &arg1;
+ args[1] = &arg2;
+ args[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_pointer_fn), &res, args);
+ /* { dg-output "0x12345678 0x89abcdef: 0x9be02467" } */
+ printf("res: 0x%08x\n", (unsigned int) res);
+ /* { dg-output "\nres: 0x9be02467" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK);
+
+ res = (ffi_arg)((void*(*)(void*, void*))(code))(arg1, arg2);
+ /* { dg-output "\n0x12345678 0x89abcdef: 0x9be02467" } */
+ printf("res: 0x%08x\n", (unsigned int) res);
+ /* { dg-output "\nres: 0x9be02467" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c
new file mode 100644
index 0000000000..697f271066
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c
@@ -0,0 +1,140 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check pointer arguments across multiple hideous stack frames.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/7/2007 */
+
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+static long dummyVar;
+
+long dummy_func(
+ long double a1, char b1,
+ long double a2, char b2,
+ long double a3, char b3,
+ long double a4, char b4)
+{
+ return a1 + b1 + a2 + b2 + a3 + b3 + a4 + b4;
+}
+
+void* cls_pointer_fn2(void* a1, void* a2)
+{
+ long double trample1 = (intptr_t)a1 + (intptr_t)a2;
+ char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0];
+ long double trample3 = (intptr_t)trample1 + (intptr_t)a1;
+ char trample4 = trample2 + ((char*)&a1)[1];
+ long double trample5 = (intptr_t)trample3 + (intptr_t)a2;
+ char trample6 = trample4 + ((char*)&a2)[1];
+ long double trample7 = (intptr_t)trample5 + (intptr_t)trample1;
+ char trample8 = trample6 + trample2;
+
+ dummyVar = dummy_func(trample1, trample2, trample3, trample4,
+ trample5, trample6, trample7, trample8);
+
+ void* result = (void*)((intptr_t)a1 + (intptr_t)a2);
+
+ printf("0x%08x 0x%08x: 0x%08x\n",
+ (unsigned int)(uintptr_t) a1,
+ (unsigned int)(uintptr_t) a2,
+ (unsigned int)(uintptr_t) result);
+
+ return result;
+}
+
+void* cls_pointer_fn1(void* a1, void* a2)
+{
+ long double trample1 = (intptr_t)a1 + (intptr_t)a2;
+ char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0];
+ long double trample3 = (intptr_t)trample1 + (intptr_t)a1;
+ char trample4 = trample2 + ((char*)&a1)[1];
+ long double trample5 = (intptr_t)trample3 + (intptr_t)a2;
+ char trample6 = trample4 + ((char*)&a2)[1];
+ long double trample7 = (intptr_t)trample5 + (intptr_t)trample1;
+ char trample8 = trample6 + trample2;
+
+ dummyVar = dummy_func(trample1, trample2, trample3, trample4,
+ trample5, trample6, trample7, trample8);
+
+ void* result = (void*)((intptr_t)a1 + (intptr_t)a2);
+
+ printf("0x%08x 0x%08x: 0x%08x\n",
+ (unsigned int)(intptr_t) a1,
+ (unsigned int)(intptr_t) a2,
+ (unsigned int)(intptr_t) result);
+
+ result = cls_pointer_fn2(result, a1);
+
+ return result;
+}
+
+static void
+cls_pointer_gn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+{
+ void* a1 = *(void**)(args[0]);
+ void* a2 = *(void**)(args[1]);
+
+ long double trample1 = (intptr_t)a1 + (intptr_t)a2;
+ char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0];
+ long double trample3 = (intptr_t)trample1 + (intptr_t)a1;
+ char trample4 = trample2 + ((char*)&a1)[1];
+ long double trample5 = (intptr_t)trample3 + (intptr_t)a2;
+ char trample6 = trample4 + ((char*)&a2)[1];
+ long double trample7 = (intptr_t)trample5 + (intptr_t)trample1;
+ char trample8 = trample6 + trample2;
+
+ dummyVar = dummy_func(trample1, trample2, trample3, trample4,
+ trample5, trample6, trample7, trample8);
+
+ *(void**)resp = cls_pointer_fn1(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args[3];
+// ffi_type cls_pointer_type;
+ ffi_type* arg_types[3];
+
+/* cls_pointer_type.size = sizeof(void*);
+ cls_pointer_type.alignment = 0;
+ cls_pointer_type.type = FFI_TYPE_POINTER;
+ cls_pointer_type.elements = NULL;*/
+
+ void* arg1 = (void*)0x01234567;
+ void* arg2 = (void*)0x89abcdef;
+ ffi_arg res = 0;
+
+ arg_types[0] = &ffi_type_pointer;
+ arg_types[1] = &ffi_type_pointer;
+ arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_pointer,
+ arg_types) == FFI_OK);
+
+ args[0] = &arg1;
+ args[1] = &arg2;
+ args[2] = NULL;
+
+ printf("\n");
+ ffi_call(&cif, FFI_FN(cls_pointer_fn1), &res, args);
+
+ printf("res: 0x%08x\n", (unsigned int) res);
+ // { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" }
+ // { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" }
+ // { dg-output "\nres: 0x8bf258bd" }
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK);
+
+ res = (ffi_arg)((void*(*)(void*, void*))(code))(arg1, arg2);
+
+ printf("res: 0x%08x\n", (unsigned int) res);
+ // { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" }
+ // { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" }
+ // { dg-output "\nres: 0x8bf258bd" }
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_schar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_schar.c
new file mode 100644
index 0000000000..82986b172c
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_schar.c
@@ -0,0 +1,44 @@
+/* Area: closure_call
+ Purpose: Check return value schar.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031108 */
+
+
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void cls_ret_schar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ *(ffi_arg*)resp = *(signed char *)args[0];
+ printf("%d: %d\n",*(signed char *)args[0],
+ (int)*(ffi_arg *)(resp));
+}
+typedef signed char (*cls_ret_schar)(signed char);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[2];
+ signed char res;
+
+ cl_arg_types[0] = &ffi_type_schar;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_schar, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_schar_fn, NULL, code) == FFI_OK);
+
+ res = (*((cls_ret_schar)code))(127);
+ /* { dg-output "127: 127" } */
+ printf("res: %d\n", res);
+ /* { dg-output "\nres: 127" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sint.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sint.c
new file mode 100644
index 0000000000..c7e13b73a3
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sint.c
@@ -0,0 +1,42 @@
+/* Area: closure_call
+ Purpose: Check return value sint32.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031108 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void cls_ret_sint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ *(ffi_arg*)resp = *(signed int *)args[0];
+ printf("%d: %d\n",*(signed int *)args[0],
+ (int)*(ffi_arg *)(resp));
+}
+typedef signed int (*cls_ret_sint)(signed int);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[2];
+ signed int res;
+
+ cl_arg_types[0] = &ffi_type_sint;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_sint_fn, NULL, code) == FFI_OK);
+
+ res = (*((cls_ret_sint)code))(65534);
+ /* { dg-output "65534: 65534" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 65534" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sshort.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sshort.c
new file mode 100644
index 0000000000..846d57ed1b
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sshort.c
@@ -0,0 +1,42 @@
+/* Area: closure_call
+ Purpose: Check return value sshort.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031108 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void cls_ret_sshort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ *(ffi_arg*)resp = *(signed short *)args[0];
+ printf("%d: %d\n",*(signed short *)args[0],
+ (int)*(ffi_arg *)(resp));
+}
+typedef signed short (*cls_ret_sshort)(signed short);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[2];
+ signed short res;
+
+ cl_arg_types[0] = &ffi_type_sshort;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_sshort, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_sshort_fn, NULL, code) == FFI_OK);
+
+ res = (*((cls_ret_sshort)code))(255);
+ /* { dg-output "255: 255" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 255" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar.c
new file mode 100644
index 0000000000..c1317e795f
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar.c
@@ -0,0 +1,42 @@
+/* Area: closure_call
+ Purpose: Check return value uchar.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void cls_ret_uchar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ *(ffi_arg*)resp = *(unsigned char *)args[0];
+ printf("%d: %d\n",*(unsigned char *)args[0],
+ (int)*(ffi_arg *)(resp));
+}
+typedef unsigned char (*cls_ret_uchar)(unsigned char);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[2];
+ unsigned char res;
+
+ cl_arg_types[0] = &ffi_type_uchar;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_uchar, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uchar_fn, NULL, code) == FFI_OK);
+
+ res = (*((cls_ret_uchar)code))(127);
+ /* { dg-output "127: 127" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 127" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint.c
new file mode 100644
index 0000000000..885cff5c31
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint.c
@@ -0,0 +1,43 @@
+/* Area: closure_call
+ Purpose: Check return value uint.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void cls_ret_uint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ *(ffi_arg *)resp = *(unsigned int *)args[0];
+
+ printf("%d: %d\n",*(unsigned int *)args[0],
+ (int)*(ffi_arg *)(resp));
+}
+typedef unsigned int (*cls_ret_uint)(unsigned int);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[2];
+ unsigned int res;
+
+ cl_arg_types[0] = &ffi_type_uint;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_uint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uint_fn, NULL, code) == FFI_OK);
+
+ res = (*((cls_ret_uint)code))(2147483647);
+ /* { dg-output "2147483647: 2147483647" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 2147483647" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c
new file mode 100644
index 0000000000..235ab44ffc
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c
@@ -0,0 +1,47 @@
+/* Area: closure_call
+ Purpose: Check return value long long.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
+#include "ffitest.h"
+
+static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+{
+ *(unsigned long long *)resp= *(unsigned long long *)args[0];
+
+ printf("%" PRIuLL ": %" PRIuLL "\n",*(unsigned long long *)args[0],
+ *(unsigned long long *)(resp));
+}
+typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[2];
+ unsigned long long res;
+
+ cl_arg_types[0] = &ffi_type_uint64;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_uint64, cl_arg_types) == FFI_OK);
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ulonglong_fn, NULL, code) == FFI_OK);
+ res = (*((cls_ret_ulonglong)code))(214LL);
+ /* { dg-output "214: 214" } */
+ printf("res: %" PRIdLL "\n", res);
+ /* { dg-output "\nres: 214" } */
+
+ res = (*((cls_ret_ulonglong)code))(9223372035854775808LL);
+ /* { dg-output "\n9223372035854775808: 9223372035854775808" } */
+ printf("res: %" PRIdLL "\n", res);
+ /* { dg-output "\nres: 9223372035854775808" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort.c
new file mode 100644
index 0000000000..a00100e07f
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort.c
@@ -0,0 +1,43 @@
+/* Area: closure_call
+ Purpose: Check return value ushort.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void cls_ret_ushort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ *(ffi_arg*)resp = *(unsigned short *)args[0];
+
+ printf("%d: %d\n",*(unsigned short *)args[0],
+ (int)*(ffi_arg *)(resp));
+}
+typedef unsigned short (*cls_ret_ushort)(unsigned short);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[2];
+ unsigned short res;
+
+ cl_arg_types[0] = &ffi_type_ushort;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_ushort, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ushort_fn, NULL, code) == FFI_OK);
+
+ res = (*((cls_ret_ushort)code))(65535);
+ /* { dg-output "65535: 65535" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 65535" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_abi.c b/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_abi.c
new file mode 100644
index 0000000000..a21a3fddd0
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_abi.c
@@ -0,0 +1,37 @@
+/* Area: ffi_prep_cif, ffi_prep_closure
+ Purpose: Test error return for bad ABIs.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/6/2007 */
+
+/* { dg-do run { xfail *-*-* } } */
+#include "ffitest.h"
+
+static void
+dummy_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
+ void** args __UNUSED__, void* userdata __UNUSED__)
+{}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args[1];
+ ffi_type* arg_types[1];
+
+ arg_types[0] = NULL;
+ args[0] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, 255, 0, &ffi_type_void,
+ arg_types) == FFI_BAD_ABI);
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void,
+ arg_types) == FFI_OK);
+
+ cif.abi= 255;
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, dummy_fn, NULL, code) == FFI_BAD_ABI);
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c b/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c
new file mode 100644
index 0000000000..bd2fc54a0e
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c
@@ -0,0 +1,25 @@
+/* Area: ffi_prep_cif
+ Purpose: Test error return for bad typedefs.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/6/2007 */
+
+/* { dg-do run { xfail *-*-* } } */
+#include "ffitest.h"
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type* arg_types[1];
+
+ arg_types[0] = NULL;
+
+ ffi_type badType = ffi_type_void;
+
+ badType.size = 0;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &badType,
+ arg_types) == FFI_BAD_TYPEDEF);
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
new file mode 100644
index 0000000000..2cb9849718
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
@@ -0,0 +1,129 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <ffi.h>
+#include "fficonfig.h"
+
+#if defined HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#if defined HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#define MAX_ARGS 256
+
+#define CHECK(x) !(x) ? abort() : 0
+
+/* Define __UNUSED__ that also other compilers than gcc can run the tests. */
+#undef __UNUSED__
+#if defined(__GNUC__)
+#define __UNUSED__ __attribute__((__unused__))
+#else
+#define __UNUSED__
+#endif
+
+/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
+ file open. */
+#ifdef HAVE_MMAP_ANON
+# undef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED -1
+# endif
+# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
+# define MAP_ANONYMOUS MAP_ANON
+# endif
+# define USING_MMAP
+
+#endif
+
+#ifdef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED -1
+# endif
+# define USING_MMAP
+
+#endif
+
+/* MinGW kludge. */
+#ifdef _WIN64
+#define PRIdLL "I64d"
+#define PRIuLL "I64u"
+#else
+#define PRIdLL "lld"
+#define PRIuLL "llu"
+#endif
+
+/* Tru64 UNIX kludge. */
+#if defined(__alpha__) && defined(__osf__)
+/* Tru64 UNIX V4.0 doesn't support %lld/%lld, but long is 64-bit. */
+#undef PRIdLL
+#define PRIdLL "ld"
+#undef PRIuLL
+#define PRIuLL "lu"
+#define PRId64 "ld"
+#define PRIu64 "lu"
+#define PRIuPTR "lu"
+#endif
+
+/* PA HP-UX kludge. */
+#if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR)
+#define PRIuPTR "lu"
+#endif
+
+/* Solaris < 10 kludge. */
+#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
+#if defined(__arch64__) || defined (__x86_64__)
+#define PRIuPTR "lu"
+#else
+#define PRIuPTR "u"
+#endif
+#endif
+
+#ifdef USING_MMAP
+static inline void *
+allocate_mmap (size_t size)
+{
+ void *page;
+#if defined (HAVE_MMAP_DEV_ZERO)
+ static int dev_zero_fd = -1;
+#endif
+
+#ifdef HAVE_MMAP_DEV_ZERO
+ if (dev_zero_fd == -1)
+ {
+ dev_zero_fd = open ("/dev/zero", O_RDONLY);
+ if (dev_zero_fd == -1)
+ {
+ perror ("open /dev/zero: %m");
+ exit (1);
+ }
+ }
+#endif
+
+
+#ifdef HAVE_MMAP_ANON
+ page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+#endif
+#ifdef HAVE_MMAP_DEV_ZERO
+ page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE, dev_zero_fd, 0);
+#endif
+
+ if (page == (void *) MAP_FAILED)
+ {
+ perror ("virtual memory exhausted");
+ exit (1);
+ }
+
+ return page;
+}
+
+#endif
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float.c
new file mode 100644
index 0000000000..fbc272d84f
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/float.c
@@ -0,0 +1,59 @@
+/* Area: ffi_call
+ Purpose: Check return value float.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+static int floating(int a, float b, double c, long double d)
+{
+ int i;
+
+ i = (int) ((float)a/b + ((float)c/(float)d));
+
+ return i;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg rint;
+
+ float f;
+ signed int si1;
+ double d;
+ long double ld;
+
+ args[0] = &ffi_type_sint;
+ values[0] = &si1;
+ args[1] = &ffi_type_float;
+ values[1] = &f;
+ args[2] = &ffi_type_double;
+ values[2] = &d;
+ args[3] = &ffi_type_longdouble;
+ values[3] = &ld;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_sint, args) == FFI_OK);
+
+ si1 = 6;
+ f = 3.14159;
+ d = (double)1.0/(double)3.0;
+ ld = 2.71828182846L;
+
+ floating (si1, f, d, ld);
+
+ ffi_call(&cif, FFI_FN(floating), &rint, values);
+
+ printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld));
+
+ CHECK((int)rint == floating(si1, f, d, ld));
+
+ exit (0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float1.c
new file mode 100644
index 0000000000..991d059fe4
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/float1.c
@@ -0,0 +1,58 @@
+/* Area: ffi_call
+ Purpose: Check return value double.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+#include "float.h"
+
+typedef union
+{
+ double d;
+ unsigned char c[sizeof (double)];
+} value_type;
+
+#define CANARY 0xba
+
+static double dblit(float f)
+{
+ return f/3.0;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ float f;
+ value_type result[2];
+ unsigned int i;
+
+ args[0] = &ffi_type_float;
+ values[0] = &f;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_double, args) == FFI_OK);
+
+ f = 3.14159;
+
+ /* Put a canary in the return array. This is a regression test for
+ a buffer overrun. */
+ memset(result[1].c, CANARY, sizeof (double));
+
+ ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
+
+ /* These are not always the same!! Check for a reasonable delta */
+
+ CHECK(result[0].d - dblit(f) < DBL_EPSILON);
+
+ /* Check the canary. */
+ for (i = 0; i < sizeof (double); ++i)
+ CHECK(result[1].c[i] == CANARY);
+
+ exit(0);
+
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c
new file mode 100644
index 0000000000..a0b296cf4b
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c
@@ -0,0 +1,58 @@
+/* Area: ffi_call
+ Purpose: Check return value long double.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-excess-errors "fails" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
+/* { dg-do run { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+
+#include "ffitest.h"
+#include "float.h"
+
+static long double ldblit(float f)
+{
+ return (long double) (((long double) f)/ (long double) 3.0);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ float f;
+ long double ld;
+
+ args[0] = &ffi_type_float;
+ values[0] = &f;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_longdouble, args) == FFI_OK);
+
+ f = 3.14159;
+
+#if 1
+ /* This is ifdef'd out for now. long double support under SunOS/gcc
+ is pretty much non-existent. You'll get the odd bus error in library
+ routines like printf(). */
+ printf ("%Lf\n", ldblit(f));
+#endif
+ ld = 666;
+ ffi_call(&cif, FFI_FN(ldblit), &ld, values);
+
+#if 1
+ /* This is ifdef'd out for now. long double support under SunOS/gcc
+ is pretty much non-existent. You'll get the odd bus error in library
+ routines like printf(). */
+ printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON);
+#endif
+
+ /* These are not always the same!! Check for a reasonable delta */
+ if (ld - ldblit(f) < LDBL_EPSILON)
+ puts("long double return value tests ok!");
+ else
+ CHECK(0);
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float3.c
new file mode 100644
index 0000000000..76bd5f287c
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/float3.c
@@ -0,0 +1,72 @@
+/* Area: ffi_call
+ Purpose: Check float arguments with different orders.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+#include "float.h"
+
+static double floating_1(float a, double b, long double c)
+{
+ return (double) a + b + (double) c;
+}
+
+static double floating_2(long double a, double b, float c)
+{
+ return (double) a + b + (double) c;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ double rd;
+
+ float f;
+ double d;
+ long double ld;
+
+ args[0] = &ffi_type_float;
+ values[0] = &f;
+ args[1] = &ffi_type_double;
+ values[1] = &d;
+ args[2] = &ffi_type_longdouble;
+ values[2] = &ld;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
+ &ffi_type_double, args) == FFI_OK);
+
+ f = 3.14159;
+ d = (double)1.0/(double)3.0;
+ ld = 2.71828182846L;
+
+ floating_1 (f, d, ld);
+
+ ffi_call(&cif, FFI_FN(floating_1), &rd, values);
+
+ CHECK(rd - floating_1(f, d, ld) < DBL_EPSILON);
+
+ args[0] = &ffi_type_longdouble;
+ values[0] = &ld;
+ args[1] = &ffi_type_double;
+ values[1] = &d;
+ args[2] = &ffi_type_float;
+ values[2] = &f;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
+ &ffi_type_double, args) == FFI_OK);
+
+ floating_2 (ld, d, f);
+
+ ffi_call(&cif, FFI_FN(floating_2), &rd, values);
+
+ CHECK(rd - floating_2(ld, d, f) < DBL_EPSILON);
+
+ exit (0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float4.c
new file mode 100644
index 0000000000..0dd6d85e7a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/float4.c
@@ -0,0 +1,62 @@
+/* Area: ffi_call
+ Purpose: Check denorm double value.
+ Limitations: none.
+ PR: PR26483.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+/* { dg-options "-mieee" { target alpha*-*-* } } */
+
+#include "ffitest.h"
+#include "float.h"
+
+typedef union
+{
+ double d;
+ unsigned char c[sizeof (double)];
+} value_type;
+
+#define CANARY 0xba
+
+static double dblit(double d)
+{
+ return d;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ double d;
+ value_type result[2];
+ unsigned int i;
+
+ args[0] = &ffi_type_double;
+ values[0] = &d;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_double, args) == FFI_OK);
+
+ d = DBL_MIN / 2;
+
+ /* Put a canary in the return array. This is a regression test for
+ a buffer overrun. */
+ memset(result[1].c, CANARY, sizeof (double));
+
+ ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
+
+ /* The standard delta check doesn't work for denorms. Since we didn't do
+ any arithmetic, we should get the original result back, and hence an
+ exact check should be OK here. */
+
+ CHECK(result[0].d == dblit(d));
+
+ /* Check the canary. */
+ for (i = 0; i < sizeof (double); ++i)
+ CHECK(result[1].c[i] == CANARY);
+
+ exit(0);
+
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c b/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
new file mode 100644
index 0000000000..9cffb718c9
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
@@ -0,0 +1,342 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check large structure returns.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/18/2007
+*/
+
+/* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
+/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+
+#include "ffitest.h"
+
+typedef struct BigStruct{
+ uint8_t a;
+ int8_t b;
+ uint16_t c;
+ int16_t d;
+ uint32_t e;
+ int32_t f;
+ uint64_t g;
+ int64_t h;
+ float i;
+ double j;
+ long double k;
+ char* l;
+ uint8_t m;
+ int8_t n;
+ uint16_t o;
+ int16_t p;
+ uint32_t q;
+ int32_t r;
+ uint64_t s;
+ int64_t t;
+ float u;
+ double v;
+ long double w;
+ char* x;
+ uint8_t y;
+ int8_t z;
+ uint16_t aa;
+ int16_t bb;
+ uint32_t cc;
+ int32_t dd;
+ uint64_t ee;
+ int64_t ff;
+ float gg;
+ double hh;
+ long double ii;
+ char* jj;
+ uint8_t kk;
+ int8_t ll;
+ uint16_t mm;
+ int16_t nn;
+ uint32_t oo;
+ int32_t pp;
+ uint64_t qq;
+ int64_t rr;
+ float ss;
+ double tt;
+ long double uu;
+ char* vv;
+ uint8_t ww;
+ int8_t xx;
+} BigStruct;
+
+BigStruct
+test_large_fn(
+ uint8_t ui8_1,
+ int8_t si8_1,
+ uint16_t ui16_1,
+ int16_t si16_1,
+ uint32_t ui32_1,
+ int32_t si32_1,
+ uint64_t ui64_1,
+ int64_t si64_1,
+ float f_1,
+ double d_1,
+ long double ld_1,
+ char* p_1,
+ uint8_t ui8_2,
+ int8_t si8_2,
+ uint16_t ui16_2,
+ int16_t si16_2,
+ uint32_t ui32_2,
+ int32_t si32_2,
+ uint64_t ui64_2,
+ int64_t si64_2,
+ float f_2,
+ double d_2,
+ long double ld_2,
+ char* p_2,
+ uint8_t ui8_3,
+ int8_t si8_3,
+ uint16_t ui16_3,
+ int16_t si16_3,
+ uint32_t ui32_3,
+ int32_t si32_3,
+ uint64_t ui64_3,
+ int64_t si64_3,
+ float f_3,
+ double d_3,
+ long double ld_3,
+ char* p_3,
+ uint8_t ui8_4,
+ int8_t si8_4,
+ uint16_t ui16_4,
+ int16_t si16_4,
+ uint32_t ui32_4,
+ int32_t si32_4,
+ uint64_t ui64_4,
+ int64_t si64_4,
+ float f_4,
+ double d_4,
+ long double ld_4,
+ char* p_4,
+ uint8_t ui8_5,
+ int8_t si8_5)
+{
+ BigStruct retVal = {
+ ui8_1 + 1, si8_1 + 1, ui16_1 + 1, si16_1 + 1, ui32_1 + 1, si32_1 + 1,
+ ui64_1 + 1, si64_1 + 1, f_1 + 1, d_1 + 1, ld_1 + 1, (char*)((intptr_t)p_1 + 1),
+ ui8_2 + 2, si8_2 + 2, ui16_2 + 2, si16_2 + 2, ui32_2 + 2, si32_2 + 2,
+ ui64_2 + 2, si64_2 + 2, f_2 + 2, d_2 + 2, ld_2 + 2, (char*)((intptr_t)p_2 + 2),
+ ui8_3 + 3, si8_3 + 3, ui16_3 + 3, si16_3 + 3, ui32_3 + 3, si32_3 + 3,
+ ui64_3 + 3, si64_3 + 3, f_3 + 3, d_3 + 3, ld_3 + 3, (char*)((intptr_t)p_3 + 3),
+ ui8_4 + 4, si8_4 + 4, ui16_4 + 4, si16_4 + 4, ui32_4 + 4, si32_4 + 4,
+ ui64_4 + 4, si64_4 + 4, f_4 + 4, d_4 + 4, ld_4 + 4, (char*)((intptr_t)p_4 + 4),
+ ui8_5 + 5, si8_5 + 5};
+
+ printf("%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %hhu %hhd: "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %hhu %hhd\n",
+ ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, (unsigned long)p_1,
+ ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, (unsigned long)p_2,
+ ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, (unsigned long)p_3,
+ ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, (unsigned long)p_4, ui8_5, si8_5,
+ retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
+ retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l,
+ retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
+ retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x,
+ retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
+ retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
+ retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
+ retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
+
+ return retVal;
+}
+
+static void
+cls_large_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
+{
+ uint8_t ui8_1 = *(uint8_t*)args[0];
+ int8_t si8_1 = *(int8_t*)args[1];
+ uint16_t ui16_1 = *(uint16_t*)args[2];
+ int16_t si16_1 = *(int16_t*)args[3];
+ uint32_t ui32_1 = *(uint32_t*)args[4];
+ int32_t si32_1 = *(int32_t*)args[5];
+ uint64_t ui64_1 = *(uint64_t*)args[6];
+ int64_t si64_1 = *(int64_t*)args[7];
+ float f_1 = *(float*)args[8];
+ double d_1 = *(double*)args[9];
+ long double ld_1 = *(long double*)args[10];
+ char* p_1 = *(char**)args[11];
+ uint8_t ui8_2 = *(uint8_t*)args[12];
+ int8_t si8_2 = *(int8_t*)args[13];
+ uint16_t ui16_2 = *(uint16_t*)args[14];
+ int16_t si16_2 = *(int16_t*)args[15];
+ uint32_t ui32_2 = *(uint32_t*)args[16];
+ int32_t si32_2 = *(int32_t*)args[17];
+ uint64_t ui64_2 = *(uint64_t*)args[18];
+ int64_t si64_2 = *(int64_t*)args[19];
+ float f_2 = *(float*)args[20];
+ double d_2 = *(double*)args[21];
+ long double ld_2 = *(long double*)args[22];
+ char* p_2 = *(char**)args[23];
+ uint8_t ui8_3 = *(uint8_t*)args[24];
+ int8_t si8_3 = *(int8_t*)args[25];
+ uint16_t ui16_3 = *(uint16_t*)args[26];
+ int16_t si16_3 = *(int16_t*)args[27];
+ uint32_t ui32_3 = *(uint32_t*)args[28];
+ int32_t si32_3 = *(int32_t*)args[29];
+ uint64_t ui64_3 = *(uint64_t*)args[30];
+ int64_t si64_3 = *(int64_t*)args[31];
+ float f_3 = *(float*)args[32];
+ double d_3 = *(double*)args[33];
+ long double ld_3 = *(long double*)args[34];
+ char* p_3 = *(char**)args[35];
+ uint8_t ui8_4 = *(uint8_t*)args[36];
+ int8_t si8_4 = *(int8_t*)args[37];
+ uint16_t ui16_4 = *(uint16_t*)args[38];
+ int16_t si16_4 = *(int16_t*)args[39];
+ uint32_t ui32_4 = *(uint32_t*)args[40];
+ int32_t si32_4 = *(int32_t*)args[41];
+ uint64_t ui64_4 = *(uint64_t*)args[42];
+ int64_t si64_4 = *(int64_t*)args[43];
+ float f_4 = *(float*)args[44];
+ double d_4 = *(double*)args[45];
+ long double ld_4 = *(long double*)args[46];
+ char* p_4 = *(char**)args[47];
+ uint8_t ui8_5 = *(uint8_t*)args[48];
+ int8_t si8_5 = *(int8_t*)args[49];
+
+ *(BigStruct*)resp = test_large_fn(
+ ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, p_1,
+ ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, p_2,
+ ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, p_3,
+ ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, p_4,
+ ui8_5, si8_5);
+}
+
+int
+main(int argc __UNUSED__, const char** argv __UNUSED__)
+{
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+
+ ffi_cif cif;
+ ffi_type* argTypes[51];
+ void* argValues[51];
+
+ ffi_type ret_struct_type;
+ ffi_type* st_fields[51];
+ BigStruct retVal;
+
+ memset (&retVal, 0, sizeof(retVal));
+
+ ret_struct_type.size = 0;
+ ret_struct_type.alignment = 0;
+ ret_struct_type.type = FFI_TYPE_STRUCT;
+ ret_struct_type.elements = st_fields;
+
+ st_fields[0] = st_fields[12] = st_fields[24] = st_fields[36] = st_fields[48] = &ffi_type_uint8;
+ st_fields[1] = st_fields[13] = st_fields[25] = st_fields[37] = st_fields[49] = &ffi_type_sint8;
+ st_fields[2] = st_fields[14] = st_fields[26] = st_fields[38] = &ffi_type_uint16;
+ st_fields[3] = st_fields[15] = st_fields[27] = st_fields[39] = &ffi_type_sint16;
+ st_fields[4] = st_fields[16] = st_fields[28] = st_fields[40] = &ffi_type_uint32;
+ st_fields[5] = st_fields[17] = st_fields[29] = st_fields[41] = &ffi_type_sint32;
+ st_fields[6] = st_fields[18] = st_fields[30] = st_fields[42] = &ffi_type_uint64;
+ st_fields[7] = st_fields[19] = st_fields[31] = st_fields[43] = &ffi_type_sint64;
+ st_fields[8] = st_fields[20] = st_fields[32] = st_fields[44] = &ffi_type_float;
+ st_fields[9] = st_fields[21] = st_fields[33] = st_fields[45] = &ffi_type_double;
+ st_fields[10] = st_fields[22] = st_fields[34] = st_fields[46] = &ffi_type_longdouble;
+ st_fields[11] = st_fields[23] = st_fields[35] = st_fields[47] = &ffi_type_pointer;
+
+ st_fields[50] = NULL;
+
+ uint8_t ui8 = 1;
+ int8_t si8 = 2;
+ uint16_t ui16 = 3;
+ int16_t si16 = 4;
+ uint32_t ui32 = 5;
+ int32_t si32 = 6;
+ uint64_t ui64 = 7;
+ int64_t si64 = 8;
+ float f = 9;
+ double d = 10;
+ long double ld = 11;
+ char* p = (char*)0x12345678;
+
+ argTypes[0] = argTypes[12] = argTypes[24] = argTypes[36] = argTypes[48] = &ffi_type_uint8;
+ argValues[0] = argValues[12] = argValues[24] = argValues[36] = argValues[48] = &ui8;
+ argTypes[1] = argTypes[13] = argTypes[25] = argTypes[37] = argTypes[49] = &ffi_type_sint8;
+ argValues[1] = argValues[13] = argValues[25] = argValues[37] = argValues[49] = &si8;
+ argTypes[2] = argTypes[14] = argTypes[26] = argTypes[38] = &ffi_type_uint16;
+ argValues[2] = argValues[14] = argValues[26] = argValues[38] = &ui16;
+ argTypes[3] = argTypes[15] = argTypes[27] = argTypes[39] = &ffi_type_sint16;
+ argValues[3] = argValues[15] = argValues[27] = argValues[39] = &si16;
+ argTypes[4] = argTypes[16] = argTypes[28] = argTypes[40] = &ffi_type_uint32;
+ argValues[4] = argValues[16] = argValues[28] = argValues[40] = &ui32;
+ argTypes[5] = argTypes[17] = argTypes[29] = argTypes[41] = &ffi_type_sint32;
+ argValues[5] = argValues[17] = argValues[29] = argValues[41] = &si32;
+ argTypes[6] = argTypes[18] = argTypes[30] = argTypes[42] = &ffi_type_uint64;
+ argValues[6] = argValues[18] = argValues[30] = argValues[42] = &ui64;
+ argTypes[7] = argTypes[19] = argTypes[31] = argTypes[43] = &ffi_type_sint64;
+ argValues[7] = argValues[19] = argValues[31] = argValues[43] = &si64;
+ argTypes[8] = argTypes[20] = argTypes[32] = argTypes[44] = &ffi_type_float;
+ argValues[8] = argValues[20] = argValues[32] = argValues[44] = &f;
+ argTypes[9] = argTypes[21] = argTypes[33] = argTypes[45] = &ffi_type_double;
+ argValues[9] = argValues[21] = argValues[33] = argValues[45] = &d;
+ argTypes[10] = argTypes[22] = argTypes[34] = argTypes[46] = &ffi_type_longdouble;
+ argValues[10] = argValues[22] = argValues[34] = argValues[46] = &ld;
+ argTypes[11] = argTypes[23] = argTypes[35] = argTypes[47] = &ffi_type_pointer;
+ argValues[11] = argValues[23] = argValues[35] = argValues[47] = &p;
+
+ argTypes[50] = NULL;
+ argValues[50] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 50, &ret_struct_type, argTypes) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_large_fn), &retVal, argValues);
+ // { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ printf("res: %hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %hhu %hhd\n",
+ retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
+ retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l,
+ retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
+ retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x,
+ retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
+ retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
+ retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
+ retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
+ // { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_large_fn, NULL, code) == FFI_OK);
+
+ retVal = ((BigStruct(*)(
+ uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
+ uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
+ uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
+ uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
+ uint8_t, int8_t))(code))(
+ ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
+ ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
+ ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
+ ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
+ ui8, si8);
+ // { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ printf("res: %hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
+ "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %hhu %hhd\n",
+ retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
+ retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l,
+ retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
+ retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x,
+ retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
+ retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
+ retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
+ retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
+ // { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+
+ return 0;
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many.c
new file mode 100644
index 0000000000..4869ba9dde
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/many.c
@@ -0,0 +1,69 @@
+/* Area: ffi_call
+ Purpose: Check return value float, with many arguments
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+#include <float.h>
+
+static float many(float f1,
+ float f2,
+ float f3,
+ float f4,
+ float f5,
+ float f6,
+ float f7,
+ float f8,
+ float f9,
+ float f10,
+ float f11,
+ float f12,
+ float f13)
+{
+#if 0
+ printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
+ (double) f1, (double) f2, (double) f3, (double) f4, (double) f5,
+ (double) f6, (double) f7, (double) f8, (double) f9, (double) f10,
+ (double) f11, (double) f12, (double) f13);
+#endif
+
+ return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[13];
+ void *values[13];
+ float fa[13];
+ float f, ff;
+ int i;
+
+ for (i = 0; i < 13; i++)
+ {
+ args[i] = &ffi_type_float;
+ values[i] = &fa[i];
+ fa[i] = (float) i;
+ }
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13,
+ &ffi_type_float, args) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(many), &f, values);
+
+ ff = many(fa[0], fa[1],
+ fa[2], fa[3],
+ fa[4], fa[5],
+ fa[6], fa[7],
+ fa[8], fa[9],
+ fa[10],fa[11],fa[12]);
+
+ if (f - ff < FLT_EPSILON)
+ exit(0);
+ else
+ abort();
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c
new file mode 100644
index 0000000000..1b2633227a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c
@@ -0,0 +1,63 @@
+/* Area: ffi_call
+ Purpose: Check stdcall many call on X86_WIN32 systems.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
+
+#include "ffitest.h"
+#include <float.h>
+
+static float __attribute__((stdcall)) stdcall_many(float f1,
+ float f2,
+ float f3,
+ float f4,
+ float f5,
+ float f6,
+ float f7,
+ float f8,
+ float f9,
+ float f10,
+ float f11,
+ float f12,
+ float f13)
+{
+ return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[13];
+ void *values[13];
+ float fa[13];
+ float f, ff;
+ unsigned long ul;
+
+ for (ul = 0; ul < 13; ul++)
+ {
+ args[ul] = &ffi_type_float;
+ values[ul] = &fa[ul];
+ fa[ul] = (float) ul;
+ }
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 13,
+ &ffi_type_float, args) == FFI_OK);
+
+ ff = stdcall_many(fa[0], fa[1],
+ fa[2], fa[3],
+ fa[4], fa[5],
+ fa[6], fa[7],
+ fa[8], fa[9],
+ fa[10], fa[11], fa[12]);
+
+ ffi_call(&cif, FFI_FN(stdcall_many), &f, values);
+
+ if (f - ff < FLT_EPSILON)
+ printf("stdcall many arg tests ok!\n");
+ else
+ CHECK(0);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/negint.c b/Modules/_ctypes/libffi/testsuite/libffi.call/negint.c
new file mode 100644
index 0000000000..3168113027
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/negint.c
@@ -0,0 +1,53 @@
+/* Area: ffi_call
+ Purpose: Check that negative integers are passed correctly.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+/* { dg-options -O2 } */
+
+#include "ffitest.h"
+
+static int checking(int a, short b, signed char c)
+{
+
+ return (a < 0 && b < 0 && c < 0);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg rint;
+
+ signed int si;
+ signed short ss;
+ signed char sc;
+
+ args[0] = &ffi_type_sint;
+ values[0] = &si;
+ args[1] = &ffi_type_sshort;
+ values[1] = &ss;
+ args[2] = &ffi_type_schar;
+ values[2] = &sc;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
+ &ffi_type_sint, args) == FFI_OK);
+
+ si = -6;
+ ss = -12;
+ sc = -1;
+
+ checking (si, ss, sc);
+
+ ffi_call(&cif, FFI_FN(checking), &rint, values);
+
+ printf ("%d vs %d\n", (int)rint, checking (si, ss, sc));
+
+ CHECK(rint != 0);
+
+ exit (0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct.c
new file mode 100644
index 0000000000..8aa527ede4
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct.c
@@ -0,0 +1,152 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_16byte1 {
+ double a;
+ float b;
+ int c;
+} cls_struct_16byte1;
+
+typedef struct cls_struct_16byte2 {
+ int ii;
+ double dd;
+ float ff;
+} cls_struct_16byte2;
+
+typedef struct cls_struct_combined {
+ cls_struct_16byte1 d;
+ cls_struct_16byte2 e;
+} cls_struct_combined;
+
+cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
+ struct cls_struct_16byte2 b1,
+ struct cls_struct_combined b2)
+{
+ struct cls_struct_combined result;
+
+ result.d.a = b0.a + b1.dd + b2.d.a;
+ result.d.b = b0.b + b1.ff + b2.d.b;
+ result.d.c = b0.c + b1.ii + b2.d.c;
+ result.e.ii = b0.c + b1.ii + b2.e.ii;
+ result.e.dd = b0.a + b1.dd + b2.e.dd;
+ result.e.ff = b0.b + b1.ff + b2.e.ff;
+
+ printf("%g %g %d %d %g %g %g %g %d %d %g %g: %g %g %d %d %g %g\n",
+ b0.a, b0.b, b0.c,
+ b1.ii, b1.dd, b1.ff,
+ b2.d.a, b2.d.b, b2.d.c,
+ b2.e.ii, b2.e.dd, b2.e.ff,
+ result.d.a, result.d.b, result.d.c,
+ result.e.ii, result.e.dd, result.e.ff);
+
+ return result;
+}
+
+static void
+cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_16byte1 b0;
+ struct cls_struct_16byte2 b1;
+ struct cls_struct_combined b2;
+
+ b0 = *(struct cls_struct_16byte1*)(args[0]);
+ b1 = *(struct cls_struct_16byte2*)(args[1]);
+ b2 = *(struct cls_struct_combined*)(args[2]);
+
+
+ *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[5];
+ ffi_type* cls_struct_fields1[5];
+ ffi_type* cls_struct_fields2[5];
+ ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ cls_struct_type2.size = 0;
+ cls_struct_type2.alignment = 0;
+ cls_struct_type2.type = FFI_TYPE_STRUCT;
+ cls_struct_type2.elements = cls_struct_fields2;
+
+ struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
+ struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
+ struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
+ {3, 1.0, 8.0}};
+ struct cls_struct_combined res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_float;
+ cls_struct_fields[2] = &ffi_type_sint;
+ cls_struct_fields[3] = NULL;
+
+ cls_struct_fields1[0] = &ffi_type_sint;
+ cls_struct_fields1[1] = &ffi_type_double;
+ cls_struct_fields1[2] = &ffi_type_float;
+ cls_struct_fields1[3] = NULL;
+
+ cls_struct_fields2[0] = &cls_struct_type;
+ cls_struct_fields2[1] = &cls_struct_type1;
+ cls_struct_fields2[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = &cls_struct_type2;
+ dbl_arg_types[3] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type2,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl);
+ /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */
+ CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
+ CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
+ CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
+ CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
+ CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
+ CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
+ cls_struct_16byte2,
+ cls_struct_combined))
+ (code))(e_dbl, f_dbl, g_dbl);
+ /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */
+ CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
+ CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
+ CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
+ CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
+ CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
+ CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct1.c
new file mode 100644
index 0000000000..2a9f515cde
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct1.c
@@ -0,0 +1,161 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_16byte1 {
+ double a;
+ float b;
+ int c;
+} cls_struct_16byte1;
+
+typedef struct cls_struct_16byte2 {
+ int ii;
+ double dd;
+ float ff;
+} cls_struct_16byte2;
+
+typedef struct cls_struct_combined {
+ cls_struct_16byte1 d;
+ cls_struct_16byte2 e;
+} cls_struct_combined;
+
+cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
+ struct cls_struct_16byte2 b1,
+ struct cls_struct_combined b2,
+ struct cls_struct_16byte1 b3)
+{
+ struct cls_struct_combined result;
+
+ result.d.a = b0.a + b1.dd + b2.d.a;
+ result.d.b = b0.b + b1.ff + b2.d.b;
+ result.d.c = b0.c + b1.ii + b2.d.c;
+ result.e.ii = b0.c + b1.ii + b2.e.ii;
+ result.e.dd = b0.a + b1.dd + b2.e.dd;
+ result.e.ff = b0.b + b1.ff + b2.e.ff;
+
+ printf("%g %g %d %d %g %g %g %g %d %d %g %g %g %g %d: %g %g %d %d %g %g\n",
+ b0.a, b0.b, b0.c,
+ b1.ii, b1.dd, b1.ff,
+ b2.d.a, b2.d.b, b2.d.c,
+ b2.e.ii, b2.e.dd, b2.e.ff,
+ b3.a, b3.b, b3.c,
+ result.d.a, result.d.b, result.d.c,
+ result.e.ii, result.e.dd, result.e.ff);
+
+ return result;
+}
+
+static void
+cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct cls_struct_16byte1 b0;
+ struct cls_struct_16byte2 b1;
+ struct cls_struct_combined b2;
+ struct cls_struct_16byte1 b3;
+
+ b0 = *(struct cls_struct_16byte1*)(args[0]);
+ b1 = *(struct cls_struct_16byte2*)(args[1]);
+ b2 = *(struct cls_struct_combined*)(args[2]);
+ b3 = *(struct cls_struct_16byte1*)(args[3]);
+
+
+ *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2, b3);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[5];
+ ffi_type* cls_struct_fields1[5];
+ ffi_type* cls_struct_fields2[5];
+ ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ cls_struct_type2.size = 0;
+ cls_struct_type2.alignment = 0;
+ cls_struct_type2.type = FFI_TYPE_STRUCT;
+ cls_struct_type2.elements = cls_struct_fields2;
+
+ struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
+ struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
+ struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
+ {3, 1.0, 8.0}};
+ struct cls_struct_16byte1 h_dbl = { 3.0, 2.0, 4};
+ struct cls_struct_combined res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_float;
+ cls_struct_fields[2] = &ffi_type_sint;
+ cls_struct_fields[3] = NULL;
+
+ cls_struct_fields1[0] = &ffi_type_sint;
+ cls_struct_fields1[1] = &ffi_type_double;
+ cls_struct_fields1[2] = &ffi_type_float;
+ cls_struct_fields1[3] = NULL;
+
+ cls_struct_fields2[0] = &cls_struct_type;
+ cls_struct_fields2[1] = &cls_struct_type1;
+ cls_struct_fields2[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = &cls_struct_type2;
+ dbl_arg_types[3] = &cls_struct_type;
+ dbl_arg_types[4] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type2,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = &h_dbl;
+ args_dbl[4] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl);
+ /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */
+ CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
+ CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
+ CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
+ CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
+ CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
+ CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
+ cls_struct_16byte2,
+ cls_struct_combined,
+ cls_struct_16byte1))
+ (code))(e_dbl, f_dbl, g_dbl, h_dbl);
+ /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */
+ CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
+ CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
+ CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
+ CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
+ CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
+ CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
+ // CHECK( 1 == 0);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct10.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct10.c
new file mode 100644
index 0000000000..d6a718bdd0
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct10.c
@@ -0,0 +1,133 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20051010 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+ unsigned long long a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ unsigned char y;
+ struct A x;
+ unsigned int z;
+} B;
+
+typedef struct C {
+ unsigned long long d;
+ unsigned char e;
+} C;
+
+static B B_fn(struct A b2, struct B b3, struct C b4)
+{
+ struct B result;
+
+ result.x.a = b2.a + b3.x.a + b3.z + b4.d;
+ result.x.b = b2.b + b3.x.b + b3.y + b4.e;
+ result.y = b2.b + b3.x.b + b4.e;
+
+ printf("%d %d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
+ (int)b3.x.a, b3.x.b, b3.y, b3.z, (int)b4.d, b4.e,
+ (int)result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct A b0;
+ struct B b1;
+ struct C b2;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+ b2 = *(struct C*)(args[2]);
+
+ *(B*)resp = B_fn(b0, b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[4];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[4];
+ ffi_type* cls_struct_fields2[3];
+ ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
+ ffi_type* dbl_arg_types[4];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ cls_struct_type2.size = 0;
+ cls_struct_type2.alignment = 0;
+ cls_struct_type2.type = FFI_TYPE_STRUCT;
+ cls_struct_type2.elements = cls_struct_fields2;
+
+ struct A e_dbl = { 1LL, 7};
+ struct B f_dbl = { 99, {12LL , 127}, 255};
+ struct C g_dbl = { 2LL, 9};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uint64;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &ffi_type_uchar;
+ cls_struct_fields1[1] = &cls_struct_type;
+ cls_struct_fields1[2] = &ffi_type_uint;
+ cls_struct_fields1[3] = NULL;
+
+ cls_struct_fields2[0] = &ffi_type_uint64;
+ cls_struct_fields2[1] = &ffi_type_uchar;
+ cls_struct_fields2[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = &cls_struct_type2;
+ dbl_arg_types[3] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99 255 2 9: 270 242 143" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + f_dbl.z + g_dbl.d));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
+ /* { dg-output "\n1 7 12 127 99 255 2 9: 270 242 143" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + f_dbl.z + g_dbl.d));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct2.c
new file mode 100644
index 0000000000..de1584c18a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct2.c
@@ -0,0 +1,110 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030911 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+ unsigned long a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+B B_fn(struct A b0, struct B b1)
+{
+ struct B result;
+
+ result.x.a = b0.a + b1.x.a;
+ result.x.b = b0.b + b1.x.b + b1.y;
+ result.y = b0.b + b1.x.b;
+
+ printf("%lu %d %lu %d %d: %lu %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y,
+ result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct A b0;
+ struct B b1;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+
+ *(B*)resp = B_fn(b0, b1);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type cls_struct_type, cls_struct_type1;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ struct A e_dbl = { 1, 7};
+ struct B f_dbl = {{12 , 127}, 99};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_ulong;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
+ /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct3.c
new file mode 100644
index 0000000000..58aa85362e
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct3.c
@@ -0,0 +1,111 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030911 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+ unsigned long long a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+B B_fn(struct A b0, struct B b1)
+{
+ struct B result;
+
+ result.x.a = b0.a + b1.x.a;
+ result.x.b = b0.b + b1.x.b + b1.y;
+ result.y = b0.b + b1.x.b;
+
+ printf("%d %d %d %d %d: %d %d %d\n", (int)b0.a, b0.b,
+ (int)b1.x.a, b1.x.b, b1.y,
+ (int)result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct A b0;
+ struct B b1;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+
+ *(B*)resp = B_fn(b0, b1);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type cls_struct_type, cls_struct_type1;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ struct A e_dbl = { 1LL, 7};
+ struct B f_dbl = {{12LL , 127}, 99};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uint64;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
+ /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct4.c
new file mode 100644
index 0000000000..98e491e65c
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct4.c
@@ -0,0 +1,111 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: PR 25630.
+ Originator: <andreast@gcc.gnu.org> 20051010 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+ double a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+static B B_fn(struct A b2, struct B b3)
+{
+ struct B result;
+
+ result.x.a = b2.a + b3.x.a;
+ result.x.b = b2.b + b3.x.b + b3.y;
+ result.y = b2.b + b3.x.b;
+
+ printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
+ (int)b3.x.a, b3.x.b, b3.y,
+ (int)result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct A b0;
+ struct B b1;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+
+ *(B*)resp = B_fn(b0, b1);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type cls_struct_type, cls_struct_type1;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ struct A e_dbl = { 1.0, 7};
+ struct B f_dbl = {{12.0 , 127}, 99};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
+ /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct5.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct5.c
new file mode 100644
index 0000000000..d8e3537d5a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct5.c
@@ -0,0 +1,112 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20051010 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+ long double a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+static B B_fn(struct A b2, struct B b3)
+{
+ struct B result;
+
+ result.x.a = b2.a + b3.x.a;
+ result.x.b = b2.b + b3.x.b + b3.y;
+ result.y = b2.b + b3.x.b;
+
+ printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
+ (int)b3.x.a, b3.x.b, b3.y,
+ (int)result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct A b0;
+ struct B b1;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+
+ *(B*)resp = B_fn(b0, b1);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type cls_struct_type, cls_struct_type1;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ struct A e_dbl = { 1.0, 7};
+ struct B f_dbl = {{12.0 , 127}, 99};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_longdouble;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
+ /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct6.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct6.c
new file mode 100644
index 0000000000..2f2b25a15d
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct6.c
@@ -0,0 +1,131 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: PR 25630.
+ Originator: <andreast@gcc.gnu.org> 20051010 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+ double a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+typedef struct C {
+ long d;
+ unsigned char e;
+} C;
+
+static B B_fn(struct A b2, struct B b3, struct C b4)
+{
+ struct B result;
+
+ result.x.a = b2.a + b3.x.a + b4.d;
+ result.x.b = b2.b + b3.x.b + b3.y + b4.e;
+ result.y = b2.b + b3.x.b + b4.e;
+
+ printf("%d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
+ (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e,
+ (int)result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct A b0;
+ struct B b1;
+ struct C b2;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+ b2 = *(struct C*)(args[2]);
+
+ *(B*)resp = B_fn(b0, b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[4];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type* cls_struct_fields2[3];
+ ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
+ ffi_type* dbl_arg_types[4];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ cls_struct_type2.size = 0;
+ cls_struct_type2.alignment = 0;
+ cls_struct_type2.type = FFI_TYPE_STRUCT;
+ cls_struct_type2.elements = cls_struct_fields2;
+
+ struct A e_dbl = { 1.0, 7};
+ struct B f_dbl = {{12.0 , 127}, 99};
+ struct C g_dbl = { 2, 9};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+ cls_struct_fields2[0] = &ffi_type_slong;
+ cls_struct_fields2[1] = &ffi_type_uchar;
+ cls_struct_fields2[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = &cls_struct_type2;
+ dbl_arg_types[3] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
+ /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct7.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct7.c
new file mode 100644
index 0000000000..14c70239eb
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct7.c
@@ -0,0 +1,111 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20051010 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+ unsigned long long a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+static B B_fn(struct A b2, struct B b3)
+{
+ struct B result;
+
+ result.x.a = b2.a + b3.x.a;
+ result.x.b = b2.b + b3.x.b + b3.y;
+ result.y = b2.b + b3.x.b;
+
+ printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
+ (int)b3.x.a, b3.x.b, b3.y,
+ (int)result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct A b0;
+ struct B b1;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+
+ *(B*)resp = B_fn(b0, b1);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type cls_struct_type, cls_struct_type1;
+ ffi_type* dbl_arg_types[3];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ struct A e_dbl = { 1LL, 7};
+ struct B f_dbl = {{12.0 , 127}, 99};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uint64;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
+ /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct8.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct8.c
new file mode 100644
index 0000000000..bb77ead8d3
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct8.c
@@ -0,0 +1,131 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20051010 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+ unsigned long long a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+typedef struct C {
+ unsigned long long d;
+ unsigned char e;
+} C;
+
+static B B_fn(struct A b2, struct B b3, struct C b4)
+{
+ struct B result;
+
+ result.x.a = b2.a + b3.x.a + b4.d;
+ result.x.b = b2.b + b3.x.b + b3.y + b4.e;
+ result.y = b2.b + b3.x.b + b4.e;
+
+ printf("%d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
+ (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e,
+ (int)result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct A b0;
+ struct B b1;
+ struct C b2;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+ b2 = *(struct C*)(args[2]);
+
+ *(B*)resp = B_fn(b0, b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[4];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type* cls_struct_fields2[3];
+ ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
+ ffi_type* dbl_arg_types[4];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ cls_struct_type2.size = 0;
+ cls_struct_type2.alignment = 0;
+ cls_struct_type2.type = FFI_TYPE_STRUCT;
+ cls_struct_type2.elements = cls_struct_fields2;
+
+ struct A e_dbl = { 1LL, 7};
+ struct B f_dbl = {{12LL , 127}, 99};
+ struct C g_dbl = { 2LL, 9};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uint64;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+ cls_struct_fields2[0] = &ffi_type_uint64;
+ cls_struct_fields2[1] = &ffi_type_uchar;
+ cls_struct_fields2[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = &cls_struct_type2;
+ dbl_arg_types[3] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
+ /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct9.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct9.c
new file mode 100644
index 0000000000..e9f541c83a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct9.c
@@ -0,0 +1,131 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20051010 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+ unsigned char a;
+ unsigned long long b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+typedef struct C {
+ unsigned long d;
+ unsigned char e;
+} C;
+
+static B B_fn(struct A b2, struct B b3, struct C b4)
+{
+ struct B result;
+
+ result.x.a = b2.a + b3.x.a + b4.d;
+ result.x.b = b2.b + b3.x.b + b3.y + b4.e;
+ result.y = b2.b + b3.x.b + b4.e;
+
+ printf("%d %d %d %d %d %d %d: %d %d %d\n", b2.a, (int)b2.b,
+ b3.x.a, (int)b3.x.b, b3.y, (int)b4.d, b4.e,
+ result.x.a, (int)result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct A b0;
+ struct B b1;
+ struct C b2;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+ b2 = *(struct C*)(args[2]);
+
+ *(B*)resp = B_fn(b0, b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[4];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type* cls_struct_fields2[3];
+ ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
+ ffi_type* dbl_arg_types[4];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ cls_struct_type2.size = 0;
+ cls_struct_type2.alignment = 0;
+ cls_struct_type2.type = FFI_TYPE_STRUCT;
+ cls_struct_type2.elements = cls_struct_fields2;
+
+ struct A e_dbl = { 1, 7LL};
+ struct B f_dbl = {{12.0 , 127}, 99};
+ struct C g_dbl = { 2, 9};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uint64;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+ cls_struct_fields2[0] = &ffi_type_ulong;
+ cls_struct_fields2[1] = &ffi_type_uchar;
+ cls_struct_fields2[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = &cls_struct_type2;
+ dbl_arg_types[3] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
+ /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/problem1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/problem1.c
new file mode 100644
index 0000000000..6a91555a1f
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/problem1.c
@@ -0,0 +1,90 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct my_ffi_struct {
+ double a;
+ double b;
+ double c;
+} my_ffi_struct;
+
+my_ffi_struct callee(struct my_ffi_struct a1, struct my_ffi_struct a2)
+{
+ struct my_ffi_struct result;
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+
+ printf("%g %g %g %g %g %g: %g %g %g\n", a1.a, a1.b, a1.c,
+ a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+void stub(ffi_cif* cif __UNUSED__, void* resp, void** args,
+ void* userdata __UNUSED__)
+{
+ struct my_ffi_struct a1;
+ struct my_ffi_struct a2;
+
+ a1 = *(struct my_ffi_struct*)(args[0]);
+ a2 = *(struct my_ffi_struct*)(args[1]);
+
+ *(my_ffi_struct *)resp = callee(a1, a2);
+}
+
+
+int main(void)
+{
+ ffi_type* my_ffi_struct_fields[4];
+ ffi_type my_ffi_struct_type;
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args[4];
+ ffi_type* arg_types[3];
+
+ struct my_ffi_struct g = { 1.0, 2.0, 3.0 };
+ struct my_ffi_struct f = { 1.0, 2.0, 3.0 };
+ struct my_ffi_struct res;
+
+ my_ffi_struct_type.size = 0;
+ my_ffi_struct_type.alignment = 0;
+ my_ffi_struct_type.type = FFI_TYPE_STRUCT;
+ my_ffi_struct_type.elements = my_ffi_struct_fields;
+
+ my_ffi_struct_fields[0] = &ffi_type_double;
+ my_ffi_struct_fields[1] = &ffi_type_double;
+ my_ffi_struct_fields[2] = &ffi_type_double;
+ my_ffi_struct_fields[3] = NULL;
+
+ arg_types[0] = &my_ffi_struct_type;
+ arg_types[1] = &my_ffi_struct_type;
+ arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &my_ffi_struct_type,
+ arg_types) == FFI_OK);
+
+ args[0] = &g;
+ args[1] = &f;
+ args[2] = NULL;
+ ffi_call(&cif, FFI_FN(callee), &res, args);
+ /* { dg-output "1 2 3 1 2 3: 2 4 6" } */
+ printf("res: %g %g %g\n", res.a, res.b, res.c);
+ /* { dg-output "\nres: 2 4 6" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, stub, NULL, code) == FFI_OK);
+
+ res = ((my_ffi_struct(*)(struct my_ffi_struct, struct my_ffi_struct))(code))(g, f);
+ /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
+ printf("res: %g %g %g\n", res.a, res.b, res.c);
+ /* { dg-output "\nres: 2 4 6" } */
+
+ exit(0);;
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/promotion.c b/Modules/_ctypes/libffi/testsuite/libffi.call/promotion.c
new file mode 100644
index 0000000000..44561615dd
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/promotion.c
@@ -0,0 +1,59 @@
+/* Area: ffi_call
+ Purpose: Promotion test.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+static int promotion(signed char sc, signed short ss,
+ unsigned char uc, unsigned short us)
+{
+ int r = (int) sc + (int) ss + (int) uc + (int) us;
+
+ return r;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg rint;
+ signed char sc;
+ unsigned char uc;
+ signed short ss;
+ unsigned short us;
+ unsigned long ul;
+
+ args[0] = &ffi_type_schar;
+ args[1] = &ffi_type_sshort;
+ args[2] = &ffi_type_uchar;
+ args[3] = &ffi_type_ushort;
+ values[0] = &sc;
+ values[1] = &ss;
+ values[2] = &uc;
+ values[3] = &us;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_sint, args) == FFI_OK);
+
+ us = 0;
+ ul = 0;
+
+ for (sc = (signed char) -127;
+ sc <= (signed char) 120; sc += 1)
+ for (ss = -30000; ss <= 30000; ss += 10000)
+ for (uc = (unsigned char) 0;
+ uc <= (unsigned char) 200; uc += 20)
+ for (us = 0; us <= 60000; us += 10000)
+ {
+ ul++;
+ ffi_call(&cif, FFI_FN(promotion), &rint, values);
+ CHECK((int)rint == (signed char) sc + (signed short) ss +
+ (unsigned char) uc + (unsigned short) us);
+ }
+ printf("%lu promotion tests run\n", ul);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c b/Modules/_ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c
new file mode 100644
index 0000000000..e29bd6c283
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c
@@ -0,0 +1,114 @@
+/* Area: ffi_call
+ Purpose: Check different structures.
+ Limitations: none.
+ PR: none.
+ Originator: Ronald Oussoren <oussoren@cistron.nl> 20030824 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct Point {
+ float x;
+ float y;
+} Point;
+
+typedef struct Size {
+ float h;
+ float w;
+} Size;
+
+typedef struct Rect {
+ Point o;
+ Size s;
+} Rect;
+
+int doit(int o, char* s, Point p, Rect r, int last)
+{
+ printf("CALLED WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n",
+ o, s, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, last);
+ return 42;
+}
+
+
+int main(void)
+{
+ ffi_type point_type;
+ ffi_type size_type;
+ ffi_type rect_type;
+ ffi_cif cif;
+ ffi_type* arglist[6];
+ void* values[6];
+ int r;
+
+ /*
+ * First set up FFI types for the 3 struct types
+ */
+
+ point_type.size = 0; /*sizeof(Point);*/
+ point_type.alignment = 0; /*__alignof__(Point);*/
+ point_type.type = FFI_TYPE_STRUCT;
+ point_type.elements = malloc(3 * sizeof(ffi_type*));
+ point_type.elements[0] = &ffi_type_float;
+ point_type.elements[1] = &ffi_type_float;
+ point_type.elements[2] = NULL;
+
+ size_type.size = 0;/* sizeof(Size);*/
+ size_type.alignment = 0;/* __alignof__(Size);*/
+ size_type.type = FFI_TYPE_STRUCT;
+ size_type.elements = malloc(3 * sizeof(ffi_type*));
+ size_type.elements[0] = &ffi_type_float;
+ size_type.elements[1] = &ffi_type_float;
+ size_type.elements[2] = NULL;
+
+ rect_type.size = 0;/*sizeof(Rect);*/
+ rect_type.alignment =0;/* __alignof__(Rect);*/
+ rect_type.type = FFI_TYPE_STRUCT;
+ rect_type.elements = malloc(3 * sizeof(ffi_type*));
+ rect_type.elements[0] = &point_type;
+ rect_type.elements[1] = &size_type;
+ rect_type.elements[2] = NULL;
+
+ /*
+ * Create a CIF
+ */
+ arglist[0] = &ffi_type_sint;
+ arglist[1] = &ffi_type_pointer;
+ arglist[2] = &point_type;
+ arglist[3] = &rect_type;
+ arglist[4] = &ffi_type_sint;
+ arglist[5] = NULL;
+
+ r = ffi_prep_cif(&cif, FFI_DEFAULT_ABI,
+ 5, &ffi_type_sint, arglist);
+ if (r != FFI_OK) {
+ abort();
+ }
+
+
+ /* And call the function through the CIF */
+
+ {
+ Point p = { 1.0, 2.0 };
+ Rect r = { { 9.0, 10.0}, { -1.0, -2.0 } };
+ int o = 0;
+ int l = 42;
+ char* m = "myMethod";
+ ffi_arg result;
+
+ values[0] = &o;
+ values[1] = &m;
+ values[2] = &p;
+ values[3] = &r;
+ values[4] = &l;
+ values[5] = NULL;
+
+ printf("CALLING WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n",
+ o, m, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, l);
+
+ ffi_call(&cif, FFI_FN(doit), &result, values);
+
+ printf ("The result is %d\n", (int)result);
+
+ }
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl.c
new file mode 100644
index 0000000000..1aab403d9c
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl.c
@@ -0,0 +1,35 @@
+/* Area: ffi_call
+ Purpose: Check return value double.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050212 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static double return_dbl(double dbl)
+{
+ return 2 * dbl;
+}
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ double dbl, rdbl;
+
+ args[0] = &ffi_type_double;
+ values[0] = &dbl;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_double, args) == FFI_OK);
+
+ for (dbl = -127.3; dbl < 127; dbl++)
+ {
+ ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
+ printf ("%f vs %f\n", rdbl, return_dbl(dbl));
+ CHECK(rdbl == 2 * dbl);
+ }
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl1.c
new file mode 100644
index 0000000000..0ea5d50551
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl1.c
@@ -0,0 +1,43 @@
+/* Area: ffi_call
+ Purpose: Check return value double.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050212 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static double return_dbl(double dbl1, float fl2, unsigned int in3, double dbl4)
+{
+ return dbl1 + fl2 + in3 + dbl4;
+}
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ double dbl1, dbl4, rdbl;
+ float fl2;
+ unsigned int in3;
+ args[0] = &ffi_type_double;
+ args[1] = &ffi_type_float;
+ args[2] = &ffi_type_uint;
+ args[3] = &ffi_type_double;
+ values[0] = &dbl1;
+ values[1] = &fl2;
+ values[2] = &in3;
+ values[3] = &dbl4;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_double, args) == FFI_OK);
+ dbl1 = 127.0;
+ fl2 = 128.0;
+ in3 = 255;
+ dbl4 = 512.7;
+
+ ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
+ printf ("%f vs %f\n", rdbl, return_dbl(dbl1, fl2, in3, dbl4));
+ CHECK(rdbl == dbl1 + fl2 + in3 + dbl4);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl2.c
new file mode 100644
index 0000000000..b3818f866b
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl2.c
@@ -0,0 +1,42 @@
+/* Area: ffi_call
+ Purpose: Check return value double.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050212 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static double return_dbl(double dbl1, double dbl2, unsigned int in3, double dbl4)
+{
+ return dbl1 + dbl2 + in3 + dbl4;
+}
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ double dbl1, dbl2, dbl4, rdbl;
+ unsigned int in3;
+ args[0] = &ffi_type_double;
+ args[1] = &ffi_type_double;
+ args[2] = &ffi_type_uint;
+ args[3] = &ffi_type_double;
+ values[0] = &dbl1;
+ values[1] = &dbl2;
+ values[2] = &in3;
+ values[3] = &dbl4;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_double, args) == FFI_OK);
+ dbl1 = 127.0;
+ dbl2 = 128.0;
+ in3 = 255;
+ dbl4 = 512.7;
+
+ ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
+ printf ("%f vs %f\n", rdbl, return_dbl(dbl1, dbl2, in3, dbl4));
+ CHECK(rdbl == dbl1 + dbl2 + in3 + dbl4);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl.c
new file mode 100644
index 0000000000..fb8a09e32a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl.c
@@ -0,0 +1,35 @@
+/* Area: ffi_call
+ Purpose: Check return value float.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050212 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static float return_fl(float fl)
+{
+ return 2 * fl;
+}
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ float fl, rfl;
+
+ args[0] = &ffi_type_float;
+ values[0] = &fl;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_float, args) == FFI_OK);
+
+ for (fl = -127.0; fl < 127; fl++)
+ {
+ ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
+ printf ("%f vs %f\n", rfl, return_fl(fl));
+ CHECK(rfl == 2 * fl);
+ }
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl1.c
new file mode 100644
index 0000000000..c3d92c283d
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl1.c
@@ -0,0 +1,36 @@
+/* Area: ffi_call
+ Purpose: Check return value float.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050212 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static float return_fl(float fl1, float fl2)
+{
+ return fl1 + fl2;
+}
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ float fl1, fl2, rfl;
+
+ args[0] = &ffi_type_float;
+ args[1] = &ffi_type_float;
+ values[0] = &fl1;
+ values[1] = &fl2;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
+ &ffi_type_float, args) == FFI_OK);
+ fl1 = 127.0;
+ fl2 = 128.0;
+
+ ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
+ printf ("%f vs %f\n", rfl, return_fl(fl1, fl2));
+ CHECK(rfl == fl1 + fl2);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl2.c
new file mode 100644
index 0000000000..ddb976cc2b
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl2.c
@@ -0,0 +1,49 @@
+/* Area: ffi_call
+ Purpose: Check return value float.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050212 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+/* Use volatile float to avoid false negative on ix86. See PR target/323. */
+static float return_fl(float fl1, float fl2, float fl3, float fl4)
+{
+ volatile float sum;
+
+ sum = fl1 + fl2 + fl3 + fl4;
+ return sum;
+}
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ float fl1, fl2, fl3, fl4, rfl;
+ volatile float sum;
+
+ args[0] = &ffi_type_float;
+ args[1] = &ffi_type_float;
+ args[2] = &ffi_type_float;
+ args[3] = &ffi_type_float;
+ values[0] = &fl1;
+ values[1] = &fl2;
+ values[2] = &fl3;
+ values[3] = &fl4;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_float, args) == FFI_OK);
+ fl1 = 127.0;
+ fl2 = 128.0;
+ fl3 = 255.1;
+ fl4 = 512.7;
+
+ ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
+ printf ("%f vs %f\n", rfl, return_fl(fl1, fl2, fl3, fl4));
+
+ sum = fl1 + fl2 + fl3 + fl4;
+ CHECK(rfl == sum);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl3.c
new file mode 100644
index 0000000000..c37877b18e
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl3.c
@@ -0,0 +1,42 @@
+/* Area: ffi_call
+ Purpose: Check return value float.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20050212 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static float return_fl(float fl1, float fl2, unsigned int in3, float fl4)
+{
+ return fl1 + fl2 + in3 + fl4;
+}
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ float fl1, fl2, fl4, rfl;
+ unsigned int in3;
+ args[0] = &ffi_type_float;
+ args[1] = &ffi_type_float;
+ args[2] = &ffi_type_uint;
+ args[3] = &ffi_type_float;
+ values[0] = &fl1;
+ values[1] = &fl2;
+ values[2] = &in3;
+ values[3] = &fl4;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_float, args) == FFI_OK);
+ fl1 = 127.0;
+ fl2 = 128.0;
+ in3 = 255;
+ fl4 = 512.7;
+
+ ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
+ printf ("%f vs %f\n", rfl, return_fl(fl1, fl2, in3, fl4));
+ CHECK(rfl == fl1 + fl2 + in3 + fl4);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c
new file mode 100644
index 0000000000..5c2fe65aec
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c
@@ -0,0 +1,34 @@
+/* Area: ffi_call
+ Purpose: Check return value long double.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20071113 */
+
+/* { dg-do run { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+#include "ffitest.h"
+
+static long double return_ldl(long double ldl)
+{
+ return 2*ldl;
+}
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ long double ldl, rldl;
+
+ args[0] = &ffi_type_longdouble;
+ values[0] = &ldl;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_longdouble, args) == FFI_OK);
+
+ for (ldl = -127.0; ldl < 127.0; ldl++)
+ {
+ ffi_call(&cif, FFI_FN(return_ldl), &rldl, values);
+ CHECK(rldl == 2 * ldl);
+ }
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll.c
new file mode 100644
index 0000000000..ea4a1e4478
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll.c
@@ -0,0 +1,41 @@
+/* Area: ffi_call
+ Purpose: Check return value long long.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+static long long return_ll(long long ll)
+{
+ return ll;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ long long rlonglong;
+ long long ll;
+
+ args[0] = &ffi_type_sint64;
+ values[0] = &ll;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_sint64, args) == FFI_OK);
+
+ for (ll = 0LL; ll < 100LL; ll++)
+ {
+ ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
+ CHECK(rlonglong == ll);
+ }
+
+ for (ll = 55555555555000LL; ll < 55555555555100LL; ll++)
+ {
+ ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
+ CHECK(rlonglong == ll);
+ }
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll1.c
new file mode 100644
index 0000000000..593e8a307c
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll1.c
@@ -0,0 +1,43 @@
+/* Area: ffi_call
+ Purpose: Check if long long are passed in the corresponding regs on ppc.
+ Limitations: none.
+ PR: 20104.
+ Originator: <andreast@gcc.gnu.org> 20050222 */
+
+/* { dg-do run } */
+/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
+#include "ffitest.h"
+static long long return_ll(int ll0, long long ll1, int ll2)
+{
+ return ll0 + ll1 + ll2;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ long long rlonglong;
+ long long ll1;
+ unsigned ll0, ll2;
+
+ args[0] = &ffi_type_sint;
+ args[1] = &ffi_type_sint64;
+ args[2] = &ffi_type_sint;
+ values[0] = &ll0;
+ values[1] = &ll1;
+ values[2] = &ll2;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
+ &ffi_type_sint64, args) == FFI_OK);
+
+ ll0 = 11111111;
+ ll1 = 11111111111000LL;
+ ll2 = 11111111;
+
+ ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
+ printf("res: %" PRIdLL ", %" PRIdLL "\n", rlonglong, ll0 + ll1 + ll2);
+ /* { dg-output "res: 11111133333222, 11111133333222" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_sc.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_sc.c
new file mode 100644
index 0000000000..19608ee7c8
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_sc.c
@@ -0,0 +1,36 @@
+/* Area: ffi_call
+ Purpose: Check return value signed char.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static signed char return_sc(signed char sc)
+{
+ return sc;
+}
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg rint;
+ signed char sc;
+
+ args[0] = &ffi_type_schar;
+ values[0] = &sc;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_schar, args) == FFI_OK);
+
+ for (sc = (signed char) -127;
+ sc < (signed char) 127; sc++)
+ {
+ ffi_call(&cif, FFI_FN(return_sc), &rint, values);
+ CHECK(rint == (ffi_arg) sc);
+ }
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_sl.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_sl.c
new file mode 100644
index 0000000000..f0fd345f7a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_sl.c
@@ -0,0 +1,38 @@
+/* Area: ffi_call
+ Purpose: Check if long as return type is handled correctly.
+ Limitations: none.
+ PR: none.
+ */
+
+/* { dg-do run } */
+#include "ffitest.h"
+static long return_sl(long l1, long l2)
+{
+ return l1 - l2;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg res;
+ unsigned long l1, l2;
+
+ args[0] = &ffi_type_slong;
+ args[1] = &ffi_type_slong;
+ values[0] = &l1;
+ values[1] = &l2;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
+ &ffi_type_slong, args) == FFI_OK);
+
+ l1 = 1073741823L;
+ l2 = 1073741824L;
+
+ ffi_call(&cif, FFI_FN(return_sl), &res, values);
+ printf("res: %ld, %ld\n", (long)res, l1 - l2);
+ /* { dg-output "res: -1, -1" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_uc.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_uc.c
new file mode 100644
index 0000000000..07c45de511
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_uc.c
@@ -0,0 +1,38 @@
+/* Area: ffi_call
+ Purpose: Check return value unsigned char.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static unsigned char return_uc(unsigned char uc)
+{
+ return uc;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg rint;
+
+ unsigned char uc;
+
+ args[0] = &ffi_type_uchar;
+ values[0] = &uc;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_uchar, args) == FFI_OK);
+
+ for (uc = (unsigned char) '\x00';
+ uc < (unsigned char) '\xff'; uc++)
+ {
+ ffi_call(&cif, FFI_FN(return_uc), &rint, values);
+ CHECK(rint == (signed int) uc);
+ }
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ul.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ul.c
new file mode 100644
index 0000000000..12b266f037
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ul.c
@@ -0,0 +1,38 @@
+/* Area: ffi_call
+ Purpose: Check if unsigned long as return type is handled correctly.
+ Limitations: none.
+ PR: none.
+ Originator: <kaffeetisch at gmx dot de> 20060724 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+static unsigned long return_ul(unsigned long ul1, unsigned long ul2)
+{
+ return ul1 + ul2;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg res;
+ unsigned long ul1, ul2;
+
+ args[0] = &ffi_type_ulong;
+ args[1] = &ffi_type_ulong;
+ values[0] = &ul1;
+ values[1] = &ul2;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
+ &ffi_type_ulong, args) == FFI_OK);
+
+ ul1 = 1073741823L;
+ ul2 = 1073741824L;
+
+ ffi_call(&cif, FFI_FN(return_ul), &res, values);
+ printf("res: %lu, %lu\n", (unsigned long)res, ul1 + ul2);
+ /* { dg-output "res: 2147483647, 2147483647" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large.c b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large.c
new file mode 100644
index 0000000000..23a93b900d
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large.c
@@ -0,0 +1,145 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure returning with different structure size.
+ Depending on the ABI. Check bigger struct which overlaps
+ the gp and fp register count on Darwin/AIX/ppc64.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/21/2007 */
+
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+// 13 FPRs: 104 bytes
+// 14 FPRs: 112 bytes
+
+typedef struct struct_108byte {
+ double a;
+ double b;
+ double c;
+ double d;
+ double e;
+ double f;
+ double g;
+ double h;
+ double i;
+ double j;
+ double k;
+ double l;
+ double m;
+ int n;
+} struct_108byte;
+
+struct_108byte cls_struct_108byte_fn(
+ struct_108byte b0,
+ struct_108byte b1,
+ struct_108byte b2,
+ struct_108byte b3)
+{
+ struct_108byte result;
+
+ result.a = b0.a + b1.a + b2.a + b3.a;
+ result.b = b0.b + b1.b + b2.b + b3.b;
+ result.c = b0.c + b1.c + b2.c + b3.c;
+ result.d = b0.d + b1.d + b2.d + b3.d;
+ result.e = b0.e + b1.e + b2.e + b3.e;
+ result.f = b0.f + b1.f + b2.f + b3.f;
+ result.g = b0.g + b1.g + b2.g + b3.g;
+ result.h = b0.h + b1.h + b2.h + b3.h;
+ result.i = b0.i + b1.i + b2.i + b3.i;
+ result.j = b0.j + b1.j + b2.j + b3.j;
+ result.k = b0.k + b1.k + b2.k + b3.k;
+ result.l = b0.l + b1.l + b2.l + b3.l;
+ result.m = b0.m + b1.m + b2.m + b3.m;
+ result.n = b0.n + b1.n + b2.n + b3.n;
+
+ printf("%g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", result.a, result.b, result.c,
+ result.d, result.e, result.f, result.g, result.h, result.i,
+ result.j, result.k, result.l, result.m, result.n);
+
+ return result;
+}
+
+static void
+cls_struct_108byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
+{
+ struct_108byte b0, b1, b2, b3;
+
+ b0 = *(struct_108byte*)(args[0]);
+ b1 = *(struct_108byte*)(args[1]);
+ b2 = *(struct_108byte*)(args[2]);
+ b3 = *(struct_108byte*)(args[3]);
+
+ *(struct_108byte*)resp = cls_struct_108byte_fn(b0, b1, b2, b3);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[15];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct_108byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 1.0, 2.0, 3.0, 7.0, 2.0, 7 };
+ struct_108byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0, 5.0, 7.0, 9.0, 1.0, 4 };
+ struct_108byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 8.0, 6.0, 1.0, 4.0, 0.0, 3 };
+ struct_108byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 9.0, 2.0, 6.0, 5.0, 3.0, 2 };
+ struct_108byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_double;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = &ffi_type_double;
+ cls_struct_fields[5] = &ffi_type_double;
+ cls_struct_fields[6] = &ffi_type_double;
+ cls_struct_fields[7] = &ffi_type_double;
+ cls_struct_fields[8] = &ffi_type_double;
+ cls_struct_fields[9] = &ffi_type_double;
+ cls_struct_fields[10] = &ffi_type_double;
+ cls_struct_fields[11] = &ffi_type_double;
+ cls_struct_fields[12] = &ffi_type_double;
+ cls_struct_fields[13] = &ffi_type_sint32;
+ cls_struct_fields[14] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = &cls_struct_type;
+ dbl_arg_types[3] = &cls_struct_type;
+ dbl_arg_types[4] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = &h_dbl;
+ args_dbl[4] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_108byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
+ printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
+ res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
+ res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_108byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((struct_108byte(*)(struct_108byte, struct_108byte,
+ struct_108byte, struct_108byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
+ /* { dg-output "\n22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
+ printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
+ res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
+ res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large2.c
new file mode 100644
index 0000000000..e2599d2673
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large2.c
@@ -0,0 +1,148 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure returning with different structure size.
+ Depending on the ABI. Check bigger struct which overlaps
+ the gp and fp register count on Darwin/AIX/ppc64.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/21/2007 */
+
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+// 13 FPRs: 104 bytes
+// 14 FPRs: 112 bytes
+
+typedef struct struct_116byte {
+ double a;
+ double b;
+ double c;
+ double d;
+ double e;
+ double f;
+ double g;
+ double h;
+ double i;
+ double j;
+ double k;
+ double l;
+ double m;
+ double n;
+ int o;
+} struct_116byte;
+
+struct_116byte cls_struct_116byte_fn(
+ struct_116byte b0,
+ struct_116byte b1,
+ struct_116byte b2,
+ struct_116byte b3)
+{
+ struct_116byte result;
+
+ result.a = b0.a + b1.a + b2.a + b3.a;
+ result.b = b0.b + b1.b + b2.b + b3.b;
+ result.c = b0.c + b1.c + b2.c + b3.c;
+ result.d = b0.d + b1.d + b2.d + b3.d;
+ result.e = b0.e + b1.e + b2.e + b3.e;
+ result.f = b0.f + b1.f + b2.f + b3.f;
+ result.g = b0.g + b1.g + b2.g + b3.g;
+ result.h = b0.h + b1.h + b2.h + b3.h;
+ result.i = b0.i + b1.i + b2.i + b3.i;
+ result.j = b0.j + b1.j + b2.j + b3.j;
+ result.k = b0.k + b1.k + b2.k + b3.k;
+ result.l = b0.l + b1.l + b2.l + b3.l;
+ result.m = b0.m + b1.m + b2.m + b3.m;
+ result.n = b0.n + b1.n + b2.n + b3.n;
+ result.o = b0.o + b1.o + b2.o + b3.o;
+
+ printf("%g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", result.a, result.b, result.c,
+ result.d, result.e, result.f, result.g, result.h, result.i,
+ result.j, result.k, result.l, result.m, result.n, result.o);
+
+ return result;
+}
+
+static void
+cls_struct_116byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
+{
+ struct_116byte b0, b1, b2, b3;
+
+ b0 = *(struct_116byte*)(args[0]);
+ b1 = *(struct_116byte*)(args[1]);
+ b2 = *(struct_116byte*)(args[2]);
+ b3 = *(struct_116byte*)(args[3]);
+
+ *(struct_116byte*)resp = cls_struct_116byte_fn(b0, b1, b2, b3);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[16];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct_116byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 7 };
+ struct_116byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0, 5.0, 7.0, 9.0, 1.0, 6.0, 4 };
+ struct_116byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 8.0, 6.0, 1.0, 4.0, 0.0, 7.0, 3 };
+ struct_116byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 9.0, 2.0, 6.0, 5.0, 3.0, 8.0, 2 };
+ struct_116byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_double;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = &ffi_type_double;
+ cls_struct_fields[5] = &ffi_type_double;
+ cls_struct_fields[6] = &ffi_type_double;
+ cls_struct_fields[7] = &ffi_type_double;
+ cls_struct_fields[8] = &ffi_type_double;
+ cls_struct_fields[9] = &ffi_type_double;
+ cls_struct_fields[10] = &ffi_type_double;
+ cls_struct_fields[11] = &ffi_type_double;
+ cls_struct_fields[12] = &ffi_type_double;
+ cls_struct_fields[13] = &ffi_type_double;
+ cls_struct_fields[14] = &ffi_type_sint32;
+ cls_struct_fields[15] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = &cls_struct_type;
+ dbl_arg_types[3] = &cls_struct_type;
+ dbl_arg_types[4] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = &h_dbl;
+ args_dbl[4] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_116byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
+ printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
+ res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
+ res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n, res_dbl.o);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_116byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((struct_116byte(*)(struct_116byte, struct_116byte,
+ struct_116byte, struct_116byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
+ /* { dg-output "\n22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
+ printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
+ res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
+ res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n, res_dbl.o);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium.c b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium.c
new file mode 100644
index 0000000000..1fc6a9edd3
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium.c
@@ -0,0 +1,124 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure returning with different structure size.
+ Depending on the ABI. Check bigger struct which overlaps
+ the gp and fp register count on Darwin/AIX/ppc64.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/21/2007 */
+
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct struct_72byte {
+ double a;
+ double b;
+ double c;
+ double d;
+ double e;
+ double f;
+ double g;
+ double h;
+ double i;
+} struct_72byte;
+
+struct_72byte cls_struct_72byte_fn(
+ struct_72byte b0,
+ struct_72byte b1,
+ struct_72byte b2,
+ struct_72byte b3)
+{
+ struct_72byte result;
+
+ result.a = b0.a + b1.a + b2.a + b3.a;
+ result.b = b0.b + b1.b + b2.b + b3.b;
+ result.c = b0.c + b1.c + b2.c + b3.c;
+ result.d = b0.d + b1.d + b2.d + b3.d;
+ result.e = b0.e + b1.e + b2.e + b3.e;
+ result.f = b0.f + b1.f + b2.f + b3.f;
+ result.g = b0.g + b1.g + b2.g + b3.g;
+ result.h = b0.h + b1.h + b2.h + b3.h;
+ result.i = b0.i + b1.i + b2.i + b3.i;
+
+ printf("%g %g %g %g %g %g %g %g %g\n", result.a, result.b, result.c,
+ result.d, result.e, result.f, result.g, result.h, result.i);
+
+ return result;
+}
+
+static void
+cls_struct_72byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
+{
+ struct_72byte b0, b1, b2, b3;
+
+ b0 = *(struct_72byte*)(args[0]);
+ b1 = *(struct_72byte*)(args[1]);
+ b2 = *(struct_72byte*)(args[2]);
+ b3 = *(struct_72byte*)(args[3]);
+
+ *(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[10];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct_72byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 7.0 };
+ struct_72byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0 };
+ struct_72byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 3.0 };
+ struct_72byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 2.0 };
+ struct_72byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_double;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = &ffi_type_double;
+ cls_struct_fields[5] = &ffi_type_double;
+ cls_struct_fields[6] = &ffi_type_double;
+ cls_struct_fields[7] = &ffi_type_double;
+ cls_struct_fields[8] = &ffi_type_double;
+ cls_struct_fields[9] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = &cls_struct_type;
+ dbl_arg_types[3] = &cls_struct_type;
+ dbl_arg_types[4] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = &h_dbl;
+ args_dbl[4] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_72byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "22 15 17 25 6 13 19 18 16" } */
+ printf("res: %g %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_72byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((struct_72byte(*)(struct_72byte, struct_72byte,
+ struct_72byte, struct_72byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
+ /* { dg-output "\n22 15 17 25 6 13 19 18 16" } */
+ printf("res: %g %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium2.c
new file mode 100644
index 0000000000..cb2f2fba33
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium2.c
@@ -0,0 +1,125 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure returning with different structure size.
+ Depending on the ABI. Check bigger struct which overlaps
+ the gp and fp register count on Darwin/AIX/ppc64.
+ Limitations: none.
+ PR: none.
+ Originator: Blake Chaffin 6/21/2007 */
+
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
+/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
+#include "ffitest.h"
+
+typedef struct struct_72byte {
+ double a;
+ double b;
+ double c;
+ double d;
+ double e;
+ double f;
+ double g;
+ double h;
+ long long i;
+} struct_72byte;
+
+struct_72byte cls_struct_72byte_fn(
+ struct_72byte b0,
+ struct_72byte b1,
+ struct_72byte b2,
+ struct_72byte b3)
+{
+ struct_72byte result;
+
+ result.a = b0.a + b1.a + b2.a + b3.a;
+ result.b = b0.b + b1.b + b2.b + b3.b;
+ result.c = b0.c + b1.c + b2.c + b3.c;
+ result.d = b0.d + b1.d + b2.d + b3.d;
+ result.e = b0.e + b1.e + b2.e + b3.e;
+ result.f = b0.f + b1.f + b2.f + b3.f;
+ result.g = b0.g + b1.g + b2.g + b3.g;
+ result.h = b0.h + b1.h + b2.h + b3.h;
+ result.i = b0.i + b1.i + b2.i + b3.i;
+
+ printf("%g %g %g %g %g %g %g %g %" PRIdLL "\n", result.a, result.b, result.c,
+ result.d, result.e, result.f, result.g, result.h, result.i);
+
+ return result;
+}
+
+static void
+cls_struct_72byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
+{
+ struct_72byte b0, b1, b2, b3;
+
+ b0 = *(struct_72byte*)(args[0]);
+ b1 = *(struct_72byte*)(args[1]);
+ b2 = *(struct_72byte*)(args[2]);
+ b3 = *(struct_72byte*)(args[3]);
+
+ *(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[10];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct_72byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 7 };
+ struct_72byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4 };
+ struct_72byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 3 };
+ struct_72byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 2 };
+ struct_72byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_double;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = &ffi_type_double;
+ cls_struct_fields[5] = &ffi_type_double;
+ cls_struct_fields[6] = &ffi_type_double;
+ cls_struct_fields[7] = &ffi_type_double;
+ cls_struct_fields[8] = &ffi_type_sint64;
+ cls_struct_fields[9] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = &cls_struct_type;
+ dbl_arg_types[3] = &cls_struct_type;
+ dbl_arg_types[4] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = &h_dbl;
+ args_dbl[4] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_72byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "22 15 17 25 6 13 19 18 16" } */
+ printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_72byte_gn, NULL, code) == FFI_OK);
+
+ res_dbl = ((struct_72byte(*)(struct_72byte, struct_72byte,
+ struct_72byte, struct_72byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
+ /* { dg-output "\n22 15 17 25 6 13 19 18 16" } */
+ printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
+
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c
new file mode 100644
index 0000000000..3de45de7aa
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c
@@ -0,0 +1,44 @@
+/* Area: ffi_call
+ Purpose: Check strlen function call.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static size_t my_strlen(char *s)
+{
+ return (strlen(s));
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg rint;
+ char *s;
+
+ args[0] = &ffi_type_pointer;
+ values[0] = (void*) &s;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_sint, args) == FFI_OK);
+
+ s = "a";
+ ffi_call(&cif, FFI_FN(my_strlen), &rint, values);
+ CHECK(rint == 1);
+
+ s = "1234567";
+ ffi_call(&cif, FFI_FN(my_strlen), &rint, values);
+ CHECK(rint == 7);
+
+ s = "1234567890123456789012345";
+ ffi_call(&cif, FFI_FN(my_strlen), &rint, values);
+ CHECK(rint == 25);
+
+ exit (0);
+}
+
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c
new file mode 100644
index 0000000000..6fbcc87400
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c
@@ -0,0 +1,44 @@
+/* Area: ffi_call
+ Purpose: Check stdcall strlen call on X86_WIN32 systems.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
+
+#include "ffitest.h"
+
+static size_t __attribute__((stdcall)) my_stdcall_strlen(char *s)
+{
+ return (strlen(s));
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg rint;
+ char *s;
+ args[0] = &ffi_type_pointer;
+ values[0] = (void*) &s;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 1,
+ &ffi_type_sint, args) == FFI_OK);
+
+ s = "a";
+ ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
+ CHECK(rint == 1);
+
+ s = "1234567";
+ ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
+ CHECK(rint == 7);
+
+ s = "1234567890123456789012345";
+ ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
+ CHECK(rint == 25);
+
+ printf("stdcall strlen tests passed\n");
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c
new file mode 100644
index 0000000000..ea76c85449
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c
@@ -0,0 +1,65 @@
+/* Area: ffi_call
+ Purpose: Check structures.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct
+{
+ unsigned char uc;
+ double d;
+ unsigned int ui;
+} test_structure_1;
+
+static test_structure_1 struct1(test_structure_1 ts)
+{
+ ts.uc++;
+ ts.d--;
+ ts.ui++;
+
+ return ts;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_type ts1_type;
+ ffi_type *ts1_type_elements[4];
+ ts1_type.size = 0;
+ ts1_type.alignment = 0;
+ ts1_type.type = FFI_TYPE_STRUCT;
+ ts1_type.elements = ts1_type_elements;
+ ts1_type_elements[0] = &ffi_type_uchar;
+ ts1_type_elements[1] = &ffi_type_double;
+ ts1_type_elements[2] = &ffi_type_uint;
+ ts1_type_elements[3] = NULL;
+
+ test_structure_1 ts1_arg;
+ /* This is a hack to get a properly aligned result buffer */
+ test_structure_1 *ts1_result =
+ (test_structure_1 *) malloc (sizeof(test_structure_1));
+
+ args[0] = &ts1_type;
+ values[0] = &ts1_arg;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ts1_type, args) == FFI_OK);
+
+ ts1_arg.uc = '\x01';
+ ts1_arg.d = 3.14159;
+ ts1_arg.ui = 555;
+
+ ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
+
+ CHECK(ts1_result->ui == 556);
+ CHECK(ts1_result->d == 3.14159 - 1);
+
+ free (ts1_result);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c
new file mode 100644
index 0000000000..14bc9fdc6f
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c
@@ -0,0 +1,67 @@
+/* Area: ffi_call
+ Purpose: Check structures.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct
+{
+ double d1;
+ double d2;
+} test_structure_2;
+
+static test_structure_2 struct2(test_structure_2 ts)
+{
+ ts.d1--;
+ ts.d2--;
+
+ return ts;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ test_structure_2 ts2_arg;
+ ffi_type ts2_type;
+ ffi_type *ts2_type_elements[3];
+ ts2_type.size = 0;
+ ts2_type.alignment = 0;
+ ts2_type.type = FFI_TYPE_STRUCT;
+ ts2_type.elements = ts2_type_elements;
+ ts2_type_elements[0] = &ffi_type_double;
+ ts2_type_elements[1] = &ffi_type_double;
+ ts2_type_elements[2] = NULL;
+
+
+ /* This is a hack to get a properly aligned result buffer */
+ test_structure_2 *ts2_result =
+ (test_structure_2 *) malloc (sizeof(test_structure_2));
+
+ args[0] = &ts2_type;
+ values[0] = &ts2_arg;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts2_type, args) == FFI_OK);
+
+ ts2_arg.d1 = 5.55;
+ ts2_arg.d2 = 6.66;
+
+ printf ("%g\n", ts2_arg.d1);
+ printf ("%g\n", ts2_arg.d2);
+
+ ffi_call(&cif, FFI_FN(struct2), ts2_result, values);
+
+ printf ("%g\n", ts2_result->d1);
+ printf ("%g\n", ts2_result->d2);
+
+ CHECK(ts2_result->d1 == 5.55 - 1);
+ CHECK(ts2_result->d2 == 6.66 - 1);
+
+ free (ts2_result);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c
new file mode 100644
index 0000000000..e0bb09b078
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c
@@ -0,0 +1,59 @@
+/* Area: ffi_call
+ Purpose: Check structures.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct
+{
+ int si;
+} test_structure_3;
+
+static test_structure_3 struct3(test_structure_3 ts)
+{
+ ts.si = -(ts.si*2);
+
+ return ts;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ int compare_value;
+ ffi_type ts3_type;
+ ffi_type *ts3_type_elements[2];
+ ts3_type.size = 0;
+ ts3_type.alignment = 0;
+ ts3_type.type = FFI_TYPE_STRUCT;
+ ts3_type.elements = ts3_type_elements;
+ ts3_type_elements[0] = &ffi_type_sint;
+ ts3_type_elements[1] = NULL;
+
+ test_structure_3 ts3_arg;
+ test_structure_3 *ts3_result =
+ (test_structure_3 *) malloc (sizeof(test_structure_3));
+
+ args[0] = &ts3_type;
+ values[0] = &ts3_arg;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ts3_type, args) == FFI_OK);
+
+ ts3_arg.si = -123;
+ compare_value = ts3_arg.si;
+
+ ffi_call(&cif, FFI_FN(struct3), ts3_result, values);
+
+ printf ("%d %d\n", ts3_result->si, -(compare_value*2));
+
+ CHECK(ts3_result->si == -(compare_value*2));
+
+ free (ts3_result);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c
new file mode 100644
index 0000000000..0ad0a83ba1
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c
@@ -0,0 +1,63 @@
+/* Area: ffi_call
+ Purpose: Check structures.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct
+{
+ unsigned ui1;
+ unsigned ui2;
+ unsigned ui3;
+} test_structure_4;
+
+static test_structure_4 struct4(test_structure_4 ts)
+{
+ ts.ui3 = ts.ui1 * ts.ui2 * ts.ui3;
+
+ return ts;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_type ts4_type;
+ ffi_type *ts4_type_elements[4];
+ ts4_type.size = 0;
+ ts4_type.alignment = 0;
+ ts4_type.type = FFI_TYPE_STRUCT;
+ test_structure_4 ts4_arg;
+ ts4_type.elements = ts4_type_elements;
+ ts4_type_elements[0] = &ffi_type_uint;
+ ts4_type_elements[1] = &ffi_type_uint;
+ ts4_type_elements[2] = &ffi_type_uint;
+ ts4_type_elements[3] = NULL;
+
+
+ /* This is a hack to get a properly aligned result buffer */
+ test_structure_4 *ts4_result =
+ (test_structure_4 *) malloc (sizeof(test_structure_4));
+
+ args[0] = &ts4_type;
+ values[0] = &ts4_arg;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts4_type, args) == FFI_OK);
+
+ ts4_arg.ui1 = 2;
+ ts4_arg.ui2 = 3;
+ ts4_arg.ui3 = 4;
+
+ ffi_call (&cif, FFI_FN(struct4), ts4_result, values);
+
+ CHECK(ts4_result->ui3 == 2U * 3U * 4U);
+
+
+ free (ts4_result);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c
new file mode 100644
index 0000000000..c03cc97ac9
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c
@@ -0,0 +1,65 @@
+/* Area: ffi_call
+ Purpose: Check structures.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+typedef struct
+{
+ char c1;
+ char c2;
+} test_structure_5;
+
+static test_structure_5 struct5(test_structure_5 ts1, test_structure_5 ts2)
+{
+ ts1.c1 += ts2.c1;
+ ts1.c2 -= ts2.c2;
+
+ return ts1;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_type ts5_type;
+ ffi_type *ts5_type_elements[3];
+ ts5_type.size = 0;
+ ts5_type.alignment = 0;
+ ts5_type.type = FFI_TYPE_STRUCT;
+ ts5_type.elements = ts5_type_elements;
+ ts5_type_elements[0] = &ffi_type_schar;
+ ts5_type_elements[1] = &ffi_type_schar;
+ ts5_type_elements[2] = NULL;
+
+ test_structure_5 ts5_arg1, ts5_arg2;
+
+ /* This is a hack to get a properly aligned result buffer */
+ test_structure_5 *ts5_result =
+ (test_structure_5 *) malloc (sizeof(test_structure_5));
+
+ args[0] = &ts5_type;
+ args[1] = &ts5_type;
+ values[0] = &ts5_arg1;
+ values[1] = &ts5_arg2;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ts5_type, args) == FFI_OK);
+
+ ts5_arg1.c1 = 2;
+ ts5_arg1.c2 = 6;
+ ts5_arg2.c1 = 5;
+ ts5_arg2.c2 = 3;
+
+ ffi_call (&cif, FFI_FN(struct5), ts5_result, values);
+
+ CHECK(ts5_result->c1 == 7);
+ CHECK(ts5_result->c2 == 3);
+
+
+ free (ts5_result);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c
new file mode 100644
index 0000000000..83db9afbbe
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c
@@ -0,0 +1,64 @@
+/* Area: ffi_call
+ Purpose: Check structures.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+typedef struct
+{
+ float f;
+ double d;
+} test_structure_6;
+
+static test_structure_6 struct6 (test_structure_6 ts)
+{
+ ts.f += 1;
+ ts.d += 1;
+
+ return ts;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_type ts6_type;
+ ffi_type *ts6_type_elements[3];
+ ts6_type.size = 0;
+ ts6_type.alignment = 0;
+ ts6_type.type = FFI_TYPE_STRUCT;
+ ts6_type.elements = ts6_type_elements;
+ ts6_type_elements[0] = &ffi_type_float;
+ ts6_type_elements[1] = &ffi_type_double;
+ ts6_type_elements[2] = NULL;
+
+
+ test_structure_6 ts6_arg;
+
+ /* This is a hack to get a properly aligned result buffer */
+ test_structure_6 *ts6_result =
+ (test_structure_6 *) malloc (sizeof(test_structure_6));
+
+ args[0] = &ts6_type;
+ values[0] = &ts6_arg;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts6_type, args) == FFI_OK);
+
+ ts6_arg.f = 5.55f;
+ ts6_arg.d = 6.66;
+
+ printf ("%g\n", ts6_arg.f);
+ printf ("%g\n", ts6_arg.d);
+
+ ffi_call(&cif, FFI_FN(struct6), ts6_result, values);
+
+ CHECK(ts6_result->f == 5.55f + 1);
+ CHECK(ts6_result->d == 6.66 + 1);
+
+ free (ts6_result);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c
new file mode 100644
index 0000000000..58aac4c992
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c
@@ -0,0 +1,74 @@
+/* Area: ffi_call
+ Purpose: Check structures.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+typedef struct
+{
+ float f1;
+ float f2;
+ double d;
+} test_structure_7;
+
+static test_structure_7 struct7 (test_structure_7 ts)
+{
+ ts.f1 += 1;
+ ts.f2 += 1;
+ ts.d += 1;
+
+ return ts;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_type ts7_type;
+ ffi_type *ts7_type_elements[4];
+ ts7_type.size = 0;
+ ts7_type.alignment = 0;
+ ts7_type.type = FFI_TYPE_STRUCT;
+ ts7_type.elements = ts7_type_elements;
+ ts7_type_elements[0] = &ffi_type_float;
+ ts7_type_elements[1] = &ffi_type_float;
+ ts7_type_elements[2] = &ffi_type_double;
+ ts7_type_elements[3] = NULL;
+
+
+ test_structure_7 ts7_arg;
+
+ /* This is a hack to get a properly aligned result buffer */
+ test_structure_7 *ts7_result =
+ (test_structure_7 *) malloc (sizeof(test_structure_7));
+
+ args[0] = &ts7_type;
+ values[0] = &ts7_arg;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts7_type, args) == FFI_OK);
+
+ ts7_arg.f1 = 5.55f;
+ ts7_arg.f2 = 55.5f;
+ ts7_arg.d = 6.66;
+
+ printf ("%g\n", ts7_arg.f1);
+ printf ("%g\n", ts7_arg.f2);
+ printf ("%g\n", ts7_arg.d);
+
+ ffi_call(&cif, FFI_FN(struct7), ts7_result, values);
+
+ printf ("%g\n", ts7_result->f1);
+ printf ("%g\n", ts7_result->f2);
+ printf ("%g\n", ts7_result->d);
+
+ CHECK(ts7_result->f1 == 5.55f + 1);
+ CHECK(ts7_result->f2 == 55.5f + 1);
+ CHECK(ts7_result->d == 6.66 + 1);
+
+ free (ts7_result);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c
new file mode 100644
index 0000000000..c773ac7b5a
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c
@@ -0,0 +1,80 @@
+/* Area: ffi_call
+ Purpose: Check structures.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+typedef struct
+{
+ float f1;
+ float f2;
+ float f3;
+ float f4;
+} test_structure_8;
+
+static test_structure_8 struct8 (test_structure_8 ts)
+{
+ ts.f1 += 1;
+ ts.f2 += 1;
+ ts.f3 += 1;
+ ts.f4 += 1;
+
+ return ts;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_type ts8_type;
+ ffi_type *ts8_type_elements[5];
+ ts8_type.size = 0;
+ ts8_type.alignment = 0;
+ ts8_type.type = FFI_TYPE_STRUCT;
+ ts8_type.elements = ts8_type_elements;
+ ts8_type_elements[0] = &ffi_type_float;
+ ts8_type_elements[1] = &ffi_type_float;
+ ts8_type_elements[2] = &ffi_type_float;
+ ts8_type_elements[3] = &ffi_type_float;
+ ts8_type_elements[4] = NULL;
+
+ test_structure_8 ts8_arg;
+
+ /* This is a hack to get a properly aligned result buffer */
+ test_structure_8 *ts8_result =
+ (test_structure_8 *) malloc (sizeof(test_structure_8));
+
+ args[0] = &ts8_type;
+ values[0] = &ts8_arg;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts8_type, args) == FFI_OK);
+
+ ts8_arg.f1 = 5.55f;
+ ts8_arg.f2 = 55.5f;
+ ts8_arg.f3 = -5.55f;
+ ts8_arg.f4 = -55.5f;
+
+ printf ("%g\n", ts8_arg.f1);
+ printf ("%g\n", ts8_arg.f2);
+ printf ("%g\n", ts8_arg.f3);
+ printf ("%g\n", ts8_arg.f4);
+
+ ffi_call(&cif, FFI_FN(struct8), ts8_result, values);
+
+ printf ("%g\n", ts8_result->f1);
+ printf ("%g\n", ts8_result->f2);
+ printf ("%g\n", ts8_result->f3);
+ printf ("%g\n", ts8_result->f4);
+
+ CHECK(ts8_result->f1 == 5.55f + 1);
+ CHECK(ts8_result->f2 == 55.5f + 1);
+ CHECK(ts8_result->f3 == -5.55f + 1);
+ CHECK(ts8_result->f4 == -55.5f + 1);
+
+ free (ts8_result);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c
new file mode 100644
index 0000000000..f30091f54f
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c
@@ -0,0 +1,67 @@
+/* Area: ffi_call
+ Purpose: Check structures.
+ Limitations: none.
+ PR: none.
+ Originator: From the original ffitest.c */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct
+{
+ float f;
+ int i;
+} test_structure_9;
+
+static test_structure_9 struct9 (test_structure_9 ts)
+{
+ ts.f += 1;
+ ts.i += 1;
+
+ return ts;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_type ts9_type;
+ ffi_type *ts9_type_elements[3];
+ ts9_type.size = 0;
+ ts9_type.alignment = 0;
+ ts9_type.type = FFI_TYPE_STRUCT;
+ ts9_type.elements = ts9_type_elements;
+ ts9_type_elements[0] = &ffi_type_float;
+ ts9_type_elements[1] = &ffi_type_sint;
+ ts9_type_elements[2] = NULL;
+
+ test_structure_9 ts9_arg;
+
+ /* This is a hack to get a properly aligned result buffer */
+ test_structure_9 *ts9_result =
+ (test_structure_9 *) malloc (sizeof(test_structure_9));
+
+ args[0] = &ts9_type;
+ values[0] = &ts9_arg;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts9_type, args) == FFI_OK);
+
+ ts9_arg.f = 5.55f;
+ ts9_arg.i = 5;
+
+ printf ("%g\n", ts9_arg.f);
+ printf ("%d\n", ts9_arg.i);
+
+ ffi_call(&cif, FFI_FN(struct9), ts9_result, values);
+
+ printf ("%g\n", ts9_result->f);
+ printf ("%d\n", ts9_result->i);
+
+ CHECK(ts9_result->f == 5.55f + 1);
+ CHECK(ts9_result->i == 5 + 1);
+
+ free (ts9_result);
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/testclosure.c b/Modules/_ctypes/libffi/testsuite/libffi.call/testclosure.c
new file mode 100644
index 0000000000..161cc89179
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/testclosure.c
@@ -0,0 +1,70 @@
+/* Area: closure_call
+ Purpose: Check return value float.
+ Limitations: none.
+ PR: 41908.
+ Originator: <rfm@gnu.org> 20091102 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_combined {
+ float a;
+ float b;
+ float c;
+ float d;
+} cls_struct_combined;
+
+void cls_struct_combined_fn(struct cls_struct_combined arg)
+{
+ printf("%g %g %g %g\n",
+ arg.a, arg.b,
+ arg.c, arg.d);
+ fflush(stdout);
+}
+
+static void
+cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
+ void** args, void* userdata __UNUSED__)
+{
+ struct cls_struct_combined a0;
+
+ a0 = *(struct cls_struct_combined*)(args[0]);
+
+ cls_struct_combined_fn(a0);
+}
+
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type* cls_struct_fields0[5];
+ ffi_type cls_struct_type0;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type0.size = 0;
+ cls_struct_type0.alignment = 0;
+ cls_struct_type0.type = FFI_TYPE_STRUCT;
+ cls_struct_type0.elements = cls_struct_fields0;
+
+ struct cls_struct_combined g_dbl = {4.0, 5.0, 1.0, 8.0};
+
+ cls_struct_fields0[0] = &ffi_type_float;
+ cls_struct_fields0[1] = &ffi_type_float;
+ cls_struct_fields0[2] = &ffi_type_float;
+ cls_struct_fields0[3] = &ffi_type_float;
+ cls_struct_fields0[4] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type0;
+ dbl_arg_types[1] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void,
+ dbl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
+
+ ((void(*)(cls_struct_combined)) (code))(g_dbl);
+ /* { dg-output "4 5 1 8" } */
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.special/ffitestcxx.h b/Modules/_ctypes/libffi/testsuite/libffi.special/ffitestcxx.h
new file mode 100644
index 0000000000..83f5442849
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.special/ffitestcxx.h
@@ -0,0 +1,96 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <ffi.h>
+#include "fficonfig.h"
+
+#define MAX_ARGS 256
+
+
+/* Define __UNUSED__ that also other compilers than gcc can run the tests. */
+#undef __UNUSED__
+#if defined(__GNUC__)
+#define __UNUSED__ __attribute__((__unused__))
+#else
+#define __UNUSED__
+#endif
+
+#define CHECK(x) (!(x) ? abort() : (void)0)
+
+/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
+ file open. */
+#ifdef HAVE_MMAP_ANON
+# undef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED -1
+# endif
+# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
+# define MAP_ANONYMOUS MAP_ANON
+# endif
+# define USING_MMAP
+
+#endif
+
+#ifdef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED -1
+# endif
+# define USING_MMAP
+
+#endif
+
+
+/* MinGW kludge. */
+#ifdef _WIN64
+#define PRIdLL "I64d"
+#define PRIuLL "I64u"
+#else
+#define PRIdLL "lld"
+#define PRIuLL "llu"
+#endif
+
+#ifdef USING_MMAP
+static inline void *
+allocate_mmap (size_t size)
+{
+ void *page;
+#if defined (HAVE_MMAP_DEV_ZERO)
+ static int dev_zero_fd = -1;
+#endif
+
+#ifdef HAVE_MMAP_DEV_ZERO
+ if (dev_zero_fd == -1)
+ {
+ dev_zero_fd = open ("/dev/zero", O_RDONLY);
+ if (dev_zero_fd == -1)
+ {
+ perror ("open /dev/zero: %m");
+ exit (1);
+ }
+ }
+#endif
+
+
+#ifdef HAVE_MMAP_ANON
+ page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+#endif
+#ifdef HAVE_MMAP_DEV_ZERO
+ page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE, dev_zero_fd, 0);
+#endif
+
+ if (page == (char *) MAP_FAILED)
+ {
+ perror ("virtual memory exhausted");
+ exit (1);
+ }
+
+ return page;
+}
+
+#endif
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.special/special.exp b/Modules/_ctypes/libffi/testsuite/libffi.special/special.exp
new file mode 100644
index 0000000000..e167e86581
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.special/special.exp
@@ -0,0 +1,37 @@
+# Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+load_lib libffi-dg.exp
+
+dg-init
+libffi-init
+
+global srcdir subdir
+
+global cxx_options
+
+set cxx_options " -shared-libgcc -lstdc++"
+
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O0 -W -Wall"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O2"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O3"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-Os"
+
+dg-finish
+
+# Local Variables:
+# tcl-indent-level:4
+# End:
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest.cc b/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest.cc
new file mode 100644
index 0000000000..d7ffd4aa21
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest.cc
@@ -0,0 +1,124 @@
+/* Area: ffi_closure, unwind info
+ Purpose: Check if the unwind information is passed correctly.
+ Limitations: none.
+ PR: none.
+ Originator: Jeff Sturm <jsturm@one-point.com> */
+
+/* { dg-do run } */
+#include "ffitestcxx.h"
+
+#if defined HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#if defined HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+void
+closure_test_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
+ void** args __UNUSED__, void* userdata __UNUSED__)
+{
+ throw 9;
+}
+
+typedef void (*closure_test_type)();
+
+void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp,
+ void** args, void* userdata __UNUSED__)
+ {
+ *(ffi_arg*)resp =
+ (int)*(float *)args[0] +(int)(*(float *)args[1]) +
+ (int)(*(float *)args[2]) + (int)*(float *)args[3] +
+ (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) +
+ (int)*(float *)args[6] + (int)(*(int *)args[7]) +
+ (int)(*(double*)args[8]) + (int)*(int *)args[9] +
+ (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
+ (int)*(int *)args[12] + (int)(*(int *)args[13]) +
+ (int)(*(int *)args[14]) + *(int *)args[15] + (int)(intptr_t)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(float *)args[0], (int)(*(float *)args[1]),
+ (int)(*(float *)args[2]), (int)*(float *)args[3],
+ (int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
+ (int)*(float *)args[6], (int)(*(int *)args[7]),
+ (int)(*(double *)args[8]), (int)*(int *)args[9],
+ (int)(*(int *)args[10]), (int)(*(float *)args[11]),
+ (int)*(int *)args[12], (int)(*(int *)args[13]),
+ (int)(*(int *)args[14]), *(int *)args[15],
+ (int)(intptr_t)userdata, (int)*(ffi_arg*)resp);
+
+ throw (int)*(ffi_arg*)resp;
+}
+
+typedef int (*closure_test_type1)(float, float, float, float, signed short,
+ float, float, int, double, int, int, float,
+ int, int, int, int);
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = (ffi_closure *)ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type * cl_arg_types[17];
+
+ {
+ cl_arg_types[1] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0,
+ &ffi_type_void, cl_arg_types) == FFI_OK);
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn, NULL, code) == FFI_OK);
+
+ try
+ {
+ (*((closure_test_type)(code)))();
+ } catch (int exception_code)
+ {
+ CHECK(exception_code == 9);
+ }
+
+ printf("part one OK\n");
+ /* { dg-output "part one OK" } */
+ }
+
+ {
+
+ cl_arg_types[0] = &ffi_type_float;
+ cl_arg_types[1] = &ffi_type_float;
+ cl_arg_types[2] = &ffi_type_float;
+ cl_arg_types[3] = &ffi_type_float;
+ cl_arg_types[4] = &ffi_type_sshort;
+ cl_arg_types[5] = &ffi_type_float;
+ cl_arg_types[6] = &ffi_type_float;
+ cl_arg_types[7] = &ffi_type_uint;
+ cl_arg_types[8] = &ffi_type_double;
+ cl_arg_types[9] = &ffi_type_uint;
+ cl_arg_types[10] = &ffi_type_uint;
+ cl_arg_types[11] = &ffi_type_float;
+ cl_arg_types[12] = &ffi_type_uint;
+ cl_arg_types[13] = &ffi_type_uint;
+ cl_arg_types[14] = &ffi_type_uint;
+ cl_arg_types[15] = &ffi_type_uint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1,
+ (void *) 3 /* userdata */, code) == FFI_OK);
+ try
+ {
+ (*((closure_test_type1)code))
+ (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
+ 19, 21, 1);
+ /* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
+ } catch (int exception_code)
+ {
+ CHECK(exception_code == 255);
+ }
+ printf("part two OK\n");
+ /* { dg-output "\npart two OK" } */
+ }
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc b/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
new file mode 100644
index 0000000000..29739cdb17
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
@@ -0,0 +1,53 @@
+/* Area: ffi_call, unwind info
+ Purpose: Check if the unwind information is passed correctly.
+ Limitations: none.
+ PR: none.
+ Originator: Andreas Tobler <andreast@gcc.gnu.org> 20061213 */
+
+/* { dg-do run } */
+#include "ffitestcxx.h"
+
+static int checking(int a __UNUSED__, short b __UNUSED__,
+ signed char c __UNUSED__)
+{
+ throw 9;
+}
+
+int main (void)
+{
+ ffi_cif cif;
+ ffi_type *args[MAX_ARGS];
+ void *values[MAX_ARGS];
+ ffi_arg rint;
+
+ signed int si;
+ signed short ss;
+ signed char sc;
+
+ args[0] = &ffi_type_sint;
+ values[0] = &si;
+ args[1] = &ffi_type_sshort;
+ values[1] = &ss;
+ args[2] = &ffi_type_schar;
+ values[2] = &sc;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
+ &ffi_type_sint, args) == FFI_OK);
+
+ si = -6;
+ ss = -12;
+ sc = -1;
+ {
+ try
+ {
+ ffi_call(&cif, FFI_FN(checking), &rint, values);
+ } catch (int exception_code)
+ {
+ CHECK(exception_code == 9);
+ }
+ printf("part one OK\n");
+ /* { dg-output "part one OK" } */
+ }
+ exit(0);
+}
diff --git a/Modules/_ctypes/libffi/texinfo.tex b/Modules/_ctypes/libffi/texinfo.tex
new file mode 100644
index 0000000000..ff2c40654b
--- /dev/null
+++ b/Modules/_ctypes/libffi/texinfo.tex
@@ -0,0 +1,7210 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2005-07-05.19}
+%
+% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+% Foundation, Inc.
+%
+% This texinfo.tex file is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation; either version 2, or (at
+% your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this texinfo.tex file; see the file COPYING. If not, write
+% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+% Boston, MA 02110-1301, USA.
+%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction. (This has been our intent since Texinfo was invented.)
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
+% ftp://tug.org/tex/texinfo.tex
+% (and all CTAN mirrors, see http://www.ctan.org).
+% The texinfo.tex in any given distribution could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever; this makes foo.ps.
+% The extra TeX runs get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages, to some
+% extent. You can get the existing language-specific files from the
+% full Texinfo distribution.
+%
+% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+ \catcode`+=\active \catcode`\_=\active}
+
+\message{Basics,}
+\chardef\other=12
+
+% We never want plain's \outer definition of \+ in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+% Save some plain tex macros whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexfootnote=\footnote
+\let\ptexgtr=>
+\let\ptexhat=^
+\let\ptexi=\i
+\let\ptexindent=\indent
+\let\ptexinsert=\insert
+\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexnewwrite\newwrite
+\let\ptexnoindent=\noindent
+\let\ptexplus=+
+\let\ptexrbrace=\}
+\let\ptexslash=\/
+\let\ptexstar=\*
+\let\ptext=\t
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Pre-3.0.
+\else
+ \def\linenumber{l.\the\inputlineno:\space}
+\fi
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+
+% In some macros, we cannot use the `\? notation---the left quote is
+% in some cases the escape char.
+\chardef\backChar = `\\
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dotChar = `\.
+\chardef\exclamChar= `\!
+\chardef\plusChar = `\+
+\chardef\questChar = `\?
+\chardef\semiChar = `\;
+\chardef\underChar = `\_
+
+\chardef\spaceChar = `\ %
+\chardef\spacecat = 10
+\def\spaceisspace{\catcode\spaceChar=\spacecat}
+
+{% for help with debugging.
+ % example usage: \expandafter\show\activebackslash
+ \catcode`\! = 0 \catcode`\\ = \active
+ !global!def!activebackslash{\}
+}
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+% The following is used inside several \edef's.
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
+
+% Hyphenation fixes.
+\hyphenation{
+ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
+ ap-pen-dix bit-map bit-maps
+ data-base data-bases eshell fall-ing half-way long-est man-u-script
+ man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
+ par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
+ spell-ing spell-ings
+ stand-alone strong-est time-stamp time-stamps which-ever white-space
+ wide-spread wrap-around
+}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen\bindingoffset
+\newdimen\normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal. We also make
+% some effort to order the tracing commands to reduce output in the log
+% file; cf. trace.sty in LaTeX.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{%
+ \tracingstats2
+ \tracingpages1
+ \tracinglostchars2 % 2 gives us more in etex
+ \tracingparagraphs1
+ \tracingoutput1
+ \tracingmacros2
+ \tracingrestores1
+ \showboxbreadth\maxdimen \showboxdepth\maxdimen
+ \ifx\eTeXversion\undefined\else % etex gives us more logging
+ \tracingscantokens1
+ \tracingifs1
+ \tracinggroups1
+ \tracingnesting2
+ \tracingassigns1
+ \fi
+ \tracingcommands3 % 3 gives us more in etex
+ \errorcontextlines16
+}%
+
+% add check for \lastpenalty to plain's definitions. If the last thing
+% we did was a \nobreak, we don't want to insert more space.
+%
+\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
+ \removelastskip\penalty-50\smallskip\fi\fi}
+\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
+ \removelastskip\penalty-100\medskip\fi\fi}
+\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
+ \removelastskip\penalty-200\bigskip\fi\fi}
+
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+ \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+ %
+ {%
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \indexdummies % don't expand commands in the output.
+ \shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingxxx.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 2\baselineskip
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \indexdummies
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1 \unvbox#1
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+ \def\next{#2}%
+ \begingroup
+ \obeylines
+ \spaceisspace
+ #1%
+ \parseargline\empty% Insert the \empty token, see \finishparsearg below.
+}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ \argremovecomment #1\comment\ArgTerm%
+ }%
+}
+
+% First remove any @comment, then any @c comment.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+
+% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
+%
+% \argremovec might leave us with trailing space, e.g.,
+% @end itemize @c foo
+% This space token undergoes the same procedure and is eventually removed
+% by \finishparsearg.
+%
+\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
+\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
+\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
+ \def\temp{#3}%
+ \ifx\temp\empty
+ % We cannot use \next here, as it holds the macro to run;
+ % thus we reuse \temp.
+ \let\temp\finishparsearg
+ \else
+ \let\temp\argcheckspaces
+ \fi
+ % Put the space token in:
+ \temp#1 #3\ArgTerm
+}
+
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it now,
+% just before passing the control to \next.
+% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
+% either the null string, or it ends with \^^M---thus there is no danger
+% that a pair of braces would be stripped.
+%
+% But first, we have to remove the trailing space token.
+%
+\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}}
+
+% \parseargdef\foo{...}
+% is roughly equivalent to
+% \def\foo{\parsearg\Xfoo}
+% \def\Xfoo#1{...}
+%
+% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
+% favourite TeX trick. --kasal, 16nov03
+
+\def\parseargdef#1{%
+ \expandafter \doparseargdef \csname\string#1\endcsname #1%
+}
+\def\doparseargdef#1#2{%
+ \def#2{\parsearg#1}%
+ \def#1##1%
+}
+
+% Several utility definitions with active space:
+{
+ \obeyspaces
+ \gdef\obeyedspace{ }
+
+ % Make each space character in the input produce a normal interword
+ % space in the output. Don't allow a line break at this space, as this
+ % is used only in environments like @example, where each line of input
+ % should produce a line of output anyway.
+ %
+ \gdef\sepspaces{\obeyspaces\let =\tie}
+
+ % If an index command is used in an @example environment, any spaces
+ % therein should become regular spaces in the raw index file, not the
+ % expansion of \tie (\leavevmode \penalty \@M \ ).
+ \gdef\unsepspaces{\let =\space}
+}
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+% Define the framework for environments in texinfo.tex. It's used like this:
+%
+% \envdef\foo{...}
+% \def\Efoo{...}
+%
+% It's the responsibility of \envdef to insert \begingroup before the
+% actual body; @end closes the group after calling \Efoo. \envdef also
+% defines \thisenv, so the current environment is known; @end checks
+% whether the environment name matches. The \checkenv macro can also be
+% used to check whether the current environment is the one expected.
+%
+% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
+% are not treated as enviroments; they don't open a group. (The
+% implementation of @end takes care not to call \endgroup in this
+% special case.)
+
+
+% At runtime, environments start with this:
+\def\startenvironment#1{\begingroup\def\thisenv{#1}}
+% initialize
+\let\thisenv\empty
+
+% ... but they get defined via ``\envdef\foo{...}'':
+\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
+\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
+
+% Check whether we're in the right environment:
+\def\checkenv#1{%
+ \def\temp{#1}%
+ \ifx\thisenv\temp
+ \else
+ \badenverr
+ \fi
+}
+
+% Evironment mismatch, #1 expected:
+\def\badenverr{%
+ \errhelp = \EMsimple
+ \errmessage{This command can appear only \inenvironment\temp,
+ not \inenvironment\thisenv}%
+}
+\def\inenvironment#1{%
+ \ifx#1\empty
+ out of any environment%
+ \else
+ in environment \expandafter\string#1%
+ \fi
+}
+
+% @end foo executes the definition of \Efoo.
+% But first, it executes a specialized version of \checkenv
+%
+\parseargdef\end{%
+ \if 1\csname iscond.#1\endcsname
+ \else
+ % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
+ \expandafter\checkenv\csname#1\endcsname
+ \csname E#1\endcsname
+ \endgroup
+ \fi
+}
+
+\newhelp\EMsimple{Press RETURN to continue.}
+
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt\char64}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+ % Definitions to produce \{ and \} commands for indices,
+ % and @{ and @} for the aux/toc files.
+ \catcode`\{ = \other \catcode`\} = \other
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\! = 0 \catcode`\\ = \other
+ !gdef!lbracecmd[\{]%
+ !gdef!rbracecmd[\}]%
+ !gdef!lbraceatcmd[@{]%
+ !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ptexi
+ \else\ifx\temp\jmacro \j
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence. (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo. Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+ L\kern-.36em
+ {\setbox0=\hbox{T}%
+ \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
+ \kern-.15em
+ \TeX
+}
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @/ allows a line break.
+\let\/=\allowbreak
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=\endofsentencespacefactor\space}
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=\endofsentencespacefactor\space}
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=\endofsentencespacefactor\space}
+
+% @frenchspacing on|off says whether to put extra space after punctuation.
+%
+\def\onword{on}
+\def\offword{off}
+%
+\parseargdef\frenchspacing{%
+ \def\temp{#1}%
+ \ifx\temp\onword \plainfrenchspacing
+ \else\ifx\temp\offword \plainnonfrenchspacing
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
+ \fi\fi
+}
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+% Another complication is that the group might be very large. This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material. In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom. The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
+\envdef\group{%
+ \ifnum\catcode`\^^M=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ \startsavinginserts
+ %
+ \setbox\groupbox = \vtop\bgroup
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% The \vtop produces a box with normal height and large depth; thus, TeX puts
+% \baselineskip glue before it, and (when the next line of text is done)
+% \lineskip glue after it. Thus, space below is not quite equal to space
+% above. But it's pretty close.
+\def\Egroup{%
+ % To get correct interline space between the last line of the group
+ % and the first line afterwards, we have to propagate \prevdepth.
+ \endgraf % Not \par, as it may have been set to \lisppar.
+ \global\dimen1 = \prevdepth
+ \egroup % End the \vtop.
+ % \dimen0 is the vertical size of the group's box.
+ \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
+ % \dimen2 is how much space is left on the page (more or less).
+ \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
+ % if the group doesn't fit on the current page, and it's a big big
+ % group, force a page break.
+ \ifdim \dimen0 > \dimen2
+ \ifdim \pagetotal < \vfilllimit\pageheight
+ \page
+ \fi
+ \fi
+ \box\groupbox
+ \prevdepth = \dimen1
+ \checkinserts
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+% Old definition--didn't work.
+%\parseargdef\need{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\prevdepth=-1000pt
+%}}
+
+\parseargdef\need{%
+ % Ensure vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
+}
+
+% @br forces paragraph break (and is undocumented).
+
+\let\br = \par
+
+% @page forces the start of a new page.
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
+
+% This defn is used inside nofill environments such as @example.
+\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
+ \leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph. For more general purposes, use the \margin insertion
+% class. WHICH is `l' or `r'.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+ \nobreak
+ \kern-\strutdepth
+ \vtop to \strutdepth{%
+ \baselineskip=\strutdepth
+ \vss
+ % if you have multiple lines of stuff to put here, you'll need to
+ % make the vbox yourself of the appropriate size.
+ \ifx#1l%
+ \llap{\ignorespaces #2\hskip\inmarginspacing}%
+ \else
+ \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+ \fi
+ \null
+ }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \def\lefttext{#1}% have both texts
+ \def\righttext{#2}%
+ \else
+ \def\lefttext{#1}% have only one text
+ \def\righttext{#1}%
+ \fi
+ %
+ \ifodd\pageno
+ \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+ \else
+ \def\temp{\inleftmargin\lefttext}%
+ \fi
+ \temp
+}
+
+% @include file insert text of that file as input.
+%
+\def\include{\parseargusing\filenamecatcodes\includezzz}
+\def\includezzz#1{%
+ \pushthisfilestack
+ \def\thisfile{#1}%
+ {%
+ \makevalueexpandable
+ \def\temp{\input #1 }%
+ \expandafter
+ }\temp
+ \popthisfilestack
+}
+\def\filenamecatcodes{%
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
+ \catcode`-=\other
+}
+
+\def\pushthisfilestack{%
+ \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
+}
+\def\pushthisfilestackX{%
+ \expandafter\pushthisfilestackY\thisfile\StackTerm
+}
+\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
+ \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
+}
+
+\def\popthisfilestack{\errthisfilestackempty}
+\def\errthisfilestackempty{\errmessage{Internal error:
+ the stack of filenames is empty.}}
+
+\def\thisfile{}
+
+% @center line
+% outputs that line, centered.
+%
+\parseargdef\center{%
+ \ifhmode
+ \let\next\centerH
+ \else
+ \let\next\centerV
+ \fi
+ \next{\hfil \ignorespaces#1\unskip \hfil}%
+}
+\def\centerH#1{%
+ {%
+ \hfil\break
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{#1}%
+ \break
+ }%
+}
+\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
+
+% @sp n outputs n lines of vertical space
+
+\parseargdef\sp{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\parseargdef\paragraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
+ \fi
+ \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\parseargdef\exampleindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
+ \fi
+}
+
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading. If WORD is `insert', then do indent at such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do.
+% We switch the definition of this back and forth according to WORD.
+% By default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\def\insertword{insert}
+%
+\parseargdef\firstparagraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\noneword
+ \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+ \else\ifx\temp\insertword
+ \let\suppressfirstparagraphindent = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @firstparagraphindent option `\temp'}%
+ \fi\fi
+}
+
+% Here is how we actually suppress indentation. Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+ \gdef\indent{%
+ \restorefirstparagraphindent
+ \indent
+ }%
+ \gdef\noindent{%
+ \restorefirstparagraphindent
+ \noindent
+ }%
+ \global\everypar = {%
+ \kern -\parindent
+ \restorefirstparagraphindent
+ }%
+}
+
+\gdef\restorefirstparagraphindent{%
+ \global \let \indent = \ptexindent
+ \global \let \noindent = \ptexnoindent
+ \global \everypar = {}%
+}
+
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}. So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+ \catcode\underChar = \active
+ \gdef\mathunderscore{%
+ \catcode\underChar=\active
+ \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+ }
+}
+% Another complication: we want \\ (and @\) to output a \ character.
+% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
+% this is not advertised and we don't care. Texinfo does not
+% otherwise define @\.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+ \tex
+ \mathunderscore
+ \let\\ = \mathbackslash
+ \mathactive
+ $\finishmath
+}
+\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+ \catcode`^ = \active
+ \catcode`< = \active
+ \catcode`> = \active
+ \catcode`+ = \active
+ \gdef\mathactive{%
+ \let^ = \ptexhat
+ \let< = \ptexless
+ \let> = \ptexgtr
+ \let+ = \ptexplus
+ }
+}
+
+% @bullet and @minus need the same treatment as @math, just above.
+\def\bullet{$\ptexbullet$}
+\def\minus{$-$}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+ \leavevmode
+ \hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil
+ .\hfil.\hfil.%
+ \hskip 0pt plus 0.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \dots
+ \spacefactor=\endofsentencespacefactor
+}
+
+% @comma{} is so commas can be inserted into text without messing up
+% Texinfo's parsing.
+%
+\let\comma = ,
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \iflinks
+ \tryauxfile
+ % Open the new aux file. TeX will close it automatically at exit.
+ \immediate\openout\auxfile=\jobname.aux
+ \fi % \openindices needs to do some work in any case.
+ \openindices
+ \let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ \openin 1 texinfo.cnf
+ \ifeof 1 \else \input texinfo.cnf \fi
+ \closein 1
+ %
+ \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
+% can be set). So we test for \relax and 0 as well as \undefined,
+% borrowed from ifpdf.sty.
+\ifx\pdfoutput\undefined
+\else
+ \ifx\pdfoutput\relax
+ \else
+ \ifcase\pdfoutput
+ \else
+ \pdftrue
+ \fi
+ \fi
+\fi
+
+% PDF uses PostScript string constants for the names of xref targets, to
+% for display in the outlines, and in other places. Thus, we have to
+% double any backslashes. Otherwise, a name like "\node" will be
+% interpreted as a newline (\n), followed by o, d, e. Not good.
+% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
+% (and related messages, the final outcome is that it is up to the TeX
+% user to double the backslashes and otherwise make the string valid, so
+% that's we do).
+
+% double active backslashes.
+%
+{\catcode`\@=0 \catcode`\\=\active
+ @gdef@activebackslash{@catcode`@\=@active @otherbackslash}
+ @gdef@activebackslashdouble{%
+ @catcode@backChar=@active
+ @let\=@doublebackslash}
+}
+
+% To handle parens, we must adopt a different approach, since parens are
+% not active characters. hyperref.dtx (which has the same problem as
+% us) handles it with this amazing macro to replace tokens. I've
+% tinkered with it a little for texinfo, but it's definitely from there.
+%
+% #1 is the tokens to replace.
+% #2 is the replacement.
+% #3 is the control sequence with the string.
+%
+\def\HyPsdSubst#1#2#3{%
+ \def\HyPsdReplace##1#1##2\END{%
+ ##1%
+ \ifx\\##2\\%
+ \else
+ #2%
+ \HyReturnAfterFi{%
+ \HyPsdReplace##2\END
+ }%
+ \fi
+ }%
+ \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
+}
+\long\def\HyReturnAfterFi#1\fi{\fi#1}
+
+% #1 is a control sequence in which to do the replacements.
+\def\backslashparens#1{%
+ \xdef#1{#1}% redefine it as its expansion; the definition is simply
+ % \lastnode when called from \setref -> \pdfmkdest.
+ \HyPsdSubst{(}{\backslashlparen}{#1}%
+ \HyPsdSubst{)}{\backslashrparen}{#1}%
+}
+
+{\catcode\exclamChar = 0 \catcode\backChar = \other
+ !gdef!backslashlparen{\(}%
+ !gdef!backslashrparen{\)}%
+}
+
+\ifpdf
+ \input pdfcolor
+ \pdfcatalog{/PageMode /UseOutlines}%
+ \def\dopdfimage#1#2#3{%
+ \def\imagewidth{#2}%
+ \def\imageheight{#3}%
+ % without \immediate, pdftex seg faults when the same image is
+ % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
+ \ifnum\pdftexversion < 14
+ \immediate\pdfimage
+ \else
+ \immediate\pdfximage
+ \fi
+ \ifx\empty\imagewidth\else width \imagewidth \fi
+ \ifx\empty\imageheight\else height \imageheight \fi
+ \ifnum\pdftexversion<13
+ #1.pdf%
+ \else
+ {#1.pdf}%
+ \fi
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ \def\pdfmkdest#1{{%
+ % We have to set dummies so commands such as @code, and characters
+ % such as \, aren't expanded when present in a section title.
+ \atdummies
+ \activebackslashdouble
+ \def\pdfdestname{#1}%
+ \backslashparens\pdfdestname
+ \pdfdest name{\pdfdestname} xyz%
+ }}%
+ %
+ % used to mark target names; must be expandable.
+ \def\pdfmkpgn#1{#1}%
+ %
+ \let\linkcolor = \Blue % was Cyan, but that seems light?
+ \def\endlink{\Black\pdfendlink}
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by 1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ %
+ % #1 is the section text, which is what will be displayed in the
+ % outline by the pdf viewer. #2 is the pdf expression for the number
+ % of subentries (or empty, for subsubsections). #3 is the node text,
+ % which might be empty if this toc entry had no corresponding node.
+ % #4 is the page number
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ % Generate a link to the node text if that exists; else, use the
+ % page number. We could generate a destination for the section
+ % text in the case where a section has no node, but it doesn't
+ % seem worth the trouble, since most documents are normally structured.
+ \def\pdfoutlinedest{#3}%
+ \ifx\pdfoutlinedest\empty
+ \def\pdfoutlinedest{#4}%
+ \else
+ % Doubled backslashes in the name.
+ {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
+ \backslashparens\pdfoutlinedest}%
+ \fi
+ %
+ % Also double the backslashes in the display string.
+ {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
+ \backslashparens\pdfoutlinetext}%
+ %
+ \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ % Thanh's hack / proper braces in bookmarks
+ \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+ \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+ %
+ % Read toc silently, to get counts of subentries for \pdfoutline.
+ \def\numchapentry##1##2##3##4{%
+ \def\thischapnum{##2}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsecentry##1##2##3##4{%
+ \advancenumber{chap\thischapnum}%
+ \def\thissecnum{##2}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsubsecentry##1##2##3##4{%
+ \advancenumber{sec\thissecnum}%
+ \def\thissubsecnum{##2}%
+ }%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \advancenumber{subsec\thissubsecnum}%
+ }%
+ \def\thischapnum{0}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ %
+ % use \def rather than \let here because we redefine \chapentry et
+ % al. a second time, below.
+ \def\appentry{\numchapentry}%
+ \def\appsecentry{\numsecentry}%
+ \def\appsubsecentry{\numsubsecentry}%
+ \def\appsubsubsecentry{\numsubsubsecentry}%
+ \def\unnchapentry{\numchapentry}%
+ \def\unnsecentry{\numsecentry}%
+ \def\unnsubsecentry{\numsubsecentry}%
+ \def\unnsubsubsecentry{\numsubsubsecentry}%
+ \readdatafile{toc}%
+ %
+ % Read toc second time, this time actually producing the outlines.
+ % The `-' means take the \expnumber as the absolute number of
+ % subentries, which we calculated on our first read of the .toc above.
+ %
+ % We use the node names as the destinations.
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{% count is always zero
+ \dopdfoutline{##1}{}{##3}{##4}}%
+ %
+ % PDF outlines are displayed using system fonts, instead of
+ % document fonts. Therefore we cannot use special characters,
+ % since the encoding is unknown. For example, the eogonek from
+ % Latin 2 (0xea) gets translated to a | character. Info from
+ % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
+ %
+ % xx to do this right, we have to translate 8-bit characters to
+ % their "best" equivalent, based on the @documentencoding. Right
+ % now, I guess we'll just let the pdf reader have its way.
+ \indexnofonts
+ \setupdatafile
+ \activebackslash
+ \input \jobname.toc
+ \endgroup
+ }
+ %
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \ifx\p\space\else\addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \fi
+ \nextsp}
+ \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ \def\pdfurl#1{%
+ \begingroup
+ \normalturnoffactive\def\@{@}%
+ \makevalueexpandable
+ \leavevmode\Red
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+ \linkcolor #1\endlink}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\else
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\linkcolor = \relax
+ \let\pdfmakeoutlines = \relax
+\fi % \ifx\pdfoutput
+
+
+\message{fonts,}
+
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+ \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+ \csname ten#1\endcsname % change the current font
+}
+
+% Select #1 fonts with the current style.
+%
+\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf.
+\newfam\sffam
+\def\sf{\fam=\sffam \setfontstyle{sf}}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
+
+% Default leading.
+\newdimen\textleading \textleading = 13.2pt
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+\def\setleading#1{%
+ \normalbaselineskip = #1\relax
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor
+\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+% Text fonts (11.2pt, magstep1).
+\def\textnominalsize{11pt}
+\edef\mainmagstep{\magstephalf}
+\setfont\textrm\rmshape{10}{\mainmagstep}
+\setfont\texttt\ttshape{10}{\mainmagstep}
+\setfont\textbf\bfshape{10}{\mainmagstep}
+\setfont\textit\itshape{10}{\mainmagstep}
+\setfont\textsl\slshape{10}{\mainmagstep}
+\setfont\textsf\sfshape{10}{\mainmagstep}
+\setfont\textsc\scshape{10}{\mainmagstep}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstep1}
+\setfont\deftt\ttshape{10}{\magstep1}
+\setfont\defttsl\ttslshape{10}{\magstep1}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}
+\setfont\smalltt\ttshape{9}{1000}
+\setfont\smallbf\bfshape{10}{900}
+\setfont\smallit\itshape{9}{1000}
+\setfont\smallsl\slshape{9}{1000}
+\setfont\smallsf\sfshape{9}{1000}
+\setfont\smallsc\scshape{10}{900}
+\setfont\smallttsl\ttslshape{10}{900}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}
+\setfont\smallertt\ttshape{8}{1000}
+\setfont\smallerbf\bfshape{10}{800}
+\setfont\smallerit\itshape{8}{1000}
+\setfont\smallersl\slshape{8}{1000}
+\setfont\smallersf\sfshape{8}{1000}
+\setfont\smallersc\scshape{10}{800}
+\setfont\smallerttsl\ttslshape{10}{800}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\setfont\titleit\itbshape{10}{\magstep4}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+\def\authortt{\sectt}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\def\chapnominalsize{17pt}
+\setfont\chaprm\rmbshape{12}{\magstep2}
+\setfont\chapit\itbshape{10}{\magstep3}
+\setfont\chapsl\slbshape{10}{\magstep3}
+\setfont\chaptt\ttbshape{12}{\magstep2}
+\setfont\chapttsl\ttslshape{10}{\magstep3}
+\setfont\chapsf\sfbshape{17}{1000}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+
+% Section fonts (14.4pt).
+\def\secnominalsize{14pt}
+\setfont\secrm\rmbshape{12}{\magstep1}
+\setfont\secit\itbshape{10}{\magstep2}
+\setfont\secsl\slbshape{10}{\magstep2}
+\setfont\sectt\ttbshape{12}{\magstep1}
+\setfont\secttsl\ttslshape{10}{\magstep2}
+\setfont\secsf\sfbshape{12}{\magstep1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+
+% Subsection fonts (13.15pt).
+\def\ssecnominalsize{13pt}
+\setfont\ssecrm\rmbshape{12}{\magstephalf}
+\setfont\ssecit\itbshape{10}{1315}
+\setfont\ssecsl\slbshape{10}{1315}
+\setfont\ssectt\ttbshape{12}{\magstephalf}
+\setfont\ssecttsl\ttslshape{10}{1315}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1315}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+
+% Reduced fonts for @acro in text (10pt).
+\def\reducednominalsize{10pt}
+\setfont\reducedrm\rmshape{10}{1000}
+\setfont\reducedtt\ttshape{10}{1000}
+\setfont\reducedbf\bfshape{10}{1000}
+\setfont\reducedit\itshape{10}{1000}
+\setfont\reducedsl\slshape{10}{1000}
+\setfont\reducedsf\sfshape{10}{1000}
+\setfont\reducedsc\scshape{10}{1000}
+\setfont\reducedttsl\ttslshape{10}{1000}
+\font\reducedi=cmmi10
+\font\reducedsy=cmsy10
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts except
+% in the main text, we don't bother to reset \scriptfont and
+% \scriptscriptfont (which would also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
+ \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
+ \textfont\ttfam=\tentt \textfont\sffam=\tensf
+}
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this because \STYLE needs to also set the
+% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
+% \tenSTYLE to set the current font.
+%
+% Each font-changing command also sets the names \lsize (one size lower)
+% and \lllsize (three sizes lower). These relative commands are used in
+% the LaTeX logo and acronyms.
+%
+% This all needs generalizing, badly.
+%
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
+ \let\tenttsl=\textttsl
+ \def\curfontsize{text}%
+ \def\lsize{reduced}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{\textleading}}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \def\curfontsize{title}%
+ \def\lsize{chap}\def\lllsize{subsec}%
+ \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
+ \let\tenttsl=\chapttsl
+ \def\curfontsize{chap}%
+ \def\lsize{sec}\def\lllsize{text}%
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
+ \let\tenttsl=\secttsl
+ \def\curfontsize{sec}%
+ \def\lsize{subsec}\def\lllsize{reduced}%
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
+ \let\tenttsl=\ssecttsl
+ \def\curfontsize{ssec}%
+ \def\lsize{text}\def\lllsize{small}%
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts
+\def\reducedfonts{%
+ \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
+ \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
+ \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
+ \let\tenttsl=\reducedttsl
+ \def\curfontsize{reduced}%
+ \def\lsize{small}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \def\curfontsize{small}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallerfonts{%
+ \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
+ \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
+ \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
+ \let\tenttsl=\smallerttsl
+ \def\curfontsize{smaller}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{9.5pt}}
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+% 8.5x11=86 smallbook=72 a4=90 a5=69
+% If we use \scriptfonts (8pt), then we can fit this many characters:
+% 8.5x11=90+ smallbook=80 a4=90+ a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt. So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+% 8.5x11=71 smallbook=60 a4=75 a5=58
+%
+% I wish the USA used A4 paper.
+% --karl, 24jan03.
+
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\textfonts \rm
+
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}
+\setfont\shortcontbf\bfshape{10}{\magstep1} % no cmb12
+\setfont\shortcontsl\slshape{12}{1000}
+\setfont\shortconttt\ttshape{12}{1000}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
+ \ptexslash\fi\fi\fi}
+\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
+
+% like \smartslanted except unconditionally uses \ttsl.
+% @var is set to this for defun arguments.
+\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
+
+% like \smartslanted except unconditionally use \sl. We never want
+% ttsl for book titles, do we?
+\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\slanted=\smartslanted
+\let\var=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+
+% @b, explicit bold.
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% @sansserif, explicit sans.
+\def\sansserif#1{{\sf #1}}
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+ \def\plainfrenchspacing{%
+ \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
+ \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
+ \def\endofsentencespacefactor{1000}% for @. and friends
+ }
+ \def\plainnonfrenchspacing{%
+ \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
+ \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
+ \def\endofsentencespacefactor{3000}% for @. and friends
+ }
+\catcode`@=\other
+\def\endofsentencespacefactor{3000}% default
+
+\def\t#1{%
+ {\tt \rawbackslash \plainfrenchspacing #1}%
+ \null
+}
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\keyrm\rmshape{8}{1000}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+ \vbox{\hrule\kern-0.4pt
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+ \kern-0.4pt\hrule}%
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @file, @option are the same as @samp.
+\let\file=\samp
+\let\option=\samp
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \plainfrenchspacing
+ #1%
+ }%
+ \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in @code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+% -- rms.
+{
+ \catcode`\-=\active
+ \catcode`\_=\active
+ %
+ \global\def\code{\begingroup
+ \catcode`\-=\active \catcode`\_=\active
+ \ifallowcodebreaks
+ \let-\codedash
+ \let_\codeunder
+ \else
+ \let-\realdash
+ \let_\realunder
+ \fi
+ \codex
+ }
+}
+
+\def\realdash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{%
+ % this is all so @math{@code{var_name}+1} can work. In math mode, _
+ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
+ % will therefore expand the active definition of _, which is us
+ % (inside @code that is), therefore an endless loop.
+ \ifusingtt{\ifmmode
+ \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
+ \else\normalunderscore \fi
+ \discretionary{}{}{}}%
+ {\_}%
+}
+\def\codex #1{\tclose{#1}\endgroup}
+
+% An additional complication: the above will allow breaks after, e.g.,
+% each of the four underscores in __typeof__. This is undesirable in
+% some manuals, especially if they don't have long identifiers in
+% general. @allowcodebreaks provides a way to control this.
+%
+\newif\ifallowcodebreaks \allowcodebreakstrue
+
+\def\keywordtrue{true}
+\def\keywordfalse{false}
+
+\parseargdef\allowcodebreaks{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\keywordtrue
+ \allowcodebreakstrue
+ \else\ifx\txiarg\keywordfalse
+ \allowcodebreaksfalse
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
+ \fi\fi
+}
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\txiarg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\txiarg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct.'
+\kbdinputstyle distinct
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
+\let\indicateurl=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url. Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% @url synonym for @uref, since that's how everyone uses it.
+%
+\let\url=\uref
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @acronym for "FBI", "NATO", and the like.
+% We print this one point size smaller, since it's intended for
+% all-uppercase.
+%
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+ {\selectfonts\lsize #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+}
+
+% @abbr for "Comput. J." and the like.
+% No font change, but don't do end-of-sentence spacing.
+%
+\def\abbr#1{\doabbr #1,,\finish}
+\def\doabbr#1,#2,#3\finish{%
+ {\plainfrenchspacing #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+}
+
+% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
+%
+\def\pounds{{\it\$}}
+
+% @euro{} comes from a separate font, depending on the current style.
+% We use the free feym* fonts from the eurosym package by Henrik
+% Theiling, which support regular, slanted, bold and bold slanted (and
+% "outlined" (blackboard board, sort of) versions, which we don't need).
+% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
+%
+% Although only regular is the truly official Euro symbol, we ignore
+% that. The Euro is designed to be slightly taller than the regular
+% font height.
+%
+% feymr - regular
+% feymo - slanted
+% feybr - bold
+% feybo - bold slanted
+%
+% There is no good (free) typewriter version, to my knowledge.
+% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
+% Hmm.
+%
+% Also doesn't work in math. Do we need to do math with euro symbols?
+% Hope not.
+%
+%
+\def\euro{{\eurofont e}}
+\def\eurofont{%
+ % We set the font at each command, rather than predefining it in
+ % \textfonts and the other font-switching commands, so that
+ % installations which never need the symbol don't have to have the
+ % font installed.
+ %
+ % There is only one designed size (nominal 10pt), so we always scale
+ % that to the current nominal size.
+ %
+ % By the way, simply using "at 1em" works for cmr10 and the like, but
+ % does not work for cmbx10 and other extended/shrunken fonts.
+ %
+ \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
+ %
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
+ \else
+ % regular:
+ \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
+ \fi
+ \thiseurofont
+}
+
+% @registeredsymbol - R in a circle. The font for the R should really
+% be smaller yet, but lllsize is the best we can do for now.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+ \hfil\crcr\Orb}}%
+ }$%
+}
+
+% Laurent Siebenmann reports \Orb undefined with:
+% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
+% so we'll define it if necessary.
+%
+\ifx\Orb\undefined
+\def\Orb{\mathhexbox20D}
+\fi
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\envdef\titlepage{%
+ % Open one extra group, as we want to close it in the middle of \Etitlepage.
+ \begingroup
+ \parindent=0pt \textfonts
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \let\page = \oldpage
+ \page
+ \null
+ }%
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % Need this before the \...aftertitlepage checks so that if they are
+ % in effect the toc pages will come out with page numbers.
+ \HEADINGSon
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+%%% Macros to be used within @titlepage:
+
+\let\subtitlerm=\tenrm
+\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
+
+\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
+ \let\tt=\authortt}
+
+\parseargdef\title{%
+ \checkenv\titlepage
+ \leftline{\titlefonts\rm #1}
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt
+}
+
+\parseargdef\subtitle{%
+ \checkenv\titlepage
+ {\subtitlefont \rightline{#1}}%
+}
+
+% @author should come last, but may come many times.
+% It can also be used inside @quotation.
+%
+\parseargdef\author{%
+ \def\temp{\quotation}%
+ \ifx\thisenv\temp
+ \def\quotationauthor{#1}% printed in \Equotation.
+ \else
+ \checkenv\titlepage
+ \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
+ {\authorfont \leftline{#1}}%
+ \fi
+}
+
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make TeX use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
+\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
+\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
+\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
+\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -\baselineskip
+ \global\advance\vsize by -\baselineskip
+}
+
+\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{%
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\undefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg{\gdef\thistitle}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemindicate{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. However, if
+ % what follows is an environment such as @example, there will be no
+ % \parskip glue; then the negative vskip we just inserted would
+ % cause the example and the item to crash together. So we use this
+ % bizarre value of 10001 as a signal to \aboveenvbreak to insert
+ % \parskip glue after all. Section titles are handled this way also.
+ %
+ \penalty 10001
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a list environment}}
+\def\itemx{\errmessage{@itemx while not in a list environment}}
+
+% @table, @ftable, @vtable.
+\envdef\table{%
+ \let\itemindex\gobble
+ \tablecheck{table}%
+}
+\envdef\ftable{%
+ \def\itemindex ##1{\doind {fn}{\code{##1}}}%
+ \tablecheck{ftable}%
+}
+\envdef\vtable{%
+ \def\itemindex ##1{\doind {vr}{\code{##1}}}%
+ \tablecheck{vtable}%
+}
+\def\tablecheck#1{%
+ \ifnum \the\catcode`\^^M=\active
+ \endgroup
+ \errmessage{This command won't work in this context; perhaps the problem is
+ that we are \inenvironment\thisenv}%
+ \def\next{\doignore{#1}}%
+ \else
+ \let\next\tablex
+ \fi
+ \next
+}
+\def\tablex#1{%
+ \def\itemindicate{#1}%
+ \parsearg\tabley
+}
+\def\tabley#1{%
+ {%
+ \makevalueexpandable
+ \edef\temp{\noexpand\tablez #1\space\space\space}%
+ \expandafter
+ }\temp \endtablez
+}
+\def\tablez #1 #2 #3 #4\endtablez{%
+ \aboveenvbreak
+ \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
+ \ifnum 0#2>0 \tableindent=#2\mil \fi
+ \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
+ \itemmax=\tableindent
+ \advance \itemmax by -\itemmargin
+ \advance \leftskip by \tableindent
+ \exdentamount=\tableindent
+ \parindent = 0pt
+ \parskip = \smallskipamount
+ \ifdim \parskip=0pt \parskip=2pt \fi
+ \let\item = \internalBitem
+ \let\itemx = \internalBitemx
+}
+\def\Etable{\endgraf\afterenvbreak}
+\let\Eftable\Etable
+\let\Evtable\Etable
+\let\Eitemize\Etable
+\let\Eenumerate\Etable
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\envdef\itemize{\parsearg\doitemize}
+
+\def\doitemize#1{%
+ \aboveenvbreak
+ \itemmax=\itemindent
+ \advance\itemmax by -\itemmargin
+ \advance\leftskip by \itemindent
+ \exdentamount=\itemindent
+ \parindent=0pt
+ \parskip=\smallskipamount
+ \ifdim\parskip=0pt \parskip=2pt \fi
+ \def\itemcontents{#1}%
+ % @itemize with no arg is equivalent to @itemize @bullet.
+ \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+ \let\item=\itemizeitem
+}
+
+% Definition of @item while inside @itemize and @enumerate.
+%
+\def\itemizeitem{%
+ \advance\itemno by 1 % for enumerations
+ {\let\par=\endgraf \smallbreak}% reasonable place to break
+ {%
+ % If the document has an @itemize directly after a section title, a
+ % \nobreak will be last on the list, and \sectionheading will have
+ % done a \vskip-\parskip. In that case, we don't want to zero
+ % parskip, or the item text will crash with the heading. On the
+ % other hand, when there is normal text preceding the item (as there
+ % usually is), we do want to zero parskip, or there would be too much
+ % space. In that case, we won't have a \nobreak before. At least
+ % that's the theory.
+ \ifnum\lastpenalty<10000 \parskip=0in \fi
+ \noindent
+ \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+ \vadjust{\penalty 1200}}% not good to break after first line of item.
+ \flushcr
+}
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call \doitemize, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \doitemize{#1.}\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab do not need to be on their own lines, but it will not hurt
+% if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the @columnfraction, usually a decimal number like .5, but might
+% be just 1. We just use it, whatever it is.
+%
+\def\pickupwholefraction#1 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
+ \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
+ \else
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+ % separator; typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
+ \fi%
+ \fi
+ \go
+}
+
+% multitable-only commands.
+%
+% @headitem starts a heading row, which we typeset in bold.
+% Assignments have to be global since we are inside the implicit group
+% of an alignment entry. Note that \everycr resets \everytab.
+\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}%
+%
+% A \tab used to include \hskip1sp. But then the space in a template
+% line is not enough. That is bad. So let's go back to just `&' until
+% we encounter the problem it was intended to solve again.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{\checkenv\multitable &\the\everytab}%
+
+% @multitable ... @end multitable definitions:
+%
+\newtoks\everytab % insert after every tab.
+%
+\envdef\multitable{%
+ \vskip\parskip
+ \startsavinginserts
+ %
+ % @item within a multitable starts a normal row.
+ % We use \def instead of \let so that if one of the multitable entries
+ % contains an @itemize, we don't choke on the \item (seen as \crcr aka
+ % \endtemplate) expanding \doitemize.
+ \def\item{\crcr}%
+ %
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ %
+ \everycr = {%
+ \noalign{%
+ \global\everytab={}%
+ \global\colcount=0 % Reset the column counter.
+ % Check for saved footnotes, etc.
+ \checkinserts
+ % Keeps underfull box messages off when table breaks over pages.
+ %\filbreak
+ % Maybe so, but it also creates really weird page breaks when the
+ % table breaks over pages. Wouldn't \vfil be better? Wait until the
+ % problem manifests itself, so it can be fixed for real --karl.
+ }%
+ }%
+ %
+ \parsearg\domultitable
+}
+\def\domultitable#1{%
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup &%
+ \global\advance\colcount by 1
+ \multistrut
+ \vtop{%
+ % Use the current \colcount to find the correct column width:
+ \hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively
+ % marking characters.
+ \noindent\ignorespaces##\unskip\multistrut
+ }\cr
+}
+\def\Emultitable{%
+ \crcr
+ \egroup % end the \halign
+ \global\setpercentfalse
+}
+
+\def\setmultitablespacing{%
+ \def\multistrut{\strut}% just use the standard line spacing
+ %
+ % Compute \multitablelinespace (if not defined by user) for use in
+ % \multitableparskip calculation. We used define \multistrut based on
+ % this, but (ironically) that caused the spacing to be off.
+ % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+\fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+
+% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
+% @ifnotxml always succeed. They currently do nothing; we don't
+% attempt to check whether the conditionals are properly nested. But we
+% have to remember that they are conditionals, so that @end doesn't
+% attempt to close an environment group.
+%
+\def\makecond#1{%
+ \expandafter\let\csname #1\endcsname = \relax
+ \expandafter\let\csname iscond.#1\endcsname = 1
+}
+\makecond{iftex}
+\makecond{ifnotdocbook}
+\makecond{ifnothtml}
+\makecond{ifnotinfo}
+\makecond{ifnotplaintext}
+\makecond{ifnotxml}
+
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
+%
+\def\direntry{\doignore{direntry}}
+\def\documentdescription{\doignore{documentdescription}}
+\def\docbook{\doignore{docbook}}
+\def\html{\doignore{html}}
+\def\ifdocbook{\doignore{ifdocbook}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
+\def\menu{\doignore{menu}}
+\def\xml{\doignore{xml}}
+
+% Ignore text until a line `@end #1', keeping track of nested conditionals.
+%
+% A count to remember the depth of nesting.
+\newcount\doignorecount
+
+\def\doignore#1{\begingroup
+ % Scan in ``verbatim'' mode:
+ \catcode`\@ = \other
+ \catcode`\{ = \other
+ \catcode`\} = \other
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \spaceisspace
+ %
+ % Count number of #1's that we've seen.
+ \doignorecount = 0
+ %
+ % Swallow text until we reach the matching `@end #1'.
+ \dodoignore{#1}%
+}
+
+{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
+ \obeylines %
+ %
+ \gdef\dodoignore#1{%
+ % #1 contains the command name as a string, e.g., `ifinfo'.
+ %
+ % Define a command to find the next `@end #1', which must be on a line
+ % by itself.
+ \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}%
+ % And this command to find another #1 command, at the beginning of a
+ % line. (Otherwise, we would consider a line `@c @ifset', for
+ % example, to count as an @ifset for nesting.)
+ \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
+ %
+ % And now expand that command.
+ \obeylines %
+ \doignoretext ^^M%
+ }%
+}
+
+\def\doignoreyyy#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty % Nothing found.
+ \let\next\doignoretextzzz
+ \else % Found a nested condition, ...
+ \advance\doignorecount by 1
+ \let\next\doignoretextyyy % ..., look for another.
+ % If we're here, #1 ends with ^^M\ifinfo (for example).
+ \fi
+ \next #1% the token \_STOP_ is present just after this macro.
+}
+
+% We have to swallow the remaining "\_STOP_".
+%
+\def\doignoretextzzz#1{%
+ \ifnum\doignorecount = 0 % We have just found the outermost @end.
+ \let\next\enddoignore
+ \else % Still inside a nested condition.
+ \advance\doignorecount by -1
+ \let\next\doignoretext % Look for the next @end.
+ \fi
+ \next
+}
+
+% Finish off ignored text.
+\def\enddoignore{\endgroup\ignorespaces}
+
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it.
+% We rely on the fact that \parsearg sets \catcode`\ =10.
+%
+\parseargdef\set{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ {%
+ \makevalueexpandable
+ \def\temp{#2}%
+ \edef\next{\gdef\makecsname{SET#1}}%
+ \ifx\temp\empty
+ \next{}%
+ \else
+ \setzzz#2\endsetzzz
+ \fi
+ }%
+}
+% Remove the trailing space \setxxx inserted.
+\def\setzzz#1 \endsetzzz{\next{#1}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\parseargdef\clear{%
+ {%
+ \makevalueexpandable
+ \global\expandafter\let\csname SET#1\endcsname=\relax
+ }%
+}
+
+% @value{foo} gets the text saved in variable foo.
+\def\value{\begingroup\makevalueexpandable\valuexxx}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+{
+ \catcode`\- = \active \catcode`\_ = \active
+ %
+ \gdef\makevalueexpandable{%
+ \let\value = \expandablevalue
+ % We don't want these characters active, ...
+ \catcode`\-=\other \catcode`\_=\other
+ % ..., but we might end up with active ones in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}, though.
+ % So \let them to their normal equivalents.
+ \let-\realdash \let_\normalunderscore
+ }
+}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we call \makevalueexpandable in \indexdummies).
+% The command has to be fully expandable (if the variable is set), since
+% the result winds up in the index file. This means that if the
+% variable's value contains other Texinfo commands, it's almost certain
+% it will fail (although perhaps we could fix that with sufficient work
+% to do a one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \message{Variable `#1', used in @value, is not set.}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+% To get special treatment of `@end ifset,' call \makeond and the redefine.
+%
+\makecond{ifset}
+\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
+\def\doifset#1#2{%
+ {%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname SET#2\endcsname\relax
+ #1% If not set, redefine \next.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifsetfail{\doignore{ifset}}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+% The `\else' inside the `\doifset' parameter is a trick to reuse the
+% above code: if the variable is not set, do nothing, if it is set,
+% then redefine \next to \ifclearfail.
+%
+\makecond{ifclear}
+\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
+\def\ifclearfail{\doignore{ifclear}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory=\comment
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within macros and \if's.
+\edef\newwrite{\makecsname{ptexnewwrite}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}%
+}
+
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+ % Only do \closeout if we haven't already done it, else we'll end up
+ % closing the target index.
+ \expandafter \ifx\csname donesynindex#2\endcsname \undefined
+ % The \closeout helps reduce unnecessary open files; the limit on the
+ % Acorn RISC OS is a mere 16 files.
+ \expandafter\closeout\csname#2indfile\endcsname
+ \expandafter\let\csname\donesynindex#2\endcsname = 1
+ \fi
+ % redefine \fooindfile:
+ \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+ \expandafter\let\csname#2indfile\endcsname=\temp
+ % redefine \fooindex:
+ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+% Take care of Texinfo commands that can appear in an index entry.
+% Since there are some commands we want to expand, and others we don't,
+% we have to laboriously prevent expansion for those that we don't.
+%
+\def\indexdummies{%
+ \escapechar = `\\ % use backslash in output files.
+ \def\@{@}% change to @@ when we switch to @ as escape char in index files.
+ \def\ {\realbackslash\space }%
+ % Need these in case \tex is in effect and \{ is a \delimiter again.
+ % But can't use \lbracecmd and \rbracecmd because texindex assumes
+ % braces and backslashes are used only as delimiters.
+ \let\{ = \mylbrace
+ \let\} = \myrbrace
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% For the aux and toc files, @ is the escape character. So we want to
+% redefine everything using @ as the escape character (instead of
+% \realbackslash, still used for index files). When everything uses @,
+% this will be simpler.
+%
+\def\atdummies{%
+ \def\@{@@}%
+ \def\ {@ }%
+ \let\{ = \lbraceatcmd
+ \let\} = \rbraceatcmd
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% Called from \indexdummies and \atdummies.
+%
+\def\commondummies{%
+ %
+ % \definedummyword defines \#1 as \string\#1\space, thus effectively
+ % preventing its expansion. This is used only for control% words,
+ % not control letters, because the \space would be incorrect for
+ % control characters, but is needed to separate the control word
+ % from whatever follows.
+ %
+ % For control letters, we have \definedummyletter, which omits the
+ % space.
+ %
+ % These can be used both for control words that take an argument and
+ % those that do not. If it is followed by {arg} in the input, then
+ % that will dutifully get written to the index (or wherever).
+ %
+ \def\definedummyword ##1{\def##1{\string##1\space}}%
+ \def\definedummyletter##1{\def##1{\string##1}}%
+ \let\definedummyaccent\definedummyletter
+ %
+ \commondummiesnofonts
+ %
+ \definedummyletter\_%
+ %
+ % Non-English letters.
+ \definedummyword\AA
+ \definedummyword\AE
+ \definedummyword\L
+ \definedummyword\OE
+ \definedummyword\O
+ \definedummyword\aa
+ \definedummyword\ae
+ \definedummyword\l
+ \definedummyword\oe
+ \definedummyword\o
+ \definedummyword\ss
+ \definedummyword\exclamdown
+ \definedummyword\questiondown
+ \definedummyword\ordf
+ \definedummyword\ordm
+ %
+ % Although these internal commands shouldn't show up, sometimes they do.
+ \definedummyword\bf
+ \definedummyword\gtr
+ \definedummyword\hat
+ \definedummyword\less
+ \definedummyword\sf
+ \definedummyword\sl
+ \definedummyword\tclose
+ \definedummyword\tt
+ %
+ \definedummyword\LaTeX
+ \definedummyword\TeX
+ %
+ % Assorted special characters.
+ \definedummyword\bullet
+ \definedummyword\comma
+ \definedummyword\copyright
+ \definedummyword\registeredsymbol
+ \definedummyword\dots
+ \definedummyword\enddots
+ \definedummyword\equiv
+ \definedummyword\error
+ \definedummyword\euro
+ \definedummyword\expansion
+ \definedummyword\minus
+ \definedummyword\pounds
+ \definedummyword\point
+ \definedummyword\print
+ \definedummyword\result
+ %
+ % We want to disable all macros so that they are not expanded by \write.
+ \macrolist
+ %
+ \normalturnoffactive
+ %
+ % Handle some cases of @value -- where it does not contain any
+ % (non-fully-expandable) commands.
+ \makevalueexpandable
+}
+
+% \commondummiesnofonts: common to \commondummies and \indexnofonts.
+%
+% Better have this without active chars.
+{
+ \catcode`\~=\other
+ \gdef\commondummiesnofonts{%
+ % Control letters and accents.
+ \definedummyletter\!%
+ \definedummyaccent\"%
+ \definedummyaccent\'%
+ \definedummyletter\*%
+ \definedummyaccent\,%
+ \definedummyletter\.%
+ \definedummyletter\/%
+ \definedummyletter\:%
+ \definedummyaccent\=%
+ \definedummyletter\?%
+ \definedummyaccent\^%
+ \definedummyaccent\`%
+ \definedummyaccent\~%
+ \definedummyword\u
+ \definedummyword\v
+ \definedummyword\H
+ \definedummyword\dotaccent
+ \definedummyword\ringaccent
+ \definedummyword\tieaccent
+ \definedummyword\ubaraccent
+ \definedummyword\udotaccent
+ \definedummyword\dotless
+ %
+ % Texinfo font commands.
+ \definedummyword\b
+ \definedummyword\i
+ \definedummyword\r
+ \definedummyword\sc
+ \definedummyword\t
+ %
+ % Commands that take arguments.
+ \definedummyword\acronym
+ \definedummyword\cite
+ \definedummyword\code
+ \definedummyword\command
+ \definedummyword\dfn
+ \definedummyword\emph
+ \definedummyword\env
+ \definedummyword\file
+ \definedummyword\kbd
+ \definedummyword\key
+ \definedummyword\math
+ \definedummyword\option
+ \definedummyword\samp
+ \definedummyword\strong
+ \definedummyword\tie
+ \definedummyword\uref
+ \definedummyword\url
+ \definedummyword\var
+ \definedummyword\verb
+ \definedummyword\w
+ }
+}
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names. It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
+\def\indexnofonts{%
+ % Accent commands should become @asis.
+ \def\definedummyaccent##1{\let##1\asis}%
+ % We can just ignore other control letters.
+ \def\definedummyletter##1{\let##1\empty}%
+ % Hopefully, all control words can become @asis.
+ \let\definedummyword\definedummyaccent
+ %
+ \commondummiesnofonts
+ %
+ % Don't no-op \tt, since it isn't a user-level command
+ % and is used in the definitions of the active chars like <, >, |, etc.
+ % Likewise with the other plain tex font commands.
+ %\let\tt=\asis
+ %
+ \def\ { }%
+ \def\@{@}%
+ % how to handle braces?
+ \def\_{\normalunderscore}%
+ %
+ % Non-English letters.
+ \def\AA{AA}%
+ \def\AE{AE}%
+ \def\L{L}%
+ \def\OE{OE}%
+ \def\O{O}%
+ \def\aa{aa}%
+ \def\ae{ae}%
+ \def\l{l}%
+ \def\oe{oe}%
+ \def\o{o}%
+ \def\ss{ss}%
+ \def\exclamdown{!}%
+ \def\questiondown{?}%
+ \def\ordf{a}%
+ \def\ordm{o}%
+ %
+ \def\LaTeX{LaTeX}%
+ \def\TeX{TeX}%
+ %
+ % Assorted special characters.
+ % (The following {} will end up in the sort string, but that's ok.)
+ \def\bullet{bullet}%
+ \def\comma{,}%
+ \def\copyright{copyright}%
+ \def\registeredsymbol{R}%
+ \def\dots{...}%
+ \def\enddots{...}%
+ \def\equiv{==}%
+ \def\error{error}%
+ \def\euro{euro}%
+ \def\expansion{==>}%
+ \def\minus{-}%
+ \def\pounds{pounds}%
+ \def\point{.}%
+ \def\print{-|}%
+ \def\result{=>}%
+ %
+ % We need to get rid of all macros, leaving only the arguments (if present).
+ % Of course this is not nearly correct, but it is the best we can do for now.
+ % makeinfo does not expand macros in the argument to @deffn, which ends up
+ % writing an index entry, and texindex isn't prepared for an index sort entry
+ % that starts with \.
+ %
+ % Since macro invocations are followed by braces, we can just redefine them
+ % to take a single TeX argument. The case of a macro invocation that
+ % goes to end-of-line is not handled.
+ %
+ \macrolist
+}
+
+\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% Most index entries go through here, but \dosubind is the general case.
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{\dosubind{#1}{#2}{}}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% empty if called from \doind, as we usually are (the main exception
+% is with most defuns, which call us directly).
+%
+\def\dosubind#1#2#3{%
+ \iflinks
+ {%
+ % Store the main index entry text (including the third arg).
+ \toks0 = {#2}%
+ % If third arg is present, precede it with a space.
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\empty \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ \edef\writeto{\csname#1indfile\endcsname}%
+ %
+ \ifvmode
+ \dosubindsanitize
+ \else
+ \dosubindwrite
+ \fi
+ }%
+ \fi
+}
+
+% Write the entry in \toks0 to the index file:
+%
+\def\dosubindwrite{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+ \fi
+ %
+ % Remember, we are within a group.
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ % Process the index entry with all font commands turned off, to
+ % get the string to sort by.
+ {\indexnofonts
+ \edef\temp{\the\toks0}% need full expansion
+ \xdef\indexsorttmp{\temp}%
+ }%
+ %
+ % Set up the complete index entry, with both the sort key and
+ % the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file (four in the
+ % subentry case), texindex reduces to two when writing the .??s
+ % sorted result.
+ \edef\temp{%
+ \write\writeto{%
+ \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
+ }%
+ \temp
+}
+
+% Take care of unwanted page breaks:
+%
+% If a skip is the last thing on the list now, preserve it
+% by backing up by \lastskip, doing the \write, then inserting
+% the skip again. Otherwise, the whatsit generated by the
+% \write will make \lastskip zero. The result is that sequences
+% like this:
+% @end defun
+% @tindex whatever
+% @defun ...
+% will have extra space inserted, because the \medbreak in the
+% start of the @defun won't see the skip inserted by the @end of
+% the previous defun.
+%
+% But don't do any of this if we're not in vertical mode. We
+% don't want to do a \vskip and prematurely end a paragraph.
+%
+% Avoid page breaks due to these extra skips, too.
+%
+% But wait, there is a catch there:
+% We'll have to check whether \lastskip is zero skip. \ifdim is not
+% sufficient for this purpose, as it ignores stretch and shrink parts
+% of the skip. The only way seems to be to check the textual
+% representation of the skip.
+%
+% The following is almost like \def\zeroskipmacro{0.0pt} except that
+% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
+%
+\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
+%
+% ..., ready, GO:
+%
+\def\dosubindsanitize{%
+ % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
+ \skip0 = \lastskip
+ \edef\lastskipmacro{\the\lastskip}%
+ \count255 = \lastpenalty
+ %
+ % If \lastskip is nonzero, that means the last item was a
+ % skip. And since a skip is discardable, that means this
+ % -\skip0 glue we're inserting is preceded by a
+ % non-discardable item, therefore it is not a potential
+ % breakpoint, therefore no \nobreak needed.
+ \ifx\lastskipmacro\zeroskipmacro
+ \else
+ \vskip-\skip0
+ \fi
+ %
+ \dosubindwrite
+ %
+ \ifx\lastskipmacro\zeroskipmacro
+ % If \lastskip was zero, perhaps the last item was a penalty, and
+ % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
+ % to re-insert the same penalty (values >10000 are used for various
+ % signals); since we just inserted a non-discardable item, any
+ % following glue (such as a \parskip) would be a breakpoint. For example:
+ %
+ % @deffn deffn-whatever
+ % @vindex index-whatever
+ % Description.
+ % would allow a break between the index-whatever whatsit
+ % and the "Description." paragraph.
+ \ifnum\count255>9999 \penalty\count255 \fi
+ \else
+ % On the other hand, if we had a nonzero \lastskip,
+ % this make-up glue would be preceded by a non-discardable item
+ % (the whatsit from the \write), so we must insert a \nobreak.
+ \nobreak\vskip\skip0
+ \fi
+}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\parseargdef\printindex{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \smallfonts \rm
+ \tolerance = 9500
+ \everypar = {}% don't want the \kern\-parindent from indentation suppression.
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ \putwordIndexNonexistent
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ \putwordIndexIsEmpty
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\backslashcurfont}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
+ \input \jobname.#1s
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \nobreak
+ \vskip 0pt plus 3\baselineskip
+ \penalty 0
+ \vskip 0pt plus -3\baselineskip
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ % Do our best not to break after the initial.
+ \nobreak
+ \vskip .33\baselineskip plus .1\baselineskip
+}}
+
+% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
+% then page number (#2) flushed to the right margin. It is used for index
+% and table of contents entries. The paragraph is indented by \leftskip.
+%
+% A straightforward implementation would start like this:
+% \def\entry#1#2{...
+% But this frozes the catcodes in the argument, and can cause problems to
+% @code, which sets - active. This problem was fixed by a kludge---
+% ``-'' was active throughout whole index, but this isn't really right.
+%
+% The right solution is to prevent \entry from swallowing the whole text.
+% --kasal, 21nov03
+\def\entry{%
+ \begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % A bit of stretch before each entry for the benefit of balancing
+ % columns.
+ \vskip 0pt plus1pt
+ %
+ % Swallow the left brace of the text (first parameter):
+ \afterassignment\doentry
+ \let\temp =
+}
+\def\doentry{%
+ \bgroup % Instead of the swallowed brace.
+ \noindent
+ \aftergroup\finishentry
+ % And now comes the text of the entry.
+}
+\def\finishentry#1{%
+ % #1 is the page number.
+ %
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \def\tempa{{\rm }}%
+ \def\tempb{#1}%
+ \edef\tempc{\tempa}%
+ \edef\tempd{\tempb}%
+ \ifx\tempc\tempd
+ \ %
+ \else
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ifpdf
+ \pdfgettoks#1.%
+ \ \the\toksA
+ \else
+ \ #1%
+ \fi
+ \fi
+ \par
+ \endgroup
+}
+
+% Like \dotfill except takes at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+\def\secondary#1#2{{%
+ \parfillskip=0in
+ \parskip=0in
+ \hangindent=1in
+ \hangafter=1
+ \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ #2
+ \fi
+ \par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ \advance\dimen@ by -\ht\partialpage
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
+}
+%
+% All done with double columns.
+\def\enddoublecolumns{%
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
+}
+%
+% Called at the end of the double column material.
+\def\balancecolumns{%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ %
+ \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+% \unnumberedno is an oxymoron, of course. But we count the unnumbered
+% sections so that we can refer to them unambiguously in the pdf
+% outlines by their "section number". We avoid collisions with chapter
+% numbers by starting them at 10000. (If a document ever has 10000
+% chapters, we're in trouble anyway, I'm sure.)
+\newcount\unnumberedno \unnumberedno = 10000
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+%
+% \def\appendixletter{\char\the\appendixno}
+% We do the following ugly conditional instead of the above simple
+% construct for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+%
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines this as the name of the chapter.
+% page headings and footings can use it. @section does likewise.
+% However, they are not reliable, because we don't use marks.
+\def\thischapter{}
+\def\thissection{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% we only have subsub.
+\chardef\maxseclevel = 3
+%
+% A numbered section within an unnumbered changes to unnumbered too.
+% To achive this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unmlevel = \maxseclevel
+%
+% Trace whether the current chapter is an appendix or not:
+% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
+\def\chapheadtype{N}
+
+% Choose a heading macro
+% #1 is heading type
+% #2 is heading level
+% #3 is text for heading
+\def\genhead#1#2#3{%
+ % Compute the abs. sec. level:
+ \absseclevel=#2
+ \advance\absseclevel by \secbase
+ % Make sure \absseclevel doesn't fall outside the range:
+ \ifnum \absseclevel < 0
+ \absseclevel = 0
+ \else
+ \ifnum \absseclevel > 3
+ \absseclevel = 3
+ \fi
+ \fi
+ % The heading type:
+ \def\headtype{#1}%
+ \if \headtype U%
+ \ifnum \absseclevel < \unmlevel
+ \chardef\unmlevel = \absseclevel
+ \fi
+ \else
+ % Check for appendix sections:
+ \ifnum \absseclevel = 0
+ \edef\chapheadtype{\headtype}%
+ \else
+ \if \headtype A\if \chapheadtype N%
+ \errmessage{@appendix... within a non-appendix chapter}%
+ \fi\fi
+ \fi
+ % Check for numbered within unnumbered:
+ \ifnum \absseclevel > \unmlevel
+ \def\headtype{U}%
+ \else
+ \chardef\unmlevel = 3
+ \fi
+ \fi
+ % Now print the heading:
+ \if \headtype U%
+ \ifcase\absseclevel
+ \unnumberedzzz{#3}%
+ \or \unnumberedseczzz{#3}%
+ \or \unnumberedsubseczzz{#3}%
+ \or \unnumberedsubsubseczzz{#3}%
+ \fi
+ \else
+ \if \headtype A%
+ \ifcase\absseclevel
+ \appendixzzz{#3}%
+ \or \appendixsectionzzz{#3}%
+ \or \appendixsubseczzz{#3}%
+ \or \appendixsubsubseczzz{#3}%
+ \fi
+ \else
+ \ifcase\absseclevel
+ \chapterzzz{#3}%
+ \or \seczzz{#3}%
+ \or \numberedsubseczzz{#3}%
+ \or \numberedsubsubseczzz{#3}%
+ \fi
+ \fi
+ \fi
+ \suppressfirstparagraphindent
+}
+
+% an interface:
+\def\numhead{\genhead N}
+\def\apphead{\genhead A}
+\def\unnmhead{\genhead U}
+
+% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
+% all lower-level sectioning counters to zero.
+%
+% Also set \chaplevelprefix, which we prepend to @float sequence numbers
+% (e.g., figures), q.v. By default (before any chapter), that is empty.
+\let\chaplevelprefix = \empty
+%
+\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz#1{%
+ % section resetting is \global in case the chapter is in a group, such
+ % as an @include file.
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\chapno by 1
+ %
+ % Used for \float.
+ \gdef\chaplevelprefix{\the\chapno.}%
+ \resetallfloatnos
+ %
+ \message{\putwordChapter\space \the\chapno}%
+ %
+ % Write the actual heading.
+ \chapmacro{#1}{Ynumbered}{\the\chapno}%
+ %
+ % So @section and the like are numbered underneath this chapter.
+ \global\let\section = \numberedsec
+ \global\let\subsection = \numberedsubsec
+ \global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\appendixno by 1
+ \gdef\chaplevelprefix{\appendixletter.}%
+ \resetallfloatnos
+ %
+ \def\appendixnum{\putwordAppendix\space \appendixletter}%
+ \message{\appendixnum}%
+ %
+ \chapmacro{#1}{Yappendix}{\appendixletter}%
+ %
+ \global\let\section = \appendixsec
+ \global\let\subsection = \appendixsubsec
+ \global\let\subsubsection = \appendixsubsubsec
+}
+
+\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\unnumberedno by 1
+ %
+ % Since an unnumbered has no number, no prefix for figures.
+ \global\let\chaplevelprefix = \empty
+ \resetallfloatnos
+ %
+ % This used to be simply \message{#1}, but TeX fully expands the
+ % argument to \message. Therefore, if #1 contained @-commands, TeX
+ % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+ % expanded @cite (which turns out to cause errors because \cite is meant
+ % to be executed, not expanded).
+ %
+ % Anyway, we don't want the fully-expanded definition of @cite to appear
+ % as a result of the \message, we just want `@cite' itself. We use
+ % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+ % simply yielding the contents of <toks register>. (We also do this for
+ % the toc entries.)
+ \toks0 = {#1}%
+ \message{(\the\toks0)}%
+ %
+ \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
+ %
+ \global\let\section = \unnumberedsec
+ \global\let\subsection = \unnumberedsubsec
+ \global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\parseargdef\centerchap{%
+ % Well, we could do the following in a group, but that would break
+ % an assumption that \chapmacro is called at the outermost level.
+ % Thus we are safer this way: --kasal, 24feb04
+ \let\centerparametersmaybe = \centerparameters
+ \unnmhead0{#1}%
+ \let\centerparametersmaybe = \relax
+}
+
+% @top is like @unnumbered.
+\let\top\unnumbered
+
+% Sections.
+\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
+\def\seczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
+}
+
+\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
+}
+\let\appendixsec\appendixsection
+
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
+}
+
+% Subsections.
+\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
+}
+
+\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno}%
+}
+
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno}%
+}
+
+% Subsubsections.
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynumbered}%
+ {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\let\section = \numberedsec
+\let\subsection = \numberedsubsec
+\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and such:
+% 1) We use \vbox rather than the earlier \line to permit
+% overlong headings to fold.
+% 2) \hyphenpenalty is set to 10000 because hyphenation in a
+% heading is obnoxious; this forbids it.
+% 3) Likewise, headings look best if no \parindent is used, and
+% if justification is not attempted. Hence \raggedright.
+
+
+\def\majorheading{%
+ {\advance\chapheadingskip by 10pt \chapbreak }%
+ \parsearg\chapheadingzzz
+}
+
+\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
+\def\chapheadingzzz#1{%
+ {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}%
+ \bigskip \par\penalty 200\relax
+ \suppressfirstparagraphindent
+}
+
+% @heading, @subheading, @subsubheading.
+\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{%
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+% Chapter opening.
+%
+% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
+% Yappendix, Yomitfromtoc), #3 the chapter number.
+%
+% To test against our argument.
+\def\Ynothingkeyword{Ynothing}
+\def\Yomitfromtockeyword{Yomitfromtoc}
+\def\Yappendixkeyword{Yappendix}
+%
+\def\chapmacro#1#2#3{%
+ \pchapsepmacro
+ {%
+ \chapfonts \rm
+ %
+ % Have to define \thissection before calling \donoderef, because the
+ % xref code eventually uses it. On the other hand, it has to be called
+ % after \pchapsepmacro, or the headline will change too soon.
+ \gdef\thissection{#1}%
+ \gdef\thischaptername{#1}%
+ %
+ % Only insert the separating space if we have a chapter/appendix
+ % number, and don't print the unnumbered ``number''.
+ \def\temptype{#2}%
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unnchap}%
+ \gdef\thischapter{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
+ \def\toctype{omit}%
+ \gdef\thischapter{}%
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
+ \def\toctype{app}%
+ % We don't substitute the actual chapter name into \thischapter
+ % because we don't want its macros evaluated now. And we don't
+ % use \thissection because that changes with each section.
+ %
+ \xdef\thischapter{\putwordAppendix{} \appendixletter:
+ \noexpand\thischaptername}%
+ \else
+ \setbox0 = \hbox{#3\enspace}%
+ \def\toctype{numchap}%
+ \xdef\thischapter{\putwordChapter{} \the\chapno:
+ \noexpand\thischaptername}%
+ \fi\fi\fi
+ %
+ % Write the toc entry for this chapter. Must come before the
+ % \donoderef, because we include the current node name in the toc
+ % entry, and \donoderef resets it to empty.
+ \writetocentry{\toctype}{#1}{#3}%
+ %
+ % For pdftex, we have to write out the node definition (aka, make
+ % the pdfdest) after any page break, but before the actual text has
+ % been typeset. If the destination for the pdf outline is after the
+ % text, then jumping from the outline may wind up with the text not
+ % being visible, for instance under high magnification.
+ \donoderef{#2}%
+ %
+ % Typeset the actual heading.
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent=\wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerparameters{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+}
+
+
+% I don't think this chapter style is supported any more, so I'm not
+% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
+%
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+%
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\nobreak
+}
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt
+ \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
+}
+\def\CHAPFopen{%
+ \global\let\chapmacro=\chfopen
+ \global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles. These macros combine the section number parts and
+% call the generic \sectionheading to do the printing.
+%
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
+
+% Subsection titles.
+\newskip\subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
+
+% Subsubsection titles.
+\def\subsubsecheadingskip{\subsecheadingskip}
+\def\subsubsecheadingbreak{\subsecheadingbreak}
+
+
+% Print any size, any type, section title.
+%
+% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
+% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
+% section number.
+%
+\def\sectionheading#1#2#3#4{%
+ {%
+ % Switch to the right set of fonts.
+ \csname #2fonts\endcsname \rm
+ %
+ % Insert space above the heading.
+ \csname #2headingbreak\endcsname
+ %
+ % Only insert the space after the number if we have a section number.
+ \def\sectionlevel{#2}%
+ \def\temptype{#3}%
+ %
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unn}%
+ \gdef\thissection{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ % for @headings -- no section number, don't include in toc,
+ % and don't redefine \thissection.
+ \setbox0 = \hbox{}%
+ \def\toctype{omit}%
+ \let\sectionlevel=\empty
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{app}%
+ \gdef\thissection{#1}%
+ \else
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{num}%
+ \gdef\thissection{#1}%
+ \fi\fi\fi
+ %
+ % Write the toc entry (before \donoderef). See comments in \chfplain.
+ \writetocentry{\toctype\sectionlevel}{#1}{#4}%
+ %
+ % Write the node reference (= pdf destination for pdftex).
+ % Again, see comments in \chfplain.
+ \donoderef{#3}%
+ %
+ % Output the actual section heading.
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent=\wd0 % zero if no section number
+ \unhbox0 #1}%
+ }%
+ % Add extra space after the heading -- half of whatever came above it.
+ % Don't allow stretch, though.
+ \kern .5 \csname #2headingskip\endcsname
+ %
+ % Do not let the kern be a potential breakpoint, as it would be if it
+ % was followed by glue.
+ \nobreak
+ %
+ % We'll almost certainly start a paragraph next, so don't let that
+ % glue accumulate. (Not a breakpoint because it's preceded by a
+ % discardable item.)
+ \vskip-\parskip
+ %
+ % This is purely so the last item on the list is a known \penalty >
+ % 10000. This is so \startdefun can avoid allowing breakpoints after
+ % section headings. Otherwise, it would insert a valid breakpoint between:
+ %
+ % @section sec-whatever
+ % @deffn def-whatever
+ \penalty 10001
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc.
+%
+% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
+% We append the current node name (if any) and page number as additional
+% arguments for the \{chap,sec,...}entry macros which will eventually
+% read this. The node name is used in the pdf outlines as the
+% destination to jump to.
+%
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
+% But if #1 is `omit', then we don't do anything. This is used for the
+% table of contents chapter openings themselves.
+%
+\newif\iftocfileopened
+\def\omitkeyword{omit}%
+%
+\def\writetocentry#1#2#3{%
+ \edef\writetoctype{#1}%
+ \ifx\writetoctype\omitkeyword \else
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ %
+ \iflinks
+ {\atdummies
+ \edef\temp{%
+ \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
+ \temp
+ }
+ \fi
+ \fi
+ %
+ % Tell \shipout to create a pdf destination on each page, if we're
+ % writing pdf. These are used in the table of contents. We can't
+ % just write one on every page because the title pages are numbered
+ % 1 and 2 (the page numbers aren't printed), and so are the first
+ % two pages of the document. Thus, we'd have two destinations named
+ % `1', and two named `2'.
+ \ifpdf \global\pdfmakepagedesttrue \fi
+}
+
+
+% These characters do not print properly in the Computer Modern roman
+% fonts, so we must take special care. This is more or less redundant
+% with the Texinfo input format setup at the end of this file.
+%
+\def\activecatcodes{%
+ \catcode`\"=\active
+ \catcode`\$=\active
+ \catcode`\<=\active
+ \catcode`\>=\active
+ \catcode`\\=\active
+ \catcode`\^=\active
+ \catcode`\_=\active
+ \catcode`\|=\active
+ \catcode`\~=\active
+}
+
+
+% Read the toc file, which is essentially Texinfo input.
+\def\readtocfile{%
+ \setupdatafile
+ \activecatcodes
+ \input \jobname.toc
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Prepare to read what we've written to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \def\thischapter{}%
+ \chapmacro{#1}{Yomitfromtoc}{}%
+ %
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+}
+
+
+% Normal (long) toc.
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \ifeof 1 \else
+ \pdfmakeoutlines
+ \fi
+ \closein 1
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\numchapentry = \shortchapentry
+ \let\appentry = \shortchapentry
+ \let\unnchapentry = \shortunnchapentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf
+ \let\sl=\shortcontsl \let\tt=\shortconttt
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\numsecentry##1##2##3##4{}
+ \let\appsecentry = \numsecentry
+ \let\unnsecentry = \numsecentry
+ \let\numsubsecentry = \numsecentry
+ \let\appsubsecentry = \numsecentry
+ \let\unnsubsecentry = \numsecentry
+ \let\numsubsubsecentry = \numsecentry
+ \let\appsubsubsecentry = \numsecentry
+ \let\unnsubsubsecentry = \numsecentry
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \closein 1
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
+%
+\def\shortchaplabel#1{%
+ % This space should be enough, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % But use \hss just in case.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ %
+ % We'd like to right-justify chapter numbers, but that looks strange
+ % with appendix letters. And right-justifying numbers and
+ % left-justifying letters looks strange when there is less than 10
+ % chapters. Have to read the whole toc once to know how many chapters
+ % there are before deciding ...
+ \hbox to 1em{#1\hss}%
+}
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapters, in the main contents.
+\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
+%
+% Chapters, in the short toc.
+% See comments in \dochapentry re vbox and related settings.
+\def\shortchapentry#1#2#3#4{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
+}
+
+% Appendices, in the main contents.
+% Need the word Appendix, and a fixed-size box.
+%
+\def\appendixbox#1{%
+ % We use M since it's probably the widest letter.
+ \setbox0 = \hbox{\putwordAppendix{} M}%
+ \hbox to \wd0{\putwordAppendix{} #1\hss}}
+%
+\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
+
+% Unnumbered chapters.
+\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
+
+% Sections.
+\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
+\let\appsecentry=\numsecentry
+\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
+
+% Subsections.
+\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsecentry=\numsubsecentry
+\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
+
+% And subsubsections.
+\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsubsecentry=\numsubsubsecentry
+\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
+
+% This parameter controls the indentation of the various levels.
+% Same as \defaultparindent.
+\newdimen\tocindent \tocindent = 15pt
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% We use the same \entry macro as for the index entries.
+\let\tocentry = \entry
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\def\subsecentryfonts{\textfonts}
+\def\subsubsecentryfonts{\textfonts}
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+%
+% Since these characters are used in examples, it should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+%
+\def\point{$\star$}
+\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% The @error{} command.
+% Adapted from the TeXbook's \boxit.
+%
+\newbox\errorbox
+%
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
+%
+\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{%
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+%
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\envdef\tex{%
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
+ \catcode `\%=14
+ \catcode `\+=\other
+ \catcode `\"=\other
+ \catcode `\|=\other
+ \catcode `\<=\other
+ \catcode `\>=\other
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\/=\ptexslash
+ \let\*=\ptexstar
+ \let\t=\ptext
+ \let\frenchspacing=\plainfrenchspacing
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+}
+% There is no need to define \Etex.
+
+% Define @lisp ... @end lisp.
+% @lisp environment forms a group so it can rebind things,
+% including the definition of @end lisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip.
+%
+\def\aboveenvbreak{{%
+ % =10000 instead of <10000 because of a special case in \itemzzz and
+ % \sectionheading, q.v.
+ \ifnum \lastpenalty=10000 \else
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ % it's not a good place to break if the last penalty was \nobreak
+ % or better ...
+ \ifnum\lastpenalty<10000 \penalty-50 \fi
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
+% also clear it, so that its embedded environments do the narrowing again.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\envdef\cartouche{%
+ \ifhmode\par\fi % can't be in the midst of a paragraph.
+ \startsavinginserts
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt % we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+ % side, and for 6pt waste from
+ % each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing = t%
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \kern3pt
+ \hsize=\cartinner
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+ \comment % For explanation, see the end of \def\group.
+}
+\def\Ecartouche{%
+ \ifhmode\par\fi
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+ \checkinserts
+}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+ \aboveenvbreak
+ \hfuzz = 12pt % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ \parindent = 0pt
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+ \let\exdent=\nofillexdent
+}
+
+% If you want all examples etc. small: @set dispenvsize small.
+% If you want even small examples the full size: @set dispenvsize nosmall.
+% This affects the following displayed environments:
+% @example, @display, @format, @lisp
+%
+\def\smallword{small}
+\def\nosmallword{nosmall}
+\let\SETdispenvsize\relax
+\def\setnormaldispenv{%
+ \ifx\SETdispenvsize\smallword
+ \smallexamplefonts \rm
+ \fi
+}
+\def\setsmalldispenv{%
+ \ifx\SETdispenvsize\nosmallword
+ \else
+ \smallexamplefonts \rm
+ \fi
+}
+
+% We often define two environments, @foo and @smallfoo.
+% Let's do it by one command:
+\def\makedispenv #1#2{
+ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
+ \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
+ \expandafter\let\csname E#1\endcsname \afterenvbreak
+ \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
+}
+
+% Define two synonyms:
+\def\maketwodispenvs #1#2#3{
+ \makedispenv{#1}{#3}
+ \makedispenv{#2}{#3}
+}
+
+% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
+%
+% @smallexample and @smalllisp: use smaller fonts.
+% Originally contributed by Pavel@xerox.
+%
+\maketwodispenvs {lisp}{example}{%
+ \nonfillstart
+ \tt
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+
+% @display/@smalldisplay: same as @lisp except keep current font.
+%
+\makedispenv {display}{%
+ \nonfillstart
+ \gobble
+}
+
+% @format/@smallformat: same as @display except don't narrow margins.
+%
+\makedispenv{format}{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+
+% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
+\envdef\flushleft{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+\let\Eflushleft = \afterenvbreak
+
+% @flushright.
+%
+\envdef\flushright{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \advance\leftskip by 0pt plus 1fill
+ \gobble
+}
+\let\Eflushright = \afterenvbreak
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins. We keep \parskip nonzero in general, since
+% we're doing normal filling. So, when using \aboveenvbreak and
+% \afterenvbreak, temporarily make \parskip 0.
+%
+\envdef\quotation{%
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \parindent=0pt
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \advance\rightskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+ \parsearg\quotationlabel
+}
+
+% We have retained a nonzero parskip for the environment, since we're
+% doing normal filling.
+%
+\def\Equotation{%
+ \par
+ \ifx\quotationauthor\undefined\else
+ % indent a bit.
+ \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
+ \fi
+ {\parskip=0pt \afterenvbreak}%
+}
+
+% If we're given an argument, typeset it in bold with a colon after.
+\def\quotationlabel#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty \else
+ {\bf #1: }%
+ \fi
+}
+
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
+%
+% [Knuth] p.344; only we need to do the other characters Texinfo sets
+% active too. Otherwise, they get lost as the first character on a
+% verbatim line.
+\def\dospecials{%
+ \do\ \do\\\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
+ \do\<\do\>\do\|\do\@\do+\do\"%
+}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1=\other}\dospecials}
+%
+% [Knuth] pp. 380,381,391
+% Disable Spanish ligatures ?` and !` of \tt font
+\begingroup
+ \catcode`\`=\active\gdef`{\relax\lq}
+\endgroup
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+ \tt % easiest (and conventionally used) font for verbatim
+ \def\par{\leavevmode\endgraf}%
+ \catcode`\`=\active
+ \tabeightspaces
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+\def\starttabbox{\setbox0=\hbox\bgroup}
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabexpand{%
+ \catcode`\^^I=\active
+ \def^^I{\leavevmode\egroup
+ \dimen0=\wd0 % the width so far, or since the previous tab
+ \divide\dimen0 by\tabw
+ \multiply\dimen0 by\tabw % compute previous multiple of \tabw
+ \advance\dimen0 by\tabw % advance to next multiple of \tabw
+ \wd0=\dimen0 \box0 \starttabbox
+ }%
+ }
+\endgroup
+\def\setupverbatim{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ % Easiest (and conventionally used) font for verbatim
+ \tt
+ \def\par{\leavevmode\egroup\box0\endgraf}%
+ \catcode`\`=\active
+ \tabexpand
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+ \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+% \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+ \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
+ \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+% \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'.
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%
+\begingroup
+ \catcode`\ =\active
+ \obeylines %
+ % ignore everything up to the first ^^M, that's the newline at the end
+ % of the @verbatim input line itself. Otherwise we get an extra blank
+ % line in the output.
+ \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+ % We really want {...\end verbatim} in the body of the macro, but
+ % without the active space; thus we have to use \xdef and \gobble.
+\endgroup
+%
+\envdef\verbatim{%
+ \setupverbatim\doverbatim
+}
+\let\Everbatim = \afterenvbreak
+
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
+%
+\def\doverbatiminclude#1{%
+ {%
+ \makevalueexpandable
+ \setupverbatim
+ \input #1
+ \afterenvbreak
+ }%
+}
+
+% @copying ... @end copying.
+% Save the text away for @insertcopying later.
+%
+% We save the uninterpreted tokens, rather than creating a box.
+% Saving the text in a box would be much easier, but then all the
+% typesetting commands (@smallbook, font changes, etc.) have to be done
+% beforehand -- and a) we want @copying to be done first in the source
+% file; b) letting users define the frontmatter in as flexible order as
+% possible is very desirable.
+%
+\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
+\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
+%
+\def\insertcopying{%
+ \begingroup
+ \parindent = 0pt % paragraph indentation looks wrong on title page
+ \scanexp\copyingtext
+ \endgroup
+}
+
+\message{defuns,}
+% @defun etc.
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+
+% Start the processing of @deffn:
+\def\startdefun{%
+ \ifnum\lastpenalty<10000
+ \medbreak
+ \else
+ % If there are two @def commands in a row, we'll have a \nobreak,
+ % which is there to keep the function description together with its
+ % header. But if there's nothing but headers, we need to allow a
+ % break somewhere. Check specifically for penalty 10002, inserted
+ % by \defargscommonending, instead of 10000, since the sectioning
+ % commands also insert a nobreak penalty, and we don't want to allow
+ % a break between a section heading and a defun.
+ %
+ \ifnum\lastpenalty=10002 \penalty2000 \fi
+ %
+ % Similarly, after a section heading, do not allow a break.
+ % But do insert the glue.
+ \medskip % preceded by discardable penalty, so not a breakpoint
+ \fi
+ %
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+}
+
+\def\dodefunx#1{%
+ % First, check whether we are in the right environment:
+ \checkenv#1%
+ %
+ % As above, allow line break if we have multiple x headers in a row.
+ % It's not a great place, though.
+ \ifnum\lastpenalty=10002 \penalty3000 \fi
+ %
+ % And now, it's time to reuse the body of the original defun:
+ \expandafter\gobbledefun#1%
+}
+\def\gobbledefun#1\startdefun{}
+
+% \printdefunline \deffnheader{text}
+%
+\def\printdefunline#1#2{%
+ \begingroup
+ % call \deffnheader:
+ #1#2 \endheader
+ % common ending:
+ \interlinepenalty = 10000
+ \advance\rightskip by 0pt plus 1fil
+ \endgraf
+ \nobreak\vskip -\parskip
+ \penalty 10002 % signal to \startdefun and \dodefunx
+ % Some of the @defun-type tags do not enable magic parentheses,
+ % rendering the following check redundant. But we don't optimize.
+ \checkparencounts
+ \endgroup
+}
+
+\def\Edefun{\endgraf\medbreak}
+
+% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
+% the only thing remainnig is to define \deffnheader.
+%
+\def\makedefun#1{%
+ \expandafter\let\csname E#1\endcsname = \Edefun
+ \edef\temp{\noexpand\domakedefun
+ \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
+ \temp
+}
+
+% \domakedefun \deffn \deffnx \deffnheader
+%
+% Define \deffn and \deffnx, without parameters.
+% \deffnheader has to be defined explicitly.
+%
+\def\domakedefun#1#2#3{%
+ \envdef#1{%
+ \startdefun
+ \parseargusing\activeparens{\printdefunline#3}%
+ }%
+ \def#2{\dodefunx#1}%
+ \def#3%
+}
+
+%%% Untyped functions:
+
+% @deffn category name args
+\makedefun{deffn}{\deffngeneral{}}
+
+% @deffn category class name args
+\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
+
+% \defopon {category on}class name args
+\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deffngeneral {subind}category name args
+%
+\def\deffngeneral#1#2 #3 #4\endheader{%
+ % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
+ \dosubind{fn}{\code{#3}}{#1}%
+ \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
+}
+
+%%% Typed functions:
+
+% @deftypefn category type name args
+\makedefun{deftypefn}{\deftypefngeneral{}}
+
+% @deftypeop category class type name args
+\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
+
+% \deftypeopon {category on}class type name args
+\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypefngeneral {subind}category type name args
+%
+\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{fn}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+%%% Typed variables:
+
+% @deftypevr category type var args
+\makedefun{deftypevr}{\deftypecvgeneral{}}
+
+% @deftypecv category class type var args
+\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
+
+% \deftypecvof {category of}class type var args
+\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypecvgeneral {subind}category type var args
+%
+\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{vr}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+%%% Untyped variables:
+
+% @defvr category var args
+\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
+
+% @defcv category class var args
+\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
+
+% \defcvof {category of}class var args
+\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
+
+%%% Type:
+% @deftp category name args
+\makedefun{deftp}#1 #2 #3\endheader{%
+ \doind{tp}{\code{#2}}%
+ \defname{#1}{}{#2}\defunargs{#3\unskip}%
+}
+
+% Remaining @defun-like shortcuts:
+\makedefun{defun}{\deffnheader{\putwordDeffunc} }
+\makedefun{defmac}{\deffnheader{\putwordDefmac} }
+\makedefun{defspec}{\deffnheader{\putwordDefspec} }
+\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
+\makedefun{defvar}{\defvrheader{\putwordDefvar} }
+\makedefun{defopt}{\defvrheader{\putwordDefopt} }
+\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
+\makedefun{defmethod}{\defopon\putwordMethodon}
+\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
+\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
+\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
+
+% \defname, which formats the name of the @def (not the args).
+% #1 is the category, such as "Function".
+% #2 is the return type, if any.
+% #3 is the function name.
+%
+% We are followed by (but not passed) the arguments, if any.
+%
+\def\defname#1#2#3{%
+ % Get the values of \leftskip and \rightskip as they were outside the @def...
+ \advance\leftskip by -\defbodyindent
+ %
+ % How we'll format the type name. Putting it in brackets helps
+ % distinguish it from the body text that may end up on the next line
+ % just below it.
+ \def\temp{#1}%
+ \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
+ %
+ % Figure out line sizes for the paragraph shape.
+ % The first line needs space for \box0; but if \rightskip is nonzero,
+ % we need only space for the part of \box0 which exceeds it:
+ \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
+ % The continuations:
+ \dimen2=\hsize \advance\dimen2 by -\defargsindent
+ % (plain.tex says that \dimen1 should be used only as global.)
+ \parshape 2 0in \dimen0 \defargsindent \dimen2
+ %
+ % Put the type name to the right margin.
+ \noindent
+ \hbox to 0pt{%
+ \hfil\box0 \kern-\hsize
+ % \hsize has to be shortened this way:
+ \kern\leftskip
+ % Intentionally do not respect \rightskip, since we need the space.
+ }%
+ %
+ % Allow all lines to be underfull without complaint:
+ \tolerance=10000 \hbadness=10000
+ \exdentamount=\defbodyindent
+ {%
+ % defun fonts. We use typewriter by default (used to be bold) because:
+ % . we're printing identifiers, they should be in tt in principle.
+ % . in languages with many accents, such as Czech or French, it's
+ % common to leave accents off identifiers. The result looks ok in
+ % tt, but exceedingly strange in rm.
+ % . we don't want -- and --- to be treated as ligatures.
+ % . this still does not fix the ?` and !` ligatures, but so far no
+ % one has made identifiers using them :).
+ \df \tt
+ \def\temp{#2}% return value type
+ \ifx\temp\empty\else \tclose{\temp} \fi
+ #3% output function name
+ }%
+ {\rm\enskip}% hskip 0.5 em of \tenrm
+ %
+ \boldbrax
+ % arguments will be output next, if any.
+}
+
+% Print arguments in slanted roman (not ttsl), inconsistently with using
+% tt for the name. This is because literal text is sometimes needed in
+% the argument list (groff manual), and ttsl and tt are not very
+% distinguishable. Prevent hyphenation at `-' chars.
+%
+\def\defunargs#1{%
+ % use sl by default (not ttsl),
+ % tt for the names.
+ \df \sl \hyphenchar\font=0
+ %
+ % On the other hand, if an argument has two dashes (for instance), we
+ % want a way to get ttsl. Let's try @var for that.
+ \let\var=\ttslanted
+ #1%
+ \sl\hyphenchar\font=45
+}
+
+% We want ()&[] to print specially on the defun line.
+%
+\def\activeparens{%
+ \catcode`\(=\active \catcode`\)=\active
+ \catcode`\[=\active \catcode`\]=\active
+ \catcode`\&=\active
+}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+{
+ \activeparens
+ \global\let(=\lparen \global\let)=\rparen
+ \global\let[=\lbrack \global\let]=\rbrack
+ \global\let& = \&
+
+ \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+ \gdef\magicamp{\let&=\amprm}
+}
+
+\newcount\parencount
+
+% If we encounter &foo, then turn on ()-hacking afterwards
+\newif\ifampseen
+\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+
+\def\parenfont{%
+ \ifampseen
+ % At the first level, print parens in roman,
+ % otherwise use the default font.
+ \ifnum \parencount=1 \rm \fi
+ \else
+ % The \sf parens (in \boldbrax) actually are a little bolder than
+ % the contained text. This is especially needed for [ and ] .
+ \sf
+ \fi
+}
+\def\infirstlevel#1{%
+ \ifampseen
+ \ifnum\parencount=1
+ #1%
+ \fi
+ \fi
+}
+\def\bfafterword#1 {#1 \bf}
+
+\def\opnr{%
+ \global\advance\parencount by 1
+ {\parenfont(}%
+ \infirstlevel \bfafterword
+}
+\def\clnr{%
+ {\parenfont)}%
+ \infirstlevel \sl
+ \global\advance\parencount by -1
+}
+
+\newcount\brackcount
+\def\lbrb{%
+ \global\advance\brackcount by 1
+ {\bf[}%
+}
+\def\rbrb{%
+ {\bf]}%
+ \global\advance\brackcount by -1
+}
+
+\def\checkparencounts{%
+ \ifnum\parencount=0 \else \badparencount \fi
+ \ifnum\brackcount=0 \else \badbrackcount \fi
+}
+\def\badparencount{%
+ \errmessage{Unbalanced parentheses in @def}%
+ \global\parencount=0
+}
+\def\badbrackcount{%
+ \errmessage{Unbalanced square braces in @def}%
+ \global\brackcount=0
+}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scantokens#1{%
+ \toks0={#1}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \input \jobname.tmp
+ }
+\fi
+
+\def\scanmacro#1{%
+ \begingroup
+ \newlinechar`\^^M
+ \let\xeatspaces\eatspaces
+ % Undo catcode changes of \startcontents and \doprintindex
+ % When called from @insertcopying or (short)caption, we need active
+ % backslash to get it printed correctly. Previously, we had
+ % \catcode`\\=\other instead. We'll see whether a problem appears
+ % with macro expansion. --kasal, 19aug04
+ \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+ % ... and \example
+ \spaceisspace
+ %
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ %
+ % I've verified that it is necessary both for e-TeX and for ordinary TeX
+ % --kasal, 29nov03
+ \scantokens{#1\endinput}%
+ \endgroup
+}
+
+\def\scanexp#1{%
+ \edef\temp{\noexpand\scanmacro{#1}}%
+ \temp
+}
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+
+% List of all defined macros in the form
+% \definedummyword\macro1\definedummyword\macro2...
+% Currently is also contains all @aliases; the list can be split
+% if there is a need.
+\def\macrolist{}
+
+% Add the macro to \macrolist
+\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
+\def\addtomacrolistxxx#1{%
+ \toks0 = \expandafter{\macrolist\definedummyword#1}%
+ \xdef\macrolist{\the\toks0}%
+}
+
+% Utility routines.
+% This does \let #1 = #2, with \csnames; that is,
+% \let \csname#1\endcsname = \csname#2\endcsname
+% (except of course we have to play expansion games).
+%
+\def\cslet#1#2{%
+ \expandafter\let
+ \csname#1\expandafter\endcsname
+ \csname#2\endcsname
+}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=\other \catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\scanctxt{%
+ \catcode`\"=\other
+ \catcode`\+=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\~=\other
+}
+
+\def\scanargctxt{%
+ \scanctxt
+ \catcode`\\=\other
+ \catcode`\^^M=\other
+}
+
+\def\macrobodyctxt{%
+ \scanctxt
+ \catcode`\{=\other
+ \catcode`\}=\other
+ \catcode`\^^M=\other
+ \usembodybackslash
+}
+
+\def\macroargctxt{%
+ \scanctxt
+ \catcode`\\=\other
+}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{Macro name \the\macname\space already defined}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ \addtomacrolist{\the\macname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\parseargdef\unmacro{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist:
+ \begingroup
+ \expandafter\let\csname#1\endcsname \relax
+ \let\definedummyword\unmacrodo
+ \xdef\macrolist{\macrolist}%
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% Called by \do from \dounmacro on each macro. The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+ \ifx #1\relax
+ % remove this
+ \else
+ \noexpand\definedummyword \noexpand#1%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \next}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Just make them active and then expand them all to nothing.
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{%
+ {%
+ \expandafter\let\obeyedspace=\empty
+ \addtomacrolist{#1}%
+ \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+ }%
+ \next
+}
+
+
+\message{cross references,}
+
+\newwrite\auxfile
+
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's only job in TeX is to define \lastnode, which is used in
+% cross-references. The @node line might or might not have commas, and
+% might or might not have spaces before the first comma, like:
+% @node foo , bar , ...
+% We don't want such trailing spaces in the node name.
+%
+\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
+%
+% also remove a trailing comma, in case of something like this:
+% @node Help-Cross, , , Cross-refs
+\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+
+\let\nwnode=\node
+\let\lastnode=\empty
+
+% Write a cross-reference definition for the current node. #1 is the
+% type (Ynumbered, Yappendix, Ynothing).
+%
+\def\donoderef#1{%
+ \ifx\lastnode\empty\else
+ \setref{\lastnode}{#1}%
+ \global\let\lastnode=\empty
+ \fi
+}
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+%
+\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name taken from \thissection,
+% or the anchor name.
+% 2) NAME-snt - section number and type, passed as the SNT arg, or
+% empty for anchors.
+% 3) NAME-pg - the page number.
+%
+% This is called from \donoderef, \anchor, and \dofloat. In the case of
+% floats, there is an additional part, which is not written here:
+% 4) NAME-lof - the text as it should appear in a @listoffloats.
+%
+\def\setref#1#2{%
+ \pdfmkdest{#1}%
+ \iflinks
+ {%
+ \atdummies % preserve commands, but don't expand them
+ \edef\writexrdef##1##2{%
+ \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
+ ##1}{##2}}% these are parameters of \writexrdef
+ }%
+ \toks0 = \expandafter{\thissection}%
+ \immediate \writexrdef{title}{\the\toks0 }%
+ \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
+ \writexrdef{pg}{\folio}% will be written later, during \shipout
+ }%
+ \fi
+}
+
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
+ \def\printedmanual{\ignorespaces #5}%
+ \def\printedrefname{\ignorespaces #3}%
+ \setbox1=\hbox{\printedmanual\unskip}%
+ \setbox0=\hbox{\printedrefname\unskip}%
+ \ifdim \wd0 = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+ % Use the node name inside the square brackets.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ % Use the actual chapter/section title appear inside
+ % the square brackets. Use the real section title if we have it.
+ \ifdim \wd1 > 0pt
+ % It is in another manual, so we don't have it.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We know the real title if we have the xref values.
+ \def\printedrefname{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printedrefname{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % Make link in pdf output.
+ \ifpdf
+ \leavevmode
+ \getfilename{#4}%
+ {\turnoffactive
+ % See comments at \activebackslashdouble.
+ {\activebackslashdouble \xdef\pdfxrefdest{#1}%
+ \backslashparens\pdfxrefdest}%
+ %
+ \ifnum\filenamelength>0
+ \startlink attr{/Border [0 0 0]}%
+ goto file{\the\filename.pdf} name{\pdfxrefdest}%
+ \else
+ \startlink attr{/Border [0 0 0]}%
+ goto name{\pdfmkpgn{\pdfxrefdest}}%
+ \fi
+ }%
+ \linkcolor
+ \fi
+ %
+ % Float references are printed completely differently: "Figure 1.2"
+ % instead of "[somenode], p.3". We distinguish them by the
+ % LABEL-title being set to a magic string.
+ {%
+ % Have to otherify everything special to allow the \csname to
+ % include an _ in the xref name, etc.
+ \indexnofonts
+ \turnoffactive
+ \expandafter\global\expandafter\let\expandafter\Xthisreftitle
+ \csname XR#1-title\endcsname
+ }%
+ \iffloat\Xthisreftitle
+ % If the user specified the print name (third arg) to the ref,
+ % print it instead of our usual "Figure 1.2".
+ \ifdim\wd0 = 0pt
+ \refx{#1-snt}%
+ \else
+ \printedrefname
+ \fi
+ %
+ % if the user also gave the printed manual name (fifth arg), append
+ % "in MANUALNAME".
+ \ifdim \wd1 > 0pt
+ \space \putwordin{} \cite{\printedmanual}%
+ \fi
+ \else
+ % node/anchor (non-float) references.
+ %
+ % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+ % insert empty discretionaries after hyphens, which means that it will
+ % not find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens, this
+ % is a loss. Therefore, we give the text of the node name again, so it
+ % is as if TeX is seeing it for the first time.
+ \ifdim \wd1 > 0pt
+ \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
+ \else
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\turnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % output the `[mynode]' via a macro so it can be overridden.
+ \xrefprintnodename\printedrefname
+ %
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output. It's a separate macro only so it can be changed more easily,
+% since square brackets don't work well in some documents. Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
+
+% Things referred to by \setref.
+%
+\def\Ynothing{}
+\def\Yomitfromtoc{}
+\def\Ynumbered{%
+ \ifnum\secno=0
+ \putwordChapter@tie \the\chapno
+ \else \ifnum\subsecno=0
+ \putwordSection@tie \the\chapno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+\def\Yappendix{%
+ \ifnum\secno=0
+ \putwordAppendix@tie @char\the\appendixno{}%
+ \else \ifnum\subsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie
+ @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+%
+\def\refx#1#2{%
+ {%
+ \indexnofonts
+ \otherbackslash
+ \expandafter\global\expandafter\let\expandafter\thisrefX
+ \csname XR#1\endcsname
+ }%
+ \ifx\thisrefX\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \thisrefX
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file. Usually it's
+% just a \def (we prepend XR to the control sequence name to avoid
+% collisions). But if this is a float type, we have more work to do.
+%
+\def\xrdef#1#2{%
+ \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value.
+ %
+ % Was that xref control sequence that we just defined for a float?
+ \expandafter\iffloat\csname XR#1\endcsname
+ % it was a float, and we have the (safe) float type in \iffloattype.
+ \expandafter\let\expandafter\floatlist
+ \csname floatlist\iffloattype\endcsname
+ %
+ % Is this the first time we've seen this float type?
+ \expandafter\ifx\floatlist\relax
+ \toks0 = {\do}% yes, so just \do
+ \else
+ % had it before, so preserve previous elements in list.
+ \toks0 = \expandafter{\floatlist\do}%
+ \fi
+ %
+ % Remember this xref in the control sequence \floatlistFLOATTYPE,
+ % for later use in \listoffloats.
+ \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}%
+ \fi
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+%
+\def\tryauxfile{%
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \readdatafile{aux}%
+ \global\havexrefstrue
+ \fi
+ \closein 1
+}
+
+\def\setupdatafile{%
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\^=\other
+ %
+ % Special characters. Should be turned off anyway, but...
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`\%=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ %
+ % This is to support \ in node names and titles, since the \
+ % characters end up in a \csname. It's easier than
+ % leaving it active and making its active definition an actual \
+ % character. What I don't understand is why it works in the *value*
+ % of the xrdef. Seems like it should be a catcode12 \, and that
+ % should not typeset properly. But it works, so I'm moving on for
+ % now. --karl, 15jan04.
+ \catcode`\\=\other
+ %
+ % Make the characters 128-255 be printing characters.
+ {%
+ \count1=128
+ \def\loop{%
+ \catcode\count1=\other
+ \advance\count1 by 1
+ \ifnum \count1<256 \loop \fi
+ }%
+ }%
+ %
+ % @ is our escape character in .aux files, and we need braces.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\@=0
+}
+
+\def\readdatafile#1{%
+\begingroup
+ \setupdatafile
+ \input\jobname.#1
+\endgroup}
+
+\message{insertions,}
+% including footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only.
+\let\footnotestyle=\comment
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \dofootnote
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset (and anything else that uses
+% \parseargline) fails inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\gdef\dofootnote{%
+ \insert\footins\bgroup
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \hsize=\pagewidth
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ \smallfonts \rm
+ %
+ % Because we use hanging indentation in footnotes, a @noindent appears
+ % to exdent this text, so make it be a no-op. makeinfo does not use
+ % hanging indentation so @noindent can still be needed within footnote
+ % text after an @example or the like (not that this is good style).
+ \let\noindent = \relax
+ %
+ % Hang the footnote text off the number. Use \everypar in case the
+ % footnote extends for more than one paragraph.
+ \everypar = {\hang}%
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ \futurelet\next\fo@t
+}
+}%end \catcode `\@=11
+
+% In case a @footnote appears in a vbox, save the footnote text and create
+% the real \insert just after the vbox finished. Otherwise, the insertion
+% would be lost.
+% Similarily, if a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is finished.
+% And the same can be done for other insert classes. --kasal, 16nov03.
+
+% Replace the \insert primitive by a cheating macro.
+% Deeper inside, just make sure that the saved insertions are not spilled
+% out prematurely.
+%
+\def\startsavinginserts{%
+ \ifx \insert\ptexinsert
+ \let\insert\saveinsert
+ \else
+ \let\checkinserts\relax
+ \fi
+}
+
+% This \insert replacement works for both \insert\footins{foo} and
+% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
+%
+\def\saveinsert#1{%
+ \edef\next{\noexpand\savetobox \makeSAVEname#1}%
+ \afterassignment\next
+ % swallow the left brace
+ \let\temp =
+}
+\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
+\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
+
+\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
+
+\def\placesaveins#1{%
+ \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
+ {\box#1}%
+}
+
+% eat @SAVE -- beware, all of them have catcode \other:
+{
+ \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
+ \gdef\gobblesave @SAVE{}
+}
+
+% initialization:
+\def\newsaveins #1{%
+ \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
+ \next
+}
+\def\newsaveinsX #1{%
+ \csname newbox\endcsname #1%
+ \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
+ \checksaveins #1}%
+}
+
+% initialize:
+\let\checkinserts\empty
+\newsaveins\footins
+\newsaveins\margin
+
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ % Do not bother showing banner with epsf.tex v2.7k (available in
+ % doc/epsf.tex and on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+\closein 1
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is (ignored optional) html alt text.
+% #5 is (ignored optional) extension.
+% #6 is just the usual extra ignored arg for parsing this stuff.
+\newif\ifimagevmode
+\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ \normalturnoffactive % allow _ et al. in names
+ % If the image is by itself, center it.
+ \ifvmode
+ \imagevmodetrue
+ \nobreak\bigskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \line\bgroup\hss
+ \fi
+ %
+ % Output the image.
+ \ifpdf
+ \dopdfimage{#1}{#2}{#3}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \epsfbox{#1.eps}%
+ \fi
+ %
+ \ifimagevmode \hss \egroup \bigbreak \fi % space after the image
+\endgroup}
+
+
+% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
+% etc. We don't actually implement floating yet, we always include the
+% float "here". But it seemed the best name for the future.
+%
+\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
+
+% There may be a space before second and/or third parameter; delete it.
+\def\eatcommaspace#1, {#1,}
+
+% #1 is the optional FLOATTYPE, the text label for this float, typically
+% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
+% this float will not be numbered and cannot be referred to.
+%
+% #2 is the optional xref label. Also must be present for the float to
+% be referable.
+%
+% #3 is the optional positioning argument; for now, it is ignored. It
+% will somehow specify the positions allowed to float to (here, top, bottom).
+%
+% We keep a separate counter for each FLOATTYPE, which we reset at each
+% chapter-level command.
+\let\resetallfloatnos=\empty
+%
+\def\dofloat#1,#2,#3,#4\finish{%
+ \let\thiscaption=\empty
+ \let\thisshortcaption=\empty
+ %
+ % don't lose footnotes inside @float.
+ %
+ % BEWARE: when the floats start float, we have to issue warning whenever an
+ % insert appears inside a float which could possibly float. --kasal, 26may04
+ %
+ \startsavinginserts
+ %
+ % We can't be used inside a paragraph.
+ \par
+ %
+ \vtop\bgroup
+ \def\floattype{#1}%
+ \def\floatlabel{#2}%
+ \def\floatloc{#3}% we do nothing with this yet.
+ %
+ \ifx\floattype\empty
+ \let\safefloattype=\empty
+ \else
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ \fi
+ %
+ % If label is given but no type, we handle that as the empty type.
+ \ifx\floatlabel\empty \else
+ % We want each FLOATTYPE to be numbered separately (Figure 1,
+ % Table 1, Figure 2, ...). (And if no label, no number.)
+ %
+ \expandafter\getfloatno\csname\safefloattype floatno\endcsname
+ \global\advance\floatno by 1
+ %
+ {%
+ % This magic value for \thissection is output by \setref as the
+ % XREFLABEL-title value. \xrefX uses it to distinguish float
+ % labels (which have a completely different output format) from
+ % node and anchor labels. And \xrdef uses it to construct the
+ % lists of floats.
+ %
+ \edef\thissection{\floatmagic=\safefloattype}%
+ \setref{\floatlabel}{Yfloat}%
+ }%
+ \fi
+ %
+ % start with \parskip glue, I guess.
+ \vskip\parskip
+ %
+ % Don't suppress indentation if a float happens to start a section.
+ \restorefirstparagraphindent
+}
+
+% we have these possibilities:
+% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
+% @float Foo,lbl & no caption: Foo 1.1
+% @float Foo & @caption{Cap}: Foo: Cap
+% @float Foo & no caption: Foo
+% @float ,lbl & Caption{Cap}: 1.1: Cap
+% @float ,lbl & no caption: 1.1
+% @float & @caption{Cap}: Cap
+% @float & no caption:
+%
+\def\Efloat{%
+ \let\floatident = \empty
+ %
+ % In all cases, if we have a float type, it comes first.
+ \ifx\floattype\empty \else \def\floatident{\floattype}\fi
+ %
+ % If we have an xref label, the number comes next.
+ \ifx\floatlabel\empty \else
+ \ifx\floattype\empty \else % if also had float type, need tie first.
+ \appendtomacro\floatident{\tie}%
+ \fi
+ % the number.
+ \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
+ \fi
+ %
+ % Start the printed caption with what we've constructed in
+ % \floatident, but keep it separate; we need \floatident again.
+ \let\captionline = \floatident
+ %
+ \ifx\thiscaption\empty \else
+ \ifx\floatident\empty \else
+ \appendtomacro\captionline{: }% had ident, so need a colon between
+ \fi
+ %
+ % caption text.
+ \appendtomacro\captionline{\scanexp\thiscaption}%
+ \fi
+ %
+ % If we have anything to print, print it, with space before.
+ % Eventually this needs to become an \insert.
+ \ifx\captionline\empty \else
+ \vskip.5\parskip
+ \captionline
+ %
+ % Space below caption.
+ \vskip\parskip
+ \fi
+ %
+ % If have an xref label, write the list of floats info. Do this
+ % after the caption, to avoid chance of it being a breakpoint.
+ \ifx\floatlabel\empty \else
+ % Write the text that goes in the lof to the aux file as
+ % \floatlabel-lof. Besides \floatident, we include the short
+ % caption if specified, else the full caption if specified, else nothing.
+ {%
+ \atdummies
+ % since we read the caption text in the macro world, where ^^M
+ % is turned into a normal character, we have to scan it back, so
+ % we don't write the literal three characters "^^M" into the aux file.
+ \scanexp{%
+ \xdef\noexpand\gtemp{%
+ \ifx\thisshortcaption\empty
+ \thiscaption
+ \else
+ \thisshortcaption
+ \fi
+ }%
+ }%
+ \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
+ \ifx\gtemp\empty \else : \gtemp \fi}}%
+ }%
+ \fi
+ \egroup % end of \vtop
+ %
+ % place the captured inserts
+ %
+ % BEWARE: when the floats start float, we have to issue warning whenever an
+ % insert appears inside a float which could possibly float. --kasal, 26may04
+ %
+ \checkinserts
+}
+
+% Append the tokens #2 to the definition of macro #1, not expanding either.
+%
+\def\appendtomacro#1#2{%
+ \expandafter\def\expandafter#1\expandafter{#1#2}%
+}
+
+% @caption, @shortcaption
+%
+\def\caption{\docaption\thiscaption}
+\def\shortcaption{\docaption\thisshortcaption}
+\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
+\def\defcaption#1#2{\egroup \def#1{#2}}
+
+% The parameter is the control sequence identifying the counter we are
+% going to use. Create it if it doesn't exist and assign it to \floatno.
+\def\getfloatno#1{%
+ \ifx#1\relax
+ % Haven't seen this figure type before.
+ \csname newcount\endcsname #1%
+ %
+ % Remember to reset this floatno at the next chap.
+ \expandafter\gdef\expandafter\resetallfloatnos
+ \expandafter{\resetallfloatnos #1=0 }%
+ \fi
+ \let\floatno#1%
+}
+
+% \setref calls this to get the XREFLABEL-snt value. We want an @xref
+% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
+% first read the @float command.
+%
+\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
+
+% Magic string used for the XREFLABEL-title value, so \xrefX can
+% distinguish floats from other xref types.
+\def\floatmagic{!!float!!}
+
+% #1 is the control sequence we are passed; we expand into a conditional
+% which is true if #1 represents a float ref. That is, the magic
+% \thissection value which we \setref above.
+%
+\def\iffloat#1{\expandafter\doiffloat#1==\finish}
+%
+% #1 is (maybe) the \floatmagic string. If so, #2 will be the
+% (safe) float type for this float. We set \iffloattype to #2.
+%
+\def\doiffloat#1=#2=#3\finish{%
+ \def\temp{#1}%
+ \def\iffloattype{#2}%
+ \ifx\temp\floatmagic
+}
+
+% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
+%
+\parseargdef\listoffloats{%
+ \def\floattype{#1}% floattype
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ %
+ % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
+ \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
+ \ifhavexrefs
+ % if the user said @listoffloats foo but never @float foo.
+ \message{\linenumber No `\safefloattype' floats to list.}%
+ \fi
+ \else
+ \begingroup
+ \leftskip=\tocindent % indent these entries like a toc
+ \let\do=\listoffloatsdo
+ \csname floatlist\safefloattype\endcsname
+ \endgroup
+ \fi
+}
+
+% This is called on each entry in a list of floats. We're passed the
+% xref label, in the form LABEL-title, which is how we save it in the
+% aux file. We strip off the -title and look up \XRLABEL-lof, which
+% has the text we're supposed to typeset here.
+%
+% Figures without xref labels will not be included in the list (since
+% they won't appear in the aux file).
+%
+\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+\def\listoffloatsdoentry#1-title\finish{{%
+ % Can't fully expand XR#1-lof because it can contain anything. Just
+ % pass the control sequence. On the other hand, XR#1-pg is just the
+ % page number, and we want to fully expand that so we can get a link
+ % in pdf output.
+ \toksA = \expandafter{\csname XR#1-lof\endcsname}%
+ %
+ % use the same \entry macro we use to generate the TOC and index.
+ \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
+ \writeentry
+}}
+
+\message{localization,}
+% and i18n.
+
+% @documentlanguage is usually given very early, just after
+% @setfilename. If done too late, it may not override everything
+% properly. Single argument is the language abbreviation.
+% It would be nice if we could set up a hyphenation file here.
+%
+\parseargdef\documentlanguage{%
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \else
+ \input txi-#1.tex
+ \fi
+ \closein 1
+ \endgroup
+}
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? In the current directory
+should work if nowhere else does.}
+
+
+% @documentencoding should change something in TeX eventually, most
+% likely, but for now just recognize it.
+\let\documentencoding = \comment
+
+
+% Page size parameters.
+%
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
+
+% Following George Bush, just get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth;
+% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
+% 7) physical page height; 8) physical page width.
+%
+% We also call \setleading{\textleading}, so the caller should define
+% \textleading. The caller should also set \parskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6#7#8{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \ifpdf
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ \fi
+ %
+ \setleading{\textleading}
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}%
+ {\voffset}{.25in}%
+ {\bindingoffset}{36pt}%
+ {11in}{8.5in}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.25 trim size.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.5in}{5in}%
+ {\voffset}{.25in}%
+ {\bindingoffset}{16pt}%
+ {9.25in}{7in}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .5cm
+}}
+
+% Use @smallerbook to reset parameters for 6x9 trim size.
+% (Just testing, parameters still in flux.)
+\def\smallerbook{{\globaldefs = 1
+ \parskip = 1.5pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.4in}{4.8in}%
+ {-.2in}{-.4in}%
+ {0pt}{14pt}%
+ {9in}{6in}%
+ %
+ \lispnarrowing = 0.25in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .4cm
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % Double-side printing via postscript on Laserjet 4050
+ % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
+ % To change the settings for a different printer or situation, adjust
+ % \normaloffset until the front-side and back-side texts align. Then
+ % do the same for \bindingoffset. You can set these for testing in
+ % your texinfo source file like this:
+ % @tex
+ % \global\normaloffset = -6mm
+ % \global\bindingoffset = 10mm
+ % @end tex
+ \internalpagesizes{51\baselineskip}{160mm}
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{44pt}%
+ {297mm}{210mm}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 5mm
+}}
+
+% Use @afivepaper to print on European A5 paper.
+% From romildo@urano.iceb.ufop.br, 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+ \parskip = 2pt plus 1pt minus 0.1pt
+ \textleading = 12.5pt
+ %
+ \internalpagesizes{160mm}{120mm}%
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{8pt}%
+ {210mm}{148mm}%
+ %
+ \lispnarrowing = 0.2in
+ \tolerance = 800
+ \hfuzz = 1.2pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 2mm
+ \tableindent = 12mm
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.
+\def\afourlatex{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}%
+ {\voffset}{4.6mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ %
+ % Must explicitly reset to 0 because we call \afourpaper.
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{241mm}{165mm}%
+ {\voffset}{-2.95mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ \globaldefs = 0
+}}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{\textleading}%
+ %
+ \dimen0 = #1
+ \advance\dimen0 by \voffset
+ %
+ \dimen2 = \hsize
+ \advance\dimen2 by \normaloffset
+ %
+ \internalpagesizes{#1}{\hsize}%
+ {\voffset}{\normaloffset}%
+ {\bindingoffset}{44pt}%
+ {\dimen0}{\dimen2}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\catcode`\$=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+\def\normaldollar{$}%$ font-lock fix
+
+% This macro is used to make a character print one way in \tt
+% (where it can probably be output as-is), and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+\let\realunder=_
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+\catcode`\@=0
+
+% \backslashcurfont outputs one backslash character in current font,
+% as in \char`\\.
+\global\chardef\backslashcurfont=`\\
+\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
+
+% \rawbackslash defines an active \ to do \backslashcurfont.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other.
+{\catcode`\\=\active
+ @gdef@rawbackslash{@let\=@backslashcurfont}
+ @gdef@otherbackslash{@let\=@realbackslash}
+}
+
+% \realbackslash is an actual character `\' with catcode other, and
+% \doublebackslash is two of them (for the pdf outlines).
+{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+
+% \normalbackslash outputs one backslash in fixed width font.
+\def\normalbackslash{{\tt\backslashcurfont}}
+
+\catcode`\\=\active
+
+% Used sometimes to turn off (effectively) the active characters
+% even after parsing them.
+@def@turnoffactive{%
+ @let"=@normaldoublequote
+ @let\=@realbackslash
+ @let~=@normaltilde
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let<=@normalless
+ @let>=@normalgreater
+ @let+=@normalplus
+ @let$=@normaldollar %$ font-lock fix
+ @unsepspaces
+}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'. (Thus, \ is not expandable when this is in
+% effect.)
+%
+@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\{ in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also turn back on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
+
+@c vim:sw=2:
+
+@ignore
+ arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
+@end ignore
diff --git a/Modules/_ctypes/libffi_msvc/ffi.c b/Modules/_ctypes/libffi_msvc/ffi.c
index 7a7348b3c4..6e595e9fe7 100644
--- a/Modules/_ctypes/libffi_msvc/ffi.c
+++ b/Modules/_ctypes/libffi_msvc/ffi.c
@@ -110,7 +110,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
argp += z;
}
- if (argp - stack > ecif->cif->bytes)
+ if (argp >= stack && (unsigned)(argp - stack) > ecif->cif->bytes)
{
Py_FatalError("FFI BUG: not enough stack space for arguments");
}
@@ -371,10 +371,11 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
extern void ffi_closure_OUTER();
ffi_status
-ffi_prep_closure (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data)
+ffi_prep_closure_loc (ffi_closure* closure,
+ ffi_cif* cif,
+ void (*fun)(ffi_cif*,void*,void**,void*),
+ void *user_data,
+ void *codeloc)
{
short bytes;
char *tramp;
@@ -452,6 +453,5 @@ ffi_prep_closure (ffi_closure* closure,
closure->cif = cif;
closure->user_data = user_data;
closure->fun = fun;
-
return FFI_OK;
}
diff --git a/Modules/_ctypes/libffi_msvc/ffi.h b/Modules/_ctypes/libffi_msvc/ffi.h
index a88d8744f7..efb14c5f6f 100644
--- a/Modules/_ctypes/libffi_msvc/ffi.h
+++ b/Modules/_ctypes/libffi_msvc/ffi.h
@@ -221,11 +221,15 @@ typedef struct {
void *user_data;
} ffi_closure;
+void ffi_closure_free(void *);
+void *ffi_closure_alloc (size_t size, void **code);
+
ffi_status
-ffi_prep_closure (ffi_closure*,
+ffi_prep_closure_loc (ffi_closure*,
ffi_cif *,
void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data);
+ void *user_data,
+ void *codeloc);
typedef struct {
char tramp[FFI_TRAMPOLINE_SIZE];
diff --git a/Modules/_ctypes/libffi_msvc/prep_cif.c b/Modules/_ctypes/libffi_msvc/prep_cif.c
index cd623a1462..2650fa0525 100644
--- a/Modules/_ctypes/libffi_msvc/prep_cif.c
+++ b/Modules/_ctypes/libffi_msvc/prep_cif.c
@@ -163,7 +163,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif,
bytes = ALIGN(bytes, (*ptr)->alignment);
#endif
- bytes += (unsigned)STACK_ARG_SIZE((*ptr)->size);
+ bytes += STACK_ARG_SIZE((*ptr)->size);
}
#endif
}
diff --git a/Modules/_ctypes/libffi_osx/include/ffi.h b/Modules/_ctypes/libffi_osx/include/ffi.h
index 3d39064350..c104a5c893 100644
--- a/Modules/_ctypes/libffi_osx/include/ffi.h
+++ b/Modules/_ctypes/libffi_osx/include/ffi.h
@@ -264,6 +264,9 @@ ffi_prep_closure(
void (*fun)(ffi_cif*,void*,void**,void*),
void* user_data);
+void ffi_closure_free(void *);
+void *ffi_closure_alloc (size_t size, void **code);
+
typedef struct ffi_raw_closure {
char tramp[FFI_TRAMPOLINE_SIZE];
ffi_cif* cif;
@@ -349,4 +352,4 @@ ffi_call(
}
#endif
-#endif // #ifndef LIBFFI_H \ No newline at end of file
+#endif // #ifndef LIBFFI_H
diff --git a/Modules/_ctypes/malloc_closure.c b/Modules/_ctypes/malloc_closure.c
index ae857a2f12..248c6a6702 100644
--- a/Modules/_ctypes/malloc_closure.c
+++ b/Modules/_ctypes/malloc_closure.c
@@ -89,7 +89,7 @@ static void more_core(void)
/******************************************************************/
/* put the item back into the free list */
-void _ctypes_free_closure(void *p)
+void ffi_closure_free(void *p)
{
ITEM *item = (ITEM *)p;
item->next = free_list;
@@ -97,7 +97,7 @@ void _ctypes_free_closure(void *p)
}
/* return one item from the free list, allocating more if needed */
-void *_ctypes_alloc_closure(void)
+void *ffi_closure_alloc(size_t ignored, void** codeloc)
{
ITEM *item;
if (!free_list)
@@ -106,5 +106,6 @@ void *_ctypes_alloc_closure(void)
return NULL;
item = free_list;
free_list = item->next;
- return item;
+ *codeloc = (void *)item;
+ return (void *)item;
}
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 04107ac299..092fb69fb2 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -31,8 +31,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* CVS: $Id$ */
-
/*
A number of SysV or ncurses functions don't have wrappers yet; if you
@@ -102,6 +100,8 @@ char *PyCursesVersion = "2.2";
/* Includes */
+#define PY_SSIZE_T_CLEAN
+
#include "Python.h"
@@ -215,7 +215,7 @@ PyCurses_ConvertToChtype(PyObject *obj, chtype *ch)
return 1;
}
-/* Function versions of the 3 functions for tested whether curses has been
+/* Function versions of the 3 functions for testing whether curses has been
initialised or not. */
static int func_PyCursesSetupTermCalled(void)
@@ -252,43 +252,50 @@ PyTypeObject PyCursesWindow_Type;
PARSESTR - format string for argument parsing
*/
-#define Window_NoArgNoReturnFunction(X) \
- static PyObject *PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
+#define Window_NoArgNoReturnFunction(X) \
+ static PyObject *PyCursesWindow_ ## X \
+ (PyCursesWindowObject *self, PyObject *args) \
{ return PyCursesCheckERR(X(self->win), # X); }
#define Window_NoArgTrueFalseFunction(X) \
- static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self) \
+ static PyObject * PyCursesWindow_ ## X \
+ (PyCursesWindowObject *self) \
{ \
if (X (self->win) == FALSE) { Py_INCREF(Py_False); return Py_False; } \
else { Py_INCREF(Py_True); return Py_True; } }
-#define Window_NoArgNoReturnVoidFunction(X) \
- static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self) \
- { \
+#define Window_NoArgNoReturnVoidFunction(X) \
+ static PyObject * PyCursesWindow_ ## X \
+ (PyCursesWindowObject *self) \
+ { \
X(self->win); Py_INCREF(Py_None); return Py_None; }
#define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \
- static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self) \
+ static PyObject * PyCursesWindow_ ## X \
+ (PyCursesWindowObject *self) \
{ \
TYPE arg1, arg2; \
X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); }
#define Window_OneArgNoReturnVoidFunction(X, TYPE, PARSESTR) \
- static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
+ static PyObject * PyCursesWindow_ ## X \
+ (PyCursesWindowObject *self, PyObject *args) \
{ \
TYPE arg1; \
if (!PyArg_ParseTuple(args, PARSESTR, &arg1)) return NULL; \
X(self->win,arg1); Py_INCREF(Py_None); return Py_None; }
#define Window_OneArgNoReturnFunction(X, TYPE, PARSESTR) \
- static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
+ static PyObject * PyCursesWindow_ ## X \
+ (PyCursesWindowObject *self, PyObject *args) \
{ \
TYPE arg1; \
if (!PyArg_ParseTuple(args,PARSESTR, &arg1)) return NULL; \
return PyCursesCheckERR(X(self->win, arg1), # X); }
#define Window_TwoArgNoReturnFunction(X, TYPE, PARSESTR) \
- static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
+ static PyObject * PyCursesWindow_ ## X \
+ (PyCursesWindowObject *self, PyObject *args) \
{ \
TYPE arg1, arg2; \
if (!PyArg_ParseTuple(args,PARSESTR, &arg1, &arg2)) return NULL; \
@@ -1236,10 +1243,11 @@ PyCursesWindow_NoOutRefresh(PyCursesWindowObject *self, PyObject *args)
int rtn;
#ifndef WINDOW_HAS_FLAGS
- if (0) {
+ if (0)
#else
- if (self->win->_flags & _ISPAD) {
+ if (self->win->_flags & _ISPAD)
#endif
+ {
switch(PyTuple_Size(args)) {
case 6:
if (!PyArg_ParseTuple(args,
@@ -1269,1701 +1277,1702 @@ PyCursesWindow_NoOutRefresh(PyCursesWindowObject *self, PyObject *args)
Py_END_ALLOW_THREADS
return PyCursesCheckERR(rtn, "wnoutrefresh");
}
- }
+}
- static PyObject *
- PyCursesWindow_Overlay(PyCursesWindowObject *self, PyObject *args)
- {
- PyCursesWindowObject *temp;
- int use_copywin = FALSE;
- int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol;
- int rtn;
-
- switch (PyTuple_Size(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "O!;window object",
- &PyCursesWindow_Type, &temp))
- return NULL;
- break;
- case 7:
- if (!PyArg_ParseTuple(args, "O!iiiiii;window object, int, int, int, int, int, int",
- &PyCursesWindow_Type, &temp, &sminrow, &smincol,
- &dminrow, &dmincol, &dmaxrow, &dmaxcol))
- return NULL;
- use_copywin = TRUE;
- break;
- default:
- PyErr_SetString(PyExc_TypeError,
- "overlay requires one or seven arguments");
+static PyObject *
+PyCursesWindow_Overlay(PyCursesWindowObject *self, PyObject *args)
+{
+ PyCursesWindowObject *temp;
+ int use_copywin = FALSE;
+ int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol;
+ int rtn;
+
+ switch (PyTuple_Size(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args, "O!;window object",
+ &PyCursesWindow_Type, &temp))
return NULL;
- }
+ break;
+ case 7:
+ if (!PyArg_ParseTuple(args, "O!iiiiii;window object, int, int, int, int, int, int",
+ &PyCursesWindow_Type, &temp, &sminrow, &smincol,
+ &dminrow, &dmincol, &dmaxrow, &dmaxcol))
+ return NULL;
+ use_copywin = TRUE;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError,
+ "overlay requires one or seven arguments");
+ return NULL;
+ }
- if (use_copywin == TRUE) {
- rtn = copywin(self->win, temp->win, sminrow, smincol,
- dminrow, dmincol, dmaxrow, dmaxcol, TRUE);
- return PyCursesCheckERR(rtn, "copywin");
- }
- else {
- rtn = overlay(self->win, temp->win);
- return PyCursesCheckERR(rtn, "overlay");
- }
+ if (use_copywin == TRUE) {
+ rtn = copywin(self->win, temp->win, sminrow, smincol,
+ dminrow, dmincol, dmaxrow, dmaxcol, TRUE);
+ return PyCursesCheckERR(rtn, "copywin");
+ }
+ else {
+ rtn = overlay(self->win, temp->win);
+ return PyCursesCheckERR(rtn, "overlay");
}
+}
- static PyObject *
- PyCursesWindow_Overwrite(PyCursesWindowObject *self, PyObject *args)
- {
- PyCursesWindowObject *temp;
- int use_copywin = FALSE;
- int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol;
- int rtn;
-
- switch (PyTuple_Size(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "O!;window object",
- &PyCursesWindow_Type, &temp))
- return NULL;
- break;
- case 7:
- if (!PyArg_ParseTuple(args, "O!iiiiii;window object, int, int, int, int, int, int",
- &PyCursesWindow_Type, &temp, &sminrow, &smincol,
- &dminrow, &dmincol, &dmaxrow, &dmaxcol))
- return NULL;
- use_copywin = TRUE;
- break;
- default:
- PyErr_SetString(PyExc_TypeError,
- "overwrite requires one or seven arguments");
+static PyObject *
+PyCursesWindow_Overwrite(PyCursesWindowObject *self, PyObject *args)
+{
+ PyCursesWindowObject *temp;
+ int use_copywin = FALSE;
+ int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol;
+ int rtn;
+
+ switch (PyTuple_Size(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args, "O!;window object",
+ &PyCursesWindow_Type, &temp))
return NULL;
- }
+ break;
+ case 7:
+ if (!PyArg_ParseTuple(args, "O!iiiiii;window object, int, int, int, int, int, int",
+ &PyCursesWindow_Type, &temp, &sminrow, &smincol,
+ &dminrow, &dmincol, &dmaxrow, &dmaxcol))
+ return NULL;
+ use_copywin = TRUE;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError,
+ "overwrite requires one or seven arguments");
+ return NULL;
+ }
- if (use_copywin == TRUE) {
- rtn = copywin(self->win, temp->win, sminrow, smincol,
- dminrow, dmincol, dmaxrow, dmaxcol, FALSE);
- return PyCursesCheckERR(rtn, "copywin");
- }
- else {
- rtn = overwrite(self->win, temp->win);
- return PyCursesCheckERR(rtn, "overwrite");
- }
+ if (use_copywin == TRUE) {
+ rtn = copywin(self->win, temp->win, sminrow, smincol,
+ dminrow, dmincol, dmaxrow, dmaxcol, FALSE);
+ return PyCursesCheckERR(rtn, "copywin");
+ }
+ else {
+ rtn = overwrite(self->win, temp->win);
+ return PyCursesCheckERR(rtn, "overwrite");
}
+}
- static PyObject *
- PyCursesWindow_PutWin(PyCursesWindowObject *self, PyObject *stream)
- {
- /* We have to simulate this by writing to a temporary FILE*,
- then reading back, then writing to the argument stream. */
- char fn[100];
- int fd;
- FILE *fp;
- PyObject *res;
-
- strcpy(fn, "/tmp/py.curses.putwin.XXXXXX");
- fd = mkstemp(fn);
- if (fd < 0)
- return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
- fp = fdopen(fd, "wb+");
- if (fp == NULL) {
- close(fd);
- remove(fn);
- return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
- }
- res = PyCursesCheckERR(putwin(self->win, fp), "putwin");
- if (res == NULL) {
- fclose(fp);
- remove(fn);
- return res;
- }
- fseek(fp, 0, 0);
- while (1) {
- char buf[BUFSIZ];
- int n = fread(buf, 1, BUFSIZ, fp);
- if (n <= 0)
- break;
- Py_DECREF(res);
- res = PyObject_CallMethod(stream, "write", "y#", buf, n);
- if (res == NULL)
- break;
- }
+static PyObject *
+PyCursesWindow_PutWin(PyCursesWindowObject *self, PyObject *stream)
+{
+ /* We have to simulate this by writing to a temporary FILE*,
+ then reading back, then writing to the argument stream. */
+ char fn[100];
+ int fd;
+ FILE *fp;
+ PyObject *res;
+
+ strcpy(fn, "/tmp/py.curses.putwin.XXXXXX");
+ fd = mkstemp(fn);
+ if (fd < 0)
+ return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+ fp = fdopen(fd, "wb+");
+ if (fp == NULL) {
+ close(fd);
+ remove(fn);
+ return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+ }
+ res = PyCursesCheckERR(putwin(self->win, fp), "putwin");
+ if (res == NULL) {
fclose(fp);
remove(fn);
return res;
}
-
- static PyObject *
- PyCursesWindow_RedrawLine(PyCursesWindowObject *self, PyObject *args)
- {
- int beg, num;
- if (!PyArg_ParseTuple(args, "ii;beg,num", &beg, &num))
- return NULL;
- return PyCursesCheckERR(wredrawln(self->win,beg,num), "redrawln");
+ fseek(fp, 0, 0);
+ while (1) {
+ char buf[BUFSIZ];
+ Py_ssize_t n = fread(buf, 1, BUFSIZ, fp);
+ if (n <= 0)
+ break;
+ Py_DECREF(res);
+ res = PyObject_CallMethod(stream, "write", "y#", buf, n);
+ if (res == NULL)
+ break;
}
+ fclose(fp);
+ remove(fn);
+ return res;
+}
- static PyObject *
- PyCursesWindow_Refresh(PyCursesWindowObject *self, PyObject *args)
- {
- int pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol;
- int rtn;
+static PyObject *
+PyCursesWindow_RedrawLine(PyCursesWindowObject *self, PyObject *args)
+{
+ int beg, num;
+ if (!PyArg_ParseTuple(args, "ii;beg,num", &beg, &num))
+ return NULL;
+ return PyCursesCheckERR(wredrawln(self->win,beg,num), "redrawln");
+}
+
+static PyObject *
+PyCursesWindow_Refresh(PyCursesWindowObject *self, PyObject *args)
+{
+ int pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol;
+ int rtn;
#ifndef WINDOW_HAS_FLAGS
- if (0) {
+ if (0)
#else
- if (self->win->_flags & _ISPAD) {
+ if (self->win->_flags & _ISPAD)
#endif
- switch(PyTuple_Size(args)) {
- case 6:
- if (!PyArg_ParseTuple(args,
- "iiiiii;" \
- "pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol",
- &pminrow, &pmincol, &sminrow,
- &smincol, &smaxrow, &smaxcol))
- return NULL;
-
- Py_BEGIN_ALLOW_THREADS
- rtn = prefresh(self->win,
- pminrow, pmincol, sminrow,
- smincol, smaxrow, smaxcol);
- Py_END_ALLOW_THREADS
- return PyCursesCheckERR(rtn, "prefresh");
- default:
- PyErr_SetString(PyCursesError,
- "refresh() for a pad requires 6 arguments");
- return NULL;
- }
- } else {
- if (!PyArg_ParseTuple(args, ":refresh"))
+ {
+ switch(PyTuple_Size(args)) {
+ case 6:
+ if (!PyArg_ParseTuple(args,
+ "iiiiii;" \
+ "pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol",
+ &pminrow, &pmincol, &sminrow,
+ &smincol, &smaxrow, &smaxcol))
return NULL;
+
Py_BEGIN_ALLOW_THREADS
- rtn = wrefresh(self->win);
+ rtn = prefresh(self->win,
+ pminrow, pmincol, sminrow,
+ smincol, smaxrow, smaxcol);
Py_END_ALLOW_THREADS
return PyCursesCheckERR(rtn, "prefresh");
+ default:
+ PyErr_SetString(PyCursesError,
+ "refresh() for a pad requires 6 arguments");
+ return NULL;
}
- }
-
- static PyObject *
- PyCursesWindow_SetScrollRegion(PyCursesWindowObject *self, PyObject *args)
- {
- int x, y;
- if (!PyArg_ParseTuple(args,"ii;top, bottom",&y,&x))
+ } else {
+ if (!PyArg_ParseTuple(args, ":refresh"))
return NULL;
- return PyCursesCheckERR(wsetscrreg(self->win,y,x), "wsetscrreg");
+ Py_BEGIN_ALLOW_THREADS
+ rtn = wrefresh(self->win);
+ Py_END_ALLOW_THREADS
+ return PyCursesCheckERR(rtn, "prefresh");
}
+}
- static PyObject *
- PyCursesWindow_SubWin(PyCursesWindowObject *self, PyObject *args)
- {
- WINDOW *win;
- int nlines, ncols, begin_y, begin_x;
-
- nlines = 0;
- ncols = 0;
- switch (PyTuple_Size(args)) {
- case 2:
- if (!PyArg_ParseTuple(args,"ii;begin_y,begin_x",&begin_y,&begin_x))
- return NULL;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiii;nlines,ncols,begin_y,begin_x",
- &nlines,&ncols,&begin_y,&begin_x))
- return NULL;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "subwin requires 2 or 4 arguments");
- return NULL;
- }
+static PyObject *
+PyCursesWindow_SetScrollRegion(PyCursesWindowObject *self, PyObject *args)
+{
+ int x, y;
+ if (!PyArg_ParseTuple(args,"ii;top, bottom",&y,&x))
+ return NULL;
+ return PyCursesCheckERR(wsetscrreg(self->win,y,x), "wsetscrreg");
+}
+
+static PyObject *
+PyCursesWindow_SubWin(PyCursesWindowObject *self, PyObject *args)
+{
+ WINDOW *win;
+ int nlines, ncols, begin_y, begin_x;
+
+ nlines = 0;
+ ncols = 0;
+ switch (PyTuple_Size(args)) {
+ case 2:
+ if (!PyArg_ParseTuple(args,"ii;begin_y,begin_x",&begin_y,&begin_x))
+ return NULL;
+ break;
+ case 4:
+ if (!PyArg_ParseTuple(args, "iiii;nlines,ncols,begin_y,begin_x",
+ &nlines,&ncols,&begin_y,&begin_x))
+ return NULL;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "subwin requires 2 or 4 arguments");
+ return NULL;
+ }
- /* printf("Subwin: %i %i %i %i \n", nlines, ncols, begin_y, begin_x); */
+ /* printf("Subwin: %i %i %i %i \n", nlines, ncols, begin_y, begin_x); */
#ifdef WINDOW_HAS_FLAGS
- if (self->win->_flags & _ISPAD)
- win = subpad(self->win, nlines, ncols, begin_y, begin_x);
- else
+ if (self->win->_flags & _ISPAD)
+ win = subpad(self->win, nlines, ncols, begin_y, begin_x);
+ else
#endif
- win = subwin(self->win, nlines, ncols, begin_y, begin_x);
+ win = subwin(self->win, nlines, ncols, begin_y, begin_x);
- if (win == NULL) {
- PyErr_SetString(PyCursesError, catchall_NULL);
- return NULL;
- }
+ if (win == NULL) {
+ PyErr_SetString(PyCursesError, catchall_NULL);
+ return NULL;
+ }
- return (PyObject *)PyCursesWindow_New(win);
- }
+ return (PyObject *)PyCursesWindow_New(win);
+}
- static PyObject *
- PyCursesWindow_Scroll(PyCursesWindowObject *self, PyObject *args)
- {
- int nlines;
- switch(PyTuple_Size(args)) {
- case 0:
- return PyCursesCheckERR(scroll(self->win), "scroll");
- case 1:
- if (!PyArg_ParseTuple(args, "i;nlines", &nlines))
- return NULL;
- return PyCursesCheckERR(wscrl(self->win, nlines), "scroll");
- default:
- PyErr_SetString(PyExc_TypeError, "scroll requires 0 or 1 arguments");
- return NULL;
- }
- }
+static PyObject *
+PyCursesWindow_Scroll(PyCursesWindowObject *self, PyObject *args)
+{
+ int nlines;
+ switch(PyTuple_Size(args)) {
+ case 0:
+ return PyCursesCheckERR(scroll(self->win), "scroll");
+ case 1:
+ if (!PyArg_ParseTuple(args, "i;nlines", &nlines))
+ return NULL;
+ return PyCursesCheckERR(wscrl(self->win, nlines), "scroll");
+ default:
+ PyErr_SetString(PyExc_TypeError, "scroll requires 0 or 1 arguments");
+ return NULL;
+ }
+}
- static PyObject *
- PyCursesWindow_TouchLine(PyCursesWindowObject *self, PyObject *args)
- {
- int st, cnt, val;
- switch (PyTuple_Size(args)) {
- case 2:
- if (!PyArg_ParseTuple(args,"ii;start,count",&st,&cnt))
- return NULL;
- return PyCursesCheckERR(touchline(self->win,st,cnt), "touchline");
- case 3:
- if (!PyArg_ParseTuple(args, "iii;start,count,val", &st, &cnt, &val))
- return NULL;
- return PyCursesCheckERR(wtouchln(self->win, st, cnt, val), "touchline");
- default:
- PyErr_SetString(PyExc_TypeError, "touchline requires 2 or 3 arguments");
- return NULL;
- }
- }
+static PyObject *
+PyCursesWindow_TouchLine(PyCursesWindowObject *self, PyObject *args)
+{
+ int st, cnt, val;
+ switch (PyTuple_Size(args)) {
+ case 2:
+ if (!PyArg_ParseTuple(args,"ii;start,count",&st,&cnt))
+ return NULL;
+ return PyCursesCheckERR(touchline(self->win,st,cnt), "touchline");
+ case 3:
+ if (!PyArg_ParseTuple(args, "iii;start,count,val", &st, &cnt, &val))
+ return NULL;
+ return PyCursesCheckERR(wtouchln(self->win, st, cnt, val), "touchline");
+ default:
+ PyErr_SetString(PyExc_TypeError, "touchline requires 2 or 3 arguments");
+ return NULL;
+ }
+}
- static PyObject *
- PyCursesWindow_Vline(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *temp;
- chtype ch;
- int n, x, y, code = OK;
- attr_t attr = A_NORMAL;
- long lattr;
-
- switch (PyTuple_Size(args)) {
- case 2:
- if (!PyArg_ParseTuple(args, "Oi;ch or int,n", &temp, &n))
- return NULL;
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "Oil;ch or int,n,attr", &temp, &n, &lattr))
- return NULL;
- attr = lattr;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiOi;y,x,ch or int,n", &y, &x, &temp, &n))
- return NULL;
- code = wmove(self->win, y, x);
- break;
- case 5:
- if (!PyArg_ParseTuple(args, "iiOil; y,x,ch or int,n,attr",
- &y, &x, &temp, &n, &lattr))
- return NULL;
- attr = lattr;
- code = wmove(self->win, y, x);
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "vline requires 2 to 5 arguments");
- return NULL;
- }
+static PyObject *
+PyCursesWindow_Vline(PyCursesWindowObject *self, PyObject *args)
+{
+ PyObject *temp;
+ chtype ch;
+ int n, x, y, code = OK;
+ attr_t attr = A_NORMAL;
+ long lattr;
- if (code != ERR) {
- if (!PyCurses_ConvertToChtype(temp, &ch)) {
- PyErr_SetString(PyExc_TypeError,
- "argument 1 or 3 must be a ch or an int");
- return NULL;
- }
- return PyCursesCheckERR(wvline(self->win, ch | attr, n), "vline");
- } else
- return PyCursesCheckERR(code, "wmove");
+ switch (PyTuple_Size(args)) {
+ case 2:
+ if (!PyArg_ParseTuple(args, "Oi;ch or int,n", &temp, &n))
+ return NULL;
+ break;
+ case 3:
+ if (!PyArg_ParseTuple(args, "Oil;ch or int,n,attr", &temp, &n, &lattr))
+ return NULL;
+ attr = lattr;
+ break;
+ case 4:
+ if (!PyArg_ParseTuple(args, "iiOi;y,x,ch or int,n", &y, &x, &temp, &n))
+ return NULL;
+ code = wmove(self->win, y, x);
+ break;
+ case 5:
+ if (!PyArg_ParseTuple(args, "iiOil; y,x,ch or int,n,attr",
+ &y, &x, &temp, &n, &lattr))
+ return NULL;
+ attr = lattr;
+ code = wmove(self->win, y, x);
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "vline requires 2 to 5 arguments");
+ return NULL;
+ }
+
+ if (code != ERR) {
+ if (!PyCurses_ConvertToChtype(temp, &ch)) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument 1 or 3 must be a ch or an int");
+ return NULL;
}
+ return PyCursesCheckERR(wvline(self->win, ch | attr, n), "vline");
+ } else
+ return PyCursesCheckERR(code, "wmove");
+}
- static PyMethodDef PyCursesWindow_Methods[] = {
- {"addch", (PyCFunction)PyCursesWindow_AddCh, METH_VARARGS},
- {"addnstr", (PyCFunction)PyCursesWindow_AddNStr, METH_VARARGS},
- {"addstr", (PyCFunction)PyCursesWindow_AddStr, METH_VARARGS},
- {"attroff", (PyCFunction)PyCursesWindow_AttrOff, METH_VARARGS},
- {"attron", (PyCFunction)PyCursesWindow_AttrOn, METH_VARARGS},
- {"attrset", (PyCFunction)PyCursesWindow_AttrSet, METH_VARARGS},
- {"bkgd", (PyCFunction)PyCursesWindow_Bkgd, METH_VARARGS},
- {"chgat", (PyCFunction)PyCursesWindow_ChgAt, METH_VARARGS},
- {"bkgdset", (PyCFunction)PyCursesWindow_BkgdSet, METH_VARARGS},
- {"border", (PyCFunction)PyCursesWindow_Border, METH_VARARGS},
- {"box", (PyCFunction)PyCursesWindow_Box, METH_VARARGS},
- {"clear", (PyCFunction)PyCursesWindow_wclear, METH_NOARGS},
- {"clearok", (PyCFunction)PyCursesWindow_clearok, METH_VARARGS},
- {"clrtobot", (PyCFunction)PyCursesWindow_wclrtobot, METH_NOARGS},
- {"clrtoeol", (PyCFunction)PyCursesWindow_wclrtoeol, METH_NOARGS},
- {"cursyncup", (PyCFunction)PyCursesWindow_wcursyncup, METH_NOARGS},
- {"delch", (PyCFunction)PyCursesWindow_DelCh, METH_VARARGS},
- {"deleteln", (PyCFunction)PyCursesWindow_wdeleteln, METH_NOARGS},
- {"derwin", (PyCFunction)PyCursesWindow_DerWin, METH_VARARGS},
- {"echochar", (PyCFunction)PyCursesWindow_EchoChar, METH_VARARGS},
+static PyMethodDef PyCursesWindow_Methods[] = {
+ {"addch", (PyCFunction)PyCursesWindow_AddCh, METH_VARARGS},
+ {"addnstr", (PyCFunction)PyCursesWindow_AddNStr, METH_VARARGS},
+ {"addstr", (PyCFunction)PyCursesWindow_AddStr, METH_VARARGS},
+ {"attroff", (PyCFunction)PyCursesWindow_AttrOff, METH_VARARGS},
+ {"attron", (PyCFunction)PyCursesWindow_AttrOn, METH_VARARGS},
+ {"attrset", (PyCFunction)PyCursesWindow_AttrSet, METH_VARARGS},
+ {"bkgd", (PyCFunction)PyCursesWindow_Bkgd, METH_VARARGS},
+ {"chgat", (PyCFunction)PyCursesWindow_ChgAt, METH_VARARGS},
+ {"bkgdset", (PyCFunction)PyCursesWindow_BkgdSet, METH_VARARGS},
+ {"border", (PyCFunction)PyCursesWindow_Border, METH_VARARGS},
+ {"box", (PyCFunction)PyCursesWindow_Box, METH_VARARGS},
+ {"clear", (PyCFunction)PyCursesWindow_wclear, METH_NOARGS},
+ {"clearok", (PyCFunction)PyCursesWindow_clearok, METH_VARARGS},
+ {"clrtobot", (PyCFunction)PyCursesWindow_wclrtobot, METH_NOARGS},
+ {"clrtoeol", (PyCFunction)PyCursesWindow_wclrtoeol, METH_NOARGS},
+ {"cursyncup", (PyCFunction)PyCursesWindow_wcursyncup, METH_NOARGS},
+ {"delch", (PyCFunction)PyCursesWindow_DelCh, METH_VARARGS},
+ {"deleteln", (PyCFunction)PyCursesWindow_wdeleteln, METH_NOARGS},
+ {"derwin", (PyCFunction)PyCursesWindow_DerWin, METH_VARARGS},
+ {"echochar", (PyCFunction)PyCursesWindow_EchoChar, METH_VARARGS},
#ifdef NCURSES_MOUSE_VERSION
- {"enclose", (PyCFunction)PyCursesWindow_Enclose, METH_VARARGS},
+ {"enclose", (PyCFunction)PyCursesWindow_Enclose, METH_VARARGS},
#endif
- {"erase", (PyCFunction)PyCursesWindow_werase, METH_NOARGS},
- {"getbegyx", (PyCFunction)PyCursesWindow_getbegyx, METH_NOARGS},
- {"getbkgd", (PyCFunction)PyCursesWindow_GetBkgd, METH_NOARGS},
- {"getch", (PyCFunction)PyCursesWindow_GetCh, METH_VARARGS},
- {"getkey", (PyCFunction)PyCursesWindow_GetKey, METH_VARARGS},
- {"getmaxyx", (PyCFunction)PyCursesWindow_getmaxyx, METH_NOARGS},
- {"getparyx", (PyCFunction)PyCursesWindow_getparyx, METH_NOARGS},
- {"getstr", (PyCFunction)PyCursesWindow_GetStr, METH_VARARGS},
- {"getyx", (PyCFunction)PyCursesWindow_getyx, METH_NOARGS},
- {"hline", (PyCFunction)PyCursesWindow_Hline, METH_VARARGS},
- {"idcok", (PyCFunction)PyCursesWindow_idcok, METH_VARARGS},
- {"idlok", (PyCFunction)PyCursesWindow_idlok, METH_VARARGS},
- {"immedok", (PyCFunction)PyCursesWindow_immedok, METH_VARARGS},
- {"inch", (PyCFunction)PyCursesWindow_InCh, METH_VARARGS},
- {"insch", (PyCFunction)PyCursesWindow_InsCh, METH_VARARGS},
- {"insdelln", (PyCFunction)PyCursesWindow_winsdelln, METH_VARARGS},
- {"insertln", (PyCFunction)PyCursesWindow_winsertln, METH_NOARGS},
- {"insnstr", (PyCFunction)PyCursesWindow_InsNStr, METH_VARARGS},
- {"insstr", (PyCFunction)PyCursesWindow_InsStr, METH_VARARGS},
- {"instr", (PyCFunction)PyCursesWindow_InStr, METH_VARARGS},
- {"is_linetouched", (PyCFunction)PyCursesWindow_Is_LineTouched, METH_VARARGS},
- {"is_wintouched", (PyCFunction)PyCursesWindow_is_wintouched, METH_NOARGS},
- {"keypad", (PyCFunction)PyCursesWindow_keypad, METH_VARARGS},
- {"leaveok", (PyCFunction)PyCursesWindow_leaveok, METH_VARARGS},
- {"move", (PyCFunction)PyCursesWindow_wmove, METH_VARARGS},
- {"mvderwin", (PyCFunction)PyCursesWindow_mvderwin, METH_VARARGS},
- {"mvwin", (PyCFunction)PyCursesWindow_mvwin, METH_VARARGS},
- {"nodelay", (PyCFunction)PyCursesWindow_nodelay, METH_VARARGS},
- {"notimeout", (PyCFunction)PyCursesWindow_notimeout, METH_VARARGS},
- {"noutrefresh", (PyCFunction)PyCursesWindow_NoOutRefresh, METH_VARARGS},
- /* Backward compatibility alias -- remove in Python 2.3 */
- {"nooutrefresh", (PyCFunction)PyCursesWindow_NoOutRefresh, METH_VARARGS},
- {"overlay", (PyCFunction)PyCursesWindow_Overlay, METH_VARARGS},
- {"overwrite", (PyCFunction)PyCursesWindow_Overwrite,
- METH_VARARGS},
- {"putwin", (PyCFunction)PyCursesWindow_PutWin, METH_O},
- {"redrawln", (PyCFunction)PyCursesWindow_RedrawLine, METH_VARARGS},
- {"redrawwin", (PyCFunction)PyCursesWindow_redrawwin, METH_NOARGS},
- {"refresh", (PyCFunction)PyCursesWindow_Refresh, METH_VARARGS},
+ {"erase", (PyCFunction)PyCursesWindow_werase, METH_NOARGS},
+ {"getbegyx", (PyCFunction)PyCursesWindow_getbegyx, METH_NOARGS},
+ {"getbkgd", (PyCFunction)PyCursesWindow_GetBkgd, METH_NOARGS},
+ {"getch", (PyCFunction)PyCursesWindow_GetCh, METH_VARARGS},
+ {"getkey", (PyCFunction)PyCursesWindow_GetKey, METH_VARARGS},
+ {"getmaxyx", (PyCFunction)PyCursesWindow_getmaxyx, METH_NOARGS},
+ {"getparyx", (PyCFunction)PyCursesWindow_getparyx, METH_NOARGS},
+ {"getstr", (PyCFunction)PyCursesWindow_GetStr, METH_VARARGS},
+ {"getyx", (PyCFunction)PyCursesWindow_getyx, METH_NOARGS},
+ {"hline", (PyCFunction)PyCursesWindow_Hline, METH_VARARGS},
+ {"idcok", (PyCFunction)PyCursesWindow_idcok, METH_VARARGS},
+ {"idlok", (PyCFunction)PyCursesWindow_idlok, METH_VARARGS},
+ {"immedok", (PyCFunction)PyCursesWindow_immedok, METH_VARARGS},
+ {"inch", (PyCFunction)PyCursesWindow_InCh, METH_VARARGS},
+ {"insch", (PyCFunction)PyCursesWindow_InsCh, METH_VARARGS},
+ {"insdelln", (PyCFunction)PyCursesWindow_winsdelln, METH_VARARGS},
+ {"insertln", (PyCFunction)PyCursesWindow_winsertln, METH_NOARGS},
+ {"insnstr", (PyCFunction)PyCursesWindow_InsNStr, METH_VARARGS},
+ {"insstr", (PyCFunction)PyCursesWindow_InsStr, METH_VARARGS},
+ {"instr", (PyCFunction)PyCursesWindow_InStr, METH_VARARGS},
+ {"is_linetouched", (PyCFunction)PyCursesWindow_Is_LineTouched, METH_VARARGS},
+ {"is_wintouched", (PyCFunction)PyCursesWindow_is_wintouched, METH_NOARGS},
+ {"keypad", (PyCFunction)PyCursesWindow_keypad, METH_VARARGS},
+ {"leaveok", (PyCFunction)PyCursesWindow_leaveok, METH_VARARGS},
+ {"move", (PyCFunction)PyCursesWindow_wmove, METH_VARARGS},
+ {"mvderwin", (PyCFunction)PyCursesWindow_mvderwin, METH_VARARGS},
+ {"mvwin", (PyCFunction)PyCursesWindow_mvwin, METH_VARARGS},
+ {"nodelay", (PyCFunction)PyCursesWindow_nodelay, METH_VARARGS},
+ {"notimeout", (PyCFunction)PyCursesWindow_notimeout, METH_VARARGS},
+ {"noutrefresh", (PyCFunction)PyCursesWindow_NoOutRefresh, METH_VARARGS},
+ /* Backward compatibility alias -- remove in Python 2.3 */
+ {"nooutrefresh", (PyCFunction)PyCursesWindow_NoOutRefresh, METH_VARARGS},
+ {"overlay", (PyCFunction)PyCursesWindow_Overlay, METH_VARARGS},
+ {"overwrite", (PyCFunction)PyCursesWindow_Overwrite,
+ METH_VARARGS},
+ {"putwin", (PyCFunction)PyCursesWindow_PutWin, METH_O},
+ {"redrawln", (PyCFunction)PyCursesWindow_RedrawLine, METH_VARARGS},
+ {"redrawwin", (PyCFunction)PyCursesWindow_redrawwin, METH_NOARGS},
+ {"refresh", (PyCFunction)PyCursesWindow_Refresh, METH_VARARGS},
#ifndef STRICT_SYSV_CURSES
- {"resize", (PyCFunction)PyCursesWindow_wresize, METH_VARARGS},
+ {"resize", (PyCFunction)PyCursesWindow_wresize, METH_VARARGS},
#endif
- {"scroll", (PyCFunction)PyCursesWindow_Scroll, METH_VARARGS},
- {"scrollok", (PyCFunction)PyCursesWindow_scrollok, METH_VARARGS},
- {"setscrreg", (PyCFunction)PyCursesWindow_SetScrollRegion, METH_VARARGS},
- {"standend", (PyCFunction)PyCursesWindow_wstandend, METH_NOARGS},
- {"standout", (PyCFunction)PyCursesWindow_wstandout, METH_NOARGS},
- {"subpad", (PyCFunction)PyCursesWindow_SubWin, METH_VARARGS},
- {"subwin", (PyCFunction)PyCursesWindow_SubWin, METH_VARARGS},
- {"syncdown", (PyCFunction)PyCursesWindow_wsyncdown, METH_NOARGS},
- {"syncok", (PyCFunction)PyCursesWindow_syncok, METH_VARARGS},
- {"syncup", (PyCFunction)PyCursesWindow_wsyncup, METH_NOARGS},
- {"timeout", (PyCFunction)PyCursesWindow_wtimeout, METH_VARARGS},
- {"touchline", (PyCFunction)PyCursesWindow_TouchLine, METH_VARARGS},
- {"touchwin", (PyCFunction)PyCursesWindow_touchwin, METH_NOARGS},
- {"untouchwin", (PyCFunction)PyCursesWindow_untouchwin, METH_NOARGS},
- {"vline", (PyCFunction)PyCursesWindow_Vline, METH_VARARGS},
- {NULL, NULL} /* sentinel */
- };
+ {"scroll", (PyCFunction)PyCursesWindow_Scroll, METH_VARARGS},
+ {"scrollok", (PyCFunction)PyCursesWindow_scrollok, METH_VARARGS},
+ {"setscrreg", (PyCFunction)PyCursesWindow_SetScrollRegion, METH_VARARGS},
+ {"standend", (PyCFunction)PyCursesWindow_wstandend, METH_NOARGS},
+ {"standout", (PyCFunction)PyCursesWindow_wstandout, METH_NOARGS},
+ {"subpad", (PyCFunction)PyCursesWindow_SubWin, METH_VARARGS},
+ {"subwin", (PyCFunction)PyCursesWindow_SubWin, METH_VARARGS},
+ {"syncdown", (PyCFunction)PyCursesWindow_wsyncdown, METH_NOARGS},
+ {"syncok", (PyCFunction)PyCursesWindow_syncok, METH_VARARGS},
+ {"syncup", (PyCFunction)PyCursesWindow_wsyncup, METH_NOARGS},
+ {"timeout", (PyCFunction)PyCursesWindow_wtimeout, METH_VARARGS},
+ {"touchline", (PyCFunction)PyCursesWindow_TouchLine, METH_VARARGS},
+ {"touchwin", (PyCFunction)PyCursesWindow_touchwin, METH_NOARGS},
+ {"untouchwin", (PyCFunction)PyCursesWindow_untouchwin, METH_NOARGS},
+ {"vline", (PyCFunction)PyCursesWindow_Vline, METH_VARARGS},
+ {NULL, NULL} /* sentinel */
+};
/* -------------------------------------------------------*/
- PyTypeObject PyCursesWindow_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "_curses.curses window", /*tp_name*/
- sizeof(PyCursesWindowObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)PyCursesWindow_Dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- (getattrfunc)0, /*tp_getattr*/
- (setattrfunc)0, /*tp_setattr*/
- 0, /*tp_reserved*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT, /*tp_flags*/
- 0, /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- PyCursesWindow_Methods, /*tp_methods*/
- };
+PyTypeObject PyCursesWindow_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_curses.curses window", /*tp_name*/
+ sizeof(PyCursesWindowObject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ /* methods */
+ (destructor)PyCursesWindow_Dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ (getattrfunc)0, /*tp_getattr*/
+ (setattrfunc)0, /*tp_setattr*/
+ 0, /*tp_reserved*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT, /*tp_flags*/
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ PyCursesWindow_Methods, /*tp_methods*/
+};
/*********************************************************************
Global Functions
**********************************************************************/
- NoArgNoReturnFunction(beep)
- NoArgNoReturnFunction(def_prog_mode)
- NoArgNoReturnFunction(def_shell_mode)
- NoArgNoReturnFunction(doupdate)
- NoArgNoReturnFunction(endwin)
- NoArgNoReturnFunction(flash)
- NoArgNoReturnFunction(nocbreak)
- NoArgNoReturnFunction(noecho)
- NoArgNoReturnFunction(nonl)
- NoArgNoReturnFunction(noraw)
- NoArgNoReturnFunction(reset_prog_mode)
- NoArgNoReturnFunction(reset_shell_mode)
- NoArgNoReturnFunction(resetty)
- NoArgNoReturnFunction(savetty)
-
- NoArgOrFlagNoReturnFunction(cbreak)
- NoArgOrFlagNoReturnFunction(echo)
- NoArgOrFlagNoReturnFunction(nl)
- NoArgOrFlagNoReturnFunction(raw)
-
- NoArgReturnIntFunction(baudrate)
- NoArgReturnIntFunction(termattrs)
-
- NoArgReturnStringFunction(termname)
- NoArgReturnStringFunction(longname)
-
- NoArgTrueFalseFunction(can_change_color)
- NoArgTrueFalseFunction(has_colors)
- NoArgTrueFalseFunction(has_ic)
- NoArgTrueFalseFunction(has_il)
- NoArgTrueFalseFunction(isendwin)
- NoArgNoReturnVoidFunction(flushinp)
- NoArgNoReturnVoidFunction(noqiflush)
-
- static PyObject *
- PyCurses_filter(PyObject *self)
- {
- /* not checking for PyCursesInitialised here since filter() must
- be called before initscr() */
- filter();
- Py_INCREF(Py_None);
- return Py_None;
- }
+NoArgNoReturnFunction(beep)
+NoArgNoReturnFunction(def_prog_mode)
+NoArgNoReturnFunction(def_shell_mode)
+NoArgNoReturnFunction(doupdate)
+NoArgNoReturnFunction(endwin)
+NoArgNoReturnFunction(flash)
+NoArgNoReturnFunction(nocbreak)
+NoArgNoReturnFunction(noecho)
+NoArgNoReturnFunction(nonl)
+NoArgNoReturnFunction(noraw)
+NoArgNoReturnFunction(reset_prog_mode)
+NoArgNoReturnFunction(reset_shell_mode)
+NoArgNoReturnFunction(resetty)
+NoArgNoReturnFunction(savetty)
+
+NoArgOrFlagNoReturnFunction(cbreak)
+NoArgOrFlagNoReturnFunction(echo)
+NoArgOrFlagNoReturnFunction(nl)
+NoArgOrFlagNoReturnFunction(raw)
+
+NoArgReturnIntFunction(baudrate)
+NoArgReturnIntFunction(termattrs)
+
+NoArgReturnStringFunction(termname)
+NoArgReturnStringFunction(longname)
+
+NoArgTrueFalseFunction(can_change_color)
+NoArgTrueFalseFunction(has_colors)
+NoArgTrueFalseFunction(has_ic)
+NoArgTrueFalseFunction(has_il)
+NoArgTrueFalseFunction(isendwin)
+NoArgNoReturnVoidFunction(flushinp)
+NoArgNoReturnVoidFunction(noqiflush)
- static PyObject *
- PyCurses_Color_Content(PyObject *self, PyObject *args)
- {
- short color,r,g,b;
+static PyObject *
+PyCurses_filter(PyObject *self)
+{
+ /* not checking for PyCursesInitialised here since filter() must
+ be called before initscr() */
+ filter();
+ Py_INCREF(Py_None);
+ return Py_None;
+}
- PyCursesInitialised
- PyCursesInitialisedColor
+static PyObject *
+PyCurses_Color_Content(PyObject *self, PyObject *args)
+{
+ short color,r,g,b;
- if (!PyArg_ParseTuple(args, "h:color_content", &color)) return NULL;
+ PyCursesInitialised;
+ PyCursesInitialisedColor;
- if (color_content(color, &r, &g, &b) != ERR)
- return Py_BuildValue("(iii)", r, g, b);
- else {
- PyErr_SetString(PyCursesError,
- "Argument 1 was out of range. Check value of COLORS.");
- return NULL;
- }
- }
+ if (!PyArg_ParseTuple(args, "h:color_content", &color)) return NULL;
- static PyObject *
- PyCurses_color_pair(PyObject *self, PyObject *args)
- {
- int n;
+ if (color_content(color, &r, &g, &b) != ERR)
+ return Py_BuildValue("(iii)", r, g, b);
+ else {
+ PyErr_SetString(PyCursesError,
+ "Argument 1 was out of range. Check value of COLORS.");
+ return NULL;
+ }
+}
- PyCursesInitialised
- PyCursesInitialisedColor
+static PyObject *
+PyCurses_color_pair(PyObject *self, PyObject *args)
+{
+ int n;
- if (!PyArg_ParseTuple(args, "i:color_pair", &n)) return NULL;
- return PyLong_FromLong((long) (n << 8));
- }
+ PyCursesInitialised;
+ PyCursesInitialisedColor;
- static PyObject *
- PyCurses_Curs_Set(PyObject *self, PyObject *args)
- {
- int vis,erg;
+ if (!PyArg_ParseTuple(args, "i:color_pair", &n)) return NULL;
+ return PyLong_FromLong((long) (n << 8));
+}
- PyCursesInitialised
+static PyObject *
+PyCurses_Curs_Set(PyObject *self, PyObject *args)
+{
+ int vis,erg;
- if (!PyArg_ParseTuple(args, "i:curs_set", &vis)) return NULL;
+ PyCursesInitialised;
- erg = curs_set(vis);
- if (erg == ERR) return PyCursesCheckERR(erg, "curs_set");
+ if (!PyArg_ParseTuple(args, "i:curs_set", &vis)) return NULL;
- return PyLong_FromLong((long) erg);
- }
+ erg = curs_set(vis);
+ if (erg == ERR) return PyCursesCheckERR(erg, "curs_set");
- static PyObject *
- PyCurses_Delay_Output(PyObject *self, PyObject *args)
- {
- int ms;
+ return PyLong_FromLong((long) erg);
+}
- PyCursesInitialised
+static PyObject *
+PyCurses_Delay_Output(PyObject *self, PyObject *args)
+{
+ int ms;
- if (!PyArg_ParseTuple(args, "i:delay_output", &ms)) return NULL;
+ PyCursesInitialised;
- return PyCursesCheckERR(delay_output(ms), "delay_output");
- }
+ if (!PyArg_ParseTuple(args, "i:delay_output", &ms)) return NULL;
- static PyObject *
- PyCurses_EraseChar(PyObject *self)
- {
- char ch;
+ return PyCursesCheckERR(delay_output(ms), "delay_output");
+}
- PyCursesInitialised
+static PyObject *
+PyCurses_EraseChar(PyObject *self)
+{
+ char ch;
- ch = erasechar();
+ PyCursesInitialised;
- return PyBytes_FromStringAndSize(&ch, 1);
- }
+ ch = erasechar();
- static PyObject *
- PyCurses_getsyx(PyObject *self)
- {
- int x = 0;
- int y = 0;
+ return PyBytes_FromStringAndSize(&ch, 1);
+}
- PyCursesInitialised
+static PyObject *
+PyCurses_getsyx(PyObject *self)
+{
+ int x = 0;
+ int y = 0;
- getsyx(y, x);
+ PyCursesInitialised;
- return Py_BuildValue("(ii)", y, x);
- }
+ getsyx(y, x);
+
+ return Py_BuildValue("(ii)", y, x);
+}
#ifdef NCURSES_MOUSE_VERSION
- static PyObject *
- PyCurses_GetMouse(PyObject *self)
- {
- int rtn;
- MEVENT event;
+static PyObject *
+PyCurses_GetMouse(PyObject *self)
+{
+ int rtn;
+ MEVENT event;
- PyCursesInitialised
+ PyCursesInitialised;
- rtn = getmouse( &event );
- if (rtn == ERR) {
- PyErr_SetString(PyCursesError, "getmouse() returned ERR");
- return NULL;
- }
- return Py_BuildValue("(hiiil)",
- (short)event.id,
- event.x, event.y, event.z,
- (long) event.bstate);
- }
+ rtn = getmouse( &event );
+ if (rtn == ERR) {
+ PyErr_SetString(PyCursesError, "getmouse() returned ERR");
+ return NULL;
+ }
+ return Py_BuildValue("(hiiil)",
+ (short)event.id,
+ event.x, event.y, event.z,
+ (long) event.bstate);
+}
- static PyObject *
- PyCurses_UngetMouse(PyObject *self, PyObject *args)
- {
- MEVENT event;
+static PyObject *
+PyCurses_UngetMouse(PyObject *self, PyObject *args)
+{
+ MEVENT event;
- PyCursesInitialised
- if (!PyArg_ParseTuple(args, "hiiil",
- &event.id,
- &event.x, &event.y, &event.z,
- (int *) &event.bstate))
- return NULL;
+ PyCursesInitialised;
+ if (!PyArg_ParseTuple(args, "hiiil",
+ &event.id,
+ &event.x, &event.y, &event.z,
+ (int *) &event.bstate))
+ return NULL;
- return PyCursesCheckERR(ungetmouse(&event), "ungetmouse");
- }
+ return PyCursesCheckERR(ungetmouse(&event), "ungetmouse");
+}
#endif
- static PyObject *
- PyCurses_GetWin(PyCursesWindowObject *self, PyObject *stream)
- {
- char fn[100];
- int fd;
- FILE *fp;
- PyObject *data;
- size_t datalen;
- WINDOW *win;
-
- PyCursesInitialised
-
- strcpy(fn, "/tmp/py.curses.getwin.XXXXXX");
- fd = mkstemp(fn);
- if (fd < 0)
- return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
- fp = fdopen(fd, "wb+");
- if (fp == NULL) {
- close(fd);
- remove(fn);
- return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
- }
- data = PyObject_CallMethod(stream, "read", "");
- if (data == NULL) {
- fclose(fp);
- remove(fn);
- return NULL;
- }
- if (!PyBytes_Check(data)) {
- PyErr_Format(PyExc_TypeError,
- "f.read() returned %.100s instead of bytes",
- data->ob_type->tp_name);
- Py_DECREF(data);
- fclose(fp);
- remove(fn);
- return NULL;
- }
- datalen = PyBytes_GET_SIZE(data);
- if (fwrite(PyBytes_AS_STRING(data), 1, datalen, fp) != datalen) {
- Py_DECREF(data);
- fclose(fp);
- remove(fn);
- return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
- }
- Py_DECREF(data);
- fseek(fp, 0, 0);
- win = getwin(fp);
- fclose(fp);
- remove(fn);
- if (win == NULL) {
- PyErr_SetString(PyCursesError, catchall_NULL);
- return NULL;
- }
- return PyCursesWindow_New(win);
- }
+static PyObject *
+PyCurses_GetWin(PyCursesWindowObject *self, PyObject *stream)
+{
+ char fn[100];
+ int fd;
+ FILE *fp;
+ PyObject *data;
+ size_t datalen;
+ WINDOW *win;
- static PyObject *
- PyCurses_HalfDelay(PyObject *self, PyObject *args)
- {
- unsigned char tenths;
+ PyCursesInitialised;
+
+ strcpy(fn, "/tmp/py.curses.getwin.XXXXXX");
+ fd = mkstemp(fn);
+ if (fd < 0)
+ return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+ fp = fdopen(fd, "wb+");
+ if (fp == NULL) {
+ close(fd);
+ remove(fn);
+ return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+ }
+ data = PyObject_CallMethod(stream, "read", "");
+ if (data == NULL) {
+ fclose(fp);
+ remove(fn);
+ return NULL;
+ }
+ if (!PyBytes_Check(data)) {
+ PyErr_Format(PyExc_TypeError,
+ "f.read() returned %.100s instead of bytes",
+ data->ob_type->tp_name);
+ Py_DECREF(data);
+ fclose(fp);
+ remove(fn);
+ return NULL;
+ }
+ datalen = PyBytes_GET_SIZE(data);
+ if (fwrite(PyBytes_AS_STRING(data), 1, datalen, fp) != datalen) {
+ Py_DECREF(data);
+ fclose(fp);
+ remove(fn);
+ return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+ }
+ Py_DECREF(data);
+ fseek(fp, 0, 0);
+ win = getwin(fp);
+ fclose(fp);
+ remove(fn);
+ if (win == NULL) {
+ PyErr_SetString(PyCursesError, catchall_NULL);
+ return NULL;
+ }
+ return PyCursesWindow_New(win);
+}
- PyCursesInitialised
+static PyObject *
+PyCurses_HalfDelay(PyObject *self, PyObject *args)
+{
+ unsigned char tenths;
- if (!PyArg_ParseTuple(args, "b:halfdelay", &tenths)) return NULL;
+ PyCursesInitialised;
- return PyCursesCheckERR(halfdelay(tenths), "halfdelay");
- }
+ if (!PyArg_ParseTuple(args, "b:halfdelay", &tenths)) return NULL;
+
+ return PyCursesCheckERR(halfdelay(tenths), "halfdelay");
+}
#ifndef STRICT_SYSV_CURSES
- /* No has_key! */
- static PyObject * PyCurses_has_key(PyObject *self, PyObject *args)
- {
- int ch;
+/* No has_key! */
+static PyObject * PyCurses_has_key(PyObject *self, PyObject *args)
+{
+ int ch;
- PyCursesInitialised
+ PyCursesInitialised;
- if (!PyArg_ParseTuple(args,"i",&ch)) return NULL;
+ if (!PyArg_ParseTuple(args,"i",&ch)) return NULL;
- if (has_key(ch) == FALSE) {
- Py_INCREF(Py_False);
- return Py_False;
- }
- Py_INCREF(Py_True);
- return Py_True;
- }
+ if (has_key(ch) == FALSE) {
+ Py_INCREF(Py_False);
+ return Py_False;
+ }
+ Py_INCREF(Py_True);
+ return Py_True;
+}
#endif /* STRICT_SYSV_CURSES */
- static PyObject *
- PyCurses_Init_Color(PyObject *self, PyObject *args)
- {
- short color, r, g, b;
+static PyObject *
+PyCurses_Init_Color(PyObject *self, PyObject *args)
+{
+ short color, r, g, b;
- PyCursesInitialised
- PyCursesInitialisedColor
+ PyCursesInitialised;
+ PyCursesInitialisedColor;
- switch(PyTuple_Size(args)) {
- case 4:
- if (!PyArg_ParseTuple(args, "hhhh;color,r,g,b", &color, &r, &g, &b)) return NULL;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "init_color requires 4 arguments");
- return NULL;
- }
+ switch(PyTuple_Size(args)) {
+ case 4:
+ if (!PyArg_ParseTuple(args, "hhhh;color,r,g,b", &color, &r, &g, &b)) return NULL;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "init_color requires 4 arguments");
+ return NULL;
+ }
- return PyCursesCheckERR(init_color(color, r, g, b), "init_color");
- }
+ return PyCursesCheckERR(init_color(color, r, g, b), "init_color");
+}
- static PyObject *
- PyCurses_Init_Pair(PyObject *self, PyObject *args)
- {
- short pair, f, b;
+static PyObject *
+PyCurses_Init_Pair(PyObject *self, PyObject *args)
+{
+ short pair, f, b;
- PyCursesInitialised
- PyCursesInitialisedColor
+ PyCursesInitialised;
+ PyCursesInitialisedColor;
- if (PyTuple_Size(args) != 3) {
- PyErr_SetString(PyExc_TypeError, "init_pair requires 3 arguments");
- return NULL;
- }
+ if (PyTuple_Size(args) != 3) {
+ PyErr_SetString(PyExc_TypeError, "init_pair requires 3 arguments");
+ return NULL;
+ }
- if (!PyArg_ParseTuple(args, "hhh;pair, f, b", &pair, &f, &b)) return NULL;
+ if (!PyArg_ParseTuple(args, "hhh;pair, f, b", &pair, &f, &b)) return NULL;
- return PyCursesCheckERR(init_pair(pair, f, b), "init_pair");
- }
+ return PyCursesCheckERR(init_pair(pair, f, b), "init_pair");
+}
- static PyObject *ModDict;
+static PyObject *ModDict;
- static PyObject *
- PyCurses_InitScr(PyObject *self)
- {
- WINDOW *win;
+static PyObject *
+PyCurses_InitScr(PyObject *self)
+{
+ WINDOW *win;
- if (initialised == TRUE) {
- wrefresh(stdscr);
- return (PyObject *)PyCursesWindow_New(stdscr);
- }
+ if (initialised == TRUE) {
+ wrefresh(stdscr);
+ return (PyObject *)PyCursesWindow_New(stdscr);
+ }
- win = initscr();
+ win = initscr();
- if (win == NULL) {
- PyErr_SetString(PyCursesError, catchall_NULL);
- return NULL;
- }
+ if (win == NULL) {
+ PyErr_SetString(PyCursesError, catchall_NULL);
+ return NULL;
+ }
- initialised = initialised_setupterm = TRUE;
+ initialised = initialised_setupterm = TRUE;
/* This was moved from initcurses() because it core dumped on SGI,
where they're not defined until you've called initscr() */
#define SetDictInt(string,ch) \
- do { \
- PyObject *o = PyLong_FromLong((long) (ch)); \
- if (o && PyDict_SetItemString(ModDict, string, o) == 0) { \
- Py_DECREF(o); \
- } \
- } while (0)
-
- /* Here are some graphic symbols you can use */
- SetDictInt("ACS_ULCORNER", (ACS_ULCORNER));
- SetDictInt("ACS_LLCORNER", (ACS_LLCORNER));
- SetDictInt("ACS_URCORNER", (ACS_URCORNER));
- SetDictInt("ACS_LRCORNER", (ACS_LRCORNER));
- SetDictInt("ACS_LTEE", (ACS_LTEE));
- SetDictInt("ACS_RTEE", (ACS_RTEE));
- SetDictInt("ACS_BTEE", (ACS_BTEE));
- SetDictInt("ACS_TTEE", (ACS_TTEE));
- SetDictInt("ACS_HLINE", (ACS_HLINE));
- SetDictInt("ACS_VLINE", (ACS_VLINE));
- SetDictInt("ACS_PLUS", (ACS_PLUS));
+ do { \
+ PyObject *o = PyLong_FromLong((long) (ch)); \
+ if (o && PyDict_SetItemString(ModDict, string, o) == 0) { \
+ Py_DECREF(o); \
+ } \
+ } while (0)
+
+ /* Here are some graphic symbols you can use */
+ SetDictInt("ACS_ULCORNER", (ACS_ULCORNER));
+ SetDictInt("ACS_LLCORNER", (ACS_LLCORNER));
+ SetDictInt("ACS_URCORNER", (ACS_URCORNER));
+ SetDictInt("ACS_LRCORNER", (ACS_LRCORNER));
+ SetDictInt("ACS_LTEE", (ACS_LTEE));
+ SetDictInt("ACS_RTEE", (ACS_RTEE));
+ SetDictInt("ACS_BTEE", (ACS_BTEE));
+ SetDictInt("ACS_TTEE", (ACS_TTEE));
+ SetDictInt("ACS_HLINE", (ACS_HLINE));
+ SetDictInt("ACS_VLINE", (ACS_VLINE));
+ SetDictInt("ACS_PLUS", (ACS_PLUS));
#if !defined(__hpux) || defined(HAVE_NCURSES_H)
- /* On HP/UX 11, these are of type cchar_t, which is not an
- integral type. If this is a problem on more platforms, a
- configure test should be added to determine whether ACS_S1
- is of integral type. */
- SetDictInt("ACS_S1", (ACS_S1));
- SetDictInt("ACS_S9", (ACS_S9));
- SetDictInt("ACS_DIAMOND", (ACS_DIAMOND));
- SetDictInt("ACS_CKBOARD", (ACS_CKBOARD));
- SetDictInt("ACS_DEGREE", (ACS_DEGREE));
- SetDictInt("ACS_PLMINUS", (ACS_PLMINUS));
- SetDictInt("ACS_BULLET", (ACS_BULLET));
- SetDictInt("ACS_LARROW", (ACS_LARROW));
- SetDictInt("ACS_RARROW", (ACS_RARROW));
- SetDictInt("ACS_DARROW", (ACS_DARROW));
- SetDictInt("ACS_UARROW", (ACS_UARROW));
- SetDictInt("ACS_BOARD", (ACS_BOARD));
- SetDictInt("ACS_LANTERN", (ACS_LANTERN));
- SetDictInt("ACS_BLOCK", (ACS_BLOCK));
+ /* On HP/UX 11, these are of type cchar_t, which is not an
+ integral type. If this is a problem on more platforms, a
+ configure test should be added to determine whether ACS_S1
+ is of integral type. */
+ SetDictInt("ACS_S1", (ACS_S1));
+ SetDictInt("ACS_S9", (ACS_S9));
+ SetDictInt("ACS_DIAMOND", (ACS_DIAMOND));
+ SetDictInt("ACS_CKBOARD", (ACS_CKBOARD));
+ SetDictInt("ACS_DEGREE", (ACS_DEGREE));
+ SetDictInt("ACS_PLMINUS", (ACS_PLMINUS));
+ SetDictInt("ACS_BULLET", (ACS_BULLET));
+ SetDictInt("ACS_LARROW", (ACS_LARROW));
+ SetDictInt("ACS_RARROW", (ACS_RARROW));
+ SetDictInt("ACS_DARROW", (ACS_DARROW));
+ SetDictInt("ACS_UARROW", (ACS_UARROW));
+ SetDictInt("ACS_BOARD", (ACS_BOARD));
+ SetDictInt("ACS_LANTERN", (ACS_LANTERN));
+ SetDictInt("ACS_BLOCK", (ACS_BLOCK));
#endif
- SetDictInt("ACS_BSSB", (ACS_ULCORNER));
- SetDictInt("ACS_SSBB", (ACS_LLCORNER));
- SetDictInt("ACS_BBSS", (ACS_URCORNER));
- SetDictInt("ACS_SBBS", (ACS_LRCORNER));
- SetDictInt("ACS_SBSS", (ACS_RTEE));
- SetDictInt("ACS_SSSB", (ACS_LTEE));
- SetDictInt("ACS_SSBS", (ACS_BTEE));
- SetDictInt("ACS_BSSS", (ACS_TTEE));
- SetDictInt("ACS_BSBS", (ACS_HLINE));
- SetDictInt("ACS_SBSB", (ACS_VLINE));
- SetDictInt("ACS_SSSS", (ACS_PLUS));
-
- /* The following are never available with strict SYSV curses */
+ SetDictInt("ACS_BSSB", (ACS_ULCORNER));
+ SetDictInt("ACS_SSBB", (ACS_LLCORNER));
+ SetDictInt("ACS_BBSS", (ACS_URCORNER));
+ SetDictInt("ACS_SBBS", (ACS_LRCORNER));
+ SetDictInt("ACS_SBSS", (ACS_RTEE));
+ SetDictInt("ACS_SSSB", (ACS_LTEE));
+ SetDictInt("ACS_SSBS", (ACS_BTEE));
+ SetDictInt("ACS_BSSS", (ACS_TTEE));
+ SetDictInt("ACS_BSBS", (ACS_HLINE));
+ SetDictInt("ACS_SBSB", (ACS_VLINE));
+ SetDictInt("ACS_SSSS", (ACS_PLUS));
+
+ /* The following are never available with strict SYSV curses */
#ifdef ACS_S3
- SetDictInt("ACS_S3", (ACS_S3));
+ SetDictInt("ACS_S3", (ACS_S3));
#endif
#ifdef ACS_S7
- SetDictInt("ACS_S7", (ACS_S7));
+ SetDictInt("ACS_S7", (ACS_S7));
#endif
#ifdef ACS_LEQUAL
- SetDictInt("ACS_LEQUAL", (ACS_LEQUAL));
+ SetDictInt("ACS_LEQUAL", (ACS_LEQUAL));
#endif
#ifdef ACS_GEQUAL
- SetDictInt("ACS_GEQUAL", (ACS_GEQUAL));
+ SetDictInt("ACS_GEQUAL", (ACS_GEQUAL));
#endif
#ifdef ACS_PI
- SetDictInt("ACS_PI", (ACS_PI));
+ SetDictInt("ACS_PI", (ACS_PI));
#endif
#ifdef ACS_NEQUAL
- SetDictInt("ACS_NEQUAL", (ACS_NEQUAL));
+ SetDictInt("ACS_NEQUAL", (ACS_NEQUAL));
#endif
#ifdef ACS_STERLING
- SetDictInt("ACS_STERLING", (ACS_STERLING));
+ SetDictInt("ACS_STERLING", (ACS_STERLING));
#endif
- SetDictInt("LINES", LINES);
- SetDictInt("COLS", COLS);
+ SetDictInt("LINES", LINES);
+ SetDictInt("COLS", COLS);
- return (PyObject *)PyCursesWindow_New(win);
- }
+ return (PyObject *)PyCursesWindow_New(win);
+}
- static PyObject *
- PyCurses_setupterm(PyObject* self, PyObject *args, PyObject* keywds)
- {
- int fd = -1;
- int err;
- char* termstr = NULL;
+static PyObject *
+PyCurses_setupterm(PyObject* self, PyObject *args, PyObject* keywds)
+{
+ int fd = -1;
+ int err;
+ char* termstr = NULL;
- static char *kwlist[] = {"term", "fd", NULL};
+ static char *kwlist[] = {"term", "fd", NULL};
- if (!PyArg_ParseTupleAndKeywords(
- args, keywds, "|zi:setupterm", kwlist, &termstr, &fd)) {
- return NULL;
- }
+ if (!PyArg_ParseTupleAndKeywords(
+ args, keywds, "|zi:setupterm", kwlist, &termstr, &fd)) {
+ return NULL;
+ }
- if (fd == -1) {
- PyObject* sys_stdout;
+ if (fd == -1) {
+ PyObject* sys_stdout;
- sys_stdout = PySys_GetObject("stdout");
+ sys_stdout = PySys_GetObject("stdout");
- if (sys_stdout == NULL || sys_stdout == Py_None) {
- PyErr_SetString(
- PyCursesError,
- "lost sys.stdout");
- return NULL;
- }
+ if (sys_stdout == NULL || sys_stdout == Py_None) {
+ PyErr_SetString(
+ PyCursesError,
+ "lost sys.stdout");
+ return NULL;
+ }
- fd = PyObject_AsFileDescriptor(sys_stdout);
+ fd = PyObject_AsFileDescriptor(sys_stdout);
- if (fd == -1) {
- return NULL;
- }
- }
+ if (fd == -1) {
+ return NULL;
+ }
+ }
- if (setupterm(termstr,fd,&err) == ERR) {
- char* s = "setupterm: unknown error";
+ if (!initialised_setupterm && setupterm(termstr,fd,&err) == ERR) {
+ char* s = "setupterm: unknown error";
- if (err == 0) {
- s = "setupterm: could not find terminal";
- } else if (err == -1) {
- s = "setupterm: could not find terminfo database";
- }
+ if (err == 0) {
+ s = "setupterm: could not find terminal";
+ } else if (err == -1) {
+ s = "setupterm: could not find terminfo database";
+ }
- PyErr_SetString(PyCursesError,s);
- return NULL;
- }
+ PyErr_SetString(PyCursesError,s);
+ return NULL;
+ }
- initialised_setupterm = TRUE;
+ initialised_setupterm = TRUE;
- Py_INCREF(Py_None);
- return Py_None;
- }
+ Py_INCREF(Py_None);
+ return Py_None;
+}
- static PyObject *
- PyCurses_IntrFlush(PyObject *self, PyObject *args)
- {
- int ch;
+static PyObject *
+PyCurses_IntrFlush(PyObject *self, PyObject *args)
+{
+ int ch;
- PyCursesInitialised
+ PyCursesInitialised;
- switch(PyTuple_Size(args)) {
- case 1:
- if (!PyArg_ParseTuple(args,"i;True(1), False(0)",&ch)) return NULL;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "intrflush requires 1 argument");
- return NULL;
- }
+ switch(PyTuple_Size(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args,"i;True(1), False(0)",&ch)) return NULL;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "intrflush requires 1 argument");
+ return NULL;
+ }
- return PyCursesCheckERR(intrflush(NULL,ch), "intrflush");
- }
+ return PyCursesCheckERR(intrflush(NULL,ch), "intrflush");
+}
#ifdef HAVE_CURSES_IS_TERM_RESIZED
- static PyObject *
- PyCurses_Is_Term_Resized(PyObject *self, PyObject *args)
- {
- int lines;
- int columns;
- int result;
+static PyObject *
+PyCurses_Is_Term_Resized(PyObject *self, PyObject *args)
+{
+ int lines;
+ int columns;
+ int result;
- PyCursesInitialised
+ PyCursesInitialised;
- if (!PyArg_ParseTuple(args,"ii:is_term_resized", &lines, &columns))
- return NULL;
- result = is_term_resized(lines, columns);
- if (result == TRUE) {
- Py_INCREF(Py_True);
- return Py_True;
- } else {
- Py_INCREF(Py_False);
- return Py_False;
- }
- }
+ if (!PyArg_ParseTuple(args,"ii:is_term_resized", &lines, &columns))
+ return NULL;
+ result = is_term_resized(lines, columns);
+ if (result == TRUE) {
+ Py_INCREF(Py_True);
+ return Py_True;
+ } else {
+ Py_INCREF(Py_False);
+ return Py_False;
+ }
+}
#endif /* HAVE_CURSES_IS_TERM_RESIZED */
#if !defined(__NetBSD__)
- static PyObject *
- PyCurses_KeyName(PyObject *self, PyObject *args)
- {
- const char *knp;
- int ch;
+static PyObject *
+PyCurses_KeyName(PyObject *self, PyObject *args)
+{
+ const char *knp;
+ int ch;
- PyCursesInitialised
+ PyCursesInitialised;
- if (!PyArg_ParseTuple(args,"i",&ch)) return NULL;
+ if (!PyArg_ParseTuple(args,"i",&ch)) return NULL;
- if (ch < 0) {
- PyErr_SetString(PyExc_ValueError, "invalid key number");
- return NULL;
- }
- knp = keyname(ch);
+ if (ch < 0) {
+ PyErr_SetString(PyExc_ValueError, "invalid key number");
+ return NULL;
+ }
+ knp = keyname(ch);
- return PyBytes_FromString((knp == NULL) ? "" : (char *)knp);
- }
+ return PyBytes_FromString((knp == NULL) ? "" : (char *)knp);
+}
#endif
- static PyObject *
- PyCurses_KillChar(PyObject *self)
- {
- char ch;
+static PyObject *
+PyCurses_KillChar(PyObject *self)
+{
+ char ch;
- ch = killchar();
+ ch = killchar();
- return PyBytes_FromStringAndSize(&ch, 1);
- }
+ return PyBytes_FromStringAndSize(&ch, 1);
+}
- static PyObject *
- PyCurses_Meta(PyObject *self, PyObject *args)
- {
- int ch;
+static PyObject *
+PyCurses_Meta(PyObject *self, PyObject *args)
+{
+ int ch;
- PyCursesInitialised
+ PyCursesInitialised;
- switch(PyTuple_Size(args)) {
- case 1:
- if (!PyArg_ParseTuple(args,"i;True(1), False(0)",&ch)) return NULL;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "meta requires 1 argument");
- return NULL;
- }
+ switch(PyTuple_Size(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args,"i;True(1), False(0)",&ch)) return NULL;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "meta requires 1 argument");
+ return NULL;
+ }
- return PyCursesCheckERR(meta(stdscr, ch), "meta");
- }
+ return PyCursesCheckERR(meta(stdscr, ch), "meta");
+}
#ifdef NCURSES_MOUSE_VERSION
- static PyObject *
- PyCurses_MouseInterval(PyObject *self, PyObject *args)
- {
- int interval;
- PyCursesInitialised
+static PyObject *
+PyCurses_MouseInterval(PyObject *self, PyObject *args)
+{
+ int interval;
+ PyCursesInitialised;
- if (!PyArg_ParseTuple(args,"i;interval",&interval))
- return NULL;
- return PyCursesCheckERR(mouseinterval(interval), "mouseinterval");
- }
+ if (!PyArg_ParseTuple(args,"i;interval",&interval))
+ return NULL;
+ return PyCursesCheckERR(mouseinterval(interval), "mouseinterval");
+}
- static PyObject *
- PyCurses_MouseMask(PyObject *self, PyObject *args)
- {
- int newmask;
- mmask_t oldmask, availmask;
+static PyObject *
+PyCurses_MouseMask(PyObject *self, PyObject *args)
+{
+ int newmask;
+ mmask_t oldmask, availmask;
- PyCursesInitialised
- if (!PyArg_ParseTuple(args,"i;mousemask",&newmask))
- return NULL;
- availmask = mousemask(newmask, &oldmask);
- return Py_BuildValue("(ll)", (long)availmask, (long)oldmask);
- }
+ PyCursesInitialised;
+ if (!PyArg_ParseTuple(args,"i;mousemask",&newmask))
+ return NULL;
+ availmask = mousemask(newmask, &oldmask);
+ return Py_BuildValue("(ll)", (long)availmask, (long)oldmask);
+}
#endif
- static PyObject *
- PyCurses_Napms(PyObject *self, PyObject *args)
- {
- int ms;
+static PyObject *
+PyCurses_Napms(PyObject *self, PyObject *args)
+{
+ int ms;
- PyCursesInitialised
- if (!PyArg_ParseTuple(args, "i;ms", &ms)) return NULL;
+ PyCursesInitialised;
+ if (!PyArg_ParseTuple(args, "i;ms", &ms)) return NULL;
- return Py_BuildValue("i", napms(ms));
- }
+ return Py_BuildValue("i", napms(ms));
+}
- static PyObject *
- PyCurses_NewPad(PyObject *self, PyObject *args)
- {
- WINDOW *win;
- int nlines, ncols;
+static PyObject *
+PyCurses_NewPad(PyObject *self, PyObject *args)
+{
+ WINDOW *win;
+ int nlines, ncols;
- PyCursesInitialised
+ PyCursesInitialised;
- if (!PyArg_ParseTuple(args,"ii;nlines,ncols",&nlines,&ncols)) return NULL;
+ if (!PyArg_ParseTuple(args,"ii;nlines,ncols",&nlines,&ncols)) return NULL;
- win = newpad(nlines, ncols);
+ win = newpad(nlines, ncols);
- if (win == NULL) {
- PyErr_SetString(PyCursesError, catchall_NULL);
- return NULL;
- }
+ if (win == NULL) {
+ PyErr_SetString(PyCursesError, catchall_NULL);
+ return NULL;
+ }
- return (PyObject *)PyCursesWindow_New(win);
- }
+ return (PyObject *)PyCursesWindow_New(win);
+}
- static PyObject *
- PyCurses_NewWindow(PyObject *self, PyObject *args)
- {
- WINDOW *win;
- int nlines, ncols, begin_y=0, begin_x=0;
+static PyObject *
+PyCurses_NewWindow(PyObject *self, PyObject *args)
+{
+ WINDOW *win;
+ int nlines, ncols, begin_y=0, begin_x=0;
- PyCursesInitialised
+ PyCursesInitialised;
- switch (PyTuple_Size(args)) {
- case 2:
- if (!PyArg_ParseTuple(args,"ii;nlines,ncols",&nlines,&ncols))
- return NULL;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiii;nlines,ncols,begin_y,begin_x",
- &nlines,&ncols,&begin_y,&begin_x))
- return NULL;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "newwin requires 2 or 4 arguments");
- return NULL;
- }
+ switch (PyTuple_Size(args)) {
+ case 2:
+ if (!PyArg_ParseTuple(args,"ii;nlines,ncols",&nlines,&ncols))
+ return NULL;
+ break;
+ case 4:
+ if (!PyArg_ParseTuple(args, "iiii;nlines,ncols,begin_y,begin_x",
+ &nlines,&ncols,&begin_y,&begin_x))
+ return NULL;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "newwin requires 2 or 4 arguments");
+ return NULL;
+ }
- win = newwin(nlines,ncols,begin_y,begin_x);
- if (win == NULL) {
- PyErr_SetString(PyCursesError, catchall_NULL);
- return NULL;
- }
+ win = newwin(nlines,ncols,begin_y,begin_x);
+ if (win == NULL) {
+ PyErr_SetString(PyCursesError, catchall_NULL);
+ return NULL;
+ }
- return (PyObject *)PyCursesWindow_New(win);
- }
+ return (PyObject *)PyCursesWindow_New(win);
+}
- static PyObject *
- PyCurses_Pair_Content(PyObject *self, PyObject *args)
- {
- short pair,f,b;
+static PyObject *
+PyCurses_Pair_Content(PyObject *self, PyObject *args)
+{
+ short pair,f,b;
- PyCursesInitialised
- PyCursesInitialisedColor
+ PyCursesInitialised;
+ PyCursesInitialisedColor;
- switch(PyTuple_Size(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "h;pair", &pair)) return NULL;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "pair_content requires 1 argument");
- return NULL;
- }
+ switch(PyTuple_Size(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args, "h;pair", &pair)) return NULL;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "pair_content requires 1 argument");
+ return NULL;
+ }
- if (pair_content(pair, &f, &b)==ERR) {
- PyErr_SetString(PyCursesError,
- "Argument 1 was out of range. (1..COLOR_PAIRS-1)");
- return NULL;
- }
+ if (pair_content(pair, &f, &b)==ERR) {
+ PyErr_SetString(PyCursesError,
+ "Argument 1 was out of range. (1..COLOR_PAIRS-1)");
+ return NULL;
+ }
- return Py_BuildValue("(ii)", f, b);
- }
+ return Py_BuildValue("(ii)", f, b);
+}
- static PyObject *
- PyCurses_pair_number(PyObject *self, PyObject *args)
- {
- int n;
+static PyObject *
+PyCurses_pair_number(PyObject *self, PyObject *args)
+{
+ int n;
- PyCursesInitialised
- PyCursesInitialisedColor
+ PyCursesInitialised;
+ PyCursesInitialisedColor;
- switch(PyTuple_Size(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "i;pairvalue", &n)) return NULL;
- break;
- default:
- PyErr_SetString(PyExc_TypeError,
- "pair_number requires 1 argument");
- return NULL;
- }
+ switch(PyTuple_Size(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args, "i;pairvalue", &n)) return NULL;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError,
+ "pair_number requires 1 argument");
+ return NULL;
+ }
- return PyLong_FromLong((long) ((n & A_COLOR) >> 8));
- }
+ return PyLong_FromLong((long) ((n & A_COLOR) >> 8));
+}
- static PyObject *
- PyCurses_Putp(PyObject *self, PyObject *args)
- {
- char *str;
+static PyObject *
+PyCurses_Putp(PyObject *self, PyObject *args)
+{
+ char *str;
- if (!PyArg_ParseTuple(args,"s;str", &str)) return NULL;
- return PyCursesCheckERR(putp(str), "putp");
- }
+ if (!PyArg_ParseTuple(args,"s;str", &str)) return NULL;
+ return PyCursesCheckERR(putp(str), "putp");
+}
- static PyObject *
- PyCurses_QiFlush(PyObject *self, PyObject *args)
- {
- int flag = 0;
-
- PyCursesInitialised
-
- switch(PyTuple_Size(args)) {
- case 0:
- qiflush();
- Py_INCREF(Py_None);
- return Py_None;
- case 1:
- if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL;
- if (flag) qiflush();
- else noqiflush();
- Py_INCREF(Py_None);
- return Py_None;
- default:
- PyErr_SetString(PyExc_TypeError, "qiflush requires 0 or 1 arguments");
- return NULL;
- }
- }
+static PyObject *
+PyCurses_QiFlush(PyObject *self, PyObject *args)
+{
+ int flag = 0;
+
+ PyCursesInitialised;
+
+ switch(PyTuple_Size(args)) {
+ case 0:
+ qiflush();
+ Py_INCREF(Py_None);
+ return Py_None;
+ case 1:
+ if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL;
+ if (flag) qiflush();
+ else noqiflush();
+ Py_INCREF(Py_None);
+ return Py_None;
+ default:
+ PyErr_SetString(PyExc_TypeError, "qiflush requires 0 or 1 arguments");
+ return NULL;
+ }
+}
/* Internal helper used for updating curses.LINES, curses.COLS, _curses.LINES
* and _curses.COLS */
#if defined(HAVE_CURSES_RESIZETERM) || defined(HAVE_CURSES_RESIZE_TERM)
- static int
- update_lines_cols(void)
- {
- PyObject *o;
- PyObject *m = PyImport_ImportModuleNoBlock("curses");
+static int
+update_lines_cols(void)
+{
+ PyObject *o;
+ PyObject *m = PyImport_ImportModuleNoBlock("curses");
- if (!m)
- return 0;
+ if (!m)
+ return 0;
- o = PyLong_FromLong(LINES);
- if (!o) {
- Py_DECREF(m);
- return 0;
- }
- if (PyObject_SetAttrString(m, "LINES", o)) {
- Py_DECREF(m);
- Py_DECREF(o);
- return 0;
- }
- if (PyDict_SetItemString(ModDict, "LINES", o)) {
- Py_DECREF(m);
- Py_DECREF(o);
- return 0;
- }
- Py_DECREF(o);
- o = PyLong_FromLong(COLS);
- if (!o) {
- Py_DECREF(m);
- return 0;
- }
- if (PyObject_SetAttrString(m, "COLS", o)) {
- Py_DECREF(m);
- Py_DECREF(o);
- return 0;
- }
- if (PyDict_SetItemString(ModDict, "COLS", o)) {
- Py_DECREF(m);
- Py_DECREF(o);
- return 0;
- }
- Py_DECREF(o);
- Py_DECREF(m);
- return 1;
- }
+ o = PyLong_FromLong(LINES);
+ if (!o) {
+ Py_DECREF(m);
+ return 0;
+ }
+ if (PyObject_SetAttrString(m, "LINES", o)) {
+ Py_DECREF(m);
+ Py_DECREF(o);
+ return 0;
+ }
+ if (PyDict_SetItemString(ModDict, "LINES", o)) {
+ Py_DECREF(m);
+ Py_DECREF(o);
+ return 0;
+ }
+ Py_DECREF(o);
+ o = PyLong_FromLong(COLS);
+ if (!o) {
+ Py_DECREF(m);
+ return 0;
+ }
+ if (PyObject_SetAttrString(m, "COLS", o)) {
+ Py_DECREF(m);
+ Py_DECREF(o);
+ return 0;
+ }
+ if (PyDict_SetItemString(ModDict, "COLS", o)) {
+ Py_DECREF(m);
+ Py_DECREF(o);
+ return 0;
+ }
+ Py_DECREF(o);
+ Py_DECREF(m);
+ return 1;
+}
#endif
#ifdef HAVE_CURSES_RESIZETERM
- static PyObject *
- PyCurses_ResizeTerm(PyObject *self, PyObject *args)
- {
- int lines;
- int columns;
- PyObject *result;
+static PyObject *
+PyCurses_ResizeTerm(PyObject *self, PyObject *args)
+{
+ int lines;
+ int columns;
+ PyObject *result;
- PyCursesInitialised
+ PyCursesInitialised;
- if (!PyArg_ParseTuple(args,"ii:resizeterm", &lines, &columns))
- return NULL;
+ if (!PyArg_ParseTuple(args,"ii:resizeterm", &lines, &columns))
+ return NULL;
- result = PyCursesCheckERR(resizeterm(lines, columns), "resizeterm");
- if (!result)
- return NULL;
- if (!update_lines_cols())
- return NULL;
- return result;
- }
+ result = PyCursesCheckERR(resizeterm(lines, columns), "resizeterm");
+ if (!result)
+ return NULL;
+ if (!update_lines_cols())
+ return NULL;
+ return result;
+}
#endif
#ifdef HAVE_CURSES_RESIZE_TERM
- static PyObject *
- PyCurses_Resize_Term(PyObject *self, PyObject *args)
- {
- int lines;
- int columns;
+static PyObject *
+PyCurses_Resize_Term(PyObject *self, PyObject *args)
+{
+ int lines;
+ int columns;
- PyObject *result;
+ PyObject *result;
- PyCursesInitialised
+ PyCursesInitialised;
- if (!PyArg_ParseTuple(args,"ii:resize_term", &lines, &columns))
- return NULL;
+ if (!PyArg_ParseTuple(args,"ii:resize_term", &lines, &columns))
+ return NULL;
- result = PyCursesCheckERR(resize_term(lines, columns), "resize_term");
- if (!result)
- return NULL;
- if (!update_lines_cols())
- return NULL;
- return result;
- }
+ result = PyCursesCheckERR(resize_term(lines, columns), "resize_term");
+ if (!result)
+ return NULL;
+ if (!update_lines_cols())
+ return NULL;
+ return result;
+}
#endif /* HAVE_CURSES_RESIZE_TERM */
- static PyObject *
- PyCurses_setsyx(PyObject *self, PyObject *args)
- {
- int y,x;
+static PyObject *
+PyCurses_setsyx(PyObject *self, PyObject *args)
+{
+ int y,x;
- PyCursesInitialised
+ PyCursesInitialised;
- if (PyTuple_Size(args)!=2) {
- PyErr_SetString(PyExc_TypeError, "setsyx requires 2 arguments");
- return NULL;
- }
+ if (PyTuple_Size(args)!=2) {
+ PyErr_SetString(PyExc_TypeError, "setsyx requires 2 arguments");
+ return NULL;
+ }
- if (!PyArg_ParseTuple(args, "ii;y, x", &y, &x)) return NULL;
+ if (!PyArg_ParseTuple(args, "ii;y, x", &y, &x)) return NULL;
- setsyx(y,x);
+ setsyx(y,x);
- Py_INCREF(Py_None);
- return Py_None;
- }
+ Py_INCREF(Py_None);
+ return Py_None;
+}
- static PyObject *
- PyCurses_Start_Color(PyObject *self)
- {
- int code;
- PyObject *c, *cp;
-
- PyCursesInitialised
-
- code = start_color();
- if (code != ERR) {
- initialisedcolors = TRUE;
- c = PyLong_FromLong((long) COLORS);
- PyDict_SetItemString(ModDict, "COLORS", c);
- Py_DECREF(c);
- cp = PyLong_FromLong((long) COLOR_PAIRS);
- PyDict_SetItemString(ModDict, "COLOR_PAIRS", cp);
- Py_DECREF(cp);
- Py_INCREF(Py_None);
- return Py_None;
- } else {
- PyErr_SetString(PyCursesError, "start_color() returned ERR");
- return NULL;
- }
- }
+static PyObject *
+PyCurses_Start_Color(PyObject *self)
+{
+ int code;
+ PyObject *c, *cp;
- static PyObject *
- PyCurses_tigetflag(PyObject *self, PyObject *args)
- {
- char *capname;
+ PyCursesInitialised;
+
+ code = start_color();
+ if (code != ERR) {
+ initialisedcolors = TRUE;
+ c = PyLong_FromLong((long) COLORS);
+ PyDict_SetItemString(ModDict, "COLORS", c);
+ Py_DECREF(c);
+ cp = PyLong_FromLong((long) COLOR_PAIRS);
+ PyDict_SetItemString(ModDict, "COLOR_PAIRS", cp);
+ Py_DECREF(cp);
+ Py_INCREF(Py_None);
+ return Py_None;
+ } else {
+ PyErr_SetString(PyCursesError, "start_color() returned ERR");
+ return NULL;
+ }
+}
- PyCursesSetupTermCalled;
+static PyObject *
+PyCurses_tigetflag(PyObject *self, PyObject *args)
+{
+ char *capname;
- if (!PyArg_ParseTuple(args, "s", &capname))
- return NULL;
+ PyCursesSetupTermCalled;
- return PyLong_FromLong( (long) tigetflag( capname ) );
- }
+ if (!PyArg_ParseTuple(args, "s", &capname))
+ return NULL;
- static PyObject *
- PyCurses_tigetnum(PyObject *self, PyObject *args)
- {
- char *capname;
+ return PyLong_FromLong( (long) tigetflag( capname ) );
+}
- PyCursesSetupTermCalled;
+static PyObject *
+PyCurses_tigetnum(PyObject *self, PyObject *args)
+{
+ char *capname;
- if (!PyArg_ParseTuple(args, "s", &capname))
- return NULL;
+ PyCursesSetupTermCalled;
- return PyLong_FromLong( (long) tigetnum( capname ) );
- }
+ if (!PyArg_ParseTuple(args, "s", &capname))
+ return NULL;
- static PyObject *
- PyCurses_tigetstr(PyObject *self, PyObject *args)
- {
- char *capname;
+ return PyLong_FromLong( (long) tigetnum( capname ) );
+}
- PyCursesSetupTermCalled;
+static PyObject *
+PyCurses_tigetstr(PyObject *self, PyObject *args)
+{
+ char *capname;
- if (!PyArg_ParseTuple(args, "s", &capname))
- return NULL;
+ PyCursesSetupTermCalled;
- capname = tigetstr( capname );
- if (capname == 0 || capname == (char*) -1) {
- Py_INCREF(Py_None);
- return Py_None;
- }
- return PyBytes_FromString( capname );
- }
+ if (!PyArg_ParseTuple(args, "s", &capname))
+ return NULL;
- static PyObject *
- PyCurses_tparm(PyObject *self, PyObject *args)
- {
- char* fmt;
- char* result = NULL;
- int i1=0,i2=0,i3=0,i4=0,i5=0,i6=0,i7=0,i8=0,i9=0;
+ capname = tigetstr( capname );
+ if (capname == 0 || capname == (char*) -1) {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ return PyBytes_FromString( capname );
+}
- PyCursesSetupTermCalled;
+static PyObject *
+PyCurses_tparm(PyObject *self, PyObject *args)
+{
+ char* fmt;
+ char* result = NULL;
+ int i1=0,i2=0,i3=0,i4=0,i5=0,i6=0,i7=0,i8=0,i9=0;
- if (!PyArg_ParseTuple(args, "s|iiiiiiiii:tparm",
- &fmt, &i1, &i2, &i3, &i4,
- &i5, &i6, &i7, &i8, &i9)) {
- return NULL;
- }
+ PyCursesSetupTermCalled;
- result = tparm(fmt,i1,i2,i3,i4,i5,i6,i7,i8,i9);
- if (!result) {
- PyErr_SetString(PyCursesError, "tparm() returned NULL");
- return NULL;
- }
+ if (!PyArg_ParseTuple(args, "s|iiiiiiiii:tparm",
+ &fmt, &i1, &i2, &i3, &i4,
+ &i5, &i6, &i7, &i8, &i9)) {
+ return NULL;
+ }
- return PyBytes_FromString(result);
- }
+ result = tparm(fmt,i1,i2,i3,i4,i5,i6,i7,i8,i9);
+ if (!result) {
+ PyErr_SetString(PyCursesError, "tparm() returned NULL");
+ return NULL;
+ }
- static PyObject *
- PyCurses_TypeAhead(PyObject *self, PyObject *args)
- {
- int fd;
+ return PyBytes_FromString(result);
+}
- PyCursesInitialised
+static PyObject *
+PyCurses_TypeAhead(PyObject *self, PyObject *args)
+{
+ int fd;
- if (!PyArg_ParseTuple(args,"i;fd",&fd)) return NULL;
+ PyCursesInitialised;
- return PyCursesCheckERR(typeahead( fd ), "typeahead");
- }
+ if (!PyArg_ParseTuple(args,"i;fd",&fd)) return NULL;
- static PyObject *
- PyCurses_UnCtrl(PyObject *self, PyObject *args)
- {
- PyObject *temp;
- chtype ch;
+ return PyCursesCheckERR(typeahead( fd ), "typeahead");
+}
- PyCursesInitialised
+static PyObject *
+PyCurses_UnCtrl(PyObject *self, PyObject *args)
+{
+ PyObject *temp;
+ chtype ch;
- if (!PyArg_ParseTuple(args,"O;ch or int",&temp)) return NULL;
+ PyCursesInitialised;
- if (!PyCurses_ConvertToChtype(temp, &ch)) {
- PyErr_SetString(PyExc_TypeError, "argument must be a ch or an int");
- return NULL;
- }
+ if (!PyArg_ParseTuple(args,"O;ch or int",&temp)) return NULL;
- return PyBytes_FromString(unctrl(ch));
- }
+ if (!PyCurses_ConvertToChtype(temp, &ch)) {
+ PyErr_SetString(PyExc_TypeError, "argument must be a ch or an int");
+ return NULL;
+ }
- static PyObject *
- PyCurses_UngetCh(PyObject *self, PyObject *args)
- {
- PyObject *temp;
- chtype ch;
+ return PyBytes_FromString(unctrl(ch));
+}
- PyCursesInitialised
+static PyObject *
+PyCurses_UngetCh(PyObject *self, PyObject *args)
+{
+ PyObject *temp;
+ chtype ch;
- if (!PyArg_ParseTuple(args,"O;ch or int",&temp)) return NULL;
+ PyCursesInitialised;
- if (!PyCurses_ConvertToChtype(temp, &ch)) {
- PyErr_SetString(PyExc_TypeError, "argument must be a ch or an int");
- return NULL;
- }
+ if (!PyArg_ParseTuple(args,"O;ch or int",&temp)) return NULL;
- return PyCursesCheckERR(ungetch(ch), "ungetch");
- }
+ if (!PyCurses_ConvertToChtype(temp, &ch)) {
+ PyErr_SetString(PyExc_TypeError, "argument must be a ch or an int");
+ return NULL;
+ }
- static PyObject *
- PyCurses_Use_Env(PyObject *self, PyObject *args)
- {
- int flag;
+ return PyCursesCheckERR(ungetch(ch), "ungetch");
+}
- switch(PyTuple_Size(args)) {
- case 1:
- if (!PyArg_ParseTuple(args,"i;True(1), False(0)",&flag))
- return NULL;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "use_env requires 1 argument");
- return NULL;
- }
- use_env(flag);
- Py_INCREF(Py_None);
- return Py_None;
- }
+static PyObject *
+PyCurses_Use_Env(PyObject *self, PyObject *args)
+{
+ int flag;
+
+ switch(PyTuple_Size(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args,"i;True(1), False(0)",&flag))
+ return NULL;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "use_env requires 1 argument");
+ return NULL;
+ }
+ use_env(flag);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
#ifndef STRICT_SYSV_CURSES
- static PyObject *
- PyCurses_Use_Default_Colors(PyObject *self)
- {
- int code;
+static PyObject *
+PyCurses_Use_Default_Colors(PyObject *self)
+{
+ int code;
- PyCursesInitialised
- PyCursesInitialisedColor
+ PyCursesInitialised;
+ PyCursesInitialisedColor;
- code = use_default_colors();
- if (code != ERR) {
- Py_INCREF(Py_None);
- return Py_None;
- } else {
- PyErr_SetString(PyCursesError, "use_default_colors() returned ERR");
- return NULL;
- }
- }
+ code = use_default_colors();
+ if (code != ERR) {
+ Py_INCREF(Py_None);
+ return Py_None;
+ } else {
+ PyErr_SetString(PyCursesError, "use_default_colors() returned ERR");
+ return NULL;
+ }
+}
#endif /* STRICT_SYSV_CURSES */
/* List of functions defined in the module */
- static PyMethodDef PyCurses_methods[] = {
- {"baudrate", (PyCFunction)PyCurses_baudrate, METH_NOARGS},
- {"beep", (PyCFunction)PyCurses_beep, METH_NOARGS},
- {"can_change_color", (PyCFunction)PyCurses_can_change_color, METH_NOARGS},
- {"cbreak", (PyCFunction)PyCurses_cbreak, METH_VARARGS},
- {"color_content", (PyCFunction)PyCurses_Color_Content, METH_VARARGS},
- {"color_pair", (PyCFunction)PyCurses_color_pair, METH_VARARGS},
- {"curs_set", (PyCFunction)PyCurses_Curs_Set, METH_VARARGS},
- {"def_prog_mode", (PyCFunction)PyCurses_def_prog_mode, METH_NOARGS},
- {"def_shell_mode", (PyCFunction)PyCurses_def_shell_mode, METH_NOARGS},
- {"delay_output", (PyCFunction)PyCurses_Delay_Output, METH_VARARGS},
- {"doupdate", (PyCFunction)PyCurses_doupdate, METH_NOARGS},
- {"echo", (PyCFunction)PyCurses_echo, METH_VARARGS},
- {"endwin", (PyCFunction)PyCurses_endwin, METH_NOARGS},
- {"erasechar", (PyCFunction)PyCurses_EraseChar, METH_NOARGS},
- {"filter", (PyCFunction)PyCurses_filter, METH_NOARGS},
- {"flash", (PyCFunction)PyCurses_flash, METH_NOARGS},
- {"flushinp", (PyCFunction)PyCurses_flushinp, METH_NOARGS},
+static PyMethodDef PyCurses_methods[] = {
+ {"baudrate", (PyCFunction)PyCurses_baudrate, METH_NOARGS},
+ {"beep", (PyCFunction)PyCurses_beep, METH_NOARGS},
+ {"can_change_color", (PyCFunction)PyCurses_can_change_color, METH_NOARGS},
+ {"cbreak", (PyCFunction)PyCurses_cbreak, METH_VARARGS},
+ {"color_content", (PyCFunction)PyCurses_Color_Content, METH_VARARGS},
+ {"color_pair", (PyCFunction)PyCurses_color_pair, METH_VARARGS},
+ {"curs_set", (PyCFunction)PyCurses_Curs_Set, METH_VARARGS},
+ {"def_prog_mode", (PyCFunction)PyCurses_def_prog_mode, METH_NOARGS},
+ {"def_shell_mode", (PyCFunction)PyCurses_def_shell_mode, METH_NOARGS},
+ {"delay_output", (PyCFunction)PyCurses_Delay_Output, METH_VARARGS},
+ {"doupdate", (PyCFunction)PyCurses_doupdate, METH_NOARGS},
+ {"echo", (PyCFunction)PyCurses_echo, METH_VARARGS},
+ {"endwin", (PyCFunction)PyCurses_endwin, METH_NOARGS},
+ {"erasechar", (PyCFunction)PyCurses_EraseChar, METH_NOARGS},
+ {"filter", (PyCFunction)PyCurses_filter, METH_NOARGS},
+ {"flash", (PyCFunction)PyCurses_flash, METH_NOARGS},
+ {"flushinp", (PyCFunction)PyCurses_flushinp, METH_NOARGS},
#ifdef NCURSES_MOUSE_VERSION
- {"getmouse", (PyCFunction)PyCurses_GetMouse, METH_NOARGS},
- {"ungetmouse", (PyCFunction)PyCurses_UngetMouse, METH_VARARGS},
+ {"getmouse", (PyCFunction)PyCurses_GetMouse, METH_NOARGS},
+ {"ungetmouse", (PyCFunction)PyCurses_UngetMouse, METH_VARARGS},
#endif
- {"getsyx", (PyCFunction)PyCurses_getsyx, METH_NOARGS},
- {"getwin", (PyCFunction)PyCurses_GetWin, METH_O},
- {"has_colors", (PyCFunction)PyCurses_has_colors, METH_NOARGS},
- {"has_ic", (PyCFunction)PyCurses_has_ic, METH_NOARGS},
- {"has_il", (PyCFunction)PyCurses_has_il, METH_NOARGS},
+ {"getsyx", (PyCFunction)PyCurses_getsyx, METH_NOARGS},
+ {"getwin", (PyCFunction)PyCurses_GetWin, METH_O},
+ {"has_colors", (PyCFunction)PyCurses_has_colors, METH_NOARGS},
+ {"has_ic", (PyCFunction)PyCurses_has_ic, METH_NOARGS},
+ {"has_il", (PyCFunction)PyCurses_has_il, METH_NOARGS},
#ifndef STRICT_SYSV_CURSES
- {"has_key", (PyCFunction)PyCurses_has_key, METH_VARARGS},
+ {"has_key", (PyCFunction)PyCurses_has_key, METH_VARARGS},
#endif
- {"halfdelay", (PyCFunction)PyCurses_HalfDelay, METH_VARARGS},
- {"init_color", (PyCFunction)PyCurses_Init_Color, METH_VARARGS},
- {"init_pair", (PyCFunction)PyCurses_Init_Pair, METH_VARARGS},
- {"initscr", (PyCFunction)PyCurses_InitScr, METH_NOARGS},
- {"intrflush", (PyCFunction)PyCurses_IntrFlush, METH_VARARGS},
- {"isendwin", (PyCFunction)PyCurses_isendwin, METH_NOARGS},
+ {"halfdelay", (PyCFunction)PyCurses_HalfDelay, METH_VARARGS},
+ {"init_color", (PyCFunction)PyCurses_Init_Color, METH_VARARGS},
+ {"init_pair", (PyCFunction)PyCurses_Init_Pair, METH_VARARGS},
+ {"initscr", (PyCFunction)PyCurses_InitScr, METH_NOARGS},
+ {"intrflush", (PyCFunction)PyCurses_IntrFlush, METH_VARARGS},
+ {"isendwin", (PyCFunction)PyCurses_isendwin, METH_NOARGS},
#ifdef HAVE_CURSES_IS_TERM_RESIZED
- {"is_term_resized", (PyCFunction)PyCurses_Is_Term_Resized, METH_VARARGS},
+ {"is_term_resized", (PyCFunction)PyCurses_Is_Term_Resized, METH_VARARGS},
#endif
#if !defined(__NetBSD__)
- {"keyname", (PyCFunction)PyCurses_KeyName, METH_VARARGS},
+ {"keyname", (PyCFunction)PyCurses_KeyName, METH_VARARGS},
#endif
- {"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS},
- {"longname", (PyCFunction)PyCurses_longname, METH_NOARGS},
- {"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS},
+ {"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS},
+ {"longname", (PyCFunction)PyCurses_longname, METH_NOARGS},
+ {"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS},
#ifdef NCURSES_MOUSE_VERSION
- {"mouseinterval", (PyCFunction)PyCurses_MouseInterval, METH_VARARGS},
- {"mousemask", (PyCFunction)PyCurses_MouseMask, METH_VARARGS},
+ {"mouseinterval", (PyCFunction)PyCurses_MouseInterval, METH_VARARGS},
+ {"mousemask", (PyCFunction)PyCurses_MouseMask, METH_VARARGS},
#endif
- {"napms", (PyCFunction)PyCurses_Napms, METH_VARARGS},
- {"newpad", (PyCFunction)PyCurses_NewPad, METH_VARARGS},
- {"newwin", (PyCFunction)PyCurses_NewWindow, METH_VARARGS},
- {"nl", (PyCFunction)PyCurses_nl, METH_VARARGS},
- {"nocbreak", (PyCFunction)PyCurses_nocbreak, METH_NOARGS},
- {"noecho", (PyCFunction)PyCurses_noecho, METH_NOARGS},
- {"nonl", (PyCFunction)PyCurses_nonl, METH_NOARGS},
- {"noqiflush", (PyCFunction)PyCurses_noqiflush, METH_NOARGS},
- {"noraw", (PyCFunction)PyCurses_noraw, METH_NOARGS},
- {"pair_content", (PyCFunction)PyCurses_Pair_Content, METH_VARARGS},
- {"pair_number", (PyCFunction)PyCurses_pair_number, METH_VARARGS},
- {"putp", (PyCFunction)PyCurses_Putp, METH_VARARGS},
- {"qiflush", (PyCFunction)PyCurses_QiFlush, METH_VARARGS},
- {"raw", (PyCFunction)PyCurses_raw, METH_VARARGS},
- {"reset_prog_mode", (PyCFunction)PyCurses_reset_prog_mode, METH_NOARGS},
- {"reset_shell_mode", (PyCFunction)PyCurses_reset_shell_mode, METH_NOARGS},
- {"resetty", (PyCFunction)PyCurses_resetty, METH_NOARGS},
+ {"napms", (PyCFunction)PyCurses_Napms, METH_VARARGS},
+ {"newpad", (PyCFunction)PyCurses_NewPad, METH_VARARGS},
+ {"newwin", (PyCFunction)PyCurses_NewWindow, METH_VARARGS},
+ {"nl", (PyCFunction)PyCurses_nl, METH_VARARGS},
+ {"nocbreak", (PyCFunction)PyCurses_nocbreak, METH_NOARGS},
+ {"noecho", (PyCFunction)PyCurses_noecho, METH_NOARGS},
+ {"nonl", (PyCFunction)PyCurses_nonl, METH_NOARGS},
+ {"noqiflush", (PyCFunction)PyCurses_noqiflush, METH_NOARGS},
+ {"noraw", (PyCFunction)PyCurses_noraw, METH_NOARGS},
+ {"pair_content", (PyCFunction)PyCurses_Pair_Content, METH_VARARGS},
+ {"pair_number", (PyCFunction)PyCurses_pair_number, METH_VARARGS},
+ {"putp", (PyCFunction)PyCurses_Putp, METH_VARARGS},
+ {"qiflush", (PyCFunction)PyCurses_QiFlush, METH_VARARGS},
+ {"raw", (PyCFunction)PyCurses_raw, METH_VARARGS},
+ {"reset_prog_mode", (PyCFunction)PyCurses_reset_prog_mode, METH_NOARGS},
+ {"reset_shell_mode", (PyCFunction)PyCurses_reset_shell_mode, METH_NOARGS},
+ {"resetty", (PyCFunction)PyCurses_resetty, METH_NOARGS},
#ifdef HAVE_CURSES_RESIZETERM
- {"resizeterm", (PyCFunction)PyCurses_ResizeTerm, METH_VARARGS},
+ {"resizeterm", (PyCFunction)PyCurses_ResizeTerm, METH_VARARGS},
#endif
#ifdef HAVE_CURSES_RESIZE_TERM
- {"resize_term", (PyCFunction)PyCurses_Resize_Term, METH_VARARGS},
+ {"resize_term", (PyCFunction)PyCurses_Resize_Term, METH_VARARGS},
#endif
- {"savetty", (PyCFunction)PyCurses_savetty, METH_NOARGS},
- {"setsyx", (PyCFunction)PyCurses_setsyx, METH_VARARGS},
- {"setupterm", (PyCFunction)PyCurses_setupterm,
- METH_VARARGS|METH_KEYWORDS},
- {"start_color", (PyCFunction)PyCurses_Start_Color, METH_NOARGS},
- {"termattrs", (PyCFunction)PyCurses_termattrs, METH_NOARGS},
- {"termname", (PyCFunction)PyCurses_termname, METH_NOARGS},
- {"tigetflag", (PyCFunction)PyCurses_tigetflag, METH_VARARGS},
- {"tigetnum", (PyCFunction)PyCurses_tigetnum, METH_VARARGS},
- {"tigetstr", (PyCFunction)PyCurses_tigetstr, METH_VARARGS},
- {"tparm", (PyCFunction)PyCurses_tparm, METH_VARARGS},
- {"typeahead", (PyCFunction)PyCurses_TypeAhead, METH_VARARGS},
- {"unctrl", (PyCFunction)PyCurses_UnCtrl, METH_VARARGS},
- {"ungetch", (PyCFunction)PyCurses_UngetCh, METH_VARARGS},
- {"use_env", (PyCFunction)PyCurses_Use_Env, METH_VARARGS},
+ {"savetty", (PyCFunction)PyCurses_savetty, METH_NOARGS},
+ {"setsyx", (PyCFunction)PyCurses_setsyx, METH_VARARGS},
+ {"setupterm", (PyCFunction)PyCurses_setupterm,
+ METH_VARARGS|METH_KEYWORDS},
+ {"start_color", (PyCFunction)PyCurses_Start_Color, METH_NOARGS},
+ {"termattrs", (PyCFunction)PyCurses_termattrs, METH_NOARGS},
+ {"termname", (PyCFunction)PyCurses_termname, METH_NOARGS},
+ {"tigetflag", (PyCFunction)PyCurses_tigetflag, METH_VARARGS},
+ {"tigetnum", (PyCFunction)PyCurses_tigetnum, METH_VARARGS},
+ {"tigetstr", (PyCFunction)PyCurses_tigetstr, METH_VARARGS},
+ {"tparm", (PyCFunction)PyCurses_tparm, METH_VARARGS},
+ {"typeahead", (PyCFunction)PyCurses_TypeAhead, METH_VARARGS},
+ {"unctrl", (PyCFunction)PyCurses_UnCtrl, METH_VARARGS},
+ {"ungetch", (PyCFunction)PyCurses_UngetCh, METH_VARARGS},
+ {"use_env", (PyCFunction)PyCurses_Use_Env, METH_VARARGS},
#ifndef STRICT_SYSV_CURSES
- {"use_default_colors", (PyCFunction)PyCurses_Use_Default_Colors, METH_NOARGS},
+ {"use_default_colors", (PyCFunction)PyCurses_Use_Default_Colors, METH_NOARGS},
#endif
- {NULL, NULL} /* sentinel */
- };
+ {NULL, NULL} /* sentinel */
+};
/* Initialization function for the module */
- static struct PyModuleDef _cursesmodule = {
- PyModuleDef_HEAD_INIT,
- "_curses",
- NULL,
- -1,
- PyCurses_methods,
- NULL,
- NULL,
- NULL,
- NULL
- };
-
- PyMODINIT_FUNC
- PyInit__curses(void)
- {
- PyObject *m, *d, *v, *c_api_object;
- static void *PyCurses_API[PyCurses_API_pointers];
+static struct PyModuleDef _cursesmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_curses",
+ NULL,
+ -1,
+ PyCurses_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__curses(void)
+{
+ PyObject *m, *d, *v, *c_api_object;
+ static void *PyCurses_API[PyCurses_API_pointers];
- /* Initialize object type */
- if (PyType_Ready(&PyCursesWindow_Type) < 0)
- return NULL;
+ /* Initialize object type */
+ if (PyType_Ready(&PyCursesWindow_Type) < 0)
+ return NULL;
- /* Initialize the C API pointer array */
- PyCurses_API[0] = (void *)&PyCursesWindow_Type;
- PyCurses_API[1] = (void *)func_PyCursesSetupTermCalled;
- PyCurses_API[2] = (void *)func_PyCursesInitialised;
- PyCurses_API[3] = (void *)func_PyCursesInitialisedColor;
+ /* Initialize the C API pointer array */
+ PyCurses_API[0] = (void *)&PyCursesWindow_Type;
+ PyCurses_API[1] = (void *)func_PyCursesSetupTermCalled;
+ PyCurses_API[2] = (void *)func_PyCursesInitialised;
+ PyCurses_API[3] = (void *)func_PyCursesInitialisedColor;
- /* Create the module and add the functions */
- m = PyModule_Create(&_cursesmodule);
- if (m == NULL)
- return NULL;
+ /* Create the module and add the functions */
+ m = PyModule_Create(&_cursesmodule);
+ if (m == NULL)
+ return NULL;
- /* Add some symbolic constants to the module */
- d = PyModule_GetDict(m);
- if (d == NULL)
- return NULL;
- ModDict = d; /* For PyCurses_InitScr to use later */
-
- /* Add a capsule for the C API */
- c_api_object = PyCapsule_New(PyCurses_API, PyCurses_CAPSULE_NAME, NULL);
- PyDict_SetItemString(d, "_C_API", c_api_object);
- Py_DECREF(c_api_object);
-
- /* For exception curses.error */
- PyCursesError = PyErr_NewException("_curses.error", NULL, NULL);
- PyDict_SetItemString(d, "error", PyCursesError);
-
- /* Make the version available */
- v = PyBytes_FromString(PyCursesVersion);
- PyDict_SetItemString(d, "version", v);
- PyDict_SetItemString(d, "__version__", v);
- Py_DECREF(v);
-
- SetDictInt("ERR", ERR);
- SetDictInt("OK", OK);
-
- /* Here are some attributes you can add to chars to print */
-
- SetDictInt("A_ATTRIBUTES", A_ATTRIBUTES);
- SetDictInt("A_NORMAL", A_NORMAL);
- SetDictInt("A_STANDOUT", A_STANDOUT);
- SetDictInt("A_UNDERLINE", A_UNDERLINE);
- SetDictInt("A_REVERSE", A_REVERSE);
- SetDictInt("A_BLINK", A_BLINK);
- SetDictInt("A_DIM", A_DIM);
- SetDictInt("A_BOLD", A_BOLD);
- SetDictInt("A_ALTCHARSET", A_ALTCHARSET);
+ /* Add some symbolic constants to the module */
+ d = PyModule_GetDict(m);
+ if (d == NULL)
+ return NULL;
+ ModDict = d; /* For PyCurses_InitScr to use later */
+
+ /* Add a capsule for the C API */
+ c_api_object = PyCapsule_New(PyCurses_API, PyCurses_CAPSULE_NAME, NULL);
+ PyDict_SetItemString(d, "_C_API", c_api_object);
+ Py_DECREF(c_api_object);
+
+ /* For exception curses.error */
+ PyCursesError = PyErr_NewException("_curses.error", NULL, NULL);
+ PyDict_SetItemString(d, "error", PyCursesError);
+
+ /* Make the version available */
+ v = PyBytes_FromString(PyCursesVersion);
+ PyDict_SetItemString(d, "version", v);
+ PyDict_SetItemString(d, "__version__", v);
+ Py_DECREF(v);
+
+ SetDictInt("ERR", ERR);
+ SetDictInt("OK", OK);
+
+ /* Here are some attributes you can add to chars to print */
+
+ SetDictInt("A_ATTRIBUTES", A_ATTRIBUTES);
+ SetDictInt("A_NORMAL", A_NORMAL);
+ SetDictInt("A_STANDOUT", A_STANDOUT);
+ SetDictInt("A_UNDERLINE", A_UNDERLINE);
+ SetDictInt("A_REVERSE", A_REVERSE);
+ SetDictInt("A_BLINK", A_BLINK);
+ SetDictInt("A_DIM", A_DIM);
+ SetDictInt("A_BOLD", A_BOLD);
+ SetDictInt("A_ALTCHARSET", A_ALTCHARSET);
#if !defined(__NetBSD__)
- SetDictInt("A_INVIS", A_INVIS);
+ SetDictInt("A_INVIS", A_INVIS);
#endif
- SetDictInt("A_PROTECT", A_PROTECT);
- SetDictInt("A_CHARTEXT", A_CHARTEXT);
- SetDictInt("A_COLOR", A_COLOR);
+ SetDictInt("A_PROTECT", A_PROTECT);
+ SetDictInt("A_CHARTEXT", A_CHARTEXT);
+ SetDictInt("A_COLOR", A_COLOR);
- /* The following are never available with strict SYSV curses */
+ /* The following are never available with strict SYSV curses */
#ifdef A_HORIZONTAL
- SetDictInt("A_HORIZONTAL", A_HORIZONTAL);
+ SetDictInt("A_HORIZONTAL", A_HORIZONTAL);
#endif
#ifdef A_LEFT
- SetDictInt("A_LEFT", A_LEFT);
+ SetDictInt("A_LEFT", A_LEFT);
#endif
#ifdef A_LOW
- SetDictInt("A_LOW", A_LOW);
+ SetDictInt("A_LOW", A_LOW);
#endif
#ifdef A_RIGHT
- SetDictInt("A_RIGHT", A_RIGHT);
+ SetDictInt("A_RIGHT", A_RIGHT);
#endif
#ifdef A_TOP
- SetDictInt("A_TOP", A_TOP);
+ SetDictInt("A_TOP", A_TOP);
#endif
#ifdef A_VERTICAL
- SetDictInt("A_VERTICAL", A_VERTICAL);
+ SetDictInt("A_VERTICAL", A_VERTICAL);
#endif
- SetDictInt("COLOR_BLACK", COLOR_BLACK);
- SetDictInt("COLOR_RED", COLOR_RED);
- SetDictInt("COLOR_GREEN", COLOR_GREEN);
- SetDictInt("COLOR_YELLOW", COLOR_YELLOW);
- SetDictInt("COLOR_BLUE", COLOR_BLUE);
- SetDictInt("COLOR_MAGENTA", COLOR_MAGENTA);
- SetDictInt("COLOR_CYAN", COLOR_CYAN);
- SetDictInt("COLOR_WHITE", COLOR_WHITE);
+ SetDictInt("COLOR_BLACK", COLOR_BLACK);
+ SetDictInt("COLOR_RED", COLOR_RED);
+ SetDictInt("COLOR_GREEN", COLOR_GREEN);
+ SetDictInt("COLOR_YELLOW", COLOR_YELLOW);
+ SetDictInt("COLOR_BLUE", COLOR_BLUE);
+ SetDictInt("COLOR_MAGENTA", COLOR_MAGENTA);
+ SetDictInt("COLOR_CYAN", COLOR_CYAN);
+ SetDictInt("COLOR_WHITE", COLOR_WHITE);
#ifdef NCURSES_MOUSE_VERSION
- /* Mouse-related constants */
- SetDictInt("BUTTON1_PRESSED", BUTTON1_PRESSED);
- SetDictInt("BUTTON1_RELEASED", BUTTON1_RELEASED);
- SetDictInt("BUTTON1_CLICKED", BUTTON1_CLICKED);
- SetDictInt("BUTTON1_DOUBLE_CLICKED", BUTTON1_DOUBLE_CLICKED);
- SetDictInt("BUTTON1_TRIPLE_CLICKED", BUTTON1_TRIPLE_CLICKED);
-
- SetDictInt("BUTTON2_PRESSED", BUTTON2_PRESSED);
- SetDictInt("BUTTON2_RELEASED", BUTTON2_RELEASED);
- SetDictInt("BUTTON2_CLICKED", BUTTON2_CLICKED);
- SetDictInt("BUTTON2_DOUBLE_CLICKED", BUTTON2_DOUBLE_CLICKED);
- SetDictInt("BUTTON2_TRIPLE_CLICKED", BUTTON2_TRIPLE_CLICKED);
-
- SetDictInt("BUTTON3_PRESSED", BUTTON3_PRESSED);
- SetDictInt("BUTTON3_RELEASED", BUTTON3_RELEASED);
- SetDictInt("BUTTON3_CLICKED", BUTTON3_CLICKED);
- SetDictInt("BUTTON3_DOUBLE_CLICKED", BUTTON3_DOUBLE_CLICKED);
- SetDictInt("BUTTON3_TRIPLE_CLICKED", BUTTON3_TRIPLE_CLICKED);
-
- SetDictInt("BUTTON4_PRESSED", BUTTON4_PRESSED);
- SetDictInt("BUTTON4_RELEASED", BUTTON4_RELEASED);
- SetDictInt("BUTTON4_CLICKED", BUTTON4_CLICKED);
- SetDictInt("BUTTON4_DOUBLE_CLICKED", BUTTON4_DOUBLE_CLICKED);
- SetDictInt("BUTTON4_TRIPLE_CLICKED", BUTTON4_TRIPLE_CLICKED);
-
- SetDictInt("BUTTON_SHIFT", BUTTON_SHIFT);
- SetDictInt("BUTTON_CTRL", BUTTON_CTRL);
- SetDictInt("BUTTON_ALT", BUTTON_ALT);
-
- SetDictInt("ALL_MOUSE_EVENTS", ALL_MOUSE_EVENTS);
- SetDictInt("REPORT_MOUSE_POSITION", REPORT_MOUSE_POSITION);
+ /* Mouse-related constants */
+ SetDictInt("BUTTON1_PRESSED", BUTTON1_PRESSED);
+ SetDictInt("BUTTON1_RELEASED", BUTTON1_RELEASED);
+ SetDictInt("BUTTON1_CLICKED", BUTTON1_CLICKED);
+ SetDictInt("BUTTON1_DOUBLE_CLICKED", BUTTON1_DOUBLE_CLICKED);
+ SetDictInt("BUTTON1_TRIPLE_CLICKED", BUTTON1_TRIPLE_CLICKED);
+
+ SetDictInt("BUTTON2_PRESSED", BUTTON2_PRESSED);
+ SetDictInt("BUTTON2_RELEASED", BUTTON2_RELEASED);
+ SetDictInt("BUTTON2_CLICKED", BUTTON2_CLICKED);
+ SetDictInt("BUTTON2_DOUBLE_CLICKED", BUTTON2_DOUBLE_CLICKED);
+ SetDictInt("BUTTON2_TRIPLE_CLICKED", BUTTON2_TRIPLE_CLICKED);
+
+ SetDictInt("BUTTON3_PRESSED", BUTTON3_PRESSED);
+ SetDictInt("BUTTON3_RELEASED", BUTTON3_RELEASED);
+ SetDictInt("BUTTON3_CLICKED", BUTTON3_CLICKED);
+ SetDictInt("BUTTON3_DOUBLE_CLICKED", BUTTON3_DOUBLE_CLICKED);
+ SetDictInt("BUTTON3_TRIPLE_CLICKED", BUTTON3_TRIPLE_CLICKED);
+
+ SetDictInt("BUTTON4_PRESSED", BUTTON4_PRESSED);
+ SetDictInt("BUTTON4_RELEASED", BUTTON4_RELEASED);
+ SetDictInt("BUTTON4_CLICKED", BUTTON4_CLICKED);
+ SetDictInt("BUTTON4_DOUBLE_CLICKED", BUTTON4_DOUBLE_CLICKED);
+ SetDictInt("BUTTON4_TRIPLE_CLICKED", BUTTON4_TRIPLE_CLICKED);
+
+ SetDictInt("BUTTON_SHIFT", BUTTON_SHIFT);
+ SetDictInt("BUTTON_CTRL", BUTTON_CTRL);
+ SetDictInt("BUTTON_ALT", BUTTON_ALT);
+
+ SetDictInt("ALL_MOUSE_EVENTS", ALL_MOUSE_EVENTS);
+ SetDictInt("REPORT_MOUSE_POSITION", REPORT_MOUSE_POSITION);
#endif
- /* Now set everything up for KEY_ variables */
- {
- int key;
- char *key_n;
- char *key_n2;
+ /* Now set everything up for KEY_ variables */
+ {
+ int key;
+ char *key_n;
+ char *key_n2;
#if !defined(__NetBSD__)
- for (key=KEY_MIN;key < KEY_MAX; key++) {
- key_n = (char *)keyname(key);
- if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0)
- continue;
- if (strncmp(key_n,"KEY_F(",6)==0) {
- char *p1, *p2;
- key_n2 = malloc(strlen(key_n)+1);
- if (!key_n2) {
- PyErr_NoMemory();
- break;
- }
- p1 = key_n;
- p2 = key_n2;
- while (*p1) {
- if (*p1 != '(' && *p1 != ')') {
- *p2 = *p1;
- p2++;
- }
- p1++;
- }
- *p2 = (char)0;
- } else
- key_n2 = key_n;
- SetDictInt(key_n2,key);
- if (key_n2 != key_n)
- free(key_n2);
+ for (key=KEY_MIN;key < KEY_MAX; key++) {
+ key_n = (char *)keyname(key);
+ if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0)
+ continue;
+ if (strncmp(key_n,"KEY_F(",6)==0) {
+ char *p1, *p2;
+ key_n2 = malloc(strlen(key_n)+1);
+ if (!key_n2) {
+ PyErr_NoMemory();
+ break;
}
-#endif
- SetDictInt("KEY_MIN", KEY_MIN);
- SetDictInt("KEY_MAX", KEY_MAX);
- }
- return m;
+ p1 = key_n;
+ p2 = key_n2;
+ while (*p1) {
+ if (*p1 != '(' && *p1 != ')') {
+ *p2 = *p1;
+ p2++;
+ }
+ p1++;
+ }
+ *p2 = (char)0;
+ } else
+ key_n2 = key_n;
+ SetDictInt(key_n2,key);
+ if (key_n2 != key_n)
+ free(key_n2);
}
+#endif
+ SetDictInt("KEY_MIN", KEY_MIN);
+ SetDictInt("KEY_MAX", KEY_MAX);
+ }
+ return m;
+}
diff --git a/Modules/datetimemodule.c b/Modules/_datetimemodule.c
index 0ac51aaa7f..6ee531768a 100644
--- a/Modules/datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -3,12 +3,11 @@
*/
#include "Python.h"
-#include "modsupport.h"
#include "structmember.h"
#include <time.h>
-#include "timefuncs.h"
+#include "_time.h"
/* Differentiate between building the core module and building extension
* modules.
@@ -25,7 +24,7 @@
* final result fits in a C int (this can be an issue on 64-bit boxes).
*/
#if SIZEOF_INT < 4
-# error "datetime.c requires that C int have at least 32 bits"
+# error "_datetime.c requires that C int have at least 32 bits"
#endif
#define MINYEAR 1
@@ -88,8 +87,11 @@
/* p is a pointer to a time or a datetime object; HASTZINFO(p) returns
* p->hastzinfo.
*/
-#define HASTZINFO(p) (((_PyDateTime_BaseTZInfo *)(p))->hastzinfo)
-
+#define HASTZINFO(p) (((_PyDateTime_BaseTZInfo *)(p))->hastzinfo)
+#define GET_TIME_TZINFO(p) (HASTZINFO(p) ? \
+ ((PyDateTime_Time *)(p))->tzinfo : Py_None)
+#define GET_DT_TZINFO(p) (HASTZINFO(p) ? \
+ ((PyDateTime_DateTime *)(p))->tzinfo : Py_None)
/* M is a char or int claiming to be a valid month. The macro is equivalent
* to the two-sided Python test
* 1 <= M <= 12
@@ -102,6 +104,7 @@ static PyTypeObject PyDateTime_DateTimeType;
static PyTypeObject PyDateTime_DeltaType;
static PyTypeObject PyDateTime_TimeType;
static PyTypeObject PyDateTime_TZInfoType;
+static PyTypeObject PyDateTime_TimeZoneType;
/* ---------------------------------------------------------------------------
* Math utilities.
@@ -152,6 +155,25 @@ round_to_long(double x)
return (long)x;
}
+/* Nearest integer to m / n for integers m and n. Half-integer results
+ * are rounded to even.
+ */
+static PyObject *
+divide_nearest(PyObject *m, PyObject *n)
+{
+ PyObject *result;
+ PyObject *temp;
+
+ temp = _PyLong_DivmodNear(m, n);
+ if (temp == NULL)
+ return NULL;
+ result = PyTuple_GET_ITEM(temp, 0);
+ Py_INCREF(result);
+ Py_DECREF(temp);
+
+ return result;
+}
+
/* ---------------------------------------------------------------------------
* General calendrical helper functions
*/
@@ -218,16 +240,10 @@ days_before_year(int year)
int y = year - 1;
/* This is incorrect if year <= 0; we really want the floor
* here. But so long as MINYEAR is 1, the smallest year this
- * can see is 0 (this can happen in some normalization endcases),
- * so we'll just special-case that.
+ * can see is 1.
*/
- assert (year >= 0);
- if (y >= 0)
- return y*365 + y/4 - y/100 + y/400;
- else {
- assert(y == -1);
- return -366;
- }
+ assert (year >= 1);
+ return y*365 + y/4 - y/100 + y/400;
}
/* Number of days in 4, 100, and 400 year cycles. That these have
@@ -486,20 +502,10 @@ normalize_y_m_d(int *y, int *m, int *d)
{
int dim; /* # of days in month */
- /* This gets muddy: the proper range for day can't be determined
- * without knowing the correct month and year, but if day is, e.g.,
- * plus or minus a million, the current month and year values make
- * no sense (and may also be out of bounds themselves).
- * Saying 12 months == 1 year should be non-controversial.
+ /* In actual use, m is always the month component extracted from a
+ * date/datetime object. Therefore it is always in [1, 12] range.
*/
- if (*m < 1 || *m > 12) {
- --*m;
- normalize_pair(y, m, 12);
- ++*m;
- /* |y| can't be bigger than about
- * |original y| + |original m|/12 now.
- */
- }
+
assert(1 <= *m && *m <= 12);
/* Now only day can be out of bounds (year may also be out of bounds
@@ -752,6 +758,71 @@ new_delta_ex(int days, int seconds, int microseconds, int normalize,
#define new_delta(d, s, us, normalize) \
new_delta_ex(d, s, us, normalize, &PyDateTime_DeltaType)
+
+typedef struct
+{
+ PyObject_HEAD
+ PyObject *offset;
+ PyObject *name;
+} PyDateTime_TimeZone;
+
+/* The interned UTC timezone instance */
+static PyObject *PyDateTime_TimeZone_UTC;
+
+/* Create new timezone instance checking offset range. This
+ function does not check the name argument. Caller must assure
+ that offset is a timedelta instance and name is either NULL
+ or a unicode object. */
+static PyObject *
+create_timezone(PyObject *offset, PyObject *name)
+{
+ PyDateTime_TimeZone *self;
+ PyTypeObject *type = &PyDateTime_TimeZoneType;
+
+ assert(offset != NULL);
+ assert(PyDelta_Check(offset));
+ assert(name == NULL || PyUnicode_Check(name));
+
+ self = (PyDateTime_TimeZone *)(type->tp_alloc(type, 0));
+ if (self == NULL) {
+ return NULL;
+ }
+ Py_INCREF(offset);
+ self->offset = offset;
+ Py_XINCREF(name);
+ self->name = name;
+ return (PyObject *)self;
+}
+
+static int delta_bool(PyDateTime_Delta *self);
+
+static PyObject *
+new_timezone(PyObject *offset, PyObject *name)
+{
+ assert(offset != NULL);
+ assert(PyDelta_Check(offset));
+ assert(name == NULL || PyUnicode_Check(name));
+
+ if (name == NULL && delta_bool((PyDateTime_Delta *)offset) == 0) {
+ Py_INCREF(PyDateTime_TimeZone_UTC);
+ return PyDateTime_TimeZone_UTC;
+ }
+ if (GET_TD_MICROSECONDS(offset) != 0 || GET_TD_SECONDS(offset) % 60 != 0) {
+ PyErr_Format(PyExc_ValueError, "offset must be a timedelta"
+ " representing a whole number of minutes");
+ return NULL;
+ }
+ if ((GET_TD_DAYS(offset) == -1 && GET_TD_SECONDS(offset) == 0) ||
+ GET_TD_DAYS(offset) < -1 || GET_TD_DAYS(offset) >= 1) {
+ PyErr_Format(PyExc_ValueError, "offset must be a timedelta"
+ " strictly between -timedelta(hours=24) and"
+ " timedelta(hours=24).");
+ return NULL;
+ }
+
+ return create_timezone(offset, name);
+}
+
/* ---------------------------------------------------------------------------
* tzinfo helpers.
*/
@@ -771,25 +842,6 @@ check_tzinfo_subclass(PyObject *p)
return -1;
}
-/* Return tzinfo.methname(tzinfoarg), without any checking of results.
- * If tzinfo is None, returns None.
- */
-static PyObject *
-call_tzinfo_method(PyObject *tzinfo, char *methname, PyObject *tzinfoarg)
-{
- PyObject *result;
-
- assert(tzinfo && methname && tzinfoarg);
- assert(check_tzinfo_subclass(tzinfo) >= 0);
- if (tzinfo == Py_None) {
- result = Py_None;
- Py_INCREF(result);
- }
- else
- result = PyObject_CallMethod(tzinfo, methname, "O", tzinfoarg);
- return result;
-}
-
/* If self has a tzinfo member, return a BORROWED reference to it. Else
* return NULL, which is NOT AN ERROR. There are no error returns here,
* and the caller must not decref the result.
@@ -807,69 +859,53 @@ get_tzinfo_member(PyObject *self)
return tzinfo;
}
-/* Call getattr(tzinfo, name)(tzinfoarg), and extract an int from the
- * result. tzinfo must be an instance of the tzinfo class. If the method
- * returns None, this returns 0 and sets *none to 1. If the method doesn't
- * return None or timedelta, TypeError is raised and this returns -1. If it
- * returnsa timedelta and the value is out of range or isn't a whole number
- * of minutes, ValueError is raised and this returns -1.
- * Else *none is set to 0 and the integer method result is returned.
+/* Call getattr(tzinfo, name)(tzinfoarg), and check the result. tzinfo must
+ * be an instance of the tzinfo class. If the method returns None, this
+ * returns None. If the method doesn't return None or timedelta, TypeError is
+ * raised and this returns NULL. If it returns a timedelta and the value is
+ * out of range or isn't a whole number of minutes, ValueError is raised and
+ * this returns NULL. Else result is returned.
*/
-static int
-call_utc_tzinfo_method(PyObject *tzinfo, char *name, PyObject *tzinfoarg,
- int *none)
+static PyObject *
+call_tzinfo_method(PyObject *tzinfo, char *name, PyObject *tzinfoarg)
{
- PyObject *u;
- int result = -1;
+ PyObject *offset;
assert(tzinfo != NULL);
- assert(PyTZInfo_Check(tzinfo));
+ assert(PyTZInfo_Check(tzinfo) || tzinfo == Py_None);
assert(tzinfoarg != NULL);
- *none = 0;
- u = call_tzinfo_method(tzinfo, name, tzinfoarg);
- if (u == NULL)
- return -1;
-
- else if (u == Py_None) {
- result = 0;
- *none = 1;
- }
- else if (PyDelta_Check(u)) {
- const int days = GET_TD_DAYS(u);
- if (days < -1 || days > 0)
- result = 24*60; /* trigger ValueError below */
- else {
- /* next line can't overflow because we know days
- * is -1 or 0 now
- */
- int ss = days * 24 * 3600 + GET_TD_SECONDS(u);
- result = divmod(ss, 60, &ss);
- if (ss || GET_TD_MICROSECONDS(u)) {
- PyErr_Format(PyExc_ValueError,
- "tzinfo.%s() must return a "
- "whole number of minutes",
- name);
- result = -1;
- }
+ if (tzinfo == Py_None)
+ Py_RETURN_NONE;
+ offset = PyObject_CallMethod(tzinfo, name, "O", tzinfoarg);
+ if (offset == Py_None || offset == NULL)
+ return offset;
+ if (PyDelta_Check(offset)) {
+ if (GET_TD_MICROSECONDS(offset) != 0 || GET_TD_SECONDS(offset) % 60 != 0) {
+ Py_DECREF(offset);
+ PyErr_Format(PyExc_ValueError, "offset must be a timedelta"
+ " representing a whole number of minutes");
+ return NULL;
+ }
+ if ((GET_TD_DAYS(offset) == -1 && GET_TD_SECONDS(offset) == 0) ||
+ GET_TD_DAYS(offset) < -1 || GET_TD_DAYS(offset) >= 1) {
+ Py_DECREF(offset);
+ PyErr_Format(PyExc_ValueError, "offset must be a timedelta"
+ " strictly between -timedelta(hours=24) and"
+ " timedelta(hours=24).");
+ return NULL;
}
}
else {
+ Py_DECREF(offset);
PyErr_Format(PyExc_TypeError,
"tzinfo.%s() must return None or "
- "timedelta, not '%s'",
- name, Py_TYPE(u)->tp_name);
+ "timedelta, not '%.200s'",
+ name, Py_TYPE(offset)->tp_name);
+ return NULL;
}
- Py_DECREF(u);
- if (result < -1439 || result > 1439) {
- PyErr_Format(PyExc_ValueError,
- "tzinfo.%s() returned %d; must be in "
- "-1439 .. 1439",
- name, result);
- result = -1;
- }
- return result;
+ return offset;
}
/* Call tzinfo.utcoffset(tzinfoarg), and extract an integer from the
@@ -880,37 +916,10 @@ call_utc_tzinfo_method(PyObject *tzinfo, char *name, PyObject *tzinfoarg,
* # of minutes), ValueError is raised and this returns -1. Else *none is
* set to 0 and the offset is returned (as int # of minutes east of UTC).
*/
-static int
-call_utcoffset(PyObject *tzinfo, PyObject *tzinfoarg, int *none)
-{
- return call_utc_tzinfo_method(tzinfo, "utcoffset", tzinfoarg, none);
-}
-
-/* Call tzinfo.name(tzinfoarg), and return the offset as a timedelta or None.
- */
static PyObject *
-offset_as_timedelta(PyObject *tzinfo, char *name, PyObject *tzinfoarg) {
- PyObject *result;
-
- assert(tzinfo && name && tzinfoarg);
- if (tzinfo == Py_None) {
- result = Py_None;
- Py_INCREF(result);
- }
- else {
- int none;
- int offset = call_utc_tzinfo_method(tzinfo, name, tzinfoarg,
- &none);
- if (offset < 0 && PyErr_Occurred())
- return NULL;
- if (none) {
- result = Py_None;
- Py_INCREF(result);
- }
- else
- result = new_delta(0, offset * 60, 0, 1);
- }
- return result;
+call_utcoffset(PyObject *tzinfo, PyObject *tzinfoarg)
+{
+ return call_tzinfo_method(tzinfo, "utcoffset", tzinfoarg);
}
/* Call tzinfo.dst(tzinfoarg), and extract an integer from the
@@ -921,10 +930,10 @@ offset_as_timedelta(PyObject *tzinfo, char *name, PyObject *tzinfoarg) {
* ValueError is raised and this returns -1. Else *none is set to 0 and
* the offset is returned (as an int # of minutes east of UTC).
*/
-static int
-call_dst(PyObject *tzinfo, PyObject *tzinfoarg, int *none)
+static PyObject *
+call_dst(PyObject *tzinfo, PyObject *tzinfoarg)
{
- return call_utc_tzinfo_method(tzinfo, "dst", tzinfoarg, none);
+ return call_tzinfo_method(tzinfo, "dst", tzinfoarg);
}
/* Call tzinfo.tzname(tzinfoarg), and return the result. tzinfo must be
@@ -942,102 +951,23 @@ call_tzname(PyObject *tzinfo, PyObject *tzinfoarg)
assert(check_tzinfo_subclass(tzinfo) >= 0);
assert(tzinfoarg != NULL);
- if (tzinfo == Py_None) {
- result = Py_None;
- Py_INCREF(result);
- }
- else
- result = PyObject_CallMethod(tzinfo, "tzname", "O", tzinfoarg);
-
- if (result != NULL && result != Py_None) {
- if (!PyUnicode_Check(result)) {
- PyErr_Format(PyExc_TypeError, "tzinfo.tzname() must "
- "return None or a string, not '%s'",
- Py_TYPE(result)->tp_name);
- Py_DECREF(result);
- result = NULL;
- }
- }
- return result;
-}
+ if (tzinfo == Py_None)
+ Py_RETURN_NONE;
-typedef enum {
- /* an exception has been set; the caller should pass it on */
- OFFSET_ERROR,
-
- /* type isn't date, datetime, or time subclass */
- OFFSET_UNKNOWN,
-
- /* date,
- * datetime with !hastzinfo
- * datetime with None tzinfo,
- * datetime where utcoffset() returns None
- * time with !hastzinfo
- * time with None tzinfo,
- * time where utcoffset() returns None
- */
- OFFSET_NAIVE,
-
- /* time or datetime where utcoffset() doesn't return None */
- OFFSET_AWARE
-} naivety;
-
-/* Classify an object as to whether it's naive or offset-aware. See
- * the "naivety" typedef for details. If the type is aware, *offset is set
- * to minutes east of UTC (as returned by the tzinfo.utcoffset() method).
- * If the type is offset-naive (or unknown, or error), *offset is set to 0.
- * tzinfoarg is the argument to pass to the tzinfo.utcoffset() method.
- */
-static naivety
-classify_utcoffset(PyObject *op, PyObject *tzinfoarg, int *offset)
-{
- int none;
- PyObject *tzinfo;
+ result = PyObject_CallMethod(tzinfo, "tzname", "O", tzinfoarg);
- assert(tzinfoarg != NULL);
- *offset = 0;
- tzinfo = get_tzinfo_member(op); /* NULL means no tzinfo, not error */
- if (tzinfo == Py_None)
- return OFFSET_NAIVE;
- if (tzinfo == NULL) {
- /* note that a datetime passes the PyDate_Check test */
- return (PyTime_Check(op) || PyDate_Check(op)) ?
- OFFSET_NAIVE : OFFSET_UNKNOWN;
- }
- *offset = call_utcoffset(tzinfo, tzinfoarg, &none);
- if (*offset == -1 && PyErr_Occurred())
- return OFFSET_ERROR;
- return none ? OFFSET_NAIVE : OFFSET_AWARE;
-}
-
-/* Classify two objects as to whether they're naive or offset-aware.
- * This isn't quite the same as calling classify_utcoffset() twice: for
- * binary operations (comparison and subtraction), we generally want to
- * ignore the tzinfo members if they're identical. This is by design,
- * so that results match "naive" expectations when mixing objects from a
- * single timezone. So in that case, this sets both offsets to 0 and
- * both naiveties to OFFSET_NAIVE.
- * The function returns 0 if everything's OK, and -1 on error.
- */
-static int
-classify_two_utcoffsets(PyObject *o1, int *offset1, naivety *n1,
- PyObject *tzinfoarg1,
- PyObject *o2, int *offset2, naivety *n2,
- PyObject *tzinfoarg2)
-{
- if (get_tzinfo_member(o1) == get_tzinfo_member(o2)) {
- *offset1 = *offset2 = 0;
- *n1 = *n2 = OFFSET_NAIVE;
- }
- else {
- *n1 = classify_utcoffset(o1, tzinfoarg1, offset1);
- if (*n1 == OFFSET_ERROR)
- return -1;
- *n2 = classify_utcoffset(o2, tzinfoarg2, offset2);
- if (*n2 == OFFSET_ERROR)
- return -1;
+ if (result == NULL || result == Py_None)
+ return result;
+
+ if (!PyUnicode_Check(result)) {
+ PyErr_Format(PyExc_TypeError, "tzinfo.tzname() must "
+ "return None or a string, not '%s'",
+ Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ result = NULL;
}
- return 0;
+
+ return result;
}
/* repr is like "someclass(arg1, arg2)". If tzinfo isn't None,
@@ -1089,6 +1019,8 @@ format_ctime(PyDateTime_Date *date, int hours, int minutes, int seconds)
GET_YEAR(date));
}
+static PyObject *delta_negative(PyDateTime_Delta *self);
+
/* Add an hours & minutes UTC offset string to buf. buf has no more than
* buflen bytes remaining. The UTC offset is gotten by calling
* tzinfo.uctoffset(tzinfoarg). If that returns None, \0 is stored into
@@ -1103,28 +1035,41 @@ static int
format_utcoffset(char *buf, size_t buflen, const char *sep,
PyObject *tzinfo, PyObject *tzinfoarg)
{
- int offset;
- int hours;
- int minutes;
+ PyObject *offset;
+ int hours, minutes, seconds;
char sign;
- int none;
assert(buflen >= 1);
- offset = call_utcoffset(tzinfo, tzinfoarg, &none);
- if (offset == -1 && PyErr_Occurred())
+ offset = call_utcoffset(tzinfo, tzinfoarg);
+ if (offset == NULL)
return -1;
- if (none) {
+ if (offset == Py_None) {
+ Py_DECREF(offset);
*buf = '\0';
return 0;
}
- sign = '+';
- if (offset < 0) {
+ /* Offset is normalized, so it is negative if days < 0 */
+ if (GET_TD_DAYS(offset) < 0) {
+ PyObject *temp = offset;
sign = '-';
- offset = - offset;
+ offset = delta_negative((PyDateTime_Delta *)offset);
+ Py_DECREF(temp);
+ if (offset == NULL)
+ return -1;
+ }
+ else {
+ sign = '+';
}
- hours = divmod(offset, 60, &minutes);
+ /* Offset is not negative here. */
+ seconds = GET_TD_SECONDS(offset);
+ Py_DECREF(offset);
+ minutes = divmod(seconds, 60, &seconds);
+ hours = divmod(minutes, 60, &minutes);
+ assert(seconds == 0);
+ /* XXX ignore sub-minute data, curently not allowed. */
PyOS_snprintf(buf, buflen, "%c%02d%s%02d", sign, hours, sep, minutes);
+
return 0;
}
@@ -1221,10 +1166,10 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
if (!pin)
return NULL;
- /* Give up if the year is before 1900.
+ /* Give up if the year is before 1000.
* Python strftime() plays games with the year, and different
* games depending on whether envar PYTHON2K is set. This makes
- * years before 1900 a nightmare, even if the platform strftime
+ * years before 1000 a nightmare, even if the platform strftime
* supports them (and not all do).
* We could get a lot farther here by avoiding Python's strftime
* wrapper and calling the C strftime() directly, but that isn't
@@ -1237,10 +1182,10 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
assert(PyLong_Check(pyyear));
year = PyLong_AsLong(pyyear);
Py_DECREF(pyyear);
- if (year < 1900) {
+ if (year < 1000) {
PyErr_Format(PyExc_ValueError, "year=%ld is before "
- "1900; the datetime strftime() "
- "methods require year >= 1900",
+ "1000; the datetime strftime() "
+ "methods require year >= 1000",
year);
return NULL;
}
@@ -1312,7 +1257,8 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
assert(PyUnicode_Check(Zreplacement));
ptoappend = _PyUnicode_AsStringAndSize(Zreplacement,
&ntoappend);
- ntoappend = Py_SIZE(Zreplacement);
+ if (ptoappend == NULL)
+ goto Done;
}
else if (ch == 'f') {
/* format microseconds */
@@ -1366,7 +1312,7 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
format = PyUnicode_FromString(PyBytes_AS_STRING(newfmt));
if (format != NULL) {
result = PyObject_CallMethod(time, "strftime", "OO",
- format, timetuple);
+ format, timetuple, NULL);
Py_DECREF(format);
}
Py_DECREF(time);
@@ -1643,6 +1589,37 @@ multiply_int_timedelta(PyObject *intobj, PyDateTime_Delta *delta)
}
static PyObject *
+multiply_float_timedelta(PyObject *floatobj, PyDateTime_Delta *delta)
+{
+ PyObject *result = NULL;
+ PyObject *pyus_in = NULL, *temp, *pyus_out;
+ PyObject *ratio = NULL;
+
+ pyus_in = delta_to_microseconds(delta);
+ if (pyus_in == NULL)
+ return NULL;
+ ratio = PyObject_CallMethod(floatobj, "as_integer_ratio", NULL);
+ if (ratio == NULL)
+ goto error;
+ temp = PyNumber_Multiply(pyus_in, PyTuple_GET_ITEM(ratio, 0));
+ Py_DECREF(pyus_in);
+ pyus_in = NULL;
+ if (temp == NULL)
+ goto error;
+ pyus_out = divide_nearest(temp, PyTuple_GET_ITEM(ratio, 1));
+ Py_DECREF(temp);
+ if (pyus_out == NULL)
+ goto error;
+ result = microseconds_to_delta(pyus_out);
+ Py_DECREF(pyus_out);
+ error:
+ Py_XDECREF(pyus_in);
+ Py_XDECREF(ratio);
+
+ return result;
+}
+
+static PyObject *
divide_timedelta_int(PyDateTime_Delta *delta, PyObject *intobj)
{
PyObject *pyus_in;
@@ -1664,6 +1641,101 @@ divide_timedelta_int(PyDateTime_Delta *delta, PyObject *intobj)
}
static PyObject *
+divide_timedelta_timedelta(PyDateTime_Delta *left, PyDateTime_Delta *right)
+{
+ PyObject *pyus_left;
+ PyObject *pyus_right;
+ PyObject *result;
+
+ pyus_left = delta_to_microseconds(left);
+ if (pyus_left == NULL)
+ return NULL;
+
+ pyus_right = delta_to_microseconds(right);
+ if (pyus_right == NULL) {
+ Py_DECREF(pyus_left);
+ return NULL;
+ }
+
+ result = PyNumber_FloorDivide(pyus_left, pyus_right);
+ Py_DECREF(pyus_left);
+ Py_DECREF(pyus_right);
+ return result;
+}
+
+static PyObject *
+truedivide_timedelta_timedelta(PyDateTime_Delta *left, PyDateTime_Delta *right)
+{
+ PyObject *pyus_left;
+ PyObject *pyus_right;
+ PyObject *result;
+
+ pyus_left = delta_to_microseconds(left);
+ if (pyus_left == NULL)
+ return NULL;
+
+ pyus_right = delta_to_microseconds(right);
+ if (pyus_right == NULL) {
+ Py_DECREF(pyus_left);
+ return NULL;
+ }
+
+ result = PyNumber_TrueDivide(pyus_left, pyus_right);
+ Py_DECREF(pyus_left);
+ Py_DECREF(pyus_right);
+ return result;
+}
+
+static PyObject *
+truedivide_timedelta_float(PyDateTime_Delta *delta, PyObject *f)
+{
+ PyObject *result = NULL;
+ PyObject *pyus_in = NULL, *temp, *pyus_out;
+ PyObject *ratio = NULL;
+
+ pyus_in = delta_to_microseconds(delta);
+ if (pyus_in == NULL)
+ return NULL;
+ ratio = PyObject_CallMethod(f, "as_integer_ratio", NULL);
+ if (ratio == NULL)
+ goto error;
+ temp = PyNumber_Multiply(pyus_in, PyTuple_GET_ITEM(ratio, 1));
+ Py_DECREF(pyus_in);
+ pyus_in = NULL;
+ if (temp == NULL)
+ goto error;
+ pyus_out = divide_nearest(temp, PyTuple_GET_ITEM(ratio, 0));
+ Py_DECREF(temp);
+ if (pyus_out == NULL)
+ goto error;
+ result = microseconds_to_delta(pyus_out);
+ Py_DECREF(pyus_out);
+ error:
+ Py_XDECREF(pyus_in);
+ Py_XDECREF(ratio);
+
+ return result;
+}
+
+static PyObject *
+truedivide_timedelta_int(PyDateTime_Delta *delta, PyObject *i)
+{
+ PyObject *result;
+ PyObject *pyus_in, *pyus_out;
+ pyus_in = delta_to_microseconds(delta);
+ if (pyus_in == NULL)
+ return NULL;
+ pyus_out = divide_nearest(pyus_in, i);
+ Py_DECREF(pyus_in);
+ if (pyus_out == NULL)
+ return NULL;
+ result = microseconds_to_delta(pyus_out);
+ Py_DECREF(pyus_out);
+
+ return result;
+}
+
+static PyObject *
delta_add(PyObject *left, PyObject *right)
{
PyObject *result = Py_NotImplemented;
@@ -1729,13 +1801,14 @@ delta_subtract(PyObject *left, PyObject *right)
if (PyDelta_Check(left) && PyDelta_Check(right)) {
/* delta - delta */
- PyObject *minus_right = PyNumber_Negative(right);
- if (minus_right) {
- result = delta_add(left, minus_right);
- Py_DECREF(minus_right);
- }
- else
- result = NULL;
+ /* The C-level additions can't overflow because of the
+ * invariant bounds.
+ */
+ int days = GET_TD_DAYS(left) - GET_TD_DAYS(right);
+ int seconds = GET_TD_SECONDS(left) - GET_TD_SECONDS(right);
+ int microseconds = GET_TD_MICROSECONDS(left) -
+ GET_TD_MICROSECONDS(right);
+ result = new_delta(days, seconds, microseconds, 1);
}
if (result == Py_NotImplemented)
@@ -1743,17 +1816,24 @@ delta_subtract(PyObject *left, PyObject *right)
return result;
}
+static int
+delta_cmp(PyObject *self, PyObject *other)
+{
+ int diff = GET_TD_DAYS(self) - GET_TD_DAYS(other);
+ if (diff == 0) {
+ diff = GET_TD_SECONDS(self) - GET_TD_SECONDS(other);
+ if (diff == 0)
+ diff = GET_TD_MICROSECONDS(self) -
+ GET_TD_MICROSECONDS(other);
+ }
+ return diff;
+}
+
static PyObject *
delta_richcompare(PyObject *self, PyObject *other, int op)
{
if (PyDelta_Check(other)) {
- int diff = GET_TD_DAYS(self) - GET_TD_DAYS(other);
- if (diff == 0) {
- diff = GET_TD_SECONDS(self) - GET_TD_SECONDS(other);
- if (diff == 0)
- diff = GET_TD_MICROSECONDS(self) -
- GET_TD_MICROSECONDS(other);
- }
+ int diff = delta_cmp(self, other);
return diff_to_bool(diff, op);
}
else {
@@ -1764,7 +1844,7 @@ delta_richcompare(PyObject *self, PyObject *other, int op)
static PyObject *delta_getstate(PyDateTime_Delta *self);
-static long
+static Py_hash_t
delta_hash(PyDateTime_Delta *self)
{
if (self->hashcode == -1) {
@@ -1787,10 +1867,16 @@ delta_multiply(PyObject *left, PyObject *right)
if (PyLong_Check(right))
result = multiply_int_timedelta(right,
(PyDateTime_Delta *) left);
+ else if (PyFloat_Check(right))
+ result = multiply_float_timedelta(right,
+ (PyDateTime_Delta *) left);
}
else if (PyLong_Check(left))
result = multiply_int_timedelta(left,
- (PyDateTime_Delta *) right);
+ (PyDateTime_Delta *) right);
+ else if (PyFloat_Check(left))
+ result = multiply_float_timedelta(left,
+ (PyDateTime_Delta *) right);
if (result == Py_NotImplemented)
Py_INCREF(result);
@@ -1808,6 +1894,33 @@ delta_divide(PyObject *left, PyObject *right)
result = divide_timedelta_int(
(PyDateTime_Delta *)left,
right);
+ else if (PyDelta_Check(right))
+ result = divide_timedelta_timedelta(
+ (PyDateTime_Delta *)left,
+ (PyDateTime_Delta *)right);
+ }
+
+ if (result == Py_NotImplemented)
+ Py_INCREF(result);
+ return result;
+}
+
+static PyObject *
+delta_truedivide(PyObject *left, PyObject *right)
+{
+ PyObject *result = Py_NotImplemented;
+
+ if (PyDelta_Check(left)) {
+ if (PyDelta_Check(right))
+ result = truedivide_timedelta_timedelta(
+ (PyDateTime_Delta *)left,
+ (PyDateTime_Delta *)right);
+ else if (PyFloat_Check(right))
+ result = truedivide_timedelta_float(
+ (PyDateTime_Delta *)left, right);
+ else if (PyLong_Check(right))
+ result = truedivide_timedelta_int(
+ (PyDateTime_Delta *)left, right);
}
if (result == Py_NotImplemented)
@@ -1815,6 +1928,85 @@ delta_divide(PyObject *left, PyObject *right)
return result;
}
+static PyObject *
+delta_remainder(PyObject *left, PyObject *right)
+{
+ PyObject *pyus_left;
+ PyObject *pyus_right;
+ PyObject *pyus_remainder;
+ PyObject *remainder;
+
+ if (!PyDelta_Check(left) || !PyDelta_Check(right)) {
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+ }
+
+ pyus_left = delta_to_microseconds((PyDateTime_Delta *)left);
+ if (pyus_left == NULL)
+ return NULL;
+
+ pyus_right = delta_to_microseconds((PyDateTime_Delta *)right);
+ if (pyus_right == NULL) {
+ Py_DECREF(pyus_left);
+ return NULL;
+ }
+
+ pyus_remainder = PyNumber_Remainder(pyus_left, pyus_right);
+ Py_DECREF(pyus_left);
+ Py_DECREF(pyus_right);
+ if (pyus_remainder == NULL)
+ return NULL;
+
+ remainder = microseconds_to_delta(pyus_remainder);
+ Py_DECREF(pyus_remainder);
+ if (remainder == NULL)
+ return NULL;
+
+ return remainder;
+}
+
+static PyObject *
+delta_divmod(PyObject *left, PyObject *right)
+{
+ PyObject *pyus_left;
+ PyObject *pyus_right;
+ PyObject *divmod;
+ PyObject *delta;
+ PyObject *result;
+
+ if (!PyDelta_Check(left) || !PyDelta_Check(right)) {
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+ }
+
+ pyus_left = delta_to_microseconds((PyDateTime_Delta *)left);
+ if (pyus_left == NULL)
+ return NULL;
+
+ pyus_right = delta_to_microseconds((PyDateTime_Delta *)right);
+ if (pyus_right == NULL) {
+ Py_DECREF(pyus_left);
+ return NULL;
+ }
+
+ divmod = PyNumber_Divmod(pyus_left, pyus_right);
+ Py_DECREF(pyus_left);
+ Py_DECREF(pyus_right);
+ if (divmod == NULL)
+ return NULL;
+
+ assert(PyTuple_Size(divmod) == 2);
+ delta = microseconds_to_delta(PyTuple_GET_ITEM(divmod, 1));
+ if (delta == NULL) {
+ Py_DECREF(divmod);
+ return NULL;
+ }
+ result = PyTuple_Pack(2, PyTuple_GET_ITEM(divmod, 0), delta);
+ Py_DECREF(delta);
+ Py_DECREF(divmod);
+ return result;
+}
+
/* Fold in the value of the tag ("seconds", "weeks", etc) component of a
* timedelta constructor. sofar is the # of microseconds accounted for
* so far, and there are factor microseconds per current unit, the number
@@ -2061,6 +2253,30 @@ delta_getstate(PyDateTime_Delta *self)
}
static PyObject *
+delta_total_seconds(PyObject *self)
+{
+ PyObject *total_seconds;
+ PyObject *total_microseconds;
+ PyObject *one_million;
+
+ total_microseconds = delta_to_microseconds((PyDateTime_Delta *)self);
+ if (total_microseconds == NULL)
+ return NULL;
+
+ one_million = PyLong_FromLong(1000000L);
+ if (one_million == NULL) {
+ Py_DECREF(total_microseconds);
+ return NULL;
+ }
+
+ total_seconds = PyNumber_TrueDivide(total_microseconds, one_million);
+
+ Py_DECREF(total_microseconds);
+ Py_DECREF(one_million);
+ return total_seconds;
+}
+
+static PyObject *
delta_reduce(PyDateTime_Delta* self)
{
return Py_BuildValue("ON", Py_TYPE(self), delta_getstate(self));
@@ -2082,7 +2298,10 @@ static PyMemberDef delta_members[] = {
};
static PyMethodDef delta_methods[] = {
- {"__reduce__", (PyCFunction)delta_reduce, METH_NOARGS,
+ {"total_seconds", (PyCFunction)delta_total_seconds, METH_NOARGS,
+ PyDoc_STR("Total seconds in the duration.")},
+
+ {"__reduce__", (PyCFunction)delta_reduce, METH_NOARGS,
PyDoc_STR("__reduce__() -> (cls, state)")},
{NULL, NULL},
@@ -2095,8 +2314,8 @@ static PyNumberMethods delta_as_number = {
delta_add, /* nb_add */
delta_subtract, /* nb_subtract */
delta_multiply, /* nb_multiply */
- 0, /* nb_remainder */
- 0, /* nb_divmod */
+ delta_remainder, /* nb_remainder */
+ delta_divmod, /* nb_divmod */
0, /* nb_power */
(unaryfunc)delta_negative, /* nb_negative */
(unaryfunc)delta_positive, /* nb_positive */
@@ -2122,7 +2341,7 @@ static PyNumberMethods delta_as_number = {
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
delta_divide, /* nb_floor_divide */
- 0, /* nb_true_divide */
+ delta_truedivide, /* nb_true_divide */
0, /* nb_inplace_floor_divide */
0, /* nb_inplace_true_divide */
};
@@ -2559,11 +2778,11 @@ date_replace(PyDateTime_Date *self, PyObject *args, PyObject *kw)
/*
Borrowed from stringobject.c, originally it was string_hash()
*/
-static long
+static Py_hash_t
generic_hash(unsigned char *data, int len)
{
register unsigned char *p;
- register long x;
+ register Py_hash_t x;
p = (unsigned char *) data;
x = *p << 7;
@@ -2579,7 +2798,7 @@ generic_hash(unsigned char *data, int len)
static PyObject *date_getstate(PyDateTime_Date *self);
-static long
+static Py_hash_t
date_hash(PyDateTime_Date *self)
{
if (self->hashcode == -1)
@@ -2786,76 +3005,73 @@ tzinfo_dst(PyDateTime_TZInfo *self, PyObject *dt)
return tzinfo_nogo("dst");
}
+
+static PyObject *add_datetime_timedelta(PyDateTime_DateTime *date,
+ PyDateTime_Delta *delta,
+ int factor);
+static PyObject *datetime_utcoffset(PyObject *self, PyObject *);
+static PyObject *datetime_dst(PyObject *self, PyObject *);
+
static PyObject *
-tzinfo_fromutc(PyDateTime_TZInfo *self, PyDateTime_DateTime *dt)
+tzinfo_fromutc(PyDateTime_TZInfo *self, PyObject *dt)
{
- int y, m, d, hh, mm, ss, us;
-
- PyObject *result;
- int off, dst;
- int none;
- int delta;
+ PyObject *result = NULL;
+ PyObject *off = NULL, *dst = NULL;
+ PyDateTime_Delta *delta = NULL;
- if (! PyDateTime_Check(dt)) {
+ if (!PyDateTime_Check(dt)) {
PyErr_SetString(PyExc_TypeError,
"fromutc: argument must be a datetime");
return NULL;
}
- if (! HASTZINFO(dt) || dt->tzinfo != (PyObject *)self) {
+ if (GET_DT_TZINFO(dt) != (PyObject *)self) {
PyErr_SetString(PyExc_ValueError, "fromutc: dt.tzinfo "
"is not self");
return NULL;
}
- off = call_utcoffset(dt->tzinfo, (PyObject *)dt, &none);
- if (off == -1 && PyErr_Occurred())
+ off = datetime_utcoffset(dt, NULL);
+ if (off == NULL)
return NULL;
- if (none) {
+ if (off == Py_None) {
PyErr_SetString(PyExc_ValueError, "fromutc: non-None "
"utcoffset() result required");
- return NULL;
+ goto Fail;
}
- dst = call_dst(dt->tzinfo, (PyObject *)dt, &none);
- if (dst == -1 && PyErr_Occurred())
- return NULL;
- if (none) {
+ dst = datetime_dst(dt, NULL);
+ if (dst == NULL)
+ goto Fail;
+ if (dst == Py_None) {
PyErr_SetString(PyExc_ValueError, "fromutc: non-None "
"dst() result required");
- return NULL;
+ goto Fail;
}
- y = GET_YEAR(dt);
- m = GET_MONTH(dt);
- d = GET_DAY(dt);
- hh = DATE_GET_HOUR(dt);
- mm = DATE_GET_MINUTE(dt);
- ss = DATE_GET_SECOND(dt);
- us = DATE_GET_MICROSECOND(dt);
-
- delta = off - dst;
- mm += delta;
- if ((mm < 0 || mm >= 60) &&
- normalize_datetime(&y, &m, &d, &hh, &mm, &ss, &us) < 0)
- return NULL;
- result = new_datetime(y, m, d, hh, mm, ss, us, dt->tzinfo);
+ delta = (PyDateTime_Delta *)delta_subtract(off, dst);
+ if (delta == NULL)
+ goto Fail;
+ result = add_datetime_timedelta((PyDateTime_DateTime *)dt, delta, 1);
if (result == NULL)
- return result;
-
- dst = call_dst(dt->tzinfo, result, &none);
- if (dst == -1 && PyErr_Occurred())
goto Fail;
- if (none)
- goto Inconsistent;
- if (dst == 0)
- return result;
- mm += dst;
- if ((mm < 0 || mm >= 60) &&
- normalize_datetime(&y, &m, &d, &hh, &mm, &ss, &us) < 0)
+ Py_DECREF(dst);
+ dst = call_dst(GET_DT_TZINFO(dt), result);
+ if (dst == NULL)
goto Fail;
- Py_DECREF(result);
- result = new_datetime(y, m, d, hh, mm, ss, us, dt->tzinfo);
+ if (dst == Py_None)
+ goto Inconsistent;
+ if (delta_bool(delta) != 0) {
+ PyObject *temp = result;
+ result = add_datetime_timedelta((PyDateTime_DateTime *)result,
+ (PyDateTime_Delta *)dst, 1);
+ Py_DECREF(temp);
+ if (result == NULL)
+ goto Fail;
+ }
+ Py_DECREF(delta);
+ Py_DECREF(dst);
+ Py_DECREF(off);
return result;
Inconsistent:
@@ -2864,7 +3080,10 @@ Inconsistent:
/* fall thru to failure */
Fail:
- Py_DECREF(result);
+ Py_XDECREF(off);
+ Py_XDECREF(dst);
+ Py_XDECREF(delta);
+ Py_XDECREF(result);
return NULL;
}
@@ -2934,15 +3153,14 @@ static PyMethodDef tzinfo_methods[] = {
PyDoc_STR("datetime -> string name of time zone.")},
{"utcoffset", (PyCFunction)tzinfo_utcoffset, METH_O,
- PyDoc_STR("datetime -> minutes east of UTC (negative for "
- "west of UTC).")},
+ PyDoc_STR("datetime -> timedelta showing offset from UTC, negative "
+ "values indicating West of UTC")},
{"dst", (PyCFunction)tzinfo_dst, METH_O,
PyDoc_STR("datetime -> DST offset in minutes east of UTC.")},
{"fromutc", (PyCFunction)tzinfo_fromutc, METH_O,
- PyDoc_STR("datetime -> timedelta showing offset from UTC, negative "
- "values indicating West of UTC")},
+ PyDoc_STR("datetime in UTC -> datetime in local time.")},
{"__reduce__", (PyCFunction)tzinfo_reduce, METH_NOARGS,
PyDoc_STR("-> (cls, state)")},
@@ -2973,7 +3191,7 @@ static PyTypeObject PyDateTime_TZInfoType = {
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
tzinfo_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
@@ -2995,6 +3213,231 @@ static PyTypeObject PyDateTime_TZInfoType = {
0, /* tp_free */
};
+static char *timezone_kws[] = {"offset", "name", NULL};
+
+static PyObject *
+timezone_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ PyObject *offset;
+ PyObject *name = NULL;
+ if (PyArg_ParseTupleAndKeywords(args, kw, "O!|O!:timezone", timezone_kws,
+ &PyDateTime_DeltaType, &offset,
+ &PyUnicode_Type, &name))
+ return new_timezone(offset, name);
+
+ return NULL;
+}
+
+static void
+timezone_dealloc(PyDateTime_TimeZone *self)
+{
+ Py_CLEAR(self->offset);
+ Py_CLEAR(self->name);
+ Py_TYPE(self)->tp_free((PyObject *)self);
+}
+
+static PyObject *
+timezone_richcompare(PyDateTime_TimeZone *self,
+ PyDateTime_TimeZone *other, int op)
+{
+ if (op != Py_EQ && op != Py_NE) {
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+ }
+ return delta_richcompare(self->offset, other->offset, op);
+}
+
+static Py_hash_t
+timezone_hash(PyDateTime_TimeZone *self)
+{
+ return delta_hash((PyDateTime_Delta *)self->offset);
+}
+
+/* Check argument type passed to tzname, utcoffset, or dst methods.
+ Returns 0 for good argument. Returns -1 and sets exception info
+ otherwise.
+ */
+static int
+_timezone_check_argument(PyObject *dt, const char *meth)
+{
+ if (dt == Py_None || PyDateTime_Check(dt))
+ return 0;
+ PyErr_Format(PyExc_TypeError, "%s(dt) argument must be a datetime instance"
+ " or None, not %.200s", meth, Py_TYPE(dt)->tp_name);
+ return -1;
+}
+
+static PyObject *
+timezone_repr(PyDateTime_TimeZone *self)
+{
+ /* Note that although timezone is not subclassable, it is convenient
+ to use Py_TYPE(self)->tp_name here. */
+ const char *type_name = Py_TYPE(self)->tp_name;
+
+ if (((PyObject *)self) == PyDateTime_TimeZone_UTC)
+ return PyUnicode_FromFormat("%s.utc", type_name);
+
+ if (self->name == NULL)
+ return PyUnicode_FromFormat("%s(%R)", type_name, self->offset);
+
+ return PyUnicode_FromFormat("%s(%R, %R)", type_name, self->offset,
+ self->name);
+}
+
+
+static PyObject *
+timezone_str(PyDateTime_TimeZone *self)
+{
+ char buf[10];
+ int hours, minutes, seconds;
+ PyObject *offset;
+ char sign;
+
+ if (self->name != NULL) {
+ Py_INCREF(self->name);
+ return self->name;
+ }
+ /* Offset is normalized, so it is negative if days < 0 */
+ if (GET_TD_DAYS(self->offset) < 0) {
+ sign = '-';
+ offset = delta_negative((PyDateTime_Delta *)self->offset);
+ if (offset == NULL)
+ return NULL;
+ }
+ else {
+ sign = '+';
+ offset = self->offset;
+ Py_INCREF(offset);
+ }
+ /* Offset is not negative here. */
+ seconds = GET_TD_SECONDS(offset);
+ Py_DECREF(offset);
+ minutes = divmod(seconds, 60, &seconds);
+ hours = divmod(minutes, 60, &minutes);
+ assert(seconds == 0);
+ /* XXX ignore sub-minute data, curently not allowed. */
+ PyOS_snprintf(buf, sizeof(buf), "UTC%c%02d:%02d", sign, hours, minutes);
+
+ return PyUnicode_FromString(buf);
+}
+
+static PyObject *
+timezone_tzname(PyDateTime_TimeZone *self, PyObject *dt)
+{
+ if (_timezone_check_argument(dt, "tzname") == -1)
+ return NULL;
+
+ return timezone_str(self);
+}
+
+static PyObject *
+timezone_utcoffset(PyDateTime_TimeZone *self, PyObject *dt)
+{
+ if (_timezone_check_argument(dt, "utcoffset") == -1)
+ return NULL;
+
+ Py_INCREF(self->offset);
+ return self->offset;
+}
+
+static PyObject *
+timezone_dst(PyObject *self, PyObject *dt)
+{
+ if (_timezone_check_argument(dt, "dst") == -1)
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+timezone_fromutc(PyDateTime_TimeZone *self, PyDateTime_DateTime *dt)
+{
+ if (!PyDateTime_Check(dt)) {
+ PyErr_SetString(PyExc_TypeError,
+ "fromutc: argument must be a datetime");
+ return NULL;
+ }
+ if (!HASTZINFO(dt) || dt->tzinfo != (PyObject *)self) {
+ PyErr_SetString(PyExc_ValueError, "fromutc: dt.tzinfo "
+ "is not self");
+ return NULL;
+ }
+
+ return add_datetime_timedelta(dt, (PyDateTime_Delta *)self->offset, 1);
+}
+
+static PyObject *
+timezone_getinitargs(PyDateTime_TimeZone *self)
+{
+ if (self->name == NULL)
+ return Py_BuildValue("(O)", self->offset);
+ return Py_BuildValue("(OO)", self->offset, self->name);
+}
+
+static PyMethodDef timezone_methods[] = {
+ {"tzname", (PyCFunction)timezone_tzname, METH_O,
+ PyDoc_STR("If name is specified when timezone is created, returns the name."
+ " Otherwise returns offset as 'UTC(+|-)HH:MM'.")},
+
+ {"utcoffset", (PyCFunction)timezone_utcoffset, METH_O,
+ PyDoc_STR("Return fixed offset.")},
+
+ {"dst", (PyCFunction)timezone_dst, METH_O,
+ PyDoc_STR("Return None.")},
+
+ {"fromutc", (PyCFunction)timezone_fromutc, METH_O,
+ PyDoc_STR("datetime in UTC -> datetime in local time.")},
+
+ {"__getinitargs__", (PyCFunction)timezone_getinitargs, METH_NOARGS,
+ PyDoc_STR("pickle support")},
+
+ {NULL, NULL}
+};
+
+static char timezone_doc[] =
+PyDoc_STR("Fixed offset from UTC implementation of tzinfo.");
+
+static PyTypeObject PyDateTime_TimeZoneType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "datetime.timezone", /* tp_name */
+ sizeof(PyDateTime_TimeZone), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)timezone_dealloc, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ (reprfunc)timezone_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)timezone_hash, /* tp_hash */
+ 0, /* tp_call */
+ (reprfunc)timezone_str, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ timezone_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ (richcmpfunc)timezone_richcompare,/* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ timezone_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &PyDateTime_TZInfoType, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ timezone_new, /* tp_new */
+};
+
/*
* PyDateTime_Time implementation.
*/
@@ -3128,21 +3571,18 @@ time_dealloc(PyDateTime_Time *self)
/* These are all METH_NOARGS, so don't need to check the arglist. */
static PyObject *
-time_utcoffset(PyDateTime_Time *self, PyObject *unused) {
- return offset_as_timedelta(HASTZINFO(self) ? self->tzinfo : Py_None,
- "utcoffset", Py_None);
+time_utcoffset(PyObject *self, PyObject *unused) {
+ return call_utcoffset(GET_TIME_TZINFO(self), Py_None);
}
static PyObject *
-time_dst(PyDateTime_Time *self, PyObject *unused) {
- return offset_as_timedelta(HASTZINFO(self) ? self->tzinfo : Py_None,
- "dst", Py_None);
+time_dst(PyObject *self, PyObject *unused) {
+ return call_dst(GET_TIME_TZINFO(self), Py_None);
}
static PyObject *
time_tzname(PyDateTime_Time *self, PyObject *unused) {
- return call_tzname(HASTZINFO(self) ? self->tzinfo : Py_None,
- Py_None);
+ return call_tzname(GET_TIME_TZINFO(self), Py_None);
}
/*
@@ -3197,7 +3637,7 @@ time_isoformat(PyDateTime_Time *self, PyObject *unused)
TIME_GET_MINUTE(self),
TIME_GET_SECOND(self));
- if (result == NULL || ! HASTZINFO(self) || self->tzinfo == Py_None)
+ if (result == NULL || !HASTZINFO(self) || self->tzinfo == Py_None)
return result;
/* We need to append the UTC offset. */
@@ -3224,7 +3664,7 @@ time_strftime(PyDateTime_Time *self, PyObject *args, PyObject *kw)
/* Python's strftime does insane things with the year part of the
* timetuple. The year is forced to (the otherwise nonsensical)
- * 1900 to worm around that.
+ * 1900 to work around that.
*/
tuple = Py_BuildValue("iiiiiiiii",
1900, 1, 1, /* year, month, day */
@@ -3248,98 +3688,108 @@ time_strftime(PyDateTime_Time *self, PyObject *args, PyObject *kw)
static PyObject *
time_richcompare(PyObject *self, PyObject *other, int op)
{
+ PyObject *result = NULL;
+ PyObject *offset1, *offset2;
int diff;
- naivety n1, n2;
- int offset1, offset2;
if (! PyTime_Check(other)) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
- if (classify_two_utcoffsets(self, &offset1, &n1, Py_None,
- other, &offset2, &n2, Py_None) < 0)
+
+ if (GET_TIME_TZINFO(self) == GET_TIME_TZINFO(other)) {
+ diff = memcmp(((PyDateTime_Time *)self)->data,
+ ((PyDateTime_Time *)other)->data,
+ _PyDateTime_TIME_DATASIZE);
+ return diff_to_bool(diff, op);
+ }
+ offset1 = time_utcoffset(self, NULL);
+ if (offset1 == NULL)
return NULL;
- assert(n1 != OFFSET_UNKNOWN && n2 != OFFSET_UNKNOWN);
+ offset2 = time_utcoffset(other, NULL);
+ if (offset2 == NULL)
+ goto done;
/* If they're both naive, or both aware and have the same offsets,
* we get off cheap. Note that if they're both naive, offset1 ==
- * offset2 == 0 at this point.
+ * offset2 == Py_None at this point.
*/
- if (n1 == n2 && offset1 == offset2) {
+ if ((offset1 == offset2) ||
+ (PyDelta_Check(offset1) && PyDelta_Check(offset2) &&
+ delta_cmp(offset1, offset2) == 0)) {
diff = memcmp(((PyDateTime_Time *)self)->data,
((PyDateTime_Time *)other)->data,
_PyDateTime_TIME_DATASIZE);
- return diff_to_bool(diff, op);
+ result = diff_to_bool(diff, op);
}
-
- if (n1 == OFFSET_AWARE && n2 == OFFSET_AWARE) {
- assert(offset1 != offset2); /* else last "if" handled it */
- /* Convert everything except microseconds to seconds. These
- * can't overflow (no more than the # of seconds in 2 days).
- */
- offset1 = TIME_GET_HOUR(self) * 3600 +
- (TIME_GET_MINUTE(self) - offset1) * 60 +
- TIME_GET_SECOND(self);
- offset2 = TIME_GET_HOUR(other) * 3600 +
- (TIME_GET_MINUTE(other) - offset2) * 60 +
- TIME_GET_SECOND(other);
- diff = offset1 - offset2;
+ /* The hard case: both aware with different UTC offsets */
+ else if (offset1 != Py_None && offset2 != Py_None) {
+ int offsecs1, offsecs2;
+ assert(offset1 != offset2); /* else last "if" handled it */
+ offsecs1 = TIME_GET_HOUR(self) * 3600 +
+ TIME_GET_MINUTE(self) * 60 +
+ TIME_GET_SECOND(self) -
+ GET_TD_DAYS(offset1) * 86400 -
+ GET_TD_SECONDS(offset1);
+ offsecs2 = TIME_GET_HOUR(other) * 3600 +
+ TIME_GET_MINUTE(other) * 60 +
+ TIME_GET_SECOND(other) -
+ GET_TD_DAYS(offset2) * 86400 -
+ GET_TD_SECONDS(offset2);
+ diff = offsecs1 - offsecs2;
if (diff == 0)
diff = TIME_GET_MICROSECOND(self) -
TIME_GET_MICROSECOND(other);
- return diff_to_bool(diff, op);
+ result = diff_to_bool(diff, op);
}
-
- assert(n1 != n2);
- PyErr_SetString(PyExc_TypeError,
- "can't compare offset-naive and "
- "offset-aware times");
- return NULL;
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "can't compare offset-naive and "
+ "offset-aware times");
+ }
+ done:
+ Py_DECREF(offset1);
+ Py_XDECREF(offset2);
+ return result;
}
-static long
+static Py_hash_t
time_hash(PyDateTime_Time *self)
{
if (self->hashcode == -1) {
- naivety n;
- int offset;
- PyObject *temp;
+ PyObject *offset;
+
+ offset = time_utcoffset((PyObject *)self, NULL);
- n = classify_utcoffset((PyObject *)self, Py_None, &offset);
- assert(n != OFFSET_UNKNOWN);
- if (n == OFFSET_ERROR)
+ if (offset == NULL)
return -1;
/* Reduce this to a hash of another object. */
- if (offset == 0) {
+ if (offset == Py_None)
self->hashcode = generic_hash(
(unsigned char *)self->data, _PyDateTime_TIME_DATASIZE);
- return self->hashcode;
- }
else {
- int hour;
- int minute;
-
- assert(n == OFFSET_AWARE);
+ PyObject *temp1, *temp2;
+ int seconds, microseconds;
assert(HASTZINFO(self));
- hour = divmod(TIME_GET_HOUR(self) * 60 +
- TIME_GET_MINUTE(self) - offset,
- 60,
- &minute);
- if (0 <= hour && hour < 24)
- temp = new_time(hour, minute,
- TIME_GET_SECOND(self),
- TIME_GET_MICROSECOND(self),
- Py_None);
- else
- temp = Py_BuildValue("iiii",
- hour, minute,
- TIME_GET_SECOND(self),
- TIME_GET_MICROSECOND(self));
- }
- if (temp != NULL) {
- self->hashcode = PyObject_Hash(temp);
- Py_DECREF(temp);
+ seconds = TIME_GET_HOUR(self) * 3600 +
+ TIME_GET_MINUTE(self) * 60 +
+ TIME_GET_SECOND(self);
+ microseconds = TIME_GET_MICROSECOND(self);
+ temp1 = new_delta(0, seconds, microseconds, 1);
+ if (temp1 == NULL) {
+ Py_DECREF(offset);
+ return -1;
+ }
+ temp2 = delta_subtract(temp1, offset);
+ Py_DECREF(temp1);
+ if (temp2 == NULL) {
+ Py_DECREF(offset);
+ return -1;
+ }
+ self->hashcode = PyObject_Hash(temp2);
+ Py_DECREF(temp2);
}
+ Py_DECREF(offset);
}
return self->hashcode;
}
@@ -3368,10 +3818,10 @@ time_replace(PyDateTime_Time *self, PyObject *args, PyObject *kw)
}
static int
-time_bool(PyDateTime_Time *self)
+time_bool(PyObject *self)
{
- int offset;
- int none;
+ PyObject *offset, *tzinfo;
+ int offsecs = 0;
if (TIME_GET_SECOND(self) || TIME_GET_MICROSECOND(self)) {
/* Since utcoffset is in whole minutes, nothing can
@@ -3379,13 +3829,15 @@ time_bool(PyDateTime_Time *self)
*/
return 1;
}
- offset = 0;
- if (HASTZINFO(self) && self->tzinfo != Py_None) {
- offset = call_utcoffset(self->tzinfo, Py_None, &none);
- if (offset == -1 && PyErr_Occurred())
+ tzinfo = GET_TIME_TZINFO(self);
+ if (tzinfo != Py_None) {
+ offset = call_utcoffset(tzinfo, Py_None);
+ if (offset == NULL)
return -1;
+ offsecs = GET_TD_DAYS(offset)*86400 + GET_TD_SECONDS(offset);
+ Py_DECREF(offset);
}
- return (TIME_GET_MINUTE(self) - offset + TIME_GET_HOUR(self)*60) != 0;
+ return (TIME_GET_MINUTE(self)*60 - offsecs + TIME_GET_HOUR(self)*3600) != 0;
}
/* Pickle support, a simple use of __reduce__. */
@@ -3716,37 +4168,10 @@ datetime_from_timestamp(PyObject *cls, TM_FUNC f, double timestamp,
static PyObject *
datetime_best_possible(PyObject *cls, TM_FUNC f, PyObject *tzinfo)
{
-#ifdef HAVE_GETTIMEOFDAY
- struct timeval t;
-
-#ifdef GETTIMEOFDAY_NO_TZ
- gettimeofday(&t);
-#else
- gettimeofday(&t, (struct timezone *)NULL);
-#endif
+ _PyTime_timeval t;
+ _PyTime_gettimeofday(&t);
return datetime_from_timet_and_us(cls, f, t.tv_sec, (int)t.tv_usec,
tzinfo);
-
-#else /* ! HAVE_GETTIMEOFDAY */
- /* No flavor of gettimeofday exists on this platform. Python's
- * time.time() does a lot of other platform tricks to get the
- * best time it can on the platform, and we're not going to do
- * better than that (if we could, the better code would belong
- * in time.time()!) We're limited by the precision of a double,
- * though.
- */
- PyObject *time;
- double dtime;
-
- time = time_time();
- if (time == NULL)
- return NULL;
- dtime = PyFloat_AsDouble(time);
- Py_DECREF(time);
- if (dtime == -1.0 && PyErr_Occurred())
- return NULL;
- return datetime_from_timestamp(cls, f, dtime, tzinfo);
-#endif /* ! HAVE_GETTIMEOFDAY */
}
/* Return best possible local time -- this isn't constrained by the
@@ -3827,82 +4252,23 @@ datetime_utcfromtimestamp(PyObject *cls, PyObject *args)
return result;
}
-/* Return new datetime from time.strptime(). */
+/* Return new datetime from _strptime.strptime_datetime(). */
static PyObject *
datetime_strptime(PyObject *cls, PyObject *args)
{
static PyObject *module = NULL;
- PyObject *result = NULL, *obj, *st = NULL, *frac = NULL;
const Py_UNICODE *string, *format;
if (!PyArg_ParseTuple(args, "uu:strptime", &string, &format))
return NULL;
- if (module == NULL &&
- (module = PyImport_ImportModuleNoBlock("_strptime")) == NULL)
- return NULL;
-
- /* _strptime._strptime returns a two-element tuple. The first
- element is a time.struct_time object. The second is the
- microseconds (which are not defined for time.struct_time). */
- obj = PyObject_CallMethod(module, "_strptime", "uu", string, format);
- if (obj != NULL) {
- int i, good_timetuple = 1;
- long int ia[7];
- if (PySequence_Check(obj) && PySequence_Size(obj) == 2) {
- st = PySequence_GetItem(obj, 0);
- frac = PySequence_GetItem(obj, 1);
- if (st == NULL || frac == NULL)
- good_timetuple = 0;
- /* copy y/m/d/h/m/s values out of the
- time.struct_time */
- if (good_timetuple &&
- PySequence_Check(st) &&
- PySequence_Size(st) >= 6) {
- for (i=0; i < 6; i++) {
- PyObject *p = PySequence_GetItem(st, i);
- if (p == NULL) {
- good_timetuple = 0;
- break;
- }
- if (PyLong_Check(p))
- ia[i] = PyLong_AsLong(p);
- else
- good_timetuple = 0;
- Py_DECREF(p);
- }
-/* if (PyLong_CheckExact(p)) {
- ia[i] = PyLong_AsLongAndOverflow(p, &overflow);
- if (overflow)
- good_timetuple = 0;
- }
- else
- good_timetuple = 0;
- Py_DECREF(p);
-*/ }
- else
- good_timetuple = 0;
- /* follow that up with a little dose of microseconds */
- if (PyLong_Check(frac))
- ia[6] = PyLong_AsLong(frac);
- else
- good_timetuple = 0;
- }
- else
- good_timetuple = 0;
- if (good_timetuple)
- result = PyObject_CallFunction(cls, "iiiiiii",
- ia[0], ia[1], ia[2],
- ia[3], ia[4], ia[5],
- ia[6]);
- else
- PyErr_SetString(PyExc_ValueError,
- "unexpected value from _strptime._strptime");
+ if (module == NULL) {
+ module = PyImport_ImportModuleNoBlock("_strptime");
+ if (module == NULL)
+ return NULL;
}
- Py_XDECREF(obj);
- Py_XDECREF(st);
- Py_XDECREF(frac);
- return result;
+ return PyObject_CallMethod(module, "_strptime_datetime", "Ouu",
+ cls, string, format);
}
/* Return new datetime from date/datetime and time arguments. */
@@ -3953,21 +4319,18 @@ datetime_dealloc(PyDateTime_DateTime *self)
/* These are all METH_NOARGS, so don't need to check the arglist. */
static PyObject *
-datetime_utcoffset(PyDateTime_DateTime *self, PyObject *unused) {
- return offset_as_timedelta(HASTZINFO(self) ? self->tzinfo : Py_None,
- "utcoffset", (PyObject *)self);
+datetime_utcoffset(PyObject *self, PyObject *unused) {
+ return call_utcoffset(GET_DT_TZINFO(self), self);
}
static PyObject *
-datetime_dst(PyDateTime_DateTime *self, PyObject *unused) {
- return offset_as_timedelta(HASTZINFO(self) ? self->tzinfo : Py_None,
- "dst", (PyObject *)self);
+datetime_dst(PyObject *self, PyObject *unused) {
+ return call_dst(GET_DT_TZINFO(self), self);
}
static PyObject *
-datetime_tzname(PyDateTime_DateTime *self, PyObject *unused) {
- return call_tzname(HASTZINFO(self) ? self->tzinfo : Py_None,
- (PyObject *)self);
+datetime_tzname(PyObject *self, PyObject *unused) {
+ return call_tzname(GET_DT_TZINFO(self), self);
}
/*
@@ -4034,21 +4397,43 @@ datetime_subtract(PyObject *left, PyObject *right)
/* datetime - ??? */
if (PyDateTime_Check(right)) {
/* datetime - datetime */
- naivety n1, n2;
- int offset1, offset2;
+ PyObject *offset1, *offset2, *offdiff = NULL;
int delta_d, delta_s, delta_us;
- if (classify_two_utcoffsets(left, &offset1, &n1, left,
- right, &offset2, &n2,
- right) < 0)
- return NULL;
- assert(n1 != OFFSET_UNKNOWN && n2 != OFFSET_UNKNOWN);
- if (n1 != n2) {
- PyErr_SetString(PyExc_TypeError,
- "can't subtract offset-naive and "
- "offset-aware datetimes");
- return NULL;
+ if (GET_DT_TZINFO(left) == GET_DT_TZINFO(right)) {
+ offset2 = offset1 = Py_None;
+ Py_INCREF(offset1);
+ Py_INCREF(offset2);
+ }
+ else {
+ offset1 = datetime_utcoffset(left, NULL);
+ if (offset1 == NULL)
+ return NULL;
+ offset2 = datetime_utcoffset(right, NULL);
+ if (offset2 == NULL) {
+ Py_DECREF(offset1);
+ return NULL;
+ }
+ if ((offset1 != Py_None) != (offset2 != Py_None)) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't subtract offset-naive and "
+ "offset-aware datetimes");
+ Py_DECREF(offset1);
+ Py_DECREF(offset2);
+ return NULL;
+ }
}
+ if ((offset1 != offset2) &&
+ delta_cmp(offset1, offset2) != 0) {
+ offdiff = delta_subtract(offset1, offset2);
+ if (offdiff == NULL) {
+ Py_DECREF(offset1);
+ Py_DECREF(offset2);
+ return NULL;
+ }
+ }
+ Py_DECREF(offset1);
+ Py_DECREF(offset2);
delta_d = ymd_to_ord(GET_YEAR(left),
GET_MONTH(left),
GET_DAY(left)) -
@@ -4067,11 +4452,13 @@ datetime_subtract(PyObject *left, PyObject *right)
DATE_GET_SECOND(right));
delta_us = DATE_GET_MICROSECOND(left) -
DATE_GET_MICROSECOND(right);
- /* (left - offset1) - (right - offset2) =
- * (left - right) + (offset2 - offset1)
- */
- delta_s += (offset2 - offset1) * 60;
result = new_delta(delta_d, delta_s, delta_us, 1);
+ if (offdiff != NULL) {
+ PyObject *temp = result;
+ result = delta_subtract(result, offdiff);
+ Py_DECREF(temp);
+ Py_DECREF(offdiff);
+ }
}
else if (PyDelta_Check(right)) {
/* datetime - delta */
@@ -4181,9 +4568,9 @@ datetime_ctime(PyDateTime_DateTime *self)
static PyObject *
datetime_richcompare(PyObject *self, PyObject *other, int op)
{
+ PyObject *result = NULL;
+ PyObject *offset1, *offset2;
int diff;
- naivety n1, n2;
- int offset1, offset2;
if (! PyDateTime_Check(other)) {
if (PyDate_Check(other)) {
@@ -4204,85 +4591,99 @@ datetime_richcompare(PyObject *self, PyObject *other, int op)
return Py_NotImplemented;
}
- if (classify_two_utcoffsets(self, &offset1, &n1, self,
- other, &offset2, &n2, other) < 0)
+ if (GET_DT_TZINFO(self) == GET_DT_TZINFO(other)) {
+ diff = memcmp(((PyDateTime_DateTime *)self)->data,
+ ((PyDateTime_DateTime *)other)->data,
+ _PyDateTime_DATETIME_DATASIZE);
+ return diff_to_bool(diff, op);
+ }
+ offset1 = datetime_utcoffset(self, NULL);
+ if (offset1 == NULL)
return NULL;
- assert(n1 != OFFSET_UNKNOWN && n2 != OFFSET_UNKNOWN);
+ offset2 = datetime_utcoffset(other, NULL);
+ if (offset2 == NULL)
+ goto done;
/* If they're both naive, or both aware and have the same offsets,
* we get off cheap. Note that if they're both naive, offset1 ==
- * offset2 == 0 at this point.
+ * offset2 == Py_None at this point.
*/
- if (n1 == n2 && offset1 == offset2) {
+ if ((offset1 == offset2) ||
+ (PyDelta_Check(offset1) && PyDelta_Check(offset2) &&
+ delta_cmp(offset1, offset2) == 0)) {
diff = memcmp(((PyDateTime_DateTime *)self)->data,
((PyDateTime_DateTime *)other)->data,
_PyDateTime_DATETIME_DATASIZE);
- return diff_to_bool(diff, op);
+ result = diff_to_bool(diff, op);
}
-
- if (n1 == OFFSET_AWARE && n2 == OFFSET_AWARE) {
+ else if (offset1 != Py_None && offset2 != Py_None) {
PyDateTime_Delta *delta;
- assert(offset1 != offset2); /* else last "if" handled it */
+ assert(offset1 != offset2); /* else last "if" handled it */
delta = (PyDateTime_Delta *)datetime_subtract((PyObject *)self,
other);
if (delta == NULL)
- return NULL;
+ goto done;
diff = GET_TD_DAYS(delta);
if (diff == 0)
diff = GET_TD_SECONDS(delta) |
GET_TD_MICROSECONDS(delta);
Py_DECREF(delta);
- return diff_to_bool(diff, op);
+ result = diff_to_bool(diff, op);
}
-
- assert(n1 != n2);
- PyErr_SetString(PyExc_TypeError,
- "can't compare offset-naive and "
- "offset-aware datetimes");
- return NULL;
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "can't compare offset-naive and "
+ "offset-aware datetimes");
+ }
+ done:
+ Py_DECREF(offset1);
+ Py_XDECREF(offset2);
+ return result;
}
-static long
+static Py_hash_t
datetime_hash(PyDateTime_DateTime *self)
{
if (self->hashcode == -1) {
- naivety n;
- int offset;
- PyObject *temp;
-
- n = classify_utcoffset((PyObject *)self, (PyObject *)self,
- &offset);
- assert(n != OFFSET_UNKNOWN);
- if (n == OFFSET_ERROR)
+ PyObject *offset;
+
+ offset = datetime_utcoffset((PyObject *)self, NULL);
+
+ if (offset == NULL)
return -1;
/* Reduce this to a hash of another object. */
- if (n == OFFSET_NAIVE) {
+ if (offset == Py_None)
self->hashcode = generic_hash(
(unsigned char *)self->data, _PyDateTime_DATETIME_DATASIZE);
- return self->hashcode;
- }
else {
- int days;
- int seconds;
+ PyObject *temp1, *temp2;
+ int days, seconds;
- assert(n == OFFSET_AWARE);
assert(HASTZINFO(self));
days = ymd_to_ord(GET_YEAR(self),
GET_MONTH(self),
GET_DAY(self));
seconds = DATE_GET_HOUR(self) * 3600 +
- (DATE_GET_MINUTE(self) - offset) * 60 +
+ DATE_GET_MINUTE(self) * 60 +
DATE_GET_SECOND(self);
- temp = new_delta(days,
- seconds,
- DATE_GET_MICROSECOND(self),
- 1);
- }
- if (temp != NULL) {
- self->hashcode = PyObject_Hash(temp);
- Py_DECREF(temp);
+ temp1 = new_delta(days, seconds,
+ DATE_GET_MICROSECOND(self),
+ 1);
+ if (temp1 == NULL) {
+ Py_DECREF(offset);
+ return -1;
+ }
+ temp2 = delta_subtract(temp1, offset);
+ Py_DECREF(temp1);
+ if (temp2 == NULL) {
+ Py_DECREF(offset);
+ return -1;
+ }
+ self->hashcode = PyObject_Hash(temp2);
+ Py_DECREF(temp2);
}
+ Py_DECREF(offset);
}
return self->hashcode;
}
@@ -4317,10 +4718,9 @@ datetime_replace(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
static PyObject *
datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
{
- int y, m, d, hh, mm, ss, us;
PyObject *result;
- int offset, none;
-
+ PyObject *offset;
+ PyObject *temp;
PyObject *tzinfo;
static char *keywords[] = {"tz", NULL};
@@ -4338,39 +4738,35 @@ datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
}
/* Convert self to UTC. */
- offset = call_utcoffset(self->tzinfo, (PyObject *)self, &none);
- if (offset == -1 && PyErr_Occurred())
+ offset = datetime_utcoffset((PyObject *)self, NULL);
+ if (offset == NULL)
return NULL;
- if (none)
- goto NeedAware;
+ if (offset == Py_None) {
+ Py_DECREF(offset);
+ NeedAware:
+ PyErr_SetString(PyExc_ValueError, "astimezone() cannot be applied to "
+ "a naive datetime");
+ return NULL;
+ }
- y = GET_YEAR(self);
- m = GET_MONTH(self);
- d = GET_DAY(self);
- hh = DATE_GET_HOUR(self);
- mm = DATE_GET_MINUTE(self);
- ss = DATE_GET_SECOND(self);
- us = DATE_GET_MICROSECOND(self);
-
- mm -= offset;
- if ((mm < 0 || mm >= 60) &&
- normalize_datetime(&y, &m, &d, &hh, &mm, &ss, &us) < 0)
+ /* result = self - offset */
+ result = add_datetime_timedelta(self,
+ (PyDateTime_Delta *)offset, -1);
+ Py_DECREF(offset);
+ if (result == NULL)
return NULL;
/* Attach new tzinfo and let fromutc() do the rest. */
- result = new_datetime(y, m, d, hh, mm, ss, us, tzinfo);
- if (result != NULL) {
- PyObject *temp = result;
+ temp = ((PyDateTime_DateTime *)result)->tzinfo;
+ ((PyDateTime_DateTime *)result)->tzinfo = tzinfo;
+ Py_INCREF(tzinfo);
+ Py_DECREF(temp);
- result = PyObject_CallMethod(tzinfo, "fromutc", "O", temp);
- Py_DECREF(temp);
- }
- return result;
+ temp = result;
+ result = PyObject_CallMethod(tzinfo, "fromutc", "O", temp);
+ Py_DECREF(temp);
-NeedAware:
- PyErr_SetString(PyExc_ValueError, "astimezone() cannot be applied to "
- "a naive datetime");
- return NULL;
+ return result;
}
static PyObject *
@@ -4379,17 +4775,15 @@ datetime_timetuple(PyDateTime_DateTime *self)
int dstflag = -1;
if (HASTZINFO(self) && self->tzinfo != Py_None) {
- int none;
+ PyObject * dst;
- dstflag = call_dst(self->tzinfo, (PyObject *)self, &none);
- if (dstflag == -1 && PyErr_Occurred())
+ dst = call_dst(self->tzinfo, (PyObject *)self);
+ if (dst == NULL)
return NULL;
- if (none)
- dstflag = -1;
- else if (dstflag != 0)
- dstflag = 1;
-
+ if (dst != Py_None)
+ dstflag = delta_bool((PyDateTime_Delta *)dst);
+ Py_DECREF(dst);
}
return build_struct_time(GET_YEAR(self),
GET_MONTH(self),
@@ -4425,47 +4819,47 @@ datetime_gettimetz(PyDateTime_DateTime *self)
DATE_GET_MINUTE(self),
DATE_GET_SECOND(self),
DATE_GET_MICROSECOND(self),
- HASTZINFO(self) ? self->tzinfo : Py_None);
+ GET_DT_TZINFO(self));
}
static PyObject *
datetime_utctimetuple(PyDateTime_DateTime *self)
{
- int y = GET_YEAR(self);
- int m = GET_MONTH(self);
- int d = GET_DAY(self);
- int hh = DATE_GET_HOUR(self);
- int mm = DATE_GET_MINUTE(self);
- int ss = DATE_GET_SECOND(self);
- int us = 0; /* microseconds are ignored in a timetuple */
- int offset = 0;
-
- if (HASTZINFO(self) && self->tzinfo != Py_None) {
- int none;
+ int y, m, d, hh, mm, ss;
+ PyObject *tzinfo;
+ PyDateTime_DateTime *utcself;
- offset = call_utcoffset(self->tzinfo, (PyObject *)self, &none);
- if (offset == -1 && PyErr_Occurred())
- return NULL;
+ tzinfo = GET_DT_TZINFO(self);
+ if (tzinfo == Py_None) {
+ utcself = self;
+ Py_INCREF(utcself);
}
- /* Even if offset is 0, don't call timetuple() -- tm_isdst should be
- * 0 in a UTC timetuple regardless of what dst() says.
- */
- if (offset) {
- /* Subtract offset minutes & normalize. */
- int stat;
-
- mm -= offset;
- stat = normalize_datetime(&y, &m, &d, &hh, &mm, &ss, &us);
- if (stat < 0) {
- /* At the edges, it's possible we overflowed
- * beyond MINYEAR or MAXYEAR.
- */
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ else {
+ PyObject *offset;
+ offset = call_utcoffset(tzinfo, (PyObject *)self);
+ if (offset == NULL)
+ return NULL;
+ if (offset == Py_None) {
+ Py_DECREF(offset);
+ utcself = self;
+ Py_INCREF(utcself);
+ }
+ else {
+ utcself = (PyDateTime_DateTime *)add_datetime_timedelta(self,
+ (PyDateTime_Delta *)offset, -1);
+ Py_DECREF(offset);
+ if (utcself == NULL)
return NULL;
}
}
+ y = GET_YEAR(utcself);
+ m = GET_MONTH(utcself);
+ d = GET_DAY(utcself);
+ hh = DATE_GET_HOUR(utcself);
+ mm = DATE_GET_MINUTE(utcself);
+ ss = DATE_GET_SECOND(utcself);
+
+ Py_DECREF(utcself);
return build_struct_time(y, m, d, hh, mm, ss, 0);
}
@@ -4667,7 +5061,7 @@ static PyDateTime_CAPI CAPI = {
static struct PyModuleDef datetimemodule = {
PyModuleDef_HEAD_INIT,
- "datetime",
+ "_datetime",
"Fast implementation of the datetime type.",
-1,
module_methods,
@@ -4678,11 +5072,12 @@ static struct PyModuleDef datetimemodule = {
};
PyMODINIT_FUNC
-PyInit_datetime(void)
+PyInit__datetime(void)
{
PyObject *m; /* a module object */
PyObject *d; /* its dict */
PyObject *x;
+ PyObject *delta;
m = PyModule_Create(&datetimemodule);
if (m == NULL)
@@ -4698,6 +5093,8 @@ PyInit_datetime(void)
return NULL;
if (PyType_Ready(&PyDateTime_TZInfoType) < 0)
return NULL;
+ if (PyType_Ready(&PyDateTime_TimeZoneType) < 0)
+ return NULL;
/* timedelta values */
d = PyDateTime_DeltaType.tp_dict;
@@ -4771,6 +5168,36 @@ PyInit_datetime(void)
return NULL;
Py_DECREF(x);
+ /* timezone values */
+ d = PyDateTime_TimeZoneType.tp_dict;
+
+ delta = new_delta(0, 0, 0, 0);
+ if (delta == NULL)
+ return NULL;
+ x = create_timezone(delta, NULL);
+ Py_DECREF(delta);
+ if (x == NULL || PyDict_SetItemString(d, "utc", x) < 0)
+ return NULL;
+ PyDateTime_TimeZone_UTC = x;
+
+ delta = new_delta(-1, 60, 0, 1); /* -23:59 */
+ if (delta == NULL)
+ return NULL;
+ x = create_timezone(delta, NULL);
+ Py_DECREF(delta);
+ if (x == NULL || PyDict_SetItemString(d, "min", x) < 0)
+ return NULL;
+ Py_DECREF(x);
+
+ delta = new_delta(0, (23 * 60 + 59) * 60, 0, 0); /* +23:59 */
+ if (delta == NULL)
+ return NULL;
+ x = create_timezone(delta, NULL);
+ Py_DECREF(delta);
+ if (x == NULL || PyDict_SetItemString(d, "max", x) < 0)
+ return NULL;
+ Py_DECREF(x);
+
/* module initialization */
PyModule_AddIntConstant(m, "MINYEAR", MINYEAR);
PyModule_AddIntConstant(m, "MAXYEAR", MAXYEAR);
@@ -4791,9 +5218,12 @@ PyInit_datetime(void)
Py_INCREF(&PyDateTime_TZInfoType);
PyModule_AddObject(m, "tzinfo", (PyObject *) &PyDateTime_TZInfoType);
+ Py_INCREF(&PyDateTime_TimeZoneType);
+ PyModule_AddObject(m, "timezone", (PyObject *) &PyDateTime_TimeZoneType);
+
x = PyCapsule_New(&CAPI, PyDateTime_CAPSULE_NAME, NULL);
if (x == NULL)
- return NULL;
+ return NULL;
PyModule_AddObject(m, "datetime_CAPI", x);
/* A 4-year cycle has an extra leap day over what we'd get from
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index ae09893286..3061d8eaf3 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -1,21 +1,15 @@
/*
* ElementTree
- * $Id: _elementtree.c 2657 2006-03-12 20:50:32Z fredrik $
+ * $Id: _elementtree.c 3473 2009-01-11 22:53:55Z fredrik $
*
* elementtree accelerator
*
* History:
* 1999-06-20 fl created (as part of sgmlop)
* 2001-05-29 fl effdom edition
- * 2001-06-05 fl backported to unix; fixed bogus free in clear
- * 2001-07-10 fl added findall helper
* 2003-02-27 fl elementtree edition (alpha)
* 2004-06-03 fl updates for elementtree 1.2
- * 2005-01-05 fl added universal name cache, Element/SubElement factories
- * 2005-01-06 fl moved python helpers into C module; removed 1.5.2 support
- * 2005-01-07 fl added 2.1 support; work around broken __copy__ in 2.3
- * 2005-01-08 fl added makeelement method; fixed path support
- * 2005-01-10 fl optimized memory usage
+ * 2005-01-05 fl major optimization effort
* 2005-01-11 fl first public release (cElementTree 0.8)
* 2005-01-12 fl split element object into base and extras
* 2005-01-13 fl use tagged pointers for tail/text (cElementTree 0.9)
@@ -35,16 +29,23 @@
* 2005-12-16 fl added support for non-standard encodings
* 2006-03-08 fl fixed a couple of potential null-refs and leaks
* 2006-03-12 fl merge in 2.5 ssize_t changes
+ * 2007-08-25 fl call custom builder's close method from XMLParser
+ * 2007-08-31 fl added iter, extend from ET 1.3
+ * 2007-09-01 fl fixed ParseError exception, setslice source type, etc
+ * 2007-09-03 fl fixed handling of negative insert indexes
+ * 2007-09-04 fl added itertext from ET 1.3
+ * 2007-09-06 fl added position attribute to ParseError exception
+ * 2008-06-06 fl delay error reporting in iterparse (from Hrvoje Niksic)
*
- * Copyright (c) 1999-2006 by Secret Labs AB. All rights reserved.
- * Copyright (c) 1999-2006 by Fredrik Lundh.
+ * Copyright (c) 1999-2009 by Secret Labs AB. All rights reserved.
+ * Copyright (c) 1999-2009 by Fredrik Lundh.
*
* info@pythonware.com
* http://www.pythonware.com
*/
/* Licensed to PSF under a Contributor Agreement. */
-/* See http://www.python.org/2.4/license for licensing details. */
+/* See http://www.python.org/psf/license for licensing details. */
#include "Python.h"
@@ -56,7 +57,7 @@
/* Leave defined to include the expat-based XMLParser type */
#define USE_EXPAT
-/* Define to to all expat calls via pyexpat's embedded expat library */
+/* Define to do all expat calls via pyexpat's embedded expat library */
/* #define USE_PYEXPAT_CAPI */
/* An element can hold this many children without extra memory
@@ -93,6 +94,25 @@ do { memory -= size; printf("%8d - %s\n", memory, comment); } while (0)
#define LOCAL(type) static type
#endif
+/* compatibility macros */
+#if (PY_VERSION_HEX < 0x02060000)
+#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
+#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
+#endif
+
+#if (PY_VERSION_HEX < 0x02050000)
+typedef int Py_ssize_t;
+#define lenfunc inquiry
+#endif
+
+#if (PY_VERSION_HEX < 0x02040000)
+#define PyDict_CheckExact PyDict_Check
+
+#if !defined(Py_RETURN_NONE)
+#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
+#endif
+#endif
+
/* macros used to store 'join' flags in string object pointers. note
that all use of text and tail as object pointers must be wrapped in
JOIN_OBJ. see comments in the ElementObject definition for more
@@ -102,9 +122,11 @@ do { memory -= size; printf("%8d - %s\n", memory, comment); } while (0)
#define JOIN_OBJ(p) ((PyObject*) ((Py_uintptr_t) (p) & ~1))
/* glue functions (see the init function for details) */
+static PyObject* elementtree_parseerror_obj;
static PyObject* elementtree_copyelement_obj;
static PyObject* elementtree_deepcopy_obj;
-static PyObject* elementtree_getiterator_obj;
+static PyObject* elementtree_iter_obj;
+static PyObject* elementtree_itertext_obj;
static PyObject* elementpath_obj;
/* helpers */
@@ -188,23 +210,6 @@ list_join(PyObject* list)
return result;
}
-#if (PY_VERSION_HEX < 0x02020000)
-LOCAL(int)
-PyDict_Update(PyObject* dict, PyObject* other)
-{
- /* PyDict_Update emulation for 2.1 and earlier */
-
- PyObject* res;
-
- res = PyObject_CallMethod(dict, "update", "O", other);
- if (!res)
- return -1;
-
- Py_DECREF(res);
- return 0;
-}
-#endif
-
/* -------------------------------------------------------------------- */
/* the element type */
@@ -309,7 +314,7 @@ element_new(PyObject* tag, PyObject* attrib)
if (element_new_extra(self, attrib) < 0) {
PyObject_Del(self);
return NULL;
- }
+ }
self->extra->length = 0;
self->extra->allocated = STATIC_CHILDREN;
@@ -407,6 +412,7 @@ element_get_attrib(ElementObject* self)
PyObject* res = self->extra->attrib;
if (res == Py_None) {
+ Py_DECREF(res);
/* create missing dictionary */
res = PyDict_New();
if (!res)
@@ -688,6 +694,8 @@ element_deepcopy(ElementObject* self, PyObject* args)
/* add object to memo dictionary (so deepcopy won't visit it again) */
id = PyLong_FromLong((Py_uintptr_t) self);
+ if (!id)
+ goto error;
i = PyDict_SetItem(memo, id, (PyObject*) element);
@@ -711,7 +719,8 @@ checkpath(PyObject* tag)
/* check if a tag contains an xpath character */
-#define PATHCHAR(ch) (ch == '/' || ch == '*' || ch == '[' || ch == '@')
+#define PATHCHAR(ch) \
+ (ch == '/' || ch == '*' || ch == '[' || ch == '@' || ch == '.')
if (PyUnicode_Check(tag)) {
Py_UNICODE *p = PyUnicode_AS_UNICODE(tag);
@@ -742,17 +751,51 @@ checkpath(PyObject* tag)
}
static PyObject*
+element_extend(ElementObject* self, PyObject* args)
+{
+ PyObject* seq;
+ Py_ssize_t i, seqlen = 0;
+
+ PyObject* seq_in;
+ if (!PyArg_ParseTuple(args, "O:extend", &seq_in))
+ return NULL;
+
+ seq = PySequence_Fast(seq_in, "");
+ if (!seq) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "expected sequence, not \"%.200s\"", Py_TYPE(seq_in)->tp_name
+ );
+ return NULL;
+ }
+
+ seqlen = PySequence_Size(seq);
+ for (i = 0; i < seqlen; i++) {
+ PyObject* element = PySequence_Fast_GET_ITEM(seq, i);
+ if (element_add_subelement(self, element) < 0) {
+ Py_DECREF(seq);
+ return NULL;
+ }
+ }
+
+ Py_DECREF(seq);
+
+ Py_RETURN_NONE;
+}
+
+static PyObject*
element_find(ElementObject* self, PyObject* args)
{
int i;
PyObject* tag;
- if (!PyArg_ParseTuple(args, "O:find", &tag))
+ PyObject* namespaces = Py_None;
+ if (!PyArg_ParseTuple(args, "O|O:find", &tag, &namespaces))
return NULL;
- if (checkpath(tag))
+ if (checkpath(tag) || namespaces != Py_None)
return PyObject_CallMethod(
- elementpath_obj, "find", "OO", self, tag
+ elementpath_obj, "find", "OOO", self, tag, namespaces
);
if (!self->extra)
@@ -777,12 +820,13 @@ element_findtext(ElementObject* self, PyObject* args)
PyObject* tag;
PyObject* default_value = Py_None;
- if (!PyArg_ParseTuple(args, "O|O:findtext", &tag, &default_value))
+ PyObject* namespaces = Py_None;
+ if (!PyArg_ParseTuple(args, "O|OO:findtext", &tag, &default_value, &namespaces))
return NULL;
- if (checkpath(tag))
+ if (checkpath(tag) || namespaces != Py_None)
return PyObject_CallMethod(
- elementpath_obj, "findtext", "OOO", self, tag, default_value
+ elementpath_obj, "findtext", "OOOO", self, tag, default_value, namespaces
);
if (!self->extra) {
@@ -813,12 +857,13 @@ element_findall(ElementObject* self, PyObject* args)
PyObject* out;
PyObject* tag;
- if (!PyArg_ParseTuple(args, "O:findall", &tag))
+ PyObject* namespaces = Py_None;
+ if (!PyArg_ParseTuple(args, "O|O:findall", &tag, &namespaces))
return NULL;
- if (checkpath(tag))
+ if (checkpath(tag) || namespaces != Py_None)
return PyObject_CallMethod(
- elementpath_obj, "findall", "OO", self, tag
+ elementpath_obj, "findall", "OOO", self, tag, namespaces
);
out = PyList_New(0);
@@ -843,6 +888,19 @@ element_findall(ElementObject* self, PyObject* args)
}
static PyObject*
+element_iterfind(ElementObject* self, PyObject* args)
+{
+ PyObject* tag;
+ PyObject* namespaces = Py_None;
+ if (!PyArg_ParseTuple(args, "O|O:iterfind", &tag, &namespaces))
+ return NULL;
+
+ return PyObject_CallMethod(
+ elementpath_obj, "iterfind", "OOO", self, tag, namespaces
+ );
+}
+
+static PyObject*
element_get(ElementObject* self, PyObject* args)
{
PyObject* value;
@@ -870,6 +928,8 @@ element_getchildren(ElementObject* self, PyObject* args)
int i;
PyObject* list;
+ /* FIXME: report as deprecated? */
+
if (!PyArg_ParseTuple(args, ":getchildren"))
return NULL;
@@ -890,18 +950,18 @@ element_getchildren(ElementObject* self, PyObject* args)
}
static PyObject*
-element_getiterator(ElementObject* self, PyObject* args)
+element_iter(ElementObject* self, PyObject* args)
{
PyObject* result;
PyObject* tag = Py_None;
- if (!PyArg_ParseTuple(args, "|O:getiterator", &tag))
+ if (!PyArg_ParseTuple(args, "|O:iter", &tag))
return NULL;
- if (!elementtree_getiterator_obj) {
+ if (!elementtree_iter_obj) {
PyErr_SetString(
PyExc_RuntimeError,
- "getiterator helper not found"
+ "iter helper not found"
);
return NULL;
}
@@ -913,61 +973,58 @@ element_getiterator(ElementObject* self, PyObject* args)
Py_INCREF(self); PyTuple_SET_ITEM(args, 0, (PyObject*) self);
Py_INCREF(tag); PyTuple_SET_ITEM(args, 1, (PyObject*) tag);
- result = PyObject_CallObject(elementtree_getiterator_obj, args);
+ result = PyObject_CallObject(elementtree_iter_obj, args);
Py_DECREF(args);
return result;
}
+
static PyObject*
-element_getitem(PyObject* self_, Py_ssize_t index)
+element_itertext(ElementObject* self, PyObject* args)
{
- ElementObject* self = (ElementObject*) self_;
+ PyObject* result;
+
+ if (!PyArg_ParseTuple(args, ":itertext"))
+ return NULL;
- if (!self->extra || index < 0 || index >= self->extra->length) {
+ if (!elementtree_itertext_obj) {
PyErr_SetString(
- PyExc_IndexError,
- "child index out of range"
+ PyExc_RuntimeError,
+ "itertext helper not found"
);
return NULL;
}
- Py_INCREF(self->extra->children[index]);
- return self->extra->children[index];
+ args = PyTuple_New(1);
+ if (!args)
+ return NULL;
+
+ Py_INCREF(self); PyTuple_SET_ITEM(args, 0, (PyObject*) self);
+
+ result = PyObject_CallObject(elementtree_itertext_obj, args);
+
+ Py_DECREF(args);
+
+ return result;
}
static PyObject*
-element_getslice(PyObject* self_, Py_ssize_t start, Py_ssize_t end)
+element_getitem(PyObject* self_, Py_ssize_t index)
{
ElementObject* self = (ElementObject*) self_;
- Py_ssize_t i;
- PyObject* list;
- if (!self->extra)
- return PyList_New(0);
-
- /* standard clamping */
- if (start < 0)
- start = 0;
- if (end < 0)
- end = 0;
- if (end > self->extra->length)
- end = self->extra->length;
- if (start > end)
- start = end;
-
- list = PyList_New(end - start);
- if (!list)
+ if (!self->extra || index < 0 || index >= self->extra->length) {
+ PyErr_SetString(
+ PyExc_IndexError,
+ "child index out of range"
+ );
return NULL;
-
- for (i = start; i < end; i++) {
- PyObject* item = self->extra->children[i];
- Py_INCREF(item);
- PyList_SET_ITEM(list, i - start, item);
}
- return list;
+ Py_INCREF(self->extra->children[index]);
+ return self->extra->children[index];
}
static PyObject*
@@ -984,8 +1041,11 @@ element_insert(ElementObject* self, PyObject* args)
if (!self->extra)
element_new_extra(self, NULL);
- if (index < 0)
- index = 0;
+ if (index < 0) {
+ index += self->extra->length;
+ if (index < 0)
+ index = 0;
+ }
if (index > self->extra->length)
index = self->extra->length;
@@ -1156,77 +1216,6 @@ element_set(ElementObject* self, PyObject* args)
}
static int
-element_setslice(PyObject* self_, Py_ssize_t start, Py_ssize_t end, PyObject* item)
-{
- ElementObject* self = (ElementObject*) self_;
- Py_ssize_t i, new, old;
- PyObject* recycle = NULL;
-
- if (!self->extra)
- element_new_extra(self, NULL);
-
- /* standard clamping */
- if (start < 0)
- start = 0;
- if (end < 0)
- end = 0;
- if (end > self->extra->length)
- end = self->extra->length;
- if (start > end)
- start = end;
-
- old = end - start;
-
- if (item == NULL)
- new = 0;
- else if (PyList_CheckExact(item)) {
- new = PyList_GET_SIZE(item);
- } else {
- /* FIXME: support arbitrary sequences? */
- PyErr_Format(
- PyExc_TypeError,
- "expected list, not \"%.200s\"", Py_TYPE(item)->tp_name
- );
- return -1;
- }
-
- if (old > 0) {
- /* to avoid recursive calls to this method (via decref), move
- old items to the recycle bin here, and get rid of them when
- we're done modifying the element */
- recycle = PyList_New(old);
- for (i = 0; i < old; i++)
- PyList_SET_ITEM(recycle, i, self->extra->children[i + start]);
- }
-
- if (new < old) {
- /* delete slice */
- for (i = end; i < self->extra->length; i++)
- self->extra->children[i + new - old] = self->extra->children[i];
- } else if (new > old) {
- /* insert slice */
- if (element_resize(self, new - old) < 0)
- return -1;
- for (i = self->extra->length-1; i >= end; i--)
- self->extra->children[i + new - old] = self->extra->children[i];
- }
-
- /* replace the slice */
- for (i = 0; i < new; i++) {
- PyObject* element = PyList_GET_ITEM(item, i);
- Py_INCREF(element);
- self->extra->children[i + start] = element;
- }
-
- self->extra->length += new - old;
-
- /* discard the recycle bin, and everything in it */
- Py_XDECREF(recycle);
-
- return 0;
-}
-
-static int
element_setitem(PyObject* self_, Py_ssize_t index, PyObject* item)
{
ElementObject* self = (ElementObject*) self_;
@@ -1256,6 +1245,190 @@ element_setitem(PyObject* self_, Py_ssize_t index, PyObject* item)
return 0;
}
+static PyObject*
+element_subscr(PyObject* self_, PyObject* item)
+{
+ ElementObject* self = (ElementObject*) self_;
+
+#if (PY_VERSION_HEX < 0x02050000)
+ if (PyInt_Check(item) || PyLong_Check(item)) {
+ long i = PyInt_AsLong(item);
+#else
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+#endif
+
+ if (i == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ if (i < 0 && self->extra)
+ i += self->extra->length;
+ return element_getitem(self_, i);
+ }
+ else if (PySlice_Check(item)) {
+ Py_ssize_t start, stop, step, slicelen, cur, i;
+ PyObject* list;
+
+ if (!self->extra)
+ return PyList_New(0);
+
+ if (PySlice_GetIndicesEx(item,
+ self->extra->length,
+ &start, &stop, &step, &slicelen) < 0) {
+ return NULL;
+ }
+
+ if (slicelen <= 0)
+ return PyList_New(0);
+ else {
+ list = PyList_New(slicelen);
+ if (!list)
+ return NULL;
+
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++) {
+ PyObject* item = self->extra->children[cur];
+ Py_INCREF(item);
+ PyList_SET_ITEM(list, i, item);
+ }
+
+ return list;
+ }
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "element indices must be integers");
+ return NULL;
+ }
+}
+
+static int
+element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value)
+{
+ ElementObject* self = (ElementObject*) self_;
+
+#if (PY_VERSION_HEX < 0x02050000)
+ if (PyInt_Check(item) || PyLong_Check(item)) {
+ long i = PyInt_AsLong(item);
+#else
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+#endif
+
+ if (i == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+ if (i < 0 && self->extra)
+ i += self->extra->length;
+ return element_setitem(self_, i, value);
+ }
+ else if (PySlice_Check(item)) {
+ Py_ssize_t start, stop, step, slicelen, newlen, cur, i;
+
+ PyObject* recycle = NULL;
+ PyObject* seq = NULL;
+
+ if (!self->extra)
+ element_new_extra(self, NULL);
+
+ if (PySlice_GetIndicesEx(item,
+ self->extra->length,
+ &start, &stop, &step, &slicelen) < 0) {
+ return -1;
+ }
+
+ if (value == NULL)
+ newlen = 0;
+ else {
+ seq = PySequence_Fast(value, "");
+ if (!seq) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "expected sequence, not \"%.200s\"", Py_TYPE(value)->tp_name
+ );
+ return -1;
+ }
+ newlen = PySequence_Size(seq);
+ }
+
+ if (step != 1 && newlen != slicelen)
+ {
+ PyErr_Format(PyExc_ValueError,
+#if (PY_VERSION_HEX < 0x02050000)
+ "attempt to assign sequence of size %d "
+ "to extended slice of size %d",
+#else
+ "attempt to assign sequence of size %zd "
+ "to extended slice of size %zd",
+#endif
+ newlen, slicelen
+ );
+ return -1;
+ }
+
+
+ /* Resize before creating the recycle bin, to prevent refleaks. */
+ if (newlen > slicelen) {
+ if (element_resize(self, newlen - slicelen) < 0) {
+ if (seq) {
+ Py_DECREF(seq);
+ }
+ return -1;
+ }
+ }
+
+ if (slicelen > 0) {
+ /* to avoid recursive calls to this method (via decref), move
+ old items to the recycle bin here, and get rid of them when
+ we're done modifying the element */
+ recycle = PyList_New(slicelen);
+ if (!recycle) {
+ if (seq) {
+ Py_DECREF(seq);
+ }
+ return -1;
+ }
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++)
+ PyList_SET_ITEM(recycle, i, self->extra->children[cur]);
+ }
+
+ if (newlen < slicelen) {
+ /* delete slice */
+ for (i = stop; i < self->extra->length; i++)
+ self->extra->children[i + newlen - slicelen] = self->extra->children[i];
+ } else if (newlen > slicelen) {
+ /* insert slice */
+ for (i = self->extra->length-1; i >= stop; i--)
+ self->extra->children[i + newlen - slicelen] = self->extra->children[i];
+ }
+
+ /* replace the slice */
+ for (cur = start, i = 0; i < newlen;
+ cur += step, i++) {
+ PyObject* element = PySequence_Fast_GET_ITEM(seq, i);
+ Py_INCREF(element);
+ self->extra->children[cur] = element;
+ }
+
+ self->extra->length += newlen - slicelen;
+
+ if (seq) {
+ Py_DECREF(seq);
+ }
+
+ /* discard the recycle bin, and everything in it */
+ Py_XDECREF(recycle);
+
+ return 0;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "element indices must be integers");
+ return -1;
+ }
+}
+
static PyMethodDef element_methods[] = {
{"clear", (PyCFunction) element_clear, METH_VARARGS},
@@ -1268,10 +1441,15 @@ static PyMethodDef element_methods[] = {
{"findall", (PyCFunction) element_findall, METH_VARARGS},
{"append", (PyCFunction) element_append, METH_VARARGS},
+ {"extend", (PyCFunction) element_extend, METH_VARARGS},
{"insert", (PyCFunction) element_insert, METH_VARARGS},
{"remove", (PyCFunction) element_remove, METH_VARARGS},
- {"getiterator", (PyCFunction) element_getiterator, METH_VARARGS},
+ {"iter", (PyCFunction) element_iter, METH_VARARGS},
+ {"itertext", (PyCFunction) element_itertext, METH_VARARGS},
+ {"iterfind", (PyCFunction) element_iterfind, METH_VARARGS},
+
+ {"getiterator", (PyCFunction) element_iter, METH_VARARGS},
{"getchildren", (PyCFunction) element_getchildren, METH_VARARGS},
{"items", (PyCFunction) element_items, METH_VARARGS},
@@ -1297,30 +1475,49 @@ static PyMethodDef element_methods[] = {
{NULL, NULL}
};
-static PyObject*
+static PyObject*
element_getattro(ElementObject* self, PyObject* nameobj)
{
PyObject* res;
char *name = "";
if (PyUnicode_Check(nameobj))
- name = _PyUnicode_AsString(nameobj);
+ name = _PyUnicode_AsString(nameobj);
+
+ if (name == NULL)
+ return NULL;
- if (strcmp(name, "tag") == 0)
- res = self->tag;
- else if (strcmp(name, "text") == 0)
+ /* handle common attributes first */
+ if (strcmp(name, "tag") == 0) {
+ res = self->tag;
+ Py_INCREF(res);
+ return res;
+ } else if (strcmp(name, "text") == 0) {
res = element_get_text(self);
- else if (strcmp(name, "tail") == 0) {
+ Py_INCREF(res);
+ return res;
+ }
+
+ /* methods */
+ res = PyObject_GenericGetAttr((PyObject*) self, nameobj);
+ if (res)
+ return res;
+
+ /* less common attributes */
+ if (strcmp(name, "tail") == 0) {
+ PyErr_Clear();
res = element_get_tail(self);
} else if (strcmp(name, "attrib") == 0) {
+ PyErr_Clear();
if (!self->extra)
element_new_extra(self, NULL);
- res = element_get_attrib(self);
- } else {
- return PyObject_GenericGetAttr((PyObject*) self, nameobj);
+ res = element_get_attrib(self);
}
- Py_XINCREF(res);
+ if (!res)
+ return NULL;
+
+ Py_INCREF(res);
return res;
}
@@ -1366,9 +1563,15 @@ static PySequenceMethods element_as_sequence = {
0, /* sq_concat */
0, /* sq_repeat */
element_getitem,
- element_getslice,
+ 0,
element_setitem,
- element_setslice,
+ 0,
+};
+
+static PyMappingMethods element_as_mapping = {
+ (lenfunc) element_length,
+ (binaryfunc) element_subscr,
+ (objobjargproc) element_ass_subscr,
};
static PyTypeObject Element_Type = {
@@ -1383,7 +1586,7 @@ static PyTypeObject Element_Type = {
(reprfunc)element_repr, /* tp_repr */
0, /* tp_as_number */
&element_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
+ &element_as_mapping, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
@@ -1537,7 +1740,7 @@ treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
} else {
if (self->root) {
PyErr_SetString(
- PyExc_SyntaxError,
+ elementtree_parseerror_obj,
"multiple elements on top level"
);
goto error;
@@ -1678,7 +1881,7 @@ treebuilder_handle_end(TreeBuilderObject* self, PyObject* tag)
LOCAL(void)
treebuilder_handle_namespace(TreeBuilderObject* self, int start,
- const char* prefix, const char *uri)
+ PyObject *prefix, PyObject *uri)
{
PyObject* res;
PyObject* action;
@@ -1691,8 +1894,7 @@ treebuilder_handle_namespace(TreeBuilderObject* self, int start,
if (!self->start_ns_event_obj)
return;
action = self->start_ns_event_obj;
- /* FIXME: prefix and uri use utf-8 encoding! */
- parcel = Py_BuildValue("ss", (prefix) ? prefix : "", uri);
+ parcel = Py_BuildValue("OO", prefix, uri);
if (!parcel)
return;
Py_INCREF(action);
@@ -1852,6 +2054,7 @@ typedef struct {
PyObject* names;
PyObject* handle_xml;
+
PyObject* handle_start;
PyObject* handle_data;
PyObject* handle_end;
@@ -1859,6 +2062,8 @@ typedef struct {
PyObject* handle_comment;
PyObject* handle_pi;
+ PyObject* handle_close;
+
} XMLParserObject;
static PyTypeObject XMLParser_Type;
@@ -1930,6 +2135,36 @@ makeuniversal(XMLParserObject* self, const char* string)
return value;
}
+static void
+expat_set_error(const char* message, int line, int column)
+{
+ PyObject *error;
+ PyObject *position;
+ char buffer[256];
+
+ sprintf(buffer, "%.100s: line %d, column %d", message, line, column);
+
+ error = PyObject_CallFunction(elementtree_parseerror_obj, "s", buffer);
+ if (!error)
+ return;
+
+ /* add position attribute */
+ position = Py_BuildValue("(ii)", line, column);
+ if (!position) {
+ Py_DECREF(error);
+ return;
+ }
+ if (PyObject_SetAttrString(error, "position", position) == -1) {
+ Py_DECREF(error);
+ Py_DECREF(position);
+ return;
+ }
+ Py_DECREF(position);
+
+ PyErr_SetObject(elementtree_parseerror_obj, error);
+ Py_DECREF(error);
+}
+
/* -------------------------------------------------------------------- */
/* handlers */
@@ -1960,10 +2195,12 @@ expat_default_handler(XMLParserObject* self, const XML_Char* data_in,
else
res = NULL;
Py_XDECREF(res);
- } else {
- PyErr_Format(
- PyExc_SyntaxError, "undefined entity &%s;: line %ld, column %ld",
- PyBytes_AS_STRING(key),
+ } else if (!PyErr_Occurred()) {
+ /* Report the first error, not the last */
+ char message[128] = "undefined entity ";
+ strncat(message, data_in, data_len < 100?data_len:100);
+ expat_set_error(
+ message,
EXPAT(GetErrorLineNumber)(self->parser),
EXPAT(GetErrorColumnNumber)(self->parser)
);
@@ -2018,9 +2255,15 @@ expat_start_handler(XMLParserObject* self, const XML_Char* tag_in,
/* shortcut */
res = treebuilder_handle_start((TreeBuilderObject*) self->target,
tag, attrib);
- else if (self->handle_start)
+ else if (self->handle_start) {
+ if (attrib == Py_None) {
+ Py_DECREF(attrib);
+ attrib = PyDict_New();
+ if (!attrib)
+ return;
+ }
res = PyObject_CallFunction(self->handle_start, "OO", tag, attrib);
- else
+ } else
res = NULL;
Py_DECREF(tag);
@@ -2080,9 +2323,28 @@ static void
expat_start_ns_handler(XMLParserObject* self, const XML_Char* prefix,
const XML_Char *uri)
{
+ PyObject* sprefix = NULL;
+ PyObject* suri = NULL;
+
+ suri = PyUnicode_DecodeUTF8(uri, strlen(uri), "strict");
+ if (!suri)
+ return;
+
+ if (prefix)
+ sprefix = PyUnicode_DecodeUTF8(prefix, strlen(prefix), "strict");
+ else
+ sprefix = PyUnicode_FromString("");
+ if (!sprefix) {
+ Py_DECREF(suri);
+ return;
+ }
+
treebuilder_handle_namespace(
- (TreeBuilderObject*) self->target, 1, prefix, uri
+ (TreeBuilderObject*) self->target, 1, sprefix, suri
);
+
+ Py_DECREF(sprefix);
+ Py_DECREF(suri);
}
static void
@@ -2158,10 +2420,10 @@ expat_unknown_encoding_handler(XMLParserObject *self, const XML_Char *name,
p = PyUnicode_AS_UNICODE(u);
for (i = 0; i < 256; i++) {
- if (p[i] != Py_UNICODE_REPLACEMENT_CHARACTER)
- info->map[i] = p[i];
+ if (p[i] != Py_UNICODE_REPLACEMENT_CHARACTER)
+ info->map[i] = p[i];
else
- info->map[i] = -1;
+ info->map[i] = -1;
}
Py_DECREF(u);
@@ -2245,6 +2507,7 @@ xmlparser(PyObject* self_, PyObject* args, PyObject* kw)
self->handle_end = PyObject_GetAttrString(target, "end");
self->handle_comment = PyObject_GetAttrString(target, "comment");
self->handle_pi = PyObject_GetAttrString(target, "pi");
+ self->handle_close = PyObject_GetAttrString(target, "close");
PyErr_Clear();
@@ -2288,6 +2551,7 @@ xmlparser_dealloc(XMLParserObject* self)
{
EXPAT(ParserFree)(self->parser);
+ Py_XDECREF(self->handle_close);
Py_XDECREF(self->handle_pi);
Py_XDECREF(self->handle_comment);
Py_XDECREF(self->handle_end);
@@ -2318,8 +2582,7 @@ expat_parse(XMLParserObject* self, char* data, int data_len, int final)
return NULL;
if (!ok) {
- PyErr_Format(
- PyExc_SyntaxError, "%s: line %ld, column %ld",
+ expat_set_error(
EXPAT(ErrorString)(EXPAT(GetErrorCode)(self->parser)),
EXPAT(GetErrorLineNumber)(self->parser),
EXPAT(GetErrorColumnNumber)(self->parser)
@@ -2340,13 +2603,17 @@ xmlparser_close(XMLParserObject* self, PyObject* args)
return NULL;
res = expat_parse(self, "", 0, 1);
+ if (!res)
+ return NULL;
- if (res && TreeBuilder_CheckExact(self->target)) {
+ if (TreeBuilder_CheckExact(self->target)) {
Py_DECREF(res);
return treebuilder_done((TreeBuilderObject*) self->target);
- }
-
- return res;
+ } if (self->handle_close) {
+ Py_DECREF(res);
+ return PyObject_CallFunction(self->handle_close, "");
+ } else
+ return res;
}
static PyObject*
@@ -2458,7 +2725,7 @@ xmlparser_setevents(XMLParserObject* self, PyObject* args)
if (event_set == Py_None) {
/* default is "end" only */
- target->end_event_obj = PyBytes_FromString("end");
+ target->end_event_obj = PyUnicode_FromString("end");
Py_RETURN_NONE;
}
@@ -2468,9 +2735,15 @@ xmlparser_setevents(XMLParserObject* self, PyObject* args)
for (i = 0; i < PyTuple_GET_SIZE(event_set); i++) {
PyObject* item = PyTuple_GET_ITEM(event_set, i);
char* event;
- if (!PyBytes_Check(item))
+ if (PyUnicode_Check(item)) {
+ event = _PyUnicode_AsString(item);
+ if (event == NULL)
+ goto error;
+ } else if (PyBytes_Check(item))
+ event = PyBytes_AS_STRING(item);
+ else {
goto error;
- event = PyBytes_AS_STRING(item);
+ }
if (strcmp(event, "start") == 0) {
Py_INCREF(item);
target->start_event_obj = item;
@@ -2526,29 +2799,25 @@ static PyMethodDef xmlparser_methods[] = {
static PyObject*
xmlparser_getattro(XMLParserObject* self, PyObject* nameobj)
{
- PyObject* res;
- char *name = "";
-
- if (PyUnicode_Check(nameobj))
- name = _PyUnicode_AsString(nameobj);
-
- PyErr_Clear();
-
- if (strcmp(name, "entity") == 0)
- res = self->entity;
- else if (strcmp(name, "target") == 0)
- res = self->target;
- else if (strcmp(name, "version") == 0) {
- char buffer[100];
- sprintf(buffer, "Expat %d.%d.%d", XML_MAJOR_VERSION,
+ if (PyUnicode_Check(nameobj)) {
+ PyObject* res;
+ if (PyUnicode_CompareWithASCIIString(nameobj, "entity") == 0)
+ res = self->entity;
+ else if (PyUnicode_CompareWithASCIIString(nameobj, "target") == 0)
+ res = self->target;
+ else if (PyUnicode_CompareWithASCIIString(nameobj, "version") == 0) {
+ return PyUnicode_FromFormat(
+ "Expat %d.%d.%d", XML_MAJOR_VERSION,
XML_MINOR_VERSION, XML_MICRO_VERSION);
- return PyBytes_FromString(buffer);
- } else {
- return PyObject_GenericGetAttr((PyObject*) self, nameobj);
- }
+ }
+ else
+ goto generic;
- Py_INCREF(res);
- return res;
+ Py_INCREF(res);
+ return res;
+ }
+ generic:
+ return PyObject_GenericGetAttr((PyObject*) self, nameobj);
}
static PyTypeObject XMLParser_Type = {
@@ -2600,15 +2869,15 @@ static PyMethodDef _functions[] = {
static struct PyModuleDef _elementtreemodule = {
- PyModuleDef_HEAD_INIT,
- "_elementtree",
- NULL,
- -1,
- _functions,
- NULL,
- NULL,
- NULL,
- NULL
+ PyModuleDef_HEAD_INIT,
+ "_elementtree",
+ NULL,
+ -1,
+ _functions,
+ NULL,
+ NULL,
+ NULL,
+ NULL
};
PyMODINIT_FUNC
@@ -2617,18 +2886,15 @@ PyInit__elementtree(void)
PyObject* m;
PyObject* g;
char* bootstrap;
-#if defined(USE_PYEXPAT_CAPI)
- struct PyExpat_CAPI* capi;
-#endif
/* Initialize object types */
if (PyType_Ready(&TreeBuilder_Type) < 0)
- return NULL;
+ return NULL;
if (PyType_Ready(&Element_Type) < 0)
- return NULL;
+ return NULL;
#if defined(USE_EXPAT)
if (PyType_Ready(&XMLParser_Type) < 0)
- return NULL;
+ return NULL;
#endif
m = PyModule_Create(&_elementtreemodule);
@@ -2638,8 +2904,8 @@ PyInit__elementtree(void)
/* The code below requires that the module gets already added
to sys.modules. */
PyDict_SetItemString(PyImport_GetModuleDict(),
- _elementtreemodule.m_name,
- m);
+ _elementtreemodule.m_name,
+ m);
/* python glue code */
@@ -2651,10 +2917,6 @@ PyInit__elementtree(void)
bootstrap = (
-#if (PY_VERSION_HEX >= 0x02020000 && PY_VERSION_HEX < 0x02030000)
- "from __future__ import generators\n" /* enable yield under 2.2 */
-#endif
-
"from copy import copy, deepcopy\n"
"try:\n"
@@ -2672,46 +2934,55 @@ PyInit__elementtree(void)
" def copyelement(elem):\n"
" return elem\n"
- "def Comment(text=None):\n" /* public */
+ "class CommentProxy:\n"
+ " def __call__(self, text=None):\n"
" element = cElementTree.Element(ET.Comment)\n"
" element.text = text\n"
" return element\n"
- "cElementTree.Comment = Comment\n"
+ " def __eq__(self, other):\n"
+ " return ET.Comment == other\n"
+ "cElementTree.Comment = CommentProxy()\n"
"class ElementTree(ET.ElementTree):\n" /* public */
" def parse(self, source, parser=None):\n"
+ " close_source = False\n"
" if not hasattr(source, 'read'):\n"
" source = open(source, 'rb')\n"
- " if parser is not None:\n"
- " while 1:\n"
- " data = source.read(65536)\n"
- " if not data:\n"
- " break\n"
- " parser.feed(data)\n"
- " self._root = parser.close()\n"
- " else:\n"
- " parser = cElementTree.XMLParser()\n"
- " self._root = parser._parse(source)\n"
- " return self._root\n"
+ " close_source = True\n"
+ " try:\n"
+ " if parser is not None:\n"
+ " while 1:\n"
+ " data = source.read(65536)\n"
+ " if not data:\n"
+ " break\n"
+ " parser.feed(data)\n"
+ " self._root = parser.close()\n"
+ " else:\n"
+ " parser = cElementTree.XMLParser()\n"
+ " self._root = parser._parse(source)\n"
+ " return self._root\n"
+ " finally:\n"
+ " if close_source:\n"
+ " source.close()\n"
"cElementTree.ElementTree = ElementTree\n"
- "def getiterator(node, tag=None):\n" /* helper */
+ "def iter(node, tag=None):\n" /* helper */
" if tag == '*':\n"
" tag = None\n"
-#if (PY_VERSION_HEX < 0x02020000)
- " nodes = []\n" /* 2.1 doesn't have yield */
- " if tag is None or node.tag == tag:\n"
- " nodes.append(node)\n"
- " for node in node:\n"
- " nodes.extend(getiterator(node, tag))\n"
- " return nodes\n"
-#else
" if tag is None or node.tag == tag:\n"
" yield node\n"
" for node in node:\n"
- " for node in getiterator(node, tag):\n"
+ " for node in iter(node, tag):\n"
" yield node\n"
-#endif
+
+ "def itertext(node):\n" /* helper */
+ " if node.text:\n"
+ " yield node.text\n"
+ " for e in node:\n"
+ " for s in e.itertext():\n"
+ " yield s\n"
+ " if e.tail:\n"
+ " yield e.tail\n"
"def parse(source, parser=None):\n" /* public */
" tree = ElementTree()\n"
@@ -2719,48 +2990,56 @@ PyInit__elementtree(void)
" return tree\n"
"cElementTree.parse = parse\n"
-#if (PY_VERSION_HEX < 0x02020000)
- "if hasattr(ET, 'iterparse'):\n"
- " cElementTree.iterparse = ET.iterparse\n" /* delegate on 2.1 */
-#else
- "class iterparse(object):\n"
+ "class iterparse:\n"
" root = None\n"
" def __init__(self, file, events=None):\n"
+ " self._close_file = False\n"
" if not hasattr(file, 'read'):\n"
" file = open(file, 'rb')\n"
+ " self._close_file = True\n"
" self._file = file\n"
- " self._events = events\n"
- " def __iter__(self):\n"
- " events = []\n"
+ " self._events = []\n"
+ " self._index = 0\n"
+ " self.root = self._root = None\n"
" b = cElementTree.TreeBuilder()\n"
- " p = cElementTree.XMLParser(b)\n"
- " p._setevents(events, self._events)\n"
+ " self._parser = cElementTree.XMLParser(b)\n"
+ " self._parser._setevents(self._events, events)\n"
+ " def __next__(self):\n"
" while 1:\n"
- " data = self._file.read(16384)\n"
- " if not data:\n"
- " break\n"
- " p.feed(data)\n"
- " for event in events:\n"
- " yield event\n"
- " del events[:]\n"
- " root = p.close()\n"
- " for event in events:\n"
- " yield event\n"
- " self.root = root\n"
+ " try:\n"
+ " item = self._events[self._index]\n"
+ " except IndexError:\n"
+ " if self._parser is None:\n"
+ " self.root = self._root\n"
+ " if self._close_file:\n"
+ " self._file.close()\n"
+ " raise StopIteration\n"
+ " # load event buffer\n"
+ " del self._events[:]\n"
+ " self._index = 0\n"
+ " data = self._file.read(16384)\n"
+ " if data:\n"
+ " self._parser.feed(data)\n"
+ " else:\n"
+ " self._root = self._parser.close()\n"
+ " self._parser = None\n"
+ " else:\n"
+ " self._index = self._index + 1\n"
+ " return item\n"
+ " def __iter__(self):\n"
+ " return self\n"
"cElementTree.iterparse = iterparse\n"
-#endif
- "def PI(target, text=None):\n" /* public */
- " element = cElementTree.Element(ET.ProcessingInstruction)\n"
+ "class PIProxy:\n"
+ " def __call__(self, target, text=None):\n"
+ " element = cElementTree.Element(ET.PI)\n"
" element.text = target\n"
" if text:\n"
" element.text = element.text + ' ' + text\n"
" return element\n"
-
- " elem = cElementTree.Element(ET.PI)\n"
- " elem.text = text\n"
- " return elem\n"
- "cElementTree.PI = cElementTree.ProcessingInstruction = PI\n"
+ " def __eq__(self, other):\n"
+ " return ET.PI == other\n"
+ "cElementTree.PI = cElementTree.ProcessingInstruction = PIProxy()\n"
"def XML(text):\n" /* public */
" parser = cElementTree.XMLParser()\n"
@@ -2771,25 +3050,34 @@ PyInit__elementtree(void)
"def XMLID(text):\n" /* public */
" tree = XML(text)\n"
" ids = {}\n"
- " for elem in tree.getiterator():\n"
+ " for elem in tree.iter():\n"
" id = elem.get('id')\n"
" if id:\n"
" ids[id] = elem\n"
" return tree, ids\n"
"cElementTree.XMLID = XMLID\n"
+ "try:\n"
+ " register_namespace = ET.register_namespace\n"
+ "except AttributeError:\n"
+ " def register_namespace(prefix, uri):\n"
+ " ET._namespace_map[uri] = prefix\n"
+ "cElementTree.register_namespace = register_namespace\n"
+
"cElementTree.dump = ET.dump\n"
"cElementTree.ElementPath = ElementPath = ET.ElementPath\n"
"cElementTree.iselement = ET.iselement\n"
"cElementTree.QName = ET.QName\n"
"cElementTree.tostring = ET.tostring\n"
+ "cElementTree.fromstringlist = ET.fromstringlist\n"
+ "cElementTree.tostringlist = ET.tostringlist\n"
"cElementTree.VERSION = '" VERSION "'\n"
"cElementTree.__version__ = '" VERSION "'\n"
- "cElementTree.XMLParserError = SyntaxError\n"
);
- PyRun_String(bootstrap, Py_file_input, g, NULL);
+ if (!PyRun_String(bootstrap, Py_file_input, g, NULL))
+ return NULL;
elementpath_obj = PyDict_GetItemString(g, "ElementPath");
@@ -2804,22 +3092,30 @@ PyInit__elementtree(void)
}
} else
PyErr_Clear();
+
elementtree_deepcopy_obj = PyDict_GetItemString(g, "deepcopy");
- elementtree_getiterator_obj = PyDict_GetItemString(g, "getiterator");
+ elementtree_iter_obj = PyDict_GetItemString(g, "iter");
+ elementtree_itertext_obj = PyDict_GetItemString(g, "itertext");
#if defined(USE_PYEXPAT_CAPI)
/* link against pyexpat, if possible */
- capi = PyCapsule_Import(PyExpat_CAPSULE_NAME, 0);
- if (capi &&
- strcmp(capi->magic, PyExpat_CAPI_MAGIC) == 0 &&
- capi->size <= sizeof(*expat_capi) &&
- capi->MAJOR_VERSION == XML_MAJOR_VERSION &&
- capi->MINOR_VERSION == XML_MINOR_VERSION &&
- capi->MICRO_VERSION == XML_MICRO_VERSION)
- expat_capi = capi;
- else
- expat_capi = NULL;
+ expat_capi = PyCapsule_Import(PyExpat_CAPSULE_NAME, 0);
+ if (expat_capi) {
+ /* check that it's usable */
+ if (strcmp(expat_capi->magic, PyExpat_CAPI_MAGIC) != 0 ||
+ expat_capi->size < sizeof(struct PyExpat_CAPI) ||
+ expat_capi->MAJOR_VERSION != XML_MAJOR_VERSION ||
+ expat_capi->MINOR_VERSION != XML_MINOR_VERSION ||
+ expat_capi->MICRO_VERSION != XML_MICRO_VERSION)
+ expat_capi = NULL;
+ }
#endif
- return m;
+ elementtree_parseerror_obj = PyErr_NewException(
+ "cElementTree.ParseError", PyExc_SyntaxError, NULL
+ );
+ Py_INCREF(elementtree_parseerror_obj);
+ PyModule_AddObject(m, "ParseError", elementtree_parseerror_obj);
+
+ return m;
}
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index 9aaa0f3994..d8a283bcec 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -196,6 +196,48 @@ static PyGetSetDef partial_getsetlist[] = {
{NULL} /* Sentinel */
};
+static PyObject *
+partial_repr(partialobject *pto)
+{
+ PyObject *result;
+ PyObject *arglist;
+ PyObject *tmp;
+ Py_ssize_t i, n;
+
+ arglist = PyUnicode_FromString("");
+ if (arglist == NULL) {
+ return NULL;
+ }
+ /* Pack positional arguments */
+ assert (PyTuple_Check(pto->args));
+ n = PyTuple_GET_SIZE(pto->args);
+ for (i = 0; i < n; i++) {
+ tmp = PyUnicode_FromFormat("%U, %R", arglist,
+ PyTuple_GET_ITEM(pto->args, i));
+ Py_DECREF(arglist);
+ if (tmp == NULL)
+ return NULL;
+ arglist = tmp;
+ }
+ /* Pack keyword arguments */
+ assert (pto->kw == Py_None || PyDict_Check(pto->kw));
+ if (pto->kw != Py_None) {
+ PyObject *key, *value;
+ for (i = 0; PyDict_Next(pto->kw, &i, &key, &value);) {
+ tmp = PyUnicode_FromFormat("%U, %U=%R", arglist,
+ key, value);
+ Py_DECREF(arglist);
+ if (tmp == NULL)
+ return NULL;
+ arglist = tmp;
+ }
+ }
+ result = PyUnicode_FromFormat("%s(%R%U)", Py_TYPE(pto)->tp_name,
+ pto->fn, arglist);
+ Py_DECREF(arglist);
+ return result;
+}
+
/* Pickle strategy:
__reduce__ by itself doesn't support getting kwargs in the unpickle
operation so we define a __setstate__ that replaces all the information
@@ -254,7 +296,7 @@ static PyTypeObject partial_type = {
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
- 0, /* tp_repr */
+ (reprfunc)partial_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c
index f15fefdf82..474561b235 100644
--- a/Modules/_gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -135,6 +135,28 @@ dbm_subscript(dbmobject *dp, register PyObject *key)
return v;
}
+PyDoc_STRVAR(dbm_get__doc__,
+"get(key[, default]) -> value\n\
+Get the value for key, or default if not present; if not given,\n\
+default is None.");
+
+static PyObject *
+dbm_get(dbmobject *dp, PyObject *args)
+{
+ PyObject *v, *res;
+ PyObject *def = Py_None;
+
+ if (!PyArg_UnpackTuple(args, "get", 1, 2, &v, &def))
+ return NULL;
+ res = dbm_subscript(dp, v);
+ if (res == NULL && PyErr_ExceptionMatches(PyExc_KeyError)) {
+ PyErr_Clear();
+ Py_INCREF(def);
+ return def;
+ }
+ return res;
+}
+
static int
dbm_ass_sub(dbmobject *dp, PyObject *v, PyObject *w)
{
@@ -176,6 +198,29 @@ dbm_ass_sub(dbmobject *dp, PyObject *v, PyObject *w)
return 0;
}
+PyDoc_STRVAR(dbm_setdefault__doc__,
+"setdefault(key[, default]) -> value\n\
+Get value for key, or set it to default and return default if not present;\n\
+if not given, default is None.");
+
+static PyObject *
+dbm_setdefault(dbmobject *dp, PyObject *args)
+{
+ PyObject *v, *res;
+ PyObject *def = Py_None;
+
+ if (!PyArg_UnpackTuple(args, "setdefault", 1, 2, &v, &def))
+ return NULL;
+ res = dbm_subscript(dp, v);
+ if (res == NULL && PyErr_ExceptionMatches(PyExc_KeyError)) {
+ PyErr_Clear();
+ if (dbm_ass_sub(dp, v, def) < 0)
+ return NULL;
+ return dbm_subscript(dp, v);
+ }
+ return res;
+}
+
static PyMappingMethods dbm_as_mapping = {
(lenfunc)dbm_length, /*mp_length*/
(binaryfunc)dbm_subscript, /*mp_subscript*/
@@ -378,6 +423,8 @@ static PyMethodDef dbm_methods[] = {
{"nextkey", (PyCFunction)dbm_nextkey, METH_VARARGS, dbm_nextkey__doc__},
{"reorganize",(PyCFunction)dbm_reorganize,METH_NOARGS, dbm_reorganize__doc__},
{"sync", (PyCFunction)dbm_sync, METH_NOARGS, dbm_sync__doc__},
+ {"get", (PyCFunction)dbm_get, METH_VARARGS, dbm_get__doc__},
+ {"setdefault",(PyCFunction)dbm_setdefault,METH_VARARGS, dbm_setdefault__doc__},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index ee149e117b..dd4317fca0 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -38,6 +38,8 @@
/* EVP is the preferred interface to hashing in OpenSSL */
#include <openssl/evp.h>
+/* We use the object interface to discover what hashes OpenSSL supports. */
+#include <openssl/objects.h>
#define MUNCH_SIZE INT_MAX
@@ -49,6 +51,10 @@
#define HASH_OBJ_CONSTRUCTOR 0
#endif
+/* Minimum OpenSSL version needed to support sha224 and higher. */
+#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x00908000)
+#define _OPENSSL_SUPPORTS_SHA2
+#endif
typedef struct {
PyObject_HEAD
@@ -70,10 +76,12 @@ static PyTypeObject EVPtype;
DEFINE_CONSTS_FOR_NEW(md5)
DEFINE_CONSTS_FOR_NEW(sha1)
+#ifdef _OPENSSL_SUPPORTS_SHA2
DEFINE_CONSTS_FOR_NEW(sha224)
DEFINE_CONSTS_FOR_NEW(sha256)
DEFINE_CONSTS_FOR_NEW(sha384)
DEFINE_CONSTS_FOR_NEW(sha512)
+#endif
static EVPobject *
@@ -482,6 +490,62 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
return ret_obj;
}
+
+/* State for our callback function so that it can accumulate a result. */
+typedef struct _internal_name_mapper_state {
+ PyObject *set;
+ int error;
+} _InternalNameMapperState;
+
+
+/* A callback function to pass to OpenSSL's OBJ_NAME_do_all(...) */
+static void
+_openssl_hash_name_mapper(const OBJ_NAME *openssl_obj_name, void *arg)
+{
+ _InternalNameMapperState *state = (_InternalNameMapperState *)arg;
+ PyObject *py_name;
+
+ assert(state != NULL);
+ if (openssl_obj_name == NULL)
+ return;
+ /* Ignore aliased names, they pollute the list and OpenSSL appears to
+ * have a its own definition of alias as the resulting list still
+ * contains duplicate and alternate names for several algorithms. */
+ if (openssl_obj_name->alias)
+ return;
+
+ py_name = PyUnicode_FromString(openssl_obj_name->name);
+ if (py_name == NULL) {
+ state->error = 1;
+ } else {
+ if (PySet_Add(state->set, py_name) != 0) {
+ Py_DECREF(py_name);
+ state->error = 1;
+ }
+ }
+}
+
+
+/* Ask OpenSSL for a list of supported ciphers, filling in a Python set. */
+static PyObject*
+generate_hash_name_list(void)
+{
+ _InternalNameMapperState state;
+ state.set = PyFrozenSet_New(NULL);
+ if (state.set == NULL)
+ return NULL;
+ state.error = 0;
+
+ OBJ_NAME_do_all(OBJ_NAME_TYPE_MD_METH, &_openssl_hash_name_mapper, &state);
+
+ if (state.error) {
+ Py_DECREF(state.set);
+ return NULL;
+ }
+ return state.set;
+}
+
+
/*
* This macro generates constructor function definitions for specific
* hash algorithms. These constructors are much faster than calling
@@ -534,10 +598,12 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
GEN_CONSTRUCTOR(md5)
GEN_CONSTRUCTOR(sha1)
+#ifdef _OPENSSL_SUPPORTS_SHA2
GEN_CONSTRUCTOR(sha224)
GEN_CONSTRUCTOR(sha256)
GEN_CONSTRUCTOR(sha384)
GEN_CONSTRUCTOR(sha512)
+#endif
/* List of functions exported by this module */
@@ -545,11 +611,13 @@ static struct PyMethodDef EVP_functions[] = {
{"new", (PyCFunction)EVP_new, METH_VARARGS|METH_KEYWORDS, EVP_new__doc__},
CONSTRUCTOR_METH_DEF(md5),
CONSTRUCTOR_METH_DEF(sha1),
+#ifdef _OPENSSL_SUPPORTS_SHA2
CONSTRUCTOR_METH_DEF(sha224),
CONSTRUCTOR_METH_DEF(sha256),
CONSTRUCTOR_METH_DEF(sha384),
CONSTRUCTOR_METH_DEF(sha512),
- {NULL, NULL} /* Sentinel */
+#endif
+ {NULL, NULL} /* Sentinel */
};
@@ -571,7 +639,7 @@ static struct PyModuleDef _hashlibmodule = {
PyMODINIT_FUNC
PyInit__hashlib(void)
{
- PyObject *m;
+ PyObject *m, *openssl_md_meth_names;
OpenSSL_add_all_digests();
@@ -588,6 +656,16 @@ PyInit__hashlib(void)
if (m == NULL)
return NULL;
+ openssl_md_meth_names = generate_hash_name_list();
+ if (openssl_md_meth_names == NULL) {
+ Py_DECREF(m);
+ return NULL;
+ }
+ if (PyModule_AddObject(m, "openssl_md_meth_names", openssl_md_meth_names)) {
+ Py_DECREF(m);
+ return NULL;
+ }
+
#if HASH_OBJ_CONSTRUCTOR
Py_INCREF(&EVPtype);
PyModule_AddObject(m, "HASH", (PyObject *)&EVPtype);
@@ -596,9 +674,11 @@ PyInit__hashlib(void)
/* these constants are used by the convenience constructors */
INIT_CONSTRUCTOR_CONSTANTS(md5);
INIT_CONSTRUCTOR_CONSTANTS(sha1);
+#ifdef _OPENSSL_SUPPORTS_SHA2
INIT_CONSTRUCTOR_CONSTANTS(sha224);
INIT_CONSTRUCTOR_CONSTANTS(sha256);
INIT_CONSTRUCTOR_CONSTANTS(sha384);
INIT_CONSTRUCTOR_CONSTANTS(sha512);
+#endif
return m;
}
diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c
index fd0ecac287..1066f94b00 100644
--- a/Modules/_heapqmodule.c
+++ b/Modules/_heapqmodule.c
@@ -9,12 +9,6 @@ annotated by François Pinard, and converted to C by Raymond Hettinger.
#include "Python.h"
static int
-cmp_lt(PyObject *x, PyObject *y)
-{
- return PyObject_RichCompareBool(x, y, Py_LT);
-}
-
-static int
_siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos)
{
PyObject *newitem, *parent;
@@ -34,7 +28,7 @@ _siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos)
while (pos > startpos){
parentpos = (pos - 1) >> 1;
parent = PyList_GET_ITEM(heap, parentpos);
- cmp = cmp_lt(newitem, parent);
+ cmp = PyObject_RichCompareBool(newitem, parent, Py_LT);
if (cmp == -1) {
Py_DECREF(newitem);
return -1;
@@ -74,9 +68,10 @@ _siftup(PyListObject *heap, Py_ssize_t pos)
/* Set childpos to index of smaller child. */
rightpos = childpos + 1;
if (rightpos < endpos) {
- cmp = cmp_lt(
+ cmp = PyObject_RichCompareBool(
PyList_GET_ITEM(heap, childpos),
- PyList_GET_ITEM(heap, rightpos));
+ PyList_GET_ITEM(heap, rightpos),
+ Py_LT);
if (cmp == -1) {
Py_DECREF(newitem);
return -1;
@@ -219,7 +214,7 @@ heappushpop(PyObject *self, PyObject *args)
return item;
}
- cmp = cmp_lt(PyList_GET_ITEM(heap, 0), item);
+ cmp = PyObject_RichCompareBool(PyList_GET_ITEM(heap, 0), item, Py_LT);
if (cmp == -1)
return NULL;
if (cmp == 0) {
@@ -318,7 +313,7 @@ nlargest(PyObject *self, PyObject *args)
else
goto sortit;
}
- cmp = cmp_lt(sol, elem);
+ cmp = PyObject_RichCompareBool(sol, elem, Py_LT);
if (cmp == -1) {
Py_DECREF(elem);
goto fail;
@@ -373,7 +368,7 @@ _siftdownmax(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos)
while (pos > startpos){
parentpos = (pos - 1) >> 1;
parent = PyList_GET_ITEM(heap, parentpos);
- cmp = cmp_lt(parent, newitem);
+ cmp = PyObject_RichCompareBool(parent, newitem, Py_LT);
if (cmp == -1) {
Py_DECREF(newitem);
return -1;
@@ -413,9 +408,10 @@ _siftupmax(PyListObject *heap, Py_ssize_t pos)
/* Set childpos to index of smaller child. */
rightpos = childpos + 1;
if (rightpos < endpos) {
- cmp = cmp_lt(
+ cmp = PyObject_RichCompareBool(
PyList_GET_ITEM(heap, rightpos),
- PyList_GET_ITEM(heap, childpos));
+ PyList_GET_ITEM(heap, childpos),
+ Py_LT);
if (cmp == -1) {
Py_DECREF(newitem);
return -1;
@@ -488,7 +484,7 @@ nsmallest(PyObject *self, PyObject *args)
else
goto sortit;
}
- cmp = cmp_lt(elem, los);
+ cmp = PyObject_RichCompareBool(elem, los, Py_LT);
if (cmp == -1) {
Py_DECREF(elem);
goto fail;
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index a1c451eb56..44bdac6b5c 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -710,6 +710,8 @@ PyInit__io(void)
/* BytesIO */
PyBytesIO_Type.tp_base = &PyBufferedIOBase_Type;
ADD_TYPE(&PyBytesIO_Type, "BytesIO");
+ if (PyType_Ready(&_PyBytesIOBuffer_Type) < 0)
+ goto fail;
/* StringIO */
PyStringIO_Type.tp_base = &PyTextIOBase_Type;
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h
index 16ab6c241d..925e4f2cc7 100644
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -73,6 +73,14 @@ PyAPI_DATA(PyObject *) PyExc_BlockingIOError;
* Offset type for positioning.
*/
+/* Printing a variable of type off_t (with e.g., PyString_FromFormat)
+ correctly and without producing compiler warnings is surprisingly painful.
+ We identify an integer type whose size matches off_t and then: (1) cast the
+ off_t to that integer type and (2) use the appropriate conversion
+ specification. The cast is necessary: gcc complains about formatting a
+ long with "%lld" even when both long and long long have the same
+ precision. */
+
#if defined(MS_WIN64) || defined(MS_WINDOWS)
/* Windows uses long long for offsets */
@@ -81,6 +89,8 @@ typedef PY_LONG_LONG Py_off_t;
# define PyLong_FromOff_t PyLong_FromLongLong
# define PY_OFF_T_MAX PY_LLONG_MAX
# define PY_OFF_T_MIN PY_LLONG_MIN
+# define PY_OFF_T_COMPAT PY_LONG_LONG /* type compatible with off_t */
+# define PY_PRIdOFF "lld" /* format to use for that type */
#else
@@ -91,16 +101,22 @@ typedef off_t Py_off_t;
# define PyLong_FromOff_t PyLong_FromSsize_t
# define PY_OFF_T_MAX PY_SSIZE_T_MAX
# define PY_OFF_T_MIN PY_SSIZE_T_MIN
-#elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG)
+# define PY_OFF_T_COMPAT Py_ssize_t
+# define PY_PRIdOFF "zd"
+#elif (HAVE_LONG_LONG && SIZEOF_OFF_T == SIZEOF_LONG_LONG)
# define PyLong_AsOff_t PyLong_AsLongLong
# define PyLong_FromOff_t PyLong_FromLongLong
# define PY_OFF_T_MAX PY_LLONG_MAX
# define PY_OFF_T_MIN PY_LLONG_MIN
+# define PY_OFF_T_COMPAT PY_LONG_LONG
+# define PY_PRIdOFF "lld"
#elif (SIZEOF_OFF_T == SIZEOF_LONG)
# define PyLong_AsOff_t PyLong_AsLong
# define PyLong_FromOff_t PyLong_FromLong
# define PY_OFF_T_MAX LONG_MAX
# define PY_OFF_T_MIN LONG_MIN
+# define PY_OFF_T_COMPAT long
+# define PY_PRIdOFF "ld"
#else
# error off_t does not match either size_t, long, or long long!
#endif
@@ -153,3 +169,5 @@ extern PyObject *_PyIO_str_write;
extern PyObject *_PyIO_empty_str;
extern PyObject *_PyIO_empty_bytes;
extern PyObject *_PyIO_zero;
+
+extern PyTypeObject _PyBytesIOBuffer_Type;
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 71c4052f29..386a880997 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -197,6 +197,7 @@ typedef struct {
int detached;
int readable;
int writable;
+ int deallocating;
/* True if this is a vanilla Buffered object (rather than a user derived
class) *and* the raw stream is a vanilla FileIO object. */
@@ -260,6 +261,7 @@ typedef struct {
/* These macros protect the buffered object against concurrent operations. */
#ifdef WITH_THREAD
+
static int
_enter_buffered_busy(buffered *self)
{
@@ -359,6 +361,7 @@ _enter_buffered_busy(buffered *self)
static void
buffered_dealloc(buffered *self)
{
+ self->deallocating = 1;
if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0)
return;
_PyObject_GC_UNTRACK(self);
@@ -399,6 +402,23 @@ buffered_clear(buffered *self)
return 0;
}
+/* Because this can call arbitrary code, it shouldn't be called when
+ the refcount is 0 (that is, not directly from tp_dealloc unless
+ the refcount has been temporarily re-incremented). */
+static PyObject *
+buffered_dealloc_warn(buffered *self, PyObject *source)
+{
+ if (self->ok && self->raw) {
+ PyObject *r;
+ r = PyObject_CallMethod(self->raw, "_dealloc_warn", "O", source);
+ if (r)
+ Py_DECREF(r);
+ else
+ PyErr_Clear();
+ }
+ Py_RETURN_NONE;
+}
+
/*
* _BufferedIOMixin methods
* This is not a class, just a collection of methods that will be reused
@@ -453,6 +473,14 @@ buffered_close(buffered *self, PyObject *args)
Py_INCREF(res);
goto end;
}
+
+ if (self->deallocating) {
+ PyObject *r = buffered_dealloc_warn(self, (PyObject *) self);
+ if (r)
+ Py_DECREF(r);
+ else
+ PyErr_Clear();
+ }
/* flush() will most probably re-take the lock, so drop it first */
LEAVE_BUFFERED(self)
res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL);
@@ -541,6 +569,15 @@ buffered_isatty(buffered *self, PyObject *args)
return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_isatty, NULL);
}
+/* Serialization */
+
+static PyObject *
+buffered_getstate(buffered *self, PyObject *args)
+{
+ PyErr_Format(PyExc_TypeError,
+ "cannot serialize '%s' object", Py_TYPE(self)->tp_name);
+ return NULL;
+}
/* Forward decls */
static PyObject *
@@ -597,7 +634,8 @@ _buffered_raw_tell(buffered *self)
if (n < 0) {
if (!PyErr_Occurred())
PyErr_Format(PyExc_IOError,
- "Raw stream returned invalid position %zd", n);
+ "Raw stream returned invalid position %" PY_PRIdOFF,
+ (PY_OFF_T_COMPAT)n);
return -1;
}
self->abs_pos = n;
@@ -629,7 +667,8 @@ _buffered_raw_seek(buffered *self, Py_off_t target, int whence)
if (n < 0) {
if (!PyErr_Occurred())
PyErr_Format(PyExc_IOError,
- "Raw stream returned invalid position %zd", n);
+ "Raw stream returned invalid position %" PY_PRIdOFF,
+ (PY_OFF_T_COMPAT)n);
return -1;
}
self->abs_pos = n;
@@ -675,6 +714,39 @@ _buffered_init(buffered *self)
return 0;
}
+/* Return 1 if an EnvironmentError with errno == EINTR is set (and then
+ clears the error indicator), 0 otherwise.
+ Should only be called when PyErr_Occurred() is true.
+*/
+static int
+_trap_eintr(void)
+{
+ static PyObject *eintr_int = NULL;
+ PyObject *typ, *val, *tb;
+ PyEnvironmentErrorObject *env_err;
+
+ if (eintr_int == NULL) {
+ eintr_int = PyLong_FromLong(EINTR);
+ assert(eintr_int != NULL);
+ }
+ if (!PyErr_ExceptionMatches(PyExc_EnvironmentError))
+ return 0;
+ PyErr_Fetch(&typ, &val, &tb);
+ PyErr_NormalizeException(&typ, &val, &tb);
+ env_err = (PyEnvironmentErrorObject *) val;
+ assert(env_err != NULL);
+ if (env_err->myerrno != NULL &&
+ PyObject_RichCompareBool(env_err->myerrno, eintr_int, Py_EQ) > 0) {
+ Py_DECREF(typ);
+ Py_DECREF(val);
+ Py_XDECREF(tb);
+ return 1;
+ }
+ /* This silences any error set by PyObject_RichCompareBool() */
+ PyErr_Restore(typ, val, tb);
+ return 0;
+}
+
/*
* Shared methods and wrappers
*/
@@ -1230,7 +1302,14 @@ _bufferedreader_raw_read(buffered *self, char *start, Py_ssize_t len)
memobj = PyMemoryView_FromBuffer(&buf);
if (memobj == NULL)
return -1;
- res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readinto, memobj, NULL);
+ /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals() when EINTR
+ occurs so we needn't do it ourselves.
+ We then retry reading, ignoring the signal if no handler has
+ raised (see issue #10956).
+ */
+ do {
+ res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readinto, memobj, NULL);
+ } while (res == NULL && _trap_eintr());
Py_DECREF(memobj);
if (res == NULL)
return -1;
@@ -1488,6 +1567,8 @@ static PyMethodDef bufferedreader_methods[] = {
{"writable", (PyCFunction)buffered_writable, METH_NOARGS},
{"fileno", (PyCFunction)buffered_fileno, METH_NOARGS},
{"isatty", (PyCFunction)buffered_isatty, METH_NOARGS},
+ {"_dealloc_warn", (PyCFunction)buffered_dealloc_warn, METH_O},
+ {"__getstate__", (PyCFunction)buffered_getstate, METH_NOARGS},
{"read", (PyCFunction)buffered_read, METH_VARARGS},
{"peek", (PyCFunction)buffered_peek, METH_VARARGS},
@@ -1637,7 +1718,14 @@ _bufferedwriter_raw_write(buffered *self, char *start, Py_ssize_t len)
memobj = PyMemoryView_FromBuffer(&buf);
if (memobj == NULL)
return -1;
- res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_write, memobj, NULL);
+ /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals() when EINTR
+ occurs so we needn't do it ourselves.
+ We then retry writing, ignoring the signal if no handler has
+ raised (see issue #10956).
+ */
+ do {
+ res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_write, memobj, NULL);
+ } while (res == NULL && _trap_eintr());
Py_DECREF(memobj);
if (res == NULL)
return -1;
@@ -1723,7 +1811,8 @@ bufferedwriter_write(buffered *self, PyObject *args)
{
PyObject *res = NULL;
Py_buffer buf;
- Py_ssize_t written, avail, remaining, n;
+ Py_ssize_t written, avail, remaining;
+ Py_off_t offset;
CHECK_INITIALIZED(self)
if (!PyArg_ParseTuple(args, "y*:write", &buf)) {
@@ -1801,18 +1890,18 @@ bufferedwriter_write(buffered *self, PyObject *args)
the raw stream by itself).
Fixes issue #6629.
*/
- n = RAW_OFFSET(self);
- if (n != 0) {
- if (_buffered_raw_seek(self, -n, 1) < 0)
+ offset = RAW_OFFSET(self);
+ if (offset != 0) {
+ if (_buffered_raw_seek(self, -offset, 1) < 0)
goto error;
- self->raw_pos -= n;
+ self->raw_pos -= offset;
}
/* Then write buf itself. At this point the buffer has been emptied. */
remaining = buf.len;
written = 0;
while (remaining > self->buffer_size) {
- n = _bufferedwriter_raw_write(
+ Py_ssize_t n = _bufferedwriter_raw_write(
self, (char *) buf.buf + written, buf.len - written);
if (n == -1) {
Py_ssize_t *w = _buffered_check_blocking_error();
@@ -1872,6 +1961,8 @@ static PyMethodDef bufferedwriter_methods[] = {
{"writable", (PyCFunction)buffered_writable, METH_NOARGS},
{"fileno", (PyCFunction)buffered_fileno, METH_NOARGS},
{"isatty", (PyCFunction)buffered_isatty, METH_NOARGS},
+ {"_dealloc_warn", (PyCFunction)buffered_dealloc_warn, METH_O},
+ {"__getstate__", (PyCFunction)buffered_getstate, METH_NOARGS},
{"write", (PyCFunction)bufferedwriter_write, METH_VARARGS},
{"truncate", (PyCFunction)buffered_truncate, METH_VARARGS},
@@ -2137,6 +2228,8 @@ static PyMethodDef bufferedrwpair_methods[] = {
{"close", (PyCFunction)bufferedrwpair_close, METH_NOARGS},
{"isatty", (PyCFunction)bufferedrwpair_isatty, METH_NOARGS},
+ {"__getstate__", (PyCFunction)buffered_getstate, METH_NOARGS},
+
{NULL, NULL}
};
@@ -2256,6 +2349,8 @@ static PyMethodDef bufferedrandom_methods[] = {
{"writable", (PyCFunction)buffered_writable, METH_NOARGS},
{"fileno", (PyCFunction)buffered_fileno, METH_NOARGS},
{"isatty", (PyCFunction)buffered_isatty, METH_NOARGS},
+ {"_dealloc_warn", (PyCFunction)buffered_dealloc_warn, METH_O},
+ {"__getstate__", (PyCFunction)buffered_getstate, METH_NOARGS},
{"flush", (PyCFunction)buffered_flush, METH_NOARGS},
@@ -2325,4 +2420,3 @@ PyTypeObject PyBufferedRandom_Type = {
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
-
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index c8fb3eb95f..b40513f7a7 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -10,8 +10,15 @@ typedef struct {
size_t buf_size;
PyObject *dict;
PyObject *weakreflist;
+ Py_ssize_t exports;
} bytesio;
+typedef struct {
+ PyObject_HEAD
+ bytesio *source;
+} bytesiobuf;
+
+
#define CHECK_CLOSED(self) \
if ((self)->buf == NULL) { \
PyErr_SetString(PyExc_ValueError, \
@@ -19,6 +26,14 @@ typedef struct {
return NULL; \
}
+#define CHECK_EXPORTS(self) \
+ if ((self)->exports > 0) { \
+ PyErr_SetString(PyExc_BufferError, \
+ "Existing exports of data: object cannot be re-sized"); \
+ return NULL; \
+ }
+
+
/* Internal routine to get a line from the buffer of a BytesIO
object. Returns the length between the current position to the
next newline character. */
@@ -173,6 +188,30 @@ bytesio_flush(bytesio *self)
Py_RETURN_NONE;
}
+PyDoc_STRVAR(getbuffer_doc,
+"getbuffer() -> bytes.\n"
+"\n"
+"Get a read-write view over the contents of the BytesIO object.");
+
+static PyObject *
+bytesio_getbuffer(bytesio *self)
+{
+ PyTypeObject *type = &_PyBytesIOBuffer_Type;
+ bytesiobuf *buf;
+ PyObject *view;
+
+ CHECK_CLOSED(self);
+
+ buf = (bytesiobuf *) type->tp_alloc(type, 0);
+ if (buf == NULL)
+ return NULL;
+ Py_INCREF(self);
+ buf->source = self;
+ view = PyMemoryView_FromObject((PyObject *) buf);
+ Py_DECREF(buf);
+ return view;
+}
+
PyDoc_STRVAR(getval_doc,
"getvalue() -> bytes.\n"
"\n"
@@ -427,6 +466,7 @@ bytesio_truncate(bytesio *self, PyObject *args)
PyObject *arg = Py_None;
CHECK_CLOSED(self);
+ CHECK_EXPORTS(self);
if (!PyArg_ParseTuple(args, "|O:truncate", &arg))
return NULL;
@@ -548,6 +588,7 @@ bytesio_write(bytesio *self, PyObject *obj)
PyObject *result = NULL;
CHECK_CLOSED(self);
+ CHECK_EXPORTS(self);
if (PyObject_GetBuffer(obj, &buf, PyBUF_CONTIG_RO) < 0)
return NULL;
@@ -611,10 +652,130 @@ bytesio_close(bytesio *self)
Py_RETURN_NONE;
}
+/* Pickling support.
+
+ Note that only pickle protocol 2 and onward are supported since we use
+ extended __reduce__ API of PEP 307 to make BytesIO instances picklable.
+
+ Providing support for protocol < 2 would require the __reduce_ex__ method
+ which is notably long-winded when defined properly.
+
+ For BytesIO, the implementation would similar to one coded for
+ object.__reduce_ex__, but slightly less general. To be more specific, we
+ could call bytesio_getstate directly and avoid checking for the presence of
+ a fallback __reduce__ method. However, we would still need a __newobj__
+ function to use the efficient instance representation of PEP 307.
+ */
+
+static PyObject *
+bytesio_getstate(bytesio *self)
+{
+ PyObject *initvalue = bytesio_getvalue(self);
+ PyObject *dict;
+ PyObject *state;
+
+ if (initvalue == NULL)
+ return NULL;
+ if (self->dict == NULL) {
+ Py_INCREF(Py_None);
+ dict = Py_None;
+ }
+ else {
+ dict = PyDict_Copy(self->dict);
+ if (dict == NULL)
+ return NULL;
+ }
+
+ state = Py_BuildValue("(OnN)", initvalue, self->pos, dict);
+ Py_DECREF(initvalue);
+ return state;
+}
+
+static PyObject *
+bytesio_setstate(bytesio *self, PyObject *state)
+{
+ PyObject *result;
+ PyObject *position_obj;
+ PyObject *dict;
+ Py_ssize_t pos;
+
+ assert(state != NULL);
+
+ /* We allow the state tuple to be longer than 3, because we may need
+ someday to extend the object's state without breaking
+ backward-compatibility. */
+ if (!PyTuple_Check(state) || Py_SIZE(state) < 3) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.__setstate__ argument should be 3-tuple, got %.200s",
+ Py_TYPE(self)->tp_name, Py_TYPE(state)->tp_name);
+ return NULL;
+ }
+ CHECK_EXPORTS(self);
+ /* Reset the object to its default state. This is only needed to handle
+ the case of repeated calls to __setstate__. */
+ self->string_size = 0;
+ self->pos = 0;
+
+ /* Set the value of the internal buffer. If state[0] does not support the
+ buffer protocol, bytesio_write will raise the appropriate TypeError. */
+ result = bytesio_write(self, PyTuple_GET_ITEM(state, 0));
+ if (result == NULL)
+ return NULL;
+ Py_DECREF(result);
+
+ /* Set carefully the position value. Alternatively, we could use the seek
+ method instead of modifying self->pos directly to better protect the
+ object internal state against errneous (or malicious) inputs. */
+ position_obj = PyTuple_GET_ITEM(state, 1);
+ if (!PyLong_Check(position_obj)) {
+ PyErr_Format(PyExc_TypeError,
+ "second item of state must be an integer, not %.200s",
+ Py_TYPE(position_obj)->tp_name);
+ return NULL;
+ }
+ pos = PyLong_AsSsize_t(position_obj);
+ if (pos == -1 && PyErr_Occurred())
+ return NULL;
+ if (pos < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "position value cannot be negative");
+ return NULL;
+ }
+ self->pos = pos;
+
+ /* Set the dictionary of the instance variables. */
+ dict = PyTuple_GET_ITEM(state, 2);
+ if (dict != Py_None) {
+ if (!PyDict_Check(dict)) {
+ PyErr_Format(PyExc_TypeError,
+ "third item of state should be a dict, got a %.200s",
+ Py_TYPE(dict)->tp_name);
+ return NULL;
+ }
+ if (self->dict) {
+ /* Alternatively, we could replace the internal dictionary
+ completely. However, it seems more practical to just update it. */
+ if (PyDict_Update(self->dict, dict) < 0)
+ return NULL;
+ }
+ else {
+ Py_INCREF(dict);
+ self->dict = dict;
+ }
+ }
+
+ Py_RETURN_NONE;
+}
+
static void
bytesio_dealloc(bytesio *self)
{
_PyObject_GC_UNTRACK(self);
+ if (self->exports > 0) {
+ PyErr_SetString(PyExc_SystemError,
+ "deallocated BytesIO object has exported buffers");
+ PyErr_Print();
+ }
if (self->buf != NULL) {
PyMem_Free(self->buf);
self->buf = NULL;
@@ -635,9 +796,9 @@ bytesio_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (self == NULL)
return NULL;
- self->string_size = 0;
- self->pos = 0;
- self->buf_size = 0;
+ /* tp_alloc initializes all the fields to zero. So we don't have to
+ initialize them here. */
+
self->buf = (char *)PyMem_Malloc(0);
if (self->buf == NULL) {
Py_DECREF(self);
@@ -709,9 +870,12 @@ static struct PyMethodDef bytesio_methods[] = {
{"readline", (PyCFunction)bytesio_readline, METH_VARARGS, readline_doc},
{"readlines", (PyCFunction)bytesio_readlines, METH_VARARGS, readlines_doc},
{"read", (PyCFunction)bytesio_read, METH_VARARGS, read_doc},
+ {"getbuffer", (PyCFunction)bytesio_getbuffer, METH_NOARGS, getbuffer_doc},
{"getvalue", (PyCFunction)bytesio_getvalue, METH_NOARGS, getval_doc},
{"seek", (PyCFunction)bytesio_seek, METH_VARARGS, seek_doc},
{"truncate", (PyCFunction)bytesio_truncate, METH_VARARGS, truncate_doc},
+ {"__getstate__", (PyCFunction)bytesio_getstate, METH_NOARGS, NULL},
+ {"__setstate__", (PyCFunction)bytesio_setstate, METH_O, NULL},
{NULL, NULL} /* sentinel */
};
@@ -762,3 +926,96 @@ PyTypeObject PyBytesIO_Type = {
0, /*tp_alloc*/
bytesio_new, /*tp_new*/
};
+
+
+/*
+ * Implementation of the small intermediate object used by getbuffer().
+ * getbuffer() returns a memoryview over this object, which should make it
+ * invisible from Python code.
+ */
+
+static int
+bytesiobuf_getbuffer(bytesiobuf *obj, Py_buffer *view, int flags)
+{
+ int ret;
+ void *ptr;
+ bytesio *b = (bytesio *) obj->source;
+ if (view == NULL) {
+ b->exports++;
+ return 0;
+ }
+ ptr = (void *) obj;
+ ret = PyBuffer_FillInfo(view, (PyObject*)obj, b->buf, b->string_size,
+ 0, flags);
+ if (ret >= 0) {
+ b->exports++;
+ }
+ return ret;
+}
+
+static void
+bytesiobuf_releasebuffer(bytesiobuf *obj, Py_buffer *view)
+{
+ bytesio *b = (bytesio *) obj->source;
+ b->exports--;
+}
+
+static int
+bytesiobuf_traverse(bytesiobuf *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->source);
+ return 0;
+}
+
+static void
+bytesiobuf_dealloc(bytesiobuf *self)
+{
+ Py_CLEAR(self->source);
+ Py_TYPE(self)->tp_free(self);
+}
+
+static PyBufferProcs bytesiobuf_as_buffer = {
+ (getbufferproc) bytesiobuf_getbuffer,
+ (releasebufferproc) bytesiobuf_releasebuffer,
+};
+
+PyTypeObject _PyBytesIOBuffer_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_io._BytesIOBuffer", /*tp_name*/
+ sizeof(bytesiobuf), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ (destructor)bytesiobuf_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_reserved*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &bytesiobuf_as_buffer, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ (traverseproc)bytesiobuf_traverse, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ 0, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ 0, /*tp_new*/
+};
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 473919b7a7..1aa5ee992d 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -2,9 +2,16 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#include "structmember.h"
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif
#include <stddef.h> /* For offsetof */
#include "_iomodule.h"
@@ -49,6 +56,7 @@ typedef struct {
unsigned int writable : 1;
signed int seekable : 2; /* -1 means unknown */
unsigned int closefd : 1;
+ unsigned int deallocating: 1;
PyObject *weakreflist;
PyObject *dict;
} fileio;
@@ -63,6 +71,26 @@ _PyFileIO_closed(PyObject *self)
return ((fileio *)self)->fd < 0;
}
+/* Because this can call arbitrary code, it shouldn't be called when
+ the refcount is 0 (that is, not directly from tp_dealloc unless
+ the refcount has been temporarily re-incremented). */
+static PyObject *
+fileio_dealloc_warn(fileio *self, PyObject *source)
+{
+ if (self->fd >= 0 && self->closefd) {
+ PyObject *exc, *val, *tb;
+ PyErr_Fetch(&exc, &val, &tb);
+ if (PyErr_WarnFormat(PyExc_ResourceWarning, 1,
+ "unclosed file %R", source)) {
+ /* Spurious errors can appear at shutdown */
+ if (PyErr_ExceptionMatches(PyExc_Warning))
+ PyErr_WriteUnraisable((PyObject *) self);
+ }
+ PyErr_Restore(exc, val, tb);
+ }
+ Py_RETURN_NONE;
+}
+
static PyObject *
portable_lseek(int fd, PyObject *posobj, int whence);
@@ -104,6 +132,13 @@ fileio_close(fileio *self)
self->fd = -1;
Py_RETURN_NONE;
}
+ if (self->deallocating) {
+ PyObject *r = fileio_dealloc_warn(self, (PyObject *) self);
+ if (r)
+ Py_DECREF(r);
+ else
+ PyErr_Clear();
+ }
errno = internal_close(self);
if (errno < 0)
return NULL;
@@ -224,11 +259,8 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
}
#ifdef MS_WINDOWS
- if (GetVersion() < 0x80000000) {
- /* On NT, so wide API available */
- if (PyUnicode_Check(nameobj))
- widename = PyUnicode_AS_UNICODE(nameobj);
- }
+ if (PyUnicode_Check(nameobj))
+ widename = PyUnicode_AS_UNICODE(nameobj);
if (widename == NULL)
#endif
if (fd < 0)
@@ -244,8 +276,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
if (u == NULL)
return -1;
- stringobj = PyUnicode_AsEncodedString(
- u, Py_FileSystemDefaultEncoding, "surrogateescape");
+ stringobj = PyUnicode_EncodeFSDefault(u);
Py_DECREF(u);
if (stringobj == NULL)
return -1;
@@ -353,10 +384,15 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
PyErr_SetFromErrnoWithFilename(PyExc_IOError, name);
goto error;
}
- if(dircheck(self, name) < 0)
+ if (dircheck(self, name) < 0)
goto error;
}
+#if defined(MS_WINDOWS) || defined(__CYGWIN__)
+ /* don't translate newlines (\r\n <=> \n) */
+ _setmode(self->fd, O_BINARY);
+#endif
+
if (PyObject_SetAttrString((PyObject *)self, "name", nameobj) < 0)
goto error;
@@ -379,6 +415,8 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
error:
ret = -1;
+ if (self->fd >= 0)
+ internal_close(self);
done:
Py_CLEAR(stringobj);
@@ -402,6 +440,7 @@ fileio_clear(fileio *self)
static void
fileio_dealloc(fileio *self)
{
+ self->deallocating = 1;
if (_PyIOBase_finalize((PyObject *) self) < 0)
return;
_PyObject_GC_UNTRACK(self);
@@ -421,7 +460,8 @@ err_closed(void)
static PyObject *
err_mode(char *action)
{
- PyErr_Format(PyExc_ValueError, "File not open for %s", action);
+ PyErr_Format(IO_STATE->unsupported_operation,
+ "File not open for %s", action);
return NULL;
}
@@ -471,7 +511,7 @@ static PyObject *
fileio_readinto(fileio *self, PyObject *args)
{
Py_buffer pbuf;
- Py_ssize_t n;
+ Py_ssize_t n, len;
if (self->fd < 0)
return err_closed();
@@ -482,9 +522,16 @@ fileio_readinto(fileio *self, PyObject *args)
return NULL;
if (_PyVerify_fd(self->fd)) {
+ len = pbuf.len;
Py_BEGIN_ALLOW_THREADS
errno = 0;
- n = read(self->fd, pbuf.buf, pbuf.len);
+#if defined(MS_WIN64) || defined(MS_WINDOWS)
+ if (len > INT_MAX)
+ len = INT_MAX;
+ n = read(self->fd, pbuf.buf, (int)len);
+#else
+ n = read(self->fd, pbuf.buf, len);
+#endif
Py_END_ALLOW_THREADS
} else
n = -1;
@@ -650,7 +697,7 @@ static PyObject *
fileio_write(fileio *self, PyObject *args)
{
Py_buffer pbuf;
- Py_ssize_t n;
+ Py_ssize_t n, len;
if (self->fd < 0)
return err_closed();
@@ -663,7 +710,21 @@ fileio_write(fileio *self, PyObject *args)
if (_PyVerify_fd(self->fd)) {
Py_BEGIN_ALLOW_THREADS
errno = 0;
- n = write(self->fd, pbuf.buf, pbuf.len);
+ len = pbuf.len;
+#if defined(MS_WIN64) || defined(MS_WINDOWS)
+ if (len > 32767 && isatty(self->fd)) {
+ /* Issue #11395: the Windows console returns an error (12: not
+ enough space error) on writing into stdout if stdout mode is
+ binary and the length is greater than 66,000 bytes (or less,
+ depending on heap usage). */
+ len = 32767;
+ }
+ else if (len > INT_MAX)
+ len = INT_MAX;
+ n = write(self->fd, pbuf.buf, (int)len);
+#else
+ n = write(self->fd, pbuf.buf, len);
+#endif
Py_END_ALLOW_THREADS
} else
n = -1;
@@ -917,6 +978,14 @@ fileio_isatty(fileio *self)
return PyBool_FromLong(res);
}
+static PyObject *
+fileio_getstate(fileio *self)
+{
+ PyErr_Format(PyExc_TypeError,
+ "cannot serialize '%s' object", Py_TYPE(self)->tp_name);
+ return NULL;
+}
+
PyDoc_STRVAR(fileio_doc,
"file(name: str[, mode: str]) -> file IO object\n"
@@ -1010,6 +1079,8 @@ static PyMethodDef fileio_methods[] = {
{"writable", (PyCFunction)fileio_writable, METH_NOARGS, writable_doc},
{"fileno", (PyCFunction)fileio_fileno, METH_NOARGS, fileno_doc},
{"isatty", (PyCFunction)fileio_isatty, METH_NOARGS, isatty_doc},
+ {"_dealloc_warn", (PyCFunction)fileio_dealloc_warn, METH_O, NULL},
+ {"__getstate__", (PyCFunction)fileio_getstate, METH_NOARGS, NULL},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index 84b560a029..ec7a242929 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -35,7 +35,8 @@ PyDoc_STRVAR(iobase_doc,
"Even though IOBase does not declare read, readinto, or write because\n"
"their signatures will vary, implementations and clients should\n"
"consider those methods part of the interface. Also, implementations\n"
- "may raise a IOError when operations they do not support are called.\n"
+ "may raise UnsupportedOperation when operations they do not support are\n"
+ "called.\n"
"\n"
"The basic type used for binary data read from or written to a file is\n"
"bytes. bytearrays are accepted too, and in some cases (such as\n"
@@ -300,7 +301,7 @@ iobase_dealloc(iobase *self)
PyDoc_STRVAR(iobase_seekable_doc,
"Return whether object supports random access.\n"
"\n"
- "If False, seek(), tell() and truncate() will raise IOError.\n"
+ "If False, seek(), tell() and truncate() will raise UnsupportedOperation.\n"
"This method may need to do a test seek().");
static PyObject *
@@ -317,7 +318,7 @@ _PyIOBase_check_seekable(PyObject *self, PyObject *args)
return NULL;
if (res != Py_True) {
Py_CLEAR(res);
- PyErr_SetString(PyExc_IOError, "File or stream is not seekable.");
+ iobase_unsupported("File or stream is not seekable.");
return NULL;
}
if (args == Py_True) {
@@ -329,7 +330,7 @@ _PyIOBase_check_seekable(PyObject *self, PyObject *args)
PyDoc_STRVAR(iobase_readable_doc,
"Return whether object was opened for reading.\n"
"\n"
- "If False, read() will raise IOError.");
+ "If False, read() will raise UnsupportedOperation.");
static PyObject *
iobase_readable(PyObject *self, PyObject *args)
@@ -346,7 +347,7 @@ _PyIOBase_check_readable(PyObject *self, PyObject *args)
return NULL;
if (res != Py_True) {
Py_CLEAR(res);
- PyErr_SetString(PyExc_IOError, "File or stream is not readable.");
+ iobase_unsupported("File or stream is not readable.");
return NULL;
}
if (args == Py_True) {
@@ -358,7 +359,7 @@ _PyIOBase_check_readable(PyObject *self, PyObject *args)
PyDoc_STRVAR(iobase_writable_doc,
"Return whether object was opened for writing.\n"
"\n"
- "If False, read() will raise IOError.");
+ "If False, write() will raise UnsupportedOperation.");
static PyObject *
iobase_writable(PyObject *self, PyObject *args)
@@ -375,7 +376,7 @@ _PyIOBase_check_writable(PyObject *self, PyObject *args)
return NULL;
if (res != Py_True) {
Py_CLEAR(res);
- PyErr_SetString(PyExc_IOError, "File or stream is not writable.");
+ iobase_unsupported("File or stream is not writable.");
return NULL;
}
if (args == Py_True) {
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index 8d83f73078..c9d14b114b 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -532,9 +532,9 @@ stringio_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (self == NULL)
return NULL;
- self->string_size = 0;
- self->pos = 0;
- self->buf_size = 0;
+ /* tp_alloc initializes all the fields to zero. So we don't have to
+ initialize them here. */
+
self->buf = (Py_UNICODE *)PyMem_Malloc(0);
if (self->buf == NULL) {
Py_DECREF(self);
@@ -671,6 +671,135 @@ stringio_writable(stringio *self, PyObject *args)
Py_RETURN_TRUE;
}
+/* Pickling support.
+
+ The implementation of __getstate__ is similar to the one for BytesIO,
+ except that we also save the newline parameter. For __setstate__ and unlike
+ BytesIO, we call __init__ to restore the object's state. Doing so allows us
+ to avoid decoding the complex newline state while keeping the object
+ representation compact.
+
+ See comment in bytesio.c regarding why only pickle protocols and onward are
+ supported.
+*/
+
+static PyObject *
+stringio_getstate(stringio *self)
+{
+ PyObject *initvalue = stringio_getvalue(self);
+ PyObject *dict;
+ PyObject *state;
+
+ if (initvalue == NULL)
+ return NULL;
+ if (self->dict == NULL) {
+ Py_INCREF(Py_None);
+ dict = Py_None;
+ }
+ else {
+ dict = PyDict_Copy(self->dict);
+ if (dict == NULL)
+ return NULL;
+ }
+
+ state = Py_BuildValue("(OOnN)", initvalue,
+ self->readnl ? self->readnl : Py_None,
+ self->pos, dict);
+ Py_DECREF(initvalue);
+ return state;
+}
+
+static PyObject *
+stringio_setstate(stringio *self, PyObject *state)
+{
+ PyObject *initarg;
+ PyObject *position_obj;
+ PyObject *dict;
+ Py_ssize_t pos;
+
+ assert(state != NULL);
+ CHECK_CLOSED(self);
+
+ /* We allow the state tuple to be longer than 4, because we may need
+ someday to extend the object's state without breaking
+ backward-compatibility. */
+ if (!PyTuple_Check(state) || Py_SIZE(state) < 4) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.__setstate__ argument should be 4-tuple, got %.200s",
+ Py_TYPE(self)->tp_name, Py_TYPE(state)->tp_name);
+ return NULL;
+ }
+
+ /* Initialize the object's state. */
+ initarg = PyTuple_GetSlice(state, 0, 2);
+ if (initarg == NULL)
+ return NULL;
+ if (stringio_init(self, initarg, NULL) < 0) {
+ Py_DECREF(initarg);
+ return NULL;
+ }
+ Py_DECREF(initarg);
+
+ /* Restore the buffer state. Even if __init__ did initialize the buffer,
+ we have to initialize it again since __init__ may translates the
+ newlines in the inital_value string. We clearly do not want that
+ because the string value in the state tuple has already been translated
+ once by __init__. So we do not take any chance and replace object's
+ buffer completely. */
+ {
+ Py_UNICODE *buf = PyUnicode_AS_UNICODE(PyTuple_GET_ITEM(state, 0));
+ Py_ssize_t bufsize = PyUnicode_GET_SIZE(PyTuple_GET_ITEM(state, 0));
+ if (resize_buffer(self, bufsize) < 0)
+ return NULL;
+ memcpy(self->buf, buf, bufsize * sizeof(Py_UNICODE));
+ self->string_size = bufsize;
+ }
+
+ /* Set carefully the position value. Alternatively, we could use the seek
+ method instead of modifying self->pos directly to better protect the
+ object internal state against errneous (or malicious) inputs. */
+ position_obj = PyTuple_GET_ITEM(state, 2);
+ if (!PyLong_Check(position_obj)) {
+ PyErr_Format(PyExc_TypeError,
+ "third item of state must be an integer, got %.200s",
+ Py_TYPE(position_obj)->tp_name);
+ return NULL;
+ }
+ pos = PyLong_AsSsize_t(position_obj);
+ if (pos == -1 && PyErr_Occurred())
+ return NULL;
+ if (pos < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "position value cannot be negative");
+ return NULL;
+ }
+ self->pos = pos;
+
+ /* Set the dictionary of the instance variables. */
+ dict = PyTuple_GET_ITEM(state, 3);
+ if (dict != Py_None) {
+ if (!PyDict_Check(dict)) {
+ PyErr_Format(PyExc_TypeError,
+ "fourth item of state should be a dict, got a %.200s",
+ Py_TYPE(dict)->tp_name);
+ return NULL;
+ }
+ if (self->dict) {
+ /* Alternatively, we could replace the internal dictionary
+ completely. However, it seems more practical to just update it. */
+ if (PyDict_Update(self->dict, dict) < 0)
+ return NULL;
+ }
+ else {
+ Py_INCREF(dict);
+ self->dict = dict;
+ }
+ }
+
+ Py_RETURN_NONE;
+}
+
+
static PyObject *
stringio_closed(stringio *self, void *context)
{
@@ -705,10 +834,13 @@ static struct PyMethodDef stringio_methods[] = {
{"truncate", (PyCFunction)stringio_truncate, METH_VARARGS, stringio_truncate_doc},
{"seek", (PyCFunction)stringio_seek, METH_VARARGS, stringio_seek_doc},
{"write", (PyCFunction)stringio_write, METH_O, stringio_write_doc},
-
+
{"seekable", (PyCFunction)stringio_seekable, METH_NOARGS},
{"readable", (PyCFunction)stringio_readable, METH_NOARGS},
{"writable", (PyCFunction)stringio_writable, METH_NOARGS},
+
+ {"__getstate__", (PyCFunction)stringio_getstate, METH_NOARGS},
+ {"__setstate__", (PyCFunction)stringio_setstate, METH_O},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index b039c2f6a3..73d83a1c0b 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -658,6 +658,7 @@ typedef struct
char writetranslate;
char seekable;
char telling;
+ char deallocating;
/* Specialized encoding func (see below) */
encodefunc_t encodefunc;
/* Whether or not it's the start of the stream */
@@ -905,8 +906,11 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
Py_CLEAR(self->encoding);
}
}
- if (self->encoding != NULL)
+ if (self->encoding != NULL) {
encoding = _PyUnicode_AsString(self->encoding);
+ if (encoding == NULL)
+ goto error;
+ }
else if (encoding != NULL) {
self->encoding = PyUnicode_FromString(encoding);
if (self->encoding == NULL)
@@ -935,6 +939,8 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
self->writetranslate = (newline == NULL || newline[0] != '\0');
if (!self->readuniversal && self->readnl) {
self->writenl = _PyUnicode_AsString(self->readnl);
+ if (self->writenl == NULL)
+ goto error;
if (!strcmp(self->writenl, "\n"))
self->writenl = NULL;
}
@@ -1089,6 +1095,7 @@ _textiowrapper_clear(textio *self)
static void
textiowrapper_dealloc(textio *self)
{
+ self->deallocating = 1;
if (_textiowrapper_clear(self) < 0)
return;
_PyObject_GC_UNTRACK(self);
@@ -1254,10 +1261,8 @@ textiowrapper_write(textio *self, PyObject *args)
CHECK_CLOSED(self);
- if (self->encoder == NULL) {
- PyErr_SetString(PyExc_IOError, "not writable");
- return NULL;
- }
+ if (self->encoder == NULL)
+ return _unsupported("not writable");
Py_INCREF(text);
@@ -1394,7 +1399,7 @@ textiowrapper_read_chunk(textio *self)
*/
if (self->decoder == NULL) {
- PyErr_SetString(PyExc_IOError, "not readable");
+ _unsupported("not readable");
return -1;
}
@@ -1484,10 +1489,8 @@ textiowrapper_read(textio *self, PyObject *args)
CHECK_CLOSED(self);
- if (self->decoder == NULL) {
- PyErr_SetString(PyExc_IOError, "not readable");
- return NULL;
- }
+ if (self->decoder == NULL)
+ return _unsupported("not readable");
if (_textiowrapper_writeflush(self) < 0)
return NULL;
@@ -1978,8 +1981,7 @@ textiowrapper_seek(textio *self, PyObject *args)
Py_INCREF(cookieObj);
if (!self->seekable) {
- PyErr_SetString(PyExc_IOError,
- "underlying stream is not seekable");
+ _unsupported("underlying stream is not seekable");
goto fail;
}
@@ -1990,8 +1992,7 @@ textiowrapper_seek(textio *self, PyObject *args)
goto fail;
if (cmp == 0) {
- PyErr_SetString(PyExc_IOError,
- "can't do nonzero cur-relative seeks");
+ _unsupported("can't do nonzero cur-relative seeks");
goto fail;
}
@@ -2011,8 +2012,7 @@ textiowrapper_seek(textio *self, PyObject *args)
goto fail;
if (cmp == 0) {
- PyErr_SetString(PyExc_IOError,
- "can't do nonzero end-relative seeks");
+ _unsupported("can't do nonzero end-relative seeks");
goto fail;
}
@@ -2146,8 +2146,7 @@ textiowrapper_tell(textio *self, PyObject *args)
CHECK_CLOSED(self);
if (!self->seekable) {
- PyErr_SetString(PyExc_IOError,
- "underlying stream is not seekable");
+ _unsupported("underlying stream is not seekable");
goto fail;
}
if (!self->telling) {
@@ -2324,25 +2323,52 @@ textiowrapper_truncate(textio *self, PyObject *args)
static PyObject *
textiowrapper_repr(textio *self)
{
- PyObject *nameobj, *res;
+ PyObject *nameobj, *modeobj, *res, *s;
CHECK_INITIALIZED(self);
+ res = PyUnicode_FromString("<_io.TextIOWrapper");
+ if (res == NULL)
+ return NULL;
nameobj = PyObject_GetAttrString((PyObject *) self, "name");
if (nameobj == NULL) {
if (PyErr_ExceptionMatches(PyExc_AttributeError))
PyErr_Clear();
else
- return NULL;
- res = PyUnicode_FromFormat("<_io.TextIOWrapper encoding=%R>",
- self->encoding);
+ goto error;
}
else {
- res = PyUnicode_FromFormat("<_io.TextIOWrapper name=%R encoding=%R>",
- nameobj, self->encoding);
+ s = PyUnicode_FromFormat(" name=%R", nameobj);
Py_DECREF(nameobj);
+ if (s == NULL)
+ goto error;
+ PyUnicode_AppendAndDel(&res, s);
+ if (res == NULL)
+ return NULL;
}
- return res;
+ modeobj = PyObject_GetAttrString((PyObject *) self, "mode");
+ if (modeobj == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_AttributeError))
+ PyErr_Clear();
+ else
+ goto error;
+ }
+ else {
+ s = PyUnicode_FromFormat(" mode=%R", modeobj);
+ Py_DECREF(modeobj);
+ if (s == NULL)
+ goto error;
+ PyUnicode_AppendAndDel(&res, s);
+ if (res == NULL)
+ return NULL;
+ }
+ s = PyUnicode_FromFormat("%U encoding=%R>",
+ res, self->encoding);
+ Py_DECREF(res);
+ return s;
+error:
+ Py_XDECREF(res);
+ return NULL;
}
@@ -2384,6 +2410,14 @@ textiowrapper_isatty(textio *self, PyObject *args)
}
static PyObject *
+textiowrapper_getstate(textio *self, PyObject *args)
+{
+ PyErr_Format(PyExc_TypeError,
+ "cannot serialize '%s' object", Py_TYPE(self)->tp_name);
+ return NULL;
+}
+
+static PyObject *
textiowrapper_flush(textio *self, PyObject *args)
{
CHECK_INITIALIZED(self);
@@ -2408,11 +2442,18 @@ textiowrapper_close(textio *self, PyObject *args)
Py_DECREF(res);
if (r < 0)
return NULL;
-
+
if (r > 0) {
Py_RETURN_NONE; /* stream already closed */
}
else {
+ if (self->deallocating) {
+ res = PyObject_CallMethod(self->buffer, "_dealloc_warn", "O", self);
+ if (res)
+ Py_DECREF(res);
+ else
+ PyErr_Clear();
+ }
res = PyObject_CallMethod((PyObject *)self, "flush", NULL);
if (res == NULL) {
return NULL;
@@ -2540,6 +2581,7 @@ static PyMethodDef textiowrapper_methods[] = {
{"readable", (PyCFunction)textiowrapper_readable, METH_NOARGS},
{"writable", (PyCFunction)textiowrapper_writable, METH_NOARGS},
{"isatty", (PyCFunction)textiowrapper_isatty, METH_NOARGS},
+ {"__getstate__", (PyCFunction)textiowrapper_getstate, METH_NOARGS},
{"seek", (PyCFunction)textiowrapper_seek, METH_VARARGS},
{"tell", (PyCFunction)textiowrapper_tell, METH_NOARGS},
diff --git a/Modules/_json.c b/Modules/_json.c
index 4da5e74dc2..75b14ee827 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -36,6 +36,7 @@ typedef struct _PyScannerObject {
PyObject *parse_float;
PyObject *parse_int;
PyObject *parse_constant;
+ PyObject *memo;
} PyScannerObject;
static PyMemberDef scanner_members[] = {
@@ -305,6 +306,21 @@ _build_rval_index_tuple(PyObject *rval, Py_ssize_t idx) {
return tpl;
}
+#define APPEND_OLD_CHUNK \
+ if (chunk != NULL) { \
+ if (chunks == NULL) { \
+ chunks = PyList_New(0); \
+ if (chunks == NULL) { \
+ goto bail; \
+ } \
+ } \
+ if (PyList_Append(chunks, chunk)) { \
+ Py_DECREF(chunk); \
+ goto bail; \
+ } \
+ Py_CLEAR(chunk); \
+ }
+
static PyObject *
scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next_end_ptr)
{
@@ -316,15 +332,14 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
Return value is a new PyUnicode
*/
- PyObject *rval;
+ PyObject *rval = NULL;
Py_ssize_t len = PyUnicode_GET_SIZE(pystr);
Py_ssize_t begin = end - 1;
Py_ssize_t next = begin;
const Py_UNICODE *buf = PyUnicode_AS_UNICODE(pystr);
- PyObject *chunks = PyList_New(0);
- if (chunks == NULL) {
- goto bail;
- }
+ PyObject *chunks = NULL;
+ PyObject *chunk = NULL;
+
if (end < 0 || len <= end) {
PyErr_SetString(PyExc_ValueError, "end is out of bounds");
goto bail;
@@ -332,7 +347,6 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
while (1) {
/* Find the end of the string or the next escape */
Py_UNICODE c = 0;
- PyObject *chunk = NULL;
for (next = end; next < len; next++) {
c = buf[next];
if (c == '"' || c == '\\') {
@@ -349,15 +363,11 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
}
/* Pick up this chunk if it's not zero length */
if (next != end) {
+ APPEND_OLD_CHUNK
chunk = PyUnicode_FromUnicode(&buf[end], next - end);
if (chunk == NULL) {
goto bail;
}
- if (PyList_Append(chunks, chunk)) {
- Py_DECREF(chunk);
- goto bail;
- }
- Py_DECREF(chunk);
}
next++;
if (c == '"') {
@@ -459,27 +469,34 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
}
#endif
}
+ APPEND_OLD_CHUNK
chunk = PyUnicode_FromUnicode(&c, 1);
if (chunk == NULL) {
goto bail;
}
- if (PyList_Append(chunks, chunk)) {
- Py_DECREF(chunk);
+ }
+
+ if (chunks == NULL) {
+ if (chunk != NULL)
+ rval = chunk;
+ else
+ rval = PyUnicode_FromStringAndSize("", 0);
+ }
+ else {
+ APPEND_OLD_CHUNK
+ rval = join_list_unicode(chunks);
+ if (rval == NULL) {
goto bail;
}
- Py_DECREF(chunk);
+ Py_CLEAR(chunks);
}
- rval = join_list_unicode(chunks);
- if (rval == NULL) {
- goto bail;
- }
- Py_DECREF(chunks);
*next_end_ptr = end;
return rval;
bail:
*next_end_ptr = -1;
Py_XDECREF(chunks);
+ Py_XDECREF(chunk);
return NULL;
}
@@ -578,6 +595,7 @@ scanner_clear(PyObject *self)
Py_CLEAR(s->parse_float);
Py_CLEAR(s->parse_int);
Py_CLEAR(s->parse_constant);
+ Py_CLEAR(s->memo);
return 0;
}
@@ -593,10 +611,16 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr);
Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1;
PyObject *val = NULL;
- PyObject *rval = PyList_New(0);
+ PyObject *rval = NULL;
PyObject *key = NULL;
int strict = PyObject_IsTrue(s->strict);
+ int has_pairs_hook = (s->object_pairs_hook != Py_None);
Py_ssize_t next_idx;
+
+ if (has_pairs_hook)
+ rval = PyList_New(0);
+ else
+ rval = PyDict_New();
if (rval == NULL)
return NULL;
@@ -606,6 +630,8 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
/* only loop if the object is non-empty */
if (idx <= end_idx && str[idx] != '}') {
while (idx <= end_idx) {
+ PyObject *memokey;
+
/* read key */
if (str[idx] != '"') {
raise_errmsg("Expecting property name", pystr, idx);
@@ -614,6 +640,16 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
key = scanstring_unicode(pystr, idx + 1, strict, &next_idx);
if (key == NULL)
goto bail;
+ memokey = PyDict_GetItem(s->memo, key);
+ if (memokey != NULL) {
+ Py_INCREF(memokey);
+ Py_DECREF(key);
+ key = memokey;
+ }
+ else {
+ if (PyDict_SetItem(s->memo, key, key) < 0)
+ goto bail;
+ }
idx = next_idx;
/* skip whitespace between key and : delimiter, read :, skip whitespace */
@@ -630,19 +666,24 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
if (val == NULL)
goto bail;
- {
- PyObject *tuple = PyTuple_Pack(2, key, val);
- if (tuple == NULL)
+ if (has_pairs_hook) {
+ PyObject *item = PyTuple_Pack(2, key, val);
+ if (item == NULL)
goto bail;
- if (PyList_Append(rval, tuple) == -1) {
- Py_DECREF(tuple);
+ Py_CLEAR(key);
+ Py_CLEAR(val);
+ if (PyList_Append(rval, item) == -1) {
+ Py_DECREF(item);
goto bail;
}
- Py_DECREF(tuple);
+ Py_DECREF(item);
+ }
+ else {
+ if (PyDict_SetItem(rval, key, val) < 0)
+ goto bail;
+ Py_CLEAR(key);
+ Py_CLEAR(val);
}
-
- Py_CLEAR(key);
- Py_CLEAR(val);
idx = next_idx;
/* skip whitespace before } or , */
@@ -672,36 +713,23 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
*next_idx_ptr = idx + 1;
- if (s->object_pairs_hook != Py_None) {
+ if (has_pairs_hook) {
val = PyObject_CallFunctionObjArgs(s->object_pairs_hook, rval, NULL);
- if (val == NULL)
- goto bail;
Py_DECREF(rval);
return val;
}
- val = PyDict_New();
- if (val == NULL)
- goto bail;
- if (PyDict_MergeFromSeq2(val, rval, 1) == -1)
- goto bail;
- Py_DECREF(rval);
- rval = val;
-
/* if object_hook is not None: rval = object_hook(rval) */
if (s->object_hook != Py_None) {
val = PyObject_CallFunctionObjArgs(s->object_hook, rval, NULL);
- if (val == NULL)
- goto bail;
Py_DECREF(rval);
- rval = val;
- val = NULL;
+ return val;
}
return rval;
bail:
Py_XDECREF(key);
Py_XDECREF(val);
- Py_DECREF(rval);
+ Py_XDECREF(rval);
return NULL;
}
@@ -988,6 +1016,9 @@ scanner_call(PyObject *self, PyObject *args, PyObject *kwds)
Py_TYPE(pystr)->tp_name);
return NULL;
}
+ PyDict_Clear(s->memo);
+ if (rval == NULL)
+ return NULL;
return _build_rval_index_tuple(rval, next_idx);
}
@@ -1021,6 +1052,12 @@ scanner_init(PyObject *self, PyObject *args, PyObject *kwds)
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:make_scanner", kwlist, &ctx))
return -1;
+ if (s->memo == NULL) {
+ s->memo = PyDict_New();
+ if (s->memo == NULL)
+ goto bail;
+ }
+
/* All of these will fail "gracefully" so we don't need to verify them */
s->strict = PyObject_GetAttrString(ctx, "strict");
if (s->strict == NULL)
@@ -1350,8 +1387,6 @@ encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ss
PyObject *item = NULL;
int skipkeys;
Py_ssize_t idx;
- PyObject *mapping;
- static PyObject *code = NULL;
if (open_dict == NULL || close_dict == NULL || empty_dict == NULL) {
open_dict = PyUnicode_InternFromString("{");
@@ -1393,30 +1428,37 @@ encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ss
}
if (PyObject_IsTrue(s->sort_keys)) {
- if (code == NULL) {
- code = Py_CompileString("sorted(d.items(), key=lambda kv: kv[0])",
- "_json.c", Py_eval_input);
- if (code == NULL)
- goto bail;
- }
-
- mapping = PyDict_New();
- if (mapping == NULL)
+ /* First sort the keys then replace them with (key, value) tuples. */
+ Py_ssize_t i, nitems;
+ items = PyMapping_Keys(dct);
+ if (items == NULL)
goto bail;
- if (PyDict_SetItemString(mapping, "d", dct) == -1) {
- Py_DECREF(mapping);
+ if (!PyList_Check(items)) {
+ PyErr_SetString(PyExc_ValueError, "keys must return list");
goto bail;
}
- items = PyEval_EvalCode((PyCodeObject *)code, PyEval_GetGlobals(), mapping);
- Py_DECREF(mapping);
- } else {
- items = PyMapping_Items(dct);
+ if (PyList_Sort(items) < 0)
+ goto bail;
+ nitems = PyList_GET_SIZE(items);
+ for (i = 0; i < nitems; i++) {
+ PyObject *key, *value;
+ key = PyList_GET_ITEM(items, i);
+ value = PyDict_GetItem(dct, key);
+ item = PyTuple_Pack(2, key, value);
+ if (item == NULL)
+ goto bail;
+ PyList_SET_ITEM(items, i, item);
+ Py_DECREF(key);
}
- if (items == NULL)
+ }
+ else {
+ items = PyMapping_Items(dct);
+ }
+ if (items == NULL)
goto bail;
it = PyObject_GetIter(items);
- Py_DECREF(items);
- if (it == NULL)
+ Py_DECREF(items);
+ if (it == NULL)
goto bail;
skipkeys = PyObject_IsTrue(s->skipkeys);
idx = 0;
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index 84e393e173..1001dd22b7 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -242,29 +242,16 @@ PyLocale_strcoll(PyObject* self, PyObject* args)
{
PyObject *os1, *os2, *result = NULL;
wchar_t *ws1 = NULL, *ws2 = NULL;
- Py_ssize_t len1, len2;
if (!PyArg_ParseTuple(args, "UU:strcoll", &os1, &os2))
return NULL;
/* Convert the unicode strings to wchar[]. */
- len1 = PyUnicode_GET_SIZE(os1) + 1;
- ws1 = PyMem_MALLOC(len1 * sizeof(wchar_t));
- if (!ws1) {
- PyErr_NoMemory();
- goto done;
- }
- if (PyUnicode_AsWideChar((PyUnicodeObject*)os1, ws1, len1) == -1)
- goto done;
- ws1[len1 - 1] = 0;
- len2 = PyUnicode_GET_SIZE(os2) + 1;
- ws2 = PyMem_MALLOC(len2 * sizeof(wchar_t));
- if (!ws2) {
- PyErr_NoMemory();
+ ws1 = PyUnicode_AsWideCharString(os1, NULL);
+ if (ws1 == NULL)
goto done;
- }
- if (PyUnicode_AsWideChar((PyUnicodeObject*)os2, ws2, len2) == -1)
+ ws2 = PyUnicode_AsWideCharString(os2, NULL);
+ if (ws2 == NULL)
goto done;
- ws2[len2 - 1] = 0;
/* Collate the strings. */
result = PyLong_FromLong(wcscoll(ws1, ws2));
done:
@@ -289,15 +276,15 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
wchar_t *s, *buf = NULL;
size_t n1, n2;
PyObject *result = NULL;
-#ifndef HAVE_USABLE_WCHAR_T
+#if Py_UNICODE_SIZE != SIZEOF_WCHAR_T
Py_ssize_t i;
#endif
if (!PyArg_ParseTuple(args, "u#:strxfrm", &s0, &n0))
return NULL;
-#ifdef HAVE_USABLE_WCHAR_T
- s = s0;
+#if Py_UNICODE_SIZE == SIZEOF_WCHAR_T
+ s = (wchar_t *) s0;
#else
s = PyMem_Malloc((n0+1)*sizeof(wchar_t));
if (!s)
@@ -326,7 +313,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
result = PyUnicode_FromWideChar(buf, n2);
exit:
if (buf) PyMem_Free(buf);
-#ifndef HAVE_USABLE_WCHAR_T
+#if Py_UNICODE_SIZE != SIZEOF_WCHAR_T
PyMem_Free(s);
#endif
return result;
@@ -572,19 +559,31 @@ PyDoc_STRVAR(bindtextdomain__doc__,
static PyObject*
PyIntl_bindtextdomain(PyObject* self,PyObject*args)
{
- char *domain, *dirname;
- if (!PyArg_ParseTuple(args, "sz", &domain, &dirname))
+ char *domain, *dirname, *current_dirname;
+ PyObject *dirname_obj, *dirname_bytes = NULL, *result;
+ if (!PyArg_ParseTuple(args, "sO", &domain, &dirname_obj))
return 0;
if (!strlen(domain)) {
PyErr_SetString(Error, "domain must be a non-empty string");
return 0;
}
- dirname = bindtextdomain(domain, dirname);
- if (!dirname) {
+ if (dirname_obj != Py_None) {
+ if (!PyUnicode_FSConverter(dirname_obj, &dirname_bytes))
+ return NULL;
+ dirname = PyBytes_AsString(dirname_bytes);
+ } else {
+ dirname_bytes = NULL;
+ dirname = NULL;
+ }
+ current_dirname = bindtextdomain(domain, dirname);
+ if (current_dirname == NULL) {
+ Py_XDECREF(dirname_bytes);
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
- return str2uni(dirname);
+ result = str2uni(current_dirname);
+ Py_XDECREF(dirname_bytes);
+ return result;
}
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 1fd660badf..cc412bfc23 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -1,7 +1,5 @@
#include "Python.h"
-#include "compile.h"
#include "frameobject.h"
-#include "structseq.h"
#include "rotatingtree.h"
#if !defined(HAVE_LONG_LONG)
@@ -180,7 +178,16 @@ normalizeUserObj(PyObject *obj)
PyObject *mod = fn->m_module;
const char *modname;
if (mod && PyUnicode_Check(mod)) {
+ /* XXX: The following will truncate module names with embedded
+ * null-characters. It is unlikely that this can happen in
+ * practice and the concequences are not serious enough to
+ * introduce extra checks here.
+ */
modname = _PyUnicode_AsString(mod);
+ if (modname == NULL) {
+ modname = "<encoding error>";
+ PyErr_Clear();
+ }
}
else if (mod && PyModule_Check(mod)) {
modname = PyModule_GetName(mod);
diff --git a/Modules/_math.c b/Modules/_math.c
new file mode 100644
index 0000000000..2fef48107f
--- /dev/null
+++ b/Modules/_math.c
@@ -0,0 +1,232 @@
+/* Definitions of some C99 math library functions, for those platforms
+ that don't implement these functions already. */
+
+#include "Python.h"
+#include <float.h>
+#include "_math.h"
+
+/* The following copyright notice applies to the original
+ implementations of acosh, asinh and atanh. */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+static const double ln2 = 6.93147180559945286227E-01;
+static const double two_pow_m28 = 3.7252902984619141E-09; /* 2**-28 */
+static const double two_pow_p28 = 268435456.0; /* 2**28 */
+static const double zero = 0.0;
+
+/* acosh(x)
+ * Method :
+ * Based on
+ * acosh(x) = log [ x + sqrt(x*x-1) ]
+ * we have
+ * acosh(x) := log(x)+ln2, if x is large; else
+ * acosh(x) := log(2x-1/(sqrt(x*x-1)+x)) if x>2; else
+ * acosh(x) := log1p(t+sqrt(2.0*t+t*t)); where t=x-1.
+ *
+ * Special cases:
+ * acosh(x) is NaN with signal if x<1.
+ * acosh(NaN) is NaN without signal.
+ */
+
+double
+_Py_acosh(double x)
+{
+ if (Py_IS_NAN(x)) {
+ return x+x;
+ }
+ if (x < 1.) { /* x < 1; return a signaling NaN */
+ errno = EDOM;
+#ifdef Py_NAN
+ return Py_NAN;
+#else
+ return (x-x)/(x-x);
+#endif
+ }
+ else if (x >= two_pow_p28) { /* x > 2**28 */
+ if (Py_IS_INFINITY(x)) {
+ return x+x;
+ }
+ else {
+ return log(x)+ln2; /* acosh(huge)=log(2x) */
+ }
+ }
+ else if (x == 1.) {
+ return 0.0; /* acosh(1) = 0 */
+ }
+ else if (x > 2.) { /* 2 < x < 2**28 */
+ double t = x*x;
+ return log(2.0*x - 1.0 / (x + sqrt(t - 1.0)));
+ }
+ else { /* 1 < x <= 2 */
+ double t = x - 1.0;
+ return m_log1p(t + sqrt(2.0*t + t*t));
+ }
+}
+
+
+/* asinh(x)
+ * Method :
+ * Based on
+ * asinh(x) = sign(x) * log [ |x| + sqrt(x*x+1) ]
+ * we have
+ * asinh(x) := x if 1+x*x=1,
+ * := sign(x)*(log(x)+ln2)) for large |x|, else
+ * := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else
+ * := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2)))
+ */
+
+double
+_Py_asinh(double x)
+{
+ double w;
+ double absx = fabs(x);
+
+ if (Py_IS_NAN(x) || Py_IS_INFINITY(x)) {
+ return x+x;
+ }
+ if (absx < two_pow_m28) { /* |x| < 2**-28 */
+ return x; /* return x inexact except 0 */
+ }
+ if (absx > two_pow_p28) { /* |x| > 2**28 */
+ w = log(absx)+ln2;
+ }
+ else if (absx > 2.0) { /* 2 < |x| < 2**28 */
+ w = log(2.0*absx + 1.0 / (sqrt(x*x + 1.0) + absx));
+ }
+ else { /* 2**-28 <= |x| < 2= */
+ double t = x*x;
+ w = m_log1p(absx + t / (1.0 + sqrt(1.0 + t)));
+ }
+ return copysign(w, x);
+
+}
+
+/* atanh(x)
+ * Method :
+ * 1.Reduced x to positive by atanh(-x) = -atanh(x)
+ * 2.For x>=0.5
+ * 1 2x x
+ * atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * -------)
+ * 2 1 - x 1 - x
+ *
+ * For x<0.5
+ * atanh(x) = 0.5*log1p(2x+2x*x/(1-x))
+ *
+ * Special cases:
+ * atanh(x) is NaN if |x| >= 1 with signal;
+ * atanh(NaN) is that NaN with no signal;
+ *
+ */
+
+double
+_Py_atanh(double x)
+{
+ double absx;
+ double t;
+
+ if (Py_IS_NAN(x)) {
+ return x+x;
+ }
+ absx = fabs(x);
+ if (absx >= 1.) { /* |x| >= 1 */
+ errno = EDOM;
+#ifdef Py_NAN
+ return Py_NAN;
+#else
+ return x/zero;
+#endif
+ }
+ if (absx < two_pow_m28) { /* |x| < 2**-28 */
+ return x;
+ }
+ if (absx < 0.5) { /* |x| < 0.5 */
+ t = absx+absx;
+ t = 0.5 * m_log1p(t + t*absx / (1.0 - absx));
+ }
+ else { /* 0.5 <= |x| <= 1.0 */
+ t = 0.5 * m_log1p((absx + absx) / (1.0 - absx));
+ }
+ return copysign(t, x);
+}
+
+/* Mathematically, expm1(x) = exp(x) - 1. The expm1 function is designed
+ to avoid the significant loss of precision that arises from direct
+ evaluation of the expression exp(x) - 1, for x near 0. */
+
+double
+_Py_expm1(double x)
+{
+ /* For abs(x) >= log(2), it's safe to evaluate exp(x) - 1 directly; this
+ also works fine for infinities and nans.
+
+ For smaller x, we can use a method due to Kahan that achieves close to
+ full accuracy.
+ */
+
+ if (fabs(x) < 0.7) {
+ double u;
+ u = exp(x);
+ if (u == 1.0)
+ return x;
+ else
+ return (u - 1.0) * x / log(u);
+ }
+ else
+ return exp(x) - 1.0;
+}
+
+/* log1p(x) = log(1+x). The log1p function is designed to avoid the
+ significant loss of precision that arises from direct evaluation when x is
+ small. */
+
+double
+_Py_log1p(double x)
+{
+ /* For x small, we use the following approach. Let y be the nearest float
+ to 1+x, then
+
+ 1+x = y * (1 - (y-1-x)/y)
+
+ so log(1+x) = log(y) + log(1-(y-1-x)/y). Since (y-1-x)/y is tiny, the
+ second term is well approximated by (y-1-x)/y. If abs(x) >=
+ DBL_EPSILON/2 or the rounding-mode is some form of round-to-nearest
+ then y-1-x will be exactly representable, and is computed exactly by
+ (y-1)-x.
+
+ If abs(x) < DBL_EPSILON/2 and the rounding mode is not known to be
+ round-to-nearest then this method is slightly dangerous: 1+x could be
+ rounded up to 1+DBL_EPSILON instead of down to 1, and in that case
+ y-1-x will not be exactly representable any more and the result can be
+ off by many ulps. But this is easily fixed: for a floating-point
+ number |x| < DBL_EPSILON/2., the closest floating-point number to
+ log(1+x) is exactly x.
+ */
+
+ double y;
+ if (fabs(x) < DBL_EPSILON/2.) {
+ return x;
+ }
+ else if (-0.5 <= x && x <= 1.) {
+ /* WARNING: it's possible than an overeager compiler
+ will incorrectly optimize the following two lines
+ to the equivalent of "return log(1.+x)". If this
+ happens, then results from log1p will be inaccurate
+ for small x. */
+ y = 1.+x;
+ return log(y)-((y-1.)-x)/y;
+ }
+ else {
+ /* NaNs and infinities should end up here */
+ return log(1.+x);
+ }
+}
diff --git a/Modules/_math.h b/Modules/_math.h
new file mode 100644
index 0000000000..c0ceece662
--- /dev/null
+++ b/Modules/_math.h
@@ -0,0 +1,45 @@
+double _Py_acosh(double x);
+double _Py_asinh(double x);
+double _Py_atanh(double x);
+double _Py_expm1(double x);
+double _Py_log1p(double x);
+
+#ifdef HAVE_ACOSH
+#define m_acosh acosh
+#else
+/* if the system doesn't have acosh, use the substitute
+ function defined in Modules/_math.c. */
+#define m_acosh _Py_acosh
+#endif
+
+#ifdef HAVE_ASINH
+#define m_asinh asinh
+#else
+/* if the system doesn't have asinh, use the substitute
+ function defined in Modules/_math.c. */
+#define m_asinh _Py_asinh
+#endif
+
+#ifdef HAVE_ATANH
+#define m_atanh atanh
+#else
+/* if the system doesn't have atanh, use the substitute
+ function defined in Modules/_math.c. */
+#define m_atanh _Py_atanh
+#endif
+
+#ifdef HAVE_EXPM1
+#define m_expm1 expm1
+#else
+/* if the system doesn't have expm1, use the substitute
+ function defined in Modules/_math.c. */
+#define m_expm1 _Py_expm1
+#endif
+
+#ifdef HAVE_LOG1P
+#define m_log1p log1p
+#else
+/* if the system doesn't have log1p, use the substitute
+ function defined in Modules/_math.c. */
+#define m_log1p _Py_log1p
+#endif
diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h
index c1496343c3..14425de821 100644
--- a/Modules/_multiprocessing/multiprocessing.h
+++ b/Modules/_multiprocessing/multiprocessing.h
@@ -3,6 +3,12 @@
#define PY_SSIZE_T_CLEAN
+#ifdef __sun
+/* The control message API is only available on Solaris
+ if XPG 4.2 or later is requested. */
+#define _XOPEN_SOURCE 500
+#endif
+
#include "Python.h"
#include "structmember.h"
#include "pythread.h"
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 5102e2491d..e13d8742ca 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -10,7 +10,6 @@ enum {
DEFAULT_PROTOCOL = 3
};
-
/* Pickle opcodes. These must be kept updated with pickle.py.
Extensive docs are in pickletools.py. */
enum opcode {
@@ -72,7 +71,7 @@ enum opcode {
/* Protocol 3 (Python 3.x) */
BINBYTES = 'B',
- SHORT_BINBYTES = 'C',
+ SHORT_BINBYTES = 'C'
};
/* These aren't opcodes -- they're ways to pickle bools before protocol 2
@@ -96,9 +95,15 @@ enum {
checking for self-referential data-structures. */
FAST_NESTING_LIMIT = 50,
- /* Size of the write buffer of Pickler. Higher values will reduce the
- number of calls to the write() method of the output stream. */
- WRITE_BUF_SIZE = 256,
+ /* Initial size of the write buffer of Pickler. */
+ WRITE_BUF_SIZE = 4096,
+
+ /* Maximum size of the write buffer of Pickler when pickling to a
+ stream. This is ignored for in-memory pickling. */
+ MAX_WRITE_BUF_SIZE = 64 * 1024,
+
+ /* Prefetch size when unpickling (disabled on unpeekable streams) */
+ PREFETCH = 8192 * 16
};
/* Exception classes for pickle. These should override the ones defined in
@@ -140,23 +145,19 @@ stack_underflow(void)
/* Internal data type used as the unpickling stack. */
typedef struct {
- PyObject_HEAD
- int length; /* number of initial slots in data currently used */
- int size; /* number of slots in data allocated */
+ PyObject_VAR_HEAD
PyObject **data;
+ Py_ssize_t allocated; /* number of slots in data allocated */
} Pdata;
static void
Pdata_dealloc(Pdata *self)
{
- int i;
- PyObject **p;
-
- for (i = self->length, p = self->data; --i >= 0; p++) {
- Py_DECREF(*p);
+ int i = Py_SIZE(self);
+ while (--i >= 0) {
+ Py_DECREF(self->data[i]);
}
- if (self->data)
- PyMem_Free(self->data);
+ PyMem_FREE(self->data);
PyObject_Del(self);
}
@@ -175,9 +176,9 @@ Pdata_New(void)
if (!(self = PyObject_New(Pdata, &Pdata_Type)))
return NULL;
- self->size = 8;
- self->length = 0;
- self->data = PyMem_Malloc(self->size * sizeof(PyObject *));
+ Py_SIZE(self) = 0;
+ self->allocated = 8;
+ self->data = PyMem_MALLOC(self->allocated * sizeof(PyObject *));
if (self->data)
return (PyObject *)self;
Py_DECREF(self);
@@ -191,42 +192,40 @@ Pdata_New(void)
static int
Pdata_clear(Pdata *self, int clearto)
{
- int i;
- PyObject **p;
+ int i = Py_SIZE(self);
if (clearto < 0)
return stack_underflow();
- if (clearto >= self->length)
+ if (clearto >= i)
return 0;
- for (i = self->length, p = self->data + clearto; --i >= clearto; p++) {
- Py_CLEAR(*p);
+ while (--i >= clearto) {
+ Py_CLEAR(self->data[i]);
}
- self->length = clearto;
-
+ Py_SIZE(self) = clearto;
return 0;
}
static int
Pdata_grow(Pdata *self)
{
- int bigger;
- size_t nbytes;
- PyObject **tmp;
+ PyObject **data = self->data;
+ Py_ssize_t allocated = self->allocated;
+ Py_ssize_t new_allocated;
- bigger = (self->size << 1) + 1;
- if (bigger <= 0) /* was 0, or new value overflows */
+ new_allocated = (allocated >> 3) + 6;
+ /* check for integer overflow */
+ if (new_allocated > PY_SSIZE_T_MAX - allocated)
goto nomemory;
- if ((int)(size_t)bigger != bigger)
+ new_allocated += allocated;
+ if (new_allocated > (PY_SSIZE_T_MAX / sizeof(PyObject *)))
goto nomemory;
- nbytes = (size_t)bigger * sizeof(PyObject *);
- if (nbytes / sizeof(PyObject *) != (size_t)bigger)
- goto nomemory;
- tmp = PyMem_Realloc(self->data, nbytes);
- if (tmp == NULL)
+ data = PyMem_REALLOC(data, new_allocated * sizeof(PyObject *));
+ if (data == NULL)
goto nomemory;
- self->data = tmp;
- self->size = bigger;
+
+ self->data = data;
+ self->allocated = new_allocated;
return 0;
nomemory:
@@ -241,21 +240,21 @@ Pdata_grow(Pdata *self)
static PyObject *
Pdata_pop(Pdata *self)
{
- if (self->length == 0) {
+ if (Py_SIZE(self) == 0) {
PyErr_SetString(UnpicklingError, "bad pickle data");
return NULL;
}
- return self->data[--(self->length)];
+ return self->data[--Py_SIZE(self)];
}
#define PDATA_POP(D, V) do { (V) = Pdata_pop((D)); } while (0)
static int
Pdata_push(Pdata *self, PyObject *obj)
{
- if (self->length == self->size && Pdata_grow(self) < 0) {
+ if (Py_SIZE(self) == self->allocated && Pdata_grow(self) < 0) {
return -1;
}
- self->data[self->length++] = obj;
+ self->data[Py_SIZE(self)++] = obj;
return 0;
}
@@ -274,14 +273,14 @@ Pdata_poptuple(Pdata *self, Py_ssize_t start)
PyObject *tuple;
Py_ssize_t len, i, j;
- len = self->length - start;
+ len = Py_SIZE(self) - start;
tuple = PyTuple_New(len);
if (tuple == NULL)
return NULL;
for (i = start, j = 0; j < len; i++, j++)
PyTuple_SET_ITEM(tuple, j, self->data[i]);
- self->length = start;
+ Py_SIZE(self) = start;
return tuple;
}
@@ -291,31 +290,45 @@ Pdata_poplist(Pdata *self, Py_ssize_t start)
PyObject *list;
Py_ssize_t len, i, j;
- len = self->length - start;
+ len = Py_SIZE(self) - start;
list = PyList_New(len);
if (list == NULL)
return NULL;
for (i = start, j = 0; j < len; i++, j++)
PyList_SET_ITEM(list, j, self->data[i]);
- self->length = start;
+ Py_SIZE(self) = start;
return list;
}
+typedef struct {
+ PyObject *me_key;
+ long me_value;
+} PyMemoEntry;
+
+typedef struct {
+ Py_ssize_t mt_mask;
+ Py_ssize_t mt_used;
+ Py_ssize_t mt_allocated;
+ PyMemoEntry *mt_table;
+} PyMemoTable;
+
typedef struct PicklerObject {
PyObject_HEAD
- PyObject *write; /* write() method of the output stream */
- PyObject *memo; /* Memo dictionary, keep track of the seen
+ PyMemoTable *memo; /* Memo table, keep track of the seen
objects to support self-referential objects
- pickling. */
+ pickling. */
PyObject *pers_func; /* persistent_id() method, can be NULL */
PyObject *arg;
+
+ PyObject *write; /* write() method of the output stream. */
+ PyObject *output_buffer; /* Write into a local bytearray buffer before
+ flushing to the stream. */
+ Py_ssize_t output_len; /* Length of output_buffer. */
+ Py_ssize_t max_output_len; /* Allocation size of output_buffer. */
int proto; /* Pickle protocol number, >= 0 */
int bin; /* Boolean, true if proto > 0 */
int buf_size; /* Size of the current buffered pickle data */
- char *write_buf; /* Write buffer, this is to avoid calling the
- write() method of the output stream too
- often. */
int fast; /* Enable fast mode if set to a true value.
The fast mode disable the usage of memo,
therefore speeding the pickling process by
@@ -331,15 +344,25 @@ typedef struct PicklerObject {
typedef struct UnpicklerObject {
PyObject_HEAD
Pdata *stack; /* Pickle data stack, store unpickled objects. */
- PyObject *readline; /* readline() method of the output stream */
- PyObject *read; /* read() method of the output stream */
- PyObject *memo; /* Memo dictionary, provide the objects stored
- using the PUT opcodes. */
+
+ /* The unpickler memo is just an array of PyObject *s. Using a dict
+ is unnecessary, since the keys are contiguous ints. */
+ PyObject **memo;
+ Py_ssize_t memo_size;
+
PyObject *arg;
PyObject *pers_func; /* persistent_load() method, can be NULL. */
- PyObject *last_string; /* Reference to the last string read by the
- readline() method. */
- char *buffer; /* Reading buffer. */
+
+ Py_buffer buffer;
+ char *input_buffer;
+ char *input_line;
+ Py_ssize_t input_len;
+ Py_ssize_t next_read_idx;
+ Py_ssize_t prefetched_idx; /* index of first prefetched byte */
+ PyObject *read; /* read() method of the input stream. */
+ PyObject *readline; /* readline() method of the input stream. */
+ PyObject *peek; /* peek() method of the input stream, or NULL */
+
char *encoding; /* Name of the encoding to be used for
decoding strings pickled using Python
2.x. The default value is "ASCII" */
@@ -362,9 +385,230 @@ static PyTypeObject Pickler_Type;
static PyTypeObject Unpickler_Type;
+/*************************************************************************
+ A custom hashtable mapping void* to longs. This is used by the pickler for
+ memoization. Using a custom hashtable rather than PyDict allows us to skip
+ a bunch of unnecessary object creation. This makes a huge performance
+ difference. */
+
+#define MT_MINSIZE 8
+#define PERTURB_SHIFT 5
+
+
+static PyMemoTable *
+PyMemoTable_New(void)
+{
+ PyMemoTable *memo = PyMem_MALLOC(sizeof(PyMemoTable));
+ if (memo == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ memo->mt_used = 0;
+ memo->mt_allocated = MT_MINSIZE;
+ memo->mt_mask = MT_MINSIZE - 1;
+ memo->mt_table = PyMem_MALLOC(MT_MINSIZE * sizeof(PyMemoEntry));
+ if (memo->mt_table == NULL) {
+ PyMem_FREE(memo);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ memset(memo->mt_table, 0, MT_MINSIZE * sizeof(PyMemoEntry));
+
+ return memo;
+}
+
+static PyMemoTable *
+PyMemoTable_Copy(PyMemoTable *self)
+{
+ Py_ssize_t i;
+ PyMemoTable *new = PyMemoTable_New();
+ if (new == NULL)
+ return NULL;
+
+ new->mt_used = self->mt_used;
+ new->mt_allocated = self->mt_allocated;
+ new->mt_mask = self->mt_mask;
+ /* The table we get from _New() is probably smaller than we wanted.
+ Free it and allocate one that's the right size. */
+ PyMem_FREE(new->mt_table);
+ new->mt_table = PyMem_MALLOC(self->mt_allocated * sizeof(PyMemoEntry));
+ if (new->mt_table == NULL) {
+ PyMem_FREE(new);
+ return NULL;
+ }
+ for (i = 0; i < self->mt_allocated; i++) {
+ Py_XINCREF(self->mt_table[i].me_key);
+ }
+ memcpy(new->mt_table, self->mt_table,
+ sizeof(PyMemoEntry) * self->mt_allocated);
+
+ return new;
+}
+
+static Py_ssize_t
+PyMemoTable_Size(PyMemoTable *self)
+{
+ return self->mt_used;
+}
+
+static int
+PyMemoTable_Clear(PyMemoTable *self)
+{
+ Py_ssize_t i = self->mt_allocated;
+
+ while (--i >= 0) {
+ Py_XDECREF(self->mt_table[i].me_key);
+ }
+ self->mt_used = 0;
+ memset(self->mt_table, 0, self->mt_allocated * sizeof(PyMemoEntry));
+ return 0;
+}
+
+static void
+PyMemoTable_Del(PyMemoTable *self)
+{
+ if (self == NULL)
+ return;
+ PyMemoTable_Clear(self);
+
+ PyMem_FREE(self->mt_table);
+ PyMem_FREE(self);
+}
+
+/* Since entries cannot be deleted from this hashtable, _PyMemoTable_Lookup()
+ can be considerably simpler than dictobject.c's lookdict(). */
+static PyMemoEntry *
+_PyMemoTable_Lookup(PyMemoTable *self, PyObject *key)
+{
+ size_t i;
+ size_t perturb;
+ size_t mask = (size_t)self->mt_mask;
+ PyMemoEntry *table = self->mt_table;
+ PyMemoEntry *entry;
+ Py_hash_t hash = (Py_hash_t)key >> 3;
+
+ i = hash & mask;
+ entry = &table[i];
+ if (entry->me_key == NULL || entry->me_key == key)
+ return entry;
+
+ for (perturb = hash; ; perturb >>= PERTURB_SHIFT) {
+ i = (i << 2) + i + perturb + 1;
+ entry = &table[i & mask];
+ if (entry->me_key == NULL || entry->me_key == key)
+ return entry;
+ }
+ assert(0); /* Never reached */
+ return NULL;
+}
+
+/* Returns -1 on failure, 0 on success. */
+static int
+_PyMemoTable_ResizeTable(PyMemoTable *self, Py_ssize_t min_size)
+{
+ PyMemoEntry *oldtable = NULL;
+ PyMemoEntry *oldentry, *newentry;
+ Py_ssize_t new_size = MT_MINSIZE;
+ Py_ssize_t to_process;
+
+ assert(min_size > 0);
+
+ /* Find the smallest valid table size >= min_size. */
+ while (new_size < min_size && new_size > 0)
+ new_size <<= 1;
+ if (new_size <= 0) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ /* new_size needs to be a power of two. */
+ assert((new_size & (new_size - 1)) == 0);
+
+ /* Allocate new table. */
+ oldtable = self->mt_table;
+ self->mt_table = PyMem_MALLOC(new_size * sizeof(PyMemoEntry));
+ if (self->mt_table == NULL) {
+ PyMem_FREE(oldtable);
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->mt_allocated = new_size;
+ self->mt_mask = new_size - 1;
+ memset(self->mt_table, 0, sizeof(PyMemoEntry) * new_size);
+
+ /* Copy entries from the old table. */
+ to_process = self->mt_used;
+ for (oldentry = oldtable; to_process > 0; oldentry++) {
+ if (oldentry->me_key != NULL) {
+ to_process--;
+ /* newentry is a pointer to a chunk of the new
+ mt_table, so we're setting the key:value pair
+ in-place. */
+ newentry = _PyMemoTable_Lookup(self, oldentry->me_key);
+ newentry->me_key = oldentry->me_key;
+ newentry->me_value = oldentry->me_value;
+ }
+ }
+
+ /* Deallocate the old table. */
+ PyMem_FREE(oldtable);
+ return 0;
+}
+
+/* Returns NULL on failure, a pointer to the value otherwise. */
+static long *
+PyMemoTable_Get(PyMemoTable *self, PyObject *key)
+{
+ PyMemoEntry *entry = _PyMemoTable_Lookup(self, key);
+ if (entry->me_key == NULL)
+ return NULL;
+ return &entry->me_value;
+}
+
+/* Returns -1 on failure, 0 on success. */
+static int
+PyMemoTable_Set(PyMemoTable *self, PyObject *key, long value)
+{
+ PyMemoEntry *entry;
+
+ assert(key != NULL);
+
+ entry = _PyMemoTable_Lookup(self, key);
+ if (entry->me_key != NULL) {
+ entry->me_value = value;
+ return 0;
+ }
+ Py_INCREF(key);
+ entry->me_key = key;
+ entry->me_value = value;
+ self->mt_used++;
+
+ /* If we added a key, we can safely resize. Otherwise just return!
+ * If used >= 2/3 size, adjust size. Normally, this quaduples the size.
+ *
+ * Quadrupling the size improves average table sparseness
+ * (reducing collisions) at the cost of some memory. It also halves
+ * the number of expensive resize operations in a growing memo table.
+ *
+ * Very large memo tables (over 50K items) use doubling instead.
+ * This may help applications with severe memory constraints.
+ */
+ if (!(self->mt_used * 3 >= (self->mt_mask + 1) * 2))
+ return 0;
+ return _PyMemoTable_ResizeTable(self,
+ (self->mt_used > 50000 ? 2 : 4) * self->mt_used);
+}
+
+#undef MT_MINSIZE
+#undef PERTURB_SHIFT
+
+/*************************************************************************/
+
/* Helpers for creating the argument tuple passed to functions. This has the
- performance advantage of calling PyTuple_New() only once. */
+ performance advantage of calling PyTuple_New() only once.
+ XXX(avassalotti): Inline directly in _Pickler_FastCall() and
+ _Unpickler_FastCall(). */
#define ARG_TUP(self, obj) do { \
if ((self)->arg || ((self)->arg=PyTuple_New(1))) { \
Py_XDECREF(PyTuple_GET_ITEM((self)->arg, 0)); \
@@ -401,10 +645,9 @@ static PyTypeObject Unpickler_Type;
XXX: And, what is the reference behavior of these? Steal, borrow? At first
glance, it seems to steal the reference of 'arg' and borrow the reference
- of 'func'.
- */
+ of 'func'. */
static PyObject *
-pickler_call(PicklerObject *self, PyObject *func, PyObject *arg)
+_Pickler_FastCall(PicklerObject *self, PyObject *func, PyObject *arg)
{
PyObject *result = NULL;
@@ -416,8 +659,188 @@ pickler_call(PicklerObject *self, PyObject *func, PyObject *arg)
return result;
}
+static int
+_Pickler_ClearBuffer(PicklerObject *self)
+{
+ Py_CLEAR(self->output_buffer);
+ self->output_buffer =
+ PyBytes_FromStringAndSize(NULL, self->max_output_len);
+ if (self->output_buffer == NULL)
+ return -1;
+ self->output_len = 0;
+ return 0;
+}
+
+static PyObject *
+_Pickler_GetString(PicklerObject *self)
+{
+ PyObject *output_buffer = self->output_buffer;
+
+ assert(self->output_buffer != NULL);
+ self->output_buffer = NULL;
+ /* Resize down to exact size */
+ if (_PyBytes_Resize(&output_buffer, self->output_len) < 0)
+ return NULL;
+ return output_buffer;
+}
+
+static int
+_Pickler_FlushToFile(PicklerObject *self)
+{
+ PyObject *output, *result;
+
+ assert(self->write != NULL);
+
+ output = _Pickler_GetString(self);
+ if (output == NULL)
+ return -1;
+
+ result = _Pickler_FastCall(self, self->write, output);
+ Py_XDECREF(result);
+ return (result == NULL) ? -1 : 0;
+}
+
+static int
+_Pickler_Write(PicklerObject *self, const char *s, Py_ssize_t n)
+{
+ Py_ssize_t i, required;
+ char *buffer;
+
+ assert(s != NULL);
+
+ required = self->output_len + n;
+ if (required > self->max_output_len) {
+ if (self->write != NULL && required > MAX_WRITE_BUF_SIZE) {
+ /* XXX This reallocates a new buffer every time, which is a bit
+ wasteful. */
+ if (_Pickler_FlushToFile(self) < 0)
+ return -1;
+ if (_Pickler_ClearBuffer(self) < 0)
+ return -1;
+ }
+ if (self->write != NULL && n > MAX_WRITE_BUF_SIZE) {
+ /* we already flushed above, so the buffer is empty */
+ PyObject *result;
+ /* XXX we could spare an intermediate copy and pass
+ a memoryview instead */
+ PyObject *output = PyBytes_FromStringAndSize(s, n);
+ if (s == NULL)
+ return -1;
+ result = _Pickler_FastCall(self, self->write, output);
+ Py_XDECREF(result);
+ return (result == NULL) ? -1 : 0;
+ }
+ else {
+ if (self->output_len >= PY_SSIZE_T_MAX / 2 - n) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->max_output_len = (self->output_len + n) * 2;
+ if (_PyBytes_Resize(&self->output_buffer, self->max_output_len) < 0)
+ return -1;
+ }
+ }
+ buffer = PyBytes_AS_STRING(self->output_buffer);
+ if (n < 8) {
+ /* This is faster than memcpy when the string is short. */
+ for (i = 0; i < n; i++) {
+ buffer[self->output_len + i] = s[i];
+ }
+ }
+ else {
+ memcpy(buffer + self->output_len, s, n);
+ }
+ self->output_len += n;
+ return n;
+}
+
+static PicklerObject *
+_Pickler_New(void)
+{
+ PicklerObject *self;
+
+ self = PyObject_GC_New(PicklerObject, &Pickler_Type);
+ if (self == NULL)
+ return NULL;
+
+ self->pers_func = NULL;
+ self->arg = NULL;
+ self->write = NULL;
+ self->proto = 0;
+ self->bin = 0;
+ self->fast = 0;
+ self->fast_nesting = 0;
+ self->fix_imports = 0;
+ self->fast_memo = NULL;
+
+ self->memo = PyMemoTable_New();
+ if (self->memo == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ self->max_output_len = WRITE_BUF_SIZE;
+ self->output_len = 0;
+ self->output_buffer = PyBytes_FromStringAndSize(NULL,
+ self->max_output_len);
+ if (self->output_buffer == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ return self;
+}
+
+static int
+_Pickler_SetProtocol(PicklerObject *self, PyObject *proto_obj,
+ PyObject *fix_imports_obj)
+{
+ long proto = 0;
+ int fix_imports;
+
+ if (proto_obj == NULL || proto_obj == Py_None)
+ proto = DEFAULT_PROTOCOL;
+ else {
+ proto = PyLong_AsLong(proto_obj);
+ if (proto == -1 && PyErr_Occurred())
+ return -1;
+ }
+ if (proto < 0)
+ proto = HIGHEST_PROTOCOL;
+ if (proto > HIGHEST_PROTOCOL) {
+ PyErr_Format(PyExc_ValueError, "pickle protocol must be <= %d",
+ HIGHEST_PROTOCOL);
+ return -1;
+ }
+ fix_imports = PyObject_IsTrue(fix_imports_obj);
+ if (fix_imports == -1)
+ return -1;
+
+ self->proto = proto;
+ self->bin = proto > 0;
+ self->fix_imports = fix_imports && proto < 3;
+
+ return 0;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Pickler. */
+static int
+_Pickler_SetOutputStream(PicklerObject *self, PyObject *file)
+{
+ assert(file != NULL);
+ self->write = PyObject_GetAttrString(file, "write");
+ if (self->write == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_AttributeError))
+ PyErr_SetString(PyExc_TypeError,
+ "file must have a 'write' attribute");
+ return -1;
+ }
+
+ return 0;
+}
+
+/* See documentation for _Pickler_FastCall(). */
static PyObject *
-unpickler_call(UnpicklerObject *self, PyObject *func, PyObject *arg)
+_Unpickler_FastCall(UnpicklerObject *self, PyObject *func, PyObject *arg)
{
PyObject *result = NULL;
@@ -429,168 +852,401 @@ unpickler_call(UnpicklerObject *self, PyObject *func, PyObject *arg)
return result;
}
+/* Returns the size of the input on success, -1 on failure. This takes its
+ own reference to `input`. */
static Py_ssize_t
-pickler_write(PicklerObject *self, const char *s, Py_ssize_t n)
+_Unpickler_SetStringInput(UnpicklerObject *self, PyObject *input)
{
- PyObject *data, *result;
+ if (self->buffer.buf != NULL)
+ PyBuffer_Release(&self->buffer);
+ if (PyObject_GetBuffer(input, &self->buffer, PyBUF_CONTIG_RO) < 0)
+ return -1;
+ self->input_buffer = self->buffer.buf;
+ self->input_len = self->buffer.len;
+ self->next_read_idx = 0;
+ self->prefetched_idx = self->input_len;
+ return self->input_len;
+}
- if (self->write_buf == NULL) {
- PyErr_SetString(PyExc_SystemError, "invalid write buffer");
- return -1;
+static int
+_Unpickler_SkipConsumed(UnpicklerObject *self)
+{
+ Py_ssize_t consumed = self->next_read_idx - self->prefetched_idx;
+
+ if (consumed > 0) {
+ PyObject *r;
+ assert(self->peek); /* otherwise we did something wrong */
+ /* This makes an useless copy... */
+ r = PyObject_CallFunction(self->read, "n", consumed);
+ if (r == NULL)
+ return -1;
+ Py_DECREF(r);
+ self->prefetched_idx = self->next_read_idx;
}
+ return 0;
+}
- if (s == NULL) {
- if (!(self->buf_size))
- return 0;
- data = PyBytes_FromStringAndSize(self->write_buf, self->buf_size);
- if (data == NULL)
+static const Py_ssize_t READ_WHOLE_LINE = -1;
+
+/* If reading from a file, we need to only pull the bytes we need, since there
+ may be multiple pickle objects arranged contiguously in the same input
+ buffer.
+
+ If `n` is READ_WHOLE_LINE, read a whole line. Otherwise, read up to `n`
+ bytes from the input stream/buffer.
+
+ Update the unpickler's input buffer with the newly-read data. Returns -1 on
+ failure; on success, returns the number of bytes read from the file.
+
+ On success, self->input_len will be 0; this is intentional so that when
+ unpickling from a file, the "we've run out of data" code paths will trigger,
+ causing the Unpickler to go back to the file for more data. Use the returned
+ size to tell you how much data you can process. */
+static Py_ssize_t
+_Unpickler_ReadFromFile(UnpicklerObject *self, Py_ssize_t n)
+{
+ PyObject *data;
+ Py_ssize_t read_size, prefetched_size = 0;
+
+ assert(self->read != NULL);
+
+ if (_Unpickler_SkipConsumed(self) < 0)
+ return -1;
+
+ if (n == READ_WHOLE_LINE)
+ data = PyObject_Call(self->readline, empty_tuple, NULL);
+ else {
+ PyObject *len = PyLong_FromSsize_t(n);
+ if (len == NULL)
return -1;
+ data = _Unpickler_FastCall(self, self->read, len);
}
- else {
- if (self->buf_size && (n + self->buf_size) > WRITE_BUF_SIZE) {
- if (pickler_write(self, NULL, 0) < 0)
- return -1;
- }
+ if (data == NULL)
+ return -1;
- if (n > WRITE_BUF_SIZE) {
- if (!(data = PyBytes_FromStringAndSize(s, n)))
+ /* Prefetch some data without advancing the file pointer, if possible */
+ if (self->peek) {
+ PyObject *len, *prefetched;
+ len = PyLong_FromSsize_t(PREFETCH);
+ if (len == NULL) {
+ Py_DECREF(data);
+ return -1;
+ }
+ prefetched = _Unpickler_FastCall(self, self->peek, len);
+ if (prefetched == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
+ /* peek() is probably not supported by the given file object */
+ PyErr_Clear();
+ Py_CLEAR(self->peek);
+ }
+ else {
+ Py_DECREF(data);
return -1;
+ }
}
else {
- memcpy(self->write_buf + self->buf_size, s, n);
- self->buf_size += n;
- return n;
+ assert(PyBytes_Check(prefetched));
+ prefetched_size = PyBytes_GET_SIZE(prefetched);
+ PyBytes_ConcatAndDel(&data, prefetched);
+ if (data == NULL)
+ return -1;
}
}
- /* object with write method */
- result = pickler_call(self, self->write, data);
- if (result == NULL)
- return -1;
-
- Py_DECREF(result);
- self->buf_size = 0;
- return n;
+ read_size = _Unpickler_SetStringInput(self, data) - prefetched_size;
+ Py_DECREF(data);
+ self->prefetched_idx = read_size;
+ return read_size;
}
-/* XXX: These read/readline functions ought to be optimized. Buffered I/O
- might help a lot, especially with the new (but much slower) io library.
- On the other hand, the added complexity might not worth it.
- */
+/* Read `n` bytes from the unpickler's data source, storing the result in `*s`.
+
+ This should be used for all data reads, rather than accessing the unpickler's
+ input buffer directly. This method deals correctly with reading from input
+ streams, which the input buffer doesn't deal with.
-/* Read at least n characters from the input stream and set s to the current
- reading position. */
+ Note that when reading from a file-like object, self->next_read_idx won't
+ be updated (it should remain at 0 for the entire unpickling process). You
+ should use this function's return value to know how many bytes you can
+ consume.
+
+ Returns -1 (with an exception set) on failure. On success, return the
+ number of chars read. */
static Py_ssize_t
-unpickler_read(UnpicklerObject *self, char **s, Py_ssize_t n)
+_Unpickler_Read(UnpicklerObject *self, char **s, Py_ssize_t n)
{
- PyObject *len;
- PyObject *data;
+ Py_ssize_t num_read;
- len = PyLong_FromSsize_t(n);
- if (len == NULL)
+ if (self->next_read_idx + n <= self->input_len) {
+ *s = self->input_buffer + self->next_read_idx;
+ self->next_read_idx += n;
+ return n;
+ }
+ if (!self->read) {
+ PyErr_Format(PyExc_EOFError, "Ran out of input");
return -1;
-
- data = unpickler_call(self, self->read, len);
- if (data == NULL)
+ }
+ num_read = _Unpickler_ReadFromFile(self, n);
+ if (num_read < 0)
return -1;
-
- /* XXX: Should bytearray be supported too? */
- if (!PyBytes_Check(data)) {
- PyErr_SetString(PyExc_ValueError,
- "read() from the underlying stream did not "
- "return bytes");
- Py_DECREF(data);
+ if (num_read < n) {
+ PyErr_Format(PyExc_EOFError, "Ran out of input");
return -1;
}
+ *s = self->input_buffer;
+ self->next_read_idx = n;
+ return n;
+}
- if (PyBytes_GET_SIZE(data) != n) {
- PyErr_SetNone(PyExc_EOFError);
- Py_DECREF(data);
+static Py_ssize_t
+_Unpickler_CopyLine(UnpicklerObject *self, char *line, Py_ssize_t len,
+ char **result)
+{
+ char *input_line = PyMem_Realloc(self->input_line, len + 1);
+ if (input_line == NULL)
return -1;
+
+ memcpy(input_line, line, len);
+ input_line[len] = '\0';
+ self->input_line = input_line;
+ *result = self->input_line;
+ return len;
+}
+
+/* Read a line from the input stream/buffer. If we run off the end of the input
+ before hitting \n, return the data we found.
+
+ Returns the number of chars read, or -1 on failure. */
+static Py_ssize_t
+_Unpickler_Readline(UnpicklerObject *self, char **result)
+{
+ Py_ssize_t i, num_read;
+
+ for (i = self->next_read_idx; i < self->input_len; i++) {
+ if (self->input_buffer[i] == '\n') {
+ char *line_start = self->input_buffer + self->next_read_idx;
+ num_read = i - self->next_read_idx + 1;
+ self->next_read_idx = i + 1;
+ return _Unpickler_CopyLine(self, line_start, num_read, result);
+ }
}
+ if (self->read) {
+ num_read = _Unpickler_ReadFromFile(self, READ_WHOLE_LINE);
+ if (num_read < 0)
+ return -1;
+ *result = self->input_buffer;
+ self->next_read_idx = num_read;
+ return num_read;
+ }
+
+ /* If we get here, we've run off the end of the input string. Return the
+ remaining string and let the caller figure it out. */
+ *result = self->input_buffer + self->next_read_idx;
+ num_read = i - self->next_read_idx;
+ self->next_read_idx = i;
+ return num_read;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. The memo array
+ will be modified in place. */
+static int
+_Unpickler_ResizeMemoList(UnpicklerObject *self, Py_ssize_t new_size)
+{
+ Py_ssize_t i;
+ PyObject **memo;
- Py_XDECREF(self->last_string);
- self->last_string = data;
+ assert(new_size > self->memo_size);
- if (!(*s = PyBytes_AS_STRING(data)))
+ memo = PyMem_REALLOC(self->memo, new_size * sizeof(PyObject *));
+ if (memo == NULL) {
+ PyErr_NoMemory();
return -1;
+ }
+ self->memo = memo;
+ for (i = self->memo_size; i < new_size; i++)
+ self->memo[i] = NULL;
+ self->memo_size = new_size;
+ return 0;
+}
- return n;
+/* Returns NULL if idx is out of bounds. */
+static PyObject *
+_Unpickler_MemoGet(UnpicklerObject *self, Py_ssize_t idx)
+{
+ if (idx < 0 || idx >= self->memo_size)
+ return NULL;
+
+ return self->memo[idx];
}
-static Py_ssize_t
-unpickler_readline(UnpicklerObject *self, char **s)
+/* Returns -1 (with an exception set) on failure, 0 on success.
+ This takes its own reference to `value`. */
+static int
+_Unpickler_MemoPut(UnpicklerObject *self, Py_ssize_t idx, PyObject *value)
{
- PyObject *data;
+ PyObject *old_item;
- data = PyObject_CallObject(self->readline, empty_tuple);
- if (data == NULL)
- return -1;
+ if (idx >= self->memo_size) {
+ if (_Unpickler_ResizeMemoList(self, idx * 2) < 0)
+ return -1;
+ assert(idx < self->memo_size);
+ }
+ Py_INCREF(value);
+ old_item = self->memo[idx];
+ self->memo[idx] = value;
+ Py_XDECREF(old_item);
+ return 0;
+}
- /* XXX: Should bytearray be supported too? */
- if (!PyBytes_Check(data)) {
- PyErr_SetString(PyExc_ValueError,
- "readline() from the underlying stream did not "
- "return bytes");
- return -1;
+static PyObject **
+_Unpickler_NewMemo(Py_ssize_t new_size)
+{
+ PyObject **memo = PyMem_MALLOC(new_size * sizeof(PyObject *));
+ if (memo == NULL)
+ return NULL;
+ memset(memo, 0, new_size * sizeof(PyObject *));
+ return memo;
+}
+
+/* Free the unpickler's memo, taking care to decref any items left in it. */
+static void
+_Unpickler_MemoCleanup(UnpicklerObject *self)
+{
+ Py_ssize_t i;
+ PyObject **memo = self->memo;
+
+ if (self->memo == NULL)
+ return;
+ self->memo = NULL;
+ i = self->memo_size;
+ while (--i >= 0) {
+ Py_XDECREF(memo[i]);
}
+ PyMem_FREE(memo);
+}
- Py_XDECREF(self->last_string);
- self->last_string = data;
+static UnpicklerObject *
+_Unpickler_New(void)
+{
+ UnpicklerObject *self;
- if (!(*s = PyBytes_AS_STRING(data)))
- return -1;
+ self = PyObject_GC_New(UnpicklerObject, &Unpickler_Type);
+ if (self == NULL)
+ return NULL;
- return PyBytes_GET_SIZE(data);
+ self->stack = (Pdata *)Pdata_New();
+ if (self->stack == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ memset(&self->buffer, 0, sizeof(Py_buffer));
+
+ self->memo_size = 32;
+ self->memo = _Unpickler_NewMemo(self->memo_size);
+ if (self->memo == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ self->arg = NULL;
+ self->pers_func = NULL;
+ self->input_buffer = NULL;
+ self->input_line = NULL;
+ self->input_len = 0;
+ self->next_read_idx = 0;
+ self->prefetched_idx = 0;
+ self->read = NULL;
+ self->readline = NULL;
+ self->peek = NULL;
+ self->encoding = NULL;
+ self->errors = NULL;
+ self->marks = NULL;
+ self->num_marks = 0;
+ self->marks_size = 0;
+ self->proto = 0;
+ self->fix_imports = 0;
+
+ return self;
}
-/* Generate a GET opcode for an object stored in the memo. The 'key' argument
- should be the address of the object as returned by PyLong_FromVoidPtr(). */
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Pickler. */
static int
-memo_get(PicklerObject *self, PyObject *key)
+_Unpickler_SetInputStream(UnpicklerObject *self, PyObject *file)
{
- PyObject *value;
- PyObject *memo_id;
- long x;
- char pdata[30];
- int len;
-
- value = PyDict_GetItemWithError(self->memo, key);
- if (value == NULL) {
- if (!PyErr_Occurred())
- PyErr_SetObject(PyExc_KeyError, key);
+ self->peek = PyObject_GetAttrString(file, "peek");
+ if (self->peek == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_AttributeError))
+ PyErr_Clear();
+ else
+ return -1;
+ }
+ self->read = PyObject_GetAttrString(file, "read");
+ self->readline = PyObject_GetAttrString(file, "readline");
+ if (self->readline == NULL || self->read == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_AttributeError))
+ PyErr_SetString(PyExc_TypeError,
+ "file must have 'read' and 'readline' attributes");
+ Py_CLEAR(self->read);
+ Py_CLEAR(self->readline);
+ Py_CLEAR(self->peek);
return -1;
}
+ return 0;
+}
- memo_id = PyTuple_GetItem(value, 0);
- if (memo_id == NULL)
- return -1;
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Pickler. */
+static int
+_Unpickler_SetInputEncoding(UnpicklerObject *self,
+ const char *encoding,
+ const char *errors)
+{
+ if (encoding == NULL)
+ encoding = "ASCII";
+ if (errors == NULL)
+ errors = "strict";
- if (!PyLong_Check(memo_id)) {
- PyErr_SetString(PicklingError, "memo id must be an integer");
+ self->encoding = strdup(encoding);
+ self->errors = strdup(errors);
+ if (self->encoding == NULL || self->errors == NULL) {
+ PyErr_NoMemory();
return -1;
}
- x = PyLong_AsLong(memo_id);
- if (x == -1 && PyErr_Occurred())
+ return 0;
+}
+
+/* Generate a GET opcode for an object stored in the memo. */
+static int
+memo_get(PicklerObject *self, PyObject *key)
+{
+ long *value;
+ char pdata[30];
+ int len;
+
+ value = PyMemoTable_Get(self->memo, key);
+ if (value == NULL) {
+ PyErr_SetObject(PyExc_KeyError, key);
return -1;
+ }
if (!self->bin) {
pdata[0] = GET;
- PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ld\n", x);
+ PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ld\n", *value);
len = (int)strlen(pdata);
}
else {
- if (x < 256) {
+ if (*value < 256) {
pdata[0] = BINGET;
- pdata[1] = (unsigned char)(x & 0xff);
+ pdata[1] = (unsigned char)(*value & 0xff);
len = 2;
}
- else if (x <= 0xffffffffL) {
+ else if (*value <= 0xffffffffL) {
pdata[0] = LONG_BINGET;
- pdata[1] = (unsigned char)(x & 0xff);
- pdata[2] = (unsigned char)((x >> 8) & 0xff);
- pdata[3] = (unsigned char)((x >> 16) & 0xff);
- pdata[4] = (unsigned char)((x >> 24) & 0xff);
+ pdata[1] = (unsigned char)(*value & 0xff);
+ pdata[2] = (unsigned char)((*value >> 8) & 0xff);
+ pdata[3] = (unsigned char)((*value >> 16) & 0xff);
+ pdata[4] = (unsigned char)((*value >> 24) & 0xff);
len = 5;
}
else { /* unlikely */
@@ -600,7 +1256,7 @@ memo_get(PicklerObject *self, PyObject *key)
}
}
- if (pickler_write(self, pdata, len) < 0)
+ if (_Pickler_Write(self, pdata, len) < 0)
return -1;
return 0;
@@ -611,9 +1267,6 @@ memo_get(PicklerObject *self, PyObject *key)
static int
memo_put(PicklerObject *self, PyObject *obj)
{
- PyObject *key = NULL;
- PyObject *memo_id = NULL;
- PyObject *tuple = NULL;
long x;
char pdata[30];
int len;
@@ -622,23 +1275,8 @@ memo_put(PicklerObject *self, PyObject *obj)
if (self->fast)
return 0;
- key = PyLong_FromVoidPtr(obj);
- if (key == NULL)
- goto error;
- if ((x = PyDict_Size(self->memo)) < 0)
- goto error;
- memo_id = PyLong_FromLong(x);
- if (memo_id == NULL)
- goto error;
- tuple = PyTuple_New(2);
- if (tuple == NULL)
- goto error;
-
- Py_INCREF(memo_id);
- PyTuple_SET_ITEM(tuple, 0, memo_id);
- Py_INCREF(obj);
- PyTuple_SET_ITEM(tuple, 1, obj);
- if (PyDict_SetItem(self->memo, key, tuple) < 0)
+ x = PyMemoTable_Size(self->memo);
+ if (PyMemoTable_Set(self->memo, obj, x) < 0)
goto error;
if (!self->bin) {
@@ -667,7 +1305,7 @@ memo_put(PicklerObject *self, PyObject *obj)
}
}
- if (pickler_write(self, pdata, len) < 0)
+ if (_Pickler_Write(self, pdata, len) < 0)
goto error;
if (0) {
@@ -675,10 +1313,6 @@ memo_put(PicklerObject *self, PyObject *obj)
status = -1;
}
- Py_XDECREF(key);
- Py_XDECREF(memo_id);
- Py_XDECREF(tuple);
-
return status;
}
@@ -821,7 +1455,7 @@ static int
save_none(PicklerObject *self, PyObject *obj)
{
const char none_op = NONE;
- if (pickler_write(self, &none_op, 1) < 0)
+ if (_Pickler_Write(self, &none_op, 1) < 0)
return -1;
return 0;
@@ -836,10 +1470,10 @@ save_bool(PicklerObject *self, PyObject *obj)
if (self->proto >= 2) {
const char bool_op = p ? NEWTRUE : NEWFALSE;
- if (pickler_write(self, &bool_op, 1) < 0)
+ if (_Pickler_Write(self, &bool_op, 1) < 0)
return -1;
}
- else if (pickler_write(self, buf[p], len[p]) < 0)
+ else if (_Pickler_Write(self, buf[p], len[p]) < 0)
return -1;
return 0;
@@ -861,7 +1495,7 @@ save_int(PicklerObject *self, long x)
*/
pdata[0] = LONG; /* use LONG for consistency with pickle.py */
PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ldL\n", x);
- if (pickler_write(self, pdata, strlen(pdata)) < 0)
+ if (_Pickler_Write(self, pdata, strlen(pdata)) < 0)
return -1;
}
else {
@@ -886,7 +1520,7 @@ save_int(PicklerObject *self, long x)
len = 5;
}
- if (pickler_write(self, pdata, len) < 0)
+ if (_Pickler_Write(self, pdata, len) < 0)
return -1;
}
@@ -922,7 +1556,7 @@ save_long(PicklerObject *self, PyObject *obj)
if (sign == 0) {
header[0] = LONG1;
header[1] = 0; /* It's 0 -- an empty bytestring. */
- if (pickler_write(self, header, 2) < 0)
+ if (_Pickler_Write(self, header, 2) < 0)
goto error;
return 0;
}
@@ -983,8 +1617,8 @@ save_long(PicklerObject *self, PyObject *obj)
}
size = 5;
}
- if (pickler_write(self, header, size) < 0 ||
- pickler_write(self, (char *)pdata, (int)nbytes) < 0)
+ if (_Pickler_Write(self, header, size) < 0 ||
+ _Pickler_Write(self, (char *)pdata, (int)nbytes) < 0)
goto error;
}
else {
@@ -1002,9 +1636,9 @@ save_long(PicklerObject *self, PyObject *obj)
if (string == NULL)
goto error;
- if (pickler_write(self, &long_op, 1) < 0 ||
- pickler_write(self, string, size) < 0 ||
- pickler_write(self, "L\n", 2) < 0)
+ if (_Pickler_Write(self, &long_op, 1) < 0 ||
+ _Pickler_Write(self, string, size) < 0 ||
+ _Pickler_Write(self, "L\n", 2) < 0)
goto error;
}
@@ -1027,7 +1661,7 @@ save_float(PicklerObject *self, PyObject *obj)
pdata[0] = BINFLOAT;
if (_PyFloat_Pack8(x, (unsigned char *)&pdata[1], 0) < 0)
return -1;
- if (pickler_write(self, pdata, 9) < 0)
+ if (_Pickler_Write(self, pdata, 9) < 0)
return -1;
}
else {
@@ -1035,7 +1669,7 @@ save_float(PicklerObject *self, PyObject *obj)
char *buf = NULL;
char op = FLOAT;
- if (pickler_write(self, &op, 1) < 0)
+ if (_Pickler_Write(self, &op, 1) < 0)
goto done;
buf = PyOS_double_to_string(x, 'g', 17, 0, NULL);
@@ -1044,10 +1678,10 @@ save_float(PicklerObject *self, PyObject *obj)
goto done;
}
- if (pickler_write(self, buf, strlen(buf)) < 0)
+ if (_Pickler_Write(self, buf, strlen(buf)) < 0)
goto done;
- if (pickler_write(self, "\n", 1) < 0)
+ if (_Pickler_Write(self, "\n", 1) < 0)
goto done;
result = 0;
@@ -1113,10 +1747,10 @@ save_bytes(PicklerObject *self, PyObject *obj)
return -1; /* string too large */
}
- if (pickler_write(self, header, len) < 0)
+ if (_Pickler_Write(self, header, len) < 0)
return -1;
- if (pickler_write(self, PyBytes_AS_STRING(obj), size) < 0)
+ if (_Pickler_Write(self, PyBytes_AS_STRING(obj), size) < 0)
return -1;
if (memo_put(self, obj) < 0)
@@ -1243,10 +1877,10 @@ save_unicode(PicklerObject *self, PyObject *obj)
pdata[3] = (unsigned char)((size >> 16) & 0xff);
pdata[4] = (unsigned char)((size >> 24) & 0xff);
- if (pickler_write(self, pdata, 5) < 0)
+ if (_Pickler_Write(self, pdata, 5) < 0)
goto error;
- if (pickler_write(self, PyBytes_AS_STRING(encoded), size) < 0)
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded), size) < 0)
goto error;
}
else {
@@ -1257,14 +1891,14 @@ save_unicode(PicklerObject *self, PyObject *obj)
if (encoded == NULL)
goto error;
- if (pickler_write(self, &unicode_op, 1) < 0)
+ if (_Pickler_Write(self, &unicode_op, 1) < 0)
goto error;
size = PyBytes_GET_SIZE(encoded);
- if (pickler_write(self, PyBytes_AS_STRING(encoded), size) < 0)
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded), size) < 0)
goto error;
- if (pickler_write(self, "\n", 1) < 0)
+ if (_Pickler_Write(self, "\n", 1) < 0)
goto error;
}
if (memo_put(self, obj) < 0)
@@ -1307,9 +1941,7 @@ store_tuple_elements(PicklerObject *self, PyObject *t, int len)
static int
save_tuple(PicklerObject *self, PyObject *obj)
{
- PyObject *memo_key = NULL;
int len, i;
- int status = 0;
const char mark_op = MARK;
const char tuple_op = TUPLE;
@@ -1332,40 +1964,35 @@ save_tuple(PicklerObject *self, PyObject *obj)
pdata[1] = TUPLE;
len = 2;
}
- if (pickler_write(self, pdata, len) < 0)
+ if (_Pickler_Write(self, pdata, len) < 0)
return -1;
return 0;
}
- /* id(tuple) isn't in the memo now. If it shows up there after
+ /* The tuple isn't in the memo now. If it shows up there after
* saving the tuple elements, the tuple must be recursive, in
* which case we'll pop everything we put on the stack, and fetch
* its value from the memo.
*/
- memo_key = PyLong_FromVoidPtr(obj);
- if (memo_key == NULL)
- return -1;
-
if (len <= 3 && self->proto >= 2) {
/* Use TUPLE{1,2,3} opcodes. */
if (store_tuple_elements(self, obj, len) < 0)
- goto error;
+ return -1;
- if (PyDict_GetItem(self->memo, memo_key)) {
+ if (PyMemoTable_Get(self->memo, obj)) {
/* pop the len elements */
for (i = 0; i < len; i++)
- if (pickler_write(self, &pop_op, 1) < 0)
- goto error;
+ if (_Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
/* fetch from memo */
- if (memo_get(self, memo_key) < 0)
- goto error;
+ if (memo_get(self, obj) < 0)
+ return -1;
- Py_DECREF(memo_key);
return 0;
}
else { /* Not recursive. */
- if (pickler_write(self, len2opcode + len, 1) < 0)
- goto error;
+ if (_Pickler_Write(self, len2opcode + len, 1) < 0)
+ return -1;
}
goto memoize;
}
@@ -1373,49 +2000,42 @@ save_tuple(PicklerObject *self, PyObject *obj)
/* proto < 2 and len > 0, or proto >= 2 and len > 3.
* Generate MARK e1 e2 ... TUPLE
*/
- if (pickler_write(self, &mark_op, 1) < 0)
- goto error;
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
if (store_tuple_elements(self, obj, len) < 0)
- goto error;
+ return -1;
- if (PyDict_GetItem(self->memo, memo_key)) {
+ if (PyMemoTable_Get(self->memo, obj)) {
/* pop the stack stuff we pushed */
if (self->bin) {
- if (pickler_write(self, &pop_mark_op, 1) < 0)
- goto error;
+ if (_Pickler_Write(self, &pop_mark_op, 1) < 0)
+ return -1;
}
else {
/* Note that we pop one more than len, to remove
* the MARK too.
*/
for (i = 0; i <= len; i++)
- if (pickler_write(self, &pop_op, 1) < 0)
- goto error;
+ if (_Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
}
/* fetch from memo */
- if (memo_get(self, memo_key) < 0)
- goto error;
+ if (memo_get(self, obj) < 0)
+ return -1;
- Py_DECREF(memo_key);
return 0;
}
else { /* Not recursive. */
- if (pickler_write(self, &tuple_op, 1) < 0)
- goto error;
+ if (_Pickler_Write(self, &tuple_op, 1) < 0)
+ return -1;
}
memoize:
if (memo_put(self, obj) < 0)
- goto error;
-
- if (0) {
- error:
- status = -1;
- }
+ return -1;
- Py_DECREF(memo_key);
- return status;
+ return 0;
}
/* iter is an iterator giving items, and we batch up chunks of
@@ -1455,7 +2075,7 @@ batch_list(PicklerObject *self, PyObject *iter)
Py_DECREF(obj);
if (i < 0)
return -1;
- if (pickler_write(self, &append_op, 1) < 0)
+ if (_Pickler_Write(self, &append_op, 1) < 0)
return -1;
}
return 0;
@@ -1482,7 +2102,7 @@ batch_list(PicklerObject *self, PyObject *iter)
/* Only one item to write */
if (save(self, firstitem, 0) < 0)
goto error;
- if (pickler_write(self, &append_op, 1) < 0)
+ if (_Pickler_Write(self, &append_op, 1) < 0)
goto error;
Py_CLEAR(firstitem);
break;
@@ -1491,7 +2111,7 @@ batch_list(PicklerObject *self, PyObject *iter)
/* More than one item to write */
/* Pump out MARK, items, APPENDS. */
- if (pickler_write(self, &mark_op, 1) < 0)
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
goto error;
if (save(self, firstitem, 0) < 0)
@@ -1517,7 +2137,7 @@ batch_list(PicklerObject *self, PyObject *iter)
}
}
- if (pickler_write(self, &appends_op, 1) < 0)
+ if (_Pickler_Write(self, &appends_op, 1) < 0)
goto error;
} while (n == BATCHSIZE);
@@ -1529,10 +2149,65 @@ batch_list(PicklerObject *self, PyObject *iter)
return -1;
}
+/* This is a variant of batch_list() above, specialized for lists (with no
+ * support for list subclasses). Like batch_list(), we batch up chunks of
+ * MARK item item ... item APPENDS
+ * opcode sequences. Calling code should have arranged to first create an
+ * empty list, or list-like object, for the APPENDS to operate on.
+ * Returns 0 on success, -1 on error.
+ *
+ * This version is considerably faster than batch_list(), if less general.
+ *
+ * Note that this only works for protocols > 0.
+ */
+static int
+batch_list_exact(PicklerObject *self, PyObject *obj)
+{
+ PyObject *item = NULL;
+ int this_batch, total;
+
+ const char append_op = APPEND;
+ const char appends_op = APPENDS;
+ const char mark_op = MARK;
+
+ assert(obj != NULL);
+ assert(self->proto > 0);
+ assert(PyList_CheckExact(obj));
+
+ if (PyList_GET_SIZE(obj) == 1) {
+ item = PyList_GET_ITEM(obj, 0);
+ if (save(self, item, 0) < 0)
+ return -1;
+ if (_Pickler_Write(self, &append_op, 1) < 0)
+ return -1;
+ return 0;
+ }
+
+ /* Write in batches of BATCHSIZE. */
+ total = 0;
+ do {
+ this_batch = 0;
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+ while (total < PyList_GET_SIZE(obj)) {
+ item = PyList_GET_ITEM(obj, total);
+ if (save(self, item, 0) < 0)
+ return -1;
+ total++;
+ if (++this_batch == BATCHSIZE)
+ break;
+ }
+ if (_Pickler_Write(self, &appends_op, 1) < 0)
+ return -1;
+
+ } while (total < PyList_GET_SIZE(obj));
+
+ return 0;
+}
+
static int
save_list(PicklerObject *self, PyObject *obj)
{
- PyObject *iter;
char header[3];
int len;
int status = 0;
@@ -1551,7 +2226,7 @@ save_list(PicklerObject *self, PyObject *obj)
len = 2;
}
- if (pickler_write(self, header, len) < 0)
+ if (_Pickler_Write(self, header, len) < 0)
goto error;
/* Get list length, and bow out early if empty. */
@@ -1562,19 +2237,26 @@ save_list(PicklerObject *self, PyObject *obj)
goto error;
if (len != 0) {
- /* Save the list elements. */
- iter = PyObject_GetIter(obj);
- if (iter == NULL)
- goto error;
- if (Py_EnterRecursiveCall(" while pickling an object")) {
+ /* Materialize the list elements. */
+ if (PyList_CheckExact(obj) && self->proto > 0) {
+ if (Py_EnterRecursiveCall(" while pickling an object"))
+ goto error;
+ status = batch_list_exact(self, obj);
+ Py_LeaveRecursiveCall();
+ } else {
+ PyObject *iter = PyObject_GetIter(obj);
+ if (iter == NULL)
+ goto error;
+
+ if (Py_EnterRecursiveCall(" while pickling an object")) {
+ Py_DECREF(iter);
+ goto error;
+ }
+ status = batch_list(self, iter);
+ Py_LeaveRecursiveCall();
Py_DECREF(iter);
- goto error;
}
- status = batch_list(self, iter);
- Py_LeaveRecursiveCall();
- Py_DECREF(iter);
}
-
if (0) {
error:
status = -1;
@@ -1630,7 +2312,7 @@ batch_dict(PicklerObject *self, PyObject *iter)
Py_DECREF(obj);
if (i < 0)
return -1;
- if (pickler_write(self, &setitem_op, 1) < 0)
+ if (_Pickler_Write(self, &setitem_op, 1) < 0)
return -1;
}
return 0;
@@ -1664,7 +2346,7 @@ batch_dict(PicklerObject *self, PyObject *iter)
goto error;
if (save(self, PyTuple_GET_ITEM(firstitem, 1), 0) < 0)
goto error;
- if (pickler_write(self, &setitem_op, 1) < 0)
+ if (_Pickler_Write(self, &setitem_op, 1) < 0)
goto error;
Py_CLEAR(firstitem);
break;
@@ -1673,7 +2355,7 @@ batch_dict(PicklerObject *self, PyObject *iter)
/* More than one item to write */
/* Pump out MARK, items, SETITEMS. */
- if (pickler_write(self, &mark_op, 1) < 0)
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
goto error;
if (save(self, PyTuple_GET_ITEM(firstitem, 0), 0) < 0)
@@ -1689,7 +2371,7 @@ batch_dict(PicklerObject *self, PyObject *iter)
PyErr_SetString(PyExc_TypeError, "dict items "
"iterator must return 2-tuples");
goto error;
- }
+ }
if (save(self, PyTuple_GET_ITEM(obj, 0), 0) < 0 ||
save(self, PyTuple_GET_ITEM(obj, 1), 0) < 0)
goto error;
@@ -1707,7 +2389,7 @@ batch_dict(PicklerObject *self, PyObject *iter)
}
}
- if (pickler_write(self, &setitems_op, 1) < 0)
+ if (_Pickler_Write(self, &setitems_op, 1) < 0)
goto error;
} while (n == BATCHSIZE);
@@ -1751,7 +2433,7 @@ batch_dict_exact(PicklerObject *self, PyObject *obj)
return -1;
if (save(self, value, 0) < 0)
return -1;
- if (pickler_write(self, &setitem_op, 1) < 0)
+ if (_Pickler_Write(self, &setitem_op, 1) < 0)
return -1;
return 0;
}
@@ -1759,7 +2441,7 @@ batch_dict_exact(PicklerObject *self, PyObject *obj)
/* Write in batches of BATCHSIZE. */
do {
i = 0;
- if (pickler_write(self, &mark_op, 1) < 0)
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
return -1;
while (PyDict_Next(obj, &ppos, &key, &value)) {
if (save(self, key, 0) < 0)
@@ -1769,7 +2451,7 @@ batch_dict_exact(PicklerObject *self, PyObject *obj)
if (++i == BATCHSIZE)
break;
}
- if (pickler_write(self, &setitems_op, 1) < 0)
+ if (_Pickler_Write(self, &setitems_op, 1) < 0)
return -1;
if (PyDict_Size(obj) != dict_size) {
PyErr_Format(
@@ -1804,7 +2486,7 @@ save_dict(PicklerObject *self, PyObject *obj)
len = 2;
}
- if (pickler_write(self, header, len) < 0)
+ if (_Pickler_Write(self, header, len) < 0)
goto error;
/* Get dict size, and bow out early if empty. */
@@ -1972,7 +2654,7 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
n = 5;
}
- if (pickler_write(self, pdata, n) < 0)
+ if (_Pickler_Write(self, pdata, n) < 0)
goto error;
}
else {
@@ -1983,7 +2665,7 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
PyObject *(*unicode_encoder)(PyObject *);
gen_global:
- if (pickler_write(self, &global_op, 1) < 0)
+ if (_Pickler_Write(self, &global_op, 1) < 0)
goto error;
/* Since Python 3.0 now supports non-ASCII identifiers, we encode both
@@ -2063,13 +2745,13 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
"pickle protocol %i", module_name, self->proto);
goto error;
}
- if (pickler_write(self, PyBytes_AS_STRING(encoded),
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
PyBytes_GET_SIZE(encoded)) < 0) {
Py_DECREF(encoded);
goto error;
}
Py_DECREF(encoded);
- if(pickler_write(self, "\n", 1) < 0)
+ if(_Pickler_Write(self, "\n", 1) < 0)
goto error;
/* Save the name of the module. */
@@ -2081,13 +2763,13 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
"pickle protocol %i", global_name, self->proto);
goto error;
}
- if (pickler_write(self, PyBytes_AS_STRING(encoded),
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
PyBytes_GET_SIZE(encoded)) < 0) {
Py_DECREF(encoded);
goto error;
}
Py_DECREF(encoded);
- if(pickler_write(self, "\n", 1) < 0)
+ if(_Pickler_Write(self, "\n", 1) < 0)
goto error;
/* Memoize the object. */
@@ -2116,14 +2798,14 @@ save_pers(PicklerObject *self, PyObject *obj, PyObject *func)
const char binpersid_op = BINPERSID;
Py_INCREF(obj);
- pid = pickler_call(self, func, obj);
+ pid = _Pickler_FastCall(self, func, obj);
if (pid == NULL)
return -1;
if (pid != Py_None) {
if (self->bin) {
if (save(self, pid, 1) < 0 ||
- pickler_write(self, &binpersid_op, 1) < 0)
+ _Pickler_Write(self, &binpersid_op, 1) < 0)
goto error;
}
else {
@@ -2143,9 +2825,9 @@ save_pers(PicklerObject *self, PyObject *obj, PyObject *func)
if (pid_ascii_bytes == NULL)
goto error;
- if (pickler_write(self, &persid_op, 1) < 0 ||
- pickler_write(self, pid_ascii_bytes, size) < 0 ||
- pickler_write(self, "\n", 1) < 0)
+ if (_Pickler_Write(self, &persid_op, 1) < 0 ||
+ _Pickler_Write(self, pid_ascii_bytes, size) < 0 ||
+ _Pickler_Write(self, "\n", 1) < 0)
goto error;
}
status = 1;
@@ -2230,6 +2912,8 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
if (newobj_str == NULL) {
newobj_str = PyUnicode_InternFromString("__newobj__");
+ if (newobj_str == NULL)
+ return -1;
}
name_str = PyObject_GetAttrString(callable, "__name__");
@@ -2322,13 +3006,13 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
return -1;
/* Add NEWOBJ opcode. */
- if (pickler_write(self, &newobj_op, 1) < 0)
+ if (_Pickler_Write(self, &newobj_op, 1) < 0)
return -1;
}
else { /* Not using NEWOBJ. */
if (save(self, callable, 0) < 0 ||
save(self, argtup, 0) < 0 ||
- pickler_write(self, &reduce_op, 1) < 0)
+ _Pickler_Write(self, &reduce_op, 1) < 0)
return -1;
}
@@ -2347,7 +3031,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
if (state) {
if (save(self, state, 0) < 0 ||
- pickler_write(self, &build_op, 1) < 0)
+ _Pickler_Write(self, &build_op, 1) < 0)
return -1;
}
@@ -2360,7 +3044,6 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
PyTypeObject *type;
PyObject *reduce_func = NULL;
PyObject *reduce_value = NULL;
- PyObject *memo_key = NULL;
int status = 0;
if (Py_EnterRecursiveCall(" while pickling an object"))
@@ -2380,11 +3063,10 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
type = Py_TYPE(obj);
- /* XXX: The old cPickle had an optimization that used switch-case
- statement dispatching on the first letter of the type name. It was
- probably not a bad idea after all. If benchmarks shows that particular
- optimization had some real benefits, it would be nice to add it
- back. */
+ /* The old cPickle had an optimization that used switch-case statement
+ dispatching on the first letter of the type name. This has was removed
+ since benchmarks shown that this optimization was actually slowing
+ things down. */
/* Atom types; these aren't memoized, so don't check the memo. */
@@ -2408,11 +3090,8 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
/* Check the memo to see if it has the object. If so, generate
a GET (or BINGET) opcode, instead of pickling the object
once again. */
- memo_key = PyLong_FromVoidPtr(obj);
- if (memo_key == NULL)
- goto error;
- if (PyDict_GetItem(self->memo, memo_key)) {
- if (memo_get(self, memo_key) < 0)
+ if (PyMemoTable_Get(self->memo, obj)) {
+ if (memo_get(self, obj) < 0)
goto error;
goto done;
}
@@ -2475,7 +3154,7 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
*/
Py_INCREF(reduce_func);
Py_INCREF(obj);
- reduce_value = pickler_call(self, reduce_func, obj);
+ reduce_value = _Pickler_FastCall(self, reduce_func, obj);
}
else {
static PyObject *reduce_str = NULL;
@@ -2505,7 +3184,7 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
PyObject *proto;
proto = PyLong_FromLong(self->proto);
if (proto != NULL) {
- reduce_value = pickler_call(self, reduce_func, proto);
+ reduce_value = _Pickler_FastCall(self, reduce_func, proto);
}
}
else {
@@ -2548,7 +3227,6 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
}
done:
Py_LeaveRecursiveCall();
- Py_XDECREF(memo_key);
Py_XDECREF(reduce_func);
Py_XDECREF(reduce_value);
@@ -2566,13 +3244,12 @@ dump(PicklerObject *self, PyObject *obj)
header[0] = PROTO;
assert(self->proto >= 0 && self->proto < 256);
header[1] = (unsigned char)self->proto;
- if (pickler_write(self, header, 2) < 0)
+ if (_Pickler_Write(self, header, 2) < 0)
return -1;
}
if (save(self, obj, 0) < 0 ||
- pickler_write(self, &stop_op, 1) < 0 ||
- pickler_write(self, NULL, 0) < 0)
+ _Pickler_Write(self, &stop_op, 1) < 0)
return -1;
return 0;
@@ -2590,7 +3267,7 @@ static PyObject *
Pickler_clear_memo(PicklerObject *self)
{
if (self->memo)
- PyDict_Clear(self->memo);
+ PyMemoTable_Clear(self->memo);
Py_RETURN_NONE;
}
@@ -2616,9 +3293,15 @@ Pickler_dump(PicklerObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O:dump", &obj))
return NULL;
+ if (_Pickler_ClearBuffer(self) < 0)
+ return NULL;
+
if (dump(self, obj) < 0)
return NULL;
+ if (_Pickler_FlushToFile(self) < 0)
+ return NULL;
+
Py_RETURN_NONE;
}
@@ -2635,13 +3318,13 @@ Pickler_dealloc(PicklerObject *self)
{
PyObject_GC_UnTrack(self);
+ Py_XDECREF(self->output_buffer);
Py_XDECREF(self->write);
- Py_XDECREF(self->memo);
Py_XDECREF(self->pers_func);
Py_XDECREF(self->arg);
Py_XDECREF(self->fast_memo);
- PyMem_Free(self->write_buf);
+ PyMemoTable_Del(self->memo);
Py_TYPE(self)->tp_free((PyObject *)self);
}
@@ -2650,7 +3333,6 @@ static int
Pickler_traverse(PicklerObject *self, visitproc visit, void *arg)
{
Py_VISIT(self->write);
- Py_VISIT(self->memo);
Py_VISIT(self->pers_func);
Py_VISIT(self->arg);
Py_VISIT(self->fast_memo);
@@ -2660,18 +3342,21 @@ Pickler_traverse(PicklerObject *self, visitproc visit, void *arg)
static int
Pickler_clear(PicklerObject *self)
{
+ Py_CLEAR(self->output_buffer);
Py_CLEAR(self->write);
- Py_CLEAR(self->memo);
Py_CLEAR(self->pers_func);
Py_CLEAR(self->arg);
Py_CLEAR(self->fast_memo);
- PyMem_Free(self->write_buf);
- self->write_buf = NULL;
-
+ if (self->memo != NULL) {
+ PyMemoTable *memo = self->memo;
+ self->memo = NULL;
+ PyMemoTable_Del(memo);
+ }
return 0;
}
+
PyDoc_STRVAR(Pickler_doc,
"Pickler(file, protocol=None)"
"\n"
@@ -2702,10 +3387,9 @@ Pickler_init(PicklerObject *self, PyObject *args, PyObject *kwds)
static char *kwlist[] = {"file", "protocol", "fix_imports", 0};
PyObject *file;
PyObject *proto_obj = NULL;
- long proto = 0;
- int fix_imports = 1;
+ PyObject *fix_imports = Py_True;
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oi:Pickler",
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:Pickler",
kwlist, &file, &proto_obj, &fix_imports))
return -1;
@@ -2713,44 +3397,31 @@ Pickler_init(PicklerObject *self, PyObject *args, PyObject *kwds)
if (self->write != NULL)
(void)Pickler_clear(self);
- if (proto_obj == NULL || proto_obj == Py_None)
- proto = DEFAULT_PROTOCOL;
- else {
- proto = PyLong_AsLong(proto_obj);
- if (proto == -1 && PyErr_Occurred())
- return -1;
- }
+ if (_Pickler_SetProtocol(self, proto_obj, fix_imports) < 0)
+ return -1;
- if (proto < 0)
- proto = HIGHEST_PROTOCOL;
- if (proto > HIGHEST_PROTOCOL) {
- PyErr_Format(PyExc_ValueError, "pickle protocol must be <= %d",
- HIGHEST_PROTOCOL);
+ if (_Pickler_SetOutputStream(self, file) < 0)
return -1;
+
+ /* memo and output_buffer may have already been created in _Pickler_New */
+ if (self->memo == NULL) {
+ self->memo = PyMemoTable_New();
+ if (self->memo == NULL)
+ return -1;
+ }
+ self->output_len = 0;
+ if (self->output_buffer == NULL) {
+ self->max_output_len = WRITE_BUF_SIZE;
+ self->output_buffer = PyBytes_FromStringAndSize(NULL,
+ self->max_output_len);
+ if (self->output_buffer == NULL)
+ return -1;
}
- self->proto = proto;
- self->bin = proto > 0;
self->arg = NULL;
self->fast = 0;
self->fast_nesting = 0;
self->fast_memo = NULL;
- self->fix_imports = fix_imports && proto < 3;
-
- if (!PyObject_HasAttrString(file, "write")) {
- PyErr_SetString(PyExc_TypeError,
- "file must have a 'write' attribute");
- return -1;
- }
- self->write = PyObject_GetAttrString(file, "write");
- if (self->write == NULL)
- return -1;
- self->buf_size = 0;
- self->write_buf = (char *)PyMem_Malloc(WRITE_BUF_SIZE);
- if (self->write_buf == NULL) {
- PyErr_NoMemory();
- return -1;
- }
self->pers_func = NULL;
if (PyObject_HasAttrString((PyObject *)self, "persistent_id")) {
self->pers_func = PyObject_GetAttrString((PyObject *)self,
@@ -2758,44 +3429,248 @@ Pickler_init(PicklerObject *self, PyObject *args, PyObject *kwds)
if (self->pers_func == NULL)
return -1;
}
- self->memo = PyDict_New();
- if (self->memo == NULL)
- return -1;
+ return 0;
+}
+
+/* Define a proxy object for the Pickler's internal memo object. This is to
+ * avoid breaking code like:
+ * pickler.memo.clear()
+ * and
+ * pickler.memo = saved_memo
+ * Is this a good idea? Not really, but we don't want to break code that uses
+ * it. Note that we don't implement the entire mapping API here. This is
+ * intentional, as these should be treated as black-box implementation details.
+ */
+
+typedef struct {
+ PyObject_HEAD
+ PicklerObject *pickler; /* Pickler whose memo table we're proxying. */
+} PicklerMemoProxyObject;
+
+PyDoc_STRVAR(pmp_clear_doc,
+"memo.clear() -> None. Remove all items from memo.");
+
+static PyObject *
+pmp_clear(PicklerMemoProxyObject *self)
+{
+ if (self->pickler->memo)
+ PyMemoTable_Clear(self->pickler->memo);
+ Py_RETURN_NONE;
+}
+PyDoc_STRVAR(pmp_copy_doc,
+"memo.copy() -> new_memo. Copy the memo to a new object.");
+
+static PyObject *
+pmp_copy(PicklerMemoProxyObject *self)
+{
+ Py_ssize_t i;
+ PyMemoTable *memo;
+ PyObject *new_memo = PyDict_New();
+ if (new_memo == NULL)
+ return NULL;
+
+ memo = self->pickler->memo;
+ for (i = 0; i < memo->mt_allocated; ++i) {
+ PyMemoEntry entry = memo->mt_table[i];
+ if (entry.me_key != NULL) {
+ int status;
+ PyObject *key, *value;
+
+ key = PyLong_FromVoidPtr(entry.me_key);
+ value = Py_BuildValue("lO", entry.me_value, entry.me_key);
+
+ if (key == NULL || value == NULL) {
+ Py_XDECREF(key);
+ Py_XDECREF(value);
+ goto error;
+ }
+ status = PyDict_SetItem(new_memo, key, value);
+ Py_DECREF(key);
+ Py_DECREF(value);
+ if (status < 0)
+ goto error;
+ }
+ }
+ return new_memo;
+
+ error:
+ Py_XDECREF(new_memo);
+ return NULL;
+}
+
+PyDoc_STRVAR(pmp_reduce_doc,
+"memo.__reduce__(). Pickling support.");
+
+static PyObject *
+pmp_reduce(PicklerMemoProxyObject *self, PyObject *args)
+{
+ PyObject *reduce_value, *dict_args;
+ PyObject *contents = pmp_copy(self);
+ if (contents == NULL)
+ return NULL;
+
+ reduce_value = PyTuple_New(2);
+ if (reduce_value == NULL) {
+ Py_DECREF(contents);
+ return NULL;
+ }
+ dict_args = PyTuple_New(1);
+ if (dict_args == NULL) {
+ Py_DECREF(contents);
+ Py_DECREF(reduce_value);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(dict_args, 0, contents);
+ Py_INCREF((PyObject *)&PyDict_Type);
+ PyTuple_SET_ITEM(reduce_value, 0, (PyObject *)&PyDict_Type);
+ PyTuple_SET_ITEM(reduce_value, 1, dict_args);
+ return reduce_value;
+}
+
+static PyMethodDef picklerproxy_methods[] = {
+ {"clear", (PyCFunction)pmp_clear, METH_NOARGS, pmp_clear_doc},
+ {"copy", (PyCFunction)pmp_copy, METH_NOARGS, pmp_copy_doc},
+ {"__reduce__", (PyCFunction)pmp_reduce, METH_VARARGS, pmp_reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static void
+PicklerMemoProxy_dealloc(PicklerMemoProxyObject *self)
+{
+ PyObject_GC_UnTrack(self);
+ Py_XDECREF(self->pickler);
+ PyObject_GC_Del((PyObject *)self);
+}
+
+static int
+PicklerMemoProxy_traverse(PicklerMemoProxyObject *self,
+ visitproc visit, void *arg)
+{
+ Py_VISIT(self->pickler);
return 0;
}
+static int
+PicklerMemoProxy_clear(PicklerMemoProxyObject *self)
+{
+ Py_CLEAR(self->pickler);
+ return 0;
+}
+
+static PyTypeObject PicklerMemoProxyType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_pickle.PicklerMemoProxy", /*tp_name*/
+ sizeof(PicklerMemoProxyObject), /*tp_basicsize*/
+ 0,
+ (destructor)PicklerMemoProxy_dealloc, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ PyObject_HashNotImplemented, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ PyObject_GenericSetAttr, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
+ 0, /* tp_doc */
+ (traverseproc)PicklerMemoProxy_traverse, /* tp_traverse */
+ (inquiry)PicklerMemoProxy_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ picklerproxy_methods, /* tp_methods */
+};
+
+static PyObject *
+PicklerMemoProxy_New(PicklerObject *pickler)
+{
+ PicklerMemoProxyObject *self;
+
+ self = PyObject_GC_New(PicklerMemoProxyObject, &PicklerMemoProxyType);
+ if (self == NULL)
+ return NULL;
+ Py_INCREF(pickler);
+ self->pickler = pickler;
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+}
+
+/*****************************************************************************/
+
static PyObject *
Pickler_get_memo(PicklerObject *self)
{
- if (self->memo == NULL)
- PyErr_SetString(PyExc_AttributeError, "memo");
- else
- Py_INCREF(self->memo);
- return self->memo;
+ return PicklerMemoProxy_New(self);
}
static int
-Pickler_set_memo(PicklerObject *self, PyObject *value)
+Pickler_set_memo(PicklerObject *self, PyObject *obj)
{
- PyObject *tmp;
+ PyMemoTable *new_memo = NULL;
- if (value == NULL) {
+ if (obj == NULL) {
PyErr_SetString(PyExc_TypeError,
"attribute deletion is not supported");
return -1;
}
- if (!PyDict_Check(value)) {
- PyErr_SetString(PyExc_TypeError, "memo must be a dictionary");
+
+ if (Py_TYPE(obj) == &PicklerMemoProxyType) {
+ PicklerObject *pickler =
+ ((PicklerMemoProxyObject *)obj)->pickler;
+
+ new_memo = PyMemoTable_Copy(pickler->memo);
+ if (new_memo == NULL)
+ return -1;
+ }
+ else if (PyDict_Check(obj)) {
+ Py_ssize_t i = 0;
+ PyObject *key, *value;
+
+ new_memo = PyMemoTable_New();
+ if (new_memo == NULL)
+ return -1;
+
+ while (PyDict_Next(obj, &i, &key, &value)) {
+ long memo_id;
+ PyObject *memo_obj;
+
+ if (!PyTuple_Check(value) || Py_SIZE(value) != 2) {
+ PyErr_SetString(PyExc_TypeError,
+ "'memo' values must be 2-item tuples");
+ goto error;
+ }
+ memo_id = PyLong_AsLong(PyTuple_GET_ITEM(value, 0));
+ if (memo_id == -1 && PyErr_Occurred())
+ goto error;
+ memo_obj = PyTuple_GET_ITEM(value, 1);
+ if (PyMemoTable_Set(new_memo, memo_obj, memo_id) < 0)
+ goto error;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "'memo' attribute must be an PicklerMemoProxy object"
+ "or dict, not %.200s", Py_TYPE(obj)->tp_name);
return -1;
}
- tmp = self->memo;
- Py_INCREF(value);
- self->memo = value;
- Py_XDECREF(tmp);
+ PyMemoTable_Del(self->memo);
+ self->memo = new_memo;
return 0;
+
+ error:
+ if (new_memo)
+ PyMemoTable_Del(new_memo);
+ return -1;
}
static PyObject *
@@ -2936,21 +3811,22 @@ load_int(UnpicklerObject *self)
Py_ssize_t len;
long x;
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 2)
return bad_readline();
errno = 0;
- /* XXX: Should the base argument of strtol() be explicitly set to 10? */
+ /* XXX: Should the base argument of strtol() be explicitly set to 10?
+ XXX(avassalotti): Should this uses PyOS_strtol()? */
x = strtol(s, &endptr, 0);
- if (errno || (*endptr != '\n') || (endptr[1] != '\0')) {
+ if (errno || (*endptr != '\n' && *endptr != '\0')) {
/* Hm, maybe we've got something long. Let's try reading
* it as a Python long object. */
errno = 0;
/* XXX: Same thing about the base here. */
- value = PyLong_FromString(s, NULL, 0);
+ value = PyLong_FromString(s, NULL, 0);
if (value == NULL) {
PyErr_SetString(PyExc_ValueError,
"could not convert string to int");
@@ -3027,7 +3903,7 @@ load_binint(UnpicklerObject *self)
{
char *s;
- if (unpickler_read(self, &s, 4) < 0)
+ if (_Unpickler_Read(self, &s, 4) < 0)
return -1;
return load_binintx(self, s, 4);
@@ -3038,7 +3914,7 @@ load_binint1(UnpicklerObject *self)
{
char *s;
- if (unpickler_read(self, &s, 1) < 0)
+ if (_Unpickler_Read(self, &s, 1) < 0)
return -1;
return load_binintx(self, s, 1);
@@ -3049,7 +3925,7 @@ load_binint2(UnpicklerObject *self)
{
char *s;
- if (unpickler_read(self, &s, 2) < 0)
+ if (_Unpickler_Read(self, &s, 2) < 0)
return -1;
return load_binintx(self, s, 2);
@@ -3062,7 +3938,7 @@ load_long(UnpicklerObject *self)
char *s;
Py_ssize_t len;
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 2)
return bad_readline();
@@ -3071,9 +3947,8 @@ load_long(UnpicklerObject *self)
the 'L' before calling PyLong_FromString. In order to maintain
compatibility with Python 3.0.0, we don't actually *require*
the 'L' to be present. */
- if (s[len-2] == 'L') {
+ if (s[len-2] == 'L')
s[len-2] = '\0';
- }
/* XXX: Should the base argument explicitly set to 10? */
value = PyLong_FromString(s, NULL, 0);
if (value == NULL)
@@ -3094,7 +3969,7 @@ load_counted_long(UnpicklerObject *self, int size)
char *pdata;
assert(size == 1 || size == 4);
- if (unpickler_read(self, &nbytes, size) < 0)
+ if (_Unpickler_Read(self, &nbytes, size) < 0)
return -1;
size = calc_binint(nbytes, size);
@@ -3109,7 +3984,7 @@ load_counted_long(UnpicklerObject *self, int size)
value = PyLong_FromLong(0L);
else {
/* Read the raw little-endian bytes and convert. */
- if (unpickler_read(self, &pdata, size) < 0)
+ if (_Unpickler_Read(self, &pdata, size) < 0)
return -1;
value = _PyLong_FromByteArray((unsigned char *)pdata, (size_t)size,
1 /* little endian */ , 1 /* signed */ );
@@ -3128,7 +4003,7 @@ load_float(UnpicklerObject *self)
Py_ssize_t len;
double d;
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 2)
return bad_readline();
@@ -3137,7 +4012,7 @@ load_float(UnpicklerObject *self)
d = PyOS_string_to_double(s, &endptr, PyExc_OverflowError);
if (d == -1.0 && PyErr_Occurred())
return -1;
- if ((endptr[0] != '\n') || (endptr[1] != '\0')) {
+ if ((endptr[0] != '\n') && (endptr[0] != '\0')) {
PyErr_SetString(PyExc_ValueError, "could not convert string to float");
return -1;
}
@@ -3147,7 +4022,7 @@ load_float(UnpicklerObject *self)
PDATA_PUSH(self->stack, value, -1);
return 0;
- }
+}
static int
load_binfloat(UnpicklerObject *self)
@@ -3156,7 +4031,7 @@ load_binfloat(UnpicklerObject *self)
double x;
char *s;
- if (unpickler_read(self, &s, 8) < 0)
+ if (_Unpickler_Read(self, &s, 8) < 0)
return -1;
x = _PyFloat_Unpack8((unsigned char *)s, 0);
@@ -3178,7 +4053,7 @@ load_string(UnpicklerObject *self)
Py_ssize_t len;
char *s, *p;
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 3)
return bad_readline();
@@ -3228,7 +4103,7 @@ load_binbytes(UnpicklerObject *self)
long x;
char *s;
- if (unpickler_read(self, &s, 4) < 0)
+ if (_Unpickler_Read(self, &s, 4) < 0)
return -1;
x = calc_binint(s, 4);
@@ -3238,7 +4113,7 @@ load_binbytes(UnpicklerObject *self)
return -1;
}
- if (unpickler_read(self, &s, x) < 0)
+ if (_Unpickler_Read(self, &s, x) < 0)
return -1;
bytes = PyBytes_FromStringAndSize(s, x);
if (bytes == NULL)
@@ -3255,12 +4130,12 @@ load_short_binbytes(UnpicklerObject *self)
unsigned char x;
char *s;
- if (unpickler_read(self, &s, 1) < 0)
+ if (_Unpickler_Read(self, &s, 1) < 0)
return -1;
x = (unsigned char)s[0];
- if (unpickler_read(self, &s, x) < 0)
+ if (_Unpickler_Read(self, &s, x) < 0)
return -1;
bytes = PyBytes_FromStringAndSize(s, x);
@@ -3278,7 +4153,7 @@ load_binstring(UnpicklerObject *self)
long x;
char *s;
- if (unpickler_read(self, &s, 4) < 0)
+ if (_Unpickler_Read(self, &s, 4) < 0)
return -1;
x = calc_binint(s, 4);
@@ -3288,7 +4163,7 @@ load_binstring(UnpicklerObject *self)
return -1;
}
- if (unpickler_read(self, &s, x) < 0)
+ if (_Unpickler_Read(self, &s, x) < 0)
return -1;
/* Convert Python 2.x strings to unicode. */
@@ -3307,12 +4182,12 @@ load_short_binstring(UnpicklerObject *self)
unsigned char x;
char *s;
- if (unpickler_read(self, &s, 1) < 0)
+ if (_Unpickler_Read(self, &s, 1) < 0)
return -1;
x = (unsigned char)s[0];
- if (unpickler_read(self, &s, x) < 0)
+ if (_Unpickler_Read(self, &s, x) < 0)
return -1;
/* Convert Python 2.x strings to unicode. */
@@ -3331,7 +4206,7 @@ load_unicode(UnpicklerObject *self)
Py_ssize_t len;
char *s;
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 1)
return bad_readline();
@@ -3351,7 +4226,7 @@ load_binunicode(UnpicklerObject *self)
long size;
char *s;
- if (unpickler_read(self, &s, 4) < 0)
+ if (_Unpickler_Read(self, &s, 4) < 0)
return -1;
size = calc_binint(s, 4);
@@ -3361,7 +4236,7 @@ load_binunicode(UnpicklerObject *self)
return -1;
}
- if (unpickler_read(self, &s, size) < 0)
+ if (_Unpickler_Read(self, &s, size) < 0)
return -1;
str = PyUnicode_DecodeUTF8(s, size, "surrogatepass");
@@ -3455,7 +4330,7 @@ load_dict(UnpicklerObject *self)
if ((i = marker(self)) < 0)
return -1;
- j = self->stack->length;
+ j = Py_SIZE(self->stack);
if ((dict = PyDict_New()) == NULL)
return -1;
@@ -3531,7 +4406,7 @@ load_inst(UnpicklerObject *self)
if ((i = marker(self)) < 0)
return -1;
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 2)
return bad_readline();
@@ -3543,7 +4418,7 @@ load_inst(UnpicklerObject *self)
if (module_name == NULL)
return -1;
- if ((len = unpickler_readline(self, &s)) >= 0) {
+ if ((len = _Unpickler_Readline(self, &s)) >= 0) {
if (len < 2)
return bad_readline();
class_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
@@ -3629,7 +4504,7 @@ load_global(UnpicklerObject *self)
Py_ssize_t len;
char *s;
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 2)
return bad_readline();
@@ -3637,7 +4512,7 @@ load_global(UnpicklerObject *self)
if (!module_name)
return -1;
- if ((len = unpickler_readline(self, &s)) >= 0) {
+ if ((len = _Unpickler_Readline(self, &s)) >= 0) {
if (len < 2) {
Py_DECREF(module_name);
return bad_readline();
@@ -3664,7 +4539,7 @@ load_persid(UnpicklerObject *self)
char *s;
if (self->pers_func) {
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 2)
return bad_readline();
@@ -3673,9 +4548,9 @@ load_persid(UnpicklerObject *self)
if (pid == NULL)
return -1;
- /* Ugh... this does not leak since unpickler_call() steals the
+ /* Ugh... this does not leak since _Unpickler_FastCall() steals the
reference to pid first. */
- pid = unpickler_call(self, self->pers_func, pid);
+ pid = _Unpickler_FastCall(self, self->pers_func, pid);
if (pid == NULL)
return -1;
@@ -3700,9 +4575,9 @@ load_binpersid(UnpicklerObject *self)
if (pid == NULL)
return -1;
- /* Ugh... this does not leak since unpickler_call() steals the
+ /* Ugh... this does not leak since _Unpickler_FastCall() steals the
reference to pid first. */
- pid = unpickler_call(self, self->pers_func, pid);
+ pid = _Unpickler_FastCall(self, self->pers_func, pid);
if (pid == NULL)
return -1;
@@ -3720,7 +4595,7 @@ load_binpersid(UnpicklerObject *self)
static int
load_pop(UnpicklerObject *self)
{
- int len = self->stack->length;
+ int len = Py_SIZE(self->stack);
/* Note that we split the (pickle.py) stack into two stacks,
* an object stack and a mark stack. We have to be clever and
@@ -3734,7 +4609,7 @@ load_pop(UnpicklerObject *self)
} else if (len > 0) {
len--;
Py_DECREF(self->stack->data[len]);
- self->stack->length = len;
+ Py_SIZE(self->stack) = len;
} else {
return stack_underflow();
}
@@ -3760,7 +4635,7 @@ load_dup(UnpicklerObject *self)
PyObject *last;
int len;
- if ((len = self->stack->length) <= 0)
+ if ((len = Py_SIZE(self->stack)) <= 0)
return stack_underflow();
last = self->stack->data[len - 1];
PDATA_APPEND(self->stack, last, -1);
@@ -3771,10 +4646,11 @@ static int
load_get(UnpicklerObject *self)
{
PyObject *key, *value;
+ Py_ssize_t idx;
Py_ssize_t len;
char *s;
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 2)
return bad_readline();
@@ -3782,8 +4658,13 @@ load_get(UnpicklerObject *self)
key = PyLong_FromString(s, NULL, 10);
if (key == NULL)
return -1;
+ idx = PyLong_AsSsize_t(key);
+ if (idx == -1 && PyErr_Occurred()) {
+ Py_DECREF(key);
+ return -1;
+ }
- value = PyDict_GetItemWithError(self->memo, key);
+ value = _Unpickler_MemoGet(self, idx);
if (value == NULL) {
if (!PyErr_Occurred())
PyErr_SetObject(PyExc_KeyError, key);
@@ -3799,25 +4680,23 @@ load_get(UnpicklerObject *self)
static int
load_binget(UnpicklerObject *self)
{
- PyObject *key, *value;
+ PyObject *value;
+ Py_ssize_t idx;
char *s;
- if (unpickler_read(self, &s, 1) < 0)
+ if (_Unpickler_Read(self, &s, 1) < 0)
return -1;
- /* Here, the unsigned cast is necessary to avoid negative values. */
- key = PyLong_FromLong((long)(unsigned char)s[0]);
- if (key == NULL)
- return -1;
+ idx = Py_CHARMASK(s[0]);
- value = PyDict_GetItemWithError(self->memo, key);
+ value = _Unpickler_MemoGet(self, idx);
if (value == NULL) {
+ PyObject *key = PyLong_FromSsize_t(idx);
if (!PyErr_Occurred())
PyErr_SetObject(PyExc_KeyError, key);
Py_DECREF(key);
return -1;
}
- Py_DECREF(key);
PDATA_APPEND(self->stack, value, -1);
return 0;
@@ -3826,30 +4705,26 @@ load_binget(UnpicklerObject *self)
static int
load_long_binget(UnpicklerObject *self)
{
- PyObject *key, *value;
+ PyObject *value;
+ Py_ssize_t idx;
char *s;
- long k;
- if (unpickler_read(self, &s, 4) < 0)
+ if (_Unpickler_Read(self, &s, 4) < 0)
return -1;
- k = (long)(unsigned char)s[0];
- k |= (long)(unsigned char)s[1] << 8;
- k |= (long)(unsigned char)s[2] << 16;
- k |= (long)(unsigned char)s[3] << 24;
+ idx = (long)Py_CHARMASK(s[0]);
+ idx |= (long)Py_CHARMASK(s[1]) << 8;
+ idx |= (long)Py_CHARMASK(s[2]) << 16;
+ idx |= (long)Py_CHARMASK(s[3]) << 24;
- key = PyLong_FromLong(k);
- if (key == NULL)
- return -1;
-
- value = PyDict_GetItemWithError(self->memo, key);
+ value = _Unpickler_MemoGet(self, idx);
if (value == NULL) {
+ PyObject *key = PyLong_FromSsize_t(idx);
if (!PyErr_Occurred())
PyErr_SetObject(PyExc_KeyError, key);
Py_DECREF(key);
return -1;
}
- Py_DECREF(key);
PDATA_APPEND(self->stack, value, -1);
return 0;
@@ -3869,7 +4744,7 @@ load_extension(UnpicklerObject *self, int nbytes)
PyObject *module_name, *class_name;
assert(nbytes == 1 || nbytes == 2 || nbytes == 4);
- if (unpickler_read(self, &codebytes, nbytes) < 0)
+ if (_Unpickler_Read(self, &codebytes, nbytes) < 0)
return -1;
code = calc_binint(codebytes, nbytes);
if (code <= 0) { /* note that 0 is forbidden */
@@ -3930,75 +4805,68 @@ static int
load_put(UnpicklerObject *self)
{
PyObject *key, *value;
+ Py_ssize_t idx;
Py_ssize_t len;
char *s;
- int x;
- if ((len = unpickler_readline(self, &s)) < 0)
+ if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
if (len < 2)
return bad_readline();
- if ((x = self->stack->length) <= 0)
+ if (Py_SIZE(self->stack) <= 0)
return stack_underflow();
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
key = PyLong_FromString(s, NULL, 10);
if (key == NULL)
return -1;
- value = self->stack->data[x - 1];
-
- x = PyDict_SetItem(self->memo, key, value);
+ idx = PyLong_AsSsize_t(key);
Py_DECREF(key);
- return x;
+ if (idx == -1 && PyErr_Occurred())
+ return -1;
+
+ return _Unpickler_MemoPut(self, idx, value);
}
static int
load_binput(UnpicklerObject *self)
{
- PyObject *key, *value;
+ PyObject *value;
+ Py_ssize_t idx;
char *s;
- int x;
- if (unpickler_read(self, &s, 1) < 0)
+ if (_Unpickler_Read(self, &s, 1) < 0)
return -1;
- if ((x = self->stack->length) <= 0)
+
+ if (Py_SIZE(self->stack) <= 0)
return stack_underflow();
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
- key = PyLong_FromLong((long)(unsigned char)s[0]);
- if (key == NULL)
- return -1;
- value = self->stack->data[x - 1];
+ idx = Py_CHARMASK(s[0]);
- x = PyDict_SetItem(self->memo, key, value);
- Py_DECREF(key);
- return x;
+ return _Unpickler_MemoPut(self, idx, value);
}
static int
load_long_binput(UnpicklerObject *self)
{
- PyObject *key, *value;
- long k;
+ PyObject *value;
+ Py_ssize_t idx;
char *s;
- int x;
- if (unpickler_read(self, &s, 4) < 0)
+ if (_Unpickler_Read(self, &s, 4) < 0)
return -1;
- if ((x = self->stack->length) <= 0)
- return stack_underflow();
- k = (long)(unsigned char)s[0];
- k |= (long)(unsigned char)s[1] << 8;
- k |= (long)(unsigned char)s[2] << 16;
- k |= (long)(unsigned char)s[3] << 24;
+ if (Py_SIZE(self->stack) <= 0)
+ return stack_underflow();
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
- key = PyLong_FromLong(k);
- if (key == NULL)
- return -1;
- value = self->stack->data[x - 1];
+ idx = (long)Py_CHARMASK(s[0]);
+ idx |= (long)Py_CHARMASK(s[1]) << 8;
+ idx |= (long)Py_CHARMASK(s[2]) << 16;
+ idx |= (long)Py_CHARMASK(s[3]) << 24;
- x = PyDict_SetItem(self->memo, key, value);
- Py_DECREF(key);
- return x;
+ return _Unpickler_MemoPut(self, idx, value);
}
static int
@@ -4008,7 +4876,7 @@ do_append(UnpicklerObject *self, int x)
PyObject *list;
int len, i;
- len = self->stack->length;
+ len = Py_SIZE(self->stack);
if (x > len || x <= 0)
return stack_underflow();
if (len == x) /* nothing to do */
@@ -4038,15 +4906,15 @@ do_append(UnpicklerObject *self, int x)
PyObject *result;
value = self->stack->data[i];
- result = unpickler_call(self, append_func, value);
+ result = _Unpickler_FastCall(self, append_func, value);
if (result == NULL) {
Pdata_clear(self->stack, i + 1);
- self->stack->length = x;
+ Py_SIZE(self->stack) = x;
return -1;
}
Py_DECREF(result);
}
- self->stack->length = x;
+ Py_SIZE(self->stack) = x;
}
return 0;
@@ -4055,7 +4923,7 @@ do_append(UnpicklerObject *self, int x)
static int
load_append(UnpicklerObject *self)
{
- return do_append(self, self->stack->length - 1);
+ return do_append(self, Py_SIZE(self->stack) - 1);
}
static int
@@ -4072,7 +4940,7 @@ do_setitems(UnpicklerObject *self, int x)
int len, i;
int status = 0;
- len = self->stack->length;
+ len = Py_SIZE(self->stack);
if (x > len || x <= 0)
return stack_underflow();
if (len == x) /* nothing to do */
@@ -4103,7 +4971,7 @@ do_setitems(UnpicklerObject *self, int x)
static int
load_setitem(UnpicklerObject *self)
{
- return do_setitems(self, self->stack->length - 2);
+ return do_setitems(self, Py_SIZE(self->stack) - 2);
}
static int
@@ -4122,14 +4990,14 @@ load_build(UnpicklerObject *self)
/* Stack is ... instance, state. We want to leave instance at
* the stack top, possibly mutated via instance.__setstate__(state).
*/
- if (self->stack->length < 2)
+ if (Py_SIZE(self->stack) < 2)
return stack_underflow();
PDATA_POP(self->stack, state);
if (state == NULL)
return -1;
- inst = self->stack->data[self->stack->length - 1];
+ inst = self->stack->data[Py_SIZE(self->stack) - 1];
setstate = PyObject_GetAttrString(inst, "__setstate__");
if (setstate == NULL) {
@@ -4144,9 +5012,9 @@ load_build(UnpicklerObject *self)
PyObject *result;
/* The explicit __setstate__ is responsible for everything. */
- /* Ugh... this does not leak since unpickler_call() steals the
+ /* Ugh... this does not leak since _Unpickler_FastCall() steals the
reference to state first. */
- result = unpickler_call(self, setstate, state);
+ result = _Unpickler_FastCall(self, setstate, state);
Py_DECREF(setstate);
if (result == NULL)
return -1;
@@ -4259,7 +5127,7 @@ load_mark(UnpicklerObject *self)
self->marks_size = (Py_ssize_t)alloc;
}
- self->marks[self->num_marks++] = self->stack->length;
+ self->marks[self->num_marks++] = Py_SIZE(self->stack);
return 0;
}
@@ -4297,7 +5165,7 @@ load_proto(UnpicklerObject *self)
char *s;
int i;
- if (unpickler_read(self, &s, 1) < 0)
+ if (_Unpickler_Read(self, &s, 1) < 0)
return -1;
i = (unsigned char)s[0];
@@ -4318,7 +5186,7 @@ load(UnpicklerObject *self)
char *s;
self->num_marks = 0;
- if (self->stack->length)
+ if (Py_SIZE(self->stack))
Pdata_clear(self->stack, 0);
/* Convenient macros for the dispatch while-switch loop just below. */
@@ -4329,7 +5197,7 @@ load(UnpicklerObject *self)
case opcode: if (load_func(self, (arg)) < 0) break; continue;
while (1) {
- if (unpickler_read(self, &s, 1) < 0)
+ if (_Unpickler_Read(self, &s, 1) < 0)
break;
switch ((enum opcode)s[0]) {
@@ -4404,6 +5272,9 @@ load(UnpicklerObject *self)
break; /* and we are done! */
}
+ if (_Unpickler_SkipConsumed(self) < 0)
+ return NULL;
+
/* XXX: It is not clear what this is actually for. */
if ((err = PyErr_Occurred())) {
if (err == PyExc_EOFError) {
@@ -4553,13 +5424,18 @@ Unpickler_dealloc(UnpicklerObject *self)
PyObject_GC_UnTrack((PyObject *)self);
Py_XDECREF(self->readline);
Py_XDECREF(self->read);
- Py_XDECREF(self->memo);
+ Py_XDECREF(self->peek);
Py_XDECREF(self->stack);
Py_XDECREF(self->pers_func);
Py_XDECREF(self->arg);
- Py_XDECREF(self->last_string);
+ if (self->buffer.buf != NULL) {
+ PyBuffer_Release(&self->buffer);
+ self->buffer.buf = NULL;
+ }
+ _Unpickler_MemoCleanup(self);
PyMem_Free(self->marks);
+ PyMem_Free(self->input_line);
free(self->encoding);
free(self->errors);
@@ -4571,11 +5447,10 @@ Unpickler_traverse(UnpicklerObject *self, visitproc visit, void *arg)
{
Py_VISIT(self->readline);
Py_VISIT(self->read);
- Py_VISIT(self->memo);
+ Py_VISIT(self->peek);
Py_VISIT(self->stack);
Py_VISIT(self->pers_func);
Py_VISIT(self->arg);
- Py_VISIT(self->last_string);
return 0;
}
@@ -4584,14 +5459,20 @@ Unpickler_clear(UnpicklerObject *self)
{
Py_CLEAR(self->readline);
Py_CLEAR(self->read);
- Py_CLEAR(self->memo);
+ Py_CLEAR(self->peek);
Py_CLEAR(self->stack);
Py_CLEAR(self->pers_func);
Py_CLEAR(self->arg);
- Py_CLEAR(self->last_string);
+ if (self->buffer.buf != NULL) {
+ PyBuffer_Release(&self->buffer);
+ self->buffer.buf = NULL;
+ }
+ _Unpickler_MemoCleanup(self);
PyMem_Free(self->marks);
self->marks = NULL;
+ PyMem_Free(self->input_line);
+ self->input_line = NULL;
free(self->encoding);
self->encoding = NULL;
free(self->errors);
@@ -4628,7 +5509,7 @@ Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {"file", "fix_imports", "encoding", "errors", 0};
PyObject *file;
- int fix_imports = 1;
+ PyObject *fix_imports = Py_True;
char *encoding = NULL;
char *errors = NULL;
@@ -4647,7 +5528,7 @@ Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
extra careful in the other Unpickler methods, since a subclass could
forget to call Unpickler.__init__() thus breaking our internal
invariants. */
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|iss:Unpickler", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oss:Unpickler", kwlist,
&file, &fix_imports, &encoding, &errors))
return -1;
@@ -4655,22 +5536,15 @@ Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
if (self->read != NULL)
(void)Unpickler_clear(self);
- self->read = PyObject_GetAttrString(file, "read");
- self->readline = PyObject_GetAttrString(file, "readline");
- if (self->readline == NULL || self->read == NULL)
+ if (_Unpickler_SetInputStream(self, file) < 0)
return -1;
- if (encoding == NULL)
- encoding = "ASCII";
- if (errors == NULL)
- errors = "strict";
+ if (_Unpickler_SetInputEncoding(self, encoding, errors) < 0)
+ return -1;
- self->encoding = strdup(encoding);
- self->errors = strdup(errors);
- if (self->encoding == NULL || self->errors == NULL) {
- PyErr_NoMemory();
+ self->fix_imports = PyObject_IsTrue(fix_imports);
+ if (self->fix_imports == -1)
return -1;
- }
if (PyObject_HasAttrString((PyObject *)self, "persistent_load")) {
self->pers_func = PyObject_GetAttrString((PyObject *)self,
@@ -4686,49 +5560,269 @@ Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
if (self->stack == NULL)
return -1;
- self->memo = PyDict_New();
+ self->memo_size = 32;
+ self->memo = _Unpickler_NewMemo(self->memo_size);
if (self->memo == NULL)
return -1;
- self->last_string = NULL;
self->arg = NULL;
self->proto = 0;
- self->fix_imports = fix_imports;
return 0;
}
+/* Define a proxy object for the Unpickler's internal memo object. This is to
+ * avoid breaking code like:
+ * unpickler.memo.clear()
+ * and
+ * unpickler.memo = saved_memo
+ * Is this a good idea? Not really, but we don't want to break code that uses
+ * it. Note that we don't implement the entire mapping API here. This is
+ * intentional, as these should be treated as black-box implementation details.
+ *
+ * We do, however, have to implement pickling/unpickling support because of
+ * real-world code like cvs2svn.
+ */
+
+typedef struct {
+ PyObject_HEAD
+ UnpicklerObject *unpickler;
+} UnpicklerMemoProxyObject;
+
+PyDoc_STRVAR(ump_clear_doc,
+"memo.clear() -> None. Remove all items from memo.");
+
+static PyObject *
+ump_clear(UnpicklerMemoProxyObject *self)
+{
+ _Unpickler_MemoCleanup(self->unpickler);
+ self->unpickler->memo = _Unpickler_NewMemo(self->unpickler->memo_size);
+ if (self->unpickler->memo == NULL)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(ump_copy_doc,
+"memo.copy() -> new_memo. Copy the memo to a new object.");
+
+static PyObject *
+ump_copy(UnpicklerMemoProxyObject *self)
+{
+ Py_ssize_t i;
+ PyObject *new_memo = PyDict_New();
+ if (new_memo == NULL)
+ return NULL;
+
+ for (i = 0; i < self->unpickler->memo_size; i++) {
+ int status;
+ PyObject *key, *value;
+
+ value = self->unpickler->memo[i];
+ if (value == NULL)
+ continue;
+
+ key = PyLong_FromSsize_t(i);
+ if (key == NULL)
+ goto error;
+ status = PyDict_SetItem(new_memo, key, value);
+ Py_DECREF(key);
+ if (status < 0)
+ goto error;
+ }
+ return new_memo;
+
+error:
+ Py_DECREF(new_memo);
+ return NULL;
+}
+
+PyDoc_STRVAR(ump_reduce_doc,
+"memo.__reduce__(). Pickling support.");
+
+static PyObject *
+ump_reduce(UnpicklerMemoProxyObject *self, PyObject *args)
+{
+ PyObject *reduce_value;
+ PyObject *constructor_args;
+ PyObject *contents = ump_copy(self);
+ if (contents == NULL)
+ return NULL;
+
+ reduce_value = PyTuple_New(2);
+ if (reduce_value == NULL) {
+ Py_DECREF(contents);
+ return NULL;
+ }
+ constructor_args = PyTuple_New(1);
+ if (constructor_args == NULL) {
+ Py_DECREF(contents);
+ Py_DECREF(reduce_value);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(constructor_args, 0, contents);
+ Py_INCREF((PyObject *)&PyDict_Type);
+ PyTuple_SET_ITEM(reduce_value, 0, (PyObject *)&PyDict_Type);
+ PyTuple_SET_ITEM(reduce_value, 1, constructor_args);
+ return reduce_value;
+}
+
+static PyMethodDef unpicklerproxy_methods[] = {
+ {"clear", (PyCFunction)ump_clear, METH_NOARGS, ump_clear_doc},
+ {"copy", (PyCFunction)ump_copy, METH_NOARGS, ump_copy_doc},
+ {"__reduce__", (PyCFunction)ump_reduce, METH_VARARGS, ump_reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static void
+UnpicklerMemoProxy_dealloc(UnpicklerMemoProxyObject *self)
+{
+ PyObject_GC_UnTrack(self);
+ Py_XDECREF(self->unpickler);
+ PyObject_GC_Del((PyObject *)self);
+}
+
+static int
+UnpicklerMemoProxy_traverse(UnpicklerMemoProxyObject *self,
+ visitproc visit, void *arg)
+{
+ Py_VISIT(self->unpickler);
+ return 0;
+}
+
+static int
+UnpicklerMemoProxy_clear(UnpicklerMemoProxyObject *self)
+{
+ Py_CLEAR(self->unpickler);
+ return 0;
+}
+
+static PyTypeObject UnpicklerMemoProxyType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_pickle.UnpicklerMemoProxy", /*tp_name*/
+ sizeof(UnpicklerMemoProxyObject), /*tp_basicsize*/
+ 0,
+ (destructor)UnpicklerMemoProxy_dealloc, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ PyObject_HashNotImplemented, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ PyObject_GenericSetAttr, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
+ 0, /* tp_doc */
+ (traverseproc)UnpicklerMemoProxy_traverse, /* tp_traverse */
+ (inquiry)UnpicklerMemoProxy_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ unpicklerproxy_methods, /* tp_methods */
+};
+
+static PyObject *
+UnpicklerMemoProxy_New(UnpicklerObject *unpickler)
+{
+ UnpicklerMemoProxyObject *self;
+
+ self = PyObject_GC_New(UnpicklerMemoProxyObject,
+ &UnpicklerMemoProxyType);
+ if (self == NULL)
+ return NULL;
+ Py_INCREF(unpickler);
+ self->unpickler = unpickler;
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+}
+
+/*****************************************************************************/
+
+
static PyObject *
Unpickler_get_memo(UnpicklerObject *self)
{
- if (self->memo == NULL)
- PyErr_SetString(PyExc_AttributeError, "memo");
- else
- Py_INCREF(self->memo);
- return self->memo;
+ return UnpicklerMemoProxy_New(self);
}
static int
-Unpickler_set_memo(UnpicklerObject *self, PyObject *value)
+Unpickler_set_memo(UnpicklerObject *self, PyObject *obj)
{
- PyObject *tmp;
+ PyObject **new_memo;
+ Py_ssize_t new_memo_size = 0;
+ Py_ssize_t i;
- if (value == NULL) {
+ if (obj == NULL) {
PyErr_SetString(PyExc_TypeError,
"attribute deletion is not supported");
return -1;
}
- if (!PyDict_Check(value)) {
- PyErr_SetString(PyExc_TypeError, "memo must be a dictionary");
+
+ if (Py_TYPE(obj) == &UnpicklerMemoProxyType) {
+ UnpicklerObject *unpickler =
+ ((UnpicklerMemoProxyObject *)obj)->unpickler;
+
+ new_memo_size = unpickler->memo_size;
+ new_memo = _Unpickler_NewMemo(new_memo_size);
+ if (new_memo == NULL)
+ return -1;
+
+ for (i = 0; i < new_memo_size; i++) {
+ Py_XINCREF(unpickler->memo[i]);
+ new_memo[i] = unpickler->memo[i];
+ }
+ }
+ else if (PyDict_Check(obj)) {
+ Py_ssize_t i = 0;
+ PyObject *key, *value;
+
+ new_memo_size = PyDict_Size(obj);
+ new_memo = _Unpickler_NewMemo(new_memo_size);
+ if (new_memo == NULL)
+ return -1;
+
+ while (PyDict_Next(obj, &i, &key, &value)) {
+ Py_ssize_t idx;
+ if (!PyLong_Check(key)) {
+ PyErr_SetString(PyExc_TypeError,
+ "memo key must be integers");
+ goto error;
+ }
+ idx = PyLong_AsSsize_t(key);
+ if (idx == -1 && PyErr_Occurred())
+ goto error;
+ if (_Unpickler_MemoPut(self, idx, value) < 0)
+ goto error;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "'memo' attribute must be an UnpicklerMemoProxy object"
+ "or dict, not %.200s", Py_TYPE(obj)->tp_name);
return -1;
}
- tmp = self->memo;
- Py_INCREF(value);
- self->memo = value;
- Py_XDECREF(tmp);
+ _Unpickler_MemoCleanup(self);
+ self->memo_size = new_memo_size;
+ self->memo = new_memo;
return 0;
+
+ error:
+ if (new_memo_size) {
+ i = new_memo_size;
+ while (--i >= 0) {
+ Py_XDECREF(new_memo[i]);
+ }
+ PyMem_FREE(new_memo);
+ }
+ return -1;
}
static PyObject *
@@ -4781,7 +5875,7 @@ static PyTypeObject Unpickler_Type = {
(destructor)Unpickler_dealloc, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
- 0, /*tp_setattr*/
+ 0, /*tp_setattr*/
0, /*tp_reserved*/
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -4816,6 +5910,280 @@ static PyTypeObject Unpickler_Type = {
0, /*tp_is_gc*/
};
+PyDoc_STRVAR(pickle_dump_doc,
+"dump(obj, file, protocol=None, *, fix_imports=True) -> None\n"
+"\n"
+"Write a pickled representation of obj to the open file object file. This\n"
+"is equivalent to ``Pickler(file, protocol).dump(obj)``, but may be more\n"
+"efficient.\n"
+"\n"
+"The optional protocol argument tells the pickler to use the given protocol;\n"
+"supported protocols are 0, 1, 2, 3. The default protocol is 3; a\n"
+"backward-incompatible protocol designed for Python 3.0.\n"
+"\n"
+"Specifying a negative protocol version selects the highest protocol version\n"
+"supported. The higher the protocol used, the more recent the version of\n"
+"Python needed to read the pickle produced.\n"
+"\n"
+"The file argument must have a write() method that accepts a single bytes\n"
+"argument. It can thus be a file object opened for binary writing, a\n"
+"io.BytesIO instance, or any other custom object that meets this interface.\n"
+"\n"
+"If fix_imports is True and protocol is less than 3, pickle will try to\n"
+"map the new Python 3.x names to the old module names used in Python 2.x,\n"
+"so that the pickle data stream is readable with Python 2.x.\n");
+
+static PyObject *
+pickle_dump(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"obj", "file", "protocol", "fix_imports", 0};
+ PyObject *obj;
+ PyObject *file;
+ PyObject *proto = NULL;
+ PyObject *fix_imports = Py_True;
+ PicklerObject *pickler;
+
+ /* fix_imports is a keyword-only argument. */
+ if (Py_SIZE(args) > 3) {
+ PyErr_Format(PyExc_TypeError,
+ "pickle.dump() takes at most 3 positional "
+ "argument (%zd given)", Py_SIZE(args));
+ return NULL;
+ }
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|OO:dump", kwlist,
+ &obj, &file, &proto, &fix_imports))
+ return NULL;
+
+ pickler = _Pickler_New();
+ if (pickler == NULL)
+ return NULL;
+
+ if (_Pickler_SetProtocol(pickler, proto, fix_imports) < 0)
+ goto error;
+
+ if (_Pickler_SetOutputStream(pickler, file) < 0)
+ goto error;
+
+ if (dump(pickler, obj) < 0)
+ goto error;
+
+ if (_Pickler_FlushToFile(pickler) < 0)
+ goto error;
+
+ Py_DECREF(pickler);
+ Py_RETURN_NONE;
+
+ error:
+ Py_XDECREF(pickler);
+ return NULL;
+}
+
+PyDoc_STRVAR(pickle_dumps_doc,
+"dumps(obj, protocol=None, *, fix_imports=True) -> bytes\n"
+"\n"
+"Return the pickled representation of the object as a bytes\n"
+"object, instead of writing it to a file.\n"
+"\n"
+"The optional protocol argument tells the pickler to use the given protocol;\n"
+"supported protocols are 0, 1, 2, 3. The default protocol is 3; a\n"
+"backward-incompatible protocol designed for Python 3.0.\n"
+"\n"
+"Specifying a negative protocol version selects the highest protocol version\n"
+"supported. The higher the protocol used, the more recent the version of\n"
+"Python needed to read the pickle produced.\n"
+"\n"
+"If fix_imports is True and *protocol* is less than 3, pickle will try to\n"
+"map the new Python 3.x names to the old module names used in Python 2.x,\n"
+"so that the pickle data stream is readable with Python 2.x.\n");
+
+static PyObject *
+pickle_dumps(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"obj", "protocol", "fix_imports", 0};
+ PyObject *obj;
+ PyObject *proto = NULL;
+ PyObject *result;
+ PyObject *fix_imports = Py_True;
+ PicklerObject *pickler;
+
+ /* fix_imports is a keyword-only argument. */
+ if (Py_SIZE(args) > 2) {
+ PyErr_Format(PyExc_TypeError,
+ "pickle.dumps() takes at most 2 positional "
+ "argument (%zd given)", Py_SIZE(args));
+ return NULL;
+ }
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:dumps", kwlist,
+ &obj, &proto, &fix_imports))
+ return NULL;
+
+ pickler = _Pickler_New();
+ if (pickler == NULL)
+ return NULL;
+
+ if (_Pickler_SetProtocol(pickler, proto, fix_imports) < 0)
+ goto error;
+
+ if (dump(pickler, obj) < 0)
+ goto error;
+
+ result = _Pickler_GetString(pickler);
+ Py_DECREF(pickler);
+ return result;
+
+ error:
+ Py_XDECREF(pickler);
+ return NULL;
+}
+
+PyDoc_STRVAR(pickle_load_doc,
+"load(file, *, fix_imports=True, encoding='ASCII', errors='strict') -> object\n"
+"\n"
+"Read a pickled object representation from the open file object file and\n"
+"return the reconstituted object hierarchy specified therein. This is\n"
+"equivalent to ``Unpickler(file).load()``, but may be more efficient.\n"
+"\n"
+"The protocol version of the pickle is detected automatically, so no protocol\n"
+"argument is needed. Bytes past the pickled object's representation are\n"
+"ignored.\n"
+"\n"
+"The argument file must have two methods, a read() method that takes an\n"
+"integer argument, and a readline() method that requires no arguments. Both\n"
+"methods should return bytes. Thus *file* can be a binary file object opened\n"
+"for reading, a BytesIO object, or any other custom object that meets this\n"
+"interface.\n"
+"\n"
+"Optional keyword arguments are fix_imports, encoding and errors,\n"
+"which are used to control compatiblity support for pickle stream generated\n"
+"by Python 2.x. If fix_imports is True, pickle will try to map the old\n"
+"Python 2.x names to the new names used in Python 3.x. The encoding and\n"
+"errors tell pickle how to decode 8-bit string instances pickled by Python\n"
+"2.x; these default to 'ASCII' and 'strict', respectively.\n");
+
+static PyObject *
+pickle_load(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"file", "fix_imports", "encoding", "errors", 0};
+ PyObject *file;
+ PyObject *fix_imports = Py_True;
+ PyObject *result;
+ char *encoding = NULL;
+ char *errors = NULL;
+ UnpicklerObject *unpickler;
+
+ /* fix_imports, encoding and errors are a keyword-only argument. */
+ if (Py_SIZE(args) != 1) {
+ PyErr_Format(PyExc_TypeError,
+ "pickle.load() takes exactly one positional "
+ "argument (%zd given)", Py_SIZE(args));
+ return NULL;
+ }
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oss:load", kwlist,
+ &file, &fix_imports, &encoding, &errors))
+ return NULL;
+
+ unpickler = _Unpickler_New();
+ if (unpickler == NULL)
+ return NULL;
+
+ if (_Unpickler_SetInputStream(unpickler, file) < 0)
+ goto error;
+
+ if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
+ goto error;
+
+ unpickler->fix_imports = PyObject_IsTrue(fix_imports);
+ if (unpickler->fix_imports == -1)
+ goto error;
+
+ result = load(unpickler);
+ Py_DECREF(unpickler);
+ return result;
+
+ error:
+ Py_XDECREF(unpickler);
+ return NULL;
+}
+
+PyDoc_STRVAR(pickle_loads_doc,
+"loads(input, *, fix_imports=True, encoding='ASCII', errors='strict') -> object\n"
+"\n"
+"Read a pickled object hierarchy from a bytes object and return the\n"
+"reconstituted object hierarchy specified therein\n"
+"\n"
+"The protocol version of the pickle is detected automatically, so no protocol\n"
+"argument is needed. Bytes past the pickled object's representation are\n"
+"ignored.\n"
+"\n"
+"Optional keyword arguments are fix_imports, encoding and errors, which\n"
+"are used to control compatiblity support for pickle stream generated\n"
+"by Python 2.x. If fix_imports is True, pickle will try to map the old\n"
+"Python 2.x names to the new names used in Python 3.x. The encoding and\n"
+"errors tell pickle how to decode 8-bit string instances pickled by Python\n"
+"2.x; these default to 'ASCII' and 'strict', respectively.\n");
+
+static PyObject *
+pickle_loads(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"input", "fix_imports", "encoding", "errors", 0};
+ PyObject *input;
+ PyObject *fix_imports = Py_True;
+ PyObject *result;
+ char *encoding = NULL;
+ char *errors = NULL;
+ UnpicklerObject *unpickler;
+
+ /* fix_imports, encoding and errors are a keyword-only argument. */
+ if (Py_SIZE(args) != 1) {
+ PyErr_Format(PyExc_TypeError,
+ "pickle.loads() takes exactly one positional "
+ "argument (%zd given)", Py_SIZE(args));
+ return NULL;
+ }
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oss:loads", kwlist,
+ &input, &fix_imports, &encoding, &errors))
+ return NULL;
+
+ unpickler = _Unpickler_New();
+ if (unpickler == NULL)
+ return NULL;
+
+ if (_Unpickler_SetStringInput(unpickler, input) < 0)
+ goto error;
+
+ if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
+ goto error;
+
+ unpickler->fix_imports = PyObject_IsTrue(fix_imports);
+ if (unpickler->fix_imports == -1)
+ goto error;
+
+ result = load(unpickler);
+ Py_DECREF(unpickler);
+ return result;
+
+ error:
+ Py_XDECREF(unpickler);
+ return NULL;
+}
+
+
+static struct PyMethodDef pickle_methods[] = {
+ {"dump", (PyCFunction)pickle_dump, METH_VARARGS|METH_KEYWORDS,
+ pickle_dump_doc},
+ {"dumps", (PyCFunction)pickle_dumps, METH_VARARGS|METH_KEYWORDS,
+ pickle_dumps_doc},
+ {"load", (PyCFunction)pickle_load, METH_VARARGS|METH_KEYWORDS,
+ pickle_load_doc},
+ {"loads", (PyCFunction)pickle_loads, METH_VARARGS|METH_KEYWORDS,
+ pickle_loads_doc},
+ {NULL, NULL} /* sentinel */
+};
+
static int
initmodule(void)
{
@@ -4925,7 +6293,7 @@ static struct PyModuleDef _picklemodule = {
"_pickle",
pickle_module_doc,
-1,
- NULL,
+ pickle_methods,
NULL,
NULL,
NULL,
@@ -4943,6 +6311,10 @@ PyInit__pickle(void)
return NULL;
if (PyType_Ready(&Pdata_Type) < 0)
return NULL;
+ if (PyType_Ready(&PicklerMemoProxyType) < 0)
+ return NULL;
+ if (PyType_Ready(&UnpicklerMemoProxyType) < 0)
+ return NULL;
/* Create the module and add the functions. */
m = PyModule_Create(&_picklemodule);
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
new file mode 100644
index 0000000000..bf10cbb43e
--- /dev/null
+++ b/Modules/_posixsubprocess.c
@@ -0,0 +1,501 @@
+/* Authors: Gregory P. Smith & Jeffrey Yasskin */
+#include "Python.h"
+#ifdef HAVE_PIPE2
+#define _GNU_SOURCE
+#endif
+#include <unistd.h>
+#include <fcntl.h>
+
+
+#define POSIX_CALL(call) if ((call) == -1) goto error
+
+
+/* Maximum file descriptor, initialized on module load. */
+static long max_fd;
+
+
+/* Given the gc module call gc.enable() and return 0 on success. */
+static int _enable_gc(PyObject *gc_module)
+{
+ PyObject *result;
+ result = PyObject_CallMethod(gc_module, "enable", NULL);
+ if (result == NULL)
+ return 1;
+ Py_DECREF(result);
+ return 0;
+}
+
+
+/*
+ * This function is code executed in the child process immediately after fork
+ * to set things up and call exec().
+ *
+ * All of the code in this function must only use async-signal-safe functions,
+ * listed at `man 7 signal` or
+ * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html.
+ *
+ * This restriction is documented at
+ * http://www.opengroup.org/onlinepubs/009695399/functions/fork.html.
+ */
+static void child_exec(char *const exec_array[],
+ char *const argv[],
+ char *const envp[],
+ const char *cwd,
+ int p2cread, int p2cwrite,
+ int c2pread, int c2pwrite,
+ int errread, int errwrite,
+ int errpipe_read, int errpipe_write,
+ int close_fds, int restore_signals,
+ int call_setsid, Py_ssize_t num_fds_to_keep,
+ PyObject *py_fds_to_keep,
+ PyObject *preexec_fn,
+ PyObject *preexec_fn_args_tuple)
+{
+ int i, saved_errno, fd_num;
+ PyObject *result;
+ const char* err_msg = "";
+ /* Buffer large enough to hold a hex integer. We can't malloc. */
+ char hex_errno[sizeof(saved_errno)*2+1];
+
+ /* Close parent's pipe ends. */
+ if (p2cwrite != -1) {
+ POSIX_CALL(close(p2cwrite));
+ }
+ if (c2pread != -1) {
+ POSIX_CALL(close(c2pread));
+ }
+ if (errread != -1) {
+ POSIX_CALL(close(errread));
+ }
+ POSIX_CALL(close(errpipe_read));
+
+ /* Dup fds for child.
+ dup2() removes the CLOEXEC flag but we must do it ourselves if dup2()
+ would be a no-op (issue #10806). */
+ if (p2cread == 0) {
+ int old = fcntl(p2cread, F_GETFD);
+ if (old != -1)
+ fcntl(p2cread, F_SETFD, old & ~FD_CLOEXEC);
+ } else if (p2cread != -1) {
+ POSIX_CALL(dup2(p2cread, 0)); /* stdin */
+ }
+ if (c2pwrite == 1) {
+ int old = fcntl(c2pwrite, F_GETFD);
+ if (old != -1)
+ fcntl(c2pwrite, F_SETFD, old & ~FD_CLOEXEC);
+ } else if (c2pwrite != -1) {
+ POSIX_CALL(dup2(c2pwrite, 1)); /* stdout */
+ }
+ if (errwrite == 2) {
+ int old = fcntl(errwrite, F_GETFD);
+ if (old != -1)
+ fcntl(errwrite, F_SETFD, old & ~FD_CLOEXEC);
+ } else if (errwrite != -1) {
+ POSIX_CALL(dup2(errwrite, 2)); /* stderr */
+ }
+
+ /* Close pipe fds. Make sure we don't close the same fd more than */
+ /* once, or standard fds. */
+ if (p2cread > 2) {
+ POSIX_CALL(close(p2cread));
+ }
+ if (c2pwrite > 2 && c2pwrite != p2cread) {
+ POSIX_CALL(close(c2pwrite));
+ }
+ if (errwrite != c2pwrite && errwrite != p2cread && errwrite > 2) {
+ POSIX_CALL(close(errwrite));
+ }
+
+ /* close() is intentionally not checked for errors here as we are closing */
+ /* a large range of fds, some of which may be invalid. */
+ if (close_fds) {
+ Py_ssize_t keep_seq_idx;
+ int start_fd = 3;
+ for (keep_seq_idx = 0; keep_seq_idx < num_fds_to_keep; ++keep_seq_idx) {
+ PyObject* py_keep_fd = PySequence_Fast_GET_ITEM(py_fds_to_keep,
+ keep_seq_idx);
+ int keep_fd = PyLong_AsLong(py_keep_fd);
+ if (keep_fd < 0) { /* Negative number, overflow or not a Long. */
+ err_msg = "bad value in fds_to_keep.";
+ errno = 0; /* We don't want to report an OSError. */
+ goto error;
+ }
+ if (keep_fd < start_fd)
+ continue;
+ for (fd_num = start_fd; fd_num < keep_fd; ++fd_num) {
+ close(fd_num);
+ }
+ start_fd = keep_fd + 1;
+ }
+ if (start_fd <= max_fd) {
+ for (fd_num = start_fd; fd_num < max_fd; ++fd_num) {
+ close(fd_num);
+ }
+ }
+ }
+
+ if (cwd)
+ POSIX_CALL(chdir(cwd));
+
+ if (restore_signals)
+ _Py_RestoreSignals();
+
+#ifdef HAVE_SETSID
+ if (call_setsid)
+ POSIX_CALL(setsid());
+#endif
+
+ if (preexec_fn != Py_None && preexec_fn_args_tuple) {
+ /* This is where the user has asked us to deadlock their program. */
+ result = PyObject_Call(preexec_fn, preexec_fn_args_tuple, NULL);
+ if (result == NULL) {
+ /* Stringifying the exception or traceback would involve
+ * memory allocation and thus potential for deadlock.
+ * We've already faced potential deadlock by calling back
+ * into Python in the first place, so it probably doesn't
+ * matter but we avoid it to minimize the possibility. */
+ err_msg = "Exception occurred in preexec_fn.";
+ errno = 0; /* We don't want to report an OSError. */
+ goto error;
+ }
+ /* Py_DECREF(result); - We're about to exec so why bother? */
+ }
+
+ /* This loop matches the Lib/os.py _execvpe()'s PATH search when */
+ /* given the executable_list generated by Lib/subprocess.py. */
+ saved_errno = 0;
+ for (i = 0; exec_array[i] != NULL; ++i) {
+ const char *executable = exec_array[i];
+ if (envp) {
+ execve(executable, argv, envp);
+ } else {
+ execv(executable, argv);
+ }
+ if (errno != ENOENT && errno != ENOTDIR && saved_errno == 0) {
+ saved_errno = errno;
+ }
+ }
+ /* Report the first exec error, not the last. */
+ if (saved_errno)
+ errno = saved_errno;
+
+error:
+ saved_errno = errno;
+ /* Report the posix error to our parent process. */
+ if (saved_errno) {
+ char *cur;
+ write(errpipe_write, "OSError:", 8);
+ cur = hex_errno + sizeof(hex_errno);
+ while (saved_errno != 0 && cur > hex_errno) {
+ *--cur = "0123456789ABCDEF"[saved_errno % 16];
+ saved_errno /= 16;
+ }
+ write(errpipe_write, cur, hex_errno + sizeof(hex_errno) - cur);
+ write(errpipe_write, ":", 1);
+ /* We can't call strerror(saved_errno). It is not async signal safe.
+ * The parent process will look the error message up. */
+ } else {
+ write(errpipe_write, "RuntimeError:0:", 15);
+ write(errpipe_write, err_msg, strlen(err_msg));
+ }
+}
+
+
+static PyObject *
+subprocess_fork_exec(PyObject* self, PyObject *args)
+{
+ PyObject *gc_module = NULL;
+ PyObject *executable_list, *py_close_fds, *py_fds_to_keep;
+ PyObject *env_list, *preexec_fn;
+ PyObject *process_args, *converted_args = NULL, *fast_args = NULL;
+ PyObject *preexec_fn_args_tuple = NULL;
+ int p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite;
+ int errpipe_read, errpipe_write, close_fds, restore_signals;
+ int call_setsid;
+ PyObject *cwd_obj, *cwd_obj2;
+ const char *cwd;
+ pid_t pid;
+ int need_to_reenable_gc = 0;
+ char *const *exec_array, *const *argv = NULL, *const *envp = NULL;
+ Py_ssize_t arg_num, num_fds_to_keep;
+
+ if (!PyArg_ParseTuple(
+ args, "OOOOOOiiiiiiiiiiO:fork_exec",
+ &process_args, &executable_list, &py_close_fds, &py_fds_to_keep,
+ &cwd_obj, &env_list,
+ &p2cread, &p2cwrite, &c2pread, &c2pwrite,
+ &errread, &errwrite, &errpipe_read, &errpipe_write,
+ &restore_signals, &call_setsid, &preexec_fn))
+ return NULL;
+
+ close_fds = PyObject_IsTrue(py_close_fds);
+ if (close_fds && errpipe_write < 3) { /* precondition */
+ PyErr_SetString(PyExc_ValueError, "errpipe_write must be >= 3");
+ return NULL;
+ }
+ num_fds_to_keep = PySequence_Length(py_fds_to_keep);
+ if (num_fds_to_keep < 0) {
+ PyErr_SetString(PyExc_ValueError, "bad fds_to_keep");
+ return NULL;
+ }
+
+ /* We need to call gc.disable() when we'll be calling preexec_fn */
+ if (preexec_fn != Py_None) {
+ PyObject *result;
+ gc_module = PyImport_ImportModule("gc");
+ if (gc_module == NULL)
+ return NULL;
+ result = PyObject_CallMethod(gc_module, "isenabled", NULL);
+ if (result == NULL) {
+ Py_DECREF(gc_module);
+ return NULL;
+ }
+ need_to_reenable_gc = PyObject_IsTrue(result);
+ Py_DECREF(result);
+ if (need_to_reenable_gc == -1) {
+ Py_DECREF(gc_module);
+ return NULL;
+ }
+ result = PyObject_CallMethod(gc_module, "disable", NULL);
+ if (result == NULL) {
+ Py_DECREF(gc_module);
+ return NULL;
+ }
+ Py_DECREF(result);
+ }
+
+ exec_array = _PySequence_BytesToCharpArray(executable_list);
+ if (!exec_array)
+ return NULL;
+
+ /* Convert args and env into appropriate arguments for exec() */
+ /* These conversions are done in the parent process to avoid allocating
+ or freeing memory in the child process. */
+ if (process_args != Py_None) {
+ Py_ssize_t num_args;
+ /* Equivalent to: */
+ /* tuple(PyUnicode_FSConverter(arg) for arg in process_args) */
+ fast_args = PySequence_Fast(process_args, "argv must be a tuple");
+ num_args = PySequence_Fast_GET_SIZE(fast_args);
+ converted_args = PyTuple_New(num_args);
+ if (converted_args == NULL)
+ goto cleanup;
+ for (arg_num = 0; arg_num < num_args; ++arg_num) {
+ PyObject *borrowed_arg, *converted_arg;
+ borrowed_arg = PySequence_Fast_GET_ITEM(fast_args, arg_num);
+ if (PyUnicode_FSConverter(borrowed_arg, &converted_arg) == 0)
+ goto cleanup;
+ PyTuple_SET_ITEM(converted_args, arg_num, converted_arg);
+ }
+
+ argv = _PySequence_BytesToCharpArray(converted_args);
+ Py_CLEAR(converted_args);
+ Py_CLEAR(fast_args);
+ if (!argv)
+ goto cleanup;
+ }
+
+ if (env_list != Py_None) {
+ envp = _PySequence_BytesToCharpArray(env_list);
+ if (!envp)
+ goto cleanup;
+ }
+
+ if (preexec_fn != Py_None) {
+ preexec_fn_args_tuple = PyTuple_New(0);
+ if (!preexec_fn_args_tuple)
+ goto cleanup;
+ _PyImport_AcquireLock();
+ }
+
+ if (cwd_obj != Py_None) {
+ if (PyUnicode_FSConverter(cwd_obj, &cwd_obj2) == 0)
+ goto cleanup;
+ cwd = PyBytes_AsString(cwd_obj2);
+ } else {
+ cwd = NULL;
+ cwd_obj2 = NULL;
+ }
+
+ pid = fork();
+ if (pid == 0) {
+ /* Child process */
+ /*
+ * Code from here to _exit() must only use async-signal-safe functions,
+ * listed at `man 7 signal` or
+ * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html.
+ */
+
+ if (preexec_fn != Py_None) {
+ /* We'll be calling back into Python later so we need to do this.
+ * This call may not be async-signal-safe but neither is calling
+ * back into Python. The user asked us to use hope as a strategy
+ * to avoid deadlock... */
+ PyOS_AfterFork();
+ }
+
+ child_exec(exec_array, argv, envp, cwd,
+ p2cread, p2cwrite, c2pread, c2pwrite,
+ errread, errwrite, errpipe_read, errpipe_write,
+ close_fds, restore_signals, call_setsid,
+ num_fds_to_keep, py_fds_to_keep,
+ preexec_fn, preexec_fn_args_tuple);
+ _exit(255);
+ return NULL; /* Dead code to avoid a potential compiler warning. */
+ }
+ Py_XDECREF(cwd_obj2);
+
+ if (pid == -1) {
+ /* Capture the errno exception before errno can be clobbered. */
+ PyErr_SetFromErrno(PyExc_OSError);
+ }
+ if (preexec_fn != Py_None &&
+ _PyImport_ReleaseLock() < 0 && !PyErr_Occurred()) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "not holding the import lock");
+ }
+
+ /* Parent process */
+ if (envp)
+ _Py_FreeCharPArray(envp);
+ if (argv)
+ _Py_FreeCharPArray(argv);
+ _Py_FreeCharPArray(exec_array);
+
+ /* Reenable gc in the parent process (or if fork failed). */
+ if (need_to_reenable_gc && _enable_gc(gc_module)) {
+ Py_XDECREF(gc_module);
+ return NULL;
+ }
+ Py_XDECREF(preexec_fn_args_tuple);
+ Py_XDECREF(gc_module);
+
+ if (pid == -1)
+ return NULL; /* fork() failed. Exception set earlier. */
+
+ return PyLong_FromPid(pid);
+
+cleanup:
+ if (envp)
+ _Py_FreeCharPArray(envp);
+ if (argv)
+ _Py_FreeCharPArray(argv);
+ _Py_FreeCharPArray(exec_array);
+ Py_XDECREF(converted_args);
+ Py_XDECREF(fast_args);
+ Py_XDECREF(preexec_fn_args_tuple);
+
+ /* Reenable gc if it was disabled. */
+ if (need_to_reenable_gc)
+ _enable_gc(gc_module);
+ Py_XDECREF(gc_module);
+ return NULL;
+}
+
+
+PyDoc_STRVAR(subprocess_fork_exec_doc,
+"fork_exec(args, executable_list, close_fds, cwd, env,\n\
+ p2cread, p2cwrite, c2pread, c2pwrite,\n\
+ errread, errwrite, errpipe_read, errpipe_write,\n\
+ restore_signals, call_setsid, preexec_fn)\n\
+\n\
+Forks a child process, closes parent file descriptors as appropriate in the\n\
+child and dups the few that are needed before calling exec() in the child\n\
+process.\n\
+\n\
+The preexec_fn, if supplied, will be called immediately before exec.\n\
+WARNING: preexec_fn is NOT SAFE if your application uses threads.\n\
+ It may trigger infrequent, difficult to debug deadlocks.\n\
+\n\
+If an error occurs in the child process before the exec, it is\n\
+serialized and written to the errpipe_write fd per subprocess.py.\n\
+\n\
+Returns: the child process's PID.\n\
+\n\
+Raises: Only on an error in the parent process.\n\
+");
+
+PyDoc_STRVAR(subprocess_cloexec_pipe_doc,
+"cloexec_pipe() -> (read_end, write_end)\n\n\
+Create a pipe whose ends have the cloexec flag set.");
+
+static PyObject *
+subprocess_cloexec_pipe(PyObject *self, PyObject *noargs)
+{
+ int fds[2];
+ int res;
+#ifdef HAVE_PIPE2
+ Py_BEGIN_ALLOW_THREADS
+ res = pipe2(fds, O_CLOEXEC);
+ Py_END_ALLOW_THREADS
+ if (res != 0 && errno == ENOSYS)
+ {
+ if (PyErr_WarnEx(
+ PyExc_RuntimeWarning,
+ "pipe2 set errno ENOSYS; falling "
+ "back to non-atomic pipe+fcntl.", 1) != 0) {
+ return NULL;
+ }
+ {
+#endif
+ /* We hold the GIL which offers some protection from other code calling
+ * fork() before the CLOEXEC flags have been set but we can't guarantee
+ * anything without pipe2(). */
+ long oldflags;
+
+ res = pipe(fds);
+
+ if (res == 0) {
+ oldflags = fcntl(fds[0], F_GETFD, 0);
+ if (oldflags < 0) res = oldflags;
+ }
+ if (res == 0)
+ res = fcntl(fds[0], F_SETFD, oldflags | FD_CLOEXEC);
+
+ if (res == 0) {
+ oldflags = fcntl(fds[1], F_GETFD, 0);
+ if (oldflags < 0) res = oldflags;
+ }
+ if (res == 0)
+ res = fcntl(fds[1], F_SETFD, oldflags | FD_CLOEXEC);
+#ifdef HAVE_PIPE2
+ }
+ }
+#endif
+ if (res != 0)
+ return PyErr_SetFromErrno(PyExc_OSError);
+ return Py_BuildValue("(ii)", fds[0], fds[1]);
+}
+
+/* module level code ********************************************************/
+
+PyDoc_STRVAR(module_doc,
+"A POSIX helper for the subprocess module.");
+
+
+static PyMethodDef module_methods[] = {
+ {"fork_exec", subprocess_fork_exec, METH_VARARGS, subprocess_fork_exec_doc},
+ {"cloexec_pipe", subprocess_cloexec_pipe, METH_NOARGS, subprocess_cloexec_pipe_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+
+static struct PyModuleDef _posixsubprocessmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_posixsubprocess",
+ module_doc,
+ -1, /* No memory is needed. */
+ module_methods,
+};
+
+PyMODINIT_FUNC
+PyInit__posixsubprocess(void)
+{
+#ifdef _SC_OPEN_MAX
+ max_fd = sysconf(_SC_OPEN_MAX);
+ if (max_fd == -1)
+#endif
+ max_fd = 256; /* Matches Lib/subprocess.py */
+
+ return PyModule_Create(&_posixsubprocessmodule);
+}
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 57f5395b0a..bc9b04a27b 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -6,7 +6,7 @@
It was modified in 2002 by Raymond Hettinger as follows:
- * the principal computational lines untouched except for tabbing.
+ * the principal computational lines untouched.
* renamed genrand_res53() to random_random() and wrapped
in python calling/return code.
diff --git a/Modules/_sqlite/cache.c b/Modules/_sqlite/cache.c
index 7ac043cae1..735a2426cc 100644
--- a/Modules/_sqlite/cache.c
+++ b/Modules/_sqlite/cache.c
@@ -1,6 +1,6 @@
/* cache .c - a LRU cache
*
- * Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -21,6 +21,7 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
+#include "sqlitecompat.h"
#include "cache.h"
#include <limits.h>
diff --git a/Modules/_sqlite/cache.h b/Modules/_sqlite/cache.h
index d6f7f13296..a133903961 100644
--- a/Modules/_sqlite/cache.h
+++ b/Modules/_sqlite/cache.h
@@ -1,6 +1,6 @@
/* cache.h - definitions for the LRU cache
*
- * Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 11fb4ac864..e4969e36a3 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1,9 +1,9 @@
/* connection.c - the connection type
*
- * Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
- *
+ *
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
@@ -23,6 +23,7 @@
#include "cache.h"
#include "module.h"
+#include "structmember.h"
#include "connection.h"
#include "statement.h"
#include "cursor.h"
@@ -35,7 +36,14 @@
#define ACTION_FINALIZE 1
#define ACTION_RESET 2
+#if SQLITE_VERSION_NUMBER >= 3003008
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+#define HAVE_LOAD_EXTENSION
+#endif
+#endif
+
static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level);
+static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self);
static void _sqlite3_result_error(sqlite3_context* ctx, const char* errmsg, int len)
@@ -69,10 +77,13 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
return -1;
}
+ self->initialized = 1;
+
self->begin_statement = NULL;
self->statement_cache = NULL;
self->statements = NULL;
+ self->cursors = NULL;
Py_INCREF(Py_None);
self->row_factory = Py_None;
@@ -106,11 +117,15 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
return -1;
}
+ self->created_statements = 0;
+ self->created_cursors = 0;
+
+ /* Create lists of weak references to statements/cursors */
self->statements = PyList_New(0);
- if (!self->statements) {
+ self->cursors = PyList_New(0);
+ if (!self->statements || !self->cursors) {
return -1;
}
- self->created_statements = 0;
/* By default, the Cache class INCREFs the factory in its initializer, and
* decrefs it in its deallocator method. Since this would create a circular
@@ -174,11 +189,12 @@ void pysqlite_flush_statement_cache(pysqlite_Connection* self)
}
/* action in (ACTION_RESET, ACTION_FINALIZE) */
-void pysqlite_do_all_statements(pysqlite_Connection* self, int action)
+void pysqlite_do_all_statements(pysqlite_Connection* self, int action, int reset_cursors)
{
int i;
PyObject* weakref;
PyObject* statement;
+ pysqlite_Cursor* cursor;
for (i = 0; i < PyList_Size(self->statements); i++) {
weakref = PyList_GetItem(self->statements, i);
@@ -191,6 +207,16 @@ void pysqlite_do_all_statements(pysqlite_Connection* self, int action)
}
}
}
+
+ if (reset_cursors) {
+ for (i = 0; i < PyList_Size(self->cursors); i++) {
+ weakref = PyList_GetItem(self->cursors, i);
+ cursor = (pysqlite_Cursor*)PyWeakref_GetObject(weakref);
+ if ((PyObject*)cursor != Py_None) {
+ cursor->reset = 1;
+ }
+ }
+ }
}
void pysqlite_connection_dealloc(pysqlite_Connection* self)
@@ -213,17 +239,43 @@ void pysqlite_connection_dealloc(pysqlite_Connection* self)
Py_XDECREF(self->text_factory);
Py_XDECREF(self->collations);
Py_XDECREF(self->statements);
+ Py_XDECREF(self->cursors);
Py_TYPE(self)->tp_free((PyObject*)self);
}
+/*
+ * Registers a cursor with the connection.
+ *
+ * 0 => error; 1 => ok
+ */
+int pysqlite_connection_register_cursor(pysqlite_Connection* connection, PyObject* cursor)
+{
+ PyObject* weakref;
+
+ weakref = PyWeakref_NewRef((PyObject*)cursor, NULL);
+ if (!weakref) {
+ goto error;
+ }
+
+ if (PyList_Append(connection->cursors, weakref) != 0) {
+ Py_CLEAR(weakref);
+ goto error;
+ }
+
+ Py_DECREF(weakref);
+
+ return 1;
+error:
+ return 0;
+}
+
PyObject* pysqlite_connection_cursor(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
{
static char *kwlist[] = {"factory", NULL, NULL};
PyObject* factory = NULL;
PyObject* cursor;
-
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", kwlist,
&factory)) {
return NULL;
@@ -239,6 +291,8 @@ PyObject* pysqlite_connection_cursor(pysqlite_Connection* self, PyObject* args,
cursor = PyObject_CallFunction(factory, "O", self);
+ _pysqlite_drop_unused_cursor_references(self);
+
if (cursor && self->row_factory != Py_None) {
Py_XDECREF(((pysqlite_Cursor*)cursor)->row_factory);
Py_INCREF(self->row_factory);
@@ -256,7 +310,7 @@ PyObject* pysqlite_connection_close(pysqlite_Connection* self, PyObject* args)
return NULL;
}
- pysqlite_do_all_statements(self, ACTION_FINALIZE);
+ pysqlite_do_all_statements(self, ACTION_FINALIZE, 1);
if (self->db) {
Py_BEGIN_ALLOW_THREADS
@@ -282,6 +336,11 @@ PyObject* pysqlite_connection_close(pysqlite_Connection* self, PyObject* args)
*/
int pysqlite_check_connection(pysqlite_Connection* con)
{
+ if (!con->initialized) {
+ PyErr_SetString(pysqlite_ProgrammingError, "Base Connection.__init__ not called.");
+ return 0;
+ }
+
if (!con->db) {
PyErr_SetString(pysqlite_ProgrammingError, "Cannot operate on a closed database.");
return 0;
@@ -340,6 +399,8 @@ PyObject* pysqlite_connection_commit(pysqlite_Connection* self, PyObject* args)
}
if (self->inTransaction) {
+ pysqlite_do_all_statements(self, ACTION_RESET, 0);
+
Py_BEGIN_ALLOW_THREADS
rc = sqlite3_prepare(self->db, "COMMIT", -1, &statement, &tail);
Py_END_ALLOW_THREADS
@@ -384,7 +445,7 @@ PyObject* pysqlite_connection_rollback(pysqlite_Connection* self, PyObject* args
}
if (self->inTransaction) {
- pysqlite_do_all_statements(self, ACTION_RESET);
+ pysqlite_do_all_statements(self, ACTION_RESET, 1);
Py_BEGIN_ALLOW_THREADS
rc = sqlite3_prepare(self->db, "ROLLBACK", -1, &statement, &tail);
@@ -435,7 +496,9 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
} else if (PyFloat_Check(py_val)) {
sqlite3_result_double(context, PyFloat_AsDouble(py_val));
} else if (PyUnicode_Check(py_val)) {
- sqlite3_result_text(context, _PyUnicode_AsString(py_val), -1, SQLITE_TRANSIENT);
+ char *str = _PyUnicode_AsString(py_val);
+ if (str != NULL)
+ sqlite3_result_text(context, str, -1, SQLITE_TRANSIENT);
} else if (PyObject_CheckBuffer(py_val)) {
if (PyObject_AsCharBuffer(py_val, &buffer, &buflen) != 0) {
PyErr_SetString(PyExc_ValueError, "could not convert BLOB to buffer");
@@ -649,7 +712,7 @@ error:
#endif
}
-void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)
+static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)
{
PyObject* new_list;
PyObject* weakref;
@@ -681,6 +744,38 @@ void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)
self->statements = new_list;
}
+static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self)
+{
+ PyObject* new_list;
+ PyObject* weakref;
+ int i;
+
+ /* we only need to do this once in a while */
+ if (self->created_cursors++ < 200) {
+ return;
+ }
+
+ self->created_cursors = 0;
+
+ new_list = PyList_New(0);
+ if (!new_list) {
+ return;
+ }
+
+ for (i = 0; i < PyList_Size(self->cursors); i++) {
+ weakref = PyList_GetItem(self->cursors, i);
+ if (PyWeakref_GetObject(weakref) != Py_None) {
+ if (PyList_Append(new_list, weakref) != 0) {
+ Py_DECREF(new_list);
+ return;
+ }
+ }
+ }
+
+ Py_DECREF(self->cursors);
+ self->cursors = new_list;
+}
+
PyObject* pysqlite_connection_create_function(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
{
static char *kwlist[] = {"name", "narg", "func", NULL, NULL};
@@ -707,7 +802,8 @@ PyObject* pysqlite_connection_create_function(pysqlite_Connection* self, PyObjec
PyErr_SetString(pysqlite_OperationalError, "Error creating function");
return NULL;
} else {
- PyDict_SetItem(self->function_pinboard, func, Py_None);
+ if (PyDict_SetItem(self->function_pinboard, func, Py_None) == -1)
+ return NULL;
Py_INCREF(Py_None);
return Py_None;
@@ -738,7 +834,8 @@ PyObject* pysqlite_connection_create_aggregate(pysqlite_Connection* self, PyObje
PyErr_SetString(pysqlite_OperationalError, "Error creating aggregate");
return NULL;
} else {
- PyDict_SetItem(self->function_pinboard, aggregate_class, Py_None);
+ if (PyDict_SetItem(self->function_pinboard, aggregate_class, Py_None) == -1)
+ return NULL;
Py_INCREF(Py_None);
return Py_None;
@@ -798,7 +895,7 @@ static int _progress_handler(void* user_arg)
}
/* abort query if error occurred */
- rc = 1;
+ rc = 1;
} else {
rc = (int)PyObject_IsTrue(ret);
Py_DECREF(ret);
@@ -810,7 +907,7 @@ static int _progress_handler(void* user_arg)
return rc;
}
-PyObject* pysqlite_connection_set_authorizer(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
+static PyObject* pysqlite_connection_set_authorizer(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
{
PyObject* authorizer_cb;
@@ -832,14 +929,15 @@ PyObject* pysqlite_connection_set_authorizer(pysqlite_Connection* self, PyObject
PyErr_SetString(pysqlite_OperationalError, "Error setting authorizer callback");
return NULL;
} else {
- PyDict_SetItem(self->function_pinboard, authorizer_cb, Py_None);
+ if (PyDict_SetItem(self->function_pinboard, authorizer_cb, Py_None) == -1)
+ return NULL;
Py_INCREF(Py_None);
return Py_None;
}
}
-PyObject* pysqlite_connection_set_progress_handler(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
+static PyObject* pysqlite_connection_set_progress_handler(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
{
PyObject* progress_handler;
int n;
@@ -860,13 +958,64 @@ PyObject* pysqlite_connection_set_progress_handler(pysqlite_Connection* self, Py
sqlite3_progress_handler(self->db, 0, 0, (void*)0);
} else {
sqlite3_progress_handler(self->db, n, _progress_handler, progress_handler);
- PyDict_SetItem(self->function_pinboard, progress_handler, Py_None);
+ if (PyDict_SetItem(self->function_pinboard, progress_handler, Py_None) == -1)
+ return NULL;
}
Py_INCREF(Py_None);
return Py_None;
}
+#ifdef HAVE_LOAD_EXTENSION
+static PyObject* pysqlite_enable_load_extension(pysqlite_Connection* self, PyObject* args)
+{
+ int rc;
+ int onoff;
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (!PyArg_ParseTuple(args, "i", &onoff)) {
+ return NULL;
+ }
+
+ rc = sqlite3_enable_load_extension(self->db, onoff);
+
+ if (rc != SQLITE_OK) {
+ PyErr_SetString(pysqlite_OperationalError, "Error enabling load extension");
+ return NULL;
+ } else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+}
+
+static PyObject* pysqlite_load_extension(pysqlite_Connection* self, PyObject* args)
+{
+ int rc;
+ char* extension_name;
+ char* errmsg;
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (!PyArg_ParseTuple(args, "s", &extension_name)) {
+ return NULL;
+ }
+
+ rc = sqlite3_load_extension(self->db, extension_name, 0, &errmsg);
+ if (rc != 0) {
+ PyErr_SetString(pysqlite_OperationalError, errmsg);
+ return NULL;
+ } else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+}
+#endif
+
int pysqlite_check_thread(pysqlite_Connection* self)
{
#ifdef WITH_THREAD
@@ -1270,9 +1419,11 @@ pysqlite_connection_create_collation(pysqlite_Connection* self, PyObject* args)
}
if (callable != Py_None) {
- PyDict_SetItem(self->collations, uppercase_name, callable);
+ if (PyDict_SetItem(self->collations, uppercase_name, callable) == -1)
+ goto finally;
} else {
- PyDict_DelItem(self->collations, uppercase_name);
+ if (PyDict_DelItem(self->collations, uppercase_name) == -1)
+ goto finally;
}
rc = sqlite3_create_collation(self->db,
@@ -1360,6 +1511,12 @@ static PyMethodDef connection_methods[] = {
PyDoc_STR("Creates a new aggregate. Non-standard.")},
{"set_authorizer", (PyCFunction)pysqlite_connection_set_authorizer, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("Sets authorizer callback. Non-standard.")},
+ #ifdef HAVE_LOAD_EXTENSION
+ {"enable_load_extension", (PyCFunction)pysqlite_enable_load_extension, METH_VARARGS,
+ PyDoc_STR("Enable dynamic loading of SQLite extension modules. Non-standard.")},
+ {"load_extension", (PyCFunction)pysqlite_load_extension, METH_VARARGS,
+ PyDoc_STR("Load SQLite extension module. Non-standard.")},
+ #endif
{"set_progress_handler", (PyCFunction)pysqlite_connection_set_progress_handler, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("Sets progress handler callback. Non-standard.")},
{"execute", (PyCFunction)pysqlite_connection_execute, METH_VARARGS,
@@ -1395,6 +1552,7 @@ static struct PyMemberDef connection_members[] =
{"NotSupportedError", T_OBJECT, offsetof(pysqlite_Connection, NotSupportedError), READONLY},
{"row_factory", T_OBJECT, offsetof(pysqlite_Connection, row_factory)},
{"text_factory", T_OBJECT, offsetof(pysqlite_Connection, text_factory)},
+ {"in_transaction", T_BOOL, offsetof(pysqlite_Connection, inTransaction), READONLY},
{NULL}
};
diff --git a/Modules/_sqlite/connection.h b/Modules/_sqlite/connection.h
index fe05297f36..c8e2f7cbd2 100644
--- a/Modules/_sqlite/connection.h
+++ b/Modules/_sqlite/connection.h
@@ -1,6 +1,6 @@
/* connection.h - definitions for the connection type
*
- * Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -39,7 +39,7 @@ typedef struct
/* 1 if we are currently within a transaction, i. e. if a BEGIN has been
* issued */
- int inTransaction;
+ char inTransaction;
/* the type detection mode. Only 0, PARSE_DECLTYPES, PARSE_COLNAMES or a
* bitwise combination thereof makes sense */
@@ -63,17 +63,21 @@ typedef struct
* used from the same thread it was created in */
int check_same_thread;
+ int initialized;
+
/* thread identification of the thread the connection was created in */
long thread_ident;
pysqlite_Cache* statement_cache;
- /* A list of weak references to statements used within this connection */
+ /* Lists of weak references to statements and cursors used within this connection */
PyObject* statements;
+ PyObject* cursors;
- /* a counter for how many statements were created in the connection. May be
+ /* Counters for how many statements/cursors were created in the connection. May be
* reset to 0 at certain intervals */
int created_statements;
+ int created_cursors;
PyObject* row_factory;
@@ -120,6 +124,7 @@ PyObject* pysqlite_connection_rollback(pysqlite_Connection* self, PyObject* args
PyObject* pysqlite_connection_new(PyTypeObject* type, PyObject* args, PyObject* kw);
int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject* kwargs);
+int pysqlite_connection_register_cursor(pysqlite_Connection* connection, PyObject* cursor);
int pysqlite_check_thread(pysqlite_Connection* self);
int pysqlite_check_connection(pysqlite_Connection* con);
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 7ce6cc5cac..97908a3093 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -1,6 +1,6 @@
/* cursor.c - the cursor type
*
- * Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -36,6 +36,8 @@
PyObject* pysqlite_cursor_iternext(pysqlite_Cursor* self);
+static char* errmsg_fetch_across_rollback = "Cursor needed to be reset because of commit/rollback and can no longer be fetched from.";
+
static pysqlite_StatementKind detect_statement_type(const char* statement)
{
char buf[20];
@@ -74,7 +76,7 @@ static pysqlite_StatementKind detect_statement_type(const char* statement)
}
}
-int pysqlite_cursor_init(pysqlite_Cursor* self, PyObject* args, PyObject* kwargs)
+static int pysqlite_cursor_init(pysqlite_Cursor* self, PyObject* args, PyObject* kwargs)
{
pysqlite_Connection* connection;
@@ -87,6 +89,7 @@ int pysqlite_cursor_init(pysqlite_Cursor* self, PyObject* args, PyObject* kwargs
self->connection = connection;
self->statement = NULL;
self->next_row = NULL;
+ self->in_weakreflist = NULL;
self->row_cast_map = PyList_New(0);
if (!self->row_cast_map) {
@@ -100,6 +103,8 @@ int pysqlite_cursor_init(pysqlite_Cursor* self, PyObject* args, PyObject* kwargs
self->lastrowid= Py_None;
self->arraysize = 1;
+ self->closed = 0;
+ self->reset = 0;
self->rowcount = -1L;
@@ -110,10 +115,16 @@ int pysqlite_cursor_init(pysqlite_Cursor* self, PyObject* args, PyObject* kwargs
return -1;
}
+ if (!pysqlite_connection_register_cursor(connection, (PyObject*)self)) {
+ return -1;
+ }
+
+ self->initialized = 1;
+
return 0;
}
-void pysqlite_cursor_dealloc(pysqlite_Cursor* self)
+static void pysqlite_cursor_dealloc(pysqlite_Cursor* self)
{
int rc;
@@ -130,6 +141,10 @@ void pysqlite_cursor_dealloc(pysqlite_Cursor* self)
Py_XDECREF(self->row_factory);
Py_XDECREF(self->next_row);
+ if (self->in_weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject*)self);
+ }
+
Py_TYPE(self)->tp_free((PyObject*)self);
}
@@ -281,6 +296,11 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
PyObject* buf_bytes;
PyObject* error_obj;
+ if (self->reset) {
+ PyErr_SetString(pysqlite_InterfaceError, errmsg_fetch_across_rollback);
+ return NULL;
+ }
+
Py_BEGIN_ALLOW_THREADS
numcols = sqlite3_data_count(self->statement->st);
Py_END_ALLOW_THREADS
@@ -348,7 +368,7 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
}
PyOS_snprintf(buf, sizeof(buf) - 1, "Could not decode to UTF-8 column '%s' with text '%s'",
colname , val_str);
- buf_bytes = PyByteArray_FromStringAndSize(buf, strlen(buf));
+ buf_bytes = PyByteArray_FromStringAndSize(buf, strlen(buf));
if (!buf_bytes) {
PyErr_SetString(pysqlite_OperationalError, "Could not decode to UTF-8");
} else {
@@ -397,6 +417,26 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
return row;
}
+/*
+ * Checks if a cursor object is usable.
+ *
+ * 0 => error; 1 => ok
+ */
+static int check_cursor(pysqlite_Cursor* cur)
+{
+ if (!cur->initialized) {
+ PyErr_SetString(pysqlite_ProgrammingError, "Base Cursor.__init__ not called.");
+ return 0;
+ }
+
+ if (cur->closed) {
+ PyErr_SetString(pysqlite_ProgrammingError, "Cannot operate on a closed cursor.");
+ return 0;
+ } else {
+ return pysqlite_check_thread(cur->connection) && pysqlite_check_connection(cur->connection);
+ }
+}
+
PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* args)
{
PyObject* operation;
@@ -416,13 +456,15 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
PyObject* second_argument = NULL;
int allow_8bit_chars;
- if (!pysqlite_check_thread(self->connection) || !pysqlite_check_connection(self->connection)) {
+ if (!check_cursor(self)) {
return NULL;
}
+ self->reset = 0;
+
/* Make shooting yourself in the foot with not utf-8 decodable 8-bit-strings harder */
allow_8bit_chars = ((self->connection->text_factory != (PyObject*)&PyUnicode_Type) &&
- (self->connection->text_factory != (PyObject*)&PyUnicode_Type && pysqlite_OptimizedUnicode));
+ (self->connection->text_factory != pysqlite_OptimizedUnicode));
Py_XDECREF(self->next_row);
self->next_row = NULL;
@@ -491,7 +533,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
}
operation_cstr = _PyUnicode_AsStringAndSize(operation, &operation_len);
- if (operation == NULL)
+ if (operation_cstr == NULL)
goto error;
/* reset description and rowcount */
@@ -573,42 +615,6 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
}
}
- func_args = PyTuple_New(1);
- if (!func_args) {
- goto error;
- }
- Py_INCREF(operation);
- if (PyTuple_SetItem(func_args, 0, operation) != 0) {
- goto error;
- }
-
- if (self->statement) {
- (void)pysqlite_statement_reset(self->statement);
- Py_DECREF(self->statement);
- }
-
- self->statement = (pysqlite_Statement*)pysqlite_cache_get(self->connection->statement_cache, func_args);
- Py_DECREF(func_args);
-
- if (!self->statement) {
- goto error;
- }
-
- if (self->statement->in_use) {
- Py_DECREF(self->statement);
- self->statement = PyObject_New(pysqlite_Statement, &pysqlite_StatementType);
- if (!self->statement) {
- goto error;
- }
- rc = pysqlite_statement_create(self->statement, self->connection, operation);
- if (rc != SQLITE_OK) {
- Py_CLEAR(self->statement);
- goto error;
- }
- }
-
- pysqlite_statement_reset(self->statement);
- pysqlite_statement_mark_dirty(self->statement);
while (1) {
parameters = PyIter_Next(parameters_iter);
@@ -623,11 +629,6 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
goto error;
}
- if (pysqlite_build_row_cast_map(self) != 0) {
- PyErr_SetString(pysqlite_OperationalError, "Error while building row_cast_map");
- goto error;
- }
-
/* Keep trying the SQL statement until the schema stops changing. */
while (1) {
/* Actually execute the SQL statement. */
@@ -671,10 +672,6 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
}
if (rc == SQLITE_ROW || (rc == SQLITE_DONE && statement_type == STATEMENT_SELECT)) {
- Py_BEGIN_ALLOW_THREADS
- numcols = sqlite3_column_count(self->statement->st);
- Py_END_ALLOW_THREADS
-
if (self->description == Py_None) {
Py_BEGIN_ALLOW_THREADS
numcols = sqlite3_column_count(self->statement->st);
@@ -782,16 +779,17 @@ PyObject* pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args)
sqlite3_stmt* statement;
int rc;
PyObject* result;
- int statement_completed = 0;
if (!PyArg_ParseTuple(args, "O", &script_obj)) {
return NULL;
}
- if (!pysqlite_check_thread(self->connection) || !pysqlite_check_connection(self->connection)) {
+ if (!check_cursor(self)) {
return NULL;
}
+ self->reset = 0;
+
if (PyUnicode_Check(script_obj)) {
script_cstr = _PyUnicode_AsString(script_obj);
if (!script_cstr) {
@@ -810,11 +808,6 @@ PyObject* pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args)
Py_DECREF(result);
while (1) {
- if (!sqlite3_complete(script_cstr)) {
- break;
- }
- statement_completed = 1;
-
Py_BEGIN_ALLOW_THREADS
rc = sqlite3_prepare(self->connection->db,
script_cstr,
@@ -845,15 +838,15 @@ PyObject* pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args)
_pysqlite_seterror(self->connection->db, NULL);
goto error;
}
+
+ if (*script_cstr == (char)0) {
+ break;
+ }
}
error:
Py_XDECREF(script_str);
- if (!statement_completed) {
- PyErr_SetString(pysqlite_ProgrammingError, "you did not provide a complete SQL statement");
- }
-
if (PyErr_Occurred()) {
return NULL;
} else {
@@ -874,7 +867,12 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
PyObject* next_row;
int rc;
- if (!pysqlite_check_thread(self->connection) || !pysqlite_check_connection(self->connection)) {
+ if (!check_cursor(self)) {
+ return NULL;
+ }
+
+ if (self->reset) {
+ PyErr_SetString(pysqlite_InterfaceError, errmsg_fetch_across_rollback);
return NULL;
}
@@ -1017,6 +1015,8 @@ PyObject* pysqlite_cursor_close(pysqlite_Cursor* self, PyObject* args)
Py_CLEAR(self->statement);
}
+ self->closed = 1;
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -1077,12 +1077,12 @@ PyTypeObject pysqlite_CursorType = {
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
cursor_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
+ offsetof(pysqlite_Cursor, in_weakreflist), /* tp_weaklistoffset */
(getiterfunc)pysqlite_cursor_getiter, /* tp_iter */
(iternextfunc)pysqlite_cursor_iternext, /* tp_iternext */
cursor_methods, /* tp_methods */
diff --git a/Modules/_sqlite/cursor.h b/Modules/_sqlite/cursor.h
index 54d816db91..5d8b5c160d 100644
--- a/Modules/_sqlite/cursor.h
+++ b/Modules/_sqlite/cursor.h
@@ -1,6 +1,6 @@
/* cursor.h - definitions for the cursor type
*
- * Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -40,9 +40,14 @@ typedef struct
long rowcount;
PyObject* row_factory;
pysqlite_Statement* statement;
+ int closed;
+ int reset;
+ int initialized;
/* the next row to be returned, NULL if no next row available */
PyObject* next_row;
+
+ PyObject* in_weakreflist; /* List of weak references */
} pysqlite_Cursor;
typedef enum {
@@ -53,8 +58,6 @@ typedef enum {
extern PyTypeObject pysqlite_CursorType;
-int pysqlite_cursor_init(pysqlite_Cursor* self, PyObject* args, PyObject* kwargs);
-void pysqlite_cursor_dealloc(pysqlite_Cursor* self);
PyObject* pysqlite_cursor_execute(pysqlite_Cursor* self, PyObject* args);
PyObject* pysqlite_cursor_executemany(pysqlite_Cursor* self, PyObject* args);
PyObject* pysqlite_cursor_getiter(pysqlite_Cursor *self);
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 2ca848dd56..cbc3b8e90b 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -1,6 +1,6 @@
/* module.c - the module itself
*
- * Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
diff --git a/Modules/_sqlite/module.h b/Modules/_sqlite/module.h
index b14be2a9ec..0eddb67948 100644
--- a/Modules/_sqlite/module.h
+++ b/Modules/_sqlite/module.h
@@ -1,6 +1,6 @@
/* module.h - definitions for the module
*
- * Copyright (C) 2004-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -25,7 +25,7 @@
#define PYSQLITE_MODULE_H
#include "Python.h"
-#define PYSQLITE_VERSION "2.4.1"
+#define PYSQLITE_VERSION "2.6.0"
extern PyObject* pysqlite_Error;
extern PyObject* pysqlite_Warning;
diff --git a/Modules/_sqlite/prepare_protocol.c b/Modules/_sqlite/prepare_protocol.c
index 96b1dca184..fc6887445e 100644
--- a/Modules/_sqlite/prepare_protocol.c
+++ b/Modules/_sqlite/prepare_protocol.c
@@ -1,6 +1,6 @@
/* prepare_protocol.c - the protocol for preparing values for SQLite
*
- * Copyright (C) 2005-2006 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -21,6 +21,7 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
+#include "sqlitecompat.h"
#include "prepare_protocol.h"
int pysqlite_prepare_protocol_init(pysqlite_PrepareProtocol* self, PyObject* args, PyObject* kwargs)
diff --git a/Modules/_sqlite/prepare_protocol.h b/Modules/_sqlite/prepare_protocol.h
index 153472e9de..924e16223a 100644
--- a/Modules/_sqlite/prepare_protocol.h
+++ b/Modules/_sqlite/prepare_protocol.h
@@ -1,6 +1,6 @@
/* prepare_protocol.h - the protocol for preparing values for SQLite
*
- * Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
index f9f57e9ffb..3d440942f9 100644
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -1,6 +1,6 @@
/* row.c - an enhanced tuple for database rows
*
- * Copyright (C) 2005-2006 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -83,6 +83,8 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
return item;
} else if (PyUnicode_Check(idx)) {
key = _PyUnicode_AsString(idx);
+ if (key == NULL)
+ return NULL;
nitems = PyTuple_Size(self->description);
@@ -164,7 +166,7 @@ static PyObject* pysqlite_iter(pysqlite_Row* self)
return PyObject_GetIter(self->data);
}
-static long pysqlite_row_hash(pysqlite_Row *self)
+static Py_hash_t pysqlite_row_hash(pysqlite_Row *self)
{
return PyObject_Hash(self->description) ^ PyObject_Hash(self->data);
}
@@ -172,17 +174,17 @@ static long pysqlite_row_hash(pysqlite_Row *self)
static PyObject* pysqlite_row_richcompare(pysqlite_Row *self, PyObject *_other, int opid)
{
if (opid != Py_EQ && opid != Py_NE) {
- Py_INCREF(Py_NotImplemented);
- return Py_NotImplemented;
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
}
if (PyType_IsSubtype(Py_TYPE(_other), &pysqlite_RowType)) {
- pysqlite_Row *other = (pysqlite_Row *)_other;
- PyObject *res = PyObject_RichCompare(self->description, other->description, opid);
- if ((opid == Py_EQ && res == Py_True)
- || (opid == Py_NE && res == Py_False)) {
- Py_DECREF(res);
- return PyObject_RichCompare(self->data, other->data, opid);
- }
+ pysqlite_Row *other = (pysqlite_Row *)_other;
+ PyObject *res = PyObject_RichCompare(self->description, other->description, opid);
+ if ((opid == Py_EQ && res == Py_True)
+ || (opid == Py_NE && res == Py_False)) {
+ Py_DECREF(res);
+ return PyObject_RichCompare(self->data, other->data, opid);
+ }
}
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
diff --git a/Modules/_sqlite/row.h b/Modules/_sqlite/row.h
index 8ed69aee21..d014109032 100644
--- a/Modules/_sqlite/row.h
+++ b/Modules/_sqlite/row.h
@@ -1,6 +1,6 @@
/* row.h - an enhanced tuple for database rows
*
- * Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
diff --git a/Modules/_sqlite/sqlitecompat.h b/Modules/_sqlite/sqlitecompat.h
index c3798257bf..cf20f16f65 100644
--- a/Modules/_sqlite/sqlitecompat.h
+++ b/Modules/_sqlite/sqlitecompat.h
@@ -1,6 +1,6 @@
/* sqlitecompat.h - compatibility macros
*
- * Copyright (C) 2006 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2006-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -21,6 +21,8 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
+#include "Python.h"
+
#ifndef PYSQLITE_COMPAT_H
#define PYSQLITE_COMPAT_H
@@ -31,4 +33,31 @@ typedef int Py_ssize_t;
typedef int (*lenfunc)(PyObject*);
#endif
+
+/* define PyDict_CheckExact for pre-2.4 versions of Python */
+#ifndef PyDict_CheckExact
+#define PyDict_CheckExact(op) ((op)->ob_type == &PyDict_Type)
+#endif
+
+/* define Py_CLEAR for pre-2.4 versions of Python */
+#ifndef Py_CLEAR
+#define Py_CLEAR(op) \
+ do { \
+ if (op) { \
+ PyObject *tmp = (PyObject *)(op); \
+ (op) = NULL; \
+ Py_DECREF(tmp); \
+ } \
+ } while (0)
+#endif
+
+#ifndef PyVarObject_HEAD_INIT
+#define PyVarObject_HEAD_INIT(type, size) \
+ PyObject_HEAD_INIT(type) size,
+#endif
+
+#ifndef Py_TYPE
+#define Py_TYPE(ob) ((ob)->ob_type)
+#endif
+
#endif
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index fc2b4c4ce1..f89fc9abf1 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -1,6 +1,6 @@
/* statement.c - the statement type
*
- * Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -130,7 +130,10 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec
break;
case TYPE_UNICODE:
string = _PyUnicode_AsString(parameter);
- rc = sqlite3_bind_text(self->st, pos, string, -1, SQLITE_TRANSIENT);
+ if (string != NULL)
+ rc = sqlite3_bind_text(self->st, pos, string, -1, SQLITE_TRANSIENT);
+ else
+ rc = -1;
break;
case TYPE_BUFFER:
if (PyObject_AsCharBuffer(parameter, &buffer, &buflen) == 0) {
diff --git a/Modules/_sqlite/statement.h b/Modules/_sqlite/statement.h
index bfa2091624..e5da42e7d8 100644
--- a/Modules/_sqlite/statement.h
+++ b/Modules/_sqlite/statement.h
@@ -1,6 +1,6 @@
/* statement.h - definitions for the statement type
*
- * Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c
index 6be39ae737..b7faae867e 100644
--- a/Modules/_sqlite/util.c
+++ b/Modules/_sqlite/util.c
@@ -1,6 +1,6 @@
/* util.c - various utility functions
*
- * Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
diff --git a/Modules/_sqlite/util.h b/Modules/_sqlite/util.h
index 2a45636d56..baf405c340 100644
--- a/Modules/_sqlite/util.h
+++ b/Modules/_sqlite/util.h
@@ -1,6 +1,6 @@
/* util.h - various utility functions
*
- * Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
diff --git a/Modules/_sre.c b/Modules/_sre.c
index ee6a26bb40..2b764b11ca 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -67,9 +67,6 @@ static char copyright[] =
/* enables fast searching */
#define USE_FAST_SEARCH
-/* enables aggressive inlining (always on for Visual C) */
-#undef USE_INLINE
-
/* enables copy/deepcopy handling (work in progress) */
#undef USE_BUILTIN_COPY
@@ -168,7 +165,7 @@ static unsigned int sre_lower_locale(unsigned int ch)
#if defined(HAVE_UNICODE)
-#define SRE_UNI_IS_DIGIT(ch) Py_UNICODE_ISDIGIT((Py_UNICODE)(ch))
+#define SRE_UNI_IS_DIGIT(ch) Py_UNICODE_ISDECIMAL((Py_UNICODE)(ch))
#define SRE_UNI_IS_SPACE(ch) Py_UNICODE_ISSPACE((Py_UNICODE)(ch))
#define SRE_UNI_IS_LINEBREAK(ch) Py_UNICODE_ISLINEBREAK((Py_UNICODE)(ch))
#define SRE_UNI_IS_ALNUM(ch) Py_UNICODE_ISALNUM((Py_UNICODE)(ch))
@@ -3903,12 +3900,9 @@ PyMODINIT_FUNC PyInit__sre(void)
PyObject* d;
PyObject* x;
- /* Initialize object types */
- if (PyType_Ready(&Pattern_Type) < 0)
- return NULL;
- if (PyType_Ready(&Match_Type) < 0)
- return NULL;
- if (PyType_Ready(&Scanner_Type) < 0)
+ /* Patch object types */
+ if (PyType_Ready(&Pattern_Type) || PyType_Ready(&Match_Type) ||
+ PyType_Ready(&Scanner_Type))
return NULL;
m = PyModule_Create(&sremodule);
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 73a76bbc05..e49426464e 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -113,25 +113,40 @@ static unsigned int _ssl_locks_count = 0;
# undef HAVE_OPENSSL_RAND
#endif
+/* SSL_CTX_clear_options() and SSL_clear_options() were first added in
+ * OpenSSL 0.9.8m but do not appear in some 0.9.9-dev versions such the
+ * 0.9.9 from "May 2008" that NetBSD 5.0 uses. */
+#if OPENSSL_VERSION_NUMBER >= 0x009080dfL && OPENSSL_VERSION_NUMBER != 0x00909000L
+# define HAVE_SSL_CTX_CLEAR_OPTIONS
+#else
+# undef HAVE_SSL_CTX_CLEAR_OPTIONS
+#endif
+
typedef struct {
PyObject_HEAD
- PyObject *Socket; /* weakref to socket on which we're layered */
- SSL_CTX* ctx;
- SSL* ssl;
- X509* peer_cert;
- int shutdown_seen_zero;
+ SSL_CTX *ctx;
+} PySSLContext;
-} PySSLObject;
+typedef struct {
+ PyObject_HEAD
+ PyObject *Socket; /* weakref to socket on which we're layered */
+ SSL *ssl;
+ X509 *peer_cert;
+ int shutdown_seen_zero;
+} PySSLSocket;
-static PyTypeObject PySSL_Type;
-static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args);
-static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args);
+static PyTypeObject PySSLContext_Type;
+static PyTypeObject PySSLSocket_Type;
+
+static PyObject *PySSL_SSLwrite(PySSLSocket *self, PyObject *args);
+static PyObject *PySSL_SSLread(PySSLSocket *self, PyObject *args);
static int check_socket_and_wait_for_timeout(PySocketSockObject *s,
int writing);
-static PyObject *PySSL_peercert(PySSLObject *self, PyObject *args);
-static PyObject *PySSL_cipher(PySSLObject *self);
+static PyObject *PySSL_peercert(PySSLSocket *self, PyObject *args);
+static PyObject *PySSL_cipher(PySSLSocket *self);
-#define PySSLObject_Check(v) (Py_TYPE(v) == &PySSL_Type)
+#define PySSLContext_Check(v) (Py_TYPE(v) == &PySSLContext_Type)
+#define PySSLSocket_Check(v) (Py_TYPE(v) == &PySSLSocket_Type)
typedef enum {
SOCKET_IS_NONBLOCKING,
@@ -154,7 +169,7 @@ typedef enum {
*/
static PyObject *
-PySSL_SetError(PySSLObject *obj, int ret, char *filename, int lineno)
+PySSL_SetError(PySSLSocket *obj, int ret, char *filename, int lineno)
{
PyObject *v;
char buf[2048];
@@ -264,127 +279,42 @@ _setSSLError (char *errstr, int errcode, char *filename, int lineno) {
return NULL;
}
-static PySSLObject *
-newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file,
+static PySSLSocket *
+newPySSLSocket(SSL_CTX *ctx, PySocketSockObject *sock,
enum py_ssl_server_or_client socket_type,
- enum py_ssl_cert_requirements certreq,
- enum py_ssl_version proto_version,
- char *cacerts_file)
+ char *server_hostname)
{
- PySSLObject *self;
- char *errstr = NULL;
- int ret;
- int verification_mode;
+ PySSLSocket *self;
- self = PyObject_New(PySSLObject, &PySSL_Type); /* Create new object */
+ self = PyObject_New(PySSLSocket, &PySSLSocket_Type);
if (self == NULL)
return NULL;
+
self->peer_cert = NULL;
self->ssl = NULL;
- self->ctx = NULL;
self->Socket = NULL;
/* Make sure the SSL error state is initialized */
(void) ERR_get_state();
ERR_clear_error();
- if ((key_file && !cert_file) || (!key_file && cert_file)) {
- errstr = ERRSTR("Both the key & certificate files "
- "must be specified");
- goto fail;
- }
-
- if ((socket_type == PY_SSL_SERVER) &&
- ((key_file == NULL) || (cert_file == NULL))) {
- errstr = ERRSTR("Both the key & certificate files "
- "must be specified for server-side operation");
- goto fail;
- }
-
- PySSL_BEGIN_ALLOW_THREADS
- if (proto_version == PY_SSL_VERSION_TLS1)
- self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
- else if (proto_version == PY_SSL_VERSION_SSL3)
- self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
- else if (proto_version == PY_SSL_VERSION_SSL2)
- self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
- else if (proto_version == PY_SSL_VERSION_SSL23)
- self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
- PySSL_END_ALLOW_THREADS
-
- if (self->ctx == NULL) {
- errstr = ERRSTR("Invalid SSL protocol variant specified.");
- goto fail;
- }
-
- if (certreq != PY_SSL_CERT_NONE) {
- if (cacerts_file == NULL) {
- errstr = ERRSTR("No root certificates specified for "
- "verification of other-side certificates.");
- goto fail;
- } else {
- PySSL_BEGIN_ALLOW_THREADS
- ret = SSL_CTX_load_verify_locations(self->ctx,
- cacerts_file,
- NULL);
- PySSL_END_ALLOW_THREADS
- if (ret != 1) {
- _setSSLError(NULL, 0, __FILE__, __LINE__);
- goto fail;
- }
- }
- }
- if (key_file) {
- PySSL_BEGIN_ALLOW_THREADS
- ret = SSL_CTX_use_PrivateKey_file(self->ctx, key_file,
- SSL_FILETYPE_PEM);
- PySSL_END_ALLOW_THREADS
- if (ret != 1) {
- _setSSLError(NULL, ret, __FILE__, __LINE__);
- goto fail;
- }
-
- PySSL_BEGIN_ALLOW_THREADS
- ret = SSL_CTX_use_certificate_chain_file(self->ctx,
- cert_file);
- PySSL_END_ALLOW_THREADS
- if (ret != 1) {
- /*
- fprintf(stderr, "ret is %d, errcode is %lu, %lu, with file \"%s\"\n",
- ret, ERR_peek_error(), ERR_peek_last_error(), cert_file);
- */
- if (ERR_peek_last_error() != 0) {
- _setSSLError(NULL, ret, __FILE__, __LINE__);
- goto fail;
- }
- }
- }
-
- /* ssl compatibility */
- SSL_CTX_set_options(self->ctx, SSL_OP_ALL);
-
- verification_mode = SSL_VERIFY_NONE;
- if (certreq == PY_SSL_CERT_OPTIONAL)
- verification_mode = SSL_VERIFY_PEER;
- else if (certreq == PY_SSL_CERT_REQUIRED)
- verification_mode = (SSL_VERIFY_PEER |
- SSL_VERIFY_FAIL_IF_NO_PEER_CERT);
- SSL_CTX_set_verify(self->ctx, verification_mode,
- NULL); /* set verify lvl */
-
PySSL_BEGIN_ALLOW_THREADS
- self->ssl = SSL_new(self->ctx); /* New ssl struct */
+ self->ssl = SSL_new(ctx);
PySSL_END_ALLOW_THREADS
- SSL_set_fd(self->ssl, Sock->sock_fd); /* Set the socket for SSL */
+ SSL_set_fd(self->ssl, sock->sock_fd);
#ifdef SSL_MODE_AUTO_RETRY
SSL_set_mode(self->ssl, SSL_MODE_AUTO_RETRY);
#endif
+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+ if (server_hostname != NULL)
+ SSL_set_tlsext_host_name(self->ssl, server_hostname);
+#endif
+
/* If the socket is in non-blocking mode or timeout mode, set the BIO
* to non-blocking mode (blocking is the default)
*/
- if (Sock->sock_timeout >= 0.0) {
- /* Set both the read and write BIO's to non-blocking mode */
+ if (sock->sock_timeout >= 0.0) {
BIO_set_nbio(SSL_get_rbio(self->ssl), 1);
BIO_set_nbio(SSL_get_wbio(self->ssl), 1);
}
@@ -396,55 +326,13 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file,
SSL_set_accept_state(self->ssl);
PySSL_END_ALLOW_THREADS
- self->Socket = PyWeakref_NewRef((PyObject *) Sock, Py_None);
+ self->Socket = PyWeakref_NewRef((PyObject *) sock, NULL);
return self;
- fail:
- if (errstr)
- PyErr_SetString(PySSLErrorObject, errstr);
- Py_DECREF(self);
- return NULL;
}
-static PyObject *
-PySSL_sslwrap(PyObject *self, PyObject *args)
-{
- PySocketSockObject *Sock;
- int server_side = 0;
- int verification_mode = PY_SSL_CERT_NONE;
- int protocol = PY_SSL_VERSION_SSL23;
- char *key_file = NULL;
- char *cert_file = NULL;
- char *cacerts_file = NULL;
-
- if (!PyArg_ParseTuple(args, "O!i|zziiz:sslwrap",
- PySocketModule.Sock_Type,
- &Sock,
- &server_side,
- &key_file, &cert_file,
- &verification_mode, &protocol,
- &cacerts_file))
- return NULL;
-
- /*
- fprintf(stderr,
- "server_side is %d, keyfile %p, certfile %p, verify_mode %d, "
- "protocol %d, certs %p\n",
- server_side, key_file, cert_file, verification_mode,
- protocol, cacerts_file);
- */
-
- return (PyObject *) newPySSLObject(Sock, key_file, cert_file,
- server_side, verification_mode,
- protocol, cacerts_file);
-}
-
-PyDoc_STRVAR(ssl_doc,
-"sslwrap(socket, server_side, [keyfile, certfile, certs_mode, protocol,\n"
-" cacertsfile]) -> sslobject");
-
/* SSL object methods */
-static PyObject *PySSL_SSLdo_handshake(PySSLObject *self)
+static PyObject *PySSL_SSLdo_handshake(PySSLSocket *self)
{
int ret;
int err;
@@ -482,7 +370,7 @@ static PyObject *PySSL_SSLdo_handshake(PySSLObject *self)
sockstate = SOCKET_OPERATION_OK;
}
if (sockstate == SOCKET_HAS_TIMED_OUT) {
- PyErr_SetString(PySSLErrorObject,
+ PyErr_SetString(PySocketModule.timeout_error,
ERRSTR("The handshake operation timed out"));
goto error;
} else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
@@ -812,7 +700,7 @@ _get_peer_alt_names (X509 *certificate) {
}
static PyObject *
-_decode_certificate (X509 *certificate, int verbose) {
+_decode_certificate(X509 *certificate) {
PyObject *retval = NULL;
BIO *biobuf = NULL;
@@ -841,65 +729,60 @@ _decode_certificate (X509 *certificate, int verbose) {
}
Py_DECREF(peer);
- if (verbose) {
- issuer = _create_tuple_for_X509_NAME(
- X509_get_issuer_name(certificate));
- if (issuer == NULL)
- goto fail0;
- if (PyDict_SetItemString(retval, (const char *)"issuer", issuer) < 0) {
- Py_DECREF(issuer);
- goto fail0;
- }
+ issuer = _create_tuple_for_X509_NAME(
+ X509_get_issuer_name(certificate));
+ if (issuer == NULL)
+ goto fail0;
+ if (PyDict_SetItemString(retval, (const char *)"issuer", issuer) < 0) {
Py_DECREF(issuer);
+ goto fail0;
+ }
+ Py_DECREF(issuer);
- version = PyLong_FromLong(X509_get_version(certificate) + 1);
- if (PyDict_SetItemString(retval, "version", version) < 0) {
- Py_DECREF(version);
- goto fail0;
- }
+ version = PyLong_FromLong(X509_get_version(certificate) + 1);
+ if (PyDict_SetItemString(retval, "version", version) < 0) {
Py_DECREF(version);
+ goto fail0;
}
+ Py_DECREF(version);
/* get a memory buffer */
biobuf = BIO_new(BIO_s_mem());
- if (verbose) {
-
- (void) BIO_reset(biobuf);
- serialNumber = X509_get_serialNumber(certificate);
- /* should not exceed 20 octets, 160 bits, so buf is big enough */
- i2a_ASN1_INTEGER(biobuf, serialNumber);
- len = BIO_gets(biobuf, buf, sizeof(buf)-1);
- if (len < 0) {
- _setSSLError(NULL, 0, __FILE__, __LINE__);
- goto fail1;
- }
- sn_obj = PyUnicode_FromStringAndSize(buf, len);
- if (sn_obj == NULL)
- goto fail1;
- if (PyDict_SetItemString(retval, "serialNumber", sn_obj) < 0) {
- Py_DECREF(sn_obj);
- goto fail1;
- }
+ (void) BIO_reset(biobuf);
+ serialNumber = X509_get_serialNumber(certificate);
+ /* should not exceed 20 octets, 160 bits, so buf is big enough */
+ i2a_ASN1_INTEGER(biobuf, serialNumber);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+ if (len < 0) {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ goto fail1;
+ }
+ sn_obj = PyUnicode_FromStringAndSize(buf, len);
+ if (sn_obj == NULL)
+ goto fail1;
+ if (PyDict_SetItemString(retval, "serialNumber", sn_obj) < 0) {
Py_DECREF(sn_obj);
+ goto fail1;
+ }
+ Py_DECREF(sn_obj);
- (void) BIO_reset(biobuf);
- notBefore = X509_get_notBefore(certificate);
- ASN1_TIME_print(biobuf, notBefore);
- len = BIO_gets(biobuf, buf, sizeof(buf)-1);
- if (len < 0) {
- _setSSLError(NULL, 0, __FILE__, __LINE__);
- goto fail1;
- }
- pnotBefore = PyUnicode_FromStringAndSize(buf, len);
- if (pnotBefore == NULL)
- goto fail1;
- if (PyDict_SetItemString(retval, "notBefore", pnotBefore) < 0) {
- Py_DECREF(pnotBefore);
- goto fail1;
- }
+ (void) BIO_reset(biobuf);
+ notBefore = X509_get_notBefore(certificate);
+ ASN1_TIME_print(biobuf, notBefore);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+ if (len < 0) {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ goto fail1;
+ }
+ pnotBefore = PyUnicode_FromStringAndSize(buf, len);
+ if (pnotBefore == NULL)
+ goto fail1;
+ if (PyDict_SetItemString(retval, "notBefore", pnotBefore) < 0) {
Py_DECREF(pnotBefore);
+ goto fail1;
}
+ Py_DECREF(pnotBefore);
(void) BIO_reset(biobuf);
notAfter = X509_get_notAfter(certificate);
@@ -948,13 +831,12 @@ static PyObject *
PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
PyObject *retval = NULL;
- char *filename = NULL;
+ PyObject *filename;
X509 *x=NULL;
BIO *cert;
- int verbose = 1;
- if (!PyArg_ParseTuple(args, "s|i:test_decode_certificate",
- &filename, &verbose))
+ if (!PyArg_ParseTuple(args, "O&:test_decode_certificate",
+ PyUnicode_FSConverter, &filename))
return NULL;
if ((cert=BIO_new(BIO_s_file())) == NULL) {
@@ -963,7 +845,7 @@ PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
goto fail0;
}
- if (BIO_read_filename(cert,filename) <= 0) {
+ if (BIO_read_filename(cert, PyBytes_AsString(filename)) <= 0) {
PyErr_SetString(PySSLErrorObject,
"Can't open file");
goto fail0;
@@ -976,18 +858,18 @@ PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
goto fail0;
}
- retval = _decode_certificate(x, verbose);
+ retval = _decode_certificate(x);
X509_free(x);
fail0:
-
+ Py_DECREF(filename);
if (cert != NULL) BIO_free(cert);
return retval;
}
static PyObject *
-PySSL_peercert(PySSLObject *self, PyObject *args)
+PySSL_peercert(PySSLSocket *self, PyObject *args)
{
PyObject *retval = NULL;
int len;
@@ -1018,12 +900,11 @@ PySSL_peercert(PySSLObject *self, PyObject *args)
return retval;
} else {
-
- verification = SSL_CTX_get_verify_mode(self->ctx);
+ verification = SSL_CTX_get_verify_mode(SSL_get_SSL_CTX(self->ssl));
if ((verification & SSL_VERIFY_PEER) == 0)
return PyDict_New();
else
- return _decode_certificate (self->peer_cert, 0);
+ return _decode_certificate(self->peer_cert);
}
}
@@ -1039,7 +920,7 @@ If the optional argument is True, returns a DER-encoded copy of the\n\
peer certificate, or None if no certificate was provided. This will\n\
return the certificate even if it wasn't validated.");
-static PyObject *PySSL_cipher (PySSLObject *self) {
+static PyObject *PySSL_cipher (PySSLSocket *self) {
PyObject *retval, *v;
const SSL_CIPHER *current;
@@ -1087,14 +968,12 @@ static PyObject *PySSL_cipher (PySSLObject *self) {
return NULL;
}
-static void PySSL_dealloc(PySSLObject *self)
+static void PySSL_dealloc(PySSLSocket *self)
{
if (self->peer_cert) /* Possible not to have one? */
X509_free (self->peer_cert);
if (self->ssl)
SSL_free(self->ssl);
- if (self->ctx)
- SSL_CTX_free(self->ctx);
Py_XDECREF(self->Socket);
PyObject_Del(self);
}
@@ -1169,11 +1048,10 @@ normal_return:
return rc == 0 ? SOCKET_HAS_TIMED_OUT : SOCKET_OPERATION_OK;
}
-static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
+static PyObject *PySSL_SSLwrite(PySSLSocket *self, PyObject *args)
{
- char *data;
+ Py_buffer buf;
int len;
- int count;
int sockstate;
int err;
int nonblocking;
@@ -1187,7 +1065,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
}
Py_INCREF(sock);
- if (!PyArg_ParseTuple(args, "y#:write", &data, &count)) {
+ if (!PyArg_ParseTuple(args, "y*:write", &buf)) {
Py_DECREF(sock);
return NULL;
}
@@ -1199,7 +1077,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
sockstate = check_socket_and_wait_for_timeout(sock, 1);
if (sockstate == SOCKET_HAS_TIMED_OUT) {
- PyErr_SetString(PySSLErrorObject,
+ PyErr_SetString(PySocketModule.timeout_error,
"The write operation timed out");
goto error;
} else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
@@ -1214,11 +1092,12 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
do {
err = 0;
PySSL_BEGIN_ALLOW_THREADS
- len = SSL_write(self->ssl, data, count);
+ len = SSL_write(self->ssl, buf.buf, buf.len);
err = SSL_get_error(self->ssl, len);
PySSL_END_ALLOW_THREADS
- if (PyErr_CheckSignals())
+ if (PyErr_CheckSignals()) {
goto error;
+ }
if (err == SSL_ERROR_WANT_READ) {
sockstate = check_socket_and_wait_for_timeout(sock, 0);
} else if (err == SSL_ERROR_WANT_WRITE) {
@@ -1227,7 +1106,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
sockstate = SOCKET_OPERATION_OK;
}
if (sockstate == SOCKET_HAS_TIMED_OUT) {
- PyErr_SetString(PySSLErrorObject,
+ PyErr_SetString(PySocketModule.timeout_error,
"The write operation timed out");
goto error;
} else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
@@ -1240,6 +1119,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
} while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
Py_DECREF(sock);
+ PyBuffer_Release(&buf);
if (len > 0)
return PyLong_FromLong(len);
else
@@ -1247,6 +1127,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
error:
Py_DECREF(sock);
+ PyBuffer_Release(&buf);
return NULL;
}
@@ -1256,7 +1137,7 @@ PyDoc_STRVAR(PySSL_SSLwrite_doc,
Writes the string s into the SSL object. Returns the number\n\
of bytes written.");
-static PyObject *PySSL_SSLpending(PySSLObject *self)
+static PyObject *PySSL_SSLpending(PySSLSocket *self)
{
int count = 0;
@@ -1275,7 +1156,7 @@ PyDoc_STRVAR(PySSL_SSLpending_doc,
Returns the number of already decrypted bytes available for read,\n\
pending on the connection.\n");
-static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
+static PyObject *PySSL_SSLread(PySSLSocket *self, PyObject *args)
{
PyObject *dest = NULL;
Py_buffer buf;
@@ -1332,7 +1213,7 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
if (!count) {
sockstate = check_socket_and_wait_for_timeout(sock, 0);
if (sockstate == SOCKET_HAS_TIMED_OUT) {
- PyErr_SetString(PySSLErrorObject,
+ PyErr_SetString(PySocketModule.timeout_error,
"The read operation timed out");
goto error;
} else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
@@ -1366,7 +1247,7 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
sockstate = SOCKET_OPERATION_OK;
}
if (sockstate == SOCKET_HAS_TIMED_OUT) {
- PyErr_SetString(PySSLErrorObject,
+ PyErr_SetString(PySocketModule.timeout_error,
"The read operation timed out");
goto error;
} else if (sockstate == SOCKET_IS_NONBLOCKING) {
@@ -1403,7 +1284,7 @@ PyDoc_STRVAR(PySSL_SSLread_doc,
\n\
Read up to len bytes from the SSL socket.");
-static PyObject *PySSL_SSLshutdown(PySSLObject *self)
+static PyObject *PySSL_SSLshutdown(PySSLSocket *self)
{
int err, ssl_err, sockstate, nonblocking;
int zeros = 0;
@@ -1461,10 +1342,10 @@ static PyObject *PySSL_SSLshutdown(PySSLObject *self)
break;
if (sockstate == SOCKET_HAS_TIMED_OUT) {
if (ssl_err == SSL_ERROR_WANT_READ)
- PyErr_SetString(PySSLErrorObject,
+ PyErr_SetString(PySocketModule.timeout_error,
"The read operation timed out");
else
- PyErr_SetString(PySSLErrorObject,
+ PyErr_SetString(PySocketModule.timeout_error,
"The write operation timed out");
goto error;
}
@@ -1514,10 +1395,10 @@ static PyMethodDef PySSLMethods[] = {
{NULL, NULL}
};
-static PyTypeObject PySSL_Type = {
+static PyTypeObject PySSLSocket_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "ssl.SSLContext", /*tp_name*/
- sizeof(PySSLObject), /*tp_basicsize*/
+ "_ssl._SSLSocket", /*tp_name*/
+ sizeof(PySSLSocket), /*tp_basicsize*/
0, /*tp_itemsize*/
/* methods */
(destructor)PySSL_dealloc, /*tp_dealloc*/
@@ -1546,6 +1427,441 @@ static PyTypeObject PySSL_Type = {
PySSLMethods, /*tp_methods*/
};
+
+/*
+ * _SSLContext objects
+ */
+
+static PyObject *
+context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ char *kwlist[] = {"protocol", NULL};
+ PySSLContext *self;
+ int proto_version = PY_SSL_VERSION_SSL23;
+ SSL_CTX *ctx = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kwds, "i:_SSLContext", kwlist,
+ &proto_version))
+ return NULL;
+
+ PySSL_BEGIN_ALLOW_THREADS
+ if (proto_version == PY_SSL_VERSION_TLS1)
+ ctx = SSL_CTX_new(TLSv1_method());
+ else if (proto_version == PY_SSL_VERSION_SSL3)
+ ctx = SSL_CTX_new(SSLv3_method());
+ else if (proto_version == PY_SSL_VERSION_SSL2)
+ ctx = SSL_CTX_new(SSLv2_method());
+ else if (proto_version == PY_SSL_VERSION_SSL23)
+ ctx = SSL_CTX_new(SSLv23_method());
+ else
+ proto_version = -1;
+ PySSL_END_ALLOW_THREADS
+
+ if (proto_version == -1) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid protocol version");
+ return NULL;
+ }
+ if (ctx == NULL) {
+ PyErr_SetString(PySSLErrorObject,
+ "failed to allocate SSL context");
+ return NULL;
+ }
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ self = (PySSLContext *) type->tp_alloc(type, 0);
+ if (self == NULL) {
+ SSL_CTX_free(ctx);
+ return NULL;
+ }
+ self->ctx = ctx;
+ /* Defaults */
+ SSL_CTX_set_verify(self->ctx, SSL_VERIFY_NONE, NULL);
+ SSL_CTX_set_options(self->ctx, SSL_OP_ALL);
+
+#define SID_CTX "Python"
+ SSL_CTX_set_session_id_context(self->ctx, (const unsigned char *) SID_CTX,
+ sizeof(SID_CTX));
+#undef SID_CTX
+
+ return (PyObject *)self;
+}
+
+static void
+context_dealloc(PySSLContext *self)
+{
+ SSL_CTX_free(self->ctx);
+ Py_TYPE(self)->tp_free(self);
+}
+
+static PyObject *
+set_ciphers(PySSLContext *self, PyObject *args)
+{
+ int ret;
+ const char *cipherlist;
+
+ if (!PyArg_ParseTuple(args, "s:set_ciphers", &cipherlist))
+ return NULL;
+ ret = SSL_CTX_set_cipher_list(self->ctx, cipherlist);
+ if (ret == 0) {
+ /* Clearing the error queue is necessary on some OpenSSL versions,
+ otherwise the error will be reported again when another SSL call
+ is done. */
+ ERR_clear_error();
+ PyErr_SetString(PySSLErrorObject,
+ "No cipher can be selected.");
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+get_verify_mode(PySSLContext *self, void *c)
+{
+ switch (SSL_CTX_get_verify_mode(self->ctx)) {
+ case SSL_VERIFY_NONE:
+ return PyLong_FromLong(PY_SSL_CERT_NONE);
+ case SSL_VERIFY_PEER:
+ return PyLong_FromLong(PY_SSL_CERT_OPTIONAL);
+ case SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT:
+ return PyLong_FromLong(PY_SSL_CERT_REQUIRED);
+ }
+ PyErr_SetString(PySSLErrorObject,
+ "invalid return value from SSL_CTX_get_verify_mode");
+ return NULL;
+}
+
+static int
+set_verify_mode(PySSLContext *self, PyObject *arg, void *c)
+{
+ int n, mode;
+ if (!PyArg_Parse(arg, "i", &n))
+ return -1;
+ if (n == PY_SSL_CERT_NONE)
+ mode = SSL_VERIFY_NONE;
+ else if (n == PY_SSL_CERT_OPTIONAL)
+ mode = SSL_VERIFY_PEER;
+ else if (n == PY_SSL_CERT_REQUIRED)
+ mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid value for verify_mode");
+ return -1;
+ }
+ SSL_CTX_set_verify(self->ctx, mode, NULL);
+ return 0;
+}
+
+static PyObject *
+get_options(PySSLContext *self, void *c)
+{
+ return PyLong_FromLong(SSL_CTX_get_options(self->ctx));
+}
+
+static int
+set_options(PySSLContext *self, PyObject *arg, void *c)
+{
+ long new_opts, opts, set, clear;
+ if (!PyArg_Parse(arg, "l", &new_opts))
+ return -1;
+ opts = SSL_CTX_get_options(self->ctx);
+ clear = opts & ~new_opts;
+ set = ~opts & new_opts;
+ if (clear) {
+#ifdef HAVE_SSL_CTX_CLEAR_OPTIONS
+ SSL_CTX_clear_options(self->ctx, clear);
+#else
+ PyErr_SetString(PyExc_ValueError,
+ "can't clear options before OpenSSL 0.9.8m");
+ return -1;
+#endif
+ }
+ if (set)
+ SSL_CTX_set_options(self->ctx, set);
+ return 0;
+}
+
+static PyObject *
+load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
+{
+ char *kwlist[] = {"certfile", "keyfile", NULL};
+ PyObject *certfile, *keyfile = NULL;
+ PyObject *certfile_bytes = NULL, *keyfile_bytes = NULL;
+ int r;
+
+ errno = 0;
+ ERR_clear_error();
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "O|O:load_cert_chain", kwlist,
+ &certfile, &keyfile))
+ return NULL;
+ if (keyfile == Py_None)
+ keyfile = NULL;
+ if (!PyUnicode_FSConverter(certfile, &certfile_bytes)) {
+ PyErr_SetString(PyExc_TypeError,
+ "certfile should be a valid filesystem path");
+ return NULL;
+ }
+ if (keyfile && !PyUnicode_FSConverter(keyfile, &keyfile_bytes)) {
+ PyErr_SetString(PyExc_TypeError,
+ "keyfile should be a valid filesystem path");
+ goto error;
+ }
+ PySSL_BEGIN_ALLOW_THREADS
+ r = SSL_CTX_use_certificate_chain_file(self->ctx,
+ PyBytes_AS_STRING(certfile_bytes));
+ PySSL_END_ALLOW_THREADS
+ if (r != 1) {
+ if (errno != 0) {
+ ERR_clear_error();
+ PyErr_SetFromErrno(PyExc_IOError);
+ }
+ else {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ }
+ goto error;
+ }
+ PySSL_BEGIN_ALLOW_THREADS
+ r = SSL_CTX_use_PrivateKey_file(self->ctx,
+ PyBytes_AS_STRING(keyfile ? keyfile_bytes : certfile_bytes),
+ SSL_FILETYPE_PEM);
+ PySSL_END_ALLOW_THREADS
+ Py_XDECREF(keyfile_bytes);
+ Py_XDECREF(certfile_bytes);
+ if (r != 1) {
+ if (errno != 0) {
+ ERR_clear_error();
+ PyErr_SetFromErrno(PyExc_IOError);
+ }
+ else {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ }
+ return NULL;
+ }
+ PySSL_BEGIN_ALLOW_THREADS
+ r = SSL_CTX_check_private_key(self->ctx);
+ PySSL_END_ALLOW_THREADS
+ if (r != 1) {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+
+error:
+ Py_XDECREF(keyfile_bytes);
+ Py_XDECREF(certfile_bytes);
+ return NULL;
+}
+
+static PyObject *
+load_verify_locations(PySSLContext *self, PyObject *args, PyObject *kwds)
+{
+ char *kwlist[] = {"cafile", "capath", NULL};
+ PyObject *cafile = NULL, *capath = NULL;
+ PyObject *cafile_bytes = NULL, *capath_bytes = NULL;
+ const char *cafile_buf = NULL, *capath_buf = NULL;
+ int r;
+
+ errno = 0;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "|OO:load_verify_locations", kwlist,
+ &cafile, &capath))
+ return NULL;
+ if (cafile == Py_None)
+ cafile = NULL;
+ if (capath == Py_None)
+ capath = NULL;
+ if (cafile == NULL && capath == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "cafile and capath cannot be both omitted");
+ return NULL;
+ }
+ if (cafile && !PyUnicode_FSConverter(cafile, &cafile_bytes)) {
+ PyErr_SetString(PyExc_TypeError,
+ "cafile should be a valid filesystem path");
+ return NULL;
+ }
+ if (capath && !PyUnicode_FSConverter(capath, &capath_bytes)) {
+ Py_XDECREF(cafile_bytes);
+ PyErr_SetString(PyExc_TypeError,
+ "capath should be a valid filesystem path");
+ return NULL;
+ }
+ if (cafile)
+ cafile_buf = PyBytes_AS_STRING(cafile_bytes);
+ if (capath)
+ capath_buf = PyBytes_AS_STRING(capath_bytes);
+ PySSL_BEGIN_ALLOW_THREADS
+ r = SSL_CTX_load_verify_locations(self->ctx, cafile_buf, capath_buf);
+ PySSL_END_ALLOW_THREADS
+ Py_XDECREF(cafile_bytes);
+ Py_XDECREF(capath_bytes);
+ if (r != 1) {
+ if (errno != 0) {
+ ERR_clear_error();
+ PyErr_SetFromErrno(PyExc_IOError);
+ }
+ else {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ }
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+context_wrap_socket(PySSLContext *self, PyObject *args, PyObject *kwds)
+{
+ char *kwlist[] = {"sock", "server_side", "server_hostname", NULL};
+ PySocketSockObject *sock;
+ int server_side = 0;
+ char *hostname = NULL;
+ PyObject *hostname_obj, *res;
+
+ /* server_hostname is either None (or absent), or to be encoded
+ using the idna encoding. */
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!i|O!:_wrap_socket", kwlist,
+ PySocketModule.Sock_Type,
+ &sock, &server_side,
+ Py_TYPE(Py_None), &hostname_obj)) {
+ PyErr_Clear();
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!iet:_wrap_socket", kwlist,
+ PySocketModule.Sock_Type,
+ &sock, &server_side,
+ "idna", &hostname))
+ return NULL;
+#ifndef SSL_CTRL_SET_TLSEXT_HOSTNAME
+ PyMem_Free(hostname);
+ PyErr_SetString(PyExc_ValueError, "server_hostname is not supported "
+ "by your OpenSSL library");
+ return NULL;
+#endif
+ }
+
+ res = (PyObject *) newPySSLSocket(self->ctx, sock, server_side,
+ hostname);
+ if (hostname != NULL)
+ PyMem_Free(hostname);
+ return res;
+}
+
+static PyObject *
+session_stats(PySSLContext *self, PyObject *unused)
+{
+ int r;
+ PyObject *value, *stats = PyDict_New();
+ if (!stats)
+ return NULL;
+
+#define ADD_STATS(SSL_NAME, KEY_NAME) \
+ value = PyLong_FromLong(SSL_CTX_sess_ ## SSL_NAME (self->ctx)); \
+ if (value == NULL) \
+ goto error; \
+ r = PyDict_SetItemString(stats, KEY_NAME, value); \
+ Py_DECREF(value); \
+ if (r < 0) \
+ goto error;
+
+ ADD_STATS(number, "number");
+ ADD_STATS(connect, "connect");
+ ADD_STATS(connect_good, "connect_good");
+ ADD_STATS(connect_renegotiate, "connect_renegotiate");
+ ADD_STATS(accept, "accept");
+ ADD_STATS(accept_good, "accept_good");
+ ADD_STATS(accept_renegotiate, "accept_renegotiate");
+ ADD_STATS(accept, "accept");
+ ADD_STATS(hits, "hits");
+ ADD_STATS(misses, "misses");
+ ADD_STATS(timeouts, "timeouts");
+ ADD_STATS(cache_full, "cache_full");
+
+#undef ADD_STATS
+
+ return stats;
+
+error:
+ Py_DECREF(stats);
+ return NULL;
+}
+
+static PyObject *
+set_default_verify_paths(PySSLContext *self, PyObject *unused)
+{
+ if (!SSL_CTX_set_default_verify_paths(self->ctx)) {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyGetSetDef context_getsetlist[] = {
+ {"options", (getter) get_options,
+ (setter) set_options, NULL},
+ {"verify_mode", (getter) get_verify_mode,
+ (setter) set_verify_mode, NULL},
+ {NULL}, /* sentinel */
+};
+
+static struct PyMethodDef context_methods[] = {
+ {"_wrap_socket", (PyCFunction) context_wrap_socket,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"set_ciphers", (PyCFunction) set_ciphers,
+ METH_VARARGS, NULL},
+ {"load_cert_chain", (PyCFunction) load_cert_chain,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"load_verify_locations", (PyCFunction) load_verify_locations,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"session_stats", (PyCFunction) session_stats,
+ METH_NOARGS, NULL},
+ {"set_default_verify_paths", (PyCFunction) set_default_verify_paths,
+ METH_NOARGS, NULL},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyTypeObject PySSLContext_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ssl._SSLContext", /*tp_name*/
+ sizeof(PySSLContext), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ (destructor)context_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_reserved*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ context_methods, /*tp_methods*/
+ 0, /*tp_members*/
+ context_getsetlist, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ context_new, /*tp_new*/
+};
+
+
+
#ifdef HAVE_OPENSSL_RAND
/* helper routines for seeding the SSL PRNG */
@@ -1583,15 +1899,17 @@ It is necessary to seed the PRNG with RAND_add() on some platforms before\n\
using the ssl() function.");
static PyObject *
-PySSL_RAND_egd(PyObject *self, PyObject *arg)
+PySSL_RAND_egd(PyObject *self, PyObject *args)
{
+ PyObject *path;
int bytes;
- if (!PyUnicode_Check(arg))
- return PyErr_Format(PyExc_TypeError,
- "RAND_egd() expected string, found %s",
- Py_TYPE(arg)->tp_name);
- bytes = RAND_egd(_PyUnicode_AsString(arg));
+ if (!PyArg_ParseTuple(args, "O&|i:RAND_egd",
+ PyUnicode_FSConverter, &path))
+ return NULL;
+
+ bytes = RAND_egd(PyBytes_AsString(path));
+ Py_DECREF(path);
if (bytes == -1) {
PyErr_SetString(PySSLErrorObject,
"EGD connection failed or EGD did not return "
@@ -1615,14 +1933,12 @@ fails or if it does provide enough data to seed PRNG.");
/* List of functions exported by this module. */
static PyMethodDef PySSL_methods[] = {
- {"sslwrap", PySSL_sslwrap,
- METH_VARARGS, ssl_doc},
{"_test_decode_cert", PySSL_test_decode_certificate,
METH_VARARGS},
#ifdef HAVE_OPENSSL_RAND
{"RAND_add", PySSL_RAND_add, METH_VARARGS,
PySSL_RAND_add_doc},
- {"RAND_egd", PySSL_RAND_egd, METH_O,
+ {"RAND_egd", PySSL_RAND_egd, METH_VARARGS,
PySSL_RAND_egd_doc},
{"RAND_status", (PyCFunction)PySSL_RAND_status, METH_NOARGS,
PySSL_RAND_status_doc},
@@ -1720,10 +2036,14 @@ static struct PyModuleDef _sslmodule = {
PyMODINIT_FUNC
PyInit__ssl(void)
{
- PyObject *m, *d;
+ PyObject *m, *d, *r;
+ unsigned long libver;
+ unsigned int major, minor, fix, patch, status;
PySocketModule_APIObject *socket_api;
- if (PyType_Ready(&PySSL_Type) < 0)
+ if (PyType_Ready(&PySSLContext_Type) < 0)
+ return NULL;
+ if (PyType_Ready(&PySSLSocket_Type) < 0)
return NULL;
m = PyModule_Create(&_sslmodule);
@@ -1756,8 +2076,11 @@ PyInit__ssl(void)
return NULL;
if (PyDict_SetItemString(d, "SSLError", PySSLErrorObject) != 0)
return NULL;
- if (PyDict_SetItemString(d, "SSLType",
- (PyObject *)&PySSL_Type) != 0)
+ if (PyDict_SetItemString(d, "_SSLContext",
+ (PyObject *)&PySSLContext_Type) != 0)
+ return NULL;
+ if (PyDict_SetItemString(d, "_SSLSocket",
+ (PyObject *)&PySSLSocket_Type) != 0)
return NULL;
PyModule_AddIntConstant(m, "SSL_ERROR_ZERO_RETURN",
PY_SSL_ERROR_ZERO_RETURN);
@@ -1795,5 +2118,46 @@ PyInit__ssl(void)
PY_SSL_VERSION_SSL23);
PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
PY_SSL_VERSION_TLS1);
+
+ /* protocol options */
+ PyModule_AddIntConstant(m, "OP_ALL", SSL_OP_ALL);
+ PyModule_AddIntConstant(m, "OP_NO_SSLv2", SSL_OP_NO_SSLv2);
+ PyModule_AddIntConstant(m, "OP_NO_SSLv3", SSL_OP_NO_SSLv3);
+ PyModule_AddIntConstant(m, "OP_NO_TLSv1", SSL_OP_NO_TLSv1);
+
+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+ r = Py_True;
+#else
+ r = Py_False;
+#endif
+ Py_INCREF(r);
+ PyModule_AddObject(m, "HAS_SNI", r);
+
+ /* OpenSSL version */
+ /* SSLeay() gives us the version of the library linked against,
+ which could be different from the headers version.
+ */
+ libver = SSLeay();
+ r = PyLong_FromUnsignedLong(libver);
+ if (r == NULL)
+ return NULL;
+ if (PyModule_AddObject(m, "OPENSSL_VERSION_NUMBER", r))
+ return NULL;
+ status = libver & 0xF;
+ libver >>= 4;
+ patch = libver & 0xFF;
+ libver >>= 8;
+ fix = libver & 0xFF;
+ libver >>= 8;
+ minor = libver & 0xFF;
+ libver >>= 8;
+ major = libver & 0xFF;
+ r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
+ if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION_INFO", r))
+ return NULL;
+ r = PyUnicode_FromString(SSLeay_version(SSLEAY_VERSION));
+ if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION", r))
+ return NULL;
+
return m;
}
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 092b72c9f8..1604b90dfd 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -6,7 +6,6 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
-#include "structseq.h"
#include "structmember.h"
#include <ctype.h>
@@ -89,19 +88,30 @@ typedef struct { char c; _Bool x; } s_bool;
#pragma options align=reset
#endif
-/* Helper to get a PyLongObject. Caller should decref. */
+/* Helper for integer format codes: converts an arbitrary Python object to a
+ PyLongObject if possible, otherwise fails. Caller should decref. */
static PyObject *
get_pylong(PyObject *v)
{
assert(v != NULL);
if (!PyLong_Check(v)) {
- PyErr_SetString(StructError,
- "required argument is not an integer");
- return NULL;
+ /* Not an integer; try to use __index__ to convert. */
+ if (PyIndex_Check(v)) {
+ v = PyNumber_Index(v);
+ if (v == NULL)
+ return NULL;
+ }
+ else {
+ PyErr_SetString(StructError,
+ "required argument is not an integer");
+ return NULL;
+ }
}
+ else
+ Py_INCREF(v);
- Py_INCREF(v);
+ assert(PyLong_Check(v));
return v;
}
@@ -113,13 +123,13 @@ get_long(PyObject *v, long *p)
{
long x;
- if (!PyLong_Check(v)) {
- PyErr_SetString(StructError,
- "required argument is not an integer");
+ v = get_pylong(v);
+ if (v == NULL)
return -1;
- }
+ assert(PyLong_Check(v));
x = PyLong_AsLong(v);
- if (x == -1 && PyErr_Occurred()) {
+ Py_DECREF(v);
+ if (x == (long)-1 && PyErr_Occurred()) {
if (PyErr_ExceptionMatches(PyExc_OverflowError))
PyErr_SetString(StructError,
"argument out of range");
@@ -132,18 +142,17 @@ get_long(PyObject *v, long *p)
/* Same, but handling unsigned long */
-#ifndef PY_STRUCT_OVERFLOW_MASKING
static int
get_ulong(PyObject *v, unsigned long *p)
{
unsigned long x;
- if (!PyLong_Check(v)) {
- PyErr_SetString(StructError,
- "required argument is not an integer");
+ v = get_pylong(v);
+ if (v == NULL)
return -1;
- }
+ assert(PyLong_Check(v));
x = PyLong_AsUnsignedLong(v);
+ Py_DECREF(v);
if (x == (unsigned long)-1 && PyErr_Occurred()) {
if (PyErr_ExceptionMatches(PyExc_OverflowError))
PyErr_SetString(StructError,
@@ -153,7 +162,6 @@ get_ulong(PyObject *v, unsigned long *p)
*p = x;
return 0;
}
-#endif /* PY_STRUCT_OVERFLOW_MASKING */
#ifdef HAVE_LONG_LONG
@@ -163,13 +171,14 @@ static int
get_longlong(PyObject *v, PY_LONG_LONG *p)
{
PY_LONG_LONG x;
- if (!PyLong_Check(v)) {
- PyErr_SetString(StructError,
- "required argument is not an integer");
+
+ v = get_pylong(v);
+ if (v == NULL)
return -1;
- }
+ assert(PyLong_Check(v));
x = PyLong_AsLongLong(v);
- if (x == -1 && PyErr_Occurred()) {
+ Py_DECREF(v);
+ if (x == (PY_LONG_LONG)-1 && PyErr_Occurred()) {
if (PyErr_ExceptionMatches(PyExc_OverflowError))
PyErr_SetString(StructError,
"argument out of range");
@@ -185,13 +194,14 @@ static int
get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p)
{
unsigned PY_LONG_LONG x;
- if (!PyLong_Check(v)) {
- PyErr_SetString(StructError,
- "required argument is not an integer");
+
+ v = get_pylong(v);
+ if (v == NULL)
return -1;
- }
+ assert(PyLong_Check(v));
x = PyLong_AsUnsignedLongLong(v);
- if (x == -1 && PyErr_Occurred()) {
+ Py_DECREF(v);
+ if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred()) {
if (PyErr_ExceptionMatches(PyExc_OverflowError))
PyErr_SetString(StructError,
"argument out of range");
@@ -452,14 +462,9 @@ np_ubyte(char *p, PyObject *v, const formatdef *f)
static int
np_char(char *p, PyObject *v, const formatdef *f)
{
- if (PyUnicode_Check(v)) {
- v = _PyUnicode_AsDefaultEncodedString(v, NULL);
- if (v == NULL)
- return -1;
- }
if (!PyBytes_Check(v) || PyBytes_Size(v) != 1) {
PyErr_SetString(StructError,
- "char format requires bytes or string of length 1");
+ "char format requires a bytes object of length 1");
return -1;
}
*p = *PyBytes_AsString(v);
@@ -1192,8 +1197,11 @@ prepare_s(PyStructObject *self)
goto overflow;
num = num*10 + (c - '0');
}
- if (c == '\0')
- break;
+ if (c == '\0') {
+ PyErr_SetString(StructError,
+ "repeat count given without format specifier");
+ return -1;
+ }
}
else
num = 1;
@@ -1332,7 +1340,7 @@ s_init(PyObject *self, PyObject *args, PyObject *kwds)
if (!PyBytes_Check(o_format)) {
Py_DECREF(o_format);
PyErr_Format(PyExc_TypeError,
- "Struct() argument 1 must be bytes, not %.200s",
+ "Struct() argument 1 must be a bytes object, not %.200s",
Py_TYPE(o_format)->tp_name);
return -1;
}
@@ -1410,7 +1418,7 @@ s_unpack(PyObject *self, PyObject *input)
return NULL;
if (vbuf.len != soself->s_size) {
PyErr_Format(StructError,
- "unpack requires a bytes argument of length %zd",
+ "unpack requires a bytes object of length %zd",
soself->s_size);
PyBuffer_Release(&vbuf);
return NULL;
@@ -1490,15 +1498,10 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
if (e->format == 's') {
int isstring;
void *p;
- if (PyUnicode_Check(v)) {
- v = _PyUnicode_AsDefaultEncodedString(v, NULL);
- if (v == NULL)
- return -1;
- }
isstring = PyBytes_Check(v);
if (!isstring && !PyByteArray_Check(v)) {
PyErr_SetString(StructError,
- "argument for 's' must be a bytes or string");
+ "argument for 's' must be a bytes object");
return -1;
}
if (isstring) {
@@ -1516,15 +1519,10 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
} else if (e->format == 'p') {
int isstring;
void *p;
- if (PyUnicode_Check(v)) {
- v = _PyUnicode_AsDefaultEncodedString(v, NULL);
- if (v == NULL)
- return -1;
- }
isstring = PyBytes_Check(v);
if (!isstring && !PyByteArray_Check(v)) {
PyErr_SetString(StructError,
- "argument for 'p' must be a bytes or string");
+ "argument for 'p' must be a bytes object");
return -1;
}
if (isstring) {
@@ -1678,7 +1676,7 @@ static struct PyMethodDef s_methods[] = {
{NULL, NULL} /* sentinel */
};
-PyDoc_STRVAR(s__doc__,
+PyDoc_STRVAR(s__doc__,
"Struct(fmt) --> compiled struct object\n"
"\n"
"Return a new Struct object which writes and reads binary data according to\n"
@@ -1920,10 +1918,10 @@ unpack_from(PyObject *self, PyObject *args, PyObject *kwds)
static struct PyMethodDef module_functions[] = {
{"_clearcache", (PyCFunction)clearcache, METH_NOARGS, clearcache_doc},
- {"calcsize", calcsize, METH_O, calcsize_doc},
+ {"calcsize", calcsize, METH_O, calcsize_doc},
{"pack", pack, METH_VARARGS, pack_doc},
{"pack_into", pack_into, METH_VARARGS, pack_into_doc},
- {"unpack", unpack, METH_VARARGS, unpack_doc},
+ {"unpack", unpack, METH_VARARGS, unpack_doc},
{"unpack_from", (PyCFunction)unpack_from,
METH_VARARGS|METH_KEYWORDS, unpack_from_doc},
{NULL, NULL} /* sentinel */
@@ -1977,11 +1975,7 @@ static struct PyModuleDef _structmodule = {
PyMODINIT_FUNC
PyInit__struct(void)
{
- PyObject *ver, *m;
-
- ver = PyBytes_FromString("0.3");
- if (ver == NULL)
- return NULL;
+ PyObject *m;
m = PyModule_Create(&_structmodule);
if (m == NULL)
@@ -2043,7 +2037,5 @@ PyInit__struct(void)
Py_INCREF((PyObject*)&PyStructType);
PyModule_AddObject(m, "Struct", (PyObject*)&PyStructType);
- PyModule_AddObject(m, "__version__", ver);
-
return m;
}
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 3e356d52a5..f19d0df594 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -10,6 +10,7 @@
#include "Python.h"
#include <float.h>
#include "structmember.h"
+#include "datetime.h"
#ifdef WITH_THREAD
#include "pythread.h"
@@ -224,7 +225,7 @@ test_lazy_hash_inheritance(PyObject* self)
{
PyTypeObject *type;
PyObject *obj;
- long hash;
+ Py_hash_t hash;
type = &_HashInheritanceTester_Type;
@@ -447,6 +448,336 @@ test_longlong_api(PyObject* self, PyObject *args)
#undef F_U_TO_PY
#undef F_PY_TO_U
+/* Test the PyLong_AsLongAndOverflow API. General conversion to PY_LONG
+ is tested by test_long_api_inner. This test will concentrate on proper
+ handling of overflow.
+*/
+
+static PyObject *
+test_long_and_overflow(PyObject *self)
+{
+ PyObject *num, *one, *temp;
+ long value;
+ int overflow;
+
+ /* Test that overflow is set properly for a large value. */
+ /* num is a number larger than LONG_MAX even on 64-bit platforms */
+ num = PyLong_FromString("FFFFFFFFFFFFFFFFFFFFFFFF", NULL, 16);
+ if (num == NULL)
+ return NULL;
+ overflow = 1234;
+ value = PyLong_AsLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -1)
+ return raiseTestError("test_long_and_overflow",
+ "return value was not set to -1");
+ if (overflow != 1)
+ return raiseTestError("test_long_and_overflow",
+ "overflow was not set to 1");
+
+ /* Same again, with num = LONG_MAX + 1 */
+ num = PyLong_FromLong(LONG_MAX);
+ if (num == NULL)
+ return NULL;
+ one = PyLong_FromLong(1L);
+ if (one == NULL) {
+ Py_DECREF(num);
+ return NULL;
+ }
+ temp = PyNumber_Add(num, one);
+ Py_DECREF(one);
+ Py_DECREF(num);
+ num = temp;
+ if (num == NULL)
+ return NULL;
+ overflow = 0;
+ value = PyLong_AsLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -1)
+ return raiseTestError("test_long_and_overflow",
+ "return value was not set to -1");
+ if (overflow != 1)
+ return raiseTestError("test_long_and_overflow",
+ "overflow was not set to 1");
+
+ /* Test that overflow is set properly for a large negative value. */
+ /* num is a number smaller than LONG_MIN even on 64-bit platforms */
+ num = PyLong_FromString("-FFFFFFFFFFFFFFFFFFFFFFFF", NULL, 16);
+ if (num == NULL)
+ return NULL;
+ overflow = 1234;
+ value = PyLong_AsLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -1)
+ return raiseTestError("test_long_and_overflow",
+ "return value was not set to -1");
+ if (overflow != -1)
+ return raiseTestError("test_long_and_overflow",
+ "overflow was not set to -1");
+
+ /* Same again, with num = LONG_MIN - 1 */
+ num = PyLong_FromLong(LONG_MIN);
+ if (num == NULL)
+ return NULL;
+ one = PyLong_FromLong(1L);
+ if (one == NULL) {
+ Py_DECREF(num);
+ return NULL;
+ }
+ temp = PyNumber_Subtract(num, one);
+ Py_DECREF(one);
+ Py_DECREF(num);
+ num = temp;
+ if (num == NULL)
+ return NULL;
+ overflow = 0;
+ value = PyLong_AsLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -1)
+ return raiseTestError("test_long_and_overflow",
+ "return value was not set to -1");
+ if (overflow != -1)
+ return raiseTestError("test_long_and_overflow",
+ "overflow was not set to -1");
+
+ /* Test that overflow is cleared properly for small values. */
+ num = PyLong_FromString("FF", NULL, 16);
+ if (num == NULL)
+ return NULL;
+ overflow = 1234;
+ value = PyLong_AsLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != 0xFF)
+ return raiseTestError("test_long_and_overflow",
+ "expected return value 0xFF");
+ if (overflow != 0)
+ return raiseTestError("test_long_and_overflow",
+ "overflow was not cleared");
+
+ num = PyLong_FromString("-FF", NULL, 16);
+ if (num == NULL)
+ return NULL;
+ overflow = 0;
+ value = PyLong_AsLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -0xFF)
+ return raiseTestError("test_long_and_overflow",
+ "expected return value 0xFF");
+ if (overflow != 0)
+ return raiseTestError("test_long_and_overflow",
+ "overflow was set incorrectly");
+
+ num = PyLong_FromLong(LONG_MAX);
+ if (num == NULL)
+ return NULL;
+ overflow = 1234;
+ value = PyLong_AsLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != LONG_MAX)
+ return raiseTestError("test_long_and_overflow",
+ "expected return value LONG_MAX");
+ if (overflow != 0)
+ return raiseTestError("test_long_and_overflow",
+ "overflow was not cleared");
+
+ num = PyLong_FromLong(LONG_MIN);
+ if (num == NULL)
+ return NULL;
+ overflow = 0;
+ value = PyLong_AsLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != LONG_MIN)
+ return raiseTestError("test_long_and_overflow",
+ "expected return value LONG_MIN");
+ if (overflow != 0)
+ return raiseTestError("test_long_and_overflow",
+ "overflow was not cleared");
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+/* Test the PyLong_AsLongLongAndOverflow API. General conversion to
+ PY_LONG_LONG is tested by test_long_api_inner. This test will
+ concentrate on proper handling of overflow.
+*/
+
+static PyObject *
+test_long_long_and_overflow(PyObject *self)
+{
+ PyObject *num, *one, *temp;
+ PY_LONG_LONG value;
+ int overflow;
+
+ /* Test that overflow is set properly for a large value. */
+ /* num is a number larger than PY_LLONG_MAX on a typical machine. */
+ num = PyLong_FromString("FFFFFFFFFFFFFFFFFFFFFFFF", NULL, 16);
+ if (num == NULL)
+ return NULL;
+ overflow = 1234;
+ value = PyLong_AsLongLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -1)
+ return raiseTestError("test_long_long_and_overflow",
+ "return value was not set to -1");
+ if (overflow != 1)
+ return raiseTestError("test_long_long_and_overflow",
+ "overflow was not set to 1");
+
+ /* Same again, with num = PY_LLONG_MAX + 1 */
+ num = PyLong_FromLongLong(PY_LLONG_MAX);
+ if (num == NULL)
+ return NULL;
+ one = PyLong_FromLong(1L);
+ if (one == NULL) {
+ Py_DECREF(num);
+ return NULL;
+ }
+ temp = PyNumber_Add(num, one);
+ Py_DECREF(one);
+ Py_DECREF(num);
+ num = temp;
+ if (num == NULL)
+ return NULL;
+ overflow = 0;
+ value = PyLong_AsLongLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -1)
+ return raiseTestError("test_long_long_and_overflow",
+ "return value was not set to -1");
+ if (overflow != 1)
+ return raiseTestError("test_long_long_and_overflow",
+ "overflow was not set to 1");
+
+ /* Test that overflow is set properly for a large negative value. */
+ /* num is a number smaller than PY_LLONG_MIN on a typical platform */
+ num = PyLong_FromString("-FFFFFFFFFFFFFFFFFFFFFFFF", NULL, 16);
+ if (num == NULL)
+ return NULL;
+ overflow = 1234;
+ value = PyLong_AsLongLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -1)
+ return raiseTestError("test_long_long_and_overflow",
+ "return value was not set to -1");
+ if (overflow != -1)
+ return raiseTestError("test_long_long_and_overflow",
+ "overflow was not set to -1");
+
+ /* Same again, with num = PY_LLONG_MIN - 1 */
+ num = PyLong_FromLongLong(PY_LLONG_MIN);
+ if (num == NULL)
+ return NULL;
+ one = PyLong_FromLong(1L);
+ if (one == NULL) {
+ Py_DECREF(num);
+ return NULL;
+ }
+ temp = PyNumber_Subtract(num, one);
+ Py_DECREF(one);
+ Py_DECREF(num);
+ num = temp;
+ if (num == NULL)
+ return NULL;
+ overflow = 0;
+ value = PyLong_AsLongLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -1)
+ return raiseTestError("test_long_long_and_overflow",
+ "return value was not set to -1");
+ if (overflow != -1)
+ return raiseTestError("test_long_long_and_overflow",
+ "overflow was not set to -1");
+
+ /* Test that overflow is cleared properly for small values. */
+ num = PyLong_FromString("FF", NULL, 16);
+ if (num == NULL)
+ return NULL;
+ overflow = 1234;
+ value = PyLong_AsLongLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != 0xFF)
+ return raiseTestError("test_long_long_and_overflow",
+ "expected return value 0xFF");
+ if (overflow != 0)
+ return raiseTestError("test_long_long_and_overflow",
+ "overflow was not cleared");
+
+ num = PyLong_FromString("-FF", NULL, 16);
+ if (num == NULL)
+ return NULL;
+ overflow = 0;
+ value = PyLong_AsLongLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != -0xFF)
+ return raiseTestError("test_long_long_and_overflow",
+ "expected return value 0xFF");
+ if (overflow != 0)
+ return raiseTestError("test_long_long_and_overflow",
+ "overflow was set incorrectly");
+
+ num = PyLong_FromLongLong(PY_LLONG_MAX);
+ if (num == NULL)
+ return NULL;
+ overflow = 1234;
+ value = PyLong_AsLongLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != PY_LLONG_MAX)
+ return raiseTestError("test_long_long_and_overflow",
+ "expected return value PY_LLONG_MAX");
+ if (overflow != 0)
+ return raiseTestError("test_long_long_and_overflow",
+ "overflow was not cleared");
+
+ num = PyLong_FromLongLong(PY_LLONG_MIN);
+ if (num == NULL)
+ return NULL;
+ overflow = 0;
+ value = PyLong_AsLongLongAndOverflow(num, &overflow);
+ Py_DECREF(num);
+ if (value == -1 && PyErr_Occurred())
+ return NULL;
+ if (value != PY_LLONG_MIN)
+ return raiseTestError("test_long_long_and_overflow",
+ "expected return value PY_LLONG_MIN");
+ if (overflow != 0)
+ return raiseTestError("test_long_long_and_overflow",
+ "overflow was not cleared");
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
/* Test the L code for PyArg_ParseTuple. This should deliver a PY_LONG_LONG
for both long and int arguments. The test may leak a little memory if
it fails.
@@ -543,6 +874,15 @@ getargs_B(PyObject *self, PyObject *args)
}
static PyObject *
+getargs_h(PyObject *self, PyObject *args)
+{
+ short value;
+ if (!PyArg_ParseTuple(args, "h", &value))
+ return NULL;
+ return PyLong_FromLong((long)value);
+}
+
+static PyObject *
getargs_H(PyObject *self, PyObject *args)
{
unsigned short value;
@@ -671,6 +1011,157 @@ test_k_code(PyObject *self)
return Py_None;
}
+static PyObject *
+getargs_s(PyObject *self, PyObject *args)
+{
+ char *str;
+ if (!PyArg_ParseTuple(args, "s", &str))
+ return NULL;
+ return PyBytes_FromString(str);
+}
+
+static PyObject *
+getargs_s_star(PyObject *self, PyObject *args)
+{
+ Py_buffer buffer;
+ PyObject *bytes;
+ if (!PyArg_ParseTuple(args, "s*", &buffer))
+ return NULL;
+ bytes = PyBytes_FromStringAndSize(buffer.buf, buffer.len);
+ PyBuffer_Release(&buffer);
+ return bytes;
+}
+
+static PyObject *
+getargs_s_hash(PyObject *self, PyObject *args)
+{
+ char *str;
+ Py_ssize_t size;
+ if (!PyArg_ParseTuple(args, "s#", &str, &size))
+ return NULL;
+ return PyBytes_FromStringAndSize(str, size);
+}
+
+static PyObject *
+getargs_z(PyObject *self, PyObject *args)
+{
+ char *str;
+ if (!PyArg_ParseTuple(args, "z", &str))
+ return NULL;
+ if (str != NULL)
+ return PyBytes_FromString(str);
+ else
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+getargs_z_star(PyObject *self, PyObject *args)
+{
+ Py_buffer buffer;
+ PyObject *bytes;
+ if (!PyArg_ParseTuple(args, "z*", &buffer))
+ return NULL;
+ if (buffer.buf != NULL)
+ bytes = PyBytes_FromStringAndSize(buffer.buf, buffer.len);
+ else {
+ Py_INCREF(Py_None);
+ bytes = Py_None;
+ }
+ PyBuffer_Release(&buffer);
+ return bytes;
+}
+
+static PyObject *
+getargs_z_hash(PyObject *self, PyObject *args)
+{
+ char *str;
+ Py_ssize_t size;
+ if (!PyArg_ParseTuple(args, "z#", &str, &size))
+ return NULL;
+ if (str != NULL)
+ return PyBytes_FromStringAndSize(str, size);
+ else
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+getargs_y(PyObject *self, PyObject *args)
+{
+ char *str;
+ if (!PyArg_ParseTuple(args, "y", &str))
+ return NULL;
+ return PyBytes_FromString(str);
+}
+
+static PyObject *
+getargs_y_star(PyObject *self, PyObject *args)
+{
+ Py_buffer buffer;
+ PyObject *bytes;
+ if (!PyArg_ParseTuple(args, "y*", &buffer))
+ return NULL;
+ bytes = PyBytes_FromStringAndSize(buffer.buf, buffer.len);
+ PyBuffer_Release(&buffer);
+ return bytes;
+}
+
+static PyObject *
+getargs_y_hash(PyObject *self, PyObject *args)
+{
+ char *str;
+ Py_ssize_t size;
+ if (!PyArg_ParseTuple(args, "y#", &str, &size))
+ return NULL;
+ return PyBytes_FromStringAndSize(str, size);
+}
+
+static PyObject *
+getargs_u(PyObject *self, PyObject *args)
+{
+ Py_UNICODE *str;
+ Py_ssize_t size;
+ if (!PyArg_ParseTuple(args, "u", &str))
+ return NULL;
+ size = Py_UNICODE_strlen(str);
+ return PyUnicode_FromUnicode(str, size);
+}
+
+static PyObject *
+getargs_u_hash(PyObject *self, PyObject *args)
+{
+ Py_UNICODE *str;
+ Py_ssize_t size;
+ if (!PyArg_ParseTuple(args, "u#", &str, &size))
+ return NULL;
+ return PyUnicode_FromUnicode(str, size);
+}
+
+static PyObject *
+getargs_Z(PyObject *self, PyObject *args)
+{
+ Py_UNICODE *str;
+ Py_ssize_t size;
+ if (!PyArg_ParseTuple(args, "Z", &str))
+ return NULL;
+ if (str != NULL) {
+ size = Py_UNICODE_strlen(str);
+ return PyUnicode_FromUnicode(str, size);
+ } else
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+getargs_Z_hash(PyObject *self, PyObject *args)
+{
+ Py_UNICODE *str;
+ Py_ssize_t size;
+ if (!PyArg_ParseTuple(args, "Z#", &str, &size))
+ return NULL;
+ if (str != NULL)
+ return PyUnicode_FromUnicode(str, size);
+ else
+ Py_RETURN_NONE;
+}
/* Test the s and z codes for PyArg_ParseTuple.
*/
@@ -762,7 +1253,6 @@ test_u_code(PyObject *self)
PyObject *tuple, *obj;
Py_UNICODE *value;
Py_ssize_t len;
- int x;
/* issue4122: Undefined reference to _Py_ascii_whitespace on Windows */
/* Just use the macro and check that it compiles */
@@ -896,6 +1386,80 @@ test_widechar(PyObject *self)
}
static PyObject *
+unicode_aswidechar(PyObject *self, PyObject *args)
+{
+ PyObject *unicode, *result;
+ Py_ssize_t buflen, size;
+ wchar_t *buffer;
+
+ if (!PyArg_ParseTuple(args, "Un", &unicode, &buflen))
+ return NULL;
+ buffer = PyMem_Malloc(buflen * sizeof(wchar_t));
+ if (buffer == NULL)
+ return PyErr_NoMemory();
+
+ size = PyUnicode_AsWideChar(unicode, buffer, buflen);
+ if (size == -1) {
+ PyMem_Free(buffer);
+ return NULL;
+ }
+
+ if (size < buflen)
+ buflen = size + 1;
+ else
+ buflen = size;
+ result = PyUnicode_FromWideChar(buffer, buflen);
+ PyMem_Free(buffer);
+ if (result == NULL)
+ return NULL;
+
+ return Py_BuildValue("(Nn)", result, size);
+}
+
+static PyObject *
+unicode_aswidecharstring(PyObject *self, PyObject *args)
+{
+ PyObject *unicode, *result;
+ Py_ssize_t size;
+ wchar_t *buffer;
+
+ if (!PyArg_ParseTuple(args, "U", &unicode))
+ return NULL;
+
+ buffer = PyUnicode_AsWideCharString(unicode, &size);
+ if (buffer == NULL)
+ return NULL;
+
+ result = PyUnicode_FromWideChar(buffer, size + 1);
+ PyMem_Free(buffer);
+ if (result == NULL)
+ return NULL;
+ return Py_BuildValue("(Nn)", result, size);
+}
+
+static PyObject *
+getargs_w_star(PyObject *self, PyObject *args)
+{
+ Py_buffer buffer;
+ PyObject *result;
+ char *str;
+
+ if (!PyArg_ParseTuple(args, "w*:getargs_w_star", &buffer))
+ return NULL;
+
+ if (2 <= buffer.len) {
+ str = buffer.buf;
+ str[0] = '[';
+ str[buffer.len-1] = ']';
+ }
+
+ result = PyBytes_FromStringAndSize(buffer.buf, buffer.len);
+ PyBuffer_Release(&buffer);
+ return result;
+}
+
+
+static PyObject *
test_empty_argparse(PyObject *self)
{
/* Test that formats can begin with '|'. See issue #4720. */
@@ -1023,6 +1587,31 @@ raise_exception(PyObject *self, PyObject *args)
return NULL;
}
+
+static int test_run_counter = 0;
+
+static PyObject *
+test_datetime_capi(PyObject *self, PyObject *args) {
+ if (PyDateTimeAPI) {
+ if (test_run_counter) {
+ /* Probably regrtest.py -R */
+ Py_RETURN_NONE;
+ }
+ else {
+ PyErr_SetString(PyExc_AssertionError,
+ "PyDateTime_CAPI somehow initialized");
+ return NULL;
+ }
+ }
+ test_run_counter++;
+ PyDateTime_IMPORT;
+ if (PyDateTimeAPI)
+ Py_RETURN_NONE;
+ else
+ return NULL;
+}
+
+
#ifdef WITH_THREAD
/* test_thread_state spawns a thread of its own, and that thread releases
@@ -1152,15 +1741,16 @@ test_string_from_format(PyObject *self, PyObject *args)
{
PyObject *result;
char *msg;
-
-#define CHECK_1_FORMAT(FORMAT, TYPE) \
- result = PyUnicode_FromFormat(FORMAT, (TYPE)1); \
- if (result == NULL) \
- return NULL; \
- if (strcmp(_PyUnicode_AsString(result), "1")) { \
- msg = FORMAT " failed at 1"; \
- goto Fail; \
- } \
+ static const Py_UNICODE one[] = {'1', 0};
+
+#define CHECK_1_FORMAT(FORMAT, TYPE) \
+ result = PyUnicode_FromFormat(FORMAT, (TYPE)1); \
+ if (result == NULL) \
+ return NULL; \
+ if (Py_UNICODE_strcmp(PyUnicode_AS_UNICODE(result), one)) { \
+ msg = FORMAT " failed at 1"; \
+ goto Fail; \
+ } \
Py_DECREF(result)
CHECK_1_FORMAT("%d", int);
@@ -1173,6 +1763,12 @@ test_string_from_format(PyObject *self, PyObject *args)
CHECK_1_FORMAT("%lu", unsigned long);
CHECK_1_FORMAT("%zu", size_t);
+ /* "%lld" and "%llu" support added in Python 2.7. */
+#ifdef HAVE_LONG_LONG
+ CHECK_1_FORMAT("%llu", unsigned PY_LONG_LONG);
+ CHECK_1_FORMAT("%lld", PY_LONG_LONG);
+#endif
+
Py_RETURN_NONE;
Fail:
@@ -1197,7 +1793,7 @@ test_unicode_compare_with_ascii(PyObject *self) {
return NULL;
}
Py_RETURN_NONE;
-};
+}
/* This is here to provide a docstring for test_descr. */
static PyObject *
@@ -1592,7 +2188,7 @@ argparsing(PyObject *o, PyObject *args)
/* argument converter not called? */
return NULL;
/* Should be 1 */
- res = PyLong_FromLong(Py_REFCNT(str2));
+ res = PyLong_FromSsize_t(Py_REFCNT(str2));
Py_DECREF(str2);
PyErr_Clear();
return res;
@@ -1600,15 +2196,77 @@ argparsing(PyObject *o, PyObject *args)
Py_RETURN_NONE;
}
+/* To test that the result of PyCode_NewEmpty has the right members. */
+static PyObject *
+code_newempty(PyObject *self, PyObject *args)
+{
+ const char *filename;
+ const char *funcname;
+ int firstlineno;
+
+ if (!PyArg_ParseTuple(args, "ssi:code_newempty",
+ &filename, &funcname, &firstlineno))
+ return NULL;
+
+ return (PyObject *)PyCode_NewEmpty(filename, funcname, firstlineno);
+}
+
+/* Test PyErr_NewExceptionWithDoc (also exercise PyErr_NewException).
+ Run via Lib/test/test_exceptions.py */
+static PyObject *
+make_exception_with_doc(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ const char *name;
+ const char *doc = NULL;
+ PyObject *base = NULL;
+ PyObject *dict = NULL;
+
+ static char *kwlist[] = {"name", "doc", "base", "dict", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "s|sOO:make_exception_with_doc", kwlist,
+ &name, &doc, &base, &dict))
+ return NULL;
+
+ return PyErr_NewExceptionWithDoc(name, doc, base, dict);
+}
+
+static PyObject *
+make_memoryview_from_NULL_pointer(PyObject *self)
+{
+ Py_buffer info;
+ if (PyBuffer_FillInfo(&info, NULL, NULL, 1, 1, PyBUF_FULL_RO) < 0)
+ return NULL;
+ return PyMemoryView_FromBuffer(&info);
+}
+
+/* Test that the fatal error from not having a current thread doesn't
+ cause an infinite loop. Run via Lib/test/test_capi.py */
+static PyObject *
+crash_no_current_thread(PyObject *self)
+{
+ Py_BEGIN_ALLOW_THREADS
+ /* Using PyThreadState_Get() directly allows the test to pass in
+ !pydebug mode. However, the test only actually tests anything
+ in pydebug mode, since that's where the infinite loop was in
+ the first place. */
+ PyThreadState_Get();
+ Py_END_ALLOW_THREADS
+ return NULL;
+}
+
static PyMethodDef TestMethods[] = {
{"raise_exception", raise_exception, METH_VARARGS},
{"raise_memoryerror", (PyCFunction)raise_memoryerror, METH_NOARGS},
{"test_config", (PyCFunction)test_config, METH_NOARGS},
+ {"test_datetime_capi", test_datetime_capi, METH_NOARGS},
{"test_list_api", (PyCFunction)test_list_api, METH_NOARGS},
{"test_dict_iteration", (PyCFunction)test_dict_iteration,METH_NOARGS},
{"test_lazy_hash_inheritance", (PyCFunction)test_lazy_hash_inheritance,METH_NOARGS},
{"test_broken_memoryview", (PyCFunction)test_broken_memoryview,METH_NOARGS},
{"test_long_api", (PyCFunction)test_long_api, METH_NOARGS},
+ {"test_long_and_overflow", (PyCFunction)test_long_and_overflow,
+ METH_NOARGS},
{"test_long_numbits", (PyCFunction)test_long_numbits, METH_NOARGS},
{"test_k_code", (PyCFunction)test_k_code, METH_NOARGS},
{"test_empty_argparse", (PyCFunction)test_empty_argparse,METH_NOARGS},
@@ -1625,6 +2283,7 @@ static PyMethodDef TestMethods[] = {
METH_VARARGS|METH_KEYWORDS},
{"getargs_b", getargs_b, METH_VARARGS},
{"getargs_B", getargs_B, METH_VARARGS},
+ {"getargs_h", getargs_h, METH_VARARGS},
{"getargs_H", getargs_H, METH_VARARGS},
{"getargs_I", getargs_I, METH_VARARGS},
{"getargs_k", getargs_k, METH_VARARGS},
@@ -1635,26 +2294,50 @@ static PyMethodDef TestMethods[] = {
{"getargs_L", getargs_L, METH_VARARGS},
{"getargs_K", getargs_K, METH_VARARGS},
{"test_longlong_api", test_longlong_api, METH_NOARGS},
+ {"test_long_long_and_overflow",
+ (PyCFunction)test_long_long_and_overflow, METH_NOARGS},
{"test_L_code", (PyCFunction)test_L_code, METH_NOARGS},
+#endif
+ {"getargs_s", getargs_s, METH_VARARGS},
+ {"getargs_s_star", getargs_s_star, METH_VARARGS},
+ {"getargs_s_hash", getargs_s_hash, METH_VARARGS},
+ {"getargs_z", getargs_z, METH_VARARGS},
+ {"getargs_z_star", getargs_z_star, METH_VARARGS},
+ {"getargs_z_hash", getargs_z_hash, METH_VARARGS},
+ {"getargs_y", getargs_y, METH_VARARGS},
+ {"getargs_y_star", getargs_y_star, METH_VARARGS},
+ {"getargs_y_hash", getargs_y_hash, METH_VARARGS},
+ {"getargs_u", getargs_u, METH_VARARGS},
+ {"getargs_u_hash", getargs_u_hash, METH_VARARGS},
+ {"getargs_Z", getargs_Z, METH_VARARGS},
+ {"getargs_Z_hash", getargs_Z_hash, METH_VARARGS},
+ {"getargs_w_star", getargs_w_star, METH_VARARGS},
{"codec_incrementalencoder",
- (PyCFunction)codec_incrementalencoder, METH_VARARGS},
+ (PyCFunction)codec_incrementalencoder, METH_VARARGS},
{"codec_incrementaldecoder",
- (PyCFunction)codec_incrementaldecoder, METH_VARARGS},
-#endif
+ (PyCFunction)codec_incrementaldecoder, METH_VARARGS},
{"test_s_code", (PyCFunction)test_s_code, METH_NOARGS},
{"test_u_code", (PyCFunction)test_u_code, METH_NOARGS},
{"test_Z_code", (PyCFunction)test_Z_code, METH_NOARGS},
{"test_widechar", (PyCFunction)test_widechar, METH_NOARGS},
+ {"unicode_aswidechar", unicode_aswidechar, METH_VARARGS},
+ {"unicode_aswidecharstring",unicode_aswidecharstring, METH_VARARGS},
#ifdef WITH_THREAD
- {"_test_thread_state", test_thread_state, METH_VARARGS},
+ {"_test_thread_state", test_thread_state, METH_VARARGS},
{"_pending_threadfunc", pending_threadfunc, METH_VARARGS},
#endif
#ifdef HAVE_GETTIMEOFDAY
- {"profile_int", profile_int, METH_NOARGS},
+ {"profile_int", profile_int, METH_NOARGS},
#endif
- {"traceback_print", traceback_print, METH_VARARGS},
- {"exception_print", exception_print, METH_VARARGS},
- {"argparsing", argparsing, METH_VARARGS},
+ {"traceback_print", traceback_print, METH_VARARGS},
+ {"exception_print", exception_print, METH_VARARGS},
+ {"argparsing", argparsing, METH_VARARGS},
+ {"code_newempty", code_newempty, METH_VARARGS},
+ {"make_exception_with_doc", (PyCFunction)make_exception_with_doc,
+ METH_VARARGS | METH_KEYWORDS},
+ {"make_memoryview_from_NULL_pointer", (PyCFunction)make_memoryview_from_NULL_pointer,
+ METH_NOARGS},
+ {"crash_no_current_thread", (PyCFunction)crash_no_current_thread, METH_NOARGS},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_testembed.c b/Modules/_testembed.c
new file mode 100644
index 0000000000..0df5ede6e4
--- /dev/null
+++ b/Modules/_testembed.c
@@ -0,0 +1,52 @@
+#include <Python.h>
+#include <stdio.h>
+
+void print_subinterp(void)
+{
+ /* Just output some debug stuff */
+ PyThreadState *ts = PyThreadState_Get();
+ printf("interp %p, thread state %p: ", ts->interp, ts);
+ fflush(stdout);
+ PyRun_SimpleString(
+ "import sys;"
+ "print('id(modules) =', id(sys.modules));"
+ "sys.stdout.flush()"
+ );
+}
+
+int main(int argc, char *argv[])
+{
+ PyThreadState *mainstate, *substate;
+ PyGILState_STATE gilstate;
+ int i, j;
+
+ for (i=0; i<3; i++) {
+ printf("--- Pass %d ---\n", i);
+ /* HACK: the "./" at front avoids a search along the PATH in
+ Modules/getpath.c */
+ Py_SetProgramName(L"./_testembed");
+ Py_Initialize();
+ mainstate = PyThreadState_Get();
+
+ PyEval_InitThreads();
+ PyEval_ReleaseThread(mainstate);
+
+ gilstate = PyGILState_Ensure();
+ print_subinterp();
+ PyThreadState_Swap(NULL);
+
+ for (j=0; j<3; j++) {
+ substate = Py_NewInterpreter();
+ print_subinterp();
+ Py_EndInterpreter(substate);
+ }
+
+ PyThreadState_Swap(mainstate);
+ print_subinterp();
+ PyGILState_Release(gilstate);
+
+ PyEval_RestoreThread(mainstate);
+ Py_Finalize();
+ }
+ return 0;
+}
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index ddaa01bb29..d91c99a4a7 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -3,6 +3,7 @@
/* Interface to Sjoerd's portable C thread library */
#include "Python.h"
+#include "structmember.h" /* offsetof */
#ifndef WITH_THREAD
#error "Error! The rest of Python is not compiled with thread support."
@@ -13,19 +14,22 @@
#include "pythread.h"
static PyObject *ThreadError;
+static long nb_threads = 0;
static PyObject *str_dict;
-
/* Lock objects */
typedef struct {
PyObject_HEAD
PyThread_type_lock lock_lock;
+ PyObject *in_weakreflist;
} lockobject;
static void
lock_dealloc(lockobject *self)
{
+ if (self->in_weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
if (self->lock_lock != NULL) {
/* Unlock the lock so it's safe to free it */
PyThread_acquire_lock(self->lock_lock, 0);
@@ -36,19 +40,101 @@ lock_dealloc(lockobject *self)
PyObject_Del(self);
}
+/* Helper to acquire an interruptible lock with a timeout. If the lock acquire
+ * is interrupted, signal handlers are run, and if they raise an exception,
+ * PY_LOCK_INTR is returned. Otherwise, PY_LOCK_ACQUIRED or PY_LOCK_FAILURE
+ * are returned, depending on whether the lock can be acquired withing the
+ * timeout.
+ */
+static PyLockStatus
+acquire_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds)
+{
+ PyLockStatus r;
+ _PyTime_timeval curtime;
+ _PyTime_timeval endtime;
+
+ if (microseconds > 0) {
+ _PyTime_gettimeofday(&endtime);
+ endtime.tv_sec += microseconds / (1000 * 1000);
+ endtime.tv_usec += microseconds % (1000 * 1000);
+ }
+
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ r = PyThread_acquire_lock_timed(lock, microseconds, 1);
+ Py_END_ALLOW_THREADS
+
+ if (r == PY_LOCK_INTR) {
+ /* Run signal handlers if we were interrupted. Propagate
+ * exceptions from signal handlers, such as KeyboardInterrupt, by
+ * passing up PY_LOCK_INTR. */
+ if (Py_MakePendingCalls() < 0) {
+ return PY_LOCK_INTR;
+ }
+
+ /* If we're using a timeout, recompute the timeout after processing
+ * signals, since those can take time. */
+ if (microseconds >= 0) {
+ _PyTime_gettimeofday(&curtime);
+ microseconds = ((endtime.tv_sec - curtime.tv_sec) * 1000000 +
+ (endtime.tv_usec - curtime.tv_usec));
+
+ /* Check for negative values, since those mean block forever.
+ */
+ if (microseconds <= 0) {
+ r = PY_LOCK_FAILURE;
+ }
+ }
+ }
+ } while (r == PY_LOCK_INTR); /* Retry if we were interrupted. */
+
+ return r;
+}
+
static PyObject *
-lock_PyThread_acquire_lock(lockobject *self, PyObject *args)
+lock_PyThread_acquire_lock(lockobject *self, PyObject *args, PyObject *kwds)
{
- int i = 1;
+ char *kwlist[] = {"blocking", "timeout", NULL};
+ int blocking = 1;
+ double timeout = -1;
+ PY_TIMEOUT_T microseconds;
+ PyLockStatus r;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|id:acquire", kwlist,
+ &blocking, &timeout))
+ return NULL;
- if (!PyArg_ParseTuple(args, "|i:acquire", &i))
+ if (!blocking && timeout != -1) {
+ PyErr_SetString(PyExc_ValueError, "can't specify a timeout "
+ "for a non-blocking call");
return NULL;
+ }
+ if (timeout < 0 && timeout != -1) {
+ PyErr_SetString(PyExc_ValueError, "timeout value must be "
+ "strictly positive");
+ return NULL;
+ }
+ if (!blocking)
+ microseconds = 0;
+ else if (timeout == -1)
+ microseconds = -1;
+ else {
+ timeout *= 1e6;
+ if (timeout >= (double) PY_TIMEOUT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "timeout value is too large");
+ return NULL;
+ }
+ microseconds = (PY_TIMEOUT_T) timeout;
+ }
- Py_BEGIN_ALLOW_THREADS
- i = PyThread_acquire_lock(self->lock_lock, i);
- Py_END_ALLOW_THREADS
+ r = acquire_timed(self->lock_lock, microseconds);
+ if (r == PY_LOCK_INTR) {
+ return NULL;
+ }
- return PyBool_FromLong((long)i);
+ return PyBool_FromLong(r == PY_LOCK_ACQUIRED);
}
PyDoc_STRVAR(acquire_doc,
@@ -60,7 +146,7 @@ locked (even by the same thread), waiting for another thread to release\n\
the lock, and return None once the lock is acquired.\n\
With an argument, this will only block if the argument is true,\n\
and the return value reflects whether the lock is acquired.\n\
-The blocking operation is not interruptible.");
+The blocking operation is interruptible.");
static PyObject *
lock_PyThread_release_lock(lockobject *self)
@@ -103,9 +189,9 @@ Return whether the lock is in the locked state.");
static PyMethodDef lock_methods[] = {
{"acquire_lock", (PyCFunction)lock_PyThread_acquire_lock,
- METH_VARARGS, acquire_doc},
+ METH_VARARGS | METH_KEYWORDS, acquire_doc},
{"acquire", (PyCFunction)lock_PyThread_acquire_lock,
- METH_VARARGS, acquire_doc},
+ METH_VARARGS | METH_KEYWORDS, acquire_doc},
{"release_lock", (PyCFunction)lock_PyThread_release_lock,
METH_NOARGS, release_doc},
{"release", (PyCFunction)lock_PyThread_release_lock,
@@ -115,7 +201,7 @@ static PyMethodDef lock_methods[] = {
{"locked", (PyCFunction)lock_locked_lock,
METH_NOARGS, locked_doc},
{"__enter__", (PyCFunction)lock_PyThread_acquire_lock,
- METH_VARARGS, acquire_doc},
+ METH_VARARGS | METH_KEYWORDS, acquire_doc},
{"__exit__", (PyCFunction)lock_PyThread_release_lock,
METH_VARARGS, release_doc},
{NULL, NULL} /* sentinel */
@@ -147,12 +233,306 @@ static PyTypeObject Locktype = {
0, /*tp_traverse*/
0, /*tp_clear*/
0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
+ offsetof(lockobject, in_weakreflist), /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
lock_methods, /*tp_methods*/
};
+/* Recursive lock objects */
+
+typedef struct {
+ PyObject_HEAD
+ PyThread_type_lock rlock_lock;
+ long rlock_owner;
+ unsigned long rlock_count;
+ PyObject *in_weakreflist;
+} rlockobject;
+
+static void
+rlock_dealloc(rlockobject *self)
+{
+ assert(self->rlock_lock);
+ if (self->in_weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
+ /* Unlock the lock so it's safe to free it */
+ if (self->rlock_count > 0)
+ PyThread_release_lock(self->rlock_lock);
+
+ PyThread_free_lock(self->rlock_lock);
+ Py_TYPE(self)->tp_free(self);
+}
+
+static PyObject *
+rlock_acquire(rlockobject *self, PyObject *args, PyObject *kwds)
+{
+ char *kwlist[] = {"blocking", "timeout", NULL};
+ int blocking = 1;
+ double timeout = -1;
+ PY_TIMEOUT_T microseconds;
+ long tid;
+ PyLockStatus r = PY_LOCK_ACQUIRED;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|id:acquire", kwlist,
+ &blocking, &timeout))
+ return NULL;
+
+ if (!blocking && timeout != -1) {
+ PyErr_SetString(PyExc_ValueError, "can't specify a timeout "
+ "for a non-blocking call");
+ return NULL;
+ }
+ if (timeout < 0 && timeout != -1) {
+ PyErr_SetString(PyExc_ValueError, "timeout value must be "
+ "strictly positive");
+ return NULL;
+ }
+ if (!blocking)
+ microseconds = 0;
+ else if (timeout == -1)
+ microseconds = -1;
+ else {
+ timeout *= 1e6;
+ if (timeout >= (double) PY_TIMEOUT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "timeout value is too large");
+ return NULL;
+ }
+ microseconds = (PY_TIMEOUT_T) timeout;
+ }
+
+ tid = PyThread_get_thread_ident();
+ if (self->rlock_count > 0 && tid == self->rlock_owner) {
+ unsigned long count = self->rlock_count + 1;
+ if (count <= self->rlock_count) {
+ PyErr_SetString(PyExc_OverflowError,
+ "Internal lock count overflowed");
+ return NULL;
+ }
+ self->rlock_count = count;
+ Py_RETURN_TRUE;
+ }
+
+ if (self->rlock_count > 0 ||
+ !PyThread_acquire_lock(self->rlock_lock, 0)) {
+ if (microseconds == 0) {
+ Py_RETURN_FALSE;
+ }
+ r = acquire_timed(self->rlock_lock, microseconds);
+ }
+ if (r == PY_LOCK_ACQUIRED) {
+ assert(self->rlock_count == 0);
+ self->rlock_owner = tid;
+ self->rlock_count = 1;
+ }
+ else if (r == PY_LOCK_INTR) {
+ return NULL;
+ }
+
+ return PyBool_FromLong(r == PY_LOCK_ACQUIRED);
+}
+
+PyDoc_STRVAR(rlock_acquire_doc,
+"acquire(blocking=True) -> bool\n\
+\n\
+Lock the lock. `blocking` indicates whether we should wait\n\
+for the lock to be available or not. If `blocking` is False\n\
+and another thread holds the lock, the method will return False\n\
+immediately. If `blocking` is True and another thread holds\n\
+the lock, the method will wait for the lock to be released,\n\
+take it and then return True.\n\
+(note: the blocking operation is interruptible.)\n\
+\n\
+In all other cases, the method will return True immediately.\n\
+Precisely, if the current thread already holds the lock, its\n\
+internal counter is simply incremented. If nobody holds the lock,\n\
+the lock is taken and its internal counter initialized to 1.");
+
+static PyObject *
+rlock_release(rlockobject *self)
+{
+ long tid = PyThread_get_thread_ident();
+
+ if (self->rlock_count == 0 || self->rlock_owner != tid) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot release un-acquired lock");
+ return NULL;
+ }
+ if (--self->rlock_count == 0) {
+ self->rlock_owner = 0;
+ PyThread_release_lock(self->rlock_lock);
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(rlock_release_doc,
+"release()\n\
+\n\
+Release the lock, allowing another thread that is blocked waiting for\n\
+the lock to acquire the lock. The lock must be in the locked state,\n\
+and must be locked by the same thread that unlocks it; otherwise a\n\
+`RuntimeError` is raised.\n\
+\n\
+Do note that if the lock was acquire()d several times in a row by the\n\
+current thread, release() needs to be called as many times for the lock\n\
+to be available for other threads.");
+
+static PyObject *
+rlock_acquire_restore(rlockobject *self, PyObject *arg)
+{
+ long owner;
+ unsigned long count;
+ int r = 1;
+
+ if (!PyArg_ParseTuple(arg, "kl:_acquire_restore", &count, &owner))
+ return NULL;
+
+ if (!PyThread_acquire_lock(self->rlock_lock, 0)) {
+ Py_BEGIN_ALLOW_THREADS
+ r = PyThread_acquire_lock(self->rlock_lock, 1);
+ Py_END_ALLOW_THREADS
+ }
+ if (!r) {
+ PyErr_SetString(ThreadError, "couldn't acquire lock");
+ return NULL;
+ }
+ assert(self->rlock_count == 0);
+ self->rlock_owner = owner;
+ self->rlock_count = count;
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(rlock_acquire_restore_doc,
+"_acquire_restore(state) -> None\n\
+\n\
+For internal use by `threading.Condition`.");
+
+static PyObject *
+rlock_release_save(rlockobject *self)
+{
+ long owner;
+ unsigned long count;
+
+ owner = self->rlock_owner;
+ count = self->rlock_count;
+ self->rlock_count = 0;
+ self->rlock_owner = 0;
+ PyThread_release_lock(self->rlock_lock);
+ return Py_BuildValue("kl", count, owner);
+}
+
+PyDoc_STRVAR(rlock_release_save_doc,
+"_release_save() -> tuple\n\
+\n\
+For internal use by `threading.Condition`.");
+
+
+static PyObject *
+rlock_is_owned(rlockobject *self)
+{
+ long tid = PyThread_get_thread_ident();
+
+ if (self->rlock_count > 0 && self->rlock_owner == tid) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
+PyDoc_STRVAR(rlock_is_owned_doc,
+"_is_owned() -> bool\n\
+\n\
+For internal use by `threading.Condition`.");
+
+static PyObject *
+rlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ rlockobject *self;
+
+ self = (rlockobject *) type->tp_alloc(type, 0);
+ if (self != NULL) {
+ self->rlock_lock = PyThread_allocate_lock();
+ if (self->rlock_lock == NULL) {
+ type->tp_free(self);
+ PyErr_SetString(ThreadError, "can't allocate lock");
+ return NULL;
+ }
+ self->in_weakreflist = NULL;
+ self->rlock_owner = 0;
+ self->rlock_count = 0;
+ }
+
+ return (PyObject *) self;
+}
+
+static PyObject *
+rlock_repr(rlockobject *self)
+{
+ return PyUnicode_FromFormat("<%s owner=%ld count=%lu>",
+ Py_TYPE(self)->tp_name, self->rlock_owner, self->rlock_count);
+}
+
+
+static PyMethodDef rlock_methods[] = {
+ {"acquire", (PyCFunction)rlock_acquire,
+ METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc},
+ {"release", (PyCFunction)rlock_release,
+ METH_NOARGS, rlock_release_doc},
+ {"_is_owned", (PyCFunction)rlock_is_owned,
+ METH_NOARGS, rlock_is_owned_doc},
+ {"_acquire_restore", (PyCFunction)rlock_acquire_restore,
+ METH_O, rlock_acquire_restore_doc},
+ {"_release_save", (PyCFunction)rlock_release_save,
+ METH_NOARGS, rlock_release_save_doc},
+ {"__enter__", (PyCFunction)rlock_acquire,
+ METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc},
+ {"__exit__", (PyCFunction)rlock_release,
+ METH_VARARGS, rlock_release_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+
+static PyTypeObject RLocktype = {
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
+ "_thread.RLock", /*tp_name*/
+ sizeof(rlockobject), /*tp_size*/
+ 0, /*tp_itemsize*/
+ /* methods */
+ (destructor)rlock_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_reserved*/
+ (reprfunc)rlock_repr, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ offsetof(rlockobject, in_weakreflist), /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ rlock_methods, /*tp_methods*/
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ PyType_GenericAlloc, /* tp_alloc */
+ rlock_new /* tp_new */
+};
+
static lockobject *
newlockobject(void)
{
@@ -161,6 +541,7 @@ newlockobject(void)
if (self == NULL)
return NULL;
self->lock_lock = PyThread_allocate_lock();
+ self->in_weakreflist = NULL;
if (self->lock_lock == NULL) {
Py_DECREF(self);
PyErr_SetString(ThreadError, "can't allocate lock");
@@ -605,6 +986,7 @@ t_bootstrap(void *boot_raw)
tstate->thread_id = PyThread_get_thread_ident();
_PyThreadState_Init(tstate);
PyEval_AcquireThread(tstate);
+ nb_threads++;
res = PyEval_CallObjectWithKeywords(
boot->func, boot->args, boot->keyw);
if (res == NULL) {
@@ -629,6 +1011,7 @@ t_bootstrap(void *boot_raw)
Py_DECREF(boot->args);
Py_XDECREF(boot->keyw);
PyMem_DEL(boot_raw);
+ nb_threads--;
PyThreadState_Clear(tstate);
PyThreadState_DeleteCurrent();
PyThread_exit_thread();
@@ -728,18 +1111,6 @@ Raise a KeyboardInterrupt in the main thread.\n\
A subthread can use this function to interrupt the main thread."
);
-#ifndef NO_EXIT_PROG
-static PyObject *
-thread_PyThread_exit_prog(PyObject *self, PyObject *args)
-{
- int sts;
- if (!PyArg_ParseTuple(args, "i:exit_prog", &sts))
- return NULL;
- Py_Exit(sts); /* Calls PyThread_exit_prog(sts) or _PyThread_exit_prog(sts) */
- for (;;) { } /* Should not be reached */
-}
-#endif
-
static lockobject *newlockobject(void);
static PyObject *
@@ -778,6 +1149,24 @@ be relied upon, and the number should be seen purely as a magic cookie.\n\
A thread's identity may be reused for another thread after it exits.");
static PyObject *
+thread__count(PyObject *self)
+{
+ return PyLong_FromLong(nb_threads);
+}
+
+PyDoc_STRVAR(_count_doc,
+"_count() -> integer\n\
+\n\
+\
+Return the number of currently running Python threads, excluding \n\
+the main thread. The returned number comprises all threads created\n\
+through `start_new_thread()` as well as `threading.Thread`, and not\n\
+yet finished.\n\
+\n\
+This function is meant for internal and specialized purposes only.\n\
+In most applications `threading.enumerate()` should be used instead.");
+
+static PyObject *
thread_stack_size(PyObject *self, PyObject *args)
{
size_t old_size;
@@ -850,13 +1239,11 @@ static PyMethodDef thread_methods[] = {
METH_NOARGS, interrupt_doc},
{"get_ident", (PyCFunction)thread_get_ident,
METH_NOARGS, get_ident_doc},
+ {"_count", (PyCFunction)thread__count,
+ METH_NOARGS, _count_doc},
{"stack_size", (PyCFunction)thread_stack_size,
METH_VARARGS,
stack_size_doc},
-#ifndef NO_EXIT_PROG
- {"exit_prog", (PyCFunction)thread_PyThread_exit_prog,
- METH_VARARGS},
-#endif
{NULL, NULL} /* sentinel */
};
@@ -895,7 +1282,7 @@ static struct PyModuleDef threadmodule = {
PyMODINIT_FUNC
PyInit__thread(void)
{
- PyObject *m, *d;
+ PyObject *m, *d, *timeout_max;
/* Initialize types: */
if (PyType_Ready(&localdummytype) < 0)
@@ -904,12 +1291,20 @@ PyInit__thread(void)
return NULL;
if (PyType_Ready(&Locktype) < 0)
return NULL;
+ if (PyType_Ready(&RLocktype) < 0)
+ return NULL;
/* Create the module and add the functions */
m = PyModule_Create(&threadmodule);
if (m == NULL)
return NULL;
+ timeout_max = PyFloat_FromDouble(PY_TIMEOUT_MAX / 1000000);
+ if (!timeout_max)
+ return NULL;
+ if (PyModule_AddObject(m, "TIMEOUT_MAX", timeout_max) < 0)
+ return NULL;
+
/* Add a symbolic constant */
d = PyModule_GetDict(m);
ThreadError = PyErr_NewException("_thread.error", NULL, NULL);
@@ -918,10 +1313,16 @@ PyInit__thread(void)
Py_INCREF(&Locktype);
PyDict_SetItemString(d, "LockType", (PyObject *)&Locktype);
+ Py_INCREF(&RLocktype);
+ if (PyModule_AddObject(m, "RLock", (PyObject *)&RLocktype) < 0)
+ return NULL;
+
Py_INCREF(&localtype);
if (PyModule_AddObject(m, "_local", (PyObject *)&localtype) < 0)
return NULL;
+ nb_threads = 0;
+
str_dict = PyUnicode_InternFromString("__dict__");
if (str_dict == NULL)
return NULL;
diff --git a/Modules/_time.c b/Modules/_time.c
new file mode 100644
index 0000000000..10cc8e12a6
--- /dev/null
+++ b/Modules/_time.c
@@ -0,0 +1,28 @@
+#include "Python.h"
+#include "_time.h"
+
+/* Exposed in timefuncs.h. */
+time_t
+_PyTime_DoubleToTimet(double x)
+{
+ time_t result;
+ double diff;
+
+ result = (time_t)x;
+ /* How much info did we lose? time_t may be an integral or
+ * floating type, and we don't know which. If it's integral,
+ * we don't know whether C truncates, rounds, returns the floor,
+ * etc. If we lost a second or more, the C rounding is
+ * unreasonable, or the input just doesn't fit in a time_t;
+ * call it an error regardless. Note that the original cast to
+ * time_t can cause a C error too, but nothing we can do to
+ * work around that.
+ */
+ diff = x - (double)result;
+ if (diff <= -1.0 || diff >= 1.0) {
+ PyErr_SetString(PyExc_ValueError,
+ "timestamp out of range for platform time_t");
+ result = (time_t)-1;
+ }
+ return result;
+}
diff --git a/Modules/_time.h b/Modules/_time.h
new file mode 100644
index 0000000000..816593b03f
--- /dev/null
+++ b/Modules/_time.h
@@ -0,0 +1,3 @@
+/* XXX: It is probably best to move timefuncs.h content in here, and
+ remove it but user code may rely on it. */
+#include "timefuncs.h"
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 8552575f40..c7c1530545 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -3147,9 +3147,7 @@ PyInit__tkinter(void)
it also helps Tcl find its encodings. */
uexe = PyUnicode_FromWideChar(Py_GetProgramName(), -1);
if (uexe) {
- cexe = PyUnicode_AsEncodedString(uexe,
- Py_FileSystemDefaultEncoding,
- NULL);
+ cexe = PyUnicode_EncodeFSDefault(uexe);
if (cexe)
Tcl_FindExecutable(PyBytes_AsString(cexe));
Py_XDECREF(cexe);
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 59f20a5da8..fe6106c9a4 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -22,11 +22,13 @@ struct arrayobject; /* Forward */
* functions aren't visible yet.
*/
struct arraydescr {
- int typecode;
+ Py_UNICODE typecode;
int itemsize;
PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
char *formats;
+ int is_integer_type;
+ int is_signed;
};
typedef struct arrayobject {
@@ -389,20 +391,24 @@ d_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
}
-/* Description of types */
+/* Description of types.
+ *
+ * Don't forget to update typecode_to_mformat_code() if you add a new
+ * typecode.
+ */
static struct arraydescr descriptors[] = {
- {'b', 1, b_getitem, b_setitem, "b"},
- {'B', 1, BB_getitem, BB_setitem, "B"},
- {'u', sizeof(Py_UNICODE), u_getitem, u_setitem, "u"},
- {'h', sizeof(short), h_getitem, h_setitem, "h"},
- {'H', sizeof(short), HH_getitem, HH_setitem, "H"},
- {'i', sizeof(int), i_getitem, i_setitem, "i"},
- {'I', sizeof(int), II_getitem, II_setitem, "I"},
- {'l', sizeof(long), l_getitem, l_setitem, "l"},
- {'L', sizeof(long), LL_getitem, LL_setitem, "L"},
- {'f', sizeof(float), f_getitem, f_setitem, "f"},
- {'d', sizeof(double), d_getitem, d_setitem, "d"},
- {'\0', 0, 0, 0, 0} /* Sentinel */
+ {'b', 1, b_getitem, b_setitem, "b", 1, 1},
+ {'B', 1, BB_getitem, BB_setitem, "B", 1, 0},
+ {'u', sizeof(Py_UNICODE), u_getitem, u_setitem, "u", 0, 0},
+ {'h', sizeof(short), h_getitem, h_setitem, "h", 1, 1},
+ {'H', sizeof(short), HH_getitem, HH_setitem, "H", 1, 0},
+ {'i', sizeof(int), i_getitem, i_setitem, "i", 1, 1},
+ {'I', sizeof(int), II_getitem, II_setitem, "I", 1, 0},
+ {'l', sizeof(long), l_getitem, l_setitem, "l", 1, 1},
+ {'L', sizeof(long), LL_getitem, LL_setitem, "L", 1, 0},
+ {'f', sizeof(float), f_getitem, f_setitem, "f", 0, 0},
+ {'d', sizeof(double), d_getitem, d_setitem, "d", 0, 0},
+ {'\0', 0, 0, 0, 0, 0, 0} /* Sentinel */
};
/****************************************************************************
@@ -668,11 +674,9 @@ array_concat(arrayobject *a, PyObject *bb)
static PyObject *
array_repeat(arrayobject *a, Py_ssize_t n)
{
- Py_ssize_t i;
Py_ssize_t size;
arrayobject *np;
- char *p;
- Py_ssize_t nbytes;
+ Py_ssize_t oldbytes, newbytes;
if (n < 0)
n = 0;
if ((Py_SIZE(a) != 0) && (n > PY_SSIZE_T_MAX / Py_SIZE(a))) {
@@ -682,13 +686,23 @@ array_repeat(arrayobject *a, Py_ssize_t n)
np = (arrayobject *) newarrayobject(&Arraytype, size, a->ob_descr);
if (np == NULL)
return NULL;
- p = np->ob_item;
- nbytes = Py_SIZE(a) * a->ob_descr->itemsize;
- for (i = 0; i < n; i++) {
- memcpy(p, a->ob_item, nbytes);
- p += nbytes;
+ if (n == 0)
+ return (PyObject *)np;
+ oldbytes = Py_SIZE(a) * a->ob_descr->itemsize;
+ newbytes = oldbytes * n;
+ /* this follows the code in unicode_repeat */
+ if (oldbytes == 1) {
+ memset(np->ob_item, a->ob_item[0], newbytes);
+ } else {
+ Py_ssize_t done = oldbytes;
+ Py_MEMCPY(np->ob_item, a->ob_item, oldbytes);
+ while (done < newbytes) {
+ Py_ssize_t ncopy = (done <= newbytes-done) ? done : newbytes-done;
+ Py_MEMCPY(np->ob_item+done, np->ob_item, ncopy);
+ done += ncopy;
+ }
}
- return (PyObject *) np;
+ return (PyObject *)np;
}
static int
@@ -1136,40 +1150,6 @@ Byteswap all items of the array. If the items in the array are not 1, 2,\n\
4, or 8 bytes in size, RuntimeError is raised.");
static PyObject *
-array_reduce(arrayobject *array)
-{
- PyObject *dict, *result;
-
- dict = PyObject_GetAttrString((PyObject *)array, "__dict__");
- if (dict == NULL) {
- PyErr_Clear();
- dict = Py_None;
- Py_INCREF(dict);
- }
- if (Py_SIZE(array) > 0) {
- if (array->ob_descr->itemsize
- > PY_SSIZE_T_MAX / Py_SIZE(array)) {
- return PyErr_NoMemory();
- }
- result = Py_BuildValue("O(Cy#)O",
- Py_TYPE(array),
- array->ob_descr->typecode,
- array->ob_item,
- Py_SIZE(array) * array->ob_descr->itemsize,
- dict);
- } else {
- result = Py_BuildValue("O(C)O",
- Py_TYPE(array),
- array->ob_descr->typecode,
- dict);
- }
- Py_DECREF(dict);
- return result;
-}
-
-PyDoc_STRVAR(array_doc, "Return state information for pickling.");
-
-static PyObject *
array_reverse(arrayobject *self, PyObject *unused)
{
register Py_ssize_t itemsize = self->ob_descr->itemsize;
@@ -1203,7 +1183,7 @@ Reverse the order of the items in the array.");
/* Forward */
-static PyObject *array_fromstring(arrayobject *self, PyObject *args);
+static PyObject *array_frombytes(arrayobject *self, PyObject *args);
static PyObject *
array_fromfile(arrayobject *self, PyObject *args)
@@ -1240,7 +1220,7 @@ array_fromfile(arrayobject *self, PyObject *args)
if (args == NULL)
return NULL;
- res = array_fromstring(self, args);
+ res = array_frombytes(self, args);
Py_DECREF(args);
if (res == NULL)
return NULL;
@@ -1359,45 +1339,84 @@ PyDoc_STRVAR(tolist_doc,
\n\
Convert array to an ordinary list with the same items.");
-
static PyObject *
-array_fromstring(arrayobject *self, PyObject *args)
+frombytes(arrayobject *self, Py_buffer *buffer)
{
- char *str;
- Py_ssize_t n;
int itemsize = self->ob_descr->itemsize;
- if (!PyArg_ParseTuple(args, "s#:fromstring", &str, &n))
+ Py_ssize_t n;
+ if (buffer->itemsize != 1) {
+ PyBuffer_Release(buffer);
+ PyErr_SetString(PyExc_TypeError, "string/buffer of bytes required.");
return NULL;
+ }
+ n = buffer->len;
if (n % itemsize != 0) {
+ PyBuffer_Release(buffer);
PyErr_SetString(PyExc_ValueError,
"string length not a multiple of item size");
return NULL;
}
n = n / itemsize;
if (n > 0) {
- Py_ssize_t old_size = Py_SIZE(self);
+ Py_ssize_t old_size = Py_SIZE(self);
if ((n > PY_SSIZE_T_MAX - old_size) ||
((old_size + n) > PY_SSIZE_T_MAX / itemsize)) {
+ PyBuffer_Release(buffer);
return PyErr_NoMemory();
}
- if (array_resize(self, old_size + n) == -1)
+ if (array_resize(self, old_size + n) == -1) {
+ PyBuffer_Release(buffer);
return NULL;
+ }
memcpy(self->ob_item + old_size * itemsize,
- str, n * itemsize);
+ buffer->buf, n * itemsize);
}
+ PyBuffer_Release(buffer);
Py_INCREF(Py_None);
return Py_None;
}
+static PyObject *
+array_fromstring(arrayobject *self, PyObject *args)
+{
+ Py_buffer buffer;
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "fromstring() is deprecated. Use frombytes() instead.", 2) != 0)
+ return NULL;
+ if (!PyArg_ParseTuple(args, "s*:fromstring", &buffer))
+ return NULL;
+ else
+ return frombytes(self, &buffer);
+}
+
PyDoc_STRVAR(fromstring_doc,
"fromstring(string)\n\
\n\
Appends items from the string, interpreting it as an array of machine\n\
+values, as if it had been read from a file using the fromfile() method).\n\
+\n\
+This method is deprecated. Use frombytes instead.");
+
+
+static PyObject *
+array_frombytes(arrayobject *self, PyObject *args)
+{
+ Py_buffer buffer;
+ if (!PyArg_ParseTuple(args, "y*:frombytes", &buffer))
+ return NULL;
+ else
+ return frombytes(self, &buffer);
+}
+
+PyDoc_STRVAR(frombytes_doc,
+"frombytes(bytestring)\n\
+\n\
+Appends items from the string, interpreting it as an array of machine\n\
values, as if it had been read from a file using the fromfile() method).");
static PyObject *
-array_tostring(arrayobject *self, PyObject *unused)
+array_tobytes(arrayobject *self, PyObject *unused)
{
if (Py_SIZE(self) <= PY_SSIZE_T_MAX / self->ob_descr->itemsize) {
return PyBytes_FromStringAndSize(self->ob_item,
@@ -1407,20 +1426,37 @@ array_tostring(arrayobject *self, PyObject *unused)
}
}
-PyDoc_STRVAR(tostring_doc,
-"tostring() -> string\n\
+PyDoc_STRVAR(tobytes_doc,
+"tobytes() -> bytes\n\
\n\
-Convert the array to an array of machine values and return the string\n\
+Convert the array to an array of machine values and return the bytes\n\
representation.");
+static PyObject *
+array_tostring(arrayobject *self, PyObject *unused)
+{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "tostring() is deprecated. Use tobytes() instead.", 2) != 0)
+ return NULL;
+ return array_tobytes(self, unused);
+}
+
+PyDoc_STRVAR(tostring_doc,
+"tostring() -> bytes\n\
+\n\
+Convert the array to an array of machine values and return the bytes\n\
+representation.\n\
+\n\
+This method is deprecated. Use tobytes instead.");
+
static PyObject *
array_fromunicode(arrayobject *self, PyObject *args)
{
Py_UNICODE *ustr;
Py_ssize_t n;
- char typecode;
+ Py_UNICODE typecode;
if (!PyArg_ParseTuple(args, "u#:fromunicode", &ustr, &n))
return NULL;
@@ -1448,14 +1484,14 @@ PyDoc_STRVAR(fromunicode_doc,
\n\
Extends this array with data from the unicode string ustr.\n\
The array must be a unicode type array; otherwise a ValueError\n\
-is raised. Use array.fromstring(ustr.decode(...)) to\n\
+is raised. Use array.frombytes(ustr.decode(...)) to\n\
append Unicode data to an array of some other type.");
static PyObject *
array_tounicode(arrayobject *self, PyObject *unused)
{
- char typecode;
+ Py_UNICODE typecode;
typecode = self->ob_descr->typecode;
if ((typecode != 'u')) {
PyErr_SetString(PyExc_ValueError,
@@ -1475,11 +1511,507 @@ an array of some other type.");
+/*********************** Pickling support ************************/
+
+enum machine_format_code {
+ UNKNOWN_FORMAT = -1,
+ /* UNKNOWN_FORMAT is used to indicate that the machine format for an
+ * array type code cannot be interpreted. When this occurs, a list of
+ * Python objects is used to represent the content of the array
+ * instead of using the memory content of the array directly. In that
+ * case, the array_reconstructor mechanism is bypassed completely, and
+ * the standard array constructor is used instead.
+ *
+ * This is will most likely occur when the machine doesn't use IEEE
+ * floating-point numbers.
+ */
+
+ UNSIGNED_INT8 = 0,
+ SIGNED_INT8 = 1,
+ UNSIGNED_INT16_LE = 2,
+ UNSIGNED_INT16_BE = 3,
+ SIGNED_INT16_LE = 4,
+ SIGNED_INT16_BE = 5,
+ UNSIGNED_INT32_LE = 6,
+ UNSIGNED_INT32_BE = 7,
+ SIGNED_INT32_LE = 8,
+ SIGNED_INT32_BE = 9,
+ UNSIGNED_INT64_LE = 10,
+ UNSIGNED_INT64_BE = 11,
+ SIGNED_INT64_LE = 12,
+ SIGNED_INT64_BE = 13,
+ IEEE_754_FLOAT_LE = 14,
+ IEEE_754_FLOAT_BE = 15,
+ IEEE_754_DOUBLE_LE = 16,
+ IEEE_754_DOUBLE_BE = 17,
+ UTF16_LE = 18,
+ UTF16_BE = 19,
+ UTF32_LE = 20,
+ UTF32_BE = 21
+};
+#define MACHINE_FORMAT_CODE_MIN 0
+#define MACHINE_FORMAT_CODE_MAX 21
+
+static const struct mformatdescr {
+ size_t size;
+ int is_signed;
+ int is_big_endian;
+} mformat_descriptors[] = {
+ {1, 0, 0}, /* 0: UNSIGNED_INT8 */
+ {1, 1, 0}, /* 1: SIGNED_INT8 */
+ {2, 0, 0}, /* 2: UNSIGNED_INT16_LE */
+ {2, 0, 1}, /* 3: UNSIGNED_INT16_BE */
+ {2, 1, 0}, /* 4: SIGNED_INT16_LE */
+ {2, 1, 1}, /* 5: SIGNED_INT16_BE */
+ {4, 0, 0}, /* 6: UNSIGNED_INT32_LE */
+ {4, 0, 1}, /* 7: UNSIGNED_INT32_BE */
+ {4, 1, 0}, /* 8: SIGNED_INT32_LE */
+ {4, 1, 1}, /* 9: SIGNED_INT32_BE */
+ {8, 0, 0}, /* 10: UNSIGNED_INT64_LE */
+ {8, 0, 1}, /* 11: UNSIGNED_INT64_BE */
+ {8, 1, 0}, /* 12: SIGNED_INT64_LE */
+ {8, 1, 1}, /* 13: SIGNED_INT64_BE */
+ {4, 0, 0}, /* 14: IEEE_754_FLOAT_LE */
+ {4, 0, 1}, /* 15: IEEE_754_FLOAT_BE */
+ {8, 0, 0}, /* 16: IEEE_754_DOUBLE_LE */
+ {8, 0, 1}, /* 17: IEEE_754_DOUBLE_BE */
+ {4, 0, 0}, /* 18: UTF16_LE */
+ {4, 0, 1}, /* 19: UTF16_BE */
+ {8, 0, 0}, /* 20: UTF32_LE */
+ {8, 0, 1} /* 21: UTF32_BE */
+};
+
+
+/*
+ * Internal: This function is used to find the machine format of a given
+ * array type code. This returns UNKNOWN_FORMAT when the machine format cannot
+ * be found.
+ */
+static enum machine_format_code
+typecode_to_mformat_code(int typecode)
+{
+#ifdef WORDS_BIGENDIAN
+ const int is_big_endian = 1;
+#else
+ const int is_big_endian = 0;
+#endif
+ size_t intsize;
+ int is_signed;
+
+ switch (typecode) {
+ case 'b':
+ return SIGNED_INT8;
+ case 'B':
+ return UNSIGNED_INT8;
+
+ case 'u':
+ if (sizeof(Py_UNICODE) == 2) {
+ return UTF16_LE + is_big_endian;
+ }
+ if (sizeof(Py_UNICODE) == 4) {
+ return UTF32_LE + is_big_endian;
+ }
+ return UNKNOWN_FORMAT;
+
+ case 'f':
+ if (sizeof(float) == 4) {
+ const float y = 16711938.0;
+ if (memcmp(&y, "\x4b\x7f\x01\x02", 4) == 0)
+ return IEEE_754_FLOAT_BE;
+ if (memcmp(&y, "\x02\x01\x7f\x4b", 4) == 0)
+ return IEEE_754_FLOAT_LE;
+ }
+ return UNKNOWN_FORMAT;
+
+ case 'd':
+ if (sizeof(double) == 8) {
+ const double x = 9006104071832581.0;
+ if (memcmp(&x, "\x43\x3f\xff\x01\x02\x03\x04\x05", 8) == 0)
+ return IEEE_754_DOUBLE_BE;
+ if (memcmp(&x, "\x05\x04\x03\x02\x01\xff\x3f\x43", 8) == 0)
+ return IEEE_754_DOUBLE_LE;
+ }
+ return UNKNOWN_FORMAT;
+
+ /* Integers */
+ case 'h':
+ intsize = sizeof(short);
+ is_signed = 1;
+ break;
+ case 'H':
+ intsize = sizeof(short);
+ is_signed = 0;
+ break;
+ case 'i':
+ intsize = sizeof(int);
+ is_signed = 1;
+ break;
+ case 'I':
+ intsize = sizeof(int);
+ is_signed = 0;
+ break;
+ case 'l':
+ intsize = sizeof(long);
+ is_signed = 1;
+ break;
+ case 'L':
+ intsize = sizeof(long);
+ is_signed = 0;
+ break;
+ default:
+ return UNKNOWN_FORMAT;
+ }
+ switch (intsize) {
+ case 2:
+ return UNSIGNED_INT16_LE + is_big_endian + (2 * is_signed);
+ case 4:
+ return UNSIGNED_INT32_LE + is_big_endian + (2 * is_signed);
+ case 8:
+ return UNSIGNED_INT64_LE + is_big_endian + (2 * is_signed);
+ default:
+ return UNKNOWN_FORMAT;
+ }
+}
+
+/* Forward declaration. */
+static PyObject *array_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
+
+/*
+ * Internal: This function wraps the array constructor--i.e., array_new()--to
+ * allow the creation of array objects from C code without having to deal
+ * directly the tuple argument of array_new(). The typecode argument is a
+ * Unicode character value, like 'i' or 'f' for example, representing an array
+ * type code. The items argument is a bytes or a list object from which
+ * contains the initial value of the array.
+ *
+ * On success, this functions returns the array object created. Otherwise,
+ * NULL is returned to indicate a failure.
+ */
+static PyObject *
+make_array(PyTypeObject *arraytype, Py_UNICODE typecode, PyObject *items)
+{
+ PyObject *new_args;
+ PyObject *array_obj;
+ PyObject *typecode_obj;
+
+ assert(arraytype != NULL);
+ assert(items != NULL);
+
+ typecode_obj = PyUnicode_FromUnicode(&typecode, 1);
+ if (typecode_obj == NULL)
+ return NULL;
+
+ new_args = PyTuple_New(2);
+ if (new_args == NULL)
+ return NULL;
+ Py_INCREF(items);
+ PyTuple_SET_ITEM(new_args, 0, typecode_obj);
+ PyTuple_SET_ITEM(new_args, 1, items);
+
+ array_obj = array_new(arraytype, new_args, NULL);
+ Py_DECREF(new_args);
+ if (array_obj == NULL)
+ return NULL;
+
+ return array_obj;
+}
+
+/*
+ * This functions is a special constructor used when unpickling an array. It
+ * provides a portable way to rebuild an array from its memory representation.
+ */
+static PyObject *
+array_reconstructor(PyObject *self, PyObject *args)
+{
+ PyTypeObject *arraytype;
+ PyObject *items;
+ PyObject *converted_items;
+ PyObject *result;
+ int typecode_int;
+ Py_UNICODE typecode;
+ enum machine_format_code mformat_code;
+ struct arraydescr *descr;
+
+ if (!PyArg_ParseTuple(args, "OCiO:array._array_reconstructor",
+ &arraytype, &typecode_int, &mformat_code, &items))
+ return NULL;
+
+ typecode = (Py_UNICODE)typecode_int;
+
+ if (!PyType_Check(arraytype)) {
+ PyErr_Format(PyExc_TypeError,
+ "first argument must a type object, not %.200s",
+ Py_TYPE(arraytype)->tp_name);
+ return NULL;
+ }
+ if (!PyType_IsSubtype(arraytype, &Arraytype)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s is not a subtype of %.200s",
+ arraytype->tp_name, Arraytype.tp_name);
+ return NULL;
+ }
+ for (descr = descriptors; descr->typecode != '\0'; descr++) {
+ if (descr->typecode == typecode)
+ break;
+ }
+ if (descr->typecode == '\0') {
+ PyErr_SetString(PyExc_ValueError,
+ "second argument must be a valid type code");
+ return NULL;
+ }
+ if (mformat_code < MACHINE_FORMAT_CODE_MIN ||
+ mformat_code > MACHINE_FORMAT_CODE_MAX) {
+ PyErr_SetString(PyExc_ValueError,
+ "third argument must be a valid machine format code.");
+ return NULL;
+ }
+ if (!PyBytes_Check(items)) {
+ PyErr_Format(PyExc_TypeError,
+ "fourth argument should be bytes, not %.200s",
+ Py_TYPE(items)->tp_name);
+ return NULL;
+ }
+
+ /* Fast path: No decoding has to be done. */
+ if (mformat_code == typecode_to_mformat_code(typecode) ||
+ mformat_code == UNKNOWN_FORMAT) {
+ return make_array(arraytype, typecode, items);
+ }
+
+ /* Slow path: Decode the byte string according to the given machine
+ * format code. This occurs when the computer unpickling the array
+ * object is architecturally different from the one that pickled the
+ * array.
+ */
+ if (Py_SIZE(items) % mformat_descriptors[mformat_code].size != 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "string length not a multiple of item size");
+ return NULL;
+ }
+ switch (mformat_code) {
+ case IEEE_754_FLOAT_LE:
+ case IEEE_754_FLOAT_BE: {
+ int i;
+ int le = (mformat_code == IEEE_754_FLOAT_LE) ? 1 : 0;
+ Py_ssize_t itemcount = Py_SIZE(items) / 4;
+ const unsigned char *memstr =
+ (unsigned char *)PyBytes_AS_STRING(items);
+
+ converted_items = PyList_New(itemcount);
+ if (converted_items == NULL)
+ return NULL;
+ for (i = 0; i < itemcount; i++) {
+ PyObject *pyfloat = PyFloat_FromDouble(
+ _PyFloat_Unpack4(&memstr[i * 4], le));
+ if (pyfloat == NULL) {
+ Py_DECREF(converted_items);
+ return NULL;
+ }
+ PyList_SET_ITEM(converted_items, i, pyfloat);
+ }
+ break;
+ }
+ case IEEE_754_DOUBLE_LE:
+ case IEEE_754_DOUBLE_BE: {
+ int i;
+ int le = (mformat_code == IEEE_754_DOUBLE_LE) ? 1 : 0;
+ Py_ssize_t itemcount = Py_SIZE(items) / 8;
+ const unsigned char *memstr =
+ (unsigned char *)PyBytes_AS_STRING(items);
+
+ converted_items = PyList_New(itemcount);
+ if (converted_items == NULL)
+ return NULL;
+ for (i = 0; i < itemcount; i++) {
+ PyObject *pyfloat = PyFloat_FromDouble(
+ _PyFloat_Unpack8(&memstr[i * 8], le));
+ if (pyfloat == NULL) {
+ Py_DECREF(converted_items);
+ return NULL;
+ }
+ PyList_SET_ITEM(converted_items, i, pyfloat);
+ }
+ break;
+ }
+ case UTF16_LE:
+ case UTF16_BE: {
+ int byteorder = (mformat_code == UTF16_LE) ? -1 : 1;
+ converted_items = PyUnicode_DecodeUTF16(
+ PyBytes_AS_STRING(items), Py_SIZE(items),
+ "strict", &byteorder);
+ if (converted_items == NULL)
+ return NULL;
+ break;
+ }
+ case UTF32_LE:
+ case UTF32_BE: {
+ int byteorder = (mformat_code == UTF32_LE) ? -1 : 1;
+ converted_items = PyUnicode_DecodeUTF32(
+ PyBytes_AS_STRING(items), Py_SIZE(items),
+ "strict", &byteorder);
+ if (converted_items == NULL)
+ return NULL;
+ break;
+ }
+
+ case UNSIGNED_INT8:
+ case SIGNED_INT8:
+ case UNSIGNED_INT16_LE:
+ case UNSIGNED_INT16_BE:
+ case SIGNED_INT16_LE:
+ case SIGNED_INT16_BE:
+ case UNSIGNED_INT32_LE:
+ case UNSIGNED_INT32_BE:
+ case SIGNED_INT32_LE:
+ case SIGNED_INT32_BE:
+ case UNSIGNED_INT64_LE:
+ case UNSIGNED_INT64_BE:
+ case SIGNED_INT64_LE:
+ case SIGNED_INT64_BE: {
+ int i;
+ const struct mformatdescr mf_descr =
+ mformat_descriptors[mformat_code];
+ Py_ssize_t itemcount = Py_SIZE(items) / mf_descr.size;
+ const unsigned char *memstr =
+ (unsigned char *)PyBytes_AS_STRING(items);
+ struct arraydescr *descr;
+
+ /* If possible, try to pack array's items using a data type
+ * that fits better. This may result in an array with narrower
+ * or wider elements.
+ *
+ * For example, if a 32-bit machine pickles a L-code array of
+ * unsigned longs, then the array will be unpickled by 64-bit
+ * machine as an I-code array of unsigned ints.
+ *
+ * XXX: Is it possible to write a unit test for this?
+ */
+ for (descr = descriptors; descr->typecode != '\0'; descr++) {
+ if (descr->is_integer_type &&
+ descr->itemsize == mf_descr.size &&
+ descr->is_signed == mf_descr.is_signed)
+ typecode = descr->typecode;
+ }
+
+ converted_items = PyList_New(itemcount);
+ if (converted_items == NULL)
+ return NULL;
+ for (i = 0; i < itemcount; i++) {
+ PyObject *pylong;
+
+ pylong = _PyLong_FromByteArray(
+ &memstr[i * mf_descr.size],
+ mf_descr.size,
+ !mf_descr.is_big_endian,
+ mf_descr.is_signed);
+ if (pylong == NULL) {
+ Py_DECREF(converted_items);
+ return NULL;
+ }
+ PyList_SET_ITEM(converted_items, i, pylong);
+ }
+ break;
+ }
+ case UNKNOWN_FORMAT:
+ /* Impossible, but needed to shut up GCC about the unhandled
+ * enumeration value.
+ */
+ default:
+ PyErr_BadArgument();
+ return NULL;
+ }
+
+ result = make_array(arraytype, typecode, converted_items);
+ Py_DECREF(converted_items);
+ return result;
+}
+
+static PyObject *
+array_reduce_ex(arrayobject *array, PyObject *value)
+{
+ PyObject *dict;
+ PyObject *result;
+ PyObject *array_str;
+ int typecode = array->ob_descr->typecode;
+ int mformat_code;
+ static PyObject *array_reconstructor = NULL;
+ long protocol;
+
+ if (array_reconstructor == NULL) {
+ PyObject *array_module = PyImport_ImportModule("array");
+ if (array_module == NULL)
+ return NULL;
+ array_reconstructor = PyObject_GetAttrString(
+ array_module,
+ "_array_reconstructor");
+ Py_DECREF(array_module);
+ if (array_reconstructor == NULL)
+ return NULL;
+ }
+
+ if (!PyLong_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "__reduce_ex__ argument should an integer");
+ return NULL;
+ }
+ protocol = PyLong_AsLong(value);
+ if (protocol == -1 && PyErr_Occurred())
+ return NULL;
+
+ dict = PyObject_GetAttrString((PyObject *)array, "__dict__");
+ if (dict == NULL) {
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError))
+ return NULL;
+ PyErr_Clear();
+ dict = Py_None;
+ Py_INCREF(dict);
+ }
+
+ mformat_code = typecode_to_mformat_code(typecode);
+ if (mformat_code == UNKNOWN_FORMAT || protocol < 3) {
+ /* Convert the array to a list if we got something weird
+ * (e.g., non-IEEE floats), or we are pickling the array using
+ * a Python 2.x compatible protocol.
+ *
+ * It is necessary to use a list representation for Python 2.x
+ * compatible pickle protocol, since Python 2's str objects
+ * are unpickled as unicode by Python 3. Thus it is impossible
+ * to make arrays unpicklable by Python 3 by using their memory
+ * representation, unless we resort to ugly hacks such as
+ * coercing unicode objects to bytes in array_reconstructor.
+ */
+ PyObject *list;
+ list = array_tolist(array, NULL);
+ if (list == NULL) {
+ Py_DECREF(dict);
+ return NULL;
+ }
+ result = Py_BuildValue(
+ "O(CO)O", Py_TYPE(array), typecode, list, dict);
+ Py_DECREF(list);
+ Py_DECREF(dict);
+ return result;
+ }
+
+ array_str = array_tobytes(array, NULL);
+ if (array_str == NULL) {
+ Py_DECREF(dict);
+ return NULL;
+ }
+ result = Py_BuildValue(
+ "O(OCiN)O", array_reconstructor, Py_TYPE(array), typecode,
+ mformat_code, array_str, dict);
+ Py_DECREF(dict);
+ return result;
+}
+
+PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
+
static PyObject *
array_get_typecode(arrayobject *a, void *closure)
{
- char tc = a->ob_descr->typecode;
- return PyUnicode_FromStringAndSize(&tc, 1);
+ Py_UNICODE tc = a->ob_descr->typecode;
+ return PyUnicode_FromUnicode(&tc, 1);
}
static PyObject *
@@ -1517,6 +2049,8 @@ static PyMethodDef array_methods[] = {
fromlist_doc},
{"fromstring", (PyCFunction)array_fromstring, METH_VARARGS,
fromstring_doc},
+ {"frombytes", (PyCFunction)array_frombytes, METH_VARARGS,
+ frombytes_doc},
{"fromunicode", (PyCFunction)array_fromunicode, METH_VARARGS,
fromunicode_doc},
{"index", (PyCFunction)array_index, METH_O,
@@ -1525,8 +2059,8 @@ static PyMethodDef array_methods[] = {
insert_doc},
{"pop", (PyCFunction)array_pop, METH_VARARGS,
pop_doc},
- {"__reduce__", (PyCFunction)array_reduce, METH_NOARGS,
- array_doc},
+ {"__reduce_ex__", (PyCFunction)array_reduce_ex, METH_O,
+ reduce_doc},
{"remove", (PyCFunction)array_remove, METH_O,
remove_doc},
{"reverse", (PyCFunction)array_reverse, METH_NOARGS,
@@ -1539,6 +2073,8 @@ static PyMethodDef array_methods[] = {
tolist_doc},
{"tostring", (PyCFunction)array_tostring, METH_NOARGS,
tostring_doc},
+ {"tobytes", (PyCFunction)array_tobytes, METH_NOARGS,
+ tobytes_doc},
{"tounicode", (PyCFunction)array_tounicode, METH_NOARGS,
tounicode_doc},
{NULL, NULL} /* sentinel */
@@ -1547,21 +2083,21 @@ static PyMethodDef array_methods[] = {
static PyObject *
array_repr(arrayobject *a)
{
- char typecode;
+ Py_UNICODE typecode;
PyObject *s, *v = NULL;
Py_ssize_t len;
len = Py_SIZE(a);
typecode = a->ob_descr->typecode;
if (len == 0) {
- return PyUnicode_FromFormat("array('%c')", typecode);
+ return PyUnicode_FromFormat("array('%c')", (int)typecode);
}
if ((typecode == 'u'))
v = array_tounicode(a, NULL);
else
v = array_tolist(a, NULL);
- s = PyUnicode_FromFormat("array('%c', %R)", typecode, v);
+ s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v);
Py_DECREF(v);
return s;
}
@@ -1584,7 +2120,7 @@ array_subscr(arrayobject* self, PyObject* item)
arrayobject* ar;
int itemsize = self->ob_descr->itemsize;
- if (PySlice_GetIndicesEx((PySliceObject*)item, Py_SIZE(self),
+ if (PySlice_GetIndicesEx(item, Py_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
@@ -1655,7 +2191,7 @@ array_ass_subscr(arrayobject* self, PyObject* item, PyObject* value)
return (*self->ob_descr->setitem)(self, i, value);
}
else if (PySlice_Check(item)) {
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
Py_SIZE(self), &start, &stop,
&step, &slicelength) < 0) {
return -1;
@@ -1869,7 +2405,9 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|| PyByteArray_Check(initial)
|| PyBytes_Check(initial)
|| PyTuple_Check(initial)
- || ((c=='u') && PyUnicode_Check(initial)))) {
+ || ((c=='u') && PyUnicode_Check(initial))
+ || (array_Check(initial)
+ && c == ((arrayobject*)initial)->ob_descr->typecode))) {
it = PyObject_GetIter(initial);
if (it == NULL)
return NULL;
@@ -1885,17 +2423,20 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *a;
Py_ssize_t len;
- if (initial == NULL || !(PyList_Check(initial)
- || PyTuple_Check(initial)))
+ if (initial == NULL)
len = 0;
+ else if (PyList_Check(initial))
+ len = PyList_GET_SIZE(initial);
+ else if (PyTuple_Check(initial) || array_Check(initial))
+ len = Py_SIZE(initial);
else
- len = PySequence_Size(initial);
+ len = 0;
a = newarrayobject(type, len, descr);
if (a == NULL)
return NULL;
- if (len > 0) {
+ if (len > 0 && !array_Check(initial)) {
Py_ssize_t i;
for (i = 0; i < len; i++) {
PyObject *v =
@@ -1920,7 +2461,7 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Py_DECREF(a);
return NULL;
}
- v = array_fromstring((arrayobject *)a,
+ v = array_frombytes((arrayobject *)a,
t_initial);
Py_DECREF(t_initial);
if (v == NULL) {
@@ -1946,6 +2487,11 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
self->allocated = Py_SIZE(self);
}
}
+ else if (initial != NULL && array_Check(initial)) {
+ arrayobject *self = (arrayobject *)a;
+ arrayobject *other = (arrayobject *)initial;
+ memcpy(self->ob_item, other->ob_item, len * other->ob_descr->itemsize);
+ }
if (it != NULL) {
if (array_iter_extend((arrayobject *)a, it) == -1) {
Py_DECREF(it);
@@ -2168,6 +2714,8 @@ static PyTypeObject PyArrayIter_Type = {
/* No functions in array module. */
static PyMethodDef a_methods[] = {
+ {"_array_reconstructor", array_reconstructor, METH_VARARGS,
+ PyDoc_STR("Internal. Used for pickling support.")},
{NULL, NULL, 0, NULL} /* Sentinel */
};
diff --git a/Modules/atexitmodule.c b/Modules/atexitmodule.c
index 1382133e0a..1ee7ead05f 100644
--- a/Modules/atexitmodule.c
+++ b/Modules/atexitmodule.c
@@ -72,6 +72,7 @@ atexit_callfuncs(void)
PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
if (!PyErr_ExceptionMatches(PyExc_SystemExit)) {
PySys_WriteStderr("Error in atexit._run_exitfuncs:\n");
+ PyErr_NormalizeException(&exc_type, &exc_value, &exc_tb);
PyErr_Display(exc_type, exc_value, exc_tb);
}
}
diff --git a/Modules/audioop.c b/Modules/audioop.c
index ce3fce36ab..a031d42b0f 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -1,6 +1,8 @@
/* audioopmodule - Module to detect peak values in arrays */
+#define PY_SSIZE_T_CLEAN
+
#include "Python.h"
#if SIZEOF_INT == 4
@@ -307,7 +309,7 @@ audioop_check_size(int size)
}
static int
-audioop_check_parameters(int len, int size)
+audioop_check_parameters(Py_ssize_t len, int size)
{
if (!audioop_check_size(size))
return 0;
@@ -322,10 +324,10 @@ static PyObject *
audioop_getsample(PyObject *self, PyObject *args)
{
signed char *cp;
- int len, size, val = 0;
- int i;
+ Py_ssize_t len, i;
+ int size, val = 0;
- if ( !PyArg_ParseTuple(args, "s#ii:getsample", &cp, &len, &size, &i) )
+ if ( !PyArg_ParseTuple(args, "s#in:getsample", &cp, &len, &size, &i) )
return 0;
if (!audioop_check_parameters(len, size))
return NULL;
@@ -343,8 +345,8 @@ static PyObject *
audioop_max(PyObject *self, PyObject *args)
{
signed char *cp;
- int len, size, val = 0;
- int i;
+ Py_ssize_t len, i;
+ int size, val = 0;
int max = 0;
if ( !PyArg_ParseTuple(args, "s#i:max", &cp, &len, &size) )
@@ -365,8 +367,8 @@ static PyObject *
audioop_minmax(PyObject *self, PyObject *args)
{
signed char *cp;
- int len, size, val = 0;
- int i;
+ Py_ssize_t len, i;
+ int size, val = 0;
int min = 0x7fffffff, max = -0x7fffffff;
if (!PyArg_ParseTuple(args, "s#i:minmax", &cp, &len, &size))
@@ -387,8 +389,8 @@ static PyObject *
audioop_avg(PyObject *self, PyObject *args)
{
signed char *cp;
- int len, size, val = 0;
- int i;
+ Py_ssize_t len, i;
+ int size, val = 0;
double avg = 0.0;
if ( !PyArg_ParseTuple(args, "s#i:avg", &cp, &len, &size) )
@@ -412,8 +414,8 @@ static PyObject *
audioop_rms(PyObject *self, PyObject *args)
{
signed char *cp;
- int len, size, val = 0;
- int i;
+ Py_ssize_t len, i;
+ int size, val = 0;
double sum_squares = 0.0;
if ( !PyArg_ParseTuple(args, "s#i:rms", &cp, &len, &size) )
@@ -433,9 +435,9 @@ audioop_rms(PyObject *self, PyObject *args)
return PyLong_FromLong(val);
}
-static double _sum2(short *a, short *b, int len)
+static double _sum2(short *a, short *b, Py_ssize_t len)
{
- int i;
+ Py_ssize_t i;
double sum = 0.0;
for( i=0; i<len; i++) {
@@ -480,8 +482,8 @@ static PyObject *
audioop_findfit(PyObject *self, PyObject *args)
{
short *cp1, *cp2;
- int len1, len2;
- int j, best_j;
+ Py_ssize_t len1, len2;
+ Py_ssize_t j, best_j;
double aj_m1, aj_lm1;
double sum_ri_2, sum_aij_2, sum_aij_ri, result, best_result, factor;
@@ -532,7 +534,7 @@ audioop_findfit(PyObject *self, PyObject *args)
factor = _sum2(cp1+best_j, cp2, len2) / sum_ri_2;
- return Py_BuildValue("(if)", best_j, factor);
+ return Py_BuildValue("(nf)", best_j, factor);
}
/*
@@ -543,7 +545,7 @@ static PyObject *
audioop_findfactor(PyObject *self, PyObject *args)
{
short *cp1, *cp2;
- int len1, len2;
+ Py_ssize_t len1, len2;
double sum_ri_2, sum_aij_ri, result;
if ( !PyArg_ParseTuple(args, "s#s#:findfactor",
@@ -574,12 +576,12 @@ static PyObject *
audioop_findmax(PyObject *self, PyObject *args)
{
short *cp1;
- int len1, len2;
- int j, best_j;
+ Py_ssize_t len1, len2;
+ Py_ssize_t j, best_j;
double aj_m1, aj_lm1;
double result, best_result;
- if ( !PyArg_ParseTuple(args, "s#i:findmax",
+ if ( !PyArg_ParseTuple(args, "s#n:findmax",
(char**)&cp1, &len1, &len2) )
return 0;
if ( len1 & 1 ) {
@@ -612,16 +614,16 @@ audioop_findmax(PyObject *self, PyObject *args)
}
- return PyLong_FromLong(best_j);
+ return PyLong_FromSsize_t(best_j);
}
static PyObject *
audioop_avgpp(PyObject *self, PyObject *args)
{
signed char *cp;
- int len, size, val = 0, prevval = 0, prevextremevalid = 0,
+ Py_ssize_t len, i;
+ int size, val = 0, prevval = 0, prevextremevalid = 0,
prevextreme = 0;
- int i;
double avg = 0.0;
int diff, prevdiff, extremediff, nextreme = 0;
@@ -674,9 +676,9 @@ static PyObject *
audioop_maxpp(PyObject *self, PyObject *args)
{
signed char *cp;
- int len, size, val = 0, prevval = 0, prevextremevalid = 0,
+ Py_ssize_t len, i;
+ int size, val = 0, prevval = 0, prevextremevalid = 0,
prevextreme = 0;
- int i;
int max = 0;
int diff, prevdiff, extremediff;
@@ -725,9 +727,10 @@ static PyObject *
audioop_cross(PyObject *self, PyObject *args)
{
signed char *cp;
- int len, size, val = 0;
- int i;
- int prevval, ncross;
+ Py_ssize_t len, i;
+ int size, val = 0;
+ int prevval;
+ Py_ssize_t ncross;
if ( !PyArg_ParseTuple(args, "s#i:cross", &cp, &len, &size) )
return 0;
@@ -743,17 +746,17 @@ audioop_cross(PyObject *self, PyObject *args)
if ( val != prevval ) ncross++;
prevval = val;
}
- return PyLong_FromLong(ncross);
+ return PyLong_FromSsize_t(ncross);
}
static PyObject *
audioop_mul(PyObject *self, PyObject *args)
{
signed char *cp, *ncp;
- int len, size, val = 0;
+ Py_ssize_t len, i;
+ int size, val = 0;
double factor, fval, maxval;
PyObject *rv;
- int i;
if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size, &factor ) )
return 0;
@@ -794,10 +797,10 @@ audioop_tomono(PyObject *self, PyObject *args)
{
Py_buffer pcp;
signed char *cp, *ncp;
- int len, size, val1 = 0, val2 = 0;
+ Py_ssize_t len, i;
+ int size, val1 = 0, val2 = 0;
double fac1, fac2, fval, maxval;
PyObject *rv;
- int i;
if ( !PyArg_ParseTuple(args, "s*idd:tomono",
&pcp, &size, &fac1, &fac2 ) )
@@ -854,10 +857,10 @@ static PyObject *
audioop_tostereo(PyObject *self, PyObject *args)
{
signed char *cp, *ncp;
- int len, size, val1, val2, val = 0;
+ Py_ssize_t len, i;
+ int size, val1, val2, val = 0;
double fac1, fac2, fval, maxval;
PyObject *rv;
- int i;
if ( !PyArg_ParseTuple(args, "s#idd:tostereo",
&cp, &len, &size, &fac1, &fac2 ) )
@@ -873,7 +876,7 @@ audioop_tostereo(PyObject *self, PyObject *args)
return 0;
}
- if (len > INT_MAX/2) {
+ if (len > PY_SSIZE_T_MAX/2) {
PyErr_SetString(PyExc_MemoryError,
"not enough memory for output buffer");
return 0;
@@ -915,9 +918,9 @@ static PyObject *
audioop_add(PyObject *self, PyObject *args)
{
signed char *cp1, *cp2, *ncp;
- int len1, len2, size, val1 = 0, val2 = 0, maxval, newval;
+ Py_ssize_t len1, len2, i;
+ int size, val1 = 0, val2 = 0, maxval, newval;
PyObject *rv;
- int i;
if ( !PyArg_ParseTuple(args, "s#s#i:add",
&cp1, &len1, &cp2, &len2, &size ) )
@@ -969,9 +972,9 @@ static PyObject *
audioop_bias(PyObject *self, PyObject *args)
{
signed char *cp, *ncp;
- int len, size, val = 0;
+ Py_ssize_t len, i;
+ int size, val = 0;
PyObject *rv;
- int i;
int bias;
if ( !PyArg_ParseTuple(args, "s#ii:bias",
@@ -1004,9 +1007,9 @@ audioop_reverse(PyObject *self, PyObject *args)
{
signed char *cp;
unsigned char *ncp;
- int len, size, val = 0;
+ Py_ssize_t len, i, j;
+ int size, val = 0;
PyObject *rv;
- int i, j;
if ( !PyArg_ParseTuple(args, "s#i:reverse",
&cp, &len, &size) )
@@ -1039,9 +1042,9 @@ audioop_lin2lin(PyObject *self, PyObject *args)
{
signed char *cp;
unsigned char *ncp;
- int len, size, size2, val = 0;
+ Py_ssize_t len, i, j;
+ int size, size2, val = 0;
PyObject *rv;
- int i, j;
if ( !PyArg_ParseTuple(args, "s#ii:lin2lin",
&cp, &len, &size, &size2) )
@@ -1052,7 +1055,7 @@ audioop_lin2lin(PyObject *self, PyObject *args)
if (!audioop_check_size(size2))
return NULL;
- if (len/size > INT_MAX/size2) {
+ if (len/size > PY_SSIZE_T_MAX/size2) {
PyErr_SetString(PyExc_MemoryError,
"not enough memory for output buffer");
return 0;
@@ -1089,7 +1092,8 @@ static PyObject *
audioop_ratecv(PyObject *self, PyObject *args)
{
char *cp, *ncp;
- int len, size, nchannels, inrate, outrate, weightA, weightB;
+ Py_ssize_t len;
+ int size, nchannels, inrate, outrate, weightA, weightB;
int chan, d, *prev_i, *cur_i, cur_o;
PyObject *state, *samps, *str, *rv = NULL;
int bytes_per_frame;
@@ -1180,8 +1184,8 @@ audioop_ratecv(PyObject *self, PyObject *args)
case ceiling(len/inrate) * outrate. */
/* compute ceiling(len/inrate) without overflow */
- int q = len > 0 ? 1 + (len - 1) / inrate : 0;
- if (outrate > INT_MAX / q / bytes_per_frame)
+ Py_ssize_t q = len > 0 ? 1 + (len - 1) / inrate : 0;
+ if (outrate > PY_SSIZE_T_MAX / q / bytes_per_frame)
str = NULL;
else
str = PyBytes_FromStringAndSize(NULL,
@@ -1210,7 +1214,7 @@ audioop_ratecv(PyObject *self, PyObject *args)
goto exit;
/* We have checked before that the length
* of the string fits into int. */
- len = (int)(ncp - PyBytes_AsString(str));
+ len = (Py_ssize_t)(ncp - PyBytes_AsString(str));
rv = PyBytes_FromStringAndSize
(PyBytes_AsString(str), len);
Py_DECREF(str);
@@ -1269,9 +1273,9 @@ audioop_lin2ulaw(PyObject *self, PyObject *args)
{
signed char *cp;
unsigned char *ncp;
- int len, size, val = 0;
+ Py_ssize_t len, i;
+ int size, val = 0;
PyObject *rv;
- int i;
if ( !PyArg_ParseTuple(args, "s#i:lin2ulaw",
&cp, &len, &size) )
@@ -1301,9 +1305,9 @@ audioop_ulaw2lin(PyObject *self, PyObject *args)
unsigned char *cp;
unsigned char cval;
signed char *ncp;
- int len, size, val;
+ Py_ssize_t len, i;
+ int size, val;
PyObject *rv;
- int i;
if ( !PyArg_ParseTuple(args, "s#i:ulaw2lin",
&cp, &len, &size) )
@@ -1312,7 +1316,7 @@ audioop_ulaw2lin(PyObject *self, PyObject *args)
if (!audioop_check_parameters(len, size))
return NULL;
- if (len > INT_MAX/size) {
+ if (len > PY_SSIZE_T_MAX/size) {
PyErr_SetString(PyExc_MemoryError,
"not enough memory for output buffer");
return 0;
@@ -1338,9 +1342,9 @@ audioop_lin2alaw(PyObject *self, PyObject *args)
{
signed char *cp;
unsigned char *ncp;
- int len, size, val = 0;
+ Py_ssize_t len, i;
+ int size, val = 0;
PyObject *rv;
- int i;
if ( !PyArg_ParseTuple(args, "s#i:lin2alaw",
&cp, &len, &size) )
@@ -1370,9 +1374,9 @@ audioop_alaw2lin(PyObject *self, PyObject *args)
unsigned char *cp;
unsigned char cval;
signed char *ncp;
- int len, size, val;
+ Py_ssize_t len, i;
+ int size, val;
PyObject *rv;
- int i;
if ( !PyArg_ParseTuple(args, "s#i:alaw2lin",
&cp, &len, &size) )
@@ -1381,7 +1385,7 @@ audioop_alaw2lin(PyObject *self, PyObject *args)
if (!audioop_check_parameters(len, size))
return NULL;
- if (len > INT_MAX/size) {
+ if (len > PY_SSIZE_T_MAX/size) {
PyErr_SetString(PyExc_MemoryError,
"not enough memory for output buffer");
return 0;
@@ -1407,10 +1411,11 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
{
signed char *cp;
signed char *ncp;
- int len, size, val = 0, step, valpred, delta,
+ Py_ssize_t len, i;
+ int size, val = 0, step, valpred, delta,
index, sign, vpdiff, diff;
PyObject *rv, *state, *str;
- int i, outputbuffer = 0, bufferstep;
+ int outputbuffer = 0, bufferstep;
if ( !PyArg_ParseTuple(args, "s#iO:lin2adpcm",
&cp, &len, &size, &state) )
@@ -1513,9 +1518,10 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
{
signed char *cp;
signed char *ncp;
- int len, size, valpred, step, delta, index, sign, vpdiff;
+ Py_ssize_t len, i;
+ int size, valpred, step, delta, index, sign, vpdiff;
PyObject *rv, *str, *state;
- int i, inputbuffer = 0, bufferstep;
+ int inputbuffer = 0, bufferstep;
if ( !PyArg_ParseTuple(args, "s#iO:adpcm2lin",
&cp, &len, &size, &state) )
@@ -1533,7 +1539,7 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
} else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) )
return 0;
- if (len > (INT_MAX/2)/size) {
+ if (len > (PY_SSIZE_T_MAX/2)/size) {
PyErr_SetString(PyExc_MemoryError,
"not enough memory for output buffer");
return 0;
diff --git a/Modules/binascii.c b/Modules/binascii.c
index 689d132263..01e8860218 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -537,6 +537,7 @@ PyDoc_STRVAR(doc_a2b_hqx, "ascii -> bin, done. Decode .hqx coding");
static PyObject *
binascii_a2b_hqx(PyObject *self, PyObject *args)
{
+ Py_buffer pascii;
unsigned char *ascii_data, *bin_data;
int leftbits = 0;
unsigned char this_ch;
@@ -545,19 +546,25 @@ binascii_a2b_hqx(PyObject *self, PyObject *args)
Py_ssize_t len;
int done = 0;
- if ( !PyArg_ParseTuple(args, "t#:a2b_hqx", &ascii_data, &len) )
+ if ( !PyArg_ParseTuple(args, "y*:a2b_hqx", &pascii) )
return NULL;
+ ascii_data = pascii.buf;
+ len = pascii.len;
assert(len >= 0);
- if (len > PY_SSIZE_T_MAX - 2)
+ if (len > PY_SSIZE_T_MAX - 2) {
+ PyBuffer_Release(&pascii);
return PyErr_NoMemory();
+ }
/* Allocate a string that is too big (fixed later)
Add two to the initial length to prevent interning which
would preclude subsequent resizing. */
- if ( (rv=PyBytes_FromStringAndSize(NULL, len+2)) == NULL )
+ if ( (rv=PyBytes_FromStringAndSize(NULL, len+2)) == NULL ) {
+ PyBuffer_Release(&pascii);
return NULL;
+ }
bin_data = (unsigned char *)PyBytes_AS_STRING(rv);
for( ; len > 0 ; len--, ascii_data++ ) {
@@ -567,6 +574,7 @@ binascii_a2b_hqx(PyObject *self, PyObject *args)
continue;
if ( this_ch == FAIL ) {
PyErr_SetString(Error, "Illegal char");
+ PyBuffer_Release(&pascii);
Py_DECREF(rv);
return NULL;
}
@@ -589,6 +597,7 @@ binascii_a2b_hqx(PyObject *self, PyObject *args)
if ( leftbits && !done ) {
PyErr_SetString(Incomplete,
"String has incomplete number of bytes");
+ PyBuffer_Release(&pascii);
Py_DECREF(rv);
return NULL;
}
@@ -600,10 +609,12 @@ binascii_a2b_hqx(PyObject *self, PyObject *args)
}
if (rv) {
PyObject *rrv = Py_BuildValue("Oi", rv, done);
+ PyBuffer_Release(&pascii);
Py_DECREF(rv);
return rrv;
}
+ PyBuffer_Release(&pascii);
return NULL;
}
@@ -739,7 +750,7 @@ binascii_rledecode_hqx(PyObject *self, PyObject *args)
PyObject *rv;
Py_ssize_t in_len, out_len, out_len_left;
- if ( !PyArg_ParseTuple(args, "s*:rledecode_hqx", &pin) )
+ if ( !PyArg_ParseTuple(args, "y*:rledecode_hqx", &pin) )
return NULL;
in_data = pin.buf;
in_len = pin.len;
@@ -1110,7 +1121,7 @@ binascii_unhexlify(PyObject *self, PyObject *args)
char* retbuf;
Py_ssize_t i, j;
- if (!PyArg_ParseTuple(args, "s*:a2b_hex", &parg))
+ if (!PyArg_ParseTuple(args, "y*:a2b_hex", &parg))
return NULL;
argbuf = parg.buf;
arglen = parg.len;
@@ -1188,7 +1199,7 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
static char *kwlist[] = {"data", "header", NULL};
int header = 0;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|i", kwlist, &pdata,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i", kwlist, &pdata,
&header))
return NULL;
data = pdata.buf;
@@ -1326,8 +1337,7 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
((data[in] == '\t' || data[in] == ' ') && (in + 1 == datalen)) ||
((data[in] < 33) &&
(data[in] != '\r') && (data[in] != '\n') &&
- (quotetabs ||
- (!quotetabs && ((data[in] != '\t') && (data[in] != ' '))))))
+ (quotetabs || ((data[in] != '\t') && (data[in] != ' ')))))
{
if ((linelen + 3) >= MAXLINESIZE) {
linelen = 0;
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index f41896998d..3e55202bd8 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -1206,10 +1206,7 @@ BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs)
&compresslevel))
return -1;
- if (PyBytes_Check(name_obj))
- name = PyBytes_AsString(name_obj);
- else
- name = PyByteArray_AsString(name_obj);
+ name = PyBytes_AsString(name_obj);
if (compresslevel < 1 || compresslevel > 9) {
PyErr_SetString(PyExc_ValueError,
"compresslevel must be between 1 and 9");
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c
index 592b4ea4a2..3021cf0466 100644
--- a/Modules/cmathmodule.c
+++ b/Modules/cmathmodule.c
@@ -3,6 +3,7 @@
/* much code borrowed from mathmodule.c */
#include "Python.h"
+#include "_math.h"
/* we need DBL_MAX, DBL_MIN, DBL_EPSILON, DBL_MANT_DIG and FLT_RADIX from
float.h. We assume that FLT_RADIX is either 2 or 16. */
#include <float.h>
@@ -149,7 +150,7 @@ c_acos(Py_complex z)
s2.imag = z.imag;
s2 = c_sqrt(s2);
r.real = 2.*atan2(s1.real, s2.real);
- r.imag = asinh(s2.real*s1.imag - s2.imag*s1.real);
+ r.imag = m_asinh(s2.real*s1.imag - s2.imag*s1.real);
}
errno = 0;
return r;
@@ -181,7 +182,7 @@ c_acosh(Py_complex z)
s2.real = z.real + 1.;
s2.imag = z.imag;
s2 = c_sqrt(s2);
- r.real = asinh(s1.real*s2.real + s1.imag*s2.imag);
+ r.real = m_asinh(s1.real*s2.real + s1.imag*s2.imag);
r.imag = 2.*atan2(s1.imag, s2.real);
}
errno = 0;
@@ -238,7 +239,7 @@ c_asinh(Py_complex z)
s2.real = 1.-z.imag;
s2.imag = z.real;
s2 = c_sqrt(s2);
- r.real = asinh(s1.real*s2.imag-s2.real*s1.imag);
+ r.real = m_asinh(s1.real*s2.imag-s2.real*s1.imag);
r.imag = atan2(z.imag, s1.real*s2.real-s1.imag*s2.imag);
}
errno = 0;
@@ -342,7 +343,7 @@ c_atanh(Py_complex z)
errno = 0;
}
} else {
- r.real = log1p(4.*z.real/((1-z.real)*(1-z.real) + ay*ay))/4.;
+ r.real = m_log1p(4.*z.real/((1-z.real)*(1-z.real) + ay*ay))/4.;
r.imag = -atan2(-2.*z.imag, (1-z.real)*(1+z.real) - ay*ay)/2.;
errno = 0;
}
@@ -552,7 +553,7 @@ c_log(Py_complex z)
if (0.71 <= h && h <= 1.73) {
am = ax > ay ? ax : ay; /* max(ax, ay) */
an = ax > ay ? ay : ax; /* min(ax, ay) */
- r.real = log1p((am-1)*(am+1)+an*an)/2.;
+ r.real = m_log1p((am-1)*(am+1)+an*an)/2.;
} else {
r.real = log(h);
}
@@ -1023,6 +1024,19 @@ PyDoc_STRVAR(cmath_rect_doc,
Convert from polar coordinates to rectangular coordinates.");
static PyObject *
+cmath_isfinite(PyObject *self, PyObject *args)
+{
+ Py_complex z;
+ if (!PyArg_ParseTuple(args, "D:isfinite", &z))
+ return NULL;
+ return PyBool_FromLong(Py_IS_FINITE(z.real) && Py_IS_FINITE(z.imag));
+}
+
+PyDoc_STRVAR(cmath_isfinite_doc,
+"isfinite(z) -> bool\n\
+Return True if both the real and imaginary parts of z are finite, else False.");
+
+static PyObject *
cmath_isnan(PyObject *self, PyObject *args)
{
Py_complex z;
@@ -1064,6 +1078,7 @@ static PyMethodDef cmath_methods[] = {
{"cos", cmath_cos, METH_VARARGS, c_cos_doc},
{"cosh", cmath_cosh, METH_VARARGS, c_cosh_doc},
{"exp", cmath_exp, METH_VARARGS, c_exp_doc},
+ {"isfinite", cmath_isfinite, METH_VARARGS, cmath_isfinite_doc},
{"isinf", cmath_isinf, METH_VARARGS, cmath_isinf_doc},
{"isnan", cmath_isnan, METH_VARARGS, cmath_isnan_doc},
{"log", cmath_log, METH_VARARGS, cmath_log_doc},
diff --git a/Modules/config.c.in b/Modules/config.c.in
index 3fb5dd3f4f..34d44d5a88 100644
--- a/Modules/config.c.in
+++ b/Modules/config.c.in
@@ -29,6 +29,7 @@ extern PyObject* PyInit_imp(void);
extern PyObject* PyInit_gc(void);
extern PyObject* PyInit__ast(void);
extern PyObject* _PyWarnings_Init(void);
+extern PyObject* PyInit__string(void);
struct _inittab _PyImport_Inittab[] = {
@@ -54,6 +55,9 @@ struct _inittab _PyImport_Inittab[] = {
/* This lives in _warnings.c */
{"_warnings", _PyWarnings_Init},
+ /* This lives in Objects/unicodeobject.c */
+ {"_string", PyInit__string},
+
/* Sentinel */
{0, 0}
};
diff --git a/Modules/errnomodule.c b/Modules/errnomodule.c
index 03c65f796d..86720af49d 100644
--- a/Modules/errnomodule.c
+++ b/Modules/errnomodule.c
@@ -82,7 +82,8 @@ PyInit_errno(void)
/*
* The names and comments are borrowed from linux/include/errno.h,
- * which should be pretty all-inclusive
+ * which should be pretty all-inclusive. However, the Solaris specific
+ * names and comments are borrowed from sys/errno.h in Solaris.
*/
#ifdef ENODEV
@@ -796,6 +797,56 @@ PyInit_errno(void)
#ifdef WSAN
inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
#endif
+#ifdef ENOMEDIUM
+ inscode(d, ds, de, "ENOMEDIUM", ENOMEDIUM, "No medium found");
+#endif
+#ifdef EMEDIUMTYPE
+ inscode(d, ds, de, "EMEDIUMTYPE", EMEDIUMTYPE, "Wrong medium type");
+#endif
+#ifdef ECANCELED
+ inscode(d, ds, de, "ECANCELED", ECANCELED, "Operation Canceled");
+#endif
+#ifdef ENOKEY
+ inscode(d, ds, de, "ENOKEY", ENOKEY, "Required key not available");
+#endif
+#ifdef EKEYEXPIRED
+ inscode(d, ds, de, "EKEYEXPIRED", EKEYEXPIRED, "Key has expired");
+#endif
+#ifdef EKEYREVOKED
+ inscode(d, ds, de, "EKEYREVOKED", EKEYREVOKED, "Key has been revoked");
+#endif
+#ifdef EKEYREJECTED
+ inscode(d, ds, de, "EKEYREJECTED", EKEYREJECTED, "Key was rejected by service");
+#endif
+#ifdef EOWNERDEAD
+ inscode(d, ds, de, "EOWNERDEAD", EOWNERDEAD, "Owner died");
+#endif
+#ifdef ENOTRECOVERABLE
+ inscode(d, ds, de, "ENOTRECOVERABLE", ENOTRECOVERABLE, "State not recoverable");
+#endif
+#ifdef ERFKILL
+ inscode(d, ds, de, "ERFKILL", ERFKILL, "Operation not possible due to RF-kill");
+#endif
+
+ /* Solaris-specific errnos */
+#ifdef ECANCELED
+ inscode(d, ds, de, "ECANCELED", ECANCELED, "Operation canceled");
+#endif
+#ifdef ENOTSUP
+ inscode(d, ds, de, "ENOTSUP", ENOTSUP, "Operation not supported");
+#endif
+#ifdef EOWNERDEAD
+ inscode(d, ds, de, "EOWNERDEAD", EOWNERDEAD, "Process died with the lock");
+#endif
+#ifdef ENOTRECOVERABLE
+ inscode(d, ds, de, "ENOTRECOVERABLE", ENOTRECOVERABLE, "Lock is not recoverable");
+#endif
+#ifdef ELOCKUNMAPPED
+ inscode(d, ds, de, "ELOCKUNMAPPED", ELOCKUNMAPPED, "Locked lock was unmapped");
+#endif
+#ifdef ENOTACTIVE
+ inscode(d, ds, de, "ENOTACTIVE", ENOTACTIVE, "Facility is not active");
+#endif
Py_DECREF(de);
return m;
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 3717a27675..10a4ed7f6a 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -1295,17 +1295,16 @@ static PyMethodDef GcMethods[] = {
static struct PyModuleDef gcmodule = {
PyModuleDef_HEAD_INIT,
- "gc",
- gc__doc__,
- -1,
- GcMethods,
- NULL,
- NULL,
- NULL,
- NULL
+ "gc", /* m_name */
+ gc__doc__, /* m_doc */
+ -1, /* m_size */
+ GcMethods, /* m_methods */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
};
-
PyMODINIT_FUNC
PyInit_gc(void)
{
@@ -1364,6 +1363,38 @@ PyGC_Collect(void)
return n;
}
+void
+_PyGC_Fini(void)
+{
+ if (!(debug & DEBUG_SAVEALL)
+ && garbage != NULL && PyList_GET_SIZE(garbage) > 0) {
+ char *message;
+ if (debug & DEBUG_UNCOLLECTABLE)
+ message = "gc: %zd uncollectable objects at " \
+ "shutdown";
+ else
+ message = "gc: %zd uncollectable objects at " \
+ "shutdown; use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them";
+ if (PyErr_WarnFormat(PyExc_ResourceWarning, 0, message,
+ PyList_GET_SIZE(garbage)) < 0)
+ PyErr_WriteUnraisable(NULL);
+ if (debug & DEBUG_UNCOLLECTABLE) {
+ PyObject *repr = NULL, *bytes = NULL;
+ repr = PyObject_Repr(garbage);
+ if (!repr || !(bytes = PyUnicode_EncodeFSDefault(repr)))
+ PyErr_WriteUnraisable(garbage);
+ else {
+ PySys_WriteStderr(
+ " %s\n",
+ PyBytes_AS_STRING(bytes)
+ );
+ }
+ Py_XDECREF(repr);
+ Py_XDECREF(bytes);
+ }
+ }
+}
+
/* for debugging */
void
_PyGC_Dump(PyGC_Head *g)
@@ -1480,11 +1511,3 @@ PyObject_GC_Del(void *op)
}
PyObject_FREE(g);
}
-
-/* for binary compatibility with 2.2 */
-#undef _PyObject_GC_Del
-void
-_PyObject_GC_Del(PyObject *op)
-{
- PyObject_GC_Del(op);
-}
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 112d6d38e6..b7f9573f69 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -48,7 +48,7 @@
* argv0_path. For prefix, the landmark's path is derived from the VPATH
* preprocessor variable (taking into account that its value is almost, but
* not quite, what we need). For exec_prefix, the landmark is
- * Modules/Setup. If the landmark is found, we're done.
+ * pybuilddir.txt. If the landmark is found, we're done.
*
* For the remaining steps, the prefix landmark will always be
* lib/python$VERSION/os.py and the exec_prefix will always be
@@ -90,6 +90,9 @@
* known use of sys.prefix and sys.exec_prefix is for the ILU installation
* process to find the installed Python tree.
*
+ * An embedding application can use Py_SetPath() to override all of
+ * these authomatic path computations.
+ *
* NOTE: Windows MSVC builds use PC/getpathp.c instead!
*/
@@ -131,73 +134,8 @@ static wchar_t prefix[MAXPATHLEN+1];
static wchar_t exec_prefix[MAXPATHLEN+1];
static wchar_t progpath[MAXPATHLEN+1];
static wchar_t *module_search_path = NULL;
-static wchar_t lib_python[] = L"lib/python" VERSION;
-
-/* In principle, this should use HAVE__WSTAT, and _wstat
- should be detected by autoconf. However, no current
- POSIX system provides that function, so testing for
- it is pointless.
- Not sure whether the MS_WINDOWS guards are necessary:
- perhaps for cygwin/mingw builds?
-*/
-#ifndef MS_WINDOWS
-static int
-_wstat(const wchar_t* path, struct stat *buf)
-{
- char fname[PATH_MAX];
- size_t res = wcstombs(fname, path, sizeof(fname));
- if (res == (size_t)-1) {
- errno = EINVAL;
- return -1;
- }
- return stat(fname, buf);
-}
-#endif
-
-#ifndef MS_WINDOWS
-static wchar_t*
-_wgetcwd(wchar_t *buf, size_t size)
-{
- char fname[PATH_MAX];
- if (getcwd(fname, PATH_MAX) == NULL)
- return NULL;
- if (mbstowcs(buf, fname, size) >= size) {
- errno = ERANGE;
- return NULL;
- }
- return buf;
-}
-#endif
-
-#ifdef HAVE_READLINK
-int
-_Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
-{
- char cbuf[PATH_MAX];
- char cpath[PATH_MAX];
- int res;
- size_t r1 = wcstombs(cpath, path, PATH_MAX);
- if (r1 == (size_t)-1 || r1 >= PATH_MAX) {
- errno = EINVAL;
- return -1;
- }
- res = (int)readlink(cpath, cbuf, PATH_MAX);
- if (res == -1)
- return -1;
- if (res == PATH_MAX) {
- errno = EINVAL;
- return -1;
- }
- cbuf[res] = '\0'; /* buf will be null terminated */
- r1 = mbstowcs(buf, cbuf, bufsiz);
- if (r1 == -1) {
- errno = EINVAL;
- return -1;
- }
- return (int)r1;
-
-}
-#endif
+static int module_search_path_malloced = 0;
+static wchar_t *lib_python = L"lib/python" VERSION;
static void
reduce(wchar_t *dir)
@@ -208,12 +146,11 @@ reduce(wchar_t *dir)
dir[i] = '\0';
}
-
static int
isfile(wchar_t *filename) /* Is file, not directory */
{
struct stat buf;
- if (_wstat(filename, &buf) != 0)
+ if (_Py_wstat(filename, &buf) != 0)
return 0;
if (!S_ISREG(buf.st_mode))
return 0;
@@ -241,7 +178,7 @@ static int
isxfile(wchar_t *filename) /* Is executable file */
{
struct stat buf;
- if (_wstat(filename, &buf) != 0)
+ if (_Py_wstat(filename, &buf) != 0)
return 0;
if (!S_ISREG(buf.st_mode))
return 0;
@@ -255,7 +192,7 @@ static int
isdir(wchar_t *filename) /* Is directory */
{
struct stat buf;
- if (_wstat(filename, &buf) != 0)
+ if (_Py_wstat(filename, &buf) != 0)
return 0;
if (!S_ISDIR(buf.st_mode))
return 0;
@@ -295,12 +232,12 @@ joinpath(wchar_t *buffer, wchar_t *stuff)
/* copy_absolute requires that path be allocated at least
MAXPATHLEN + 1 bytes and that p be no more than MAXPATHLEN bytes. */
static void
-copy_absolute(wchar_t *path, wchar_t *p)
+copy_absolute(wchar_t *path, wchar_t *p, size_t pathlen)
{
if (p[0] == SEP)
wcscpy(path, p);
else {
- if (!_wgetcwd(path, MAXPATHLEN)) {
+ if (!_Py_wgetcwd(path, pathlen)) {
/* unable to get the current directory */
wcscpy(path, p);
return;
@@ -315,11 +252,11 @@ copy_absolute(wchar_t *path, wchar_t *p)
static void
absolutize(wchar_t *path)
{
- wchar_t buffer[MAXPATHLEN + 1];
+ wchar_t buffer[MAXPATHLEN+1];
if (path[0] == SEP)
return;
- copy_absolute(buffer, path);
+ copy_absolute(buffer, path, MAXPATHLEN+1);
wcscpy(path, buffer);
}
@@ -327,7 +264,7 @@ absolutize(wchar_t *path)
bytes long.
*/
static int
-search_for_prefix(wchar_t *argv0_path, wchar_t *home)
+search_for_prefix(wchar_t *argv0_path, wchar_t *home, wchar_t *_prefix)
{
size_t n;
wchar_t *vpath;
@@ -349,17 +286,20 @@ search_for_prefix(wchar_t *argv0_path, wchar_t *home)
joinpath(prefix, L"Modules/Setup");
if (isfile(prefix)) {
/* Check VPATH to see if argv0_path is in the build directory. */
- vpath = L"" VPATH;
- wcscpy(prefix, argv0_path);
- joinpath(prefix, vpath);
- joinpath(prefix, L"Lib");
- joinpath(prefix, LANDMARK);
- if (ismodule(prefix))
- return -1;
+ vpath = _Py_char2wchar(VPATH, NULL);
+ if (vpath != NULL) {
+ wcscpy(prefix, argv0_path);
+ joinpath(prefix, vpath);
+ PyMem_Free(vpath);
+ joinpath(prefix, L"Lib");
+ joinpath(prefix, LANDMARK);
+ if (ismodule(prefix))
+ return -1;
+ }
}
/* Search from argv0_path, until root is found */
- copy_absolute(prefix, argv0_path);
+ copy_absolute(prefix, argv0_path, MAXPATHLEN+1);
do {
n = wcslen(prefix);
joinpath(prefix, lib_python);
@@ -371,7 +311,7 @@ search_for_prefix(wchar_t *argv0_path, wchar_t *home)
} while (prefix[0]);
/* Look at configure's PREFIX */
- wcsncpy(prefix, L"" PREFIX, MAXPATHLEN);
+ wcsncpy(prefix, _prefix, MAXPATHLEN);
joinpath(prefix, lib_python);
joinpath(prefix, LANDMARK);
if (ismodule(prefix))
@@ -386,7 +326,7 @@ search_for_prefix(wchar_t *argv0_path, wchar_t *home)
MAXPATHLEN bytes long.
*/
static int
-search_for_exec_prefix(wchar_t *argv0_path, wchar_t *home)
+search_for_exec_prefix(wchar_t *argv0_path, wchar_t *home, wchar_t *_exec_prefix)
{
size_t n;
@@ -403,16 +343,40 @@ search_for_exec_prefix(wchar_t *argv0_path, wchar_t *home)
return 1;
}
- /* Check to see if argv[0] is in the build directory */
+ /* Check to see if argv[0] is in the build directory. "pybuilddir.txt"
+ is written by setup.py and contains the relative path to the location
+ of shared library modules. */
wcscpy(exec_prefix, argv0_path);
- joinpath(exec_prefix, L"Modules/Setup");
+ joinpath(exec_prefix, L"pybuilddir.txt");
if (isfile(exec_prefix)) {
- reduce(exec_prefix);
- return -1;
+ FILE *f = _Py_wfopen(exec_prefix, L"rb");
+ if (f == NULL)
+ errno = 0;
+ else {
+ char buf[MAXPATHLEN+1];
+ PyObject *decoded;
+ wchar_t rel_builddir_path[MAXPATHLEN+1];
+ n = fread(buf, 1, MAXPATHLEN, f);
+ buf[n] = '\0';
+ fclose(f);
+ decoded = PyUnicode_DecodeUTF8(buf, n, "surrogateescape");
+ if (decoded != NULL) {
+ Py_ssize_t k;
+ k = PyUnicode_AsWideChar(decoded,
+ rel_builddir_path, MAXPATHLEN);
+ Py_DECREF(decoded);
+ if (k >= 0) {
+ rel_builddir_path[k] = L'\0';
+ wcscpy(exec_prefix, argv0_path);
+ joinpath(exec_prefix, rel_builddir_path);
+ return -1;
+ }
+ }
+ }
}
/* Search from argv0_path, until root is found */
- copy_absolute(exec_prefix, argv0_path);
+ copy_absolute(exec_prefix, argv0_path, MAXPATHLEN+1);
do {
n = wcslen(exec_prefix);
joinpath(exec_prefix, lib_python);
@@ -424,7 +388,7 @@ search_for_exec_prefix(wchar_t *argv0_path, wchar_t *home)
} while (exec_prefix[0]);
/* Look at configure's EXEC_PREFIX */
- wcsncpy(exec_prefix, L"" EXEC_PREFIX, MAXPATHLEN);
+ wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
joinpath(exec_prefix, lib_python);
joinpath(exec_prefix, L"lib-dynload");
if (isdir(exec_prefix))
@@ -434,7 +398,6 @@ search_for_exec_prefix(wchar_t *argv0_path, wchar_t *home)
return 0;
}
-
static void
calculate_path(void)
{
@@ -442,12 +405,11 @@ calculate_path(void)
static wchar_t delimiter[2] = {DELIM, '\0'};
static wchar_t separator[2] = {SEP, '\0'};
- wchar_t *pythonpath = L"" PYTHONPATH;
char *_rtpypath = Py_GETENV("PYTHONPATH"); /* XXX use wide version on Windows */
wchar_t rtpypath[MAXPATHLEN+1];
wchar_t *home = Py_GetPythonHome();
char *_path = getenv("PATH");
- wchar_t wpath[MAXPATHLEN+1];
+ wchar_t *path_buffer = NULL;
wchar_t *path = NULL;
wchar_t *prog = Py_GetProgramName();
wchar_t argv0_path[MAXPATHLEN+1];
@@ -456,7 +418,7 @@ calculate_path(void)
wchar_t *buf;
size_t bufsz;
size_t prefixsz;
- wchar_t *defpath = pythonpath;
+ wchar_t *defpath;
#ifdef WITH_NEXT_FRAMEWORK
NSModule pythonModule;
#endif
@@ -466,16 +428,23 @@ calculate_path(void)
#else
unsigned long nsexeclength = MAXPATHLEN;
#endif
- char execpath[MAXPATHLEN+1];
+ char execpath[MAXPATHLEN+1];
#endif
+ wchar_t *_pythonpath, *_prefix, *_exec_prefix;
+
+ _pythonpath = _Py_char2wchar(PYTHONPATH, NULL);
+ _prefix = _Py_char2wchar(PREFIX, NULL);
+ _exec_prefix = _Py_char2wchar(EXEC_PREFIX, NULL);
+
+ if (!_pythonpath || !_prefix || !_exec_prefix) {
+ Py_FatalError(
+ "Unable to decode path variables in getpath.c: "
+ "memory error");
+ }
if (_path) {
- size_t r = mbstowcs(wpath, _path, MAXPATHLEN+1);
- path = wpath;
- if (r == (size_t)-1 || r > MAXPATHLEN) {
- /* Could not convert PATH, or it's too long. */
- path = NULL;
- }
+ path_buffer = _Py_char2wchar(_path, NULL);
+ path = path_buffer;
}
/* If there is no slash in the argv0 path, then we have to
@@ -531,6 +500,8 @@ calculate_path(void)
}
else
progpath[0] = '\0';
+ if (path_buffer != NULL)
+ PyMem_Free(path_buffer);
if (progpath[0] != SEP && progpath[0] != '\0')
absolutize(progpath);
wcsncpy(argv0_path, progpath, MAXPATHLEN);
@@ -594,11 +565,11 @@ calculate_path(void)
MAXPATHLEN bytes long.
*/
- if (!(pfound = search_for_prefix(argv0_path, home))) {
+ if (!(pfound = search_for_prefix(argv0_path, home, _prefix))) {
if (!Py_FrozenFlag)
fprintf(stderr,
"Could not find platform independent libraries <prefix>\n");
- wcsncpy(prefix, L"" PREFIX, MAXPATHLEN);
+ wcsncpy(prefix, _prefix, MAXPATHLEN);
joinpath(prefix, lib_python);
}
else
@@ -611,17 +582,17 @@ calculate_path(void)
reduce(zip_path);
}
else
- wcsncpy(zip_path, L"" PREFIX, MAXPATHLEN);
+ wcsncpy(zip_path, _prefix, MAXPATHLEN);
joinpath(zip_path, L"lib/python00.zip");
bufsz = wcslen(zip_path); /* Replace "00" with version */
zip_path[bufsz - 6] = VERSION[0];
zip_path[bufsz - 5] = VERSION[2];
- if (!(efound = search_for_exec_prefix(argv0_path, home))) {
+ if (!(efound = search_for_exec_prefix(argv0_path, home, _exec_prefix))) {
if (!Py_FrozenFlag)
fprintf(stderr,
"Could not find platform dependent libraries <exec_prefix>\n");
- wcsncpy(exec_prefix, L"" EXEC_PREFIX, MAXPATHLEN);
+ wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
joinpath(exec_prefix, L"lib/lib-dynload");
}
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
@@ -643,8 +614,8 @@ calculate_path(void)
bufsz += wcslen(rtpypath) + 1;
}
+ defpath = _pythonpath;
prefixsz = wcslen(prefix) + 1;
-
while (1) {
wchar_t *delim = wcschr(defpath, DELIM);
@@ -664,7 +635,6 @@ calculate_path(void)
bufsz += wcslen(zip_path) + 1;
bufsz += wcslen(exec_prefix) + 1;
- /* This is the only malloc call in this file */
buf = (wchar_t *)PyMem_Malloc(bufsz*sizeof(wchar_t));
if (buf == NULL) {
@@ -689,7 +659,7 @@ calculate_path(void)
/* Next goes merge of compile-time $PYTHONPATH with
* dynamically located prefix.
*/
- defpath = pythonpath;
+ defpath = _pythonpath;
while (1) {
wchar_t *delim = wcschr(defpath, DELIM);
@@ -717,6 +687,7 @@ calculate_path(void)
/* And publish the results */
module_search_path = buf;
+ module_search_path_malloced = 1;
}
/* Reduce prefix and exec_prefix to their essence,
@@ -733,7 +704,7 @@ calculate_path(void)
wcscpy(prefix, separator);
}
else
- wcsncpy(prefix, L"" PREFIX, MAXPATHLEN);
+ wcsncpy(prefix, _prefix, MAXPATHLEN);
if (efound > 0) {
reduce(exec_prefix);
@@ -743,11 +714,35 @@ calculate_path(void)
wcscpy(exec_prefix, separator);
}
else
- wcsncpy(exec_prefix, L"" EXEC_PREFIX, MAXPATHLEN);
+ wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
+
+ PyMem_Free(_pythonpath);
+ PyMem_Free(_prefix);
+ PyMem_Free(_exec_prefix);
}
/* External interface */
+void
+Py_SetPath(const wchar_t *path)
+{
+ if (module_search_path != NULL) {
+ if (module_search_path_malloced)
+ PyMem_Free(module_search_path);
+ module_search_path = NULL;
+ module_search_path_malloced = 0;
+ }
+ if (path != NULL) {
+ extern wchar_t *Py_GetProgramName(void);
+ wchar_t *prog = Py_GetProgramName();
+ wcsncpy(progpath, prog, MAXPATHLEN);
+ exec_prefix[0] = prefix[0] = L'\0';
+ module_search_path = PyMem_Malloc((wcslen(path) + 1) * sizeof(wchar_t));
+ module_search_path_malloced = 1;
+ if (module_search_path != NULL)
+ wcscpy(module_search_path, path);
+ }
+}
wchar_t *
Py_GetPath(void)
diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c
index 4ab5547fdd..7dfda280c7 100644
--- a/Modules/grpmodule.c
+++ b/Modules/grpmodule.c
@@ -2,7 +2,6 @@
/* UNIX group file access module */
#include "Python.h"
-#include "structseq.h"
#include <sys/types.h>
#include <grp.h>
@@ -46,11 +45,8 @@ mkgrent(struct group *p)
Py_DECREF(v);
return NULL;
}
-#define FSDECODE(val) PyUnicode_Decode(val, strlen(val),\
- Py_FileSystemDefaultEncoding,\
- "surrogateescape")
for (member = p->gr_mem; *member != NULL; member++) {
- PyObject *x = FSDECODE(*member);
+ PyObject *x = PyUnicode_DecodeFSDefault(*member);
if (x == NULL || PyList_Append(w, x) != 0) {
Py_XDECREF(x);
Py_DECREF(w);
@@ -61,13 +57,13 @@ mkgrent(struct group *p)
}
#define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)
- SET(setIndex++, FSDECODE(p->gr_name));
+ SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name));
#ifdef __VMS
SET(setIndex++, Py_None);
Py_INCREF(Py_None);
#else
if (p->gr_passwd)
- SET(setIndex++, FSDECODE(p->gr_passwd));
+ SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd));
else {
SET(setIndex++, Py_None);
Py_INCREF(Py_None);
@@ -114,8 +110,7 @@ grp_getgrnam(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "U:getgrnam", &arg))
return NULL;
- if ((bytes = PyUnicode_AsEncodedString(arg, Py_FileSystemDefaultEncoding,
- "surrogateescape")) == NULL)
+ if ((bytes = PyUnicode_EncodeFSDefault(arg)) == NULL)
return NULL;
if (PyBytes_AsStringAndSize(bytes, &name, NULL) == -1)
goto out;
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index e7a7fbe8fa..71d5bb646c 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -2584,6 +2584,138 @@ static PyTypeObject permutations_type = {
PyObject_GC_Del, /* tp_free */
};
+/* accumulate object ************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *total;
+ PyObject *it;
+} accumulateobject;
+
+static PyTypeObject accumulate_type;
+
+static PyObject *
+accumulate_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ static char *kwargs[] = {"iterable", NULL};
+ PyObject *iterable;
+ PyObject *it;
+ accumulateobject *lz;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:accumulate", kwargs, &iterable))
+ return NULL;
+
+ /* Get iterator. */
+ it = PyObject_GetIter(iterable);
+ if (it == NULL)
+ return NULL;
+
+ /* create accumulateobject structure */
+ lz = (accumulateobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+
+ lz->total = NULL;
+ lz->it = it;
+ return (PyObject *)lz;
+}
+
+static void
+accumulate_dealloc(accumulateobject *lz)
+{
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->total);
+ Py_XDECREF(lz->it);
+ Py_TYPE(lz)->tp_free(lz);
+}
+
+static int
+accumulate_traverse(accumulateobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(lz->it);
+ Py_VISIT(lz->total);
+ return 0;
+}
+
+static PyObject *
+accumulate_next(accumulateobject *lz)
+{
+ PyObject *val, *oldtotal, *newtotal;
+
+ val = PyIter_Next(lz->it);
+ if (val == NULL)
+ return NULL;
+
+ if (lz->total == NULL) {
+ Py_INCREF(val);
+ lz->total = val;
+ return lz->total;
+ }
+
+ newtotal = PyNumber_Add(lz->total, val);
+ Py_DECREF(val);
+ if (newtotal == NULL)
+ return NULL;
+
+ oldtotal = lz->total;
+ lz->total = newtotal;
+ Py_DECREF(oldtotal);
+
+ Py_INCREF(newtotal);
+ return newtotal;
+}
+
+PyDoc_STRVAR(accumulate_doc,
+"accumulate(iterable) --> accumulate object\n\
+\n\
+Return series of accumulated sums.");
+
+static PyTypeObject accumulate_type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "itertools.accumulate", /* tp_name */
+ sizeof(accumulateobject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ /* methods */
+ (destructor)accumulate_dealloc, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_BASETYPE, /* tp_flags */
+ accumulate_doc, /* tp_doc */
+ (traverseproc)accumulate_traverse, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ PyObject_SelfIter, /* tp_iter */
+ (iternextfunc)accumulate_next, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ accumulate_new, /* tp_new */
+ PyObject_GC_Del, /* tp_free */
+};
+
/* compress object ************************************************************/
@@ -3499,6 +3631,7 @@ cycle(p) --> p0, p1, ... plast, p0, p1, ...\n\
repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times\n\
\n\
Iterators terminating on the shortest input sequence:\n\
+accumulate(p, start=0) --> p0, p0+p1, p0+p1+p2\n\
chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ... \n\
compress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...\n\
dropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails\n\
@@ -3544,6 +3677,7 @@ PyInit_itertools(void)
PyObject *m;
char *name;
PyTypeObject *typelist[] = {
+ &accumulate_type,
&combinations_type,
&cwr_type,
&cycle_type,
diff --git a/Modules/ld_so_aix.in b/Modules/ld_so_aix.in
index 0fd245b062..86a9f7e15e 100644
--- a/Modules/ld_so_aix.in
+++ b/Modules/ld_so_aix.in
@@ -131,7 +131,7 @@ do
shift
done
-if test "$objfile" = "libpython@VERSION@.so"; then
+if test "$objfile" = "libpython@VERSION@@ABIFLAGS@.so"; then
ldsocoremode="true"
fi
diff --git a/Modules/main.c b/Modules/main.c
index eb9bb54517..fcd9330e41 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -2,7 +2,6 @@
#include "Python.h"
#include "osdefs.h"
-#include "import.h"
#include <locale.h>
@@ -47,7 +46,7 @@ static wchar_t **orig_argv;
static int orig_argc;
/* command line options */
-#define BASE_OPTS L"bBc:dEhiJm:OsStuvVW:xX?"
+#define BASE_OPTS L"bBc:dEhiJm:OqsStuvVW:xX:?"
#define PROGRAM_OPTS BASE_OPTS
@@ -72,6 +71,7 @@ static char *usage_2 = "\
-m mod : run library module as a script (terminates option list)\n\
-O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
-OO : remove doc-strings in addition to the -O optimizations\n\
+-q : don't print version and copyright messages on interactive startup\n\
-s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\
-S : don't imply 'import site' on initialization\n\
";
@@ -82,7 +82,9 @@ static char *usage_3 = "\
can be supplied multiple times to increase verbosity\n\
-V : print the Python version number and exit (also --version)\n\
-W arg : warning control; arg is action:message:category:module:lineno\n\
+ also PYTHONWARNINGS=arg\n\
-x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\
+-X opt : set implementation-specific option\n\
";
static char *usage_4 = "\
file : program read from script file\n\
@@ -93,34 +95,12 @@ PYTHONSTARTUP: file executed on interactive startup (no default)\n\
PYTHONPATH : '%c'-separated list of directories prefixed to the\n\
default module search path. The result is sys.path.\n\
";
-static char *usage_5 = "\
-PYTHONHOME : alternate <prefix> directory (or <prefix>%c<exec_prefix>).\n\
- The default module search path uses %s.\n\
-PYTHONCASEOK : ignore case in 'import' statements (Windows).\n\
-PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n\
-";
-
-#ifndef MS_WINDOWS
-static FILE*
-_wfopen(const wchar_t *path, const wchar_t *mode)
-{
- char cpath[PATH_MAX];
- char cmode[10];
- size_t r;
- r = wcstombs(cpath, path, PATH_MAX);
- if (r == (size_t)-1 || r >= PATH_MAX) {
- errno = EINVAL;
- return NULL;
- }
- r = wcstombs(cmode, mode, 10);
- if (r == (size_t)-1 || r >= 10) {
- errno = EINVAL;
- return NULL;
- }
- return fopen(cpath, cmode);
-}
-#endif
-
+static char *usage_5 =
+"PYTHONHOME : alternate <prefix> directory (or <prefix>%c<exec_prefix>).\n"
+" The default module search path uses %s.\n"
+"PYTHONCASEOK : ignore case in 'import' statements (Windows).\n"
+"PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n"
+;
static int
usage(int exitcode, wchar_t* program)
@@ -221,35 +201,102 @@ static int RunModule(wchar_t *modname, int set_argv0)
return 0;
}
-static int RunMainFromImporter(wchar_t *filename)
+static int
+RunMainFromImporter(wchar_t *filename)
{
- PyObject *argv0 = NULL, *importer = NULL;
+ PyObject *argv0 = NULL, *importer, *sys_path;
+ int sts;
- if ((argv0 = PyUnicode_FromWideChar(filename,wcslen(filename))) &&
- (importer = PyImport_GetImporter(argv0)) &&
- (importer->ob_type != &PyNullImporter_Type))
- {
- /* argv0 is usable as an import source, so
- put it in sys.path[0] and import __main__ */
- PyObject *sys_path = NULL;
- if ((sys_path = PySys_GetObject("path")) &&
- !PyList_SetItem(sys_path, 0, argv0))
- {
- Py_INCREF(argv0);
- Py_DECREF(importer);
- sys_path = NULL;
- return RunModule(L"__main__", 0) != 0;
- }
+ argv0 = PyUnicode_FromWideChar(filename, wcslen(filename));
+ if (argv0 == NULL)
+ goto error;
+
+ importer = PyImport_GetImporter(argv0);
+ if (importer == NULL)
+ goto error;
+
+ if (importer->ob_type == &PyNullImporter_Type) {
+ Py_DECREF(argv0);
+ Py_DECREF(importer);
+ return -1;
}
+ Py_DECREF(importer);
+
+ /* argv0 is usable as an import source, so put it in sys.path[0]
+ and import __main__ */
+ sys_path = PySys_GetObject("path");
+ if (sys_path == NULL)
+ goto error;
+ if (PyList_SetItem(sys_path, 0, argv0)) {
+ argv0 = NULL;
+ goto error;
+ }
+ Py_INCREF(argv0);
+
+ sts = RunModule(L"__main__", 0);
+ return sts != 0;
+
+error:
Py_XDECREF(argv0);
- Py_XDECREF(importer);
- if (PyErr_Occurred()) {
+ PyErr_Print();
+ return 1;
+}
+
+static int
+run_command(wchar_t *command, PyCompilerFlags *cf)
+{
+ PyObject *unicode, *bytes;
+ int ret;
+
+ unicode = PyUnicode_FromWideChar(command, -1);
+ if (unicode == NULL)
+ goto error;
+ bytes = PyUnicode_AsUTF8String(unicode);
+ Py_DECREF(unicode);
+ if (bytes == NULL)
+ goto error;
+ ret = PyRun_SimpleStringFlags(PyBytes_AsString(bytes), cf);
+ Py_DECREF(bytes);
+ return ret != 0;
+
+error:
+ PySys_WriteStderr("Unable to decode the command from the command line:\n");
+ PyErr_Print();
+ return 1;
+}
+
+static int
+run_file(FILE *fp, const wchar_t *filename, PyCompilerFlags *p_cf)
+{
+ PyObject *unicode, *bytes = NULL;
+ char *filename_str;
+ int run;
+
+ /* call pending calls like signal handlers (SIGINT) */
+ if (Py_MakePendingCalls() == -1) {
PyErr_Print();
return 1;
}
- else {
- return -1;
+
+ if (filename) {
+ unicode = PyUnicode_FromWideChar(filename, wcslen(filename));
+ if (unicode != NULL) {
+ bytes = PyUnicode_EncodeFSDefault(unicode);
+ Py_DECREF(unicode);
+ }
+ if (bytes != NULL)
+ filename_str = PyBytes_AsString(bytes);
+ else {
+ PyErr_Clear();
+ filename_str = "<encoding error>";
+ }
}
+ else
+ filename_str = "<stdin>";
+
+ run = PyRun_AnyFileExFlags(fp, filename_str, filename != NULL, p_cf);
+ Py_XDECREF(bytes);
+ return run != 0;
}
@@ -265,6 +312,9 @@ Py_Main(int argc, wchar_t **argv)
wchar_t *module = NULL;
FILE *fp = stdin;
char *p;
+#ifdef MS_WINDOWS
+ wchar_t *wp;
+#endif
int skipfirstline = 0;
int stdin_is_interactive = 0;
int help = 0;
@@ -358,8 +408,6 @@ Py_Main(int argc, wchar_t **argv)
skipfirstline = 1;
break;
- /* case 'X': reserved for implementation-specific arguments */
-
case 'h':
case '?':
help++;
@@ -373,6 +421,14 @@ Py_Main(int argc, wchar_t **argv)
PySys_AddWarnOption(_PyOS_optarg);
break;
+ case 'X':
+ PySys_AddXOption(_PyOS_optarg);
+ break;
+
+ case 'q':
+ Py_QuietFlag++;
+ break;
+
/* This space reserved for other options */
default:
@@ -401,6 +457,61 @@ Py_Main(int argc, wchar_t **argv)
(p = Py_GETENV("PYTHONNOUSERSITE")) && *p != '\0')
Py_NoUserSiteDirectory = 1;
+#ifdef MS_WINDOWS
+ if (!Py_IgnoreEnvironmentFlag && (wp = _wgetenv(L"PYTHONWARNINGS")) &&
+ *wp != L'\0') {
+ wchar_t *buf, *warning;
+
+ buf = (wchar_t *)malloc((wcslen(wp) + 1) * sizeof(wchar_t));
+ if (buf == NULL)
+ Py_FatalError(
+ "not enough memory to copy PYTHONWARNINGS");
+ wcscpy(buf, wp);
+ for (warning = wcstok(buf, L",");
+ warning != NULL;
+ warning = wcstok(NULL, L",")) {
+ PySys_AddWarnOption(warning);
+ }
+ free(buf);
+ }
+#else
+ if ((p = Py_GETENV("PYTHONWARNINGS")) && *p != '\0') {
+ char *buf, *oldloc;
+ PyObject *unicode;
+
+ /* settle for strtok here as there's no one standard
+ C89 wcstok */
+ buf = (char *)malloc(strlen(p) + 1);
+ if (buf == NULL)
+ Py_FatalError(
+ "not enough memory to copy PYTHONWARNINGS");
+ strcpy(buf, p);
+ oldloc = strdup(setlocale(LC_ALL, NULL));
+ setlocale(LC_ALL, "");
+ for (p = strtok(buf, ","); p != NULL; p = strtok(NULL, ",")) {
+#ifdef __APPLE__
+ /* Use utf-8 on Mac OS X */
+ unicode = PyUnicode_FromString(p);
+#else
+ wchar_t *wchar;
+ size_t len;
+ wchar = _Py_char2wchar(p, &len);
+ if (wchar == NULL)
+ continue;
+ unicode = PyUnicode_FromWideChar(wchar, len);
+ PyMem_Free(wchar);
+#endif
+ if (unicode == NULL)
+ continue;
+ PySys_AddWarnOptionUnicode(unicode);
+ Py_DECREF(unicode);
+ }
+ setlocale(LC_ALL, oldloc);
+ free(oldloc);
+ free(buf);
+ }
+#endif
+
if (command == NULL && module == NULL && _PyOS_optind < argc &&
wcscmp(argv[_PyOS_optind], L"-") != 0)
{
@@ -416,11 +527,14 @@ Py_Main(int argc, wchar_t **argv)
stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0);
- if (Py_UnbufferedStdioFlag) {
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
- _setmode(fileno(stdin), O_BINARY);
- _setmode(fileno(stdout), O_BINARY);
+ /* don't translate newlines (\r\n <=> \n) */
+ _setmode(fileno(stdin), O_BINARY);
+ _setmode(fileno(stdout), O_BINARY);
+ _setmode(fileno(stderr), O_BINARY);
#endif
+
+ if (Py_UnbufferedStdioFlag) {
#ifdef HAVE_SETVBUF
setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ);
setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ);
@@ -482,8 +596,9 @@ Py_Main(int argc, wchar_t **argv)
#endif
Py_Initialize();
- if (Py_VerboseFlag ||
- (command == NULL && filename == NULL && module == NULL && stdin_is_interactive)) {
+ if (!Py_QuietFlag && (Py_VerboseFlag ||
+ (command == NULL && filename == NULL &&
+ module == NULL && stdin_is_interactive))) {
fprintf(stderr, "Python %s on %s\n",
Py_GetVersion(), Py_GetPlatform());
if (!Py_NoSiteFlag)
@@ -497,10 +612,9 @@ Py_Main(int argc, wchar_t **argv)
}
if (module != NULL) {
- /* Backup _PyOS_optind and force sys.argv[0] = '-c'
- so that PySys_SetArgv correctly sets sys.path[0] to ''*/
+ /* Backup _PyOS_optind and force sys.argv[0] = '-m'*/
_PyOS_optind--;
- argv[_PyOS_optind] = L"-c";
+ argv[_PyOS_optind] = L"-m";
}
PySys_SetArgv(argc-_PyOS_optind, argv+_PyOS_optind);
@@ -516,22 +630,8 @@ Py_Main(int argc, wchar_t **argv)
}
if (command) {
- char *commandStr;
- PyObject *commandObj = PyUnicode_FromWideChar(
- command, wcslen(command));
+ sts = run_command(command, &cf);
free(command);
- if (commandObj != NULL)
- commandStr = _PyUnicode_AsString(commandObj);
- else
- commandStr = NULL;
- if (commandStr != NULL) {
- sts = PyRun_SimpleStringFlags(commandStr, &cf) != 0;
- Py_DECREF(commandObj);
- }
- else {
- PyErr_Print();
- sts = 1;
- }
} else if (module) {
sts = RunModule(module, 1);
}
@@ -550,19 +650,19 @@ Py_Main(int argc, wchar_t **argv)
}
if (sts==-1 && filename!=NULL) {
- if ((fp = _wfopen(filename, L"r")) == NULL) {
- char cfilename[PATH_MAX];
- size_t r = wcstombs(cfilename, filename, PATH_MAX);
- if (r == PATH_MAX)
- /* cfilename is not null-terminated;
- * forcefully null-terminating it
- * might break the shift state */
- strcpy(cfilename, "<file name too long>");
- if (r == ((size_t)-1))
- strcpy(cfilename, "<unprintable file name>");
+ fp = _Py_wfopen(filename, L"r");
+ if (fp == NULL) {
+ char *cfilename_buffer;
+ const char *cfilename;
+ cfilename_buffer = _Py_wchar2char(filename, NULL);
+ if (cfilename_buffer != NULL)
+ cfilename = cfilename_buffer;
+ else
+ cfilename = "<unprintable file name>";
fprintf(stderr, "%ls: can't open file '%s': [Errno %d] %s\n",
argv[0], cfilename, errno, strerror(errno));
-
+ if (cfilename_buffer)
+ PyMem_Free(cfilename_buffer);
return 2;
}
else if (skipfirstline) {
@@ -588,30 +688,8 @@ Py_Main(int argc, wchar_t **argv)
}
}
- if (sts==-1) {
- PyObject *filenameObj = NULL;
- char *p_cfilename = "<stdin>";
- if (filename) {
- filenameObj = PyUnicode_FromWideChar(
- filename, wcslen(filename));
- if (filenameObj != NULL)
- p_cfilename = _PyUnicode_AsString(filenameObj);
- else
- p_cfilename = "<decoding error>";
- }
- /* call pending calls like signal handlers (SIGINT) */
- if (Py_MakePendingCalls() == -1) {
- PyErr_Print();
- sts = 1;
- } else {
- sts = PyRun_AnyFileExFlags(
- fp,
- p_cfilename,
- filename != NULL, &cf) != 0;
- }
- Py_XDECREF(filenameObj);
- }
-
+ if (sts == -1)
+ sts = run_file(fp, filename, &cf);
}
/* Check this environment variable at the end, to give programs the
diff --git a/Modules/makesetup b/Modules/makesetup
index 23f778d07b..40dfa9db48 100755
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -219,7 +219,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
case $doconfig in
no) cc="$cc \$(CCSHARED) \$(CFLAGS) \$(CPPFLAGS)";;
*)
- cc="$cc \$(PY_CFLAGS)";;
+ cc="$cc \$(PY_CORE_CFLAGS)";;
esac
rule="$obj: $src; $cc $cpps -c $src -o $obj"
echo "$rule" >>$rulesf
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 05bad5de6e..29c32a30d8 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -53,54 +53,471 @@ raised for division by zero and mod by zero.
*/
#include "Python.h"
-#include "longintrepr.h" /* just for SHIFT */
+#include "_math.h"
#ifdef _OSF_SOURCE
/* OSF1 5.1 doesn't make this available with XOPEN_SOURCE_EXTENDED defined */
extern double copysign(double, double);
#endif
-/* Call is_error when errno != 0, and where x is the result libm
- * returned. is_error will usually set up an exception and return
- * true (1), but may return false (0) without setting up an exception.
- */
-static int
-is_error(double x)
+/*
+ sin(pi*x), giving accurate results for all finite x (especially x
+ integral or close to an integer). This is here for use in the
+ reflection formula for the gamma function. It conforms to IEEE
+ 754-2008 for finite arguments, but not for infinities or nans.
+*/
+
+static const double pi = 3.141592653589793238462643383279502884197;
+static const double sqrtpi = 1.772453850905516027298167483341145182798;
+static const double logpi = 1.144729885849400174143427351353058711647;
+
+static double
+sinpi(double x)
{
- int result = 1; /* presumption of guilt */
- assert(errno); /* non-zero errno is a precondition for calling */
- if (errno == EDOM)
- PyErr_SetString(PyExc_ValueError, "math domain error");
+ double y, r;
+ int n;
+ /* this function should only ever be called for finite arguments */
+ assert(Py_IS_FINITE(x));
+ y = fmod(fabs(x), 2.0);
+ n = (int)round(2.0*y);
+ assert(0 <= n && n <= 4);
+ switch (n) {
+ case 0:
+ r = sin(pi*y);
+ break;
+ case 1:
+ r = cos(pi*(y-0.5));
+ break;
+ case 2:
+ /* N.B. -sin(pi*(y-1.0)) is *not* equivalent: it would give
+ -0.0 instead of 0.0 when y == 1.0. */
+ r = sin(pi*(1.0-y));
+ break;
+ case 3:
+ r = -cos(pi*(y-1.5));
+ break;
+ case 4:
+ r = sin(pi*(y-2.0));
+ break;
+ default:
+ assert(0); /* should never get here */
+ r = -1.23e200; /* silence gcc warning */
+ }
+ return copysign(1.0, x)*r;
+}
- else if (errno == ERANGE) {
- /* ANSI C generally requires libm functions to set ERANGE
- * on overflow, but also generally *allows* them to set
- * ERANGE on underflow too. There's no consistency about
- * the latter across platforms.
- * Alas, C99 never requires that errno be set.
- * Here we suppress the underflow errors (libm functions
- * should return a zero on underflow, and +- HUGE_VAL on
- * overflow, so testing the result for zero suffices to
- * distinguish the cases).
- *
- * On some platforms (Ubuntu/ia64) it seems that errno can be
- * set to ERANGE for subnormal results that do *not* underflow
- * to zero. So to be safe, we'll ignore ERANGE whenever the
- * function result is less than one in absolute value.
- */
- if (fabs(x) < 1.0)
- result = 0;
+/* Implementation of the real gamma function. In extensive but non-exhaustive
+ random tests, this function proved accurate to within <= 10 ulps across the
+ entire float domain. Note that accuracy may depend on the quality of the
+ system math functions, the pow function in particular. Special cases
+ follow C99 annex F. The parameters and method are tailored to platforms
+ whose double format is the IEEE 754 binary64 format.
+
+ Method: for x > 0.0 we use the Lanczos approximation with parameters N=13
+ and g=6.024680040776729583740234375; these parameters are amongst those
+ used by the Boost library. Following Boost (again), we re-express the
+ Lanczos sum as a rational function, and compute it that way. The
+ coefficients below were computed independently using MPFR, and have been
+ double-checked against the coefficients in the Boost source code.
+
+ For x < 0.0 we use the reflection formula.
+
+ There's one minor tweak that deserves explanation: Lanczos' formula for
+ Gamma(x) involves computing pow(x+g-0.5, x-0.5) / exp(x+g-0.5). For many x
+ values, x+g-0.5 can be represented exactly. However, in cases where it
+ can't be represented exactly the small error in x+g-0.5 can be magnified
+ significantly by the pow and exp calls, especially for large x. A cheap
+ correction is to multiply by (1 + e*g/(x+g-0.5)), where e is the error
+ involved in the computation of x+g-0.5 (that is, e = computed value of
+ x+g-0.5 - exact value of x+g-0.5). Here's the proof:
+
+ Correction factor
+ -----------------
+ Write x+g-0.5 = y-e, where y is exactly representable as an IEEE 754
+ double, and e is tiny. Then:
+
+ pow(x+g-0.5,x-0.5)/exp(x+g-0.5) = pow(y-e, x-0.5)/exp(y-e)
+ = pow(y, x-0.5)/exp(y) * C,
+
+ where the correction_factor C is given by
+
+ C = pow(1-e/y, x-0.5) * exp(e)
+
+ Since e is tiny, pow(1-e/y, x-0.5) ~ 1-(x-0.5)*e/y, and exp(x) ~ 1+e, so:
+
+ C ~ (1-(x-0.5)*e/y) * (1+e) ~ 1 + e*(y-(x-0.5))/y
+
+ But y-(x-0.5) = g+e, and g+e ~ g. So we get C ~ 1 + e*g/y, and
+
+ pow(x+g-0.5,x-0.5)/exp(x+g-0.5) ~ pow(y, x-0.5)/exp(y) * (1 + e*g/y),
+
+ Note that for accuracy, when computing r*C it's better to do
+
+ r + e*g/y*r;
+
+ than
+
+ r * (1 + e*g/y);
+
+ since the addition in the latter throws away most of the bits of
+ information in e*g/y.
+*/
+
+#define LANCZOS_N 13
+static const double lanczos_g = 6.024680040776729583740234375;
+static const double lanczos_g_minus_half = 5.524680040776729583740234375;
+static const double lanczos_num_coeffs[LANCZOS_N] = {
+ 23531376880.410759688572007674451636754734846804940,
+ 42919803642.649098768957899047001988850926355848959,
+ 35711959237.355668049440185451547166705960488635843,
+ 17921034426.037209699919755754458931112671403265390,
+ 6039542586.3520280050642916443072979210699388420708,
+ 1439720407.3117216736632230727949123939715485786772,
+ 248874557.86205415651146038641322942321632125127801,
+ 31426415.585400194380614231628318205362874684987640,
+ 2876370.6289353724412254090516208496135991145378768,
+ 186056.26539522349504029498971604569928220784236328,
+ 8071.6720023658162106380029022722506138218516325024,
+ 210.82427775157934587250973392071336271166969580291,
+ 2.5066282746310002701649081771338373386264310793408
+};
+
+/* denominator is x*(x+1)*...*(x+LANCZOS_N-2) */
+static const double lanczos_den_coeffs[LANCZOS_N] = {
+ 0.0, 39916800.0, 120543840.0, 150917976.0, 105258076.0, 45995730.0,
+ 13339535.0, 2637558.0, 357423.0, 32670.0, 1925.0, 66.0, 1.0};
+
+/* gamma values for small positive integers, 1 though NGAMMA_INTEGRAL */
+#define NGAMMA_INTEGRAL 23
+static const double gamma_integral[NGAMMA_INTEGRAL] = {
+ 1.0, 1.0, 2.0, 6.0, 24.0, 120.0, 720.0, 5040.0, 40320.0, 362880.0,
+ 3628800.0, 39916800.0, 479001600.0, 6227020800.0, 87178291200.0,
+ 1307674368000.0, 20922789888000.0, 355687428096000.0,
+ 6402373705728000.0, 121645100408832000.0, 2432902008176640000.0,
+ 51090942171709440000.0, 1124000727777607680000.0,
+};
+
+/* Lanczos' sum L_g(x), for positive x */
+
+static double
+lanczos_sum(double x)
+{
+ double num = 0.0, den = 0.0;
+ int i;
+ assert(x > 0.0);
+ /* evaluate the rational function lanczos_sum(x). For large
+ x, the obvious algorithm risks overflow, so we instead
+ rescale the denominator and numerator of the rational
+ function by x**(1-LANCZOS_N) and treat this as a
+ rational function in 1/x. This also reduces the error for
+ larger x values. The choice of cutoff point (5.0 below) is
+ somewhat arbitrary; in tests, smaller cutoff values than
+ this resulted in lower accuracy. */
+ if (x < 5.0) {
+ for (i = LANCZOS_N; --i >= 0; ) {
+ num = num * x + lanczos_num_coeffs[i];
+ den = den * x + lanczos_den_coeffs[i];
+ }
+ }
+ else {
+ for (i = 0; i < LANCZOS_N; i++) {
+ num = num / x + lanczos_num_coeffs[i];
+ den = den / x + lanczos_den_coeffs[i];
+ }
+ }
+ return num/den;
+}
+
+static double
+m_tgamma(double x)
+{
+ double absx, r, y, z, sqrtpow;
+
+ /* special cases */
+ if (!Py_IS_FINITE(x)) {
+ if (Py_IS_NAN(x) || x > 0.0)
+ return x; /* tgamma(nan) = nan, tgamma(inf) = inf */
+ else {
+ errno = EDOM;
+ return Py_NAN; /* tgamma(-inf) = nan, invalid */
+ }
+ }
+ if (x == 0.0) {
+ errno = EDOM;
+ return 1.0/x; /* tgamma(+-0.0) = +-inf, divide-by-zero */
+ }
+
+ /* integer arguments */
+ if (x == floor(x)) {
+ if (x < 0.0) {
+ errno = EDOM; /* tgamma(n) = nan, invalid for */
+ return Py_NAN; /* negative integers n */
+ }
+ if (x <= NGAMMA_INTEGRAL)
+ return gamma_integral[(int)x - 1];
+ }
+ absx = fabs(x);
+
+ /* tiny arguments: tgamma(x) ~ 1/x for x near 0 */
+ if (absx < 1e-20) {
+ r = 1.0/x;
+ if (Py_IS_INFINITY(r))
+ errno = ERANGE;
+ return r;
+ }
+
+ /* large arguments: assuming IEEE 754 doubles, tgamma(x) overflows for
+ x > 200, and underflows to +-0.0 for x < -200, not a negative
+ integer. */
+ if (absx > 200.0) {
+ if (x < 0.0) {
+ return 0.0/sinpi(x);
+ }
+ else {
+ errno = ERANGE;
+ return Py_HUGE_VAL;
+ }
+ }
+
+ y = absx + lanczos_g_minus_half;
+ /* compute error in sum */
+ if (absx > lanczos_g_minus_half) {
+ /* note: the correction can be foiled by an optimizing
+ compiler that (incorrectly) thinks that an expression like
+ a + b - a - b can be optimized to 0.0. This shouldn't
+ happen in a standards-conforming compiler. */
+ double q = y - absx;
+ z = q - lanczos_g_minus_half;
+ }
+ else {
+ double q = y - lanczos_g_minus_half;
+ z = q - absx;
+ }
+ z = z * lanczos_g / y;
+ if (x < 0.0) {
+ r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
+ r -= z * r;
+ if (absx < 140.0) {
+ r /= pow(y, absx - 0.5);
+ }
+ else {
+ sqrtpow = pow(y, absx / 2.0 - 0.25);
+ r /= sqrtpow;
+ r /= sqrtpow;
+ }
+ }
+ else {
+ r = lanczos_sum(absx) / exp(y);
+ r += z * r;
+ if (absx < 140.0) {
+ r *= pow(y, absx - 0.5);
+ }
+ else {
+ sqrtpow = pow(y, absx / 2.0 - 0.25);
+ r *= sqrtpow;
+ r *= sqrtpow;
+ }
+ }
+ if (Py_IS_INFINITY(r))
+ errno = ERANGE;
+ return r;
+}
+
+/*
+ lgamma: natural log of the absolute value of the Gamma function.
+ For large arguments, Lanczos' formula works extremely well here.
+*/
+
+static double
+m_lgamma(double x)
+{
+ double r, absx;
+
+ /* special cases */
+ if (!Py_IS_FINITE(x)) {
+ if (Py_IS_NAN(x))
+ return x; /* lgamma(nan) = nan */
else
- PyErr_SetString(PyExc_OverflowError,
- "math range error");
+ return Py_HUGE_VAL; /* lgamma(+-inf) = +inf */
}
- else
- /* Unexpected math error */
- PyErr_SetFromErrno(PyExc_ValueError);
+
+ /* integer arguments */
+ if (x == floor(x) && x <= 2.0) {
+ if (x <= 0.0) {
+ errno = EDOM; /* lgamma(n) = inf, divide-by-zero for */
+ return Py_HUGE_VAL; /* integers n <= 0 */
+ }
+ else {
+ return 0.0; /* lgamma(1) = lgamma(2) = 0.0 */
+ }
+ }
+
+ absx = fabs(x);
+ /* tiny arguments: lgamma(x) ~ -log(fabs(x)) for small x */
+ if (absx < 1e-20)
+ return -log(absx);
+
+ /* Lanczos' formula. We could save a fraction of a ulp in accuracy by
+ having a second set of numerator coefficients for lanczos_sum that
+ absorbed the exp(-lanczos_g) term, and throwing out the lanczos_g
+ subtraction below; it's probably not worth it. */
+ r = log(lanczos_sum(absx)) - lanczos_g;
+ r += (absx - 0.5) * (log(absx + lanczos_g - 0.5) - 1);
+ if (x < 0.0)
+ /* Use reflection formula to get value for negative x. */
+ r = logpi - log(fabs(sinpi(absx))) - log(absx) - r;
+ if (Py_IS_INFINITY(r))
+ errno = ERANGE;
+ return r;
+}
+
+/*
+ Implementations of the error function erf(x) and the complementary error
+ function erfc(x).
+
+ Method: following 'Numerical Recipes' by Flannery, Press et. al. (2nd ed.,
+ Cambridge University Press), we use a series approximation for erf for
+ small x, and a continued fraction approximation for erfc(x) for larger x;
+ combined with the relations erf(-x) = -erf(x) and erfc(x) = 1.0 - erf(x),
+ this gives us erf(x) and erfc(x) for all x.
+
+ The series expansion used is:
+
+ erf(x) = x*exp(-x*x)/sqrt(pi) * [
+ 2/1 + 4/3 x**2 + 8/15 x**4 + 16/105 x**6 + ...]
+
+ The coefficient of x**(2k-2) here is 4**k*factorial(k)/factorial(2*k).
+ This series converges well for smallish x, but slowly for larger x.
+
+ The continued fraction expansion used is:
+
+ erfc(x) = x*exp(-x*x)/sqrt(pi) * [1/(0.5 + x**2 -) 0.5/(2.5 + x**2 - )
+ 3.0/(4.5 + x**2 - ) 7.5/(6.5 + x**2 - ) ...]
+
+ after the first term, the general term has the form:
+
+ k*(k-0.5)/(2*k+0.5 + x**2 - ...).
+
+ This expansion converges fast for larger x, but convergence becomes
+ infinitely slow as x approaches 0.0. The (somewhat naive) continued
+ fraction evaluation algorithm used below also risks overflow for large x;
+ but for large x, erfc(x) == 0.0 to within machine precision. (For
+ example, erfc(30.0) is approximately 2.56e-393).
+
+ Parameters: use series expansion for abs(x) < ERF_SERIES_CUTOFF and
+ continued fraction expansion for ERF_SERIES_CUTOFF <= abs(x) <
+ ERFC_CONTFRAC_CUTOFF. ERFC_SERIES_TERMS and ERFC_CONTFRAC_TERMS are the
+ numbers of terms to use for the relevant expansions. */
+
+#define ERF_SERIES_CUTOFF 1.5
+#define ERF_SERIES_TERMS 25
+#define ERFC_CONTFRAC_CUTOFF 30.0
+#define ERFC_CONTFRAC_TERMS 50
+
+/*
+ Error function, via power series.
+
+ Given a finite float x, return an approximation to erf(x).
+ Converges reasonably fast for small x.
+*/
+
+static double
+m_erf_series(double x)
+{
+ double x2, acc, fk, result;
+ int i, saved_errno;
+
+ x2 = x * x;
+ acc = 0.0;
+ fk = (double)ERF_SERIES_TERMS + 0.5;
+ for (i = 0; i < ERF_SERIES_TERMS; i++) {
+ acc = 2.0 + x2 * acc / fk;
+ fk -= 1.0;
+ }
+ /* Make sure the exp call doesn't affect errno;
+ see m_erfc_contfrac for more. */
+ saved_errno = errno;
+ result = acc * x * exp(-x2) / sqrtpi;
+ errno = saved_errno;
return result;
}
/*
+ Complementary error function, via continued fraction expansion.
+
+ Given a positive float x, return an approximation to erfc(x). Converges
+ reasonably fast for x large (say, x > 2.0), and should be safe from
+ overflow if x and nterms are not too large. On an IEEE 754 machine, with x
+ <= 30.0, we're safe up to nterms = 100. For x >= 30.0, erfc(x) is smaller
+ than the smallest representable nonzero float. */
+
+static double
+m_erfc_contfrac(double x)
+{
+ double x2, a, da, p, p_last, q, q_last, b, result;
+ int i, saved_errno;
+
+ if (x >= ERFC_CONTFRAC_CUTOFF)
+ return 0.0;
+
+ x2 = x*x;
+ a = 0.0;
+ da = 0.5;
+ p = 1.0; p_last = 0.0;
+ q = da + x2; q_last = 1.0;
+ for (i = 0; i < ERFC_CONTFRAC_TERMS; i++) {
+ double temp;
+ a += da;
+ da += 2.0;
+ b = da + x2;
+ temp = p; p = b*p - a*p_last; p_last = temp;
+ temp = q; q = b*q - a*q_last; q_last = temp;
+ }
+ /* Issue #8986: On some platforms, exp sets errno on underflow to zero;
+ save the current errno value so that we can restore it later. */
+ saved_errno = errno;
+ result = p / q * x * exp(-x2) / sqrtpi;
+ errno = saved_errno;
+ return result;
+}
+
+/* Error function erf(x), for general x */
+
+static double
+m_erf(double x)
+{
+ double absx, cf;
+
+ if (Py_IS_NAN(x))
+ return x;
+ absx = fabs(x);
+ if (absx < ERF_SERIES_CUTOFF)
+ return m_erf_series(x);
+ else {
+ cf = m_erfc_contfrac(absx);
+ return x > 0.0 ? 1.0 - cf : cf - 1.0;
+ }
+}
+
+/* Complementary error function erfc(x), for general x. */
+
+static double
+m_erfc(double x)
+{
+ double absx, cf;
+
+ if (Py_IS_NAN(x))
+ return x;
+ absx = fabs(x);
+ if (absx < ERF_SERIES_CUTOFF)
+ return 1.0 - m_erf_series(x);
+ else {
+ cf = m_erfc_contfrac(absx);
+ return x > 0.0 ? cf : 2.0 - cf;
+ }
+}
+
+/*
wrapper for atan2 that deals directly with special cases before
delegating to the platform libm for the remaining cases. This
is necessary to get consistent behaviour across platforms.
@@ -188,6 +605,46 @@ m_log10(double x)
}
+/* Call is_error when errno != 0, and where x is the result libm
+ * returned. is_error will usually set up an exception and return
+ * true (1), but may return false (0) without setting up an exception.
+ */
+static int
+is_error(double x)
+{
+ int result = 1; /* presumption of guilt */
+ assert(errno); /* non-zero errno is a precondition for calling */
+ if (errno == EDOM)
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+
+ else if (errno == ERANGE) {
+ /* ANSI C generally requires libm functions to set ERANGE
+ * on overflow, but also generally *allows* them to set
+ * ERANGE on underflow too. There's no consistency about
+ * the latter across platforms.
+ * Alas, C99 never requires that errno be set.
+ * Here we suppress the underflow errors (libm functions
+ * should return a zero on underflow, and +- HUGE_VAL on
+ * overflow, so testing the result for zero suffices to
+ * distinguish the cases).
+ *
+ * On some platforms (Ubuntu/ia64) it seems that errno can be
+ * set to ERANGE for subnormal results that do *not* underflow
+ * to zero. So to be safe, we'll ignore ERANGE whenever the
+ * function result is less than one in absolute value.
+ */
+ if (fabs(x) < 1.0)
+ result = 0;
+ else
+ PyErr_SetString(PyExc_OverflowError,
+ "math range error");
+ }
+ else
+ /* Unexpected math error */
+ PyErr_SetFromErrno(PyExc_ValueError);
+ return result;
+}
+
/*
math_1 is used to wrap a libm function f that takes a double
arguments and returns a double.
@@ -252,6 +709,26 @@ math_1_to_whatever(PyObject *arg, double (*func) (double),
return (*from_double_func)(r);
}
+/* variant of math_1, to be used when the function being wrapped is known to
+ set errno properly (that is, errno = EDOM for invalid or divide-by-zero,
+ errno = ERANGE for overflow). */
+
+static PyObject *
+math_1a(PyObject *arg, double (*func) (double))
+{
+ double x, r;
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+ errno = 0;
+ PyFPE_START_PROTECT("in math_1a", return 0);
+ r = (*func)(x);
+ PyFPE_END_PROTECT(r);
+ if (errno && is_error(r))
+ return NULL;
+ return PyFloat_FromDouble(r);
+}
+
/*
math_2 is used to wrap a libm function f that takes two double
arguments and returns a double.
@@ -330,6 +807,12 @@ math_2(PyObject *args, double (*func) (double, double), char *funcname)
}\
PyDoc_STRVAR(math_##funcname##_doc, docstring);
+#define FUNC1A(funcname, func, docstring) \
+ static PyObject * math_##funcname(PyObject *self, PyObject *args) { \
+ return math_1a(args, func); \
+ }\
+ PyDoc_STRVAR(math_##funcname##_doc, docstring);
+
#define FUNC2(funcname, func, docstring) \
static PyObject * math_##funcname(PyObject *self, PyObject *args) { \
return math_2(args, func, #funcname); \
@@ -338,35 +821,33 @@ math_2(PyObject *args, double (*func) (double, double), char *funcname)
FUNC1(acos, acos, 0,
"acos(x)\n\nReturn the arc cosine (measured in radians) of x.")
-FUNC1(acosh, acosh, 0,
+FUNC1(acosh, m_acosh, 0,
"acosh(x)\n\nReturn the hyperbolic arc cosine (measured in radians) of x.")
FUNC1(asin, asin, 0,
"asin(x)\n\nReturn the arc sine (measured in radians) of x.")
-FUNC1(asinh, asinh, 0,
+FUNC1(asinh, m_asinh, 0,
"asinh(x)\n\nReturn the hyperbolic arc sine (measured in radians) of x.")
FUNC1(atan, atan, 0,
"atan(x)\n\nReturn the arc tangent (measured in radians) of x.")
FUNC2(atan2, m_atan2,
"atan2(y, x)\n\nReturn the arc tangent (measured in radians) of y/x.\n"
"Unlike atan(y/x), the signs of both x and y are considered.")
-FUNC1(atanh, atanh, 0,
+FUNC1(atanh, m_atanh, 0,
"atanh(x)\n\nReturn the hyperbolic arc tangent (measured in radians) of x.")
static PyObject * math_ceil(PyObject *self, PyObject *number) {
static PyObject *ceil_str = NULL;
- PyObject *method;
+ PyObject *method, *result;
- if (ceil_str == NULL) {
- ceil_str = PyUnicode_InternFromString("__ceil__");
- if (ceil_str == NULL)
+ method = _PyObject_LookupSpecial(number, "__ceil__", &ceil_str);
+ if (method == NULL) {
+ if (PyErr_Occurred())
return NULL;
- }
-
- method = _PyType_Lookup(Py_TYPE(number), ceil_str);
- if (method == NULL)
return math_1_to_int(number, ceil, 0);
- else
- return PyObject_CallFunction(method, "O", number);
+ }
+ result = PyObject_CallFunctionObjArgs(method, NULL);
+ Py_DECREF(method);
+ return result;
}
PyDoc_STRVAR(math_ceil_doc,
@@ -379,33 +860,43 @@ FUNC1(cos, cos, 0,
"cos(x)\n\nReturn the cosine of x (measured in radians).")
FUNC1(cosh, cosh, 1,
"cosh(x)\n\nReturn the hyperbolic cosine of x.")
+FUNC1A(erf, m_erf,
+ "erf(x)\n\nError function at x.")
+FUNC1A(erfc, m_erfc,
+ "erfc(x)\n\nComplementary error function at x.")
FUNC1(exp, exp, 1,
"exp(x)\n\nReturn e raised to the power of x.")
+FUNC1(expm1, m_expm1, 1,
+ "expm1(x)\n\nReturn exp(x)-1.\n"
+ "This function avoids the loss of precision involved in the direct "
+ "evaluation of exp(x)-1 for small x.")
FUNC1(fabs, fabs, 0,
"fabs(x)\n\nReturn the absolute value of the float x.")
static PyObject * math_floor(PyObject *self, PyObject *number) {
static PyObject *floor_str = NULL;
- PyObject *method;
+ PyObject *method, *result;
- if (floor_str == NULL) {
- floor_str = PyUnicode_InternFromString("__floor__");
- if (floor_str == NULL)
+ method = _PyObject_LookupSpecial(number, "__floor__", &floor_str);
+ if (method == NULL) {
+ if (PyErr_Occurred())
return NULL;
- }
-
- method = _PyType_Lookup(Py_TYPE(number), floor_str);
- if (method == NULL)
return math_1_to_int(number, floor, 0);
- else
- return PyObject_CallFunction(method, "O", number);
+ }
+ result = PyObject_CallFunctionObjArgs(method, NULL);
+ Py_DECREF(method);
+ return result;
}
PyDoc_STRVAR(math_floor_doc,
"floor(x)\n\nReturn the floor of x as an int.\n"
"This is the largest integral value <= x.");
-FUNC1(log1p, log1p, 1,
+FUNC1A(gamma, m_tgamma,
+ "gamma(x)\n\nGamma function at x.")
+FUNC1A(lgamma, m_lgamma,
+ "lgamma(x)\n\nNatural logarithm of absolute value of Gamma function at x.")
+FUNC1(log1p, m_log1p, 0,
"log1p(x)\n\nReturn the natural logarithm of 1+x (base e).\n"
"The result is computed in a way which is accurate for x near zero.")
FUNC1(sin, sin, 0,
@@ -640,49 +1131,276 @@ PyDoc_STRVAR(math_fsum_doc,
Return an accurate floating point sum of values in the iterable.\n\
Assumes IEEE-754 floating point arithmetic.");
+/* Return the smallest integer k such that n < 2**k, or 0 if n == 0.
+ * Equivalent to floor(lg(x))+1. Also equivalent to: bitwidth_of_type -
+ * count_leading_zero_bits(x)
+ */
+
+/* XXX: This routine does more or less the same thing as
+ * bits_in_digit() in Objects/longobject.c. Someday it would be nice to
+ * consolidate them. On BSD, there's a library function called fls()
+ * that we could use, and GCC provides __builtin_clz().
+ */
+
+static unsigned long
+bit_length(unsigned long n)
+{
+ unsigned long len = 0;
+ while (n != 0) {
+ ++len;
+ n >>= 1;
+ }
+ return len;
+}
+
+static unsigned long
+count_set_bits(unsigned long n)
+{
+ unsigned long count = 0;
+ while (n != 0) {
+ ++count;
+ n &= n - 1; /* clear least significant bit */
+ }
+ return count;
+}
+
+/* Divide-and-conquer factorial algorithm
+ *
+ * Based on the formula and psuedo-code provided at:
+ * http://www.luschny.de/math/factorial/binarysplitfact.html
+ *
+ * Faster algorithms exist, but they're more complicated and depend on
+ * a fast prime factorization algorithm.
+ *
+ * Notes on the algorithm
+ * ----------------------
+ *
+ * factorial(n) is written in the form 2**k * m, with m odd. k and m are
+ * computed separately, and then combined using a left shift.
+ *
+ * The function factorial_odd_part computes the odd part m (i.e., the greatest
+ * odd divisor) of factorial(n), using the formula:
+ *
+ * factorial_odd_part(n) =
+ *
+ * product_{i >= 0} product_{0 < j <= n / 2**i, j odd} j
+ *
+ * Example: factorial_odd_part(20) =
+ *
+ * (1) *
+ * (1) *
+ * (1 * 3 * 5) *
+ * (1 * 3 * 5 * 7 * 9)
+ * (1 * 3 * 5 * 7 * 9 * 11 * 13 * 15 * 17 * 19)
+ *
+ * Here i goes from large to small: the first term corresponds to i=4 (any
+ * larger i gives an empty product), and the last term corresponds to i=0.
+ * Each term can be computed from the last by multiplying by the extra odd
+ * numbers required: e.g., to get from the penultimate term to the last one,
+ * we multiply by (11 * 13 * 15 * 17 * 19).
+ *
+ * To see a hint of why this formula works, here are the same numbers as above
+ * but with the even parts (i.e., the appropriate powers of 2) included. For
+ * each subterm in the product for i, we multiply that subterm by 2**i:
+ *
+ * factorial(20) =
+ *
+ * (16) *
+ * (8) *
+ * (4 * 12 * 20) *
+ * (2 * 6 * 10 * 14 * 18) *
+ * (1 * 3 * 5 * 7 * 9 * 11 * 13 * 15 * 17 * 19)
+ *
+ * The factorial_partial_product function computes the product of all odd j in
+ * range(start, stop) for given start and stop. It's used to compute the
+ * partial products like (11 * 13 * 15 * 17 * 19) in the example above. It
+ * operates recursively, repeatedly splitting the range into two roughly equal
+ * pieces until the subranges are small enough to be computed using only C
+ * integer arithmetic.
+ *
+ * The two-valuation k (i.e., the exponent of the largest power of 2 dividing
+ * the factorial) is computed independently in the main math_factorial
+ * function. By standard results, its value is:
+ *
+ * two_valuation = n//2 + n//4 + n//8 + ....
+ *
+ * It can be shown (e.g., by complete induction on n) that two_valuation is
+ * equal to n - count_set_bits(n), where count_set_bits(n) gives the number of
+ * '1'-bits in the binary expansion of n.
+ */
+
+/* factorial_partial_product: Compute product(range(start, stop, 2)) using
+ * divide and conquer. Assumes start and stop are odd and stop > start.
+ * max_bits must be >= bit_length(stop - 2). */
+
+static PyObject *
+factorial_partial_product(unsigned long start, unsigned long stop,
+ unsigned long max_bits)
+{
+ unsigned long midpoint, num_operands;
+ PyObject *left = NULL, *right = NULL, *result = NULL;
+
+ /* If the return value will fit an unsigned long, then we can
+ * multiply in a tight, fast loop where each multiply is O(1).
+ * Compute an upper bound on the number of bits required to store
+ * the answer.
+ *
+ * Storing some integer z requires floor(lg(z))+1 bits, which is
+ * conveniently the value returned by bit_length(z). The
+ * product x*y will require at most
+ * bit_length(x) + bit_length(y) bits to store, based
+ * on the idea that lg product = lg x + lg y.
+ *
+ * We know that stop - 2 is the largest number to be multiplied. From
+ * there, we have: bit_length(answer) <= num_operands *
+ * bit_length(stop - 2)
+ */
+
+ num_operands = (stop - start) / 2;
+ /* The "num_operands <= 8 * SIZEOF_LONG" check guards against the
+ * unlikely case of an overflow in num_operands * max_bits. */
+ if (num_operands <= 8 * SIZEOF_LONG &&
+ num_operands * max_bits <= 8 * SIZEOF_LONG) {
+ unsigned long j, total;
+ for (total = start, j = start + 2; j < stop; j += 2)
+ total *= j;
+ return PyLong_FromUnsignedLong(total);
+ }
+
+ /* find midpoint of range(start, stop), rounded up to next odd number. */
+ midpoint = (start + num_operands) | 1;
+ left = factorial_partial_product(start, midpoint,
+ bit_length(midpoint - 2));
+ if (left == NULL)
+ goto error;
+ right = factorial_partial_product(midpoint, stop, max_bits);
+ if (right == NULL)
+ goto error;
+ result = PyNumber_Multiply(left, right);
+
+ error:
+ Py_XDECREF(left);
+ Py_XDECREF(right);
+ return result;
+}
+
+/* factorial_odd_part: compute the odd part of factorial(n). */
+
+static PyObject *
+factorial_odd_part(unsigned long n)
+{
+ long i;
+ unsigned long v, lower, upper;
+ PyObject *partial, *tmp, *inner, *outer;
+
+ inner = PyLong_FromLong(1);
+ if (inner == NULL)
+ return NULL;
+ outer = inner;
+ Py_INCREF(outer);
+
+ upper = 3;
+ for (i = bit_length(n) - 2; i >= 0; i--) {
+ v = n >> i;
+ if (v <= 2)
+ continue;
+ lower = upper;
+ /* (v + 1) | 1 = least odd integer strictly larger than n / 2**i */
+ upper = (v + 1) | 1;
+ /* Here inner is the product of all odd integers j in the range (0,
+ n/2**(i+1)]. The factorial_partial_product call below gives the
+ product of all odd integers j in the range (n/2**(i+1), n/2**i]. */
+ partial = factorial_partial_product(lower, upper, bit_length(upper-2));
+ /* inner *= partial */
+ if (partial == NULL)
+ goto error;
+ tmp = PyNumber_Multiply(inner, partial);
+ Py_DECREF(partial);
+ if (tmp == NULL)
+ goto error;
+ Py_DECREF(inner);
+ inner = tmp;
+ /* Now inner is the product of all odd integers j in the range (0,
+ n/2**i], giving the inner product in the formula above. */
+
+ /* outer *= inner; */
+ tmp = PyNumber_Multiply(outer, inner);
+ if (tmp == NULL)
+ goto error;
+ Py_DECREF(outer);
+ outer = tmp;
+ }
+
+ goto done;
+
+ error:
+ Py_DECREF(outer);
+ done:
+ Py_DECREF(inner);
+ return outer;
+}
+
+/* Lookup table for small factorial values */
+
+static const unsigned long SmallFactorials[] = {
+ 1, 1, 2, 6, 24, 120, 720, 5040, 40320,
+ 362880, 3628800, 39916800, 479001600,
+#if SIZEOF_LONG >= 8
+ 6227020800, 87178291200, 1307674368000,
+ 20922789888000, 355687428096000, 6402373705728000,
+ 121645100408832000, 2432902008176640000
+#endif
+};
+
static PyObject *
math_factorial(PyObject *self, PyObject *arg)
{
- long i, x;
- PyObject *result, *iobj, *newresult;
+ long x;
+ PyObject *result, *odd_part, *two_valuation;
if (PyFloat_Check(arg)) {
+ PyObject *lx;
double dx = PyFloat_AS_DOUBLE((PyFloatObject *)arg);
- if (dx != floor(dx)) {
+ if (!(Py_IS_FINITE(dx) && dx == floor(dx))) {
PyErr_SetString(PyExc_ValueError,
- "factorial() only accepts integral values");
+ "factorial() only accepts integral values");
return NULL;
}
+ lx = PyLong_FromDouble(dx);
+ if (lx == NULL)
+ return NULL;
+ x = PyLong_AsLong(lx);
+ Py_DECREF(lx);
}
+ else
+ x = PyLong_AsLong(arg);
- x = PyLong_AsLong(arg);
if (x == -1 && PyErr_Occurred())
return NULL;
if (x < 0) {
PyErr_SetString(PyExc_ValueError,
- "factorial() not defined for negative values");
+ "factorial() not defined for negative values");
return NULL;
}
- result = (PyObject *)PyLong_FromLong(1);
- if (result == NULL)
+ /* use lookup table if x is small */
+ if (x < (long)(sizeof(SmallFactorials)/sizeof(SmallFactorials[0])))
+ return PyLong_FromUnsignedLong(SmallFactorials[x]);
+
+ /* else express in the form odd_part * 2**two_valuation, and compute as
+ odd_part << two_valuation. */
+ odd_part = factorial_odd_part(x);
+ if (odd_part == NULL)
+ return NULL;
+ two_valuation = PyLong_FromLong(x - count_set_bits(x));
+ if (two_valuation == NULL) {
+ Py_DECREF(odd_part);
return NULL;
- for (i=1 ; i<=x ; i++) {
- iobj = (PyObject *)PyLong_FromLong(i);
- if (iobj == NULL)
- goto error;
- newresult = PyNumber_Multiply(result, iobj);
- Py_DECREF(iobj);
- if (newresult == NULL)
- goto error;
- Py_DECREF(result);
- result = newresult;
}
+ result = PyNumber_Lshift(odd_part, two_valuation);
+ Py_DECREF(two_valuation);
+ Py_DECREF(odd_part);
return result;
-
-error:
- Py_DECREF(result);
- return NULL;
}
PyDoc_STRVAR(math_factorial_doc,
@@ -694,27 +1412,24 @@ static PyObject *
math_trunc(PyObject *self, PyObject *number)
{
static PyObject *trunc_str = NULL;
- PyObject *trunc;
+ PyObject *trunc, *result;
if (Py_TYPE(number)->tp_dict == NULL) {
if (PyType_Ready(Py_TYPE(number)) < 0)
return NULL;
}
- if (trunc_str == NULL) {
- trunc_str = PyUnicode_InternFromString("__trunc__");
- if (trunc_str == NULL)
- return NULL;
- }
-
- trunc = _PyType_Lookup(Py_TYPE(number), trunc_str);
+ trunc = _PyObject_LookupSpecial(number, "__trunc__", &trunc_str);
if (trunc == NULL) {
- PyErr_Format(PyExc_TypeError,
- "type %.100s doesn't define __trunc__ method",
- Py_TYPE(number)->tp_name);
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_TypeError,
+ "type %.100s doesn't define __trunc__ method",
+ Py_TYPE(number)->tp_name);
return NULL;
}
- return PyObject_CallFunctionObjArgs(trunc, number, NULL);
+ result = PyObject_CallFunctionObjArgs(trunc, NULL);
+ Py_DECREF(trunc);
+ return result;
}
PyDoc_STRVAR(math_trunc_doc,
@@ -755,28 +1470,18 @@ math_ldexp(PyObject *self, PyObject *args)
double x, r;
PyObject *oexp;
long exp;
+ int overflow;
if (! PyArg_ParseTuple(args, "dO:ldexp", &x, &oexp))
return NULL;
if (PyLong_Check(oexp)) {
/* on overflow, replace exponent with either LONG_MAX
or LONG_MIN, depending on the sign. */
- exp = PyLong_AsLong(oexp);
- if (exp == -1 && PyErr_Occurred()) {
- if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
- if (Py_SIZE(oexp) < 0) {
- exp = LONG_MIN;
- }
- else {
- exp = LONG_MAX;
- }
- PyErr_Clear();
- }
- else {
- /* propagate any unexpected exception */
- return NULL;
- }
- }
+ exp = PyLong_AsLongAndOverflow(oexp, &overflow);
+ if (exp == -1 && PyErr_Occurred())
+ return NULL;
+ if (overflow)
+ exp = overflow < 0 ? LONG_MIN : LONG_MAX;
}
else {
PyErr_SetString(PyExc_TypeError,
@@ -845,31 +1550,45 @@ PyDoc_STRVAR(math_modf_doc,
/* A decent logarithm is easy to compute even for huge longs, but libm can't
do that by itself -- loghelper can. func is log or log10, and name is
- "log" or "log10". Note that overflow isn't possible: a long can contain
- no more than INT_MAX * SHIFT bits, so has value certainly less than
- 2**(2**64 * 2**16) == 2**2**80, and log2 of that is 2**80, which is
+ "log" or "log10". Note that overflow of the result isn't possible: a long
+ can contain no more than INT_MAX * SHIFT bits, so has value certainly less
+ than 2**(2**64 * 2**16) == 2**2**80, and log2 of that is 2**80, which is
small enough to fit in an IEEE single. log and log10 are even smaller.
-*/
+ However, intermediate overflow is possible for a long if the number of bits
+ in that long is larger than PY_SSIZE_T_MAX. */
static PyObject*
loghelper(PyObject* arg, double (*func)(double), char *funcname)
{
/* If it is long, do it ourselves. */
if (PyLong_Check(arg)) {
- double x;
- int e;
- x = _PyLong_AsScaledDouble(arg, &e);
- if (x <= 0.0) {
+ double x, result;
+ Py_ssize_t e;
+
+ /* Negative or zero inputs give a ValueError. */
+ if (Py_SIZE(arg) <= 0) {
PyErr_SetString(PyExc_ValueError,
"math domain error");
return NULL;
}
- /* Value is ~= x * 2**(e*PyLong_SHIFT), so the log ~=
- log(x) + log(2) * e * PyLong_SHIFT.
- CAUTION: e*PyLong_SHIFT may overflow using int arithmetic,
- so force use of double. */
- x = func(x) + (e * (double)PyLong_SHIFT) * func(2.0);
- return PyFloat_FromDouble(x);
+
+ x = PyLong_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ return NULL;
+ /* Here the conversion to double overflowed, but it's possible
+ to compute the log anyway. Clear the exception and continue. */
+ PyErr_Clear();
+ x = _PyLong_Frexp((PyLongObject *)arg, &e);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+ /* Value is ~= x * 2**e, so the log ~= log(x) + log(2) * e. */
+ result = func(x) + func(2.0) * e;
+ }
+ else
+ /* Successfully converted x to a double. */
+ result = func(x);
+ return PyFloat_FromDouble(result);
}
/* Else let libm handle it by itself. */
@@ -1109,6 +1828,19 @@ PyDoc_STRVAR(math_radians_doc,
Convert angle x from degrees to radians.");
static PyObject *
+math_isfinite(PyObject *self, PyObject *arg)
+{
+ double x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+ return PyBool_FromLong((long)Py_IS_FINITE(x));
+}
+
+PyDoc_STRVAR(math_isfinite_doc,
+"isfinite(x) -> bool\n\n\
+Return True if x is neither an infinity nor a NaN, and False otherwise.");
+
+static PyObject *
math_isnan(PyObject *self, PyObject *arg)
{
double x = PyFloat_AsDouble(arg);
@@ -1119,7 +1851,7 @@ math_isnan(PyObject *self, PyObject *arg)
PyDoc_STRVAR(math_isnan_doc,
"isnan(x) -> bool\n\n\
-Check if float x is not a number (NaN).");
+Return True if x is a NaN (not a number), and False otherwise.");
static PyObject *
math_isinf(PyObject *self, PyObject *arg)
@@ -1132,7 +1864,7 @@ math_isinf(PyObject *self, PyObject *arg)
PyDoc_STRVAR(math_isinf_doc,
"isinf(x) -> bool\n\n\
-Check if float x is infinite (positive or negative).");
+Return True if x is a positive or negative infinity, and False otherwise.");
static PyMethodDef math_methods[] = {
{"acos", math_acos, METH_O, math_acos_doc},
@@ -1147,17 +1879,23 @@ static PyMethodDef math_methods[] = {
{"cos", math_cos, METH_O, math_cos_doc},
{"cosh", math_cosh, METH_O, math_cosh_doc},
{"degrees", math_degrees, METH_O, math_degrees_doc},
+ {"erf", math_erf, METH_O, math_erf_doc},
+ {"erfc", math_erfc, METH_O, math_erfc_doc},
{"exp", math_exp, METH_O, math_exp_doc},
+ {"expm1", math_expm1, METH_O, math_expm1_doc},
{"fabs", math_fabs, METH_O, math_fabs_doc},
{"factorial", math_factorial, METH_O, math_factorial_doc},
{"floor", math_floor, METH_O, math_floor_doc},
{"fmod", math_fmod, METH_VARARGS, math_fmod_doc},
{"frexp", math_frexp, METH_O, math_frexp_doc},
{"fsum", math_fsum, METH_O, math_fsum_doc},
+ {"gamma", math_gamma, METH_O, math_gamma_doc},
{"hypot", math_hypot, METH_VARARGS, math_hypot_doc},
+ {"isfinite", math_isfinite, METH_O, math_isfinite_doc},
{"isinf", math_isinf, METH_O, math_isinf_doc},
{"isnan", math_isnan, METH_O, math_isnan_doc},
{"ldexp", math_ldexp, METH_VARARGS, math_ldexp_doc},
+ {"lgamma", math_lgamma, METH_O, math_lgamma_doc},
{"log", math_log, METH_VARARGS, math_log_doc},
{"log1p", math_log1p, METH_O, math_log1p_doc},
{"log10", math_log10, METH_O, math_log10_doc},
diff --git a/Modules/md5module.c b/Modules/md5module.c
index d217dc85fd..208930dfaa 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -228,9 +228,9 @@ void md5_init(struct md5_state *md5)
@param inlen The length of the data (octets)
*/
void md5_process(struct md5_state *md5,
- const unsigned char *in, unsigned long inlen)
+ const unsigned char *in, Py_ssize_t inlen)
{
- unsigned long n;
+ Py_ssize_t n;
assert(md5 != NULL);
assert(in != NULL);
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 88da4a0ac6..36ca67d3c1 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -132,8 +132,6 @@ mmap_object_dealloc(mmap_object *m_obj)
if (m_obj->fd >= 0)
(void) close(m_obj->fd);
if (m_obj->data!=NULL) {
- if (m_obj->access != ACCESS_READ && m_obj->access != ACCESS_COPY)
- msync(m_obj->data, m_obj->size, MS_SYNC);
munmap(m_obj->data, m_obj->size);
}
#endif /* UNIX */
@@ -660,6 +658,31 @@ mmap_move_method(mmap_object *self, PyObject *args)
}
}
+static PyObject *
+mmap_closed_get(mmap_object *self)
+{
+#ifdef MS_WINDOWS
+ return PyBool_FromLong(self->map_handle == NULL ? 1 : 0);
+#elif defined(UNIX)
+ return PyBool_FromLong(self->data == NULL ? 1 : 0);
+#endif
+}
+
+static PyObject *
+mmap__enter__method(mmap_object *self, PyObject *args)
+{
+ CHECK_VALID(NULL);
+
+ Py_INCREF(self);
+ return (PyObject *)self;
+}
+
+static PyObject *
+mmap__exit__method(PyObject *self, PyObject *args)
+{
+ return PyObject_CallMethod(self, "close", NULL);
+}
+
static struct PyMethodDef mmap_object_methods[] = {
{"close", (PyCFunction) mmap_close_method, METH_NOARGS},
{"find", (PyCFunction) mmap_find_method, METH_VARARGS},
@@ -675,9 +698,17 @@ static struct PyMethodDef mmap_object_methods[] = {
{"tell", (PyCFunction) mmap_tell_method, METH_NOARGS},
{"write", (PyCFunction) mmap_write_method, METH_VARARGS},
{"write_byte", (PyCFunction) mmap_write_byte_method, METH_VARARGS},
+ {"__enter__", (PyCFunction) mmap__enter__method, METH_NOARGS},
+ {"__exit__", (PyCFunction) mmap__exit__method, METH_VARARGS},
{NULL, NULL} /* sentinel */
};
+static PyGetSetDef mmap_object_getset[] = {
+ {"closed", (getter) mmap_closed_get, NULL, NULL},
+ {NULL}
+};
+
+
/* Functions for treating an mmap'ed file as a buffer */
static int
@@ -735,7 +766,7 @@ mmap_subscript(mmap_object *self, PyObject *item)
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelen;
- if (PySlice_GetIndicesEx((PySliceObject *)item, self->size,
+ if (PySlice_GetIndicesEx(item, self->size,
&start, &stop, &step, &slicelen) < 0) {
return NULL;
}
@@ -861,7 +892,7 @@ mmap_ass_subscript(mmap_object *self, PyObject *item, PyObject *value)
Py_ssize_t start, stop, step, slicelen;
Py_buffer vbuf;
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
self->size, &start, &stop,
&step, &slicelen) < 0) {
return -1;
@@ -984,7 +1015,7 @@ static PyTypeObject mmap_object_type = {
0, /* tp_iternext */
mmap_object_methods, /* tp_methods */
0, /* tp_members */
- 0, /* tp_getset */
+ mmap_object_getset, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
diff --git a/Modules/nismodule.c b/Modules/nismodule.c
index d75af5d589..a81ca8ca4d 100644
--- a/Modules/nismodule.c
+++ b/Modules/nismodule.c
@@ -117,8 +117,8 @@ nis_foreach (int instatus, char *inkey, int inkeylen, char *inval,
if (invallen > 0 && inval[invallen-1] == '\0')
invallen--;
}
- key = PyUnicode_FromStringAndSize(inkey, inkeylen);
- val = PyUnicode_FromStringAndSize(inval, invallen);
+ key = PyUnicode_DecodeFSDefaultAndSize(inkey, inkeylen);
+ val = PyUnicode_DecodeFSDefaultAndSize(inval, invallen);
if (key == NULL || val == NULL) {
/* XXX error -- don't know how to handle */
PyErr_Clear();
@@ -159,30 +159,40 @@ nis_match (PyObject *self, PyObject *args, PyObject *kwdict)
{
char *match;
char *domain = NULL;
- int keylen, len;
+ Py_ssize_t keylen;
+ int len;
char *key, *map;
int err;
- PyObject *res;
+ PyObject *ukey, *bkey, *res;
int fix;
static char *kwlist[] = {"key", "map", "domain", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwdict,
- "s#s|s:match", kwlist,
- &key, &keylen, &map, &domain))
+ "Us|s:match", kwlist,
+ &ukey, &map, &domain))
return NULL;
- if (!domain && ((err = yp_get_default_domain(&domain)) != 0))
+ if ((bkey = PyUnicode_EncodeFSDefault(ukey)) == NULL)
+ return NULL;
+ if (PyBytes_AsStringAndSize(bkey, &key, &keylen) == -1) {
+ Py_DECREF(bkey);
+ return NULL;
+ }
+ if (!domain && ((err = yp_get_default_domain(&domain)) != 0)) {
+ Py_DECREF(bkey);
return nis_error(err);
+ }
map = nis_mapname (map, &fix);
if (fix)
keylen++;
Py_BEGIN_ALLOW_THREADS
err = yp_match (domain, map, key, keylen, &match, &len);
Py_END_ALLOW_THREADS
+ Py_DECREF(bkey);
if (fix)
len--;
if (err != 0)
return nis_error(err);
- res = PyUnicode_FromStringAndSize (match, len);
+ res = PyUnicode_DecodeFSDefaultAndSize(match, len);
free (match);
return res;
}
diff --git a/Modules/operator.c b/Modules/operator.c
index 8ca4d2d06c..866ec3a761 100644
--- a/Modules/operator.c
+++ b/Modules/operator.c
@@ -383,7 +383,7 @@ attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
attrgetterobject *ag;
PyObject *attr;
- Py_ssize_t nattrs;
+ Py_ssize_t nattrs, idx, char_idx;
if (!_PyArg_NoKeywords("attrgetter()", kwds))
return NULL;
@@ -392,15 +392,92 @@ attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (nattrs <= 1) {
if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &attr))
return NULL;
- } else
- attr = args;
+ }
+
+ attr = PyTuple_New(nattrs);
+ if (attr == NULL)
+ return NULL;
+
+ /* prepare attr while checking args */
+ for (idx = 0; idx < nattrs; ++idx) {
+ PyObject *item = PyTuple_GET_ITEM(args, idx);
+ Py_ssize_t item_len;
+ Py_UNICODE *item_buffer;
+ int dot_count;
+
+ if (!PyUnicode_Check(item)) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute name must be a string");
+ Py_DECREF(attr);
+ return NULL;
+ }
+ item_len = PyUnicode_GET_SIZE(item);
+ item_buffer = PyUnicode_AS_UNICODE(item);
+
+ /* check whethere the string is dotted */
+ dot_count = 0;
+ for (char_idx = 0; char_idx < item_len; ++char_idx) {
+ if (item_buffer[char_idx] == (Py_UNICODE)'.')
+ ++dot_count;
+ }
+
+ if (dot_count == 0) {
+ Py_INCREF(item);
+ PyUnicode_InternInPlace(&item);
+ PyTuple_SET_ITEM(attr, idx, item);
+ } else { /* make it a tuple of non-dotted attrnames */
+ PyObject *attr_chain = PyTuple_New(dot_count + 1);
+ PyObject *attr_chain_item;
+ Py_ssize_t unibuff_from = 0;
+ Py_ssize_t unibuff_till = 0;
+ Py_ssize_t attr_chain_idx = 0;
+
+ if (attr_chain == NULL) {
+ Py_DECREF(attr);
+ return NULL;
+ }
+
+ for (; dot_count > 0; --dot_count) {
+ while (item_buffer[unibuff_till] != (Py_UNICODE)'.') {
+ ++unibuff_till;
+ }
+ attr_chain_item = PyUnicode_FromUnicode(
+ item_buffer + unibuff_from,
+ unibuff_till - unibuff_from);
+ if (attr_chain_item == NULL) {
+ Py_DECREF(attr_chain);
+ Py_DECREF(attr);
+ return NULL;
+ }
+ PyUnicode_InternInPlace(&attr_chain_item);
+ PyTuple_SET_ITEM(attr_chain, attr_chain_idx, attr_chain_item);
+ ++attr_chain_idx;
+ unibuff_till = unibuff_from = unibuff_till + 1;
+ }
+
+ /* now add the last dotless name */
+ attr_chain_item = PyUnicode_FromUnicode(
+ item_buffer + unibuff_from,
+ item_len - unibuff_from);
+ if (attr_chain_item == NULL) {
+ Py_DECREF(attr_chain);
+ Py_DECREF(attr);
+ return NULL;
+ }
+ PyUnicode_InternInPlace(&attr_chain_item);
+ PyTuple_SET_ITEM(attr_chain, attr_chain_idx, attr_chain_item);
+
+ PyTuple_SET_ITEM(attr, idx, attr_chain);
+ }
+ }
/* create attrgetterobject structure */
ag = PyObject_GC_New(attrgetterobject, &attrgetter_type);
- if (ag == NULL)
+ if (ag == NULL) {
+ Py_DECREF(attr);
return NULL;
+ }
- Py_INCREF(attr);
ag->attr = attr;
ag->nattrs = nattrs;
@@ -426,33 +503,31 @@ attrgetter_traverse(attrgetterobject *ag, visitproc visit, void *arg)
static PyObject *
dotted_getattr(PyObject *obj, PyObject *attr)
{
- char *s, *p;
-
- if (!PyUnicode_Check(attr)) {
- PyErr_SetString(PyExc_TypeError,
- "attribute name must be a string");
- return NULL;
- }
-
- s = _PyUnicode_AsString(attr);
- Py_INCREF(obj);
- for (;;) {
- PyObject *newobj, *str;
- p = strchr(s, '.');
- str = p ? PyUnicode_FromStringAndSize(s, (p-s)) :
- PyUnicode_FromString(s);
- if (str == NULL) {
+ PyObject *newobj;
+
+ /* attr is either a tuple or instance of str.
+ Ensured by the setup code of attrgetter_new */
+ if (PyTuple_CheckExact(attr)) { /* chained getattr */
+ Py_ssize_t name_idx = 0, name_count;
+ PyObject *attr_name;
+
+ name_count = PyTuple_GET_SIZE(attr);
+ Py_INCREF(obj);
+ for (name_idx = 0; name_idx < name_count; ++name_idx) {
+ attr_name = PyTuple_GET_ITEM(attr, name_idx);
+ newobj = PyObject_GetAttr(obj, attr_name);
Py_DECREF(obj);
- return NULL;
+ if (newobj == NULL) {
+ return NULL;
+ }
+ /* here */
+ obj = newobj;
}
- newobj = PyObject_GetAttr(obj, str);
- Py_DECREF(str);
- Py_DECREF(obj);
+ } else { /* single getattr */
+ newobj = PyObject_GetAttr(obj, attr);
if (newobj == NULL)
return NULL;
obj = newobj;
- if (p == NULL) break;
- s = p+1;
}
return obj;
@@ -466,8 +541,8 @@ attrgetter_call(attrgetterobject *ag, PyObject *args, PyObject *kw)
if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &obj))
return NULL;
- if (ag->nattrs == 1)
- return dotted_getattr(obj, ag->attr);
+ if (ag->nattrs == 1) /* ag->attr is always a tuple */
+ return dotted_getattr(obj, PyTuple_GET_ITEM(ag->attr, 0));
assert(PyTuple_Check(ag->attr));
assert(PyTuple_GET_SIZE(ag->attr) == nattrs);
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
index 5c990eff85..e660e50d0c 100644
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -470,6 +470,23 @@ oss_close(oss_audio_t *self, PyObject *unused)
}
static PyObject *
+oss_self(PyObject *self, PyObject *unused)
+{
+ Py_INCREF(self);
+ return self;
+}
+
+static PyObject *
+oss_exit(PyObject *self, PyObject *unused)
+{
+ PyObject *ret = PyObject_CallMethod(self, "close", NULL);
+ if (!ret)
+ return NULL;
+ Py_DECREF(ret);
+ Py_RETURN_NONE;
+}
+
+static PyObject *
oss_fileno(oss_audio_t *self, PyObject *unused)
{
return PyLong_FromLong(self->fd);
@@ -782,6 +799,10 @@ static PyMethodDef oss_methods[] = {
/* Aliases for backwards compatibility */
{ "flush", (PyCFunction)oss_sync, METH_VARARGS },
+ /* Support for the context manager protocol */
+ { "__enter__", oss_self, METH_NOARGS },
+ { "__exit__", oss_exit, METH_VARARGS },
+
{ NULL, NULL} /* sentinel */
};
@@ -790,6 +811,10 @@ static PyMethodDef oss_mixer_methods[] = {
{ "close", (PyCFunction)oss_mixer_close, METH_NOARGS },
{ "fileno", (PyCFunction)oss_mixer_fileno, METH_NOARGS },
+ /* Support for the context manager protocol */
+ { "__enter__", oss_self, METH_NOARGS },
+ { "__exit__", oss_exit, METH_VARARGS },
+
/* Simple ioctl wrappers */
{ "controls", (PyCFunction)oss_mixer_controls, METH_VARARGS },
{ "stereocontrols", (PyCFunction)oss_mixer_stereocontrols, METH_VARARGS},
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index 8e9e25813a..3cdf1359a6 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -34,10 +34,8 @@
#include "grammar.h"
#include "parsetok.h"
/* ISTERMINAL() / ISNONTERMINAL() */
-#include "compile.h"
#undef Yield
#include "ast.h"
-#include "pyarena.h"
extern grammar _PyParser_Grammar; /* From graminit.c */
@@ -794,6 +792,11 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
}
}
temp_str = _PyUnicode_AsStringAndSize(temp, &len);
+ if (temp_str == NULL) {
+ Py_DECREF(temp);
+ Py_XDECREF(elem);
+ return 0;
+ }
strn = (char *)PyObject_MALLOC(len + 1);
if (strn != NULL)
(void) memcpy(strn, temp_str, len + 1);
@@ -872,6 +875,8 @@ build_node_tree(PyObject *tuple)
encoding = PySequence_GetItem(tuple, 2);
/* tuple isn't borrowed anymore here, need to DECREF */
tuple = PySequence_GetSlice(tuple, 0, 2);
+ if (tuple == NULL)
+ return NULL;
}
res = PyNode_New(num);
if (res != NULL) {
@@ -883,6 +888,12 @@ build_node_tree(PyObject *tuple)
Py_ssize_t len;
const char *temp;
temp = _PyUnicode_AsStringAndSize(encoding, &len);
+ if (temp == NULL) {
+ Py_DECREF(res);
+ Py_DECREF(encoding);
+ Py_DECREF(tuple);
+ return NULL;
+ }
res->n_str = (char *)PyObject_MALLOC(len + 1);
if (res->n_str != NULL && temp != NULL)
(void) memcpy(res->n_str, temp, len + 1);
@@ -943,7 +954,7 @@ VALIDATER(return_stmt); VALIDATER(raise_stmt);
VALIDATER(import_stmt); VALIDATER(import_stmt);
VALIDATER(import_name); VALIDATER(yield_stmt);
VALIDATER(global_stmt); VALIDATER(assert_stmt);
-VALIDATER(compound_stmt);
+VALIDATER(compound_stmt); VALIDATER(test_or_star_expr);
VALIDATER(while); VALIDATER(for);
VALIDATER(try); VALIDATER(except_clause);
VALIDATER(test); VALIDATER(and_test);
@@ -958,10 +969,10 @@ VALIDATER(trailer); VALIDATER(subscript);
VALIDATER(subscriptlist); VALIDATER(sliceop);
VALIDATER(exprlist); VALIDATER(dictorsetmaker);
VALIDATER(arglist); VALIDATER(argument);
-VALIDATER(testlist1); VALIDATER(comp_for);
+VALIDATER(comp_for);
VALIDATER(comp_iter); VALIDATER(comp_if);
VALIDATER(testlist_comp); VALIDATER(yield_expr);
-VALIDATER(yield_or_testlist); VALIDATER(or_test);
+VALIDATER(or_test);
VALIDATER(test_nocond); VALIDATER(lambdef_nocond);
#undef VALIDATER
@@ -1183,12 +1194,11 @@ validate_testlist(node *tree)
validate_test, "testlist"));
}
-
static int
-validate_testlist1(node *tree)
+validate_testlist_star_expr(node *tl)
{
- return (validate_repeating_list(tree, testlist1,
- validate_test, "testlist1"));
+ return (validate_repeating_list(tl, testlist_star_expr, validate_test_or_star_expr,
+ "testlist"));
}
@@ -1516,12 +1526,17 @@ validate_compound_stmt(node *tree)
}
static int
-validate_yield_or_testlist(node *tree)
+validate_yield_or_testlist(node *tree, int tse)
{
- if (TYPE(tree) == yield_expr)
- return validate_yield_expr(tree);
+ if (TYPE(tree) == yield_expr) {
+ return validate_yield_expr(tree);
+ }
+ else {
+ if (tse)
+ return validate_testlist_star_expr(tree);
else
- return validate_testlist(tree);
+ return validate_testlist(tree);
+ }
}
static int
@@ -1531,12 +1546,12 @@ validate_expr_stmt(node *tree)
int nch = NCH(tree);
int res = (validate_ntype(tree, expr_stmt)
&& is_odd(nch)
- && validate_testlist(CHILD(tree, 0)));
+ && validate_testlist_star_expr(CHILD(tree, 0)));
if (res && nch == 3
&& TYPE(CHILD(tree, 1)) == augassign) {
res = validate_numnodes(CHILD(tree, 1), 1, "augassign")
- && validate_yield_or_testlist(CHILD(tree, 2));
+ && validate_yield_or_testlist(CHILD(tree, 2), 0);
if (res) {
char *s = STR(CHILD(CHILD(tree, 1), 0));
@@ -1560,7 +1575,7 @@ validate_expr_stmt(node *tree)
else {
for (j = 1; res && (j < nch); j += 2)
res = validate_equal(CHILD(tree, j))
- && validate_yield_or_testlist(CHILD(tree, j + 1));
+ && validate_yield_or_testlist(CHILD(tree, j + 1), 1);
}
return (res);
}
@@ -2078,11 +2093,11 @@ validate_comparison(node *tree)
int nch = NCH(tree);
int res = (validate_ntype(tree, comparison)
&& is_odd(nch)
- && validate_star_expr(CHILD(tree, 0)));
+ && validate_expr(CHILD(tree, 0)));
for (pos = 1; res && (pos < nch); pos += 2)
res = (validate_comp_op(CHILD(tree, pos))
- && validate_star_expr(CHILD(tree, pos + 1)));
+ && validate_expr(CHILD(tree, pos + 1)));
return (res);
}
@@ -2144,12 +2159,10 @@ validate_star_expr(node *tree)
{
int res = validate_ntype(tree, star_expr);
if (!res) return res;
- if (NCH(tree) == 2) {
- return validate_ntype(CHILD(tree, 0), STAR) && \
- validate_expr(CHILD(tree, 1));
- } else {
- return validate_expr(CHILD(tree, 0));
- }
+ if (!validate_numnodes(tree, 2, "star_expr"))
+ return 0;
+ return validate_ntype(CHILD(tree, 0), STAR) && \
+ validate_expr(CHILD(tree, 1));
}
@@ -2380,7 +2393,7 @@ validate_testlist_comp(node *tree)
if (nch == 0)
err_string("missing child nodes of testlist_comp");
else {
- ok = validate_test(CHILD(tree, 0));
+ ok = validate_test_or_star_expr(CHILD(tree, 0));
}
/*
@@ -2393,7 +2406,7 @@ validate_testlist_comp(node *tree)
int i = 1;
while (ok && nch - i >= 2) {
ok = (validate_comma(CHILD(tree, i))
- && validate_test(CHILD(tree, i+1)));
+ && validate_test_or_star_expr(CHILD(tree, i+1)));
i += 2;
}
if (ok && i == nch-1)
@@ -2788,10 +2801,27 @@ validate_sliceop(node *tree)
static int
+validate_test_or_star_expr(node *n)
+{
+ if (TYPE(n) == test)
+ return validate_test(n);
+ return validate_star_expr(n);
+}
+
+static int
+validate_expr_or_star_expr(node *n)
+{
+ if (TYPE(n) == expr)
+ return validate_expr(n);
+ return validate_star_expr(n);
+}
+
+
+static int
validate_exprlist(node *tree)
{
return (validate_repeating_list(tree, exprlist,
- validate_star_expr, "exprlist"));
+ validate_expr_or_star_expr, "exprlist"));
}
@@ -2972,9 +3002,6 @@ validate_node(node *tree)
case yield_expr:
res = validate_yield_expr(tree);
break;
- case testlist1:
- res = validate_testlist1(tree);
- break;
case test:
res = validate_test(tree);
break;
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index a836af6cd0..89d3f2f2d0 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -28,7 +28,6 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
-#include "structseq.h"
#if defined(__VMS)
# include <unixio.h>
@@ -121,6 +120,8 @@ corresponding Unix manual entries for more information on calls.");
#else
#ifdef _MSC_VER /* Microsoft compiler */
#define HAVE_GETCWD 1
+#define HAVE_GETPPID 1
+#define HAVE_GETLOGIN 1
#define HAVE_SPAWNV 1
#define HAVE_EXECV 1
#define HAVE_PIPE 1
@@ -262,10 +263,24 @@ extern int lstat(const char *, struct stat *);
#ifdef HAVE_PROCESS_H
#include <process.h>
#endif
+#ifndef VOLUME_NAME_DOS
+#define VOLUME_NAME_DOS 0x0
+#endif
+#ifndef VOLUME_NAME_NT
+#define VOLUME_NAME_NT 0x2
+#endif
+#ifndef IO_REPARSE_TAG_SYMLINK
+#define IO_REPARSE_TAG_SYMLINK (0xA000000CL)
+#endif
#include "osdefs.h"
#include <malloc.h>
#include <windows.h>
#include <shellapi.h> /* for ShellExecute() */
+#include <lmcons.h> /* for UNLEN */
+#ifdef SE_CREATE_SYMBOLIC_LINK_NAME /* Available starting with Vista */
+#define HAVE_SYMLINK
+static int win32_can_symlink = 0;
+#endif
#endif /* _MSC_VER */
#if defined(PYCC_VACPP) && defined(PYOS_OS2)
@@ -303,23 +318,6 @@ extern int lstat(const char *, struct stat *);
#define WAIT_STATUS_INT(s) (s)
#endif /* UNION_WAIT */
-/* Issue #1983: pid_t can be longer than a C long on some systems */
-#if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT
-#define PARSE_PID "i"
-#define PyLong_FromPid PyLong_FromLong
-#define PyLong_AsPid PyLong_AsLong
-#elif SIZEOF_PID_T == SIZEOF_LONG
-#define PARSE_PID "l"
-#define PyLong_FromPid PyLong_FromLong
-#define PyLong_AsPid PyLong_AsLong
-#elif defined(SIZEOF_LONG_LONG) && SIZEOF_PID_T == SIZEOF_LONG_LONG
-#define PARSE_PID "L"
-#define PyLong_FromPid PyLong_FromLongLong
-#define PyLong_AsPid PyLong_AsLongLong
-#else
-#error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)"
-#endif /* SIZEOF_PID_T */
-
/* Don't use the "_r" form if we don't need it (also, won't have a
prototype for it, at least on Solaris -- maybe others as well?). */
#if defined(HAVE_CTERMID_R) && defined(WITH_THREAD)
@@ -444,6 +442,98 @@ _PyVerify_fd_dup2(int fd1, int fd2)
#define _PyVerify_fd_dup2(A, B) (1)
#endif
+#ifdef MS_WINDOWS
+/* The following structure was copied from
+ http://msdn.microsoft.com/en-us/library/ms791514.aspx as the required
+ include doesn't seem to be present in the Windows SDK (at least as included
+ with Visual Studio Express). */
+typedef struct _REPARSE_DATA_BUFFER {
+ ULONG ReparseTag;
+ USHORT ReparseDataLength;
+ USHORT Reserved;
+ union {
+ struct {
+ USHORT SubstituteNameOffset;
+ USHORT SubstituteNameLength;
+ USHORT PrintNameOffset;
+ USHORT PrintNameLength;
+ ULONG Flags;
+ WCHAR PathBuffer[1];
+ } SymbolicLinkReparseBuffer;
+
+ struct {
+ USHORT SubstituteNameOffset;
+ USHORT SubstituteNameLength;
+ USHORT PrintNameOffset;
+ USHORT PrintNameLength;
+ WCHAR PathBuffer[1];
+ } MountPointReparseBuffer;
+
+ struct {
+ UCHAR DataBuffer[1];
+ } GenericReparseBuffer;
+ };
+} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
+
+#define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER,\
+ GenericReparseBuffer)
+#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 )
+
+static int
+win32_read_link(HANDLE reparse_point_handle, ULONG *reparse_tag, wchar_t **target_path)
+{
+ char target_buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
+ REPARSE_DATA_BUFFER *rdb = (REPARSE_DATA_BUFFER *)target_buffer;
+ DWORD n_bytes_returned;
+ const wchar_t *ptr;
+ wchar_t *buf;
+ size_t len;
+
+ if (0 == DeviceIoControl(
+ reparse_point_handle,
+ FSCTL_GET_REPARSE_POINT,
+ NULL, 0, /* in buffer */
+ target_buffer, sizeof(target_buffer),
+ &n_bytes_returned,
+ NULL)) /* we're not using OVERLAPPED_IO */
+ return -1;
+
+ if (reparse_tag)
+ *reparse_tag = rdb->ReparseTag;
+
+ if (target_path) {
+ switch (rdb->ReparseTag) {
+ case IO_REPARSE_TAG_SYMLINK:
+ /* XXX: Maybe should use SubstituteName? */
+ ptr = rdb->SymbolicLinkReparseBuffer.PathBuffer +
+ rdb->SymbolicLinkReparseBuffer.PrintNameOffset/sizeof(WCHAR);
+ len = rdb->SymbolicLinkReparseBuffer.PrintNameLength/sizeof(WCHAR);
+ break;
+ case IO_REPARSE_TAG_MOUNT_POINT:
+ ptr = rdb->MountPointReparseBuffer.PathBuffer +
+ rdb->MountPointReparseBuffer.SubstituteNameOffset/sizeof(WCHAR);
+ len = rdb->MountPointReparseBuffer.SubstituteNameLength/sizeof(WCHAR);
+ break;
+ default:
+ SetLastError(ERROR_REPARSE_TAG_MISMATCH); /* XXX: Proper error code? */
+ return -1;
+ }
+ buf = (wchar_t *)malloc(sizeof(wchar_t)*(len+1));
+ if (!buf) {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return -1;
+ }
+ wcsncpy(buf, ptr, len);
+ buf[len] = L'\0';
+ if (wcsncmp(buf, L"\\??\\", 4) == 0)
+ buf[1] = L'\\';
+ *target_path = buf;
+ }
+
+ return 0;
+}
+#endif /* MS_WINDOWS */
+
/* Return a dictionary corresponding to the POSIX environment table */
#ifdef WITH_NEXT_FRAMEWORK
/* On Darwin/MacOSX a shared library or framework has no access to
@@ -517,14 +607,12 @@ convertenviron(void)
char *p = strchr(*e, '=');
if (p == NULL)
continue;
- k = PyUnicode_Decode(*e, (int)(p-*e),
- Py_FileSystemDefaultEncoding, "surrogateescape");
+ k = PyBytes_FromStringAndSize(*e, (int)(p-*e));
if (k == NULL) {
PyErr_Clear();
continue;
}
- v = PyUnicode_Decode(p+1, strlen(p+1),
- Py_FileSystemDefaultEncoding, "surrogateescape");
+ v = PyBytes_FromStringAndSize(p+1, strlen(p+1));
if (v == NULL) {
PyErr_Clear();
Py_DECREF(k);
@@ -555,38 +643,6 @@ convertenviron(void)
return d;
}
-/* Convert a bytes object to a char*. Optionally lock the buffer if it is a
- bytes array. */
-
-static char*
-bytes2str(PyObject* o, int lock)
-{
- if(PyBytes_Check(o))
- return PyBytes_AsString(o);
- else if(PyByteArray_Check(o)) {
- if (lock && PyObject_GetBuffer(o, NULL, 0) < 0)
- /* On a bytearray, this should not fail. */
- PyErr_BadInternalCall();
- return PyByteArray_AsString(o);
- } else {
- /* The FS converter should have verified that this
- is either bytes or bytearray. */
- Py_FatalError("bad object passed to bytes2str");
- /* not reached. */
- return "";
- }
-}
-
-/* Release the lock, decref the object. */
-static void
-release_bytes(PyObject* o)
-{
- if (PyByteArray_Check(o))
- o->ob_type->tp_as_buffer->bf_releasebuffer(o, 0);
- Py_DECREF(o);
-}
-
-
/* Set a POSIX-specific error from errno, and return NULL */
static PyObject *
@@ -600,27 +656,23 @@ posix_error_with_filename(char* name)
return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
}
-#ifdef MS_WINDOWS
-static PyObject *
-posix_error_with_unicode_filename(Py_UNICODE* name)
-{
- return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name);
-}
-#endif /* MS_WINDOWS */
-
static PyObject *
posix_error_with_allocated_filename(PyObject* name)
{
- PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError,
- bytes2str(name, 0));
- release_bytes(name);
+ PyObject *name_str, *rc;
+ name_str = PyUnicode_DecodeFSDefaultAndSize(PyBytes_AsString(name),
+ PyBytes_GET_SIZE(name));
+ Py_DECREF(name);
+ rc = PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError,
+ name_str);
+ Py_XDECREF(name_str);
return rc;
}
#ifdef MS_WINDOWS
static PyObject *
-win32_error(char* function, char* filename)
+win32_error(char* function, const char* filename)
{
/* XXX We should pass the function name along in the future.
(winreg.c also wants to pass the function name.)
@@ -762,20 +814,6 @@ posix_fildes(PyObject *fdobj, int (*func)(int))
return Py_None;
}
-#ifdef MS_WINDOWS
-static int
-unicode_file_names(void)
-{
- static int canusewide = -1;
- if (canusewide == -1) {
- /* As per doc for ::GetVersion(), this is the correct test for
- the Windows NT family. */
- canusewide = (GetVersion() < 0x80000000) ? 1 : 0;
- }
- return canusewide;
-}
-#endif
-
static PyObject *
posix_1str(PyObject *args, char *format, int (*func)(const char*))
{
@@ -785,13 +823,13 @@ posix_1str(PyObject *args, char *format, int (*func)(const char*))
if (!PyArg_ParseTuple(args, format,
PyUnicode_FSConverter, &opath1))
return NULL;
- path1 = bytes2str(opath1, 1);
+ path1 = PyBytes_AsString(opath1);
Py_BEGIN_ALLOW_THREADS
res = (*func)(path1);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(opath1);
- release_bytes(opath1);
+ Py_DECREF(opath1);
Py_INCREF(Py_None);
return Py_None;
}
@@ -809,13 +847,13 @@ posix_2str(PyObject *args,
PyUnicode_FSConverter, &opath2)) {
return NULL;
}
- path1 = bytes2str(opath1, 1);
- path2 = bytes2str(opath2, 1);
+ path1 = PyBytes_AsString(opath1);
+ path2 = PyBytes_AsString(opath2);
Py_BEGIN_ALLOW_THREADS
res = (*func)(path1, path2);
Py_END_ALLOW_THREADS
- release_bytes(opath1);
- release_bytes(opath2);
+ Py_DECREF(opath1);
+ Py_DECREF(opath2);
if (res != 0)
/* XXX how to report both path1 and path2??? */
return posix_error();
@@ -832,18 +870,17 @@ win32_1str(PyObject* args, char* func,
PyObject *uni;
char *ansi;
BOOL result;
- if (unicode_file_names()) {
- if (!PyArg_ParseTuple(args, wformat, &uni))
- PyErr_Clear();
- else {
- Py_BEGIN_ALLOW_THREADS
- result = funcW(PyUnicode_AsUnicode(uni));
- Py_END_ALLOW_THREADS
- if (!result)
- return win32_error_unicode(func, PyUnicode_AsUnicode(uni));
- Py_INCREF(Py_None);
- return Py_None;
- }
+
+ if (!PyArg_ParseTuple(args, wformat, &uni))
+ PyErr_Clear();
+ else {
+ Py_BEGIN_ALLOW_THREADS
+ result = funcW(PyUnicode_AsUnicode(uni));
+ Py_END_ALLOW_THREADS
+ if (!result)
+ return win32_error_unicode(func, PyUnicode_AsUnicode(uni));
+ Py_INCREF(Py_None);
+ return Py_None;
}
if (!PyArg_ParseTuple(args, format, &ansi))
return NULL;
@@ -993,7 +1030,7 @@ attributes_to_mode(DWORD attr)
}
static int
-attribute_data_to_stat(WIN32_FILE_ATTRIBUTE_DATA *info, struct win32_stat *result)
+attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *info, ULONG reparse_tag, struct win32_stat *result)
{
memset(result, 0, sizeof(*result));
result->st_mode = attributes_to_mode(info->dwFileAttributes);
@@ -1001,28 +1038,20 @@ attribute_data_to_stat(WIN32_FILE_ATTRIBUTE_DATA *info, struct win32_stat *resul
FILE_TIME_to_time_t_nsec(&info->ftCreationTime, &result->st_ctime, &result->st_ctime_nsec);
FILE_TIME_to_time_t_nsec(&info->ftLastWriteTime, &result->st_mtime, &result->st_mtime_nsec);
FILE_TIME_to_time_t_nsec(&info->ftLastAccessTime, &result->st_atime, &result->st_atime_nsec);
+ result->st_nlink = info->nNumberOfLinks;
+ result->st_ino = (((__int64)info->nFileIndexHigh)<<32) + info->nFileIndexLow;
+ if (reparse_tag == IO_REPARSE_TAG_SYMLINK) {
+ /* first clear the S_IFMT bits */
+ result->st_mode ^= (result->st_mode & 0170000);
+ /* now set the bits that make this a symlink */
+ result->st_mode |= 0120000;
+ }
return 0;
}
-/* Emulate GetFileAttributesEx[AW] on Windows 95 */
-static int checked = 0;
-static BOOL (CALLBACK *gfaxa)(LPCSTR, GET_FILEEX_INFO_LEVELS, LPVOID);
-static BOOL (CALLBACK *gfaxw)(LPCWSTR, GET_FILEEX_INFO_LEVELS, LPVOID);
-static void
-check_gfax()
-{
- HINSTANCE hKernel32;
- if (checked)
- return;
- checked = 1;
- hKernel32 = GetModuleHandle("KERNEL32");
- *(FARPROC*)&gfaxa = GetProcAddress(hKernel32, "GetFileAttributesExA");
- *(FARPROC*)&gfaxw = GetProcAddress(hKernel32, "GetFileAttributesExW");
-}
-
static BOOL
-attributes_from_dir(LPCSTR pszFile, LPWIN32_FILE_ATTRIBUTE_DATA pfad)
+attributes_from_dir(LPCSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *reparse_tag)
{
HANDLE hFindFile;
WIN32_FIND_DATAA FileData;
@@ -1030,17 +1059,22 @@ attributes_from_dir(LPCSTR pszFile, LPWIN32_FILE_ATTRIBUTE_DATA pfad)
if (hFindFile == INVALID_HANDLE_VALUE)
return FALSE;
FindClose(hFindFile);
- pfad->dwFileAttributes = FileData.dwFileAttributes;
- pfad->ftCreationTime = FileData.ftCreationTime;
- pfad->ftLastAccessTime = FileData.ftLastAccessTime;
- pfad->ftLastWriteTime = FileData.ftLastWriteTime;
- pfad->nFileSizeHigh = FileData.nFileSizeHigh;
- pfad->nFileSizeLow = FileData.nFileSizeLow;
+ memset(info, 0, sizeof(*info));
+ *reparse_tag = 0;
+ info->dwFileAttributes = FileData.dwFileAttributes;
+ info->ftCreationTime = FileData.ftCreationTime;
+ info->ftLastAccessTime = FileData.ftLastAccessTime;
+ info->ftLastWriteTime = FileData.ftLastWriteTime;
+ info->nFileSizeHigh = FileData.nFileSizeHigh;
+ info->nFileSizeLow = FileData.nFileSizeLow;
+/* info->nNumberOfLinks = 1; */
+ if (FileData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
+ *reparse_tag = FileData.dwReserved0;
return TRUE;
}
static BOOL
-attributes_from_dir_w(LPCWSTR pszFile, LPWIN32_FILE_ATTRIBUTE_DATA pfad)
+attributes_from_dir_w(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *reparse_tag)
{
HANDLE hFindFile;
WIN32_FIND_DATAW FileData;
@@ -1048,152 +1082,232 @@ attributes_from_dir_w(LPCWSTR pszFile, LPWIN32_FILE_ATTRIBUTE_DATA pfad)
if (hFindFile == INVALID_HANDLE_VALUE)
return FALSE;
FindClose(hFindFile);
- pfad->dwFileAttributes = FileData.dwFileAttributes;
- pfad->ftCreationTime = FileData.ftCreationTime;
- pfad->ftLastAccessTime = FileData.ftLastAccessTime;
- pfad->ftLastWriteTime = FileData.ftLastWriteTime;
- pfad->nFileSizeHigh = FileData.nFileSizeHigh;
- pfad->nFileSizeLow = FileData.nFileSizeLow;
+ memset(info, 0, sizeof(*info));
+ *reparse_tag = 0;
+ info->dwFileAttributes = FileData.dwFileAttributes;
+ info->ftCreationTime = FileData.ftCreationTime;
+ info->ftLastAccessTime = FileData.ftLastAccessTime;
+ info->ftLastWriteTime = FileData.ftLastWriteTime;
+ info->nFileSizeHigh = FileData.nFileSizeHigh;
+ info->nFileSizeLow = FileData.nFileSizeLow;
+/* info->nNumberOfLinks = 1; */
+ if (FileData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
+ *reparse_tag = FileData.dwReserved0;
return TRUE;
}
-static BOOL WINAPI
-Py_GetFileAttributesExA(LPCSTR pszFile,
- GET_FILEEX_INFO_LEVELS level,
- LPVOID pv)
-{
- BOOL result;
- LPWIN32_FILE_ATTRIBUTE_DATA pfad = pv;
- /* First try to use the system's implementation, if that is
- available and either succeeds to gives an error other than
- that it isn't implemented. */
- check_gfax();
- if (gfaxa) {
- result = gfaxa(pszFile, level, pv);
- if (result || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
- return result;
- }
- /* It's either not present, or not implemented.
- Emulate using FindFirstFile. */
- if (level != GetFileExInfoStandard) {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
- /* Use GetFileAttributes to validate that the file name
- does not contain wildcards (which FindFirstFile would
- accept). */
- if (GetFileAttributesA(pszFile) == 0xFFFFFFFF)
- return FALSE;
- return attributes_from_dir(pszFile, pfad);
-}
+#ifndef SYMLOOP_MAX
+#define SYMLOOP_MAX ( 88 )
+#endif
-static BOOL WINAPI
-Py_GetFileAttributesExW(LPCWSTR pszFile,
- GET_FILEEX_INFO_LEVELS level,
- LPVOID pv)
-{
- BOOL result;
- LPWIN32_FILE_ATTRIBUTE_DATA pfad = pv;
- /* First try to use the system's implementation, if that is
- available and either succeeds to gives an error other than
- that it isn't implemented. */
- check_gfax();
- if (gfaxa) {
- result = gfaxw(pszFile, level, pv);
- if (result || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
- return result;
- }
- /* It's either not present, or not implemented.
- Emulate using FindFirstFile. */
- if (level != GetFileExInfoStandard) {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
- /* Use GetFileAttributes to validate that the file name
- does not contain wildcards (which FindFirstFile would
- accept). */
- if (GetFileAttributesW(pszFile) == 0xFFFFFFFF)
- return FALSE;
- return attributes_from_dir_w(pszFile, pfad);
-}
+static int
+win32_xstat_impl_w(const wchar_t *path, struct win32_stat *result, BOOL traverse, int depth);
static int
-win32_stat(const char* path, struct win32_stat *result)
+win32_xstat_impl(const char *path, struct win32_stat *result, BOOL traverse, int depth)
{
- WIN32_FILE_ATTRIBUTE_DATA info;
int code;
- char *dot;
- /* XXX not supported on Win95 and NT 3.x */
- if (!Py_GetFileAttributesExA(path, GetFileExInfoStandard, &info)) {
- if (GetLastError() != ERROR_SHARING_VIOLATION) {
- /* Protocol violation: we explicitly clear errno, instead of
- setting it to a POSIX error. Callers should use GetLastError. */
- errno = 0;
+ HANDLE hFile;
+ BY_HANDLE_FILE_INFORMATION info;
+ ULONG reparse_tag = 0;
+ wchar_t *target_path;
+ const char *dot;
+
+ if (depth > SYMLOOP_MAX) {
+ SetLastError(ERROR_CANT_RESOLVE_FILENAME); /* XXX: ELOOP? */
+ return -1;
+ }
+
+ hFile = CreateFileA(
+ path,
+ 0, /* desired access */
+ 0, /* share mode */
+ NULL, /* security attributes */
+ OPEN_EXISTING,
+ /* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */
+ FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS|FILE_FLAG_OPEN_REPARSE_POINT,
+ NULL);
+
+ if (hFile == INVALID_HANDLE_VALUE) {
+ /* Either the target doesn't exist, or we don't have access to
+ get a handle to it. If the former, we need to return an error.
+ If the latter, we can use attributes_from_dir. */
+ if (GetLastError() != ERROR_SHARING_VIOLATION)
return -1;
- } else {
- /* Could not get attributes on open file. Fall back to
- reading the directory. */
- if (!attributes_from_dir(path, &info)) {
- /* Very strange. This should not fail now */
- errno = 0;
+ /* Could not get attributes on open file. Fall back to
+ reading the directory. */
+ if (!attributes_from_dir(path, &info, &reparse_tag))
+ /* Very strange. This should not fail now */
+ return -1;
+ if (info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ if (traverse) {
+ /* Should traverse, but could not open reparse point handle */
+ SetLastError(ERROR_SHARING_VIOLATION);
return -1;
}
}
+ } else {
+ if (!GetFileInformationByHandle(hFile, &info)) {
+ CloseHandle(hFile);
+ return -1;;
+ }
+ if (info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ code = win32_read_link(hFile, &reparse_tag, traverse ? &target_path : NULL);
+ CloseHandle(hFile);
+ if (code < 0)
+ return code;
+ if (traverse) {
+ code = win32_xstat_impl_w(target_path, result, traverse, depth + 1);
+ free(target_path);
+ return code;
+ }
+ } else
+ CloseHandle(hFile);
}
- code = attribute_data_to_stat(&info, result);
- if (code != 0)
- return code;
- /* Set S_IFEXEC if it is an .exe, .bat, ... */
+ attribute_data_to_stat(&info, reparse_tag, result);
+
+ /* Set S_IEXEC if it is an .exe, .bat, ... */
dot = strrchr(path, '.');
if (dot) {
- if (stricmp(dot, ".bat") == 0 ||
- stricmp(dot, ".cmd") == 0 ||
- stricmp(dot, ".exe") == 0 ||
- stricmp(dot, ".com") == 0)
+ if (stricmp(dot, ".bat") == 0 || stricmp(dot, ".cmd") == 0 ||
+ stricmp(dot, ".exe") == 0 || stricmp(dot, ".com") == 0)
result->st_mode |= 0111;
}
- return code;
+ return 0;
}
static int
-win32_wstat(const wchar_t* path, struct win32_stat *result)
+win32_xstat_impl_w(const wchar_t *path, struct win32_stat *result, BOOL traverse, int depth)
{
int code;
+ HANDLE hFile;
+ BY_HANDLE_FILE_INFORMATION info;
+ ULONG reparse_tag = 0;
+ wchar_t *target_path;
const wchar_t *dot;
- WIN32_FILE_ATTRIBUTE_DATA info;
- /* XXX not supported on Win95 and NT 3.x */
- if (!Py_GetFileAttributesExW(path, GetFileExInfoStandard, &info)) {
- if (GetLastError() != ERROR_SHARING_VIOLATION) {
- /* Protocol violation: we explicitly clear errno, instead of
- setting it to a POSIX error. Callers should use GetLastError. */
- errno = 0;
+
+ if (depth > SYMLOOP_MAX) {
+ SetLastError(ERROR_CANT_RESOLVE_FILENAME); /* XXX: ELOOP? */
+ return -1;
+ }
+
+ hFile = CreateFileW(
+ path,
+ 0, /* desired access */
+ 0, /* share mode */
+ NULL, /* security attributes */
+ OPEN_EXISTING,
+ /* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */
+ FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS|FILE_FLAG_OPEN_REPARSE_POINT,
+ NULL);
+
+ if (hFile == INVALID_HANDLE_VALUE) {
+ /* Either the target doesn't exist, or we don't have access to
+ get a handle to it. If the former, we need to return an error.
+ If the latter, we can use attributes_from_dir. */
+ if (GetLastError() != ERROR_SHARING_VIOLATION)
return -1;
- } else {
- /* Could not get attributes on open file. Fall back to
- reading the directory. */
- if (!attributes_from_dir_w(path, &info)) {
- /* Very strange. This should not fail now */
- errno = 0;
+ /* Could not get attributes on open file. Fall back to
+ reading the directory. */
+ if (!attributes_from_dir_w(path, &info, &reparse_tag))
+ /* Very strange. This should not fail now */
+ return -1;
+ if (info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ if (traverse) {
+ /* Should traverse, but could not open reparse point handle */
+ SetLastError(ERROR_SHARING_VIOLATION);
return -1;
}
}
+ } else {
+ if (!GetFileInformationByHandle(hFile, &info)) {
+ CloseHandle(hFile);
+ return -1;;
+ }
+ if (info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ code = win32_read_link(hFile, &reparse_tag, traverse ? &target_path : NULL);
+ CloseHandle(hFile);
+ if (code < 0)
+ return code;
+ if (traverse) {
+ code = win32_xstat_impl_w(target_path, result, traverse, depth + 1);
+ free(target_path);
+ return code;
+ }
+ } else
+ CloseHandle(hFile);
}
- code = attribute_data_to_stat(&info, result);
- if (code < 0)
- return code;
- /* Set IFEXEC if it is an .exe, .bat, ... */
+ attribute_data_to_stat(&info, reparse_tag, result);
+
+ /* Set S_IEXEC if it is an .exe, .bat, ... */
dot = wcsrchr(path, '.');
if (dot) {
- if (_wcsicmp(dot, L".bat") == 0 ||
- _wcsicmp(dot, L".cmd") == 0 ||
- _wcsicmp(dot, L".exe") == 0 ||
- _wcsicmp(dot, L".com") == 0)
+ if (_wcsicmp(dot, L".bat") == 0 || _wcsicmp(dot, L".cmd") == 0 ||
+ _wcsicmp(dot, L".exe") == 0 || _wcsicmp(dot, L".com") == 0)
result->st_mode |= 0111;
}
+ return 0;
+}
+
+static int
+win32_xstat(const char *path, struct win32_stat *result, BOOL traverse)
+{
+ /* Protocol violation: we explicitly clear errno, instead of
+ setting it to a POSIX error. Callers should use GetLastError. */
+ int code = win32_xstat_impl(path, result, traverse, 0);
+ errno = 0;
return code;
}
static int
+win32_xstat_w(const wchar_t *path, struct win32_stat *result, BOOL traverse)
+{
+ /* Protocol violation: we explicitly clear errno, instead of
+ setting it to a POSIX error. Callers should use GetLastError. */
+ int code = win32_xstat_impl_w(path, result, traverse, 0);
+ errno = 0;
+ return code;
+}
+
+/* About the following functions: win32_lstat, win32_lstat_w, win32_stat,
+ win32_stat_w
+
+ In Posix, stat automatically traverses symlinks and returns the stat
+ structure for the target. In Windows, the equivalent GetFileAttributes by
+ default does not traverse symlinks and instead returns attributes for
+ the symlink.
+
+ Therefore, win32_lstat will get the attributes traditionally, and
+ win32_stat will first explicitly resolve the symlink target and then will
+ call win32_lstat on that result.
+
+ The _w represent Unicode equivalents of the aforementioned ANSI functions. */
+
+static int
+win32_lstat(const char* path, struct win32_stat *result)
+{
+ return win32_xstat(path, result, FALSE);
+}
+
+static int
+win32_lstat_w(const wchar_t* path, struct win32_stat *result)
+{
+ return win32_xstat_w(path, result, FALSE);
+}
+
+static int
+win32_stat(const char* path, struct win32_stat *result)
+{
+ return win32_xstat(path, result, TRUE);
+}
+
+static int
+win32_stat_w(const wchar_t* path, struct win32_stat *result)
+{
+ return win32_xstat_w(path, result, TRUE);
+}
+
+static int
win32_fstat(int file_number, struct win32_stat *result)
{
BY_HANDLE_FILE_INFORMATION info;
@@ -1218,7 +1332,7 @@ win32_fstat(int file_number, struct win32_stat *result)
if (type == FILE_TYPE_UNKNOWN) {
DWORD error = GetLastError();
if (error != 0) {
- return -1;
+ return -1;
}
/* else: valid but unknown file */
}
@@ -1235,14 +1349,8 @@ win32_fstat(int file_number, struct win32_stat *result)
return -1;
}
- /* similar to stat() */
- result->st_mode = attributes_to_mode(info.dwFileAttributes);
- result->st_size = (((__int64)info.nFileSizeHigh)<<32) + info.nFileSizeLow;
- FILE_TIME_to_time_t_nsec(&info.ftCreationTime, &result->st_ctime, &result->st_ctime_nsec);
- FILE_TIME_to_time_t_nsec(&info.ftLastWriteTime, &result->st_mtime, &result->st_mtime_nsec);
- FILE_TIME_to_time_t_nsec(&info.ftLastAccessTime, &result->st_atime, &result->st_atime_nsec);
+ attribute_data_to_stat(&info, 0, result);
/* specific to fstat() */
- result->st_nlink = info.nNumberOfLinks;
result->st_ino = (((__int64)info.nFileIndexHigh)<<32) + info.nFileIndexLow;
return 0;
}
@@ -1542,66 +1650,6 @@ _pystat_fromstructstat(STRUCT_STAT *st)
return v;
}
-#ifdef MS_WINDOWS
-
-/* IsUNCRoot -- test whether the supplied path is of the form \\SERVER\SHARE\,
- where / can be used in place of \ and the trailing slash is optional.
- Both SERVER and SHARE must have at least one character.
-*/
-
-#define ISSLASHA(c) ((c) == '\\' || (c) == '/')
-#define ISSLASHW(c) ((c) == L'\\' || (c) == L'/')
-#ifndef ARRAYSIZE
-#define ARRAYSIZE(a) (sizeof(a) / sizeof(a[0]))
-#endif
-
-static BOOL
-IsUNCRootA(char *path, int pathlen)
-{
- #define ISSLASH ISSLASHA
-
- int i, share;
-
- if (pathlen < 5 || !ISSLASH(path[0]) || !ISSLASH(path[1]))
- /* minimum UNCRoot is \\x\y */
- return FALSE;
- for (i = 2; i < pathlen ; i++)
- if (ISSLASH(path[i])) break;
- if (i == 2 || i == pathlen)
- /* do not allow \\\SHARE or \\SERVER */
- return FALSE;
- share = i+1;
- for (i = share; i < pathlen; i++)
- if (ISSLASH(path[i])) break;
- return (i != share && (i == pathlen || i == pathlen-1));
-
- #undef ISSLASH
-}
-
-static BOOL
-IsUNCRootW(Py_UNICODE *path, int pathlen)
-{
- #define ISSLASH ISSLASHW
-
- int i, share;
-
- if (pathlen < 5 || !ISSLASH(path[0]) || !ISSLASH(path[1]))
- /* minimum UNCRoot is \\x\y */
- return FALSE;
- for (i = 2; i < pathlen ; i++)
- if (ISSLASH(path[i])) break;
- if (i == 2 || i == pathlen)
- /* do not allow \\\SHARE or \\SERVER */
- return FALSE;
- share = i+1;
- for (i = share; i < pathlen; i++)
- if (ISSLASH(path[i])) break;
- return (i != share && (i == pathlen || i == pathlen-1));
-
- #undef ISSLASH
-}
-#endif /* MS_WINDOWS */
-
static PyObject *
posix_do_stat(PyObject *self, PyObject *args,
char *format,
@@ -1620,33 +1668,29 @@ posix_do_stat(PyObject *self, PyObject *args,
PyObject *result;
#ifdef MS_WINDOWS
- /* If on wide-character-capable OS see if argument
- is Unicode and if so use wide API. */
- if (unicode_file_names()) {
- PyUnicodeObject *po;
- if (PyArg_ParseTuple(args, wformat, &po)) {
- Py_UNICODE *wpath = PyUnicode_AS_UNICODE(po);
+ PyUnicodeObject *po;
+ if (PyArg_ParseTuple(args, wformat, &po)) {
+ Py_UNICODE *wpath = PyUnicode_AS_UNICODE(po);
- Py_BEGIN_ALLOW_THREADS
- /* PyUnicode_AS_UNICODE result OK without
- thread lock as it is a simple dereference. */
- res = wstatfunc(wpath, &st);
- Py_END_ALLOW_THREADS
+ Py_BEGIN_ALLOW_THREADS
+ /* PyUnicode_AS_UNICODE result OK without
+ thread lock as it is a simple dereference. */
+ res = wstatfunc(wpath, &st);
+ Py_END_ALLOW_THREADS
- if (res != 0)
- return win32_error_unicode("stat", wpath);
- return _pystat_fromstructstat(&st);
- }
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
+ if (res != 0)
+ return win32_error_unicode("stat", wpath);
+ return _pystat_fromstructstat(&st);
}
+ /* Drop the argument parsing error as narrow strings
+ are also valid. */
+ PyErr_Clear();
#endif
if (!PyArg_ParseTuple(args, format,
PyUnicode_FSConverter, &opath))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
res = (*statfunc)(path, &st);
Py_END_ALLOW_THREADS
@@ -1661,7 +1705,7 @@ posix_do_stat(PyObject *self, PyObject *args,
else
result = _pystat_fromstructstat(&st);
- release_bytes(opath);
+ Py_DECREF(opath);
return result;
}
@@ -1684,28 +1728,26 @@ posix_access(PyObject *self, PyObject *args)
#ifdef MS_WINDOWS
DWORD attr;
- if (unicode_file_names()) {
- PyUnicodeObject *po;
- if (PyArg_ParseTuple(args, "Ui:access", &po, &mode)) {
- Py_BEGIN_ALLOW_THREADS
- /* PyUnicode_AS_UNICODE OK without thread lock as
- it is a simple dereference. */
- attr = GetFileAttributesW(PyUnicode_AS_UNICODE(po));
- Py_END_ALLOW_THREADS
- goto finish;
- }
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
+ PyUnicodeObject *po;
+ if (PyArg_ParseTuple(args, "Ui:access", &po, &mode)) {
+ Py_BEGIN_ALLOW_THREADS
+ /* PyUnicode_AS_UNICODE OK without thread lock as
+ it is a simple dereference. */
+ attr = GetFileAttributesW(PyUnicode_AS_UNICODE(po));
+ Py_END_ALLOW_THREADS
+ goto finish;
}
+ /* Drop the argument parsing error as narrow strings
+ are also valid. */
+ PyErr_Clear();
if (!PyArg_ParseTuple(args, "O&i:access",
PyUnicode_FSConverter, &opath, &mode))
- return 0;
- path = bytes2str(opath, 1);
+ return NULL;
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
attr = GetFileAttributesA(path);
Py_END_ALLOW_THREADS
- release_bytes(opath);
+ Py_DECREF(opath);
finish:
if (attr == 0xFFFFFFFF)
/* File does not exist, or cannot read attributes */
@@ -1721,11 +1763,11 @@ finish:
if (!PyArg_ParseTuple(args, "O&i:access",
PyUnicode_FSConverter, &opath, &mode))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
res = access(path, mode);
Py_END_ALLOW_THREADS
- release_bytes(opath);
+ Py_DECREF(opath);
return PyBool_FromLong(res == 0);
#endif
}
@@ -1841,35 +1883,34 @@ posix_chmod(PyObject *self, PyObject *args)
int res;
#ifdef MS_WINDOWS
DWORD attr;
- if (unicode_file_names()) {
- PyUnicodeObject *po;
- if (PyArg_ParseTuple(args, "Ui|:chmod", &po, &i)) {
- Py_BEGIN_ALLOW_THREADS
- attr = GetFileAttributesW(PyUnicode_AS_UNICODE(po));
- if (attr != 0xFFFFFFFF) {
- if (i & _S_IWRITE)
- attr &= ~FILE_ATTRIBUTE_READONLY;
- else
- attr |= FILE_ATTRIBUTE_READONLY;
- res = SetFileAttributesW(PyUnicode_AS_UNICODE(po), attr);
- }
+ PyUnicodeObject *po;
+ if (PyArg_ParseTuple(args, "Ui|:chmod", &po, &i)) {
+ Py_BEGIN_ALLOW_THREADS
+ attr = GetFileAttributesW(PyUnicode_AS_UNICODE(po));
+ if (attr != 0xFFFFFFFF) {
+ if (i & _S_IWRITE)
+ attr &= ~FILE_ATTRIBUTE_READONLY;
else
- res = 0;
- Py_END_ALLOW_THREADS
- if (!res)
- return win32_error_unicode("chmod",
- PyUnicode_AS_UNICODE(po));
- Py_INCREF(Py_None);
- return Py_None;
+ attr |= FILE_ATTRIBUTE_READONLY;
+ res = SetFileAttributesW(PyUnicode_AS_UNICODE(po), attr);
}
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
+ else
+ res = 0;
+ Py_END_ALLOW_THREADS
+ if (!res)
+ return win32_error_unicode("chmod",
+ PyUnicode_AS_UNICODE(po));
+ Py_INCREF(Py_None);
+ return Py_None;
}
+ /* Drop the argument parsing error as narrow strings
+ are also valid. */
+ PyErr_Clear();
+
if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter,
&opath, &i))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
attr = GetFileAttributesA(path);
if (attr != 0xFFFFFFFF) {
@@ -1884,23 +1925,23 @@ posix_chmod(PyObject *self, PyObject *args)
Py_END_ALLOW_THREADS
if (!res) {
win32_error("chmod", path);
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
- release_bytes(opath);
+ Py_DECREF(opath);
Py_INCREF(Py_None);
return Py_None;
#else /* MS_WINDOWS */
if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter,
&opath, &i))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
res = chmod(path, i);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(opath);
- release_bytes(opath);
+ Py_DECREF(opath);
Py_INCREF(Py_None);
return Py_None;
#endif
@@ -1943,13 +1984,13 @@ posix_lchmod(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O&i:lchmod", PyUnicode_FSConverter,
&opath, &i))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
res = lchmod(path, i);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(opath);
- release_bytes(opath);
+ Py_DECREF(opath);
Py_RETURN_NONE;
}
#endif /* HAVE_LCHMOD */
@@ -1970,13 +2011,13 @@ posix_chflags(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O&k:chflags",
PyUnicode_FSConverter, &opath, &flags))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
res = chflags(path, flags);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(opath);
- release_bytes(opath);
+ Py_DECREF(opath);
Py_INCREF(Py_None);
return Py_None;
}
@@ -1998,13 +2039,13 @@ posix_lchflags(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O&k:lchflags",
PyUnicode_FSConverter, &opath, &flags))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
res = lchflags(path, flags);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(opath);
- release_bytes(opath);
+ Py_DECREF(opath);
Py_INCREF(Py_None);
return Py_None;
}
@@ -2069,13 +2110,13 @@ posix_chown(PyObject *self, PyObject *args)
PyUnicode_FSConverter, &opath,
&uid, &gid))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
res = chown(path, (uid_t) uid, (gid_t) gid);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(opath);
- release_bytes(opath);
+ Py_DECREF(opath);
Py_INCREF(Py_None);
return Py_None;
}
@@ -2121,13 +2162,13 @@ posix_lchown(PyObject *self, PyObject *args)
PyUnicode_FSConverter, &opath,
&uid, &gid))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
res = lchown(path, (uid_t) uid, (gid_t) gid);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(opath);
- release_bytes(opath);
+ Py_DECREF(opath);
Py_INCREF(Py_None);
return Py_None;
}
@@ -2142,7 +2183,7 @@ posix_getcwd(int use_bytes)
char *res;
#ifdef MS_WINDOWS
- if (!use_bytes && unicode_file_names()) {
+ if (!use_bytes) {
wchar_t wbuf[1026];
wchar_t *wbuf2 = wbuf;
PyObject *resobj;
@@ -2183,7 +2224,7 @@ posix_getcwd(int use_bytes)
return posix_error();
if (use_bytes)
return PyBytes_FromStringAndSize(buf, strlen(buf));
- return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"surrogateescape");
+ return PyUnicode_DecodeFSDefault(buf);
}
PyDoc_STRVAR(posix_getcwd__doc__,
@@ -2220,12 +2261,60 @@ posix_link(PyObject *self, PyObject *args)
}
#endif /* HAVE_LINK */
+#ifdef MS_WINDOWS
+PyDoc_STRVAR(win32_link__doc__,
+"link(src, dst)\n\n\
+Create a hard link to a file.");
+
+static PyObject *
+win32_link(PyObject *self, PyObject *args)
+{
+ PyObject *osrc, *odst;
+ char *src, *dst;
+ BOOL rslt;
+
+ PyUnicodeObject *usrc, *udst;
+ if (PyArg_ParseTuple(args, "UU:link", &usrc, &udst)) {
+ Py_BEGIN_ALLOW_THREADS
+ rslt = CreateHardLinkW(PyUnicode_AS_UNICODE(udst),
+ PyUnicode_AS_UNICODE(usrc), NULL);
+ Py_END_ALLOW_THREADS
+
+ if (rslt == 0)
+ return win32_error("link", NULL);
+
+ Py_RETURN_NONE;
+ }
+
+ /* Narrow strings also valid. */
+ PyErr_Clear();
+
+ if (!PyArg_ParseTuple(args, "O&O&:link", PyUnicode_FSConverter, &osrc,
+ PyUnicode_FSConverter, &odst))
+ return NULL;
+
+ src = PyBytes_AsString(osrc);
+ dst = PyBytes_AsString(odst);
+
+ Py_BEGIN_ALLOW_THREADS
+ rslt = CreateHardLinkA(dst, src, NULL);
+ Py_END_ALLOW_THREADS
+
+ Py_DECREF(osrc);
+ Py_DECREF(odst);
+ if (rslt == 0)
+ return win32_error("link", NULL);
+
+ Py_RETURN_NONE;
+}
+#endif /* MS_WINDOWS */
+
PyDoc_STRVAR(posix_listdir__doc__,
-"listdir(path) -> list_of_strings\n\n\
+"listdir([path]) -> list_of_strings\n\n\
Return a list containing the names of the entries in the directory.\n\
\n\
- path: path of directory to list\n\
+ path: path of directory to list (default: '.')\n\
\n\
The list is in arbitrary order. It does not include the special\n\
entries '.' and '..' even if they are present in the directory.");
@@ -2246,101 +2335,105 @@ posix_listdir(PyObject *self, PyObject *args)
char *bufptr = namebuf;
Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for MAX_PATH */
- /* If on wide-character-capable OS see if argument
- is Unicode and if so use wide API. */
- if (unicode_file_names()) {
- PyObject *po;
- if (PyArg_ParseTuple(args, "U:listdir", &po)) {
- WIN32_FIND_DATAW wFileData;
- Py_UNICODE *wnamebuf;
- /* Overallocate for \\*.*\0 */
+ PyObject *po = NULL;
+ if (PyArg_ParseTuple(args, "|U:listdir", &po)) {
+ WIN32_FIND_DATAW wFileData;
+ Py_UNICODE *wnamebuf, *po_wchars;
+
+ if (po == NULL) { /* Default arg: "." */
+ po_wchars = L".";
+ len = 1;
+ } else {
+ po_wchars = PyUnicode_AS_UNICODE(po);
len = PyUnicode_GET_SIZE(po);
- wnamebuf = malloc((len + 5) * sizeof(wchar_t));
- if (!wnamebuf) {
- PyErr_NoMemory();
- return NULL;
- }
- wcscpy(wnamebuf, PyUnicode_AS_UNICODE(po));
- if (len > 0) {
- Py_UNICODE wch = wnamebuf[len-1];
- if (wch != L'/' && wch != L'\\' && wch != L':')
- wnamebuf[len++] = L'\\';
- wcscpy(wnamebuf + len, L"*.*");
- }
- if ((d = PyList_New(0)) == NULL) {
+ }
+ /* Overallocate for \\*.*\0 */
+ wnamebuf = malloc((len + 5) * sizeof(wchar_t));
+ if (!wnamebuf) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ wcscpy(wnamebuf, po_wchars);
+ if (len > 0) {
+ Py_UNICODE wch = wnamebuf[len-1];
+ if (wch != L'/' && wch != L'\\' && wch != L':')
+ wnamebuf[len++] = L'\\';
+ wcscpy(wnamebuf + len, L"*.*");
+ }
+ if ((d = PyList_New(0)) == NULL) {
+ free(wnamebuf);
+ return NULL;
+ }
+ Py_BEGIN_ALLOW_THREADS
+ hFindFile = FindFirstFileW(wnamebuf, &wFileData);
+ Py_END_ALLOW_THREADS
+ if (hFindFile == INVALID_HANDLE_VALUE) {
+ int error = GetLastError();
+ if (error == ERROR_FILE_NOT_FOUND) {
free(wnamebuf);
- return NULL;
+ return d;
}
- Py_BEGIN_ALLOW_THREADS
- hFindFile = FindFirstFileW(wnamebuf, &wFileData);
- Py_END_ALLOW_THREADS
- if (hFindFile == INVALID_HANDLE_VALUE) {
- int error = GetLastError();
- if (error == ERROR_FILE_NOT_FOUND) {
- free(wnamebuf);
- return d;
+ Py_DECREF(d);
+ win32_error_unicode("FindFirstFileW", wnamebuf);
+ free(wnamebuf);
+ return NULL;
+ }
+ do {
+ /* Skip over . and .. */
+ if (wcscmp(wFileData.cFileName, L".") != 0 &&
+ wcscmp(wFileData.cFileName, L"..") != 0) {
+ v = PyUnicode_FromUnicode(wFileData.cFileName, wcslen(wFileData.cFileName));
+ if (v == NULL) {
+ Py_DECREF(d);
+ d = NULL;
+ break;
}
- Py_DECREF(d);
- win32_error_unicode("FindFirstFileW", wnamebuf);
- free(wnamebuf);
- return NULL;
- }
- do {
- /* Skip over . and .. */
- if (wcscmp(wFileData.cFileName, L".") != 0 &&
- wcscmp(wFileData.cFileName, L"..") != 0) {
- v = PyUnicode_FromUnicode(wFileData.cFileName, wcslen(wFileData.cFileName));
- if (v == NULL) {
- Py_DECREF(d);
- d = NULL;
- break;
- }
- if (PyList_Append(d, v) != 0) {
- Py_DECREF(v);
- Py_DECREF(d);
- d = NULL;
- break;
- }
+ if (PyList_Append(d, v) != 0) {
Py_DECREF(v);
- }
- Py_BEGIN_ALLOW_THREADS
- result = FindNextFileW(hFindFile, &wFileData);
- Py_END_ALLOW_THREADS
- /* FindNextFile sets error to ERROR_NO_MORE_FILES if
- it got to the end of the directory. */
- if (!result && GetLastError() != ERROR_NO_MORE_FILES) {
Py_DECREF(d);
- win32_error_unicode("FindNextFileW", wnamebuf);
- FindClose(hFindFile);
- free(wnamebuf);
- return NULL;
+ d = NULL;
+ break;
}
- } while (result == TRUE);
-
- if (FindClose(hFindFile) == FALSE) {
+ Py_DECREF(v);
+ }
+ Py_BEGIN_ALLOW_THREADS
+ result = FindNextFileW(hFindFile, &wFileData);
+ Py_END_ALLOW_THREADS
+ /* FindNextFile sets error to ERROR_NO_MORE_FILES if
+ it got to the end of the directory. */
+ if (!result && GetLastError() != ERROR_NO_MORE_FILES) {
Py_DECREF(d);
- win32_error_unicode("FindClose", wnamebuf);
+ win32_error_unicode("FindNextFileW", wnamebuf);
+ FindClose(hFindFile);
free(wnamebuf);
return NULL;
}
+ } while (result == TRUE);
+
+ if (FindClose(hFindFile) == FALSE) {
+ Py_DECREF(d);
+ win32_error_unicode("FindClose", wnamebuf);
free(wnamebuf);
- return d;
+ return NULL;
}
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
+ free(wnamebuf);
+ return d;
}
+ /* Drop the argument parsing error as narrow strings
+ are also valid. */
+ PyErr_Clear();
if (!PyArg_ParseTuple(args, "O&:listdir",
PyUnicode_FSConverter, &opath))
return NULL;
- if (PyObject_Size(opath)+1 > MAX_PATH) {
+ if (PyBytes_GET_SIZE(opath)+1 > MAX_PATH) {
PyErr_SetString(PyExc_ValueError, "path too long");
Py_DECREF(opath);
return NULL;
}
- strcpy(namebuf, bytes2str(opath, 0));
+ strcpy(namebuf, PyBytes_AsString(opath));
len = PyObject_Size(opath);
+ Py_DECREF(opath);
if (len > 0) {
char ch = namebuf[len-1];
if (ch != SEP && ch != ALTSEP && ch != ':')
@@ -2417,10 +2510,10 @@ posix_listdir(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O&:listdir",
PyUnicode_FSConverter, &oname))
return NULL;
- name = bytes2str(oname);
- len = PyObject_Size(oname);
+ name = PyBytes_AsString(oname);
+ len = PyBytes_GET_SIZE(oname);
if (len >= MAX_PATH) {
- release_bytes(oname);
+ Py_DECREF(oname);
PyErr_SetString(PyExc_ValueError, "path too long");
return NULL;
}
@@ -2433,7 +2526,7 @@ posix_listdir(PyObject *self, PyObject *args)
strcpy(namebuf + len, "*.*");
if ((d = PyList_New(0)) == NULL) {
- release_bytes(oname);
+ Py_DECREF(oname);
return NULL;
}
@@ -2476,7 +2569,7 @@ posix_listdir(PyObject *self, PyObject *args)
} while (DosFindNext(hdir, &ep, sizeof(ep), &srchcnt) == NO_ERROR && srchcnt > 0);
}
- release_bytes(oname);
+ Py_DECREF(oname);
return d;
#else
PyObject *oname;
@@ -2487,13 +2580,18 @@ posix_listdir(PyObject *self, PyObject *args)
int arg_is_unicode = 1;
errno = 0;
- if (!PyArg_ParseTuple(args, "U:listdir", &v)) {
+ /* v is never read, so it does not need to be initialized yet. */
+ if (!PyArg_ParseTuple(args, "|U:listdir", &v)) {
arg_is_unicode = 0;
PyErr_Clear();
}
- if (!PyArg_ParseTuple(args, "O&:listdir", PyUnicode_FSConverter, &oname))
+ oname = NULL;
+ if (!PyArg_ParseTuple(args, "|O&:listdir", PyUnicode_FSConverter, &oname))
return NULL;
- name = bytes2str(oname, 1);
+ if (oname == NULL) { /* Default arg: "." */
+ oname = PyBytes_FromString(".");
+ }
+ name = PyBytes_AsString(oname);
Py_BEGIN_ALLOW_THREADS
dirp = opendir(name);
Py_END_ALLOW_THREADS
@@ -2504,7 +2602,7 @@ posix_listdir(PyObject *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS
closedir(dirp);
Py_END_ALLOW_THREADS
- release_bytes(oname);
+ Py_DECREF(oname);
return NULL;
}
for (;;) {
@@ -2527,33 +2625,17 @@ posix_listdir(PyObject *self, PyObject *args)
(NAMLEN(ep) == 1 ||
(ep->d_name[1] == '.' && NAMLEN(ep) == 2)))
continue;
- v = PyBytes_FromStringAndSize(ep->d_name, NAMLEN(ep));
+ if (arg_is_unicode)
+ v = PyUnicode_DecodeFSDefaultAndSize(ep->d_name, NAMLEN(ep));
+ else
+ v = PyBytes_FromStringAndSize(ep->d_name, NAMLEN(ep));
if (v == NULL) {
- Py_DECREF(d);
- d = NULL;
+ Py_CLEAR(d);
break;
}
- if (arg_is_unicode) {
- PyObject *w;
-
- w = PyUnicode_FromEncodedObject(v,
- Py_FileSystemDefaultEncoding,
- "surrogateescape");
- Py_DECREF(v);
- if (w != NULL)
- v = w;
- else {
- /* Encoding failed to decode ASCII bytes.
- Raise exception. */
- Py_DECREF(d);
- d = NULL;
- break;
- }
- }
if (PyList_Append(d, v) != 0) {
Py_DECREF(v);
- Py_DECREF(d);
- d = NULL;
+ Py_CLEAR(d);
break;
}
Py_DECREF(v);
@@ -2561,7 +2643,7 @@ posix_listdir(PyObject *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS
closedir(dirp);
Py_END_ALLOW_THREADS
- release_bytes(oname);
+ Py_DECREF(oname);
return d;
@@ -2578,53 +2660,165 @@ posix__getfullpathname(PyObject *self, PyObject *args)
char outbuf[MAX_PATH*2];
char *temp;
#ifdef MS_WINDOWS
- if (unicode_file_names()) {
- PyUnicodeObject *po;
- if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) {
- Py_UNICODE *wpath = PyUnicode_AS_UNICODE(po);
- Py_UNICODE woutbuf[MAX_PATH*2], *woutbufp = woutbuf;
- Py_UNICODE *wtemp;
- DWORD result;
- PyObject *v;
- result = GetFullPathNameW(wpath,
- sizeof(woutbuf)/sizeof(woutbuf[0]),
- woutbuf, &wtemp);
- if (result > sizeof(woutbuf)/sizeof(woutbuf[0])) {
- woutbufp = malloc(result * sizeof(Py_UNICODE));
- if (!woutbufp)
- return PyErr_NoMemory();
- result = GetFullPathNameW(wpath, result, woutbufp, &wtemp);
- }
- if (result)
- v = PyUnicode_FromUnicode(woutbufp, wcslen(woutbufp));
- else
- v = win32_error_unicode("GetFullPathNameW", wpath);
- if (woutbufp != woutbuf)
- free(woutbufp);
- return v;
+ PyUnicodeObject *po;
+ if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) {
+ Py_UNICODE *wpath = PyUnicode_AS_UNICODE(po);
+ Py_UNICODE woutbuf[MAX_PATH*2], *woutbufp = woutbuf;
+ Py_UNICODE *wtemp;
+ DWORD result;
+ PyObject *v;
+ result = GetFullPathNameW(wpath,
+ sizeof(woutbuf)/sizeof(woutbuf[0]),
+ woutbuf, &wtemp);
+ if (result > sizeof(woutbuf)/sizeof(woutbuf[0])) {
+ woutbufp = malloc(result * sizeof(Py_UNICODE));
+ if (!woutbufp)
+ return PyErr_NoMemory();
+ result = GetFullPathNameW(wpath, result, woutbufp, &wtemp);
}
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
+ if (result)
+ v = PyUnicode_FromUnicode(woutbufp, wcslen(woutbufp));
+ else
+ v = win32_error_unicode("GetFullPathNameW", wpath);
+ if (woutbufp != woutbuf)
+ free(woutbufp);
+ return v;
}
+ /* Drop the argument parsing error as narrow strings
+ are also valid. */
+ PyErr_Clear();
+
#endif
if (!PyArg_ParseTuple (args, "O&:_getfullpathname",
PyUnicode_FSConverter, &opath))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
if (!GetFullPathName(path, sizeof(outbuf)/sizeof(outbuf[0]),
outbuf, &temp)) {
win32_error("GetFullPathName", path);
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
- release_bytes(opath);
+ Py_DECREF(opath);
if (PyUnicode_Check(PyTuple_GetItem(args, 0))) {
return PyUnicode_Decode(outbuf, strlen(outbuf),
Py_FileSystemDefaultEncoding, NULL);
}
return PyBytes_FromString(outbuf);
} /* end of posix__getfullpathname */
+
+/* Grab GetFinalPathNameByHandle dynamically from kernel32 */
+static int has_GetFinalPathNameByHandle = 0;
+static DWORD (CALLBACK *Py_GetFinalPathNameByHandleA)(HANDLE, LPSTR, DWORD,
+ DWORD);
+static DWORD (CALLBACK *Py_GetFinalPathNameByHandleW)(HANDLE, LPWSTR, DWORD,
+ DWORD);
+static int
+check_GetFinalPathNameByHandle()
+{
+ HINSTANCE hKernel32;
+ /* only recheck */
+ if (!has_GetFinalPathNameByHandle)
+ {
+ hKernel32 = GetModuleHandle("KERNEL32");
+ *(FARPROC*)&Py_GetFinalPathNameByHandleA = GetProcAddress(hKernel32,
+ "GetFinalPathNameByHandleA");
+ *(FARPROC*)&Py_GetFinalPathNameByHandleW = GetProcAddress(hKernel32,
+ "GetFinalPathNameByHandleW");
+ has_GetFinalPathNameByHandle = Py_GetFinalPathNameByHandleA &&
+ Py_GetFinalPathNameByHandleW;
+ }
+ return has_GetFinalPathNameByHandle;
+}
+
+/* A helper function for samepath on windows */
+static PyObject *
+posix__getfinalpathname(PyObject *self, PyObject *args)
+{
+ HANDLE hFile;
+ int buf_size;
+ wchar_t *target_path;
+ int result_length;
+ PyObject *result;
+ wchar_t *path;
+
+ if (!PyArg_ParseTuple(args, "u|:_getfinalpathname", &path)) {
+ return NULL;
+ }
+
+ if(!check_GetFinalPathNameByHandle()) {
+ /* If the OS doesn't have GetFinalPathNameByHandle, return a
+ NotImplementedError. */
+ return PyErr_Format(PyExc_NotImplementedError,
+ "GetFinalPathNameByHandle not available on this platform");
+ }
+
+ hFile = CreateFileW(
+ path,
+ 0, /* desired access */
+ 0, /* share mode */
+ NULL, /* security attributes */
+ OPEN_EXISTING,
+ /* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */
+ FILE_FLAG_BACKUP_SEMANTICS,
+ NULL);
+
+ if(hFile == INVALID_HANDLE_VALUE) {
+ return win32_error_unicode("GetFinalPathNamyByHandle", path);
+ return PyErr_Format(PyExc_RuntimeError,
+ "Could not get a handle to file.");
+ }
+
+ /* We have a good handle to the target, use it to determine the
+ target path name. */
+ buf_size = Py_GetFinalPathNameByHandleW(hFile, 0, 0, VOLUME_NAME_NT);
+
+ if(!buf_size)
+ return win32_error_unicode("GetFinalPathNameByHandle", path);
+
+ target_path = (wchar_t *)malloc((buf_size+1)*sizeof(wchar_t));
+ if(!target_path)
+ return PyErr_NoMemory();
+
+ result_length = Py_GetFinalPathNameByHandleW(hFile, target_path,
+ buf_size, VOLUME_NAME_DOS);
+ if(!result_length)
+ return win32_error_unicode("GetFinalPathNamyByHandle", path);
+
+ if(!CloseHandle(hFile))
+ return win32_error_unicode("GetFinalPathNameByHandle", path);
+
+ target_path[result_length] = 0;
+ result = PyUnicode_FromUnicode(target_path, result_length);
+ free(target_path);
+ return result;
+
+} /* end of posix__getfinalpathname */
+
+static PyObject *
+posix__getfileinformation(PyObject *self, PyObject *args)
+{
+ HANDLE hFile;
+ BY_HANDLE_FILE_INFORMATION info;
+ int fd;
+
+ if (!PyArg_ParseTuple(args, "i:_getfileinformation", &fd))
+ return NULL;
+
+ if (!_PyVerify_fd(fd))
+ return posix_error();
+
+ hFile = (HANDLE)_get_osfhandle(fd);
+ if (hFile == INVALID_HANDLE_VALUE)
+ return posix_error();
+
+ if (!GetFileInformationByHandle(hFile, &info))
+ return win32_error("_getfileinformation", NULL);
+
+ return Py_BuildValue("iii", info.dwVolumeSerialNumber,
+ info.nFileIndexHigh,
+ info.nFileIndexLow);
+}
#endif /* MS_WINDOWS */
PyDoc_STRVAR(posix_mkdir__doc__,
@@ -2640,27 +2834,25 @@ posix_mkdir(PyObject *self, PyObject *args)
int mode = 0777;
#ifdef MS_WINDOWS
- if (unicode_file_names()) {
- PyUnicodeObject *po;
- if (PyArg_ParseTuple(args, "U|i:mkdir", &po, &mode)) {
- Py_BEGIN_ALLOW_THREADS
- /* PyUnicode_AS_UNICODE OK without thread lock as
- it is a simple dereference. */
- res = CreateDirectoryW(PyUnicode_AS_UNICODE(po), NULL);
- Py_END_ALLOW_THREADS
- if (!res)
- return win32_error_unicode("mkdir", PyUnicode_AS_UNICODE(po));
- Py_INCREF(Py_None);
- return Py_None;
- }
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
+ PyUnicodeObject *po;
+ if (PyArg_ParseTuple(args, "U|i:mkdir", &po, &mode)) {
+ Py_BEGIN_ALLOW_THREADS
+ /* PyUnicode_AS_UNICODE OK without thread lock as
+ it is a simple dereference. */
+ res = CreateDirectoryW(PyUnicode_AS_UNICODE(po), NULL);
+ Py_END_ALLOW_THREADS
+ if (!res)
+ return win32_error_unicode("mkdir", PyUnicode_AS_UNICODE(po));
+ Py_INCREF(Py_None);
+ return Py_None;
}
+ /* Drop the argument parsing error as narrow strings
+ are also valid. */
+ PyErr_Clear();
if (!PyArg_ParseTuple(args, "O&|i:mkdir",
PyUnicode_FSConverter, &opath, &mode))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
/* PyUnicode_AS_UNICODE OK without thread lock as
it is a simple dereference. */
@@ -2668,10 +2860,10 @@ posix_mkdir(PyObject *self, PyObject *args)
Py_END_ALLOW_THREADS
if (!res) {
win32_error("mkdir", path);
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
- release_bytes(opath);
+ Py_DECREF(opath);
Py_INCREF(Py_None);
return Py_None;
#else
@@ -2679,7 +2871,7 @@ posix_mkdir(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O&|i:mkdir",
PyUnicode_FSConverter, &opath, &mode))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
Py_BEGIN_ALLOW_THREADS
#if ( defined(__WATCOMC__) || defined(PYCC_VACPP) ) && !defined(__QNX__)
res = mkdir(path);
@@ -2689,7 +2881,7 @@ posix_mkdir(PyObject *self, PyObject *args)
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(opath);
- release_bytes(opath);
+ Py_DECREF(opath);
Py_INCREF(Py_None);
return Py_None;
#endif
@@ -2749,28 +2941,26 @@ posix_rename(PyObject *self, PyObject *args)
PyObject *o1, *o2;
char *p1, *p2;
BOOL result;
- if (unicode_file_names()) {
- if (!PyArg_ParseTuple(args, "OO:rename", &o1, &o2))
+ if (!PyArg_ParseTuple(args, "OO:rename", &o1, &o2))
goto error;
- if (!convert_to_unicode(&o1))
+ if (!convert_to_unicode(&o1))
goto error;
- if (!convert_to_unicode(&o2)) {
+ if (!convert_to_unicode(&o2)) {
Py_DECREF(o1);
goto error;
- }
- Py_BEGIN_ALLOW_THREADS
- result = MoveFileW(PyUnicode_AsUnicode(o1),
- PyUnicode_AsUnicode(o2));
- Py_END_ALLOW_THREADS
- Py_DECREF(o1);
- Py_DECREF(o2);
- if (!result)
- return win32_error("rename", NULL);
- Py_INCREF(Py_None);
- return Py_None;
-error:
- PyErr_Clear();
}
+ Py_BEGIN_ALLOW_THREADS
+ result = MoveFileW(PyUnicode_AsUnicode(o1),
+ PyUnicode_AsUnicode(o2));
+ Py_END_ALLOW_THREADS
+ Py_DECREF(o1);
+ Py_DECREF(o2);
+ if (!result)
+ return win32_error("rename", NULL);
+ Py_INCREF(Py_None);
+ return Py_None;
+error:
+ PyErr_Clear();
if (!PyArg_ParseTuple(args, "ss:rename", &p1, &p2))
return NULL;
Py_BEGIN_ALLOW_THREADS
@@ -2809,7 +2999,7 @@ static PyObject *
posix_stat(PyObject *self, PyObject *args)
{
#ifdef MS_WINDOWS
- return posix_do_stat(self, args, "O&:stat", STAT, "U:stat", win32_wstat);
+ return posix_do_stat(self, args, "O&:stat", STAT, "U:stat", win32_stat_w);
#else
return posix_do_stat(self, args, "O&:stat", STAT, NULL, NULL);
#endif
@@ -2840,11 +3030,11 @@ posix_system(PyObject *self, PyObject *args)
PyUnicode_FSConverter, &command_obj))
return NULL;
- command = bytes2str(command_obj, 1);
+ command = PyBytes_AsString(command_obj);
Py_BEGIN_ALLOW_THREADS
sts = system(command);
Py_END_ALLOW_THREADS
- release_bytes(command_obj);
+ Py_DECREF(command_obj);
#endif
return PyLong_FromLong(sts);
}
@@ -2867,6 +3057,41 @@ posix_umask(PyObject *self, PyObject *args)
return PyLong_FromLong((long)i);
}
+#ifdef MS_WINDOWS
+
+/* override the default DeleteFileW behavior so that directory
+symlinks can be removed with this function, the same as with
+Unix symlinks */
+BOOL WINAPI Py_DeleteFileW(LPCWSTR lpFileName)
+{
+ WIN32_FILE_ATTRIBUTE_DATA info;
+ WIN32_FIND_DATAW find_data;
+ HANDLE find_data_handle;
+ int is_directory = 0;
+ int is_link = 0;
+
+ if (GetFileAttributesExW(lpFileName, GetFileExInfoStandard, &info)) {
+ is_directory = info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+
+ /* Get WIN32_FIND_DATA structure for the path to determine if
+ it is a symlink */
+ if(is_directory &&
+ info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ find_data_handle = FindFirstFileW(lpFileName, &find_data);
+
+ if(find_data_handle != INVALID_HANDLE_VALUE) {
+ is_link = find_data.dwReserved0 == IO_REPARSE_TAG_SYMLINK;
+ FindClose(find_data_handle);
+ }
+ }
+ }
+
+ if (is_directory && is_link)
+ return RemoveDirectoryW(lpFileName);
+
+ return DeleteFileW(lpFileName);
+}
+#endif /* MS_WINDOWS */
PyDoc_STRVAR(posix_unlink__doc__,
"unlink(path)\n\n\
@@ -2880,7 +3105,8 @@ static PyObject *
posix_unlink(PyObject *self, PyObject *args)
{
#ifdef MS_WINDOWS
- return win32_1str(args, "remove", "y:remove", DeleteFileA, "U:remove", DeleteFileW);
+ return win32_1str(args, "remove", "y:remove", DeleteFileA,
+ "U:remove", Py_DeleteFileW);
#else
return posix_1str(args, "O&:remove", unlink);
#endif
@@ -2970,26 +3196,25 @@ posix_utime(PyObject *self, PyObject *args)
FILETIME atime, mtime;
PyObject *result = NULL;
- if (unicode_file_names()) {
- if (PyArg_ParseTuple(args, "UO|:utime", &obwpath, &arg)) {
- wpath = PyUnicode_AS_UNICODE(obwpath);
- Py_BEGIN_ALLOW_THREADS
- hFile = CreateFileW(wpath, FILE_WRITE_ATTRIBUTES, 0,
- NULL, OPEN_EXISTING,
- FILE_FLAG_BACKUP_SEMANTICS, NULL);
- Py_END_ALLOW_THREADS
- if (hFile == INVALID_HANDLE_VALUE)
- return win32_error_unicode("utime", wpath);
- } else
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
- }
+ if (PyArg_ParseTuple(args, "UO|:utime", &obwpath, &arg)) {
+ wpath = PyUnicode_AS_UNICODE(obwpath);
+ Py_BEGIN_ALLOW_THREADS
+ hFile = CreateFileW(wpath, FILE_WRITE_ATTRIBUTES, 0,
+ NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ Py_END_ALLOW_THREADS
+ if (hFile == INVALID_HANDLE_VALUE)
+ return win32_error_unicode("utime", wpath);
+ } else
+ /* Drop the argument parsing error as narrow strings
+ are also valid. */
+ PyErr_Clear();
+
if (!wpath) {
if (!PyArg_ParseTuple(args, "O&O:utime",
PyUnicode_FSConverter, &oapath, &arg))
return NULL;
- apath = bytes2str(oapath, 1);
+ apath = PyBytes_AsString(oapath);
Py_BEGIN_ALLOW_THREADS
hFile = CreateFileA(apath, FILE_WRITE_ATTRIBUTES, 0,
NULL, OPEN_EXISTING,
@@ -2997,10 +3222,10 @@ posix_utime(PyObject *self, PyObject *args)
Py_END_ALLOW_THREADS
if (hFile == INVALID_HANDLE_VALUE) {
win32_error("utime", apath);
- release_bytes(oapath);
+ Py_DECREF(oapath);
return NULL;
}
- release_bytes(oapath);
+ Py_DECREF(oapath);
}
if (arg == Py_None) {
@@ -3070,7 +3295,7 @@ done:
if (!PyArg_ParseTuple(args, "O&O:utime",
PyUnicode_FSConverter, &opath, &arg))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
if (arg == Py_None) {
/* optional time values not given */
Py_BEGIN_ALLOW_THREADS
@@ -3080,18 +3305,18 @@ done:
else if (!PyTuple_Check(arg) || PyTuple_Size(arg) != 2) {
PyErr_SetString(PyExc_TypeError,
"utime() arg 2 must be a tuple (atime, mtime)");
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
else {
if (extract_time(PyTuple_GET_ITEM(arg, 0),
&atime, &ausec) == -1) {
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
if (extract_time(PyTuple_GET_ITEM(arg, 1),
&mtime, &musec) == -1) {
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
ATIME = atime;
@@ -3111,7 +3336,7 @@ done:
if (res < 0) {
return posix_error_with_allocated_filename(opath);
}
- release_bytes(opath);
+ Py_DECREF(opath);
Py_INCREF(Py_None);
return Py_None;
#undef UTIME_ARG
@@ -3154,12 +3379,11 @@ int fsconvert_strdup(PyObject *o, char**out)
Py_ssize_t size;
if (!PyUnicode_FSConverter(o, &bytes))
return 0;
- size = PyObject_Size(bytes);
+ size = PyBytes_GET_SIZE(bytes);
*out = PyMem_Malloc(size+1);
if (!*out)
return 0;
- /* Don't lock bytes, as we hold the GIL */
- memcpy(*out, bytes2str(bytes, 0), size+1);
+ memcpy(*out, PyBytes_AsString(bytes), size+1);
Py_DECREF(bytes);
return 1;
}
@@ -3191,7 +3415,7 @@ posix_execv(PyObject *self, PyObject *args)
PyUnicode_FSConverter,
&opath, &argv))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
if (PyList_Check(argv)) {
argc = PyList_Size(argv);
getitem = PyList_GetItem;
@@ -3202,18 +3426,18 @@ posix_execv(PyObject *self, PyObject *args)
}
else {
PyErr_SetString(PyExc_TypeError, "execv() arg 2 must be a tuple or list");
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
if (argc < 1) {
PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty");
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
argvlist = PyMem_NEW(char *, argc+1);
if (argvlist == NULL) {
- release_bytes(opath);
+ Py_DECREF(opath);
return PyErr_NoMemory();
}
for (i = 0; i < argc; i++) {
@@ -3222,7 +3446,7 @@ posix_execv(PyObject *self, PyObject *args)
free_string_array(argvlist, i);
PyErr_SetString(PyExc_TypeError,
"execv() arg 2 must contain only strings");
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
@@ -3234,7 +3458,7 @@ posix_execv(PyObject *self, PyObject *args)
/* If we get here it's definitely an error */
free_string_array(argvlist, argc);
- release_bytes(opath);
+ Py_DECREF(opath);
return posix_error();
}
@@ -3347,7 +3571,7 @@ posix_execve(PyObject *self, PyObject *args)
PyUnicode_FSConverter,
&opath, &argv, &env))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
if (PyList_Check(argv)) {
argc = PyList_Size(argv);
getitem = PyList_GetItem;
@@ -3399,7 +3623,7 @@ posix_execve(PyObject *self, PyObject *args)
fail_1:
free_string_array(argvlist, lastarg);
fail_0:
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
#endif /* HAVE_EXECV */
@@ -3433,7 +3657,7 @@ posix_spawnv(PyObject *self, PyObject *args)
PyUnicode_FSConverter,
&opath, &argv))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
if (PyList_Check(argv)) {
argc = PyList_Size(argv);
getitem = PyList_GetItem;
@@ -3445,13 +3669,13 @@ posix_spawnv(PyObject *self, PyObject *args)
else {
PyErr_SetString(PyExc_TypeError,
"spawnv() arg 2 must be a tuple or list");
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
argvlist = PyMem_NEW(char *, argc+1);
if (argvlist == NULL) {
- release_bytes(opath);
+ Py_DECREF(opath);
return PyErr_NoMemory();
}
for (i = 0; i < argc; i++) {
@@ -3461,7 +3685,7 @@ posix_spawnv(PyObject *self, PyObject *args)
PyErr_SetString(
PyExc_TypeError,
"spawnv() arg 2 must contain only strings");
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
}
@@ -3481,7 +3705,7 @@ posix_spawnv(PyObject *self, PyObject *args)
#endif
free_string_array(argvlist, argc);
- release_bytes(opath);
+ Py_DECREF(opath);
if (spawnval == -1)
return posix_error();
@@ -3526,7 +3750,7 @@ posix_spawnve(PyObject *self, PyObject *args)
PyUnicode_FSConverter,
&opath, &argv, &env))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
if (PyList_Check(argv)) {
argc = PyList_Size(argv);
getitem = PyList_GetItem;
@@ -3594,7 +3818,7 @@ posix_spawnve(PyObject *self, PyObject *args)
fail_1:
free_string_array(argvlist, lastarg);
fail_0:
- release_bytes(opath);
+ Py_DECREF(opath);
return res;
}
@@ -3627,7 +3851,7 @@ posix_spawnvp(PyObject *self, PyObject *args)
PyUnicode_FSConverter,
&opath, &argv))
return NULL;
- path = bytes2str(opath);
+ path = PyBytes_AsString(opath);
if (PyList_Check(argv)) {
argc = PyList_Size(argv);
getitem = PyList_GetItem;
@@ -3639,13 +3863,13 @@ posix_spawnvp(PyObject *self, PyObject *args)
else {
PyErr_SetString(PyExc_TypeError,
"spawnvp() arg 2 must be a tuple or list");
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
argvlist = PyMem_NEW(char *, argc+1);
if (argvlist == NULL) {
- release_bytes(opath);
+ Py_DECREF(opath);
return PyErr_NoMemory();
}
for (i = 0; i < argc; i++) {
@@ -3655,7 +3879,7 @@ posix_spawnvp(PyObject *self, PyObject *args)
PyErr_SetString(
PyExc_TypeError,
"spawnvp() arg 2 must contain only strings");
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
}
@@ -3670,7 +3894,7 @@ posix_spawnvp(PyObject *self, PyObject *args)
Py_END_ALLOW_THREADS
free_string_array(argvlist, argc);
- release_bytes(opath);
+ Py_DECREF(opath);
if (spawnval == -1)
return posix_error();
@@ -3712,7 +3936,7 @@ posix_spawnvpe(PyObject *self, PyObject *args)
PyUnicode_FSConverter,
&opath, &argv, &env))
return NULL;
- path = bytes2str(opath);
+ path = PyBytes_AsString(opath);
if (PyList_Check(argv)) {
argc = PyList_Size(argv);
getitem = PyList_GetItem;
@@ -3771,7 +3995,7 @@ posix_spawnvpe(PyObject *self, PyObject *args)
fail_1:
free_string_array(argvlist, lastarg);
fail_0:
- release_bytes(opath);
+ Py_DECREF(opath);
return res;
}
#endif /* PYOS_OS2 */
@@ -3789,14 +4013,18 @@ static PyObject *
posix_fork1(PyObject *self, PyObject *noargs)
{
pid_t pid;
- int result;
+ int result = 0;
_PyImport_AcquireLock();
pid = fork1();
- result = _PyImport_ReleaseLock();
+ if (pid == 0) {
+ /* child: this clobbers and resets the import lock. */
+ PyOS_AfterFork();
+ } else {
+ /* parent: release the import lock. */
+ result = _PyImport_ReleaseLock();
+ }
if (pid == -1)
return posix_error();
- if (pid == 0)
- PyOS_AfterFork();
if (result < 0) {
/* Don't clobber the OSError if the fork failed. */
PyErr_SetString(PyExc_RuntimeError,
@@ -3818,14 +4046,18 @@ static PyObject *
posix_fork(PyObject *self, PyObject *noargs)
{
pid_t pid;
- int result;
+ int result = 0;
_PyImport_AcquireLock();
pid = fork();
- result = _PyImport_ReleaseLock();
+ if (pid == 0) {
+ /* child: this clobbers and resets the import lock. */
+ PyOS_AfterFork();
+ } else {
+ /* parent: release the import lock. */
+ result = _PyImport_ReleaseLock();
+ }
if (pid == -1)
return posix_error();
- if (pid == 0)
- PyOS_AfterFork();
if (result < 0) {
/* Don't clobber the OSError if the fork failed. */
PyErr_SetString(PyExc_RuntimeError,
@@ -3851,6 +4083,10 @@ posix_fork(PyObject *self, PyObject *noargs)
#else
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
+#else
+#ifdef HAVE_UTIL_H
+#include <util.h>
+#endif /* HAVE_UTIL_H */
#endif /* HAVE_LIBUTIL_H */
#endif /* HAVE_PTY_H */
#ifdef HAVE_STROPTS_H
@@ -3934,16 +4170,20 @@ To both, return fd of newly opened pseudo-terminal.\n");
static PyObject *
posix_forkpty(PyObject *self, PyObject *noargs)
{
- int master_fd = -1, result;
+ int master_fd = -1, result = 0;
pid_t pid;
_PyImport_AcquireLock();
pid = forkpty(&master_fd, NULL, NULL, NULL);
- result = _PyImport_ReleaseLock();
+ if (pid == 0) {
+ /* child: this clobbers and resets the import lock. */
+ PyOS_AfterFork();
+ } else {
+ /* parent: release the import lock. */
+ result = _PyImport_ReleaseLock();
+ }
if (pid == -1)
return posix_error();
- if (pid == 0)
- PyOS_AfterFork();
if (result < 0) {
/* Don't clobber the OSError if the fork failed. */
PyErr_SetString(PyExc_RuntimeError,
@@ -4081,6 +4321,36 @@ posix_getgroups(PyObject *self, PyObject *noargs)
}
#endif
+#ifdef HAVE_INITGROUPS
+PyDoc_STRVAR(posix_initgroups__doc__,
+"initgroups(username, gid) -> None\n\n\
+Call the system initgroups() to initialize the group access list with all of\n\
+the groups of which the specified username is a member, plus the specified\n\
+group id.");
+
+static PyObject *
+posix_initgroups(PyObject *self, PyObject *args)
+{
+ PyObject *oname;
+ char *username;
+ int res;
+ long gid;
+
+ if (!PyArg_ParseTuple(args, "O&l:initgroups",
+ PyUnicode_FSConverter, &oname, &gid))
+ return NULL;
+ username = PyBytes_AS_STRING(oname);
+
+ res = initgroups(username, (gid_t) gid);
+ Py_DECREF(oname);
+ if (res == -1)
+ return PyErr_SetFromErrno(PyExc_OSError);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+#endif
+
#ifdef HAVE_GETPGID
PyDoc_STRVAR(posix_getpgid__doc__,
"getpgid(pid) -> pgid\n\n\
@@ -4090,7 +4360,7 @@ static PyObject *
posix_getpgid(PyObject *self, PyObject *args)
{
pid_t pid, pgid;
- if (!PyArg_ParseTuple(args, PARSE_PID ":getpgid", &pid))
+ if (!PyArg_ParseTuple(args, _Py_PARSE_PID ":getpgid", &pid))
return NULL;
pgid = getpgid(pid);
if (pgid < 0)
@@ -4138,16 +4408,65 @@ posix_setpgrp(PyObject *self, PyObject *noargs)
#endif /* HAVE_SETPGRP */
#ifdef HAVE_GETPPID
+
+#ifdef MS_WINDOWS
+#include <tlhelp32.h>
+
+static PyObject*
+win32_getppid()
+{
+ HANDLE snapshot;
+ pid_t mypid;
+ PyObject* result = NULL;
+ BOOL have_record;
+ PROCESSENTRY32 pe;
+
+ mypid = getpid(); /* This function never fails */
+
+ snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ if (snapshot == INVALID_HANDLE_VALUE)
+ return PyErr_SetFromWindowsErr(GetLastError());
+
+ pe.dwSize = sizeof(pe);
+ have_record = Process32First(snapshot, &pe);
+ while (have_record) {
+ if (mypid == (pid_t)pe.th32ProcessID) {
+ /* We could cache the ulong value in a static variable. */
+ result = PyLong_FromPid((pid_t)pe.th32ParentProcessID);
+ break;
+ }
+
+ have_record = Process32Next(snapshot, &pe);
+ }
+
+ /* If our loop exits and our pid was not found (result will be NULL)
+ * then GetLastError will return ERROR_NO_MORE_FILES. This is an
+ * error anyway, so let's raise it. */
+ if (!result)
+ result = PyErr_SetFromWindowsErr(GetLastError());
+
+ CloseHandle(snapshot);
+
+ return result;
+}
+#endif /*MS_WINDOWS*/
+
PyDoc_STRVAR(posix_getppid__doc__,
"getppid() -> ppid\n\n\
-Return the parent's process id.");
+Return the parent's process id. If the parent process has already exited,\n\
+Windows machines will still return its id; others systems will return the id\n\
+of the 'init' process (1).");
static PyObject *
posix_getppid(PyObject *self, PyObject *noargs)
{
+#ifdef MS_WINDOWS
+ return win32_getppid();
+#else
return PyLong_FromPid(getppid());
-}
#endif
+}
+#endif /* HAVE_GETPPID */
#ifdef HAVE_GETLOGIN
@@ -4159,6 +4478,17 @@ static PyObject *
posix_getlogin(PyObject *self, PyObject *noargs)
{
PyObject *result = NULL;
+#ifdef MS_WINDOWS
+ wchar_t user_name[UNLEN + 1];
+ DWORD num_chars = sizeof(user_name)/sizeof(user_name[0]);
+
+ if (GetUserNameW(user_name, &num_chars)) {
+ /* num_chars is the number of unicode chars plus null terminator */
+ result = PyUnicode_FromWideChar(user_name, num_chars - 1);
+ }
+ else
+ result = PyErr_SetFromWindowsErr(GetLastError());
+#else
char *name;
int old_errno = errno;
@@ -4173,10 +4503,10 @@ posix_getlogin(PyObject *self, PyObject *noargs)
else
result = PyUnicode_DecodeFSDefault(name);
errno = old_errno;
-
+#endif
return result;
}
-#endif
+#endif /* HAVE_GETLOGIN */
#ifdef HAVE_GETUID
PyDoc_STRVAR(posix_getuid__doc__,
@@ -4201,7 +4531,7 @@ posix_kill(PyObject *self, PyObject *args)
{
pid_t pid;
int sig;
- if (!PyArg_ParseTuple(args, PARSE_PID "i:kill", &pid, &sig))
+ if (!PyArg_ParseTuple(args, _Py_PARSE_PID "i:kill", &pid, &sig))
return NULL;
#if defined(PYOS_OS2) && !defined(PYCC_GCC)
if (sig == XCPT_SIGNAL_INTR || sig == XCPT_SIGNAL_BREAK) {
@@ -4239,7 +4569,7 @@ posix_killpg(PyObject *self, PyObject *args)
a pid_t. Since getpgrp() returns a pid_t, we assume killpg should
take the same type. Moreover, pid_t is always at least as wide as
int (else compilation of this module fails), which is safe. */
- if (!PyArg_ParseTuple(args, PARSE_PID "i:killpg", &pgid, &sig))
+ if (!PyArg_ParseTuple(args, _Py_PARSE_PID "i:killpg", &pgid, &sig))
return NULL;
if (killpg(pgid, sig) == -1)
return posix_error();
@@ -4248,6 +4578,53 @@ posix_killpg(PyObject *self, PyObject *args)
}
#endif
+#ifdef MS_WINDOWS
+PyDoc_STRVAR(win32_kill__doc__,
+"kill(pid, sig)\n\n\
+Kill a process with a signal.");
+
+static PyObject *
+win32_kill(PyObject *self, PyObject *args)
+{
+ PyObject *result;
+ DWORD pid, sig, err;
+ HANDLE handle;
+
+ if (!PyArg_ParseTuple(args, "kk:kill", &pid, &sig))
+ return NULL;
+
+ /* Console processes which share a common console can be sent CTRL+C or
+ CTRL+BREAK events, provided they handle said events. */
+ if (sig == CTRL_C_EVENT || sig == CTRL_BREAK_EVENT) {
+ if (GenerateConsoleCtrlEvent(sig, pid) == 0) {
+ err = GetLastError();
+ PyErr_SetFromWindowsErr(err);
+ }
+ else
+ Py_RETURN_NONE;
+ }
+
+ /* If the signal is outside of what GenerateConsoleCtrlEvent can use,
+ attempt to open and terminate the process. */
+ handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
+ if (handle == NULL) {
+ err = GetLastError();
+ return PyErr_SetFromWindowsErr(err);
+ }
+
+ if (TerminateProcess(handle, sig) == 0) {
+ err = GetLastError();
+ result = PyErr_SetFromWindowsErr(err);
+ } else {
+ Py_INCREF(Py_None);
+ result = Py_None;
+ }
+
+ CloseHandle(handle);
+ return result;
+}
+#endif /* MS_WINDOWS */
+
#ifdef HAVE_PLOCK
#ifdef HAVE_SYS_LOCK_H
@@ -4596,7 +4973,7 @@ posix_wait4(PyObject *self, PyObject *args)
WAIT_TYPE status;
WAIT_STATUS_INT(status) = 0;
- if (!PyArg_ParseTuple(args, PARSE_PID "i:wait4", &pid, &options))
+ if (!PyArg_ParseTuple(args, _Py_PARSE_PID "i:wait4", &pid, &options))
return NULL;
Py_BEGIN_ALLOW_THREADS
@@ -4620,7 +4997,7 @@ posix_waitpid(PyObject *self, PyObject *args)
WAIT_TYPE status;
WAIT_STATUS_INT(status) = 0;
- if (!PyArg_ParseTuple(args, PARSE_PID "i:waitpid", &pid, &options))
+ if (!PyArg_ParseTuple(args, _Py_PARSE_PID "i:waitpid", &pid, &options))
return NULL;
Py_BEGIN_ALLOW_THREADS
pid = waitpid(pid, &status, options);
@@ -4644,7 +5021,7 @@ posix_waitpid(PyObject *self, PyObject *args)
Py_intptr_t pid;
int status, options;
- if (!PyArg_ParseTuple(args, PARSE_PID "i:waitpid", &pid, &options))
+ if (!PyArg_ParseTuple(args, _Py_PARSE_PID "i:waitpid", &pid, &options))
return NULL;
Py_BEGIN_ALLOW_THREADS
pid = _cwait(&status, pid, options);
@@ -4691,7 +5068,8 @@ posix_lstat(PyObject *self, PyObject *args)
return posix_do_stat(self, args, "O&:lstat", lstat, NULL, NULL);
#else /* !HAVE_LSTAT */
#ifdef MS_WINDOWS
- return posix_do_stat(self, args, "O&:lstat", STAT, "U:lstat", win32_wstat);
+ return posix_do_stat(self, args, "O&:lstat", STAT, "U:lstat",
+ win32_lstat_w);
#else
return posix_do_stat(self, args, "O&:lstat", STAT, NULL, NULL);
#endif
@@ -4717,10 +5095,10 @@ posix_readlink(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O&:readlink",
PyUnicode_FSConverter, &opath))
return NULL;
- path = bytes2str(opath, 1);
+ path = PyBytes_AsString(opath);
v = PySequence_GetItem(args, 0);
if (v == NULL) {
- release_bytes(opath);
+ Py_DECREF(opath);
return NULL;
}
@@ -4735,28 +5113,16 @@ posix_readlink(PyObject *self, PyObject *args)
if (n < 0)
return posix_error_with_allocated_filename(opath);
- release_bytes(opath);
- v = PyBytes_FromStringAndSize(buf, n);
- if (arg_is_unicode) {
- PyObject *w;
-
- w = PyUnicode_FromEncodedObject(v,
- Py_FileSystemDefaultEncoding,
- "surrogateescape");
- if (w != NULL) {
- Py_DECREF(v);
- v = w;
- }
- else {
- v = NULL;
- }
- }
- return v;
+ Py_DECREF(opath);
+ if (arg_is_unicode)
+ return PyUnicode_DecodeFSDefaultAndSize(buf, n);
+ else
+ return PyBytes_FromStringAndSize(buf, n);
}
#endif /* HAVE_READLINK */
-#ifdef HAVE_SYMLINK
+#if defined(HAVE_SYMLINK) && !defined(MS_WINDOWS)
PyDoc_STRVAR(posix_symlink__doc__,
"symlink(src, dst)\n\n\
Create a symbolic link pointing to src named dst.");
@@ -4768,6 +5134,165 @@ posix_symlink(PyObject *self, PyObject *args)
}
#endif /* HAVE_SYMLINK */
+#if !defined(HAVE_READLINK) && defined(MS_WINDOWS)
+
+PyDoc_STRVAR(win_readlink__doc__,
+"readlink(path) -> path\n\n\
+Return a string representing the path to which the symbolic link points.");
+
+/* Windows readlink implementation */
+static PyObject *
+win_readlink(PyObject *self, PyObject *args)
+{
+ wchar_t *path;
+ DWORD n_bytes_returned;
+ DWORD io_result;
+ PyObject *result;
+ HANDLE reparse_point_handle;
+
+ char target_buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
+ REPARSE_DATA_BUFFER *rdb = (REPARSE_DATA_BUFFER *)target_buffer;
+ wchar_t *print_name;
+
+ if (!PyArg_ParseTuple(args,
+ "u:readlink",
+ &path))
+ return NULL;
+
+ /* First get a handle to the reparse point */
+ Py_BEGIN_ALLOW_THREADS
+ reparse_point_handle = CreateFileW(
+ path,
+ 0,
+ 0,
+ 0,
+ OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS,
+ 0);
+ Py_END_ALLOW_THREADS
+
+ if (reparse_point_handle==INVALID_HANDLE_VALUE)
+ {
+ return win32_error_unicode("readlink", path);
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ /* New call DeviceIoControl to read the reparse point */
+ io_result = DeviceIoControl(
+ reparse_point_handle,
+ FSCTL_GET_REPARSE_POINT,
+ 0, 0, /* in buffer */
+ target_buffer, sizeof(target_buffer),
+ &n_bytes_returned,
+ 0 /* we're not using OVERLAPPED_IO */
+ );
+ CloseHandle(reparse_point_handle);
+ Py_END_ALLOW_THREADS
+
+ if (io_result==0)
+ {
+ return win32_error_unicode("readlink", path);
+ }
+
+ if (rdb->ReparseTag != IO_REPARSE_TAG_SYMLINK)
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "not a symbolic link");
+ return NULL;
+ }
+ print_name = rdb->SymbolicLinkReparseBuffer.PathBuffer +
+ rdb->SymbolicLinkReparseBuffer.PrintNameOffset;
+
+ result = PyUnicode_FromWideChar(print_name,
+ rdb->SymbolicLinkReparseBuffer.PrintNameLength/2);
+ return result;
+}
+
+#endif /* !defined(HAVE_READLINK) && defined(MS_WINDOWS) */
+
+#if defined(HAVE_SYMLINK) && defined(MS_WINDOWS)
+
+/* Grab CreateSymbolicLinkW dynamically from kernel32 */
+static int has_CreateSymbolicLinkW = 0;
+static DWORD (CALLBACK *Py_CreateSymbolicLinkW)(LPWSTR, LPWSTR, DWORD);
+static int
+check_CreateSymbolicLinkW()
+{
+ HINSTANCE hKernel32;
+ /* only recheck */
+ if (has_CreateSymbolicLinkW)
+ return has_CreateSymbolicLinkW;
+ hKernel32 = GetModuleHandle("KERNEL32");
+ *(FARPROC*)&Py_CreateSymbolicLinkW = GetProcAddress(hKernel32,
+ "CreateSymbolicLinkW");
+ if (Py_CreateSymbolicLinkW)
+ has_CreateSymbolicLinkW = 1;
+ return has_CreateSymbolicLinkW;
+}
+
+PyDoc_STRVAR(win_symlink__doc__,
+"symlink(src, dst, target_is_directory=False)\n\n\
+Create a symbolic link pointing to src named dst.\n\
+target_is_directory is required if the target is to be interpreted as\n\
+a directory.\n\
+This function requires Windows 6.0 or greater, and raises a\n\
+NotImplementedError otherwise.");
+
+static PyObject *
+win_symlink(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = {"src", "dest", "target_is_directory", NULL};
+ PyObject *src, *dest;
+ int target_is_directory = 0;
+ DWORD res;
+ WIN32_FILE_ATTRIBUTE_DATA src_info;
+
+ if (!check_CreateSymbolicLinkW())
+ {
+ /* raise NotImplementedError */
+ return PyErr_Format(PyExc_NotImplementedError,
+ "CreateSymbolicLinkW not found");
+ }
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|i:symlink",
+ kwlist, &src, &dest, &target_is_directory))
+ return NULL;
+
+ if (win32_can_symlink == 0)
+ return PyErr_Format(PyExc_OSError, "symbolic link privilege not held");
+
+ if (!convert_to_unicode(&src)) { return NULL; }
+ if (!convert_to_unicode(&dest)) {
+ Py_DECREF(src);
+ return NULL;
+ }
+
+ /* if src is a directory, ensure target_is_directory==1 */
+ if(
+ GetFileAttributesExW(
+ PyUnicode_AsUnicode(src), GetFileExInfoStandard, &src_info
+ ))
+ {
+ target_is_directory = target_is_directory ||
+ (src_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ res = Py_CreateSymbolicLinkW(
+ PyUnicode_AsUnicode(dest),
+ PyUnicode_AsUnicode(src),
+ target_is_directory);
+ Py_END_ALLOW_THREADS
+ Py_DECREF(src);
+ Py_DECREF(dest);
+ if (!res)
+ {
+ return win32_error_unicode("symlink", PyUnicode_AsUnicode(src));
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+#endif /* defined(HAVE_SYMLINK) && defined(MS_WINDOWS) */
#ifdef HAVE_TIMES
#if defined(PYCC_VACPP) && defined(PYOS_OS2)
@@ -4860,7 +5385,7 @@ posix_getsid(PyObject *self, PyObject *args)
{
pid_t pid;
int sid;
- if (!PyArg_ParseTuple(args, PARSE_PID ":getsid", &pid))
+ if (!PyArg_ParseTuple(args, _Py_PARSE_PID ":getsid", &pid))
return NULL;
sid = getsid(pid);
if (sid < 0)
@@ -4895,7 +5420,7 @@ posix_setpgid(PyObject *self, PyObject *args)
{
pid_t pid;
int pgrp;
- if (!PyArg_ParseTuple(args, PARSE_PID "i:setpgid", &pid, &pgrp))
+ if (!PyArg_ParseTuple(args, _Py_PARSE_PID "i:setpgid", &pid, &pgrp))
return NULL;
if (setpgid(pid, pgrp) < 0)
return posix_error();
@@ -4935,7 +5460,7 @@ posix_tcsetpgrp(PyObject *self, PyObject *args)
{
int fd;
pid_t pgid;
- if (!PyArg_ParseTuple(args, "i" PARSE_PID ":tcsetpgrp", &fd, &pgid))
+ if (!PyArg_ParseTuple(args, "i" _Py_PARSE_PID ":tcsetpgrp", &fd, &pgid))
return NULL;
if (tcsetpgrp(fd, pgid) < 0)
return posix_error();
@@ -4960,35 +5485,33 @@ posix_open(PyObject *self, PyObject *args)
int fd;
#ifdef MS_WINDOWS
- if (unicode_file_names()) {
- PyUnicodeObject *po;
- if (PyArg_ParseTuple(args, "Ui|i:mkdir", &po, &flag, &mode)) {
- Py_BEGIN_ALLOW_THREADS
- /* PyUnicode_AS_UNICODE OK without thread
- lock as it is a simple dereference. */
- fd = _wopen(PyUnicode_AS_UNICODE(po), flag, mode);
- Py_END_ALLOW_THREADS
- if (fd < 0)
- return posix_error();
- return PyLong_FromLong((long)fd);
- }
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
+ PyUnicodeObject *po;
+ if (PyArg_ParseTuple(args, "Ui|i:mkdir", &po, &flag, &mode)) {
+ Py_BEGIN_ALLOW_THREADS
+ /* PyUnicode_AS_UNICODE OK without thread
+ lock as it is a simple dereference. */
+ fd = _wopen(PyUnicode_AS_UNICODE(po), flag, mode);
+ Py_END_ALLOW_THREADS
+ if (fd < 0)
+ return posix_error();
+ return PyLong_FromLong((long)fd);
}
+ /* Drop the argument parsing error as narrow strings
+ are also valid. */
+ PyErr_Clear();
#endif
if (!PyArg_ParseTuple(args, "O&i|i",
PyUnicode_FSConverter, &ofile,
&flag, &mode))
return NULL;
- file = bytes2str(ofile, 1);
+ file = PyBytes_AsString(ofile);
Py_BEGIN_ALLOW_THREADS
fd = open(file, flag, mode);
Py_END_ALLOW_THREADS
if (fd < 0)
return posix_error_with_allocated_filename(ofile);
- release_bytes(ofile);
+ Py_DECREF(ofile);
return PyLong_FromLong((long)fd);
}
@@ -5176,7 +5699,7 @@ posix_write(PyObject *self, PyObject *args)
{
Py_buffer pbuf;
int fd;
- Py_ssize_t size;
+ Py_ssize_t size, len;
if (!PyArg_ParseTuple(args, "iy*:write", &fd, &pbuf))
return NULL;
@@ -5184,8 +5707,15 @@ posix_write(PyObject *self, PyObject *args)
PyBuffer_Release(&pbuf);
return posix_error();
}
+ len = pbuf.len;
Py_BEGIN_ALLOW_THREADS
- size = write(fd, pbuf.buf, (size_t)pbuf.len);
+#if defined(MS_WIN64) || defined(MS_WINDOWS)
+ if (len > INT_MAX)
+ len = INT_MAX;
+ size = write(fd, pbuf.buf, (int)len);
+#else
+ size = write(fd, pbuf.buf, len);
+#endif
Py_END_ALLOW_THREADS
PyBuffer_Release(&pbuf);
if (size < 0)
@@ -5448,7 +5978,7 @@ posix_putenv(PyObject *self, PyObject *args)
char *s1, *s2;
char *newenv;
#endif
- PyObject *newstr;
+ PyObject *newstr = NULL;
size_t len;
#ifdef MS_WINDOWS
@@ -5462,8 +5992,8 @@ posix_putenv(PyObject *self, PyObject *args)
PyUnicode_FSConverter, &os1,
PyUnicode_FSConverter, &os2))
return NULL;
- s1 = bytes2str(os1, 1);
- s2 = bytes2str(os2, 1);
+ s1 = PyBytes_AsString(os1);
+ s2 = PyBytes_AsString(os2);
#endif
#if defined(PYOS_OS2)
@@ -5471,15 +6001,19 @@ posix_putenv(PyObject *self, PyObject *args)
APIRET rc;
rc = DosSetExtLIBPATH(s2, BEGIN_LIBPATH);
- if (rc != NO_ERROR)
- return os2_error(rc);
+ if (rc != NO_ERROR) {
+ os2_error(rc);
+ goto error;
+ }
} else if (stricmp(s1, "ENDLIBPATH") == 0) {
APIRET rc;
rc = DosSetExtLIBPATH(s2, END_LIBPATH);
- if (rc != NO_ERROR)
- return os2_error(rc);
+ if (rc != NO_ERROR) {
+ os2_error(rc);
+ goto error;
+ }
} else {
#endif
/* XXX This can leak memory -- not easy to fix :-( */
@@ -5489,36 +6023,40 @@ posix_putenv(PyObject *self, PyObject *args)
len = wcslen(s1) + wcslen(s2) + 2;
newstr = PyUnicode_FromUnicode(NULL, (int)len - 1);
#else
- len = strlen(s1) + strlen(s2) + 2;
+ len = PyBytes_GET_SIZE(os1) + PyBytes_GET_SIZE(os2) + 2;
newstr = PyBytes_FromStringAndSize(NULL, (int)len - 1);
#endif
- if (newstr == NULL)
- return PyErr_NoMemory();
+ if (newstr == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
#ifdef MS_WINDOWS
newenv = PyUnicode_AsUnicode(newstr);
_snwprintf(newenv, len, L"%s=%s", s1, s2);
if (_wputenv(newenv)) {
- Py_DECREF(newstr);
posix_error();
- return NULL;
+ goto error;
}
#else
newenv = PyBytes_AS_STRING(newstr);
PyOS_snprintf(newenv, len, "%s=%s", s1, s2);
if (putenv(newenv)) {
- Py_DECREF(newstr);
- release_bytes(os1);
- release_bytes(os2);
posix_error();
- return NULL;
+ goto error;
}
#endif
+
/* Install the first arg and newstr in posix_putenv_garbage;
* this will cause previous value to be collected. This has to
* happen after the real putenv() call because the old value
* was still accessible until then. */
if (PyDict_SetItem(posix_putenv_garbage,
- PyTuple_GET_ITEM(args, 0), newstr)) {
+#ifdef MS_WINDOWS
+ PyTuple_GET_ITEM(args, 0),
+#else
+ os1,
+#endif
+ newstr)) {
/* really not much we can do; just leak */
PyErr_Clear();
}
@@ -5529,12 +6067,20 @@ posix_putenv(PyObject *self, PyObject *args)
#if defined(PYOS_OS2)
}
#endif
+
#ifndef MS_WINDOWS
- release_bytes(os1);
- release_bytes(os2);
+ Py_DECREF(os1);
+ Py_DECREF(os2);
#endif
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
+
+error:
+#ifndef MS_WINDOWS
+ Py_DECREF(os1);
+ Py_DECREF(os2);
+#endif
+ Py_XDECREF(newstr);
+ return NULL;
}
#endif /* putenv */
@@ -5546,10 +6092,20 @@ Delete an environment variable.");
static PyObject *
posix_unsetenv(PyObject *self, PyObject *args)
{
+#ifdef MS_WINDOWS
char *s1;
if (!PyArg_ParseTuple(args, "s:unsetenv", &s1))
return NULL;
+#else
+ PyObject *os1;
+ char *s1;
+
+ if (!PyArg_ParseTuple(args, "O&:unsetenv",
+ PyUnicode_FSConverter, &os1))
+ return NULL;
+ s1 = PyBytes_AsString(os1);
+#endif
unsetenv(s1);
@@ -5559,13 +6115,20 @@ posix_unsetenv(PyObject *self, PyObject *args)
* old value was still accessible until then.
*/
if (PyDict_DelItem(posix_putenv_garbage,
- PyTuple_GET_ITEM(args, 0))) {
+#ifdef MS_WINDOWS
+ PyTuple_GET_ITEM(args, 0)
+#else
+ os1
+#endif
+ )) {
/* really not much we can do; just leak */
PyErr_Clear();
}
- Py_INCREF(Py_None);
- return Py_None;
+#ifndef MS_WINDOWS
+ Py_DECREF(os1);
+#endif
+ Py_RETURN_NONE;
}
#endif /* unsetenv */
@@ -5948,6 +6511,39 @@ static struct constdef posix_constants_pathconf[] = {
#ifdef _PC_VDISABLE
{"PC_VDISABLE", _PC_VDISABLE},
#endif
+#ifdef _PC_ACL_ENABLED
+ {"PC_ACL_ENABLED", _PC_ACL_ENABLED},
+#endif
+#ifdef _PC_MIN_HOLE_SIZE
+ {"PC_MIN_HOLE_SIZE", _PC_MIN_HOLE_SIZE},
+#endif
+#ifdef _PC_ALLOC_SIZE_MIN
+ {"PC_ALLOC_SIZE_MIN", _PC_ALLOC_SIZE_MIN},
+#endif
+#ifdef _PC_REC_INCR_XFER_SIZE
+ {"PC_REC_INCR_XFER_SIZE", _PC_REC_INCR_XFER_SIZE},
+#endif
+#ifdef _PC_REC_MAX_XFER_SIZE
+ {"PC_REC_MAX_XFER_SIZE", _PC_REC_MAX_XFER_SIZE},
+#endif
+#ifdef _PC_REC_MIN_XFER_SIZE
+ {"PC_REC_MIN_XFER_SIZE", _PC_REC_MIN_XFER_SIZE},
+#endif
+#ifdef _PC_REC_XFER_ALIGN
+ {"PC_REC_XFER_ALIGN", _PC_REC_XFER_ALIGN},
+#endif
+#ifdef _PC_SYMLINK_MAX
+ {"PC_SYMLINK_MAX", _PC_SYMLINK_MAX},
+#endif
+#ifdef _PC_XATTR_ENABLED
+ {"PC_XATTR_ENABLED", _PC_XATTR_ENABLED},
+#endif
+#ifdef _PC_XATTR_EXISTS
+ {"PC_XATTR_EXISTS", _PC_XATTR_EXISTS},
+#endif
+#ifdef _PC_TIMESTAMP_RESOLUTION
+ {"PC_TIMESTAMP_RESOLUTION", _PC_TIMESTAMP_RESOLUTION},
+#endif
};
static int
@@ -6191,32 +6787,34 @@ posix_confstr(PyObject *self, PyObject *args)
{
PyObject *result = NULL;
int name;
- char buffer[256];
-
- if (PyArg_ParseTuple(args, "O&:confstr", conv_confstr_confname, &name)) {
+ char buffer[255];
int len;
- errno = 0;
- len = confstr(name, buffer, sizeof(buffer));
- if (len == 0) {
- if (errno) {
- posix_error();
- }
- else {
- result = Py_None;
- Py_INCREF(Py_None);
- }
+ if (!PyArg_ParseTuple(args, "O&:confstr", conv_confstr_confname, &name))
+ return NULL;
+
+ errno = 0;
+ len = confstr(name, buffer, sizeof(buffer));
+ if (len == 0) {
+ if (errno) {
+ posix_error();
+ return NULL;
}
else {
- if ((unsigned int)len >= sizeof(buffer)) {
- result = PyUnicode_FromStringAndSize(NULL, len-1);
- if (result != NULL)
- confstr(name, _PyUnicode_AsString(result), len);
- }
- else
- result = PyUnicode_FromStringAndSize(buffer, len-1);
+ Py_RETURN_NONE;
}
}
+
+ if ((unsigned int)len >= sizeof(buffer)) {
+ char *buf = PyMem_Malloc(len);
+ if (buf == NULL)
+ return PyErr_NoMemory();
+ confstr(name, buf, len);
+ result = PyUnicode_DecodeFSDefaultAndSize(buf, len-1);
+ PyMem_Free(buf);
+ }
+ else
+ result = PyUnicode_DecodeFSDefaultAndSize(buffer, len-1);
return result;
}
#endif
@@ -6867,57 +7465,54 @@ win32_startfile(PyObject *self, PyObject *args)
char *operation = NULL;
HINSTANCE rc;
- if (unicode_file_names()) {
- PyObject *unipath, *woperation = NULL;
- if (!PyArg_ParseTuple(args, "U|s:startfile",
- &unipath, &operation)) {
+ PyObject *unipath, *woperation = NULL;
+ if (!PyArg_ParseTuple(args, "U|s:startfile",
+ &unipath, &operation)) {
+ PyErr_Clear();
+ goto normal;
+ }
+
+ if (operation) {
+ woperation = PyUnicode_DecodeASCII(operation,
+ strlen(operation), NULL);
+ if (!woperation) {
PyErr_Clear();
+ operation = NULL;
goto normal;
}
+ }
+ Py_BEGIN_ALLOW_THREADS
+ rc = ShellExecuteW((HWND)0, woperation ? PyUnicode_AS_UNICODE(woperation) : 0,
+ PyUnicode_AS_UNICODE(unipath),
+ NULL, NULL, SW_SHOWNORMAL);
+ Py_END_ALLOW_THREADS
- if (operation) {
- woperation = PyUnicode_DecodeASCII(operation,
- strlen(operation), NULL);
- if (!woperation) {
- PyErr_Clear();
- operation = NULL;
- goto normal;
- }
- }
-
- Py_BEGIN_ALLOW_THREADS
- rc = ShellExecuteW((HWND)0, woperation ? PyUnicode_AS_UNICODE(woperation) : 0,
- PyUnicode_AS_UNICODE(unipath),
- NULL, NULL, SW_SHOWNORMAL);
- Py_END_ALLOW_THREADS
-
- Py_XDECREF(woperation);
- if (rc <= (HINSTANCE)32) {
- PyObject *errval = win32_error_unicode("startfile",
- PyUnicode_AS_UNICODE(unipath));
- return errval;
- }
- Py_INCREF(Py_None);
- return Py_None;
+ Py_XDECREF(woperation);
+ if (rc <= (HINSTANCE)32) {
+ PyObject *errval = win32_error_unicode("startfile",
+ PyUnicode_AS_UNICODE(unipath));
+ return errval;
}
+ Py_INCREF(Py_None);
+ return Py_None;
normal:
if (!PyArg_ParseTuple(args, "O&|s:startfile",
PyUnicode_FSConverter, &ofilepath,
&operation))
return NULL;
- filepath = bytes2str(ofilepath, 1);
+ filepath = PyBytes_AsString(ofilepath);
Py_BEGIN_ALLOW_THREADS
rc = ShellExecute((HWND)0, operation, filepath,
NULL, NULL, SW_SHOWNORMAL);
Py_END_ALLOW_THREADS
if (rc <= (HINSTANCE)32) {
PyObject *errval = win32_error("startfile", filepath);
- release_bytes(ofilepath);
+ Py_DECREF(ofilepath);
return errval;
}
- release_bytes(ofilepath);
+ Py_DECREF(ofilepath);
Py_INCREF(Py_None);
return Py_None;
}
@@ -7091,6 +7686,82 @@ vms_urandom(PyObject *self, PyObject *args)
}
#endif
+#ifdef HAVE_SETRESUID
+PyDoc_STRVAR(posix_setresuid__doc__,
+"setresuid(ruid, euid, suid)\n\n\
+Set the current process's real, effective, and saved user ids.");
+
+static PyObject*
+posix_setresuid (PyObject *self, PyObject *args)
+{
+ /* We assume uid_t is no larger than a long. */
+ long ruid, euid, suid;
+ if (!PyArg_ParseTuple(args, "lll", &ruid, &euid, &suid))
+ return NULL;
+ if (setresuid(ruid, euid, suid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif
+
+#ifdef HAVE_SETRESGID
+PyDoc_STRVAR(posix_setresgid__doc__,
+"setresgid(rgid, egid, sgid)\n\n\
+Set the current process's real, effective, and saved group ids.");
+
+static PyObject*
+posix_setresgid (PyObject *self, PyObject *args)
+{
+ /* We assume uid_t is no larger than a long. */
+ long rgid, egid, sgid;
+ if (!PyArg_ParseTuple(args, "lll", &rgid, &egid, &sgid))
+ return NULL;
+ if (setresgid(rgid, egid, sgid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif
+
+#ifdef HAVE_GETRESUID
+PyDoc_STRVAR(posix_getresuid__doc__,
+"getresuid() -> (ruid, euid, suid)\n\n\
+Get tuple of the current process's real, effective, and saved user ids.");
+
+static PyObject*
+posix_getresuid (PyObject *self, PyObject *noargs)
+{
+ uid_t ruid, euid, suid;
+ long l_ruid, l_euid, l_suid;
+ if (getresuid(&ruid, &euid, &suid) < 0)
+ return posix_error();
+ /* Force the values into long's as we don't know the size of uid_t. */
+ l_ruid = ruid;
+ l_euid = euid;
+ l_suid = suid;
+ return Py_BuildValue("(lll)", l_ruid, l_euid, l_suid);
+}
+#endif
+
+#ifdef HAVE_GETRESGID
+PyDoc_STRVAR(posix_getresgid__doc__,
+"getresgid() -> (rgid, egid, sgid)\n\n\
+Get tuple of the current process's real, effective, and saved group ids.");
+
+static PyObject*
+posix_getresgid (PyObject *self, PyObject *noargs)
+{
+ uid_t rgid, egid, sgid;
+ long l_rgid, l_egid, l_sgid;
+ if (getresgid(&rgid, &egid, &sgid) < 0)
+ return posix_error();
+ /* Force the values into long's as we don't know the size of uid_t. */
+ l_rgid = rgid;
+ l_egid = egid;
+ l_sgid = sgid;
+ return Py_BuildValue("(lll)", l_rgid, l_egid, l_sgid);
+}
+#endif
+
static PyMethodDef posix_methods[] = {
{"access", posix_access, METH_VARARGS, posix_access__doc__},
#ifdef HAVE_TTYNAME
@@ -7143,13 +7814,20 @@ static PyMethodDef posix_methods[] = {
#ifdef HAVE_READLINK
{"readlink", posix_readlink, METH_VARARGS, posix_readlink__doc__},
#endif /* HAVE_READLINK */
+#if !defined(HAVE_READLINK) && defined(MS_WINDOWS)
+ {"readlink", win_readlink, METH_VARARGS, win_readlink__doc__},
+#endif /* !defined(HAVE_READLINK) && defined(MS_WINDOWS) */
{"rename", posix_rename, METH_VARARGS, posix_rename__doc__},
{"rmdir", posix_rmdir, METH_VARARGS, posix_rmdir__doc__},
{"stat", posix_stat, METH_VARARGS, posix_stat__doc__},
{"stat_float_times", stat_float_times, METH_VARARGS, stat_float_times__doc__},
-#ifdef HAVE_SYMLINK
+#if defined(HAVE_SYMLINK) && !defined(MS_WINDOWS)
{"symlink", posix_symlink, METH_VARARGS, posix_symlink__doc__},
#endif /* HAVE_SYMLINK */
+#if defined(HAVE_SYMLINK) && defined(MS_WINDOWS)
+ {"symlink", (PyCFunction)win_symlink, METH_VARARGS | METH_KEYWORDS,
+ win_symlink__doc__},
+#endif /* defined(HAVE_SYMLINK) && defined(MS_WINDOWS) */
#ifdef HAVE_SYSTEM
{"system", posix_system, METH_VARARGS, posix_system__doc__},
#endif
@@ -7224,6 +7902,8 @@ static PyMethodDef posix_methods[] = {
#endif /* HAVE_PLOCK */
#ifdef MS_WINDOWS
{"startfile", win32_startfile, METH_VARARGS, win32_startfile__doc__},
+ {"kill", win32_kill, METH_VARARGS, win32_kill__doc__},
+ {"link", win32_link, METH_VARARGS, win32_link__doc__},
#endif
#ifdef HAVE_SETUID
{"setuid", posix_setuid, METH_VARARGS, posix_setuid__doc__},
@@ -7246,6 +7926,9 @@ static PyMethodDef posix_methods[] = {
#ifdef HAVE_SETGROUPS
{"setgroups", posix_setgroups, METH_O, posix_setgroups__doc__},
#endif /* HAVE_SETGROUPS */
+#ifdef HAVE_INITGROUPS
+ {"initgroups", posix_initgroups, METH_VARARGS, posix_initgroups__doc__},
+#endif /* HAVE_INITGROUPS */
#ifdef HAVE_GETPGID
{"getpgid", posix_getpgid, METH_VARARGS, posix_getpgid__doc__},
#endif /* HAVE_GETPGID */
@@ -7370,6 +8053,8 @@ static PyMethodDef posix_methods[] = {
{"abort", posix_abort, METH_NOARGS, posix_abort__doc__},
#ifdef MS_WINDOWS
{"_getfullpathname", posix__getfullpathname, METH_VARARGS, NULL},
+ {"_getfinalpathname", posix__getfinalpathname, METH_VARARGS, NULL},
+ {"_getfileinformation", posix__getfileinformation, METH_VARARGS, NULL},
#endif
#ifdef HAVE_GETLOADAVG
{"getloadavg", posix_getloadavg, METH_NOARGS, posix_getloadavg__doc__},
@@ -7380,6 +8065,19 @@ static PyMethodDef posix_methods[] = {
#ifdef __VMS
{"urandom", vms_urandom, METH_VARARGS, vms_urandom__doc__},
#endif
+#ifdef HAVE_SETRESUID
+ {"setresuid", posix_setresuid, METH_VARARGS, posix_setresuid__doc__},
+#endif
+#ifdef HAVE_SETRESGID
+ {"setresgid", posix_setresgid, METH_VARARGS, posix_setresgid__doc__},
+#endif
+#ifdef HAVE_GETRESUID
+ {"getresuid", posix_getresuid, METH_NOARGS, posix_getresuid__doc__},
+#endif
+#ifdef HAVE_GETRESGID
+ {"getresgid", posix_getresgid, METH_NOARGS, posix_getresgid__doc__},
+#endif
+
{NULL, NULL} /* Sentinel */
};
@@ -7443,6 +8141,35 @@ static int insertvalues(PyObject *module)
}
#endif
+#if defined(HAVE_SYMLINK) && defined(MS_WINDOWS)
+static int
+enable_symlink()
+{
+ HANDLE tok;
+ TOKEN_PRIVILEGES tok_priv;
+ LUID luid;
+ int meth_idx = 0;
+
+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &tok))
+ return 0;
+
+ if (!LookupPrivilegeValue(NULL, SE_CREATE_SYMBOLIC_LINK_NAME, &luid))
+ return 0;
+
+ tok_priv.PrivilegeCount = 1;
+ tok_priv.Privileges[0].Luid = luid;
+ tok_priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+
+ if (!AdjustTokenPrivileges(tok, FALSE, &tok_priv,
+ sizeof(TOKEN_PRIVILEGES),
+ (PTOKEN_PRIVILEGES) NULL, (PDWORD) NULL))
+ return 0;
+
+ /* ERROR_NOT_ALL_ASSIGNED returned when the privilege can't be assigned. */
+ return GetLastError() == ERROR_NOT_ALL_ASSIGNED ? 0 : 1;
+}
+#endif /* defined(HAVE_SYMLINK) && defined(MS_WINDOWS) */
+
static int
all_ins(PyObject *d)
{
@@ -7627,6 +8354,14 @@ all_ins(PyObject *d)
if (ins(d, "EX_NOTFOUND", (long)EX_NOTFOUND)) return -1;
#endif /* EX_NOTFOUND */
+ /* statvfs */
+#ifdef ST_RDONLY
+ if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
+#endif /* ST_RDONLY */
+#ifdef ST_NOSUID
+ if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
+#endif /* ST_NOSUID */
+
#ifdef HAVE_SPAWNV
#if defined(PYOS_OS2) && defined(PYCC_GCC)
if (ins(d, "P_WAIT", (long)P_WAIT)) return -1;
@@ -7696,6 +8431,10 @@ INITFUNC(void)
{
PyObject *m, *v;
+#if defined(HAVE_SYMLINK) && defined(MS_WINDOWS)
+ win32_can_symlink = enable_symlink();
+#endif
+
m = PyModule_Create(&posixmodule);
if (m == NULL)
return NULL;
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index 96275bd506..1e0903a388 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -2,7 +2,6 @@
/* UNIX password file access module */
#include "Python.h"
-#include "structseq.h"
#include <sys/types.h>
#include <pwd.h>
@@ -49,9 +48,7 @@ static void
sets(PyObject *v, int i, const char* val)
{
if (val) {
- PyObject *o = PyUnicode_Decode(val, strlen(val),
- Py_FileSystemDefaultEncoding,
- "surrogateescape");
+ PyObject *o = PyUnicode_DecodeFSDefault(val);
PyStructSequence_SET_ITEM(v, i, o);
}
else {
@@ -134,9 +131,7 @@ pwd_getpwnam(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "U:getpwnam", &arg))
return NULL;
- if ((bytes = PyUnicode_AsEncodedString(arg,
- Py_FileSystemDefaultEncoding,
- "surrogateescape")) == NULL)
+ if ((bytes = PyUnicode_EncodeFSDefault(arg)) == NULL)
return NULL;
if (PyBytes_AsStringAndSize(bytes, &name, NULL) == -1)
goto out;
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index cc62274d14..40d93246fc 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -209,53 +209,11 @@ flag_error(xmlparseobject *self)
static PyCodeObject*
getcode(enum HandlerTypes slot, char* func_name, int lineno)
{
- PyObject *code = NULL;
- PyObject *name = NULL;
- PyObject *nulltuple = NULL;
- PyObject *filename = NULL;
-
if (handler_info[slot].tb_code == NULL) {
- code = PyBytes_FromString("");
- if (code == NULL)
- goto failed;
- name = PyUnicode_FromString(func_name);
- if (name == NULL)
- goto failed;
- nulltuple = PyTuple_New(0);
- if (nulltuple == NULL)
- goto failed;
- filename = PyUnicode_DecodeFSDefault(__FILE__);
handler_info[slot].tb_code =
- PyCode_New(0, /* argcount */
- 0, /* kwonlyargcount */
- 0, /* nlocals */
- 0, /* stacksize */
- 0, /* flags */
- code, /* code */
- nulltuple, /* consts */
- nulltuple, /* names */
- nulltuple, /* varnames */
-#if PYTHON_API_VERSION >= 1010
- nulltuple, /* freevars */
- nulltuple, /* cellvars */
-#endif
- filename, /* filename */
- name, /* name */
- lineno, /* firstlineno */
- code /* lnotab */
- );
- if (handler_info[slot].tb_code == NULL)
- goto failed;
- Py_DECREF(code);
- Py_DECREF(nulltuple);
- Py_DECREF(filename);
- Py_DECREF(name);
+ PyCode_NewEmpty(__FILE__, func_name, lineno);
}
return handler_info[slot].tb_code;
- failed:
- Py_XDECREF(code);
- Py_XDECREF(name);
- return NULL;
}
#ifdef FIX_TRACE
@@ -300,11 +258,7 @@ trace_frame_exc(PyThreadState *tstate, PyFrameObject *f)
value = Py_None;
Py_INCREF(value);
}
-#if PY_VERSION_HEX < 0x02040000
- arg = Py_BuildValue("(OOO)", type, value, traceback);
-#else
arg = PyTuple_Pack(3, type, value, traceback);
-#endif
if (arg == NULL) {
PyErr_Restore(type, value, traceback);
return 0;
@@ -843,29 +797,13 @@ xmlparse_Parse(xmlparseobject *self, PyObject *args)
static int
readinst(char *buf, int buf_size, PyObject *meth)
{
- PyObject *arg = NULL;
- PyObject *bytes = NULL;
- PyObject *str = NULL;
- int len = -1;
+ PyObject *str;
+ Py_ssize_t len;
char *ptr;
- if ((bytes = PyLong_FromLong(buf_size)) == NULL)
- goto finally;
-
- if ((arg = PyTuple_New(1)) == NULL) {
- Py_DECREF(bytes);
- goto finally;
- }
-
- PyTuple_SET_ITEM(arg, 0, bytes);
-
-#if PY_VERSION_HEX < 0x02020000
- str = PyObject_CallObject(meth, arg);
-#else
- str = PyObject_Call(meth, arg, NULL);
-#endif
+ str = PyObject_CallFunction(meth, "n", buf_size);
if (str == NULL)
- goto finally;
+ goto error;
if (PyBytes_Check(str))
ptr = PyBytes_AS_STRING(str);
@@ -875,21 +813,24 @@ readinst(char *buf, int buf_size, PyObject *meth)
PyErr_Format(PyExc_TypeError,
"read() did not return a bytes object (type=%.400s)",
Py_TYPE(str)->tp_name);
- goto finally;
+ goto error;
}
len = Py_SIZE(str);
if (len > buf_size) {
PyErr_Format(PyExc_ValueError,
"read() returned too much data: "
- "%i bytes requested, %i returned",
+ "%i bytes requested, %zd returned",
buf_size, len);
- goto finally;
+ goto error;
}
memcpy(buf, ptr, len);
-finally:
- Py_XDECREF(arg);
+ Py_DECREF(str);
+ /* len <= buf_size <= INT_MAX */
+ return (int)len;
+
+error:
Py_XDECREF(str);
- return len;
+ return -1;
}
PyDoc_STRVAR(xmlparse_ParseFile__doc__,
@@ -900,18 +841,14 @@ static PyObject *
xmlparse_ParseFile(xmlparseobject *self, PyObject *f)
{
int rv = 1;
- FILE *fp;
PyObject *readmethod = NULL;
- {
- fp = NULL;
- readmethod = PyObject_GetAttrString(f, "read");
- if (readmethod == NULL) {
- PyErr_Clear();
- PyErr_SetString(PyExc_TypeError,
- "argument must have 'read' attribute");
- return NULL;
- }
+
+ readmethod = PyObject_GetAttrString(f, "read");
+ if (readmethod == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument must have 'read' attribute");
+ return NULL;
}
for (;;) {
int bytes_read;
@@ -921,19 +858,10 @@ xmlparse_ParseFile(xmlparseobject *self, PyObject *f)
return PyErr_NoMemory();
}
- if (fp) {
- bytes_read = fread(buf, sizeof(char), BUF_SIZE, fp);
- if (bytes_read < 0) {
- PyErr_SetFromErrno(PyExc_IOError);
- return NULL;
- }
- }
- else {
- bytes_read = readinst(buf, BUF_SIZE, readmethod);
- if (bytes_read < 0) {
- Py_DECREF(readmethod);
- return NULL;
- }
+ bytes_read = readinst(buf, BUF_SIZE, readmethod);
+ if (bytes_read < 0) {
+ Py_DECREF(readmethod);
+ return NULL;
}
rv = XML_ParseBuffer(self->itself, bytes_read, bytes_read == 0);
if (PyErr_Occurred()) {
@@ -1018,33 +946,12 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
return NULL;
}
-#ifndef Py_TPFLAGS_HAVE_GC
- /* Python versions 2.0 and 2.1 */
- new_parser = PyObject_New(xmlparseobject, &Xmlparsetype);
-#else
- /* Python versions 2.2 and later */
new_parser = PyObject_GC_New(xmlparseobject, &Xmlparsetype);
-#endif
-
if (new_parser == NULL)
return NULL;
new_parser->buffer_size = self->buffer_size;
new_parser->buffer_used = 0;
- if (self->buffer != NULL) {
- new_parser->buffer = malloc(new_parser->buffer_size);
- if (new_parser->buffer == NULL) {
-#ifndef Py_TPFLAGS_HAVE_GC
- /* Code for versions 2.0 and 2.1 */
- PyObject_Del(new_parser);
-#else
- /* Code for versions 2.2 and later. */
- PyObject_GC_Del(new_parser);
-#endif
- return PyErr_NoMemory();
- }
- }
- else
- new_parser->buffer = NULL;
+ new_parser->buffer = NULL;
new_parser->ordered_attributes = self->ordered_attributes;
new_parser->specified_attributes = self->specified_attributes;
new_parser->in_callback = 0;
@@ -1054,12 +961,15 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
new_parser->handlers = 0;
new_parser->intern = self->intern;
Py_XINCREF(new_parser->intern);
-#ifdef Py_TPFLAGS_HAVE_GC
PyObject_GC_Track(new_parser);
-#else
- PyObject_GC_Init(new_parser);
-#endif
+ if (self->buffer != NULL) {
+ new_parser->buffer = malloc(new_parser->buffer_size);
+ if (new_parser->buffer == NULL) {
+ Py_DECREF(new_parser);
+ return PyErr_NoMemory();
+ }
+ }
if (!new_parser->itself) {
Py_DECREF(new_parser);
return PyErr_NoMemory();
@@ -1222,12 +1132,7 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
int i;
xmlparseobject *self;
-#ifdef Py_TPFLAGS_HAVE_GC
- /* Code for versions 2.2 and later */
self = PyObject_GC_New(xmlparseobject, &Xmlparsetype);
-#else
- self = PyObject_New(xmlparseobject, &Xmlparsetype);
-#endif
if (self == NULL)
return NULL;
@@ -1247,11 +1152,7 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
}
self->intern = intern;
Py_XINCREF(self->intern);
-#ifdef Py_TPFLAGS_HAVE_GC
PyObject_GC_Track(self);
-#else
- PyObject_GC_Init(self);
-#endif
if (self->itself == NULL) {
PyErr_SetString(PyExc_RuntimeError,
"XML_ParserCreate failed");
@@ -1280,11 +1181,7 @@ static void
xmlparse_dealloc(xmlparseobject *self)
{
int i;
-#ifdef Py_TPFLAGS_HAVE_GC
PyObject_GC_UnTrack(self);
-#else
- PyObject_GC_Fini(self);
-#endif
if (self->itself != NULL)
XML_ParserFree(self->itself);
self->itself = NULL;
@@ -1304,21 +1201,16 @@ xmlparse_dealloc(xmlparseobject *self)
self->buffer = NULL;
}
Py_XDECREF(self->intern);
-#ifndef Py_TPFLAGS_HAVE_GC
- /* Code for versions 2.0 and 2.1 */
- PyObject_Del(self);
-#else
- /* Code for versions 2.2 and later. */
PyObject_GC_Del(self);
-#endif
}
static int
-handlername2int(const char *name)
+handlername2int(PyObject *name)
{
int i;
for (i = 0; handler_info[i].name != NULL; i++) {
- if (strcmp(name, handler_info[i].name) == 0) {
+ if (PyUnicode_CompareWithASCIIString(
+ name, handler_info[i].name) == 0) {
return i;
}
}
@@ -1336,13 +1228,13 @@ get_pybool(int istrue)
static PyObject *
xmlparse_getattro(xmlparseobject *self, PyObject *nameobj)
{
- char *name = "";
+ Py_UNICODE *name;
int handlernum = -1;
- if (PyUnicode_Check(nameobj))
- name = _PyUnicode_AsString(nameobj);
+ if (!PyUnicode_Check(nameobj))
+ goto generic;
- handlernum = handlername2int(name);
+ handlernum = handlername2int(nameobj);
if (handlernum != -1) {
PyObject *result = self->handlers[handlernum];
@@ -1351,46 +1243,48 @@ xmlparse_getattro(xmlparseobject *self, PyObject *nameobj)
Py_INCREF(result);
return result;
}
+
+ name = PyUnicode_AS_UNICODE(nameobj);
if (name[0] == 'E') {
- if (strcmp(name, "ErrorCode") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "ErrorCode") == 0)
return PyLong_FromLong((long)
XML_GetErrorCode(self->itself));
- if (strcmp(name, "ErrorLineNumber") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "ErrorLineNumber") == 0)
return PyLong_FromLong((long)
XML_GetErrorLineNumber(self->itself));
- if (strcmp(name, "ErrorColumnNumber") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "ErrorColumnNumber") == 0)
return PyLong_FromLong((long)
XML_GetErrorColumnNumber(self->itself));
- if (strcmp(name, "ErrorByteIndex") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "ErrorByteIndex") == 0)
return PyLong_FromLong((long)
XML_GetErrorByteIndex(self->itself));
}
if (name[0] == 'C') {
- if (strcmp(name, "CurrentLineNumber") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "CurrentLineNumber") == 0)
return PyLong_FromLong((long)
XML_GetCurrentLineNumber(self->itself));
- if (strcmp(name, "CurrentColumnNumber") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "CurrentColumnNumber") == 0)
return PyLong_FromLong((long)
XML_GetCurrentColumnNumber(self->itself));
- if (strcmp(name, "CurrentByteIndex") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "CurrentByteIndex") == 0)
return PyLong_FromLong((long)
XML_GetCurrentByteIndex(self->itself));
}
if (name[0] == 'b') {
- if (strcmp(name, "buffer_size") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "buffer_size") == 0)
return PyLong_FromLong((long) self->buffer_size);
- if (strcmp(name, "buffer_text") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "buffer_text") == 0)
return get_pybool(self->buffer != NULL);
- if (strcmp(name, "buffer_used") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "buffer_used") == 0)
return PyLong_FromLong((long) self->buffer_used);
}
- if (strcmp(name, "namespace_prefixes") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "namespace_prefixes") == 0)
return get_pybool(self->ns_prefixes);
- if (strcmp(name, "ordered_attributes") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "ordered_attributes") == 0)
return get_pybool(self->ordered_attributes);
- if (strcmp(name, "specified_attributes") == 0)
+ if (PyUnicode_CompareWithASCIIString(nameobj, "specified_attributes") == 0)
return get_pybool((long) self->specified_attributes);
- if (strcmp(name, "intern") == 0) {
+ if (PyUnicode_CompareWithASCIIString(nameobj, "intern") == 0) {
if (self->intern == NULL) {
Py_INCREF(Py_None);
return Py_None;
@@ -1400,7 +1294,7 @@ xmlparse_getattro(xmlparseobject *self, PyObject *nameobj)
return self->intern;
}
}
-
+ generic:
return PyObject_GenericGetAttr((PyObject*)self, nameobj);
}
@@ -1451,7 +1345,7 @@ xmlparse_dir(PyObject *self, PyObject* noargs)
}
static int
-sethandler(xmlparseobject *self, const char *name, PyObject* v)
+sethandler(xmlparseobject *self, PyObject *name, PyObject* v)
{
int handlernum = handlername2int(name);
if (handlernum >= 0) {
@@ -1487,14 +1381,15 @@ sethandler(xmlparseobject *self, const char *name, PyObject* v)
}
static int
-xmlparse_setattr(xmlparseobject *self, char *name, PyObject *v)
+xmlparse_setattro(xmlparseobject *self, PyObject *name, PyObject *v)
{
/* Set attribute 'name' to value 'v'. v==NULL means delete */
if (v == NULL) {
PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute");
return -1;
}
- if (strcmp(name, "buffer_text") == 0) {
+ assert(PyUnicode_Check(name));
+ if (PyUnicode_CompareWithASCIIString(name, "buffer_text") == 0) {
if (PyObject_IsTrue(v)) {
if (self->buffer == NULL) {
self->buffer = malloc(self->buffer_size);
@@ -1513,7 +1408,7 @@ xmlparse_setattr(xmlparseobject *self, char *name, PyObject *v)
}
return 0;
}
- if (strcmp(name, "namespace_prefixes") == 0) {
+ if (PyUnicode_CompareWithASCIIString(name, "namespace_prefixes") == 0) {
if (PyObject_IsTrue(v))
self->ns_prefixes = 1;
else
@@ -1521,14 +1416,14 @@ xmlparse_setattr(xmlparseobject *self, char *name, PyObject *v)
XML_SetReturnNSTriplet(self->itself, self->ns_prefixes);
return 0;
}
- if (strcmp(name, "ordered_attributes") == 0) {
+ if (PyUnicode_CompareWithASCIIString(name, "ordered_attributes") == 0) {
if (PyObject_IsTrue(v))
self->ordered_attributes = 1;
else
self->ordered_attributes = 0;
return 0;
}
- if (strcmp(name, "specified_attributes") == 0) {
+ if (PyUnicode_CompareWithASCIIString(name, "specified_attributes") == 0) {
if (PyObject_IsTrue(v))
self->specified_attributes = 1;
else
@@ -1536,7 +1431,7 @@ xmlparse_setattr(xmlparseobject *self, char *name, PyObject *v)
return 0;
}
- if (strcmp(name, "buffer_size") == 0) {
+ if (PyUnicode_CompareWithASCIIString(name, "buffer_size") == 0) {
long new_buffer_size;
if (!PyLong_Check(v)) {
PyErr_SetString(PyExc_TypeError, "buffer_size must be an integer");
@@ -1579,7 +1474,7 @@ xmlparse_setattr(xmlparseobject *self, char *name, PyObject *v)
return 0;
}
- if (strcmp(name, "CharacterDataHandler") == 0) {
+ if (PyUnicode_CompareWithASCIIString(name, "CharacterDataHandler") == 0) {
/* If we're changing the character data handler, flush all
* cached data with the old handler. Not sure there's a
* "right" thing to do, though, but this probably won't
@@ -1591,7 +1486,7 @@ xmlparse_setattr(xmlparseobject *self, char *name, PyObject *v)
if (sethandler(self, name, v)) {
return 0;
}
- PyErr_SetString(PyExc_AttributeError, name);
+ PyErr_SetObject(PyExc_AttributeError, name);
return -1;
}
@@ -1617,13 +1512,13 @@ PyDoc_STRVAR(Xmlparsetype__doc__, "XML parser");
static PyTypeObject Xmlparsetype = {
PyVarObject_HEAD_INIT(NULL, 0)
"pyexpat.xmlparser", /*tp_name*/
- sizeof(xmlparseobject) + PyGC_HEAD_SIZE,/*tp_basicsize*/
+ sizeof(xmlparseobject), /*tp_basicsize*/
0, /*tp_itemsize*/
/* methods */
(destructor)xmlparse_dealloc, /*tp_dealloc*/
(printfunc)0, /*tp_print*/
0, /*tp_getattr*/
- (setattrfunc)xmlparse_setattr, /*tp_setattr*/
+ 0, /*tp_setattr*/
0, /*tp_reserved*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
@@ -1633,13 +1528,9 @@ static PyTypeObject Xmlparsetype = {
(ternaryfunc)0, /*tp_call*/
(reprfunc)0, /*tp_str*/
(getattrofunc)xmlparse_getattro, /* tp_getattro */
- 0, /* tp_setattro */
+ (setattrofunc)xmlparse_setattro, /* tp_setattro */
0, /* tp_as_buffer */
-#ifdef Py_TPFLAGS_HAVE_GC
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-#else
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /*tp_flags*/
-#endif
Xmlparsetype__doc__, /* tp_doc - Documentation string */
(traverseproc)xmlparse_traverse, /* tp_traverse */
(inquiry)xmlparse_clear, /* tp_clear */
@@ -1791,8 +1682,12 @@ MODULE_INITFUNC(void)
PyObject *modelmod_name;
PyObject *model_module;
PyObject *sys_modules;
+ PyObject *tmpnum, *tmpstr;
+ PyObject *codes_dict;
+ PyObject *rev_codes_dict;
+ int res;
static struct PyExpat_CAPI capi;
- PyObject* capi_object;
+ PyObject *capi_object;
if (errmod_name == NULL)
return NULL;
@@ -1895,9 +1790,29 @@ MODULE_INITFUNC(void)
}
#endif
+ codes_dict = PyDict_New();
+ rev_codes_dict = PyDict_New();
+ if (codes_dict == NULL || rev_codes_dict == NULL) {
+ Py_XDECREF(codes_dict);
+ Py_XDECREF(rev_codes_dict);
+ return NULL;
+ }
+
#define MYCONST(name) \
- PyModule_AddStringConstant(errors_module, #name, \
- (char*)XML_ErrorString(name))
+ if (PyModule_AddStringConstant(errors_module, #name, \
+ (char *)XML_ErrorString(name)) < 0) \
+ return NULL; \
+ tmpnum = PyLong_FromLong(name); \
+ if (tmpnum == NULL) return NULL; \
+ res = PyDict_SetItemString(codes_dict, \
+ XML_ErrorString(name), tmpnum); \
+ if (res < 0) return NULL; \
+ tmpstr = PyUnicode_FromString(XML_ErrorString(name)); \
+ if (tmpstr == NULL) return NULL; \
+ res = PyDict_SetItem(rev_codes_dict, tmpnum, tmpstr); \
+ Py_DECREF(tmpstr); \
+ Py_DECREF(tmpnum); \
+ if (res < 0) return NULL; \
MYCONST(XML_ERROR_NO_MEMORY);
MYCONST(XML_ERROR_SYNTAX);
@@ -1939,8 +1854,15 @@ MODULE_INITFUNC(void)
MYCONST(XML_ERROR_FINISHED);
MYCONST(XML_ERROR_SUSPEND_PE);
- PyModule_AddStringConstant(errors_module, "__doc__",
- "Constants used to describe error conditions.");
+ if (PyModule_AddStringConstant(errors_module, "__doc__",
+ "Constants used to describe "
+ "error conditions.") < 0)
+ return NULL;
+
+ if (PyModule_AddObject(errors_module, "codes", codes_dict) < 0)
+ return NULL;
+ if (PyModule_AddObject(errors_module, "messages", rev_codes_dict) < 0)
+ return NULL;
#undef MYCONST
diff --git a/Modules/python.c b/Modules/python.c
index 50ec5f0219..18f9b3dd66 100644
--- a/Modules/python.c
+++ b/Modules/python.c
@@ -14,108 +14,10 @@ wmain(int argc, wchar_t **argv)
return Py_Main(argc, argv);
}
#else
-static wchar_t*
-char2wchar(char* arg)
-{
- wchar_t *res;
-#ifdef HAVE_BROKEN_MBSTOWCS
- /* Some platforms have a broken implementation of
- * mbstowcs which does not count the characters that
- * would result from conversion. Use an upper bound.
- */
- size_t argsize = strlen(arg);
-#else
- size_t argsize = mbstowcs(NULL, arg, 0);
-#endif
- size_t count;
- unsigned char *in;
- wchar_t *out;
-#ifdef HAVE_MBRTOWC
- mbstate_t mbs;
-#endif
- if (argsize != (size_t)-1) {
- res = (wchar_t *)PyMem_Malloc((argsize+1)*sizeof(wchar_t));
- if (!res)
- goto oom;
- count = mbstowcs(res, arg, argsize+1);
- if (count != (size_t)-1) {
- wchar_t *tmp;
- /* Only use the result if it contains no
- surrogate characters. */
- for (tmp = res; *tmp != 0 &&
- (*tmp < 0xd800 || *tmp > 0xdfff); tmp++)
- ;
- if (*tmp == 0)
- return res;
- }
- PyMem_Free(res);
- }
- /* Conversion failed. Fall back to escaping with surrogateescape. */
-#ifdef HAVE_MBRTOWC
- /* Try conversion with mbrtwoc (C99), and escape non-decodable bytes. */
- /* Overallocate; as multi-byte characters are in the argument, the
- actual output could use less memory. */
- argsize = strlen(arg) + 1;
- res = PyMem_Malloc(argsize*sizeof(wchar_t));
- if (!res) goto oom;
- in = (unsigned char*)arg;
- out = res;
- memset(&mbs, 0, sizeof mbs);
- while (argsize) {
- size_t converted = mbrtowc(out, (char*)in, argsize, &mbs);
- if (converted == 0)
- /* Reached end of string; null char stored. */
- break;
- if (converted == (size_t)-2) {
- /* Incomplete character. This should never happen,
- since we provide everything that we have -
- unless there is a bug in the C library, or I
- misunderstood how mbrtowc works. */
- fprintf(stderr, "unexpected mbrtowc result -2\n");
- return NULL;
- }
- if (converted == (size_t)-1) {
- /* Conversion error. Escape as UTF-8b, and start over
- in the initial shift state. */
- *out++ = 0xdc00 + *in++;
- argsize--;
- memset(&mbs, 0, sizeof mbs);
- continue;
- }
- if (*out >= 0xd800 && *out <= 0xdfff) {
- /* Surrogate character. Escape the original
- byte sequence with surrogateescape. */
- argsize -= converted;
- while (converted--)
- *out++ = 0xdc00 + *in++;
- continue;
- }
- /* successfully converted some bytes */
- in += converted;
- argsize -= converted;
- out++;
- }
-#else
- /* Cannot use C locale for escaping; manually escape as if charset
- is ASCII (i.e. escape all bytes > 128. This will still roundtrip
- correctly in the locale's charset, which must be an ASCII superset. */
- res = PyMem_Malloc((strlen(arg)+1)*sizeof(wchar_t));
- if (!res) goto oom;
- in = (unsigned char*)arg;
- out = res;
- while(*in)
- if(*in < 128)
- *out++ = *in++;
- else
- *out++ = 0xdc00 + *in++;
- *out = 0;
+#ifdef __APPLE__
+extern wchar_t* _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size);
#endif
- return res;
-oom:
- fprintf(stderr, "out of memory\n");
- return NULL;
-}
int
main(int argc, char **argv)
@@ -143,9 +45,14 @@ main(int argc, char **argv)
oldloc = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, "");
for (i = 0; i < argc; i++) {
- argv_copy2[i] = argv_copy[i] = char2wchar(argv[i]);
+#ifdef __APPLE__
+ argv_copy[i] = _Py_DecodeUTF8_surrogateescape(argv[i], strlen(argv[i]));
+#else
+ argv_copy[i] = _Py_char2wchar(argv[i], NULL);
+#endif
if (!argv_copy[i])
return 1;
+ argv_copy2[i] = argv_copy[i];
}
setlocale(LC_ALL, oldloc);
free(oldloc);
diff --git a/Modules/readline.c b/Modules/readline.c
index 53c6de2c5c..8337956648 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -38,14 +38,37 @@
#if defined(_RL_FUNCTION_TYPEDEF)
extern char **completion_matches(char *, rl_compentry_func_t *);
#else
+
+#if !defined(__APPLE__)
extern char **completion_matches(char *, CPFunction *);
#endif
#endif
+#endif
+
+#ifdef __APPLE__
+/*
+ * It is possible to link the readline module to the readline
+ * emulation library of editline/libedit.
+ *
+ * On OSX this emulation library is not 100% API compatible
+ * with the "real" readline and cannot be detected at compile-time,
+ * hence we use a runtime check to detect if we're using libedit
+ *
+ * Currently there is one know API incompatibility:
+ * - 'get_history' has a 1-based index with GNU readline, and a 0-based
+ * index with libedit's emulation.
+ * - Note that replace_history and remove_history use a 0-based index
+ * with both implementation.
+ */
+static int using_libedit_emulation = 0;
+static const char libedit_version_tag[] = "EditLine wrapper";
+#endif /* __APPLE__ */
+#ifdef HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK
static void
on_completion_display_matches_hook(char **matches,
int num_matches, int max_length);
-
+#endif
/* Exported function to send one line to readline's init file parser */
@@ -76,10 +99,16 @@ Parse and execute single line of a readline init file.");
static PyObject *
read_init_file(PyObject *self, PyObject *args)
{
- char *s = NULL;
- if (!PyArg_ParseTuple(args, "|z:read_init_file", &s))
+ PyObject *filename_obj = Py_None, *filename_bytes;
+ if (!PyArg_ParseTuple(args, "|O:read_init_file", &filename_obj))
return NULL;
- errno = rl_read_init_file(s);
+ if (filename_obj != Py_None) {
+ if (!PyUnicode_FSConverter(filename_obj, &filename_bytes))
+ return NULL;
+ errno = rl_read_init_file(PyBytes_AsString(filename_bytes));
+ Py_DECREF(filename_bytes);
+ } else
+ errno = rl_read_init_file(NULL);
if (errno)
return PyErr_SetFromErrno(PyExc_IOError);
Py_RETURN_NONE;
@@ -96,10 +125,16 @@ The default filename is the last filename used.");
static PyObject *
read_history_file(PyObject *self, PyObject *args)
{
- char *s = NULL;
- if (!PyArg_ParseTuple(args, "|z:read_history_file", &s))
+ PyObject *filename_obj = Py_None, *filename_bytes;
+ if (!PyArg_ParseTuple(args, "|O:read_history_file", &filename_obj))
return NULL;
- errno = read_history(s);
+ if (filename_obj != Py_None) {
+ if (!PyUnicode_FSConverter(filename_obj, &filename_bytes))
+ return NULL;
+ errno = read_history(PyBytes_AsString(filename_bytes));
+ Py_DECREF(filename_bytes);
+ } else
+ errno = read_history(NULL);
if (errno)
return PyErr_SetFromErrno(PyExc_IOError);
Py_RETURN_NONE;
@@ -117,12 +152,22 @@ The default filename is ~/.history.");
static PyObject *
write_history_file(PyObject *self, PyObject *args)
{
- char *s = NULL;
- if (!PyArg_ParseTuple(args, "|z:write_history_file", &s))
+ PyObject *filename_obj = Py_None, *filename_bytes;
+ char *filename;
+ if (!PyArg_ParseTuple(args, "|O:write_history_file", &filename_obj))
return NULL;
- errno = write_history(s);
+ if (filename_obj != Py_None) {
+ if (!PyUnicode_FSConverter(filename_obj, &filename_bytes))
+ return NULL;
+ filename = PyBytes_AsString(filename_bytes);
+ } else {
+ filename_bytes = NULL;
+ filename = NULL;
+ }
+ errno = write_history(filename);
if (!errno && _history_length >= 0)
- history_truncate_file(s, _history_length);
+ history_truncate_file(filename, _history_length);
+ Py_XDECREF(filename_bytes);
if (errno)
return PyErr_SetFromErrno(PyExc_IOError);
Py_RETURN_NONE;
@@ -519,6 +564,27 @@ get_history_item(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "i:index", &idx))
return NULL;
+#ifdef __APPLE__
+ if (using_libedit_emulation) {
+ /* Libedit emulation uses 0-based indexes,
+ * the real one uses 1-based indexes,
+ * adjust the index to ensure that Python
+ * code doesn't have to worry about the
+ * difference.
+ */
+ int length = _py_get_history_length();
+ idx --;
+
+ /*
+ * Apple's readline emulation crashes when
+ * the index is out of range, therefore
+ * test for that and fail gracefully.
+ */
+ if (idx < 0 || idx >= length) {
+ Py_RETURN_NONE;
+ }
+ }
+#endif /* __APPLE__ */
if ((hist_ent = history_get(idx)))
return PyUnicode_FromString(hist_ent->line);
else {
@@ -709,6 +775,7 @@ on_pre_input_hook(void)
/* C function to call the Python completion_display_matches */
+#ifdef HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK
static void
on_completion_display_matches_hook(char **matches,
int num_matches, int max_length)
@@ -750,6 +817,7 @@ on_completion_display_matches_hook(char **matches,
#endif
}
+#endif
/* C function to call the Python completer. */
@@ -821,6 +889,14 @@ setup_readline(void)
Py_FatalError("not enough memory to save locale");
#endif
+#ifdef __APPLE__
+ /* the libedit readline emulation resets key bindings etc
+ * when calling rl_initialize. So call it upfront
+ */
+ if (using_libedit_emulation)
+ rl_initialize();
+#endif /* __APPLE__ */
+
using_history();
rl_readline_name = "python";
@@ -852,8 +928,13 @@ setup_readline(void)
* XXX: A bug in the readline-2.2 library causes a memory leak
* inside this function. Nothing we can do about it.
*/
- rl_initialize();
-
+#ifdef __APPLE__
+ if (using_libedit_emulation)
+ rl_read_init_file(NULL);
+ else
+#endif /* __APPLE__ */
+ rl_initialize();
+
RESTORE_LOCALE(saved_locale)
}
@@ -1015,10 +1096,19 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
/* we have a valid line */
n = strlen(p);
if (n > 0) {
- char *line;
+ const char *line;
int length = _py_get_history_length();
if (length > 0)
- line = history_get(length)->line;
+#ifdef __APPLE__
+ if (using_libedit_emulation) {
+ /*
+ * Libedit's emulation uses 0-based indexes,
+ * the real readline uses 1-based indexes.
+ */
+ line = (const char *)history_get(length - 1)->line;
+ } else
+#endif /* __APPLE__ */
+ line = (const char *)history_get(length)->line;
else
line = "";
if (strcmp(p, line))
@@ -1044,6 +1134,10 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
PyDoc_STRVAR(doc_module,
"Importing this module enables command line editing using GNU readline.");
+#ifdef __APPLE__
+PyDoc_STRVAR(doc_module_le,
+"Importing this module enables command line editing using libedit readline.");
+#endif /* __APPLE__ */
static struct PyModuleDef readlinemodule = {
PyModuleDef_HEAD_INIT,
@@ -1057,15 +1151,29 @@ static struct PyModuleDef readlinemodule = {
NULL
};
+
PyMODINIT_FUNC
PyInit_readline(void)
{
PyObject *m;
+#ifdef __APPLE__
+ if (strncmp(rl_library_version, libedit_version_tag, strlen(libedit_version_tag)) == 0) {
+ using_libedit_emulation = 1;
+ }
+
+ if (using_libedit_emulation)
+ readlinemodule.m_doc = doc_module_le;
+
+#endif /* __APPLE__ */
+
m = PyModule_Create(&readlinemodule);
+
if (m == NULL)
return NULL;
+
+
PyOS_ReadlineFunctionPointer = call_readline;
setup_readline();
return m;
diff --git a/Modules/resource.c b/Modules/resource.c
index 6d8bd579c5..1875e483f9 100644
--- a/Modules/resource.c
+++ b/Modules/resource.c
@@ -1,6 +1,5 @@
#include "Python.h"
-#include "structseq.h"
#include <sys/resource.h>
#include <sys/time.h>
#include <string.h>
@@ -325,6 +324,10 @@ PyInit_resource(void)
PyModule_AddIntConstant(m, "RUSAGE_BOTH", RUSAGE_BOTH);
#endif
+#ifdef RUSAGE_THREAD
+ PyModule_AddIntConstant(m, "RUSAGE_THREAD", RUSAGE_THREAD);
+#endif
+
#if defined(HAVE_LONG_LONG)
if (sizeof(RLIM_INFINITY) > sizeof(long)) {
v = PyLong_FromLongLong((PY_LONG_LONG) RLIM_INFINITY);
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 3da910cca3..65e1826eba 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -81,17 +81,16 @@ reap_obj(pylist fd2obj[FD_SETSIZE + 1])
static int
seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
{
- int i;
int max = -1;
int index = 0;
- int len = -1;
+ Py_ssize_t i, len = -1;
PyObject* fast_seq = NULL;
PyObject* o = NULL;
fd2obj[0].obj = (PyObject*)0; /* set list to zero size */
FD_ZERO(set);
- fast_seq=PySequence_Fast(seq, "arguments 1-3 must be sequences");
+ fast_seq = PySequence_Fast(seq, "arguments 1-3 must be sequences");
if (!fast_seq)
return -1;
@@ -1190,6 +1189,30 @@ static PyTypeObject kqueue_queue_Type;
#define kqueue_queue_Check(op) (PyObject_TypeCheck((op), &kqueue_queue_Type))
+#if (SIZEOF_UINTPTR_T != SIZEOF_VOID_P)
+# error uintptr_t does not match void *!
+#elif (SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG)
+# define T_UINTPTRT T_ULONGLONG
+# define T_INTPTRT T_LONGLONG
+# define PyLong_AsUintptr_t PyLong_AsUnsignedLongLong
+# define UINTPTRT_FMT_UNIT "K"
+# define INTPTRT_FMT_UNIT "L"
+#elif (SIZEOF_UINTPTR_T == SIZEOF_LONG)
+# define T_UINTPTRT T_ULONG
+# define T_INTPTRT T_LONG
+# define PyLong_AsUintptr_t PyLong_AsUnsignedLong
+# define UINTPTRT_FMT_UNIT "k"
+# define INTPTRT_FMT_UNIT "l"
+#elif (SIZEOF_UINTPTR_T == SIZEOF_INT)
+# define T_UINTPTRT T_UINT
+# define T_INTPTRT T_INT
+# define PyLong_AsUintptr_t PyLong_AsUnsignedLong
+# define UINTPTRT_FMT_UNIT "I"
+# define INTPTRT_FMT_UNIT "i"
+#else
+# error uintptr_t does not match int, long, or long long!
+#endif
+
/* Unfortunately, we can't store python objects in udata, because
* kevents in the kernel can be removed without warning, which would
* forever lose the refcount on the object stored with it.
@@ -1197,27 +1220,28 @@ static PyTypeObject kqueue_queue_Type;
#define KQ_OFF(x) offsetof(kqueue_event_Object, x)
static struct PyMemberDef kqueue_event_members[] = {
- {"ident", T_UINT, KQ_OFF(e.ident)},
+ {"ident", T_UINTPTRT, KQ_OFF(e.ident)},
{"filter", T_SHORT, KQ_OFF(e.filter)},
{"flags", T_USHORT, KQ_OFF(e.flags)},
{"fflags", T_UINT, KQ_OFF(e.fflags)},
- {"data", T_INT, KQ_OFF(e.data)},
- {"udata", T_INT, KQ_OFF(e.udata)},
+ {"data", T_INTPTRT, KQ_OFF(e.data)},
+ {"udata", T_UINTPTRT, KQ_OFF(e.udata)},
{NULL} /* Sentinel */
};
#undef KQ_OFF
static PyObject *
+
kqueue_event_repr(kqueue_event_Object *s)
{
char buf[1024];
PyOS_snprintf(
buf, sizeof(buf),
- "<select.kevent ident=%lu filter=%d flags=0x%x fflags=0x%x "
- "data=0x%lx udata=%p>",
- (unsigned long)(s->e.ident), s->e.filter, s->e.flags,
- s->e.fflags, (long)(s->e.data), s->e.udata);
- return PyBytes_FromString(buf);
+ "<select.kevent ident=%zu filter=%d flags=0x%x fflags=0x%x "
+ "data=0x%zd udata=%p>",
+ (size_t)(s->e.ident), s->e.filter, s->e.flags,
+ s->e.fflags, (Py_ssize_t)(s->e.data), s->e.udata);
+ return PyUnicode_FromString(buf);
}
static int
@@ -1226,17 +1250,23 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds)
PyObject *pfd;
static char *kwlist[] = {"ident", "filter", "flags", "fflags",
"data", "udata", NULL};
+ static char *fmt = "O|hhi" INTPTRT_FMT_UNIT UINTPTRT_FMT_UNIT ":kevent";
EV_SET(&(self->e), 0, EVFILT_READ, EV_ADD, 0, 0, 0); /* defaults */
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|hhiii:kevent", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, fmt, kwlist,
&pfd, &(self->e.filter), &(self->e.flags),
&(self->e.fflags), &(self->e.data), &(self->e.udata))) {
return -1;
}
- self->e.ident = PyObject_AsFileDescriptor(pfd);
- if (self->e.ident == -1) {
+ if (PyLong_Check(pfd)) {
+ self->e.ident = PyLong_AsUintptr_t(pfd);
+ }
+ else {
+ self->e.ident = PyObject_AsFileDescriptor(pfd);
+ }
+ if (PyErr_Occurred()) {
return -1;
}
return 0;
@@ -1246,7 +1276,7 @@ static PyObject *
kqueue_event_richcompare(kqueue_event_Object *s, kqueue_event_Object *o,
int op)
{
- int result = 0;
+ Py_intptr_t result = 0;
if (!kqueue_event_Check(o)) {
if (op == Py_EQ || op == Py_NE) {
@@ -1289,7 +1319,7 @@ kqueue_event_richcompare(kqueue_event_Object *s, kqueue_event_Object *o,
result = (result > 0);
break;
}
- return PyBool_FromLong(result);
+ return PyBool_FromLong((long)result);
}
static PyTypeObject kqueue_event_Type = {
@@ -1487,19 +1517,6 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args)
return NULL;
}
- if (ch != NULL && ch != Py_None) {
- it = PyObject_GetIter(ch);
- if (it == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "changelist is not iterable");
- return NULL;
- }
- nchanges = PyObject_Size(ch);
- if (nchanges < 0) {
- return NULL;
- }
- }
-
if (otimeout == Py_None || otimeout == NULL) {
ptimeoutspec = NULL;
}
@@ -1535,11 +1552,22 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args)
return NULL;
}
- if (nchanges) {
+ if (ch != NULL && ch != Py_None) {
+ it = PyObject_GetIter(ch);
+ if (it == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "changelist is not iterable");
+ return NULL;
+ }
+ nchanges = PyObject_Size(ch);
+ if (nchanges < 0) {
+ goto error;
+ }
+
chl = PyMem_New(struct kevent, nchanges);
if (chl == NULL) {
PyErr_NoMemory();
- return NULL;
+ goto error;
}
i = 0;
while ((ei = PyIter_Next(it)) != NULL) {
@@ -1562,7 +1590,7 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args)
evl = PyMem_New(struct kevent, nevents);
if (evl == NULL) {
PyErr_NoMemory();
- return NULL;
+ goto error;
}
}
@@ -1756,6 +1784,14 @@ PyInit_select(void)
Py_INCREF(SelectError);
PyModule_AddObject(m, "error", SelectError);
+#ifdef PIPE_BUF
+#ifdef HAVE_BROKEN_PIPE_BUF
+#undef PIPE_BUF
+#define PIPE_BUF 512
+#endif
+ PyModule_AddIntConstant(m, "PIPE_BUF", PIPE_BUF);
+#endif
+
#if defined(HAVE_POLL)
#ifdef __APPLE__
if (select_have_broken_poll()) {
diff --git a/Modules/sha1module.c b/Modules/sha1module.c
index b8e88805fc..b25bd44dd1 100644
--- a/Modules/sha1module.c
+++ b/Modules/sha1module.c
@@ -127,50 +127,50 @@ static void sha1_compress(struct sha1_state *sha1, unsigned char *buf)
/* compress */
/* round one */
- #define FF0(a,b,c,d,e,i) e = (ROLc(a, 5) + F0(b,c,d) + e + W[i] + 0x5a827999UL); b = ROLc(b, 30);
- #define FF1(a,b,c,d,e,i) e = (ROLc(a, 5) + F1(b,c,d) + e + W[i] + 0x6ed9eba1UL); b = ROLc(b, 30);
- #define FF2(a,b,c,d,e,i) e = (ROLc(a, 5) + F2(b,c,d) + e + W[i] + 0x8f1bbcdcUL); b = ROLc(b, 30);
- #define FF3(a,b,c,d,e,i) e = (ROLc(a, 5) + F3(b,c,d) + e + W[i] + 0xca62c1d6UL); b = ROLc(b, 30);
+ #define FF_0(a,b,c,d,e,i) e = (ROLc(a, 5) + F0(b,c,d) + e + W[i] + 0x5a827999UL); b = ROLc(b, 30);
+ #define FF_1(a,b,c,d,e,i) e = (ROLc(a, 5) + F1(b,c,d) + e + W[i] + 0x6ed9eba1UL); b = ROLc(b, 30);
+ #define FF_2(a,b,c,d,e,i) e = (ROLc(a, 5) + F2(b,c,d) + e + W[i] + 0x8f1bbcdcUL); b = ROLc(b, 30);
+ #define FF_3(a,b,c,d,e,i) e = (ROLc(a, 5) + F3(b,c,d) + e + W[i] + 0xca62c1d6UL); b = ROLc(b, 30);
for (i = 0; i < 20; ) {
- FF0(a,b,c,d,e,i++);
- FF0(e,a,b,c,d,i++);
- FF0(d,e,a,b,c,i++);
- FF0(c,d,e,a,b,i++);
- FF0(b,c,d,e,a,i++);
+ FF_0(a,b,c,d,e,i++);
+ FF_0(e,a,b,c,d,i++);
+ FF_0(d,e,a,b,c,i++);
+ FF_0(c,d,e,a,b,i++);
+ FF_0(b,c,d,e,a,i++);
}
/* round two */
for (; i < 40; ) {
- FF1(a,b,c,d,e,i++);
- FF1(e,a,b,c,d,i++);
- FF1(d,e,a,b,c,i++);
- FF1(c,d,e,a,b,i++);
- FF1(b,c,d,e,a,i++);
+ FF_1(a,b,c,d,e,i++);
+ FF_1(e,a,b,c,d,i++);
+ FF_1(d,e,a,b,c,i++);
+ FF_1(c,d,e,a,b,i++);
+ FF_1(b,c,d,e,a,i++);
}
/* round three */
for (; i < 60; ) {
- FF2(a,b,c,d,e,i++);
- FF2(e,a,b,c,d,i++);
- FF2(d,e,a,b,c,i++);
- FF2(c,d,e,a,b,i++);
- FF2(b,c,d,e,a,i++);
+ FF_2(a,b,c,d,e,i++);
+ FF_2(e,a,b,c,d,i++);
+ FF_2(d,e,a,b,c,i++);
+ FF_2(c,d,e,a,b,i++);
+ FF_2(b,c,d,e,a,i++);
}
/* round four */
for (; i < 80; ) {
- FF3(a,b,c,d,e,i++);
- FF3(e,a,b,c,d,i++);
- FF3(d,e,a,b,c,i++);
- FF3(c,d,e,a,b,i++);
- FF3(b,c,d,e,a,i++);
+ FF_3(a,b,c,d,e,i++);
+ FF_3(e,a,b,c,d,i++);
+ FF_3(d,e,a,b,c,i++);
+ FF_3(c,d,e,a,b,i++);
+ FF_3(b,c,d,e,a,i++);
}
- #undef FF0
- #undef FF1
- #undef FF2
- #undef FF3
+ #undef FF_0
+ #undef FF_1
+ #undef FF_2
+ #undef FF_3
/* store */
sha1->state[0] = sha1->state[0] + a;
@@ -203,9 +203,9 @@ void sha1_init(struct sha1_state *sha1)
@param inlen The length of the data (octets)
*/
void sha1_process(struct sha1_state *sha1,
- const unsigned char *in, unsigned long inlen)
+ const unsigned char *in, Py_ssize_t inlen)
{
- unsigned long n;
+ Py_ssize_t n;
assert(sha1 != NULL);
assert(in != NULL);
diff --git a/Modules/sha256module.c b/Modules/sha256module.c
index 705b31aab6..8617210917 100644
--- a/Modules/sha256module.c
+++ b/Modules/sha256module.c
@@ -265,9 +265,9 @@ sha224_init(SHAobject *sha_info)
/* update the SHA digest */
static void
-sha_update(SHAobject *sha_info, SHA_BYTE *buffer, int count)
+sha_update(SHAobject *sha_info, SHA_BYTE *buffer, Py_ssize_t count)
{
- int i;
+ Py_ssize_t i;
SHA_INT32 clo;
clo = sha_info->count_lo + ((SHA_INT32) count << 3);
diff --git a/Modules/sha512module.c b/Modules/sha512module.c
index c403ed6113..0faaf5c5cb 100644
--- a/Modules/sha512module.c
+++ b/Modules/sha512module.c
@@ -291,9 +291,9 @@ sha384_init(SHAobject *sha_info)
/* update the SHA digest */
static void
-sha512_update(SHAobject *sha_info, SHA_BYTE *buffer, int count)
+sha512_update(SHAobject *sha_info, SHA_BYTE *buffer, Py_ssize_t count)
{
- int i;
+ Py_ssize_t i;
SHA_INT32 clo;
clo = sha_info->count_lo + ((SHA_INT32) count << 3);
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 14297709c5..00a83b497c 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -4,7 +4,6 @@
/* XXX Signals should be recorded per thread, now we have thread state. */
#include "Python.h"
-#include "intrcheck.h"
#ifdef MS_WINDOWS
#include <Windows.h>
@@ -13,9 +12,12 @@
#endif
#endif
+#ifdef HAVE_SIGNAL_H
#include <signal.h>
-
+#endif
+#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -841,6 +843,18 @@ PyInit_signal(void)
PyDict_SetItemString(d, "ItimerError", ItimerError);
#endif
+#ifdef CTRL_C_EVENT
+ x = PyLong_FromLong(CTRL_C_EVENT);
+ PyDict_SetItemString(d, "CTRL_C_EVENT", x);
+ Py_DECREF(x);
+#endif
+
+#ifdef CTRL_BREAK_EVENT
+ x = PyLong_FromLong(CTRL_BREAK_EVENT);
+ PyDict_SetItemString(d, "CTRL_BREAK_EVENT", x);
+ Py_DECREF(x);
+#endif
+
if (PyErr_Occurred()) {
Py_DECREF(m);
m = NULL;
@@ -948,7 +962,7 @@ PyOS_InitInterrupts(void)
{
PyObject *m = PyInit_signal();
if (m) {
- _PyImport_FixupExtension(m, "signal", "signal");
+ _PyImport_FixupBuiltin(m, "signal");
Py_DECREF(m);
}
}
@@ -977,6 +991,7 @@ void
PyOS_AfterFork(void)
{
#ifdef WITH_THREAD
+ _PyGILState_Reinit();
PyEval_ReInitThreads();
main_thread = PyThread_get_thread_ident();
main_pid = getpid();
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 5e911e0584..e2fdb5e12e 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -476,6 +476,17 @@ select_error(void)
return NULL;
}
+#ifdef MS_WINDOWS
+#ifndef WSAEAGAIN
+#define WSAEAGAIN WSAEWOULDBLOCK
+#endif
+#define CHECK_ERRNO(expected) \
+ (WSAGetLastError() == WSA ## expected)
+#else
+#define CHECK_ERRNO(expected) \
+ (errno == expected)
+#endif
+
/* Convenience function to raise an error according to errno
and return a NULL pointer from a function. */
@@ -606,6 +617,12 @@ internal_setblocking(PySocketSockObject *s, int block)
#ifndef MS_WINDOWS
int delay_flag;
#endif
+#ifdef SOCK_NONBLOCK
+ if (block)
+ s->sock_type &= (~SOCK_NONBLOCK);
+ else
+ s->sock_type |= SOCK_NONBLOCK;
+#endif
Py_BEGIN_ALLOW_THREADS
#ifndef MS_WINDOWS
@@ -639,7 +656,7 @@ internal_setblocking(PySocketSockObject *s, int block)
after they've reacquired the interpreter lock.
Returns 1 on timeout, -1 on error, 0 otherwise. */
static int
-internal_select(PySocketSockObject *s, int writing)
+internal_select_ex(PySocketSockObject *s, int writing, double interval)
{
int n;
@@ -651,6 +668,10 @@ internal_select(PySocketSockObject *s, int writing)
if (s->sock_fd < 0)
return 0;
+ /* Handling this condition here simplifies the select loops */
+ if (interval < 0.0)
+ return 1;
+
/* Prefer poll, if available, since you can poll() any fd
* which can't be done with select(). */
#ifdef HAVE_POLL
@@ -662,7 +683,7 @@ internal_select(PySocketSockObject *s, int writing)
pollfd.events = writing ? POLLOUT : POLLIN;
/* s->sock_timeout is in seconds, timeout in ms */
- timeout = (int)(s->sock_timeout * 1000 + 0.5);
+ timeout = (int)(interval * 1000 + 0.5);
n = poll(&pollfd, 1, timeout);
}
#else
@@ -670,8 +691,8 @@ internal_select(PySocketSockObject *s, int writing)
/* Construct the arguments to select */
fd_set fds;
struct timeval tv;
- tv.tv_sec = (int)s->sock_timeout;
- tv.tv_usec = (int)((s->sock_timeout - tv.tv_sec) * 1e6);
+ tv.tv_sec = (int)interval;
+ tv.tv_usec = (int)((interval - tv.tv_sec) * 1e6);
FD_ZERO(&fds);
FD_SET(s->sock_fd, &fds);
@@ -692,6 +713,53 @@ internal_select(PySocketSockObject *s, int writing)
return 0;
}
+static int
+internal_select(PySocketSockObject *s, int writing)
+{
+ return internal_select_ex(s, writing, s->sock_timeout);
+}
+
+/*
+ Two macros for automatic retry of select() in case of false positives
+ (for example, select() could indicate a socket is ready for reading
+ but the data then discarded by the OS because of a wrong checksum).
+ Here is an example of use:
+
+ BEGIN_SELECT_LOOP(s)
+ Py_BEGIN_ALLOW_THREADS
+ timeout = internal_select_ex(s, 0, interval);
+ if (!timeout)
+ outlen = recv(s->sock_fd, cbuf, len, flags);
+ Py_END_ALLOW_THREADS
+ if (timeout == 1) {
+ PyErr_SetString(socket_timeout, "timed out");
+ return -1;
+ }
+ END_SELECT_LOOP(s)
+*/
+
+#define BEGIN_SELECT_LOOP(s) \
+ { \
+ _PyTime_timeval now, deadline = {0, 0}; \
+ double interval = s->sock_timeout; \
+ int has_timeout = s->sock_timeout > 0.0; \
+ if (has_timeout) { \
+ _PyTime_gettimeofday(&now); \
+ deadline = now; \
+ _PyTime_ADD_SECONDS(deadline, s->sock_timeout); \
+ } \
+ while (1) { \
+ errno = 0; \
+
+#define END_SELECT_LOOP(s) \
+ if (!has_timeout || \
+ (!CHECK_ERRNO(EWOULDBLOCK) && !CHECK_ERRNO(EAGAIN))) \
+ break; \
+ _PyTime_gettimeofday(&now); \
+ interval = _PyTime_INTERVAL(now, deadline); \
+ } \
+ } \
+
/* Initialize a new socket object. */
static double defaulttimeout = -1.0; /* Default timeout for new sockets */
@@ -704,12 +772,18 @@ init_sockobject(PySocketSockObject *s,
s->sock_family = family;
s->sock_type = type;
s->sock_proto = proto;
- s->sock_timeout = defaulttimeout;
s->errorhandler = &set_error;
-
- if (defaulttimeout >= 0.0)
- internal_setblocking(s, 0);
+#ifdef SOCK_NONBLOCK
+ if (type & SOCK_NONBLOCK)
+ s->sock_timeout = 0.0;
+ else
+#endif
+ {
+ s->sock_timeout = defaulttimeout;
+ if (defaulttimeout >= 0.0)
+ internal_setblocking(s, 0);
+ }
}
@@ -1332,9 +1406,9 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
{
struct sockaddr_hci *addr = (struct sockaddr_hci *)addr_ret;
#if defined(__NetBSD__) || defined(__DragonFly__)
- char *straddr = PyBytes_AS_STRING(args);
+ char *straddr = PyBytes_AS_STRING(args);
- _BT_HCI_MEMB(addr, family) = AF_BLUETOOTH;
+ _BT_HCI_MEMB(addr, family) = AF_BLUETOOTH;
if (straddr == NULL) {
PyErr_SetString(socket_error, "getsockaddrarg: "
"wrong format");
@@ -1602,7 +1676,6 @@ sock_accept(PySocketSockObject *s)
PyObject *addr = NULL;
PyObject *res = NULL;
int timeout;
-
if (!getsockaddrlen(s, &addrlen))
return NULL;
memset(&addrbuf, 0, addrlen);
@@ -1610,16 +1683,19 @@ sock_accept(PySocketSockObject *s)
if (!IS_SELECTABLE(s))
return select_error();
+ BEGIN_SELECT_LOOP(s)
Py_BEGIN_ALLOW_THREADS
- timeout = internal_select(s, 0);
- if (!timeout)
+ timeout = internal_select_ex(s, 0, interval);
+ if (!timeout) {
newfd = accept(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
+ }
Py_END_ALLOW_THREADS
if (timeout == 1) {
PyErr_SetString(socket_timeout, "timed out");
return NULL;
}
+ END_SELECT_LOOP(s)
if (newfd == INVALID_SOCKET)
return s->errorhandler();
@@ -1887,6 +1963,21 @@ PyDoc_STRVAR(close_doc,
\n\
Close the socket. It cannot be used after this call.");
+static PyObject *
+sock_detach(PySocketSockObject *s)
+{
+ SOCKET_T fd = s->sock_fd;
+ s->sock_fd = -1;
+ return PyLong_FromSocket_t(fd);
+}
+
+PyDoc_STRVAR(detach_doc,
+"detach()\n\
+\n\
+Close the socket object without closing the underlying file descriptor.\
+The object cannot be used after this call, but the file descriptor\
+can be reused for other purposes. The file descriptor is returned.");
+
static int
internal_connect(PySocketSockObject *s, struct sockaddr *addr, int addrlen,
int *timeoutp)
@@ -2155,6 +2246,7 @@ will allow before refusing new connections.");
* also possible that we return a number of bytes smaller than the request
* bytes.
*/
+
static Py_ssize_t
sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)
{
@@ -2175,8 +2267,9 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)
}
#ifndef __VMS
+ BEGIN_SELECT_LOOP(s)
Py_BEGIN_ALLOW_THREADS
- timeout = internal_select(s, 0);
+ timeout = internal_select_ex(s, 0, interval);
if (!timeout)
outlen = recv(s->sock_fd, cbuf, len, flags);
Py_END_ALLOW_THREADS
@@ -2185,6 +2278,7 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)
PyErr_SetString(socket_timeout, "timed out");
return -1;
}
+ END_SELECT_LOOP(s)
if (outlen < 0) {
/* Note: the call to errorhandler() ALWAYS indirectly returned
NULL, so ignore its return value */
@@ -2206,16 +2300,18 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)
segment = remaining;
}
+ BEGIN_SELECT_LOOP(s)
Py_BEGIN_ALLOW_THREADS
- timeout = internal_select(s, 0);
+ timeout = internal_select_ex(s, 0, interval);
if (!timeout)
nread = recv(s->sock_fd, read_buf, segment, flags);
Py_END_ALLOW_THREADS
-
if (timeout == 1) {
PyErr_SetString(socket_timeout, "timed out");
return -1;
}
+ END_SELECT_LOOP(s)
+
if (nread < 0) {
s->errorhandler();
return -1;
@@ -2376,9 +2472,10 @@ sock_recvfrom_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags,
return -1;
}
+ BEGIN_SELECT_LOOP(s)
Py_BEGIN_ALLOW_THREADS
memset(&addrbuf, 0, addrlen);
- timeout = internal_select(s, 0);
+ timeout = internal_select_ex(s, 0, interval);
if (!timeout) {
#ifndef MS_WINDOWS
#if defined(PYOS_OS2) && !defined(PYCC_GCC)
@@ -2399,6 +2496,7 @@ sock_recvfrom_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags,
PyErr_SetString(socket_timeout, "timed out");
return -1;
}
+ END_SELECT_LOOP(s)
if (n < 0) {
s->errorhandler();
return -1;
@@ -2536,8 +2634,9 @@ sock_send(PySocketSockObject *s, PyObject *args)
buf = pbuf.buf;
len = pbuf.len;
+ BEGIN_SELECT_LOOP(s)
Py_BEGIN_ALLOW_THREADS
- timeout = internal_select(s, 1);
+ timeout = internal_select_ex(s, 1, interval);
if (!timeout)
#ifdef __VMS
n = sendsegmented(s->sock_fd, buf, len, flags);
@@ -2545,13 +2644,14 @@ sock_send(PySocketSockObject *s, PyObject *args)
n = send(s->sock_fd, buf, len, flags);
#endif
Py_END_ALLOW_THREADS
-
- PyBuffer_Release(&pbuf);
-
if (timeout == 1) {
+ PyBuffer_Release(&pbuf);
PyErr_SetString(socket_timeout, "timed out");
return NULL;
}
+ END_SELECT_LOOP(s)
+
+ PyBuffer_Release(&pbuf);
if (n < 0)
return s->errorhandler();
return PyLong_FromSsize_t(n);
@@ -2682,17 +2782,20 @@ sock_sendto(PySocketSockObject *s, PyObject *args)
return NULL;
}
+ BEGIN_SELECT_LOOP(s)
Py_BEGIN_ALLOW_THREADS
- timeout = internal_select(s, 1);
+ timeout = internal_select_ex(s, 1, interval);
if (!timeout)
n = sendto(s->sock_fd, buf, len, flags, SAS2SA(&addrbuf), addrlen);
Py_END_ALLOW_THREADS
- PyBuffer_Release(&pbuf);
if (timeout == 1) {
+ PyBuffer_Release(&pbuf);
PyErr_SetString(socket_timeout, "timed out");
return NULL;
}
+ END_SELECT_LOOP(s)
+ PyBuffer_Release(&pbuf);
if (n < 0)
return s->errorhandler();
return PyLong_FromSsize_t(n);
@@ -2736,24 +2839,43 @@ static PyObject*
sock_ioctl(PySocketSockObject *s, PyObject *arg)
{
unsigned long cmd = SIO_RCVALL;
- unsigned int option = RCVALL_ON;
+ PyObject *argO;
DWORD recv;
- if (!PyArg_ParseTuple(arg, "kI:ioctl", &cmd, &option))
+ if (!PyArg_ParseTuple(arg, "kO:ioctl", &cmd, &argO))
return NULL;
- if (WSAIoctl(s->sock_fd, cmd, &option, sizeof(option),
- NULL, 0, &recv, NULL, NULL) == SOCKET_ERROR) {
- return set_error();
+ switch (cmd) {
+ case SIO_RCVALL: {
+ unsigned int option = RCVALL_ON;
+ if (!PyArg_ParseTuple(arg, "kI:ioctl", &cmd, &option))
+ return NULL;
+ if (WSAIoctl(s->sock_fd, cmd, &option, sizeof(option),
+ NULL, 0, &recv, NULL, NULL) == SOCKET_ERROR) {
+ return set_error();
+ }
+ return PyLong_FromUnsignedLong(recv); }
+ case SIO_KEEPALIVE_VALS: {
+ struct tcp_keepalive ka;
+ if (!PyArg_ParseTuple(arg, "k(kkk):ioctl", &cmd,
+ &ka.onoff, &ka.keepalivetime, &ka.keepaliveinterval))
+ return NULL;
+ if (WSAIoctl(s->sock_fd, cmd, &ka, sizeof(ka),
+ NULL, 0, &recv, NULL, NULL) == SOCKET_ERROR) {
+ return set_error();
+ }
+ return PyLong_FromUnsignedLong(recv); }
+ default:
+ PyErr_Format(PyExc_ValueError, "invalid ioctl command %d", cmd);
+ return NULL;
}
- return PyLong_FromUnsignedLong(recv);
}
PyDoc_STRVAR(sock_ioctl_doc,
"ioctl(cmd, option) -> long\n\
\n\
-Control the socket with WSAIoctl syscall. Currently only socket.SIO_RCVALL\n\
-is supported as control. Options must be one of the socket.RCVALL_*\n\
-constants.");
+Control the socket with WSAIoctl syscall. Currently supported 'cmd' values are\n\
+SIO_RCVALL: 'option' must be one of the socket.RCVALL_* constants.\n\
+SIO_KEEPALIVE_VALS: 'option' is a tuple of (onoff, timeout, interval).");
#endif
@@ -2770,6 +2892,8 @@ static PyMethodDef sock_methods[] = {
connect_doc},
{"connect_ex", (PyCFunction)sock_connect_ex, METH_O,
connect_ex_doc},
+ {"detach", (PyCFunction)sock_detach, METH_NOARGS,
+ detach_doc},
{"fileno", (PyCFunction)sock_fileno, METH_NOARGS,
fileno_doc},
#ifdef HAVE_GETPEERNAME
@@ -2828,8 +2952,20 @@ static PyMemberDef sock_memberlist[] = {
static void
sock_dealloc(PySocketSockObject *s)
{
- if (s->sock_fd != -1)
+ if (s->sock_fd != -1) {
+ PyObject *exc, *val, *tb;
+ Py_ssize_t old_refcount = Py_REFCNT(s);
+ ++Py_REFCNT(s);
+ PyErr_Fetch(&exc, &val, &tb);
+ if (PyErr_WarnFormat(PyExc_ResourceWarning, 1,
+ "unclosed %R", s))
+ /* Spurious errors can appear at shutdown */
+ if (PyErr_ExceptionMatches(PyExc_Warning))
+ PyErr_WriteUnraisable((PyObject *) s);
+ PyErr_Restore(exc, val, tb);
(void) SOCKETCLOSE(s->sock_fd);
+ Py_REFCNT(s) = old_refcount;
+ }
Py_TYPE(s)->tp_free((PyObject *)s);
}
@@ -2968,6 +3104,31 @@ static PyTypeObject sock_type = {
static PyObject *
socket_gethostname(PyObject *self, PyObject *unused)
{
+#ifdef MS_WINDOWS
+ /* Don't use winsock's gethostname, as this returns the ANSI
+ version of the hostname, whereas we need a Unicode string.
+ Otherwise, gethostname apparently also returns the DNS name. */
+ wchar_t buf[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD size = sizeof(buf) / sizeof(wchar_t);
+ PyObject *result;
+ if (!GetComputerNameExW(ComputerNamePhysicalDnsHostname, buf, &size)) {
+ if (GetLastError() == ERROR_MORE_DATA) {
+ /* MSDN says this may occur "because DNS allows longer names */
+ if (size == 0) /* XXX: I'm not sure how to handle this */
+ return PyUnicode_FromUnicode(NULL, 0);
+ result = PyUnicode_FromUnicode(NULL, size - 1);
+ if (!result)
+ return NULL;
+ if (GetComputerNameExW(ComputerNamePhysicalDnsHostname,
+ PyUnicode_AS_UNICODE(result),
+ &size))
+ return result;
+ Py_DECREF(result);
+ }
+ return PyErr_SetExcFromWindowsErr(PyExc_WindowsError, GetLastError());
+ }
+ return PyUnicode_FromUnicode(buf, size);
+#else
char buf[1024];
int res;
Py_BEGIN_ALLOW_THREADS
@@ -2977,6 +3138,7 @@ socket_gethostname(PyObject *self, PyObject *unused)
return set_error();
buf[sizeof buf - 1] = '\0';
return PyUnicode_FromString(buf);
+#endif
}
PyDoc_STRVAR(gethostname_doc,
@@ -2993,12 +3155,16 @@ socket_gethostbyname(PyObject *self, PyObject *args)
{
char *name;
sock_addr_t addrbuf;
+ PyObject *ret = NULL;
- if (!PyArg_ParseTuple(args, "s:gethostbyname", &name))
+ if (!PyArg_ParseTuple(args, "et:gethostbyname", "idna", &name))
return NULL;
if (setipaddr(name, SAS2SA(&addrbuf), sizeof(addrbuf), AF_INET) < 0)
- return NULL;
- return makeipaddr(SAS2SA(&addrbuf), sizeof(struct sockaddr_in));
+ goto finally;
+ ret = makeipaddr(SAS2SA(&addrbuf), sizeof(struct sockaddr_in));
+finally:
+ PyMem_Free(name);
+ return ret;
}
PyDoc_STRVAR(gethostbyname_doc,
@@ -3149,7 +3315,7 @@ socket_gethostbyname_ex(PyObject *self, PyObject *args)
struct sockaddr_in addr;
#endif
struct sockaddr *sa;
- PyObject *ret;
+ PyObject *ret = NULL;
#ifdef HAVE_GETHOSTBYNAME_R
struct hostent hp_allocated;
#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
@@ -3164,10 +3330,10 @@ socket_gethostbyname_ex(PyObject *self, PyObject *args)
#endif
#endif /* HAVE_GETHOSTBYNAME_R */
- if (!PyArg_ParseTuple(args, "s:gethostbyname_ex", &name))
+ if (!PyArg_ParseTuple(args, "et:gethostbyname_ex", "idna", &name))
return NULL;
if (setipaddr(name, (struct sockaddr *)&addr, sizeof(addr), AF_INET) < 0)
- return NULL;
+ goto finally;
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_GETHOSTBYNAME_R
#if defined(HAVE_GETHOSTBYNAME_R_6_ARG)
@@ -3197,6 +3363,8 @@ socket_gethostbyname_ex(PyObject *self, PyObject *args)
#ifdef USE_GETHOSTBYNAME_LOCK
PyThread_release_lock(netdb_lock);
#endif
+finally:
+ PyMem_Free(name);
return ret;
}
@@ -3221,7 +3389,7 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
struct sockaddr *sa = (struct sockaddr *)&addr;
char *ip_num;
struct hostent *h;
- PyObject *ret;
+ PyObject *ret = NULL;
#ifdef HAVE_GETHOSTBYNAME_R
struct hostent hp_allocated;
#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
@@ -3243,11 +3411,11 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
int al;
int af;
- if (!PyArg_ParseTuple(args, "s:gethostbyaddr", &ip_num))
+ if (!PyArg_ParseTuple(args, "et:gethostbyaddr", "idna", &ip_num))
return NULL;
af = AF_UNSPEC;
if (setipaddr(ip_num, sa, sizeof(addr), af) < 0)
- return NULL;
+ goto finally;
af = sa->sa_family;
ap = NULL;
al = 0;
@@ -3264,7 +3432,7 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
#endif
default:
PyErr_SetString(socket_error, "unsupported address family");
- return NULL;
+ goto finally;
}
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_GETHOSTBYNAME_R
@@ -3291,6 +3459,8 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
#ifdef USE_GETHOSTBYNAME_LOCK
PyThread_release_lock(netdb_lock);
#endif
+finally:
+ PyMem_Free(ip_num);
return ret;
}
@@ -3818,8 +3988,10 @@ socket_inet_ntop(PyObject *self, PyObject *args)
/*ARGSUSED*/
static PyObject *
-socket_getaddrinfo(PyObject *self, PyObject *args)
+socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
{
+ static char* kwnames[] = {"host", "port", "family", "type", "proto",
+ "flags", 0};
struct addrinfo hints, *res;
struct addrinfo *res0 = NULL;
PyObject *hobj = NULL;
@@ -3833,8 +4005,8 @@ socket_getaddrinfo(PyObject *self, PyObject *args)
family = socktype = protocol = flags = 0;
family = AF_UNSPEC;
- if (!PyArg_ParseTuple(args, "OO|iiii:getaddrinfo",
- &hobj, &pobj, &family, &socktype,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iiii:getaddrinfo",
+ kwnames, &hobj, &pobj, &family, &socktype,
&protocol, &flags)) {
return NULL;
}
@@ -3861,8 +4033,10 @@ socket_getaddrinfo(PyObject *self, PyObject *args)
pptr = pbuf;
} else if (PyUnicode_Check(pobj)) {
pptr = _PyUnicode_AsString(pobj);
+ if (pptr == NULL)
+ goto err;
} else if (PyBytes_Check(pobj)) {
- pptr = PyBytes_AsString(pobj);
+ pptr = PyBytes_AS_STRING(pobj);
} else if (pobj == Py_None) {
pptr = (char *)NULL;
} else {
@@ -3952,6 +4126,7 @@ socket_getnameinfo(PyObject *self, PyObject *args)
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM; /* make numeric port happy */
+ hints.ai_flags = AI_NUMERICHOST; /* don't do any name resolution */
Py_BEGIN_ALLOW_THREADS
ACQUIRE_GETADDRINFO_LOCK
error = getaddrinfo(hostp, pbuf, &hints, &res);
@@ -4101,8 +4276,8 @@ static PyMethodDef socket_methods[] = {
{"inet_ntop", socket_inet_ntop,
METH_VARARGS, inet_ntop_doc},
#endif
- {"getaddrinfo", socket_getaddrinfo,
- METH_VARARGS, getaddrinfo_doc},
+ {"getaddrinfo", (PyCFunction)socket_getaddrinfo,
+ METH_VARARGS | METH_KEYWORDS, getaddrinfo_doc},
{"getnameinfo", socket_getnameinfo,
METH_VARARGS, getnameinfo_doc},
{"getdefaulttimeout", (PyCFunction)socket_getdefaulttimeout,
@@ -4196,6 +4371,7 @@ static
PySocketModule_APIObject PySocketModuleAPI =
{
&sock_type,
+ NULL,
NULL
};
@@ -4263,6 +4439,7 @@ PyInit__socket(void)
socket_error, NULL);
if (socket_timeout == NULL)
return NULL;
+ PySocketModuleAPI.timeout_error = socket_timeout;
Py_INCREF(socket_timeout);
PyModule_AddObject(m, "timeout", socket_timeout);
Py_INCREF((PyObject *)&sock_type);
@@ -4526,6 +4703,12 @@ PyInit__socket(void)
#if defined(SOCK_RDM)
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
#endif
+#ifdef SOCK_CLOEXEC
+ PyModule_AddIntConstant(m, "SOCK_CLOEXEC", SOCK_CLOEXEC);
+#endif
+#ifdef SOCK_NONBLOCK
+ PyModule_AddIntConstant(m, "SOCK_NONBLOCK", SOCK_NONBLOCK);
+#endif
#ifdef SO_DEBUG
PyModule_AddIntConstant(m, "SO_DEBUG", SO_DEBUG);
@@ -4585,6 +4768,9 @@ PyInit__socket(void)
#ifdef SO_TYPE
PyModule_AddIntConstant(m, "SO_TYPE", SO_TYPE);
#endif
+#ifdef SO_SETFIB
+ PyModule_AddIntConstant(m, "SO_SETFIB", SO_SETFIB);
+#endif
/* Maximum number of connections for "listen" */
#ifdef SOMAXCONN
@@ -5131,11 +5317,16 @@ PyInit__socket(void)
#ifdef SIO_RCVALL
{
- PyObject *tmp;
- tmp = PyLong_FromUnsignedLong(SIO_RCVALL);
- if (tmp == NULL)
- return NULL;
- PyModule_AddObject(m, "SIO_RCVALL", tmp);
+ DWORD codes[] = {SIO_RCVALL, SIO_KEEPALIVE_VALS};
+ const char *names[] = {"SIO_RCVALL", "SIO_KEEPALIVE_VALS"};
+ int i;
+ for(i = 0; i<sizeof(codes)/sizeof(*codes); ++i) {
+ PyObject *tmp;
+ tmp = PyLong_FromUnsignedLong(codes[i]);
+ if (tmp == NULL)
+ return NULL;
+ PyModule_AddObject(m, names[i], tmp);
+ }
}
PyModule_AddIntConstant(m, "RCVALL_OFF", RCVALL_OFF);
PyModule_AddIntConstant(m, "RCVALL_ON", RCVALL_ON);
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index 4f426f5d85..f064795b80 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -196,6 +196,7 @@ typedef struct {
typedef struct {
PyTypeObject *Sock_Type;
PyObject *error;
+ PyObject *timeout_error;
} PySocketModule_APIObject;
#define PySocketModule_ImportModuleAndAPI() PyCapsule_Import(PySocket_CAPSULE_NAME, 1)
diff --git a/Modules/spwdmodule.c b/Modules/spwdmodule.c
index 3a62fe8c0d..194ae196ba 100644
--- a/Modules/spwdmodule.c
+++ b/Modules/spwdmodule.c
@@ -4,7 +4,6 @@
/* For info also see http://www.unixpapa.com/incnote/passwd.html */
#include "Python.h"
-#include "structseq.h"
#include <sys/types.h>
#ifdef HAVE_SHADOW_H
@@ -60,9 +59,7 @@ static void
sets(PyObject *v, int i, const char* val)
{
if (val) {
- PyObject *o = PyUnicode_Decode(val, strlen(val),
- Py_FileSystemDefaultEncoding,
- "surrogateescape");
+ PyObject *o = PyUnicode_DecodeFSDefault(val);
PyStructSequence_SET_ITEM(v, i, o);
} else {
PyStructSequence_SET_ITEM(v, i, Py_None);
@@ -120,9 +117,7 @@ static PyObject* spwd_getspnam(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "U:getspnam", &arg))
return NULL;
- if ((bytes = PyUnicode_AsEncodedString(arg,
- Py_FileSystemDefaultEncoding,
- "surrogateescape")) == NULL)
+ if ((bytes = PyUnicode_EncodeFSDefault(arg)) == NULL)
return NULL;
if (PyBytes_AsStringAndSize(bytes, &name, NULL) == -1)
goto out;
diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c
index 26e27685bd..f6201e5bb0 100644
--- a/Modules/symtablemodule.c
+++ b/Modules/symtablemodule.c
@@ -1,7 +1,6 @@
#include "Python.h"
#include "code.h"
-#include "compile.h"
#include "Python-ast.h"
#include "symtable.h"
@@ -71,11 +70,7 @@ PyInit__symtable(void)
PyModule_AddIntConstant(m, "DEF_GLOBAL", DEF_GLOBAL);
PyModule_AddIntConstant(m, "DEF_LOCAL", DEF_LOCAL);
PyModule_AddIntConstant(m, "DEF_PARAM", DEF_PARAM);
- PyModule_AddIntConstant(m, "DEF_STAR", DEF_STAR);
- PyModule_AddIntConstant(m, "DEF_DOUBLESTAR", DEF_DOUBLESTAR);
- PyModule_AddIntConstant(m, "DEF_INTUPLE", DEF_INTUPLE);
PyModule_AddIntConstant(m, "DEF_FREE", DEF_FREE);
- PyModule_AddIntConstant(m, "DEF_FREE_GLOBAL", DEF_FREE_GLOBAL);
PyModule_AddIntConstant(m, "DEF_FREE_CLASS", DEF_FREE_CLASS);
PyModule_AddIntConstant(m, "DEF_IMPORT", DEF_IMPORT);
PyModule_AddIntConstant(m, "DEF_BOUND", DEF_BOUND);
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c
index 5532d03a27..5b86963fc8 100644
--- a/Modules/syslogmodule.c
+++ b/Modules/syslogmodule.c
@@ -26,6 +26,11 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Revision history:
+2010/04/20 (Sean Reifschneider)
+ - Use basename(sys.argv[0]) for the default "ident".
+ - Arguments to openlog() are now keyword args and are all optional.
+ - syslog() calls openlog() if it hasn't already been called.
+
1998/04/28 (Sean Reifschneider)
- When facility not specified to syslog() method, use default from openlog()
(This is how it was claimed to work in the documentation)
@@ -45,37 +50,102 @@ Revision history:
/* syslog module */
#include "Python.h"
+#include "osdefs.h"
#include <syslog.h>
/* only one instance, only one syslog, so globals should be ok */
static PyObject *S_ident_o = NULL; /* identifier, held by openlog() */
+static char S_log_open = 0;
static PyObject *
-syslog_openlog(PyObject * self, PyObject * args)
+syslog_get_argv(void)
+{
+ /* Figure out what to use for as the program "ident" for openlog().
+ * This swallows exceptions and continues rather than failing out,
+ * because the syslog module can still be used because openlog(3)
+ * is optional.
+ */
+
+ Py_ssize_t argv_len, scriptlen;
+ PyObject *scriptobj;
+ Py_UNICODE *atslash, *atstart;
+ PyObject *argv = PySys_GetObject("argv");
+
+ if (argv == NULL) {
+ return(NULL);
+ }
+
+ argv_len = PyList_Size(argv);
+ if (argv_len == -1) {
+ PyErr_Clear();
+ return(NULL);
+ }
+ if (argv_len == 0) {
+ return(NULL);
+ }
+
+ scriptobj = PyList_GetItem(argv, 0);
+ if (!PyUnicode_Check(scriptobj)) {
+ return(NULL);
+ }
+ scriptlen = PyUnicode_GET_SIZE(scriptobj);
+ if (scriptlen == 0) {
+ return(NULL);
+ }
+
+ atstart = PyUnicode_AS_UNICODE(scriptobj);
+ atslash = Py_UNICODE_strrchr(atstart, SEP);
+ if (atslash) {
+ return(PyUnicode_FromUnicode(atslash + 1,
+ scriptlen - (atslash - atstart) - 1));
+ } else {
+ Py_INCREF(scriptobj);
+ return(scriptobj);
+ }
+
+ return(NULL);
+}
+
+
+static PyObject *
+syslog_openlog(PyObject * self, PyObject * args, PyObject *kwds)
{
long logopt = 0;
long facility = LOG_USER;
- PyObject *new_S_ident_o;
- const char *ident;
+ PyObject *new_S_ident_o = NULL;
+ static char *keywords[] = {"ident", "logoption", "facility", 0};
+ char *ident = NULL;
- if (!PyArg_ParseTuple(args,
- "U|ll;ident string [, logoption [, facility]]",
- &new_S_ident_o, &logopt, &facility))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "|Ull:openlog", keywords, &new_S_ident_o, &logopt, &facility))
return NULL;
- /* This is needed because openlog() does NOT make a copy
- * and syslog() later uses it.. cannot trash it.
- */
+ if (new_S_ident_o) {
+ Py_INCREF(new_S_ident_o);
+ }
+
+ /* get sys.argv[0] or NULL if we can't for some reason */
+ if (!new_S_ident_o) {
+ new_S_ident_o = syslog_get_argv();
+ }
+
Py_XDECREF(S_ident_o);
S_ident_o = new_S_ident_o;
- Py_INCREF(S_ident_o);
- ident = _PyUnicode_AsString(S_ident_o);
- if (ident == NULL)
- return NULL;
+ /* At this point, S_ident_o should be INCREF()ed. openlog(3) does not
+ * make a copy, and syslog(3) later uses it. We can't garbagecollect it
+ * If NULL, just let openlog figure it out (probably using C argv[0]).
+ */
+ if (S_ident_o) {
+ ident = _PyUnicode_AsString(S_ident_o);
+ if (ident == NULL)
+ return NULL;
+ }
+
openlog(ident, logopt, facility);
+ S_log_open = 1;
Py_INCREF(Py_None);
return Py_None;
@@ -100,6 +170,22 @@ syslog_syslog(PyObject * self, PyObject * args)
message = _PyUnicode_AsString(message_object);
if (message == NULL)
return NULL;
+
+ /* if log is not opened, open it now */
+ if (!S_log_open) {
+ PyObject *openargs;
+
+ /* Continue even if PyTuple_New fails, because openlog(3) is optional.
+ * So, we can still do loggin in the unlikely event things are so hosed
+ * that we can't do this tuple.
+ */
+ if ((openargs = PyTuple_New(0))) {
+ PyObject *openlog_ret = syslog_openlog(self, openargs, NULL);
+ Py_XDECREF(openlog_ret);
+ Py_DECREF(openargs);
+ }
+ }
+
Py_BEGIN_ALLOW_THREADS;
syslog(priority, "%s", message);
Py_END_ALLOW_THREADS;
@@ -109,9 +195,12 @@ syslog_syslog(PyObject * self, PyObject * args)
static PyObject *
syslog_closelog(PyObject *self, PyObject *unused)
{
- closelog();
- Py_XDECREF(S_ident_o);
- S_ident_o = NULL;
+ if (S_log_open) {
+ closelog();
+ Py_XDECREF(S_ident_o);
+ S_ident_o = NULL;
+ S_log_open = 0;
+ }
Py_INCREF(Py_None);
return Py_None;
}
@@ -152,7 +241,7 @@ syslog_log_upto(PyObject *self, PyObject *args)
/* List of functions defined in the module */
static PyMethodDef syslog_methods[] = {
- {"openlog", syslog_openlog, METH_VARARGS},
+ {"openlog", (PyCFunction) syslog_openlog, METH_VARARGS | METH_KEYWORDS},
{"closelog", syslog_closelog, METH_NOARGS},
{"syslog", syslog_syslog, METH_VARARGS},
{"setlogmask", syslog_setlogmask, METH_VARARGS},
diff --git a/Modules/termios.c b/Modules/termios.c
index 97a0da2bcc..edeb6f5c45 100644
--- a/Modules/termios.c
+++ b/Modules/termios.c
@@ -347,6 +347,43 @@ static struct constant {
#ifdef B230400
{"B230400", B230400},
#endif
+#ifdef B460800
+ {"B460800", B460800},
+#endif
+#ifdef B500000
+ {"B500000", B500000},
+#endif
+#ifdef B576000
+ {"B576000", B576000},
+#endif
+#ifdef B921600
+ {"B921600", B921600},
+#endif
+#ifdef B1000000
+ {"B1000000", B1000000},
+#endif
+#ifdef B1152000
+ {"B1152000", B1152000},
+#endif
+#ifdef B1500000
+ {"B1500000", B1500000},
+#endif
+#ifdef B2000000
+ {"B2000000", B2000000},
+#endif
+#ifdef B2500000
+ {"B2500000", B2500000},
+#endif
+#ifdef B3000000
+ {"B3000000", B3000000},
+#endif
+#ifdef B3500000
+ {"B3500000", B3500000},
+#endif
+#ifdef B4000000
+ {"B4000000", B4000000},
+#endif
+
#ifdef CBAUDEX
{"CBAUDEX", CBAUDEX},
#endif
@@ -355,6 +392,9 @@ static struct constant {
{"TCSANOW", TCSANOW},
{"TCSADRAIN", TCSADRAIN},
{"TCSAFLUSH", TCSAFLUSH},
+#ifdef TCSASOFT
+ {"TCSASOFT", TCSASOFT},
+#endif
/* tcflush() constants */
{"TCIFLUSH", TCIFLUSH},
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index faed0e18f2..3af041a2b6 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -1,24 +1,10 @@
-
/* Time module */
#include "Python.h"
-#include "structseq.h"
-#include "timefuncs.h"
+#include "_time.h"
#define TZNAME_ENCODING "utf-8"
-#ifdef __APPLE__
-#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_FTIME)
- /*
- * floattime falls back to ftime when getttimeofday fails because the latter
- * might fail on some platforms. This fallback is unwanted on MacOSX because
- * that makes it impossible to use a binary build on OSX 10.4 on earlier
- * releases of the OS. Therefore claim we don't support ftime.
- */
-# undef HAVE_FTIME
-#endif
-#endif
-
#include <ctype.h>
#ifdef HAVE_SYS_TYPES_H
@@ -29,13 +15,6 @@
#include <io.h>
#endif
-#ifdef HAVE_FTIME
-#include <sys/timeb.h>
-#if !defined(MS_WINDOWS) && !defined(PYOS_OS2)
-extern int ftime(struct timeb *);
-#endif /* MS_WINDOWS */
-#endif /* HAVE_FTIME */
-
#if defined(__WATCOMC__) && !defined(__QNX__)
#include <i86.h>
#else
@@ -90,32 +69,6 @@ static double floattime(void);
/* For Y2K check */
static PyObject *moddict;
-/* Exposed in timefuncs.h. */
-time_t
-_PyTime_DoubleToTimet(double x)
-{
- time_t result;
- double diff;
-
- result = (time_t)x;
- /* How much info did we lose? time_t may be an integral or
- * floating type, and we don't know which. If it's integral,
- * we don't know whether C truncates, rounds, returns the floor,
- * etc. If we lost a second or more, the C rounding is
- * unreasonable, or the input just doesn't fit in a time_t;
- * call it an error regardless. Note that the original cast to
- * time_t can cause a C error too, but nothing we can do to
- * worm around that.
- */
- diff = x - (double)result;
- if (diff <= -1.0 || diff >= 1.0) {
- PyErr_SetString(PyExc_ValueError,
- "timestamp out of range for platform time_t");
- result = (time_t)-1;
- }
- return result;
-}
-
static PyObject *
time_time(PyObject *self, PyObject *unused)
{
@@ -208,21 +161,27 @@ Delay execution for a given number of seconds. The argument may be\n\
a floating point number for subsecond precision.");
static PyStructSequence_Field struct_time_type_fields[] = {
- {"tm_year", NULL},
- {"tm_mon", NULL},
- {"tm_mday", NULL},
- {"tm_hour", NULL},
- {"tm_min", NULL},
- {"tm_sec", NULL},
- {"tm_wday", NULL},
- {"tm_yday", NULL},
- {"tm_isdst", NULL},
+ {"tm_year", "year, for example, 1993"},
+ {"tm_mon", "month of year, range [1, 12]"},
+ {"tm_mday", "day of month, range [1, 31]"},
+ {"tm_hour", "hours, range [0, 23]"},
+ {"tm_min", "minutes, range [0, 59]"},
+ {"tm_sec", "seconds, range [0, 61])"},
+ {"tm_wday", "day of week, range [0, 6], Monday is 0"},
+ {"tm_yday", "day of year, range [1, 366]"},
+ {"tm_isdst", "1 if summer time is in effect, 0 if not, and -1 if unknown"},
{0}
};
static PyStructSequence_Desc struct_time_type_desc = {
"time.struct_time",
- NULL,
+ "The time value as returned by gmtime(), localtime(), and strptime(), and\n"
+ " accepted by asctime(), mktime() and strftime(). May be considered as a\n"
+ " sequence of 9 integers.\n\n"
+ " Note that several fields' values are not the same as those defined by\n"
+ " the C language standard for struct tm. For example, the value of the\n"
+ " field tm_year is the actual year, not year - 1900. See individual\n"
+ " fields' descriptions for details.",
struct_time_type_fields,
9,
};
@@ -258,29 +217,6 @@ tmtotuple(struct tm *p)
}
static PyObject *
-structtime_totuple(PyObject *t)
-{
- PyObject *x = NULL;
- unsigned int i;
- PyObject *v = PyTuple_New(9);
- if (v == NULL)
- return NULL;
-
- for (i=0; i<9; i++) {
- x = PyStructSequence_GET_ITEM(t, i);
- Py_INCREF(x);
- PyTuple_SET_ITEM(v, i, x);
- }
-
- if (PyErr_Occurred()) {
- Py_XDECREF(v);
- return NULL;
- }
-
- return v;
-}
-
-static PyObject *
time_convert(double when, struct tm * (*function)(const time_t *))
{
struct tm *p;
@@ -354,60 +290,69 @@ PyDoc_STRVAR(localtime_doc,
Convert seconds since the Epoch to a time tuple expressing local time.\n\
When 'seconds' is not passed in, convert the current time instead.");
+/* Convert 9-item tuple to tm structure. Return 1 on success, set
+ * an exception and return 0 on error.
+ */
static int
gettmarg(PyObject *args, struct tm *p)
{
int y;
- PyObject *t = NULL;
memset((void *) p, '\0', sizeof(struct tm));
- if (PyTuple_Check(args)) {
- t = args;
- Py_INCREF(t);
- }
- else if (Py_TYPE(args) == &StructTimeType) {
- t = structtime_totuple(args);
- }
- else {
+ if (!PyTuple_Check(args)) {
PyErr_SetString(PyExc_TypeError,
"Tuple or struct_time argument required");
return 0;
}
- if (t == NULL || !PyArg_ParseTuple(t, "iiiiiiiii",
- &y,
- &p->tm_mon,
- &p->tm_mday,
- &p->tm_hour,
- &p->tm_min,
- &p->tm_sec,
- &p->tm_wday,
- &p->tm_yday,
- &p->tm_isdst)) {
- Py_XDECREF(t);
+ if (!PyArg_ParseTuple(args, "iiiiiiiii",
+ &y, &p->tm_mon, &p->tm_mday,
+ &p->tm_hour, &p->tm_min, &p->tm_sec,
+ &p->tm_wday, &p->tm_yday, &p->tm_isdst))
return 0;
- }
- Py_DECREF(t);
- if (y < 1900) {
+ /* If year is specified with less than 4 digits, its interpretation
+ * depends on the accept2dyear value.
+ *
+ * If accept2dyear is true (default), a backward compatibility behavior is
+ * invoked as follows:
+ *
+ * - for 2-digit year, century is guessed according to POSIX rules for
+ * %y strptime format: 21st century for y < 69, 20th century
+ * otherwise. A deprecation warning is issued when century
+ * information is guessed in this way.
+ *
+ * - for 3-digit or negative year, a ValueError exception is raised.
+ *
+ * If accept2dyear is false (set by the program or as a result of a
+ * non-empty value assigned to PYTHONY2K environment variable) all year
+ * values are interpreted as given.
+ */
+ if (y < 1000) {
PyObject *accept = PyDict_GetItemString(moddict,
"accept2dyear");
- if (accept == NULL || !PyLong_CheckExact(accept) ||
- !PyObject_IsTrue(accept)) {
- PyErr_SetString(PyExc_ValueError,
- "year >= 1900 required");
- return 0;
+ if (accept != NULL) {
+ int acceptval = PyObject_IsTrue(accept);
+ if (acceptval == -1)
+ return 0;
+ if (acceptval) {
+ if (0 <= y && y < 69)
+ y += 2000;
+ else if (69 <= y && y < 100)
+ y += 1900;
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "year out of range");
+ return 0;
+ }
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "Century info guessed for a 2-digit year.", 1) != 0)
+ return 0;
+ }
}
- if (69 <= y && y <= 99)
- y += 1900;
- else if (0 <= y && y <= 68)
- y += 2000;
- else {
- PyErr_SetString(PyExc_ValueError,
- "year out of range");
+ else
return 0;
- }
}
p->tm_year = y - 1900;
p->tm_mon--;
@@ -416,6 +361,76 @@ gettmarg(PyObject *args, struct tm *p)
return 1;
}
+/* Check values of the struct tm fields before it is passed to strftime() and
+ * asctime(). Return 1 if all values are valid, otherwise set an exception
+ * and returns 0.
+ */
+static int
+checktm(struct tm* buf)
+{
+ /* Checks added to make sure strftime() and asctime() does not crash Python by
+ indexing blindly into some array for a textual representation
+ by some bad index (fixes bug #897625 and #6608).
+
+ Also support values of zero from Python code for arguments in which
+ that is out of range by forcing that value to the lowest value that
+ is valid (fixed bug #1520914).
+
+ Valid ranges based on what is allowed in struct tm:
+
+ - tm_year: [0, max(int)] (1)
+ - tm_mon: [0, 11] (2)
+ - tm_mday: [1, 31]
+ - tm_hour: [0, 23]
+ - tm_min: [0, 59]
+ - tm_sec: [0, 60]
+ - tm_wday: [0, 6] (1)
+ - tm_yday: [0, 365] (2)
+ - tm_isdst: [-max(int), max(int)]
+
+ (1) gettmarg() handles bounds-checking.
+ (2) Python's acceptable range is one greater than the range in C,
+ thus need to check against automatic decrement by gettmarg().
+ */
+ if (buf->tm_mon == -1)
+ buf->tm_mon = 0;
+ else if (buf->tm_mon < 0 || buf->tm_mon > 11) {
+ PyErr_SetString(PyExc_ValueError, "month out of range");
+ return 0;
+ }
+ if (buf->tm_mday == 0)
+ buf->tm_mday = 1;
+ else if (buf->tm_mday < 0 || buf->tm_mday > 31) {
+ PyErr_SetString(PyExc_ValueError, "day of month out of range");
+ return 0;
+ }
+ if (buf->tm_hour < 0 || buf->tm_hour > 23) {
+ PyErr_SetString(PyExc_ValueError, "hour out of range");
+ return 0;
+ }
+ if (buf->tm_min < 0 || buf->tm_min > 59) {
+ PyErr_SetString(PyExc_ValueError, "minute out of range");
+ return 0;
+ }
+ if (buf->tm_sec < 0 || buf->tm_sec > 61) {
+ PyErr_SetString(PyExc_ValueError, "seconds out of range");
+ return 0;
+ }
+ /* tm_wday does not need checking of its upper-bound since taking
+ ``% 7`` in gettmarg() automatically restricts the range. */
+ if (buf->tm_wday < 0) {
+ PyErr_SetString(PyExc_ValueError, "day of week out of range");
+ return 0;
+ }
+ if (buf->tm_yday == -1)
+ buf->tm_yday = 0;
+ else if (buf->tm_yday < 0 || buf->tm_yday > 365) {
+ PyErr_SetString(PyExc_ValueError, "day of year out of range");
+ return 0;
+ }
+ return 1;
+}
+
#ifdef HAVE_STRFTIME
#ifdef HAVE_WCSFTIME
#define time_char wchar_t
@@ -433,108 +448,56 @@ time_strftime(PyObject *self, PyObject *args)
PyObject *tup = NULL;
struct tm buf;
const time_char *fmt;
- PyObject *format, *tmpfmt;
+#ifdef HAVE_WCSFTIME
+ wchar_t *format;
+#else
+ PyObject *format;
+#endif
+ PyObject *format_arg;
size_t fmtlen, buflen;
- time_char *outbuf = 0;
+ time_char *outbuf = NULL;
size_t i;
+ PyObject *ret = NULL;
memset((void *) &buf, '\0', sizeof(buf));
/* Will always expect a unicode string to be passed as format.
Given that there's no str type anymore in py3k this seems safe.
*/
- if (!PyArg_ParseTuple(args, "U|O:strftime", &format, &tup))
+ if (!PyArg_ParseTuple(args, "U|O:strftime", &format_arg, &tup))
return NULL;
if (tup == NULL) {
time_t tt = time(NULL);
buf = *localtime(&tt);
- } else if (!gettmarg(tup, &buf))
- return NULL;
-
- /* Checks added to make sure strftime() does not crash Python by
- indexing blindly into some array for a textual representation
- by some bad index (fixes bug #897625).
-
- Also support values of zero from Python code for arguments in which
- that is out of range by forcing that value to the lowest value that
- is valid (fixed bug #1520914).
-
- Valid ranges based on what is allowed in struct tm:
-
- - tm_year: [0, max(int)] (1)
- - tm_mon: [0, 11] (2)
- - tm_mday: [1, 31]
- - tm_hour: [0, 23]
- - tm_min: [0, 59]
- - tm_sec: [0, 60]
- - tm_wday: [0, 6] (1)
- - tm_yday: [0, 365] (2)
- - tm_isdst: [-max(int), max(int)]
-
- (1) gettmarg() handles bounds-checking.
- (2) Python's acceptable range is one greater than the range in C,
- thus need to check against automatic decrement by gettmarg().
- */
- if (buf.tm_mon == -1)
- buf.tm_mon = 0;
- else if (buf.tm_mon < 0 || buf.tm_mon > 11) {
- PyErr_SetString(PyExc_ValueError, "month out of range");
- return NULL;
- }
- if (buf.tm_mday == 0)
- buf.tm_mday = 1;
- else if (buf.tm_mday < 0 || buf.tm_mday > 31) {
- PyErr_SetString(PyExc_ValueError, "day of month out of range");
- return NULL;
- }
- if (buf.tm_hour < 0 || buf.tm_hour > 23) {
- PyErr_SetString(PyExc_ValueError, "hour out of range");
- return NULL;
- }
- if (buf.tm_min < 0 || buf.tm_min > 59) {
- PyErr_SetString(PyExc_ValueError, "minute out of range");
- return NULL;
- }
- if (buf.tm_sec < 0 || buf.tm_sec > 61) {
- PyErr_SetString(PyExc_ValueError, "seconds out of range");
- return NULL;
}
- /* tm_wday does not need checking of its upper-bound since taking
- ``% 7`` in gettmarg() automatically restricts the range. */
- if (buf.tm_wday < 0) {
- PyErr_SetString(PyExc_ValueError, "day of week out of range");
+ else if (!gettmarg(tup, &buf) || !checktm(&buf))
return NULL;
- }
- if (buf.tm_yday == -1)
- buf.tm_yday = 0;
- else if (buf.tm_yday < 0 || buf.tm_yday > 365) {
- PyErr_SetString(PyExc_ValueError, "day of year out of range");
- return NULL;
- }
- if (buf.tm_isdst < -1 || buf.tm_isdst > 1) {
+
+#if defined(_MSC_VER) || defined(sun)
+ if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
PyErr_SetString(PyExc_ValueError,
- "daylight savings flag out of range");
+ "strftime() requires year in [1; 9999]");
return NULL;
}
+#endif
+
+ /* Normalize tm_isdst just in case someone foolishly implements %Z
+ based on the assumption that tm_isdst falls within the range of
+ [-1, 1] */
+ if (buf.tm_isdst < -1)
+ buf.tm_isdst = -1;
+ else if (buf.tm_isdst > 1)
+ buf.tm_isdst = 1;
#ifdef HAVE_WCSFTIME
- tmpfmt = PyBytes_FromStringAndSize(NULL,
- sizeof(wchar_t) * (PyUnicode_GetSize(format)+1));
- if (!tmpfmt)
+ format = PyUnicode_AsWideCharString(format_arg, NULL);
+ if (format == NULL)
return NULL;
- /* This assumes that PyUnicode_AsWideChar doesn't do any UTF-16
- expansion. */
- if (PyUnicode_AsWideChar((PyUnicodeObject*)format,
- (wchar_t*)PyBytes_AS_STRING(tmpfmt),
- PyUnicode_GetSize(format)+1) == (size_t)-1)
- /* This shouldn't fail. */
- Py_FatalError("PyUnicode_AsWideChar failed");
- format = tmpfmt;
- fmt = (wchar_t*)PyBytes_AS_STRING(format);
+ fmt = format;
#else
/* Convert the unicode string to an ascii one */
- format = PyUnicode_AsEncodedString(format, TZNAME_ENCODING, NULL);
+ format = PyUnicode_AsEncodedString(format_arg, TZNAME_ENCODING, NULL);
if (format == NULL)
return NULL;
fmt = PyBytes_AS_STRING(format);
@@ -565,8 +528,8 @@ time_strftime(PyObject *self, PyObject *args)
for (i = 1024; ; i += i) {
outbuf = (time_char *)PyMem_Malloc(i*sizeof(time_char));
if (outbuf == NULL) {
- Py_DECREF(format);
- return PyErr_NoMemory();
+ PyErr_NoMemory();
+ break;
}
buflen = format_time(outbuf, i, fmt, &buf);
if (buflen > 0 || i >= 256 * fmtlen) {
@@ -575,7 +538,6 @@ time_strftime(PyObject *self, PyObject *args)
More likely, the format yields an empty result,
e.g. an empty format, or %Z when the timezone
is unknown. */
- PyObject *ret;
#ifdef HAVE_WCSFTIME
ret = PyUnicode_FromWideChar(outbuf, buflen);
#else
@@ -583,19 +545,23 @@ time_strftime(PyObject *self, PyObject *args)
TZNAME_ENCODING, NULL);
#endif
PyMem_Free(outbuf);
- Py_DECREF(format);
- return ret;
+ break;
}
PyMem_Free(outbuf);
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
/* VisualStudio .NET 2005 does this properly */
if (buflen == 0 && errno == EINVAL) {
PyErr_SetString(PyExc_ValueError, "Invalid format string");
- Py_DECREF(format);
- return 0;
+ break;
}
#endif
}
+#ifdef HAVE_WCSFTIME
+ PyMem_Free(format);
+#else
+ Py_DECREF(format);
+#endif
+ return ret;
}
#undef time_char
@@ -616,40 +582,66 @@ time_strptime(PyObject *self, PyObject *args)
PyObject *strptime_result;
if (!strptime_module)
- return NULL;
- strptime_result = PyObject_CallMethod(strptime_module, "_strptime_time", "O", args);
+ return NULL;
+ strptime_result = PyObject_CallMethod(strptime_module,
+ "_strptime_time", "O", args);
Py_DECREF(strptime_module);
return strptime_result;
}
+
PyDoc_STRVAR(strptime_doc,
"strptime(string, format) -> struct_time\n\
\n\
Parse a string to a time tuple according to a format specification.\n\
See the library reference manual for formatting codes (same as strftime()).");
+static PyObject *
+_asctime(struct tm *timeptr)
+{
+ /* Inspired by Open Group reference implementation available at
+ * http://pubs.opengroup.org/onlinepubs/009695399/functions/asctime.html */
+ static char wday_name[7][3] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+ };
+ static char mon_name[12][3] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+ char buf[20]; /* 'Sun Sep 16 01:03:52\0' */
+ int n;
+
+ n = PyOS_snprintf(buf, sizeof(buf), "%.3s %.3s%3d %.2d:%.2d:%.2d",
+ wday_name[timeptr->tm_wday],
+ mon_name[timeptr->tm_mon],
+ timeptr->tm_mday, timeptr->tm_hour,
+ timeptr->tm_min, timeptr->tm_sec);
+ /* XXX: since the fields used by snprintf above are validated in checktm,
+ * the following condition should never trigger. We keep the check because
+ * historically fixed size buffer used in asctime was the source of
+ * crashes. */
+ if (n + 1 != sizeof(buf)) {
+ PyErr_SetString(PyExc_ValueError, "unconvertible time");
+ return NULL;
+ }
+
+ return PyUnicode_FromFormat("%s %d", buf, 1900 + timeptr->tm_year);
+}
static PyObject *
time_asctime(PyObject *self, PyObject *args)
{
PyObject *tup = NULL;
struct tm buf;
- char *p;
+
if (!PyArg_UnpackTuple(args, "asctime", 0, 1, &tup))
return NULL;
if (tup == NULL) {
time_t tt = time(NULL);
buf = *localtime(&tt);
- } else if (!gettmarg(tup, &buf))
- return NULL;
- p = asctime(&buf);
- if (p == NULL) {
- PyErr_SetString(PyExc_ValueError, "invalid time");
+ } else if (!gettmarg(tup, &buf) || !checktm(&buf))
return NULL;
- }
- if (p[24] == '\n')
- p[24] = '\0';
- return PyUnicode_FromString(p);
+ return _asctime(&buf);
}
PyDoc_STRVAR(asctime_doc,
@@ -664,7 +656,7 @@ time_ctime(PyObject *self, PyObject *args)
{
PyObject *ot = NULL;
time_t tt;
- char *p;
+ struct tm *timeptr;
if (!PyArg_UnpackTuple(args, "ctime", 0, 1, &ot))
return NULL;
@@ -678,14 +670,12 @@ time_ctime(PyObject *self, PyObject *args)
if (tt == (time_t)-1 && PyErr_Occurred())
return NULL;
}
- p = ctime(&tt);
- if (p == NULL) {
+ timeptr = localtime(&tt);
+ if (timeptr == NULL) {
PyErr_SetString(PyExc_ValueError, "unconvertible time");
return NULL;
}
- if (p[24] == '\n')
- p[24] = '\0';
- return PyUnicode_FromString(p);
+ return _asctime(timeptr);
}
PyDoc_STRVAR(ctime_doc,
@@ -970,44 +960,12 @@ PyInit_time(void)
return m;
}
-
-/* Implement floattime() for various platforms */
-
static double
floattime(void)
{
- /* There are three ways to get the time:
- (1) gettimeofday() -- resolution in microseconds
- (2) ftime() -- resolution in milliseconds
- (3) time() -- resolution in seconds
- In all cases the return value is a float in seconds.
- Since on some systems (e.g. SCO ODT 3.0) gettimeofday() may
- fail, so we fall back on ftime() or time().
- Note: clock resolution does not imply clock accuracy! */
-#ifdef HAVE_GETTIMEOFDAY
- {
- struct timeval t;
-#ifdef GETTIMEOFDAY_NO_TZ
- if (gettimeofday(&t) == 0)
- return (double)t.tv_sec + t.tv_usec*0.000001;
-#else /* !GETTIMEOFDAY_NO_TZ */
- if (gettimeofday(&t, (struct timezone *)NULL) == 0)
- return (double)t.tv_sec + t.tv_usec*0.000001;
-#endif /* !GETTIMEOFDAY_NO_TZ */
- }
-
-#endif /* !HAVE_GETTIMEOFDAY */
- {
-#if defined(HAVE_FTIME)
- struct timeb t;
- ftime(&t);
- return (double)t.time + (double)t.millitm * (double)0.001;
-#else /* !HAVE_FTIME */
- time_t secs;
- time(&secs);
- return (double)secs;
-#endif /* !HAVE_FTIME */
- }
+ _PyTime_timeval t;
+ _PyTime_gettimeofday(&t);
+ return (double)t.tv_sec + t.tv_usec*0.000001;
}
@@ -1088,22 +1046,6 @@ floatsleep(double secs)
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(PLAN9)
- {
- double millisecs = secs * 1000.0;
- if (millisecs > (double)LONG_MAX) {
- PyErr_SetString(PyExc_OverflowError, "sleep length is too large");
- return -1;
- }
- /* This sleep *CAN BE* interrupted. */
- Py_BEGIN_ALLOW_THREADS
- if(sleep((long)millisecs) < 0){
- Py_BLOCK_THREADS
- PyErr_SetFromErrno(PyExc_IOError);
- return -1;
- }
- Py_END_ALLOW_THREADS
- }
#else
/* XXX Can't interrupt this sleep */
Py_BEGIN_ALLOW_THREADS
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 1a55696840..463be2c8f8 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -1,12 +1,12 @@
/* ------------------------------------------------------------------------
- unicodedata -- Provides access to the Unicode 5.1 data base.
+ unicodedata -- Provides access to the Unicode 5.2 data base.
- Data was extracted from the Unicode 5.1 UnicodeData.txt file.
+ Data was extracted from the Unicode 5.2 UnicodeData.txt file.
Written by Marc-Andre Lemburg (mal@lemburg.com).
Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com)
- Modified by Martin v. Löwis (martin@v.loewis.de)
+ Modified by Martin v. Löwis (martin@v.loewis.de)
Copyright (c) Corporation for National Research Initiatives.
@@ -36,7 +36,7 @@ typedef struct change_record {
const unsigned char category_changed;
const unsigned char decimal_changed;
const unsigned char mirrored_changed;
- const int numeric_changed;
+ const double numeric_changed;
} change_record;
/* data file generated by Tools/unicode/makeunicodedata.py */
@@ -403,7 +403,8 @@ unicodedata_decomposition(PyObject *self, PyObject *args)
{
PyUnicodeObject *v;
char decomp[256];
- int code, index, count, i;
+ int code, index, count;
+ size_t i;
unsigned int prefix_index;
Py_UCS4 c;
@@ -450,15 +451,12 @@ unicodedata_decomposition(PyObject *self, PyObject *args)
while (count-- > 0) {
if (i)
decomp[i++] = ' ';
- assert((size_t)i < sizeof(decomp));
+ assert(i < sizeof(decomp));
PyOS_snprintf(decomp + i, sizeof(decomp) - i, "%04X",
decomp_data[++index]);
i += strlen(decomp + i);
}
-
- decomp[i] = '\0';
-
- return PyUnicode_FromString(decomp);
+ return PyUnicode_FromStringAndSize(decomp, i);
}
static void
@@ -871,13 +869,16 @@ static char *hangul_syllables[][3] = {
{ 0, 0, "H" }
};
+/* These ranges need to match makeunicodedata.py:cjk_ranges. */
static int
is_unified_ideograph(Py_UCS4 code)
{
- return (
- (0x3400 <= code && code <= 0x4DB5) || /* CJK Ideograph Extension A */
- (0x4E00 <= code && code <= 0x9FC3) || /* CJK Ideograph, Unicode 5.1 */
- (0x20000 <= code && code <= 0x2A6D6));/* CJK Ideograph Extension B */
+ return
+ (0x3400 <= code && code <= 0x4DB5) || /* CJK Ideograph Extension A */
+ (0x4E00 <= code && code <= 0x9FCB) || /* CJK Ideograph */
+ (0x20000 <= code && code <= 0x2A6D6) || /* CJK Ideograph Extension B */
+ (0x2A700 <= code && code <= 0x2B734) || /* CJK Ideograph Extension C */
+ (0x2B740 <= code && code <= 0x2B81D); /* CJK Ideograph Extension D */
}
static int
@@ -1240,11 +1241,11 @@ PyDoc_STRVAR(unicodedata_docstring,
"This module provides access to the Unicode Character Database which\n\
defines character properties for all Unicode characters. The data in\n\
this database is based on the UnicodeData.txt file version\n\
-5.1.0 which is publically available from ftp://ftp.unicode.org/.\n\
+5.2.0 which is publically available from ftp://ftp.unicode.org/.\n\
\n\
The module uses the same names and symbols as defined by the\n\
-UnicodeData File Format 5.1.0 (see\n\
-http://www.unicode.org/Public/5.1.0/ucd/UCD.html).");
+UnicodeData File Format 5.2.0 (see\n\
+http://www.unicode.org/reports/tr44/tr44-4.html).");
static struct PyModuleDef unicodedatamodule = {
diff --git a/Modules/unicodedata_db.h b/Modules/unicodedata_db.h
index d447319ee3..8e2e72452a 100644
--- a/Modules/unicodedata_db.h
+++ b/Modules/unicodedata_db.h
@@ -1,6 +1,6 @@
-/* this file was generated by Tools/unicode/makeunicodedata.py 2.6 */
+/* this file was generated by Tools/unicode/makeunicodedata.py 3.2 */
-#define UNIDATA_VERSION "5.1.0"
+#define UNIDATA_VERSION "6.0.0"
/* a list of unique database records */
const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{0, 0, 0, 0, 0, 0},
@@ -134,7 +134,6 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{19, 0, 5, 0, 5, 136},
{7, 0, 9, 0, 5, 0},
{30, 0, 5, 0, 5, 0},
- {14, 0, 15, 0, 5, 0},
{4, 36, 14, 0, 5, 0},
{4, 0, 14, 0, 5, 0},
{7, 0, 4, 0, 5, 0},
@@ -178,9 +177,11 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{8, 0, 1, 0, 5, 0},
{14, 0, 1, 0, 5, 0},
{5, 9, 1, 0, 5, 0},
+ {4, 1, 14, 0, 5, 0},
{4, 234, 14, 0, 5, 0},
{4, 214, 14, 0, 5, 0},
{4, 202, 14, 0, 5, 0},
+ {4, 233, 14, 0, 5, 0},
{2, 0, 1, 0, 5, 138},
{2, 0, 1, 0, 5, 170},
{3, 0, 1, 0, 5, 10},
@@ -188,6 +189,7 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{29, 0, 19, 0, 5, 170},
{10, 0, 18, 0, 5, 170},
{10, 0, 18, 0, 5, 136},
+ {14, 0, 15, 0, 5, 0},
{14, 0, 4, 0, 5, 0},
{21, 0, 19, 0, 4, 0},
{21, 0, 19, 0, 5, 136},
@@ -214,9 +216,9 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{27, 0, 19, 0, 5, 136},
{22, 0, 19, 1, 5, 136},
{23, 0, 19, 1, 5, 136},
+ {18, 0, 1, 0, 4, 136},
{28, 0, 11, 0, 5, 136},
{28, 0, 11, 0, 1, 0},
- {4, 1, 14, 0, 5, 0},
{30, 0, 19, 0, 5, 136},
{30, 0, 19, 0, 4, 136},
{1, 0, 1, 0, 4, 170},
@@ -264,6 +266,7 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{30, 0, 1, 0, 2, 0},
{9, 0, 1, 0, 2, 136},
{30, 0, 1, 0, 2, 136},
+ {30, 0, 1, 0, 4, 0},
{9, 0, 19, 0, 2, 136},
{29, 0, 1, 0, 5, 0},
{15, 0, 1, 0, 5, 0},
@@ -272,6 +275,7 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{19, 0, 4, 0, 5, 170},
{4, 26, 14, 0, 5, 0},
{19, 0, 4, 0, 5, 136},
+ {29, 0, 5, 0, 5, 0},
{23, 0, 19, 0, 5, 0},
{28, 0, 5, 0, 5, 136},
{26, 0, 19, 0, 2, 136},
@@ -314,17 +318,18 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{14, 0, 19, 0, 5, 0},
{8, 0, 19, 0, 5, 0},
{9, 0, 4, 0, 5, 0},
+ {9, 0, 12, 0, 5, 0},
{30, 0, 1, 0, 5, 170},
{5, 216, 1, 0, 5, 0},
{5, 226, 1, 0, 5, 0},
{27, 0, 1, 0, 5, 136},
- {27, 0, 1, 1, 5, 136},
{7, 0, 9, 0, 5, 136},
+ {30, 0, 1, 0, 5, 136},
};
/* Reindexing of NFC first characters. */
-#define TOTAL_FIRST 367
-#define TOTAL_LAST 54
+#define TOTAL_FIRST 370
+#define TOTAL_LAST 55
struct reindex{int start;short count,index;};
static struct reindex nfc_first[] = {
{ 60, 2, 0},
@@ -530,6 +535,9 @@ static struct reindex nfc_first[] = {
{ 12507, 0, 361},
{ 12527, 3, 362},
{ 12541, 0, 366},
+ { 69785, 0, 367},
+ { 69787, 0, 368},
+ { 69797, 0, 369},
{0,0,0}
};
@@ -565,6 +573,7 @@ static struct reindex nfc_last[] = {
{ 4142, 0, 50},
{ 6965, 0, 51},
{ 12441, 1, 52},
+ { 69818, 0, 54},
{0,0,0}
};
@@ -658,509 +667,519 @@ static const char *decomp_prefix[] = {
/* index tables for the database records */
#define SHIFT 7
static unsigned char index1[] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 40, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 16, 50, 51, 52,
- 16, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 16, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 98, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 99, 100, 97, 97, 97, 97, 97, 97,
- 97, 97, 101, 40, 40, 102, 103, 104, 105, 106, 107, 108, 16, 109, 16, 16,
- 16, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 111, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
- 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 114, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 124, 125,
- 126, 127, 128, 129, 16, 130, 131, 132, 133, 134, 16, 16, 16, 16, 16, 16,
- 135, 16, 136, 16, 137, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 40, 40, 40, 40, 40,
- 40, 138, 16, 139, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 75, 140, 141, 142, 143, 16, 144, 16, 145, 146, 147,
- 148, 149, 150, 151, 152, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 153, 154, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 155, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 114, 114, 114, 114, 156, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 157, 16, 158, 159, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 160, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 160,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 41, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 78, 79, 80, 81, 82, 83, 17, 84, 85, 86, 87, 88,
+ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 101, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 102,
+ 103, 100, 100, 100, 100, 100, 100, 100, 100, 104, 41, 41, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, 119,
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
+ 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 122, 123, 124,
+ 125, 126, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 17, 137,
+ 138, 139, 140, 141, 17, 17, 17, 17, 17, 17, 142, 17, 143, 17, 144, 17,
+ 145, 17, 146, 17, 17, 17, 147, 17, 17, 17, 148, 149, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 41, 41, 41, 41, 41, 41, 150, 17, 151, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 41, 41, 41, 41, 41, 41, 41, 41, 152, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 41, 41, 41, 41, 153, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 154, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 78,
+ 155, 156, 157, 158, 17, 159, 17, 160, 161, 162, 163, 164, 165, 166, 167,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 168, 169, 170, 171, 172,
+ 17, 173, 174, 175, 176, 177, 178, 179, 180, 181, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 182, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 183, 100, 184, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 121,
+ 121, 121, 121, 185, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 186, 17, 187,
+ 188, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 189, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 189,
};
static unsigned short index2[] = {
@@ -1235,8 +1254,8 @@ static unsigned short index2[] = {
38, 43, 38, 43, 38, 43, 44, 46, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
38, 43, 44, 46, 38, 43, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
- 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 0, 0, 52, 82, 82, 82, 82, 82, 82, 0, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
@@ -1249,12 +1268,12 @@ static unsigned short index2[] = {
105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 0, 0, 0, 0, 0,
105, 105, 105, 102, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 106, 106,
106, 0, 0, 77, 77, 107, 108, 108, 109, 110, 111, 27, 27, 80, 80, 80, 80,
- 80, 80, 80, 80, 112, 113, 114, 111, 0, 0, 111, 111, 0, 115, 116, 116,
+ 80, 80, 80, 80, 112, 113, 114, 111, 0, 0, 111, 111, 115, 115, 116, 116,
116, 116, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
117, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 118, 119, 120,
112, 113, 114, 121, 122, 123, 123, 124, 84, 80, 80, 80, 80, 80, 84, 80,
- 80, 0, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 108, 126, 126,
+ 80, 84, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 108, 126, 126,
111, 115, 115, 127, 115, 115, 115, 115, 128, 128, 128, 128, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
@@ -1262,11 +1281,11 @@ static unsigned short index2[] = {
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116,
115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
- 115, 115, 115, 115, 116, 111, 115, 80, 80, 80, 80, 80, 80, 80, 106, 81,
+ 115, 115, 115, 115, 116, 111, 115, 80, 80, 80, 80, 80, 80, 80, 106, 27,
80, 80, 80, 80, 84, 80, 117, 117, 80, 80, 27, 84, 80, 80, 84, 115, 115,
129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 115, 115, 115, 130,
130, 115, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 0, 131, 115, 132, 115, 115, 115, 115, 115, 115, 115, 115, 115,
+ 111, 111, 0, 106, 115, 131, 115, 115, 115, 115, 115, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 80, 84, 80, 80, 84, 80, 80, 84, 84,
84, 80, 84, 84, 80, 84, 80, 80, 80, 84, 80, 84, 80, 84, 80, 84, 80, 80,
@@ -1276,175 +1295,185 @@ static unsigned short index2[] = {
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
- 115, 115, 115, 115, 115, 115, 133, 133, 133, 133, 133, 133, 133, 133,
- 133, 133, 133, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 134,
- 134, 134, 134, 134, 134, 134, 134, 134, 105, 105, 105, 105, 105, 105,
+ 115, 115, 115, 115, 115, 115, 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, 133,
+ 133, 133, 133, 133, 133, 133, 133, 133, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 80, 80,
- 80, 80, 80, 80, 80, 84, 80, 135, 135, 27, 136, 136, 136, 135, 0, 0, 0, 0,
+ 80, 80, 80, 80, 80, 84, 80, 134, 134, 27, 135, 135, 135, 134, 0, 0, 0, 0,
+ 0, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 80, 80, 80, 80, 134, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 134, 80, 80, 80, 134, 80, 80, 80, 80, 80, 0, 0,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 0, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 84, 84, 84,
+ 0, 0, 102, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, 133, 137, 47, 47, 47, 47, 47, 47, 47,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 132,
+ 132, 136, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 138, 47, 47, 47, 47, 47,
- 47, 47, 138, 47, 47, 138, 47, 47, 47, 47, 47, 0, 0, 139, 47, 137, 137,
- 137, 133, 133, 133, 133, 133, 133, 133, 133, 137, 137, 137, 137, 140, 0,
- 0, 47, 80, 84, 80, 80, 0, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141,
- 47, 47, 133, 133, 82, 82, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 82, 52, 47, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 0, 133, 137,
- 137, 0, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 47, 47, 0, 0, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 0, 0, 0, 47, 47, 47, 47, 0, 0,
- 143, 47, 144, 137, 137, 133, 133, 133, 133, 0, 0, 137, 137, 0, 0, 145,
- 145, 140, 47, 0, 0, 0, 0, 0, 0, 0, 0, 144, 0, 0, 0, 0, 141, 141, 0, 141,
- 47, 47, 133, 133, 0, 0, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 47, 47, 146, 146, 147, 147, 147, 147, 147, 147, 79, 0, 0, 0, 0, 0, 0,
- 133, 133, 137, 0, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 47, 47, 0, 0, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 141, 0, 47, 141, 0, 47,
- 47, 0, 0, 143, 0, 137, 137, 137, 133, 133, 0, 0, 0, 0, 133, 133, 0, 0,
- 133, 133, 140, 0, 0, 0, 133, 0, 0, 0, 0, 0, 0, 0, 141, 141, 141, 47, 0,
- 141, 0, 0, 0, 0, 0, 0, 0, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 133, 133, 47, 47, 47, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133,
- 133, 137, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 0, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 0, 47, 47, 47, 47,
- 47, 0, 0, 143, 47, 137, 137, 137, 133, 133, 133, 133, 133, 0, 133, 133,
- 137, 0, 137, 137, 140, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 47, 47, 133, 133, 0, 0, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, 137,
- 137, 0, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 47, 47, 0, 0, 47, 47, 47,
+ 47, 47, 47, 137, 47, 47, 47, 47, 47, 47, 47, 137, 47, 47, 137, 47, 47,
+ 47, 47, 47, 132, 136, 138, 47, 136, 136, 136, 132, 132, 132, 132, 132,
+ 132, 132, 132, 136, 136, 136, 136, 139, 136, 136, 47, 80, 84, 80, 80,
+ 132, 132, 132, 140, 140, 140, 140, 140, 140, 140, 140, 47, 47, 132, 132,
+ 82, 82, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 82, 52, 47, 47,
+ 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 132, 136, 136, 0, 47,
+ 47, 47, 47, 47, 47, 47, 47, 0, 0, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47,
+ 47, 47, 47, 47, 47, 47, 0, 47, 0, 0, 0, 47, 47, 47, 47, 0, 0, 142, 47,
+ 143, 136, 136, 132, 132, 132, 132, 0, 0, 136, 136, 0, 0, 144, 144, 139,
+ 47, 0, 0, 0, 0, 0, 0, 0, 0, 143, 0, 0, 0, 0, 140, 140, 0, 140, 47, 47,
+ 132, 132, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 47, 47,
+ 145, 145, 146, 146, 146, 146, 146, 146, 79, 145, 0, 0, 0, 0, 0, 132, 132,
+ 136, 0, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 47, 47, 0, 0, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 0, 47, 47, 47, 47, 47, 0,
- 0, 143, 47, 144, 133, 137, 133, 133, 133, 133, 0, 0, 137, 145, 0, 0, 145,
- 145, 140, 0, 0, 0, 0, 0, 0, 0, 0, 148, 144, 0, 0, 0, 0, 141, 141, 0, 47,
- 47, 47, 133, 133, 0, 0, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 79, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, 47, 0, 47,
- 47, 47, 47, 47, 47, 0, 0, 0, 47, 47, 47, 0, 47, 47, 138, 47, 0, 0, 0, 47,
+ 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 140, 0, 47, 140, 0, 47, 47, 0, 0,
+ 142, 0, 136, 136, 136, 132, 132, 0, 0, 0, 0, 132, 132, 0, 0, 132, 132,
+ 139, 0, 0, 0, 132, 0, 0, 0, 0, 0, 0, 0, 140, 140, 140, 47, 0, 140, 0, 0,
+ 0, 0, 0, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 132,
+ 132, 47, 47, 47, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 132, 136, 0,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 0, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0,
+ 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 0, 47, 47, 47, 47, 47, 0, 0, 142,
+ 47, 136, 136, 136, 132, 132, 132, 132, 132, 0, 132, 132, 136, 0, 136,
+ 136, 139, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47,
+ 132, 132, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 0, 145,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 136, 136, 0, 47, 47,
+ 47, 47, 47, 47, 47, 47, 0, 0, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47,
+ 47, 47, 47, 47, 47, 0, 47, 47, 0, 47, 47, 47, 47, 47, 0, 0, 142, 47, 143,
+ 132, 136, 132, 132, 132, 132, 0, 0, 136, 144, 0, 0, 144, 144, 139, 0, 0,
+ 0, 0, 0, 0, 0, 0, 147, 143, 0, 0, 0, 0, 140, 140, 0, 47, 47, 47, 132,
+ 132, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 79, 47, 146,
+ 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 47, 0, 47,
+ 47, 47, 47, 47, 47, 0, 0, 0, 47, 47, 47, 0, 47, 47, 137, 47, 0, 0, 0, 47,
47, 0, 47, 0, 47, 47, 0, 0, 0, 47, 47, 0, 0, 0, 47, 47, 47, 0, 0, 0, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 144, 137, 133,
- 137, 137, 0, 0, 0, 137, 137, 137, 0, 145, 145, 145, 140, 0, 0, 47, 0, 0,
- 0, 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 147, 147, 147, 27, 27, 27, 27, 27, 27,
- 146, 27, 0, 0, 0, 0, 0, 0, 137, 137, 137, 0, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 143, 136, 132,
+ 136, 136, 0, 0, 0, 136, 136, 136, 0, 144, 144, 144, 139, 0, 0, 47, 0, 0,
+ 0, 0, 0, 0, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 141, 146, 146, 146, 27, 27, 27, 27, 27, 27,
+ 145, 27, 0, 0, 0, 0, 0, 0, 136, 136, 136, 0, 47, 47, 47, 47, 47, 47, 47,
47, 0, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 0, 47, 47, 47, 47, 47, 0, 0, 0, 47, 133, 133, 133, 137, 137,
- 137, 137, 0, 133, 133, 149, 0, 133, 133, 133, 140, 0, 0, 0, 0, 0, 0, 0,
- 150, 151, 0, 47, 47, 0, 0, 0, 0, 0, 0, 47, 47, 133, 133, 0, 0, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 0, 0, 0, 0, 0, 0, 0, 0, 152, 152,
- 152, 152, 152, 152, 152, 79, 0, 0, 137, 137, 0, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 0, 47, 47, 47, 47, 47, 0, 0, 0, 47, 132, 132, 132, 136, 136,
+ 136, 136, 0, 132, 132, 148, 0, 132, 132, 132, 139, 0, 0, 0, 0, 0, 0, 0,
+ 149, 150, 0, 47, 47, 0, 0, 0, 0, 0, 0, 47, 47, 132, 132, 0, 0, 141, 141,
+ 141, 141, 141, 141, 141, 141, 141, 141, 0, 0, 0, 0, 0, 0, 0, 0, 151, 151,
+ 151, 151, 151, 151, 151, 79, 0, 0, 136, 136, 0, 47, 47, 47, 47, 47, 47,
47, 47, 0, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 0, 0, 143, 47, 137, 153, 145, 137,
- 144, 137, 137, 0, 153, 145, 145, 0, 145, 145, 133, 140, 0, 0, 0, 0, 0, 0,
- 0, 144, 144, 0, 0, 0, 0, 0, 0, 0, 47, 0, 47, 47, 133, 133, 0, 0, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 0, 27, 27, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 137, 0, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 0, 0, 142, 47, 136, 152, 144, 136,
+ 143, 136, 136, 0, 152, 144, 144, 0, 144, 144, 132, 139, 0, 0, 0, 0, 0, 0,
+ 0, 143, 143, 0, 0, 0, 0, 0, 0, 0, 47, 0, 47, 47, 132, 132, 0, 0, 141,
+ 141, 141, 141, 141, 141, 141, 141, 141, 141, 0, 47, 47, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 136, 0, 47, 47, 47, 47, 47, 47, 47, 47,
0, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 47, 144, 137, 137, 133, 133,
- 133, 133, 0, 137, 137, 137, 0, 145, 145, 145, 140, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 133, 133, 0, 0, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 147, 147, 147, 147, 147, 147, 0, 0, 0,
- 79, 47, 47, 47, 47, 47, 47, 0, 0, 137, 137, 0, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 47, 143, 136, 136, 132, 132,
+ 132, 132, 0, 136, 136, 136, 0, 144, 144, 144, 139, 47, 0, 0, 0, 0, 0, 0,
+ 0, 0, 143, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 132, 132, 0, 0, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 141, 146, 146, 146, 146, 146, 146, 0, 0, 0,
+ 79, 47, 47, 47, 47, 47, 47, 0, 0, 136, 136, 0, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 0, 0, 47, 47, 47,
- 47, 47, 47, 47, 0, 0, 0, 154, 0, 0, 0, 0, 144, 137, 137, 133, 133, 133,
- 0, 133, 0, 137, 137, 145, 137, 145, 145, 145, 144, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 137, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 47, 47, 47, 0, 0, 0, 153, 0, 0, 0, 0, 143, 136, 136, 132, 132, 132,
+ 0, 132, 0, 136, 136, 144, 136, 144, 144, 144, 143, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 136, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 133, 47, 155,
- 133, 133, 133, 133, 156, 156, 140, 0, 0, 0, 0, 146, 47, 47, 47, 47, 47,
- 47, 52, 133, 157, 157, 157, 157, 133, 133, 133, 82, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 82, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 132, 47, 154,
+ 132, 132, 132, 132, 155, 155, 139, 0, 0, 0, 0, 145, 47, 47, 47, 47, 47,
+ 47, 52, 132, 156, 156, 156, 156, 132, 132, 132, 82, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 82, 82, 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, 47, 47, 0, 47, 0, 0, 47, 47, 0, 47, 0, 0, 47, 0, 0, 0, 0, 0, 0, 47,
47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 0, 47, 0, 47,
- 0, 0, 47, 47, 0, 47, 47, 47, 47, 133, 47, 155, 133, 133, 133, 133, 158,
- 158, 0, 133, 133, 47, 0, 0, 47, 47, 47, 47, 47, 0, 52, 0, 159, 159, 159,
- 159, 133, 133, 0, 0, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 0,
- 0, 155, 155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 47, 47, 0, 47, 47, 47, 47, 132, 47, 154, 132, 132, 132, 132, 157,
+ 157, 0, 132, 132, 47, 0, 0, 47, 47, 47, 47, 47, 0, 52, 0, 158, 158, 158,
+ 158, 132, 132, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 0,
+ 0, 154, 154, 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, 47, 79, 79, 79, 82, 82, 82, 82,
- 82, 82, 82, 82, 160, 82, 82, 82, 82, 82, 82, 79, 79, 79, 79, 79, 84, 84,
- 79, 79, 79, 79, 79, 79, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 79, 84, 79, 84, 79,
- 161, 162, 163, 162, 163, 137, 137, 47, 47, 47, 141, 47, 47, 47, 47, 0,
- 47, 47, 47, 47, 141, 47, 47, 47, 47, 141, 47, 47, 47, 47, 141, 47, 47,
- 47, 47, 141, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 141, 47, 47,
- 47, 0, 0, 0, 0, 164, 165, 166, 167, 166, 166, 168, 166, 168, 165, 165,
- 165, 165, 133, 137, 165, 166, 80, 80, 140, 82, 80, 80, 47, 47, 47, 47, 0,
- 0, 0, 0, 133, 133, 133, 166, 133, 133, 133, 133, 0, 133, 133, 133, 133,
- 166, 133, 133, 133, 133, 166, 133, 133, 133, 133, 166, 133, 133, 133,
- 133, 166, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133,
- 166, 133, 133, 133, 0, 79, 79, 79, 79, 79, 79, 79, 79, 84, 79, 79, 79,
- 79, 79, 79, 0, 79, 79, 82, 82, 82, 82, 82, 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, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 82, 82, 82, 82, 159, 82, 82, 82, 82, 82, 82, 79, 79, 79, 79, 79, 84, 84,
+ 79, 79, 79, 79, 79, 79, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 79, 84, 79, 84, 79,
+ 160, 161, 162, 161, 162, 136, 136, 47, 47, 47, 140, 47, 47, 47, 47, 0,
+ 47, 47, 47, 47, 140, 47, 47, 47, 47, 140, 47, 47, 47, 47, 140, 47, 47,
+ 47, 47, 140, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 140, 47, 47,
+ 47, 0, 0, 0, 0, 163, 164, 165, 166, 165, 165, 167, 165, 167, 164, 164,
+ 164, 164, 132, 136, 164, 165, 80, 80, 139, 82, 80, 80, 47, 47, 47, 47,
+ 47, 132, 132, 132, 132, 132, 132, 165, 132, 132, 132, 132, 0, 132, 132,
+ 132, 132, 165, 132, 132, 132, 132, 165, 132, 132, 132, 132, 165, 132,
+ 132, 132, 132, 165, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 165, 132, 132, 132, 0, 79, 79, 79, 79, 79, 79, 79, 79, 84, 79,
+ 79, 79, 79, 79, 79, 0, 79, 79, 82, 82, 82, 82, 82, 79, 79, 79, 79, 82,
+ 82, 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, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 138, 47, 47, 47, 47, 137, 137, 133,
- 148, 133, 133, 137, 133, 133, 133, 133, 133, 143, 137, 140, 140, 137,
- 137, 133, 133, 47, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 82,
- 82, 82, 82, 82, 82, 47, 47, 47, 47, 47, 47, 137, 137, 133, 133, 47, 47,
- 47, 47, 133, 133, 133, 47, 137, 137, 137, 47, 47, 137, 137, 137, 137,
- 137, 137, 137, 47, 47, 47, 133, 133, 133, 133, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 133, 137, 137, 133, 133, 137, 137, 137, 137,
- 137, 137, 84, 47, 137, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 0, 0, 0, 0, 79, 79, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 137, 47, 47, 47, 47, 136,
+ 136, 132, 147, 132, 132, 136, 132, 132, 132, 132, 132, 142, 136, 139,
+ 139, 136, 136, 132, 132, 47, 141, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 82, 82, 82, 82, 82, 82, 47, 47, 47, 47, 47, 47, 136, 136, 132, 132,
+ 47, 47, 47, 47, 132, 132, 132, 47, 136, 136, 136, 47, 47, 136, 136, 136,
+ 136, 136, 136, 136, 47, 47, 47, 132, 132, 132, 132, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 132, 136, 136, 132, 132, 136, 136, 136,
+ 136, 136, 136, 84, 47, 136, 141, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 136, 136, 136, 132, 79, 79, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 82, 50, 0, 0, 0, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
+ 47, 47, 47, 47, 47, 47, 82, 50, 0, 0, 0, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 47, 169, 169, 169, 169, 169, 169, 169, 169,
+ 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 168, 168, 168, 168, 168, 169, 169, 169, 169,
169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 0, 0, 0, 0, 0,
- 169, 47, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
- 170, 170, 170, 170, 170, 170, 170, 170, 47, 47, 47, 47, 47, 47, 47, 47,
+ 169, 169, 169, 169, 169, 169, 169, 169, 169, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 0, 0, 0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
- 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
- 170, 170, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 168, 168, 168, 168, 168,
+ 168, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 0, 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 0,
+ 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 0, 0, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 0, 0, 47, 47, 47, 47,
- 47, 47, 47, 0, 47, 0, 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 0,
+ 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 0, 47, 47, 47, 47, 0, 0, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47,
- 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 0, 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 0, 47,
- 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0,
+ 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 0, 0, 80, 80, 80, 79, 82, 82, 82, 82, 82, 82, 82, 82, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 80, 79, 82, 82, 82, 82, 82, 82, 82,
- 82, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
- 147, 147, 147, 147, 147, 147, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 83, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
@@ -1463,177 +1492,192 @@ static unsigned short index2[] = {
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 82, 82, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 170, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 161,
+ 162, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 82, 82, 47, 47, 47, 47, 47,
- 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 162, 163, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 82, 82, 82, 171, 171, 171, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 0, 47, 47, 47, 47, 132, 132, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 132, 132, 139, 82, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 132, 132, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 0, 47, 47, 47, 0, 132, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 82, 82, 82, 172, 172, 172, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 0, 47, 47, 47, 47, 133, 133, 140, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 133, 133, 140, 82, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 133, 133, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 0, 47, 47, 47, 0, 133, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 172, 172, 136,
+ 132, 132, 132, 132, 132, 132, 132, 136, 136, 136, 136, 136, 136, 136,
+ 136, 132, 136, 136, 132, 132, 132, 132, 132, 132, 132, 132, 132, 139,
+ 132, 82, 82, 82, 52, 82, 82, 82, 145, 47, 80, 0, 0, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 0, 0, 0, 0, 0, 0, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 0, 0, 0, 0, 0, 0, 135, 135, 135, 135, 135, 135,
+ 83, 135, 135, 135, 135, 132, 132, 132, 170, 0, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 173, 173,
- 137, 133, 133, 133, 133, 133, 133, 133, 137, 137, 137, 137, 137, 137,
- 137, 137, 133, 137, 137, 133, 133, 133, 133, 133, 133, 133, 133, 133,
- 140, 133, 82, 82, 82, 52, 82, 82, 82, 146, 47, 80, 0, 0, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 0, 0, 0, 0, 0, 0, 152, 152, 152, 152,
- 152, 152, 152, 152, 152, 152, 0, 0, 0, 0, 0, 0, 136, 136, 136, 136, 136,
- 136, 83, 136, 136, 136, 136, 133, 133, 133, 171, 0, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 52, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 52, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 86, 47, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 86, 47, 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, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 133, 133, 133, 137, 137, 137, 137,
- 133, 133, 137, 137, 137, 0, 0, 0, 0, 137, 137, 133, 137, 137, 137, 137,
- 137, 137, 85, 80, 84, 0, 0, 0, 0, 27, 0, 0, 0, 136, 136, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 0, 0, 0, 132, 132, 132, 136, 136, 136, 136, 132,
+ 132, 136, 136, 136, 0, 0, 0, 0, 136, 136, 132, 136, 136, 136, 136, 136,
+ 136, 85, 80, 84, 0, 0, 0, 0, 27, 0, 0, 0, 135, 135, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 0, 0, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 137, 137, 137, 137, 137, 137,
- 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 47, 47, 47, 47,
- 47, 47, 47, 137, 137, 0, 0, 0, 0, 0, 0, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 0, 0, 0, 0, 136, 136, 27, 27, 27, 27, 27, 27, 27, 27,
+ 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 47, 47, 47, 47, 47, 47,
+ 47, 136, 136, 0, 0, 0, 0, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 141, 146, 0, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 84, 137, 137, 137, 0, 0,
- 82, 82, 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, 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, 133, 133, 133, 133, 137, 47, 138, 47, 138, 47, 138, 47, 138, 47,
- 138, 47, 47, 47, 138, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 27, 27, 27, 27, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 84, 136, 136, 136, 0, 0, 82, 82,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 143, 144, 133, 133, 133, 133, 133, 145, 133, 145, 137, 137, 145,
- 145, 133, 145, 174, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 82, 82, 82, 82, 82, 82, 82, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 84, 80, 80, 80, 80, 80, 80, 80,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 0, 0, 0, 133, 133, 137, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 137, 133, 133, 133, 133, 137, 137,
- 133, 133, 174, 0, 0, 0, 47, 47, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 136,
+ 132, 136, 132, 132, 132, 132, 132, 132, 132, 0, 139, 136, 132, 136, 136,
+ 132, 132, 132, 132, 132, 132, 132, 132, 136, 136, 136, 136, 136, 136,
+ 132, 132, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 84, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 0, 0, 0, 0, 0, 0, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 0, 0, 0, 0, 0, 0, 82, 82, 82, 82, 82, 82, 82,
+ 52, 82, 82, 82, 82, 82, 82, 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, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 132, 132,
+ 132, 136, 47, 137, 47, 137, 47, 137, 47, 137, 47, 137, 47, 47, 47, 137,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 137, 137, 137, 137, 137, 137, 137, 137, 133, 133, 133, 133, 133, 133,
- 133, 133, 137, 137, 133, 143, 0, 0, 0, 82, 82, 82, 82, 82, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 0, 0, 0, 47, 47, 47, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 142, 143,
+ 132, 132, 132, 132, 132, 144, 132, 144, 136, 136, 144, 144, 132, 144,
+ 173, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 82, 82, 82, 82, 82, 82, 82, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 80, 84, 80, 80, 80, 80, 80, 80, 80, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 0, 0, 0, 132, 132, 136, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 52, 52, 52, 52, 52, 52, 82, 82, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 47, 47, 47, 47, 47, 136, 132, 132, 132, 132, 136, 136, 132, 132, 173, 0,
+ 0, 0, 47, 47, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 0, 0, 0,
+ 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 142, 136, 132, 132, 136, 136, 136, 132, 136, 132, 132,
+ 132, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 82, 82, 82, 82, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 136, 136, 136,
+ 136, 136, 136, 136, 136, 132, 132, 132, 132, 132, 132, 132, 132, 136,
+ 136, 132, 142, 0, 0, 0, 82, 82, 82, 82, 82, 141, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 0, 0, 0, 47, 47, 47, 141, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 52,
+ 52, 52, 52, 52, 52, 82, 82, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 82, 174,
+ 84, 84, 84, 84, 84, 80, 80, 84, 84, 84, 84, 80, 136, 174, 174, 174, 174,
+ 174, 174, 174, 47, 47, 47, 47, 84, 47, 47, 47, 47, 136, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 50, 50, 50, 52, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 52, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 52,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 35, 35, 35, 35, 35, 35, 35, 35, 35, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 50, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 50, 50, 50, 52, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 52, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 52, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 50,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 80, 80, 84, 80, 80, 80, 80, 80, 80, 80, 84, 80, 80,
- 175, 176, 84, 177, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 84, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 43, 43,
- 43, 43, 35, 178, 46, 46, 44, 46, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
- 38, 43, 38, 43, 38, 43, 38, 43, 44, 46, 44, 46, 44, 46, 43, 43, 43, 43,
- 43, 43, 43, 43, 38, 38, 38, 38, 38, 38, 38, 38, 43, 43, 43, 43, 43, 43,
- 0, 0, 38, 38, 38, 38, 38, 38, 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 38,
- 38, 38, 38, 38, 38, 38, 38, 43, 43, 43, 43, 43, 43, 43, 43, 38, 38, 38,
- 38, 38, 38, 38, 38, 43, 43, 43, 43, 43, 43, 0, 0, 38, 38, 38, 38, 38, 38,
- 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 0, 38, 0, 38, 0, 38, 0, 38, 43, 43,
- 43, 43, 43, 43, 43, 43, 38, 38, 38, 38, 38, 38, 38, 38, 43, 179, 43, 179,
- 43, 179, 43, 179, 43, 179, 43, 179, 43, 179, 0, 0, 43, 43, 43, 43, 43,
- 43, 43, 43, 180, 180, 180, 180, 180, 180, 180, 180, 43, 43, 43, 43, 43,
- 43, 43, 43, 180, 180, 180, 180, 180, 180, 180, 180, 43, 43, 43, 43, 43,
- 43, 43, 43, 180, 180, 180, 180, 180, 180, 180, 180, 43, 43, 43, 43, 43,
- 0, 43, 43, 38, 38, 38, 181, 180, 57, 179, 57, 57, 75, 43, 43, 43, 0, 43,
- 43, 38, 181, 38, 181, 180, 75, 75, 75, 43, 43, 43, 179, 0, 0, 43, 43, 38,
- 38, 38, 181, 0, 75, 75, 75, 43, 43, 43, 179, 43, 43, 43, 43, 38, 38, 38,
- 181, 38, 75, 182, 182, 0, 0, 43, 43, 43, 0, 43, 43, 38, 181, 38, 181,
- 180, 182, 57, 0, 183, 183, 184, 184, 184, 184, 184, 184, 184, 184, 184,
- 131, 131, 131, 173, 185, 186, 187, 83, 186, 186, 186, 22, 188, 189, 190,
- 191, 192, 189, 190, 191, 192, 22, 22, 22, 136, 193, 193, 193, 22, 194,
- 195, 196, 197, 198, 199, 200, 21, 201, 108, 201, 202, 203, 22, 188, 188,
- 136, 29, 36, 22, 188, 136, 193, 204, 204, 136, 136, 136, 205, 162, 163,
- 188, 188, 188, 136, 136, 136, 136, 136, 136, 136, 136, 77, 136, 204, 136,
- 136, 188, 136, 136, 136, 136, 136, 136, 136, 184, 131, 131, 131, 131,
- 131, 0, 0, 0, 0, 0, 131, 131, 131, 131, 131, 131, 206, 35, 0, 0, 34, 206,
- 206, 206, 206, 206, 207, 207, 208, 209, 210, 28, 206, 34, 34, 34, 34,
- 206, 206, 206, 206, 206, 207, 207, 208, 209, 210, 0, 50, 50, 50, 50, 50,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146,
- 211, 212, 146, 146, 23, 146, 146, 146, 146, 146, 146, 146, 146, 146, 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, 80, 80, 213, 213, 80, 80, 80, 80, 213, 213, 213, 80, 80, 81, 81, 81,
- 81, 80, 81, 81, 81, 213, 213, 80, 84, 80, 213, 213, 84, 84, 84, 84, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 214, 48, 215, 27, 215,
- 214, 48, 27, 215, 35, 48, 48, 48, 35, 35, 48, 48, 48, 28, 27, 48, 215,
- 27, 27, 48, 48, 48, 48, 48, 27, 27, 214, 215, 215, 27, 48, 27, 216, 27,
- 48, 27, 181, 216, 48, 48, 217, 35, 48, 48, 44, 48, 35, 155, 155, 155,
- 155, 35, 27, 214, 35, 35, 48, 48, 218, 77, 77, 77, 77, 48, 35, 35, 35,
- 35, 27, 77, 27, 27, 46, 79, 0, 0, 0, 37, 37, 219, 219, 219, 219, 219,
- 219, 37, 37, 37, 37, 219, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- 220, 220, 220, 221, 221, 221, 221, 220, 220, 220, 220, 220, 220, 220,
- 220, 220, 220, 221, 221, 221, 221, 221, 221, 172, 172, 172, 44, 46, 172,
- 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 40, 40, 40, 40, 40, 25, 25, 25, 25,
- 25, 222, 222, 27, 27, 27, 27, 77, 27, 27, 77, 27, 27, 77, 27, 27, 27, 27,
- 27, 27, 27, 222, 27, 27, 27, 27, 27, 27, 27, 27, 27, 25, 25, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 223, 222,
- 222, 27, 27, 40, 27, 40, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 40, 224, 225, 225,
- 226, 77, 77, 40, 225, 226, 224, 225, 226, 224, 77, 40, 77, 225, 227, 228,
- 77, 225, 224, 77, 77, 77, 225, 224, 224, 225, 40, 225, 225, 224, 224, 40,
- 226, 40, 226, 40, 40, 40, 40, 225, 229, 218, 225, 218, 218, 224, 224,
- 224, 40, 40, 40, 40, 77, 224, 77, 224, 225, 225, 224, 224, 224, 226, 224,
- 224, 226, 224, 224, 226, 225, 226, 224, 224, 225, 77, 77, 77, 77, 77,
- 225, 224, 224, 224, 77, 77, 77, 77, 77, 77, 77, 77, 77, 224, 230, 40,
- 226, 77, 225, 225, 225, 225, 224, 224, 225, 225, 77, 222, 230, 230, 226,
- 226, 224, 224, 226, 226, 224, 224, 226, 226, 224, 224, 224, 224, 224,
- 224, 226, 226, 225, 225, 226, 226, 225, 225, 226, 226, 224, 224, 224, 77,
- 77, 224, 224, 224, 224, 77, 77, 40, 77, 77, 224, 40, 77, 77, 77, 77, 77,
- 77, 77, 77, 224, 224, 77, 40, 224, 224, 224, 224, 224, 224, 226, 226,
- 226, 226, 224, 224, 224, 224, 224, 224, 224, 224, 224, 77, 77, 77, 77,
- 77, 224, 225, 77, 77, 77, 77, 77, 77, 77, 77, 77, 224, 224, 224, 224,
- 224, 77, 77, 224, 224, 77, 77, 77, 77, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 224, 226, 226, 226, 226, 224, 224, 224, 224, 224, 224, 226,
- 226, 226, 226, 77, 77, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 224, 224, 224, 224, 27, 27, 27, 27, 27, 27, 27, 27, 224, 224,
- 224, 224, 27, 27, 27, 27, 27, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 224, 224, 27, 27, 27, 27, 27, 27, 27, 231, 232, 27, 27,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 80,
+ 80, 84, 80, 80, 80, 80, 80, 80, 80, 84, 80, 80, 175, 176, 84, 177, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 178, 84, 80, 84, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 43, 43, 43, 43, 35, 179, 46,
+ 46, 44, 46, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 44, 46, 44, 46, 44, 46, 43, 43, 43, 43, 43, 43, 43, 43, 38,
+ 38, 38, 38, 38, 38, 38, 38, 43, 43, 43, 43, 43, 43, 0, 0, 38, 38, 38, 38,
+ 38, 38, 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 38, 38, 38, 38, 38, 38, 38,
+ 38, 43, 43, 43, 43, 43, 43, 43, 43, 38, 38, 38, 38, 38, 38, 38, 38, 43,
+ 43, 43, 43, 43, 43, 0, 0, 38, 38, 38, 38, 38, 38, 0, 0, 43, 43, 43, 43,
+ 43, 43, 43, 43, 0, 38, 0, 38, 0, 38, 0, 38, 43, 43, 43, 43, 43, 43, 43,
+ 43, 38, 38, 38, 38, 38, 38, 38, 38, 43, 180, 43, 180, 43, 180, 43, 180,
+ 43, 180, 43, 180, 43, 180, 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 181,
+ 181, 181, 181, 181, 181, 181, 181, 43, 43, 43, 43, 43, 43, 43, 43, 181,
+ 181, 181, 181, 181, 181, 181, 181, 43, 43, 43, 43, 43, 43, 43, 43, 181,
+ 181, 181, 181, 181, 181, 181, 181, 43, 43, 43, 43, 43, 0, 43, 43, 38, 38,
+ 38, 182, 181, 57, 180, 57, 57, 75, 43, 43, 43, 0, 43, 43, 38, 182, 38,
+ 182, 181, 75, 75, 75, 43, 43, 43, 180, 0, 0, 43, 43, 38, 38, 38, 182, 0,
+ 75, 75, 75, 43, 43, 43, 180, 43, 43, 43, 43, 38, 38, 38, 182, 38, 75,
+ 183, 183, 0, 0, 43, 43, 43, 0, 43, 43, 38, 182, 38, 182, 181, 183, 57, 0,
+ 184, 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, 186, 186, 186,
+ 172, 187, 188, 189, 83, 188, 188, 188, 22, 190, 191, 192, 193, 194, 191,
+ 192, 193, 194, 22, 22, 22, 135, 195, 195, 195, 22, 196, 197, 198, 199,
+ 200, 201, 202, 21, 203, 108, 203, 204, 205, 22, 190, 190, 135, 29, 36,
+ 22, 190, 135, 195, 206, 206, 135, 135, 135, 207, 161, 162, 190, 190, 190,
+ 135, 135, 135, 135, 135, 135, 135, 135, 77, 135, 206, 135, 135, 190, 135,
+ 135, 135, 135, 135, 135, 135, 185, 186, 186, 186, 186, 186, 0, 0, 0, 0,
+ 0, 186, 186, 186, 186, 186, 186, 208, 50, 0, 0, 34, 208, 208, 208, 208,
+ 208, 209, 209, 210, 211, 212, 213, 208, 34, 34, 34, 34, 208, 208, 208,
+ 208, 208, 209, 209, 210, 211, 212, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 0, 0, 0, 145, 145, 145, 145, 145, 145, 145, 145, 214,
+ 215, 145, 145, 23, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 80, 80, 174, 174, 80, 80, 80, 80, 174, 174, 174, 80, 80, 81, 81, 81,
+ 81, 80, 81, 81, 81, 174, 174, 80, 84, 80, 174, 174, 84, 84, 84, 84, 80,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 216, 216, 48, 217, 27, 217,
+ 216, 48, 27, 217, 35, 48, 48, 48, 35, 35, 48, 48, 48, 28, 27, 48, 217,
+ 27, 77, 48, 48, 48, 48, 48, 27, 27, 216, 217, 217, 27, 48, 27, 218, 27,
+ 48, 27, 182, 218, 48, 48, 219, 35, 48, 48, 44, 48, 35, 154, 154, 154,
+ 154, 35, 27, 216, 35, 35, 48, 48, 220, 77, 77, 77, 77, 48, 35, 35, 35,
+ 35, 27, 77, 27, 27, 46, 79, 221, 221, 221, 37, 37, 221, 221, 221, 221,
+ 221, 221, 37, 37, 37, 37, 221, 222, 222, 222, 222, 222, 222, 222, 222,
+ 222, 222, 222, 222, 223, 223, 223, 223, 222, 222, 222, 222, 222, 222,
+ 222, 222, 222, 222, 223, 223, 223, 223, 223, 223, 171, 171, 171, 44, 46,
+ 171, 171, 171, 171, 37, 0, 0, 0, 0, 0, 0, 40, 40, 40, 40, 40, 25, 25, 25,
+ 25, 25, 224, 224, 27, 27, 27, 27, 77, 27, 27, 77, 27, 27, 77, 27, 27, 27,
+ 27, 27, 27, 27, 224, 27, 27, 27, 27, 27, 27, 27, 27, 27, 25, 25, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 225,
+ 224, 224, 27, 27, 40, 27, 40, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 40, 226, 227,
+ 227, 228, 77, 77, 40, 227, 228, 226, 227, 228, 226, 77, 40, 77, 227, 229,
+ 230, 77, 227, 226, 77, 77, 77, 227, 226, 226, 227, 40, 227, 227, 226,
+ 226, 40, 228, 40, 228, 40, 40, 40, 40, 227, 231, 220, 227, 220, 220, 226,
+ 226, 226, 40, 40, 40, 40, 77, 226, 77, 226, 227, 227, 226, 226, 226, 228,
+ 226, 226, 228, 226, 226, 228, 227, 228, 226, 226, 227, 77, 77, 77, 77,
+ 77, 227, 226, 226, 226, 77, 77, 77, 77, 77, 77, 77, 77, 77, 226, 232, 40,
+ 228, 77, 227, 227, 227, 227, 226, 226, 227, 227, 77, 224, 232, 232, 228,
+ 228, 226, 226, 228, 228, 226, 226, 228, 228, 226, 226, 226, 226, 226,
+ 226, 228, 228, 227, 227, 228, 228, 227, 227, 228, 228, 226, 226, 226, 77,
+ 77, 226, 226, 226, 226, 77, 77, 40, 77, 77, 226, 40, 77, 77, 77, 77, 77,
+ 77, 77, 77, 226, 226, 77, 40, 226, 226, 226, 226, 226, 226, 228, 228,
+ 228, 228, 226, 226, 226, 226, 226, 226, 226, 226, 226, 77, 77, 77, 77,
+ 77, 226, 227, 77, 77, 77, 77, 77, 77, 77, 77, 77, 226, 226, 226, 226,
+ 226, 77, 77, 226, 226, 77, 77, 77, 77, 226, 226, 226, 226, 226, 226, 226,
+ 226, 226, 226, 228, 228, 228, 228, 226, 226, 226, 226, 226, 226, 228,
+ 228, 228, 228, 77, 77, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
+ 226, 226, 226, 226, 226, 226, 27, 27, 27, 27, 27, 27, 27, 27, 226, 226,
+ 226, 226, 27, 27, 27, 27, 27, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 226, 226, 27, 27, 27, 27, 27, 27, 27, 233, 234, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
@@ -1644,409 +1688,443 @@ static unsigned short index2[] = {
77, 77, 77, 77, 77, 77, 77, 77, 77, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 77, 77, 77, 77, 77,
- 77, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 77, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 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, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 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, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
- 37, 37, 37, 37, 37, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
- 34, 34, 34, 34, 34, 34, 34, 233, 233, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 219,
- 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
- 234, 234, 234, 234, 234, 234, 234, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 37, 37, 37, 37, 37, 37, 37, 37, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 235, 235, 235, 235, 235, 235,
+ 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
+ 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
+ 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
+ 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
+ 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
+ 235, 235, 221, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
+ 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
- 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 27, 27, 27, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 27,
+ 27, 27, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
- 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 25, 25, 25, 25, 25, 25, 25,
- 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 27, 25, 25, 25, 25, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 25, 25, 27, 25, 25, 25, 25, 25, 25, 25, 27,
- 27, 27, 27, 27, 27, 27, 27, 25, 25, 27, 27, 25, 40, 27, 27, 27, 27, 25,
- 25, 27, 27, 25, 40, 27, 27, 27, 27, 25, 25, 25, 27, 27, 25, 27, 27, 25,
- 25, 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 25, 25, 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 25, 27, 27, 27,
- 27, 27, 27, 27, 27, 77, 77, 77, 77, 77, 77, 77, 77, 27, 27, 27, 27, 27,
- 25, 25, 27, 27, 25, 27, 27, 27, 27, 25, 25, 27, 27, 27, 27, 25, 25, 27,
- 27, 27, 27, 27, 27, 25, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 27, 25, 25, 25, 25,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 25, 25, 27, 25, 25, 25, 25, 25,
+ 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 25, 25, 27, 27, 25, 40, 27, 27,
+ 27, 27, 25, 25, 27, 27, 25, 40, 27, 27, 27, 27, 25, 25, 25, 27, 27, 25,
+ 27, 27, 25, 25, 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 25, 25, 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 25,
+ 27, 27, 27, 27, 27, 27, 27, 27, 77, 77, 77, 77, 77, 77, 77, 77, 27, 27,
+ 27, 27, 27, 25, 25, 27, 27, 25, 27, 27, 27, 27, 25, 25, 27, 27, 27, 27,
+ 25, 25, 27, 27, 27, 27, 27, 27, 25, 27, 25, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 25, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 25, 27, 25, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 25, 25, 27, 25, 25, 25, 27, 25, 25, 25, 25, 27, 25, 25, 27, 40, 27,
+ 27, 27, 27, 27, 25, 25, 27, 25, 25, 25, 27, 25, 25, 25, 25, 27, 25, 25,
+ 27, 40, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 25, 25, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 79, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 25, 25, 27, 27, 27, 27, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 27, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 27, 25, 27, 27, 27, 27, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 79, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 0, 0, 0, 27, 27, 27, 27, 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, 27, 27, 27, 27, 0, 27, 27, 27, 27, 0, 0, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 0, 27, 0, 27, 27, 27, 27, 0, 0, 0, 27, 0, 27, 27, 27, 27, 27,
- 27, 27, 0, 0, 27, 27, 27, 27, 27, 27, 27, 162, 163, 162, 163, 162, 163,
- 162, 163, 162, 163, 162, 163, 162, 163, 234, 234, 234, 234, 234, 234,
- 234, 234, 234, 234, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
- 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 27, 0, 0, 0, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 25,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 161, 162,
+ 161, 162, 161, 162, 161, 162, 161, 162, 161, 162, 161, 162, 236, 236,
+ 236, 236, 236, 236, 236, 236, 236, 236, 151, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 0, 224, 77, 77, 224, 224, 162, 163, 77, 224, 224, 77, 0, 224, 0, 0,
- 0, 77, 77, 77, 224, 224, 224, 224, 77, 77, 77, 77, 77, 224, 224, 224, 77,
- 77, 77, 224, 224, 224, 224, 9, 10, 9, 10, 9, 10, 9, 10, 162, 163, 77, 77,
- 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 79, 79, 79, 79,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 226, 77, 77, 226, 226, 161, 162, 77, 226,
+ 226, 77, 0, 226, 0, 77, 77, 77, 77, 77, 226, 226, 226, 226, 77, 77, 77,
+ 77, 77, 226, 226, 226, 77, 77, 77, 226, 226, 226, 226, 9, 10, 9, 10, 9,
+ 10, 9, 10, 161, 162, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
+ 77, 77, 77, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 77, 77,
- 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
+ 79, 79, 79, 79, 79, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
- 77, 77, 77, 162, 163, 9, 10, 162, 163, 162, 163, 162, 163, 162, 163, 162,
- 163, 162, 163, 162, 163, 162, 163, 162, 163, 77, 77, 224, 224, 224, 224,
- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 224, 77, 77, 77, 77, 77, 77, 77, 77, 224, 77, 77, 77, 77, 77,
- 77, 77, 224, 224, 224, 224, 224, 224, 77, 77, 77, 224, 77, 77, 77, 77,
- 224, 224, 224, 224, 224, 77, 224, 224, 77, 77, 162, 163, 162, 163, 224,
- 77, 77, 77, 77, 224, 77, 224, 224, 224, 77, 77, 224, 224, 77, 77, 77, 77,
- 77, 77, 77, 77, 77, 77, 224, 224, 224, 224, 224, 224, 77, 77, 162, 163,
- 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 224, 224, 218, 224, 224,
- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 77,
- 224, 224, 224, 224, 77, 77, 224, 77, 224, 77, 77, 224, 77, 224, 224, 224,
- 224, 77, 77, 77, 77, 77, 224, 224, 77, 77, 77, 77, 77, 77, 224, 224, 224,
- 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
- 77, 77, 77, 77, 77, 77, 224, 224, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
- 77, 224, 224, 77, 77, 77, 77, 224, 224, 224, 224, 77, 224, 224, 77, 77,
- 224, 218, 208, 208, 77, 77, 224, 224, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 224, 224, 224, 224, 77, 77, 224, 224, 224, 224, 224, 224, 224,
- 224, 77, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 77, 77,
- 77, 77, 77, 235, 77, 224, 77, 77, 77, 224, 224, 224, 224, 224, 77, 77,
- 77, 77, 77, 224, 224, 224, 77, 77, 77, 77, 224, 77, 77, 77, 224, 224,
- 224, 224, 224, 77, 224, 77, 77, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 161, 162, 9, 10, 161, 162, 161,
+ 162, 161, 162, 161, 162, 161, 162, 161, 162, 161, 162, 161, 162, 161,
+ 162, 77, 77, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
+ 226, 226, 226, 226, 226, 226, 226, 226, 226, 77, 77, 77, 77, 77, 77, 77,
+ 77, 226, 77, 77, 77, 77, 77, 77, 77, 226, 226, 226, 226, 226, 226, 77,
+ 77, 77, 226, 77, 77, 77, 77, 226, 226, 226, 226, 226, 77, 226, 226, 77,
+ 77, 161, 162, 161, 162, 226, 77, 77, 77, 77, 226, 77, 226, 226, 226, 77,
+ 77, 226, 226, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 226, 226, 226, 226,
+ 226, 226, 77, 77, 161, 162, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
+ 77, 226, 226, 220, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
+ 226, 226, 226, 226, 226, 77, 226, 226, 226, 226, 77, 77, 226, 77, 226,
+ 77, 77, 226, 77, 226, 226, 226, 226, 77, 77, 77, 77, 77, 226, 226, 77,
+ 77, 77, 77, 77, 77, 226, 226, 226, 77, 77, 77, 77, 77, 77, 77, 77, 77,
+ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 226, 226, 77,
+ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 226, 226, 77, 77, 77, 77, 226,
+ 226, 226, 226, 77, 226, 226, 77, 77, 226, 220, 210, 210, 77, 77, 226,
+ 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
+ 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
+ 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 77,
+ 77, 226, 226, 226, 226, 226, 226, 226, 226, 77, 226, 226, 226, 226, 226,
+ 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
+ 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
+ 226, 226, 226, 226, 226, 226, 226, 77, 77, 77, 77, 77, 237, 77, 226, 77,
+ 77, 77, 226, 226, 226, 226, 226, 77, 77, 77, 77, 77, 226, 226, 226, 77,
+ 77, 77, 77, 226, 77, 77, 77, 226, 226, 226, 226, 226, 77, 226, 77, 77,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
- 77, 77, 77, 77, 77, 27, 27, 77, 77, 77, 77, 77, 77, 0, 0, 0, 27, 27, 27,
- 27, 27, 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, 44, 44,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 77, 77, 77, 77, 77, 77,
+ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 27, 27, 77,
+ 77, 77, 77, 77, 77, 0, 0, 0, 27, 27, 27, 27, 27, 25, 25, 25, 25, 25, 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, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 0, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 0, 44, 46, 44, 44, 44, 46, 46, 44, 46, 44, 46, 44, 46, 44,
- 44, 44, 0, 46, 44, 46, 46, 44, 46, 46, 46, 46, 46, 46, 35, 50, 0, 0, 44,
- 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44,
- 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44,
- 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44,
- 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44,
- 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44,
- 46, 44, 46, 44, 46, 44, 46, 44, 46, 46, 27, 27, 27, 27, 27, 27, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 136, 136, 136, 152, 136, 136, 46,
+ 44, 44, 44, 0, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 0, 44, 46,
+ 44, 44, 44, 46, 46, 44, 46, 44, 46, 44, 46, 44, 44, 44, 44, 46, 44, 46,
+ 46, 44, 46, 46, 46, 46, 46, 46, 35, 50, 44, 44, 44, 46, 44, 46, 44, 46,
+ 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
+ 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
+ 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
+ 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
+ 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
+ 44, 46, 44, 46, 46, 27, 27, 27, 27, 27, 27, 44, 46, 44, 46, 80, 80, 80,
+ 0, 0, 0, 0, 0, 0, 0, 135, 135, 135, 135, 151, 135, 135, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 82, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 139, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0,
0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47,
47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47,
- 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 80, 80, 80, 80, 80, 80, 80, 80,
+ 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0,
+ 47, 47, 47, 47, 47, 47, 47, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 136, 136, 29, 36, 29, 36, 136, 136, 136, 29, 36,
- 136, 29, 36, 136, 136, 136, 136, 136, 136, 136, 136, 136, 83, 136, 136,
- 83, 136, 29, 36, 136, 136, 29, 36, 162, 163, 162, 163, 162, 163, 162,
- 163, 136, 136, 136, 136, 136, 51, 136, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 0, 236, 236, 236, 236,
- 237, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 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, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 0, 0, 0, 0, 238,
- 239, 239, 239, 236, 240, 169, 241, 242, 243, 242, 243, 242, 243, 242,
- 243, 242, 243, 236, 236, 242, 243, 242, 243, 242, 243, 242, 243, 244,
- 245, 246, 246, 236, 241, 241, 241, 241, 241, 241, 241, 241, 241, 247,
- 248, 249, 250, 251, 251, 244, 240, 240, 240, 240, 240, 237, 236, 252,
- 252, 252, 240, 169, 239, 236, 27, 0, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 253, 169, 253, 169, 253, 169, 253, 169, 253, 169,
- 253, 169, 253, 169, 253, 169, 253, 169, 253, 169, 253, 169, 253, 169,
- 169, 253, 169, 253, 169, 253, 169, 169, 169, 169, 169, 169, 253, 253,
- 169, 253, 253, 169, 253, 253, 169, 253, 253, 169, 253, 253, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 253, 169, 169, 0, 0, 254, 254, 255, 255,
- 240, 256, 257, 244, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 253, 169, 253, 169, 253, 169, 253, 169, 253, 169, 253, 169, 253,
- 169, 253, 169, 253, 169, 253, 169, 253, 169, 253, 169, 169, 253, 169,
- 253, 169, 253, 169, 169, 169, 169, 169, 169, 253, 253, 169, 253, 253,
- 169, 253, 253, 169, 253, 253, 169, 253, 253, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 253, 169, 169, 253, 253, 253, 253, 239, 240, 240, 256,
- 257, 0, 0, 0, 0, 0, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 0, 0, 0, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
- 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
- 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
- 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
- 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
- 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
- 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 0,
- 258, 258, 259, 259, 259, 259, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 0, 0, 0, 0,
- 0, 0, 0, 0, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 237, 237, 0, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 237, 237, 237, 258,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 237, 237, 237, 237, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 0, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 237, 237, 237, 237, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 237,
- 237, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
- 260, 260, 260, 260, 237, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 27,
+ 80, 80, 80, 80, 135, 135, 29, 36, 29, 36, 135, 135, 135, 29, 36, 135, 29,
+ 36, 135, 135, 135, 135, 135, 135, 135, 135, 135, 83, 135, 135, 83, 135,
+ 29, 36, 135, 135, 29, 36, 161, 162, 161, 162, 161, 162, 161, 162, 135,
+ 135, 135, 135, 135, 51, 135, 135, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 0, 238, 238, 238, 238, 239, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+ 239, 239, 239, 239, 239, 239, 239, 239, 239, 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, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 0, 0, 0, 0, 240, 241, 241, 241,
+ 238, 242, 168, 243, 244, 245, 244, 245, 244, 245, 244, 245, 244, 245,
+ 238, 238, 244, 245, 244, 245, 244, 245, 244, 245, 246, 247, 248, 248,
+ 238, 243, 243, 243, 243, 243, 243, 243, 243, 243, 249, 250, 251, 252,
+ 253, 253, 246, 242, 242, 242, 242, 242, 239, 238, 254, 254, 254, 242,
+ 168, 241, 238, 27, 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 255, 168, 255, 168, 255, 168, 255, 168, 255, 168, 255, 168, 255,
+ 168, 255, 168, 255, 168, 255, 168, 255, 168, 255, 168, 168, 255, 168,
+ 255, 168, 255, 168, 168, 168, 168, 168, 168, 255, 255, 168, 255, 255,
+ 168, 255, 255, 168, 255, 255, 168, 255, 255, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 255, 168, 168, 0, 0, 256, 256, 257, 257, 242, 258, 259,
+ 246, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 255, 168,
+ 255, 168, 255, 168, 255, 168, 255, 168, 255, 168, 255, 168, 255, 168,
+ 255, 168, 255, 168, 255, 168, 255, 168, 168, 255, 168, 255, 168, 255,
+ 168, 168, 168, 168, 168, 168, 255, 255, 168, 255, 255, 168, 255, 255,
+ 168, 255, 255, 168, 255, 255, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 255, 168, 168, 255, 255, 255, 255, 241, 242, 242, 258, 259, 0, 0, 0, 0,
+ 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 0, 0, 0,
+ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
+ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
+ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
+ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
+ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
+ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
+ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 0, 260, 260, 261, 261,
+ 261, 261, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 0, 0, 0, 0, 0,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 239, 239, 0, 261, 261, 261, 261, 261, 261, 261, 261, 261,
+ 261, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 263, 263, 263, 263, 263, 263, 263, 263, 239, 264, 264,
+ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 239,
+ 239, 239, 260, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 264, 264, 264, 264,
+ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 239, 239, 239, 239, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 0, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 239, 239, 239,
+ 239, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 239, 239, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 239, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 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, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 240, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 0, 0, 0, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 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, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 52, 136, 136, 136, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 46, 44, 46, 44, 46, 44, 46, 44,
- 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44,
- 46, 44, 46, 44, 46, 0, 0, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
- 47, 80, 81, 81, 81, 136, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 136, 51, 44, 46,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 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, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 242, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 0, 0, 0, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 52, 52, 52, 52, 52, 52,
+ 82, 82, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 52, 135, 135,
+ 135, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 141,
+ 141, 141, 141, 141, 141, 141, 141, 141, 141, 47, 47, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 46, 44, 46, 44, 46, 44, 46,
44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
- 44, 46, 44, 46, 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, 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, 53, 53, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 53, 53, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
- 44, 46, 44, 46, 46, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
+ 44, 46, 47, 80, 81, 81, 81, 135, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 135, 51,
44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46,
- 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 50, 46, 46, 46,
- 46, 46, 46, 46, 46, 44, 46, 44, 46, 44, 44, 46, 44, 46, 44, 46, 44, 46,
- 44, 46, 51, 262, 262, 44, 46, 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,
+ 44, 46, 44, 46, 44, 46, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 80, 80, 82, 82, 82, 82, 82, 82, 0, 0, 0, 0, 0, 0, 0,
+ 0, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 51, 51, 51, 51, 51, 51, 51, 51, 51, 53, 53, 44,
+ 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 46, 46, 44, 46, 44,
+ 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44,
+ 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44,
+ 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 44,
+ 46, 44, 46, 44, 46, 50, 46, 46, 46, 46, 46, 46, 46, 46, 44, 46, 44, 46,
+ 44, 44, 46, 44, 46, 44, 46, 44, 46, 44, 46, 51, 265, 265, 44, 46, 44, 46,
+ 0, 44, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 46, 44, 46, 44,
+ 46, 44, 46, 44, 46, 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, 0, 0,
- 47, 47, 47, 47, 47, 47, 47, 133, 47, 47, 47, 140, 47, 47, 47, 47, 133,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 47, 47, 47, 47, 47, 47, 47,
+ 132, 47, 47, 47, 139, 47, 47, 47, 47, 132, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 136, 136,
+ 132, 132, 136, 27, 27, 27, 27, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146,
+ 79, 79, 145, 219, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 137, 137, 133, 133, 137, 27, 27, 27, 27, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 135, 135, 135, 135, 0, 0, 0, 0, 0, 0, 0, 0,
+ 136, 136, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 136, 136, 136, 136, 0, 0, 0, 0,
- 0, 0, 0, 0, 137, 137, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
+ 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 82, 141, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 47, 47, 47, 47, 47, 47, 82, 82, 82,
+ 47, 0, 0, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 132, 132, 132, 132, 132, 84, 84, 84, 82,
+ 82, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 136, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 0, 0, 0, 132, 132,
+ 132, 136, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
- 137, 137, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 82, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 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,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 142, 136, 136, 132,
+ 132, 132, 132, 136, 136, 132, 136, 136, 136, 173, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 0, 52, 141, 141, 141, 141, 141, 141, 141,
+ 141, 141, 141, 0, 0, 0, 0, 82, 82, 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, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 133, 133, 133, 133, 133, 84, 84, 84, 82, 82, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 137, 174,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 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, 47, 47, 47,
+ 47, 132, 132, 132, 132, 132, 132, 136, 136, 132, 132, 136, 136, 132, 132,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 132, 47, 47, 47, 47, 47, 47, 47,
+ 47, 132, 136, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 0,
+ 0, 82, 82, 82, 82, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 52, 47, 47, 47, 47, 47, 47, 79, 79, 79, 47, 136, 0, 0, 0, 0,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 133, 133, 133, 133, 133, 133, 137, 137, 133, 133, 137, 137, 133,
- 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 133, 47, 47, 47, 47, 47, 47,
- 47, 47, 133, 137, 0, 0, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 0, 0, 82, 82, 82, 82, 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, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 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,
- 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, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 263, 263, 263, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 169, 169, 265, 169, 265, 169,
- 169, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 169, 265, 169,
- 265, 169, 169, 265, 265, 169, 169, 169, 265, 265, 265, 265, 0, 0, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 0, 0, 0, 0, 0, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 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, 35, 35, 35, 35, 35, 35, 35, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 35, 35, 35, 35, 35, 0, 0, 0, 0, 0, 266, 267, 266,
- 268, 268, 268, 268, 268, 268, 268, 268, 268, 207, 266, 266, 266, 266,
- 266, 266, 266, 266, 266, 266, 266, 266, 266, 0, 266, 266, 266, 266, 266,
- 0, 266, 0, 266, 266, 0, 266, 266, 0, 266, 266, 266, 266, 266, 266, 266,
- 266, 266, 268, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 47, 80, 80, 84, 47,
+ 47, 80, 80, 47, 47, 47, 47, 47, 80, 80, 47, 80, 47, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 52, 82, 82, 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, 47, 47, 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47,
+ 47, 0, 0, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47,
+ 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 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, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 136, 136, 132, 136, 136, 132,
+ 136, 136, 82, 136, 139, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 141, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 0, 0, 0, 0, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 0, 0, 0, 0,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 168, 168, 268, 168, 268, 168, 168, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 168, 268, 168, 268, 168,
+ 168, 268, 268, 168, 168, 168, 268, 268, 268, 268, 0, 0, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 0, 0, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 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, 35, 35, 35, 35, 35, 35, 35, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 35, 35, 35, 35, 35, 0, 0, 0, 0, 0, 269, 270, 269,
+ 271, 271, 271, 271, 271, 271, 271, 271, 271, 209, 269, 269, 269, 269,
+ 269, 269, 269, 269, 269, 269, 269, 269, 269, 0, 269, 269, 269, 269, 269,
+ 0, 269, 0, 269, 269, 0, 269, 269, 0, 269, 269, 269, 269, 269, 269, 269,
+ 269, 269, 271, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 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, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
@@ -2062,26 +2140,26 @@ static unsigned short index2[] = {
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 191, 269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 193, 273, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 0, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 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, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 270, 27, 0, 0, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
- 70, 70, 70, 271, 271, 271, 271, 271, 271, 271, 272, 273, 271, 0, 0, 0, 0,
- 0, 0, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 271, 274,
- 274, 275, 275, 272, 273, 272, 273, 272, 273, 272, 273, 272, 273, 272,
- 273, 272, 273, 272, 273, 239, 239, 272, 273, 271, 271, 271, 271, 275,
- 275, 275, 276, 271, 276, 0, 271, 276, 271, 271, 274, 277, 278, 277, 278,
- 277, 278, 279, 271, 271, 280, 281, 282, 282, 283, 0, 271, 284, 279, 271,
- 0, 0, 0, 0, 128, 128, 128, 115, 128, 0, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 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, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 274, 27, 0, 0, 70, 70, 70, 70, 70, 70,
+ 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 275, 275, 275, 275, 275, 275,
+ 275, 276, 277, 275, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80, 80, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 275, 278, 278, 279, 279, 276, 277, 276, 277, 276,
+ 277, 276, 277, 276, 277, 276, 277, 276, 277, 276, 277, 241, 241, 276,
+ 277, 275, 275, 275, 275, 279, 279, 279, 280, 275, 280, 0, 275, 280, 275,
+ 275, 278, 281, 282, 281, 282, 281, 282, 283, 275, 275, 284, 285, 286,
+ 286, 287, 0, 275, 288, 283, 275, 0, 0, 0, 0, 128, 128, 128, 115, 128, 0,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
@@ -2091,173 +2169,229 @@ static unsigned short index2[] = {
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 131, 0, 285, 285, 286, 287, 286, 285, 285, 288, 289,
- 285, 290, 291, 292, 291, 291, 293, 293, 293, 293, 293, 293, 293, 293,
- 293, 293, 291, 285, 294, 295, 294, 285, 285, 296, 296, 296, 296, 296,
- 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296,
- 296, 296, 296, 296, 296, 296, 296, 288, 285, 289, 297, 298, 297, 299,
- 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299,
- 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 288, 295, 289,
- 295, 288, 289, 300, 301, 302, 300, 300, 303, 303, 303, 303, 303, 303,
- 303, 303, 303, 303, 304, 303, 303, 303, 303, 303, 303, 303, 303, 303,
- 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 186, 0, 289, 289, 290,
+ 291, 290, 289, 289, 292, 293, 289, 294, 295, 296, 295, 295, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297, 295, 289, 298, 299, 298, 289,
+ 289, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
+ 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 292,
+ 289, 293, 301, 302, 301, 303, 303, 303, 303, 303, 303, 303, 303, 303,
303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303,
- 303, 303, 303, 303, 303, 303, 303, 303, 304, 304, 303, 303, 303, 303,
- 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303,
- 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 0, 0, 0,
- 303, 303, 303, 303, 303, 303, 0, 0, 303, 303, 303, 303, 303, 303, 0, 0,
- 303, 303, 303, 303, 303, 303, 0, 0, 303, 303, 303, 0, 0, 0, 287, 287,
- 295, 297, 305, 287, 287, 0, 306, 307, 307, 307, 307, 306, 306, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 308, 308, 308, 27, 25, 0, 0, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0,
- 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0,
- 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 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, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 303, 303, 303, 292, 299, 293, 299, 292, 293, 304, 305, 306, 304, 304,
+ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 308, 307, 307, 307,
+ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ 308, 308, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ 307, 307, 307, 307, 307, 0, 0, 0, 307, 307, 307, 307, 307, 307, 0, 0,
+ 307, 307, 307, 307, 307, 307, 0, 0, 307, 307, 307, 307, 307, 307, 0, 0,
+ 307, 307, 307, 0, 0, 0, 291, 291, 299, 301, 309, 291, 291, 0, 310, 311,
+ 311, 311, 311, 310, 310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 312, 312, 312, 27,
+ 25, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 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, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 0, 0, 0, 0, 0, 82, 136, 79, 0, 0, 0, 0, 147, 147, 147, 147, 147, 147,
- 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
- 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
- 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 0, 0, 0, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 309, 309, 309, 309, 309, 309, 309, 309, 309,
- 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
- 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
- 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
- 309, 309, 152, 152, 152, 152, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 152, 0, 0, 0, 0, 0, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 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, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 84, 0, 0,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 82, 135, 79, 0, 0, 0, 0,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 0, 0, 0, 79, 79, 79, 79, 79, 79, 79, 79, 79, 313, 313,
+ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
+ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
+ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
+ 313, 313, 313, 313, 313, 313, 313, 313, 313, 151, 151, 151, 151, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 151, 0, 0, 0,
+ 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 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, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 84, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 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, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 0, 147, 147, 147, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 172, 47,
- 47, 47, 47, 47, 47, 47, 47, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 146, 146, 146, 146, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 171, 47, 47, 47, 47, 47, 47, 47, 47, 171, 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, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 0, 82, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 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, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 82, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47,
- 47, 82, 172, 172, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0,
+ 0, 47, 47, 47, 47, 47, 47, 47, 47, 82, 171, 171, 171, 171, 171, 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, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 44, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 0, 0, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 0, 0, 0, 0, 0, 0,
+ 47, 47, 47, 47, 47, 47, 47, 0, 0, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 141, 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, 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, 105, 105, 105, 105, 105, 105, 0, 0, 105, 0, 105,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 105, 105, 105,
+ 105, 105, 0, 0, 105, 0, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 0, 105, 105, 0, 0, 0, 105, 0, 0, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 0, 102, 314, 314, 314, 314, 314, 314,
+ 314, 314, 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, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
- 105, 0, 105, 105, 0, 0, 0, 105, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 314, 314, 314, 314, 314, 314, 0, 0, 0, 135, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 0, 0, 0, 0, 0, 102, 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, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
- 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 310, 310, 310,
- 310, 0, 0, 0, 0, 0, 136, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 0, 0, 0, 0, 0, 0, 0, 0, 105, 132, 132, 132, 0, 132, 132, 0, 0, 0, 0, 0,
+ 132, 84, 132, 80, 105, 105, 105, 105, 0, 105, 105, 105, 0, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 0, 0, 0, 0, 80, 174,
+ 84, 0, 0, 0, 0, 139, 314, 314, 314, 314, 314, 314, 314, 314, 0, 0, 0, 0,
+ 0, 0, 0, 0, 102, 102, 102, 102, 102, 102, 102, 102, 102, 0, 0, 0, 0, 0,
+ 0, 0, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 314, 314, 102, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 0, 0, 0, 135, 135, 135, 135, 135, 135, 135, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 0, 0, 314, 314, 314, 314, 314, 314, 314, 314,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 0, 0, 0, 0, 0, 314, 314, 314, 314, 314, 314,
+ 314, 314, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
- 105, 105, 105, 0, 0, 0, 0, 0, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 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,
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, 105, 133, 133, 133, 0, 133, 133, 0, 0, 0, 0, 0, 133, 84, 133,
- 80, 105, 105, 105, 105, 0, 105, 105, 105, 0, 105, 105, 105, 105, 105,
- 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
- 105, 105, 105, 105, 105, 105, 105, 105, 0, 0, 0, 0, 80, 213, 84, 0, 0, 0,
- 0, 140, 310, 310, 310, 310, 310, 310, 310, 310, 0, 0, 0, 0, 0, 0, 0, 0,
- 102, 102, 102, 102, 102, 102, 102, 102, 102, 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, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 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, 315, 315, 315, 315, 315,
+ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 0, 136, 132,
+ 136, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
+ 139, 82, 82, 82, 82, 82, 82, 82, 0, 0, 0, 0, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 132, 136, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 137, 47,
+ 137, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 137, 47, 47,
+ 47, 47, 136, 136, 136, 132, 132, 132, 132, 136, 136, 139, 138, 82, 82,
+ 172, 82, 82, 82, 82, 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, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
- 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
- 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
- 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
- 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
- 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
- 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
- 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 82, 82, 82, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
+ 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 82, 82, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 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, 0, 0, 0,
+ 0, 0, 0, 0, 168, 168, 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, 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, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 0, 0, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 0, 0, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 311, 311, 311, 311, 311, 311, 311,
- 312, 312, 213, 213, 213, 79, 79, 79, 313, 312, 312, 312, 312, 312, 131,
- 131, 131, 131, 131, 131, 131, 131, 84, 84, 84, 84, 84, 84, 84, 84, 79,
- 79, 80, 80, 80, 80, 80, 84, 84, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 316, 316, 316, 316, 316,
+ 316, 316, 317, 317, 174, 174, 174, 79, 79, 79, 318, 317, 317, 317, 317,
+ 317, 186, 186, 186, 186, 186, 186, 186, 186, 84, 84, 84, 84, 84, 84, 84,
+ 84, 79, 79, 80, 80, 80, 80, 80, 84, 84, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 80, 80, 80, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 311, 311, 311, 311, 311, 311, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 80, 80, 80, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 316, 316, 316, 316, 316, 316, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 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, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 79, 79, 79, 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, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 80, 80, 80, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 27, 27, 27, 27, 80, 80, 80, 27, 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, 27, 27, 27, 27, 27,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 147,
- 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
- 147, 147, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 35, 35, 35, 35, 35, 35, 35, 0, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 35, 35, 35, 35, 35, 35, 35, 0, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 48, 0, 48, 48, 0, 0, 48, 0, 0, 48,
+ 48, 0, 0, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 35, 35, 35,
+ 35, 0, 35, 0, 35, 35, 35, 35, 35, 35, 35, 0, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 35, 35, 35, 35, 35, 48, 0, 48, 48, 0, 0, 48, 0, 0, 48, 48, 0,
- 0, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 35, 35, 35, 35, 0,
- 35, 0, 35, 35, 35, 35, 35, 35, 35, 0, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 48, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48,
- 48, 48, 48, 48, 48, 48, 0, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 48, 48, 0,
- 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 0, 48, 0, 0, 0, 48, 48, 48, 48,
+ 35, 35, 48, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48,
+ 0, 48, 48, 48, 48, 48, 48, 48, 0, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 48, 48,
+ 0, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 0, 48, 0, 0, 0, 48, 48, 48, 48,
48, 48, 48, 0, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
@@ -2278,25 +2412,25 @@ static unsigned short index2[] = {
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 314, 35, 35, 35, 35, 35, 35, 35,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 319, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 315, 35, 35, 35, 35, 35, 35, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 314, 35, 35, 35,
+ 220, 35, 35, 35, 35, 35, 35, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 319, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 35, 315, 35, 35, 35, 35, 35, 35, 48, 48, 48, 48, 48, 48, 48,
+ 35, 35, 35, 35, 220, 35, 35, 35, 35, 35, 35, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 314, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 35, 35, 35, 35, 35, 315, 35, 35, 35, 35, 35, 35, 48, 48, 48,
+ 319, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 220, 35, 35, 35, 35, 35, 35, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 314, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 315, 35, 35, 35, 35, 35,
+ 48, 48, 48, 48, 319, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 220, 35, 35, 35, 35, 35,
35, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 314, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 315, 35,
- 35, 35, 35, 35, 35, 48, 35, 0, 0, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 27,
+ 48, 48, 48, 48, 48, 48, 48, 48, 319, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 220, 35,
+ 35, 35, 35, 35, 35, 48, 35, 0, 0, 320, 320, 320, 320, 320, 320, 320, 320,
+ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
+ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
+ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27,
@@ -2305,34 +2439,130 @@ static unsigned short index2[] = {
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 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, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 0,
+ 0, 0, 0, 0, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
+ 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
+ 235, 235, 235, 235, 321, 0, 235, 235, 235, 235, 235, 235, 235, 235, 235,
+ 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
+ 235, 235, 235, 235, 235, 235, 235, 235, 235, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 0, 0, 0, 0, 0, 0, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 235, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 262, 262, 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 0, 0, 0, 0, 0, 262, 262, 262, 262, 262, 262, 262, 262, 262, 0,
+ 0, 0, 0, 0, 0, 0, 262, 262, 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, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 27, 27,
+ 27, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 0, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 27, 27, 27,
+ 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 0, 27, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 79, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 0, 27, 27, 27, 27, 0, 0, 0, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 79, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 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, 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, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 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, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 265, 265, 265, 265, 265, 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, 27, 27, 27, 27, 27, 0, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 27, 27, 27, 0, 27, 0, 27, 0, 27,
+ 0, 27, 27, 27, 0, 27, 27, 27, 27, 27, 27, 0, 0, 27, 27, 27, 27, 0, 27, 0,
+ 0, 27, 27, 27, 27, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0,
+ 0, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 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, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 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, 131, 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, 131,
- 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
- 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
- 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
- 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
- 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
- 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
- 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 70, 70, 70, 70,
- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 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, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 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, 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, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268,
+ 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 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, 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, 186, 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, 186, 186, 186, 186, 186, 186, 186, 186, 186,
+ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
+ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
+ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
+ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
+ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
+ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
+ 186, 186, 186, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
@@ -2345,16 +2575,17 @@ static unsigned short index2[] = {
70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
- 70, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 0, 0,
+ 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 0, 0,
};
/* decomposition data */
@@ -2582,15 +2813,17 @@ static unsigned int decomp_data[] = {
8722, 259, 61, 259, 40, 259, 41, 259, 110, 261, 48, 261, 49, 261, 50,
261, 51, 261, 52, 261, 53, 261, 54, 261, 55, 261, 56, 261, 57, 261, 43,
261, 8722, 261, 61, 261, 40, 261, 41, 261, 97, 261, 101, 261, 111, 261,
- 120, 261, 601, 514, 82, 115, 770, 97, 47, 99, 770, 97, 47, 115, 262, 67,
- 514, 176, 67, 770, 99, 47, 111, 770, 99, 47, 117, 258, 400, 514, 176, 70,
- 262, 103, 262, 72, 262, 72, 262, 72, 262, 104, 262, 295, 262, 73, 262,
- 73, 262, 76, 262, 108, 262, 78, 514, 78, 111, 262, 80, 262, 81, 262, 82,
- 262, 82, 262, 82, 515, 83, 77, 770, 84, 69, 76, 515, 84, 77, 262, 90,
- 256, 937, 262, 90, 256, 75, 256, 197, 262, 66, 262, 67, 262, 101, 262,
- 69, 262, 70, 262, 77, 262, 111, 258, 1488, 258, 1489, 258, 1490, 258,
- 1491, 262, 105, 770, 70, 65, 88, 262, 960, 262, 947, 262, 915, 262, 928,
- 262, 8721, 262, 68, 262, 100, 262, 101, 262, 105, 262, 106, 772, 49,
+ 120, 261, 601, 261, 104, 261, 107, 261, 108, 261, 109, 261, 110, 261,
+ 112, 261, 115, 261, 116, 514, 82, 115, 770, 97, 47, 99, 770, 97, 47, 115,
+ 262, 67, 514, 176, 67, 770, 99, 47, 111, 770, 99, 47, 117, 258, 400, 514,
+ 176, 70, 262, 103, 262, 72, 262, 72, 262, 72, 262, 104, 262, 295, 262,
+ 73, 262, 73, 262, 76, 262, 108, 262, 78, 514, 78, 111, 262, 80, 262, 81,
+ 262, 82, 262, 82, 262, 82, 515, 83, 77, 770, 84, 69, 76, 515, 84, 77,
+ 262, 90, 256, 937, 262, 90, 256, 75, 256, 197, 262, 66, 262, 67, 262,
+ 101, 262, 69, 262, 70, 262, 77, 262, 111, 258, 1488, 258, 1489, 258,
+ 1490, 258, 1491, 262, 105, 770, 70, 65, 88, 262, 960, 262, 947, 262, 915,
+ 262, 928, 262, 8721, 262, 68, 262, 100, 262, 101, 262, 105, 262, 106,
+ 772, 49, 8260, 55, 772, 49, 8260, 57, 1028, 49, 8260, 49, 48, 772, 49,
8260, 51, 772, 50, 8260, 51, 772, 49, 8260, 53, 772, 50, 8260, 53, 772,
51, 8260, 53, 772, 52, 8260, 53, 772, 49, 8260, 54, 772, 53, 8260, 54,
772, 49, 8260, 56, 772, 51, 8260, 56, 772, 53, 8260, 56, 772, 55, 8260,
@@ -2600,169 +2833,170 @@ static unsigned int decomp_data[] = {
77, 258, 105, 514, 105, 105, 770, 105, 105, 105, 514, 105, 118, 258, 118,
514, 118, 105, 770, 118, 105, 105, 1026, 118, 105, 105, 105, 514, 105,
120, 258, 120, 514, 120, 105, 770, 120, 105, 105, 258, 108, 258, 99, 258,
- 100, 258, 109, 512, 8592, 824, 512, 8594, 824, 512, 8596, 824, 512, 8656,
- 824, 512, 8660, 824, 512, 8658, 824, 512, 8707, 824, 512, 8712, 824, 512,
- 8715, 824, 512, 8739, 824, 512, 8741, 824, 514, 8747, 8747, 770, 8747,
- 8747, 8747, 514, 8750, 8750, 770, 8750, 8750, 8750, 512, 8764, 824, 512,
- 8771, 824, 512, 8773, 824, 512, 8776, 824, 512, 61, 824, 512, 8801, 824,
- 512, 8781, 824, 512, 60, 824, 512, 62, 824, 512, 8804, 824, 512, 8805,
- 824, 512, 8818, 824, 512, 8819, 824, 512, 8822, 824, 512, 8823, 824, 512,
- 8826, 824, 512, 8827, 824, 512, 8834, 824, 512, 8835, 824, 512, 8838,
- 824, 512, 8839, 824, 512, 8866, 824, 512, 8872, 824, 512, 8873, 824, 512,
- 8875, 824, 512, 8828, 824, 512, 8829, 824, 512, 8849, 824, 512, 8850,
- 824, 512, 8882, 824, 512, 8883, 824, 512, 8884, 824, 512, 8885, 824, 256,
- 12296, 256, 12297, 263, 49, 263, 50, 263, 51, 263, 52, 263, 53, 263, 54,
- 263, 55, 263, 56, 263, 57, 519, 49, 48, 519, 49, 49, 519, 49, 50, 519,
- 49, 51, 519, 49, 52, 519, 49, 53, 519, 49, 54, 519, 49, 55, 519, 49, 56,
- 519, 49, 57, 519, 50, 48, 770, 40, 49, 41, 770, 40, 50, 41, 770, 40, 51,
- 41, 770, 40, 52, 41, 770, 40, 53, 41, 770, 40, 54, 41, 770, 40, 55, 41,
- 770, 40, 56, 41, 770, 40, 57, 41, 1026, 40, 49, 48, 41, 1026, 40, 49, 49,
- 41, 1026, 40, 49, 50, 41, 1026, 40, 49, 51, 41, 1026, 40, 49, 52, 41,
- 1026, 40, 49, 53, 41, 1026, 40, 49, 54, 41, 1026, 40, 49, 55, 41, 1026,
- 40, 49, 56, 41, 1026, 40, 49, 57, 41, 1026, 40, 50, 48, 41, 514, 49, 46,
- 514, 50, 46, 514, 51, 46, 514, 52, 46, 514, 53, 46, 514, 54, 46, 514, 55,
- 46, 514, 56, 46, 514, 57, 46, 770, 49, 48, 46, 770, 49, 49, 46, 770, 49,
- 50, 46, 770, 49, 51, 46, 770, 49, 52, 46, 770, 49, 53, 46, 770, 49, 54,
- 46, 770, 49, 55, 46, 770, 49, 56, 46, 770, 49, 57, 46, 770, 50, 48, 46,
- 770, 40, 97, 41, 770, 40, 98, 41, 770, 40, 99, 41, 770, 40, 100, 41, 770,
- 40, 101, 41, 770, 40, 102, 41, 770, 40, 103, 41, 770, 40, 104, 41, 770,
- 40, 105, 41, 770, 40, 106, 41, 770, 40, 107, 41, 770, 40, 108, 41, 770,
- 40, 109, 41, 770, 40, 110, 41, 770, 40, 111, 41, 770, 40, 112, 41, 770,
- 40, 113, 41, 770, 40, 114, 41, 770, 40, 115, 41, 770, 40, 116, 41, 770,
- 40, 117, 41, 770, 40, 118, 41, 770, 40, 119, 41, 770, 40, 120, 41, 770,
- 40, 121, 41, 770, 40, 122, 41, 263, 65, 263, 66, 263, 67, 263, 68, 263,
- 69, 263, 70, 263, 71, 263, 72, 263, 73, 263, 74, 263, 75, 263, 76, 263,
- 77, 263, 78, 263, 79, 263, 80, 263, 81, 263, 82, 263, 83, 263, 84, 263,
- 85, 263, 86, 263, 87, 263, 88, 263, 89, 263, 90, 263, 97, 263, 98, 263,
- 99, 263, 100, 263, 101, 263, 102, 263, 103, 263, 104, 263, 105, 263, 106,
- 263, 107, 263, 108, 263, 109, 263, 110, 263, 111, 263, 112, 263, 113,
- 263, 114, 263, 115, 263, 116, 263, 117, 263, 118, 263, 119, 263, 120,
- 263, 121, 263, 122, 263, 48, 1026, 8747, 8747, 8747, 8747, 770, 58, 58,
- 61, 514, 61, 61, 770, 61, 61, 61, 512, 10973, 824, 261, 106, 259, 86,
- 259, 11617, 258, 27597, 258, 40863, 258, 19968, 258, 20008, 258, 20022,
- 258, 20031, 258, 20057, 258, 20101, 258, 20108, 258, 20128, 258, 20154,
- 258, 20799, 258, 20837, 258, 20843, 258, 20866, 258, 20886, 258, 20907,
- 258, 20960, 258, 20981, 258, 20992, 258, 21147, 258, 21241, 258, 21269,
- 258, 21274, 258, 21304, 258, 21313, 258, 21340, 258, 21353, 258, 21378,
- 258, 21430, 258, 21448, 258, 21475, 258, 22231, 258, 22303, 258, 22763,
- 258, 22786, 258, 22794, 258, 22805, 258, 22823, 258, 22899, 258, 23376,
- 258, 23424, 258, 23544, 258, 23567, 258, 23586, 258, 23608, 258, 23662,
- 258, 23665, 258, 24027, 258, 24037, 258, 24049, 258, 24062, 258, 24178,
- 258, 24186, 258, 24191, 258, 24308, 258, 24318, 258, 24331, 258, 24339,
- 258, 24400, 258, 24417, 258, 24435, 258, 24515, 258, 25096, 258, 25142,
- 258, 25163, 258, 25903, 258, 25908, 258, 25991, 258, 26007, 258, 26020,
- 258, 26041, 258, 26080, 258, 26085, 258, 26352, 258, 26376, 258, 26408,
- 258, 27424, 258, 27490, 258, 27513, 258, 27571, 258, 27595, 258, 27604,
- 258, 27611, 258, 27663, 258, 27668, 258, 27700, 258, 28779, 258, 29226,
- 258, 29238, 258, 29243, 258, 29247, 258, 29255, 258, 29273, 258, 29275,
- 258, 29356, 258, 29572, 258, 29577, 258, 29916, 258, 29926, 258, 29976,
- 258, 29983, 258, 29992, 258, 30000, 258, 30091, 258, 30098, 258, 30326,
- 258, 30333, 258, 30382, 258, 30399, 258, 30446, 258, 30683, 258, 30690,
- 258, 30707, 258, 31034, 258, 31160, 258, 31166, 258, 31348, 258, 31435,
- 258, 31481, 258, 31859, 258, 31992, 258, 32566, 258, 32593, 258, 32650,
- 258, 32701, 258, 32769, 258, 32780, 258, 32786, 258, 32819, 258, 32895,
- 258, 32905, 258, 33251, 258, 33258, 258, 33267, 258, 33276, 258, 33292,
- 258, 33307, 258, 33311, 258, 33390, 258, 33394, 258, 33400, 258, 34381,
- 258, 34411, 258, 34880, 258, 34892, 258, 34915, 258, 35198, 258, 35211,
- 258, 35282, 258, 35328, 258, 35895, 258, 35910, 258, 35925, 258, 35960,
- 258, 35997, 258, 36196, 258, 36208, 258, 36275, 258, 36523, 258, 36554,
- 258, 36763, 258, 36784, 258, 36789, 258, 37009, 258, 37193, 258, 37318,
- 258, 37324, 258, 37329, 258, 38263, 258, 38272, 258, 38428, 258, 38582,
- 258, 38585, 258, 38632, 258, 38737, 258, 38750, 258, 38754, 258, 38761,
- 258, 38859, 258, 38893, 258, 38899, 258, 38913, 258, 39080, 258, 39131,
- 258, 39135, 258, 39318, 258, 39321, 258, 39340, 258, 39592, 258, 39640,
- 258, 39647, 258, 39717, 258, 39727, 258, 39730, 258, 39740, 258, 39770,
- 258, 40165, 258, 40565, 258, 40575, 258, 40613, 258, 40635, 258, 40643,
- 258, 40653, 258, 40657, 258, 40697, 258, 40701, 258, 40718, 258, 40723,
- 258, 40736, 258, 40763, 258, 40778, 258, 40786, 258, 40845, 258, 40860,
- 258, 40864, 264, 32, 258, 12306, 258, 21313, 258, 21316, 258, 21317, 512,
- 12363, 12441, 512, 12365, 12441, 512, 12367, 12441, 512, 12369, 12441,
- 512, 12371, 12441, 512, 12373, 12441, 512, 12375, 12441, 512, 12377,
- 12441, 512, 12379, 12441, 512, 12381, 12441, 512, 12383, 12441, 512,
- 12385, 12441, 512, 12388, 12441, 512, 12390, 12441, 512, 12392, 12441,
- 512, 12399, 12441, 512, 12399, 12442, 512, 12402, 12441, 512, 12402,
- 12442, 512, 12405, 12441, 512, 12405, 12442, 512, 12408, 12441, 512,
- 12408, 12442, 512, 12411, 12441, 512, 12411, 12442, 512, 12358, 12441,
- 514, 32, 12441, 514, 32, 12442, 512, 12445, 12441, 521, 12424, 12426,
- 512, 12459, 12441, 512, 12461, 12441, 512, 12463, 12441, 512, 12465,
- 12441, 512, 12467, 12441, 512, 12469, 12441, 512, 12471, 12441, 512,
- 12473, 12441, 512, 12475, 12441, 512, 12477, 12441, 512, 12479, 12441,
- 512, 12481, 12441, 512, 12484, 12441, 512, 12486, 12441, 512, 12488,
- 12441, 512, 12495, 12441, 512, 12495, 12442, 512, 12498, 12441, 512,
- 12498, 12442, 512, 12501, 12441, 512, 12501, 12442, 512, 12504, 12441,
- 512, 12504, 12442, 512, 12507, 12441, 512, 12507, 12442, 512, 12454,
- 12441, 512, 12527, 12441, 512, 12528, 12441, 512, 12529, 12441, 512,
- 12530, 12441, 512, 12541, 12441, 521, 12467, 12488, 258, 4352, 258, 4353,
- 258, 4522, 258, 4354, 258, 4524, 258, 4525, 258, 4355, 258, 4356, 258,
- 4357, 258, 4528, 258, 4529, 258, 4530, 258, 4531, 258, 4532, 258, 4533,
- 258, 4378, 258, 4358, 258, 4359, 258, 4360, 258, 4385, 258, 4361, 258,
- 4362, 258, 4363, 258, 4364, 258, 4365, 258, 4366, 258, 4367, 258, 4368,
- 258, 4369, 258, 4370, 258, 4449, 258, 4450, 258, 4451, 258, 4452, 258,
- 4453, 258, 4454, 258, 4455, 258, 4456, 258, 4457, 258, 4458, 258, 4459,
- 258, 4460, 258, 4461, 258, 4462, 258, 4463, 258, 4464, 258, 4465, 258,
- 4466, 258, 4467, 258, 4468, 258, 4469, 258, 4448, 258, 4372, 258, 4373,
- 258, 4551, 258, 4552, 258, 4556, 258, 4558, 258, 4563, 258, 4567, 258,
- 4569, 258, 4380, 258, 4573, 258, 4575, 258, 4381, 258, 4382, 258, 4384,
- 258, 4386, 258, 4387, 258, 4391, 258, 4393, 258, 4395, 258, 4396, 258,
- 4397, 258, 4398, 258, 4399, 258, 4402, 258, 4406, 258, 4416, 258, 4423,
- 258, 4428, 258, 4593, 258, 4594, 258, 4439, 258, 4440, 258, 4441, 258,
- 4484, 258, 4485, 258, 4488, 258, 4497, 258, 4498, 258, 4500, 258, 4510,
- 258, 4513, 259, 19968, 259, 20108, 259, 19977, 259, 22235, 259, 19978,
- 259, 20013, 259, 19979, 259, 30002, 259, 20057, 259, 19993, 259, 19969,
- 259, 22825, 259, 22320, 259, 20154, 770, 40, 4352, 41, 770, 40, 4354, 41,
- 770, 40, 4355, 41, 770, 40, 4357, 41, 770, 40, 4358, 41, 770, 40, 4359,
- 41, 770, 40, 4361, 41, 770, 40, 4363, 41, 770, 40, 4364, 41, 770, 40,
- 4366, 41, 770, 40, 4367, 41, 770, 40, 4368, 41, 770, 40, 4369, 41, 770,
- 40, 4370, 41, 1026, 40, 4352, 4449, 41, 1026, 40, 4354, 4449, 41, 1026,
- 40, 4355, 4449, 41, 1026, 40, 4357, 4449, 41, 1026, 40, 4358, 4449, 41,
- 1026, 40, 4359, 4449, 41, 1026, 40, 4361, 4449, 41, 1026, 40, 4363, 4449,
- 41, 1026, 40, 4364, 4449, 41, 1026, 40, 4366, 4449, 41, 1026, 40, 4367,
- 4449, 41, 1026, 40, 4368, 4449, 41, 1026, 40, 4369, 4449, 41, 1026, 40,
- 4370, 4449, 41, 1026, 40, 4364, 4462, 41, 1794, 40, 4363, 4457, 4364,
- 4453, 4523, 41, 1538, 40, 4363, 4457, 4370, 4462, 41, 770, 40, 19968, 41,
- 770, 40, 20108, 41, 770, 40, 19977, 41, 770, 40, 22235, 41, 770, 40,
- 20116, 41, 770, 40, 20845, 41, 770, 40, 19971, 41, 770, 40, 20843, 41,
- 770, 40, 20061, 41, 770, 40, 21313, 41, 770, 40, 26376, 41, 770, 40,
- 28779, 41, 770, 40, 27700, 41, 770, 40, 26408, 41, 770, 40, 37329, 41,
- 770, 40, 22303, 41, 770, 40, 26085, 41, 770, 40, 26666, 41, 770, 40,
- 26377, 41, 770, 40, 31038, 41, 770, 40, 21517, 41, 770, 40, 29305, 41,
- 770, 40, 36001, 41, 770, 40, 31069, 41, 770, 40, 21172, 41, 770, 40,
- 20195, 41, 770, 40, 21628, 41, 770, 40, 23398, 41, 770, 40, 30435, 41,
- 770, 40, 20225, 41, 770, 40, 36039, 41, 770, 40, 21332, 41, 770, 40,
- 31085, 41, 770, 40, 20241, 41, 770, 40, 33258, 41, 770, 40, 33267, 41,
- 778, 80, 84, 69, 519, 50, 49, 519, 50, 50, 519, 50, 51, 519, 50, 52, 519,
- 50, 53, 519, 50, 54, 519, 50, 55, 519, 50, 56, 519, 50, 57, 519, 51, 48,
- 519, 51, 49, 519, 51, 50, 519, 51, 51, 519, 51, 52, 519, 51, 53, 263,
- 4352, 263, 4354, 263, 4355, 263, 4357, 263, 4358, 263, 4359, 263, 4361,
- 263, 4363, 263, 4364, 263, 4366, 263, 4367, 263, 4368, 263, 4369, 263,
- 4370, 519, 4352, 4449, 519, 4354, 4449, 519, 4355, 4449, 519, 4357, 4449,
- 519, 4358, 4449, 519, 4359, 4449, 519, 4361, 4449, 519, 4363, 4449, 519,
- 4364, 4449, 519, 4366, 4449, 519, 4367, 4449, 519, 4368, 4449, 519, 4369,
- 4449, 519, 4370, 4449, 1287, 4366, 4449, 4535, 4352, 4457, 1031, 4364,
- 4462, 4363, 4468, 519, 4363, 4462, 263, 19968, 263, 20108, 263, 19977,
- 263, 22235, 263, 20116, 263, 20845, 263, 19971, 263, 20843, 263, 20061,
- 263, 21313, 263, 26376, 263, 28779, 263, 27700, 263, 26408, 263, 37329,
- 263, 22303, 263, 26085, 263, 26666, 263, 26377, 263, 31038, 263, 21517,
- 263, 29305, 263, 36001, 263, 31069, 263, 21172, 263, 31192, 263, 30007,
- 263, 22899, 263, 36969, 263, 20778, 263, 21360, 263, 27880, 263, 38917,
- 263, 20241, 263, 20889, 263, 27491, 263, 19978, 263, 20013, 263, 19979,
- 263, 24038, 263, 21491, 263, 21307, 263, 23447, 263, 23398, 263, 30435,
- 263, 20225, 263, 36039, 263, 21332, 263, 22812, 519, 51, 54, 519, 51, 55,
- 519, 51, 56, 519, 51, 57, 519, 52, 48, 519, 52, 49, 519, 52, 50, 519, 52,
- 51, 519, 52, 52, 519, 52, 53, 519, 52, 54, 519, 52, 55, 519, 52, 56, 519,
- 52, 57, 519, 53, 48, 514, 49, 26376, 514, 50, 26376, 514, 51, 26376, 514,
- 52, 26376, 514, 53, 26376, 514, 54, 26376, 514, 55, 26376, 514, 56,
- 26376, 514, 57, 26376, 770, 49, 48, 26376, 770, 49, 49, 26376, 770, 49,
- 50, 26376, 522, 72, 103, 778, 101, 114, 103, 522, 101, 86, 778, 76, 84,
- 68, 263, 12450, 263, 12452, 263, 12454, 263, 12456, 263, 12458, 263,
- 12459, 263, 12461, 263, 12463, 263, 12465, 263, 12467, 263, 12469, 263,
- 12471, 263, 12473, 263, 12475, 263, 12477, 263, 12479, 263, 12481, 263,
- 12484, 263, 12486, 263, 12488, 263, 12490, 263, 12491, 263, 12492, 263,
- 12493, 263, 12494, 263, 12495, 263, 12498, 263, 12501, 263, 12504, 263,
- 12507, 263, 12510, 263, 12511, 263, 12512, 263, 12513, 263, 12514, 263,
- 12516, 263, 12518, 263, 12520, 263, 12521, 263, 12522, 263, 12523, 263,
- 12524, 263, 12525, 263, 12527, 263, 12528, 263, 12529, 263, 12530, 1034,
- 12450, 12497, 12540, 12488, 1034, 12450, 12523, 12501, 12449, 1034,
+ 100, 258, 109, 772, 48, 8260, 51, 512, 8592, 824, 512, 8594, 824, 512,
+ 8596, 824, 512, 8656, 824, 512, 8660, 824, 512, 8658, 824, 512, 8707,
+ 824, 512, 8712, 824, 512, 8715, 824, 512, 8739, 824, 512, 8741, 824, 514,
+ 8747, 8747, 770, 8747, 8747, 8747, 514, 8750, 8750, 770, 8750, 8750,
+ 8750, 512, 8764, 824, 512, 8771, 824, 512, 8773, 824, 512, 8776, 824,
+ 512, 61, 824, 512, 8801, 824, 512, 8781, 824, 512, 60, 824, 512, 62, 824,
+ 512, 8804, 824, 512, 8805, 824, 512, 8818, 824, 512, 8819, 824, 512,
+ 8822, 824, 512, 8823, 824, 512, 8826, 824, 512, 8827, 824, 512, 8834,
+ 824, 512, 8835, 824, 512, 8838, 824, 512, 8839, 824, 512, 8866, 824, 512,
+ 8872, 824, 512, 8873, 824, 512, 8875, 824, 512, 8828, 824, 512, 8829,
+ 824, 512, 8849, 824, 512, 8850, 824, 512, 8882, 824, 512, 8883, 824, 512,
+ 8884, 824, 512, 8885, 824, 256, 12296, 256, 12297, 263, 49, 263, 50, 263,
+ 51, 263, 52, 263, 53, 263, 54, 263, 55, 263, 56, 263, 57, 519, 49, 48,
+ 519, 49, 49, 519, 49, 50, 519, 49, 51, 519, 49, 52, 519, 49, 53, 519, 49,
+ 54, 519, 49, 55, 519, 49, 56, 519, 49, 57, 519, 50, 48, 770, 40, 49, 41,
+ 770, 40, 50, 41, 770, 40, 51, 41, 770, 40, 52, 41, 770, 40, 53, 41, 770,
+ 40, 54, 41, 770, 40, 55, 41, 770, 40, 56, 41, 770, 40, 57, 41, 1026, 40,
+ 49, 48, 41, 1026, 40, 49, 49, 41, 1026, 40, 49, 50, 41, 1026, 40, 49, 51,
+ 41, 1026, 40, 49, 52, 41, 1026, 40, 49, 53, 41, 1026, 40, 49, 54, 41,
+ 1026, 40, 49, 55, 41, 1026, 40, 49, 56, 41, 1026, 40, 49, 57, 41, 1026,
+ 40, 50, 48, 41, 514, 49, 46, 514, 50, 46, 514, 51, 46, 514, 52, 46, 514,
+ 53, 46, 514, 54, 46, 514, 55, 46, 514, 56, 46, 514, 57, 46, 770, 49, 48,
+ 46, 770, 49, 49, 46, 770, 49, 50, 46, 770, 49, 51, 46, 770, 49, 52, 46,
+ 770, 49, 53, 46, 770, 49, 54, 46, 770, 49, 55, 46, 770, 49, 56, 46, 770,
+ 49, 57, 46, 770, 50, 48, 46, 770, 40, 97, 41, 770, 40, 98, 41, 770, 40,
+ 99, 41, 770, 40, 100, 41, 770, 40, 101, 41, 770, 40, 102, 41, 770, 40,
+ 103, 41, 770, 40, 104, 41, 770, 40, 105, 41, 770, 40, 106, 41, 770, 40,
+ 107, 41, 770, 40, 108, 41, 770, 40, 109, 41, 770, 40, 110, 41, 770, 40,
+ 111, 41, 770, 40, 112, 41, 770, 40, 113, 41, 770, 40, 114, 41, 770, 40,
+ 115, 41, 770, 40, 116, 41, 770, 40, 117, 41, 770, 40, 118, 41, 770, 40,
+ 119, 41, 770, 40, 120, 41, 770, 40, 121, 41, 770, 40, 122, 41, 263, 65,
+ 263, 66, 263, 67, 263, 68, 263, 69, 263, 70, 263, 71, 263, 72, 263, 73,
+ 263, 74, 263, 75, 263, 76, 263, 77, 263, 78, 263, 79, 263, 80, 263, 81,
+ 263, 82, 263, 83, 263, 84, 263, 85, 263, 86, 263, 87, 263, 88, 263, 89,
+ 263, 90, 263, 97, 263, 98, 263, 99, 263, 100, 263, 101, 263, 102, 263,
+ 103, 263, 104, 263, 105, 263, 106, 263, 107, 263, 108, 263, 109, 263,
+ 110, 263, 111, 263, 112, 263, 113, 263, 114, 263, 115, 263, 116, 263,
+ 117, 263, 118, 263, 119, 263, 120, 263, 121, 263, 122, 263, 48, 1026,
+ 8747, 8747, 8747, 8747, 770, 58, 58, 61, 514, 61, 61, 770, 61, 61, 61,
+ 512, 10973, 824, 261, 106, 259, 86, 259, 11617, 258, 27597, 258, 40863,
+ 258, 19968, 258, 20008, 258, 20022, 258, 20031, 258, 20057, 258, 20101,
+ 258, 20108, 258, 20128, 258, 20154, 258, 20799, 258, 20837, 258, 20843,
+ 258, 20866, 258, 20886, 258, 20907, 258, 20960, 258, 20981, 258, 20992,
+ 258, 21147, 258, 21241, 258, 21269, 258, 21274, 258, 21304, 258, 21313,
+ 258, 21340, 258, 21353, 258, 21378, 258, 21430, 258, 21448, 258, 21475,
+ 258, 22231, 258, 22303, 258, 22763, 258, 22786, 258, 22794, 258, 22805,
+ 258, 22823, 258, 22899, 258, 23376, 258, 23424, 258, 23544, 258, 23567,
+ 258, 23586, 258, 23608, 258, 23662, 258, 23665, 258, 24027, 258, 24037,
+ 258, 24049, 258, 24062, 258, 24178, 258, 24186, 258, 24191, 258, 24308,
+ 258, 24318, 258, 24331, 258, 24339, 258, 24400, 258, 24417, 258, 24435,
+ 258, 24515, 258, 25096, 258, 25142, 258, 25163, 258, 25903, 258, 25908,
+ 258, 25991, 258, 26007, 258, 26020, 258, 26041, 258, 26080, 258, 26085,
+ 258, 26352, 258, 26376, 258, 26408, 258, 27424, 258, 27490, 258, 27513,
+ 258, 27571, 258, 27595, 258, 27604, 258, 27611, 258, 27663, 258, 27668,
+ 258, 27700, 258, 28779, 258, 29226, 258, 29238, 258, 29243, 258, 29247,
+ 258, 29255, 258, 29273, 258, 29275, 258, 29356, 258, 29572, 258, 29577,
+ 258, 29916, 258, 29926, 258, 29976, 258, 29983, 258, 29992, 258, 30000,
+ 258, 30091, 258, 30098, 258, 30326, 258, 30333, 258, 30382, 258, 30399,
+ 258, 30446, 258, 30683, 258, 30690, 258, 30707, 258, 31034, 258, 31160,
+ 258, 31166, 258, 31348, 258, 31435, 258, 31481, 258, 31859, 258, 31992,
+ 258, 32566, 258, 32593, 258, 32650, 258, 32701, 258, 32769, 258, 32780,
+ 258, 32786, 258, 32819, 258, 32895, 258, 32905, 258, 33251, 258, 33258,
+ 258, 33267, 258, 33276, 258, 33292, 258, 33307, 258, 33311, 258, 33390,
+ 258, 33394, 258, 33400, 258, 34381, 258, 34411, 258, 34880, 258, 34892,
+ 258, 34915, 258, 35198, 258, 35211, 258, 35282, 258, 35328, 258, 35895,
+ 258, 35910, 258, 35925, 258, 35960, 258, 35997, 258, 36196, 258, 36208,
+ 258, 36275, 258, 36523, 258, 36554, 258, 36763, 258, 36784, 258, 36789,
+ 258, 37009, 258, 37193, 258, 37318, 258, 37324, 258, 37329, 258, 38263,
+ 258, 38272, 258, 38428, 258, 38582, 258, 38585, 258, 38632, 258, 38737,
+ 258, 38750, 258, 38754, 258, 38761, 258, 38859, 258, 38893, 258, 38899,
+ 258, 38913, 258, 39080, 258, 39131, 258, 39135, 258, 39318, 258, 39321,
+ 258, 39340, 258, 39592, 258, 39640, 258, 39647, 258, 39717, 258, 39727,
+ 258, 39730, 258, 39740, 258, 39770, 258, 40165, 258, 40565, 258, 40575,
+ 258, 40613, 258, 40635, 258, 40643, 258, 40653, 258, 40657, 258, 40697,
+ 258, 40701, 258, 40718, 258, 40723, 258, 40736, 258, 40763, 258, 40778,
+ 258, 40786, 258, 40845, 258, 40860, 258, 40864, 264, 32, 258, 12306, 258,
+ 21313, 258, 21316, 258, 21317, 512, 12363, 12441, 512, 12365, 12441, 512,
+ 12367, 12441, 512, 12369, 12441, 512, 12371, 12441, 512, 12373, 12441,
+ 512, 12375, 12441, 512, 12377, 12441, 512, 12379, 12441, 512, 12381,
+ 12441, 512, 12383, 12441, 512, 12385, 12441, 512, 12388, 12441, 512,
+ 12390, 12441, 512, 12392, 12441, 512, 12399, 12441, 512, 12399, 12442,
+ 512, 12402, 12441, 512, 12402, 12442, 512, 12405, 12441, 512, 12405,
+ 12442, 512, 12408, 12441, 512, 12408, 12442, 512, 12411, 12441, 512,
+ 12411, 12442, 512, 12358, 12441, 514, 32, 12441, 514, 32, 12442, 512,
+ 12445, 12441, 521, 12424, 12426, 512, 12459, 12441, 512, 12461, 12441,
+ 512, 12463, 12441, 512, 12465, 12441, 512, 12467, 12441, 512, 12469,
+ 12441, 512, 12471, 12441, 512, 12473, 12441, 512, 12475, 12441, 512,
+ 12477, 12441, 512, 12479, 12441, 512, 12481, 12441, 512, 12484, 12441,
+ 512, 12486, 12441, 512, 12488, 12441, 512, 12495, 12441, 512, 12495,
+ 12442, 512, 12498, 12441, 512, 12498, 12442, 512, 12501, 12441, 512,
+ 12501, 12442, 512, 12504, 12441, 512, 12504, 12442, 512, 12507, 12441,
+ 512, 12507, 12442, 512, 12454, 12441, 512, 12527, 12441, 512, 12528,
+ 12441, 512, 12529, 12441, 512, 12530, 12441, 512, 12541, 12441, 521,
+ 12467, 12488, 258, 4352, 258, 4353, 258, 4522, 258, 4354, 258, 4524, 258,
+ 4525, 258, 4355, 258, 4356, 258, 4357, 258, 4528, 258, 4529, 258, 4530,
+ 258, 4531, 258, 4532, 258, 4533, 258, 4378, 258, 4358, 258, 4359, 258,
+ 4360, 258, 4385, 258, 4361, 258, 4362, 258, 4363, 258, 4364, 258, 4365,
+ 258, 4366, 258, 4367, 258, 4368, 258, 4369, 258, 4370, 258, 4449, 258,
+ 4450, 258, 4451, 258, 4452, 258, 4453, 258, 4454, 258, 4455, 258, 4456,
+ 258, 4457, 258, 4458, 258, 4459, 258, 4460, 258, 4461, 258, 4462, 258,
+ 4463, 258, 4464, 258, 4465, 258, 4466, 258, 4467, 258, 4468, 258, 4469,
+ 258, 4448, 258, 4372, 258, 4373, 258, 4551, 258, 4552, 258, 4556, 258,
+ 4558, 258, 4563, 258, 4567, 258, 4569, 258, 4380, 258, 4573, 258, 4575,
+ 258, 4381, 258, 4382, 258, 4384, 258, 4386, 258, 4387, 258, 4391, 258,
+ 4393, 258, 4395, 258, 4396, 258, 4397, 258, 4398, 258, 4399, 258, 4402,
+ 258, 4406, 258, 4416, 258, 4423, 258, 4428, 258, 4593, 258, 4594, 258,
+ 4439, 258, 4440, 258, 4441, 258, 4484, 258, 4485, 258, 4488, 258, 4497,
+ 258, 4498, 258, 4500, 258, 4510, 258, 4513, 259, 19968, 259, 20108, 259,
+ 19977, 259, 22235, 259, 19978, 259, 20013, 259, 19979, 259, 30002, 259,
+ 20057, 259, 19993, 259, 19969, 259, 22825, 259, 22320, 259, 20154, 770,
+ 40, 4352, 41, 770, 40, 4354, 41, 770, 40, 4355, 41, 770, 40, 4357, 41,
+ 770, 40, 4358, 41, 770, 40, 4359, 41, 770, 40, 4361, 41, 770, 40, 4363,
+ 41, 770, 40, 4364, 41, 770, 40, 4366, 41, 770, 40, 4367, 41, 770, 40,
+ 4368, 41, 770, 40, 4369, 41, 770, 40, 4370, 41, 1026, 40, 4352, 4449, 41,
+ 1026, 40, 4354, 4449, 41, 1026, 40, 4355, 4449, 41, 1026, 40, 4357, 4449,
+ 41, 1026, 40, 4358, 4449, 41, 1026, 40, 4359, 4449, 41, 1026, 40, 4361,
+ 4449, 41, 1026, 40, 4363, 4449, 41, 1026, 40, 4364, 4449, 41, 1026, 40,
+ 4366, 4449, 41, 1026, 40, 4367, 4449, 41, 1026, 40, 4368, 4449, 41, 1026,
+ 40, 4369, 4449, 41, 1026, 40, 4370, 4449, 41, 1026, 40, 4364, 4462, 41,
+ 1794, 40, 4363, 4457, 4364, 4453, 4523, 41, 1538, 40, 4363, 4457, 4370,
+ 4462, 41, 770, 40, 19968, 41, 770, 40, 20108, 41, 770, 40, 19977, 41,
+ 770, 40, 22235, 41, 770, 40, 20116, 41, 770, 40, 20845, 41, 770, 40,
+ 19971, 41, 770, 40, 20843, 41, 770, 40, 20061, 41, 770, 40, 21313, 41,
+ 770, 40, 26376, 41, 770, 40, 28779, 41, 770, 40, 27700, 41, 770, 40,
+ 26408, 41, 770, 40, 37329, 41, 770, 40, 22303, 41, 770, 40, 26085, 41,
+ 770, 40, 26666, 41, 770, 40, 26377, 41, 770, 40, 31038, 41, 770, 40,
+ 21517, 41, 770, 40, 29305, 41, 770, 40, 36001, 41, 770, 40, 31069, 41,
+ 770, 40, 21172, 41, 770, 40, 20195, 41, 770, 40, 21628, 41, 770, 40,
+ 23398, 41, 770, 40, 30435, 41, 770, 40, 20225, 41, 770, 40, 36039, 41,
+ 770, 40, 21332, 41, 770, 40, 31085, 41, 770, 40, 20241, 41, 770, 40,
+ 33258, 41, 770, 40, 33267, 41, 263, 21839, 263, 24188, 263, 25991, 263,
+ 31631, 778, 80, 84, 69, 519, 50, 49, 519, 50, 50, 519, 50, 51, 519, 50,
+ 52, 519, 50, 53, 519, 50, 54, 519, 50, 55, 519, 50, 56, 519, 50, 57, 519,
+ 51, 48, 519, 51, 49, 519, 51, 50, 519, 51, 51, 519, 51, 52, 519, 51, 53,
+ 263, 4352, 263, 4354, 263, 4355, 263, 4357, 263, 4358, 263, 4359, 263,
+ 4361, 263, 4363, 263, 4364, 263, 4366, 263, 4367, 263, 4368, 263, 4369,
+ 263, 4370, 519, 4352, 4449, 519, 4354, 4449, 519, 4355, 4449, 519, 4357,
+ 4449, 519, 4358, 4449, 519, 4359, 4449, 519, 4361, 4449, 519, 4363, 4449,
+ 519, 4364, 4449, 519, 4366, 4449, 519, 4367, 4449, 519, 4368, 4449, 519,
+ 4369, 4449, 519, 4370, 4449, 1287, 4366, 4449, 4535, 4352, 4457, 1031,
+ 4364, 4462, 4363, 4468, 519, 4363, 4462, 263, 19968, 263, 20108, 263,
+ 19977, 263, 22235, 263, 20116, 263, 20845, 263, 19971, 263, 20843, 263,
+ 20061, 263, 21313, 263, 26376, 263, 28779, 263, 27700, 263, 26408, 263,
+ 37329, 263, 22303, 263, 26085, 263, 26666, 263, 26377, 263, 31038, 263,
+ 21517, 263, 29305, 263, 36001, 263, 31069, 263, 21172, 263, 31192, 263,
+ 30007, 263, 22899, 263, 36969, 263, 20778, 263, 21360, 263, 27880, 263,
+ 38917, 263, 20241, 263, 20889, 263, 27491, 263, 19978, 263, 20013, 263,
+ 19979, 263, 24038, 263, 21491, 263, 21307, 263, 23447, 263, 23398, 263,
+ 30435, 263, 20225, 263, 36039, 263, 21332, 263, 22812, 519, 51, 54, 519,
+ 51, 55, 519, 51, 56, 519, 51, 57, 519, 52, 48, 519, 52, 49, 519, 52, 50,
+ 519, 52, 51, 519, 52, 52, 519, 52, 53, 519, 52, 54, 519, 52, 55, 519, 52,
+ 56, 519, 52, 57, 519, 53, 48, 514, 49, 26376, 514, 50, 26376, 514, 51,
+ 26376, 514, 52, 26376, 514, 53, 26376, 514, 54, 26376, 514, 55, 26376,
+ 514, 56, 26376, 514, 57, 26376, 770, 49, 48, 26376, 770, 49, 49, 26376,
+ 770, 49, 50, 26376, 522, 72, 103, 778, 101, 114, 103, 522, 101, 86, 778,
+ 76, 84, 68, 263, 12450, 263, 12452, 263, 12454, 263, 12456, 263, 12458,
+ 263, 12459, 263, 12461, 263, 12463, 263, 12465, 263, 12467, 263, 12469,
+ 263, 12471, 263, 12473, 263, 12475, 263, 12477, 263, 12479, 263, 12481,
+ 263, 12484, 263, 12486, 263, 12488, 263, 12490, 263, 12491, 263, 12492,
+ 263, 12493, 263, 12494, 263, 12495, 263, 12498, 263, 12501, 263, 12504,
+ 263, 12507, 263, 12510, 263, 12511, 263, 12512, 263, 12513, 263, 12514,
+ 263, 12516, 263, 12518, 263, 12520, 263, 12521, 263, 12522, 263, 12523,
+ 263, 12524, 263, 12525, 263, 12527, 263, 12528, 263, 12529, 263, 12530,
+ 1034, 12450, 12497, 12540, 12488, 1034, 12450, 12523, 12501, 12449, 1034,
12450, 12531, 12506, 12450, 778, 12450, 12540, 12523, 1034, 12452, 12491,
12531, 12464, 778, 12452, 12531, 12481, 778, 12454, 12457, 12531, 1290,
12456, 12473, 12463, 12540, 12489, 1034, 12456, 12540, 12459, 12540, 778,
@@ -2896,293 +3130,263 @@ static unsigned int decomp_data[] = {
256, 31361, 256, 31680, 256, 32244, 256, 32265, 256, 32321, 256, 32626,
256, 32773, 256, 33261, 256, 33401, 256, 33401, 256, 33879, 256, 35088,
256, 35222, 256, 35585, 256, 35641, 256, 36051, 256, 36104, 256, 36790,
- 256, 36920, 256, 38627, 256, 38911, 256, 38971, 256, 20006, 256, 20917,
- 256, 20840, 256, 20352, 256, 20805, 256, 20864, 256, 21191, 256, 21242,
- 256, 21917, 256, 21845, 256, 21913, 256, 21986, 256, 22618, 256, 22707,
- 256, 22852, 256, 22868, 256, 23138, 256, 23336, 256, 24274, 256, 24281,
- 256, 24425, 256, 24493, 256, 24792, 256, 24910, 256, 24840, 256, 24974,
- 256, 24928, 256, 25074, 256, 25140, 256, 25540, 256, 25628, 256, 25682,
- 256, 25942, 256, 26228, 256, 26391, 256, 26395, 256, 26454, 256, 27513,
- 256, 27578, 256, 27969, 256, 28379, 256, 28363, 256, 28450, 256, 28702,
- 256, 29038, 256, 30631, 256, 29237, 256, 29359, 256, 29482, 256, 29809,
- 256, 29958, 256, 30011, 256, 30237, 256, 30239, 256, 30410, 256, 30427,
- 256, 30452, 256, 30538, 256, 30528, 256, 30924, 256, 31409, 256, 31680,
- 256, 31867, 256, 32091, 256, 32244, 256, 32574, 256, 32773, 256, 33618,
- 256, 33775, 256, 34681, 256, 35137, 256, 35206, 256, 35222, 256, 35519,
- 256, 35576, 256, 35531, 256, 35585, 256, 35582, 256, 35565, 256, 35641,
- 256, 35722, 256, 36104, 256, 36664, 256, 36978, 256, 37273, 256, 37494,
- 256, 38524, 256, 38627, 256, 38742, 256, 38875, 256, 38911, 256, 38923,
- 256, 38971, 256, 39698, 256, 40860, 256, 141386, 256, 141380, 256,
- 144341, 256, 15261, 256, 16408, 256, 16441, 256, 152137, 256, 154832,
- 256, 163539, 256, 40771, 256, 40846, 514, 102, 102, 514, 102, 105, 514,
- 102, 108, 770, 102, 102, 105, 770, 102, 102, 108, 514, 383, 116, 514,
- 115, 116, 514, 1396, 1398, 514, 1396, 1381, 514, 1396, 1387, 514, 1406,
- 1398, 514, 1396, 1389, 512, 1497, 1460, 512, 1522, 1463, 262, 1506, 262,
- 1488, 262, 1491, 262, 1492, 262, 1499, 262, 1500, 262, 1501, 262, 1512,
- 262, 1514, 262, 43, 512, 1513, 1473, 512, 1513, 1474, 512, 64329, 1473,
- 512, 64329, 1474, 512, 1488, 1463, 512, 1488, 1464, 512, 1488, 1468, 512,
- 1489, 1468, 512, 1490, 1468, 512, 1491, 1468, 512, 1492, 1468, 512, 1493,
- 1468, 512, 1494, 1468, 512, 1496, 1468, 512, 1497, 1468, 512, 1498, 1468,
- 512, 1499, 1468, 512, 1500, 1468, 512, 1502, 1468, 512, 1504, 1468, 512,
- 1505, 1468, 512, 1507, 1468, 512, 1508, 1468, 512, 1510, 1468, 512, 1511,
- 1468, 512, 1512, 1468, 512, 1513, 1468, 512, 1514, 1468, 512, 1493, 1465,
- 512, 1489, 1471, 512, 1499, 1471, 512, 1508, 1471, 514, 1488, 1500, 267,
- 1649, 268, 1649, 267, 1659, 268, 1659, 269, 1659, 270, 1659, 267, 1662,
- 268, 1662, 269, 1662, 270, 1662, 267, 1664, 268, 1664, 269, 1664, 270,
- 1664, 267, 1658, 268, 1658, 269, 1658, 270, 1658, 267, 1663, 268, 1663,
- 269, 1663, 270, 1663, 267, 1657, 268, 1657, 269, 1657, 270, 1657, 267,
- 1700, 268, 1700, 269, 1700, 270, 1700, 267, 1702, 268, 1702, 269, 1702,
- 270, 1702, 267, 1668, 268, 1668, 269, 1668, 270, 1668, 267, 1667, 268,
- 1667, 269, 1667, 270, 1667, 267, 1670, 268, 1670, 269, 1670, 270, 1670,
- 267, 1671, 268, 1671, 269, 1671, 270, 1671, 267, 1677, 268, 1677, 267,
- 1676, 268, 1676, 267, 1678, 268, 1678, 267, 1672, 268, 1672, 267, 1688,
- 268, 1688, 267, 1681, 268, 1681, 267, 1705, 268, 1705, 269, 1705, 270,
- 1705, 267, 1711, 268, 1711, 269, 1711, 270, 1711, 267, 1715, 268, 1715,
- 269, 1715, 270, 1715, 267, 1713, 268, 1713, 269, 1713, 270, 1713, 267,
- 1722, 268, 1722, 267, 1723, 268, 1723, 269, 1723, 270, 1723, 267, 1728,
- 268, 1728, 267, 1729, 268, 1729, 269, 1729, 270, 1729, 267, 1726, 268,
- 1726, 269, 1726, 270, 1726, 267, 1746, 268, 1746, 267, 1747, 268, 1747,
- 267, 1709, 268, 1709, 269, 1709, 270, 1709, 267, 1735, 268, 1735, 267,
- 1734, 268, 1734, 267, 1736, 268, 1736, 267, 1655, 267, 1739, 268, 1739,
- 267, 1733, 268, 1733, 267, 1737, 268, 1737, 267, 1744, 268, 1744, 269,
- 1744, 270, 1744, 269, 1609, 270, 1609, 523, 1574, 1575, 524, 1574, 1575,
- 523, 1574, 1749, 524, 1574, 1749, 523, 1574, 1608, 524, 1574, 1608, 523,
- 1574, 1735, 524, 1574, 1735, 523, 1574, 1734, 524, 1574, 1734, 523, 1574,
- 1736, 524, 1574, 1736, 523, 1574, 1744, 524, 1574, 1744, 525, 1574, 1744,
- 523, 1574, 1609, 524, 1574, 1609, 525, 1574, 1609, 267, 1740, 268, 1740,
- 269, 1740, 270, 1740, 523, 1574, 1580, 523, 1574, 1581, 523, 1574, 1605,
- 523, 1574, 1609, 523, 1574, 1610, 523, 1576, 1580, 523, 1576, 1581, 523,
- 1576, 1582, 523, 1576, 1605, 523, 1576, 1609, 523, 1576, 1610, 523, 1578,
- 1580, 523, 1578, 1581, 523, 1578, 1582, 523, 1578, 1605, 523, 1578, 1609,
- 523, 1578, 1610, 523, 1579, 1580, 523, 1579, 1605, 523, 1579, 1609, 523,
- 1579, 1610, 523, 1580, 1581, 523, 1580, 1605, 523, 1581, 1580, 523, 1581,
- 1605, 523, 1582, 1580, 523, 1582, 1581, 523, 1582, 1605, 523, 1587, 1580,
- 523, 1587, 1581, 523, 1587, 1582, 523, 1587, 1605, 523, 1589, 1581, 523,
- 1589, 1605, 523, 1590, 1580, 523, 1590, 1581, 523, 1590, 1582, 523, 1590,
- 1605, 523, 1591, 1581, 523, 1591, 1605, 523, 1592, 1605, 523, 1593, 1580,
- 523, 1593, 1605, 523, 1594, 1580, 523, 1594, 1605, 523, 1601, 1580, 523,
- 1601, 1581, 523, 1601, 1582, 523, 1601, 1605, 523, 1601, 1609, 523, 1601,
- 1610, 523, 1602, 1581, 523, 1602, 1605, 523, 1602, 1609, 523, 1602, 1610,
- 523, 1603, 1575, 523, 1603, 1580, 523, 1603, 1581, 523, 1603, 1582, 523,
- 1603, 1604, 523, 1603, 1605, 523, 1603, 1609, 523, 1603, 1610, 523, 1604,
- 1580, 523, 1604, 1581, 523, 1604, 1582, 523, 1604, 1605, 523, 1604, 1609,
- 523, 1604, 1610, 523, 1605, 1580, 523, 1605, 1581, 523, 1605, 1582, 523,
- 1605, 1605, 523, 1605, 1609, 523, 1605, 1610, 523, 1606, 1580, 523, 1606,
- 1581, 523, 1606, 1582, 523, 1606, 1605, 523, 1606, 1609, 523, 1606, 1610,
- 523, 1607, 1580, 523, 1607, 1605, 523, 1607, 1609, 523, 1607, 1610, 523,
- 1610, 1580, 523, 1610, 1581, 523, 1610, 1582, 523, 1610, 1605, 523, 1610,
- 1609, 523, 1610, 1610, 523, 1584, 1648, 523, 1585, 1648, 523, 1609, 1648,
- 779, 32, 1612, 1617, 779, 32, 1613, 1617, 779, 32, 1614, 1617, 779, 32,
- 1615, 1617, 779, 32, 1616, 1617, 779, 32, 1617, 1648, 524, 1574, 1585,
- 524, 1574, 1586, 524, 1574, 1605, 524, 1574, 1606, 524, 1574, 1609, 524,
- 1574, 1610, 524, 1576, 1585, 524, 1576, 1586, 524, 1576, 1605, 524, 1576,
- 1606, 524, 1576, 1609, 524, 1576, 1610, 524, 1578, 1585, 524, 1578, 1586,
- 524, 1578, 1605, 524, 1578, 1606, 524, 1578, 1609, 524, 1578, 1610, 524,
- 1579, 1585, 524, 1579, 1586, 524, 1579, 1605, 524, 1579, 1606, 524, 1579,
- 1609, 524, 1579, 1610, 524, 1601, 1609, 524, 1601, 1610, 524, 1602, 1609,
- 524, 1602, 1610, 524, 1603, 1575, 524, 1603, 1604, 524, 1603, 1605, 524,
- 1603, 1609, 524, 1603, 1610, 524, 1604, 1605, 524, 1604, 1609, 524, 1604,
- 1610, 524, 1605, 1575, 524, 1605, 1605, 524, 1606, 1585, 524, 1606, 1586,
- 524, 1606, 1605, 524, 1606, 1606, 524, 1606, 1609, 524, 1606, 1610, 524,
- 1609, 1648, 524, 1610, 1585, 524, 1610, 1586, 524, 1610, 1605, 524, 1610,
- 1606, 524, 1610, 1609, 524, 1610, 1610, 525, 1574, 1580, 525, 1574, 1581,
- 525, 1574, 1582, 525, 1574, 1605, 525, 1574, 1607, 525, 1576, 1580, 525,
- 1576, 1581, 525, 1576, 1582, 525, 1576, 1605, 525, 1576, 1607, 525, 1578,
- 1580, 525, 1578, 1581, 525, 1578, 1582, 525, 1578, 1605, 525, 1578, 1607,
- 525, 1579, 1605, 525, 1580, 1581, 525, 1580, 1605, 525, 1581, 1580, 525,
- 1581, 1605, 525, 1582, 1580, 525, 1582, 1605, 525, 1587, 1580, 525, 1587,
- 1581, 525, 1587, 1582, 525, 1587, 1605, 525, 1589, 1581, 525, 1589, 1582,
- 525, 1589, 1605, 525, 1590, 1580, 525, 1590, 1581, 525, 1590, 1582, 525,
- 1590, 1605, 525, 1591, 1581, 525, 1592, 1605, 525, 1593, 1580, 525, 1593,
- 1605, 525, 1594, 1580, 525, 1594, 1605, 525, 1601, 1580, 525, 1601, 1581,
- 525, 1601, 1582, 525, 1601, 1605, 525, 1602, 1581, 525, 1602, 1605, 525,
- 1603, 1580, 525, 1603, 1581, 525, 1603, 1582, 525, 1603, 1604, 525, 1603,
- 1605, 525, 1604, 1580, 525, 1604, 1581, 525, 1604, 1582, 525, 1604, 1605,
- 525, 1604, 1607, 525, 1605, 1580, 525, 1605, 1581, 525, 1605, 1582, 525,
- 1605, 1605, 525, 1606, 1580, 525, 1606, 1581, 525, 1606, 1582, 525, 1606,
- 1605, 525, 1606, 1607, 525, 1607, 1580, 525, 1607, 1605, 525, 1607, 1648,
- 525, 1610, 1580, 525, 1610, 1581, 525, 1610, 1582, 525, 1610, 1605, 525,
- 1610, 1607, 526, 1574, 1605, 526, 1574, 1607, 526, 1576, 1605, 526, 1576,
- 1607, 526, 1578, 1605, 526, 1578, 1607, 526, 1579, 1605, 526, 1579, 1607,
- 526, 1587, 1605, 526, 1587, 1607, 526, 1588, 1605, 526, 1588, 1607, 526,
- 1603, 1604, 526, 1603, 1605, 526, 1604, 1605, 526, 1606, 1605, 526, 1606,
- 1607, 526, 1610, 1605, 526, 1610, 1607, 782, 1600, 1614, 1617, 782, 1600,
- 1615, 1617, 782, 1600, 1616, 1617, 523, 1591, 1609, 523, 1591, 1610, 523,
- 1593, 1609, 523, 1593, 1610, 523, 1594, 1609, 523, 1594, 1610, 523, 1587,
- 1609, 523, 1587, 1610, 523, 1588, 1609, 523, 1588, 1610, 523, 1581, 1609,
- 523, 1581, 1610, 523, 1580, 1609, 523, 1580, 1610, 523, 1582, 1609, 523,
- 1582, 1610, 523, 1589, 1609, 523, 1589, 1610, 523, 1590, 1609, 523, 1590,
- 1610, 523, 1588, 1580, 523, 1588, 1581, 523, 1588, 1582, 523, 1588, 1605,
- 523, 1588, 1585, 523, 1587, 1585, 523, 1589, 1585, 523, 1590, 1585, 524,
- 1591, 1609, 524, 1591, 1610, 524, 1593, 1609, 524, 1593, 1610, 524, 1594,
- 1609, 524, 1594, 1610, 524, 1587, 1609, 524, 1587, 1610, 524, 1588, 1609,
- 524, 1588, 1610, 524, 1581, 1609, 524, 1581, 1610, 524, 1580, 1609, 524,
- 1580, 1610, 524, 1582, 1609, 524, 1582, 1610, 524, 1589, 1609, 524, 1589,
- 1610, 524, 1590, 1609, 524, 1590, 1610, 524, 1588, 1580, 524, 1588, 1581,
- 524, 1588, 1582, 524, 1588, 1605, 524, 1588, 1585, 524, 1587, 1585, 524,
- 1589, 1585, 524, 1590, 1585, 525, 1588, 1580, 525, 1588, 1581, 525, 1588,
- 1582, 525, 1588, 1605, 525, 1587, 1607, 525, 1588, 1607, 525, 1591, 1605,
- 526, 1587, 1580, 526, 1587, 1581, 526, 1587, 1582, 526, 1588, 1580, 526,
- 1588, 1581, 526, 1588, 1582, 526, 1591, 1605, 526, 1592, 1605, 524, 1575,
- 1611, 523, 1575, 1611, 781, 1578, 1580, 1605, 780, 1578, 1581, 1580, 781,
- 1578, 1581, 1580, 781, 1578, 1581, 1605, 781, 1578, 1582, 1605, 781,
- 1578, 1605, 1580, 781, 1578, 1605, 1581, 781, 1578, 1605, 1582, 780,
- 1580, 1605, 1581, 781, 1580, 1605, 1581, 780, 1581, 1605, 1610, 780,
- 1581, 1605, 1609, 781, 1587, 1581, 1580, 781, 1587, 1580, 1581, 780,
- 1587, 1580, 1609, 780, 1587, 1605, 1581, 781, 1587, 1605, 1581, 781,
- 1587, 1605, 1580, 780, 1587, 1605, 1605, 781, 1587, 1605, 1605, 780,
- 1589, 1581, 1581, 781, 1589, 1581, 1581, 780, 1589, 1605, 1605, 780,
- 1588, 1581, 1605, 781, 1588, 1581, 1605, 780, 1588, 1580, 1610, 780,
- 1588, 1605, 1582, 781, 1588, 1605, 1582, 780, 1588, 1605, 1605, 781,
- 1588, 1605, 1605, 780, 1590, 1581, 1609, 780, 1590, 1582, 1605, 781,
- 1590, 1582, 1605, 780, 1591, 1605, 1581, 781, 1591, 1605, 1581, 781,
- 1591, 1605, 1605, 780, 1591, 1605, 1610, 780, 1593, 1580, 1605, 780,
- 1593, 1605, 1605, 781, 1593, 1605, 1605, 780, 1593, 1605, 1609, 780,
- 1594, 1605, 1605, 780, 1594, 1605, 1610, 780, 1594, 1605, 1609, 780,
- 1601, 1582, 1605, 781, 1601, 1582, 1605, 780, 1602, 1605, 1581, 780,
- 1602, 1605, 1605, 780, 1604, 1581, 1605, 780, 1604, 1581, 1610, 780,
- 1604, 1581, 1609, 781, 1604, 1580, 1580, 780, 1604, 1580, 1580, 780,
- 1604, 1582, 1605, 781, 1604, 1582, 1605, 780, 1604, 1605, 1581, 781,
- 1604, 1605, 1581, 781, 1605, 1581, 1580, 781, 1605, 1581, 1605, 780,
- 1605, 1581, 1610, 781, 1605, 1580, 1581, 781, 1605, 1580, 1605, 781,
- 1605, 1582, 1580, 781, 1605, 1582, 1605, 781, 1605, 1580, 1582, 781,
- 1607, 1605, 1580, 781, 1607, 1605, 1605, 781, 1606, 1581, 1605, 780,
- 1606, 1581, 1609, 780, 1606, 1580, 1605, 781, 1606, 1580, 1605, 780,
- 1606, 1580, 1609, 780, 1606, 1605, 1610, 780, 1606, 1605, 1609, 780,
- 1610, 1605, 1605, 781, 1610, 1605, 1605, 780, 1576, 1582, 1610, 780,
- 1578, 1580, 1610, 780, 1578, 1580, 1609, 780, 1578, 1582, 1610, 780,
- 1578, 1582, 1609, 780, 1578, 1605, 1610, 780, 1578, 1605, 1609, 780,
- 1580, 1605, 1610, 780, 1580, 1581, 1609, 780, 1580, 1605, 1609, 780,
- 1587, 1582, 1609, 780, 1589, 1581, 1610, 780, 1588, 1581, 1610, 780,
- 1590, 1581, 1610, 780, 1604, 1580, 1610, 780, 1604, 1605, 1610, 780,
- 1610, 1581, 1610, 780, 1610, 1580, 1610, 780, 1610, 1605, 1610, 780,
- 1605, 1605, 1610, 780, 1602, 1605, 1610, 780, 1606, 1581, 1610, 781,
- 1602, 1605, 1581, 781, 1604, 1581, 1605, 780, 1593, 1605, 1610, 780,
- 1603, 1605, 1610, 781, 1606, 1580, 1581, 780, 1605, 1582, 1610, 781,
- 1604, 1580, 1605, 780, 1603, 1605, 1605, 780, 1604, 1580, 1605, 780,
- 1606, 1580, 1581, 780, 1580, 1581, 1610, 780, 1581, 1580, 1610, 780,
- 1605, 1580, 1610, 780, 1601, 1605, 1610, 780, 1576, 1581, 1610, 781,
- 1603, 1605, 1605, 781, 1593, 1580, 1605, 781, 1589, 1605, 1605, 780,
- 1587, 1582, 1610, 780, 1606, 1580, 1610, 779, 1589, 1604, 1746, 779,
- 1602, 1604, 1746, 1035, 1575, 1604, 1604, 1607, 1035, 1575, 1603, 1576,
- 1585, 1035, 1605, 1581, 1605, 1583, 1035, 1589, 1604, 1593, 1605, 1035,
- 1585, 1587, 1608, 1604, 1035, 1593, 1604, 1610, 1607, 1035, 1608, 1587,
- 1604, 1605, 779, 1589, 1604, 1609, 4619, 1589, 1604, 1609, 32, 1575,
- 1604, 1604, 1607, 32, 1593, 1604, 1610, 1607, 32, 1608, 1587, 1604, 1605,
- 2059, 1580, 1604, 32, 1580, 1604, 1575, 1604, 1607, 1035, 1585, 1740,
- 1575, 1604, 265, 44, 265, 12289, 265, 12290, 265, 58, 265, 59, 265, 33,
- 265, 63, 265, 12310, 265, 12311, 265, 8230, 265, 8229, 265, 8212, 265,
- 8211, 265, 95, 265, 95, 265, 40, 265, 41, 265, 123, 265, 125, 265, 12308,
- 265, 12309, 265, 12304, 265, 12305, 265, 12298, 265, 12299, 265, 12296,
- 265, 12297, 265, 12300, 265, 12301, 265, 12302, 265, 12303, 265, 91, 265,
- 93, 258, 8254, 258, 8254, 258, 8254, 258, 8254, 258, 95, 258, 95, 258,
- 95, 271, 44, 271, 12289, 271, 46, 271, 59, 271, 58, 271, 63, 271, 33,
- 271, 8212, 271, 40, 271, 41, 271, 123, 271, 125, 271, 12308, 271, 12309,
- 271, 35, 271, 38, 271, 42, 271, 43, 271, 45, 271, 60, 271, 62, 271, 61,
- 271, 92, 271, 36, 271, 37, 271, 64, 523, 32, 1611, 526, 1600, 1611, 523,
- 32, 1612, 523, 32, 1613, 523, 32, 1614, 526, 1600, 1614, 523, 32, 1615,
- 526, 1600, 1615, 523, 32, 1616, 526, 1600, 1616, 523, 32, 1617, 526,
- 1600, 1617, 523, 32, 1618, 526, 1600, 1618, 267, 1569, 267, 1570, 268,
- 1570, 267, 1571, 268, 1571, 267, 1572, 268, 1572, 267, 1573, 268, 1573,
- 267, 1574, 268, 1574, 269, 1574, 270, 1574, 267, 1575, 268, 1575, 267,
- 1576, 268, 1576, 269, 1576, 270, 1576, 267, 1577, 268, 1577, 267, 1578,
- 268, 1578, 269, 1578, 270, 1578, 267, 1579, 268, 1579, 269, 1579, 270,
- 1579, 267, 1580, 268, 1580, 269, 1580, 270, 1580, 267, 1581, 268, 1581,
- 269, 1581, 270, 1581, 267, 1582, 268, 1582, 269, 1582, 270, 1582, 267,
- 1583, 268, 1583, 267, 1584, 268, 1584, 267, 1585, 268, 1585, 267, 1586,
- 268, 1586, 267, 1587, 268, 1587, 269, 1587, 270, 1587, 267, 1588, 268,
- 1588, 269, 1588, 270, 1588, 267, 1589, 268, 1589, 269, 1589, 270, 1589,
- 267, 1590, 268, 1590, 269, 1590, 270, 1590, 267, 1591, 268, 1591, 269,
- 1591, 270, 1591, 267, 1592, 268, 1592, 269, 1592, 270, 1592, 267, 1593,
- 268, 1593, 269, 1593, 270, 1593, 267, 1594, 268, 1594, 269, 1594, 270,
- 1594, 267, 1601, 268, 1601, 269, 1601, 270, 1601, 267, 1602, 268, 1602,
- 269, 1602, 270, 1602, 267, 1603, 268, 1603, 269, 1603, 270, 1603, 267,
- 1604, 268, 1604, 269, 1604, 270, 1604, 267, 1605, 268, 1605, 269, 1605,
- 270, 1605, 267, 1606, 268, 1606, 269, 1606, 270, 1606, 267, 1607, 268,
- 1607, 269, 1607, 270, 1607, 267, 1608, 268, 1608, 267, 1609, 268, 1609,
- 267, 1610, 268, 1610, 269, 1610, 270, 1610, 523, 1604, 1570, 524, 1604,
- 1570, 523, 1604, 1571, 524, 1604, 1571, 523, 1604, 1573, 524, 1604, 1573,
- 523, 1604, 1575, 524, 1604, 1575, 264, 33, 264, 34, 264, 35, 264, 36,
- 264, 37, 264, 38, 264, 39, 264, 40, 264, 41, 264, 42, 264, 43, 264, 44,
- 264, 45, 264, 46, 264, 47, 264, 48, 264, 49, 264, 50, 264, 51, 264, 52,
- 264, 53, 264, 54, 264, 55, 264, 56, 264, 57, 264, 58, 264, 59, 264, 60,
- 264, 61, 264, 62, 264, 63, 264, 64, 264, 65, 264, 66, 264, 67, 264, 68,
- 264, 69, 264, 70, 264, 71, 264, 72, 264, 73, 264, 74, 264, 75, 264, 76,
- 264, 77, 264, 78, 264, 79, 264, 80, 264, 81, 264, 82, 264, 83, 264, 84,
- 264, 85, 264, 86, 264, 87, 264, 88, 264, 89, 264, 90, 264, 91, 264, 92,
- 264, 93, 264, 94, 264, 95, 264, 96, 264, 97, 264, 98, 264, 99, 264, 100,
- 264, 101, 264, 102, 264, 103, 264, 104, 264, 105, 264, 106, 264, 107,
- 264, 108, 264, 109, 264, 110, 264, 111, 264, 112, 264, 113, 264, 114,
- 264, 115, 264, 116, 264, 117, 264, 118, 264, 119, 264, 120, 264, 121,
- 264, 122, 264, 123, 264, 124, 264, 125, 264, 126, 264, 10629, 264, 10630,
- 272, 12290, 272, 12300, 272, 12301, 272, 12289, 272, 12539, 272, 12530,
- 272, 12449, 272, 12451, 272, 12453, 272, 12455, 272, 12457, 272, 12515,
- 272, 12517, 272, 12519, 272, 12483, 272, 12540, 272, 12450, 272, 12452,
- 272, 12454, 272, 12456, 272, 12458, 272, 12459, 272, 12461, 272, 12463,
- 272, 12465, 272, 12467, 272, 12469, 272, 12471, 272, 12473, 272, 12475,
- 272, 12477, 272, 12479, 272, 12481, 272, 12484, 272, 12486, 272, 12488,
- 272, 12490, 272, 12491, 272, 12492, 272, 12493, 272, 12494, 272, 12495,
- 272, 12498, 272, 12501, 272, 12504, 272, 12507, 272, 12510, 272, 12511,
- 272, 12512, 272, 12513, 272, 12514, 272, 12516, 272, 12518, 272, 12520,
- 272, 12521, 272, 12522, 272, 12523, 272, 12524, 272, 12525, 272, 12527,
- 272, 12531, 272, 12441, 272, 12442, 272, 12644, 272, 12593, 272, 12594,
- 272, 12595, 272, 12596, 272, 12597, 272, 12598, 272, 12599, 272, 12600,
- 272, 12601, 272, 12602, 272, 12603, 272, 12604, 272, 12605, 272, 12606,
- 272, 12607, 272, 12608, 272, 12609, 272, 12610, 272, 12611, 272, 12612,
- 272, 12613, 272, 12614, 272, 12615, 272, 12616, 272, 12617, 272, 12618,
- 272, 12619, 272, 12620, 272, 12621, 272, 12622, 272, 12623, 272, 12624,
- 272, 12625, 272, 12626, 272, 12627, 272, 12628, 272, 12629, 272, 12630,
- 272, 12631, 272, 12632, 272, 12633, 272, 12634, 272, 12635, 272, 12636,
- 272, 12637, 272, 12638, 272, 12639, 272, 12640, 272, 12641, 272, 12642,
- 272, 12643, 264, 162, 264, 163, 264, 172, 264, 175, 264, 166, 264, 165,
- 264, 8361, 272, 9474, 272, 8592, 272, 8593, 272, 8594, 272, 8595, 272,
- 9632, 272, 9675, 512, 119127, 119141, 512, 119128, 119141, 512, 119135,
- 119150, 512, 119135, 119151, 512, 119135, 119152, 512, 119135, 119153,
- 512, 119135, 119154, 512, 119225, 119141, 512, 119226, 119141, 512,
- 119227, 119150, 512, 119228, 119150, 512, 119227, 119151, 512, 119228,
- 119151, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71,
- 262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79,
- 262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87,
- 262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101,
- 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108,
- 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115,
- 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122,
- 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72,
- 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80,
- 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88,
- 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
- 102, 262, 103, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262,
- 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262,
- 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66,
- 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74,
- 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82,
- 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90,
- 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262,
- 104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,
- 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262,
- 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 67, 262, 68,
- 262, 71, 262, 74, 262, 75, 262, 78, 262, 79, 262, 80, 262, 81, 262, 83,
- 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97,
- 262, 98, 262, 99, 262, 100, 262, 102, 262, 104, 262, 105, 262, 106, 262,
- 107, 262, 108, 262, 109, 262, 110, 262, 112, 262, 113, 262, 114, 262,
- 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262,
- 122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262,
- 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262,
- 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262,
- 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
- 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262,
- 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262,
- 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65,
- 262, 66, 262, 68, 262, 69, 262, 70, 262, 71, 262, 74, 262, 75, 262, 76,
- 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 83, 262, 84, 262, 85,
- 262, 86, 262, 87, 262, 88, 262, 89, 262, 97, 262, 98, 262, 99, 262, 100,
- 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107,
- 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114,
- 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121,
- 262, 122, 262, 65, 262, 66, 262, 68, 262, 69, 262, 70, 262, 71, 262, 73,
- 262, 74, 262, 75, 262, 76, 262, 77, 262, 79, 262, 83, 262, 84, 262, 85,
- 262, 86, 262, 87, 262, 88, 262, 89, 262, 97, 262, 98, 262, 99, 262, 100,
- 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107,
+ 256, 36920, 256, 38627, 256, 38911, 256, 38971, 256, 24693, 256, 148206,
+ 256, 33304, 256, 20006, 256, 20917, 256, 20840, 256, 20352, 256, 20805,
+ 256, 20864, 256, 21191, 256, 21242, 256, 21917, 256, 21845, 256, 21913,
+ 256, 21986, 256, 22618, 256, 22707, 256, 22852, 256, 22868, 256, 23138,
+ 256, 23336, 256, 24274, 256, 24281, 256, 24425, 256, 24493, 256, 24792,
+ 256, 24910, 256, 24840, 256, 24974, 256, 24928, 256, 25074, 256, 25140,
+ 256, 25540, 256, 25628, 256, 25682, 256, 25942, 256, 26228, 256, 26391,
+ 256, 26395, 256, 26454, 256, 27513, 256, 27578, 256, 27969, 256, 28379,
+ 256, 28363, 256, 28450, 256, 28702, 256, 29038, 256, 30631, 256, 29237,
+ 256, 29359, 256, 29482, 256, 29809, 256, 29958, 256, 30011, 256, 30237,
+ 256, 30239, 256, 30410, 256, 30427, 256, 30452, 256, 30538, 256, 30528,
+ 256, 30924, 256, 31409, 256, 31680, 256, 31867, 256, 32091, 256, 32244,
+ 256, 32574, 256, 32773, 256, 33618, 256, 33775, 256, 34681, 256, 35137,
+ 256, 35206, 256, 35222, 256, 35519, 256, 35576, 256, 35531, 256, 35585,
+ 256, 35582, 256, 35565, 256, 35641, 256, 35722, 256, 36104, 256, 36664,
+ 256, 36978, 256, 37273, 256, 37494, 256, 38524, 256, 38627, 256, 38742,
+ 256, 38875, 256, 38911, 256, 38923, 256, 38971, 256, 39698, 256, 40860,
+ 256, 141386, 256, 141380, 256, 144341, 256, 15261, 256, 16408, 256,
+ 16441, 256, 152137, 256, 154832, 256, 163539, 256, 40771, 256, 40846,
+ 514, 102, 102, 514, 102, 105, 514, 102, 108, 770, 102, 102, 105, 770,
+ 102, 102, 108, 514, 383, 116, 514, 115, 116, 514, 1396, 1398, 514, 1396,
+ 1381, 514, 1396, 1387, 514, 1406, 1398, 514, 1396, 1389, 512, 1497, 1460,
+ 512, 1522, 1463, 262, 1506, 262, 1488, 262, 1491, 262, 1492, 262, 1499,
+ 262, 1500, 262, 1501, 262, 1512, 262, 1514, 262, 43, 512, 1513, 1473,
+ 512, 1513, 1474, 512, 64329, 1473, 512, 64329, 1474, 512, 1488, 1463,
+ 512, 1488, 1464, 512, 1488, 1468, 512, 1489, 1468, 512, 1490, 1468, 512,
+ 1491, 1468, 512, 1492, 1468, 512, 1493, 1468, 512, 1494, 1468, 512, 1496,
+ 1468, 512, 1497, 1468, 512, 1498, 1468, 512, 1499, 1468, 512, 1500, 1468,
+ 512, 1502, 1468, 512, 1504, 1468, 512, 1505, 1468, 512, 1507, 1468, 512,
+ 1508, 1468, 512, 1510, 1468, 512, 1511, 1468, 512, 1512, 1468, 512, 1513,
+ 1468, 512, 1514, 1468, 512, 1493, 1465, 512, 1489, 1471, 512, 1499, 1471,
+ 512, 1508, 1471, 514, 1488, 1500, 267, 1649, 268, 1649, 267, 1659, 268,
+ 1659, 269, 1659, 270, 1659, 267, 1662, 268, 1662, 269, 1662, 270, 1662,
+ 267, 1664, 268, 1664, 269, 1664, 270, 1664, 267, 1658, 268, 1658, 269,
+ 1658, 270, 1658, 267, 1663, 268, 1663, 269, 1663, 270, 1663, 267, 1657,
+ 268, 1657, 269, 1657, 270, 1657, 267, 1700, 268, 1700, 269, 1700, 270,
+ 1700, 267, 1702, 268, 1702, 269, 1702, 270, 1702, 267, 1668, 268, 1668,
+ 269, 1668, 270, 1668, 267, 1667, 268, 1667, 269, 1667, 270, 1667, 267,
+ 1670, 268, 1670, 269, 1670, 270, 1670, 267, 1671, 268, 1671, 269, 1671,
+ 270, 1671, 267, 1677, 268, 1677, 267, 1676, 268, 1676, 267, 1678, 268,
+ 1678, 267, 1672, 268, 1672, 267, 1688, 268, 1688, 267, 1681, 268, 1681,
+ 267, 1705, 268, 1705, 269, 1705, 270, 1705, 267, 1711, 268, 1711, 269,
+ 1711, 270, 1711, 267, 1715, 268, 1715, 269, 1715, 270, 1715, 267, 1713,
+ 268, 1713, 269, 1713, 270, 1713, 267, 1722, 268, 1722, 267, 1723, 268,
+ 1723, 269, 1723, 270, 1723, 267, 1728, 268, 1728, 267, 1729, 268, 1729,
+ 269, 1729, 270, 1729, 267, 1726, 268, 1726, 269, 1726, 270, 1726, 267,
+ 1746, 268, 1746, 267, 1747, 268, 1747, 267, 1709, 268, 1709, 269, 1709,
+ 270, 1709, 267, 1735, 268, 1735, 267, 1734, 268, 1734, 267, 1736, 268,
+ 1736, 267, 1655, 267, 1739, 268, 1739, 267, 1733, 268, 1733, 267, 1737,
+ 268, 1737, 267, 1744, 268, 1744, 269, 1744, 270, 1744, 269, 1609, 270,
+ 1609, 523, 1574, 1575, 524, 1574, 1575, 523, 1574, 1749, 524, 1574, 1749,
+ 523, 1574, 1608, 524, 1574, 1608, 523, 1574, 1735, 524, 1574, 1735, 523,
+ 1574, 1734, 524, 1574, 1734, 523, 1574, 1736, 524, 1574, 1736, 523, 1574,
+ 1744, 524, 1574, 1744, 525, 1574, 1744, 523, 1574, 1609, 524, 1574, 1609,
+ 525, 1574, 1609, 267, 1740, 268, 1740, 269, 1740, 270, 1740, 523, 1574,
+ 1580, 523, 1574, 1581, 523, 1574, 1605, 523, 1574, 1609, 523, 1574, 1610,
+ 523, 1576, 1580, 523, 1576, 1581, 523, 1576, 1582, 523, 1576, 1605, 523,
+ 1576, 1609, 523, 1576, 1610, 523, 1578, 1580, 523, 1578, 1581, 523, 1578,
+ 1582, 523, 1578, 1605, 523, 1578, 1609, 523, 1578, 1610, 523, 1579, 1580,
+ 523, 1579, 1605, 523, 1579, 1609, 523, 1579, 1610, 523, 1580, 1581, 523,
+ 1580, 1605, 523, 1581, 1580, 523, 1581, 1605, 523, 1582, 1580, 523, 1582,
+ 1581, 523, 1582, 1605, 523, 1587, 1580, 523, 1587, 1581, 523, 1587, 1582,
+ 523, 1587, 1605, 523, 1589, 1581, 523, 1589, 1605, 523, 1590, 1580, 523,
+ 1590, 1581, 523, 1590, 1582, 523, 1590, 1605, 523, 1591, 1581, 523, 1591,
+ 1605, 523, 1592, 1605, 523, 1593, 1580, 523, 1593, 1605, 523, 1594, 1580,
+ 523, 1594, 1605, 523, 1601, 1580, 523, 1601, 1581, 523, 1601, 1582, 523,
+ 1601, 1605, 523, 1601, 1609, 523, 1601, 1610, 523, 1602, 1581, 523, 1602,
+ 1605, 523, 1602, 1609, 523, 1602, 1610, 523, 1603, 1575, 523, 1603, 1580,
+ 523, 1603, 1581, 523, 1603, 1582, 523, 1603, 1604, 523, 1603, 1605, 523,
+ 1603, 1609, 523, 1603, 1610, 523, 1604, 1580, 523, 1604, 1581, 523, 1604,
+ 1582, 523, 1604, 1605, 523, 1604, 1609, 523, 1604, 1610, 523, 1605, 1580,
+ 523, 1605, 1581, 523, 1605, 1582, 523, 1605, 1605, 523, 1605, 1609, 523,
+ 1605, 1610, 523, 1606, 1580, 523, 1606, 1581, 523, 1606, 1582, 523, 1606,
+ 1605, 523, 1606, 1609, 523, 1606, 1610, 523, 1607, 1580, 523, 1607, 1605,
+ 523, 1607, 1609, 523, 1607, 1610, 523, 1610, 1580, 523, 1610, 1581, 523,
+ 1610, 1582, 523, 1610, 1605, 523, 1610, 1609, 523, 1610, 1610, 523, 1584,
+ 1648, 523, 1585, 1648, 523, 1609, 1648, 779, 32, 1612, 1617, 779, 32,
+ 1613, 1617, 779, 32, 1614, 1617, 779, 32, 1615, 1617, 779, 32, 1616,
+ 1617, 779, 32, 1617, 1648, 524, 1574, 1585, 524, 1574, 1586, 524, 1574,
+ 1605, 524, 1574, 1606, 524, 1574, 1609, 524, 1574, 1610, 524, 1576, 1585,
+ 524, 1576, 1586, 524, 1576, 1605, 524, 1576, 1606, 524, 1576, 1609, 524,
+ 1576, 1610, 524, 1578, 1585, 524, 1578, 1586, 524, 1578, 1605, 524, 1578,
+ 1606, 524, 1578, 1609, 524, 1578, 1610, 524, 1579, 1585, 524, 1579, 1586,
+ 524, 1579, 1605, 524, 1579, 1606, 524, 1579, 1609, 524, 1579, 1610, 524,
+ 1601, 1609, 524, 1601, 1610, 524, 1602, 1609, 524, 1602, 1610, 524, 1603,
+ 1575, 524, 1603, 1604, 524, 1603, 1605, 524, 1603, 1609, 524, 1603, 1610,
+ 524, 1604, 1605, 524, 1604, 1609, 524, 1604, 1610, 524, 1605, 1575, 524,
+ 1605, 1605, 524, 1606, 1585, 524, 1606, 1586, 524, 1606, 1605, 524, 1606,
+ 1606, 524, 1606, 1609, 524, 1606, 1610, 524, 1609, 1648, 524, 1610, 1585,
+ 524, 1610, 1586, 524, 1610, 1605, 524, 1610, 1606, 524, 1610, 1609, 524,
+ 1610, 1610, 525, 1574, 1580, 525, 1574, 1581, 525, 1574, 1582, 525, 1574,
+ 1605, 525, 1574, 1607, 525, 1576, 1580, 525, 1576, 1581, 525, 1576, 1582,
+ 525, 1576, 1605, 525, 1576, 1607, 525, 1578, 1580, 525, 1578, 1581, 525,
+ 1578, 1582, 525, 1578, 1605, 525, 1578, 1607, 525, 1579, 1605, 525, 1580,
+ 1581, 525, 1580, 1605, 525, 1581, 1580, 525, 1581, 1605, 525, 1582, 1580,
+ 525, 1582, 1605, 525, 1587, 1580, 525, 1587, 1581, 525, 1587, 1582, 525,
+ 1587, 1605, 525, 1589, 1581, 525, 1589, 1582, 525, 1589, 1605, 525, 1590,
+ 1580, 525, 1590, 1581, 525, 1590, 1582, 525, 1590, 1605, 525, 1591, 1581,
+ 525, 1592, 1605, 525, 1593, 1580, 525, 1593, 1605, 525, 1594, 1580, 525,
+ 1594, 1605, 525, 1601, 1580, 525, 1601, 1581, 525, 1601, 1582, 525, 1601,
+ 1605, 525, 1602, 1581, 525, 1602, 1605, 525, 1603, 1580, 525, 1603, 1581,
+ 525, 1603, 1582, 525, 1603, 1604, 525, 1603, 1605, 525, 1604, 1580, 525,
+ 1604, 1581, 525, 1604, 1582, 525, 1604, 1605, 525, 1604, 1607, 525, 1605,
+ 1580, 525, 1605, 1581, 525, 1605, 1582, 525, 1605, 1605, 525, 1606, 1580,
+ 525, 1606, 1581, 525, 1606, 1582, 525, 1606, 1605, 525, 1606, 1607, 525,
+ 1607, 1580, 525, 1607, 1605, 525, 1607, 1648, 525, 1610, 1580, 525, 1610,
+ 1581, 525, 1610, 1582, 525, 1610, 1605, 525, 1610, 1607, 526, 1574, 1605,
+ 526, 1574, 1607, 526, 1576, 1605, 526, 1576, 1607, 526, 1578, 1605, 526,
+ 1578, 1607, 526, 1579, 1605, 526, 1579, 1607, 526, 1587, 1605, 526, 1587,
+ 1607, 526, 1588, 1605, 526, 1588, 1607, 526, 1603, 1604, 526, 1603, 1605,
+ 526, 1604, 1605, 526, 1606, 1605, 526, 1606, 1607, 526, 1610, 1605, 526,
+ 1610, 1607, 782, 1600, 1614, 1617, 782, 1600, 1615, 1617, 782, 1600,
+ 1616, 1617, 523, 1591, 1609, 523, 1591, 1610, 523, 1593, 1609, 523, 1593,
+ 1610, 523, 1594, 1609, 523, 1594, 1610, 523, 1587, 1609, 523, 1587, 1610,
+ 523, 1588, 1609, 523, 1588, 1610, 523, 1581, 1609, 523, 1581, 1610, 523,
+ 1580, 1609, 523, 1580, 1610, 523, 1582, 1609, 523, 1582, 1610, 523, 1589,
+ 1609, 523, 1589, 1610, 523, 1590, 1609, 523, 1590, 1610, 523, 1588, 1580,
+ 523, 1588, 1581, 523, 1588, 1582, 523, 1588, 1605, 523, 1588, 1585, 523,
+ 1587, 1585, 523, 1589, 1585, 523, 1590, 1585, 524, 1591, 1609, 524, 1591,
+ 1610, 524, 1593, 1609, 524, 1593, 1610, 524, 1594, 1609, 524, 1594, 1610,
+ 524, 1587, 1609, 524, 1587, 1610, 524, 1588, 1609, 524, 1588, 1610, 524,
+ 1581, 1609, 524, 1581, 1610, 524, 1580, 1609, 524, 1580, 1610, 524, 1582,
+ 1609, 524, 1582, 1610, 524, 1589, 1609, 524, 1589, 1610, 524, 1590, 1609,
+ 524, 1590, 1610, 524, 1588, 1580, 524, 1588, 1581, 524, 1588, 1582, 524,
+ 1588, 1605, 524, 1588, 1585, 524, 1587, 1585, 524, 1589, 1585, 524, 1590,
+ 1585, 525, 1588, 1580, 525, 1588, 1581, 525, 1588, 1582, 525, 1588, 1605,
+ 525, 1587, 1607, 525, 1588, 1607, 525, 1591, 1605, 526, 1587, 1580, 526,
+ 1587, 1581, 526, 1587, 1582, 526, 1588, 1580, 526, 1588, 1581, 526, 1588,
+ 1582, 526, 1591, 1605, 526, 1592, 1605, 524, 1575, 1611, 523, 1575, 1611,
+ 781, 1578, 1580, 1605, 780, 1578, 1581, 1580, 781, 1578, 1581, 1580, 781,
+ 1578, 1581, 1605, 781, 1578, 1582, 1605, 781, 1578, 1605, 1580, 781,
+ 1578, 1605, 1581, 781, 1578, 1605, 1582, 780, 1580, 1605, 1581, 781,
+ 1580, 1605, 1581, 780, 1581, 1605, 1610, 780, 1581, 1605, 1609, 781,
+ 1587, 1581, 1580, 781, 1587, 1580, 1581, 780, 1587, 1580, 1609, 780,
+ 1587, 1605, 1581, 781, 1587, 1605, 1581, 781, 1587, 1605, 1580, 780,
+ 1587, 1605, 1605, 781, 1587, 1605, 1605, 780, 1589, 1581, 1581, 781,
+ 1589, 1581, 1581, 780, 1589, 1605, 1605, 780, 1588, 1581, 1605, 781,
+ 1588, 1581, 1605, 780, 1588, 1580, 1610, 780, 1588, 1605, 1582, 781,
+ 1588, 1605, 1582, 780, 1588, 1605, 1605, 781, 1588, 1605, 1605, 780,
+ 1590, 1581, 1609, 780, 1590, 1582, 1605, 781, 1590, 1582, 1605, 780,
+ 1591, 1605, 1581, 781, 1591, 1605, 1581, 781, 1591, 1605, 1605, 780,
+ 1591, 1605, 1610, 780, 1593, 1580, 1605, 780, 1593, 1605, 1605, 781,
+ 1593, 1605, 1605, 780, 1593, 1605, 1609, 780, 1594, 1605, 1605, 780,
+ 1594, 1605, 1610, 780, 1594, 1605, 1609, 780, 1601, 1582, 1605, 781,
+ 1601, 1582, 1605, 780, 1602, 1605, 1581, 780, 1602, 1605, 1605, 780,
+ 1604, 1581, 1605, 780, 1604, 1581, 1610, 780, 1604, 1581, 1609, 781,
+ 1604, 1580, 1580, 780, 1604, 1580, 1580, 780, 1604, 1582, 1605, 781,
+ 1604, 1582, 1605, 780, 1604, 1605, 1581, 781, 1604, 1605, 1581, 781,
+ 1605, 1581, 1580, 781, 1605, 1581, 1605, 780, 1605, 1581, 1610, 781,
+ 1605, 1580, 1581, 781, 1605, 1580, 1605, 781, 1605, 1582, 1580, 781,
+ 1605, 1582, 1605, 781, 1605, 1580, 1582, 781, 1607, 1605, 1580, 781,
+ 1607, 1605, 1605, 781, 1606, 1581, 1605, 780, 1606, 1581, 1609, 780,
+ 1606, 1580, 1605, 781, 1606, 1580, 1605, 780, 1606, 1580, 1609, 780,
+ 1606, 1605, 1610, 780, 1606, 1605, 1609, 780, 1610, 1605, 1605, 781,
+ 1610, 1605, 1605, 780, 1576, 1582, 1610, 780, 1578, 1580, 1610, 780,
+ 1578, 1580, 1609, 780, 1578, 1582, 1610, 780, 1578, 1582, 1609, 780,
+ 1578, 1605, 1610, 780, 1578, 1605, 1609, 780, 1580, 1605, 1610, 780,
+ 1580, 1581, 1609, 780, 1580, 1605, 1609, 780, 1587, 1582, 1609, 780,
+ 1589, 1581, 1610, 780, 1588, 1581, 1610, 780, 1590, 1581, 1610, 780,
+ 1604, 1580, 1610, 780, 1604, 1605, 1610, 780, 1610, 1581, 1610, 780,
+ 1610, 1580, 1610, 780, 1610, 1605, 1610, 780, 1605, 1605, 1610, 780,
+ 1602, 1605, 1610, 780, 1606, 1581, 1610, 781, 1602, 1605, 1581, 781,
+ 1604, 1581, 1605, 780, 1593, 1605, 1610, 780, 1603, 1605, 1610, 781,
+ 1606, 1580, 1581, 780, 1605, 1582, 1610, 781, 1604, 1580, 1605, 780,
+ 1603, 1605, 1605, 780, 1604, 1580, 1605, 780, 1606, 1580, 1581, 780,
+ 1580, 1581, 1610, 780, 1581, 1580, 1610, 780, 1605, 1580, 1610, 780,
+ 1601, 1605, 1610, 780, 1576, 1581, 1610, 781, 1603, 1605, 1605, 781,
+ 1593, 1580, 1605, 781, 1589, 1605, 1605, 780, 1587, 1582, 1610, 780,
+ 1606, 1580, 1610, 779, 1589, 1604, 1746, 779, 1602, 1604, 1746, 1035,
+ 1575, 1604, 1604, 1607, 1035, 1575, 1603, 1576, 1585, 1035, 1605, 1581,
+ 1605, 1583, 1035, 1589, 1604, 1593, 1605, 1035, 1585, 1587, 1608, 1604,
+ 1035, 1593, 1604, 1610, 1607, 1035, 1608, 1587, 1604, 1605, 779, 1589,
+ 1604, 1609, 4619, 1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593,
+ 1604, 1610, 1607, 32, 1608, 1587, 1604, 1605, 2059, 1580, 1604, 32, 1580,
+ 1604, 1575, 1604, 1607, 1035, 1585, 1740, 1575, 1604, 265, 44, 265,
+ 12289, 265, 12290, 265, 58, 265, 59, 265, 33, 265, 63, 265, 12310, 265,
+ 12311, 265, 8230, 265, 8229, 265, 8212, 265, 8211, 265, 95, 265, 95, 265,
+ 40, 265, 41, 265, 123, 265, 125, 265, 12308, 265, 12309, 265, 12304, 265,
+ 12305, 265, 12298, 265, 12299, 265, 12296, 265, 12297, 265, 12300, 265,
+ 12301, 265, 12302, 265, 12303, 265, 91, 265, 93, 258, 8254, 258, 8254,
+ 258, 8254, 258, 8254, 258, 95, 258, 95, 258, 95, 271, 44, 271, 12289,
+ 271, 46, 271, 59, 271, 58, 271, 63, 271, 33, 271, 8212, 271, 40, 271, 41,
+ 271, 123, 271, 125, 271, 12308, 271, 12309, 271, 35, 271, 38, 271, 42,
+ 271, 43, 271, 45, 271, 60, 271, 62, 271, 61, 271, 92, 271, 36, 271, 37,
+ 271, 64, 523, 32, 1611, 526, 1600, 1611, 523, 32, 1612, 523, 32, 1613,
+ 523, 32, 1614, 526, 1600, 1614, 523, 32, 1615, 526, 1600, 1615, 523, 32,
+ 1616, 526, 1600, 1616, 523, 32, 1617, 526, 1600, 1617, 523, 32, 1618,
+ 526, 1600, 1618, 267, 1569, 267, 1570, 268, 1570, 267, 1571, 268, 1571,
+ 267, 1572, 268, 1572, 267, 1573, 268, 1573, 267, 1574, 268, 1574, 269,
+ 1574, 270, 1574, 267, 1575, 268, 1575, 267, 1576, 268, 1576, 269, 1576,
+ 270, 1576, 267, 1577, 268, 1577, 267, 1578, 268, 1578, 269, 1578, 270,
+ 1578, 267, 1579, 268, 1579, 269, 1579, 270, 1579, 267, 1580, 268, 1580,
+ 269, 1580, 270, 1580, 267, 1581, 268, 1581, 269, 1581, 270, 1581, 267,
+ 1582, 268, 1582, 269, 1582, 270, 1582, 267, 1583, 268, 1583, 267, 1584,
+ 268, 1584, 267, 1585, 268, 1585, 267, 1586, 268, 1586, 267, 1587, 268,
+ 1587, 269, 1587, 270, 1587, 267, 1588, 268, 1588, 269, 1588, 270, 1588,
+ 267, 1589, 268, 1589, 269, 1589, 270, 1589, 267, 1590, 268, 1590, 269,
+ 1590, 270, 1590, 267, 1591, 268, 1591, 269, 1591, 270, 1591, 267, 1592,
+ 268, 1592, 269, 1592, 270, 1592, 267, 1593, 268, 1593, 269, 1593, 270,
+ 1593, 267, 1594, 268, 1594, 269, 1594, 270, 1594, 267, 1601, 268, 1601,
+ 269, 1601, 270, 1601, 267, 1602, 268, 1602, 269, 1602, 270, 1602, 267,
+ 1603, 268, 1603, 269, 1603, 270, 1603, 267, 1604, 268, 1604, 269, 1604,
+ 270, 1604, 267, 1605, 268, 1605, 269, 1605, 270, 1605, 267, 1606, 268,
+ 1606, 269, 1606, 270, 1606, 267, 1607, 268, 1607, 269, 1607, 270, 1607,
+ 267, 1608, 268, 1608, 267, 1609, 268, 1609, 267, 1610, 268, 1610, 269,
+ 1610, 270, 1610, 523, 1604, 1570, 524, 1604, 1570, 523, 1604, 1571, 524,
+ 1604, 1571, 523, 1604, 1573, 524, 1604, 1573, 523, 1604, 1575, 524, 1604,
+ 1575, 264, 33, 264, 34, 264, 35, 264, 36, 264, 37, 264, 38, 264, 39, 264,
+ 40, 264, 41, 264, 42, 264, 43, 264, 44, 264, 45, 264, 46, 264, 47, 264,
+ 48, 264, 49, 264, 50, 264, 51, 264, 52, 264, 53, 264, 54, 264, 55, 264,
+ 56, 264, 57, 264, 58, 264, 59, 264, 60, 264, 61, 264, 62, 264, 63, 264,
+ 64, 264, 65, 264, 66, 264, 67, 264, 68, 264, 69, 264, 70, 264, 71, 264,
+ 72, 264, 73, 264, 74, 264, 75, 264, 76, 264, 77, 264, 78, 264, 79, 264,
+ 80, 264, 81, 264, 82, 264, 83, 264, 84, 264, 85, 264, 86, 264, 87, 264,
+ 88, 264, 89, 264, 90, 264, 91, 264, 92, 264, 93, 264, 94, 264, 95, 264,
+ 96, 264, 97, 264, 98, 264, 99, 264, 100, 264, 101, 264, 102, 264, 103,
+ 264, 104, 264, 105, 264, 106, 264, 107, 264, 108, 264, 109, 264, 110,
+ 264, 111, 264, 112, 264, 113, 264, 114, 264, 115, 264, 116, 264, 117,
+ 264, 118, 264, 119, 264, 120, 264, 121, 264, 122, 264, 123, 264, 124,
+ 264, 125, 264, 126, 264, 10629, 264, 10630, 272, 12290, 272, 12300, 272,
+ 12301, 272, 12289, 272, 12539, 272, 12530, 272, 12449, 272, 12451, 272,
+ 12453, 272, 12455, 272, 12457, 272, 12515, 272, 12517, 272, 12519, 272,
+ 12483, 272, 12540, 272, 12450, 272, 12452, 272, 12454, 272, 12456, 272,
+ 12458, 272, 12459, 272, 12461, 272, 12463, 272, 12465, 272, 12467, 272,
+ 12469, 272, 12471, 272, 12473, 272, 12475, 272, 12477, 272, 12479, 272,
+ 12481, 272, 12484, 272, 12486, 272, 12488, 272, 12490, 272, 12491, 272,
+ 12492, 272, 12493, 272, 12494, 272, 12495, 272, 12498, 272, 12501, 272,
+ 12504, 272, 12507, 272, 12510, 272, 12511, 272, 12512, 272, 12513, 272,
+ 12514, 272, 12516, 272, 12518, 272, 12520, 272, 12521, 272, 12522, 272,
+ 12523, 272, 12524, 272, 12525, 272, 12527, 272, 12531, 272, 12441, 272,
+ 12442, 272, 12644, 272, 12593, 272, 12594, 272, 12595, 272, 12596, 272,
+ 12597, 272, 12598, 272, 12599, 272, 12600, 272, 12601, 272, 12602, 272,
+ 12603, 272, 12604, 272, 12605, 272, 12606, 272, 12607, 272, 12608, 272,
+ 12609, 272, 12610, 272, 12611, 272, 12612, 272, 12613, 272, 12614, 272,
+ 12615, 272, 12616, 272, 12617, 272, 12618, 272, 12619, 272, 12620, 272,
+ 12621, 272, 12622, 272, 12623, 272, 12624, 272, 12625, 272, 12626, 272,
+ 12627, 272, 12628, 272, 12629, 272, 12630, 272, 12631, 272, 12632, 272,
+ 12633, 272, 12634, 272, 12635, 272, 12636, 272, 12637, 272, 12638, 272,
+ 12639, 272, 12640, 272, 12641, 272, 12642, 272, 12643, 264, 162, 264,
+ 163, 264, 172, 264, 175, 264, 166, 264, 165, 264, 8361, 272, 9474, 272,
+ 8592, 272, 8593, 272, 8594, 272, 8595, 272, 9632, 272, 9675, 512, 69785,
+ 69818, 512, 69787, 69818, 512, 69797, 69818, 512, 119127, 119141, 512,
+ 119128, 119141, 512, 119135, 119150, 512, 119135, 119151, 512, 119135,
+ 119152, 512, 119135, 119153, 512, 119135, 119154, 512, 119225, 119141,
+ 512, 119226, 119141, 512, 119227, 119150, 512, 119228, 119150, 512,
+ 119227, 119151, 512, 119228, 119151, 262, 65, 262, 66, 262, 67, 262, 68,
+ 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76,
+ 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84,
+ 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98,
+ 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262,
+ 106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262,
+ 113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262,
+ 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69,
+ 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77,
+ 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85,
+ 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99,
+ 262, 100, 262, 101, 262, 102, 262, 103, 262, 105, 262, 106, 262, 107,
262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114,
262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121,
262, 122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71,
@@ -3192,23 +3396,27 @@ static unsigned int decomp_data[] = {
262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108,
262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115,
262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122,
- 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72,
- 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80,
- 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88,
- 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
- 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262,
- 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262,
- 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65,
- 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73,
- 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81,
- 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89,
- 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262,
- 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262,
- 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262,
- 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66,
- 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74,
- 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82,
- 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90,
+ 262, 65, 262, 67, 262, 68, 262, 71, 262, 74, 262, 75, 262, 78, 262, 79,
+ 262, 80, 262, 81, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88,
+ 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 102, 262,
+ 104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,
+ 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262,
+ 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67, 262, 68,
+ 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76,
+ 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84,
+ 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98,
+ 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262,
+ 106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262,
+ 113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262,
+ 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 68, 262, 69, 262, 70,
+ 262, 71, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80,
+ 262, 81, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89,
+ 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262,
+ 104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,
+ 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262,
+ 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 68,
+ 262, 69, 262, 70, 262, 71, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77,
+ 262, 79, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89,
262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262,
104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,
111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262,
@@ -3226,24 +3434,35 @@ static unsigned int decomp_data[] = {
262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262,
106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262,
113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262,
- 120, 262, 121, 262, 122, 262, 305, 262, 567, 262, 913, 262, 914, 262,
- 915, 262, 916, 262, 917, 262, 918, 262, 919, 262, 920, 262, 921, 262,
- 922, 262, 923, 262, 924, 262, 925, 262, 926, 262, 927, 262, 928, 262,
- 929, 262, 1012, 262, 931, 262, 932, 262, 933, 262, 934, 262, 935, 262,
- 936, 262, 937, 262, 8711, 262, 945, 262, 946, 262, 947, 262, 948, 262,
- 949, 262, 950, 262, 951, 262, 952, 262, 953, 262, 954, 262, 955, 262,
- 956, 262, 957, 262, 958, 262, 959, 262, 960, 262, 961, 262, 962, 262,
- 963, 262, 964, 262, 965, 262, 966, 262, 967, 262, 968, 262, 969, 262,
- 8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262, 982, 262,
- 913, 262, 914, 262, 915, 262, 916, 262, 917, 262, 918, 262, 919, 262,
- 920, 262, 921, 262, 922, 262, 923, 262, 924, 262, 925, 262, 926, 262,
- 927, 262, 928, 262, 929, 262, 1012, 262, 931, 262, 932, 262, 933, 262,
- 934, 262, 935, 262, 936, 262, 937, 262, 8711, 262, 945, 262, 946, 262,
- 947, 262, 948, 262, 949, 262, 950, 262, 951, 262, 952, 262, 953, 262,
- 954, 262, 955, 262, 956, 262, 957, 262, 958, 262, 959, 262, 960, 262,
- 961, 262, 962, 262, 963, 262, 964, 262, 965, 262, 966, 262, 967, 262,
- 968, 262, 969, 262, 8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262,
- 1009, 262, 982, 262, 913, 262, 914, 262, 915, 262, 916, 262, 917, 262,
+ 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69,
+ 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77,
+ 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85,
+ 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99,
+ 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106,
+ 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113,
+ 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120,
+ 262, 121, 262, 122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70,
+ 262, 71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78,
+ 262, 79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86,
+ 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100,
+ 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107,
+ 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114,
+ 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121,
+ 262, 122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71,
+ 262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79,
+ 262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87,
+ 262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101,
+ 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108,
+ 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115,
+ 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122,
+ 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72,
+ 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80,
+ 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88,
+ 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
+ 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262,
+ 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262,
+ 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262,
+ 305, 262, 567, 262, 913, 262, 914, 262, 915, 262, 916, 262, 917, 262,
918, 262, 919, 262, 920, 262, 921, 262, 922, 262, 923, 262, 924, 262,
925, 262, 926, 262, 927, 262, 928, 262, 929, 262, 1012, 262, 931, 262,
932, 262, 933, 262, 934, 262, 935, 262, 936, 262, 937, 262, 8711, 262,
@@ -3268,104 +3487,146 @@ static unsigned int decomp_data[] = {
955, 262, 956, 262, 957, 262, 958, 262, 959, 262, 960, 262, 961, 262,
962, 262, 963, 262, 964, 262, 965, 262, 966, 262, 967, 262, 968, 262,
969, 262, 8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262,
- 982, 262, 988, 262, 989, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52,
- 262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 48, 262, 49, 262, 50,
- 262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 48,
- 262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262, 56,
- 262, 57, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54,
- 262, 55, 262, 56, 262, 57, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52,
- 262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 256, 20029, 256, 20024, 256,
- 20033, 256, 131362, 256, 20320, 256, 20398, 256, 20411, 256, 20482, 256,
- 20602, 256, 20633, 256, 20711, 256, 20687, 256, 13470, 256, 132666, 256,
- 20813, 256, 20820, 256, 20836, 256, 20855, 256, 132380, 256, 13497, 256,
- 20839, 256, 20877, 256, 132427, 256, 20887, 256, 20900, 256, 20172, 256,
- 20908, 256, 20917, 256, 168415, 256, 20981, 256, 20995, 256, 13535, 256,
- 21051, 256, 21062, 256, 21106, 256, 21111, 256, 13589, 256, 21191, 256,
- 21193, 256, 21220, 256, 21242, 256, 21253, 256, 21254, 256, 21271, 256,
- 21321, 256, 21329, 256, 21338, 256, 21363, 256, 21373, 256, 21375, 256,
- 21375, 256, 21375, 256, 133676, 256, 28784, 256, 21450, 256, 21471, 256,
- 133987, 256, 21483, 256, 21489, 256, 21510, 256, 21662, 256, 21560, 256,
- 21576, 256, 21608, 256, 21666, 256, 21750, 256, 21776, 256, 21843, 256,
- 21859, 256, 21892, 256, 21892, 256, 21913, 256, 21931, 256, 21939, 256,
- 21954, 256, 22294, 256, 22022, 256, 22295, 256, 22097, 256, 22132, 256,
- 20999, 256, 22766, 256, 22478, 256, 22516, 256, 22541, 256, 22411, 256,
- 22578, 256, 22577, 256, 22700, 256, 136420, 256, 22770, 256, 22775, 256,
- 22790, 256, 22810, 256, 22818, 256, 22882, 256, 136872, 256, 136938, 256,
- 23020, 256, 23067, 256, 23079, 256, 23000, 256, 23142, 256, 14062, 256,
- 14076, 256, 23304, 256, 23358, 256, 23358, 256, 137672, 256, 23491, 256,
- 23512, 256, 23527, 256, 23539, 256, 138008, 256, 23551, 256, 23558, 256,
- 24403, 256, 23586, 256, 14209, 256, 23648, 256, 23662, 256, 23744, 256,
- 23693, 256, 138724, 256, 23875, 256, 138726, 256, 23918, 256, 23915, 256,
- 23932, 256, 24033, 256, 24034, 256, 14383, 256, 24061, 256, 24104, 256,
- 24125, 256, 24169, 256, 14434, 256, 139651, 256, 14460, 256, 24240, 256,
- 24243, 256, 24246, 256, 24266, 256, 172946, 256, 24318, 256, 140081, 256,
- 140081, 256, 33281, 256, 24354, 256, 24354, 256, 14535, 256, 144056, 256,
- 156122, 256, 24418, 256, 24427, 256, 14563, 256, 24474, 256, 24525, 256,
- 24535, 256, 24569, 256, 24705, 256, 14650, 256, 14620, 256, 24724, 256,
- 141012, 256, 24775, 256, 24904, 256, 24908, 256, 24910, 256, 24908, 256,
- 24954, 256, 24974, 256, 25010, 256, 24996, 256, 25007, 256, 25054, 256,
- 25074, 256, 25078, 256, 25104, 256, 25115, 256, 25181, 256, 25265, 256,
- 25300, 256, 25424, 256, 142092, 256, 25405, 256, 25340, 256, 25448, 256,
- 25475, 256, 25572, 256, 142321, 256, 25634, 256, 25541, 256, 25513, 256,
- 14894, 256, 25705, 256, 25726, 256, 25757, 256, 25719, 256, 14956, 256,
- 25935, 256, 25964, 256, 143370, 256, 26083, 256, 26360, 256, 26185, 256,
- 15129, 256, 26257, 256, 15112, 256, 15076, 256, 20882, 256, 20885, 256,
- 26368, 256, 26268, 256, 32941, 256, 17369, 256, 26391, 256, 26395, 256,
- 26401, 256, 26462, 256, 26451, 256, 144323, 256, 15177, 256, 26618, 256,
- 26501, 256, 26706, 256, 26757, 256, 144493, 256, 26766, 256, 26655, 256,
- 26900, 256, 15261, 256, 26946, 256, 27043, 256, 27114, 256, 27304, 256,
- 145059, 256, 27355, 256, 15384, 256, 27425, 256, 145575, 256, 27476, 256,
- 15438, 256, 27506, 256, 27551, 256, 27578, 256, 27579, 256, 146061, 256,
- 138507, 256, 146170, 256, 27726, 256, 146620, 256, 27839, 256, 27853,
- 256, 27751, 256, 27926, 256, 27966, 256, 28023, 256, 27969, 256, 28009,
- 256, 28024, 256, 28037, 256, 146718, 256, 27956, 256, 28207, 256, 28270,
- 256, 15667, 256, 28363, 256, 28359, 256, 147153, 256, 28153, 256, 28526,
- 256, 147294, 256, 147342, 256, 28614, 256, 28729, 256, 28702, 256, 28699,
- 256, 15766, 256, 28746, 256, 28797, 256, 28791, 256, 28845, 256, 132389,
- 256, 28997, 256, 148067, 256, 29084, 256, 148395, 256, 29224, 256, 29237,
- 256, 29264, 256, 149000, 256, 29312, 256, 29333, 256, 149301, 256,
- 149524, 256, 29562, 256, 29579, 256, 16044, 256, 29605, 256, 16056, 256,
- 16056, 256, 29767, 256, 29788, 256, 29809, 256, 29829, 256, 29898, 256,
- 16155, 256, 29988, 256, 150582, 256, 30014, 256, 150674, 256, 30064, 256,
- 139679, 256, 30224, 256, 151457, 256, 151480, 256, 151620, 256, 16380,
- 256, 16392, 256, 30452, 256, 151795, 256, 151794, 256, 151833, 256,
- 151859, 256, 30494, 256, 30495, 256, 30495, 256, 30538, 256, 16441, 256,
- 30603, 256, 16454, 256, 16534, 256, 152605, 256, 30798, 256, 30860, 256,
- 30924, 256, 16611, 256, 153126, 256, 31062, 256, 153242, 256, 153285,
- 256, 31119, 256, 31211, 256, 16687, 256, 31296, 256, 31306, 256, 31311,
- 256, 153980, 256, 154279, 256, 154279, 256, 31470, 256, 16898, 256,
- 154539, 256, 31686, 256, 31689, 256, 16935, 256, 154752, 256, 31954, 256,
- 17056, 256, 31976, 256, 31971, 256, 32000, 256, 155526, 256, 32099, 256,
- 17153, 256, 32199, 256, 32258, 256, 32325, 256, 17204, 256, 156200, 256,
- 156231, 256, 17241, 256, 156377, 256, 32634, 256, 156478, 256, 32661,
- 256, 32762, 256, 32773, 256, 156890, 256, 156963, 256, 32864, 256,
- 157096, 256, 32880, 256, 144223, 256, 17365, 256, 32946, 256, 33027, 256,
- 17419, 256, 33086, 256, 23221, 256, 157607, 256, 157621, 256, 144275,
- 256, 144284, 256, 33281, 256, 33284, 256, 36766, 256, 17515, 256, 33425,
- 256, 33419, 256, 33437, 256, 21171, 256, 33457, 256, 33459, 256, 33469,
- 256, 33510, 256, 158524, 256, 33509, 256, 33565, 256, 33635, 256, 33709,
- 256, 33571, 256, 33725, 256, 33767, 256, 33879, 256, 33619, 256, 33738,
- 256, 33740, 256, 33756, 256, 158774, 256, 159083, 256, 158933, 256,
- 17707, 256, 34033, 256, 34035, 256, 34070, 256, 160714, 256, 34148, 256,
- 159532, 256, 17757, 256, 17761, 256, 159665, 256, 159954, 256, 17771,
- 256, 34384, 256, 34396, 256, 34407, 256, 34409, 256, 34473, 256, 34440,
- 256, 34574, 256, 34530, 256, 34681, 256, 34600, 256, 34667, 256, 34694,
- 256, 17879, 256, 34785, 256, 34817, 256, 17913, 256, 34912, 256, 34915,
- 256, 161383, 256, 35031, 256, 35038, 256, 17973, 256, 35066, 256, 13499,
- 256, 161966, 256, 162150, 256, 18110, 256, 18119, 256, 35488, 256, 35565,
- 256, 35722, 256, 35925, 256, 162984, 256, 36011, 256, 36033, 256, 36123,
- 256, 36215, 256, 163631, 256, 133124, 256, 36299, 256, 36284, 256, 36336,
- 256, 133342, 256, 36564, 256, 36664, 256, 165330, 256, 165357, 256,
- 37012, 256, 37105, 256, 37137, 256, 165678, 256, 37147, 256, 37432, 256,
- 37591, 256, 37592, 256, 37500, 256, 37881, 256, 37909, 256, 166906, 256,
- 38283, 256, 18837, 256, 38327, 256, 167287, 256, 18918, 256, 38595, 256,
- 23986, 256, 38691, 256, 168261, 256, 168474, 256, 19054, 256, 19062, 256,
- 38880, 256, 168970, 256, 19122, 256, 169110, 256, 38923, 256, 38923, 256,
- 38953, 256, 169398, 256, 39138, 256, 19251, 256, 39209, 256, 39335, 256,
- 39362, 256, 39422, 256, 19406, 256, 170800, 256, 39698, 256, 40000, 256,
- 40189, 256, 19662, 256, 19693, 256, 40295, 256, 172238, 256, 19704, 256,
- 172293, 256, 172558, 256, 172689, 256, 40635, 256, 19798, 256, 40697,
- 256, 40702, 256, 40709, 256, 40719, 256, 40726, 256, 40763, 256, 173568,
+ 982, 262, 913, 262, 914, 262, 915, 262, 916, 262, 917, 262, 918, 262,
+ 919, 262, 920, 262, 921, 262, 922, 262, 923, 262, 924, 262, 925, 262,
+ 926, 262, 927, 262, 928, 262, 929, 262, 1012, 262, 931, 262, 932, 262,
+ 933, 262, 934, 262, 935, 262, 936, 262, 937, 262, 8711, 262, 945, 262,
+ 946, 262, 947, 262, 948, 262, 949, 262, 950, 262, 951, 262, 952, 262,
+ 953, 262, 954, 262, 955, 262, 956, 262, 957, 262, 958, 262, 959, 262,
+ 960, 262, 961, 262, 962, 262, 963, 262, 964, 262, 965, 262, 966, 262,
+ 967, 262, 968, 262, 969, 262, 8706, 262, 1013, 262, 977, 262, 1008, 262,
+ 981, 262, 1009, 262, 982, 262, 913, 262, 914, 262, 915, 262, 916, 262,
+ 917, 262, 918, 262, 919, 262, 920, 262, 921, 262, 922, 262, 923, 262,
+ 924, 262, 925, 262, 926, 262, 927, 262, 928, 262, 929, 262, 1012, 262,
+ 931, 262, 932, 262, 933, 262, 934, 262, 935, 262, 936, 262, 937, 262,
+ 8711, 262, 945, 262, 946, 262, 947, 262, 948, 262, 949, 262, 950, 262,
+ 951, 262, 952, 262, 953, 262, 954, 262, 955, 262, 956, 262, 957, 262,
+ 958, 262, 959, 262, 960, 262, 961, 262, 962, 262, 963, 262, 964, 262,
+ 965, 262, 966, 262, 967, 262, 968, 262, 969, 262, 8706, 262, 1013, 262,
+ 977, 262, 1008, 262, 981, 262, 1009, 262, 982, 262, 988, 262, 989, 262,
+ 48, 262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262,
+ 56, 262, 57, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262,
+ 54, 262, 55, 262, 56, 262, 57, 262, 48, 262, 49, 262, 50, 262, 51, 262,
+ 52, 262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 48, 262, 49, 262,
+ 50, 262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262,
+ 48, 262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262,
+ 56, 262, 57, 514, 48, 46, 514, 48, 44, 514, 49, 44, 514, 50, 44, 514, 51,
+ 44, 514, 52, 44, 514, 53, 44, 514, 54, 44, 514, 55, 44, 514, 56, 44, 514,
+ 57, 44, 770, 40, 65, 41, 770, 40, 66, 41, 770, 40, 67, 41, 770, 40, 68,
+ 41, 770, 40, 69, 41, 770, 40, 70, 41, 770, 40, 71, 41, 770, 40, 72, 41,
+ 770, 40, 73, 41, 770, 40, 74, 41, 770, 40, 75, 41, 770, 40, 76, 41, 770,
+ 40, 77, 41, 770, 40, 78, 41, 770, 40, 79, 41, 770, 40, 80, 41, 770, 40,
+ 81, 41, 770, 40, 82, 41, 770, 40, 83, 41, 770, 40, 84, 41, 770, 40, 85,
+ 41, 770, 40, 86, 41, 770, 40, 87, 41, 770, 40, 88, 41, 770, 40, 89, 41,
+ 770, 40, 90, 41, 770, 12308, 83, 12309, 263, 67, 263, 82, 519, 67, 68,
+ 519, 87, 90, 266, 65, 266, 66, 266, 67, 266, 68, 266, 69, 266, 70, 266,
+ 71, 266, 72, 266, 73, 266, 74, 266, 75, 266, 76, 266, 77, 266, 78, 266,
+ 79, 266, 80, 266, 81, 266, 82, 266, 83, 266, 84, 266, 85, 266, 86, 266,
+ 87, 266, 88, 266, 89, 266, 90, 522, 72, 86, 522, 77, 86, 522, 83, 68,
+ 522, 83, 83, 778, 80, 80, 86, 522, 87, 67, 522, 68, 74, 522, 12411,
+ 12363, 522, 12467, 12467, 266, 12469, 266, 25163, 266, 23383, 266, 21452,
+ 266, 12487, 266, 20108, 266, 22810, 266, 35299, 266, 22825, 266, 20132,
+ 266, 26144, 266, 28961, 266, 26009, 266, 21069, 266, 24460, 266, 20877,
+ 266, 26032, 266, 21021, 266, 32066, 266, 29983, 266, 36009, 266, 22768,
+ 266, 21561, 266, 28436, 266, 25237, 266, 25429, 266, 19968, 266, 19977,
+ 266, 36938, 266, 24038, 266, 20013, 266, 21491, 266, 25351, 266, 36208,
+ 266, 25171, 266, 31105, 266, 31354, 266, 21512, 266, 28288, 266, 26377,
+ 266, 26376, 266, 30003, 266, 21106, 266, 21942, 770, 12308, 26412, 12309,
+ 770, 12308, 19977, 12309, 770, 12308, 20108, 12309, 770, 12308, 23433,
+ 12309, 770, 12308, 28857, 12309, 770, 12308, 25171, 12309, 770, 12308,
+ 30423, 12309, 770, 12308, 21213, 12309, 770, 12308, 25943, 12309, 263,
+ 24471, 263, 21487, 256, 20029, 256, 20024, 256, 20033, 256, 131362, 256,
+ 20320, 256, 20398, 256, 20411, 256, 20482, 256, 20602, 256, 20633, 256,
+ 20711, 256, 20687, 256, 13470, 256, 132666, 256, 20813, 256, 20820, 256,
+ 20836, 256, 20855, 256, 132380, 256, 13497, 256, 20839, 256, 20877, 256,
+ 132427, 256, 20887, 256, 20900, 256, 20172, 256, 20908, 256, 20917, 256,
+ 168415, 256, 20981, 256, 20995, 256, 13535, 256, 21051, 256, 21062, 256,
+ 21106, 256, 21111, 256, 13589, 256, 21191, 256, 21193, 256, 21220, 256,
+ 21242, 256, 21253, 256, 21254, 256, 21271, 256, 21321, 256, 21329, 256,
+ 21338, 256, 21363, 256, 21373, 256, 21375, 256, 21375, 256, 21375, 256,
+ 133676, 256, 28784, 256, 21450, 256, 21471, 256, 133987, 256, 21483, 256,
+ 21489, 256, 21510, 256, 21662, 256, 21560, 256, 21576, 256, 21608, 256,
+ 21666, 256, 21750, 256, 21776, 256, 21843, 256, 21859, 256, 21892, 256,
+ 21892, 256, 21913, 256, 21931, 256, 21939, 256, 21954, 256, 22294, 256,
+ 22022, 256, 22295, 256, 22097, 256, 22132, 256, 20999, 256, 22766, 256,
+ 22478, 256, 22516, 256, 22541, 256, 22411, 256, 22578, 256, 22577, 256,
+ 22700, 256, 136420, 256, 22770, 256, 22775, 256, 22790, 256, 22810, 256,
+ 22818, 256, 22882, 256, 136872, 256, 136938, 256, 23020, 256, 23067, 256,
+ 23079, 256, 23000, 256, 23142, 256, 14062, 256, 14076, 256, 23304, 256,
+ 23358, 256, 23358, 256, 137672, 256, 23491, 256, 23512, 256, 23527, 256,
+ 23539, 256, 138008, 256, 23551, 256, 23558, 256, 24403, 256, 23586, 256,
+ 14209, 256, 23648, 256, 23662, 256, 23744, 256, 23693, 256, 138724, 256,
+ 23875, 256, 138726, 256, 23918, 256, 23915, 256, 23932, 256, 24033, 256,
+ 24034, 256, 14383, 256, 24061, 256, 24104, 256, 24125, 256, 24169, 256,
+ 14434, 256, 139651, 256, 14460, 256, 24240, 256, 24243, 256, 24246, 256,
+ 24266, 256, 172946, 256, 24318, 256, 140081, 256, 140081, 256, 33281,
+ 256, 24354, 256, 24354, 256, 14535, 256, 144056, 256, 156122, 256, 24418,
+ 256, 24427, 256, 14563, 256, 24474, 256, 24525, 256, 24535, 256, 24569,
+ 256, 24705, 256, 14650, 256, 14620, 256, 24724, 256, 141012, 256, 24775,
+ 256, 24904, 256, 24908, 256, 24910, 256, 24908, 256, 24954, 256, 24974,
+ 256, 25010, 256, 24996, 256, 25007, 256, 25054, 256, 25074, 256, 25078,
+ 256, 25104, 256, 25115, 256, 25181, 256, 25265, 256, 25300, 256, 25424,
+ 256, 142092, 256, 25405, 256, 25340, 256, 25448, 256, 25475, 256, 25572,
+ 256, 142321, 256, 25634, 256, 25541, 256, 25513, 256, 14894, 256, 25705,
+ 256, 25726, 256, 25757, 256, 25719, 256, 14956, 256, 25935, 256, 25964,
+ 256, 143370, 256, 26083, 256, 26360, 256, 26185, 256, 15129, 256, 26257,
+ 256, 15112, 256, 15076, 256, 20882, 256, 20885, 256, 26368, 256, 26268,
+ 256, 32941, 256, 17369, 256, 26391, 256, 26395, 256, 26401, 256, 26462,
+ 256, 26451, 256, 144323, 256, 15177, 256, 26618, 256, 26501, 256, 26706,
+ 256, 26757, 256, 144493, 256, 26766, 256, 26655, 256, 26900, 256, 15261,
+ 256, 26946, 256, 27043, 256, 27114, 256, 27304, 256, 145059, 256, 27355,
+ 256, 15384, 256, 27425, 256, 145575, 256, 27476, 256, 15438, 256, 27506,
+ 256, 27551, 256, 27578, 256, 27579, 256, 146061, 256, 138507, 256,
+ 146170, 256, 27726, 256, 146620, 256, 27839, 256, 27853, 256, 27751, 256,
+ 27926, 256, 27966, 256, 28023, 256, 27969, 256, 28009, 256, 28024, 256,
+ 28037, 256, 146718, 256, 27956, 256, 28207, 256, 28270, 256, 15667, 256,
+ 28363, 256, 28359, 256, 147153, 256, 28153, 256, 28526, 256, 147294, 256,
+ 147342, 256, 28614, 256, 28729, 256, 28702, 256, 28699, 256, 15766, 256,
+ 28746, 256, 28797, 256, 28791, 256, 28845, 256, 132389, 256, 28997, 256,
+ 148067, 256, 29084, 256, 148395, 256, 29224, 256, 29237, 256, 29264, 256,
+ 149000, 256, 29312, 256, 29333, 256, 149301, 256, 149524, 256, 29562,
+ 256, 29579, 256, 16044, 256, 29605, 256, 16056, 256, 16056, 256, 29767,
+ 256, 29788, 256, 29809, 256, 29829, 256, 29898, 256, 16155, 256, 29988,
+ 256, 150582, 256, 30014, 256, 150674, 256, 30064, 256, 139679, 256,
+ 30224, 256, 151457, 256, 151480, 256, 151620, 256, 16380, 256, 16392,
+ 256, 30452, 256, 151795, 256, 151794, 256, 151833, 256, 151859, 256,
+ 30494, 256, 30495, 256, 30495, 256, 30538, 256, 16441, 256, 30603, 256,
+ 16454, 256, 16534, 256, 152605, 256, 30798, 256, 30860, 256, 30924, 256,
+ 16611, 256, 153126, 256, 31062, 256, 153242, 256, 153285, 256, 31119,
+ 256, 31211, 256, 16687, 256, 31296, 256, 31306, 256, 31311, 256, 153980,
+ 256, 154279, 256, 154279, 256, 31470, 256, 16898, 256, 154539, 256,
+ 31686, 256, 31689, 256, 16935, 256, 154752, 256, 31954, 256, 17056, 256,
+ 31976, 256, 31971, 256, 32000, 256, 155526, 256, 32099, 256, 17153, 256,
+ 32199, 256, 32258, 256, 32325, 256, 17204, 256, 156200, 256, 156231, 256,
+ 17241, 256, 156377, 256, 32634, 256, 156478, 256, 32661, 256, 32762, 256,
+ 32773, 256, 156890, 256, 156963, 256, 32864, 256, 157096, 256, 32880,
+ 256, 144223, 256, 17365, 256, 32946, 256, 33027, 256, 17419, 256, 33086,
+ 256, 23221, 256, 157607, 256, 157621, 256, 144275, 256, 144284, 256,
+ 33281, 256, 33284, 256, 36766, 256, 17515, 256, 33425, 256, 33419, 256,
+ 33437, 256, 21171, 256, 33457, 256, 33459, 256, 33469, 256, 33510, 256,
+ 158524, 256, 33509, 256, 33565, 256, 33635, 256, 33709, 256, 33571, 256,
+ 33725, 256, 33767, 256, 33879, 256, 33619, 256, 33738, 256, 33740, 256,
+ 33756, 256, 158774, 256, 159083, 256, 158933, 256, 17707, 256, 34033,
+ 256, 34035, 256, 34070, 256, 160714, 256, 34148, 256, 159532, 256, 17757,
+ 256, 17761, 256, 159665, 256, 159954, 256, 17771, 256, 34384, 256, 34396,
+ 256, 34407, 256, 34409, 256, 34473, 256, 34440, 256, 34574, 256, 34530,
+ 256, 34681, 256, 34600, 256, 34667, 256, 34694, 256, 17879, 256, 34785,
+ 256, 34817, 256, 17913, 256, 34912, 256, 34915, 256, 161383, 256, 35031,
+ 256, 35038, 256, 17973, 256, 35066, 256, 13499, 256, 161966, 256, 162150,
+ 256, 18110, 256, 18119, 256, 35488, 256, 35565, 256, 35722, 256, 35925,
+ 256, 162984, 256, 36011, 256, 36033, 256, 36123, 256, 36215, 256, 163631,
+ 256, 133124, 256, 36299, 256, 36284, 256, 36336, 256, 133342, 256, 36564,
+ 256, 36664, 256, 165330, 256, 165357, 256, 37012, 256, 37105, 256, 37137,
+ 256, 165678, 256, 37147, 256, 37432, 256, 37591, 256, 37592, 256, 37500,
+ 256, 37881, 256, 37909, 256, 166906, 256, 38283, 256, 18837, 256, 38327,
+ 256, 167287, 256, 18918, 256, 38595, 256, 23986, 256, 38691, 256, 168261,
+ 256, 168474, 256, 19054, 256, 19062, 256, 38880, 256, 168970, 256, 19122,
+ 256, 169110, 256, 38923, 256, 38923, 256, 38953, 256, 169398, 256, 39138,
+ 256, 19251, 256, 39209, 256, 39335, 256, 39362, 256, 39422, 256, 19406,
+ 256, 170800, 256, 39698, 256, 40000, 256, 40189, 256, 19662, 256, 19693,
+ 256, 40295, 256, 172238, 256, 19704, 256, 172293, 256, 172558, 256,
+ 172689, 256, 40635, 256, 19798, 256, 40697, 256, 40702, 256, 40709, 256,
+ 40719, 256, 40726, 256, 40763, 256, 173568,
};
/* index tables for the decomposition data */
@@ -3382,7 +3643,7 @@ static unsigned char decomp_index1[] = {
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 35, 36, 37, 38, 39, 40,
- 41, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 41, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 42, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
@@ -3390,8 +3651,9 @@ static unsigned char decomp_index1[] = {
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 42, 7, 7, 43, 44,
- 45, 46, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 43, 7, 7, 44, 45,
+ 46, 47, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 48, 49, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
@@ -3402,8 +3664,7 @@ static unsigned char decomp_index1[] = {
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 47, 48, 49, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 50, 51, 52, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
@@ -3817,41 +4078,44 @@ static unsigned short decomp_index2[] = {
0, 0, 3127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3129, 3131,
0, 0, 3133, 3135, 3137, 3139, 3141, 3143, 3145, 3147, 3149, 3151, 3153,
3155, 3157, 3159, 3161, 3163, 3165, 3167, 3169, 3171, 3173, 3175, 3177,
- 3179, 3181, 3183, 3185, 0, 3187, 3189, 3191, 3193, 3195, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3197, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3179, 3181, 3183, 3185, 0, 3187, 3189, 3191, 3193, 3195, 3197, 3199,
+ 3201, 3203, 3205, 3207, 3209, 3211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3213, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3216, 3220, 3224,
+ 3226, 0, 3229, 3233, 3237, 0, 3239, 3242, 3244, 3246, 3248, 3250, 3252,
+ 3254, 3256, 3258, 3260, 0, 3262, 3264, 0, 0, 3267, 3269, 3271, 3273,
+ 3275, 0, 0, 3277, 3280, 3284, 0, 3287, 0, 3289, 0, 3291, 0, 3293, 3295,
+ 3297, 3299, 0, 3301, 3303, 3305, 0, 3307, 3309, 3311, 3313, 3315, 3317,
+ 3319, 0, 3321, 3325, 3327, 3329, 3331, 3333, 0, 0, 0, 0, 3335, 3337,
+ 3339, 3341, 3343, 0, 0, 0, 0, 0, 0, 3345, 3349, 3353, 3358, 3362, 3366,
+ 3370, 3374, 3378, 3382, 3386, 3390, 3394, 3398, 3402, 3406, 3409, 3411,
+ 3414, 3418, 3421, 3423, 3426, 3430, 3435, 3438, 3440, 3443, 3447, 3449,
+ 3451, 3453, 3455, 3457, 3460, 3464, 3467, 3469, 3472, 3476, 3481, 3484,
+ 3486, 3489, 3493, 3495, 3497, 3499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3501, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3505, 3508, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3511, 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, 3514,
+ 3517, 3520, 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, 3200, 3204, 3208, 3210, 0, 3213, 3217, 3221, 0,
- 3223, 3226, 3228, 3230, 3232, 3234, 3236, 3238, 3240, 3242, 3244, 0,
- 3246, 3248, 0, 0, 3251, 3253, 3255, 3257, 3259, 0, 0, 3261, 3264, 3268,
- 0, 3271, 0, 3273, 0, 3275, 0, 3277, 3279, 3281, 3283, 0, 3285, 3287,
- 3289, 0, 3291, 3293, 3295, 3297, 3299, 3301, 3303, 0, 3305, 3309, 3311,
- 3313, 3315, 3317, 0, 0, 0, 0, 3319, 3321, 3323, 3325, 3327, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 3329, 3333, 3337, 3341, 3345, 3349, 3353, 3357, 3361,
- 3365, 3369, 3373, 3377, 3380, 3382, 3385, 3389, 3392, 3394, 3397, 3401,
- 3406, 3409, 3411, 3414, 3418, 3420, 3422, 3424, 3426, 3428, 3431, 3435,
- 3438, 3440, 3443, 3447, 3452, 3455, 3457, 3460, 3464, 3466, 3468, 3470,
+ 0, 0, 0, 0, 0, 0, 0, 0, 3523, 0, 0, 0, 0, 3526, 0, 0, 3529, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3532, 0, 3535,
+ 0, 0, 0, 0, 0, 3538, 3541, 0, 3545, 3548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3552, 0, 0, 3555, 0, 0, 3558, 0, 3561, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3564, 0, 3567, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 3570, 3573, 3576, 3579, 3582, 0, 0, 3585, 3588,
+ 0, 0, 3591, 3594, 0, 0, 0, 0, 0, 0, 3597, 3600, 0, 0, 3603, 3606, 0, 0,
+ 3609, 3612, 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, 3615, 3618, 3621, 3624, 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, 3472, 3475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 3478, 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, 3481, 3484, 3487, 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, 3627,
+ 3630, 3633, 3636, 0, 0, 0, 0, 0, 0, 3639, 3642, 3645, 3648, 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, 3490, 0, 0, 0, 0,
- 3493, 0, 0, 3496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 3499, 0, 3502, 0, 0, 0, 0, 0, 3505, 3508, 0, 3512, 3515,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3519, 0, 0, 3522, 0, 0,
- 3525, 0, 3528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 3531, 0, 3534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3537, 3540, 3543,
- 3546, 3549, 0, 0, 3552, 3555, 0, 0, 3558, 3561, 0, 0, 0, 0, 0, 0, 3564,
- 3567, 0, 0, 3570, 3573, 0, 0, 3576, 3579, 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,
- 3582, 3585, 3588, 3591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 3651, 3653, 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, 3594, 3597, 3600, 3603, 0, 0, 0, 0, 0, 0, 3606,
- 3609, 3612, 3615, 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, 3618, 3620, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -3862,38 +4126,37 @@ static unsigned short decomp_index2[] = {
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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 3655, 3657, 3659, 3661, 3663, 3665, 3667, 3669,
+ 3671, 3673, 3676, 3679, 3682, 3685, 3688, 3691, 3694, 3697, 3700, 3703,
+ 3706, 3710, 3714, 3718, 3722, 3726, 3730, 3734, 3738, 3742, 3747, 3752,
+ 3757, 3762, 3767, 3772, 3777, 3782, 3787, 3792, 3797, 3800, 3803, 3806,
+ 3809, 3812, 3815, 3818, 3821, 3824, 3828, 3832, 3836, 3840, 3844, 3848,
+ 3852, 3856, 3860, 3864, 3868, 3872, 3876, 3880, 3884, 3888, 3892, 3896,
+ 3900, 3904, 3908, 3912, 3916, 3920, 3924, 3928, 3932, 3936, 3940, 3944,
+ 3948, 3952, 3956, 3960, 3964, 3968, 3972, 3974, 3976, 3978, 3980, 3982,
+ 3984, 3986, 3988, 3990, 3992, 3994, 3996, 3998, 4000, 4002, 4004, 4006,
+ 4008, 4010, 4012, 4014, 4016, 4018, 4020, 4022, 4024, 4026, 4028, 4030,
+ 4032, 4034, 4036, 4038, 4040, 4042, 4044, 4046, 4048, 4050, 4052, 4054,
+ 4056, 4058, 4060, 4062, 4064, 4066, 4068, 4070, 4072, 4074, 4076, 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, 4078, 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, 3622, 3624, 3626,
- 3628, 3630, 3632, 3634, 3636, 3638, 3640, 3643, 3646, 3649, 3652, 3655,
- 3658, 3661, 3664, 3667, 3670, 3673, 3677, 3681, 3685, 3689, 3693, 3697,
- 3701, 3705, 3709, 3714, 3719, 3724, 3729, 3734, 3739, 3744, 3749, 3754,
- 3759, 3764, 3767, 3770, 3773, 3776, 3779, 3782, 3785, 3788, 3791, 3795,
- 3799, 3803, 3807, 3811, 3815, 3819, 3823, 3827, 3831, 3835, 3839, 3843,
- 3847, 3851, 3855, 3859, 3863, 3867, 3871, 3875, 3879, 3883, 3887, 3891,
- 3895, 3899, 3903, 3907, 3911, 3915, 3919, 3923, 3927, 3931, 3935, 3939,
- 3941, 3943, 3945, 3947, 3949, 3951, 3953, 3955, 3957, 3959, 3961, 3963,
- 3965, 3967, 3969, 3971, 3973, 3975, 3977, 3979, 3981, 3983, 3985, 3987,
- 3989, 3991, 3993, 3995, 3997, 3999, 4001, 4003, 4005, 4007, 4009, 4011,
- 4013, 4015, 4017, 4019, 4021, 4023, 4025, 4027, 4029, 4031, 4033, 4035,
- 4037, 4039, 4041, 4043, 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, 4045, 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, 0, 0, 0, 0, 0, 4083, 4087, 4090, 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, 4050, 4054, 4057, 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,
+ 0, 0, 0, 4094, 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, 4061, 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, 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, 4097, 4099,
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, 4064, 4066, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -3902,8 +4165,8 @@ static unsigned short decomp_index2[] = {
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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 4101, 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, 4068, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -3914,777 +4177,854 @@ static unsigned short decomp_index2[] = {
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, 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, 4103, 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, 4070, 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, 4105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4107,
+ 4109, 4111, 4113, 4115, 4117, 4119, 4121, 4123, 4125, 4127, 4129, 4131,
+ 4133, 4135, 4137, 4139, 4141, 4143, 4145, 4147, 4149, 4151, 4153, 4155,
+ 4157, 4159, 4161, 4163, 4165, 4167, 4169, 4171, 4173, 4175, 4177, 4179,
+ 4181, 4183, 4185, 4187, 4189, 4191, 4193, 4195, 4197, 4199, 4201, 4203,
+ 4205, 4207, 4209, 4211, 4213, 4215, 4217, 4219, 4221, 4223, 4225, 4227,
+ 4229, 4231, 4233, 4235, 4237, 4239, 4241, 4243, 4245, 4247, 4249, 4251,
+ 4253, 4255, 4257, 4259, 4261, 4263, 4265, 4267, 4269, 4271, 4273, 4275,
+ 4277, 4279, 4281, 4283, 4285, 4287, 4289, 4291, 4293, 4295, 4297, 4299,
+ 4301, 4303, 4305, 4307, 4309, 4311, 4313, 4315, 4317, 4319, 4321, 4323,
+ 4325, 4327, 4329, 4331, 4333, 4335, 4337, 4339, 4341, 4343, 4345, 4347,
+ 4349, 4351, 4353, 4355, 4357, 4359, 4361, 4363, 4365, 4367, 4369, 4371,
+ 4373, 4375, 4377, 4379, 4381, 4383, 4385, 4387, 4389, 4391, 4393, 4395,
+ 4397, 4399, 4401, 4403, 4405, 4407, 4409, 4411, 4413, 4415, 4417, 4419,
+ 4421, 4423, 4425, 4427, 4429, 4431, 4433, 4435, 4437, 4439, 4441, 4443,
+ 4445, 4447, 4449, 4451, 4453, 4455, 4457, 4459, 4461, 4463, 4465, 4467,
+ 4469, 4471, 4473, 4475, 4477, 4479, 4481, 4483, 4485, 4487, 4489, 4491,
+ 4493, 4495, 4497, 4499, 4501, 4503, 4505, 4507, 4509, 4511, 4513, 4515,
+ 4517, 4519, 4521, 4523, 4525, 4527, 4529, 4531, 4533, 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, 4072, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 4074, 4076, 4078, 4080, 4082, 4084, 4086, 4088,
- 4090, 4092, 4094, 4096, 4098, 4100, 4102, 4104, 4106, 4108, 4110, 4112,
- 4114, 4116, 4118, 4120, 4122, 4124, 4126, 4128, 4130, 4132, 4134, 4136,
- 4138, 4140, 4142, 4144, 4146, 4148, 4150, 4152, 4154, 4156, 4158, 4160,
- 4162, 4164, 4166, 4168, 4170, 4172, 4174, 4176, 4178, 4180, 4182, 4184,
- 4186, 4188, 4190, 4192, 4194, 4196, 4198, 4200, 4202, 4204, 4206, 4208,
- 4210, 4212, 4214, 4216, 4218, 4220, 4222, 4224, 4226, 4228, 4230, 4232,
- 4234, 4236, 4238, 4240, 4242, 4244, 4246, 4248, 4250, 4252, 4254, 4256,
- 4258, 4260, 4262, 4264, 4266, 4268, 4270, 4272, 4274, 4276, 4278, 4280,
- 4282, 4284, 4286, 4288, 4290, 4292, 4294, 4296, 4298, 4300, 4302, 4304,
- 4306, 4308, 4310, 4312, 4314, 4316, 4318, 4320, 4322, 4324, 4326, 4328,
- 4330, 4332, 4334, 4336, 4338, 4340, 4342, 4344, 4346, 4348, 4350, 4352,
- 4354, 4356, 4358, 4360, 4362, 4364, 4366, 4368, 4370, 4372, 4374, 4376,
- 4378, 4380, 4382, 4384, 4386, 4388, 4390, 4392, 4394, 4396, 4398, 4400,
- 4402, 4404, 4406, 4408, 4410, 4412, 4414, 4416, 4418, 4420, 4422, 4424,
- 4426, 4428, 4430, 4432, 4434, 4436, 4438, 4440, 4442, 4444, 4446, 4448,
- 4450, 4452, 4454, 4456, 4458, 4460, 4462, 4464, 4466, 4468, 4470, 4472,
- 4474, 4476, 4478, 4480, 4482, 4484, 4486, 4488, 4490, 4492, 4494, 4496,
- 4498, 4500, 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, 4502,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4535, 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, 4537, 0, 4539,
+ 4541, 4543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4545, 0,
+ 4548, 0, 4551, 0, 4554, 0, 4557, 0, 4560, 0, 4563, 0, 4566, 0, 4569, 0,
+ 4572, 0, 4575, 0, 4578, 0, 0, 4581, 0, 4584, 0, 4587, 0, 0, 0, 0, 0, 0,
+ 4590, 4593, 0, 4596, 4599, 0, 4602, 4605, 0, 4608, 4611, 0, 4614, 4617,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4620,
+ 0, 0, 0, 0, 0, 0, 4623, 4626, 0, 4629, 4632, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 4635, 0, 4638, 0, 4641, 0, 4644, 0, 4647, 0, 4650, 0, 4653, 0,
+ 4656, 0, 4659, 0, 4662, 0, 4665, 0, 4668, 0, 0, 4671, 0, 4674, 0, 4677,
+ 0, 0, 0, 0, 0, 0, 4680, 4683, 0, 4686, 4689, 0, 4692, 4695, 0, 4698,
+ 4701, 0, 4704, 4707, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 4710, 0, 0, 4713, 4716, 4719, 4722, 0, 0, 0, 4725, 4728,
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, 4504, 0, 4506, 4508, 4510, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 4512, 0, 4515, 0, 4518, 0, 4521, 0, 4524, 0, 4527,
- 0, 4530, 0, 4533, 0, 4536, 0, 4539, 0, 4542, 0, 4545, 0, 0, 4548, 0,
- 4551, 0, 4554, 0, 0, 0, 0, 0, 0, 4557, 4560, 0, 4563, 4566, 0, 4569,
- 4572, 0, 4575, 4578, 0, 4581, 4584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4587, 0, 0, 0, 0, 0, 0, 4590, 4593, 0,
- 4596, 4599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4602, 0, 4605, 0, 4608,
- 0, 4611, 0, 4614, 0, 4617, 0, 4620, 0, 4623, 0, 4626, 0, 4629, 0, 4632,
- 0, 4635, 0, 0, 4638, 0, 4641, 0, 4644, 0, 0, 0, 0, 0, 0, 4647, 4650, 0,
- 4653, 4656, 0, 4659, 4662, 0, 4665, 4668, 0, 4671, 4674, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4677, 0, 0, 4680,
- 4683, 4686, 4689, 0, 0, 0, 4692, 4695, 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, 4698, 4700, 4702, 4704, 4706,
- 4708, 4710, 4712, 4714, 4716, 4718, 4720, 4722, 4724, 4726, 4728, 4730,
- 4732, 4734, 4736, 4738, 4740, 4742, 4744, 4746, 4748, 4750, 4752, 4754,
- 4756, 4758, 4760, 4762, 4764, 4766, 4768, 4770, 4772, 4774, 4776, 4778,
- 4780, 4782, 4784, 4786, 4788, 4790, 4792, 4794, 4796, 4798, 4800, 4802,
- 4804, 4806, 4808, 4810, 4812, 4814, 4816, 4818, 4820, 4822, 4824, 4826,
- 4828, 4830, 4832, 4834, 4836, 4838, 4840, 4842, 4844, 4846, 4848, 4850,
- 4852, 4854, 4856, 4858, 4860, 4862, 4864, 4866, 4868, 4870, 4872, 4874,
- 4876, 4878, 4880, 4882, 4884, 0, 0, 0, 4886, 4888, 4890, 4892, 4894,
- 4896, 4898, 4900, 4902, 4904, 4906, 4908, 4910, 4912, 0, 0, 0, 0, 0, 0,
+ 0, 4731, 4733, 4735, 4737, 4739, 4741, 4743, 4745, 4747, 4749, 4751,
+ 4753, 4755, 4757, 4759, 4761, 4763, 4765, 4767, 4769, 4771, 4773, 4775,
+ 4777, 4779, 4781, 4783, 4785, 4787, 4789, 4791, 4793, 4795, 4797, 4799,
+ 4801, 4803, 4805, 4807, 4809, 4811, 4813, 4815, 4817, 4819, 4821, 4823,
+ 4825, 4827, 4829, 4831, 4833, 4835, 4837, 4839, 4841, 4843, 4845, 4847,
+ 4849, 4851, 4853, 4855, 4857, 4859, 4861, 4863, 4865, 4867, 4869, 4871,
+ 4873, 4875, 4877, 4879, 4881, 4883, 4885, 4887, 4889, 4891, 4893, 4895,
+ 4897, 4899, 4901, 4903, 4905, 4907, 4909, 4911, 4913, 4915, 4917, 0, 0,
+ 0, 4919, 4921, 4923, 4925, 4927, 4929, 4931, 4933, 4935, 4937, 4939,
+ 4941, 4943, 4945, 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, 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, 4914, 4918, 4922,
- 4926, 4930, 4934, 4938, 4942, 4946, 4950, 4954, 4958, 4962, 4966, 4970,
- 4975, 4980, 4985, 4990, 4995, 5000, 5005, 5010, 5015, 5020, 5025, 5030,
- 5035, 5040, 5045, 5053, 0, 5060, 5064, 5068, 5072, 5076, 5080, 5084,
- 5088, 5092, 5096, 5100, 5104, 5108, 5112, 5116, 5120, 5124, 5128, 5132,
- 5136, 5140, 5144, 5148, 5152, 5156, 5160, 5164, 5168, 5172, 5176, 5180,
- 5184, 5188, 5192, 5196, 5200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5204,
- 5208, 5211, 5214, 5217, 5220, 5223, 5226, 5229, 5232, 5235, 5238, 5241,
- 5244, 5247, 5250, 5253, 5255, 5257, 5259, 5261, 5263, 5265, 5267, 5269,
- 5271, 5273, 5275, 5277, 5279, 5281, 5284, 5287, 5290, 5293, 5296, 5299,
- 5302, 5305, 5308, 5311, 5314, 5317, 5320, 5323, 5329, 5334, 0, 5337,
- 5339, 5341, 5343, 5345, 5347, 5349, 5351, 5353, 5355, 5357, 5359, 5361,
- 5363, 5365, 5367, 5369, 5371, 5373, 5375, 5377, 5379, 5381, 5383, 5385,
- 5387, 5389, 5391, 5393, 5395, 5397, 5399, 5401, 5403, 5405, 5407, 5409,
- 5411, 5413, 5415, 5417, 5419, 5421, 5423, 5425, 5427, 5429, 5431, 5433,
- 5435, 5438, 5441, 5444, 5447, 5450, 5453, 5456, 5459, 5462, 5465, 5468,
- 5471, 5474, 5477, 5480, 5483, 5486, 5489, 5492, 5495, 5498, 5501, 5504,
- 5507, 5511, 5515, 5519, 5522, 5526, 5529, 5533, 5535, 5537, 5539, 5541,
- 5543, 5545, 5547, 5549, 5551, 5553, 5555, 5557, 5559, 5561, 5563, 5565,
- 5567, 5569, 5571, 5573, 5575, 5577, 5579, 5581, 5583, 5585, 5587, 5589,
- 5591, 5593, 5595, 5597, 5599, 5601, 5603, 5605, 5607, 5609, 5611, 5613,
- 5615, 5617, 5619, 5621, 5623, 5625, 0, 5627, 5632, 5637, 5642, 5646,
- 5651, 5655, 5659, 5665, 5670, 5674, 5678, 5682, 5687, 5692, 5696, 5700,
- 5703, 5707, 5712, 5717, 5720, 5726, 5733, 5739, 5743, 5749, 5755, 5760,
- 5764, 5768, 5772, 5777, 5783, 5788, 5792, 5796, 5800, 5803, 5806, 5809,
- 5812, 5816, 5820, 5826, 5830, 5835, 5841, 5845, 5848, 5851, 5857, 5862,
- 5868, 5872, 5878, 5881, 5885, 5889, 5893, 5897, 5901, 5906, 5910, 5913,
- 5917, 5921, 5925, 5930, 5934, 5938, 5942, 5948, 5953, 5956, 5962, 5965,
- 5970, 5975, 5979, 5983, 5987, 5992, 5995, 5999, 6004, 6007, 6013, 6017,
- 6020, 6023, 6026, 6029, 6032, 6035, 6038, 6041, 6044, 6047, 6051, 6055,
- 6059, 6063, 6067, 6071, 6075, 6079, 6083, 6087, 6091, 6095, 6099, 6103,
- 6107, 6111, 6114, 6117, 6121, 6124, 6127, 6130, 6134, 6138, 6141, 6144,
- 6147, 6150, 6153, 6158, 6161, 6164, 6167, 6170, 6173, 6176, 6179, 6182,
- 6186, 6191, 6194, 6197, 6200, 6203, 6206, 6209, 6212, 6216, 6220, 6224,
- 6228, 6231, 6234, 6237, 6240, 6243, 6246, 6249, 6252, 6255, 6258, 6262,
- 6266, 6269, 6273, 6277, 6281, 6284, 6288, 6292, 6297, 6300, 6304, 6308,
- 6312, 6316, 6322, 6329, 6332, 6335, 6338, 6341, 6344, 6347, 6350, 6353,
- 6356, 6359, 6362, 6365, 6368, 6371, 6374, 6377, 6380, 6383, 6388, 6391,
- 6394, 6397, 6402, 6406, 6409, 6412, 6415, 6418, 6421, 6424, 6427, 6430,
- 6433, 6436, 6440, 6443, 6446, 6450, 6454, 6457, 6462, 6466, 6469, 6472,
- 6475, 6478, 6482, 6486, 6489, 6492, 6495, 6498, 6501, 6504, 6507, 6510,
- 6513, 6517, 6521, 6525, 6529, 6533, 6537, 6541, 6545, 6549, 6553, 6557,
- 6561, 6565, 6569, 6573, 6577, 6581, 6585, 6589, 6593, 6597, 6601, 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, 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, 6605, 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, 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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6607, 6609, 6611, 6613,
- 6615, 6617, 6619, 6621, 6623, 6625, 6627, 6629, 6631, 6633, 6635, 6637,
- 6639, 6641, 6643, 6645, 6647, 6649, 6651, 6653, 6655, 6657, 6659, 6661,
- 6663, 6665, 6667, 6669, 6671, 6673, 6675, 6677, 6679, 6681, 6683, 6685,
- 6687, 6689, 6691, 6693, 6695, 6697, 6699, 6701, 6703, 6705, 6707, 6709,
- 6711, 6713, 6715, 6717, 6719, 6721, 6723, 6725, 6727, 6729, 6731, 6733,
- 6735, 6737, 6739, 6741, 6743, 6745, 6747, 6749, 6751, 6753, 6755, 6757,
- 6759, 6761, 6763, 6765, 6767, 6769, 6771, 6773, 6775, 6777, 6779, 6781,
- 6783, 6785, 6787, 6789, 6791, 6793, 6795, 6797, 6799, 6801, 6803, 6805,
- 6807, 6809, 6811, 6813, 6815, 6817, 6819, 6821, 6823, 6825, 6827, 6829,
- 6831, 6833, 6835, 6837, 6839, 6841, 6843, 6845, 6847, 6849, 6851, 6853,
- 6855, 6857, 6859, 6861, 6863, 6865, 6867, 6869, 6871, 6873, 6875, 6877,
- 6879, 6881, 6883, 6885, 6887, 6889, 6891, 6893, 6895, 6897, 6899, 6901,
- 6903, 6905, 6907, 6909, 6911, 6913, 6915, 6917, 6919, 6921, 6923, 6925,
- 6927, 6929, 6931, 6933, 6935, 6937, 6939, 6941, 6943, 6945, 6947, 6949,
- 6951, 6953, 6955, 6957, 6959, 6961, 6963, 6965, 6967, 6969, 6971, 6973,
- 6975, 6977, 6979, 6981, 6983, 6985, 6987, 6989, 6991, 6993, 6995, 6997,
- 6999, 7001, 7003, 7005, 7007, 7009, 7011, 7013, 7015, 7017, 7019, 7021,
- 7023, 7025, 7027, 7029, 7031, 7033, 7035, 7037, 7039, 7041, 7043, 7045,
- 7047, 7049, 7051, 7053, 7055, 7057, 7059, 7061, 7063, 7065, 7067, 7069,
- 7071, 7073, 7075, 7077, 7079, 7081, 7083, 7085, 7087, 7089, 7091, 7093,
- 7095, 7097, 7099, 7101, 7103, 7105, 7107, 7109, 7111, 7113, 7115, 7117,
- 7119, 7121, 7123, 7125, 7127, 7129, 7131, 7133, 7135, 7137, 7139, 7141,
- 7143, 7145, 0, 0, 7147, 0, 7149, 0, 0, 7151, 7153, 7155, 7157, 7159,
- 7161, 7163, 7165, 7167, 7169, 0, 7171, 0, 7173, 0, 0, 7175, 7177, 0, 0,
- 0, 7179, 7181, 7183, 7185, 0, 0, 7187, 7189, 7191, 7193, 7195, 7197,
- 7199, 7201, 7203, 7205, 7207, 7209, 7211, 7213, 7215, 7217, 7219, 7221,
- 7223, 7225, 7227, 7229, 7231, 7233, 7235, 7237, 7239, 7241, 7243, 7245,
- 7247, 7249, 7251, 7253, 7255, 7257, 7259, 7261, 7263, 7265, 7267, 7269,
- 7271, 7273, 7275, 7277, 7279, 7281, 7283, 7285, 7287, 7289, 7291, 7293,
- 7295, 7297, 7299, 7301, 7303, 0, 0, 0, 0, 0, 7305, 7307, 7309, 7311,
- 7313, 7315, 7317, 7319, 7321, 7323, 7325, 7327, 7329, 7331, 7333, 7335,
- 7337, 7339, 7341, 7343, 7345, 7347, 7349, 7351, 7353, 7355, 7357, 7359,
- 7361, 7363, 7365, 7367, 7369, 7371, 7373, 7375, 7377, 7379, 7381, 7383,
- 7385, 7387, 7389, 7391, 7393, 7395, 7397, 7399, 7401, 7403, 7405, 7407,
- 7409, 7411, 7413, 7415, 7417, 7419, 7421, 7423, 7425, 7427, 7429, 7431,
- 7433, 7435, 7437, 7439, 7441, 7443, 7445, 7447, 7449, 7451, 7453, 7455,
- 7457, 7459, 7461, 7463, 7465, 7467, 7469, 7471, 7473, 7475, 7477, 7479,
- 7481, 7483, 7485, 7487, 7489, 7491, 7493, 7495, 7497, 7499, 7501, 7503,
- 7505, 7507, 7509, 7511, 7513, 7515, 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, 7517, 7520, 7523, 7526, 7530, 7534, 7537, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7540, 7543, 7546, 7549, 7552, 0, 0, 0, 0, 0, 7555, 0, 7558,
- 7561, 7563, 7565, 7567, 7569, 7571, 7573, 7575, 7577, 7579, 7581, 7584,
- 7587, 7590, 7593, 7596, 7599, 7602, 7605, 7608, 7611, 7614, 7617, 0,
- 7620, 7623, 7626, 7629, 7632, 0, 7635, 0, 7638, 7641, 0, 7644, 7647, 0,
- 7650, 7653, 7656, 7659, 7662, 7665, 7668, 7671, 7674, 7677, 7680, 7682,
- 7684, 7686, 7688, 7690, 7692, 7694, 7696, 7698, 7700, 7702, 7704, 7706,
- 7708, 7710, 7712, 7714, 7716, 7718, 7720, 7722, 7724, 7726, 7728, 7730,
- 7732, 7734, 7736, 7738, 7740, 7742, 7744, 7746, 7748, 7750, 7752, 7754,
- 7756, 7758, 7760, 7762, 7764, 7766, 7768, 7770, 7772, 7774, 7776, 7778,
- 7780, 7782, 7784, 7786, 7788, 7790, 7792, 7794, 7796, 7798, 7800, 7802,
- 7804, 7806, 7808, 7810, 7812, 7814, 7816, 7818, 7820, 7822, 7824, 7826,
- 7828, 7830, 7832, 7834, 7836, 7838, 7840, 7842, 7844, 7846, 7848, 7850,
- 7852, 7854, 7856, 7858, 7860, 7862, 7864, 7866, 7868, 7870, 7872, 7874,
- 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, 7876, 7878, 7880, 7882, 7884, 7886, 7888,
- 7890, 7892, 7894, 7896, 7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912,
- 7914, 7916, 7918, 7920, 7922, 7925, 7928, 7931, 7934, 7937, 7940, 7943,
- 7946, 7949, 7952, 7955, 7958, 7961, 7964, 7967, 7970, 7973, 7976, 7978,
- 7980, 7982, 7984, 7987, 7990, 7993, 7996, 7999, 8002, 8005, 8008, 8011,
- 8014, 8017, 8020, 8023, 8026, 8029, 8032, 8035, 8038, 8041, 8044, 8047,
- 8050, 8053, 8056, 8059, 8062, 8065, 8068, 8071, 8074, 8077, 8080, 8083,
- 8086, 8089, 8092, 8095, 8098, 8101, 8104, 8107, 8110, 8113, 8116, 8119,
- 8122, 8125, 8128, 8131, 8134, 8137, 8140, 8143, 8146, 8149, 8152, 8155,
- 8158, 8161, 8164, 8167, 8170, 8173, 8176, 8179, 8182, 8185, 8188, 8191,
- 8194, 8197, 8200, 8203, 8206, 8209, 8212, 8215, 8218, 8221, 8224, 8227,
- 8230, 8233, 8236, 8239, 8242, 8245, 8248, 8251, 8254, 8257, 8260, 8263,
- 8266, 8270, 8274, 8278, 8282, 8286, 8290, 8293, 8296, 8299, 8302, 8305,
- 8308, 8311, 8314, 8317, 8320, 8323, 8326, 8329, 8332, 8335, 8338, 8341,
- 8344, 8347, 8350, 8353, 8356, 8359, 8362, 8365, 8368, 8371, 8374, 8377,
- 8380, 8383, 8386, 8389, 8392, 8395, 8398, 8401, 8404, 8407, 8410, 8413,
- 8416, 8419, 8422, 8425, 8428, 8431, 8434, 8437, 8440, 8443, 8446, 8449,
- 8452, 8455, 8458, 8461, 8464, 8467, 8470, 8473, 8476, 8479, 8482, 8485,
- 8488, 8491, 8494, 8497, 8500, 8503, 8506, 8509, 8512, 8515, 8518, 8521,
- 8524, 8527, 8530, 8533, 8536, 8539, 8542, 8545, 8548, 8551, 8554, 8557,
- 8560, 8563, 8566, 8569, 8572, 8575, 8578, 8581, 8584, 8587, 8590, 8593,
- 8596, 8599, 8602, 8605, 8608, 8611, 8614, 8617, 8620, 8623, 8626, 8629,
- 8632, 8635, 8638, 8641, 8644, 8647, 8650, 8653, 8656, 8659, 8662, 8665,
- 8668, 8671, 8674, 8677, 8680, 8683, 8686, 8689, 8692, 8695, 8698, 8701,
- 8704, 8707, 8710, 8713, 8716, 8720, 8724, 8728, 8731, 8734, 8737, 8740,
- 8743, 8746, 8749, 8752, 8755, 8758, 8761, 8764, 8767, 8770, 8773, 8776,
- 8779, 8782, 8785, 8788, 8791, 8794, 8797, 8800, 8803, 8806, 8809, 8812,
- 8815, 8818, 8821, 8824, 8827, 8830, 8833, 8836, 8839, 8842, 8845, 8848,
- 8851, 8854, 8857, 8860, 8863, 8866, 8869, 8872, 8875, 8878, 8881, 8884,
- 8887, 8890, 8893, 8896, 8899, 8902, 8905, 8908, 8911, 8914, 8917, 8920,
- 8923, 8926, 8929, 8932, 8935, 8938, 8941, 8944, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8947, 8951, 8955, 8959, 8963, 8967, 8971,
- 8975, 8979, 8983, 8987, 8991, 8995, 8999, 9003, 9007, 9011, 9015, 9019,
- 9023, 9027, 9031, 9035, 9039, 9043, 9047, 9051, 9055, 9059, 9063, 9067,
- 9071, 9075, 9079, 9083, 9087, 9091, 9095, 9099, 9103, 9107, 9111, 9115,
- 9119, 9123, 9127, 9131, 9135, 9139, 9143, 9147, 9151, 9155, 9159, 9163,
- 9167, 9171, 9175, 9179, 9183, 9187, 9191, 9195, 9199, 0, 0, 9203, 9207,
- 9211, 9215, 9219, 9223, 9227, 9231, 9235, 9239, 9243, 9247, 9251, 9255,
- 9259, 9263, 9267, 9271, 9275, 9279, 9283, 9287, 9291, 9295, 9299, 9303,
- 9307, 9311, 9315, 9319, 9323, 9327, 9331, 9335, 9339, 9343, 9347, 9351,
- 9355, 9359, 9363, 9367, 9371, 9375, 9379, 9383, 9387, 9391, 9395, 9399,
- 9403, 9407, 9411, 9415, 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,
- 9419, 9423, 9427, 9432, 9437, 9442, 9447, 9452, 9457, 9462, 9466, 9485,
- 9494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9499,
- 9501, 9503, 9505, 9507, 9509, 9511, 9513, 9515, 9517, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9519, 9521, 9523, 9525,
- 9527, 9529, 9531, 9533, 9535, 9537, 9539, 9541, 9543, 9545, 9547, 9549,
- 9551, 9553, 9555, 9557, 9559, 0, 0, 9561, 9563, 9565, 9567, 9569, 9571,
- 9573, 9575, 9577, 9579, 9581, 9583, 0, 9585, 9587, 9589, 9591, 9593,
- 9595, 9597, 9599, 9601, 9603, 9605, 9607, 9609, 9611, 9613, 9615, 9617,
- 9619, 9621, 0, 9623, 9625, 9627, 9629, 0, 0, 0, 0, 9631, 9634, 9637, 0,
- 9640, 0, 9643, 9646, 9649, 9652, 9655, 9658, 9661, 9664, 9667, 9670,
- 9673, 9675, 9677, 9679, 9681, 9683, 9685, 9687, 9689, 9691, 9693, 9695,
- 9697, 9699, 9701, 9703, 9705, 9707, 9709, 9711, 9713, 9715, 9717, 9719,
- 9721, 9723, 9725, 9727, 9729, 9731, 9733, 9735, 9737, 9739, 9741, 9743,
- 9745, 9747, 9749, 9751, 9753, 9755, 9757, 9759, 9761, 9763, 9765, 9767,
- 9769, 9771, 9773, 9775, 9777, 9779, 9781, 9783, 9785, 9787, 9789, 9791,
- 9793, 9795, 9797, 9799, 9801, 9803, 9805, 9807, 9809, 9811, 9813, 9815,
- 9817, 9819, 9821, 9823, 9825, 9827, 9829, 9831, 9833, 9835, 9837, 9839,
- 9841, 9843, 9845, 9847, 9849, 9851, 9853, 9855, 9857, 9859, 9861, 9863,
- 9865, 9867, 9869, 9871, 9873, 9875, 9877, 9879, 9881, 9883, 9885, 9887,
- 9889, 9891, 9893, 9895, 9897, 9899, 9901, 9903, 9905, 9907, 9910, 9913,
- 9916, 9919, 9922, 9925, 9928, 0, 0, 0, 0, 9931, 9933, 9935, 9937, 9939,
- 9941, 9943, 9945, 9947, 9949, 9951, 9953, 9955, 9957, 9959, 9961, 9963,
- 9965, 9967, 9969, 9971, 9973, 9975, 9977, 9979, 9981, 9983, 9985, 9987,
- 9989, 9991, 9993, 9995, 9997, 9999, 10001, 10003, 10005, 10007, 10009,
- 10011, 10013, 10015, 10017, 10019, 10021, 10023, 10025, 10027, 10029,
- 10031, 10033, 10035, 10037, 10039, 10041, 10043, 10045, 10047, 10049,
- 10051, 10053, 10055, 10057, 10059, 10061, 10063, 10065, 10067, 10069,
- 10071, 10073, 10075, 10077, 10079, 10081, 10083, 10085, 10087, 10089,
- 10091, 10093, 10095, 10097, 10099, 10101, 10103, 10105, 10107, 10109,
- 10111, 10113, 10115, 10117, 10119, 10121, 10123, 10125, 10127, 10129,
- 10131, 10133, 10135, 10137, 10139, 10141, 10143, 10145, 10147, 10149,
- 10151, 10153, 10155, 10157, 10159, 10161, 10163, 10165, 10167, 10169,
- 10171, 10173, 10175, 10177, 10179, 10181, 10183, 10185, 10187, 10189,
- 10191, 10193, 10195, 10197, 10199, 10201, 10203, 10205, 10207, 10209,
- 10211, 10213, 10215, 10217, 10219, 10221, 10223, 10225, 10227, 10229,
- 10231, 10233, 10235, 10237, 10239, 10241, 10243, 10245, 10247, 10249,
- 10251, 10253, 10255, 10257, 10259, 10261, 10263, 10265, 10267, 10269,
- 10271, 10273, 10275, 10277, 10279, 10281, 10283, 10285, 10287, 10289,
- 10291, 10293, 10295, 10297, 10299, 10301, 10303, 10305, 10307, 10309, 0,
- 0, 0, 10311, 10313, 10315, 10317, 10319, 10321, 0, 0, 10323, 10325,
- 10327, 10329, 10331, 10333, 0, 0, 10335, 10337, 10339, 10341, 10343,
- 10345, 0, 0, 10347, 10349, 10351, 0, 0, 0, 10353, 10355, 10357, 10359,
- 10361, 10363, 10365, 0, 10367, 10369, 10371, 10373, 10375, 10377, 10379,
- 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, 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, 10381, 10384, 10387, 10390,
- 10393, 10396, 10399, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10402,
- 10405, 10408, 10411, 10414, 10417, 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, 10420, 10422, 10424, 10426, 10428, 10430, 10432, 10434, 10436,
- 10438, 10440, 10442, 10444, 10446, 10448, 10450, 10452, 10454, 10456,
- 10458, 10460, 10462, 10464, 10466, 10468, 10470, 10472, 10474, 10476,
- 10478, 10480, 10482, 10484, 10486, 10488, 10490, 10492, 10494, 10496,
- 10498, 10500, 10502, 10504, 10506, 10508, 10510, 10512, 10514, 10516,
- 10518, 10520, 10522, 10524, 10526, 10528, 10530, 10532, 10534, 10536,
- 10538, 10540, 10542, 10544, 10546, 10548, 10550, 10552, 10554, 10556,
- 10558, 10560, 10562, 10564, 10566, 10568, 10570, 10572, 10574, 10576,
- 10578, 10580, 10582, 10584, 10586, 10588, 0, 10590, 10592, 10594, 10596,
- 10598, 10600, 10602, 10604, 10606, 10608, 10610, 10612, 10614, 10616,
- 10618, 10620, 10622, 10624, 10626, 10628, 10630, 10632, 10634, 10636,
- 10638, 10640, 10642, 10644, 10646, 10648, 10650, 10652, 10654, 10656,
- 10658, 10660, 10662, 10664, 10666, 10668, 10670, 10672, 10674, 10676,
- 10678, 10680, 10682, 10684, 10686, 10688, 10690, 10692, 10694, 10696,
- 10698, 10700, 10702, 10704, 10706, 10708, 10710, 10712, 10714, 10716,
- 10718, 10720, 10722, 10724, 10726, 10728, 10730, 0, 10732, 10734, 0, 0,
- 10736, 0, 0, 10738, 10740, 0, 0, 10742, 10744, 10746, 10748, 0, 10750,
- 10752, 10754, 10756, 10758, 10760, 10762, 10764, 10766, 10768, 10770,
- 10772, 0, 10774, 0, 10776, 10778, 10780, 10782, 10784, 10786, 10788, 0,
- 10790, 10792, 10794, 10796, 10798, 10800, 10802, 10804, 10806, 10808,
- 10810, 10812, 10814, 10816, 10818, 10820, 10822, 10824, 10826, 10828,
- 10830, 10832, 10834, 10836, 10838, 10840, 10842, 10844, 10846, 10848,
- 10850, 10852, 10854, 10856, 10858, 10860, 10862, 10864, 10866, 10868,
- 10870, 10872, 10874, 10876, 10878, 10880, 10882, 10884, 10886, 10888,
- 10890, 10892, 10894, 10896, 10898, 10900, 10902, 10904, 10906, 10908,
- 10910, 10912, 10914, 10916, 10918, 0, 10920, 10922, 10924, 10926, 0, 0,
- 10928, 10930, 10932, 10934, 10936, 10938, 10940, 10942, 0, 10944, 10946,
- 10948, 10950, 10952, 10954, 10956, 0, 10958, 10960, 10962, 10964, 10966,
- 10968, 10970, 10972, 10974, 10976, 10978, 10980, 10982, 10984, 10986,
- 10988, 10990, 10992, 10994, 10996, 10998, 11000, 11002, 11004, 11006,
- 11008, 11010, 11012, 0, 11014, 11016, 11018, 11020, 0, 11022, 11024,
- 11026, 11028, 11030, 0, 11032, 0, 0, 0, 11034, 11036, 11038, 11040,
- 11042, 11044, 11046, 0, 11048, 11050, 11052, 11054, 11056, 11058, 11060,
- 11062, 11064, 11066, 11068, 11070, 11072, 11074, 11076, 11078, 11080,
- 11082, 11084, 11086, 11088, 11090, 11092, 11094, 11096, 11098, 11100,
- 11102, 11104, 11106, 11108, 11110, 11112, 11114, 11116, 11118, 11120,
- 11122, 11124, 11126, 11128, 11130, 11132, 11134, 11136, 11138, 11140,
- 11142, 11144, 11146, 11148, 11150, 11152, 11154, 11156, 11158, 11160,
- 11162, 11164, 11166, 11168, 11170, 11172, 11174, 11176, 11178, 11180,
- 11182, 11184, 11186, 11188, 11190, 11192, 11194, 11196, 11198, 11200,
- 11202, 11204, 11206, 11208, 11210, 11212, 11214, 11216, 11218, 11220,
- 11222, 11224, 11226, 11228, 11230, 11232, 11234, 11236, 11238, 11240,
- 11242, 11244, 11246, 11248, 11250, 11252, 11254, 11256, 11258, 11260,
- 11262, 11264, 11266, 11268, 11270, 11272, 11274, 11276, 11278, 11280,
- 11282, 11284, 11286, 11288, 11290, 11292, 11294, 11296, 11298, 11300,
- 11302, 11304, 11306, 11308, 11310, 11312, 11314, 11316, 11318, 11320,
- 11322, 11324, 11326, 11328, 11330, 11332, 11334, 11336, 11338, 11340,
- 11342, 11344, 11346, 11348, 11350, 11352, 11354, 11356, 11358, 11360,
- 11362, 11364, 11366, 11368, 11370, 11372, 11374, 11376, 11378, 11380,
- 11382, 11384, 11386, 11388, 11390, 11392, 11394, 11396, 11398, 11400,
- 11402, 11404, 11406, 11408, 11410, 11412, 11414, 11416, 11418, 11420,
- 11422, 11424, 11426, 11428, 11430, 11432, 11434, 11436, 11438, 11440,
- 11442, 11444, 11446, 11448, 11450, 11452, 11454, 11456, 11458, 11460,
- 11462, 11464, 11466, 11468, 11470, 11472, 11474, 11476, 11478, 11480,
- 11482, 11484, 11486, 11488, 11490, 11492, 11494, 11496, 11498, 11500,
- 11502, 11504, 11506, 11508, 11510, 11512, 11514, 11516, 11518, 11520,
- 11522, 11524, 11526, 11528, 11530, 11532, 11534, 11536, 11538, 11540,
- 11542, 11544, 11546, 11548, 11550, 11552, 11554, 11556, 11558, 11560,
- 11562, 11564, 11566, 11568, 11570, 11572, 11574, 11576, 11578, 11580,
- 11582, 11584, 11586, 11588, 11590, 11592, 11594, 11596, 11598, 11600,
- 11602, 11604, 11606, 11608, 11610, 11612, 11614, 11616, 11618, 11620,
- 11622, 11624, 11626, 11628, 11630, 11632, 11634, 11636, 11638, 11640,
- 11642, 11644, 11646, 11648, 11650, 11652, 11654, 11656, 11658, 11660,
- 11662, 11664, 11666, 11668, 11670, 11672, 11674, 11676, 11678, 11680,
- 11682, 11684, 11686, 11688, 11690, 11692, 11694, 11696, 11698, 11700,
- 11702, 11704, 11706, 11708, 11710, 11712, 11714, 11716, 11718, 11720,
- 11722, 11724, 11726, 0, 0, 11728, 11730, 11732, 11734, 11736, 11738,
+ 0, 0, 0, 0, 0, 0, 4947, 4951, 4955, 4959, 4963, 4967, 4971, 4975, 4979,
+ 4983, 4987, 4991, 4995, 4999, 5003, 5008, 5013, 5018, 5023, 5028, 5033,
+ 5038, 5043, 5048, 5053, 5058, 5063, 5068, 5073, 5078, 5086, 0, 5093,
+ 5097, 5101, 5105, 5109, 5113, 5117, 5121, 5125, 5129, 5133, 5137, 5141,
+ 5145, 5149, 5153, 5157, 5161, 5165, 5169, 5173, 5177, 5181, 5185, 5189,
+ 5193, 5197, 5201, 5205, 5209, 5213, 5217, 5221, 5225, 5229, 5233, 5237,
+ 5239, 5241, 5243, 0, 0, 0, 0, 0, 0, 0, 0, 5245, 5249, 5252, 5255, 5258,
+ 5261, 5264, 5267, 5270, 5273, 5276, 5279, 5282, 5285, 5288, 5291, 5294,
+ 5296, 5298, 5300, 5302, 5304, 5306, 5308, 5310, 5312, 5314, 5316, 5318,
+ 5320, 5322, 5325, 5328, 5331, 5334, 5337, 5340, 5343, 5346, 5349, 5352,
+ 5355, 5358, 5361, 5364, 5370, 5375, 0, 5378, 5380, 5382, 5384, 5386,
+ 5388, 5390, 5392, 5394, 5396, 5398, 5400, 5402, 5404, 5406, 5408, 5410,
+ 5412, 5414, 5416, 5418, 5420, 5422, 5424, 5426, 5428, 5430, 5432, 5434,
+ 5436, 5438, 5440, 5442, 5444, 5446, 5448, 5450, 5452, 5454, 5456, 5458,
+ 5460, 5462, 5464, 5466, 5468, 5470, 5472, 5474, 5476, 5479, 5482, 5485,
+ 5488, 5491, 5494, 5497, 5500, 5503, 5506, 5509, 5512, 5515, 5518, 5521,
+ 5524, 5527, 5530, 5533, 5536, 5539, 5542, 5545, 5548, 5552, 5556, 5560,
+ 5563, 5567, 5570, 5574, 5576, 5578, 5580, 5582, 5584, 5586, 5588, 5590,
+ 5592, 5594, 5596, 5598, 5600, 5602, 5604, 5606, 5608, 5610, 5612, 5614,
+ 5616, 5618, 5620, 5622, 5624, 5626, 5628, 5630, 5632, 5634, 5636, 5638,
+ 5640, 5642, 5644, 5646, 5648, 5650, 5652, 5654, 5656, 5658, 5660, 5662,
+ 5664, 5666, 0, 5668, 5673, 5678, 5683, 5687, 5692, 5696, 5700, 5706,
+ 5711, 5715, 5719, 5723, 5728, 5733, 5737, 5741, 5744, 5748, 5753, 5758,
+ 5761, 5767, 5774, 5780, 5784, 5790, 5796, 5801, 5805, 5809, 5813, 5818,
+ 5824, 5829, 5833, 5837, 5841, 5844, 5847, 5850, 5853, 5857, 5861, 5867,
+ 5871, 5876, 5882, 5886, 5889, 5892, 5898, 5903, 5909, 5913, 5919, 5922,
+ 5926, 5930, 5934, 5938, 5942, 5947, 5951, 5954, 5958, 5962, 5966, 5971,
+ 5975, 5979, 5983, 5989, 5994, 5997, 6003, 6006, 6011, 6016, 6020, 6024,
+ 6028, 6033, 6036, 6040, 6045, 6048, 6054, 6058, 6061, 6064, 6067, 6070,
+ 6073, 6076, 6079, 6082, 6085, 6088, 6092, 6096, 6100, 6104, 6108, 6112,
+ 6116, 6120, 6124, 6128, 6132, 6136, 6140, 6144, 6148, 6152, 6155, 6158,
+ 6162, 6165, 6168, 6171, 6175, 6179, 6182, 6185, 6188, 6191, 6194, 6199,
+ 6202, 6205, 6208, 6211, 6214, 6217, 6220, 6223, 6227, 6232, 6235, 6238,
+ 6241, 6244, 6247, 6250, 6253, 6257, 6261, 6265, 6269, 6272, 6275, 6278,
+ 6281, 6284, 6287, 6290, 6293, 6296, 6299, 6303, 6307, 6310, 6314, 6318,
+ 6322, 6325, 6329, 6333, 6338, 6341, 6345, 6349, 6353, 6357, 6363, 6370,
+ 6373, 6376, 6379, 6382, 6385, 6388, 6391, 6394, 6397, 6400, 6403, 6406,
+ 6409, 6412, 6415, 6418, 6421, 6424, 6429, 6432, 6435, 6438, 6443, 6447,
+ 6450, 6453, 6456, 6459, 6462, 6465, 6468, 6471, 6474, 6477, 6481, 6484,
+ 6487, 6491, 6495, 6498, 6503, 6507, 6510, 6513, 6516, 6519, 6523, 6527,
+ 6530, 6533, 6536, 6539, 6542, 6545, 6548, 6551, 6554, 6558, 6562, 6566,
+ 6570, 6574, 6578, 6582, 6586, 6590, 6594, 6598, 6602, 6606, 6610, 6614,
+ 6618, 6622, 6626, 6630, 6634, 6638, 6642, 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, 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, 6646, 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,
+ 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 6648, 6650, 6652, 6654, 6656, 6658, 6660, 6662,
+ 6664, 6666, 6668, 6670, 6672, 6674, 6676, 6678, 6680, 6682, 6684, 6686,
+ 6688, 6690, 6692, 6694, 6696, 6698, 6700, 6702, 6704, 6706, 6708, 6710,
+ 6712, 6714, 6716, 6718, 6720, 6722, 6724, 6726, 6728, 6730, 6732, 6734,
+ 6736, 6738, 6740, 6742, 6744, 6746, 6748, 6750, 6752, 6754, 6756, 6758,
+ 6760, 6762, 6764, 6766, 6768, 6770, 6772, 6774, 6776, 6778, 6780, 6782,
+ 6784, 6786, 6788, 6790, 6792, 6794, 6796, 6798, 6800, 6802, 6804, 6806,
+ 6808, 6810, 6812, 6814, 6816, 6818, 6820, 6822, 6824, 6826, 6828, 6830,
+ 6832, 6834, 6836, 6838, 6840, 6842, 6844, 6846, 6848, 6850, 6852, 6854,
+ 6856, 6858, 6860, 6862, 6864, 6866, 6868, 6870, 6872, 6874, 6876, 6878,
+ 6880, 6882, 6884, 6886, 6888, 6890, 6892, 6894, 6896, 6898, 6900, 6902,
+ 6904, 6906, 6908, 6910, 6912, 6914, 6916, 6918, 6920, 6922, 6924, 6926,
+ 6928, 6930, 6932, 6934, 6936, 6938, 6940, 6942, 6944, 6946, 6948, 6950,
+ 6952, 6954, 6956, 6958, 6960, 6962, 6964, 6966, 6968, 6970, 6972, 6974,
+ 6976, 6978, 6980, 6982, 6984, 6986, 6988, 6990, 6992, 6994, 6996, 6998,
+ 7000, 7002, 7004, 7006, 7008, 7010, 7012, 7014, 7016, 7018, 7020, 7022,
+ 7024, 7026, 7028, 7030, 7032, 7034, 7036, 7038, 7040, 7042, 7044, 7046,
+ 7048, 7050, 7052, 7054, 7056, 7058, 7060, 7062, 7064, 7066, 7068, 7070,
+ 7072, 7074, 7076, 7078, 7080, 7082, 7084, 7086, 7088, 7090, 7092, 7094,
+ 7096, 7098, 7100, 7102, 7104, 7106, 7108, 7110, 7112, 7114, 7116, 7118,
+ 7120, 7122, 7124, 7126, 7128, 7130, 7132, 7134, 7136, 7138, 7140, 7142,
+ 7144, 7146, 7148, 7150, 7152, 7154, 7156, 7158, 7160, 7162, 7164, 7166,
+ 7168, 7170, 7172, 7174, 7176, 7178, 7180, 7182, 7184, 7186, 0, 0, 7188,
+ 0, 7190, 0, 0, 7192, 7194, 7196, 7198, 7200, 7202, 7204, 7206, 7208,
+ 7210, 0, 7212, 0, 7214, 0, 0, 7216, 7218, 0, 0, 0, 7220, 7222, 7224,
+ 7226, 0, 0, 7228, 7230, 7232, 7234, 7236, 7238, 7240, 7242, 7244, 7246,
+ 7248, 7250, 7252, 7254, 7256, 7258, 7260, 7262, 7264, 7266, 7268, 7270,
+ 7272, 7274, 7276, 7278, 7280, 7282, 7284, 7286, 7288, 7290, 7292, 7294,
+ 7296, 7298, 7300, 7302, 7304, 7306, 7308, 7310, 7312, 7314, 7316, 7318,
+ 7320, 7322, 7324, 7326, 7328, 7330, 7332, 7334, 7336, 7338, 7340, 7342,
+ 7344, 7346, 7348, 7350, 0, 0, 7352, 7354, 7356, 7358, 7360, 7362, 7364,
+ 7366, 7368, 7370, 7372, 7374, 7376, 7378, 7380, 7382, 7384, 7386, 7388,
+ 7390, 7392, 7394, 7396, 7398, 7400, 7402, 7404, 7406, 7408, 7410, 7412,
+ 7414, 7416, 7418, 7420, 7422, 7424, 7426, 7428, 7430, 7432, 7434, 7436,
+ 7438, 7440, 7442, 7444, 7446, 7448, 7450, 7452, 7454, 7456, 7458, 7460,
+ 7462, 7464, 7466, 7468, 7470, 7472, 7474, 7476, 7478, 7480, 7482, 7484,
+ 7486, 7488, 7490, 7492, 7494, 7496, 7498, 7500, 7502, 7504, 7506, 7508,
+ 7510, 7512, 7514, 7516, 7518, 7520, 7522, 7524, 7526, 7528, 7530, 7532,
+ 7534, 7536, 7538, 7540, 7542, 7544, 7546, 7548, 7550, 7552, 7554, 7556,
+ 7558, 7560, 7562, 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, 7564, 7567,
+ 7570, 7573, 7577, 7581, 7584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7587,
+ 7590, 7593, 7596, 7599, 0, 0, 0, 0, 0, 7602, 0, 7605, 7608, 7610, 7612,
+ 7614, 7616, 7618, 7620, 7622, 7624, 7626, 7628, 7631, 7634, 7637, 7640,
+ 7643, 7646, 7649, 7652, 7655, 7658, 7661, 7664, 0, 7667, 7670, 7673,
+ 7676, 7679, 0, 7682, 0, 7685, 7688, 0, 7691, 7694, 0, 7697, 7700, 7703,
+ 7706, 7709, 7712, 7715, 7718, 7721, 7724, 7727, 7729, 7731, 7733, 7735,
+ 7737, 7739, 7741, 7743, 7745, 7747, 7749, 7751, 7753, 7755, 7757, 7759,
+ 7761, 7763, 7765, 7767, 7769, 7771, 7773, 7775, 7777, 7779, 7781, 7783,
+ 7785, 7787, 7789, 7791, 7793, 7795, 7797, 7799, 7801, 7803, 7805, 7807,
+ 7809, 7811, 7813, 7815, 7817, 7819, 7821, 7823, 7825, 7827, 7829, 7831,
+ 7833, 7835, 7837, 7839, 7841, 7843, 7845, 7847, 7849, 7851, 7853, 7855,
+ 7857, 7859, 7861, 7863, 7865, 7867, 7869, 7871, 7873, 7875, 7877, 7879,
+ 7881, 7883, 7885, 7887, 7889, 7891, 7893, 7895, 7897, 7899, 7901, 7903,
+ 7905, 7907, 7909, 7911, 7913, 7915, 7917, 7919, 7921, 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, 7923, 7925, 7927, 7929, 7931, 7933, 7935, 7937, 7939, 7941,
+ 7943, 7945, 7947, 7949, 7951, 7953, 7955, 7957, 7959, 7961, 7963, 7965,
+ 7967, 7969, 7972, 7975, 7978, 7981, 7984, 7987, 7990, 7993, 7996, 7999,
+ 8002, 8005, 8008, 8011, 8014, 8017, 8020, 8023, 8025, 8027, 8029, 8031,
+ 8034, 8037, 8040, 8043, 8046, 8049, 8052, 8055, 8058, 8061, 8064, 8067,
+ 8070, 8073, 8076, 8079, 8082, 8085, 8088, 8091, 8094, 8097, 8100, 8103,
+ 8106, 8109, 8112, 8115, 8118, 8121, 8124, 8127, 8130, 8133, 8136, 8139,
+ 8142, 8145, 8148, 8151, 8154, 8157, 8160, 8163, 8166, 8169, 8172, 8175,
+ 8178, 8181, 8184, 8187, 8190, 8193, 8196, 8199, 8202, 8205, 8208, 8211,
+ 8214, 8217, 8220, 8223, 8226, 8229, 8232, 8235, 8238, 8241, 8244, 8247,
+ 8250, 8253, 8256, 8259, 8262, 8265, 8268, 8271, 8274, 8277, 8280, 8283,
+ 8286, 8289, 8292, 8295, 8298, 8301, 8304, 8307, 8310, 8313, 8317, 8321,
+ 8325, 8329, 8333, 8337, 8340, 8343, 8346, 8349, 8352, 8355, 8358, 8361,
+ 8364, 8367, 8370, 8373, 8376, 8379, 8382, 8385, 8388, 8391, 8394, 8397,
+ 8400, 8403, 8406, 8409, 8412, 8415, 8418, 8421, 8424, 8427, 8430, 8433,
+ 8436, 8439, 8442, 8445, 8448, 8451, 8454, 8457, 8460, 8463, 8466, 8469,
+ 8472, 8475, 8478, 8481, 8484, 8487, 8490, 8493, 8496, 8499, 8502, 8505,
+ 8508, 8511, 8514, 8517, 8520, 8523, 8526, 8529, 8532, 8535, 8538, 8541,
+ 8544, 8547, 8550, 8553, 8556, 8559, 8562, 8565, 8568, 8571, 8574, 8577,
+ 8580, 8583, 8586, 8589, 8592, 8595, 8598, 8601, 8604, 8607, 8610, 8613,
+ 8616, 8619, 8622, 8625, 8628, 8631, 8634, 8637, 8640, 8643, 8646, 8649,
+ 8652, 8655, 8658, 8661, 8664, 8667, 8670, 8673, 8676, 8679, 8682, 8685,
+ 8688, 8691, 8694, 8697, 8700, 8703, 8706, 8709, 8712, 8715, 8718, 8721,
+ 8724, 8727, 8730, 8733, 8736, 8739, 8742, 8745, 8748, 8751, 8754, 8757,
+ 8760, 8763, 8767, 8771, 8775, 8778, 8781, 8784, 8787, 8790, 8793, 8796,
+ 8799, 8802, 8805, 8808, 8811, 8814, 8817, 8820, 8823, 8826, 8829, 8832,
+ 8835, 8838, 8841, 8844, 8847, 8850, 8853, 8856, 8859, 8862, 8865, 8868,
+ 8871, 8874, 8877, 8880, 8883, 8886, 8889, 8892, 8895, 8898, 8901, 8904,
+ 8907, 8910, 8913, 8916, 8919, 8922, 8925, 8928, 8931, 8934, 8937, 8940,
+ 8943, 8946, 8949, 8952, 8955, 8958, 8961, 8964, 8967, 8970, 8973, 8976,
+ 8979, 8982, 8985, 8988, 8991, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 8994, 8998, 9002, 9006, 9010, 9014, 9018, 9022, 9026, 9030,
+ 9034, 9038, 9042, 9046, 9050, 9054, 9058, 9062, 9066, 9070, 9074, 9078,
+ 9082, 9086, 9090, 9094, 9098, 9102, 9106, 9110, 9114, 9118, 9122, 9126,
+ 9130, 9134, 9138, 9142, 9146, 9150, 9154, 9158, 9162, 9166, 9170, 9174,
+ 9178, 9182, 9186, 9190, 9194, 9198, 9202, 9206, 9210, 9214, 9218, 9222,
+ 9226, 9230, 9234, 9238, 9242, 9246, 0, 0, 9250, 9254, 9258, 9262, 9266,
+ 9270, 9274, 9278, 9282, 9286, 9290, 9294, 9298, 9302, 9306, 9310, 9314,
+ 9318, 9322, 9326, 9330, 9334, 9338, 9342, 9346, 9350, 9354, 9358, 9362,
+ 9366, 9370, 9374, 9378, 9382, 9386, 9390, 9394, 9398, 9402, 9406, 9410,
+ 9414, 9418, 9422, 9426, 9430, 9434, 9438, 9442, 9446, 9450, 9454, 9458,
+ 9462, 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, 9466, 9470, 9474,
+ 9479, 9484, 9489, 9494, 9499, 9504, 9509, 9513, 9532, 9541, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9546, 9548, 9550, 9552,
+ 9554, 9556, 9558, 9560, 9562, 9564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9566, 9568, 9570, 9572, 9574, 9576, 9578,
+ 9580, 9582, 9584, 9586, 9588, 9590, 9592, 9594, 9596, 9598, 9600, 9602,
+ 9604, 9606, 0, 0, 9608, 9610, 9612, 9614, 9616, 9618, 9620, 9622, 9624,
+ 9626, 9628, 9630, 0, 9632, 9634, 9636, 9638, 9640, 9642, 9644, 9646,
+ 9648, 9650, 9652, 9654, 9656, 9658, 9660, 9662, 9664, 9666, 9668, 0,
+ 9670, 9672, 9674, 9676, 0, 0, 0, 0, 9678, 9681, 9684, 0, 9687, 0, 9690,
+ 9693, 9696, 9699, 9702, 9705, 9708, 9711, 9714, 9717, 9720, 9722, 9724,
+ 9726, 9728, 9730, 9732, 9734, 9736, 9738, 9740, 9742, 9744, 9746, 9748,
+ 9750, 9752, 9754, 9756, 9758, 9760, 9762, 9764, 9766, 9768, 9770, 9772,
+ 9774, 9776, 9778, 9780, 9782, 9784, 9786, 9788, 9790, 9792, 9794, 9796,
+ 9798, 9800, 9802, 9804, 9806, 9808, 9810, 9812, 9814, 9816, 9818, 9820,
+ 9822, 9824, 9826, 9828, 9830, 9832, 9834, 9836, 9838, 9840, 9842, 9844,
+ 9846, 9848, 9850, 9852, 9854, 9856, 9858, 9860, 9862, 9864, 9866, 9868,
+ 9870, 9872, 9874, 9876, 9878, 9880, 9882, 9884, 9886, 9888, 9890, 9892,
+ 9894, 9896, 9898, 9900, 9902, 9904, 9906, 9908, 9910, 9912, 9914, 9916,
+ 9918, 9920, 9922, 9924, 9926, 9928, 9930, 9932, 9934, 9936, 9938, 9940,
+ 9942, 9944, 9946, 9948, 9950, 9952, 9954, 9957, 9960, 9963, 9966, 9969,
+ 9972, 9975, 0, 0, 0, 0, 9978, 9980, 9982, 9984, 9986, 9988, 9990, 9992,
+ 9994, 9996, 9998, 10000, 10002, 10004, 10006, 10008, 10010, 10012, 10014,
+ 10016, 10018, 10020, 10022, 10024, 10026, 10028, 10030, 10032, 10034,
+ 10036, 10038, 10040, 10042, 10044, 10046, 10048, 10050, 10052, 10054,
+ 10056, 10058, 10060, 10062, 10064, 10066, 10068, 10070, 10072, 10074,
+ 10076, 10078, 10080, 10082, 10084, 10086, 10088, 10090, 10092, 10094,
+ 10096, 10098, 10100, 10102, 10104, 10106, 10108, 10110, 10112, 10114,
+ 10116, 10118, 10120, 10122, 10124, 10126, 10128, 10130, 10132, 10134,
+ 10136, 10138, 10140, 10142, 10144, 10146, 10148, 10150, 10152, 10154,
+ 10156, 10158, 10160, 10162, 10164, 10166, 10168, 10170, 10172, 10174,
+ 10176, 10178, 10180, 10182, 10184, 10186, 10188, 10190, 10192, 10194,
+ 10196, 10198, 10200, 10202, 10204, 10206, 10208, 10210, 10212, 10214,
+ 10216, 10218, 10220, 10222, 10224, 10226, 10228, 10230, 10232, 10234,
+ 10236, 10238, 10240, 10242, 10244, 10246, 10248, 10250, 10252, 10254,
+ 10256, 10258, 10260, 10262, 10264, 10266, 10268, 10270, 10272, 10274,
+ 10276, 10278, 10280, 10282, 10284, 10286, 10288, 10290, 10292, 10294,
+ 10296, 10298, 10300, 10302, 10304, 10306, 10308, 10310, 10312, 10314,
+ 10316, 10318, 10320, 10322, 10324, 10326, 10328, 10330, 10332, 10334,
+ 10336, 10338, 10340, 10342, 10344, 10346, 10348, 10350, 10352, 10354,
+ 10356, 0, 0, 0, 10358, 10360, 10362, 10364, 10366, 10368, 0, 0, 10370,
+ 10372, 10374, 10376, 10378, 10380, 0, 0, 10382, 10384, 10386, 10388,
+ 10390, 10392, 0, 0, 10394, 10396, 10398, 0, 0, 0, 10400, 10402, 10404,
+ 10406, 10408, 10410, 10412, 0, 10414, 10416, 10418, 10420, 10422, 10424,
+ 10426, 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, 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, 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, 10428, 0, 10431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 10434, 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, 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, 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, 10437, 10440, 10443, 10446, 10449,
+ 10452, 10455, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10458, 10461,
+ 10464, 10467, 10470, 10473, 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,
+ 10476, 10478, 10480, 10482, 10484, 10486, 10488, 10490, 10492, 10494,
+ 10496, 10498, 10500, 10502, 10504, 10506, 10508, 10510, 10512, 10514,
+ 10516, 10518, 10520, 10522, 10524, 10526, 10528, 10530, 10532, 10534,
+ 10536, 10538, 10540, 10542, 10544, 10546, 10548, 10550, 10552, 10554,
+ 10556, 10558, 10560, 10562, 10564, 10566, 10568, 10570, 10572, 10574,
+ 10576, 10578, 10580, 10582, 10584, 10586, 10588, 10590, 10592, 10594,
+ 10596, 10598, 10600, 10602, 10604, 10606, 10608, 10610, 10612, 10614,
+ 10616, 10618, 10620, 10622, 10624, 10626, 10628, 10630, 10632, 10634,
+ 10636, 10638, 10640, 10642, 10644, 0, 10646, 10648, 10650, 10652, 10654,
+ 10656, 10658, 10660, 10662, 10664, 10666, 10668, 10670, 10672, 10674,
+ 10676, 10678, 10680, 10682, 10684, 10686, 10688, 10690, 10692, 10694,
+ 10696, 10698, 10700, 10702, 10704, 10706, 10708, 10710, 10712, 10714,
+ 10716, 10718, 10720, 10722, 10724, 10726, 10728, 10730, 10732, 10734,
+ 10736, 10738, 10740, 10742, 10744, 10746, 10748, 10750, 10752, 10754,
+ 10756, 10758, 10760, 10762, 10764, 10766, 10768, 10770, 10772, 10774,
+ 10776, 10778, 10780, 10782, 10784, 10786, 0, 10788, 10790, 0, 0, 10792,
+ 0, 0, 10794, 10796, 0, 0, 10798, 10800, 10802, 10804, 0, 10806, 10808,
+ 10810, 10812, 10814, 10816, 10818, 10820, 10822, 10824, 10826, 10828, 0,
+ 10830, 0, 10832, 10834, 10836, 10838, 10840, 10842, 10844, 0, 10846,
+ 10848, 10850, 10852, 10854, 10856, 10858, 10860, 10862, 10864, 10866,
+ 10868, 10870, 10872, 10874, 10876, 10878, 10880, 10882, 10884, 10886,
+ 10888, 10890, 10892, 10894, 10896, 10898, 10900, 10902, 10904, 10906,
+ 10908, 10910, 10912, 10914, 10916, 10918, 10920, 10922, 10924, 10926,
+ 10928, 10930, 10932, 10934, 10936, 10938, 10940, 10942, 10944, 10946,
+ 10948, 10950, 10952, 10954, 10956, 10958, 10960, 10962, 10964, 10966,
+ 10968, 10970, 10972, 10974, 0, 10976, 10978, 10980, 10982, 0, 0, 10984,
+ 10986, 10988, 10990, 10992, 10994, 10996, 10998, 0, 11000, 11002, 11004,
+ 11006, 11008, 11010, 11012, 0, 11014, 11016, 11018, 11020, 11022, 11024,
+ 11026, 11028, 11030, 11032, 11034, 11036, 11038, 11040, 11042, 11044,
+ 11046, 11048, 11050, 11052, 11054, 11056, 11058, 11060, 11062, 11064,
+ 11066, 11068, 0, 11070, 11072, 11074, 11076, 0, 11078, 11080, 11082,
+ 11084, 11086, 0, 11088, 0, 0, 0, 11090, 11092, 11094, 11096, 11098,
+ 11100, 11102, 0, 11104, 11106, 11108, 11110, 11112, 11114, 11116, 11118,
+ 11120, 11122, 11124, 11126, 11128, 11130, 11132, 11134, 11136, 11138,
+ 11140, 11142, 11144, 11146, 11148, 11150, 11152, 11154, 11156, 11158,
+ 11160, 11162, 11164, 11166, 11168, 11170, 11172, 11174, 11176, 11178,
+ 11180, 11182, 11184, 11186, 11188, 11190, 11192, 11194, 11196, 11198,
+ 11200, 11202, 11204, 11206, 11208, 11210, 11212, 11214, 11216, 11218,
+ 11220, 11222, 11224, 11226, 11228, 11230, 11232, 11234, 11236, 11238,
+ 11240, 11242, 11244, 11246, 11248, 11250, 11252, 11254, 11256, 11258,
+ 11260, 11262, 11264, 11266, 11268, 11270, 11272, 11274, 11276, 11278,
+ 11280, 11282, 11284, 11286, 11288, 11290, 11292, 11294, 11296, 11298,
+ 11300, 11302, 11304, 11306, 11308, 11310, 11312, 11314, 11316, 11318,
+ 11320, 11322, 11324, 11326, 11328, 11330, 11332, 11334, 11336, 11338,
+ 11340, 11342, 11344, 11346, 11348, 11350, 11352, 11354, 11356, 11358,
+ 11360, 11362, 11364, 11366, 11368, 11370, 11372, 11374, 11376, 11378,
+ 11380, 11382, 11384, 11386, 11388, 11390, 11392, 11394, 11396, 11398,
+ 11400, 11402, 11404, 11406, 11408, 11410, 11412, 11414, 11416, 11418,
+ 11420, 11422, 11424, 11426, 11428, 11430, 11432, 11434, 11436, 11438,
+ 11440, 11442, 11444, 11446, 11448, 11450, 11452, 11454, 11456, 11458,
+ 11460, 11462, 11464, 11466, 11468, 11470, 11472, 11474, 11476, 11478,
+ 11480, 11482, 11484, 11486, 11488, 11490, 11492, 11494, 11496, 11498,
+ 11500, 11502, 11504, 11506, 11508, 11510, 11512, 11514, 11516, 11518,
+ 11520, 11522, 11524, 11526, 11528, 11530, 11532, 11534, 11536, 11538,
+ 11540, 11542, 11544, 11546, 11548, 11550, 11552, 11554, 11556, 11558,
+ 11560, 11562, 11564, 11566, 11568, 11570, 11572, 11574, 11576, 11578,
+ 11580, 11582, 11584, 11586, 11588, 11590, 11592, 11594, 11596, 11598,
+ 11600, 11602, 11604, 11606, 11608, 11610, 11612, 11614, 11616, 11618,
+ 11620, 11622, 11624, 11626, 11628, 11630, 11632, 11634, 11636, 11638,
+ 11640, 11642, 11644, 11646, 11648, 11650, 11652, 11654, 11656, 11658,
+ 11660, 11662, 11664, 11666, 11668, 11670, 11672, 11674, 11676, 11678,
+ 11680, 11682, 11684, 11686, 11688, 11690, 11692, 11694, 11696, 11698,
+ 11700, 11702, 11704, 11706, 11708, 11710, 11712, 11714, 11716, 11718,
+ 11720, 11722, 11724, 11726, 11728, 11730, 11732, 11734, 11736, 11738,
11740, 11742, 11744, 11746, 11748, 11750, 11752, 11754, 11756, 11758,
11760, 11762, 11764, 11766, 11768, 11770, 11772, 11774, 11776, 11778,
- 11780, 11782, 11784, 11786, 11788, 11790, 11792, 11794, 11796, 11798,
- 11800, 11802, 11804, 11806, 11808, 11810, 11812, 11814, 11816, 11818,
- 11820, 11822, 11824, 11826, 11828, 11830, 11832, 11834, 11836, 11838,
- 11840, 11842, 11844, 11846, 11848, 11850, 11852, 11854, 11856, 11858,
- 11860, 11862, 11864, 11866, 11868, 11870, 11872, 11874, 11876, 11878,
- 11880, 11882, 11884, 11886, 11888, 11890, 11892, 11894, 11896, 11898,
- 11900, 11902, 11904, 11906, 11908, 11910, 11912, 11914, 11916, 11918,
- 11920, 11922, 11924, 11926, 11928, 11930, 11932, 11934, 11936, 11938,
- 11940, 11942, 11944, 11946, 11948, 11950, 11952, 11954, 11956, 11958,
- 11960, 11962, 11964, 11966, 11968, 11970, 11972, 11974, 11976, 11978,
- 11980, 11982, 11984, 11986, 11988, 11990, 11992, 11994, 11996, 11998,
- 12000, 12002, 12004, 12006, 12008, 12010, 12012, 12014, 12016, 12018,
- 12020, 12022, 12024, 12026, 12028, 12030, 12032, 12034, 12036, 12038,
- 12040, 12042, 12044, 12046, 12048, 12050, 12052, 12054, 12056, 12058,
- 12060, 12062, 12064, 12066, 12068, 12070, 12072, 12074, 12076, 12078,
- 12080, 12082, 12084, 12086, 12088, 12090, 12092, 12094, 12096, 12098,
- 12100, 12102, 12104, 12106, 12108, 12110, 12112, 12114, 12116, 12118,
- 12120, 12122, 12124, 12126, 12128, 12130, 12132, 12134, 12136, 12138,
- 12140, 12142, 12144, 12146, 12148, 12150, 12152, 12154, 12156, 12158,
- 12160, 12162, 12164, 12166, 12168, 12170, 12172, 12174, 12176, 12178,
- 12180, 12182, 12184, 12186, 12188, 12190, 12192, 12194, 12196, 12198,
- 12200, 12202, 12204, 12206, 12208, 12210, 12212, 12214, 12216, 12218,
- 12220, 12222, 12224, 12226, 12228, 12230, 12232, 12234, 12236, 12238,
- 12240, 12242, 12244, 12246, 12248, 12250, 12252, 12254, 12256, 12258,
- 12260, 12262, 12264, 12266, 12268, 12270, 12272, 12274, 12276, 12278,
- 12280, 12282, 12284, 12286, 12288, 12290, 12292, 12294, 12296, 12298,
- 12300, 12302, 12304, 12306, 12308, 12310, 0, 0, 12312, 12314, 12316,
+ 11780, 11782, 0, 0, 11784, 11786, 11788, 11790, 11792, 11794, 11796,
+ 11798, 11800, 11802, 11804, 11806, 11808, 11810, 11812, 11814, 11816,
+ 11818, 11820, 11822, 11824, 11826, 11828, 11830, 11832, 11834, 11836,
+ 11838, 11840, 11842, 11844, 11846, 11848, 11850, 11852, 11854, 11856,
+ 11858, 11860, 11862, 11864, 11866, 11868, 11870, 11872, 11874, 11876,
+ 11878, 11880, 11882, 11884, 11886, 11888, 11890, 11892, 11894, 11896,
+ 11898, 11900, 11902, 11904, 11906, 11908, 11910, 11912, 11914, 11916,
+ 11918, 11920, 11922, 11924, 11926, 11928, 11930, 11932, 11934, 11936,
+ 11938, 11940, 11942, 11944, 11946, 11948, 11950, 11952, 11954, 11956,
+ 11958, 11960, 11962, 11964, 11966, 11968, 11970, 11972, 11974, 11976,
+ 11978, 11980, 11982, 11984, 11986, 11988, 11990, 11992, 11994, 11996,
+ 11998, 12000, 12002, 12004, 12006, 12008, 12010, 12012, 12014, 12016,
+ 12018, 12020, 12022, 12024, 12026, 12028, 12030, 12032, 12034, 12036,
+ 12038, 12040, 12042, 12044, 12046, 12048, 12050, 12052, 12054, 12056,
+ 12058, 12060, 12062, 12064, 12066, 12068, 12070, 12072, 12074, 12076,
+ 12078, 12080, 12082, 12084, 12086, 12088, 12090, 12092, 12094, 12096,
+ 12098, 12100, 12102, 12104, 12106, 12108, 12110, 12112, 12114, 12116,
+ 12118, 12120, 12122, 12124, 12126, 12128, 12130, 12132, 12134, 12136,
+ 12138, 12140, 12142, 12144, 12146, 12148, 12150, 12152, 12154, 12156,
+ 12158, 12160, 12162, 12164, 12166, 12168, 12170, 12172, 12174, 12176,
+ 12178, 12180, 12182, 12184, 12186, 12188, 12190, 12192, 12194, 12196,
+ 12198, 12200, 12202, 12204, 12206, 12208, 12210, 12212, 12214, 12216,
+ 12218, 12220, 12222, 12224, 12226, 12228, 12230, 12232, 12234, 12236,
+ 12238, 12240, 12242, 12244, 12246, 12248, 12250, 12252, 12254, 12256,
+ 12258, 12260, 12262, 12264, 12266, 12268, 12270, 12272, 12274, 12276,
+ 12278, 12280, 12282, 12284, 12286, 12288, 12290, 12292, 12294, 12296,
+ 12298, 12300, 12302, 12304, 12306, 12308, 12310, 12312, 12314, 12316,
12318, 12320, 12322, 12324, 12326, 12328, 12330, 12332, 12334, 12336,
12338, 12340, 12342, 12344, 12346, 12348, 12350, 12352, 12354, 12356,
- 12358, 12360, 12362, 12364, 12366, 12368, 12370, 12372, 12374, 12376,
- 12378, 12380, 12382, 12384, 12386, 12388, 12390, 12392, 12394, 12396,
- 12398, 12400, 12402, 12404, 12406, 12408, 12410, 12412, 12414, 12416,
- 12418, 12420, 12422, 12424, 12426, 12428, 12430, 12432, 12434, 12436,
- 12438, 12440, 12442, 12444, 12446, 12448, 12450, 12452, 12454, 12456,
- 12458, 12460, 12462, 12464, 12466, 12468, 12470, 12472, 12474, 12476,
- 12478, 12480, 12482, 12484, 12486, 12488, 12490, 12492, 12494, 12496,
- 12498, 12500, 12502, 12504, 12506, 12508, 12510, 12512, 12514, 12516,
- 12518, 12520, 12522, 12524, 12526, 12528, 12530, 12532, 12534, 12536,
- 12538, 12540, 12542, 12544, 12546, 12548, 12550, 12552, 12554, 12556,
- 12558, 12560, 12562, 12564, 12566, 12568, 12570, 12572, 12574, 12576,
- 12578, 12580, 12582, 12584, 12586, 12588, 12590, 12592, 12594, 12596,
- 12598, 12600, 12602, 12604, 12606, 12608, 12610, 12612, 12614, 12616,
- 12618, 12620, 12622, 12624, 12626, 12628, 12630, 12632, 12634, 12636,
- 12638, 12640, 12642, 12644, 12646, 12648, 12650, 12652, 12654, 12656,
- 12658, 12660, 12662, 12664, 12666, 12668, 12670, 12672, 12674, 12676,
- 12678, 12680, 12682, 12684, 12686, 12688, 12690, 12692, 12694, 12696,
- 12698, 12700, 12702, 12704, 12706, 12708, 12710, 12712, 12714, 12716,
- 12718, 12720, 12722, 12724, 12726, 12728, 12730, 12732, 12734, 12736,
- 12738, 12740, 12742, 12744, 12746, 12748, 12750, 12752, 12754, 12756,
- 12758, 12760, 12762, 12764, 12766, 12768, 12770, 12772, 12774, 12776,
- 12778, 12780, 12782, 12784, 12786, 12788, 12790, 12792, 12794, 12796,
- 12798, 12800, 12802, 12804, 12806, 12808, 12810, 12812, 12814, 12816,
- 12818, 12820, 12822, 12824, 12826, 12828, 12830, 12832, 12834, 12836,
- 12838, 12840, 12842, 12844, 12846, 12848, 12850, 12852, 12854, 12856,
- 12858, 12860, 12862, 12864, 12866, 12868, 12870, 12872, 12874, 12876,
- 12878, 12880, 12882, 12884, 12886, 12888, 12890, 12892, 12894, 12896,
- 12898, 12900, 12902, 12904, 12906, 12908, 12910, 12912, 12914, 12916,
- 12918, 12920, 12922, 12924, 12926, 12928, 12930, 12932, 12934, 12936,
- 12938, 12940, 12942, 12944, 12946, 12948, 12950, 12952, 12954, 12956,
- 12958, 12960, 12962, 12964, 12966, 12968, 12970, 12972, 12974, 12976,
- 12978, 12980, 12982, 12984, 12986, 12988, 12990, 12992, 12994, 12996,
- 12998, 13000, 13002, 13004, 13006, 13008, 13010, 13012, 13014, 13016,
- 13018, 13020, 13022, 13024, 13026, 13028, 13030, 13032, 13034, 13036,
- 13038, 13040, 13042, 13044, 13046, 13048, 13050, 13052, 13054, 13056,
- 13058, 13060, 13062, 13064, 13066, 13068, 13070, 13072, 13074, 13076,
- 13078, 13080, 13082, 13084, 13086, 13088, 13090, 13092, 13094, 13096,
- 13098, 13100, 13102, 13104, 13106, 13108, 13110, 13112, 13114, 13116,
- 13118, 13120, 13122, 13124, 13126, 13128, 13130, 13132, 13134, 13136,
- 13138, 13140, 13142, 13144, 13146, 13148, 13150, 13152, 13154, 13156,
- 13158, 13160, 13162, 13164, 13166, 13168, 13170, 13172, 13174, 13176,
- 13178, 13180, 13182, 13184, 13186, 13188, 13190, 13192, 13194, 13196,
- 13198, 13200, 13202, 13204, 13206, 13208, 13210, 13212, 13214, 13216,
- 13218, 13220, 13222, 13224, 13226, 13228, 13230, 13232, 13234, 13236,
- 13238, 13240, 13242, 13244, 13246, 13248, 13250, 13252, 13254, 13256,
- 13258, 13260, 13262, 13264, 13266, 13268, 13270, 13272, 13274, 13276,
- 13278, 13280, 13282, 13284, 13286, 13288, 13290, 13292, 13294, 13296,
- 13298, 13300, 13302, 13304, 13306, 13308, 13310, 13312, 13314, 13316,
- 13318, 13320, 13322, 13324, 13326, 13328, 13330, 13332, 13334, 13336,
- 13338, 13340, 13342, 13344, 13346, 13348, 13350, 13352, 13354, 13356,
- 13358, 13360, 13362, 13364, 13366, 13368, 13370, 13372, 13374, 13376,
- 13378, 13380, 13382, 13384, 13386, 13388, 13390, 13392, 13394, 13396,
- 13398, 13400, 13402, 13404, 13406, 13408, 13410, 13412, 13414, 13416,
- 13418, 13420, 13422, 13424, 13426, 13428, 13430, 13432, 13434, 13436,
- 13438, 13440, 13442, 13444, 13446, 13448, 13450, 13452, 13454, 13456,
- 13458, 13460, 13462, 13464, 13466, 13468, 13470, 13472, 13474, 13476,
- 13478, 13480, 13482, 13484, 13486, 13488, 13490, 13492, 13494, 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, 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, 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, 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,
+ 12358, 12360, 12362, 12364, 12366, 0, 0, 12368, 12370, 12372, 12374,
+ 12376, 12378, 12380, 12382, 12384, 12386, 12388, 12390, 12392, 12394,
+ 12396, 12398, 12400, 12402, 12404, 12406, 12408, 12410, 12412, 12414,
+ 12416, 12418, 12420, 12422, 12424, 12426, 12428, 12430, 12432, 12434,
+ 12436, 12438, 12440, 12442, 12444, 12446, 12448, 12450, 12452, 12454,
+ 12456, 12458, 12460, 12462, 12464, 12466, 12468, 12471, 12474, 12477,
+ 12480, 12483, 12486, 12489, 12492, 12495, 12498, 0, 0, 0, 0, 0, 12501,
+ 12505, 12509, 12513, 12517, 12521, 12525, 12529, 12533, 12537, 12541,
+ 12545, 12549, 12553, 12557, 12561, 12565, 12569, 12573, 12577, 12581,
+ 12585, 12589, 12593, 12597, 12601, 12605, 12609, 12611, 12613, 12616, 0,
+ 12619, 12621, 12623, 12625, 12627, 12629, 12631, 12633, 12635, 12637,
+ 12639, 12641, 12643, 12645, 12647, 12649, 12651, 12653, 12655, 12657,
+ 12659, 12661, 12663, 12665, 12667, 12669, 12671, 12674, 12677, 12680,
+ 12683, 12687, 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, 12690, 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, 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, 12693, 12696, 12699, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 12701, 12703, 12705, 12707, 12709, 12711,
+ 12713, 12715, 12717, 12719, 12721, 12723, 12725, 12727, 12729, 12731,
+ 12733, 12735, 12737, 12739, 12741, 12743, 12745, 12747, 12749, 12751,
+ 12753, 12755, 12757, 12759, 12761, 12763, 12765, 12767, 12769, 12771,
+ 12773, 12775, 12777, 12779, 12781, 12783, 12785, 0, 0, 0, 0, 0, 12787,
+ 12791, 12795, 12799, 12803, 12807, 12811, 12815, 12819, 0, 0, 0, 0, 0, 0,
+ 0, 12823, 12825, 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, 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, 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, 12827, 12829, 12831, 12833, 12835,
+ 12837, 12839, 12841, 12843, 12845, 12847, 12849, 12851, 12853, 12855,
+ 12857, 12859, 12861, 12863, 12865, 12867, 12869, 12871, 12873, 12875,
+ 12877, 12879, 12881, 12883, 12885, 12887, 12889, 12891, 12893, 12895,
+ 12897, 12899, 12901, 12903, 12905, 12907, 12909, 12911, 12913, 12915,
+ 12917, 12919, 12921, 12923, 12925, 12927, 12929, 12931, 12933, 12935,
+ 12937, 12939, 12941, 12943, 12945, 12947, 12949, 12951, 12953, 12955,
+ 12957, 12959, 12961, 12963, 12965, 12967, 12969, 12971, 12973, 12975,
+ 12977, 12979, 12981, 12983, 12985, 12987, 12989, 12991, 12993, 12995,
+ 12997, 12999, 13001, 13003, 13005, 13007, 13009, 13011, 13013, 13015,
+ 13017, 13019, 13021, 13023, 13025, 13027, 13029, 13031, 13033, 13035,
+ 13037, 13039, 13041, 13043, 13045, 13047, 13049, 13051, 13053, 13055,
+ 13057, 13059, 13061, 13063, 13065, 13067, 13069, 13071, 13073, 13075,
+ 13077, 13079, 13081, 13083, 13085, 13087, 13089, 13091, 13093, 13095,
+ 13097, 13099, 13101, 13103, 13105, 13107, 13109, 13111, 13113, 13115,
+ 13117, 13119, 13121, 13123, 13125, 13127, 13129, 13131, 13133, 13135,
+ 13137, 13139, 13141, 13143, 13145, 13147, 13149, 13151, 13153, 13155,
+ 13157, 13159, 13161, 13163, 13165, 13167, 13169, 13171, 13173, 13175,
+ 13177, 13179, 13181, 13183, 13185, 13187, 13189, 13191, 13193, 13195,
+ 13197, 13199, 13201, 13203, 13205, 13207, 13209, 13211, 13213, 13215,
+ 13217, 13219, 13221, 13223, 13225, 13227, 13229, 13231, 13233, 13235,
+ 13237, 13239, 13241, 13243, 13245, 13247, 13249, 13251, 13253, 13255,
+ 13257, 13259, 13261, 13263, 13265, 13267, 13269, 13271, 13273, 13275,
+ 13277, 13279, 13281, 13283, 13285, 13287, 13289, 13291, 13293, 13295,
+ 13297, 13299, 13301, 13303, 13305, 13307, 13309, 13311, 13313, 13315,
+ 13317, 13319, 13321, 13323, 13325, 13327, 13329, 13331, 13333, 13335,
+ 13337, 13339, 13341, 13343, 13345, 13347, 13349, 13351, 13353, 13355,
+ 13357, 13359, 13361, 13363, 13365, 13367, 13369, 13371, 13373, 13375,
+ 13377, 13379, 13381, 13383, 13385, 13387, 13389, 13391, 13393, 13395,
+ 13397, 13399, 13401, 13403, 13405, 13407, 13409, 13411, 13413, 13415,
+ 13417, 13419, 13421, 13423, 13425, 13427, 13429, 13431, 13433, 13435,
+ 13437, 13439, 13441, 13443, 13445, 13447, 13449, 13451, 13453, 13455,
+ 13457, 13459, 13461, 13463, 13465, 13467, 13469, 13471, 13473, 13475,
+ 13477, 13479, 13481, 13483, 13485, 13487, 13489, 13491, 13493, 13495,
+ 13497, 13499, 13501, 13503, 13505, 13507, 13509, 13511, 13513, 13515,
+ 13517, 13519, 13521, 13523, 13525, 13527, 13529, 13531, 13533, 13535,
+ 13537, 13539, 13541, 13543, 13545, 13547, 13549, 13551, 13553, 13555,
+ 13557, 13559, 13561, 13563, 13565, 13567, 13569, 13571, 13573, 13575,
+ 13577, 13579, 13581, 13583, 13585, 13587, 13589, 13591, 13593, 13595,
+ 13597, 13599, 13601, 13603, 13605, 13607, 13609, 13611, 13613, 13615,
+ 13617, 13619, 13621, 13623, 13625, 13627, 13629, 13631, 13633, 13635,
+ 13637, 13639, 13641, 13643, 13645, 13647, 13649, 13651, 13653, 13655,
+ 13657, 13659, 13661, 13663, 13665, 13667, 13669, 13671, 13673, 13675,
+ 13677, 13679, 13681, 13683, 13685, 13687, 13689, 13691, 13693, 13695,
+ 13697, 13699, 13701, 13703, 13705, 13707, 13709, 13711, 13713, 13715,
+ 13717, 13719, 13721, 13723, 13725, 13727, 13729, 13731, 13733, 13735,
+ 13737, 13739, 13741, 13743, 13745, 13747, 13749, 13751, 13753, 13755,
+ 13757, 13759, 13761, 13763, 13765, 13767, 13769, 13771, 13773, 13775,
+ 13777, 13779, 13781, 13783, 13785, 13787, 13789, 13791, 13793, 13795,
+ 13797, 13799, 13801, 13803, 13805, 13807, 13809, 13811, 13813, 13815,
+ 13817, 13819, 13821, 13823, 13825, 13827, 13829, 13831, 13833, 13835,
+ 13837, 13839, 13841, 13843, 13845, 13847, 13849, 13851, 13853, 13855,
+ 13857, 13859, 13861, 13863, 13865, 13867, 13869, 13871, 13873, 13875,
+ 13877, 13879, 13881, 13883, 13885, 13887, 13889, 13891, 13893, 13895,
+ 13897, 13899, 13901, 13903, 13905, 13907, 13909, 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, 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,
+ 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, 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,
};
/* NFC pairs */
-#define COMP_SHIFT 3
+#define COMP_SHIFT 2
static unsigned short comp_index[] = {
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 5, 6, 7,
- 0, 0, 0, 8, 0, 9, 10, 0, 0, 11, 12, 13, 14, 0, 0, 0, 0, 15, 16, 17, 0, 0,
- 0, 18, 19, 20, 21, 0, 0, 0, 22, 0, 0, 0, 0, 0, 23, 24, 25, 26, 0, 0, 0,
- 27, 28, 29, 30, 0, 0, 0, 31, 32, 33, 34, 0, 0, 0, 35, 0, 0, 0, 0, 0, 36,
- 0, 37, 38, 39, 0, 0, 40, 41, 42, 43, 0, 0, 0, 44, 45, 46, 0, 0, 0, 0, 47,
- 48, 49, 50, 0, 0, 51, 52, 53, 54, 0, 0, 0, 55, 56, 0, 0, 0, 0, 0, 57, 58,
- 59, 60, 0, 0, 0, 61, 62, 63, 0, 0, 0, 0, 64, 65, 66, 67, 0, 0, 68, 69,
- 70, 71, 0, 0, 0, 72, 0, 73, 0, 0, 0, 0, 74, 0, 75, 0, 0, 0, 0, 76, 0, 0,
- 0, 0, 0, 77, 78, 79, 0, 0, 0, 0, 80, 81, 82, 83, 0, 0, 0, 84, 85, 86, 0,
- 0, 0, 0, 87, 88, 0, 89, 0, 0, 90, 91, 0, 92, 0, 0, 0, 0, 93, 94, 95, 0,
- 0, 0, 96, 97, 98, 99, 0, 0, 0, 100, 0, 0, 0, 0, 0, 101, 102, 0, 103, 0,
- 0, 0, 104, 105, 106, 107, 0, 0, 0, 108, 109, 110, 111, 0, 0, 0, 112, 113,
- 0, 0, 0, 0, 114, 115, 116, 117, 0, 0, 0, 118, 119, 120, 121, 0, 0, 0,
- 122, 0, 123, 0, 0, 0, 124, 125, 126, 127, 128, 0, 0, 129, 130, 131, 132,
- 0, 0, 0, 133, 134, 0, 0, 0, 0, 0, 135, 136, 137, 138, 0, 0, 139, 140,
- 141, 142, 0, 0, 0, 0, 143, 144, 145, 0, 0, 0, 146, 147, 148, 149, 0, 0,
- 0, 150, 0, 151, 0, 0, 0, 152, 153, 154, 0, 0, 0, 0, 0, 155, 0, 0, 0, 0,
- 0, 156, 157, 158, 0, 0, 0, 0, 159, 160, 161, 162, 0, 0, 163, 0, 0, 0,
- 164, 0, 0, 165, 166, 0, 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, 0, 168, 0, 0, 0,
- 0, 0, 169, 170, 0, 0, 0, 0, 0, 171, 0, 0, 0, 0, 0, 0, 172, 173, 0, 0, 0,
- 0, 0, 174, 0, 0, 0, 0, 0, 175, 176, 0, 0, 0, 0, 0, 177, 178, 0, 0, 0, 0,
- 0, 179, 0, 0, 0, 0, 0, 0, 180, 0, 0, 0, 0, 0, 181, 182, 183, 0, 0, 0, 0,
- 184, 185, 0, 0, 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, 0, 0, 188,
- 189, 0, 0, 0, 0, 0, 190, 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, 0, 0, 0, 193,
- 0, 0, 0, 0, 0, 194, 195, 0, 0, 0, 0, 0, 196, 197, 0, 0, 0, 0, 0, 198, 0,
- 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 200, 201, 202, 0, 0, 0, 0, 203, 204,
- 0, 0, 0, 0, 0, 205, 206, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 208, 0, 0, 0,
- 0, 0, 0, 209, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0,
- 0, 0, 212, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0, 0, 0, 0, 214, 0, 0, 0, 0, 0,
- 215, 0, 0, 0, 0, 0, 216, 0, 0, 0, 0, 0, 0, 0, 217, 0, 0, 0, 0, 0, 0, 218,
- 0, 0, 0, 0, 0, 219, 0, 0, 0, 0, 0, 220, 221, 222, 0, 0, 0, 0, 223, 224,
- 225, 0, 0, 0, 0, 226, 227, 228, 0, 0, 0, 0, 229, 230, 231, 0, 0, 0, 0, 0,
- 232, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 234, 0, 0, 0, 0, 0, 0, 235, 0, 0,
- 0, 0, 0, 0, 236, 0, 0, 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, 238, 0, 0, 0, 0,
- 0, 0, 239, 0, 0, 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, 0,
- 242, 0, 243, 244, 0, 0, 0, 245, 246, 0, 0, 0, 0, 247, 0, 248, 0, 249, 0,
- 0, 250, 251, 252, 0, 0, 0, 0, 253, 0, 254, 0, 0, 0, 0, 0, 255, 0, 0, 0,
- 0, 256, 257, 258, 0, 0, 0, 0, 259, 0, 260, 0, 261, 0, 0, 0, 0, 0, 262, 0,
- 0, 0, 0, 0, 0, 263, 0, 0, 264, 265, 266, 0, 267, 0, 0, 268, 0, 269, 0, 0,
- 0, 0, 270, 0, 271, 272, 0, 0, 0, 273, 274, 0, 275, 0, 0, 276, 0, 277, 0,
- 0, 0, 0, 0, 0, 278, 0, 0, 0, 0, 279, 280, 281, 282, 0, 0, 0, 283, 284, 0,
- 285, 0, 0, 286, 0, 0, 0, 287, 0, 0, 288, 0, 0, 0, 289, 0, 0, 0, 0, 0,
- 290, 0, 0, 0, 291, 0, 0, 0, 0, 0, 0, 292, 0, 0, 0, 0, 0, 0, 293, 0, 0, 0,
- 0, 0, 294, 0, 0, 0, 0, 0, 0, 295, 0, 0, 0, 0, 0, 0, 296, 0, 0, 0, 0, 0,
- 0, 297, 0, 0, 0, 0, 0, 298, 299, 0, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0, 0,
- 301, 0, 0, 0, 0, 0, 0, 302, 0, 0, 0, 0, 0, 0, 303, 0, 0, 0, 0, 0, 304, 0,
- 0, 0, 0, 0, 0, 305, 0, 0, 0, 0, 0, 0, 306, 0, 0, 0, 0, 0, 307, 0, 0, 0,
- 0, 0, 0, 308, 0, 0, 0, 0, 0, 0, 309, 0, 0, 0, 0, 0, 0, 310, 0, 0, 0, 0,
- 0, 311, 312, 0, 0, 0, 0, 0, 313, 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, 0, 0, 0,
- 315, 0, 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, 0, 317, 0, 0, 0, 0, 0, 0, 318, 0,
- 0, 0, 0, 0, 0, 319, 0, 0, 0, 0, 0, 0, 320, 0, 0, 0, 0, 0, 0, 321, 0, 0,
- 0, 0, 0, 322, 0, 0, 0, 0, 0, 0, 323, 0, 0, 0, 0, 0, 0, 324, 0, 0, 0, 0,
- 0, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0,
- 0, 0, 0, 328, 0, 0, 0, 0, 0, 329, 0, 0, 0, 0, 0, 0, 330, 0, 0, 0, 0, 0,
- 0, 331, 0, 0, 0, 0, 0, 0, 332, 0, 0, 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, 334,
- 0, 0, 0, 0, 0, 0, 335, 0, 0, 0, 0, 0, 0, 336, 337, 0, 0, 0, 0, 0, 0, 338,
- 0, 0, 0, 0, 0, 339, 0, 0, 0, 0, 0, 0, 340, 0, 0, 0, 0, 0, 0, 341, 0, 0,
- 0, 0, 0, 0, 342, 0, 0, 0, 0, 0, 0, 343, 0, 0, 0, 0, 0, 344, 0, 0, 0, 0,
- 0, 0, 345, 346, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 348, 0, 0, 0, 0, 0,
- 0, 349, 0, 0, 0, 0, 0, 0, 350, 0, 0, 0, 0, 0, 0, 351, 0, 0, 0, 0, 0, 0,
- 352, 0, 0, 0, 0, 0, 353, 0, 0, 0, 0, 0, 0, 354, 0, 0, 0, 0, 0, 0, 355, 0,
- 0, 0, 0, 0, 0, 356, 0, 0, 0, 0, 0, 357, 0, 0, 0, 0, 0, 0, 358, 0, 0, 0,
- 0, 0, 0, 359, 0, 0, 0, 0, 0, 0, 360, 0, 0, 0, 0, 0, 361, 362, 0, 0, 0, 0,
- 0, 0, 363, 0, 0, 0, 0, 0, 0, 364, 0, 0, 0, 0, 0, 0, 365, 0, 0, 0, 0, 0,
- 0, 366, 0, 0, 0, 0, 0, 367, 0, 0, 0, 0, 0, 0, 368, 0, 0, 0, 0, 0, 369,
- 370, 0, 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, 0, 372, 0, 0, 0, 0, 0, 0, 373, 0,
- 0, 0, 0, 0, 374, 0, 0, 0, 0, 0, 0, 375, 0, 0, 376, 0, 0, 0, 377, 0, 0,
- 378, 0, 0, 0, 0, 0, 0, 379, 0, 0, 0, 0, 0, 0, 380, 0, 0, 0, 0, 0, 381, 0,
- 0, 0, 0, 0, 0, 382, 0, 0, 0, 0, 0, 0, 383, 0, 0, 0, 0, 0, 0, 384, 0, 0,
- 385, 0, 0, 386, 0, 0, 0, 387, 0, 0, 388, 0, 0, 0, 0, 0, 0, 389, 0, 0, 0,
- 0, 0, 0, 390, 0, 0, 0, 0, 0, 391, 0, 0, 0, 0, 0, 0, 392, 0, 0, 0, 0, 0,
- 0, 393, 0, 0, 0, 0, 0, 0, 394, 0, 0, 395, 0, 0, 0, 0, 0, 0, 396, 0, 0, 0,
- 0, 0, 397, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, 0, 399, 0, 0, 400, 0, 0,
- 0, 401, 0, 0, 402, 0, 0, 0, 0, 0, 0, 403, 0, 0, 0, 0, 0, 0, 404, 0, 0, 0,
- 0, 0, 405, 0, 0, 0, 0, 0, 0, 406, 0, 0, 0, 0, 0, 0, 407, 0, 0, 0, 0, 0,
- 0, 408, 0, 0, 409, 0, 0, 410, 0, 0, 0, 411, 0, 0, 412, 0, 0, 0, 0, 0, 0,
- 413, 0, 0, 0, 0, 0, 0, 414, 0, 0, 0, 0, 0, 415, 0, 0, 0, 0, 0, 0, 416, 0,
- 0, 0, 0, 0, 0, 417, 0, 0, 0, 0, 0, 0, 418, 0, 0, 419, 0, 0, 420, 0, 0, 0,
- 421, 0, 0, 422, 0, 0, 423, 0, 0, 0, 424, 0, 0, 425, 0, 0, 0, 426, 0, 0,
- 427, 0, 0, 0, 0, 0, 0, 428, 0, 0, 0, 0, 0, 429, 0, 0, 0, 0, 0, 0, 430, 0,
- 0, 0, 0, 0, 0, 431, 0, 0, 432, 0, 0, 0, 433, 0, 0, 434, 0, 0, 435, 0, 0,
- 0, 436, 0, 0, 437, 0, 0, 0, 438, 0, 0, 439, 0, 0, 440, 0, 0, 0, 0, 0, 0,
- 441, 0, 0, 0, 0, 0, 0, 442, 0, 0, 0, 0, 0, 0, 443, 0, 0, 0, 0, 0, 444, 0,
- 0, 0, 0, 0, 0, 445, 0, 0, 0, 0, 0, 0, 446, 0, 0, 447, 0, 0, 0, 448, 0, 0,
- 449, 0, 0, 450, 0, 0, 0, 0, 0, 0, 451, 0, 0, 0, 0, 0, 0, 452, 0, 0, 0, 0,
- 0, 0, 453, 0, 0, 0, 0, 0, 454, 0, 0, 0, 0, 0, 0, 455, 0, 0, 0, 0, 0, 0,
- 456, 0, 0, 0, 0, 0, 0, 457, 0, 0, 0, 0, 0, 458, 0, 0, 0, 0, 0, 0, 459, 0,
- 0, 0, 0, 0, 0, 460, 0, 0, 461, 0, 0, 0, 462, 0, 0, 0, 0, 0, 463, 0, 0, 0,
- 0, 0, 0, 464, 0, 0, 465, 0, 0, 0, 466, 0, 0, 0, 0, 0, 467, 0, 0, 0, 0, 0,
- 0, 468, 0, 0, 0, 0, 0, 0, 469, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 471,
- 0, 0, 0, 0, 0, 0, 472, 0, 0, 0, 0, 0, 0, 473, 0, 0, 0, 0, 0, 0, 474, 0,
- 0, 0, 0, 0, 475, 0, 0, 0, 0, 0, 0, 476, 0, 0, 0, 0, 0, 0, 477, 0, 0, 0,
- 0, 0, 0, 478, 0, 0, 0, 0, 0, 479, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0,
- 0, 481, 0, 0, 0, 0, 0, 0, 482, 0, 0, 0, 0, 0, 483, 0, 0, 0, 0, 0, 0, 484,
- 0, 0, 0, 0, 0, 0, 485, 0, 0, 0, 0, 0, 0, 486, 0, 0, 0, 0, 0, 487, 0, 0,
- 0, 0, 0, 0, 488, 0, 0, 0, 0, 0, 0, 489, 0, 0, 0, 0, 0, 0, 490, 0, 0, 0,
- 0, 0, 491, 0, 0, 0, 0, 0, 0, 492, 0, 0, 0, 0, 0, 0, 493, 0, 0, 0, 0, 0,
- 0, 494, 0, 0, 0, 0, 0, 495, 0, 0, 0, 0, 0, 0, 496, 0, 0, 0, 0, 0, 0, 497,
- 0, 0, 0, 0, 0, 0, 498, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, 0, 500, 0, 0,
- 0, 0, 0, 0, 501, 0, 0, 0, 0, 0, 0, 502, 0, 0, 0, 0, 0, 503, 0, 0, 0, 0,
- 0, 0, 504, 0, 0, 0, 0, 0, 0, 505, 0, 0, 0, 0, 0, 0, 506, 0, 0, 0, 0, 0,
- 507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 508, 0, 0, 0, 0, 0, 0, 509, 0, 0, 0, 0,
- 0, 0, 510, 0, 0, 0, 0, 0, 0, 511, 0, 0, 0, 0, 0, 512, 0, 0, 0, 0, 0, 0,
- 513, 0, 0, 0, 0, 0, 0, 514, 0, 0, 0, 0, 0, 0, 515, 0, 0, 0, 0, 0, 516, 0,
- 0, 0, 0, 0, 0, 517, 0, 0, 0, 0, 0, 0, 518, 0, 0, 0, 0, 0, 0, 519, 0, 0,
- 0, 0, 0, 520, 0, 0, 0, 0, 0, 0, 521, 0, 0, 0, 0, 0, 0, 522, 0, 0, 0, 0,
- 0, 0, 523, 0, 0, 0, 0, 0, 524, 0, 0, 0, 0, 0, 0, 525, 0, 0, 0, 0, 0, 0,
- 526, 0, 0, 0, 0, 0, 0, 527, 0, 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 529, 0,
- 0, 0, 0, 0, 0, 530, 0, 0, 0, 0, 0, 0, 531, 0, 0, 0, 0, 0, 532, 0, 0, 0,
- 0, 0, 0, 533, 0, 0, 0, 0, 0, 0, 534, 0, 0, 0, 0, 0, 0, 535, 0, 0, 0, 0,
- 0, 536, 0, 0, 0, 0, 0, 0, 537, 0, 0, 0, 0, 0, 0, 538, 0, 0, 0, 0, 0, 0,
- 539, 0, 0, 0, 0, 0, 540, 0, 0, 0, 0, 0, 0, 541, 0, 0, 0, 0, 0, 0, 542, 0,
- 0, 0, 0, 0, 0, 543, 0, 0, 0, 0, 0, 544, 0, 0, 0, 0, 0, 0, 545, 0, 0, 0,
- 0, 0, 0, 546, 0, 0, 0, 0, 0, 0, 547, 0, 0, 0, 0, 0, 548, 0, 0, 0, 0, 0,
- 0, 549, 0, 0, 0, 0, 0, 0, 550, 0, 0, 0, 0, 0, 0, 551, 0, 0, 0, 0, 0, 552,
- 0, 0, 0, 0, 0, 0, 553, 0, 0, 0, 0, 0, 0, 554, 0, 0, 0, 0, 0, 0, 555,
+ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 8, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 13, 14,
+ 15, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, 22, 0, 0, 0,
+ 0, 0, 0, 23, 24, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 32, 33, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0,
+ 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, 44, 45, 46, 47,
+ 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0,
+ 50, 0, 51, 52, 53, 0, 0, 0, 0, 0, 0, 54, 0, 0, 55, 56, 57, 58, 59, 0, 0,
+ 0, 0, 0, 0, 60, 61, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 64, 65, 0,
+ 66, 67, 68, 0, 0, 0, 0, 0, 0, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 0,
+ 0, 0, 76, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 79, 0, 80, 81, 82,
+ 83, 0, 0, 0, 0, 0, 0, 0, 84, 85, 86, 0, 87, 88, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 89, 90, 0, 91, 92, 93, 0, 0, 0, 0, 0, 0, 94, 95, 96, 97, 98, 99, 100,
+ 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103,
+ 104, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 107, 108, 109, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 112,
+ 0, 113, 114, 0, 115, 0, 0, 0, 0, 0, 0, 0, 116, 117, 118, 119, 120, 121,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 0, 0, 123, 0, 124, 0, 0, 0, 0, 0, 0, 125,
+ 126, 127, 128, 0, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 0, 131, 132, 133,
+ 134, 0, 0, 0, 0, 0, 0, 0, 135, 136, 137, 138, 139, 140, 141, 0, 0, 0, 0,
+ 0, 0, 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 144, 145, 146, 0,
+ 147, 0, 0, 0, 0, 0, 0, 0, 0, 148, 149, 150, 151, 152, 153, 154, 0, 0, 0,
+ 0, 0, 0, 0, 155, 156, 157, 158, 159, 160, 161, 0, 0, 0, 0, 0, 0, 0, 162,
+ 0, 163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 164, 0, 0, 165, 166, 167, 0, 168,
+ 0, 0, 0, 0, 0, 0, 169, 0, 0, 170, 171, 172, 173, 0, 0, 0, 0, 0, 0, 0,
+ 174, 175, 0, 0, 176, 0, 0, 0, 0, 0, 0, 0, 0, 177, 178, 179, 180, 0, 181,
+ 182, 183, 0, 0, 0, 0, 0, 0, 184, 185, 186, 187, 188, 0, 189, 0, 0, 0, 0,
+ 0, 0, 0, 190, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 193, 194,
+ 195, 196, 197, 198, 0, 0, 0, 0, 0, 0, 0, 199, 200, 201, 0, 202, 203, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 204, 205, 206, 207, 208, 209, 0, 0, 0, 0, 0, 0,
+ 210, 211, 212, 213, 214, 215, 216, 0, 0, 0, 0, 0, 0, 0, 217, 0, 0, 0,
+ 218, 0, 0, 0, 0, 0, 0, 0, 0, 219, 220, 221, 222, 0, 223, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 225, 226, 227, 0,
+ 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 229, 230, 231, 0, 232, 0, 233, 0, 0, 0,
+ 0, 0, 0, 234, 235, 0, 0, 0, 0, 0, 236, 0, 0, 0, 0, 0, 0, 237, 238, 239,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 245, 246,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 248, 249, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251, 252, 253, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256, 257, 0, 258, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 259, 260, 261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 262, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 266, 267, 268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 269, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 270, 271, 272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 273, 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 279,
+ 0, 280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 281, 282, 283, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 284, 285, 286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 288, 289, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 290, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 291, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 293, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 294, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 296, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 298, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 301, 302, 303, 0, 0, 304, 0, 0, 0,
+ 0, 0, 0, 0, 0, 305, 306, 307, 0, 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 309,
+ 310, 311, 0, 312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 313, 0, 314, 0, 315, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 317, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 320, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 322, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 326, 327, 0, 328, 329, 0, 0, 330, 0, 0, 0, 0, 0, 0, 331, 0,
+ 0, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 333, 334, 0, 0, 335, 0, 0, 0, 336, 0,
+ 0, 0, 0, 0, 337, 338, 339, 0, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, 0, 0,
+ 342, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 344, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 345, 346, 347, 0, 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, 0, 0, 0,
+ 350, 0, 0, 351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 352, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 353, 0, 0, 0, 0, 0, 354, 355, 356, 0, 357, 0,
+ 0, 358, 359, 0, 0, 0, 0, 0, 360, 0, 0, 0, 361, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 362, 0, 0, 363, 364, 0, 0, 365, 0, 0, 0, 0, 0, 0, 366, 367, 0, 368, 0, 0,
+ 0, 369, 0, 0, 0, 0, 0, 370, 371, 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 374, 375, 376, 377, 378, 0, 0,
+ 379, 0, 0, 0, 0, 0, 0, 380, 0, 0, 381, 0, 0, 0, 382, 0, 0, 0, 0, 0, 383,
+ 384, 0, 0, 0, 0, 0, 385, 0, 0, 0, 0, 0, 0, 386, 0, 0, 0, 0, 0, 0, 387, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 389, 390, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 392, 393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 395, 396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 397,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 404,
+ 405, 406, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 407, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 408, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 409, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 410, 411, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 416, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 417, 418, 419, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 421, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 422, 423, 424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 425, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 426, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 428, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 433, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 436, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 438, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 439, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 440, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 441, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 443, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 445, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 446, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 448, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 451, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 453, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 454, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 455, 456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 457, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 459,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 462, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 464, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 467, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 468, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 469, 0,
+ 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 471, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 473, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 476, 477, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 478, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 479, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 482, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 483, 0, 0, 0, 0, 0, 0, 484, 0, 0, 0, 0, 0, 0, 485, 0, 0, 0,
+ 0, 0, 0, 486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 487, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 489, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 492, 0, 0, 0, 0, 0, 0,
+ 493, 0, 0, 0, 0, 0, 0, 494, 0, 0, 0, 0, 0, 0, 495, 0, 0, 0, 0, 0, 0, 496,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 501, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 502, 0, 0, 0, 0, 0, 0, 503, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 505,
+ 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 507, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 508, 0, 0, 0, 0, 0, 0, 509, 0, 0, 0, 0, 0, 0, 510, 0, 0, 0,
+ 0, 0, 0, 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 512, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 513, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 514, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 515, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 516, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, 0, 0, 0, 0, 0, 0,
+ 518, 0, 0, 0, 0, 0, 0, 519, 0, 0, 0, 0, 0, 0, 520, 0, 0, 0, 0, 0, 0, 521,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 522, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 526, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 527, 0, 0, 0, 0, 0, 0, 528, 0, 0, 0, 0,
+ 0, 0, 529, 0, 0, 0, 0, 0, 0, 530, 0, 0, 0, 0, 0, 0, 531, 0, 0, 0, 0, 0,
+ 532, 533, 0, 0, 0, 0, 0, 534, 0, 0, 0, 0, 0, 0, 535, 0, 0, 0, 0, 0, 0,
+ 536, 0, 0, 0, 0, 0, 0, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 538,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 542, 0, 0, 0, 0, 0,
+ 0, 543, 0, 0, 0, 0, 0, 0, 544, 0, 0, 0, 0, 0, 0, 545, 0, 0, 0, 0, 0, 546,
+ 547, 0, 0, 0, 0, 0, 548, 0, 0, 0, 0, 0, 0, 549, 0, 0, 0, 0, 0, 0, 550, 0,
+ 0, 0, 0, 0, 0, 551, 0, 0, 0, 0, 0, 0, 552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 554, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 556, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 558, 0, 0, 0, 0, 0, 559, 0, 0, 0, 0, 0, 0, 560, 0, 0, 0, 0, 0, 0,
+ 561, 0, 0, 0, 0, 0, 0, 562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 563,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 566, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 568, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 569, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 570, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 572, 0, 0, 0, 0, 0, 573, 0, 0, 0, 0, 0, 0, 574, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 576, 0, 0, 0, 0, 0, 577, 578, 0, 0, 0, 0, 0, 579, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 581, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 582, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 583, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 584, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 585, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 586, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 589, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 590, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 591, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 592, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 594, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 596, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 598,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 601, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 603, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 606, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 608, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 610, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 611, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 613, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 615, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 616, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 617, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 618, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 621, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 624, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 626, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 629, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 631, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 632, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 634, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 636, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 638, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 639, 640, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 641, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 642, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 645, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 647, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 650, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 652, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 655, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 657, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 660, 661, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 663, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 665, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 667, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 669, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 670, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 671, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 674,
};
-static unsigned short comp_data[] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8814, 0, 0, 0, 0, 0, 8800, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 8815, 0, 0, 192, 193, 194, 195, 256, 258, 550,
- 196, 7842, 197, 0, 461, 512, 514, 0, 0, 0, 7840, 0, 7680, 0, 0, 260, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7682, 0, 0, 7684, 0, 0, 0, 0, 0, 0,
- 0, 0, 7686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 262, 264, 0, 0, 0, 266,
- 0, 0, 0, 0, 268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, 7690,
- 0, 0, 0, 0, 270, 0, 0, 0, 0, 0, 7692, 0, 0, 0, 7696, 0, 7698, 0, 0, 7694,
- 0, 0, 0, 200, 201, 202, 7868, 274, 276, 278, 203, 7866, 0, 0, 282, 516,
- 518, 0, 0, 0, 7864, 0, 0, 0, 552, 280, 7704, 0, 7706, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7710, 0, 0, 0, 0, 0, 0, 0, 0, 500, 284, 0, 7712, 286, 288, 0,
- 0, 0, 0, 486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 290, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 292, 0, 0, 0, 7714, 7718, 0, 0, 0, 542, 0, 0, 0, 0, 0, 7716, 0, 0, 0,
- 7720, 0, 0, 7722, 0, 0, 0, 0, 0, 204, 205, 206, 296, 298, 300, 304, 207,
- 7880, 0, 0, 463, 520, 522, 0, 0, 0, 7882, 0, 0, 0, 0, 302, 0, 0, 7724, 0,
- 0, 0, 0, 0, 0, 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7728, 0, 488, 0,
- 0, 0, 0, 0, 7730, 0, 0, 0, 310, 0, 0, 0, 0, 7732, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 317, 0, 0, 0, 0, 0, 7734, 0,
- 0, 0, 315, 0, 7740, 0, 0, 7738, 0, 0, 0, 0, 7742, 0, 0, 0, 0, 7744, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7746, 0, 0, 0, 0, 504, 323, 0, 209, 0, 0, 7748,
- 0, 0, 0, 0, 327, 0, 0, 0, 0, 0, 7750, 0, 0, 0, 325, 0, 7754, 0, 0, 7752,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 211, 212, 213, 332, 334, 558, 214,
- 7886, 0, 336, 465, 524, 526, 0, 0, 416, 7884, 0, 0, 0, 0, 490, 0, 0, 0,
- 0, 0, 0, 0, 0, 7764, 0, 0, 0, 0, 7766, 0, 0, 0, 0, 0, 0, 0, 0, 340, 0, 0,
- 0, 0, 7768, 0, 0, 0, 0, 344, 528, 530, 0, 0, 0, 7770, 0, 0, 0, 342, 0, 0,
- 0, 0, 7774, 0, 0, 0, 0, 346, 348, 0, 0, 0, 7776, 0, 0, 0, 0, 352, 0, 0,
- 0, 0, 0, 7778, 0, 0, 536, 350, 0, 0, 0, 0, 0, 0, 7786, 0, 0, 0, 0, 356,
- 0, 0, 0, 0, 0, 7788, 0, 0, 538, 354, 0, 7792, 0, 0, 7790, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 217, 218, 219, 360, 362, 364, 0, 220, 7910, 366, 368,
- 467, 532, 534, 0, 0, 431, 7908, 7794, 0, 0, 0, 370, 7798, 0, 7796, 0, 0,
- 0, 0, 0, 0, 0, 7804, 0, 0, 0, 0, 0, 7806, 0, 0, 0, 0, 7808, 7810, 372, 0,
- 0, 0, 7814, 7812, 0, 7816, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7818, 7820, 0,
- 0, 0, 0, 0, 0, 7922, 221, 374, 7928, 562, 0, 7822, 376, 7926, 0, 0, 0, 0,
- 0, 0, 0, 0, 7924, 0, 0, 0, 0, 0, 377, 7824, 0, 0, 0, 379, 0, 0, 0, 0,
- 381, 0, 0, 0, 0, 0, 7826, 0, 0, 0, 0, 0, 0, 0, 0, 7828, 0, 0, 0, 224,
- 225, 226, 227, 257, 259, 551, 228, 7843, 229, 0, 462, 513, 515, 0, 0, 0,
- 7841, 0, 7681, 0, 0, 261, 0, 0, 0, 0, 0, 7683, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7685, 7687, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 263, 265, 0, 0, 0,
- 267, 0, 0, 0, 0, 269, 0, 231, 0, 0, 0, 0, 0, 0, 7691, 0, 0, 0, 0, 271, 0,
- 0, 0, 0, 0, 7693, 0, 0, 0, 7697, 0, 7699, 0, 0, 7695, 0, 0, 0, 232, 233,
- 234, 7869, 275, 277, 279, 235, 7867, 0, 0, 283, 517, 519, 0, 0, 0, 7865,
- 0, 0, 0, 553, 281, 7705, 0, 7707, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7711, 0,
- 0, 0, 0, 0, 0, 0, 0, 501, 285, 0, 7713, 287, 289, 0, 0, 0, 0, 487, 0,
- 291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 293, 0, 0, 0, 7715, 7719, 0, 0, 0,
- 543, 0, 0, 0, 0, 0, 7717, 0, 0, 0, 7721, 0, 0, 7723, 0, 7830, 0, 0, 0,
- 236, 237, 238, 297, 299, 301, 0, 239, 7881, 0, 0, 464, 521, 523, 0, 0, 0,
- 7883, 0, 0, 0, 0, 303, 0, 0, 7725, 0, 0, 0, 0, 0, 0, 309, 0, 0, 0, 0, 0,
- 0, 0, 0, 496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7729, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 489, 0, 0, 0, 0, 0, 7731, 0, 0, 0, 311, 0, 0, 0, 0, 7733, 0, 0, 0,
- 0, 314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 318, 0, 0, 0, 0, 0, 7735, 0, 0, 0,
- 316, 0, 7741, 0, 0, 7739, 0, 0, 0, 0, 7743, 0, 0, 0, 0, 7745, 0, 0, 7747,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 505, 324, 0, 241, 0, 0, 7749, 0, 0,
- 0, 0, 328, 0, 0, 0, 0, 0, 7751, 0, 0, 0, 326, 0, 7755, 0, 0, 7753, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 243, 244, 245, 333, 335, 559, 246, 7887,
- 0, 337, 466, 525, 527, 0, 0, 417, 7885, 0, 0, 0, 0, 491, 0, 0, 0, 0, 0,
- 0, 0, 0, 7765, 0, 0, 0, 0, 7767, 0, 0, 0, 0, 0, 0, 0, 0, 341, 0, 0, 0, 0,
- 7769, 0, 0, 0, 0, 345, 529, 531, 0, 0, 0, 7771, 0, 0, 0, 343, 0, 0, 0, 0,
- 7775, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 349, 0, 0, 0, 7777, 0, 0,
- 0, 0, 353, 0, 0, 0, 0, 0, 7779, 0, 0, 537, 351, 0, 0, 0, 0, 0, 0, 7787,
- 7831, 0, 0, 0, 357, 0, 0, 0, 0, 0, 7789, 0, 0, 539, 355, 0, 7793, 0, 0,
- 7791, 0, 0, 0, 249, 250, 251, 361, 363, 365, 0, 252, 7911, 367, 369, 468,
- 533, 535, 0, 0, 432, 7909, 7795, 0, 0, 0, 371, 7799, 0, 7797, 0, 0, 0, 0,
- 0, 0, 0, 7805, 0, 0, 0, 0, 0, 7807, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7809, 7811, 373, 0, 0, 0, 7815, 7813, 0, 7832, 0, 0, 0, 0, 0, 0, 0, 7817,
- 0, 0, 7819, 7821, 0, 0, 0, 0, 0, 0, 7923, 253, 375, 7929, 563, 0, 7823,
- 255, 7927, 7833, 0, 0, 0, 0, 0, 0, 0, 7925, 0, 0, 0, 0, 0, 378, 7825, 0,
- 0, 0, 380, 0, 0, 0, 0, 382, 0, 0, 0, 0, 0, 7827, 0, 0, 0, 0, 0, 0, 0, 0,
- 7829, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8173, 901, 0, 0, 8129, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 7846, 7844, 0, 7850, 0, 0, 0, 0, 7848, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 478, 0, 0, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 508, 0,
- 0, 482, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7688, 0, 0, 0, 0, 7872, 7870, 0,
- 7876, 0, 0, 0, 0, 7874, 0, 0, 0, 0, 0, 0, 7726, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7890, 7888, 0, 7894, 0, 0, 0, 0, 7892, 0, 0, 0, 0, 0, 0,
- 7756, 0, 0, 556, 0, 0, 7758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 554, 0, 0,
- 510, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 475, 471, 0, 0, 469, 0, 0, 0, 0,
- 0, 0, 473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7847, 7845, 0, 7851, 0, 0, 0, 0,
- 7849, 0, 0, 0, 0, 0, 0, 0, 0, 0, 479, 0, 0, 507, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 509, 0, 0, 483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7689, 0, 0,
- 0, 0, 7873, 7871, 0, 7877, 0, 0, 0, 0, 7875, 0, 0, 0, 0, 0, 0, 7727, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7891, 7889, 0, 7895, 0, 0, 0, 0, 7893,
- 0, 0, 0, 0, 0, 0, 7757, 0, 0, 557, 0, 0, 7759, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 555, 0, 0, 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 476, 472, 0, 0,
- 470, 0, 0, 0, 0, 0, 0, 474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7856, 7854, 0,
- 7860, 0, 0, 0, 0, 7858, 0, 0, 0, 0, 0, 7857, 7855, 0, 7861, 0, 0, 0, 0,
- 7859, 0, 0, 0, 0, 0, 7700, 7702, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7701, 7703, 0, 0, 0, 0, 7760, 7762, 0, 0, 0, 0, 7761, 7763, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7780, 0, 0, 0, 0, 0, 7781, 0, 0, 0, 0, 0, 7782, 0, 0,
- 0, 0, 0, 7783, 0, 0, 0, 0, 0, 0, 0, 0, 7800, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7801, 0, 0, 0, 7802, 0, 0, 0, 0, 0, 7803, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7835, 0, 0, 0, 0, 0, 0, 0, 7900, 7898, 0, 7904, 0, 0,
- 0, 0, 7902, 0, 0, 0, 0, 0, 0, 0, 0, 7906, 0, 0, 0, 0, 7901, 7899, 0,
- 7905, 0, 0, 0, 0, 7903, 0, 0, 0, 0, 0, 0, 0, 0, 7907, 0, 0, 0, 0, 7914,
- 7912, 0, 7918, 0, 0, 0, 0, 7916, 0, 0, 0, 0, 0, 0, 0, 0, 7920, 0, 0, 0,
- 0, 7915, 7913, 0, 7919, 0, 0, 0, 0, 7917, 0, 0, 0, 0, 0, 0, 0, 0, 7921,
- 0, 0, 0, 0, 0, 0, 0, 494, 0, 0, 0, 0, 0, 0, 492, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 493, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 481, 0, 0, 0, 0,
- 0, 0, 7708, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7709, 0, 0, 0, 0, 560,
- 0, 0, 0, 0, 0, 561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 495, 0, 0, 8122,
- 902, 0, 0, 8121, 8120, 7944, 7945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8124, 8136, 904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7960, 7961, 0, 0, 0,
- 0, 0, 0, 8138, 905, 0, 0, 0, 0, 7976, 7977, 0, 0, 0, 0, 0, 8140, 0, 0, 0,
- 0, 0, 0, 0, 0, 8154, 906, 0, 0, 8153, 8152, 0, 938, 0, 0, 0, 0, 0, 0,
- 7992, 7993, 0, 0, 0, 0, 0, 0, 8184, 908, 0, 0, 0, 0, 8008, 8009, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8172, 0, 0, 0, 0, 0, 0, 8170, 910, 0, 0,
- 8169, 8168, 0, 939, 0, 0, 0, 0, 0, 0, 0, 8025, 0, 0, 0, 0, 0, 0, 8186,
- 911, 0, 0, 0, 0, 8040, 8041, 0, 0, 0, 0, 0, 8188, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 8116, 0, 0, 0, 0, 0, 8132, 0, 0, 0, 0, 0, 0, 0, 0, 8048,
- 940, 0, 0, 8113, 8112, 0, 0, 0, 0, 0, 0, 0, 0, 7936, 7937, 0, 0, 0, 0,
- 8118, 8115, 0, 0, 0, 0, 0, 0, 0, 0, 8050, 941, 0, 0, 0, 0, 7952, 7953, 0,
- 0, 0, 0, 0, 0, 8052, 942, 0, 0, 0, 0, 7968, 7969, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8134, 8131, 8054, 943, 0, 0, 8145, 8144, 0, 970, 0, 0, 0, 0,
- 0, 0, 7984, 7985, 0, 0, 0, 0, 8150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8056, 972,
- 0, 0, 0, 0, 8000, 8001, 0, 0, 0, 0, 8164, 8165, 0, 0, 0, 0, 0, 0, 8058,
- 973, 0, 0, 8161, 8160, 0, 971, 0, 0, 0, 0, 0, 0, 8016, 8017, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 8166, 0, 8060, 974, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 8032, 8033, 0, 0, 0, 0, 8182, 8179, 0, 0, 0, 0, 0, 0, 0, 0, 8146,
- 912, 0, 0, 8151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8162, 944, 0, 0, 8167, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8180, 0, 979, 0, 0, 0, 0, 0, 980, 0,
- 0, 0, 0, 0, 1031, 0, 0, 0, 1232, 0, 1234, 0, 0, 0, 0, 0, 0, 0, 1027, 0,
- 0, 0, 0, 1024, 0, 0, 0, 0, 1238, 0, 1025, 0, 0, 0, 1217, 0, 1244, 0, 0,
- 0, 0, 0, 1246, 0, 0, 0, 0, 0, 0, 1037, 0, 0, 0, 1250, 1049, 0, 1252, 0,
- 0, 0, 0, 0, 0, 0, 1036, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1254, 0, 0,
- 1262, 1038, 0, 1264, 0, 0, 1266, 0, 0, 1268, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1272, 0, 0, 0, 0, 0, 1260, 0, 0, 0, 1233, 0, 1235, 0, 0, 0,
- 0, 0, 0, 0, 1107, 0, 0, 0, 0, 1104, 0, 0, 0, 0, 1239, 0, 1105, 0, 0, 0,
- 1218, 0, 1245, 0, 0, 0, 0, 0, 1247, 0, 0, 0, 0, 0, 0, 1117, 0, 0, 0,
- 1251, 1081, 0, 1253, 0, 0, 0, 0, 0, 0, 0, 1116, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1255, 0, 0, 1263, 1118, 0, 1265, 0, 0, 1267, 0, 0, 1269, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1273, 0, 0, 0, 0, 0, 1261, 0, 0, 0, 0,
- 0, 1111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1142, 0, 0, 0, 0, 0, 1143, 0, 0,
- 0, 0, 0, 0, 0, 0, 1242, 0, 0, 0, 0, 0, 1243, 0, 0, 0, 0, 0, 1258, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1259, 0, 0, 0, 0, 1570, 1571, 1573, 0,
- 0, 0, 0, 1572, 0, 0, 0, 0, 0, 1574, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1730, 0, 0, 0, 0, 0, 1747, 0, 0, 0, 0, 0, 1728, 0, 0, 0, 0, 0, 0, 0,
- 2345, 0, 0, 0, 0, 0, 2353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2356,
- 0, 0, 0, 0, 0, 0, 2507, 2508, 0, 0, 0, 0, 0, 0, 2891, 2888, 2892, 0, 0,
- 0, 0, 0, 0, 0, 2964, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3018, 3020, 0,
- 0, 0, 0, 3019, 0, 0, 0, 0, 0, 0, 0, 3144, 0, 0, 0, 0, 0, 0, 0, 3264, 0,
- 0, 0, 0, 3274, 3271, 3272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3275, 0,
- 0, 0, 0, 0, 0, 0, 3402, 3404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3403,
- 0, 0, 0, 0, 0, 0, 0, 3546, 3548, 3550, 0, 0, 0, 3549, 0, 0, 0, 0, 0, 0,
- 0, 0, 4134, 0, 0, 0, 0, 0, 0, 6918, 0, 0, 0, 0, 0, 6920, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 6922, 0, 0, 0, 0, 0, 6924, 0, 0, 0, 0, 0, 6926,
- 0, 0, 0, 0, 0, 6930, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6971, 0, 0,
- 0, 0, 0, 6973, 0, 0, 0, 0, 0, 6976, 0, 0, 0, 0, 0, 6977, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 6979, 0, 0, 0, 0, 0, 0, 7736, 0, 0, 0, 0, 0,
- 7737, 0, 0, 0, 0, 0, 7772, 0, 0, 0, 0, 0, 7773, 0, 0, 0, 0, 0, 0, 0,
- 7784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7785, 0, 7852, 0, 0, 7862,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7853, 0, 0, 7863, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 7878, 0, 0, 0, 0, 0, 7879, 0, 0, 0, 0, 0, 7896, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 7897, 0, 0, 0, 7938, 7940, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 7942, 8064, 7939, 7941, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7943, 8065,
- 0, 0, 0, 0, 0, 8066, 0, 0, 0, 0, 0, 8067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 8068, 0, 0, 0, 0, 0, 8069, 0, 0, 0, 0, 0, 8070, 0, 0, 0, 0, 0,
- 8071, 0, 0, 0, 0, 0, 0, 0, 0, 7946, 7948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7950, 8072, 7947, 7949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7951, 8073, 0, 0,
- 0, 0, 0, 8074, 0, 0, 0, 0, 0, 8075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 8076, 0, 0, 0, 0, 0, 8077, 0, 0, 0, 0, 0, 8078, 0, 0, 0, 0, 0, 8079,
- 0, 0, 0, 0, 0, 0, 0, 0, 7954, 7956, 0, 0, 0, 0, 7955, 7957, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7962, 7964, 0, 0, 0, 0, 7963, 7965, 0, 0, 0, 0,
- 7970, 7972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7974, 8080, 7971, 7973, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7975, 8081, 0, 0, 0, 0, 0, 8082, 0, 0, 0, 0, 0,
- 8083, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8084, 0, 0, 0, 0, 0, 8085,
- 0, 0, 0, 0, 0, 8086, 0, 0, 0, 0, 0, 8087, 0, 0, 0, 0, 0, 0, 0, 0, 7978,
- 7980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7982, 8088, 7979, 7981, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7983, 8089, 0, 0, 0, 0, 0, 8090, 0, 0, 0, 0, 0, 8091,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8092, 0, 0, 0, 0, 0, 8093, 0, 0,
- 0, 0, 0, 8094, 0, 0, 0, 0, 0, 8095, 0, 0, 0, 0, 0, 0, 0, 0, 7986, 7988,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7990, 0, 7987, 7989, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 7991, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7994, 7996, 0, 0, 7998, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 7995, 7997, 0, 0, 7999, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8002, 8004, 0, 0, 0, 0, 8003, 8005, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8010, 8012, 0, 0, 0, 0, 8011, 8013, 0, 0, 0, 0, 8018, 8020, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 8022, 0, 8019, 8021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8027, 8029, 0, 0, 8031, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8034, 8036, 0, 0, 8038, 8096, 0, 0, 0, 0, 0, 0, 0, 0, 8035,
- 8037, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8039, 8097, 0, 0, 0, 0, 0, 8098, 0,
- 0, 0, 0, 0, 8099, 0, 0, 0, 0, 0, 8100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 8101, 0, 0, 0, 0, 0, 8102, 0, 0, 0, 0, 0, 8103, 0, 0, 0, 0, 0, 0,
- 0, 0, 8042, 8044, 0, 0, 8046, 8104, 0, 0, 0, 0, 0, 0, 0, 0, 8043, 8045,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8047, 8105, 0, 0, 0, 0, 0, 8106, 0, 0, 0,
- 0, 0, 8107, 0, 0, 0, 0, 0, 8108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8109, 0, 0, 0, 0, 0, 8110, 0, 0, 0, 0, 0, 8111, 0, 0, 0, 0, 0, 8114, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8130, 0, 0, 0, 0, 0, 8178, 0, 0, 0,
- 0, 0, 8119, 0, 0, 0, 0, 0, 0, 0, 0, 8141, 8142, 0, 0, 8143, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8135, 0, 0, 0, 0, 0, 8183, 0, 0, 0, 0, 0,
- 0, 0, 0, 8157, 8158, 0, 0, 8159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8602, 0, 0, 0, 0, 0, 8603, 0, 0, 0, 0, 0, 8622, 0, 0, 0, 0, 0, 8653, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8655, 0, 0, 0, 0, 0, 8654, 0, 0, 0,
- 0, 0, 8708, 0, 0, 0, 0, 0, 8713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8716, 0, 0, 0, 0, 0, 8740, 0, 0, 0, 0, 0, 8742, 0, 0, 0, 0, 0, 8769, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8772, 0, 0, 0, 0, 0, 8775, 0, 0, 0,
- 0, 0, 8777, 0, 0, 0, 0, 0, 8813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8802, 0, 0, 0, 0, 0, 8816, 0, 0, 0, 0, 0, 8817, 0, 0, 0, 0, 0, 8820, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8821, 0, 0, 0, 0, 0, 8824, 0, 0, 0,
- 0, 0, 8825, 0, 0, 0, 0, 0, 8832, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8833, 0, 0, 0, 0, 0, 8928, 0, 0, 0, 0, 0, 8929, 0, 0, 0, 0, 0, 8836, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8837, 0, 0, 0, 0, 0, 8840, 0, 0, 0,
- 0, 0, 8841, 0, 0, 0, 0, 0, 8930, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8931, 0, 0, 0, 0, 0, 8876, 0, 0, 0, 0, 0, 8877, 0, 0, 0, 0, 0, 8878, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8879, 0, 0, 0, 0, 0, 8938, 0, 0, 0,
- 0, 0, 8939, 0, 0, 0, 0, 0, 8940, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8941, 0, 0, 0, 0, 0, 0, 12436, 0, 0, 0, 0, 0, 12364, 0, 0, 0, 0, 0,
- 12366, 0, 0, 0, 0, 0, 12368, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 12370, 0, 0, 0, 0, 0, 12372, 0, 0, 0, 0, 0, 12374, 0, 0, 0, 0, 0, 12376,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12378, 0, 0, 0, 0, 0, 12380, 0, 0,
- 0, 0, 0, 12382, 0, 0, 0, 0, 0, 12384, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 12386, 0, 0, 0, 0, 0, 12389, 0, 0, 0, 0, 0, 12391, 0, 0, 0, 0, 0,
- 12393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12400, 12401, 0, 0, 0, 0,
- 12403, 12404, 0, 0, 0, 0, 12406, 12407, 0, 0, 0, 0, 12409, 12410, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12412, 12413, 0, 0, 0, 0, 12446, 0, 0, 0,
- 0, 0, 12532, 0, 0, 0, 0, 0, 12460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 12462, 0, 0, 0, 0, 0, 12464, 0, 0, 0, 0, 0, 12466, 0, 0, 0, 0, 0, 12468,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12470, 0, 0, 0, 0, 0, 12472, 0, 0,
- 0, 0, 0, 12474, 0, 0, 0, 0, 0, 12476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 12478, 0, 0, 0, 0, 0, 12480, 0, 0, 0, 0, 0, 12482, 0, 0, 0, 0, 0,
- 12485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12487, 0, 0, 0, 0, 0,
- 12489, 0, 0, 0, 0, 0, 12496, 12497, 0, 0, 0, 0, 12499, 12500, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 12502, 12503, 0, 0, 0, 0, 12505, 12506, 0, 0, 0,
- 0, 12508, 12509, 0, 0, 0, 0, 12535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 12536, 0, 0, 0, 0, 0, 12537, 0, 0, 0, 0, 0, 12538, 0, 0, 0, 0, 0,
- 12542, 0,
+static unsigned int comp_data[] = {
+ 0, 0, 0, 0, 0, 0, 0, 8814, 0, 0, 8800, 0, 0, 8815, 0, 0, 0, 192, 193,
+ 194, 195, 256, 258, 550, 196, 7842, 197, 0, 461, 512, 514, 0, 0, 0, 7840,
+ 0, 7680, 0, 0, 260, 0, 0, 7682, 0, 0, 7684, 0, 0, 0, 0, 7686, 0, 262,
+ 264, 0, 0, 0, 266, 0, 0, 0, 0, 268, 0, 199, 0, 0, 0, 7690, 0, 0, 0, 0,
+ 270, 0, 0, 0, 0, 0, 7692, 0, 0, 0, 7696, 0, 7698, 0, 0, 7694, 0, 0, 0, 0,
+ 200, 201, 202, 7868, 274, 276, 278, 203, 7866, 0, 0, 282, 516, 518, 0, 0,
+ 0, 7864, 0, 0, 0, 552, 280, 7704, 0, 7706, 0, 0, 0, 7710, 0, 500, 284, 0,
+ 7712, 286, 288, 0, 0, 0, 0, 486, 0, 290, 0, 0, 0, 292, 0, 0, 0, 7714,
+ 7718, 0, 0, 0, 542, 0, 0, 0, 0, 0, 7716, 0, 0, 0, 7720, 0, 0, 7722, 0, 0,
+ 204, 205, 206, 296, 298, 300, 304, 207, 7880, 0, 0, 463, 520, 522, 0, 0,
+ 0, 7882, 0, 0, 0, 0, 302, 0, 0, 7724, 0, 0, 0, 308, 0, 7728, 0, 0, 0, 0,
+ 0, 488, 0, 7730, 0, 0, 0, 310, 0, 0, 0, 0, 7732, 0, 0, 0, 0, 0, 313, 0,
+ 317, 0, 0, 0, 0, 0, 7734, 0, 0, 0, 315, 0, 7740, 0, 0, 7738, 0, 0, 0, 0,
+ 0, 7742, 0, 0, 0, 0, 7744, 0, 0, 7746, 0, 504, 323, 0, 209, 0, 0, 7748,
+ 0, 0, 0, 0, 327, 0, 7750, 0, 0, 0, 325, 0, 7754, 0, 0, 7752, 0, 0, 0, 0,
+ 210, 211, 212, 213, 332, 334, 558, 214, 7886, 0, 336, 465, 524, 526, 0,
+ 0, 416, 7884, 0, 0, 0, 0, 490, 0, 0, 0, 0, 0, 7764, 7766, 0, 0, 0, 0, 0,
+ 340, 0, 0, 0, 0, 7768, 344, 528, 530, 0, 0, 0, 7770, 0, 0, 0, 342, 0, 0,
+ 0, 0, 7774, 0, 346, 348, 0, 0, 0, 7776, 0, 0, 0, 0, 352, 0, 7778, 0, 0,
+ 536, 350, 0, 0, 0, 7786, 0, 0, 0, 0, 356, 0, 7788, 0, 0, 538, 354, 0,
+ 7792, 0, 0, 7790, 0, 0, 0, 0, 217, 218, 219, 360, 362, 364, 0, 220, 7910,
+ 366, 368, 467, 532, 534, 0, 0, 431, 7908, 7794, 0, 0, 0, 370, 7798, 0,
+ 7796, 7804, 0, 0, 0, 0, 0, 7806, 0, 7808, 7810, 372, 0, 0, 0, 7814, 7812,
+ 0, 7816, 0, 0, 0, 7818, 7820, 0, 0, 0, 7922, 221, 374, 7928, 562, 0,
+ 7822, 376, 7926, 0, 0, 0, 0, 7924, 0, 0, 377, 7824, 0, 0, 0, 379, 381, 0,
+ 0, 0, 0, 0, 7826, 0, 0, 0, 0, 7828, 224, 225, 226, 227, 257, 259, 551,
+ 228, 7843, 229, 0, 462, 513, 515, 0, 0, 0, 7841, 0, 7681, 0, 0, 261, 0,
+ 0, 7683, 0, 0, 7685, 0, 0, 0, 0, 7687, 0, 0, 0, 0, 0, 263, 265, 0, 0, 0,
+ 267, 0, 0, 0, 0, 269, 0, 0, 0, 0, 0, 231, 0, 0, 0, 7691, 271, 0, 0, 0, 0,
+ 0, 7693, 0, 0, 0, 7697, 0, 7699, 0, 0, 7695, 232, 233, 234, 7869, 275,
+ 277, 279, 235, 7867, 0, 0, 283, 517, 519, 0, 0, 0, 7865, 0, 0, 0, 553,
+ 281, 7705, 0, 7707, 0, 0, 0, 7711, 0, 0, 0, 0, 0, 501, 285, 0, 7713, 287,
+ 289, 0, 0, 0, 0, 487, 0, 0, 0, 0, 0, 291, 0, 0, 0, 293, 0, 0, 0, 7715,
+ 7719, 0, 0, 0, 543, 0, 0, 0, 0, 0, 7717, 0, 0, 0, 7721, 0, 0, 7723, 0,
+ 7830, 236, 237, 238, 297, 299, 301, 0, 239, 7881, 0, 0, 464, 521, 523, 0,
+ 0, 0, 7883, 0, 0, 0, 0, 303, 0, 0, 7725, 0, 0, 0, 309, 0, 0, 0, 0, 496,
+ 0, 0, 0, 0, 7729, 0, 489, 0, 0, 0, 0, 0, 7731, 0, 0, 0, 311, 7733, 0, 0,
+ 0, 0, 0, 314, 0, 318, 0, 0, 0, 0, 0, 7735, 0, 0, 0, 316, 0, 7741, 0, 0,
+ 7739, 0, 7743, 0, 0, 0, 0, 7745, 0, 0, 7747, 0, 0, 0, 0, 0, 505, 324, 0,
+ 241, 0, 0, 7749, 0, 0, 0, 0, 328, 0, 7751, 0, 0, 0, 326, 0, 7755, 0, 0,
+ 7753, 0, 0, 0, 0, 242, 243, 244, 245, 333, 335, 559, 246, 7887, 0, 337,
+ 466, 525, 527, 0, 0, 417, 7885, 491, 0, 0, 0, 0, 0, 7765, 0, 0, 0, 0,
+ 7767, 0, 341, 0, 0, 0, 0, 7769, 0, 0, 0, 0, 345, 529, 531, 0, 0, 0, 7771,
+ 0, 0, 0, 343, 0, 0, 0, 0, 7775, 0, 347, 349, 0, 0, 0, 7777, 0, 0, 0, 0,
+ 353, 0, 7779, 0, 0, 537, 351, 0, 0, 0, 7787, 7831, 0, 0, 0, 357, 0, 0, 0,
+ 0, 0, 7789, 0, 0, 539, 355, 0, 7793, 0, 0, 7791, 0, 0, 0, 0, 249, 250,
+ 251, 361, 363, 365, 0, 252, 7911, 367, 369, 468, 533, 535, 0, 0, 432,
+ 7909, 7795, 0, 0, 0, 371, 7799, 0, 7797, 0, 0, 0, 0, 7805, 0, 7807, 0, 0,
+ 0, 0, 0, 7809, 7811, 373, 0, 0, 0, 7815, 7813, 0, 7832, 0, 0, 0, 7817, 0,
+ 0, 0, 7819, 7821, 0, 0, 0, 7923, 253, 375, 7929, 563, 0, 7823, 255, 7927,
+ 7833, 0, 0, 0, 7925, 0, 0, 378, 7825, 0, 0, 0, 380, 0, 0, 0, 0, 382, 0,
+ 7827, 0, 0, 0, 0, 7829, 0, 0, 0, 0, 8173, 901, 0, 0, 0, 0, 0, 0, 8129, 0,
+ 0, 7846, 7844, 0, 7850, 0, 0, 0, 0, 7848, 0, 0, 478, 0, 0, 0, 506, 0, 0,
+ 508, 0, 0, 482, 0, 0, 0, 7688, 0, 7872, 7870, 0, 7876, 0, 0, 0, 0, 7874,
+ 0, 0, 0, 7726, 0, 0, 0, 0, 0, 7890, 7888, 0, 7894, 0, 0, 0, 0, 7892, 0,
+ 0, 0, 7756, 0, 0, 556, 0, 0, 7758, 0, 0, 0, 554, 0, 0, 0, 510, 0, 0, 0,
+ 0, 0, 475, 471, 0, 0, 469, 0, 0, 473, 0, 0, 0, 7847, 7845, 0, 7851, 0, 0,
+ 0, 0, 7849, 0, 0, 479, 0, 0, 0, 507, 0, 0, 509, 0, 0, 483, 0, 0, 0, 7689,
+ 0, 7873, 7871, 0, 7877, 0, 0, 0, 0, 7875, 0, 0, 0, 7727, 0, 0, 0, 0, 0,
+ 7891, 7889, 0, 7895, 0, 0, 0, 0, 7893, 0, 0, 0, 7757, 0, 0, 557, 0, 0,
+ 7759, 0, 0, 0, 555, 0, 0, 0, 511, 0, 0, 0, 0, 0, 476, 472, 0, 0, 470, 0,
+ 0, 474, 0, 0, 0, 7856, 7854, 0, 7860, 0, 0, 0, 0, 7858, 0, 0, 7857, 7855,
+ 0, 7861, 0, 0, 0, 0, 7859, 0, 0, 7700, 7702, 0, 0, 0, 0, 0, 7701, 7703,
+ 0, 0, 0, 0, 0, 7760, 7762, 0, 7761, 7763, 0, 0, 0, 7780, 0, 0, 7781, 0,
+ 0, 7782, 0, 0, 0, 0, 0, 0, 7783, 0, 7800, 0, 0, 7801, 0, 0, 0, 0, 7802,
+ 0, 0, 7803, 0, 0, 0, 0, 0, 7835, 0, 0, 0, 0, 7900, 7898, 0, 7904, 0, 0,
+ 0, 0, 7902, 7906, 0, 0, 0, 0, 0, 7901, 7899, 0, 7905, 0, 0, 0, 0, 7903,
+ 0, 0, 0, 0, 7907, 0, 7914, 7912, 0, 7918, 0, 0, 0, 0, 7916, 0, 0, 0, 0,
+ 7920, 0, 7915, 7913, 0, 7919, 7917, 0, 0, 0, 0, 7921, 0, 0, 0, 0, 494, 0,
+ 0, 0, 492, 0, 0, 493, 0, 0, 480, 0, 0, 0, 0, 0, 0, 481, 0, 0, 0, 7708, 0,
+ 0, 7709, 0, 560, 0, 0, 0, 0, 0, 0, 561, 0, 495, 0, 0, 0, 8122, 902, 0, 0,
+ 8121, 8120, 0, 0, 0, 0, 7944, 7945, 0, 0, 0, 0, 0, 8124, 0, 8136, 904, 0,
+ 0, 0, 0, 7960, 7961, 0, 0, 0, 8138, 905, 0, 0, 0, 0, 7976, 7977, 0, 8140,
+ 0, 0, 0, 0, 0, 8154, 906, 0, 0, 8153, 8152, 0, 938, 0, 0, 7992, 7993, 0,
+ 0, 0, 8184, 908, 0, 0, 0, 0, 8008, 8009, 0, 0, 0, 0, 0, 0, 8172, 0, 0, 0,
+ 8170, 910, 0, 0, 8169, 8168, 0, 939, 0, 0, 0, 8025, 0, 0, 0, 8186, 911,
+ 8040, 8041, 0, 0, 0, 0, 0, 8188, 0, 0, 8116, 0, 0, 8132, 0, 0, 0, 0, 0,
+ 8048, 940, 0, 0, 8113, 8112, 0, 0, 0, 0, 7936, 7937, 0, 0, 0, 0, 8118,
+ 8115, 0, 0, 0, 0, 0, 8050, 941, 7952, 7953, 0, 0, 0, 8052, 942, 0, 0, 0,
+ 0, 7968, 7969, 0, 0, 0, 0, 8134, 8131, 0, 8054, 943, 0, 0, 8145, 8144, 0,
+ 970, 0, 0, 7984, 7985, 8150, 0, 0, 0, 0, 0, 0, 8056, 972, 0, 0, 0, 0,
+ 8000, 8001, 0, 8164, 8165, 0, 0, 0, 8058, 973, 0, 0, 8161, 8160, 0, 971,
+ 0, 0, 0, 0, 0, 0, 8016, 8017, 0, 0, 0, 0, 8166, 0, 0, 8060, 974, 0, 0, 0,
+ 0, 8032, 8033, 8182, 8179, 0, 0, 0, 0, 0, 8146, 912, 0, 0, 0, 0, 0, 0,
+ 8151, 0, 0, 8162, 944, 0, 0, 8167, 0, 0, 0, 8180, 0, 0, 979, 0, 0, 0, 0,
+ 0, 980, 0, 0, 1031, 0, 0, 0, 0, 1232, 0, 1234, 0, 0, 0, 0, 1027, 0, 1024,
+ 0, 0, 0, 0, 1238, 0, 1025, 1217, 0, 1244, 0, 0, 1246, 0, 0, 0, 1037, 0,
+ 0, 0, 1250, 1049, 0, 1252, 0, 0, 0, 0, 1036, 0, 0, 0, 0, 1254, 0, 0, 0,
+ 1262, 1038, 0, 1264, 0, 0, 1266, 0, 0, 0, 1268, 0, 0, 0, 0, 0, 0, 1272,
+ 0, 0, 1260, 0, 0, 0, 0, 1233, 0, 1235, 0, 0, 0, 0, 1107, 0, 1104, 0, 0,
+ 0, 0, 1239, 0, 1105, 1218, 0, 1245, 0, 0, 1247, 0, 0, 0, 1117, 0, 0, 0,
+ 1251, 1081, 0, 1253, 0, 0, 0, 0, 1116, 0, 0, 0, 0, 1255, 0, 0, 0, 1263,
+ 1118, 0, 1265, 0, 0, 1267, 0, 0, 0, 1269, 0, 0, 0, 0, 0, 0, 1273, 0, 0,
+ 1261, 0, 0, 1111, 0, 0, 0, 1142, 0, 0, 1143, 0, 0, 0, 0, 0, 1242, 0, 0,
+ 1243, 0, 0, 1258, 0, 0, 0, 0, 0, 0, 1259, 0, 1570, 1571, 1573, 0, 1572,
+ 0, 0, 1574, 0, 0, 0, 0, 0, 0, 1730, 0, 0, 1747, 0, 0, 1728, 0, 0, 0, 0,
+ 2345, 0, 0, 2353, 0, 0, 2356, 0, 0, 0, 2507, 2508, 0, 0, 0, 2891, 2888,
+ 2892, 2964, 0, 0, 0, 0, 0, 3018, 3020, 0, 3019, 0, 0, 0, 0, 3144, 0, 0,
+ 0, 0, 3264, 0, 3274, 3271, 3272, 0, 3275, 0, 0, 0, 0, 3402, 3404, 0,
+ 3403, 0, 0, 0, 0, 3546, 3548, 3550, 0, 0, 0, 0, 3549, 0, 0, 0, 0, 0,
+ 4134, 0, 0, 0, 6918, 0, 0, 6920, 0, 0, 6922, 0, 0, 6924, 0, 0, 0, 0, 0,
+ 0, 6926, 0, 0, 6930, 0, 0, 6971, 0, 0, 6973, 0, 0, 0, 0, 0, 0, 6976, 0,
+ 0, 6977, 0, 0, 6979, 0, 0, 0, 7736, 0, 0, 7737, 0, 0, 0, 0, 0, 0, 7772,
+ 0, 0, 7773, 0, 0, 0, 0, 7784, 0, 0, 7785, 0, 0, 7852, 0, 0, 7862, 0, 0,
+ 0, 7853, 0, 0, 7863, 0, 0, 0, 7878, 0, 0, 7879, 0, 0, 7896, 0, 0, 7897,
+ 0, 0, 0, 0, 7938, 7940, 0, 0, 7942, 8064, 0, 7939, 7941, 0, 0, 7943,
+ 8065, 0, 0, 8066, 0, 0, 0, 0, 0, 0, 8067, 0, 0, 8068, 0, 0, 8069, 0, 0,
+ 8070, 0, 0, 0, 0, 0, 0, 8071, 0, 7946, 7948, 0, 0, 7950, 8072, 0, 7947,
+ 7949, 0, 0, 7951, 8073, 0, 0, 8074, 0, 0, 0, 0, 0, 0, 8075, 0, 0, 8076,
+ 0, 0, 8077, 0, 0, 8078, 0, 0, 0, 0, 0, 0, 8079, 0, 7954, 7956, 0, 7955,
+ 7957, 0, 0, 0, 0, 0, 7962, 7964, 0, 0, 0, 0, 0, 7963, 7965, 0, 7970,
+ 7972, 0, 0, 7974, 8080, 0, 7971, 7973, 0, 0, 7975, 8081, 0, 0, 8082, 0,
+ 0, 0, 0, 0, 0, 8083, 0, 0, 8084, 0, 0, 8085, 0, 0, 8086, 0, 0, 0, 0, 0,
+ 0, 8087, 0, 7978, 7980, 0, 0, 7982, 8088, 0, 7979, 7981, 0, 0, 7983,
+ 8089, 0, 0, 8090, 0, 0, 0, 0, 0, 0, 8091, 0, 0, 8092, 0, 0, 8093, 0, 0,
+ 8094, 0, 0, 0, 0, 0, 0, 8095, 0, 7986, 7988, 0, 0, 7990, 0, 0, 7987,
+ 7989, 0, 0, 7991, 0, 0, 0, 0, 0, 0, 7994, 7996, 0, 0, 0, 0, 0, 0, 7998,
+ 0, 0, 7995, 7997, 0, 0, 7999, 0, 0, 8002, 8004, 0, 8003, 8005, 0, 0, 0,
+ 0, 0, 8010, 8012, 0, 0, 0, 0, 0, 8011, 8013, 0, 8018, 8020, 0, 0, 8022,
+ 0, 0, 8019, 8021, 0, 0, 8023, 0, 0, 0, 0, 0, 0, 8027, 8029, 0, 0, 0, 0,
+ 0, 0, 8031, 0, 0, 8034, 8036, 0, 0, 8038, 8096, 0, 8035, 8037, 0, 0,
+ 8039, 8097, 0, 0, 8098, 0, 0, 8099, 0, 0, 0, 0, 0, 0, 8100, 0, 0, 8101,
+ 0, 0, 8102, 0, 0, 8103, 0, 0, 0, 0, 0, 8042, 8044, 0, 0, 8046, 8104, 0,
+ 8043, 8045, 0, 0, 8047, 8105, 0, 0, 8106, 0, 0, 8107, 0, 0, 0, 0, 0, 0,
+ 8108, 0, 0, 8109, 0, 0, 8110, 0, 0, 8111, 0, 0, 0, 0, 0, 0, 8114, 0, 0,
+ 8130, 0, 0, 8178, 0, 0, 8119, 0, 0, 0, 0, 0, 8141, 8142, 0, 0, 8143, 0,
+ 0, 0, 8135, 0, 0, 8183, 0, 0, 0, 0, 0, 8157, 8158, 0, 0, 0, 0, 0, 0,
+ 8159, 0, 8602, 0, 0, 8603, 0, 0, 0, 0, 0, 0, 8622, 0, 0, 8653, 0, 0,
+ 8655, 0, 0, 8654, 0, 0, 0, 0, 0, 0, 8708, 0, 0, 8713, 0, 0, 8716, 0, 0,
+ 8740, 0, 0, 0, 0, 0, 0, 8742, 0, 0, 8769, 0, 0, 8772, 0, 0, 8775, 0, 0,
+ 0, 0, 0, 0, 8777, 0, 0, 8813, 0, 0, 8802, 0, 0, 8816, 0, 0, 0, 0, 0, 0,
+ 8817, 0, 0, 8820, 0, 0, 8821, 0, 0, 8824, 0, 0, 0, 0, 0, 0, 8825, 0, 0,
+ 8832, 0, 0, 8833, 0, 0, 8928, 0, 0, 0, 0, 0, 0, 8929, 0, 0, 8836, 0, 0,
+ 8837, 0, 0, 8840, 0, 0, 0, 0, 0, 0, 8841, 0, 0, 8930, 0, 0, 8931, 0, 0,
+ 8876, 0, 0, 0, 0, 0, 0, 8877, 0, 0, 8878, 0, 0, 8879, 0, 0, 8938, 0, 0,
+ 0, 0, 0, 0, 8939, 0, 0, 8940, 0, 0, 8941, 0, 0, 0, 12436, 0, 0, 12364, 0,
+ 0, 0, 0, 0, 0, 12366, 0, 0, 12368, 0, 0, 12370, 0, 0, 12372, 0, 0, 0, 0,
+ 0, 0, 12374, 0, 0, 12376, 0, 0, 12378, 0, 0, 12380, 0, 0, 0, 0, 0, 0,
+ 12382, 0, 0, 12384, 0, 0, 12386, 0, 0, 12389, 0, 0, 0, 0, 0, 0, 12391, 0,
+ 0, 12393, 0, 0, 12400, 12401, 0, 12403, 12404, 0, 0, 0, 0, 0, 12406,
+ 12407, 0, 0, 0, 0, 0, 12409, 12410, 0, 12412, 12413, 0, 12446, 0, 0, 0,
+ 0, 0, 0, 12532, 0, 0, 12460, 0, 0, 12462, 0, 0, 12464, 0, 0, 0, 0, 0, 0,
+ 12466, 0, 0, 12468, 0, 0, 12470, 0, 0, 12472, 0, 0, 0, 0, 0, 0, 12474, 0,
+ 0, 12476, 0, 0, 12478, 0, 0, 12480, 0, 0, 0, 0, 0, 0, 12482, 0, 0, 12485,
+ 0, 0, 12487, 0, 0, 12489, 0, 0, 0, 0, 0, 0, 12496, 12497, 0, 0, 0, 0, 0,
+ 12499, 12500, 0, 12502, 12503, 0, 12505, 12506, 0, 0, 0, 0, 0, 12508,
+ 12509, 0, 0, 0, 0, 0, 12535, 0, 0, 12536, 0, 0, 12537, 0, 0, 0, 0, 0, 0,
+ 12538, 0, 0, 12542, 0, 0, 0, 0, 69786, 0, 0, 69788, 0, 0, 69803,
};
static const change_record change_records_3_2_0[] = {
@@ -4700,6 +5040,13 @@ static const change_record change_records_3_2_0[] = {
{ 255, 29, 255, 255, 0 },
{ 255, 26, 255, 255, 0 },
{ 5, 255, 255, 255, 0 },
+ { 14, 6, 255, 255, 0 },
+ { 15, 255, 255, 255, 0 },
+ { 255, 255, 255, 255, 1.0 },
+ { 255, 255, 255, 255, 2.0 },
+ { 255, 255, 255, 255, 3.0 },
+ { 255, 255, 255, 255, 4.0 },
+ { 255, 255, 255, 255, -1 },
{ 14, 255, 255, 255, 0 },
{ 255, 255, 255, 0, 0 },
{ 255, 7, 1, 255, 0 },
@@ -4723,83 +5070,87 @@ static const change_record change_records_3_2_0[] = {
{ 255, 255, 7, 255, 0 },
{ 255, 255, 8, 255, 0 },
{ 255, 255, 9, 255, 0 },
+ { 255, 30, 255, 255, 0 },
{ 19, 30, 255, 255, 0 },
{ 255, 8, 255, 255, 0 },
{ 255, 22, 255, 255, 0 },
{ 255, 23, 255, 255, 0 },
{ 9, 255, 255, 255, 0 },
{ 255, 20, 255, 255, 0 },
+ { 255, 255, 255, 255, 1e+16 },
+ { 255, 255, 255, 255, 1e+20 },
{ 255, 19, 255, 255, 0 },
- { 255, 255, 255, 255, -1 },
- { 15, 255, 255, 255, 0 },
{ 255, 19, 255, 255, -1 },
+ { 1, 255, 255, 0, 0 },
};
static unsigned char changes_3_2_0_index[] = {
- 0, 1, 2, 2, 3, 4, 5, 6, 2, 7, 8, 9, 10, 11, 12, 13, 2, 2, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 2, 2, 2, 23, 24, 25, 26, 2, 2, 27, 28, 29, 30, 2, 2,
- 2, 2, 2, 31, 2, 32, 33, 34, 35, 36, 37, 2, 38, 39, 40, 2, 41, 42, 2, 43,
- 2, 2, 44, 45, 46, 47, 48, 2, 2, 49, 50, 51, 2, 2, 52, 53, 2, 54, 55, 55,
- 2, 2, 2, 2, 56, 2, 57, 58, 59, 60, 61, 2, 2, 2, 2, 62, 63, 64, 65, 66,
- 67, 68, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 69, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 0, 1, 2, 2, 3, 4, 5, 6, 2, 7, 8, 9, 10, 11, 12, 13, 14, 2, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 2, 2, 2, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 2, 2, 2, 35, 36, 2, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 2, 50, 2, 2, 51, 52, 53, 54, 55, 2, 2, 56, 57, 58, 2, 2, 59, 60, 61,
+ 62, 63, 63, 2, 2, 2, 2, 64, 2, 65, 66, 67, 68, 69, 2, 2, 2, 2, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, 2, 2, 2, 2, 2, 2, 79, 2, 2, 2, 2, 2, 80, 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, 2, 2, 2, 2, 81, 2, 82, 2, 2, 2, 2, 2, 2, 2, 2, 83,
+ 84, 2, 2, 2, 2, 2, 2, 2, 85, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 86, 87,
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, 88, 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, 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, 89, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 90, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 91, 92, 2, 2, 2, 2, 2, 2, 2, 2, 93, 48, 48,
+ 94, 95, 48, 96, 97, 98, 99, 100, 101, 102, 103, 104, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 70, 71, 2, 2, 2, 2, 2, 2, 2, 2, 2, 41, 41, 72, 73, 41, 74, 75, 76, 77,
- 2, 78, 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, 105, 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, 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, 2, 2, 106, 107, 108, 109, 110, 111, 2, 2, 2, 112, 113, 2, 114, 115,
+ 116, 117, 118, 119, 2, 120, 121, 122, 123, 124, 2, 2, 2, 2, 2, 2, 125, 2,
+ 126, 2, 127, 2, 128, 2, 129, 2, 2, 2, 130, 2, 2, 2, 131, 132, 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, 48, 48, 48, 48, 48, 48, 133, 2, 134, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48, 48, 48, 48, 48, 48, 48, 48,
+ 135, 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, 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, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 79, 80, 81, 82, 83, 2, 2, 2,
- 2, 84, 85, 2, 86, 87, 88, 89, 90, 91, 2, 92, 93, 94, 95, 96, 2, 2, 2, 2,
- 2, 2, 97, 2, 98, 2, 99, 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, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 41, 41, 41, 41, 41, 41, 100, 2, 101, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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,
- 102, 2, 103, 2, 104, 2, 2, 105, 2, 2, 2, 106, 107, 108, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 109, 110, 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, 2, 2, 2, 48, 48, 48, 48, 136, 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, 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, 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, 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, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 137, 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, 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, 2, 138, 2, 139, 2, 140, 2, 2, 141, 2, 2, 2, 142, 143, 144, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 145,
+ 146, 147, 148, 149, 2, 150, 151, 152, 153, 154, 155, 156, 139, 157, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 158, 159, 90, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 79, 160, 2, 161, 162, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 163, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 164, 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, 2, 2, 165, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 166, 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, 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, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 167, 48, 168, 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, 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, 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, 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, 111, 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, 163,
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, 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, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -5035,7 +5386,7 @@ static unsigned char changes_3_2_0_index[] = {
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, 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, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 41, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 48, 169, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -5099,7 +5450,7 @@ static unsigned char changes_3_2_0_index[] = {
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, 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, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2,
};
static unsigned char changes_3_2_0_data[] = {
@@ -5147,7 +5498,7 @@ static unsigned char changes_3_2_0_data[] = {
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, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 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,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -5157,17 +5508,17 @@ static unsigned char changes_3_2_0_data[] = {
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, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 0, 7, 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, 7, 7, 7, 7, 7,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 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,
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, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
- 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, 13, 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, 7, 7, 7,
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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
@@ -5177,263 +5528,305 @@ static unsigned char changes_3_2_0_data[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 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,
+ 7, 0, 0, 0, 7, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7,
+ 0, 7, 7, 7, 7, 7, 7, 7, 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, 7, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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, 14, 15, 16, 17, 18, 0, 0, 7, 0, 0, 0, 0, 0, 7, 0, 7, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7,
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, 7, 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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7, 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, 7, 0, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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, 7,
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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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, 7, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 0,
+ 19, 0, 0, 0, 0, 0, 0, 19, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 7, 7, 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, 7, 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, 7, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 7, 0, 0, 7, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 7, 7,
+ 7, 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, 20, 20, 20, 20, 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, 7, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 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, 7, 7,
+ 7, 7, 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, 7, 0, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 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, 7, 7, 0, 12, 0, 0, 0, 0, 0, 0, 12, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 7, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7,
+ 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
- 0, 0, 0, 0, 7, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 0, 7, 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, 13, 13, 13, 13, 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, 7, 7, 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, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 7, 0, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0,
- 0, 7, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7,
- 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7,
- 7, 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, 7, 7, 7, 7,
+ 7, 7, 0, 0, 0, 0, 0, 0, 0, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 7, 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, 7, 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,
- 7, 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, 7, 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, 7, 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, 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 7, 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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 7, 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, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 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, 7, 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, 7, 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,
- 7, 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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7, 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, 7, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0,
- 0, 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 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, 7, 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, 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, 13, 13, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 23, 23, 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, 7, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 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, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 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, 20, 20, 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, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 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, 7, 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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
- 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 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, 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, 7, 7, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
+ 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 0, 0, 0, 0, 7, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0,
- 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0,
+ 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 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, 7, 7, 7, 7, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 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, 7, 7, 7, 7, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 25, 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, 26, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0,
- 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 29, 30, 31, 32, 33, 34,
- 1, 1, 0, 0, 0, 0, 28, 6, 4, 5, 29, 30, 31, 32, 33, 34, 1, 1, 0, 0, 0, 0,
- 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 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, 7,
+ 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 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, 7, 7, 7, 7, 7,
- 7, 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, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 0, 7, 7, 7,
+ 7, 7, 7, 7, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 8, 0,
+ 0, 36, 37, 38, 39, 40, 41, 1, 1, 0, 0, 0, 8, 35, 6, 4, 5, 36, 37, 38, 39,
+ 40, 41, 1, 1, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7,
+ 7, 7, 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, 35, 0, 0, 0, 0, 0,
- 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 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,
+ 42, 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, 43, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 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, 36, 7, 7, 7, 7, 7, 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, 44, 7, 7, 7, 7, 7, 7, 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, 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, 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, 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, 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, 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, 37, 38, 10,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 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, 45, 46, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 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, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 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, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 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, 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, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 7, 7, 0, 0, 7, 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, 47, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 7, 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, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 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,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 7, 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, 7, 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, 7, 0, 7, 0, 0, 0, 0, 7, 7, 7, 0, 7, 0, 0,
+ 0, 0, 0, 0, 0, 7, 7, 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, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 0, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 0, 7, 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, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 7, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 0,
7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 0,
7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 0,
- 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -5441,108 +5834,210 @@ static unsigned char changes_3_2_0_data[] = {
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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 48, 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, 7, 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, 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, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 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, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 7, 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, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 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, 7, 7, 7, 7,
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, 7, 7, 7, 7, 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, 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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
- 7, 7, 7, 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, 7, 7, 7, 7, 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, 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, 7, 7,
+ 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, 7, 0, 0, 0, 0, 0, 18, 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, 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, 18, 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, 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, 0, 0, 7, 7, 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, 7, 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, 18, 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, 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, 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, 18, 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, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 18, 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, 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, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 18, 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, 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, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7,
+ 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, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 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, 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, 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, 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, 18, 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, 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, 0, 0, 0, 18, 0,
+ 0, 0, 0, 0, 0, 0, 18, 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, 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, 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, 18, 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, 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, 18, 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, 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, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 51, 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, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7,
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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 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, 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, 42, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0,
- 42, 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, 42, 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, 42, 0, 42, 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, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 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, 18, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0,
+ 18, 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, 18, 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, 18, 0, 18, 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, 18, 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, 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, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
@@ -5555,160 +6050,320 @@ static unsigned char changes_3_2_0_data[] = {
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, 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, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 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, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 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, 7,
- 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 13, 13, 13,
- 13, 0, 0, 0, 1, 1, 13, 13, 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, 1, 0,
- 1, 0, 2, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 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, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 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, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 20, 20, 20, 20, 20, 20, 0, 0, 0, 1, 1, 20, 20, 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, 1, 0, 1, 0, 2, 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, 43, 43, 43,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 0, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 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, 48,
+ 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 13, 13, 13, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7,
+ 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 0,
- 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
+ 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 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, 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, 52, 0, 0, 0,
+ 0, 0, 0, 0, 0, 18, 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, 44, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 7, 7, 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, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 0, 0, 7, 0, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 0, 0, 0, 7,
+ 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0,
+ 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 7, 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, 7, 7, 7, 7, 0, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 0,
+ 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 0, 0, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 0, 0, 0, 7, 0, 0, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
- 0, 0, 0, 7, 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, 7, 7, 7, 7,
- 0, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 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, 7, 7, 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, 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, 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, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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, 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, 7, 7, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 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, 13,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 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, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 53, 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, 13, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 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, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 53, 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, 13, 0, 0, 0, 0, 0, 0, 7, 7,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 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, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 7, 7, 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, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7,
+ 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 0, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 0, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 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, 42, 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, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 0, 7, 0, 7, 0, 7, 0, 7,
+ 7, 7, 0, 7, 7, 7, 7, 7, 7, 0, 0, 7, 7, 7, 7, 0, 7, 0, 0, 7, 7, 7, 7, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 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, 18, 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, 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, 18, 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, 18, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 18, 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,
+ 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 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, 18, 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, 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, 18, 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, 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, 0, 0, 0, 0, 0, 0, 0, 18, 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, 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, 0, 0, 18, 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, 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, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 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, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
static const change_record* get_change_3_2_0(Py_UCS4 n)
diff --git a/Modules/unicodename_db.h b/Modules/unicodename_db.h
index dd4e44dbf9..8830560c1f 100644
--- a/Modules/unicodename_db.h
+++ b/Modules/unicodename_db.h
@@ -1,4 +1,4 @@
-/* this file was generated by Tools/unicode/makeunicodedata.py 2.6 */
+/* this file was generated by Tools/unicode/makeunicodedata.py 3.2 */
#define NAME_MAXLEN 256
@@ -6,2789 +6,3552 @@
static unsigned char lexicon[] = {
76, 69, 84, 84, 69, 210, 87, 73, 84, 200, 83, 77, 65, 76, 204, 83, 89,
76, 76, 65, 66, 76, 197, 83, 73, 71, 206, 67, 65, 80, 73, 84, 65, 204,
- 76, 65, 84, 73, 206, 89, 201, 67, 74, 203, 65, 82, 65, 66, 73, 195, 67,
- 79, 77, 80, 65, 84, 73, 66, 73, 76, 73, 84, 217, 77, 65, 84, 72, 69, 77,
- 65, 84, 73, 67, 65, 204, 67, 85, 78, 69, 73, 70, 79, 82, 205, 83, 89, 77,
- 66, 79, 204, 70, 79, 82, 77, 128, 67, 65, 78, 65, 68, 73, 65, 206, 83,
- 89, 76, 76, 65, 66, 73, 67, 211, 66, 79, 76, 196, 71, 82, 69, 69, 203,
- 76, 73, 71, 65, 84, 85, 82, 197, 68, 73, 71, 73, 212, 65, 78, 196, 77,
- 85, 83, 73, 67, 65, 204, 84, 73, 77, 69, 211, 69, 84, 72, 73, 79, 80, 73,
- 195, 72, 65, 78, 71, 85, 204, 73, 84, 65, 76, 73, 195, 67, 89, 82, 73,
- 76, 76, 73, 195, 82, 65, 68, 73, 67, 65, 204, 83, 65, 78, 83, 45, 83, 69,
- 82, 73, 198, 86, 79, 87, 69, 204, 70, 79, 210, 67, 73, 82, 67, 76, 69,
- 196, 86, 65, 201, 70, 73, 78, 65, 204, 67, 79, 77, 66, 73, 78, 73, 78,
- 199, 83, 81, 85, 65, 82, 197, 86, 65, 82, 73, 65, 84, 73, 79, 206, 66,
- 82, 65, 73, 76, 76, 197, 80, 65, 84, 84, 69, 82, 206, 82, 73, 71, 72,
- 212, 76, 69, 70, 212, 66, 89, 90, 65, 78, 84, 73, 78, 197, 73, 83, 79,
- 76, 65, 84, 69, 196, 194, 65, 66, 79, 86, 69, 128, 68, 79, 85, 66, 76,
- 197, 75, 65, 84, 65, 75, 65, 78, 193, 75, 65, 78, 71, 88, 201, 76, 73,
- 78, 69, 65, 210, 66, 69, 76, 79, 87, 128, 77, 79, 68, 73, 70, 73, 69,
- 210, 83, 73, 71, 78, 128, 84, 73, 66, 69, 84, 65, 206, 77, 69, 69, 205,
- 68, 79, 212, 65, 128, 65, 82, 82, 79, 87, 128, 73, 78, 73, 84, 73, 65,
- 204, 67, 65, 82, 82, 73, 69, 210, 86, 69, 82, 84, 73, 67, 65, 204, 89,
- 69, 200, 87, 72, 73, 84, 197, 65, 66, 79, 86, 197, 78, 85, 77, 66, 69,
- 210, 85, 128, 65, 82, 82, 79, 215, 77, 79, 78, 71, 79, 76, 73, 65, 206,
- 77, 89, 65, 78, 77, 65, 210, 67, 79, 80, 84, 73, 195, 75, 72, 77, 69,
- 210, 79, 128, 73, 128, 84, 73, 76, 197, 77, 65, 82, 75, 128, 66, 79, 216,
- 72, 69, 66, 82, 69, 215, 80, 76, 85, 211, 68, 82, 65, 87, 73, 78, 71,
- 211, 82, 73, 71, 72, 84, 87, 65, 82, 68, 211, 83, 84, 82, 79, 75, 69,
- 128, 72, 65, 76, 70, 87, 73, 68, 84, 200, 66, 65, 76, 73, 78, 69, 83,
- 197, 66, 76, 65, 67, 203, 71, 69, 79, 82, 71, 73, 65, 206, 72, 79, 79,
- 75, 128, 73, 68, 69, 79, 71, 82, 65, 205, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 73, 195, 84, 65, 201, 65, 76, 69, 198, 80, 65, 82, 69, 78, 84, 72,
- 69, 83, 73, 90, 69, 196, 68, 69, 86, 65, 78, 65, 71, 65, 82, 201, 83, 67,
- 82, 73, 80, 212, 84, 79, 128, 213, 83, 89, 77, 66, 79, 76, 128, 85, 208,
- 70, 85, 76, 76, 87, 73, 68, 84, 200, 72, 65, 200, 68, 79, 87, 206, 66,
- 82, 65, 67, 75, 69, 84, 128, 69, 81, 85, 65, 204, 79, 198, 79, 86, 69,
- 210, 84, 65, 199, 68, 79, 77, 73, 78, 207, 70, 82, 65, 75, 84, 85, 210,
- 78, 85, 77, 69, 82, 73, 195, 72, 69, 65, 86, 217, 84, 87, 79, 128, 77,
- 65, 76, 65, 89, 65, 76, 65, 205, 71, 76, 65, 71, 79, 76, 73, 84, 73, 195,
- 67, 72, 65, 82, 65, 67, 84, 69, 210, 76, 69, 70, 84, 87, 65, 82, 68, 211,
- 79, 78, 69, 128, 84, 69, 76, 85, 71, 213, 65, 82, 77, 69, 78, 73, 65,
- 206, 66, 69, 78, 71, 65, 76, 201, 67, 72, 79, 83, 69, 79, 78, 199, 74,
- 69, 69, 205, 77, 69, 68, 73, 65, 204, 66, 65, 82, 128, 72, 73, 82, 65,
- 71, 65, 78, 193, 87, 69, 83, 84, 45, 67, 82, 69, 197, 84, 72, 65, 201,
- 75, 65, 78, 78, 65, 68, 193, 67, 72, 69, 82, 79, 75, 69, 197, 72, 65, 76,
- 198, 73, 68, 69, 79, 71, 82, 65, 80, 200, 79, 82, 73, 89, 193, 84, 87,
- 207, 67, 72, 65, 205, 71, 85, 74, 65, 82, 65, 84, 201, 74, 79, 78, 71,
- 83, 69, 79, 78, 199, 78, 69, 215, 82, 85, 78, 73, 195, 83, 65, 85, 82,
- 65, 83, 72, 84, 82, 193, 84, 69, 84, 82, 65, 71, 82, 65, 205, 68, 69, 83,
- 69, 82, 69, 212, 76, 85, 197, 83, 73, 78, 72, 65, 76, 193, 71, 85, 82,
- 77, 85, 75, 72, 201, 78, 79, 84, 65, 84, 73, 79, 206, 83, 89, 82, 73, 65,
- 195, 84, 72, 82, 69, 197, 86, 79, 67, 65, 76, 73, 195, 72, 65, 128, 65,
- 67, 85, 84, 69, 128, 76, 69, 80, 67, 72, 193, 76, 73, 71, 72, 212, 70,
- 79, 85, 82, 128, 68, 79, 85, 66, 76, 69, 45, 83, 84, 82, 85, 67, 203, 84,
- 65, 77, 73, 204, 65, 80, 204, 70, 85, 78, 67, 84, 73, 79, 78, 65, 204,
- 72, 65, 77, 90, 193, 77, 65, 82, 203, 84, 72, 82, 69, 69, 128, 84, 69,
- 76, 69, 71, 82, 65, 80, 200, 79, 78, 197, 72, 79, 82, 73, 90, 79, 78, 84,
- 65, 204, 74, 85, 78, 71, 83, 69, 79, 78, 199, 66, 65, 82, 194, 68, 65,
- 83, 73, 193, 70, 73, 86, 69, 128, 76, 73, 77, 66, 213, 77, 65, 75, 83,
- 85, 82, 193, 66, 79, 80, 79, 77, 79, 70, 207, 75, 65, 128, 75, 72, 65,
- 82, 79, 83, 72, 84, 72, 201, 76, 65, 207, 84, 207, 72, 69, 88, 65, 71,
- 82, 65, 205, 76, 79, 78, 199, 83, 73, 88, 128, 76, 79, 215, 80, 83, 73,
- 76, 201, 69, 73, 71, 72, 84, 128, 75, 193, 77, 79, 78, 79, 83, 80, 65,
- 67, 197, 78, 79, 212, 89, 65, 128, 78, 73, 78, 69, 128, 83, 128, 83, 69,
- 86, 69, 78, 128, 83, 84, 82, 79, 75, 197, 86, 128, 68, 79, 84, 211, 77,
- 65, 128, 82, 69, 86, 69, 82, 83, 69, 196, 72, 73, 71, 200, 75, 72, 65,
- 200, 76, 79, 87, 69, 210, 78, 75, 207, 84, 73, 76, 68, 69, 128, 84, 79,
- 78, 197, 78, 85, 77, 69, 82, 65, 204, 82, 65, 128, 84, 85, 82, 78, 69,
- 196, 65, 69, 71, 69, 65, 206, 72, 128, 80, 65, 128, 71, 128, 76, 65, 71,
- 65, 194, 80, 72, 65, 71, 83, 45, 80, 193, 67, 89, 80, 82, 73, 79, 212,
- 68, 73, 65, 69, 82, 69, 83, 73, 83, 128, 83, 85, 78, 68, 65, 78, 69, 83,
- 197, 84, 73, 70, 73, 78, 65, 71, 200, 68, 128, 90, 90, 89, 88, 128, 90,
- 90, 89, 84, 128, 90, 90, 89, 82, 88, 128, 90, 90, 89, 82, 128, 90, 90,
- 89, 80, 128, 90, 90, 89, 128, 90, 90, 85, 88, 128, 90, 90, 85, 82, 88,
- 128, 90, 90, 85, 82, 128, 90, 90, 85, 80, 128, 90, 90, 85, 128, 90, 90,
- 79, 88, 128, 90, 90, 79, 80, 128, 90, 90, 79, 128, 90, 90, 73, 88, 128,
- 90, 90, 73, 84, 128, 90, 90, 73, 80, 128, 90, 90, 73, 69, 88, 128, 90,
- 90, 73, 69, 84, 128, 90, 90, 73, 69, 80, 128, 90, 90, 73, 69, 128, 90,
- 90, 73, 128, 90, 90, 69, 88, 128, 90, 90, 69, 80, 128, 90, 90, 69, 69,
- 128, 90, 90, 69, 128, 90, 90, 65, 88, 128, 90, 90, 65, 84, 128, 90, 90,
- 65, 80, 128, 90, 90, 65, 65, 128, 90, 90, 65, 128, 90, 89, 71, 79, 83,
- 128, 90, 87, 65, 82, 65, 75, 65, 89, 128, 90, 87, 65, 128, 90, 85, 84,
- 128, 90, 85, 79, 88, 128, 90, 85, 79, 80, 128, 90, 85, 79, 128, 90, 85,
- 77, 128, 90, 85, 66, 85, 82, 128, 90, 85, 53, 128, 90, 85, 181, 90, 82,
- 65, 128, 90, 81, 65, 80, 72, 193, 90, 79, 84, 128, 90, 79, 79, 128, 90,
- 79, 65, 128, 90, 76, 65, 77, 193, 90, 76, 65, 128, 90, 76, 193, 90, 74,
- 69, 128, 90, 73, 90, 50, 128, 90, 73, 78, 79, 82, 128, 90, 73, 76, 68,
- 69, 128, 90, 73, 71, 90, 65, 199, 90, 73, 71, 128, 90, 73, 68, 193, 90,
- 73, 66, 128, 90, 73, 194, 90, 73, 51, 128, 90, 201, 90, 72, 89, 88, 128,
- 90, 72, 89, 84, 128, 90, 72, 89, 82, 88, 128, 90, 72, 89, 82, 128, 90,
- 72, 89, 80, 128, 90, 72, 89, 128, 90, 72, 87, 69, 128, 90, 72, 87, 65,
- 128, 90, 72, 85, 88, 128, 90, 72, 85, 84, 128, 90, 72, 85, 82, 88, 128,
- 90, 72, 85, 82, 128, 90, 72, 85, 80, 128, 90, 72, 85, 79, 88, 128, 90,
- 72, 85, 79, 80, 128, 90, 72, 85, 79, 128, 90, 72, 85, 128, 90, 72, 79,
- 88, 128, 90, 72, 79, 84, 128, 90, 72, 79, 80, 128, 90, 72, 79, 79, 128,
- 90, 72, 79, 128, 90, 72, 73, 86, 69, 84, 69, 128, 90, 72, 73, 128, 90,
- 72, 69, 88, 128, 90, 72, 69, 84, 128, 90, 72, 69, 80, 128, 90, 72, 69,
- 69, 128, 90, 72, 69, 128, 90, 72, 197, 90, 72, 65, 88, 128, 90, 72, 65,
- 84, 128, 90, 72, 65, 82, 128, 90, 72, 65, 80, 128, 90, 72, 65, 73, 78,
- 128, 90, 72, 65, 65, 128, 90, 72, 65, 128, 90, 72, 128, 90, 69, 84, 65,
- 128, 90, 69, 82, 79, 128, 90, 69, 82, 207, 90, 69, 78, 128, 90, 69, 77,
- 76, 89, 65, 128, 90, 69, 77, 76, 74, 65, 128, 90, 69, 50, 128, 90, 197,
- 90, 65, 89, 73, 78, 128, 90, 65, 89, 73, 206, 90, 65, 86, 73, 89, 65, 78,
- 73, 128, 90, 65, 84, 65, 128, 90, 65, 82, 81, 65, 128, 90, 65, 81, 69,
- 198, 90, 65, 77, 88, 128, 90, 65, 204, 90, 65, 73, 78, 128, 90, 65, 73,
- 206, 90, 65, 73, 128, 90, 65, 72, 128, 90, 65, 200, 90, 65, 71, 128, 90,
- 128, 218, 89, 89, 88, 128, 89, 89, 84, 128, 89, 89, 82, 88, 128, 89, 89,
- 82, 128, 89, 89, 80, 128, 89, 89, 65, 128, 89, 89, 128, 89, 87, 79, 79,
- 128, 89, 87, 79, 128, 89, 87, 73, 73, 128, 89, 87, 73, 128, 89, 87, 69,
- 128, 89, 87, 65, 65, 128, 89, 87, 65, 128, 89, 86, 128, 89, 85, 88, 128,
- 89, 85, 85, 75, 65, 76, 69, 65, 80, 73, 78, 84, 85, 128, 89, 85, 84, 128,
- 89, 85, 83, 128, 89, 85, 211, 89, 85, 82, 88, 128, 89, 85, 82, 128, 89,
- 85, 80, 128, 89, 85, 79, 88, 128, 89, 85, 79, 84, 128, 89, 85, 79, 80,
- 128, 89, 85, 79, 128, 89, 85, 68, 72, 128, 89, 85, 68, 200, 89, 85, 65,
+ 76, 65, 84, 73, 206, 89, 201, 67, 74, 203, 69, 71, 89, 80, 84, 73, 65,
+ 206, 72, 73, 69, 82, 79, 71, 76, 89, 80, 200, 65, 82, 65, 66, 73, 195,
+ 67, 79, 77, 80, 65, 84, 73, 66, 73, 76, 73, 84, 217, 77, 65, 84, 72, 69,
+ 77, 65, 84, 73, 67, 65, 204, 67, 85, 78, 69, 73, 70, 79, 82, 205, 83, 89,
+ 77, 66, 79, 204, 70, 79, 82, 77, 128, 67, 65, 78, 65, 68, 73, 65, 206,
+ 83, 89, 76, 76, 65, 66, 73, 67, 211, 66, 65, 77, 85, 205, 68, 73, 71, 73,
+ 212, 66, 79, 76, 196, 72, 65, 78, 71, 85, 204, 65, 78, 196, 71, 82, 69,
+ 69, 203, 76, 73, 71, 65, 84, 85, 82, 197, 77, 85, 83, 73, 67, 65, 204,
+ 69, 84, 72, 73, 79, 80, 73, 195, 84, 73, 77, 69, 211, 86, 79, 87, 69,
+ 204, 70, 79, 210, 73, 84, 65, 76, 73, 195, 67, 89, 82, 73, 76, 76, 73,
+ 195, 82, 65, 68, 73, 67, 65, 204, 83, 65, 78, 83, 45, 83, 69, 82, 73,
+ 198, 67, 73, 82, 67, 76, 69, 196, 67, 79, 77, 66, 73, 78, 73, 78, 199,
+ 84, 65, 201, 86, 65, 201, 70, 73, 78, 65, 204, 83, 81, 85, 65, 82, 197,
+ 76, 69, 70, 212, 86, 65, 82, 73, 65, 84, 73, 79, 206, 66, 82, 65, 73, 76,
+ 76, 197, 80, 65, 84, 84, 69, 82, 206, 82, 73, 71, 72, 212, 66, 89, 90,
+ 65, 78, 84, 73, 78, 197, 73, 83, 79, 76, 65, 84, 69, 196, 65, 66, 79, 86,
+ 69, 128, 78, 85, 77, 66, 69, 210, 68, 79, 85, 66, 76, 197, 83, 73, 71,
+ 78, 128, 194, 66, 69, 76, 79, 87, 128, 75, 65, 84, 65, 75, 65, 78, 193,
+ 75, 65, 78, 71, 88, 201, 76, 73, 78, 69, 65, 210, 77, 79, 68, 73, 70, 73,
+ 69, 210, 84, 73, 66, 69, 84, 65, 206, 65, 128, 68, 79, 212, 77, 69, 69,
+ 205, 77, 89, 65, 78, 77, 65, 210, 79, 198, 67, 65, 82, 82, 73, 69, 210,
+ 87, 72, 73, 84, 197, 65, 82, 82, 79, 87, 128, 85, 128, 73, 78, 73, 84,
+ 73, 65, 204, 86, 69, 82, 84, 73, 67, 65, 204, 73, 128, 89, 69, 200, 79,
+ 128, 65, 82, 82, 79, 215, 77, 65, 82, 75, 128, 65, 66, 79, 86, 197, 67,
+ 79, 80, 84, 73, 195, 80, 72, 65, 83, 69, 45, 197, 77, 79, 78, 71, 79, 76,
+ 73, 65, 206, 68, 69, 86, 65, 78, 65, 71, 65, 82, 201, 66, 76, 65, 67,
+ 203, 75, 72, 77, 69, 210, 84, 73, 76, 197, 80, 65, 82, 69, 78, 84, 72,
+ 69, 83, 73, 90, 69, 196, 83, 89, 77, 66, 79, 76, 128, 84, 72, 65, 205,
+ 74, 79, 78, 71, 83, 69, 79, 78, 199, 83, 84, 82, 79, 75, 69, 128, 83, 81,
+ 85, 65, 82, 69, 196, 66, 79, 216, 72, 69, 66, 82, 69, 215, 80, 76, 85,
+ 211, 82, 73, 71, 72, 84, 87, 65, 82, 68, 211, 68, 82, 65, 87, 73, 78, 71,
+ 211, 67, 72, 79, 83, 69, 79, 78, 199, 72, 65, 76, 70, 87, 73, 68, 84,
+ 200, 66, 65, 76, 73, 78, 69, 83, 197, 71, 69, 79, 82, 71, 73, 65, 206,
+ 72, 79, 79, 75, 128, 73, 68, 69, 79, 71, 82, 65, 205, 80, 72, 65, 83, 69,
+ 45, 196, 65, 76, 67, 72, 69, 77, 73, 67, 65, 204, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 73, 195, 65, 76, 69, 198, 72, 69, 65, 86, 217, 84, 79, 128,
+ 84, 87, 79, 128, 79, 86, 69, 210, 213, 66, 82, 65, 72, 77, 201, 83, 67,
+ 82, 73, 80, 212, 85, 208, 76, 79, 215, 79, 78, 69, 128, 84, 87, 207, 68,
+ 79, 87, 206, 70, 85, 76, 76, 87, 73, 68, 84, 200, 72, 65, 200, 79, 78,
+ 197, 69, 81, 85, 65, 204, 72, 73, 71, 200, 66, 82, 65, 67, 75, 69, 84,
+ 128, 84, 65, 199, 68, 79, 77, 73, 78, 207, 78, 85, 77, 69, 82, 73, 195,
+ 70, 82, 65, 75, 84, 85, 210, 77, 65, 76, 65, 89, 65, 76, 65, 205, 80, 72,
+ 65, 83, 69, 45, 195, 76, 69, 70, 84, 87, 65, 82, 68, 211, 84, 72, 82, 69,
+ 197, 66, 65, 82, 128, 74, 85, 78, 71, 83, 69, 79, 78, 199, 71, 76, 65,
+ 71, 79, 76, 73, 84, 73, 195, 67, 72, 65, 82, 65, 67, 84, 69, 210, 77, 69,
+ 68, 73, 65, 204, 84, 69, 76, 85, 71, 213, 66, 69, 78, 71, 65, 76, 201,
+ 65, 82, 77, 69, 78, 73, 65, 206, 72, 73, 82, 65, 71, 65, 78, 193, 73, 68,
+ 69, 79, 71, 82, 65, 80, 200, 74, 65, 86, 65, 78, 69, 83, 197, 74, 69, 69,
+ 205, 78, 69, 71, 65, 84, 73, 86, 197, 79, 82, 73, 89, 193, 87, 69, 83,
+ 84, 45, 67, 82, 69, 197, 72, 65, 76, 198, 77, 65, 82, 203, 80, 72, 65,
+ 83, 69, 45, 193, 84, 72, 65, 201, 75, 65, 78, 78, 65, 68, 193, 78, 69,
+ 215, 67, 72, 69, 82, 79, 75, 69, 197, 72, 65, 128, 84, 79, 78, 197, 86,
+ 79, 67, 65, 76, 73, 195, 67, 72, 65, 205, 70, 79, 85, 82, 128, 71, 85,
+ 74, 65, 82, 65, 84, 201, 76, 85, 197, 84, 72, 82, 69, 69, 128, 82, 85,
+ 78, 73, 195, 83, 65, 85, 82, 65, 83, 72, 84, 82, 193, 84, 69, 84, 82, 65,
+ 71, 82, 65, 205, 68, 69, 83, 69, 82, 69, 212, 83, 73, 78, 72, 65, 76,
+ 193, 71, 85, 82, 77, 85, 75, 72, 201, 78, 79, 84, 65, 84, 73, 79, 206,
+ 83, 89, 82, 73, 65, 195, 68, 79, 84, 211, 76, 73, 71, 72, 212, 84, 65,
+ 77, 73, 204, 65, 67, 85, 84, 69, 128, 70, 73, 86, 69, 128, 75, 65, 128,
+ 76, 69, 80, 67, 72, 193, 76, 79, 78, 199, 84, 85, 82, 75, 73, 195, 89,
+ 65, 128, 68, 79, 85, 66, 76, 69, 45, 83, 84, 82, 85, 67, 203, 77, 65,
+ 128, 83, 73, 88, 128, 86, 73, 69, 212, 72, 65, 77, 90, 193, 80, 65, 128,
+ 65, 80, 204, 69, 73, 71, 72, 84, 128, 70, 85, 78, 67, 84, 73, 79, 78, 65,
+ 204, 83, 128, 83, 69, 86, 69, 78, 128, 72, 79, 82, 73, 90, 79, 78, 84,
+ 65, 204, 78, 73, 78, 69, 128, 84, 69, 76, 69, 71, 82, 65, 80, 200, 66,
+ 79, 80, 79, 77, 79, 70, 207, 82, 65, 128, 78, 65, 128, 66, 65, 82, 194,
+ 68, 65, 83, 73, 193, 75, 65, 73, 84, 72, 201, 76, 73, 77, 66, 213, 77,
+ 65, 75, 83, 85, 82, 193, 84, 207, 90, 90, 89, 88, 128, 90, 90, 89, 84,
+ 128, 90, 90, 89, 82, 88, 128, 90, 90, 89, 82, 128, 90, 90, 89, 80, 128,
+ 90, 90, 89, 128, 90, 90, 85, 88, 128, 90, 90, 85, 82, 88, 128, 90, 90,
+ 85, 82, 128, 90, 90, 85, 80, 128, 90, 90, 85, 128, 90, 90, 79, 88, 128,
+ 90, 90, 79, 80, 128, 90, 90, 79, 128, 90, 90, 73, 88, 128, 90, 90, 73,
+ 84, 128, 90, 90, 73, 80, 128, 90, 90, 73, 69, 88, 128, 90, 90, 73, 69,
+ 84, 128, 90, 90, 73, 69, 80, 128, 90, 90, 73, 69, 128, 90, 90, 73, 128,
+ 90, 90, 69, 88, 128, 90, 90, 69, 80, 128, 90, 90, 69, 69, 128, 90, 90,
+ 69, 128, 90, 90, 65, 88, 128, 90, 90, 65, 84, 128, 90, 90, 65, 80, 128,
+ 90, 90, 65, 65, 128, 90, 90, 65, 128, 90, 89, 71, 79, 83, 128, 90, 87,
+ 65, 82, 65, 75, 65, 89, 128, 90, 87, 65, 128, 90, 85, 84, 128, 90, 85,
+ 79, 88, 128, 90, 85, 79, 80, 128, 90, 85, 79, 128, 90, 85, 77, 128, 90,
+ 85, 66, 85, 82, 128, 90, 85, 53, 128, 90, 85, 181, 90, 82, 65, 128, 90,
+ 81, 65, 80, 72, 193, 90, 79, 84, 128, 90, 79, 79, 128, 90, 79, 65, 128,
+ 90, 76, 65, 77, 193, 90, 76, 65, 128, 90, 76, 193, 90, 74, 69, 128, 90,
+ 73, 90, 50, 128, 90, 73, 81, 65, 65, 128, 90, 73, 78, 79, 82, 128, 90,
+ 73, 76, 68, 69, 128, 90, 73, 71, 90, 65, 199, 90, 73, 71, 128, 90, 73,
+ 68, 193, 90, 73, 66, 128, 90, 73, 194, 90, 73, 51, 128, 90, 201, 90, 72,
+ 89, 88, 128, 90, 72, 89, 84, 128, 90, 72, 89, 82, 88, 128, 90, 72, 89,
+ 82, 128, 90, 72, 89, 80, 128, 90, 72, 89, 128, 90, 72, 87, 69, 128, 90,
+ 72, 87, 65, 128, 90, 72, 85, 88, 128, 90, 72, 85, 84, 128, 90, 72, 85,
+ 82, 88, 128, 90, 72, 85, 82, 128, 90, 72, 85, 80, 128, 90, 72, 85, 79,
+ 88, 128, 90, 72, 85, 79, 80, 128, 90, 72, 85, 79, 128, 90, 72, 85, 128,
+ 90, 72, 79, 88, 128, 90, 72, 79, 84, 128, 90, 72, 79, 80, 128, 90, 72,
+ 79, 79, 128, 90, 72, 79, 128, 90, 72, 73, 86, 69, 84, 69, 128, 90, 72,
+ 73, 128, 90, 72, 69, 88, 128, 90, 72, 69, 84, 128, 90, 72, 69, 80, 128,
+ 90, 72, 69, 69, 128, 90, 72, 69, 128, 90, 72, 197, 90, 72, 65, 88, 128,
+ 90, 72, 65, 84, 128, 90, 72, 65, 82, 128, 90, 72, 65, 80, 128, 90, 72,
+ 65, 73, 78, 128, 90, 72, 65, 65, 128, 90, 72, 65, 128, 90, 72, 128, 90,
+ 69, 84, 65, 128, 90, 69, 82, 79, 128, 90, 69, 82, 207, 90, 69, 78, 128,
+ 90, 69, 77, 76, 89, 65, 128, 90, 69, 77, 76, 74, 65, 128, 90, 69, 50,
+ 128, 90, 197, 90, 65, 89, 78, 128, 90, 65, 89, 73, 78, 128, 90, 65, 89,
+ 73, 206, 90, 65, 86, 73, 89, 65, 78, 73, 128, 90, 65, 84, 65, 128, 90,
+ 65, 82, 81, 65, 128, 90, 65, 81, 69, 198, 90, 65, 77, 88, 128, 90, 65,
+ 204, 90, 65, 73, 78, 128, 90, 65, 73, 206, 90, 65, 73, 128, 90, 65, 72,
+ 128, 90, 65, 200, 90, 65, 71, 128, 90, 65, 69, 70, 128, 90, 48, 49, 54,
+ 72, 128, 90, 48, 49, 54, 71, 128, 90, 48, 49, 54, 70, 128, 90, 48, 49,
+ 54, 69, 128, 90, 48, 49, 54, 68, 128, 90, 48, 49, 54, 67, 128, 90, 48,
+ 49, 54, 66, 128, 90, 48, 49, 54, 65, 128, 90, 48, 49, 54, 128, 90, 48,
+ 49, 53, 73, 128, 90, 48, 49, 53, 72, 128, 90, 48, 49, 53, 71, 128, 90,
+ 48, 49, 53, 70, 128, 90, 48, 49, 53, 69, 128, 90, 48, 49, 53, 68, 128,
+ 90, 48, 49, 53, 67, 128, 90, 48, 49, 53, 66, 128, 90, 48, 49, 53, 65,
+ 128, 90, 48, 49, 53, 128, 90, 48, 49, 52, 128, 90, 48, 49, 51, 128, 90,
+ 48, 49, 50, 128, 90, 48, 49, 49, 128, 90, 48, 49, 48, 128, 90, 48, 48,
+ 57, 128, 90, 48, 48, 56, 128, 90, 48, 48, 55, 128, 90, 48, 48, 54, 128,
+ 90, 48, 48, 53, 65, 128, 90, 48, 48, 53, 128, 90, 48, 48, 52, 65, 128,
+ 90, 48, 48, 52, 128, 90, 48, 48, 51, 66, 128, 90, 48, 48, 51, 65, 128,
+ 90, 48, 48, 51, 128, 90, 48, 48, 50, 68, 128, 90, 48, 48, 50, 67, 128,
+ 90, 48, 48, 50, 66, 128, 90, 48, 48, 50, 65, 128, 90, 48, 48, 50, 128,
+ 90, 48, 48, 49, 128, 90, 128, 218, 89, 89, 88, 128, 89, 89, 84, 128, 89,
+ 89, 82, 88, 128, 89, 89, 82, 128, 89, 89, 80, 128, 89, 89, 69, 128, 89,
+ 89, 65, 128, 89, 89, 128, 89, 87, 79, 79, 128, 89, 87, 79, 128, 89, 87,
+ 73, 73, 128, 89, 87, 73, 128, 89, 87, 69, 128, 89, 87, 65, 65, 128, 89,
+ 87, 65, 128, 89, 86, 128, 89, 85, 88, 128, 89, 85, 87, 79, 81, 128, 89,
+ 85, 85, 75, 65, 76, 69, 65, 80, 73, 78, 84, 85, 128, 89, 85, 84, 128, 89,
+ 85, 83, 128, 89, 85, 211, 89, 85, 82, 88, 128, 89, 85, 82, 128, 89, 85,
+ 81, 128, 89, 85, 209, 89, 85, 80, 128, 89, 85, 79, 88, 128, 89, 85, 79,
+ 84, 128, 89, 85, 79, 80, 128, 89, 85, 79, 77, 128, 89, 85, 79, 128, 89,
+ 85, 78, 128, 89, 85, 77, 128, 89, 85, 69, 81, 128, 89, 85, 69, 128, 89,
+ 85, 68, 72, 128, 89, 85, 68, 200, 89, 85, 65, 78, 128, 89, 85, 65, 69,
78, 128, 89, 85, 45, 89, 69, 79, 128, 89, 85, 45, 89, 69, 128, 89, 85,
- 45, 85, 128, 89, 85, 45, 73, 128, 89, 85, 45, 69, 79, 128, 89, 85, 45,
- 69, 128, 89, 85, 45, 65, 128, 89, 85, 128, 89, 213, 89, 80, 83, 73, 76,
- 73, 128, 89, 80, 79, 82, 82, 79, 73, 128, 89, 80, 79, 75, 82, 73, 83, 73,
- 83, 128, 89, 80, 79, 75, 82, 73, 83, 73, 211, 89, 80, 79, 71, 69, 71, 82,
- 65, 77, 77, 69, 78, 73, 128, 89, 79, 88, 128, 89, 79, 85, 84, 72, 70, 85,
- 76, 78, 69, 83, 83, 128, 89, 79, 85, 84, 72, 70, 85, 204, 89, 79, 84,
- 128, 89, 79, 82, 73, 128, 89, 79, 80, 128, 89, 79, 79, 128, 89, 79, 77,
- 79, 128, 89, 79, 71, 72, 128, 89, 79, 68, 128, 89, 79, 196, 89, 79, 65,
- 128, 89, 79, 45, 89, 69, 79, 128, 89, 79, 45, 89, 65, 69, 128, 89, 79,
- 45, 89, 65, 128, 89, 79, 45, 79, 128, 89, 79, 45, 73, 128, 89, 79, 128,
- 89, 207, 89, 78, 128, 89, 73, 90, 69, 84, 128, 89, 73, 88, 128, 89, 73,
- 87, 78, 128, 89, 73, 84, 128, 89, 73, 80, 128, 89, 73, 78, 71, 128, 89,
- 73, 73, 128, 89, 73, 199, 89, 73, 69, 88, 128, 89, 73, 69, 84, 128, 89,
- 73, 69, 80, 128, 89, 73, 69, 128, 89, 73, 68, 68, 73, 83, 200, 89, 73,
- 45, 85, 128, 89, 73, 128, 89, 70, 69, 83, 73, 83, 128, 89, 70, 69, 83,
- 73, 211, 89, 70, 69, 206, 89, 69, 89, 128, 89, 69, 87, 128, 89, 69, 84,
- 73, 86, 128, 89, 69, 83, 84, 85, 128, 89, 69, 83, 73, 69, 85, 78, 71, 45,
- 83, 73, 79, 83, 128, 89, 69, 83, 73, 69, 85, 78, 71, 45, 80, 65, 78, 83,
- 73, 79, 83, 128, 89, 69, 83, 73, 69, 85, 78, 71, 128, 89, 69, 82, 85,
- 128, 89, 69, 82, 213, 89, 69, 82, 73, 128, 89, 69, 82, 65, 200, 89, 69,
- 82, 128, 89, 69, 79, 82, 73, 78, 72, 73, 69, 85, 72, 128, 89, 69, 79, 45,
- 85, 128, 89, 69, 79, 45, 79, 128, 89, 69, 206, 89, 69, 76, 76, 79, 87,
- 128, 89, 69, 72, 128, 89, 69, 69, 128, 89, 69, 65, 210, 89, 69, 65, 128,
- 89, 65, 90, 90, 128, 89, 65, 90, 72, 128, 89, 65, 90, 128, 89, 65, 89,
- 65, 78, 78, 65, 128, 89, 65, 89, 128, 89, 65, 87, 128, 89, 65, 86, 128,
- 89, 65, 84, 84, 128, 89, 65, 84, 73, 128, 89, 65, 84, 72, 128, 89, 65,
- 84, 128, 89, 65, 83, 83, 128, 89, 65, 83, 72, 128, 89, 65, 83, 128, 89,
- 65, 82, 82, 128, 89, 65, 82, 128, 89, 65, 210, 89, 65, 81, 128, 89, 65,
- 80, 128, 89, 65, 78, 71, 128, 89, 65, 78, 199, 89, 65, 78, 128, 89, 65,
- 77, 65, 75, 75, 65, 78, 128, 89, 65, 77, 128, 89, 65, 76, 128, 89, 65,
- 75, 72, 72, 128, 89, 65, 75, 72, 128, 89, 65, 75, 65, 83, 72, 128, 89,
- 65, 75, 128, 89, 65, 74, 128, 89, 65, 72, 72, 128, 89, 65, 72, 128, 89,
- 65, 71, 78, 128, 89, 65, 71, 72, 72, 128, 89, 65, 71, 72, 128, 89, 65,
- 71, 128, 89, 65, 70, 128, 89, 65, 68, 72, 128, 89, 65, 68, 68, 72, 128,
- 89, 65, 68, 68, 128, 89, 65, 68, 128, 89, 65, 67, 72, 128, 89, 65, 66,
- 72, 128, 89, 65, 66, 128, 89, 65, 65, 82, 85, 128, 89, 65, 65, 73, 128,
- 89, 65, 65, 68, 79, 128, 89, 65, 65, 128, 89, 65, 45, 89, 79, 128, 89,
- 65, 45, 79, 128, 89, 45, 67, 82, 69, 197, 88, 89, 88, 128, 88, 89, 85,
- 128, 88, 89, 84, 128, 88, 89, 82, 88, 128, 88, 89, 82, 128, 88, 89, 80,
- 128, 88, 89, 79, 128, 88, 89, 73, 128, 88, 89, 69, 69, 128, 88, 89, 69,
- 128, 88, 89, 65, 65, 128, 88, 89, 65, 128, 88, 89, 128, 88, 87, 73, 128,
- 88, 87, 69, 69, 128, 88, 87, 69, 128, 88, 87, 65, 65, 128, 88, 87, 65,
- 128, 88, 86, 65, 128, 88, 85, 79, 88, 128, 88, 85, 79, 128, 88, 85, 128,
- 88, 83, 72, 65, 65, 89, 65, 84, 72, 73, 89, 65, 128, 88, 79, 88, 128, 88,
- 79, 84, 128, 88, 79, 82, 128, 88, 79, 80, 128, 88, 79, 65, 128, 88, 79,
- 128, 88, 73, 88, 128, 88, 73, 84, 128, 88, 73, 82, 79, 206, 88, 73, 80,
- 128, 88, 73, 69, 88, 128, 88, 73, 69, 84, 128, 88, 73, 69, 80, 128, 88,
- 73, 69, 128, 88, 73, 128, 88, 71, 128, 88, 69, 83, 84, 69, 211, 88, 69,
- 72, 128, 88, 69, 69, 128, 88, 69, 128, 88, 65, 78, 128, 88, 65, 65, 128,
- 88, 65, 128, 87, 89, 78, 78, 128, 87, 89, 78, 206, 87, 86, 128, 87, 85,
- 79, 88, 128, 87, 85, 79, 80, 128, 87, 85, 79, 128, 87, 85, 78, 74, 207,
- 87, 85, 78, 128, 87, 85, 128, 87, 82, 79, 78, 71, 128, 87, 82, 73, 84,
- 73, 78, 199, 87, 82, 69, 65, 84, 200, 87, 82, 65, 80, 128, 87, 79, 88,
- 128, 87, 79, 82, 75, 128, 87, 79, 82, 203, 87, 79, 82, 68, 83, 80, 65,
- 67, 69, 128, 87, 79, 82, 196, 87, 79, 80, 128, 87, 79, 79, 78, 128, 87,
- 79, 79, 76, 128, 87, 79, 79, 68, 83, 45, 67, 82, 69, 197, 87, 79, 79, 68,
- 128, 87, 79, 78, 128, 87, 79, 206, 87, 79, 77, 65, 78, 128, 87, 79, 76,
- 79, 83, 79, 128, 87, 79, 69, 128, 87, 79, 65, 128, 87, 73, 78, 84, 69,
- 82, 128, 87, 73, 78, 74, 65, 128, 87, 73, 78, 69, 128, 87, 73, 78, 68,
- 85, 128, 87, 73, 78, 68, 128, 87, 73, 78, 128, 87, 73, 71, 71, 76, 217,
- 87, 73, 68, 69, 45, 72, 69, 65, 68, 69, 196, 87, 73, 68, 197, 87, 72, 79,
- 76, 197, 87, 72, 73, 84, 69, 45, 70, 69, 65, 84, 72, 69, 82, 69, 196, 87,
- 72, 73, 84, 69, 128, 87, 72, 69, 69, 76, 69, 196, 87, 72, 69, 69, 76, 67,
- 72, 65, 73, 210, 87, 72, 69, 69, 76, 128, 87, 72, 69, 69, 204, 87, 72,
- 69, 65, 84, 128, 87, 71, 128, 87, 69, 88, 128, 87, 69, 83, 84, 69, 82,
- 206, 87, 69, 83, 84, 128, 87, 69, 83, 212, 87, 69, 80, 128, 87, 69, 79,
- 128, 87, 69, 78, 128, 87, 69, 76, 76, 128, 87, 69, 73, 71, 72, 212, 87,
- 69, 69, 78, 128, 87, 69, 68, 71, 69, 45, 84, 65, 73, 76, 69, 196, 87, 69,
- 65, 80, 79, 78, 128, 87, 66, 128, 87, 65, 88, 128, 87, 65, 87, 128, 87,
- 65, 215, 87, 65, 86, 217, 87, 65, 86, 69, 128, 87, 65, 86, 197, 87, 65,
- 85, 128, 87, 65, 84, 84, 79, 128, 87, 65, 84, 69, 82, 128, 87, 65, 84,
- 69, 210, 87, 65, 84, 67, 72, 128, 87, 65, 84, 128, 87, 65, 83, 84, 73,
- 78, 71, 128, 87, 65, 83, 83, 65, 76, 76, 65, 77, 128, 87, 65, 83, 76, 65,
- 128, 87, 65, 83, 76, 193, 87, 65, 83, 65, 76, 76, 65, 77, 128, 87, 65,
- 83, 65, 76, 76, 65, 205, 87, 65, 82, 78, 73, 78, 199, 87, 65, 80, 128,
- 87, 65, 78, 68, 69, 82, 69, 82, 128, 87, 65, 78, 128, 87, 65, 76, 76,
- 128, 87, 65, 76, 75, 128, 87, 65, 76, 203, 87, 65, 73, 84, 73, 78, 71,
- 128, 87, 65, 69, 78, 128, 87, 65, 69, 128, 87, 65, 65, 86, 85, 128, 86,
- 90, 77, 69, 84, 128, 86, 89, 88, 128, 86, 89, 84, 128, 86, 89, 82, 88,
- 128, 86, 89, 82, 128, 86, 89, 80, 128, 86, 89, 128, 86, 87, 65, 128, 86,
- 85, 88, 128, 86, 85, 84, 128, 86, 85, 82, 88, 128, 86, 85, 82, 128, 86,
- 85, 80, 128, 86, 85, 76, 71, 65, 210, 86, 82, 65, 67, 72, 89, 128, 86,
- 79, 88, 128, 86, 79, 87, 69, 76, 45, 67, 65, 82, 82, 73, 69, 210, 86, 79,
- 87, 128, 86, 79, 85, 128, 86, 79, 84, 128, 86, 79, 80, 128, 86, 79, 79,
- 128, 86, 79, 76, 85, 77, 197, 86, 79, 76, 84, 65, 71, 197, 86, 79, 73,
- 196, 86, 79, 73, 67, 73, 78, 71, 128, 86, 79, 73, 67, 69, 76, 69, 83,
- 211, 86, 79, 73, 67, 69, 196, 86, 79, 67, 65, 204, 86, 79, 128, 86, 73,
- 88, 128, 86, 73, 84, 128, 86, 73, 83, 73, 71, 79, 84, 72, 73, 195, 86,
- 73, 83, 65, 82, 71, 65, 89, 65, 128, 86, 73, 83, 65, 82, 71, 65, 128, 86,
- 73, 83, 65, 82, 71, 193, 86, 73, 82, 73, 65, 77, 128, 86, 73, 82, 71, 79,
- 128, 86, 73, 82, 71, 65, 128, 86, 73, 82, 65, 77, 65, 128, 86, 73, 80,
- 128, 86, 73, 78, 69, 128, 86, 73, 78, 128, 86, 73, 76, 76, 65, 71, 69,
- 128, 86, 73, 69, 88, 128, 86, 73, 69, 87, 68, 65, 84, 193, 86, 73, 69,
- 84, 128, 86, 73, 69, 80, 128, 86, 73, 69, 128, 86, 73, 68, 65, 128, 86,
- 73, 67, 84, 79, 82, 217, 86, 73, 128, 86, 69, 88, 128, 86, 69, 87, 128,
- 86, 69, 215, 86, 69, 83, 84, 65, 128, 86, 69, 83, 83, 69, 204, 86, 69,
- 82, 217, 86, 69, 82, 84, 73, 67, 65, 76, 76, 89, 128, 86, 69, 82, 84, 73,
- 67, 65, 76, 76, 217, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45, 48,
- 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45, 48, 53, 128, 86,
- 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45, 48, 52, 128, 86, 69, 82, 84,
- 73, 67, 65, 76, 45, 48, 54, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67, 65,
- 76, 45, 48, 54, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48,
- 54, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45, 48,
- 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45, 48, 54, 128, 86,
- 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45, 48, 53, 128, 86, 69, 82, 84,
- 73, 67, 65, 76, 45, 48, 53, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67, 65,
- 76, 45, 48, 53, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48,
- 53, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45, 48,
- 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45, 48, 48, 128, 86,
- 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 54, 128, 86, 69, 82, 84,
- 73, 67, 65, 76, 45, 48, 52, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67, 65,
- 76, 45, 48, 52, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48,
- 52, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45, 48,
- 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 49, 128, 86,
- 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 48, 128, 86, 69, 82, 84,
- 73, 67, 65, 76, 45, 48, 51, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67, 65,
- 76, 45, 48, 51, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48,
- 51, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45, 48,
- 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45, 48, 50, 128, 86,
- 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45, 48, 49, 128, 86, 69, 82, 84,
- 73, 67, 65, 76, 45, 48, 51, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67, 65,
- 76, 45, 48, 50, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48,
- 50, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45, 48,
- 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 51, 128, 86,
- 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 50, 128, 86, 69, 82, 84,
- 73, 67, 65, 76, 45, 48, 50, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67, 65,
- 76, 45, 48, 50, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48,
- 49, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45, 48,
- 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45, 48, 52, 128, 86,
- 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45, 48, 51, 128, 86, 69, 82, 84,
- 73, 67, 65, 76, 45, 48, 49, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67, 65,
- 76, 45, 48, 49, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48,
- 49, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45, 48,
- 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45, 48, 53, 128, 86,
- 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45, 48, 52, 128, 86, 69, 82, 84,
- 73, 67, 65, 76, 45, 48, 48, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67, 65,
- 76, 45, 48, 48, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48,
- 48, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45, 48,
- 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 128, 86, 69, 82, 83, 73, 67, 76,
- 69, 128, 86, 69, 82, 83, 197, 86, 69, 82, 71, 69, 128, 86, 69, 80, 128,
- 86, 69, 78, 68, 128, 86, 69, 72, 128, 86, 69, 200, 86, 69, 69, 128, 86,
- 69, 197, 86, 69, 68, 69, 128, 86, 69, 67, 84, 79, 210, 86, 65, 89, 65,
- 78, 78, 65, 128, 86, 65, 88, 128, 86, 65, 86, 128, 86, 65, 214, 86, 65,
- 84, 72, 89, 128, 86, 65, 84, 128, 86, 65, 83, 84, 78, 69, 83, 211, 86,
- 65, 83, 73, 83, 128, 86, 65, 82, 89, 211, 86, 65, 82, 73, 75, 65, 128,
- 86, 65, 82, 73, 65, 78, 212, 86, 65, 82, 73, 65, 128, 86, 65, 82, 73,
- 193, 86, 65, 82, 69, 73, 65, 201, 86, 65, 82, 69, 73, 193, 86, 65, 80,
- 128, 86, 65, 78, 69, 128, 86, 65, 76, 76, 69, 89, 128, 86, 65, 65, 86,
- 85, 128, 86, 65, 65, 128, 85, 90, 85, 128, 85, 90, 51, 128, 85, 90, 179,
- 85, 89, 65, 78, 78, 65, 128, 85, 89, 128, 85, 85, 89, 65, 78, 78, 65,
- 128, 85, 85, 85, 85, 128, 85, 85, 85, 51, 128, 85, 85, 85, 50, 128, 85,
- 84, 85, 75, 73, 128, 85, 83, 83, 85, 51, 128, 85, 83, 83, 85, 128, 85,
- 83, 72, 88, 128, 85, 83, 72, 85, 77, 88, 128, 85, 83, 72, 50, 128, 85,
- 83, 72, 128, 85, 83, 200, 85, 83, 69, 196, 85, 83, 69, 128, 85, 82, 85,
- 218, 85, 82, 85, 83, 128, 85, 82, 85, 68, 65, 128, 85, 82, 85, 68, 193,
- 85, 82, 85, 128, 85, 82, 213, 85, 82, 78, 128, 85, 82, 73, 51, 128, 85,
- 82, 73, 128, 85, 82, 65, 78, 85, 83, 128, 85, 82, 65, 128, 85, 82, 52,
- 128, 85, 82, 50, 128, 85, 82, 178, 85, 80, 87, 65, 82, 68, 83, 128, 85,
- 80, 87, 65, 82, 68, 211, 85, 80, 87, 65, 82, 68, 128, 85, 80, 87, 65, 82,
- 196, 85, 80, 84, 85, 82, 78, 128, 85, 80, 83, 73, 76, 79, 78, 128, 85,
- 80, 83, 73, 76, 79, 206, 85, 80, 82, 73, 71, 72, 212, 85, 80, 80, 69,
- 210, 85, 80, 65, 68, 72, 77, 65, 78, 73, 89, 65, 128, 85, 80, 45, 80, 79,
- 73, 78, 84, 73, 78, 199, 85, 79, 78, 128, 85, 78, 78, 128, 85, 78, 77,
- 65, 82, 82, 73, 69, 196, 85, 78, 73, 86, 69, 82, 83, 65, 204, 85, 78, 73,
- 84, 89, 128, 85, 78, 73, 84, 128, 85, 78, 73, 212, 85, 78, 73, 79, 78,
- 128, 85, 78, 73, 79, 206, 85, 78, 68, 207, 85, 78, 68, 69, 82, 84, 73,
- 69, 128, 85, 78, 68, 69, 82, 76, 73, 78, 197, 85, 78, 68, 69, 82, 68, 79,
- 84, 128, 85, 78, 68, 69, 82, 66, 65, 82, 128, 85, 78, 68, 69, 210, 85,
- 78, 67, 73, 193, 85, 78, 65, 83, 80, 73, 82, 65, 84, 69, 68, 128, 85, 78,
- 65, 128, 85, 206, 85, 77, 85, 77, 128, 85, 77, 85, 205, 85, 77, 66, 82,
- 69, 76, 76, 65, 128, 85, 77, 66, 82, 69, 76, 76, 193, 85, 77, 66, 73, 78,
- 128, 85, 76, 85, 128, 85, 76, 213, 85, 75, 85, 128, 85, 75, 82, 65, 73,
- 78, 73, 65, 206, 85, 75, 65, 82, 65, 128, 85, 75, 65, 82, 193, 85, 75,
- 128, 85, 73, 76, 76, 69, 65, 78, 78, 128, 85, 73, 71, 72, 85, 210, 85,
- 71, 65, 82, 73, 84, 73, 195, 85, 69, 89, 128, 85, 69, 69, 128, 85, 69,
- 128, 85, 68, 85, 71, 128, 85, 68, 65, 84, 84, 65, 128, 85, 68, 65, 65,
- 84, 128, 85, 68, 128, 85, 196, 85, 67, 128, 85, 66, 85, 70, 73, 76, 73,
- 128, 85, 66, 65, 68, 65, 77, 65, 128, 85, 66, 128, 85, 65, 84, 72, 128,
- 85, 65, 128, 85, 178, 85, 45, 69, 79, 45, 69, 85, 128, 85, 45, 65, 69,
- 128, 84, 90, 85, 128, 84, 90, 79, 65, 128, 84, 90, 79, 128, 84, 90, 73,
- 210, 84, 90, 73, 128, 84, 90, 69, 69, 128, 84, 90, 69, 128, 84, 90, 65,
- 65, 128, 84, 90, 65, 128, 84, 90, 128, 84, 89, 210, 84, 89, 80, 69, 45,
- 183, 84, 89, 80, 69, 45, 182, 84, 89, 80, 69, 45, 181, 84, 89, 80, 69,
- 45, 180, 84, 89, 80, 69, 45, 179, 84, 89, 80, 69, 45, 178, 84, 89, 80,
- 69, 45, 177, 84, 89, 80, 197, 84, 89, 79, 128, 84, 89, 73, 128, 84, 89,
- 69, 128, 84, 89, 65, 128, 84, 87, 79, 79, 128, 84, 87, 79, 45, 76, 73,
- 78, 197, 84, 87, 79, 45, 72, 69, 65, 68, 69, 196, 84, 87, 73, 73, 128,
- 84, 87, 73, 128, 84, 87, 69, 78, 84, 89, 45, 84, 87, 79, 128, 84, 87, 69,
- 78, 84, 89, 45, 84, 72, 82, 69, 69, 128, 84, 87, 69, 78, 84, 89, 45, 83,
- 73, 88, 128, 84, 87, 69, 78, 84, 89, 45, 83, 69, 86, 69, 78, 128, 84, 87,
- 69, 78, 84, 89, 45, 79, 78, 69, 128, 84, 87, 69, 78, 84, 89, 45, 78, 73,
- 78, 69, 128, 84, 87, 69, 78, 84, 89, 45, 70, 79, 85, 82, 128, 84, 87, 69,
- 78, 84, 89, 45, 70, 73, 86, 69, 128, 84, 87, 69, 78, 84, 89, 45, 69, 73,
- 71, 72, 84, 200, 84, 87, 69, 78, 84, 89, 45, 69, 73, 71, 72, 84, 128, 84,
- 87, 69, 78, 84, 89, 128, 84, 87, 69, 78, 84, 217, 84, 87, 69, 76, 86, 69,
- 128, 84, 87, 69, 76, 86, 197, 84, 87, 69, 128, 84, 87, 65, 65, 128, 84,
- 87, 65, 128, 84, 86, 82, 73, 68, 79, 128, 84, 86, 73, 77, 65, 68, 85,
- 210, 84, 85, 88, 128, 84, 85, 85, 77, 85, 128, 84, 85, 84, 69, 89, 65,
- 83, 65, 84, 128, 84, 85, 84, 128, 84, 85, 82, 88, 128, 84, 85, 82, 84,
- 76, 69, 128, 84, 85, 82, 79, 50, 128, 84, 85, 82, 78, 83, 84, 73, 76, 69,
- 128, 84, 85, 82, 206, 84, 85, 82, 66, 65, 78, 128, 84, 85, 82, 128, 84,
- 85, 80, 128, 84, 85, 79, 88, 128, 84, 85, 79, 84, 128, 84, 85, 79, 80,
- 128, 84, 85, 79, 128, 84, 85, 78, 78, 89, 128, 84, 85, 77, 128, 84, 85,
- 75, 128, 84, 85, 71, 82, 73, 203, 84, 85, 71, 50, 128, 84, 85, 71, 178,
- 84, 85, 65, 82, 69, 199, 84, 84, 85, 68, 68, 65, 71, 128, 84, 84, 85, 68,
- 68, 65, 65, 71, 128, 84, 84, 85, 128, 84, 84, 84, 72, 65, 128, 84, 84,
- 83, 85, 128, 84, 84, 83, 79, 128, 84, 84, 83, 73, 128, 84, 84, 83, 69,
- 69, 128, 84, 84, 83, 69, 128, 84, 84, 83, 65, 128, 84, 84, 73, 128, 84,
- 84, 72, 79, 128, 84, 84, 72, 73, 128, 84, 84, 72, 69, 128, 84, 84, 72,
- 128, 84, 84, 69, 72, 69, 72, 128, 84, 84, 69, 72, 69, 200, 84, 84, 69,
- 72, 128, 84, 84, 69, 200, 84, 84, 69, 69, 128, 84, 84, 69, 128, 84, 84,
- 65, 89, 65, 78, 78, 65, 128, 84, 84, 65, 65, 128, 84, 84, 50, 128, 84,
- 83, 87, 69, 128, 84, 83, 87, 65, 128, 84, 83, 86, 128, 84, 83, 83, 69,
- 128, 84, 83, 72, 85, 71, 83, 128, 84, 83, 72, 79, 79, 75, 128, 84, 83,
- 72, 79, 79, 203, 84, 83, 72, 69, 83, 128, 84, 83, 72, 69, 71, 128, 84,
- 83, 72, 69, 199, 84, 83, 72, 69, 128, 84, 83, 72, 65, 128, 84, 83, 69,
- 82, 69, 128, 84, 83, 65, 68, 73, 128, 84, 83, 65, 68, 201, 84, 83, 65,
- 65, 128, 84, 83, 193, 84, 82, 89, 66, 76, 73, 79, 206, 84, 82, 85, 84,
- 72, 128, 84, 82, 85, 78, 75, 128, 84, 82, 85, 78, 67, 65, 84, 69, 196,
- 84, 82, 85, 69, 128, 84, 82, 79, 77, 73, 75, 79, 83, 89, 78, 65, 71, 77,
+ 45, 85, 128, 89, 85, 45, 79, 128, 89, 85, 45, 73, 128, 89, 85, 45, 69,
+ 79, 128, 89, 85, 45, 69, 128, 89, 85, 45, 65, 69, 128, 89, 85, 45, 65,
+ 128, 89, 85, 128, 89, 213, 89, 80, 83, 73, 76, 73, 128, 89, 80, 79, 82,
+ 82, 79, 73, 128, 89, 80, 79, 75, 82, 73, 83, 73, 83, 128, 89, 80, 79, 75,
+ 82, 73, 83, 73, 211, 89, 80, 79, 71, 69, 71, 82, 65, 77, 77, 69, 78, 73,
+ 128, 89, 79, 89, 128, 89, 79, 88, 128, 89, 79, 85, 84, 72, 70, 85, 76,
+ 78, 69, 83, 83, 128, 89, 79, 85, 84, 72, 70, 85, 204, 89, 79, 84, 128,
+ 89, 79, 82, 73, 128, 89, 79, 81, 128, 89, 79, 209, 89, 79, 80, 128, 89,
+ 79, 79, 128, 89, 79, 77, 79, 128, 89, 79, 71, 72, 128, 89, 79, 68, 72,
+ 128, 89, 79, 68, 128, 89, 79, 196, 89, 79, 65, 128, 89, 79, 45, 89, 69,
+ 79, 128, 89, 79, 45, 89, 65, 69, 128, 89, 79, 45, 89, 65, 128, 89, 79,
+ 45, 79, 128, 89, 79, 45, 73, 128, 89, 79, 45, 69, 79, 128, 89, 79, 45,
+ 65, 69, 128, 89, 79, 45, 65, 128, 89, 79, 128, 89, 207, 89, 73, 90, 69,
+ 84, 128, 89, 73, 88, 128, 89, 73, 87, 78, 128, 89, 73, 84, 128, 89, 73,
+ 80, 128, 89, 73, 78, 71, 128, 89, 73, 73, 128, 89, 73, 199, 89, 73, 69,
+ 88, 128, 89, 73, 69, 84, 128, 89, 73, 69, 80, 128, 89, 73, 69, 69, 128,
+ 89, 73, 69, 128, 89, 73, 68, 68, 73, 83, 200, 89, 73, 45, 85, 128, 89,
+ 73, 128, 89, 70, 69, 83, 73, 83, 128, 89, 70, 69, 83, 73, 211, 89, 70,
+ 69, 206, 89, 69, 89, 128, 89, 69, 87, 128, 89, 69, 85, 88, 128, 89, 69,
+ 85, 82, 65, 69, 128, 89, 69, 85, 81, 128, 89, 69, 85, 77, 128, 89, 69,
+ 85, 65, 69, 84, 128, 89, 69, 85, 65, 69, 128, 89, 69, 84, 73, 86, 128,
+ 89, 69, 83, 84, 85, 128, 89, 69, 83, 73, 69, 85, 78, 71, 45, 83, 73, 79,
+ 83, 128, 89, 69, 83, 73, 69, 85, 78, 71, 45, 80, 65, 78, 83, 73, 79, 83,
+ 128, 89, 69, 83, 73, 69, 85, 78, 71, 45, 77, 73, 69, 85, 77, 128, 89, 69,
+ 83, 73, 69, 85, 78, 71, 45, 72, 73, 69, 85, 72, 128, 89, 69, 83, 73, 69,
+ 85, 78, 71, 128, 89, 69, 82, 85, 128, 89, 69, 82, 213, 89, 69, 82, 73,
+ 128, 89, 69, 82, 65, 200, 89, 69, 82, 128, 89, 69, 79, 82, 73, 78, 72,
+ 73, 69, 85, 72, 128, 89, 69, 79, 45, 89, 65, 128, 89, 69, 79, 45, 85,
+ 128, 89, 69, 79, 45, 79, 128, 89, 69, 78, 73, 83, 69, 201, 89, 69, 78,
+ 65, 80, 128, 89, 69, 78, 128, 89, 69, 206, 89, 69, 76, 76, 79, 87, 128,
+ 89, 69, 76, 76, 79, 215, 89, 69, 72, 128, 89, 69, 69, 128, 89, 69, 65,
+ 210, 89, 69, 65, 128, 89, 65, 90, 90, 128, 89, 65, 90, 72, 128, 89, 65,
+ 90, 128, 89, 65, 89, 65, 78, 78, 65, 128, 89, 65, 89, 128, 89, 65, 87,
+ 128, 89, 65, 86, 128, 89, 65, 84, 84, 128, 89, 65, 84, 73, 128, 89, 65,
+ 84, 72, 128, 89, 65, 84, 128, 89, 65, 83, 83, 128, 89, 65, 83, 72, 128,
+ 89, 65, 83, 128, 89, 65, 82, 82, 128, 89, 65, 82, 128, 89, 65, 210, 89,
+ 65, 81, 128, 89, 65, 80, 128, 89, 65, 78, 71, 128, 89, 65, 78, 199, 89,
+ 65, 78, 128, 89, 65, 77, 79, 75, 128, 89, 65, 77, 65, 75, 75, 65, 78,
+ 128, 89, 65, 77, 128, 89, 65, 76, 128, 89, 65, 75, 72, 72, 128, 89, 65,
+ 75, 72, 128, 89, 65, 75, 65, 83, 72, 128, 89, 65, 75, 128, 89, 65, 74,
+ 85, 82, 86, 69, 68, 73, 195, 89, 65, 74, 128, 89, 65, 72, 72, 128, 89,
+ 65, 72, 128, 89, 65, 71, 78, 128, 89, 65, 71, 72, 72, 128, 89, 65, 71,
+ 72, 128, 89, 65, 71, 128, 89, 65, 70, 213, 89, 65, 70, 128, 89, 65, 69,
+ 77, 77, 65, 69, 128, 89, 65, 68, 72, 128, 89, 65, 68, 68, 72, 128, 89,
+ 65, 68, 68, 128, 89, 65, 68, 128, 89, 65, 67, 72, 128, 89, 65, 66, 72,
+ 128, 89, 65, 66, 128, 89, 65, 65, 82, 85, 128, 89, 65, 65, 73, 128, 89,
+ 65, 65, 68, 79, 128, 89, 65, 65, 128, 89, 65, 45, 89, 79, 128, 89, 65,
+ 45, 85, 128, 89, 65, 45, 79, 128, 89, 48, 48, 56, 128, 89, 48, 48, 55,
+ 128, 89, 48, 48, 54, 128, 89, 48, 48, 53, 128, 89, 48, 48, 52, 128, 89,
+ 48, 48, 51, 128, 89, 48, 48, 50, 128, 89, 48, 48, 49, 65, 128, 89, 48,
+ 48, 49, 128, 89, 45, 67, 82, 69, 197, 88, 89, 88, 128, 88, 89, 85, 128,
+ 88, 89, 84, 128, 88, 89, 82, 88, 128, 88, 89, 82, 128, 88, 89, 80, 128,
+ 88, 89, 79, 128, 88, 89, 73, 128, 88, 89, 69, 69, 128, 88, 89, 69, 128,
+ 88, 89, 65, 65, 128, 88, 89, 65, 128, 88, 89, 128, 88, 87, 73, 128, 88,
+ 87, 69, 69, 128, 88, 87, 69, 128, 88, 87, 65, 65, 128, 88, 87, 65, 128,
+ 88, 86, 69, 128, 88, 86, 65, 128, 88, 85, 79, 88, 128, 88, 85, 79, 128,
+ 88, 85, 128, 88, 83, 72, 65, 65, 89, 65, 84, 72, 73, 89, 65, 128, 88, 79,
+ 88, 128, 88, 79, 84, 128, 88, 79, 82, 128, 88, 79, 80, 128, 88, 79, 65,
+ 128, 88, 79, 128, 88, 73, 88, 128, 88, 73, 84, 128, 88, 73, 82, 79, 206,
+ 88, 73, 80, 128, 88, 73, 69, 88, 128, 88, 73, 69, 84, 128, 88, 73, 69,
+ 80, 128, 88, 73, 69, 128, 88, 73, 128, 88, 71, 128, 88, 69, 83, 84, 69,
+ 211, 88, 69, 72, 128, 88, 69, 69, 128, 88, 69, 128, 88, 65, 78, 128, 88,
+ 65, 65, 128, 88, 65, 128, 88, 48, 48, 56, 65, 128, 88, 48, 48, 56, 128,
+ 88, 48, 48, 55, 128, 88, 48, 48, 54, 65, 128, 88, 48, 48, 54, 128, 88,
+ 48, 48, 53, 128, 88, 48, 48, 52, 66, 128, 88, 48, 48, 52, 65, 128, 88,
+ 48, 48, 52, 128, 88, 48, 48, 51, 128, 88, 48, 48, 50, 128, 88, 48, 48,
+ 49, 128, 87, 90, 128, 87, 89, 78, 78, 128, 87, 89, 78, 206, 87, 86, 128,
+ 87, 85, 80, 128, 87, 85, 79, 88, 128, 87, 85, 79, 80, 128, 87, 85, 79,
+ 128, 87, 85, 78, 74, 207, 87, 85, 78, 128, 87, 85, 76, 85, 128, 87, 85,
+ 76, 213, 87, 85, 69, 128, 87, 85, 65, 69, 84, 128, 87, 85, 65, 69, 78,
+ 128, 87, 85, 128, 87, 82, 217, 87, 82, 79, 78, 71, 128, 87, 82, 73, 84,
+ 73, 78, 199, 87, 82, 69, 78, 67, 72, 128, 87, 82, 69, 65, 84, 200, 87,
+ 82, 65, 80, 80, 69, 196, 87, 82, 65, 80, 128, 87, 79, 88, 128, 87, 79,
+ 82, 75, 69, 82, 128, 87, 79, 82, 75, 128, 87, 79, 82, 203, 87, 79, 82,
+ 68, 83, 80, 65, 67, 69, 128, 87, 79, 82, 196, 87, 79, 80, 128, 87, 79,
+ 79, 78, 128, 87, 79, 79, 76, 128, 87, 79, 79, 68, 83, 45, 67, 82, 69,
+ 197, 87, 79, 79, 68, 128, 87, 79, 78, 128, 87, 79, 206, 87, 79, 77, 69,
+ 78, 211, 87, 79, 77, 69, 206, 87, 79, 77, 65, 78, 211, 87, 79, 77, 65,
+ 78, 128, 87, 79, 77, 65, 206, 87, 79, 76, 79, 83, 79, 128, 87, 79, 76,
+ 198, 87, 79, 69, 128, 87, 79, 65, 128, 87, 73, 84, 72, 79, 85, 212, 87,
+ 73, 78, 84, 69, 82, 128, 87, 73, 78, 75, 73, 78, 199, 87, 73, 78, 74, 65,
+ 128, 87, 73, 78, 71, 83, 128, 87, 73, 78, 69, 128, 87, 73, 78, 197, 87,
+ 73, 78, 68, 85, 128, 87, 73, 78, 68, 128, 87, 73, 78, 196, 87, 73, 78,
+ 128, 87, 73, 71, 78, 89, 65, 78, 128, 87, 73, 71, 71, 76, 217, 87, 73,
+ 68, 69, 45, 72, 69, 65, 68, 69, 196, 87, 73, 68, 197, 87, 73, 65, 78, 71,
+ 87, 65, 65, 75, 128, 87, 73, 65, 78, 71, 128, 87, 72, 79, 76, 197, 87,
+ 72, 73, 84, 69, 45, 70, 69, 65, 84, 72, 69, 82, 69, 196, 87, 72, 73, 84,
+ 69, 128, 87, 72, 69, 69, 76, 69, 196, 87, 72, 69, 69, 76, 67, 72, 65, 73,
+ 210, 87, 72, 69, 69, 76, 128, 87, 72, 69, 69, 204, 87, 72, 69, 65, 84,
+ 128, 87, 72, 65, 76, 69, 128, 87, 71, 128, 87, 69, 88, 128, 87, 69, 85,
+ 88, 128, 87, 69, 83, 84, 69, 82, 206, 87, 69, 83, 84, 128, 87, 69, 83,
+ 212, 87, 69, 80, 128, 87, 69, 79, 128, 87, 69, 78, 128, 87, 69, 76, 76,
+ 128, 87, 69, 73, 71, 72, 212, 87, 69, 69, 78, 128, 87, 69, 68, 71, 69,
+ 45, 84, 65, 73, 76, 69, 196, 87, 69, 68, 68, 73, 78, 71, 128, 87, 69, 65,
+ 82, 217, 87, 69, 65, 80, 79, 78, 128, 87, 67, 128, 87, 66, 128, 87, 65,
+ 89, 128, 87, 65, 217, 87, 65, 88, 73, 78, 199, 87, 65, 88, 128, 87, 65,
+ 87, 45, 65, 89, 73, 78, 45, 82, 69, 83, 72, 128, 87, 65, 87, 128, 87, 65,
+ 215, 87, 65, 86, 217, 87, 65, 86, 73, 78, 199, 87, 65, 86, 69, 83, 128,
+ 87, 65, 86, 69, 128, 87, 65, 86, 197, 87, 65, 85, 128, 87, 65, 84, 84,
+ 79, 128, 87, 65, 84, 69, 82, 77, 69, 76, 79, 78, 128, 87, 65, 84, 69, 82,
+ 128, 87, 65, 84, 69, 210, 87, 65, 84, 67, 72, 128, 87, 65, 84, 128, 87,
+ 65, 83, 84, 73, 78, 71, 128, 87, 65, 83, 83, 65, 76, 76, 65, 77, 128, 87,
+ 65, 83, 76, 65, 128, 87, 65, 83, 76, 193, 87, 65, 83, 65, 76, 76, 65, 77,
+ 128, 87, 65, 83, 65, 76, 76, 65, 205, 87, 65, 82, 78, 73, 78, 199, 87,
+ 65, 80, 128, 87, 65, 78, 73, 78, 199, 87, 65, 78, 71, 75, 85, 79, 81,
+ 128, 87, 65, 78, 68, 69, 82, 69, 82, 128, 87, 65, 78, 128, 87, 65, 76,
+ 76, 128, 87, 65, 76, 75, 128, 87, 65, 76, 203, 87, 65, 73, 84, 73, 78,
+ 71, 128, 87, 65, 73, 128, 87, 65, 69, 78, 128, 87, 65, 69, 128, 87, 65,
+ 65, 86, 85, 128, 87, 48, 50, 53, 128, 87, 48, 50, 52, 65, 128, 87, 48,
+ 50, 52, 128, 87, 48, 50, 51, 128, 87, 48, 50, 50, 128, 87, 48, 50, 49,
+ 128, 87, 48, 50, 48, 128, 87, 48, 49, 57, 128, 87, 48, 49, 56, 65, 128,
+ 87, 48, 49, 56, 128, 87, 48, 49, 55, 65, 128, 87, 48, 49, 55, 128, 87,
+ 48, 49, 54, 128, 87, 48, 49, 53, 128, 87, 48, 49, 52, 65, 128, 87, 48,
+ 49, 52, 128, 87, 48, 49, 51, 128, 87, 48, 49, 50, 128, 87, 48, 49, 49,
+ 128, 87, 48, 49, 48, 65, 128, 87, 48, 49, 48, 128, 87, 48, 48, 57, 65,
+ 128, 87, 48, 48, 57, 128, 87, 48, 48, 56, 128, 87, 48, 48, 55, 128, 87,
+ 48, 48, 54, 128, 87, 48, 48, 53, 128, 87, 48, 48, 52, 128, 87, 48, 48,
+ 51, 65, 128, 87, 48, 48, 51, 128, 87, 48, 48, 50, 128, 87, 48, 48, 49,
+ 128, 86, 90, 77, 69, 84, 128, 86, 89, 88, 128, 86, 89, 84, 128, 86, 89,
+ 82, 88, 128, 86, 89, 82, 128, 86, 89, 80, 128, 86, 89, 128, 86, 87, 65,
+ 128, 86, 85, 88, 128, 86, 85, 84, 128, 86, 85, 82, 88, 128, 86, 85, 82,
+ 128, 86, 85, 80, 128, 86, 85, 76, 71, 65, 210, 86, 85, 69, 81, 128, 86,
+ 83, 128, 86, 82, 65, 67, 72, 89, 128, 86, 79, 88, 128, 86, 79, 87, 69,
+ 76, 45, 67, 65, 82, 82, 73, 69, 210, 86, 79, 87, 128, 86, 79, 85, 128,
+ 86, 79, 84, 128, 86, 79, 80, 128, 86, 79, 79, 128, 86, 79, 77, 128, 86,
+ 79, 76, 85, 77, 197, 86, 79, 76, 84, 65, 71, 197, 86, 79, 76, 67, 65, 78,
+ 79, 128, 86, 79, 73, 196, 86, 79, 73, 67, 73, 78, 71, 128, 86, 79, 73,
+ 67, 69, 76, 69, 83, 211, 86, 79, 73, 67, 69, 196, 86, 79, 67, 65, 76, 73,
+ 90, 65, 84, 73, 79, 206, 86, 79, 67, 65, 204, 86, 79, 128, 86, 73, 88,
+ 128, 86, 73, 84, 82, 73, 79, 76, 45, 50, 128, 86, 73, 84, 82, 73, 79, 76,
+ 128, 86, 73, 84, 65, 69, 45, 50, 128, 86, 73, 84, 65, 69, 128, 86, 73,
+ 84, 128, 86, 73, 83, 73, 71, 79, 84, 72, 73, 195, 86, 73, 83, 65, 82, 71,
+ 65, 89, 65, 128, 86, 73, 83, 65, 82, 71, 65, 128, 86, 73, 83, 65, 82, 71,
+ 193, 86, 73, 82, 73, 65, 77, 128, 86, 73, 82, 71, 79, 128, 86, 73, 82,
+ 71, 65, 128, 86, 73, 82, 65, 77, 65, 128, 86, 73, 80, 128, 86, 73, 79,
+ 76, 73, 78, 128, 86, 73, 78, 69, 71, 65, 82, 45, 51, 128, 86, 73, 78, 69,
+ 71, 65, 82, 45, 50, 128, 86, 73, 78, 69, 71, 65, 82, 128, 86, 73, 78, 69,
+ 71, 65, 210, 86, 73, 78, 69, 128, 86, 73, 78, 128, 86, 73, 76, 76, 65,
+ 71, 69, 128, 86, 73, 69, 88, 128, 86, 73, 69, 87, 73, 78, 199, 86, 73,
+ 69, 87, 68, 65, 84, 193, 86, 73, 69, 84, 128, 86, 73, 69, 80, 128, 86,
+ 73, 69, 128, 86, 73, 68, 69, 79, 67, 65, 83, 83, 69, 84, 84, 69, 128, 86,
+ 73, 68, 69, 207, 86, 73, 68, 65, 128, 86, 73, 67, 84, 79, 82, 217, 86,
+ 73, 66, 82, 65, 84, 73, 79, 206, 86, 73, 128, 86, 69, 88, 128, 86, 69,
+ 87, 128, 86, 69, 215, 86, 69, 85, 88, 128, 86, 69, 85, 77, 128, 86, 69,
+ 85, 65, 69, 80, 69, 78, 128, 86, 69, 85, 65, 69, 128, 86, 69, 83, 84, 65,
+ 128, 86, 69, 83, 83, 69, 204, 86, 69, 82, 217, 86, 69, 82, 84, 73, 67,
+ 65, 76, 76, 89, 128, 86, 69, 82, 84, 73, 67, 65, 76, 76, 217, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 54, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 54, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 54, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45,
+ 48, 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45, 48, 50, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45, 48, 49, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 54, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 53, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 53, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45,
+ 48, 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45, 48, 51, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45, 48, 50, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 53, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 53, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 52, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45,
+ 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 52, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 51, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 52, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 52, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45,
+ 48, 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45, 48, 53, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45, 48, 52, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 51, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 51, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 51, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45,
+ 48, 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 54, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 53, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 50, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 50, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45,
+ 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 48, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45, 48, 54, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 49, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 49, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 49, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45,
+ 48, 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45, 48, 49, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45, 48, 48, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 48, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 48, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 48, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45,
+ 48, 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45, 48, 50, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45, 48, 49, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 48, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 128, 86, 69, 82, 83, 73, 67, 76, 69, 128, 86, 69, 82, 83, 197,
+ 86, 69, 82, 71, 69, 128, 86, 69, 82, 68, 73, 71, 82, 73, 83, 128, 86, 69,
+ 80, 128, 86, 69, 78, 68, 128, 86, 69, 73, 76, 128, 86, 69, 72, 73, 67,
+ 76, 69, 128, 86, 69, 72, 128, 86, 69, 200, 86, 69, 69, 128, 86, 69, 197,
+ 86, 69, 68, 69, 128, 86, 69, 67, 84, 79, 210, 86, 65, 89, 65, 78, 78, 65,
+ 128, 86, 65, 88, 128, 86, 65, 86, 128, 86, 65, 214, 86, 65, 84, 72, 89,
+ 128, 86, 65, 84, 128, 86, 65, 83, 84, 78, 69, 83, 211, 86, 65, 83, 73,
+ 83, 128, 86, 65, 82, 89, 211, 86, 65, 82, 73, 75, 65, 128, 86, 65, 82,
+ 73, 65, 78, 212, 86, 65, 82, 73, 65, 128, 86, 65, 82, 73, 193, 86, 65,
+ 82, 69, 73, 65, 201, 86, 65, 82, 69, 73, 193, 86, 65, 80, 79, 85, 82, 83,
+ 128, 86, 65, 80, 128, 86, 65, 78, 69, 128, 86, 65, 77, 65, 71, 79, 77,
+ 85, 75, 72, 65, 128, 86, 65, 77, 65, 71, 79, 77, 85, 75, 72, 193, 86, 65,
+ 76, 76, 69, 89, 128, 86, 65, 65, 86, 85, 128, 86, 65, 65, 128, 86, 48,
+ 52, 48, 65, 128, 86, 48, 52, 48, 128, 86, 48, 51, 57, 128, 86, 48, 51,
+ 56, 128, 86, 48, 51, 55, 65, 128, 86, 48, 51, 55, 128, 86, 48, 51, 54,
+ 128, 86, 48, 51, 53, 128, 86, 48, 51, 52, 128, 86, 48, 51, 51, 65, 128,
+ 86, 48, 51, 51, 128, 86, 48, 51, 50, 128, 86, 48, 51, 49, 65, 128, 86,
+ 48, 51, 49, 128, 86, 48, 51, 48, 65, 128, 86, 48, 51, 48, 128, 86, 48,
+ 50, 57, 65, 128, 86, 48, 50, 57, 128, 86, 48, 50, 56, 65, 128, 86, 48,
+ 50, 56, 128, 86, 48, 50, 55, 128, 86, 48, 50, 54, 128, 86, 48, 50, 53,
+ 128, 86, 48, 50, 52, 128, 86, 48, 50, 51, 65, 128, 86, 48, 50, 51, 128,
+ 86, 48, 50, 50, 128, 86, 48, 50, 49, 128, 86, 48, 50, 48, 76, 128, 86,
+ 48, 50, 48, 75, 128, 86, 48, 50, 48, 74, 128, 86, 48, 50, 48, 73, 128,
+ 86, 48, 50, 48, 72, 128, 86, 48, 50, 48, 71, 128, 86, 48, 50, 48, 70,
+ 128, 86, 48, 50, 48, 69, 128, 86, 48, 50, 48, 68, 128, 86, 48, 50, 48,
+ 67, 128, 86, 48, 50, 48, 66, 128, 86, 48, 50, 48, 65, 128, 86, 48, 50,
+ 48, 128, 86, 48, 49, 57, 128, 86, 48, 49, 56, 128, 86, 48, 49, 55, 128,
+ 86, 48, 49, 54, 128, 86, 48, 49, 53, 128, 86, 48, 49, 52, 128, 86, 48,
+ 49, 51, 128, 86, 48, 49, 50, 66, 128, 86, 48, 49, 50, 65, 128, 86, 48,
+ 49, 50, 128, 86, 48, 49, 49, 67, 128, 86, 48, 49, 49, 66, 128, 86, 48,
+ 49, 49, 65, 128, 86, 48, 49, 49, 128, 86, 48, 49, 48, 128, 86, 48, 48,
+ 57, 128, 86, 48, 48, 56, 128, 86, 48, 48, 55, 66, 128, 86, 48, 48, 55,
+ 65, 128, 86, 48, 48, 55, 128, 86, 48, 48, 54, 128, 86, 48, 48, 53, 128,
+ 86, 48, 48, 52, 128, 86, 48, 48, 51, 128, 86, 48, 48, 50, 65, 128, 86,
+ 48, 48, 50, 128, 86, 48, 48, 49, 73, 128, 86, 48, 48, 49, 72, 128, 86,
+ 48, 48, 49, 71, 128, 86, 48, 48, 49, 70, 128, 86, 48, 48, 49, 69, 128,
+ 86, 48, 48, 49, 68, 128, 86, 48, 48, 49, 67, 128, 86, 48, 48, 49, 66,
+ 128, 86, 48, 48, 49, 65, 128, 86, 48, 48, 49, 128, 85, 90, 85, 128, 85,
+ 90, 51, 128, 85, 90, 179, 85, 89, 65, 78, 78, 65, 128, 85, 89, 128, 85,
+ 85, 89, 65, 78, 78, 65, 128, 85, 85, 85, 85, 128, 85, 85, 85, 51, 128,
+ 85, 85, 85, 50, 128, 85, 85, 69, 128, 85, 84, 85, 75, 73, 128, 85, 83,
+ 83, 85, 51, 128, 85, 83, 83, 85, 128, 85, 83, 72, 88, 128, 85, 83, 72,
+ 85, 77, 88, 128, 85, 83, 72, 69, 78, 78, 65, 128, 85, 83, 72, 50, 128,
+ 85, 83, 72, 128, 85, 83, 200, 85, 83, 69, 196, 85, 83, 69, 128, 85, 82,
+ 85, 218, 85, 82, 85, 83, 128, 85, 82, 85, 68, 65, 128, 85, 82, 85, 68,
+ 193, 85, 82, 85, 128, 85, 82, 213, 85, 82, 78, 128, 85, 82, 73, 78, 69,
+ 128, 85, 82, 73, 51, 128, 85, 82, 73, 128, 85, 82, 65, 78, 85, 83, 128,
+ 85, 82, 65, 128, 85, 82, 52, 128, 85, 82, 50, 128, 85, 82, 178, 85, 80,
+ 87, 65, 82, 68, 83, 128, 85, 80, 87, 65, 82, 68, 211, 85, 80, 87, 65, 82,
+ 68, 128, 85, 80, 87, 65, 82, 196, 85, 80, 84, 85, 82, 78, 128, 85, 80,
+ 83, 73, 76, 79, 78, 128, 85, 80, 83, 73, 76, 79, 206, 85, 80, 82, 73, 71,
+ 72, 212, 85, 80, 80, 69, 210, 85, 80, 65, 68, 72, 77, 65, 78, 73, 89, 65,
+ 128, 85, 80, 45, 80, 79, 73, 78, 84, 73, 78, 199, 85, 79, 78, 128, 85,
+ 78, 78, 128, 85, 78, 77, 65, 82, 82, 73, 69, 196, 85, 78, 75, 78, 79, 87,
+ 78, 128, 85, 78, 73, 86, 69, 82, 83, 65, 204, 85, 78, 73, 84, 89, 128,
+ 85, 78, 73, 84, 128, 85, 78, 73, 212, 85, 78, 73, 79, 78, 128, 85, 78,
+ 73, 79, 206, 85, 78, 73, 70, 73, 69, 196, 85, 78, 68, 207, 85, 78, 68,
+ 69, 82, 84, 73, 69, 128, 85, 78, 68, 69, 82, 76, 73, 78, 197, 85, 78, 68,
+ 69, 82, 68, 79, 84, 128, 85, 78, 68, 69, 82, 66, 65, 82, 128, 85, 78, 68,
+ 69, 210, 85, 78, 67, 73, 193, 85, 78, 65, 83, 80, 73, 82, 65, 84, 69, 68,
+ 128, 85, 78, 65, 80, 128, 85, 78, 65, 77, 85, 83, 69, 196, 85, 78, 65,
+ 128, 85, 206, 85, 77, 85, 77, 128, 85, 77, 85, 205, 85, 77, 66, 82, 69,
+ 76, 76, 65, 128, 85, 77, 66, 82, 69, 76, 76, 193, 85, 77, 66, 73, 78,
+ 128, 85, 75, 85, 128, 85, 75, 82, 65, 73, 78, 73, 65, 206, 85, 75, 65,
+ 82, 65, 128, 85, 75, 65, 82, 193, 85, 75, 128, 85, 73, 76, 76, 69, 65,
+ 78, 78, 128, 85, 73, 71, 72, 85, 210, 85, 71, 65, 82, 73, 84, 73, 195,
+ 85, 69, 89, 128, 85, 69, 69, 128, 85, 69, 65, 128, 85, 68, 85, 71, 128,
+ 85, 68, 65, 84, 84, 65, 128, 85, 68, 65, 84, 84, 193, 85, 68, 65, 65, 84,
+ 128, 85, 68, 128, 85, 196, 85, 67, 128, 85, 66, 85, 70, 73, 76, 73, 128,
+ 85, 66, 72, 65, 89, 65, 84, 207, 85, 66, 65, 68, 65, 77, 65, 128, 85, 66,
+ 128, 85, 65, 84, 72, 128, 85, 65, 128, 85, 178, 85, 48, 52, 50, 128, 85,
+ 48, 52, 49, 128, 85, 48, 52, 48, 128, 85, 48, 51, 57, 128, 85, 48, 51,
+ 56, 128, 85, 48, 51, 55, 128, 85, 48, 51, 54, 128, 85, 48, 51, 53, 128,
+ 85, 48, 51, 52, 128, 85, 48, 51, 51, 128, 85, 48, 51, 50, 65, 128, 85,
+ 48, 51, 50, 128, 85, 48, 51, 49, 128, 85, 48, 51, 48, 128, 85, 48, 50,
+ 57, 65, 128, 85, 48, 50, 57, 128, 85, 48, 50, 56, 128, 85, 48, 50, 55,
+ 128, 85, 48, 50, 54, 128, 85, 48, 50, 53, 128, 85, 48, 50, 52, 128, 85,
+ 48, 50, 51, 65, 128, 85, 48, 50, 51, 128, 85, 48, 50, 50, 128, 85, 48,
+ 50, 49, 128, 85, 48, 50, 48, 128, 85, 48, 49, 57, 128, 85, 48, 49, 56,
+ 128, 85, 48, 49, 55, 128, 85, 48, 49, 54, 128, 85, 48, 49, 53, 128, 85,
+ 48, 49, 52, 128, 85, 48, 49, 51, 128, 85, 48, 49, 50, 128, 85, 48, 49,
+ 49, 128, 85, 48, 49, 48, 128, 85, 48, 48, 57, 128, 85, 48, 48, 56, 128,
+ 85, 48, 48, 55, 128, 85, 48, 48, 54, 66, 128, 85, 48, 48, 54, 65, 128,
+ 85, 48, 48, 54, 128, 85, 48, 48, 53, 128, 85, 48, 48, 52, 128, 85, 48,
+ 48, 51, 128, 85, 48, 48, 50, 128, 85, 48, 48, 49, 128, 85, 45, 73, 45,
+ 73, 128, 85, 45, 69, 79, 45, 69, 85, 128, 84, 90, 85, 128, 84, 90, 79,
+ 65, 128, 84, 90, 79, 128, 84, 90, 73, 210, 84, 90, 73, 128, 84, 90, 69,
+ 69, 128, 84, 90, 69, 128, 84, 90, 65, 65, 128, 84, 90, 65, 128, 84, 90,
+ 128, 84, 89, 210, 84, 89, 80, 69, 45, 183, 84, 89, 80, 69, 45, 182, 84,
+ 89, 80, 69, 45, 181, 84, 89, 80, 69, 45, 180, 84, 89, 80, 69, 45, 179,
+ 84, 89, 80, 69, 45, 178, 84, 89, 80, 69, 45, 177, 84, 89, 80, 197, 84,
+ 89, 79, 128, 84, 89, 73, 128, 84, 89, 69, 128, 84, 89, 65, 128, 84, 87,
+ 79, 79, 128, 84, 87, 79, 45, 87, 65, 217, 84, 87, 79, 45, 84, 72, 73, 82,
+ 84, 89, 128, 84, 87, 79, 45, 76, 73, 78, 197, 84, 87, 79, 45, 72, 69, 65,
+ 68, 69, 196, 84, 87, 73, 83, 84, 69, 196, 84, 87, 73, 73, 128, 84, 87,
+ 73, 128, 84, 87, 69, 78, 84, 89, 45, 84, 87, 79, 128, 84, 87, 69, 78, 84,
+ 89, 45, 84, 72, 82, 69, 69, 128, 84, 87, 69, 78, 84, 89, 45, 83, 73, 88,
+ 128, 84, 87, 69, 78, 84, 89, 45, 83, 69, 86, 69, 78, 128, 84, 87, 69, 78,
+ 84, 89, 45, 79, 78, 69, 128, 84, 87, 69, 78, 84, 89, 45, 78, 73, 78, 69,
+ 128, 84, 87, 69, 78, 84, 89, 45, 70, 79, 85, 82, 128, 84, 87, 69, 78, 84,
+ 89, 45, 70, 73, 86, 69, 128, 84, 87, 69, 78, 84, 89, 45, 69, 73, 71, 72,
+ 84, 200, 84, 87, 69, 78, 84, 89, 45, 69, 73, 71, 72, 84, 128, 84, 87, 69,
+ 78, 84, 89, 128, 84, 87, 69, 78, 84, 217, 84, 87, 69, 76, 86, 69, 45, 84,
+ 72, 73, 82, 84, 89, 128, 84, 87, 69, 76, 86, 69, 128, 84, 87, 69, 76, 86,
+ 197, 84, 87, 69, 128, 84, 87, 65, 65, 128, 84, 87, 65, 128, 84, 86, 82,
+ 73, 68, 79, 128, 84, 86, 73, 77, 65, 68, 85, 210, 84, 85, 88, 128, 84,
+ 85, 85, 77, 85, 128, 84, 85, 84, 84, 89, 128, 84, 85, 84, 69, 89, 65, 83,
+ 65, 84, 128, 84, 85, 84, 128, 84, 85, 82, 88, 128, 84, 85, 82, 85, 128,
+ 84, 85, 82, 84, 76, 69, 128, 84, 85, 82, 79, 50, 128, 84, 85, 82, 78, 83,
+ 84, 73, 76, 69, 128, 84, 85, 82, 78, 69, 196, 84, 85, 82, 206, 84, 85,
+ 82, 66, 65, 78, 128, 84, 85, 82, 128, 84, 85, 80, 128, 84, 85, 79, 88,
+ 128, 84, 85, 79, 84, 128, 84, 85, 79, 80, 128, 84, 85, 79, 128, 84, 85,
+ 78, 78, 89, 128, 84, 85, 77, 69, 84, 69, 83, 128, 84, 85, 77, 65, 69,
+ 128, 84, 85, 77, 128, 84, 85, 76, 73, 80, 128, 84, 85, 75, 87, 69, 78,
+ 84, 73, 83, 128, 84, 85, 75, 128, 84, 85, 71, 82, 73, 203, 84, 85, 71,
+ 50, 128, 84, 85, 71, 178, 84, 85, 65, 82, 69, 199, 84, 85, 65, 69, 80,
+ 128, 84, 85, 65, 69, 128, 84, 213, 84, 84, 85, 68, 68, 65, 71, 128, 84,
+ 84, 85, 68, 68, 65, 65, 71, 128, 84, 84, 85, 128, 84, 84, 84, 72, 65,
+ 128, 84, 84, 84, 65, 128, 84, 84, 83, 85, 128, 84, 84, 83, 79, 128, 84,
+ 84, 83, 73, 128, 84, 84, 83, 69, 69, 128, 84, 84, 83, 69, 128, 84, 84,
+ 83, 65, 128, 84, 84, 73, 128, 84, 84, 72, 87, 69, 128, 84, 84, 72, 85,
+ 128, 84, 84, 72, 79, 79, 128, 84, 84, 72, 79, 128, 84, 84, 72, 73, 128,
+ 84, 84, 72, 69, 69, 128, 84, 84, 72, 69, 128, 84, 84, 72, 65, 65, 128,
+ 84, 84, 72, 128, 84, 84, 69, 72, 69, 72, 128, 84, 84, 69, 72, 69, 200,
+ 84, 84, 69, 72, 128, 84, 84, 69, 200, 84, 84, 69, 69, 128, 84, 84, 65,
+ 89, 65, 78, 78, 65, 128, 84, 84, 65, 65, 128, 84, 84, 50, 128, 84, 83,
+ 87, 69, 128, 84, 83, 87, 65, 128, 84, 83, 86, 128, 84, 83, 83, 69, 128,
+ 84, 83, 72, 85, 71, 83, 128, 84, 83, 72, 79, 79, 75, 128, 84, 83, 72, 79,
+ 79, 203, 84, 83, 72, 69, 83, 128, 84, 83, 72, 69, 71, 128, 84, 83, 72,
+ 69, 199, 84, 83, 72, 69, 128, 84, 83, 72, 65, 128, 84, 83, 69, 82, 69,
+ 128, 84, 83, 65, 68, 73, 128, 84, 83, 65, 68, 201, 84, 83, 65, 65, 68,
+ 73, 89, 128, 84, 83, 65, 65, 128, 84, 83, 193, 84, 82, 89, 66, 76, 73,
+ 79, 206, 84, 82, 85, 84, 72, 128, 84, 82, 85, 78, 75, 128, 84, 82, 85,
+ 78, 67, 65, 84, 69, 196, 84, 82, 85, 77, 80, 69, 84, 128, 84, 82, 85, 69,
+ 128, 84, 82, 85, 67, 75, 128, 84, 82, 79, 80, 73, 67, 65, 204, 84, 82,
+ 79, 80, 72, 89, 128, 84, 82, 79, 77, 73, 75, 79, 83, 89, 78, 65, 71, 77,
65, 128, 84, 82, 79, 77, 73, 75, 79, 80, 83, 73, 70, 73, 83, 84, 79, 78,
128, 84, 82, 79, 77, 73, 75, 79, 80, 65, 82, 65, 75, 65, 76, 69, 83, 77,
65, 128, 84, 82, 79, 77, 73, 75, 79, 78, 128, 84, 82, 79, 77, 73, 75, 79,
206, 84, 82, 79, 77, 73, 75, 79, 76, 89, 71, 73, 83, 77, 65, 128, 84, 82,
- 79, 75, 85, 84, 65, 83, 84, 201, 84, 82, 79, 69, 90, 69, 78, 73, 65, 206,
- 84, 82, 73, 84, 79, 211, 84, 82, 73, 84, 73, 77, 79, 82, 73, 79, 78, 128,
- 84, 82, 73, 83, 73, 77, 79, 85, 128, 84, 82, 73, 83, 69, 77, 69, 128, 84,
- 82, 73, 80, 79, 68, 128, 84, 82, 73, 80, 76, 73, 128, 84, 82, 73, 80, 76,
- 197, 84, 82, 73, 79, 206, 84, 82, 73, 73, 83, 65, 80, 128, 84, 82, 73,
- 71, 82, 65, 77, 77, 79, 211, 84, 82, 73, 71, 82, 65, 205, 84, 82, 73, 71,
- 79, 82, 71, 79, 78, 128, 84, 82, 73, 70, 79, 78, 73, 65, 83, 128, 84, 82,
- 73, 70, 79, 76, 73, 65, 84, 197, 84, 82, 73, 67, 79, 76, 79, 78, 128, 84,
- 82, 73, 65, 78, 71, 85, 76, 65, 210, 84, 82, 73, 65, 78, 71, 76, 69, 45,
- 82, 79, 85, 78, 196, 84, 82, 73, 65, 78, 71, 76, 69, 45, 72, 69, 65, 68,
- 69, 196, 84, 82, 73, 65, 78, 71, 76, 69, 128, 84, 82, 73, 65, 78, 71, 76,
- 197, 84, 82, 73, 65, 128, 84, 82, 73, 128, 84, 82, 69, 83, 73, 76, 76,
- 79, 128, 84, 82, 69, 77, 79, 76, 79, 45, 51, 128, 84, 82, 69, 77, 79, 76,
- 79, 45, 50, 128, 84, 82, 69, 77, 79, 76, 79, 45, 49, 128, 84, 82, 69, 69,
- 128, 84, 82, 69, 197, 84, 82, 69, 65, 68, 73, 78, 71, 128, 84, 82, 65,
- 80, 69, 90, 73, 85, 77, 128, 84, 82, 65, 78, 83, 86, 69, 82, 83, 65, 204,
- 84, 82, 65, 78, 83, 80, 79, 83, 73, 84, 73, 79, 206, 84, 82, 65, 78, 83,
- 77, 73, 83, 83, 73, 79, 78, 128, 84, 82, 65, 78, 83, 77, 73, 83, 83, 73,
- 79, 206, 84, 82, 65, 68, 197, 84, 82, 65, 67, 75, 128, 84, 82, 128, 84,
- 79, 88, 128, 84, 79, 84, 65, 204, 84, 79, 84, 128, 84, 79, 82, 84, 79,
- 73, 83, 197, 84, 79, 82, 67, 85, 76, 85, 83, 128, 84, 79, 82, 67, 85, 76,
- 85, 211, 84, 79, 80, 66, 65, 82, 128, 84, 79, 80, 45, 76, 73, 71, 72, 84,
- 69, 196, 84, 79, 80, 128, 84, 79, 208, 84, 79, 79, 84, 72, 128, 84, 79,
- 79, 128, 84, 79, 78, 79, 83, 128, 84, 79, 78, 71, 85, 69, 128, 84, 79,
- 78, 71, 128, 84, 79, 78, 69, 45, 54, 128, 84, 79, 78, 69, 45, 53, 128,
- 84, 79, 78, 69, 45, 52, 128, 84, 79, 78, 69, 45, 51, 128, 84, 79, 78, 69,
- 45, 50, 128, 84, 79, 78, 69, 45, 49, 128, 84, 79, 78, 69, 128, 84, 79,
- 78, 65, 204, 84, 79, 71, 69, 84, 72, 69, 82, 128, 84, 79, 68, 207, 84,
- 79, 65, 78, 68, 65, 75, 72, 73, 65, 84, 128, 84, 79, 65, 128, 84, 78,
- 128, 84, 76, 86, 128, 84, 76, 85, 128, 84, 76, 79, 128, 84, 76, 73, 128,
- 84, 76, 72, 85, 128, 84, 76, 72, 79, 128, 84, 76, 72, 73, 128, 84, 76,
- 72, 69, 69, 128, 84, 76, 72, 69, 128, 84, 76, 72, 65, 128, 84, 76, 69,
- 69, 128, 84, 76, 65, 128, 84, 74, 69, 128, 84, 73, 88, 128, 84, 73, 87,
- 78, 128, 84, 73, 87, 65, 218, 84, 73, 84, 76, 79, 128, 84, 73, 84, 128,
- 84, 73, 82, 79, 78, 73, 65, 206, 84, 73, 82, 128, 84, 73, 210, 84, 73,
- 80, 80, 73, 128, 84, 73, 80, 69, 72, 65, 128, 84, 73, 80, 128, 84, 73,
- 208, 84, 73, 78, 89, 128, 84, 73, 78, 78, 69, 128, 84, 73, 78, 65, 71,
- 77, 65, 128, 84, 73, 77, 69, 83, 128, 84, 73, 77, 69, 128, 84, 73, 76,
- 68, 197, 84, 73, 76, 128, 84, 73, 75, 69, 85, 84, 45, 82, 73, 69, 85, 76,
- 128, 84, 73, 75, 69, 85, 84, 45, 75, 73, 89, 69, 79, 75, 128, 84, 73, 75,
- 69, 85, 84, 128, 84, 73, 75, 69, 85, 212, 84, 73, 73, 128, 84, 73, 71,
- 72, 212, 84, 73, 71, 69, 82, 128, 84, 73, 69, 88, 128, 84, 73, 69, 80,
- 128, 84, 73, 197, 84, 73, 67, 75, 128, 84, 73, 67, 203, 84, 73, 65, 82,
- 65, 128, 84, 72, 90, 128, 84, 72, 89, 79, 79, 205, 84, 72, 87, 65, 65,
- 128, 84, 72, 87, 65, 128, 84, 72, 85, 82, 211, 84, 72, 85, 82, 73, 83,
- 65, 218, 84, 72, 85, 78, 71, 128, 84, 72, 85, 78, 68, 69, 82, 83, 84, 79,
- 82, 77, 128, 84, 72, 85, 78, 68, 69, 82, 128, 84, 72, 85, 128, 84, 72,
- 82, 79, 85, 71, 72, 128, 84, 72, 82, 79, 85, 71, 200, 84, 72, 82, 69, 69,
- 45, 80, 69, 82, 45, 69, 205, 84, 72, 82, 69, 69, 45, 76, 73, 78, 197, 84,
- 72, 82, 69, 69, 45, 196, 84, 72, 82, 69, 65, 68, 128, 84, 72, 79, 85, 83,
- 65, 78, 68, 211, 84, 72, 79, 85, 83, 65, 78, 68, 128, 84, 72, 79, 85, 83,
- 65, 78, 196, 84, 72, 79, 82, 78, 128, 84, 72, 79, 82, 206, 84, 72, 79,
- 79, 128, 84, 72, 79, 78, 71, 128, 84, 72, 79, 65, 128, 84, 72, 207, 84,
- 72, 73, 85, 84, 72, 128, 84, 72, 73, 84, 65, 128, 84, 72, 73, 82, 84, 89,
- 45, 83, 69, 67, 79, 78, 196, 84, 72, 73, 82, 84, 89, 45, 79, 78, 69, 128,
- 84, 72, 73, 82, 84, 89, 128, 84, 72, 73, 82, 84, 217, 84, 72, 73, 82, 84,
- 69, 69, 78, 128, 84, 72, 73, 82, 84, 69, 69, 206, 84, 72, 73, 82, 68, 83,
- 128, 84, 72, 73, 82, 68, 211, 84, 72, 73, 82, 68, 128, 84, 72, 73, 82,
- 196, 84, 72, 73, 206, 84, 72, 73, 73, 128, 84, 72, 73, 71, 72, 128, 84,
- 72, 73, 69, 85, 84, 72, 128, 84, 72, 73, 69, 85, 84, 200, 84, 72, 69, 89,
- 128, 84, 72, 69, 84, 72, 69, 128, 84, 72, 69, 84, 65, 128, 84, 72, 69,
- 84, 193, 84, 72, 69, 83, 80, 73, 65, 206, 84, 72, 69, 83, 69, 79, 83,
- 128, 84, 72, 69, 83, 69, 79, 211, 84, 72, 69, 211, 84, 72, 69, 82, 77,
- 79, 68, 89, 78, 65, 77, 73, 67, 128, 84, 72, 69, 82, 69, 70, 79, 82, 69,
- 128, 84, 72, 69, 82, 197, 84, 72, 69, 206, 84, 72, 69, 77, 65, 84, 73,
- 83, 77, 79, 211, 84, 72, 69, 77, 65, 128, 84, 72, 69, 77, 193, 84, 72,
- 69, 72, 128, 84, 72, 69, 200, 84, 72, 69, 69, 128, 84, 72, 197, 84, 72,
- 65, 78, 84, 72, 65, 75, 72, 65, 84, 128, 84, 72, 65, 78, 78, 65, 128, 84,
- 72, 65, 78, 128, 84, 72, 65, 206, 84, 72, 65, 76, 128, 84, 72, 65, 204,
- 84, 72, 65, 72, 65, 78, 128, 84, 72, 65, 65, 78, 193, 84, 72, 65, 65, 76,
- 85, 128, 84, 72, 65, 65, 128, 84, 72, 45, 67, 82, 69, 197, 84, 69, 88,
- 84, 128, 84, 69, 88, 128, 84, 69, 86, 73, 82, 128, 84, 69, 84, 82, 65,
- 83, 73, 77, 79, 85, 128, 84, 69, 84, 82, 65, 83, 69, 77, 69, 128, 84, 69,
- 84, 82, 65, 80, 76, 73, 128, 84, 69, 84, 82, 65, 70, 79, 78, 73, 65, 83,
- 128, 84, 69, 84, 72, 128, 84, 69, 84, 200, 84, 69, 84, 65, 82, 84, 79,
- 211, 84, 69, 84, 65, 82, 84, 73, 77, 79, 82, 73, 79, 78, 128, 84, 69, 84,
- 128, 84, 69, 212, 84, 69, 83, 83, 69, 82, 65, 128, 84, 69, 83, 83, 69,
- 82, 193, 84, 69, 83, 83, 65, 82, 79, 206, 84, 69, 83, 200, 84, 69, 82,
- 77, 73, 78, 65, 84, 79, 82, 128, 84, 69, 80, 128, 84, 69, 78, 85, 84, 79,
- 128, 84, 69, 78, 85, 128, 84, 69, 78, 213, 84, 69, 78, 84, 128, 84, 69,
- 78, 211, 84, 69, 78, 128, 84, 69, 206, 84, 69, 77, 80, 85, 211, 84, 69,
- 76, 79, 85, 211, 84, 69, 76, 73, 83, 72, 193, 84, 69, 76, 69, 80, 72, 79,
- 78, 69, 128, 84, 69, 76, 69, 80, 72, 79, 78, 197, 84, 69, 76, 69, 73, 65,
- 128, 84, 69, 73, 87, 83, 128, 84, 69, 71, 69, 72, 128, 84, 69, 197, 84,
- 69, 68, 85, 78, 71, 128, 84, 69, 65, 82, 68, 82, 79, 80, 45, 83, 80, 79,
- 75, 69, 196, 84, 69, 65, 82, 68, 82, 79, 80, 45, 83, 72, 65, 78, 75, 69,
- 196, 84, 69, 65, 82, 68, 82, 79, 80, 45, 66, 65, 82, 66, 69, 196, 84, 69,
- 45, 85, 128, 84, 67, 72, 69, 72, 69, 72, 128, 84, 67, 72, 69, 72, 69,
- 200, 84, 67, 72, 69, 72, 128, 84, 67, 72, 69, 200, 84, 67, 72, 69, 128,
- 84, 195, 84, 65, 88, 128, 84, 65, 87, 69, 76, 76, 69, 77, 69, 212, 84,
- 65, 87, 65, 128, 84, 65, 87, 128, 84, 65, 86, 73, 89, 65, 78, 73, 128,
- 84, 65, 86, 128, 84, 65, 214, 84, 65, 85, 82, 85, 83, 128, 84, 65, 85,
- 128, 84, 65, 213, 84, 65, 84, 87, 69, 69, 76, 128, 84, 65, 84, 87, 69,
- 69, 204, 84, 65, 84, 84, 79, 79, 69, 196, 84, 65, 84, 128, 84, 65, 82,
- 128, 84, 65, 80, 69, 82, 128, 84, 65, 80, 197, 84, 65, 80, 128, 84, 65,
- 79, 128, 84, 65, 78, 78, 69, 196, 84, 65, 78, 128, 84, 65, 77, 73, 78,
- 71, 128, 84, 65, 77, 128, 84, 65, 76, 76, 128, 84, 65, 76, 204, 84, 65,
- 76, 73, 78, 71, 128, 84, 65, 76, 73, 78, 199, 84, 65, 76, 69, 78, 84, 83,
- 128, 84, 65, 76, 69, 78, 212, 84, 65, 75, 72, 65, 76, 76, 85, 83, 128,
- 84, 65, 75, 69, 128, 84, 65, 75, 52, 128, 84, 65, 75, 128, 84, 65, 73,
- 83, 89, 79, 85, 128, 84, 65, 73, 76, 76, 69, 83, 211, 84, 65, 73, 76,
- 128, 84, 65, 73, 204, 84, 65, 72, 128, 84, 65, 200, 84, 65, 71, 66, 65,
- 78, 87, 193, 84, 65, 71, 65, 76, 79, 199, 84, 65, 71, 128, 84, 65, 67,
- 75, 128, 84, 65, 67, 203, 84, 65, 66, 85, 76, 65, 84, 73, 79, 78, 128,
- 84, 65, 66, 76, 69, 128, 84, 65, 66, 128, 84, 65, 194, 84, 65, 65, 76,
- 85, 74, 193, 84, 65, 65, 73, 128, 84, 65, 50, 128, 84, 65, 45, 82, 79,
- 76, 128, 83, 90, 90, 128, 83, 90, 87, 71, 128, 83, 90, 87, 65, 128, 83,
- 90, 85, 128, 83, 90, 79, 128, 83, 90, 73, 128, 83, 90, 69, 69, 128, 83,
- 90, 69, 128, 83, 90, 65, 65, 128, 83, 90, 65, 128, 83, 90, 128, 83, 89,
- 88, 128, 83, 89, 84, 128, 83, 89, 82, 88, 128, 83, 89, 82, 77, 65, 84,
- 73, 75, 73, 128, 83, 89, 82, 77, 65, 128, 83, 89, 82, 128, 83, 89, 80,
- 128, 83, 89, 79, 85, 87, 65, 128, 83, 89, 78, 69, 86, 77, 65, 128, 83,
- 89, 78, 68, 69, 83, 77, 79, 211, 83, 89, 78, 67, 72, 82, 79, 78, 79, 85,
- 211, 83, 89, 78, 65, 71, 77, 193, 83, 89, 78, 65, 70, 73, 128, 83, 89,
- 77, 77, 69, 84, 82, 89, 128, 83, 89, 77, 77, 69, 84, 82, 73, 195, 83, 89,
- 77, 66, 79, 76, 45, 57, 128, 83, 89, 77, 66, 79, 76, 45, 56, 128, 83, 89,
- 77, 66, 79, 76, 45, 55, 128, 83, 89, 77, 66, 79, 76, 45, 54, 128, 83, 89,
- 77, 66, 79, 76, 45, 53, 52, 128, 83, 89, 77, 66, 79, 76, 45, 53, 51, 128,
- 83, 89, 77, 66, 79, 76, 45, 53, 50, 128, 83, 89, 77, 66, 79, 76, 45, 53,
- 49, 128, 83, 89, 77, 66, 79, 76, 45, 53, 48, 128, 83, 89, 77, 66, 79, 76,
- 45, 53, 128, 83, 89, 77, 66, 79, 76, 45, 52, 57, 128, 83, 89, 77, 66, 79,
- 76, 45, 52, 56, 128, 83, 89, 77, 66, 79, 76, 45, 52, 55, 128, 83, 89, 77,
- 66, 79, 76, 45, 52, 53, 128, 83, 89, 77, 66, 79, 76, 45, 52, 51, 128, 83,
- 89, 77, 66, 79, 76, 45, 52, 50, 128, 83, 89, 77, 66, 79, 76, 45, 52, 48,
- 128, 83, 89, 77, 66, 79, 76, 45, 52, 128, 83, 89, 77, 66, 79, 76, 45, 51,
- 57, 128, 83, 89, 77, 66, 79, 76, 45, 51, 56, 128, 83, 89, 77, 66, 79, 76,
- 45, 51, 55, 128, 83, 89, 77, 66, 79, 76, 45, 51, 54, 128, 83, 89, 77, 66,
- 79, 76, 45, 51, 50, 128, 83, 89, 77, 66, 79, 76, 45, 51, 48, 128, 83, 89,
- 77, 66, 79, 76, 45, 51, 128, 83, 89, 77, 66, 79, 76, 45, 50, 57, 128, 83,
- 89, 77, 66, 79, 76, 45, 50, 55, 128, 83, 89, 77, 66, 79, 76, 45, 50, 54,
- 128, 83, 89, 77, 66, 79, 76, 45, 50, 53, 128, 83, 89, 77, 66, 79, 76, 45,
- 50, 52, 128, 83, 89, 77, 66, 79, 76, 45, 50, 51, 128, 83, 89, 77, 66, 79,
- 76, 45, 50, 50, 128, 83, 89, 77, 66, 79, 76, 45, 50, 49, 128, 83, 89, 77,
- 66, 79, 76, 45, 50, 48, 128, 83, 89, 77, 66, 79, 76, 45, 50, 128, 83, 89,
- 77, 66, 79, 76, 45, 49, 57, 128, 83, 89, 77, 66, 79, 76, 45, 49, 56, 128,
- 83, 89, 77, 66, 79, 76, 45, 49, 55, 128, 83, 89, 77, 66, 79, 76, 45, 49,
- 54, 128, 83, 89, 77, 66, 79, 76, 45, 49, 53, 128, 83, 89, 77, 66, 79, 76,
- 45, 49, 52, 128, 83, 89, 77, 66, 79, 76, 45, 49, 51, 128, 83, 89, 77, 66,
- 79, 76, 45, 49, 50, 128, 83, 89, 77, 66, 79, 76, 45, 49, 49, 128, 83, 89,
- 77, 66, 79, 76, 45, 49, 48, 128, 83, 89, 77, 66, 79, 76, 45, 49, 128, 83,
- 89, 76, 79, 84, 201, 83, 89, 65, 128, 83, 89, 128, 83, 87, 90, 128, 83,
- 87, 85, 78, 199, 83, 87, 79, 82, 68, 83, 128, 83, 87, 79, 82, 68, 128,
- 83, 87, 79, 79, 128, 83, 87, 79, 128, 83, 87, 73, 73, 128, 83, 87, 73,
- 128, 83, 87, 71, 128, 83, 87, 69, 69, 84, 128, 83, 87, 65, 83, 200, 83,
- 87, 65, 80, 80, 73, 78, 71, 128, 83, 87, 65, 65, 128, 83, 87, 128, 83,
- 85, 88, 128, 83, 85, 84, 128, 83, 85, 83, 80, 69, 78, 83, 73, 79, 206,
- 83, 85, 82, 88, 128, 83, 85, 82, 82, 79, 85, 78, 68, 128, 83, 85, 82, 82,
- 79, 85, 78, 196, 83, 85, 82, 70, 65, 67, 197, 83, 85, 82, 69, 128, 83,
- 85, 82, 65, 78, 71, 128, 83, 85, 82, 57, 128, 83, 85, 82, 128, 83, 85,
- 210, 83, 85, 80, 82, 65, 76, 73, 78, 69, 65, 210, 83, 85, 80, 69, 82, 86,
- 73, 83, 69, 128, 83, 85, 80, 69, 82, 83, 69, 84, 128, 83, 85, 80, 69, 82,
- 83, 69, 212, 83, 85, 80, 69, 82, 83, 67, 82, 73, 80, 212, 83, 85, 80, 69,
- 82, 73, 77, 80, 79, 83, 69, 196, 83, 85, 80, 69, 82, 70, 73, 88, 69, 196,
- 83, 85, 80, 128, 83, 85, 79, 88, 128, 83, 85, 79, 80, 128, 83, 85, 79,
- 128, 83, 85, 78, 71, 128, 83, 85, 78, 128, 83, 85, 206, 83, 85, 77, 77,
- 69, 82, 128, 83, 85, 77, 77, 65, 84, 73, 79, 78, 128, 83, 85, 77, 77, 65,
- 84, 73, 79, 206, 83, 85, 77, 65, 83, 72, 128, 83, 85, 77, 128, 83, 85,
- 75, 85, 78, 128, 83, 85, 75, 85, 206, 83, 85, 75, 85, 128, 83, 85, 75,
- 213, 83, 85, 73, 84, 65, 66, 76, 69, 128, 83, 85, 73, 84, 128, 83, 85,
- 72, 85, 82, 128, 83, 85, 68, 50, 128, 83, 85, 68, 128, 83, 85, 67, 67,
- 69, 69, 68, 83, 128, 83, 85, 67, 67, 69, 69, 68, 211, 83, 85, 67, 67, 69,
- 69, 68, 128, 83, 85, 67, 67, 69, 69, 196, 83, 85, 66, 85, 78, 73, 84,
- 128, 83, 85, 66, 83, 84, 73, 84, 85, 84, 73, 79, 206, 83, 85, 66, 83, 84,
- 73, 84, 85, 84, 69, 128, 83, 85, 66, 83, 84, 73, 84, 85, 84, 197, 83, 85,
- 66, 83, 69, 84, 128, 83, 85, 66, 83, 69, 212, 83, 85, 66, 83, 67, 82, 73,
- 80, 212, 83, 85, 66, 80, 85, 78, 67, 84, 73, 83, 128, 83, 85, 66, 76, 73,
- 78, 69, 65, 210, 83, 85, 66, 74, 79, 73, 78, 69, 196, 83, 85, 66, 74, 69,
- 67, 84, 128, 83, 85, 66, 73, 84, 79, 128, 83, 85, 66, 71, 82, 79, 85, 80,
- 128, 83, 85, 66, 71, 82, 79, 85, 208, 83, 85, 65, 128, 83, 213, 83, 84,
- 87, 65, 128, 83, 84, 85, 68, 89, 128, 83, 84, 82, 79, 75, 69, 83, 128,
- 83, 84, 82, 79, 75, 69, 211, 83, 84, 82, 79, 75, 69, 45, 57, 128, 83, 84,
- 82, 79, 75, 69, 45, 56, 128, 83, 84, 82, 79, 75, 69, 45, 55, 128, 83, 84,
- 82, 79, 75, 69, 45, 54, 128, 83, 84, 82, 79, 75, 69, 45, 53, 128, 83, 84,
- 82, 79, 75, 69, 45, 52, 128, 83, 84, 82, 79, 75, 69, 45, 51, 128, 83, 84,
- 82, 79, 75, 69, 45, 50, 128, 83, 84, 82, 79, 75, 69, 45, 49, 49, 128, 83,
- 84, 82, 79, 75, 69, 45, 49, 48, 128, 83, 84, 82, 79, 75, 69, 45, 49, 128,
- 83, 84, 82, 73, 75, 69, 84, 72, 82, 79, 85, 71, 72, 128, 83, 84, 82, 73,
- 68, 69, 128, 83, 84, 82, 73, 67, 84, 76, 217, 83, 84, 82, 69, 84, 67, 72,
- 69, 196, 83, 84, 82, 69, 83, 211, 83, 84, 82, 69, 78, 71, 84, 72, 128,
- 83, 84, 82, 65, 84, 73, 65, 206, 83, 84, 82, 65, 73, 78, 69, 82, 128, 83,
- 84, 82, 65, 73, 71, 72, 84, 78, 69, 83, 83, 128, 83, 84, 82, 65, 73, 71,
- 72, 212, 83, 84, 82, 65, 73, 70, 128, 83, 84, 82, 65, 71, 71, 73, 83, 77,
- 65, 84, 65, 128, 83, 84, 79, 86, 69, 128, 83, 84, 79, 80, 80, 73, 78, 71,
- 128, 83, 84, 79, 80, 80, 65, 71, 69, 128, 83, 84, 79, 80, 128, 83, 84,
- 79, 208, 83, 84, 79, 78, 69, 128, 83, 84, 79, 67, 75, 128, 83, 84, 73,
- 77, 77, 69, 128, 83, 84, 73, 76, 204, 83, 84, 73, 76, 197, 83, 84, 73,
- 71, 77, 65, 128, 83, 84, 69, 80, 128, 83, 84, 69, 77, 128, 83, 84, 69,
- 205, 83, 84, 69, 65, 77, 128, 83, 84, 65, 86, 82, 79, 85, 128, 83, 84,
- 65, 86, 82, 79, 83, 128, 83, 84, 65, 86, 82, 79, 211, 83, 84, 65, 85, 82,
- 79, 83, 128, 83, 84, 65, 84, 69, 82, 83, 128, 83, 84, 65, 82, 212, 83,
- 84, 65, 82, 75, 128, 83, 84, 65, 82, 128, 83, 84, 65, 210, 83, 84, 65,
- 78, 68, 83, 84, 73, 76, 76, 128, 83, 84, 65, 78, 68, 65, 82, 196, 83, 84,
- 65, 78, 68, 128, 83, 84, 65, 78, 128, 83, 84, 65, 76, 76, 73, 79, 78,
- 128, 83, 84, 65, 70, 70, 128, 83, 84, 65, 70, 198, 83, 84, 65, 67, 67,
- 65, 84, 79, 128, 83, 84, 65, 67, 67, 65, 84, 73, 83, 83, 73, 77, 79, 128,
- 83, 84, 50, 128, 83, 83, 89, 88, 128, 83, 83, 89, 84, 128, 83, 83, 89,
- 82, 88, 128, 83, 83, 89, 82, 128, 83, 83, 89, 80, 128, 83, 83, 89, 128,
- 83, 83, 85, 88, 128, 83, 83, 85, 84, 128, 83, 83, 85, 80, 128, 83, 83,
- 79, 88, 128, 83, 83, 79, 84, 128, 83, 83, 79, 80, 128, 83, 83, 79, 128,
- 83, 83, 73, 88, 128, 83, 83, 73, 84, 128, 83, 83, 73, 80, 128, 83, 83,
- 73, 69, 88, 128, 83, 83, 73, 69, 80, 128, 83, 83, 73, 69, 128, 83, 83,
- 73, 128, 83, 83, 69, 88, 128, 83, 83, 69, 80, 128, 83, 83, 69, 69, 128,
- 83, 83, 65, 88, 128, 83, 83, 65, 84, 128, 83, 83, 65, 80, 128, 83, 83,
- 65, 78, 71, 84, 73, 75, 69, 85, 84, 128, 83, 83, 65, 78, 71, 83, 73, 79,
- 83, 128, 83, 83, 65, 78, 71, 82, 73, 69, 85, 76, 128, 83, 83, 65, 78, 71,
- 80, 73, 69, 85, 80, 128, 83, 83, 65, 78, 71, 78, 73, 69, 85, 78, 128, 83,
- 83, 65, 78, 71, 75, 73, 89, 69, 79, 75, 128, 83, 83, 65, 78, 71, 73, 69,
- 85, 78, 71, 128, 83, 83, 65, 78, 71, 72, 73, 69, 85, 72, 128, 83, 83, 65,
- 78, 71, 67, 73, 69, 85, 67, 128, 83, 83, 65, 78, 71, 65, 82, 65, 69, 65,
- 128, 83, 83, 65, 65, 128, 83, 83, 65, 128, 83, 82, 128, 83, 81, 85, 73,
- 83, 200, 83, 81, 85, 73, 82, 82, 69, 204, 83, 81, 85, 73, 71, 71, 76,
- 197, 83, 81, 85, 65, 212, 83, 81, 85, 65, 82, 69, 83, 128, 83, 81, 85,
- 65, 82, 69, 68, 128, 83, 81, 85, 65, 82, 69, 196, 83, 81, 85, 65, 82, 69,
- 128, 83, 80, 87, 65, 128, 83, 80, 85, 78, 71, 211, 83, 80, 82, 79, 85,
- 84, 128, 83, 80, 82, 73, 78, 71, 83, 128, 83, 80, 82, 73, 78, 71, 128,
- 83, 80, 82, 69, 67, 72, 71, 69, 83, 65, 78, 199, 83, 80, 79, 84, 128, 83,
- 80, 79, 79, 78, 128, 83, 80, 76, 73, 84, 84, 73, 78, 199, 83, 80, 73, 82,
- 73, 84, 128, 83, 80, 73, 82, 73, 212, 83, 80, 73, 82, 65, 78, 84, 128,
- 83, 80, 73, 82, 65, 76, 128, 83, 80, 73, 68, 69, 82, 217, 83, 80, 73, 67,
- 69, 128, 83, 80, 72, 69, 82, 73, 67, 65, 204, 83, 80, 69, 69, 67, 72,
- 128, 83, 80, 69, 67, 73, 65, 76, 128, 83, 80, 69, 65, 82, 128, 83, 80,
- 65, 84, 72, 73, 128, 83, 80, 65, 82, 75, 76, 69, 128, 83, 80, 65, 68,
- 197, 83, 80, 65, 67, 73, 78, 199, 83, 80, 128, 83, 79, 87, 73, 76, 207,
- 83, 79, 87, 128, 83, 79, 85, 84, 72, 45, 83, 76, 65, 86, 69, 217, 83, 79,
- 85, 84, 200, 83, 79, 85, 82, 67, 69, 128, 83, 79, 85, 78, 68, 128, 83,
- 79, 85, 78, 196, 83, 79, 85, 128, 83, 79, 79, 128, 83, 79, 78, 128, 83,
- 79, 76, 73, 68, 85, 83, 128, 83, 79, 76, 73, 68, 85, 211, 83, 79, 71, 68,
- 73, 65, 206, 83, 79, 70, 84, 87, 65, 82, 69, 45, 70, 85, 78, 67, 84, 73,
- 79, 206, 83, 79, 70, 212, 83, 79, 198, 83, 79, 67, 73, 69, 84, 89, 128,
+ 79, 76, 76, 69, 89, 66, 85, 83, 128, 84, 82, 79, 75, 85, 84, 65, 83, 84,
+ 201, 84, 82, 79, 69, 90, 69, 78, 73, 65, 206, 84, 82, 73, 85, 77, 80, 72,
+ 128, 84, 82, 73, 84, 79, 211, 84, 82, 73, 84, 73, 77, 79, 82, 73, 79, 78,
+ 128, 84, 82, 73, 83, 73, 77, 79, 85, 128, 84, 82, 73, 83, 69, 77, 69,
+ 128, 84, 82, 73, 80, 79, 68, 128, 84, 82, 73, 80, 76, 73, 128, 84, 82,
+ 73, 80, 76, 197, 84, 82, 73, 79, 206, 84, 82, 73, 73, 83, 65, 80, 128,
+ 84, 82, 73, 71, 82, 65, 77, 77, 79, 211, 84, 82, 73, 71, 82, 65, 205, 84,
+ 82, 73, 71, 79, 82, 71, 79, 78, 128, 84, 82, 73, 70, 79, 78, 73, 65, 83,
+ 128, 84, 82, 73, 70, 79, 76, 73, 65, 84, 197, 84, 82, 73, 68, 69, 78, 84,
+ 128, 84, 82, 73, 68, 69, 78, 212, 84, 82, 73, 67, 79, 76, 79, 78, 128,
+ 84, 82, 73, 65, 78, 71, 85, 76, 65, 210, 84, 82, 73, 65, 78, 71, 76, 69,
+ 45, 82, 79, 85, 78, 196, 84, 82, 73, 65, 78, 71, 76, 69, 45, 72, 69, 65,
+ 68, 69, 196, 84, 82, 73, 65, 78, 71, 76, 69, 128, 84, 82, 73, 65, 78, 71,
+ 76, 197, 84, 82, 73, 65, 128, 84, 82, 73, 128, 84, 82, 69, 83, 73, 76,
+ 76, 79, 128, 84, 82, 69, 78, 68, 128, 84, 82, 69, 78, 196, 84, 82, 69,
+ 77, 79, 76, 79, 45, 51, 128, 84, 82, 69, 77, 79, 76, 79, 45, 50, 128, 84,
+ 82, 69, 77, 79, 76, 79, 45, 49, 128, 84, 82, 69, 69, 128, 84, 82, 69,
+ 197, 84, 82, 69, 65, 68, 73, 78, 71, 128, 84, 82, 65, 89, 128, 84, 82,
+ 65, 80, 69, 90, 73, 85, 77, 128, 84, 82, 65, 78, 83, 86, 69, 82, 83, 65,
+ 204, 84, 82, 65, 78, 83, 80, 79, 83, 73, 84, 73, 79, 206, 84, 82, 65, 78,
+ 83, 77, 73, 83, 83, 73, 79, 78, 128, 84, 82, 65, 78, 83, 77, 73, 83, 83,
+ 73, 79, 206, 84, 82, 65, 77, 87, 65, 89, 128, 84, 82, 65, 77, 128, 84,
+ 82, 65, 205, 84, 82, 65, 73, 78, 128, 84, 82, 65, 73, 206, 84, 82, 65,
+ 73, 76, 73, 78, 199, 84, 82, 65, 70, 70, 73, 67, 128, 84, 82, 65, 70, 70,
+ 73, 195, 84, 82, 65, 68, 197, 84, 82, 65, 67, 84, 79, 82, 128, 84, 82,
+ 65, 67, 75, 128, 84, 82, 128, 84, 79, 88, 128, 84, 79, 87, 69, 82, 128,
+ 84, 79, 85, 82, 78, 79, 73, 211, 84, 79, 84, 65, 204, 84, 79, 84, 128,
+ 84, 79, 82, 84, 79, 73, 83, 197, 84, 79, 82, 67, 85, 76, 85, 83, 128, 84,
+ 79, 82, 67, 85, 76, 85, 211, 84, 79, 82, 67, 72, 128, 84, 79, 81, 128,
+ 84, 79, 80, 66, 65, 82, 128, 84, 79, 80, 45, 76, 73, 71, 72, 84, 69, 196,
+ 84, 79, 80, 128, 84, 79, 208, 84, 79, 79, 84, 72, 128, 84, 79, 79, 78,
+ 128, 84, 79, 79, 128, 84, 79, 78, 79, 83, 128, 84, 79, 78, 71, 85, 69,
+ 128, 84, 79, 78, 71, 85, 197, 84, 79, 78, 71, 128, 84, 79, 78, 69, 45,
+ 54, 128, 84, 79, 78, 69, 45, 53, 128, 84, 79, 78, 69, 45, 52, 128, 84,
+ 79, 78, 69, 45, 51, 128, 84, 79, 78, 69, 45, 50, 128, 84, 79, 78, 69, 45,
+ 49, 128, 84, 79, 78, 69, 128, 84, 79, 78, 65, 204, 84, 79, 77, 80, 73,
+ 128, 84, 79, 77, 65, 84, 79, 128, 84, 79, 76, 79, 78, 71, 128, 84, 79,
+ 75, 89, 207, 84, 79, 73, 76, 69, 84, 128, 84, 79, 71, 69, 84, 72, 69, 82,
+ 128, 84, 79, 68, 207, 84, 79, 65, 78, 68, 65, 75, 72, 73, 65, 84, 128,
+ 84, 79, 65, 128, 84, 78, 128, 84, 76, 86, 128, 84, 76, 85, 128, 84, 76,
+ 79, 128, 84, 76, 73, 128, 84, 76, 72, 87, 69, 128, 84, 76, 72, 85, 128,
+ 84, 76, 72, 79, 79, 128, 84, 76, 72, 79, 128, 84, 76, 72, 73, 128, 84,
+ 76, 72, 69, 69, 128, 84, 76, 72, 69, 128, 84, 76, 72, 65, 128, 84, 76,
+ 69, 69, 128, 84, 76, 65, 128, 84, 74, 69, 128, 84, 73, 88, 128, 84, 73,
+ 87, 78, 128, 84, 73, 87, 65, 218, 84, 73, 84, 85, 65, 69, 80, 128, 84,
+ 73, 84, 76, 79, 128, 84, 73, 84, 193, 84, 73, 84, 128, 84, 73, 82, 89,
+ 65, 75, 128, 84, 73, 82, 84, 193, 84, 73, 82, 79, 78, 73, 65, 206, 84,
+ 73, 82, 69, 196, 84, 73, 82, 128, 84, 73, 210, 84, 73, 80, 80, 73, 128,
+ 84, 73, 80, 69, 72, 65, 128, 84, 73, 80, 128, 84, 73, 208, 84, 73, 78,
+ 89, 128, 84, 73, 78, 217, 84, 73, 78, 78, 69, 128, 84, 73, 78, 67, 84,
+ 85, 82, 69, 128, 84, 73, 78, 65, 71, 77, 65, 128, 84, 73, 77, 69, 83,
+ 128, 84, 73, 77, 69, 210, 84, 73, 77, 69, 128, 84, 73, 76, 68, 69, 128,
+ 84, 73, 76, 68, 197, 84, 73, 76, 128, 84, 73, 204, 84, 73, 75, 69, 85,
+ 84, 45, 84, 72, 73, 69, 85, 84, 72, 128, 84, 73, 75, 69, 85, 84, 45, 83,
+ 73, 79, 83, 45, 75, 73, 89, 69, 79, 75, 128, 84, 73, 75, 69, 85, 84, 45,
+ 83, 73, 79, 83, 128, 84, 73, 75, 69, 85, 84, 45, 82, 73, 69, 85, 76, 128,
+ 84, 73, 75, 69, 85, 84, 45, 80, 73, 69, 85, 80, 128, 84, 73, 75, 69, 85,
+ 84, 45, 77, 73, 69, 85, 77, 128, 84, 73, 75, 69, 85, 84, 45, 75, 73, 89,
+ 69, 79, 75, 128, 84, 73, 75, 69, 85, 84, 45, 67, 73, 69, 85, 67, 128, 84,
+ 73, 75, 69, 85, 84, 45, 67, 72, 73, 69, 85, 67, 72, 128, 84, 73, 75, 69,
+ 85, 84, 128, 84, 73, 75, 69, 85, 212, 84, 73, 73, 128, 84, 73, 71, 72,
+ 84, 76, 89, 45, 67, 76, 79, 83, 69, 196, 84, 73, 71, 72, 212, 84, 73, 71,
+ 69, 82, 128, 84, 73, 71, 69, 210, 84, 73, 70, 73, 78, 65, 71, 200, 84,
+ 73, 69, 88, 128, 84, 73, 69, 80, 128, 84, 73, 197, 84, 73, 67, 75, 69,
+ 84, 128, 84, 73, 67, 75, 128, 84, 73, 67, 203, 84, 73, 65, 82, 65, 128,
+ 84, 72, 90, 128, 84, 72, 89, 79, 79, 205, 84, 72, 87, 79, 79, 128, 84,
+ 72, 87, 79, 128, 84, 72, 87, 73, 73, 128, 84, 72, 87, 73, 128, 84, 72,
+ 87, 69, 69, 128, 84, 72, 87, 65, 65, 128, 84, 72, 87, 65, 128, 84, 72,
+ 85, 82, 211, 84, 72, 85, 82, 73, 83, 65, 218, 84, 72, 85, 78, 71, 128,
+ 84, 72, 85, 78, 68, 69, 82, 83, 84, 79, 82, 77, 128, 84, 72, 85, 78, 68,
+ 69, 82, 128, 84, 72, 85, 78, 68, 69, 210, 84, 72, 85, 77, 66, 211, 84,
+ 72, 82, 79, 87, 73, 78, 199, 84, 72, 82, 79, 85, 71, 72, 128, 84, 72, 82,
+ 79, 85, 71, 200, 84, 72, 82, 69, 69, 45, 84, 72, 73, 82, 84, 89, 128, 84,
+ 72, 82, 69, 69, 45, 80, 69, 82, 45, 69, 205, 84, 72, 82, 69, 69, 45, 76,
+ 73, 78, 197, 84, 72, 82, 69, 69, 45, 196, 84, 72, 82, 69, 65, 68, 128,
+ 84, 72, 79, 85, 83, 65, 78, 68, 211, 84, 72, 79, 85, 83, 65, 78, 68, 128,
+ 84, 72, 79, 85, 83, 65, 78, 196, 84, 72, 79, 85, 71, 72, 212, 84, 72, 79,
+ 85, 128, 84, 72, 79, 82, 78, 128, 84, 72, 79, 82, 206, 84, 72, 79, 78,
+ 71, 128, 84, 72, 79, 65, 128, 84, 72, 207, 84, 72, 73, 85, 84, 72, 128,
+ 84, 72, 73, 84, 65, 128, 84, 72, 73, 82, 84, 89, 45, 83, 69, 67, 79, 78,
+ 196, 84, 72, 73, 82, 84, 89, 45, 79, 78, 69, 128, 84, 72, 73, 82, 84,
+ 217, 84, 72, 73, 82, 84, 69, 69, 78, 128, 84, 72, 73, 82, 84, 69, 69,
+ 206, 84, 72, 73, 82, 68, 83, 128, 84, 72, 73, 82, 68, 211, 84, 72, 73,
+ 82, 68, 128, 84, 72, 73, 82, 196, 84, 72, 73, 206, 84, 72, 73, 73, 128,
+ 84, 72, 73, 71, 72, 128, 84, 72, 73, 69, 85, 84, 200, 84, 72, 69, 89,
+ 128, 84, 72, 69, 84, 72, 69, 128, 84, 72, 69, 84, 72, 128, 84, 72, 69,
+ 84, 65, 128, 84, 72, 69, 84, 193, 84, 72, 69, 83, 80, 73, 65, 206, 84,
+ 72, 69, 83, 69, 79, 83, 128, 84, 72, 69, 83, 69, 79, 211, 84, 72, 69,
+ 211, 84, 72, 69, 82, 77, 79, 68, 89, 78, 65, 77, 73, 67, 128, 84, 72, 69,
+ 82, 69, 70, 79, 82, 69, 128, 84, 72, 69, 82, 197, 84, 72, 69, 206, 84,
+ 72, 69, 77, 65, 84, 73, 83, 77, 79, 211, 84, 72, 69, 77, 65, 128, 84, 72,
+ 69, 77, 193, 84, 72, 69, 72, 128, 84, 72, 69, 200, 84, 72, 197, 84, 72,
+ 65, 87, 128, 84, 72, 65, 78, 84, 72, 65, 75, 72, 65, 84, 128, 84, 72, 65,
+ 78, 78, 65, 128, 84, 72, 65, 78, 128, 84, 72, 65, 206, 84, 72, 65, 76,
+ 128, 84, 72, 65, 204, 84, 72, 65, 72, 65, 78, 128, 84, 72, 65, 65, 78,
+ 193, 84, 72, 65, 65, 76, 85, 128, 84, 72, 45, 67, 82, 69, 197, 84, 69,
+ 88, 84, 128, 84, 69, 88, 128, 84, 69, 86, 73, 82, 128, 84, 69, 85, 84,
+ 69, 85, 88, 128, 84, 69, 85, 84, 69, 85, 87, 69, 78, 128, 84, 69, 85, 84,
+ 128, 84, 69, 85, 78, 128, 84, 69, 85, 65, 69, 81, 128, 84, 69, 85, 65,
+ 69, 78, 128, 84, 69, 85, 128, 84, 69, 84, 82, 65, 83, 73, 77, 79, 85,
+ 128, 84, 69, 84, 82, 65, 83, 69, 77, 69, 128, 84, 69, 84, 82, 65, 80, 76,
+ 73, 128, 84, 69, 84, 82, 65, 70, 79, 78, 73, 65, 83, 128, 84, 69, 84, 72,
+ 128, 84, 69, 84, 200, 84, 69, 84, 65, 82, 84, 79, 211, 84, 69, 84, 65,
+ 82, 84, 73, 77, 79, 82, 73, 79, 78, 128, 84, 69, 84, 128, 84, 69, 212,
+ 84, 69, 83, 83, 69, 82, 65, 128, 84, 69, 83, 83, 69, 82, 193, 84, 69, 83,
+ 83, 65, 82, 79, 206, 84, 69, 83, 200, 84, 69, 82, 77, 73, 78, 65, 84, 79,
+ 82, 128, 84, 69, 80, 128, 84, 69, 78, 85, 84, 79, 128, 84, 69, 78, 85,
+ 128, 84, 69, 78, 213, 84, 69, 78, 84, 72, 128, 84, 69, 78, 84, 128, 84,
+ 69, 78, 211, 84, 69, 78, 78, 73, 211, 84, 69, 78, 71, 197, 84, 69, 78,
+ 45, 84, 72, 73, 82, 84, 89, 128, 84, 69, 78, 128, 84, 69, 206, 84, 69,
+ 77, 80, 85, 211, 84, 69, 76, 85, 128, 84, 69, 76, 79, 85, 211, 84, 69,
+ 76, 76, 69, 210, 84, 69, 76, 73, 83, 72, 193, 84, 69, 76, 69, 86, 73, 83,
+ 73, 79, 78, 128, 84, 69, 76, 69, 83, 67, 79, 80, 69, 128, 84, 69, 76, 69,
+ 80, 72, 79, 78, 69, 128, 84, 69, 76, 69, 80, 72, 79, 78, 197, 84, 69, 76,
+ 69, 73, 65, 128, 84, 69, 73, 87, 83, 128, 84, 69, 71, 69, 72, 128, 84,
+ 69, 69, 69, 69, 128, 84, 69, 197, 84, 69, 68, 85, 78, 71, 128, 84, 69,
+ 65, 82, 211, 84, 69, 65, 82, 68, 82, 79, 80, 45, 83, 80, 79, 75, 69, 196,
+ 84, 69, 65, 82, 68, 82, 79, 80, 45, 83, 72, 65, 78, 75, 69, 196, 84, 69,
+ 65, 82, 68, 82, 79, 80, 45, 66, 65, 82, 66, 69, 196, 84, 69, 65, 82, 45,
+ 79, 70, 198, 84, 69, 65, 67, 85, 208, 84, 69, 45, 85, 128, 84, 67, 72,
+ 69, 72, 69, 72, 128, 84, 67, 72, 69, 72, 69, 200, 84, 67, 72, 69, 72,
+ 128, 84, 67, 72, 69, 200, 84, 67, 72, 69, 128, 84, 195, 84, 65, 89, 128,
+ 84, 65, 88, 73, 128, 84, 65, 88, 128, 84, 65, 87, 69, 76, 76, 69, 77, 69,
+ 212, 84, 65, 87, 65, 128, 84, 65, 87, 128, 84, 65, 86, 73, 89, 65, 78,
+ 73, 128, 84, 65, 86, 128, 84, 65, 214, 84, 65, 85, 82, 85, 83, 128, 84,
+ 65, 85, 128, 84, 65, 213, 84, 65, 84, 87, 69, 69, 76, 128, 84, 65, 84,
+ 87, 69, 69, 204, 84, 65, 84, 84, 79, 79, 69, 196, 84, 65, 84, 128, 84,
+ 65, 82, 85, 78, 71, 128, 84, 65, 82, 84, 65, 82, 45, 50, 128, 84, 65, 82,
+ 84, 65, 82, 128, 84, 65, 81, 128, 84, 65, 80, 69, 82, 128, 84, 65, 80,
+ 197, 84, 65, 80, 128, 84, 65, 79, 128, 84, 65, 78, 78, 69, 196, 84, 65,
+ 78, 71, 69, 82, 73, 78, 69, 128, 84, 65, 78, 199, 84, 65, 78, 65, 66, 65,
+ 84, 193, 84, 65, 78, 128, 84, 65, 77, 73, 78, 71, 128, 84, 65, 77, 128,
+ 84, 65, 76, 76, 128, 84, 65, 76, 204, 84, 65, 76, 73, 78, 71, 128, 84,
+ 65, 76, 73, 78, 199, 84, 65, 76, 69, 78, 84, 83, 128, 84, 65, 76, 69, 78,
+ 212, 84, 65, 75, 72, 65, 76, 76, 85, 83, 128, 84, 65, 75, 69, 128, 84,
+ 65, 75, 52, 128, 84, 65, 75, 128, 84, 65, 73, 83, 89, 79, 85, 128, 84,
+ 65, 73, 76, 76, 69, 83, 211, 84, 65, 73, 76, 128, 84, 65, 73, 204, 84,
+ 65, 72, 128, 84, 65, 200, 84, 65, 71, 66, 65, 78, 87, 193, 84, 65, 71,
+ 65, 76, 79, 199, 84, 65, 71, 128, 84, 65, 69, 206, 84, 65, 67, 75, 128,
+ 84, 65, 67, 203, 84, 65, 66, 85, 76, 65, 84, 73, 79, 78, 128, 84, 65, 66,
+ 83, 128, 84, 65, 66, 76, 69, 128, 84, 65, 66, 128, 84, 65, 194, 84, 65,
+ 65, 83, 72, 65, 69, 128, 84, 65, 65, 81, 128, 84, 65, 65, 77, 128, 84,
+ 65, 65, 76, 85, 74, 193, 84, 65, 65, 73, 128, 84, 65, 65, 70, 128, 84,
+ 65, 50, 128, 84, 65, 45, 82, 79, 76, 128, 84, 48, 51, 54, 128, 84, 48,
+ 51, 53, 128, 84, 48, 51, 52, 128, 84, 48, 51, 51, 65, 128, 84, 48, 51,
+ 51, 128, 84, 48, 51, 50, 65, 128, 84, 48, 51, 50, 128, 84, 48, 51, 49,
+ 128, 84, 48, 51, 48, 128, 84, 48, 50, 57, 128, 84, 48, 50, 56, 128, 84,
+ 48, 50, 55, 128, 84, 48, 50, 54, 128, 84, 48, 50, 53, 128, 84, 48, 50,
+ 52, 128, 84, 48, 50, 51, 128, 84, 48, 50, 50, 128, 84, 48, 50, 49, 128,
+ 84, 48, 50, 48, 128, 84, 48, 49, 57, 128, 84, 48, 49, 56, 128, 84, 48,
+ 49, 55, 128, 84, 48, 49, 54, 65, 128, 84, 48, 49, 54, 128, 84, 48, 49,
+ 53, 128, 84, 48, 49, 52, 128, 84, 48, 49, 51, 128, 84, 48, 49, 50, 128,
+ 84, 48, 49, 49, 65, 128, 84, 48, 49, 49, 128, 84, 48, 49, 48, 128, 84,
+ 48, 48, 57, 65, 128, 84, 48, 48, 57, 128, 84, 48, 48, 56, 65, 128, 84,
+ 48, 48, 56, 128, 84, 48, 48, 55, 65, 128, 84, 48, 48, 55, 128, 84, 48,
+ 48, 54, 128, 84, 48, 48, 53, 128, 84, 48, 48, 52, 128, 84, 48, 48, 51,
+ 65, 128, 84, 48, 48, 51, 128, 84, 48, 48, 50, 128, 84, 48, 48, 49, 128,
+ 84, 45, 83, 72, 73, 82, 84, 128, 83, 90, 90, 128, 83, 90, 87, 71, 128,
+ 83, 90, 87, 65, 128, 83, 90, 85, 128, 83, 90, 79, 128, 83, 90, 73, 128,
+ 83, 90, 69, 69, 128, 83, 90, 69, 128, 83, 90, 65, 65, 128, 83, 90, 65,
+ 128, 83, 90, 128, 83, 89, 88, 128, 83, 89, 84, 128, 83, 89, 82, 88, 128,
+ 83, 89, 82, 77, 65, 84, 73, 75, 73, 128, 83, 89, 82, 77, 65, 128, 83, 89,
+ 82, 73, 78, 71, 69, 128, 83, 89, 82, 128, 83, 89, 80, 128, 83, 89, 79,
+ 85, 87, 65, 128, 83, 89, 78, 69, 86, 77, 65, 128, 83, 89, 78, 68, 69, 83,
+ 77, 79, 211, 83, 89, 78, 67, 72, 82, 79, 78, 79, 85, 211, 83, 89, 78, 65,
+ 71, 77, 193, 83, 89, 78, 65, 70, 73, 128, 83, 89, 77, 77, 69, 84, 82, 89,
+ 128, 83, 89, 77, 77, 69, 84, 82, 73, 195, 83, 89, 77, 66, 79, 76, 83,
+ 128, 83, 89, 77, 66, 79, 76, 45, 57, 128, 83, 89, 77, 66, 79, 76, 45, 56,
+ 128, 83, 89, 77, 66, 79, 76, 45, 55, 128, 83, 89, 77, 66, 79, 76, 45, 54,
+ 128, 83, 89, 77, 66, 79, 76, 45, 53, 52, 128, 83, 89, 77, 66, 79, 76, 45,
+ 53, 51, 128, 83, 89, 77, 66, 79, 76, 45, 53, 50, 128, 83, 89, 77, 66, 79,
+ 76, 45, 53, 49, 128, 83, 89, 77, 66, 79, 76, 45, 53, 48, 128, 83, 89, 77,
+ 66, 79, 76, 45, 53, 128, 83, 89, 77, 66, 79, 76, 45, 52, 57, 128, 83, 89,
+ 77, 66, 79, 76, 45, 52, 56, 128, 83, 89, 77, 66, 79, 76, 45, 52, 55, 128,
+ 83, 89, 77, 66, 79, 76, 45, 52, 53, 128, 83, 89, 77, 66, 79, 76, 45, 52,
+ 51, 128, 83, 89, 77, 66, 79, 76, 45, 52, 50, 128, 83, 89, 77, 66, 79, 76,
+ 45, 52, 48, 128, 83, 89, 77, 66, 79, 76, 45, 52, 128, 83, 89, 77, 66, 79,
+ 76, 45, 51, 57, 128, 83, 89, 77, 66, 79, 76, 45, 51, 56, 128, 83, 89, 77,
+ 66, 79, 76, 45, 51, 55, 128, 83, 89, 77, 66, 79, 76, 45, 51, 54, 128, 83,
+ 89, 77, 66, 79, 76, 45, 51, 50, 128, 83, 89, 77, 66, 79, 76, 45, 51, 48,
+ 128, 83, 89, 77, 66, 79, 76, 45, 51, 128, 83, 89, 77, 66, 79, 76, 45, 50,
+ 57, 128, 83, 89, 77, 66, 79, 76, 45, 50, 55, 128, 83, 89, 77, 66, 79, 76,
+ 45, 50, 54, 128, 83, 89, 77, 66, 79, 76, 45, 50, 53, 128, 83, 89, 77, 66,
+ 79, 76, 45, 50, 52, 128, 83, 89, 77, 66, 79, 76, 45, 50, 51, 128, 83, 89,
+ 77, 66, 79, 76, 45, 50, 50, 128, 83, 89, 77, 66, 79, 76, 45, 50, 49, 128,
+ 83, 89, 77, 66, 79, 76, 45, 50, 48, 128, 83, 89, 77, 66, 79, 76, 45, 50,
+ 128, 83, 89, 77, 66, 79, 76, 45, 49, 57, 128, 83, 89, 77, 66, 79, 76, 45,
+ 49, 56, 128, 83, 89, 77, 66, 79, 76, 45, 49, 55, 128, 83, 89, 77, 66, 79,
+ 76, 45, 49, 54, 128, 83, 89, 77, 66, 79, 76, 45, 49, 53, 128, 83, 89, 77,
+ 66, 79, 76, 45, 49, 52, 128, 83, 89, 77, 66, 79, 76, 45, 49, 51, 128, 83,
+ 89, 77, 66, 79, 76, 45, 49, 50, 128, 83, 89, 77, 66, 79, 76, 45, 49, 49,
+ 128, 83, 89, 77, 66, 79, 76, 45, 49, 48, 128, 83, 89, 77, 66, 79, 76, 45,
+ 49, 128, 83, 89, 76, 79, 84, 201, 83, 89, 65, 128, 83, 89, 128, 83, 87,
+ 90, 128, 83, 87, 85, 78, 199, 83, 87, 79, 82, 68, 83, 128, 83, 87, 79,
+ 82, 68, 128, 83, 87, 79, 79, 128, 83, 87, 79, 128, 83, 87, 73, 82, 204,
+ 83, 87, 73, 77, 77, 73, 78, 71, 128, 83, 87, 73, 77, 77, 69, 82, 128, 83,
+ 87, 73, 73, 128, 83, 87, 73, 128, 83, 87, 71, 128, 83, 87, 69, 69, 84,
+ 128, 83, 87, 69, 69, 212, 83, 87, 69, 65, 84, 128, 83, 87, 69, 65, 212,
+ 83, 87, 65, 83, 200, 83, 87, 65, 80, 80, 73, 78, 71, 128, 83, 87, 65, 65,
+ 128, 83, 87, 128, 83, 86, 65, 83, 84, 201, 83, 86, 65, 82, 73, 84, 65,
+ 128, 83, 86, 65, 82, 73, 84, 193, 83, 85, 88, 128, 83, 85, 85, 128, 83,
+ 85, 84, 128, 83, 85, 83, 80, 69, 78, 83, 73, 79, 206, 83, 85, 83, 72, 73,
+ 128, 83, 85, 82, 88, 128, 83, 85, 82, 82, 79, 85, 78, 68, 128, 83, 85,
+ 82, 82, 79, 85, 78, 196, 83, 85, 82, 70, 69, 82, 128, 83, 85, 82, 70, 65,
+ 67, 197, 83, 85, 82, 69, 128, 83, 85, 82, 65, 78, 71, 128, 83, 85, 82,
+ 57, 128, 83, 85, 82, 128, 83, 85, 210, 83, 85, 80, 82, 65, 76, 73, 78,
+ 69, 65, 210, 83, 85, 80, 69, 82, 86, 73, 83, 69, 128, 83, 85, 80, 69, 82,
+ 83, 69, 84, 128, 83, 85, 80, 69, 82, 83, 69, 212, 83, 85, 80, 69, 82, 83,
+ 67, 82, 73, 80, 212, 83, 85, 80, 69, 82, 73, 77, 80, 79, 83, 69, 196, 83,
+ 85, 80, 69, 82, 70, 73, 88, 69, 196, 83, 85, 80, 69, 210, 83, 85, 80,
+ 128, 83, 85, 79, 88, 128, 83, 85, 79, 80, 128, 83, 85, 79, 128, 83, 85,
+ 78, 83, 69, 212, 83, 85, 78, 82, 73, 83, 69, 128, 83, 85, 78, 82, 73, 83,
+ 197, 83, 85, 78, 71, 76, 65, 83, 83, 69, 83, 128, 83, 85, 78, 71, 128,
+ 83, 85, 78, 70, 76, 79, 87, 69, 82, 128, 83, 85, 78, 68, 65, 78, 69, 83,
+ 197, 83, 85, 78, 128, 83, 85, 206, 83, 85, 77, 77, 69, 82, 128, 83, 85,
+ 77, 77, 65, 84, 73, 79, 78, 128, 83, 85, 77, 77, 65, 84, 73, 79, 206, 83,
+ 85, 77, 65, 83, 72, 128, 83, 85, 77, 128, 83, 85, 76, 70, 85, 82, 128,
+ 83, 85, 75, 85, 78, 128, 83, 85, 75, 85, 206, 83, 85, 75, 85, 128, 83,
+ 85, 75, 213, 83, 85, 73, 84, 65, 66, 76, 69, 128, 83, 85, 73, 84, 128,
+ 83, 85, 72, 85, 82, 128, 83, 85, 69, 128, 83, 85, 68, 50, 128, 83, 85,
+ 68, 128, 83, 85, 67, 67, 69, 69, 68, 83, 128, 83, 85, 67, 67, 69, 69, 68,
+ 211, 83, 85, 67, 67, 69, 69, 68, 128, 83, 85, 67, 67, 69, 69, 196, 83,
+ 85, 66, 85, 78, 73, 84, 128, 83, 85, 66, 83, 84, 73, 84, 85, 84, 73, 79,
+ 206, 83, 85, 66, 83, 84, 73, 84, 85, 84, 69, 128, 83, 85, 66, 83, 84, 73,
+ 84, 85, 84, 197, 83, 85, 66, 83, 69, 84, 128, 83, 85, 66, 83, 69, 212,
+ 83, 85, 66, 83, 67, 82, 73, 80, 212, 83, 85, 66, 80, 85, 78, 67, 84, 73,
+ 83, 128, 83, 85, 66, 76, 73, 78, 69, 65, 210, 83, 85, 66, 76, 73, 77, 65,
+ 84, 73, 79, 78, 128, 83, 85, 66, 76, 73, 77, 65, 84, 69, 45, 51, 128, 83,
+ 85, 66, 76, 73, 77, 65, 84, 69, 45, 50, 128, 83, 85, 66, 76, 73, 77, 65,
+ 84, 69, 128, 83, 85, 66, 76, 73, 77, 65, 84, 197, 83, 85, 66, 74, 79, 73,
+ 78, 69, 196, 83, 85, 66, 74, 69, 67, 84, 128, 83, 85, 66, 73, 84, 79,
+ 128, 83, 85, 66, 71, 82, 79, 85, 80, 128, 83, 85, 66, 71, 82, 79, 85,
+ 208, 83, 85, 65, 69, 84, 128, 83, 85, 65, 69, 78, 128, 83, 85, 65, 69,
+ 128, 83, 85, 65, 128, 83, 213, 83, 84, 87, 65, 128, 83, 84, 85, 68, 89,
+ 128, 83, 84, 85, 67, 75, 45, 79, 85, 212, 83, 84, 82, 79, 75, 69, 83,
+ 128, 83, 84, 82, 79, 75, 69, 211, 83, 84, 82, 79, 75, 69, 45, 57, 128,
+ 83, 84, 82, 79, 75, 69, 45, 56, 128, 83, 84, 82, 79, 75, 69, 45, 55, 128,
+ 83, 84, 82, 79, 75, 69, 45, 54, 128, 83, 84, 82, 79, 75, 69, 45, 53, 128,
+ 83, 84, 82, 79, 75, 69, 45, 52, 128, 83, 84, 82, 79, 75, 69, 45, 51, 128,
+ 83, 84, 82, 79, 75, 69, 45, 50, 128, 83, 84, 82, 79, 75, 69, 45, 49, 49,
+ 128, 83, 84, 82, 79, 75, 69, 45, 49, 48, 128, 83, 84, 82, 79, 75, 69, 45,
+ 49, 128, 83, 84, 82, 79, 75, 197, 83, 84, 82, 73, 80, 69, 128, 83, 84,
+ 82, 73, 75, 69, 84, 72, 82, 79, 85, 71, 72, 128, 83, 84, 82, 73, 68, 69,
+ 128, 83, 84, 82, 73, 67, 84, 76, 217, 83, 84, 82, 69, 84, 67, 72, 69,
+ 196, 83, 84, 82, 69, 83, 211, 83, 84, 82, 69, 78, 71, 84, 72, 128, 83,
+ 84, 82, 69, 65, 77, 69, 82, 128, 83, 84, 82, 65, 87, 66, 69, 82, 82, 89,
+ 128, 83, 84, 82, 65, 84, 85, 77, 45, 50, 128, 83, 84, 82, 65, 84, 85, 77,
+ 128, 83, 84, 82, 65, 84, 85, 205, 83, 84, 82, 65, 84, 73, 65, 206, 83,
+ 84, 82, 65, 73, 78, 69, 82, 128, 83, 84, 82, 65, 73, 71, 72, 84, 78, 69,
+ 83, 83, 128, 83, 84, 82, 65, 73, 71, 72, 212, 83, 84, 82, 65, 73, 70,
+ 128, 83, 84, 82, 65, 71, 71, 73, 83, 77, 65, 84, 65, 128, 83, 84, 79, 86,
+ 69, 128, 83, 84, 79, 82, 69, 128, 83, 84, 79, 80, 87, 65, 84, 67, 72,
+ 128, 83, 84, 79, 80, 80, 73, 78, 71, 128, 83, 84, 79, 80, 80, 65, 71, 69,
+ 128, 83, 84, 79, 80, 128, 83, 84, 79, 208, 83, 84, 79, 78, 69, 128, 83,
+ 84, 79, 67, 75, 128, 83, 84, 73, 77, 77, 69, 128, 83, 84, 73, 76, 204,
+ 83, 84, 73, 76, 197, 83, 84, 73, 71, 77, 65, 128, 83, 84, 69, 80, 128,
+ 83, 84, 69, 77, 128, 83, 84, 69, 205, 83, 84, 69, 65, 77, 73, 78, 199,
+ 83, 84, 69, 65, 77, 128, 83, 84, 69, 65, 205, 83, 84, 65, 86, 82, 79, 85,
+ 128, 83, 84, 65, 86, 82, 79, 83, 128, 83, 84, 65, 86, 82, 79, 211, 83,
+ 84, 65, 85, 82, 79, 83, 128, 83, 84, 65, 84, 85, 197, 83, 84, 65, 84, 73,
+ 79, 78, 128, 83, 84, 65, 84, 69, 82, 83, 128, 83, 84, 65, 82, 212, 83,
+ 84, 65, 82, 83, 128, 83, 84, 65, 82, 82, 69, 196, 83, 84, 65, 82, 75,
+ 128, 83, 84, 65, 82, 128, 83, 84, 65, 210, 83, 84, 65, 78, 68, 83, 84,
+ 73, 76, 76, 128, 83, 84, 65, 78, 68, 65, 82, 196, 83, 84, 65, 78, 68,
+ 128, 83, 84, 65, 78, 128, 83, 84, 65, 76, 76, 73, 79, 78, 128, 83, 84,
+ 65, 70, 70, 128, 83, 84, 65, 70, 198, 83, 84, 65, 67, 67, 65, 84, 79,
+ 128, 83, 84, 65, 67, 67, 65, 84, 73, 83, 83, 73, 77, 79, 128, 83, 84, 50,
+ 128, 83, 83, 89, 88, 128, 83, 83, 89, 84, 128, 83, 83, 89, 82, 88, 128,
+ 83, 83, 89, 82, 128, 83, 83, 89, 80, 128, 83, 83, 89, 128, 83, 83, 85,
+ 88, 128, 83, 83, 85, 84, 128, 83, 83, 85, 80, 128, 83, 83, 79, 88, 128,
+ 83, 83, 79, 84, 128, 83, 83, 79, 80, 128, 83, 83, 79, 128, 83, 83, 73,
+ 88, 128, 83, 83, 73, 84, 128, 83, 83, 73, 80, 128, 83, 83, 73, 69, 88,
+ 128, 83, 83, 73, 69, 80, 128, 83, 83, 73, 69, 128, 83, 83, 73, 128, 83,
+ 83, 72, 69, 128, 83, 83, 69, 88, 128, 83, 83, 69, 80, 128, 83, 83, 69,
+ 69, 128, 83, 83, 65, 88, 128, 83, 83, 65, 84, 128, 83, 83, 65, 80, 128,
+ 83, 83, 65, 78, 71, 89, 69, 79, 82, 73, 78, 72, 73, 69, 85, 72, 128, 83,
+ 83, 65, 78, 71, 84, 73, 75, 69, 85, 84, 45, 80, 73, 69, 85, 80, 128, 83,
+ 83, 65, 78, 71, 84, 73, 75, 69, 85, 84, 128, 83, 83, 65, 78, 71, 84, 72,
+ 73, 69, 85, 84, 72, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 45, 84, 73,
+ 75, 69, 85, 84, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 45, 80, 73, 69,
+ 85, 80, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 45, 75, 73, 89, 69, 79,
+ 75, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 83, 83, 65, 78, 71, 82,
+ 73, 69, 85, 76, 45, 75, 72, 73, 69, 85, 75, 72, 128, 83, 83, 65, 78, 71,
+ 82, 73, 69, 85, 76, 128, 83, 83, 65, 78, 71, 80, 73, 69, 85, 80, 128, 83,
+ 83, 65, 78, 71, 78, 73, 69, 85, 78, 128, 83, 83, 65, 78, 71, 77, 73, 69,
+ 85, 77, 128, 83, 83, 65, 78, 71, 75, 73, 89, 69, 79, 75, 128, 83, 83, 65,
+ 78, 71, 73, 69, 85, 78, 71, 128, 83, 83, 65, 78, 71, 72, 73, 69, 85, 72,
+ 128, 83, 83, 65, 78, 71, 67, 73, 69, 85, 67, 45, 72, 73, 69, 85, 72, 128,
+ 83, 83, 65, 78, 71, 67, 73, 69, 85, 67, 128, 83, 83, 65, 78, 71, 65, 82,
+ 65, 69, 65, 128, 83, 83, 65, 65, 128, 83, 83, 65, 128, 83, 82, 128, 83,
+ 81, 85, 73, 83, 200, 83, 81, 85, 73, 82, 82, 69, 204, 83, 81, 85, 73, 71,
+ 71, 76, 197, 83, 81, 85, 65, 212, 83, 81, 85, 65, 82, 69, 83, 128, 83,
+ 81, 85, 65, 82, 69, 68, 128, 83, 81, 85, 65, 82, 69, 128, 83, 80, 87, 65,
+ 128, 83, 80, 85, 78, 71, 211, 83, 80, 82, 79, 85, 84, 128, 83, 80, 82,
+ 73, 78, 71, 83, 128, 83, 80, 82, 73, 78, 71, 128, 83, 80, 82, 69, 67, 72,
+ 71, 69, 83, 65, 78, 199, 83, 80, 79, 85, 84, 73, 78, 199, 83, 80, 79, 84,
+ 128, 83, 80, 79, 79, 78, 128, 83, 80, 76, 73, 84, 84, 73, 78, 199, 83,
+ 80, 76, 65, 83, 72, 73, 78, 199, 83, 80, 73, 82, 73, 84, 85, 211, 83, 80,
+ 73, 82, 73, 84, 128, 83, 80, 73, 82, 73, 212, 83, 80, 73, 82, 65, 78, 84,
+ 128, 83, 80, 73, 82, 65, 76, 128, 83, 80, 73, 82, 65, 204, 83, 80, 73,
+ 68, 69, 82, 217, 83, 80, 73, 67, 69, 128, 83, 80, 72, 69, 82, 73, 67, 65,
+ 204, 83, 80, 69, 83, 77, 73, 76, 207, 83, 80, 69, 69, 68, 66, 79, 65, 84,
+ 128, 83, 80, 69, 69, 67, 72, 128, 83, 80, 69, 69, 67, 200, 83, 80, 69,
+ 67, 73, 65, 76, 128, 83, 80, 69, 65, 82, 128, 83, 80, 69, 65, 75, 69, 82,
+ 128, 83, 80, 69, 65, 75, 69, 210, 83, 80, 69, 65, 75, 45, 78, 79, 45, 69,
+ 86, 73, 204, 83, 80, 65, 84, 72, 73, 128, 83, 80, 65, 82, 75, 76, 73, 78,
+ 199, 83, 80, 65, 82, 75, 76, 69, 83, 128, 83, 80, 65, 82, 75, 76, 69, 82,
+ 128, 83, 80, 65, 82, 75, 76, 69, 128, 83, 80, 65, 71, 72, 69, 84, 84, 73,
+ 128, 83, 80, 65, 68, 69, 83, 128, 83, 80, 65, 68, 197, 83, 80, 65, 67,
+ 73, 78, 199, 83, 80, 65, 67, 197, 83, 80, 128, 83, 79, 89, 128, 83, 79,
+ 87, 73, 76, 207, 83, 79, 87, 128, 83, 79, 85, 84, 72, 69, 82, 206, 83,
+ 79, 85, 84, 72, 45, 83, 76, 65, 86, 69, 217, 83, 79, 85, 84, 200, 83, 79,
+ 85, 82, 67, 69, 128, 83, 79, 85, 78, 68, 128, 83, 79, 85, 78, 196, 83,
+ 79, 85, 78, 65, 80, 128, 83, 79, 85, 128, 83, 79, 83, 128, 83, 79, 81,
+ 128, 83, 79, 79, 206, 83, 79, 79, 128, 83, 79, 78, 74, 65, 77, 128, 83,
+ 79, 78, 71, 128, 83, 79, 78, 128, 83, 79, 77, 128, 83, 79, 76, 73, 68,
+ 85, 83, 128, 83, 79, 76, 73, 68, 85, 211, 83, 79, 71, 68, 73, 65, 206,
+ 83, 79, 70, 84, 87, 65, 82, 69, 45, 70, 85, 78, 67, 84, 73, 79, 206, 83,
+ 79, 70, 84, 78, 69, 83, 83, 128, 83, 79, 70, 212, 83, 79, 198, 83, 79,
+ 67, 73, 69, 84, 89, 128, 83, 79, 67, 67, 69, 210, 83, 79, 65, 80, 128,
83, 79, 65, 128, 83, 207, 83, 78, 79, 87, 77, 65, 78, 128, 83, 78, 79,
- 87, 70, 76, 65, 75, 69, 128, 83, 78, 79, 85, 84, 128, 83, 78, 79, 85,
- 212, 83, 78, 65, 208, 83, 78, 65, 75, 69, 128, 83, 78, 65, 75, 197, 83,
- 78, 193, 83, 77, 73, 76, 73, 78, 199, 83, 77, 73, 76, 69, 128, 83, 77,
- 69, 65, 82, 128, 83, 77, 65, 83, 200, 83, 77, 65, 76, 76, 69, 210, 83,
- 77, 65, 76, 76, 128, 83, 76, 85, 82, 128, 83, 76, 79, 87, 76, 89, 128,
- 83, 76, 79, 86, 79, 128, 83, 76, 79, 80, 73, 78, 199, 83, 76, 79, 80, 69,
- 128, 83, 76, 73, 78, 71, 128, 83, 76, 73, 67, 69, 128, 83, 76, 65, 86,
- 79, 78, 73, 195, 83, 76, 65, 86, 69, 128, 83, 76, 65, 83, 72, 128, 83,
- 76, 65, 83, 200, 83, 76, 65, 78, 84, 69, 196, 83, 75, 87, 65, 128, 83,
- 75, 87, 128, 83, 75, 85, 76, 204, 83, 75, 76, 73, 82, 79, 206, 83, 75,
- 73, 78, 128, 83, 75, 69, 87, 69, 196, 83, 75, 128, 83, 74, 69, 128, 83,
- 73, 88, 84, 89, 45, 70, 79, 85, 82, 84, 200, 83, 73, 88, 84, 89, 128, 83,
- 73, 88, 84, 217, 83, 73, 88, 84, 72, 83, 128, 83, 73, 88, 84, 72, 211,
- 83, 73, 88, 84, 72, 128, 83, 73, 88, 84, 69, 69, 78, 84, 200, 83, 73, 88,
- 84, 69, 69, 78, 128, 83, 73, 88, 84, 69, 69, 206, 83, 73, 88, 45, 83, 84,
- 82, 73, 78, 199, 83, 73, 88, 45, 80, 69, 82, 45, 69, 205, 83, 73, 88, 45,
- 76, 73, 78, 197, 83, 73, 216, 83, 73, 82, 73, 78, 71, 85, 128, 83, 73,
- 79, 83, 45, 84, 73, 75, 69, 85, 84, 128, 83, 73, 79, 83, 45, 84, 72, 73,
- 69, 85, 84, 72, 128, 83, 73, 79, 83, 45, 83, 83, 65, 78, 71, 83, 73, 79,
- 83, 128, 83, 73, 79, 83, 45, 82, 73, 69, 85, 76, 128, 83, 73, 79, 83, 45,
- 80, 73, 69, 85, 80, 45, 75, 73, 89, 69, 79, 75, 128, 83, 73, 79, 83, 45,
- 80, 73, 69, 85, 80, 128, 83, 73, 79, 83, 45, 80, 72, 73, 69, 85, 80, 72,
- 128, 83, 73, 79, 83, 45, 78, 73, 69, 85, 78, 128, 83, 73, 79, 83, 45, 77,
- 73, 69, 85, 77, 128, 83, 73, 79, 83, 45, 75, 73, 89, 69, 79, 75, 128, 83,
- 73, 79, 83, 45, 75, 72, 73, 69, 85, 75, 72, 128, 83, 73, 79, 83, 45, 73,
- 69, 85, 78, 71, 128, 83, 73, 79, 83, 45, 72, 73, 69, 85, 72, 128, 83, 73,
- 79, 83, 45, 67, 73, 69, 85, 67, 128, 83, 73, 79, 83, 45, 67, 72, 73, 69,
- 85, 67, 72, 128, 83, 73, 79, 211, 83, 73, 78, 75, 73, 78, 71, 128, 83,
- 73, 78, 71, 76, 69, 45, 76, 73, 78, 197, 83, 73, 78, 71, 76, 69, 128, 83,
- 73, 78, 71, 76, 197, 83, 73, 78, 197, 83, 73, 78, 68, 72, 201, 83, 73,
- 206, 83, 73, 77, 80, 76, 73, 70, 73, 69, 196, 83, 73, 77, 73, 76, 65, 82,
- 128, 83, 73, 77, 73, 76, 65, 210, 83, 73, 77, 65, 78, 83, 73, 211, 83,
- 73, 77, 65, 128, 83, 73, 76, 75, 128, 83, 73, 76, 73, 81, 85, 193, 83,
- 73, 76, 65, 51, 128, 83, 73, 75, 73, 128, 83, 73, 75, 50, 128, 83, 73,
- 75, 178, 83, 73, 73, 128, 83, 73, 71, 78, 83, 128, 83, 73, 71, 77, 65,
- 128, 83, 73, 71, 77, 193, 83, 73, 71, 69, 204, 83, 73, 71, 52, 128, 83,
- 73, 71, 180, 83, 73, 71, 128, 83, 73, 68, 69, 87, 65, 89, 211, 83, 73,
+ 87, 77, 65, 206, 83, 78, 79, 87, 70, 76, 65, 75, 69, 128, 83, 78, 79, 87,
+ 66, 79, 65, 82, 68, 69, 82, 128, 83, 78, 79, 87, 128, 83, 78, 79, 85, 84,
+ 128, 83, 78, 79, 85, 212, 83, 78, 65, 208, 83, 78, 65, 75, 69, 128, 83,
+ 78, 65, 75, 197, 83, 78, 65, 73, 76, 128, 83, 78, 193, 83, 77, 79, 75,
+ 73, 78, 199, 83, 77, 73, 82, 75, 73, 78, 199, 83, 77, 73, 76, 73, 78,
+ 199, 83, 77, 73, 76, 69, 128, 83, 77, 69, 65, 82, 128, 83, 77, 65, 83,
+ 200, 83, 77, 65, 76, 76, 69, 210, 83, 77, 65, 76, 76, 128, 83, 76, 85,
+ 82, 128, 83, 76, 79, 87, 76, 89, 128, 83, 76, 79, 215, 83, 76, 79, 86,
+ 79, 128, 83, 76, 79, 212, 83, 76, 79, 80, 73, 78, 199, 83, 76, 79, 80,
+ 69, 128, 83, 76, 73, 78, 71, 128, 83, 76, 73, 68, 73, 78, 71, 128, 83,
+ 76, 73, 67, 69, 128, 83, 76, 73, 67, 197, 83, 76, 69, 69, 80, 217, 83,
+ 76, 69, 69, 80, 73, 78, 199, 83, 76, 65, 86, 79, 78, 73, 195, 83, 76, 65,
+ 86, 69, 128, 83, 76, 65, 83, 72, 128, 83, 76, 65, 83, 200, 83, 76, 65,
+ 78, 84, 69, 196, 83, 75, 87, 65, 128, 83, 75, 87, 128, 83, 75, 85, 76,
+ 76, 128, 83, 75, 85, 76, 204, 83, 75, 76, 73, 82, 79, 206, 83, 75, 73,
+ 78, 128, 83, 75, 73, 69, 82, 128, 83, 75, 201, 83, 75, 69, 87, 69, 196,
+ 83, 75, 65, 84, 69, 128, 83, 75, 128, 83, 74, 69, 128, 83, 73, 88, 84,
+ 89, 45, 70, 79, 85, 82, 84, 200, 83, 73, 88, 84, 89, 128, 83, 73, 88, 84,
+ 217, 83, 73, 88, 84, 72, 83, 128, 83, 73, 88, 84, 72, 211, 83, 73, 88,
+ 84, 72, 128, 83, 73, 88, 84, 69, 69, 78, 84, 72, 83, 128, 83, 73, 88, 84,
+ 69, 69, 78, 84, 72, 128, 83, 73, 88, 84, 69, 69, 78, 84, 200, 83, 73, 88,
+ 84, 69, 69, 78, 128, 83, 73, 88, 84, 69, 69, 206, 83, 73, 88, 45, 84, 72,
+ 73, 82, 84, 89, 128, 83, 73, 88, 45, 83, 84, 82, 73, 78, 199, 83, 73, 88,
+ 45, 80, 69, 82, 45, 69, 205, 83, 73, 88, 45, 76, 73, 78, 197, 83, 73,
+ 216, 83, 73, 84, 69, 128, 83, 73, 83, 65, 128, 83, 73, 82, 73, 78, 71,
+ 85, 128, 83, 73, 79, 83, 45, 84, 72, 73, 69, 85, 84, 72, 128, 83, 73, 79,
+ 83, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 83, 73, 79, 83, 45, 82,
+ 73, 69, 85, 76, 128, 83, 73, 79, 83, 45, 80, 73, 69, 85, 80, 45, 75, 73,
+ 89, 69, 79, 75, 128, 83, 73, 79, 83, 45, 80, 72, 73, 69, 85, 80, 72, 128,
+ 83, 73, 79, 83, 45, 80, 65, 78, 83, 73, 79, 83, 128, 83, 73, 79, 83, 45,
+ 78, 73, 69, 85, 78, 128, 83, 73, 79, 83, 45, 77, 73, 69, 85, 77, 128, 83,
+ 73, 79, 83, 45, 75, 72, 73, 69, 85, 75, 72, 128, 83, 73, 79, 83, 45, 75,
+ 65, 80, 89, 69, 79, 85, 78, 80, 73, 69, 85, 80, 128, 83, 73, 79, 83, 45,
+ 73, 69, 85, 78, 71, 128, 83, 73, 79, 83, 45, 72, 73, 69, 85, 72, 128, 83,
+ 73, 79, 83, 45, 67, 73, 69, 85, 67, 128, 83, 73, 79, 83, 45, 67, 72, 73,
+ 69, 85, 67, 72, 128, 83, 73, 79, 211, 83, 73, 78, 75, 73, 78, 71, 128,
+ 83, 73, 78, 71, 76, 69, 45, 76, 73, 78, 197, 83, 73, 78, 71, 76, 69, 128,
+ 83, 73, 78, 71, 76, 197, 83, 73, 78, 71, 65, 65, 84, 128, 83, 73, 78,
+ 197, 83, 73, 78, 68, 72, 201, 83, 73, 206, 83, 73, 77, 80, 76, 73, 70,
+ 73, 69, 196, 83, 73, 77, 73, 76, 65, 82, 128, 83, 73, 77, 73, 76, 65,
+ 210, 83, 73, 77, 65, 78, 83, 73, 211, 83, 73, 77, 65, 76, 85, 78, 71, 85,
+ 206, 83, 73, 77, 65, 128, 83, 73, 76, 86, 69, 82, 128, 83, 73, 76, 75,
+ 128, 83, 73, 76, 73, 81, 85, 193, 83, 73, 76, 72, 79, 85, 69, 84, 84, 69,
+ 128, 83, 73, 76, 72, 79, 85, 69, 84, 84, 197, 83, 73, 76, 65, 51, 128,
+ 83, 73, 75, 73, 128, 83, 73, 75, 50, 128, 83, 73, 75, 178, 83, 73, 73,
+ 128, 83, 73, 71, 78, 83, 128, 83, 73, 71, 77, 65, 128, 83, 73, 71, 77,
+ 193, 83, 73, 71, 69, 204, 83, 73, 71, 52, 128, 83, 73, 71, 180, 83, 73,
+ 71, 128, 83, 73, 69, 69, 128, 83, 73, 68, 69, 87, 65, 89, 211, 83, 73,
67, 75, 78, 69, 83, 83, 128, 83, 73, 67, 75, 76, 69, 128, 83, 73, 66,
197, 83, 201, 83, 72, 89, 88, 128, 83, 72, 89, 84, 128, 83, 72, 89, 82,
- 88, 128, 83, 72, 89, 82, 128, 83, 72, 89, 80, 128, 83, 72, 89, 65, 128,
- 83, 72, 89, 128, 83, 72, 87, 79, 79, 128, 83, 72, 87, 79, 128, 83, 72,
- 87, 73, 73, 128, 83, 72, 87, 73, 128, 83, 72, 87, 69, 128, 83, 72, 87,
- 65, 65, 128, 83, 72, 87, 65, 128, 83, 72, 85, 88, 128, 83, 72, 85, 84,
- 128, 83, 72, 85, 82, 88, 128, 83, 72, 85, 82, 128, 83, 72, 85, 80, 128,
- 83, 72, 85, 79, 88, 128, 83, 72, 85, 79, 80, 128, 83, 72, 85, 79, 128,
- 83, 72, 85, 70, 70, 76, 197, 83, 72, 85, 66, 85, 82, 128, 83, 72, 85, 50,
- 128, 83, 72, 85, 178, 83, 72, 85, 128, 83, 72, 213, 83, 72, 84, 65, 80,
- 73, 67, 128, 83, 72, 84, 65, 128, 83, 72, 79, 88, 128, 83, 72, 79, 85,
- 76, 68, 69, 82, 69, 196, 83, 72, 79, 84, 128, 83, 72, 79, 82, 84, 83,
- 128, 83, 72, 79, 82, 84, 211, 83, 72, 79, 82, 84, 69, 78, 69, 82, 128,
- 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 89, 82, 128, 83, 72, 79, 82,
- 84, 45, 84, 87, 73, 71, 45, 84, 89, 210, 83, 72, 79, 82, 84, 45, 84, 87,
- 73, 71, 45, 83, 79, 204, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 79,
- 83, 211, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 78, 65, 85, 196, 83,
- 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 77, 65, 68, 210, 83, 72, 79, 82,
- 84, 45, 84, 87, 73, 71, 45, 72, 65, 71, 65, 76, 204, 83, 72, 79, 82, 84,
- 45, 84, 87, 73, 71, 45, 66, 74, 65, 82, 75, 65, 206, 83, 72, 79, 82, 84,
- 45, 84, 87, 73, 71, 45, 65, 210, 83, 72, 79, 82, 84, 128, 83, 72, 79, 82,
- 212, 83, 72, 79, 80, 128, 83, 72, 79, 79, 84, 128, 83, 72, 79, 79, 128,
- 83, 72, 79, 71, 201, 83, 72, 79, 199, 83, 72, 79, 197, 83, 72, 79, 65,
- 128, 83, 72, 79, 128, 83, 72, 73, 84, 65, 128, 83, 72, 73, 84, 193, 83,
- 72, 73, 82, 128, 83, 72, 73, 210, 83, 72, 73, 80, 128, 83, 72, 73, 78,
- 73, 71, 128, 83, 72, 73, 78, 128, 83, 72, 73, 206, 83, 72, 73, 77, 65,
- 128, 83, 72, 73, 77, 193, 83, 72, 73, 77, 128, 83, 72, 73, 205, 83, 72,
- 73, 73, 78, 128, 83, 72, 73, 73, 128, 83, 72, 73, 70, 212, 83, 72, 73,
- 69, 76, 68, 128, 83, 72, 73, 68, 128, 83, 72, 73, 196, 83, 72, 73, 128,
- 83, 72, 72, 65, 128, 83, 72, 69, 88, 128, 83, 72, 69, 86, 65, 128, 83,
- 72, 69, 84, 128, 83, 72, 69, 83, 72, 76, 65, 77, 128, 83, 72, 69, 83, 72,
- 73, 71, 128, 83, 72, 69, 83, 72, 73, 199, 83, 72, 69, 83, 72, 50, 128,
- 83, 72, 69, 83, 72, 128, 83, 72, 69, 81, 69, 204, 83, 72, 69, 80, 128,
- 83, 72, 69, 78, 128, 83, 72, 69, 76, 76, 128, 83, 72, 69, 76, 204, 83,
- 72, 69, 76, 70, 128, 83, 72, 69, 73, 128, 83, 72, 69, 71, 57, 128, 83,
- 72, 69, 69, 80, 128, 83, 72, 69, 69, 78, 85, 128, 83, 72, 69, 69, 78,
+ 88, 128, 83, 72, 89, 82, 128, 83, 72, 89, 80, 128, 83, 72, 89, 69, 128,
+ 83, 72, 89, 65, 128, 83, 72, 89, 128, 83, 72, 87, 79, 89, 128, 83, 72,
+ 87, 79, 79, 128, 83, 72, 87, 79, 128, 83, 72, 87, 73, 73, 128, 83, 72,
+ 87, 73, 128, 83, 72, 87, 69, 128, 83, 72, 87, 65, 65, 128, 83, 72, 87,
+ 65, 128, 83, 72, 85, 88, 128, 83, 72, 85, 84, 128, 83, 72, 85, 82, 88,
+ 128, 83, 72, 85, 82, 128, 83, 72, 85, 80, 128, 83, 72, 85, 79, 88, 128,
+ 83, 72, 85, 79, 80, 128, 83, 72, 85, 79, 128, 83, 72, 85, 77, 128, 83,
+ 72, 85, 70, 70, 76, 197, 83, 72, 85, 69, 81, 128, 83, 72, 85, 69, 78, 83,
+ 72, 85, 69, 84, 128, 83, 72, 85, 66, 85, 82, 128, 83, 72, 85, 50, 128,
+ 83, 72, 85, 178, 83, 72, 85, 128, 83, 72, 213, 83, 72, 84, 65, 80, 73,
+ 67, 128, 83, 72, 84, 65, 128, 83, 72, 82, 73, 78, 69, 128, 83, 72, 82,
+ 73, 77, 80, 128, 83, 72, 79, 89, 128, 83, 72, 79, 88, 128, 83, 72, 79,
+ 87, 69, 82, 128, 83, 72, 79, 85, 76, 68, 69, 82, 69, 196, 83, 72, 79, 84,
+ 128, 83, 72, 79, 82, 84, 83, 128, 83, 72, 79, 82, 84, 211, 83, 72, 79,
+ 82, 84, 69, 78, 69, 82, 128, 83, 72, 79, 82, 84, 67, 65, 75, 69, 128, 83,
+ 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 89, 82, 128, 83, 72, 79, 82, 84,
+ 45, 84, 87, 73, 71, 45, 84, 89, 210, 83, 72, 79, 82, 84, 45, 84, 87, 73,
+ 71, 45, 83, 79, 204, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 79, 83,
+ 211, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 78, 65, 85, 196, 83, 72,
+ 79, 82, 84, 45, 84, 87, 73, 71, 45, 77, 65, 68, 210, 83, 72, 79, 82, 84,
+ 45, 84, 87, 73, 71, 45, 72, 65, 71, 65, 76, 204, 83, 72, 79, 82, 84, 45,
+ 84, 87, 73, 71, 45, 66, 74, 65, 82, 75, 65, 206, 83, 72, 79, 82, 84, 45,
+ 84, 87, 73, 71, 45, 65, 210, 83, 72, 79, 82, 84, 128, 83, 72, 79, 82,
+ 212, 83, 72, 79, 81, 128, 83, 72, 79, 209, 83, 72, 79, 80, 128, 83, 72,
+ 79, 79, 84, 73, 78, 199, 83, 72, 79, 79, 84, 128, 83, 72, 79, 79, 128,
+ 83, 72, 79, 71, 201, 83, 72, 79, 199, 83, 72, 79, 69, 128, 83, 72, 79,
+ 197, 83, 72, 79, 65, 128, 83, 72, 79, 128, 83, 72, 73, 89, 89, 65, 65,
+ 76, 65, 65, 128, 83, 72, 73, 84, 65, 128, 83, 72, 73, 84, 193, 83, 72,
+ 73, 82, 212, 83, 72, 73, 82, 65, 69, 128, 83, 72, 73, 82, 128, 83, 72,
+ 73, 210, 83, 72, 73, 81, 128, 83, 72, 73, 80, 128, 83, 72, 73, 78, 84,
+ 207, 83, 72, 73, 78, 73, 71, 128, 83, 72, 73, 78, 68, 193, 83, 72, 73,
+ 78, 128, 83, 72, 73, 206, 83, 72, 73, 77, 65, 128, 83, 72, 73, 77, 193,
+ 83, 72, 73, 77, 128, 83, 72, 73, 205, 83, 72, 73, 73, 78, 128, 83, 72,
+ 73, 73, 128, 83, 72, 73, 70, 212, 83, 72, 73, 69, 76, 68, 128, 83, 72,
+ 73, 68, 128, 83, 72, 73, 196, 83, 72, 72, 65, 128, 83, 72, 72, 193, 83,
+ 72, 69, 88, 128, 83, 72, 69, 86, 65, 128, 83, 72, 69, 85, 88, 128, 83,
+ 72, 69, 85, 79, 81, 128, 83, 72, 69, 85, 65, 69, 81, 84, 85, 128, 83, 72,
+ 69, 85, 65, 69, 81, 128, 83, 72, 69, 85, 65, 69, 128, 83, 72, 69, 84,
+ 128, 83, 72, 69, 212, 83, 72, 69, 83, 72, 76, 65, 77, 128, 83, 72, 69,
+ 83, 72, 73, 71, 128, 83, 72, 69, 83, 72, 73, 199, 83, 72, 69, 83, 72, 50,
+ 128, 83, 72, 69, 83, 72, 128, 83, 72, 69, 81, 69, 204, 83, 72, 69, 80,
+ 128, 83, 72, 69, 78, 128, 83, 72, 69, 76, 76, 128, 83, 72, 69, 76, 204,
+ 83, 72, 69, 76, 70, 128, 83, 72, 69, 73, 128, 83, 72, 69, 71, 57, 128,
+ 83, 72, 69, 69, 80, 128, 83, 72, 69, 69, 78, 85, 128, 83, 72, 69, 69, 78,
128, 83, 72, 69, 69, 206, 83, 72, 69, 69, 128, 83, 72, 69, 45, 71, 79,
- 65, 84, 128, 83, 72, 197, 83, 72, 67, 72, 65, 128, 83, 72, 65, 88, 128,
- 83, 72, 65, 86, 73, 89, 65, 78, 73, 128, 83, 72, 65, 86, 73, 65, 206, 83,
- 72, 65, 84, 128, 83, 72, 65, 82, 85, 128, 83, 72, 65, 82, 213, 83, 72,
- 65, 82, 80, 128, 83, 72, 65, 82, 208, 83, 72, 65, 82, 50, 128, 83, 72,
+ 65, 84, 128, 83, 72, 197, 83, 72, 67, 72, 65, 128, 83, 72, 65, 89, 128,
+ 83, 72, 65, 88, 128, 83, 72, 65, 86, 73, 89, 65, 78, 73, 128, 83, 72, 65,
+ 86, 73, 65, 206, 83, 72, 65, 86, 69, 196, 83, 72, 65, 84, 128, 83, 72,
+ 65, 82, 85, 128, 83, 72, 65, 82, 213, 83, 72, 65, 82, 80, 128, 83, 72,
+ 65, 82, 208, 83, 72, 65, 82, 65, 128, 83, 72, 65, 82, 50, 128, 83, 72,
65, 82, 178, 83, 72, 65, 80, 73, 78, 71, 128, 83, 72, 65, 80, 69, 83,
- 128, 83, 72, 65, 80, 128, 83, 72, 65, 78, 71, 128, 83, 72, 65, 206, 83,
- 72, 65, 77, 82, 79, 67, 75, 128, 83, 72, 65, 76, 83, 72, 69, 76, 69, 84,
- 128, 83, 72, 65, 75, 84, 73, 128, 83, 72, 65, 68, 79, 87, 69, 196, 83,
- 72, 65, 68, 69, 128, 83, 72, 65, 68, 68, 65, 128, 83, 72, 65, 68, 68,
- 193, 83, 72, 65, 68, 128, 83, 72, 65, 196, 83, 72, 65, 66, 54, 128, 83,
- 72, 65, 65, 128, 83, 72, 65, 54, 128, 83, 72, 65, 51, 128, 83, 72, 65,
- 179, 83, 71, 82, 193, 83, 71, 79, 210, 83, 71, 65, 215, 83, 71, 65, 194,
- 83, 71, 128, 83, 69, 88, 84, 85, 76, 193, 83, 69, 88, 84, 73, 76, 69,
- 128, 83, 69, 88, 84, 65, 78, 211, 83, 69, 86, 69, 82, 65, 78, 67, 69,
- 128, 83, 69, 86, 69, 78, 84, 89, 128, 83, 69, 86, 69, 78, 84, 217, 83,
+ 128, 83, 72, 65, 80, 197, 83, 72, 65, 80, 128, 83, 72, 65, 78, 71, 128,
+ 83, 72, 65, 78, 128, 83, 72, 65, 206, 83, 72, 65, 77, 82, 79, 67, 75,
+ 128, 83, 72, 65, 76, 83, 72, 69, 76, 69, 84, 128, 83, 72, 65, 75, 84, 73,
+ 128, 83, 72, 65, 68, 79, 87, 69, 196, 83, 72, 65, 68, 69, 128, 83, 72,
+ 65, 68, 68, 65, 128, 83, 72, 65, 68, 68, 193, 83, 72, 65, 68, 128, 83,
+ 72, 65, 196, 83, 72, 65, 66, 54, 128, 83, 72, 65, 65, 128, 83, 72, 65,
+ 54, 128, 83, 72, 65, 51, 128, 83, 72, 65, 179, 83, 71, 82, 193, 83, 71,
+ 79, 210, 83, 71, 65, 215, 83, 71, 65, 194, 83, 71, 128, 83, 69, 88, 84,
+ 85, 76, 193, 83, 69, 88, 84, 73, 76, 69, 128, 83, 69, 88, 84, 65, 78,
+ 211, 83, 69, 86, 69, 82, 65, 78, 67, 69, 128, 83, 69, 86, 69, 78, 84, 89,
+ 128, 83, 69, 86, 69, 78, 84, 217, 83, 69, 86, 69, 78, 84, 72, 128, 83,
69, 86, 69, 78, 84, 69, 69, 78, 128, 83, 69, 86, 69, 78, 84, 69, 69, 206,
- 83, 69, 86, 69, 206, 83, 69, 83, 84, 69, 82, 84, 73, 85, 211, 83, 69, 83,
- 81, 85, 73, 81, 85, 65, 68, 82, 65, 84, 69, 128, 83, 69, 83, 65, 77, 197,
- 83, 69, 82, 86, 73, 67, 197, 83, 69, 82, 73, 70, 83, 128, 83, 69, 82, 73,
- 70, 211, 83, 69, 80, 84, 69, 77, 66, 69, 82, 128, 83, 69, 80, 65, 82, 65,
- 84, 79, 82, 128, 83, 69, 80, 65, 82, 65, 84, 79, 210, 83, 69, 78, 84, 79,
- 128, 83, 69, 78, 84, 73, 128, 83, 69, 77, 85, 78, 67, 73, 193, 83, 69,
- 77, 75, 65, 84, 72, 128, 83, 69, 77, 75, 128, 83, 69, 77, 73, 86, 79, 87,
- 69, 204, 83, 69, 77, 73, 83, 79, 70, 212, 83, 69, 77, 73, 83, 69, 88, 84,
- 73, 76, 69, 128, 83, 69, 77, 73, 77, 73, 78, 73, 77, 193, 83, 69, 77, 73,
- 68, 73, 82, 69, 67, 212, 83, 69, 77, 73, 67, 79, 76, 79, 78, 128, 83, 69,
- 77, 73, 67, 79, 76, 79, 206, 83, 69, 77, 73, 67, 73, 82, 67, 85, 76, 65,
- 210, 83, 69, 77, 73, 67, 73, 82, 67, 76, 197, 83, 69, 77, 73, 66, 82, 69,
- 86, 73, 211, 83, 69, 77, 73, 45, 86, 79, 73, 67, 69, 196, 83, 69, 76, 70,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 57, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 57, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 55,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 54, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 57, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 52,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 51, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 57, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 49,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 48, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 57, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 56, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 56, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 54, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 53, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 56, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 51, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 50, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 56, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 48, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 55, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 56, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 55, 55, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 55, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 53, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 55, 52, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 55, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 50, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 55, 49, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 55, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 54, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 54, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 55, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 54, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 54, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 52, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 54, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 54, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 49, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 54, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 57, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 53, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 53, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 54, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 53, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 53, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 51, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 53, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 53, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 48, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52,
- 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 56, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 52, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52,
- 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 53, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 52, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52,
- 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 50, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 52, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52,
- 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 51, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 56,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 55, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 51, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 53,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 52, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 51, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 50,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 49, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 51, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 57, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 50, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 55, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 54, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 50, 53, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53,
- 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 52, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 50, 53, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 50, 53, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 49, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 48, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 50, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52,
- 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 56, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 50, 52, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 50, 52, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 53, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 52, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 50, 52, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50,
- 52, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 49, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 50, 52, 48, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 50, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 57, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 56, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 50, 51, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50,
- 51, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 53, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 50, 51, 52, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 50, 51, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 50,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 49, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 50, 51, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 50, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 57, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 50, 50, 56, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 50, 50, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 54,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 53, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 50, 50, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 50, 50, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 50, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 49, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 50, 50, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 57, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 50, 49, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 50, 49, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 54, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 53, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 50, 49, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49,
- 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 50, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 50, 49, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 50, 49, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 57, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 50, 48, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48,
- 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 54, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 50, 48, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 50, 48, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 51, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 50, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 50, 48, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50,
- 48, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
- 57, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 56, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 49, 57, 55, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 49, 57, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 53,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 52, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 49, 57, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 49, 57, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 49, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 48, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 49, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 57,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 56, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 49, 56, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 49, 56, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 53, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 52, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 49, 56, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56,
- 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 49, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 49, 56, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 49, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 57, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 56, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 49, 55, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55,
- 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 53, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 49, 55, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 49, 55, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 50, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 49, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 49, 55, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
- 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 57, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 49, 54, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 49, 54, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 54, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 53, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 49, 54, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
- 54, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 50, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 49, 54, 49, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 49, 54, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 57, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 49, 53, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
- 53, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 54, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 49, 53, 53, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 49, 53, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 51,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 50, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 49, 53, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 49, 53, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 49, 52, 57, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 49, 52, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 55,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 54, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 49, 52, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 49, 52, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 51, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 50, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 49, 52, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52,
- 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 49, 51, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 49, 51, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 55, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 54, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 49, 51, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51,
- 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 51, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 49, 51, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 49, 51, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 48, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 49, 50, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50,
- 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 55, 128, 83, 69, 76,
- 69, 67, 84, 79, 82, 45, 49, 50, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 49, 50, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 52, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 51, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 49, 50, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
- 50, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 48, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 49, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82,
- 45, 49, 49, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 56, 128,
- 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 55, 128, 83, 69, 76, 69, 67,
- 84, 79, 82, 45, 49, 49, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
- 49, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 52, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 49, 49, 51, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 49, 49, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 49,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 48, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 49, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
- 48, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 56, 128, 83, 69,
- 76, 69, 67, 84, 79, 82, 45, 49, 48, 55, 128, 83, 69, 76, 69, 67, 84, 79,
- 82, 45, 49, 48, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 53,
- 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 52, 128, 83, 69, 76, 69,
- 67, 84, 79, 82, 45, 49, 48, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
- 49, 48, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 49, 128, 83,
- 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 48, 128, 83, 69, 76, 69, 67, 84,
- 79, 82, 45, 49, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 128, 83,
- 69, 76, 69, 67, 84, 79, 210, 83, 69, 73, 83, 77, 65, 128, 83, 69, 73, 83,
- 77, 193, 83, 69, 72, 128, 83, 69, 71, 79, 76, 128, 83, 69, 71, 78, 79,
- 128, 83, 69, 71, 77, 69, 78, 84, 128, 83, 69, 69, 78, 85, 128, 83, 69,
- 69, 78, 128, 83, 69, 69, 206, 83, 69, 67, 84, 79, 82, 128, 83, 69, 67,
- 84, 73, 79, 78, 128, 83, 69, 67, 84, 73, 79, 206, 83, 69, 67, 82, 69, 84,
- 128, 83, 69, 67, 79, 78, 68, 128, 83, 69, 66, 65, 84, 66, 69, 73, 212,
- 83, 69, 65, 76, 128, 83, 69, 65, 71, 85, 76, 204, 83, 68, 79, 78, 199,
- 83, 67, 87, 65, 128, 83, 67, 82, 85, 80, 76, 69, 128, 83, 67, 82, 73, 80,
- 84, 128, 83, 67, 82, 69, 69, 78, 128, 83, 67, 82, 69, 69, 206, 83, 67,
- 79, 82, 80, 73, 85, 83, 128, 83, 67, 73, 83, 83, 79, 82, 83, 128, 83, 67,
- 72, 87, 65, 128, 83, 67, 72, 87, 193, 83, 67, 72, 79, 76, 65, 82, 128,
- 83, 67, 72, 69, 77, 193, 83, 67, 65, 78, 68, 73, 67, 85, 83, 128, 83, 67,
- 65, 78, 68, 73, 67, 85, 211, 83, 67, 65, 206, 83, 67, 65, 76, 69, 83,
- 128, 83, 66, 85, 194, 83, 66, 82, 85, 204, 83, 65, 89, 73, 83, 201, 83,
- 65, 89, 65, 78, 78, 65, 128, 83, 65, 89, 128, 83, 65, 88, 73, 77, 65, 84,
- 65, 128, 83, 65, 87, 128, 83, 65, 85, 73, 76, 128, 83, 65, 84, 85, 82,
- 78, 128, 83, 65, 83, 65, 75, 128, 83, 65, 82, 73, 128, 83, 65, 82, 193,
- 83, 65, 82, 128, 83, 65, 80, 65, 128, 83, 65, 78, 89, 79, 79, 71, 193,
- 83, 65, 78, 89, 65, 75, 193, 83, 65, 78, 84, 73, 73, 77, 85, 128, 83, 65,
- 78, 78, 89, 65, 128, 83, 65, 78, 71, 65, 50, 128, 83, 65, 78, 65, 72,
- 128, 83, 65, 78, 128, 83, 65, 77, 89, 79, 203, 83, 65, 77, 80, 73, 128,
- 83, 65, 77, 80, 72, 65, 79, 128, 83, 65, 77, 75, 65, 128, 83, 65, 77, 69,
- 75, 72, 128, 83, 65, 77, 69, 75, 200, 83, 65, 77, 65, 82, 73, 84, 65,
- 206, 83, 65, 76, 84, 73, 82, 69, 128, 83, 65, 76, 84, 73, 76, 76, 79,
- 128, 83, 65, 76, 84, 128, 83, 65, 76, 76, 65, 76, 76, 65, 72, 79, 213,
- 83, 65, 76, 76, 193, 83, 65, 76, 65, 205, 83, 65, 76, 65, 128, 83, 65,
- 76, 128, 83, 65, 74, 68, 65, 72, 128, 83, 65, 73, 76, 128, 83, 65, 73,
- 75, 85, 82, 85, 128, 83, 65, 71, 73, 84, 84, 65, 82, 73, 85, 83, 128, 83,
- 65, 71, 65, 128, 83, 65, 71, 128, 83, 65, 199, 83, 65, 70, 72, 65, 128,
- 83, 65, 68, 72, 69, 128, 83, 65, 68, 69, 128, 83, 65, 68, 128, 83, 65,
- 196, 83, 65, 67, 82, 73, 70, 73, 67, 73, 65, 204, 83, 65, 65, 73, 128,
- 83, 65, 65, 68, 72, 85, 128, 83, 65, 45, 73, 128, 83, 45, 87, 128, 83,
- 45, 83, 72, 65, 80, 69, 196, 82, 89, 89, 128, 82, 89, 88, 128, 82, 89,
- 84, 128, 82, 89, 82, 88, 128, 82, 89, 82, 128, 82, 89, 80, 128, 82, 89,
- 65, 128, 82, 87, 65, 72, 65, 128, 82, 87, 65, 65, 128, 82, 87, 65, 128,
- 82, 85, 88, 128, 82, 85, 85, 66, 85, 82, 85, 128, 82, 85, 84, 128, 82,
- 85, 83, 73, 128, 82, 85, 82, 88, 128, 82, 85, 82, 128, 82, 85, 80, 73,
- 73, 128, 82, 85, 80, 69, 197, 82, 85, 80, 128, 82, 85, 79, 88, 128, 82,
- 85, 79, 80, 128, 82, 85, 79, 128, 82, 85, 78, 79, 85, 84, 128, 82, 85,
- 78, 128, 82, 85, 77, 65, 201, 82, 85, 77, 128, 82, 85, 205, 82, 85, 76,
- 69, 45, 68, 69, 76, 65, 89, 69, 68, 128, 82, 85, 76, 69, 128, 82, 85, 75,
- 75, 65, 75, 72, 65, 128, 82, 85, 73, 83, 128, 82, 85, 194, 82, 85, 65,
- 128, 82, 84, 65, 71, 83, 128, 82, 84, 65, 71, 211, 82, 82, 89, 88, 128,
- 82, 82, 89, 84, 128, 82, 82, 89, 82, 88, 128, 82, 82, 89, 82, 128, 82,
- 82, 89, 80, 128, 82, 82, 89, 128, 82, 82, 85, 88, 128, 82, 82, 85, 84,
- 128, 82, 82, 85, 82, 88, 128, 82, 82, 85, 82, 128, 82, 82, 85, 80, 128,
- 82, 82, 85, 79, 88, 128, 82, 82, 85, 79, 128, 82, 82, 85, 128, 82, 82,
- 79, 88, 128, 82, 82, 79, 84, 128, 82, 82, 79, 80, 128, 82, 82, 79, 128,
- 82, 82, 69, 88, 128, 82, 82, 69, 84, 128, 82, 82, 69, 80, 128, 82, 82,
- 69, 72, 128, 82, 82, 69, 200, 82, 82, 69, 128, 82, 82, 65, 88, 128, 82,
- 82, 65, 128, 82, 79, 85, 78, 68, 69, 196, 82, 79, 85, 78, 68, 45, 84, 73,
+ 83, 69, 86, 69, 78, 45, 84, 72, 73, 82, 84, 89, 128, 83, 69, 86, 69, 206,
+ 83, 69, 85, 88, 128, 83, 69, 85, 78, 89, 65, 77, 128, 83, 69, 85, 65, 69,
+ 81, 128, 83, 69, 84, 70, 79, 78, 128, 83, 69, 83, 84, 69, 82, 84, 73, 85,
+ 211, 83, 69, 83, 81, 85, 73, 81, 85, 65, 68, 82, 65, 84, 69, 128, 83, 69,
+ 83, 65, 77, 197, 83, 69, 82, 86, 73, 67, 197, 83, 69, 82, 73, 70, 83,
+ 128, 83, 69, 82, 73, 70, 211, 83, 69, 80, 84, 69, 77, 66, 69, 82, 128,
+ 83, 69, 80, 65, 82, 65, 84, 79, 82, 128, 83, 69, 80, 65, 82, 65, 84, 79,
+ 210, 83, 69, 78, 84, 79, 128, 83, 69, 78, 84, 73, 128, 83, 69, 77, 85,
+ 78, 67, 73, 193, 83, 69, 77, 75, 65, 84, 72, 128, 83, 69, 77, 75, 128,
+ 83, 69, 77, 73, 86, 79, 87, 69, 204, 83, 69, 77, 73, 83, 79, 70, 212, 83,
+ 69, 77, 73, 83, 69, 88, 84, 73, 76, 69, 128, 83, 69, 77, 73, 77, 73, 78,
+ 73, 77, 193, 83, 69, 77, 73, 68, 73, 82, 69, 67, 212, 83, 69, 77, 73, 67,
+ 79, 76, 79, 78, 128, 83, 69, 77, 73, 67, 79, 76, 79, 206, 83, 69, 77, 73,
+ 67, 73, 82, 67, 85, 76, 65, 210, 83, 69, 77, 73, 67, 73, 82, 67, 76, 197,
+ 83, 69, 77, 73, 66, 82, 69, 86, 73, 211, 83, 69, 77, 73, 45, 86, 79, 73,
+ 67, 69, 196, 83, 69, 76, 70, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57,
+ 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 56, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 57, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57,
+ 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 53, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 57, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57,
+ 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 50, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 57, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57,
+ 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 56, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 56,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 55, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 56, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 53,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 52, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 56, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 50,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 49, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 56, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 57, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 55, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 55, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 54, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 55, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 52, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 51, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 55, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 49, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 48, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 57, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 54, 56, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 54, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 54, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 54, 53, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 54, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 51, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 54, 50, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 54, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 48, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 53, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 56, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 53, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 53, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 53, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 53, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 53, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 50, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 53, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 53, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 52, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 52, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 55, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 52, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 52, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 52, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 52, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 52, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 49, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 52, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 57, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 51, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51,
+ 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 54, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 51, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51,
+ 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 51, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 51, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51,
+ 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 48, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 57,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 56, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 50, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 54,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 54, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 50, 53, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 50, 53, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 51, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 50, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 50, 53, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53,
+ 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 50, 52, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 50, 52, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 55, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 54, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 50, 52, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52,
+ 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 51, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 50, 52, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 52, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 48, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 50, 51, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51,
+ 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 55, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 50, 51, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 51, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 52, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 51, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 50, 51, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50,
+ 51, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 48, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 50, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 50, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 56, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 55, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 50, 50, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50,
+ 50, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 52, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 50, 50, 51, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 50, 50, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 49,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 48, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 50, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50,
+ 49, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 56, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 50, 49, 55, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 50, 49, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 53,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 52, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 50, 49, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 50, 49, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 49, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 48, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 50, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 57,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 56, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 50, 48, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 50, 48, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 53, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 52, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 50, 48, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48,
+ 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 49, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 50, 48, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 57, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 57, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 55, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 54, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 57, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 57, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 51, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 57, 50, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 57, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 48,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 56, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 56, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 55, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 56, 54, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 56, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 52,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 51, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 56, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 56, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 48, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 55, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 56,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 55, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 55, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 55, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 52, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 51, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 55, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55,
+ 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 48, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 54, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 56, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 55, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 54, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54,
+ 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 52, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 54, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 54, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 49, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 48, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53,
+ 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 56, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 53, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 53, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 53, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 52, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 53, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 53, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 49, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 53, 48, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 57, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 56, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 52, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 52, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 53, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 52, 52, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 52, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 50,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 49, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 52, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 57, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 51, 56, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 51, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 54,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 53, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 51, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 51, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 50, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 49, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 51, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 57, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 50, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 50, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 54, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 53, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 50, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50,
+ 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 50, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 50, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 50, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 57, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 49, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49,
+ 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 54, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 49, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 49, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 51, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 50, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 49, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 49, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 48, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 48, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 55, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 54, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 48, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 48, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 51, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 48, 50, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 48, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 48,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 128, 83, 69, 76, 69, 67, 84, 79, 210, 83, 69, 73, 83,
+ 77, 65, 128, 83, 69, 73, 83, 77, 193, 83, 69, 72, 128, 83, 69, 71, 79,
+ 76, 128, 83, 69, 71, 78, 79, 128, 83, 69, 71, 77, 69, 78, 84, 128, 83,
+ 69, 69, 78, 85, 128, 83, 69, 69, 78, 128, 83, 69, 69, 206, 83, 69, 69,
+ 68, 76, 73, 78, 71, 128, 83, 69, 69, 45, 78, 79, 45, 69, 86, 73, 204, 83,
+ 69, 67, 84, 79, 82, 128, 83, 69, 67, 84, 73, 79, 78, 128, 83, 69, 67, 84,
+ 73, 79, 206, 83, 69, 67, 82, 69, 84, 128, 83, 69, 67, 79, 78, 68, 128,
+ 83, 69, 66, 65, 84, 66, 69, 73, 212, 83, 69, 65, 84, 128, 83, 69, 65, 76,
+ 128, 83, 69, 65, 71, 85, 76, 204, 83, 68, 79, 78, 199, 83, 68, 128, 83,
+ 67, 87, 65, 128, 83, 67, 82, 85, 80, 76, 69, 128, 83, 67, 82, 79, 76, 76,
+ 128, 83, 67, 82, 73, 80, 84, 128, 83, 67, 82, 69, 69, 78, 128, 83, 67,
+ 82, 69, 69, 206, 83, 67, 82, 69, 65, 77, 73, 78, 199, 83, 67, 79, 82, 80,
+ 73, 85, 83, 128, 83, 67, 79, 82, 69, 128, 83, 67, 73, 83, 83, 79, 82, 83,
+ 128, 83, 67, 72, 87, 65, 128, 83, 67, 72, 87, 193, 83, 67, 72, 82, 79,
+ 69, 68, 69, 82, 128, 83, 67, 72, 79, 79, 76, 128, 83, 67, 72, 79, 79,
+ 204, 83, 67, 72, 79, 76, 65, 82, 128, 83, 67, 72, 69, 77, 193, 83, 67,
+ 69, 80, 84, 69, 210, 83, 67, 65, 78, 68, 73, 67, 85, 83, 128, 83, 67, 65,
+ 78, 68, 73, 67, 85, 211, 83, 67, 65, 206, 83, 67, 65, 76, 69, 83, 128,
+ 83, 66, 85, 194, 83, 66, 82, 85, 204, 83, 65, 89, 73, 83, 201, 83, 65,
+ 89, 65, 78, 78, 65, 128, 83, 65, 89, 128, 83, 65, 88, 79, 80, 72, 79, 78,
+ 69, 128, 83, 65, 88, 73, 77, 65, 84, 65, 128, 83, 65, 87, 65, 78, 128,
+ 83, 65, 87, 128, 83, 65, 86, 79, 85, 82, 73, 78, 199, 83, 65, 85, 73, 76,
+ 128, 83, 65, 84, 85, 82, 78, 128, 83, 65, 84, 75, 65, 65, 78, 75, 85, 85,
+ 128, 83, 65, 84, 75, 65, 65, 78, 128, 83, 65, 84, 69, 76, 76, 73, 84,
+ 197, 83, 65, 84, 67, 72, 69, 76, 128, 83, 65, 83, 72, 128, 83, 65, 83,
+ 65, 75, 128, 83, 65, 82, 73, 128, 83, 65, 82, 193, 83, 65, 82, 128, 83,
+ 65, 81, 128, 83, 65, 80, 65, 128, 83, 65, 78, 89, 79, 79, 71, 193, 83,
+ 65, 78, 89, 65, 75, 193, 83, 65, 78, 84, 73, 73, 77, 85, 128, 83, 65, 78,
+ 78, 89, 65, 128, 83, 65, 78, 71, 65, 50, 128, 83, 65, 78, 68, 65, 76,
+ 128, 83, 65, 78, 65, 72, 128, 83, 65, 78, 128, 83, 65, 77, 89, 79, 203,
+ 83, 65, 77, 80, 73, 128, 83, 65, 77, 80, 72, 65, 79, 128, 83, 65, 77, 75,
+ 65, 128, 83, 65, 77, 69, 75, 72, 128, 83, 65, 77, 69, 75, 200, 83, 65,
+ 77, 66, 65, 128, 83, 65, 77, 65, 82, 73, 84, 65, 206, 83, 65, 77, 128,
+ 83, 65, 76, 84, 73, 82, 69, 128, 83, 65, 76, 84, 73, 76, 76, 79, 128, 83,
+ 65, 76, 84, 45, 50, 128, 83, 65, 76, 84, 128, 83, 65, 76, 212, 83, 65,
+ 76, 76, 65, 76, 76, 65, 72, 79, 213, 83, 65, 76, 76, 193, 83, 65, 76, 65,
+ 205, 83, 65, 76, 65, 128, 83, 65, 76, 45, 65, 77, 77, 79, 78, 73, 65, 67,
+ 128, 83, 65, 76, 128, 83, 65, 75, 79, 84, 128, 83, 65, 75, 69, 85, 65,
+ 69, 128, 83, 65, 75, 197, 83, 65, 74, 68, 65, 72, 128, 83, 65, 73, 76,
+ 66, 79, 65, 84, 128, 83, 65, 73, 76, 128, 83, 65, 73, 75, 85, 82, 85,
+ 128, 83, 65, 71, 73, 84, 84, 65, 82, 73, 85, 83, 128, 83, 65, 71, 65,
+ 128, 83, 65, 71, 128, 83, 65, 199, 83, 65, 70, 72, 65, 128, 83, 65, 68,
+ 72, 69, 128, 83, 65, 68, 69, 128, 83, 65, 68, 128, 83, 65, 196, 83, 65,
+ 67, 82, 73, 70, 73, 67, 73, 65, 204, 83, 65, 65, 73, 128, 83, 65, 65, 68,
+ 72, 85, 128, 83, 65, 45, 73, 128, 83, 48, 52, 54, 128, 83, 48, 52, 53,
+ 128, 83, 48, 52, 52, 128, 83, 48, 52, 51, 128, 83, 48, 52, 50, 128, 83,
+ 48, 52, 49, 128, 83, 48, 52, 48, 128, 83, 48, 51, 57, 128, 83, 48, 51,
+ 56, 128, 83, 48, 51, 55, 128, 83, 48, 51, 54, 128, 83, 48, 51, 53, 65,
+ 128, 83, 48, 51, 53, 128, 83, 48, 51, 52, 128, 83, 48, 51, 51, 128, 83,
+ 48, 51, 50, 128, 83, 48, 51, 49, 128, 83, 48, 51, 48, 128, 83, 48, 50,
+ 57, 128, 83, 48, 50, 56, 128, 83, 48, 50, 55, 128, 83, 48, 50, 54, 66,
+ 128, 83, 48, 50, 54, 65, 128, 83, 48, 50, 54, 128, 83, 48, 50, 53, 128,
+ 83, 48, 50, 52, 128, 83, 48, 50, 51, 128, 83, 48, 50, 50, 128, 83, 48,
+ 50, 49, 128, 83, 48, 50, 48, 128, 83, 48, 49, 57, 128, 83, 48, 49, 56,
+ 128, 83, 48, 49, 55, 65, 128, 83, 48, 49, 55, 128, 83, 48, 49, 54, 128,
+ 83, 48, 49, 53, 128, 83, 48, 49, 52, 66, 128, 83, 48, 49, 52, 65, 128,
+ 83, 48, 49, 52, 128, 83, 48, 49, 51, 128, 83, 48, 49, 50, 128, 83, 48,
+ 49, 49, 128, 83, 48, 49, 48, 128, 83, 48, 48, 57, 128, 83, 48, 48, 56,
+ 128, 83, 48, 48, 55, 128, 83, 48, 48, 54, 65, 128, 83, 48, 48, 54, 128,
+ 83, 48, 48, 53, 128, 83, 48, 48, 52, 128, 83, 48, 48, 51, 128, 83, 48,
+ 48, 50, 65, 128, 83, 48, 48, 50, 128, 83, 48, 48, 49, 128, 83, 45, 87,
+ 128, 83, 45, 83, 72, 65, 80, 69, 196, 82, 89, 89, 128, 82, 89, 88, 128,
+ 82, 89, 84, 128, 82, 89, 82, 88, 128, 82, 89, 82, 128, 82, 89, 80, 128,
+ 82, 89, 65, 128, 82, 87, 79, 79, 128, 82, 87, 79, 128, 82, 87, 73, 73,
+ 128, 82, 87, 73, 128, 82, 87, 69, 69, 128, 82, 87, 69, 128, 82, 87, 65,
+ 72, 65, 128, 82, 87, 65, 65, 128, 82, 87, 65, 128, 82, 85, 88, 128, 82,
+ 85, 85, 66, 85, 82, 85, 128, 82, 85, 84, 128, 82, 85, 83, 73, 128, 82,
+ 85, 82, 88, 128, 82, 85, 82, 128, 82, 85, 80, 73, 73, 128, 82, 85, 80,
+ 69, 197, 82, 85, 80, 128, 82, 85, 79, 88, 128, 82, 85, 79, 80, 128, 82,
+ 85, 79, 128, 82, 85, 78, 79, 85, 84, 128, 82, 85, 78, 78, 73, 78, 199,
+ 82, 85, 78, 78, 69, 82, 128, 82, 85, 78, 128, 82, 85, 77, 201, 82, 85,
+ 77, 65, 201, 82, 85, 77, 128, 82, 85, 205, 82, 85, 76, 69, 82, 128, 82,
+ 85, 76, 69, 45, 68, 69, 76, 65, 89, 69, 68, 128, 82, 85, 76, 69, 128, 82,
+ 85, 75, 75, 65, 75, 72, 65, 128, 82, 85, 73, 83, 128, 82, 85, 71, 66,
+ 217, 82, 85, 194, 82, 85, 65, 128, 82, 84, 72, 65, 78, 199, 82, 84, 65,
+ 71, 83, 128, 82, 84, 65, 71, 211, 82, 82, 89, 88, 128, 82, 82, 89, 84,
+ 128, 82, 82, 89, 82, 88, 128, 82, 82, 89, 82, 128, 82, 82, 89, 80, 128,
+ 82, 82, 85, 88, 128, 82, 82, 85, 84, 128, 82, 82, 85, 82, 88, 128, 82,
+ 82, 85, 82, 128, 82, 82, 85, 80, 128, 82, 82, 85, 79, 88, 128, 82, 82,
+ 85, 79, 128, 82, 82, 85, 128, 82, 82, 79, 88, 128, 82, 82, 79, 84, 128,
+ 82, 82, 79, 80, 128, 82, 82, 79, 128, 82, 82, 69, 88, 128, 82, 82, 69,
+ 84, 128, 82, 82, 69, 80, 128, 82, 82, 69, 72, 128, 82, 82, 69, 200, 82,
+ 82, 69, 128, 82, 82, 65, 88, 128, 82, 82, 65, 128, 82, 79, 87, 66, 79,
+ 65, 84, 128, 82, 79, 85, 78, 68, 69, 196, 82, 79, 85, 78, 68, 45, 84, 73,
80, 80, 69, 196, 82, 79, 84, 85, 78, 68, 65, 128, 82, 79, 84, 65, 84, 69,
- 196, 82, 79, 83, 72, 128, 82, 79, 83, 69, 84, 84, 69, 128, 82, 79, 79,
- 84, 128, 82, 79, 79, 75, 128, 82, 79, 79, 70, 128, 82, 79, 79, 128, 82,
- 79, 77, 65, 206, 82, 79, 196, 82, 79, 67, 128, 82, 79, 66, 65, 84, 128,
- 82, 79, 65, 82, 128, 82, 79, 65, 128, 82, 78, 89, 73, 78, 199, 82, 78,
- 79, 79, 78, 128, 82, 78, 79, 79, 206, 82, 78, 65, 205, 82, 74, 69, 211,
- 82, 74, 69, 128, 82, 74, 197, 82, 73, 86, 69, 82, 128, 82, 73, 84, 85,
- 65, 76, 128, 82, 73, 84, 84, 79, 82, 85, 128, 82, 73, 84, 83, 73, 128,
- 82, 73, 83, 73, 78, 199, 82, 73, 83, 72, 128, 82, 73, 82, 65, 128, 82,
- 73, 80, 128, 82, 73, 78, 70, 79, 82, 90, 65, 78, 68, 79, 128, 82, 73,
- 206, 82, 73, 75, 82, 73, 75, 128, 82, 73, 73, 128, 82, 73, 71, 72, 84,
- 87, 65, 82, 68, 83, 128, 82, 73, 71, 72, 84, 72, 65, 78, 196, 82, 73, 71,
- 72, 84, 45, 84, 79, 45, 76, 69, 70, 212, 82, 73, 71, 72, 84, 45, 83, 73,
- 68, 197, 82, 73, 71, 72, 84, 45, 83, 72, 65, 68, 79, 87, 69, 196, 82, 73,
- 71, 72, 84, 45, 83, 72, 65, 68, 69, 196, 82, 73, 71, 72, 84, 45, 80, 79,
- 73, 78, 84, 73, 78, 199, 82, 73, 71, 72, 84, 45, 72, 65, 78, 196, 82, 73,
- 71, 72, 84, 128, 82, 73, 69, 85, 76, 45, 89, 69, 79, 82, 73, 78, 72, 73,
+ 196, 82, 79, 83, 72, 128, 82, 79, 83, 69, 84, 84, 69, 128, 82, 79, 83,
+ 69, 128, 82, 79, 79, 84, 128, 82, 79, 79, 83, 84, 69, 82, 128, 82, 79,
+ 79, 75, 128, 82, 79, 79, 70, 128, 82, 79, 79, 128, 82, 79, 77, 65, 206,
+ 82, 79, 77, 128, 82, 79, 76, 76, 69, 210, 82, 79, 196, 82, 79, 67, 75,
+ 69, 84, 128, 82, 79, 67, 203, 82, 79, 67, 128, 82, 79, 66, 65, 84, 128,
+ 82, 79, 65, 83, 84, 69, 196, 82, 79, 65, 82, 128, 82, 79, 65, 128, 82,
+ 78, 89, 73, 78, 199, 82, 78, 79, 79, 78, 128, 82, 78, 79, 79, 206, 82,
+ 78, 65, 205, 82, 74, 69, 211, 82, 74, 69, 128, 82, 74, 197, 82, 73, 86,
+ 69, 82, 128, 82, 73, 84, 85, 65, 76, 128, 82, 73, 84, 84, 79, 82, 85,
+ 128, 82, 73, 84, 83, 73, 128, 82, 73, 83, 73, 78, 199, 82, 73, 83, 72,
+ 128, 82, 73, 82, 65, 128, 82, 73, 80, 128, 82, 73, 78, 71, 211, 82, 73,
+ 78, 70, 79, 82, 90, 65, 78, 68, 79, 128, 82, 73, 206, 82, 73, 77, 71, 66,
+ 65, 128, 82, 73, 75, 82, 73, 75, 128, 82, 73, 73, 128, 82, 73, 71, 86,
+ 69, 68, 73, 195, 82, 73, 71, 72, 84, 87, 65, 82, 68, 83, 128, 82, 73, 71,
+ 72, 84, 72, 65, 78, 196, 82, 73, 71, 72, 84, 45, 84, 79, 45, 76, 69, 70,
+ 212, 82, 73, 71, 72, 84, 45, 83, 73, 68, 197, 82, 73, 71, 72, 84, 45, 83,
+ 72, 65, 68, 79, 87, 69, 196, 82, 73, 71, 72, 84, 45, 83, 72, 65, 68, 69,
+ 196, 82, 73, 71, 72, 84, 45, 80, 79, 73, 78, 84, 73, 78, 199, 82, 73, 71,
+ 72, 84, 45, 72, 65, 78, 68, 69, 196, 82, 73, 71, 72, 84, 45, 72, 65, 78,
+ 196, 82, 73, 71, 72, 84, 45, 70, 65, 67, 73, 78, 199, 82, 73, 71, 72, 84,
+ 128, 82, 73, 69, 85, 76, 45, 89, 69, 83, 73, 69, 85, 78, 71, 128, 82, 73,
+ 69, 85, 76, 45, 89, 69, 79, 82, 73, 78, 72, 73, 69, 85, 72, 45, 72, 73,
+ 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 89, 69, 79, 82, 73, 78, 72, 73,
69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 84, 73, 75, 69, 85, 84, 45, 72,
73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 84, 73, 75, 69, 85, 84, 128,
82, 73, 69, 85, 76, 45, 84, 72, 73, 69, 85, 84, 72, 128, 82, 73, 69, 85,
+ 76, 45, 83, 83, 65, 78, 71, 84, 73, 75, 69, 85, 84, 128, 82, 73, 69, 85,
76, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45,
- 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45, 83,
- 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45, 72, 73,
- 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 128, 82, 73,
- 69, 85, 76, 45, 80, 72, 73, 69, 85, 80, 72, 128, 82, 73, 69, 85, 76, 45,
- 80, 65, 78, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 78, 73, 69, 85,
- 78, 128, 82, 73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 45, 83, 73, 79, 83,
- 128, 82, 73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 45, 75, 73, 89, 69, 79,
- 75, 128, 82, 73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 128, 82, 73, 69, 85,
- 76, 45, 75, 73, 89, 69, 79, 75, 45, 83, 73, 79, 83, 128, 82, 73, 69, 85,
- 76, 45, 75, 73, 89, 69, 79, 75, 128, 82, 73, 69, 85, 76, 45, 75, 72, 73,
- 69, 85, 75, 72, 128, 82, 73, 69, 85, 76, 45, 75, 65, 80, 89, 69, 79, 85,
- 78, 80, 73, 69, 85, 80, 128, 82, 73, 69, 85, 76, 45, 72, 73, 69, 85, 72,
- 128, 82, 73, 69, 85, 204, 82, 73, 69, 76, 128, 82, 73, 67, 69, 77, 128,
- 82, 73, 67, 69, 128, 82, 73, 65, 204, 82, 72, 79, 84, 73, 195, 82, 72,
+ 83, 83, 65, 78, 71, 80, 73, 69, 85, 80, 128, 82, 73, 69, 85, 76, 45, 83,
+ 83, 65, 78, 71, 75, 73, 89, 69, 79, 75, 128, 82, 73, 69, 85, 76, 45, 83,
+ 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45, 84, 73,
+ 75, 69, 85, 84, 128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45, 83,
+ 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45, 80, 72,
+ 73, 69, 85, 80, 72, 128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45,
+ 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 128,
+ 82, 73, 69, 85, 76, 45, 80, 72, 73, 69, 85, 80, 72, 128, 82, 73, 69, 85,
+ 76, 45, 80, 65, 78, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 78, 73,
+ 69, 85, 78, 128, 82, 73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 45, 83, 73,
+ 79, 83, 128, 82, 73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 45, 75, 73, 89,
+ 69, 79, 75, 128, 82, 73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 45, 72, 73,
+ 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 128, 82, 73,
+ 69, 85, 76, 45, 75, 73, 89, 69, 79, 75, 45, 83, 73, 79, 83, 128, 82, 73,
+ 69, 85, 76, 45, 75, 73, 89, 69, 79, 75, 45, 72, 73, 69, 85, 72, 128, 82,
+ 73, 69, 85, 76, 45, 75, 73, 89, 69, 79, 75, 128, 82, 73, 69, 85, 76, 45,
+ 75, 65, 80, 89, 69, 79, 85, 78, 80, 73, 69, 85, 80, 128, 82, 73, 69, 85,
+ 76, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 67, 73, 69, 85,
+ 67, 128, 82, 73, 69, 85, 204, 82, 73, 69, 76, 128, 82, 73, 69, 69, 128,
+ 82, 73, 67, 69, 77, 128, 82, 73, 67, 69, 128, 82, 73, 67, 197, 82, 73,
+ 66, 66, 79, 78, 128, 82, 73, 65, 204, 82, 72, 79, 84, 73, 195, 82, 72,
79, 128, 82, 72, 207, 82, 72, 65, 128, 82, 71, 89, 73, 78, 71, 83, 128,
- 82, 71, 89, 65, 78, 128, 82, 71, 89, 193, 82, 69, 86, 79, 76, 85, 84, 73,
- 79, 78, 128, 82, 69, 86, 77, 65, 128, 82, 69, 86, 73, 65, 128, 82, 69,
- 86, 69, 82, 83, 69, 68, 128, 82, 69, 86, 69, 82, 83, 197, 82, 69, 84, 85,
- 82, 78, 128, 82, 69, 84, 85, 82, 206, 82, 69, 84, 82, 79, 70, 76, 69,
- 216, 82, 69, 84, 82, 69, 65, 84, 128, 82, 69, 83, 85, 80, 73, 78, 85, 83,
- 128, 82, 69, 83, 84, 128, 82, 69, 83, 80, 79, 78, 83, 69, 128, 82, 69,
- 83, 79, 85, 82, 67, 69, 128, 82, 69, 83, 79, 76, 85, 84, 73, 79, 78, 128,
- 82, 69, 83, 73, 83, 84, 65, 78, 67, 69, 128, 82, 69, 83, 73, 68, 69, 78,
- 67, 69, 128, 82, 69, 83, 72, 128, 82, 69, 83, 200, 82, 69, 82, 69, 75,
- 65, 78, 128, 82, 69, 80, 82, 69, 83, 69, 78, 84, 128, 82, 69, 80, 76, 65,
- 67, 69, 77, 69, 78, 212, 82, 69, 80, 69, 65, 84, 69, 196, 82, 69, 80, 69,
- 65, 84, 128, 82, 69, 80, 69, 65, 212, 82, 69, 80, 65, 128, 82, 69, 80,
- 193, 82, 69, 78, 84, 79, 71, 69, 78, 128, 82, 69, 77, 85, 128, 82, 69,
- 76, 73, 71, 73, 79, 78, 128, 82, 69, 76, 69, 65, 83, 69, 128, 82, 69, 76,
- 65, 84, 73, 79, 78, 65, 204, 82, 69, 76, 65, 84, 73, 79, 78, 128, 82, 69,
- 76, 65, 65, 128, 82, 69, 74, 65, 78, 199, 82, 69, 73, 196, 82, 69, 71,
- 73, 83, 84, 69, 82, 69, 196, 82, 69, 70, 69, 82, 69, 78, 67, 197, 82, 69,
+ 82, 71, 89, 65, 78, 128, 82, 71, 89, 193, 82, 69, 86, 79, 76, 86, 73, 78,
+ 199, 82, 69, 86, 79, 76, 85, 84, 73, 79, 78, 128, 82, 69, 86, 77, 65,
+ 128, 82, 69, 86, 73, 65, 128, 82, 69, 86, 69, 82, 83, 69, 68, 128, 82,
+ 69, 86, 69, 82, 83, 69, 196, 82, 69, 86, 69, 82, 83, 197, 82, 69, 85, 88,
+ 128, 82, 69, 84, 85, 82, 78, 128, 82, 69, 84, 85, 82, 206, 82, 69, 84,
+ 82, 79, 70, 76, 69, 216, 82, 69, 84, 82, 69, 65, 84, 128, 82, 69, 84, 79,
+ 82, 84, 128, 82, 69, 83, 85, 80, 73, 78, 85, 83, 128, 82, 69, 83, 84, 82,
+ 79, 79, 77, 128, 82, 69, 83, 84, 82, 73, 67, 84, 69, 196, 82, 69, 83, 84,
+ 128, 82, 69, 83, 80, 79, 78, 83, 69, 128, 82, 69, 83, 79, 85, 82, 67, 69,
+ 128, 82, 69, 83, 79, 76, 85, 84, 73, 79, 78, 128, 82, 69, 83, 73, 83, 84,
+ 65, 78, 67, 69, 128, 82, 69, 83, 73, 68, 69, 78, 67, 69, 128, 82, 69, 83,
+ 200, 82, 69, 82, 69, 78, 71, 71, 65, 78, 128, 82, 69, 82, 69, 75, 65, 78,
+ 128, 82, 69, 80, 82, 69, 83, 69, 78, 84, 128, 82, 69, 80, 76, 65, 67, 69,
+ 77, 69, 78, 212, 82, 69, 80, 72, 128, 82, 69, 80, 69, 65, 84, 69, 196,
+ 82, 69, 80, 69, 65, 84, 128, 82, 69, 80, 69, 65, 212, 82, 69, 80, 65,
+ 128, 82, 69, 80, 193, 82, 69, 78, 84, 79, 71, 69, 78, 128, 82, 69, 78,
+ 128, 82, 69, 206, 82, 69, 77, 85, 128, 82, 69, 77, 69, 68, 89, 128, 82,
+ 69, 76, 73, 71, 73, 79, 78, 128, 82, 69, 76, 73, 69, 86, 69, 196, 82, 69,
+ 76, 69, 65, 83, 69, 128, 82, 69, 76, 65, 84, 73, 79, 78, 65, 204, 82, 69,
+ 76, 65, 84, 73, 79, 78, 128, 82, 69, 76, 65, 65, 128, 82, 69, 74, 65, 78,
+ 199, 82, 69, 73, 196, 82, 69, 71, 85, 76, 85, 83, 45, 52, 128, 82, 69,
+ 71, 85, 76, 85, 83, 45, 51, 128, 82, 69, 71, 85, 76, 85, 83, 45, 50, 128,
+ 82, 69, 71, 85, 76, 85, 83, 128, 82, 69, 71, 85, 76, 85, 211, 82, 69, 71,
+ 73, 83, 84, 69, 82, 69, 196, 82, 69, 71, 73, 79, 78, 65, 204, 82, 69, 71,
+ 73, 65, 45, 50, 128, 82, 69, 71, 73, 65, 128, 82, 69, 70, 69, 82, 69, 78,
+ 67, 197, 82, 69, 68, 85, 80, 76, 73, 67, 65, 84, 73, 79, 78, 128, 82, 69,
67, 89, 67, 76, 73, 78, 199, 82, 69, 67, 89, 67, 76, 69, 196, 82, 69, 67,
84, 73, 76, 73, 78, 69, 65, 210, 82, 69, 67, 84, 65, 78, 71, 85, 76, 65,
210, 82, 69, 67, 84, 65, 78, 71, 76, 69, 128, 82, 69, 67, 84, 65, 78, 71,
- 76, 197, 82, 69, 67, 79, 82, 68, 73, 78, 199, 82, 69, 67, 79, 82, 68, 69,
- 82, 128, 82, 69, 67, 79, 82, 196, 82, 69, 67, 69, 80, 84, 73, 86, 197,
- 82, 69, 65, 72, 77, 85, 75, 128, 82, 69, 65, 67, 72, 128, 82, 68, 207,
- 82, 68, 69, 204, 82, 66, 65, 83, 193, 82, 65, 89, 83, 128, 82, 65, 89,
- 65, 78, 78, 65, 128, 82, 65, 89, 128, 82, 65, 84, 73, 79, 128, 82, 65,
- 84, 128, 82, 65, 83, 79, 85, 204, 82, 65, 83, 72, 65, 128, 82, 65, 80,
- 73, 83, 77, 65, 128, 82, 65, 78, 71, 197, 82, 65, 78, 128, 82, 65, 77,
- 211, 82, 65, 77, 66, 65, 84, 128, 82, 65, 77, 128, 82, 65, 75, 72, 65,
- 78, 71, 128, 82, 65, 73, 83, 69, 196, 82, 65, 73, 78, 128, 82, 65, 73,
- 206, 82, 65, 73, 68, 207, 82, 65, 73, 68, 65, 128, 82, 65, 72, 77, 65,
- 84, 85, 76, 76, 65, 200, 82, 65, 70, 69, 128, 82, 65, 69, 128, 82, 65,
- 68, 73, 79, 65, 67, 84, 73, 86, 197, 82, 65, 68, 201, 82, 65, 68, 128,
- 82, 65, 196, 82, 65, 66, 128, 82, 65, 65, 73, 128, 82, 65, 65, 128, 82,
- 65, 51, 128, 82, 65, 50, 128, 82, 45, 67, 82, 69, 197, 81, 89, 88, 128,
- 81, 89, 85, 128, 81, 89, 84, 128, 81, 89, 82, 88, 128, 81, 89, 82, 128,
- 81, 89, 80, 128, 81, 89, 79, 128, 81, 89, 73, 128, 81, 89, 69, 69, 128,
- 81, 89, 69, 128, 81, 89, 65, 65, 128, 81, 89, 65, 128, 81, 89, 128, 81,
- 87, 73, 128, 81, 87, 69, 69, 128, 81, 87, 69, 128, 81, 87, 65, 65, 128,
- 81, 87, 65, 128, 81, 85, 88, 128, 81, 85, 86, 128, 81, 85, 85, 86, 128,
- 81, 85, 85, 128, 81, 85, 84, 128, 81, 85, 83, 72, 83, 72, 65, 89, 65,
- 128, 81, 85, 82, 88, 128, 81, 85, 82, 128, 81, 85, 80, 128, 81, 85, 79,
- 88, 128, 81, 85, 79, 84, 197, 81, 85, 79, 84, 65, 84, 73, 79, 206, 81,
- 85, 79, 84, 128, 81, 85, 79, 80, 128, 81, 85, 79, 128, 81, 85, 75, 128,
- 81, 85, 73, 78, 68, 73, 67, 69, 83, 73, 77, 193, 81, 85, 73, 78, 67, 85,
- 78, 88, 128, 81, 85, 73, 78, 65, 82, 73, 85, 211, 81, 85, 73, 76, 76,
- 128, 81, 85, 73, 128, 81, 85, 69, 83, 84, 73, 79, 78, 69, 196, 81, 85,
- 69, 83, 84, 73, 79, 78, 128, 81, 85, 69, 83, 84, 73, 79, 206, 81, 85, 69,
- 69, 78, 128, 81, 85, 69, 128, 81, 85, 66, 85, 84, 83, 128, 81, 85, 65,
- 84, 69, 82, 78, 73, 79, 206, 81, 85, 65, 82, 84, 69, 82, 83, 128, 81, 85,
- 65, 82, 84, 69, 82, 211, 81, 85, 65, 82, 84, 69, 82, 128, 81, 85, 65, 82,
- 84, 69, 210, 81, 85, 65, 68, 82, 85, 80, 76, 197, 81, 85, 65, 68, 82, 65,
- 78, 84, 128, 81, 85, 65, 68, 82, 65, 78, 212, 81, 85, 65, 68, 128, 81,
- 85, 65, 196, 81, 85, 65, 128, 81, 85, 128, 81, 208, 81, 79, 88, 128, 81,
- 79, 84, 128, 81, 79, 80, 65, 128, 81, 79, 80, 128, 81, 79, 79, 128, 81,
- 79, 207, 81, 79, 70, 128, 81, 79, 198, 81, 79, 65, 128, 81, 79, 128, 81,
- 73, 88, 128, 81, 73, 84, 128, 81, 73, 80, 128, 81, 73, 73, 128, 81, 73,
- 69, 88, 128, 81, 73, 69, 84, 128, 81, 73, 69, 80, 128, 81, 73, 69, 128,
- 81, 73, 128, 81, 72, 87, 73, 128, 81, 72, 87, 69, 69, 128, 81, 72, 87,
- 69, 128, 81, 72, 87, 65, 65, 128, 81, 72, 87, 65, 128, 81, 72, 85, 128,
- 81, 72, 79, 128, 81, 72, 73, 128, 81, 72, 69, 69, 128, 81, 72, 69, 128,
- 81, 72, 65, 65, 128, 81, 72, 65, 128, 81, 69, 84, 65, 78, 65, 128, 81,
- 69, 69, 128, 81, 69, 128, 81, 65, 85, 128, 81, 65, 84, 65, 78, 128, 81,
- 65, 82, 78, 69, 217, 81, 65, 82, 128, 81, 65, 81, 128, 81, 65, 80, 72,
- 128, 81, 65, 77, 65, 84, 83, 128, 81, 65, 77, 65, 84, 211, 81, 65, 76,
- 193, 81, 65, 73, 82, 84, 72, 82, 65, 128, 81, 65, 73, 128, 81, 65, 70,
- 128, 81, 65, 198, 81, 65, 68, 77, 65, 128, 81, 65, 65, 73, 128, 81, 65,
- 65, 70, 85, 128, 81, 65, 65, 70, 128, 81, 65, 65, 128, 209, 80, 90, 128,
- 80, 89, 88, 128, 80, 89, 84, 128, 80, 89, 82, 88, 128, 80, 89, 82, 128,
- 80, 89, 80, 128, 80, 89, 128, 80, 87, 79, 79, 128, 80, 87, 79, 128, 80,
- 87, 207, 80, 87, 73, 73, 128, 80, 87, 73, 128, 80, 87, 69, 69, 128, 80,
- 87, 69, 128, 80, 87, 65, 65, 128, 80, 87, 128, 80, 86, 128, 80, 85, 88,
- 128, 80, 85, 84, 128, 80, 85, 83, 72, 73, 78, 199, 80, 85, 82, 88, 128,
- 80, 85, 82, 73, 84, 89, 128, 80, 85, 82, 128, 80, 85, 80, 128, 80, 85,
- 79, 88, 128, 80, 85, 79, 80, 128, 80, 85, 79, 128, 80, 85, 78, 71, 128,
- 80, 85, 78, 67, 84, 85, 65, 84, 73, 79, 78, 128, 80, 85, 78, 67, 84, 85,
- 65, 84, 73, 79, 206, 80, 85, 50, 128, 80, 85, 128, 80, 84, 72, 65, 72,
- 193, 80, 84, 69, 128, 80, 83, 73, 70, 73, 83, 84, 79, 83, 89, 78, 65, 71,
- 77, 65, 128, 80, 83, 73, 70, 73, 83, 84, 79, 80, 65, 82, 65, 75, 65, 76,
- 69, 83, 77, 65, 128, 80, 83, 73, 70, 73, 83, 84, 79, 206, 80, 83, 73, 70,
- 73, 83, 84, 79, 76, 89, 71, 73, 83, 77, 65, 128, 80, 83, 73, 128, 80, 83,
- 128, 80, 82, 79, 86, 69, 128, 80, 82, 79, 84, 79, 86, 65, 82, 89, 211,
- 80, 82, 79, 84, 79, 211, 80, 82, 79, 83, 71, 69, 71, 82, 65, 77, 77, 69,
- 78, 73, 128, 80, 82, 79, 80, 79, 82, 84, 73, 79, 78, 65, 204, 80, 82, 79,
- 80, 79, 82, 84, 73, 79, 78, 128, 80, 82, 79, 80, 69, 82, 84, 217, 80, 82,
- 79, 80, 69, 76, 76, 69, 210, 80, 82, 79, 79, 70, 128, 80, 82, 79, 76, 79,
- 78, 71, 69, 196, 80, 82, 79, 76, 65, 84, 73, 79, 78, 197, 80, 82, 79, 74,
- 69, 67, 84, 73, 86, 69, 128, 80, 82, 79, 74, 69, 67, 84, 73, 79, 78, 128,
- 80, 82, 79, 71, 82, 69, 83, 83, 128, 80, 82, 79, 70, 79, 85, 78, 68, 128,
- 80, 82, 79, 68, 85, 67, 84, 128, 80, 82, 79, 68, 85, 67, 212, 80, 82, 73,
- 86, 65, 84, 69, 128, 80, 82, 73, 78, 84, 128, 80, 82, 73, 78, 212, 80,
- 82, 73, 77, 69, 128, 80, 82, 73, 77, 197, 80, 82, 69, 86, 73, 79, 85,
- 211, 80, 82, 69, 83, 69, 78, 84, 65, 84, 73, 79, 206, 80, 82, 69, 83, 67,
- 82, 73, 80, 84, 73, 79, 206, 80, 82, 69, 80, 79, 78, 68, 69, 82, 65, 78,
- 67, 69, 128, 80, 82, 69, 70, 65, 67, 197, 80, 82, 69, 67, 69, 68, 73, 78,
- 199, 80, 82, 69, 67, 69, 68, 69, 83, 128, 80, 82, 69, 67, 69, 68, 69,
- 211, 80, 82, 69, 67, 69, 68, 69, 196, 80, 82, 69, 67, 69, 68, 69, 128,
- 80, 82, 69, 67, 69, 68, 197, 80, 82, 65, 77, 45, 80, 73, 73, 128, 80, 82,
- 65, 77, 45, 80, 73, 201, 80, 82, 65, 77, 45, 77, 85, 79, 89, 128, 80, 82,
- 65, 77, 45, 77, 85, 79, 217, 80, 82, 65, 77, 45, 66, 85, 79, 78, 128, 80,
- 82, 65, 77, 45, 66, 85, 79, 206, 80, 82, 65, 77, 45, 66, 69, 73, 128, 80,
- 82, 65, 77, 45, 66, 69, 201, 80, 82, 65, 77, 128, 80, 82, 65, 205, 80,
- 82, 128, 80, 80, 77, 128, 80, 80, 65, 128, 80, 79, 88, 128, 80, 79, 87,
- 69, 82, 211, 80, 79, 87, 69, 82, 128, 80, 79, 85, 78, 196, 80, 79, 83,
- 84, 80, 79, 83, 73, 84, 73, 79, 206, 80, 79, 83, 84, 65, 204, 80, 79, 83,
- 83, 69, 83, 83, 73, 79, 78, 128, 80, 79, 82, 82, 69, 67, 84, 85, 83, 128,
- 80, 79, 82, 82, 69, 67, 84, 85, 211, 80, 79, 80, 128, 80, 79, 208, 80,
- 79, 79, 128, 80, 79, 78, 68, 79, 128, 80, 79, 76, 201, 80, 79, 76, 69,
- 128, 80, 79, 75, 82, 89, 84, 73, 69, 128, 80, 79, 75, 79, 74, 73, 128,
- 80, 79, 73, 78, 84, 79, 128, 80, 79, 73, 78, 84, 69, 82, 128, 80, 79, 73,
- 78, 84, 69, 196, 80, 79, 73, 78, 84, 128, 80, 79, 73, 78, 212, 80, 79,
- 69, 84, 82, 217, 80, 79, 69, 84, 73, 195, 80, 79, 68, 65, 84, 85, 83,
- 128, 80, 79, 65, 128, 80, 79, 128, 80, 207, 80, 78, 69, 85, 77, 65, 84,
- 65, 128, 80, 76, 85, 84, 79, 128, 80, 76, 85, 83, 45, 77, 73, 78, 85,
- 211, 80, 76, 85, 83, 128, 80, 76, 85, 77, 69, 196, 80, 76, 85, 77, 128,
- 80, 76, 85, 75, 128, 80, 76, 79, 87, 128, 80, 76, 79, 80, 72, 85, 128,
- 80, 76, 69, 84, 72, 82, 79, 78, 128, 80, 76, 65, 83, 84, 73, 67, 83, 128,
- 80, 76, 65, 78, 69, 128, 80, 76, 65, 78, 197, 80, 76, 65, 78, 67, 203,
- 80, 76, 65, 75, 128, 80, 76, 65, 71, 73, 79, 211, 80, 76, 65, 67, 197,
- 80, 76, 65, 128, 80, 73, 90, 90, 73, 67, 65, 84, 79, 128, 80, 73, 88,
- 128, 80, 73, 87, 82, 128, 80, 73, 84, 67, 72, 70, 79, 82, 75, 128, 80,
- 73, 84, 67, 72, 70, 79, 82, 203, 80, 73, 84, 128, 80, 73, 83, 67, 69, 83,
- 128, 80, 73, 82, 73, 71, 128, 80, 73, 82, 73, 199, 80, 73, 80, 73, 78,
- 71, 128, 80, 73, 80, 128, 80, 73, 78, 87, 72, 69, 69, 204, 80, 73, 76,
- 67, 82, 79, 215, 80, 73, 75, 85, 82, 85, 128, 80, 73, 75, 79, 128, 80,
- 73, 71, 128, 80, 73, 69, 88, 128, 80, 73, 69, 85, 80, 45, 84, 73, 75, 69,
- 85, 84, 128, 80, 73, 69, 85, 80, 45, 84, 72, 73, 69, 85, 84, 72, 128, 80,
- 73, 69, 85, 80, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 80, 73, 69,
- 85, 80, 45, 83, 73, 79, 83, 45, 84, 73, 75, 69, 85, 84, 128, 80, 73, 69,
- 85, 80, 45, 83, 73, 79, 83, 45, 80, 73, 69, 85, 80, 128, 80, 73, 69, 85,
- 80, 45, 83, 73, 79, 83, 45, 75, 73, 89, 69, 79, 75, 128, 80, 73, 69, 85,
- 80, 45, 83, 73, 79, 83, 45, 67, 73, 69, 85, 67, 128, 80, 73, 69, 85, 80,
- 45, 82, 73, 69, 85, 76, 128, 80, 73, 69, 85, 80, 45, 80, 72, 73, 69, 85,
- 80, 72, 128, 80, 73, 69, 85, 80, 45, 78, 73, 69, 85, 78, 128, 80, 73, 69,
- 85, 80, 45, 67, 73, 69, 85, 67, 128, 80, 73, 69, 85, 80, 45, 67, 72, 73,
- 69, 85, 67, 72, 128, 80, 73, 69, 85, 208, 80, 73, 69, 80, 128, 80, 73,
- 69, 67, 69, 128, 80, 73, 69, 128, 80, 73, 67, 75, 128, 80, 73, 65, 83,
- 85, 84, 79, 82, 85, 128, 80, 73, 65, 83, 77, 193, 80, 73, 65, 78, 79,
- 128, 80, 201, 80, 72, 87, 65, 128, 80, 72, 85, 84, 72, 65, 79, 128, 80,
- 72, 85, 210, 80, 72, 85, 78, 71, 128, 80, 72, 82, 65, 83, 69, 128, 80,
- 72, 79, 69, 78, 73, 67, 73, 65, 206, 80, 72, 79, 65, 128, 80, 72, 79,
- 128, 80, 72, 207, 80, 72, 78, 65, 69, 203, 80, 72, 73, 78, 84, 72, 85,
- 128, 80, 72, 73, 76, 73, 80, 80, 73, 78, 197, 80, 72, 73, 69, 85, 80, 72,
- 45, 80, 73, 69, 85, 80, 128, 80, 72, 73, 69, 85, 80, 200, 80, 72, 73,
- 128, 80, 72, 201, 80, 72, 69, 69, 128, 80, 72, 69, 128, 80, 72, 65, 82,
- 89, 78, 71, 69, 65, 204, 80, 72, 65, 82, 128, 80, 72, 65, 78, 128, 80,
- 72, 65, 73, 83, 84, 79, 211, 80, 72, 65, 65, 82, 75, 65, 65, 128, 80, 72,
- 65, 65, 128, 80, 72, 65, 128, 80, 71, 128, 80, 70, 128, 80, 69, 84, 65,
- 83, 84, 79, 75, 79, 85, 70, 73, 83, 77, 65, 128, 80, 69, 84, 65, 83, 84,
- 73, 128, 80, 69, 84, 65, 83, 77, 65, 128, 80, 69, 84, 65, 76, 76, 69,
- 196, 80, 69, 83, 79, 128, 80, 69, 83, 207, 80, 69, 83, 72, 50, 128, 80,
- 69, 83, 69, 84, 193, 80, 69, 211, 80, 69, 82, 84, 72, 207, 80, 69, 82,
- 83, 80, 69, 67, 84, 73, 86, 69, 128, 80, 69, 82, 83, 79, 78, 128, 80, 69,
- 82, 83, 73, 65, 206, 80, 69, 82, 80, 69, 78, 68, 73, 67, 85, 76, 65, 82,
- 128, 80, 69, 82, 80, 69, 78, 68, 73, 67, 85, 76, 65, 210, 80, 69, 82, 77,
- 65, 78, 69, 78, 212, 80, 69, 82, 73, 83, 80, 79, 77, 69, 78, 73, 128, 80,
- 69, 82, 73, 83, 80, 79, 77, 69, 78, 201, 80, 69, 82, 70, 69, 67, 84, 85,
- 205, 80, 69, 82, 70, 69, 67, 84, 65, 128, 80, 69, 82, 70, 69, 67, 84,
- 193, 80, 69, 82, 67, 85, 83, 83, 73, 86, 69, 128, 80, 69, 82, 67, 69, 78,
- 212, 80, 69, 80, 69, 84, 128, 80, 69, 80, 69, 212, 80, 69, 79, 82, 84,
- 200, 80, 69, 78, 84, 65, 83, 69, 77, 69, 128, 80, 69, 78, 84, 65, 71, 79,
- 78, 128, 80, 69, 78, 83, 85, 128, 80, 69, 78, 78, 217, 80, 69, 78, 73,
- 72, 73, 128, 80, 69, 78, 69, 84, 82, 65, 84, 73, 79, 78, 128, 80, 69, 78,
- 67, 73, 76, 128, 80, 69, 76, 65, 83, 84, 79, 78, 128, 80, 69, 76, 65, 83,
- 84, 79, 206, 80, 69, 73, 84, 72, 128, 80, 69, 72, 69, 72, 128, 80, 69,
- 72, 69, 200, 80, 69, 72, 128, 80, 69, 200, 80, 69, 69, 90, 73, 128, 80,
- 69, 69, 80, 128, 80, 69, 69, 128, 80, 69, 68, 69, 83, 84, 82, 73, 65, 78,
- 128, 80, 69, 68, 69, 83, 84, 65, 76, 128, 80, 69, 68, 69, 83, 84, 65,
- 204, 80, 69, 68, 65, 204, 80, 69, 65, 67, 69, 128, 80, 69, 65, 67, 197,
- 80, 68, 128, 80, 67, 128, 80, 65, 90, 69, 82, 128, 80, 65, 89, 69, 82,
- 79, 75, 128, 80, 65, 89, 65, 78, 78, 65, 128, 80, 65, 88, 128, 80, 65,
- 87, 78, 128, 80, 65, 215, 80, 65, 86, 73, 89, 65, 78, 73, 128, 80, 65,
- 84, 84, 69, 82, 78, 128, 80, 65, 84, 72, 65, 77, 65, 83, 65, 84, 128, 80,
- 65, 84, 200, 80, 65, 84, 65, 75, 128, 80, 65, 84, 65, 72, 128, 80, 65,
- 84, 128, 80, 65, 83, 85, 81, 128, 80, 65, 83, 83, 73, 86, 69, 45, 80, 85,
- 76, 76, 45, 85, 80, 45, 79, 85, 84, 80, 85, 212, 80, 65, 83, 83, 73, 86,
- 69, 45, 80, 85, 76, 76, 45, 68, 79, 87, 78, 45, 79, 85, 84, 80, 85, 212,
- 80, 65, 83, 72, 84, 65, 128, 80, 65, 83, 69, 81, 128, 80, 65, 82, 84, 78,
- 69, 82, 83, 72, 73, 208, 80, 65, 82, 84, 73, 65, 76, 76, 89, 45, 82, 69,
- 67, 89, 67, 76, 69, 196, 80, 65, 82, 84, 73, 65, 204, 80, 65, 82, 212,
- 80, 65, 82, 73, 67, 72, 79, 78, 128, 80, 65, 82, 69, 83, 84, 73, 71, 77,
- 69, 78, 79, 206, 80, 65, 82, 69, 82, 69, 78, 128, 80, 65, 82, 69, 78, 84,
- 72, 69, 83, 73, 83, 128, 80, 65, 82, 69, 78, 84, 72, 69, 83, 73, 211, 80,
- 65, 82, 65, 80, 72, 82, 65, 83, 197, 80, 65, 82, 65, 76, 76, 69, 76, 79,
- 71, 82, 65, 77, 128, 80, 65, 82, 65, 76, 76, 69, 76, 128, 80, 65, 82, 65,
- 76, 76, 69, 204, 80, 65, 82, 65, 75, 76, 73, 84, 73, 75, 73, 128, 80, 65,
- 82, 65, 75, 76, 73, 84, 73, 75, 201, 80, 65, 82, 65, 75, 65, 76, 69, 83,
- 77, 193, 80, 65, 82, 65, 71, 82, 65, 80, 72, 79, 83, 128, 80, 65, 82, 65,
- 71, 82, 65, 80, 72, 128, 80, 65, 82, 65, 71, 82, 65, 80, 200, 80, 65, 82,
- 65, 128, 80, 65, 82, 128, 80, 65, 80, 89, 82, 85, 83, 128, 80, 65, 80,
- 69, 210, 80, 65, 80, 128, 80, 65, 208, 80, 65, 78, 89, 85, 75, 85, 128,
- 80, 65, 78, 89, 73, 75, 85, 128, 80, 65, 78, 89, 69, 67, 69, 75, 128, 80,
- 65, 78, 89, 65, 75, 82, 65, 128, 80, 65, 78, 84, 73, 128, 80, 65, 78, 79,
- 76, 79, 78, 71, 128, 80, 65, 78, 71, 87, 73, 83, 65, 68, 128, 80, 65, 78,
- 71, 76, 65, 89, 65, 82, 128, 80, 65, 78, 71, 72, 85, 76, 85, 128, 80, 65,
- 78, 71, 128, 80, 65, 78, 69, 85, 76, 69, 85, 78, 71, 128, 80, 65, 78, 65,
- 69, 76, 65, 69, 78, 71, 128, 80, 65, 78, 128, 80, 65, 77, 85, 78, 71, 75,
- 65, 72, 128, 80, 65, 77, 85, 68, 80, 79, 68, 128, 80, 65, 77, 80, 72, 89,
- 76, 73, 65, 206, 80, 65, 77, 73, 78, 71, 75, 65, 76, 128, 80, 65, 77, 69,
- 80, 69, 84, 128, 80, 65, 77, 69, 78, 69, 78, 71, 128, 80, 65, 77, 65, 68,
- 65, 128, 80, 65, 77, 65, 65, 69, 72, 128, 80, 65, 76, 85, 84, 65, 128,
- 80, 65, 76, 79, 67, 72, 75, 65, 128, 80, 65, 76, 205, 80, 65, 76, 76, 65,
- 87, 65, 128, 80, 65, 76, 76, 65, 83, 128, 80, 65, 76, 65, 85, 78, 199,
- 80, 65, 76, 65, 84, 65, 76, 73, 90, 69, 196, 80, 65, 76, 65, 84, 65, 76,
- 73, 90, 65, 84, 73, 79, 78, 128, 80, 65, 76, 65, 84, 65, 204, 80, 65, 73,
- 89, 65, 78, 78, 79, 73, 128, 80, 65, 73, 82, 84, 72, 82, 65, 128, 80, 65,
- 73, 82, 69, 196, 80, 65, 68, 77, 193, 80, 65, 68, 128, 80, 65, 67, 75,
- 73, 78, 71, 128, 80, 65, 65, 84, 85, 128, 80, 65, 65, 83, 69, 78, 84, 79,
- 128, 80, 65, 65, 73, 128, 80, 65, 65, 45, 80, 73, 76, 76, 65, 128, 80,
- 65, 65, 128, 80, 50, 128, 79, 89, 82, 65, 78, 73, 83, 77, 193, 79, 89,
- 65, 78, 78, 65, 128, 79, 88, 73, 65, 128, 79, 88, 73, 193, 79, 88, 69,
- 73, 65, 201, 79, 88, 69, 73, 193, 79, 86, 69, 82, 82, 73, 68, 69, 128,
- 79, 86, 69, 82, 76, 73, 78, 69, 128, 79, 86, 69, 82, 76, 65, 89, 128, 79,
- 86, 69, 82, 76, 65, 80, 80, 73, 78, 199, 79, 86, 69, 82, 76, 65, 73, 68,
- 128, 79, 86, 69, 82, 66, 65, 82, 128, 79, 86, 128, 79, 85, 84, 76, 73,
- 78, 69, 196, 79, 85, 84, 76, 73, 78, 69, 128, 79, 85, 84, 69, 210, 79,
- 85, 78, 75, 73, 193, 79, 85, 78, 67, 197, 79, 84, 85, 128, 79, 84, 84,
- 65, 86, 193, 79, 84, 84, 128, 79, 84, 72, 65, 76, 65, 206, 79, 84, 72,
- 65, 76, 128, 79, 83, 77, 65, 78, 89, 193, 79, 82, 84, 72, 79, 71, 79, 78,
- 65, 204, 79, 82, 84, 72, 79, 68, 79, 216, 79, 82, 78, 65, 84, 197, 79,
- 82, 78, 65, 77, 69, 78, 84, 128, 79, 82, 78, 65, 77, 69, 78, 212, 79, 82,
- 73, 71, 73, 78, 65, 204, 79, 82, 73, 71, 73, 78, 128, 79, 82, 68, 73, 78,
- 65, 204, 79, 82, 67, 72, 73, 68, 128, 79, 80, 84, 73, 79, 206, 79, 80,
- 80, 82, 69, 83, 83, 73, 79, 78, 128, 79, 80, 80, 79, 83, 73, 84, 73, 79,
- 78, 128, 79, 80, 80, 79, 83, 73, 78, 199, 79, 80, 80, 79, 83, 69, 128,
- 79, 80, 69, 82, 65, 84, 79, 82, 128, 79, 80, 69, 82, 65, 84, 79, 210, 79,
- 80, 69, 78, 73, 78, 199, 79, 80, 69, 78, 45, 80, 128, 79, 80, 69, 78, 45,
- 79, 85, 84, 76, 73, 78, 69, 196, 79, 80, 69, 78, 45, 72, 69, 65, 68, 69,
- 196, 79, 80, 69, 78, 45, 67, 73, 82, 67, 85, 73, 84, 45, 79, 85, 84, 80,
- 85, 212, 79, 80, 69, 206, 79, 79, 90, 69, 128, 79, 79, 89, 65, 78, 78,
- 65, 128, 79, 79, 85, 128, 79, 79, 77, 85, 128, 79, 79, 66, 79, 79, 70,
- 73, 76, 73, 128, 79, 78, 85, 128, 79, 78, 83, 85, 128, 79, 78, 78, 128,
- 79, 78, 75, 65, 82, 128, 79, 78, 69, 83, 69, 76, 70, 128, 79, 78, 69, 45,
- 76, 73, 78, 197, 79, 77, 73, 83, 83, 73, 79, 206, 79, 77, 73, 67, 82, 79,
- 78, 128, 79, 77, 73, 67, 82, 79, 206, 79, 77, 69, 71, 65, 128, 79, 77,
- 69, 71, 193, 79, 77, 65, 76, 79, 78, 128, 79, 77, 128, 79, 76, 73, 86,
- 69, 128, 79, 76, 73, 71, 79, 206, 79, 76, 68, 128, 79, 75, 84, 207, 79,
- 75, 65, 82, 65, 128, 79, 75, 65, 82, 193, 79, 74, 69, 79, 78, 128, 79,
- 73, 76, 128, 79, 72, 77, 128, 79, 72, 205, 79, 72, 128, 79, 71, 79, 78,
- 69, 75, 128, 79, 71, 79, 78, 69, 203, 79, 71, 72, 65, 205, 79, 68, 196,
- 79, 67, 84, 79, 66, 69, 82, 128, 79, 67, 210, 79, 66, 83, 84, 82, 85, 67,
- 84, 73, 79, 78, 128, 79, 66, 79, 76, 211, 79, 66, 79, 204, 79, 66, 79,
- 70, 73, 76, 73, 128, 79, 66, 76, 73, 81, 85, 197, 79, 66, 74, 69, 67,
- 212, 79, 66, 69, 76, 85, 83, 128, 79, 66, 69, 76, 79, 83, 128, 79, 66,
- 128, 79, 65, 89, 128, 79, 65, 75, 128, 79, 65, 66, 79, 65, 70, 73, 76,
- 73, 128, 79, 45, 89, 69, 128, 79, 45, 69, 79, 128, 79, 45, 69, 128, 78,
- 90, 89, 88, 128, 78, 90, 89, 84, 128, 78, 90, 89, 82, 88, 128, 78, 90,
- 89, 82, 128, 78, 90, 89, 80, 128, 78, 90, 89, 128, 78, 90, 85, 88, 128,
- 78, 90, 85, 82, 88, 128, 78, 90, 85, 82, 128, 78, 90, 85, 80, 128, 78,
- 90, 85, 79, 88, 128, 78, 90, 85, 79, 128, 78, 90, 85, 128, 78, 90, 79,
- 88, 128, 78, 90, 79, 80, 128, 78, 90, 73, 88, 128, 78, 90, 73, 84, 128,
- 78, 90, 73, 80, 128, 78, 90, 73, 69, 88, 128, 78, 90, 73, 69, 80, 128,
- 78, 90, 73, 69, 128, 78, 90, 73, 128, 78, 90, 69, 88, 128, 78, 90, 69,
- 128, 78, 90, 65, 88, 128, 78, 90, 65, 84, 128, 78, 90, 65, 80, 128, 78,
- 90, 65, 128, 78, 89, 87, 65, 128, 78, 89, 85, 88, 128, 78, 89, 85, 84,
- 128, 78, 89, 85, 80, 128, 78, 89, 85, 79, 88, 128, 78, 89, 85, 79, 80,
- 128, 78, 89, 85, 79, 128, 78, 89, 85, 128, 78, 89, 79, 88, 128, 78, 89,
- 79, 84, 128, 78, 89, 79, 80, 128, 78, 89, 79, 79, 128, 78, 89, 79, 65,
- 128, 78, 89, 79, 128, 78, 89, 74, 65, 128, 78, 89, 73, 88, 128, 78, 89,
- 73, 84, 128, 78, 89, 73, 211, 78, 89, 73, 80, 128, 78, 89, 73, 78, 45,
- 68, 79, 128, 78, 89, 73, 69, 88, 128, 78, 89, 73, 69, 84, 128, 78, 89,
- 73, 69, 80, 128, 78, 89, 73, 69, 128, 78, 89, 73, 128, 78, 89, 201, 78,
- 89, 69, 212, 78, 89, 69, 72, 128, 78, 89, 69, 200, 78, 89, 69, 69, 128,
- 78, 89, 69, 128, 78, 89, 196, 78, 89, 67, 65, 128, 78, 89, 65, 65, 128,
- 78, 87, 69, 128, 78, 87, 65, 65, 128, 78, 87, 65, 128, 78, 87, 128, 78,
- 86, 128, 78, 85, 88, 128, 78, 85, 85, 78, 128, 78, 85, 84, 73, 76, 76,
- 85, 128, 78, 85, 84, 128, 78, 85, 82, 88, 128, 78, 85, 82, 128, 78, 85,
- 80, 128, 78, 85, 79, 88, 128, 78, 85, 79, 80, 128, 78, 85, 79, 128, 78,
- 85, 78, 85, 90, 128, 78, 85, 78, 85, 218, 78, 85, 78, 65, 86, 85, 212,
- 78, 85, 78, 65, 86, 73, 203, 78, 85, 78, 128, 78, 85, 206, 78, 85, 77,
- 69, 82, 207, 78, 85, 77, 69, 82, 65, 84, 79, 210, 78, 85, 77, 66, 69, 82,
- 128, 78, 85, 77, 128, 78, 85, 76, 76, 128, 78, 85, 76, 204, 78, 85, 75,
- 84, 65, 128, 78, 85, 69, 128, 78, 85, 66, 73, 65, 206, 78, 85, 49, 49,
- 128, 78, 82, 89, 88, 128, 78, 82, 89, 84, 128, 78, 82, 89, 82, 88, 128,
- 78, 82, 89, 82, 128, 78, 82, 89, 80, 128, 78, 82, 89, 128, 78, 82, 85,
- 88, 128, 78, 82, 85, 84, 128, 78, 82, 85, 82, 88, 128, 78, 82, 85, 82,
- 128, 78, 82, 85, 80, 128, 78, 82, 85, 128, 78, 82, 79, 88, 128, 78, 82,
- 79, 80, 128, 78, 82, 79, 128, 78, 82, 69, 88, 128, 78, 82, 69, 84, 128,
- 78, 82, 69, 80, 128, 78, 82, 69, 128, 78, 82, 65, 88, 128, 78, 82, 65,
- 84, 128, 78, 82, 65, 80, 128, 78, 82, 65, 128, 78, 79, 88, 128, 78, 79,
- 87, 128, 78, 79, 86, 69, 77, 66, 69, 82, 128, 78, 79, 84, 84, 79, 128,
- 78, 79, 84, 69, 83, 128, 78, 79, 84, 69, 72, 69, 65, 68, 128, 78, 79, 84,
- 69, 72, 69, 65, 196, 78, 79, 84, 69, 128, 78, 79, 84, 197, 78, 79, 84,
- 67, 72, 69, 196, 78, 79, 84, 67, 72, 128, 78, 79, 84, 128, 78, 79, 83,
- 69, 128, 78, 79, 82, 84, 72, 87, 69, 83, 212, 78, 79, 82, 84, 200, 78,
- 79, 82, 77, 65, 204, 78, 79, 210, 78, 79, 80, 128, 78, 79, 79, 78, 85,
- 128, 78, 79, 79, 128, 78, 79, 78, 70, 79, 82, 75, 73, 78, 71, 128, 78,
- 79, 78, 45, 74, 79, 73, 78, 69, 82, 128, 78, 79, 78, 45, 66, 82, 69, 65,
- 75, 73, 78, 199, 78, 79, 77, 73, 78, 65, 204, 78, 79, 75, 72, 85, 75,
- 128, 78, 79, 68, 69, 128, 78, 79, 65, 128, 78, 79, 45, 66, 82, 69, 65,
- 203, 78, 78, 79, 128, 78, 78, 78, 65, 128, 78, 78, 71, 79, 79, 128, 78,
- 78, 71, 79, 128, 78, 78, 71, 73, 73, 128, 78, 78, 71, 73, 128, 78, 78,
- 71, 65, 65, 128, 78, 78, 71, 65, 128, 78, 78, 71, 128, 78, 77, 128, 78,
- 74, 89, 88, 128, 78, 74, 89, 84, 128, 78, 74, 89, 82, 88, 128, 78, 74,
- 89, 82, 128, 78, 74, 89, 80, 128, 78, 74, 89, 128, 78, 74, 85, 88, 128,
- 78, 74, 85, 82, 88, 128, 78, 74, 85, 82, 128, 78, 74, 85, 80, 128, 78,
- 74, 85, 79, 88, 128, 78, 74, 85, 79, 128, 78, 74, 85, 128, 78, 74, 79,
- 88, 128, 78, 74, 79, 84, 128, 78, 74, 79, 80, 128, 78, 74, 79, 79, 128,
- 78, 74, 79, 128, 78, 74, 73, 88, 128, 78, 74, 73, 84, 128, 78, 74, 73,
- 80, 128, 78, 74, 73, 69, 88, 128, 78, 74, 73, 69, 84, 128, 78, 74, 73,
- 69, 80, 128, 78, 74, 73, 69, 128, 78, 74, 73, 128, 78, 74, 69, 69, 128,
- 78, 74, 69, 128, 78, 74, 128, 78, 73, 88, 128, 78, 73, 83, 65, 71, 128,
- 78, 73, 82, 85, 71, 85, 128, 78, 73, 80, 128, 78, 73, 78, 69, 84, 89,
- 128, 78, 73, 78, 69, 84, 217, 78, 73, 78, 69, 84, 69, 69, 78, 128, 78,
- 73, 78, 69, 84, 69, 69, 206, 78, 73, 78, 197, 78, 73, 78, 68, 65, 50,
- 128, 78, 73, 78, 68, 65, 178, 78, 73, 77, 128, 78, 73, 205, 78, 73, 75,
- 72, 65, 72, 73, 84, 128, 78, 73, 75, 65, 72, 73, 84, 128, 78, 73, 73,
- 128, 78, 73, 71, 73, 68, 65, 77, 73, 78, 128, 78, 73, 71, 73, 68, 65, 69,
- 83, 72, 128, 78, 73, 71, 72, 84, 128, 78, 73, 71, 71, 65, 72, 73, 84, 65,
- 128, 78, 73, 69, 88, 128, 78, 73, 69, 85, 78, 45, 84, 73, 75, 69, 85, 84,
- 128, 78, 73, 69, 85, 78, 45, 84, 72, 73, 69, 85, 84, 72, 128, 78, 73, 69,
- 85, 78, 45, 83, 73, 79, 83, 128, 78, 73, 69, 85, 78, 45, 80, 73, 69, 85,
- 80, 128, 78, 73, 69, 85, 78, 45, 80, 65, 78, 83, 73, 79, 83, 128, 78, 73,
- 69, 85, 78, 45, 75, 73, 89, 69, 79, 75, 128, 78, 73, 69, 85, 78, 45, 72,
- 73, 69, 85, 72, 128, 78, 73, 69, 85, 78, 45, 67, 73, 69, 85, 67, 128, 78,
- 73, 69, 85, 206, 78, 73, 69, 80, 128, 78, 73, 69, 128, 78, 73, 66, 128,
- 78, 73, 65, 128, 78, 73, 50, 128, 78, 72, 85, 69, 128, 78, 72, 74, 65,
- 128, 78, 72, 65, 128, 78, 72, 128, 78, 71, 85, 79, 88, 128, 78, 71, 85,
- 79, 84, 128, 78, 71, 85, 79, 128, 78, 71, 79, 88, 128, 78, 71, 79, 84,
- 128, 78, 71, 79, 80, 128, 78, 71, 79, 78, 128, 78, 71, 79, 69, 72, 128,
- 78, 71, 79, 69, 200, 78, 71, 207, 78, 71, 75, 65, 128, 78, 71, 73, 69,
- 88, 128, 78, 71, 73, 69, 80, 128, 78, 71, 73, 69, 128, 78, 71, 71, 85,
- 128, 78, 71, 71, 79, 79, 128, 78, 71, 71, 79, 128, 78, 71, 71, 73, 128,
- 78, 71, 71, 69, 78, 128, 78, 71, 71, 69, 69, 128, 78, 71, 71, 69, 128,
- 78, 71, 71, 65, 128, 78, 71, 71, 128, 78, 71, 69, 88, 128, 78, 71, 69,
- 80, 128, 78, 71, 69, 78, 128, 78, 71, 69, 65, 68, 65, 76, 128, 78, 71,
- 69, 128, 78, 71, 65, 88, 128, 78, 71, 65, 84, 128, 78, 71, 65, 211, 78,
- 71, 65, 80, 128, 78, 71, 65, 78, 128, 78, 71, 65, 73, 128, 78, 71, 65,
- 65, 73, 128, 78, 71, 193, 78, 70, 128, 78, 69, 88, 212, 78, 69, 88, 128,
- 78, 69, 87, 76, 73, 78, 69, 128, 78, 69, 85, 84, 82, 65, 204, 78, 69, 85,
- 84, 69, 82, 128, 78, 69, 84, 128, 78, 69, 212, 78, 69, 83, 84, 69, 196,
- 78, 69, 80, 84, 85, 78, 69, 128, 78, 69, 80, 128, 78, 69, 79, 128, 78,
- 69, 207, 78, 69, 78, 65, 78, 79, 128, 78, 69, 78, 128, 78, 69, 73, 84,
- 72, 69, 210, 78, 69, 71, 65, 84, 73, 86, 197, 78, 69, 71, 65, 84, 73, 79,
- 206, 78, 69, 71, 65, 84, 69, 196, 78, 69, 69, 128, 78, 69, 66, 69, 78,
- 83, 84, 73, 77, 77, 69, 128, 78, 68, 85, 88, 128, 78, 68, 85, 84, 128,
- 78, 68, 85, 82, 88, 128, 78, 68, 85, 82, 128, 78, 68, 85, 80, 128, 78,
- 68, 79, 88, 128, 78, 68, 79, 84, 128, 78, 68, 79, 80, 128, 78, 68, 79,
- 79, 128, 78, 68, 79, 76, 197, 78, 68, 73, 88, 128, 78, 68, 73, 84, 128,
- 78, 68, 73, 80, 128, 78, 68, 73, 69, 88, 128, 78, 68, 73, 69, 128, 78,
- 68, 73, 128, 78, 68, 69, 88, 128, 78, 68, 69, 80, 128, 78, 68, 69, 69,
- 128, 78, 68, 69, 128, 78, 68, 65, 88, 128, 78, 68, 65, 84, 128, 78, 68,
- 65, 80, 128, 78, 66, 89, 88, 128, 78, 66, 89, 84, 128, 78, 66, 89, 82,
- 88, 128, 78, 66, 89, 82, 128, 78, 66, 89, 80, 128, 78, 66, 89, 128, 78,
- 66, 85, 88, 128, 78, 66, 85, 84, 128, 78, 66, 85, 82, 88, 128, 78, 66,
- 85, 82, 128, 78, 66, 85, 80, 128, 78, 66, 85, 128, 78, 66, 79, 88, 128,
- 78, 66, 79, 84, 128, 78, 66, 79, 80, 128, 78, 66, 79, 128, 78, 66, 73,
- 88, 128, 78, 66, 73, 84, 128, 78, 66, 73, 80, 128, 78, 66, 73, 69, 88,
- 128, 78, 66, 73, 69, 80, 128, 78, 66, 73, 69, 128, 78, 66, 73, 128, 78,
- 66, 65, 88, 128, 78, 66, 65, 84, 128, 78, 66, 65, 80, 128, 78, 66, 65,
- 128, 78, 65, 89, 65, 78, 78, 65, 128, 78, 65, 88, 73, 65, 206, 78, 65,
- 88, 128, 78, 65, 85, 84, 72, 83, 128, 78, 65, 85, 68, 73, 218, 78, 65,
- 84, 85, 82, 65, 204, 78, 65, 84, 73, 79, 78, 65, 204, 78, 65, 83, 75, 65,
- 80, 201, 78, 65, 83, 72, 73, 128, 78, 65, 83, 65, 76, 73, 90, 65, 84, 73,
- 79, 206, 78, 65, 82, 82, 79, 215, 78, 65, 82, 128, 78, 65, 80, 128, 78,
- 65, 79, 211, 78, 65, 78, 71, 77, 79, 78, 84, 72, 79, 128, 78, 65, 78, 68,
- 128, 78, 65, 78, 65, 128, 78, 65, 77, 69, 128, 78, 65, 77, 197, 78, 65,
- 77, 50, 128, 78, 65, 77, 128, 78, 65, 73, 82, 193, 78, 65, 71, 82, 201,
- 78, 65, 71, 65, 82, 128, 78, 65, 71, 65, 128, 78, 65, 71, 193, 78, 65,
- 71, 128, 78, 65, 199, 78, 65, 66, 76, 65, 128, 78, 65, 65, 83, 73, 75,
- 89, 65, 89, 65, 128, 78, 65, 65, 75, 83, 73, 75, 89, 65, 89, 65, 128, 78,
- 65, 65, 73, 128, 78, 65, 65, 128, 78, 65, 193, 78, 65, 50, 128, 78, 45,
- 67, 82, 69, 197, 78, 45, 65, 82, 217, 77, 89, 88, 128, 77, 89, 84, 128,
- 77, 89, 83, 76, 73, 84, 69, 128, 77, 89, 80, 128, 77, 89, 65, 128, 77,
- 89, 128, 77, 87, 79, 79, 128, 77, 87, 79, 128, 77, 87, 73, 73, 128, 77,
- 87, 73, 128, 77, 87, 69, 69, 128, 77, 87, 69, 128, 77, 87, 65, 65, 128,
- 77, 87, 65, 128, 77, 87, 128, 77, 215, 77, 86, 128, 77, 214, 77, 85, 88,
- 128, 77, 85, 85, 83, 73, 75, 65, 84, 79, 65, 78, 128, 77, 85, 85, 82, 68,
- 72, 65, 74, 193, 77, 85, 84, 128, 77, 85, 83, 73, 67, 128, 77, 85, 83,
- 73, 195, 77, 85, 83, 72, 51, 128, 77, 85, 83, 72, 179, 77, 85, 83, 72,
- 128, 77, 85, 83, 200, 77, 85, 82, 88, 128, 77, 85, 82, 71, 85, 50, 128,
- 77, 85, 82, 68, 193, 77, 85, 82, 128, 77, 85, 81, 68, 65, 77, 128, 77,
- 85, 80, 128, 77, 85, 79, 88, 128, 77, 85, 79, 84, 128, 77, 85, 79, 80,
- 128, 77, 85, 79, 128, 77, 85, 78, 83, 85, 66, 128, 77, 85, 78, 65, 72,
- 128, 77, 85, 76, 84, 73, 83, 69, 84, 128, 77, 85, 76, 84, 73, 83, 69,
- 212, 77, 85, 76, 84, 73, 80, 76, 73, 67, 65, 84, 73, 79, 78, 128, 77, 85,
- 76, 84, 73, 80, 76, 73, 67, 65, 84, 73, 79, 206, 77, 85, 76, 84, 73, 80,
- 76, 197, 77, 85, 76, 84, 73, 79, 67, 85, 76, 65, 210, 77, 85, 76, 84, 73,
- 77, 65, 80, 128, 77, 85, 76, 84, 201, 77, 85, 75, 80, 72, 82, 69, 78, 71,
- 128, 77, 85, 73, 78, 128, 77, 85, 71, 128, 77, 85, 199, 77, 85, 69, 128,
- 77, 85, 67, 200, 77, 85, 67, 65, 65, 68, 128, 77, 85, 65, 78, 128, 77,
- 85, 45, 71, 65, 65, 72, 76, 65, 193, 77, 213, 77, 83, 128, 77, 80, 65,
- 128, 77, 79, 88, 128, 77, 79, 86, 69, 196, 77, 79, 85, 84, 72, 128, 77,
- 79, 85, 84, 200, 77, 79, 85, 78, 84, 65, 73, 78, 128, 77, 79, 85, 78, 68,
- 128, 77, 79, 85, 78, 196, 77, 79, 84, 72, 69, 82, 128, 77, 79, 84, 128,
- 77, 79, 82, 84, 65, 82, 128, 77, 79, 82, 80, 72, 79, 76, 79, 71, 73, 67,
- 65, 204, 77, 79, 82, 78, 73, 78, 71, 128, 77, 79, 80, 128, 77, 79, 79,
- 83, 69, 45, 67, 82, 69, 197, 77, 79, 79, 78, 128, 77, 79, 79, 206, 77,
- 79, 79, 128, 77, 79, 78, 84, 72, 128, 77, 79, 78, 84, 200, 77, 79, 78,
- 79, 83, 84, 65, 66, 76, 197, 77, 79, 78, 79, 71, 82, 65, 80, 200, 77, 79,
+ 76, 197, 82, 69, 67, 82, 69, 65, 84, 73, 79, 78, 65, 204, 82, 69, 67, 79,
+ 82, 68, 73, 78, 199, 82, 69, 67, 79, 82, 68, 69, 82, 128, 82, 69, 67, 79,
+ 82, 196, 82, 69, 67, 69, 80, 84, 73, 86, 197, 82, 69, 67, 69, 73, 86, 69,
+ 82, 128, 82, 69, 65, 76, 71, 65, 82, 45, 50, 128, 82, 69, 65, 76, 71, 65,
+ 82, 128, 82, 69, 65, 72, 77, 85, 75, 128, 82, 69, 65, 67, 72, 128, 82,
+ 68, 207, 82, 68, 69, 204, 82, 66, 65, 83, 193, 82, 65, 89, 83, 128, 82,
+ 65, 89, 65, 78, 78, 65, 128, 82, 65, 84, 73, 79, 128, 82, 65, 84, 72, 65,
+ 128, 82, 65, 84, 72, 193, 82, 65, 84, 65, 128, 82, 65, 84, 128, 82, 65,
+ 83, 87, 65, 68, 73, 128, 82, 65, 83, 79, 85, 204, 82, 65, 83, 72, 65,
+ 128, 82, 65, 81, 128, 82, 65, 80, 73, 83, 77, 65, 128, 82, 65, 78, 71,
+ 197, 82, 65, 78, 65, 128, 82, 65, 78, 128, 82, 65, 77, 211, 82, 65, 77,
+ 66, 65, 84, 128, 82, 65, 75, 72, 65, 78, 71, 128, 82, 65, 73, 83, 73, 78,
+ 199, 82, 65, 73, 83, 69, 196, 82, 65, 73, 78, 66, 79, 87, 128, 82, 65,
+ 73, 76, 87, 65, 89, 128, 82, 65, 73, 76, 87, 65, 217, 82, 65, 73, 76,
+ 128, 82, 65, 73, 68, 207, 82, 65, 73, 68, 65, 128, 82, 65, 73, 128, 82,
+ 65, 72, 77, 65, 84, 85, 76, 76, 65, 200, 82, 65, 70, 69, 128, 82, 65, 69,
+ 77, 128, 82, 65, 68, 73, 79, 65, 67, 84, 73, 86, 197, 82, 65, 68, 73, 79,
+ 128, 82, 65, 68, 73, 207, 82, 65, 68, 201, 82, 65, 68, 128, 82, 65, 196,
+ 82, 65, 67, 81, 85, 69, 212, 82, 65, 67, 73, 78, 71, 128, 82, 65, 66, 66,
+ 73, 84, 128, 82, 65, 66, 66, 73, 212, 82, 65, 66, 128, 82, 65, 65, 73,
+ 128, 82, 65, 65, 128, 82, 65, 51, 128, 82, 65, 50, 128, 82, 48, 50, 57,
+ 128, 82, 48, 50, 56, 128, 82, 48, 50, 55, 128, 82, 48, 50, 54, 128, 82,
+ 48, 50, 53, 128, 82, 48, 50, 52, 128, 82, 48, 50, 51, 128, 82, 48, 50,
+ 50, 128, 82, 48, 50, 49, 128, 82, 48, 50, 48, 128, 82, 48, 49, 57, 128,
+ 82, 48, 49, 56, 128, 82, 48, 49, 55, 128, 82, 48, 49, 54, 65, 128, 82,
+ 48, 49, 54, 128, 82, 48, 49, 53, 128, 82, 48, 49, 52, 128, 82, 48, 49,
+ 51, 128, 82, 48, 49, 50, 128, 82, 48, 49, 49, 128, 82, 48, 49, 48, 65,
+ 128, 82, 48, 49, 48, 128, 82, 48, 48, 57, 128, 82, 48, 48, 56, 128, 82,
+ 48, 48, 55, 128, 82, 48, 48, 54, 128, 82, 48, 48, 53, 128, 82, 48, 48,
+ 52, 128, 82, 48, 48, 51, 66, 128, 82, 48, 48, 51, 65, 128, 82, 48, 48,
+ 51, 128, 82, 48, 48, 50, 65, 128, 82, 48, 48, 50, 128, 82, 48, 48, 49,
+ 128, 82, 45, 67, 82, 69, 197, 81, 89, 88, 128, 81, 89, 85, 128, 81, 89,
+ 84, 128, 81, 89, 82, 88, 128, 81, 89, 82, 128, 81, 89, 80, 128, 81, 89,
+ 79, 128, 81, 89, 73, 128, 81, 89, 69, 69, 128, 81, 89, 69, 128, 81, 89,
+ 65, 65, 128, 81, 89, 65, 128, 81, 89, 128, 81, 87, 73, 128, 81, 87, 69,
+ 69, 128, 81, 87, 69, 128, 81, 87, 65, 65, 128, 81, 87, 65, 128, 81, 85,
+ 88, 128, 81, 85, 86, 128, 81, 85, 85, 86, 128, 81, 85, 85, 128, 81, 85,
+ 84, 128, 81, 85, 83, 72, 83, 72, 65, 89, 65, 128, 81, 85, 82, 88, 128,
+ 81, 85, 82, 128, 81, 85, 80, 128, 81, 85, 79, 88, 128, 81, 85, 79, 84,
+ 197, 81, 85, 79, 84, 65, 84, 73, 79, 206, 81, 85, 79, 84, 128, 81, 85,
+ 79, 80, 128, 81, 85, 79, 128, 81, 85, 75, 128, 81, 85, 73, 78, 84, 69,
+ 83, 83, 69, 78, 67, 69, 128, 81, 85, 73, 78, 68, 73, 67, 69, 83, 73, 77,
+ 193, 81, 85, 73, 78, 67, 85, 78, 88, 128, 81, 85, 73, 78, 65, 82, 73, 85,
+ 211, 81, 85, 73, 76, 76, 128, 81, 85, 73, 67, 203, 81, 85, 73, 128, 81,
+ 85, 70, 128, 81, 85, 69, 83, 84, 73, 79, 78, 69, 196, 81, 85, 69, 83, 84,
+ 73, 79, 78, 128, 81, 85, 69, 83, 84, 73, 79, 206, 81, 85, 69, 69, 78,
+ 128, 81, 85, 69, 69, 206, 81, 85, 69, 128, 81, 85, 66, 85, 84, 83, 128,
+ 81, 85, 65, 84, 69, 82, 78, 73, 79, 206, 81, 85, 65, 82, 84, 69, 82, 83,
+ 128, 81, 85, 65, 82, 84, 69, 82, 211, 81, 85, 65, 82, 84, 69, 82, 128,
+ 81, 85, 65, 82, 84, 69, 210, 81, 85, 65, 78, 84, 73, 84, 217, 81, 85, 65,
+ 68, 82, 85, 80, 76, 197, 81, 85, 65, 68, 82, 65, 78, 84, 128, 81, 85, 65,
+ 68, 82, 65, 78, 212, 81, 85, 65, 68, 128, 81, 85, 65, 196, 81, 85, 65,
+ 128, 81, 85, 128, 81, 208, 81, 79, 88, 128, 81, 79, 84, 128, 81, 79, 80,
+ 72, 128, 81, 79, 80, 65, 128, 81, 79, 80, 128, 81, 79, 79, 128, 81, 79,
+ 207, 81, 79, 70, 128, 81, 79, 198, 81, 79, 65, 128, 81, 79, 128, 81, 78,
+ 128, 81, 73, 88, 128, 81, 73, 84, 83, 65, 128, 81, 73, 84, 128, 81, 73,
+ 80, 128, 81, 73, 73, 128, 81, 73, 69, 88, 128, 81, 73, 69, 84, 128, 81,
+ 73, 69, 80, 128, 81, 73, 69, 128, 81, 73, 128, 81, 72, 87, 73, 128, 81,
+ 72, 87, 69, 69, 128, 81, 72, 87, 69, 128, 81, 72, 87, 65, 65, 128, 81,
+ 72, 87, 65, 128, 81, 72, 85, 128, 81, 72, 79, 128, 81, 72, 73, 128, 81,
+ 72, 69, 69, 128, 81, 72, 69, 128, 81, 72, 65, 65, 128, 81, 72, 65, 128,
+ 81, 69, 84, 65, 78, 65, 128, 81, 69, 69, 128, 81, 69, 128, 81, 65, 85,
+ 128, 81, 65, 84, 65, 78, 128, 81, 65, 82, 78, 69, 217, 81, 65, 82, 128,
+ 81, 65, 81, 128, 81, 65, 80, 72, 128, 81, 65, 77, 65, 84, 83, 128, 81,
+ 65, 77, 65, 84, 211, 81, 65, 76, 193, 81, 65, 73, 82, 84, 72, 82, 65,
+ 128, 81, 65, 73, 128, 81, 65, 70, 128, 81, 65, 198, 81, 65, 68, 77, 65,
+ 128, 81, 65, 65, 73, 128, 81, 65, 65, 70, 85, 128, 81, 65, 65, 70, 128,
+ 81, 48, 48, 55, 128, 81, 48, 48, 54, 128, 81, 48, 48, 53, 128, 81, 48,
+ 48, 52, 128, 81, 48, 48, 51, 128, 81, 48, 48, 50, 128, 81, 48, 48, 49,
+ 128, 80, 90, 128, 80, 89, 88, 128, 80, 89, 84, 128, 80, 89, 82, 88, 128,
+ 80, 89, 82, 128, 80, 89, 80, 128, 80, 89, 128, 80, 87, 79, 89, 128, 80,
+ 87, 79, 79, 128, 80, 87, 79, 128, 80, 87, 207, 80, 87, 73, 73, 128, 80,
+ 87, 73, 128, 80, 87, 69, 69, 128, 80, 87, 69, 128, 80, 87, 65, 65, 128,
+ 80, 87, 128, 80, 86, 128, 80, 85, 88, 128, 80, 85, 85, 84, 128, 80, 85,
+ 84, 82, 69, 70, 65, 67, 84, 73, 79, 78, 128, 80, 85, 84, 128, 80, 85,
+ 212, 80, 85, 83, 72, 80, 73, 78, 128, 80, 85, 83, 72, 80, 73, 75, 65,
+ 128, 80, 85, 83, 72, 73, 78, 199, 80, 85, 82, 88, 128, 80, 85, 82, 83,
+ 69, 128, 80, 85, 82, 80, 76, 197, 80, 85, 82, 73, 84, 89, 128, 80, 85,
+ 82, 73, 70, 89, 128, 80, 85, 82, 128, 80, 85, 81, 128, 80, 85, 80, 128,
+ 80, 85, 79, 88, 128, 80, 85, 79, 80, 128, 80, 85, 79, 128, 80, 85, 78,
+ 71, 65, 65, 77, 128, 80, 85, 78, 71, 128, 80, 85, 78, 67, 84, 85, 65, 84,
+ 73, 79, 78, 128, 80, 85, 78, 67, 84, 85, 65, 84, 73, 79, 206, 80, 85, 77,
+ 80, 128, 80, 85, 77, 128, 80, 85, 69, 128, 80, 85, 66, 76, 73, 195, 80,
+ 85, 65, 81, 128, 80, 85, 65, 69, 128, 80, 85, 50, 128, 80, 85, 128, 80,
+ 84, 72, 65, 72, 193, 80, 84, 69, 128, 80, 83, 73, 76, 201, 80, 83, 73,
+ 70, 73, 83, 84, 79, 83, 89, 78, 65, 71, 77, 65, 128, 80, 83, 73, 70, 73,
+ 83, 84, 79, 80, 65, 82, 65, 75, 65, 76, 69, 83, 77, 65, 128, 80, 83, 73,
+ 70, 73, 83, 84, 79, 206, 80, 83, 73, 70, 73, 83, 84, 79, 76, 89, 71, 73,
+ 83, 77, 65, 128, 80, 83, 73, 128, 80, 83, 128, 80, 82, 79, 86, 69, 128,
+ 80, 82, 79, 84, 79, 86, 65, 82, 89, 211, 80, 82, 79, 84, 79, 211, 80, 82,
+ 79, 83, 71, 69, 71, 82, 65, 77, 77, 69, 78, 73, 128, 80, 82, 79, 80, 79,
+ 82, 84, 73, 79, 78, 65, 204, 80, 82, 79, 80, 79, 82, 84, 73, 79, 78, 128,
+ 80, 82, 79, 80, 69, 82, 84, 217, 80, 82, 79, 80, 69, 76, 76, 69, 210, 80,
+ 82, 79, 79, 70, 128, 80, 82, 79, 76, 79, 78, 71, 69, 196, 80, 82, 79, 76,
+ 65, 84, 73, 79, 78, 197, 80, 82, 79, 74, 69, 67, 84, 73, 86, 69, 128, 80,
+ 82, 79, 74, 69, 67, 84, 73, 79, 78, 128, 80, 82, 79, 71, 82, 69, 83, 83,
+ 128, 80, 82, 79, 70, 79, 85, 78, 68, 128, 80, 82, 79, 68, 85, 67, 84,
+ 128, 80, 82, 79, 68, 85, 67, 212, 80, 82, 73, 86, 65, 84, 69, 128, 80,
+ 82, 73, 83, 72, 84, 72, 65, 77, 65, 84, 82, 193, 80, 82, 73, 78, 84, 83,
+ 128, 80, 82, 73, 78, 84, 128, 80, 82, 73, 78, 212, 80, 82, 73, 78, 67,
+ 69, 83, 83, 128, 80, 82, 73, 77, 69, 128, 80, 82, 73, 77, 197, 80, 82,
+ 69, 86, 73, 79, 85, 211, 80, 82, 69, 83, 69, 78, 84, 65, 84, 73, 79, 206,
+ 80, 82, 69, 83, 67, 82, 73, 80, 84, 73, 79, 206, 80, 82, 69, 80, 79, 78,
+ 68, 69, 82, 65, 78, 67, 69, 128, 80, 82, 69, 78, 75, 72, 65, 128, 80, 82,
+ 69, 70, 65, 67, 197, 80, 82, 69, 67, 73, 80, 73, 84, 65, 84, 69, 128, 80,
+ 82, 69, 67, 69, 68, 73, 78, 199, 80, 82, 69, 67, 69, 68, 69, 83, 128, 80,
+ 82, 69, 67, 69, 68, 69, 211, 80, 82, 69, 67, 69, 68, 69, 196, 80, 82, 69,
+ 67, 69, 68, 69, 128, 80, 82, 69, 67, 69, 68, 197, 80, 82, 65, 77, 45, 80,
+ 73, 73, 128, 80, 82, 65, 77, 45, 80, 73, 201, 80, 82, 65, 77, 45, 77, 85,
+ 79, 89, 128, 80, 82, 65, 77, 45, 77, 85, 79, 217, 80, 82, 65, 77, 45, 66,
+ 85, 79, 78, 128, 80, 82, 65, 77, 45, 66, 85, 79, 206, 80, 82, 65, 77, 45,
+ 66, 69, 73, 128, 80, 82, 65, 77, 45, 66, 69, 201, 80, 82, 65, 77, 128,
+ 80, 82, 65, 205, 80, 82, 128, 80, 80, 86, 128, 80, 80, 77, 128, 80, 80,
+ 65, 128, 80, 79, 89, 128, 80, 79, 88, 128, 80, 79, 87, 69, 82, 211, 80,
+ 79, 87, 69, 82, 128, 80, 79, 87, 68, 69, 82, 69, 196, 80, 79, 87, 68, 69,
+ 82, 128, 80, 79, 85, 78, 196, 80, 79, 85, 76, 84, 82, 217, 80, 79, 85,
+ 67, 72, 128, 80, 79, 84, 65, 84, 79, 128, 80, 79, 84, 65, 66, 76, 197,
+ 80, 79, 212, 80, 79, 83, 84, 80, 79, 83, 73, 84, 73, 79, 206, 80, 79, 83,
+ 84, 66, 79, 88, 128, 80, 79, 83, 84, 65, 204, 80, 79, 83, 84, 128, 80,
+ 79, 83, 212, 80, 79, 83, 83, 69, 83, 83, 73, 79, 78, 128, 80, 79, 82, 82,
+ 69, 67, 84, 85, 83, 128, 80, 79, 82, 82, 69, 67, 84, 85, 211, 80, 79, 80,
+ 80, 69, 82, 128, 80, 79, 80, 128, 80, 79, 208, 80, 79, 79, 68, 76, 69,
+ 128, 80, 79, 79, 128, 80, 79, 78, 68, 79, 128, 80, 79, 206, 80, 79, 76,
+ 73, 83, 72, 128, 80, 79, 76, 73, 67, 197, 80, 79, 76, 201, 80, 79, 76,
+ 69, 128, 80, 79, 76, 197, 80, 79, 75, 82, 89, 84, 73, 69, 128, 80, 79,
+ 75, 79, 74, 73, 128, 80, 79, 73, 78, 84, 211, 80, 79, 73, 78, 84, 79,
+ 128, 80, 79, 73, 78, 84, 69, 82, 128, 80, 79, 73, 78, 84, 69, 196, 80,
+ 79, 73, 78, 84, 128, 80, 79, 73, 78, 212, 80, 79, 69, 84, 82, 217, 80,
+ 79, 69, 84, 73, 195, 80, 79, 68, 65, 84, 85, 83, 128, 80, 79, 65, 128,
+ 80, 79, 128, 80, 207, 80, 78, 69, 85, 77, 65, 84, 65, 128, 80, 76, 85,
+ 84, 79, 128, 80, 76, 85, 83, 45, 77, 73, 78, 85, 211, 80, 76, 85, 83,
+ 128, 80, 76, 85, 82, 65, 76, 128, 80, 76, 85, 77, 69, 196, 80, 76, 85,
+ 77, 128, 80, 76, 85, 75, 128, 80, 76, 85, 71, 128, 80, 76, 79, 87, 128,
+ 80, 76, 79, 80, 72, 85, 128, 80, 76, 69, 84, 72, 82, 79, 78, 128, 80, 76,
+ 65, 89, 73, 78, 199, 80, 76, 65, 83, 84, 73, 67, 83, 128, 80, 76, 65, 78,
+ 69, 128, 80, 76, 65, 78, 197, 80, 76, 65, 78, 67, 203, 80, 76, 65, 75,
+ 128, 80, 76, 65, 71, 73, 79, 211, 80, 76, 65, 67, 69, 72, 79, 76, 68, 69,
+ 210, 80, 76, 65, 67, 197, 80, 76, 65, 128, 80, 73, 90, 90, 73, 67, 65,
+ 84, 79, 128, 80, 73, 90, 90, 65, 128, 80, 73, 88, 128, 80, 73, 87, 82,
+ 128, 80, 73, 84, 67, 72, 70, 79, 82, 75, 128, 80, 73, 84, 67, 72, 70, 79,
+ 82, 203, 80, 73, 84, 128, 80, 73, 83, 84, 79, 76, 128, 80, 73, 83, 69,
+ 76, 69, 72, 128, 80, 73, 83, 67, 69, 83, 128, 80, 73, 82, 73, 71, 128,
+ 80, 73, 82, 73, 199, 80, 73, 82, 73, 69, 69, 78, 128, 80, 73, 80, 73, 78,
+ 71, 128, 80, 73, 80, 65, 69, 77, 71, 66, 73, 69, 69, 128, 80, 73, 80, 65,
+ 69, 77, 66, 65, 128, 80, 73, 80, 128, 80, 73, 78, 87, 72, 69, 69, 204,
+ 80, 73, 78, 69, 65, 80, 80, 76, 69, 128, 80, 73, 78, 197, 80, 73, 78, 65,
+ 82, 66, 79, 82, 65, 83, 128, 80, 73, 76, 76, 128, 80, 73, 76, 197, 80,
+ 73, 76, 67, 82, 79, 215, 80, 73, 75, 85, 82, 85, 128, 80, 73, 75, 79,
+ 128, 80, 73, 71, 128, 80, 73, 199, 80, 73, 69, 88, 128, 80, 73, 69, 85,
+ 80, 45, 84, 72, 73, 69, 85, 84, 72, 128, 80, 73, 69, 85, 80, 45, 83, 83,
+ 65, 78, 71, 83, 73, 79, 83, 128, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83,
+ 45, 84, 73, 75, 69, 85, 84, 128, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83,
+ 45, 84, 72, 73, 69, 85, 84, 72, 128, 80, 73, 69, 85, 80, 45, 83, 73, 79,
+ 83, 45, 80, 73, 69, 85, 80, 128, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83,
+ 45, 75, 73, 89, 69, 79, 75, 128, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83,
+ 45, 67, 73, 69, 85, 67, 128, 80, 73, 69, 85, 80, 45, 82, 73, 69, 85, 76,
+ 45, 80, 72, 73, 69, 85, 80, 72, 128, 80, 73, 69, 85, 80, 45, 82, 73, 69,
+ 85, 76, 128, 80, 73, 69, 85, 80, 45, 78, 73, 69, 85, 78, 128, 80, 73, 69,
+ 85, 80, 45, 77, 73, 69, 85, 77, 128, 80, 73, 69, 85, 80, 45, 75, 72, 73,
+ 69, 85, 75, 72, 128, 80, 73, 69, 85, 80, 45, 67, 73, 69, 85, 67, 128, 80,
+ 73, 69, 85, 80, 45, 67, 72, 73, 69, 85, 67, 72, 128, 80, 73, 69, 85, 208,
+ 80, 73, 69, 84, 128, 80, 73, 69, 80, 128, 80, 73, 69, 69, 84, 128, 80,
+ 73, 69, 69, 81, 128, 80, 73, 69, 67, 69, 128, 80, 73, 69, 128, 80, 73,
+ 67, 75, 69, 84, 128, 80, 73, 67, 75, 128, 80, 73, 65, 83, 85, 84, 79, 82,
+ 85, 128, 80, 73, 65, 83, 77, 193, 80, 73, 65, 78, 79, 128, 80, 201, 80,
+ 72, 87, 65, 128, 80, 72, 85, 84, 72, 65, 79, 128, 80, 72, 85, 210, 80,
+ 72, 85, 78, 71, 128, 80, 72, 82, 65, 83, 69, 128, 80, 72, 79, 78, 69, 83,
+ 128, 80, 72, 79, 69, 78, 73, 67, 73, 65, 206, 80, 72, 79, 65, 128, 80,
+ 72, 79, 128, 80, 72, 207, 80, 72, 78, 65, 69, 203, 80, 72, 73, 78, 84,
+ 72, 85, 128, 80, 72, 73, 76, 79, 83, 79, 80, 72, 69, 82, 211, 80, 72, 73,
+ 76, 73, 80, 80, 73, 78, 197, 80, 72, 73, 69, 85, 80, 72, 45, 84, 72, 73,
+ 69, 85, 84, 72, 128, 80, 72, 73, 69, 85, 80, 72, 45, 83, 73, 79, 83, 128,
+ 80, 72, 73, 69, 85, 80, 72, 45, 80, 73, 69, 85, 80, 128, 80, 72, 73, 69,
+ 85, 80, 72, 45, 72, 73, 69, 85, 72, 128, 80, 72, 73, 69, 85, 80, 200, 80,
+ 72, 73, 128, 80, 72, 201, 80, 72, 69, 69, 128, 80, 72, 69, 128, 80, 72,
+ 65, 83, 69, 45, 198, 80, 72, 65, 83, 69, 45, 194, 80, 72, 65, 82, 89, 78,
+ 71, 69, 65, 204, 80, 72, 65, 82, 128, 80, 72, 65, 78, 128, 80, 72, 65,
+ 77, 128, 80, 72, 65, 73, 83, 84, 79, 211, 80, 72, 65, 71, 83, 45, 80,
+ 193, 80, 72, 65, 65, 82, 75, 65, 65, 128, 80, 72, 65, 65, 128, 80, 72,
+ 65, 128, 80, 71, 128, 80, 70, 128, 80, 69, 85, 88, 128, 80, 69, 85, 84,
+ 65, 69, 128, 80, 69, 85, 84, 128, 80, 69, 84, 65, 83, 84, 79, 75, 79, 85,
+ 70, 73, 83, 77, 65, 128, 80, 69, 84, 65, 83, 84, 73, 128, 80, 69, 84, 65,
+ 83, 77, 65, 128, 80, 69, 84, 65, 76, 76, 69, 196, 80, 69, 83, 79, 128,
+ 80, 69, 83, 207, 80, 69, 83, 72, 50, 128, 80, 69, 83, 69, 84, 193, 80,
+ 69, 211, 80, 69, 82, 84, 72, 207, 80, 69, 82, 83, 80, 69, 67, 84, 73, 86,
+ 69, 128, 80, 69, 82, 83, 79, 78, 65, 204, 80, 69, 82, 83, 79, 78, 128,
+ 80, 69, 82, 83, 79, 206, 80, 69, 82, 83, 73, 65, 206, 80, 69, 82, 83, 69,
+ 86, 69, 82, 73, 78, 199, 80, 69, 82, 80, 69, 78, 68, 73, 67, 85, 76, 65,
+ 82, 128, 80, 69, 82, 80, 69, 78, 68, 73, 67, 85, 76, 65, 210, 80, 69, 82,
+ 77, 65, 78, 69, 78, 212, 80, 69, 82, 73, 83, 80, 79, 77, 69, 78, 73, 128,
+ 80, 69, 82, 73, 83, 80, 79, 77, 69, 78, 201, 80, 69, 82, 70, 79, 82, 77,
+ 73, 78, 199, 80, 69, 82, 70, 69, 67, 84, 85, 205, 80, 69, 82, 70, 69, 67,
+ 84, 65, 128, 80, 69, 82, 70, 69, 67, 84, 193, 80, 69, 82, 67, 85, 83, 83,
+ 73, 86, 69, 128, 80, 69, 82, 67, 69, 78, 212, 80, 69, 80, 69, 84, 128,
+ 80, 69, 80, 69, 212, 80, 69, 79, 82, 84, 200, 80, 69, 79, 80, 76, 69,
+ 128, 80, 69, 78, 84, 65, 83, 69, 77, 69, 128, 80, 69, 78, 84, 65, 71, 82,
+ 65, 77, 128, 80, 69, 78, 84, 65, 71, 79, 78, 128, 80, 69, 78, 83, 85,
+ 128, 80, 69, 78, 83, 73, 86, 197, 80, 69, 78, 78, 217, 80, 69, 78, 73,
+ 72, 73, 128, 80, 69, 78, 71, 85, 73, 78, 128, 80, 69, 78, 71, 75, 65, 76,
+ 128, 80, 69, 78, 69, 84, 82, 65, 84, 73, 79, 78, 128, 80, 69, 78, 67, 73,
+ 76, 128, 80, 69, 76, 65, 83, 84, 79, 78, 128, 80, 69, 76, 65, 83, 84, 79,
+ 206, 80, 69, 73, 84, 72, 128, 80, 69, 72, 69, 72, 128, 80, 69, 72, 69,
+ 200, 80, 69, 72, 128, 80, 69, 200, 80, 69, 69, 90, 73, 128, 80, 69, 69,
+ 83, 72, 73, 128, 80, 69, 69, 80, 128, 80, 69, 69, 77, 128, 80, 69, 69,
+ 128, 80, 69, 68, 69, 83, 84, 82, 73, 65, 78, 83, 128, 80, 69, 68, 69, 83,
+ 84, 82, 73, 65, 78, 128, 80, 69, 68, 69, 83, 84, 65, 76, 128, 80, 69, 68,
+ 69, 83, 84, 65, 204, 80, 69, 68, 65, 204, 80, 69, 65, 67, 72, 128, 80,
+ 69, 65, 67, 69, 128, 80, 69, 65, 67, 197, 80, 68, 128, 80, 67, 128, 80,
+ 65, 90, 69, 82, 128, 80, 65, 89, 69, 82, 79, 75, 128, 80, 65, 89, 65, 78,
+ 78, 65, 128, 80, 65, 89, 128, 80, 65, 88, 128, 80, 65, 87, 78, 128, 80,
+ 65, 215, 80, 65, 86, 73, 89, 65, 78, 73, 128, 80, 65, 84, 84, 69, 82, 78,
+ 128, 80, 65, 84, 72, 65, 77, 65, 83, 65, 84, 128, 80, 65, 84, 200, 80,
+ 65, 84, 65, 75, 128, 80, 65, 84, 65, 72, 128, 80, 65, 84, 128, 80, 65,
+ 83, 85, 81, 128, 80, 65, 83, 83, 80, 79, 82, 212, 80, 65, 83, 83, 73, 86,
+ 69, 45, 80, 85, 76, 76, 45, 85, 80, 45, 79, 85, 84, 80, 85, 212, 80, 65,
+ 83, 83, 73, 86, 69, 45, 80, 85, 76, 76, 45, 68, 79, 87, 78, 45, 79, 85,
+ 84, 80, 85, 212, 80, 65, 83, 72, 84, 65, 128, 80, 65, 83, 72, 65, 69,
+ 128, 80, 65, 83, 69, 81, 128, 80, 65, 82, 85, 77, 128, 80, 65, 82, 84,
+ 217, 80, 65, 82, 84, 78, 69, 82, 83, 72, 73, 208, 80, 65, 82, 84, 73, 65,
+ 76, 76, 89, 45, 82, 69, 67, 89, 67, 76, 69, 196, 80, 65, 82, 84, 73, 65,
+ 204, 80, 65, 82, 84, 72, 73, 65, 206, 80, 65, 82, 212, 80, 65, 82, 73,
+ 67, 72, 79, 78, 128, 80, 65, 82, 69, 83, 84, 73, 71, 77, 69, 78, 79, 206,
+ 80, 65, 82, 69, 82, 69, 78, 128, 80, 65, 82, 69, 78, 84, 72, 69, 83, 73,
+ 83, 128, 80, 65, 82, 69, 78, 84, 72, 69, 83, 73, 211, 80, 65, 82, 65, 80,
+ 72, 82, 65, 83, 197, 80, 65, 82, 65, 76, 76, 69, 76, 79, 71, 82, 65, 77,
+ 128, 80, 65, 82, 65, 76, 76, 69, 76, 128, 80, 65, 82, 65, 76, 76, 69,
+ 204, 80, 65, 82, 65, 75, 76, 73, 84, 73, 75, 73, 128, 80, 65, 82, 65, 75,
+ 76, 73, 84, 73, 75, 201, 80, 65, 82, 65, 75, 65, 76, 69, 83, 77, 193, 80,
+ 65, 82, 65, 71, 82, 65, 80, 72, 79, 83, 128, 80, 65, 82, 65, 71, 82, 65,
+ 80, 72, 128, 80, 65, 82, 65, 71, 82, 65, 80, 200, 80, 65, 82, 65, 128,
+ 80, 65, 82, 128, 80, 65, 80, 89, 82, 85, 83, 128, 80, 65, 80, 69, 82, 67,
+ 76, 73, 80, 128, 80, 65, 80, 69, 210, 80, 65, 80, 128, 80, 65, 208, 80,
+ 65, 207, 80, 65, 78, 89, 85, 75, 85, 128, 80, 65, 78, 89, 73, 75, 85,
+ 128, 80, 65, 78, 89, 69, 67, 69, 75, 128, 80, 65, 78, 89, 65, 78, 71, 71,
+ 65, 128, 80, 65, 78, 89, 65, 75, 82, 65, 128, 80, 65, 78, 84, 73, 128,
+ 80, 65, 78, 83, 73, 79, 83, 45, 80, 73, 69, 85, 80, 128, 80, 65, 78, 83,
+ 73, 79, 83, 45, 75, 65, 80, 89, 69, 79, 85, 78, 80, 73, 69, 85, 80, 128,
+ 80, 65, 78, 79, 78, 71, 79, 78, 65, 78, 128, 80, 65, 78, 79, 76, 79, 78,
+ 71, 128, 80, 65, 78, 71, 87, 73, 83, 65, 68, 128, 80, 65, 78, 71, 82, 65,
+ 78, 71, 75, 69, 80, 128, 80, 65, 78, 71, 79, 76, 65, 84, 128, 80, 65, 78,
+ 71, 76, 65, 89, 65, 82, 128, 80, 65, 78, 71, 75, 79, 78, 128, 80, 65, 78,
+ 71, 75, 65, 84, 128, 80, 65, 78, 71, 72, 85, 76, 85, 128, 80, 65, 78, 71,
+ 128, 80, 65, 78, 69, 85, 76, 69, 85, 78, 71, 128, 80, 65, 78, 68, 193,
+ 80, 65, 78, 65, 69, 76, 65, 69, 78, 71, 128, 80, 65, 78, 128, 80, 65, 77,
+ 85, 78, 71, 75, 65, 72, 128, 80, 65, 77, 85, 68, 80, 79, 68, 128, 80, 65,
+ 77, 83, 72, 65, 69, 128, 80, 65, 77, 80, 72, 89, 76, 73, 65, 206, 80, 65,
+ 77, 73, 78, 71, 75, 65, 76, 128, 80, 65, 77, 69, 80, 69, 84, 128, 80, 65,
+ 77, 69, 78, 69, 78, 71, 128, 80, 65, 77, 65, 68, 65, 128, 80, 65, 77, 65,
+ 65, 69, 72, 128, 80, 65, 76, 85, 84, 65, 128, 80, 65, 76, 79, 67, 72, 75,
+ 65, 128, 80, 65, 76, 205, 80, 65, 76, 76, 65, 87, 65, 128, 80, 65, 76,
+ 76, 65, 83, 128, 80, 65, 76, 69, 84, 84, 69, 128, 80, 65, 76, 65, 85, 78,
+ 199, 80, 65, 76, 65, 84, 65, 76, 73, 90, 69, 196, 80, 65, 76, 65, 84, 65,
+ 76, 73, 90, 65, 84, 73, 79, 78, 128, 80, 65, 76, 65, 84, 65, 204, 80, 65,
+ 75, 80, 65, 203, 80, 65, 73, 89, 65, 78, 78, 79, 73, 128, 80, 65, 73, 82,
+ 84, 72, 82, 65, 128, 80, 65, 73, 82, 69, 196, 80, 65, 72, 76, 65, 86,
+ 201, 80, 65, 71, 69, 82, 128, 80, 65, 71, 197, 80, 65, 68, 77, 193, 80,
+ 65, 68, 193, 80, 65, 68, 128, 80, 65, 67, 75, 73, 78, 71, 128, 80, 65,
+ 67, 75, 65, 71, 69, 128, 80, 65, 65, 84, 85, 128, 80, 65, 65, 83, 69, 78,
+ 84, 79, 128, 80, 65, 65, 82, 65, 69, 128, 80, 65, 65, 77, 128, 80, 65,
+ 65, 73, 128, 80, 65, 65, 45, 80, 73, 76, 76, 65, 128, 80, 65, 65, 128,
+ 80, 50, 128, 80, 48, 49, 49, 128, 80, 48, 49, 48, 128, 80, 48, 48, 57,
+ 128, 80, 48, 48, 56, 128, 80, 48, 48, 55, 128, 80, 48, 48, 54, 128, 80,
+ 48, 48, 53, 128, 80, 48, 48, 52, 128, 80, 48, 48, 51, 65, 128, 80, 48,
+ 48, 51, 128, 80, 48, 48, 50, 128, 80, 48, 48, 49, 65, 128, 80, 48, 48,
+ 49, 128, 79, 89, 82, 65, 78, 73, 83, 77, 193, 79, 89, 65, 78, 78, 65,
+ 128, 79, 88, 73, 65, 128, 79, 88, 73, 193, 79, 88, 69, 73, 65, 201, 79,
+ 88, 69, 73, 193, 79, 86, 69, 82, 82, 73, 68, 69, 128, 79, 86, 69, 82, 76,
+ 79, 78, 199, 79, 86, 69, 82, 76, 73, 78, 69, 128, 79, 86, 69, 82, 76, 65,
+ 89, 128, 79, 86, 69, 82, 76, 65, 80, 80, 73, 78, 199, 79, 86, 69, 82, 76,
+ 65, 73, 68, 128, 79, 86, 69, 82, 66, 65, 82, 128, 79, 86, 65, 204, 79,
+ 86, 128, 79, 85, 84, 76, 73, 78, 69, 196, 79, 85, 84, 76, 73, 78, 69,
+ 128, 79, 85, 84, 69, 210, 79, 85, 84, 66, 79, 216, 79, 85, 78, 75, 73,
+ 193, 79, 85, 78, 67, 69, 128, 79, 85, 78, 67, 197, 79, 84, 85, 128, 79,
+ 84, 84, 65, 86, 193, 79, 84, 84, 128, 79, 84, 72, 65, 76, 65, 206, 79,
+ 84, 72, 65, 76, 128, 79, 83, 77, 65, 78, 89, 193, 79, 82, 84, 72, 79, 71,
+ 79, 78, 65, 204, 79, 82, 84, 72, 79, 68, 79, 216, 79, 82, 78, 65, 84,
+ 197, 79, 82, 78, 65, 77, 69, 78, 84, 128, 79, 82, 78, 65, 77, 69, 78,
+ 212, 79, 82, 75, 72, 79, 206, 79, 82, 73, 71, 73, 78, 65, 204, 79, 82,
+ 73, 71, 73, 78, 128, 79, 82, 69, 45, 50, 128, 79, 82, 68, 73, 78, 65,
+ 204, 79, 82, 67, 72, 73, 68, 128, 79, 82, 65, 78, 71, 197, 79, 80, 84,
+ 73, 79, 206, 79, 80, 84, 73, 67, 65, 204, 79, 80, 80, 82, 69, 83, 83, 73,
+ 79, 78, 128, 79, 80, 80, 79, 83, 73, 84, 73, 79, 78, 128, 79, 80, 80, 79,
+ 83, 73, 78, 199, 79, 80, 80, 79, 83, 69, 128, 79, 80, 72, 73, 85, 67, 72,
+ 85, 83, 128, 79, 80, 69, 82, 65, 84, 79, 82, 128, 79, 80, 69, 82, 65, 84,
+ 79, 210, 79, 80, 69, 78, 73, 78, 199, 79, 80, 69, 78, 45, 80, 128, 79,
+ 80, 69, 78, 45, 79, 85, 84, 76, 73, 78, 69, 196, 79, 80, 69, 78, 45, 72,
+ 69, 65, 68, 69, 196, 79, 80, 69, 78, 45, 67, 73, 82, 67, 85, 73, 84, 45,
+ 79, 85, 84, 80, 85, 212, 79, 80, 69, 206, 79, 79, 90, 69, 128, 79, 79,
+ 89, 65, 78, 78, 65, 128, 79, 79, 85, 128, 79, 79, 77, 85, 128, 79, 79,
+ 69, 128, 79, 79, 66, 79, 79, 70, 73, 76, 73, 128, 79, 78, 85, 128, 79,
+ 78, 83, 85, 128, 79, 78, 78, 128, 79, 78, 75, 65, 82, 128, 79, 78, 69,
+ 83, 69, 76, 70, 128, 79, 78, 69, 45, 87, 65, 217, 79, 78, 69, 45, 84, 72,
+ 73, 82, 84, 89, 128, 79, 78, 69, 45, 76, 73, 78, 197, 79, 78, 67, 79, 77,
+ 73, 78, 199, 79, 78, 65, 80, 128, 79, 77, 73, 83, 83, 73, 79, 206, 79,
+ 77, 73, 67, 82, 79, 78, 128, 79, 77, 73, 67, 82, 79, 206, 79, 77, 69, 71,
+ 65, 128, 79, 77, 69, 71, 193, 79, 77, 65, 76, 79, 78, 128, 79, 76, 73,
+ 86, 69, 128, 79, 76, 73, 71, 79, 206, 79, 76, 68, 128, 79, 75, 84, 207,
+ 79, 75, 65, 82, 65, 128, 79, 75, 65, 82, 193, 79, 74, 73, 66, 87, 65,
+ 217, 79, 74, 69, 79, 78, 128, 79, 73, 76, 128, 79, 72, 77, 128, 79, 72,
+ 205, 79, 72, 128, 79, 71, 82, 69, 128, 79, 71, 79, 78, 69, 75, 128, 79,
+ 71, 79, 78, 69, 203, 79, 71, 72, 65, 205, 79, 70, 70, 73, 67, 69, 82,
+ 128, 79, 70, 70, 73, 67, 69, 128, 79, 70, 70, 73, 67, 197, 79, 70, 70,
+ 128, 79, 69, 75, 128, 79, 68, 69, 78, 128, 79, 68, 196, 79, 67, 84, 79,
+ 80, 85, 83, 128, 79, 67, 84, 79, 66, 69, 82, 128, 79, 67, 210, 79, 67,
+ 76, 79, 67, 75, 128, 79, 67, 67, 76, 85, 83, 73, 79, 78, 128, 79, 66, 83,
+ 84, 82, 85, 67, 84, 73, 79, 78, 128, 79, 66, 79, 76, 211, 79, 66, 79,
+ 204, 79, 66, 79, 70, 73, 76, 73, 128, 79, 66, 76, 73, 81, 85, 197, 79,
+ 66, 74, 69, 67, 212, 79, 66, 69, 76, 85, 83, 128, 79, 66, 69, 76, 79, 83,
+ 128, 79, 66, 128, 79, 65, 89, 128, 79, 65, 75, 128, 79, 65, 66, 79, 65,
+ 70, 73, 76, 73, 128, 79, 193, 79, 48, 53, 49, 128, 79, 48, 53, 48, 66,
+ 128, 79, 48, 53, 48, 65, 128, 79, 48, 53, 48, 128, 79, 48, 52, 57, 128,
+ 79, 48, 52, 56, 128, 79, 48, 52, 55, 128, 79, 48, 52, 54, 128, 79, 48,
+ 52, 53, 128, 79, 48, 52, 52, 128, 79, 48, 52, 51, 128, 79, 48, 52, 50,
+ 128, 79, 48, 52, 49, 128, 79, 48, 52, 48, 128, 79, 48, 51, 57, 128, 79,
+ 48, 51, 56, 128, 79, 48, 51, 55, 128, 79, 48, 51, 54, 68, 128, 79, 48,
+ 51, 54, 67, 128, 79, 48, 51, 54, 66, 128, 79, 48, 51, 54, 65, 128, 79,
+ 48, 51, 54, 128, 79, 48, 51, 53, 128, 79, 48, 51, 52, 128, 79, 48, 51,
+ 51, 65, 128, 79, 48, 51, 51, 128, 79, 48, 51, 50, 128, 79, 48, 51, 49,
+ 128, 79, 48, 51, 48, 65, 128, 79, 48, 51, 48, 128, 79, 48, 50, 57, 65,
+ 128, 79, 48, 50, 57, 128, 79, 48, 50, 56, 128, 79, 48, 50, 55, 128, 79,
+ 48, 50, 54, 128, 79, 48, 50, 53, 65, 128, 79, 48, 50, 53, 128, 79, 48,
+ 50, 52, 65, 128, 79, 48, 50, 52, 128, 79, 48, 50, 51, 128, 79, 48, 50,
+ 50, 128, 79, 48, 50, 49, 128, 79, 48, 50, 48, 65, 128, 79, 48, 50, 48,
+ 128, 79, 48, 49, 57, 65, 128, 79, 48, 49, 57, 128, 79, 48, 49, 56, 128,
+ 79, 48, 49, 55, 128, 79, 48, 49, 54, 128, 79, 48, 49, 53, 128, 79, 48,
+ 49, 52, 128, 79, 48, 49, 51, 128, 79, 48, 49, 50, 128, 79, 48, 49, 49,
+ 128, 79, 48, 49, 48, 67, 128, 79, 48, 49, 48, 66, 128, 79, 48, 49, 48,
+ 65, 128, 79, 48, 49, 48, 128, 79, 48, 48, 57, 128, 79, 48, 48, 56, 128,
+ 79, 48, 48, 55, 128, 79, 48, 48, 54, 70, 128, 79, 48, 48, 54, 69, 128,
+ 79, 48, 48, 54, 68, 128, 79, 48, 48, 54, 67, 128, 79, 48, 48, 54, 66,
+ 128, 79, 48, 48, 54, 65, 128, 79, 48, 48, 54, 128, 79, 48, 48, 53, 65,
+ 128, 79, 48, 48, 53, 128, 79, 48, 48, 52, 128, 79, 48, 48, 51, 128, 79,
+ 48, 48, 50, 128, 79, 48, 48, 49, 65, 128, 79, 48, 48, 49, 128, 79, 45,
+ 89, 69, 128, 79, 45, 79, 45, 73, 128, 79, 45, 69, 128, 78, 90, 89, 88,
+ 128, 78, 90, 89, 84, 128, 78, 90, 89, 82, 88, 128, 78, 90, 89, 82, 128,
+ 78, 90, 89, 80, 128, 78, 90, 89, 128, 78, 90, 85, 88, 128, 78, 90, 85,
+ 82, 88, 128, 78, 90, 85, 82, 128, 78, 90, 85, 81, 128, 78, 90, 85, 80,
+ 128, 78, 90, 85, 79, 88, 128, 78, 90, 85, 79, 128, 78, 90, 85, 206, 78,
+ 90, 85, 128, 78, 90, 79, 88, 128, 78, 90, 79, 80, 128, 78, 90, 73, 88,
+ 128, 78, 90, 73, 84, 128, 78, 90, 73, 80, 128, 78, 90, 73, 69, 88, 128,
+ 78, 90, 73, 69, 80, 128, 78, 90, 73, 69, 128, 78, 90, 73, 128, 78, 90,
+ 69, 88, 128, 78, 90, 69, 85, 77, 128, 78, 90, 69, 128, 78, 90, 65, 88,
+ 128, 78, 90, 65, 84, 128, 78, 90, 65, 81, 128, 78, 90, 65, 80, 128, 78,
+ 90, 65, 128, 78, 90, 193, 78, 89, 87, 65, 128, 78, 89, 85, 88, 128, 78,
+ 89, 85, 84, 128, 78, 89, 85, 80, 128, 78, 89, 85, 79, 88, 128, 78, 89,
+ 85, 79, 80, 128, 78, 89, 85, 79, 128, 78, 89, 85, 69, 128, 78, 89, 85,
+ 128, 78, 89, 79, 88, 128, 78, 89, 79, 84, 128, 78, 89, 79, 80, 128, 78,
+ 89, 79, 79, 128, 78, 89, 79, 65, 128, 78, 89, 79, 128, 78, 89, 74, 65,
+ 128, 78, 89, 73, 88, 128, 78, 89, 73, 84, 128, 78, 89, 73, 212, 78, 89,
+ 73, 211, 78, 89, 73, 210, 78, 89, 73, 80, 128, 78, 89, 73, 78, 45, 68,
+ 79, 128, 78, 89, 73, 69, 88, 128, 78, 89, 73, 69, 84, 128, 78, 89, 73,
+ 69, 80, 128, 78, 89, 73, 69, 128, 78, 89, 73, 128, 78, 89, 201, 78, 89,
+ 69, 84, 128, 78, 89, 69, 212, 78, 89, 69, 72, 128, 78, 89, 69, 200, 78,
+ 89, 69, 69, 128, 78, 89, 69, 128, 78, 89, 196, 78, 89, 67, 65, 128, 78,
+ 89, 65, 69, 77, 65, 69, 128, 78, 89, 65, 65, 128, 78, 87, 79, 79, 128,
+ 78, 87, 79, 128, 78, 87, 73, 73, 128, 78, 87, 73, 128, 78, 87, 69, 128,
+ 78, 87, 65, 65, 128, 78, 87, 65, 128, 78, 87, 128, 78, 86, 128, 78, 85,
+ 88, 128, 78, 85, 85, 78, 128, 78, 85, 84, 73, 76, 76, 85, 128, 78, 85,
+ 84, 128, 78, 85, 212, 78, 85, 82, 88, 128, 78, 85, 82, 128, 78, 85, 80,
+ 128, 78, 85, 79, 88, 128, 78, 85, 79, 80, 128, 78, 85, 79, 128, 78, 85,
+ 78, 85, 90, 128, 78, 85, 78, 85, 218, 78, 85, 78, 71, 128, 78, 85, 78,
+ 65, 86, 85, 212, 78, 85, 78, 65, 86, 73, 203, 78, 85, 78, 128, 78, 85,
+ 206, 78, 85, 77, 69, 82, 207, 78, 85, 77, 69, 82, 65, 84, 79, 210, 78,
+ 85, 77, 69, 82, 65, 204, 78, 85, 77, 66, 69, 82, 83, 128, 78, 85, 77, 66,
+ 69, 82, 128, 78, 85, 77, 128, 78, 85, 76, 76, 128, 78, 85, 76, 204, 78,
+ 85, 75, 84, 65, 128, 78, 85, 69, 78, 71, 128, 78, 85, 69, 128, 78, 85,
+ 66, 73, 65, 206, 78, 85, 65, 69, 128, 78, 85, 49, 49, 128, 78, 85, 48,
+ 50, 50, 65, 128, 78, 85, 48, 50, 50, 128, 78, 85, 48, 50, 49, 128, 78,
+ 85, 48, 50, 48, 128, 78, 85, 48, 49, 57, 128, 78, 85, 48, 49, 56, 65,
+ 128, 78, 85, 48, 49, 56, 128, 78, 85, 48, 49, 55, 128, 78, 85, 48, 49,
+ 54, 128, 78, 85, 48, 49, 53, 128, 78, 85, 48, 49, 52, 128, 78, 85, 48,
+ 49, 51, 128, 78, 85, 48, 49, 50, 128, 78, 85, 48, 49, 49, 65, 128, 78,
+ 85, 48, 49, 49, 128, 78, 85, 48, 49, 48, 65, 128, 78, 85, 48, 49, 48,
+ 128, 78, 85, 48, 48, 57, 128, 78, 85, 48, 48, 56, 128, 78, 85, 48, 48,
+ 55, 128, 78, 85, 48, 48, 54, 128, 78, 85, 48, 48, 53, 128, 78, 85, 48,
+ 48, 52, 128, 78, 85, 48, 48, 51, 128, 78, 85, 48, 48, 50, 128, 78, 85,
+ 48, 48, 49, 128, 78, 84, 85, 85, 128, 78, 84, 85, 77, 128, 78, 84, 213,
+ 78, 84, 79, 81, 80, 69, 78, 128, 78, 84, 73, 69, 197, 78, 84, 69, 85, 78,
+ 71, 66, 65, 128, 78, 84, 69, 85, 77, 128, 78, 84, 69, 78, 128, 78, 84,
+ 69, 69, 128, 78, 84, 65, 80, 128, 78, 84, 65, 208, 78, 84, 65, 65, 128,
+ 78, 83, 85, 79, 212, 78, 83, 85, 78, 128, 78, 83, 85, 77, 128, 78, 83,
+ 79, 77, 128, 78, 83, 73, 69, 69, 84, 128, 78, 83, 73, 69, 69, 80, 128,
+ 78, 83, 73, 69, 69, 128, 78, 83, 72, 85, 84, 128, 78, 83, 72, 85, 212,
+ 78, 83, 72, 85, 79, 80, 128, 78, 83, 72, 85, 69, 128, 78, 83, 72, 73, 69,
+ 69, 128, 78, 83, 72, 69, 69, 128, 78, 83, 72, 65, 81, 128, 78, 83, 72,
+ 65, 128, 78, 83, 69, 85, 65, 69, 78, 128, 78, 83, 69, 78, 128, 78, 83,
+ 65, 128, 78, 82, 89, 88, 128, 78, 82, 89, 84, 128, 78, 82, 89, 82, 88,
+ 128, 78, 82, 89, 82, 128, 78, 82, 89, 80, 128, 78, 82, 89, 128, 78, 82,
+ 85, 88, 128, 78, 82, 85, 84, 128, 78, 82, 85, 82, 88, 128, 78, 82, 85,
+ 82, 128, 78, 82, 85, 80, 128, 78, 82, 85, 128, 78, 82, 79, 88, 128, 78,
+ 82, 79, 80, 128, 78, 82, 79, 128, 78, 82, 69, 88, 128, 78, 82, 69, 84,
+ 128, 78, 82, 69, 80, 128, 78, 82, 69, 128, 78, 82, 65, 88, 128, 78, 82,
+ 65, 84, 128, 78, 82, 65, 80, 128, 78, 82, 65, 128, 78, 79, 89, 128, 78,
+ 79, 88, 128, 78, 79, 86, 69, 77, 66, 69, 82, 128, 78, 79, 84, 84, 79,
+ 128, 78, 79, 84, 69, 83, 128, 78, 79, 84, 69, 72, 69, 65, 68, 128, 78,
+ 79, 84, 69, 72, 69, 65, 196, 78, 79, 84, 69, 66, 79, 79, 75, 128, 78, 79,
+ 84, 69, 66, 79, 79, 203, 78, 79, 84, 69, 128, 78, 79, 84, 197, 78, 79,
+ 84, 67, 72, 69, 196, 78, 79, 84, 67, 72, 128, 78, 79, 84, 128, 78, 79,
+ 212, 78, 79, 83, 69, 128, 78, 79, 82, 84, 72, 87, 69, 83, 212, 78, 79,
+ 82, 84, 72, 69, 82, 206, 78, 79, 82, 84, 200, 78, 79, 82, 77, 65, 204,
+ 78, 79, 210, 78, 79, 80, 128, 78, 79, 79, 78, 85, 128, 78, 79, 79, 128,
+ 78, 79, 78, 70, 79, 82, 75, 73, 78, 71, 128, 78, 79, 78, 45, 80, 79, 84,
+ 65, 66, 76, 197, 78, 79, 78, 45, 74, 79, 73, 78, 69, 82, 128, 78, 79, 78,
+ 45, 66, 82, 69, 65, 75, 73, 78, 199, 78, 79, 77, 73, 78, 65, 204, 78, 79,
+ 75, 72, 85, 75, 128, 78, 79, 68, 69, 128, 78, 79, 65, 128, 78, 79, 45,
+ 66, 82, 69, 65, 203, 78, 78, 79, 128, 78, 78, 78, 65, 128, 78, 78, 71,
+ 79, 79, 128, 78, 78, 71, 79, 128, 78, 78, 71, 73, 73, 128, 78, 78, 71,
+ 73, 128, 78, 78, 71, 65, 65, 128, 78, 78, 71, 65, 128, 78, 78, 71, 128,
+ 78, 77, 128, 78, 76, 48, 50, 48, 128, 78, 76, 48, 49, 57, 128, 78, 76,
+ 48, 49, 56, 128, 78, 76, 48, 49, 55, 65, 128, 78, 76, 48, 49, 55, 128,
+ 78, 76, 48, 49, 54, 128, 78, 76, 48, 49, 53, 128, 78, 76, 48, 49, 52,
+ 128, 78, 76, 48, 49, 51, 128, 78, 76, 48, 49, 50, 128, 78, 76, 48, 49,
+ 49, 128, 78, 76, 48, 49, 48, 128, 78, 76, 48, 48, 57, 128, 78, 76, 48,
+ 48, 56, 128, 78, 76, 48, 48, 55, 128, 78, 76, 48, 48, 54, 128, 78, 76,
+ 48, 48, 53, 65, 128, 78, 76, 48, 48, 53, 128, 78, 76, 48, 48, 52, 128,
+ 78, 76, 48, 48, 51, 128, 78, 76, 48, 48, 50, 128, 78, 76, 48, 48, 49,
+ 128, 78, 75, 79, 77, 128, 78, 75, 207, 78, 75, 73, 78, 68, 73, 128, 78,
+ 75, 65, 65, 82, 65, 69, 128, 78, 74, 89, 88, 128, 78, 74, 89, 84, 128,
+ 78, 74, 89, 82, 88, 128, 78, 74, 89, 82, 128, 78, 74, 89, 80, 128, 78,
+ 74, 89, 128, 78, 74, 85, 88, 128, 78, 74, 85, 82, 88, 128, 78, 74, 85,
+ 82, 128, 78, 74, 85, 81, 65, 128, 78, 74, 85, 80, 128, 78, 74, 85, 79,
+ 88, 128, 78, 74, 85, 79, 128, 78, 74, 85, 69, 81, 128, 78, 74, 85, 65,
+ 69, 128, 78, 74, 85, 128, 78, 74, 79, 88, 128, 78, 74, 79, 84, 128, 78,
+ 74, 79, 80, 128, 78, 74, 79, 79, 128, 78, 74, 79, 128, 78, 74, 73, 88,
+ 128, 78, 74, 73, 84, 128, 78, 74, 73, 80, 128, 78, 74, 73, 69, 88, 128,
+ 78, 74, 73, 69, 84, 128, 78, 74, 73, 69, 80, 128, 78, 74, 73, 69, 69,
+ 128, 78, 74, 73, 69, 128, 78, 74, 73, 128, 78, 74, 201, 78, 74, 69, 85,
+ 88, 128, 78, 74, 69, 85, 84, 128, 78, 74, 69, 85, 65, 69, 78, 65, 128,
+ 78, 74, 69, 85, 65, 69, 77, 128, 78, 74, 69, 69, 69, 69, 128, 78, 74, 69,
+ 69, 128, 78, 74, 69, 197, 78, 74, 69, 128, 78, 74, 65, 81, 128, 78, 74,
+ 65, 80, 128, 78, 74, 65, 69, 77, 76, 73, 128, 78, 74, 65, 69, 77, 128,
+ 78, 74, 65, 65, 128, 78, 74, 128, 78, 73, 88, 128, 78, 73, 84, 82, 69,
+ 128, 78, 73, 83, 65, 71, 128, 78, 73, 82, 85, 71, 85, 128, 78, 73, 80,
+ 128, 78, 73, 78, 84, 72, 128, 78, 73, 78, 69, 84, 89, 128, 78, 73, 78,
+ 69, 84, 217, 78, 73, 78, 69, 84, 69, 69, 78, 128, 78, 73, 78, 69, 84, 69,
+ 69, 206, 78, 73, 78, 69, 45, 84, 72, 73, 82, 84, 89, 128, 78, 73, 78,
+ 197, 78, 73, 78, 68, 65, 50, 128, 78, 73, 78, 68, 65, 178, 78, 73, 77,
+ 128, 78, 73, 205, 78, 73, 75, 72, 65, 72, 73, 84, 128, 78, 73, 75, 65,
+ 72, 73, 84, 128, 78, 73, 75, 65, 128, 78, 73, 73, 128, 78, 73, 72, 83,
+ 72, 86, 65, 83, 65, 128, 78, 73, 71, 73, 68, 65, 77, 73, 78, 128, 78, 73,
+ 71, 73, 68, 65, 69, 83, 72, 128, 78, 73, 71, 72, 84, 128, 78, 73, 71, 72,
+ 212, 78, 73, 71, 71, 65, 72, 73, 84, 65, 128, 78, 73, 69, 88, 128, 78,
+ 73, 69, 85, 78, 45, 84, 73, 75, 69, 85, 84, 128, 78, 73, 69, 85, 78, 45,
+ 84, 72, 73, 69, 85, 84, 72, 128, 78, 73, 69, 85, 78, 45, 83, 73, 79, 83,
+ 128, 78, 73, 69, 85, 78, 45, 82, 73, 69, 85, 76, 128, 78, 73, 69, 85, 78,
+ 45, 80, 73, 69, 85, 80, 128, 78, 73, 69, 85, 78, 45, 80, 65, 78, 83, 73,
+ 79, 83, 128, 78, 73, 69, 85, 78, 45, 75, 73, 89, 69, 79, 75, 128, 78, 73,
+ 69, 85, 78, 45, 72, 73, 69, 85, 72, 128, 78, 73, 69, 85, 78, 45, 67, 73,
+ 69, 85, 67, 128, 78, 73, 69, 85, 78, 45, 67, 72, 73, 69, 85, 67, 72, 128,
+ 78, 73, 69, 85, 206, 78, 73, 69, 80, 128, 78, 73, 69, 128, 78, 73, 66,
+ 128, 78, 73, 65, 128, 78, 73, 50, 128, 78, 72, 85, 69, 128, 78, 72, 74,
+ 65, 128, 78, 72, 65, 128, 78, 72, 128, 78, 71, 89, 69, 128, 78, 71, 86,
+ 69, 128, 78, 71, 85, 79, 88, 128, 78, 71, 85, 79, 84, 128, 78, 71, 85,
+ 79, 128, 78, 71, 85, 65, 69, 84, 128, 78, 71, 85, 65, 69, 128, 78, 71,
+ 79, 88, 128, 78, 71, 79, 85, 128, 78, 71, 79, 213, 78, 71, 79, 84, 128,
+ 78, 71, 79, 81, 128, 78, 71, 79, 80, 128, 78, 71, 79, 78, 128, 78, 71,
+ 79, 77, 128, 78, 71, 79, 69, 72, 128, 78, 71, 79, 69, 200, 78, 71, 207,
+ 78, 71, 75, 89, 69, 69, 128, 78, 71, 75, 87, 65, 69, 78, 128, 78, 71, 75,
+ 85, 80, 128, 78, 71, 75, 85, 78, 128, 78, 71, 75, 85, 77, 128, 78, 71,
+ 75, 85, 69, 78, 90, 69, 85, 77, 128, 78, 71, 75, 85, 197, 78, 71, 75, 73,
+ 78, 68, 201, 78, 71, 75, 73, 69, 69, 128, 78, 71, 75, 69, 85, 88, 128,
+ 78, 71, 75, 69, 85, 82, 73, 128, 78, 71, 75, 69, 85, 65, 69, 81, 128, 78,
+ 71, 75, 69, 85, 65, 69, 77, 128, 78, 71, 75, 65, 81, 128, 78, 71, 75, 65,
+ 80, 128, 78, 71, 75, 65, 65, 77, 73, 128, 78, 71, 75, 65, 128, 78, 71,
+ 73, 69, 88, 128, 78, 71, 73, 69, 80, 128, 78, 71, 73, 69, 128, 78, 71,
+ 71, 87, 65, 69, 78, 128, 78, 71, 71, 85, 82, 65, 69, 128, 78, 71, 71, 85,
+ 80, 128, 78, 71, 71, 85, 79, 81, 128, 78, 71, 71, 85, 79, 209, 78, 71,
+ 71, 85, 79, 78, 128, 78, 71, 71, 85, 79, 77, 128, 78, 71, 71, 85, 77,
+ 128, 78, 71, 71, 85, 69, 69, 84, 128, 78, 71, 71, 85, 65, 69, 83, 72, 65,
+ 197, 78, 71, 71, 85, 65, 69, 206, 78, 71, 71, 85, 128, 78, 71, 71, 79,
+ 79, 128, 78, 71, 71, 79, 128, 78, 71, 71, 73, 128, 78, 71, 71, 69, 85,
+ 88, 128, 78, 71, 71, 69, 85, 65, 69, 84, 128, 78, 71, 71, 69, 85, 65, 69,
+ 128, 78, 71, 71, 69, 213, 78, 71, 71, 69, 78, 128, 78, 71, 71, 69, 69,
+ 84, 128, 78, 71, 71, 69, 69, 69, 69, 128, 78, 71, 71, 69, 69, 128, 78,
+ 71, 71, 69, 128, 78, 71, 71, 65, 80, 128, 78, 71, 71, 65, 65, 77, 65, 69,
+ 128, 78, 71, 71, 65, 65, 77, 128, 78, 71, 71, 128, 78, 71, 69, 88, 128,
+ 78, 71, 69, 85, 82, 69, 85, 84, 128, 78, 71, 69, 80, 128, 78, 71, 69, 78,
+ 128, 78, 71, 69, 65, 68, 65, 76, 128, 78, 71, 65, 88, 128, 78, 71, 65,
+ 84, 128, 78, 71, 65, 211, 78, 71, 65, 81, 128, 78, 71, 65, 80, 128, 78,
+ 71, 65, 78, 71, 85, 128, 78, 71, 65, 78, 128, 78, 71, 65, 73, 128, 78,
+ 71, 65, 65, 73, 128, 78, 71, 193, 78, 70, 128, 78, 69, 88, 212, 78, 69,
+ 88, 128, 78, 69, 87, 83, 80, 65, 80, 69, 82, 128, 78, 69, 87, 76, 73, 78,
+ 69, 128, 78, 69, 87, 128, 78, 69, 85, 84, 82, 65, 204, 78, 69, 85, 84,
+ 69, 82, 128, 78, 69, 84, 128, 78, 69, 212, 78, 69, 83, 84, 69, 196, 78,
+ 69, 81, 85, 68, 65, 65, 128, 78, 69, 80, 84, 85, 78, 69, 128, 78, 69, 80,
+ 128, 78, 69, 79, 128, 78, 69, 207, 78, 69, 78, 65, 78, 79, 128, 78, 69,
+ 78, 128, 78, 69, 73, 84, 72, 69, 210, 78, 69, 71, 65, 84, 73, 79, 206,
+ 78, 69, 71, 65, 84, 69, 196, 78, 69, 69, 128, 78, 69, 67, 75, 84, 73, 69,
+ 128, 78, 69, 66, 69, 78, 83, 84, 73, 77, 77, 69, 128, 78, 68, 85, 88,
+ 128, 78, 68, 85, 84, 128, 78, 68, 85, 82, 88, 128, 78, 68, 85, 82, 128,
+ 78, 68, 85, 80, 128, 78, 68, 85, 78, 128, 78, 68, 213, 78, 68, 79, 88,
+ 128, 78, 68, 79, 84, 128, 78, 68, 79, 80, 128, 78, 68, 79, 79, 128, 78,
+ 68, 79, 78, 128, 78, 68, 79, 77, 66, 85, 128, 78, 68, 79, 76, 197, 78,
+ 68, 73, 88, 128, 78, 68, 73, 84, 128, 78, 68, 73, 81, 128, 78, 68, 73,
+ 80, 128, 78, 68, 73, 69, 88, 128, 78, 68, 73, 69, 128, 78, 68, 73, 68,
+ 65, 128, 78, 68, 73, 65, 81, 128, 78, 68, 69, 88, 128, 78, 68, 69, 85,
+ 88, 128, 78, 68, 69, 85, 84, 128, 78, 68, 69, 85, 65, 69, 82, 69, 69,
+ 128, 78, 68, 69, 80, 128, 78, 68, 69, 69, 128, 78, 68, 69, 128, 78, 68,
+ 65, 88, 128, 78, 68, 65, 84, 128, 78, 68, 65, 80, 128, 78, 68, 65, 77,
+ 128, 78, 68, 65, 65, 78, 71, 71, 69, 85, 65, 69, 84, 128, 78, 68, 65, 65,
+ 128, 78, 68, 65, 193, 78, 66, 89, 88, 128, 78, 66, 89, 84, 128, 78, 66,
+ 89, 82, 88, 128, 78, 66, 89, 82, 128, 78, 66, 89, 80, 128, 78, 66, 89,
+ 128, 78, 66, 85, 88, 128, 78, 66, 85, 84, 128, 78, 66, 85, 82, 88, 128,
+ 78, 66, 85, 82, 128, 78, 66, 85, 80, 128, 78, 66, 85, 128, 78, 66, 79,
+ 88, 128, 78, 66, 79, 84, 128, 78, 66, 79, 80, 128, 78, 66, 79, 128, 78,
+ 66, 73, 88, 128, 78, 66, 73, 84, 128, 78, 66, 73, 80, 128, 78, 66, 73,
+ 69, 88, 128, 78, 66, 73, 69, 80, 128, 78, 66, 73, 69, 128, 78, 66, 73,
+ 128, 78, 66, 65, 88, 128, 78, 66, 65, 84, 128, 78, 66, 65, 80, 128, 78,
+ 66, 65, 128, 78, 65, 89, 65, 78, 78, 65, 128, 78, 65, 89, 128, 78, 65,
+ 88, 73, 65, 206, 78, 65, 88, 128, 78, 65, 85, 84, 72, 83, 128, 78, 65,
+ 85, 68, 73, 218, 78, 65, 84, 85, 82, 65, 204, 78, 65, 84, 73, 79, 78, 65,
+ 204, 78, 65, 83, 75, 65, 80, 201, 78, 65, 83, 72, 73, 128, 78, 65, 83,
+ 65, 76, 73, 90, 65, 84, 73, 79, 206, 78, 65, 82, 82, 79, 215, 78, 65, 82,
+ 128, 78, 65, 81, 128, 78, 65, 79, 211, 78, 65, 78, 83, 65, 78, 65, 81,
+ 128, 78, 65, 78, 71, 77, 79, 78, 84, 72, 79, 128, 78, 65, 78, 68, 128,
+ 78, 65, 78, 65, 128, 78, 65, 77, 69, 128, 78, 65, 77, 197, 78, 65, 77,
+ 50, 128, 78, 65, 77, 128, 78, 65, 73, 82, 193, 78, 65, 73, 204, 78, 65,
+ 71, 82, 201, 78, 65, 71, 65, 82, 128, 78, 65, 71, 65, 128, 78, 65, 71,
+ 193, 78, 65, 71, 128, 78, 65, 199, 78, 65, 69, 128, 78, 65, 66, 76, 65,
+ 128, 78, 65, 65, 83, 73, 75, 89, 65, 89, 65, 128, 78, 65, 65, 75, 83, 73,
+ 75, 89, 65, 89, 65, 128, 78, 65, 65, 73, 128, 78, 65, 65, 128, 78, 65,
+ 193, 78, 65, 50, 128, 78, 48, 52, 50, 128, 78, 48, 52, 49, 128, 78, 48,
+ 52, 48, 128, 78, 48, 51, 57, 128, 78, 48, 51, 56, 128, 78, 48, 51, 55,
+ 65, 128, 78, 48, 51, 55, 128, 78, 48, 51, 54, 128, 78, 48, 51, 53, 65,
+ 128, 78, 48, 51, 53, 128, 78, 48, 51, 52, 65, 128, 78, 48, 51, 52, 128,
+ 78, 48, 51, 51, 65, 128, 78, 48, 51, 51, 128, 78, 48, 51, 50, 128, 78,
+ 48, 51, 49, 128, 78, 48, 51, 48, 128, 78, 48, 50, 57, 128, 78, 48, 50,
+ 56, 128, 78, 48, 50, 55, 128, 78, 48, 50, 54, 128, 78, 48, 50, 53, 65,
+ 128, 78, 48, 50, 53, 128, 78, 48, 50, 52, 128, 78, 48, 50, 51, 128, 78,
+ 48, 50, 50, 128, 78, 48, 50, 49, 128, 78, 48, 50, 48, 128, 78, 48, 49,
+ 57, 128, 78, 48, 49, 56, 66, 128, 78, 48, 49, 56, 65, 128, 78, 48, 49,
+ 56, 128, 78, 48, 49, 55, 128, 78, 48, 49, 54, 128, 78, 48, 49, 53, 128,
+ 78, 48, 49, 52, 128, 78, 48, 49, 51, 128, 78, 48, 49, 50, 128, 78, 48,
+ 49, 49, 128, 78, 48, 49, 48, 128, 78, 48, 48, 57, 128, 78, 48, 48, 56,
+ 128, 78, 48, 48, 55, 128, 78, 48, 48, 54, 128, 78, 48, 48, 53, 128, 78,
+ 48, 48, 52, 128, 78, 48, 48, 51, 128, 78, 48, 48, 50, 128, 78, 48, 48,
+ 49, 128, 78, 45, 67, 82, 69, 197, 78, 45, 65, 82, 217, 77, 89, 88, 128,
+ 77, 89, 84, 128, 77, 89, 83, 76, 73, 84, 69, 128, 77, 89, 80, 128, 77,
+ 89, 65, 128, 77, 89, 193, 77, 89, 128, 77, 217, 77, 87, 79, 79, 128, 77,
+ 87, 79, 128, 77, 87, 73, 73, 128, 77, 87, 73, 128, 77, 87, 69, 69, 128,
+ 77, 87, 69, 128, 77, 87, 65, 65, 128, 77, 87, 65, 128, 77, 87, 128, 77,
+ 215, 77, 86, 79, 80, 128, 77, 86, 73, 128, 77, 86, 69, 85, 65, 69, 78,
+ 71, 65, 77, 128, 77, 86, 128, 77, 214, 77, 85, 88, 128, 77, 85, 85, 83,
+ 73, 75, 65, 84, 79, 65, 78, 128, 77, 85, 85, 82, 68, 72, 65, 74, 193, 77,
+ 85, 84, 128, 77, 85, 83, 73, 67, 128, 77, 85, 83, 73, 195, 77, 85, 83,
+ 72, 82, 79, 79, 77, 128, 77, 85, 83, 72, 51, 128, 77, 85, 83, 72, 179,
+ 77, 85, 83, 72, 128, 77, 85, 83, 200, 77, 85, 82, 88, 128, 77, 85, 82,
+ 71, 85, 50, 128, 77, 85, 82, 69, 128, 77, 85, 82, 68, 65, 128, 77, 85,
+ 82, 68, 193, 77, 85, 82, 128, 77, 85, 81, 68, 65, 77, 128, 77, 85, 80,
+ 128, 77, 85, 79, 88, 128, 77, 85, 79, 84, 128, 77, 85, 79, 80, 128, 77,
+ 85, 79, 77, 65, 69, 128, 77, 85, 79, 128, 77, 85, 78, 83, 85, 66, 128,
+ 77, 85, 78, 65, 72, 128, 77, 85, 76, 84, 73, 83, 69, 84, 128, 77, 85, 76,
+ 84, 73, 83, 69, 212, 77, 85, 76, 84, 73, 80, 76, 73, 67, 65, 84, 73, 79,
+ 78, 128, 77, 85, 76, 84, 73, 80, 76, 73, 67, 65, 84, 73, 79, 206, 77, 85,
+ 76, 84, 73, 80, 76, 197, 77, 85, 76, 84, 73, 79, 67, 85, 76, 65, 210, 77,
+ 85, 76, 84, 73, 77, 65, 80, 128, 77, 85, 76, 84, 201, 77, 85, 75, 80, 72,
+ 82, 69, 78, 71, 128, 77, 85, 73, 78, 128, 77, 85, 71, 83, 128, 77, 85,
+ 71, 128, 77, 85, 199, 77, 85, 69, 128, 77, 85, 67, 72, 128, 77, 85, 67,
+ 200, 77, 85, 67, 65, 65, 68, 128, 77, 85, 65, 78, 128, 77, 85, 65, 69,
+ 128, 77, 85, 45, 71, 65, 65, 72, 76, 65, 193, 77, 213, 77, 83, 128, 77,
+ 80, 65, 128, 77, 79, 89, 65, 73, 128, 77, 79, 88, 128, 77, 79, 86, 73,
+ 197, 77, 79, 86, 69, 196, 77, 79, 85, 84, 72, 128, 77, 79, 85, 84, 200,
+ 77, 79, 85, 83, 69, 128, 77, 79, 85, 83, 197, 77, 79, 85, 78, 84, 65, 73,
+ 78, 83, 128, 77, 79, 85, 78, 84, 65, 73, 78, 128, 77, 79, 85, 78, 84, 65,
+ 73, 206, 77, 79, 85, 78, 212, 77, 79, 85, 78, 68, 128, 77, 79, 85, 78,
+ 196, 77, 79, 84, 72, 69, 82, 128, 77, 79, 84, 128, 77, 79, 82, 84, 85,
+ 85, 77, 128, 77, 79, 82, 84, 65, 82, 128, 77, 79, 82, 80, 72, 79, 76, 79,
+ 71, 73, 67, 65, 204, 77, 79, 82, 78, 73, 78, 71, 128, 77, 79, 80, 128,
+ 77, 79, 79, 83, 69, 45, 67, 82, 69, 197, 77, 79, 79, 78, 128, 77, 79, 79,
+ 206, 77, 79, 79, 77, 80, 85, 81, 128, 77, 79, 79, 77, 69, 85, 84, 128,
+ 77, 79, 79, 128, 77, 79, 78, 84, 73, 69, 69, 78, 128, 77, 79, 78, 84, 72,
+ 128, 77, 79, 78, 84, 200, 77, 79, 78, 83, 84, 69, 82, 128, 77, 79, 78,
+ 79, 83, 84, 65, 66, 76, 197, 77, 79, 78, 79, 83, 80, 65, 67, 197, 77, 79,
+ 78, 79, 82, 65, 73, 76, 128, 77, 79, 78, 79, 71, 82, 65, 80, 200, 77, 79,
78, 79, 71, 82, 65, 77, 77, 79, 211, 77, 79, 78, 79, 71, 82, 65, 205, 77,
79, 78, 79, 70, 79, 78, 73, 65, 83, 128, 77, 79, 78, 79, 67, 85, 76, 65,
- 210, 77, 79, 206, 77, 79, 76, 128, 77, 79, 72, 65, 77, 77, 65, 196, 77,
- 79, 68, 85, 76, 207, 77, 79, 68, 69, 83, 84, 89, 128, 77, 79, 68, 69, 76,
- 83, 128, 77, 79, 68, 69, 76, 128, 77, 79, 65, 128, 77, 207, 77, 78, 89,
- 65, 205, 77, 78, 65, 83, 128, 77, 77, 128, 77, 205, 77, 76, 65, 128, 77,
- 76, 128, 77, 73, 88, 128, 77, 73, 84, 128, 77, 73, 83, 82, 65, 128, 77,
- 73, 82, 73, 66, 65, 65, 82, 85, 128, 77, 73, 82, 73, 128, 77, 73, 82, 69,
- 68, 128, 77, 73, 80, 128, 77, 73, 78, 89, 128, 77, 73, 78, 85, 83, 45,
- 79, 82, 45, 80, 76, 85, 211, 77, 73, 78, 85, 83, 128, 77, 73, 78, 73, 83,
- 84, 69, 82, 128, 77, 73, 78, 73, 77, 65, 128, 77, 73, 77, 69, 128, 77,
- 73, 77, 128, 77, 73, 76, 76, 73, 79, 78, 211, 77, 73, 76, 76, 69, 84,
- 128, 77, 73, 76, 76, 197, 77, 73, 76, 204, 77, 73, 76, 128, 77, 73, 75,
- 85, 82, 79, 78, 128, 77, 73, 75, 82, 79, 206, 77, 73, 75, 82, 73, 128,
- 77, 73, 73, 78, 128, 77, 73, 73, 128, 77, 73, 199, 77, 73, 69, 88, 128,
- 77, 73, 69, 85, 77, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 77, 73,
- 69, 85, 77, 45, 82, 73, 69, 85, 76, 128, 77, 73, 69, 85, 77, 45, 80, 73,
- 69, 85, 80, 128, 77, 73, 69, 85, 77, 45, 80, 65, 78, 83, 73, 79, 83, 128,
- 77, 73, 69, 85, 77, 45, 72, 73, 69, 85, 72, 128, 77, 73, 69, 85, 77, 45,
- 67, 72, 73, 69, 85, 67, 72, 128, 77, 73, 69, 85, 205, 77, 73, 69, 80,
- 128, 77, 73, 69, 128, 77, 73, 68, 76, 73, 78, 197, 77, 73, 68, 68, 76,
- 69, 45, 87, 69, 76, 83, 200, 77, 73, 68, 68, 76, 197, 77, 73, 196, 77,
- 73, 67, 82, 207, 77, 73, 128, 77, 201, 77, 72, 90, 128, 77, 72, 128, 77,
- 71, 85, 88, 128, 77, 71, 85, 84, 128, 77, 71, 85, 82, 88, 128, 77, 71,
- 85, 82, 128, 77, 71, 85, 80, 128, 77, 71, 85, 79, 88, 128, 77, 71, 85,
- 79, 80, 128, 77, 71, 85, 79, 128, 77, 71, 85, 128, 77, 71, 79, 88, 128,
- 77, 71, 79, 84, 128, 77, 71, 79, 80, 128, 77, 71, 79, 128, 77, 71, 207,
- 77, 71, 73, 69, 88, 128, 77, 71, 73, 69, 128, 77, 71, 69, 88, 128, 77,
- 71, 69, 80, 128, 77, 71, 69, 128, 77, 71, 66, 85, 128, 77, 71, 66, 79,
- 79, 128, 77, 71, 66, 79, 128, 77, 71, 66, 73, 128, 77, 71, 66, 69, 69,
- 128, 77, 71, 66, 69, 128, 77, 71, 66, 65, 128, 77, 71, 65, 88, 128, 77,
+ 210, 77, 79, 78, 75, 69, 89, 128, 77, 79, 78, 75, 69, 217, 77, 79, 78,
+ 73, 128, 77, 79, 78, 71, 75, 69, 85, 65, 69, 81, 128, 77, 79, 78, 69,
+ 217, 77, 79, 78, 128, 77, 79, 206, 77, 79, 76, 128, 77, 79, 72, 65, 77,
+ 77, 65, 196, 77, 79, 68, 85, 76, 207, 77, 79, 68, 69, 83, 84, 89, 128,
+ 77, 79, 68, 69, 76, 83, 128, 77, 79, 68, 69, 76, 128, 77, 79, 68, 69,
+ 128, 77, 79, 66, 73, 76, 197, 77, 79, 65, 128, 77, 207, 77, 78, 89, 65,
+ 205, 77, 78, 65, 83, 128, 77, 77, 128, 77, 205, 77, 76, 65, 128, 77, 76,
+ 128, 77, 75, 80, 65, 82, 65, 209, 77, 73, 88, 128, 77, 73, 84, 128, 77,
+ 73, 212, 77, 73, 83, 82, 65, 128, 77, 73, 82, 73, 66, 65, 65, 82, 85,
+ 128, 77, 73, 82, 73, 128, 77, 73, 82, 69, 68, 128, 77, 73, 80, 128, 77,
+ 73, 78, 89, 128, 77, 73, 78, 85, 83, 45, 79, 82, 45, 80, 76, 85, 211, 77,
+ 73, 78, 85, 83, 128, 77, 73, 78, 73, 83, 84, 69, 82, 128, 77, 73, 78, 73,
+ 77, 65, 128, 77, 73, 78, 73, 68, 73, 83, 67, 128, 77, 73, 78, 73, 66, 85,
+ 83, 128, 77, 73, 77, 69, 128, 77, 73, 77, 128, 77, 73, 76, 76, 73, 79,
+ 78, 211, 77, 73, 76, 76, 69, 84, 128, 77, 73, 76, 76, 197, 77, 73, 76,
+ 204, 77, 73, 76, 75, 217, 77, 73, 76, 128, 77, 73, 75, 85, 82, 79, 78,
+ 128, 77, 73, 75, 82, 79, 206, 77, 73, 75, 82, 73, 128, 77, 73, 73, 78,
+ 128, 77, 73, 73, 128, 77, 73, 199, 77, 73, 69, 88, 128, 77, 73, 69, 85,
+ 77, 45, 84, 73, 75, 69, 85, 84, 128, 77, 73, 69, 85, 77, 45, 83, 83, 65,
+ 78, 71, 83, 73, 79, 83, 128, 77, 73, 69, 85, 77, 45, 83, 83, 65, 78, 71,
+ 78, 73, 69, 85, 78, 128, 77, 73, 69, 85, 77, 45, 82, 73, 69, 85, 76, 128,
+ 77, 73, 69, 85, 77, 45, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 128, 77,
+ 73, 69, 85, 77, 45, 80, 73, 69, 85, 80, 128, 77, 73, 69, 85, 77, 45, 80,
+ 65, 78, 83, 73, 79, 83, 128, 77, 73, 69, 85, 77, 45, 78, 73, 69, 85, 78,
+ 128, 77, 73, 69, 85, 77, 45, 67, 73, 69, 85, 67, 128, 77, 73, 69, 85, 77,
+ 45, 67, 72, 73, 69, 85, 67, 72, 128, 77, 73, 69, 85, 205, 77, 73, 69, 80,
+ 128, 77, 73, 69, 69, 128, 77, 73, 69, 128, 77, 73, 68, 76, 73, 78, 197,
+ 77, 73, 68, 68, 76, 69, 45, 87, 69, 76, 83, 200, 77, 73, 68, 68, 76, 197,
+ 77, 73, 196, 77, 73, 67, 82, 79, 83, 67, 79, 80, 69, 128, 77, 73, 67, 82,
+ 79, 80, 72, 79, 78, 69, 128, 77, 73, 67, 82, 207, 77, 72, 90, 128, 77,
+ 72, 128, 77, 71, 85, 88, 128, 77, 71, 85, 84, 128, 77, 71, 85, 82, 88,
+ 128, 77, 71, 85, 82, 128, 77, 71, 85, 80, 128, 77, 71, 85, 79, 88, 128,
+ 77, 71, 85, 79, 80, 128, 77, 71, 85, 79, 128, 77, 71, 85, 128, 77, 71,
+ 79, 88, 128, 77, 71, 79, 84, 128, 77, 71, 79, 80, 128, 77, 71, 79, 128,
+ 77, 71, 207, 77, 71, 73, 69, 88, 128, 77, 71, 73, 69, 128, 77, 71, 69,
+ 88, 128, 77, 71, 69, 80, 128, 77, 71, 69, 128, 77, 71, 66, 85, 128, 77,
+ 71, 66, 79, 79, 128, 77, 71, 66, 79, 70, 85, 77, 128, 77, 71, 66, 79,
+ 128, 77, 71, 66, 73, 128, 77, 71, 66, 69, 85, 78, 128, 77, 71, 66, 69,
+ 78, 128, 77, 71, 66, 69, 69, 128, 77, 71, 66, 69, 128, 77, 71, 66, 65,
+ 83, 65, 81, 128, 77, 71, 66, 65, 83, 65, 128, 77, 71, 65, 88, 128, 77,
71, 65, 84, 128, 77, 71, 65, 80, 128, 77, 71, 65, 128, 77, 71, 128, 77,
- 69, 90, 90, 79, 128, 77, 69, 88, 128, 77, 69, 84, 82, 73, 67, 65, 204,
- 77, 69, 84, 82, 73, 65, 128, 77, 69, 84, 82, 69, 84, 69, 211, 77, 69, 84,
- 79, 66, 69, 76, 85, 83, 128, 77, 69, 84, 69, 71, 128, 77, 69, 84, 65, 76,
- 128, 77, 69, 84, 193, 77, 69, 83, 83, 69, 78, 73, 65, 206, 77, 69, 83,
- 79, 128, 77, 69, 83, 73, 128, 77, 69, 83, 72, 128, 77, 69, 82, 75, 72,
- 65, 128, 77, 69, 82, 75, 72, 193, 77, 69, 82, 73, 128, 77, 69, 82, 67,
- 85, 82, 89, 128, 77, 69, 78, 128, 77, 69, 206, 77, 69, 77, 66, 69, 82,
- 83, 72, 73, 80, 128, 77, 69, 77, 66, 69, 82, 128, 77, 69, 77, 66, 69,
- 210, 77, 69, 77, 128, 77, 69, 205, 77, 69, 76, 79, 78, 128, 77, 69, 73,
- 90, 73, 128, 77, 69, 71, 65, 84, 79, 78, 128, 77, 69, 71, 65, 76, 73,
- 128, 77, 69, 69, 84, 79, 82, 85, 128, 77, 69, 69, 84, 128, 77, 69, 69,
- 77, 85, 128, 77, 69, 69, 77, 128, 77, 69, 69, 128, 77, 69, 68, 73, 85,
- 77, 128, 77, 69, 68, 73, 85, 205, 77, 69, 68, 73, 67, 73, 78, 69, 128,
- 77, 69, 65, 84, 128, 77, 69, 65, 83, 85, 82, 69, 196, 77, 69, 65, 83, 85,
- 82, 69, 128, 77, 69, 65, 83, 85, 82, 197, 77, 68, 85, 206, 77, 67, 72,
- 213, 77, 66, 85, 128, 77, 66, 79, 79, 128, 77, 66, 79, 128, 77, 66, 73,
- 128, 77, 66, 69, 69, 128, 77, 66, 69, 128, 77, 66, 65, 128, 77, 66, 52,
- 128, 77, 66, 51, 128, 77, 66, 50, 128, 77, 66, 128, 77, 194, 77, 65, 89,
- 65, 78, 78, 65, 128, 77, 65, 89, 128, 77, 65, 88, 73, 77, 65, 128, 77,
- 65, 88, 128, 77, 65, 84, 84, 79, 67, 75, 128, 77, 65, 84, 82, 73, 88,
- 128, 77, 65, 84, 69, 82, 73, 65, 76, 83, 128, 77, 65, 84, 128, 77, 65,
- 83, 213, 77, 65, 83, 83, 73, 78, 71, 128, 77, 65, 83, 79, 82, 193, 77,
- 65, 83, 72, 50, 128, 77, 65, 83, 67, 85, 76, 73, 78, 197, 77, 65, 82, 85,
- 75, 85, 128, 77, 65, 82, 84, 89, 82, 73, 193, 77, 65, 82, 82, 89, 73, 78,
- 199, 77, 65, 82, 82, 73, 65, 71, 197, 77, 65, 82, 75, 69, 82, 128, 77,
- 65, 82, 75, 45, 52, 128, 77, 65, 82, 75, 45, 51, 128, 77, 65, 82, 75, 45,
- 50, 128, 77, 65, 82, 75, 45, 49, 128, 77, 65, 82, 69, 128, 77, 65, 82,
- 67, 72, 128, 77, 65, 82, 67, 65, 84, 79, 45, 83, 84, 65, 67, 67, 65, 84,
- 79, 128, 77, 65, 82, 67, 65, 84, 79, 128, 77, 65, 82, 66, 85, 84, 65,
- 128, 77, 65, 82, 66, 85, 84, 193, 77, 65, 82, 128, 77, 65, 81, 65, 70,
- 128, 77, 65, 80, 73, 81, 128, 77, 65, 78, 83, 89, 79, 78, 128, 77, 65,
- 78, 78, 65, 218, 77, 65, 78, 78, 65, 128, 77, 65, 78, 71, 65, 76, 65, 77,
- 128, 77, 65, 78, 67, 72, 213, 77, 65, 78, 65, 67, 76, 69, 83, 128, 77,
- 65, 76, 84, 69, 83, 197, 77, 65, 76, 69, 128, 77, 65, 76, 197, 77, 65,
- 76, 65, 75, 79, 206, 77, 65, 75, 83, 85, 82, 65, 128, 77, 65, 73, 89, 65,
- 77, 79, 75, 128, 77, 65, 73, 84, 65, 73, 75, 72, 85, 128, 77, 65, 73, 82,
- 85, 128, 77, 65, 73, 77, 85, 65, 78, 128, 77, 65, 73, 77, 65, 76, 65, 73,
- 128, 77, 65, 73, 75, 85, 82, 79, 128, 77, 65, 73, 68, 69, 78, 128, 77,
- 65, 72, 74, 79, 78, 199, 77, 65, 72, 72, 65, 128, 77, 65, 72, 65, 80, 82,
- 65, 78, 65, 128, 77, 65, 72, 65, 80, 65, 75, 72, 128, 77, 65, 72, 65, 65,
- 80, 82, 65, 65, 78, 193, 77, 65, 72, 128, 77, 65, 68, 85, 128, 77, 65,
- 68, 68, 65, 200, 77, 65, 68, 68, 65, 128, 77, 65, 68, 68, 193, 77, 65,
- 67, 82, 79, 78, 45, 71, 82, 65, 86, 69, 128, 77, 65, 67, 82, 79, 78, 45,
- 66, 82, 69, 86, 69, 128, 77, 65, 67, 82, 79, 78, 45, 65, 67, 85, 84, 69,
- 128, 77, 65, 67, 82, 79, 78, 128, 77, 65, 67, 82, 79, 206, 77, 65, 65,
- 73, 128, 77, 65, 65, 128, 77, 65, 50, 128, 76, 218, 76, 89, 89, 128, 76,
- 89, 88, 128, 76, 89, 84, 128, 76, 89, 82, 88, 128, 76, 89, 82, 128, 76,
- 89, 80, 128, 76, 89, 68, 73, 65, 206, 76, 89, 67, 73, 65, 206, 76, 88,
- 128, 76, 87, 79, 79, 128, 76, 87, 79, 128, 76, 87, 73, 73, 128, 76, 87,
- 73, 128, 76, 87, 69, 128, 76, 87, 65, 65, 128, 76, 87, 65, 128, 76, 85,
- 88, 128, 76, 85, 84, 128, 76, 85, 82, 88, 128, 76, 85, 80, 128, 76, 85,
- 79, 88, 128, 76, 85, 79, 84, 128, 76, 85, 79, 80, 128, 76, 85, 79, 128,
- 76, 85, 78, 65, 84, 197, 76, 85, 205, 76, 85, 76, 128, 76, 85, 73, 83,
- 128, 76, 85, 72, 128, 76, 85, 71, 65, 76, 128, 76, 85, 71, 65, 204, 76,
- 85, 51, 128, 76, 85, 50, 128, 76, 85, 178, 76, 79, 90, 69, 78, 71, 69,
- 128, 76, 79, 90, 69, 78, 71, 197, 76, 79, 88, 128, 76, 79, 87, 45, 185,
- 76, 79, 85, 82, 69, 128, 76, 79, 84, 85, 83, 128, 76, 79, 84, 128, 76,
- 79, 82, 82, 65, 73, 78, 69, 128, 76, 79, 80, 128, 76, 79, 79, 84, 128,
- 76, 79, 79, 80, 128, 76, 79, 79, 128, 76, 79, 78, 71, 65, 128, 76, 79,
- 78, 71, 193, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 89, 82, 128,
- 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 83, 79, 204, 76, 79, 78,
- 71, 45, 66, 82, 65, 78, 67, 72, 45, 79, 83, 211, 76, 79, 78, 71, 45, 66,
- 82, 65, 78, 67, 72, 45, 77, 65, 68, 210, 76, 79, 78, 71, 45, 66, 82, 65,
- 78, 67, 72, 45, 72, 65, 71, 65, 76, 204, 76, 79, 78, 71, 45, 66, 82, 65,
- 78, 67, 72, 45, 65, 210, 76, 79, 76, 76, 128, 76, 79, 71, 210, 76, 79,
- 71, 79, 84, 89, 80, 197, 76, 79, 71, 128, 76, 79, 67, 65, 84, 73, 86, 69,
- 128, 76, 79, 67, 65, 84, 73, 79, 206, 76, 79, 65, 128, 76, 78, 128, 76,
- 77, 128, 76, 76, 76, 65, 128, 76, 74, 85, 68, 73, 74, 69, 128, 76, 74,
- 69, 128, 76, 74, 128, 76, 73, 88, 128, 76, 73, 87, 78, 128, 76, 73, 84,
- 84, 76, 197, 76, 73, 84, 82, 193, 76, 73, 84, 128, 76, 73, 83, 72, 128,
- 76, 73, 82, 193, 76, 73, 81, 85, 73, 196, 76, 73, 80, 128, 76, 73, 78,
- 75, 73, 78, 199, 76, 73, 78, 203, 76, 73, 78, 69, 83, 128, 76, 73, 78,
- 69, 45, 57, 128, 76, 73, 78, 69, 45, 55, 128, 76, 73, 78, 69, 45, 51,
- 128, 76, 73, 78, 69, 45, 49, 128, 76, 73, 77, 77, 85, 52, 128, 76, 73,
- 77, 77, 85, 50, 128, 76, 73, 77, 77, 85, 128, 76, 73, 77, 77, 213, 76,
- 73, 77, 73, 84, 69, 196, 76, 73, 77, 73, 84, 65, 84, 73, 79, 78, 128, 76,
- 73, 77, 73, 84, 128, 76, 73, 76, 89, 128, 76, 73, 76, 73, 84, 72, 128,
- 76, 73, 76, 128, 76, 73, 73, 128, 76, 73, 71, 72, 84, 78, 73, 78, 71,
+ 70, 79, 78, 128, 77, 70, 79, 206, 77, 70, 79, 128, 77, 70, 73, 89, 65,
+ 81, 128, 77, 70, 73, 69, 69, 128, 77, 70, 69, 85, 84, 128, 77, 70, 69,
+ 85, 81, 128, 77, 70, 69, 85, 65, 69, 128, 77, 70, 65, 65, 128, 77, 69,
+ 90, 90, 79, 128, 77, 69, 88, 128, 77, 69, 85, 212, 77, 69, 85, 81, 128,
+ 77, 69, 85, 78, 74, 79, 77, 78, 68, 69, 85, 81, 128, 77, 69, 85, 78, 128,
+ 77, 69, 84, 82, 79, 128, 77, 69, 84, 82, 73, 67, 65, 204, 77, 69, 84, 82,
+ 73, 65, 128, 77, 69, 84, 82, 69, 84, 69, 211, 77, 69, 84, 79, 66, 69, 76,
+ 85, 83, 128, 77, 69, 84, 69, 75, 128, 77, 69, 84, 69, 71, 128, 77, 69,
+ 84, 65, 76, 128, 77, 69, 84, 193, 77, 69, 83, 83, 69, 78, 73, 65, 206,
+ 77, 69, 83, 79, 128, 77, 69, 83, 73, 128, 77, 69, 83, 72, 128, 77, 69,
+ 82, 75, 72, 65, 128, 77, 69, 82, 75, 72, 193, 77, 69, 82, 73, 68, 73, 65,
+ 78, 83, 128, 77, 69, 82, 73, 128, 77, 69, 82, 71, 69, 128, 77, 69, 82,
+ 67, 85, 82, 89, 128, 77, 69, 82, 67, 85, 82, 217, 77, 69, 78, 68, 85, 84,
+ 128, 77, 69, 78, 128, 77, 69, 77, 79, 128, 77, 69, 77, 66, 69, 82, 83,
+ 72, 73, 80, 128, 77, 69, 77, 66, 69, 82, 128, 77, 69, 77, 66, 69, 210,
+ 77, 69, 77, 45, 81, 79, 80, 72, 128, 77, 69, 77, 128, 77, 69, 205, 77,
+ 69, 76, 79, 68, 73, 195, 77, 69, 76, 73, 75, 128, 77, 69, 73, 90, 73,
+ 128, 77, 69, 71, 65, 84, 79, 78, 128, 77, 69, 71, 65, 80, 72, 79, 78, 69,
+ 128, 77, 69, 71, 65, 76, 73, 128, 77, 69, 69, 84, 79, 82, 85, 128, 77,
+ 69, 69, 84, 69, 201, 77, 69, 69, 84, 128, 77, 69, 69, 77, 85, 128, 77,
+ 69, 69, 77, 128, 77, 69, 69, 69, 69, 128, 77, 69, 69, 128, 77, 69, 68,
+ 73, 85, 77, 128, 77, 69, 68, 73, 85, 205, 77, 69, 68, 73, 67, 73, 78, 69,
+ 128, 77, 69, 68, 73, 67, 65, 204, 77, 69, 65, 84, 128, 77, 69, 65, 212,
+ 77, 69, 65, 83, 85, 82, 69, 196, 77, 69, 65, 83, 85, 82, 69, 128, 77, 69,
+ 65, 83, 85, 82, 197, 77, 68, 85, 206, 77, 67, 72, 213, 77, 67, 72, 65,
+ 206, 77, 66, 85, 79, 81, 128, 77, 66, 85, 79, 128, 77, 66, 85, 69, 128,
+ 77, 66, 85, 65, 69, 77, 128, 77, 66, 85, 65, 69, 128, 77, 66, 79, 79,
+ 128, 77, 66, 79, 128, 77, 66, 73, 84, 128, 77, 66, 73, 212, 77, 66, 73,
+ 82, 73, 69, 69, 78, 128, 77, 66, 73, 128, 77, 66, 69, 85, 88, 128, 77,
+ 66, 69, 85, 82, 73, 128, 77, 66, 69, 85, 77, 128, 77, 66, 69, 82, 65, 69,
+ 128, 77, 66, 69, 78, 128, 77, 66, 69, 69, 75, 69, 69, 84, 128, 77, 66,
+ 69, 69, 128, 77, 66, 69, 128, 77, 66, 65, 81, 128, 77, 66, 65, 78, 89,
+ 73, 128, 77, 66, 65, 65, 82, 65, 69, 128, 77, 66, 65, 65, 75, 69, 84,
+ 128, 77, 66, 65, 65, 128, 77, 66, 65, 193, 77, 66, 193, 77, 66, 52, 128,
+ 77, 66, 51, 128, 77, 66, 50, 128, 77, 66, 128, 77, 194, 77, 65, 89, 69,
+ 203, 77, 65, 89, 65, 78, 78, 65, 128, 77, 65, 89, 128, 77, 65, 88, 73,
+ 77, 65, 128, 77, 65, 88, 128, 77, 65, 84, 84, 79, 67, 75, 128, 77, 65,
+ 84, 82, 73, 88, 128, 77, 65, 84, 69, 82, 73, 65, 76, 83, 128, 77, 65, 84,
+ 128, 77, 65, 83, 213, 77, 65, 83, 83, 73, 78, 71, 128, 77, 65, 83, 83,
+ 65, 71, 69, 128, 77, 65, 83, 79, 82, 193, 77, 65, 83, 75, 128, 77, 65,
+ 83, 72, 70, 65, 65, 84, 128, 77, 65, 83, 72, 50, 128, 77, 65, 83, 67, 85,
+ 76, 73, 78, 197, 77, 65, 82, 89, 128, 77, 65, 82, 85, 75, 85, 128, 77,
+ 65, 82, 84, 89, 82, 73, 193, 77, 65, 82, 82, 89, 73, 78, 199, 77, 65, 82,
+ 82, 73, 65, 71, 197, 77, 65, 82, 75, 69, 82, 128, 77, 65, 82, 75, 45, 52,
+ 128, 77, 65, 82, 75, 45, 51, 128, 77, 65, 82, 75, 45, 50, 128, 77, 65,
+ 82, 75, 45, 49, 128, 77, 65, 82, 69, 128, 77, 65, 82, 67, 72, 128, 77,
+ 65, 82, 67, 65, 84, 79, 45, 83, 84, 65, 67, 67, 65, 84, 79, 128, 77, 65,
+ 82, 67, 65, 84, 79, 128, 77, 65, 82, 67, 65, 83, 73, 84, 69, 128, 77, 65,
+ 82, 66, 85, 84, 65, 128, 77, 65, 82, 66, 85, 84, 193, 77, 65, 82, 128,
+ 77, 65, 81, 65, 70, 128, 77, 65, 81, 128, 77, 65, 80, 76, 197, 77, 65,
+ 80, 73, 81, 128, 77, 65, 208, 77, 65, 79, 128, 77, 65, 78, 83, 89, 79,
+ 78, 128, 77, 65, 78, 83, 85, 65, 69, 128, 77, 65, 78, 78, 65, 218, 77,
+ 65, 78, 78, 65, 128, 77, 65, 78, 71, 65, 76, 65, 77, 128, 77, 65, 78, 68,
+ 65, 73, 76, 73, 78, 199, 77, 65, 78, 68, 65, 73, 195, 77, 65, 78, 67, 72,
+ 213, 77, 65, 78, 65, 67, 76, 69, 83, 128, 77, 65, 76, 84, 69, 83, 197,
+ 77, 65, 76, 69, 69, 82, 73, 128, 77, 65, 76, 69, 128, 77, 65, 76, 197,
+ 77, 65, 76, 65, 75, 79, 206, 77, 65, 75, 83, 85, 82, 65, 128, 77, 65, 73,
+ 90, 69, 128, 77, 65, 73, 89, 65, 77, 79, 75, 128, 77, 65, 73, 84, 65, 73,
+ 75, 72, 85, 128, 77, 65, 73, 82, 85, 128, 77, 65, 73, 77, 85, 65, 78,
+ 128, 77, 65, 73, 77, 65, 76, 65, 73, 128, 77, 65, 73, 76, 66, 79, 216,
+ 77, 65, 73, 75, 85, 82, 79, 128, 77, 65, 73, 68, 69, 78, 128, 77, 65, 72,
+ 74, 79, 78, 199, 77, 65, 72, 72, 65, 128, 77, 65, 72, 65, 80, 82, 65, 78,
+ 65, 128, 77, 65, 72, 65, 80, 65, 75, 72, 128, 77, 65, 72, 65, 65, 80, 82,
+ 65, 65, 78, 193, 77, 65, 72, 128, 77, 65, 71, 78, 73, 70, 89, 73, 78,
+ 199, 77, 65, 69, 83, 73, 128, 77, 65, 69, 78, 89, 73, 128, 77, 65, 69,
+ 78, 74, 69, 84, 128, 77, 65, 69, 77, 86, 69, 85, 88, 128, 77, 65, 69, 77,
+ 75, 80, 69, 78, 128, 77, 65, 69, 77, 71, 66, 73, 69, 69, 128, 77, 65, 69,
+ 77, 66, 71, 66, 73, 69, 69, 128, 77, 65, 69, 77, 66, 65, 128, 77, 65, 69,
+ 77, 128, 77, 65, 69, 76, 69, 69, 128, 77, 65, 69, 75, 69, 85, 80, 128,
+ 77, 65, 68, 89, 65, 128, 77, 65, 68, 85, 128, 77, 65, 68, 68, 65, 200,
+ 77, 65, 68, 68, 65, 128, 77, 65, 68, 68, 193, 77, 65, 67, 82, 79, 78, 45,
+ 71, 82, 65, 86, 69, 128, 77, 65, 67, 82, 79, 78, 45, 66, 82, 69, 86, 69,
+ 128, 77, 65, 67, 82, 79, 78, 45, 65, 67, 85, 84, 69, 128, 77, 65, 67, 82,
+ 79, 78, 128, 77, 65, 67, 82, 79, 206, 77, 65, 67, 72, 73, 78, 69, 128,
+ 77, 65, 65, 73, 128, 77, 65, 65, 128, 77, 65, 50, 128, 77, 48, 52, 52,
+ 128, 77, 48, 52, 51, 128, 77, 48, 52, 50, 128, 77, 48, 52, 49, 128, 77,
+ 48, 52, 48, 65, 128, 77, 48, 52, 48, 128, 77, 48, 51, 57, 128, 77, 48,
+ 51, 56, 128, 77, 48, 51, 55, 128, 77, 48, 51, 54, 128, 77, 48, 51, 53,
+ 128, 77, 48, 51, 52, 128, 77, 48, 51, 51, 66, 128, 77, 48, 51, 51, 65,
+ 128, 77, 48, 51, 51, 128, 77, 48, 51, 50, 128, 77, 48, 51, 49, 65, 128,
+ 77, 48, 51, 49, 128, 77, 48, 51, 48, 128, 77, 48, 50, 57, 128, 77, 48,
+ 50, 56, 65, 128, 77, 48, 50, 56, 128, 77, 48, 50, 55, 128, 77, 48, 50,
+ 54, 128, 77, 48, 50, 53, 128, 77, 48, 50, 52, 65, 128, 77, 48, 50, 52,
+ 128, 77, 48, 50, 51, 128, 77, 48, 50, 50, 65, 128, 77, 48, 50, 50, 128,
+ 77, 48, 50, 49, 128, 77, 48, 50, 48, 128, 77, 48, 49, 57, 128, 77, 48,
+ 49, 56, 128, 77, 48, 49, 55, 65, 128, 77, 48, 49, 55, 128, 77, 48, 49,
+ 54, 65, 128, 77, 48, 49, 54, 128, 77, 48, 49, 53, 65, 128, 77, 48, 49,
+ 53, 128, 77, 48, 49, 52, 128, 77, 48, 49, 51, 128, 77, 48, 49, 50, 72,
+ 128, 77, 48, 49, 50, 71, 128, 77, 48, 49, 50, 70, 128, 77, 48, 49, 50,
+ 69, 128, 77, 48, 49, 50, 68, 128, 77, 48, 49, 50, 67, 128, 77, 48, 49,
+ 50, 66, 128, 77, 48, 49, 50, 65, 128, 77, 48, 49, 50, 128, 77, 48, 49,
+ 49, 128, 77, 48, 49, 48, 65, 128, 77, 48, 49, 48, 128, 77, 48, 48, 57,
+ 128, 77, 48, 48, 56, 128, 77, 48, 48, 55, 128, 77, 48, 48, 54, 128, 77,
+ 48, 48, 53, 128, 77, 48, 48, 52, 128, 77, 48, 48, 51, 65, 128, 77, 48,
+ 48, 51, 128, 77, 48, 48, 50, 128, 77, 48, 48, 49, 66, 128, 77, 48, 48,
+ 49, 65, 128, 77, 48, 48, 49, 128, 76, 218, 76, 89, 89, 128, 76, 89, 88,
+ 128, 76, 89, 84, 128, 76, 89, 82, 88, 128, 76, 89, 82, 128, 76, 89, 80,
+ 128, 76, 89, 68, 73, 65, 206, 76, 89, 67, 73, 65, 206, 76, 88, 128, 76,
+ 87, 79, 79, 128, 76, 87, 79, 128, 76, 87, 73, 73, 128, 76, 87, 73, 128,
+ 76, 87, 69, 128, 76, 87, 65, 65, 128, 76, 87, 65, 128, 76, 85, 88, 128,
+ 76, 85, 84, 128, 76, 85, 82, 88, 128, 76, 85, 80, 128, 76, 85, 79, 88,
+ 128, 76, 85, 79, 84, 128, 76, 85, 79, 80, 128, 76, 85, 79, 128, 76, 85,
+ 78, 71, 83, 73, 128, 76, 85, 78, 65, 84, 197, 76, 85, 205, 76, 85, 76,
+ 128, 76, 85, 73, 83, 128, 76, 85, 72, 85, 82, 128, 76, 85, 72, 128, 76,
+ 85, 71, 71, 65, 71, 69, 128, 76, 85, 71, 65, 76, 128, 76, 85, 71, 65,
+ 204, 76, 85, 69, 128, 76, 85, 65, 69, 80, 128, 76, 85, 51, 128, 76, 85,
+ 50, 128, 76, 85, 178, 76, 79, 90, 69, 78, 71, 69, 128, 76, 79, 90, 69,
+ 78, 71, 197, 76, 79, 88, 128, 76, 79, 87, 69, 82, 69, 196, 76, 79, 87,
+ 69, 210, 76, 79, 87, 45, 185, 76, 79, 86, 197, 76, 79, 85, 82, 69, 128,
+ 76, 79, 85, 68, 83, 80, 69, 65, 75, 69, 82, 128, 76, 79, 85, 68, 76, 217,
+ 76, 79, 84, 85, 83, 128, 76, 79, 84, 128, 76, 79, 82, 82, 89, 128, 76,
+ 79, 82, 82, 65, 73, 78, 69, 128, 76, 79, 81, 128, 76, 79, 80, 128, 76,
+ 79, 79, 84, 128, 76, 79, 79, 80, 128, 76, 79, 79, 78, 128, 76, 79, 79,
+ 203, 76, 79, 79, 128, 76, 79, 78, 83, 85, 77, 128, 76, 79, 78, 71, 65,
+ 128, 76, 79, 78, 71, 193, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45,
+ 89, 82, 128, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 83, 79, 204,
+ 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 79, 83, 211, 76, 79, 78,
+ 71, 45, 66, 82, 65, 78, 67, 72, 45, 77, 65, 68, 210, 76, 79, 78, 71, 45,
+ 66, 82, 65, 78, 67, 72, 45, 72, 65, 71, 65, 76, 204, 76, 79, 78, 71, 45,
+ 66, 82, 65, 78, 67, 72, 45, 65, 210, 76, 79, 77, 77, 65, 69, 128, 76, 79,
+ 77, 128, 76, 79, 205, 76, 79, 76, 76, 73, 80, 79, 80, 128, 76, 79, 76,
+ 76, 128, 76, 79, 71, 210, 76, 79, 71, 79, 84, 89, 80, 197, 76, 79, 71,
+ 79, 71, 82, 65, 205, 76, 79, 71, 128, 76, 79, 68, 69, 83, 84, 79, 78, 69,
+ 128, 76, 79, 67, 79, 77, 79, 84, 73, 86, 69, 128, 76, 79, 67, 203, 76,
+ 79, 67, 65, 84, 73, 86, 69, 128, 76, 79, 67, 65, 84, 73, 79, 206, 76, 79,
+ 65, 128, 76, 78, 128, 76, 77, 128, 76, 76, 76, 65, 128, 76, 74, 85, 68,
+ 73, 74, 69, 128, 76, 74, 69, 128, 76, 74, 128, 76, 73, 88, 128, 76, 73,
+ 87, 78, 128, 76, 73, 86, 82, 197, 76, 73, 84, 84, 76, 197, 76, 73, 84,
+ 84, 69, 210, 76, 73, 84, 82, 193, 76, 73, 84, 128, 76, 73, 83, 213, 76,
+ 73, 82, 193, 76, 73, 81, 85, 73, 196, 76, 73, 81, 128, 76, 73, 80, 83,
+ 84, 73, 67, 75, 128, 76, 73, 78, 75, 73, 78, 199, 76, 73, 78, 203, 76,
+ 73, 78, 71, 83, 65, 128, 76, 73, 78, 69, 83, 128, 76, 73, 78, 69, 211,
+ 76, 73, 78, 69, 45, 57, 128, 76, 73, 78, 69, 45, 55, 128, 76, 73, 78, 69,
+ 45, 51, 128, 76, 73, 78, 69, 45, 49, 128, 76, 73, 77, 77, 85, 52, 128,
+ 76, 73, 77, 77, 85, 50, 128, 76, 73, 77, 77, 85, 128, 76, 73, 77, 77,
+ 213, 76, 73, 77, 73, 84, 69, 196, 76, 73, 77, 73, 84, 65, 84, 73, 79, 78,
+ 128, 76, 73, 77, 73, 84, 128, 76, 73, 77, 69, 128, 76, 73, 76, 89, 128,
+ 76, 73, 76, 73, 84, 72, 128, 76, 73, 76, 128, 76, 73, 73, 128, 76, 73,
+ 71, 72, 84, 78, 73, 78, 71, 128, 76, 73, 71, 72, 84, 72, 79, 85, 83, 69,
128, 76, 73, 71, 72, 84, 128, 76, 73, 70, 69, 128, 76, 73, 69, 88, 128,
- 76, 73, 69, 84, 128, 76, 73, 69, 80, 128, 76, 73, 69, 128, 76, 73, 68,
- 128, 76, 73, 66, 82, 65, 128, 76, 73, 65, 66, 73, 76, 73, 84, 217, 76,
- 72, 79, 79, 128, 76, 72, 73, 73, 128, 76, 72, 65, 86, 73, 89, 65, 78, 73,
- 128, 76, 72, 65, 199, 76, 72, 65, 65, 128, 76, 72, 128, 76, 69, 90, 72,
- 128, 76, 69, 88, 128, 76, 69, 86, 69, 204, 76, 69, 84, 84, 69, 82, 128,
- 76, 69, 83, 83, 69, 210, 76, 69, 83, 83, 45, 84, 72, 65, 78, 128, 76, 69,
- 83, 83, 45, 84, 72, 65, 206, 76, 69, 80, 128, 76, 69, 79, 128, 76, 69,
- 78, 84, 73, 67, 85, 76, 65, 210, 76, 69, 78, 71, 84, 72, 69, 78, 69, 82,
- 128, 76, 69, 78, 71, 84, 200, 76, 69, 78, 71, 65, 128, 76, 69, 78, 71,
- 193, 76, 69, 77, 79, 73, 128, 76, 69, 203, 76, 69, 73, 77, 77, 65, 128,
- 76, 69, 73, 77, 77, 193, 76, 69, 71, 83, 128, 76, 69, 71, 73, 79, 78,
- 128, 76, 69, 71, 69, 84, 79, 211, 76, 69, 71, 128, 76, 69, 70, 84, 87,
- 65, 82, 68, 83, 128, 76, 69, 70, 84, 45, 84, 79, 45, 82, 73, 71, 72, 212,
- 76, 69, 70, 84, 45, 83, 84, 69, 205, 76, 69, 70, 84, 45, 83, 73, 68, 197,
- 76, 69, 70, 84, 45, 83, 72, 65, 68, 69, 196, 76, 69, 70, 84, 45, 80, 79,
- 73, 78, 84, 73, 78, 199, 76, 69, 70, 84, 45, 72, 65, 78, 196, 76, 69, 70,
- 84, 128, 76, 69, 69, 75, 128, 76, 69, 65, 84, 72, 69, 82, 128, 76, 69,
- 65, 70, 128, 76, 69, 65, 68, 69, 82, 128, 76, 68, 65, 78, 128, 76, 68,
- 50, 128, 76, 67, 201, 76, 67, 197, 76, 65, 90, 217, 76, 65, 89, 65, 78,
- 78, 65, 128, 76, 65, 88, 128, 76, 65, 215, 76, 65, 85, 76, 65, 128, 76,
- 65, 85, 75, 65, 218, 76, 65, 84, 73, 78, 65, 84, 197, 76, 65, 84, 73, 75,
- 128, 76, 65, 84, 69, 82, 65, 204, 76, 65, 84, 197, 76, 65, 84, 128, 76,
- 65, 83, 212, 76, 65, 82, 89, 78, 71, 69, 65, 204, 76, 65, 82, 71, 69,
- 210, 76, 65, 82, 71, 197, 76, 65, 80, 128, 76, 65, 78, 71, 85, 65, 71,
- 197, 76, 65, 77, 69, 68, 128, 76, 65, 77, 69, 196, 76, 65, 77, 69, 128,
- 76, 65, 77, 197, 76, 65, 77, 68, 65, 128, 76, 65, 77, 68, 128, 76, 65,
- 77, 66, 68, 193, 76, 65, 77, 65, 68, 72, 128, 76, 65, 76, 128, 76, 65,
- 204, 76, 65, 75, 75, 72, 65, 78, 71, 89, 65, 79, 128, 76, 65, 74, 65, 78,
- 89, 65, 76, 65, 78, 128, 76, 65, 72, 83, 72, 85, 128, 76, 65, 71, 85, 83,
+ 76, 73, 69, 84, 128, 76, 73, 69, 80, 128, 76, 73, 69, 69, 128, 76, 73,
+ 69, 128, 76, 73, 68, 128, 76, 73, 66, 82, 65, 128, 76, 73, 66, 69, 82,
+ 84, 89, 128, 76, 73, 65, 66, 73, 76, 73, 84, 217, 76, 72, 73, 73, 128,
+ 76, 72, 65, 86, 73, 89, 65, 78, 73, 128, 76, 72, 65, 199, 76, 72, 65, 65,
+ 128, 76, 72, 128, 76, 69, 90, 72, 128, 76, 69, 88, 128, 76, 69, 86, 69,
+ 204, 76, 69, 85, 77, 128, 76, 69, 85, 65, 69, 80, 128, 76, 69, 85, 65,
+ 69, 77, 128, 76, 69, 84, 84, 69, 82, 83, 128, 76, 69, 84, 84, 69, 82,
+ 128, 76, 69, 212, 76, 69, 83, 83, 69, 210, 76, 69, 83, 83, 45, 84, 72,
+ 65, 78, 128, 76, 69, 83, 83, 45, 84, 72, 65, 206, 76, 69, 80, 128, 76,
+ 69, 79, 80, 65, 82, 68, 128, 76, 69, 79, 128, 76, 69, 78, 84, 73, 67, 85,
+ 76, 65, 210, 76, 69, 78, 73, 83, 128, 76, 69, 78, 71, 84, 72, 69, 78, 69,
+ 82, 128, 76, 69, 78, 71, 84, 200, 76, 69, 78, 71, 65, 128, 76, 69, 78,
+ 71, 193, 76, 69, 77, 79, 78, 128, 76, 69, 77, 79, 73, 128, 76, 69, 76,
+ 69, 84, 128, 76, 69, 76, 69, 212, 76, 69, 203, 76, 69, 73, 77, 77, 65,
+ 128, 76, 69, 73, 77, 77, 193, 76, 69, 71, 83, 128, 76, 69, 71, 73, 79,
+ 78, 128, 76, 69, 71, 69, 84, 79, 211, 76, 69, 71, 128, 76, 69, 70, 84,
+ 87, 65, 82, 68, 83, 128, 76, 69, 70, 84, 45, 84, 79, 45, 82, 73, 71, 72,
+ 212, 76, 69, 70, 84, 45, 83, 84, 69, 205, 76, 69, 70, 84, 45, 83, 73, 68,
+ 197, 76, 69, 70, 84, 45, 83, 72, 65, 68, 69, 196, 76, 69, 70, 84, 45, 80,
+ 79, 73, 78, 84, 73, 78, 199, 76, 69, 70, 84, 45, 72, 65, 78, 68, 69, 196,
+ 76, 69, 70, 84, 45, 72, 65, 78, 196, 76, 69, 70, 84, 45, 70, 65, 67, 73,
+ 78, 199, 76, 69, 70, 84, 128, 76, 69, 69, 82, 65, 69, 87, 65, 128, 76,
+ 69, 69, 75, 128, 76, 69, 69, 69, 69, 128, 76, 69, 68, 71, 69, 82, 128,
+ 76, 69, 65, 84, 72, 69, 82, 128, 76, 69, 65, 70, 128, 76, 69, 65, 198,
+ 76, 69, 65, 68, 73, 78, 199, 76, 69, 65, 68, 69, 82, 128, 76, 69, 65,
+ 196, 76, 68, 65, 78, 128, 76, 68, 50, 128, 76, 67, 201, 76, 67, 197, 76,
+ 65, 90, 217, 76, 65, 89, 65, 78, 78, 65, 128, 76, 65, 88, 128, 76, 65,
+ 87, 128, 76, 65, 215, 76, 65, 85, 76, 65, 128, 76, 65, 85, 75, 65, 218,
+ 76, 65, 84, 73, 78, 65, 84, 197, 76, 65, 84, 73, 75, 128, 76, 65, 84, 69,
+ 82, 65, 204, 76, 65, 84, 197, 76, 65, 83, 212, 76, 65, 82, 89, 78, 71,
+ 69, 65, 204, 76, 65, 82, 71, 69, 210, 76, 65, 82, 71, 69, 128, 76, 65,
+ 82, 71, 197, 76, 65, 81, 128, 76, 65, 80, 65, 81, 128, 76, 65, 80, 128,
+ 76, 65, 207, 76, 65, 78, 84, 69, 82, 78, 128, 76, 65, 78, 71, 85, 65, 71,
+ 197, 76, 65, 78, 69, 83, 128, 76, 65, 77, 69, 68, 72, 128, 76, 65, 77,
+ 69, 68, 128, 76, 65, 77, 69, 196, 76, 65, 77, 69, 128, 76, 65, 77, 197,
+ 76, 65, 77, 68, 65, 128, 76, 65, 77, 68, 128, 76, 65, 77, 66, 68, 193,
+ 76, 65, 77, 65, 68, 72, 128, 76, 65, 76, 128, 76, 65, 204, 76, 65, 75,
+ 75, 72, 65, 78, 71, 89, 65, 79, 128, 76, 65, 74, 65, 78, 89, 65, 76, 65,
+ 78, 128, 76, 65, 201, 76, 65, 72, 83, 72, 85, 128, 76, 65, 71, 85, 83,
128, 76, 65, 71, 213, 76, 65, 71, 65, 82, 128, 76, 65, 71, 65, 210, 76,
- 65, 71, 65, 66, 128, 76, 65, 69, 86, 128, 76, 65, 69, 128, 76, 65, 67,
- 75, 128, 76, 65, 67, 65, 128, 76, 65, 66, 79, 85, 82, 73, 78, 71, 128,
- 76, 65, 66, 79, 82, 128, 76, 65, 66, 73, 65, 76, 73, 90, 65, 84, 73, 79,
- 206, 76, 65, 65, 78, 128, 76, 65, 65, 77, 85, 128, 76, 65, 65, 73, 128,
- 76, 45, 84, 89, 80, 197, 76, 45, 83, 72, 65, 80, 69, 196, 75, 89, 85, 82,
- 73, 73, 128, 75, 89, 85, 128, 75, 89, 79, 128, 75, 89, 76, 73, 83, 77,
- 65, 128, 75, 89, 73, 128, 75, 89, 69, 69, 128, 75, 89, 69, 128, 75, 89,
+ 65, 71, 65, 66, 128, 76, 65, 71, 65, 194, 76, 65, 69, 86, 128, 76, 65,
+ 69, 128, 76, 65, 68, 217, 76, 65, 67, 75, 128, 76, 65, 67, 65, 128, 76,
+ 65, 66, 79, 85, 82, 73, 78, 71, 128, 76, 65, 66, 79, 82, 128, 76, 65, 66,
+ 73, 65, 76, 73, 90, 65, 84, 73, 79, 206, 76, 65, 66, 65, 84, 128, 76, 65,
+ 65, 78, 65, 69, 128, 76, 65, 65, 78, 128, 76, 65, 65, 77, 85, 128, 76,
+ 65, 65, 77, 128, 76, 65, 65, 73, 128, 76, 48, 48, 54, 65, 128, 76, 48,
+ 48, 50, 65, 128, 76, 45, 84, 89, 80, 197, 76, 45, 83, 72, 65, 80, 69,
+ 196, 75, 89, 85, 82, 73, 73, 128, 75, 89, 85, 128, 75, 89, 79, 128, 75,
+ 89, 76, 73, 83, 77, 65, 128, 75, 89, 73, 128, 75, 89, 69, 128, 75, 89,
65, 84, 72, 79, 211, 75, 89, 65, 65, 128, 75, 89, 65, 128, 75, 88, 87,
73, 128, 75, 88, 87, 69, 69, 128, 75, 88, 87, 69, 128, 75, 88, 87, 65,
65, 128, 75, 88, 87, 65, 128, 75, 88, 85, 128, 75, 88, 79, 128, 75, 88,
73, 128, 75, 88, 69, 69, 128, 75, 88, 69, 128, 75, 88, 65, 65, 128, 75,
88, 65, 128, 75, 87, 85, 51, 49, 56, 128, 75, 87, 79, 79, 128, 75, 87,
79, 128, 75, 87, 73, 73, 128, 75, 87, 73, 128, 75, 87, 69, 69, 128, 75,
- 87, 69, 128, 75, 87, 65, 65, 128, 75, 86, 65, 128, 75, 86, 128, 75, 85,
- 88, 128, 75, 85, 85, 72, 128, 75, 85, 84, 128, 75, 85, 83, 77, 65, 128,
- 75, 85, 83, 72, 85, 50, 128, 75, 85, 82, 88, 128, 75, 85, 82, 85, 90, 69,
- 73, 82, 79, 128, 75, 85, 82, 84, 128, 75, 85, 82, 79, 79, 78, 69, 128,
- 75, 85, 82, 128, 75, 85, 210, 75, 85, 80, 128, 75, 85, 79, 88, 128, 75,
- 85, 79, 80, 128, 75, 85, 79, 128, 75, 85, 78, 71, 128, 75, 85, 78, 68,
- 68, 65, 76, 73, 89, 65, 128, 75, 85, 76, 128, 75, 85, 204, 75, 85, 55,
- 128, 75, 85, 52, 128, 75, 85, 180, 75, 85, 51, 128, 75, 85, 179, 75, 84,
- 128, 75, 83, 83, 65, 128, 75, 83, 73, 128, 75, 82, 69, 77, 65, 83, 84,
- 73, 128, 75, 82, 65, 84, 73, 77, 79, 89, 80, 79, 82, 82, 79, 79, 78, 128,
- 75, 82, 65, 84, 73, 77, 79, 75, 79, 85, 70, 73, 83, 77, 65, 128, 75, 82,
- 65, 84, 73, 77, 65, 84, 65, 128, 75, 82, 65, 84, 73, 77, 193, 75, 80, 85,
- 128, 75, 80, 79, 79, 128, 75, 80, 79, 128, 75, 80, 73, 128, 75, 80, 69,
- 78, 128, 75, 80, 69, 69, 128, 75, 80, 69, 128, 75, 80, 65, 78, 128, 75,
- 80, 65, 128, 75, 79, 88, 128, 75, 79, 84, 79, 128, 75, 79, 84, 128, 75,
- 79, 82, 85, 78, 65, 128, 75, 79, 82, 79, 78, 73, 83, 128, 75, 79, 82, 69,
- 65, 206, 75, 79, 82, 65, 78, 73, 195, 75, 79, 80, 80, 65, 128, 75, 79,
- 80, 128, 75, 79, 79, 80, 79, 128, 75, 79, 79, 77, 85, 85, 84, 128, 75,
- 79, 79, 128, 75, 79, 78, 84, 69, 86, 77, 65, 128, 75, 79, 78, 84, 69, 86,
- 77, 193, 75, 79, 77, 201, 75, 79, 77, 66, 85, 86, 65, 128, 75, 79, 77,
- 66, 85, 86, 193, 75, 79, 77, 66, 213, 75, 79, 72, 128, 75, 79, 69, 84,
- 128, 75, 79, 65, 128, 75, 78, 73, 71, 72, 84, 128, 75, 78, 73, 70, 69,
- 128, 75, 78, 73, 70, 197, 75, 77, 128, 75, 205, 75, 76, 73, 84, 79, 78,
- 128, 75, 76, 65, 83, 77, 65, 128, 75, 76, 65, 83, 77, 193, 75, 76, 65,
- 128, 75, 76, 128, 75, 75, 85, 128, 75, 75, 79, 128, 75, 75, 73, 128, 75,
- 75, 69, 69, 128, 75, 75, 69, 128, 75, 75, 65, 128, 75, 75, 128, 75, 74,
- 69, 128, 75, 73, 89, 69, 79, 75, 45, 83, 73, 79, 83, 45, 75, 73, 89, 69,
- 79, 75, 128, 75, 73, 89, 69, 79, 75, 45, 82, 73, 69, 85, 76, 128, 75, 73,
- 89, 69, 79, 203, 75, 73, 88, 128, 75, 73, 84, 128, 75, 73, 83, 73, 77,
+ 87, 69, 128, 75, 87, 65, 89, 128, 75, 87, 65, 69, 84, 128, 75, 87, 65,
+ 65, 128, 75, 86, 65, 128, 75, 86, 128, 75, 85, 88, 128, 75, 85, 85, 72,
+ 128, 75, 85, 84, 128, 75, 85, 83, 77, 65, 128, 75, 85, 83, 72, 85, 50,
+ 128, 75, 85, 82, 88, 128, 75, 85, 82, 85, 90, 69, 73, 82, 79, 128, 75,
+ 85, 82, 84, 128, 75, 85, 82, 79, 79, 78, 69, 128, 75, 85, 82, 128, 75,
+ 85, 210, 75, 85, 81, 128, 75, 85, 79, 88, 128, 75, 85, 79, 80, 128, 75,
+ 85, 79, 208, 75, 85, 79, 77, 128, 75, 85, 79, 128, 75, 85, 78, 71, 128,
+ 75, 85, 78, 68, 68, 65, 76, 73, 89, 65, 128, 75, 85, 76, 128, 75, 85,
+ 204, 75, 85, 69, 84, 128, 75, 85, 55, 128, 75, 85, 52, 128, 75, 85, 180,
+ 75, 85, 51, 128, 75, 85, 179, 75, 84, 128, 75, 83, 83, 65, 128, 75, 83,
+ 73, 128, 75, 82, 69, 77, 65, 83, 84, 73, 128, 75, 82, 65, 84, 73, 77, 79,
+ 89, 80, 79, 82, 82, 79, 79, 78, 128, 75, 82, 65, 84, 73, 77, 79, 75, 79,
+ 85, 70, 73, 83, 77, 65, 128, 75, 82, 65, 84, 73, 77, 65, 84, 65, 128, 75,
+ 82, 65, 84, 73, 77, 193, 75, 80, 85, 128, 75, 80, 79, 81, 128, 75, 80,
+ 79, 79, 128, 75, 80, 79, 128, 75, 80, 73, 128, 75, 80, 69, 85, 88, 128,
+ 75, 80, 69, 69, 128, 75, 80, 69, 128, 75, 80, 65, 82, 65, 81, 128, 75,
+ 80, 65, 78, 128, 75, 80, 65, 128, 75, 79, 88, 128, 75, 79, 86, 85, 85,
+ 128, 75, 79, 84, 79, 128, 75, 79, 82, 85, 78, 65, 128, 75, 79, 82, 79,
+ 78, 73, 83, 128, 75, 79, 82, 69, 65, 206, 75, 79, 82, 65, 78, 73, 195,
+ 75, 79, 81, 78, 68, 79, 78, 128, 75, 79, 80, 80, 65, 128, 75, 79, 80,
+ 128, 75, 79, 79, 80, 79, 128, 75, 79, 79, 77, 85, 85, 84, 128, 75, 79,
+ 79, 128, 75, 79, 78, 84, 69, 86, 77, 65, 128, 75, 79, 78, 84, 69, 86, 77,
+ 193, 75, 79, 77, 201, 75, 79, 77, 66, 85, 86, 65, 128, 75, 79, 77, 66,
+ 85, 86, 193, 75, 79, 77, 66, 213, 75, 79, 75, 79, 128, 75, 79, 75, 128,
+ 75, 79, 203, 75, 79, 73, 128, 75, 79, 201, 75, 79, 72, 128, 75, 79, 71,
+ 72, 79, 77, 128, 75, 79, 69, 84, 128, 75, 79, 65, 76, 65, 128, 75, 79,
+ 65, 128, 75, 78, 73, 71, 72, 84, 128, 75, 78, 73, 71, 72, 212, 75, 78,
+ 73, 70, 69, 128, 75, 78, 73, 70, 197, 75, 77, 128, 75, 205, 75, 76, 73,
+ 84, 79, 78, 128, 75, 76, 65, 83, 77, 65, 128, 75, 76, 65, 83, 77, 193,
+ 75, 76, 65, 128, 75, 76, 128, 75, 75, 85, 128, 75, 75, 79, 128, 75, 75,
+ 73, 128, 75, 75, 69, 69, 128, 75, 75, 69, 128, 75, 75, 65, 128, 75, 75,
+ 128, 75, 74, 69, 128, 75, 73, 89, 69, 79, 75, 45, 84, 73, 75, 69, 85, 84,
+ 128, 75, 73, 89, 69, 79, 75, 45, 83, 73, 79, 83, 45, 75, 73, 89, 69, 79,
+ 75, 128, 75, 73, 89, 69, 79, 75, 45, 82, 73, 69, 85, 76, 128, 75, 73, 89,
+ 69, 79, 75, 45, 80, 73, 69, 85, 80, 128, 75, 73, 89, 69, 79, 75, 45, 78,
+ 73, 69, 85, 78, 128, 75, 73, 89, 69, 79, 75, 45, 75, 72, 73, 69, 85, 75,
+ 72, 128, 75, 73, 89, 69, 79, 75, 45, 67, 72, 73, 69, 85, 67, 72, 128, 75,
+ 73, 89, 69, 79, 203, 75, 73, 88, 128, 75, 73, 84, 128, 75, 73, 83, 83,
+ 73, 78, 199, 75, 73, 83, 83, 128, 75, 73, 83, 211, 75, 73, 83, 73, 77,
53, 128, 75, 73, 83, 73, 77, 181, 75, 73, 83, 72, 128, 75, 73, 83, 65,
76, 128, 75, 73, 82, 79, 87, 65, 84, 84, 79, 128, 75, 73, 82, 79, 77, 69,
69, 84, 79, 82, 85, 128, 75, 73, 82, 79, 71, 85, 82, 65, 77, 85, 128, 75,
- 73, 82, 79, 128, 75, 73, 82, 71, 72, 73, 218, 75, 73, 80, 128, 75, 73,
- 208, 75, 73, 78, 83, 72, 73, 80, 128, 75, 73, 73, 128, 75, 73, 72, 128,
- 75, 73, 69, 88, 128, 75, 73, 69, 80, 128, 75, 73, 69, 128, 75, 73, 68,
- 128, 75, 73, 196, 75, 73, 67, 75, 128, 75, 72, 90, 128, 75, 72, 87, 65,
- 73, 128, 75, 72, 85, 65, 84, 128, 75, 72, 79, 212, 75, 72, 79, 78, 128,
- 75, 72, 79, 77, 85, 84, 128, 75, 72, 79, 128, 75, 72, 207, 75, 72, 73,
- 69, 85, 75, 200, 75, 72, 73, 128, 75, 72, 72, 65, 128, 75, 72, 69, 73,
- 128, 75, 72, 69, 69, 128, 75, 72, 69, 128, 75, 72, 65, 82, 128, 75, 72,
- 65, 80, 72, 128, 75, 72, 65, 78, 199, 75, 72, 65, 78, 68, 193, 75, 72,
- 65, 78, 128, 75, 72, 65, 75, 65, 83, 83, 73, 65, 206, 75, 72, 65, 73,
- 128, 75, 72, 65, 72, 128, 75, 72, 65, 65, 128, 75, 71, 128, 75, 69, 89,
- 67, 65, 80, 128, 75, 69, 89, 66, 79, 65, 82, 68, 128, 75, 69, 89, 128,
- 75, 69, 217, 75, 69, 88, 128, 75, 69, 84, 84, 201, 75, 69, 83, 72, 50,
- 128, 75, 69, 80, 128, 75, 69, 78, 84, 73, 77, 65, 84, 65, 128, 75, 69,
- 78, 84, 73, 77, 65, 84, 193, 75, 69, 78, 84, 73, 77, 193, 75, 69, 78, 65,
- 84, 128, 75, 69, 78, 128, 75, 69, 77, 80, 85, 76, 128, 75, 69, 77, 80,
- 85, 204, 75, 69, 77, 80, 76, 73, 128, 75, 69, 77, 80, 76, 201, 75, 69,
- 77, 80, 72, 82, 69, 78, 71, 128, 75, 69, 77, 66, 65, 78, 71, 128, 75, 69,
- 76, 86, 73, 206, 75, 69, 72, 69, 72, 128, 75, 69, 72, 69, 200, 75, 69,
- 72, 128, 75, 69, 70, 85, 76, 65, 128, 75, 69, 69, 83, 85, 128, 75, 69,
- 69, 80, 73, 78, 199, 75, 69, 69, 78, 71, 128, 75, 67, 65, 76, 128, 75,
- 66, 128, 75, 65, 90, 65, 75, 200, 75, 65, 89, 65, 78, 78, 65, 128, 75,
- 65, 89, 65, 200, 75, 65, 88, 128, 75, 65, 86, 89, 75, 65, 128, 75, 65,
- 85, 78, 65, 128, 75, 65, 85, 206, 75, 65, 84, 79, 128, 75, 65, 84, 72,
- 73, 83, 84, 73, 128, 75, 65, 84, 65, 86, 65, 83, 77, 65, 128, 75, 65, 84,
- 65, 86, 193, 75, 65, 84, 65, 75, 65, 78, 65, 45, 72, 73, 82, 65, 71, 65,
- 78, 193, 75, 65, 84, 128, 75, 65, 83, 82, 65, 84, 65, 78, 128, 75, 65,
- 83, 82, 65, 84, 65, 206, 75, 65, 83, 82, 65, 128, 75, 65, 83, 82, 193,
- 75, 65, 83, 75, 65, 76, 128, 75, 65, 83, 75, 65, 204, 75, 65, 82, 79, 82,
- 73, 73, 128, 75, 65, 82, 69, 206, 75, 65, 82, 65, 84, 84, 79, 128, 75,
- 65, 80, 89, 69, 79, 85, 78, 83, 83, 65, 78, 71, 80, 73, 69, 85, 80, 128,
- 75, 65, 80, 89, 69, 79, 85, 78, 82, 73, 69, 85, 76, 128, 75, 65, 80, 89,
- 69, 79, 85, 78, 80, 72, 73, 69, 85, 80, 72, 128, 75, 65, 80, 89, 69, 79,
- 85, 78, 77, 73, 69, 85, 77, 128, 75, 65, 80, 80, 65, 128, 75, 65, 80, 80,
- 193, 75, 65, 80, 79, 128, 75, 65, 80, 72, 128, 75, 65, 80, 65, 76, 128,
- 75, 65, 80, 65, 128, 75, 65, 80, 128, 75, 65, 78, 84, 65, 74, 193, 75,
- 65, 78, 71, 128, 75, 65, 78, 65, 75, 79, 128, 75, 65, 77, 52, 128, 75,
- 65, 77, 50, 128, 75, 65, 75, 79, 128, 75, 65, 75, 65, 66, 65, 84, 128,
- 75, 65, 75, 128, 75, 65, 203, 75, 65, 73, 82, 73, 128, 75, 65, 73, 128,
- 75, 65, 201, 75, 65, 70, 128, 75, 65, 198, 75, 65, 68, 53, 128, 75, 65,
- 68, 181, 75, 65, 68, 52, 128, 75, 65, 68, 51, 128, 75, 65, 68, 179, 75,
- 65, 68, 50, 128, 75, 65, 66, 193, 75, 65, 66, 128, 75, 65, 65, 73, 128,
- 75, 65, 65, 70, 85, 128, 75, 65, 65, 70, 128, 75, 65, 50, 128, 75, 65,
- 178, 74, 87, 65, 128, 74, 85, 84, 128, 74, 85, 80, 73, 84, 69, 82, 128,
- 74, 85, 79, 84, 128, 74, 85, 79, 80, 128, 74, 85, 78, 79, 128, 74, 85,
- 78, 69, 128, 74, 85, 76, 89, 128, 74, 85, 69, 85, 73, 128, 74, 85, 68,
- 71, 69, 128, 74, 85, 68, 69, 79, 45, 83, 80, 65, 78, 73, 83, 200, 74, 79,
- 89, 79, 85, 211, 74, 79, 89, 128, 74, 79, 212, 74, 79, 78, 71, 128, 74,
- 79, 78, 193, 74, 79, 75, 69, 82, 128, 74, 79, 73, 78, 69, 68, 128, 74,
- 79, 73, 78, 128, 74, 79, 65, 128, 74, 74, 89, 88, 128, 74, 74, 89, 84,
- 128, 74, 74, 89, 80, 128, 74, 74, 89, 128, 74, 74, 85, 88, 128, 74, 74,
- 85, 84, 128, 74, 74, 85, 82, 88, 128, 74, 74, 85, 82, 128, 74, 74, 85,
- 80, 128, 74, 74, 85, 79, 88, 128, 74, 74, 85, 79, 80, 128, 74, 74, 85,
- 79, 128, 74, 74, 85, 128, 74, 74, 79, 88, 128, 74, 74, 79, 84, 128, 74,
- 74, 79, 80, 128, 74, 74, 79, 128, 74, 74, 73, 88, 128, 74, 74, 73, 84,
- 128, 74, 74, 73, 80, 128, 74, 74, 73, 69, 88, 128, 74, 74, 73, 69, 84,
- 128, 74, 74, 73, 69, 80, 128, 74, 74, 73, 69, 128, 74, 74, 73, 128, 74,
- 74, 69, 69, 128, 74, 74, 69, 128, 74, 74, 65, 128, 74, 73, 76, 128, 74,
- 73, 72, 86, 65, 77, 85, 76, 73, 89, 65, 128, 74, 73, 65, 128, 74, 72, 79,
- 128, 74, 72, 69, 72, 128, 74, 72, 65, 78, 128, 74, 72, 65, 128, 74, 69,
- 82, 85, 83, 65, 76, 69, 77, 128, 74, 69, 82, 65, 206, 74, 69, 82, 65,
- 128, 74, 69, 82, 128, 74, 69, 72, 128, 74, 69, 200, 74, 69, 71, 79, 71,
- 65, 78, 128, 74, 69, 69, 77, 128, 74, 65, 89, 65, 78, 78, 65, 128, 74,
- 65, 86, 73, 89, 65, 78, 73, 128, 74, 65, 82, 128, 74, 65, 80, 65, 78, 69,
- 83, 197, 74, 65, 78, 85, 65, 82, 89, 128, 74, 65, 76, 76, 65, 74, 65, 76,
- 65, 76, 79, 85, 72, 79, 85, 128, 74, 65, 68, 69, 128, 74, 65, 65, 128,
- 74, 45, 83, 73, 77, 80, 76, 73, 70, 73, 69, 196, 202, 73, 90, 72, 73, 84,
- 83, 65, 128, 73, 90, 72, 73, 84, 83, 193, 73, 90, 72, 69, 128, 73, 89,
- 65, 78, 78, 65, 128, 73, 89, 128, 73, 85, 74, 65, 128, 73, 85, 128, 73,
- 84, 69, 82, 65, 84, 73, 79, 206, 73, 84, 69, 77, 128, 73, 83, 83, 72, 65,
- 82, 128, 73, 83, 211, 73, 83, 79, 78, 128, 73, 83, 79, 206, 73, 83, 65,
- 75, 73, 193, 73, 83, 45, 80, 73, 76, 76, 65, 128, 73, 82, 85, 89, 65, 78,
- 78, 65, 128, 73, 82, 85, 85, 89, 65, 78, 78, 65, 128, 73, 79, 84, 73, 70,
- 73, 69, 196, 73, 79, 84, 65, 84, 69, 196, 73, 79, 84, 65, 128, 73, 79,
- 84, 193, 73, 79, 82, 128, 73, 79, 68, 72, 65, 68, 72, 128, 73, 78, 86,
- 73, 83, 73, 66, 76, 197, 73, 78, 86, 69, 82, 84, 69, 68, 128, 73, 78, 86,
- 69, 82, 84, 69, 196, 73, 78, 86, 69, 82, 83, 197, 73, 78, 84, 73, 128,
- 73, 78, 84, 69, 82, 83, 89, 76, 76, 65, 66, 73, 195, 73, 78, 84, 69, 82,
- 83, 69, 67, 84, 73, 79, 78, 128, 73, 78, 84, 69, 82, 83, 69, 67, 84, 73,
- 79, 206, 73, 78, 84, 69, 82, 83, 69, 67, 84, 73, 78, 199, 73, 78, 84, 69,
- 82, 82, 79, 66, 65, 78, 71, 128, 73, 78, 84, 69, 82, 80, 79, 76, 65, 84,
- 73, 79, 206, 73, 78, 84, 69, 82, 76, 79, 67, 75, 69, 196, 73, 78, 84, 69,
- 82, 76, 73, 78, 69, 65, 210, 73, 78, 84, 69, 82, 73, 79, 210, 73, 78, 84,
- 69, 82, 69, 83, 212, 73, 78, 84, 69, 82, 67, 65, 76, 65, 84, 69, 128, 73,
- 78, 84, 69, 71, 82, 65, 84, 73, 79, 78, 128, 73, 78, 84, 69, 71, 82, 65,
- 84, 73, 79, 206, 73, 78, 84, 69, 71, 82, 65, 76, 128, 73, 78, 84, 69, 71,
- 82, 65, 204, 73, 78, 83, 85, 76, 65, 210, 73, 78, 83, 84, 82, 85, 77, 69,
- 78, 84, 65, 204, 73, 78, 83, 73, 68, 69, 128, 73, 78, 83, 69, 82, 84, 73,
- 79, 206, 73, 78, 83, 69, 67, 84, 128, 73, 78, 78, 79, 67, 69, 78, 67, 69,
+ 73, 82, 79, 128, 75, 73, 82, 71, 72, 73, 218, 75, 73, 81, 128, 75, 73,
+ 80, 128, 75, 73, 208, 75, 73, 78, 83, 72, 73, 80, 128, 75, 73, 78, 68,
+ 69, 82, 71, 65, 82, 84, 69, 78, 128, 75, 73, 77, 79, 78, 79, 128, 75, 73,
+ 73, 128, 75, 73, 72, 128, 75, 73, 69, 88, 128, 75, 73, 69, 80, 128, 75,
+ 73, 69, 69, 77, 128, 75, 73, 69, 128, 75, 73, 68, 128, 75, 73, 196, 75,
+ 73, 67, 75, 128, 75, 72, 90, 128, 75, 72, 87, 65, 73, 128, 75, 72, 85,
+ 69, 78, 45, 76, 85, 197, 75, 72, 85, 69, 206, 75, 72, 85, 65, 84, 128,
+ 75, 72, 79, 85, 128, 75, 72, 79, 212, 75, 72, 79, 78, 128, 75, 72, 79,
+ 77, 85, 84, 128, 75, 72, 79, 128, 75, 72, 207, 75, 72, 73, 84, 128, 75,
+ 72, 73, 69, 85, 75, 200, 75, 72, 73, 128, 75, 72, 72, 79, 128, 75, 72,
+ 72, 65, 128, 75, 72, 69, 84, 72, 128, 75, 72, 69, 73, 128, 75, 72, 69,
+ 69, 128, 75, 72, 69, 128, 75, 72, 65, 82, 79, 83, 72, 84, 72, 201, 75,
+ 72, 65, 82, 128, 75, 72, 65, 80, 72, 128, 75, 72, 65, 78, 199, 75, 72,
+ 65, 78, 68, 193, 75, 72, 65, 78, 128, 75, 72, 65, 77, 84, 201, 75, 72,
+ 65, 75, 65, 83, 83, 73, 65, 206, 75, 72, 65, 73, 128, 75, 72, 65, 72,
+ 128, 75, 72, 65, 200, 75, 72, 65, 65, 128, 75, 71, 128, 75, 69, 89, 67,
+ 65, 80, 128, 75, 69, 89, 67, 65, 208, 75, 69, 89, 66, 79, 65, 82, 68,
+ 128, 75, 69, 88, 128, 75, 69, 85, 89, 69, 85, 88, 128, 75, 69, 85, 83,
+ 72, 69, 85, 65, 69, 80, 128, 75, 69, 85, 83, 69, 85, 88, 128, 75, 69, 85,
+ 80, 85, 81, 128, 75, 69, 85, 79, 212, 75, 69, 85, 77, 128, 75, 69, 85,
+ 75, 69, 85, 84, 78, 68, 65, 128, 75, 69, 85, 75, 65, 81, 128, 75, 69, 85,
+ 65, 69, 84, 77, 69, 85, 78, 128, 75, 69, 85, 65, 69, 82, 73, 128, 75, 69,
+ 84, 84, 201, 75, 69, 83, 72, 50, 128, 75, 69, 82, 69, 84, 128, 75, 69,
+ 79, 87, 128, 75, 69, 78, 84, 73, 77, 65, 84, 65, 128, 75, 69, 78, 84, 73,
+ 77, 65, 84, 193, 75, 69, 78, 84, 73, 77, 193, 75, 69, 78, 65, 84, 128,
+ 75, 69, 78, 128, 75, 69, 206, 75, 69, 77, 80, 85, 76, 128, 75, 69, 77,
+ 80, 85, 204, 75, 69, 77, 80, 76, 73, 128, 75, 69, 77, 80, 76, 201, 75,
+ 69, 77, 80, 72, 82, 69, 78, 71, 128, 75, 69, 77, 66, 65, 78, 71, 128, 75,
+ 69, 76, 86, 73, 206, 75, 69, 72, 69, 72, 128, 75, 69, 72, 69, 200, 75,
+ 69, 72, 128, 75, 69, 70, 85, 76, 65, 128, 75, 69, 69, 83, 85, 128, 75,
+ 69, 69, 80, 73, 78, 199, 75, 69, 69, 78, 71, 128, 75, 67, 65, 76, 128,
+ 75, 66, 128, 75, 65, 90, 65, 75, 200, 75, 65, 89, 65, 78, 78, 65, 128,
+ 75, 65, 89, 65, 200, 75, 65, 88, 128, 75, 65, 87, 73, 128, 75, 65, 86,
+ 89, 75, 65, 128, 75, 65, 85, 78, 65, 128, 75, 65, 85, 206, 75, 65, 84,
+ 79, 128, 75, 65, 84, 72, 73, 83, 84, 73, 128, 75, 65, 84, 72, 65, 75,
+ 193, 75, 65, 84, 65, 86, 65, 83, 77, 65, 128, 75, 65, 84, 65, 86, 193,
+ 75, 65, 84, 65, 75, 65, 78, 65, 45, 72, 73, 82, 65, 71, 65, 78, 193, 75,
+ 65, 83, 82, 65, 84, 65, 78, 128, 75, 65, 83, 82, 65, 84, 65, 206, 75, 65,
+ 83, 82, 65, 128, 75, 65, 83, 82, 193, 75, 65, 83, 75, 65, 76, 128, 75,
+ 65, 83, 75, 65, 204, 75, 65, 83, 72, 77, 73, 82, 201, 75, 65, 82, 83, 72,
+ 65, 78, 65, 128, 75, 65, 82, 79, 82, 73, 73, 128, 75, 65, 82, 207, 75,
+ 65, 82, 69, 206, 75, 65, 82, 65, 84, 84, 79, 128, 75, 65, 82, 65, 78,
+ 128, 75, 65, 80, 89, 69, 79, 85, 78, 83, 83, 65, 78, 71, 80, 73, 69, 85,
+ 80, 128, 75, 65, 80, 89, 69, 79, 85, 78, 82, 73, 69, 85, 76, 128, 75, 65,
+ 80, 89, 69, 79, 85, 78, 80, 72, 73, 69, 85, 80, 72, 128, 75, 65, 80, 89,
+ 69, 79, 85, 78, 77, 73, 69, 85, 77, 128, 75, 65, 80, 80, 65, 128, 75, 65,
+ 80, 80, 193, 75, 65, 80, 79, 128, 75, 65, 80, 72, 128, 75, 65, 80, 65,
+ 76, 128, 75, 65, 80, 65, 128, 75, 65, 78, 84, 65, 74, 193, 75, 65, 78,
+ 71, 128, 75, 65, 78, 199, 75, 65, 78, 65, 75, 79, 128, 75, 65, 77, 52,
+ 128, 75, 65, 77, 50, 128, 75, 65, 77, 128, 75, 65, 75, 79, 128, 75, 65,
+ 75, 65, 66, 65, 84, 128, 75, 65, 75, 128, 75, 65, 203, 75, 65, 73, 82,
+ 73, 128, 75, 65, 73, 128, 75, 65, 201, 75, 65, 70, 65, 128, 75, 65, 70,
+ 128, 75, 65, 198, 75, 65, 68, 53, 128, 75, 65, 68, 181, 75, 65, 68, 52,
+ 128, 75, 65, 68, 51, 128, 75, 65, 68, 179, 75, 65, 68, 50, 128, 75, 65,
+ 68, 128, 75, 65, 66, 193, 75, 65, 66, 128, 75, 65, 65, 73, 128, 75, 65,
+ 65, 70, 85, 128, 75, 65, 65, 70, 128, 75, 65, 50, 128, 75, 65, 178, 75,
+ 48, 48, 56, 128, 75, 48, 48, 55, 128, 75, 48, 48, 54, 128, 75, 48, 48,
+ 53, 128, 75, 48, 48, 52, 128, 75, 48, 48, 51, 128, 75, 48, 48, 50, 128,
+ 75, 48, 48, 49, 128, 74, 87, 65, 128, 74, 85, 85, 128, 74, 85, 84, 128,
+ 74, 85, 80, 73, 84, 69, 82, 128, 74, 85, 79, 84, 128, 74, 85, 79, 80,
+ 128, 74, 85, 78, 79, 128, 74, 85, 78, 69, 128, 74, 85, 76, 89, 128, 74,
+ 85, 69, 85, 73, 128, 74, 85, 68, 85, 76, 128, 74, 85, 68, 71, 69, 128,
+ 74, 85, 68, 69, 79, 45, 83, 80, 65, 78, 73, 83, 200, 74, 79, 89, 79, 85,
+ 211, 74, 79, 89, 128, 74, 79, 86, 69, 128, 74, 79, 212, 74, 79, 78, 71,
+ 128, 74, 79, 78, 193, 74, 79, 75, 69, 82, 128, 74, 79, 73, 78, 69, 68,
+ 128, 74, 79, 73, 78, 128, 74, 79, 65, 128, 74, 74, 89, 88, 128, 74, 74,
+ 89, 84, 128, 74, 74, 89, 80, 128, 74, 74, 89, 128, 74, 74, 85, 88, 128,
+ 74, 74, 85, 84, 128, 74, 74, 85, 82, 88, 128, 74, 74, 85, 82, 128, 74,
+ 74, 85, 80, 128, 74, 74, 85, 79, 88, 128, 74, 74, 85, 79, 80, 128, 74,
+ 74, 85, 79, 128, 74, 74, 85, 128, 74, 74, 79, 88, 128, 74, 74, 79, 84,
+ 128, 74, 74, 79, 80, 128, 74, 74, 79, 128, 74, 74, 73, 88, 128, 74, 74,
+ 73, 84, 128, 74, 74, 73, 80, 128, 74, 74, 73, 69, 88, 128, 74, 74, 73,
+ 69, 84, 128, 74, 74, 73, 69, 80, 128, 74, 74, 73, 69, 128, 74, 74, 73,
+ 128, 74, 74, 69, 69, 128, 74, 74, 69, 128, 74, 74, 65, 128, 74, 73, 76,
+ 128, 74, 73, 72, 86, 65, 77, 85, 76, 73, 89, 65, 128, 74, 73, 65, 128,
+ 74, 72, 79, 128, 74, 72, 69, 72, 128, 74, 72, 65, 78, 128, 74, 72, 65,
+ 77, 128, 74, 72, 65, 128, 74, 69, 85, 128, 74, 69, 82, 85, 83, 65, 76,
+ 69, 77, 128, 74, 69, 82, 65, 206, 74, 69, 82, 65, 128, 74, 69, 82, 128,
+ 74, 69, 72, 128, 74, 69, 200, 74, 69, 71, 79, 71, 65, 78, 128, 74, 69,
+ 69, 77, 128, 74, 69, 65, 78, 83, 128, 74, 65, 89, 65, 78, 78, 65, 128,
+ 74, 65, 86, 73, 89, 65, 78, 73, 128, 74, 65, 82, 128, 74, 65, 80, 65, 78,
+ 69, 83, 197, 74, 65, 80, 65, 78, 128, 74, 65, 78, 85, 65, 82, 89, 128,
+ 74, 65, 76, 76, 65, 74, 65, 76, 65, 76, 79, 85, 72, 79, 85, 128, 74, 65,
+ 68, 69, 128, 74, 65, 67, 75, 45, 79, 45, 76, 65, 78, 84, 69, 82, 78, 128,
+ 74, 65, 67, 203, 74, 45, 83, 73, 77, 80, 76, 73, 70, 73, 69, 196, 202,
+ 73, 90, 72, 73, 84, 83, 65, 128, 73, 90, 72, 73, 84, 83, 193, 73, 90, 72,
+ 69, 128, 73, 90, 65, 75, 65, 89, 193, 73, 89, 69, 75, 128, 73, 89, 65,
+ 78, 78, 65, 128, 73, 85, 74, 65, 128, 73, 85, 128, 73, 84, 211, 73, 84,
+ 69, 82, 65, 84, 73, 79, 206, 73, 84, 69, 77, 128, 73, 83, 83, 72, 65, 82,
+ 128, 73, 83, 79, 78, 128, 73, 83, 79, 206, 73, 83, 69, 78, 45, 73, 83,
+ 69, 78, 128, 73, 83, 65, 75, 73, 193, 73, 83, 45, 80, 73, 76, 76, 65,
+ 128, 73, 82, 85, 89, 65, 78, 78, 65, 128, 73, 82, 85, 85, 89, 65, 78, 78,
+ 65, 128, 73, 82, 79, 78, 45, 67, 79, 80, 80, 69, 210, 73, 82, 79, 78,
+ 128, 73, 79, 84, 73, 70, 73, 69, 196, 73, 79, 84, 65, 84, 69, 196, 73,
+ 79, 84, 65, 128, 73, 79, 84, 193, 73, 79, 82, 128, 73, 79, 68, 72, 65,
+ 68, 72, 128, 73, 78, 86, 73, 83, 73, 66, 76, 197, 73, 78, 86, 69, 82, 84,
+ 69, 68, 128, 73, 78, 86, 69, 82, 84, 69, 196, 73, 78, 86, 69, 82, 83,
+ 197, 73, 78, 84, 73, 128, 73, 78, 84, 69, 82, 83, 89, 76, 76, 65, 66, 73,
+ 195, 73, 78, 84, 69, 82, 83, 69, 67, 84, 73, 79, 78, 128, 73, 78, 84, 69,
+ 82, 83, 69, 67, 84, 73, 79, 206, 73, 78, 84, 69, 82, 83, 69, 67, 84, 73,
+ 78, 199, 73, 78, 84, 69, 82, 82, 79, 66, 65, 78, 71, 128, 73, 78, 84, 69,
+ 82, 80, 79, 76, 65, 84, 73, 79, 206, 73, 78, 84, 69, 82, 76, 79, 67, 75,
+ 69, 196, 73, 78, 84, 69, 82, 76, 73, 78, 69, 65, 210, 73, 78, 84, 69, 82,
+ 76, 65, 67, 69, 196, 73, 78, 84, 69, 82, 73, 79, 210, 73, 78, 84, 69, 82,
+ 69, 83, 212, 73, 78, 84, 69, 82, 67, 65, 76, 65, 84, 69, 128, 73, 78, 84,
+ 69, 71, 82, 65, 84, 73, 79, 78, 128, 73, 78, 84, 69, 71, 82, 65, 84, 73,
+ 79, 206, 73, 78, 84, 69, 71, 82, 65, 76, 128, 73, 78, 84, 69, 71, 82, 65,
+ 204, 73, 78, 83, 85, 76, 65, 210, 73, 78, 83, 84, 82, 85, 77, 69, 78, 84,
+ 65, 204, 73, 78, 83, 73, 68, 69, 128, 73, 78, 83, 69, 82, 84, 73, 79,
+ 206, 73, 78, 83, 69, 67, 84, 128, 73, 78, 83, 67, 82, 73, 80, 84, 73, 79,
+ 78, 65, 204, 73, 78, 80, 85, 212, 73, 78, 78, 79, 67, 69, 78, 67, 69,
128, 73, 78, 78, 78, 128, 73, 78, 78, 69, 82, 128, 73, 78, 78, 69, 210,
73, 78, 78, 128, 73, 78, 73, 78, 71, 85, 128, 73, 78, 73, 128, 73, 78,
72, 73, 66, 73, 212, 73, 78, 72, 69, 82, 69, 78, 212, 73, 78, 71, 87, 65,
90, 128, 73, 78, 70, 79, 82, 77, 65, 84, 73, 79, 206, 73, 78, 70, 76, 85,
69, 78, 67, 69, 128, 73, 78, 70, 73, 78, 73, 84, 89, 128, 73, 78, 70, 73,
78, 73, 84, 217, 73, 78, 68, 85, 83, 84, 82, 73, 65, 204, 73, 78, 68, 73,
- 82, 69, 67, 212, 73, 78, 68, 73, 67, 65, 84, 79, 82, 128, 73, 78, 68, 69,
- 88, 128, 73, 78, 68, 69, 80, 69, 78, 68, 69, 78, 212, 73, 78, 67, 82, 69,
- 77, 69, 78, 84, 128, 73, 78, 67, 82, 69, 65, 83, 69, 211, 73, 78, 67, 82,
- 69, 65, 83, 69, 128, 73, 78, 67, 79, 77, 80, 76, 69, 84, 197, 73, 78, 67,
- 76, 85, 68, 73, 78, 199, 73, 78, 67, 72, 128, 73, 77, 80, 69, 82, 70, 69,
- 67, 84, 85, 205, 73, 77, 80, 69, 82, 70, 69, 67, 84, 65, 128, 73, 77, 80,
- 69, 82, 70, 69, 67, 84, 193, 73, 77, 73, 83, 69, 79, 211, 73, 77, 73, 78,
- 51, 128, 73, 77, 73, 78, 128, 73, 77, 73, 206, 73, 77, 73, 70, 84, 72,
- 79, 82, 79, 78, 128, 73, 77, 73, 70, 84, 72, 79, 82, 65, 128, 73, 77, 73,
- 70, 79, 78, 79, 78, 128, 73, 77, 73, 68, 73, 65, 82, 71, 79, 78, 128, 73,
- 77, 65, 71, 197, 73, 76, 85, 89, 65, 78, 78, 65, 128, 73, 76, 85, 89,
- 128, 73, 76, 85, 85, 89, 65, 78, 78, 65, 128, 73, 76, 85, 84, 128, 73,
- 76, 73, 77, 77, 85, 52, 128, 73, 76, 73, 77, 77, 85, 51, 128, 73, 76, 73,
- 77, 77, 85, 128, 73, 76, 73, 77, 77, 213, 73, 76, 50, 128, 73, 75, 65,
- 82, 65, 128, 73, 75, 65, 82, 193, 73, 74, 128, 73, 73, 89, 65, 78, 78,
- 65, 128, 73, 71, 73, 128, 73, 71, 201, 73, 71, 71, 87, 83, 128, 73, 70,
- 73, 78, 128, 73, 69, 85, 78, 71, 45, 84, 73, 75, 69, 85, 84, 128, 73, 69,
- 85, 78, 71, 45, 84, 72, 73, 69, 85, 84, 72, 128, 73, 69, 85, 78, 71, 45,
- 83, 83, 65, 78, 71, 75, 73, 89, 69, 79, 75, 128, 73, 69, 85, 78, 71, 45,
- 80, 73, 69, 85, 80, 128, 73, 69, 85, 78, 71, 45, 80, 72, 73, 69, 85, 80,
- 72, 128, 73, 69, 85, 78, 71, 45, 77, 73, 69, 85, 77, 128, 73, 69, 85, 78,
- 71, 45, 75, 73, 89, 69, 79, 75, 128, 73, 69, 85, 78, 71, 45, 75, 72, 73,
- 69, 85, 75, 72, 128, 73, 69, 85, 78, 71, 45, 67, 73, 69, 85, 67, 128, 73,
- 69, 85, 78, 71, 45, 67, 72, 73, 69, 85, 67, 72, 128, 73, 69, 85, 78, 199,
- 73, 68, 76, 69, 128, 73, 68, 73, 77, 128, 73, 68, 73, 205, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 57, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 68, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 53, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 52, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 51, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 68, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 70, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 69, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 68, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 57, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 56, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 55, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 67, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 51, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 50, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 49, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 67, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 68, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 67, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 66, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 66, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 55, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 54, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 53, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 66, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 49, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 48, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 70, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 65, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 66, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 65, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 57, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 65, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 53, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 52, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 51, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 65, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 70, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 69, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 68, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 57, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 57, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 56, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 55, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 57, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 51, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 50, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 49, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 57, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 68, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 67, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 66, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 56, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 55, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 54, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 53, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 56, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 49, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 48, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 70, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 55, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 66, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 65, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 57, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 55, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 53, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 52, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 51, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 55, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 57, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 54, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 51, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 68, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 53, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 55, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 49, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 66, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 52, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 53, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 52, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 70, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 57, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 51, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 51, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 50, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 66, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 50, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 50, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 53, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 70, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 57, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 51, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 68, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 55, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 65, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 65, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
- 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 49, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 70, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 70, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 70, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 66, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 70, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 70, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 70, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 53, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 70, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 70, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 70, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 69, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 69, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 69, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 57, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 69, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 69, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 69, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 51, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 69, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 69, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 68, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 68, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 68, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 68, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 68, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 55, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 68, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 68, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 49, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 67, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 67, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 66, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 67, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 67, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 53, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 67, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 67, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 70, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 66, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 66, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 57, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 66, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 66, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 51, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 65, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 68, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 65, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 65, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 55, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 65, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 65, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 49, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 57, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 57, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 66, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 57, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 57, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 53, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 57, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 57, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 70, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 56, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 57, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 56, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 56, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 51, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 56, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 55, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 68, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 55, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 55, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 55, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 55, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 49, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 54, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 54, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 66, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 54, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 53, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 54, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 54, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 70, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 53, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 53, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 57, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 51, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 53, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 53, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 68, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 55, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 52, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 49, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 51, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 51, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 66, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 51, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 53, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 70, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 50, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 50, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 57, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 50, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 50, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 51, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 49, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 68, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 55, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 49, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 66, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 53, 128, 73, 68, 69,
- 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 70, 57, 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
- 45, 70, 57, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
- 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 68, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 67, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 66, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 65, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 65, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 65, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 65, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49,
- 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 53, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 52, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 51, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 65, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 65, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 65, 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 65, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48,
- 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 66, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 65, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 57, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 65, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 65, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 65, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 65, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48,
- 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 51, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 50, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 49, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 70, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 70, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 70, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 70, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70,
- 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 57, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 56, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 55, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 70, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 70, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 70, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70,
- 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 49, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 48, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 70, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 69, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 69, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 69, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 69, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69,
- 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 55, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 54, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 53, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 69, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 69, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 69, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 69, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69,
- 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 70, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 69, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 68, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 68, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 68, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 68, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 68, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68,
- 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 53, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 52, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 51, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 68, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67,
- 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 68, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 67, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 66, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 67, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 67, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 67, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67,
- 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 51, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 50, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 49, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 67, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66,
- 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 66, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 65, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 57, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 66, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 66, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 66, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66,
- 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 49, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 48, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 70, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 65, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65,
- 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 57, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 56, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 55, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 65, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 65, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 65, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65,
- 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 70, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 69, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 68, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 57, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57,
- 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 55, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 54, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 53, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 57, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 57, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 57, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56,
- 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 68, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 67, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 66, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 56, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56,
- 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 53, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 52, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 51, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 56, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 55, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 55, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55,
- 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 66, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 65, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 57, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 55, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55,
- 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 51, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 50, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 49, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 54, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 54, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54,
- 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 57, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 56, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 55, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 54, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 54, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 54, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54,
- 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 49, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 48, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 70, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 53, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 53, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53,
- 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 55, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 54, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 53, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 53, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 53, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53,
- 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 70, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 69, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 68, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52,
- 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 53, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 52, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 51, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 52, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 52, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 51, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51,
- 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 68, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 67, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 66, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 51, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51,
- 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 51, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 50, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 49, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 50, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 50, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 50, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50,
- 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 66, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 65, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 57, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 50, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 50, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50,
- 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 49, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 48, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 70, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49,
- 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 57, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 56, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 55, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49,
- 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 70, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 69, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 68, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48,
- 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 55, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 54, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 53, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 57, 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 57, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 57, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 57, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70,
- 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 68, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 67, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 66, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 70, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 70, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 70, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 70, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70,
- 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 53, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 52, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 51, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 70, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 70, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 69, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 69, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69,
- 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 66, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 65, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 57, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 69, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 69, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 69, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 69, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69,
- 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 51, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 50, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 49, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 68, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 68, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 68, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68,
- 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 57, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 56, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 55, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 68, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 68, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68,
- 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 49, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 48, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 70, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 67, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67,
- 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 55, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 54, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 53, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 67, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 67, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67,
- 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 70, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 69, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 68, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 66, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 66, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66,
- 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 53, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 52, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 51, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 65, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65,
- 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 68, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 67, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 66, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 65, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 65, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65,
- 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 51, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 50, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 49, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 57, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 57, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57,
- 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 66, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 65, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 57, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 57, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 57, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57,
- 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 49, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 48, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 70, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 56, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56,
- 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 57, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 56, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 55, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 54, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 56, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 56, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56,
- 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 48, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 70, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 69, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 68, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 55, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55,
- 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 55, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 54, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 53, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 52, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 55, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 55, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54,
- 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 69, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 68, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 67, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 66, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 54, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 54, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54,
- 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 53, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 52, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 51, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 50, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 53, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53,
- 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 67, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 66, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 65, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 57, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 53, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53,
- 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 51, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 50, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 49, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 48, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 52, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52,
- 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 65, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 57, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 56, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 55, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 52, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 52, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52,
- 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 49, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 48, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 70, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 69, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 51, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51,
- 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 56, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 55, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 54, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 53, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 51, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51,
- 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 70, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 69, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 68, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 67, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 50, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50,
- 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 54, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 53, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 52, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 51, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 49, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49,
- 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 68, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 67, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 66, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 65, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49,
- 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 52, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 51, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 50, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 49, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48,
- 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 66, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 65, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 57, 128, 73, 68, 69, 79,
- 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 56, 128, 73, 68, 69, 79, 71, 82,
- 65, 80, 72, 45, 50, 70, 56, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80,
- 72, 45, 50, 70, 56, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
- 50, 70, 56, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
- 56, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48,
- 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 50, 128,
- 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 49, 128, 73, 68,
- 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 48, 128, 73, 68, 69, 78,
- 84, 73, 70, 73, 67, 65, 84, 73, 79, 78, 128, 73, 68, 69, 78, 84, 73, 67,
- 65, 204, 73, 67, 72, 79, 85, 128, 73, 67, 72, 79, 83, 128, 73, 67, 72,
- 73, 77, 65, 84, 79, 83, 128, 73, 67, 72, 65, 68, 73, 78, 128, 73, 67, 69,
- 76, 65, 78, 68, 73, 67, 45, 89, 82, 128, 73, 66, 73, 70, 73, 76, 73, 128,
- 73, 65, 85, 68, 65, 128, 73, 45, 89, 65, 128, 73, 45, 79, 128, 73, 45,
- 69, 85, 128, 73, 45, 66, 69, 65, 77, 128, 73, 45, 65, 82, 65, 69, 65,
- 128, 73, 45, 65, 128, 72, 90, 90, 90, 71, 128, 72, 90, 90, 90, 128, 72,
- 90, 90, 80, 128, 72, 90, 90, 128, 72, 90, 87, 71, 128, 72, 90, 87, 128,
- 72, 90, 84, 128, 72, 90, 71, 128, 72, 89, 83, 84, 69, 82, 69, 83, 73,
- 211, 72, 89, 80, 79, 68, 73, 65, 83, 84, 79, 76, 69, 128, 72, 89, 80, 72,
- 69, 78, 65, 84, 73, 79, 206, 72, 89, 80, 72, 69, 78, 45, 77, 73, 78, 85,
- 83, 128, 72, 89, 80, 72, 69, 78, 128, 72, 89, 80, 72, 69, 206, 72, 88,
- 87, 71, 128, 72, 88, 85, 79, 88, 128, 72, 88, 85, 79, 84, 128, 72, 88,
- 85, 79, 80, 128, 72, 88, 85, 79, 128, 72, 88, 79, 88, 128, 72, 88, 79,
- 84, 128, 72, 88, 79, 80, 128, 72, 88, 79, 128, 72, 88, 73, 88, 128, 72,
- 88, 73, 84, 128, 72, 88, 73, 80, 128, 72, 88, 73, 69, 88, 128, 72, 88,
- 73, 69, 84, 128, 72, 88, 73, 69, 80, 128, 72, 88, 73, 69, 128, 72, 88,
- 73, 128, 72, 88, 69, 88, 128, 72, 88, 69, 80, 128, 72, 88, 69, 128, 72,
- 88, 65, 88, 128, 72, 88, 65, 84, 128, 72, 88, 65, 80, 128, 72, 88, 65,
- 128, 72, 87, 85, 128, 72, 87, 65, 73, 82, 128, 72, 86, 128, 72, 85, 82,
- 65, 78, 128, 72, 85, 79, 84, 128, 72, 85, 78, 68, 82, 69, 68, 128, 72,
- 85, 78, 68, 82, 69, 196, 72, 85, 78, 128, 72, 85, 77, 65, 78, 128, 72,
- 85, 77, 65, 206, 72, 85, 76, 50, 128, 72, 85, 73, 73, 84, 79, 128, 72,
- 85, 66, 50, 128, 72, 85, 66, 178, 72, 85, 65, 82, 65, 68, 68, 79, 128,
- 72, 82, 89, 86, 78, 73, 193, 72, 80, 87, 71, 128, 72, 80, 65, 128, 72,
- 80, 128, 72, 79, 85, 83, 69, 128, 72, 79, 85, 82, 71, 76, 65, 83, 83,
- 128, 72, 79, 85, 210, 72, 79, 84, 65, 128, 72, 79, 82, 83, 69, 128, 72,
- 79, 82, 73, 90, 79, 78, 84, 65, 76, 76, 217, 72, 79, 82, 73, 90, 79, 78,
- 84, 65, 76, 45, 48, 54, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84,
- 65, 76, 45, 48, 54, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
- 76, 45, 48, 54, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76,
- 45, 48, 54, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45,
- 48, 54, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48,
- 54, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54,
- 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45,
- 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48,
- 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 52,
- 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 51, 128,
- 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 50, 128, 72,
- 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 49, 128, 72, 79,
- 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 48, 128, 72, 79, 82,
- 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 54, 128, 72, 79, 82, 73,
- 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 53, 128, 72, 79, 82, 73, 90,
- 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79,
- 78, 84, 65, 76, 45, 48, 52, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78,
- 84, 65, 76, 45, 48, 52, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84,
- 65, 76, 45, 48, 52, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
- 76, 45, 48, 52, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76,
- 45, 48, 51, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45,
- 48, 51, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48,
- 51, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51,
- 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45,
- 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48,
- 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 48,
- 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 54, 128,
- 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 53, 128, 72,
- 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 52, 128, 72, 79,
- 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 51, 128, 72, 79, 82,
- 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 50, 128, 72, 79, 82, 73,
- 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 49, 128, 72, 79, 82, 73, 90,
- 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79,
- 78, 84, 65, 76, 45, 48, 49, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78,
- 84, 65, 76, 45, 48, 49, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84,
- 65, 76, 45, 48, 49, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
- 76, 45, 48, 49, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76,
- 45, 48, 49, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45,
- 48, 49, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48,
- 49, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48,
- 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45,
- 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48,
- 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 51,
- 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 50, 128,
- 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 49, 128, 72,
- 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 48, 128, 72, 79,
- 82, 73, 90, 79, 78, 84, 65, 76, 128, 72, 79, 82, 73, 128, 72, 79, 79, 82,
- 85, 128, 72, 79, 79, 78, 128, 72, 79, 77, 79, 84, 72, 69, 84, 73, 67,
- 128, 72, 79, 77, 79, 84, 72, 69, 84, 73, 195, 72, 79, 76, 68, 73, 78,
- 199, 72, 79, 76, 65, 77, 128, 72, 79, 76, 65, 205, 72, 79, 69, 128, 72,
- 78, 85, 84, 128, 72, 78, 85, 79, 88, 128, 72, 78, 85, 79, 128, 72, 78,
- 79, 88, 128, 72, 78, 79, 84, 128, 72, 78, 79, 80, 128, 72, 78, 73, 88,
- 128, 72, 78, 73, 84, 128, 72, 78, 73, 80, 128, 72, 78, 73, 69, 88, 128,
- 72, 78, 73, 69, 84, 128, 72, 78, 73, 69, 80, 128, 72, 78, 73, 69, 128,
- 72, 78, 73, 128, 72, 78, 69, 88, 128, 72, 78, 69, 80, 128, 72, 78, 69,
- 128, 72, 78, 65, 88, 128, 72, 78, 65, 84, 128, 72, 78, 65, 80, 128, 72,
- 78, 65, 128, 72, 77, 89, 88, 128, 72, 77, 89, 82, 88, 128, 72, 77, 89,
- 82, 128, 72, 77, 89, 80, 128, 72, 77, 89, 128, 72, 77, 85, 88, 128, 72,
- 77, 85, 84, 128, 72, 77, 85, 82, 88, 128, 72, 77, 85, 82, 128, 72, 77,
- 85, 80, 128, 72, 77, 85, 79, 88, 128, 72, 77, 85, 79, 80, 128, 72, 77,
- 85, 79, 128, 72, 77, 85, 128, 72, 77, 79, 88, 128, 72, 77, 79, 84, 128,
- 72, 77, 79, 80, 128, 72, 77, 79, 128, 72, 77, 73, 88, 128, 72, 77, 73,
- 84, 128, 72, 77, 73, 80, 128, 72, 77, 73, 69, 88, 128, 72, 77, 73, 69,
- 80, 128, 72, 77, 73, 69, 128, 72, 77, 73, 128, 72, 77, 65, 88, 128, 72,
- 77, 65, 84, 128, 72, 77, 65, 80, 128, 72, 77, 65, 128, 72, 76, 89, 88,
- 128, 72, 76, 89, 84, 128, 72, 76, 89, 82, 88, 128, 72, 76, 89, 82, 128,
- 72, 76, 89, 80, 128, 72, 76, 89, 128, 72, 76, 85, 88, 128, 72, 76, 85,
- 84, 128, 72, 76, 85, 82, 88, 128, 72, 76, 85, 82, 128, 72, 76, 85, 80,
- 128, 72, 76, 85, 79, 88, 128, 72, 76, 85, 79, 80, 128, 72, 76, 85, 79,
- 128, 72, 76, 85, 128, 72, 76, 79, 88, 128, 72, 76, 79, 80, 128, 72, 76,
- 79, 128, 72, 76, 73, 88, 128, 72, 76, 73, 84, 128, 72, 76, 73, 80, 128,
- 72, 76, 73, 69, 88, 128, 72, 76, 73, 69, 80, 128, 72, 76, 73, 69, 128,
- 72, 76, 73, 128, 72, 76, 69, 88, 128, 72, 76, 69, 80, 128, 72, 76, 69,
- 128, 72, 76, 65, 88, 128, 72, 76, 65, 84, 128, 72, 76, 65, 80, 128, 72,
- 76, 65, 128, 72, 75, 128, 72, 73, 90, 66, 128, 72, 73, 82, 73, 81, 128,
- 72, 73, 71, 72, 45, 82, 69, 86, 69, 82, 83, 69, 68, 45, 185, 72, 73, 69,
- 88, 128, 72, 73, 69, 85, 72, 45, 82, 73, 69, 85, 76, 128, 72, 73, 69, 85,
- 72, 45, 80, 73, 69, 85, 80, 128, 72, 73, 69, 85, 72, 45, 78, 73, 69, 85,
- 78, 128, 72, 73, 69, 85, 72, 45, 77, 73, 69, 85, 77, 128, 72, 73, 69, 85,
- 200, 72, 73, 69, 128, 72, 73, 68, 73, 78, 199, 72, 73, 68, 69, 84, 128,
- 72, 73, 68, 69, 128, 72, 72, 87, 65, 128, 72, 72, 85, 128, 72, 72, 79,
- 128, 72, 72, 73, 128, 72, 72, 69, 69, 128, 72, 72, 69, 128, 72, 72, 65,
- 65, 128, 72, 71, 128, 72, 69, 88, 65, 71, 79, 78, 128, 72, 69, 84, 72,
+ 82, 69, 67, 212, 73, 78, 68, 73, 67, 65, 84, 79, 82, 128, 73, 78, 68, 73,
+ 67, 65, 84, 79, 210, 73, 78, 68, 73, 195, 73, 78, 68, 73, 65, 206, 73,
+ 78, 68, 69, 88, 128, 73, 78, 68, 69, 80, 69, 78, 68, 69, 78, 212, 73, 78,
+ 67, 82, 69, 77, 69, 78, 84, 128, 73, 78, 67, 82, 69, 65, 83, 69, 211, 73,
+ 78, 67, 82, 69, 65, 83, 69, 128, 73, 78, 67, 79, 77, 80, 76, 69, 84, 197,
+ 73, 78, 67, 79, 77, 73, 78, 199, 73, 78, 67, 76, 85, 68, 73, 78, 199, 73,
+ 78, 67, 72, 128, 73, 78, 66, 79, 216, 73, 78, 65, 80, 128, 73, 78, 45,
+ 65, 76, 65, 70, 128, 73, 77, 80, 69, 82, 73, 65, 204, 73, 77, 80, 69, 82,
+ 70, 69, 67, 84, 85, 205, 73, 77, 80, 69, 82, 70, 69, 67, 84, 65, 128, 73,
+ 77, 80, 69, 82, 70, 69, 67, 84, 193, 73, 77, 73, 83, 69, 79, 211, 73, 77,
+ 73, 78, 51, 128, 73, 77, 73, 78, 128, 73, 77, 73, 206, 73, 77, 73, 70,
+ 84, 72, 79, 82, 79, 78, 128, 73, 77, 73, 70, 84, 72, 79, 82, 65, 128, 73,
+ 77, 73, 70, 79, 78, 79, 78, 128, 73, 77, 73, 68, 73, 65, 82, 71, 79, 78,
+ 128, 73, 77, 65, 71, 197, 73, 76, 85, 89, 65, 78, 78, 65, 128, 73, 76,
+ 85, 89, 128, 73, 76, 85, 85, 89, 65, 78, 78, 65, 128, 73, 76, 85, 84,
+ 128, 73, 76, 73, 77, 77, 85, 52, 128, 73, 76, 73, 77, 77, 85, 51, 128,
+ 73, 76, 73, 77, 77, 85, 128, 73, 76, 73, 77, 77, 213, 73, 76, 50, 128,
+ 73, 75, 65, 82, 65, 128, 73, 75, 65, 82, 193, 73, 74, 128, 73, 73, 89,
+ 65, 78, 78, 65, 128, 73, 71, 73, 128, 73, 71, 201, 73, 71, 71, 87, 83,
+ 128, 73, 70, 73, 78, 128, 73, 69, 85, 78, 71, 45, 84, 73, 75, 69, 85, 84,
+ 128, 73, 69, 85, 78, 71, 45, 84, 72, 73, 69, 85, 84, 72, 128, 73, 69, 85,
+ 78, 71, 45, 83, 83, 65, 78, 71, 75, 73, 89, 69, 79, 75, 128, 73, 69, 85,
+ 78, 71, 45, 82, 73, 69, 85, 76, 128, 73, 69, 85, 78, 71, 45, 80, 73, 69,
+ 85, 80, 128, 73, 69, 85, 78, 71, 45, 80, 72, 73, 69, 85, 80, 72, 128, 73,
+ 69, 85, 78, 71, 45, 75, 73, 89, 69, 79, 75, 128, 73, 69, 85, 78, 71, 45,
+ 75, 72, 73, 69, 85, 75, 72, 128, 73, 69, 85, 78, 71, 45, 67, 73, 69, 85,
+ 67, 128, 73, 69, 85, 78, 71, 45, 67, 72, 73, 69, 85, 67, 72, 128, 73, 69,
+ 85, 78, 199, 73, 68, 76, 69, 128, 73, 68, 73, 77, 128, 73, 68, 73, 205,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 54, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 54, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 54, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 53, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 53, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 53, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 53, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 52, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 51, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 51, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 51, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 49, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65,
+ 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 65, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 65, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 70, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 70, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 70, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 70, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 70, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 70, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 69, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 69, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 69, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 69, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 69, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 69, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 69, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 69, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 69, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 68, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 68, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 54, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 54, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 54, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 54, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 54, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 54, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 54, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 53, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 53, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 53, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 53, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 53, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 53, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 52, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 52, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 52, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 52, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 52, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 52, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 51, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 51, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 51, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 51, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 50, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 50, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 50, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 50, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 50, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 70, 57, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 70, 57, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57,
+ 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 57, 48, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 56, 68, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 56, 67,
+ 65, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 56, 57, 69, 51, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 68, 52, 50, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 55, 65, 55, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 55, 57, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 55, 54, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 53,
+ 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 53, 49, 70, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 49, 50, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 55, 48, 66, 57, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 54, 70, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 54, 69, 56, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 55,
+ 50, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 55, 48, 57, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 55, 48, 56, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 54, 54, 50, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 54, 53, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 54, 53, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 53,
+ 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 51, 53, 53, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 51, 48, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 54, 50, 57, 53, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 54, 50, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 54, 50, 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 70,
+ 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 68, 69, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 66, 56, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 53, 66, 53, 55, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 53, 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 53, 57, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 56,
+ 70, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 53, 66, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 52, 51, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 53, 52, 48, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 53, 51, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 53, 51, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 50,
+ 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 50, 55, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 50, 52, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 53, 50, 49, 68, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 53, 49, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 52, 69, 65, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69,
+ 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 50, 68, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 48, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 52, 69, 48, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 65, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 65, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 65, 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 65, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49,
+ 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 55, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 54, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 53, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 65, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 65, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 65, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 65, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49,
+ 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 70, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 68, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 65, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 65, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 65, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 65, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48,
+ 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 53, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 52, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 51, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 65, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 65, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 65, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 70, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70,
+ 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 68, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 66, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 70, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 70, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 70, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 70, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70,
+ 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 51, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 50, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 49, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 70, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 69, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 69, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 69, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69,
+ 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 66, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 57, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 69, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 69, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 69, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 69, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69,
+ 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 49, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 48, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 70, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 68, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 68, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 68, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68,
+ 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 57, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 55, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 68, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 68, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 68, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68,
+ 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 70, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 69, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 68, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67,
+ 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 55, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 53, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 67, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 67, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 67, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66,
+ 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 68, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 67, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 66, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 66, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66,
+ 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 53, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 51, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 65, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 65, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65,
+ 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 66, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 65, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 57, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 65, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65,
+ 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 51, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 49, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 57, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 57, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 57, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57,
+ 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 57, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 56, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 55, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 57, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57,
+ 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 49, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 70, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 56, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 56, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56,
+ 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 55, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 54, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 53, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 56, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56,
+ 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 70, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 68, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 55, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 55, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55,
+ 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 53, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 52, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 51, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 55, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 54, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54,
+ 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 68, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 66, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 54, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54,
+ 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 51, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 50, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 49, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 53, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 53, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53,
+ 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 66, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 57, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53,
+ 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 49, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 48, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 70, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 52, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52,
+ 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 57, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 55, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 52, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52,
+ 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 70, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 69, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 68, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 51, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51,
+ 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 55, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 53, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50,
+ 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 68, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 67, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 66, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 50, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 50, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50,
+ 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 53, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 51, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 49, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49,
+ 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 66, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 65, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 57, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49,
+ 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 51, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 49, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48,
+ 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 57, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 56, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 55, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 57, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 57, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 57, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 57, 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48,
+ 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 49, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 70, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 70, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 70, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 70, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 70, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70,
+ 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 55, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 54, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 53, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 70, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 70, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 70, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70,
+ 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 70, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 68, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 69, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 69, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 69, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 69, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69,
+ 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 53, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 52, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 51, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 69, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 69, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 69, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 68, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68,
+ 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 68, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 66, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 68, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 68, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68,
+ 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 51, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 50, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 49, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 67, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 67, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67,
+ 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 66, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 57, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 67, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 67, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67,
+ 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 49, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 48, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 70, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 66, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 66, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66,
+ 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 57, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 55, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 66, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 66, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66,
+ 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 70, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 69, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 68, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 65, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 65, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65,
+ 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 55, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 53, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 65, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 65, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57,
+ 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 68, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 67, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 66, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 57, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 57, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57,
+ 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 53, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 51, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 57, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 57, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56,
+ 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 67, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 66, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 65, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 57, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 56, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 56, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56,
+ 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 51, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 49, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 48, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 55, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 55, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55,
+ 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 65, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 57, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 56, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 55, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 55, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 55, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55,
+ 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 49, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 70, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 69, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 54, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 54, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54,
+ 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 56, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 55, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 54, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 53, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 54, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 54, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 54, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54,
+ 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 70, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 68, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 67, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 53, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 53, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53,
+ 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 54, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 53, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 52, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 51, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 53, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 53, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 53, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52,
+ 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 68, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 66, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 65, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 52, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 52, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52,
+ 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 52, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 51, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 50, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 49, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 52, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 51, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 51, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51,
+ 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 66, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 57, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 56, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 51, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 51, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51,
+ 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 50, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 49, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 48, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 70, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 50, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 50, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 50, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50,
+ 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 57, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 55, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 54, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50,
+ 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 48, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 70, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 69, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 68, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49,
+ 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 55, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 53, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 52, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48,
+ 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 69, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 68, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 67, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 66, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45,
+ 50, 70, 56, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70,
+ 56, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48,
+ 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 53, 128,
+ 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 51, 128, 73, 68, 69, 79,
+ 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 50, 128, 73, 68, 69, 79, 71, 82,
+ 65, 80, 72, 45, 50, 70, 56, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 50, 70, 56, 48, 48, 128, 73, 68, 69, 78, 84, 73, 70, 73, 67, 65,
+ 84, 73, 79, 78, 128, 73, 68, 69, 78, 84, 73, 67, 65, 204, 73, 67, 72, 79,
+ 85, 128, 73, 67, 72, 79, 83, 128, 73, 67, 72, 73, 77, 65, 84, 79, 83,
+ 128, 73, 67, 72, 65, 68, 73, 78, 128, 73, 67, 69, 76, 65, 78, 68, 73, 67,
+ 45, 89, 82, 128, 73, 66, 73, 70, 73, 76, 73, 128, 73, 65, 85, 68, 65,
+ 128, 73, 48, 49, 53, 128, 73, 48, 49, 52, 128, 73, 48, 49, 51, 128, 73,
+ 48, 49, 50, 128, 73, 48, 49, 49, 65, 128, 73, 48, 49, 49, 128, 73, 48,
+ 49, 48, 65, 128, 73, 48, 49, 48, 128, 73, 48, 48, 57, 65, 128, 73, 48,
+ 48, 57, 128, 73, 48, 48, 56, 128, 73, 48, 48, 55, 128, 73, 48, 48, 54,
+ 128, 73, 48, 48, 53, 65, 128, 73, 48, 48, 53, 128, 73, 48, 48, 52, 128,
+ 73, 48, 48, 51, 128, 73, 48, 48, 50, 128, 73, 48, 48, 49, 128, 73, 45,
+ 89, 85, 128, 73, 45, 89, 79, 128, 73, 45, 89, 69, 79, 128, 73, 45, 89,
+ 69, 128, 73, 45, 89, 65, 69, 128, 73, 45, 89, 65, 45, 79, 128, 73, 45,
+ 89, 65, 128, 73, 45, 79, 45, 73, 128, 73, 45, 79, 128, 73, 45, 69, 85,
+ 128, 73, 45, 66, 69, 65, 77, 128, 73, 45, 65, 82, 65, 69, 65, 128, 73,
+ 45, 65, 128, 72, 90, 90, 90, 71, 128, 72, 90, 90, 90, 128, 72, 90, 90,
+ 80, 128, 72, 90, 90, 128, 72, 90, 87, 71, 128, 72, 90, 87, 128, 72, 90,
+ 84, 128, 72, 90, 71, 128, 72, 89, 83, 84, 69, 82, 69, 83, 73, 211, 72,
+ 89, 80, 79, 68, 73, 65, 83, 84, 79, 76, 69, 128, 72, 89, 80, 72, 69, 78,
+ 65, 84, 73, 79, 206, 72, 89, 80, 72, 69, 78, 45, 77, 73, 78, 85, 83, 128,
+ 72, 89, 80, 72, 69, 78, 128, 72, 89, 80, 72, 69, 206, 72, 88, 87, 71,
+ 128, 72, 88, 85, 79, 88, 128, 72, 88, 85, 79, 84, 128, 72, 88, 85, 79,
+ 80, 128, 72, 88, 85, 79, 128, 72, 88, 79, 88, 128, 72, 88, 79, 84, 128,
+ 72, 88, 79, 80, 128, 72, 88, 79, 128, 72, 88, 73, 88, 128, 72, 88, 73,
+ 84, 128, 72, 88, 73, 80, 128, 72, 88, 73, 69, 88, 128, 72, 88, 73, 69,
+ 84, 128, 72, 88, 73, 69, 80, 128, 72, 88, 73, 69, 128, 72, 88, 73, 128,
+ 72, 88, 69, 88, 128, 72, 88, 69, 80, 128, 72, 88, 69, 128, 72, 88, 65,
+ 88, 128, 72, 88, 65, 84, 128, 72, 88, 65, 80, 128, 72, 88, 65, 128, 72,
+ 87, 85, 128, 72, 87, 65, 73, 82, 128, 72, 86, 128, 72, 85, 82, 65, 78,
+ 128, 72, 85, 79, 84, 128, 72, 85, 78, 68, 82, 69, 68, 128, 72, 85, 78,
+ 68, 82, 69, 196, 72, 85, 78, 128, 72, 85, 77, 65, 78, 128, 72, 85, 77,
+ 65, 206, 72, 85, 76, 50, 128, 72, 85, 73, 73, 84, 79, 128, 72, 85, 66,
+ 50, 128, 72, 85, 66, 178, 72, 85, 66, 128, 72, 85, 65, 82, 65, 68, 68,
+ 79, 128, 72, 82, 89, 86, 78, 73, 193, 72, 80, 87, 71, 128, 72, 80, 65,
+ 128, 72, 80, 128, 72, 79, 85, 83, 197, 72, 79, 85, 82, 71, 76, 65, 83,
+ 83, 128, 72, 79, 85, 82, 71, 76, 65, 83, 211, 72, 79, 85, 82, 128, 72,
+ 79, 85, 210, 72, 79, 84, 69, 76, 128, 72, 79, 84, 65, 128, 72, 79, 83,
+ 80, 73, 84, 65, 76, 128, 72, 79, 82, 83, 69, 128, 72, 79, 82, 83, 197,
+ 72, 79, 82, 78, 83, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 76, 217,
+ 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 54, 128, 72,
+ 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 53, 128, 72, 79,
+ 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 52, 128, 72, 79, 82,
+ 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 51, 128, 72, 79, 82, 73,
+ 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 50, 128, 72, 79, 82, 73, 90,
+ 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79,
+ 78, 84, 65, 76, 45, 48, 54, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78,
+ 84, 65, 76, 45, 48, 53, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84,
+ 65, 76, 45, 48, 53, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
+ 76, 45, 48, 53, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76,
+ 45, 48, 53, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45,
+ 48, 53, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48,
+ 53, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53,
+ 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45,
+ 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48,
+ 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 52,
+ 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 51, 128,
+ 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 50, 128, 72,
+ 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 49, 128, 72, 79,
+ 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 48, 128, 72, 79, 82,
+ 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 54, 128, 72, 79, 82, 73,
+ 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 53, 128, 72, 79, 82, 73, 90,
+ 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79,
+ 78, 84, 65, 76, 45, 48, 51, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78,
+ 84, 65, 76, 45, 48, 51, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84,
+ 65, 76, 45, 48, 51, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
+ 76, 45, 48, 51, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76,
+ 45, 48, 50, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45,
+ 48, 50, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48,
+ 50, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50,
+ 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45,
+ 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48,
+ 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 48,
+ 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 54, 128,
+ 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 53, 128, 72,
+ 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 52, 128, 72, 79,
+ 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 51, 128, 72, 79, 82,
+ 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 50, 128, 72, 79, 82, 73,
+ 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 49, 128, 72, 79, 82, 73, 90,
+ 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79,
+ 78, 84, 65, 76, 45, 48, 48, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78,
+ 84, 65, 76, 45, 48, 48, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84,
+ 65, 76, 45, 48, 48, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
+ 76, 45, 48, 48, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76,
+ 45, 48, 48, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45,
+ 48, 48, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48,
+ 48, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 128, 72, 79,
+ 82, 73, 128, 72, 79, 82, 193, 72, 79, 79, 82, 85, 128, 72, 79, 79, 80,
+ 128, 72, 79, 79, 78, 128, 72, 79, 78, 69, 89, 66, 69, 69, 128, 72, 79,
+ 78, 69, 217, 72, 79, 77, 79, 84, 72, 69, 84, 73, 67, 128, 72, 79, 77, 79,
+ 84, 72, 69, 84, 73, 195, 72, 79, 76, 69, 128, 72, 79, 76, 68, 73, 78,
+ 199, 72, 79, 76, 65, 77, 128, 72, 79, 76, 65, 205, 72, 79, 75, 65, 128,
+ 72, 79, 73, 128, 72, 79, 67, 72, 79, 128, 72, 78, 85, 84, 128, 72, 78,
+ 85, 79, 88, 128, 72, 78, 85, 79, 128, 72, 78, 79, 88, 128, 72, 78, 79,
+ 84, 128, 72, 78, 79, 80, 128, 72, 78, 73, 88, 128, 72, 78, 73, 84, 128,
+ 72, 78, 73, 80, 128, 72, 78, 73, 69, 88, 128, 72, 78, 73, 69, 84, 128,
+ 72, 78, 73, 69, 80, 128, 72, 78, 73, 69, 128, 72, 78, 73, 128, 72, 78,
+ 69, 88, 128, 72, 78, 69, 80, 128, 72, 78, 69, 128, 72, 78, 65, 88, 128,
+ 72, 78, 65, 84, 128, 72, 78, 65, 80, 128, 72, 78, 65, 128, 72, 77, 89,
+ 88, 128, 72, 77, 89, 82, 88, 128, 72, 77, 89, 82, 128, 72, 77, 89, 80,
+ 128, 72, 77, 89, 128, 72, 77, 85, 88, 128, 72, 77, 85, 84, 128, 72, 77,
+ 85, 82, 88, 128, 72, 77, 85, 82, 128, 72, 77, 85, 80, 128, 72, 77, 85,
+ 79, 88, 128, 72, 77, 85, 79, 80, 128, 72, 77, 85, 79, 128, 72, 77, 85,
+ 128, 72, 77, 79, 88, 128, 72, 77, 79, 84, 128, 72, 77, 79, 80, 128, 72,
+ 77, 79, 128, 72, 77, 73, 88, 128, 72, 77, 73, 84, 128, 72, 77, 73, 80,
+ 128, 72, 77, 73, 69, 88, 128, 72, 77, 73, 69, 80, 128, 72, 77, 73, 69,
+ 128, 72, 77, 73, 128, 72, 77, 69, 128, 72, 77, 65, 88, 128, 72, 77, 65,
+ 84, 128, 72, 77, 65, 80, 128, 72, 77, 65, 128, 72, 76, 89, 88, 128, 72,
+ 76, 89, 84, 128, 72, 76, 89, 82, 88, 128, 72, 76, 89, 82, 128, 72, 76,
+ 89, 80, 128, 72, 76, 89, 128, 72, 76, 85, 88, 128, 72, 76, 85, 84, 128,
+ 72, 76, 85, 82, 88, 128, 72, 76, 85, 82, 128, 72, 76, 85, 80, 128, 72,
+ 76, 85, 79, 88, 128, 72, 76, 85, 79, 80, 128, 72, 76, 85, 79, 128, 72,
+ 76, 85, 128, 72, 76, 79, 88, 128, 72, 76, 79, 80, 128, 72, 76, 79, 128,
+ 72, 76, 73, 88, 128, 72, 76, 73, 84, 128, 72, 76, 73, 80, 128, 72, 76,
+ 73, 69, 88, 128, 72, 76, 73, 69, 80, 128, 72, 76, 73, 69, 128, 72, 76,
+ 73, 128, 72, 76, 69, 88, 128, 72, 76, 69, 80, 128, 72, 76, 69, 128, 72,
+ 76, 65, 88, 128, 72, 76, 65, 84, 128, 72, 76, 65, 80, 128, 72, 76, 65,
+ 128, 72, 75, 128, 72, 73, 90, 66, 128, 72, 73, 83, 84, 79, 82, 73, 195,
+ 72, 73, 82, 73, 81, 128, 72, 73, 71, 72, 45, 83, 80, 69, 69, 196, 72, 73,
+ 71, 72, 45, 82, 69, 86, 69, 82, 83, 69, 68, 45, 185, 72, 73, 71, 72, 45,
+ 72, 69, 69, 76, 69, 196, 72, 73, 69, 88, 128, 72, 73, 69, 85, 72, 45, 83,
+ 73, 79, 83, 128, 72, 73, 69, 85, 72, 45, 82, 73, 69, 85, 76, 128, 72, 73,
+ 69, 85, 72, 45, 80, 73, 69, 85, 80, 128, 72, 73, 69, 85, 72, 45, 78, 73,
+ 69, 85, 78, 128, 72, 73, 69, 85, 72, 45, 77, 73, 69, 85, 77, 128, 72, 73,
+ 69, 85, 200, 72, 73, 69, 128, 72, 73, 68, 73, 78, 199, 72, 73, 68, 69,
+ 84, 128, 72, 73, 68, 69, 128, 72, 73, 66, 73, 83, 67, 85, 83, 128, 72,
+ 72, 87, 65, 128, 72, 72, 85, 128, 72, 72, 73, 128, 72, 72, 69, 69, 128,
+ 72, 72, 69, 128, 72, 72, 65, 65, 128, 72, 71, 128, 72, 69, 88, 73, 70,
+ 79, 82, 205, 72, 69, 88, 65, 71, 82, 65, 205, 72, 69, 88, 65, 71, 79, 78,
128, 72, 69, 82, 85, 84, 85, 128, 72, 69, 82, 85, 128, 72, 69, 82, 77,
73, 84, 73, 65, 206, 72, 69, 82, 77, 73, 79, 78, 73, 65, 206, 72, 69, 82,
- 77, 69, 83, 128, 72, 69, 82, 65, 69, 85, 205, 72, 69, 78, 71, 128, 72,
- 69, 78, 199, 72, 69, 77, 80, 128, 72, 69, 76, 77, 69, 84, 128, 72, 69,
- 76, 205, 72, 69, 75, 85, 84, 65, 65, 82, 85, 128, 72, 69, 73, 83, 69, 73,
- 128, 72, 69, 65, 86, 89, 128, 72, 69, 65, 86, 69, 78, 76, 217, 72, 69,
- 65, 86, 69, 78, 128, 72, 69, 65, 86, 69, 206, 72, 69, 65, 82, 84, 128,
- 72, 69, 65, 82, 212, 72, 69, 65, 68, 73, 78, 71, 128, 72, 66, 65, 83, 65,
- 45, 69, 83, 65, 83, 193, 72, 66, 65, 83, 193, 72, 65, 89, 65, 78, 78, 65,
- 128, 72, 65, 86, 69, 128, 72, 65, 85, 80, 84, 83, 84, 73, 77, 77, 69,
- 128, 72, 65, 84, 72, 73, 128, 72, 65, 84, 69, 128, 72, 65, 84, 65, 198,
- 72, 65, 83, 69, 210, 72, 65, 83, 65, 78, 84, 65, 128, 72, 65, 82, 80, 79,
- 79, 78, 128, 72, 65, 82, 80, 79, 79, 206, 72, 65, 82, 77, 79, 78, 73, 67,
- 128, 72, 65, 82, 75, 76, 69, 65, 206, 72, 65, 82, 68, 78, 69, 83, 83,
- 128, 72, 65, 82, 196, 72, 65, 78, 85, 78, 79, 207, 72, 65, 78, 71, 90,
- 72, 79, 213, 72, 65, 78, 68, 83, 128, 72, 65, 78, 68, 128, 72, 65, 78,
- 45, 65, 75, 65, 84, 128, 72, 65, 77, 90, 65, 128, 72, 65, 77, 77, 69,
- 210, 72, 65, 76, 70, 128, 72, 65, 76, 66, 69, 82, 68, 128, 72, 65, 76,
- 65, 78, 84, 65, 128, 72, 65, 73, 84, 85, 128, 72, 65, 73, 82, 128, 72,
- 65, 71, 76, 65, 218, 72, 65, 71, 76, 128, 72, 65, 70, 85, 75, 72, 65,
- 128, 72, 65, 70, 85, 75, 72, 128, 72, 65, 69, 71, 204, 72, 65, 69, 128,
- 72, 65, 65, 82, 85, 128, 72, 65, 193, 72, 65, 45, 72, 65, 128, 72, 45,
- 84, 89, 80, 197, 71, 89, 85, 128, 71, 89, 79, 78, 128, 71, 89, 79, 128,
- 71, 89, 73, 128, 71, 89, 70, 213, 71, 89, 69, 69, 128, 71, 89, 69, 128,
- 71, 89, 65, 83, 128, 71, 89, 65, 65, 128, 71, 89, 65, 128, 71, 89, 128,
- 71, 87, 73, 128, 71, 87, 69, 69, 128, 71, 87, 69, 128, 71, 87, 65, 65,
- 128, 71, 87, 65, 128, 71, 86, 128, 71, 85, 82, 85, 83, 72, 128, 71, 85,
- 82, 85, 78, 128, 71, 85, 82, 65, 77, 85, 84, 79, 78, 128, 71, 85, 82, 55,
- 128, 71, 85, 78, 85, 128, 71, 85, 78, 213, 71, 85, 77, 128, 71, 85, 205,
- 71, 85, 76, 128, 71, 85, 199, 71, 85, 69, 72, 128, 71, 85, 69, 200, 71,
- 85, 68, 128, 71, 85, 196, 71, 85, 65, 82, 68, 69, 68, 78, 69, 83, 83,
- 128, 71, 85, 65, 82, 65, 78, 201, 71, 85, 178, 71, 84, 69, 210, 71, 83,
- 85, 77, 128, 71, 83, 85, 205, 71, 82, 213, 71, 82, 79, 85, 78, 68, 128,
- 71, 82, 79, 78, 84, 72, 73, 83, 77, 65, 84, 65, 128, 71, 82, 69, 71, 79,
- 82, 73, 65, 206, 71, 82, 69, 69, 206, 71, 82, 69, 65, 84, 78, 69, 83, 83,
- 128, 71, 82, 69, 65, 84, 69, 82, 45, 84, 72, 65, 78, 128, 71, 82, 69, 65,
- 84, 69, 82, 45, 84, 72, 65, 206, 71, 82, 69, 65, 84, 69, 210, 71, 82, 69,
- 65, 212, 71, 82, 65, 86, 69, 45, 77, 65, 67, 82, 79, 78, 128, 71, 82, 65,
- 86, 69, 45, 65, 67, 85, 84, 69, 45, 71, 82, 65, 86, 69, 128, 71, 82, 65,
- 86, 197, 71, 82, 65, 84, 69, 82, 128, 71, 82, 65, 83, 83, 128, 71, 82,
- 65, 83, 211, 71, 82, 65, 80, 72, 69, 77, 197, 71, 82, 65, 77, 77, 193,
- 71, 82, 65, 73, 78, 128, 71, 82, 65, 67, 69, 128, 71, 82, 65, 67, 197,
- 71, 80, 65, 128, 71, 79, 82, 84, 72, 77, 73, 75, 79, 206, 71, 79, 82, 84,
- 128, 71, 79, 82, 71, 79, 84, 69, 82, 73, 128, 71, 79, 82, 71, 79, 83, 89,
- 78, 84, 72, 69, 84, 79, 78, 128, 71, 79, 82, 71, 79, 206, 71, 79, 82, 71,
- 73, 128, 71, 79, 82, 65, 128, 71, 79, 78, 71, 128, 71, 79, 76, 68, 128,
- 71, 79, 73, 78, 199, 71, 79, 65, 76, 128, 71, 79, 65, 204, 71, 79, 65,
- 128, 71, 78, 89, 73, 83, 128, 71, 78, 65, 86, 73, 89, 65, 78, 73, 128,
- 71, 76, 79, 84, 84, 65, 204, 71, 76, 73, 83, 83, 65, 78, 68, 207, 71, 76,
- 69, 73, 67, 200, 71, 76, 65, 71, 79, 76, 73, 128, 71, 76, 65, 128, 71,
- 74, 69, 128, 71, 73, 88, 128, 71, 73, 84, 128, 71, 73, 83, 72, 128, 71,
- 73, 83, 200, 71, 73, 83, 65, 76, 128, 71, 73, 82, 85, 68, 65, 65, 128,
- 71, 73, 82, 51, 128, 71, 73, 82, 179, 71, 73, 82, 50, 128, 71, 73, 82,
- 178, 71, 73, 80, 128, 71, 73, 78, 73, 73, 128, 71, 73, 77, 69, 76, 128,
- 71, 73, 77, 69, 204, 71, 73, 77, 128, 71, 73, 71, 65, 128, 71, 73, 69,
- 84, 128, 71, 73, 68, 73, 77, 128, 71, 73, 66, 65, 128, 71, 73, 52, 128,
- 71, 73, 180, 71, 72, 90, 128, 71, 72, 87, 65, 128, 71, 72, 85, 78, 78,
- 65, 128, 71, 72, 85, 78, 78, 193, 71, 72, 85, 128, 71, 72, 79, 83, 84,
- 128, 71, 72, 79, 128, 71, 72, 73, 128, 71, 72, 72, 65, 128, 71, 72, 69,
- 69, 128, 71, 72, 69, 128, 71, 72, 197, 71, 72, 65, 78, 128, 71, 72, 65,
- 77, 65, 76, 128, 71, 72, 65, 73, 78, 85, 128, 71, 72, 65, 73, 78, 128,
- 71, 72, 65, 73, 206, 71, 72, 65, 68, 128, 71, 72, 65, 128, 71, 71, 87,
- 73, 128, 71, 71, 87, 69, 69, 128, 71, 71, 87, 69, 128, 71, 71, 87, 65,
- 65, 128, 71, 71, 87, 65, 128, 71, 71, 85, 88, 128, 71, 71, 85, 84, 128,
- 71, 71, 85, 82, 88, 128, 71, 71, 85, 82, 128, 71, 71, 85, 80, 128, 71,
+ 77, 69, 83, 128, 72, 69, 82, 66, 128, 72, 69, 82, 65, 69, 85, 205, 72,
+ 69, 78, 71, 128, 72, 69, 78, 199, 72, 69, 77, 80, 128, 72, 69, 76, 77,
+ 69, 84, 128, 72, 69, 76, 77, 69, 212, 72, 69, 76, 205, 72, 69, 76, 73,
+ 67, 79, 80, 84, 69, 82, 128, 72, 69, 75, 85, 84, 65, 65, 82, 85, 128, 72,
+ 69, 73, 83, 69, 73, 128, 72, 69, 65, 86, 89, 128, 72, 69, 65, 86, 69, 78,
+ 76, 217, 72, 69, 65, 86, 69, 78, 128, 72, 69, 65, 86, 69, 206, 72, 69,
+ 65, 82, 84, 83, 128, 72, 69, 65, 82, 84, 45, 83, 72, 65, 80, 69, 196, 72,
+ 69, 65, 82, 84, 128, 72, 69, 65, 82, 212, 72, 69, 65, 82, 45, 78, 79, 45,
+ 69, 86, 73, 204, 72, 69, 65, 68, 83, 84, 82, 79, 75, 69, 128, 72, 69, 65,
+ 68, 83, 84, 79, 78, 197, 72, 69, 65, 68, 80, 72, 79, 78, 69, 128, 72, 69,
+ 65, 68, 73, 78, 71, 128, 72, 66, 65, 83, 65, 45, 69, 83, 65, 83, 193, 72,
+ 66, 65, 83, 193, 72, 65, 89, 65, 78, 78, 65, 128, 72, 65, 86, 69, 128,
+ 72, 65, 85, 80, 84, 83, 84, 73, 77, 77, 69, 128, 72, 65, 84, 72, 73, 128,
+ 72, 65, 84, 69, 128, 72, 65, 84, 67, 72, 73, 78, 199, 72, 65, 84, 65,
+ 198, 72, 65, 83, 69, 210, 72, 65, 83, 65, 78, 84, 65, 128, 72, 65, 82,
+ 80, 79, 79, 78, 128, 72, 65, 82, 80, 79, 79, 206, 72, 65, 82, 77, 79, 78,
+ 73, 67, 128, 72, 65, 82, 75, 76, 69, 65, 206, 72, 65, 82, 68, 78, 69, 83,
+ 83, 128, 72, 65, 82, 196, 72, 65, 80, 80, 217, 72, 65, 78, 85, 78, 79,
+ 207, 72, 65, 78, 71, 90, 72, 79, 213, 72, 65, 78, 68, 83, 128, 72, 65,
+ 78, 68, 211, 72, 65, 78, 68, 76, 69, 83, 128, 72, 65, 78, 68, 76, 69,
+ 128, 72, 65, 78, 68, 66, 65, 71, 128, 72, 65, 78, 68, 128, 72, 65, 78,
+ 45, 65, 75, 65, 84, 128, 72, 65, 77, 90, 65, 128, 72, 65, 77, 83, 84, 69,
+ 210, 72, 65, 77, 77, 69, 82, 128, 72, 65, 77, 77, 69, 210, 72, 65, 77,
+ 66, 85, 82, 71, 69, 82, 128, 72, 65, 76, 81, 65, 128, 72, 65, 76, 79,
+ 128, 72, 65, 76, 70, 128, 72, 65, 76, 66, 69, 82, 68, 128, 72, 65, 76,
+ 65, 78, 84, 65, 128, 72, 65, 73, 84, 85, 128, 72, 65, 73, 82, 67, 85, 84,
+ 128, 72, 65, 73, 82, 128, 72, 65, 71, 76, 65, 218, 72, 65, 71, 76, 128,
+ 72, 65, 70, 85, 75, 72, 65, 128, 72, 65, 70, 85, 75, 72, 128, 72, 65, 69,
+ 71, 204, 72, 65, 65, 82, 85, 128, 72, 65, 65, 77, 128, 72, 65, 193, 72,
+ 65, 45, 72, 65, 128, 72, 48, 48, 56, 128, 72, 48, 48, 55, 128, 72, 48,
+ 48, 54, 65, 128, 72, 48, 48, 54, 128, 72, 48, 48, 53, 128, 72, 48, 48,
+ 52, 128, 72, 48, 48, 51, 128, 72, 48, 48, 50, 128, 72, 48, 48, 49, 128,
+ 72, 45, 84, 89, 80, 197, 71, 89, 85, 128, 71, 89, 79, 78, 128, 71, 89,
+ 79, 128, 71, 89, 73, 128, 71, 89, 70, 213, 71, 89, 69, 69, 128, 71, 89,
+ 65, 83, 128, 71, 89, 65, 65, 128, 71, 89, 65, 128, 71, 89, 128, 71, 87,
+ 85, 128, 71, 87, 73, 128, 71, 87, 69, 69, 128, 71, 87, 69, 128, 71, 87,
+ 65, 65, 128, 71, 87, 65, 128, 71, 86, 128, 71, 85, 82, 85, 83, 72, 128,
+ 71, 85, 82, 85, 78, 128, 71, 85, 82, 65, 77, 85, 84, 79, 78, 128, 71, 85,
+ 82, 55, 128, 71, 85, 78, 85, 128, 71, 85, 78, 213, 71, 85, 205, 71, 85,
+ 76, 128, 71, 85, 73, 84, 65, 82, 128, 71, 85, 199, 71, 85, 69, 72, 128,
+ 71, 85, 69, 200, 71, 85, 68, 128, 71, 85, 196, 71, 85, 65, 82, 68, 83,
+ 77, 65, 78, 128, 71, 85, 65, 82, 68, 69, 68, 78, 69, 83, 83, 128, 71, 85,
+ 65, 82, 65, 78, 201, 71, 85, 193, 71, 85, 178, 71, 84, 69, 210, 71, 83,
+ 85, 77, 128, 71, 83, 85, 205, 71, 82, 213, 71, 82, 79, 87, 73, 78, 199,
+ 71, 82, 79, 85, 78, 68, 128, 71, 82, 79, 78, 84, 72, 73, 83, 77, 65, 84,
+ 65, 128, 71, 82, 73, 78, 78, 73, 78, 199, 71, 82, 69, 71, 79, 82, 73, 65,
+ 206, 71, 82, 69, 69, 206, 71, 82, 69, 65, 84, 78, 69, 83, 83, 128, 71,
+ 82, 69, 65, 84, 69, 82, 45, 84, 72, 65, 78, 128, 71, 82, 69, 65, 84, 69,
+ 82, 45, 84, 72, 65, 206, 71, 82, 69, 65, 84, 69, 210, 71, 82, 69, 65,
+ 212, 71, 82, 65, 86, 69, 89, 65, 82, 196, 71, 82, 65, 86, 69, 45, 77, 65,
+ 67, 82, 79, 78, 128, 71, 82, 65, 86, 69, 45, 65, 67, 85, 84, 69, 45, 71,
+ 82, 65, 86, 69, 128, 71, 82, 65, 86, 197, 71, 82, 65, 84, 69, 82, 128,
+ 71, 82, 65, 83, 83, 128, 71, 82, 65, 83, 211, 71, 82, 65, 80, 72, 69, 77,
+ 197, 71, 82, 65, 80, 69, 83, 128, 71, 82, 65, 77, 77, 193, 71, 82, 65,
+ 73, 78, 128, 71, 82, 65, 68, 85, 65, 84, 73, 79, 206, 71, 82, 65, 67, 69,
+ 128, 71, 82, 65, 67, 197, 71, 80, 65, 128, 71, 79, 82, 84, 72, 77, 73,
+ 75, 79, 206, 71, 79, 82, 84, 128, 71, 79, 82, 71, 79, 84, 69, 82, 73,
+ 128, 71, 79, 82, 71, 79, 83, 89, 78, 84, 72, 69, 84, 79, 78, 128, 71, 79,
+ 82, 71, 79, 206, 71, 79, 82, 71, 73, 128, 71, 79, 82, 65, 128, 71, 79,
+ 79, 196, 71, 79, 78, 71, 128, 71, 79, 76, 68, 128, 71, 79, 75, 128, 71,
+ 79, 73, 78, 199, 71, 79, 66, 76, 73, 78, 128, 71, 79, 65, 76, 128, 71,
+ 79, 65, 204, 71, 79, 65, 128, 71, 78, 89, 73, 83, 128, 71, 78, 65, 86,
+ 73, 89, 65, 78, 73, 128, 71, 76, 79, 87, 73, 78, 199, 71, 76, 79, 84, 84,
+ 65, 204, 71, 76, 79, 66, 197, 71, 76, 73, 83, 83, 65, 78, 68, 207, 71,
+ 76, 69, 73, 67, 200, 71, 76, 65, 71, 79, 76, 73, 128, 71, 76, 65, 128,
+ 71, 74, 69, 128, 71, 73, 88, 128, 71, 73, 84, 128, 71, 73, 83, 72, 128,
+ 71, 73, 83, 200, 71, 73, 83, 65, 76, 128, 71, 73, 82, 85, 68, 65, 65,
+ 128, 71, 73, 82, 76, 128, 71, 73, 82, 51, 128, 71, 73, 82, 179, 71, 73,
+ 82, 50, 128, 71, 73, 82, 178, 71, 73, 80, 128, 71, 73, 78, 73, 73, 128,
+ 71, 73, 77, 69, 76, 128, 71, 73, 77, 69, 204, 71, 73, 77, 128, 71, 73,
+ 71, 65, 128, 71, 73, 69, 84, 128, 71, 73, 68, 73, 77, 128, 71, 73, 66,
+ 66, 79, 85, 211, 71, 73, 66, 65, 128, 71, 73, 52, 128, 71, 73, 180, 71,
+ 72, 90, 128, 71, 72, 87, 65, 128, 71, 72, 85, 78, 78, 65, 128, 71, 72,
+ 85, 78, 78, 193, 71, 72, 85, 128, 71, 72, 79, 85, 128, 71, 72, 79, 83,
+ 84, 128, 71, 72, 79, 128, 71, 72, 73, 128, 71, 72, 72, 65, 128, 71, 72,
+ 69, 85, 88, 128, 71, 72, 69, 85, 78, 128, 71, 72, 69, 85, 71, 72, 69, 85,
+ 65, 69, 77, 128, 71, 72, 69, 85, 71, 72, 69, 78, 128, 71, 72, 69, 85, 65,
+ 69, 82, 65, 69, 128, 71, 72, 69, 85, 65, 69, 71, 72, 69, 85, 65, 69, 128,
+ 71, 72, 69, 84, 128, 71, 72, 69, 69, 128, 71, 72, 69, 128, 71, 72, 197,
+ 71, 72, 65, 89, 78, 128, 71, 72, 65, 82, 65, 69, 128, 71, 72, 65, 80,
+ 128, 71, 72, 65, 78, 128, 71, 72, 65, 77, 65, 76, 128, 71, 72, 65, 73,
+ 78, 85, 128, 71, 72, 65, 73, 78, 128, 71, 72, 65, 73, 206, 71, 72, 65,
+ 68, 128, 71, 72, 65, 65, 77, 65, 69, 128, 71, 72, 65, 65, 128, 71, 72,
+ 65, 128, 71, 71, 87, 73, 128, 71, 71, 87, 69, 69, 128, 71, 71, 87, 69,
+ 128, 71, 71, 87, 65, 65, 128, 71, 71, 87, 65, 128, 71, 71, 85, 88, 128,
+ 71, 71, 85, 84, 128, 71, 71, 85, 82, 88, 128, 71, 71, 85, 82, 128, 71,
71, 85, 79, 88, 128, 71, 71, 85, 79, 84, 128, 71, 71, 85, 79, 80, 128,
71, 71, 85, 79, 128, 71, 71, 79, 88, 128, 71, 71, 79, 84, 128, 71, 71,
79, 80, 128, 71, 71, 73, 88, 128, 71, 71, 73, 84, 128, 71, 71, 73, 69,
88, 128, 71, 71, 73, 69, 80, 128, 71, 71, 73, 69, 128, 71, 71, 69, 88,
128, 71, 71, 69, 84, 128, 71, 71, 69, 80, 128, 71, 71, 65, 88, 128, 71,
- 71, 65, 84, 128, 71, 71, 65, 80, 128, 71, 71, 65, 65, 128, 71, 69, 84,
- 193, 71, 69, 83, 72, 85, 128, 71, 69, 83, 72, 84, 73, 78, 128, 71, 69,
- 83, 72, 84, 73, 206, 71, 69, 83, 72, 50, 128, 71, 69, 82, 83, 72, 65, 89,
- 73, 77, 128, 71, 69, 82, 77, 65, 206, 71, 69, 82, 69, 83, 72, 128, 71,
- 69, 82, 69, 83, 200, 71, 69, 79, 77, 69, 84, 82, 73, 67, 65, 76, 76, 217,
- 71, 69, 79, 77, 69, 84, 82, 73, 195, 71, 69, 78, 84, 76, 197, 71, 69, 78,
- 73, 84, 73, 86, 69, 128, 71, 69, 78, 73, 75, 201, 71, 69, 78, 69, 82, 73,
- 195, 71, 69, 77, 73, 78, 73, 128, 71, 69, 77, 73, 78, 65, 84, 73, 79,
- 206, 71, 69, 68, 79, 76, 65, 128, 71, 69, 68, 69, 128, 71, 69, 66, 207,
- 71, 69, 66, 193, 71, 69, 65, 82, 128, 71, 68, 65, 78, 128, 71, 67, 73,
- 71, 128, 71, 67, 65, 206, 71, 66, 79, 78, 128, 71, 66, 69, 78, 128, 71,
- 66, 65, 75, 85, 82, 85, 78, 69, 78, 128, 71, 66, 128, 71, 65, 89, 65, 78,
- 85, 75, 73, 84, 84, 65, 128, 71, 65, 89, 65, 78, 78, 65, 128, 71, 65, 89,
- 128, 71, 65, 85, 78, 84, 76, 69, 84, 128, 71, 65, 84, 72, 69, 82, 73, 78,
- 71, 128, 71, 65, 84, 72, 69, 82, 73, 78, 199, 71, 65, 84, 69, 128, 71,
- 65, 83, 72, 65, 78, 128, 71, 65, 82, 83, 72, 85, 78, 73, 128, 71, 65, 82,
- 79, 78, 128, 71, 65, 82, 77, 69, 78, 84, 128, 71, 65, 82, 51, 128, 71,
- 65, 80, 80, 69, 196, 71, 65, 78, 77, 65, 128, 71, 65, 78, 71, 73, 65,
- 128, 71, 65, 78, 50, 128, 71, 65, 78, 178, 71, 65, 77, 77, 65, 128, 71,
- 65, 77, 76, 65, 128, 71, 65, 77, 76, 128, 71, 65, 77, 65, 76, 128, 71,
- 65, 77, 65, 204, 71, 65, 77, 128, 71, 65, 71, 128, 71, 65, 70, 128, 71,
- 65, 198, 71, 65, 69, 84, 84, 65, 45, 80, 73, 76, 76, 65, 128, 71, 65, 68,
- 79, 76, 128, 71, 65, 68, 128, 71, 65, 196, 71, 65, 66, 65, 128, 71, 65,
- 66, 193, 71, 65, 65, 70, 85, 128, 71, 65, 178, 70, 89, 88, 128, 70, 89,
- 84, 128, 70, 89, 80, 128, 70, 89, 65, 128, 70, 89, 128, 70, 87, 73, 128,
- 70, 87, 69, 69, 128, 70, 87, 69, 128, 70, 87, 65, 65, 128, 70, 87, 65,
- 128, 70, 85, 88, 128, 70, 85, 84, 128, 70, 85, 83, 69, 128, 70, 85, 83,
- 193, 70, 85, 82, 88, 128, 70, 85, 82, 128, 70, 85, 80, 128, 70, 85, 78,
- 69, 82, 65, 204, 70, 85, 78, 67, 84, 73, 79, 78, 128, 70, 85, 76, 76, 78,
- 69, 83, 83, 128, 70, 85, 76, 204, 70, 84, 72, 79, 82, 193, 70, 82, 79,
- 87, 78, 73, 78, 199, 70, 82, 79, 87, 78, 128, 70, 82, 79, 78, 84, 45, 84,
- 73, 76, 84, 69, 196, 70, 82, 79, 205, 70, 82, 79, 71, 128, 70, 82, 73,
- 84, 85, 128, 70, 82, 73, 67, 65, 84, 73, 86, 69, 128, 70, 82, 69, 84, 66,
- 79, 65, 82, 68, 128, 70, 82, 69, 78, 67, 200, 70, 82, 69, 197, 70, 82,
- 65, 78, 195, 70, 82, 65, 77, 69, 128, 70, 82, 65, 71, 82, 65, 78, 84,
- 128, 70, 82, 65, 71, 77, 69, 78, 84, 128, 70, 82, 65, 67, 84, 73, 79,
- 206, 70, 79, 88, 128, 70, 79, 85, 82, 84, 69, 69, 78, 128, 70, 79, 85,
- 82, 84, 69, 69, 206, 70, 79, 85, 82, 45, 83, 84, 82, 73, 78, 199, 70, 79,
- 85, 82, 45, 80, 69, 82, 45, 69, 205, 70, 79, 85, 82, 45, 76, 73, 78, 197,
- 70, 79, 85, 210, 70, 79, 83, 84, 69, 82, 73, 78, 71, 128, 70, 79, 82, 84,
- 89, 128, 70, 79, 82, 84, 217, 70, 79, 82, 84, 69, 128, 70, 79, 82, 77,
- 211, 70, 79, 82, 77, 65, 84, 84, 73, 78, 71, 128, 70, 79, 82, 75, 69,
- 196, 70, 79, 82, 67, 69, 83, 128, 70, 79, 82, 67, 69, 128, 70, 79, 80,
- 128, 70, 79, 79, 84, 83, 84, 79, 79, 76, 128, 70, 79, 79, 84, 78, 79, 84,
- 197, 70, 79, 79, 84, 128, 70, 79, 79, 128, 70, 79, 78, 71, 77, 65, 78,
- 128, 70, 79, 76, 76, 89, 128, 70, 79, 76, 76, 79, 87, 73, 78, 71, 128,
- 70, 79, 128, 70, 77, 128, 70, 76, 89, 128, 70, 76, 85, 84, 69, 128, 70,
- 76, 79, 87, 69, 82, 128, 70, 76, 79, 87, 69, 210, 70, 76, 79, 85, 82, 73,
- 83, 72, 128, 70, 76, 79, 82, 69, 84, 84, 69, 128, 70, 76, 79, 82, 65,
- 204, 70, 76, 79, 79, 82, 128, 70, 76, 73, 80, 128, 70, 76, 73, 71, 72,
- 84, 128, 70, 76, 69, 88, 85, 83, 128, 70, 76, 69, 85, 82, 45, 68, 69, 45,
- 76, 73, 83, 128, 70, 76, 65, 84, 84, 69, 78, 69, 196, 70, 76, 65, 84, 78,
- 69, 83, 83, 128, 70, 76, 65, 84, 128, 70, 76, 65, 212, 70, 76, 65, 71,
- 45, 53, 128, 70, 76, 65, 71, 45, 52, 128, 70, 76, 65, 71, 45, 51, 128,
- 70, 76, 65, 71, 45, 50, 128, 70, 76, 65, 71, 45, 49, 128, 70, 76, 65, 71,
- 128, 70, 76, 65, 128, 70, 76, 128, 70, 73, 88, 69, 68, 45, 70, 79, 82,
- 205, 70, 73, 88, 128, 70, 73, 86, 69, 45, 76, 73, 78, 197, 70, 73, 86,
- 197, 70, 73, 84, 65, 128, 70, 73, 84, 128, 70, 73, 83, 72, 72, 79, 79,
- 75, 128, 70, 73, 83, 72, 72, 79, 79, 203, 70, 73, 83, 72, 69, 89, 69,
- 128, 70, 73, 83, 72, 128, 70, 73, 83, 200, 70, 73, 82, 83, 212, 70, 73,
- 82, 69, 128, 70, 73, 80, 128, 70, 73, 78, 73, 84, 197, 70, 73, 78, 71,
- 69, 82, 78, 65, 73, 76, 83, 128, 70, 73, 78, 71, 69, 82, 69, 196, 70, 73,
- 78, 65, 78, 67, 73, 65, 76, 128, 70, 73, 76, 76, 69, 82, 128, 70, 73, 76,
- 76, 69, 196, 70, 73, 76, 76, 128, 70, 73, 76, 204, 70, 73, 76, 197, 70,
- 73, 73, 128, 70, 73, 71, 85, 82, 69, 45, 51, 128, 70, 73, 71, 85, 82, 69,
- 45, 50, 128, 70, 73, 71, 85, 82, 69, 45, 49, 128, 70, 73, 71, 85, 82,
- 197, 70, 73, 71, 72, 84, 128, 70, 73, 70, 84, 89, 128, 70, 73, 70, 84,
- 217, 70, 73, 70, 84, 72, 83, 128, 70, 73, 70, 84, 72, 128, 70, 73, 70,
- 84, 69, 69, 78, 128, 70, 73, 70, 84, 69, 69, 206, 70, 73, 69, 76, 68,
- 128, 70, 72, 84, 79, 82, 193, 70, 70, 76, 128, 70, 70, 73, 128, 70, 69,
- 83, 84, 73, 86, 65, 76, 128, 70, 69, 82, 77, 65, 84, 65, 128, 70, 69, 82,
- 77, 65, 84, 193, 70, 69, 79, 200, 70, 69, 78, 199, 70, 69, 78, 67, 69,
- 128, 70, 69, 77, 73, 78, 73, 78, 197, 70, 69, 77, 65, 76, 69, 128, 70,
- 69, 77, 65, 76, 197, 70, 69, 76, 76, 79, 87, 83, 72, 73, 80, 128, 70, 69,
- 73, 128, 70, 69, 72, 213, 70, 69, 72, 128, 70, 69, 200, 70, 69, 69, 78,
- 71, 128, 70, 69, 69, 68, 128, 70, 69, 69, 196, 70, 69, 69, 128, 70, 69,
- 66, 82, 85, 65, 82, 89, 128, 70, 69, 65, 84, 72, 69, 82, 128, 70, 69, 65,
- 84, 72, 69, 210, 70, 69, 65, 82, 78, 128, 70, 65, 89, 65, 78, 78, 65,
- 128, 70, 65, 88, 128, 70, 65, 84, 72, 69, 82, 128, 70, 65, 84, 72, 65,
- 84, 65, 78, 128, 70, 65, 84, 72, 65, 84, 65, 206, 70, 65, 84, 72, 65,
- 128, 70, 65, 84, 72, 193, 70, 65, 84, 128, 70, 65, 82, 83, 201, 70, 65,
- 80, 128, 70, 65, 78, 71, 128, 70, 65, 78, 69, 82, 79, 83, 73, 211, 70,
- 65, 78, 128, 70, 65, 77, 73, 76, 89, 128, 70, 65, 76, 76, 73, 78, 199,
- 70, 65, 73, 76, 85, 82, 69, 128, 70, 65, 73, 72, 85, 128, 70, 65, 72, 82,
- 69, 78, 72, 69, 73, 84, 128, 70, 65, 67, 84, 79, 210, 70, 65, 67, 83, 73,
- 77, 73, 76, 197, 70, 65, 67, 69, 45, 54, 128, 70, 65, 67, 69, 45, 53,
- 128, 70, 65, 67, 69, 45, 52, 128, 70, 65, 67, 69, 45, 51, 128, 70, 65,
- 67, 69, 45, 50, 128, 70, 65, 67, 69, 45, 49, 128, 70, 65, 65, 73, 128,
- 70, 65, 65, 70, 85, 128, 70, 65, 65, 128, 69, 90, 200, 69, 90, 69, 78,
- 128, 69, 90, 69, 206, 69, 89, 66, 69, 89, 70, 73, 76, 73, 128, 69, 89,
- 65, 78, 78, 65, 128, 69, 88, 84, 82, 65, 45, 76, 79, 215, 69, 88, 84, 82,
+ 71, 65, 84, 128, 71, 71, 65, 65, 128, 71, 69, 84, 193, 71, 69, 83, 84,
+ 85, 82, 69, 128, 71, 69, 83, 72, 85, 128, 71, 69, 83, 72, 84, 73, 78,
+ 128, 71, 69, 83, 72, 84, 73, 206, 71, 69, 83, 72, 50, 128, 71, 69, 82,
+ 83, 72, 65, 89, 73, 77, 128, 71, 69, 82, 77, 65, 206, 71, 69, 82, 69, 83,
+ 72, 128, 71, 69, 82, 69, 83, 200, 71, 69, 79, 77, 69, 84, 82, 73, 67, 65,
+ 76, 76, 217, 71, 69, 79, 77, 69, 84, 82, 73, 195, 71, 69, 78, 84, 76,
+ 197, 71, 69, 78, 73, 84, 73, 86, 69, 128, 71, 69, 78, 73, 75, 201, 71,
+ 69, 78, 69, 82, 73, 195, 71, 69, 77, 73, 78, 73, 128, 71, 69, 77, 73, 78,
+ 65, 84, 73, 79, 206, 71, 69, 205, 71, 69, 68, 79, 76, 65, 128, 71, 69,
+ 68, 69, 128, 71, 69, 66, 207, 71, 69, 66, 193, 71, 69, 65, 82, 128, 71,
+ 69, 65, 210, 71, 68, 65, 78, 128, 71, 67, 73, 71, 128, 71, 67, 65, 206,
+ 71, 66, 79, 78, 128, 71, 66, 73, 69, 197, 71, 66, 69, 85, 88, 128, 71,
+ 66, 69, 84, 128, 71, 66, 65, 89, 73, 128, 71, 66, 65, 75, 85, 82, 85, 78,
+ 69, 78, 128, 71, 66, 128, 71, 65, 89, 65, 78, 85, 75, 73, 84, 84, 65,
+ 128, 71, 65, 89, 65, 78, 78, 65, 128, 71, 65, 89, 128, 71, 65, 85, 78,
+ 84, 76, 69, 84, 128, 71, 65, 84, 72, 69, 82, 73, 78, 71, 128, 71, 65, 84,
+ 72, 69, 82, 73, 78, 199, 71, 65, 84, 69, 128, 71, 65, 83, 72, 65, 78,
+ 128, 71, 65, 82, 83, 72, 85, 78, 73, 128, 71, 65, 82, 79, 78, 128, 71,
+ 65, 82, 77, 69, 78, 84, 128, 71, 65, 82, 68, 69, 78, 128, 71, 65, 82, 51,
+ 128, 71, 65, 80, 80, 69, 196, 71, 65, 208, 71, 65, 78, 77, 65, 128, 71,
+ 65, 78, 71, 73, 65, 128, 71, 65, 78, 68, 193, 71, 65, 78, 50, 128, 71,
+ 65, 78, 178, 71, 65, 77, 77, 65, 128, 71, 65, 77, 76, 65, 128, 71, 65,
+ 77, 76, 128, 71, 65, 77, 69, 128, 71, 65, 77, 197, 71, 65, 77, 65, 78,
+ 128, 71, 65, 77, 65, 76, 128, 71, 65, 77, 65, 204, 71, 65, 71, 128, 71,
+ 65, 70, 128, 71, 65, 198, 71, 65, 69, 84, 84, 65, 45, 80, 73, 76, 76, 65,
+ 128, 71, 65, 68, 79, 76, 128, 71, 65, 68, 128, 71, 65, 196, 71, 65, 66,
+ 65, 128, 71, 65, 66, 193, 71, 65, 65, 70, 85, 128, 71, 65, 178, 71, 48,
+ 53, 52, 128, 71, 48, 53, 51, 128, 71, 48, 53, 50, 128, 71, 48, 53, 49,
+ 128, 71, 48, 53, 48, 128, 71, 48, 52, 57, 128, 71, 48, 52, 56, 128, 71,
+ 48, 52, 55, 128, 71, 48, 52, 54, 128, 71, 48, 52, 53, 65, 128, 71, 48,
+ 52, 53, 128, 71, 48, 52, 52, 128, 71, 48, 52, 51, 65, 128, 71, 48, 52,
+ 51, 128, 71, 48, 52, 50, 128, 71, 48, 52, 49, 128, 71, 48, 52, 48, 128,
+ 71, 48, 51, 57, 128, 71, 48, 51, 56, 128, 71, 48, 51, 55, 65, 128, 71,
+ 48, 51, 55, 128, 71, 48, 51, 54, 65, 128, 71, 48, 51, 54, 128, 71, 48,
+ 51, 53, 128, 71, 48, 51, 52, 128, 71, 48, 51, 51, 128, 71, 48, 51, 50,
+ 128, 71, 48, 51, 49, 128, 71, 48, 51, 48, 128, 71, 48, 50, 57, 128, 71,
+ 48, 50, 56, 128, 71, 48, 50, 55, 128, 71, 48, 50, 54, 65, 128, 71, 48,
+ 50, 54, 128, 71, 48, 50, 53, 128, 71, 48, 50, 52, 128, 71, 48, 50, 51,
+ 128, 71, 48, 50, 50, 128, 71, 48, 50, 49, 128, 71, 48, 50, 48, 65, 128,
+ 71, 48, 50, 48, 128, 71, 48, 49, 57, 128, 71, 48, 49, 56, 128, 71, 48,
+ 49, 55, 128, 71, 48, 49, 54, 128, 71, 48, 49, 53, 128, 71, 48, 49, 52,
+ 128, 71, 48, 49, 51, 128, 71, 48, 49, 50, 128, 71, 48, 49, 49, 65, 128,
+ 71, 48, 49, 49, 128, 71, 48, 49, 48, 128, 71, 48, 48, 57, 128, 71, 48,
+ 48, 56, 128, 71, 48, 48, 55, 66, 128, 71, 48, 48, 55, 65, 128, 71, 48,
+ 48, 55, 128, 71, 48, 48, 54, 65, 128, 71, 48, 48, 54, 128, 71, 48, 48,
+ 53, 128, 71, 48, 48, 52, 128, 71, 48, 48, 51, 128, 71, 48, 48, 50, 128,
+ 71, 48, 48, 49, 128, 70, 89, 88, 128, 70, 89, 84, 128, 70, 89, 80, 128,
+ 70, 89, 65, 128, 70, 87, 73, 128, 70, 87, 69, 69, 128, 70, 87, 69, 128,
+ 70, 87, 65, 65, 128, 70, 87, 65, 128, 70, 85, 88, 128, 70, 85, 84, 128,
+ 70, 85, 83, 69, 128, 70, 85, 83, 193, 70, 85, 82, 88, 128, 70, 85, 80,
+ 128, 70, 85, 78, 69, 82, 65, 204, 70, 85, 78, 67, 84, 73, 79, 78, 128,
+ 70, 85, 76, 76, 78, 69, 83, 83, 128, 70, 85, 76, 204, 70, 85, 74, 73,
+ 128, 70, 85, 69, 84, 128, 70, 85, 69, 204, 70, 85, 69, 128, 70, 84, 72,
+ 79, 82, 193, 70, 82, 79, 87, 78, 73, 78, 71, 128, 70, 82, 79, 87, 78, 73,
+ 78, 199, 70, 82, 79, 87, 78, 128, 70, 82, 79, 78, 84, 45, 84, 73, 76, 84,
+ 69, 196, 70, 82, 79, 78, 84, 45, 70, 65, 67, 73, 78, 199, 70, 82, 79,
+ 205, 70, 82, 79, 71, 128, 70, 82, 79, 199, 70, 82, 73, 84, 85, 128, 70,
+ 82, 73, 69, 83, 128, 70, 82, 73, 69, 196, 70, 82, 73, 67, 65, 84, 73, 86,
+ 69, 128, 70, 82, 69, 84, 66, 79, 65, 82, 68, 128, 70, 82, 69, 78, 67,
+ 200, 70, 82, 69, 69, 128, 70, 82, 69, 197, 70, 82, 65, 78, 195, 70, 82,
+ 65, 77, 69, 128, 70, 82, 65, 71, 82, 65, 78, 84, 128, 70, 82, 65, 71, 77,
+ 69, 78, 84, 128, 70, 82, 65, 67, 84, 73, 79, 206, 70, 79, 88, 128, 70,
+ 79, 85, 82, 84, 69, 69, 78, 128, 70, 79, 85, 82, 84, 69, 69, 206, 70, 79,
+ 85, 82, 45, 84, 72, 73, 82, 84, 89, 128, 70, 79, 85, 82, 45, 83, 84, 82,
+ 73, 78, 199, 70, 79, 85, 82, 45, 80, 69, 82, 45, 69, 205, 70, 79, 85, 82,
+ 45, 76, 73, 78, 197, 70, 79, 85, 210, 70, 79, 85, 78, 84, 65, 73, 78,
+ 128, 70, 79, 83, 84, 69, 82, 73, 78, 71, 128, 70, 79, 82, 84, 89, 128,
+ 70, 79, 82, 84, 217, 70, 79, 82, 84, 69, 128, 70, 79, 82, 77, 211, 70,
+ 79, 82, 77, 65, 84, 84, 73, 78, 71, 128, 70, 79, 82, 75, 69, 196, 70, 79,
+ 82, 67, 69, 83, 128, 70, 79, 82, 67, 69, 128, 70, 79, 80, 128, 70, 79,
+ 79, 84, 83, 84, 79, 79, 76, 128, 70, 79, 79, 84, 80, 82, 73, 78, 84, 83,
+ 128, 70, 79, 79, 84, 78, 79, 84, 197, 70, 79, 79, 84, 66, 65, 76, 76,
+ 128, 70, 79, 79, 84, 128, 70, 79, 79, 68, 128, 70, 79, 79, 128, 70, 79,
+ 78, 71, 77, 65, 78, 128, 70, 79, 77, 128, 70, 79, 76, 76, 89, 128, 70,
+ 79, 76, 76, 79, 87, 73, 78, 71, 128, 70, 79, 76, 68, 69, 82, 128, 70, 79,
+ 76, 68, 69, 196, 70, 79, 71, 71, 89, 128, 70, 77, 128, 70, 76, 89, 128,
+ 70, 76, 85, 84, 84, 69, 82, 73, 78, 199, 70, 76, 85, 84, 69, 128, 70, 76,
+ 85, 83, 72, 69, 196, 70, 76, 79, 87, 73, 78, 199, 70, 76, 79, 87, 69,
+ 210, 70, 76, 79, 85, 82, 73, 83, 72, 128, 70, 76, 79, 82, 69, 84, 84, 69,
+ 128, 70, 76, 79, 82, 65, 204, 70, 76, 79, 80, 80, 217, 70, 76, 79, 79,
+ 82, 128, 70, 76, 73, 80, 128, 70, 76, 73, 71, 72, 84, 128, 70, 76, 69,
+ 88, 85, 83, 128, 70, 76, 69, 88, 69, 196, 70, 76, 69, 85, 82, 45, 68, 69,
+ 45, 76, 73, 83, 128, 70, 76, 65, 84, 84, 69, 78, 69, 196, 70, 76, 65, 84,
+ 78, 69, 83, 83, 128, 70, 76, 65, 84, 128, 70, 76, 65, 212, 70, 76, 65,
+ 71, 83, 128, 70, 76, 65, 71, 45, 53, 128, 70, 76, 65, 71, 45, 52, 128,
+ 70, 76, 65, 71, 45, 51, 128, 70, 76, 65, 71, 45, 50, 128, 70, 76, 65, 71,
+ 45, 49, 128, 70, 76, 65, 71, 128, 70, 76, 65, 199, 70, 76, 65, 128, 70,
+ 76, 128, 70, 73, 88, 69, 68, 45, 70, 79, 82, 205, 70, 73, 88, 128, 70,
+ 73, 86, 69, 45, 84, 72, 73, 82, 84, 89, 128, 70, 73, 86, 69, 45, 76, 73,
+ 78, 197, 70, 73, 86, 197, 70, 73, 84, 65, 128, 70, 73, 84, 128, 70, 73,
+ 83, 84, 69, 196, 70, 73, 83, 84, 128, 70, 73, 83, 72, 73, 78, 199, 70,
+ 73, 83, 72, 72, 79, 79, 75, 128, 70, 73, 83, 72, 72, 79, 79, 203, 70, 73,
+ 83, 72, 69, 89, 69, 128, 70, 73, 83, 72, 128, 70, 73, 83, 200, 70, 73,
+ 82, 83, 212, 70, 73, 82, 73, 128, 70, 73, 82, 69, 87, 79, 82, 75, 83,
+ 128, 70, 73, 82, 69, 87, 79, 82, 203, 70, 73, 82, 69, 128, 70, 73, 82,
+ 197, 70, 73, 80, 128, 70, 73, 78, 73, 84, 197, 70, 73, 78, 71, 69, 82,
+ 78, 65, 73, 76, 83, 128, 70, 73, 78, 71, 69, 82, 69, 196, 70, 73, 78, 65,
+ 78, 67, 73, 65, 76, 128, 70, 73, 76, 76, 69, 82, 128, 70, 73, 76, 76, 69,
+ 196, 70, 73, 76, 76, 128, 70, 73, 76, 204, 70, 73, 76, 197, 70, 73, 73,
+ 128, 70, 73, 71, 85, 82, 69, 45, 51, 128, 70, 73, 71, 85, 82, 69, 45, 50,
+ 128, 70, 73, 71, 85, 82, 69, 45, 49, 128, 70, 73, 71, 85, 82, 197, 70,
+ 73, 71, 72, 84, 128, 70, 73, 70, 84, 89, 128, 70, 73, 70, 84, 217, 70,
+ 73, 70, 84, 72, 83, 128, 70, 73, 70, 84, 72, 128, 70, 73, 70, 84, 69, 69,
+ 78, 128, 70, 73, 70, 84, 69, 69, 206, 70, 73, 69, 76, 68, 128, 70, 72,
+ 84, 79, 82, 193, 70, 70, 76, 128, 70, 70, 73, 128, 70, 69, 85, 88, 128,
+ 70, 69, 85, 70, 69, 85, 65, 69, 84, 128, 70, 69, 83, 84, 73, 86, 65, 76,
+ 128, 70, 69, 82, 82, 89, 128, 70, 69, 82, 82, 73, 211, 70, 69, 82, 77,
+ 65, 84, 65, 128, 70, 69, 82, 77, 65, 84, 193, 70, 69, 79, 200, 70, 69,
+ 78, 199, 70, 69, 78, 67, 69, 128, 70, 69, 77, 73, 78, 73, 78, 197, 70,
+ 69, 77, 65, 76, 69, 128, 70, 69, 77, 65, 76, 197, 70, 69, 76, 76, 79, 87,
+ 83, 72, 73, 80, 128, 70, 69, 73, 128, 70, 69, 72, 213, 70, 69, 72, 128,
+ 70, 69, 200, 70, 69, 69, 78, 71, 128, 70, 69, 69, 68, 128, 70, 69, 69,
+ 196, 70, 69, 69, 128, 70, 69, 66, 82, 85, 65, 82, 89, 128, 70, 69, 65,
+ 84, 72, 69, 82, 128, 70, 69, 65, 84, 72, 69, 210, 70, 69, 65, 82, 78,
+ 128, 70, 69, 65, 82, 70, 85, 204, 70, 69, 65, 82, 128, 70, 65, 89, 65,
+ 78, 78, 65, 128, 70, 65, 88, 128, 70, 65, 216, 70, 65, 84, 73, 71, 85,
+ 69, 128, 70, 65, 84, 72, 69, 82, 128, 70, 65, 84, 72, 69, 210, 70, 65,
+ 84, 72, 65, 84, 65, 78, 128, 70, 65, 84, 72, 65, 84, 65, 206, 70, 65, 84,
+ 72, 65, 128, 70, 65, 84, 72, 193, 70, 65, 84, 128, 70, 65, 82, 83, 201,
+ 70, 65, 81, 128, 70, 65, 80, 128, 70, 65, 78, 71, 128, 70, 65, 78, 69,
+ 82, 79, 83, 73, 211, 70, 65, 78, 128, 70, 65, 77, 73, 76, 89, 128, 70,
+ 65, 76, 76, 73, 78, 199, 70, 65, 76, 76, 69, 206, 70, 65, 73, 76, 85, 82,
+ 69, 128, 70, 65, 73, 72, 85, 128, 70, 65, 72, 82, 69, 78, 72, 69, 73, 84,
+ 128, 70, 65, 67, 84, 79, 82, 89, 128, 70, 65, 67, 84, 79, 210, 70, 65,
+ 67, 83, 73, 77, 73, 76, 197, 70, 65, 67, 69, 45, 54, 128, 70, 65, 67, 69,
+ 45, 53, 128, 70, 65, 67, 69, 45, 52, 128, 70, 65, 67, 69, 45, 51, 128,
+ 70, 65, 67, 69, 45, 50, 128, 70, 65, 67, 69, 45, 49, 128, 70, 65, 65, 77,
+ 65, 69, 128, 70, 65, 65, 73, 128, 70, 65, 65, 70, 85, 128, 70, 48, 53,
+ 51, 128, 70, 48, 53, 50, 128, 70, 48, 53, 49, 67, 128, 70, 48, 53, 49,
+ 66, 128, 70, 48, 53, 49, 65, 128, 70, 48, 53, 49, 128, 70, 48, 53, 48,
+ 128, 70, 48, 52, 57, 128, 70, 48, 52, 56, 128, 70, 48, 52, 55, 65, 128,
+ 70, 48, 52, 55, 128, 70, 48, 52, 54, 65, 128, 70, 48, 52, 54, 128, 70,
+ 48, 52, 53, 65, 128, 70, 48, 52, 53, 128, 70, 48, 52, 52, 128, 70, 48,
+ 52, 51, 128, 70, 48, 52, 50, 128, 70, 48, 52, 49, 128, 70, 48, 52, 48,
+ 128, 70, 48, 51, 57, 128, 70, 48, 51, 56, 65, 128, 70, 48, 51, 56, 128,
+ 70, 48, 51, 55, 65, 128, 70, 48, 51, 55, 128, 70, 48, 51, 54, 128, 70,
+ 48, 51, 53, 128, 70, 48, 51, 52, 128, 70, 48, 51, 51, 128, 70, 48, 51,
+ 50, 128, 70, 48, 51, 49, 65, 128, 70, 48, 51, 49, 128, 70, 48, 51, 48,
+ 128, 70, 48, 50, 57, 128, 70, 48, 50, 56, 128, 70, 48, 50, 55, 128, 70,
+ 48, 50, 54, 128, 70, 48, 50, 53, 128, 70, 48, 50, 52, 128, 70, 48, 50,
+ 51, 128, 70, 48, 50, 50, 128, 70, 48, 50, 49, 65, 128, 70, 48, 50, 49,
+ 128, 70, 48, 50, 48, 128, 70, 48, 49, 57, 128, 70, 48, 49, 56, 128, 70,
+ 48, 49, 55, 128, 70, 48, 49, 54, 128, 70, 48, 49, 53, 128, 70, 48, 49,
+ 52, 128, 70, 48, 49, 51, 65, 128, 70, 48, 49, 51, 128, 70, 48, 49, 50,
+ 128, 70, 48, 49, 49, 128, 70, 48, 49, 48, 128, 70, 48, 48, 57, 128, 70,
+ 48, 48, 56, 128, 70, 48, 48, 55, 128, 70, 48, 48, 54, 128, 70, 48, 48,
+ 53, 128, 70, 48, 48, 52, 128, 70, 48, 48, 51, 128, 70, 48, 48, 50, 128,
+ 70, 48, 48, 49, 65, 128, 70, 48, 48, 49, 128, 69, 90, 200, 69, 90, 69,
+ 78, 128, 69, 90, 69, 206, 69, 90, 128, 69, 89, 69, 83, 128, 69, 89, 69,
+ 71, 76, 65, 83, 83, 69, 83, 128, 69, 89, 66, 69, 89, 70, 73, 76, 73, 128,
+ 69, 89, 65, 78, 78, 65, 128, 69, 88, 84, 82, 65, 84, 69, 82, 82, 69, 83,
+ 84, 82, 73, 65, 204, 69, 88, 84, 82, 65, 45, 76, 79, 215, 69, 88, 84, 82,
65, 45, 72, 73, 71, 200, 69, 88, 84, 69, 78, 83, 73, 79, 78, 128, 69, 88,
- 84, 69, 78, 68, 69, 196, 69, 88, 79, 128, 69, 88, 207, 69, 88, 73, 83,
- 84, 83, 128, 69, 88, 73, 83, 84, 128, 69, 88, 72, 65, 85, 83, 84, 73, 79,
- 78, 128, 69, 88, 67, 76, 65, 77, 65, 84, 73, 79, 78, 128, 69, 88, 67, 76,
- 65, 77, 65, 84, 73, 79, 206, 69, 88, 67, 69, 83, 83, 128, 69, 88, 67, 69,
- 76, 76, 69, 78, 84, 128, 69, 87, 69, 128, 69, 86, 69, 78, 73, 78, 71,
- 128, 69, 85, 82, 79, 45, 67, 85, 82, 82, 69, 78, 67, 217, 69, 85, 82,
- 207, 69, 85, 76, 69, 210, 69, 85, 45, 85, 128, 69, 85, 45, 69, 85, 128,
- 69, 84, 78, 65, 72, 84, 65, 128, 69, 84, 72, 69, 204, 69, 84, 69, 82, 79,
+ 84, 69, 78, 68, 69, 196, 69, 88, 80, 79, 78, 69, 78, 212, 69, 88, 79,
+ 128, 69, 88, 207, 69, 88, 73, 83, 84, 83, 128, 69, 88, 73, 83, 84, 128,
+ 69, 88, 72, 65, 85, 83, 84, 73, 79, 78, 128, 69, 88, 67, 76, 65, 77, 65,
+ 84, 73, 79, 78, 128, 69, 88, 67, 76, 65, 77, 65, 84, 73, 79, 206, 69, 88,
+ 67, 72, 65, 78, 71, 69, 128, 69, 88, 67, 69, 83, 83, 128, 69, 88, 67, 69,
+ 76, 76, 69, 78, 84, 128, 69, 87, 69, 128, 69, 86, 69, 82, 71, 82, 69, 69,
+ 206, 69, 86, 69, 78, 73, 78, 71, 128, 69, 85, 82, 79, 80, 69, 65, 206,
+ 69, 85, 82, 79, 80, 69, 45, 65, 70, 82, 73, 67, 65, 128, 69, 85, 82, 79,
+ 45, 67, 85, 82, 82, 69, 78, 67, 217, 69, 85, 82, 207, 69, 85, 76, 69,
+ 210, 69, 85, 45, 85, 128, 69, 85, 45, 79, 128, 69, 85, 45, 69, 85, 128,
+ 69, 85, 45, 69, 79, 128, 69, 85, 45, 69, 128, 69, 85, 45, 65, 128, 69,
+ 84, 78, 65, 72, 84, 65, 128, 69, 84, 72, 69, 204, 69, 84, 69, 82, 79,
206, 69, 84, 69, 82, 78, 73, 84, 89, 128, 69, 83, 85, 75, 85, 85, 68, 79,
128, 69, 83, 84, 73, 77, 65, 84, 69, 83, 128, 69, 83, 84, 73, 77, 65, 84,
69, 196, 69, 83, 72, 69, 51, 128, 69, 83, 72, 50, 49, 128, 69, 83, 72,
@@ -2798,12527 +3561,15251 @@ static unsigned char lexicon[] = {
81, 85, 73, 86, 65, 76, 69, 78, 212, 69, 81, 85, 73, 68, 128, 69, 81, 85,
73, 65, 78, 71, 85, 76, 65, 210, 69, 81, 85, 65, 76, 83, 128, 69, 81, 85,
65, 76, 211, 69, 81, 85, 65, 76, 128, 69, 80, 83, 73, 76, 79, 78, 128,
- 69, 80, 83, 73, 76, 79, 206, 69, 80, 73, 71, 82, 65, 80, 72, 73, 195, 69,
- 80, 73, 68, 65, 85, 82, 69, 65, 206, 69, 80, 69, 71, 69, 82, 77, 65, 128,
- 69, 79, 76, 72, 88, 128, 69, 79, 72, 128, 69, 78, 86, 69, 76, 79, 80, 69,
- 128, 69, 78, 84, 72, 85, 83, 73, 65, 83, 77, 128, 69, 78, 84, 69, 82, 80,
- 82, 73, 83, 69, 128, 69, 78, 84, 69, 82, 73, 78, 199, 69, 78, 84, 69, 82,
- 128, 69, 78, 84, 69, 210, 69, 78, 81, 85, 73, 82, 89, 128, 69, 78, 79,
- 211, 69, 78, 78, 128, 69, 78, 76, 65, 82, 71, 69, 77, 69, 78, 84, 128,
- 69, 78, 68, 79, 70, 79, 78, 79, 78, 128, 69, 78, 68, 73, 78, 199, 69, 78,
- 68, 69, 80, 128, 69, 78, 68, 69, 65, 86, 79, 85, 82, 128, 69, 78, 196,
+ 69, 80, 83, 73, 76, 79, 206, 69, 80, 79, 67, 72, 128, 69, 80, 73, 71, 82,
+ 65, 80, 72, 73, 195, 69, 80, 73, 68, 65, 85, 82, 69, 65, 206, 69, 80, 69,
+ 78, 84, 72, 69, 84, 73, 195, 69, 80, 69, 71, 69, 82, 77, 65, 128, 69, 79,
+ 76, 72, 88, 128, 69, 79, 72, 128, 69, 78, 89, 128, 69, 78, 86, 69, 76,
+ 79, 80, 69, 128, 69, 78, 86, 69, 76, 79, 80, 197, 69, 78, 85, 77, 69, 82,
+ 65, 84, 73, 79, 206, 69, 78, 84, 82, 89, 45, 50, 128, 69, 78, 84, 82, 89,
+ 45, 49, 128, 69, 78, 84, 82, 89, 128, 69, 78, 84, 82, 217, 69, 78, 84,
+ 72, 85, 83, 73, 65, 83, 77, 128, 69, 78, 84, 69, 82, 80, 82, 73, 83, 69,
+ 128, 69, 78, 84, 69, 82, 73, 78, 199, 69, 78, 84, 69, 82, 128, 69, 78,
+ 84, 69, 210, 69, 78, 81, 85, 73, 82, 89, 128, 69, 78, 79, 211, 69, 78,
+ 78, 128, 69, 78, 76, 65, 82, 71, 69, 77, 69, 78, 84, 128, 69, 78, 71, 73,
+ 78, 69, 128, 69, 78, 68, 79, 70, 79, 78, 79, 78, 128, 69, 78, 68, 73, 78,
+ 199, 69, 78, 68, 69, 80, 128, 69, 78, 68, 69, 65, 86, 79, 85, 82, 128,
69, 78, 67, 79, 85, 78, 84, 69, 82, 83, 128, 69, 78, 67, 76, 79, 83, 85,
- 82, 69, 128, 69, 78, 67, 76, 79, 83, 73, 78, 199, 69, 78, 65, 82, 88, 73,
- 211, 69, 78, 65, 82, 77, 79, 78, 73, 79, 211, 69, 77, 80, 84, 217, 69,
- 77, 80, 72, 65, 84, 73, 195, 69, 77, 80, 72, 65, 83, 73, 211, 69, 77, 66,
- 82, 79, 73, 68, 69, 82, 89, 128, 69, 77, 66, 69, 76, 76, 73, 83, 72, 77,
- 69, 78, 84, 128, 69, 77, 66, 69, 68, 68, 73, 78, 71, 128, 69, 76, 76, 73,
- 80, 83, 73, 83, 128, 69, 76, 76, 73, 80, 83, 69, 128, 69, 76, 73, 70, 73,
- 128, 69, 76, 69, 86, 69, 78, 128, 69, 76, 69, 86, 69, 206, 69, 76, 69,
- 77, 69, 78, 212, 69, 76, 69, 67, 84, 82, 73, 67, 65, 204, 69, 76, 69, 67,
- 84, 82, 73, 195, 69, 76, 65, 70, 82, 79, 78, 128, 69, 75, 83, 84, 82, 69,
- 80, 84, 79, 78, 128, 69, 75, 83, 128, 69, 75, 70, 79, 78, 73, 84, 73, 75,
- 79, 78, 128, 69, 75, 65, 82, 65, 128, 69, 74, 69, 67, 212, 69, 73, 83,
- 128, 69, 73, 71, 72, 84, 89, 128, 69, 73, 71, 72, 84, 217, 69, 73, 71,
- 72, 84, 72, 83, 128, 69, 73, 71, 72, 84, 72, 211, 69, 73, 71, 72, 84, 72,
- 128, 69, 73, 71, 72, 84, 69, 69, 78, 128, 69, 73, 71, 72, 84, 69, 69,
- 206, 69, 73, 69, 128, 69, 72, 87, 65, 218, 69, 71, 89, 80, 84, 79, 76,
- 79, 71, 73, 67, 65, 204, 69, 71, 73, 82, 128, 69, 71, 71, 128, 69, 69,
- 89, 65, 78, 78, 65, 128, 69, 69, 75, 65, 65, 128, 69, 69, 66, 69, 69, 70,
- 73, 76, 73, 128, 69, 68, 73, 84, 79, 82, 73, 65, 204, 69, 68, 73, 78,
- 128, 69, 68, 68, 128, 69, 67, 200, 69, 66, 69, 70, 73, 76, 73, 128, 69,
- 65, 83, 84, 69, 82, 206, 69, 65, 83, 212, 69, 65, 82, 84, 72, 76, 217,
- 69, 65, 82, 84, 72, 128, 69, 65, 82, 84, 200, 69, 65, 82, 76, 217, 69,
- 65, 77, 72, 65, 78, 67, 72, 79, 76, 76, 128, 69, 65, 71, 76, 69, 128, 69,
- 65, 68, 72, 65, 68, 72, 128, 69, 65, 66, 72, 65, 68, 72, 128, 69, 178,
- 68, 90, 90, 69, 128, 68, 90, 87, 69, 128, 68, 90, 85, 128, 68, 90, 79,
- 128, 68, 90, 74, 69, 128, 68, 90, 73, 128, 68, 90, 72, 69, 128, 68, 90,
- 72, 65, 128, 68, 90, 69, 76, 79, 128, 68, 90, 69, 69, 128, 68, 90, 69,
- 128, 68, 90, 65, 128, 68, 90, 128, 68, 218, 68, 89, 79, 128, 68, 89, 207,
- 68, 89, 69, 72, 128, 68, 89, 69, 200, 68, 87, 79, 128, 68, 87, 69, 128,
- 68, 87, 65, 128, 68, 86, 73, 83, 86, 65, 82, 65, 128, 68, 86, 128, 68,
- 85, 84, 73, 69, 83, 128, 68, 85, 82, 65, 84, 73, 79, 78, 128, 68, 85, 82,
+ 82, 69, 128, 69, 78, 67, 76, 79, 83, 73, 78, 199, 69, 78, 67, 128, 69,
+ 78, 65, 82, 88, 73, 211, 69, 78, 65, 82, 77, 79, 78, 73, 79, 211, 69, 77,
+ 80, 84, 217, 69, 77, 80, 72, 65, 84, 73, 195, 69, 77, 80, 72, 65, 83, 73,
+ 211, 69, 77, 66, 82, 79, 73, 68, 69, 82, 89, 128, 69, 77, 66, 76, 69, 77,
+ 128, 69, 77, 66, 69, 76, 76, 73, 83, 72, 77, 69, 78, 84, 128, 69, 77, 66,
+ 69, 68, 68, 73, 78, 71, 128, 69, 76, 84, 128, 69, 76, 76, 73, 80, 83, 73,
+ 83, 128, 69, 76, 76, 73, 80, 83, 69, 128, 69, 76, 73, 70, 73, 128, 69,
+ 76, 69, 86, 69, 78, 45, 84, 72, 73, 82, 84, 89, 128, 69, 76, 69, 86, 69,
+ 78, 128, 69, 76, 69, 86, 69, 206, 69, 76, 69, 80, 72, 65, 78, 84, 128,
+ 69, 76, 69, 77, 69, 78, 212, 69, 76, 69, 67, 84, 82, 73, 67, 65, 204, 69,
+ 76, 69, 67, 84, 82, 73, 195, 69, 76, 65, 70, 82, 79, 78, 128, 69, 75, 83,
+ 84, 82, 69, 80, 84, 79, 78, 128, 69, 75, 83, 128, 69, 75, 70, 79, 78, 73,
+ 84, 73, 75, 79, 78, 128, 69, 75, 65, 82, 65, 128, 69, 74, 69, 67, 212,
+ 69, 73, 83, 128, 69, 73, 71, 72, 84, 89, 128, 69, 73, 71, 72, 84, 217,
+ 69, 73, 71, 72, 84, 72, 83, 128, 69, 73, 71, 72, 84, 72, 211, 69, 73, 71,
+ 72, 84, 72, 128, 69, 73, 71, 72, 84, 69, 69, 78, 128, 69, 73, 71, 72, 84,
+ 69, 69, 206, 69, 73, 71, 72, 84, 45, 84, 72, 73, 82, 84, 89, 128, 69, 73,
+ 69, 128, 69, 72, 87, 65, 218, 69, 71, 89, 80, 84, 79, 76, 79, 71, 73, 67,
+ 65, 204, 69, 71, 73, 82, 128, 69, 71, 71, 128, 69, 69, 89, 65, 78, 78,
+ 65, 128, 69, 69, 75, 65, 65, 128, 69, 69, 66, 69, 69, 70, 73, 76, 73,
+ 128, 69, 68, 73, 84, 79, 82, 73, 65, 204, 69, 68, 73, 78, 128, 69, 68,
+ 68, 128, 69, 66, 69, 70, 73, 76, 73, 128, 69, 65, 83, 84, 69, 82, 206,
+ 69, 65, 83, 212, 69, 65, 82, 84, 72, 76, 217, 69, 65, 82, 84, 72, 128,
+ 69, 65, 82, 84, 200, 69, 65, 82, 83, 128, 69, 65, 82, 76, 217, 69, 65,
+ 77, 72, 65, 78, 67, 72, 79, 76, 76, 128, 69, 65, 71, 76, 69, 128, 69, 65,
+ 68, 72, 65, 68, 72, 128, 69, 65, 66, 72, 65, 68, 72, 128, 69, 178, 69,
+ 48, 51, 56, 128, 69, 48, 51, 55, 128, 69, 48, 51, 54, 128, 69, 48, 51,
+ 52, 65, 128, 69, 48, 51, 52, 128, 69, 48, 51, 51, 128, 69, 48, 51, 50,
+ 128, 69, 48, 51, 49, 128, 69, 48, 51, 48, 128, 69, 48, 50, 57, 128, 69,
+ 48, 50, 56, 65, 128, 69, 48, 50, 56, 128, 69, 48, 50, 55, 128, 69, 48,
+ 50, 54, 128, 69, 48, 50, 53, 128, 69, 48, 50, 52, 128, 69, 48, 50, 51,
+ 128, 69, 48, 50, 50, 128, 69, 48, 50, 49, 128, 69, 48, 50, 48, 65, 128,
+ 69, 48, 50, 48, 128, 69, 48, 49, 57, 128, 69, 48, 49, 56, 128, 69, 48,
+ 49, 55, 65, 128, 69, 48, 49, 55, 128, 69, 48, 49, 54, 65, 128, 69, 48,
+ 49, 54, 128, 69, 48, 49, 53, 128, 69, 48, 49, 52, 128, 69, 48, 49, 51,
+ 128, 69, 48, 49, 50, 128, 69, 48, 49, 49, 128, 69, 48, 49, 48, 128, 69,
+ 48, 48, 57, 65, 128, 69, 48, 48, 57, 128, 69, 48, 48, 56, 65, 128, 69,
+ 48, 48, 56, 128, 69, 48, 48, 55, 128, 69, 48, 48, 54, 128, 69, 48, 48,
+ 53, 128, 69, 48, 48, 52, 128, 69, 48, 48, 51, 128, 69, 48, 48, 50, 128,
+ 69, 48, 48, 49, 128, 69, 45, 77, 65, 73, 204, 68, 90, 90, 69, 128, 68,
+ 90, 87, 69, 128, 68, 90, 85, 128, 68, 90, 79, 128, 68, 90, 74, 69, 128,
+ 68, 90, 73, 128, 68, 90, 72, 69, 128, 68, 90, 72, 65, 128, 68, 90, 69,
+ 76, 79, 128, 68, 90, 69, 69, 128, 68, 90, 69, 128, 68, 90, 65, 65, 128,
+ 68, 90, 65, 128, 68, 90, 128, 68, 218, 68, 89, 79, 128, 68, 89, 207, 68,
+ 89, 69, 72, 128, 68, 89, 69, 200, 68, 87, 79, 128, 68, 87, 69, 128, 68,
+ 87, 65, 128, 68, 86, 73, 83, 86, 65, 82, 65, 128, 68, 86, 68, 128, 68,
+ 86, 128, 68, 85, 84, 73, 69, 83, 128, 68, 85, 83, 75, 128, 68, 85, 83,
+ 72, 69, 78, 78, 65, 128, 68, 85, 82, 65, 84, 73, 79, 78, 128, 68, 85, 82,
50, 128, 68, 85, 80, 79, 78, 68, 73, 85, 211, 68, 85, 79, 88, 128, 68,
85, 79, 128, 68, 85, 78, 52, 128, 68, 85, 78, 51, 128, 68, 85, 78, 179,
- 68, 85, 78, 128, 68, 85, 77, 128, 68, 85, 76, 128, 68, 85, 204, 68, 85,
- 72, 128, 68, 85, 71, 85, 68, 128, 68, 85, 66, 50, 128, 68, 85, 66, 128,
- 68, 85, 194, 68, 213, 68, 82, 89, 128, 68, 82, 217, 68, 82, 85, 77, 128,
- 68, 82, 85, 205, 68, 82, 79, 80, 83, 128, 68, 82, 79, 80, 45, 83, 72, 65,
- 68, 79, 87, 69, 196, 68, 82, 73, 86, 69, 128, 68, 82, 73, 204, 68, 82,
- 65, 85, 71, 72, 84, 211, 68, 82, 65, 71, 79, 78, 128, 68, 82, 65, 70, 84,
- 73, 78, 199, 68, 82, 65, 67, 72, 77, 65, 83, 128, 68, 82, 65, 67, 72, 77,
- 65, 128, 68, 82, 65, 67, 72, 77, 193, 68, 79, 87, 78, 87, 65, 82, 68, 83,
- 128, 68, 79, 87, 78, 87, 65, 82, 68, 211, 68, 79, 87, 78, 45, 80, 79, 73,
- 78, 84, 73, 78, 199, 68, 79, 87, 78, 128, 68, 79, 86, 69, 128, 68, 79,
- 85, 66, 84, 128, 68, 79, 85, 66, 76, 69, 196, 68, 79, 85, 66, 76, 69, 45,
- 76, 73, 78, 197, 68, 79, 85, 66, 76, 69, 45, 69, 78, 68, 69, 196, 68, 79,
- 85, 66, 76, 69, 128, 68, 79, 84, 84, 69, 68, 45, 80, 128, 68, 79, 84, 84,
- 69, 68, 45, 78, 128, 68, 79, 84, 84, 69, 68, 45, 76, 128, 68, 79, 84, 84,
- 69, 68, 128, 68, 79, 84, 84, 69, 196, 68, 79, 84, 83, 45, 56, 128, 68,
- 79, 84, 83, 45, 55, 56, 128, 68, 79, 84, 83, 45, 55, 128, 68, 79, 84, 83,
- 45, 54, 56, 128, 68, 79, 84, 83, 45, 54, 55, 56, 128, 68, 79, 84, 83, 45,
- 54, 55, 128, 68, 79, 84, 83, 45, 54, 128, 68, 79, 84, 83, 45, 53, 56,
- 128, 68, 79, 84, 83, 45, 53, 55, 56, 128, 68, 79, 84, 83, 45, 53, 55,
- 128, 68, 79, 84, 83, 45, 53, 54, 56, 128, 68, 79, 84, 83, 45, 53, 54, 55,
- 56, 128, 68, 79, 84, 83, 45, 53, 54, 55, 128, 68, 79, 84, 83, 45, 53, 54,
- 128, 68, 79, 84, 83, 45, 53, 128, 68, 79, 84, 83, 45, 52, 56, 128, 68,
- 79, 84, 83, 45, 52, 55, 56, 128, 68, 79, 84, 83, 45, 52, 55, 128, 68, 79,
- 84, 83, 45, 52, 54, 56, 128, 68, 79, 84, 83, 45, 52, 54, 55, 56, 128, 68,
- 79, 84, 83, 45, 52, 54, 55, 128, 68, 79, 84, 83, 45, 52, 54, 128, 68, 79,
- 84, 83, 45, 52, 53, 56, 128, 68, 79, 84, 83, 45, 52, 53, 55, 56, 128, 68,
- 79, 84, 83, 45, 52, 53, 55, 128, 68, 79, 84, 83, 45, 52, 53, 54, 56, 128,
- 68, 79, 84, 83, 45, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 52, 53,
- 54, 55, 128, 68, 79, 84, 83, 45, 52, 53, 54, 128, 68, 79, 84, 83, 45, 52,
- 53, 128, 68, 79, 84, 83, 45, 52, 128, 68, 79, 84, 83, 45, 51, 56, 128,
- 68, 79, 84, 83, 45, 51, 55, 56, 128, 68, 79, 84, 83, 45, 51, 55, 128, 68,
- 79, 84, 83, 45, 51, 54, 56, 128, 68, 79, 84, 83, 45, 51, 54, 55, 56, 128,
- 68, 79, 84, 83, 45, 51, 54, 55, 128, 68, 79, 84, 83, 45, 51, 54, 128, 68,
- 79, 84, 83, 45, 51, 53, 56, 128, 68, 79, 84, 83, 45, 51, 53, 55, 56, 128,
- 68, 79, 84, 83, 45, 51, 53, 55, 128, 68, 79, 84, 83, 45, 51, 53, 54, 56,
- 128, 68, 79, 84, 83, 45, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51,
- 53, 54, 55, 128, 68, 79, 84, 83, 45, 51, 53, 54, 128, 68, 79, 84, 83, 45,
- 51, 53, 128, 68, 79, 84, 83, 45, 51, 52, 56, 128, 68, 79, 84, 83, 45, 51,
- 52, 55, 56, 128, 68, 79, 84, 83, 45, 51, 52, 55, 128, 68, 79, 84, 83, 45,
- 51, 52, 54, 56, 128, 68, 79, 84, 83, 45, 51, 52, 54, 55, 56, 128, 68, 79,
- 84, 83, 45, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 51, 52, 54, 128, 68,
- 79, 84, 83, 45, 51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 55,
- 56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 51,
- 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 54, 55, 56, 128, 68,
- 79, 84, 83, 45, 51, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 51, 52, 53,
- 54, 128, 68, 79, 84, 83, 45, 51, 52, 53, 128, 68, 79, 84, 83, 45, 51, 52,
- 128, 68, 79, 84, 83, 45, 51, 128, 68, 79, 84, 83, 45, 50, 56, 128, 68,
- 79, 84, 83, 45, 50, 55, 56, 128, 68, 79, 84, 83, 45, 50, 55, 128, 68, 79,
- 84, 83, 45, 50, 54, 56, 128, 68, 79, 84, 83, 45, 50, 54, 55, 56, 128, 68,
- 79, 84, 83, 45, 50, 54, 55, 128, 68, 79, 84, 83, 45, 50, 54, 128, 68, 79,
- 84, 83, 45, 50, 53, 56, 128, 68, 79, 84, 83, 45, 50, 53, 55, 56, 128, 68,
- 79, 84, 83, 45, 50, 53, 55, 128, 68, 79, 84, 83, 45, 50, 53, 54, 56, 128,
- 68, 79, 84, 83, 45, 50, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 53,
- 54, 55, 128, 68, 79, 84, 83, 45, 50, 53, 54, 128, 68, 79, 84, 83, 45, 50,
- 53, 128, 68, 79, 84, 83, 45, 50, 52, 56, 128, 68, 79, 84, 83, 45, 50, 52,
- 55, 56, 128, 68, 79, 84, 83, 45, 50, 52, 55, 128, 68, 79, 84, 83, 45, 50,
- 52, 54, 56, 128, 68, 79, 84, 83, 45, 50, 52, 54, 55, 56, 128, 68, 79, 84,
- 83, 45, 50, 52, 54, 55, 128, 68, 79, 84, 83, 45, 50, 52, 54, 128, 68, 79,
- 84, 83, 45, 50, 52, 53, 56, 128, 68, 79, 84, 83, 45, 50, 52, 53, 55, 56,
- 128, 68, 79, 84, 83, 45, 50, 52, 53, 55, 128, 68, 79, 84, 83, 45, 50, 52,
- 53, 54, 56, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54, 55, 56, 128, 68, 79,
- 84, 83, 45, 50, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54,
- 128, 68, 79, 84, 83, 45, 50, 52, 53, 128, 68, 79, 84, 83, 45, 50, 52,
- 128, 68, 79, 84, 83, 45, 50, 51, 56, 128, 68, 79, 84, 83, 45, 50, 51, 55,
- 56, 128, 68, 79, 84, 83, 45, 50, 51, 55, 128, 68, 79, 84, 83, 45, 50, 51,
- 54, 56, 128, 68, 79, 84, 83, 45, 50, 51, 54, 55, 56, 128, 68, 79, 84, 83,
- 45, 50, 51, 54, 55, 128, 68, 79, 84, 83, 45, 50, 51, 54, 128, 68, 79, 84,
- 83, 45, 50, 51, 53, 56, 128, 68, 79, 84, 83, 45, 50, 51, 53, 55, 56, 128,
- 68, 79, 84, 83, 45, 50, 51, 53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 53,
- 54, 56, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 55, 56, 128, 68, 79, 84,
- 83, 45, 50, 51, 53, 54, 55, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 128,
- 68, 79, 84, 83, 45, 50, 51, 53, 128, 68, 79, 84, 83, 45, 50, 51, 52, 56,
- 128, 68, 79, 84, 83, 45, 50, 51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 50,
- 51, 52, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 56, 128, 68, 79, 84,
- 83, 45, 50, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54,
- 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 128, 68, 79, 84, 83, 45, 50,
- 51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 55, 56, 128, 68,
- 79, 84, 83, 45, 50, 51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52,
- 53, 54, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 54, 55, 56, 128, 68,
- 79, 84, 83, 45, 50, 51, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 50, 51,
- 52, 53, 54, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 128, 68, 79, 84, 83,
- 45, 50, 51, 52, 128, 68, 79, 84, 83, 45, 50, 51, 128, 68, 79, 84, 83, 45,
- 50, 128, 68, 79, 84, 83, 45, 49, 56, 128, 68, 79, 84, 83, 45, 49, 55, 56,
- 128, 68, 79, 84, 83, 45, 49, 55, 128, 68, 79, 84, 83, 45, 49, 54, 56,
- 128, 68, 79, 84, 83, 45, 49, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 54,
- 55, 128, 68, 79, 84, 83, 45, 49, 54, 128, 68, 79, 84, 83, 45, 49, 53, 56,
- 128, 68, 79, 84, 83, 45, 49, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 53,
- 55, 128, 68, 79, 84, 83, 45, 49, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49,
- 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 53, 54, 55, 128, 68, 79, 84,
- 83, 45, 49, 53, 54, 128, 68, 79, 84, 83, 45, 49, 53, 128, 68, 79, 84, 83,
- 45, 49, 52, 56, 128, 68, 79, 84, 83, 45, 49, 52, 55, 56, 128, 68, 79, 84,
- 83, 45, 49, 52, 55, 128, 68, 79, 84, 83, 45, 49, 52, 54, 56, 128, 68, 79,
- 84, 83, 45, 49, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 54, 55,
- 128, 68, 79, 84, 83, 45, 49, 52, 54, 128, 68, 79, 84, 83, 45, 49, 52, 53,
- 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45,
- 49, 52, 53, 55, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 56, 128, 68, 79,
- 84, 83, 45, 49, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 53,
- 54, 55, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 128, 68, 79, 84, 83, 45,
- 49, 52, 53, 128, 68, 79, 84, 83, 45, 49, 52, 128, 68, 79, 84, 83, 45, 49,
- 51, 56, 128, 68, 79, 84, 83, 45, 49, 51, 55, 56, 128, 68, 79, 84, 83, 45,
- 49, 51, 55, 128, 68, 79, 84, 83, 45, 49, 51, 54, 56, 128, 68, 79, 84, 83,
- 45, 49, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 54, 55, 128, 68,
- 79, 84, 83, 45, 49, 51, 54, 128, 68, 79, 84, 83, 45, 49, 51, 53, 56, 128,
- 68, 79, 84, 83, 45, 49, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51,
- 53, 55, 128, 68, 79, 84, 83, 45, 49, 51, 53, 54, 56, 128, 68, 79, 84, 83,
- 45, 49, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53, 54, 55,
- 128, 68, 79, 84, 83, 45, 49, 51, 53, 54, 128, 68, 79, 84, 83, 45, 49, 51,
- 53, 128, 68, 79, 84, 83, 45, 49, 51, 52, 56, 128, 68, 79, 84, 83, 45, 49,
- 51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 55, 128, 68, 79, 84,
- 83, 45, 49, 51, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 55,
- 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45,
- 49, 51, 52, 54, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 56, 128, 68, 79,
- 84, 83, 45, 49, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52,
- 53, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 56, 128, 68, 79, 84,
- 83, 45, 49, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52,
- 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 128, 68, 79, 84,
- 83, 45, 49, 51, 52, 53, 128, 68, 79, 84, 83, 45, 49, 51, 52, 128, 68, 79,
- 84, 83, 45, 49, 51, 128, 68, 79, 84, 83, 45, 49, 50, 56, 128, 68, 79, 84,
- 83, 45, 49, 50, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 55, 128, 68, 79,
- 84, 83, 45, 49, 50, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 54, 55, 56,
- 128, 68, 79, 84, 83, 45, 49, 50, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50,
- 54, 128, 68, 79, 84, 83, 45, 49, 50, 53, 56, 128, 68, 79, 84, 83, 45, 49,
- 50, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 53, 55, 128, 68, 79, 84,
- 83, 45, 49, 50, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 55,
- 56, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 55, 128, 68, 79, 84, 83, 45,
- 49, 50, 53, 54, 128, 68, 79, 84, 83, 45, 49, 50, 53, 128, 68, 79, 84, 83,
- 45, 49, 50, 52, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 55, 56, 128, 68,
- 79, 84, 83, 45, 49, 50, 52, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 54,
- 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 55, 56, 128, 68, 79, 84, 83,
- 45, 49, 50, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 128, 68,
- 79, 84, 83, 45, 49, 50, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52,
- 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 55, 128, 68, 79, 84,
- 83, 45, 49, 50, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53,
- 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54, 55, 128, 68, 79,
- 84, 83, 45, 49, 50, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53,
- 128, 68, 79, 84, 83, 45, 49, 50, 52, 128, 68, 79, 84, 83, 45, 49, 50, 51,
- 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 55, 56, 128, 68, 79, 84, 83, 45,
- 49, 50, 51, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 56, 128, 68, 79,
- 84, 83, 45, 49, 50, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51,
- 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 128, 68, 79, 84, 83, 45,
- 49, 50, 51, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 55, 56, 128,
- 68, 79, 84, 83, 45, 49, 50, 51, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50,
- 51, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 55, 56, 128,
- 68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49,
- 50, 51, 53, 54, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 128, 68, 79, 84,
- 83, 45, 49, 50, 51, 52, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 55,
- 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 55, 128, 68, 79, 84, 83, 45,
- 49, 50, 51, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 55,
- 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 55, 128, 68, 79, 84, 83,
- 45, 49, 50, 51, 52, 54, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 56,
- 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83,
- 45, 49, 50, 51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53,
- 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 55, 56, 128, 68,
- 79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49,
- 50, 51, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 128, 68,
- 79, 84, 83, 45, 49, 50, 51, 52, 128, 68, 79, 84, 83, 45, 49, 50, 51, 128,
- 68, 79, 84, 83, 45, 49, 50, 128, 68, 79, 84, 83, 45, 49, 128, 68, 79, 84,
- 83, 128, 68, 79, 84, 76, 69, 83, 211, 68, 79, 82, 85, 128, 68, 79, 79,
- 82, 128, 68, 79, 79, 78, 71, 128, 68, 79, 78, 71, 128, 68, 79, 78, 128,
- 68, 79, 77, 65, 73, 206, 68, 79, 76, 76, 65, 210, 68, 79, 76, 73, 85, 77,
- 128, 68, 79, 73, 84, 128, 68, 79, 71, 128, 68, 79, 69, 211, 68, 79, 68,
- 69, 75, 65, 84, 65, 128, 68, 79, 66, 82, 79, 128, 68, 79, 65, 67, 72, 65,
- 83, 72, 77, 69, 69, 128, 68, 79, 65, 67, 72, 65, 83, 72, 77, 69, 197, 68,
- 79, 65, 128, 68, 79, 45, 79, 128, 68, 77, 128, 68, 205, 68, 76, 85, 128,
- 68, 76, 79, 128, 68, 76, 73, 128, 68, 76, 69, 69, 128, 68, 76, 65, 128,
- 68, 76, 128, 68, 75, 65, 82, 128, 68, 75, 65, 210, 68, 74, 69, 82, 86,
- 73, 128, 68, 74, 69, 82, 86, 128, 68, 74, 69, 128, 68, 74, 65, 128, 68,
- 73, 86, 79, 82, 67, 197, 68, 73, 86, 73, 83, 73, 79, 78, 128, 68, 73, 86,
- 73, 83, 73, 79, 206, 68, 73, 86, 73, 78, 65, 84, 73, 79, 78, 128, 68, 73,
- 86, 73, 68, 69, 83, 128, 68, 73, 86, 73, 68, 69, 82, 128, 68, 73, 86, 73,
- 68, 69, 196, 68, 73, 86, 73, 68, 69, 128, 68, 73, 86, 73, 68, 197, 68,
- 73, 86, 69, 82, 71, 69, 78, 67, 69, 128, 68, 73, 84, 84, 207, 68, 73, 83,
- 84, 79, 82, 84, 73, 79, 78, 128, 68, 73, 83, 84, 73, 78, 71, 85, 73, 83,
- 72, 128, 68, 73, 83, 80, 69, 82, 83, 73, 79, 78, 128, 68, 73, 83, 73, 77,
- 79, 85, 128, 68, 73, 83, 72, 128, 68, 73, 83, 67, 79, 78, 84, 73, 78, 85,
- 79, 85, 211, 68, 73, 83, 195, 68, 73, 82, 69, 67, 84, 76, 217, 68, 73,
- 82, 69, 67, 84, 73, 79, 78, 65, 204, 68, 73, 80, 84, 69, 128, 68, 73, 80,
- 80, 69, 82, 128, 68, 73, 80, 76, 79, 85, 78, 128, 68, 73, 80, 76, 73,
- 128, 68, 73, 80, 76, 201, 68, 73, 78, 71, 66, 65, 212, 68, 73, 206, 68,
- 73, 77, 77, 73, 78, 71, 128, 68, 73, 77, 73, 78, 85, 84, 73, 79, 78, 45,
- 51, 128, 68, 73, 77, 73, 78, 85, 84, 73, 79, 78, 45, 50, 128, 68, 73, 77,
- 73, 78, 85, 84, 73, 79, 78, 45, 49, 128, 68, 73, 77, 73, 78, 73, 83, 72,
- 77, 69, 78, 84, 128, 68, 73, 77, 73, 68, 73, 193, 68, 73, 77, 69, 78, 83,
- 73, 79, 78, 65, 204, 68, 73, 77, 69, 78, 83, 73, 79, 206, 68, 73, 77, 50,
- 128, 68, 73, 71, 82, 65, 80, 72, 128, 68, 73, 71, 82, 65, 80, 200, 68,
- 73, 71, 82, 65, 77, 77, 79, 211, 68, 73, 71, 82, 65, 77, 77, 193, 68, 73,
- 71, 82, 65, 205, 68, 73, 71, 79, 82, 71, 79, 78, 128, 68, 73, 71, 79, 82,
- 71, 79, 206, 68, 73, 71, 65, 77, 77, 65, 128, 68, 73, 71, 193, 68, 73,
- 70, 84, 79, 71, 71, 79, 211, 68, 73, 70, 79, 78, 73, 65, 83, 128, 68, 73,
- 70, 70, 73, 67, 85, 76, 84, 217, 68, 73, 70, 70, 73, 67, 85, 76, 84, 73,
- 69, 83, 128, 68, 73, 70, 70, 69, 82, 69, 78, 84, 73, 65, 76, 128, 68, 73,
- 70, 70, 69, 82, 69, 78, 67, 197, 68, 73, 70, 65, 84, 128, 68, 73, 69, 83,
- 73, 83, 128, 68, 73, 69, 83, 73, 211, 68, 73, 69, 80, 128, 68, 73, 197,
- 68, 73, 66, 128, 68, 73, 65, 84, 79, 78, 79, 206, 68, 73, 65, 84, 79, 78,
- 73, 75, 201, 68, 73, 65, 83, 84, 79, 76, 201, 68, 73, 65, 77, 79, 78, 68,
- 128, 68, 73, 65, 77, 79, 78, 196, 68, 73, 65, 77, 69, 84, 69, 210, 68,
- 73, 65, 76, 89, 84, 73, 75, 65, 128, 68, 73, 65, 76, 89, 84, 73, 75, 193,
- 68, 73, 65, 76, 69, 67, 84, 45, 208, 68, 73, 65, 71, 79, 78, 65, 76, 128,
- 68, 73, 65, 71, 79, 78, 65, 204, 68, 73, 65, 69, 82, 69, 83, 73, 90, 69,
- 196, 68, 73, 65, 69, 82, 69, 83, 73, 211, 68, 72, 79, 79, 128, 68, 72,
- 79, 128, 68, 72, 73, 128, 68, 72, 72, 85, 128, 68, 72, 72, 79, 79, 128,
- 68, 72, 72, 79, 128, 68, 72, 72, 73, 128, 68, 72, 72, 69, 69, 128, 68,
- 72, 72, 69, 128, 68, 72, 72, 65, 128, 68, 72, 69, 69, 128, 68, 72, 65,
- 82, 77, 65, 128, 68, 72, 65, 76, 65, 84, 72, 128, 68, 72, 65, 76, 128,
- 68, 72, 65, 65, 76, 85, 128, 68, 72, 65, 128, 68, 69, 90, 200, 68, 69,
- 89, 84, 69, 82, 79, 213, 68, 69, 89, 84, 69, 82, 79, 211, 68, 69, 88, 73,
- 65, 128, 68, 69, 86, 73, 67, 197, 68, 69, 86, 69, 76, 79, 80, 77, 69, 78,
- 84, 128, 68, 69, 85, 78, 71, 128, 68, 69, 83, 73, 128, 68, 69, 83, 67,
- 82, 73, 80, 84, 73, 79, 206, 68, 69, 83, 67, 69, 78, 68, 73, 78, 199, 68,
- 69, 83, 67, 69, 78, 68, 69, 82, 128, 68, 69, 82, 69, 84, 45, 72, 73, 68,
- 69, 84, 128, 68, 69, 82, 69, 84, 128, 68, 69, 80, 65, 82, 84, 85, 82, 69,
- 128, 68, 69, 80, 65, 82, 84, 73, 78, 199, 68, 69, 78, 84, 73, 83, 84, 82,
- 217, 68, 69, 78, 84, 65, 204, 68, 69, 78, 79, 77, 73, 78, 65, 84, 79, 82,
- 128, 68, 69, 78, 79, 77, 73, 78, 65, 84, 79, 210, 68, 69, 78, 78, 69, 78,
- 128, 68, 69, 78, 71, 128, 68, 69, 78, 65, 82, 73, 85, 211, 68, 69, 76,
- 84, 65, 128, 68, 69, 76, 84, 193, 68, 69, 76, 84, 128, 68, 69, 76, 80,
- 72, 73, 195, 68, 69, 76, 73, 86, 69, 82, 65, 78, 67, 69, 128, 68, 69, 76,
- 73, 77, 73, 84, 69, 82, 128, 68, 69, 76, 73, 77, 73, 84, 69, 210, 68, 69,
- 76, 69, 84, 69, 128, 68, 69, 76, 69, 84, 197, 68, 69, 75, 65, 128, 68,
- 69, 75, 128, 68, 69, 73, 128, 68, 69, 72, 73, 128, 68, 69, 71, 82, 69,
- 197, 68, 69, 70, 73, 78, 73, 84, 73, 79, 78, 128, 68, 69, 70, 69, 67, 84,
- 73, 86, 69, 78, 69, 83, 211, 68, 69, 69, 82, 128, 68, 69, 69, 76, 128,
- 68, 69, 67, 82, 69, 83, 67, 69, 78, 68, 79, 128, 68, 69, 67, 82, 69, 65,
- 83, 69, 128, 68, 69, 67, 73, 83, 73, 86, 69, 78, 69, 83, 83, 128, 68, 69,
- 67, 73, 77, 65, 204, 68, 69, 67, 69, 77, 66, 69, 82, 128, 68, 69, 67, 65,
- 89, 69, 68, 128, 68, 69, 66, 73, 212, 68, 69, 65, 84, 72, 128, 68, 69,
- 65, 68, 128, 68, 68, 87, 65, 128, 68, 68, 85, 88, 128, 68, 68, 85, 84,
- 128, 68, 68, 85, 82, 88, 128, 68, 68, 85, 82, 128, 68, 68, 85, 80, 128,
- 68, 68, 85, 79, 88, 128, 68, 68, 85, 79, 80, 128, 68, 68, 85, 79, 128,
- 68, 68, 85, 128, 68, 68, 79, 88, 128, 68, 68, 79, 84, 128, 68, 68, 79,
- 80, 128, 68, 68, 79, 65, 128, 68, 68, 73, 88, 128, 68, 68, 73, 84, 128,
- 68, 68, 73, 80, 128, 68, 68, 73, 69, 88, 128, 68, 68, 73, 69, 80, 128,
- 68, 68, 73, 69, 128, 68, 68, 73, 128, 68, 68, 72, 79, 128, 68, 68, 72,
- 65, 128, 68, 68, 69, 88, 128, 68, 68, 69, 80, 128, 68, 68, 69, 69, 128,
- 68, 68, 69, 128, 68, 68, 68, 72, 65, 128, 68, 68, 68, 65, 128, 68, 68,
- 65, 89, 65, 78, 78, 65, 128, 68, 68, 65, 88, 128, 68, 68, 65, 84, 128,
- 68, 68, 65, 80, 128, 68, 68, 65, 76, 128, 68, 68, 65, 204, 68, 68, 65,
- 72, 65, 76, 128, 68, 68, 65, 72, 65, 204, 68, 68, 65, 65, 128, 68, 194,
- 68, 65, 217, 68, 65, 86, 73, 89, 65, 78, 73, 128, 68, 65, 86, 73, 68,
- 128, 68, 65, 84, 197, 68, 65, 83, 73, 65, 128, 68, 65, 83, 72, 69, 196,
- 68, 65, 83, 72, 128, 68, 65, 83, 200, 68, 65, 83, 69, 73, 65, 128, 68,
- 65, 82, 84, 128, 68, 65, 82, 75, 69, 78, 73, 78, 71, 128, 68, 65, 82, 75,
- 69, 78, 73, 78, 199, 68, 65, 82, 203, 68, 65, 82, 71, 65, 128, 68, 65,
- 82, 65, 52, 128, 68, 65, 82, 65, 51, 128, 68, 65, 82, 128, 68, 65, 80,
- 45, 80, 82, 65, 205, 68, 65, 80, 45, 80, 73, 201, 68, 65, 80, 45, 77, 85,
- 79, 217, 68, 65, 80, 45, 66, 85, 79, 206, 68, 65, 80, 45, 66, 69, 201,
- 68, 65, 208, 68, 65, 78, 84, 65, 74, 193, 68, 65, 78, 71, 128, 68, 65,
- 78, 199, 68, 65, 78, 68, 65, 128, 68, 65, 77, 80, 128, 68, 65, 77, 208,
- 68, 65, 77, 77, 65, 84, 65, 78, 128, 68, 65, 77, 77, 65, 84, 65, 206, 68,
- 65, 77, 77, 65, 128, 68, 65, 77, 77, 193, 68, 65, 77, 65, 82, 85, 128,
- 68, 65, 76, 69, 84, 128, 68, 65, 76, 69, 212, 68, 65, 76, 68, 65, 128,
- 68, 65, 76, 65, 84, 72, 128, 68, 65, 76, 65, 84, 200, 68, 65, 73, 82,
- 128, 68, 65, 73, 78, 71, 128, 68, 65, 72, 89, 65, 65, 85, 83, 72, 45, 50,
- 128, 68, 65, 72, 89, 65, 65, 85, 83, 72, 128, 68, 65, 71, 83, 128, 68,
- 65, 71, 71, 69, 82, 128, 68, 65, 71, 69, 83, 72, 128, 68, 65, 71, 69, 83,
- 200, 68, 65, 71, 66, 65, 83, 73, 78, 78, 65, 128, 68, 65, 71, 65, 218,
- 68, 65, 71, 65, 76, 71, 65, 128, 68, 65, 199, 68, 65, 69, 78, 71, 128,
- 68, 65, 69, 199, 68, 65, 68, 128, 68, 65, 196, 68, 65, 65, 83, 85, 128,
- 68, 65, 65, 68, 72, 85, 128, 67, 89, 88, 128, 67, 89, 84, 128, 67, 89,
- 82, 88, 128, 67, 89, 82, 69, 78, 65, 73, 195, 67, 89, 82, 128, 67, 89,
- 80, 69, 82, 85, 83, 128, 67, 89, 80, 128, 67, 89, 76, 73, 78, 68, 82, 73,
- 67, 73, 84, 89, 128, 67, 89, 65, 128, 67, 89, 128, 67, 87, 79, 79, 128,
- 67, 87, 79, 128, 67, 87, 73, 73, 128, 67, 87, 73, 128, 67, 87, 69, 79,
- 82, 84, 72, 128, 67, 87, 69, 128, 67, 87, 65, 65, 128, 67, 85, 88, 128,
- 67, 85, 84, 128, 67, 85, 212, 67, 85, 83, 84, 79, 77, 69, 210, 67, 85,
- 82, 88, 128, 67, 85, 82, 86, 73, 78, 199, 67, 85, 82, 86, 69, 196, 67,
- 85, 82, 86, 69, 128, 67, 85, 82, 86, 197, 67, 85, 82, 82, 69, 78, 84,
- 128, 67, 85, 82, 82, 69, 78, 212, 67, 85, 82, 76, 217, 67, 85, 82, 76,
- 128, 67, 85, 82, 128, 67, 85, 80, 128, 67, 85, 79, 88, 128, 67, 85, 79,
- 80, 128, 67, 85, 79, 128, 67, 85, 205, 67, 85, 66, 69, 68, 128, 67, 85,
- 66, 197, 67, 85, 65, 84, 82, 73, 76, 76, 79, 128, 67, 85, 65, 84, 82, 73,
- 76, 76, 207, 67, 85, 128, 67, 82, 89, 80, 84, 79, 71, 82, 65, 77, 77, 73,
- 195, 67, 82, 85, 90, 69, 73, 82, 207, 67, 82, 79, 83, 83, 73, 78, 199,
- 67, 82, 79, 83, 83, 72, 65, 84, 67, 200, 67, 82, 79, 83, 83, 69, 68, 45,
- 84, 65, 73, 76, 128, 67, 82, 79, 83, 83, 69, 196, 67, 82, 79, 83, 83, 66,
- 79, 78, 69, 83, 128, 67, 82, 79, 83, 83, 128, 67, 82, 79, 83, 211, 67,
- 82, 79, 80, 128, 67, 82, 79, 73, 88, 128, 67, 82, 69, 83, 67, 69, 78, 84,
+ 68, 85, 77, 128, 68, 85, 204, 68, 85, 72, 128, 68, 85, 71, 85, 68, 128,
+ 68, 85, 66, 50, 128, 68, 85, 66, 128, 68, 85, 194, 68, 82, 89, 128, 68,
+ 82, 217, 68, 82, 85, 77, 128, 68, 82, 85, 205, 68, 82, 79, 80, 83, 128,
+ 68, 82, 79, 80, 76, 69, 84, 128, 68, 82, 79, 80, 45, 83, 72, 65, 68, 79,
+ 87, 69, 196, 68, 82, 79, 77, 69, 68, 65, 82, 217, 68, 82, 73, 86, 69,
+ 128, 68, 82, 73, 86, 197, 68, 82, 73, 78, 75, 128, 68, 82, 73, 204, 68,
+ 82, 69, 83, 83, 128, 68, 82, 65, 85, 71, 72, 84, 211, 68, 82, 65, 77,
+ 128, 68, 82, 65, 71, 79, 78, 128, 68, 82, 65, 71, 79, 206, 68, 82, 65,
+ 70, 84, 73, 78, 199, 68, 82, 65, 67, 72, 77, 65, 83, 128, 68, 82, 65, 67,
+ 72, 77, 65, 128, 68, 82, 65, 67, 72, 77, 193, 68, 79, 87, 78, 87, 65, 82,
+ 68, 83, 128, 68, 79, 87, 78, 87, 65, 82, 68, 211, 68, 79, 87, 78, 45, 80,
+ 79, 73, 78, 84, 73, 78, 199, 68, 79, 87, 78, 128, 68, 79, 86, 69, 128,
+ 68, 79, 85, 71, 72, 78, 85, 84, 128, 68, 79, 85, 66, 84, 128, 68, 79, 85,
+ 66, 76, 69, 196, 68, 79, 85, 66, 76, 69, 45, 76, 73, 78, 197, 68, 79, 85,
+ 66, 76, 69, 45, 69, 78, 68, 69, 196, 68, 79, 85, 66, 76, 69, 128, 68, 79,
+ 84, 84, 69, 68, 45, 80, 128, 68, 79, 84, 84, 69, 68, 45, 78, 128, 68, 79,
+ 84, 84, 69, 68, 45, 76, 128, 68, 79, 84, 84, 69, 68, 128, 68, 79, 84, 84,
+ 69, 196, 68, 79, 84, 83, 45, 56, 128, 68, 79, 84, 83, 45, 55, 56, 128,
+ 68, 79, 84, 83, 45, 55, 128, 68, 79, 84, 83, 45, 54, 56, 128, 68, 79, 84,
+ 83, 45, 54, 55, 56, 128, 68, 79, 84, 83, 45, 54, 55, 128, 68, 79, 84, 83,
+ 45, 54, 128, 68, 79, 84, 83, 45, 53, 56, 128, 68, 79, 84, 83, 45, 53, 55,
+ 56, 128, 68, 79, 84, 83, 45, 53, 55, 128, 68, 79, 84, 83, 45, 53, 54, 56,
+ 128, 68, 79, 84, 83, 45, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 53, 54,
+ 55, 128, 68, 79, 84, 83, 45, 53, 54, 128, 68, 79, 84, 83, 45, 53, 128,
+ 68, 79, 84, 83, 45, 52, 56, 128, 68, 79, 84, 83, 45, 52, 55, 56, 128, 68,
+ 79, 84, 83, 45, 52, 55, 128, 68, 79, 84, 83, 45, 52, 54, 56, 128, 68, 79,
+ 84, 83, 45, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 52, 54, 55, 128, 68,
+ 79, 84, 83, 45, 52, 54, 128, 68, 79, 84, 83, 45, 52, 53, 56, 128, 68, 79,
+ 84, 83, 45, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 52, 53, 55, 128, 68,
+ 79, 84, 83, 45, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 52, 53, 54, 55,
+ 56, 128, 68, 79, 84, 83, 45, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 52,
+ 53, 54, 128, 68, 79, 84, 83, 45, 52, 53, 128, 68, 79, 84, 83, 45, 52,
+ 128, 68, 79, 84, 83, 45, 51, 56, 128, 68, 79, 84, 83, 45, 51, 55, 56,
+ 128, 68, 79, 84, 83, 45, 51, 55, 128, 68, 79, 84, 83, 45, 51, 54, 56,
+ 128, 68, 79, 84, 83, 45, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 54,
+ 55, 128, 68, 79, 84, 83, 45, 51, 54, 128, 68, 79, 84, 83, 45, 51, 53, 56,
+ 128, 68, 79, 84, 83, 45, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 51, 53,
+ 55, 128, 68, 79, 84, 83, 45, 51, 53, 54, 56, 128, 68, 79, 84, 83, 45, 51,
+ 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 53, 54, 55, 128, 68, 79, 84,
+ 83, 45, 51, 53, 54, 128, 68, 79, 84, 83, 45, 51, 53, 128, 68, 79, 84, 83,
+ 45, 51, 52, 56, 128, 68, 79, 84, 83, 45, 51, 52, 55, 56, 128, 68, 79, 84,
+ 83, 45, 51, 52, 55, 128, 68, 79, 84, 83, 45, 51, 52, 54, 56, 128, 68, 79,
+ 84, 83, 45, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 52, 54, 55,
+ 128, 68, 79, 84, 83, 45, 51, 52, 54, 128, 68, 79, 84, 83, 45, 51, 52, 53,
+ 56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45,
+ 51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 51, 52, 53, 54, 56, 128, 68, 79,
+ 84, 83, 45, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 52, 53,
+ 54, 55, 128, 68, 79, 84, 83, 45, 51, 52, 53, 54, 128, 68, 79, 84, 83, 45,
+ 51, 52, 53, 128, 68, 79, 84, 83, 45, 51, 52, 128, 68, 79, 84, 83, 45, 51,
+ 128, 68, 79, 84, 83, 45, 50, 56, 128, 68, 79, 84, 83, 45, 50, 55, 56,
+ 128, 68, 79, 84, 83, 45, 50, 55, 128, 68, 79, 84, 83, 45, 50, 54, 56,
+ 128, 68, 79, 84, 83, 45, 50, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 54,
+ 55, 128, 68, 79, 84, 83, 45, 50, 54, 128, 68, 79, 84, 83, 45, 50, 53, 56,
+ 128, 68, 79, 84, 83, 45, 50, 53, 55, 56, 128, 68, 79, 84, 83, 45, 50, 53,
+ 55, 128, 68, 79, 84, 83, 45, 50, 53, 54, 56, 128, 68, 79, 84, 83, 45, 50,
+ 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 53, 54, 55, 128, 68, 79, 84,
+ 83, 45, 50, 53, 54, 128, 68, 79, 84, 83, 45, 50, 53, 128, 68, 79, 84, 83,
+ 45, 50, 52, 56, 128, 68, 79, 84, 83, 45, 50, 52, 55, 56, 128, 68, 79, 84,
+ 83, 45, 50, 52, 55, 128, 68, 79, 84, 83, 45, 50, 52, 54, 56, 128, 68, 79,
+ 84, 83, 45, 50, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 52, 54, 55,
+ 128, 68, 79, 84, 83, 45, 50, 52, 54, 128, 68, 79, 84, 83, 45, 50, 52, 53,
+ 56, 128, 68, 79, 84, 83, 45, 50, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45,
+ 50, 52, 53, 55, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54, 56, 128, 68, 79,
+ 84, 83, 45, 50, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 52, 53,
+ 54, 55, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54, 128, 68, 79, 84, 83, 45,
+ 50, 52, 53, 128, 68, 79, 84, 83, 45, 50, 52, 128, 68, 79, 84, 83, 45, 50,
+ 51, 56, 128, 68, 79, 84, 83, 45, 50, 51, 55, 56, 128, 68, 79, 84, 83, 45,
+ 50, 51, 55, 128, 68, 79, 84, 83, 45, 50, 51, 54, 56, 128, 68, 79, 84, 83,
+ 45, 50, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 54, 55, 128, 68,
+ 79, 84, 83, 45, 50, 51, 54, 128, 68, 79, 84, 83, 45, 50, 51, 53, 56, 128,
+ 68, 79, 84, 83, 45, 50, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51,
+ 53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 56, 128, 68, 79, 84, 83,
+ 45, 50, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 55,
+ 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 128, 68, 79, 84, 83, 45, 50, 51,
+ 53, 128, 68, 79, 84, 83, 45, 50, 51, 52, 56, 128, 68, 79, 84, 83, 45, 50,
+ 51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 55, 128, 68, 79, 84,
+ 83, 45, 50, 51, 52, 54, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 55,
+ 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45,
+ 50, 51, 52, 54, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 56, 128, 68, 79,
+ 84, 83, 45, 50, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52,
+ 53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 54, 56, 128, 68, 79, 84,
+ 83, 45, 50, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52,
+ 53, 54, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 54, 128, 68, 79, 84,
+ 83, 45, 50, 51, 52, 53, 128, 68, 79, 84, 83, 45, 50, 51, 52, 128, 68, 79,
+ 84, 83, 45, 50, 51, 128, 68, 79, 84, 83, 45, 50, 128, 68, 79, 84, 83, 45,
+ 49, 56, 128, 68, 79, 84, 83, 45, 49, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 55, 128, 68, 79, 84, 83, 45, 49, 54, 56, 128, 68, 79, 84, 83, 45, 49, 54,
+ 55, 56, 128, 68, 79, 84, 83, 45, 49, 54, 55, 128, 68, 79, 84, 83, 45, 49,
+ 54, 128, 68, 79, 84, 83, 45, 49, 53, 56, 128, 68, 79, 84, 83, 45, 49, 53,
+ 55, 56, 128, 68, 79, 84, 83, 45, 49, 53, 55, 128, 68, 79, 84, 83, 45, 49,
+ 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 53, 54, 55, 56, 128, 68, 79, 84,
+ 83, 45, 49, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 53, 54, 128, 68, 79,
+ 84, 83, 45, 49, 53, 128, 68, 79, 84, 83, 45, 49, 52, 56, 128, 68, 79, 84,
+ 83, 45, 49, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 55, 128, 68, 79,
+ 84, 83, 45, 49, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49, 52, 54, 55, 56,
+ 128, 68, 79, 84, 83, 45, 49, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 52,
+ 54, 128, 68, 79, 84, 83, 45, 49, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49,
+ 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 55, 128, 68, 79, 84,
+ 83, 45, 49, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 55,
+ 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45,
+ 49, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 52, 53, 128, 68, 79, 84, 83,
+ 45, 49, 52, 128, 68, 79, 84, 83, 45, 49, 51, 56, 128, 68, 79, 84, 83, 45,
+ 49, 51, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 55, 128, 68, 79, 84, 83,
+ 45, 49, 51, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 54, 55, 56, 128, 68,
+ 79, 84, 83, 45, 49, 51, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51, 54, 128,
+ 68, 79, 84, 83, 45, 49, 51, 53, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53,
+ 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53, 55, 128, 68, 79, 84, 83, 45,
+ 49, 51, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53, 54, 55, 56, 128,
+ 68, 79, 84, 83, 45, 49, 51, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51,
+ 53, 54, 128, 68, 79, 84, 83, 45, 49, 51, 53, 128, 68, 79, 84, 83, 45, 49,
+ 51, 52, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 55, 56, 128, 68, 79, 84,
+ 83, 45, 49, 51, 52, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 56, 128,
+ 68, 79, 84, 83, 45, 49, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 128, 68, 79, 84,
+ 83, 45, 49, 51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 55,
+ 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 55, 128, 68, 79, 84, 83, 45,
+ 49, 51, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 55,
+ 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 55, 128, 68, 79, 84, 83,
+ 45, 49, 51, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 128, 68,
+ 79, 84, 83, 45, 49, 51, 52, 128, 68, 79, 84, 83, 45, 49, 51, 128, 68, 79,
+ 84, 83, 45, 49, 50, 56, 128, 68, 79, 84, 83, 45, 49, 50, 55, 56, 128, 68,
+ 79, 84, 83, 45, 49, 50, 55, 128, 68, 79, 84, 83, 45, 49, 50, 54, 56, 128,
+ 68, 79, 84, 83, 45, 49, 50, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50,
+ 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 54, 128, 68, 79, 84, 83, 45, 49,
+ 50, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50, 53, 55, 56, 128, 68, 79, 84,
+ 83, 45, 49, 50, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 56, 128,
+ 68, 79, 84, 83, 45, 49, 50, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 128, 68, 79, 84,
+ 83, 45, 49, 50, 53, 128, 68, 79, 84, 83, 45, 49, 50, 52, 56, 128, 68, 79,
+ 84, 83, 45, 49, 50, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 55,
+ 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 55, 128, 68,
+ 79, 84, 83, 45, 49, 50, 52, 54, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53,
+ 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 55, 56, 128, 68, 79, 84, 83,
+ 45, 49, 50, 52, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54, 56,
+ 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83,
+ 45, 49, 50, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54,
+ 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 128, 68, 79, 84, 83, 45, 49, 50,
+ 52, 128, 68, 79, 84, 83, 45, 49, 50, 51, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 51, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 55, 128, 68, 79, 84,
+ 83, 45, 49, 50, 51, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 55,
+ 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 55, 128, 68, 79, 84, 83, 45,
+ 49, 50, 51, 54, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 56, 128, 68, 79,
+ 84, 83, 45, 49, 50, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51,
+ 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 56, 128, 68, 79, 84,
+ 83, 45, 49, 50, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51,
+ 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 128, 68, 79, 84,
+ 83, 45, 49, 50, 51, 53, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 56, 128,
+ 68, 79, 84, 83, 45, 49, 50, 51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 51, 52, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 56, 128, 68,
+ 79, 84, 83, 45, 49, 50, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 128, 68,
+ 79, 84, 83, 45, 49, 50, 51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50,
+ 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 55, 128,
+ 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45,
+ 49, 50, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52,
+ 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 128, 68, 79,
+ 84, 83, 45, 49, 50, 51, 52, 53, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52,
+ 128, 68, 79, 84, 83, 45, 49, 50, 51, 128, 68, 79, 84, 83, 45, 49, 50,
+ 128, 68, 79, 84, 83, 45, 49, 128, 68, 79, 84, 83, 128, 68, 79, 84, 76,
+ 69, 83, 211, 68, 79, 82, 85, 128, 68, 79, 79, 82, 128, 68, 79, 79, 78,
+ 71, 128, 68, 79, 78, 71, 128, 68, 79, 77, 65, 73, 206, 68, 79, 76, 80,
+ 72, 73, 78, 128, 68, 79, 76, 76, 83, 128, 68, 79, 76, 76, 65, 210, 68,
+ 79, 76, 73, 85, 77, 128, 68, 79, 75, 77, 65, 73, 128, 68, 79, 73, 84,
+ 128, 68, 79, 71, 128, 68, 79, 199, 68, 79, 69, 211, 68, 79, 68, 69, 75,
+ 65, 84, 65, 128, 68, 79, 66, 82, 79, 128, 68, 79, 65, 67, 72, 65, 83, 72,
+ 77, 69, 69, 128, 68, 79, 65, 67, 72, 65, 83, 72, 77, 69, 197, 68, 79, 65,
+ 128, 68, 79, 45, 79, 128, 68, 77, 128, 68, 205, 68, 76, 85, 128, 68, 76,
+ 79, 128, 68, 76, 73, 128, 68, 76, 69, 69, 128, 68, 76, 65, 128, 68, 76,
+ 128, 68, 75, 65, 82, 128, 68, 75, 65, 210, 68, 74, 69, 82, 86, 73, 128,
+ 68, 74, 69, 82, 86, 128, 68, 74, 69, 128, 68, 74, 65, 128, 68, 74, 128,
+ 68, 73, 90, 90, 217, 68, 73, 86, 79, 82, 67, 197, 68, 73, 86, 73, 83, 73,
+ 79, 78, 128, 68, 73, 86, 73, 83, 73, 79, 206, 68, 73, 86, 73, 78, 65, 84,
+ 73, 79, 78, 128, 68, 73, 86, 73, 68, 69, 83, 128, 68, 73, 86, 73, 68, 69,
+ 82, 128, 68, 73, 86, 73, 68, 69, 196, 68, 73, 86, 73, 68, 69, 128, 68,
+ 73, 86, 73, 68, 197, 68, 73, 86, 69, 82, 71, 69, 78, 67, 69, 128, 68, 73,
+ 84, 84, 207, 68, 73, 83, 84, 79, 82, 84, 73, 79, 78, 128, 68, 73, 83, 84,
+ 73, 78, 71, 85, 73, 83, 72, 128, 68, 73, 83, 84, 73, 76, 76, 128, 68, 73,
+ 83, 83, 79, 76, 86, 69, 45, 50, 128, 68, 73, 83, 83, 79, 76, 86, 69, 128,
+ 68, 73, 83, 80, 69, 82, 83, 73, 79, 78, 128, 68, 73, 83, 75, 128, 68, 73,
+ 83, 73, 77, 79, 85, 128, 68, 73, 83, 72, 128, 68, 73, 83, 67, 79, 78, 84,
+ 73, 78, 85, 79, 85, 211, 68, 73, 83, 195, 68, 73, 83, 65, 80, 80, 79, 73,
+ 78, 84, 69, 196, 68, 73, 83, 65, 66, 76, 69, 196, 68, 73, 82, 71, 193,
+ 68, 73, 82, 69, 67, 84, 76, 217, 68, 73, 82, 69, 67, 84, 73, 79, 78, 65,
+ 204, 68, 73, 80, 84, 69, 128, 68, 73, 80, 80, 69, 82, 128, 68, 73, 80,
+ 76, 79, 85, 78, 128, 68, 73, 80, 76, 73, 128, 68, 73, 80, 76, 201, 68,
+ 73, 78, 71, 66, 65, 212, 68, 73, 206, 68, 73, 77, 77, 73, 78, 71, 128,
+ 68, 73, 77, 73, 78, 85, 84, 73, 79, 78, 45, 51, 128, 68, 73, 77, 73, 78,
+ 85, 84, 73, 79, 78, 45, 50, 128, 68, 73, 77, 73, 78, 85, 84, 73, 79, 78,
+ 45, 49, 128, 68, 73, 77, 73, 78, 73, 83, 72, 77, 69, 78, 84, 128, 68, 73,
+ 77, 73, 68, 73, 193, 68, 73, 77, 69, 78, 83, 73, 79, 78, 65, 204, 68, 73,
+ 77, 69, 78, 83, 73, 79, 206, 68, 73, 77, 50, 128, 68, 73, 76, 128, 68,
+ 73, 71, 82, 65, 80, 72, 128, 68, 73, 71, 82, 65, 80, 200, 68, 73, 71, 82,
+ 65, 77, 77, 79, 211, 68, 73, 71, 82, 65, 77, 77, 193, 68, 73, 71, 82, 65,
+ 205, 68, 73, 71, 79, 82, 71, 79, 78, 128, 68, 73, 71, 79, 82, 71, 79,
+ 206, 68, 73, 71, 65, 77, 77, 65, 128, 68, 73, 71, 193, 68, 73, 70, 84,
+ 79, 71, 71, 79, 211, 68, 73, 70, 79, 78, 73, 65, 83, 128, 68, 73, 70, 70,
+ 73, 67, 85, 76, 84, 217, 68, 73, 70, 70, 73, 67, 85, 76, 84, 73, 69, 83,
+ 128, 68, 73, 70, 70, 69, 82, 69, 78, 84, 73, 65, 76, 128, 68, 73, 70, 70,
+ 69, 82, 69, 78, 67, 197, 68, 73, 70, 65, 84, 128, 68, 73, 69, 83, 73, 83,
+ 128, 68, 73, 69, 83, 73, 211, 68, 73, 69, 80, 128, 68, 73, 197, 68, 73,
+ 66, 128, 68, 73, 65, 84, 79, 78, 79, 206, 68, 73, 65, 84, 79, 78, 73, 75,
+ 201, 68, 73, 65, 83, 84, 79, 76, 201, 68, 73, 65, 77, 79, 78, 68, 83,
+ 128, 68, 73, 65, 77, 79, 78, 68, 128, 68, 73, 65, 77, 79, 78, 196, 68,
+ 73, 65, 77, 69, 84, 69, 210, 68, 73, 65, 76, 89, 84, 73, 75, 65, 128, 68,
+ 73, 65, 76, 89, 84, 73, 75, 193, 68, 73, 65, 76, 69, 67, 84, 45, 208, 68,
+ 73, 65, 71, 79, 78, 65, 76, 128, 68, 73, 65, 71, 79, 78, 65, 204, 68, 73,
+ 65, 69, 82, 69, 83, 73, 90, 69, 196, 68, 73, 65, 69, 82, 69, 83, 73, 83,
+ 128, 68, 73, 65, 69, 82, 69, 83, 73, 211, 68, 72, 79, 85, 128, 68, 72,
+ 79, 79, 128, 68, 72, 79, 128, 68, 72, 73, 128, 68, 72, 72, 85, 128, 68,
+ 72, 72, 79, 79, 128, 68, 72, 72, 79, 128, 68, 72, 72, 73, 128, 68, 72,
+ 72, 69, 69, 128, 68, 72, 72, 69, 128, 68, 72, 72, 65, 128, 68, 72, 69,
+ 69, 128, 68, 72, 65, 82, 77, 65, 128, 68, 72, 65, 76, 69, 84, 72, 128,
+ 68, 72, 65, 76, 65, 84, 72, 128, 68, 72, 65, 76, 128, 68, 72, 65, 68, 72,
+ 69, 128, 68, 72, 65, 65, 76, 85, 128, 68, 72, 65, 128, 68, 69, 90, 200,
+ 68, 69, 89, 84, 69, 82, 79, 213, 68, 69, 89, 84, 69, 82, 79, 211, 68, 69,
+ 88, 73, 65, 128, 68, 69, 86, 73, 67, 197, 68, 69, 86, 69, 76, 79, 80, 77,
+ 69, 78, 84, 128, 68, 69, 85, 78, 71, 128, 68, 69, 83, 203, 68, 69, 83,
+ 73, 71, 78, 128, 68, 69, 83, 73, 128, 68, 69, 83, 67, 82, 73, 80, 84, 73,
+ 79, 206, 68, 69, 83, 67, 69, 78, 68, 73, 78, 199, 68, 69, 83, 67, 69, 78,
+ 68, 69, 82, 128, 68, 69, 82, 69, 84, 45, 72, 73, 68, 69, 84, 128, 68, 69,
+ 82, 69, 84, 128, 68, 69, 80, 65, 82, 84, 85, 82, 69, 128, 68, 69, 80, 65,
+ 82, 84, 77, 69, 78, 212, 68, 69, 80, 65, 82, 84, 73, 78, 199, 68, 69, 78,
+ 84, 73, 83, 84, 82, 217, 68, 69, 78, 84, 65, 204, 68, 69, 78, 79, 77, 73,
+ 78, 65, 84, 79, 82, 128, 68, 69, 78, 79, 77, 73, 78, 65, 84, 79, 210, 68,
+ 69, 78, 78, 69, 78, 128, 68, 69, 78, 71, 128, 68, 69, 78, 197, 68, 69,
+ 78, 65, 82, 73, 85, 211, 68, 69, 76, 84, 65, 128, 68, 69, 76, 84, 193,
+ 68, 69, 76, 84, 128, 68, 69, 76, 80, 72, 73, 195, 68, 69, 76, 73, 86, 69,
+ 82, 217, 68, 69, 76, 73, 86, 69, 82, 65, 78, 67, 69, 128, 68, 69, 76, 73,
+ 77, 73, 84, 69, 82, 128, 68, 69, 76, 73, 77, 73, 84, 69, 210, 68, 69, 76,
+ 73, 67, 73, 79, 85, 211, 68, 69, 76, 69, 84, 69, 128, 68, 69, 76, 69, 84,
+ 197, 68, 69, 75, 65, 128, 68, 69, 75, 128, 68, 69, 73, 128, 68, 69, 72,
+ 73, 128, 68, 69, 71, 82, 69, 197, 68, 69, 70, 73, 78, 73, 84, 73, 79, 78,
+ 128, 68, 69, 70, 69, 67, 84, 73, 86, 69, 78, 69, 83, 211, 68, 69, 69, 82,
+ 128, 68, 69, 69, 80, 76, 89, 128, 68, 69, 69, 76, 128, 68, 69, 67, 82,
+ 69, 83, 67, 69, 78, 68, 79, 128, 68, 69, 67, 82, 69, 65, 83, 69, 128, 68,
+ 69, 67, 79, 82, 65, 84, 73, 86, 197, 68, 69, 67, 79, 82, 65, 84, 73, 79,
+ 78, 128, 68, 69, 67, 73, 83, 73, 86, 69, 78, 69, 83, 83, 128, 68, 69, 67,
+ 73, 77, 65, 204, 68, 69, 67, 73, 68, 85, 79, 85, 211, 68, 69, 67, 69, 77,
+ 66, 69, 82, 128, 68, 69, 67, 65, 89, 69, 68, 128, 68, 69, 66, 73, 212,
+ 68, 69, 65, 84, 72, 128, 68, 69, 65, 68, 128, 68, 68, 87, 65, 128, 68,
+ 68, 85, 88, 128, 68, 68, 85, 84, 128, 68, 68, 85, 82, 88, 128, 68, 68,
+ 85, 82, 128, 68, 68, 85, 80, 128, 68, 68, 85, 79, 88, 128, 68, 68, 85,
+ 79, 80, 128, 68, 68, 85, 79, 128, 68, 68, 85, 128, 68, 68, 79, 88, 128,
+ 68, 68, 79, 84, 128, 68, 68, 79, 80, 128, 68, 68, 79, 65, 128, 68, 68,
+ 73, 88, 128, 68, 68, 73, 84, 128, 68, 68, 73, 80, 128, 68, 68, 73, 69,
+ 88, 128, 68, 68, 73, 69, 80, 128, 68, 68, 73, 69, 128, 68, 68, 73, 128,
+ 68, 68, 72, 85, 128, 68, 68, 72, 79, 128, 68, 68, 72, 73, 128, 68, 68,
+ 72, 69, 69, 128, 68, 68, 72, 69, 128, 68, 68, 72, 65, 65, 128, 68, 68,
+ 72, 65, 128, 68, 68, 69, 88, 128, 68, 68, 69, 80, 128, 68, 68, 69, 69,
+ 128, 68, 68, 69, 128, 68, 68, 68, 72, 65, 128, 68, 68, 68, 65, 128, 68,
+ 68, 65, 89, 65, 78, 78, 65, 128, 68, 68, 65, 88, 128, 68, 68, 65, 84,
+ 128, 68, 68, 65, 80, 128, 68, 68, 65, 76, 128, 68, 68, 65, 204, 68, 68,
+ 65, 72, 65, 76, 128, 68, 68, 65, 72, 65, 204, 68, 68, 65, 65, 128, 68,
+ 194, 68, 65, 89, 45, 78, 73, 71, 72, 84, 128, 68, 65, 217, 68, 65, 86,
+ 73, 89, 65, 78, 73, 128, 68, 65, 86, 73, 68, 128, 68, 65, 84, 197, 68,
+ 65, 83, 73, 65, 128, 68, 65, 83, 72, 69, 196, 68, 65, 83, 72, 128, 68,
+ 65, 83, 200, 68, 65, 83, 69, 73, 65, 128, 68, 65, 82, 84, 128, 68, 65,
+ 82, 75, 69, 78, 73, 78, 71, 128, 68, 65, 82, 75, 69, 78, 73, 78, 199, 68,
+ 65, 82, 203, 68, 65, 82, 71, 65, 128, 68, 65, 82, 65, 52, 128, 68, 65,
+ 82, 65, 51, 128, 68, 65, 82, 128, 68, 65, 80, 45, 80, 82, 65, 205, 68,
+ 65, 80, 45, 80, 73, 201, 68, 65, 80, 45, 77, 85, 79, 217, 68, 65, 80, 45,
+ 66, 85, 79, 206, 68, 65, 80, 45, 66, 69, 201, 68, 65, 208, 68, 65, 78,
+ 84, 65, 74, 193, 68, 65, 78, 71, 79, 128, 68, 65, 78, 71, 128, 68, 65,
+ 78, 199, 68, 65, 78, 68, 65, 128, 68, 65, 78, 67, 69, 82, 128, 68, 65,
+ 77, 80, 128, 68, 65, 77, 208, 68, 65, 77, 77, 65, 84, 65, 78, 128, 68,
+ 65, 77, 77, 65, 84, 65, 206, 68, 65, 77, 77, 65, 128, 68, 65, 77, 77,
+ 193, 68, 65, 77, 65, 82, 85, 128, 68, 65, 76, 69, 84, 72, 128, 68, 65,
+ 76, 69, 84, 128, 68, 65, 76, 69, 212, 68, 65, 76, 68, 65, 128, 68, 65,
+ 76, 65, 84, 72, 128, 68, 65, 76, 65, 84, 200, 68, 65, 76, 65, 84, 128,
+ 68, 65, 73, 82, 128, 68, 65, 73, 78, 71, 128, 68, 65, 72, 89, 65, 65, 85,
+ 83, 72, 45, 50, 128, 68, 65, 72, 89, 65, 65, 85, 83, 72, 128, 68, 65, 71,
+ 83, 128, 68, 65, 71, 71, 69, 82, 128, 68, 65, 71, 69, 83, 72, 128, 68,
+ 65, 71, 69, 83, 200, 68, 65, 71, 66, 65, 83, 73, 78, 78, 65, 128, 68, 65,
+ 71, 65, 218, 68, 65, 71, 65, 76, 71, 65, 128, 68, 65, 199, 68, 65, 69,
+ 78, 71, 128, 68, 65, 69, 199, 68, 65, 68, 128, 68, 65, 196, 68, 65, 65,
+ 83, 85, 128, 68, 65, 65, 68, 72, 85, 128, 68, 48, 54, 55, 72, 128, 68,
+ 48, 54, 55, 71, 128, 68, 48, 54, 55, 70, 128, 68, 48, 54, 55, 69, 128,
+ 68, 48, 54, 55, 68, 128, 68, 48, 54, 55, 67, 128, 68, 48, 54, 55, 66,
+ 128, 68, 48, 54, 55, 65, 128, 68, 48, 54, 55, 128, 68, 48, 54, 54, 128,
+ 68, 48, 54, 53, 128, 68, 48, 54, 52, 128, 68, 48, 54, 51, 128, 68, 48,
+ 54, 50, 128, 68, 48, 54, 49, 128, 68, 48, 54, 48, 128, 68, 48, 53, 57,
+ 128, 68, 48, 53, 56, 128, 68, 48, 53, 55, 128, 68, 48, 53, 54, 128, 68,
+ 48, 53, 53, 128, 68, 48, 53, 52, 65, 128, 68, 48, 53, 52, 128, 68, 48,
+ 53, 51, 128, 68, 48, 53, 50, 65, 128, 68, 48, 53, 50, 128, 68, 48, 53,
+ 49, 128, 68, 48, 53, 48, 73, 128, 68, 48, 53, 48, 72, 128, 68, 48, 53,
+ 48, 71, 128, 68, 48, 53, 48, 70, 128, 68, 48, 53, 48, 69, 128, 68, 48,
+ 53, 48, 68, 128, 68, 48, 53, 48, 67, 128, 68, 48, 53, 48, 66, 128, 68,
+ 48, 53, 48, 65, 128, 68, 48, 53, 48, 128, 68, 48, 52, 57, 128, 68, 48,
+ 52, 56, 65, 128, 68, 48, 52, 56, 128, 68, 48, 52, 55, 128, 68, 48, 52,
+ 54, 65, 128, 68, 48, 52, 54, 128, 68, 48, 52, 53, 128, 68, 48, 52, 52,
+ 128, 68, 48, 52, 51, 128, 68, 48, 52, 50, 128, 68, 48, 52, 49, 128, 68,
+ 48, 52, 48, 128, 68, 48, 51, 57, 128, 68, 48, 51, 56, 128, 68, 48, 51,
+ 55, 128, 68, 48, 51, 54, 128, 68, 48, 51, 53, 128, 68, 48, 51, 52, 65,
+ 128, 68, 48, 51, 52, 128, 68, 48, 51, 51, 128, 68, 48, 51, 50, 128, 68,
+ 48, 51, 49, 65, 128, 68, 48, 51, 49, 128, 68, 48, 51, 48, 128, 68, 48,
+ 50, 57, 128, 68, 48, 50, 56, 128, 68, 48, 50, 55, 65, 128, 68, 48, 50,
+ 55, 128, 68, 48, 50, 54, 128, 68, 48, 50, 53, 128, 68, 48, 50, 52, 128,
+ 68, 48, 50, 51, 128, 68, 48, 50, 50, 128, 68, 48, 50, 49, 128, 68, 48,
+ 50, 48, 128, 68, 48, 49, 57, 128, 68, 48, 49, 56, 128, 68, 48, 49, 55,
+ 128, 68, 48, 49, 54, 128, 68, 48, 49, 53, 128, 68, 48, 49, 52, 128, 68,
+ 48, 49, 51, 128, 68, 48, 49, 50, 128, 68, 48, 49, 49, 128, 68, 48, 49,
+ 48, 128, 68, 48, 48, 57, 128, 68, 48, 48, 56, 65, 128, 68, 48, 48, 56,
+ 128, 68, 48, 48, 55, 128, 68, 48, 48, 54, 128, 68, 48, 48, 53, 128, 68,
+ 48, 48, 52, 128, 68, 48, 48, 51, 128, 68, 48, 48, 50, 128, 68, 48, 48,
+ 49, 128, 67, 89, 88, 128, 67, 89, 84, 128, 67, 89, 82, 88, 128, 67, 89,
+ 82, 69, 78, 65, 73, 195, 67, 89, 82, 128, 67, 89, 80, 82, 73, 79, 212,
+ 67, 89, 80, 69, 82, 85, 83, 128, 67, 89, 80, 128, 67, 89, 76, 73, 78, 68,
+ 82, 73, 67, 73, 84, 89, 128, 67, 89, 67, 76, 79, 78, 69, 128, 67, 89, 65,
+ 128, 67, 89, 128, 67, 87, 79, 79, 128, 67, 87, 79, 128, 67, 87, 73, 73,
+ 128, 67, 87, 73, 128, 67, 87, 69, 79, 82, 84, 72, 128, 67, 87, 69, 128,
+ 67, 87, 65, 65, 128, 67, 85, 88, 128, 67, 85, 212, 67, 85, 83, 84, 79,
+ 77, 83, 128, 67, 85, 83, 84, 79, 77, 69, 210, 67, 85, 83, 84, 65, 82, 68,
+ 128, 67, 85, 82, 88, 128, 67, 85, 82, 86, 73, 78, 199, 67, 85, 82, 86,
+ 69, 196, 67, 85, 82, 86, 69, 128, 67, 85, 82, 86, 197, 67, 85, 82, 82,
+ 217, 67, 85, 82, 82, 69, 78, 84, 128, 67, 85, 82, 82, 69, 78, 212, 67,
+ 85, 82, 76, 217, 67, 85, 82, 76, 128, 67, 85, 82, 128, 67, 85, 80, 128,
+ 67, 85, 79, 88, 128, 67, 85, 79, 80, 128, 67, 85, 79, 128, 67, 85, 205,
+ 67, 85, 66, 69, 68, 128, 67, 85, 66, 197, 67, 85, 65, 84, 82, 73, 76, 76,
+ 79, 128, 67, 85, 65, 84, 82, 73, 76, 76, 207, 67, 85, 128, 67, 82, 89,
+ 83, 84, 65, 204, 67, 82, 89, 80, 84, 79, 71, 82, 65, 77, 77, 73, 195, 67,
+ 82, 89, 73, 78, 199, 67, 82, 85, 90, 69, 73, 82, 207, 67, 82, 85, 67, 73,
+ 66, 76, 69, 45, 53, 128, 67, 82, 85, 67, 73, 66, 76, 69, 45, 52, 128, 67,
+ 82, 85, 67, 73, 66, 76, 69, 45, 51, 128, 67, 82, 85, 67, 73, 66, 76, 69,
+ 45, 50, 128, 67, 82, 85, 67, 73, 66, 76, 69, 128, 67, 82, 79, 87, 78,
+ 128, 67, 82, 79, 83, 83, 73, 78, 71, 128, 67, 82, 79, 83, 83, 73, 78,
+ 199, 67, 82, 79, 83, 83, 72, 65, 84, 67, 200, 67, 82, 79, 83, 83, 69, 68,
+ 45, 84, 65, 73, 76, 128, 67, 82, 79, 83, 83, 69, 196, 67, 82, 79, 83, 83,
+ 66, 79, 78, 69, 83, 128, 67, 82, 79, 83, 83, 128, 67, 82, 79, 83, 211,
+ 67, 82, 79, 80, 128, 67, 82, 79, 73, 88, 128, 67, 82, 79, 67, 85, 211,
+ 67, 82, 79, 67, 79, 68, 73, 76, 69, 128, 67, 82, 69, 83, 67, 69, 78, 84,
128, 67, 82, 69, 83, 67, 69, 78, 212, 67, 82, 69, 68, 73, 212, 67, 82,
- 69, 65, 84, 73, 86, 197, 67, 79, 88, 128, 67, 79, 87, 128, 67, 79, 86,
- 69, 82, 128, 67, 79, 85, 78, 84, 73, 78, 199, 67, 79, 85, 78, 84, 69, 82,
- 83, 73, 78, 75, 128, 67, 79, 85, 78, 84, 69, 82, 66, 79, 82, 69, 128, 67,
- 79, 85, 78, 67, 73, 204, 67, 79, 84, 128, 67, 79, 82, 82, 69, 83, 80, 79,
- 78, 68, 211, 67, 79, 82, 82, 69, 67, 84, 128, 67, 79, 82, 80, 83, 69,
- 128, 67, 79, 82, 80, 79, 82, 65, 84, 73, 79, 78, 128, 67, 79, 82, 79, 78,
- 73, 83, 128, 67, 79, 82, 78, 69, 82, 83, 128, 67, 79, 82, 78, 69, 82,
- 128, 67, 79, 82, 78, 69, 210, 67, 79, 80, 89, 82, 73, 71, 72, 84, 128,
- 67, 79, 80, 89, 82, 73, 71, 72, 212, 67, 79, 80, 89, 128, 67, 79, 80, 82,
- 79, 68, 85, 67, 84, 128, 67, 79, 80, 128, 67, 79, 79, 128, 67, 79, 78,
- 84, 82, 79, 204, 67, 79, 78, 84, 82, 65, 82, 73, 69, 84, 89, 128, 67, 79,
- 78, 84, 82, 65, 67, 84, 73, 79, 78, 128, 67, 79, 78, 84, 79, 85, 82, 69,
- 196, 67, 79, 78, 84, 79, 85, 210, 67, 79, 78, 84, 69, 78, 84, 73, 79, 78,
- 128, 67, 79, 78, 84, 69, 77, 80, 76, 65, 84, 73, 79, 78, 128, 67, 79, 78,
- 84, 65, 73, 78, 211, 67, 79, 78, 84, 65, 73, 78, 73, 78, 199, 67, 79, 78,
- 84, 65, 73, 206, 67, 79, 78, 84, 65, 67, 84, 128, 67, 79, 78, 83, 84, 65,
+ 69, 65, 84, 73, 86, 197, 67, 82, 69, 65, 77, 128, 67, 82, 65, 67, 75, 69,
+ 82, 128, 67, 79, 88, 128, 67, 79, 87, 128, 67, 79, 215, 67, 79, 86, 69,
+ 82, 128, 67, 79, 85, 80, 76, 197, 67, 79, 85, 78, 84, 73, 78, 199, 67,
+ 79, 85, 78, 84, 69, 82, 83, 73, 78, 75, 128, 67, 79, 85, 78, 84, 69, 82,
+ 66, 79, 82, 69, 128, 67, 79, 85, 78, 67, 73, 204, 67, 79, 84, 128, 67,
+ 79, 82, 82, 69, 83, 80, 79, 78, 68, 211, 67, 79, 82, 82, 69, 67, 84, 128,
+ 67, 79, 82, 80, 83, 69, 128, 67, 79, 82, 80, 79, 82, 65, 84, 73, 79, 78,
+ 128, 67, 79, 82, 79, 78, 73, 83, 128, 67, 79, 82, 78, 69, 82, 83, 128,
+ 67, 79, 82, 78, 69, 82, 128, 67, 79, 82, 78, 69, 210, 67, 79, 80, 89, 82,
+ 73, 71, 72, 84, 128, 67, 79, 80, 89, 82, 73, 71, 72, 212, 67, 79, 80, 89,
+ 128, 67, 79, 80, 82, 79, 68, 85, 67, 84, 128, 67, 79, 80, 80, 69, 82, 45,
+ 50, 128, 67, 79, 80, 80, 69, 82, 128, 67, 79, 80, 128, 67, 79, 79, 76,
+ 128, 67, 79, 79, 75, 73, 78, 71, 128, 67, 79, 79, 75, 73, 69, 128, 67,
+ 79, 79, 75, 69, 196, 67, 79, 79, 128, 67, 79, 78, 86, 69, 82, 71, 73, 78,
+ 199, 67, 79, 78, 86, 69, 78, 73, 69, 78, 67, 197, 67, 79, 78, 84, 82, 79,
+ 76, 128, 67, 79, 78, 84, 82, 79, 204, 67, 79, 78, 84, 82, 65, 82, 73, 69,
+ 84, 89, 128, 67, 79, 78, 84, 82, 65, 67, 84, 73, 79, 78, 128, 67, 79, 78,
+ 84, 79, 85, 82, 69, 196, 67, 79, 78, 84, 79, 85, 210, 67, 79, 78, 84, 69,
+ 78, 84, 73, 79, 78, 128, 67, 79, 78, 84, 69, 77, 80, 76, 65, 84, 73, 79,
+ 78, 128, 67, 79, 78, 84, 65, 73, 78, 211, 67, 79, 78, 84, 65, 73, 78, 73,
+ 78, 199, 67, 79, 78, 84, 65, 73, 206, 67, 79, 78, 84, 65, 67, 84, 128,
+ 67, 79, 78, 83, 84, 82, 85, 67, 84, 73, 79, 206, 67, 79, 78, 83, 84, 65,
78, 84, 128, 67, 79, 78, 83, 84, 65, 78, 212, 67, 79, 78, 83, 84, 65, 78,
67, 89, 128, 67, 79, 78, 83, 79, 78, 65, 78, 212, 67, 79, 78, 83, 69, 67,
85, 84, 73, 86, 197, 67, 79, 78, 74, 85, 78, 67, 84, 73, 79, 78, 128, 67,
79, 78, 74, 85, 71, 65, 84, 197, 67, 79, 78, 74, 79, 73, 78, 73, 78, 199,
67, 79, 78, 73, 67, 65, 204, 67, 79, 78, 71, 82, 85, 69, 78, 212, 67, 79,
- 78, 71, 82, 65, 84, 85, 76, 65, 84, 73, 79, 78, 128, 67, 79, 78, 70, 76,
- 73, 67, 84, 128, 67, 79, 78, 67, 65, 86, 69, 45, 83, 73, 68, 69, 196, 67,
+ 78, 71, 82, 65, 84, 85, 76, 65, 84, 73, 79, 78, 128, 67, 79, 78, 70, 79,
+ 85, 78, 68, 69, 196, 67, 79, 78, 70, 76, 73, 67, 84, 128, 67, 79, 78, 70,
+ 69, 84, 84, 201, 67, 79, 78, 67, 65, 86, 69, 45, 83, 73, 68, 69, 196, 67,
79, 78, 67, 65, 86, 69, 45, 80, 79, 73, 78, 84, 69, 196, 67, 79, 78, 128,
- 67, 79, 77, 80, 79, 83, 73, 84, 73, 79, 78, 128, 67, 79, 77, 80, 79, 83,
- 73, 84, 73, 79, 206, 67, 79, 77, 80, 76, 73, 65, 78, 67, 69, 128, 67, 79,
- 77, 80, 76, 69, 84, 73, 79, 78, 128, 67, 79, 77, 80, 76, 69, 84, 69, 68,
- 128, 67, 79, 77, 80, 76, 69, 77, 69, 78, 84, 128, 67, 79, 77, 80, 65, 82,
- 69, 128, 67, 79, 77, 77, 79, 206, 67, 79, 77, 77, 69, 82, 67, 73, 65,
- 204, 67, 79, 77, 77, 65, 128, 67, 79, 77, 77, 193, 67, 79, 77, 73, 78,
- 199, 67, 79, 77, 69, 84, 128, 67, 79, 77, 66, 128, 67, 79, 76, 85, 77,
- 78, 128, 67, 79, 76, 79, 82, 128, 67, 79, 76, 76, 128, 67, 79, 70, 70,
- 73, 78, 128, 67, 79, 69, 78, 71, 128, 67, 79, 68, 65, 128, 67, 79, 65,
- 128, 67, 79, 128, 67, 77, 128, 67, 205, 67, 76, 85, 83, 84, 69, 210, 67,
- 76, 85, 66, 45, 83, 80, 79, 75, 69, 196, 67, 76, 85, 66, 128, 67, 76, 85,
- 194, 67, 76, 79, 85, 68, 128, 67, 76, 79, 84, 72, 69, 83, 128, 67, 76,
- 79, 84, 72, 128, 67, 76, 79, 83, 69, 78, 69, 83, 83, 128, 67, 76, 79, 83,
- 69, 68, 128, 67, 76, 79, 83, 69, 196, 67, 76, 79, 83, 197, 67, 76, 79,
- 67, 75, 87, 73, 83, 197, 67, 76, 73, 86, 73, 83, 128, 67, 76, 73, 78, 71,
- 73, 78, 199, 67, 76, 73, 77, 65, 67, 85, 83, 128, 67, 76, 73, 70, 70,
- 128, 67, 76, 73, 67, 75, 128, 67, 76, 69, 70, 45, 50, 128, 67, 76, 69,
- 70, 45, 49, 128, 67, 76, 69, 70, 128, 67, 76, 69, 198, 67, 76, 69, 65,
- 210, 67, 76, 65, 87, 128, 67, 76, 65, 78, 128, 67, 73, 88, 128, 67, 73,
- 86, 73, 76, 73, 65, 78, 128, 67, 73, 84, 128, 67, 73, 82, 67, 85, 77, 70,
- 76, 69, 88, 128, 67, 73, 82, 67, 85, 77, 70, 76, 69, 216, 67, 73, 82, 67,
- 85, 76, 65, 84, 73, 79, 206, 67, 73, 82, 67, 76, 69, 83, 128, 67, 73, 82,
- 67, 76, 69, 128, 67, 73, 80, 128, 67, 73, 73, 128, 67, 73, 69, 88, 128,
- 67, 73, 69, 85, 67, 45, 73, 69, 85, 78, 71, 128, 67, 73, 69, 85, 195, 67,
- 73, 69, 84, 128, 67, 73, 69, 80, 128, 67, 73, 69, 128, 67, 73, 128, 67,
- 72, 89, 88, 128, 67, 72, 89, 84, 128, 67, 72, 89, 82, 88, 128, 67, 72,
- 89, 82, 128, 67, 72, 89, 80, 128, 67, 72, 85, 88, 128, 67, 72, 85, 82,
- 88, 128, 67, 72, 85, 82, 67, 72, 128, 67, 72, 85, 82, 128, 67, 72, 85,
- 80, 128, 67, 72, 85, 79, 88, 128, 67, 72, 85, 79, 84, 128, 67, 72, 85,
- 79, 80, 128, 67, 72, 85, 79, 128, 67, 72, 85, 76, 65, 128, 67, 72, 85,
- 128, 67, 72, 82, 89, 83, 65, 78, 84, 72, 69, 77, 85, 77, 128, 67, 72, 82,
- 79, 78, 79, 85, 128, 67, 72, 82, 79, 78, 79, 78, 128, 67, 72, 82, 79, 77,
- 193, 67, 72, 82, 79, 193, 67, 72, 82, 73, 86, 73, 128, 67, 72, 79, 88,
- 128, 67, 72, 79, 84, 128, 67, 72, 79, 82, 69, 86, 77, 193, 67, 72, 79,
- 80, 128, 67, 72, 79, 75, 69, 128, 67, 72, 79, 69, 128, 67, 72, 79, 65,
- 128, 67, 72, 79, 128, 67, 72, 207, 67, 72, 73, 84, 85, 69, 85, 77, 83,
- 83, 65, 78, 71, 83, 73, 79, 83, 128, 67, 72, 73, 84, 85, 69, 85, 77, 83,
- 83, 65, 78, 71, 67, 73, 69, 85, 67, 128, 67, 72, 73, 84, 85, 69, 85, 77,
- 83, 73, 79, 83, 128, 67, 72, 73, 84, 85, 69, 85, 77, 67, 73, 69, 85, 67,
- 128, 67, 72, 73, 84, 85, 69, 85, 77, 67, 72, 73, 69, 85, 67, 72, 128, 67,
- 72, 73, 82, 79, 78, 128, 67, 72, 73, 82, 69, 84, 128, 67, 72, 73, 78, 71,
- 128, 67, 72, 73, 78, 69, 83, 197, 67, 72, 73, 78, 128, 67, 72, 73, 76,
- 76, 213, 67, 72, 73, 76, 68, 128, 67, 72, 73, 75, 201, 67, 72, 73, 69,
- 85, 67, 72, 45, 75, 72, 73, 69, 85, 75, 72, 128, 67, 72, 73, 69, 85, 67,
- 72, 45, 72, 73, 69, 85, 72, 128, 67, 72, 73, 69, 85, 67, 200, 67, 72, 73,
- 128, 67, 72, 201, 67, 72, 72, 65, 128, 67, 72, 69, 88, 128, 67, 72, 69,
- 86, 82, 79, 206, 67, 72, 69, 84, 128, 67, 72, 69, 83, 211, 67, 72, 69,
- 80, 128, 67, 72, 69, 206, 67, 72, 69, 69, 128, 67, 72, 69, 67, 75, 128,
- 67, 72, 69, 67, 203, 67, 72, 197, 67, 72, 65, 88, 128, 67, 72, 65, 86,
- 73, 89, 65, 78, 73, 128, 67, 72, 65, 84, 84, 65, 87, 65, 128, 67, 72, 65,
- 84, 128, 67, 72, 65, 82, 73, 79, 84, 128, 67, 72, 65, 82, 73, 79, 212,
- 67, 72, 65, 82, 65, 67, 84, 69, 82, 83, 128, 67, 72, 65, 82, 65, 67, 84,
- 69, 82, 128, 67, 72, 65, 82, 128, 67, 72, 65, 80, 128, 67, 72, 65, 78,
- 71, 69, 128, 67, 72, 65, 78, 71, 128, 67, 72, 65, 78, 128, 67, 72, 65,
- 77, 75, 79, 128, 67, 72, 65, 77, 73, 76, 79, 78, 128, 67, 72, 65, 77, 73,
- 76, 73, 128, 67, 72, 65, 73, 82, 128, 67, 72, 65, 68, 65, 128, 67, 72,
- 65, 196, 67, 72, 65, 65, 128, 67, 69, 88, 128, 67, 69, 82, 69, 83, 128,
- 67, 69, 82, 45, 87, 65, 128, 67, 69, 80, 128, 67, 69, 79, 78, 71, 67, 72,
- 73, 69, 85, 77, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 67, 69, 79, 78,
- 71, 67, 72, 73, 69, 85, 77, 83, 83, 65, 78, 71, 67, 73, 69, 85, 67, 128,
- 67, 69, 79, 78, 71, 67, 72, 73, 69, 85, 77, 83, 73, 79, 83, 128, 67, 69,
- 79, 78, 71, 67, 72, 73, 69, 85, 77, 67, 73, 69, 85, 67, 128, 67, 69, 79,
- 78, 71, 67, 72, 73, 69, 85, 77, 67, 72, 73, 69, 85, 67, 72, 128, 67, 69,
- 78, 84, 85, 82, 73, 65, 204, 67, 69, 78, 84, 82, 69, 76, 73, 78, 197, 67,
- 69, 78, 84, 82, 69, 196, 67, 69, 78, 84, 82, 69, 128, 67, 69, 78, 84, 82,
- 197, 67, 69, 78, 128, 67, 69, 76, 83, 73, 85, 83, 128, 67, 69, 73, 82,
- 84, 128, 67, 69, 73, 76, 73, 78, 71, 128, 67, 69, 69, 128, 67, 69, 68,
- 73, 76, 76, 65, 128, 67, 69, 68, 73, 76, 76, 193, 67, 69, 68, 201, 67,
- 69, 67, 69, 75, 128, 67, 69, 65, 76, 67, 128, 67, 67, 85, 128, 67, 67,
- 79, 128, 67, 67, 73, 128, 67, 67, 72, 85, 128, 67, 67, 72, 79, 128, 67,
- 67, 72, 73, 128, 67, 67, 72, 69, 69, 128, 67, 67, 72, 69, 128, 67, 67,
- 72, 65, 65, 128, 67, 67, 72, 65, 128, 67, 67, 69, 69, 128, 67, 67, 69,
- 128, 67, 67, 65, 65, 128, 67, 67, 65, 128, 67, 65, 89, 78, 128, 67, 65,
- 89, 65, 78, 78, 65, 128, 67, 65, 88, 128, 67, 65, 86, 69, 128, 67, 65,
- 85, 84, 73, 79, 206, 67, 65, 85, 76, 68, 82, 79, 78, 128, 67, 65, 85, 68,
- 65, 128, 67, 65, 84, 65, 87, 65, 128, 67, 65, 84, 128, 67, 65, 82, 89,
- 83, 84, 73, 65, 206, 67, 65, 82, 84, 128, 67, 65, 82, 82, 73, 65, 71,
- 197, 67, 65, 82, 80, 69, 78, 84, 82, 217, 67, 65, 82, 79, 78, 128, 67,
+ 67, 79, 77, 80, 85, 84, 69, 82, 128, 67, 79, 77, 80, 79, 83, 73, 84, 73,
+ 79, 78, 128, 67, 79, 77, 80, 79, 83, 73, 84, 73, 79, 206, 67, 79, 77, 80,
+ 76, 73, 65, 78, 67, 69, 128, 67, 79, 77, 80, 76, 69, 84, 73, 79, 78, 128,
+ 67, 79, 77, 80, 76, 69, 84, 69, 68, 128, 67, 79, 77, 80, 76, 69, 77, 69,
+ 78, 84, 128, 67, 79, 77, 80, 65, 82, 69, 128, 67, 79, 77, 77, 79, 206,
+ 67, 79, 77, 77, 69, 82, 67, 73, 65, 204, 67, 79, 77, 77, 65, 128, 67, 79,
+ 77, 77, 193, 67, 79, 77, 69, 84, 128, 67, 79, 77, 66, 128, 67, 79, 76,
+ 85, 77, 78, 128, 67, 79, 76, 79, 82, 128, 67, 79, 76, 76, 73, 83, 73, 79,
+ 206, 67, 79, 76, 76, 128, 67, 79, 76, 196, 67, 79, 70, 70, 73, 78, 128,
+ 67, 79, 69, 78, 71, 128, 67, 79, 68, 65, 128, 67, 79, 67, 75, 84, 65, 73,
+ 204, 67, 79, 65, 83, 84, 69, 82, 128, 67, 79, 65, 128, 67, 79, 128, 67,
+ 77, 128, 67, 205, 67, 76, 85, 83, 84, 69, 210, 67, 76, 85, 66, 83, 128,
+ 67, 76, 85, 66, 45, 83, 80, 79, 75, 69, 196, 67, 76, 85, 66, 128, 67, 76,
+ 85, 194, 67, 76, 79, 86, 69, 82, 128, 67, 76, 79, 85, 68, 128, 67, 76,
+ 79, 85, 196, 67, 76, 79, 84, 72, 69, 83, 128, 67, 76, 79, 84, 72, 128,
+ 67, 76, 79, 83, 69, 84, 128, 67, 76, 79, 83, 69, 78, 69, 83, 83, 128, 67,
+ 76, 79, 83, 69, 68, 128, 67, 76, 79, 83, 197, 67, 76, 79, 67, 75, 87, 73,
+ 83, 197, 67, 76, 79, 67, 203, 67, 76, 73, 86, 73, 83, 128, 67, 76, 73,
+ 80, 66, 79, 65, 82, 68, 128, 67, 76, 73, 78, 75, 73, 78, 199, 67, 76, 73,
+ 78, 71, 73, 78, 199, 67, 76, 73, 77, 65, 67, 85, 83, 128, 67, 76, 73, 70,
+ 70, 128, 67, 76, 73, 67, 75, 128, 67, 76, 69, 70, 45, 50, 128, 67, 76,
+ 69, 70, 45, 49, 128, 67, 76, 69, 70, 128, 67, 76, 69, 198, 67, 76, 69,
+ 65, 86, 69, 82, 128, 67, 76, 69, 65, 210, 67, 76, 65, 87, 128, 67, 76,
+ 65, 80, 80, 73, 78, 199, 67, 76, 65, 80, 80, 69, 210, 67, 76, 65, 78,
+ 128, 67, 76, 65, 73, 77, 128, 67, 76, 128, 67, 73, 88, 128, 67, 73, 86,
+ 73, 76, 73, 65, 78, 128, 67, 73, 84, 89, 83, 67, 65, 80, 197, 67, 73, 84,
+ 128, 67, 73, 82, 67, 85, 211, 67, 73, 82, 67, 85, 77, 70, 76, 69, 88,
+ 128, 67, 73, 82, 67, 85, 77, 70, 76, 69, 216, 67, 73, 82, 67, 85, 76, 65,
+ 84, 73, 79, 206, 67, 73, 82, 67, 76, 69, 83, 128, 67, 73, 82, 67, 76, 69,
+ 128, 67, 73, 80, 128, 67, 73, 78, 78, 65, 66, 65, 82, 128, 67, 73, 78,
+ 69, 77, 65, 128, 67, 73, 73, 128, 67, 73, 69, 88, 128, 67, 73, 69, 85,
+ 67, 45, 83, 83, 65, 78, 71, 80, 73, 69, 85, 80, 128, 67, 73, 69, 85, 67,
+ 45, 80, 73, 69, 85, 80, 128, 67, 73, 69, 85, 67, 45, 73, 69, 85, 78, 71,
+ 128, 67, 73, 69, 85, 195, 67, 73, 69, 84, 128, 67, 73, 69, 80, 128, 67,
+ 73, 69, 128, 67, 73, 128, 67, 72, 89, 88, 128, 67, 72, 89, 84, 128, 67,
+ 72, 89, 82, 88, 128, 67, 72, 89, 82, 128, 67, 72, 89, 80, 128, 67, 72,
+ 85, 88, 128, 67, 72, 85, 82, 88, 128, 67, 72, 85, 82, 67, 72, 128, 67,
+ 72, 85, 82, 128, 67, 72, 85, 80, 128, 67, 72, 85, 79, 88, 128, 67, 72,
+ 85, 79, 84, 128, 67, 72, 85, 79, 80, 128, 67, 72, 85, 79, 128, 67, 72,
+ 85, 76, 65, 128, 67, 72, 85, 128, 67, 72, 82, 89, 83, 65, 78, 84, 72, 69,
+ 77, 85, 77, 128, 67, 72, 82, 79, 78, 79, 85, 128, 67, 72, 82, 79, 78, 79,
+ 78, 128, 67, 72, 82, 79, 77, 193, 67, 72, 82, 79, 193, 67, 72, 82, 73,
+ 86, 73, 128, 67, 72, 82, 73, 83, 84, 77, 65, 83, 128, 67, 72, 82, 73, 83,
+ 84, 77, 65, 211, 67, 72, 79, 88, 128, 67, 72, 79, 84, 128, 67, 72, 79,
+ 82, 69, 86, 77, 193, 67, 72, 79, 80, 128, 67, 72, 79, 75, 69, 128, 67,
+ 72, 79, 69, 128, 67, 72, 79, 67, 79, 76, 65, 84, 197, 67, 72, 79, 65,
+ 128, 67, 72, 207, 67, 72, 73, 84, 85, 69, 85, 77, 83, 83, 65, 78, 71, 83,
+ 73, 79, 83, 128, 67, 72, 73, 84, 85, 69, 85, 77, 83, 83, 65, 78, 71, 67,
+ 73, 69, 85, 67, 128, 67, 72, 73, 84, 85, 69, 85, 77, 83, 73, 79, 83, 128,
+ 67, 72, 73, 84, 85, 69, 85, 77, 67, 73, 69, 85, 67, 128, 67, 72, 73, 84,
+ 85, 69, 85, 77, 67, 72, 73, 69, 85, 67, 72, 128, 67, 72, 73, 82, 79, 78,
+ 128, 67, 72, 73, 82, 69, 84, 128, 67, 72, 73, 78, 71, 128, 67, 72, 73,
+ 78, 69, 83, 197, 67, 72, 73, 78, 128, 67, 72, 73, 77, 69, 128, 67, 72,
+ 73, 76, 76, 213, 67, 72, 73, 76, 68, 82, 69, 206, 67, 72, 73, 76, 68,
+ 128, 67, 72, 73, 76, 128, 67, 72, 73, 75, 201, 67, 72, 73, 69, 85, 67,
+ 72, 45, 75, 72, 73, 69, 85, 75, 72, 128, 67, 72, 73, 69, 85, 67, 72, 45,
+ 72, 73, 69, 85, 72, 128, 67, 72, 73, 69, 85, 67, 200, 67, 72, 73, 67, 75,
+ 69, 78, 128, 67, 72, 73, 67, 75, 128, 67, 72, 73, 128, 67, 72, 201, 67,
+ 72, 72, 65, 128, 67, 72, 69, 88, 128, 67, 72, 69, 86, 82, 79, 206, 67,
+ 72, 69, 84, 128, 67, 72, 69, 83, 84, 78, 85, 84, 128, 67, 72, 69, 83,
+ 211, 67, 72, 69, 82, 82, 217, 67, 72, 69, 82, 82, 73, 69, 83, 128, 67,
+ 72, 69, 81, 85, 69, 82, 69, 196, 67, 72, 69, 80, 128, 67, 72, 69, 206,
+ 67, 72, 69, 73, 78, 65, 80, 128, 67, 72, 69, 73, 75, 72, 69, 73, 128, 67,
+ 72, 69, 69, 82, 73, 78, 199, 67, 72, 69, 69, 128, 67, 72, 69, 67, 75,
+ 128, 67, 72, 69, 67, 203, 67, 72, 197, 67, 72, 65, 88, 128, 67, 72, 65,
+ 86, 73, 89, 65, 78, 73, 128, 67, 72, 65, 84, 84, 65, 87, 65, 128, 67, 72,
+ 65, 84, 128, 67, 72, 65, 82, 84, 128, 67, 72, 65, 82, 212, 67, 72, 65,
+ 82, 73, 79, 84, 128, 67, 72, 65, 82, 73, 79, 212, 67, 72, 65, 82, 65, 67,
+ 84, 69, 82, 83, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 128, 67, 72, 65,
+ 82, 128, 67, 72, 65, 80, 128, 67, 72, 65, 78, 71, 128, 67, 72, 65, 78,
+ 128, 67, 72, 65, 77, 75, 79, 128, 67, 72, 65, 77, 73, 76, 79, 78, 128,
+ 67, 72, 65, 77, 73, 76, 73, 128, 67, 72, 65, 73, 82, 128, 67, 72, 65, 73,
+ 78, 83, 128, 67, 72, 65, 68, 65, 128, 67, 72, 65, 196, 67, 72, 65, 65,
+ 128, 67, 69, 88, 128, 67, 69, 82, 69, 83, 128, 67, 69, 82, 69, 77, 79,
+ 78, 89, 128, 67, 69, 82, 69, 75, 128, 67, 69, 82, 45, 87, 65, 128, 67,
+ 69, 80, 128, 67, 69, 79, 78, 71, 67, 72, 73, 69, 85, 77, 83, 83, 65, 78,
+ 71, 83, 73, 79, 83, 128, 67, 69, 79, 78, 71, 67, 72, 73, 69, 85, 77, 83,
+ 83, 65, 78, 71, 67, 73, 69, 85, 67, 128, 67, 69, 79, 78, 71, 67, 72, 73,
+ 69, 85, 77, 83, 73, 79, 83, 128, 67, 69, 79, 78, 71, 67, 72, 73, 69, 85,
+ 77, 67, 73, 69, 85, 67, 128, 67, 69, 79, 78, 71, 67, 72, 73, 69, 85, 77,
+ 67, 72, 73, 69, 85, 67, 72, 128, 67, 69, 78, 84, 85, 82, 73, 65, 204, 67,
+ 69, 78, 84, 82, 69, 76, 73, 78, 197, 67, 69, 78, 84, 82, 69, 196, 67, 69,
+ 78, 84, 82, 69, 128, 67, 69, 78, 84, 82, 197, 67, 69, 78, 128, 67, 69,
+ 76, 83, 73, 85, 83, 128, 67, 69, 76, 69, 66, 82, 65, 84, 73, 79, 78, 128,
+ 67, 69, 73, 82, 84, 128, 67, 69, 73, 76, 73, 78, 71, 128, 67, 69, 69,
+ 128, 67, 69, 68, 73, 76, 76, 65, 128, 67, 69, 68, 73, 76, 76, 193, 67,
+ 69, 68, 201, 67, 69, 67, 69, 75, 128, 67, 69, 67, 65, 75, 128, 67, 69,
+ 67, 65, 203, 67, 69, 65, 76, 67, 128, 67, 67, 85, 128, 67, 67, 79, 128,
+ 67, 67, 73, 128, 67, 67, 72, 85, 128, 67, 67, 72, 79, 128, 67, 67, 72,
+ 73, 128, 67, 67, 72, 72, 85, 128, 67, 67, 72, 72, 79, 128, 67, 67, 72,
+ 72, 73, 128, 67, 67, 72, 72, 69, 69, 128, 67, 67, 72, 72, 69, 128, 67,
+ 67, 72, 72, 65, 65, 128, 67, 67, 72, 72, 65, 128, 67, 67, 72, 69, 69,
+ 128, 67, 67, 72, 69, 128, 67, 67, 72, 65, 65, 128, 67, 67, 72, 65, 128,
+ 67, 67, 69, 69, 128, 67, 67, 69, 128, 67, 67, 65, 65, 128, 67, 67, 65,
+ 128, 67, 65, 89, 78, 128, 67, 65, 89, 65, 78, 78, 65, 128, 67, 65, 88,
+ 128, 67, 65, 86, 69, 128, 67, 65, 85, 84, 73, 79, 206, 67, 65, 85, 76,
+ 68, 82, 79, 78, 128, 67, 65, 85, 68, 65, 128, 67, 65, 84, 65, 87, 65,
+ 128, 67, 65, 84, 128, 67, 65, 212, 67, 65, 83, 84, 76, 69, 128, 67, 65,
+ 82, 89, 83, 84, 73, 65, 206, 67, 65, 82, 84, 128, 67, 65, 82, 211, 67,
+ 65, 82, 82, 73, 65, 71, 197, 67, 65, 82, 80, 69, 78, 84, 82, 217, 67, 65,
+ 82, 208, 67, 65, 82, 79, 85, 83, 69, 204, 67, 65, 82, 79, 78, 128, 67,
65, 82, 79, 206, 67, 65, 82, 73, 203, 67, 65, 82, 73, 65, 206, 67, 65,
- 82, 69, 84, 128, 67, 65, 82, 69, 212, 67, 65, 82, 197, 67, 65, 80, 84,
- 73, 86, 69, 128, 67, 65, 80, 82, 73, 67, 79, 82, 78, 128, 67, 65, 80, 79,
- 128, 67, 65, 80, 73, 84, 65, 76, 128, 67, 65, 78, 84, 73, 76, 76, 65, 84,
- 73, 79, 206, 67, 65, 78, 199, 67, 65, 78, 68, 82, 65, 66, 73, 78, 68, 85,
- 128, 67, 65, 78, 68, 82, 65, 128, 67, 65, 78, 68, 82, 193, 67, 65, 78,
- 67, 69, 82, 128, 67, 65, 78, 67, 69, 76, 76, 65, 84, 73, 79, 206, 67, 65,
- 78, 67, 69, 76, 128, 67, 65, 78, 67, 69, 204, 67, 65, 78, 128, 67, 65,
- 77, 78, 85, 195, 67, 65, 76, 89, 65, 128, 67, 65, 76, 89, 193, 67, 65,
- 76, 76, 128, 67, 65, 76, 67, 128, 67, 65, 69, 83, 85, 82, 65, 128, 67,
- 65, 68, 85, 67, 69, 85, 83, 128, 67, 65, 68, 193, 67, 65, 65, 73, 128,
- 67, 193, 67, 45, 83, 73, 77, 80, 76, 73, 70, 73, 69, 196, 67, 45, 51, 57,
- 128, 67, 45, 49, 56, 128, 66, 90, 85, 78, 199, 66, 90, 72, 201, 66, 89,
- 69, 76, 79, 82, 85, 83, 83, 73, 65, 78, 45, 85, 75, 82, 65, 73, 78, 73,
- 65, 206, 66, 217, 66, 88, 71, 128, 66, 87, 73, 128, 66, 87, 69, 69, 128,
- 66, 87, 69, 128, 66, 87, 65, 128, 66, 85, 85, 77, 73, 83, 72, 128, 66,
- 85, 212, 66, 85, 83, 83, 89, 69, 82, 85, 128, 66, 85, 82, 213, 66, 85,
- 82, 50, 128, 66, 85, 210, 66, 85, 79, 88, 128, 66, 85, 79, 80, 128, 66,
- 85, 79, 128, 66, 85, 77, 80, 217, 66, 85, 76, 85, 71, 128, 66, 85, 76,
- 85, 199, 66, 85, 76, 76, 83, 69, 89, 69, 128, 66, 85, 76, 76, 211, 66,
- 85, 76, 76, 69, 84, 128, 66, 85, 76, 76, 69, 212, 66, 85, 76, 76, 128,
- 66, 85, 75, 89, 128, 66, 85, 72, 73, 196, 66, 85, 71, 73, 78, 69, 83,
- 197, 66, 85, 67, 75, 76, 69, 128, 66, 83, 84, 65, 82, 128, 66, 83, 75,
- 85, 210, 66, 83, 75, 65, 173, 66, 83, 68, 85, 211, 66, 82, 85, 83, 72,
- 128, 66, 82, 85, 83, 200, 66, 82, 79, 78, 90, 69, 128, 66, 82, 79, 75,
- 69, 206, 66, 82, 79, 65, 196, 66, 82, 73, 83, 84, 76, 69, 128, 66, 82,
- 73, 68, 71, 197, 66, 82, 69, 86, 73, 83, 128, 66, 82, 69, 86, 69, 45, 77,
- 65, 67, 82, 79, 78, 128, 66, 82, 69, 86, 197, 66, 82, 69, 65, 84, 200,
- 66, 82, 69, 65, 75, 84, 72, 82, 79, 85, 71, 72, 128, 66, 82, 68, 193, 66,
- 82, 65, 78, 67, 72, 73, 78, 199, 66, 82, 65, 78, 67, 72, 128, 66, 82, 65,
- 78, 67, 200, 66, 82, 65, 75, 67, 69, 84, 128, 66, 82, 65, 67, 75, 69,
- 212, 66, 82, 65, 67, 69, 128, 66, 81, 128, 66, 79, 87, 84, 73, 69, 128,
- 66, 79, 87, 84, 73, 197, 66, 79, 87, 128, 66, 79, 215, 66, 79, 85, 78,
- 68, 65, 82, 217, 66, 79, 84, 84, 79, 77, 45, 76, 73, 71, 72, 84, 69, 196,
- 66, 79, 84, 84, 79, 77, 128, 66, 79, 84, 84, 79, 205, 66, 79, 82, 85, 84,
- 79, 128, 66, 79, 79, 77, 69, 82, 65, 78, 71, 128, 66, 79, 78, 69, 128,
- 66, 79, 76, 212, 66, 79, 68, 89, 128, 66, 79, 65, 84, 128, 66, 79, 65,
- 82, 128, 66, 79, 65, 128, 66, 76, 85, 69, 128, 66, 76, 79, 79, 68, 128,
- 66, 76, 79, 67, 75, 128, 66, 76, 69, 78, 68, 69, 196, 66, 76, 65, 78, 75,
- 128, 66, 76, 65, 78, 203, 66, 76, 65, 68, 197, 66, 76, 65, 67, 75, 70,
- 79, 79, 212, 66, 76, 65, 67, 75, 45, 76, 69, 84, 84, 69, 210, 66, 76, 65,
- 67, 75, 45, 70, 69, 65, 84, 72, 69, 82, 69, 196, 66, 76, 65, 67, 75, 128,
- 66, 75, 65, 173, 66, 73, 84, 84, 69, 82, 128, 66, 73, 84, 73, 78, 199,
- 66, 73, 83, 77, 73, 76, 76, 65, 200, 66, 73, 83, 72, 79, 80, 128, 66, 73,
- 83, 69, 67, 84, 73, 78, 199, 66, 73, 83, 65, 72, 128, 66, 73, 82, 85,
- 128, 66, 73, 82, 71, 65, 128, 66, 73, 82, 68, 128, 66, 73, 79, 72, 65,
- 90, 65, 82, 196, 66, 73, 78, 79, 67, 85, 76, 65, 210, 66, 73, 78, 68, 73,
- 78, 199, 66, 73, 78, 68, 73, 128, 66, 73, 78, 65, 82, 217, 66, 73, 76,
- 65, 66, 73, 65, 204, 66, 73, 71, 128, 66, 73, 199, 66, 73, 69, 84, 128,
- 66, 73, 68, 69, 78, 84, 65, 204, 66, 73, 66, 76, 69, 45, 67, 82, 69, 197,
- 66, 73, 66, 128, 66, 201, 66, 72, 85, 128, 66, 72, 79, 79, 128, 66, 72,
- 79, 128, 66, 72, 73, 128, 66, 72, 69, 84, 72, 128, 66, 72, 69, 69, 128,
- 66, 72, 69, 128, 66, 72, 65, 128, 66, 69, 89, 89, 65, 76, 128, 66, 69,
- 88, 128, 66, 69, 86, 69, 82, 65, 71, 69, 128, 66, 69, 84, 87, 69, 69, 78,
- 128, 66, 69, 84, 87, 69, 69, 206, 66, 69, 84, 72, 128, 66, 69, 84, 65,
- 128, 66, 69, 84, 193, 66, 69, 84, 128, 66, 69, 212, 66, 69, 83, 73, 68,
- 197, 66, 69, 82, 75, 65, 78, 65, 206, 66, 69, 82, 66, 69, 210, 66, 69,
- 80, 128, 66, 69, 79, 82, 195, 66, 69, 78, 90, 69, 78, 197, 66, 69, 78,
- 68, 69, 128, 66, 69, 78, 68, 128, 66, 69, 206, 66, 69, 76, 84, 128, 66,
- 69, 76, 212, 66, 69, 76, 79, 215, 66, 69, 76, 76, 128, 66, 69, 76, 204,
- 66, 69, 76, 71, 84, 72, 79, 210, 66, 69, 73, 84, 72, 128, 66, 69, 72, 69,
- 72, 128, 66, 69, 72, 69, 200, 66, 69, 72, 128, 66, 69, 200, 66, 69, 71,
- 73, 78, 78, 73, 78, 71, 128, 66, 69, 71, 73, 206, 66, 69, 70, 79, 82,
- 197, 66, 69, 69, 84, 65, 128, 66, 69, 69, 72, 73, 86, 69, 128, 66, 69,
+ 82, 69, 84, 128, 67, 65, 82, 69, 212, 67, 65, 82, 197, 67, 65, 82, 68,
+ 83, 128, 67, 65, 82, 68, 128, 67, 65, 82, 196, 67, 65, 82, 128, 67, 65,
+ 210, 67, 65, 80, 85, 212, 67, 65, 80, 84, 73, 86, 69, 128, 67, 65, 80,
+ 82, 73, 67, 79, 82, 78, 128, 67, 65, 80, 79, 128, 67, 65, 80, 73, 84, 65,
+ 76, 128, 67, 65, 78, 84, 73, 76, 76, 65, 84, 73, 79, 206, 67, 65, 78,
+ 199, 67, 65, 78, 68, 89, 128, 67, 65, 78, 68, 82, 65, 66, 73, 78, 68, 85,
+ 128, 67, 65, 78, 68, 82, 65, 66, 73, 78, 68, 213, 67, 65, 78, 68, 82, 65,
+ 128, 67, 65, 78, 68, 82, 193, 67, 65, 78, 67, 69, 82, 128, 67, 65, 78,
+ 67, 69, 76, 76, 65, 84, 73, 79, 206, 67, 65, 78, 67, 69, 76, 128, 67, 65,
+ 78, 67, 69, 204, 67, 65, 78, 128, 67, 65, 77, 78, 85, 195, 67, 65, 77,
+ 69, 82, 65, 128, 67, 65, 77, 69, 76, 128, 67, 65, 76, 89, 65, 128, 67,
+ 65, 76, 89, 193, 67, 65, 76, 88, 128, 67, 65, 76, 76, 128, 67, 65, 76,
+ 69, 78, 68, 65, 82, 128, 67, 65, 76, 67, 128, 67, 65, 75, 82, 65, 128,
+ 67, 65, 75, 197, 67, 65, 69, 83, 85, 82, 65, 128, 67, 65, 68, 85, 67, 69,
+ 85, 83, 128, 67, 65, 68, 193, 67, 65, 67, 84, 85, 83, 128, 67, 65, 66,
+ 76, 69, 87, 65, 89, 128, 67, 65, 66, 66, 65, 71, 69, 45, 84, 82, 69, 69,
+ 128, 67, 65, 65, 78, 71, 128, 67, 65, 65, 73, 128, 67, 193, 67, 48, 50,
+ 52, 128, 67, 48, 50, 51, 128, 67, 48, 50, 50, 128, 67, 48, 50, 49, 128,
+ 67, 48, 50, 48, 128, 67, 48, 49, 57, 128, 67, 48, 49, 56, 128, 67, 48,
+ 49, 55, 128, 67, 48, 49, 54, 128, 67, 48, 49, 53, 128, 67, 48, 49, 52,
+ 128, 67, 48, 49, 51, 128, 67, 48, 49, 50, 128, 67, 48, 49, 49, 128, 67,
+ 48, 49, 48, 65, 128, 67, 48, 49, 48, 128, 67, 48, 48, 57, 128, 67, 48,
+ 48, 56, 128, 67, 48, 48, 55, 128, 67, 48, 48, 54, 128, 67, 48, 48, 53,
+ 128, 67, 48, 48, 52, 128, 67, 48, 48, 51, 128, 67, 48, 48, 50, 67, 128,
+ 67, 48, 48, 50, 66, 128, 67, 48, 48, 50, 65, 128, 67, 48, 48, 50, 128,
+ 67, 48, 48, 49, 128, 67, 45, 83, 73, 77, 80, 76, 73, 70, 73, 69, 196, 67,
+ 45, 51, 57, 128, 67, 45, 49, 56, 128, 66, 90, 85, 78, 199, 66, 90, 72,
+ 201, 66, 89, 69, 76, 79, 82, 85, 83, 83, 73, 65, 78, 45, 85, 75, 82, 65,
+ 73, 78, 73, 65, 206, 66, 88, 71, 128, 66, 87, 73, 128, 66, 87, 69, 69,
+ 128, 66, 87, 69, 128, 66, 87, 65, 128, 66, 85, 85, 77, 73, 83, 72, 128,
+ 66, 85, 84, 84, 79, 78, 128, 66, 85, 212, 66, 85, 83, 84, 211, 66, 85,
+ 83, 212, 66, 85, 83, 83, 89, 69, 82, 85, 128, 66, 85, 211, 66, 85, 82,
+ 213, 66, 85, 82, 50, 128, 66, 85, 210, 66, 85, 79, 88, 128, 66, 85, 79,
+ 80, 128, 66, 85, 78, 78, 217, 66, 85, 78, 71, 128, 66, 85, 77, 80, 217,
+ 66, 85, 76, 85, 71, 128, 66, 85, 76, 85, 199, 66, 85, 76, 76, 83, 69, 89,
+ 69, 128, 66, 85, 76, 76, 211, 66, 85, 76, 76, 69, 84, 128, 66, 85, 76,
+ 76, 69, 212, 66, 85, 76, 76, 128, 66, 85, 76, 66, 128, 66, 85, 75, 89,
+ 128, 66, 85, 73, 76, 68, 73, 78, 71, 83, 128, 66, 85, 73, 76, 68, 73, 78,
+ 71, 128, 66, 85, 72, 73, 196, 66, 85, 71, 73, 78, 69, 83, 197, 66, 85,
+ 71, 128, 66, 85, 70, 70, 65, 76, 79, 128, 66, 85, 67, 75, 76, 69, 128,
+ 66, 83, 84, 65, 82, 128, 66, 83, 75, 85, 210, 66, 83, 75, 65, 173, 66,
+ 83, 68, 85, 211, 66, 82, 85, 83, 72, 128, 66, 82, 85, 83, 200, 66, 82,
+ 79, 78, 90, 69, 128, 66, 82, 79, 75, 69, 206, 66, 82, 79, 65, 196, 66,
+ 82, 73, 83, 84, 76, 69, 128, 66, 82, 73, 71, 72, 84, 78, 69, 83, 211, 66,
+ 82, 73, 69, 70, 67, 65, 83, 69, 128, 66, 82, 73, 68, 71, 197, 66, 82, 73,
+ 68, 197, 66, 82, 73, 67, 75, 128, 66, 82, 69, 86, 73, 83, 128, 66, 82,
+ 69, 86, 69, 45, 77, 65, 67, 82, 79, 78, 128, 66, 82, 69, 86, 197, 66, 82,
+ 69, 65, 84, 200, 66, 82, 69, 65, 75, 84, 72, 82, 79, 85, 71, 72, 128, 66,
+ 82, 69, 65, 68, 128, 66, 82, 68, 193, 66, 82, 65, 78, 67, 72, 73, 78,
+ 199, 66, 82, 65, 78, 67, 72, 128, 66, 82, 65, 78, 67, 200, 66, 82, 65,
+ 75, 67, 69, 84, 128, 66, 82, 65, 67, 75, 69, 84, 69, 196, 66, 82, 65, 67,
+ 75, 69, 212, 66, 82, 65, 67, 69, 128, 66, 81, 128, 66, 79, 89, 128, 66,
+ 79, 87, 84, 73, 69, 128, 66, 79, 87, 84, 73, 197, 66, 79, 87, 76, 73, 78,
+ 71, 128, 66, 79, 87, 76, 128, 66, 79, 87, 73, 78, 199, 66, 79, 215, 66,
+ 79, 85, 81, 85, 69, 84, 128, 66, 79, 85, 78, 68, 65, 82, 217, 66, 79, 84,
+ 84, 79, 77, 45, 76, 73, 71, 72, 84, 69, 196, 66, 79, 84, 84, 79, 77, 128,
+ 66, 79, 84, 84, 79, 205, 66, 79, 84, 84, 76, 69, 128, 66, 79, 84, 84, 76,
+ 197, 66, 79, 84, 200, 66, 79, 82, 85, 84, 79, 128, 66, 79, 82, 65, 88,
+ 45, 51, 128, 66, 79, 82, 65, 88, 45, 50, 128, 66, 79, 82, 65, 88, 128,
+ 66, 79, 79, 84, 83, 128, 66, 79, 79, 84, 128, 66, 79, 79, 77, 69, 82, 65,
+ 78, 71, 128, 66, 79, 79, 75, 83, 128, 66, 79, 79, 75, 77, 65, 82, 75,
+ 128, 66, 79, 79, 75, 77, 65, 82, 203, 66, 79, 78, 69, 128, 66, 79, 77,
+ 66, 128, 66, 79, 76, 84, 128, 66, 79, 76, 212, 66, 79, 68, 89, 128, 66,
+ 79, 65, 82, 128, 66, 79, 65, 128, 66, 76, 85, 69, 128, 66, 76, 85, 197,
+ 66, 76, 79, 87, 70, 73, 83, 72, 128, 66, 76, 79, 83, 83, 79, 77, 128, 66,
+ 76, 79, 79, 68, 128, 66, 76, 79, 78, 196, 66, 76, 79, 67, 75, 128, 66,
+ 76, 69, 78, 68, 69, 196, 66, 76, 65, 78, 75, 128, 66, 76, 65, 78, 203,
+ 66, 76, 65, 68, 197, 66, 76, 65, 67, 75, 70, 79, 79, 212, 66, 76, 65, 67,
+ 75, 45, 76, 69, 84, 84, 69, 210, 66, 76, 65, 67, 75, 45, 70, 69, 65, 84,
+ 72, 69, 82, 69, 196, 66, 76, 65, 67, 75, 128, 66, 75, 65, 173, 66, 73,
+ 84, 84, 69, 82, 128, 66, 73, 84, 73, 78, 199, 66, 73, 83, 77, 85, 84,
+ 200, 66, 73, 83, 77, 73, 76, 76, 65, 200, 66, 73, 83, 72, 79, 80, 128,
+ 66, 73, 83, 69, 67, 84, 73, 78, 199, 66, 73, 83, 65, 72, 128, 66, 73, 82,
+ 85, 128, 66, 73, 82, 84, 72, 68, 65, 217, 66, 73, 82, 71, 65, 128, 66,
+ 73, 82, 68, 128, 66, 73, 79, 72, 65, 90, 65, 82, 196, 66, 73, 78, 79, 67,
+ 85, 76, 65, 210, 66, 73, 78, 68, 73, 78, 199, 66, 73, 78, 68, 73, 128,
+ 66, 73, 78, 65, 82, 217, 66, 73, 76, 76, 73, 65, 82, 68, 83, 128, 66, 73,
+ 76, 65, 66, 73, 65, 204, 66, 73, 75, 73, 78, 73, 128, 66, 73, 71, 128,
+ 66, 73, 199, 66, 73, 69, 84, 128, 66, 73, 68, 69, 78, 84, 65, 204, 66,
+ 73, 67, 89, 67, 76, 73, 83, 84, 128, 66, 73, 67, 89, 67, 76, 69, 83, 128,
+ 66, 73, 67, 89, 67, 76, 69, 128, 66, 73, 67, 69, 80, 83, 128, 66, 73, 66,
+ 76, 69, 45, 67, 82, 69, 197, 66, 73, 66, 128, 66, 201, 66, 72, 85, 128,
+ 66, 72, 79, 79, 128, 66, 72, 79, 128, 66, 72, 73, 128, 66, 72, 69, 84,
+ 72, 128, 66, 72, 69, 69, 128, 66, 72, 69, 128, 66, 72, 65, 84, 84, 73,
+ 80, 82, 79, 76, 213, 66, 72, 65, 77, 128, 66, 72, 65, 128, 66, 69, 89,
+ 89, 65, 76, 128, 66, 69, 88, 128, 66, 69, 86, 69, 82, 65, 71, 69, 128,
+ 66, 69, 84, 87, 69, 69, 78, 128, 66, 69, 84, 87, 69, 69, 206, 66, 69, 84,
+ 72, 128, 66, 69, 84, 65, 128, 66, 69, 84, 193, 66, 69, 212, 66, 69, 83,
+ 73, 68, 197, 66, 69, 82, 75, 65, 78, 65, 206, 66, 69, 82, 66, 69, 210,
+ 66, 69, 80, 128, 66, 69, 79, 82, 195, 66, 69, 78, 90, 69, 78, 197, 66,
+ 69, 78, 84, 207, 66, 69, 78, 68, 69, 128, 66, 69, 78, 68, 128, 66, 69,
+ 206, 66, 69, 76, 84, 128, 66, 69, 76, 212, 66, 69, 76, 79, 215, 66, 69,
+ 76, 76, 128, 66, 69, 76, 204, 66, 69, 76, 71, 84, 72, 79, 210, 66, 69,
+ 73, 84, 72, 128, 66, 69, 72, 73, 78, 196, 66, 69, 72, 69, 72, 128, 66,
+ 69, 72, 69, 200, 66, 69, 72, 128, 66, 69, 200, 66, 69, 71, 73, 78, 78,
+ 73, 78, 71, 128, 66, 69, 71, 73, 78, 78, 69, 82, 128, 66, 69, 71, 73,
+ 206, 66, 69, 70, 79, 82, 197, 66, 69, 69, 84, 76, 69, 128, 66, 69, 69,
+ 84, 65, 128, 66, 69, 69, 210, 66, 69, 69, 72, 73, 86, 69, 128, 66, 69,
69, 72, 128, 66, 69, 69, 200, 66, 69, 67, 65, 85, 83, 69, 128, 66, 69,
- 65, 84, 128, 66, 69, 65, 78, 128, 66, 69, 65, 77, 69, 196, 66, 67, 65,
+ 65, 86, 69, 210, 66, 69, 65, 84, 73, 78, 199, 66, 69, 65, 84, 128, 66,
+ 69, 65, 210, 66, 69, 65, 78, 128, 66, 69, 65, 77, 69, 196, 66, 67, 65,
68, 128, 66, 67, 65, 196, 66, 66, 89, 88, 128, 66, 66, 89, 84, 128, 66,
66, 89, 80, 128, 66, 66, 89, 128, 66, 66, 85, 88, 128, 66, 66, 85, 84,
128, 66, 66, 85, 82, 88, 128, 66, 66, 85, 82, 128, 66, 66, 85, 80, 128,
66, 66, 85, 79, 88, 128, 66, 66, 85, 79, 80, 128, 66, 66, 85, 79, 128,
66, 66, 85, 128, 66, 66, 79, 88, 128, 66, 66, 79, 84, 128, 66, 66, 79,
- 80, 128, 66, 66, 79, 128, 66, 66, 73, 88, 128, 66, 66, 73, 84, 128, 66,
- 66, 73, 80, 128, 66, 66, 73, 69, 88, 128, 66, 66, 73, 69, 84, 128, 66,
- 66, 73, 69, 80, 128, 66, 66, 73, 69, 128, 66, 66, 73, 128, 66, 66, 69,
- 88, 128, 66, 66, 69, 80, 128, 66, 66, 69, 128, 66, 66, 65, 88, 128, 66,
- 66, 65, 84, 128, 66, 66, 65, 80, 128, 66, 66, 65, 128, 66, 65, 89, 65,
- 78, 78, 65, 128, 66, 65, 84, 72, 84, 85, 66, 128, 66, 65, 84, 72, 65, 77,
- 65, 83, 65, 84, 128, 66, 65, 83, 83, 65, 128, 66, 65, 83, 72, 75, 73,
- 210, 66, 65, 83, 69, 128, 66, 65, 83, 197, 66, 65, 82, 83, 128, 66, 65,
- 82, 82, 73, 69, 82, 128, 66, 65, 82, 82, 69, 75, 72, 128, 66, 65, 82, 82,
- 69, 69, 128, 66, 65, 82, 82, 69, 197, 66, 65, 82, 76, 73, 78, 69, 128,
- 66, 65, 82, 76, 69, 89, 128, 66, 65, 82, 73, 89, 79, 79, 83, 65, 78, 128,
- 66, 65, 82, 65, 50, 128, 66, 65, 210, 66, 65, 78, 84, 79, 67, 128, 66,
- 65, 78, 203, 66, 65, 78, 68, 128, 66, 65, 78, 50, 128, 66, 65, 78, 178,
- 66, 65, 77, 66, 79, 79, 83, 128, 66, 65, 77, 66, 79, 79, 128, 66, 65, 76,
- 85, 68, 65, 128, 66, 65, 76, 76, 79, 212, 66, 65, 76, 76, 79, 79, 78, 45,
- 83, 80, 79, 75, 69, 196, 66, 65, 76, 65, 71, 128, 66, 65, 76, 128, 66,
- 65, 204, 66, 65, 73, 82, 75, 65, 78, 128, 66, 65, 73, 77, 65, 73, 128,
- 66, 65, 72, 84, 128, 66, 65, 72, 65, 82, 50, 128, 66, 65, 71, 65, 128,
- 66, 65, 71, 51, 128, 66, 65, 199, 66, 65, 68, 71, 69, 82, 128, 66, 65,
- 68, 128, 66, 65, 67, 75, 83, 80, 65, 67, 69, 128, 66, 65, 67, 75, 83, 76,
- 65, 83, 72, 128, 66, 65, 67, 75, 83, 76, 65, 83, 200, 66, 65, 67, 75, 45,
- 84, 73, 76, 84, 69, 196, 66, 65, 67, 75, 128, 66, 65, 67, 203, 66, 65,
- 65, 82, 69, 82, 85, 128, 66, 65, 65, 128, 66, 51, 48, 53, 128, 66, 50,
- 53, 57, 128, 66, 50, 53, 56, 128, 66, 50, 53, 55, 128, 66, 50, 53, 54,
- 128, 66, 50, 53, 53, 128, 66, 50, 53, 180, 66, 50, 53, 51, 128, 66, 50,
- 53, 50, 128, 66, 50, 53, 49, 128, 66, 50, 53, 48, 128, 66, 50, 52, 57,
- 128, 66, 50, 52, 56, 128, 66, 50, 52, 183, 66, 50, 52, 54, 128, 66, 50,
- 52, 53, 128, 66, 50, 52, 179, 66, 50, 52, 178, 66, 50, 52, 177, 66, 50,
- 52, 176, 66, 50, 51, 54, 128, 66, 50, 51, 52, 128, 66, 50, 51, 179, 66,
- 50, 51, 50, 128, 66, 50, 51, 177, 66, 50, 51, 176, 66, 50, 50, 57, 128,
- 66, 50, 50, 56, 128, 66, 50, 50, 55, 128, 66, 50, 50, 54, 128, 66, 50,
- 50, 181, 66, 50, 50, 50, 128, 66, 50, 50, 49, 128, 66, 50, 50, 176, 66,
- 50, 49, 57, 128, 66, 50, 49, 56, 128, 66, 50, 49, 55, 128, 66, 50, 49,
- 54, 128, 66, 50, 49, 53, 128, 66, 50, 49, 52, 128, 66, 50, 49, 51, 128,
- 66, 50, 49, 50, 128, 66, 50, 49, 49, 128, 66, 50, 49, 48, 128, 66, 50,
- 48, 57, 128, 66, 50, 48, 56, 128, 66, 50, 48, 55, 128, 66, 50, 48, 54,
- 128, 66, 50, 48, 53, 128, 66, 50, 48, 52, 128, 66, 50, 48, 51, 128, 66,
- 50, 48, 50, 128, 66, 50, 48, 49, 128, 66, 50, 48, 48, 128, 66, 49, 57,
- 177, 66, 49, 57, 48, 128, 66, 49, 56, 57, 128, 66, 49, 56, 53, 128, 66,
- 49, 56, 52, 128, 66, 49, 56, 51, 128, 66, 49, 56, 50, 128, 66, 49, 56,
- 49, 128, 66, 49, 56, 48, 128, 66, 49, 55, 57, 128, 66, 49, 55, 56, 128,
- 66, 49, 55, 55, 128, 66, 49, 55, 182, 66, 49, 55, 52, 128, 66, 49, 55,
- 179, 66, 49, 55, 50, 128, 66, 49, 55, 49, 128, 66, 49, 55, 48, 128, 66,
- 49, 54, 57, 128, 66, 49, 54, 56, 128, 66, 49, 54, 55, 128, 66, 49, 54,
- 54, 128, 66, 49, 54, 53, 128, 66, 49, 54, 52, 128, 66, 49, 54, 179, 66,
- 49, 54, 178, 66, 49, 54, 49, 128, 66, 49, 54, 48, 128, 66, 49, 53, 185,
- 66, 49, 53, 56, 128, 66, 49, 53, 55, 128, 66, 49, 53, 182, 66, 49, 53,
- 53, 128, 66, 49, 53, 52, 128, 66, 49, 53, 51, 128, 66, 49, 53, 50, 128,
- 66, 49, 53, 177, 66, 49, 53, 48, 128, 66, 49, 52, 54, 128, 66, 49, 52,
- 181, 66, 49, 52, 50, 128, 66, 49, 52, 177, 66, 49, 52, 176, 66, 49, 51,
- 181, 66, 49, 51, 179, 66, 49, 51, 50, 128, 66, 49, 51, 177, 66, 49, 51,
- 176, 66, 49, 50, 184, 66, 49, 50, 183, 66, 49, 50, 181, 66, 49, 50, 179,
- 66, 49, 50, 178, 66, 49, 50, 177, 66, 49, 50, 176, 66, 49, 48, 57, 205,
- 66, 49, 48, 57, 198, 66, 49, 48, 56, 205, 66, 49, 48, 56, 198, 66, 49,
- 48, 55, 205, 66, 49, 48, 55, 198, 66, 49, 48, 54, 205, 66, 49, 48, 54,
- 198, 66, 49, 48, 53, 205, 66, 49, 48, 53, 198, 66, 49, 48, 181, 66, 49,
- 48, 180, 66, 49, 48, 178, 66, 49, 48, 176, 66, 48, 57, 177, 66, 48, 57,
- 176, 66, 48, 56, 57, 128, 66, 48, 56, 183, 66, 48, 56, 54, 128, 66, 48,
- 56, 181, 66, 48, 56, 51, 128, 66, 48, 56, 50, 128, 66, 48, 56, 177, 66,
- 48, 56, 176, 66, 48, 55, 57, 128, 66, 48, 55, 184, 66, 48, 55, 183, 66,
- 48, 55, 182, 66, 48, 55, 181, 66, 48, 55, 180, 66, 48, 55, 179, 66, 48,
- 55, 178, 66, 48, 55, 177, 66, 48, 55, 176, 66, 48, 54, 185, 66, 48, 54,
- 184, 66, 48, 54, 183, 66, 48, 54, 182, 66, 48, 54, 181, 66, 48, 54, 52,
- 128, 66, 48, 54, 51, 128, 66, 48, 54, 178, 66, 48, 54, 177, 66, 48, 54,
- 176, 66, 48, 53, 185, 66, 48, 53, 184, 66, 48, 53, 183, 66, 48, 53, 54,
- 128, 66, 48, 53, 181, 66, 48, 53, 180, 66, 48, 53, 179, 66, 48, 53, 178,
- 66, 48, 53, 177, 66, 48, 53, 176, 66, 48, 52, 57, 128, 66, 48, 52, 184,
- 66, 48, 52, 55, 128, 66, 48, 52, 182, 66, 48, 52, 181, 66, 48, 52, 180,
- 66, 48, 52, 179, 66, 48, 52, 178, 66, 48, 52, 177, 66, 48, 52, 176, 66,
- 48, 51, 185, 66, 48, 51, 184, 66, 48, 51, 183, 66, 48, 51, 182, 66, 48,
- 51, 52, 128, 66, 48, 51, 179, 66, 48, 51, 178, 66, 48, 51, 177, 66, 48,
- 51, 176, 66, 48, 50, 185, 66, 48, 50, 184, 66, 48, 50, 183, 66, 48, 50,
- 182, 66, 48, 50, 181, 66, 48, 50, 180, 66, 48, 50, 179, 66, 48, 50, 50,
- 128, 66, 48, 50, 177, 66, 48, 50, 176, 66, 48, 49, 57, 128, 66, 48, 49,
- 56, 128, 66, 48, 49, 183, 66, 48, 49, 182, 66, 48, 49, 181, 66, 48, 49,
- 180, 66, 48, 49, 179, 66, 48, 49, 178, 66, 48, 49, 177, 66, 48, 49, 176,
- 66, 48, 48, 185, 66, 48, 48, 184, 66, 48, 48, 183, 66, 48, 48, 182, 66,
- 48, 48, 181, 66, 48, 48, 180, 66, 48, 48, 179, 66, 48, 48, 178, 66, 48,
- 48, 177, 65, 90, 85, 128, 65, 89, 69, 210, 65, 89, 66, 128, 65, 89, 65,
- 72, 128, 65, 88, 69, 128, 65, 87, 69, 128, 65, 86, 69, 82, 65, 71, 197,
- 65, 86, 65, 75, 82, 65, 72, 65, 83, 65, 78, 89, 65, 128, 65, 86, 65, 71,
- 82, 65, 72, 65, 128, 65, 85, 89, 65, 78, 78, 65, 128, 65, 85, 84, 85, 77,
- 78, 128, 65, 85, 83, 84, 82, 65, 204, 65, 85, 82, 65, 77, 65, 90, 68, 65,
- 65, 72, 65, 128, 65, 85, 82, 65, 77, 65, 90, 68, 65, 65, 45, 50, 128, 65,
- 85, 82, 65, 77, 65, 90, 68, 65, 65, 128, 65, 85, 78, 78, 128, 65, 85, 71,
- 85, 83, 84, 128, 65, 85, 71, 77, 69, 78, 84, 65, 84, 73, 79, 206, 65, 85,
- 69, 128, 65, 84, 84, 73, 195, 65, 84, 84, 72, 65, 67, 65, 78, 128, 65,
- 84, 84, 69, 78, 84, 73, 79, 78, 128, 65, 84, 84, 65, 203, 65, 84, 79,
- 205, 65, 84, 78, 65, 200, 65, 84, 72, 65, 80, 65, 83, 67, 65, 206, 65,
- 83, 89, 85, 82, 193, 65, 83, 89, 77, 80, 84, 79, 84, 73, 67, 65, 76, 76,
- 217, 65, 83, 84, 82, 79, 76, 79, 71, 73, 67, 65, 204, 65, 83, 84, 69, 82,
- 73, 83, 77, 128, 65, 83, 84, 69, 82, 73, 83, 75, 211, 65, 83, 84, 69, 82,
- 73, 83, 75, 128, 65, 83, 84, 69, 82, 73, 83, 203, 65, 83, 84, 69, 82, 73,
- 83, 67, 85, 83, 128, 65, 83, 83, 89, 82, 73, 65, 206, 65, 83, 83, 69, 82,
- 84, 73, 79, 78, 128, 65, 83, 80, 73, 82, 65, 84, 69, 196, 65, 83, 72, 71,
- 65, 66, 128, 65, 83, 72, 57, 128, 65, 83, 72, 178, 65, 83, 67, 69, 78,
- 84, 128, 65, 83, 67, 69, 78, 68, 73, 78, 199, 65, 83, 65, 76, 50, 128,
- 65, 82, 85, 72, 85, 65, 128, 65, 82, 84, 65, 66, 197, 65, 82, 83, 69, 79,
- 83, 128, 65, 82, 83, 69, 79, 211, 65, 82, 82, 79, 87, 83, 128, 65, 82,
- 82, 79, 87, 72, 69, 65, 68, 128, 65, 82, 82, 79, 87, 72, 69, 65, 196, 65,
- 82, 82, 79, 87, 45, 84, 65, 73, 76, 128, 65, 82, 82, 73, 86, 69, 128, 65,
- 82, 82, 65, 89, 128, 65, 82, 80, 69, 71, 71, 73, 65, 84, 207, 65, 82, 79,
- 85, 83, 73, 78, 199, 65, 82, 79, 85, 82, 193, 65, 82, 79, 85, 78, 68, 45,
- 80, 82, 79, 70, 73, 76, 69, 128, 65, 82, 79, 85, 78, 196, 65, 82, 77, 89,
- 128, 65, 82, 77, 79, 85, 82, 128, 65, 82, 205, 65, 82, 76, 65, 85, 199,
- 65, 82, 75, 84, 73, 75, 207, 65, 82, 75, 65, 66, 128, 65, 82, 73, 83, 84,
- 69, 82, 65, 128, 65, 82, 73, 83, 84, 69, 82, 193, 65, 82, 73, 69, 83,
- 128, 65, 82, 71, 79, 84, 69, 82, 73, 128, 65, 82, 71, 79, 83, 89, 78, 84,
- 72, 69, 84, 79, 78, 128, 65, 82, 71, 73, 128, 65, 82, 69, 80, 65, 128,
- 65, 82, 67, 72, 65, 73, 79, 78, 128, 65, 82, 67, 72, 65, 73, 79, 206, 65,
- 82, 67, 72, 65, 73, 195, 65, 82, 67, 200, 65, 82, 67, 128, 65, 82, 195,
- 65, 82, 65, 69, 65, 69, 128, 65, 82, 65, 69, 65, 45, 85, 128, 65, 82, 65,
- 69, 65, 45, 73, 128, 65, 82, 65, 69, 65, 45, 69, 79, 128, 65, 82, 65, 68,
- 128, 65, 82, 65, 196, 65, 82, 65, 66, 73, 67, 45, 73, 78, 68, 73, 195,
- 65, 82, 45, 82, 65, 72, 77, 65, 206, 65, 82, 45, 82, 65, 72, 69, 69, 77,
- 128, 65, 81, 85, 65, 82, 73, 85, 83, 128, 65, 80, 82, 73, 76, 128, 65,
- 80, 80, 82, 79, 88, 73, 77, 65, 84, 69, 76, 217, 65, 80, 80, 82, 79, 88,
- 73, 77, 65, 84, 69, 128, 65, 80, 80, 82, 79, 65, 67, 72, 69, 211, 65, 80,
- 80, 82, 79, 65, 67, 72, 128, 65, 80, 80, 76, 73, 67, 65, 84, 73, 79, 78,
- 128, 65, 80, 79, 84, 72, 69, 83, 128, 65, 80, 79, 84, 72, 69, 77, 65,
- 128, 65, 80, 79, 83, 84, 82, 79, 80, 72, 69, 128, 65, 80, 79, 83, 84, 82,
- 79, 70, 79, 83, 128, 65, 80, 79, 83, 84, 82, 79, 70, 79, 211, 65, 80, 79,
- 83, 84, 82, 79, 70, 79, 201, 65, 80, 79, 68, 69, 88, 73, 65, 128, 65, 80,
- 79, 68, 69, 82, 77, 193, 65, 80, 76, 79, 85, 78, 128, 65, 80, 76, 201,
- 65, 80, 73, 78, 128, 65, 80, 69, 83, 207, 65, 80, 65, 82, 84, 128, 65,
- 80, 65, 65, 84, 79, 128, 65, 78, 85, 83, 86, 65, 82, 65, 89, 65, 128, 65,
- 78, 85, 83, 86, 65, 82, 65, 128, 65, 78, 85, 83, 86, 65, 82, 193, 65, 78,
- 85, 68, 65, 84, 84, 65, 128, 65, 78, 84, 73, 82, 69, 83, 84, 82, 73, 67,
- 84, 73, 79, 78, 128, 65, 78, 84, 73, 75, 69, 78, 79, 77, 65, 128, 65, 78,
- 84, 73, 75, 69, 78, 79, 75, 89, 76, 73, 83, 77, 65, 128, 65, 78, 84, 73,
- 70, 79, 78, 73, 65, 128, 65, 78, 84, 73, 67, 76, 79, 67, 75, 87, 73, 83,
- 69, 45, 82, 79, 84, 65, 84, 69, 196, 65, 78, 84, 73, 67, 76, 79, 67, 75,
- 87, 73, 83, 197, 65, 78, 83, 85, 218, 65, 78, 83, 72, 69, 128, 65, 78,
- 80, 69, 65, 128, 65, 78, 207, 65, 78, 78, 85, 73, 84, 217, 65, 78, 78,
- 79, 84, 65, 84, 73, 79, 206, 65, 78, 75, 72, 128, 65, 78, 72, 85, 128,
- 65, 78, 71, 85, 76, 65, 82, 128, 65, 78, 71, 83, 84, 82, 79, 205, 65, 78,
- 71, 75, 72, 65, 78, 75, 72, 85, 128, 65, 78, 67, 79, 82, 65, 128, 65, 78,
- 67, 72, 79, 82, 128, 65, 78, 65, 84, 82, 73, 67, 72, 73, 83, 77, 65, 128,
- 65, 77, 80, 83, 128, 65, 77, 80, 69, 82, 83, 65, 78, 68, 128, 65, 77, 79,
- 85, 78, 212, 65, 77, 66, 193, 65, 77, 65, 82, 128, 65, 77, 65, 210, 65,
- 77, 65, 76, 71, 65, 77, 65, 84, 73, 79, 206, 65, 76, 86, 69, 79, 76, 65,
- 210, 65, 76, 84, 69, 82, 78, 65, 84, 73, 86, 197, 65, 76, 84, 69, 82, 78,
- 65, 84, 73, 79, 206, 65, 76, 84, 69, 82, 78, 65, 84, 197, 65, 76, 84, 65,
- 128, 65, 76, 80, 72, 65, 128, 65, 76, 80, 72, 193, 65, 76, 80, 65, 80,
- 82, 65, 78, 65, 128, 65, 76, 80, 65, 80, 82, 65, 65, 78, 193, 65, 76, 80,
- 65, 128, 65, 76, 77, 79, 83, 212, 65, 76, 76, 79, 128, 65, 76, 76, 73,
- 65, 78, 67, 69, 128, 65, 76, 76, 201, 65, 76, 76, 65, 200, 65, 76, 73,
- 71, 78, 69, 196, 65, 76, 73, 70, 85, 128, 65, 76, 71, 73, 218, 65, 76,
- 70, 65, 128, 65, 76, 69, 85, 212, 65, 76, 69, 80, 72, 128, 65, 76, 69,
- 77, 66, 73, 67, 128, 65, 76, 69, 70, 128, 65, 76, 65, 89, 72, 69, 128,
- 65, 76, 65, 89, 72, 197, 65, 76, 65, 80, 72, 128, 65, 76, 45, 76, 65, 75,
- 85, 78, 65, 128, 65, 75, 84, 73, 69, 83, 69, 76, 83, 75, 65, 66, 128, 65,
- 75, 72, 77, 73, 77, 73, 195, 65, 75, 66, 65, 210, 65, 75, 65, 82, 65,
- 128, 65, 75, 65, 82, 193, 65, 73, 89, 65, 78, 78, 65, 128, 65, 73, 86,
- 73, 76, 73, 203, 65, 73, 82, 80, 76, 65, 78, 69, 128, 65, 73, 78, 78,
- 128, 65, 73, 76, 77, 128, 65, 73, 75, 65, 82, 65, 128, 65, 73, 72, 86,
- 85, 83, 128, 65, 72, 83, 68, 65, 128, 65, 72, 83, 65, 128, 65, 72, 65,
- 71, 71, 65, 210, 65, 72, 65, 68, 128, 65, 71, 79, 71, 201, 65, 71, 71,
- 82, 65, 86, 65, 84, 73, 79, 78, 128, 65, 71, 65, 73, 78, 128, 65, 70, 84,
- 69, 210, 65, 70, 82, 73, 67, 65, 206, 65, 70, 79, 82, 69, 77, 69, 78, 84,
- 73, 79, 78, 69, 68, 128, 65, 70, 71, 72, 65, 78, 201, 65, 69, 89, 65, 78,
- 78, 65, 128, 65, 69, 83, 67, 85, 76, 65, 80, 73, 85, 83, 128, 65, 69, 83,
- 67, 128, 65, 69, 76, 65, 45, 80, 73, 76, 76, 65, 128, 65, 69, 69, 89, 65,
- 78, 78, 65, 128, 65, 69, 68, 65, 45, 80, 73, 76, 76, 65, 128, 65, 197,
- 65, 68, 86, 65, 78, 67, 69, 128, 65, 68, 69, 71, 128, 65, 68, 69, 199,
- 65, 68, 68, 82, 69, 83, 83, 69, 196, 65, 68, 68, 65, 75, 128, 65, 68, 65,
- 203, 65, 67, 85, 84, 69, 45, 77, 65, 67, 82, 79, 78, 128, 65, 67, 85, 84,
- 69, 45, 71, 82, 65, 86, 69, 45, 65, 67, 85, 84, 69, 128, 65, 67, 85, 84,
- 197, 65, 67, 84, 85, 65, 76, 76, 217, 65, 67, 84, 73, 86, 65, 84, 197,
- 65, 67, 82, 79, 80, 72, 79, 78, 73, 195, 65, 67, 75, 78, 79, 87, 76, 69,
- 68, 71, 69, 128, 65, 67, 67, 85, 77, 85, 76, 65, 84, 73, 79, 78, 128, 65,
- 67, 67, 79, 85, 78, 212, 65, 67, 67, 69, 78, 84, 45, 83, 84, 65, 67, 67,
- 65, 84, 79, 128, 65, 67, 67, 69, 78, 84, 128, 65, 67, 67, 69, 78, 212,
- 65, 67, 65, 68, 69, 77, 217, 65, 66, 89, 83, 77, 65, 204, 65, 66, 85, 78,
- 68, 65, 78, 67, 69, 128, 65, 66, 75, 72, 65, 83, 73, 65, 206, 65, 66, 66,
- 82, 69, 86, 73, 65, 84, 73, 79, 206, 65, 66, 65, 70, 73, 76, 73, 128, 65,
- 66, 178, 65, 65, 89, 65, 78, 78, 65, 128, 65, 65, 89, 128, 65, 65, 87,
- 128, 65, 65, 77, 128, 65, 65, 75, 128, 65, 65, 74, 128, 65, 65, 66, 65,
- 65, 70, 73, 76, 73, 128, 45, 85, 205, 45, 80, 72, 82, 85, 128, 45, 75,
- 72, 89, 85, 196, 45, 75, 72, 89, 73, 76, 128, 45, 68, 90, 85, 196, 45,
- 67, 72, 65, 210, 45, 67, 72, 65, 76, 128,
+ 80, 128, 66, 66, 79, 128, 66, 66, 73, 88, 128, 66, 66, 73, 80, 128, 66,
+ 66, 73, 69, 88, 128, 66, 66, 73, 69, 84, 128, 66, 66, 73, 69, 80, 128,
+ 66, 66, 73, 69, 128, 66, 66, 73, 128, 66, 66, 69, 88, 128, 66, 66, 69,
+ 80, 128, 66, 66, 69, 69, 128, 66, 66, 69, 128, 66, 66, 65, 88, 128, 66,
+ 66, 65, 84, 128, 66, 66, 65, 80, 128, 66, 66, 65, 65, 128, 66, 66, 65,
+ 128, 66, 65, 89, 65, 78, 78, 65, 128, 66, 65, 85, 128, 66, 65, 84, 84,
+ 69, 82, 89, 128, 66, 65, 84, 72, 84, 85, 66, 128, 66, 65, 84, 72, 65, 77,
+ 65, 83, 65, 84, 128, 66, 65, 84, 72, 128, 66, 65, 84, 200, 66, 65, 84,
+ 65, 203, 66, 65, 83, 83, 65, 128, 66, 65, 83, 75, 69, 84, 66, 65, 76,
+ 204, 66, 65, 83, 72, 75, 73, 210, 66, 65, 83, 72, 128, 66, 65, 83, 69,
+ 66, 65, 76, 76, 128, 66, 65, 83, 69, 128, 66, 65, 83, 197, 66, 65, 82,
+ 83, 128, 66, 65, 82, 82, 73, 69, 82, 128, 66, 65, 82, 82, 69, 75, 72,
+ 128, 66, 65, 82, 82, 69, 69, 128, 66, 65, 82, 82, 69, 197, 66, 65, 82,
+ 76, 73, 78, 69, 128, 66, 65, 82, 76, 69, 89, 128, 66, 65, 82, 73, 89, 79,
+ 79, 83, 65, 78, 128, 66, 65, 82, 66, 69, 210, 66, 65, 82, 65, 50, 128,
+ 66, 65, 210, 66, 65, 78, 84, 79, 67, 128, 66, 65, 78, 75, 78, 79, 84,
+ 197, 66, 65, 78, 75, 128, 66, 65, 78, 203, 66, 65, 78, 68, 128, 66, 65,
+ 78, 65, 78, 65, 128, 66, 65, 78, 50, 128, 66, 65, 78, 178, 66, 65, 77,
+ 66, 79, 79, 83, 128, 66, 65, 77, 66, 79, 79, 128, 66, 65, 76, 85, 68, 65,
+ 128, 66, 65, 76, 76, 79, 212, 66, 65, 76, 76, 79, 79, 78, 45, 83, 80, 79,
+ 75, 69, 196, 66, 65, 76, 76, 79, 79, 78, 128, 66, 65, 76, 65, 71, 128,
+ 66, 65, 76, 128, 66, 65, 204, 66, 65, 73, 82, 75, 65, 78, 128, 66, 65,
+ 73, 77, 65, 73, 128, 66, 65, 72, 84, 128, 66, 65, 72, 73, 82, 71, 79, 77,
+ 85, 75, 72, 65, 128, 66, 65, 72, 65, 82, 50, 128, 66, 65, 71, 71, 65, 71,
+ 197, 66, 65, 71, 65, 128, 66, 65, 71, 51, 128, 66, 65, 199, 66, 65, 68,
+ 71, 69, 82, 128, 66, 65, 68, 71, 69, 128, 66, 65, 68, 128, 66, 65, 67,
+ 84, 82, 73, 65, 206, 66, 65, 67, 75, 83, 80, 65, 67, 69, 128, 66, 65, 67,
+ 75, 83, 76, 65, 83, 72, 128, 66, 65, 67, 75, 83, 76, 65, 83, 200, 66, 65,
+ 67, 75, 72, 65, 78, 196, 66, 65, 67, 75, 45, 84, 73, 76, 84, 69, 196, 66,
+ 65, 67, 75, 128, 66, 65, 67, 203, 66, 65, 66, 89, 128, 66, 65, 66, 217,
+ 66, 65, 65, 82, 69, 82, 85, 128, 66, 51, 48, 53, 128, 66, 50, 53, 57,
+ 128, 66, 50, 53, 56, 128, 66, 50, 53, 55, 128, 66, 50, 53, 54, 128, 66,
+ 50, 53, 53, 128, 66, 50, 53, 180, 66, 50, 53, 51, 128, 66, 50, 53, 50,
+ 128, 66, 50, 53, 49, 128, 66, 50, 53, 48, 128, 66, 50, 52, 57, 128, 66,
+ 50, 52, 56, 128, 66, 50, 52, 183, 66, 50, 52, 54, 128, 66, 50, 52, 53,
+ 128, 66, 50, 52, 179, 66, 50, 52, 178, 66, 50, 52, 177, 66, 50, 52, 176,
+ 66, 50, 51, 54, 128, 66, 50, 51, 52, 128, 66, 50, 51, 179, 66, 50, 51,
+ 50, 128, 66, 50, 51, 177, 66, 50, 51, 176, 66, 50, 50, 57, 128, 66, 50,
+ 50, 56, 128, 66, 50, 50, 55, 128, 66, 50, 50, 54, 128, 66, 50, 50, 181,
+ 66, 50, 50, 50, 128, 66, 50, 50, 49, 128, 66, 50, 50, 176, 66, 50, 49,
+ 57, 128, 66, 50, 49, 56, 128, 66, 50, 49, 55, 128, 66, 50, 49, 54, 128,
+ 66, 50, 49, 53, 128, 66, 50, 49, 52, 128, 66, 50, 49, 51, 128, 66, 50,
+ 49, 50, 128, 66, 50, 49, 49, 128, 66, 50, 49, 48, 128, 66, 50, 48, 57,
+ 128, 66, 50, 48, 56, 128, 66, 50, 48, 55, 128, 66, 50, 48, 54, 128, 66,
+ 50, 48, 53, 128, 66, 50, 48, 52, 128, 66, 50, 48, 51, 128, 66, 50, 48,
+ 50, 128, 66, 50, 48, 49, 128, 66, 50, 48, 48, 128, 66, 49, 57, 177, 66,
+ 49, 57, 48, 128, 66, 49, 56, 57, 128, 66, 49, 56, 53, 128, 66, 49, 56,
+ 52, 128, 66, 49, 56, 51, 128, 66, 49, 56, 50, 128, 66, 49, 56, 49, 128,
+ 66, 49, 56, 48, 128, 66, 49, 55, 57, 128, 66, 49, 55, 56, 128, 66, 49,
+ 55, 55, 128, 66, 49, 55, 182, 66, 49, 55, 52, 128, 66, 49, 55, 179, 66,
+ 49, 55, 50, 128, 66, 49, 55, 49, 128, 66, 49, 55, 48, 128, 66, 49, 54,
+ 57, 128, 66, 49, 54, 56, 128, 66, 49, 54, 55, 128, 66, 49, 54, 54, 128,
+ 66, 49, 54, 53, 128, 66, 49, 54, 52, 128, 66, 49, 54, 179, 66, 49, 54,
+ 178, 66, 49, 54, 49, 128, 66, 49, 54, 48, 128, 66, 49, 53, 185, 66, 49,
+ 53, 56, 128, 66, 49, 53, 55, 128, 66, 49, 53, 182, 66, 49, 53, 53, 128,
+ 66, 49, 53, 52, 128, 66, 49, 53, 51, 128, 66, 49, 53, 50, 128, 66, 49,
+ 53, 177, 66, 49, 53, 48, 128, 66, 49, 52, 54, 128, 66, 49, 52, 181, 66,
+ 49, 52, 50, 128, 66, 49, 52, 177, 66, 49, 52, 176, 66, 49, 51, 181, 66,
+ 49, 51, 179, 66, 49, 51, 50, 128, 66, 49, 51, 177, 66, 49, 51, 176, 66,
+ 49, 50, 184, 66, 49, 50, 183, 66, 49, 50, 181, 66, 49, 50, 179, 66, 49,
+ 50, 178, 66, 49, 50, 177, 66, 49, 50, 176, 66, 49, 48, 57, 205, 66, 49,
+ 48, 57, 198, 66, 49, 48, 56, 205, 66, 49, 48, 56, 198, 66, 49, 48, 55,
+ 205, 66, 49, 48, 55, 198, 66, 49, 48, 54, 205, 66, 49, 48, 54, 198, 66,
+ 49, 48, 53, 205, 66, 49, 48, 53, 198, 66, 49, 48, 181, 66, 49, 48, 180,
+ 66, 49, 48, 178, 66, 49, 48, 176, 66, 48, 57, 177, 66, 48, 57, 176, 66,
+ 48, 56, 57, 128, 66, 48, 56, 183, 66, 48, 56, 54, 128, 66, 48, 56, 181,
+ 66, 48, 56, 51, 128, 66, 48, 56, 50, 128, 66, 48, 56, 177, 66, 48, 56,
+ 176, 66, 48, 55, 57, 128, 66, 48, 55, 184, 66, 48, 55, 183, 66, 48, 55,
+ 182, 66, 48, 55, 181, 66, 48, 55, 180, 66, 48, 55, 179, 66, 48, 55, 178,
+ 66, 48, 55, 177, 66, 48, 55, 176, 66, 48, 54, 185, 66, 48, 54, 184, 66,
+ 48, 54, 183, 66, 48, 54, 182, 66, 48, 54, 181, 66, 48, 54, 52, 128, 66,
+ 48, 54, 51, 128, 66, 48, 54, 178, 66, 48, 54, 177, 66, 48, 54, 176, 66,
+ 48, 53, 185, 66, 48, 53, 184, 66, 48, 53, 183, 66, 48, 53, 54, 128, 66,
+ 48, 53, 181, 66, 48, 53, 180, 66, 48, 53, 179, 66, 48, 53, 178, 66, 48,
+ 53, 177, 66, 48, 53, 176, 66, 48, 52, 57, 128, 66, 48, 52, 184, 66, 48,
+ 52, 55, 128, 66, 48, 52, 182, 66, 48, 52, 181, 66, 48, 52, 180, 66, 48,
+ 52, 179, 66, 48, 52, 178, 66, 48, 52, 177, 66, 48, 52, 176, 66, 48, 51,
+ 185, 66, 48, 51, 184, 66, 48, 51, 183, 66, 48, 51, 182, 66, 48, 51, 52,
+ 128, 66, 48, 51, 179, 66, 48, 51, 178, 66, 48, 51, 177, 66, 48, 51, 176,
+ 66, 48, 50, 185, 66, 48, 50, 184, 66, 48, 50, 183, 66, 48, 50, 182, 66,
+ 48, 50, 181, 66, 48, 50, 180, 66, 48, 50, 179, 66, 48, 50, 50, 128, 66,
+ 48, 50, 177, 66, 48, 50, 176, 66, 48, 49, 57, 128, 66, 48, 49, 56, 128,
+ 66, 48, 49, 183, 66, 48, 49, 182, 66, 48, 49, 181, 66, 48, 49, 180, 66,
+ 48, 49, 179, 66, 48, 49, 178, 66, 48, 49, 177, 66, 48, 49, 176, 66, 48,
+ 48, 57, 128, 66, 48, 48, 185, 66, 48, 48, 56, 128, 66, 48, 48, 184, 66,
+ 48, 48, 55, 128, 66, 48, 48, 183, 66, 48, 48, 54, 128, 66, 48, 48, 182,
+ 66, 48, 48, 53, 65, 128, 66, 48, 48, 53, 128, 66, 48, 48, 181, 66, 48,
+ 48, 52, 128, 66, 48, 48, 180, 66, 48, 48, 51, 128, 66, 48, 48, 179, 66,
+ 48, 48, 50, 128, 66, 48, 48, 178, 66, 48, 48, 49, 128, 66, 48, 48, 177,
+ 65, 90, 85, 128, 65, 89, 69, 210, 65, 89, 66, 128, 65, 89, 65, 72, 128,
+ 65, 88, 69, 128, 65, 87, 69, 128, 65, 86, 69, 83, 84, 65, 206, 65, 86,
+ 69, 82, 65, 71, 197, 65, 86, 65, 75, 82, 65, 72, 65, 83, 65, 78, 89, 65,
+ 128, 65, 86, 65, 71, 82, 65, 72, 65, 128, 65, 85, 89, 65, 78, 78, 65,
+ 128, 65, 85, 84, 85, 77, 78, 128, 65, 85, 84, 79, 77, 79, 66, 73, 76, 69,
+ 128, 65, 85, 84, 79, 77, 65, 84, 69, 196, 65, 85, 83, 84, 82, 65, 204,
+ 65, 85, 82, 73, 80, 73, 71, 77, 69, 78, 84, 128, 65, 85, 82, 65, 77, 65,
+ 90, 68, 65, 65, 72, 65, 128, 65, 85, 82, 65, 77, 65, 90, 68, 65, 65, 45,
+ 50, 128, 65, 85, 82, 65, 77, 65, 90, 68, 65, 65, 128, 65, 85, 78, 78,
+ 128, 65, 85, 71, 85, 83, 84, 128, 65, 85, 71, 77, 69, 78, 84, 65, 84, 73,
+ 79, 206, 65, 85, 69, 128, 65, 85, 66, 69, 82, 71, 73, 78, 69, 128, 65,
+ 84, 84, 73, 195, 65, 84, 84, 72, 65, 67, 65, 78, 128, 65, 84, 84, 69, 78,
+ 84, 73, 79, 78, 128, 65, 84, 84, 65, 203, 65, 84, 79, 205, 65, 84, 78,
+ 65, 200, 65, 84, 77, 65, 65, 85, 128, 65, 84, 73, 89, 65, 128, 65, 84,
+ 72, 76, 69, 84, 73, 195, 65, 84, 72, 65, 82, 86, 65, 86, 69, 68, 73, 195,
+ 65, 84, 72, 65, 80, 65, 83, 67, 65, 206, 65, 83, 90, 128, 65, 83, 89, 85,
+ 82, 193, 65, 83, 89, 77, 80, 84, 79, 84, 73, 67, 65, 76, 76, 217, 65, 83,
+ 84, 82, 79, 78, 79, 77, 73, 67, 65, 204, 65, 83, 84, 82, 79, 76, 79, 71,
+ 73, 67, 65, 204, 65, 83, 84, 79, 78, 73, 83, 72, 69, 196, 65, 83, 84, 69,
+ 82, 73, 83, 77, 128, 65, 83, 84, 69, 82, 73, 83, 75, 211, 65, 83, 84, 69,
+ 82, 73, 83, 75, 128, 65, 83, 84, 69, 82, 73, 83, 203, 65, 83, 84, 69, 82,
+ 73, 83, 67, 85, 83, 128, 65, 83, 83, 89, 82, 73, 65, 206, 65, 83, 83, 69,
+ 82, 84, 73, 79, 78, 128, 65, 83, 80, 73, 82, 65, 84, 69, 196, 65, 83, 80,
+ 69, 82, 128, 65, 83, 73, 65, 45, 65, 85, 83, 84, 82, 65, 76, 73, 65, 128,
+ 65, 83, 72, 71, 65, 66, 128, 65, 83, 72, 69, 83, 128, 65, 83, 72, 57,
+ 128, 65, 83, 72, 178, 65, 83, 67, 69, 78, 84, 128, 65, 83, 67, 69, 78,
+ 68, 73, 78, 199, 65, 83, 65, 76, 50, 128, 65, 82, 85, 72, 85, 65, 128,
+ 65, 82, 84, 73, 83, 212, 65, 82, 84, 73, 67, 85, 76, 65, 84, 69, 196, 65,
+ 82, 84, 65, 66, 197, 65, 82, 83, 69, 79, 83, 128, 65, 82, 83, 69, 79,
+ 211, 65, 82, 83, 69, 78, 73, 67, 128, 65, 82, 82, 79, 87, 83, 128, 65,
+ 82, 82, 79, 87, 211, 65, 82, 82, 79, 87, 72, 69, 65, 68, 128, 65, 82, 82,
+ 79, 87, 72, 69, 65, 196, 65, 82, 82, 79, 87, 45, 84, 65, 73, 76, 128, 65,
+ 82, 82, 73, 86, 69, 128, 65, 82, 82, 65, 89, 128, 65, 82, 80, 69, 71, 71,
+ 73, 65, 84, 207, 65, 82, 79, 85, 83, 73, 78, 199, 65, 82, 79, 85, 82,
+ 193, 65, 82, 79, 85, 78, 68, 45, 80, 82, 79, 70, 73, 76, 69, 128, 65, 82,
+ 79, 85, 78, 196, 65, 82, 77, 89, 128, 65, 82, 77, 79, 85, 82, 128, 65,
+ 82, 205, 65, 82, 76, 65, 85, 199, 65, 82, 75, 84, 73, 75, 207, 65, 82,
+ 75, 65, 66, 128, 65, 82, 75, 65, 65, 78, 85, 128, 65, 82, 73, 83, 84, 69,
+ 82, 65, 128, 65, 82, 73, 83, 84, 69, 82, 193, 65, 82, 73, 69, 83, 128,
+ 65, 82, 71, 79, 84, 69, 82, 73, 128, 65, 82, 71, 79, 83, 89, 78, 84, 72,
+ 69, 84, 79, 78, 128, 65, 82, 71, 73, 128, 65, 82, 69, 80, 65, 128, 65,
+ 82, 68, 72, 65, 86, 73, 83, 65, 82, 71, 65, 128, 65, 82, 67, 72, 65, 73,
+ 79, 78, 128, 65, 82, 67, 72, 65, 73, 79, 206, 65, 82, 67, 72, 65, 73,
+ 195, 65, 82, 67, 200, 65, 82, 67, 128, 65, 82, 195, 65, 82, 65, 77, 65,
+ 73, 195, 65, 82, 65, 69, 65, 69, 128, 65, 82, 65, 69, 65, 45, 85, 128,
+ 65, 82, 65, 69, 65, 45, 73, 128, 65, 82, 65, 69, 65, 45, 69, 79, 128, 65,
+ 82, 65, 69, 65, 45, 69, 128, 65, 82, 65, 69, 65, 45, 65, 128, 65, 82, 65,
+ 68, 128, 65, 82, 65, 196, 65, 82, 65, 66, 73, 67, 45, 73, 78, 68, 73,
+ 195, 65, 82, 65, 66, 73, 65, 206, 65, 82, 45, 82, 65, 72, 77, 65, 206,
+ 65, 82, 45, 82, 65, 72, 69, 69, 77, 128, 65, 81, 85, 65, 82, 73, 85, 83,
+ 128, 65, 81, 85, 65, 70, 79, 82, 84, 73, 83, 128, 65, 81, 85, 193, 65,
+ 80, 85, 206, 65, 80, 82, 73, 76, 128, 65, 80, 80, 82, 79, 88, 73, 77, 65,
+ 84, 69, 76, 217, 65, 80, 80, 82, 79, 88, 73, 77, 65, 84, 69, 128, 65, 80,
+ 80, 82, 79, 65, 67, 72, 69, 211, 65, 80, 80, 82, 79, 65, 67, 72, 128, 65,
+ 80, 80, 76, 73, 67, 65, 84, 73, 79, 78, 128, 65, 80, 79, 84, 72, 69, 83,
+ 128, 65, 80, 79, 84, 72, 69, 77, 65, 128, 65, 80, 79, 83, 84, 82, 79, 80,
+ 72, 69, 128, 65, 80, 79, 83, 84, 82, 79, 70, 79, 83, 128, 65, 80, 79, 83,
+ 84, 82, 79, 70, 79, 211, 65, 80, 79, 83, 84, 82, 79, 70, 79, 201, 65, 80,
+ 79, 68, 69, 88, 73, 65, 128, 65, 80, 79, 68, 69, 82, 77, 193, 65, 80, 76,
+ 79, 85, 78, 128, 65, 80, 76, 201, 65, 80, 73, 78, 128, 65, 80, 69, 83,
+ 207, 65, 80, 65, 82, 84, 128, 65, 80, 65, 65, 84, 79, 128, 65, 78, 85,
+ 83, 86, 65, 82, 65, 89, 65, 128, 65, 78, 85, 83, 86, 65, 82, 65, 128, 65,
+ 78, 85, 83, 86, 65, 82, 193, 65, 78, 85, 68, 65, 84, 84, 65, 128, 65, 78,
+ 85, 68, 65, 84, 84, 193, 65, 78, 84, 73, 82, 69, 83, 84, 82, 73, 67, 84,
+ 73, 79, 78, 128, 65, 78, 84, 73, 77, 79, 78, 89, 45, 50, 128, 65, 78, 84,
+ 73, 77, 79, 78, 89, 128, 65, 78, 84, 73, 77, 79, 78, 217, 65, 78, 84, 73,
+ 77, 79, 78, 73, 65, 84, 69, 128, 65, 78, 84, 73, 75, 69, 78, 79, 77, 65,
+ 128, 65, 78, 84, 73, 75, 69, 78, 79, 75, 89, 76, 73, 83, 77, 65, 128, 65,
+ 78, 84, 73, 70, 79, 78, 73, 65, 128, 65, 78, 84, 73, 67, 76, 79, 67, 75,
+ 87, 73, 83, 69, 45, 82, 79, 84, 65, 84, 69, 196, 65, 78, 84, 73, 67, 76,
+ 79, 67, 75, 87, 73, 83, 197, 65, 78, 84, 69, 78, 78, 65, 128, 65, 78, 84,
+ 69, 78, 78, 193, 65, 78, 84, 65, 82, 71, 79, 77, 85, 75, 72, 65, 128, 65,
+ 78, 83, 85, 218, 65, 78, 83, 72, 69, 128, 65, 78, 80, 69, 65, 128, 65,
+ 78, 207, 65, 78, 78, 85, 73, 84, 217, 65, 78, 78, 79, 84, 65, 84, 73, 79,
+ 206, 65, 78, 78, 65, 65, 85, 128, 65, 78, 75, 72, 128, 65, 78, 72, 85,
+ 128, 65, 78, 71, 85, 76, 65, 82, 128, 65, 78, 71, 83, 84, 82, 79, 205,
+ 65, 78, 71, 82, 217, 65, 78, 71, 75, 72, 65, 78, 75, 72, 85, 128, 65, 78,
+ 71, 69, 210, 65, 78, 71, 69, 76, 128, 65, 78, 71, 69, 68, 128, 65, 78,
+ 68, 65, 80, 128, 65, 78, 67, 79, 82, 65, 128, 65, 78, 67, 72, 79, 82,
+ 128, 65, 78, 65, 84, 82, 73, 67, 72, 73, 83, 77, 65, 128, 65, 78, 65, 80,
+ 128, 65, 77, 80, 83, 128, 65, 77, 80, 69, 82, 83, 65, 78, 68, 128, 65,
+ 77, 79, 85, 78, 212, 65, 77, 69, 82, 73, 67, 65, 83, 128, 65, 77, 69, 82,
+ 73, 67, 65, 206, 65, 77, 66, 85, 76, 65, 78, 67, 69, 128, 65, 77, 66,
+ 193, 65, 77, 65, 82, 128, 65, 77, 65, 210, 65, 77, 65, 76, 71, 65, 77,
+ 65, 84, 73, 79, 206, 65, 77, 65, 76, 71, 65, 77, 128, 65, 76, 86, 69, 79,
+ 76, 65, 210, 65, 76, 85, 77, 128, 65, 76, 84, 69, 82, 78, 65, 84, 73, 86,
+ 197, 65, 76, 84, 69, 82, 78, 65, 84, 73, 79, 206, 65, 76, 84, 69, 82, 78,
+ 65, 84, 197, 65, 76, 84, 65, 128, 65, 76, 80, 72, 65, 128, 65, 76, 80,
+ 72, 193, 65, 76, 80, 65, 80, 82, 65, 78, 65, 128, 65, 76, 80, 65, 80, 82,
+ 65, 65, 78, 193, 65, 76, 80, 65, 128, 65, 76, 77, 79, 83, 212, 65, 76,
+ 76, 79, 128, 65, 76, 76, 73, 65, 78, 67, 69, 128, 65, 76, 76, 201, 65,
+ 76, 76, 65, 200, 65, 76, 75, 65, 76, 73, 45, 50, 128, 65, 76, 75, 65, 76,
+ 73, 128, 65, 76, 73, 71, 78, 69, 196, 65, 76, 73, 70, 85, 128, 65, 76,
+ 73, 69, 78, 128, 65, 76, 73, 69, 206, 65, 76, 71, 73, 218, 65, 76, 70,
+ 65, 128, 65, 76, 69, 85, 212, 65, 76, 69, 80, 72, 128, 65, 76, 69, 77,
+ 66, 73, 67, 128, 65, 76, 69, 70, 128, 65, 76, 65, 89, 72, 69, 128, 65,
+ 76, 65, 89, 72, 197, 65, 76, 65, 82, 205, 65, 76, 65, 80, 72, 128, 65,
+ 76, 45, 76, 65, 75, 85, 78, 65, 128, 65, 75, 84, 73, 69, 83, 69, 76, 83,
+ 75, 65, 66, 128, 65, 75, 83, 65, 128, 65, 75, 72, 77, 73, 77, 73, 195,
+ 65, 75, 66, 65, 210, 65, 75, 65, 82, 65, 128, 65, 75, 65, 82, 193, 65,
+ 73, 89, 65, 78, 78, 65, 128, 65, 73, 86, 73, 76, 73, 203, 65, 73, 84, 79,
+ 206, 65, 73, 82, 80, 76, 65, 78, 69, 128, 65, 73, 78, 78, 128, 65, 73,
+ 76, 77, 128, 65, 73, 75, 65, 82, 65, 128, 65, 73, 72, 86, 85, 83, 128,
+ 65, 72, 83, 68, 65, 128, 65, 72, 83, 65, 128, 65, 72, 65, 71, 71, 65,
+ 210, 65, 72, 65, 68, 128, 65, 71, 85, 78, 71, 128, 65, 71, 79, 71, 201,
+ 65, 71, 71, 82, 65, 86, 65, 84, 73, 79, 78, 128, 65, 71, 71, 82, 65, 86,
+ 65, 84, 69, 196, 65, 71, 65, 73, 78, 128, 65, 70, 84, 69, 210, 65, 70,
+ 83, 65, 65, 81, 128, 65, 70, 82, 73, 67, 65, 206, 65, 70, 79, 82, 69, 77,
+ 69, 78, 84, 73, 79, 78, 69, 68, 128, 65, 70, 71, 72, 65, 78, 201, 65, 70,
+ 70, 82, 73, 67, 65, 84, 73, 79, 206, 65, 69, 89, 65, 78, 78, 65, 128, 65,
+ 69, 89, 128, 65, 69, 83, 67, 85, 76, 65, 80, 73, 85, 83, 128, 65, 69, 83,
+ 67, 128, 65, 69, 83, 128, 65, 69, 82, 73, 65, 204, 65, 69, 82, 128, 65,
+ 69, 76, 65, 45, 80, 73, 76, 76, 65, 128, 65, 69, 76, 128, 65, 69, 75,
+ 128, 65, 69, 71, 69, 65, 206, 65, 69, 71, 128, 65, 69, 69, 89, 65, 78,
+ 78, 65, 128, 65, 69, 69, 128, 65, 69, 68, 65, 45, 80, 73, 76, 76, 65,
+ 128, 65, 69, 68, 128, 65, 69, 66, 128, 65, 68, 86, 65, 78, 84, 65, 71,
+ 69, 128, 65, 68, 86, 65, 78, 67, 69, 128, 65, 68, 69, 71, 128, 65, 68,
+ 69, 199, 65, 68, 68, 82, 69, 83, 83, 69, 196, 65, 68, 68, 82, 69, 83,
+ 211, 65, 68, 68, 65, 75, 128, 65, 68, 65, 203, 65, 67, 85, 84, 69, 45,
+ 77, 65, 67, 82, 79, 78, 128, 65, 67, 85, 84, 69, 45, 71, 82, 65, 86, 69,
+ 45, 65, 67, 85, 84, 69, 128, 65, 67, 85, 84, 197, 65, 67, 84, 85, 65, 76,
+ 76, 217, 65, 67, 84, 73, 86, 65, 84, 197, 65, 67, 82, 79, 80, 72, 79, 78,
+ 73, 195, 65, 67, 75, 78, 79, 87, 76, 69, 68, 71, 69, 128, 65, 67, 67, 85,
+ 77, 85, 76, 65, 84, 73, 79, 78, 128, 65, 67, 67, 79, 85, 78, 212, 65, 67,
+ 67, 69, 80, 84, 128, 65, 67, 67, 69, 78, 84, 45, 83, 84, 65, 67, 67, 65,
+ 84, 79, 128, 65, 67, 67, 69, 78, 84, 128, 65, 67, 67, 69, 78, 212, 65,
+ 67, 65, 68, 69, 77, 217, 65, 66, 89, 83, 77, 65, 204, 65, 66, 85, 78, 68,
+ 65, 78, 67, 69, 128, 65, 66, 75, 72, 65, 83, 73, 65, 206, 65, 66, 66, 82,
+ 69, 86, 73, 65, 84, 73, 79, 206, 65, 66, 65, 70, 73, 76, 73, 128, 65, 66,
+ 178, 65, 65, 89, 65, 78, 78, 65, 128, 65, 65, 89, 128, 65, 65, 87, 128,
+ 65, 65, 79, 128, 65, 65, 74, 128, 65, 65, 66, 65, 65, 70, 73, 76, 73,
+ 128, 65, 65, 48, 51, 50, 128, 65, 65, 48, 51, 49, 128, 65, 65, 48, 51,
+ 48, 128, 65, 65, 48, 50, 57, 128, 65, 65, 48, 50, 56, 128, 65, 65, 48,
+ 50, 55, 128, 65, 65, 48, 50, 54, 128, 65, 65, 48, 50, 53, 128, 65, 65,
+ 48, 50, 52, 128, 65, 65, 48, 50, 51, 128, 65, 65, 48, 50, 50, 128, 65,
+ 65, 48, 50, 49, 128, 65, 65, 48, 50, 48, 128, 65, 65, 48, 49, 57, 128,
+ 65, 65, 48, 49, 56, 128, 65, 65, 48, 49, 55, 128, 65, 65, 48, 49, 54,
+ 128, 65, 65, 48, 49, 53, 128, 65, 65, 48, 49, 52, 128, 65, 65, 48, 49,
+ 51, 128, 65, 65, 48, 49, 50, 128, 65, 65, 48, 49, 49, 128, 65, 65, 48,
+ 49, 48, 128, 65, 65, 48, 48, 57, 128, 65, 65, 48, 48, 56, 128, 65, 65,
+ 48, 48, 55, 66, 128, 65, 65, 48, 48, 55, 65, 128, 65, 65, 48, 48, 55,
+ 128, 65, 65, 48, 48, 54, 128, 65, 65, 48, 48, 53, 128, 65, 65, 48, 48,
+ 52, 128, 65, 65, 48, 48, 51, 128, 65, 65, 48, 48, 50, 128, 65, 65, 48,
+ 48, 49, 128, 65, 48, 55, 48, 128, 65, 48, 54, 57, 128, 65, 48, 54, 56,
+ 128, 65, 48, 54, 55, 128, 65, 48, 54, 54, 128, 65, 48, 54, 53, 128, 65,
+ 48, 54, 52, 128, 65, 48, 54, 51, 128, 65, 48, 54, 50, 128, 65, 48, 54,
+ 49, 128, 65, 48, 54, 48, 128, 65, 48, 53, 57, 128, 65, 48, 53, 56, 128,
+ 65, 48, 53, 55, 128, 65, 48, 53, 54, 128, 65, 48, 53, 53, 128, 65, 48,
+ 53, 52, 128, 65, 48, 53, 51, 128, 65, 48, 53, 50, 128, 65, 48, 53, 49,
+ 128, 65, 48, 53, 48, 128, 65, 48, 52, 57, 128, 65, 48, 52, 56, 128, 65,
+ 48, 52, 55, 128, 65, 48, 52, 54, 128, 65, 48, 52, 53, 65, 128, 65, 48,
+ 52, 53, 128, 65, 48, 52, 52, 128, 65, 48, 52, 51, 65, 128, 65, 48, 52,
+ 51, 128, 65, 48, 52, 50, 65, 128, 65, 48, 52, 50, 128, 65, 48, 52, 49,
+ 128, 65, 48, 52, 48, 65, 128, 65, 48, 52, 48, 128, 65, 48, 51, 57, 128,
+ 65, 48, 51, 56, 128, 65, 48, 51, 55, 128, 65, 48, 51, 54, 128, 65, 48,
+ 51, 53, 128, 65, 48, 51, 52, 128, 65, 48, 51, 51, 128, 65, 48, 51, 50,
+ 65, 128, 65, 48, 49, 55, 65, 128, 65, 48, 49, 52, 65, 128, 65, 48, 48,
+ 54, 66, 128, 65, 48, 48, 54, 65, 128, 65, 48, 48, 53, 65, 128, 65, 45,
+ 69, 85, 128, 45, 85, 205, 45, 80, 72, 82, 85, 128, 45, 75, 72, 89, 85,
+ 196, 45, 75, 72, 89, 73, 76, 128, 45, 68, 90, 85, 196, 45, 67, 72, 65,
+ 210, 45, 67, 72, 65, 76, 128,
};
-static unsigned short lexicon_offset[] = {
- 0, 0, 6, 10, 15, 23, 27, 34, 39, 41, 44, 50, 63, 75, 84, 90, 95, 103,
- 112, 116, 121, 129, 134, 137, 144, 149, 157, 163, 169, 177, 184, 194,
- 199, 202, 209, 212, 217, 226, 232, 241, 248, 255, 260, 264, 273, 281,
- 282, 288, 294, 302, 308, 314, 320, 328, 333, 340, 344, 347, 349, 355,
- 362, 369, 377, 380, 385, 390, 396, 398, 403, 412, 419, 425, 286, 430,
- 432, 434, 438, 443, 446, 452, 456, 464, 474, 481, 113, 490, 498, 503,
- 511, 516, 524, 535, 538, 542, 555, 565, 571, 574, 575, 582, 584, 593,
- 301, 596, 600, 608, 613, 615, 619, 622, 628, 635, 642, 647, 651, 660,
- 670, 679, 688, 692, 698, 706, 713, 721, 725, 731, 735, 743, 752, 756,
- 627, 763, 771, 775, 784, 789, 792, 796, 804, 813, 816, 821, 831, 840,
- 847, 200, 733, 850, 857, 580, 865, 873, 879, 884, 891, 894, 900, 906,
- 911, 916, 929, 22, 934, 937, 947, 952, 956, 962, 971, 974, 984, 993, 997,
- 1002, 1007, 1012, 1019, 1027, 1030, 1040, 1043, 1045, 1053, 1057, 1061,
- 93, 1064, 1069, 1075, 1077, 1086, 1089, 1092, 1097, 1099, 1105, 1111,
- 1113, 1117, 331, 1120, 1128, 1132, 1136, 1141, 1144, 1150, 1154, 1161,
- 1164, 1170, 80, 1176, 1178, 1181, 1183, 657, 1188, 1196, 1203, 1213,
- 1222, 1230, 1232, 1237, 1242, 1248, 1253, 1258, 1262, 1267, 1273, 1278,
- 1283, 1287, 1292, 1297, 1301, 1306, 1311, 1316, 1322, 1328, 1334, 1339,
- 1343, 1348, 1353, 1358, 1362, 1367, 1372, 1377, 1382, 1233, 1238, 1243,
- 1249, 1254, 1386, 1259, 1392, 1401, 1263, 1405, 1268, 1274, 1279, 1409,
- 1414, 1419, 1423, 1427, 1433, 1437, 1284, 1440, 1444, 1288, 1450, 1293,
- 1454, 1458, 1298, 1462, 1467, 1471, 1474, 1478, 1302, 1307, 1312, 1483,
- 1489, 1495, 1501, 1317, 1329, 1335, 1505, 1509, 1513, 1516, 1340, 1520,
- 1522, 1527, 1532, 1538, 1543, 1548, 1552, 1557, 1562, 1567, 1572, 1578,
- 1583, 1588, 1594, 1600, 1605, 1609, 1614, 1619, 1624, 1629, 1633, 1641,
- 1645, 1650, 1655, 1660, 1665, 1669, 1672, 1677, 1682, 1687, 1692, 1698,
- 1703, 1707, 1344, 1710, 1715, 1720, 1349, 1724, 1728, 1735, 1354, 1742,
- 1359, 1746, 1748, 1754, 1363, 1759, 1768, 1368, 1773, 1779, 1373, 1784,
- 1789, 1792, 1797, 1801, 1805, 1809, 1812, 1378, 1383, 950, 1816, 1818,
- 1819, 1823, 1827, 1832, 1836, 1840, 1844, 1847, 1852, 1856, 1861, 1865,
- 1869, 1874, 1878, 1881, 1885, 1899, 1903, 1907, 1910, 1915, 1919, 1923,
- 1928, 1933, 1938, 1942, 1947, 1951, 1956, 1963, 1969, 1974, 1979, 1985,
- 1990, 1995, 1998, 1250, 2000, 2007, 2015, 2025, 2034, 2048, 2052, 2065,
- 2073, 2077, 2082, 2086, 2090, 2095, 2100, 2104, 2107, 2111, 2118, 2125,
- 2131, 2136, 2141, 2144, 2146, 2149, 2155, 2159, 2164, 2168, 2172, 1750,
- 1756, 2177, 2181, 2184, 2189, 2194, 2199, 2203, 2210, 2215, 2218, 2225,
- 2231, 2235, 2239, 2243, 2249, 2255, 2269, 2286, 2295, 2300, 2304, 2309,
- 2314, 2318, 2330, 2336, 1959, 2342, 2345, 2352, 2356, 2360, 2364, 1966,
- 2368, 2373, 2378, 2382, 2390, 2394, 2398, 2402, 2407, 2412, 2417, 2421,
- 2426, 2431, 2435, 2440, 2444, 2447, 2451, 2455, 2460, 2464, 2468, 2477,
- 2481, 2485, 2491, 2496, 2503, 2507, 2511, 2516, 2520, 2525, 2531, 2536,
- 2540, 2121, 2544, 2549, 2555, 2560, 2564, 2569, 2574, 2578, 2584, 2589,
- 2595, 2599, 2605, 2610, 1260, 62, 2616, 2620, 2624, 2628, 2633, 2637,
- 2641, 2645, 2649, 2654, 2658, 2663, 2667, 2670, 2674, 2679, 2683, 2688,
- 2692, 2696, 2701, 2705, 2708, 2721, 2725, 2729, 2733, 2737, 2741, 2744,
- 2748, 2752, 2757, 2761, 2766, 2771, 2776, 2780, 2783, 2786, 2792, 2796,
- 2800, 2803, 2807, 2811, 1059, 445, 2814, 2819, 2823, 2826, 2831, 2836,
- 2840, 2845, 2849, 2852, 2858, 2865, 2871, 2876, 2880, 2885, 2889, 2899,
- 2903, 2907, 2912, 2917, 2927, 1848, 2932, 2936, 2939, 2945, 2952, 2956,
- 648, 790, 2960, 2967, 2973, 2978, 2984, 2989, 1857, 2993, 485, 2999,
- 3010, 1862, 3014, 3019, 3034, 3040, 3047, 3057, 3063, 3068, 3074, 3077,
- 3081, 3088, 3093, 3097, 3101, 3105, 3109, 3114, 3120, 2675, 3125, 3137,
- 1554, 3144, 3147, 3151, 3155, 3158, 3162, 3167, 3171, 3175, 3181, 3187,
- 3192, 3198, 3202, 3210, 3220, 3226, 3231, 3240, 3248, 3255, 3259, 3268,
- 3272, 3277, 3282, 3286, 3294, 3299, 3303, 1870, 1402, 318, 402, 3309,
- 3315, 3319, 3323, 3328, 3332, 3336, 3339, 3343, 3347, 3351, 3356, 3360,
- 3364, 3306, 3370, 3377, 3381, 3394, 3398, 3402, 3406, 3410, 3414, 3420,
- 3427, 3431, 3439, 3448, 3454, 3459, 3462, 3466, 3470, 3480, 3490, 3498,
- 3505, 3512, 3518, 3524, 3531, 3535, 3540, 3544, 3552, 3557, 3565, 3570,
- 3575, 3579, 3584, 3591, 3594, 3598, 3602, 3605, 3611, 3617, 3621, 3632,
- 3642, 3657, 3672, 3687, 3702, 3717, 3732, 3747, 3762, 3777, 3792, 3807,
- 3822, 3837, 3852, 3867, 3882, 3897, 3912, 3927, 3942, 3957, 3972, 3987,
- 4002, 4017, 4032, 4047, 4062, 4077, 4092, 4107, 4122, 4137, 4152, 4167,
- 4182, 4197, 4212, 4227, 4242, 4257, 4272, 4287, 4302, 4317, 4332, 4347,
- 4362, 4377, 4386, 4395, 4400, 4406, 4410, 4415, 4419, 4422, 4426, 4429,
- 4434, 285, 388, 4440, 4448, 4452, 4456, 4459, 4465, 4469, 4477, 4483,
- 4488, 4495, 4502, 4508, 4513, 4520, 4526, 4530, 4535, 4542, 4548, 2693,
- 4458, 4552, 4556, 4560, 4563, 4570, 4573, 4581, 4586, 4591, 4582, 4583,
- 4596, 4602, 4608, 4613, 4618, 4625, 4630, 4634, 4637, 4641, 1904, 454,
- 4645, 4649, 4654, 4660, 4665, 4669, 4672, 4676, 4681, 4685, 4692, 4696,
- 4700, 4704, 913, 633, 4707, 4715, 4722, 4729, 4735, 4742, 4750, 4757,
- 4764, 4769, 4781, 1280, 1410, 1415, 4792, 1420, 4796, 4800, 4809, 4818,
- 4824, 4829, 4833, 4839, 4844, 4848, 4857, 4866, 4875, 4884, 4889, 4894,
- 4906, 2846, 4910, 4912, 4917, 4921, 4930, 4938, 1424, 4919, 4944, 4948,
- 4951, 4955, 4964, 4970, 4975, 4978, 4987, 4993, 5001, 5005, 5009, 5012,
- 5017, 5024, 5030, 5033, 5035, 5038, 5046, 5054, 5057, 5062, 4593, 5065,
- 1964, 1970, 5067, 5075, 1991, 5080, 5084, 5089, 5093, 5097, 5101, 5106,
- 5110, 5115, 5119, 5122, 5125, 5131, 5137, 5143, 5149, 5155, 5161, 5167,
- 5171, 5175, 5179, 5183, 5187, 5192, 5200, 5210, 5215, 5219, 5230, 5243,
- 5254, 5267, 5278, 5290, 5302, 5314, 5327, 5340, 5347, 5353, 5360, 5366,
- 5370, 5375, 5379, 5386, 5394, 5398, 5404, 5414, 5418, 5423, 5430, 5436,
- 4737, 5446, 5450, 5457, 632, 5461, 5465, 5470, 5475, 5480, 5484, 5490,
- 5494, 5498, 5504, 5509, 5513, 1896, 5519, 5527, 5536, 5540, 5546, 5551,
- 5556, 5561, 5567, 5572, 3177, 5577, 5581, 5586, 5591, 5541, 5596, 5600,
- 5607, 5613, 5618, 5622, 5627, 5631, 5640, 5020, 5645, 2404, 5649, 5654,
- 5659, 5547, 5663, 5552, 5557, 5668, 5675, 5682, 5688, 5694, 5700, 5705,
- 5710, 5715, 5562, 5568, 5721, 5727, 5732, 5573, 5737, 1115, 5740, 5748,
- 5754, 5760, 5769, 5774, 5789, 5806, 5825, 5834, 5842, 5857, 5867, 5877,
- 5883, 5895, 5904, 5912, 5919, 5926, 5932, 5937, 5945, 5955, 5962, 5972,
- 5982, 5992, 6001, 6011, 6025, 6040, 6049, 6057, 6062, 6066, 6075, 6085,
- 6095, 6105, 6110, 6114, 6123, 6133, 6144, 6157, 6170, 6182, 6187, 6193,
- 6196, 6200, 6205, 6209, 6217, 6226, 6234, 6241, 6252, 6256, 6259, 6265,
- 6269, 6275, 6282, 6287, 6294, 6301, 6308, 6315, 6322, 6329, 6334, 5802,
- 6339, 6348, 6352, 6364, 6368, 6371, 6375, 6379, 6383, 6387, 6392, 6397,
- 6402, 6408, 6413, 6418, 5426, 6423, 6427, 6431, 6435, 6440, 6445, 6451,
- 6455, 6463, 6467, 6470, 6476, 6483, 6487, 6490, 6495, 3205, 6501, 6509,
- 6515, 5441, 6520, 6525, 6529, 6542, 6556, 6563, 6569, 6573, 6578, 6584,
- 6589, 4853, 6594, 6597, 6602, 6606, 2409, 802, 6612, 6616, 6622, 6628,
- 6633, 6638, 6646, 6652, 6665, 6673, 6677, 6685, 6692, 6704, 6714, 6721,
- 6728, 6737, 6746, 6754, 6760, 6765, 6770, 6776, 5582, 6781, 6784, 6791,
- 6797, 6810, 6821, 6828, 6834, 6843, 6851, 6858, 6864, 6870, 6875, 6879,
- 6884, 6890, 6898, 5587, 6905, 6910, 6917, 6923, 6928, 6936, 6944, 6951,
- 6955, 6969, 6979, 6984, 6988, 6999, 7005, 7010, 7015, 7019, 5592, 7024,
- 7027, 7039, 7046, 7051, 7055, 7060, 7064, 7071, 7077, 7084, 5542, 7089,
- 2414, 8, 7096, 7101, 7105, 7111, 7122, 7132, 7141, 7153, 7158, 7162,
- 7170, 7184, 7188, 7191, 7199, 7206, 7214, 7218, 7229, 7233, 7240, 7245,
- 7249, 7254, 7258, 7262, 7265, 7271, 7277, 7284, 7294, 7303, 7310, 5601,
- 5608, 5614, 5619, 7316, 5623, 7322, 7325, 7332, 7347, 7363, 7378, 897,
- 383, 7383, 7391, 7398, 7404, 7409, 7414, 5632, 7416, 7420, 7430, 7435,
- 7439, 7448, 7452, 7455, 7462, 7466, 7469, 7477, 7484, 7492, 7496, 7500,
- 7506, 7510, 7514, 7518, 7524, 7528, 7535, 7539, 7544, 7548, 7555, 7561,
- 7569, 7575, 7585, 7590, 7595, 7599, 7607, 3131, 7615, 7620, 7624, 7628,
- 7631, 7639, 7646, 7650, 7655, 7659, 7670, 7676, 7680, 7683, 7690, 5641,
- 7695, 7699, 1712, 3563, 606, 133, 7706, 7710, 7715, 7720, 7724, 7728,
- 7732, 7737, 7741, 7746, 7750, 7753, 7757, 7761, 7766, 7776, 7782, 7786,
- 7790, 7797, 7805, 7814, 7825, 7832, 7839, 7848, 7857, 7866, 7875, 7884,
- 7893, 7903, 7913, 7923, 7933, 7943, 7952, 7962, 7972, 7982, 7992, 8002,
- 8012, 8022, 8031, 8041, 8051, 8061, 8071, 8081, 8091, 8100, 8110, 8120,
- 8130, 8140, 8150, 8160, 8170, 8180, 8190, 8199, 8209, 8219, 8229, 8239,
- 8249, 8259, 8269, 8279, 8289, 8299, 8308, 8314, 8318, 8321, 8325, 8330,
- 8337, 8343, 8348, 8352, 8357, 8361, 8365, 5650, 8371, 8376, 8385, 5655,
- 8390, 5660, 8393, 8397, 8401, 8411, 8416, 8425, 8433, 8440, 8445, 8452,
- 8457, 8461, 8464, 8475, 8485, 8494, 8502, 8513, 8525, 8535, 8539, 8544,
- 8549, 8553, 8558, 8562, 8565, 8572, 8582, 8591, 8598, 8602, 8608, 8613,
- 8618, 8622, 8631, 8636, 8642, 8647, 8651, 8660, 8668, 8676, 8683, 8691,
- 8703, 8714, 8724, 8731, 8737, 8746, 8757, 8766, 8775, 8783, 8790, 8799,
- 8807, 4610, 8811, 8813, 8818, 8824, 8832, 8839, 8848, 8857, 8866, 8875,
- 8884, 8893, 8902, 8911, 8921, 8931, 8940, 8954, 8961, 8969, 8978, 8984,
- 8993, 9001, 9010, 9023, 9031, 9038, 9051, 9057, 9066, 9075, 9080, 9084,
- 9090, 9096, 9103, 5440, 9108, 9113, 9120, 9125, 9130, 9134, 9140, 9148,
- 9156, 9163, 9171, 9179, 9184, 9190, 9195, 9199, 9210, 9218, 9224, 9229,
- 9238, 9244, 9249, 9258, 9272, 3090, 9276, 9281, 9286, 9292, 9297, 9302,
- 9306, 9311, 9316, 4609, 9321, 9326, 9331, 9336, 9340, 9345, 9350, 9355,
- 9361, 9367, 9372, 9376, 9381, 9386, 5664, 9391, 9396, 9401, 9406, 9418,
- 9428, 9439, 9450, 9461, 9473, 9484, 9495, 9506, 9517, 9522, 2062, 9526,
- 9529, 9535, 9543, 9551, 9556, 9564, 9572, 9579, 9586, 9591, 9597, 9604,
- 9612, 9619, 9631, 9636, 7341, 9642, 9651, 9658, 9664, 9672, 9679, 9686,
- 9692, 9701, 9708, 9716, 9722, 9729, 9737, 9742, 2893, 1081, 9749, 9322,
- 9752, 9758, 9762, 9774, 9779, 9786, 9792, 9797, 9327, 9332, 9801, 9805,
- 9809, 9817, 9824, 9831, 9848, 9852, 9855, 9863, 2949, 9867, 9869, 9877,
- 9887, 9893, 9898, 9902, 9908, 9913, 9916, 9923, 9929, 9935, 9940, 9947,
- 9953, 9958, 9965, 9971, 9978, 9984, 9990, 9996, 10004, 10010, 10016,
- 10021, 10028, 10033, 10037, 10042, 10049, 10054, 10060, 10063, 10067,
- 10079, 10085, 10090, 10097, 10103, 10109, 10118, 10126, 10133, 10143,
- 10153, 10161, 9346, 10164, 9351, 10172, 10184, 10197, 10212, 10223,
- 10241, 10252, 10265, 10276, 10287, 10299, 10312, 10323, 10334, 10345,
- 2264, 10358, 10362, 10370, 10381, 10388, 10394, 10398, 10404, 10407,
- 10417, 10425, 10432, 10440, 10445, 10450, 10457, 10463, 10468, 10473,
- 10477, 10481, 10487, 10493, 10498, 10503, 10508, 10512, 9356, 9362, 9368,
- 10516, 10524, 10533, 10540, 5558, 10544, 10546, 10551, 10556, 10562,
- 10567, 10572, 10577, 10581, 10587, 10592, 10598, 10603, 10608, 10614,
- 10619, 10624, 10629, 10635, 10640, 10645, 10651, 10657, 10662, 10669,
- 10676, 10681, 10685, 10689, 10692, 10700, 10705, 10710, 10720, 10725,
- 10732, 10738, 10748, 10762, 10776, 10790, 10804, 10819, 10834, 10851,
- 10869, 10882, 10888, 10893, 10898, 10904, 10909, 10914, 10918, 10922,
- 10927, 10931, 10937, 10942, 10947, 10951, 10956, 10963, 10968, 10972,
- 10978, 10983, 10988, 10992, 10998, 11003, 11008, 11015, 11020, 11024,
- 11028, 11033, 11038, 11044, 11049, 11058, 11066, 11073, 11080, 11086,
- 11092, 11097, 11102, 11108, 11113, 11119, 11124, 11130, 11136, 11143,
- 11149, 11154, 11159, 5706, 11168, 11171, 11177, 11182, 11192, 11199,
- 11204, 11210, 11215, 11221, 11226, 11232, 11237, 11245, 11252, 11257,
- 11263, 11267, 11276, 11287, 11294, 11302, 11308, 11315, 11321, 11326,
- 11330, 11336, 11341, 11346, 11351, 5711, 4626, 2428, 11355, 11359, 11363,
- 11367, 11371, 11374, 11381, 11389, 9377, 11396, 11406, 11414, 11421,
- 11431, 11440, 8490, 8499, 11445, 11455, 11470, 11476, 11483, 11490,
- 11496, 11506, 11516, 9382, 11525, 11531, 11537, 11545, 11553, 11558,
- 11567, 11575, 11587, 11597, 11607, 11617, 11626, 11638, 11648, 11658,
- 11669, 11674, 11686, 11698, 11710, 11722, 11734, 11746, 11758, 11770,
- 11782, 11794, 11805, 11817, 11829, 11841, 11853, 11865, 11877, 11889,
- 11901, 11913, 11925, 11936, 11948, 11960, 11972, 11984, 11996, 12008,
- 12020, 12032, 12044, 12056, 12067, 12079, 12091, 12103, 12115, 12127,
- 12139, 12151, 12163, 12175, 12187, 12198, 12210, 12222, 12234, 12246,
- 12258, 12270, 12282, 12294, 12306, 12318, 12329, 12341, 12353, 12365,
- 12377, 12389, 12401, 12413, 12425, 12437, 12449, 12460, 12472, 12484,
- 12496, 12508, 12520, 12532, 12544, 12556, 12568, 12580, 12591, 12603,
- 12615, 12627, 12639, 12652, 12665, 12678, 12691, 12704, 12717, 12730,
- 12742, 12755, 12768, 12781, 12794, 12807, 12820, 12833, 12846, 12859,
- 12872, 12884, 12897, 12910, 12923, 12936, 12949, 12962, 12975, 12988,
- 13001, 13014, 13026, 13039, 13052, 13065, 13078, 13091, 13104, 13117,
- 13130, 13143, 13156, 13168, 13181, 13194, 13207, 13220, 13233, 13246,
- 13259, 13272, 13285, 13298, 13310, 13323, 13336, 13349, 13362, 13375,
- 13388, 13401, 13414, 13427, 13440, 13452, 13463, 13476, 13489, 13502,
- 13515, 13528, 13541, 13554, 13567, 13580, 13593, 13605, 13618, 13631,
- 13644, 13657, 13670, 13683, 13696, 13709, 13722, 13735, 13747, 13760,
- 13773, 13786, 13799, 13812, 13825, 13838, 13851, 13864, 13877, 13889,
- 13902, 13915, 13928, 13941, 13954, 13967, 13980, 13993, 14006, 14019,
- 14031, 14044, 14057, 14070, 14083, 14096, 14109, 14122, 14135, 14148,
- 14161, 14173, 14186, 14199, 14212, 14225, 14238, 14251, 14264, 14277,
- 14290, 14303, 14315, 14328, 14341, 14354, 14367, 14380, 14393, 14406,
- 14419, 14432, 14445, 14457, 14470, 14483, 14496, 14509, 14522, 14535,
- 14548, 14561, 14574, 14587, 14599, 14612, 14625, 14638, 14651, 14664,
- 14677, 14690, 14703, 14716, 14729, 14741, 14754, 14767, 14780, 14793,
- 14806, 14819, 14832, 14845, 14858, 14871, 14883, 14894, 14902, 14909,
- 14915, 14919, 14925, 14931, 14939, 14945, 14950, 5563, 14954, 14961,
- 14969, 14976, 14983, 6804, 14990, 14999, 15004, 4642, 15011, 15016,
- 15021, 15029, 15036, 15043, 15049, 15058, 15067, 15073, 15078, 15086,
- 15092, 15102, 15111, 15115, 15122, 15126, 15131, 15137, 15145, 15149,
- 9392, 15158, 15162, 15168, 5410, 15175, 15181, 15186, 15190, 15194, 5941,
- 15199, 15207, 15214, 15223, 15230, 15237, 15243, 15247, 15253, 15259,
- 15267, 15273, 15280, 15286, 15295, 15303, 15312, 15317, 15328, 15333,
- 15338, 15343, 4815, 15347, 15354, 15359, 15367, 15379, 15384, 15388,
- 15391, 15397, 15403, 15408, 15412, 15415, 15426, 15431, 5733, 15438,
- 5574, 5738, 15443, 15447, 111, 15455, 15459, 15463, 15467, 15472, 15476,
- 15480, 7845, 15484, 15490, 15495, 15499, 15503, 15511, 15515, 15520,
- 15525, 15529, 15535, 15540, 15544, 15549, 15554, 15558, 15565, 15569,
- 15574, 15578, 15581, 15594, 15599, 15608, 15613, 15616, 2297, 2302,
- 15620, 15626, 15631, 15636, 15641, 15647, 15652, 15657, 15661, 15666,
- 15671, 15677, 15682, 15687, 15693, 15698, 15702, 15707, 15712, 15717,
- 15721, 15726, 15731, 15736, 15741, 15745, 15749, 15754, 2437, 15703,
- 15758, 15765, 6020, 15777, 15785, 15708, 15792, 15797, 15713, 15805,
- 15810, 15815, 15820, 15824, 15829, 15832, 15836, 15842, 15847, 5432,
- 1717, 1722, 15851, 15857, 15863, 15868, 15872, 15876, 15880, 15883,
- 15889, 15896, 15904, 15910, 15916, 15921, 15926, 9614, 10139, 15930,
- 15942, 15945, 15952, 15956, 15967, 15976, 15989, 15999, 16013, 16025,
- 16039, 16049, 16055, 16073, 16092, 16105, 16119, 16135, 16146, 16163,
- 16181, 16193, 16207, 16221, 16233, 16250, 16269, 16281, 16299, 16312,
- 16326, 16346, 6536, 16358, 16363, 16368, 16374, 16379, 2079, 16383,
- 16389, 16393, 16396, 16400, 16408, 16414, 15722, 16418, 16429, 16435,
- 16441, 16450, 16457, 16464, 16470, 16479, 16487, 16497, 16502, 16511,
- 16520, 16531, 16542, 16552, 16557, 16561, 16569, 16579, 16590, 16598,
- 16605, 16611, 16616, 15732, 16620, 16629, 16634, 16643, 16651, 16661,
- 16670, 16676, 16682, 15737, 15742, 16686, 16696, 958, 9568, 3031, 16705,
- 16714, 16722, 16733, 16744, 16754, 16763, 16772, 16781, 16787, 16796,
- 16804, 5718, 16810, 16813, 16817, 16822, 16827, 16835, 15750, 16839,
- 16845, 16849, 16855, 16861, 2872, 16869, 16874, 16878, 16882, 16889,
- 16893, 16901, 16907, 16912, 16916, 16921, 16927, 16938, 16943, 16947,
- 16958, 16962, 16966, 16969, 16973, 16978, 16982, 16986, 829, 16990, 5,
- 16996, 17000, 17004, 17008, 17013, 17017, 17021, 17025, 17029, 17034,
- 17038, 17043, 17047, 17050, 17054, 17059, 17063, 17068, 17072, 17076,
- 17080, 17085, 17089, 17093, 17103, 17108, 17112, 17116, 17121, 17126,
- 17135, 17140, 17145, 17149, 17153, 17165, 17174, 17183, 17189, 17193,
- 17203, 17212, 17220, 17226, 17230, 17237, 17247, 17256, 17264, 17272,
- 17279, 17288, 17297, 17305, 17310, 17314, 17318, 17321, 17323, 17327,
- 17331, 17336, 17340, 17344, 17347, 17351, 17354, 17358, 17361, 17365,
- 17369, 17373, 17377, 17382, 17387, 17392, 17396, 17399, 17404, 17410,
- 17415, 17421, 17426, 17430, 17434, 17438, 17443, 17447, 17452, 17456,
- 17463, 17467, 17470, 17474, 17480, 17486, 17490, 17494, 17499, 17506,
- 17512, 17516, 17525, 17529, 17533, 17536, 17542, 17547, 17553, 17558,
- 1776, 2449, 17562, 17563, 17566, 17570, 17574, 17579, 17583, 17587,
- 17590, 17595, 17599, 17602, 17607, 17611, 17616, 17620, 9587, 17625,
- 17628, 17631, 17635, 17639, 17646, 17651, 17658, 17662, 17666, 17671,
- 17676, 17680, 17685, 17697, 17708, 17712, 17715, 17721, 4743, 2001,
- 17725, 17741, 5796, 17761, 17770, 17786, 17790, 17793, 17799, 17809,
- 17815, 17830, 17842, 17853, 17861, 17870, 17876, 17885, 17895, 17906,
- 17917, 17926, 17935, 17943, 17950, 17958, 17964, 17969, 17975, 17980,
- 17988, 18000, 18012, 18026, 18033, 18042, 18051, 18059, 18067, 18075,
- 18082, 18091, 18099, 18109, 18118, 18128, 18137, 18146, 18154, 18159,
- 18163, 18166, 18170, 18174, 18178, 18184, 18190, 9632, 18195, 18207,
- 18213, 6149, 18224, 18234, 18243, 18247, 18250, 18254, 18260, 18264,
- 18269, 18278, 18285, 4784, 18292, 18300, 18307, 18313, 18318, 18324,
- 18330, 18338, 18342, 18345, 18347, 18167, 18356, 18362, 18372, 18377,
- 18383, 18388, 18393, 18398, 18405, 18414, 18423, 18429, 18434, 18440,
- 18445, 18452, 18457, 18461, 18471, 18475, 18480, 18490, 18499, 18503,
- 18510, 18516, 18521, 18528, 18532, 8380, 18540, 18547, 18554, 15531,
- 18096, 18559, 18563, 18568, 18581, 18595, 18611, 18629, 18646, 18664,
- 16152, 18681, 18693, 18707, 10228, 16169, 18719, 18731, 9444, 18745,
- 18750, 18755, 18761, 18765, 18770, 18780, 18786, 6473, 18792, 18794,
- 18799, 18807, 18811, 18401, 18817, 18824, 18834, 18839, 18843, 18846,
- 18852, 18860, 18870, 10257, 18884, 18891, 18895, 18898, 18903, 18907,
- 18917, 18922, 18927, 18935, 18944, 18949, 10262, 18953, 18956, 18959,
- 18975, 18983, 18991, 18999, 19004, 19008, 19014, 19020, 19023, 19029,
- 19041, 19048, 19055, 19069, 19082, 19091, 19103, 19114, 19123, 19132,
- 19140, 19151, 4766, 19158, 19164, 19169, 19175, 19185, 19194, 19200,
- 19205, 19212, 19224, 19231, 19240, 19248, 19254, 19260, 19265, 19269,
- 19272, 19278, 19283, 19287, 19298, 19307, 19315, 19320, 19326, 9981,
- 5169, 19331, 19334, 19337, 19343, 19351, 19359, 19363, 19368, 19371,
- 19380, 19388, 19399, 19403, 19409, 19415, 19419, 19425, 19447, 19471,
- 19478, 19484, 19495, 19513, 19520, 19524, 19533, 19546, 19554, 19566,
- 19577, 19587, 19601, 19610, 19618, 19630, 5813, 19641, 19652, 19664,
- 19674, 19683, 19688, 19692, 19700, 19705, 19709, 19712, 19720, 19728,
- 19737, 19746, 2278, 19752, 19761, 19771, 19781, 19790, 19795, 19806,
- 19817, 19821, 19831, 19840, 19850, 19860, 19868, 19877, 19884, 19892,
- 19899, 19908, 19912, 19920, 19927, 19934, 19945, 19960, 19967, 19977,
- 19986, 9070, 19992, 19997, 20001, 20009, 20015, 20024, 20029, 20039,
- 1194, 20043, 1256, 583, 20046, 20055, 18106, 20062, 20067, 20071, 20077,
- 1289, 444, 317, 20082, 20091, 20100, 20108, 20119, 20128, 20136, 20139,
- 20147, 20155, 9600, 20160, 20166, 3399, 20171, 20175, 20181, 20185,
- 20192, 1451, 20198, 5881, 20205, 20215, 20223, 20229, 20238, 20246,
- 20254, 20261, 20268, 1486, 20275, 20281, 20292, 20303, 20311, 20318,
- 20327, 20335, 20342, 20349, 20362, 20373, 20392, 1294, 20396, 20401,
- 20409, 2908, 20413, 20418, 1455, 17345, 20428, 20432, 20437, 20441, 2854,
- 20447, 20455, 2909, 239, 20463, 20471, 20479, 20486, 20492, 20497, 20504,
- 20507, 20513, 18265, 20519, 88, 20523, 20527, 20533, 20538, 20544, 2012,
- 20548, 20552, 20555, 20558, 20565, 20571, 15817, 2953, 10920, 20576,
- 20579, 20587, 20590, 20602, 20607, 20611, 20619, 20626, 20632, 20639,
- 20646, 20649, 20653, 20657, 1459, 20667, 2332, 2132, 20672, 20677, 20681,
- 20686, 20691, 20697, 20702, 20707, 20711, 20716, 20722, 20727, 20732,
- 20738, 20743, 20747, 20752, 20757, 20762, 20767, 20772, 20778, 20784,
- 20789, 20793, 20798, 20802, 20807, 20812, 20817, 20821, 20826, 20831,
- 20836, 20841, 20847, 20853, 20858, 20862, 20867, 20872, 20877, 20882,
- 20887, 20891, 20896, 20901, 20906, 20910, 20915, 20923, 20929, 20935,
- 20941, 20946, 20950, 20953, 20957, 20962, 20966, 20971, 20975, 20978,
- 20983, 15226, 20202, 20988, 20992, 20997, 21001, 21004, 21007, 21011,
- 21016, 21024, 21028, 21033, 21037, 21041, 21046, 21051, 21055, 21061,
- 21066, 21073, 21080, 21084, 21087, 21093, 21102, 21109, 21113, 21118,
- 21122, 21128, 21132, 21138, 7242, 10484, 21143, 21148, 21153, 21159,
- 21164, 21169, 21173, 21178, 21183, 21189, 21194, 21199, 21203, 21208,
- 21213, 21217, 21222, 21227, 21232, 21236, 21241, 21246, 21251, 21255,
- 21259, 21263, 21272, 21278, 21284, 21293, 21301, 21306, 21310, 21317,
- 21323, 21327, 21332, 21341, 21346, 1485, 21352, 21355, 21359, 15858,
- 15864, 21365, 21369, 21380, 21391, 21403, 21410, 21417, 21422, 21426,
- 14928, 626, 15225, 21434, 21438, 21443, 21449, 21454, 21460, 21465,
- 21471, 21476, 2386, 2816, 21480, 21483, 21488, 21493, 21499, 21504,
- 21509, 21513, 21518, 21524, 21529, 21534, 21540, 21545, 21549, 21554,
- 21559, 21564, 21569, 21573, 21578, 21583, 21588, 21594, 21600, 21606,
- 21611, 21615, 21620, 2969, 21624, 21627, 4825, 21631, 21637, 21644, 4834,
- 21648, 21655, 21661, 21670, 21678, 21682, 21689, 21695, 21699, 21702,
- 21711, 21719, 21723, 21733, 21743, 21749, 21759, 21764, 21777, 21791,
- 21802, 21814, 21828, 21841, 21853, 9455, 21865, 21870, 21875, 21879,
- 21883, 21887, 1765, 19112, 21891, 21896, 21901, 21905, 21908, 21914,
- 21920, 6277, 10168, 21925, 21930, 21935, 21444, 21940, 21945, 21951,
- 21450, 21956, 21959, 21455, 21964, 21970, 21976, 21461, 21981, 21986,
- 21992, 21997, 22002, 22008, 22014, 22019, 22024, 22028, 22033, 22038,
- 22043, 22051, 22055, 22060, 22065, 22069, 22074, 22079, 22084, 21466,
- 21472, 22090, 2174, 224, 22093, 22096, 22100, 22104, 22112, 22119, 22126,
- 22130, 22133, 22139, 22147, 22151, 22155, 22158, 22165, 22169, 22176,
- 22184, 22192, 22199, 22203, 689, 271, 22215, 22220, 22225, 22231, 22236,
- 2980, 22241, 22246, 22251, 22256, 22261, 15938, 22266, 22271, 22276,
- 22281, 22287, 22292, 22296, 22301, 22306, 22311, 22315, 22320, 22325,
- 15781, 2986, 22330, 22335, 22340, 22346, 22351, 22356, 22360, 22365,
- 22370, 22376, 22381, 22386, 22390, 22395, 22400, 22405, 22409, 22414,
- 22419, 22424, 22430, 22436, 22441, 22445, 22450, 22455, 22460, 22464,
- 22472, 22478, 22482, 22489, 10815, 22495, 22502, 22510, 22517, 22523,
- 22535, 22541, 22545, 22549, 22160, 22553, 22564, 22569, 22574, 22579,
- 22583, 22588, 15869, 22592, 15239, 22597, 22602, 22608, 22613, 22617,
- 22621, 22624, 22630, 22641, 22653, 22658, 22662, 22665, 2387, 300, 22669,
- 22675, 26, 22680, 22684, 22688, 22696, 22700, 22704, 22707, 22712, 22716,
- 22721, 22725, 22730, 22734, 22739, 22743, 22746, 22748, 22751, 22753,
- 22757, 22769, 22778, 22782, 22788, 22793, 22799, 22804, 22809, 22813,
- 22818, 22825, 22830, 22834, 22841, 18104, 18114, 22845, 22850, 22855,
- 22860, 22864, 22871, 4913, 22877, 22886, 22894, 22909, 22923, 22931,
- 22942, 22951, 22956, 22966, 22971, 22975, 22978, 22982, 22986, 22993,
- 22998, 5401, 23008, 23010, 23013, 23017, 23021, 23026, 23032, 23037,
- 23046, 23052, 23057, 23064, 23068, 23075, 23088, 23096, 23100, 23110,
- 23115, 23119, 23123, 23129, 23134, 23144, 23153, 23164, 23172, 23183,
- 23192, 23195, 23199, 23207, 23213, 23221, 23228, 23234, 2092, 23238,
- 23240, 23245, 23250, 23253, 23255, 23259, 23262, 23266, 23270, 23276,
- 23286, 23291, 23297, 23301, 23306, 23319, 18367, 23325, 23334, 11591,
- 21729, 23341, 23346, 23350, 23358, 23365, 23370, 23374, 23378, 23386,
- 23392, 23398, 23403, 23407, 23410, 23415, 16239, 23431, 23443, 23455,
- 16256, 23469, 23481, 10281, 23495, 23500, 23505, 23509, 23516, 23528,
- 23534, 23537, 23542, 23545, 23547, 23551, 23554, 23559, 23564, 23570,
- 23575, 23580, 23586, 23592, 23597, 23601, 23606, 23611, 23616, 23620,
- 23623, 23629, 23634, 23639, 23644, 23648, 23653, 23659, 23664, 23669,
- 23675, 23680, 23685, 23690, 23695, 23700, 23704, 23707, 23713, 23717,
- 23725, 23732, 23740, 23750, 23756, 23762, 23766, 23775, 23780, 23785,
- 6511, 23790, 23797, 23803, 23808, 23816, 23820, 23823, 23834, 23841,
- 23847, 23851, 23854, 23860, 23866, 23874, 20487, 23881, 23889, 23894,
- 23900, 23905, 23909, 23916, 23922, 18380, 23931, 23936, 23944, 23952,
- 5909, 3418, 23959, 23963, 23967, 23971, 23976, 23980, 23984, 23989,
- 23993, 23997, 24001, 24005, 24009, 24012, 24014, 24022, 24026, 24033,
- 24037, 24045, 24052, 24062, 24066, 24070, 24078, 24084, 8593, 24090,
- 24099, 24106, 24114, 24122, 24130, 24137, 24144, 24151, 24158, 24165,
- 24170, 24176, 24193, 24201, 24209, 24216, 416, 24220, 24226, 22947,
- 24232, 24240, 24246, 24252, 24261, 24267, 2941, 15826, 24276, 24283,
- 24288, 24292, 24299, 24307, 24316, 24326, 24332, 24340, 24349, 24357,
- 15571, 24364, 24371, 24377, 24387, 24396, 24407, 24411, 24416, 24422,
- 24428, 24433, 24446, 24459, 24472, 24479, 24485, 24490, 24494, 1465, 83,
- 24498, 24500, 24504, 24508, 24512, 24517, 24521, 5849, 24525, 24531,
- 3629, 24537, 24540, 24545, 24549, 24554, 24558, 24562, 24567, 6372,
- 24571, 24575, 24579, 9954, 24584, 24588, 24593, 24598, 24603, 24607,
- 18384, 24613, 24616, 24620, 24625, 24629, 24635, 24640, 24644, 24648,
- 4945, 4949, 20605, 24651, 24659, 24666, 24670, 316, 24675, 24681, 24687,
- 24691, 24700, 24704, 24709, 24714, 24718, 24724, 24729, 24744, 24759,
- 24774, 24790, 24808, 19756, 24822, 24827, 24831, 23081, 24839, 24843,
- 24852, 24860, 6072, 9756, 24864, 24867, 24870, 4926, 3111, 24875, 24883,
- 24887, 24890, 24894, 24899, 24905, 24910, 24914, 24919, 24923, 24929,
- 24933, 24940, 7550, 24944, 24950, 24957, 24964, 24971, 20095, 4862,
- 24978, 24985, 24992, 24998, 25003, 25010, 25021, 25027, 25032, 25039,
- 25043, 25047, 25057, 25063, 25068, 25073, 25078, 25083, 25087, 25091,
- 25097, 2004, 711, 6388, 25106, 6393, 25111, 6398, 6403, 6409, 25116,
- 25126, 25130, 6414, 25135, 25138, 25143, 25147, 25152, 25159, 25165,
- 25175, 3444, 25184, 25188, 25192, 25202, 25213, 25219, 25225, 25230,
- 25236, 25239, 25246, 25252, 25257, 25264, 25271, 25275, 25285, 25298,
- 25307, 25316, 25327, 25340, 25349, 25354, 6419, 25359, 25367, 25372,
- 4392, 21, 25379, 25384, 11012, 25388, 25391, 25394, 25398, 25406, 25410,
- 25413, 25419, 25425, 25433, 25439, 25446, 25450, 25454, 19923, 25458,
- 25467, 25473, 25478, 25482, 25490, 25496, 25501, 25506, 25510, 25516,
- 25521, 25527, 3216, 25534, 25538, 25541, 9882, 25553, 25564, 25571,
- 25577, 25581, 25587, 25592, 25598, 25603, 25607, 25612, 25617, 25627,
- 25633, 25646, 25651, 25657, 16672, 1468, 855, 25662, 25668, 14, 25676,
- 25683, 25687, 25691, 25699, 25703, 25708, 25712, 25719, 25724, 25728,
- 25733, 25739, 25744, 25750, 25755, 25759, 25763, 25767, 25772, 25776,
- 25781, 25785, 25792, 25797, 25801, 25806, 25810, 25815, 25819, 10029,
- 10034, 25824, 25828, 25831, 25835, 25840, 25844, 25850, 25857, 25862,
- 25872, 25877, 25885, 25889, 25892, 25896, 25901, 25906, 25910, 25915,
- 8604, 25926, 25930, 25933, 25937, 25941, 25944, 25948, 4952, 8620, 25951,
- 25954, 25959, 25963, 25972, 25988, 26004, 26014, 19742, 26021, 26025,
- 26030, 26034, 26038, 26043, 26048, 26052, 26057, 26061, 18966, 26065,
- 26070, 26074, 26081, 26089, 26095, 26102, 26108, 26112, 26118, 26126,
- 26130, 26139, 5830, 26147, 26151, 26159, 26166, 26171, 26175, 26180,
- 18556, 1142, 26184, 26191, 26197, 26202, 26205, 26207, 26214, 26221,
- 26227, 26231, 26234, 26238, 26242, 26246, 26251, 26255, 26259, 26262,
- 26266, 16287, 26285, 6549, 26298, 26304, 26308, 26312, 26319, 26325,
- 26330, 26336, 26346, 26358, 26369, 26374, 26381, 26385, 26388, 10365,
- 10050, 26396, 26400, 26404, 26409, 26414, 26418, 26422, 26425, 4599,
- 19639, 26430, 26434, 26440, 24322, 26446, 26450, 26455, 26462, 26466,
- 10304, 26469, 26476, 862, 26480, 26485, 26490, 26495, 26499, 26504,
- 26510, 26515, 26521, 26526, 26536, 26541, 26546, 15604, 23800, 26551,
- 26554, 26561, 26570, 26574, 26577, 26581, 604, 26586, 26592, 26596,
- 26606, 26615, 26622, 26628, 26632, 26639, 26645, 26652, 26658, 26668,
- 26676, 26682, 26688, 26693, 26697, 26704, 26710, 26717, 26247, 478, 1109,
- 26723, 26728, 26731, 26737, 26745, 1397, 26750, 26754, 26761, 26767,
- 26771, 26776, 26785, 26795, 26801, 26818, 26822, 26831, 26839, 26845,
- 26850, 26857, 26863, 26871, 26876, 26884, 26903, 16332, 26917, 26933,
- 26947, 26953, 26958, 26963, 26968, 26974, 26979, 26983, 26990, 26995,
- 298, 2473, 27002, 27007, 19856, 26860, 27012, 27017, 27025, 27029, 27032,
- 27038, 27042, 19827, 27045, 27049, 27052, 27057, 27061, 27066, 27071,
- 27075, 27080, 27084, 27088, 27093, 27099, 18940, 27104, 27108, 10470,
- 441, 43, 21484, 21489, 21494, 21500, 21505, 21510, 27111, 21514, 27115,
- 21519, 21525, 27119, 21530, 21535, 27127, 27132, 21541, 27137, 27142,
- 27147, 27152, 27158, 27164, 21546, 27177, 27183, 21550, 21555, 27187,
- 21560, 21565, 27190, 27195, 27199, 21384, 27205, 8769, 27212, 27217,
- 21570, 27221, 27226, 27231, 27236, 27240, 27245, 27250, 27256, 27261,
- 27266, 27272, 27278, 27283, 27287, 27292, 27297, 27302, 27306, 27311,
- 27316, 27321, 27327, 27333, 27339, 27344, 27348, 27353, 27357, 21574,
- 21579, 21584, 27361, 27365, 21589, 21595, 21601, 21607, 27377, 18282,
- 27381, 27385, 27390, 27395, 27399, 27409, 27414, 27419, 27423, 27427,
- 27430, 27438, 21616, 1475, 27443, 27451, 27460, 27464, 27472, 27480,
- 27496, 27501, 1739, 7688, 27505, 2509, 27517, 27518, 27526, 27533, 27538,
- 27545, 1058, 6441, 27548, 27553, 27556, 27565, 1308, 27570, 27577, 27580,
- 27585, 15917, 2207, 6642, 27589, 27595, 1210, 2032, 27604, 27613, 23287,
- 6464, 3055, 1313, 27623, 27631, 27638, 27643, 27647, 27651, 16842, 6491,
- 27659, 27668, 27677, 27685, 27692, 27697, 27710, 27723, 27735, 27747,
- 27759, 27772, 27783, 27794, 27802, 27810, 27822, 27834, 27845, 27854,
- 27862, 27869, 27881, 27888, 27897, 27904, 27914, 27919, 27925, 27930,
- 27934, 27941, 27945, 27952, 27960, 2173, 27967, 27978, 27988, 27997,
- 28005, 28015, 28023, 28033, 28039, 28050, 28060, 28069, 28078, 28088,
- 28097, 1695, 37, 28102, 28113, 28124, 28134, 28141, 28147, 28152, 28156,
- 28167, 28177, 28186, 28197, 10985, 10990, 28202, 28211, 28216, 28226,
- 28231, 28239, 28247, 28254, 28260, 6526, 932, 28264, 28270, 28275, 28278,
- 1858, 26401, 28286, 28290, 28293, 1502, 28299, 9035, 1318, 28304, 28317,
- 28331, 2258, 28349, 28361, 2272, 28375, 28387, 28400, 28414, 28426, 2289,
- 28440, 1324, 1330, 1336, 6595, 28445, 28450, 28455, 28459, 28474, 28489,
- 28504, 28519, 28534, 28549, 28564, 28579, 28594, 28609, 28624, 28639,
- 28654, 28669, 28684, 28699, 28714, 28729, 28744, 28759, 28774, 28789,
- 28804, 28819, 28834, 28849, 28864, 28879, 28894, 28909, 28924, 28939,
- 28954, 28969, 28984, 28999, 29014, 29029, 29044, 29059, 29074, 29089,
- 29104, 29119, 29134, 29149, 29164, 29179, 29194, 29209, 29224, 29239,
- 29254, 29269, 29284, 29299, 29314, 29329, 29344, 29359, 29374, 29389,
- 29404, 29419, 29434, 29449, 29464, 29479, 29494, 29509, 29524, 29539,
- 29554, 29569, 29584, 29599, 29614, 29629, 29644, 29659, 29674, 29689,
- 29704, 29719, 29734, 29749, 29764, 29779, 29794, 29809, 29824, 29839,
- 29854, 29869, 29884, 29899, 29914, 29929, 29944, 29959, 29974, 29989,
- 30004, 30019, 30034, 30049, 30064, 30079, 30094, 30109, 30124, 30139,
- 30154, 30169, 30184, 30199, 30214, 30229, 30244, 30259, 30274, 30289,
- 30304, 30319, 30334, 30349, 30364, 30379, 30394, 30409, 30424, 30439,
- 30454, 30469, 30484, 30499, 30514, 30529, 30544, 30559, 30574, 30589,
- 30604, 30619, 30634, 30649, 30664, 30679, 30694, 30709, 30724, 30739,
- 30754, 30769, 30784, 30799, 30814, 30829, 30844, 30859, 30874, 30889,
- 30904, 30919, 30934, 30949, 30964, 30979, 30994, 31009, 31024, 31039,
- 31054, 31069, 31084, 31099, 31114, 31129, 31144, 31159, 31174, 31189,
- 31204, 31219, 31234, 31249, 31264, 31279, 31294, 31309, 31324, 31339,
- 31354, 31369, 31384, 31399, 31414, 31429, 31444, 31459, 31474, 31489,
- 31504, 31519, 31534, 31549, 31564, 31579, 31594, 31609, 31624, 31639,
- 31654, 31669, 31684, 31699, 31714, 31729, 31744, 31759, 31774, 31789,
- 31804, 31819, 31834, 31849, 31864, 31879, 31894, 31909, 31924, 31939,
- 31954, 31969, 31984, 31999, 32014, 32029, 32044, 32059, 32074, 32089,
- 32104, 32119, 32134, 32149, 32164, 32179, 32194, 32209, 32224, 32239,
- 32254, 32269, 32284, 32299, 32314, 32329, 32344, 32359, 32374, 32389,
- 32404, 32419, 32434, 32449, 32464, 32479, 32494, 32509, 32524, 32539,
- 32554, 32569, 32584, 32599, 32614, 32629, 32644, 32659, 32674, 32689,
- 32704, 32719, 32734, 32749, 32764, 32779, 32794, 32809, 32824, 32839,
- 32854, 32869, 32884, 32899, 32914, 32929, 32944, 32959, 32974, 32989,
- 33004, 33019, 33034, 33049, 33064, 33079, 33094, 33109, 33124, 33139,
- 33154, 33169, 33184, 33199, 33214, 33229, 33244, 33259, 33274, 33289,
- 33304, 33319, 33334, 33349, 33364, 33379, 33394, 33409, 33424, 33439,
- 33454, 33469, 33484, 33499, 33514, 33529, 33544, 33559, 33574, 33589,
- 33604, 33619, 33634, 33649, 33664, 33679, 33694, 33709, 33724, 33739,
- 33754, 33769, 33784, 33799, 33814, 33829, 33844, 33859, 33874, 33889,
- 33904, 33919, 33934, 33949, 33964, 33979, 33994, 34009, 34024, 34039,
- 34054, 34069, 34084, 34099, 34114, 34129, 34144, 34159, 34174, 34189,
- 34204, 34219, 34234, 34249, 34264, 34279, 34294, 34309, 34324, 34339,
- 34354, 34369, 34384, 34399, 34414, 34429, 34444, 34459, 34474, 34489,
- 34504, 34519, 34534, 34549, 34564, 34579, 34594, 34609, 34624, 34639,
- 34654, 34669, 34684, 34699, 34714, 34729, 34744, 34759, 34774, 34789,
- 34804, 34819, 34834, 34849, 34864, 34879, 34894, 34909, 34924, 34939,
- 34954, 34969, 34984, 34999, 35014, 35029, 35044, 35059, 35074, 35089,
- 35104, 35119, 35134, 35149, 35164, 35179, 35194, 35209, 35224, 35239,
- 35254, 35269, 35284, 35299, 35314, 35329, 35344, 35359, 35374, 35389,
- 35404, 35419, 35434, 35449, 35464, 35480, 35496, 35512, 35528, 35544,
- 35560, 35576, 35592, 35608, 35624, 35640, 35656, 35672, 35688, 35704,
- 35720, 35736, 35752, 35768, 35784, 35800, 35816, 35832, 35848, 35864,
- 35880, 35896, 35912, 35928, 35944, 35960, 35976, 35992, 36008, 36024,
- 36040, 36056, 36072, 36088, 36104, 36120, 36136, 36152, 36168, 36184,
- 36200, 36216, 36232, 36248, 36264, 36280, 36296, 36312, 36328, 36344,
- 36360, 36376, 36392, 36408, 36424, 36440, 36456, 36472, 36488, 36504,
- 36520, 36536, 36552, 36568, 36584, 36600, 36616, 36632, 36648, 36664,
- 36680, 36696, 36712, 36728, 36744, 36760, 36776, 36792, 36808, 36824,
- 36840, 36856, 36872, 36888, 36904, 36920, 36936, 36952, 36968, 36984,
- 37000, 37016, 37032, 37048, 37064, 37080, 37096, 37112, 37128, 37144,
- 37160, 37176, 37192, 37208, 37224, 37240, 37256, 37272, 37288, 37304,
- 37320, 37336, 37352, 37368, 37384, 37400, 37416, 37432, 37448, 37464,
- 37480, 37496, 37512, 37528, 37544, 37560, 37576, 37592, 37608, 37624,
- 37640, 37656, 37672, 37688, 37704, 37720, 37736, 37752, 37768, 37784,
- 37800, 37816, 37832, 37848, 37864, 37880, 37896, 37912, 37928, 37944,
- 37960, 37976, 37992, 38008, 38024, 38040, 38056, 38072, 38088, 38104,
- 38120, 38136, 38152, 38168, 38184, 38200, 38216, 38232, 38248, 38264,
- 38280, 38296, 38312, 38328, 38344, 38360, 38376, 38392, 38408, 38424,
- 38440, 38456, 38472, 38488, 38504, 38520, 38536, 38552, 38568, 38584,
- 38600, 38616, 38632, 38648, 38664, 38680, 38696, 38712, 38728, 38744,
- 38760, 38776, 38792, 38808, 38824, 38840, 38856, 38872, 38888, 38904,
- 38920, 38936, 38952, 38968, 38984, 39000, 39016, 39032, 39048, 39064,
- 39080, 39096, 39112, 39128, 39144, 39160, 39176, 39192, 39208, 39224,
- 39240, 39256, 39272, 39288, 39304, 39320, 39336, 39352, 39368, 39384,
- 39400, 39416, 39432, 39448, 39464, 39480, 39496, 39512, 39528, 39544,
- 39560, 39576, 39592, 39608, 39624, 39640, 39656, 39672, 39688, 39704,
- 39720, 39736, 39752, 39768, 39784, 39800, 39816, 39832, 39848, 39864,
- 39880, 39896, 39912, 39928, 39944, 39960, 39976, 39992, 40008, 40024,
- 40040, 40056, 40072, 40088, 40104, 40120, 40136, 40152, 40168, 40184,
- 40200, 40216, 40232, 40248, 40264, 40280, 40296, 40312, 40328, 40344,
- 40360, 40376, 40392, 40408, 40424, 40440, 40456, 40472, 40488, 40504,
- 40520, 40536, 40552, 40568, 40584, 40600, 40616, 40632, 40648, 40664,
- 40680, 40696, 40712, 40728, 40744, 40760, 40776, 40792, 40808, 40824,
- 40840, 40856, 40872, 40888, 40904, 40920, 40936, 40952, 40968, 40984,
- 41000, 41016, 41032, 41048, 41064, 41080, 41096, 41112, 41128, 41144,
- 41160, 41176, 41192, 41208, 41224, 41240, 41256, 41272, 41288, 41304,
- 41320, 41336, 41352, 41368, 41384, 41400, 41416, 41432, 41448, 41464,
- 41480, 41496, 41512, 41528, 41544, 41560, 41576, 41592, 41608, 41624,
- 41640, 41656, 41672, 41688, 41704, 41720, 41736, 41752, 41768, 41784,
- 41800, 41816, 41832, 41848, 41864, 41880, 41896, 41912, 41928, 41944,
- 41960, 41976, 41992, 42008, 42024, 42040, 42056, 42072, 42088, 42104,
- 42120, 42136, 42152, 42168, 42184, 42200, 42216, 42232, 42248, 42264,
- 42280, 42296, 42312, 42328, 42344, 42360, 42376, 42392, 42408, 42424,
- 42440, 42456, 42472, 42488, 42504, 42520, 42536, 42552, 42568, 42584,
- 42600, 42616, 42632, 42648, 42664, 42680, 42696, 42712, 42728, 42744,
- 42760, 42776, 42792, 42808, 42824, 42840, 42856, 42872, 42888, 42904,
- 42920, 42936, 42952, 42968, 42984, 43000, 43016, 43032, 43048, 43064,
- 43080, 43096, 43112, 43128, 43144, 43160, 43176, 43192, 43208, 43224,
- 43240, 43256, 43272, 43288, 43304, 43320, 43336, 43352, 43368, 43384,
- 43400, 43416, 43432, 43448, 43464, 43480, 43496, 43512, 43528, 43544,
- 43560, 43576, 43592, 43608, 43624, 43640, 43656, 43672, 43688, 43704,
- 43720, 43736, 43752, 43768, 43784, 43800, 43816, 43832, 43848, 43864,
- 43880, 43896, 43912, 43928, 43944, 43960, 43976, 43992, 44008, 44024,
- 44040, 44056, 44072, 44088, 44104, 44120, 44136, 44151, 44160, 44166,
- 44172, 44182, 44190, 9688, 44203, 1510, 44211, 19294, 44217, 2211, 44222,
- 44226, 44231, 44238, 44246, 40, 44250, 44256, 44261, 44266, 44270, 44275,
- 44279, 44283, 6613, 44287, 44297, 44310, 44321, 44334, 44341, 44347,
- 44352, 44358, 44364, 44370, 44375, 44380, 44385, 44390, 44394, 44399,
- 44404, 44409, 44415, 44421, 44427, 44432, 44436, 44441, 44446, 44450,
- 44455, 44460, 44465, 44469, 10588, 10599, 17405, 1553, 44473, 1558,
- 44479, 44482, 1589, 44488, 1595, 1601, 6647, 44493, 44501, 44508, 44512,
- 44518, 44523, 44528, 44535, 44540, 44544, 1606, 10690, 10701, 44553,
- 44560, 44565, 44569, 1610, 44572, 44578, 44588, 44592, 1615, 26447,
- 44597, 6755, 6761, 44603, 44615, 44632, 44649, 44666, 44683, 44700,
- 44717, 44734, 44751, 44768, 44785, 44802, 44819, 44836, 44853, 44870,
- 44887, 44904, 44921, 44938, 44955, 44972, 44989, 45006, 45023, 45040,
- 45057, 45074, 45091, 45108, 45125, 45142, 45159, 45176, 45193, 45210,
- 45227, 45244, 45261, 45278, 45295, 45312, 45329, 45346, 45363, 45380,
- 45397, 45414, 45431, 45448, 45459, 1620, 45464, 45470, 5684, 1625, 19529,
- 45475, 45486, 45496, 45503, 45509, 45514, 6777, 1630, 6782, 45518, 45523,
- 45529, 45534, 45539, 45544, 45549, 45554, 45559, 45564, 45570, 45576,
- 45582, 45587, 45591, 45596, 45601, 45605, 45610, 45615, 45620, 45624,
- 45629, 45635, 45640, 45645, 45649, 45654, 45659, 45665, 45670, 45675,
- 45681, 45687, 45692, 45696, 45701, 45706, 45711, 45715, 45720, 45725,
- 45730, 45736, 45742, 45747, 45751, 45756, 45761, 45766, 45770, 45775,
- 45780, 45786, 45791, 45796, 45800, 45805, 45810, 45816, 45821, 45826,
- 45832, 45838, 45843, 45847, 45852, 45857, 45861, 45866, 45871, 45876,
- 45882, 45888, 45893, 45897, 45902, 45907, 45911, 45916, 45921, 45926,
- 45930, 45933, 21707, 45938, 10952, 10964, 6880, 45944, 6885, 45959,
- 45964, 45976, 45988, 46000, 2324, 46012, 46017, 46021, 46027, 46033,
- 1642, 863, 46038, 46043, 46047, 46051, 46055, 46060, 46064, 11029, 46069,
- 46072, 1646, 46080, 6918, 1651, 46085, 46092, 46097, 46106, 46116, 46123,
- 1656, 46130, 46135, 11098, 46139, 46144, 46151, 46155, 46165, 11120,
- 5603, 5610, 1661, 46172, 46178, 46186, 46193, 46199, 46205, 46210, 3004,
- 21288, 21297, 11160, 1666, 1670, 46218, 46229, 46234, 1673, 46242, 46247,
- 46259, 46265, 46270, 1678, 46275, 46280, 46288, 46296, 46303, 46312,
- 46320, 46329, 1683, 1688, 46333, 46340, 46348, 46354, 46359, 7047, 46368,
- 46374, 46380, 46385, 46393, 7056, 7061, 46401, 46407, 3053, 26542, 46412,
- 46418, 46423, 46431, 46438, 46443, 46447, 1699, 46453, 46456, 904, 46462,
- 9, 46468, 46472, 46477, 46481, 46485, 46489, 46494, 46498, 46503, 46508,
- 46512, 46515, 46519, 46524, 46528, 46533, 46537, 23555, 23560, 23565,
- 46540, 46547, 46553, 26362, 46563, 23571, 23576, 21909, 21915, 23587,
- 21921, 46568, 46573, 46577, 46581, 46584, 46588, 46591, 46596, 46600,
- 46604, 46607, 46619, 22821, 46626, 10169, 696, 46629, 46633, 46638,
- 46642, 8802, 46645, 46652, 46665, 46674, 46679, 46689, 46702, 46714,
- 46721, 46726, 46739, 24440, 46757, 46762, 46769, 46775, 46780, 46788,
- 19596, 520, 46794, 46800, 46806, 46811, 21926, 3474, 21931, 46815, 46825,
- 46830, 46840, 46855, 46861, 46867, 21936, 21445, 46872, 46877, 46882,
- 46887, 46892, 46896, 3515, 21957, 46900, 46906, 330, 46916, 46923, 46932,
- 46938, 46946, 46950, 46954, 46958, 46962, 46967, 46971, 46977, 46985,
- 46990, 46994, 46999, 47003, 47007, 47013, 47019, 47024, 47028, 21965,
- 47033, 21971, 21977, 47038, 47044, 47049, 47053, 21462, 10912, 47056,
- 47060, 47065, 47072, 47078, 47082, 47088, 47092, 47096, 47101, 47106,
- 47110, 47113, 47118, 47125, 47132, 47138, 47143, 47148, 47152, 47157,
- 47163, 47168, 47174, 47179, 47184, 47189, 47195, 47200, 47205, 47211,
- 47217, 47223, 21982, 47228, 47233, 47238, 21993, 47243, 47248, 47253,
- 47259, 47265, 21998, 47270, 47275, 47280, 22009, 22015, 47285, 47290,
- 47295, 47300, 22020, 22025, 22029, 47305, 47276, 47309, 47315, 47323,
- 47330, 47336, 47346, 47352, 47359, 6580, 22034, 47365, 47378, 47387,
- 47393, 47402, 47408, 16625, 47415, 47422, 22010, 47432, 47439, 47444,
- 47448, 47452, 3549, 47457, 47462, 47467, 23649, 23654, 47471, 23660,
- 23665, 47476, 23670, 23676, 47481, 23681, 47492, 47495, 47507, 47515,
- 22056, 47519, 47528, 47538, 47547, 22061, 47552, 47559, 47568, 47574,
- 47582, 22604, 3367, 47587, 22070, 47593, 47599, 47606, 47611, 22075,
- 47615, 47621, 47627, 47632, 47638, 47643, 709, 24255, 24631, 24637,
- 47647, 47651, 47655, 47658, 47671, 47677, 47681, 47684, 47689, 23001,
- 47693, 21467, 15233, 47699, 3495, 3503, 5506, 225, 47702, 47706, 47710,
- 47714, 47718, 47721, 47725, 47730, 47734, 47739, 47743, 47747, 47751,
- 47756, 47760, 47765, 47769, 47773, 47780, 9840, 47789, 47798, 17550,
- 47802, 47808, 47816, 47822, 47834, 47838, 47843, 47849, 47859, 47869,
- 47875, 47879, 47884, 47890, 47899, 47908, 47916, 10073, 47920, 47929,
- 47937, 47948, 47959, 47968, 47972, 47982, 47988, 47993, 47999, 48004,
- 21372, 48015, 18485, 48021, 48028, 48034, 48038, 48048, 48056, 48061,
- 48065, 48073, 48079, 48089, 1025, 48092, 48095, 48099, 48105, 48112,
- 48118, 48127, 48136, 48142, 48148, 48153, 48160, 48167, 48180, 48189,
- 48198, 48203, 48207, 48214, 48221, 48228, 48235, 48242, 48247, 48251,
- 48254, 48264, 48268, 48277, 48281, 48286, 48290, 48299, 48307, 48315,
- 48320, 48324, 48329, 48334, 48338, 48344, 48356, 48364, 48374, 48381,
- 48387, 48392, 48396, 48400, 48404, 48413, 48422, 48431, 48437, 48443,
- 48449, 48454, 48461, 48467, 48475, 48482, 7836, 48488, 48494, 48498,
- 9241, 48502, 48511, 48519, 48526, 48530, 48534, 48540, 48548, 48555,
- 48561, 48572, 48576, 48580, 48584, 48587, 48593, 48598, 48602, 48606,
- 48615, 48623, 48630, 16940, 26200, 48636, 48644, 48648, 48655, 48664,
- 48672, 48678, 48683, 48687, 48692, 48696, 48701, 48710, 48714, 48721,
- 48728, 48736, 48742, 48753, 48759, 48768, 48775, 48782, 48789, 48796,
- 48803, 28634, 48810, 48815, 48821, 31711, 2542, 193, 25139, 48825, 48828,
- 48833, 48311, 48837, 48847, 48854, 48863, 48873, 48883, 48891, 48895,
- 48898, 48905, 48911, 48922, 48934, 48945, 48952, 1319, 16477, 48962,
- 2240, 48966, 1100, 11441, 25600, 48974, 48987, 48991, 48996, 49001, 5072,
- 49007, 49015, 7154, 49020, 49026, 1711, 6925, 605, 49035, 49044, 49054,
- 19000, 49063, 49069, 11075, 49075, 49079, 11082, 7215, 49085, 46224,
- 49092, 5691, 147, 9175, 49098, 49110, 49114, 49120, 19549, 49124, 7203,
- 2315, 4, 49129, 49139, 49145, 49156, 49163, 49169, 49175, 49183, 49190,
- 49200, 49210, 1331, 49219, 49225, 2331, 2337, 5069, 1960, 49229, 49238,
- 49249, 49260, 49268, 49274, 49279, 49287, 49291, 49295, 19813, 49307,
- 49317, 49323, 49329, 49339, 49342, 49353, 49363, 49372, 49379, 1102,
- 2233, 49389, 49394, 49402, 49410, 49421, 49435, 9127, 342, 49445, 49454,
- 49462, 49468, 49475, 49481, 49488, 49498, 49506, 3060, 197, 49514, 49525,
- 49529, 49541, 19734, 119, 49547, 49552, 49556, 49563, 49569, 49577,
- 49584, 5321, 49591, 49600, 3115, 49608, 11121, 49612, 2353, 378, 49617,
- 49630, 49635, 31876, 540, 49639, 3121, 49647, 49653, 959, 49663, 49672,
- 49677, 9704, 49681, 49684, 3070, 16608, 49692, 49699, 16646, 49703,
- 49710, 49716, 49721, 9718, 49726, 49738, 49744, 49752, 2365, 1743, 49760,
- 49762, 49767, 49772, 49776, 49780, 49785, 49789, 49794, 49799, 49805,
- 49810, 49814, 49818, 49821, 49823, 49827, 49830, 49835, 49839, 49843,
- 49847, 49851, 49860, 22216, 49863, 22221, 22226, 49870, 49879, 22232,
- 49884, 22237, 49893, 49898, 7327, 49902, 49907, 49912, 49916, 49920,
- 49924, 49928, 49931, 49935, 5013, 49941, 49946, 49950, 2981, 49953,
- 49955, 49959, 49962, 49967, 49971, 49977, 49990, 49996, 50000, 50008,
- 50015, 50023, 50032, 50040, 22242, 50047, 50057, 50066, 50079, 50084,
- 50089, 50095, 50102, 50113, 50125, 50132, 50141, 50150, 50159, 50166,
- 50172, 50179, 50187, 50194, 50202, 50211, 50219, 50226, 50234, 50243,
- 50251, 50260, 50270, 50279, 50287, 50294, 50302, 50311, 50319, 50328,
- 50338, 50347, 50355, 50364, 50374, 50383, 50393, 50404, 50414, 50423,
- 50431, 50438, 50446, 50455, 50463, 50472, 50482, 50491, 50499, 50508,
- 50518, 50527, 50537, 50548, 50558, 50567, 50575, 50584, 50594, 50603,
- 50613, 50624, 50634, 50643, 50653, 50664, 50674, 50685, 50697, 50708,
- 50718, 50727, 50735, 50742, 50750, 50759, 50767, 50776, 50786, 50795,
- 50803, 50812, 50822, 50831, 50841, 50852, 50862, 50871, 50879, 50888,
- 50898, 50907, 50917, 50928, 50938, 50947, 50957, 50968, 50978, 50989,
- 51001, 51012, 51022, 51031, 51039, 51048, 51058, 51067, 51077, 51088,
- 51098, 51107, 51117, 51128, 51138, 51149, 51161, 51172, 51182, 51191,
- 51201, 51212, 51222, 51233, 51245, 51256, 51266, 51277, 51289, 51300,
- 51312, 51325, 51337, 51348, 51358, 51367, 51375, 51382, 51390, 51399,
- 51407, 51416, 51426, 51435, 51443, 51452, 51462, 51471, 51481, 51492,
- 51502, 51511, 51519, 51528, 51538, 51547, 51557, 51568, 51578, 51587,
- 51597, 51608, 51618, 51629, 51641, 51652, 51662, 51671, 51679, 51688,
- 51698, 51707, 51717, 51728, 51738, 51747, 51757, 51768, 51778, 51789,
- 51801, 51812, 51822, 51831, 51841, 51852, 51862, 51873, 51885, 51896,
- 51906, 51917, 51929, 51940, 51952, 51965, 51977, 51988, 51998, 52007,
- 52015, 52024, 52034, 52043, 52053, 52064, 52074, 52083, 52093, 52104,
- 52114, 52125, 52137, 52148, 52158, 52167, 52177, 52188, 52198, 52209,
- 52221, 52232, 52242, 52253, 52265, 52276, 52288, 52301, 52313, 52324,
- 52334, 52343, 52353, 52364, 52374, 52385, 52397, 52408, 52418, 52429,
- 52441, 52452, 52464, 52477, 52489, 52500, 52510, 52521, 52533, 52544,
- 52556, 52569, 52581, 52592, 52604, 52617, 52629, 52642, 52656, 52669,
- 52681, 52692, 52702, 52711, 52719, 52726, 52731, 4871, 52738, 22252,
- 52743, 52748, 22257, 52754, 15012, 52759, 52763, 52769, 52775, 52782,
- 52787, 52791, 52795, 52804, 52810, 52822, 52833, 52837, 2592, 4846,
- 52842, 52845, 52847, 52851, 52855, 52859, 28446, 52864, 52868, 52871,
- 52876, 52880, 52887, 52893, 52897, 22267, 52901, 52908, 52917, 52925,
- 52936, 52944, 52952, 52959, 52966, 52972, 52983, 22272, 52988, 52999,
- 53011, 53022, 53030, 2206, 53035, 53048, 53052, 53060, 11601, 53071,
- 53077, 53084, 53092, 53098, 22277, 53103, 6118, 44186, 53110, 53113,
- 53121, 53134, 53147, 53160, 53173, 53180, 53191, 53200, 28451, 28456,
- 53205, 53213, 53220, 53229, 53237, 53243, 53252, 53260, 53268, 53272,
- 53281, 53290, 53300, 53313, 53326, 53336, 22282, 53342, 53349, 53355,
- 22288, 53360, 53363, 53367, 53375, 53384, 28189, 53392, 53400, 53407,
- 53415, 53425, 53434, 53443, 53452, 53460, 53471, 5724, 15434, 53480,
- 53485, 53489, 53493, 53498, 53504, 53509, 53514, 53520, 53525, 53530,
- 15399, 53535, 53542, 53550, 53555, 53562, 53566, 53570, 53578, 53586,
- 22297, 53592, 53598, 53610, 53616, 53621, 53632, 53642, 53652, 53664,
- 53670, 53680, 22302, 53689, 53698, 53704, 53716, 53727, 53734, 53739,
- 53747, 53753, 53758, 53763, 53770, 53782, 53792, 53801, 53808, 23230,
- 16814, 53814, 53819, 53823, 53827, 53832, 53838, 53849, 53862, 53867,
- 22307, 53872, 53884, 53893, 53906, 53913, 53922, 53930, 53935, 53941,
- 1147, 53946, 53951, 53956, 53961, 53967, 53972, 53977, 53983, 53989,
- 53994, 53998, 54003, 54008, 54013, 44549, 54018, 54023, 54028, 54033,
- 54039, 54045, 54050, 54054, 54059, 54064, 54069, 54074, 54079, 54083,
- 54089, 54094, 54103, 54108, 54113, 54118, 54123, 54127, 54134, 54140,
- 11311, 32176, 54145, 54095, 54147, 22316, 54150, 54159, 54165, 3561,
- 22321, 54169, 54175, 54181, 54186, 54190, 54197, 54202, 54212, 54221,
- 54225, 54231, 54237, 54243, 54247, 54255, 54262, 54270, 54278, 22326,
- 54285, 54288, 54295, 54300, 54304, 54310, 54315, 54319, 54328, 54336,
- 54342, 54347, 22837, 54354, 54360, 54365, 54371, 54378, 22047, 19317,
- 54384, 54389, 54395, 54407, 54128, 54135, 54417, 54422, 54429, 54436,
- 54442, 54453, 54458, 5523, 54466, 54469, 54475, 54479, 54483, 54486,
- 54492, 46981, 3581, 761, 8644, 115, 54499, 54503, 54507, 54512, 54520,
- 54524, 54532, 54536, 54549, 54553, 54556, 54561, 54565, 54570, 54574,
- 54582, 54586, 15017, 54591, 54595, 54599, 54602, 54610, 54615, 54622,
- 54628, 54634, 54639, 54647, 48979, 54654, 54659, 54664, 54668, 54672,
- 54677, 54682, 54686, 54689, 54695, 54699, 54709, 54718, 54721, 54734,
- 54742, 54750, 54760, 54773, 54780, 54791, 54797, 54802, 54807, 54813,
- 54822, 53874, 54830, 54836, 54844, 54848, 54852, 54858, 54866, 54878,
- 54890, 54897, 54901, 54912, 54920, 54927, 54939, 54947, 54955, 54962,
- 54968, 54978, 54987, 54992, 55002, 55006, 55010, 55017, 55029, 55041,
- 55050, 53038, 55057, 55068, 55082, 55090, 55100, 55107, 55115, 55124,
- 55132, 55142, 55151, 55162, 55174, 55183, 55193, 55200, 55209, 55224,
- 55233, 55246, 55261, 55265, 55277, 55288, 55299, 55310, 55320, 55331,
- 55339, 55345, 55355, 55361, 55366, 55372, 55378, 55383, 55390, 5995,
- 11621, 55396, 55401, 55408, 55414, 55419, 55423, 55426, 55429, 55431,
- 55438, 55449, 55454, 55458, 55464, 55472, 49355, 49365, 55478, 55488,
- 55495, 55501, 55506, 55515, 55522, 55530, 55539, 55545, 55551, 55558,
- 55565, 55570, 55574, 55579, 55584, 55589, 55593, 54544, 55602, 55606,
- 55617, 55627, 11630, 55638, 55646, 11642, 55653, 19227, 55657, 55661,
- 55666, 9500, 55678, 55683, 55688, 55693, 55697, 55700, 55705, 55710,
- 55716, 55721, 3373, 15068, 55726, 55731, 55737, 55744, 55749, 55754,
- 55760, 55766, 55772, 55777, 55783, 55787, 55801, 55809, 55817, 55823,
- 55828, 55835, 55840, 55845, 55853, 55858, 55864, 55869, 55874, 55878,
- 55881, 55899, 55918, 55931, 55945, 55961, 55968, 55975, 55981, 55988,
- 55993, 55999, 56005, 56010, 56026, 10350, 56040, 56047, 56051, 56054,
- 56059, 56064, 56071, 56076, 56081, 56086, 7399, 56090, 56095, 56101,
- 7410, 56106, 56109, 56114, 56124, 56133, 56138, 56146, 56153, 56164,
- 56174, 56179, 56184, 56191, 56197, 56202, 56209, 56218, 56226, 56232,
- 56238, 56242, 11173, 2566, 56247, 56251, 56257, 56264, 56268, 56289,
- 56311, 56327, 56344, 56363, 56372, 56382, 56389, 56396, 19154, 56402,
- 56406, 56414, 56420, 56428, 56432, 56440, 56447, 56451, 56457, 2896,
- 28651, 56463, 56467, 56471, 56475, 56480, 56485, 56490, 56496, 56501,
- 56507, 56512, 56517, 56521, 56526, 28666, 56530, 56535, 56543, 56547,
- 56552, 56559, 56568, 56574, 56581, 56585, 56594, 56599, 56607, 56616,
- 56622, 56627, 56632, 56638, 56644, 56649, 56653, 56661, 56671, 56676,
- 26557, 56684, 56696, 56700, 56712, 56719, 56725, 56732, 56744, 56751,
- 56757, 15112, 56761, 56767, 56773, 56778, 56783, 4382, 56788, 56796,
- 56805, 56809, 56522, 20980, 56814, 56816, 56828, 56833, 5036, 49, 56838,
- 56843, 22331, 22336, 22341, 22347, 22352, 56847, 22357, 56869, 56871,
- 56875, 56879, 56884, 56888, 22361, 56892, 22366, 56900, 56903, 22371,
- 15506, 56912, 56916, 1429, 56921, 22382, 56924, 56929, 18123, 18133,
- 56934, 56938, 56943, 56949, 56954, 56963, 56968, 56975, 56981, 56986,
- 56991, 56996, 57004, 22387, 1010, 57011, 57017, 57022, 57027, 57032,
- 57038, 57043, 57050, 57056, 57061, 57069, 57075, 11652, 57082, 24453,
- 57095, 57100, 57106, 57119, 57123, 57132, 57139, 57145, 57153, 57160,
- 57166, 22391, 57169, 57176, 57182, 57186, 57189, 57197, 57211, 57218,
- 22396, 57224, 22401, 57231, 23655, 57241, 57246, 57250, 57255, 57260,
- 57265, 22406, 47446, 57269, 57274, 57280, 57286, 57293, 57299, 57304,
- 57309, 57318, 57330, 57345, 22626, 57351, 10862, 22410, 57355, 57362,
- 22415, 57368, 57377, 57384, 57393, 57399, 57404, 57410, 22420, 57415,
- 57424, 57433, 57440, 57446, 57452, 57460, 57464, 22425, 57467, 22431,
- 22437, 57472, 57480, 57490, 22442, 57494, 57496, 57500, 57505, 57509,
- 57513, 57519, 57524, 57528, 2571, 57532, 57539, 57543, 57552, 57560,
- 57567, 57572, 57577, 57581, 57585, 57588, 57594, 57602, 57608, 57612,
- 57617, 57624, 57630, 47477, 57635, 57638, 57643, 57647, 57652, 57657,
- 57661, 57669, 18142, 18151, 57675, 57681, 57686, 57690, 57693, 57703,
- 57708, 57714, 57720, 57728, 57733, 23671, 57737, 57745, 57750, 57755,
- 44233, 23677, 57761, 57766, 57770, 57775, 57780, 57785, 57789, 57794,
- 57799, 57805, 57810, 57815, 57821, 57827, 57832, 57836, 57841, 57846,
- 57851, 57855, 57860, 57865, 57870, 57876, 57882, 57888, 57893, 57897,
- 57902, 57907, 57911, 57916, 57921, 57926, 57930, 22446, 57938, 57946,
- 15838, 57957, 57963, 57970, 57975, 57979, 57984, 57992, 58000, 58007,
- 49104, 58013, 58021, 58028, 58039, 58045, 22456, 58048, 58055, 26671,
- 58059, 58064, 58069, 5453, 58073, 58081, 58088, 58095, 58101, 58115,
- 58121, 58125, 58128, 58136, 58143, 58148, 58155, 58160, 58165, 58168,
- 58175, 58179, 58189, 58199, 58208, 58219, 58224, 58228, 58236, 22461,
- 27082, 58240, 58245, 58250, 58255, 58260, 58265, 58270, 58274, 58279,
- 58284, 58289, 58294, 58299, 58304, 58308, 58313, 58318, 58322, 58326,
- 58330, 58334, 58339, 58344, 58348, 58353, 58357, 58361, 58366, 58371,
- 58376, 58381, 58385, 58390, 58395, 58399, 58404, 58409, 58414, 58419,
- 58424, 58429, 58434, 58439, 58444, 58449, 58454, 58459, 58464, 58469,
- 58474, 58479, 58484, 58489, 58494, 58499, 58503, 58508, 58513, 58518,
- 58523, 58528, 58533, 58538, 58543, 58548, 58553, 58558, 58562, 58567,
- 58571, 58576, 58581, 58586, 58591, 58596, 58601, 58606, 58611, 58616,
- 58620, 58624, 58629, 58634, 58638, 58643, 58648, 58652, 58657, 58662,
- 58667, 58672, 58676, 58681, 58686, 58690, 58695, 58699, 58703, 58707,
- 58711, 58716, 58720, 58724, 58728, 58732, 58736, 58740, 58744, 58748,
- 58752, 58757, 58762, 58767, 58772, 58777, 58782, 58787, 58792, 58797,
- 58802, 58806, 58810, 58814, 58818, 58822, 58826, 58831, 58835, 58840,
- 58844, 58849, 58854, 58858, 58862, 58867, 58871, 58875, 58879, 58883,
- 58887, 58891, 58895, 58899, 58903, 58907, 58911, 58915, 58919, 58923,
- 58928, 58933, 58937, 58941, 58945, 58949, 58953, 58957, 58962, 58966,
- 58970, 58974, 58978, 58982, 58986, 58991, 58995, 59000, 59004, 59008,
- 59012, 59016, 59020, 59024, 59028, 59032, 59036, 59040, 59044, 59049,
- 59053, 59057, 59061, 59065, 59069, 59073, 59077, 59081, 59085, 59089,
- 59093, 59098, 59102, 59106, 59111, 59116, 59120, 59124, 59128, 59132,
- 59136, 59140, 59144, 59148, 59152, 59156, 59160, 59164, 59168, 59172,
- 59176, 59180, 1511, 59184, 1749, 59188, 59192, 2383, 59196, 1398, 59201,
- 1364, 59205, 59209, 59216, 59230, 2399, 4457, 59239, 59247, 59254, 59261,
- 59274, 59287, 59298, 59303, 59310, 59322, 3172, 7467, 59326, 59331,
- 59340, 59350, 59355, 59359, 59364, 1369, 9554, 59374, 59380, 59394,
- 59406, 59415, 59424, 59433, 59441, 59452, 59460, 3211, 59470, 59479,
- 59486, 24085, 59491, 2427, 8373, 59495, 59502, 5409, 59511, 2432, 22067,
- 59517, 59524, 59530, 59537, 59543, 59550, 59560, 59569, 59580, 59587,
- 59593, 59603, 59611, 59617, 59632, 59638, 59643, 59650, 59653, 59659,
- 59666, 59672, 59681, 59689, 59695, 59704, 28191, 59718, 59723, 9582,
- 59729, 59738, 59746, 59753, 59757, 59761, 59764, 59771, 59779, 59787,
- 9511, 59796, 59801, 59805, 59817, 59826, 59836, 2448, 59845, 59851,
- 59864, 59876, 59886, 59895, 59907, 59915, 59924, 59935, 59946, 59956,
- 59966, 59975, 59983, 7136, 59990, 59994, 59999, 60004, 60010, 1374, 7515,
- 60017, 60028, 60037, 60045, 60054, 60070, 60081, 60097, 60107, 60128,
- 60141, 60146, 60152, 18788, 60158, 60161, 60168, 4983, 60178, 60183,
- 60188, 60196, 6043, 6052, 60204, 2456, 2461, 6742, 60215, 60222, 60229,
- 1953, 101, 60242, 60247, 60257, 60263, 60267, 60272, 60276, 2478, 60288,
- 60296, 60307, 60318, 60327, 60332, 60338, 60343, 60353, 60363, 60368,
- 60374, 60379, 60388, 15321, 60392, 3273, 12, 60397, 60404, 710, 60410,
- 60415, 46381, 60420, 60425, 60431, 60439, 60444, 60451, 60457, 25559,
- 60463, 2482, 32, 60473, 60486, 60494, 60499, 60505, 2504, 21432, 60510,
- 60518, 60525, 44475, 47127, 60534, 1694, 1798, 60539, 60544, 60551, 1802,
- 210, 60558, 60564, 60569, 60576, 1806, 60581, 60586, 3548, 60598, 1813,
- 60604, 60609, 60616, 60631, 60638, 60646, 60658, 60663, 60674, 60683,
- 2122, 60694, 60696, 2591, 5729, 60704, 60709, 60713, 60722, 60728, 2561,
- 11328, 60732, 60745, 60763, 60768, 60776, 60784, 60794, 60806, 60819,
- 60826, 60842, 60849, 60855, 877, 60862, 60869, 60879, 60888, 60900,
- 29055, 60908, 2575, 1186, 60911, 60919, 60923, 2579, 60927, 60931, 60935,
- 2585, 60939, 1379, 10460, 7696, 59775, 2606, 60949, 60952, 60958, 60964,
- 60971, 60976, 60981, 1992,
+static unsigned int lexicon_offset[] = {
+ 0, 0, 6, 10, 15, 23, 27, 34, 39, 41, 44, 52, 62, 68, 81, 93, 102, 108,
+ 113, 121, 130, 135, 140, 144, 150, 153, 158, 166, 173, 181, 186, 191,
+ 194, 200, 208, 215, 225, 232, 241, 244, 247, 252, 258, 262, 271, 278,
+ 285, 290, 299, 307, 313, 319, 325, 141, 330, 331, 337, 345, 351, 357,
+ 365, 372, 374, 377, 381, 388, 390, 397, 402, 408, 410, 417, 425, 427,
+ 311, 430, 432, 437, 442, 447, 453, 460, 469, 479, 484, 489, 493, 506,
+ 513, 517, 526, 533, 540, 543, 549, 553, 563, 571, 579, 588, 596, 604,
+ 609, 617, 624, 634, 645, 649, 654, 657, 661, 665, 666, 672, 678, 680,
+ 683, 687, 344, 690, 694, 703, 706, 709, 714, 718, 726, 729, 735, 742,
+ 749, 758, 765, 774, 779, 783, 792, 802, 811, 817, 823, 830, 838, 846,
+ 855, 863, 867, 875, 880, 781, 511, 889, 893, 897, 904, 908, 915, 689,
+ 918, 926, 929, 933, 940, 944, 949, 957, 960, 192, 966, 971, 981, 990,
+ 997, 1004, 1012, 1020, 1026, 1030, 1035, 1040, 1046, 1051, 1054, 111,
+ 1060, 1064, 1070, 1073, 1086, 1089, 1093, 22, 1097, 1102, 1105, 1108,
+ 1114, 1124, 1126, 1132, 1142, 1147, 1156, 1164, 328, 1167, 1170, 1174,
+ 1179, 1185, 1190, 1197, 1199, 1204, 1209, 1215, 1220, 1225, 1229, 1234,
+ 1240, 1245, 1250, 1254, 1259, 1264, 1268, 1273, 1278, 1283, 1289, 1295,
+ 1301, 1306, 1310, 1315, 1320, 1325, 1329, 1334, 1339, 1344, 1349, 1200,
+ 1205, 1210, 1216, 1221, 1353, 1226, 1359, 1368, 1230, 1372, 1235, 1241,
+ 1246, 1376, 1381, 1386, 1390, 1394, 1400, 1404, 1251, 1407, 1411, 1255,
+ 1417, 1260, 1421, 1425, 1265, 1429, 1434, 1438, 1441, 1445, 1269, 1274,
+ 1450, 1279, 1456, 1462, 1468, 1474, 1284, 1296, 1302, 1478, 1482, 1486,
+ 1489, 1307, 1493, 1495, 1500, 1505, 1511, 1516, 1521, 1525, 1530, 1535,
+ 1540, 1545, 1551, 1556, 1561, 1567, 1573, 1578, 1582, 1587, 1592, 1597,
+ 1602, 1606, 1614, 1618, 1623, 1628, 1633, 1638, 1642, 1645, 1650, 1655,
+ 1660, 1665, 1671, 1676, 1680, 1311, 1683, 1688, 1693, 1316, 1697, 1701,
+ 1708, 1321, 1715, 1326, 1719, 1721, 1726, 1732, 1330, 1737, 1746, 1335,
+ 1751, 1757, 1340, 1762, 1767, 1770, 1775, 1779, 1783, 1787, 1790, 1794,
+ 1345, 1350, 1100, 1799, 1805, 1811, 1817, 1823, 1829, 1835, 1841, 1847,
+ 1852, 1858, 1864, 1870, 1876, 1882, 1888, 1894, 1900, 1906, 1911, 1916,
+ 1921, 1926, 1931, 1936, 1941, 1946, 1951, 1956, 1962, 1967, 1973, 1978,
+ 1984, 1990, 1995, 2001, 2007, 2013, 2019, 2024, 2029, 2031, 2032, 2036,
+ 2040, 2045, 2049, 2053, 2057, 2061, 2064, 2069, 2073, 2078, 2082, 2086,
+ 2091, 2095, 2098, 2102, 2108, 2122, 2126, 2130, 2133, 2138, 2142, 2146,
+ 2149, 2153, 2158, 2163, 2168, 2173, 2177, 2181, 2185, 2190, 2194, 2199,
+ 2203, 2208, 2214, 2221, 2227, 2232, 2237, 2242, 2248, 2253, 2259, 2264,
+ 2267, 1217, 2269, 2276, 2284, 2294, 2303, 2317, 2321, 2325, 2338, 2346,
+ 2350, 2355, 2359, 2362, 2366, 2370, 2375, 2380, 2385, 2389, 2392, 2396,
+ 2403, 2410, 2416, 2421, 2426, 2432, 2438, 2443, 2446, 1723, 2448, 2454,
+ 2458, 2463, 2467, 2471, 1728, 1734, 2476, 2480, 2483, 2488, 2493, 2498,
+ 2503, 2507, 2514, 2519, 2522, 2529, 2535, 2539, 2543, 2547, 2552, 2559,
+ 2564, 2569, 2576, 2582, 2588, 2594, 2608, 2625, 2640, 2655, 2664, 2669,
+ 2673, 2678, 2683, 2687, 2699, 2706, 2712, 2217, 2718, 2725, 2731, 2735,
+ 2738, 2745, 2751, 2755, 2759, 2763, 2054, 2767, 2772, 2777, 2781, 2789,
+ 2793, 2797, 2801, 2806, 2811, 2816, 2820, 2825, 2830, 2834, 2839, 2843,
+ 2846, 2850, 2854, 2859, 2863, 2867, 2873, 2882, 2886, 2890, 2896, 2901,
+ 2908, 2912, 2922, 2926, 2931, 2935, 2940, 2946, 2951, 2955, 2959, 2963,
+ 2406, 2971, 2976, 2982, 2987, 2991, 2996, 3001, 3005, 3011, 3016, 3022,
+ 3026, 3032, 3037, 3042, 3047, 3052, 3057, 3062, 3067, 3072, 3077, 3083,
+ 3088, 1227, 80, 3094, 3098, 3102, 3106, 3111, 3115, 3119, 3123, 3127,
+ 3132, 3136, 3141, 3145, 3148, 3152, 3157, 3161, 3166, 3170, 3174, 3178,
+ 3183, 3187, 3190, 3203, 3207, 3211, 3215, 3219, 3223, 3226, 3230, 3234,
+ 3239, 3243, 3248, 3253, 3258, 3262, 3265, 3268, 3274, 3278, 3282, 3285,
+ 3289, 3293, 3296, 3302, 3307, 3312, 3318, 3323, 3328, 3334, 3340, 3345,
+ 3350, 3355, 1091, 542, 3360, 3363, 3368, 3372, 3375, 3379, 3384, 3389,
+ 3393, 3398, 3402, 3407, 3411, 3415, 3421, 3427, 3430, 3433, 3439, 3446,
+ 3453, 3459, 3466, 3471, 3475, 3482, 3487, 3491, 3501, 3505, 3509, 3514,
+ 3519, 3529, 2065, 3534, 3538, 3541, 3547, 3552, 3558, 3564, 3569, 3576,
+ 3580, 3584, 658, 688, 3588, 3595, 3602, 3609, 3615, 3621, 3626, 3630,
+ 3636, 3641, 3645, 2074, 3649, 3657, 583, 3663, 3674, 3678, 3688, 2079,
+ 3694, 3699, 3714, 3720, 3727, 3737, 3743, 3748, 3754, 3760, 3763, 3767,
+ 3772, 3779, 3784, 3788, 3792, 3796, 3800, 3805, 3811, 3153, 3816, 3828,
+ 3836, 3841, 1527, 3848, 3851, 3854, 3858, 3861, 3867, 3871, 3885, 3889,
+ 3892, 3896, 3902, 3908, 3913, 3917, 3921, 3927, 3938, 3944, 3949, 3955,
+ 3959, 3967, 3977, 3983, 3988, 3997, 4005, 4012, 4016, 4022, 4031, 4040,
+ 4044, 4049, 4054, 4058, 4066, 4070, 4075, 4079, 2087, 1369, 4085, 4090,
+ 4096, 4101, 4106, 4111, 4116, 4121, 4126, 4132, 4137, 4143, 4148, 4153,
+ 4158, 4164, 4169, 4174, 4179, 4184, 4190, 4195, 4201, 4206, 4211, 4216,
+ 4221, 4226, 4231, 4237, 4242, 4247, 335, 436, 4252, 4258, 4262, 4266,
+ 4271, 4275, 4279, 4282, 4286, 4290, 4294, 4299, 4303, 4307, 4313, 4082,
+ 4318, 4321, 4328, 4332, 4345, 4349, 4353, 4357, 4361, 4365, 4369, 4375,
+ 4382, 4390, 4394, 4402, 4411, 4417, 4429, 4434, 4437, 4441, 4451, 4459,
+ 4467, 4473, 4477, 4487, 4497, 4505, 4512, 4519, 4525, 4531, 4538, 4542,
+ 4549, 4559, 4569, 4577, 4584, 4589, 4593, 4601, 4606, 4613, 4621, 4626,
+ 4631, 4635, 4649, 4654, 4659, 4666, 4675, 4678, 4682, 4686, 4689, 4694,
+ 4699, 4708, 4714, 4720, 4726, 4730, 4741, 4751, 4766, 4781, 4796, 4811,
+ 4826, 4841, 4856, 4871, 4886, 4901, 4916, 4931, 4946, 4961, 4976, 4991,
+ 5006, 5021, 5036, 5051, 5066, 5081, 5096, 5111, 5126, 5141, 5156, 5171,
+ 5186, 5201, 5216, 5231, 5246, 5261, 5276, 5291, 5306, 5321, 5336, 5351,
+ 5366, 5381, 5396, 5411, 5426, 5441, 5456, 5471, 5486, 5495, 5504, 5509,
+ 5515, 5525, 5529, 5534, 5539, 5547, 5551, 5554, 5558, 2917, 5561, 5566,
+ 310, 445, 5572, 5580, 5584, 5588, 5591, 5597, 5601, 5609, 5615, 5620,
+ 5627, 5634, 5640, 5645, 5652, 5658, 5666, 5670, 5675, 5687, 5698, 5705,
+ 5711, 3175, 5715, 5721, 5726, 5731, 5736, 5742, 5747, 5752, 5757, 5762,
+ 5768, 5773, 5778, 5784, 5789, 5795, 5800, 5806, 5811, 5817, 5822, 5827,
+ 5832, 5837, 5842, 5848, 5853, 5858, 5863, 5869, 5875, 5881, 5887, 5893,
+ 5899, 5905, 5911, 5917, 5923, 5929, 5935, 5940, 5945, 5950, 5955, 5960,
+ 5965, 5970, 5975, 5981, 5987, 5992, 5998, 6004, 6010, 6015, 6020, 6025,
+ 6030, 6036, 6042, 6047, 6052, 6057, 6062, 6067, 6073, 6078, 6084, 6090,
+ 6096, 6102, 6108, 6114, 6120, 6126, 6132, 2096, 5590, 6137, 6141, 6145,
+ 6148, 6155, 6158, 6166, 6171, 6176, 6167, 6181, 6168, 6185, 6191, 6197,
+ 6202, 6207, 6214, 6222, 6227, 6231, 6234, 6238, 2127, 551, 6242, 6246,
+ 6251, 6257, 6262, 6266, 6269, 6273, 6279, 6284, 6288, 6295, 6299, 6303,
+ 6307, 946, 747, 6310, 6318, 6325, 6332, 6338, 6345, 6353, 6360, 6367,
+ 6372, 6384, 1247, 1377, 1382, 6395, 1387, 6399, 6403, 6412, 6420, 6429,
+ 6435, 6440, 6444, 6450, 6455, 6462, 6466, 6475, 6484, 6493, 6502, 6507,
+ 6512, 6524, 6529, 6537, 2178, 6541, 6543, 6548, 6552, 6561, 6569, 1391,
+ 133, 3403, 3408, 6575, 6579, 6588, 6594, 6599, 6602, 6611, 2652, 6617,
+ 6625, 6629, 6633, 2191, 6637, 6642, 6649, 6655, 6661, 6664, 6666, 6669,
+ 6677, 6685, 6693, 6696, 6701, 6178, 6704, 6706, 6711, 6716, 6721, 6726,
+ 6731, 6736, 6741, 6746, 6751, 6756, 6762, 6767, 6772, 6777, 6783, 6788,
+ 6793, 6798, 6803, 6808, 6813, 6819, 6824, 6829, 6834, 6839, 6844, 6849,
+ 6854, 6859, 6864, 6869, 6874, 6879, 6884, 6889, 6894, 6899, 6904, 6910,
+ 6916, 6921, 6926, 6931, 6936, 6941, 2215, 2222, 2228, 6946, 6952, 2254,
+ 2260, 6960, 6964, 6969, 6973, 6977, 6981, 6986, 6990, 6995, 6999, 7002,
+ 7005, 7011, 7017, 7023, 7029, 7035, 7041, 7047, 7051, 7055, 7059, 7063,
+ 7067, 7072, 7079, 7090, 7098, 7108, 7115, 7120, 7124, 7135, 7148, 7159,
+ 7172, 7183, 7195, 7207, 7219, 7232, 7245, 7252, 7258, 7272, 7279, 7285,
+ 7289, 7294, 7298, 7305, 7313, 7317, 7323, 7329, 7339, 7343, 7348, 7353,
+ 7360, 7366, 7376, 6340, 7382, 7386, 7393, 746, 7397, 7401, 7406, 7411,
+ 7416, 7420, 7426, 7434, 7440, 7444, 7450, 7460, 7464, 7470, 7475, 7479,
+ 7485, 7491, 2119, 7496, 7498, 7506, 7515, 7519, 7525, 7530, 7535, 7540,
+ 7545, 7551, 7556, 3923, 7561, 7565, 7571, 7576, 7582, 7587, 7592, 7598,
+ 7603, 7520, 7609, 7613, 7620, 7626, 7631, 7635, 4645, 7640, 7649, 6645,
+ 6652, 7654, 2803, 7658, 7663, 7668, 7531, 7672, 7536, 7541, 7677, 7684,
+ 7691, 7697, 7703, 7709, 7714, 7719, 7724, 7546, 7552, 7730, 7736, 7741,
+ 7749, 7557, 7754, 1028, 7757, 7765, 7771, 7777, 7786, 7794, 7799, 7805,
+ 7813, 7820, 7835, 7852, 7871, 7880, 7888, 7903, 7914, 7924, 7934, 7942,
+ 7948, 7960, 7969, 7977, 7984, 7991, 7997, 8002, 8010, 8020, 8027, 8037,
+ 8047, 8057, 8065, 8072, 8081, 8091, 8105, 8120, 8129, 8137, 8142, 8146,
+ 8155, 8161, 8166, 8176, 8186, 8196, 8201, 8205, 8214, 8219, 8229, 8240,
+ 8253, 8266, 8278, 8286, 8291, 8295, 8301, 8306, 8314, 8322, 8329, 8334,
+ 8342, 8348, 8351, 8355, 8361, 8369, 8374, 8378, 8386, 8395, 8403, 8409,
+ 8413, 8420, 8431, 8435, 8438, 8444, 8449, 8453, 8459, 8466, 8472, 8477,
+ 8484, 8491, 8498, 8505, 8512, 8519, 8524, 7848, 8529, 8535, 8542, 8549,
+ 8554, 8561, 8570, 8574, 8586, 8590, 8593, 8597, 8601, 8605, 8609, 8615,
+ 8620, 8626, 8631, 8636, 8642, 8647, 8652, 7356, 8657, 8661, 8665, 8669,
+ 8674, 8679, 8687, 8693, 8697, 8701, 8708, 8713, 8721, 8726, 8730, 8733,
+ 8739, 8746, 8750, 8753, 8758, 8762, 3962, 8768, 8777, 36, 8785, 8791,
+ 8796, 7371, 8801, 8807, 8812, 8816, 8819, 8834, 8853, 8865, 8878, 8891,
+ 8904, 8918, 8931, 8946, 8953, 8959, 8963, 8977, 8982, 8988, 8993, 9001,
+ 9006, 6471, 9011, 9014, 9021, 9026, 9030, 2808, 955, 9036, 9040, 9046,
+ 9052, 9057, 9063, 9068, 7566, 9074, 9080, 9085, 9090, 9098, 9104, 9117,
+ 9125, 9132, 7572, 9138, 9146, 9154, 9161, 9174, 9186, 9196, 9203, 9210,
+ 9219, 9228, 9236, 9243, 9248, 9254, 7577, 9259, 9265, 7583, 9270, 9273,
+ 9280, 9286, 9299, 7083, 9310, 9316, 9325, 9333, 9340, 9346, 9352, 9357,
+ 9361, 9366, 8826, 9372, 7588, 9379, 9384, 9391, 9397, 9403, 9408, 9416,
+ 9424, 9431, 9435, 9449, 9459, 9464, 9468, 9479, 9485, 9490, 9495, 7593,
+ 7599, 9499, 9502, 9507, 9519, 9526, 9531, 9535, 9540, 9544, 9551, 9557,
+ 7604, 7521, 9564, 2813, 8, 9571, 9576, 9580, 9586, 9594, 9604, 9609,
+ 9614, 9621, 9628, 9632, 9643, 9653, 9662, 9674, 9679, 9683, 9691, 9705,
+ 9709, 9712, 9720, 9727, 9735, 9739, 9750, 9754, 9761, 9766, 9770, 9776,
+ 9781, 9785, 9791, 9796, 9807, 9811, 9814, 9820, 9825, 9831, 9837, 9844,
+ 9855, 9865, 9875, 9884, 9891, 7614, 7621, 7627, 7632, 9897, 9903, 7636,
+ 9909, 9912, 9919, 9924, 9939, 9955, 9970, 9978, 9984, 1043, 400, 9989,
+ 9997, 10004, 10010, 10015, 10020, 7641, 10022, 10026, 10031, 10035,
+ 10045, 10050, 10054, 10063, 10067, 10070, 10077, 10081, 10084, 10092,
+ 10099, 10107, 10111, 10118, 10127, 10130, 10134, 10138, 10144, 10148,
+ 10152, 10156, 10162, 10172, 10176, 10184, 10188, 10195, 10199, 10204,
+ 10208, 10215, 10221, 10229, 10235, 10245, 10250, 10255, 10259, 10267,
+ 3822, 10275, 10280, 10284, 10288, 10291, 10299, 10306, 10310, 4469,
+ 10314, 10319, 10323, 10334, 10339, 10345, 10349, 10352, 10360, 10365,
+ 10370, 10377, 10382, 7650, 10387, 10391, 1685, 4619, 10398, 10403, 10408,
+ 10413, 10419, 10424, 10430, 10435, 10440, 10445, 10450, 10455, 10460,
+ 10465, 10470, 10475, 10480, 10485, 10490, 10495, 10500, 10505, 10510,
+ 10516, 10521, 10526, 10531, 10536, 10541, 10547, 10552, 10557, 10563,
+ 10568, 10574, 10579, 10585, 10590, 10595, 10600, 10605, 10611, 10616,
+ 10621, 10626, 724, 139, 10634, 10638, 10643, 10648, 10652, 10656, 10660,
+ 10665, 10669, 10674, 10678, 10681, 10685, 10689, 10694, 10704, 10710,
+ 10718, 10722, 10726, 10733, 10741, 10750, 10761, 10768, 10775, 10784,
+ 10793, 10801, 10810, 10819, 10828, 10837, 10847, 10857, 10867, 10877,
+ 10887, 10896, 10906, 10916, 10926, 10936, 10946, 10956, 10966, 10975,
+ 10985, 10995, 11005, 11015, 11025, 11035, 11044, 11054, 11064, 11074,
+ 11084, 11094, 11104, 11114, 11124, 11134, 11143, 11153, 11163, 11173,
+ 11183, 11193, 11203, 11213, 11223, 11233, 11243, 11252, 11258, 11262,
+ 11265, 11269, 11274, 11281, 11287, 11292, 11296, 11301, 11310, 11318,
+ 11323, 11327, 11331, 11337, 11342, 11348, 7659, 11353, 11358, 11367,
+ 7664, 11372, 11375, 11381, 11389, 7669, 11396, 11400, 11404, 11408,
+ 11418, 11424, 11429, 11438, 11446, 11453, 11460, 11465, 11472, 11477,
+ 11481, 11484, 11495, 11505, 11514, 11522, 11533, 11545, 11555, 11560,
+ 11564, 11569, 11574, 11578, 11584, 11592, 11599, 11610, 11615, 11625,
+ 11634, 11638, 11641, 11648, 11658, 11667, 11674, 11678, 11685, 11691,
+ 11696, 11701, 11705, 11714, 11719, 11725, 11729, 11734, 11738, 11747,
+ 11755, 11763, 11770, 11778, 11790, 11801, 11811, 11818, 11824, 11833,
+ 11844, 11853, 11865, 11877, 11889, 11899, 11908, 11917, 11925, 11932,
+ 11941, 11949, 11955, 11961, 11966, 6199, 11970, 11972, 11977, 11983,
+ 11992, 12000, 12007, 12016, 12025, 12034, 12043, 12052, 12061, 12070,
+ 12079, 12089, 12099, 12108, 12114, 12121, 12135, 12142, 12150, 12159,
+ 12165, 12174, 12183, 12194, 12204, 12212, 12219, 12227, 12236, 12249,
+ 12257, 12264, 12277, 12283, 12289, 12299, 12308, 12317, 12322, 12326,
+ 12332, 12338, 12345, 7370, 12350, 12355, 12362, 12367, 12372, 12376,
+ 12384, 12390, 12395, 12403, 12411, 12418, 12426, 12432, 12440, 12448,
+ 12453, 12459, 12466, 12472, 12477, 12481, 12492, 12500, 12506, 12511,
+ 12520, 12526, 12531, 12540, 12554, 3781, 12558, 12563, 12568, 12574,
+ 12579, 12584, 12588, 12593, 12598, 6198, 12603, 12608, 12613, 12618,
+ 12622, 12627, 12632, 12637, 12643, 12649, 12654, 12658, 12663, 12668,
+ 12673, 7673, 12678, 12683, 12688, 12693, 12710, 12728, 12740, 12753,
+ 12770, 12786, 12803, 12813, 12832, 12843, 12854, 12865, 12876, 12888,
+ 12899, 12910, 12927, 12938, 12949, 12954, 2335, 12958, 12961, 12967,
+ 12975, 12983, 12988, 12996, 13004, 13011, 13016, 13022, 13029, 13037,
+ 13044, 13056, 13064, 13069, 9933, 13075, 13084, 13093, 13101, 13108,
+ 13114, 13122, 13129, 13135, 13142, 13148, 13157, 13165, 13175, 13182,
+ 13188, 13196, 13202, 13210, 13217, 13230, 13237, 13246, 13255, 13264,
+ 13272, 13282, 13289, 13294, 3495, 13301, 13306, 13309, 12604, 13313,
+ 13319, 13323, 13331, 13343, 13348, 13355, 13361, 13366, 13373, 12609,
+ 13377, 13381, 12614, 13385, 13389, 13393, 13400, 13405, 13409, 13413,
+ 13421, 13428, 13435, 13452, 13461, 13465, 13468, 13476, 13482, 13487,
+ 3573, 13491, 13493, 13501, 13508, 13518, 13530, 13535, 13541, 13546,
+ 13550, 13556, 13561, 13567, 13570, 13577, 13585, 13592, 13598, 13604,
+ 13609, 13616, 13622, 13627, 13634, 13638, 13644, 13648, 13655, 13661,
+ 13667, 13675, 13681, 13686, 13692, 13700, 13708, 13714, 13720, 13725,
+ 13732, 13737, 13741, 13747, 13752, 13759, 13764, 13770, 13773, 13779,
+ 13785, 13788, 13792, 13804, 13810, 13815, 13822, 13828, 13834, 13845,
+ 13855, 13864, 13872, 13879, 13890, 13900, 13910, 13918, 13921, 12628,
+ 13926, 13931, 12633, 12758, 13939, 13952, 13967, 13978, 12775, 13996,
+ 14009, 14022, 14033, 8841, 14044, 14057, 14076, 14087, 14098, 14109,
+ 2603, 14122, 14126, 14134, 14145, 14152, 14158, 14166, 14170, 14176,
+ 14179, 14189, 14197, 14204, 14212, 14222, 14227, 14234, 14239, 14246,
+ 14257, 14267, 14273, 14278, 14283, 14287, 14291, 14297, 14303, 14308,
+ 14313, 14318, 14322, 12638, 12644, 14326, 12650, 14331, 14339, 14348,
+ 14355, 7542, 14359, 14361, 14366, 14371, 14377, 14382, 14387, 14392,
+ 14397, 14401, 14407, 14413, 14418, 14424, 14429, 14434, 14440, 14445,
+ 14450, 14455, 14461, 14466, 14471, 14477, 14483, 14488, 14493, 14500,
+ 14506, 14517, 14524, 14529, 14533, 14537, 14540, 14548, 14553, 14560,
+ 14567, 14572, 14577, 14584, 14594, 14599, 14606, 14612, 14622, 14632,
+ 14646, 14660, 14674, 14688, 14703, 14718, 14735, 14753, 14766, 14772,
+ 14777, 14782, 14786, 14791, 14799, 14805, 14810, 14815, 14819, 14824,
+ 14828, 14833, 14837, 14848, 14854, 14859, 14864, 14871, 14876, 14880,
+ 14885, 14890, 14896, 14903, 14909, 14914, 14918, 14924, 14929, 14934,
+ 14938, 14944, 14949, 14954, 14961, 14966, 11420, 14970, 14975, 14979,
+ 14984, 14990, 14996, 15003, 15013, 15021, 15028, 15033, 15037, 15046,
+ 15054, 15061, 15068, 15074, 15080, 15085, 15090, 15096, 15101, 15107,
+ 15112, 15118, 15124, 15131, 15137, 15142, 15147, 7715, 15156, 15159,
+ 15165, 15170, 15175, 15185, 15192, 15198, 15203, 15209, 15214, 15220,
+ 15225, 15231, 15237, 15242, 15250, 15257, 15262, 15267, 15273, 15278,
+ 15282, 15291, 15302, 15309, 15317, 15323, 15330, 15336, 15341, 15345,
+ 15351, 15356, 15361, 15366, 7720, 6223, 2827, 15370, 15374, 15378, 15382,
+ 15386, 15389, 15396, 15404, 12664, 15411, 15421, 15429, 15436, 15444,
+ 15454, 15463, 15476, 15481, 15486, 15494, 15501, 11510, 11519, 15508,
+ 15518, 15533, 15539, 15546, 15553, 15559, 15569, 15579, 12669, 15588,
+ 15594, 15600, 15608, 15616, 15621, 15630, 15638, 15650, 15660, 15670,
+ 15680, 15689, 15701, 15711, 15721, 15732, 15737, 15749, 15761, 15773,
+ 15785, 15797, 15809, 15821, 15833, 15845, 15857, 15868, 15880, 15892,
+ 15904, 15916, 15928, 15940, 15952, 15964, 15976, 15988, 15999, 16011,
+ 16023, 16035, 16047, 16059, 16071, 16083, 16095, 16107, 16119, 16130,
+ 16142, 16154, 16166, 16178, 16190, 16202, 16214, 16226, 16238, 16250,
+ 16261, 16273, 16285, 16297, 16309, 16321, 16333, 16345, 16357, 16369,
+ 16381, 16392, 16404, 16416, 16428, 16440, 16452, 16464, 16476, 16488,
+ 16500, 16512, 16523, 16535, 16547, 16559, 16571, 16583, 16595, 16607,
+ 16619, 16631, 16643, 16654, 16666, 16678, 16690, 16702, 16715, 16728,
+ 16741, 16754, 16767, 16780, 16793, 16805, 16818, 16831, 16844, 16857,
+ 16870, 16883, 16896, 16909, 16922, 16935, 16947, 16960, 16973, 16986,
+ 16999, 17012, 17025, 17038, 17051, 17064, 17077, 17089, 17102, 17115,
+ 17128, 17141, 17154, 17167, 17180, 17193, 17206, 17219, 17231, 17244,
+ 17257, 17270, 17283, 17296, 17309, 17322, 17335, 17348, 17361, 17373,
+ 17386, 17399, 17412, 17425, 17438, 17451, 17464, 17477, 17490, 17503,
+ 17515, 17526, 17539, 17552, 17565, 17578, 17591, 17604, 17617, 17630,
+ 17643, 17656, 17668, 17681, 17694, 17707, 17720, 17733, 17746, 17759,
+ 17772, 17785, 17798, 17810, 17823, 17836, 17849, 17862, 17875, 17888,
+ 17901, 17914, 17927, 17940, 17952, 17965, 17978, 17991, 18004, 18017,
+ 18030, 18043, 18056, 18069, 18082, 18094, 18107, 18120, 18133, 18146,
+ 18159, 18172, 18185, 18198, 18211, 18224, 18236, 18249, 18262, 18275,
+ 18288, 18301, 18314, 18327, 18340, 18353, 18366, 18378, 18391, 18404,
+ 18417, 18430, 18443, 18456, 18469, 18482, 18495, 18508, 18520, 18533,
+ 18546, 18559, 18572, 18585, 18598, 18611, 18624, 18637, 18650, 18662,
+ 18675, 18688, 18701, 18714, 18727, 18740, 18753, 18766, 18779, 18792,
+ 18804, 18817, 18830, 18843, 18856, 18869, 18882, 18895, 18908, 18921,
+ 18934, 18946, 18957, 18965, 18972, 18978, 18982, 18988, 18994, 19002,
+ 19008, 19013, 19017, 19026, 7547, 19037, 19044, 19052, 19059, 19066,
+ 9293, 19073, 19082, 19087, 19092, 6239, 19099, 19104, 19107, 19112,
+ 19120, 19127, 19134, 19141, 19147, 19156, 19165, 19171, 19180, 19186,
+ 19191, 19201, 19208, 19214, 19222, 19228, 19235, 19245, 19254, 19258,
+ 19265, 19269, 19274, 19280, 19288, 19292, 19302, 12679, 19311, 19317,
+ 19321, 19330, 19336, 19343, 19354, 19362, 19371, 7335, 19379, 19384,
+ 19390, 19395, 19399, 19403, 19407, 8006, 19412, 19420, 19427, 19436,
+ 19443, 19450, 9223, 19457, 19463, 19467, 19473, 19479, 19487, 19493,
+ 19500, 19506, 19512, 19521, 19525, 19533, 19542, 19549, 19554, 19558,
+ 19569, 19574, 19579, 19584, 19597, 6426, 19601, 19607, 19615, 19619,
+ 19626, 19635, 19640, 19648, 19660, 19665, 19669, 19672, 19678, 19684,
+ 19689, 19693, 19696, 19707, 19712, 7750, 19719, 7558, 7755, 19724, 19729,
+ 19734, 19739, 19744, 19749, 19754, 19759, 19764, 19769, 19774, 19779,
+ 19785, 19790, 19795, 19800, 19805, 19810, 19815, 19820, 19825, 19830,
+ 19836, 19842, 19847, 19852, 19857, 19862, 19867, 19872, 19877, 19882,
+ 19887, 19893, 19898, 19903, 19908, 19914, 19920, 19925, 19930, 19935,
+ 19940, 19945, 19950, 19955, 19960, 19966, 19971, 19976, 19981, 19986,
+ 19992, 19997, 20002, 20006, 129, 20014, 20018, 20022, 20026, 20031,
+ 20035, 20039, 10781, 20043, 20048, 20052, 20057, 20061, 20066, 20070,
+ 20076, 20081, 20085, 20089, 20097, 20101, 20106, 20111, 20115, 20121,
+ 20126, 20130, 20135, 20140, 20144, 20151, 20158, 20165, 20169, 20173,
+ 20178, 20182, 20185, 20191, 20204, 20209, 20218, 20223, 7795, 20228,
+ 20231, 2666, 2671, 20235, 20241, 20247, 20252, 20257, 20262, 20268,
+ 20273, 12190, 20278, 20283, 20288, 20294, 20299, 20304, 20310, 20315,
+ 20319, 20324, 20329, 20334, 20338, 20343, 20348, 20353, 20358, 20362,
+ 20366, 20371, 2836, 20320, 20375, 20383, 20390, 8100, 20402, 20410,
+ 20325, 20417, 20422, 20430, 20330, 20435, 20440, 20448, 20453, 20458,
+ 20462, 20467, 20471, 20477, 20480, 20487, 20491, 20495, 20501, 20508,
+ 20513, 7362, 1690, 1695, 20517, 20523, 20529, 20534, 20538, 20542, 20546,
+ 20549, 20555, 20562, 20570, 20576, 20582, 20587, 20592, 20596, 13039,
+ 13896, 20601, 20613, 20616, 20623, 20630, 20634, 20642, 20653, 20662,
+ 20675, 20685, 20699, 20711, 20725, 20737, 20747, 20759, 20765, 20780,
+ 20804, 20822, 20841, 20854, 20868, 20886, 20902, 20919, 20937, 20948,
+ 20967, 20984, 21004, 21022, 21034, 21048, 21062, 21074, 21091, 21110,
+ 21128, 21140, 21158, 21177, 12818, 21190, 21210, 21222, 8872, 21234,
+ 21239, 21244, 21249, 21255, 21260, 21264, 21271, 2352, 21275, 21281,
+ 21285, 21288, 21292, 21300, 21306, 20339, 21310, 21319, 21330, 21336,
+ 21342, 21351, 21359, 21366, 21371, 21378, 21384, 21393, 21401, 21408,
+ 21418, 21427, 21437, 21442, 21451, 21460, 21471, 21482, 3880, 21492,
+ 21496, 21506, 21514, 21524, 21535, 21540, 21548, 21555, 21561, 21566,
+ 20349, 21570, 21579, 21583, 21586, 21591, 21598, 21607, 21615, 21623,
+ 21633, 21642, 21648, 21654, 20354, 20359, 21658, 21668, 21678, 21688,
+ 21696, 21703, 21713, 21721, 21729, 21735, 962, 21744, 13000, 537, 21758,
+ 21767, 21775, 21786, 21797, 21807, 21816, 21828, 21837, 21846, 21852,
+ 21861, 21870, 21880, 21888, 21896, 7727, 21902, 21905, 21909, 21914,
+ 21919, 8215, 20367, 21927, 21933, 21939, 21944, 21949, 21953, 21961,
+ 21967, 21973, 21977, 3467, 21985, 21990, 21995, 21999, 22003, 8287,
+ 22010, 22018, 22025, 22031, 8296, 8302, 22039, 22047, 22054, 22059,
+ 22064, 22070, 22074, 22085, 22090, 2555, 22095, 22106, 22112, 22117,
+ 22121, 22125, 22128, 22135, 22142, 22149, 22155, 22159, 22164, 22168,
+ 22172, 979, 22176, 22181, 22186, 22191, 22196, 22201, 22206, 22211,
+ 22216, 22221, 22226, 22231, 22236, 22241, 22247, 22252, 22257, 22262,
+ 22267, 22272, 22277, 22283, 22288, 22293, 22298, 22303, 22308, 22313,
+ 22318, 22324, 22330, 22335, 22341, 22346, 22351, 5, 22357, 22361, 22365,
+ 22369, 22374, 22378, 22382, 22386, 22390, 22395, 22399, 22404, 22408,
+ 22411, 22415, 22420, 22424, 22429, 22433, 22437, 22441, 22446, 22450,
+ 22454, 22464, 22469, 22473, 22477, 22482, 22487, 22496, 22501, 22506,
+ 22510, 22514, 22527, 22539, 22548, 22557, 22563, 22568, 22572, 22576,
+ 22586, 22595, 22603, 22609, 22614, 22618, 22625, 22635, 22644, 22652,
+ 22660, 22667, 22675, 22684, 22693, 22701, 22706, 22710, 22714, 22717,
+ 22719, 22723, 22727, 22732, 22737, 22741, 22745, 22748, 22752, 22755,
+ 22759, 22762, 22765, 22769, 22775, 22779, 22783, 22787, 22792, 22797,
+ 22802, 22806, 22809, 22814, 22820, 22825, 22831, 22836, 22840, 22844,
+ 22848, 22853, 22857, 22862, 22866, 22873, 22877, 22880, 22884, 22890,
+ 22896, 22900, 22904, 22909, 22916, 22922, 22926, 22935, 22939, 22943,
+ 22946, 22952, 22957, 22963, 1452, 1754, 22968, 22973, 22978, 22983,
+ 22988, 22993, 22998, 2106, 2148, 23003, 23006, 23010, 23014, 23019,
+ 23023, 23027, 23030, 23035, 23040, 23044, 23047, 23052, 23056, 23061,
+ 23065, 13012, 23070, 23073, 23076, 23080, 23085, 23098, 23102, 23105,
+ 23113, 23122, 23129, 23134, 23140, 23146, 23153, 23160, 23164, 23168,
+ 23172, 23177, 23182, 23186, 23194, 23199, 23211, 23222, 23227, 23231,
+ 23235, 23241, 23246, 23251, 23255, 23258, 23264, 6346, 2270, 23268,
+ 23273, 23289, 7842, 23309, 23318, 23334, 23338, 23341, 23347, 23357,
+ 23363, 23378, 23390, 23401, 23409, 23418, 23424, 23433, 23443, 23454,
+ 23465, 23474, 23483, 23491, 23498, 23506, 23519, 23526, 23532, 23537,
+ 23546, 23552, 23557, 23565, 21516, 23577, 23589, 23603, 23611, 23618,
+ 23630, 23639, 23648, 23656, 23664, 23672, 23679, 23688, 23696, 23706,
+ 23715, 23725, 23734, 23743, 23751, 23756, 23760, 23763, 23767, 23771,
+ 23775, 23779, 23783, 23789, 23795, 23803, 13057, 23810, 23815, 23822,
+ 23828, 23835, 13065, 23842, 23845, 23857, 23865, 23871, 23876, 23880,
+ 8245, 23891, 23901, 23910, 23917, 23921, 13070, 23924, 23931, 23935,
+ 23941, 23944, 23951, 23957, 23961, 23966, 23970, 23979, 23986, 23992,
+ 6387, 23999, 24007, 24014, 24020, 24025, 24031, 24037, 24045, 24049,
+ 24052, 24054, 23768, 24063, 24069, 24079, 24084, 24091, 24097, 24102,
+ 24107, 24112, 24117, 24124, 24133, 24140, 24149, 24155, 24160, 24166,
+ 24171, 24178, 24189, 24194, 24198, 24208, 24214, 24218, 24223, 24233,
+ 24242, 24246, 24253, 24261, 24268, 24274, 24279, 24287, 24294, 24306,
+ 24315, 24319, 11362, 24327, 24337, 24341, 23109, 24352, 24357, 24361,
+ 24368, 24375, 20117, 23693, 24380, 24384, 24387, 20954, 24392, 24406,
+ 24422, 24440, 24459, 24476, 24494, 20973, 24511, 24531, 20990, 24543,
+ 24555, 13983, 24567, 21010, 24581, 24593, 8885, 24607, 24612, 24617,
+ 24622, 24628, 24634, 24640, 24644, 24651, 24656, 24666, 24672, 8532,
+ 24678, 24680, 24685, 24693, 24697, 24120, 24703, 24710, 9869, 9879,
+ 24717, 24727, 24732, 24736, 24739, 24745, 24753, 24765, 24775, 24791,
+ 24804, 24818, 14001, 24832, 24839, 24843, 24846, 24851, 24855, 24862,
+ 24869, 24879, 24884, 24889, 24894, 24902, 24910, 24919, 24924, 7939,
+ 24928, 24931, 24934, 24939, 24946, 24951, 24967, 24975, 24983, 7790,
+ 24991, 24996, 25000, 25006, 25012, 25015, 25021, 25033, 25041, 25048,
+ 25054, 25061, 25072, 25086, 25099, 25108, 25120, 25131, 25141, 25150,
+ 25159, 25167, 25178, 6369, 25185, 25191, 25196, 25202, 25209, 25219,
+ 25229, 25238, 25244, 25251, 25256, 25263, 25271, 25279, 25291, 4704,
+ 25298, 25307, 25315, 25321, 25327, 25332, 25336, 25339, 25345, 25352,
+ 25357, 25362, 25366, 25378, 25389, 25398, 25406, 13197, 25411, 25417,
+ 25423, 9862, 7049, 25428, 25431, 25434, 25440, 25448, 25456, 25460,
+ 25464, 25469, 25472, 25481, 25489, 25500, 25504, 25510, 25516, 25520,
+ 25526, 25534, 25556, 25580, 25587, 25594, 25600, 25606, 25611, 25622,
+ 25640, 25647, 25655, 25659, 25668, 25681, 25689, 25701, 25712, 25722,
+ 25736, 25745, 25753, 25765, 7859, 25776, 25787, 25799, 25809, 25818,
+ 25823, 25827, 25835, 25845, 25850, 25854, 25857, 25860, 25868, 25876,
+ 25885, 25895, 25904, 25910, 25924, 2617, 25946, 25957, 25966, 25976,
+ 25988, 25997, 26007, 26015, 26023, 26032, 26037, 26048, 26053, 26064,
+ 26068, 26078, 26087, 26095, 26105, 26115, 26123, 26132, 26139, 26147,
+ 26154, 26163, 26167, 26175, 26182, 26190, 26197, 26208, 26223, 26230,
+ 26236, 26246, 26255, 26261, 26268, 12312, 26274, 26278, 26283, 26287,
+ 26291, 26299, 26307, 26313, 26322, 26329, 26334, 26339, 26349, 21568,
+ 26353, 26356, 26361, 26366, 26371, 26376, 26381, 26386, 26391, 26396,
+ 26402, 26407, 26412, 26418, 1223, 679, 26423, 26432, 2318, 26439, 26444,
+ 26448, 26454, 1256, 541, 334, 26459, 26468, 26476, 26485, 26493, 26504,
+ 26513, 26521, 26525, 26528, 26536, 26544, 26549, 13025, 26555, 26561,
+ 26567, 4350, 26572, 26576, 26582, 26586, 26593, 1418, 26599, 7946, 26606,
+ 26616, 26624, 26630, 26639, 26647, 26653, 26661, 26668, 9455, 26674,
+ 26681, 26688, 1459, 2105, 26694, 26700, 26707, 26718, 26729, 26737,
+ 26744, 26754, 26763, 26771, 26778, 26785, 26798, 26809, 26828, 1261,
+ 26832, 26837, 26845, 3510, 26849, 26854, 26858, 1422, 22746, 26868,
+ 26872, 26877, 26881, 3435, 26887, 26895, 26902, 26913, 26921, 26929,
+ 3511, 269, 26934, 26942, 26950, 26957, 26963, 26968, 2170, 26975, 26981,
+ 23962, 24184, 26987, 106, 26991, 26995, 27001, 606, 7695, 27006, 27013,
+ 27019, 2281, 27023, 27027, 27030, 27033, 27038, 27045, 27051, 27056,
+ 27064, 27071, 27077, 20455, 27081, 3581, 14826, 27085, 27090, 27093,
+ 27101, 27109, 27112, 27119, 27129, 27141, 27146, 27150, 27158, 27165,
+ 27171, 27178, 27185, 27188, 27192, 27196, 1426, 27206, 27208, 27213,
+ 27219, 27225, 27230, 27235, 27240, 27245, 27250, 27255, 27260, 27265,
+ 27270, 27275, 27280, 27285, 27290, 27295, 27301, 27307, 27313, 27319,
+ 27324, 27329, 27334, 27340, 27345, 27350, 27355, 27361, 27366, 27372,
+ 27377, 27382, 27387, 27392, 27398, 27403, 27409, 27414, 27419, 27424,
+ 27429, 27435, 27440, 27446, 27451, 27456, 27461, 27466, 27471, 27476,
+ 27481, 27486, 27491, 27497, 27503, 27509, 27514, 27519, 27524, 27529,
+ 27535, 27541, 27547, 27553, 27559, 27565, 27570, 27576, 27581, 27586,
+ 27591, 27596, 27602, 2397, 27607, 2404, 2411, 2708, 27612, 2417, 2427,
+ 27618, 27622, 27627, 27632, 27638, 27643, 27648, 27652, 27657, 27663,
+ 27668, 27673, 27678, 27684, 27689, 27693, 27697, 27702, 27707, 27712,
+ 27717, 27722, 27728, 27734, 27739, 27743, 27748, 27754, 27758, 27763,
+ 27768, 27773, 27778, 27782, 27785, 27790, 27795, 27800, 27805, 27811,
+ 27817, 27822, 27827, 27831, 27836, 27841, 27846, 27851, 27856, 27860,
+ 27865, 27870, 27875, 27879, 27883, 27887, 27892, 27900, 27906, 27912,
+ 27918, 27923, 27927, 27930, 27935, 27939, 27944, 27948, 27953, 27957,
+ 27960, 15489, 27965, 27973, 19439, 26603, 27978, 27983, 27987, 27992,
+ 27996, 28000, 28005, 28009, 28012, 28015, 28019, 28024, 28032, 28036,
+ 28039, 28044, 28048, 28052, 28057, 28062, 28066, 28072, 28077, 28082,
+ 28089, 28096, 28100, 28103, 28109, 28118, 28125, 28133, 28140, 28144,
+ 28149, 28153, 28159, 28165, 28169, 28175, 28180, 28185, 28192, 28198,
+ 28204, 28210, 28216, 28223, 28229, 28235, 28241, 28247, 28253, 28259,
+ 28265, 28272, 28278, 28285, 28291, 28297, 28303, 28309, 28315, 28321,
+ 28327, 28333, 28339, 9763, 28345, 28350, 28355, 28358, 28366, 28371,
+ 28380, 28386, 28391, 28396, 28401, 28405, 28410, 28415, 28420, 28425,
+ 28430, 28437, 28444, 28450, 28456, 28461, 14510, 28468, 28474, 28481,
+ 28487, 28493, 28498, 28506, 28511, 14294, 28515, 28520, 28525, 28531,
+ 28536, 28541, 28545, 28550, 28555, 28561, 28566, 28571, 28575, 28580,
+ 28585, 28589, 28594, 28599, 28604, 28608, 28613, 28618, 28623, 28627,
+ 28631, 13531, 28635, 28644, 28650, 28656, 28665, 28673, 28682, 28690,
+ 28695, 28699, 28706, 28712, 28716, 28719, 28724, 28733, 28741, 28746,
+ 1458, 28752, 28755, 28759, 20524, 20530, 28765, 28769, 28780, 28791,
+ 28802, 28814, 28821, 28828, 28833, 28837, 4387, 733, 19438, 28845, 28849,
+ 28854, 28860, 28865, 28871, 28876, 28882, 28887, 8764, 2785, 3365, 28891,
+ 28894, 28900, 28906, 28912, 28919, 28925, 28931, 28937, 28943, 28949,
+ 28955, 28961, 28967, 28973, 28979, 28985, 28991, 28998, 29004, 29010,
+ 29016, 29022, 29028, 29033, 29036, 29043, 29051, 29056, 29061, 29067,
+ 29072, 29077, 29081, 29086, 29092, 29097, 29103, 29108, 29114, 29119,
+ 29125, 29131, 29135, 29140, 29145, 29150, 29155, 29159, 29164, 29169,
+ 29174, 29180, 29186, 29192, 29198, 29203, 29207, 29210, 29216, 29222,
+ 29231, 29239, 29246, 29251, 29255, 29259, 29264, 13395, 29269, 29277,
+ 29283, 3611, 29288, 29291, 29295, 6436, 29301, 29307, 29314, 6445, 29318,
+ 29324, 29331, 29337, 29346, 29354, 29366, 29370, 29377, 29383, 29387,
+ 29390, 29399, 29407, 29412, 29416, 29426, 29436, 29446, 29452, 29457,
+ 29467, 29472, 29485, 29499, 29510, 29522, 29534, 29548, 29561, 29573,
+ 29585, 12859, 29599, 29604, 29609, 29613, 29617, 29621, 1743, 25129,
+ 29625, 29630, 29635, 29639, 29642, 29647, 29652, 29658, 29664, 8461,
+ 29669, 29676, 13935, 29682, 29687, 29692, 29696, 29701, 29706, 28855,
+ 29711, 29716, 29721, 29727, 28861, 29732, 29735, 29742, 29750, 29756,
+ 29762, 29768, 29779, 29784, 29791, 29798, 29805, 29813, 29822, 29831,
+ 29837, 29843, 29851, 28866, 29856, 29862, 29868, 28872, 29873, 29881,
+ 29889, 29895, 29902, 29908, 29915, 29922, 29928, 29936, 29946, 29953,
+ 29958, 29964, 29969, 29974, 29981, 29990, 29998, 30003, 30009, 30016,
+ 30024, 30030, 30035, 30041, 30050, 25890, 30057, 30061, 30066, 30075,
+ 30080, 30085, 10714, 30093, 30098, 30103, 30107, 30112, 30117, 30124,
+ 30129, 30134, 28877, 28883, 30140, 2473, 239, 30143, 30146, 30150, 30154,
+ 30164, 30172, 30176, 30183, 30190, 30194, 30197, 30203, 30211, 30219,
+ 30223, 30227, 30230, 30237, 30241, 30248, 30256, 30263, 30267, 30275,
+ 684, 297, 30287, 30292, 30297, 30303, 30308, 30313, 3632, 30318, 30321,
+ 30326, 30331, 30336, 30341, 30346, 30353, 20609, 30358, 30363, 30368,
+ 30373, 30378, 30384, 30389, 30395, 29039, 30401, 30406, 30412, 30418,
+ 30428, 30433, 30438, 30442, 30447, 30452, 30457, 30462, 30475, 30480,
+ 20406, 14906, 3638, 30484, 30489, 30494, 30500, 30505, 30510, 30514,
+ 30519, 30524, 30530, 30535, 30540, 30544, 30549, 30554, 30559, 30563,
+ 30568, 30573, 30578, 30584, 30590, 30595, 30599, 30604, 30609, 30614,
+ 30618, 30626, 30630, 30636, 30640, 30647, 14699, 30653, 30660, 30668,
+ 30675, 30681, 30693, 30699, 30703, 2727, 30707, 30711, 30232, 30720,
+ 30731, 30736, 30741, 30746, 30750, 30755, 20535, 30759, 30764, 19459,
+ 30768, 30773, 30779, 30784, 30788, 30792, 30795, 30799, 30805, 30816,
+ 30828, 30833, 30837, 30840, 343, 30844, 30849, 30854, 30859, 30864,
+ 30869, 30875, 30880, 30885, 30891, 30896, 30902, 30907, 30913, 30918,
+ 30923, 30928, 30933, 30938, 30943, 30948, 30953, 30959, 30964, 30969,
+ 30974, 30979, 30984, 30989, 30994, 31000, 31006, 31011, 31016, 31021,
+ 31026, 31031, 31036, 31041, 31046, 31051, 31056, 31061, 31066, 31071,
+ 31076, 31081, 31086, 31091, 31096, 31102, 26, 31107, 31111, 31115, 31123,
+ 31127, 31131, 31134, 31137, 31139, 31144, 31148, 31153, 31157, 31162,
+ 31166, 31171, 31175, 31178, 31180, 31185, 31189, 31200, 31203, 31205,
+ 31209, 31221, 31230, 31234, 31240, 31245, 31254, 31260, 31265, 31270,
+ 31274, 31279, 31286, 31291, 31297, 31302, 31306, 31313, 23701, 23711,
+ 31317, 31322, 31327, 31332, 31339, 31343, 31350, 6544, 31356, 31365,
+ 31373, 31388, 31402, 31410, 31421, 31430, 31435, 5681, 31445, 31450,
+ 31455, 31459, 31462, 31466, 31471, 31475, 31482, 31487, 31492, 7320,
+ 31502, 31504, 31507, 31511, 31517, 31521, 31526, 31531, 31537, 31542,
+ 31548, 31553, 31563, 31572, 31580, 31585, 31591, 31596, 31603, 31607,
+ 31615, 31622, 31635, 31643, 31647, 31657, 31662, 31666, 31674, 31682,
+ 31686, 31695, 31701, 31706, 31714, 31724, 31733, 31742, 31751, 31762,
+ 31770, 31781, 31790, 31797, 31803, 31808, 31819, 31824, 31828, 31831,
+ 31835, 31843, 31849, 31857, 31864, 31870, 31875, 31881, 2372, 31885,
+ 31887, 31892, 31897, 31900, 31902, 31906, 31909, 31916, 31920, 31924,
+ 31927, 31933, 31943, 31948, 31954, 31958, 31963, 31976, 24074, 31982,
+ 31991, 15654, 31998, 32007, 29432, 32015, 32020, 32024, 32032, 32039,
+ 32044, 32048, 32053, 32057, 32065, 32071, 32077, 32082, 32086, 32089,
+ 32094, 32107, 32123, 21080, 32140, 32152, 32169, 32181, 32195, 21097,
+ 21116, 32207, 32219, 2634, 32233, 32238, 32243, 32248, 32252, 32259,
+ 32271, 32277, 32280, 32291, 32302, 29848, 670, 32307, 32311, 32314,
+ 32319, 32324, 32330, 32335, 32340, 32346, 32352, 32357, 32361, 32366,
+ 32371, 32376, 32380, 32383, 32389, 32394, 32399, 32404, 32408, 32413,
+ 32419, 32427, 24299, 32432, 32437, 32444, 32450, 32456, 32461, 32469,
+ 20618, 32476, 32481, 32486, 32491, 32495, 32498, 32503, 32507, 32511,
+ 32518, 32524, 32530, 32536, 32543, 32548, 32554, 31677, 32558, 32562,
+ 32567, 32580, 32585, 32591, 32599, 32606, 32614, 32624, 32630, 32636,
+ 32642, 32646, 32655, 32660, 32665, 8787, 32670, 32677, 32683, 32693,
+ 32698, 32704, 32712, 3543, 32719, 32726, 3549, 32730, 32735, 32746,
+ 32753, 32759, 32768, 32772, 3932, 32775, 32782, 32788, 32794, 32802,
+ 32812, 26958, 32819, 32827, 32833, 32838, 32844, 32849, 32855, 32859,
+ 32866, 32872, 32881, 24094, 32888, 32893, 32897, 32905, 32913, 7974,
+ 4373, 32920, 32924, 32928, 32933, 32939, 32944, 32949, 32956, 30349,
+ 32962, 32967, 32971, 32976, 32980, 32989, 32993, 32999, 33006, 33012,
+ 33019, 33024, 33033, 33038, 33042, 33047, 33054, 33062, 33070, 33075,
+ 19508, 33079, 33082, 33086, 33090, 33094, 33097, 33099, 33104, 33112,
+ 33116, 33123, 33127, 33135, 33142, 33152, 33156, 33160, 33168, 33176,
+ 33182, 33187, 33196, 11669, 33202, 33211, 33216, 33223, 33231, 33239,
+ 33247, 33254, 33261, 33268, 33275, 33282, 33287, 33293, 33310, 33318,
+ 33328, 33336, 33343, 385, 33347, 33353, 33357, 33362, 31426, 33368,
+ 33371, 33375, 33383, 3554, 33391, 33397, 33403, 33412, 33422, 33429,
+ 33435, 3560, 3566, 33444, 33451, 33459, 33464, 33468, 33475, 33483,
+ 33489, 33498, 33508, 33514, 33522, 33531, 33538, 33546, 20175, 33553,
+ 33560, 33566, 33576, 33585, 33596, 33600, 33610, 33616, 33623, 33631,
+ 33640, 33649, 33659, 33670, 33677, 33682, 33689, 2967, 33697, 33703,
+ 33708, 33714, 33720, 33725, 33738, 33751, 33764, 33771, 33777, 33785,
+ 33790, 33794, 1432, 33798, 33803, 33808, 33813, 33818, 33824, 33829,
+ 33834, 33839, 33844, 33849, 33854, 33859, 33865, 33871, 33876, 33881,
+ 33887, 33892, 33897, 33902, 33908, 33913, 33918, 33923, 33928, 33934,
+ 33939, 33944, 33950, 33955, 33960, 33965, 33970, 33975, 33981, 33986,
+ 33992, 33997, 34003, 34008, 34013, 34018, 34024, 34030, 34036, 34042,
+ 34048, 34054, 34060, 34066, 34071, 34076, 34082, 34087, 34092, 34097,
+ 34102, 34107, 34112, 34117, 34123, 34128, 34133, 34139, 34145, 101,
+ 34150, 34152, 34156, 34160, 34164, 34169, 34173, 7895, 34177, 34183,
+ 4738, 34189, 34192, 34197, 34201, 34206, 34210, 34214, 34219, 8594,
+ 34223, 34227, 34231, 13623, 34236, 34240, 34245, 34250, 34255, 34259,
+ 34266, 24098, 34272, 34275, 34279, 34284, 34290, 34294, 34302, 34308,
+ 34313, 34317, 34323, 34327, 34331, 3404, 3409, 27144, 34334, 34342,
+ 34349, 34353, 34360, 34365, 333, 34370, 34374, 34380, 34392, 34398,
+ 34404, 34408, 34414, 34423, 34427, 34431, 34436, 34441, 34446, 34450,
+ 34454, 34461, 34467, 34472, 34487, 34502, 34517, 34533, 34551, 8544,
+ 34565, 34572, 34576, 34579, 34588, 34593, 34597, 34605, 31628, 34613,
+ 34617, 34627, 27114, 34638, 34642, 34651, 34659, 8152, 13163, 34663,
+ 34666, 34669, 6557, 3802, 34674, 34682, 34686, 34689, 34693, 34698,
+ 34703, 34709, 34715, 34720, 34724, 23946, 34728, 34732, 34738, 34742,
+ 7446, 34751, 34758, 34762, 10210, 34769, 34775, 34780, 34787, 34794,
+ 34801, 26480, 6480, 34808, 34815, 34822, 34828, 34833, 34840, 34851,
+ 34857, 34862, 34867, 34874, 34878, 34882, 34892, 34903, 34909, 34914,
+ 34919, 34924, 34929, 34934, 34938, 34942, 34948, 34956, 2273, 828, 8616,
+ 8621, 8627, 34965, 8632, 8637, 8643, 34970, 34980, 34984, 8648, 34989,
+ 34992, 34997, 35001, 35006, 35011, 35018, 35025, 35033, 8557, 35040,
+ 35043, 35049, 35059, 4407, 35068, 35072, 35080, 35084, 35094, 35100,
+ 35111, 35117, 35123, 35128, 35134, 35140, 35146, 35151, 35154, 35161,
+ 35167, 35172, 35179, 35186, 35190, 35200, 35213, 35222, 35231, 35242,
+ 35255, 35266, 35275, 35286, 35291, 35300, 35305, 8653, 35311, 35318,
+ 35326, 35331, 35335, 35342, 35349, 3757, 21, 35353, 35358, 14958, 35362,
+ 35365, 35368, 26001, 35372, 26489, 35380, 35384, 35388, 35391, 35397,
+ 35403, 35411, 35417, 35424, 25993, 35428, 26178, 35432, 35441, 35447,
+ 35453, 35458, 35462, 35468, 35472, 35475, 35483, 35491, 24156, 35497,
+ 35504, 35510, 35515, 35520, 35524, 35530, 35535, 35541, 3973, 755, 35548,
+ 35552, 35555, 13513, 35567, 33527, 35578, 35581, 35588, 35594, 35598,
+ 35604, 35609, 35615, 35620, 35625, 35629, 35633, 35638, 35643, 35653,
+ 35659, 35672, 35678, 35685, 35690, 35696, 35701, 14844, 1435, 1002,
+ 28974, 28980, 35706, 28986, 28999, 29005, 29011, 35712, 29017, 29023,
+ 35718, 35724, 14, 35732, 35739, 35743, 35747, 35755, 29737, 35759, 35763,
+ 35770, 35775, 35779, 35784, 35790, 35795, 35801, 35806, 35810, 35814,
+ 35818, 35823, 35827, 35832, 35836, 35843, 35848, 35852, 35857, 35861,
+ 35866, 35870, 35875, 35881, 13733, 13738, 35886, 35890, 35893, 35897,
+ 35902, 35906, 35912, 35919, 35924, 35934, 35939, 35947, 35951, 35954,
+ 29752, 35958, 4026, 35963, 35968, 35972, 35977, 35981, 35986, 11687,
+ 35997, 36001, 36004, 36009, 36013, 36017, 36020, 36024, 6576, 11703,
+ 36027, 36030, 36035, 36039, 36048, 36064, 36080, 36090, 25900, 36097,
+ 36101, 36106, 36111, 36115, 36119, 33644, 36125, 36130, 36134, 36141,
+ 36146, 36150, 36154, 24958, 36160, 19603, 36165, 36172, 36180, 36186,
+ 36193, 36201, 36207, 36211, 36217, 36225, 36229, 36238, 7876, 36246,
+ 36250, 36258, 36265, 36270, 36275, 36279, 36282, 36286, 36289, 36293,
+ 36300, 36305, 36311, 24377, 29034, 36315, 36322, 36328, 36334, 36339,
+ 36342, 36344, 36351, 36358, 36364, 36368, 36371, 36375, 36379, 36383,
+ 36388, 36392, 36396, 36399, 36403, 36417, 21146, 36436, 36449, 36462,
+ 36475, 21164, 36490, 8846, 36505, 36511, 36515, 36519, 36526, 36531,
+ 36535, 36542, 36548, 36553, 36559, 36569, 36581, 36592, 36597, 36604,
+ 36608, 36612, 36615, 14129, 3605, 36623, 13760, 36636, 36643, 36647,
+ 36651, 36656, 36661, 36667, 36671, 36675, 36678, 6188, 13771, 36683,
+ 36687, 36693, 36702, 36707, 33504, 36713, 36718, 36722, 36727, 36734,
+ 36738, 36741, 12824, 36746, 36753, 1009, 36757, 36762, 36767, 36773,
+ 36778, 36783, 36787, 36797, 36802, 36808, 36813, 36819, 36824, 36830,
+ 36840, 36845, 36850, 36854, 5683, 5695, 36859, 36862, 36869, 36875,
+ 31793, 31800, 36884, 36888, 29800, 36896, 36907, 36915, 33692, 36922,
+ 36927, 36932, 36943, 36950, 36961, 29824, 19609, 36969, 722, 36974,
+ 36980, 25984, 36986, 36991, 37001, 37010, 37017, 37023, 37027, 37030,
+ 37037, 37043, 37050, 37056, 37066, 37074, 37080, 37086, 37091, 37095,
+ 37102, 37108, 37115, 36384, 530, 12112, 37121, 37126, 37129, 37135,
+ 37143, 1364, 37148, 37152, 37157, 37164, 37170, 37174, 37179, 37188,
+ 37195, 37205, 37211, 26019, 37228, 37237, 37245, 37251, 37256, 37263,
+ 37269, 37277, 37286, 37294, 37298, 37303, 37311, 29833, 37317, 37336,
+ 14062, 37350, 37366, 37380, 37386, 37391, 37396, 37401, 37407, 29839,
+ 37412, 37419, 37424, 37428, 341, 2878, 37435, 37440, 37445, 25275, 37266,
+ 37449, 37454, 37462, 37466, 37469, 37475, 37479, 26074, 37482, 37487,
+ 37491, 37494, 37499, 37503, 37508, 37513, 37517, 37522, 37526, 37530,
+ 19346, 19357, 37534, 37539, 37545, 24915, 37550, 37554, 19425, 14280,
+ 37557, 37562, 37567, 37572, 37577, 37582, 37587, 37592, 440, 43, 29052,
+ 29057, 29062, 29068, 29073, 29078, 37597, 29082, 37601, 37605, 29087,
+ 29093, 37609, 29104, 29109, 37617, 37622, 29115, 37627, 37632, 37637,
+ 37642, 37648, 37654, 37660, 29132, 37673, 37679, 29136, 37683, 29141,
+ 37688, 29146, 29151, 37691, 37696, 37700, 28795, 37706, 11911, 37713,
+ 37718, 29156, 37722, 37727, 37732, 37737, 37741, 37746, 37751, 37757,
+ 37762, 37767, 37773, 37779, 37784, 37788, 37793, 37798, 37803, 37807,
+ 37812, 37817, 37822, 37828, 37834, 37840, 37845, 37849, 37854, 37858,
+ 29160, 29165, 29170, 37862, 37866, 29175, 29181, 29187, 29199, 37878,
+ 23983, 37882, 37886, 37891, 37896, 37901, 37905, 37909, 37919, 37924,
+ 37929, 37933, 37937, 37940, 37948, 29247, 37953, 1442, 37959, 37967,
+ 37976, 37980, 37988, 37994, 38002, 38018, 38023, 38038, 29284, 1712,
+ 10375, 38042, 2924, 38054, 38055, 38063, 38070, 38075, 38082, 38087,
+ 7746, 1090, 8675, 38094, 38099, 38102, 38105, 38114, 1275, 38119, 36532,
+ 38126, 38131, 20583, 2511, 38135, 9094, 38145, 38151, 2291, 2301, 38160,
+ 38169, 38179, 38190, 3235, 31944, 8727, 3735, 14882, 1280, 38195, 38203,
+ 38210, 38215, 38219, 38223, 21930, 8754, 38231, 38240, 38249, 38257,
+ 38264, 38269, 38282, 38295, 38307, 38319, 38331, 38344, 38355, 38366,
+ 38376, 38384, 38392, 38404, 38416, 38427, 38436, 38444, 38451, 38463,
+ 38470, 38479, 38486, 38499, 38504, 38514, 38519, 38525, 38530, 34759,
+ 38534, 38541, 38545, 38552, 38560, 2472, 38567, 38578, 38588, 38597,
+ 38605, 38615, 38623, 38633, 38642, 38647, 38653, 38659, 38670, 38680,
+ 38689, 38698, 38708, 38716, 38725, 38730, 38735, 38740, 1668, 37, 38748,
+ 38756, 38767, 38778, 14563, 38788, 38795, 38801, 38806, 38810, 38821,
+ 38831, 38840, 38851, 14931, 14936, 38856, 38865, 38870, 38880, 38885,
+ 38893, 38901, 38908, 38914, 5536, 1038, 38918, 38924, 38929, 38932, 2075,
+ 36648, 38940, 38944, 38947, 1475, 38953, 12261, 1285, 38958, 38971,
+ 38985, 2597, 39003, 39015, 39027, 2611, 2628, 39041, 39054, 2643, 39068,
+ 39080, 2658, 39094, 1291, 1297, 1303, 9012, 39099, 39104, 39109, 39113,
+ 39128, 39143, 39158, 39173, 39188, 39203, 39218, 39233, 39248, 39263,
+ 39278, 39293, 39308, 39323, 39338, 39353, 39368, 39383, 39398, 39413,
+ 39428, 39443, 39458, 39473, 39488, 39503, 39518, 39533, 39548, 39563,
+ 39578, 39593, 39608, 39623, 39638, 39653, 39668, 39683, 39698, 39713,
+ 39728, 39743, 39758, 39773, 39788, 39803, 39818, 39833, 39848, 39863,
+ 39878, 39893, 39908, 39923, 39938, 39953, 39968, 39983, 39998, 40013,
+ 40028, 40043, 40058, 40073, 40088, 40103, 40118, 40133, 40148, 40163,
+ 40178, 40193, 40208, 40223, 40238, 40253, 40268, 40283, 40298, 40313,
+ 40328, 40343, 40358, 40373, 40388, 40403, 40418, 40433, 40448, 40463,
+ 40478, 40493, 40508, 40523, 40538, 40553, 40568, 40583, 40598, 40613,
+ 40628, 40643, 40658, 40673, 40688, 40703, 40718, 40733, 40748, 40763,
+ 40778, 40793, 40808, 40823, 40838, 40853, 40868, 40883, 40898, 40913,
+ 40928, 40943, 40958, 40973, 40988, 41003, 41018, 41033, 41048, 41063,
+ 41078, 41093, 41108, 41123, 41138, 41153, 41168, 41183, 41198, 41213,
+ 41228, 41243, 41258, 41273, 41288, 41303, 41318, 41333, 41348, 41363,
+ 41378, 41393, 41408, 41423, 41438, 41453, 41468, 41483, 41498, 41513,
+ 41528, 41543, 41558, 41573, 41588, 41603, 41618, 41633, 41648, 41663,
+ 41678, 41693, 41708, 41723, 41738, 41753, 41768, 41783, 41798, 41813,
+ 41828, 41843, 41858, 41873, 41888, 41903, 41918, 41933, 41948, 41963,
+ 41978, 41993, 42008, 42023, 42038, 42053, 42068, 42083, 42098, 42113,
+ 42128, 42143, 42158, 42173, 42188, 42203, 42218, 42233, 42248, 42263,
+ 42278, 42293, 42308, 42323, 42338, 42353, 42368, 42383, 42398, 42413,
+ 42428, 42443, 42458, 42473, 42488, 42503, 42518, 42533, 42548, 42563,
+ 42578, 42593, 42608, 42623, 42638, 42653, 42668, 42683, 42698, 42713,
+ 42728, 42743, 42758, 42773, 42788, 42803, 42818, 42833, 42848, 42863,
+ 42878, 42893, 42908, 42923, 42938, 42953, 42968, 42983, 42998, 43013,
+ 43028, 43043, 43058, 43073, 43088, 43103, 43118, 43133, 43148, 43163,
+ 43178, 43193, 43208, 43223, 43238, 43253, 43268, 43283, 43298, 43313,
+ 43328, 43343, 43358, 43373, 43388, 43403, 43418, 43433, 43448, 43463,
+ 43478, 43493, 43508, 43523, 43538, 43553, 43568, 43583, 43598, 43613,
+ 43628, 43643, 43658, 43673, 43688, 43703, 43718, 43733, 43748, 43763,
+ 43778, 43793, 43808, 43823, 43838, 43853, 43868, 43883, 43898, 43913,
+ 43928, 43943, 43958, 43973, 43988, 44003, 44018, 44033, 44048, 44063,
+ 44078, 44093, 44108, 44123, 44138, 44153, 44168, 44183, 44198, 44213,
+ 44228, 44243, 44258, 44273, 44288, 44303, 44318, 44333, 44348, 44363,
+ 44378, 44393, 44408, 44423, 44438, 44453, 44468, 44483, 44498, 44513,
+ 44528, 44543, 44558, 44573, 44588, 44603, 44618, 44633, 44648, 44663,
+ 44678, 44693, 44708, 44723, 44738, 44753, 44768, 44783, 44798, 44813,
+ 44828, 44843, 44858, 44873, 44888, 44903, 44918, 44933, 44948, 44963,
+ 44978, 44993, 45008, 45023, 45038, 45053, 45068, 45083, 45098, 45113,
+ 45128, 45143, 45158, 45173, 45188, 45203, 45218, 45233, 45248, 45263,
+ 45278, 45293, 45308, 45323, 45338, 45353, 45368, 45383, 45398, 45413,
+ 45428, 45443, 45458, 45473, 45488, 45503, 45518, 45533, 45548, 45563,
+ 45578, 45593, 45608, 45623, 45638, 45653, 45668, 45683, 45698, 45713,
+ 45728, 45743, 45758, 45773, 45788, 45803, 45818, 45833, 45848, 45863,
+ 45878, 45893, 45908, 45923, 45938, 45953, 45968, 45983, 45998, 46013,
+ 46028, 46043, 46058, 46073, 46088, 46103, 46118, 46133, 46148, 46163,
+ 46178, 46193, 46208, 46223, 46238, 46253, 46268, 46283, 46298, 46313,
+ 46328, 46343, 46358, 46373, 46388, 46403, 46418, 46433, 46448, 46463,
+ 46478, 46493, 46508, 46523, 46538, 46553, 46568, 46583, 46598, 46613,
+ 46628, 46643, 46658, 46673, 46688, 46703, 46718, 46733, 46748, 46763,
+ 46778, 46793, 46808, 46823, 46838, 46853, 46868, 46883, 46899, 46915,
+ 46931, 46947, 46963, 46979, 46995, 47011, 47027, 47043, 47059, 47075,
+ 47091, 47107, 47123, 47139, 47155, 47171, 47187, 47203, 47219, 47235,
+ 47251, 47267, 47283, 47299, 47315, 47331, 47347, 47363, 47379, 47395,
+ 47411, 47427, 47443, 47459, 47475, 47491, 47507, 47523, 47539, 47555,
+ 47571, 47587, 47603, 47619, 47635, 47651, 47667, 47683, 47699, 47715,
+ 47731, 47747, 47763, 47779, 47795, 47811, 47827, 47843, 47859, 47875,
+ 47891, 47907, 47923, 47939, 47955, 47971, 47987, 48003, 48019, 48035,
+ 48051, 48067, 48083, 48099, 48115, 48131, 48147, 48163, 48179, 48195,
+ 48211, 48227, 48243, 48259, 48275, 48291, 48307, 48323, 48339, 48355,
+ 48371, 48387, 48403, 48419, 48435, 48451, 48467, 48483, 48499, 48515,
+ 48531, 48547, 48563, 48579, 48595, 48611, 48627, 48643, 48659, 48675,
+ 48691, 48707, 48723, 48739, 48755, 48771, 48787, 48803, 48819, 48835,
+ 48851, 48867, 48883, 48899, 48915, 48931, 48947, 48963, 48979, 48995,
+ 49011, 49027, 49043, 49059, 49075, 49091, 49107, 49123, 49139, 49155,
+ 49171, 49187, 49203, 49219, 49235, 49251, 49267, 49283, 49299, 49315,
+ 49331, 49347, 49363, 49379, 49395, 49411, 49427, 49443, 49459, 49475,
+ 49491, 49507, 49523, 49539, 49555, 49571, 49587, 49603, 49619, 49635,
+ 49651, 49667, 49683, 49699, 49715, 49731, 49747, 49763, 49779, 49795,
+ 49811, 49827, 49843, 49859, 49875, 49891, 49907, 49923, 49939, 49955,
+ 49971, 49987, 50003, 50019, 50035, 50051, 50067, 50083, 50099, 50115,
+ 50131, 50147, 50163, 50179, 50195, 50211, 50227, 50243, 50259, 50275,
+ 50291, 50307, 50323, 50339, 50355, 50371, 50387, 50403, 50419, 50435,
+ 50451, 50467, 50483, 50499, 50515, 50531, 50547, 50563, 50579, 50595,
+ 50611, 50627, 50643, 50659, 50675, 50691, 50707, 50723, 50739, 50755,
+ 50771, 50787, 50803, 50819, 50835, 50851, 50867, 50883, 50899, 50915,
+ 50931, 50947, 50963, 50979, 50995, 51011, 51027, 51043, 51059, 51075,
+ 51091, 51107, 51123, 51139, 51155, 51171, 51187, 51203, 51219, 51235,
+ 51251, 51267, 51283, 51299, 51315, 51331, 51347, 51363, 51379, 51395,
+ 51411, 51427, 51443, 51459, 51475, 51491, 51507, 51523, 51539, 51555,
+ 51571, 51587, 51603, 51619, 51635, 51651, 51667, 51683, 51699, 51715,
+ 51731, 51747, 51763, 51779, 51795, 51811, 51827, 51843, 51859, 51875,
+ 51891, 51907, 51923, 51939, 51955, 51971, 51987, 52003, 52019, 52035,
+ 52051, 52067, 52083, 52099, 52115, 52131, 52147, 52163, 52179, 52195,
+ 52211, 52227, 52243, 52259, 52275, 52291, 52307, 52323, 52339, 52355,
+ 52371, 52387, 52403, 52419, 52435, 52451, 52467, 52483, 52499, 52515,
+ 52531, 52547, 52563, 52579, 52595, 52611, 52627, 52643, 52659, 52675,
+ 52691, 52707, 52723, 52739, 52755, 52771, 52787, 52803, 52819, 52835,
+ 52851, 52867, 52883, 52899, 52915, 52931, 52947, 52963, 52979, 52995,
+ 53011, 53027, 53043, 53059, 53075, 53091, 53107, 53123, 53139, 53155,
+ 53171, 53187, 53203, 53219, 53235, 53251, 53267, 53283, 53299, 53315,
+ 53331, 53347, 53363, 53379, 53395, 53411, 53427, 53443, 53459, 53475,
+ 53491, 53507, 53523, 53539, 53555, 53571, 53587, 53603, 53619, 53635,
+ 53651, 53667, 53683, 53699, 53715, 53731, 53747, 53763, 53779, 53795,
+ 53811, 53827, 53843, 53859, 53875, 53891, 53907, 53923, 53939, 53955,
+ 53971, 53987, 54003, 54019, 54035, 54051, 54067, 54083, 54099, 54115,
+ 54131, 54147, 54163, 54179, 54195, 54211, 54227, 54243, 54259, 54275,
+ 54291, 54307, 54323, 54339, 54355, 54371, 54387, 54403, 54419, 54435,
+ 54451, 54467, 54483, 54499, 54515, 54531, 54547, 54563, 54579, 54595,
+ 54611, 54627, 54643, 54659, 54675, 54691, 54707, 54723, 54739, 54755,
+ 54771, 54787, 54803, 54819, 54835, 54851, 54867, 54883, 54899, 54915,
+ 54931, 54947, 54963, 54979, 54995, 55011, 55027, 55043, 55059, 55075,
+ 55091, 55107, 55123, 55139, 55155, 55171, 55187, 55203, 55219, 55235,
+ 55251, 55267, 55283, 55299, 55315, 55331, 55347, 55363, 55379, 55395,
+ 55411, 55427, 55443, 55459, 55475, 55491, 55507, 55523, 55539, 55555,
+ 55570, 14963, 55579, 55585, 55591, 55601, 55609, 13144, 13683, 8319,
+ 55622, 1483, 55630, 25385, 5637, 55636, 55641, 55646, 55651, 55656,
+ 55662, 55667, 55673, 55678, 55684, 55689, 55694, 55699, 55704, 55710,
+ 55715, 55720, 55725, 55730, 55735, 55740, 55745, 55751, 55756, 55762,
+ 55769, 2515, 55774, 55780, 6948, 55784, 55789, 55796, 55804, 40, 55808,
+ 55814, 55819, 55824, 55828, 55833, 55837, 55841, 9037, 55845, 55855,
+ 55868, 55879, 55892, 55899, 55905, 55910, 55916, 55922, 55928, 55933,
+ 55938, 55943, 55948, 55952, 55957, 55962, 55967, 55973, 55979, 55985,
+ 55990, 55994, 55999, 56004, 56008, 56013, 56018, 56023, 56027, 9053,
+ 9064, 9069, 1526, 56031, 1531, 56037, 56040, 1562, 56046, 1568, 1574,
+ 9099, 56051, 56059, 56066, 56070, 56076, 56081, 28824, 56086, 56093,
+ 56098, 56102, 56106, 1579, 14538, 14549, 56115, 56122, 56127, 56131,
+ 14568, 1583, 34897, 56134, 56139, 56149, 56158, 56163, 56167, 56173,
+ 1588, 36719, 56178, 56187, 56193, 56198, 9249, 9255, 56204, 56216, 56233,
+ 56250, 56267, 56284, 56301, 56318, 56335, 56352, 56369, 56386, 56403,
+ 56420, 56437, 56454, 56471, 56488, 56505, 56522, 56539, 56556, 56573,
+ 56590, 56607, 56624, 56641, 56658, 56675, 56692, 56709, 56726, 56743,
+ 56760, 56777, 56794, 56811, 56828, 56845, 56862, 56879, 56896, 56913,
+ 56930, 56947, 56964, 56981, 56998, 57015, 57032, 57049, 57060, 57065,
+ 1593, 57069, 57075, 57080, 7693, 1598, 57085, 57094, 25664, 57099, 57110,
+ 57120, 57125, 57132, 57138, 57143, 57148, 14820, 57152, 9266, 1603, 9271,
+ 57158, 57163, 57169, 57174, 57179, 57184, 57189, 57194, 57199, 57204,
+ 57210, 57216, 57222, 57227, 57231, 57236, 57241, 57245, 57250, 57255,
+ 57260, 57264, 57269, 57275, 57280, 57285, 57289, 57294, 57299, 57305,
+ 57310, 57315, 57321, 57327, 57332, 57336, 57341, 57346, 57351, 57355,
+ 57360, 57365, 57370, 57376, 57382, 57387, 57391, 57395, 57400, 57405,
+ 57410, 27024, 57414, 57419, 57424, 57430, 57435, 57440, 57444, 57449,
+ 57454, 57460, 57465, 57470, 57476, 57482, 57487, 57491, 57496, 57501,
+ 57505, 57510, 57515, 57520, 57526, 57532, 57537, 57541, 57546, 57551,
+ 57555, 57560, 57565, 57570, 57574, 57577, 29395, 57582, 57590, 14886,
+ 14910, 9362, 57596, 57606, 57621, 9367, 57632, 57637, 57648, 57660,
+ 57672, 57684, 2649, 57696, 57701, 57705, 57711, 57717, 57722, 1615, 1010,
+ 57731, 57736, 36758, 57740, 57744, 57749, 57753, 14971, 57758, 57761,
+ 57769, 57777, 1619, 9392, 9398, 1624, 57785, 57792, 57797, 57806, 57816,
+ 57823, 57828, 1629, 57835, 57840, 15086, 57844, 57849, 57856, 57862,
+ 57866, 57877, 57887, 15108, 7616, 7623, 1634, 57894, 57900, 57908, 57915,
+ 57921, 57928, 57940, 57946, 57951, 57963, 57974, 57983, 57993, 3668,
+ 28660, 28669, 15148, 1639, 1643, 58001, 58012, 58017, 1646, 58025, 58030,
+ 58042, 58048, 58053, 58061, 1651, 58066, 58071, 58079, 58087, 58094,
+ 58103, 58111, 58120, 1656, 58124, 1661, 58129, 58136, 15268, 58144,
+ 58150, 58155, 58163, 58170, 58178, 20658, 58183, 9527, 58192, 58198,
+ 58205, 58212, 58218, 58228, 58234, 58239, 58244, 58252, 9536, 9541,
+ 58260, 58266, 58274, 3733, 36846, 58279, 58285, 58290, 58298, 58305,
+ 10356, 58310, 58316, 1672, 58321, 58324, 1058, 58330, 58335, 58340,
+ 58346, 58351, 58356, 58361, 58366, 58371, 58376, 1681, 9, 58382, 58386,
+ 58391, 58395, 58399, 58403, 29643, 58408, 58413, 58418, 58422, 58425,
+ 58429, 58433, 58438, 58442, 58447, 58451, 32315, 32320, 32325, 58454,
+ 58461, 58467, 36585, 58477, 32331, 29891, 29653, 29659, 32347, 29665,
+ 58482, 58487, 29924, 58491, 58494, 58498, 58505, 58508, 58513, 58517,
+ 58521, 58524, 58534, 58546, 58553, 31282, 58556, 13936, 821, 58559,
+ 58563, 58568, 58572, 58575, 11944, 58582, 58589, 58602, 58610, 58619,
+ 58624, 58634, 58647, 58659, 58666, 58671, 58680, 58693, 33732, 58711,
+ 58716, 58723, 58729, 58734, 58742, 58749, 25224, 613, 58755, 58761,
+ 58771, 58777, 58782, 29683, 4481, 29697, 58786, 58796, 58801, 58811,
+ 58826, 58832, 58838, 29707, 58843, 28856, 58847, 58852, 58857, 58861,
+ 58866, 15151, 58873, 58878, 58882, 4522, 29733, 58886, 58892, 327, 58902,
+ 58909, 58916, 58921, 58930, 56143, 58936, 58944, 58948, 58952, 58956,
+ 58960, 58965, 58969, 58975, 58983, 58988, 58993, 58997, 59002, 59006,
+ 59010, 59016, 59022, 59027, 59031, 29857, 59036, 29863, 29869, 59041,
+ 59047, 59054, 59059, 59063, 28873, 14813, 59066, 59070, 59075, 59082,
+ 59088, 59092, 59097, 36295, 59103, 59107, 59111, 59116, 59122, 59128,
+ 59140, 59149, 59159, 59165, 59172, 59177, 59182, 59186, 59189, 59195,
+ 59202, 59207, 59212, 59219, 59226, 59232, 59237, 59242, 59250, 59255,
+ 2377, 59259, 59264, 59270, 59275, 59281, 59286, 59291, 59296, 59302,
+ 29890, 59307, 59313, 59319, 59325, 29954, 59330, 59335, 59340, 29965,
+ 59345, 59350, 59355, 59361, 59367, 29970, 59372, 59377, 59382, 30025,
+ 30031, 59387, 59392, 30036, 59397, 25891, 30058, 30062, 59402, 59378,
+ 59406, 59414, 59420, 59428, 59435, 59441, 59451, 59457, 59464, 8984,
+ 30076, 59470, 59483, 59492, 59498, 59507, 59513, 21575, 59520, 59527,
+ 59537, 30026, 59540, 59547, 59552, 59556, 59560, 59565, 4598, 59569,
+ 59574, 59579, 32409, 32414, 59583, 32428, 59588, 32433, 59593, 59599,
+ 32445, 32451, 32457, 59604, 59610, 20619, 59621, 59624, 59636, 59644,
+ 30094, 59648, 59657, 59667, 59676, 30099, 59681, 59688, 59697, 59703,
+ 59711, 59718, 4573, 4310, 59723, 30037, 59729, 59732, 59738, 59745,
+ 59750, 59755, 21502, 59759, 59765, 59771, 59776, 59781, 59785, 59791,
+ 59797, 31196, 826, 33406, 34304, 34310, 59802, 59806, 59810, 59813,
+ 59826, 59832, 59836, 59839, 59844, 31495, 59848, 28878, 19446, 59854,
+ 4502, 4510, 7472, 59857, 59862, 59867, 59872, 59877, 59882, 59887, 59892,
+ 59897, 59902, 59908, 59913, 59918, 59924, 59929, 59934, 59939, 59944,
+ 59949, 59954, 59960, 59965, 59971, 59976, 59981, 59986, 59991, 59996,
+ 60001, 60006, 60011, 60016, 60021, 60027, 60032, 60037, 60042, 60047,
+ 60052, 60057, 60063, 60068, 60073, 60078, 60083, 60088, 60093, 60098,
+ 60103, 60108, 60114, 60119, 60124, 60129, 60134, 60140, 60146, 60151,
+ 60157, 60162, 60167, 60172, 60177, 60182, 1476, 240, 60187, 60191, 60195,
+ 60199, 23157, 60203, 60207, 60212, 60216, 60221, 60225, 60229, 60233,
+ 60238, 60242, 11681, 60247, 60251, 60258, 13444, 60267, 60276, 60280,
+ 60285, 60290, 60294, 22960, 2957, 60298, 60304, 60313, 60321, 60327,
+ 60339, 60351, 60355, 60360, 60364, 60370, 60376, 60381, 60391, 60401,
+ 60407, 60412, 60416, 60421, 60427, 60436, 60445, 60453, 13798, 60457,
+ 60466, 60474, 60486, 60497, 60508, 60517, 60521, 60530, 60540, 60546,
+ 60551, 60557, 60562, 98, 28772, 60573, 24228, 24238, 60579, 60586, 60592,
+ 60596, 60606, 60617, 60625, 60634, 60639, 60644, 60648, 15504, 60656,
+ 60660, 60666, 60676, 60683, 60689, 32508, 1162, 60695, 60698, 60702,
+ 60712, 60718, 60725, 11618, 60732, 60738, 60747, 60756, 60762, 60768,
+ 60774, 60779, 60786, 60793, 60799, 60812, 60821, 60830, 60835, 60839,
+ 60845, 60852, 60859, 60866, 60873, 60880, 60885, 60889, 60893, 60896,
+ 60906, 60910, 60922, 60931, 60935, 60940, 60944, 60950, 60955, 60962,
+ 60971, 60979, 60987, 60992, 60996, 61001, 61006, 61016, 61024, 61029,
+ 61033, 61037, 61043, 61055, 61063, 61073, 61080, 61086, 61091, 61095,
+ 61099, 61103, 61112, 61121, 61130, 61136, 61142, 61148, 61153, 61160,
+ 61166, 61174, 61181, 10772, 61187, 61193, 61197, 12523, 61201, 61206,
+ 61216, 61225, 61231, 61237, 61245, 61252, 61256, 61260, 61266, 61274,
+ 61281, 61287, 61298, 61302, 61306, 61310, 61313, 61319, 61324, 61328,
+ 61332, 61341, 61349, 61356, 61362, 61369, 22087, 36337, 61374, 61382,
+ 61386, 61389, 61397, 61404, 61410, 61419, 61427, 61433, 61438, 61442,
+ 61447, 61451, 61455, 61460, 61469, 61473, 61480, 61487, 61493, 61501,
+ 61507, 61518, 61526, 61532, 20753, 61541, 61548, 61555, 61562, 61569,
+ 61576, 39288, 11456, 61583, 61590, 61595, 32544, 37484, 61601, 61606,
+ 61611, 61617, 61623, 61629, 61634, 61639, 61644, 61649, 61655, 61660,
+ 61666, 61671, 61677, 61682, 61687, 61692, 61697, 61702, 61707, 61712,
+ 61718, 61723, 61729, 61734, 61739, 61744, 61749, 61754, 61759, 61765,
+ 61770, 61775, 61780, 61785, 61790, 61795, 61800, 61805, 61810, 61815,
+ 61821, 61826, 61831, 61836, 61841, 61846, 61851, 61856, 61861, 61867,
+ 61872, 61877, 61882, 61887, 61892, 61897, 61902, 61907, 61912, 61917,
+ 61922, 61927, 61933, 1797, 224, 34993, 61938, 61941, 61946, 61950, 61953,
+ 61958, 60983, 61969, 61979, 61986, 62002, 62011, 62021, 62031, 62039,
+ 62047, 62051, 62054, 62061, 62067, 62078, 62090, 62101, 62110, 62117,
+ 1286, 21391, 62127, 2544, 62131, 62140, 1127, 15477, 35622, 62148, 62156,
+ 62170, 62183, 62187, 62192, 62197, 62202, 62208, 62214, 62219, 6957,
+ 62224, 62232, 9393, 62237, 62243, 1684, 9405, 723, 62252, 62261, 62271,
+ 24992, 62280, 62286, 15063, 62292, 62296, 3881, 9736, 62302, 58007,
+ 62309, 3905, 184, 12444, 62315, 62327, 62331, 62337, 25684, 62341, 9724,
+ 2684, 4, 62346, 62356, 62362, 62373, 62380, 62386, 62392, 62400, 62407,
+ 62413, 62423, 62433, 62443, 1298, 62452, 62458, 2707, 2713, 6954, 2218,
+ 62462, 62466, 62475, 62483, 62494, 62502, 62510, 62516, 62521, 62532,
+ 62543, 62551, 62557, 8061, 62562, 62570, 62574, 62578, 62590, 26060,
+ 62597, 62607, 62613, 62619, 8163, 62629, 62640, 62650, 62659, 62663,
+ 62670, 1129, 2537, 62680, 62685, 62693, 62701, 62712, 62719, 62733,
+ 12369, 379, 62743, 62747, 62756, 62764, 62770, 62784, 62791, 62797,
+ 62806, 62813, 62823, 62831, 3740, 189, 62839, 62850, 62854, 62866, 25882,
+ 156, 62872, 62877, 62881, 62888, 62894, 62902, 62909, 7226, 62916, 62925,
+ 62933, 3806, 62946, 15109, 62950, 2752, 428, 62955, 62968, 62973, 1796,
+ 647, 62977, 3812, 62985, 62991, 963, 63001, 63010, 63015, 13178, 13185,
+ 42620, 63019, 3750, 11350, 63027, 63034, 21618, 63038, 63045, 63051,
+ 63056, 63061, 13198, 354, 63066, 63078, 63084, 63092, 2764, 1716, 63100,
+ 63102, 63107, 63112, 63117, 63123, 63128, 63133, 63138, 63143, 63148,
+ 63153, 63159, 63164, 63169, 63174, 63179, 63184, 63189, 63194, 63199,
+ 63205, 63210, 63215, 63220, 63226, 63231, 63237, 63242, 63247, 63252,
+ 63257, 63262, 63267, 63272, 63278, 63283, 63289, 63294, 63299, 63304,
+ 63309, 63314, 63319, 63324, 63329, 63335, 63340, 63345, 63349, 63353,
+ 63358, 63362, 63367, 63372, 63378, 63383, 63387, 63392, 63396, 63399,
+ 63401, 63405, 63408, 63413, 63417, 63421, 63425, 63429, 63438, 63442,
+ 30288, 63445, 30293, 63452, 63457, 30298, 63466, 63475, 30304, 63480,
+ 30309, 63489, 63494, 9914, 63498, 63503, 63508, 30314, 63512, 37650,
+ 63516, 63519, 63523, 6638, 63529, 63534, 63538, 3633, 30319, 63541,
+ 63545, 63548, 63553, 63557, 63563, 63571, 63584, 63593, 63599, 63604,
+ 63610, 63614, 63620, 63628, 63633, 63640, 63646, 63654, 63663, 63671,
+ 30322, 63678, 63688, 63697, 63710, 63715, 63720, 63729, 63735, 63742,
+ 63753, 63765, 63772, 63781, 63790, 63799, 63806, 63812, 63819, 63827,
+ 63834, 63842, 63851, 63859, 63866, 63874, 63883, 63891, 63900, 63910,
+ 63919, 63927, 63934, 63942, 63951, 63959, 63968, 63978, 63987, 63995,
+ 64004, 64014, 64023, 64033, 64044, 64054, 64063, 64071, 64078, 64086,
+ 64095, 64103, 64112, 64122, 64131, 64139, 64148, 64158, 64167, 64177,
+ 64188, 64198, 64207, 64215, 64224, 64234, 64243, 64253, 64264, 64274,
+ 64283, 64293, 64304, 64314, 64325, 64337, 64348, 64358, 64367, 64375,
+ 64382, 64390, 64399, 64407, 64416, 64426, 64435, 64443, 64452, 64462,
+ 64471, 64481, 64492, 64502, 64511, 64519, 64528, 64538, 64547, 64557,
+ 64568, 64578, 64587, 64597, 64608, 64618, 64629, 64641, 64652, 64662,
+ 64671, 64679, 64688, 64698, 64707, 64717, 64728, 64738, 64747, 64757,
+ 64768, 64778, 64789, 64801, 64812, 64822, 64831, 64841, 64852, 64862,
+ 64873, 64885, 64896, 64906, 64917, 64929, 64940, 64952, 64965, 64977,
+ 64988, 64998, 65007, 65015, 65022, 65030, 65039, 65047, 65056, 65066,
+ 65075, 65083, 65092, 65102, 65111, 65121, 65132, 65142, 65151, 65159,
+ 65168, 65178, 65187, 65197, 65208, 65218, 65227, 65237, 65248, 65258,
+ 65269, 65281, 65292, 65302, 65311, 65319, 65328, 65338, 65347, 65357,
+ 65368, 65378, 65387, 65397, 65408, 65418, 65429, 65441, 65452, 65462,
+ 65471, 65481, 65492, 65502, 65513, 65525, 65536, 65546, 65557, 65569,
+ 65580, 65592, 65605, 65617, 65628, 65638, 65647, 65655, 65664, 65674,
+ 65683, 65693, 65704, 65714, 65723, 65733, 65744, 65754, 65765, 65777,
+ 65788, 65798, 65807, 65817, 65828, 65838, 65849, 65861, 65872, 65882,
+ 65893, 65905, 65916, 65928, 65941, 65953, 65964, 65974, 65983, 65993,
+ 66004, 66014, 66025, 66037, 66048, 66058, 66069, 66081, 66092, 66104,
+ 66117, 66129, 66140, 66150, 66161, 66173, 66184, 66196, 66209, 66221,
+ 66232, 66244, 66257, 66269, 66282, 66296, 66309, 66321, 66332, 66342,
+ 66351, 66359, 66366, 66371, 6489, 66378, 30332, 66383, 66388, 30337,
+ 66394, 19100, 30342, 66399, 66405, 66413, 66419, 66425, 66432, 66439,
+ 66444, 66448, 66451, 66455, 66464, 66470, 66482, 66493, 66497, 3019,
+ 6464, 66502, 66505, 66507, 66511, 66515, 66519, 23927, 66524, 66528,
+ 66531, 66536, 66540, 66547, 66553, 66557, 66561, 66564, 30359, 66569,
+ 66576, 66585, 66593, 66604, 66612, 66620, 66627, 66634, 66640, 66651,
+ 30364, 66656, 66667, 66679, 66687, 66698, 66707, 66718, 66723, 66731,
+ 2510, 66736, 32002, 66749, 66753, 66765, 66773, 66778, 66786, 15664,
+ 66797, 66803, 66810, 66818, 66824, 30374, 66829, 3831, 55605, 66836,
+ 66839, 66847, 66860, 66873, 66886, 66899, 66906, 66917, 66926, 39105,
+ 39110, 66931, 66935, 66943, 66950, 66959, 66967, 66973, 66982, 66990,
+ 66998, 67002, 67011, 67020, 67030, 67043, 67056, 67066, 30379, 67072,
+ 67079, 67085, 30385, 67090, 67093, 67097, 67105, 67114, 38843, 67122,
+ 67131, 67139, 67146, 67154, 67164, 67173, 67182, 67191, 67199, 67210,
+ 67220, 7733, 19715, 67229, 67234, 67239, 67243, 67247, 67252, 67258,
+ 67263, 67268, 67274, 67279, 67284, 19680, 67289, 67296, 67304, 67312,
+ 67317, 67324, 67331, 67335, 67339, 67347, 67355, 30402, 67361, 67367,
+ 67379, 67385, 67389, 67396, 67401, 67412, 67422, 67432, 67444, 67450,
+ 67460, 67470, 30429, 67479, 67488, 67494, 67506, 67517, 67524, 67529,
+ 67533, 67541, 67547, 67552, 67557, 67564, 67572, 67584, 67594, 67603,
+ 67612, 67619, 31866, 21906, 67625, 67630, 67634, 67638, 67643, 67649,
+ 67660, 67673, 67678, 67685, 30434, 67690, 67702, 67711, 67721, 67732,
+ 67745, 67752, 67761, 67770, 67778, 67783, 67789, 1465, 67794, 67799,
+ 67804, 67809, 67815, 67820, 67825, 67831, 67837, 67842, 67846, 67851,
+ 67856, 67861, 56111, 67866, 67871, 67876, 67881, 67887, 67893, 67898,
+ 67902, 67907, 67912, 67917, 67923, 67928, 67934, 67939, 67944, 67949,
+ 67954, 67958, 67964, 67969, 67978, 67983, 67988, 67993, 67998, 68002,
+ 68009, 68015, 15326, 15333, 42875, 68020, 67970, 68022, 68032, 30443,
+ 68035, 68044, 68050, 4617, 30448, 68054, 68060, 68066, 68071, 68075,
+ 68082, 68087, 68097, 68106, 68110, 68116, 68122, 68128, 68132, 68140,
+ 68147, 68155, 68163, 30453, 68170, 68173, 68180, 68186, 68191, 68195,
+ 68201, 68208, 68213, 68217, 68226, 68234, 68240, 68245, 30458, 68252,
+ 68259, 68265, 68270, 68276, 68283, 68289, 19453, 25408, 68295, 68300,
+ 68306, 68318, 68003, 68010, 68328, 68333, 68340, 68347, 68353, 68364,
+ 68369, 7502, 68377, 68380, 68386, 68390, 68394, 68397, 68403, 30207,
+ 4656, 913, 11731, 68410, 68416, 68422, 68428, 68434, 68440, 68446, 68452,
+ 68458, 68463, 68468, 68473, 68478, 68483, 68488, 68493, 68498, 68503,
+ 68508, 68513, 68518, 68523, 68529, 68534, 68539, 68545, 68550, 68555,
+ 68561, 68567, 68573, 68579, 68585, 68591, 68597, 68603, 68609, 68614,
+ 68619, 68625, 68630, 68635, 68641, 68646, 68651, 68656, 68661, 68666,
+ 68671, 68676, 68681, 68686, 68691, 68696, 68701, 68707, 68712, 68717,
+ 68722, 68728, 68733, 68738, 68743, 68748, 68754, 68759, 68764, 68769,
+ 68774, 68779, 68784, 68789, 68794, 68799, 68804, 68809, 68814, 68819,
+ 68824, 68829, 68834, 68839, 68844, 68849, 68855, 68860, 68865, 68870,
+ 68875, 68880, 68885, 68890, 1827, 143, 68895, 68899, 68903, 68908, 68916,
+ 68920, 68927, 68935, 68939, 68952, 68960, 68964, 68967, 68972, 68976,
+ 68981, 68985, 68993, 68997, 19108, 69002, 58270, 69006, 69009, 69017,
+ 69025, 69033, 69038, 69045, 69051, 69057, 69062, 69067, 69075, 62175,
+ 69082, 69087, 69092, 69096, 9981, 69100, 69105, 69110, 69114, 69117,
+ 69123, 69127, 69137, 69146, 69149, 69156, 69169, 69175, 69183, 69194,
+ 69205, 69216, 69227, 69236, 69242, 69251, 69259, 69269, 69282, 69289,
+ 69300, 69306, 69311, 69316, 69322, 69328, 69338, 69347, 67692, 69355,
+ 69361, 69369, 69375, 69383, 69387, 69391, 69394, 69400, 69406, 69414,
+ 69426, 69438, 69445, 69449, 69460, 69468, 69475, 69487, 69495, 69503,
+ 69510, 69516, 69526, 69535, 69540, 69550, 69559, 38184, 69566, 69570,
+ 69575, 69583, 69590, 69596, 69600, 69610, 69621, 69629, 69636, 69648,
+ 69660, 69669, 66739, 69676, 69687, 69701, 69709, 69719, 69726, 69734,
+ 69746, 69755, 69763, 69773, 69782, 69793, 69805, 69814, 69824, 69831,
+ 69840, 69855, 69865, 69874, 69882, 69895, 69910, 69914, 69923, 69935,
+ 69946, 69957, 69968, 69978, 69989, 69997, 70003, 70013, 70019, 26923,
+ 70024, 70030, 70035, 70042, 8075, 15684, 70048, 70057, 70062, 70066,
+ 70073, 70079, 70084, 70092, 70100, 70104, 70107, 70110, 70112, 70119,
+ 70125, 70136, 70141, 70145, 70152, 70158, 70163, 70171, 62642, 62652,
+ 70177, 70184, 70194, 8971, 70201, 70206, 27113, 70215, 70220, 70227,
+ 70237, 70245, 70253, 70262, 70268, 70274, 70281, 70288, 70293, 70297,
+ 70305, 70310, 70315, 70323, 70330, 70335, 70341, 70344, 70348, 70357,
+ 68947, 70366, 70370, 70376, 70387, 70397, 15693, 70408, 70416, 15705,
+ 70423, 70427, 70436, 25294, 70443, 70447, 70452, 70469, 70481, 8925,
+ 70493, 70498, 70503, 70508, 70512, 70515, 70520, 70525, 70531, 70536,
+ 4324, 19181, 70541, 70546, 70552, 70559, 70564, 70569, 70575, 70581,
+ 70587, 70592, 70598, 70602, 70616, 70624, 70632, 70638, 70643, 70650,
+ 70660, 70669, 70674, 70679, 70687, 70692, 70698, 70703, 70712, 57154,
+ 70717, 70720, 70738, 70757, 70770, 70784, 70800, 70807, 70814, 70820,
+ 70827, 70832, 70838, 70844, 70852, 70858, 70863, 70868, 70884, 8938,
+ 70898, 70905, 70913, 70919, 70923, 70926, 70931, 70936, 70943, 70948,
+ 70957, 70962, 70968, 70977, 70986, 70991, 70995, 71003, 10005, 71012,
+ 71020, 71025, 71031, 10016, 71036, 71039, 71044, 71054, 71063, 71068,
+ 71074, 71079, 71087, 71094, 71105, 71115, 71120, 62103, 71125, 71131,
+ 71136, 71143, 71152, 71160, 71166, 71173, 71179, 71183, 15161, 2993,
+ 71188, 71192, 71198, 71207, 71213, 71220, 71224, 71245, 71267, 71283,
+ 71300, 71319, 71328, 71338, 71345, 71352, 25181, 71358, 71362, 71370,
+ 71382, 71388, 71396, 71400, 71408, 71415, 71419, 71425, 71431, 71436,
+ 3498, 39305, 71442, 71446, 71450, 71454, 71459, 71464, 71469, 71475,
+ 71481, 71487, 71494, 71500, 71507, 71513, 71519, 71524, 71530, 71535,
+ 71540, 71544, 71549, 39320, 71553, 71558, 71566, 71570, 71575, 71582,
+ 71591, 71597, 71604, 71608, 71611, 71618, 71627, 71632, 71636, 71644,
+ 71653, 71657, 71665, 71671, 71676, 71681, 71687, 71693, 71698, 71702,
+ 71708, 71713, 71717, 71721, 71724, 71729, 71737, 71747, 71752, 36865,
+ 71760, 71772, 71776, 71782, 71794, 71805, 71812, 71818, 71825, 71837,
+ 71844, 71850, 19255, 71854, 71860, 71867, 71873, 71879, 71884, 71889,
+ 71894, 71903, 5491, 71908, 14627, 71914, 71918, 71926, 71935, 71939,
+ 71946, 71955, 71968, 71974, 71545, 27962, 71979, 71981, 71986, 71991,
+ 71996, 72001, 72006, 72011, 72016, 72021, 72026, 72031, 72036, 72041,
+ 72046, 72051, 72057, 72062, 72067, 72072, 72077, 72082, 72087, 72092,
+ 72097, 72103, 72109, 72115, 72120, 72125, 72137, 72142, 1833, 67, 72147,
+ 72152, 30485, 30490, 30495, 30501, 30506, 72156, 30511, 20226, 72178,
+ 72182, 72186, 72191, 72195, 30515, 72199, 72207, 30520, 72214, 72217,
+ 72222, 72226, 7910, 72235, 30525, 20092, 72238, 72242, 1396, 72247,
+ 30536, 72250, 72255, 23720, 23730, 32940, 72260, 72265, 72270, 72275,
+ 72281, 72286, 72295, 72300, 72307, 72313, 72318, 72323, 72328, 72338,
+ 72347, 72352, 72360, 72364, 72372, 30350, 1188, 72379, 72385, 72390,
+ 72395, 72400, 72406, 72411, 72418, 72424, 72429, 72437, 72447, 72457,
+ 72463, 72468, 72474, 15715, 72481, 33745, 72494, 72499, 72505, 72518,
+ 72524, 72528, 72537, 72544, 72550, 72558, 72567, 72574, 72580, 72583,
+ 23861, 72587, 72594, 72600, 72608, 72613, 22035, 72619, 72622, 72630,
+ 72638, 72652, 72659, 72665, 72672, 72678, 30550, 72682, 72689, 72697,
+ 72705, 30555, 72711, 72717, 72722, 72732, 72738, 72747, 28677, 32415,
+ 72755, 72760, 72765, 72770, 72774, 13170, 36878, 72779, 72784, 30560,
+ 59554, 72788, 72793, 72797, 72806, 72814, 72820, 72825, 72831, 72838,
+ 72844, 72849, 72854, 72863, 72875, 72890, 30801, 72896, 14746, 30564,
+ 72900, 72907, 22145, 72913, 72920, 72929, 72936, 72945, 72951, 72956,
+ 72964, 72970, 30574, 72975, 72984, 71800, 72993, 73000, 73006, 73012,
+ 73022, 73030, 73037, 73041, 30579, 73044, 30585, 30591, 73049, 73057,
+ 73067, 73076, 73084, 73091, 73101, 30596, 73105, 73107, 73111, 73116,
+ 73120, 73124, 73130, 73135, 73139, 73150, 73155, 2998, 73159, 73166,
+ 73170, 73179, 73187, 73194, 73199, 73204, 59600, 73208, 73211, 73217,
+ 73225, 73231, 73235, 73240, 73247, 73252, 73258, 32446, 73263, 73266,
+ 73271, 73275, 73280, 73285, 73289, 73297, 23739, 23748, 73303, 73309,
+ 73315, 73320, 73324, 73327, 73337, 73346, 73351, 73357, 73364, 73370,
+ 73374, 73382, 73387, 32452, 73391, 73399, 73405, 73412, 73417, 73421,
+ 73426, 55791, 32458, 73432, 73437, 73441, 73446, 73451, 73456, 73460,
+ 73465, 73470, 73476, 73481, 73486, 73492, 73498, 73503, 73507, 73512,
+ 73517, 73522, 73526, 22144, 73531, 73536, 73542, 73548, 73554, 73559,
+ 73563, 73568, 73573, 73578, 73582, 73587, 73592, 73597, 73602, 73606,
+ 30600, 73614, 73618, 73626, 73634, 73645, 73650, 73654, 20497, 73659,
+ 73665, 73675, 73682, 73687, 73696, 73701, 73705, 73710, 73718, 73726,
+ 73733, 62321, 73739, 73747, 73754, 73765, 73771, 73777, 30610, 73780,
+ 73787, 73795, 73800, 37069, 73804, 73809, 73816, 73821, 7389, 73825,
+ 73833, 73840, 73847, 73853, 73867, 60629, 73875, 73881, 73885, 73888,
+ 73896, 73903, 73908, 73921, 73928, 73935, 73940, 58174, 73945, 73948,
+ 73955, 73961, 73965, 73973, 73983, 73993, 74002, 74010, 74021, 74026,
+ 74030, 74035, 74039, 33071, 19509, 33080, 74047, 74052, 74057, 74062,
+ 74067, 74072, 74077, 74081, 74086, 74091, 74096, 74101, 74106, 74111,
+ 74115, 74120, 74125, 74129, 74133, 74137, 74141, 74146, 74151, 74155,
+ 74160, 74164, 74168, 74173, 74178, 74183, 74188, 74192, 74197, 74202,
+ 74206, 74211, 74216, 74221, 74226, 74231, 74236, 74241, 74246, 74251,
+ 74256, 74261, 74266, 74271, 74276, 74281, 74286, 74291, 74296, 74301,
+ 74306, 74310, 74315, 74320, 74325, 74330, 74335, 74340, 74345, 74350,
+ 74355, 74360, 74365, 74369, 74374, 74378, 74383, 74388, 74393, 74398,
+ 74403, 74408, 74413, 74418, 74423, 74427, 74431, 74436, 74441, 74445,
+ 74450, 74455, 74459, 74464, 74469, 74474, 74479, 74483, 74488, 74493,
+ 74497, 74502, 74506, 74510, 74514, 74518, 74523, 74527, 74531, 74535,
+ 74539, 74543, 74547, 74551, 74555, 74559, 74564, 74569, 74574, 74579,
+ 74584, 74589, 74594, 74599, 74604, 74609, 74613, 74617, 74621, 74625,
+ 74629, 74633, 74638, 74642, 74647, 74651, 74656, 74661, 74665, 74669,
+ 74674, 74678, 74682, 74686, 74690, 74694, 74698, 74702, 74706, 74710,
+ 74714, 74718, 74722, 74726, 74730, 74735, 74740, 74744, 74748, 74752,
+ 74756, 74760, 74764, 74769, 74773, 74777, 74781, 74785, 74789, 74793,
+ 74798, 74802, 74807, 74811, 74815, 74819, 74823, 74827, 74831, 74835,
+ 74839, 74843, 74847, 74851, 74856, 74860, 74864, 74868, 74872, 74876,
+ 74880, 74884, 74888, 74892, 74896, 74900, 74905, 74909, 74913, 74918,
+ 74923, 74927, 74931, 74935, 74939, 74943, 74947, 74951, 74955, 74960,
+ 74964, 74969, 74973, 74978, 74982, 74987, 74991, 74997, 75002, 75006,
+ 75011, 75015, 75020, 75024, 75029, 75033, 75038, 1484, 75042, 2778, 1722,
+ 1727, 75046, 75050, 2782, 75054, 1365, 75059, 1331, 75063, 2794, 75067,
+ 75074, 75081, 75095, 2798, 5589, 75104, 75112, 75119, 75130, 75139,
+ 75146, 75158, 75171, 75184, 75195, 75200, 75207, 75219, 75223, 3918,
+ 10082, 75233, 75238, 75247, 75257, 2802, 75262, 75266, 75271, 75278,
+ 75284, 75292, 75304, 1336, 11351, 75314, 75318, 75324, 75338, 75350,
+ 75362, 75372, 75381, 75390, 75399, 75407, 75418, 75426, 3968, 75436,
+ 75445, 75451, 75466, 75473, 75479, 33197, 75484, 2826, 11355, 75488,
+ 75495, 7334, 75504, 2831, 30105, 75510, 57923, 75517, 75523, 75534,
+ 75540, 75547, 75553, 75561, 75568, 75574, 75584, 75593, 75604, 75611,
+ 75617, 75627, 75635, 75641, 75656, 75662, 75667, 75674, 75677, 75683,
+ 75690, 75696, 75704, 75713, 75721, 75727, 75736, 38845, 75750, 75755,
+ 13007, 75761, 75774, 75783, 75791, 75798, 75802, 75806, 75809, 75816,
+ 75823, 75831, 75839, 75848, 75856, 12943, 75864, 75869, 75873, 75885,
+ 75892, 75901, 780, 75911, 75920, 75931, 2847, 75935, 75939, 75945, 75958,
+ 75970, 75980, 75989, 24331, 76001, 76009, 76018, 76029, 76040, 76050,
+ 76060, 76069, 76077, 9657, 76084, 76088, 76093, 76098, 76104, 1341,
+ 10153, 76111, 76122, 76131, 76139, 76148, 76156, 76172, 76183, 76192,
+ 76200, 76212, 76223, 76239, 76249, 76270, 76283, 76291, 76298, 13118,
+ 76311, 76316, 76322, 4386, 76328, 76331, 76338, 76348, 6607, 76355,
+ 76360, 76365, 76373, 76381, 8123, 8132, 76386, 76397, 76402, 76408, 2855,
+ 2860, 76414, 9224, 76420, 76427, 76434, 76447, 2205, 50, 76452, 76457,
+ 76467, 76473, 76482, 76490, 76500, 76504, 76509, 76513, 76525, 2883,
+ 76533, 76541, 76546, 76557, 76568, 76577, 76582, 76588, 76593, 76603,
+ 76613, 76618, 76624, 76629, 76638, 19562, 76642, 4045, 12, 76647, 76656,
+ 76663, 76670, 76676, 76682, 827, 76687, 76692, 58240, 76697, 76702,
+ 76708, 76716, 76721, 76728, 76734, 76739, 35573, 38743, 76745, 2887, 32,
+ 76755, 76768, 76773, 76781, 76786, 76792, 2909, 26234, 76797, 76805,
+ 76812, 76817, 56033, 59221, 76826, 1667, 1776, 76831, 76836, 76843, 1780,
+ 242, 76850, 76856, 76861, 76868, 1784, 76873, 76879, 76884, 76896, 4597,
+ 76906, 1791, 76912, 76917, 76924, 76931, 76946, 76953, 76964, 76972,
+ 2572, 76976, 76988, 76993, 76997, 77003, 26059, 2210, 77007, 77018,
+ 77022, 77026, 77032, 77036, 77045, 77049, 77060, 77064, 2256, 29944,
+ 77068, 77078, 3018, 7738, 77086, 77091, 77095, 77104, 77111, 77117, 2988,
+ 15343, 77121, 77134, 77152, 77157, 77165, 77173, 77183, 11457, 77195,
+ 77208, 77215, 77222, 77238, 77245, 77251, 1024, 77258, 77265, 77275,
+ 77284, 77296, 39709, 77304, 3002, 10350, 77307, 77315, 77319, 3006,
+ 77323, 19358, 10366, 3684, 77327, 3012, 77331, 77341, 77347, 77353,
+ 77359, 77365, 77371, 77377, 77383, 77389, 77395, 77401, 77407, 77413,
+ 77419, 77425, 77431, 77437, 77443, 77449, 77455, 77461, 77467, 77473,
+ 77479, 77485, 77491, 77498, 77505, 77511, 77517, 77523, 77529, 77535,
+ 77541, 1346, 14270, 10388, 77547, 77552, 77557, 77562, 77567, 77572,
+ 77577, 77582, 77587, 77592, 77597, 77602, 77607, 77612, 77617, 77622,
+ 77627, 77632, 77637, 77642, 77647, 77652, 77657, 77662, 77667, 77672,
+ 77678, 77683, 77688, 77694, 77699, 77705, 77710, 77715, 77721, 77726,
+ 77731, 77736, 77741, 77746, 77751, 77756, 77761, 77342, 77348, 77354,
+ 77360, 77366, 77372, 77378, 77384, 77390, 77396, 77402, 77408, 77414,
+ 77420, 77426, 77767, 77432, 77438, 77444, 77773, 77450, 77456, 77462,
+ 77468, 77474, 77480, 77486, 77506, 77779, 77785, 77512, 77791, 77518,
+ 77524, 77530, 77536, 77542, 3033, 3038, 77797, 77802, 77805, 77811,
+ 77817, 77824, 77829, 77834, 2261,
};
/* code->name phrasebook */
#define phrasebook_shift 7
-#define phrasebook_short 222
+#define phrasebook_short 211
static unsigned char phrasebook[] = {
- 0, 228, 145, 247, 149, 76, 232, 57, 76, 65, 53, 249, 150, 53, 233, 123,
- 53, 254, 193, 254, 144, 42, 233, 180, 41, 233, 180, 254, 69, 79, 53, 251,
- 54, 244, 94, 246, 218, 228, 38, 228, 161, 21, 223, 89, 21, 118, 21, 113,
- 21, 166, 21, 158, 21, 173, 21, 183, 21, 194, 21, 187, 21, 192, 251, 61,
- 229, 186, 237, 213, 53, 247, 204, 53, 245, 231, 53, 232, 69, 76, 251, 53,
- 254, 62, 7, 6, 1, 57, 7, 6, 1, 254, 27, 7, 6, 1, 252, 44, 7, 6, 1, 222,
- 222, 7, 6, 1, 72, 7, 6, 1, 247, 130, 7, 6, 1, 214, 7, 6, 1, 212, 7, 6, 1,
- 74, 7, 6, 1, 239, 182, 7, 6, 1, 239, 76, 7, 6, 1, 149, 7, 6, 1, 185, 7,
- 6, 1, 199, 7, 6, 1, 73, 7, 6, 1, 233, 244, 7, 6, 1, 232, 139, 7, 6, 1,
- 146, 7, 6, 1, 193, 7, 6, 1, 227, 109, 7, 6, 1, 66, 7, 6, 1, 196, 7, 6, 1,
- 224, 174, 7, 6, 1, 224, 73, 7, 6, 1, 224, 25, 7, 6, 1, 223, 119, 42, 37,
- 104, 231, 193, 228, 161, 41, 37, 104, 251, 102, 255, 41, 184, 237, 170,
- 245, 237, 255, 41, 7, 3, 1, 57, 7, 3, 1, 254, 27, 7, 3, 1, 252, 44, 7, 3,
- 1, 222, 222, 7, 3, 1, 72, 7, 3, 1, 247, 130, 7, 3, 1, 214, 7, 3, 1, 212,
- 7, 3, 1, 74, 7, 3, 1, 239, 182, 7, 3, 1, 239, 76, 7, 3, 1, 149, 7, 3, 1,
- 185, 7, 3, 1, 199, 7, 3, 1, 73, 7, 3, 1, 233, 244, 7, 3, 1, 232, 139, 7,
- 3, 1, 146, 7, 3, 1, 193, 7, 3, 1, 227, 109, 7, 3, 1, 66, 7, 3, 1, 196, 7,
- 3, 1, 224, 174, 7, 3, 1, 224, 73, 7, 3, 1, 224, 25, 7, 3, 1, 223, 119,
- 42, 250, 223, 104, 61, 237, 170, 41, 250, 223, 104, 205, 235, 5, 228,
- 145, 239, 223, 247, 149, 76, 251, 220, 53, 232, 234, 53, 250, 222, 53,
- 223, 222, 53, 252, 99, 125, 230, 206, 53, 219, 251, 13, 53, 247, 81, 234,
- 29, 240, 7, 237, 235, 47, 254, 182, 232, 57, 76, 190, 53, 228, 165, 244,
- 95, 231, 227, 53, 237, 63, 250, 62, 53, 233, 9, 53, 227, 219, 113, 227,
- 219, 166, 255, 33, 255, 41, 236, 156, 53, 233, 38, 53, 236, 154, 249,
- 140, 251, 226, 227, 219, 118, 237, 8, 234, 29, 240, 7, 231, 151, 47, 254,
- 182, 232, 57, 76, 224, 189, 246, 235, 168, 232, 76, 224, 189, 246, 235,
- 168, 245, 151, 224, 189, 246, 235, 152, 232, 74, 239, 223, 232, 69, 76,
- 7, 6, 1, 102, 2, 245, 236, 7, 6, 1, 102, 2, 155, 7, 6, 1, 102, 2, 251,
- 101, 7, 6, 1, 102, 2, 205, 7, 6, 1, 102, 2, 219, 7, 6, 1, 102, 2, 231,
- 140, 46, 7, 6, 1, 255, 19, 7, 6, 1, 252, 45, 2, 251, 226, 7, 6, 1, 161,
- 2, 245, 236, 7, 6, 1, 161, 2, 155, 7, 6, 1, 161, 2, 251, 101, 7, 6, 1,
- 161, 2, 219, 7, 6, 1, 244, 81, 2, 245, 236, 7, 6, 1, 244, 81, 2, 155, 7,
- 6, 1, 244, 81, 2, 251, 101, 7, 6, 1, 244, 81, 2, 219, 7, 6, 1, 247, 168,
- 7, 6, 1, 236, 5, 2, 205, 7, 6, 1, 130, 2, 245, 236, 7, 6, 1, 130, 2, 155,
- 7, 6, 1, 130, 2, 251, 101, 7, 6, 1, 130, 2, 205, 7, 6, 1, 130, 2, 219,
- 236, 52, 53, 7, 6, 1, 130, 2, 82, 7, 6, 1, 97, 2, 245, 236, 7, 6, 1, 97,
- 2, 155, 7, 6, 1, 97, 2, 251, 101, 7, 6, 1, 97, 2, 219, 7, 6, 1, 224, 26,
- 2, 155, 7, 6, 1, 226, 196, 7, 3, 1, 229, 124, 193, 7, 3, 1, 102, 2, 245,
- 236, 7, 3, 1, 102, 2, 155, 7, 3, 1, 102, 2, 251, 101, 7, 3, 1, 102, 2,
- 205, 7, 3, 1, 102, 2, 219, 7, 3, 1, 102, 2, 231, 140, 46, 7, 3, 1, 255,
- 19, 7, 3, 1, 252, 45, 2, 251, 226, 7, 3, 1, 161, 2, 245, 236, 7, 3, 1,
- 161, 2, 155, 7, 3, 1, 161, 2, 251, 101, 7, 3, 1, 161, 2, 219, 7, 3, 1,
- 244, 81, 2, 245, 236, 7, 3, 1, 244, 81, 2, 155, 7, 3, 1, 244, 81, 2, 251,
- 101, 7, 3, 1, 244, 81, 2, 219, 7, 3, 1, 247, 168, 7, 3, 1, 236, 5, 2,
- 205, 7, 3, 1, 130, 2, 245, 236, 7, 3, 1, 130, 2, 155, 7, 3, 1, 130, 2,
- 251, 101, 7, 3, 1, 130, 2, 205, 7, 3, 1, 130, 2, 219, 249, 181, 53, 7, 3,
- 1, 130, 2, 82, 7, 3, 1, 97, 2, 245, 236, 7, 3, 1, 97, 2, 155, 7, 3, 1,
- 97, 2, 251, 101, 7, 3, 1, 97, 2, 219, 7, 3, 1, 224, 26, 2, 155, 7, 3, 1,
- 226, 196, 7, 3, 1, 224, 26, 2, 219, 7, 6, 1, 102, 2, 237, 63, 7, 3, 1,
- 102, 2, 237, 63, 7, 6, 1, 102, 2, 252, 106, 7, 3, 1, 102, 2, 252, 106, 7,
- 6, 1, 102, 2, 234, 84, 7, 3, 1, 102, 2, 234, 84, 7, 6, 1, 252, 45, 2,
- 155, 7, 3, 1, 252, 45, 2, 155, 7, 6, 1, 252, 45, 2, 251, 101, 7, 3, 1,
- 252, 45, 2, 251, 101, 7, 6, 1, 252, 45, 2, 56, 46, 7, 3, 1, 252, 45, 2,
- 56, 46, 7, 6, 1, 252, 45, 2, 252, 5, 7, 3, 1, 252, 45, 2, 252, 5, 7, 6,
- 1, 250, 192, 2, 252, 5, 7, 3, 1, 250, 192, 2, 252, 5, 7, 6, 1, 250, 192,
- 2, 82, 7, 3, 1, 250, 192, 2, 82, 7, 6, 1, 161, 2, 237, 63, 7, 3, 1, 161,
- 2, 237, 63, 7, 6, 1, 161, 2, 252, 106, 7, 3, 1, 161, 2, 252, 106, 7, 6,
- 1, 161, 2, 56, 46, 7, 3, 1, 161, 2, 56, 46, 7, 6, 1, 161, 2, 234, 84, 7,
- 3, 1, 161, 2, 234, 84, 7, 6, 1, 161, 2, 252, 5, 7, 3, 1, 161, 2, 252, 5,
- 7, 6, 1, 246, 196, 2, 251, 101, 7, 3, 1, 246, 196, 2, 251, 101, 7, 6, 1,
- 246, 196, 2, 252, 106, 7, 3, 1, 246, 196, 2, 252, 106, 7, 6, 1, 246, 196,
- 2, 56, 46, 7, 3, 1, 246, 196, 2, 56, 46, 7, 6, 1, 246, 196, 2, 251, 226,
- 7, 3, 1, 246, 196, 2, 251, 226, 7, 6, 1, 245, 172, 2, 251, 101, 7, 3, 1,
- 245, 172, 2, 251, 101, 7, 6, 1, 245, 172, 2, 82, 7, 3, 1, 245, 172, 2,
- 82, 7, 6, 1, 244, 81, 2, 205, 7, 3, 1, 244, 81, 2, 205, 7, 6, 1, 244, 81,
- 2, 237, 63, 7, 3, 1, 244, 81, 2, 237, 63, 7, 6, 1, 244, 81, 2, 252, 106,
- 7, 3, 1, 244, 81, 2, 252, 106, 7, 6, 1, 244, 81, 2, 234, 84, 7, 3, 1,
- 244, 81, 2, 234, 84, 7, 6, 1, 244, 81, 2, 56, 46, 7, 3, 1, 249, 139, 74,
- 7, 6, 20, 240, 45, 7, 3, 20, 240, 45, 7, 6, 1, 239, 183, 2, 251, 101, 7,
- 3, 1, 239, 183, 2, 251, 101, 7, 6, 1, 239, 77, 2, 251, 226, 7, 3, 1, 239,
- 77, 2, 251, 226, 7, 3, 1, 238, 117, 7, 6, 1, 238, 47, 2, 155, 7, 3, 1,
- 238, 47, 2, 155, 7, 6, 1, 238, 47, 2, 251, 226, 7, 3, 1, 238, 47, 2, 251,
- 226, 7, 6, 1, 238, 47, 2, 252, 5, 7, 3, 1, 238, 47, 2, 252, 5, 7, 6, 1,
- 238, 47, 2, 236, 154, 249, 140, 7, 3, 1, 238, 47, 2, 236, 154, 249, 140,
- 7, 6, 1, 238, 47, 2, 82, 7, 3, 1, 238, 47, 2, 82, 7, 6, 1, 236, 5, 2,
- 155, 7, 3, 1, 236, 5, 2, 155, 7, 6, 1, 236, 5, 2, 251, 226, 7, 3, 1, 236,
- 5, 2, 251, 226, 7, 6, 1, 236, 5, 2, 252, 5, 7, 3, 1, 236, 5, 2, 252, 5,
- 7, 3, 1, 236, 5, 232, 215, 252, 55, 254, 144, 7, 6, 1, 247, 228, 7, 3, 1,
- 247, 228, 7, 6, 1, 130, 2, 237, 63, 7, 3, 1, 130, 2, 237, 63, 7, 6, 1,
- 130, 2, 252, 106, 7, 3, 1, 130, 2, 252, 106, 7, 6, 1, 130, 2, 47, 155, 7,
- 3, 1, 130, 2, 47, 155, 7, 6, 20, 234, 88, 7, 3, 20, 234, 88, 7, 6, 1,
- 232, 27, 2, 155, 7, 3, 1, 232, 27, 2, 155, 7, 6, 1, 232, 27, 2, 251, 226,
- 7, 3, 1, 232, 27, 2, 251, 226, 7, 6, 1, 232, 27, 2, 252, 5, 7, 3, 1, 232,
- 27, 2, 252, 5, 7, 6, 1, 231, 35, 2, 155, 7, 3, 1, 231, 35, 2, 155, 7, 6,
- 1, 231, 35, 2, 251, 101, 7, 3, 1, 231, 35, 2, 251, 101, 7, 6, 1, 231, 35,
- 2, 251, 226, 7, 3, 1, 231, 35, 2, 251, 226, 7, 6, 1, 231, 35, 2, 252, 5,
- 7, 3, 1, 231, 35, 2, 252, 5, 7, 6, 1, 227, 110, 2, 251, 226, 7, 3, 1,
- 227, 110, 2, 251, 226, 7, 6, 1, 227, 110, 2, 252, 5, 7, 3, 1, 227, 110,
- 2, 252, 5, 7, 6, 1, 227, 110, 2, 82, 7, 3, 1, 227, 110, 2, 82, 7, 6, 1,
- 97, 2, 205, 7, 3, 1, 97, 2, 205, 7, 6, 1, 97, 2, 237, 63, 7, 3, 1, 97, 2,
- 237, 63, 7, 6, 1, 97, 2, 252, 106, 7, 3, 1, 97, 2, 252, 106, 7, 6, 1, 97,
- 2, 231, 140, 46, 7, 3, 1, 97, 2, 231, 140, 46, 7, 6, 1, 97, 2, 47, 155,
- 7, 3, 1, 97, 2, 47, 155, 7, 6, 1, 97, 2, 234, 84, 7, 3, 1, 97, 2, 234,
- 84, 7, 6, 1, 224, 175, 2, 251, 101, 7, 3, 1, 224, 175, 2, 251, 101, 7, 6,
- 1, 224, 26, 2, 251, 101, 7, 3, 1, 224, 26, 2, 251, 101, 7, 6, 1, 224, 26,
- 2, 219, 7, 6, 1, 223, 120, 2, 155, 7, 3, 1, 223, 120, 2, 155, 7, 6, 1,
- 223, 120, 2, 56, 46, 7, 3, 1, 223, 120, 2, 56, 46, 7, 6, 1, 223, 120, 2,
- 252, 5, 7, 3, 1, 223, 120, 2, 252, 5, 7, 3, 1, 182, 193, 7, 3, 1, 45, 2,
- 82, 7, 6, 1, 45, 2, 88, 7, 6, 1, 45, 2, 226, 103, 7, 3, 1, 45, 2, 226,
- 103, 7, 6, 1, 206, 183, 7, 3, 1, 206, 183, 7, 6, 1, 234, 44, 73, 7, 6, 1,
- 252, 45, 2, 88, 7, 3, 1, 252, 45, 2, 88, 7, 6, 1, 255, 10, 222, 222, 7,
- 6, 1, 250, 192, 2, 88, 7, 6, 1, 250, 192, 2, 226, 103, 7, 3, 1, 250, 192,
- 2, 226, 103, 7, 3, 1, 209, 250, 47, 7, 6, 1, 200, 72, 7, 6, 1, 230, 222,
- 7, 6, 1, 234, 44, 72, 7, 6, 1, 247, 131, 2, 88, 7, 3, 1, 247, 131, 2, 88,
- 7, 6, 1, 246, 196, 2, 88, 7, 6, 1, 246, 169, 7, 3, 1, 244, 128, 7, 6, 1,
- 239, 215, 7, 6, 1, 244, 81, 2, 82, 7, 6, 1, 239, 77, 2, 88, 7, 3, 1, 239,
- 77, 2, 88, 7, 3, 1, 238, 47, 2, 125, 7, 3, 1, 238, 18, 2, 82, 7, 6, 1,
- 209, 185, 7, 6, 1, 236, 5, 2, 42, 88, 7, 3, 1, 236, 5, 2, 182, 41, 237,
- 229, 7, 6, 1, 130, 2, 236, 154, 205, 7, 6, 1, 130, 2, 244, 160, 7, 3, 1,
- 130, 2, 244, 160, 7, 6, 1, 234, 80, 7, 3, 1, 234, 80, 7, 6, 1, 233, 245,
- 2, 88, 7, 3, 1, 233, 245, 2, 88, 7, 1, 223, 160, 7, 6, 1, 206, 113, 7, 3,
- 1, 206, 113, 7, 6, 1, 247, 183, 7, 1, 200, 247, 184, 237, 124, 7, 3, 1,
- 227, 110, 2, 233, 229, 88, 7, 6, 1, 227, 110, 2, 88, 7, 3, 1, 227, 110,
- 2, 88, 7, 6, 1, 227, 110, 2, 231, 196, 88, 7, 6, 1, 97, 2, 244, 160, 7,
- 3, 1, 97, 2, 244, 160, 7, 6, 1, 225, 110, 7, 6, 1, 225, 65, 2, 88, 7, 6,
- 1, 224, 26, 2, 88, 7, 3, 1, 224, 26, 2, 88, 7, 6, 1, 223, 120, 2, 82, 7,
- 3, 1, 223, 120, 2, 82, 7, 6, 1, 247, 132, 7, 6, 1, 247, 133, 231, 192, 7,
- 3, 1, 247, 133, 231, 192, 7, 3, 1, 247, 133, 2, 227, 89, 7, 1, 135, 2,
- 82, 7, 6, 1, 206, 173, 7, 3, 1, 206, 173, 7, 1, 239, 223, 246, 16, 228,
- 39, 2, 82, 7, 1, 224, 75, 7, 1, 250, 41, 251, 89, 7, 1, 238, 2, 251, 89,
- 7, 1, 254, 200, 251, 89, 7, 1, 231, 196, 251, 89, 7, 6, 1, 248, 72, 2,
- 252, 5, 7, 6, 1, 250, 192, 2, 3, 1, 223, 120, 2, 252, 5, 7, 3, 1, 248,
- 72, 2, 252, 5, 7, 6, 1, 237, 152, 7, 6, 1, 238, 47, 2, 3, 1, 239, 182, 7,
- 3, 1, 237, 152, 7, 6, 1, 235, 50, 7, 6, 1, 236, 5, 2, 3, 1, 239, 182, 7,
- 3, 1, 235, 50, 7, 6, 1, 102, 2, 252, 5, 7, 3, 1, 102, 2, 252, 5, 7, 6, 1,
- 244, 81, 2, 252, 5, 7, 3, 1, 244, 81, 2, 252, 5, 7, 6, 1, 130, 2, 252, 5,
- 7, 3, 1, 130, 2, 252, 5, 7, 6, 1, 97, 2, 252, 5, 7, 3, 1, 97, 2, 252, 5,
- 7, 6, 1, 97, 2, 250, 3, 22, 237, 63, 7, 3, 1, 97, 2, 250, 3, 22, 237, 63,
- 7, 6, 1, 97, 2, 250, 3, 22, 155, 7, 3, 1, 97, 2, 250, 3, 22, 155, 7, 6,
- 1, 97, 2, 250, 3, 22, 252, 5, 7, 3, 1, 97, 2, 250, 3, 22, 252, 5, 7, 6,
- 1, 97, 2, 250, 3, 22, 245, 236, 7, 3, 1, 97, 2, 250, 3, 22, 245, 236, 7,
- 3, 1, 209, 72, 7, 6, 1, 102, 2, 250, 3, 22, 237, 63, 7, 3, 1, 102, 2,
- 250, 3, 22, 237, 63, 7, 6, 1, 102, 2, 56, 64, 22, 237, 63, 7, 3, 1, 102,
- 2, 56, 64, 22, 237, 63, 7, 6, 1, 255, 20, 2, 237, 63, 7, 3, 1, 255, 20,
- 2, 237, 63, 7, 6, 1, 246, 196, 2, 82, 7, 3, 1, 246, 196, 2, 82, 7, 6, 1,
- 246, 196, 2, 252, 5, 7, 3, 1, 246, 196, 2, 252, 5, 7, 6, 1, 239, 77, 2,
- 252, 5, 7, 3, 1, 239, 77, 2, 252, 5, 7, 6, 1, 130, 2, 234, 84, 7, 3, 1,
- 130, 2, 234, 84, 7, 6, 1, 130, 2, 234, 85, 22, 237, 63, 7, 3, 1, 130, 2,
- 234, 85, 22, 237, 63, 7, 6, 1, 247, 133, 2, 252, 5, 7, 3, 1, 247, 133, 2,
- 252, 5, 7, 3, 1, 239, 183, 2, 252, 5, 7, 6, 1, 248, 71, 7, 6, 1, 250,
- 192, 2, 3, 1, 223, 119, 7, 3, 1, 248, 71, 7, 6, 1, 246, 196, 2, 155, 7,
- 3, 1, 246, 196, 2, 155, 7, 6, 1, 244, 126, 7, 6, 1, 224, 75, 7, 6, 1,
- 236, 5, 2, 245, 236, 7, 3, 1, 236, 5, 2, 245, 236, 7, 6, 1, 102, 2, 231,
- 140, 64, 22, 155, 7, 3, 1, 102, 2, 231, 140, 64, 22, 155, 7, 6, 1, 255,
- 20, 2, 155, 7, 3, 1, 255, 20, 2, 155, 7, 6, 1, 130, 2, 195, 22, 155, 7,
- 3, 1, 130, 2, 195, 22, 155, 7, 6, 1, 102, 2, 47, 245, 236, 7, 3, 1, 102,
- 2, 47, 245, 236, 7, 6, 1, 102, 2, 239, 223, 252, 106, 7, 3, 1, 102, 2,
- 239, 223, 252, 106, 7, 6, 1, 161, 2, 47, 245, 236, 7, 3, 1, 161, 2, 47,
- 245, 236, 7, 6, 1, 161, 2, 239, 223, 252, 106, 7, 3, 1, 161, 2, 239, 223,
- 252, 106, 7, 6, 1, 244, 81, 2, 47, 245, 236, 7, 3, 1, 244, 81, 2, 47,
- 245, 236, 7, 6, 1, 244, 81, 2, 239, 223, 252, 106, 7, 3, 1, 244, 81, 2,
- 239, 223, 252, 106, 7, 6, 1, 130, 2, 47, 245, 236, 7, 3, 1, 130, 2, 47,
- 245, 236, 7, 6, 1, 130, 2, 239, 223, 252, 106, 7, 3, 1, 130, 2, 239, 223,
- 252, 106, 7, 6, 1, 232, 27, 2, 47, 245, 236, 7, 3, 1, 232, 27, 2, 47,
- 245, 236, 7, 6, 1, 232, 27, 2, 239, 223, 252, 106, 7, 3, 1, 232, 27, 2,
- 239, 223, 252, 106, 7, 6, 1, 97, 2, 47, 245, 236, 7, 3, 1, 97, 2, 47,
- 245, 236, 7, 6, 1, 97, 2, 239, 223, 252, 106, 7, 3, 1, 97, 2, 239, 223,
- 252, 106, 7, 6, 1, 231, 35, 2, 251, 55, 51, 7, 3, 1, 231, 35, 2, 251, 55,
- 51, 7, 6, 1, 227, 110, 2, 251, 55, 51, 7, 3, 1, 227, 110, 2, 251, 55, 51,
- 7, 6, 1, 223, 174, 7, 3, 1, 223, 174, 7, 6, 1, 245, 172, 2, 252, 5, 7, 3,
- 1, 245, 172, 2, 252, 5, 7, 6, 1, 236, 5, 2, 182, 41, 237, 229, 7, 3, 1,
- 250, 192, 2, 250, 224, 7, 6, 1, 234, 13, 7, 3, 1, 234, 13, 7, 6, 1, 223,
- 120, 2, 88, 7, 3, 1, 223, 120, 2, 88, 7, 6, 1, 102, 2, 56, 46, 7, 3, 1,
- 102, 2, 56, 46, 7, 6, 1, 161, 2, 251, 226, 7, 3, 1, 161, 2, 251, 226, 7,
- 6, 1, 130, 2, 250, 3, 22, 237, 63, 7, 3, 1, 130, 2, 250, 3, 22, 237, 63,
- 7, 6, 1, 130, 2, 226, 159, 22, 237, 63, 7, 3, 1, 130, 2, 226, 159, 22,
- 237, 63, 7, 6, 1, 130, 2, 56, 46, 7, 3, 1, 130, 2, 56, 46, 7, 6, 1, 130,
- 2, 56, 64, 22, 237, 63, 7, 3, 1, 130, 2, 56, 64, 22, 237, 63, 7, 6, 1,
- 224, 26, 2, 237, 63, 7, 3, 1, 224, 26, 2, 237, 63, 7, 3, 1, 238, 47, 2,
- 250, 224, 7, 3, 1, 236, 5, 2, 250, 224, 7, 3, 1, 227, 110, 2, 250, 224,
- 7, 3, 1, 249, 139, 239, 182, 7, 3, 1, 250, 119, 249, 223, 7, 3, 1, 232,
- 85, 249, 223, 7, 6, 1, 102, 2, 82, 7, 6, 1, 252, 45, 2, 82, 7, 3, 1, 252,
- 45, 2, 82, 7, 6, 1, 238, 47, 2, 125, 7, 6, 1, 227, 110, 2, 250, 1, 82, 7,
- 3, 1, 231, 35, 2, 227, 197, 227, 89, 7, 3, 1, 223, 120, 2, 227, 197, 227,
- 89, 7, 6, 1, 246, 16, 228, 38, 7, 3, 1, 246, 16, 228, 38, 7, 6, 1, 45, 2,
- 82, 7, 6, 1, 97, 125, 7, 6, 1, 209, 196, 7, 6, 1, 161, 2, 82, 7, 3, 1,
- 161, 2, 82, 7, 6, 1, 239, 183, 2, 82, 7, 3, 1, 239, 183, 2, 82, 7, 6, 1,
- 3, 232, 140, 2, 244, 217, 227, 89, 7, 3, 1, 232, 140, 2, 244, 217, 227,
- 89, 7, 6, 1, 232, 27, 2, 82, 7, 3, 1, 232, 27, 2, 82, 7, 6, 1, 224, 26,
- 2, 82, 7, 3, 1, 224, 26, 2, 82, 7, 3, 1, 209, 57, 7, 3, 1, 254, 205, 7,
- 3, 1, 209, 254, 205, 7, 3, 1, 45, 2, 88, 7, 3, 1, 234, 44, 73, 7, 3, 1,
- 252, 45, 2, 250, 224, 7, 3, 1, 250, 192, 2, 227, 89, 7, 3, 1, 250, 192,
- 2, 88, 7, 3, 1, 200, 72, 7, 3, 1, 230, 222, 7, 3, 1, 230, 223, 2, 88, 7,
- 3, 1, 234, 44, 72, 7, 3, 1, 200, 234, 44, 72, 7, 3, 1, 200, 234, 44, 161,
- 2, 88, 7, 3, 1, 251, 82, 200, 234, 44, 72, 7, 3, 1, 249, 139, 239, 183,
- 2, 82, 7, 3, 1, 246, 196, 2, 88, 7, 3, 1, 95, 214, 7, 1, 3, 6, 214, 7, 3,
- 1, 246, 169, 7, 3, 1, 232, 4, 244, 160, 7, 3, 1, 209, 212, 7, 3, 1, 245,
- 172, 2, 88, 7, 3, 1, 245, 99, 2, 88, 7, 3, 1, 244, 81, 2, 82, 7, 3, 1,
- 239, 215, 7, 1, 3, 6, 74, 7, 3, 1, 238, 47, 2, 236, 154, 205, 7, 3, 1,
- 238, 47, 2, 252, 212, 7, 3, 1, 238, 47, 2, 231, 196, 88, 7, 3, 1, 237,
- 207, 7, 3, 1, 209, 185, 7, 3, 1, 209, 237, 69, 2, 182, 237, 229, 7, 3, 1,
- 237, 69, 2, 88, 7, 3, 1, 236, 5, 2, 42, 88, 7, 3, 1, 236, 5, 2, 231, 196,
- 88, 7, 1, 3, 6, 199, 7, 3, 1, 253, 31, 73, 7, 1, 3, 6, 234, 88, 7, 3, 1,
- 251, 82, 234, 66, 7, 3, 1, 233, 87, 7, 3, 1, 209, 146, 7, 3, 1, 209, 232,
- 27, 2, 182, 237, 229, 7, 3, 1, 209, 232, 27, 2, 88, 7, 3, 1, 232, 27, 2,
- 182, 237, 229, 7, 3, 1, 232, 27, 2, 227, 89, 7, 3, 1, 232, 27, 2, 247,
- 40, 7, 3, 1, 200, 232, 27, 2, 247, 40, 7, 1, 3, 6, 146, 7, 1, 3, 6, 239,
- 223, 146, 7, 3, 1, 231, 35, 2, 88, 7, 3, 1, 247, 183, 7, 3, 1, 249, 139,
- 239, 183, 2, 195, 22, 88, 7, 3, 1, 228, 116, 200, 247, 183, 7, 3, 1, 247,
- 184, 2, 250, 224, 7, 3, 1, 209, 227, 109, 7, 3, 1, 227, 110, 2, 231, 196,
- 88, 7, 3, 1, 97, 125, 7, 3, 1, 225, 110, 7, 3, 1, 225, 65, 2, 88, 7, 3,
- 1, 209, 196, 7, 3, 1, 209, 224, 174, 7, 3, 1, 209, 224, 25, 7, 1, 3, 6,
- 224, 25, 7, 3, 1, 223, 120, 2, 231, 196, 88, 7, 3, 1, 223, 120, 2, 250,
- 224, 7, 3, 1, 247, 132, 7, 3, 1, 247, 133, 2, 250, 224, 7, 1, 246, 16,
- 228, 38, 7, 1, 233, 91, 224, 204, 246, 227, 7, 1, 239, 223, 246, 16, 228,
- 38, 7, 1, 228, 26, 252, 44, 7, 1, 252, 171, 251, 89, 7, 1, 3, 6, 254, 27,
- 7, 3, 1, 251, 82, 234, 44, 72, 7, 1, 3, 6, 246, 196, 2, 88, 7, 1, 3, 6,
- 212, 7, 3, 1, 239, 183, 2, 250, 240, 7, 3, 1, 209, 239, 76, 7, 1, 3, 6,
- 149, 7, 3, 1, 232, 140, 2, 88, 7, 1, 246, 16, 228, 39, 2, 82, 7, 1, 200,
- 246, 16, 228, 39, 2, 82, 7, 3, 1, 248, 72, 249, 223, 7, 3, 1, 250, 23,
- 249, 223, 7, 3, 1, 248, 72, 249, 224, 2, 250, 224, 7, 3, 1, 226, 46, 249,
- 223, 7, 3, 1, 227, 15, 249, 223, 7, 3, 1, 227, 51, 249, 224, 2, 250, 224,
- 7, 3, 1, 247, 79, 249, 223, 7, 3, 1, 237, 112, 249, 223, 7, 3, 1, 237,
- 70, 249, 223, 7, 1, 252, 171, 233, 122, 7, 1, 252, 178, 233, 122, 7, 3,
- 1, 209, 245, 172, 2, 247, 40, 7, 3, 1, 209, 245, 172, 2, 247, 41, 22,
- 227, 89, 52, 1, 3, 212, 52, 1, 3, 245, 172, 2, 88, 52, 1, 3, 239, 182,
- 52, 1, 3, 146, 52, 1, 3, 209, 146, 52, 1, 3, 209, 232, 27, 2, 88, 52, 1,
- 3, 6, 239, 223, 146, 52, 1, 3, 224, 174, 52, 1, 3, 224, 25, 52, 1, 232,
- 205, 52, 1, 47, 232, 205, 52, 1, 209, 251, 54, 52, 1, 254, 144, 52, 1,
- 200, 251, 54, 52, 1, 41, 132, 231, 139, 52, 1, 42, 132, 231, 139, 52, 1,
- 246, 16, 228, 38, 52, 1, 200, 246, 16, 228, 38, 52, 1, 42, 254, 93, 52,
- 1, 41, 254, 93, 52, 1, 99, 254, 93, 52, 1, 103, 254, 93, 52, 1, 251, 102,
- 255, 41, 252, 5, 52, 1, 61, 237, 170, 52, 1, 237, 63, 52, 1, 255, 33,
- 255, 41, 52, 1, 245, 237, 255, 41, 52, 1, 184, 61, 237, 170, 52, 1, 184,
- 237, 63, 52, 1, 184, 245, 237, 255, 41, 52, 1, 184, 255, 33, 255, 41, 52,
- 1, 226, 75, 251, 61, 52, 1, 132, 226, 75, 251, 61, 52, 1, 251, 217, 41,
- 132, 231, 139, 52, 1, 251, 217, 42, 132, 231, 139, 52, 1, 99, 227, 96,
- 52, 1, 103, 227, 96, 52, 1, 79, 53, 52, 1, 236, 121, 53, 252, 106, 56,
- 46, 231, 140, 46, 234, 84, 3, 205, 47, 255, 33, 255, 41, 52, 1, 231, 181,
- 88, 52, 1, 250, 244, 255, 41, 52, 1, 3, 246, 169, 52, 1, 3, 149, 52, 1,
- 3, 193, 52, 1, 3, 224, 73, 52, 1, 3, 200, 246, 16, 228, 38, 52, 1, 247,
- 140, 206, 125, 52, 1, 201, 206, 125, 52, 1, 236, 155, 206, 125, 52, 1,
- 184, 206, 125, 52, 1, 247, 139, 206, 125, 52, 1, 223, 193, 250, 38, 206,
- 76, 52, 1, 223, 249, 250, 38, 206, 76, 52, 1, 224, 202, 52, 1, 225, 136,
- 52, 1, 47, 254, 144, 52, 1, 184, 103, 254, 93, 52, 1, 184, 99, 254, 93,
- 52, 1, 184, 42, 254, 93, 52, 1, 184, 41, 254, 93, 52, 1, 184, 231, 139,
- 52, 1, 236, 154, 245, 237, 255, 41, 52, 1, 236, 154, 47, 245, 237, 255,
- 41, 52, 1, 236, 154, 47, 255, 33, 255, 41, 52, 1, 184, 205, 52, 1, 232,
- 8, 251, 61, 52, 1, 252, 226, 201, 226, 118, 52, 1, 247, 233, 201, 226,
- 118, 52, 1, 252, 226, 184, 226, 118, 52, 1, 247, 233, 184, 226, 118, 52,
- 1, 229, 105, 52, 1, 234, 44, 229, 105, 52, 1, 184, 42, 58, 36, 245, 237,
- 255, 41, 36, 255, 33, 255, 41, 36, 251, 102, 255, 41, 36, 205, 36, 237,
- 63, 36, 234, 1, 36, 252, 106, 36, 56, 46, 36, 219, 36, 244, 217, 46, 36,
- 231, 140, 46, 36, 47, 255, 33, 255, 41, 36, 252, 5, 36, 61, 237, 171, 46,
- 36, 47, 61, 237, 171, 46, 36, 47, 245, 237, 255, 41, 36, 252, 19, 36,
- 239, 223, 252, 106, 36, 209, 251, 55, 46, 36, 251, 55, 46, 36, 200, 251,
- 55, 46, 36, 251, 55, 64, 231, 153, 36, 245, 237, 255, 42, 51, 36, 255,
- 33, 255, 42, 51, 36, 42, 227, 97, 51, 36, 41, 227, 97, 51, 36, 42, 254,
- 182, 46, 36, 244, 160, 36, 42, 132, 231, 140, 51, 36, 99, 227, 97, 51,
- 36, 103, 227, 97, 51, 36, 79, 5, 51, 36, 236, 121, 5, 51, 36, 233, 227,
- 244, 217, 51, 36, 231, 196, 244, 217, 51, 36, 56, 51, 36, 250, 3, 51, 36,
- 231, 140, 51, 36, 251, 55, 51, 36, 251, 226, 36, 234, 84, 36, 61, 237,
- 171, 51, 36, 252, 102, 51, 36, 239, 223, 47, 254, 121, 51, 36, 252, 6,
- 51, 36, 251, 102, 255, 42, 51, 36, 252, 107, 51, 36, 239, 223, 252, 107,
- 51, 36, 226, 159, 51, 36, 237, 64, 51, 36, 184, 237, 170, 36, 47, 184,
- 237, 170, 36, 226, 159, 234, 2, 36, 229, 63, 195, 234, 2, 36, 182, 195,
- 234, 2, 36, 229, 63, 228, 162, 234, 2, 36, 182, 228, 162, 234, 2, 36, 41,
- 132, 231, 140, 51, 36, 239, 223, 252, 102, 51, 36, 37, 51, 36, 230, 212,
- 51, 36, 224, 74, 46, 36, 61, 205, 36, 47, 234, 1, 36, 245, 237, 206, 76,
- 36, 255, 33, 206, 76, 36, 19, 233, 117, 36, 19, 238, 132, 36, 19, 249,
- 254, 226, 109, 36, 19, 223, 165, 36, 252, 102, 46, 36, 247, 204, 5, 51,
- 36, 47, 61, 237, 171, 51, 36, 42, 254, 182, 51, 36, 190, 226, 159, 46,
- 36, 244, 221, 46, 36, 254, 210, 105, 180, 46, 36, 42, 41, 67, 51, 36,
- 225, 106, 67, 51, 36, 245, 241, 239, 112, 36, 41, 254, 94, 46, 36, 42,
- 132, 231, 140, 46, 36, 247, 76, 36, 224, 74, 51, 36, 42, 254, 94, 51, 36,
- 41, 254, 94, 51, 36, 41, 254, 94, 22, 99, 254, 94, 51, 36, 41, 132, 231,
- 140, 46, 36, 56, 64, 231, 153, 36, 254, 70, 51, 36, 47, 231, 140, 51, 36,
- 223, 38, 46, 36, 47, 252, 107, 51, 36, 47, 252, 106, 36, 47, 237, 63, 36,
- 47, 237, 64, 51, 36, 47, 205, 36, 47, 239, 223, 252, 106, 36, 47, 81, 67,
- 51, 36, 7, 3, 1, 57, 36, 7, 3, 1, 72, 36, 7, 3, 1, 74, 36, 7, 3, 1, 73,
- 36, 7, 3, 1, 66, 36, 7, 3, 1, 252, 44, 36, 7, 3, 1, 222, 222, 36, 7, 3,
- 1, 212, 36, 7, 3, 1, 185, 36, 7, 3, 1, 146, 36, 7, 3, 1, 227, 109, 36, 7,
- 3, 1, 196, 36, 7, 3, 1, 224, 73, 19, 6, 1, 245, 89, 19, 3, 1, 245, 89,
- 19, 6, 1, 254, 120, 230, 255, 19, 3, 1, 254, 120, 230, 255, 19, 207, 53,
- 19, 203, 207, 53, 19, 6, 1, 233, 215, 249, 230, 19, 3, 1, 233, 215, 249,
- 230, 19, 223, 165, 19, 3, 200, 237, 99, 229, 3, 98, 19, 3, 248, 138, 237,
- 99, 229, 3, 98, 19, 3, 200, 248, 138, 237, 99, 229, 3, 98, 19, 232, 69,
- 76, 19, 226, 109, 19, 249, 254, 226, 109, 19, 6, 1, 254, 206, 2, 226,
- 109, 19, 254, 173, 227, 30, 19, 6, 1, 247, 207, 2, 226, 109, 19, 6, 1,
- 247, 172, 2, 226, 109, 19, 6, 1, 239, 216, 2, 226, 109, 19, 6, 1, 234,
- 65, 2, 226, 109, 19, 6, 1, 225, 111, 2, 226, 109, 19, 6, 1, 234, 67, 2,
- 226, 109, 19, 3, 1, 239, 216, 2, 249, 254, 22, 226, 109, 19, 6, 1, 254,
- 205, 19, 6, 1, 252, 198, 19, 6, 1, 246, 169, 19, 6, 1, 250, 47, 19, 6, 1,
- 247, 206, 19, 6, 1, 223, 88, 19, 6, 1, 247, 171, 19, 6, 1, 226, 223, 19,
- 6, 1, 239, 215, 19, 6, 1, 239, 35, 19, 6, 1, 238, 16, 19, 6, 1, 236, 66,
- 19, 6, 1, 234, 206, 19, 6, 1, 224, 64, 19, 6, 1, 234, 64, 19, 6, 1, 233,
- 69, 19, 6, 1, 231, 182, 19, 6, 1, 229, 2, 19, 6, 1, 227, 61, 19, 6, 1,
- 225, 110, 19, 6, 1, 233, 87, 19, 6, 1, 251, 169, 19, 6, 1, 232, 183, 19,
- 6, 1, 234, 66, 19, 6, 1, 239, 216, 2, 249, 253, 19, 6, 1, 225, 111, 2,
- 249, 253, 19, 3, 1, 254, 206, 2, 226, 109, 19, 3, 1, 247, 207, 2, 226,
- 109, 19, 3, 1, 247, 172, 2, 226, 109, 19, 3, 1, 239, 216, 2, 226, 109,
- 19, 3, 1, 225, 111, 2, 249, 254, 22, 226, 109, 19, 3, 1, 254, 205, 19, 3,
- 1, 252, 198, 19, 3, 1, 246, 169, 19, 3, 1, 250, 47, 19, 3, 1, 247, 206,
- 19, 3, 1, 223, 88, 19, 3, 1, 247, 171, 19, 3, 1, 226, 223, 19, 3, 1, 239,
- 215, 19, 3, 1, 239, 35, 19, 3, 1, 238, 16, 19, 3, 1, 236, 66, 19, 3, 1,
- 234, 206, 19, 3, 1, 224, 64, 19, 3, 1, 234, 64, 19, 3, 1, 233, 69, 19, 3,
- 1, 231, 182, 19, 3, 1, 35, 229, 2, 19, 3, 1, 229, 2, 19, 3, 1, 227, 61,
- 19, 3, 1, 225, 110, 19, 3, 1, 233, 87, 19, 3, 1, 251, 169, 19, 3, 1, 232,
- 183, 19, 3, 1, 234, 66, 19, 3, 1, 239, 216, 2, 249, 253, 19, 3, 1, 225,
- 111, 2, 249, 253, 19, 3, 1, 234, 65, 2, 226, 109, 19, 3, 1, 225, 111, 2,
- 226, 109, 19, 3, 1, 234, 67, 2, 226, 109, 19, 6, 239, 57, 98, 19, 252,
- 199, 98, 19, 226, 224, 98, 19, 225, 111, 2, 244, 217, 98, 19, 225, 111,
- 2, 255, 33, 22, 244, 217, 98, 19, 225, 111, 2, 250, 3, 22, 244, 217, 98,
- 19, 233, 88, 98, 19, 233, 70, 98, 19, 239, 57, 98, 19, 1, 254, 120, 238,
- 135, 19, 3, 1, 254, 120, 238, 135, 19, 1, 228, 46, 19, 3, 1, 228, 46, 19,
- 1, 249, 230, 19, 3, 1, 249, 230, 19, 1, 238, 135, 19, 3, 1, 238, 135, 19,
- 1, 230, 255, 19, 3, 1, 230, 255, 70, 6, 1, 229, 106, 70, 3, 1, 229, 106,
- 70, 6, 1, 247, 85, 70, 3, 1, 247, 85, 70, 6, 1, 238, 215, 70, 3, 1, 238,
- 215, 70, 6, 1, 244, 213, 70, 3, 1, 244, 213, 70, 6, 1, 246, 165, 70, 3,
- 1, 246, 165, 70, 6, 1, 229, 80, 70, 3, 1, 229, 80, 70, 6, 1, 250, 60, 70,
- 3, 1, 250, 60, 19, 239, 36, 98, 19, 231, 183, 98, 19, 237, 99, 229, 3,
- 98, 19, 1, 223, 169, 19, 6, 226, 224, 98, 19, 237, 99, 247, 207, 98, 19,
- 200, 237, 99, 247, 207, 98, 19, 6, 1, 229, 71, 19, 3, 1, 229, 71, 19, 6,
- 237, 99, 229, 3, 98, 19, 6, 1, 230, 253, 19, 3, 1, 230, 253, 19, 231,
- 183, 2, 195, 98, 19, 6, 200, 237, 99, 229, 3, 98, 19, 6, 248, 138, 237,
- 99, 229, 3, 98, 19, 6, 200, 248, 138, 237, 99, 229, 3, 98, 28, 6, 1, 240,
- 73, 2, 245, 236, 28, 6, 1, 239, 219, 28, 6, 1, 249, 176, 28, 6, 1, 246,
- 21, 28, 6, 1, 225, 150, 240, 72, 28, 6, 1, 248, 69, 28, 6, 1, 252, 53,
- 74, 28, 6, 1, 223, 202, 28, 6, 1, 239, 170, 28, 6, 1, 237, 151, 28, 6, 1,
- 235, 48, 28, 6, 1, 226, 36, 28, 6, 1, 238, 169, 28, 6, 1, 244, 81, 2,
- 245, 236, 28, 6, 1, 229, 63, 66, 28, 6, 1, 248, 65, 28, 6, 1, 57, 28, 6,
- 1, 252, 238, 28, 6, 1, 225, 42, 28, 6, 1, 246, 58, 28, 6, 1, 250, 77, 28,
- 6, 1, 240, 72, 28, 6, 1, 223, 77, 28, 6, 1, 223, 97, 28, 6, 1, 74, 28, 6,
- 1, 229, 63, 74, 28, 6, 1, 177, 28, 6, 1, 248, 2, 28, 6, 1, 247, 247, 28,
- 6, 1, 247, 239, 28, 6, 1, 73, 28, 6, 1, 233, 151, 28, 6, 1, 247, 198, 28,
- 6, 1, 247, 188, 28, 6, 1, 227, 44, 28, 6, 1, 66, 28, 6, 1, 248, 29, 28,
- 6, 1, 154, 28, 6, 1, 226, 40, 28, 6, 1, 251, 182, 28, 6, 1, 229, 146, 28,
- 6, 1, 229, 116, 28, 6, 1, 245, 140, 53, 28, 6, 1, 223, 213, 28, 6, 1,
- 228, 165, 53, 28, 6, 1, 72, 28, 6, 1, 223, 158, 28, 6, 1, 191, 28, 3, 1,
- 57, 28, 3, 1, 252, 238, 28, 3, 1, 225, 42, 28, 3, 1, 246, 58, 28, 3, 1,
- 250, 77, 28, 3, 1, 240, 72, 28, 3, 1, 223, 77, 28, 3, 1, 223, 97, 28, 3,
- 1, 74, 28, 3, 1, 229, 63, 74, 28, 3, 1, 177, 28, 3, 1, 248, 2, 28, 3, 1,
- 247, 247, 28, 3, 1, 247, 239, 28, 3, 1, 73, 28, 3, 1, 233, 151, 28, 3, 1,
- 247, 198, 28, 3, 1, 247, 188, 28, 3, 1, 227, 44, 28, 3, 1, 66, 28, 3, 1,
- 248, 29, 28, 3, 1, 154, 28, 3, 1, 226, 40, 28, 3, 1, 251, 182, 28, 3, 1,
- 229, 146, 28, 3, 1, 229, 116, 28, 3, 1, 245, 140, 53, 28, 3, 1, 223, 213,
- 28, 3, 1, 228, 165, 53, 28, 3, 1, 72, 28, 3, 1, 223, 158, 28, 3, 1, 191,
- 28, 3, 1, 240, 73, 2, 245, 236, 28, 3, 1, 239, 219, 28, 3, 1, 249, 176,
- 28, 3, 1, 246, 21, 28, 3, 1, 225, 150, 240, 72, 28, 3, 1, 248, 69, 28, 3,
- 1, 252, 53, 74, 28, 3, 1, 223, 202, 28, 3, 1, 239, 170, 28, 3, 1, 237,
- 151, 28, 3, 1, 235, 48, 28, 3, 1, 226, 36, 28, 3, 1, 238, 169, 28, 3, 1,
- 244, 81, 2, 245, 236, 28, 3, 1, 229, 63, 66, 28, 3, 1, 248, 65, 28, 6, 1,
- 234, 66, 28, 3, 1, 234, 66, 28, 6, 1, 223, 239, 28, 3, 1, 223, 239, 28,
- 6, 1, 239, 213, 72, 28, 3, 1, 239, 213, 72, 28, 6, 1, 237, 155, 223, 139,
- 28, 3, 1, 237, 155, 223, 139, 28, 6, 1, 239, 213, 237, 155, 223, 139, 28,
- 3, 1, 239, 213, 237, 155, 223, 139, 28, 6, 1, 252, 173, 223, 139, 28, 3,
- 1, 252, 173, 223, 139, 28, 6, 1, 239, 213, 252, 173, 223, 139, 28, 3, 1,
- 239, 213, 252, 173, 223, 139, 28, 6, 1, 238, 111, 28, 3, 1, 238, 111, 28,
- 6, 1, 232, 183, 28, 3, 1, 232, 183, 28, 6, 1, 247, 38, 28, 3, 1, 247, 38,
- 28, 6, 1, 239, 184, 28, 3, 1, 239, 184, 28, 6, 1, 239, 185, 2, 47, 245,
- 237, 255, 41, 28, 3, 1, 239, 185, 2, 47, 245, 237, 255, 41, 28, 6, 1,
- 225, 153, 28, 3, 1, 225, 153, 28, 6, 1, 231, 104, 234, 66, 28, 3, 1, 231,
- 104, 234, 66, 28, 6, 1, 234, 67, 2, 226, 143, 28, 3, 1, 234, 67, 2, 226,
- 143, 28, 6, 1, 234, 19, 28, 3, 1, 234, 19, 28, 6, 1, 238, 135, 28, 3, 1,
- 238, 135, 28, 226, 193, 53, 36, 28, 226, 143, 36, 28, 233, 228, 36, 28,
- 172, 233, 6, 36, 28, 186, 233, 6, 36, 28, 232, 248, 36, 28, 244, 136,
- 226, 193, 53, 36, 28, 236, 128, 53, 28, 6, 1, 229, 63, 244, 81, 2, 227,
- 89, 28, 3, 1, 229, 63, 244, 81, 2, 227, 89, 28, 6, 1, 229, 182, 53, 28,
- 3, 1, 229, 182, 53, 28, 6, 1, 247, 199, 2, 226, 172, 28, 3, 1, 247, 199,
- 2, 226, 172, 28, 6, 1, 246, 59, 2, 225, 109, 28, 3, 1, 246, 59, 2, 225,
- 109, 28, 6, 1, 246, 59, 2, 82, 28, 3, 1, 246, 59, 2, 82, 28, 6, 1, 246,
- 59, 2, 236, 154, 88, 28, 3, 1, 246, 59, 2, 236, 154, 88, 28, 6, 1, 223,
- 78, 2, 250, 34, 28, 3, 1, 223, 78, 2, 250, 34, 28, 6, 1, 223, 98, 2, 250,
- 34, 28, 3, 1, 223, 98, 2, 250, 34, 28, 6, 1, 188, 2, 250, 34, 28, 3, 1,
- 188, 2, 250, 34, 28, 6, 1, 188, 2, 61, 82, 28, 3, 1, 188, 2, 61, 82, 28,
- 6, 1, 188, 2, 82, 28, 3, 1, 188, 2, 82, 28, 6, 1, 253, 23, 177, 28, 3, 1,
- 253, 23, 177, 28, 6, 1, 247, 240, 2, 250, 34, 28, 3, 1, 247, 240, 2, 250,
- 34, 28, 6, 20, 247, 240, 246, 58, 28, 3, 20, 247, 240, 246, 58, 28, 6, 1,
- 233, 152, 2, 236, 154, 88, 28, 3, 1, 233, 152, 2, 236, 154, 88, 28, 6, 1,
- 255, 47, 154, 28, 3, 1, 255, 47, 154, 28, 6, 1, 247, 189, 2, 250, 34, 28,
- 3, 1, 247, 189, 2, 250, 34, 28, 6, 1, 227, 45, 2, 250, 34, 28, 3, 1, 227,
- 45, 2, 250, 34, 28, 6, 1, 228, 32, 66, 28, 3, 1, 228, 32, 66, 28, 6, 1,
- 228, 32, 97, 2, 82, 28, 3, 1, 228, 32, 97, 2, 82, 28, 6, 1, 245, 170, 2,
- 250, 34, 28, 3, 1, 245, 170, 2, 250, 34, 28, 6, 20, 227, 45, 226, 40, 28,
- 3, 20, 227, 45, 226, 40, 28, 6, 1, 251, 183, 2, 250, 34, 28, 3, 1, 251,
- 183, 2, 250, 34, 28, 6, 1, 251, 183, 2, 61, 82, 28, 3, 1, 251, 183, 2,
- 61, 82, 28, 6, 1, 229, 91, 28, 3, 1, 229, 91, 28, 6, 1, 255, 47, 251,
- 182, 28, 3, 1, 255, 47, 251, 182, 28, 6, 1, 255, 47, 251, 183, 2, 250,
- 34, 28, 3, 1, 255, 47, 251, 183, 2, 250, 34, 28, 1, 233, 222, 28, 6, 1,
- 223, 78, 2, 252, 106, 28, 3, 1, 223, 78, 2, 252, 106, 28, 6, 1, 188, 2,
- 88, 28, 3, 1, 188, 2, 88, 28, 6, 1, 248, 3, 2, 227, 89, 28, 3, 1, 248, 3,
- 2, 227, 89, 28, 6, 1, 247, 240, 2, 88, 28, 3, 1, 247, 240, 2, 88, 28, 6,
- 1, 247, 240, 2, 227, 89, 28, 3, 1, 247, 240, 2, 227, 89, 28, 6, 1, 238,
- 223, 251, 182, 28, 3, 1, 238, 223, 251, 182, 28, 6, 1, 247, 248, 2, 227,
- 89, 28, 3, 1, 247, 248, 2, 227, 89, 28, 3, 1, 233, 222, 28, 6, 1, 102, 2,
- 252, 106, 28, 3, 1, 102, 2, 252, 106, 28, 6, 1, 102, 2, 219, 28, 3, 1,
- 102, 2, 219, 28, 6, 20, 102, 240, 72, 28, 3, 20, 102, 240, 72, 28, 6, 1,
- 240, 73, 2, 252, 106, 28, 3, 1, 240, 73, 2, 252, 106, 28, 6, 1, 230, 222,
- 28, 3, 1, 230, 222, 28, 6, 1, 230, 223, 2, 219, 28, 3, 1, 230, 223, 2,
- 219, 28, 6, 1, 223, 78, 2, 219, 28, 3, 1, 223, 78, 2, 219, 28, 6, 1, 223,
- 98, 2, 219, 28, 3, 1, 223, 98, 2, 219, 28, 6, 1, 255, 47, 248, 69, 28, 3,
- 1, 255, 47, 248, 69, 28, 6, 1, 244, 81, 2, 237, 63, 28, 3, 1, 244, 81, 2,
- 237, 63, 28, 6, 1, 244, 81, 2, 219, 28, 3, 1, 244, 81, 2, 219, 28, 6, 1,
- 130, 2, 219, 28, 3, 1, 130, 2, 219, 28, 6, 1, 253, 31, 73, 28, 3, 1, 253,
- 31, 73, 28, 6, 1, 253, 31, 130, 2, 219, 28, 3, 1, 253, 31, 130, 2, 219,
- 28, 6, 1, 161, 2, 219, 28, 3, 1, 161, 2, 219, 28, 6, 1, 97, 2, 237, 63,
- 28, 3, 1, 97, 2, 237, 63, 28, 6, 1, 97, 2, 219, 28, 3, 1, 97, 2, 219, 28,
- 6, 1, 97, 2, 47, 155, 28, 3, 1, 97, 2, 47, 155, 28, 6, 1, 251, 183, 2,
- 219, 28, 3, 1, 251, 183, 2, 219, 28, 6, 1, 246, 59, 2, 250, 34, 28, 3, 1,
- 246, 59, 2, 250, 34, 28, 6, 1, 223, 214, 2, 219, 28, 3, 1, 223, 214, 2,
- 219, 28, 6, 1, 246, 59, 2, 195, 22, 88, 28, 3, 1, 246, 59, 2, 195, 22,
- 88, 28, 6, 1, 245, 170, 2, 88, 28, 3, 1, 245, 170, 2, 88, 28, 6, 1, 245,
- 170, 2, 82, 28, 3, 1, 245, 170, 2, 82, 28, 6, 1, 238, 143, 250, 77, 28,
- 3, 1, 238, 143, 250, 77, 28, 6, 1, 238, 143, 249, 176, 28, 3, 1, 238,
- 143, 249, 176, 28, 6, 1, 238, 143, 223, 31, 28, 3, 1, 238, 143, 223, 31,
- 28, 6, 1, 238, 143, 248, 63, 28, 3, 1, 238, 143, 248, 63, 28, 6, 1, 238,
- 143, 237, 151, 28, 3, 1, 238, 143, 237, 151, 28, 6, 1, 238, 143, 235, 48,
- 28, 3, 1, 238, 143, 235, 48, 28, 6, 1, 238, 143, 228, 204, 28, 3, 1, 238,
- 143, 228, 204, 28, 6, 1, 238, 143, 226, 139, 28, 3, 1, 238, 143, 226,
- 139, 28, 6, 1, 200, 223, 97, 28, 3, 1, 200, 223, 97, 28, 6, 1, 248, 3, 2,
- 88, 28, 3, 1, 248, 3, 2, 88, 28, 6, 1, 237, 205, 28, 3, 1, 237, 205, 28,
- 6, 1, 231, 184, 28, 3, 1, 231, 184, 28, 6, 1, 224, 10, 28, 3, 1, 224, 10,
- 28, 6, 1, 232, 138, 28, 3, 1, 232, 138, 28, 6, 1, 224, 141, 28, 3, 1,
- 224, 141, 28, 6, 1, 254, 224, 177, 28, 3, 1, 254, 224, 177, 28, 6, 1,
- 248, 3, 2, 236, 154, 88, 28, 3, 1, 248, 3, 2, 236, 154, 88, 28, 6, 1,
- 247, 240, 2, 236, 154, 88, 28, 3, 1, 247, 240, 2, 236, 154, 88, 120, 6,
- 1, 254, 31, 120, 6, 1, 252, 210, 120, 6, 1, 246, 36, 120, 6, 1, 250, 189,
- 120, 6, 1, 248, 39, 120, 6, 1, 223, 117, 120, 6, 1, 248, 24, 120, 6, 1,
- 247, 173, 120, 6, 1, 96, 120, 6, 1, 223, 77, 120, 6, 1, 239, 252, 120, 6,
- 1, 237, 154, 120, 6, 1, 224, 67, 120, 6, 1, 252, 39, 120, 6, 1, 238, 243,
- 120, 6, 1, 244, 227, 120, 6, 1, 239, 179, 120, 6, 1, 246, 65, 120, 6, 1,
- 251, 178, 120, 6, 1, 236, 210, 120, 6, 1, 223, 202, 120, 6, 1, 234, 232,
- 120, 6, 1, 229, 146, 120, 6, 1, 224, 206, 120, 6, 1, 251, 204, 120, 6, 1,
- 233, 140, 120, 6, 1, 239, 158, 120, 6, 1, 208, 120, 6, 1, 230, 196, 120,
- 6, 1, 224, 230, 120, 6, 1, 226, 141, 120, 6, 1, 231, 225, 120, 6, 1, 251,
- 68, 120, 6, 1, 223, 188, 120, 6, 1, 233, 27, 120, 6, 1, 238, 253, 120, 6,
- 1, 234, 83, 120, 6, 1, 247, 87, 120, 52, 1, 42, 132, 231, 139, 120, 254,
- 144, 120, 247, 243, 76, 120, 247, 149, 76, 120, 251, 54, 120, 232, 69,
- 76, 120, 255, 48, 76, 120, 3, 1, 254, 31, 120, 3, 1, 252, 210, 120, 3, 1,
- 246, 36, 120, 3, 1, 250, 189, 120, 3, 1, 248, 39, 120, 3, 1, 223, 117,
- 120, 3, 1, 248, 24, 120, 3, 1, 247, 173, 120, 3, 1, 96, 120, 3, 1, 223,
- 77, 120, 3, 1, 239, 252, 120, 3, 1, 237, 154, 120, 3, 1, 224, 67, 120, 3,
- 1, 252, 39, 120, 3, 1, 238, 243, 120, 3, 1, 244, 227, 120, 3, 1, 239,
- 179, 120, 3, 1, 246, 65, 120, 3, 1, 251, 178, 120, 3, 1, 236, 210, 120,
- 3, 1, 223, 202, 120, 3, 1, 234, 232, 120, 3, 1, 229, 146, 120, 3, 1, 224,
- 206, 120, 3, 1, 251, 204, 120, 3, 1, 233, 140, 120, 3, 1, 239, 158, 120,
- 3, 1, 208, 120, 3, 1, 230, 196, 120, 3, 1, 224, 230, 120, 3, 1, 226, 141,
- 120, 3, 1, 231, 225, 120, 3, 1, 251, 68, 120, 3, 1, 223, 188, 120, 3, 1,
- 233, 27, 120, 3, 1, 238, 253, 120, 3, 1, 234, 83, 120, 3, 1, 247, 87,
- 120, 3, 20, 248, 40, 223, 188, 120, 246, 218, 228, 38, 120, 244, 95, 78,
- 255, 42, 247, 166, 78, 255, 42, 230, 197, 78, 255, 42, 229, 133, 78, 255,
- 42, 223, 106, 232, 121, 78, 255, 42, 223, 106, 246, 183, 78, 255, 42,
- 226, 149, 78, 255, 42, 231, 191, 78, 255, 42, 223, 105, 78, 255, 42, 233,
- 171, 78, 255, 42, 223, 208, 78, 255, 42, 227, 1, 78, 255, 42, 246, 112,
- 78, 255, 42, 246, 113, 236, 38, 78, 255, 42, 246, 110, 78, 255, 42, 232,
- 122, 233, 193, 78, 255, 42, 227, 27, 246, 126, 78, 255, 42, 233, 155, 78,
- 255, 42, 254, 60, 245, 163, 78, 255, 42, 236, 47, 78, 255, 42, 237, 53,
- 78, 255, 42, 236, 206, 78, 255, 42, 236, 207, 238, 254, 78, 255, 42, 250,
- 137, 78, 255, 42, 232, 133, 78, 255, 42, 227, 27, 232, 117, 78, 255, 42,
- 223, 216, 252, 211, 223, 173, 78, 255, 42, 234, 72, 78, 255, 42, 240, 33,
- 78, 255, 42, 250, 61, 78, 255, 42, 223, 36, 78, 165, 237, 5, 251, 106,
- 78, 232, 255, 229, 93, 78, 232, 255, 245, 131, 230, 197, 78, 232, 255,
- 245, 131, 233, 166, 78, 232, 255, 245, 131, 232, 126, 78, 232, 255, 245,
- 58, 78, 232, 255, 226, 38, 78, 232, 255, 230, 197, 78, 232, 255, 233,
- 166, 78, 232, 255, 232, 126, 78, 232, 255, 244, 223, 78, 232, 255, 244,
- 224, 245, 133, 32, 225, 46, 78, 232, 255, 232, 72, 78, 232, 255, 250,
- 176, 145, 237, 27, 78, 232, 255, 236, 198, 78, 232, 171, 237, 26, 78,
- 232, 255, 232, 14, 78, 232, 171, 233, 172, 78, 232, 255, 229, 79, 249,
- 140, 78, 232, 255, 228, 244, 249, 140, 78, 232, 171, 228, 166, 233, 168,
- 78, 165, 225, 113, 249, 140, 78, 165, 203, 249, 140, 78, 232, 171, 234,
- 195, 245, 162, 78, 232, 255, 232, 127, 232, 121, 78, 1, 254, 227, 78, 1,
- 252, 200, 78, 1, 246, 34, 78, 1, 250, 160, 78, 1, 245, 121, 78, 1, 225,
- 46, 78, 1, 223, 99, 78, 1, 245, 90, 78, 1, 227, 10, 78, 1, 223, 175, 78,
- 1, 35, 239, 59, 78, 1, 239, 59, 78, 1, 238, 12, 78, 1, 35, 236, 215, 78,
- 1, 236, 215, 78, 1, 35, 234, 194, 78, 1, 234, 194, 78, 1, 231, 2, 78, 1,
- 254, 29, 78, 1, 35, 233, 151, 78, 1, 233, 151, 78, 1, 35, 226, 41, 78, 1,
- 226, 41, 78, 1, 232, 92, 78, 1, 231, 205, 78, 1, 229, 78, 78, 1, 227, 58,
- 78, 20, 223, 200, 47, 225, 46, 78, 20, 223, 200, 225, 47, 223, 175, 78,
- 20, 223, 200, 47, 223, 175, 78, 232, 171, 246, 112, 78, 232, 171, 246,
- 110, 10, 65, 53, 10, 5, 230, 252, 10, 247, 1, 237, 13, 10, 5, 231, 21,
- 254, 131, 250, 232, 231, 111, 254, 131, 246, 237, 231, 111, 10, 231, 250,
- 254, 131, 233, 124, 236, 130, 53, 254, 131, 233, 124, 227, 24, 226, 195,
- 53, 255, 12, 53, 10, 251, 54, 10, 250, 125, 229, 173, 10, 233, 1, 225,
- 32, 53, 10, 5, 236, 113, 10, 5, 231, 8, 254, 229, 224, 156, 10, 5, 254,
- 229, 254, 74, 10, 5, 232, 13, 254, 228, 10, 5, 232, 17, 254, 214, 254,
- 178, 10, 5, 227, 82, 10, 3, 201, 227, 91, 10, 3, 201, 20, 92, 2, 216, 2,
- 223, 224, 10, 3, 201, 223, 110, 10, 3, 247, 104, 10, 3, 250, 156, 10, 3,
- 239, 23, 10, 229, 186, 10, 226, 66, 56, 232, 171, 76, 10, 232, 69, 76,
- 10, 1, 245, 149, 10, 1, 92, 2, 237, 59, 46, 10, 1, 92, 2, 164, 46, 10, 1,
- 224, 145, 2, 164, 46, 10, 1, 92, 2, 164, 51, 10, 1, 62, 2, 164, 46, 10,
- 1, 254, 227, 10, 1, 252, 223, 10, 1, 227, 35, 237, 22, 10, 1, 227, 34,
- 10, 1, 226, 236, 10, 1, 239, 168, 10, 1, 245, 159, 10, 1, 238, 225, 10,
- 1, 250, 165, 10, 1, 226, 245, 10, 1, 231, 225, 10, 1, 223, 110, 10, 1,
- 230, 201, 10, 1, 229, 110, 10, 1, 231, 24, 10, 1, 250, 184, 10, 1, 227,
- 91, 10, 1, 223, 113, 10, 1, 254, 248, 10, 1, 246, 63, 10, 1, 238, 252, 2,
- 135, 197, 46, 10, 1, 238, 252, 2, 152, 197, 51, 10, 1, 247, 107, 62, 2,
- 239, 223, 196, 10, 1, 247, 107, 62, 2, 135, 197, 46, 10, 1, 247, 107, 62,
- 2, 152, 197, 46, 10, 227, 63, 10, 1, 247, 87, 10, 1, 232, 131, 10, 1,
- 239, 59, 10, 1, 238, 20, 10, 1, 236, 225, 10, 1, 234, 251, 10, 1, 245,
- 107, 10, 1, 224, 144, 10, 1, 92, 237, 41, 10, 1, 223, 224, 10, 247, 102,
- 10, 250, 154, 10, 239, 21, 10, 247, 104, 10, 250, 156, 10, 239, 23, 10,
- 229, 137, 10, 227, 234, 10, 237, 57, 46, 10, 164, 46, 10, 164, 51, 10,
- 227, 253, 254, 227, 10, 239, 223, 250, 156, 10, 165, 234, 252, 246, 50,
- 10, 223, 5, 10, 31, 5, 3, 225, 65, 46, 10, 31, 5, 239, 223, 3, 225, 65,
- 46, 10, 31, 5, 56, 51, 10, 200, 250, 156, 10, 247, 105, 2, 135, 249, 138,
- 254, 131, 21, 223, 89, 254, 131, 21, 118, 254, 131, 21, 113, 254, 131,
- 21, 166, 254, 131, 21, 158, 254, 131, 21, 173, 254, 131, 21, 183, 254,
- 131, 21, 194, 254, 131, 21, 187, 254, 131, 21, 192, 10, 233, 123, 53, 10,
- 250, 71, 229, 173, 10, 226, 193, 229, 173, 10, 247, 37, 232, 253, 228,
- 58, 10, 1, 249, 139, 252, 223, 10, 1, 249, 139, 232, 131, 10, 1, 227,
- 219, 254, 227, 10, 1, 92, 224, 157, 10, 1, 92, 2, 224, 146, 164, 46, 10,
- 1, 92, 2, 224, 146, 164, 51, 10, 1, 201, 245, 149, 10, 1, 201, 164, 254,
- 227, 10, 1, 201, 164, 224, 144, 10, 1, 97, 2, 164, 46, 10, 1, 201, 164,
- 223, 224, 10, 1, 226, 14, 10, 1, 226, 12, 10, 1, 252, 230, 10, 1, 227,
- 35, 2, 231, 139, 10, 1, 227, 35, 2, 152, 197, 64, 248, 124, 10, 1, 233,
- 140, 10, 1, 227, 32, 10, 1, 252, 221, 10, 1, 101, 2, 164, 46, 10, 1, 101,
- 2, 135, 197, 61, 46, 10, 1, 234, 166, 10, 1, 248, 75, 10, 1, 101, 2, 152,
- 197, 46, 10, 1, 227, 48, 10, 1, 227, 46, 10, 1, 250, 112, 10, 1, 250,
- 166, 2, 231, 139, 10, 1, 250, 166, 2, 56, 51, 10, 1, 250, 166, 2, 56,
- 252, 214, 22, 3, 227, 91, 10, 1, 250, 171, 10, 1, 250, 114, 10, 1, 248,
- 99, 10, 1, 250, 166, 2, 152, 197, 64, 248, 124, 10, 1, 250, 166, 2, 246,
- 243, 197, 46, 10, 1, 231, 95, 10, 1, 231, 226, 2, 3, 196, 10, 1, 231,
- 226, 2, 231, 139, 10, 1, 231, 226, 2, 56, 51, 10, 1, 231, 226, 2, 3, 225,
- 65, 51, 10, 1, 231, 226, 2, 56, 252, 214, 22, 56, 46, 10, 1, 231, 226, 2,
- 135, 197, 46, 10, 1, 239, 165, 10, 1, 231, 226, 2, 246, 243, 197, 46, 10,
- 1, 230, 202, 2, 56, 252, 214, 22, 56, 46, 10, 1, 230, 202, 2, 152, 197,
- 51, 10, 1, 230, 202, 2, 152, 197, 252, 214, 22, 152, 197, 46, 10, 1, 231,
- 25, 2, 135, 197, 51, 10, 1, 231, 25, 2, 152, 197, 46, 10, 1, 227, 92, 2,
- 152, 197, 46, 10, 1, 254, 249, 2, 152, 197, 46, 10, 1, 249, 139, 247, 87,
- 10, 1, 247, 88, 2, 56, 236, 71, 51, 10, 1, 247, 88, 2, 56, 51, 10, 1,
- 225, 36, 10, 1, 247, 88, 2, 152, 197, 51, 10, 1, 233, 138, 10, 1, 232,
- 132, 2, 56, 46, 10, 1, 232, 132, 2, 152, 197, 46, 10, 1, 238, 251, 10, 1,
- 227, 197, 239, 59, 10, 1, 239, 60, 2, 231, 139, 10, 1, 239, 60, 2, 56,
- 46, 10, 1, 235, 139, 10, 1, 239, 60, 2, 152, 197, 51, 10, 1, 246, 180,
- 10, 1, 246, 181, 2, 231, 139, 10, 1, 235, 105, 10, 1, 246, 181, 2, 135,
- 197, 51, 10, 1, 245, 210, 10, 1, 246, 181, 2, 152, 197, 46, 10, 1, 216,
- 2, 3, 196, 10, 1, 216, 2, 56, 46, 10, 1, 216, 2, 152, 197, 46, 10, 1,
- 216, 2, 152, 197, 51, 10, 1, 234, 252, 2, 56, 51, 10, 1, 234, 252, 246,
- 50, 10, 1, 231, 125, 10, 1, 234, 252, 2, 231, 139, 10, 1, 234, 252, 2,
- 152, 197, 46, 10, 1, 245, 108, 249, 157, 10, 1, 227, 49, 2, 56, 46, 10,
- 1, 245, 108, 2, 62, 46, 10, 1, 245, 108, 246, 8, 10, 1, 245, 108, 246, 9,
- 2, 164, 46, 10, 1, 227, 35, 237, 23, 246, 8, 10, 1, 224, 145, 2, 231,
- 139, 10, 1, 238, 185, 234, 88, 10, 1, 234, 88, 10, 1, 66, 10, 1, 223,
- 158, 10, 1, 238, 185, 223, 158, 10, 1, 224, 145, 2, 135, 197, 46, 10, 1,
- 225, 42, 10, 1, 247, 107, 223, 224, 10, 1, 62, 2, 227, 89, 10, 1, 62, 2,
- 3, 196, 10, 1, 224, 145, 2, 56, 46, 10, 1, 72, 10, 1, 62, 2, 152, 197,
- 51, 10, 1, 62, 253, 29, 10, 1, 62, 253, 30, 2, 164, 46, 10, 246, 218,
- 228, 38, 10, 1, 255, 19, 10, 3, 201, 20, 231, 25, 2, 216, 2, 92, 237, 41,
- 10, 3, 201, 20, 232, 132, 2, 216, 2, 92, 237, 41, 10, 3, 201, 55, 59, 15,
- 10, 3, 201, 216, 254, 227, 10, 3, 201, 239, 168, 10, 3, 201, 152, 249,
- 138, 10, 3, 201, 230, 201, 10, 247, 233, 106, 254, 33, 10, 228, 56, 106,
- 231, 68, 248, 3, 245, 56, 10, 3, 201, 231, 102, 223, 89, 10, 3, 201, 225,
- 112, 231, 235, 223, 89, 10, 3, 201, 249, 139, 245, 119, 106, 238, 225,
- 10, 3, 201, 55, 44, 15, 10, 3, 184, 230, 201, 10, 3, 201, 237, 58, 10, 3,
- 224, 144, 10, 3, 223, 224, 10, 3, 201, 223, 224, 10, 3, 201, 234, 251,
- 10, 233, 23, 106, 231, 14, 10, 247, 241, 251, 219, 184, 228, 38, 10, 247,
- 241, 251, 219, 201, 228, 38, 10, 231, 102, 201, 228, 39, 2, 247, 53, 251,
- 218, 10, 3, 184, 236, 225, 10, 1, 250, 166, 2, 239, 223, 196, 10, 1, 231,
- 226, 2, 239, 223, 196, 247, 142, 254, 131, 21, 223, 89, 247, 142, 254,
- 131, 21, 118, 247, 142, 254, 131, 21, 113, 247, 142, 254, 131, 21, 166,
- 247, 142, 254, 131, 21, 158, 247, 142, 254, 131, 21, 173, 247, 142, 254,
- 131, 21, 183, 247, 142, 254, 131, 21, 194, 247, 142, 254, 131, 21, 187,
- 247, 142, 254, 131, 21, 192, 10, 1, 229, 111, 2, 56, 51, 10, 1, 250, 185,
- 2, 56, 51, 10, 1, 246, 64, 2, 56, 51, 10, 5, 228, 243, 254, 193, 10, 5,
- 228, 243, 232, 236, 236, 210, 10, 1, 245, 108, 2, 239, 223, 196, 151,
- 247, 233, 106, 233, 191, 151, 227, 215, 246, 218, 228, 38, 151, 227, 255,
- 246, 218, 228, 38, 151, 227, 215, 251, 61, 151, 227, 255, 251, 61, 151,
- 169, 251, 61, 151, 251, 62, 228, 202, 237, 237, 151, 251, 62, 228, 202,
- 231, 153, 151, 227, 215, 251, 62, 228, 202, 237, 237, 151, 227, 255, 251,
- 62, 228, 202, 231, 153, 151, 251, 20, 151, 245, 138, 234, 99, 151, 245,
- 138, 236, 197, 151, 245, 138, 254, 71, 151, 255, 48, 76, 151, 1, 254,
- 230, 151, 1, 227, 219, 254, 230, 151, 1, 252, 197, 151, 1, 246, 172, 151,
- 1, 246, 173, 246, 156, 151, 1, 250, 163, 151, 1, 249, 139, 250, 164, 231,
- 136, 151, 1, 245, 121, 151, 1, 224, 144, 151, 1, 223, 110, 151, 1, 245,
- 88, 151, 1, 227, 6, 151, 1, 227, 7, 246, 156, 151, 1, 223, 148, 151, 1,
- 223, 149, 245, 121, 151, 1, 239, 38, 151, 1, 238, 19, 151, 1, 236, 127,
- 151, 1, 234, 194, 151, 1, 229, 179, 151, 1, 35, 229, 179, 151, 1, 72,
- 151, 1, 233, 151, 151, 1, 200, 233, 151, 151, 1, 231, 22, 151, 1, 232,
- 125, 151, 1, 231, 136, 151, 1, 229, 78, 151, 1, 227, 56, 151, 1, 233,
- 113, 252, 187, 151, 1, 233, 113, 246, 61, 151, 1, 233, 113, 250, 19, 151,
- 232, 174, 46, 151, 232, 174, 51, 151, 232, 174, 248, 137, 151, 223, 21,
- 46, 151, 223, 21, 51, 151, 223, 21, 248, 137, 151, 231, 247, 46, 151,
- 231, 247, 51, 151, 248, 138, 223, 28, 244, 212, 151, 248, 138, 223, 28,
- 254, 179, 151, 245, 124, 46, 151, 245, 124, 51, 151, 245, 123, 248, 137,
- 151, 247, 186, 46, 151, 247, 186, 51, 151, 231, 44, 151, 247, 81, 249,
- 140, 151, 232, 51, 151, 231, 66, 151, 135, 61, 197, 46, 151, 135, 61,
- 197, 51, 151, 152, 197, 46, 151, 152, 197, 51, 151, 234, 97, 237, 171,
- 46, 151, 234, 97, 237, 171, 51, 151, 236, 28, 151, 253, 28, 151, 1, 228,
- 163, 223, 83, 151, 1, 228, 163, 238, 219, 151, 1, 228, 163, 247, 97, 10,
- 1, 252, 224, 2, 152, 197, 244, 162, 51, 10, 1, 252, 224, 2, 56, 252, 214,
- 22, 152, 197, 46, 10, 1, 252, 224, 2, 152, 197, 232, 251, 225, 106, 51,
- 10, 1, 252, 224, 2, 152, 197, 232, 251, 225, 106, 252, 214, 22, 135, 197,
- 46, 10, 1, 252, 224, 2, 135, 197, 252, 214, 22, 56, 46, 10, 1, 252, 224,
- 2, 239, 223, 3, 225, 65, 51, 10, 1, 252, 224, 2, 3, 196, 10, 1, 101, 2,
- 135, 197, 46, 10, 1, 101, 2, 152, 197, 232, 251, 225, 106, 51, 10, 1,
- 250, 166, 2, 135, 197, 224, 236, 252, 214, 22, 3, 227, 91, 10, 1, 250,
- 166, 2, 239, 223, 3, 225, 65, 51, 10, 1, 231, 226, 2, 82, 10, 1, 230,
- 202, 2, 246, 243, 197, 46, 10, 1, 254, 249, 2, 135, 197, 46, 10, 1, 254,
- 249, 2, 152, 197, 232, 251, 248, 125, 46, 10, 1, 254, 249, 2, 135, 197,
- 224, 236, 46, 10, 1, 247, 88, 2, 135, 197, 51, 10, 1, 247, 88, 2, 152,
- 197, 232, 251, 225, 106, 51, 10, 1, 238, 252, 2, 56, 46, 10, 1, 238, 252,
- 2, 152, 197, 46, 10, 1, 238, 252, 2, 152, 197, 232, 251, 225, 106, 51,
- 10, 1, 55, 2, 56, 46, 10, 1, 55, 2, 56, 51, 10, 1, 234, 252, 2, 135, 197,
- 51, 10, 1, 234, 252, 2, 3, 227, 91, 10, 1, 234, 252, 2, 3, 196, 10, 1,
- 216, 2, 125, 10, 1, 231, 226, 2, 135, 197, 224, 236, 46, 10, 1, 231, 226,
- 2, 164, 46, 10, 1, 230, 202, 2, 135, 197, 224, 236, 46, 10, 1, 101, 2, 3,
- 10, 1, 227, 92, 51, 10, 1, 101, 2, 3, 10, 1, 227, 92, 22, 135, 249, 138,
- 10, 1, 230, 202, 2, 3, 10, 1, 227, 92, 22, 135, 249, 138, 10, 1, 231,
- 226, 2, 3, 10, 1, 227, 92, 22, 135, 249, 138, 10, 1, 101, 2, 3, 10, 1,
- 227, 92, 46, 10, 1, 92, 2, 247, 142, 254, 131, 21, 135, 46, 10, 1, 92, 2,
- 247, 142, 254, 131, 21, 152, 46, 10, 1, 247, 107, 62, 2, 247, 142, 254,
- 131, 21, 135, 46, 10, 1, 247, 107, 62, 2, 247, 142, 254, 131, 21, 152,
- 46, 10, 1, 247, 107, 62, 2, 247, 142, 254, 131, 21, 246, 243, 51, 10, 1,
- 224, 145, 2, 247, 142, 254, 131, 21, 135, 46, 10, 1, 224, 145, 2, 247,
- 142, 254, 131, 21, 152, 46, 10, 1, 62, 253, 30, 2, 247, 142, 254, 131,
- 21, 135, 46, 10, 1, 62, 253, 30, 2, 247, 142, 254, 131, 21, 152, 46, 10,
- 1, 101, 2, 247, 142, 254, 131, 21, 246, 243, 51, 10, 1, 230, 202, 2, 247,
- 142, 254, 131, 21, 246, 243, 46, 10, 1, 230, 202, 2, 239, 223, 196, 10,
- 1, 239, 60, 2, 135, 197, 46, 226, 248, 1, 245, 167, 226, 248, 1, 229,
- 118, 226, 248, 1, 234, 250, 226, 248, 1, 232, 22, 226, 248, 1, 253, 69,
- 226, 248, 1, 237, 202, 226, 248, 1, 239, 70, 226, 248, 1, 254, 219, 226,
- 248, 1, 225, 62, 226, 248, 1, 236, 224, 226, 248, 1, 247, 127, 226, 248,
- 1, 250, 21, 226, 248, 1, 226, 250, 226, 248, 1, 238, 40, 226, 248, 1,
- 246, 189, 226, 248, 1, 246, 14, 226, 248, 1, 230, 200, 226, 248, 1, 250,
- 123, 226, 248, 1, 223, 102, 226, 248, 1, 227, 57, 226, 248, 1, 224, 21,
- 226, 248, 1, 233, 161, 226, 248, 1, 239, 172, 226, 248, 1, 251, 185, 226,
- 248, 1, 226, 19, 226, 248, 1, 245, 83, 226, 248, 1, 238, 226, 226, 248,
- 1, 226, 249, 226, 248, 1, 223, 116, 226, 248, 1, 229, 109, 226, 248, 1,
- 231, 28, 226, 248, 1, 250, 187, 226, 248, 1, 96, 226, 248, 1, 223, 27,
- 226, 248, 1, 254, 246, 226, 248, 1, 246, 62, 226, 248, 1, 232, 135, 226,
- 248, 1, 224, 171, 226, 248, 255, 49, 226, 248, 255, 62, 226, 248, 244,
- 70, 226, 248, 248, 34, 226, 248, 225, 166, 226, 248, 234, 51, 226, 248,
- 248, 41, 226, 248, 247, 137, 226, 248, 234, 96, 226, 248, 234, 104, 226,
- 248, 227, 234, 226, 248, 1, 235, 254, 204, 21, 223, 89, 204, 21, 118,
- 204, 21, 113, 204, 21, 166, 204, 21, 158, 204, 21, 173, 204, 21, 183,
- 204, 21, 194, 204, 21, 187, 204, 21, 192, 204, 1, 57, 204, 1, 248, 35,
- 204, 1, 74, 204, 1, 72, 204, 1, 66, 204, 1, 234, 52, 204, 1, 73, 204, 1,
- 250, 177, 204, 1, 199, 204, 1, 253, 70, 204, 1, 213, 204, 1, 227, 107,
- 204, 1, 239, 179, 204, 1, 251, 204, 204, 1, 250, 189, 204, 1, 208, 204,
- 1, 231, 99, 204, 1, 231, 31, 204, 1, 246, 144, 204, 1, 247, 129, 204, 1,
- 177, 204, 1, 238, 43, 204, 1, 236, 2, 224, 102, 204, 1, 198, 204, 1, 234,
- 173, 204, 1, 236, 1, 204, 1, 154, 204, 1, 224, 173, 204, 1, 191, 204, 1,
- 234, 174, 224, 102, 204, 1, 239, 110, 239, 179, 204, 1, 239, 110, 251,
- 204, 204, 1, 239, 110, 208, 204, 36, 229, 63, 201, 226, 118, 204, 36,
- 229, 63, 184, 226, 118, 204, 36, 229, 63, 231, 135, 226, 118, 204, 36,
- 182, 250, 33, 226, 118, 204, 36, 182, 201, 226, 118, 204, 36, 182, 184,
- 226, 118, 204, 36, 182, 231, 135, 226, 118, 204, 36, 235, 228, 76, 204,
- 36, 47, 56, 46, 204, 201, 206, 254, 144, 204, 184, 206, 254, 144, 204,
- 14, 234, 53, 250, 44, 204, 14, 246, 143, 204, 251, 54, 204, 247, 149, 76,
- 204, 238, 25, 94, 5, 252, 19, 94, 5, 254, 160, 94, 5, 224, 211, 94, 1,
- 229, 63, 57, 94, 1, 57, 94, 1, 255, 63, 94, 1, 74, 94, 1, 240, 47, 94, 1,
- 66, 94, 1, 225, 76, 94, 1, 153, 146, 94, 1, 153, 149, 94, 1, 252, 21, 72,
- 94, 1, 229, 63, 72, 94, 1, 72, 94, 1, 254, 253, 94, 1, 252, 21, 73, 94,
- 1, 229, 63, 73, 94, 1, 73, 94, 1, 254, 53, 94, 1, 177, 94, 1, 238, 227,
- 94, 1, 246, 193, 94, 1, 246, 66, 94, 1, 235, 137, 94, 1, 252, 39, 94, 1,
- 251, 204, 94, 1, 239, 179, 94, 1, 239, 160, 94, 1, 234, 173, 94, 1, 226,
- 20, 94, 1, 226, 10, 94, 1, 250, 117, 94, 1, 250, 101, 94, 1, 235, 18, 94,
- 1, 227, 107, 94, 1, 226, 251, 94, 1, 250, 189, 94, 1, 250, 22, 94, 1,
- 236, 1, 94, 1, 235, 10, 94, 1, 213, 94, 1, 233, 97, 94, 1, 253, 70, 94,
- 1, 252, 190, 94, 1, 198, 94, 1, 191, 94, 1, 208, 94, 1, 231, 99, 94, 1,
- 238, 43, 94, 1, 237, 148, 94, 1, 237, 147, 94, 1, 225, 64, 94, 1, 229,
- 146, 94, 1, 228, 110, 94, 1, 231, 31, 94, 1, 154, 94, 5, 234, 202, 94, 5,
- 254, 40, 94, 31, 5, 255, 63, 94, 31, 5, 74, 94, 31, 5, 240, 47, 94, 31,
- 5, 66, 94, 31, 5, 225, 76, 94, 31, 5, 153, 146, 94, 31, 5, 153, 231, 100,
- 94, 31, 5, 252, 21, 72, 94, 31, 5, 229, 63, 72, 94, 31, 5, 72, 94, 31, 5,
- 254, 253, 94, 31, 5, 252, 21, 73, 94, 31, 5, 229, 63, 73, 94, 31, 5, 73,
- 94, 31, 5, 254, 53, 94, 5, 224, 216, 94, 234, 69, 94, 228, 27, 5, 225,
- 161, 94, 228, 27, 5, 254, 162, 94, 245, 237, 255, 41, 94, 255, 33, 255,
- 41, 94, 1, 232, 138, 94, 1, 238, 214, 94, 1, 246, 56, 94, 1, 223, 117,
- 94, 1, 250, 106, 94, 1, 231, 184, 94, 1, 247, 129, 94, 1, 223, 126, 94,
- 1, 153, 231, 100, 94, 1, 153, 237, 149, 94, 31, 5, 153, 149, 94, 31, 5,
- 153, 237, 149, 94, 250, 151, 94, 47, 250, 151, 94, 21, 223, 89, 94, 21,
- 118, 94, 21, 113, 94, 21, 166, 94, 21, 158, 94, 21, 173, 94, 21, 183, 94,
- 21, 194, 94, 21, 187, 94, 21, 192, 94, 255, 48, 53, 94, 5, 201, 228, 144,
- 249, 140, 94, 1, 252, 21, 57, 94, 1, 246, 101, 94, 1, 239, 145, 94, 1,
- 246, 16, 228, 38, 94, 1, 250, 107, 94, 1, 253, 16, 121, 5, 252, 19, 121,
- 5, 254, 160, 121, 5, 224, 211, 121, 1, 57, 121, 1, 255, 63, 121, 1, 74,
- 121, 1, 240, 47, 121, 1, 66, 121, 1, 225, 76, 121, 1, 153, 146, 121, 1,
- 153, 149, 121, 1, 72, 121, 1, 254, 253, 121, 1, 73, 121, 1, 254, 53, 121,
- 1, 177, 121, 1, 238, 227, 121, 1, 246, 193, 121, 1, 246, 66, 121, 1, 235,
- 137, 121, 1, 252, 39, 121, 1, 251, 204, 121, 1, 239, 179, 121, 1, 239,
- 160, 121, 1, 234, 173, 121, 1, 226, 20, 121, 1, 226, 10, 121, 1, 250,
- 117, 121, 1, 250, 101, 121, 1, 235, 18, 121, 1, 227, 107, 121, 1, 226,
- 251, 121, 1, 250, 189, 121, 1, 250, 22, 121, 1, 236, 1, 121, 1, 213, 121,
- 1, 233, 97, 121, 1, 253, 70, 121, 1, 252, 190, 121, 1, 198, 121, 1, 191,
- 121, 1, 208, 121, 1, 238, 43, 121, 1, 229, 146, 121, 1, 228, 110, 121, 1,
- 231, 31, 121, 1, 154, 121, 5, 234, 202, 121, 5, 254, 40, 121, 31, 5, 255,
- 63, 121, 31, 5, 74, 121, 31, 5, 240, 47, 121, 31, 5, 66, 121, 31, 5, 225,
- 76, 121, 31, 5, 153, 146, 121, 31, 5, 153, 231, 100, 121, 31, 5, 72, 121,
- 31, 5, 254, 253, 121, 31, 5, 73, 121, 31, 5, 254, 53, 121, 5, 224, 216,
- 121, 1, 238, 221, 227, 107, 121, 254, 54, 237, 219, 76, 121, 1, 231, 99,
- 121, 1, 231, 184, 121, 1, 223, 126, 121, 1, 153, 231, 100, 121, 1, 153,
- 237, 149, 121, 31, 5, 153, 149, 121, 31, 5, 153, 237, 149, 121, 21, 223,
- 89, 121, 21, 118, 121, 21, 113, 121, 21, 166, 121, 21, 158, 121, 21, 173,
- 121, 21, 183, 121, 21, 194, 121, 21, 187, 121, 21, 192, 121, 1, 232, 25,
- 2, 236, 154, 250, 0, 121, 1, 232, 25, 2, 203, 250, 0, 121, 231, 54, 76,
- 121, 231, 54, 53, 121, 250, 222, 234, 197, 118, 121, 250, 222, 234, 197,
- 113, 121, 250, 222, 234, 197, 166, 121, 250, 222, 234, 197, 158, 121,
- 250, 222, 234, 197, 168, 237, 214, 226, 244, 226, 240, 250, 42, 121, 250,
- 222, 250, 43, 228, 212, 121, 239, 196, 148, 5, 255, 28, 252, 169, 148, 5,
- 252, 169, 148, 5, 224, 211, 148, 1, 57, 148, 1, 255, 63, 148, 1, 74, 148,
- 1, 240, 47, 148, 1, 66, 148, 1, 225, 76, 148, 1, 248, 35, 148, 1, 254,
- 253, 148, 1, 234, 52, 148, 1, 254, 53, 148, 1, 177, 148, 1, 238, 227,
- 148, 1, 246, 193, 148, 1, 246, 66, 148, 1, 235, 137, 148, 1, 252, 39,
- 148, 1, 251, 204, 148, 1, 239, 179, 148, 1, 239, 160, 148, 1, 234, 173,
- 148, 1, 226, 20, 148, 1, 226, 10, 148, 1, 250, 117, 148, 1, 250, 101,
- 148, 1, 235, 18, 148, 1, 227, 107, 148, 1, 226, 251, 148, 1, 250, 189,
- 148, 1, 250, 22, 148, 1, 236, 1, 148, 1, 213, 148, 1, 233, 97, 148, 1,
- 253, 70, 148, 1, 252, 190, 148, 1, 198, 148, 1, 191, 148, 1, 208, 148, 1,
- 238, 43, 148, 1, 237, 148, 148, 1, 225, 64, 148, 1, 229, 146, 148, 1,
- 231, 31, 148, 1, 154, 148, 5, 234, 202, 148, 31, 5, 255, 63, 148, 31, 5,
- 74, 148, 31, 5, 240, 47, 148, 31, 5, 66, 148, 31, 5, 225, 76, 148, 31, 5,
- 248, 35, 148, 31, 5, 254, 253, 148, 31, 5, 234, 52, 148, 31, 5, 254, 53,
- 148, 5, 224, 216, 148, 5, 225, 162, 148, 1, 238, 214, 148, 1, 246, 56,
- 148, 1, 223, 117, 148, 1, 231, 99, 148, 1, 247, 129, 148, 21, 223, 89,
- 148, 21, 118, 148, 21, 113, 148, 21, 166, 148, 21, 158, 148, 21, 173,
- 148, 21, 183, 148, 21, 194, 148, 21, 187, 148, 21, 192, 148, 226, 148,
- 148, 255, 27, 148, 239, 209, 148, 225, 99, 148, 248, 9, 234, 57, 148, 5,
- 224, 0, 137, 5, 252, 19, 137, 5, 254, 160, 137, 5, 224, 211, 137, 1, 57,
- 137, 1, 255, 63, 137, 1, 74, 137, 1, 240, 47, 137, 1, 66, 137, 1, 225,
- 76, 137, 1, 153, 146, 137, 1, 153, 149, 137, 31, 252, 21, 72, 137, 1, 72,
- 137, 1, 254, 253, 137, 31, 252, 21, 73, 137, 1, 73, 137, 1, 254, 53, 137,
- 1, 177, 137, 1, 238, 227, 137, 1, 246, 193, 137, 1, 246, 66, 137, 1, 235,
- 137, 137, 1, 252, 39, 137, 1, 251, 204, 137, 1, 239, 179, 137, 1, 239,
- 160, 137, 1, 234, 173, 137, 1, 226, 20, 137, 1, 226, 10, 137, 1, 250,
- 117, 137, 1, 250, 101, 137, 1, 235, 18, 137, 1, 227, 107, 137, 1, 226,
- 251, 137, 1, 250, 189, 137, 1, 250, 22, 137, 1, 236, 1, 137, 1, 213, 137,
- 1, 233, 97, 137, 1, 253, 70, 137, 1, 252, 190, 137, 1, 198, 137, 1, 191,
- 137, 1, 208, 137, 1, 238, 43, 137, 1, 237, 148, 137, 1, 225, 64, 137, 1,
- 229, 146, 137, 1, 228, 110, 137, 1, 231, 31, 137, 1, 154, 137, 5, 234,
- 202, 137, 5, 254, 40, 137, 31, 5, 255, 63, 137, 31, 5, 74, 137, 31, 5,
- 240, 47, 137, 31, 5, 66, 137, 31, 5, 225, 76, 137, 31, 5, 153, 146, 137,
- 31, 5, 153, 231, 100, 137, 31, 5, 252, 21, 72, 137, 31, 5, 72, 137, 31,
- 5, 254, 253, 137, 31, 5, 252, 21, 73, 137, 31, 5, 73, 137, 31, 5, 254,
- 53, 137, 5, 224, 216, 137, 234, 69, 137, 1, 153, 231, 100, 137, 1, 153,
- 237, 149, 137, 31, 5, 153, 149, 137, 31, 5, 153, 237, 149, 137, 21, 223,
- 89, 137, 21, 118, 137, 21, 113, 137, 21, 166, 137, 21, 158, 137, 21, 173,
- 137, 21, 183, 137, 21, 194, 137, 21, 187, 137, 21, 192, 137, 231, 54, 53,
- 134, 5, 252, 19, 134, 5, 254, 160, 134, 5, 224, 211, 134, 1, 57, 134, 1,
- 255, 63, 134, 1, 74, 134, 1, 240, 47, 134, 1, 66, 134, 1, 225, 76, 134,
- 1, 153, 146, 134, 1, 153, 149, 134, 1, 72, 134, 1, 254, 253, 134, 1, 73,
- 134, 1, 254, 53, 134, 1, 177, 134, 1, 238, 227, 134, 1, 246, 193, 134, 1,
- 246, 66, 134, 1, 235, 137, 134, 1, 252, 39, 134, 1, 251, 204, 134, 1,
- 239, 179, 134, 1, 239, 160, 134, 1, 234, 173, 134, 1, 226, 20, 134, 1,
- 226, 10, 134, 1, 250, 117, 134, 1, 250, 101, 134, 1, 235, 18, 134, 1,
- 227, 107, 134, 1, 226, 251, 134, 1, 250, 189, 134, 1, 250, 22, 134, 1,
- 236, 1, 134, 1, 213, 134, 1, 233, 97, 134, 1, 253, 70, 134, 1, 252, 190,
- 134, 1, 198, 134, 1, 191, 134, 1, 208, 134, 1, 238, 43, 134, 1, 237, 148,
- 134, 1, 225, 64, 134, 1, 229, 146, 134, 1, 228, 110, 134, 1, 231, 31,
- 134, 1, 154, 134, 5, 234, 202, 134, 5, 254, 40, 134, 31, 5, 255, 63, 134,
- 31, 5, 74, 134, 31, 5, 240, 47, 134, 31, 5, 66, 134, 31, 5, 225, 76, 134,
- 31, 5, 153, 146, 134, 31, 5, 153, 231, 100, 134, 31, 5, 72, 134, 31, 5,
- 254, 253, 134, 31, 5, 73, 134, 31, 5, 254, 53, 134, 5, 224, 216, 134,
- 254, 254, 237, 219, 76, 134, 254, 54, 237, 219, 76, 134, 1, 231, 99, 134,
- 1, 231, 184, 134, 1, 223, 126, 134, 1, 153, 231, 100, 134, 1, 153, 237,
- 149, 134, 31, 5, 153, 149, 134, 31, 5, 153, 237, 149, 134, 21, 223, 89,
- 134, 21, 118, 134, 21, 113, 134, 21, 166, 134, 21, 158, 134, 21, 173,
- 134, 21, 183, 134, 21, 194, 134, 21, 187, 134, 21, 192, 134, 239, 196,
- 134, 1, 224, 173, 160, 5, 254, 160, 160, 5, 224, 211, 160, 1, 57, 160, 1,
- 255, 63, 160, 1, 74, 160, 1, 240, 47, 160, 1, 66, 160, 1, 225, 76, 160,
- 1, 72, 160, 1, 248, 35, 160, 1, 254, 253, 160, 1, 73, 160, 1, 234, 52,
- 160, 1, 254, 53, 160, 1, 177, 160, 1, 235, 137, 160, 1, 252, 39, 160, 1,
- 239, 179, 160, 1, 234, 173, 160, 1, 226, 20, 160, 1, 235, 18, 160, 1,
- 227, 107, 160, 1, 236, 1, 160, 1, 235, 10, 160, 1, 213, 160, 1, 198, 160,
- 1, 191, 160, 1, 208, 160, 1, 231, 99, 160, 1, 238, 43, 160, 1, 237, 148,
- 160, 1, 237, 147, 160, 1, 225, 64, 160, 1, 229, 146, 160, 1, 228, 110,
- 160, 1, 231, 31, 160, 1, 154, 160, 31, 5, 255, 63, 160, 31, 5, 74, 160,
- 31, 5, 240, 47, 160, 31, 5, 66, 160, 31, 5, 225, 76, 160, 31, 5, 72, 160,
- 31, 5, 248, 35, 160, 31, 5, 254, 253, 160, 31, 5, 73, 160, 31, 5, 234,
- 52, 160, 31, 5, 254, 53, 160, 5, 224, 216, 160, 234, 69, 160, 254, 54,
- 237, 219, 76, 160, 21, 223, 89, 160, 21, 118, 160, 21, 113, 160, 21, 166,
- 160, 21, 158, 160, 21, 173, 160, 21, 183, 160, 21, 194, 160, 21, 187,
- 160, 21, 192, 160, 65, 227, 23, 160, 65, 168, 244, 135, 160, 65, 168,
- 226, 194, 160, 250, 121, 53, 160, 236, 88, 53, 160, 223, 226, 53, 160,
- 250, 74, 53, 160, 250, 250, 53, 160, 254, 87, 64, 53, 160, 231, 54, 53,
- 160, 65, 53, 119, 5, 252, 19, 119, 5, 254, 160, 119, 5, 224, 211, 119, 1,
- 57, 119, 1, 255, 63, 119, 1, 74, 119, 1, 240, 47, 119, 1, 66, 119, 1,
- 225, 76, 119, 1, 153, 146, 119, 1, 153, 149, 119, 1, 72, 119, 1, 248, 35,
- 119, 1, 254, 253, 119, 1, 73, 119, 1, 234, 52, 119, 1, 254, 53, 119, 1,
- 177, 119, 1, 238, 227, 119, 1, 246, 193, 119, 1, 246, 66, 119, 1, 235,
- 137, 119, 1, 252, 39, 119, 1, 251, 204, 119, 1, 239, 179, 119, 1, 239,
- 160, 119, 1, 234, 173, 119, 1, 226, 20, 119, 1, 226, 10, 119, 1, 250,
- 117, 119, 1, 250, 101, 119, 1, 235, 18, 119, 1, 227, 107, 119, 1, 226,
- 251, 119, 1, 250, 189, 119, 1, 250, 22, 119, 1, 236, 1, 119, 1, 213, 119,
- 1, 233, 97, 119, 1, 253, 70, 119, 1, 252, 190, 119, 1, 198, 119, 1, 191,
- 119, 1, 208, 119, 1, 231, 99, 119, 1, 238, 43, 119, 1, 237, 148, 119, 1,
- 225, 64, 119, 1, 229, 146, 119, 1, 228, 110, 119, 1, 231, 31, 119, 1,
- 154, 119, 5, 254, 40, 119, 31, 5, 255, 63, 119, 31, 5, 74, 119, 31, 5,
- 240, 47, 119, 31, 5, 66, 119, 31, 5, 225, 76, 119, 31, 5, 153, 146, 119,
- 31, 5, 153, 231, 100, 119, 31, 5, 72, 119, 31, 5, 248, 35, 119, 31, 5,
- 254, 253, 119, 31, 5, 73, 119, 31, 5, 234, 52, 119, 31, 5, 254, 53, 119,
- 5, 224, 216, 119, 237, 219, 76, 119, 254, 254, 237, 219, 76, 119, 1, 226,
- 44, 119, 1, 248, 70, 119, 1, 153, 231, 100, 119, 1, 153, 237, 149, 119,
- 31, 5, 153, 149, 119, 31, 5, 153, 237, 149, 119, 21, 223, 89, 119, 21,
- 118, 119, 21, 113, 119, 21, 166, 119, 21, 158, 119, 21, 173, 119, 21,
- 183, 119, 21, 194, 119, 21, 187, 119, 21, 192, 119, 246, 235, 21, 223,
- 90, 32, 234, 90, 232, 232, 106, 158, 119, 246, 235, 21, 168, 32, 234, 90,
- 232, 232, 106, 158, 119, 246, 235, 21, 135, 32, 234, 90, 232, 232, 106,
- 158, 119, 246, 235, 21, 152, 32, 234, 90, 232, 232, 106, 158, 119, 246,
- 235, 21, 168, 32, 247, 158, 232, 232, 106, 158, 119, 246, 235, 21, 135,
- 32, 247, 158, 232, 232, 106, 158, 119, 246, 235, 21, 152, 32, 247, 158,
- 232, 232, 106, 158, 119, 5, 225, 226, 129, 5, 254, 160, 129, 5, 224, 211,
- 129, 1, 57, 129, 1, 255, 63, 129, 1, 74, 129, 1, 240, 47, 129, 1, 66,
- 129, 1, 225, 76, 129, 1, 153, 146, 129, 1, 153, 149, 129, 1, 72, 129, 1,
- 248, 35, 129, 1, 254, 253, 129, 1, 73, 129, 1, 234, 52, 129, 1, 254, 53,
- 129, 1, 177, 129, 1, 238, 227, 129, 1, 246, 193, 129, 1, 246, 66, 129, 1,
- 235, 137, 129, 1, 252, 39, 129, 1, 251, 204, 129, 1, 239, 179, 129, 1,
- 239, 160, 129, 1, 234, 173, 129, 1, 226, 20, 129, 1, 226, 10, 129, 1,
- 250, 117, 129, 1, 250, 101, 129, 1, 235, 18, 129, 1, 227, 107, 129, 1,
- 226, 251, 129, 1, 250, 189, 129, 1, 250, 22, 129, 1, 236, 1, 129, 1, 213,
- 129, 1, 233, 97, 129, 1, 253, 70, 129, 1, 252, 190, 129, 1, 198, 129, 1,
- 191, 129, 1, 208, 129, 1, 231, 99, 129, 1, 238, 43, 129, 1, 237, 148,
- 129, 1, 225, 64, 129, 1, 229, 146, 129, 1, 228, 110, 129, 1, 231, 31,
- 129, 1, 154, 129, 5, 234, 202, 129, 5, 254, 40, 129, 31, 5, 255, 63, 129,
- 31, 5, 74, 129, 31, 5, 240, 47, 129, 31, 5, 66, 129, 31, 5, 225, 76, 129,
- 31, 5, 153, 146, 129, 31, 5, 153, 231, 100, 129, 31, 5, 72, 129, 31, 5,
- 248, 35, 129, 31, 5, 254, 253, 129, 31, 5, 73, 129, 31, 5, 234, 52, 129,
- 31, 5, 254, 53, 129, 5, 224, 216, 129, 237, 219, 76, 129, 254, 254, 237,
- 219, 76, 129, 1, 247, 129, 129, 1, 153, 231, 100, 129, 1, 153, 237, 149,
- 129, 31, 5, 153, 149, 129, 31, 5, 153, 237, 149, 129, 21, 223, 89, 129,
- 21, 118, 129, 21, 113, 129, 21, 166, 129, 21, 158, 129, 21, 173, 129, 21,
- 183, 129, 21, 194, 129, 21, 187, 129, 21, 192, 129, 5, 239, 150, 129, 5,
- 225, 114, 114, 5, 254, 160, 114, 5, 224, 211, 114, 1, 57, 114, 1, 255,
- 63, 114, 1, 74, 114, 1, 240, 47, 114, 1, 66, 114, 1, 225, 76, 114, 1,
- 153, 146, 114, 1, 153, 149, 114, 1, 72, 114, 1, 248, 35, 114, 1, 254,
- 253, 114, 1, 73, 114, 1, 234, 52, 114, 1, 254, 53, 114, 1, 177, 114, 1,
- 238, 227, 114, 1, 246, 193, 114, 1, 246, 66, 114, 1, 235, 137, 114, 1,
- 252, 39, 114, 1, 251, 204, 114, 1, 239, 179, 114, 1, 239, 160, 114, 1,
- 234, 173, 114, 1, 226, 20, 114, 1, 226, 10, 114, 1, 250, 117, 114, 1,
- 250, 101, 114, 1, 235, 18, 114, 1, 227, 107, 114, 1, 226, 251, 114, 1,
- 250, 189, 114, 1, 250, 22, 114, 1, 236, 1, 114, 1, 213, 114, 1, 233, 97,
- 114, 1, 253, 70, 114, 1, 252, 190, 114, 1, 198, 114, 1, 191, 114, 1, 208,
- 114, 1, 231, 99, 114, 1, 238, 43, 114, 1, 237, 148, 114, 1, 237, 147,
- 114, 1, 225, 64, 114, 1, 229, 146, 114, 1, 228, 110, 114, 1, 231, 31,
- 114, 1, 154, 114, 5, 254, 40, 114, 31, 5, 255, 63, 114, 31, 5, 74, 114,
- 31, 5, 240, 47, 114, 31, 5, 66, 114, 31, 5, 225, 76, 114, 31, 5, 153,
- 146, 114, 31, 5, 153, 231, 100, 114, 31, 5, 72, 114, 31, 5, 248, 35, 114,
- 31, 5, 254, 253, 114, 31, 5, 73, 114, 31, 5, 234, 52, 114, 31, 5, 254,
- 53, 114, 5, 224, 216, 114, 254, 54, 237, 219, 76, 114, 1, 153, 231, 100,
- 114, 1, 153, 237, 149, 114, 31, 5, 153, 149, 114, 31, 5, 153, 237, 149,
- 114, 21, 223, 89, 114, 21, 118, 114, 21, 113, 114, 21, 166, 114, 21, 158,
- 114, 21, 173, 114, 21, 183, 114, 21, 194, 114, 21, 187, 114, 21, 192,
- 114, 65, 227, 23, 114, 65, 168, 244, 135, 114, 65, 168, 226, 194, 114,
- 246, 235, 168, 232, 76, 114, 246, 235, 168, 245, 151, 114, 246, 235, 152,
- 232, 74, 114, 250, 125, 76, 114, 1, 251, 162, 235, 19, 114, 1, 251, 162,
- 199, 114, 1, 251, 162, 231, 100, 114, 1, 251, 162, 149, 114, 1, 251, 162,
- 237, 149, 114, 1, 251, 162, 239, 76, 147, 5, 254, 159, 147, 5, 224, 210,
- 147, 1, 254, 32, 147, 1, 255, 54, 147, 1, 255, 13, 147, 1, 255, 17, 147,
- 1, 239, 187, 147, 1, 240, 46, 147, 1, 225, 69, 147, 1, 225, 71, 147, 1,
- 239, 207, 147, 1, 239, 208, 147, 1, 240, 32, 147, 1, 240, 34, 147, 1,
- 247, 138, 147, 1, 248, 31, 147, 1, 254, 242, 147, 1, 233, 247, 147, 1,
- 234, 47, 147, 1, 254, 43, 147, 1, 254, 208, 239, 8, 147, 1, 237, 54, 239,
- 8, 147, 1, 254, 208, 246, 147, 147, 1, 237, 54, 246, 147, 147, 1, 239,
- 42, 235, 251, 147, 1, 230, 248, 246, 147, 147, 1, 254, 208, 251, 249,
- 147, 1, 237, 54, 251, 249, 147, 1, 254, 208, 239, 171, 147, 1, 237, 54,
- 239, 171, 147, 1, 227, 102, 235, 251, 147, 1, 227, 102, 230, 247, 235,
- 252, 147, 1, 230, 248, 239, 171, 147, 1, 254, 208, 226, 18, 147, 1, 237,
- 54, 226, 18, 147, 1, 254, 208, 250, 108, 147, 1, 237, 54, 250, 108, 147,
- 1, 236, 26, 235, 218, 147, 1, 230, 248, 250, 108, 147, 1, 254, 208, 227,
- 52, 147, 1, 237, 54, 227, 52, 147, 1, 254, 208, 250, 120, 147, 1, 237,
- 54, 250, 120, 147, 1, 250, 148, 235, 218, 147, 1, 230, 248, 250, 120,
- 147, 1, 254, 208, 233, 157, 147, 1, 237, 54, 233, 157, 147, 1, 254, 208,
- 253, 17, 147, 1, 237, 54, 253, 17, 147, 1, 236, 251, 147, 1, 254, 195,
- 253, 17, 147, 1, 223, 232, 147, 1, 231, 249, 147, 1, 250, 148, 237, 251,
- 147, 1, 225, 44, 147, 1, 227, 102, 230, 233, 147, 1, 236, 26, 230, 233,
- 147, 1, 250, 148, 230, 233, 147, 1, 245, 125, 147, 1, 236, 26, 237, 251,
- 147, 1, 247, 99, 147, 5, 254, 232, 147, 31, 5, 255, 16, 147, 31, 5, 238,
- 235, 255, 18, 147, 31, 5, 249, 231, 255, 18, 147, 31, 5, 238, 235, 239,
- 204, 147, 31, 5, 249, 231, 239, 204, 147, 31, 5, 238, 235, 233, 240, 147,
- 31, 5, 249, 231, 233, 240, 147, 31, 5, 246, 182, 147, 31, 5, 238, 144,
- 147, 31, 5, 249, 231, 238, 144, 147, 31, 5, 238, 146, 250, 58, 147, 31,
- 5, 238, 145, 245, 168, 255, 16, 147, 31, 5, 238, 145, 245, 168, 249, 231,
- 255, 16, 147, 31, 5, 238, 145, 245, 168, 246, 146, 147, 31, 5, 246, 146,
- 147, 31, 5, 249, 231, 246, 182, 147, 31, 5, 249, 231, 246, 146, 147, 232,
- 171, 238, 98, 128, 116, 238, 151, 239, 56, 128, 116, 238, 209, 238, 224,
- 128, 116, 238, 209, 238, 203, 128, 116, 238, 209, 238, 202, 128, 116,
- 238, 209, 238, 206, 128, 116, 238, 209, 232, 7, 128, 116, 235, 108, 235,
- 99, 128, 116, 251, 151, 251, 196, 128, 116, 251, 151, 251, 159, 128, 116,
- 251, 151, 251, 195, 128, 116, 228, 170, 228, 169, 128, 116, 251, 151,
- 251, 148, 128, 116, 223, 184, 223, 191, 128, 116, 249, 162, 251, 201,
- 128, 116, 180, 233, 165, 128, 116, 226, 202, 226, 243, 128, 116, 226,
- 202, 235, 234, 128, 116, 226, 202, 233, 72, 128, 116, 235, 7, 235, 155,
- 128, 116, 249, 162, 250, 59, 128, 116, 180, 227, 71, 128, 116, 226, 202,
- 226, 183, 128, 116, 226, 202, 226, 247, 128, 116, 226, 202, 226, 199,
- 128, 116, 235, 7, 234, 206, 128, 116, 252, 139, 253, 54, 128, 116, 233,
- 5, 233, 24, 128, 116, 233, 80, 233, 74, 128, 116, 247, 8, 247, 129, 128,
- 116, 233, 80, 233, 93, 128, 116, 247, 8, 247, 111, 128, 116, 233, 80,
- 231, 0, 128, 116, 236, 104, 198, 128, 116, 223, 184, 224, 1, 128, 116,
- 231, 123, 231, 69, 128, 116, 231, 70, 128, 116, 237, 144, 237, 164, 128,
- 116, 237, 110, 128, 116, 224, 106, 224, 169, 128, 116, 228, 170, 231, 11,
- 128, 116, 228, 170, 231, 50, 128, 116, 228, 170, 228, 5, 128, 116, 244,
- 228, 245, 59, 128, 116, 237, 144, 251, 135, 128, 116, 130, 254, 184, 128,
- 116, 244, 228, 235, 2, 128, 116, 233, 230, 128, 116, 230, 243, 57, 128,
- 116, 237, 49, 245, 147, 128, 116, 230, 243, 255, 63, 128, 116, 230, 243,
- 254, 199, 128, 116, 230, 243, 74, 128, 116, 230, 243, 240, 47, 128, 116,
- 230, 243, 225, 159, 128, 116, 230, 243, 225, 158, 128, 116, 230, 243, 66,
- 128, 116, 230, 243, 225, 76, 128, 116, 233, 82, 128, 250, 222, 14, 253,
- 55, 128, 116, 230, 243, 72, 128, 116, 230, 243, 255, 19, 128, 116, 230,
- 243, 73, 128, 116, 230, 243, 254, 254, 237, 45, 128, 116, 230, 243, 254,
- 254, 237, 46, 128, 116, 238, 23, 128, 116, 237, 42, 128, 116, 237, 43,
- 128, 116, 237, 49, 248, 8, 128, 116, 237, 49, 226, 201, 128, 116, 237,
- 49, 226, 81, 128, 116, 237, 49, 251, 186, 128, 116, 226, 241, 128, 116,
- 235, 66, 128, 116, 223, 251, 128, 116, 247, 4, 128, 21, 223, 89, 128, 21,
- 118, 128, 21, 113, 128, 21, 166, 128, 21, 158, 128, 21, 173, 128, 21,
- 183, 128, 21, 194, 128, 21, 187, 128, 21, 192, 128, 116, 254, 183, 128,
- 116, 238, 207, 179, 1, 238, 150, 179, 1, 238, 209, 227, 226, 179, 1, 238,
- 209, 227, 75, 179, 1, 235, 107, 179, 1, 251, 68, 179, 1, 228, 170, 227,
- 75, 179, 1, 234, 152, 179, 1, 249, 161, 179, 1, 96, 179, 1, 226, 202,
- 227, 226, 179, 1, 226, 202, 227, 75, 179, 1, 235, 6, 179, 1, 252, 138,
- 179, 1, 233, 4, 179, 1, 233, 80, 227, 226, 179, 1, 247, 8, 227, 75, 179,
- 1, 233, 80, 227, 75, 179, 1, 247, 8, 227, 226, 179, 1, 236, 103, 179, 1,
- 223, 183, 179, 1, 237, 144, 237, 164, 179, 1, 237, 144, 237, 123, 179, 1,
- 224, 105, 179, 1, 228, 170, 227, 226, 179, 1, 244, 228, 227, 226, 179, 1,
- 73, 179, 1, 244, 228, 227, 75, 179, 247, 249, 179, 31, 5, 57, 179, 31, 5,
- 237, 49, 239, 46, 179, 31, 5, 255, 63, 179, 31, 5, 254, 199, 179, 31, 5,
- 74, 179, 31, 5, 240, 47, 179, 31, 5, 224, 25, 179, 31, 5, 223, 127, 179,
- 31, 5, 66, 179, 31, 5, 225, 76, 179, 31, 5, 237, 49, 238, 142, 179, 229,
- 181, 5, 237, 143, 179, 229, 181, 5, 234, 152, 179, 31, 5, 72, 179, 31, 5,
- 248, 22, 179, 31, 5, 73, 179, 31, 5, 254, 34, 179, 31, 5, 254, 253, 179,
- 238, 151, 238, 43, 179, 206, 237, 49, 248, 8, 179, 206, 237, 49, 226,
- 201, 179, 206, 237, 49, 226, 175, 179, 206, 237, 49, 251, 255, 179, 252,
- 23, 76, 179, 235, 72, 179, 21, 223, 89, 179, 21, 118, 179, 21, 113, 179,
- 21, 166, 179, 21, 158, 179, 21, 173, 179, 21, 183, 179, 21, 194, 179, 21,
- 187, 179, 21, 192, 179, 244, 228, 235, 6, 179, 244, 228, 236, 103, 54, 4,
- 234, 69, 54, 165, 245, 220, 223, 195, 236, 174, 226, 50, 57, 54, 165,
- 245, 220, 223, 195, 236, 174, 255, 68, 231, 127, 252, 240, 198, 54, 165,
- 245, 220, 223, 195, 236, 174, 255, 68, 245, 220, 226, 35, 198, 54, 165,
- 59, 223, 195, 236, 174, 236, 237, 198, 54, 165, 251, 79, 223, 195, 236,
- 174, 229, 152, 198, 54, 165, 252, 10, 223, 195, 236, 174, 233, 73, 229,
- 140, 198, 54, 165, 223, 195, 236, 174, 226, 35, 229, 140, 198, 54, 165,
- 230, 231, 229, 139, 54, 165, 252, 93, 223, 195, 236, 173, 54, 165, 252,
- 152, 229, 68, 223, 195, 236, 173, 54, 165, 239, 226, 226, 34, 54, 165,
- 250, 53, 226, 35, 252, 92, 54, 165, 229, 139, 54, 165, 234, 156, 229,
- 139, 54, 165, 226, 35, 229, 139, 54, 165, 234, 156, 226, 35, 229, 139,
- 54, 165, 231, 142, 251, 177, 228, 122, 229, 139, 54, 165, 231, 187, 245,
- 244, 229, 139, 54, 165, 252, 10, 255, 72, 231, 73, 236, 236, 182, 252,
- 26, 54, 165, 245, 220, 226, 34, 54, 237, 137, 5, 251, 202, 231, 72, 54,
- 237, 137, 5, 237, 203, 231, 72, 54, 254, 66, 5, 229, 149, 246, 134, 255,
- 73, 231, 72, 54, 254, 66, 5, 255, 70, 213, 54, 254, 66, 5, 230, 214, 226,
- 30, 54, 5, 231, 246, 249, 173, 246, 133, 54, 5, 231, 246, 249, 173, 246,
- 13, 54, 5, 231, 246, 249, 173, 245, 221, 54, 5, 231, 246, 235, 249, 246,
- 133, 54, 5, 231, 246, 235, 249, 246, 13, 54, 5, 231, 246, 249, 173, 231,
- 246, 235, 248, 54, 21, 223, 89, 54, 21, 118, 54, 21, 113, 54, 21, 166,
- 54, 21, 158, 54, 21, 173, 54, 21, 183, 54, 21, 194, 54, 21, 187, 54, 21,
- 192, 54, 21, 132, 118, 54, 21, 132, 113, 54, 21, 132, 166, 54, 21, 132,
- 158, 54, 21, 132, 173, 54, 21, 132, 183, 54, 21, 132, 194, 54, 21, 132,
- 187, 54, 21, 132, 192, 54, 21, 132, 223, 89, 54, 165, 252, 95, 231, 72,
- 54, 165, 235, 131, 252, 46, 234, 164, 223, 29, 54, 165, 252, 10, 255, 72,
- 231, 73, 252, 47, 236, 138, 252, 26, 54, 165, 235, 131, 252, 46, 229,
- 150, 231, 72, 54, 165, 251, 183, 236, 173, 54, 165, 226, 45, 255, 69, 54,
- 165, 245, 209, 231, 73, 245, 174, 54, 165, 245, 209, 231, 73, 245, 180,
- 54, 165, 254, 185, 238, 220, 245, 174, 54, 165, 254, 185, 238, 220, 245,
- 180, 54, 5, 223, 245, 226, 33, 54, 5, 237, 25, 226, 33, 54, 1, 177, 54,
- 1, 238, 227, 54, 1, 246, 193, 54, 1, 246, 66, 54, 1, 235, 137, 54, 1,
- 252, 39, 54, 1, 251, 204, 54, 1, 239, 179, 54, 1, 234, 173, 54, 1, 226,
- 20, 54, 1, 226, 10, 54, 1, 250, 117, 54, 1, 250, 101, 54, 1, 235, 18, 54,
- 1, 227, 107, 54, 1, 226, 251, 54, 1, 250, 189, 54, 1, 250, 22, 54, 1,
- 236, 1, 54, 1, 213, 54, 1, 233, 97, 54, 1, 253, 70, 54, 1, 252, 190, 54,
- 1, 198, 54, 1, 226, 44, 54, 1, 226, 37, 54, 1, 248, 70, 54, 1, 248, 66,
- 54, 1, 224, 173, 54, 1, 223, 85, 54, 1, 223, 117, 54, 1, 255, 75, 54, 1,
- 191, 54, 1, 208, 54, 1, 238, 43, 54, 1, 229, 146, 54, 1, 228, 110, 54, 1,
- 231, 31, 54, 1, 154, 54, 1, 57, 54, 1, 238, 110, 54, 1, 247, 34, 208, 54,
- 1, 238, 167, 54, 1, 231, 99, 54, 31, 5, 255, 63, 54, 31, 5, 74, 54, 31,
- 5, 240, 47, 54, 31, 5, 66, 54, 31, 5, 225, 76, 54, 31, 5, 153, 146, 54,
- 31, 5, 153, 231, 100, 54, 31, 5, 153, 149, 54, 31, 5, 153, 237, 149, 54,
- 31, 5, 72, 54, 31, 5, 248, 35, 54, 31, 5, 73, 54, 31, 5, 234, 52, 54, 5,
- 231, 128, 228, 7, 235, 138, 231, 122, 54, 5, 231, 127, 252, 239, 54, 31,
- 5, 200, 74, 54, 31, 5, 200, 240, 47, 54, 5, 234, 164, 223, 30, 235, 255,
- 250, 189, 54, 5, 228, 178, 237, 245, 54, 165, 245, 153, 54, 165, 233,
- 221, 54, 5, 237, 248, 231, 72, 54, 5, 223, 249, 231, 72, 54, 5, 237, 249,
- 226, 45, 252, 26, 54, 5, 236, 238, 252, 26, 54, 5, 245, 223, 252, 27,
- 231, 185, 54, 5, 245, 223, 236, 230, 231, 185, 54, 228, 0, 1, 177, 54,
- 228, 0, 1, 238, 227, 54, 228, 0, 1, 246, 193, 54, 228, 0, 1, 246, 66, 54,
- 228, 0, 1, 235, 137, 54, 228, 0, 1, 252, 39, 54, 228, 0, 1, 251, 204, 54,
- 228, 0, 1, 239, 179, 54, 228, 0, 1, 234, 173, 54, 228, 0, 1, 226, 20, 54,
- 228, 0, 1, 226, 10, 54, 228, 0, 1, 250, 117, 54, 228, 0, 1, 250, 101, 54,
- 228, 0, 1, 235, 18, 54, 228, 0, 1, 227, 107, 54, 228, 0, 1, 226, 251, 54,
- 228, 0, 1, 250, 189, 54, 228, 0, 1, 250, 22, 54, 228, 0, 1, 236, 1, 54,
- 228, 0, 1, 213, 54, 228, 0, 1, 233, 97, 54, 228, 0, 1, 253, 70, 54, 228,
- 0, 1, 252, 190, 54, 228, 0, 1, 198, 54, 228, 0, 1, 226, 44, 54, 228, 0,
- 1, 226, 37, 54, 228, 0, 1, 248, 70, 54, 228, 0, 1, 248, 66, 54, 228, 0,
- 1, 224, 173, 54, 228, 0, 1, 223, 85, 54, 228, 0, 1, 223, 117, 54, 228, 0,
- 1, 255, 75, 54, 228, 0, 1, 191, 54, 228, 0, 1, 208, 54, 228, 0, 1, 238,
- 43, 54, 228, 0, 1, 229, 146, 54, 228, 0, 1, 228, 110, 54, 228, 0, 1, 231,
- 31, 54, 228, 0, 1, 154, 54, 228, 0, 1, 57, 54, 228, 0, 1, 238, 110, 54,
- 228, 0, 1, 247, 34, 224, 173, 54, 228, 0, 1, 247, 34, 191, 54, 228, 0, 1,
- 247, 34, 208, 54, 238, 108, 231, 71, 238, 227, 54, 238, 108, 231, 71,
- 238, 228, 252, 47, 236, 138, 252, 26, 54, 252, 17, 5, 112, 252, 234, 54,
- 252, 17, 5, 157, 252, 234, 54, 252, 17, 5, 252, 18, 227, 43, 54, 252, 17,
- 5, 230, 230, 255, 74, 54, 14, 248, 116, 252, 90, 54, 14, 231, 245, 231,
- 129, 54, 14, 233, 234, 246, 132, 54, 14, 231, 245, 231, 130, 231, 187,
- 245, 243, 54, 14, 233, 73, 213, 54, 14, 234, 248, 252, 90, 54, 14, 234,
- 248, 252, 91, 234, 156, 255, 71, 54, 14, 234, 248, 252, 91, 245, 222,
- 255, 71, 54, 14, 234, 248, 252, 91, 252, 47, 255, 71, 54, 5, 231, 246,
- 235, 249, 231, 246, 249, 172, 54, 5, 231, 246, 235, 249, 245, 221, 54,
- 165, 252, 94, 229, 68, 246, 47, 236, 174, 231, 186, 54, 165, 236, 105,
- 223, 195, 246, 47, 236, 174, 231, 186, 54, 165, 234, 156, 226, 34, 54,
- 165, 59, 252, 110, 231, 124, 223, 195, 236, 174, 236, 237, 198, 54, 165,
- 251, 79, 252, 110, 231, 124, 223, 195, 236, 174, 229, 152, 198, 69, 1,
- 177, 69, 1, 238, 227, 69, 1, 246, 193, 69, 1, 246, 66, 69, 1, 235, 137,
- 69, 1, 252, 39, 69, 1, 251, 204, 69, 1, 239, 179, 69, 1, 239, 160, 69, 1,
- 234, 173, 69, 1, 235, 8, 69, 1, 226, 20, 69, 1, 226, 10, 69, 1, 250, 117,
- 69, 1, 250, 101, 69, 1, 235, 18, 69, 1, 227, 107, 69, 1, 226, 251, 69, 1,
- 250, 189, 69, 1, 250, 22, 69, 1, 236, 1, 69, 1, 213, 69, 1, 233, 97, 69,
- 1, 253, 70, 69, 1, 252, 190, 69, 1, 198, 69, 1, 191, 69, 1, 208, 69, 1,
- 238, 43, 69, 1, 224, 173, 69, 1, 231, 31, 69, 1, 154, 69, 1, 237, 148,
- 69, 1, 57, 69, 1, 229, 131, 57, 69, 1, 74, 69, 1, 240, 47, 69, 1, 66, 69,
- 1, 225, 76, 69, 1, 72, 69, 1, 236, 95, 72, 69, 1, 73, 69, 1, 254, 53, 69,
- 31, 5, 227, 77, 255, 63, 69, 31, 5, 255, 63, 69, 31, 5, 74, 69, 31, 5,
- 240, 47, 69, 31, 5, 66, 69, 31, 5, 225, 76, 69, 31, 5, 72, 69, 31, 5,
- 254, 253, 69, 31, 5, 236, 95, 240, 47, 69, 31, 5, 236, 95, 73, 69, 31, 5,
- 161, 46, 69, 5, 254, 160, 69, 5, 56, 51, 69, 5, 224, 211, 69, 5, 224,
- 216, 69, 5, 254, 84, 69, 251, 33, 5, 124, 191, 69, 251, 33, 5, 124, 208,
- 69, 251, 33, 5, 124, 224, 173, 69, 251, 33, 5, 124, 154, 69, 1, 245, 233,
- 231, 31, 69, 21, 223, 89, 69, 21, 118, 69, 21, 113, 69, 21, 166, 69, 21,
- 158, 69, 21, 173, 69, 21, 183, 69, 21, 194, 69, 21, 187, 69, 21, 192, 69,
- 5, 237, 155, 230, 205, 69, 5, 230, 205, 69, 14, 237, 140, 69, 14, 251,
- 49, 69, 14, 255, 11, 69, 14, 246, 119, 69, 1, 229, 146, 69, 1, 228, 110,
- 69, 1, 153, 146, 69, 1, 153, 231, 100, 69, 1, 153, 149, 69, 1, 153, 237,
- 149, 69, 31, 5, 153, 146, 69, 31, 5, 153, 231, 100, 69, 31, 5, 153, 149,
- 69, 31, 5, 153, 237, 149, 69, 1, 236, 95, 235, 137, 69, 1, 236, 95, 239,
- 160, 69, 1, 236, 95, 253, 16, 69, 1, 236, 95, 253, 12, 69, 251, 33, 5,
- 236, 95, 124, 236, 1, 69, 251, 33, 5, 236, 95, 124, 198, 69, 251, 33, 5,
- 236, 95, 124, 238, 43, 69, 1, 229, 151, 239, 28, 229, 146, 69, 31, 5,
- 229, 151, 239, 28, 247, 165, 69, 206, 165, 229, 151, 239, 28, 245, 129,
- 69, 206, 165, 229, 151, 239, 28, 239, 4, 233, 79, 69, 1, 224, 129, 232,
- 150, 239, 28, 226, 251, 69, 1, 224, 129, 232, 150, 239, 28, 232, 156, 69,
- 31, 5, 224, 129, 232, 150, 239, 28, 247, 165, 69, 31, 5, 224, 129, 232,
- 150, 239, 28, 225, 159, 69, 5, 224, 129, 232, 150, 239, 28, 226, 117, 69,
- 5, 224, 129, 232, 150, 239, 28, 226, 116, 69, 5, 224, 129, 232, 150, 239,
- 28, 226, 115, 69, 5, 224, 129, 232, 150, 239, 28, 226, 114, 69, 5, 224,
- 129, 232, 150, 239, 28, 226, 113, 69, 1, 248, 44, 232, 150, 239, 28, 235,
- 18, 69, 1, 248, 44, 232, 150, 239, 28, 223, 134, 69, 1, 248, 44, 232,
- 150, 239, 28, 246, 49, 69, 31, 5, 246, 129, 239, 28, 74, 69, 31, 5, 239,
- 9, 234, 88, 69, 31, 5, 239, 9, 66, 69, 31, 5, 239, 9, 248, 35, 69, 1,
- 229, 131, 177, 69, 1, 229, 131, 238, 227, 69, 1, 229, 131, 246, 193, 69,
- 1, 229, 131, 252, 39, 69, 1, 229, 131, 223, 117, 69, 1, 229, 131, 234,
- 173, 69, 1, 229, 131, 250, 189, 69, 1, 229, 131, 236, 1, 69, 1, 229, 131,
- 233, 97, 69, 1, 229, 131, 247, 129, 69, 1, 229, 131, 253, 70, 69, 1, 229,
- 131, 226, 251, 69, 1, 229, 131, 154, 69, 251, 33, 5, 229, 131, 124, 224,
- 173, 69, 31, 5, 229, 131, 255, 63, 69, 31, 5, 229, 131, 72, 69, 31, 5,
- 229, 131, 161, 46, 69, 31, 5, 229, 131, 35, 224, 25, 69, 5, 229, 131,
- 226, 116, 69, 5, 229, 131, 226, 115, 69, 5, 229, 131, 226, 113, 69, 5,
- 229, 131, 226, 112, 69, 5, 229, 131, 251, 2, 226, 116, 69, 5, 229, 131,
- 251, 2, 226, 115, 69, 5, 229, 131, 251, 2, 247, 242, 226, 118, 69, 1,
- 231, 61, 233, 226, 247, 129, 69, 5, 231, 61, 233, 226, 226, 113, 69, 229,
- 131, 21, 223, 89, 69, 229, 131, 21, 118, 69, 229, 131, 21, 113, 69, 229,
- 131, 21, 166, 69, 229, 131, 21, 158, 69, 229, 131, 21, 173, 69, 229, 131,
- 21, 183, 69, 229, 131, 21, 194, 69, 229, 131, 21, 187, 69, 229, 131, 21,
- 192, 69, 14, 229, 131, 118, 69, 14, 229, 131, 247, 148, 87, 6, 1, 254,
- 190, 87, 6, 1, 253, 44, 87, 6, 1, 246, 168, 87, 6, 1, 249, 148, 87, 6, 1,
- 247, 239, 87, 6, 1, 224, 219, 87, 6, 1, 223, 92, 87, 6, 1, 227, 73, 87,
- 6, 1, 240, 16, 87, 6, 1, 239, 46, 87, 6, 1, 238, 6, 87, 6, 1, 237, 35,
- 87, 6, 1, 235, 230, 87, 6, 1, 234, 61, 87, 6, 1, 233, 194, 87, 6, 1, 223,
- 81, 87, 6, 1, 232, 15, 87, 6, 1, 230, 253, 87, 6, 1, 227, 67, 87, 6, 1,
- 225, 138, 87, 6, 1, 233, 92, 87, 6, 1, 238, 218, 87, 6, 1, 246, 60, 87,
- 6, 1, 232, 123, 87, 6, 1, 229, 78, 87, 6, 1, 251, 161, 87, 6, 1, 252, 26,
- 87, 6, 1, 239, 149, 87, 6, 1, 251, 109, 87, 6, 1, 251, 192, 87, 6, 1,
- 224, 70, 87, 6, 1, 239, 159, 87, 6, 1, 245, 165, 87, 6, 1, 245, 121, 87,
- 6, 1, 245, 71, 87, 6, 1, 224, 141, 87, 6, 1, 245, 141, 87, 6, 1, 244,
- 225, 87, 1, 254, 190, 87, 1, 253, 44, 87, 1, 246, 168, 87, 1, 249, 148,
- 87, 1, 247, 239, 87, 1, 224, 219, 87, 1, 223, 92, 87, 1, 227, 73, 87, 1,
- 240, 16, 87, 1, 239, 46, 87, 1, 238, 6, 87, 1, 237, 35, 87, 1, 235, 230,
- 87, 1, 234, 61, 87, 1, 233, 194, 87, 1, 223, 81, 87, 1, 232, 15, 87, 1,
- 230, 253, 87, 1, 227, 67, 87, 1, 225, 138, 87, 1, 233, 92, 87, 1, 238,
- 218, 87, 1, 246, 60, 87, 1, 232, 123, 87, 1, 229, 78, 87, 1, 251, 161,
- 87, 1, 252, 26, 87, 1, 239, 149, 87, 1, 251, 109, 87, 1, 251, 192, 87, 1,
- 224, 70, 87, 1, 239, 159, 87, 1, 245, 165, 87, 1, 245, 121, 87, 1, 245,
- 71, 87, 1, 224, 141, 87, 1, 245, 141, 87, 1, 244, 225, 87, 1, 247, 70,
- 87, 1, 223, 185, 87, 1, 247, 251, 87, 1, 209, 246, 168, 87, 1, 254, 248,
- 87, 233, 192, 229, 173, 52, 1, 87, 235, 230, 26, 122, 238, 173, 26, 122,
- 228, 104, 26, 122, 235, 82, 26, 122, 226, 163, 26, 122, 228, 99, 26, 122,
- 231, 174, 26, 122, 236, 148, 26, 122, 233, 60, 26, 122, 228, 102, 26,
- 122, 228, 236, 26, 122, 228, 100, 26, 122, 240, 68, 26, 122, 251, 113,
- 26, 122, 228, 107, 26, 122, 251, 167, 26, 122, 238, 210, 26, 122, 226,
- 218, 26, 122, 233, 85, 26, 122, 245, 69, 26, 122, 235, 79, 26, 122, 228,
- 103, 26, 122, 235, 74, 26, 122, 235, 77, 26, 122, 226, 162, 26, 122, 231,
- 165, 26, 122, 228, 101, 26, 122, 231, 173, 26, 122, 239, 31, 26, 122,
- 236, 143, 26, 122, 239, 34, 26, 122, 233, 56, 26, 122, 233, 55, 26, 122,
- 233, 45, 26, 122, 233, 52, 26, 122, 233, 50, 26, 122, 233, 48, 26, 122,
- 233, 49, 26, 122, 233, 47, 26, 122, 233, 51, 26, 122, 233, 58, 26, 122,
- 233, 59, 26, 122, 233, 46, 26, 122, 233, 54, 26, 122, 239, 32, 26, 122,
- 239, 30, 26, 122, 228, 230, 26, 122, 228, 228, 26, 122, 228, 221, 26,
- 122, 228, 224, 26, 122, 228, 229, 26, 122, 228, 226, 26, 122, 228, 225,
- 26, 122, 228, 223, 26, 122, 228, 232, 26, 122, 228, 234, 26, 122, 228,
- 235, 26, 122, 228, 231, 26, 122, 228, 222, 26, 122, 228, 227, 26, 122,
- 228, 233, 26, 122, 251, 154, 26, 122, 251, 152, 26, 122, 251, 212, 26,
- 122, 251, 210, 26, 122, 233, 204, 26, 122, 240, 64, 26, 122, 240, 56, 26,
- 122, 240, 63, 26, 122, 240, 60, 26, 122, 240, 59, 26, 122, 240, 62, 26,
- 122, 228, 105, 26, 122, 240, 66, 26, 122, 240, 67, 26, 122, 240, 57, 26,
- 122, 240, 61, 26, 122, 223, 212, 26, 122, 251, 112, 26, 122, 251, 155,
- 26, 122, 251, 153, 26, 122, 251, 213, 26, 122, 251, 211, 26, 122, 251,
- 165, 26, 122, 251, 166, 26, 122, 251, 156, 26, 122, 251, 214, 26, 122,
- 233, 84, 26, 122, 239, 33, 26, 122, 228, 106, 26, 122, 223, 218, 26, 122,
- 247, 52, 26, 170, 247, 52, 26, 170, 57, 26, 170, 255, 19, 26, 170, 191,
- 26, 170, 224, 10, 26, 170, 247, 217, 26, 170, 72, 26, 170, 223, 221, 26,
- 170, 223, 228, 26, 170, 73, 26, 170, 224, 173, 26, 170, 224, 170, 26,
- 170, 234, 88, 26, 170, 223, 183, 26, 170, 66, 26, 170, 224, 133, 26, 170,
- 224, 141, 26, 170, 224, 118, 26, 170, 223, 158, 26, 170, 247, 165, 26,
- 170, 223, 202, 26, 170, 74, 26, 170, 255, 67, 26, 170, 255, 66, 26, 170,
- 224, 23, 26, 170, 224, 22, 26, 170, 247, 215, 26, 170, 247, 214, 26, 170,
- 247, 216, 26, 170, 223, 220, 26, 170, 223, 219, 26, 170, 234, 109, 26,
- 170, 234, 110, 26, 170, 234, 106, 26, 170, 234, 108, 26, 170, 234, 107,
- 26, 170, 223, 180, 26, 170, 223, 179, 26, 170, 223, 178, 26, 170, 223,
- 181, 26, 170, 223, 182, 26, 170, 225, 177, 26, 170, 225, 176, 26, 170,
- 225, 175, 26, 170, 225, 173, 26, 170, 225, 174, 26, 170, 223, 157, 26,
- 170, 223, 155, 26, 170, 223, 156, 26, 170, 223, 151, 26, 170, 223, 152,
- 26, 170, 223, 153, 26, 170, 223, 154, 26, 170, 247, 163, 26, 170, 247,
- 164, 26, 170, 223, 201, 26, 170, 244, 80, 26, 170, 244, 74, 26, 170, 244,
- 76, 26, 170, 244, 75, 26, 170, 244, 77, 26, 170, 244, 79, 26, 170, 254,
- 128, 26, 170, 254, 127, 26, 170, 254, 125, 26, 170, 254, 126, 26, 170,
- 228, 108, 26, 138, 238, 173, 26, 138, 228, 104, 26, 138, 238, 171, 26,
- 138, 235, 82, 26, 138, 235, 81, 26, 138, 235, 80, 26, 138, 226, 163, 26,
- 138, 231, 174, 26, 138, 231, 170, 26, 138, 231, 168, 26, 138, 231, 162,
- 26, 138, 231, 159, 26, 138, 231, 157, 26, 138, 231, 163, 26, 138, 231,
- 173, 26, 138, 236, 148, 26, 138, 233, 60, 26, 138, 233, 52, 26, 138, 228,
- 236, 26, 138, 228, 100, 26, 138, 240, 68, 26, 138, 251, 113, 26, 138,
- 251, 167, 26, 138, 238, 210, 26, 138, 226, 218, 26, 138, 233, 85, 26,
- 138, 245, 69, 26, 138, 238, 172, 26, 138, 238, 170, 26, 138, 235, 79, 26,
- 138, 235, 74, 26, 138, 235, 76, 26, 138, 235, 78, 26, 138, 235, 75, 26,
- 138, 226, 162, 26, 138, 226, 161, 26, 138, 231, 169, 26, 138, 231, 165,
- 26, 138, 231, 156, 26, 138, 231, 155, 26, 138, 228, 101, 26, 138, 231,
- 167, 26, 138, 231, 166, 26, 138, 231, 160, 26, 138, 231, 161, 26, 138,
- 231, 172, 26, 138, 231, 158, 26, 138, 231, 164, 26, 138, 231, 171, 26,
- 138, 231, 154, 26, 138, 236, 145, 26, 138, 236, 142, 26, 138, 236, 143,
- 26, 138, 236, 141, 26, 138, 236, 140, 26, 138, 236, 144, 26, 138, 236,
- 147, 26, 138, 236, 146, 26, 138, 239, 34, 26, 138, 233, 53, 26, 138, 233,
- 54, 26, 138, 233, 57, 26, 138, 239, 32, 26, 138, 228, 230, 26, 138, 228,
- 221, 26, 138, 228, 224, 26, 138, 228, 226, 26, 138, 233, 204, 26, 138,
- 240, 64, 26, 138, 240, 58, 26, 138, 228, 105, 26, 138, 240, 65, 26, 138,
- 223, 212, 26, 138, 223, 210, 26, 138, 223, 211, 26, 138, 233, 84, 26,
- 138, 239, 33, 26, 138, 245, 67, 26, 138, 245, 65, 26, 138, 245, 68, 26,
- 138, 245, 66, 26, 138, 223, 218, 25, 4, 154, 25, 4, 244, 145, 25, 4, 245,
- 75, 25, 4, 245, 167, 25, 4, 245, 109, 25, 4, 245, 121, 25, 4, 244, 227,
- 25, 4, 244, 226, 25, 4, 238, 43, 25, 4, 237, 110, 25, 4, 237, 193, 25, 4,
- 238, 42, 25, 4, 237, 239, 25, 4, 237, 243, 25, 4, 237, 143, 25, 4, 237,
- 88, 25, 4, 245, 84, 25, 4, 245, 78, 25, 4, 245, 80, 25, 4, 245, 83, 25,
- 4, 245, 81, 25, 4, 245, 82, 25, 4, 245, 79, 25, 4, 245, 77, 25, 4, 198,
- 25, 4, 236, 66, 25, 4, 236, 157, 25, 4, 237, 66, 25, 4, 236, 226, 25, 4,
- 236, 235, 25, 4, 236, 103, 25, 4, 236, 19, 25, 4, 227, 120, 25, 4, 227,
- 114, 25, 4, 227, 116, 25, 4, 227, 119, 25, 4, 227, 117, 25, 4, 227, 118,
- 25, 4, 227, 115, 25, 4, 227, 113, 25, 4, 208, 25, 4, 231, 70, 25, 4, 231,
- 180, 25, 4, 232, 22, 25, 4, 231, 229, 25, 4, 231, 244, 25, 4, 231, 122,
- 25, 4, 231, 46, 25, 4, 231, 31, 25, 4, 228, 6, 25, 4, 229, 15, 25, 4,
- 231, 29, 25, 4, 230, 203, 25, 4, 230, 213, 25, 4, 228, 169, 25, 4, 227,
- 200, 25, 4, 229, 146, 25, 4, 229, 43, 25, 4, 229, 90, 25, 4, 229, 142,
- 25, 4, 229, 112, 25, 4, 229, 114, 25, 4, 229, 71, 25, 4, 229, 30, 25, 4,
- 232, 138, 25, 4, 232, 84, 25, 4, 232, 104, 25, 4, 232, 137, 25, 4, 232,
- 118, 25, 4, 232, 119, 25, 4, 232, 95, 25, 4, 232, 94, 25, 4, 232, 45, 25,
- 4, 232, 41, 25, 4, 232, 44, 25, 4, 232, 42, 25, 4, 232, 43, 25, 4, 232,
- 116, 25, 4, 232, 110, 25, 4, 232, 112, 25, 4, 232, 115, 25, 4, 232, 113,
- 25, 4, 232, 114, 25, 4, 232, 111, 25, 4, 232, 109, 25, 4, 232, 105, 25,
- 4, 232, 108, 25, 4, 232, 106, 25, 4, 232, 107, 25, 4, 253, 70, 25, 4,
- 252, 90, 25, 4, 252, 181, 25, 4, 253, 69, 25, 4, 252, 232, 25, 4, 252,
- 238, 25, 4, 252, 138, 25, 4, 252, 60, 25, 4, 225, 64, 25, 4, 224, 190,
- 25, 4, 224, 228, 25, 4, 225, 63, 25, 4, 225, 38, 25, 4, 225, 42, 25, 4,
- 224, 206, 25, 4, 224, 183, 25, 4, 227, 107, 25, 4, 225, 250, 25, 4, 226,
- 175, 25, 4, 227, 104, 25, 4, 227, 37, 25, 4, 227, 44, 25, 4, 96, 25, 4,
- 225, 222, 25, 4, 252, 39, 25, 4, 250, 235, 25, 4, 251, 118, 25, 4, 252,
- 38, 25, 4, 251, 225, 25, 4, 251, 231, 25, 4, 251, 68, 25, 4, 250, 210,
- 25, 4, 224, 72, 25, 4, 224, 48, 25, 4, 224, 64, 25, 4, 224, 71, 25, 4,
- 224, 68, 25, 4, 224, 69, 25, 4, 224, 55, 25, 4, 224, 54, 25, 4, 224, 44,
- 25, 4, 224, 40, 25, 4, 224, 43, 25, 4, 224, 41, 25, 4, 224, 42, 25, 4,
- 236, 1, 25, 4, 234, 206, 25, 4, 235, 89, 25, 4, 235, 254, 25, 4, 235,
- 160, 25, 4, 235, 162, 25, 4, 235, 6, 25, 4, 234, 177, 25, 4, 234, 173,
- 25, 4, 234, 146, 25, 4, 234, 163, 25, 4, 234, 172, 25, 4, 234, 168, 25,
- 4, 234, 169, 25, 4, 234, 152, 25, 4, 234, 139, 25, 4, 246, 16, 57, 25, 4,
- 246, 16, 66, 25, 4, 246, 16, 74, 25, 4, 246, 16, 255, 63, 25, 4, 246, 16,
- 248, 35, 25, 4, 246, 16, 72, 25, 4, 246, 16, 73, 25, 4, 246, 16, 224,
- 173, 25, 4, 177, 25, 4, 238, 107, 25, 4, 238, 199, 25, 4, 239, 72, 25, 4,
- 239, 2, 25, 4, 239, 3, 25, 4, 238, 150, 25, 4, 238, 149, 25, 4, 238, 78,
- 25, 4, 238, 74, 25, 4, 238, 77, 25, 4, 238, 75, 25, 4, 238, 76, 25, 4,
- 238, 69, 25, 4, 238, 63, 25, 4, 238, 65, 25, 4, 238, 68, 25, 4, 238, 66,
- 25, 4, 238, 67, 25, 4, 238, 64, 25, 4, 238, 62, 25, 4, 238, 58, 25, 4,
- 238, 61, 25, 4, 238, 59, 25, 4, 238, 60, 25, 4, 224, 173, 25, 4, 224, 83,
- 25, 4, 224, 118, 25, 4, 224, 172, 25, 4, 224, 138, 25, 4, 224, 141, 25,
- 4, 224, 105, 25, 4, 224, 104, 25, 4, 233, 91, 57, 25, 4, 233, 91, 66, 25,
- 4, 233, 91, 74, 25, 4, 233, 91, 255, 63, 25, 4, 233, 91, 248, 35, 25, 4,
- 233, 91, 72, 25, 4, 233, 91, 73, 25, 4, 223, 117, 25, 4, 223, 19, 25, 4,
- 223, 47, 25, 4, 223, 116, 25, 4, 223, 95, 25, 4, 223, 97, 25, 4, 223, 27,
- 25, 4, 223, 6, 25, 4, 223, 85, 25, 4, 223, 65, 25, 4, 223, 72, 25, 4,
- 223, 84, 25, 4, 223, 76, 25, 4, 223, 77, 25, 4, 223, 70, 25, 4, 223, 56,
- 25, 4, 191, 25, 4, 223, 158, 25, 4, 223, 202, 25, 4, 224, 21, 25, 4, 223,
- 225, 25, 4, 223, 228, 25, 4, 223, 183, 25, 4, 223, 177, 25, 4, 250, 189,
- 25, 4, 248, 107, 25, 4, 250, 4, 25, 4, 250, 188, 25, 4, 250, 67, 25, 4,
- 250, 77, 25, 4, 249, 161, 25, 4, 248, 79, 25, 4, 250, 117, 25, 4, 250,
- 87, 25, 4, 250, 99, 25, 4, 250, 116, 25, 4, 250, 104, 25, 4, 250, 105,
- 25, 4, 250, 92, 25, 4, 250, 78, 25, 4, 239, 179, 25, 4, 239, 101, 25, 4,
- 239, 156, 25, 4, 239, 178, 25, 4, 239, 169, 25, 4, 239, 170, 25, 4, 239,
- 117, 25, 4, 239, 84, 25, 4, 246, 193, 25, 4, 245, 218, 25, 4, 246, 46,
- 25, 4, 246, 190, 25, 4, 246, 125, 25, 4, 246, 131, 25, 4, 246, 11, 25, 4,
- 246, 10, 25, 4, 245, 188, 25, 4, 245, 184, 25, 4, 245, 187, 25, 4, 245,
- 185, 25, 4, 245, 186, 25, 4, 246, 101, 25, 4, 246, 81, 25, 4, 246, 91,
- 25, 4, 246, 100, 25, 4, 246, 95, 25, 4, 246, 96, 25, 4, 246, 85, 25, 4,
- 246, 70, 25, 4, 226, 251, 25, 4, 226, 186, 25, 4, 226, 220, 25, 4, 226,
- 250, 25, 4, 226, 238, 25, 4, 226, 239, 25, 4, 226, 201, 25, 4, 226, 180,
- 25, 4, 251, 204, 25, 4, 251, 136, 25, 4, 251, 169, 25, 4, 251, 203, 25,
- 4, 251, 179, 25, 4, 251, 182, 25, 4, 251, 150, 25, 4, 251, 125, 25, 4,
- 233, 97, 25, 4, 233, 75, 25, 4, 233, 87, 25, 4, 233, 96, 25, 4, 233, 89,
- 25, 4, 233, 90, 25, 4, 233, 79, 25, 4, 233, 71, 25, 4, 226, 44, 25, 4,
- 226, 26, 25, 4, 226, 29, 25, 4, 226, 43, 25, 4, 226, 39, 25, 4, 226, 40,
- 25, 4, 226, 28, 25, 4, 226, 24, 25, 4, 225, 186, 25, 4, 225, 178, 25, 4,
- 225, 182, 25, 4, 225, 185, 25, 4, 225, 183, 25, 4, 225, 184, 25, 4, 225,
- 180, 25, 4, 225, 179, 25, 4, 247, 129, 25, 4, 246, 219, 25, 4, 247, 70,
- 25, 4, 247, 128, 25, 4, 247, 92, 25, 4, 247, 97, 25, 4, 247, 7, 25, 4,
- 246, 206, 25, 4, 213, 25, 4, 232, 173, 25, 4, 233, 69, 25, 4, 233, 241,
- 25, 4, 233, 144, 25, 4, 233, 151, 25, 4, 233, 4, 25, 4, 232, 156, 25, 4,
- 231, 42, 25, 4, 236, 10, 25, 4, 246, 200, 25, 36, 246, 124, 76, 25, 230,
- 206, 76, 25, 224, 91, 25, 246, 218, 228, 38, 25, 251, 54, 25, 229, 186,
- 25, 251, 61, 25, 232, 211, 251, 61, 25, 232, 69, 76, 25, 233, 192, 229,
- 173, 25, 21, 118, 25, 21, 113, 25, 21, 166, 25, 21, 158, 25, 21, 173, 25,
- 21, 183, 25, 21, 194, 25, 21, 187, 25, 21, 192, 25, 65, 227, 23, 25, 65,
- 225, 216, 25, 65, 226, 207, 25, 65, 246, 245, 25, 65, 247, 63, 25, 65,
- 228, 206, 25, 65, 229, 159, 25, 65, 248, 12, 25, 65, 235, 57, 25, 65,
- 244, 135, 25, 65, 227, 24, 226, 194, 25, 4, 230, 210, 236, 19, 25, 4,
- 236, 15, 25, 4, 236, 16, 25, 4, 236, 17, 25, 4, 230, 210, 252, 60, 25, 4,
- 252, 57, 25, 4, 252, 58, 25, 4, 252, 59, 25, 4, 230, 210, 246, 206, 25,
- 4, 246, 202, 25, 4, 246, 203, 25, 4, 246, 204, 25, 4, 230, 210, 232, 156,
- 25, 4, 232, 152, 25, 4, 232, 153, 25, 4, 232, 154, 25, 226, 119, 165,
- 223, 186, 25, 226, 119, 165, 250, 36, 25, 226, 119, 165, 231, 143, 25,
- 226, 119, 165, 229, 63, 231, 143, 25, 226, 119, 165, 249, 238, 25, 226,
- 119, 165, 238, 242, 25, 226, 119, 165, 251, 158, 25, 226, 119, 165, 245,
- 73, 25, 226, 119, 165, 250, 35, 25, 226, 119, 165, 238, 89, 131, 1, 57,
- 131, 1, 72, 131, 1, 74, 131, 1, 73, 131, 1, 66, 131, 1, 196, 131, 1, 246,
- 193, 131, 1, 177, 131, 1, 246, 131, 131, 1, 246, 46, 131, 1, 246, 11,
- 131, 1, 245, 218, 131, 1, 245, 189, 131, 1, 154, 131, 1, 245, 121, 131,
- 1, 245, 75, 131, 1, 244, 227, 131, 1, 244, 145, 131, 1, 244, 128, 131, 1,
- 238, 43, 131, 1, 237, 243, 131, 1, 237, 193, 131, 1, 237, 143, 131, 1,
- 237, 110, 131, 1, 237, 89, 131, 1, 198, 131, 1, 236, 235, 131, 1, 236,
- 157, 131, 1, 236, 103, 131, 1, 236, 66, 131, 1, 236, 1, 131, 1, 244, 249,
- 131, 1, 235, 243, 131, 1, 235, 162, 131, 1, 235, 89, 131, 1, 235, 6, 131,
- 1, 234, 206, 131, 1, 234, 179, 131, 1, 232, 83, 131, 1, 232, 71, 131, 1,
- 232, 66, 131, 1, 232, 60, 131, 1, 232, 49, 131, 1, 232, 47, 131, 1, 231,
- 31, 131, 1, 193, 131, 1, 230, 213, 131, 1, 229, 15, 131, 1, 228, 169,
- 131, 1, 228, 6, 131, 1, 227, 202, 131, 1, 250, 189, 131, 1, 227, 107,
- 131, 1, 250, 77, 131, 1, 227, 44, 131, 1, 250, 4, 131, 1, 226, 175, 131,
- 1, 249, 161, 131, 1, 248, 107, 131, 1, 248, 81, 131, 1, 249, 170, 131, 1,
- 226, 138, 131, 1, 226, 137, 131, 1, 226, 129, 131, 1, 226, 128, 131, 1,
- 226, 127, 131, 1, 226, 126, 131, 1, 226, 44, 131, 1, 226, 40, 131, 1,
- 226, 29, 131, 1, 226, 28, 131, 1, 226, 26, 131, 1, 226, 25, 131, 1, 224,
- 173, 131, 1, 224, 141, 131, 1, 224, 118, 131, 1, 224, 105, 131, 1, 224,
- 83, 131, 1, 224, 77, 131, 1, 191, 131, 1, 223, 228, 131, 1, 223, 202,
- 131, 1, 223, 183, 131, 1, 223, 158, 131, 1, 223, 135, 16, 17, 72, 16, 17,
- 255, 61, 16, 17, 74, 16, 17, 240, 47, 16, 17, 73, 16, 17, 234, 52, 16,
- 17, 224, 24, 234, 52, 16, 17, 60, 248, 35, 16, 17, 60, 74, 16, 17, 57,
- 16, 17, 255, 63, 16, 17, 224, 141, 16, 17, 127, 224, 141, 16, 17, 224,
- 118, 16, 17, 127, 224, 118, 16, 17, 224, 113, 16, 17, 127, 224, 113, 16,
- 17, 224, 105, 16, 17, 127, 224, 105, 16, 17, 224, 98, 16, 17, 127, 224,
- 98, 16, 17, 235, 226, 224, 98, 16, 17, 224, 173, 16, 17, 127, 224, 173,
- 16, 17, 224, 172, 16, 17, 127, 224, 172, 16, 17, 235, 226, 224, 172, 16,
- 17, 254, 253, 16, 17, 224, 24, 224, 174, 16, 17, 246, 16, 228, 38, 16,
- 17, 35, 155, 16, 17, 35, 245, 236, 16, 17, 35, 252, 126, 132, 231, 139,
- 16, 17, 35, 226, 106, 132, 231, 139, 16, 17, 35, 41, 132, 231, 139, 16,
- 17, 35, 231, 139, 16, 17, 35, 47, 155, 16, 17, 35, 47, 229, 63, 61, 228,
- 10, 16, 17, 35, 236, 154, 249, 140, 16, 17, 35, 229, 63, 169, 82, 16, 17,
- 35, 233, 10, 16, 17, 35, 103, 227, 96, 16, 17, 247, 239, 16, 17, 240, 16,
- 16, 17, 234, 61, 16, 17, 254, 190, 16, 17, 233, 151, 16, 17, 233, 239,
- 16, 17, 233, 69, 16, 17, 233, 41, 16, 17, 233, 4, 16, 17, 232, 244, 16,
- 17, 224, 24, 232, 244, 16, 17, 60, 245, 109, 16, 17, 60, 245, 75, 16, 17,
- 213, 16, 17, 233, 241, 16, 17, 232, 154, 16, 17, 127, 232, 154, 16, 17,
- 232, 152, 16, 17, 127, 232, 152, 16, 17, 232, 151, 16, 17, 127, 232, 151,
- 16, 17, 232, 149, 16, 17, 127, 232, 149, 16, 17, 232, 148, 16, 17, 127,
- 232, 148, 16, 17, 232, 156, 16, 17, 127, 232, 156, 16, 17, 232, 155, 16,
- 17, 127, 232, 155, 16, 17, 224, 24, 232, 155, 16, 17, 233, 244, 16, 17,
- 127, 233, 244, 16, 17, 60, 212, 16, 17, 227, 44, 16, 17, 227, 103, 16,
- 17, 226, 175, 16, 17, 226, 165, 16, 17, 96, 16, 17, 226, 108, 16, 17,
- 224, 24, 226, 108, 16, 17, 60, 250, 67, 16, 17, 60, 250, 4, 16, 17, 227,
- 107, 16, 17, 227, 104, 16, 17, 225, 220, 16, 17, 127, 225, 220, 16, 17,
- 225, 205, 16, 17, 127, 225, 205, 16, 17, 225, 204, 16, 17, 127, 225, 204,
- 16, 17, 113, 16, 17, 127, 113, 16, 17, 225, 201, 16, 17, 127, 225, 201,
- 16, 17, 225, 222, 16, 17, 127, 225, 222, 16, 17, 225, 221, 16, 17, 127,
- 225, 221, 16, 17, 235, 226, 225, 221, 16, 17, 227, 109, 16, 17, 226, 17,
- 16, 17, 226, 6, 16, 17, 226, 5, 16, 17, 226, 20, 16, 17, 239, 3, 16, 17,
- 239, 69, 16, 17, 238, 199, 16, 17, 238, 191, 16, 17, 238, 150, 16, 17,
- 238, 139, 16, 17, 224, 24, 238, 139, 16, 17, 177, 16, 17, 239, 72, 16,
- 17, 238, 76, 16, 17, 127, 238, 76, 16, 17, 238, 74, 16, 17, 127, 238, 74,
- 16, 17, 238, 73, 16, 17, 127, 238, 73, 16, 17, 238, 72, 16, 17, 127, 238,
- 72, 16, 17, 238, 71, 16, 17, 127, 238, 71, 16, 17, 238, 78, 16, 17, 127,
- 238, 78, 16, 17, 238, 77, 16, 17, 127, 238, 77, 16, 17, 235, 226, 238,
- 77, 16, 17, 239, 76, 16, 17, 238, 79, 16, 17, 228, 151, 238, 253, 16, 17,
- 228, 151, 238, 192, 16, 17, 228, 151, 238, 147, 16, 17, 228, 151, 239,
- 58, 16, 17, 251, 231, 16, 17, 252, 37, 16, 17, 251, 118, 16, 17, 251,
- 110, 16, 17, 251, 68, 16, 17, 251, 17, 16, 17, 224, 24, 251, 17, 16, 17,
- 252, 39, 16, 17, 252, 38, 16, 17, 250, 208, 16, 17, 127, 250, 208, 16,
- 17, 250, 206, 16, 17, 127, 250, 206, 16, 17, 250, 205, 16, 17, 127, 250,
- 205, 16, 17, 250, 204, 16, 17, 127, 250, 204, 16, 17, 250, 203, 16, 17,
- 127, 250, 203, 16, 17, 250, 210, 16, 17, 127, 250, 210, 16, 17, 250, 209,
- 16, 17, 127, 250, 209, 16, 17, 235, 226, 250, 209, 16, 17, 252, 44, 16,
- 17, 230, 232, 226, 253, 16, 17, 236, 235, 16, 17, 237, 65, 16, 17, 236,
- 157, 16, 17, 236, 137, 16, 17, 236, 103, 16, 17, 236, 86, 16, 17, 224,
- 24, 236, 86, 16, 17, 198, 16, 17, 237, 66, 16, 17, 236, 17, 16, 17, 127,
- 236, 17, 16, 17, 236, 15, 16, 17, 127, 236, 15, 16, 17, 236, 14, 16, 17,
- 127, 236, 14, 16, 17, 236, 13, 16, 17, 127, 236, 13, 16, 17, 236, 12, 16,
- 17, 127, 236, 12, 16, 17, 236, 19, 16, 17, 127, 236, 19, 16, 17, 236, 18,
- 16, 17, 127, 236, 18, 16, 17, 235, 226, 236, 18, 16, 17, 185, 16, 17,
- 127, 185, 16, 17, 236, 160, 16, 17, 254, 61, 185, 16, 17, 230, 232, 185,
- 16, 17, 235, 162, 16, 17, 235, 253, 16, 17, 235, 89, 16, 17, 235, 68, 16,
- 17, 235, 6, 16, 17, 234, 253, 16, 17, 224, 24, 234, 253, 16, 17, 236, 1,
- 16, 17, 235, 254, 16, 17, 234, 175, 16, 17, 127, 234, 175, 16, 17, 234,
- 177, 16, 17, 127, 234, 177, 16, 17, 234, 176, 16, 17, 127, 234, 176, 16,
- 17, 235, 226, 234, 176, 16, 17, 199, 16, 17, 60, 235, 139, 16, 17, 235,
- 94, 16, 17, 237, 243, 16, 17, 238, 41, 16, 17, 237, 193, 16, 17, 237,
- 182, 16, 17, 237, 143, 16, 17, 237, 125, 16, 17, 224, 24, 237, 125, 16,
- 17, 238, 43, 16, 17, 238, 42, 16, 17, 237, 86, 16, 17, 127, 237, 86, 16,
- 17, 237, 85, 16, 17, 127, 237, 85, 16, 17, 237, 84, 16, 17, 127, 237, 84,
- 16, 17, 237, 83, 16, 17, 127, 237, 83, 16, 17, 237, 82, 16, 17, 127, 237,
- 82, 16, 17, 237, 88, 16, 17, 127, 237, 88, 16, 17, 237, 87, 16, 17, 127,
- 237, 87, 16, 17, 149, 16, 17, 127, 149, 16, 17, 124, 149, 16, 17, 230,
- 213, 16, 17, 231, 27, 16, 17, 229, 15, 16, 17, 229, 0, 16, 17, 228, 169,
- 16, 17, 228, 159, 16, 17, 224, 24, 228, 159, 16, 17, 231, 31, 16, 17,
- 231, 29, 16, 17, 227, 196, 16, 17, 127, 227, 196, 16, 17, 227, 193, 16,
- 17, 127, 227, 193, 16, 17, 227, 192, 16, 17, 127, 227, 192, 16, 17, 227,
- 191, 16, 17, 127, 227, 191, 16, 17, 227, 190, 16, 17, 127, 227, 190, 16,
- 17, 227, 200, 16, 17, 127, 227, 200, 16, 17, 227, 199, 16, 17, 127, 227,
- 199, 16, 17, 235, 226, 227, 199, 16, 17, 193, 16, 17, 254, 61, 193, 16,
- 17, 227, 201, 16, 17, 252, 147, 193, 16, 17, 236, 83, 228, 203, 16, 17,
- 235, 226, 228, 198, 16, 17, 235, 226, 231, 33, 16, 17, 235, 226, 228,
- 121, 16, 17, 235, 226, 228, 8, 16, 17, 235, 226, 228, 197, 16, 17, 235,
- 226, 230, 215, 16, 17, 229, 114, 16, 17, 229, 90, 16, 17, 229, 85, 16,
- 17, 229, 71, 16, 17, 229, 66, 16, 17, 229, 146, 16, 17, 229, 142, 16, 17,
- 229, 28, 16, 17, 127, 229, 28, 16, 17, 229, 27, 16, 17, 127, 229, 27, 16,
- 17, 229, 26, 16, 17, 127, 229, 26, 16, 17, 229, 25, 16, 17, 127, 229, 25,
- 16, 17, 229, 24, 16, 17, 127, 229, 24, 16, 17, 229, 30, 16, 17, 127, 229,
- 30, 16, 17, 229, 29, 16, 17, 127, 229, 29, 16, 17, 229, 148, 16, 17, 223,
- 228, 16, 17, 224, 19, 16, 17, 223, 202, 16, 17, 223, 194, 16, 17, 223,
- 183, 16, 17, 223, 172, 16, 17, 224, 24, 223, 172, 16, 17, 191, 16, 17,
- 224, 21, 16, 17, 223, 132, 16, 17, 127, 223, 132, 16, 17, 223, 131, 16,
- 17, 127, 223, 131, 16, 17, 223, 130, 16, 17, 127, 223, 130, 16, 17, 223,
- 129, 16, 17, 127, 223, 129, 16, 17, 223, 128, 16, 17, 127, 223, 128, 16,
- 17, 223, 134, 16, 17, 127, 223, 134, 16, 17, 223, 133, 16, 17, 127, 223,
- 133, 16, 17, 235, 226, 223, 133, 16, 17, 224, 25, 16, 17, 252, 179, 224,
- 25, 16, 17, 127, 224, 25, 16, 17, 230, 232, 223, 202, 16, 17, 231, 244,
- 16, 17, 232, 26, 231, 244, 16, 17, 127, 237, 243, 16, 17, 232, 21, 16,
- 17, 231, 180, 16, 17, 231, 144, 16, 17, 231, 122, 16, 17, 231, 114, 16,
- 17, 127, 237, 143, 16, 17, 208, 16, 17, 232, 22, 16, 17, 127, 238, 43,
- 16, 17, 231, 45, 16, 17, 127, 231, 45, 16, 17, 146, 16, 17, 127, 146, 16,
- 17, 124, 146, 16, 17, 247, 97, 16, 17, 247, 126, 16, 17, 247, 70, 16, 17,
- 247, 57, 16, 17, 247, 7, 16, 17, 247, 3, 16, 17, 247, 129, 16, 17, 247,
- 128, 16, 17, 246, 205, 16, 17, 127, 246, 205, 16, 17, 247, 130, 16, 17,
- 226, 239, 16, 17, 236, 3, 226, 239, 16, 17, 226, 220, 16, 17, 236, 3,
- 226, 220, 16, 17, 226, 216, 16, 17, 236, 3, 226, 216, 16, 17, 226, 201,
- 16, 17, 226, 198, 16, 17, 226, 251, 16, 17, 226, 250, 16, 17, 226, 179,
- 16, 17, 127, 226, 179, 16, 17, 226, 253, 16, 17, 226, 9, 16, 17, 226, 8,
- 16, 17, 226, 7, 16, 17, 226, 10, 16, 17, 226, 11, 16, 17, 225, 199, 16,
- 17, 225, 198, 16, 17, 225, 197, 16, 17, 225, 200, 16, 17, 234, 193, 245,
- 121, 16, 17, 234, 193, 245, 75, 16, 17, 234, 193, 245, 61, 16, 17, 234,
- 193, 244, 227, 16, 17, 234, 193, 244, 218, 16, 17, 234, 193, 154, 16, 17,
- 234, 193, 245, 167, 16, 17, 234, 193, 212, 16, 17, 234, 192, 212, 16, 17,
- 245, 55, 16, 17, 232, 134, 16, 17, 232, 104, 16, 17, 232, 99, 16, 17,
- 232, 95, 16, 17, 232, 90, 16, 17, 232, 138, 16, 17, 232, 137, 16, 17,
- 232, 139, 16, 17, 226, 134, 16, 17, 226, 132, 16, 17, 226, 131, 16, 17,
- 226, 135, 16, 17, 127, 231, 244, 16, 17, 127, 231, 180, 16, 17, 127, 231,
- 122, 16, 17, 127, 208, 16, 17, 235, 135, 16, 17, 235, 114, 16, 17, 235,
- 110, 16, 17, 235, 107, 16, 17, 235, 103, 16, 17, 235, 137, 16, 17, 235,
- 136, 16, 17, 235, 139, 16, 17, 235, 17, 16, 17, 230, 232, 229, 114, 16,
- 17, 230, 232, 229, 90, 16, 17, 230, 232, 229, 71, 16, 17, 230, 232, 229,
- 146, 16, 17, 224, 96, 226, 239, 16, 17, 224, 96, 226, 220, 16, 17, 224,
- 96, 226, 201, 16, 17, 224, 96, 226, 251, 16, 17, 224, 96, 226, 253, 16,
- 17, 237, 199, 16, 17, 237, 198, 16, 17, 237, 197, 16, 17, 237, 196, 16,
- 17, 237, 205, 16, 17, 237, 204, 16, 17, 237, 206, 16, 17, 226, 252, 226,
- 239, 16, 17, 226, 252, 226, 220, 16, 17, 226, 252, 226, 216, 16, 17, 226,
- 252, 226, 201, 16, 17, 226, 252, 226, 198, 16, 17, 226, 252, 226, 251,
- 16, 17, 226, 252, 226, 250, 16, 17, 226, 252, 226, 253, 16, 17, 254, 243,
- 254, 27, 16, 17, 252, 147, 72, 16, 17, 252, 147, 74, 16, 17, 252, 147,
- 73, 16, 17, 252, 147, 57, 16, 17, 252, 147, 224, 141, 16, 17, 252, 147,
- 224, 118, 16, 17, 252, 147, 224, 105, 16, 17, 252, 147, 224, 173, 16, 17,
- 252, 147, 235, 162, 16, 17, 252, 147, 235, 89, 16, 17, 252, 147, 235, 6,
- 16, 17, 252, 147, 236, 1, 16, 17, 252, 147, 239, 3, 16, 17, 252, 147,
- 238, 199, 16, 17, 252, 147, 238, 150, 16, 17, 252, 147, 177, 16, 17, 230,
- 232, 245, 121, 16, 17, 230, 232, 245, 75, 16, 17, 230, 232, 244, 227, 16,
- 17, 230, 232, 154, 16, 17, 60, 246, 52, 16, 17, 60, 246, 54, 16, 17, 60,
- 246, 58, 16, 17, 60, 246, 57, 16, 17, 60, 246, 55, 16, 17, 60, 246, 66,
- 16, 17, 60, 231, 70, 16, 17, 60, 231, 122, 16, 17, 60, 231, 244, 16, 17,
- 60, 231, 229, 16, 17, 60, 231, 180, 16, 17, 60, 208, 16, 17, 60, 224, 83,
- 16, 17, 60, 224, 105, 16, 17, 60, 224, 141, 16, 17, 60, 224, 138, 16, 17,
- 60, 224, 118, 16, 17, 60, 224, 173, 16, 17, 60, 244, 121, 16, 17, 60,
- 244, 122, 16, 17, 60, 244, 125, 16, 17, 60, 244, 124, 16, 17, 60, 244,
- 123, 16, 17, 60, 244, 127, 16, 17, 60, 226, 186, 16, 17, 60, 226, 201,
- 16, 17, 60, 226, 239, 16, 17, 60, 226, 238, 16, 17, 60, 226, 220, 16, 17,
- 60, 226, 251, 16, 17, 60, 225, 253, 16, 17, 60, 226, 5, 16, 17, 60, 226,
- 17, 16, 17, 60, 226, 16, 16, 17, 60, 226, 6, 16, 17, 60, 226, 20, 16, 17,
- 60, 232, 173, 16, 17, 60, 233, 4, 16, 17, 60, 233, 151, 16, 17, 60, 233,
- 144, 16, 17, 60, 233, 69, 16, 17, 60, 213, 16, 17, 60, 233, 244, 16, 17,
- 60, 245, 218, 16, 17, 60, 246, 11, 16, 17, 60, 246, 131, 16, 17, 60, 246,
- 125, 16, 17, 60, 246, 46, 16, 17, 60, 246, 193, 16, 17, 60, 238, 204, 16,
- 17, 60, 238, 208, 16, 17, 60, 238, 217, 16, 17, 60, 238, 216, 16, 17, 60,
- 238, 212, 16, 17, 60, 238, 227, 16, 17, 60, 238, 162, 16, 17, 60, 238,
- 163, 16, 17, 60, 238, 166, 16, 17, 60, 238, 165, 16, 17, 60, 238, 164,
- 16, 17, 60, 238, 167, 16, 17, 60, 238, 168, 16, 17, 60, 234, 206, 16, 17,
- 60, 235, 6, 16, 17, 60, 235, 162, 16, 17, 60, 235, 160, 16, 17, 60, 235,
- 89, 16, 17, 60, 236, 1, 16, 17, 60, 236, 66, 16, 17, 60, 236, 103, 16,
- 17, 60, 236, 235, 16, 17, 60, 236, 226, 16, 17, 60, 236, 157, 16, 17, 60,
- 198, 16, 17, 60, 223, 158, 16, 17, 60, 223, 183, 16, 17, 60, 223, 228,
- 16, 17, 60, 223, 225, 16, 17, 60, 223, 202, 16, 17, 60, 191, 16, 17, 60,
- 239, 101, 16, 17, 230, 232, 239, 101, 16, 17, 60, 239, 117, 16, 17, 60,
- 239, 170, 16, 17, 60, 239, 169, 16, 17, 60, 239, 156, 16, 17, 230, 232,
- 239, 156, 16, 17, 60, 239, 179, 16, 17, 60, 239, 130, 16, 17, 60, 239,
- 134, 16, 17, 60, 239, 144, 16, 17, 60, 239, 143, 16, 17, 60, 239, 142,
- 16, 17, 60, 239, 145, 16, 17, 60, 237, 110, 16, 17, 60, 237, 143, 16, 17,
- 60, 237, 243, 16, 17, 60, 237, 239, 16, 17, 60, 237, 193, 16, 17, 60,
- 238, 43, 16, 17, 60, 249, 165, 16, 17, 60, 249, 166, 16, 17, 60, 249,
- 169, 16, 17, 60, 249, 168, 16, 17, 60, 249, 167, 16, 17, 60, 249, 170,
- 16, 17, 60, 237, 195, 16, 17, 60, 237, 197, 16, 17, 60, 237, 201, 16, 17,
- 60, 237, 200, 16, 17, 60, 237, 199, 16, 17, 60, 237, 205, 16, 17, 60,
- 226, 130, 16, 17, 60, 226, 131, 16, 17, 60, 226, 134, 16, 17, 60, 226,
- 133, 16, 17, 60, 226, 132, 16, 17, 60, 226, 135, 16, 17, 60, 226, 127,
- 16, 17, 60, 226, 128, 16, 17, 60, 226, 137, 16, 17, 60, 226, 136, 16, 17,
- 60, 226, 129, 16, 17, 60, 226, 138, 16, 17, 60, 223, 19, 16, 17, 60, 223,
- 27, 16, 17, 60, 223, 97, 16, 17, 60, 223, 95, 16, 17, 60, 223, 47, 16,
- 17, 60, 223, 117, 16, 17, 60, 223, 119, 16, 17, 60, 59, 223, 119, 16, 17,
- 60, 248, 61, 16, 17, 60, 248, 62, 16, 17, 60, 248, 69, 16, 17, 60, 248,
- 68, 16, 17, 60, 248, 64, 16, 17, 60, 248, 70, 16, 17, 60, 228, 6, 16, 17,
- 60, 228, 169, 16, 17, 60, 230, 213, 16, 17, 60, 230, 203, 16, 17, 60,
- 229, 15, 16, 17, 60, 231, 31, 16, 17, 60, 229, 43, 16, 17, 60, 229, 71,
- 16, 17, 60, 229, 114, 16, 17, 60, 229, 112, 16, 17, 60, 229, 90, 16, 17,
- 60, 229, 146, 16, 17, 60, 229, 148, 16, 17, 60, 226, 26, 16, 17, 60, 226,
- 28, 16, 17, 60, 226, 40, 16, 17, 60, 226, 39, 16, 17, 60, 226, 29, 16,
- 17, 60, 226, 44, 16, 17, 60, 251, 136, 16, 17, 60, 251, 150, 16, 17, 60,
- 251, 182, 16, 17, 60, 251, 179, 16, 17, 60, 251, 169, 16, 17, 60, 251,
- 204, 16, 17, 60, 225, 255, 16, 17, 60, 226, 0, 16, 17, 60, 226, 3, 16,
- 17, 60, 226, 2, 16, 17, 60, 226, 1, 16, 17, 60, 226, 4, 16, 17, 251, 170,
- 53, 16, 17, 246, 218, 228, 38, 16, 17, 232, 130, 16, 17, 235, 134, 16,
- 17, 235, 14, 16, 17, 235, 13, 16, 17, 235, 12, 16, 17, 235, 11, 16, 17,
- 235, 16, 16, 17, 235, 15, 234, 86, 228, 146, 76, 234, 86, 1, 252, 218,
- 234, 86, 1, 237, 103, 234, 86, 1, 247, 96, 234, 86, 1, 231, 15, 234, 86,
- 1, 235, 56, 234, 86, 1, 225, 169, 234, 86, 1, 250, 167, 234, 86, 1, 226,
- 153, 234, 86, 1, 251, 63, 234, 86, 1, 251, 223, 234, 86, 1, 236, 58, 234,
- 86, 1, 245, 253, 234, 86, 1, 235, 127, 234, 86, 1, 228, 33, 234, 86, 1,
- 231, 67, 234, 86, 1, 254, 250, 234, 86, 1, 234, 56, 234, 86, 1, 225, 103,
- 234, 86, 1, 248, 54, 234, 86, 1, 239, 218, 234, 86, 1, 248, 55, 234, 86,
- 1, 234, 31, 234, 86, 1, 225, 154, 234, 86, 1, 240, 53, 234, 86, 1, 248,
- 52, 234, 86, 1, 233, 137, 234, 86, 247, 95, 76, 234, 86, 200, 247, 95,
- 76, 140, 1, 247, 86, 247, 78, 247, 98, 247, 130, 140, 1, 196, 140, 1,
- 225, 89, 225, 104, 66, 140, 1, 223, 160, 140, 1, 224, 25, 140, 1, 224,
- 174, 140, 1, 226, 182, 226, 181, 226, 196, 140, 1, 247, 168, 140, 1, 254,
- 169, 57, 140, 1, 234, 21, 73, 140, 1, 255, 44, 57, 140, 1, 255, 15, 140,
- 1, 237, 130, 73, 140, 1, 229, 56, 73, 140, 1, 73, 140, 1, 234, 88, 140,
- 1, 234, 61, 140, 1, 232, 11, 232, 19, 231, 224, 146, 140, 1, 239, 13,
- 140, 1, 251, 221, 140, 1, 239, 14, 239, 76, 140, 1, 214, 140, 1, 247,
- 228, 140, 1, 246, 128, 245, 177, 214, 140, 1, 246, 160, 140, 1, 224, 81,
- 224, 76, 224, 174, 140, 1, 245, 160, 212, 140, 1, 245, 164, 212, 140, 1,
- 237, 132, 212, 140, 1, 229, 59, 212, 140, 1, 235, 222, 234, 170, 235,
- 223, 199, 140, 1, 229, 57, 199, 140, 1, 248, 135, 140, 1, 239, 202, 239,
- 206, 239, 197, 74, 140, 1, 72, 140, 1, 239, 162, 239, 182, 140, 1, 246,
- 114, 140, 1, 237, 133, 255, 19, 140, 1, 229, 61, 57, 140, 1, 239, 190,
- 247, 213, 140, 1, 233, 110, 233, 127, 233, 244, 140, 1, 254, 221, 247,
- 212, 140, 1, 228, 149, 193, 140, 1, 229, 4, 237, 129, 193, 140, 1, 229,
- 55, 193, 140, 1, 252, 44, 140, 1, 223, 119, 140, 1, 226, 142, 226, 147,
- 225, 188, 227, 109, 140, 1, 229, 54, 227, 109, 140, 1, 222, 222, 140, 1,
- 252, 203, 252, 206, 252, 153, 254, 27, 140, 1, 229, 60, 254, 27, 140, 1,
- 248, 134, 140, 1, 234, 40, 140, 1, 248, 23, 248, 25, 72, 140, 1, 237, 30,
- 237, 36, 185, 140, 1, 237, 131, 185, 140, 1, 229, 58, 185, 140, 1, 237,
- 255, 238, 28, 237, 136, 149, 140, 1, 248, 136, 140, 1, 239, 255, 140, 1,
- 240, 0, 140, 1, 250, 178, 250, 183, 222, 222, 140, 1, 234, 17, 247, 167,
- 73, 140, 1, 248, 51, 140, 1, 239, 217, 140, 1, 250, 207, 140, 1, 252, 32,
- 140, 1, 251, 230, 140, 1, 228, 63, 140, 1, 237, 128, 140, 1, 229, 53,
- 140, 1, 244, 68, 140, 1, 232, 139, 140, 1, 224, 73, 140, 228, 241, 232,
- 170, 140, 236, 53, 232, 170, 140, 250, 244, 232, 170, 140, 254, 106, 98,
- 140, 225, 224, 98, 140, 252, 217, 98, 227, 94, 1, 57, 227, 94, 1, 74,
- 227, 94, 1, 66, 227, 94, 1, 177, 227, 94, 1, 246, 193, 227, 94, 1, 235,
- 137, 227, 94, 1, 227, 107, 227, 94, 1, 250, 189, 227, 94, 1, 236, 1, 227,
- 94, 1, 213, 227, 94, 1, 253, 70, 227, 94, 1, 198, 227, 94, 1, 191, 227,
- 94, 1, 238, 43, 227, 94, 1, 224, 173, 227, 94, 1, 231, 31, 227, 94, 1,
- 154, 227, 94, 31, 5, 74, 227, 94, 31, 5, 66, 227, 94, 5, 224, 216, 245,
- 143, 1, 57, 245, 143, 1, 74, 245, 143, 1, 66, 245, 143, 1, 177, 245, 143,
- 1, 246, 193, 245, 143, 1, 235, 137, 245, 143, 1, 227, 107, 245, 143, 1,
- 250, 189, 245, 143, 1, 236, 1, 245, 143, 1, 213, 245, 143, 1, 253, 70,
- 245, 143, 1, 198, 245, 143, 1, 191, 245, 143, 1, 208, 245, 143, 1, 238,
- 43, 245, 143, 1, 224, 173, 245, 143, 1, 231, 31, 245, 143, 1, 154, 245,
- 143, 31, 5, 74, 245, 143, 31, 5, 66, 245, 143, 5, 233, 214, 233, 83, 228,
- 241, 232, 170, 233, 83, 47, 232, 170, 252, 87, 1, 57, 252, 87, 1, 74,
- 252, 87, 1, 66, 252, 87, 1, 177, 252, 87, 1, 246, 193, 252, 87, 1, 235,
- 137, 252, 87, 1, 227, 107, 252, 87, 1, 250, 189, 252, 87, 1, 236, 1, 252,
- 87, 1, 213, 252, 87, 1, 253, 70, 252, 87, 1, 198, 252, 87, 1, 191, 252,
- 87, 1, 208, 252, 87, 1, 238, 43, 252, 87, 1, 224, 173, 252, 87, 1, 231,
- 31, 252, 87, 1, 154, 252, 87, 31, 5, 74, 252, 87, 31, 5, 66, 227, 93, 1,
- 57, 227, 93, 1, 74, 227, 93, 1, 66, 227, 93, 1, 177, 227, 93, 1, 246,
- 193, 227, 93, 1, 235, 137, 227, 93, 1, 227, 107, 227, 93, 1, 250, 189,
- 227, 93, 1, 236, 1, 227, 93, 1, 213, 227, 93, 1, 253, 70, 227, 93, 1,
- 198, 227, 93, 1, 191, 227, 93, 1, 238, 43, 227, 93, 1, 224, 173, 227, 93,
- 1, 231, 31, 227, 93, 31, 5, 74, 227, 93, 31, 5, 66, 71, 1, 177, 71, 1,
- 238, 227, 71, 1, 238, 150, 71, 1, 238, 208, 71, 1, 235, 107, 71, 1, 252,
- 39, 71, 1, 251, 204, 71, 1, 251, 68, 71, 1, 251, 150, 71, 1, 234, 152,
- 71, 1, 250, 189, 71, 1, 226, 10, 71, 1, 249, 161, 71, 1, 226, 7, 71, 1,
- 235, 9, 71, 1, 227, 107, 71, 1, 226, 251, 71, 1, 96, 71, 1, 226, 201, 71,
- 1, 235, 6, 71, 1, 253, 70, 71, 1, 233, 97, 71, 1, 233, 4, 71, 1, 233, 79,
- 71, 1, 236, 103, 71, 1, 223, 183, 71, 1, 231, 122, 71, 1, 237, 143, 71,
- 1, 224, 206, 71, 1, 229, 146, 71, 1, 228, 84, 71, 1, 231, 31, 71, 1, 154,
- 71, 1, 238, 43, 71, 1, 232, 138, 71, 240, 9, 31, 232, 124, 71, 240, 9,
- 31, 232, 137, 71, 240, 9, 31, 232, 104, 71, 240, 9, 31, 232, 99, 71, 240,
- 9, 31, 232, 84, 71, 240, 9, 31, 232, 61, 71, 240, 9, 31, 232, 49, 71,
- 240, 9, 31, 232, 48, 71, 240, 9, 31, 231, 43, 71, 240, 9, 31, 231, 36,
- 71, 240, 9, 31, 237, 80, 71, 240, 9, 31, 237, 71, 71, 240, 9, 31, 232,
- 119, 71, 240, 9, 31, 232, 130, 71, 240, 9, 31, 232, 91, 225, 196, 118,
- 71, 240, 9, 31, 232, 91, 225, 196, 113, 71, 240, 9, 31, 232, 120, 71, 31,
- 239, 254, 254, 135, 71, 31, 239, 254, 255, 63, 71, 31, 5, 255, 63, 71,
- 31, 5, 74, 71, 31, 5, 240, 47, 71, 31, 5, 224, 25, 71, 31, 5, 223, 127,
- 71, 31, 5, 66, 71, 31, 5, 225, 76, 71, 31, 5, 225, 170, 71, 31, 5, 234,
- 88, 71, 31, 5, 191, 71, 31, 5, 240, 72, 71, 31, 5, 72, 71, 31, 5, 255,
- 19, 71, 31, 5, 254, 253, 71, 31, 5, 234, 52, 71, 31, 5, 254, 53, 71, 5,
- 235, 67, 71, 5, 231, 242, 71, 5, 223, 137, 71, 5, 236, 25, 71, 5, 226,
- 68, 71, 5, 253, 38, 71, 5, 231, 118, 71, 5, 226, 123, 71, 5, 239, 52, 71,
- 5, 254, 255, 71, 5, 230, 254, 230, 250, 71, 5, 224, 213, 71, 5, 251, 65,
- 71, 5, 253, 20, 71, 5, 238, 222, 71, 5, 253, 34, 71, 5, 252, 28, 233, 42,
- 238, 83, 71, 5, 237, 223, 226, 108, 71, 5, 252, 192, 71, 5, 233, 81, 236,
- 64, 71, 5, 238, 138, 71, 250, 222, 14, 231, 176, 71, 5, 254, 39, 71, 5,
- 254, 56, 71, 21, 223, 89, 71, 21, 118, 71, 21, 113, 71, 21, 166, 71, 21,
- 158, 71, 21, 173, 71, 21, 183, 71, 21, 194, 71, 21, 187, 71, 21, 192, 71,
- 14, 237, 223, 254, 58, 228, 160, 71, 14, 237, 223, 254, 58, 236, 40, 71,
- 14, 237, 223, 254, 58, 233, 41, 71, 14, 237, 223, 254, 58, 252, 219, 71,
- 14, 237, 223, 254, 58, 252, 75, 71, 14, 237, 223, 254, 58, 232, 226, 71,
- 14, 237, 223, 254, 58, 232, 220, 71, 14, 237, 223, 254, 58, 232, 218, 71,
- 14, 237, 223, 254, 58, 232, 224, 71, 14, 237, 223, 254, 58, 232, 222, 68,
- 252, 163, 68, 247, 249, 68, 251, 54, 68, 246, 218, 228, 38, 68, 251, 61,
- 68, 246, 243, 249, 138, 68, 226, 122, 228, 165, 244, 95, 68, 229, 14, 4,
- 252, 123, 237, 13, 68, 237, 33, 251, 54, 68, 237, 33, 246, 218, 228, 38,
- 68, 235, 54, 68, 246, 230, 38, 230, 193, 118, 68, 246, 230, 38, 230, 193,
- 113, 68, 246, 230, 38, 230, 193, 166, 68, 31, 229, 173, 68, 21, 223, 89,
- 68, 21, 118, 68, 21, 113, 68, 21, 166, 68, 21, 158, 68, 21, 173, 68, 21,
- 183, 68, 21, 194, 68, 21, 187, 68, 21, 192, 68, 1, 57, 68, 1, 72, 68, 1,
- 74, 68, 1, 73, 68, 1, 66, 68, 1, 234, 88, 68, 1, 225, 159, 68, 1, 248,
- 35, 68, 1, 236, 1, 68, 1, 254, 184, 68, 1, 253, 70, 68, 1, 213, 68, 1,
- 232, 138, 68, 1, 246, 193, 68, 1, 198, 68, 1, 238, 43, 68, 1, 231, 31,
- 68, 1, 229, 146, 68, 1, 227, 107, 68, 1, 250, 189, 68, 1, 251, 204, 68,
- 1, 239, 179, 68, 1, 191, 68, 1, 208, 68, 1, 224, 173, 68, 1, 247, 129,
- 68, 1, 177, 68, 1, 238, 227, 68, 1, 226, 44, 68, 1, 223, 117, 68, 1, 245,
- 167, 68, 1, 223, 20, 68, 1, 237, 205, 68, 1, 223, 72, 68, 1, 251, 169,
- 68, 1, 226, 122, 182, 31, 53, 68, 1, 226, 122, 72, 68, 1, 226, 122, 74,
- 68, 1, 226, 122, 73, 68, 1, 226, 122, 66, 68, 1, 226, 122, 234, 88, 68,
- 1, 226, 122, 225, 159, 68, 1, 226, 122, 254, 184, 68, 1, 226, 122, 253,
- 70, 68, 1, 226, 122, 213, 68, 1, 226, 122, 232, 138, 68, 1, 226, 122,
- 246, 193, 68, 1, 226, 122, 198, 68, 1, 226, 122, 227, 107, 68, 1, 226,
- 122, 250, 189, 68, 1, 226, 122, 251, 204, 68, 1, 226, 122, 239, 179, 68,
- 1, 226, 122, 226, 44, 68, 1, 226, 122, 191, 68, 1, 226, 122, 224, 173,
- 68, 1, 226, 122, 177, 68, 1, 226, 122, 246, 190, 68, 1, 226, 122, 245,
- 167, 68, 1, 226, 122, 239, 155, 68, 1, 226, 122, 235, 87, 68, 1, 226,
- 122, 248, 70, 68, 1, 229, 14, 72, 68, 1, 229, 14, 74, 68, 1, 229, 14,
- 239, 188, 68, 1, 229, 14, 225, 159, 68, 1, 229, 14, 66, 68, 1, 229, 14,
- 254, 184, 68, 1, 229, 14, 177, 68, 1, 229, 14, 246, 193, 68, 1, 229, 14,
- 154, 68, 1, 229, 14, 213, 68, 1, 229, 14, 229, 146, 68, 1, 229, 14, 227,
- 107, 68, 1, 229, 14, 250, 189, 68, 1, 229, 14, 239, 179, 68, 1, 229, 14,
- 247, 129, 68, 1, 229, 14, 246, 190, 68, 1, 229, 14, 245, 167, 68, 1, 229,
- 14, 226, 44, 68, 1, 229, 14, 223, 117, 68, 1, 229, 14, 232, 22, 68, 1,
- 229, 14, 251, 204, 68, 1, 229, 14, 223, 85, 68, 1, 237, 33, 74, 68, 1,
- 237, 33, 177, 68, 1, 237, 33, 208, 68, 1, 237, 33, 247, 129, 68, 1, 237,
- 33, 223, 85, 68, 1, 254, 220, 246, 175, 254, 161, 118, 68, 1, 254, 220,
- 246, 175, 224, 212, 118, 68, 1, 254, 220, 246, 175, 250, 158, 68, 1, 254,
- 220, 246, 175, 225, 167, 68, 1, 254, 220, 246, 175, 239, 223, 225, 167,
- 68, 1, 254, 220, 246, 175, 253, 47, 68, 1, 254, 220, 246, 175, 152, 253,
- 47, 68, 1, 254, 220, 246, 175, 57, 68, 1, 254, 220, 246, 175, 74, 68, 1,
- 254, 220, 246, 175, 177, 68, 1, 254, 220, 246, 175, 235, 137, 68, 1, 254,
- 220, 246, 175, 252, 39, 68, 1, 254, 220, 246, 175, 226, 20, 68, 1, 254,
- 220, 246, 175, 226, 10, 68, 1, 254, 220, 246, 175, 250, 117, 68, 1, 254,
- 220, 246, 175, 235, 18, 68, 1, 254, 220, 246, 175, 227, 107, 68, 1, 254,
- 220, 246, 175, 250, 189, 68, 1, 254, 220, 246, 175, 213, 68, 1, 254, 220,
- 246, 175, 233, 97, 68, 1, 254, 220, 246, 175, 228, 110, 68, 1, 254, 220,
- 246, 175, 223, 85, 68, 1, 254, 220, 246, 175, 223, 117, 68, 1, 254, 220,
- 246, 175, 255, 3, 68, 1, 226, 122, 254, 220, 246, 175, 227, 107, 68, 1,
- 226, 122, 254, 220, 246, 175, 223, 85, 68, 1, 237, 33, 254, 220, 246,
- 175, 246, 66, 68, 1, 237, 33, 254, 220, 246, 175, 235, 137, 68, 1, 237,
- 33, 254, 220, 246, 175, 252, 39, 68, 1, 237, 33, 254, 220, 246, 175, 239,
- 160, 68, 1, 237, 33, 254, 220, 246, 175, 226, 20, 68, 1, 237, 33, 254,
- 220, 246, 175, 250, 101, 68, 1, 237, 33, 254, 220, 246, 175, 227, 107,
- 68, 1, 237, 33, 254, 220, 246, 175, 250, 22, 68, 1, 237, 33, 254, 220,
- 246, 175, 228, 110, 68, 1, 237, 33, 254, 220, 246, 175, 250, 201, 68, 1,
- 237, 33, 254, 220, 246, 175, 223, 85, 68, 1, 237, 33, 254, 220, 246, 175,
- 223, 117, 68, 1, 254, 220, 246, 175, 132, 66, 68, 1, 254, 220, 246, 175,
- 132, 191, 68, 1, 237, 33, 254, 220, 246, 175, 252, 190, 68, 1, 254, 220,
- 246, 175, 250, 179, 68, 1, 237, 33, 254, 220, 246, 175, 237, 205, 174,
- 224, 193, 237, 210, 174, 1, 177, 174, 1, 238, 227, 174, 1, 246, 193, 174,
- 1, 246, 66, 174, 1, 235, 137, 174, 1, 252, 39, 174, 1, 251, 204, 174, 1,
- 239, 179, 174, 1, 239, 160, 174, 1, 223, 250, 174, 1, 227, 107, 174, 1,
- 226, 251, 174, 1, 250, 189, 174, 1, 250, 22, 174, 1, 236, 1, 174, 1, 213,
- 174, 1, 233, 97, 174, 1, 253, 70, 174, 1, 252, 190, 174, 1, 198, 174, 1,
- 191, 174, 1, 208, 174, 1, 238, 43, 174, 1, 224, 173, 174, 1, 229, 146,
- 174, 1, 228, 110, 174, 1, 231, 31, 174, 1, 154, 174, 31, 5, 57, 174, 31,
- 5, 74, 174, 31, 5, 66, 174, 31, 5, 248, 35, 174, 31, 5, 254, 253, 174,
- 31, 5, 234, 52, 174, 31, 5, 254, 53, 174, 31, 5, 72, 174, 31, 5, 73, 174,
- 228, 0, 1, 191, 174, 228, 0, 1, 208, 174, 228, 0, 1, 224, 173, 174, 3, 1,
- 177, 174, 3, 1, 235, 137, 174, 3, 1, 254, 160, 174, 3, 1, 227, 107, 174,
- 3, 1, 236, 1, 174, 3, 1, 213, 174, 3, 1, 198, 174, 3, 1, 208, 174, 3, 1,
- 238, 43, 174, 5, 236, 57, 174, 5, 238, 248, 174, 5, 231, 30, 174, 5, 237,
- 125, 174, 247, 149, 76, 174, 232, 69, 76, 174, 21, 223, 89, 174, 21, 118,
- 174, 21, 113, 174, 21, 166, 174, 21, 158, 174, 21, 173, 174, 21, 183,
- 174, 21, 194, 174, 21, 187, 174, 21, 192, 91, 237, 244, 1, 177, 91, 237,
- 244, 1, 224, 72, 91, 237, 244, 1, 235, 137, 91, 237, 244, 1, 226, 44, 91,
- 237, 244, 1, 231, 31, 91, 237, 244, 1, 191, 91, 237, 244, 1, 227, 107,
- 91, 237, 244, 1, 226, 251, 91, 237, 244, 1, 238, 43, 91, 237, 244, 1,
- 213, 91, 237, 244, 1, 233, 97, 91, 237, 244, 1, 198, 91, 237, 244, 1,
- 247, 129, 91, 237, 244, 1, 225, 64, 91, 237, 244, 1, 154, 91, 237, 244,
- 1, 232, 138, 91, 237, 244, 1, 238, 227, 91, 237, 244, 1, 226, 37, 91,
- 237, 244, 1, 236, 1, 91, 237, 244, 1, 57, 91, 237, 244, 1, 74, 91, 237,
- 244, 1, 248, 35, 91, 237, 244, 1, 248, 24, 91, 237, 244, 1, 66, 91, 237,
- 244, 1, 234, 52, 91, 237, 244, 1, 73, 91, 237, 244, 1, 225, 159, 91, 237,
- 244, 1, 72, 91, 237, 244, 1, 254, 52, 91, 237, 244, 1, 254, 253, 91, 237,
- 244, 1, 226, 116, 91, 237, 244, 1, 226, 115, 91, 237, 244, 1, 226, 114,
- 91, 237, 244, 1, 226, 113, 91, 237, 244, 1, 226, 112, 139, 91, 144, 1,
- 201, 232, 138, 139, 91, 144, 1, 184, 232, 138, 139, 91, 144, 1, 201, 177,
- 139, 91, 144, 1, 201, 224, 72, 139, 91, 144, 1, 201, 235, 137, 139, 91,
- 144, 1, 184, 177, 139, 91, 144, 1, 184, 224, 72, 139, 91, 144, 1, 184,
- 235, 137, 139, 91, 144, 1, 201, 226, 44, 139, 91, 144, 1, 201, 231, 31,
- 139, 91, 144, 1, 201, 191, 139, 91, 144, 1, 184, 226, 44, 139, 91, 144,
- 1, 184, 231, 31, 139, 91, 144, 1, 184, 191, 139, 91, 144, 1, 201, 227,
- 107, 139, 91, 144, 1, 201, 226, 251, 139, 91, 144, 1, 201, 236, 1, 139,
- 91, 144, 1, 184, 227, 107, 139, 91, 144, 1, 184, 226, 251, 139, 91, 144,
- 1, 184, 236, 1, 139, 91, 144, 1, 201, 213, 139, 91, 144, 1, 201, 233, 97,
- 139, 91, 144, 1, 201, 198, 139, 91, 144, 1, 184, 213, 139, 91, 144, 1,
- 184, 233, 97, 139, 91, 144, 1, 184, 198, 139, 91, 144, 1, 201, 247, 129,
- 139, 91, 144, 1, 201, 225, 64, 139, 91, 144, 1, 201, 238, 43, 139, 91,
- 144, 1, 184, 247, 129, 139, 91, 144, 1, 184, 225, 64, 139, 91, 144, 1,
- 184, 238, 43, 139, 91, 144, 1, 201, 154, 139, 91, 144, 1, 201, 250, 189,
- 139, 91, 144, 1, 201, 253, 70, 139, 91, 144, 1, 184, 154, 139, 91, 144,
- 1, 184, 250, 189, 139, 91, 144, 1, 184, 253, 70, 139, 91, 144, 1, 201,
- 238, 80, 139, 91, 144, 1, 201, 224, 45, 139, 91, 144, 1, 184, 238, 80,
- 139, 91, 144, 1, 184, 224, 45, 139, 91, 144, 31, 5, 31, 229, 52, 139, 91,
- 144, 31, 5, 255, 63, 139, 91, 144, 31, 5, 240, 47, 139, 91, 144, 31, 5,
- 66, 139, 91, 144, 31, 5, 225, 76, 139, 91, 144, 31, 5, 72, 139, 91, 144,
- 31, 5, 255, 19, 139, 91, 144, 31, 5, 73, 139, 91, 144, 31, 5, 234, 105,
- 139, 91, 144, 31, 5, 225, 159, 139, 91, 144, 31, 5, 254, 34, 139, 91,
- 144, 31, 5, 255, 55, 139, 91, 144, 31, 5, 225, 70, 139, 91, 144, 31, 5,
- 233, 248, 139, 91, 144, 31, 5, 234, 102, 139, 91, 144, 31, 5, 225, 157,
- 139, 91, 144, 31, 5, 239, 188, 139, 91, 144, 1, 35, 196, 139, 91, 144, 1,
- 35, 235, 139, 139, 91, 144, 1, 35, 199, 139, 91, 144, 1, 35, 185, 139,
- 91, 144, 1, 35, 239, 76, 139, 91, 144, 1, 35, 222, 222, 139, 91, 144, 1,
- 35, 254, 27, 139, 91, 144, 206, 237, 17, 139, 91, 144, 206, 237, 16, 139,
- 91, 144, 21, 223, 89, 139, 91, 144, 21, 118, 139, 91, 144, 21, 113, 139,
- 91, 144, 21, 166, 139, 91, 144, 21, 158, 139, 91, 144, 21, 173, 139, 91,
- 144, 21, 183, 139, 91, 144, 21, 194, 139, 91, 144, 21, 187, 139, 91, 144,
- 21, 192, 139, 91, 144, 5, 238, 33, 139, 91, 144, 5, 238, 32, 71, 14, 233,
- 163, 71, 14, 236, 41, 238, 148, 71, 14, 233, 42, 238, 148, 71, 14, 252,
- 220, 238, 148, 71, 14, 252, 76, 238, 148, 71, 14, 232, 227, 238, 148, 71,
- 14, 232, 221, 238, 148, 71, 14, 232, 219, 238, 148, 71, 14, 232, 225,
- 238, 148, 71, 14, 232, 223, 238, 148, 71, 14, 250, 147, 238, 148, 71, 14,
- 250, 143, 238, 148, 71, 14, 250, 142, 238, 148, 71, 14, 250, 145, 238,
- 148, 71, 14, 250, 144, 238, 148, 71, 14, 250, 141, 238, 148, 71, 14, 225,
- 227, 71, 14, 236, 41, 231, 117, 71, 14, 233, 42, 231, 117, 71, 14, 252,
- 220, 231, 117, 71, 14, 252, 76, 231, 117, 71, 14, 232, 227, 231, 117, 71,
- 14, 232, 221, 231, 117, 71, 14, 232, 219, 231, 117, 71, 14, 232, 225,
- 231, 117, 71, 14, 232, 223, 231, 117, 71, 14, 250, 147, 231, 117, 71, 14,
- 250, 143, 231, 117, 71, 14, 250, 142, 231, 117, 71, 14, 250, 145, 231,
- 117, 71, 14, 250, 144, 231, 117, 71, 14, 250, 141, 231, 117, 252, 88, 1,
- 177, 252, 88, 1, 246, 193, 252, 88, 1, 235, 137, 252, 88, 1, 235, 109,
- 252, 88, 1, 213, 252, 88, 1, 253, 70, 252, 88, 1, 198, 252, 88, 1, 236,
- 69, 252, 88, 1, 227, 107, 252, 88, 1, 250, 189, 252, 88, 1, 236, 1, 252,
- 88, 1, 234, 230, 252, 88, 1, 252, 39, 252, 88, 1, 239, 179, 252, 88, 1,
- 234, 173, 252, 88, 1, 234, 171, 252, 88, 1, 191, 252, 88, 1, 208, 252,
- 88, 1, 238, 43, 252, 88, 1, 225, 64, 252, 88, 1, 231, 31, 252, 88, 1, 57,
- 252, 88, 1, 154, 252, 88, 31, 5, 74, 252, 88, 31, 5, 66, 252, 88, 31, 5,
- 72, 252, 88, 31, 5, 73, 252, 88, 31, 5, 255, 19, 252, 88, 233, 224, 252,
- 88, 247, 233, 106, 230, 205, 85, 5, 225, 148, 231, 177, 85, 5, 225, 148,
- 252, 20, 85, 5, 251, 229, 85, 5, 227, 211, 85, 5, 252, 161, 85, 1, 254,
- 238, 85, 1, 254, 239, 227, 39, 85, 1, 240, 43, 85, 1, 240, 44, 227, 39,
- 85, 1, 225, 151, 85, 1, 225, 152, 227, 39, 85, 1, 232, 25, 231, 213, 85,
- 1, 232, 25, 231, 214, 227, 39, 85, 1, 238, 44, 237, 220, 85, 1, 238, 44,
- 237, 221, 227, 39, 85, 1, 248, 7, 85, 1, 254, 251, 85, 1, 234, 76, 85, 1,
- 234, 77, 227, 39, 85, 1, 177, 85, 1, 188, 237, 52, 85, 1, 246, 193, 85,
- 1, 246, 194, 246, 2, 85, 1, 235, 137, 85, 1, 252, 39, 85, 1, 252, 40,
- 238, 35, 85, 1, 239, 179, 85, 1, 239, 180, 239, 163, 85, 1, 234, 173, 85,
- 1, 227, 108, 238, 1, 85, 1, 227, 108, 236, 36, 237, 52, 85, 1, 250, 190,
- 236, 36, 254, 207, 85, 1, 250, 190, 236, 36, 237, 52, 85, 1, 236, 2, 232,
- 5, 85, 1, 227, 107, 85, 1, 227, 108, 227, 55, 85, 1, 250, 189, 85, 1,
- 250, 190, 237, 56, 85, 1, 236, 1, 85, 1, 213, 85, 1, 233, 242, 239, 39,
- 85, 1, 253, 70, 85, 1, 253, 71, 238, 249, 85, 1, 198, 85, 1, 191, 85, 1,
- 208, 85, 1, 238, 43, 85, 1, 224, 173, 85, 1, 231, 32, 231, 18, 85, 1,
- 231, 32, 230, 245, 85, 1, 231, 31, 85, 1, 154, 85, 5, 231, 207, 85, 31,
- 5, 227, 39, 85, 31, 5, 225, 147, 85, 31, 5, 225, 148, 230, 242, 85, 31,
- 5, 227, 236, 85, 31, 5, 227, 237, 240, 35, 85, 31, 5, 232, 25, 231, 213,
- 85, 31, 5, 232, 25, 231, 214, 227, 39, 85, 31, 5, 238, 44, 237, 220, 85,
- 31, 5, 238, 44, 237, 221, 227, 39, 85, 31, 5, 227, 78, 85, 31, 5, 227,
- 79, 231, 213, 85, 31, 5, 227, 79, 227, 39, 85, 31, 5, 227, 79, 231, 214,
- 227, 39, 85, 31, 5, 233, 125, 85, 31, 5, 233, 126, 227, 39, 85, 255, 25,
- 255, 24, 85, 1, 239, 60, 230, 241, 85, 1, 238, 205, 230, 241, 85, 1, 225,
- 181, 230, 241, 85, 1, 248, 30, 230, 241, 85, 1, 225, 43, 230, 241, 85, 1,
- 223, 109, 230, 241, 85, 1, 254, 64, 230, 241, 85, 21, 223, 89, 85, 21,
- 118, 85, 21, 113, 85, 21, 166, 85, 21, 158, 85, 21, 173, 85, 21, 183, 85,
- 21, 194, 85, 21, 187, 85, 21, 192, 85, 233, 203, 85, 233, 219, 85, 224,
- 110, 85, 252, 7, 233, 213, 85, 252, 7, 228, 253, 85, 252, 7, 233, 179,
- 85, 233, 218, 85, 23, 14, 249, 146, 85, 23, 14, 250, 45, 85, 23, 14, 248,
- 93, 85, 23, 14, 250, 149, 85, 23, 14, 250, 150, 227, 211, 85, 23, 14,
- 249, 209, 85, 23, 14, 250, 182, 85, 23, 14, 250, 30, 85, 23, 14, 250,
- 168, 85, 23, 14, 250, 150, 246, 127, 85, 23, 14, 36, 227, 36, 85, 23, 14,
- 36, 247, 231, 85, 23, 14, 36, 238, 244, 85, 23, 14, 36, 238, 246, 85, 23,
- 14, 36, 239, 167, 85, 23, 14, 36, 238, 245, 2, 239, 167, 85, 23, 14, 36,
- 238, 247, 2, 239, 167, 85, 23, 14, 36, 252, 208, 85, 23, 14, 36, 246, 5,
- 85, 23, 14, 231, 152, 234, 44, 248, 103, 85, 23, 14, 231, 152, 234, 44,
- 250, 180, 85, 23, 14, 231, 152, 251, 82, 225, 245, 85, 23, 14, 231, 152,
- 251, 82, 227, 85, 85, 23, 14, 237, 236, 234, 44, 233, 209, 85, 23, 14,
- 237, 236, 234, 44, 232, 169, 85, 23, 14, 237, 236, 251, 82, 233, 21, 85,
- 23, 14, 237, 236, 251, 82, 233, 13, 85, 23, 14, 237, 236, 234, 44, 233,
- 37, 220, 5, 233, 201, 220, 5, 233, 207, 220, 5, 233, 206, 220, 1, 57,
- 220, 1, 74, 220, 1, 66, 220, 1, 255, 19, 220, 1, 73, 220, 1, 72, 220, 1,
- 247, 165, 220, 1, 177, 220, 1, 232, 138, 220, 1, 246, 193, 220, 1, 235,
- 137, 220, 1, 252, 39, 220, 1, 239, 179, 220, 1, 223, 117, 220, 1, 234,
- 173, 220, 1, 227, 107, 220, 1, 250, 189, 220, 1, 236, 1, 220, 1, 213,
- 220, 1, 247, 129, 220, 1, 225, 64, 220, 1, 253, 70, 220, 1, 198, 220, 1,
- 191, 220, 1, 208, 220, 1, 238, 43, 220, 1, 224, 173, 220, 1, 231, 31,
- 220, 1, 224, 72, 220, 1, 154, 220, 251, 33, 5, 233, 216, 220, 251, 33, 5,
- 233, 202, 220, 251, 33, 5, 233, 200, 220, 31, 5, 233, 208, 220, 31, 5,
- 233, 199, 220, 31, 5, 233, 211, 220, 31, 5, 233, 205, 220, 31, 5, 233,
- 217, 220, 31, 5, 233, 210, 220, 5, 233, 220, 220, 1, 238, 227, 220, 1,
- 227, 184, 220, 21, 223, 89, 220, 21, 118, 220, 21, 113, 220, 21, 166,
- 220, 21, 158, 220, 21, 173, 220, 21, 183, 220, 21, 194, 220, 21, 187,
- 220, 21, 192, 156, 1, 177, 156, 1, 238, 160, 156, 1, 238, 227, 156, 1,
- 246, 193, 156, 1, 246, 20, 156, 1, 235, 137, 156, 1, 252, 39, 156, 1,
- 251, 204, 156, 1, 239, 179, 156, 1, 234, 173, 156, 1, 227, 107, 156, 1,
- 226, 251, 156, 1, 250, 189, 156, 1, 236, 1, 156, 1, 213, 156, 1, 233, 24,
- 156, 1, 233, 97, 156, 1, 247, 129, 156, 1, 247, 32, 156, 1, 253, 70, 156,
- 1, 252, 151, 156, 1, 198, 156, 1, 236, 109, 156, 1, 226, 44, 156, 1, 226,
- 37, 156, 1, 248, 70, 156, 1, 191, 156, 1, 208, 156, 1, 238, 43, 156, 1,
- 154, 156, 1, 245, 54, 156, 1, 225, 64, 156, 1, 231, 31, 156, 1, 229, 146,
- 156, 1, 224, 173, 156, 1, 57, 156, 228, 0, 1, 191, 156, 228, 0, 1, 208,
- 156, 31, 5, 255, 63, 156, 31, 5, 74, 156, 31, 5, 73, 156, 31, 5, 234, 52,
- 156, 31, 5, 66, 156, 31, 5, 225, 76, 156, 31, 5, 72, 156, 251, 33, 5,
- 239, 76, 156, 251, 33, 5, 185, 156, 251, 33, 5, 149, 156, 251, 33, 5,
- 199, 156, 251, 33, 5, 233, 244, 156, 251, 33, 5, 146, 156, 251, 33, 5,
- 227, 109, 156, 251, 33, 5, 234, 158, 156, 251, 33, 5, 239, 43, 156, 5,
- 232, 3, 156, 5, 234, 202, 156, 232, 171, 227, 106, 156, 232, 171, 234,
- 165, 226, 178, 227, 106, 156, 232, 171, 251, 208, 156, 232, 171, 226, 32,
- 251, 208, 156, 232, 171, 226, 31, 156, 21, 223, 89, 156, 21, 118, 156,
- 21, 113, 156, 21, 166, 156, 21, 158, 156, 21, 173, 156, 21, 183, 156, 21,
- 194, 156, 21, 187, 156, 21, 192, 156, 1, 226, 20, 156, 1, 226, 10, 156,
- 1, 250, 117, 234, 74, 251, 164, 21, 223, 89, 234, 74, 251, 164, 21, 118,
- 234, 74, 251, 164, 21, 113, 234, 74, 251, 164, 21, 166, 234, 74, 251,
- 164, 21, 158, 234, 74, 251, 164, 21, 173, 234, 74, 251, 164, 21, 183,
- 234, 74, 251, 164, 21, 194, 234, 74, 251, 164, 21, 187, 234, 74, 251,
- 164, 21, 192, 234, 74, 251, 164, 1, 238, 43, 234, 74, 251, 164, 1, 254,
- 62, 234, 74, 251, 164, 1, 255, 8, 234, 74, 251, 164, 1, 254, 184, 234,
- 74, 251, 164, 1, 254, 233, 234, 74, 251, 164, 1, 238, 42, 234, 74, 251,
- 164, 1, 255, 59, 234, 74, 251, 164, 1, 255, 60, 234, 74, 251, 164, 1,
- 255, 58, 234, 74, 251, 164, 1, 255, 56, 234, 74, 251, 164, 1, 237, 193,
- 234, 74, 251, 164, 1, 239, 205, 234, 74, 251, 164, 1, 240, 48, 234, 74,
- 251, 164, 1, 239, 220, 234, 74, 251, 164, 1, 239, 210, 234, 74, 251, 164,
- 1, 237, 110, 234, 74, 251, 164, 1, 225, 165, 234, 74, 251, 164, 1, 225,
- 163, 234, 74, 251, 164, 1, 225, 121, 234, 74, 251, 164, 1, 225, 70, 234,
- 74, 251, 164, 1, 237, 243, 234, 74, 251, 164, 1, 247, 211, 234, 74, 251,
- 164, 1, 248, 38, 234, 74, 251, 164, 1, 247, 239, 234, 74, 251, 164, 1,
- 247, 192, 234, 74, 251, 164, 1, 237, 143, 234, 74, 251, 164, 1, 234, 16,
- 234, 74, 251, 164, 1, 234, 101, 234, 74, 251, 164, 1, 234, 6, 234, 74,
- 251, 164, 1, 234, 83, 234, 74, 251, 164, 236, 67, 225, 251, 234, 74, 251,
- 164, 246, 188, 225, 252, 234, 74, 251, 164, 236, 65, 225, 252, 234, 74,
- 251, 164, 231, 222, 234, 74, 251, 164, 233, 95, 234, 74, 251, 164, 255,
- 2, 234, 74, 251, 164, 232, 171, 236, 63, 234, 74, 251, 164, 232, 171, 47,
- 236, 63, 7, 1, 3, 6, 57, 7, 1, 3, 6, 255, 19, 7, 3, 1, 209, 255, 19, 7,
- 1, 3, 6, 253, 31, 254, 27, 7, 1, 3, 6, 252, 44, 7, 1, 3, 6, 222, 222, 7,
- 1, 3, 6, 247, 168, 7, 1, 3, 6, 72, 7, 3, 1, 209, 234, 44, 72, 7, 3, 1,
- 209, 74, 7, 1, 3, 6, 239, 182, 7, 1, 3, 6, 239, 76, 7, 1, 3, 6, 238, 47,
- 2, 82, 7, 1, 3, 6, 185, 7, 1, 3, 6, 200, 199, 7, 1, 3, 6, 73, 7, 1, 3, 6,
- 234, 44, 73, 7, 3, 1, 229, 11, 73, 7, 3, 1, 229, 11, 234, 44, 73, 7, 3,
- 1, 229, 11, 130, 2, 82, 7, 3, 1, 209, 234, 88, 7, 1, 3, 6, 234, 13, 7, 3,
- 1, 226, 106, 132, 73, 7, 3, 1, 252, 126, 132, 73, 7, 1, 3, 6, 233, 244,
- 7, 1, 3, 6, 200, 146, 7, 1, 3, 6, 209, 146, 7, 1, 3, 6, 227, 109, 7, 1,
- 3, 6, 66, 7, 3, 1, 229, 11, 66, 7, 3, 1, 229, 11, 250, 2, 66, 7, 3, 1,
- 229, 11, 209, 185, 7, 1, 3, 6, 196, 7, 1, 3, 6, 224, 174, 7, 1, 3, 6,
- 223, 119, 7, 1, 3, 6, 247, 132, 7, 1, 224, 204, 238, 7, 228, 133, 7, 1,
- 254, 248, 19, 1, 3, 6, 246, 169, 19, 1, 3, 6, 238, 16, 19, 1, 3, 6, 233,
- 69, 19, 1, 3, 6, 231, 182, 19, 1, 3, 6, 232, 183, 28, 1, 3, 6, 248, 2,
- 52, 1, 6, 57, 52, 1, 6, 255, 19, 52, 1, 6, 254, 27, 52, 1, 6, 253, 31,
- 254, 27, 52, 1, 6, 222, 222, 52, 1, 6, 72, 52, 1, 6, 200, 72, 52, 1, 6,
- 214, 52, 1, 6, 212, 52, 1, 6, 74, 52, 1, 6, 239, 182, 52, 1, 6, 239, 76,
- 52, 1, 6, 149, 52, 1, 6, 185, 52, 1, 6, 199, 52, 1, 6, 200, 199, 52, 1,
- 6, 73, 52, 1, 6, 234, 13, 52, 1, 6, 233, 244, 52, 1, 6, 146, 52, 1, 6,
- 227, 109, 52, 1, 6, 66, 52, 1, 6, 224, 174, 52, 1, 3, 57, 52, 1, 3, 209,
- 57, 52, 1, 3, 254, 205, 52, 1, 3, 209, 255, 19, 52, 1, 3, 254, 27, 52, 1,
- 3, 222, 222, 52, 1, 3, 72, 52, 1, 3, 230, 222, 52, 1, 3, 234, 44, 72, 52,
- 1, 3, 209, 234, 44, 72, 52, 1, 3, 214, 52, 1, 3, 209, 74, 52, 1, 3, 239,
- 76, 52, 1, 3, 185, 52, 1, 3, 247, 228, 52, 1, 3, 73, 52, 1, 3, 234, 44,
- 73, 52, 1, 3, 226, 106, 132, 73, 52, 1, 3, 252, 126, 132, 73, 52, 1, 3,
- 233, 244, 52, 1, 3, 227, 109, 52, 1, 3, 66, 52, 1, 3, 229, 11, 66, 52, 1,
- 3, 209, 185, 52, 1, 3, 196, 52, 1, 3, 254, 248, 52, 1, 3, 252, 198, 52,
- 1, 3, 19, 246, 169, 52, 1, 3, 250, 47, 52, 1, 3, 19, 233, 87, 52, 1, 3,
- 251, 169, 7, 227, 253, 3, 1, 74, 7, 227, 253, 3, 1, 146, 7, 227, 253, 3,
- 1, 66, 7, 227, 253, 3, 1, 196, 19, 227, 253, 3, 1, 252, 198, 19, 227,
- 253, 3, 1, 246, 169, 19, 227, 253, 3, 1, 231, 182, 19, 227, 253, 3, 1,
- 233, 87, 19, 227, 253, 3, 1, 251, 169, 7, 3, 1, 225, 159, 7, 3, 1, 45, 2,
- 236, 154, 205, 7, 3, 1, 250, 192, 2, 236, 154, 205, 7, 3, 1, 247, 131, 2,
- 236, 154, 205, 7, 3, 1, 237, 69, 2, 236, 154, 205, 7, 3, 1, 236, 5, 2,
- 236, 154, 205, 7, 3, 1, 233, 245, 2, 236, 154, 205, 7, 3, 1, 232, 27, 2,
- 236, 154, 205, 7, 3, 1, 232, 27, 2, 247, 41, 22, 236, 154, 205, 7, 3, 1,
- 231, 35, 2, 236, 154, 205, 7, 3, 1, 227, 110, 2, 236, 154, 205, 7, 3, 1,
- 223, 120, 2, 236, 154, 205, 7, 3, 1, 209, 214, 52, 1, 28, 247, 239, 7, 3,
- 1, 239, 241, 214, 7, 3, 1, 226, 254, 2, 228, 23, 7, 3, 6, 1, 244, 81, 2,
- 82, 7, 3, 1, 239, 216, 2, 82, 7, 3, 1, 233, 245, 2, 82, 7, 3, 6, 1, 97,
- 2, 82, 7, 3, 1, 225, 111, 2, 82, 7, 3, 1, 45, 2, 233, 229, 88, 7, 3, 1,
- 250, 192, 2, 233, 229, 88, 7, 3, 1, 247, 131, 2, 233, 229, 88, 7, 3, 1,
- 246, 196, 2, 233, 229, 88, 7, 3, 1, 239, 77, 2, 233, 229, 88, 7, 3, 1,
- 238, 47, 2, 233, 229, 88, 7, 3, 1, 237, 69, 2, 233, 229, 88, 7, 3, 1,
- 236, 5, 2, 233, 229, 88, 7, 3, 1, 233, 245, 2, 233, 229, 88, 7, 3, 1,
- 232, 27, 2, 233, 229, 88, 7, 3, 1, 231, 35, 2, 233, 229, 88, 7, 3, 1,
- 247, 184, 2, 233, 229, 88, 7, 3, 1, 225, 65, 2, 233, 229, 88, 7, 3, 1,
- 224, 74, 2, 233, 229, 88, 7, 3, 1, 223, 120, 2, 233, 229, 88, 7, 3, 1,
- 102, 2, 231, 196, 88, 7, 3, 1, 254, 206, 2, 231, 196, 88, 7, 3, 1, 250,
- 192, 2, 244, 217, 22, 227, 89, 7, 3, 1, 161, 2, 231, 196, 88, 7, 3, 1,
- 234, 44, 161, 2, 231, 196, 88, 7, 3, 1, 200, 234, 44, 161, 2, 231, 196,
- 88, 7, 3, 1, 230, 223, 2, 231, 196, 88, 7, 3, 1, 244, 81, 2, 231, 196,
- 88, 7, 3, 1, 234, 44, 130, 2, 231, 196, 88, 7, 3, 1, 247, 184, 2, 231,
- 196, 88, 7, 3, 1, 97, 2, 231, 196, 88, 7, 3, 1, 247, 133, 2, 231, 196,
- 88, 52, 1, 3, 209, 254, 205, 52, 1, 3, 252, 44, 52, 1, 3, 252, 45, 2,
- 250, 224, 52, 1, 3, 247, 168, 52, 1, 3, 200, 234, 44, 72, 52, 1, 3, 247,
- 130, 52, 1, 3, 249, 139, 239, 183, 2, 82, 52, 1, 3, 95, 214, 52, 1, 3,
- 209, 212, 52, 1, 3, 244, 81, 2, 82, 52, 1, 3, 239, 215, 52, 1, 3, 6, 74,
- 52, 1, 3, 6, 244, 81, 2, 82, 52, 1, 3, 239, 183, 2, 250, 240, 52, 1, 3,
- 238, 47, 2, 231, 196, 88, 52, 1, 3, 238, 47, 2, 233, 229, 88, 52, 1, 3,
- 6, 149, 52, 1, 3, 237, 69, 2, 88, 52, 1, 3, 209, 237, 69, 2, 182, 237,
- 229, 52, 1, 3, 236, 5, 2, 42, 88, 52, 1, 3, 236, 5, 2, 231, 196, 88, 52,
- 1, 3, 6, 199, 52, 1, 3, 253, 31, 73, 52, 1, 3, 233, 87, 52, 1, 3, 231,
- 35, 2, 88, 52, 1, 3, 247, 183, 52, 1, 3, 227, 110, 2, 233, 229, 88, 52,
- 1, 3, 97, 125, 52, 1, 3, 225, 110, 52, 1, 3, 6, 66, 52, 1, 3, 225, 65, 2,
- 88, 52, 1, 3, 209, 196, 52, 1, 3, 223, 119, 52, 1, 3, 223, 120, 2, 231,
- 196, 88, 52, 1, 3, 223, 120, 2, 250, 224, 52, 1, 3, 247, 132, 52, 1, 3,
- 226, 223, 36, 248, 138, 245, 237, 255, 41, 36, 248, 138, 255, 33, 255,
- 41, 36, 228, 177, 51, 36, 227, 205, 76, 36, 237, 62, 36, 245, 234, 36,
- 237, 60, 36, 255, 31, 36, 245, 235, 36, 255, 32, 36, 7, 3, 1, 232, 27,
- 51, 36, 252, 105, 36, 237, 61, 36, 47, 251, 102, 46, 36, 234, 85, 46, 36,
- 223, 38, 51, 36, 239, 206, 51, 36, 225, 104, 46, 36, 225, 88, 46, 36, 7,
- 3, 1, 247, 22, 234, 44, 102, 46, 36, 7, 3, 1, 255, 19, 36, 7, 3, 1, 254,
- 158, 36, 7, 3, 1, 254, 41, 36, 7, 3, 1, 252, 45, 251, 226, 36, 7, 3, 1,
- 239, 241, 222, 222, 36, 7, 3, 1, 247, 168, 36, 7, 3, 1, 214, 36, 7, 1, 3,
- 6, 214, 36, 7, 3, 1, 239, 76, 36, 7, 3, 1, 149, 36, 7, 1, 3, 6, 149, 36,
- 7, 1, 3, 6, 185, 36, 7, 3, 1, 199, 36, 7, 1, 3, 6, 199, 36, 7, 1, 3, 6,
- 146, 36, 7, 3, 1, 232, 27, 231, 105, 36, 7, 3, 1, 193, 36, 7, 3, 1, 182,
- 193, 36, 7, 3, 1, 223, 119, 36, 42, 254, 94, 46, 36, 41, 254, 94, 22,
- 103, 254, 94, 51, 7, 6, 1, 102, 2, 231, 140, 51, 7, 3, 1, 102, 2, 231,
- 140, 51, 7, 6, 1, 45, 2, 56, 46, 7, 3, 1, 45, 2, 56, 46, 7, 6, 1, 45, 2,
- 56, 51, 7, 3, 1, 45, 2, 56, 51, 7, 6, 1, 45, 2, 237, 171, 51, 7, 3, 1,
- 45, 2, 237, 171, 51, 7, 6, 1, 252, 45, 2, 251, 227, 22, 155, 7, 3, 1,
- 252, 45, 2, 251, 227, 22, 155, 7, 6, 1, 250, 192, 2, 56, 46, 7, 3, 1,
- 250, 192, 2, 56, 46, 7, 6, 1, 250, 192, 2, 56, 51, 7, 3, 1, 250, 192, 2,
- 56, 51, 7, 6, 1, 250, 192, 2, 237, 171, 51, 7, 3, 1, 250, 192, 2, 237,
- 171, 51, 7, 6, 1, 250, 192, 2, 251, 226, 7, 3, 1, 250, 192, 2, 251, 226,
- 7, 6, 1, 250, 192, 2, 251, 102, 51, 7, 3, 1, 250, 192, 2, 251, 102, 51,
- 7, 6, 1, 161, 2, 237, 64, 22, 245, 236, 7, 3, 1, 161, 2, 237, 64, 22,
- 245, 236, 7, 6, 1, 161, 2, 237, 64, 22, 155, 7, 3, 1, 161, 2, 237, 64,
- 22, 155, 7, 6, 1, 161, 2, 251, 102, 51, 7, 3, 1, 161, 2, 251, 102, 51, 7,
- 6, 1, 161, 2, 226, 159, 51, 7, 3, 1, 161, 2, 226, 159, 51, 7, 6, 1, 161,
- 2, 251, 227, 22, 252, 106, 7, 3, 1, 161, 2, 251, 227, 22, 252, 106, 7, 6,
- 1, 247, 131, 2, 56, 46, 7, 3, 1, 247, 131, 2, 56, 46, 7, 6, 1, 246, 196,
- 2, 237, 63, 7, 3, 1, 246, 196, 2, 237, 63, 7, 6, 1, 245, 172, 2, 56, 46,
- 7, 3, 1, 245, 172, 2, 56, 46, 7, 6, 1, 245, 172, 2, 56, 51, 7, 3, 1, 245,
- 172, 2, 56, 51, 7, 6, 1, 245, 172, 2, 219, 7, 3, 1, 245, 172, 2, 219, 7,
- 6, 1, 245, 172, 2, 251, 226, 7, 3, 1, 245, 172, 2, 251, 226, 7, 6, 1,
- 245, 172, 2, 252, 107, 51, 7, 3, 1, 245, 172, 2, 252, 107, 51, 7, 6, 1,
- 244, 81, 2, 226, 159, 51, 7, 3, 1, 244, 81, 2, 226, 159, 51, 7, 6, 1,
- 244, 81, 2, 250, 3, 22, 155, 7, 3, 1, 244, 81, 2, 250, 3, 22, 155, 7, 6,
- 1, 239, 77, 2, 155, 7, 3, 1, 239, 77, 2, 155, 7, 6, 1, 239, 77, 2, 56,
- 51, 7, 3, 1, 239, 77, 2, 56, 51, 7, 6, 1, 239, 77, 2, 237, 171, 51, 7, 3,
- 1, 239, 77, 2, 237, 171, 51, 7, 6, 1, 238, 47, 2, 56, 51, 7, 3, 1, 238,
- 47, 2, 56, 51, 7, 6, 1, 238, 47, 2, 56, 252, 214, 22, 237, 63, 7, 3, 1,
- 238, 47, 2, 56, 252, 214, 22, 237, 63, 7, 6, 1, 238, 47, 2, 237, 171, 51,
- 7, 3, 1, 238, 47, 2, 237, 171, 51, 7, 6, 1, 238, 47, 2, 251, 102, 51, 7,
- 3, 1, 238, 47, 2, 251, 102, 51, 7, 6, 1, 237, 69, 2, 155, 7, 3, 1, 237,
- 69, 2, 155, 7, 6, 1, 237, 69, 2, 56, 46, 7, 3, 1, 237, 69, 2, 56, 46, 7,
- 6, 1, 237, 69, 2, 56, 51, 7, 3, 1, 237, 69, 2, 56, 51, 7, 6, 1, 236, 5,
- 2, 56, 46, 7, 3, 1, 236, 5, 2, 56, 46, 7, 6, 1, 236, 5, 2, 56, 51, 7, 3,
- 1, 236, 5, 2, 56, 51, 7, 6, 1, 236, 5, 2, 237, 171, 51, 7, 3, 1, 236, 5,
- 2, 237, 171, 51, 7, 6, 1, 236, 5, 2, 251, 102, 51, 7, 3, 1, 236, 5, 2,
- 251, 102, 51, 7, 6, 1, 130, 2, 226, 159, 22, 155, 7, 3, 1, 130, 2, 226,
- 159, 22, 155, 7, 6, 1, 130, 2, 226, 159, 22, 219, 7, 3, 1, 130, 2, 226,
- 159, 22, 219, 7, 6, 1, 130, 2, 237, 64, 22, 245, 236, 7, 3, 1, 130, 2,
- 237, 64, 22, 245, 236, 7, 6, 1, 130, 2, 237, 64, 22, 155, 7, 3, 1, 130,
- 2, 237, 64, 22, 155, 7, 6, 1, 233, 245, 2, 155, 7, 3, 1, 233, 245, 2,
- 155, 7, 6, 1, 233, 245, 2, 56, 46, 7, 3, 1, 233, 245, 2, 56, 46, 7, 6, 1,
- 232, 27, 2, 56, 46, 7, 3, 1, 232, 27, 2, 56, 46, 7, 6, 1, 232, 27, 2, 56,
- 51, 7, 3, 1, 232, 27, 2, 56, 51, 7, 6, 1, 232, 27, 2, 56, 252, 214, 22,
- 237, 63, 7, 3, 1, 232, 27, 2, 56, 252, 214, 22, 237, 63, 7, 6, 1, 232,
- 27, 2, 237, 171, 51, 7, 3, 1, 232, 27, 2, 237, 171, 51, 7, 6, 1, 231, 35,
- 2, 56, 46, 7, 3, 1, 231, 35, 2, 56, 46, 7, 6, 1, 231, 35, 2, 56, 51, 7,
- 3, 1, 231, 35, 2, 56, 51, 7, 6, 1, 231, 35, 2, 255, 33, 22, 56, 46, 7, 3,
- 1, 231, 35, 2, 255, 33, 22, 56, 46, 7, 6, 1, 231, 35, 2, 252, 6, 22, 56,
- 46, 7, 3, 1, 231, 35, 2, 252, 6, 22, 56, 46, 7, 6, 1, 231, 35, 2, 56,
- 252, 214, 22, 56, 46, 7, 3, 1, 231, 35, 2, 56, 252, 214, 22, 56, 46, 7,
- 6, 1, 227, 110, 2, 56, 46, 7, 3, 1, 227, 110, 2, 56, 46, 7, 6, 1, 227,
- 110, 2, 56, 51, 7, 3, 1, 227, 110, 2, 56, 51, 7, 6, 1, 227, 110, 2, 237,
- 171, 51, 7, 3, 1, 227, 110, 2, 237, 171, 51, 7, 6, 1, 227, 110, 2, 251,
- 102, 51, 7, 3, 1, 227, 110, 2, 251, 102, 51, 7, 6, 1, 97, 2, 250, 3, 51,
- 7, 3, 1, 97, 2, 250, 3, 51, 7, 6, 1, 97, 2, 226, 159, 51, 7, 3, 1, 97, 2,
- 226, 159, 51, 7, 6, 1, 97, 2, 251, 102, 51, 7, 3, 1, 97, 2, 251, 102, 51,
- 7, 6, 1, 97, 2, 226, 159, 22, 155, 7, 3, 1, 97, 2, 226, 159, 22, 155, 7,
- 6, 1, 97, 2, 237, 64, 22, 219, 7, 3, 1, 97, 2, 237, 64, 22, 219, 7, 6, 1,
- 225, 65, 2, 205, 7, 3, 1, 225, 65, 2, 205, 7, 6, 1, 225, 65, 2, 56, 51,
- 7, 3, 1, 225, 65, 2, 56, 51, 7, 6, 1, 224, 175, 2, 245, 236, 7, 3, 1,
- 224, 175, 2, 245, 236, 7, 6, 1, 224, 175, 2, 155, 7, 3, 1, 224, 175, 2,
- 155, 7, 6, 1, 224, 175, 2, 219, 7, 3, 1, 224, 175, 2, 219, 7, 6, 1, 224,
- 175, 2, 56, 46, 7, 3, 1, 224, 175, 2, 56, 46, 7, 6, 1, 224, 175, 2, 56,
- 51, 7, 3, 1, 224, 175, 2, 56, 51, 7, 6, 1, 224, 74, 2, 56, 46, 7, 3, 1,
- 224, 74, 2, 56, 46, 7, 6, 1, 224, 74, 2, 219, 7, 3, 1, 224, 74, 2, 219,
- 7, 6, 1, 224, 26, 2, 56, 46, 7, 3, 1, 224, 26, 2, 56, 46, 7, 6, 1, 223,
- 120, 2, 251, 101, 7, 3, 1, 223, 120, 2, 251, 101, 7, 6, 1, 223, 120, 2,
- 56, 51, 7, 3, 1, 223, 120, 2, 56, 51, 7, 6, 1, 223, 120, 2, 237, 171, 51,
- 7, 3, 1, 223, 120, 2, 237, 171, 51, 7, 3, 1, 245, 172, 2, 237, 171, 51,
- 7, 3, 1, 227, 110, 2, 219, 7, 3, 1, 224, 175, 2, 231, 140, 46, 7, 3, 1,
- 224, 26, 2, 231, 140, 46, 7, 3, 1, 102, 2, 41, 132, 231, 139, 7, 3, 1,
- 182, 231, 35, 2, 56, 46, 7, 3, 1, 182, 231, 35, 2, 250, 1, 82, 7, 3, 1,
- 182, 231, 35, 2, 201, 82, 7, 6, 1, 229, 124, 193, 7, 3, 1, 250, 47, 7, 6,
- 1, 102, 2, 56, 51, 7, 3, 1, 102, 2, 56, 51, 7, 6, 1, 102, 2, 244, 217,
- 46, 7, 3, 1, 102, 2, 244, 217, 46, 7, 6, 1, 102, 2, 251, 102, 22, 155, 7,
- 3, 1, 102, 2, 251, 102, 22, 155, 7, 6, 1, 102, 2, 251, 102, 22, 245, 236,
- 7, 3, 1, 102, 2, 251, 102, 22, 245, 236, 7, 6, 1, 102, 2, 251, 102, 22,
- 244, 217, 46, 7, 3, 1, 102, 2, 251, 102, 22, 244, 217, 46, 7, 6, 1, 102,
- 2, 251, 102, 22, 205, 7, 3, 1, 102, 2, 251, 102, 22, 205, 7, 6, 1, 102,
- 2, 251, 102, 22, 56, 51, 7, 3, 1, 102, 2, 251, 102, 22, 56, 51, 7, 6, 1,
- 102, 2, 252, 107, 22, 155, 7, 3, 1, 102, 2, 252, 107, 22, 155, 7, 6, 1,
- 102, 2, 252, 107, 22, 245, 236, 7, 3, 1, 102, 2, 252, 107, 22, 245, 236,
- 7, 6, 1, 102, 2, 252, 107, 22, 244, 217, 46, 7, 3, 1, 102, 2, 252, 107,
- 22, 244, 217, 46, 7, 6, 1, 102, 2, 252, 107, 22, 205, 7, 3, 1, 102, 2,
- 252, 107, 22, 205, 7, 6, 1, 102, 2, 252, 107, 22, 56, 51, 7, 3, 1, 102,
- 2, 252, 107, 22, 56, 51, 7, 6, 1, 161, 2, 56, 51, 7, 3, 1, 161, 2, 56,
- 51, 7, 6, 1, 161, 2, 244, 217, 46, 7, 3, 1, 161, 2, 244, 217, 46, 7, 6,
- 1, 161, 2, 205, 7, 3, 1, 161, 2, 205, 7, 6, 1, 161, 2, 251, 102, 22, 155,
- 7, 3, 1, 161, 2, 251, 102, 22, 155, 7, 6, 1, 161, 2, 251, 102, 22, 245,
- 236, 7, 3, 1, 161, 2, 251, 102, 22, 245, 236, 7, 6, 1, 161, 2, 251, 102,
- 22, 244, 217, 46, 7, 3, 1, 161, 2, 251, 102, 22, 244, 217, 46, 7, 6, 1,
- 161, 2, 251, 102, 22, 205, 7, 3, 1, 161, 2, 251, 102, 22, 205, 7, 6, 1,
- 161, 2, 251, 102, 22, 56, 51, 7, 3, 1, 161, 2, 251, 102, 22, 56, 51, 7,
- 6, 1, 244, 81, 2, 244, 217, 46, 7, 3, 1, 244, 81, 2, 244, 217, 46, 7, 6,
- 1, 244, 81, 2, 56, 51, 7, 3, 1, 244, 81, 2, 56, 51, 7, 6, 1, 130, 2, 56,
- 51, 7, 3, 1, 130, 2, 56, 51, 7, 6, 1, 130, 2, 244, 217, 46, 7, 3, 1, 130,
- 2, 244, 217, 46, 7, 6, 1, 130, 2, 251, 102, 22, 155, 7, 3, 1, 130, 2,
- 251, 102, 22, 155, 7, 6, 1, 130, 2, 251, 102, 22, 245, 236, 7, 3, 1, 130,
- 2, 251, 102, 22, 245, 236, 7, 6, 1, 130, 2, 251, 102, 22, 244, 217, 46,
- 7, 3, 1, 130, 2, 251, 102, 22, 244, 217, 46, 7, 6, 1, 130, 2, 251, 102,
- 22, 205, 7, 3, 1, 130, 2, 251, 102, 22, 205, 7, 6, 1, 130, 2, 251, 102,
- 22, 56, 51, 7, 3, 1, 130, 2, 251, 102, 22, 56, 51, 7, 6, 1, 130, 2, 244,
- 161, 22, 155, 7, 3, 1, 130, 2, 244, 161, 22, 155, 7, 6, 1, 130, 2, 244,
- 161, 22, 245, 236, 7, 3, 1, 130, 2, 244, 161, 22, 245, 236, 7, 6, 1, 130,
- 2, 244, 161, 22, 244, 217, 46, 7, 3, 1, 130, 2, 244, 161, 22, 244, 217,
- 46, 7, 6, 1, 130, 2, 244, 161, 22, 205, 7, 3, 1, 130, 2, 244, 161, 22,
- 205, 7, 6, 1, 130, 2, 244, 161, 22, 56, 51, 7, 3, 1, 130, 2, 244, 161,
- 22, 56, 51, 7, 6, 1, 97, 2, 56, 51, 7, 3, 1, 97, 2, 56, 51, 7, 6, 1, 97,
- 2, 244, 217, 46, 7, 3, 1, 97, 2, 244, 217, 46, 7, 6, 1, 97, 2, 244, 161,
- 22, 155, 7, 3, 1, 97, 2, 244, 161, 22, 155, 7, 6, 1, 97, 2, 244, 161, 22,
- 245, 236, 7, 3, 1, 97, 2, 244, 161, 22, 245, 236, 7, 6, 1, 97, 2, 244,
- 161, 22, 244, 217, 46, 7, 3, 1, 97, 2, 244, 161, 22, 244, 217, 46, 7, 6,
- 1, 97, 2, 244, 161, 22, 205, 7, 3, 1, 97, 2, 244, 161, 22, 205, 7, 6, 1,
- 97, 2, 244, 161, 22, 56, 51, 7, 3, 1, 97, 2, 244, 161, 22, 56, 51, 7, 6,
- 1, 224, 26, 2, 245, 236, 7, 3, 1, 224, 26, 2, 245, 236, 7, 6, 1, 224, 26,
- 2, 56, 51, 7, 3, 1, 224, 26, 2, 56, 51, 7, 6, 1, 224, 26, 2, 244, 217,
- 46, 7, 3, 1, 224, 26, 2, 244, 217, 46, 7, 6, 1, 224, 26, 2, 205, 7, 3, 1,
- 224, 26, 2, 205, 7, 6, 1, 236, 153, 237, 149, 7, 3, 1, 236, 153, 237,
- 149, 7, 6, 1, 236, 153, 196, 7, 3, 1, 236, 153, 196, 7, 6, 1, 224, 26, 2,
- 237, 124, 7, 3, 1, 224, 26, 2, 237, 124, 19, 3, 1, 254, 206, 2, 232, 177,
- 19, 3, 1, 254, 206, 2, 250, 128, 19, 3, 1, 254, 206, 2, 186, 22, 225, 55,
- 19, 3, 1, 254, 206, 2, 172, 22, 225, 55, 19, 3, 1, 254, 206, 2, 186, 22,
- 233, 249, 19, 3, 1, 254, 206, 2, 172, 22, 233, 249, 19, 3, 1, 254, 206,
- 2, 186, 22, 233, 117, 19, 3, 1, 254, 206, 2, 172, 22, 233, 117, 19, 6, 1,
- 254, 206, 2, 232, 177, 19, 6, 1, 254, 206, 2, 250, 128, 19, 6, 1, 254,
- 206, 2, 186, 22, 225, 55, 19, 6, 1, 254, 206, 2, 172, 22, 225, 55, 19, 6,
- 1, 254, 206, 2, 186, 22, 233, 249, 19, 6, 1, 254, 206, 2, 172, 22, 233,
- 249, 19, 6, 1, 254, 206, 2, 186, 22, 233, 117, 19, 6, 1, 254, 206, 2,
- 172, 22, 233, 117, 19, 3, 1, 247, 207, 2, 232, 177, 19, 3, 1, 247, 207,
- 2, 250, 128, 19, 3, 1, 247, 207, 2, 186, 22, 225, 55, 19, 3, 1, 247, 207,
- 2, 172, 22, 225, 55, 19, 3, 1, 247, 207, 2, 186, 22, 233, 249, 19, 3, 1,
- 247, 207, 2, 172, 22, 233, 249, 19, 6, 1, 247, 207, 2, 232, 177, 19, 6,
- 1, 247, 207, 2, 250, 128, 19, 6, 1, 247, 207, 2, 186, 22, 225, 55, 19, 6,
- 1, 247, 207, 2, 172, 22, 225, 55, 19, 6, 1, 247, 207, 2, 186, 22, 233,
- 249, 19, 6, 1, 247, 207, 2, 172, 22, 233, 249, 19, 3, 1, 247, 172, 2,
- 232, 177, 19, 3, 1, 247, 172, 2, 250, 128, 19, 3, 1, 247, 172, 2, 186,
- 22, 225, 55, 19, 3, 1, 247, 172, 2, 172, 22, 225, 55, 19, 3, 1, 247, 172,
- 2, 186, 22, 233, 249, 19, 3, 1, 247, 172, 2, 172, 22, 233, 249, 19, 3, 1,
- 247, 172, 2, 186, 22, 233, 117, 19, 3, 1, 247, 172, 2, 172, 22, 233, 117,
- 19, 6, 1, 247, 172, 2, 232, 177, 19, 6, 1, 247, 172, 2, 250, 128, 19, 6,
- 1, 247, 172, 2, 186, 22, 225, 55, 19, 6, 1, 247, 172, 2, 172, 22, 225,
- 55, 19, 6, 1, 247, 172, 2, 186, 22, 233, 249, 19, 6, 1, 247, 172, 2, 172,
- 22, 233, 249, 19, 6, 1, 247, 172, 2, 186, 22, 233, 117, 19, 6, 1, 247,
- 172, 2, 172, 22, 233, 117, 19, 3, 1, 239, 216, 2, 232, 177, 19, 3, 1,
- 239, 216, 2, 250, 128, 19, 3, 1, 239, 216, 2, 186, 22, 225, 55, 19, 3, 1,
- 239, 216, 2, 172, 22, 225, 55, 19, 3, 1, 239, 216, 2, 186, 22, 233, 249,
- 19, 3, 1, 239, 216, 2, 172, 22, 233, 249, 19, 3, 1, 239, 216, 2, 186, 22,
- 233, 117, 19, 3, 1, 239, 216, 2, 172, 22, 233, 117, 19, 6, 1, 239, 216,
- 2, 232, 177, 19, 6, 1, 239, 216, 2, 250, 128, 19, 6, 1, 239, 216, 2, 186,
- 22, 225, 55, 19, 6, 1, 239, 216, 2, 172, 22, 225, 55, 19, 6, 1, 239, 216,
- 2, 186, 22, 233, 249, 19, 6, 1, 239, 216, 2, 172, 22, 233, 249, 19, 6, 1,
- 239, 216, 2, 186, 22, 233, 117, 19, 6, 1, 239, 216, 2, 172, 22, 233, 117,
- 19, 3, 1, 234, 65, 2, 232, 177, 19, 3, 1, 234, 65, 2, 250, 128, 19, 3, 1,
- 234, 65, 2, 186, 22, 225, 55, 19, 3, 1, 234, 65, 2, 172, 22, 225, 55, 19,
- 3, 1, 234, 65, 2, 186, 22, 233, 249, 19, 3, 1, 234, 65, 2, 172, 22, 233,
- 249, 19, 6, 1, 234, 65, 2, 232, 177, 19, 6, 1, 234, 65, 2, 250, 128, 19,
- 6, 1, 234, 65, 2, 186, 22, 225, 55, 19, 6, 1, 234, 65, 2, 172, 22, 225,
- 55, 19, 6, 1, 234, 65, 2, 186, 22, 233, 249, 19, 6, 1, 234, 65, 2, 172,
- 22, 233, 249, 19, 3, 1, 225, 111, 2, 232, 177, 19, 3, 1, 225, 111, 2,
- 250, 128, 19, 3, 1, 225, 111, 2, 186, 22, 225, 55, 19, 3, 1, 225, 111, 2,
- 172, 22, 225, 55, 19, 3, 1, 225, 111, 2, 186, 22, 233, 249, 19, 3, 1,
- 225, 111, 2, 172, 22, 233, 249, 19, 3, 1, 225, 111, 2, 186, 22, 233, 117,
- 19, 3, 1, 225, 111, 2, 172, 22, 233, 117, 19, 6, 1, 225, 111, 2, 250,
- 128, 19, 6, 1, 225, 111, 2, 172, 22, 225, 55, 19, 6, 1, 225, 111, 2, 172,
- 22, 233, 249, 19, 6, 1, 225, 111, 2, 172, 22, 233, 117, 19, 3, 1, 234,
- 67, 2, 232, 177, 19, 3, 1, 234, 67, 2, 250, 128, 19, 3, 1, 234, 67, 2,
- 186, 22, 225, 55, 19, 3, 1, 234, 67, 2, 172, 22, 225, 55, 19, 3, 1, 234,
- 67, 2, 186, 22, 233, 249, 19, 3, 1, 234, 67, 2, 172, 22, 233, 249, 19, 3,
- 1, 234, 67, 2, 186, 22, 233, 117, 19, 3, 1, 234, 67, 2, 172, 22, 233,
- 117, 19, 6, 1, 234, 67, 2, 232, 177, 19, 6, 1, 234, 67, 2, 250, 128, 19,
- 6, 1, 234, 67, 2, 186, 22, 225, 55, 19, 6, 1, 234, 67, 2, 172, 22, 225,
- 55, 19, 6, 1, 234, 67, 2, 186, 22, 233, 249, 19, 6, 1, 234, 67, 2, 172,
- 22, 233, 249, 19, 6, 1, 234, 67, 2, 186, 22, 233, 117, 19, 6, 1, 234, 67,
- 2, 172, 22, 233, 117, 19, 3, 1, 254, 206, 2, 225, 55, 19, 3, 1, 254, 206,
- 2, 233, 249, 19, 3, 1, 247, 207, 2, 225, 55, 19, 3, 1, 247, 207, 2, 233,
- 249, 19, 3, 1, 247, 172, 2, 225, 55, 19, 3, 1, 247, 172, 2, 233, 249, 19,
- 3, 1, 239, 216, 2, 225, 55, 19, 3, 1, 239, 216, 2, 233, 249, 19, 3, 1,
- 234, 65, 2, 225, 55, 19, 3, 1, 234, 65, 2, 233, 249, 19, 3, 1, 225, 111,
- 2, 225, 55, 19, 3, 1, 225, 111, 2, 233, 249, 19, 3, 1, 234, 67, 2, 225,
- 55, 19, 3, 1, 234, 67, 2, 233, 249, 19, 3, 1, 254, 206, 2, 186, 22, 223,
- 165, 19, 3, 1, 254, 206, 2, 172, 22, 223, 165, 19, 3, 1, 254, 206, 2,
- 186, 22, 225, 56, 22, 223, 165, 19, 3, 1, 254, 206, 2, 172, 22, 225, 56,
- 22, 223, 165, 19, 3, 1, 254, 206, 2, 186, 22, 233, 250, 22, 223, 165, 19,
- 3, 1, 254, 206, 2, 172, 22, 233, 250, 22, 223, 165, 19, 3, 1, 254, 206,
- 2, 186, 22, 233, 118, 22, 223, 165, 19, 3, 1, 254, 206, 2, 172, 22, 233,
- 118, 22, 223, 165, 19, 6, 1, 254, 206, 2, 186, 22, 232, 188, 19, 6, 1,
- 254, 206, 2, 172, 22, 232, 188, 19, 6, 1, 254, 206, 2, 186, 22, 225, 56,
- 22, 232, 188, 19, 6, 1, 254, 206, 2, 172, 22, 225, 56, 22, 232, 188, 19,
- 6, 1, 254, 206, 2, 186, 22, 233, 250, 22, 232, 188, 19, 6, 1, 254, 206,
- 2, 172, 22, 233, 250, 22, 232, 188, 19, 6, 1, 254, 206, 2, 186, 22, 233,
- 118, 22, 232, 188, 19, 6, 1, 254, 206, 2, 172, 22, 233, 118, 22, 232,
- 188, 19, 3, 1, 247, 172, 2, 186, 22, 223, 165, 19, 3, 1, 247, 172, 2,
- 172, 22, 223, 165, 19, 3, 1, 247, 172, 2, 186, 22, 225, 56, 22, 223, 165,
- 19, 3, 1, 247, 172, 2, 172, 22, 225, 56, 22, 223, 165, 19, 3, 1, 247,
- 172, 2, 186, 22, 233, 250, 22, 223, 165, 19, 3, 1, 247, 172, 2, 172, 22,
- 233, 250, 22, 223, 165, 19, 3, 1, 247, 172, 2, 186, 22, 233, 118, 22,
- 223, 165, 19, 3, 1, 247, 172, 2, 172, 22, 233, 118, 22, 223, 165, 19, 6,
- 1, 247, 172, 2, 186, 22, 232, 188, 19, 6, 1, 247, 172, 2, 172, 22, 232,
- 188, 19, 6, 1, 247, 172, 2, 186, 22, 225, 56, 22, 232, 188, 19, 6, 1,
- 247, 172, 2, 172, 22, 225, 56, 22, 232, 188, 19, 6, 1, 247, 172, 2, 186,
- 22, 233, 250, 22, 232, 188, 19, 6, 1, 247, 172, 2, 172, 22, 233, 250, 22,
- 232, 188, 19, 6, 1, 247, 172, 2, 186, 22, 233, 118, 22, 232, 188, 19, 6,
- 1, 247, 172, 2, 172, 22, 233, 118, 22, 232, 188, 19, 3, 1, 234, 67, 2,
- 186, 22, 223, 165, 19, 3, 1, 234, 67, 2, 172, 22, 223, 165, 19, 3, 1,
- 234, 67, 2, 186, 22, 225, 56, 22, 223, 165, 19, 3, 1, 234, 67, 2, 172,
- 22, 225, 56, 22, 223, 165, 19, 3, 1, 234, 67, 2, 186, 22, 233, 250, 22,
- 223, 165, 19, 3, 1, 234, 67, 2, 172, 22, 233, 250, 22, 223, 165, 19, 3,
- 1, 234, 67, 2, 186, 22, 233, 118, 22, 223, 165, 19, 3, 1, 234, 67, 2,
- 172, 22, 233, 118, 22, 223, 165, 19, 6, 1, 234, 67, 2, 186, 22, 232, 188,
- 19, 6, 1, 234, 67, 2, 172, 22, 232, 188, 19, 6, 1, 234, 67, 2, 186, 22,
- 225, 56, 22, 232, 188, 19, 6, 1, 234, 67, 2, 172, 22, 225, 56, 22, 232,
- 188, 19, 6, 1, 234, 67, 2, 186, 22, 233, 250, 22, 232, 188, 19, 6, 1,
- 234, 67, 2, 172, 22, 233, 250, 22, 232, 188, 19, 6, 1, 234, 67, 2, 186,
- 22, 233, 118, 22, 232, 188, 19, 6, 1, 234, 67, 2, 172, 22, 233, 118, 22,
- 232, 188, 19, 3, 1, 254, 206, 2, 224, 191, 19, 3, 1, 254, 206, 2, 237,
- 63, 19, 3, 1, 254, 206, 2, 225, 56, 22, 223, 165, 19, 3, 1, 254, 206, 2,
- 223, 165, 19, 3, 1, 254, 206, 2, 233, 250, 22, 223, 165, 19, 3, 1, 254,
- 206, 2, 233, 117, 19, 3, 1, 254, 206, 2, 233, 118, 22, 223, 165, 19, 6,
- 1, 254, 206, 2, 224, 191, 19, 6, 1, 254, 206, 2, 237, 63, 19, 6, 1, 254,
- 206, 2, 225, 55, 19, 6, 1, 254, 206, 2, 233, 249, 19, 6, 1, 254, 206, 2,
- 232, 188, 19, 238, 132, 19, 232, 188, 19, 232, 177, 19, 233, 117, 19,
- 249, 254, 22, 233, 117, 19, 3, 1, 247, 172, 2, 225, 56, 22, 223, 165, 19,
- 3, 1, 247, 172, 2, 223, 165, 19, 3, 1, 247, 172, 2, 233, 250, 22, 223,
- 165, 19, 3, 1, 247, 172, 2, 233, 117, 19, 3, 1, 247, 172, 2, 233, 118,
- 22, 223, 165, 19, 6, 1, 247, 207, 2, 225, 55, 19, 6, 1, 247, 207, 2, 233,
- 249, 19, 6, 1, 247, 172, 2, 225, 55, 19, 6, 1, 247, 172, 2, 233, 249, 19,
- 6, 1, 247, 172, 2, 232, 188, 19, 186, 22, 225, 55, 19, 186, 22, 233, 249,
- 19, 186, 22, 233, 117, 19, 3, 1, 239, 216, 2, 224, 191, 19, 3, 1, 239,
- 216, 2, 237, 63, 19, 3, 1, 239, 216, 2, 249, 254, 22, 225, 55, 19, 3, 1,
- 239, 216, 2, 249, 254, 22, 233, 249, 19, 3, 1, 239, 216, 2, 233, 117, 19,
- 3, 1, 239, 216, 2, 249, 254, 22, 233, 117, 19, 6, 1, 239, 216, 2, 224,
- 191, 19, 6, 1, 239, 216, 2, 237, 63, 19, 6, 1, 239, 216, 2, 225, 55, 19,
- 6, 1, 239, 216, 2, 233, 249, 19, 172, 22, 225, 55, 19, 172, 22, 233, 249,
- 19, 172, 22, 233, 117, 19, 3, 1, 225, 111, 2, 224, 191, 19, 3, 1, 225,
- 111, 2, 237, 63, 19, 3, 1, 225, 111, 2, 249, 254, 22, 225, 55, 19, 3, 1,
- 225, 111, 2, 249, 254, 22, 233, 249, 19, 3, 1, 231, 183, 2, 232, 177, 19,
- 3, 1, 231, 183, 2, 250, 128, 19, 3, 1, 225, 111, 2, 233, 117, 19, 3, 1,
- 225, 111, 2, 249, 254, 22, 233, 117, 19, 6, 1, 225, 111, 2, 224, 191, 19,
- 6, 1, 225, 111, 2, 237, 63, 19, 6, 1, 225, 111, 2, 225, 55, 19, 6, 1,
- 225, 111, 2, 233, 249, 19, 6, 1, 231, 183, 2, 250, 128, 19, 249, 254, 22,
- 225, 55, 19, 249, 254, 22, 233, 249, 19, 225, 55, 19, 3, 1, 234, 67, 2,
- 225, 56, 22, 223, 165, 19, 3, 1, 234, 67, 2, 223, 165, 19, 3, 1, 234, 67,
- 2, 233, 250, 22, 223, 165, 19, 3, 1, 234, 67, 2, 233, 117, 19, 3, 1, 234,
- 67, 2, 233, 118, 22, 223, 165, 19, 6, 1, 234, 65, 2, 225, 55, 19, 6, 1,
- 234, 65, 2, 233, 249, 19, 6, 1, 234, 67, 2, 225, 55, 19, 6, 1, 234, 67,
- 2, 233, 249, 19, 6, 1, 234, 67, 2, 232, 188, 19, 233, 249, 19, 250, 128,
- 247, 240, 232, 81, 247, 248, 232, 81, 247, 240, 228, 145, 247, 248, 228,
- 145, 226, 189, 228, 145, 246, 241, 228, 145, 228, 215, 228, 145, 247, 61,
- 228, 145, 232, 171, 228, 145, 226, 215, 228, 145, 245, 158, 228, 145,
- 223, 90, 224, 115, 228, 145, 223, 90, 224, 115, 234, 255, 223, 90, 224,
- 115, 239, 112, 237, 231, 76, 231, 147, 76, 244, 95, 235, 0, 244, 95, 247,
- 61, 250, 130, 247, 240, 250, 130, 247, 248, 250, 130, 169, 125, 47, 61,
- 237, 170, 47, 184, 237, 170, 42, 228, 241, 232, 57, 76, 41, 228, 241,
- 232, 57, 76, 228, 241, 237, 116, 232, 57, 76, 228, 241, 245, 62, 232, 57,
- 76, 42, 47, 232, 57, 76, 41, 47, 232, 57, 76, 47, 237, 116, 232, 57, 76,
- 47, 245, 62, 232, 57, 76, 250, 174, 47, 250, 174, 252, 83, 226, 75, 252,
- 83, 168, 56, 237, 242, 135, 56, 237, 242, 169, 247, 249, 244, 93, 232,
- 254, 237, 171, 229, 173, 233, 192, 229, 173, 237, 231, 247, 246, 231,
- 147, 247, 246, 232, 243, 249, 200, 246, 249, 237, 231, 234, 0, 231, 147,
- 234, 0, 235, 229, 235, 5, 228, 145, 233, 124, 236, 130, 53, 233, 124,
- 227, 24, 226, 195, 53, 232, 205, 47, 232, 205, 226, 66, 232, 205, 200,
- 232, 205, 200, 47, 232, 205, 200, 226, 66, 232, 205, 252, 9, 228, 241,
- 237, 235, 254, 182, 232, 57, 76, 228, 241, 231, 151, 254, 182, 232, 57,
- 76, 231, 228, 76, 47, 247, 149, 76, 239, 230, 234, 1, 225, 130, 116, 226,
- 170, 252, 10, 239, 244, 232, 254, 254, 67, 244, 96, 252, 83, 246, 235,
- 228, 194, 42, 37, 252, 115, 2, 232, 65, 41, 37, 252, 115, 2, 232, 65, 47,
- 232, 69, 76, 232, 69, 247, 149, 76, 247, 149, 232, 69, 76, 226, 145, 5,
- 247, 173, 200, 233, 38, 53, 86, 117, 252, 83, 86, 81, 252, 83, 184, 254,
- 69, 200, 229, 186, 251, 83, 225, 116, 135, 254, 68, 254, 218, 224, 235,
- 251, 53, 236, 121, 53, 227, 187, 250, 130, 239, 223, 225, 130, 247, 13,
- 232, 171, 76, 152, 56, 232, 170, 232, 78, 232, 205, 246, 243, 56, 232,
- 170, 247, 37, 56, 232, 170, 135, 56, 232, 170, 246, 243, 56, 76, 248,
- 138, 250, 243, 226, 74, 61, 246, 243, 249, 138, 236, 228, 12, 228, 145,
- 224, 92, 239, 112, 246, 216, 254, 141, 239, 221, 226, 156, 239, 221, 229,
- 173, 239, 221, 233, 10, 239, 253, 227, 136, 227, 198, 255, 35, 227, 136,
- 227, 198, 239, 253, 10, 211, 229, 127, 255, 35, 10, 211, 229, 127, 235,
- 225, 21, 229, 128, 235, 1, 21, 229, 128, 227, 219, 223, 89, 227, 219, 7,
- 3, 1, 74, 227, 219, 158, 227, 219, 173, 227, 219, 183, 227, 219, 194,
- 227, 219, 187, 227, 219, 192, 227, 219, 79, 53, 227, 219, 236, 120, 227,
- 219, 247, 204, 53, 227, 219, 42, 233, 180, 227, 219, 41, 233, 180, 227,
- 219, 7, 3, 1, 199, 227, 253, 223, 89, 227, 253, 118, 227, 253, 113, 227,
- 253, 166, 227, 253, 158, 227, 253, 173, 227, 253, 183, 227, 253, 194,
- 227, 253, 187, 227, 253, 192, 227, 253, 79, 53, 227, 253, 236, 120, 227,
- 253, 247, 204, 53, 227, 253, 42, 233, 180, 227, 253, 41, 233, 180, 7,
- 227, 253, 3, 1, 57, 7, 227, 253, 3, 1, 72, 7, 227, 253, 3, 1, 73, 7, 227,
- 253, 3, 1, 224, 73, 7, 227, 253, 3, 1, 230, 222, 247, 160, 53, 251, 62,
- 53, 250, 237, 53, 246, 229, 246, 231, 53, 237, 159, 53, 236, 131, 53,
- 235, 242, 53, 233, 108, 53, 231, 54, 53, 224, 100, 53, 139, 229, 100, 53,
- 249, 147, 53, 247, 161, 53, 238, 187, 53, 225, 246, 53, 248, 122, 53,
- 246, 111, 233, 131, 53, 233, 106, 53, 245, 215, 53, 254, 45, 53, 244,
- 148, 53, 251, 228, 53, 36, 42, 245, 136, 46, 36, 41, 245, 136, 46, 36,
- 182, 61, 237, 171, 234, 2, 36, 229, 63, 61, 237, 171, 234, 2, 36, 254,
- 168, 67, 46, 36, 251, 84, 67, 46, 36, 42, 67, 46, 36, 41, 67, 46, 36,
- 231, 140, 234, 2, 36, 251, 84, 231, 140, 234, 2, 36, 254, 168, 231, 140,
- 234, 2, 36, 152, 197, 46, 36, 246, 243, 197, 46, 36, 247, 236, 251, 106,
- 36, 247, 236, 228, 120, 36, 247, 236, 249, 250, 36, 247, 236, 251, 107,
- 253, 63, 36, 42, 41, 67, 46, 36, 247, 236, 230, 218, 36, 247, 236, 238,
- 230, 36, 247, 236, 225, 108, 232, 251, 226, 78, 36, 231, 193, 228, 162,
- 234, 2, 36, 47, 61, 195, 234, 2, 36, 254, 174, 98, 36, 226, 66, 225, 132,
- 36, 224, 117, 252, 102, 46, 36, 117, 67, 234, 2, 36, 182, 47, 228, 162,
- 234, 2, 36, 81, 245, 136, 2, 171, 248, 124, 36, 117, 245, 136, 2, 171,
- 248, 124, 36, 42, 67, 51, 36, 41, 67, 51, 36, 254, 70, 46, 255, 39, 234,
- 87, 255, 26, 180, 226, 240, 228, 1, 159, 6, 252, 44, 250, 62, 251, 222,
- 251, 219, 237, 171, 98, 252, 11, 234, 87, 252, 36, 225, 137, 247, 162,
- 251, 30, 230, 216, 250, 62, 247, 116, 95, 3, 214, 95, 6, 212, 252, 148,
- 6, 212, 159, 6, 212, 233, 20, 251, 30, 233, 20, 251, 31, 107, 135, 233,
- 69, 95, 6, 74, 252, 148, 6, 74, 95, 6, 149, 95, 3, 149, 238, 47, 45, 253,
- 36, 98, 159, 6, 199, 234, 196, 53, 228, 155, 231, 238, 251, 12, 95, 6,
- 233, 244, 159, 6, 233, 244, 159, 6, 232, 139, 95, 6, 146, 252, 148, 6,
- 146, 159, 6, 146, 232, 209, 227, 83, 231, 200, 229, 169, 76, 227, 29, 53,
- 226, 94, 165, 53, 225, 31, 159, 6, 223, 119, 234, 12, 53, 234, 82, 53,
- 239, 223, 234, 82, 53, 252, 148, 6, 223, 119, 209, 19, 3, 1, 239, 215,
- 238, 250, 53, 254, 180, 53, 95, 6, 254, 27, 252, 148, 6, 252, 44, 247,
- 176, 98, 95, 3, 72, 95, 6, 72, 95, 6, 247, 130, 209, 6, 247, 130, 95, 6,
- 185, 95, 3, 73, 92, 98, 252, 201, 98, 246, 35, 98, 250, 161, 98, 240, 1,
- 228, 153, 231, 106, 6, 232, 139, 247, 118, 53, 159, 3, 233, 69, 159, 3,
- 246, 169, 159, 6, 246, 169, 159, 6, 233, 69, 159, 236, 4, 227, 230, 209,
- 30, 6, 214, 209, 30, 6, 149, 200, 30, 6, 149, 209, 30, 6, 224, 25, 159,
- 27, 6, 222, 222, 159, 27, 3, 222, 222, 159, 27, 3, 72, 159, 27, 3, 74,
- 159, 27, 3, 239, 182, 232, 191, 237, 170, 209, 254, 193, 233, 124, 53,
- 254, 235, 209, 3, 247, 130, 14, 32, 231, 4, 228, 153, 224, 189, 246, 235,
- 168, 226, 213, 224, 189, 246, 235, 135, 226, 211, 224, 189, 246, 235,
- 168, 247, 66, 224, 189, 246, 235, 135, 247, 65, 224, 189, 246, 235, 152,
- 247, 65, 224, 189, 246, 235, 246, 243, 247, 65, 224, 189, 246, 235, 168,
- 228, 210, 224, 189, 246, 235, 247, 37, 228, 208, 224, 189, 246, 235, 168,
- 248, 16, 224, 189, 246, 235, 152, 248, 14, 224, 189, 246, 235, 247, 37,
- 248, 14, 224, 189, 246, 235, 229, 163, 248, 14, 246, 235, 234, 197, 118,
- 231, 115, 207, 118, 231, 115, 207, 113, 231, 115, 207, 166, 231, 115,
- 207, 158, 231, 115, 207, 173, 231, 115, 207, 183, 231, 115, 207, 194,
- 231, 115, 207, 187, 231, 115, 207, 192, 231, 115, 207, 227, 23, 231, 115,
- 207, 247, 252, 231, 115, 207, 225, 218, 231, 115, 207, 247, 63, 231, 115,
- 207, 168, 244, 135, 231, 115, 207, 247, 37, 244, 135, 231, 115, 207, 168,
- 226, 194, 3, 231, 115, 207, 118, 3, 231, 115, 207, 113, 3, 231, 115, 207,
- 166, 3, 231, 115, 207, 158, 3, 231, 115, 207, 173, 3, 231, 115, 207, 183,
- 3, 231, 115, 207, 194, 3, 231, 115, 207, 187, 3, 231, 115, 207, 192, 3,
- 231, 115, 207, 227, 23, 3, 231, 115, 207, 247, 252, 3, 231, 115, 207,
- 225, 218, 3, 231, 115, 207, 247, 63, 3, 231, 115, 207, 168, 244, 135, 3,
- 231, 115, 207, 247, 37, 244, 135, 3, 231, 115, 207, 168, 226, 194, 231,
- 115, 207, 168, 226, 195, 252, 45, 222, 222, 231, 115, 207, 247, 37, 226,
- 194, 231, 115, 207, 227, 24, 226, 194, 231, 115, 207, 200, 168, 244, 135,
- 7, 3, 1, 200, 252, 44, 231, 115, 207, 228, 217, 238, 3, 15, 231, 115,
- 207, 247, 64, 248, 50, 15, 231, 115, 207, 247, 64, 226, 194, 231, 115,
- 207, 168, 244, 136, 226, 194, 117, 58, 225, 106, 58, 81, 58, 248, 125,
- 58, 42, 41, 58, 99, 103, 58, 234, 245, 224, 131, 58, 234, 245, 248, 45,
- 58, 228, 152, 248, 45, 58, 228, 152, 224, 131, 58, 117, 67, 2, 82, 81,
- 67, 2, 82, 117, 224, 148, 58, 81, 224, 148, 58, 117, 135, 245, 117, 58,
- 225, 106, 135, 245, 117, 58, 81, 135, 245, 117, 58, 248, 125, 135, 245,
- 117, 58, 117, 67, 2, 227, 89, 81, 67, 2, 227, 89, 117, 67, 246, 224, 125,
- 225, 106, 67, 246, 224, 125, 81, 67, 246, 224, 125, 248, 125, 67, 246,
- 224, 125, 99, 103, 67, 2, 253, 24, 117, 67, 2, 88, 81, 67, 2, 88, 117,
- 67, 2, 237, 124, 81, 67, 2, 237, 124, 42, 41, 224, 148, 58, 42, 41, 67,
- 2, 82, 248, 125, 223, 38, 58, 225, 106, 67, 2, 226, 151, 237, 230, 225,
- 106, 67, 2, 226, 151, 231, 145, 248, 125, 67, 2, 226, 151, 237, 230, 248,
- 125, 67, 2, 226, 151, 231, 145, 81, 67, 2, 251, 11, 248, 124, 248, 125,
- 67, 2, 251, 11, 237, 230, 254, 168, 226, 106, 229, 189, 58, 251, 84, 226,
- 106, 229, 189, 58, 234, 245, 224, 131, 67, 180, 182, 125, 117, 67, 180,
- 253, 36, 107, 81, 67, 180, 125, 254, 168, 234, 44, 251, 107, 58, 251, 84,
- 234, 44, 251, 107, 58, 117, 245, 136, 2, 171, 225, 105, 117, 245, 136, 2,
- 171, 248, 124, 225, 106, 245, 136, 2, 171, 231, 145, 225, 106, 245, 136,
- 2, 171, 237, 230, 81, 245, 136, 2, 171, 225, 105, 81, 245, 136, 2, 171,
- 248, 124, 248, 125, 245, 136, 2, 171, 231, 145, 248, 125, 245, 136, 2,
- 171, 237, 230, 81, 67, 107, 117, 58, 225, 106, 67, 117, 106, 248, 125,
- 58, 117, 67, 107, 81, 58, 117, 233, 232, 254, 92, 225, 106, 233, 232,
- 254, 92, 81, 233, 232, 254, 92, 248, 125, 233, 232, 254, 92, 117, 245,
- 136, 107, 81, 245, 135, 81, 245, 136, 107, 117, 245, 135, 117, 47, 67, 2,
- 82, 42, 41, 47, 67, 2, 82, 81, 47, 67, 2, 82, 117, 47, 58, 225, 106, 47,
- 58, 81, 47, 58, 248, 125, 47, 58, 42, 41, 47, 58, 99, 103, 47, 58, 234,
- 245, 224, 131, 47, 58, 234, 245, 248, 45, 47, 58, 228, 152, 248, 45, 47,
- 58, 228, 152, 224, 131, 47, 58, 117, 226, 66, 58, 81, 226, 66, 58, 117,
- 228, 115, 58, 81, 228, 115, 58, 225, 106, 67, 2, 47, 82, 248, 125, 67, 2,
- 47, 82, 117, 250, 129, 58, 225, 106, 250, 129, 58, 81, 250, 129, 58, 248,
- 125, 250, 129, 58, 117, 67, 180, 125, 81, 67, 180, 125, 117, 63, 58, 225,
- 106, 63, 58, 81, 63, 58, 248, 125, 63, 58, 225, 106, 63, 67, 246, 224,
- 125, 225, 106, 63, 67, 234, 62, 233, 146, 225, 106, 63, 67, 234, 62, 233,
- 147, 2, 169, 125, 225, 106, 63, 67, 234, 62, 233, 147, 2, 61, 125, 225,
- 106, 63, 47, 58, 225, 106, 63, 47, 67, 234, 62, 233, 146, 81, 63, 67,
- 246, 224, 224, 165, 234, 245, 224, 131, 67, 180, 251, 10, 228, 152, 248,
- 45, 67, 180, 251, 10, 99, 103, 63, 58, 41, 67, 2, 3, 251, 106, 248, 125,
- 67, 117, 106, 225, 106, 58, 152, 81, 254, 92, 117, 67, 2, 61, 82, 81, 67,
- 2, 61, 82, 42, 41, 67, 2, 61, 82, 117, 67, 2, 47, 61, 82, 81, 67, 2, 47,
- 61, 82, 42, 41, 67, 2, 47, 61, 82, 117, 234, 42, 58, 81, 234, 42, 58, 42,
- 41, 234, 42, 58, 32, 254, 216, 251, 50, 233, 175, 249, 236, 226, 231,
- 247, 145, 226, 231, 249, 154, 190, 247, 146, 247, 241, 229, 164, 240, 10,
- 235, 250, 247, 254, 234, 87, 190, 254, 191, 247, 254, 234, 87, 3, 247,
- 254, 234, 87, 251, 26, 254, 87, 236, 213, 249, 154, 190, 251, 28, 254,
- 87, 236, 213, 3, 251, 26, 254, 87, 236, 213, 247, 233, 106, 232, 193,
- 236, 4, 232, 200, 236, 4, 251, 15, 236, 4, 227, 230, 236, 121, 53, 236,
- 119, 53, 56, 233, 10, 249, 181, 228, 194, 229, 165, 236, 120, 254, 70,
- 234, 37, 231, 140, 234, 37, 252, 84, 234, 37, 37, 231, 111, 250, 232,
- 231, 111, 246, 237, 231, 111, 232, 189, 96, 240, 3, 41, 254, 181, 254,
- 181, 236, 232, 254, 181, 228, 137, 254, 181, 249, 183, 249, 154, 190,
- 249, 186, 233, 185, 96, 190, 233, 185, 96, 237, 138, 254, 186, 237, 138,
- 234, 31, 239, 227, 225, 127, 239, 239, 47, 239, 239, 226, 66, 239, 239,
- 251, 22, 239, 239, 227, 209, 239, 239, 224, 199, 239, 239, 251, 84, 239,
- 239, 251, 84, 251, 22, 239, 239, 254, 168, 251, 22, 239, 239, 226, 230,
- 252, 233, 231, 252, 232, 190, 56, 236, 120, 247, 150, 246, 117, 232, 190,
- 244, 220, 226, 159, 234, 37, 200, 205, 239, 223, 237, 250, 193, 228, 242,
- 224, 147, 224, 86, 232, 200, 190, 205, 236, 121, 205, 254, 65, 105, 96,
- 190, 254, 65, 105, 96, 254, 137, 105, 96, 254, 137, 252, 64, 190, 255,
- 34, 105, 96, 235, 156, 254, 137, 234, 248, 255, 34, 105, 96, 254, 210,
- 105, 96, 190, 254, 210, 105, 96, 254, 210, 105, 145, 105, 96, 226, 66,
- 205, 254, 217, 105, 96, 247, 200, 96, 246, 116, 247, 200, 96, 249, 237,
- 252, 195, 254, 139, 226, 240, 237, 178, 246, 116, 105, 96, 254, 137, 105,
- 180, 145, 226, 240, 240, 29, 234, 87, 240, 29, 106, 145, 254, 137, 105,
- 96, 251, 62, 247, 203, 247, 204, 251, 61, 231, 140, 240, 17, 105, 96,
- 231, 140, 105, 96, 251, 4, 96, 247, 175, 247, 202, 96, 228, 59, 247, 203,
- 250, 48, 105, 96, 105, 180, 252, 55, 250, 63, 236, 232, 252, 54, 232, 67,
- 105, 96, 190, 105, 96, 244, 63, 96, 190, 244, 63, 96, 228, 25, 247, 200,
- 96, 237, 213, 145, 105, 96, 245, 231, 145, 105, 96, 237, 213, 107, 105,
- 96, 245, 231, 107, 105, 96, 237, 213, 252, 64, 190, 105, 96, 245, 231,
- 252, 64, 190, 105, 96, 236, 62, 237, 212, 236, 62, 245, 230, 252, 195,
- 190, 247, 200, 96, 190, 237, 212, 190, 245, 230, 235, 156, 237, 213, 234,
- 248, 105, 96, 235, 156, 245, 231, 234, 248, 105, 96, 237, 213, 145, 247,
- 200, 96, 245, 231, 145, 247, 200, 96, 235, 156, 237, 213, 234, 248, 247,
- 200, 96, 235, 156, 245, 231, 234, 248, 247, 200, 96, 237, 213, 145, 245,
- 230, 245, 231, 145, 237, 212, 235, 156, 237, 213, 234, 248, 245, 230,
- 235, 156, 245, 231, 234, 248, 237, 212, 232, 213, 227, 243, 232, 214,
- 145, 105, 96, 227, 244, 145, 105, 96, 232, 214, 145, 247, 200, 96, 227,
- 244, 145, 247, 200, 96, 249, 154, 190, 232, 216, 249, 154, 190, 227, 245,
- 227, 252, 234, 87, 227, 218, 234, 87, 190, 102, 227, 252, 234, 87, 190,
- 102, 227, 218, 234, 87, 227, 252, 106, 145, 105, 96, 227, 218, 106, 145,
- 105, 96, 235, 156, 102, 227, 252, 106, 234, 248, 105, 96, 235, 156, 102,
- 227, 218, 106, 234, 248, 105, 96, 227, 252, 106, 2, 190, 105, 96, 227,
- 218, 106, 2, 190, 105, 96, 236, 49, 236, 50, 236, 51, 236, 50, 225, 127,
- 37, 240, 29, 234, 87, 37, 234, 27, 234, 87, 37, 240, 29, 106, 145, 105,
- 96, 37, 234, 27, 106, 145, 105, 96, 37, 252, 16, 37, 250, 226, 33, 233,
- 10, 33, 236, 120, 33, 226, 156, 33, 249, 181, 228, 194, 33, 56, 234, 37,
- 33, 231, 140, 234, 37, 33, 254, 70, 234, 37, 33, 247, 203, 33, 250, 130,
- 228, 119, 233, 10, 228, 119, 236, 120, 228, 119, 226, 156, 228, 119, 56,
- 234, 37, 41, 227, 96, 42, 227, 96, 103, 227, 96, 99, 227, 96, 254, 73,
- 236, 100, 226, 51, 246, 253, 226, 66, 61, 253, 36, 41, 225, 232, 47, 61,
- 253, 36, 47, 41, 225, 232, 249, 154, 190, 232, 185, 190, 226, 51, 249,
- 154, 190, 246, 254, 235, 159, 47, 61, 253, 36, 47, 41, 225, 232, 232,
- 214, 225, 134, 231, 221, 227, 244, 225, 134, 231, 221, 234, 246, 228, 4,
- 234, 87, 251, 26, 254, 87, 234, 246, 228, 3, 234, 246, 228, 4, 106, 145,
- 105, 96, 251, 26, 254, 87, 234, 246, 228, 4, 145, 105, 96, 234, 27, 234,
- 87, 240, 29, 234, 87, 236, 55, 245, 93, 251, 36, 237, 0, 239, 236, 224,
- 52, 235, 235, 234, 247, 41, 254, 182, 2, 254, 122, 41, 226, 78, 236, 4,
- 237, 138, 254, 186, 236, 4, 237, 138, 234, 31, 236, 4, 239, 227, 236, 4,
- 225, 127, 249, 251, 234, 37, 56, 234, 37, 228, 59, 234, 37, 249, 181,
- 226, 156, 252, 119, 42, 234, 246, 247, 117, 229, 185, 232, 200, 41, 234,
- 246, 247, 117, 229, 185, 232, 200, 42, 229, 185, 232, 200, 41, 229, 185,
- 232, 200, 200, 226, 159, 247, 203, 250, 223, 237, 138, 234, 31, 250, 223,
- 237, 138, 254, 186, 47, 227, 251, 47, 227, 217, 47, 239, 227, 47, 225,
- 127, 233, 28, 105, 22, 233, 185, 96, 237, 213, 2, 249, 140, 245, 231, 2,
- 249, 140, 224, 234, 236, 62, 237, 212, 224, 234, 236, 62, 245, 230, 237,
- 213, 105, 180, 145, 245, 230, 245, 231, 105, 180, 145, 237, 212, 105,
- 180, 145, 237, 212, 105, 180, 145, 245, 230, 105, 180, 145, 232, 213,
- 105, 180, 145, 227, 243, 249, 154, 190, 232, 217, 145, 247, 205, 249,
- 154, 190, 227, 246, 145, 247, 205, 190, 37, 240, 29, 106, 145, 105, 96,
- 190, 37, 234, 27, 106, 145, 105, 96, 37, 240, 29, 106, 145, 190, 105, 96,
- 37, 234, 27, 106, 145, 190, 105, 96, 237, 213, 252, 64, 190, 247, 200,
- 96, 245, 231, 252, 64, 190, 247, 200, 96, 232, 214, 252, 64, 190, 247,
- 200, 96, 227, 244, 252, 64, 190, 247, 200, 96, 190, 234, 246, 228, 4,
- 234, 87, 249, 154, 190, 251, 28, 254, 87, 234, 246, 228, 3, 190, 234,
- 246, 228, 4, 106, 145, 105, 96, 249, 154, 190, 251, 28, 254, 87, 234,
- 246, 228, 4, 145, 247, 205, 61, 247, 249, 236, 152, 169, 247, 249, 99,
- 41, 250, 1, 247, 249, 103, 41, 250, 1, 247, 249, 247, 254, 106, 2, 182,
- 169, 82, 247, 254, 106, 2, 61, 253, 36, 254, 63, 247, 233, 106, 169, 82,
- 3, 247, 254, 106, 2, 61, 253, 36, 254, 63, 247, 233, 106, 169, 82, 247,
- 254, 106, 2, 56, 46, 247, 254, 106, 2, 234, 5, 3, 247, 254, 106, 2, 234,
- 5, 247, 254, 106, 2, 225, 133, 247, 254, 106, 2, 135, 169, 228, 10, 251,
- 26, 2, 182, 169, 82, 251, 26, 2, 61, 253, 36, 254, 63, 247, 233, 106,
- 169, 82, 3, 251, 26, 2, 61, 253, 36, 254, 63, 247, 233, 106, 169, 82,
- 251, 26, 2, 234, 5, 3, 251, 26, 2, 234, 5, 223, 120, 150, 253, 59, 236,
- 212, 249, 252, 53, 248, 0, 58, 244, 153, 99, 254, 93, 103, 254, 93, 232,
- 196, 233, 111, 224, 146, 237, 170, 42, 251, 224, 41, 251, 224, 42, 247,
- 17, 41, 247, 17, 252, 126, 41, 250, 245, 252, 126, 42, 250, 245, 226,
- 106, 41, 250, 245, 226, 106, 42, 250, 245, 200, 190, 53, 37, 237, 113,
- 254, 122, 230, 199, 230, 204, 227, 29, 231, 239, 232, 239, 240, 7, 224,
- 222, 228, 120, 233, 23, 106, 239, 235, 53, 209, 190, 53, 224, 153, 244,
- 154, 226, 106, 42, 251, 10, 226, 106, 41, 251, 10, 252, 126, 42, 251, 10,
- 252, 126, 41, 251, 10, 226, 106, 132, 239, 239, 252, 126, 132, 239, 239,
- 246, 222, 228, 180, 99, 254, 94, 252, 196, 135, 169, 253, 26, 234, 32,
- 238, 232, 247, 196, 180, 226, 240, 231, 153, 224, 74, 240, 17, 102, 231,
- 237, 252, 118, 238, 231, 237, 235, 254, 182, 104, 231, 151, 254, 182,
- 104, 247, 196, 180, 226, 240, 237, 237, 252, 207, 231, 139, 250, 200,
- 254, 217, 254, 101, 227, 135, 226, 98, 231, 59, 249, 219, 234, 28, 251,
- 38, 227, 68, 228, 189, 251, 1, 251, 0, 162, 163, 14, 244, 78, 162, 163,
- 14, 228, 113, 232, 81, 162, 163, 14, 232, 82, 247, 205, 162, 163, 14,
- 232, 82, 249, 186, 162, 163, 14, 232, 82, 249, 250, 162, 163, 14, 232,
- 82, 239, 105, 162, 163, 14, 232, 82, 251, 106, 162, 163, 14, 251, 107,
- 228, 44, 162, 163, 14, 251, 107, 239, 105, 162, 163, 14, 228, 195, 125,
- 162, 163, 14, 253, 64, 125, 162, 163, 14, 232, 82, 228, 194, 162, 163,
- 14, 232, 82, 253, 63, 162, 163, 14, 232, 82, 237, 212, 162, 163, 14, 232,
- 82, 245, 230, 162, 163, 14, 117, 225, 60, 162, 163, 14, 81, 225, 60, 162,
- 163, 14, 232, 82, 117, 58, 162, 163, 14, 232, 82, 81, 58, 162, 163, 14,
- 251, 107, 253, 63, 162, 163, 14, 103, 227, 97, 225, 133, 162, 163, 14,
- 250, 48, 228, 44, 162, 163, 14, 232, 82, 103, 252, 9, 162, 163, 14, 232,
- 82, 250, 47, 162, 163, 14, 103, 227, 97, 239, 105, 162, 163, 14, 225,
- 106, 225, 60, 162, 163, 14, 232, 82, 225, 106, 58, 162, 163, 14, 99, 227,
- 97, 234, 5, 162, 163, 14, 250, 57, 228, 44, 162, 163, 14, 232, 82, 99,
- 252, 9, 162, 163, 14, 232, 82, 250, 56, 162, 163, 14, 99, 227, 97, 239,
- 105, 162, 163, 14, 248, 125, 225, 60, 162, 163, 14, 232, 82, 248, 125,
- 58, 162, 163, 14, 232, 56, 225, 133, 162, 163, 14, 250, 48, 225, 133,
- 162, 163, 14, 249, 251, 225, 133, 162, 163, 14, 239, 106, 225, 133, 162,
- 163, 14, 251, 107, 225, 133, 162, 163, 14, 99, 229, 69, 239, 105, 162,
- 163, 14, 232, 56, 232, 81, 162, 163, 14, 251, 107, 228, 58, 162, 163, 14,
- 232, 82, 251, 61, 162, 163, 14, 99, 227, 97, 219, 162, 163, 14, 250, 57,
- 219, 162, 163, 14, 228, 59, 219, 162, 163, 14, 239, 106, 219, 162, 163,
- 14, 251, 107, 219, 162, 163, 14, 103, 229, 69, 228, 44, 162, 163, 14, 42,
- 229, 69, 228, 44, 162, 163, 14, 226, 159, 219, 162, 163, 14, 245, 231,
- 219, 162, 163, 14, 251, 55, 125, 162, 163, 14, 250, 57, 205, 162, 163,
- 14, 223, 37, 162, 163, 14, 228, 45, 205, 162, 163, 14, 229, 187, 225,
- 133, 162, 163, 14, 232, 82, 190, 247, 205, 162, 163, 14, 232, 82, 232,
- 68, 162, 163, 14, 103, 252, 10, 205, 162, 163, 14, 99, 252, 10, 205, 162,
- 163, 14, 239, 215, 162, 163, 14, 231, 182, 162, 163, 14, 234, 66, 162,
- 163, 14, 254, 206, 225, 133, 162, 163, 14, 247, 207, 225, 133, 162, 163,
- 14, 239, 216, 225, 133, 162, 163, 14, 234, 67, 225, 133, 162, 163, 14,
- 254, 205, 190, 251, 181, 76, 41, 254, 182, 2, 248, 125, 223, 38, 58, 229,
- 48, 234, 44, 252, 118, 252, 216, 98, 61, 237, 171, 2, 236, 154, 249, 140,
- 239, 244, 98, 251, 23, 225, 131, 98, 249, 197, 225, 131, 98, 247, 243,
- 98, 251, 46, 98, 63, 37, 2, 251, 219, 61, 237, 170, 247, 223, 98, 254,
- 201, 238, 233, 98, 245, 103, 98, 33, 169, 253, 36, 2, 234, 241, 33, 226,
- 79, 248, 127, 252, 99, 251, 107, 2, 234, 244, 58, 225, 129, 98, 236, 89,
- 98, 244, 91, 98, 234, 43, 245, 171, 98, 234, 43, 238, 45, 98, 233, 170,
- 98, 233, 169, 98, 249, 201, 250, 221, 14, 211, 113, 228, 164, 98, 162,
- 163, 14, 232, 81, 250, 71, 229, 174, 238, 233, 98, 232, 207, 233, 233,
- 235, 142, 233, 233, 232, 204, 230, 219, 98, 251, 94, 230, 219, 98, 42,
- 233, 181, 225, 113, 88, 42, 233, 181, 247, 141, 42, 233, 181, 203, 88,
- 41, 233, 181, 225, 113, 88, 41, 233, 181, 247, 141, 41, 233, 181, 203,
- 88, 42, 37, 252, 115, 225, 113, 251, 10, 42, 37, 252, 115, 247, 141, 42,
- 37, 252, 115, 203, 251, 10, 41, 37, 252, 115, 225, 113, 251, 10, 41, 37,
- 252, 115, 247, 141, 41, 37, 252, 115, 203, 251, 10, 42, 250, 223, 252,
- 115, 225, 113, 88, 42, 250, 223, 252, 115, 236, 154, 233, 63, 42, 250,
- 223, 252, 115, 203, 88, 250, 223, 252, 115, 247, 141, 41, 250, 223, 252,
- 115, 225, 113, 88, 41, 250, 223, 252, 115, 236, 154, 233, 63, 41, 250,
- 223, 252, 115, 203, 88, 239, 240, 247, 141, 169, 237, 171, 247, 141, 225,
- 113, 42, 145, 203, 41, 250, 223, 252, 115, 230, 205, 225, 113, 41, 145,
- 203, 42, 250, 223, 252, 115, 230, 205, 227, 231, 226, 105, 227, 231, 252,
- 125, 226, 106, 37, 104, 252, 126, 37, 104, 252, 126, 37, 252, 115, 107,
- 226, 106, 37, 104, 29, 14, 252, 125, 42, 61, 77, 237, 170, 41, 61, 77,
- 237, 170, 169, 230, 228, 237, 169, 169, 230, 228, 237, 168, 169, 230,
- 228, 237, 167, 169, 230, 228, 237, 166, 250, 40, 14, 157, 61, 22, 226,
- 106, 231, 153, 250, 40, 14, 157, 61, 22, 252, 126, 231, 153, 250, 40, 14,
- 157, 61, 2, 251, 106, 250, 40, 14, 157, 103, 22, 169, 2, 251, 106, 250,
- 40, 14, 157, 99, 22, 169, 2, 251, 106, 250, 40, 14, 157, 61, 2, 226, 78,
- 250, 40, 14, 157, 103, 22, 169, 2, 226, 78, 250, 40, 14, 157, 99, 22,
- 169, 2, 226, 78, 250, 40, 14, 157, 61, 22, 224, 147, 250, 40, 14, 157,
- 103, 22, 169, 2, 224, 147, 250, 40, 14, 157, 99, 22, 169, 2, 224, 147,
- 250, 40, 14, 157, 103, 22, 244, 212, 250, 40, 14, 157, 99, 22, 244, 212,
- 250, 40, 14, 157, 61, 22, 226, 106, 237, 237, 250, 40, 14, 157, 61, 22,
- 252, 126, 237, 237, 37, 247, 2, 231, 195, 98, 248, 10, 98, 61, 237, 171,
- 247, 141, 236, 194, 252, 106, 236, 194, 182, 107, 229, 62, 236, 194, 229,
- 63, 107, 237, 134, 236, 194, 182, 107, 135, 229, 50, 236, 194, 135, 229,
- 51, 107, 237, 134, 236, 194, 135, 229, 51, 239, 113, 236, 194, 226, 63,
- 236, 194, 227, 3, 236, 194, 233, 128, 248, 49, 245, 225, 246, 209, 226,
- 106, 233, 180, 252, 126, 233, 180, 226, 106, 250, 223, 104, 252, 126,
- 250, 223, 104, 226, 106, 226, 100, 229, 104, 104, 252, 126, 226, 100,
- 229, 104, 104, 63, 226, 89, 252, 207, 231, 140, 2, 251, 106, 228, 31,
- 247, 23, 255, 44, 250, 220, 247, 255, 239, 227, 14, 32, 234, 200, 14, 32,
- 228, 56, 106, 245, 116, 14, 32, 228, 56, 106, 226, 255, 14, 32, 247, 233,
- 106, 226, 255, 14, 32, 247, 233, 106, 226, 92, 14, 32, 247, 224, 14, 32,
- 255, 37, 14, 32, 252, 215, 14, 32, 253, 62, 14, 32, 169, 227, 98, 14, 32,
- 237, 171, 247, 90, 14, 32, 61, 227, 98, 14, 32, 211, 247, 90, 14, 32,
- 252, 3, 231, 194, 14, 32, 229, 86, 234, 10, 14, 32, 229, 86, 240, 16, 14,
- 32, 250, 126, 237, 163, 247, 185, 14, 32, 250, 28, 251, 18, 118, 14, 32,
- 250, 28, 251, 18, 113, 14, 32, 250, 28, 251, 18, 166, 14, 32, 250, 28,
- 251, 18, 158, 14, 32, 235, 157, 255, 37, 14, 32, 227, 132, 240, 74, 14,
- 32, 247, 233, 106, 226, 93, 252, 142, 14, 32, 252, 24, 14, 32, 247, 233,
- 106, 236, 227, 14, 32, 227, 249, 14, 32, 247, 185, 14, 32, 247, 56, 229,
- 173, 14, 32, 245, 224, 229, 173, 14, 32, 231, 240, 229, 173, 14, 32, 225,
- 126, 229, 173, 14, 32, 228, 145, 14, 32, 250, 54, 252, 145, 98, 234, 44,
- 252, 118, 14, 32, 235, 144, 14, 32, 250, 55, 211, 113, 14, 32, 227, 250,
- 211, 113, 234, 92, 88, 234, 92, 251, 200, 234, 92, 246, 252, 234, 92,
- 239, 223, 246, 252, 234, 92, 252, 213, 252, 89, 234, 92, 252, 122, 226,
- 170, 234, 92, 252, 113, 253, 39, 244, 62, 234, 92, 254, 194, 106, 251,
- 180, 234, 92, 250, 130, 234, 92, 250, 214, 255, 39, 234, 198, 234, 92,
- 47, 253, 63, 33, 21, 118, 33, 21, 113, 33, 21, 166, 33, 21, 158, 33, 21,
- 173, 33, 21, 183, 33, 21, 194, 33, 21, 187, 33, 21, 192, 33, 65, 227, 23,
- 33, 65, 247, 252, 33, 65, 225, 218, 33, 65, 226, 209, 33, 65, 246, 238,
- 33, 65, 247, 67, 33, 65, 228, 212, 33, 65, 229, 161, 33, 65, 248, 18, 33,
- 65, 235, 59, 33, 65, 225, 216, 93, 21, 118, 93, 21, 113, 93, 21, 166, 93,
- 21, 158, 93, 21, 173, 93, 21, 183, 93, 21, 194, 93, 21, 187, 93, 21, 192,
- 93, 65, 227, 23, 93, 65, 247, 252, 93, 65, 225, 218, 93, 65, 226, 209,
- 93, 65, 246, 238, 93, 65, 247, 67, 93, 65, 228, 212, 93, 65, 229, 161,
- 93, 65, 248, 18, 93, 65, 235, 59, 93, 65, 225, 216, 21, 168, 246, 218,
- 228, 38, 21, 135, 246, 218, 228, 38, 21, 152, 246, 218, 228, 38, 21, 246,
- 243, 246, 218, 228, 38, 21, 247, 37, 246, 218, 228, 38, 21, 228, 217,
- 246, 218, 228, 38, 21, 229, 163, 246, 218, 228, 38, 21, 248, 20, 246,
- 218, 228, 38, 21, 235, 61, 246, 218, 228, 38, 65, 227, 24, 246, 218, 228,
- 38, 65, 247, 253, 246, 218, 228, 38, 65, 225, 219, 246, 218, 228, 38, 65,
- 226, 210, 246, 218, 228, 38, 65, 246, 239, 246, 218, 228, 38, 65, 247,
- 68, 246, 218, 228, 38, 65, 228, 213, 246, 218, 228, 38, 65, 229, 162,
- 246, 218, 228, 38, 65, 248, 19, 246, 218, 228, 38, 65, 235, 60, 246, 218,
- 228, 38, 65, 225, 217, 246, 218, 228, 38, 93, 7, 3, 1, 57, 93, 7, 3, 1,
- 254, 27, 93, 7, 3, 1, 252, 44, 93, 7, 3, 1, 222, 222, 93, 7, 3, 1, 72,
- 93, 7, 3, 1, 247, 130, 93, 7, 3, 1, 214, 93, 7, 3, 1, 212, 93, 7, 3, 1,
- 74, 93, 7, 3, 1, 239, 182, 93, 7, 3, 1, 239, 76, 93, 7, 3, 1, 149, 93, 7,
- 3, 1, 185, 93, 7, 3, 1, 199, 93, 7, 3, 1, 73, 93, 7, 3, 1, 233, 244, 93,
- 7, 3, 1, 232, 139, 93, 7, 3, 1, 146, 93, 7, 3, 1, 193, 93, 7, 3, 1, 227,
- 109, 93, 7, 3, 1, 66, 93, 7, 3, 1, 196, 93, 7, 3, 1, 224, 174, 93, 7, 3,
- 1, 224, 73, 93, 7, 3, 1, 224, 25, 93, 7, 3, 1, 223, 119, 33, 7, 6, 1, 57,
- 33, 7, 6, 1, 254, 27, 33, 7, 6, 1, 252, 44, 33, 7, 6, 1, 222, 222, 33, 7,
- 6, 1, 72, 33, 7, 6, 1, 247, 130, 33, 7, 6, 1, 214, 33, 7, 6, 1, 212, 33,
- 7, 6, 1, 74, 33, 7, 6, 1, 239, 182, 33, 7, 6, 1, 239, 76, 33, 7, 6, 1,
- 149, 33, 7, 6, 1, 185, 33, 7, 6, 1, 199, 33, 7, 6, 1, 73, 33, 7, 6, 1,
- 233, 244, 33, 7, 6, 1, 232, 139, 33, 7, 6, 1, 146, 33, 7, 6, 1, 193, 33,
- 7, 6, 1, 227, 109, 33, 7, 6, 1, 66, 33, 7, 6, 1, 196, 33, 7, 6, 1, 224,
- 174, 33, 7, 6, 1, 224, 73, 33, 7, 6, 1, 224, 25, 33, 7, 6, 1, 223, 119,
- 33, 7, 3, 1, 57, 33, 7, 3, 1, 254, 27, 33, 7, 3, 1, 252, 44, 33, 7, 3, 1,
- 222, 222, 33, 7, 3, 1, 72, 33, 7, 3, 1, 247, 130, 33, 7, 3, 1, 214, 33,
- 7, 3, 1, 212, 33, 7, 3, 1, 74, 33, 7, 3, 1, 239, 182, 33, 7, 3, 1, 239,
- 76, 33, 7, 3, 1, 149, 33, 7, 3, 1, 185, 33, 7, 3, 1, 199, 33, 7, 3, 1,
- 73, 33, 7, 3, 1, 233, 244, 33, 7, 3, 1, 232, 139, 33, 7, 3, 1, 146, 33,
- 7, 3, 1, 193, 33, 7, 3, 1, 227, 109, 33, 7, 3, 1, 66, 33, 7, 3, 1, 196,
- 33, 7, 3, 1, 224, 174, 33, 7, 3, 1, 224, 73, 33, 7, 3, 1, 224, 25, 33, 7,
- 3, 1, 223, 119, 33, 21, 223, 89, 235, 157, 33, 65, 247, 252, 235, 157,
- 33, 65, 225, 218, 235, 157, 33, 65, 226, 209, 235, 157, 33, 65, 246, 238,
- 235, 157, 33, 65, 247, 67, 235, 157, 33, 65, 228, 212, 235, 157, 33, 65,
- 229, 161, 235, 157, 33, 65, 248, 18, 235, 157, 33, 65, 235, 59, 235, 157,
- 33, 65, 225, 216, 47, 33, 21, 118, 47, 33, 21, 113, 47, 33, 21, 166, 47,
- 33, 21, 158, 47, 33, 21, 173, 47, 33, 21, 183, 47, 33, 21, 194, 47, 33,
- 21, 187, 47, 33, 21, 192, 47, 33, 65, 227, 23, 235, 157, 33, 21, 223, 89,
- 77, 80, 157, 244, 212, 77, 80, 112, 244, 212, 77, 80, 157, 225, 30, 77,
- 80, 112, 225, 30, 77, 80, 157, 226, 66, 250, 131, 244, 212, 77, 80, 112,
- 226, 66, 250, 131, 244, 212, 77, 80, 157, 226, 66, 250, 131, 225, 30, 77,
- 80, 112, 226, 66, 250, 131, 225, 30, 77, 80, 157, 232, 78, 250, 131, 244,
- 212, 77, 80, 112, 232, 78, 250, 131, 244, 212, 77, 80, 157, 232, 78, 250,
- 131, 225, 30, 77, 80, 112, 232, 78, 250, 131, 225, 30, 77, 80, 157, 103,
- 22, 231, 153, 77, 80, 103, 157, 22, 41, 245, 110, 77, 80, 103, 112, 22,
- 41, 237, 184, 77, 80, 112, 103, 22, 231, 153, 77, 80, 157, 103, 22, 237,
- 237, 77, 80, 103, 157, 22, 42, 245, 110, 77, 80, 103, 112, 22, 42, 237,
- 184, 77, 80, 112, 103, 22, 237, 237, 77, 80, 157, 99, 22, 231, 153, 77,
- 80, 99, 157, 22, 41, 245, 110, 77, 80, 99, 112, 22, 41, 237, 184, 77, 80,
- 112, 99, 22, 231, 153, 77, 80, 157, 99, 22, 237, 237, 77, 80, 99, 157,
- 22, 42, 245, 110, 77, 80, 99, 112, 22, 42, 237, 184, 77, 80, 112, 99, 22,
- 237, 237, 77, 80, 157, 61, 22, 231, 153, 77, 80, 61, 157, 22, 41, 245,
- 110, 77, 80, 99, 112, 22, 41, 103, 237, 184, 77, 80, 103, 112, 22, 41,
- 99, 237, 184, 77, 80, 61, 112, 22, 41, 237, 184, 77, 80, 103, 157, 22,
- 41, 99, 245, 110, 77, 80, 99, 157, 22, 41, 103, 245, 110, 77, 80, 112,
- 61, 22, 231, 153, 77, 80, 157, 61, 22, 237, 237, 77, 80, 61, 157, 22, 42,
- 245, 110, 77, 80, 99, 112, 22, 42, 103, 237, 184, 77, 80, 103, 112, 22,
- 42, 99, 237, 184, 77, 80, 61, 112, 22, 42, 237, 184, 77, 80, 103, 157,
- 22, 42, 99, 245, 110, 77, 80, 99, 157, 22, 42, 103, 245, 110, 77, 80,
- 112, 61, 22, 237, 237, 77, 80, 157, 103, 22, 244, 212, 77, 80, 42, 112,
- 22, 41, 103, 237, 184, 77, 80, 41, 112, 22, 42, 103, 237, 184, 77, 80,
- 103, 157, 22, 169, 245, 110, 77, 80, 103, 112, 22, 169, 237, 184, 77, 80,
- 41, 157, 22, 42, 103, 245, 110, 77, 80, 42, 157, 22, 41, 103, 245, 110,
- 77, 80, 112, 103, 22, 244, 212, 77, 80, 157, 99, 22, 244, 212, 77, 80,
- 42, 112, 22, 41, 99, 237, 184, 77, 80, 41, 112, 22, 42, 99, 237, 184, 77,
- 80, 99, 157, 22, 169, 245, 110, 77, 80, 99, 112, 22, 169, 237, 184, 77,
- 80, 41, 157, 22, 42, 99, 245, 110, 77, 80, 42, 157, 22, 41, 99, 245, 110,
- 77, 80, 112, 99, 22, 244, 212, 77, 80, 157, 61, 22, 244, 212, 77, 80, 42,
- 112, 22, 41, 61, 237, 184, 77, 80, 41, 112, 22, 42, 61, 237, 184, 77, 80,
- 61, 157, 22, 169, 245, 110, 77, 80, 99, 112, 22, 103, 169, 237, 184, 77,
- 80, 103, 112, 22, 99, 169, 237, 184, 77, 80, 61, 112, 22, 169, 237, 184,
- 77, 80, 42, 99, 112, 22, 41, 103, 237, 184, 77, 80, 41, 99, 112, 22, 42,
- 103, 237, 184, 77, 80, 42, 103, 112, 22, 41, 99, 237, 184, 77, 80, 41,
- 103, 112, 22, 42, 99, 237, 184, 77, 80, 103, 157, 22, 99, 169, 245, 110,
- 77, 80, 99, 157, 22, 103, 169, 245, 110, 77, 80, 41, 157, 22, 42, 61,
- 245, 110, 77, 80, 42, 157, 22, 41, 61, 245, 110, 77, 80, 112, 61, 22,
- 244, 212, 77, 80, 157, 47, 250, 131, 244, 212, 77, 80, 112, 47, 250, 131,
- 244, 212, 77, 80, 157, 47, 250, 131, 225, 30, 77, 80, 112, 47, 250, 131,
- 225, 30, 77, 80, 47, 244, 212, 77, 80, 47, 225, 30, 77, 80, 103, 228,
- 241, 22, 41, 248, 133, 77, 80, 103, 47, 22, 41, 228, 240, 77, 80, 47,
- 103, 22, 231, 153, 77, 80, 103, 228, 241, 22, 42, 248, 133, 77, 80, 103,
- 47, 22, 42, 228, 240, 77, 80, 47, 103, 22, 237, 237, 77, 80, 99, 228,
- 241, 22, 41, 248, 133, 77, 80, 99, 47, 22, 41, 228, 240, 77, 80, 47, 99,
- 22, 231, 153, 77, 80, 99, 228, 241, 22, 42, 248, 133, 77, 80, 99, 47, 22,
- 42, 228, 240, 77, 80, 47, 99, 22, 237, 237, 77, 80, 61, 228, 241, 22, 41,
- 248, 133, 77, 80, 61, 47, 22, 41, 228, 240, 77, 80, 47, 61, 22, 231, 153,
- 77, 80, 61, 228, 241, 22, 42, 248, 133, 77, 80, 61, 47, 22, 42, 228, 240,
- 77, 80, 47, 61, 22, 237, 237, 77, 80, 103, 228, 241, 22, 169, 248, 133,
- 77, 80, 103, 47, 22, 169, 228, 240, 77, 80, 47, 103, 22, 244, 212, 77,
- 80, 99, 228, 241, 22, 169, 248, 133, 77, 80, 99, 47, 22, 169, 228, 240,
- 77, 80, 47, 99, 22, 244, 212, 77, 80, 61, 228, 241, 22, 169, 248, 133,
- 77, 80, 61, 47, 22, 169, 228, 240, 77, 80, 47, 61, 22, 244, 212, 77, 80,
- 157, 254, 123, 103, 22, 231, 153, 77, 80, 157, 254, 123, 103, 22, 237,
- 237, 77, 80, 157, 254, 123, 99, 22, 237, 237, 77, 80, 157, 254, 123, 99,
- 22, 231, 153, 77, 80, 157, 250, 1, 225, 113, 41, 180, 203, 237, 237, 77,
- 80, 157, 250, 1, 225, 113, 42, 180, 203, 231, 153, 77, 80, 157, 250, 1,
- 250, 243, 77, 80, 157, 237, 237, 77, 80, 157, 225, 116, 77, 80, 157, 231,
- 153, 77, 80, 157, 248, 127, 77, 80, 112, 237, 237, 77, 80, 112, 225, 116,
- 77, 80, 112, 231, 153, 77, 80, 112, 248, 127, 77, 80, 157, 42, 22, 112,
- 231, 153, 77, 80, 157, 99, 22, 112, 248, 127, 77, 80, 112, 42, 22, 157,
- 231, 153, 77, 80, 112, 99, 22, 157, 248, 127, 225, 113, 132, 252, 142,
- 203, 168, 248, 17, 252, 142, 203, 168, 232, 77, 252, 142, 203, 152, 248,
- 15, 252, 142, 203, 132, 252, 142, 203, 247, 37, 248, 15, 252, 142, 203,
- 152, 232, 75, 252, 142, 203, 229, 163, 248, 15, 252, 142, 246, 218, 252,
- 142, 42, 229, 163, 248, 15, 252, 142, 42, 152, 232, 75, 252, 142, 42,
- 247, 37, 248, 15, 252, 142, 42, 132, 252, 142, 42, 152, 248, 15, 252,
- 142, 42, 168, 232, 77, 252, 142, 42, 168, 248, 17, 252, 142, 41, 132,
- 252, 142, 157, 229, 136, 236, 228, 229, 136, 250, 136, 229, 136, 225,
- 113, 168, 248, 17, 252, 142, 41, 168, 248, 17, 252, 142, 232, 80, 203,
- 237, 237, 232, 80, 203, 231, 153, 232, 80, 225, 113, 237, 237, 232, 80,
- 225, 113, 42, 22, 203, 42, 22, 203, 231, 153, 232, 80, 225, 113, 42, 22,
- 203, 231, 153, 232, 80, 225, 113, 42, 22, 225, 113, 41, 22, 203, 237,
- 237, 232, 80, 225, 113, 42, 22, 225, 113, 41, 22, 203, 231, 153, 232, 80,
- 225, 113, 231, 153, 232, 80, 225, 113, 41, 22, 203, 237, 237, 232, 80,
- 225, 113, 41, 22, 203, 42, 22, 203, 231, 153, 86, 228, 120, 63, 228, 120,
- 63, 37, 2, 231, 102, 251, 9, 63, 37, 251, 27, 86, 3, 228, 120, 37, 2,
- 169, 247, 54, 37, 2, 61, 247, 54, 37, 2, 234, 22, 250, 239, 247, 54, 37,
- 2, 225, 113, 42, 180, 203, 41, 247, 54, 37, 2, 225, 113, 41, 180, 203,
- 42, 247, 54, 37, 2, 250, 1, 250, 239, 247, 54, 86, 3, 228, 120, 63, 3,
- 228, 120, 86, 231, 236, 63, 231, 236, 86, 61, 231, 236, 63, 61, 231, 236,
- 86, 233, 183, 63, 233, 183, 86, 225, 115, 226, 78, 63, 225, 115, 226, 78,
- 86, 225, 115, 3, 226, 78, 63, 225, 115, 3, 226, 78, 86, 231, 151, 226,
- 78, 63, 231, 151, 226, 78, 86, 231, 151, 3, 226, 78, 63, 231, 151, 3,
- 226, 78, 86, 231, 151, 232, 252, 63, 231, 151, 232, 252, 86, 248, 126,
- 226, 78, 63, 248, 126, 226, 78, 86, 248, 126, 3, 226, 78, 63, 248, 126,
- 3, 226, 78, 86, 237, 235, 226, 78, 63, 237, 235, 226, 78, 86, 237, 235,
- 3, 226, 78, 63, 237, 235, 3, 226, 78, 86, 237, 235, 232, 252, 63, 237,
- 235, 232, 252, 86, 249, 250, 63, 249, 250, 63, 249, 251, 251, 27, 86, 3,
- 249, 250, 247, 42, 237, 113, 63, 251, 106, 248, 138, 251, 106, 251, 107,
- 2, 61, 247, 54, 252, 81, 86, 251, 106, 251, 107, 2, 42, 132, 252, 150,
- 251, 107, 2, 41, 132, 252, 150, 251, 107, 2, 203, 132, 252, 150, 251,
- 107, 2, 225, 113, 132, 252, 150, 251, 107, 2, 225, 113, 41, 232, 80, 252,
- 150, 251, 107, 2, 254, 217, 252, 64, 225, 113, 42, 232, 80, 252, 150, 42,
- 132, 86, 251, 106, 41, 132, 86, 251, 106, 239, 224, 252, 83, 239, 224,
- 63, 251, 106, 225, 113, 132, 239, 224, 63, 251, 106, 203, 132, 239, 224,
- 63, 251, 106, 225, 113, 42, 232, 80, 251, 104, 254, 122, 225, 113, 41,
- 232, 80, 251, 104, 254, 122, 203, 41, 232, 80, 251, 104, 254, 122, 203,
- 42, 232, 80, 251, 104, 254, 122, 225, 113, 132, 251, 106, 203, 132, 251,
- 106, 86, 203, 41, 226, 78, 86, 203, 42, 226, 78, 86, 225, 113, 42, 226,
- 78, 86, 225, 113, 41, 226, 78, 63, 252, 83, 37, 2, 42, 132, 252, 150, 37,
- 2, 41, 132, 252, 150, 37, 2, 225, 113, 42, 250, 1, 132, 252, 150, 37, 2,
- 203, 41, 250, 1, 132, 252, 150, 63, 37, 2, 61, 252, 160, 237, 170, 63,
- 225, 115, 226, 79, 2, 249, 140, 225, 115, 226, 79, 2, 42, 132, 252, 150,
- 225, 115, 226, 79, 2, 41, 132, 252, 150, 238, 9, 251, 106, 63, 37, 2,
- 225, 113, 42, 232, 79, 63, 37, 2, 203, 42, 232, 79, 63, 37, 2, 203, 41,
- 232, 79, 63, 37, 2, 225, 113, 41, 232, 79, 63, 251, 107, 2, 225, 113, 42,
- 232, 79, 63, 251, 107, 2, 203, 42, 232, 79, 63, 251, 107, 2, 203, 41,
- 232, 79, 63, 251, 107, 2, 225, 113, 41, 232, 79, 225, 113, 42, 226, 78,
- 225, 113, 41, 226, 78, 203, 42, 226, 78, 63, 236, 228, 228, 120, 86, 236,
- 228, 228, 120, 63, 236, 228, 3, 228, 120, 86, 236, 228, 3, 228, 120, 203,
- 41, 226, 78, 86, 227, 228, 2, 231, 248, 251, 75, 225, 142, 228, 171, 251,
- 57, 86, 228, 58, 63, 228, 58, 237, 183, 226, 184, 227, 227, 254, 83, 235,
- 3, 250, 33, 235, 3, 251, 35, 234, 34, 86, 227, 28, 63, 227, 28, 253, 48,
- 252, 118, 253, 48, 77, 2, 251, 180, 253, 48, 77, 2, 224, 73, 231, 5, 225,
- 143, 2, 232, 10, 248, 113, 244, 158, 252, 194, 63, 229, 67, 233, 63, 86,
- 229, 67, 233, 63, 229, 132, 200, 231, 106, 247, 16, 245, 115, 252, 83,
- 86, 42, 232, 251, 240, 8, 86, 41, 232, 251, 240, 8, 63, 42, 232, 251,
- 240, 8, 63, 99, 232, 251, 240, 8, 63, 41, 232, 251, 240, 8, 63, 103, 232,
- 251, 240, 8, 228, 199, 22, 250, 242, 251, 252, 53, 232, 16, 53, 252, 166,
- 53, 252, 35, 254, 177, 234, 23, 250, 243, 251, 170, 231, 182, 250, 244,
- 106, 237, 121, 250, 244, 106, 239, 161, 228, 59, 22, 250, 247, 247, 107,
- 98, 255, 23, 229, 134, 245, 150, 22, 229, 13, 233, 150, 98, 223, 193,
- 223, 248, 226, 70, 32, 245, 112, 226, 70, 32, 238, 24, 226, 70, 32, 247,
- 46, 226, 70, 32, 226, 185, 226, 70, 32, 224, 111, 226, 70, 32, 224, 151,
- 226, 70, 32, 236, 74, 226, 70, 32, 248, 48, 224, 125, 106, 250, 18, 63,
- 246, 221, 247, 125, 63, 228, 179, 247, 125, 86, 228, 179, 247, 125, 63,
- 227, 228, 2, 231, 248, 247, 45, 232, 77, 236, 84, 238, 5, 232, 77, 236,
- 84, 236, 209, 247, 83, 53, 248, 48, 237, 39, 53, 239, 89, 230, 239, 225,
- 98, 235, 150, 233, 8, 254, 111, 227, 60, 246, 123, 252, 22, 237, 216,
- 224, 214, 237, 191, 230, 220, 231, 17, 252, 13, 254, 134, 233, 31, 63,
- 251, 175, 238, 189, 63, 251, 175, 232, 70, 63, 251, 175, 231, 112, 63,
- 251, 175, 252, 159, 63, 251, 175, 238, 152, 63, 251, 175, 233, 159, 86,
- 251, 175, 238, 189, 86, 251, 175, 232, 70, 86, 251, 175, 231, 112, 86,
- 251, 175, 252, 159, 86, 251, 175, 238, 152, 86, 251, 175, 233, 159, 86,
- 228, 143, 227, 239, 63, 245, 115, 227, 239, 63, 249, 251, 227, 239, 86,
- 251, 74, 227, 239, 63, 228, 143, 227, 239, 86, 245, 115, 227, 239, 86,
- 249, 251, 227, 239, 63, 251, 74, 227, 239, 244, 158, 228, 124, 232, 77,
- 234, 238, 248, 17, 234, 238, 252, 236, 248, 17, 234, 235, 252, 236, 228,
- 211, 234, 235, 236, 29, 247, 25, 53, 236, 29, 235, 224, 53, 236, 29, 229,
- 124, 53, 224, 131, 151, 250, 243, 248, 45, 151, 250, 243, 225, 123, 231,
- 232, 98, 231, 232, 14, 32, 225, 195, 233, 17, 231, 232, 14, 32, 225, 194,
- 233, 17, 231, 232, 14, 32, 225, 193, 233, 17, 231, 232, 14, 32, 225, 192,
- 233, 17, 231, 232, 14, 32, 225, 191, 233, 17, 231, 232, 14, 32, 225, 190,
- 233, 17, 231, 232, 14, 32, 225, 189, 233, 17, 231, 232, 14, 32, 246, 121,
- 237, 1, 86, 225, 123, 231, 232, 98, 231, 233, 233, 196, 98, 233, 174,
- 233, 196, 98, 233, 116, 233, 196, 53, 224, 123, 98, 249, 244, 247, 124,
- 249, 244, 247, 123, 249, 244, 247, 122, 249, 244, 247, 121, 249, 244,
- 247, 120, 249, 244, 247, 119, 63, 251, 107, 2, 56, 231, 153, 63, 251,
- 107, 2, 135, 249, 138, 86, 251, 107, 2, 63, 56, 231, 153, 86, 251, 107,
- 2, 135, 63, 249, 138, 236, 92, 32, 223, 248, 236, 92, 32, 223, 192, 249,
- 227, 32, 245, 232, 223, 248, 249, 227, 32, 237, 211, 223, 192, 249, 227,
- 32, 237, 211, 223, 248, 249, 227, 32, 245, 232, 223, 192, 63, 247, 31,
- 86, 247, 31, 245, 150, 22, 233, 65, 254, 188, 250, 241, 227, 188, 228,
- 66, 106, 255, 14, 230, 229, 254, 226, 247, 12, 246, 130, 228, 66, 106,
- 245, 95, 254, 59, 98, 247, 21, 234, 7, 63, 228, 58, 224, 161, 53, 201,
- 224, 200, 53, 248, 130, 247, 83, 53, 248, 130, 237, 39, 53, 239, 232,
- 247, 83, 22, 237, 39, 53, 237, 39, 22, 247, 83, 53, 237, 39, 2, 195, 53,
- 237, 39, 2, 195, 22, 237, 39, 22, 247, 83, 53, 61, 237, 39, 2, 195, 53,
- 169, 237, 39, 2, 195, 53, 236, 228, 63, 251, 106, 236, 228, 86, 251, 106,
- 236, 228, 3, 63, 251, 106, 237, 12, 98, 249, 179, 98, 225, 122, 233, 173,
- 98, 251, 64, 246, 214, 225, 95, 235, 146, 251, 207, 233, 225, 239, 95,
- 224, 232, 251, 157, 86, 236, 85, 237, 180, 229, 155, 229, 183, 232, 63,
- 229, 167, 63, 248, 117, 237, 35, 63, 248, 117, 238, 189, 86, 248, 117,
- 237, 35, 86, 248, 117, 238, 189, 225, 113, 252, 146, 230, 221, 86, 230,
- 221, 203, 252, 146, 230, 221, 63, 230, 221, 227, 29, 237, 141, 53, 227,
- 69, 248, 115, 254, 244, 247, 218, 224, 227, 245, 146, 224, 85, 245, 146,
- 203, 41, 233, 134, 233, 134, 225, 113, 41, 233, 134, 63, 235, 86, 86,
- 235, 86, 251, 181, 76, 112, 251, 181, 76, 236, 52, 224, 73, 112, 236, 52,
- 224, 73, 253, 48, 224, 73, 112, 253, 48, 224, 73, 234, 7, 19, 250, 243,
- 112, 19, 250, 243, 234, 44, 251, 219, 250, 243, 112, 234, 44, 251, 219,
- 250, 243, 7, 250, 243, 229, 135, 63, 7, 250, 243, 234, 7, 7, 250, 243,
- 237, 37, 250, 243, 228, 59, 106, 250, 124, 246, 243, 227, 40, 254, 69,
- 246, 243, 253, 49, 254, 69, 112, 246, 243, 253, 49, 254, 69, 246, 243,
- 251, 72, 254, 69, 86, 246, 243, 232, 253, 228, 58, 63, 246, 243, 232,
- 253, 228, 58, 228, 27, 234, 7, 63, 228, 58, 33, 63, 228, 58, 234, 44,
- 251, 219, 86, 228, 58, 86, 251, 219, 63, 228, 58, 234, 7, 86, 228, 58,
- 112, 234, 7, 86, 228, 58, 233, 36, 228, 58, 229, 135, 63, 228, 58, 112,
- 254, 69, 234, 44, 251, 219, 254, 69, 248, 20, 228, 129, 254, 69, 248, 20,
- 232, 253, 86, 228, 58, 248, 20, 232, 253, 233, 36, 228, 58, 228, 217,
- 232, 253, 86, 228, 58, 248, 20, 232, 253, 231, 234, 86, 228, 58, 112,
- 248, 20, 232, 253, 231, 234, 86, 228, 58, 225, 219, 232, 253, 86, 228,
- 58, 228, 213, 232, 253, 254, 69, 227, 40, 254, 69, 234, 44, 251, 219,
- 227, 40, 254, 69, 112, 227, 40, 254, 69, 228, 217, 233, 104, 86, 22, 63,
- 247, 15, 86, 247, 15, 63, 247, 15, 248, 20, 233, 104, 234, 7, 86, 247,
- 15, 33, 234, 44, 251, 219, 248, 20, 232, 253, 228, 58, 112, 227, 40, 233,
- 36, 254, 69, 228, 172, 226, 166, 226, 73, 228, 172, 112, 251, 173, 228,
- 172, 228, 142, 112, 228, 142, 253, 49, 254, 69, 248, 20, 227, 40, 232,
- 192, 254, 69, 112, 248, 20, 227, 40, 232, 192, 254, 69, 229, 135, 63,
- 251, 106, 203, 41, 248, 114, 63, 228, 120, 225, 113, 41, 248, 114, 63,
- 228, 120, 203, 41, 229, 135, 63, 228, 120, 225, 113, 41, 229, 135, 63,
- 228, 120, 86, 249, 251, 236, 121, 63, 224, 73, 157, 61, 125, 236, 228,
- 61, 125, 112, 61, 125, 112, 228, 241, 209, 251, 55, 232, 57, 165, 234,
- 25, 112, 228, 241, 251, 55, 232, 57, 165, 234, 25, 112, 47, 209, 251, 55,
- 232, 57, 165, 234, 25, 112, 47, 251, 55, 232, 57, 165, 234, 25, 250, 217,
- 228, 49, 233, 192, 5, 234, 25, 112, 247, 149, 165, 234, 25, 112, 245,
- 115, 247, 149, 165, 234, 25, 112, 86, 245, 114, 231, 106, 112, 86, 245,
- 115, 252, 83, 247, 16, 245, 114, 231, 106, 247, 16, 245, 115, 252, 83,
- 236, 228, 42, 233, 181, 234, 25, 236, 228, 41, 233, 181, 234, 25, 236,
- 228, 247, 22, 42, 233, 181, 234, 25, 236, 228, 247, 22, 41, 233, 181,
- 234, 25, 236, 228, 237, 235, 254, 182, 252, 115, 234, 25, 236, 228, 231,
- 151, 254, 182, 252, 115, 234, 25, 112, 237, 235, 254, 182, 232, 57, 165,
- 234, 25, 112, 231, 151, 254, 182, 232, 57, 165, 234, 25, 112, 237, 235,
- 254, 182, 252, 115, 234, 25, 112, 231, 151, 254, 182, 252, 115, 234, 25,
- 157, 42, 226, 100, 229, 104, 252, 115, 234, 25, 157, 41, 226, 100, 229,
- 104, 252, 115, 234, 25, 236, 228, 42, 250, 223, 252, 115, 234, 25, 236,
- 228, 41, 250, 223, 252, 115, 234, 25, 249, 208, 235, 157, 33, 21, 118,
- 249, 208, 235, 157, 33, 21, 113, 249, 208, 235, 157, 33, 21, 166, 249,
- 208, 235, 157, 33, 21, 158, 249, 208, 235, 157, 33, 21, 173, 249, 208,
- 235, 157, 33, 21, 183, 249, 208, 235, 157, 33, 21, 194, 249, 208, 235,
- 157, 33, 21, 187, 249, 208, 235, 157, 33, 21, 192, 249, 208, 235, 157,
- 33, 65, 227, 23, 249, 208, 33, 30, 21, 118, 249, 208, 33, 30, 21, 113,
- 249, 208, 33, 30, 21, 166, 249, 208, 33, 30, 21, 158, 249, 208, 33, 30,
- 21, 173, 249, 208, 33, 30, 21, 183, 249, 208, 33, 30, 21, 194, 249, 208,
- 33, 30, 21, 187, 249, 208, 33, 30, 21, 192, 249, 208, 33, 30, 65, 227,
- 23, 249, 208, 235, 157, 33, 30, 21, 118, 249, 208, 235, 157, 33, 30, 21,
- 113, 249, 208, 235, 157, 33, 30, 21, 166, 249, 208, 235, 157, 33, 30, 21,
- 158, 249, 208, 235, 157, 33, 30, 21, 173, 249, 208, 235, 157, 33, 30, 21,
- 183, 249, 208, 235, 157, 33, 30, 21, 194, 249, 208, 235, 157, 33, 30, 21,
- 187, 249, 208, 235, 157, 33, 30, 21, 192, 249, 208, 235, 157, 33, 30, 65,
- 227, 23, 112, 224, 116, 81, 58, 112, 228, 152, 248, 45, 58, 112, 81, 58,
- 112, 234, 245, 248, 45, 58, 248, 119, 232, 255, 81, 58, 112, 231, 103,
- 81, 58, 226, 77, 81, 58, 112, 226, 77, 81, 58, 250, 129, 226, 77, 81, 58,
- 112, 250, 129, 226, 77, 81, 58, 86, 81, 58, 226, 191, 226, 104, 81, 254,
- 93, 226, 191, 252, 124, 81, 254, 93, 86, 81, 254, 93, 112, 86, 250, 217,
- 248, 125, 22, 81, 58, 112, 86, 250, 217, 225, 106, 22, 81, 58, 228, 116,
- 86, 81, 58, 112, 251, 43, 86, 81, 58, 231, 150, 63, 81, 58, 237, 234, 63,
- 81, 58, 253, 65, 229, 135, 63, 81, 58, 246, 223, 229, 135, 63, 81, 58,
- 112, 203, 231, 149, 63, 81, 58, 112, 225, 113, 231, 149, 63, 81, 58, 234,
- 240, 203, 231, 149, 63, 81, 58, 234, 240, 225, 113, 231, 149, 63, 81, 58,
- 33, 112, 63, 81, 58, 224, 120, 81, 58, 252, 149, 228, 152, 248, 45, 58,
- 252, 149, 81, 58, 252, 149, 234, 245, 248, 45, 58, 112, 252, 149, 228,
- 152, 248, 45, 58, 112, 252, 149, 81, 58, 112, 252, 149, 234, 245, 248,
- 45, 58, 227, 42, 81, 58, 112, 227, 41, 81, 58, 224, 139, 81, 58, 112,
- 224, 139, 81, 58, 234, 41, 81, 58, 152, 249, 218, 254, 181, 63, 226, 79,
- 251, 27, 3, 63, 226, 78, 233, 114, 234, 44, 227, 251, 234, 44, 227, 217,
- 42, 231, 34, 253, 59, 250, 52, 41, 231, 34, 253, 59, 250, 52, 145, 2, 56,
- 239, 243, 231, 193, 228, 162, 232, 212, 227, 251, 227, 218, 232, 212,
- 228, 161, 61, 253, 36, 2, 169, 82, 182, 249, 180, 63, 249, 251, 2, 251,
- 217, 249, 140, 22, 2, 249, 140, 247, 254, 106, 234, 39, 225, 105, 203,
- 41, 251, 11, 2, 249, 140, 225, 113, 42, 251, 11, 2, 249, 140, 42, 234, 9,
- 239, 115, 41, 234, 9, 239, 115, 246, 218, 234, 9, 239, 115, 238, 9, 99,
- 227, 96, 238, 9, 103, 227, 96, 42, 22, 41, 47, 225, 232, 42, 22, 41, 227,
- 96, 42, 236, 55, 182, 41, 227, 96, 182, 42, 227, 96, 99, 227, 97, 2, 251,
- 107, 46, 237, 114, 249, 185, 252, 55, 169, 231, 65, 63, 251, 42, 249,
- 250, 63, 251, 42, 249, 251, 2, 117, 226, 172, 63, 251, 42, 249, 251, 2,
- 81, 226, 172, 63, 37, 2, 117, 226, 172, 63, 37, 2, 81, 226, 172, 12, 42,
- 63, 37, 104, 12, 41, 63, 37, 104, 12, 42, 254, 182, 104, 12, 41, 254,
- 182, 104, 12, 42, 47, 254, 182, 104, 12, 41, 47, 254, 182, 104, 12, 42,
- 63, 226, 100, 229, 104, 104, 12, 41, 63, 226, 100, 229, 104, 104, 12, 42,
- 247, 22, 233, 180, 12, 41, 247, 22, 233, 180, 225, 106, 232, 78, 58, 248,
- 125, 232, 78, 58, 254, 168, 246, 162, 251, 107, 58, 251, 84, 246, 162,
- 251, 107, 58, 41, 67, 2, 33, 233, 10, 182, 117, 58, 182, 81, 58, 182, 42,
- 41, 58, 182, 117, 47, 58, 182, 81, 47, 58, 182, 42, 41, 47, 58, 182, 117,
- 67, 246, 224, 125, 182, 81, 67, 246, 224, 125, 182, 117, 47, 67, 246,
- 224, 125, 182, 81, 47, 67, 246, 224, 125, 182, 81, 228, 115, 58, 39, 40,
- 252, 144, 39, 40, 249, 137, 39, 40, 249, 9, 39, 40, 249, 136, 39, 40,
- 248, 201, 39, 40, 249, 72, 39, 40, 249, 8, 39, 40, 249, 135, 39, 40, 248,
- 169, 39, 40, 249, 40, 39, 40, 248, 232, 39, 40, 249, 103, 39, 40, 248,
- 200, 39, 40, 249, 71, 39, 40, 249, 7, 39, 40, 249, 134, 39, 40, 248, 153,
- 39, 40, 249, 24, 39, 40, 248, 216, 39, 40, 249, 87, 39, 40, 248, 184, 39,
- 40, 249, 55, 39, 40, 248, 247, 39, 40, 249, 118, 39, 40, 248, 168, 39,
- 40, 249, 39, 39, 40, 248, 231, 39, 40, 249, 102, 39, 40, 248, 199, 39,
- 40, 249, 70, 39, 40, 249, 6, 39, 40, 249, 133, 39, 40, 248, 145, 39, 40,
- 249, 16, 39, 40, 248, 208, 39, 40, 249, 79, 39, 40, 248, 176, 39, 40,
- 249, 47, 39, 40, 248, 239, 39, 40, 249, 110, 39, 40, 248, 160, 39, 40,
- 249, 31, 39, 40, 248, 223, 39, 40, 249, 94, 39, 40, 248, 191, 39, 40,
- 249, 62, 39, 40, 248, 254, 39, 40, 249, 125, 39, 40, 248, 152, 39, 40,
- 249, 23, 39, 40, 248, 215, 39, 40, 249, 86, 39, 40, 248, 183, 39, 40,
- 249, 54, 39, 40, 248, 246, 39, 40, 249, 117, 39, 40, 248, 167, 39, 40,
- 249, 38, 39, 40, 248, 230, 39, 40, 249, 101, 39, 40, 248, 198, 39, 40,
- 249, 69, 39, 40, 249, 5, 39, 40, 249, 132, 39, 40, 248, 141, 39, 40, 249,
- 12, 39, 40, 248, 204, 39, 40, 249, 75, 39, 40, 248, 172, 39, 40, 249, 43,
- 39, 40, 248, 235, 39, 40, 249, 106, 39, 40, 248, 156, 39, 40, 249, 27,
- 39, 40, 248, 219, 39, 40, 249, 90, 39, 40, 248, 187, 39, 40, 249, 58, 39,
- 40, 248, 250, 39, 40, 249, 121, 39, 40, 248, 148, 39, 40, 249, 19, 39,
- 40, 248, 211, 39, 40, 249, 82, 39, 40, 248, 179, 39, 40, 249, 50, 39, 40,
- 248, 242, 39, 40, 249, 113, 39, 40, 248, 163, 39, 40, 249, 34, 39, 40,
- 248, 226, 39, 40, 249, 97, 39, 40, 248, 194, 39, 40, 249, 65, 39, 40,
- 249, 1, 39, 40, 249, 128, 39, 40, 248, 144, 39, 40, 249, 15, 39, 40, 248,
- 207, 39, 40, 249, 78, 39, 40, 248, 175, 39, 40, 249, 46, 39, 40, 248,
- 238, 39, 40, 249, 109, 39, 40, 248, 159, 39, 40, 249, 30, 39, 40, 248,
- 222, 39, 40, 249, 93, 39, 40, 248, 190, 39, 40, 249, 61, 39, 40, 248,
- 253, 39, 40, 249, 124, 39, 40, 248, 151, 39, 40, 249, 22, 39, 40, 248,
- 214, 39, 40, 249, 85, 39, 40, 248, 182, 39, 40, 249, 53, 39, 40, 248,
- 245, 39, 40, 249, 116, 39, 40, 248, 166, 39, 40, 249, 37, 39, 40, 248,
- 229, 39, 40, 249, 100, 39, 40, 248, 197, 39, 40, 249, 68, 39, 40, 249, 4,
- 39, 40, 249, 131, 39, 40, 248, 139, 39, 40, 249, 10, 39, 40, 248, 202,
- 39, 40, 249, 73, 39, 40, 248, 170, 39, 40, 249, 41, 39, 40, 248, 233, 39,
- 40, 249, 104, 39, 40, 248, 154, 39, 40, 249, 25, 39, 40, 248, 217, 39,
- 40, 249, 88, 39, 40, 248, 185, 39, 40, 249, 56, 39, 40, 248, 248, 39, 40,
- 249, 119, 39, 40, 248, 146, 39, 40, 249, 17, 39, 40, 248, 209, 39, 40,
- 249, 80, 39, 40, 248, 177, 39, 40, 249, 48, 39, 40, 248, 240, 39, 40,
- 249, 111, 39, 40, 248, 161, 39, 40, 249, 32, 39, 40, 248, 224, 39, 40,
- 249, 95, 39, 40, 248, 192, 39, 40, 249, 63, 39, 40, 248, 255, 39, 40,
- 249, 126, 39, 40, 248, 142, 39, 40, 249, 13, 39, 40, 248, 205, 39, 40,
- 249, 76, 39, 40, 248, 173, 39, 40, 249, 44, 39, 40, 248, 236, 39, 40,
- 249, 107, 39, 40, 248, 157, 39, 40, 249, 28, 39, 40, 248, 220, 39, 40,
- 249, 91, 39, 40, 248, 188, 39, 40, 249, 59, 39, 40, 248, 251, 39, 40,
- 249, 122, 39, 40, 248, 149, 39, 40, 249, 20, 39, 40, 248, 212, 39, 40,
- 249, 83, 39, 40, 248, 180, 39, 40, 249, 51, 39, 40, 248, 243, 39, 40,
- 249, 114, 39, 40, 248, 164, 39, 40, 249, 35, 39, 40, 248, 227, 39, 40,
- 249, 98, 39, 40, 248, 195, 39, 40, 249, 66, 39, 40, 249, 2, 39, 40, 249,
- 129, 39, 40, 248, 140, 39, 40, 249, 11, 39, 40, 248, 203, 39, 40, 249,
- 74, 39, 40, 248, 171, 39, 40, 249, 42, 39, 40, 248, 234, 39, 40, 249,
- 105, 39, 40, 248, 155, 39, 40, 249, 26, 39, 40, 248, 218, 39, 40, 249,
- 89, 39, 40, 248, 186, 39, 40, 249, 57, 39, 40, 248, 249, 39, 40, 249,
- 120, 39, 40, 248, 147, 39, 40, 249, 18, 39, 40, 248, 210, 39, 40, 249,
- 81, 39, 40, 248, 178, 39, 40, 249, 49, 39, 40, 248, 241, 39, 40, 249,
- 112, 39, 40, 248, 162, 39, 40, 249, 33, 39, 40, 248, 225, 39, 40, 249,
- 96, 39, 40, 248, 193, 39, 40, 249, 64, 39, 40, 249, 0, 39, 40, 249, 127,
- 39, 40, 248, 143, 39, 40, 249, 14, 39, 40, 248, 206, 39, 40, 249, 77, 39,
- 40, 248, 174, 39, 40, 249, 45, 39, 40, 248, 237, 39, 40, 249, 108, 39,
- 40, 248, 158, 39, 40, 249, 29, 39, 40, 248, 221, 39, 40, 249, 92, 39, 40,
- 248, 189, 39, 40, 249, 60, 39, 40, 248, 252, 39, 40, 249, 123, 39, 40,
- 248, 150, 39, 40, 249, 21, 39, 40, 248, 213, 39, 40, 249, 84, 39, 40,
- 248, 181, 39, 40, 249, 52, 39, 40, 248, 244, 39, 40, 249, 115, 39, 40,
- 248, 165, 39, 40, 249, 36, 39, 40, 248, 228, 39, 40, 249, 99, 39, 40,
- 248, 196, 39, 40, 249, 67, 39, 40, 249, 3, 39, 40, 249, 130, 81, 225,
- 203, 67, 2, 61, 82, 81, 225, 203, 67, 2, 47, 61, 82, 117, 47, 67, 2, 61,
- 82, 81, 47, 67, 2, 61, 82, 42, 41, 47, 67, 2, 61, 82, 81, 225, 203, 67,
- 246, 224, 125, 117, 47, 67, 246, 224, 125, 81, 47, 67, 246, 224, 125,
- 248, 125, 67, 2, 169, 82, 225, 106, 67, 2, 169, 82, 225, 106, 226, 66,
- 58, 248, 125, 226, 66, 58, 117, 47, 250, 131, 58, 81, 47, 250, 131, 58,
- 117, 226, 66, 250, 131, 58, 81, 226, 66, 250, 131, 58, 81, 225, 203, 226,
- 66, 250, 131, 58, 81, 67, 2, 248, 138, 228, 48, 225, 106, 67, 180, 125,
- 248, 125, 67, 180, 125, 81, 67, 2, 227, 90, 2, 61, 82, 81, 67, 2, 227,
- 90, 2, 47, 61, 82, 81, 225, 203, 67, 2, 227, 89, 81, 225, 203, 67, 2,
- 227, 90, 2, 61, 82, 81, 225, 203, 67, 2, 227, 90, 2, 47, 61, 82, 117,
- 254, 95, 81, 254, 95, 117, 47, 254, 95, 81, 47, 254, 95, 117, 67, 180,
- 86, 249, 250, 81, 67, 180, 86, 249, 250, 117, 67, 246, 224, 253, 36, 180,
- 86, 249, 250, 81, 67, 246, 224, 253, 36, 180, 86, 249, 250, 234, 245,
- 224, 131, 22, 228, 152, 248, 45, 58, 234, 245, 248, 45, 22, 228, 152,
- 224, 131, 58, 234, 245, 224, 131, 67, 2, 88, 234, 245, 248, 45, 67, 2,
- 88, 228, 152, 248, 45, 67, 2, 88, 228, 152, 224, 131, 67, 2, 88, 234,
- 245, 224, 131, 67, 22, 234, 245, 248, 45, 58, 234, 245, 248, 45, 67, 22,
- 228, 152, 248, 45, 58, 228, 152, 248, 45, 67, 22, 228, 152, 224, 131, 58,
- 228, 152, 224, 131, 67, 22, 234, 245, 224, 131, 58, 231, 135, 250, 1,
- 250, 238, 247, 113, 250, 0, 247, 113, 250, 1, 250, 238, 231, 135, 250, 0,
- 228, 152, 248, 45, 67, 250, 238, 234, 245, 248, 45, 58, 234, 245, 248,
- 45, 67, 250, 238, 228, 152, 248, 45, 58, 247, 113, 250, 1, 250, 238, 234,
- 245, 248, 45, 58, 231, 135, 250, 1, 250, 238, 228, 152, 248, 45, 58, 234,
- 245, 248, 45, 67, 250, 238, 234, 245, 224, 131, 58, 234, 245, 224, 131,
- 67, 250, 238, 234, 245, 248, 45, 58, 224, 148, 67, 232, 251, 249, 199,
- 231, 153, 67, 232, 251, 81, 226, 232, 250, 216, 225, 105, 67, 232, 251,
- 81, 226, 232, 250, 216, 248, 124, 67, 232, 251, 248, 125, 226, 232, 250,
- 216, 237, 230, 67, 232, 251, 248, 125, 226, 232, 250, 216, 231, 145, 231,
- 148, 254, 123, 251, 84, 58, 237, 233, 254, 123, 254, 168, 58, 226, 106,
- 254, 123, 254, 168, 58, 252, 126, 254, 123, 254, 168, 58, 226, 106, 254,
- 123, 251, 84, 67, 2, 236, 120, 226, 106, 254, 123, 254, 168, 67, 2, 233,
- 10, 203, 41, 229, 188, 251, 84, 58, 203, 42, 229, 188, 254, 168, 58, 254,
- 168, 251, 82, 251, 107, 58, 251, 84, 251, 82, 251, 107, 58, 81, 67, 64,
- 229, 63, 117, 58, 117, 67, 64, 229, 63, 81, 58, 229, 63, 81, 67, 64, 117,
- 58, 81, 67, 2, 79, 51, 117, 67, 2, 79, 51, 81, 67, 226, 188, 224, 73, 42,
- 41, 67, 226, 188, 3, 251, 106, 225, 106, 225, 203, 67, 246, 224, 3, 251,
- 106, 42, 171, 99, 41, 171, 103, 245, 135, 42, 171, 103, 41, 171, 99, 245,
- 135, 99, 171, 41, 103, 171, 42, 245, 135, 99, 171, 42, 103, 171, 41, 245,
- 135, 42, 171, 99, 41, 171, 99, 245, 135, 99, 171, 41, 103, 171, 41, 245,
- 135, 42, 171, 103, 41, 171, 103, 245, 135, 99, 171, 42, 103, 171, 42,
- 245, 135, 117, 245, 136, 2, 171, 99, 180, 125, 81, 245, 136, 2, 171, 99,
- 180, 125, 225, 106, 245, 136, 2, 171, 41, 180, 125, 248, 125, 245, 136,
- 2, 171, 41, 180, 125, 117, 245, 136, 2, 171, 103, 180, 125, 81, 245, 136,
- 2, 171, 103, 180, 125, 225, 106, 245, 136, 2, 171, 42, 180, 125, 248,
- 125, 245, 136, 2, 171, 42, 180, 125, 117, 245, 136, 2, 171, 99, 246, 224,
- 125, 81, 245, 136, 2, 171, 99, 246, 224, 125, 225, 106, 245, 136, 2, 171,
- 41, 246, 224, 125, 248, 125, 245, 136, 2, 171, 41, 246, 224, 125, 117,
- 245, 136, 2, 171, 103, 246, 224, 125, 81, 245, 136, 2, 171, 103, 246,
- 224, 125, 225, 106, 245, 136, 2, 171, 42, 246, 224, 125, 248, 125, 245,
- 136, 2, 171, 42, 246, 224, 125, 117, 245, 136, 2, 171, 99, 64, 117, 245,
- 136, 2, 171, 248, 127, 225, 106, 245, 136, 2, 171, 42, 252, 202, 225,
- 106, 245, 136, 2, 171, 231, 153, 81, 245, 136, 2, 171, 99, 64, 81, 245,
- 136, 2, 171, 248, 127, 248, 125, 245, 136, 2, 171, 42, 252, 202, 248,
- 125, 245, 136, 2, 171, 231, 153, 117, 245, 136, 2, 171, 99, 64, 81, 245,
- 136, 2, 171, 225, 116, 117, 245, 136, 2, 171, 103, 64, 81, 245, 136, 2,
- 171, 248, 127, 81, 245, 136, 2, 171, 99, 64, 117, 245, 136, 2, 171, 225,
- 116, 81, 245, 136, 2, 171, 103, 64, 117, 245, 136, 2, 171, 248, 127, 117,
- 245, 136, 2, 171, 99, 64, 182, 250, 130, 117, 245, 136, 2, 171, 103, 252,
- 214, 182, 250, 130, 81, 245, 136, 2, 171, 99, 64, 182, 250, 130, 81, 245,
- 136, 2, 171, 103, 252, 214, 182, 250, 130, 225, 106, 245, 136, 2, 171,
- 42, 252, 202, 248, 125, 245, 136, 2, 171, 231, 153, 248, 125, 245, 136,
- 2, 171, 42, 252, 202, 225, 106, 245, 136, 2, 171, 231, 153, 41, 47, 67,
- 2, 231, 102, 245, 118, 247, 204, 5, 64, 81, 58, 226, 159, 234, 38, 64,
- 81, 58, 117, 67, 64, 226, 159, 234, 37, 81, 67, 64, 226, 159, 234, 37,
- 81, 67, 64, 254, 210, 105, 96, 237, 213, 64, 117, 58, 117, 67, 226, 188,
- 237, 212, 245, 231, 64, 81, 58, 227, 252, 64, 81, 58, 117, 67, 226, 188,
- 227, 251, 227, 218, 64, 117, 58, 42, 247, 44, 227, 89, 41, 247, 44, 227,
- 89, 99, 247, 44, 227, 89, 103, 247, 44, 227, 89, 226, 66, 61, 253, 36,
- 250, 52, 223, 120, 150, 228, 127, 223, 120, 150, 225, 196, 251, 61, 42,
- 63, 250, 223, 104, 41, 63, 250, 223, 104, 42, 63, 233, 180, 41, 63, 233,
- 180, 223, 120, 150, 42, 240, 29, 104, 223, 120, 150, 41, 240, 29, 104,
- 223, 120, 150, 42, 252, 168, 104, 223, 120, 150, 41, 252, 168, 104, 42,
- 37, 252, 115, 2, 225, 133, 41, 37, 252, 115, 2, 225, 133, 42, 37, 252,
- 115, 2, 226, 173, 240, 17, 226, 106, 251, 10, 41, 37, 252, 115, 2, 226,
- 173, 240, 17, 252, 126, 251, 10, 42, 37, 252, 115, 2, 226, 173, 240, 17,
- 252, 126, 251, 10, 41, 37, 252, 115, 2, 226, 173, 240, 17, 226, 106, 251,
- 10, 42, 254, 182, 252, 115, 2, 249, 140, 41, 254, 182, 252, 115, 2, 249,
- 140, 42, 254, 123, 237, 213, 104, 41, 254, 123, 245, 231, 104, 47, 42,
- 254, 123, 245, 231, 104, 47, 41, 254, 123, 237, 213, 104, 42, 86, 226,
- 100, 229, 104, 104, 41, 86, 226, 100, 229, 104, 104, 248, 138, 247, 80,
- 61, 223, 38, 237, 170, 236, 232, 254, 182, 234, 39, 237, 237, 41, 254,
- 182, 225, 54, 2, 228, 120, 236, 232, 41, 254, 182, 2, 249, 140, 254, 182,
- 2, 231, 35, 239, 243, 255, 33, 254, 181, 228, 137, 254, 182, 234, 39,
- 237, 237, 228, 137, 254, 182, 234, 39, 225, 116, 209, 254, 181, 200, 254,
- 181, 254, 182, 2, 225, 133, 200, 254, 182, 2, 225, 133, 234, 97, 254,
- 182, 234, 39, 225, 116, 234, 97, 254, 182, 234, 39, 248, 127, 236, 232,
- 254, 182, 2, 234, 44, 254, 105, 247, 230, 240, 17, 67, 232, 251, 99, 22,
- 231, 153, 236, 232, 254, 182, 2, 234, 44, 254, 105, 247, 230, 240, 17,
- 67, 232, 251, 99, 22, 237, 237, 236, 232, 254, 182, 2, 234, 44, 254, 105,
- 247, 230, 240, 17, 67, 232, 251, 103, 22, 231, 153, 236, 232, 254, 182,
- 2, 234, 44, 254, 105, 247, 230, 240, 17, 67, 232, 251, 103, 22, 237, 237,
- 236, 232, 254, 182, 2, 234, 44, 254, 105, 247, 230, 240, 17, 67, 232,
- 251, 41, 22, 225, 116, 236, 232, 254, 182, 2, 234, 44, 254, 105, 247,
- 230, 240, 17, 67, 232, 251, 42, 22, 225, 116, 236, 232, 254, 182, 2, 234,
- 44, 254, 105, 247, 230, 240, 17, 67, 232, 251, 41, 22, 248, 127, 236,
- 232, 254, 182, 2, 234, 44, 254, 105, 247, 230, 240, 17, 67, 232, 251, 42,
- 22, 248, 127, 200, 247, 241, 229, 164, 247, 241, 229, 165, 2, 234, 5,
- 247, 241, 229, 165, 2, 3, 251, 107, 46, 247, 241, 229, 165, 2, 41, 67,
- 46, 247, 241, 229, 165, 2, 42, 67, 46, 251, 107, 2, 169, 125, 33, 61,
- 125, 33, 233, 184, 33, 231, 193, 228, 161, 33, 233, 114, 251, 107, 249,
- 185, 252, 55, 169, 253, 36, 22, 226, 106, 132, 249, 185, 252, 55, 61,
- 125, 251, 107, 2, 227, 220, 224, 73, 33, 254, 167, 249, 181, 53, 99, 67,
- 226, 188, 251, 106, 33, 63, 252, 83, 33, 252, 83, 33, 237, 212, 33, 245,
- 230, 251, 107, 2, 3, 251, 107, 180, 226, 240, 231, 153, 251, 107, 2, 135,
- 169, 228, 11, 180, 226, 240, 231, 153, 228, 119, 231, 135, 250, 1, 228,
- 194, 228, 119, 247, 113, 250, 1, 228, 194, 228, 119, 254, 69, 228, 119,
- 3, 251, 106, 228, 119, 228, 120, 135, 239, 114, 228, 117, 226, 79, 2, 56,
- 46, 226, 79, 2, 225, 133, 231, 35, 240, 17, 226, 78, 226, 79, 2, 229,
- 171, 254, 63, 252, 125, 41, 226, 79, 64, 42, 226, 78, 42, 226, 79, 252,
- 202, 61, 125, 61, 253, 36, 252, 202, 41, 226, 78, 252, 120, 2, 42, 132,
- 252, 150, 252, 120, 2, 41, 132, 252, 150, 86, 252, 119, 24, 2, 42, 132,
- 252, 150, 24, 2, 41, 132, 252, 150, 63, 244, 154, 86, 244, 154, 42, 224,
- 114, 247, 80, 41, 224, 114, 247, 80, 42, 47, 224, 114, 247, 80, 41, 47,
- 224, 114, 247, 80, 240, 13, 240, 3, 226, 171, 107, 240, 3, 240, 4, 235,
- 159, 2, 61, 125, 248, 132, 236, 55, 37, 2, 251, 21, 234, 8, 240, 11, 254,
- 86, 229, 39, 232, 200, 247, 204, 5, 22, 228, 196, 233, 184, 247, 204, 5,
- 22, 228, 196, 233, 185, 2, 226, 159, 46, 244, 63, 180, 22, 228, 196, 233,
- 184, 246, 18, 228, 57, 226, 229, 248, 126, 226, 79, 2, 42, 132, 252, 150,
- 248, 126, 226, 79, 2, 41, 132, 252, 150, 86, 249, 251, 2, 103, 58, 86,
- 237, 113, 63, 251, 107, 2, 103, 58, 86, 251, 107, 2, 103, 58, 247, 191,
- 63, 228, 120, 247, 191, 86, 228, 120, 247, 191, 63, 249, 250, 247, 191,
- 86, 249, 250, 247, 191, 63, 251, 106, 247, 191, 86, 251, 106, 231, 64,
- 231, 193, 228, 162, 234, 37, 228, 162, 2, 234, 5, 231, 193, 228, 162, 2,
- 169, 82, 252, 173, 228, 161, 252, 173, 231, 193, 228, 161, 47, 233, 10,
- 226, 66, 233, 10, 237, 235, 250, 217, 254, 182, 104, 231, 151, 250, 217,
- 254, 182, 104, 226, 152, 236, 118, 236, 4, 33, 56, 234, 37, 236, 4, 33,
- 79, 234, 37, 236, 4, 33, 24, 234, 37, 236, 4, 225, 128, 234, 38, 2, 249,
- 140, 236, 4, 225, 128, 234, 38, 2, 233, 10, 236, 4, 37, 239, 228, 234,
- 37, 236, 4, 37, 225, 128, 234, 37, 135, 237, 138, 22, 234, 37, 135, 237,
- 138, 145, 234, 37, 236, 4, 24, 234, 37, 236, 98, 135, 227, 233, 227, 231,
- 2, 239, 239, 232, 78, 239, 240, 234, 37, 247, 48, 233, 176, 239, 239,
- 239, 240, 2, 47, 82, 239, 240, 254, 38, 2, 228, 194, 251, 103, 246, 215,
- 254, 168, 239, 237, 237, 171, 239, 238, 2, 231, 235, 233, 164, 254, 102,
- 232, 247, 237, 171, 239, 238, 2, 229, 188, 233, 164, 254, 102, 232, 247,
- 237, 171, 239, 238, 190, 240, 14, 226, 240, 232, 247, 239, 240, 254, 102,
- 102, 232, 255, 234, 37, 232, 73, 239, 240, 234, 37, 239, 240, 2, 117, 67,
- 2, 88, 239, 240, 2, 24, 53, 239, 240, 2, 239, 227, 239, 240, 2, 225, 127,
- 239, 240, 2, 234, 5, 239, 240, 2, 225, 133, 239, 115, 238, 9, 42, 226,
- 79, 234, 37, 223, 120, 150, 230, 225, 251, 45, 223, 120, 150, 230, 225,
- 233, 34, 223, 120, 150, 230, 225, 232, 197, 79, 5, 2, 3, 251, 107, 46,
- 79, 5, 2, 251, 102, 255, 42, 46, 79, 5, 2, 226, 159, 46, 79, 5, 2, 56,
- 51, 79, 5, 2, 226, 159, 51, 79, 5, 2, 227, 253, 113, 79, 5, 2, 86, 226,
- 78, 236, 121, 5, 2, 251, 55, 46, 236, 121, 5, 2, 56, 51, 236, 121, 5, 2,
- 247, 113, 249, 138, 236, 121, 5, 2, 231, 135, 249, 138, 79, 5, 240, 17,
- 42, 132, 251, 106, 79, 5, 240, 17, 41, 132, 251, 106, 225, 41, 145, 250,
- 244, 232, 200, 236, 52, 5, 2, 56, 46, 236, 52, 5, 2, 225, 133, 229, 185,
- 232, 201, 2, 252, 126, 251, 81, 228, 182, 232, 200, 236, 52, 5, 240, 17,
- 42, 132, 251, 106, 236, 52, 5, 240, 17, 41, 132, 251, 106, 33, 236, 52,
- 5, 2, 251, 102, 255, 41, 236, 52, 5, 240, 17, 47, 251, 106, 33, 249, 181,
- 53, 79, 5, 240, 17, 226, 78, 236, 121, 5, 240, 17, 226, 78, 236, 52, 5,
- 240, 17, 226, 78, 239, 234, 232, 200, 231, 146, 239, 234, 232, 200, 223,
- 120, 150, 231, 220, 251, 45, 254, 198, 145, 251, 15, 239, 228, 2, 249,
- 140, 225, 128, 2, 236, 121, 53, 225, 128, 2, 234, 5, 239, 228, 2, 234, 5,
- 239, 228, 2, 237, 138, 254, 186, 225, 128, 2, 237, 138, 234, 31, 225,
- 128, 64, 239, 227, 239, 228, 64, 225, 127, 225, 128, 64, 253, 36, 64,
- 239, 227, 239, 228, 64, 253, 36, 64, 225, 127, 225, 128, 252, 202, 22,
- 239, 114, 2, 225, 127, 239, 228, 252, 202, 22, 239, 114, 2, 239, 227,
- 251, 82, 225, 128, 2, 229, 170, 251, 82, 239, 228, 2, 229, 170, 47, 37,
- 239, 227, 47, 37, 225, 127, 251, 82, 225, 128, 2, 229, 171, 22, 228, 182,
- 232, 200, 237, 138, 22, 2, 56, 46, 237, 138, 145, 2, 56, 46, 47, 237,
- 138, 254, 186, 47, 237, 138, 234, 31, 135, 239, 229, 237, 138, 254, 186,
- 135, 239, 229, 237, 138, 234, 31, 228, 188, 238, 9, 234, 31, 228, 188,
- 238, 9, 254, 186, 237, 138, 145, 234, 3, 237, 138, 254, 186, 237, 138,
- 22, 2, 236, 154, 228, 48, 237, 138, 145, 2, 236, 154, 228, 48, 237, 138,
- 22, 2, 169, 250, 130, 237, 138, 145, 2, 169, 250, 130, 237, 138, 22, 2,
- 47, 234, 5, 237, 138, 22, 2, 225, 133, 237, 138, 22, 2, 47, 225, 133, 3,
- 225, 39, 2, 225, 133, 237, 138, 145, 2, 47, 234, 5, 237, 138, 145, 2, 47,
- 225, 133, 223, 120, 150, 249, 149, 254, 163, 223, 120, 150, 232, 2, 254,
- 163, 247, 204, 5, 2, 56, 51, 244, 63, 2, 56, 46, 226, 66, 169, 253, 36,
- 2, 47, 61, 82, 226, 66, 169, 253, 36, 2, 226, 66, 61, 82, 226, 159, 234,
- 38, 2, 56, 46, 226, 159, 234, 38, 2, 231, 135, 249, 138, 228, 247, 236,
- 121, 228, 246, 251, 39, 2, 56, 46, 247, 204, 2, 254, 69, 254, 210, 105,
- 180, 2, 251, 102, 255, 41, 254, 137, 105, 145, 105, 96, 247, 204, 5, 64,
- 79, 53, 79, 5, 64, 247, 204, 53, 247, 204, 5, 64, 226, 159, 234, 37, 47,
- 251, 62, 247, 205, 135, 251, 34, 247, 204, 229, 1, 152, 251, 34, 247,
- 204, 229, 1, 247, 204, 5, 2, 135, 197, 64, 22, 135, 197, 51, 247, 200, 2,
- 246, 243, 197, 46, 237, 213, 2, 251, 107, 239, 243, 245, 231, 2, 251,
- 107, 239, 243, 237, 213, 2, 232, 69, 165, 46, 245, 231, 2, 232, 69, 165,
- 46, 237, 213, 145, 228, 196, 105, 96, 245, 231, 145, 228, 196, 105, 96,
- 237, 213, 145, 228, 196, 105, 180, 2, 56, 239, 243, 245, 231, 145, 228,
- 196, 105, 180, 2, 56, 239, 243, 237, 213, 145, 228, 196, 105, 180, 2, 56,
- 46, 245, 231, 145, 228, 196, 105, 180, 2, 56, 46, 237, 213, 145, 228,
- 196, 105, 180, 2, 56, 64, 231, 153, 245, 231, 145, 228, 196, 105, 180, 2,
- 56, 64, 237, 237, 237, 213, 145, 254, 138, 245, 231, 145, 254, 138, 237,
- 213, 22, 228, 239, 190, 105, 96, 245, 231, 22, 228, 239, 190, 105, 96,
- 237, 213, 22, 190, 254, 138, 245, 231, 22, 190, 254, 138, 237, 213, 64,
- 248, 131, 105, 64, 245, 230, 245, 231, 64, 248, 131, 105, 64, 237, 212,
- 237, 213, 64, 228, 247, 145, 247, 205, 245, 231, 64, 228, 247, 145, 247,
- 205, 237, 213, 64, 228, 247, 64, 245, 230, 245, 231, 64, 228, 247, 64,
- 237, 212, 237, 213, 64, 245, 231, 64, 248, 131, 247, 205, 245, 231, 64,
- 237, 213, 64, 248, 131, 247, 205, 237, 213, 64, 228, 196, 105, 64, 245,
- 231, 64, 228, 196, 247, 205, 245, 231, 64, 228, 196, 105, 64, 237, 213,
- 64, 228, 196, 247, 205, 228, 196, 105, 180, 145, 237, 212, 228, 196, 105,
- 180, 145, 245, 230, 228, 196, 105, 180, 145, 237, 213, 2, 56, 239, 243,
- 228, 196, 105, 180, 145, 245, 231, 2, 56, 239, 243, 248, 131, 105, 180,
- 145, 237, 212, 248, 131, 105, 180, 145, 245, 230, 248, 131, 228, 196,
- 105, 180, 145, 237, 212, 248, 131, 228, 196, 105, 180, 145, 245, 230,
- 228, 247, 145, 237, 212, 228, 247, 145, 245, 230, 228, 247, 64, 237, 213,
- 64, 247, 204, 53, 228, 247, 64, 245, 231, 64, 247, 204, 53, 47, 235, 149,
- 237, 212, 47, 235, 149, 245, 230, 47, 235, 149, 237, 213, 2, 225, 133,
- 245, 231, 234, 3, 237, 212, 245, 231, 252, 202, 237, 212, 237, 213, 251,
- 82, 252, 55, 250, 218, 245, 231, 251, 82, 252, 55, 250, 218, 237, 213,
- 251, 82, 252, 55, 250, 219, 64, 228, 196, 247, 205, 245, 231, 251, 82,
- 252, 55, 250, 219, 64, 228, 196, 247, 205, 228, 183, 226, 243, 238, 8,
- 226, 243, 228, 183, 226, 244, 145, 105, 96, 238, 8, 226, 244, 145, 105,
- 96, 247, 204, 5, 2, 252, 78, 46, 232, 214, 64, 228, 239, 247, 204, 53,
- 227, 244, 64, 228, 239, 247, 204, 53, 232, 214, 64, 228, 239, 190, 105,
- 96, 227, 244, 64, 228, 239, 190, 105, 96, 232, 214, 64, 247, 204, 53,
- 227, 244, 64, 247, 204, 53, 232, 214, 64, 190, 105, 96, 227, 244, 64,
- 190, 105, 96, 232, 214, 64, 254, 210, 105, 96, 227, 244, 64, 254, 210,
- 105, 96, 232, 214, 64, 190, 254, 210, 105, 96, 227, 244, 64, 190, 254,
- 210, 105, 96, 47, 232, 213, 47, 227, 243, 227, 252, 2, 249, 140, 227,
- 218, 2, 249, 140, 227, 252, 2, 79, 5, 51, 227, 218, 2, 79, 5, 51, 227,
- 252, 2, 236, 52, 5, 51, 227, 218, 2, 236, 52, 5, 51, 227, 252, 106, 145,
- 105, 180, 2, 56, 46, 227, 218, 106, 145, 105, 180, 2, 56, 46, 227, 252,
- 106, 64, 247, 204, 53, 227, 218, 106, 64, 247, 204, 53, 227, 252, 106,
- 64, 226, 159, 234, 37, 227, 218, 106, 64, 226, 159, 234, 37, 227, 252,
- 106, 64, 254, 210, 105, 96, 227, 218, 106, 64, 254, 210, 105, 96, 227,
- 252, 106, 64, 190, 105, 96, 227, 218, 106, 64, 190, 105, 96, 37, 42, 234,
- 44, 77, 234, 37, 37, 41, 234, 44, 77, 234, 37, 251, 82, 227, 251, 251,
- 82, 227, 217, 251, 82, 227, 252, 145, 105, 96, 251, 82, 227, 218, 145,
- 105, 96, 227, 252, 64, 227, 217, 227, 218, 64, 227, 251, 227, 252, 64,
- 227, 251, 227, 218, 64, 227, 217, 227, 218, 252, 202, 227, 251, 227, 218,
- 252, 202, 22, 239, 114, 252, 55, 250, 131, 2, 227, 251, 247, 254, 106,
- 234, 39, 248, 124, 233, 29, 2, 227, 38, 226, 105, 226, 90, 239, 227, 246,
- 250, 234, 254, 229, 63, 42, 227, 96, 229, 63, 103, 227, 96, 229, 63, 99,
- 227, 96, 233, 115, 2, 193, 61, 253, 36, 226, 66, 41, 225, 232, 47, 61,
- 253, 36, 42, 225, 232, 61, 253, 36, 47, 42, 225, 232, 47, 61, 253, 36,
- 47, 42, 225, 232, 182, 250, 131, 246, 224, 42, 236, 214, 106, 47, 225,
- 30, 229, 63, 103, 227, 97, 2, 234, 5, 229, 63, 99, 227, 97, 2, 225, 133,
- 229, 63, 99, 227, 97, 64, 229, 63, 103, 227, 96, 47, 103, 227, 96, 47,
- 99, 227, 96, 47, 195, 190, 53, 200, 47, 195, 190, 53, 249, 154, 190, 249,
- 187, 2, 200, 235, 158, 228, 194, 61, 237, 171, 2, 251, 107, 46, 61, 237,
- 171, 2, 251, 107, 51, 103, 227, 97, 2, 251, 107, 51, 233, 185, 2, 169,
- 82, 233, 185, 2, 226, 159, 234, 37, 226, 66, 61, 253, 36, 252, 170, 231,
- 221, 226, 66, 61, 253, 36, 2, 169, 82, 226, 66, 251, 62, 234, 37, 226,
- 66, 235, 149, 237, 212, 226, 66, 235, 149, 245, 230, 248, 131, 228, 196,
- 237, 213, 145, 105, 96, 248, 131, 228, 196, 245, 231, 145, 105, 96, 226,
- 66, 228, 162, 252, 170, 231, 221, 238, 9, 226, 66, 61, 253, 36, 234, 37,
- 47, 228, 162, 234, 37, 63, 61, 125, 236, 4, 63, 61, 125, 234, 245, 248,
- 45, 63, 58, 234, 245, 224, 131, 63, 58, 228, 152, 248, 45, 63, 58, 228,
- 152, 224, 131, 63, 58, 42, 41, 63, 58, 117, 86, 58, 225, 106, 86, 58,
- 248, 125, 86, 58, 234, 245, 248, 45, 86, 58, 234, 245, 224, 131, 86, 58,
- 228, 152, 248, 45, 86, 58, 228, 152, 224, 131, 86, 58, 42, 41, 86, 58,
- 99, 103, 86, 58, 81, 67, 2, 226, 151, 248, 124, 81, 67, 2, 226, 151, 225,
- 105, 117, 67, 2, 226, 151, 248, 124, 117, 67, 2, 226, 151, 225, 105, 37,
- 2, 226, 106, 132, 252, 150, 37, 2, 252, 126, 132, 252, 150, 37, 2, 225,
- 113, 41, 250, 1, 132, 252, 150, 37, 2, 203, 42, 250, 1, 132, 252, 150,
- 249, 251, 2, 42, 132, 252, 150, 249, 251, 2, 41, 132, 252, 150, 249, 251,
- 2, 226, 106, 132, 252, 150, 249, 251, 2, 252, 126, 132, 252, 150, 248,
- 138, 228, 120, 86, 238, 9, 228, 120, 63, 238, 9, 228, 120, 86, 224, 234,
- 3, 228, 120, 63, 224, 234, 3, 228, 120, 86, 233, 129, 63, 233, 129, 63,
- 245, 86, 86, 245, 86, 169, 86, 245, 86, 86, 238, 9, 251, 106, 86, 236,
- 228, 249, 250, 63, 236, 228, 249, 250, 86, 236, 228, 237, 113, 63, 236,
- 228, 237, 113, 86, 3, 249, 250, 86, 3, 237, 113, 63, 3, 237, 113, 86,
- 169, 247, 250, 63, 169, 247, 250, 86, 61, 247, 250, 63, 61, 247, 250, 42,
- 67, 2, 3, 251, 106, 152, 117, 254, 92, 42, 67, 2, 33, 233, 10, 182, 117,
- 228, 115, 58, 117, 225, 203, 67, 2, 61, 82, 117, 225, 203, 67, 2, 47, 61,
- 82, 117, 225, 203, 67, 246, 224, 125, 117, 225, 203, 226, 66, 250, 131,
- 58, 117, 67, 2, 248, 138, 228, 48, 117, 67, 2, 227, 90, 2, 61, 82, 117,
- 67, 2, 227, 90, 2, 47, 61, 82, 117, 225, 203, 67, 2, 227, 89, 117, 225,
- 203, 67, 2, 227, 90, 2, 61, 82, 117, 225, 203, 67, 2, 227, 90, 2, 47, 61,
- 82, 117, 67, 226, 188, 224, 73, 224, 148, 67, 232, 251, 249, 199, 237,
- 237, 247, 204, 5, 64, 117, 58, 231, 193, 226, 159, 234, 38, 64, 117, 58,
- 117, 67, 64, 231, 193, 254, 210, 105, 96, 81, 67, 226, 188, 245, 230, 81,
- 67, 226, 188, 227, 217, 117, 232, 78, 58, 81, 232, 78, 58, 231, 193, 226,
- 159, 234, 38, 64, 81, 58, 81, 67, 64, 231, 193, 254, 210, 105, 96, 226,
- 159, 234, 38, 64, 117, 58, 117, 67, 64, 254, 210, 105, 96, 117, 67, 64,
- 231, 193, 226, 159, 234, 37, 81, 67, 64, 231, 193, 226, 159, 234, 37, 63,
- 236, 228, 228, 58, 86, 3, 228, 58, 63, 3, 228, 58, 86, 231, 151, 233,
- 129, 63, 231, 151, 233, 129, 115, 6, 1, 254, 28, 115, 6, 1, 252, 86, 115,
- 6, 1, 225, 40, 115, 6, 1, 246, 19, 115, 6, 1, 249, 156, 115, 6, 1, 223,
- 209, 115, 6, 1, 223, 71, 115, 6, 1, 248, 67, 115, 6, 1, 223, 94, 115, 6,
- 1, 239, 186, 115, 6, 1, 59, 239, 186, 115, 6, 1, 74, 115, 6, 1, 249, 174,
- 115, 6, 1, 239, 51, 115, 6, 1, 237, 150, 115, 6, 1, 236, 8, 115, 6, 1,
- 235, 227, 115, 6, 1, 234, 54, 115, 6, 1, 232, 249, 115, 6, 1, 231, 134,
- 115, 6, 1, 228, 187, 115, 6, 1, 225, 223, 115, 6, 1, 225, 149, 115, 6, 1,
- 246, 226, 115, 6, 1, 245, 92, 115, 6, 1, 234, 14, 115, 6, 1, 233, 151,
- 115, 6, 1, 229, 46, 115, 6, 1, 226, 29, 115, 6, 1, 251, 142, 115, 6, 1,
- 229, 146, 115, 6, 1, 223, 213, 115, 6, 1, 223, 215, 115, 6, 1, 223, 237,
- 115, 6, 1, 228, 135, 154, 115, 6, 1, 223, 158, 115, 6, 1, 3, 223, 139,
- 115, 6, 1, 3, 223, 140, 2, 227, 89, 115, 6, 1, 223, 183, 115, 6, 1, 239,
- 214, 3, 223, 139, 115, 6, 1, 252, 173, 223, 139, 115, 6, 1, 239, 214,
- 252, 173, 223, 139, 115, 6, 1, 247, 38, 115, 6, 1, 239, 184, 115, 6, 1,
- 229, 45, 115, 6, 1, 226, 58, 57, 115, 6, 1, 238, 0, 236, 8, 115, 3, 1,
- 254, 28, 115, 3, 1, 252, 86, 115, 3, 1, 225, 40, 115, 3, 1, 246, 19, 115,
- 3, 1, 249, 156, 115, 3, 1, 223, 209, 115, 3, 1, 223, 71, 115, 3, 1, 248,
- 67, 115, 3, 1, 223, 94, 115, 3, 1, 239, 186, 115, 3, 1, 59, 239, 186,
- 115, 3, 1, 74, 115, 3, 1, 249, 174, 115, 3, 1, 239, 51, 115, 3, 1, 237,
- 150, 115, 3, 1, 236, 8, 115, 3, 1, 235, 227, 115, 3, 1, 234, 54, 115, 3,
- 1, 232, 249, 115, 3, 1, 231, 134, 115, 3, 1, 228, 187, 115, 3, 1, 225,
- 223, 115, 3, 1, 225, 149, 115, 3, 1, 246, 226, 115, 3, 1, 245, 92, 115,
- 3, 1, 234, 14, 115, 3, 1, 233, 151, 115, 3, 1, 229, 46, 115, 3, 1, 226,
- 29, 115, 3, 1, 251, 142, 115, 3, 1, 229, 146, 115, 3, 1, 223, 213, 115,
- 3, 1, 223, 215, 115, 3, 1, 223, 237, 115, 3, 1, 228, 135, 154, 115, 3, 1,
- 223, 158, 115, 3, 1, 3, 223, 139, 115, 3, 1, 3, 223, 140, 2, 227, 89,
- 115, 3, 1, 223, 183, 115, 3, 1, 239, 214, 3, 223, 139, 115, 3, 1, 252,
- 173, 223, 139, 115, 3, 1, 239, 214, 252, 173, 223, 139, 115, 3, 1, 247,
- 38, 115, 3, 1, 239, 184, 115, 3, 1, 229, 45, 115, 3, 1, 226, 58, 57, 115,
- 3, 1, 238, 0, 236, 8, 7, 6, 1, 238, 47, 2, 47, 125, 7, 3, 1, 238, 47, 2,
- 47, 125, 7, 6, 1, 238, 47, 2, 236, 154, 205, 7, 6, 1, 233, 245, 2, 82, 7,
- 6, 1, 232, 27, 2, 227, 89, 7, 3, 1, 102, 2, 82, 7, 3, 1, 227, 110, 2,
- 250, 1, 82, 7, 6, 1, 245, 172, 2, 250, 34, 7, 3, 1, 245, 172, 2, 250, 34,
- 7, 6, 1, 239, 77, 2, 250, 34, 7, 3, 1, 239, 77, 2, 250, 34, 7, 6, 1, 223,
- 120, 2, 250, 34, 7, 3, 1, 223, 120, 2, 250, 34, 7, 6, 1, 254, 205, 7, 6,
- 1, 237, 69, 2, 88, 7, 6, 1, 209, 57, 7, 3, 1, 225, 65, 2, 41, 88, 7, 6,
- 1, 224, 175, 2, 88, 7, 3, 1, 224, 175, 2, 88, 7, 3, 1, 225, 65, 2, 250,
- 224, 7, 6, 1, 132, 212, 7, 3, 1, 132, 212, 7, 3, 1, 227, 87, 233, 87, 7,
- 3, 1, 161, 2, 234, 241, 7, 3, 1, 209, 232, 27, 2, 227, 89, 7, 3, 1, 130,
- 2, 184, 231, 140, 239, 243, 7, 1, 3, 6, 209, 72, 7, 227, 253, 3, 1, 239,
- 182, 52, 1, 6, 196, 70, 6, 1, 254, 222, 70, 3, 1, 254, 222, 70, 6, 1,
- 224, 226, 70, 3, 1, 224, 226, 70, 6, 1, 246, 169, 70, 3, 1, 246, 169, 70,
- 6, 1, 250, 162, 70, 3, 1, 250, 162, 70, 6, 1, 248, 21, 70, 3, 1, 248, 21,
- 70, 6, 1, 228, 156, 70, 3, 1, 228, 156, 70, 6, 1, 223, 103, 70, 3, 1,
- 223, 103, 70, 6, 1, 245, 130, 70, 3, 1, 245, 130, 70, 6, 1, 226, 222, 70,
- 3, 1, 226, 222, 70, 6, 1, 244, 72, 70, 3, 1, 244, 72, 70, 6, 1, 239, 40,
- 70, 3, 1, 239, 40, 70, 6, 1, 237, 254, 70, 3, 1, 237, 254, 70, 6, 1, 236,
- 157, 70, 3, 1, 236, 157, 70, 6, 1, 235, 89, 70, 3, 1, 235, 89, 70, 6, 1,
- 238, 111, 70, 3, 1, 238, 111, 70, 6, 1, 73, 70, 3, 1, 73, 70, 6, 1, 233,
- 69, 70, 3, 1, 233, 69, 70, 6, 1, 231, 122, 70, 3, 1, 231, 122, 70, 6, 1,
- 228, 249, 70, 3, 1, 228, 249, 70, 6, 1, 227, 61, 70, 3, 1, 227, 61, 70,
- 6, 1, 225, 170, 70, 3, 1, 225, 170, 70, 6, 1, 247, 70, 70, 3, 1, 247, 70,
- 70, 6, 1, 238, 212, 70, 3, 1, 238, 212, 70, 6, 1, 232, 183, 70, 3, 1,
- 232, 183, 70, 6, 1, 234, 48, 70, 3, 1, 234, 48, 70, 6, 1, 249, 255, 254,
- 227, 70, 3, 1, 249, 255, 254, 227, 70, 6, 1, 84, 70, 254, 248, 70, 3, 1,
- 84, 70, 254, 248, 70, 6, 1, 250, 236, 248, 21, 70, 3, 1, 250, 236, 248,
- 21, 70, 6, 1, 249, 255, 239, 40, 70, 3, 1, 249, 255, 239, 40, 70, 6, 1,
- 249, 255, 235, 89, 70, 3, 1, 249, 255, 235, 89, 70, 6, 1, 250, 236, 235,
- 89, 70, 3, 1, 250, 236, 235, 89, 70, 6, 1, 84, 70, 234, 48, 70, 3, 1, 84,
- 70, 234, 48, 70, 6, 1, 230, 255, 70, 3, 1, 230, 255, 70, 6, 1, 250, 241,
- 229, 106, 70, 3, 1, 250, 241, 229, 106, 70, 6, 1, 84, 70, 229, 106, 70,
- 3, 1, 84, 70, 229, 106, 70, 6, 1, 84, 70, 247, 183, 70, 3, 1, 84, 70,
- 247, 183, 70, 6, 1, 254, 236, 238, 215, 70, 3, 1, 254, 236, 238, 215, 70,
- 6, 1, 249, 255, 244, 213, 70, 3, 1, 249, 255, 244, 213, 70, 6, 1, 84, 70,
- 244, 213, 70, 3, 1, 84, 70, 244, 213, 70, 6, 1, 84, 70, 154, 70, 3, 1,
- 84, 70, 154, 70, 6, 1, 238, 46, 154, 70, 3, 1, 238, 46, 154, 70, 6, 1,
- 84, 70, 245, 106, 70, 3, 1, 84, 70, 245, 106, 70, 6, 1, 84, 70, 245, 132,
- 70, 3, 1, 84, 70, 245, 132, 70, 6, 1, 84, 70, 246, 165, 70, 3, 1, 84, 70,
- 246, 165, 70, 6, 1, 84, 70, 249, 177, 70, 3, 1, 84, 70, 249, 177, 70, 6,
- 1, 84, 70, 229, 80, 70, 3, 1, 84, 70, 229, 80, 70, 6, 1, 84, 234, 204,
- 229, 80, 70, 3, 1, 84, 234, 204, 229, 80, 70, 6, 1, 84, 234, 204, 235,
- 114, 70, 3, 1, 84, 234, 204, 235, 114, 70, 6, 1, 84, 234, 204, 234, 163,
- 70, 3, 1, 84, 234, 204, 234, 163, 70, 6, 1, 84, 234, 204, 224, 149, 70,
- 3, 1, 84, 234, 204, 224, 149, 70, 14, 239, 56, 70, 14, 236, 158, 231,
- 122, 70, 14, 233, 70, 231, 122, 70, 14, 228, 54, 70, 14, 227, 62, 231,
- 122, 70, 14, 238, 213, 231, 122, 70, 14, 229, 81, 228, 249, 70, 84, 234,
- 204, 246, 218, 228, 38, 70, 84, 234, 204, 249, 201, 232, 69, 76, 70, 84,
- 234, 204, 240, 6, 232, 69, 76, 70, 84, 234, 204, 225, 32, 249, 184, 70,
- 246, 235, 168, 245, 151, 70, 246, 218, 228, 38, 70, 236, 80, 249, 184,
- 87, 3, 1, 254, 190, 87, 3, 1, 253, 44, 87, 3, 1, 246, 168, 87, 3, 1, 249,
- 148, 87, 3, 1, 247, 239, 87, 3, 1, 224, 219, 87, 3, 1, 223, 92, 87, 3, 1,
- 227, 73, 87, 3, 1, 240, 16, 87, 3, 1, 239, 46, 87, 3, 1, 238, 6, 87, 3,
- 1, 237, 35, 87, 3, 1, 235, 230, 87, 3, 1, 234, 61, 87, 3, 1, 233, 194,
- 87, 3, 1, 223, 81, 87, 3, 1, 232, 15, 87, 3, 1, 230, 253, 87, 3, 1, 227,
- 67, 87, 3, 1, 225, 138, 87, 3, 1, 233, 92, 87, 3, 1, 238, 218, 87, 3, 1,
- 246, 60, 87, 3, 1, 232, 123, 87, 3, 1, 229, 78, 87, 3, 1, 251, 161, 87,
- 3, 1, 252, 26, 87, 3, 1, 239, 149, 87, 3, 1, 251, 109, 87, 3, 1, 251,
- 192, 87, 3, 1, 224, 70, 87, 3, 1, 239, 159, 87, 3, 1, 245, 165, 87, 3, 1,
- 245, 121, 87, 3, 1, 245, 71, 87, 3, 1, 224, 141, 87, 3, 1, 245, 141, 87,
- 3, 1, 244, 225, 221, 1, 191, 221, 1, 224, 17, 221, 1, 224, 16, 221, 1,
- 224, 8, 221, 1, 224, 6, 221, 1, 252, 204, 255, 43, 224, 2, 221, 1, 224,
- 2, 221, 1, 224, 14, 221, 1, 224, 11, 221, 1, 224, 13, 221, 1, 224, 12,
- 221, 1, 223, 206, 221, 1, 224, 9, 221, 1, 224, 1, 221, 1, 225, 249, 224,
- 1, 221, 1, 223, 254, 221, 1, 224, 4, 221, 1, 252, 204, 255, 43, 224, 4,
- 221, 1, 225, 249, 224, 4, 221, 1, 224, 3, 221, 1, 224, 21, 221, 1, 223,
- 255, 221, 1, 225, 249, 223, 255, 221, 1, 223, 246, 221, 1, 225, 249, 223,
- 246, 221, 1, 223, 202, 221, 1, 223, 230, 221, 1, 255, 1, 223, 230, 221,
- 1, 225, 249, 223, 230, 221, 1, 223, 253, 221, 1, 223, 252, 221, 1, 223,
- 250, 221, 1, 225, 249, 224, 5, 221, 1, 225, 249, 223, 248, 221, 1, 223,
- 247, 221, 1, 223, 158, 221, 1, 223, 244, 221, 1, 223, 243, 221, 1, 224,
- 7, 221, 1, 225, 249, 224, 7, 221, 1, 254, 30, 224, 7, 221, 1, 223, 242,
- 221, 1, 223, 240, 221, 1, 223, 241, 221, 1, 223, 239, 221, 1, 223, 238,
- 221, 1, 224, 15, 221, 1, 223, 236, 221, 1, 223, 235, 221, 1, 223, 234,
- 221, 1, 223, 233, 221, 1, 223, 231, 221, 1, 227, 54, 223, 231, 221, 1,
- 223, 229, 221, 52, 1, 238, 38, 76, 25, 4, 237, 142, 25, 4, 236, 102, 25,
- 4, 231, 120, 25, 4, 228, 168, 25, 4, 229, 70, 25, 4, 252, 137, 25, 4,
- 226, 124, 25, 4, 251, 67, 25, 4, 235, 4, 25, 4, 234, 151, 25, 4, 246, 16,
- 234, 105, 25, 4, 223, 26, 25, 4, 249, 159, 25, 4, 250, 91, 25, 4, 239,
- 116, 25, 4, 226, 200, 25, 4, 251, 149, 25, 4, 233, 78, 25, 4, 233, 3, 25,
- 4, 246, 71, 25, 4, 246, 67, 25, 4, 246, 68, 25, 4, 246, 69, 25, 4, 228,
- 110, 25, 4, 228, 80, 25, 4, 228, 91, 25, 4, 228, 109, 25, 4, 228, 94, 25,
- 4, 228, 95, 25, 4, 228, 84, 25, 4, 251, 246, 25, 4, 251, 233, 25, 4, 251,
- 235, 25, 4, 251, 245, 25, 4, 251, 243, 25, 4, 251, 244, 25, 4, 251, 234,
- 25, 4, 222, 253, 25, 4, 222, 233, 25, 4, 222, 244, 25, 4, 222, 252, 25,
- 4, 222, 247, 25, 4, 222, 248, 25, 4, 222, 236, 25, 4, 251, 242, 25, 4,
- 251, 236, 25, 4, 251, 238, 25, 4, 251, 241, 25, 4, 251, 239, 25, 4, 251,
- 240, 25, 4, 251, 237, 25, 4, 232, 39, 25, 4, 232, 29, 25, 4, 232, 35, 25,
- 4, 232, 38, 25, 4, 232, 36, 25, 4, 232, 37, 25, 4, 232, 34, 25, 4, 238,
- 57, 25, 4, 238, 49, 25, 4, 238, 52, 25, 4, 238, 56, 25, 4, 238, 53, 25,
- 4, 238, 54, 25, 4, 238, 50, 25, 4, 224, 38, 25, 4, 224, 28, 25, 4, 224,
- 34, 25, 4, 224, 37, 25, 4, 224, 35, 25, 4, 224, 36, 25, 4, 224, 33, 25,
- 4, 245, 182, 25, 4, 245, 173, 25, 4, 245, 176, 25, 4, 245, 181, 25, 4,
- 245, 178, 25, 4, 245, 179, 25, 4, 245, 175, 36, 28, 1, 252, 238, 36, 28,
- 1, 225, 42, 36, 28, 1, 246, 58, 36, 28, 1, 250, 77, 36, 28, 1, 223, 77,
- 36, 28, 1, 223, 97, 36, 28, 1, 177, 36, 28, 1, 248, 2, 36, 28, 1, 247,
- 247, 36, 28, 1, 247, 239, 36, 28, 1, 73, 36, 28, 1, 233, 151, 36, 28, 1,
- 247, 198, 36, 28, 1, 247, 188, 36, 28, 1, 227, 44, 36, 28, 1, 154, 36,
- 28, 1, 226, 40, 36, 28, 1, 251, 182, 36, 28, 1, 229, 146, 36, 28, 1, 229,
- 116, 36, 28, 1, 247, 38, 36, 28, 1, 247, 187, 36, 28, 1, 57, 36, 28, 1,
- 240, 72, 36, 28, 1, 249, 175, 36, 28, 1, 236, 90, 225, 153, 36, 28, 1,
- 223, 239, 36, 28, 1, 223, 158, 36, 28, 1, 239, 213, 57, 36, 28, 1, 237,
- 155, 223, 139, 36, 28, 1, 252, 173, 223, 139, 36, 28, 1, 239, 213, 252,
- 173, 223, 139, 41, 254, 182, 227, 248, 237, 13, 41, 254, 182, 248, 138,
- 227, 248, 237, 13, 42, 227, 248, 104, 41, 227, 248, 104, 42, 248, 138,
- 227, 248, 104, 41, 248, 138, 227, 248, 104, 232, 8, 239, 231, 237, 13,
- 232, 8, 248, 138, 239, 231, 237, 13, 248, 138, 226, 91, 237, 13, 42, 226,
- 91, 104, 41, 226, 91, 104, 232, 8, 228, 120, 42, 232, 8, 234, 63, 104,
- 41, 232, 8, 234, 63, 104, 248, 36, 251, 8, 233, 190, 246, 251, 233, 190,
- 200, 246, 251, 233, 190, 244, 92, 248, 138, 234, 100, 248, 125, 254, 187,
- 225, 106, 254, 187, 248, 138, 231, 151, 254, 181, 47, 234, 97, 244, 95,
- 239, 223, 239, 230, 233, 223, 252, 112, 244, 96, 2, 219, 226, 159, 2,
- 231, 140, 46, 42, 184, 233, 182, 104, 41, 184, 233, 182, 104, 226, 159,
- 2, 56, 46, 226, 159, 2, 56, 51, 42, 61, 253, 36, 2, 232, 65, 41, 61, 253,
- 36, 2, 232, 65, 226, 106, 42, 132, 104, 226, 106, 41, 132, 104, 252, 126,
- 42, 132, 104, 252, 126, 41, 132, 104, 42, 229, 11, 97, 104, 41, 229, 11,
- 97, 104, 42, 47, 233, 180, 41, 47, 233, 180, 135, 197, 107, 168, 56, 232,
- 170, 168, 56, 107, 135, 197, 232, 170, 228, 119, 246, 243, 56, 232, 170,
- 247, 37, 56, 76, 200, 232, 69, 76, 61, 205, 231, 140, 232, 254, 9, 29,
- 231, 211, 9, 29, 251, 88, 9, 29, 230, 209, 118, 9, 29, 230, 209, 113, 9,
- 29, 230, 209, 166, 9, 29, 233, 112, 9, 29, 252, 118, 9, 29, 227, 99, 9,
- 29, 238, 154, 118, 9, 29, 238, 154, 113, 9, 29, 249, 182, 9, 29, 230,
- 211, 9, 29, 3, 118, 9, 29, 3, 113, 9, 29, 238, 15, 118, 9, 29, 238, 15,
- 113, 9, 29, 238, 15, 166, 9, 29, 238, 15, 158, 9, 29, 228, 176, 9, 29,
- 226, 192, 9, 29, 228, 174, 118, 9, 29, 228, 174, 113, 9, 29, 245, 115,
- 118, 9, 29, 245, 115, 113, 9, 29, 245, 146, 9, 29, 232, 1, 9, 29, 251,
- 147, 9, 29, 227, 227, 9, 29, 236, 84, 9, 29, 250, 75, 9, 29, 236, 77, 9,
- 29, 251, 98, 9, 29, 224, 152, 118, 9, 29, 224, 152, 113, 9, 29, 247, 46,
- 9, 29, 233, 160, 118, 9, 29, 233, 160, 113, 9, 29, 228, 245, 132, 226,
- 87, 226, 49, 9, 29, 250, 253, 9, 29, 249, 153, 9, 29, 239, 177, 9, 29,
- 252, 133, 106, 251, 77, 9, 29, 247, 136, 9, 29, 228, 132, 118, 9, 29,
- 228, 132, 113, 9, 29, 253, 46, 9, 29, 228, 250, 9, 29, 252, 41, 228, 250,
- 9, 29, 235, 148, 118, 9, 29, 235, 148, 113, 9, 29, 235, 148, 166, 9, 29,
- 235, 148, 158, 9, 29, 236, 204, 9, 29, 229, 108, 9, 29, 232, 6, 9, 29,
- 247, 154, 9, 29, 234, 73, 9, 29, 252, 97, 118, 9, 29, 252, 97, 113, 9,
- 29, 236, 231, 9, 29, 236, 79, 9, 29, 245, 240, 118, 9, 29, 245, 240, 113,
- 9, 29, 245, 240, 166, 9, 29, 226, 167, 9, 29, 251, 76, 9, 29, 224, 131,
- 118, 9, 29, 224, 131, 113, 9, 29, 252, 41, 230, 203, 9, 29, 228, 245,
- 244, 160, 9, 29, 244, 160, 9, 29, 252, 41, 228, 138, 9, 29, 252, 41, 229,
- 103, 9, 29, 247, 2, 9, 29, 252, 41, 252, 2, 9, 29, 228, 245, 224, 166, 9,
- 29, 224, 167, 118, 9, 29, 224, 167, 113, 9, 29, 251, 99, 9, 29, 252, 41,
- 246, 6, 9, 29, 182, 118, 9, 29, 182, 113, 9, 29, 252, 41, 237, 134, 9,
- 29, 252, 41, 246, 153, 9, 29, 236, 76, 118, 9, 29, 236, 76, 113, 9, 29,
- 232, 9, 9, 29, 252, 140, 9, 29, 252, 41, 227, 72, 237, 240, 9, 29, 252,
- 41, 237, 241, 9, 29, 252, 41, 224, 111, 9, 29, 252, 41, 247, 10, 9, 29,
- 248, 43, 118, 9, 29, 248, 43, 113, 9, 29, 248, 43, 166, 9, 29, 252, 41,
- 248, 42, 9, 29, 245, 118, 9, 29, 252, 41, 244, 159, 9, 29, 252, 132, 9,
- 29, 246, 53, 9, 29, 252, 41, 247, 43, 9, 29, 252, 41, 252, 164, 9, 29,
- 252, 41, 231, 7, 9, 29, 228, 245, 224, 126, 9, 29, 228, 245, 223, 223, 9,
- 29, 252, 41, 246, 225, 9, 29, 239, 181, 247, 157, 9, 29, 252, 41, 247,
- 157, 9, 29, 239, 181, 226, 107, 9, 29, 252, 41, 226, 107, 9, 29, 239,
- 181, 248, 118, 9, 29, 252, 41, 248, 118, 9, 29, 225, 230, 9, 29, 239,
- 181, 225, 230, 9, 29, 252, 41, 225, 230, 49, 29, 118, 49, 29, 237, 170,
- 49, 29, 249, 140, 49, 29, 228, 194, 49, 29, 230, 208, 49, 29, 88, 49, 29,
- 113, 49, 29, 237, 190, 49, 29, 237, 35, 49, 29, 237, 226, 49, 29, 247,
- 222, 49, 29, 187, 49, 29, 103, 252, 118, 49, 29, 250, 254, 49, 29, 244,
- 69, 49, 29, 227, 99, 49, 29, 234, 44, 252, 118, 49, 29, 238, 153, 49, 29,
- 232, 233, 49, 29, 224, 87, 49, 29, 228, 128, 49, 29, 41, 234, 44, 252,
- 118, 49, 29, 245, 72, 247, 235, 49, 29, 227, 23, 49, 29, 249, 182, 49,
- 29, 230, 211, 49, 29, 251, 88, 49, 29, 232, 202, 49, 29, 255, 7, 49, 29,
- 236, 72, 49, 29, 247, 235, 49, 29, 248, 48, 49, 29, 230, 224, 49, 29,
- 246, 11, 49, 29, 246, 12, 228, 186, 49, 29, 247, 156, 49, 29, 252, 172,
- 49, 29, 224, 101, 49, 29, 251, 163, 49, 29, 231, 113, 49, 29, 240, 15,
- 49, 29, 228, 184, 49, 29, 238, 14, 49, 29, 251, 6, 49, 29, 228, 123, 49,
- 29, 236, 74, 49, 29, 231, 131, 49, 29, 224, 89, 49, 29, 234, 59, 49, 29,
- 225, 235, 49, 29, 248, 109, 49, 29, 229, 63, 226, 192, 49, 29, 248, 138,
- 251, 88, 49, 29, 182, 228, 24, 49, 29, 135, 245, 145, 49, 29, 229, 65,
- 49, 29, 252, 121, 49, 29, 228, 173, 49, 29, 252, 101, 49, 29, 228, 47,
- 49, 29, 245, 114, 49, 29, 245, 152, 49, 29, 249, 143, 49, 29, 245, 146,
- 49, 29, 252, 112, 49, 29, 232, 1, 49, 29, 230, 217, 49, 29, 249, 203, 49,
- 29, 254, 35, 49, 29, 228, 120, 49, 29, 234, 242, 49, 29, 227, 227, 49,
- 29, 230, 234, 49, 29, 236, 84, 49, 29, 226, 86, 49, 29, 238, 34, 49, 29,
- 228, 38, 49, 29, 250, 75, 49, 29, 224, 140, 49, 29, 249, 162, 234, 242,
- 49, 29, 251, 51, 49, 29, 246, 212, 49, 29, 251, 96, 49, 29, 228, 50, 49,
- 29, 224, 151, 49, 29, 247, 46, 49, 29, 251, 95, 49, 29, 247, 101, 49, 29,
- 47, 224, 73, 49, 29, 132, 226, 87, 226, 49, 49, 29, 228, 191, 49, 29,
- 247, 109, 49, 29, 250, 253, 49, 29, 249, 153, 49, 29, 232, 199, 49, 29,
- 239, 177, 49, 29, 236, 217, 49, 29, 226, 158, 49, 29, 227, 195, 49, 29,
- 237, 185, 49, 29, 225, 86, 49, 29, 247, 69, 49, 29, 252, 133, 106, 251,
- 77, 49, 29, 229, 12, 49, 29, 248, 138, 227, 21, 49, 29, 224, 121, 49, 29,
- 228, 201, 49, 29, 249, 195, 49, 29, 247, 136, 49, 29, 228, 140, 49, 29,
- 58, 49, 29, 228, 40, 49, 29, 228, 131, 49, 29, 226, 95, 49, 29, 245, 245,
- 49, 29, 251, 251, 49, 29, 228, 62, 49, 29, 253, 46, 49, 29, 231, 178, 49,
- 29, 228, 250, 49, 29, 239, 173, 49, 29, 235, 147, 49, 29, 229, 108, 49,
- 29, 247, 94, 49, 29, 234, 73, 49, 29, 254, 186, 49, 29, 233, 14, 49, 29,
- 248, 51, 49, 29, 252, 96, 49, 29, 236, 231, 49, 29, 236, 122, 49, 29,
- 229, 192, 49, 29, 254, 96, 49, 29, 236, 79, 49, 29, 226, 110, 49, 29,
- 234, 36, 49, 29, 252, 135, 49, 29, 228, 36, 49, 29, 251, 60, 49, 29, 245,
- 239, 49, 29, 226, 167, 49, 29, 239, 245, 49, 29, 252, 141, 49, 29, 224,
- 167, 247, 235, 49, 29, 251, 76, 49, 29, 224, 130, 49, 29, 230, 203, 49,
- 29, 244, 160, 49, 29, 228, 138, 49, 29, 225, 61, 49, 29, 252, 235, 49,
- 29, 233, 43, 49, 29, 253, 60, 49, 29, 229, 103, 49, 29, 231, 230, 49, 29,
- 231, 60, 49, 29, 247, 2, 49, 29, 252, 134, 49, 29, 252, 2, 49, 29, 252,
- 155, 49, 29, 236, 81, 49, 29, 224, 166, 49, 29, 251, 99, 49, 29, 224,
- 109, 49, 29, 249, 192, 49, 29, 224, 220, 49, 29, 246, 6, 49, 29, 237,
- 134, 49, 29, 246, 153, 49, 29, 236, 75, 49, 29, 228, 193, 49, 29, 229,
- 63, 227, 88, 252, 164, 49, 29, 232, 9, 49, 29, 252, 140, 49, 29, 224, 84,
- 49, 29, 247, 125, 49, 29, 237, 240, 49, 29, 227, 72, 237, 240, 49, 29,
- 237, 238, 49, 29, 228, 154, 49, 29, 237, 241, 49, 29, 224, 111, 49, 29,
- 247, 10, 49, 29, 248, 42, 49, 29, 245, 118, 49, 29, 246, 233, 49, 29,
- 244, 159, 49, 29, 252, 132, 49, 29, 227, 76, 49, 29, 245, 157, 49, 29,
- 247, 62, 49, 29, 231, 26, 224, 109, 49, 29, 251, 253, 49, 29, 246, 53,
- 49, 29, 247, 43, 49, 29, 252, 164, 49, 29, 231, 7, 49, 29, 250, 65, 49,
- 29, 224, 126, 49, 29, 245, 101, 49, 29, 223, 223, 49, 29, 236, 129, 49,
- 29, 252, 150, 49, 29, 247, 244, 49, 29, 246, 225, 49, 29, 226, 64, 49,
- 29, 248, 111, 49, 29, 231, 253, 49, 29, 234, 243, 49, 29, 247, 157, 49,
- 29, 226, 107, 49, 29, 248, 118, 49, 29, 225, 230, 49, 29, 247, 11, 90,
- 250, 32, 116, 42, 180, 231, 153, 90, 250, 32, 116, 64, 180, 51, 90, 250,
- 32, 116, 42, 180, 236, 154, 22, 231, 153, 90, 250, 32, 116, 64, 180, 236,
- 154, 22, 51, 90, 250, 32, 116, 246, 218, 227, 207, 90, 250, 32, 116, 227,
- 208, 246, 224, 46, 90, 250, 32, 116, 227, 208, 246, 224, 51, 90, 250, 32,
- 116, 227, 208, 246, 224, 237, 237, 90, 250, 32, 116, 227, 208, 246, 224,
- 225, 113, 237, 237, 90, 250, 32, 116, 227, 208, 246, 224, 225, 113, 231,
- 153, 90, 250, 32, 116, 227, 208, 246, 224, 203, 237, 237, 90, 250, 32,
- 116, 234, 4, 90, 228, 145, 90, 251, 54, 90, 246, 218, 228, 38, 249, 189,
- 76, 239, 174, 240, 5, 228, 61, 98, 90, 239, 193, 76, 90, 251, 79, 76, 90,
- 65, 223, 89, 42, 254, 182, 104, 41, 254, 182, 104, 42, 47, 254, 182, 104,
- 41, 47, 254, 182, 104, 42, 251, 11, 104, 41, 251, 11, 104, 42, 63, 251,
- 11, 104, 41, 63, 251, 11, 104, 42, 86, 237, 217, 104, 41, 86, 237, 217,
- 104, 232, 237, 76, 246, 104, 76, 42, 226, 100, 229, 104, 104, 41, 226,
- 100, 229, 104, 104, 42, 63, 237, 217, 104, 41, 63, 237, 217, 104, 42, 63,
- 226, 100, 229, 104, 104, 41, 63, 226, 100, 229, 104, 104, 42, 63, 37,
- 104, 41, 63, 37, 104, 224, 148, 250, 130, 200, 47, 232, 206, 232, 57, 76,
- 47, 232, 206, 232, 57, 76, 184, 47, 232, 206, 232, 57, 76, 232, 237, 165,
- 247, 125, 245, 144, 207, 118, 245, 144, 207, 113, 245, 144, 207, 166,
- 245, 144, 207, 158, 245, 144, 207, 173, 245, 144, 207, 183, 245, 144,
- 207, 194, 245, 144, 207, 187, 245, 144, 207, 192, 90, 237, 209, 206, 76,
- 90, 231, 135, 206, 76, 90, 250, 38, 206, 76, 90, 247, 221, 206, 76, 26,
- 228, 241, 56, 206, 76, 26, 47, 56, 206, 76, 224, 146, 250, 130, 61, 239,
- 45, 231, 212, 76, 61, 239, 45, 231, 212, 2, 224, 204, 228, 155, 76, 61,
- 239, 45, 231, 212, 165, 225, 113, 245, 151, 61, 239, 45, 231, 212, 2,
- 224, 204, 228, 155, 165, 225, 113, 245, 151, 61, 239, 45, 231, 212, 165,
- 203, 245, 151, 33, 232, 237, 76, 90, 167, 237, 171, 247, 91, 229, 174,
- 98, 245, 144, 207, 227, 23, 245, 144, 207, 225, 216, 245, 144, 207, 226,
- 207, 61, 90, 239, 193, 76, 237, 3, 76, 233, 176, 254, 202, 76, 90, 38,
- 240, 7, 90, 132, 247, 55, 228, 145, 126, 1, 3, 57, 126, 1, 57, 126, 1, 3,
- 74, 126, 1, 74, 126, 1, 3, 66, 126, 1, 66, 126, 1, 3, 72, 126, 1, 72,
- 126, 1, 3, 73, 126, 1, 73, 126, 1, 177, 126, 1, 246, 193, 126, 1, 238,
- 199, 126, 1, 246, 46, 126, 1, 238, 107, 126, 1, 245, 218, 126, 1, 239, 3,
- 126, 1, 246, 131, 126, 1, 238, 150, 126, 1, 246, 11, 126, 1, 231, 31,
- 126, 1, 223, 117, 126, 1, 229, 15, 126, 1, 223, 47, 126, 1, 228, 6, 126,
- 1, 223, 19, 126, 1, 230, 213, 126, 1, 223, 97, 126, 1, 228, 169, 126, 1,
- 223, 27, 126, 1, 227, 107, 126, 1, 250, 189, 126, 1, 226, 175, 126, 1,
- 250, 4, 126, 1, 3, 225, 250, 126, 1, 225, 250, 126, 1, 248, 107, 126, 1,
- 227, 44, 126, 1, 250, 77, 126, 1, 96, 126, 1, 249, 161, 126, 1, 236, 1,
- 126, 1, 235, 89, 126, 1, 234, 206, 126, 1, 235, 162, 126, 1, 235, 6, 126,
- 1, 154, 126, 1, 253, 70, 126, 1, 213, 126, 1, 245, 75, 126, 1, 252, 181,
- 126, 1, 233, 69, 126, 1, 244, 145, 126, 1, 252, 90, 126, 1, 232, 173,
- 126, 1, 245, 121, 126, 1, 252, 238, 126, 1, 233, 151, 126, 1, 244, 227,
- 126, 1, 252, 138, 126, 1, 233, 4, 126, 1, 198, 126, 1, 236, 157, 126, 1,
- 236, 66, 126, 1, 236, 235, 126, 1, 236, 103, 126, 1, 3, 191, 126, 1, 191,
- 126, 1, 3, 223, 158, 126, 1, 223, 158, 126, 1, 3, 223, 183, 126, 1, 223,
- 183, 126, 1, 208, 126, 1, 231, 180, 126, 1, 231, 70, 126, 1, 231, 244,
- 126, 1, 231, 122, 126, 1, 3, 224, 173, 126, 1, 224, 173, 126, 1, 224,
- 118, 126, 1, 224, 141, 126, 1, 224, 105, 126, 1, 199, 126, 1, 224, 190,
- 126, 1, 3, 177, 126, 1, 3, 239, 3, 36, 239, 19, 224, 204, 228, 155, 76,
- 36, 239, 19, 229, 191, 228, 155, 76, 239, 19, 224, 204, 228, 155, 76,
- 239, 19, 229, 191, 228, 155, 76, 126, 239, 193, 76, 126, 224, 204, 239,
- 193, 76, 126, 249, 224, 223, 170, 239, 19, 47, 244, 95, 48, 1, 3, 57, 48,
- 1, 57, 48, 1, 3, 74, 48, 1, 74, 48, 1, 3, 66, 48, 1, 66, 48, 1, 3, 72,
- 48, 1, 72, 48, 1, 3, 73, 48, 1, 73, 48, 1, 177, 48, 1, 246, 193, 48, 1,
- 238, 199, 48, 1, 246, 46, 48, 1, 238, 107, 48, 1, 245, 218, 48, 1, 239,
- 3, 48, 1, 246, 131, 48, 1, 238, 150, 48, 1, 246, 11, 48, 1, 231, 31, 48,
- 1, 223, 117, 48, 1, 229, 15, 48, 1, 223, 47, 48, 1, 228, 6, 48, 1, 223,
- 19, 48, 1, 230, 213, 48, 1, 223, 97, 48, 1, 228, 169, 48, 1, 223, 27, 48,
- 1, 227, 107, 48, 1, 250, 189, 48, 1, 226, 175, 48, 1, 250, 4, 48, 1, 3,
- 225, 250, 48, 1, 225, 250, 48, 1, 248, 107, 48, 1, 227, 44, 48, 1, 250,
- 77, 48, 1, 96, 48, 1, 249, 161, 48, 1, 236, 1, 48, 1, 235, 89, 48, 1,
- 234, 206, 48, 1, 235, 162, 48, 1, 235, 6, 48, 1, 154, 48, 1, 253, 70, 48,
- 1, 213, 48, 1, 245, 75, 48, 1, 252, 181, 48, 1, 233, 69, 48, 1, 244, 145,
- 48, 1, 252, 90, 48, 1, 232, 173, 48, 1, 245, 121, 48, 1, 252, 238, 48, 1,
- 233, 151, 48, 1, 244, 227, 48, 1, 252, 138, 48, 1, 233, 4, 48, 1, 198,
- 48, 1, 236, 157, 48, 1, 236, 66, 48, 1, 236, 235, 48, 1, 236, 103, 48, 1,
- 3, 191, 48, 1, 191, 48, 1, 3, 223, 158, 48, 1, 223, 158, 48, 1, 3, 223,
- 183, 48, 1, 223, 183, 48, 1, 208, 48, 1, 231, 180, 48, 1, 231, 70, 48, 1,
- 231, 244, 48, 1, 231, 122, 48, 1, 3, 224, 173, 48, 1, 224, 173, 48, 1,
- 224, 118, 48, 1, 224, 141, 48, 1, 224, 105, 48, 1, 199, 48, 1, 224, 190,
- 48, 1, 3, 177, 48, 1, 3, 239, 3, 48, 1, 225, 64, 48, 1, 224, 228, 48, 1,
- 225, 42, 48, 1, 224, 206, 48, 236, 154, 249, 140, 239, 19, 232, 194, 228,
- 155, 76, 48, 239, 193, 76, 48, 224, 204, 239, 193, 76, 48, 249, 224, 238,
- 129, 176, 1, 254, 27, 176, 1, 233, 244, 176, 1, 185, 176, 1, 247, 130,
- 176, 1, 222, 222, 176, 1, 227, 109, 176, 1, 199, 176, 1, 149, 176, 1,
- 214, 176, 1, 239, 76, 176, 1, 212, 176, 1, 239, 182, 176, 1, 232, 139,
- 176, 1, 224, 73, 176, 1, 223, 86, 176, 1, 251, 205, 176, 1, 229, 148,
- 176, 1, 146, 176, 1, 223, 119, 176, 1, 252, 44, 176, 1, 193, 176, 1, 57,
- 176, 1, 73, 176, 1, 72, 176, 1, 248, 24, 176, 1, 254, 253, 176, 1, 248,
- 22, 176, 1, 254, 53, 176, 1, 234, 13, 176, 1, 254, 190, 176, 1, 247, 239,
- 176, 1, 254, 184, 176, 1, 247, 228, 176, 1, 247, 198, 176, 1, 74, 176, 1,
- 66, 176, 1, 239, 192, 176, 1, 196, 176, 1, 235, 139, 176, 1, 246, 15,
- 176, 1, 240, 48, 26, 1, 238, 173, 26, 1, 228, 104, 26, 1, 238, 171, 26,
- 1, 235, 82, 26, 1, 235, 81, 26, 1, 235, 80, 26, 1, 226, 163, 26, 1, 228,
- 99, 26, 1, 231, 174, 26, 1, 231, 170, 26, 1, 231, 168, 26, 1, 231, 162,
- 26, 1, 231, 159, 26, 1, 231, 157, 26, 1, 231, 163, 26, 1, 231, 173, 26,
- 1, 236, 148, 26, 1, 233, 60, 26, 1, 228, 102, 26, 1, 233, 52, 26, 1, 228,
- 236, 26, 1, 228, 100, 26, 1, 240, 68, 26, 1, 251, 113, 26, 1, 228, 107,
- 26, 1, 251, 167, 26, 1, 238, 210, 26, 1, 226, 218, 26, 1, 233, 85, 26, 1,
- 245, 69, 26, 1, 57, 26, 1, 255, 19, 26, 1, 191, 26, 1, 224, 10, 26, 1,
- 247, 217, 26, 1, 72, 26, 1, 223, 221, 26, 1, 223, 228, 26, 1, 73, 26, 1,
- 224, 173, 26, 1, 224, 170, 26, 1, 234, 88, 26, 1, 223, 183, 26, 1, 66,
- 26, 1, 224, 133, 26, 1, 224, 141, 26, 1, 224, 118, 26, 1, 223, 158, 26,
- 1, 247, 165, 26, 1, 223, 202, 26, 1, 74, 26, 247, 52, 26, 1, 228, 103,
- 26, 1, 235, 74, 26, 1, 235, 76, 26, 1, 235, 78, 26, 1, 231, 169, 26, 1,
- 231, 156, 26, 1, 231, 160, 26, 1, 231, 164, 26, 1, 231, 154, 26, 1, 236,
- 143, 26, 1, 236, 141, 26, 1, 236, 144, 26, 1, 239, 34, 26, 1, 233, 56,
- 26, 1, 233, 45, 26, 1, 233, 50, 26, 1, 233, 48, 26, 1, 233, 58, 26, 1,
- 233, 46, 26, 1, 239, 32, 26, 1, 239, 30, 26, 1, 228, 230, 26, 1, 228,
- 228, 26, 1, 228, 221, 26, 1, 228, 226, 26, 1, 228, 234, 26, 1, 233, 204,
- 26, 1, 228, 105, 26, 1, 223, 212, 26, 1, 223, 210, 26, 1, 223, 211, 26,
- 1, 239, 33, 26, 1, 228, 106, 26, 1, 223, 218, 26, 1, 223, 180, 26, 1,
- 223, 179, 26, 1, 223, 182, 26, 1, 223, 151, 26, 1, 223, 152, 26, 1, 223,
- 154, 26, 1, 254, 128, 26, 1, 254, 124, 90, 254, 175, 237, 162, 76, 90,
- 254, 175, 231, 193, 76, 90, 254, 175, 168, 76, 90, 254, 175, 135, 76, 90,
- 254, 175, 152, 76, 90, 254, 175, 246, 243, 76, 90, 254, 175, 226, 106,
- 76, 90, 254, 175, 236, 154, 76, 90, 254, 175, 252, 126, 76, 90, 254, 175,
- 247, 45, 76, 90, 254, 175, 230, 209, 76, 90, 254, 175, 226, 214, 76, 90,
- 254, 175, 246, 237, 76, 90, 254, 175, 245, 113, 76, 90, 254, 175, 248,
- 49, 76, 90, 254, 175, 237, 36, 76, 176, 1, 252, 90, 176, 1, 223, 47, 176,
- 1, 239, 156, 176, 1, 245, 218, 176, 1, 248, 35, 176, 1, 247, 226, 176, 1,
- 234, 52, 176, 1, 234, 56, 176, 1, 239, 210, 176, 1, 254, 176, 176, 1,
- 239, 250, 176, 1, 225, 121, 176, 1, 240, 30, 176, 1, 235, 123, 176, 1,
- 254, 247, 176, 1, 254, 49, 176, 1, 254, 199, 176, 1, 234, 69, 176, 1,
- 234, 58, 176, 1, 239, 247, 176, 35, 1, 233, 244, 176, 35, 1, 227, 109,
- 176, 35, 1, 239, 76, 176, 35, 1, 212, 9, 195, 227, 109, 9, 195, 224, 127,
- 9, 195, 224, 65, 9, 195, 252, 56, 9, 195, 227, 201, 9, 195, 244, 85, 9,
- 195, 244, 89, 9, 195, 244, 151, 9, 195, 244, 86, 9, 195, 227, 112, 9,
- 195, 244, 88, 9, 195, 244, 84, 9, 195, 244, 149, 9, 195, 244, 87, 9, 195,
- 244, 83, 9, 195, 199, 9, 195, 212, 9, 195, 193, 9, 195, 233, 244, 9, 195,
- 228, 147, 9, 195, 222, 222, 9, 195, 244, 90, 9, 195, 245, 85, 9, 195,
- 227, 121, 9, 195, 227, 186, 9, 195, 228, 70, 9, 195, 229, 153, 9, 195,
- 233, 153, 9, 195, 232, 141, 9, 195, 226, 125, 9, 195, 227, 111, 9, 195,
- 227, 194, 9, 195, 244, 97, 9, 195, 244, 82, 9, 195, 233, 99, 9, 195, 232,
- 139, 48, 1, 3, 238, 107, 48, 1, 3, 229, 15, 48, 1, 3, 228, 6, 48, 1, 3,
- 96, 48, 1, 3, 234, 206, 48, 1, 3, 154, 48, 1, 3, 245, 75, 48, 1, 3, 244,
- 145, 48, 1, 3, 245, 121, 48, 1, 3, 244, 227, 48, 1, 3, 236, 66, 48, 1, 3,
- 208, 48, 1, 3, 231, 180, 48, 1, 3, 231, 70, 48, 1, 3, 231, 244, 48, 1, 3,
- 231, 122, 93, 26, 238, 173, 93, 26, 235, 82, 93, 26, 226, 163, 93, 26,
- 231, 174, 93, 26, 236, 148, 93, 26, 233, 60, 93, 26, 228, 236, 93, 26,
- 240, 68, 93, 26, 251, 113, 93, 26, 251, 167, 93, 26, 238, 210, 93, 26,
- 226, 218, 93, 26, 233, 85, 93, 26, 245, 69, 93, 26, 238, 174, 57, 93, 26,
- 235, 83, 57, 93, 26, 226, 164, 57, 93, 26, 231, 175, 57, 93, 26, 236,
- 149, 57, 93, 26, 233, 61, 57, 93, 26, 228, 237, 57, 93, 26, 240, 69, 57,
- 93, 26, 251, 114, 57, 93, 26, 251, 168, 57, 93, 26, 238, 211, 57, 93, 26,
- 226, 219, 57, 93, 26, 233, 86, 57, 93, 26, 245, 70, 57, 93, 26, 251, 114,
- 66, 93, 238, 133, 116, 234, 78, 93, 238, 133, 116, 130, 244, 145, 93,
- 133, 118, 93, 133, 113, 93, 133, 166, 93, 133, 158, 93, 133, 173, 93,
- 133, 183, 93, 133, 194, 93, 133, 187, 93, 133, 192, 93, 133, 227, 23, 93,
- 133, 236, 84, 93, 133, 247, 46, 93, 133, 224, 151, 93, 133, 224, 97, 93,
- 133, 236, 199, 93, 133, 248, 48, 93, 133, 227, 227, 93, 133, 228, 41, 93,
- 133, 245, 127, 93, 133, 228, 167, 93, 133, 235, 237, 93, 133, 228, 139,
- 93, 133, 247, 51, 93, 133, 251, 40, 93, 133, 238, 37, 93, 133, 231, 208,
- 93, 133, 252, 31, 93, 133, 228, 9, 93, 133, 227, 216, 93, 133, 247, 220,
- 93, 133, 231, 201, 93, 133, 254, 212, 93, 133, 247, 75, 93, 133, 231,
- 199, 93, 133, 229, 192, 93, 133, 231, 243, 233, 173, 53, 33, 65, 225,
- 217, 118, 33, 65, 225, 217, 113, 33, 65, 225, 217, 166, 33, 65, 225, 217,
- 158, 33, 65, 225, 217, 173, 33, 65, 225, 217, 183, 33, 65, 225, 217, 194,
- 33, 65, 225, 217, 187, 33, 65, 225, 217, 192, 33, 65, 226, 207, 33, 65,
- 226, 208, 118, 33, 65, 226, 208, 113, 33, 65, 226, 208, 166, 33, 65, 226,
- 208, 158, 33, 65, 226, 208, 173, 33, 26, 238, 173, 33, 26, 235, 82, 33,
- 26, 226, 163, 33, 26, 231, 174, 33, 26, 236, 148, 33, 26, 233, 60, 33,
- 26, 228, 236, 33, 26, 240, 68, 33, 26, 251, 113, 33, 26, 251, 167, 33,
- 26, 238, 210, 33, 26, 226, 218, 33, 26, 233, 85, 33, 26, 245, 69, 33, 26,
- 238, 174, 57, 33, 26, 235, 83, 57, 33, 26, 226, 164, 57, 33, 26, 231,
- 175, 57, 33, 26, 236, 149, 57, 33, 26, 233, 61, 57, 33, 26, 228, 237, 57,
- 33, 26, 240, 69, 57, 33, 26, 251, 114, 57, 33, 26, 251, 168, 57, 33, 26,
- 238, 211, 57, 33, 26, 226, 219, 57, 33, 26, 233, 86, 57, 33, 26, 245, 70,
- 57, 33, 238, 133, 116, 251, 197, 33, 238, 133, 116, 239, 98, 33, 26, 240,
- 69, 66, 238, 133, 228, 61, 98, 33, 133, 118, 33, 133, 113, 33, 133, 166,
- 33, 133, 158, 33, 133, 173, 33, 133, 183, 33, 133, 194, 33, 133, 187, 33,
- 133, 192, 33, 133, 227, 23, 33, 133, 236, 84, 33, 133, 247, 46, 33, 133,
- 224, 151, 33, 133, 224, 97, 33, 133, 236, 199, 33, 133, 248, 48, 33, 133,
- 227, 227, 33, 133, 228, 41, 33, 133, 245, 127, 33, 133, 228, 167, 33,
- 133, 235, 237, 33, 133, 228, 139, 33, 133, 247, 51, 33, 133, 251, 40, 33,
- 133, 238, 37, 33, 133, 230, 207, 33, 133, 237, 38, 33, 133, 247, 82, 33,
- 133, 227, 238, 33, 133, 247, 151, 33, 133, 232, 203, 33, 133, 254, 57,
- 33, 133, 239, 194, 33, 133, 231, 199, 33, 133, 251, 14, 33, 133, 251, 5,
- 33, 133, 245, 63, 33, 133, 251, 218, 33, 133, 237, 117, 33, 133, 237,
- 237, 33, 133, 231, 153, 33, 133, 236, 229, 33, 133, 231, 218, 33, 133,
- 228, 9, 33, 133, 227, 216, 33, 133, 247, 220, 33, 133, 231, 201, 33, 133,
- 254, 212, 33, 133, 235, 71, 33, 65, 226, 208, 183, 33, 65, 226, 208, 194,
- 33, 65, 226, 208, 187, 33, 65, 226, 208, 192, 33, 65, 246, 245, 33, 65,
- 246, 246, 118, 33, 65, 246, 246, 113, 33, 65, 246, 246, 166, 33, 65, 246,
- 246, 158, 33, 65, 246, 246, 173, 33, 65, 246, 246, 183, 33, 65, 246, 246,
- 194, 33, 65, 246, 246, 187, 33, 65, 246, 246, 192, 33, 65, 247, 63, 90,
- 167, 14, 32, 239, 175, 90, 167, 14, 32, 247, 93, 90, 167, 14, 32, 237,
- 19, 90, 167, 14, 32, 254, 136, 90, 167, 14, 32, 236, 252, 90, 167, 14,
- 32, 239, 96, 90, 167, 14, 32, 239, 97, 90, 167, 14, 32, 254, 50, 90, 167,
- 14, 32, 229, 172, 90, 167, 14, 32, 234, 91, 90, 167, 14, 32, 234, 233,
- 90, 167, 14, 32, 250, 72, 37, 245, 85, 37, 247, 194, 37, 247, 159, 237,
- 176, 237, 192, 53, 33, 48, 57, 33, 48, 74, 33, 48, 66, 33, 48, 72, 33,
- 48, 73, 33, 48, 177, 33, 48, 238, 199, 33, 48, 238, 107, 33, 48, 239, 3,
- 33, 48, 238, 150, 33, 48, 231, 31, 33, 48, 229, 15, 33, 48, 228, 6, 33,
- 48, 230, 213, 33, 48, 228, 169, 33, 48, 227, 107, 33, 48, 226, 175, 33,
- 48, 225, 250, 33, 48, 227, 44, 33, 48, 96, 33, 48, 236, 1, 33, 48, 235,
- 89, 33, 48, 234, 206, 33, 48, 235, 162, 33, 48, 235, 6, 33, 48, 154, 33,
- 48, 245, 75, 33, 48, 244, 145, 33, 48, 245, 121, 33, 48, 244, 227, 33,
- 48, 198, 33, 48, 236, 157, 33, 48, 236, 66, 33, 48, 236, 235, 33, 48,
- 236, 103, 33, 48, 191, 33, 48, 223, 158, 33, 48, 223, 183, 33, 48, 208,
- 33, 48, 231, 180, 33, 48, 231, 70, 33, 48, 231, 244, 33, 48, 231, 122,
- 33, 48, 224, 173, 33, 48, 224, 118, 33, 48, 224, 141, 33, 48, 224, 105,
- 37, 254, 156, 37, 254, 88, 37, 254, 171, 37, 255, 57, 37, 239, 251, 37,
- 239, 225, 37, 225, 119, 37, 247, 174, 37, 248, 33, 37, 234, 55, 37, 234,
- 50, 37, 239, 55, 37, 239, 29, 37, 239, 27, 37, 246, 157, 37, 246, 164,
- 37, 246, 37, 37, 246, 33, 37, 238, 48, 37, 246, 27, 37, 238, 184, 37,
- 238, 183, 37, 238, 182, 37, 238, 181, 37, 245, 196, 37, 245, 195, 37,
- 238, 88, 37, 238, 90, 37, 238, 255, 37, 238, 131, 37, 238, 137, 37, 231,
- 16, 37, 230, 249, 37, 228, 219, 37, 229, 177, 37, 229, 176, 37, 250, 186,
- 37, 250, 31, 37, 249, 141, 37, 226, 120, 37, 235, 233, 37, 234, 234, 37,
- 245, 156, 37, 233, 238, 37, 233, 237, 37, 253, 68, 37, 233, 66, 37, 233,
- 39, 37, 233, 40, 37, 252, 162, 37, 244, 144, 37, 244, 141, 37, 252, 65,
- 37, 244, 129, 37, 245, 104, 37, 233, 105, 37, 233, 132, 37, 245, 91, 37,
- 233, 130, 37, 233, 142, 37, 252, 228, 37, 232, 250, 37, 252, 128, 37,
- 244, 219, 37, 232, 245, 37, 244, 215, 37, 244, 216, 37, 237, 47, 37, 237,
- 44, 37, 237, 51, 37, 237, 9, 37, 237, 29, 37, 236, 133, 37, 236, 115, 37,
- 236, 114, 37, 236, 221, 37, 236, 219, 37, 236, 222, 37, 224, 20, 37, 224,
- 18, 37, 223, 150, 37, 231, 133, 37, 231, 137, 37, 231, 53, 37, 231, 48,
- 37, 231, 217, 37, 231, 216, 37, 224, 150, 90, 167, 14, 32, 244, 155, 223,
- 89, 90, 167, 14, 32, 244, 155, 118, 90, 167, 14, 32, 244, 155, 113, 90,
- 167, 14, 32, 244, 155, 166, 90, 167, 14, 32, 244, 155, 158, 90, 167, 14,
- 32, 244, 155, 173, 90, 167, 14, 32, 244, 155, 183, 90, 167, 14, 32, 244,
- 155, 194, 90, 167, 14, 32, 244, 155, 187, 90, 167, 14, 32, 244, 155, 192,
- 90, 167, 14, 32, 244, 155, 227, 23, 90, 167, 14, 32, 244, 155, 247, 252,
- 90, 167, 14, 32, 244, 155, 225, 218, 90, 167, 14, 32, 244, 155, 226, 209,
- 90, 167, 14, 32, 244, 155, 246, 238, 90, 167, 14, 32, 244, 155, 247, 67,
- 90, 167, 14, 32, 244, 155, 228, 212, 90, 167, 14, 32, 244, 155, 229, 161,
- 90, 167, 14, 32, 244, 155, 248, 18, 90, 167, 14, 32, 244, 155, 235, 59,
- 90, 167, 14, 32, 244, 155, 225, 216, 90, 167, 14, 32, 244, 155, 225, 210,
- 90, 167, 14, 32, 244, 155, 225, 206, 90, 167, 14, 32, 244, 155, 225, 207,
- 90, 167, 14, 32, 244, 155, 225, 212, 37, 244, 150, 37, 250, 189, 37, 254,
- 53, 37, 125, 37, 234, 6, 37, 233, 154, 37, 249, 163, 37, 249, 164, 228,
- 118, 37, 249, 164, 250, 231, 37, 239, 192, 37, 247, 197, 235, 238, 245,
- 105, 37, 247, 197, 235, 238, 227, 129, 37, 247, 197, 235, 238, 227, 86,
- 37, 247, 197, 235, 238, 236, 218, 37, 251, 7, 37, 233, 242, 254, 192, 37,
- 236, 1, 37, 236, 67, 57, 37, 198, 37, 177, 37, 239, 6, 37, 236, 249, 37,
- 246, 145, 37, 252, 33, 37, 239, 5, 37, 233, 100, 37, 235, 141, 37, 236,
- 67, 247, 130, 37, 236, 67, 214, 37, 236, 191, 37, 238, 229, 37, 244, 90,
- 37, 238, 201, 37, 236, 159, 37, 246, 48, 37, 226, 177, 37, 236, 67, 149,
- 37, 236, 110, 37, 249, 171, 37, 238, 161, 37, 247, 9, 37, 235, 20, 37,
- 236, 67, 185, 37, 236, 107, 37, 251, 69, 37, 238, 155, 37, 236, 108, 228,
- 118, 37, 251, 70, 228, 118, 37, 237, 69, 228, 118, 37, 238, 156, 228,
- 118, 37, 236, 108, 250, 231, 37, 251, 70, 250, 231, 37, 237, 69, 250,
- 231, 37, 238, 156, 250, 231, 37, 237, 69, 107, 193, 37, 237, 69, 107,
- 231, 35, 228, 118, 37, 213, 37, 238, 126, 37, 236, 69, 37, 245, 248, 37,
- 232, 18, 37, 232, 19, 107, 193, 37, 232, 19, 107, 231, 35, 228, 118, 37,
- 232, 184, 37, 234, 207, 37, 236, 67, 193, 37, 236, 68, 37, 232, 158, 37,
- 234, 179, 37, 236, 67, 196, 37, 236, 22, 37, 238, 81, 37, 236, 23, 236,
- 221, 37, 232, 157, 37, 234, 178, 37, 236, 67, 224, 174, 37, 236, 20, 37,
- 238, 79, 37, 236, 21, 236, 221, 37, 239, 77, 234, 81, 37, 237, 69, 234,
- 81, 37, 254, 199, 37, 252, 117, 37, 251, 247, 37, 251, 232, 37, 252, 45,
- 107, 238, 229, 37, 251, 68, 37, 250, 118, 37, 245, 183, 37, 154, 37, 244,
- 151, 37, 240, 16, 37, 238, 168, 37, 238, 156, 252, 15, 37, 238, 109, 37,
- 237, 146, 37, 237, 145, 37, 237, 139, 37, 237, 81, 37, 236, 250, 228,
- 184, 37, 236, 132, 37, 236, 96, 37, 233, 98, 37, 233, 7, 37, 232, 229,
- 37, 232, 228, 37, 228, 112, 37, 227, 202, 37, 224, 142, 37, 225, 65, 107,
- 185, 37, 102, 107, 185, 90, 167, 14, 32, 250, 121, 118, 90, 167, 14, 32,
- 250, 121, 113, 90, 167, 14, 32, 250, 121, 166, 90, 167, 14, 32, 250, 121,
- 158, 90, 167, 14, 32, 250, 121, 173, 90, 167, 14, 32, 250, 121, 183, 90,
- 167, 14, 32, 250, 121, 194, 90, 167, 14, 32, 250, 121, 187, 90, 167, 14,
- 32, 250, 121, 192, 90, 167, 14, 32, 250, 121, 227, 23, 90, 167, 14, 32,
- 250, 121, 247, 252, 90, 167, 14, 32, 250, 121, 225, 218, 90, 167, 14, 32,
- 250, 121, 226, 209, 90, 167, 14, 32, 250, 121, 246, 238, 90, 167, 14, 32,
- 250, 121, 247, 67, 90, 167, 14, 32, 250, 121, 228, 212, 90, 167, 14, 32,
- 250, 121, 229, 161, 90, 167, 14, 32, 250, 121, 248, 18, 90, 167, 14, 32,
- 250, 121, 235, 59, 90, 167, 14, 32, 250, 121, 225, 216, 90, 167, 14, 32,
- 250, 121, 225, 210, 90, 167, 14, 32, 250, 121, 225, 206, 90, 167, 14, 32,
- 250, 121, 225, 207, 90, 167, 14, 32, 250, 121, 225, 212, 90, 167, 14, 32,
- 250, 121, 225, 213, 90, 167, 14, 32, 250, 121, 225, 208, 90, 167, 14, 32,
- 250, 121, 225, 209, 90, 167, 14, 32, 250, 121, 225, 215, 90, 167, 14, 32,
- 250, 121, 225, 211, 90, 167, 14, 32, 250, 121, 226, 207, 90, 167, 14, 32,
- 250, 121, 226, 206, 37, 246, 177, 181, 32, 226, 240, 250, 251, 245, 112,
- 181, 32, 226, 240, 231, 241, 248, 48, 181, 32, 249, 234, 254, 63, 226,
- 240, 252, 225, 181, 32, 223, 168, 247, 5, 181, 32, 224, 168, 181, 32,
- 251, 41, 181, 32, 226, 240, 254, 103, 181, 32, 244, 222, 226, 121, 181,
- 32, 3, 227, 74, 181, 32, 226, 88, 181, 32, 233, 149, 181, 32, 228, 60,
- 181, 32, 247, 84, 181, 32, 245, 233, 232, 238, 181, 32, 236, 99, 181, 32,
- 247, 219, 181, 32, 247, 6, 181, 32, 224, 90, 234, 62, 226, 240, 250, 73,
- 181, 32, 254, 140, 181, 32, 251, 25, 181, 32, 252, 156, 226, 187, 181,
- 32, 245, 246, 181, 32, 228, 130, 254, 155, 181, 32, 231, 194, 181, 32,
- 239, 246, 181, 32, 245, 233, 227, 74, 181, 32, 236, 73, 251, 9, 181, 32,
- 245, 233, 232, 210, 181, 32, 226, 240, 255, 45, 224, 151, 181, 32, 226,
- 240, 251, 86, 247, 46, 181, 32, 240, 2, 181, 32, 248, 86, 181, 32, 231,
- 197, 181, 32, 245, 233, 232, 233, 181, 32, 232, 198, 181, 32, 250, 135,
- 106, 226, 240, 237, 184, 181, 32, 226, 240, 247, 112, 181, 32, 234, 34,
- 181, 32, 234, 93, 181, 32, 250, 51, 181, 32, 250, 69, 181, 32, 240, 12,
- 181, 32, 252, 109, 181, 32, 251, 56, 180, 236, 223, 181, 32, 246, 152,
- 226, 121, 181, 32, 232, 161, 225, 107, 181, 32, 234, 33, 181, 32, 226,
- 240, 224, 135, 181, 32, 231, 189, 181, 32, 226, 240, 251, 253, 181, 32,
- 226, 240, 254, 99, 226, 185, 181, 32, 226, 240, 239, 0, 228, 43, 236, 74,
- 181, 32, 250, 29, 181, 32, 226, 240, 237, 11, 237, 48, 181, 32, 255, 46,
- 181, 32, 226, 240, 224, 163, 181, 32, 226, 240, 246, 118, 224, 111, 181,
- 32, 226, 240, 239, 102, 238, 24, 181, 32, 249, 193, 181, 32, 237, 177,
- 181, 32, 239, 249, 226, 48, 181, 32, 3, 232, 210, 181, 32, 255, 9, 251,
- 48, 181, 32, 252, 227, 251, 48, 8, 4, 239, 195, 8, 4, 239, 189, 8, 4, 74,
- 8, 4, 239, 212, 8, 4, 240, 70, 8, 4, 240, 55, 8, 4, 240, 72, 8, 4, 240,
- 71, 8, 4, 254, 62, 8, 4, 254, 36, 8, 4, 57, 8, 4, 254, 157, 8, 4, 225,
- 117, 8, 4, 225, 120, 8, 4, 225, 118, 8, 4, 234, 19, 8, 4, 233, 253, 8, 4,
- 73, 8, 4, 234, 45, 8, 4, 247, 152, 8, 4, 72, 8, 4, 224, 83, 8, 4, 252,
- 157, 8, 4, 252, 154, 8, 4, 252, 181, 8, 4, 252, 165, 8, 4, 252, 175, 8,
- 4, 252, 174, 8, 4, 252, 177, 8, 4, 252, 176, 8, 4, 253, 21, 8, 4, 253,
- 18, 8, 4, 253, 70, 8, 4, 253, 37, 8, 4, 252, 73, 8, 4, 252, 77, 8, 4,
- 252, 74, 8, 4, 252, 127, 8, 4, 252, 118, 8, 4, 252, 138, 8, 4, 252, 129,
- 8, 4, 252, 193, 8, 4, 252, 238, 8, 4, 252, 205, 8, 4, 252, 63, 8, 4, 252,
- 61, 8, 4, 252, 90, 8, 4, 252, 72, 8, 4, 252, 66, 8, 4, 252, 70, 8, 4,
- 252, 49, 8, 4, 252, 48, 8, 4, 252, 54, 8, 4, 252, 52, 8, 4, 252, 50, 8,
- 4, 252, 51, 8, 4, 233, 30, 8, 4, 233, 26, 8, 4, 233, 69, 8, 4, 233, 35,
- 8, 4, 233, 44, 8, 4, 233, 64, 8, 4, 233, 62, 8, 4, 233, 167, 8, 4, 233,
- 158, 8, 4, 213, 8, 4, 233, 197, 8, 4, 232, 166, 8, 4, 232, 168, 8, 4,
- 232, 167, 8, 4, 232, 235, 8, 4, 232, 231, 8, 4, 233, 4, 8, 4, 232, 242,
- 8, 4, 232, 160, 8, 4, 232, 159, 8, 4, 232, 173, 8, 4, 232, 165, 8, 4,
- 232, 162, 8, 4, 232, 164, 8, 4, 232, 143, 8, 4, 232, 142, 8, 4, 232, 147,
- 8, 4, 232, 146, 8, 4, 232, 144, 8, 4, 232, 145, 8, 4, 253, 3, 8, 4, 253,
- 2, 8, 4, 253, 9, 8, 4, 253, 4, 8, 4, 253, 6, 8, 4, 253, 5, 8, 4, 253, 8,
- 8, 4, 253, 7, 8, 4, 253, 14, 8, 4, 253, 13, 8, 4, 253, 16, 8, 4, 253, 15,
- 8, 4, 252, 250, 8, 4, 252, 252, 8, 4, 252, 251, 8, 4, 252, 255, 8, 4,
- 252, 254, 8, 4, 253, 1, 8, 4, 253, 0, 8, 4, 253, 10, 8, 4, 253, 12, 8, 4,
- 253, 11, 8, 4, 252, 246, 8, 4, 252, 245, 8, 4, 252, 253, 8, 4, 252, 249,
- 8, 4, 252, 247, 8, 4, 252, 248, 8, 4, 252, 242, 8, 4, 252, 241, 8, 4,
- 252, 244, 8, 4, 252, 243, 8, 4, 235, 208, 8, 4, 235, 207, 8, 4, 235, 213,
- 8, 4, 235, 209, 8, 4, 235, 210, 8, 4, 235, 212, 8, 4, 235, 211, 8, 4,
- 235, 215, 8, 4, 235, 214, 8, 4, 235, 217, 8, 4, 235, 216, 8, 4, 235, 204,
- 8, 4, 235, 203, 8, 4, 235, 206, 8, 4, 235, 205, 8, 4, 235, 198, 8, 4,
- 235, 197, 8, 4, 235, 202, 8, 4, 235, 201, 8, 4, 235, 199, 8, 4, 235, 200,
- 8, 4, 235, 192, 8, 4, 235, 191, 8, 4, 235, 196, 8, 4, 235, 195, 8, 4,
- 235, 193, 8, 4, 235, 194, 8, 4, 245, 13, 8, 4, 245, 12, 8, 4, 245, 18, 8,
- 4, 245, 14, 8, 4, 245, 15, 8, 4, 245, 17, 8, 4, 245, 16, 8, 4, 245, 20,
- 8, 4, 245, 19, 8, 4, 245, 22, 8, 4, 245, 21, 8, 4, 245, 4, 8, 4, 245, 6,
- 8, 4, 245, 5, 8, 4, 245, 9, 8, 4, 245, 8, 8, 4, 245, 11, 8, 4, 245, 10,
- 8, 4, 245, 0, 8, 4, 244, 255, 8, 4, 245, 7, 8, 4, 245, 3, 8, 4, 245, 1,
- 8, 4, 245, 2, 8, 4, 244, 250, 8, 4, 244, 254, 8, 4, 244, 253, 8, 4, 244,
- 251, 8, 4, 244, 252, 8, 4, 236, 112, 8, 4, 236, 111, 8, 4, 236, 157, 8,
- 4, 236, 117, 8, 4, 236, 139, 8, 4, 236, 151, 8, 4, 236, 150, 8, 4, 237,
- 2, 8, 4, 236, 254, 8, 4, 198, 8, 4, 237, 28, 8, 4, 236, 43, 8, 4, 236,
- 42, 8, 4, 236, 45, 8, 4, 236, 44, 8, 4, 236, 78, 8, 4, 236, 70, 8, 4,
- 236, 103, 8, 4, 236, 82, 8, 4, 236, 193, 8, 4, 236, 235, 8, 4, 236, 27,
- 8, 4, 236, 24, 8, 4, 236, 66, 8, 4, 236, 39, 8, 4, 236, 34, 8, 4, 236,
- 37, 8, 4, 236, 7, 8, 4, 236, 6, 8, 4, 236, 11, 8, 4, 236, 9, 8, 4, 247,
- 39, 8, 4, 247, 35, 8, 4, 247, 70, 8, 4, 247, 47, 8, 4, 247, 106, 8, 4,
- 247, 100, 8, 4, 247, 129, 8, 4, 247, 108, 8, 4, 246, 236, 8, 4, 247, 7,
- 8, 4, 246, 255, 8, 4, 246, 208, 8, 4, 246, 207, 8, 4, 246, 219, 8, 4,
- 246, 213, 8, 4, 246, 211, 8, 4, 246, 212, 8, 4, 246, 198, 8, 4, 246, 197,
- 8, 4, 246, 201, 8, 4, 246, 199, 8, 4, 224, 208, 8, 4, 224, 207, 8, 4,
- 224, 228, 8, 4, 224, 217, 8, 4, 224, 223, 8, 4, 224, 221, 8, 4, 224, 225,
- 8, 4, 224, 224, 8, 4, 225, 49, 8, 4, 225, 45, 8, 4, 225, 64, 8, 4, 225,
- 59, 8, 4, 224, 196, 8, 4, 224, 192, 8, 4, 224, 206, 8, 4, 224, 197, 8, 4,
- 224, 229, 8, 4, 225, 34, 8, 4, 224, 185, 8, 4, 224, 184, 8, 4, 224, 190,
- 8, 4, 224, 188, 8, 4, 224, 186, 8, 4, 224, 187, 8, 4, 224, 178, 8, 4,
- 224, 177, 8, 4, 224, 182, 8, 4, 224, 181, 8, 4, 224, 179, 8, 4, 224, 180,
- 8, 4, 249, 190, 8, 4, 249, 178, 8, 4, 250, 4, 8, 4, 249, 207, 8, 4, 249,
- 239, 8, 4, 249, 243, 8, 4, 249, 242, 8, 4, 250, 127, 8, 4, 250, 122, 8,
- 4, 250, 189, 8, 4, 250, 146, 8, 4, 248, 91, 8, 4, 248, 92, 8, 4, 249,
- 140, 8, 4, 248, 123, 8, 4, 249, 161, 8, 4, 249, 142, 8, 4, 250, 27, 8, 4,
- 250, 77, 8, 4, 250, 39, 8, 4, 248, 84, 8, 4, 248, 82, 8, 4, 248, 107, 8,
- 4, 248, 90, 8, 4, 248, 85, 8, 4, 248, 88, 8, 4, 226, 144, 8, 4, 226, 140,
- 8, 4, 226, 175, 8, 4, 226, 150, 8, 4, 226, 168, 8, 4, 226, 170, 8, 4,
- 226, 169, 8, 4, 227, 66, 8, 4, 227, 53, 8, 4, 227, 107, 8, 4, 227, 70, 8,
- 4, 225, 240, 8, 4, 225, 239, 8, 4, 225, 242, 8, 4, 225, 241, 8, 4, 226,
- 99, 8, 4, 226, 97, 8, 4, 96, 8, 4, 226, 105, 8, 4, 227, 0, 8, 4, 227, 44,
- 8, 4, 227, 17, 8, 4, 225, 228, 8, 4, 225, 225, 8, 4, 225, 250, 8, 4, 225,
- 238, 8, 4, 225, 229, 8, 4, 225, 236, 8, 4, 250, 94, 8, 4, 250, 93, 8, 4,
- 250, 99, 8, 4, 250, 95, 8, 4, 250, 96, 8, 4, 250, 98, 8, 4, 250, 97, 8,
- 4, 250, 110, 8, 4, 250, 109, 8, 4, 250, 117, 8, 4, 250, 111, 8, 4, 250,
- 84, 8, 4, 250, 86, 8, 4, 250, 85, 8, 4, 250, 89, 8, 4, 250, 88, 8, 4,
- 250, 92, 8, 4, 250, 90, 8, 4, 250, 102, 8, 4, 250, 105, 8, 4, 250, 103,
- 8, 4, 250, 80, 8, 4, 250, 79, 8, 4, 250, 87, 8, 4, 250, 83, 8, 4, 250,
- 81, 8, 4, 250, 82, 8, 4, 235, 177, 8, 4, 235, 176, 8, 4, 235, 181, 8, 4,
- 235, 178, 8, 4, 235, 179, 8, 4, 235, 180, 8, 4, 235, 187, 8, 4, 235, 186,
- 8, 4, 235, 189, 8, 4, 235, 188, 8, 4, 235, 171, 8, 4, 235, 170, 8, 4,
- 235, 175, 8, 4, 235, 172, 8, 4, 235, 182, 8, 4, 235, 185, 8, 4, 235, 183,
- 8, 4, 235, 165, 8, 4, 235, 164, 8, 4, 235, 169, 8, 4, 235, 168, 8, 4,
- 235, 166, 8, 4, 235, 167, 8, 4, 244, 236, 8, 4, 244, 235, 8, 4, 244, 242,
- 8, 4, 244, 237, 8, 4, 244, 239, 8, 4, 244, 238, 8, 4, 244, 241, 8, 4,
- 244, 240, 8, 4, 244, 247, 8, 4, 244, 246, 8, 4, 244, 249, 8, 4, 244, 248,
- 8, 4, 244, 230, 8, 4, 244, 231, 8, 4, 244, 233, 8, 4, 244, 232, 8, 4,
- 244, 234, 8, 4, 244, 243, 8, 4, 244, 245, 8, 4, 244, 244, 8, 4, 244, 229,
- 8, 4, 235, 52, 8, 4, 235, 51, 8, 4, 235, 89, 8, 4, 235, 55, 8, 4, 235,
- 73, 8, 4, 235, 85, 8, 4, 235, 84, 8, 4, 235, 220, 8, 4, 236, 1, 8, 4,
- 235, 231, 8, 4, 234, 187, 8, 4, 234, 189, 8, 4, 234, 188, 8, 4, 234, 242,
- 8, 4, 234, 231, 8, 4, 235, 6, 8, 4, 234, 249, 8, 4, 235, 143, 8, 4, 235,
- 162, 8, 4, 235, 151, 8, 4, 234, 183, 8, 4, 234, 180, 8, 4, 234, 206, 8,
- 4, 234, 186, 8, 4, 234, 184, 8, 4, 234, 185, 8, 4, 245, 42, 8, 4, 245,
- 41, 8, 4, 245, 47, 8, 4, 245, 43, 8, 4, 245, 44, 8, 4, 245, 46, 8, 4,
- 245, 45, 8, 4, 245, 52, 8, 4, 245, 51, 8, 4, 245, 54, 8, 4, 245, 53, 8,
- 4, 245, 34, 8, 4, 245, 36, 8, 4, 245, 35, 8, 4, 245, 38, 8, 4, 245, 40,
- 8, 4, 245, 39, 8, 4, 245, 48, 8, 4, 245, 50, 8, 4, 245, 49, 8, 4, 245,
- 30, 8, 4, 245, 29, 8, 4, 245, 37, 8, 4, 245, 33, 8, 4, 245, 31, 8, 4,
- 245, 32, 8, 4, 245, 24, 8, 4, 245, 23, 8, 4, 245, 28, 8, 4, 245, 27, 8,
- 4, 245, 25, 8, 4, 245, 26, 8, 4, 237, 157, 8, 4, 237, 153, 8, 4, 237,
- 193, 8, 4, 237, 161, 8, 4, 237, 187, 8, 4, 237, 186, 8, 4, 237, 189, 8,
- 4, 237, 188, 8, 4, 238, 4, 8, 4, 237, 252, 8, 4, 238, 43, 8, 4, 238, 10,
- 8, 4, 237, 96, 8, 4, 237, 95, 8, 4, 237, 98, 8, 4, 237, 97, 8, 4, 237,
- 120, 8, 4, 237, 115, 8, 4, 237, 143, 8, 4, 237, 122, 8, 4, 237, 208, 8,
- 4, 237, 243, 8, 4, 237, 215, 8, 4, 237, 91, 8, 4, 237, 90, 8, 4, 237,
- 110, 8, 4, 237, 94, 8, 4, 237, 92, 8, 4, 237, 93, 8, 4, 237, 73, 8, 4,
- 237, 72, 8, 4, 237, 80, 8, 4, 237, 76, 8, 4, 237, 74, 8, 4, 237, 75, 8,
- 4, 246, 23, 8, 4, 246, 22, 8, 4, 246, 46, 8, 4, 246, 32, 8, 4, 246, 39,
- 8, 4, 246, 38, 8, 4, 246, 41, 8, 4, 246, 40, 8, 4, 246, 154, 8, 4, 246,
- 149, 8, 4, 246, 193, 8, 4, 246, 163, 8, 4, 245, 201, 8, 4, 245, 200, 8,
- 4, 245, 203, 8, 4, 245, 202, 8, 4, 245, 251, 8, 4, 245, 249, 8, 4, 246,
- 11, 8, 4, 246, 3, 8, 4, 246, 105, 8, 4, 246, 103, 8, 4, 246, 131, 8, 4,
- 246, 115, 8, 4, 245, 191, 8, 4, 245, 190, 8, 4, 245, 218, 8, 4, 245, 199,
- 8, 4, 245, 192, 8, 4, 245, 198, 8, 4, 238, 176, 8, 4, 238, 175, 8, 4,
- 238, 199, 8, 4, 238, 186, 8, 4, 238, 193, 8, 4, 238, 195, 8, 4, 238, 194,
- 8, 4, 239, 20, 8, 4, 239, 11, 8, 4, 177, 8, 4, 239, 41, 8, 4, 238, 94, 8,
- 4, 238, 96, 8, 4, 238, 95, 8, 4, 238, 130, 8, 4, 238, 127, 8, 4, 238,
- 150, 8, 4, 238, 136, 8, 4, 238, 236, 8, 4, 238, 234, 8, 4, 239, 3, 8, 4,
- 238, 238, 8, 4, 238, 84, 8, 4, 238, 82, 8, 4, 238, 107, 8, 4, 238, 93, 8,
- 4, 238, 87, 8, 4, 238, 91, 8, 4, 246, 87, 8, 4, 246, 86, 8, 4, 246, 91,
- 8, 4, 246, 88, 8, 4, 246, 90, 8, 4, 246, 89, 8, 4, 246, 98, 8, 4, 246,
- 97, 8, 4, 246, 101, 8, 4, 246, 99, 8, 4, 246, 78, 8, 4, 246, 77, 8, 4,
- 246, 80, 8, 4, 246, 79, 8, 4, 246, 83, 8, 4, 246, 82, 8, 4, 246, 85, 8,
- 4, 246, 84, 8, 4, 246, 93, 8, 4, 246, 92, 8, 4, 246, 96, 8, 4, 246, 94,
- 8, 4, 246, 73, 8, 4, 246, 72, 8, 4, 246, 81, 8, 4, 246, 76, 8, 4, 246,
- 74, 8, 4, 246, 75, 8, 4, 236, 175, 8, 4, 236, 176, 8, 4, 236, 188, 8, 4,
- 236, 187, 8, 4, 236, 190, 8, 4, 236, 189, 8, 4, 236, 166, 8, 4, 236, 168,
- 8, 4, 236, 167, 8, 4, 236, 171, 8, 4, 236, 170, 8, 4, 236, 173, 8, 4,
- 236, 172, 8, 4, 236, 177, 8, 4, 236, 179, 8, 4, 236, 178, 8, 4, 236, 162,
- 8, 4, 236, 161, 8, 4, 236, 169, 8, 4, 236, 165, 8, 4, 236, 163, 8, 4,
- 236, 164, 8, 4, 244, 107, 8, 4, 244, 106, 8, 4, 244, 113, 8, 4, 244, 108,
- 8, 4, 244, 110, 8, 4, 244, 109, 8, 4, 244, 112, 8, 4, 244, 111, 8, 4,
- 244, 118, 8, 4, 244, 117, 8, 4, 244, 120, 8, 4, 244, 119, 8, 4, 244, 99,
- 8, 4, 244, 98, 8, 4, 244, 101, 8, 4, 244, 100, 8, 4, 244, 103, 8, 4, 244,
- 102, 8, 4, 244, 105, 8, 4, 244, 104, 8, 4, 244, 114, 8, 4, 244, 116, 8,
- 4, 244, 115, 8, 4, 235, 111, 8, 4, 235, 113, 8, 4, 235, 112, 8, 4, 235,
- 130, 8, 4, 235, 129, 8, 4, 235, 137, 8, 4, 235, 132, 8, 4, 235, 96, 8, 4,
- 235, 95, 8, 4, 235, 97, 8, 4, 235, 101, 8, 4, 235, 100, 8, 4, 235, 107,
- 8, 4, 235, 102, 8, 4, 235, 124, 8, 4, 235, 128, 8, 4, 235, 125, 8, 4,
- 245, 57, 8, 4, 245, 64, 8, 4, 245, 71, 8, 4, 245, 132, 8, 4, 245, 126, 8,
- 4, 154, 8, 4, 245, 142, 8, 4, 244, 131, 8, 4, 244, 130, 8, 4, 244, 133,
- 8, 4, 244, 132, 8, 4, 244, 157, 8, 4, 244, 152, 8, 4, 244, 227, 8, 4,
- 244, 214, 8, 4, 245, 87, 8, 4, 245, 121, 8, 4, 245, 97, 8, 4, 224, 154,
- 8, 4, 224, 143, 8, 4, 224, 173, 8, 4, 224, 162, 8, 4, 224, 78, 8, 4, 224,
- 80, 8, 4, 224, 79, 8, 4, 224, 88, 8, 4, 224, 105, 8, 4, 224, 93, 8, 4,
- 224, 128, 8, 4, 224, 141, 8, 4, 224, 132, 8, 4, 223, 34, 8, 4, 223, 33,
- 8, 4, 223, 47, 8, 4, 223, 35, 8, 4, 223, 40, 8, 4, 223, 42, 8, 4, 223,
- 41, 8, 4, 223, 104, 8, 4, 223, 101, 8, 4, 223, 117, 8, 4, 223, 107, 8, 4,
- 223, 12, 8, 4, 223, 14, 8, 4, 223, 13, 8, 4, 223, 23, 8, 4, 223, 22, 8,
- 4, 223, 27, 8, 4, 223, 24, 8, 4, 223, 87, 8, 4, 223, 97, 8, 4, 223, 91,
- 8, 4, 223, 8, 8, 4, 223, 7, 8, 4, 223, 19, 8, 4, 223, 11, 8, 4, 223, 9,
- 8, 4, 223, 10, 8, 4, 222, 255, 8, 4, 222, 254, 8, 4, 223, 4, 8, 4, 223,
- 2, 8, 4, 223, 0, 8, 4, 223, 1, 8, 4, 251, 100, 8, 4, 251, 97, 8, 4, 251,
- 118, 8, 4, 251, 108, 8, 4, 251, 115, 8, 4, 251, 111, 8, 4, 251, 117, 8,
- 4, 251, 116, 8, 4, 252, 0, 8, 4, 251, 250, 8, 4, 252, 39, 8, 4, 252, 16,
- 8, 4, 250, 227, 8, 4, 250, 229, 8, 4, 250, 228, 8, 4, 251, 3, 8, 4, 250,
- 252, 8, 4, 251, 68, 8, 4, 251, 16, 8, 4, 251, 206, 8, 4, 251, 231, 8, 4,
- 251, 209, 8, 4, 250, 212, 8, 4, 250, 211, 8, 4, 250, 235, 8, 4, 250, 226,
- 8, 4, 250, 215, 8, 4, 250, 225, 8, 4, 250, 194, 8, 4, 250, 193, 8, 4,
- 250, 202, 8, 4, 250, 199, 8, 4, 250, 195, 8, 4, 250, 197, 8, 4, 222, 238,
- 8, 4, 222, 237, 8, 4, 222, 244, 8, 4, 222, 239, 8, 4, 222, 241, 8, 4,
- 222, 240, 8, 4, 222, 243, 8, 4, 222, 242, 8, 4, 222, 250, 8, 4, 222, 249,
- 8, 4, 222, 253, 8, 4, 222, 251, 8, 4, 222, 234, 8, 4, 222, 236, 8, 4,
- 222, 235, 8, 4, 222, 245, 8, 4, 222, 248, 8, 4, 222, 246, 8, 4, 222, 229,
- 8, 4, 222, 233, 8, 4, 222, 232, 8, 4, 222, 230, 8, 4, 222, 231, 8, 4,
- 222, 224, 8, 4, 222, 223, 8, 4, 222, 228, 8, 4, 222, 227, 8, 4, 222, 225,
- 8, 4, 222, 226, 8, 4, 234, 127, 8, 4, 234, 126, 8, 4, 234, 132, 8, 4,
- 234, 128, 8, 4, 234, 129, 8, 4, 234, 131, 8, 4, 234, 130, 8, 4, 234, 136,
- 8, 4, 234, 135, 8, 4, 234, 138, 8, 4, 234, 137, 8, 4, 234, 121, 8, 4,
- 234, 122, 8, 4, 234, 124, 8, 4, 234, 125, 8, 4, 234, 133, 8, 4, 234, 134,
- 8, 4, 234, 117, 8, 4, 234, 123, 8, 4, 234, 120, 8, 4, 234, 118, 8, 4,
- 234, 119, 8, 4, 234, 112, 8, 4, 234, 111, 8, 4, 234, 116, 8, 4, 234, 115,
- 8, 4, 234, 113, 8, 4, 234, 114, 8, 4, 228, 218, 8, 4, 183, 8, 4, 229, 15,
- 8, 4, 228, 220, 8, 4, 229, 8, 8, 4, 229, 10, 8, 4, 229, 9, 8, 4, 230,
- 240, 8, 4, 230, 236, 8, 4, 231, 31, 8, 4, 230, 246, 8, 4, 227, 223, 8, 4,
- 227, 225, 8, 4, 227, 224, 8, 4, 228, 157, 8, 4, 228, 148, 8, 4, 228, 169,
- 8, 4, 228, 158, 8, 4, 229, 157, 8, 4, 230, 213, 8, 4, 229, 175, 8, 4,
- 227, 204, 8, 4, 227, 203, 8, 4, 228, 6, 8, 4, 227, 222, 8, 4, 227, 206,
- 8, 4, 227, 213, 8, 4, 227, 123, 8, 4, 227, 122, 8, 4, 227, 185, 8, 4,
- 227, 128, 8, 4, 227, 124, 8, 4, 227, 127, 8, 4, 228, 86, 8, 4, 228, 85,
- 8, 4, 228, 91, 8, 4, 228, 87, 8, 4, 228, 88, 8, 4, 228, 90, 8, 4, 228,
- 89, 8, 4, 228, 97, 8, 4, 228, 96, 8, 4, 228, 110, 8, 4, 228, 98, 8, 4,
- 228, 82, 8, 4, 228, 81, 8, 4, 228, 84, 8, 4, 228, 83, 8, 4, 228, 92, 8,
- 4, 228, 95, 8, 4, 228, 93, 8, 4, 228, 78, 8, 4, 228, 77, 8, 4, 228, 80,
- 8, 4, 228, 79, 8, 4, 228, 72, 8, 4, 228, 71, 8, 4, 228, 76, 8, 4, 228,
- 75, 8, 4, 228, 73, 8, 4, 228, 74, 8, 4, 223, 80, 8, 4, 223, 79, 8, 4,
- 223, 85, 8, 4, 223, 82, 8, 4, 223, 62, 8, 4, 223, 64, 8, 4, 223, 63, 8,
- 4, 223, 67, 8, 4, 223, 66, 8, 4, 223, 70, 8, 4, 223, 68, 8, 4, 223, 74,
- 8, 4, 223, 73, 8, 4, 223, 77, 8, 4, 223, 75, 8, 4, 223, 58, 8, 4, 223,
- 57, 8, 4, 223, 65, 8, 4, 223, 61, 8, 4, 223, 59, 8, 4, 223, 60, 8, 4,
- 223, 50, 8, 4, 223, 49, 8, 4, 223, 54, 8, 4, 223, 53, 8, 4, 223, 51, 8,
- 4, 223, 52, 8, 4, 251, 187, 8, 4, 251, 184, 8, 4, 251, 204, 8, 4, 251,
- 193, 8, 4, 251, 132, 8, 4, 251, 131, 8, 4, 251, 134, 8, 4, 251, 133, 8,
- 4, 251, 144, 8, 4, 251, 143, 8, 4, 251, 150, 8, 4, 251, 146, 8, 4, 251,
- 174, 8, 4, 251, 172, 8, 4, 251, 182, 8, 4, 251, 176, 8, 4, 251, 126, 8,
- 4, 251, 136, 8, 4, 251, 130, 8, 4, 251, 127, 8, 4, 251, 129, 8, 4, 251,
- 120, 8, 4, 251, 119, 8, 4, 251, 124, 8, 4, 251, 123, 8, 4, 251, 121, 8,
- 4, 251, 122, 8, 4, 231, 98, 8, 4, 231, 99, 8, 4, 231, 85, 8, 4, 231, 86,
- 8, 4, 231, 89, 8, 4, 231, 88, 8, 4, 231, 91, 8, 4, 231, 90, 8, 4, 231,
- 93, 8, 4, 231, 92, 8, 4, 231, 97, 8, 4, 231, 94, 8, 4, 231, 81, 8, 4,
- 231, 80, 8, 4, 231, 87, 8, 4, 231, 84, 8, 4, 231, 82, 8, 4, 231, 83, 8,
- 4, 231, 75, 8, 4, 231, 74, 8, 4, 231, 79, 8, 4, 231, 78, 8, 4, 231, 76,
- 8, 4, 231, 77, 8, 4, 234, 228, 8, 4, 234, 227, 8, 4, 234, 230, 8, 4, 234,
- 229, 8, 4, 234, 220, 8, 4, 234, 222, 8, 4, 234, 221, 8, 4, 234, 224, 8,
- 4, 234, 223, 8, 4, 234, 226, 8, 4, 234, 225, 8, 4, 234, 215, 8, 4, 234,
- 214, 8, 4, 234, 219, 8, 4, 234, 218, 8, 4, 234, 216, 8, 4, 234, 217, 8,
- 4, 234, 209, 8, 4, 234, 208, 8, 4, 234, 213, 8, 4, 234, 212, 8, 4, 234,
- 210, 8, 4, 234, 211, 8, 4, 229, 120, 8, 4, 229, 117, 8, 4, 229, 146, 8,
- 4, 229, 129, 8, 4, 229, 36, 8, 4, 229, 38, 8, 4, 229, 37, 8, 4, 229, 49,
- 8, 4, 229, 47, 8, 4, 229, 71, 8, 4, 229, 64, 8, 4, 229, 94, 8, 4, 229,
- 92, 8, 4, 229, 114, 8, 4, 229, 101, 8, 4, 229, 32, 8, 4, 229, 31, 8, 4,
- 229, 43, 8, 4, 229, 35, 8, 4, 229, 33, 8, 4, 229, 34, 8, 4, 229, 18, 8,
- 4, 229, 17, 8, 4, 229, 23, 8, 4, 229, 21, 8, 4, 229, 19, 8, 4, 229, 20,
- 8, 4, 231, 253, 8, 4, 231, 251, 8, 4, 208, 8, 4, 232, 1, 8, 4, 231, 56,
- 8, 4, 231, 58, 8, 4, 231, 57, 8, 4, 231, 107, 8, 4, 231, 101, 8, 4, 231,
- 122, 8, 4, 231, 110, 8, 4, 231, 188, 8, 4, 231, 244, 8, 4, 231, 215, 8,
- 4, 231, 49, 8, 4, 231, 47, 8, 4, 231, 70, 8, 4, 231, 55, 8, 4, 231, 51,
- 8, 4, 231, 52, 8, 4, 231, 38, 8, 4, 231, 37, 8, 4, 231, 43, 8, 4, 231,
- 41, 8, 4, 231, 39, 8, 4, 231, 40, 8, 4, 239, 147, 8, 4, 239, 146, 8, 4,
- 239, 156, 8, 4, 239, 148, 8, 4, 239, 152, 8, 4, 239, 151, 8, 4, 239, 154,
- 8, 4, 239, 153, 8, 4, 239, 92, 8, 4, 239, 91, 8, 4, 239, 94, 8, 4, 239,
- 93, 8, 4, 239, 105, 8, 4, 239, 104, 8, 4, 239, 117, 8, 4, 239, 107, 8, 4,
- 239, 86, 8, 4, 239, 85, 8, 4, 239, 101, 8, 4, 239, 90, 8, 4, 239, 87, 8,
- 4, 239, 88, 8, 4, 239, 79, 8, 4, 239, 78, 8, 4, 239, 83, 8, 4, 239, 82,
- 8, 4, 239, 80, 8, 4, 239, 81, 8, 4, 232, 97, 8, 4, 232, 96, 8, 4, 232,
- 104, 8, 4, 232, 98, 8, 4, 232, 101, 8, 4, 232, 100, 8, 4, 232, 103, 8, 4,
- 232, 102, 8, 4, 232, 58, 8, 4, 232, 55, 8, 4, 232, 60, 8, 4, 232, 59, 8,
- 4, 232, 87, 8, 4, 232, 86, 8, 4, 232, 95, 8, 4, 232, 89, 8, 4, 232, 50,
- 8, 4, 232, 46, 8, 4, 232, 84, 8, 4, 232, 54, 8, 4, 232, 52, 8, 4, 232,
- 53, 8, 4, 232, 30, 8, 4, 232, 28, 8, 4, 232, 40, 8, 4, 232, 33, 8, 4,
- 232, 31, 8, 4, 232, 32, 8, 4, 239, 136, 8, 4, 239, 135, 8, 4, 239, 142,
- 8, 4, 239, 137, 8, 4, 239, 139, 8, 4, 239, 138, 8, 4, 239, 141, 8, 4,
- 239, 140, 8, 4, 239, 127, 8, 4, 239, 129, 8, 4, 239, 128, 8, 4, 239, 132,
- 8, 4, 239, 131, 8, 4, 239, 134, 8, 4, 239, 133, 8, 4, 239, 123, 8, 4,
- 239, 122, 8, 4, 239, 130, 8, 4, 239, 126, 8, 4, 239, 124, 8, 4, 239, 125,
- 8, 4, 239, 119, 8, 4, 239, 118, 8, 4, 239, 121, 8, 4, 239, 120, 8, 4,
- 235, 40, 8, 4, 235, 39, 8, 4, 235, 46, 8, 4, 235, 41, 8, 4, 235, 43, 8,
- 4, 235, 42, 8, 4, 235, 45, 8, 4, 235, 44, 8, 4, 235, 31, 8, 4, 235, 32,
- 8, 4, 235, 35, 8, 4, 235, 34, 8, 4, 235, 38, 8, 4, 235, 36, 8, 4, 235,
- 27, 8, 4, 235, 33, 8, 4, 235, 30, 8, 4, 235, 28, 8, 4, 235, 29, 8, 4,
- 235, 22, 8, 4, 235, 21, 8, 4, 235, 26, 8, 4, 235, 25, 8, 4, 235, 23, 8,
- 4, 235, 24, 8, 4, 234, 155, 8, 4, 234, 154, 8, 4, 234, 163, 8, 4, 234,
- 157, 8, 4, 234, 160, 8, 4, 234, 159, 8, 4, 234, 162, 8, 4, 234, 161, 8,
- 4, 234, 143, 8, 4, 234, 145, 8, 4, 234, 144, 8, 4, 234, 148, 8, 4, 234,
- 147, 8, 4, 234, 152, 8, 4, 234, 149, 8, 4, 234, 141, 8, 4, 234, 140, 8,
- 4, 234, 146, 8, 4, 234, 142, 8, 4, 224, 57, 8, 4, 224, 56, 8, 4, 224, 64,
- 8, 4, 224, 59, 8, 4, 224, 61, 8, 4, 224, 60, 8, 4, 224, 63, 8, 4, 224,
- 62, 8, 4, 224, 46, 8, 4, 224, 47, 8, 4, 224, 51, 8, 4, 224, 50, 8, 4,
- 224, 55, 8, 4, 224, 53, 8, 4, 224, 29, 8, 4, 224, 27, 8, 4, 224, 39, 8,
- 4, 224, 32, 8, 4, 224, 30, 8, 4, 224, 31, 8, 4, 223, 189, 8, 4, 223, 187,
- 8, 4, 223, 202, 8, 4, 223, 190, 8, 4, 223, 197, 8, 4, 223, 196, 8, 4,
- 223, 199, 8, 4, 223, 198, 8, 4, 223, 145, 8, 4, 223, 144, 8, 4, 223, 147,
- 8, 4, 223, 146, 8, 4, 223, 169, 8, 4, 223, 166, 8, 4, 223, 183, 8, 4,
- 223, 171, 8, 4, 223, 138, 8, 4, 223, 136, 8, 4, 223, 158, 8, 4, 223, 143,
- 8, 4, 223, 141, 8, 4, 223, 142, 8, 4, 223, 122, 8, 4, 223, 121, 8, 4,
- 223, 127, 8, 4, 223, 125, 8, 4, 223, 123, 8, 4, 223, 124, 8, 29, 232, 87,
- 8, 29, 237, 193, 8, 29, 238, 176, 8, 29, 234, 157, 8, 29, 250, 199, 8,
- 29, 228, 91, 8, 29, 246, 84, 8, 29, 246, 115, 8, 29, 236, 157, 8, 29,
- 244, 107, 8, 29, 237, 75, 8, 29, 252, 246, 8, 29, 236, 82, 8, 29, 223,
- 183, 8, 29, 232, 160, 8, 29, 244, 101, 8, 29, 227, 66, 8, 29, 246, 193,
- 8, 29, 223, 11, 8, 29, 250, 194, 8, 29, 250, 82, 8, 29, 252, 70, 8, 29,
- 246, 80, 8, 29, 234, 149, 8, 29, 225, 250, 8, 29, 234, 45, 8, 29, 239,
- 123, 8, 29, 223, 23, 8, 29, 232, 143, 8, 29, 245, 11, 8, 29, 223, 189, 8,
- 29, 224, 187, 8, 29, 229, 23, 8, 29, 225, 34, 8, 29, 223, 117, 8, 29,
- 239, 117, 8, 29, 234, 120, 8, 29, 239, 121, 8, 29, 245, 251, 8, 29, 239,
- 141, 8, 29, 224, 105, 8, 29, 248, 107, 8, 29, 229, 34, 8, 29, 237, 189,
- 8, 29, 250, 202, 8, 29, 250, 228, 8, 29, 251, 108, 8, 29, 244, 104, 8,
- 29, 229, 120, 8, 29, 223, 10, 8, 29, 229, 64, 8, 29, 251, 182, 8, 29,
- 222, 241, 8, 29, 235, 212, 8, 29, 239, 3, 34, 4, 248, 35, 34, 4, 248, 32,
- 34, 4, 245, 109, 34, 4, 224, 138, 34, 4, 224, 137, 34, 4, 233, 144, 34,
- 4, 252, 188, 34, 4, 252, 232, 34, 4, 236, 243, 34, 4, 238, 123, 34, 4,
- 236, 184, 34, 4, 246, 141, 34, 4, 247, 92, 34, 4, 225, 38, 34, 4, 227,
- 37, 34, 4, 226, 238, 34, 4, 250, 16, 34, 4, 250, 13, 34, 4, 237, 239, 34,
- 4, 231, 229, 34, 4, 250, 67, 34, 4, 235, 184, 34, 4, 230, 203, 34, 4,
- 229, 112, 34, 4, 223, 95, 34, 4, 223, 76, 34, 4, 251, 225, 34, 4, 239,
- 169, 34, 4, 235, 47, 34, 4, 223, 225, 34, 4, 239, 2, 34, 4, 235, 120, 34,
- 4, 246, 125, 34, 4, 236, 226, 34, 4, 235, 160, 34, 4, 234, 168, 34, 4,
- 74, 34, 4, 240, 16, 34, 4, 245, 75, 34, 4, 245, 60, 34, 4, 224, 118, 34,
- 4, 224, 112, 34, 4, 233, 69, 34, 4, 252, 186, 34, 4, 252, 181, 34, 4,
- 236, 242, 34, 4, 238, 121, 34, 4, 236, 183, 34, 4, 246, 139, 34, 4, 247,
- 70, 34, 4, 224, 228, 34, 4, 226, 175, 34, 4, 226, 220, 34, 4, 250, 8, 34,
- 4, 250, 12, 34, 4, 237, 193, 34, 4, 231, 180, 34, 4, 250, 4, 34, 4, 235,
- 181, 34, 4, 229, 15, 34, 4, 229, 90, 34, 4, 223, 47, 34, 4, 223, 72, 34,
- 4, 251, 118, 34, 4, 239, 156, 34, 4, 235, 46, 34, 4, 223, 202, 34, 4,
- 238, 199, 34, 4, 235, 118, 34, 4, 246, 46, 34, 4, 236, 157, 34, 4, 235,
- 89, 34, 4, 234, 163, 34, 4, 57, 34, 4, 254, 190, 34, 4, 235, 133, 34, 4,
- 154, 34, 4, 245, 148, 34, 4, 224, 173, 34, 4, 224, 164, 34, 4, 213, 34,
- 4, 252, 190, 34, 4, 253, 70, 34, 4, 236, 245, 34, 4, 238, 126, 34, 4,
- 238, 125, 34, 4, 236, 186, 34, 4, 246, 144, 34, 4, 247, 129, 34, 4, 225,
- 64, 34, 4, 227, 107, 34, 4, 226, 251, 34, 4, 250, 22, 34, 4, 250, 15, 34,
- 4, 238, 43, 34, 4, 208, 34, 4, 250, 189, 34, 4, 235, 189, 34, 4, 231, 31,
- 34, 4, 229, 146, 34, 4, 223, 117, 34, 4, 223, 85, 34, 4, 252, 39, 34, 4,
- 239, 179, 34, 4, 235, 49, 34, 4, 191, 34, 4, 177, 34, 4, 239, 46, 34, 4,
- 235, 122, 34, 4, 246, 193, 34, 4, 198, 34, 4, 236, 1, 34, 4, 234, 173,
- 34, 4, 234, 52, 34, 4, 234, 49, 34, 4, 244, 218, 34, 4, 224, 98, 34, 4,
- 224, 94, 34, 4, 232, 244, 34, 4, 252, 184, 34, 4, 252, 131, 34, 4, 236,
- 240, 34, 4, 238, 119, 34, 4, 236, 181, 34, 4, 246, 136, 34, 4, 247, 3,
- 34, 4, 224, 198, 34, 4, 226, 108, 34, 4, 226, 198, 34, 4, 250, 6, 34, 4,
- 250, 10, 34, 4, 237, 125, 34, 4, 231, 114, 34, 4, 249, 145, 34, 4, 235,
- 173, 34, 4, 228, 159, 34, 4, 229, 66, 34, 4, 223, 25, 34, 4, 223, 69, 34,
- 4, 251, 17, 34, 4, 239, 108, 34, 4, 235, 37, 34, 4, 223, 172, 34, 4, 238,
- 139, 34, 4, 235, 116, 34, 4, 246, 4, 34, 4, 236, 86, 34, 4, 234, 253, 34,
- 4, 234, 150, 34, 4, 66, 34, 4, 225, 138, 34, 4, 244, 145, 34, 4, 244,
- 137, 34, 4, 224, 83, 34, 4, 224, 82, 34, 4, 232, 173, 34, 4, 252, 183,
- 34, 4, 252, 90, 34, 4, 236, 239, 34, 4, 238, 118, 34, 4, 236, 180, 34, 4,
- 246, 135, 34, 4, 246, 219, 34, 4, 224, 190, 34, 4, 225, 250, 34, 4, 226,
- 186, 34, 4, 250, 5, 34, 4, 250, 9, 34, 4, 237, 110, 34, 4, 231, 70, 34,
- 4, 248, 107, 34, 4, 235, 169, 34, 4, 228, 6, 34, 4, 229, 43, 34, 4, 223,
- 19, 34, 4, 223, 65, 34, 4, 250, 235, 34, 4, 239, 101, 34, 4, 235, 33, 34,
- 4, 223, 158, 34, 4, 238, 107, 34, 4, 235, 115, 34, 4, 245, 218, 34, 4,
- 236, 66, 34, 4, 234, 206, 34, 4, 234, 146, 34, 4, 73, 34, 4, 234, 61, 34,
- 4, 235, 104, 34, 4, 244, 227, 34, 4, 244, 219, 34, 4, 224, 105, 34, 4,
- 224, 99, 34, 4, 233, 4, 34, 4, 252, 185, 34, 4, 252, 138, 34, 4, 236,
- 241, 34, 4, 238, 120, 34, 4, 236, 182, 34, 4, 246, 138, 34, 4, 246, 137,
- 34, 4, 247, 7, 34, 4, 224, 206, 34, 4, 96, 34, 4, 226, 201, 34, 4, 250,
- 7, 34, 4, 250, 11, 34, 4, 237, 143, 34, 4, 231, 122, 34, 4, 249, 161, 34,
- 4, 235, 175, 34, 4, 228, 169, 34, 4, 229, 71, 34, 4, 223, 27, 34, 4, 223,
- 70, 34, 4, 251, 68, 34, 4, 239, 117, 34, 4, 235, 38, 34, 4, 223, 183, 34,
- 4, 238, 150, 34, 4, 235, 117, 34, 4, 246, 11, 34, 4, 236, 103, 34, 4,
- 235, 6, 34, 4, 234, 152, 34, 4, 72, 34, 4, 247, 239, 34, 4, 235, 126, 34,
- 4, 245, 121, 34, 4, 245, 100, 34, 4, 224, 141, 34, 4, 224, 134, 34, 4,
- 233, 151, 34, 4, 252, 189, 34, 4, 252, 238, 34, 4, 236, 244, 34, 4, 238,
- 124, 34, 4, 238, 122, 34, 4, 236, 185, 34, 4, 246, 142, 34, 4, 246, 140,
- 34, 4, 247, 97, 34, 4, 225, 42, 34, 4, 227, 44, 34, 4, 226, 239, 34, 4,
- 250, 17, 34, 4, 250, 14, 34, 4, 237, 243, 34, 4, 231, 244, 34, 4, 250,
- 77, 34, 4, 235, 185, 34, 4, 230, 213, 34, 4, 229, 114, 34, 4, 223, 97,
- 34, 4, 223, 77, 34, 4, 251, 231, 34, 4, 239, 170, 34, 4, 235, 48, 34, 4,
- 223, 228, 34, 4, 239, 3, 34, 4, 235, 121, 34, 4, 235, 119, 34, 4, 246,
- 131, 34, 4, 246, 122, 34, 4, 236, 235, 34, 4, 235, 162, 34, 4, 234, 169,
- 34, 4, 235, 139, 34, 4, 237, 218, 34, 251, 54, 34, 246, 218, 228, 38, 34,
- 232, 69, 76, 34, 4, 235, 174, 247, 129, 34, 4, 235, 174, 177, 34, 4, 235,
- 174, 228, 159, 34, 14, 247, 89, 34, 14, 239, 1, 34, 14, 226, 154, 34, 14,
- 235, 68, 34, 14, 253, 40, 34, 14, 247, 128, 34, 14, 227, 104, 34, 14,
- 250, 149, 34, 14, 249, 144, 34, 14, 238, 97, 34, 14, 226, 111, 34, 14,
- 249, 160, 34, 14, 239, 109, 34, 21, 223, 89, 34, 21, 118, 34, 21, 113,
- 34, 21, 166, 34, 21, 158, 34, 21, 173, 34, 21, 183, 34, 21, 194, 34, 21,
- 187, 34, 21, 192, 34, 4, 235, 174, 198, 34, 4, 235, 174, 249, 161, 28, 6,
- 1, 223, 93, 28, 3, 1, 223, 93, 28, 6, 1, 248, 67, 28, 3, 1, 248, 67, 28,
- 6, 1, 200, 248, 69, 28, 3, 1, 200, 248, 69, 28, 6, 1, 239, 215, 28, 3, 1,
- 239, 215, 28, 6, 1, 249, 175, 28, 3, 1, 249, 175, 28, 6, 1, 236, 90, 225,
- 153, 28, 3, 1, 236, 90, 225, 153, 28, 6, 1, 252, 100, 234, 66, 28, 3, 1,
- 252, 100, 234, 66, 28, 6, 1, 235, 145, 223, 217, 28, 3, 1, 235, 145, 223,
- 217, 28, 6, 1, 223, 214, 2, 253, 67, 223, 217, 28, 3, 1, 223, 214, 2,
- 253, 67, 223, 217, 28, 6, 1, 239, 213, 223, 239, 28, 3, 1, 239, 213, 223,
- 239, 28, 6, 1, 200, 223, 158, 28, 3, 1, 200, 223, 158, 28, 6, 1, 239,
- 213, 57, 28, 3, 1, 239, 213, 57, 28, 6, 1, 251, 82, 237, 155, 223, 139,
- 28, 3, 1, 251, 82, 237, 155, 223, 139, 28, 6, 1, 252, 143, 223, 139, 28,
- 3, 1, 252, 143, 223, 139, 28, 6, 1, 239, 213, 251, 82, 237, 155, 223,
- 139, 28, 3, 1, 239, 213, 251, 82, 237, 155, 223, 139, 28, 6, 1, 223, 185,
- 28, 3, 1, 223, 185, 28, 6, 1, 228, 165, 250, 77, 28, 3, 1, 228, 165, 250,
- 77, 28, 6, 1, 228, 165, 248, 2, 28, 3, 1, 228, 165, 248, 2, 28, 6, 1,
- 228, 165, 247, 247, 28, 3, 1, 228, 165, 247, 247, 28, 6, 1, 236, 94, 73,
- 28, 3, 1, 236, 94, 73, 28, 6, 1, 252, 167, 73, 28, 3, 1, 252, 167, 73,
- 28, 6, 1, 47, 236, 94, 73, 28, 3, 1, 47, 236, 94, 73, 28, 1, 236, 54, 73,
- 36, 28, 224, 176, 36, 28, 227, 24, 236, 128, 53, 36, 28, 244, 136, 236,
- 128, 53, 36, 28, 226, 195, 236, 128, 53, 228, 192, 254, 69, 36, 28, 239,
- 12, 36, 28, 233, 156, 28, 239, 12, 28, 233, 156, 28, 6, 1, 248, 78, 28,
- 3, 1, 248, 78, 28, 6, 1, 248, 60, 28, 3, 1, 248, 60, 28, 6, 1, 223, 55,
- 28, 3, 1, 223, 55, 28, 6, 1, 251, 240, 28, 3, 1, 251, 240, 28, 6, 1, 248,
- 59, 28, 3, 1, 248, 59, 28, 6, 1, 227, 45, 2, 236, 154, 88, 28, 3, 1, 227,
- 45, 2, 236, 154, 88, 28, 6, 1, 225, 220, 28, 3, 1, 225, 220, 28, 6, 1,
- 226, 23, 28, 3, 1, 226, 23, 28, 6, 1, 226, 27, 28, 3, 1, 226, 27, 28, 6,
- 1, 227, 50, 28, 3, 1, 227, 50, 28, 6, 1, 244, 125, 28, 3, 1, 244, 125,
- 28, 6, 1, 229, 28, 28, 3, 1, 229, 28, 52, 1, 251, 160, 206, 223, 193,
- 233, 37, 52, 1, 251, 160, 206, 223, 249, 233, 37, 52, 1, 251, 160, 206,
- 223, 193, 229, 130, 52, 1, 251, 160, 206, 223, 249, 229, 130, 52, 1, 251,
- 160, 206, 223, 193, 232, 84, 52, 1, 251, 160, 206, 223, 249, 232, 84, 52,
- 1, 251, 160, 206, 223, 193, 231, 70, 52, 1, 251, 160, 206, 223, 249, 231,
- 70, 52, 1, 247, 140, 248, 138, 206, 125, 52, 1, 201, 248, 138, 206, 125,
- 52, 1, 236, 155, 248, 138, 206, 125, 52, 1, 184, 248, 138, 206, 125, 52,
- 1, 247, 139, 248, 138, 206, 125, 52, 1, 247, 140, 248, 138, 237, 232,
- 206, 125, 52, 1, 201, 248, 138, 237, 232, 206, 125, 52, 1, 236, 155, 248,
- 138, 237, 232, 206, 125, 52, 1, 184, 248, 138, 237, 232, 206, 125, 52, 1,
- 247, 139, 248, 138, 237, 232, 206, 125, 52, 1, 247, 140, 237, 232, 206,
- 125, 52, 1, 201, 237, 232, 206, 125, 52, 1, 236, 155, 237, 232, 206, 125,
- 52, 1, 184, 237, 232, 206, 125, 52, 1, 247, 139, 237, 232, 206, 125, 52,
- 1, 56, 61, 125, 52, 1, 56, 228, 194, 52, 1, 56, 169, 125, 52, 1, 203, 41,
- 251, 11, 254, 181, 52, 1, 232, 8, 99, 58, 52, 1, 232, 8, 103, 58, 52, 1,
- 232, 8, 247, 149, 76, 52, 1, 232, 8, 239, 223, 247, 149, 76, 52, 1, 184,
- 239, 223, 247, 149, 76, 52, 1, 228, 27, 22, 201, 226, 118, 52, 1, 228,
- 27, 22, 184, 226, 118, 7, 6, 1, 248, 26, 254, 227, 7, 3, 1, 248, 26, 254,
- 227, 7, 6, 1, 248, 26, 254, 248, 7, 3, 1, 248, 26, 254, 248, 7, 6, 1,
- 245, 98, 7, 3, 1, 245, 98, 7, 6, 1, 225, 187, 7, 3, 1, 225, 187, 7, 6, 1,
- 226, 82, 7, 3, 1, 226, 82, 7, 6, 1, 250, 233, 7, 3, 1, 250, 233, 7, 6, 1,
- 250, 234, 2, 251, 54, 7, 3, 1, 250, 234, 2, 251, 54, 7, 1, 3, 6, 247,
- 130, 7, 1, 3, 6, 193, 7, 6, 1, 255, 63, 7, 3, 1, 255, 63, 7, 6, 1, 254,
- 158, 7, 3, 1, 254, 158, 7, 6, 1, 254, 53, 7, 3, 1, 254, 53, 7, 6, 1, 254,
- 41, 7, 3, 1, 254, 41, 7, 6, 1, 254, 42, 2, 169, 125, 7, 3, 1, 254, 42, 2,
- 169, 125, 7, 6, 1, 254, 34, 7, 3, 1, 254, 34, 7, 6, 1, 200, 252, 45, 2,
- 249, 140, 7, 3, 1, 200, 252, 45, 2, 249, 140, 7, 6, 1, 239, 77, 2, 82, 7,
- 3, 1, 239, 77, 2, 82, 7, 6, 1, 239, 77, 2, 250, 1, 82, 7, 3, 1, 239, 77,
- 2, 250, 1, 82, 7, 6, 1, 239, 77, 2, 195, 22, 250, 1, 82, 7, 3, 1, 239,
- 77, 2, 195, 22, 250, 1, 82, 7, 6, 1, 252, 99, 149, 7, 3, 1, 252, 99, 149,
- 7, 6, 1, 238, 47, 2, 201, 82, 7, 3, 1, 238, 47, 2, 201, 82, 7, 6, 1, 130,
- 2, 182, 195, 234, 2, 7, 3, 1, 130, 2, 182, 195, 234, 2, 7, 6, 1, 130, 2,
- 237, 124, 7, 3, 1, 130, 2, 237, 124, 7, 6, 1, 234, 52, 7, 3, 1, 234, 52,
- 7, 6, 1, 233, 245, 2, 195, 226, 188, 250, 34, 7, 3, 1, 233, 245, 2, 195,
- 226, 188, 250, 34, 7, 6, 1, 233, 245, 2, 247, 14, 7, 3, 1, 233, 245, 2,
- 247, 14, 7, 6, 1, 233, 245, 2, 228, 114, 227, 89, 7, 3, 1, 233, 245, 2,
- 228, 114, 227, 89, 7, 6, 1, 232, 140, 2, 195, 226, 188, 250, 34, 7, 3, 1,
- 232, 140, 2, 195, 226, 188, 250, 34, 7, 6, 1, 232, 140, 2, 250, 1, 82, 7,
- 3, 1, 232, 140, 2, 250, 1, 82, 7, 6, 1, 232, 27, 231, 105, 7, 3, 1, 232,
- 27, 231, 105, 7, 6, 1, 231, 63, 231, 105, 7, 3, 1, 231, 63, 231, 105, 7,
- 6, 1, 225, 65, 2, 250, 1, 82, 7, 3, 1, 225, 65, 2, 250, 1, 82, 7, 6, 1,
- 224, 182, 7, 3, 1, 224, 182, 7, 6, 1, 224, 209, 223, 119, 7, 3, 1, 224,
- 209, 223, 119, 7, 6, 1, 226, 197, 2, 82, 7, 3, 1, 226, 197, 2, 82, 7, 6,
- 1, 226, 197, 2, 195, 226, 188, 250, 34, 7, 3, 1, 226, 197, 2, 195, 226,
- 188, 250, 34, 7, 6, 1, 225, 35, 7, 3, 1, 225, 35, 7, 6, 1, 247, 173, 7,
- 3, 1, 247, 173, 7, 6, 1, 239, 205, 7, 3, 1, 239, 205, 7, 6, 1, 251, 44,
- 7, 3, 1, 251, 44, 52, 1, 225, 87, 7, 3, 1, 248, 98, 7, 3, 1, 237, 100, 7,
- 3, 1, 236, 48, 7, 3, 1, 234, 199, 7, 3, 1, 231, 62, 7, 1, 3, 6, 231, 62,
- 7, 3, 1, 225, 244, 7, 3, 1, 225, 145, 7, 6, 1, 239, 241, 222, 222, 7, 3,
- 1, 239, 241, 222, 222, 7, 6, 1, 239, 241, 247, 130, 7, 3, 1, 239, 241,
- 247, 130, 7, 6, 1, 239, 241, 214, 7, 6, 1, 209, 239, 241, 214, 7, 3, 1,
- 209, 239, 241, 214, 7, 6, 1, 209, 149, 7, 3, 1, 209, 149, 7, 6, 1, 239,
- 241, 146, 7, 3, 1, 239, 241, 146, 7, 6, 1, 239, 241, 193, 7, 3, 1, 239,
- 241, 193, 7, 6, 1, 239, 241, 227, 109, 7, 3, 1, 239, 241, 227, 109, 52,
- 1, 184, 251, 102, 255, 41, 52, 1, 251, 61, 52, 1, 229, 63, 247, 204, 53,
- 7, 6, 1, 231, 6, 7, 3, 1, 231, 6, 7, 247, 208, 1, 200, 247, 130, 7, 247,
- 208, 1, 200, 233, 244, 7, 247, 208, 1, 239, 223, 185, 7, 247, 208, 1,
- 244, 81, 237, 126, 7, 247, 208, 1, 254, 120, 185, 227, 183, 235, 244, 1,
- 57, 227, 183, 235, 244, 1, 74, 227, 183, 235, 244, 5, 248, 80, 227, 183,
- 235, 244, 1, 66, 227, 183, 235, 244, 1, 72, 227, 183, 235, 244, 1, 73,
- 227, 183, 235, 244, 5, 245, 134, 227, 183, 235, 244, 1, 238, 150, 227,
- 183, 235, 244, 1, 238, 208, 227, 183, 235, 244, 1, 246, 11, 227, 183,
- 235, 244, 1, 246, 54, 227, 183, 235, 244, 5, 254, 160, 227, 183, 235,
- 244, 1, 251, 68, 227, 183, 235, 244, 1, 251, 150, 227, 183, 235, 244, 1,
- 239, 117, 227, 183, 235, 244, 1, 239, 157, 227, 183, 235, 244, 1, 226, 5,
- 227, 183, 235, 244, 1, 226, 7, 227, 183, 235, 244, 1, 250, 92, 227, 183,
- 235, 244, 1, 250, 100, 227, 183, 235, 244, 1, 96, 227, 183, 235, 244, 1,
- 226, 201, 227, 183, 235, 244, 1, 249, 161, 227, 183, 235, 244, 1, 250, 7,
- 227, 183, 235, 244, 1, 235, 6, 227, 183, 235, 244, 1, 233, 4, 227, 183,
- 235, 244, 1, 233, 79, 227, 183, 235, 244, 1, 252, 138, 227, 183, 235,
- 244, 1, 252, 185, 227, 183, 235, 244, 1, 236, 103, 227, 183, 235, 244, 1,
- 231, 122, 227, 183, 235, 244, 1, 237, 143, 227, 183, 235, 244, 1, 231,
- 91, 227, 183, 235, 244, 1, 228, 169, 227, 183, 235, 244, 1, 244, 227,
- 227, 183, 235, 244, 31, 5, 57, 227, 183, 235, 244, 31, 5, 74, 227, 183,
- 235, 244, 31, 5, 66, 227, 183, 235, 244, 31, 5, 72, 227, 183, 235, 244,
- 31, 5, 234, 52, 227, 183, 235, 244, 233, 0, 237, 17, 227, 183, 235, 244,
- 233, 0, 237, 16, 227, 183, 235, 244, 233, 0, 237, 15, 227, 183, 235, 244,
- 233, 0, 237, 14, 217, 1, 177, 217, 1, 238, 227, 217, 1, 246, 193, 217, 1,
- 235, 137, 217, 1, 252, 39, 217, 1, 251, 204, 217, 1, 239, 179, 217, 1,
- 234, 173, 217, 1, 227, 107, 217, 1, 226, 251, 217, 1, 250, 189, 217, 1,
- 236, 1, 217, 1, 213, 217, 1, 233, 97, 217, 1, 253, 70, 217, 1, 198, 217,
- 1, 226, 44, 217, 1, 226, 37, 217, 1, 248, 70, 217, 1, 224, 173, 217, 1,
- 223, 85, 217, 1, 223, 117, 217, 1, 3, 57, 217, 1, 191, 217, 1, 208, 217,
- 1, 238, 43, 217, 1, 229, 146, 217, 1, 231, 31, 217, 1, 154, 217, 1, 57,
- 217, 1, 74, 217, 1, 66, 217, 1, 72, 217, 1, 73, 217, 1, 232, 138, 217, 1,
- 224, 72, 217, 1, 247, 129, 217, 1, 246, 101, 217, 1, 248, 35, 217, 228,
- 0, 1, 224, 173, 217, 228, 0, 1, 191, 217, 1, 226, 20, 217, 1, 226, 10,
- 217, 1, 250, 117, 217, 1, 235, 18, 217, 1, 254, 203, 191, 217, 1, 224,
- 203, 229, 146, 217, 1, 224, 204, 154, 217, 1, 254, 75, 247, 129, 217,
- 228, 0, 1, 208, 217, 227, 221, 1, 208, 217, 1, 252, 19, 217, 228, 241,
- 245, 119, 76, 217, 47, 245, 119, 76, 217, 165, 229, 139, 217, 165, 47,
- 229, 139, 141, 5, 254, 160, 141, 5, 224, 211, 141, 1, 57, 141, 1, 255,
- 63, 141, 1, 74, 141, 1, 240, 47, 141, 1, 66, 141, 1, 225, 76, 141, 1,
- 153, 146, 141, 1, 153, 231, 100, 141, 1, 153, 149, 141, 1, 153, 237, 149,
- 141, 1, 72, 141, 1, 248, 35, 141, 1, 254, 253, 141, 1, 73, 141, 1, 234,
- 52, 141, 1, 254, 53, 141, 1, 177, 141, 1, 238, 227, 141, 1, 246, 193,
- 141, 1, 246, 66, 141, 1, 235, 137, 141, 1, 252, 39, 141, 1, 251, 204,
- 141, 1, 239, 179, 141, 1, 239, 160, 141, 1, 234, 173, 141, 1, 226, 20,
- 141, 1, 226, 10, 141, 1, 250, 117, 141, 1, 250, 101, 141, 1, 235, 18,
- 141, 1, 227, 107, 141, 1, 226, 251, 141, 1, 250, 189, 141, 1, 250, 22,
- 141, 1, 236, 1, 141, 1, 213, 141, 1, 233, 97, 141, 1, 253, 70, 141, 1,
- 252, 190, 141, 1, 198, 141, 1, 191, 141, 1, 208, 141, 1, 238, 43, 141, 1,
- 225, 64, 141, 1, 229, 146, 141, 1, 228, 110, 141, 1, 231, 31, 141, 1,
- 154, 141, 1, 237, 148, 141, 251, 33, 5, 245, 166, 141, 31, 5, 255, 63,
- 141, 31, 5, 74, 141, 31, 5, 240, 47, 141, 31, 5, 66, 141, 31, 5, 225, 76,
- 141, 31, 5, 153, 146, 141, 31, 5, 153, 231, 100, 141, 31, 5, 153, 149,
- 141, 31, 5, 153, 237, 149, 141, 31, 5, 72, 141, 31, 5, 248, 35, 141, 31,
- 5, 254, 253, 141, 31, 5, 73, 141, 31, 5, 234, 52, 141, 31, 5, 254, 53,
- 141, 5, 224, 216, 141, 250, 151, 141, 47, 250, 151, 141, 21, 223, 89,
- 141, 21, 118, 141, 21, 113, 141, 21, 166, 141, 21, 158, 141, 21, 173,
- 141, 21, 183, 141, 21, 194, 141, 21, 187, 141, 21, 192, 239, 9, 237, 194,
- 21, 223, 89, 239, 9, 237, 194, 21, 118, 239, 9, 237, 194, 21, 113, 239,
- 9, 237, 194, 21, 166, 239, 9, 237, 194, 21, 158, 239, 9, 237, 194, 21,
- 173, 239, 9, 237, 194, 21, 183, 239, 9, 237, 194, 21, 194, 239, 9, 237,
- 194, 21, 187, 239, 9, 237, 194, 21, 192, 239, 9, 237, 194, 1, 177, 239,
- 9, 237, 194, 1, 238, 227, 239, 9, 237, 194, 1, 246, 193, 239, 9, 237,
- 194, 1, 235, 137, 239, 9, 237, 194, 1, 231, 31, 239, 9, 237, 194, 1, 229,
- 146, 239, 9, 237, 194, 1, 223, 117, 239, 9, 237, 194, 1, 234, 173, 239,
- 9, 237, 194, 1, 227, 107, 239, 9, 237, 194, 1, 244, 147, 239, 9, 237,
- 194, 1, 236, 1, 239, 9, 237, 194, 1, 213, 239, 9, 237, 194, 1, 233, 97,
- 239, 9, 237, 194, 1, 198, 239, 9, 237, 194, 1, 250, 189, 239, 9, 237,
- 194, 1, 253, 70, 239, 9, 237, 194, 1, 208, 239, 9, 237, 194, 1, 191, 239,
- 9, 237, 194, 1, 238, 43, 239, 9, 237, 194, 1, 224, 173, 239, 9, 237, 194,
- 1, 226, 251, 239, 9, 237, 194, 1, 154, 239, 9, 237, 194, 1, 225, 64, 239,
- 9, 237, 194, 1, 252, 39, 239, 9, 237, 194, 1, 57, 239, 9, 237, 194, 1,
- 234, 88, 239, 9, 237, 194, 1, 74, 239, 9, 237, 194, 1, 234, 52, 239, 9,
- 237, 194, 31, 225, 159, 239, 9, 237, 194, 31, 72, 239, 9, 237, 194, 31,
- 66, 239, 9, 237, 194, 31, 248, 35, 239, 9, 237, 194, 31, 73, 239, 9, 237,
- 194, 206, 233, 15, 239, 9, 237, 194, 206, 252, 29, 239, 9, 237, 194, 206,
- 252, 30, 233, 15, 239, 9, 237, 194, 5, 250, 206, 239, 9, 237, 194, 5,
- 229, 22, 231, 223, 1, 177, 231, 223, 1, 246, 193, 231, 223, 1, 235, 137,
- 231, 223, 1, 227, 107, 231, 223, 1, 250, 189, 231, 223, 1, 236, 1, 231,
- 223, 1, 213, 231, 223, 1, 253, 70, 231, 223, 1, 198, 231, 223, 1, 252,
- 39, 231, 223, 1, 239, 179, 231, 223, 1, 234, 173, 231, 223, 1, 231, 31,
- 231, 223, 1, 208, 231, 223, 1, 238, 43, 231, 223, 1, 191, 231, 223, 1,
- 224, 173, 231, 223, 1, 154, 231, 223, 1, 236, 245, 231, 223, 1, 235, 122,
- 231, 223, 1, 235, 189, 231, 223, 1, 234, 153, 231, 223, 1, 57, 231, 223,
- 31, 5, 74, 231, 223, 31, 5, 66, 231, 223, 31, 5, 72, 231, 223, 31, 5,
- 254, 253, 231, 223, 31, 5, 73, 231, 223, 31, 5, 254, 53, 231, 223, 31, 5,
- 247, 165, 231, 223, 31, 5, 248, 56, 231, 223, 251, 33, 5, 235, 139, 231,
- 223, 251, 33, 5, 199, 231, 223, 251, 33, 5, 146, 231, 223, 251, 33, 5,
- 212, 231, 223, 224, 216, 231, 223, 230, 206, 76, 136, 1, 57, 136, 1, 74,
- 136, 1, 66, 136, 1, 72, 136, 1, 254, 253, 136, 1, 73, 136, 1, 177, 136,
- 1, 238, 227, 136, 1, 246, 193, 136, 1, 246, 66, 136, 1, 235, 98, 136, 1,
- 235, 137, 136, 1, 251, 204, 136, 1, 251, 171, 136, 1, 239, 179, 136, 1,
- 239, 160, 136, 1, 235, 91, 136, 1, 235, 93, 136, 1, 235, 92, 136, 1, 227,
- 107, 136, 1, 226, 251, 136, 1, 250, 189, 136, 1, 250, 22, 136, 1, 234,
- 203, 136, 1, 236, 1, 136, 1, 250, 117, 136, 1, 213, 136, 1, 232, 230,
- 136, 1, 233, 97, 136, 1, 253, 70, 136, 1, 252, 190, 136, 1, 236, 61, 136,
- 1, 198, 136, 1, 253, 16, 136, 1, 191, 136, 1, 208, 136, 1, 238, 43, 136,
- 1, 225, 64, 136, 1, 228, 110, 136, 1, 231, 31, 136, 1, 154, 136, 31, 5,
- 255, 63, 136, 31, 5, 74, 136, 31, 5, 240, 47, 136, 31, 5, 248, 22, 136,
- 31, 5, 66, 136, 31, 5, 234, 88, 136, 31, 5, 73, 136, 31, 5, 254, 253,
- 136, 31, 5, 254, 53, 136, 31, 5, 225, 159, 136, 251, 33, 5, 191, 136,
- 251, 33, 5, 208, 136, 251, 33, 5, 238, 43, 136, 251, 33, 5, 224, 173,
- 136, 1, 35, 239, 76, 136, 1, 35, 214, 136, 1, 35, 235, 139, 136, 251, 33,
- 5, 35, 235, 139, 136, 1, 35, 251, 205, 136, 1, 35, 227, 109, 136, 1, 35,
- 199, 136, 1, 35, 233, 244, 136, 1, 35, 224, 25, 136, 1, 35, 146, 136, 1,
- 35, 149, 136, 1, 35, 228, 111, 136, 251, 33, 5, 35, 185, 136, 251, 33, 5,
- 35, 212, 136, 21, 223, 89, 136, 21, 118, 136, 21, 113, 136, 21, 166, 136,
- 21, 158, 136, 21, 173, 136, 21, 183, 136, 21, 194, 136, 21, 187, 136, 21,
- 192, 136, 232, 171, 228, 134, 136, 232, 171, 250, 151, 136, 232, 171, 47,
- 250, 151, 136, 232, 171, 226, 66, 250, 151, 9, 11, 242, 31, 9, 11, 242,
- 30, 9, 11, 242, 29, 9, 11, 242, 28, 9, 11, 242, 27, 9, 11, 242, 26, 9,
- 11, 242, 25, 9, 11, 242, 24, 9, 11, 242, 23, 9, 11, 242, 22, 9, 11, 242,
- 21, 9, 11, 242, 20, 9, 11, 242, 19, 9, 11, 242, 18, 9, 11, 242, 17, 9,
- 11, 242, 16, 9, 11, 242, 15, 9, 11, 242, 14, 9, 11, 242, 13, 9, 11, 242,
- 12, 9, 11, 242, 11, 9, 11, 242, 10, 9, 11, 242, 9, 9, 11, 242, 8, 9, 11,
- 242, 7, 9, 11, 242, 6, 9, 11, 242, 5, 9, 11, 242, 4, 9, 11, 242, 3, 9,
- 11, 242, 2, 9, 11, 242, 1, 9, 11, 242, 0, 9, 11, 241, 255, 9, 11, 241,
- 254, 9, 11, 241, 253, 9, 11, 241, 252, 9, 11, 241, 251, 9, 11, 241, 250,
- 9, 11, 241, 249, 9, 11, 241, 248, 9, 11, 241, 247, 9, 11, 241, 246, 9,
- 11, 241, 245, 9, 11, 241, 244, 9, 11, 241, 243, 9, 11, 241, 242, 9, 11,
- 241, 241, 9, 11, 241, 240, 9, 11, 241, 239, 9, 11, 241, 238, 9, 11, 241,
- 237, 9, 11, 241, 236, 9, 11, 241, 235, 9, 11, 241, 234, 9, 11, 241, 233,
- 9, 11, 241, 232, 9, 11, 241, 231, 9, 11, 241, 230, 9, 11, 241, 229, 9,
- 11, 241, 228, 9, 11, 241, 227, 9, 11, 241, 226, 9, 11, 241, 225, 9, 11,
- 241, 224, 9, 11, 241, 223, 9, 11, 241, 222, 9, 11, 241, 221, 9, 11, 241,
- 220, 9, 11, 241, 219, 9, 11, 241, 218, 9, 11, 241, 217, 9, 11, 241, 216,
- 9, 11, 241, 215, 9, 11, 241, 214, 9, 11, 241, 213, 9, 11, 241, 212, 9,
- 11, 241, 211, 9, 11, 241, 210, 9, 11, 241, 209, 9, 11, 241, 208, 9, 11,
- 241, 207, 9, 11, 241, 206, 9, 11, 241, 205, 9, 11, 241, 204, 9, 11, 241,
- 203, 9, 11, 241, 202, 9, 11, 241, 201, 9, 11, 241, 200, 9, 11, 241, 199,
- 9, 11, 241, 198, 9, 11, 241, 197, 9, 11, 241, 196, 9, 11, 241, 195, 9,
- 11, 241, 194, 9, 11, 241, 193, 9, 11, 241, 192, 9, 11, 241, 191, 9, 11,
- 241, 190, 9, 11, 241, 189, 9, 11, 241, 188, 9, 11, 241, 187, 9, 11, 241,
- 186, 9, 11, 241, 185, 9, 11, 241, 184, 9, 11, 241, 183, 9, 11, 241, 182,
- 9, 11, 241, 181, 9, 11, 241, 180, 9, 11, 241, 179, 9, 11, 241, 178, 9,
- 11, 241, 177, 9, 11, 241, 176, 9, 11, 241, 175, 9, 11, 241, 174, 9, 11,
- 241, 173, 9, 11, 241, 172, 9, 11, 241, 171, 9, 11, 241, 170, 9, 11, 241,
- 169, 9, 11, 241, 168, 9, 11, 241, 167, 9, 11, 241, 166, 9, 11, 241, 165,
- 9, 11, 241, 164, 9, 11, 241, 163, 9, 11, 241, 162, 9, 11, 241, 161, 9,
- 11, 241, 160, 9, 11, 241, 159, 9, 11, 241, 158, 9, 11, 241, 157, 9, 11,
- 241, 156, 9, 11, 241, 155, 9, 11, 241, 154, 9, 11, 241, 153, 9, 11, 241,
- 152, 9, 11, 241, 151, 9, 11, 241, 150, 9, 11, 241, 149, 9, 11, 241, 148,
- 9, 11, 241, 147, 9, 11, 241, 146, 9, 11, 241, 145, 9, 11, 241, 144, 9,
- 11, 241, 143, 9, 11, 241, 142, 9, 11, 241, 141, 9, 11, 241, 140, 9, 11,
- 241, 139, 9, 11, 241, 138, 9, 11, 241, 137, 9, 11, 241, 136, 9, 11, 241,
- 135, 9, 11, 241, 134, 9, 11, 241, 133, 9, 11, 241, 132, 9, 11, 241, 131,
- 9, 11, 241, 130, 9, 11, 241, 129, 9, 11, 241, 128, 9, 11, 241, 127, 9,
- 11, 241, 126, 9, 11, 241, 125, 9, 11, 241, 124, 9, 11, 241, 123, 9, 11,
- 241, 122, 9, 11, 241, 121, 9, 11, 241, 120, 9, 11, 241, 119, 9, 11, 241,
- 118, 9, 11, 241, 117, 9, 11, 241, 116, 9, 11, 241, 115, 9, 11, 241, 114,
- 9, 11, 241, 113, 9, 11, 241, 112, 9, 11, 241, 111, 9, 11, 241, 110, 9,
- 11, 241, 109, 9, 11, 241, 108, 9, 11, 241, 107, 9, 11, 241, 106, 9, 11,
- 241, 105, 9, 11, 241, 104, 9, 11, 241, 103, 9, 11, 241, 102, 9, 11, 241,
- 101, 9, 11, 241, 100, 9, 11, 241, 99, 9, 11, 241, 98, 9, 11, 241, 97, 9,
- 11, 241, 96, 9, 11, 241, 95, 9, 11, 241, 94, 9, 11, 241, 93, 9, 11, 241,
- 92, 9, 11, 241, 91, 9, 11, 241, 90, 9, 11, 241, 89, 9, 11, 241, 88, 9,
- 11, 241, 87, 9, 11, 241, 86, 9, 11, 241, 85, 9, 11, 241, 84, 9, 11, 241,
- 83, 9, 11, 241, 82, 9, 11, 241, 81, 9, 11, 241, 80, 9, 11, 241, 79, 9,
- 11, 241, 78, 9, 11, 241, 77, 9, 11, 241, 76, 9, 11, 241, 75, 9, 11, 241,
- 74, 9, 11, 241, 73, 9, 11, 241, 72, 9, 11, 241, 71, 9, 11, 241, 70, 9,
- 11, 241, 69, 9, 11, 241, 68, 9, 11, 241, 67, 9, 11, 241, 66, 9, 11, 241,
- 65, 9, 11, 241, 64, 9, 11, 241, 63, 9, 11, 241, 62, 9, 11, 241, 61, 9,
- 11, 241, 60, 9, 11, 241, 59, 9, 11, 241, 58, 9, 11, 241, 57, 9, 11, 241,
- 56, 9, 11, 241, 55, 9, 11, 241, 54, 9, 11, 241, 53, 9, 11, 241, 52, 9,
- 11, 241, 51, 9, 11, 241, 50, 9, 11, 241, 49, 9, 11, 241, 48, 9, 11, 241,
- 47, 9, 11, 241, 46, 9, 11, 241, 45, 9, 11, 241, 44, 9, 11, 241, 43, 9,
- 11, 241, 42, 9, 11, 241, 41, 9, 11, 241, 40, 9, 11, 241, 39, 9, 11, 241,
- 38, 9, 11, 241, 37, 9, 11, 241, 36, 9, 11, 241, 35, 9, 11, 241, 34, 9,
- 11, 241, 33, 9, 11, 241, 32, 9, 11, 241, 31, 9, 11, 241, 30, 9, 11, 241,
- 29, 9, 11, 241, 28, 9, 11, 241, 27, 9, 11, 241, 26, 9, 11, 241, 25, 9,
- 11, 241, 24, 9, 11, 241, 23, 9, 11, 241, 22, 9, 11, 241, 21, 9, 11, 241,
- 20, 9, 11, 241, 19, 9, 11, 241, 18, 9, 11, 241, 17, 9, 11, 241, 16, 9,
- 11, 241, 15, 9, 11, 241, 14, 9, 11, 241, 13, 9, 11, 241, 12, 9, 11, 241,
- 11, 9, 11, 241, 10, 9, 11, 241, 9, 9, 11, 241, 8, 9, 11, 241, 7, 9, 11,
- 241, 6, 9, 11, 241, 5, 9, 11, 241, 4, 9, 11, 241, 3, 9, 11, 241, 2, 9,
- 11, 241, 1, 9, 11, 241, 0, 9, 11, 240, 255, 9, 11, 240, 254, 9, 11, 240,
- 253, 9, 11, 240, 252, 9, 11, 240, 251, 9, 11, 240, 250, 9, 11, 240, 249,
- 9, 11, 240, 248, 9, 11, 240, 247, 9, 11, 240, 246, 9, 11, 240, 245, 9,
- 11, 240, 244, 9, 11, 240, 243, 9, 11, 240, 242, 9, 11, 240, 241, 9, 11,
- 240, 240, 9, 11, 240, 239, 9, 11, 240, 238, 9, 11, 240, 237, 9, 11, 240,
- 236, 9, 11, 240, 235, 9, 11, 240, 234, 9, 11, 240, 233, 9, 11, 240, 232,
- 9, 11, 240, 231, 9, 11, 240, 230, 9, 11, 240, 229, 9, 11, 240, 228, 9,
- 11, 240, 227, 9, 11, 240, 226, 9, 11, 240, 225, 9, 11, 240, 224, 9, 11,
- 240, 223, 9, 11, 240, 222, 9, 11, 240, 221, 9, 11, 240, 220, 9, 11, 240,
- 219, 9, 11, 240, 218, 9, 11, 240, 217, 9, 11, 240, 216, 9, 11, 240, 215,
- 9, 11, 240, 214, 9, 11, 240, 213, 9, 11, 240, 212, 9, 11, 240, 211, 9,
- 11, 240, 210, 9, 11, 240, 209, 9, 11, 240, 208, 9, 11, 240, 207, 9, 11,
- 240, 206, 9, 11, 240, 205, 9, 11, 240, 204, 9, 11, 240, 203, 9, 11, 240,
- 202, 9, 11, 240, 201, 9, 11, 240, 200, 9, 11, 240, 199, 9, 11, 240, 198,
- 9, 11, 240, 197, 9, 11, 240, 196, 9, 11, 240, 195, 9, 11, 240, 194, 9,
- 11, 240, 193, 9, 11, 240, 192, 9, 11, 240, 191, 9, 11, 240, 190, 9, 11,
- 240, 189, 9, 11, 240, 188, 9, 11, 240, 187, 9, 11, 240, 186, 9, 11, 240,
- 185, 9, 11, 240, 184, 9, 11, 240, 183, 9, 11, 240, 182, 9, 11, 240, 181,
- 9, 11, 240, 180, 9, 11, 240, 179, 9, 11, 240, 178, 9, 11, 240, 177, 9,
- 11, 240, 176, 9, 11, 240, 175, 9, 11, 240, 174, 9, 11, 240, 173, 9, 11,
- 240, 172, 9, 11, 240, 171, 9, 11, 240, 170, 9, 11, 240, 169, 9, 11, 240,
- 168, 9, 11, 240, 167, 9, 11, 240, 166, 9, 11, 240, 165, 9, 11, 240, 164,
- 9, 11, 240, 163, 9, 11, 240, 162, 9, 11, 240, 161, 9, 11, 240, 160, 9,
- 11, 240, 159, 9, 11, 240, 158, 9, 11, 240, 157, 9, 11, 240, 156, 9, 11,
- 240, 155, 9, 11, 240, 154, 9, 11, 240, 153, 9, 11, 240, 152, 9, 11, 240,
- 151, 9, 11, 240, 150, 9, 11, 240, 149, 9, 11, 240, 148, 9, 11, 240, 147,
- 9, 11, 240, 146, 9, 11, 240, 145, 9, 11, 240, 144, 9, 11, 240, 143, 9,
- 11, 240, 142, 9, 11, 240, 141, 9, 11, 240, 140, 9, 11, 240, 139, 9, 11,
- 240, 138, 9, 11, 240, 137, 9, 11, 240, 136, 9, 11, 240, 135, 9, 11, 240,
- 134, 9, 11, 240, 133, 9, 11, 240, 132, 9, 11, 240, 131, 9, 11, 240, 130,
- 9, 11, 240, 129, 9, 11, 240, 128, 9, 11, 240, 127, 9, 11, 240, 126, 9,
- 11, 240, 125, 9, 11, 240, 124, 9, 11, 240, 123, 9, 11, 240, 122, 9, 11,
- 240, 121, 9, 11, 240, 120, 9, 11, 240, 119, 9, 11, 240, 118, 9, 11, 240,
- 117, 9, 11, 240, 116, 9, 11, 240, 115, 9, 11, 240, 114, 9, 11, 240, 113,
- 9, 11, 240, 112, 9, 11, 240, 111, 9, 11, 240, 110, 9, 11, 240, 109, 9,
- 11, 240, 108, 9, 11, 240, 107, 9, 11, 240, 106, 9, 11, 240, 105, 9, 11,
- 240, 104, 9, 11, 240, 103, 9, 11, 240, 102, 9, 11, 240, 101, 9, 11, 240,
- 100, 9, 11, 240, 99, 9, 11, 240, 98, 9, 11, 240, 97, 9, 11, 240, 96, 9,
- 11, 240, 95, 9, 11, 240, 94, 9, 11, 240, 93, 9, 11, 240, 92, 9, 11, 240,
- 91, 9, 11, 240, 90, 9, 11, 240, 89, 9, 11, 240, 88, 9, 11, 240, 87, 9,
- 11, 240, 86, 9, 11, 240, 85, 9, 11, 240, 84, 9, 11, 240, 83, 9, 11, 240,
- 82, 9, 11, 240, 81, 9, 11, 240, 80, 9, 11, 240, 79, 9, 11, 240, 78, 9,
- 11, 240, 77, 7, 3, 20, 247, 74, 7, 3, 20, 247, 70, 7, 3, 20, 247, 33, 7,
- 3, 20, 247, 73, 7, 3, 20, 247, 72, 7, 3, 20, 182, 231, 35, 227, 109, 7,
- 3, 20, 228, 70, 120, 3, 20, 236, 211, 234, 232, 120, 3, 20, 236, 211,
- 248, 39, 120, 3, 20, 236, 211, 239, 252, 120, 3, 20, 224, 231, 234, 232,
- 120, 3, 20, 236, 211, 224, 67, 78, 1, 223, 176, 2, 245, 58, 78, 232, 255,
- 239, 100, 225, 53, 78, 20, 223, 200, 223, 176, 223, 176, 233, 166, 78, 1,
- 254, 201, 254, 29, 78, 1, 224, 117, 254, 227, 78, 1, 224, 117, 250, 160,
- 78, 1, 224, 117, 245, 121, 78, 1, 224, 117, 239, 59, 78, 1, 224, 117,
- 238, 12, 78, 1, 224, 117, 35, 236, 215, 78, 1, 224, 117, 231, 205, 78, 1,
- 224, 117, 227, 58, 78, 1, 254, 201, 79, 53, 78, 1, 229, 79, 2, 229, 79,
- 249, 140, 78, 1, 229, 79, 2, 228, 244, 249, 140, 78, 1, 229, 79, 2, 250,
- 176, 22, 229, 79, 249, 140, 78, 1, 229, 79, 2, 250, 176, 22, 228, 244,
- 249, 140, 78, 1, 92, 2, 233, 166, 78, 1, 92, 2, 232, 126, 78, 1, 92, 2,
- 237, 27, 78, 1, 252, 201, 2, 250, 175, 78, 1, 246, 35, 2, 250, 175, 78,
- 1, 250, 161, 2, 250, 175, 78, 1, 245, 122, 2, 237, 27, 78, 1, 225, 47, 2,
- 250, 175, 78, 1, 223, 100, 2, 250, 175, 78, 1, 227, 11, 2, 250, 175, 78,
- 1, 223, 176, 2, 250, 175, 78, 1, 35, 239, 60, 2, 250, 175, 78, 1, 239,
- 60, 2, 250, 175, 78, 1, 238, 13, 2, 250, 175, 78, 1, 236, 216, 2, 250,
- 175, 78, 1, 234, 195, 2, 250, 175, 78, 1, 231, 3, 2, 250, 175, 78, 1, 35,
- 233, 152, 2, 250, 175, 78, 1, 233, 152, 2, 250, 175, 78, 1, 226, 42, 2,
- 250, 175, 78, 1, 232, 93, 2, 250, 175, 78, 1, 231, 206, 2, 250, 175, 78,
- 1, 229, 79, 2, 250, 175, 78, 1, 227, 59, 2, 250, 175, 78, 1, 225, 47, 2,
- 244, 223, 78, 1, 252, 201, 2, 232, 14, 78, 1, 239, 60, 2, 232, 14, 78, 1,
- 233, 152, 2, 232, 14, 78, 20, 92, 238, 12, 10, 1, 92, 224, 158, 44, 15,
- 10, 1, 92, 224, 158, 35, 15, 10, 1, 252, 231, 44, 15, 10, 1, 252, 231,
- 35, 15, 10, 1, 252, 231, 59, 15, 10, 1, 252, 231, 124, 15, 10, 1, 233,
- 141, 44, 15, 10, 1, 233, 141, 35, 15, 10, 1, 233, 141, 59, 15, 10, 1,
- 233, 141, 124, 15, 10, 1, 252, 222, 44, 15, 10, 1, 252, 222, 35, 15, 10,
- 1, 252, 222, 59, 15, 10, 1, 252, 222, 124, 15, 10, 1, 226, 13, 44, 15,
- 10, 1, 226, 13, 35, 15, 10, 1, 226, 13, 59, 15, 10, 1, 226, 13, 124, 15,
- 10, 1, 227, 33, 44, 15, 10, 1, 227, 33, 35, 15, 10, 1, 227, 33, 59, 15,
- 10, 1, 227, 33, 124, 15, 10, 1, 226, 15, 44, 15, 10, 1, 226, 15, 35, 15,
- 10, 1, 226, 15, 59, 15, 10, 1, 226, 15, 124, 15, 10, 1, 225, 37, 44, 15,
- 10, 1, 225, 37, 35, 15, 10, 1, 225, 37, 59, 15, 10, 1, 225, 37, 124, 15,
- 10, 1, 233, 139, 44, 15, 10, 1, 233, 139, 35, 15, 10, 1, 233, 139, 59,
- 15, 10, 1, 233, 139, 124, 15, 10, 1, 248, 76, 44, 15, 10, 1, 248, 76, 35,
- 15, 10, 1, 248, 76, 59, 15, 10, 1, 248, 76, 124, 15, 10, 1, 234, 167, 44,
- 15, 10, 1, 234, 167, 35, 15, 10, 1, 234, 167, 59, 15, 10, 1, 234, 167,
- 124, 15, 10, 1, 227, 49, 44, 15, 10, 1, 227, 49, 35, 15, 10, 1, 227, 49,
- 59, 15, 10, 1, 227, 49, 124, 15, 10, 1, 227, 47, 44, 15, 10, 1, 227, 47,
- 35, 15, 10, 1, 227, 47, 59, 15, 10, 1, 227, 47, 124, 15, 10, 1, 250, 115,
- 44, 15, 10, 1, 250, 115, 35, 15, 10, 1, 250, 172, 44, 15, 10, 1, 250,
- 172, 35, 15, 10, 1, 248, 100, 44, 15, 10, 1, 248, 100, 35, 15, 10, 1,
- 250, 113, 44, 15, 10, 1, 250, 113, 35, 15, 10, 1, 239, 166, 44, 15, 10,
- 1, 239, 166, 35, 15, 10, 1, 231, 96, 44, 15, 10, 1, 231, 96, 35, 15, 10,
- 1, 238, 252, 44, 15, 10, 1, 238, 252, 35, 15, 10, 1, 238, 252, 59, 15,
- 10, 1, 238, 252, 124, 15, 10, 1, 246, 181, 44, 15, 10, 1, 246, 181, 35,
- 15, 10, 1, 246, 181, 59, 15, 10, 1, 246, 181, 124, 15, 10, 1, 245, 211,
- 44, 15, 10, 1, 245, 211, 35, 15, 10, 1, 245, 211, 59, 15, 10, 1, 245,
- 211, 124, 15, 10, 1, 235, 106, 44, 15, 10, 1, 235, 106, 35, 15, 10, 1,
- 235, 106, 59, 15, 10, 1, 235, 106, 124, 15, 10, 1, 234, 252, 246, 51, 44,
- 15, 10, 1, 234, 252, 246, 51, 35, 15, 10, 1, 231, 126, 44, 15, 10, 1,
- 231, 126, 35, 15, 10, 1, 231, 126, 59, 15, 10, 1, 231, 126, 124, 15, 10,
- 1, 245, 108, 2, 62, 64, 44, 15, 10, 1, 245, 108, 2, 62, 64, 35, 15, 10,
- 1, 245, 108, 246, 9, 44, 15, 10, 1, 245, 108, 246, 9, 35, 15, 10, 1, 245,
- 108, 246, 9, 59, 15, 10, 1, 245, 108, 246, 9, 124, 15, 10, 1, 245, 108,
- 249, 158, 44, 15, 10, 1, 245, 108, 249, 158, 35, 15, 10, 1, 245, 108,
- 249, 158, 59, 15, 10, 1, 245, 108, 249, 158, 124, 15, 10, 1, 62, 253, 30,
- 44, 15, 10, 1, 62, 253, 30, 35, 15, 10, 1, 62, 253, 30, 2, 164, 64, 44,
- 15, 10, 1, 62, 253, 30, 2, 164, 64, 35, 15, 10, 1, 235, 140, 44, 15, 10,
- 1, 235, 140, 35, 15, 10, 1, 235, 140, 59, 15, 10, 1, 235, 140, 124, 15,
- 10, 1, 97, 44, 15, 10, 1, 97, 35, 15, 10, 1, 234, 89, 44, 15, 10, 1, 234,
- 89, 35, 15, 10, 1, 223, 159, 44, 15, 10, 1, 223, 159, 35, 15, 10, 1, 97,
- 2, 164, 64, 44, 15, 10, 1, 225, 43, 44, 15, 10, 1, 225, 43, 35, 15, 10,
- 1, 238, 185, 234, 89, 44, 15, 10, 1, 238, 185, 234, 89, 35, 15, 10, 1,
- 238, 185, 223, 159, 44, 15, 10, 1, 238, 185, 223, 159, 35, 15, 10, 1,
- 161, 44, 15, 10, 1, 161, 35, 15, 10, 1, 161, 59, 15, 10, 1, 161, 124, 15,
- 10, 1, 225, 155, 239, 7, 238, 185, 92, 175, 59, 15, 10, 1, 225, 155, 239,
- 7, 238, 185, 92, 175, 124, 15, 10, 20, 62, 2, 164, 64, 2, 92, 44, 15, 10,
- 20, 62, 2, 164, 64, 2, 92, 35, 15, 10, 20, 62, 2, 164, 64, 2, 255, 20,
- 44, 15, 10, 20, 62, 2, 164, 64, 2, 255, 20, 35, 15, 10, 20, 62, 2, 164,
- 64, 2, 224, 145, 44, 15, 10, 20, 62, 2, 164, 64, 2, 224, 145, 35, 15, 10,
- 20, 62, 2, 164, 64, 2, 97, 44, 15, 10, 20, 62, 2, 164, 64, 2, 97, 35, 15,
- 10, 20, 62, 2, 164, 64, 2, 234, 89, 44, 15, 10, 20, 62, 2, 164, 64, 2,
- 234, 89, 35, 15, 10, 20, 62, 2, 164, 64, 2, 223, 159, 44, 15, 10, 20, 62,
- 2, 164, 64, 2, 223, 159, 35, 15, 10, 20, 62, 2, 164, 64, 2, 161, 44, 15,
- 10, 20, 62, 2, 164, 64, 2, 161, 35, 15, 10, 20, 62, 2, 164, 64, 2, 161,
- 59, 15, 10, 20, 225, 155, 238, 185, 62, 2, 164, 64, 2, 92, 175, 44, 15,
- 10, 20, 225, 155, 238, 185, 62, 2, 164, 64, 2, 92, 175, 35, 15, 10, 20,
- 225, 155, 238, 185, 62, 2, 164, 64, 2, 92, 175, 59, 15, 10, 1, 247, 107,
- 62, 44, 15, 10, 1, 247, 107, 62, 35, 15, 10, 1, 247, 107, 62, 59, 15, 10,
- 1, 247, 107, 62, 124, 15, 10, 20, 62, 2, 164, 64, 2, 123, 44, 15, 10, 20,
- 62, 2, 164, 64, 2, 101, 44, 15, 10, 20, 62, 2, 164, 64, 2, 55, 44, 15,
- 10, 20, 62, 2, 164, 64, 2, 92, 175, 44, 15, 10, 20, 62, 2, 164, 64, 2,
- 62, 44, 15, 10, 20, 252, 224, 2, 123, 44, 15, 10, 20, 252, 224, 2, 101,
- 44, 15, 10, 20, 252, 224, 2, 202, 44, 15, 10, 20, 252, 224, 2, 55, 44,
- 15, 10, 20, 252, 224, 2, 92, 175, 44, 15, 10, 20, 252, 224, 2, 62, 44,
- 15, 10, 20, 227, 35, 2, 123, 44, 15, 10, 20, 227, 35, 2, 101, 44, 15, 10,
- 20, 227, 35, 2, 202, 44, 15, 10, 20, 227, 35, 2, 55, 44, 15, 10, 20, 227,
- 35, 2, 92, 175, 44, 15, 10, 20, 227, 35, 2, 62, 44, 15, 10, 20, 226, 237,
- 2, 123, 44, 15, 10, 20, 226, 237, 2, 55, 44, 15, 10, 20, 226, 237, 2, 92,
- 175, 44, 15, 10, 20, 226, 237, 2, 62, 44, 15, 10, 20, 123, 2, 101, 44,
- 15, 10, 20, 123, 2, 55, 44, 15, 10, 20, 101, 2, 123, 44, 15, 10, 20, 101,
- 2, 55, 44, 15, 10, 20, 202, 2, 123, 44, 15, 10, 20, 202, 2, 101, 44, 15,
- 10, 20, 202, 2, 55, 44, 15, 10, 20, 230, 202, 2, 123, 44, 15, 10, 20,
- 230, 202, 2, 101, 44, 15, 10, 20, 230, 202, 2, 202, 44, 15, 10, 20, 230,
- 202, 2, 55, 44, 15, 10, 20, 231, 25, 2, 101, 44, 15, 10, 20, 231, 25, 2,
- 55, 44, 15, 10, 20, 250, 185, 2, 123, 44, 15, 10, 20, 250, 185, 2, 101,
- 44, 15, 10, 20, 250, 185, 2, 202, 44, 15, 10, 20, 250, 185, 2, 55, 44,
- 15, 10, 20, 227, 92, 2, 101, 44, 15, 10, 20, 227, 92, 2, 55, 44, 15, 10,
- 20, 223, 114, 2, 55, 44, 15, 10, 20, 254, 249, 2, 123, 44, 15, 10, 20,
- 254, 249, 2, 55, 44, 15, 10, 20, 246, 64, 2, 123, 44, 15, 10, 20, 246,
- 64, 2, 55, 44, 15, 10, 20, 247, 88, 2, 123, 44, 15, 10, 20, 247, 88, 2,
- 101, 44, 15, 10, 20, 247, 88, 2, 202, 44, 15, 10, 20, 247, 88, 2, 55, 44,
- 15, 10, 20, 247, 88, 2, 92, 175, 44, 15, 10, 20, 247, 88, 2, 62, 44, 15,
- 10, 20, 232, 132, 2, 101, 44, 15, 10, 20, 232, 132, 2, 55, 44, 15, 10,
- 20, 232, 132, 2, 92, 175, 44, 15, 10, 20, 232, 132, 2, 62, 44, 15, 10,
- 20, 239, 60, 2, 92, 44, 15, 10, 20, 239, 60, 2, 123, 44, 15, 10, 20, 239,
- 60, 2, 101, 44, 15, 10, 20, 239, 60, 2, 202, 44, 15, 10, 20, 239, 60, 2,
- 216, 44, 15, 10, 20, 239, 60, 2, 55, 44, 15, 10, 20, 239, 60, 2, 92, 175,
- 44, 15, 10, 20, 239, 60, 2, 62, 44, 15, 10, 20, 216, 2, 123, 44, 15, 10,
- 20, 216, 2, 101, 44, 15, 10, 20, 216, 2, 202, 44, 15, 10, 20, 216, 2, 55,
- 44, 15, 10, 20, 216, 2, 92, 175, 44, 15, 10, 20, 216, 2, 62, 44, 15, 10,
- 20, 55, 2, 123, 44, 15, 10, 20, 55, 2, 101, 44, 15, 10, 20, 55, 2, 202,
- 44, 15, 10, 20, 55, 2, 55, 44, 15, 10, 20, 55, 2, 92, 175, 44, 15, 10,
- 20, 55, 2, 62, 44, 15, 10, 20, 234, 252, 2, 123, 44, 15, 10, 20, 234,
- 252, 2, 101, 44, 15, 10, 20, 234, 252, 2, 202, 44, 15, 10, 20, 234, 252,
- 2, 55, 44, 15, 10, 20, 234, 252, 2, 92, 175, 44, 15, 10, 20, 234, 252, 2,
- 62, 44, 15, 10, 20, 245, 108, 2, 123, 44, 15, 10, 20, 245, 108, 2, 55,
- 44, 15, 10, 20, 245, 108, 2, 92, 175, 44, 15, 10, 20, 245, 108, 2, 62,
- 44, 15, 10, 20, 62, 2, 123, 44, 15, 10, 20, 62, 2, 101, 44, 15, 10, 20,
- 62, 2, 202, 44, 15, 10, 20, 62, 2, 55, 44, 15, 10, 20, 62, 2, 92, 175,
- 44, 15, 10, 20, 62, 2, 62, 44, 15, 10, 20, 226, 246, 2, 227, 219, 92, 44,
- 15, 10, 20, 231, 226, 2, 227, 219, 92, 44, 15, 10, 20, 92, 175, 2, 227,
- 219, 92, 44, 15, 10, 20, 229, 138, 2, 250, 155, 44, 15, 10, 20, 229, 138,
- 2, 239, 22, 44, 15, 10, 20, 229, 138, 2, 247, 105, 44, 15, 10, 20, 229,
- 138, 2, 250, 157, 44, 15, 10, 20, 229, 138, 2, 239, 24, 44, 15, 10, 20,
- 229, 138, 2, 227, 219, 92, 44, 15, 10, 20, 62, 2, 164, 64, 2, 231, 226,
- 35, 15, 10, 20, 62, 2, 164, 64, 2, 223, 111, 35, 15, 10, 20, 62, 2, 164,
- 64, 2, 55, 35, 15, 10, 20, 62, 2, 164, 64, 2, 234, 252, 35, 15, 10, 20,
- 62, 2, 164, 64, 2, 92, 175, 35, 15, 10, 20, 62, 2, 164, 64, 2, 62, 35,
- 15, 10, 20, 252, 224, 2, 231, 226, 35, 15, 10, 20, 252, 224, 2, 223, 111,
- 35, 15, 10, 20, 252, 224, 2, 55, 35, 15, 10, 20, 252, 224, 2, 234, 252,
- 35, 15, 10, 20, 252, 224, 2, 92, 175, 35, 15, 10, 20, 252, 224, 2, 62,
- 35, 15, 10, 20, 227, 35, 2, 231, 226, 35, 15, 10, 20, 227, 35, 2, 223,
- 111, 35, 15, 10, 20, 227, 35, 2, 55, 35, 15, 10, 20, 227, 35, 2, 234,
- 252, 35, 15, 10, 20, 227, 35, 2, 92, 175, 35, 15, 10, 20, 227, 35, 2, 62,
- 35, 15, 10, 20, 226, 237, 2, 231, 226, 35, 15, 10, 20, 226, 237, 2, 223,
- 111, 35, 15, 10, 20, 226, 237, 2, 55, 35, 15, 10, 20, 226, 237, 2, 234,
- 252, 35, 15, 10, 20, 226, 237, 2, 92, 175, 35, 15, 10, 20, 226, 237, 2,
- 62, 35, 15, 10, 20, 247, 88, 2, 92, 175, 35, 15, 10, 20, 247, 88, 2, 62,
- 35, 15, 10, 20, 232, 132, 2, 92, 175, 35, 15, 10, 20, 232, 132, 2, 62,
- 35, 15, 10, 20, 239, 60, 2, 92, 35, 15, 10, 20, 239, 60, 2, 216, 35, 15,
- 10, 20, 239, 60, 2, 55, 35, 15, 10, 20, 239, 60, 2, 92, 175, 35, 15, 10,
- 20, 239, 60, 2, 62, 35, 15, 10, 20, 216, 2, 55, 35, 15, 10, 20, 216, 2,
- 92, 175, 35, 15, 10, 20, 216, 2, 62, 35, 15, 10, 20, 55, 2, 92, 35, 15,
- 10, 20, 55, 2, 55, 35, 15, 10, 20, 234, 252, 2, 231, 226, 35, 15, 10, 20,
- 234, 252, 2, 223, 111, 35, 15, 10, 20, 234, 252, 2, 55, 35, 15, 10, 20,
- 234, 252, 2, 234, 252, 35, 15, 10, 20, 234, 252, 2, 92, 175, 35, 15, 10,
- 20, 234, 252, 2, 62, 35, 15, 10, 20, 92, 175, 2, 227, 219, 92, 35, 15,
- 10, 20, 62, 2, 231, 226, 35, 15, 10, 20, 62, 2, 223, 111, 35, 15, 10, 20,
- 62, 2, 55, 35, 15, 10, 20, 62, 2, 234, 252, 35, 15, 10, 20, 62, 2, 92,
- 175, 35, 15, 10, 20, 62, 2, 62, 35, 15, 10, 20, 62, 2, 164, 64, 2, 123,
- 59, 15, 10, 20, 62, 2, 164, 64, 2, 101, 59, 15, 10, 20, 62, 2, 164, 64,
- 2, 202, 59, 15, 10, 20, 62, 2, 164, 64, 2, 55, 59, 15, 10, 20, 62, 2,
- 164, 64, 2, 245, 108, 59, 15, 10, 20, 252, 224, 2, 123, 59, 15, 10, 20,
- 252, 224, 2, 101, 59, 15, 10, 20, 252, 224, 2, 202, 59, 15, 10, 20, 252,
- 224, 2, 55, 59, 15, 10, 20, 252, 224, 2, 245, 108, 59, 15, 10, 20, 227,
- 35, 2, 123, 59, 15, 10, 20, 227, 35, 2, 101, 59, 15, 10, 20, 227, 35, 2,
- 202, 59, 15, 10, 20, 227, 35, 2, 55, 59, 15, 10, 20, 227, 35, 2, 245,
- 108, 59, 15, 10, 20, 226, 237, 2, 55, 59, 15, 10, 20, 123, 2, 101, 59,
- 15, 10, 20, 123, 2, 55, 59, 15, 10, 20, 101, 2, 123, 59, 15, 10, 20, 101,
- 2, 55, 59, 15, 10, 20, 202, 2, 123, 59, 15, 10, 20, 202, 2, 55, 59, 15,
- 10, 20, 230, 202, 2, 123, 59, 15, 10, 20, 230, 202, 2, 101, 59, 15, 10,
- 20, 230, 202, 2, 202, 59, 15, 10, 20, 230, 202, 2, 55, 59, 15, 10, 20,
- 231, 25, 2, 101, 59, 15, 10, 20, 231, 25, 2, 202, 59, 15, 10, 20, 231,
- 25, 2, 55, 59, 15, 10, 20, 250, 185, 2, 123, 59, 15, 10, 20, 250, 185, 2,
- 101, 59, 15, 10, 20, 250, 185, 2, 202, 59, 15, 10, 20, 250, 185, 2, 55,
- 59, 15, 10, 20, 227, 92, 2, 101, 59, 15, 10, 20, 223, 114, 2, 55, 59, 15,
- 10, 20, 254, 249, 2, 123, 59, 15, 10, 20, 254, 249, 2, 55, 59, 15, 10,
- 20, 246, 64, 2, 123, 59, 15, 10, 20, 246, 64, 2, 55, 59, 15, 10, 20, 247,
- 88, 2, 123, 59, 15, 10, 20, 247, 88, 2, 101, 59, 15, 10, 20, 247, 88, 2,
- 202, 59, 15, 10, 20, 247, 88, 2, 55, 59, 15, 10, 20, 232, 132, 2, 101,
- 59, 15, 10, 20, 232, 132, 2, 55, 59, 15, 10, 20, 239, 60, 2, 123, 59, 15,
- 10, 20, 239, 60, 2, 101, 59, 15, 10, 20, 239, 60, 2, 202, 59, 15, 10, 20,
- 239, 60, 2, 216, 59, 15, 10, 20, 239, 60, 2, 55, 59, 15, 10, 20, 216, 2,
- 123, 59, 15, 10, 20, 216, 2, 101, 59, 15, 10, 20, 216, 2, 202, 59, 15,
- 10, 20, 216, 2, 55, 59, 15, 10, 20, 216, 2, 245, 108, 59, 15, 10, 20, 55,
- 2, 123, 59, 15, 10, 20, 55, 2, 101, 59, 15, 10, 20, 55, 2, 202, 59, 15,
- 10, 20, 55, 2, 55, 59, 15, 10, 20, 234, 252, 2, 123, 59, 15, 10, 20, 234,
- 252, 2, 101, 59, 15, 10, 20, 234, 252, 2, 202, 59, 15, 10, 20, 234, 252,
- 2, 55, 59, 15, 10, 20, 234, 252, 2, 245, 108, 59, 15, 10, 20, 245, 108,
- 2, 123, 59, 15, 10, 20, 245, 108, 2, 55, 59, 15, 10, 20, 245, 108, 2,
- 227, 219, 92, 59, 15, 10, 20, 62, 2, 123, 59, 15, 10, 20, 62, 2, 101, 59,
- 15, 10, 20, 62, 2, 202, 59, 15, 10, 20, 62, 2, 55, 59, 15, 10, 20, 62, 2,
- 245, 108, 59, 15, 10, 20, 62, 2, 164, 64, 2, 55, 124, 15, 10, 20, 62, 2,
- 164, 64, 2, 245, 108, 124, 15, 10, 20, 252, 224, 2, 55, 124, 15, 10, 20,
- 252, 224, 2, 245, 108, 124, 15, 10, 20, 227, 35, 2, 55, 124, 15, 10, 20,
- 227, 35, 2, 245, 108, 124, 15, 10, 20, 226, 237, 2, 55, 124, 15, 10, 20,
- 226, 237, 2, 245, 108, 124, 15, 10, 20, 230, 202, 2, 55, 124, 15, 10, 20,
- 230, 202, 2, 245, 108, 124, 15, 10, 20, 229, 111, 2, 55, 124, 15, 10, 20,
- 229, 111, 2, 245, 108, 124, 15, 10, 20, 239, 60, 2, 216, 124, 15, 10, 20,
- 239, 60, 2, 55, 124, 15, 10, 20, 216, 2, 55, 124, 15, 10, 20, 234, 252,
- 2, 55, 124, 15, 10, 20, 234, 252, 2, 245, 108, 124, 15, 10, 20, 62, 2,
- 55, 124, 15, 10, 20, 62, 2, 245, 108, 124, 15, 10, 20, 229, 138, 2, 247,
- 105, 124, 15, 10, 20, 229, 138, 2, 250, 157, 124, 15, 10, 20, 229, 138,
- 2, 239, 24, 124, 15, 10, 20, 227, 92, 2, 92, 175, 44, 15, 10, 20, 227,
- 92, 2, 62, 44, 15, 10, 20, 254, 249, 2, 92, 175, 44, 15, 10, 20, 254,
- 249, 2, 62, 44, 15, 10, 20, 246, 64, 2, 92, 175, 44, 15, 10, 20, 246, 64,
- 2, 62, 44, 15, 10, 20, 230, 202, 2, 92, 175, 44, 15, 10, 20, 230, 202, 2,
- 62, 44, 15, 10, 20, 229, 111, 2, 92, 175, 44, 15, 10, 20, 229, 111, 2,
- 62, 44, 15, 10, 20, 101, 2, 92, 175, 44, 15, 10, 20, 101, 2, 62, 44, 15,
- 10, 20, 123, 2, 92, 175, 44, 15, 10, 20, 123, 2, 62, 44, 15, 10, 20, 202,
- 2, 92, 175, 44, 15, 10, 20, 202, 2, 62, 44, 15, 10, 20, 231, 25, 2, 92,
- 175, 44, 15, 10, 20, 231, 25, 2, 62, 44, 15, 10, 20, 250, 185, 2, 92,
- 175, 44, 15, 10, 20, 250, 185, 2, 62, 44, 15, 10, 20, 229, 111, 2, 123,
- 44, 15, 10, 20, 229, 111, 2, 101, 44, 15, 10, 20, 229, 111, 2, 202, 44,
- 15, 10, 20, 229, 111, 2, 55, 44, 15, 10, 20, 229, 111, 2, 231, 226, 44,
- 15, 10, 20, 230, 202, 2, 231, 226, 44, 15, 10, 20, 231, 25, 2, 231, 226,
- 44, 15, 10, 20, 250, 185, 2, 231, 226, 44, 15, 10, 20, 227, 92, 2, 92,
- 175, 35, 15, 10, 20, 227, 92, 2, 62, 35, 15, 10, 20, 254, 249, 2, 92,
- 175, 35, 15, 10, 20, 254, 249, 2, 62, 35, 15, 10, 20, 246, 64, 2, 92,
- 175, 35, 15, 10, 20, 246, 64, 2, 62, 35, 15, 10, 20, 230, 202, 2, 92,
- 175, 35, 15, 10, 20, 230, 202, 2, 62, 35, 15, 10, 20, 229, 111, 2, 92,
- 175, 35, 15, 10, 20, 229, 111, 2, 62, 35, 15, 10, 20, 101, 2, 92, 175,
- 35, 15, 10, 20, 101, 2, 62, 35, 15, 10, 20, 123, 2, 92, 175, 35, 15, 10,
- 20, 123, 2, 62, 35, 15, 10, 20, 202, 2, 92, 175, 35, 15, 10, 20, 202, 2,
- 62, 35, 15, 10, 20, 231, 25, 2, 92, 175, 35, 15, 10, 20, 231, 25, 2, 62,
- 35, 15, 10, 20, 250, 185, 2, 92, 175, 35, 15, 10, 20, 250, 185, 2, 62,
- 35, 15, 10, 20, 229, 111, 2, 123, 35, 15, 10, 20, 229, 111, 2, 101, 35,
- 15, 10, 20, 229, 111, 2, 202, 35, 15, 10, 20, 229, 111, 2, 55, 35, 15,
- 10, 20, 229, 111, 2, 231, 226, 35, 15, 10, 20, 230, 202, 2, 231, 226, 35,
- 15, 10, 20, 231, 25, 2, 231, 226, 35, 15, 10, 20, 250, 185, 2, 231, 226,
- 35, 15, 10, 20, 229, 111, 2, 123, 59, 15, 10, 20, 229, 111, 2, 101, 59,
- 15, 10, 20, 229, 111, 2, 202, 59, 15, 10, 20, 229, 111, 2, 55, 59, 15,
- 10, 20, 230, 202, 2, 245, 108, 59, 15, 10, 20, 229, 111, 2, 245, 108, 59,
- 15, 10, 20, 227, 92, 2, 55, 59, 15, 10, 20, 230, 202, 2, 123, 124, 15,
- 10, 20, 230, 202, 2, 101, 124, 15, 10, 20, 230, 202, 2, 202, 124, 15, 10,
- 20, 229, 111, 2, 123, 124, 15, 10, 20, 229, 111, 2, 101, 124, 15, 10, 20,
- 229, 111, 2, 202, 124, 15, 10, 20, 227, 92, 2, 55, 124, 15, 10, 20, 223,
- 114, 2, 55, 124, 15, 10, 20, 92, 2, 247, 103, 35, 15, 10, 20, 92, 2, 247,
- 103, 44, 15, 234, 24, 42, 233, 180, 234, 24, 41, 233, 180, 10, 20, 227,
- 35, 2, 123, 2, 55, 59, 15, 10, 20, 227, 35, 2, 101, 2, 123, 35, 15, 10,
- 20, 227, 35, 2, 101, 2, 123, 59, 15, 10, 20, 227, 35, 2, 101, 2, 55, 59,
- 15, 10, 20, 227, 35, 2, 202, 2, 55, 59, 15, 10, 20, 227, 35, 2, 55, 2,
- 123, 59, 15, 10, 20, 227, 35, 2, 55, 2, 101, 59, 15, 10, 20, 227, 35, 2,
- 55, 2, 202, 59, 15, 10, 20, 123, 2, 55, 2, 101, 35, 15, 10, 20, 123, 2,
- 55, 2, 101, 59, 15, 10, 20, 101, 2, 55, 2, 62, 35, 15, 10, 20, 101, 2,
- 55, 2, 92, 175, 35, 15, 10, 20, 230, 202, 2, 101, 2, 123, 59, 15, 10, 20,
- 230, 202, 2, 123, 2, 101, 59, 15, 10, 20, 230, 202, 2, 123, 2, 92, 175,
- 35, 15, 10, 20, 230, 202, 2, 55, 2, 101, 35, 15, 10, 20, 230, 202, 2, 55,
- 2, 101, 59, 15, 10, 20, 230, 202, 2, 55, 2, 123, 59, 15, 10, 20, 230,
- 202, 2, 55, 2, 55, 35, 15, 10, 20, 230, 202, 2, 55, 2, 55, 59, 15, 10,
- 20, 231, 25, 2, 101, 2, 101, 35, 15, 10, 20, 231, 25, 2, 101, 2, 101, 59,
- 15, 10, 20, 231, 25, 2, 55, 2, 55, 35, 15, 10, 20, 229, 111, 2, 101, 2,
- 55, 35, 15, 10, 20, 229, 111, 2, 101, 2, 55, 59, 15, 10, 20, 229, 111, 2,
- 123, 2, 62, 35, 15, 10, 20, 229, 111, 2, 55, 2, 202, 35, 15, 10, 20, 229,
- 111, 2, 55, 2, 202, 59, 15, 10, 20, 229, 111, 2, 55, 2, 55, 35, 15, 10,
- 20, 229, 111, 2, 55, 2, 55, 59, 15, 10, 20, 250, 185, 2, 101, 2, 92, 175,
- 35, 15, 10, 20, 250, 185, 2, 202, 2, 55, 35, 15, 10, 20, 250, 185, 2,
- 202, 2, 55, 59, 15, 10, 20, 227, 92, 2, 55, 2, 101, 35, 15, 10, 20, 227,
- 92, 2, 55, 2, 101, 59, 15, 10, 20, 227, 92, 2, 55, 2, 55, 59, 15, 10, 20,
- 227, 92, 2, 55, 2, 62, 35, 15, 10, 20, 254, 249, 2, 123, 2, 55, 35, 15,
- 10, 20, 254, 249, 2, 55, 2, 55, 35, 15, 10, 20, 254, 249, 2, 55, 2, 55,
- 59, 15, 10, 20, 254, 249, 2, 55, 2, 92, 175, 35, 15, 10, 20, 246, 64, 2,
- 55, 2, 55, 35, 15, 10, 20, 246, 64, 2, 55, 2, 62, 35, 15, 10, 20, 246,
- 64, 2, 55, 2, 92, 175, 35, 15, 10, 20, 247, 88, 2, 202, 2, 55, 35, 15,
- 10, 20, 247, 88, 2, 202, 2, 55, 59, 15, 10, 20, 232, 132, 2, 55, 2, 101,
- 35, 15, 10, 20, 232, 132, 2, 55, 2, 55, 35, 15, 10, 20, 216, 2, 101, 2,
- 55, 35, 15, 10, 20, 216, 2, 101, 2, 62, 35, 15, 10, 20, 216, 2, 101, 2,
- 92, 175, 35, 15, 10, 20, 216, 2, 123, 2, 123, 59, 15, 10, 20, 216, 2,
- 123, 2, 123, 35, 15, 10, 20, 216, 2, 202, 2, 55, 35, 15, 10, 20, 216, 2,
- 202, 2, 55, 59, 15, 10, 20, 216, 2, 55, 2, 101, 35, 15, 10, 20, 216, 2,
- 55, 2, 101, 59, 15, 10, 20, 55, 2, 101, 2, 123, 59, 15, 10, 20, 55, 2,
- 101, 2, 55, 59, 15, 10, 20, 55, 2, 101, 2, 62, 35, 15, 10, 20, 55, 2,
- 123, 2, 101, 59, 15, 10, 20, 55, 2, 123, 2, 55, 59, 15, 10, 20, 55, 2,
- 202, 2, 123, 59, 15, 10, 20, 55, 2, 202, 2, 55, 59, 15, 10, 20, 55, 2,
- 123, 2, 202, 59, 15, 10, 20, 245, 108, 2, 55, 2, 123, 59, 15, 10, 20,
- 245, 108, 2, 55, 2, 55, 59, 15, 10, 20, 234, 252, 2, 101, 2, 55, 59, 15,
- 10, 20, 234, 252, 2, 101, 2, 92, 175, 35, 15, 10, 20, 234, 252, 2, 123,
- 2, 55, 35, 15, 10, 20, 234, 252, 2, 123, 2, 55, 59, 15, 10, 20, 234, 252,
- 2, 123, 2, 92, 175, 35, 15, 10, 20, 234, 252, 2, 55, 2, 62, 35, 15, 10,
- 20, 234, 252, 2, 55, 2, 92, 175, 35, 15, 10, 20, 62, 2, 55, 2, 55, 35,
- 15, 10, 20, 62, 2, 55, 2, 55, 59, 15, 10, 20, 252, 224, 2, 202, 2, 62,
- 35, 15, 10, 20, 227, 35, 2, 123, 2, 62, 35, 15, 10, 20, 227, 35, 2, 123,
- 2, 92, 175, 35, 15, 10, 20, 227, 35, 2, 202, 2, 62, 35, 15, 10, 20, 227,
- 35, 2, 202, 2, 92, 175, 35, 15, 10, 20, 227, 35, 2, 55, 2, 62, 35, 15,
- 10, 20, 227, 35, 2, 55, 2, 92, 175, 35, 15, 10, 20, 123, 2, 55, 2, 62,
- 35, 15, 10, 20, 123, 2, 101, 2, 92, 175, 35, 15, 10, 20, 123, 2, 55, 2,
- 92, 175, 35, 15, 10, 20, 230, 202, 2, 202, 2, 92, 175, 35, 15, 10, 20,
- 231, 25, 2, 101, 2, 62, 35, 15, 10, 20, 229, 111, 2, 101, 2, 62, 35, 15,
- 10, 20, 250, 185, 2, 101, 2, 62, 35, 15, 10, 20, 216, 2, 123, 2, 62, 35,
- 15, 10, 20, 216, 2, 55, 2, 62, 35, 15, 10, 20, 62, 2, 101, 2, 62, 35, 15,
- 10, 20, 62, 2, 123, 2, 62, 35, 15, 10, 20, 62, 2, 55, 2, 62, 35, 15, 10,
- 20, 55, 2, 55, 2, 62, 35, 15, 10, 20, 232, 132, 2, 55, 2, 62, 35, 15, 10,
- 20, 234, 252, 2, 101, 2, 62, 35, 15, 10, 20, 232, 132, 2, 55, 2, 101, 59,
- 15, 10, 20, 216, 2, 101, 2, 55, 59, 15, 10, 20, 254, 249, 2, 55, 2, 62,
- 35, 15, 10, 20, 239, 60, 2, 55, 2, 62, 35, 15, 10, 20, 234, 252, 2, 123,
- 2, 101, 59, 15, 10, 20, 55, 2, 202, 2, 62, 35, 15, 10, 20, 216, 2, 123,
- 2, 55, 59, 15, 10, 20, 239, 60, 2, 55, 2, 55, 35, 15, 10, 20, 216, 2,
- 123, 2, 55, 35, 15, 10, 20, 234, 252, 2, 123, 2, 101, 35, 15, 10, 20,
- 123, 2, 101, 2, 62, 35, 15, 10, 20, 101, 2, 123, 2, 62, 35, 15, 10, 20,
- 55, 2, 123, 2, 62, 35, 15, 10, 20, 247, 88, 2, 55, 2, 62, 35, 15, 10, 20,
- 252, 224, 2, 101, 2, 62, 35, 15, 10, 20, 239, 60, 2, 55, 2, 55, 59, 15,
- 10, 20, 254, 249, 2, 123, 2, 55, 59, 15, 10, 20, 231, 25, 2, 55, 2, 55,
- 59, 15, 10, 20, 230, 202, 2, 202, 2, 62, 35, 15, 10, 20, 234, 252, 2,
- 123, 2, 62, 35, 15, 10, 20, 231, 9, 225, 85, 254, 87, 238, 134, 228, 39,
- 5, 44, 15, 10, 20, 232, 128, 225, 85, 254, 87, 238, 134, 228, 39, 5, 44,
- 15, 10, 20, 254, 215, 44, 15, 10, 20, 254, 237, 44, 15, 10, 20, 236, 97,
- 44, 15, 10, 20, 231, 10, 44, 15, 10, 20, 231, 254, 44, 15, 10, 20, 254,
- 229, 44, 15, 10, 20, 224, 160, 44, 15, 10, 20, 231, 9, 44, 15, 10, 20,
- 231, 8, 254, 229, 224, 159, 10, 20, 239, 176, 231, 179, 53, 10, 20, 252,
- 158, 254, 132, 254, 133, 38, 230, 192, 38, 230, 81, 38, 230, 13, 38, 230,
- 2, 38, 229, 247, 38, 229, 236, 38, 229, 225, 38, 229, 214, 38, 229, 203,
- 38, 230, 191, 38, 230, 180, 38, 230, 169, 38, 230, 158, 38, 230, 147, 38,
- 230, 136, 38, 230, 125, 232, 208, 211, 32, 61, 251, 54, 232, 208, 211,
- 32, 61, 90, 251, 54, 232, 208, 211, 32, 61, 90, 246, 218, 228, 38, 232,
- 208, 211, 32, 61, 251, 61, 232, 208, 211, 32, 61, 229, 186, 232, 208,
- 211, 32, 61, 247, 149, 76, 232, 208, 211, 32, 61, 232, 69, 76, 232, 208,
- 211, 32, 61, 42, 63, 237, 217, 104, 232, 208, 211, 32, 61, 41, 63, 237,
- 217, 252, 114, 232, 208, 211, 32, 61, 169, 247, 249, 36, 20, 42, 245,
- 151, 36, 20, 41, 245, 151, 36, 47, 226, 159, 42, 245, 151, 36, 47, 226,
- 159, 41, 245, 151, 36, 237, 64, 42, 245, 151, 36, 237, 64, 41, 245, 151,
- 36, 251, 37, 237, 63, 232, 208, 211, 32, 61, 135, 56, 237, 242, 232, 208,
- 211, 32, 61, 247, 248, 250, 130, 232, 208, 211, 32, 61, 247, 240, 250,
- 130, 232, 208, 211, 32, 61, 184, 237, 170, 232, 208, 211, 32, 61, 224,
- 146, 184, 237, 170, 232, 208, 211, 32, 61, 42, 233, 180, 232, 208, 211,
- 32, 61, 41, 233, 180, 232, 208, 211, 32, 61, 42, 250, 223, 104, 232, 208,
- 211, 32, 61, 41, 250, 223, 104, 232, 208, 211, 32, 61, 42, 226, 100, 229,
- 104, 104, 232, 208, 211, 32, 61, 41, 226, 100, 229, 104, 104, 232, 208,
- 211, 32, 61, 42, 86, 237, 217, 104, 232, 208, 211, 32, 61, 41, 86, 237,
- 217, 104, 232, 208, 211, 32, 61, 42, 47, 254, 182, 104, 232, 208, 211,
- 32, 61, 41, 47, 254, 182, 104, 232, 208, 211, 32, 61, 42, 254, 182, 104,
- 232, 208, 211, 32, 61, 41, 254, 182, 104, 232, 208, 211, 32, 61, 42, 251,
- 11, 104, 232, 208, 211, 32, 61, 41, 251, 11, 104, 232, 208, 211, 32, 61,
- 42, 63, 251, 11, 104, 232, 208, 211, 32, 61, 41, 63, 251, 11, 104, 229,
- 168, 249, 140, 63, 229, 168, 249, 140, 232, 208, 211, 32, 61, 42, 37,
- 104, 232, 208, 211, 32, 61, 41, 37, 104, 250, 129, 234, 1, 251, 216, 234,
- 1, 224, 146, 234, 1, 47, 224, 146, 234, 1, 250, 129, 184, 237, 170, 251,
- 216, 184, 237, 170, 224, 146, 184, 237, 170, 3, 251, 54, 3, 90, 251, 54,
- 3, 246, 218, 228, 38, 3, 229, 186, 3, 251, 61, 3, 232, 69, 76, 3, 247,
- 149, 76, 3, 247, 248, 250, 130, 3, 42, 233, 180, 3, 41, 233, 180, 3, 42,
- 250, 223, 104, 3, 41, 250, 223, 104, 3, 42, 226, 100, 229, 104, 104, 3,
- 41, 226, 100, 229, 104, 104, 3, 65, 53, 3, 254, 193, 3, 254, 69, 3, 79,
- 53, 3, 244, 94, 3, 237, 213, 53, 3, 245, 231, 53, 3, 247, 204, 53, 3,
- 231, 193, 228, 161, 3, 249, 150, 53, 3, 233, 123, 53, 3, 251, 53, 254,
- 62, 10, 247, 103, 44, 15, 10, 227, 64, 2, 247, 103, 46, 10, 250, 155, 44,
- 15, 10, 227, 90, 246, 234, 10, 239, 22, 44, 15, 10, 247, 105, 44, 15, 10,
- 247, 105, 124, 15, 10, 250, 157, 44, 15, 10, 250, 157, 124, 15, 10, 239,
- 24, 44, 15, 10, 239, 24, 124, 15, 10, 229, 138, 44, 15, 10, 229, 138,
- 124, 15, 10, 227, 235, 44, 15, 10, 227, 235, 124, 15, 10, 1, 164, 44, 15,
- 10, 1, 92, 2, 237, 59, 64, 44, 15, 10, 1, 92, 2, 237, 59, 64, 35, 15, 10,
- 1, 92, 2, 164, 64, 44, 15, 10, 1, 92, 2, 164, 64, 35, 15, 10, 1, 224,
- 145, 2, 164, 64, 44, 15, 10, 1, 224, 145, 2, 164, 64, 35, 15, 10, 1, 92,
- 2, 164, 252, 214, 44, 15, 10, 1, 92, 2, 164, 252, 214, 35, 15, 10, 1, 62,
- 2, 164, 64, 44, 15, 10, 1, 62, 2, 164, 64, 35, 15, 10, 1, 62, 2, 164, 64,
- 59, 15, 10, 1, 62, 2, 164, 64, 124, 15, 10, 1, 92, 44, 15, 10, 1, 92, 35,
- 15, 10, 1, 252, 224, 44, 15, 10, 1, 252, 224, 35, 15, 10, 1, 252, 224,
- 59, 15, 10, 1, 252, 224, 124, 15, 10, 1, 227, 35, 237, 23, 44, 15, 10, 1,
- 227, 35, 237, 23, 35, 15, 10, 1, 227, 35, 44, 15, 10, 1, 227, 35, 35, 15,
- 10, 1, 227, 35, 59, 15, 10, 1, 227, 35, 124, 15, 10, 1, 226, 237, 44, 15,
- 10, 1, 226, 237, 35, 15, 10, 1, 226, 237, 59, 15, 10, 1, 226, 237, 124,
- 15, 10, 1, 123, 44, 15, 10, 1, 123, 35, 15, 10, 1, 123, 59, 15, 10, 1,
- 123, 124, 15, 10, 1, 101, 44, 15, 10, 1, 101, 35, 15, 10, 1, 101, 59, 15,
- 10, 1, 101, 124, 15, 10, 1, 202, 44, 15, 10, 1, 202, 35, 15, 10, 1, 202,
- 59, 15, 10, 1, 202, 124, 15, 10, 1, 250, 166, 44, 15, 10, 1, 250, 166,
- 35, 15, 10, 1, 226, 246, 44, 15, 10, 1, 226, 246, 35, 15, 10, 1, 231,
- 226, 44, 15, 10, 1, 231, 226, 35, 15, 10, 1, 223, 111, 44, 15, 10, 1,
- 223, 111, 35, 15, 10, 1, 230, 202, 44, 15, 10, 1, 230, 202, 35, 15, 10,
- 1, 230, 202, 59, 15, 10, 1, 230, 202, 124, 15, 10, 1, 229, 111, 44, 15,
- 10, 1, 229, 111, 35, 15, 10, 1, 229, 111, 59, 15, 10, 1, 229, 111, 124,
- 15, 10, 1, 231, 25, 44, 15, 10, 1, 231, 25, 35, 15, 10, 1, 231, 25, 59,
- 15, 10, 1, 231, 25, 124, 15, 10, 1, 250, 185, 44, 15, 10, 1, 250, 185,
- 35, 15, 10, 1, 250, 185, 59, 15, 10, 1, 250, 185, 124, 15, 10, 1, 227,
- 92, 44, 15, 10, 1, 227, 92, 35, 15, 10, 1, 227, 92, 59, 15, 10, 1, 227,
- 92, 124, 15, 10, 1, 223, 114, 44, 15, 10, 1, 223, 114, 35, 15, 10, 1,
- 223, 114, 59, 15, 10, 1, 223, 114, 124, 15, 10, 1, 254, 249, 44, 15, 10,
- 1, 254, 249, 35, 15, 10, 1, 254, 249, 59, 15, 10, 1, 254, 249, 124, 15,
- 10, 1, 246, 64, 44, 15, 10, 1, 246, 64, 35, 15, 10, 1, 246, 64, 59, 15,
- 10, 1, 246, 64, 124, 15, 10, 1, 247, 88, 44, 15, 10, 1, 247, 88, 35, 15,
- 10, 1, 247, 88, 59, 15, 10, 1, 247, 88, 124, 15, 10, 1, 232, 132, 44, 15,
- 10, 1, 232, 132, 35, 15, 10, 1, 232, 132, 59, 15, 10, 1, 232, 132, 124,
- 15, 10, 1, 239, 60, 44, 15, 10, 1, 239, 60, 35, 15, 10, 1, 239, 60, 59,
- 15, 10, 1, 239, 60, 124, 15, 10, 1, 216, 44, 15, 10, 1, 216, 35, 15, 10,
- 1, 216, 59, 15, 10, 1, 216, 124, 15, 10, 1, 55, 44, 15, 10, 1, 55, 35,
- 15, 10, 1, 55, 59, 15, 10, 1, 55, 124, 15, 10, 1, 234, 252, 44, 15, 10,
- 1, 234, 252, 35, 15, 10, 1, 234, 252, 59, 15, 10, 1, 234, 252, 124, 15,
- 10, 1, 245, 108, 44, 15, 10, 1, 245, 108, 35, 15, 10, 1, 245, 108, 59,
- 15, 10, 1, 245, 108, 124, 15, 10, 1, 224, 145, 44, 15, 10, 1, 224, 145,
- 35, 15, 10, 1, 92, 175, 44, 15, 10, 1, 92, 175, 35, 15, 10, 1, 62, 44,
- 15, 10, 1, 62, 35, 15, 10, 1, 62, 59, 15, 10, 1, 62, 124, 15, 10, 20,
- 216, 2, 92, 2, 237, 59, 64, 44, 15, 10, 20, 216, 2, 92, 2, 237, 59, 64,
- 35, 15, 10, 20, 216, 2, 92, 2, 164, 64, 44, 15, 10, 20, 216, 2, 92, 2,
- 164, 64, 35, 15, 10, 20, 216, 2, 92, 2, 164, 252, 214, 44, 15, 10, 20,
- 216, 2, 92, 2, 164, 252, 214, 35, 15, 10, 20, 216, 2, 92, 44, 15, 10, 20,
- 216, 2, 92, 35, 15, 223, 90, 224, 115, 235, 5, 228, 145, 100, 247, 149,
- 76, 100, 232, 57, 76, 100, 65, 53, 100, 249, 150, 53, 100, 233, 123, 53,
- 100, 254, 193, 100, 254, 144, 100, 42, 233, 180, 100, 41, 233, 180, 100,
- 254, 69, 100, 79, 53, 100, 251, 54, 100, 244, 94, 100, 246, 218, 228, 38,
- 100, 228, 161, 100, 21, 223, 89, 100, 21, 118, 100, 21, 113, 100, 21,
- 166, 100, 21, 158, 100, 21, 173, 100, 21, 183, 100, 21, 194, 100, 21,
- 187, 100, 21, 192, 100, 251, 61, 100, 229, 186, 100, 237, 213, 53, 100,
- 247, 204, 53, 100, 245, 231, 53, 100, 232, 69, 76, 100, 251, 53, 254, 62,
- 100, 7, 6, 1, 57, 100, 7, 6, 1, 254, 27, 100, 7, 6, 1, 252, 44, 100, 7,
- 6, 1, 222, 222, 100, 7, 6, 1, 72, 100, 7, 6, 1, 247, 130, 100, 7, 6, 1,
- 214, 100, 7, 6, 1, 212, 100, 7, 6, 1, 74, 100, 7, 6, 1, 239, 182, 100, 7,
- 6, 1, 239, 76, 100, 7, 6, 1, 149, 100, 7, 6, 1, 185, 100, 7, 6, 1, 199,
- 100, 7, 6, 1, 73, 100, 7, 6, 1, 233, 244, 100, 7, 6, 1, 232, 139, 100, 7,
- 6, 1, 146, 100, 7, 6, 1, 193, 100, 7, 6, 1, 227, 109, 100, 7, 6, 1, 66,
- 100, 7, 6, 1, 196, 100, 7, 6, 1, 224, 174, 100, 7, 6, 1, 224, 73, 100, 7,
- 6, 1, 224, 25, 100, 7, 6, 1, 223, 119, 100, 42, 37, 104, 100, 231, 193,
- 228, 161, 100, 41, 37, 104, 100, 251, 102, 255, 41, 100, 184, 237, 170,
- 100, 245, 237, 255, 41, 100, 7, 3, 1, 57, 100, 7, 3, 1, 254, 27, 100, 7,
- 3, 1, 252, 44, 100, 7, 3, 1, 222, 222, 100, 7, 3, 1, 72, 100, 7, 3, 1,
- 247, 130, 100, 7, 3, 1, 214, 100, 7, 3, 1, 212, 100, 7, 3, 1, 74, 100, 7,
- 3, 1, 239, 182, 100, 7, 3, 1, 239, 76, 100, 7, 3, 1, 149, 100, 7, 3, 1,
- 185, 100, 7, 3, 1, 199, 100, 7, 3, 1, 73, 100, 7, 3, 1, 233, 244, 100, 7,
- 3, 1, 232, 139, 100, 7, 3, 1, 146, 100, 7, 3, 1, 193, 100, 7, 3, 1, 227,
- 109, 100, 7, 3, 1, 66, 100, 7, 3, 1, 196, 100, 7, 3, 1, 224, 174, 100, 7,
- 3, 1, 224, 73, 100, 7, 3, 1, 224, 25, 100, 7, 3, 1, 223, 119, 100, 42,
- 250, 223, 104, 100, 61, 237, 170, 100, 41, 250, 223, 104, 100, 205, 100,
- 42, 63, 233, 180, 100, 41, 63, 233, 180, 83, 90, 246, 218, 228, 38, 83,
- 42, 251, 11, 104, 83, 41, 251, 11, 104, 83, 90, 251, 54, 83, 48, 236,
- 154, 249, 140, 83, 48, 1, 224, 105, 83, 48, 1, 3, 57, 83, 48, 1, 3, 74,
- 83, 48, 1, 3, 66, 83, 48, 1, 3, 72, 83, 48, 1, 3, 73, 83, 48, 1, 3, 191,
- 83, 48, 1, 3, 223, 158, 83, 48, 1, 3, 223, 183, 83, 48, 1, 3, 225, 250,
- 83, 239, 19, 232, 194, 228, 155, 76, 83, 48, 1, 57, 83, 48, 1, 74, 83,
- 48, 1, 66, 83, 48, 1, 72, 83, 48, 1, 73, 83, 48, 1, 177, 83, 48, 1, 238,
- 199, 83, 48, 1, 238, 107, 83, 48, 1, 239, 3, 83, 48, 1, 238, 150, 83, 48,
- 1, 231, 31, 83, 48, 1, 229, 15, 83, 48, 1, 228, 6, 83, 48, 1, 230, 213,
- 83, 48, 1, 228, 169, 83, 48, 1, 227, 107, 83, 48, 1, 226, 175, 83, 48, 1,
- 225, 250, 83, 48, 1, 227, 44, 83, 48, 1, 96, 83, 48, 1, 236, 1, 83, 48,
- 1, 235, 89, 83, 48, 1, 234, 206, 83, 48, 1, 235, 162, 83, 48, 1, 235, 6,
- 83, 48, 1, 154, 83, 48, 1, 245, 75, 83, 48, 1, 244, 145, 83, 48, 1, 245,
- 121, 83, 48, 1, 244, 227, 83, 48, 1, 198, 83, 48, 1, 236, 157, 83, 48, 1,
- 236, 66, 83, 48, 1, 236, 235, 83, 48, 1, 236, 103, 83, 48, 1, 191, 83,
- 48, 1, 223, 158, 83, 48, 1, 223, 183, 83, 48, 1, 208, 83, 48, 1, 231,
- 180, 83, 48, 1, 231, 70, 83, 48, 1, 231, 244, 83, 48, 1, 231, 122, 83,
- 48, 1, 224, 173, 83, 48, 1, 199, 83, 48, 224, 204, 228, 155, 76, 83, 48,
- 229, 191, 228, 155, 76, 83, 26, 247, 52, 83, 26, 1, 238, 173, 83, 26, 1,
- 228, 104, 83, 26, 1, 238, 171, 83, 26, 1, 235, 82, 83, 26, 1, 235, 81,
- 83, 26, 1, 235, 80, 83, 26, 1, 226, 163, 83, 26, 1, 228, 99, 83, 26, 1,
- 231, 174, 83, 26, 1, 231, 170, 83, 26, 1, 231, 168, 83, 26, 1, 231, 162,
- 83, 26, 1, 231, 159, 83, 26, 1, 231, 157, 83, 26, 1, 231, 163, 83, 26, 1,
- 231, 173, 83, 26, 1, 236, 148, 83, 26, 1, 233, 60, 83, 26, 1, 228, 102,
- 83, 26, 1, 233, 52, 83, 26, 1, 228, 236, 83, 26, 1, 228, 100, 83, 26, 1,
- 240, 68, 83, 26, 1, 251, 113, 83, 26, 1, 228, 107, 83, 26, 1, 251, 167,
- 83, 26, 1, 238, 210, 83, 26, 1, 226, 218, 83, 26, 1, 233, 85, 83, 26, 1,
- 245, 69, 83, 26, 1, 57, 83, 26, 1, 255, 19, 83, 26, 1, 191, 83, 26, 1,
- 224, 10, 83, 26, 1, 247, 217, 83, 26, 1, 72, 83, 26, 1, 223, 221, 83, 26,
- 1, 223, 228, 83, 26, 1, 73, 83, 26, 1, 224, 173, 83, 26, 1, 224, 170, 83,
- 26, 1, 234, 88, 83, 26, 1, 223, 183, 83, 26, 1, 66, 83, 26, 1, 224, 133,
- 83, 26, 1, 224, 141, 83, 26, 1, 224, 118, 83, 26, 1, 223, 158, 83, 26, 1,
- 247, 165, 83, 26, 1, 223, 202, 83, 26, 1, 74, 100, 251, 220, 53, 100,
- 232, 234, 53, 100, 190, 53, 100, 237, 63, 100, 252, 99, 125, 100, 223,
- 222, 53, 100, 224, 100, 53, 83, 246, 248, 157, 225, 30, 83, 117, 58, 83,
- 225, 106, 58, 83, 81, 58, 83, 248, 125, 58, 83, 86, 228, 120, 83, 63,
- 251, 106, 239, 233, 254, 175, 254, 188, 239, 233, 254, 175, 229, 173,
- 239, 233, 254, 175, 227, 16, 234, 98, 231, 209, 251, 191, 231, 209, 251,
- 191, 50, 45, 4, 254, 19, 57, 50, 45, 4, 253, 246, 72, 50, 45, 4, 253,
- 255, 74, 50, 45, 4, 253, 223, 73, 50, 45, 4, 254, 17, 66, 50, 45, 4, 254,
- 26, 250, 189, 50, 45, 4, 253, 239, 250, 77, 50, 45, 4, 254, 20, 250, 4,
- 50, 45, 4, 254, 13, 249, 161, 50, 45, 4, 253, 233, 248, 107, 50, 45, 4,
- 253, 227, 239, 179, 50, 45, 4, 253, 238, 239, 170, 50, 45, 4, 253, 248,
- 239, 117, 50, 45, 4, 253, 219, 239, 101, 50, 45, 4, 253, 207, 177, 50,
- 45, 4, 253, 240, 239, 3, 50, 45, 4, 253, 217, 238, 199, 50, 45, 4, 253,
- 214, 238, 150, 50, 45, 4, 253, 203, 238, 107, 50, 45, 4, 253, 204, 198,
- 50, 45, 4, 254, 14, 236, 235, 50, 45, 4, 253, 211, 236, 157, 50, 45, 4,
- 254, 12, 236, 103, 50, 45, 4, 254, 4, 236, 66, 50, 45, 4, 254, 21, 236,
- 1, 50, 45, 4, 254, 3, 235, 162, 50, 45, 4, 253, 253, 235, 89, 50, 45, 4,
- 253, 232, 235, 6, 50, 45, 4, 253, 229, 234, 206, 50, 45, 4, 254, 24, 213,
- 50, 45, 4, 253, 212, 233, 151, 50, 45, 4, 253, 245, 233, 69, 50, 45, 4,
- 254, 16, 233, 4, 50, 45, 4, 253, 234, 232, 173, 50, 45, 4, 254, 11, 232,
- 138, 50, 45, 4, 253, 206, 232, 119, 50, 45, 4, 254, 6, 232, 104, 50, 45,
- 4, 253, 251, 232, 95, 50, 45, 4, 253, 224, 208, 50, 45, 4, 254, 0, 231,
- 244, 50, 45, 4, 253, 231, 231, 180, 50, 45, 4, 254, 25, 231, 122, 50, 45,
- 4, 254, 1, 231, 70, 50, 45, 4, 253, 252, 231, 31, 50, 45, 4, 254, 18,
- 230, 213, 50, 45, 4, 253, 243, 229, 15, 50, 45, 4, 254, 15, 228, 169, 50,
- 45, 4, 253, 226, 228, 6, 50, 45, 4, 253, 225, 227, 107, 50, 45, 4, 254,
- 23, 227, 44, 50, 45, 4, 253, 247, 226, 175, 50, 45, 4, 254, 22, 96, 50,
- 45, 4, 253, 215, 225, 250, 50, 45, 4, 253, 230, 224, 173, 50, 45, 4, 253,
- 209, 224, 141, 50, 45, 4, 253, 244, 224, 118, 50, 45, 4, 253, 242, 224,
- 105, 50, 45, 4, 254, 10, 223, 117, 50, 45, 4, 253, 210, 223, 97, 50, 45,
- 4, 254, 7, 223, 27, 50, 45, 4, 254, 2, 255, 65, 50, 45, 4, 253, 241, 255,
- 64, 50, 45, 4, 253, 200, 254, 53, 50, 45, 4, 253, 213, 248, 78, 50, 45,
- 4, 253, 196, 248, 77, 50, 45, 4, 253, 236, 234, 177, 50, 45, 4, 253, 254,
- 232, 172, 50, 45, 4, 253, 222, 232, 175, 50, 45, 4, 253, 208, 232, 24,
- 50, 45, 4, 253, 250, 232, 23, 50, 45, 4, 253, 216, 231, 121, 50, 45, 4,
- 253, 218, 227, 105, 50, 45, 4, 253, 198, 225, 220, 50, 45, 4, 253, 195,
- 113, 50, 45, 14, 254, 9, 50, 45, 14, 254, 8, 50, 45, 14, 254, 5, 50, 45,
- 14, 253, 249, 50, 45, 14, 253, 237, 50, 45, 14, 253, 235, 50, 45, 14,
- 253, 228, 50, 45, 14, 253, 221, 50, 45, 14, 253, 220, 50, 45, 14, 253,
- 205, 50, 45, 14, 253, 202, 50, 45, 14, 253, 201, 50, 45, 14, 253, 199,
- 50, 45, 14, 253, 197, 50, 45, 89, 253, 194, 237, 35, 50, 45, 89, 253,
- 193, 224, 101, 50, 45, 89, 253, 192, 250, 65, 50, 45, 89, 253, 191, 247,
- 201, 50, 45, 89, 253, 190, 237, 18, 50, 45, 89, 253, 189, 228, 64, 50,
- 45, 89, 253, 188, 247, 154, 50, 45, 89, 253, 187, 232, 6, 50, 45, 89,
- 253, 186, 229, 113, 50, 45, 89, 253, 185, 245, 120, 50, 45, 89, 253, 184,
- 228, 150, 50, 45, 89, 253, 183, 252, 136, 50, 45, 89, 253, 182, 250, 253,
- 50, 45, 89, 253, 181, 252, 85, 50, 45, 89, 253, 180, 224, 126, 50, 45,
- 89, 253, 179, 253, 33, 50, 45, 89, 253, 178, 234, 70, 50, 45, 89, 253,
- 177, 228, 136, 50, 45, 89, 253, 176, 250, 198, 50, 45, 236, 92, 253, 175,
- 239, 37, 50, 45, 236, 92, 253, 174, 239, 44, 50, 45, 89, 253, 173, 234,
- 79, 50, 45, 89, 253, 172, 224, 109, 50, 45, 89, 253, 171, 50, 45, 236,
- 92, 253, 170, 254, 116, 50, 45, 236, 92, 253, 169, 236, 208, 50, 45, 89,
- 253, 168, 252, 98, 50, 45, 89, 253, 167, 246, 6, 50, 45, 89, 253, 166,
- 50, 45, 89, 253, 165, 224, 95, 50, 45, 89, 253, 164, 50, 45, 89, 253,
- 163, 50, 45, 89, 253, 162, 244, 160, 50, 45, 89, 253, 161, 50, 45, 89,
- 253, 160, 50, 45, 89, 253, 159, 50, 45, 236, 92, 253, 157, 225, 231, 50,
- 45, 89, 253, 156, 50, 45, 89, 253, 155, 50, 45, 89, 253, 154, 251, 77,
- 50, 45, 89, 253, 153, 50, 45, 89, 253, 152, 50, 45, 89, 253, 151, 246,
- 158, 50, 45, 89, 253, 150, 254, 104, 50, 45, 89, 253, 149, 50, 45, 89,
- 253, 148, 50, 45, 89, 253, 147, 50, 45, 89, 253, 146, 50, 45, 89, 253,
- 145, 50, 45, 89, 253, 144, 50, 45, 89, 253, 143, 50, 45, 89, 253, 142,
- 50, 45, 89, 253, 141, 50, 45, 89, 253, 140, 236, 87, 50, 45, 89, 253,
- 139, 50, 45, 89, 253, 138, 226, 86, 50, 45, 89, 253, 137, 50, 45, 89,
- 253, 136, 50, 45, 89, 253, 135, 50, 45, 89, 253, 134, 50, 45, 89, 253,
- 133, 50, 45, 89, 253, 132, 50, 45, 89, 253, 131, 50, 45, 89, 253, 130,
- 50, 45, 89, 253, 129, 50, 45, 89, 253, 128, 50, 45, 89, 253, 127, 50, 45,
- 89, 253, 126, 245, 102, 50, 45, 89, 253, 105, 247, 0, 50, 45, 89, 253,
- 102, 253, 19, 50, 45, 89, 253, 97, 228, 140, 50, 45, 89, 253, 96, 58, 50,
- 45, 89, 253, 95, 50, 45, 89, 253, 94, 227, 189, 50, 45, 89, 253, 93, 50,
- 45, 89, 253, 92, 50, 45, 89, 253, 91, 224, 122, 251, 188, 50, 45, 89,
- 253, 90, 251, 188, 50, 45, 89, 253, 89, 251, 189, 246, 232, 50, 45, 89,
- 253, 88, 224, 124, 50, 45, 89, 253, 87, 50, 45, 89, 253, 86, 50, 45, 236,
- 92, 253, 85, 249, 202, 50, 45, 89, 253, 84, 50, 45, 89, 253, 83, 50, 45,
- 89, 253, 81, 50, 45, 89, 253, 80, 50, 45, 89, 253, 79, 50, 45, 89, 253,
- 78, 250, 133, 50, 45, 89, 253, 77, 50, 45, 89, 253, 76, 50, 45, 89, 253,
- 75, 50, 45, 89, 253, 74, 50, 45, 89, 253, 73, 50, 45, 89, 224, 233, 253,
- 158, 50, 45, 89, 224, 233, 253, 125, 50, 45, 89, 224, 233, 253, 124, 50,
- 45, 89, 224, 233, 253, 123, 50, 45, 89, 224, 233, 253, 122, 50, 45, 89,
- 224, 233, 253, 121, 50, 45, 89, 224, 233, 253, 120, 50, 45, 89, 224, 233,
- 253, 119, 50, 45, 89, 224, 233, 253, 118, 50, 45, 89, 224, 233, 253, 117,
- 50, 45, 89, 224, 233, 253, 116, 50, 45, 89, 224, 233, 253, 115, 50, 45,
- 89, 224, 233, 253, 114, 50, 45, 89, 224, 233, 253, 113, 50, 45, 89, 224,
- 233, 253, 112, 50, 45, 89, 224, 233, 253, 111, 50, 45, 89, 224, 233, 253,
- 110, 50, 45, 89, 224, 233, 253, 109, 50, 45, 89, 224, 233, 253, 108, 50,
- 45, 89, 224, 233, 253, 107, 50, 45, 89, 224, 233, 253, 106, 50, 45, 89,
- 224, 233, 253, 104, 50, 45, 89, 224, 233, 253, 103, 50, 45, 89, 224, 233,
- 253, 101, 50, 45, 89, 224, 233, 253, 100, 50, 45, 89, 224, 233, 253, 99,
- 50, 45, 89, 224, 233, 253, 98, 50, 45, 89, 224, 233, 253, 82, 50, 45, 89,
- 224, 233, 253, 72, 210, 224, 92, 229, 174, 237, 170, 210, 224, 92, 229,
- 174, 249, 140, 210, 251, 181, 76, 210, 65, 118, 210, 65, 113, 210, 65,
- 166, 210, 65, 158, 210, 65, 173, 210, 65, 183, 210, 65, 194, 210, 65,
- 187, 210, 65, 192, 210, 65, 227, 23, 210, 65, 225, 216, 210, 65, 226,
- 207, 210, 65, 246, 245, 210, 65, 247, 63, 210, 65, 228, 206, 210, 65,
- 229, 159, 210, 65, 248, 12, 210, 65, 235, 57, 210, 65, 168, 244, 135,
- 210, 65, 135, 244, 135, 210, 65, 152, 244, 135, 210, 65, 246, 243, 244,
- 135, 210, 65, 247, 37, 244, 135, 210, 65, 228, 217, 244, 135, 210, 65,
- 229, 163, 244, 135, 210, 65, 248, 20, 244, 135, 210, 65, 235, 61, 244,
- 135, 210, 65, 168, 226, 194, 210, 65, 135, 226, 194, 210, 65, 152, 226,
- 194, 210, 65, 246, 243, 226, 194, 210, 65, 247, 37, 226, 194, 210, 65,
- 228, 217, 226, 194, 210, 65, 229, 163, 226, 194, 210, 65, 248, 20, 226,
- 194, 210, 65, 235, 61, 226, 194, 210, 65, 227, 24, 226, 194, 210, 65,
- 225, 217, 226, 194, 210, 65, 226, 208, 226, 194, 210, 65, 246, 246, 226,
- 194, 210, 65, 247, 64, 226, 194, 210, 65, 228, 207, 226, 194, 210, 65,
- 229, 160, 226, 194, 210, 65, 248, 13, 226, 194, 210, 65, 235, 58, 226,
- 194, 210, 224, 136, 253, 25, 225, 125, 210, 224, 136, 247, 45, 227, 247,
- 210, 224, 136, 230, 209, 227, 247, 210, 224, 136, 226, 214, 227, 247,
- 210, 224, 136, 246, 237, 227, 247, 210, 248, 110, 236, 234, 247, 45, 227,
- 247, 210, 237, 160, 236, 234, 247, 45, 227, 247, 210, 236, 234, 230, 209,
- 227, 247, 210, 236, 234, 226, 214, 227, 247, 19, 255, 36, 254, 55, 168,
- 232, 76, 19, 255, 36, 254, 55, 168, 245, 151, 19, 255, 36, 254, 55, 168,
- 248, 121, 19, 255, 36, 254, 55, 173, 19, 255, 36, 254, 55, 247, 63, 19,
- 255, 36, 254, 55, 247, 37, 244, 135, 19, 255, 36, 254, 55, 247, 37, 226,
- 194, 19, 255, 36, 254, 55, 247, 64, 226, 194, 19, 255, 36, 254, 55, 247,
- 37, 227, 80, 19, 255, 36, 254, 55, 227, 24, 227, 80, 19, 255, 36, 254,
- 55, 247, 64, 227, 80, 19, 255, 36, 254, 55, 168, 244, 136, 227, 80, 19,
- 255, 36, 254, 55, 247, 37, 244, 136, 227, 80, 19, 255, 36, 254, 55, 168,
- 226, 195, 227, 80, 19, 255, 36, 254, 55, 247, 37, 226, 195, 227, 80, 19,
- 255, 36, 254, 55, 247, 37, 228, 55, 19, 255, 36, 254, 55, 227, 24, 228,
- 55, 19, 255, 36, 254, 55, 247, 64, 228, 55, 19, 255, 36, 254, 55, 168,
- 244, 136, 228, 55, 19, 255, 36, 254, 55, 247, 37, 244, 136, 228, 55, 19,
- 255, 36, 254, 55, 168, 226, 195, 228, 55, 19, 255, 36, 254, 55, 227, 24,
- 226, 195, 228, 55, 19, 255, 36, 254, 55, 247, 64, 226, 195, 228, 55, 19,
- 255, 36, 254, 55, 227, 24, 236, 106, 19, 255, 36, 245, 96, 168, 233, 16,
- 19, 255, 36, 226, 225, 118, 19, 255, 36, 245, 94, 118, 19, 255, 36, 247,
- 209, 113, 19, 255, 36, 226, 225, 113, 19, 255, 36, 250, 196, 135, 248,
- 120, 19, 255, 36, 247, 209, 135, 248, 120, 19, 255, 36, 226, 59, 173, 19,
- 255, 36, 226, 59, 227, 23, 19, 255, 36, 226, 59, 227, 24, 254, 203, 15,
- 19, 255, 36, 245, 94, 227, 23, 19, 255, 36, 236, 201, 227, 23, 19, 255,
- 36, 226, 225, 227, 23, 19, 255, 36, 226, 225, 226, 207, 19, 255, 36, 226,
- 59, 247, 63, 19, 255, 36, 226, 59, 247, 64, 254, 203, 15, 19, 255, 36,
- 245, 94, 247, 63, 19, 255, 36, 226, 225, 247, 63, 19, 255, 36, 226, 225,
- 168, 244, 135, 19, 255, 36, 226, 225, 152, 244, 135, 19, 255, 36, 247,
- 209, 247, 37, 244, 135, 19, 255, 36, 226, 59, 247, 37, 244, 135, 19, 255,
- 36, 226, 225, 247, 37, 244, 135, 19, 255, 36, 252, 1, 247, 37, 244, 135,
- 19, 255, 36, 235, 219, 247, 37, 244, 135, 19, 255, 36, 226, 225, 168,
- 226, 194, 19, 255, 36, 226, 225, 247, 37, 226, 194, 19, 255, 36, 250, 50,
- 247, 37, 236, 106, 19, 255, 36, 228, 29, 247, 64, 236, 106, 19, 168, 132,
- 53, 19, 168, 132, 5, 254, 203, 15, 19, 135, 226, 212, 53, 19, 152, 232,
- 75, 53, 19, 223, 226, 53, 19, 227, 81, 53, 19, 248, 122, 53, 19, 234, 95,
- 53, 19, 135, 234, 94, 53, 19, 152, 234, 94, 53, 19, 246, 243, 234, 94,
- 53, 19, 247, 37, 234, 94, 53, 19, 236, 196, 53, 19, 238, 55, 253, 25, 53,
- 19, 237, 156, 53, 19, 234, 11, 53, 19, 224, 66, 53, 19, 254, 89, 53, 19,
- 254, 100, 53, 19, 245, 242, 53, 19, 226, 47, 253, 25, 53, 19, 223, 90,
- 53, 231, 115, 229, 156, 53, 231, 115, 225, 135, 53, 231, 115, 229, 178,
- 53, 231, 115, 229, 154, 53, 231, 115, 249, 217, 229, 154, 53, 231, 115,
- 228, 251, 53, 231, 115, 250, 46, 53, 231, 115, 232, 64, 53, 231, 115,
- 229, 166, 53, 231, 115, 248, 89, 53, 231, 115, 254, 87, 53, 231, 115,
- 251, 215, 53, 233, 94, 249, 198, 5, 233, 145, 233, 94, 249, 198, 5, 233,
- 11, 245, 118, 233, 94, 249, 198, 5, 227, 65, 245, 118, 233, 94, 249, 198,
- 5, 252, 12, 233, 94, 249, 198, 5, 251, 163, 233, 94, 249, 198, 5, 224,
- 101, 233, 94, 249, 198, 5, 245, 102, 233, 94, 249, 198, 5, 246, 150, 233,
- 94, 249, 198, 5, 226, 174, 233, 94, 249, 198, 5, 58, 233, 94, 249, 198,
- 5, 252, 121, 233, 94, 249, 198, 5, 229, 87, 233, 94, 249, 198, 5, 251,
- 73, 233, 94, 249, 198, 5, 237, 34, 233, 94, 249, 198, 5, 236, 255, 233,
- 94, 249, 198, 5, 230, 237, 233, 94, 249, 198, 5, 237, 190, 233, 94, 249,
- 198, 5, 252, 130, 233, 94, 249, 198, 5, 252, 4, 233, 18, 233, 94, 249,
- 198, 5, 249, 151, 233, 94, 249, 198, 5, 251, 58, 233, 94, 249, 198, 5,
- 228, 190, 233, 94, 249, 198, 5, 251, 59, 233, 94, 249, 198, 5, 252, 229,
- 233, 94, 249, 198, 5, 229, 76, 233, 94, 249, 198, 5, 244, 160, 233, 94,
- 249, 198, 5, 245, 74, 233, 94, 249, 198, 5, 252, 82, 237, 229, 233, 94,
- 249, 198, 5, 252, 0, 233, 94, 249, 198, 5, 232, 6, 233, 94, 249, 198, 5,
- 248, 53, 233, 94, 249, 198, 5, 248, 128, 233, 94, 249, 198, 5, 225, 243,
- 233, 94, 249, 198, 5, 252, 232, 233, 94, 249, 198, 5, 233, 19, 226, 86,
- 233, 94, 249, 198, 5, 224, 218, 233, 94, 249, 198, 5, 233, 195, 233, 94,
- 249, 198, 5, 231, 109, 233, 94, 249, 198, 5, 237, 179, 233, 94, 249, 198,
- 5, 233, 254, 253, 66, 233, 94, 249, 198, 5, 247, 11, 233, 94, 249, 198,
- 5, 245, 238, 233, 94, 249, 198, 5, 228, 30, 233, 94, 249, 198, 5, 3, 254,
- 35, 233, 94, 249, 198, 5, 224, 146, 253, 41, 233, 94, 249, 198, 5, 36,
- 234, 97, 82, 237, 79, 1, 57, 237, 79, 1, 72, 237, 79, 1, 254, 27, 237,
- 79, 1, 252, 191, 237, 79, 1, 214, 237, 79, 1, 222, 222, 237, 79, 1, 74,
- 237, 79, 1, 224, 174, 237, 79, 1, 223, 119, 237, 79, 1, 226, 253, 237,
- 79, 1, 239, 182, 237, 79, 1, 239, 76, 237, 79, 1, 232, 139, 237, 79, 1,
- 149, 237, 79, 1, 185, 237, 79, 1, 199, 237, 79, 1, 236, 107, 237, 79, 1,
- 235, 19, 237, 79, 1, 66, 237, 79, 1, 233, 244, 237, 79, 1, 238, 168, 237,
- 79, 1, 146, 237, 79, 1, 193, 237, 79, 1, 227, 109, 237, 79, 1, 226, 22,
- 237, 79, 1, 254, 190, 237, 79, 1, 247, 239, 237, 79, 1, 212, 237, 79, 1,
- 224, 73, 252, 8, 1, 57, 252, 8, 1, 233, 243, 252, 8, 1, 222, 222, 252, 8,
- 1, 149, 252, 8, 1, 225, 75, 252, 8, 1, 146, 252, 8, 1, 237, 247, 252, 8,
- 1, 255, 65, 252, 8, 1, 232, 139, 252, 8, 1, 254, 27, 252, 8, 1, 185, 252,
- 8, 1, 73, 252, 8, 1, 250, 191, 252, 8, 1, 227, 109, 252, 8, 1, 229, 148,
- 252, 8, 1, 229, 147, 252, 8, 1, 193, 252, 8, 1, 252, 43, 252, 8, 1, 66,
- 252, 8, 1, 235, 19, 252, 8, 1, 224, 73, 252, 8, 1, 199, 252, 8, 1, 226,
- 21, 252, 8, 1, 233, 244, 252, 8, 1, 228, 111, 252, 8, 1, 74, 252, 8, 1,
- 72, 252, 8, 1, 225, 72, 252, 8, 1, 239, 76, 252, 8, 1, 239, 75, 252, 8,
- 1, 235, 190, 252, 8, 1, 225, 76, 252, 8, 1, 214, 252, 8, 1, 246, 195,
- 252, 8, 1, 228, 70, 252, 8, 1, 228, 69, 252, 8, 1, 235, 139, 252, 8, 1,
- 240, 47, 252, 8, 1, 252, 42, 252, 8, 1, 226, 22, 252, 8, 1, 225, 74, 252,
- 8, 1, 231, 100, 252, 8, 1, 236, 249, 252, 8, 1, 236, 248, 252, 8, 1, 236,
- 247, 252, 8, 1, 236, 246, 252, 8, 1, 237, 246, 252, 8, 1, 248, 57, 252,
- 8, 1, 225, 73, 84, 27, 1, 57, 84, 27, 1, 252, 238, 84, 27, 1, 239, 3, 84,
- 27, 1, 250, 77, 84, 27, 1, 72, 84, 27, 1, 225, 42, 84, 27, 1, 223, 97,
- 84, 27, 1, 245, 121, 84, 27, 1, 226, 239, 84, 27, 1, 74, 84, 27, 1, 177,
- 84, 27, 1, 248, 2, 84, 27, 1, 247, 247, 84, 27, 1, 247, 239, 84, 27, 1,
- 247, 183, 84, 27, 1, 73, 84, 27, 1, 233, 151, 84, 27, 1, 229, 114, 84,
- 27, 1, 238, 107, 84, 27, 1, 247, 198, 84, 27, 1, 247, 188, 84, 27, 1,
- 227, 44, 84, 27, 1, 66, 84, 27, 1, 248, 5, 84, 27, 1, 233, 90, 84, 27, 1,
- 238, 217, 84, 27, 1, 248, 29, 84, 27, 1, 247, 190, 84, 27, 1, 251, 182,
- 84, 27, 1, 240, 47, 84, 27, 1, 225, 76, 84, 27, 207, 118, 84, 27, 207,
- 173, 84, 27, 207, 227, 23, 84, 27, 207, 247, 63, 245, 250, 1, 255, 0,
- 245, 250, 1, 253, 53, 245, 250, 1, 246, 43, 245, 250, 1, 250, 173, 245,
- 250, 1, 254, 252, 245, 250, 1, 232, 129, 245, 250, 1, 239, 191, 245, 250,
- 1, 245, 161, 245, 250, 1, 226, 203, 245, 250, 1, 248, 11, 245, 250, 1,
- 238, 85, 245, 250, 1, 238, 27, 245, 250, 1, 237, 31, 245, 250, 1, 235,
- 221, 245, 250, 1, 239, 164, 245, 250, 1, 225, 90, 245, 250, 1, 233, 231,
- 245, 250, 1, 235, 57, 245, 250, 1, 232, 12, 245, 250, 1, 230, 238, 245,
- 250, 1, 227, 31, 245, 250, 1, 224, 108, 245, 250, 1, 247, 115, 245, 250,
- 1, 240, 51, 245, 250, 1, 244, 126, 245, 250, 1, 234, 18, 245, 250, 1,
- 235, 61, 244, 135, 225, 156, 1, 254, 209, 225, 156, 1, 252, 198, 225,
- 156, 1, 246, 170, 225, 156, 1, 238, 227, 225, 156, 1, 250, 47, 225, 156,
- 1, 244, 227, 225, 156, 1, 224, 105, 225, 156, 1, 223, 88, 225, 156, 1,
- 244, 156, 225, 156, 1, 227, 10, 225, 156, 1, 223, 175, 225, 156, 1, 239,
- 59, 225, 156, 1, 229, 78, 225, 156, 1, 238, 16, 225, 156, 1, 236, 215,
- 225, 156, 1, 250, 20, 225, 156, 1, 234, 194, 225, 156, 1, 223, 19, 225,
- 156, 1, 231, 1, 225, 156, 1, 254, 248, 225, 156, 1, 232, 173, 225, 156,
- 1, 231, 23, 225, 156, 1, 232, 88, 225, 156, 1, 231, 255, 225, 156, 1,
- 226, 242, 225, 156, 1, 246, 63, 225, 156, 1, 96, 225, 156, 1, 74, 225,
- 156, 1, 66, 225, 156, 1, 228, 80, 225, 156, 224, 92, 249, 184, 84, 233,
- 113, 5, 57, 84, 233, 113, 5, 74, 84, 233, 113, 5, 66, 84, 233, 113, 5,
- 177, 84, 233, 113, 5, 238, 107, 84, 233, 113, 5, 246, 193, 84, 233, 113,
- 5, 245, 218, 84, 233, 113, 5, 224, 72, 84, 233, 113, 5, 252, 39, 84, 233,
- 113, 5, 239, 179, 84, 233, 113, 5, 239, 156, 84, 233, 113, 5, 227, 107,
- 84, 233, 113, 5, 225, 250, 84, 233, 113, 5, 250, 189, 84, 233, 113, 5,
- 250, 4, 84, 233, 113, 5, 248, 107, 84, 233, 113, 5, 226, 251, 84, 233,
- 113, 5, 213, 84, 233, 113, 5, 253, 70, 84, 233, 113, 5, 247, 129, 84,
- 233, 113, 5, 236, 1, 84, 233, 113, 5, 234, 206, 84, 233, 113, 5, 198, 84,
- 233, 113, 5, 236, 157, 84, 233, 113, 5, 236, 66, 84, 233, 113, 5, 191,
- 84, 233, 113, 5, 225, 64, 84, 233, 113, 5, 224, 228, 84, 233, 113, 5,
- 208, 84, 233, 113, 5, 231, 70, 84, 233, 113, 5, 238, 43, 84, 233, 113, 5,
- 231, 31, 84, 233, 113, 5, 223, 117, 84, 233, 113, 5, 229, 146, 84, 233,
- 113, 5, 228, 110, 84, 233, 113, 5, 154, 84, 233, 113, 5, 254, 48, 84,
- 233, 113, 5, 254, 47, 84, 233, 113, 5, 254, 46, 84, 233, 113, 5, 224, 49,
- 84, 233, 113, 5, 250, 170, 84, 233, 113, 5, 250, 169, 84, 233, 113, 5,
- 253, 57, 84, 233, 113, 5, 252, 62, 84, 233, 113, 224, 92, 249, 184, 84,
- 233, 113, 65, 118, 84, 233, 113, 65, 113, 84, 233, 113, 65, 227, 23, 84,
- 233, 113, 65, 225, 216, 84, 233, 113, 65, 244, 135, 143, 6, 1, 182, 74,
- 143, 6, 1, 182, 72, 143, 6, 1, 182, 57, 143, 6, 1, 182, 255, 3, 143, 6,
- 1, 182, 73, 143, 6, 1, 182, 234, 52, 143, 6, 1, 229, 63, 74, 143, 6, 1,
- 229, 63, 72, 143, 6, 1, 229, 63, 57, 143, 6, 1, 229, 63, 255, 3, 143, 6,
- 1, 229, 63, 73, 143, 6, 1, 229, 63, 234, 52, 143, 6, 1, 254, 34, 143, 6,
- 1, 233, 255, 143, 6, 1, 224, 83, 143, 6, 1, 223, 225, 143, 6, 1, 212,
- 143, 6, 1, 233, 144, 143, 6, 1, 252, 232, 143, 6, 1, 227, 37, 143, 6, 1,
- 250, 67, 143, 6, 1, 251, 179, 143, 6, 1, 239, 169, 143, 6, 1, 239, 10,
- 143, 6, 1, 246, 148, 143, 6, 1, 248, 29, 143, 6, 1, 225, 38, 143, 6, 1,
- 247, 168, 143, 6, 1, 226, 238, 143, 6, 1, 247, 188, 143, 6, 1, 223, 95,
- 143, 6, 1, 247, 183, 143, 6, 1, 223, 76, 143, 6, 1, 247, 198, 143, 6, 1,
- 248, 2, 143, 6, 1, 247, 247, 143, 6, 1, 247, 239, 143, 6, 1, 247, 228,
- 143, 6, 1, 234, 80, 143, 6, 1, 247, 155, 143, 3, 1, 182, 74, 143, 3, 1,
- 182, 72, 143, 3, 1, 182, 57, 143, 3, 1, 182, 255, 3, 143, 3, 1, 182, 73,
- 143, 3, 1, 182, 234, 52, 143, 3, 1, 229, 63, 74, 143, 3, 1, 229, 63, 72,
- 143, 3, 1, 229, 63, 57, 143, 3, 1, 229, 63, 255, 3, 143, 3, 1, 229, 63,
- 73, 143, 3, 1, 229, 63, 234, 52, 143, 3, 1, 254, 34, 143, 3, 1, 233, 255,
- 143, 3, 1, 224, 83, 143, 3, 1, 223, 225, 143, 3, 1, 212, 143, 3, 1, 233,
- 144, 143, 3, 1, 252, 232, 143, 3, 1, 227, 37, 143, 3, 1, 250, 67, 143, 3,
- 1, 251, 179, 143, 3, 1, 239, 169, 143, 3, 1, 239, 10, 143, 3, 1, 246,
- 148, 143, 3, 1, 248, 29, 143, 3, 1, 225, 38, 143, 3, 1, 247, 168, 143, 3,
- 1, 226, 238, 143, 3, 1, 247, 188, 143, 3, 1, 223, 95, 143, 3, 1, 247,
- 183, 143, 3, 1, 223, 76, 143, 3, 1, 247, 198, 143, 3, 1, 248, 2, 143, 3,
- 1, 247, 247, 143, 3, 1, 247, 239, 143, 3, 1, 247, 228, 143, 3, 1, 234,
- 80, 143, 3, 1, 247, 155, 229, 119, 1, 233, 143, 229, 119, 1, 226, 99,
- 229, 119, 1, 238, 198, 229, 119, 1, 247, 92, 229, 119, 1, 226, 217, 229,
- 119, 1, 228, 169, 229, 119, 1, 227, 210, 229, 119, 1, 251, 128, 229, 119,
- 1, 223, 227, 229, 119, 1, 244, 134, 229, 119, 1, 252, 180, 229, 119, 1,
- 250, 76, 229, 119, 1, 246, 179, 229, 119, 1, 224, 194, 229, 119, 1, 226,
- 221, 229, 119, 1, 223, 25, 229, 119, 1, 236, 233, 229, 119, 1, 239, 99,
- 229, 119, 1, 224, 103, 229, 119, 1, 245, 169, 229, 119, 1, 237, 135, 229,
- 119, 1, 236, 126, 229, 119, 1, 240, 54, 229, 119, 1, 248, 28, 229, 119,
- 1, 254, 80, 229, 119, 1, 255, 22, 229, 119, 1, 234, 61, 229, 119, 1, 224,
- 95, 229, 119, 1, 234, 10, 229, 119, 1, 255, 3, 229, 119, 1, 231, 119,
- 229, 119, 1, 234, 194, 229, 119, 1, 248, 42, 229, 119, 1, 255, 6, 229,
- 119, 1, 244, 69, 229, 119, 1, 225, 116, 229, 119, 1, 234, 103, 229, 119,
- 1, 234, 46, 229, 119, 1, 234, 79, 229, 119, 1, 254, 37, 229, 119, 1, 254,
- 117, 229, 119, 1, 234, 31, 229, 119, 1, 254, 245, 229, 119, 1, 247, 192,
- 229, 119, 1, 254, 97, 229, 119, 1, 248, 51, 229, 119, 1, 244, 73, 229,
- 119, 1, 223, 207, 234, 20, 1, 254, 227, 234, 20, 1, 253, 70, 234, 20, 1,
- 227, 107, 234, 20, 1, 239, 179, 234, 20, 1, 224, 72, 234, 20, 1, 238,
- 227, 234, 20, 1, 250, 66, 234, 20, 1, 208, 234, 20, 1, 231, 31, 234, 20,
- 1, 229, 84, 234, 20, 1, 250, 22, 234, 20, 1, 251, 248, 234, 20, 1, 246,
- 193, 234, 20, 1, 247, 129, 234, 20, 1, 232, 136, 234, 20, 1, 239, 71,
- 234, 20, 1, 238, 39, 234, 20, 1, 236, 136, 234, 20, 1, 234, 181, 234, 20,
- 1, 224, 144, 234, 20, 1, 154, 234, 20, 1, 191, 234, 20, 1, 57, 234, 20,
- 1, 72, 234, 20, 1, 74, 234, 20, 1, 73, 234, 20, 1, 66, 234, 20, 1, 255,
- 63, 234, 20, 1, 248, 35, 234, 20, 1, 234, 52, 234, 20, 21, 223, 89, 234,
- 20, 21, 118, 234, 20, 21, 113, 234, 20, 21, 166, 234, 20, 21, 158, 234,
- 20, 21, 173, 234, 20, 21, 183, 234, 20, 21, 194, 234, 20, 21, 187, 234,
- 20, 21, 192, 218, 4, 57, 218, 4, 72, 218, 4, 74, 218, 4, 73, 218, 4, 66,
- 218, 4, 239, 179, 218, 4, 239, 117, 218, 4, 177, 218, 4, 239, 3, 218, 4,
- 238, 199, 218, 4, 238, 150, 218, 4, 238, 107, 218, 4, 238, 43, 218, 4,
- 237, 243, 218, 4, 237, 193, 218, 4, 237, 143, 218, 4, 237, 110, 218, 4,
- 198, 218, 4, 236, 235, 218, 4, 236, 157, 218, 4, 236, 103, 218, 4, 236,
- 66, 218, 4, 236, 1, 218, 4, 235, 162, 218, 4, 235, 89, 218, 4, 235, 6,
- 218, 4, 234, 206, 218, 4, 213, 218, 4, 233, 151, 218, 4, 233, 69, 218, 4,
- 233, 4, 218, 4, 232, 173, 218, 4, 208, 218, 4, 231, 244, 218, 4, 231,
- 180, 218, 4, 231, 122, 218, 4, 231, 70, 218, 4, 231, 31, 218, 4, 230,
- 213, 218, 4, 229, 15, 218, 4, 228, 169, 218, 4, 228, 6, 218, 4, 227, 107,
- 218, 4, 227, 44, 218, 4, 226, 175, 218, 4, 96, 218, 4, 225, 250, 218, 4,
- 224, 173, 218, 4, 224, 141, 218, 4, 224, 118, 218, 4, 224, 105, 218, 4,
- 224, 72, 218, 4, 224, 69, 218, 4, 223, 117, 218, 4, 223, 27, 233, 77, 1,
- 254, 223, 233, 77, 1, 252, 200, 233, 77, 1, 246, 171, 233, 77, 1, 250,
- 49, 233, 77, 1, 245, 121, 233, 77, 1, 224, 149, 233, 77, 1, 223, 112,
- 233, 77, 1, 245, 90, 233, 77, 1, 227, 10, 233, 77, 1, 223, 175, 233, 77,
- 1, 239, 59, 233, 77, 1, 238, 17, 233, 77, 1, 236, 215, 233, 77, 1, 234,
- 194, 233, 77, 1, 229, 180, 233, 77, 1, 254, 248, 233, 77, 1, 233, 151,
- 233, 77, 1, 231, 23, 233, 77, 1, 232, 92, 233, 77, 1, 231, 108, 233, 77,
- 1, 229, 78, 233, 77, 1, 227, 61, 233, 77, 65, 118, 233, 77, 65, 227, 23,
- 233, 77, 65, 225, 216, 233, 77, 65, 168, 244, 135, 233, 77, 224, 92, 229,
- 173, 237, 78, 1, 57, 237, 78, 1, 254, 27, 237, 78, 1, 214, 237, 78, 1,
- 222, 222, 237, 78, 1, 72, 237, 78, 1, 196, 237, 78, 1, 74, 237, 78, 1,
- 224, 25, 237, 78, 1, 239, 76, 237, 78, 1, 149, 237, 78, 1, 185, 237, 78,
- 1, 199, 237, 78, 1, 73, 237, 78, 1, 146, 237, 78, 1, 228, 111, 237, 78,
- 1, 227, 109, 237, 78, 1, 66, 237, 78, 1, 247, 130, 237, 78, 1, 232, 139,
- 237, 78, 1, 193, 237, 78, 1, 226, 22, 237, 78, 1, 254, 190, 237, 78, 1,
- 247, 239, 237, 78, 1, 237, 80, 237, 78, 1, 235, 19, 237, 78, 1, 252, 44,
- 237, 78, 226, 75, 76, 178, 1, 57, 178, 31, 5, 74, 178, 31, 5, 66, 178,
- 31, 5, 153, 146, 178, 31, 5, 72, 178, 31, 5, 73, 178, 31, 237, 219, 76,
- 178, 5, 47, 231, 140, 51, 178, 5, 254, 160, 178, 5, 224, 211, 178, 1,
- 177, 178, 1, 238, 227, 178, 1, 246, 193, 178, 1, 246, 66, 178, 1, 252,
- 39, 178, 1, 251, 204, 178, 1, 239, 179, 178, 1, 234, 173, 178, 1, 226,
- 20, 178, 1, 226, 10, 178, 1, 250, 117, 178, 1, 250, 101, 178, 1, 235, 18,
- 178, 1, 227, 107, 178, 1, 226, 251, 178, 1, 250, 189, 178, 1, 250, 22,
- 178, 1, 236, 1, 178, 1, 213, 178, 1, 233, 97, 178, 1, 253, 70, 178, 1,
- 252, 190, 178, 1, 198, 178, 1, 191, 178, 1, 208, 178, 1, 238, 43, 178, 1,
- 225, 64, 178, 1, 229, 146, 178, 1, 228, 110, 178, 1, 231, 31, 178, 1,
- 223, 117, 178, 1, 154, 178, 1, 238, 167, 178, 1, 225, 254, 178, 5, 253,
- 36, 46, 178, 5, 251, 254, 178, 5, 56, 51, 178, 224, 216, 178, 21, 118,
- 178, 21, 113, 178, 21, 166, 178, 21, 158, 178, 65, 227, 23, 178, 65, 225,
- 216, 178, 65, 168, 244, 135, 178, 65, 168, 226, 194, 178, 232, 171, 249,
- 140, 178, 232, 171, 3, 251, 106, 178, 232, 171, 251, 106, 178, 232, 171,
- 250, 248, 125, 178, 232, 171, 237, 32, 178, 232, 171, 237, 119, 178, 232,
- 171, 250, 151, 178, 232, 171, 47, 250, 151, 178, 232, 171, 237, 165, 13,
- 5, 57, 13, 5, 102, 24, 57, 13, 5, 102, 24, 253, 61, 13, 5, 102, 24, 246,
- 167, 227, 19, 13, 5, 102, 24, 154, 13, 5, 102, 24, 240, 49, 13, 5, 102,
- 24, 238, 30, 245, 204, 13, 5, 102, 24, 236, 32, 13, 5, 102, 24, 231, 19,
- 13, 5, 255, 65, 13, 5, 255, 52, 13, 5, 255, 53, 24, 254, 78, 13, 5, 255,
- 53, 24, 248, 96, 245, 204, 13, 5, 255, 53, 24, 246, 177, 13, 5, 255, 53,
- 24, 246, 167, 227, 19, 13, 5, 255, 53, 24, 154, 13, 5, 255, 53, 24, 240,
- 50, 245, 204, 13, 5, 255, 53, 24, 240, 23, 13, 5, 255, 53, 24, 238, 31,
- 13, 5, 255, 53, 24, 229, 99, 13, 5, 255, 53, 24, 97, 79, 97, 79, 66, 13,
- 5, 255, 53, 245, 204, 13, 5, 255, 50, 13, 5, 255, 51, 24, 253, 50, 13, 5,
- 255, 51, 24, 246, 167, 227, 19, 13, 5, 255, 51, 24, 236, 236, 79, 247,
- 239, 13, 5, 255, 51, 24, 229, 144, 13, 5, 255, 51, 24, 227, 84, 13, 5,
- 255, 29, 13, 5, 254, 240, 13, 5, 254, 241, 24, 247, 193, 13, 5, 254, 241,
- 24, 229, 73, 79, 246, 24, 13, 5, 254, 233, 13, 5, 254, 234, 24, 254, 233,
- 13, 5, 254, 234, 24, 249, 220, 13, 5, 254, 234, 24, 246, 24, 13, 5, 254,
- 234, 24, 154, 13, 5, 254, 234, 24, 239, 64, 13, 5, 254, 234, 24, 238,
- 199, 13, 5, 254, 234, 24, 229, 114, 13, 5, 254, 234, 24, 225, 83, 13, 5,
- 254, 231, 13, 5, 254, 225, 13, 5, 254, 196, 13, 5, 254, 197, 24, 229,
- 114, 13, 5, 254, 190, 13, 5, 254, 191, 107, 254, 190, 13, 5, 254, 191,
- 152, 226, 156, 13, 5, 254, 191, 79, 235, 247, 234, 35, 254, 191, 79, 235,
- 246, 13, 5, 254, 191, 79, 235, 247, 228, 118, 13, 5, 254, 170, 13, 5,
- 254, 153, 13, 5, 254, 129, 13, 5, 254, 130, 24, 238, 91, 13, 5, 254, 108,
- 13, 5, 254, 85, 13, 5, 254, 80, 13, 5, 254, 81, 223, 43, 227, 19, 13, 5,
- 254, 81, 239, 67, 227, 19, 13, 5, 254, 81, 107, 254, 81, 225, 248, 107,
- 225, 248, 225, 248, 107, 225, 248, 233, 197, 13, 5, 254, 81, 107, 254,
- 81, 107, 254, 80, 13, 5, 254, 81, 107, 254, 81, 107, 254, 81, 250, 238,
- 254, 81, 107, 254, 81, 107, 254, 80, 13, 5, 254, 78, 13, 5, 254, 76, 13,
- 5, 253, 70, 13, 5, 253, 61, 13, 5, 253, 58, 13, 5, 253, 56, 13, 5, 253,
- 51, 13, 5, 253, 52, 107, 253, 51, 13, 5, 253, 50, 13, 5, 125, 13, 5, 253,
- 35, 13, 5, 252, 181, 13, 5, 252, 182, 24, 57, 13, 5, 252, 182, 24, 246,
- 160, 13, 5, 252, 182, 24, 240, 50, 245, 204, 13, 5, 252, 90, 13, 5, 252,
- 91, 107, 252, 91, 255, 52, 13, 5, 252, 91, 107, 252, 91, 225, 138, 13, 5,
- 252, 91, 250, 238, 252, 90, 13, 5, 252, 79, 13, 5, 252, 80, 107, 252, 79,
- 13, 5, 252, 70, 13, 5, 252, 69, 13, 5, 250, 189, 13, 5, 250, 180, 13, 5,
- 250, 181, 238, 178, 24, 102, 79, 237, 7, 13, 5, 250, 181, 238, 178, 24,
- 254, 196, 13, 5, 250, 181, 238, 178, 24, 253, 50, 13, 5, 250, 181, 238,
- 178, 24, 252, 181, 13, 5, 250, 181, 238, 178, 24, 246, 193, 13, 5, 250,
- 181, 238, 178, 24, 246, 194, 79, 237, 7, 13, 5, 250, 181, 238, 178, 24,
- 246, 46, 13, 5, 250, 181, 238, 178, 24, 246, 30, 13, 5, 250, 181, 238,
- 178, 24, 245, 212, 13, 5, 250, 181, 238, 178, 24, 154, 13, 5, 250, 181,
- 238, 178, 24, 239, 210, 13, 5, 250, 181, 238, 178, 24, 239, 211, 79, 237,
- 110, 13, 5, 250, 181, 238, 178, 24, 239, 53, 13, 5, 250, 181, 238, 178,
- 24, 238, 43, 13, 5, 250, 181, 238, 178, 24, 237, 110, 13, 5, 250, 181,
- 238, 178, 24, 237, 111, 79, 237, 6, 13, 5, 250, 181, 238, 178, 24, 237,
- 100, 13, 5, 250, 181, 238, 178, 24, 235, 162, 13, 5, 250, 181, 238, 178,
- 24, 233, 198, 79, 233, 197, 13, 5, 250, 181, 238, 178, 24, 229, 15, 13,
- 5, 250, 181, 238, 178, 24, 227, 84, 13, 5, 250, 181, 238, 178, 24, 225,
- 172, 79, 246, 30, 13, 5, 250, 181, 238, 178, 24, 225, 83, 13, 5, 250,
- 159, 13, 5, 250, 140, 13, 5, 250, 139, 13, 5, 250, 138, 13, 5, 250, 4,
- 13, 5, 249, 245, 13, 5, 249, 221, 13, 5, 249, 222, 24, 229, 114, 13, 5,
- 249, 220, 13, 5, 249, 210, 13, 5, 249, 211, 239, 26, 97, 245, 205, 249,
- 195, 13, 5, 249, 195, 13, 5, 248, 107, 13, 5, 248, 108, 107, 248, 107,
- 13, 5, 248, 108, 245, 204, 13, 5, 248, 108, 229, 96, 13, 5, 248, 105, 13,
- 5, 248, 106, 24, 247, 180, 13, 5, 248, 104, 13, 5, 248, 103, 13, 5, 248,
- 102, 13, 5, 248, 101, 13, 5, 248, 97, 13, 5, 248, 95, 13, 5, 248, 96,
- 245, 204, 13, 5, 248, 96, 245, 205, 245, 204, 13, 5, 248, 94, 13, 5, 248,
- 87, 13, 5, 72, 13, 5, 161, 24, 233, 197, 13, 5, 161, 107, 161, 234, 195,
- 107, 234, 194, 13, 5, 248, 57, 13, 5, 248, 58, 24, 102, 79, 245, 170, 79,
- 250, 189, 13, 5, 248, 58, 24, 246, 160, 13, 5, 248, 58, 24, 236, 157, 13,
- 5, 248, 58, 24, 231, 12, 13, 5, 248, 58, 24, 229, 114, 13, 5, 248, 58,
- 24, 66, 13, 5, 248, 37, 13, 5, 248, 27, 13, 5, 248, 2, 13, 5, 247, 239,
- 13, 5, 247, 240, 24, 246, 166, 13, 5, 247, 240, 24, 246, 167, 227, 19,
- 13, 5, 247, 240, 24, 236, 235, 13, 5, 247, 240, 250, 238, 247, 239, 13,
- 5, 247, 240, 234, 35, 247, 239, 13, 5, 247, 240, 228, 118, 13, 5, 247,
- 195, 13, 5, 247, 193, 13, 5, 247, 180, 13, 5, 247, 134, 13, 5, 247, 135,
- 24, 57, 13, 5, 247, 135, 24, 102, 79, 238, 21, 13, 5, 247, 135, 24, 102,
- 79, 238, 22, 24, 238, 21, 13, 5, 247, 135, 24, 254, 190, 13, 5, 247, 135,
- 24, 253, 61, 13, 5, 247, 135, 24, 248, 96, 245, 204, 13, 5, 247, 135, 24,
- 248, 96, 245, 205, 245, 204, 13, 5, 247, 135, 24, 154, 13, 5, 247, 135,
- 24, 245, 170, 245, 204, 13, 5, 247, 135, 24, 240, 50, 245, 204, 13, 5,
- 247, 135, 24, 239, 25, 13, 5, 247, 135, 24, 239, 26, 228, 118, 13, 5,
- 247, 135, 24, 238, 105, 13, 5, 247, 135, 24, 238, 43, 13, 5, 247, 135,
- 24, 238, 22, 24, 238, 21, 13, 5, 247, 135, 24, 237, 193, 13, 5, 247, 135,
- 24, 237, 110, 13, 5, 247, 135, 24, 225, 171, 13, 5, 247, 135, 24, 225,
- 163, 13, 5, 246, 193, 13, 5, 246, 194, 245, 204, 13, 5, 246, 191, 13, 5,
- 246, 192, 24, 102, 79, 250, 190, 79, 154, 13, 5, 246, 192, 24, 102, 79,
- 154, 13, 5, 246, 192, 24, 102, 79, 240, 49, 13, 5, 246, 192, 24, 255, 51,
- 227, 20, 79, 227, 100, 13, 5, 246, 192, 24, 254, 190, 13, 5, 246, 192,
- 24, 254, 80, 13, 5, 246, 192, 24, 254, 79, 79, 246, 177, 13, 5, 246, 192,
- 24, 253, 61, 13, 5, 246, 192, 24, 253, 36, 79, 208, 13, 5, 246, 192, 24,
- 252, 70, 13, 5, 246, 192, 24, 252, 71, 79, 208, 13, 5, 246, 192, 24, 250,
- 189, 13, 5, 246, 192, 24, 250, 4, 13, 5, 246, 192, 24, 249, 222, 24, 229,
- 114, 13, 5, 246, 192, 24, 248, 105, 13, 5, 246, 192, 24, 248, 2, 13, 5,
- 246, 192, 24, 248, 3, 79, 238, 43, 13, 5, 246, 192, 24, 247, 239, 13, 5,
- 246, 192, 24, 247, 240, 24, 246, 167, 227, 19, 13, 5, 246, 192, 24, 246,
- 167, 227, 19, 13, 5, 246, 192, 24, 246, 160, 13, 5, 246, 192, 24, 246,
- 46, 13, 5, 246, 192, 24, 246, 44, 13, 5, 246, 192, 24, 246, 45, 79, 57,
- 13, 5, 246, 192, 24, 246, 31, 79, 228, 6, 13, 5, 246, 192, 24, 245, 170,
- 79, 237, 111, 79, 247, 180, 13, 5, 246, 192, 24, 245, 154, 13, 5, 246,
- 192, 24, 245, 155, 79, 238, 43, 13, 5, 246, 192, 24, 245, 76, 79, 237,
- 193, 13, 5, 246, 192, 24, 244, 142, 13, 5, 246, 192, 24, 240, 50, 245,
- 204, 13, 5, 246, 192, 24, 239, 201, 79, 244, 146, 79, 254, 80, 13, 5,
- 246, 192, 24, 239, 53, 13, 5, 246, 192, 24, 239, 25, 13, 5, 246, 192, 24,
- 238, 196, 13, 5, 246, 192, 24, 238, 197, 79, 238, 21, 13, 5, 246, 192,
- 24, 238, 106, 79, 254, 190, 13, 5, 246, 192, 24, 238, 43, 13, 5, 246,
- 192, 24, 236, 236, 79, 247, 239, 13, 5, 246, 192, 24, 236, 157, 13, 5,
- 246, 192, 24, 234, 194, 13, 5, 246, 192, 24, 234, 195, 107, 234, 194, 13,
- 5, 246, 192, 24, 213, 13, 5, 246, 192, 24, 231, 12, 13, 5, 246, 192, 24,
- 230, 244, 13, 5, 246, 192, 24, 229, 114, 13, 5, 246, 192, 24, 229, 115,
- 79, 225, 236, 13, 5, 246, 192, 24, 229, 88, 13, 5, 246, 192, 24, 227,
- 233, 13, 5, 246, 192, 24, 227, 84, 13, 5, 246, 192, 24, 66, 13, 5, 246,
- 192, 24, 225, 163, 13, 5, 246, 192, 24, 225, 164, 79, 248, 107, 13, 5,
- 246, 192, 107, 246, 191, 13, 5, 246, 186, 13, 5, 246, 187, 250, 238, 246,
- 186, 13, 5, 246, 184, 13, 5, 246, 185, 107, 246, 185, 246, 161, 107, 246,
- 160, 13, 5, 246, 177, 13, 5, 246, 178, 246, 185, 107, 246, 185, 246, 161,
- 107, 246, 160, 13, 5, 246, 176, 13, 5, 246, 174, 13, 5, 246, 168, 13, 5,
- 246, 166, 13, 5, 246, 167, 227, 19, 13, 5, 246, 167, 107, 246, 166, 13,
- 5, 246, 167, 250, 238, 246, 166, 13, 5, 246, 160, 13, 5, 246, 159, 13, 5,
- 246, 155, 13, 5, 246, 107, 13, 5, 246, 108, 24, 238, 91, 13, 5, 246, 46,
- 13, 5, 246, 47, 24, 72, 13, 5, 246, 47, 24, 66, 13, 5, 246, 47, 250, 238,
- 246, 46, 13, 5, 246, 44, 13, 5, 246, 45, 107, 246, 44, 13, 5, 246, 45,
- 250, 238, 246, 44, 13, 5, 246, 42, 13, 5, 246, 30, 13, 5, 246, 31, 245,
- 204, 13, 5, 246, 28, 13, 5, 246, 29, 24, 102, 79, 240, 49, 13, 5, 246,
- 29, 24, 246, 167, 227, 19, 13, 5, 246, 29, 24, 240, 49, 13, 5, 246, 29,
- 24, 237, 111, 79, 240, 49, 13, 5, 246, 29, 24, 213, 13, 5, 246, 26, 13,
- 5, 246, 24, 13, 5, 246, 25, 250, 238, 246, 24, 13, 5, 246, 25, 24, 253,
- 61, 13, 5, 246, 25, 24, 227, 84, 13, 5, 246, 25, 227, 19, 13, 5, 245,
- 218, 13, 5, 245, 219, 250, 238, 245, 218, 13, 5, 245, 216, 13, 5, 245,
- 217, 24, 239, 53, 13, 5, 245, 217, 24, 239, 54, 24, 240, 50, 245, 204,
- 13, 5, 245, 217, 24, 234, 194, 13, 5, 245, 217, 24, 231, 13, 79, 225,
- 247, 13, 5, 245, 217, 245, 204, 13, 5, 245, 212, 13, 5, 245, 213, 24,
- 102, 79, 238, 91, 13, 5, 245, 213, 24, 238, 91, 13, 5, 245, 213, 107,
- 245, 213, 237, 105, 13, 5, 245, 208, 13, 5, 245, 206, 13, 5, 245, 207,
- 24, 229, 114, 13, 5, 245, 198, 13, 5, 245, 197, 13, 5, 245, 194, 13, 5,
- 245, 193, 13, 5, 154, 13, 5, 245, 170, 227, 19, 13, 5, 245, 170, 245,
- 204, 13, 5, 245, 154, 13, 5, 245, 75, 13, 5, 245, 76, 24, 254, 80, 13, 5,
- 245, 76, 24, 254, 78, 13, 5, 245, 76, 24, 253, 61, 13, 5, 245, 76, 24,
- 249, 195, 13, 5, 245, 76, 24, 246, 184, 13, 5, 245, 76, 24, 238, 190, 13,
- 5, 245, 76, 24, 234, 194, 13, 5, 245, 76, 24, 229, 114, 13, 5, 245, 76,
- 24, 66, 13, 5, 244, 145, 13, 5, 244, 142, 13, 5, 244, 143, 24, 254, 190,
- 13, 5, 244, 143, 24, 245, 154, 13, 5, 244, 143, 24, 239, 25, 13, 5, 244,
- 143, 24, 237, 158, 13, 5, 244, 143, 24, 225, 163, 13, 5, 244, 140, 13, 5,
- 74, 13, 5, 244, 81, 57, 13, 5, 244, 71, 13, 5, 240, 75, 13, 5, 240, 76,
- 107, 240, 76, 252, 70, 13, 5, 240, 76, 107, 240, 76, 228, 118, 13, 5,
- 240, 52, 13, 5, 240, 49, 13, 5, 240, 50, 249, 245, 13, 5, 240, 50, 231,
- 180, 13, 5, 240, 50, 107, 240, 50, 229, 75, 107, 229, 75, 225, 164, 107,
- 225, 163, 13, 5, 240, 50, 245, 204, 13, 5, 240, 41, 13, 5, 240, 42, 24,
- 246, 167, 227, 19, 13, 5, 240, 40, 13, 5, 240, 30, 13, 5, 240, 31, 24,
- 227, 84, 13, 5, 240, 31, 250, 238, 240, 30, 13, 5, 240, 31, 234, 35, 240,
- 30, 13, 5, 240, 31, 228, 118, 13, 5, 240, 23, 13, 5, 240, 16, 13, 5, 239,
- 210, 13, 5, 239, 200, 13, 5, 177, 13, 5, 188, 24, 57, 13, 5, 188, 24,
- 255, 29, 13, 5, 188, 24, 255, 30, 79, 238, 105, 13, 5, 188, 24, 254, 78,
- 13, 5, 188, 24, 253, 61, 13, 5, 188, 24, 253, 50, 13, 5, 188, 24, 125,
- 13, 5, 188, 24, 252, 181, 13, 5, 188, 24, 247, 193, 13, 5, 188, 24, 247,
- 180, 13, 5, 188, 24, 246, 193, 13, 5, 188, 24, 246, 177, 13, 5, 188, 24,
- 246, 167, 227, 19, 13, 5, 188, 24, 246, 160, 13, 5, 188, 24, 246, 161,
- 79, 229, 145, 79, 57, 13, 5, 188, 24, 246, 46, 13, 5, 188, 24, 246, 30,
- 13, 5, 188, 24, 246, 25, 79, 230, 244, 13, 5, 188, 24, 246, 25, 250, 238,
- 246, 24, 13, 5, 188, 24, 245, 218, 13, 5, 188, 24, 245, 197, 13, 5, 188,
- 24, 240, 49, 13, 5, 188, 24, 240, 30, 13, 5, 188, 24, 239, 53, 13, 5,
- 188, 24, 238, 199, 13, 5, 188, 24, 238, 196, 13, 5, 188, 24, 237, 193,
- 13, 5, 188, 24, 237, 110, 13, 5, 188, 24, 236, 235, 13, 5, 188, 24, 236,
- 236, 79, 248, 107, 13, 5, 188, 24, 236, 236, 79, 246, 46, 13, 5, 188, 24,
- 236, 236, 79, 227, 44, 13, 5, 188, 24, 236, 157, 13, 5, 188, 24, 236,
- 158, 79, 234, 190, 13, 5, 188, 24, 235, 162, 13, 5, 188, 24, 234, 194,
- 13, 5, 188, 24, 233, 69, 13, 5, 188, 24, 231, 70, 13, 5, 188, 24, 231,
- 31, 13, 5, 188, 24, 230, 244, 13, 5, 188, 24, 229, 146, 13, 5, 188, 24,
- 229, 114, 13, 5, 188, 24, 229, 88, 13, 5, 188, 24, 229, 43, 13, 5, 188,
- 24, 229, 7, 13, 5, 188, 24, 227, 240, 13, 5, 188, 24, 227, 67, 13, 5,
- 188, 24, 66, 13, 5, 188, 24, 225, 171, 13, 5, 188, 24, 225, 163, 13, 5,
- 188, 24, 225, 141, 24, 213, 13, 5, 188, 24, 225, 83, 13, 5, 188, 24, 223,
- 47, 13, 5, 239, 73, 13, 5, 239, 74, 250, 238, 239, 73, 13, 5, 239, 68,
- 13, 5, 239, 66, 13, 5, 239, 64, 13, 5, 239, 63, 13, 5, 239, 61, 13, 5,
- 239, 62, 107, 239, 61, 13, 5, 239, 53, 13, 5, 239, 54, 24, 240, 50, 245,
- 204, 13, 5, 239, 49, 13, 5, 239, 50, 24, 253, 61, 13, 5, 239, 50, 250,
- 238, 239, 49, 13, 5, 239, 48, 13, 5, 239, 47, 13, 5, 239, 25, 13, 5, 239,
- 26, 215, 24, 97, 107, 215, 24, 66, 13, 5, 239, 26, 107, 239, 26, 215, 24,
- 97, 107, 215, 24, 66, 13, 5, 238, 237, 13, 5, 238, 199, 13, 5, 238, 200,
- 24, 253, 61, 13, 5, 238, 200, 24, 66, 13, 5, 238, 200, 24, 225, 163, 13,
- 5, 238, 196, 13, 5, 238, 190, 13, 5, 238, 180, 13, 5, 238, 179, 13, 5,
- 238, 177, 13, 5, 238, 178, 107, 238, 177, 13, 5, 238, 107, 13, 5, 238,
- 108, 107, 245, 76, 24, 254, 79, 238, 108, 107, 245, 76, 24, 254, 78, 13,
- 5, 238, 105, 13, 5, 238, 103, 13, 5, 238, 104, 225, 54, 15, 13, 5, 238,
- 102, 13, 5, 238, 100, 13, 5, 238, 101, 245, 204, 13, 5, 238, 99, 13, 5,
- 238, 91, 13, 5, 238, 92, 234, 35, 238, 91, 13, 5, 238, 86, 13, 5, 238,
- 70, 13, 5, 238, 43, 13, 5, 238, 31, 13, 5, 215, 24, 57, 13, 5, 215, 24,
- 102, 79, 250, 190, 79, 154, 13, 5, 215, 24, 102, 79, 246, 160, 13, 5,
- 215, 24, 102, 79, 238, 21, 13, 5, 215, 24, 254, 233, 13, 5, 215, 24, 254,
- 190, 13, 5, 215, 24, 254, 81, 223, 43, 227, 19, 13, 5, 215, 24, 253, 61,
- 13, 5, 215, 24, 252, 181, 13, 5, 215, 24, 250, 140, 13, 5, 215, 24, 247,
- 239, 13, 5, 215, 24, 246, 193, 13, 5, 215, 24, 246, 160, 13, 5, 215, 24,
- 245, 212, 13, 5, 215, 24, 245, 213, 79, 245, 212, 13, 5, 215, 24, 154,
- 13, 5, 215, 24, 245, 154, 13, 5, 215, 24, 245, 76, 24, 234, 194, 13, 5,
- 215, 24, 240, 50, 245, 204, 13, 5, 215, 24, 240, 30, 13, 5, 215, 24, 240,
- 31, 79, 154, 13, 5, 215, 24, 240, 31, 79, 237, 110, 13, 5, 215, 24, 238,
- 199, 13, 5, 215, 24, 238, 190, 13, 5, 215, 24, 238, 105, 13, 5, 215, 24,
- 238, 100, 13, 5, 215, 24, 238, 101, 79, 245, 76, 79, 57, 13, 5, 215, 24,
- 238, 31, 13, 5, 215, 24, 237, 158, 13, 5, 215, 24, 237, 110, 13, 5, 215,
- 24, 237, 102, 13, 5, 215, 24, 236, 235, 13, 5, 215, 24, 236, 236, 79,
- 247, 239, 13, 5, 215, 24, 236, 32, 13, 5, 215, 24, 235, 162, 13, 5, 215,
- 24, 229, 115, 79, 227, 233, 13, 5, 215, 24, 229, 73, 79, 246, 25, 79,
- 247, 193, 13, 5, 215, 24, 229, 73, 79, 246, 25, 227, 19, 13, 5, 215, 24,
- 229, 41, 13, 5, 215, 24, 229, 42, 79, 229, 41, 13, 5, 215, 24, 227, 233,
- 13, 5, 215, 24, 227, 95, 13, 5, 215, 24, 227, 84, 13, 5, 215, 24, 227,
- 45, 79, 102, 79, 228, 7, 79, 236, 1, 13, 5, 215, 24, 66, 13, 5, 215, 24,
- 97, 79, 57, 13, 5, 215, 24, 97, 79, 97, 79, 66, 13, 5, 215, 24, 225, 172,
- 79, 254, 80, 13, 5, 215, 24, 225, 163, 13, 5, 215, 24, 225, 83, 13, 5,
- 215, 228, 118, 13, 5, 238, 29, 13, 5, 238, 30, 24, 229, 114, 13, 5, 238,
- 30, 24, 229, 115, 79, 227, 233, 13, 5, 238, 30, 245, 204, 13, 5, 238, 30,
- 245, 205, 107, 238, 30, 245, 205, 229, 114, 13, 5, 238, 26, 13, 5, 238,
- 21, 13, 5, 238, 22, 24, 238, 21, 13, 5, 238, 20, 13, 5, 216, 24, 238, 91,
- 13, 5, 216, 24, 238, 92, 79, 231, 70, 13, 5, 237, 193, 13, 5, 237, 181,
- 13, 5, 237, 173, 13, 5, 237, 158, 13, 5, 237, 110, 13, 5, 237, 111, 24,
- 253, 61, 13, 5, 237, 108, 13, 5, 237, 109, 24, 254, 233, 13, 5, 237, 109,
- 24, 253, 61, 13, 5, 237, 109, 24, 247, 180, 13, 5, 237, 109, 24, 247,
- 181, 227, 19, 13, 5, 237, 109, 24, 246, 167, 227, 19, 13, 5, 237, 109,
- 24, 245, 76, 24, 253, 61, 13, 5, 237, 109, 24, 240, 30, 13, 5, 237, 109,
- 24, 239, 66, 13, 5, 237, 109, 24, 239, 64, 13, 5, 237, 109, 24, 239, 65,
- 79, 254, 80, 13, 5, 237, 109, 24, 238, 199, 13, 5, 237, 109, 24, 238, 44,
- 79, 254, 80, 13, 5, 237, 109, 24, 238, 31, 13, 5, 237, 109, 24, 236, 236,
- 79, 247, 239, 13, 5, 237, 109, 24, 235, 162, 13, 5, 237, 109, 24, 234,
- 206, 13, 5, 237, 109, 24, 229, 16, 79, 254, 80, 13, 5, 237, 109, 24, 228,
- 255, 79, 252, 90, 13, 5, 237, 109, 24, 225, 247, 13, 5, 237, 109, 227,
- 19, 13, 5, 237, 109, 250, 238, 237, 108, 13, 5, 237, 109, 234, 35, 237,
- 108, 13, 5, 237, 109, 228, 118, 13, 5, 237, 109, 229, 96, 13, 5, 237,
- 107, 13, 5, 237, 105, 13, 5, 237, 106, 107, 237, 105, 13, 5, 237, 106,
- 234, 35, 237, 105, 13, 5, 237, 106, 229, 96, 13, 5, 237, 104, 13, 5, 237,
- 102, 13, 5, 237, 100, 13, 5, 237, 101, 107, 237, 100, 13, 5, 237, 101,
- 107, 237, 101, 246, 161, 107, 246, 160, 13, 5, 198, 13, 5, 237, 68, 24,
- 227, 84, 13, 5, 237, 68, 245, 204, 13, 5, 237, 67, 13, 5, 237, 55, 13, 5,
- 237, 24, 13, 5, 237, 7, 13, 5, 237, 6, 13, 5, 236, 235, 13, 5, 236, 205,
- 13, 5, 236, 157, 13, 5, 236, 125, 13, 5, 236, 66, 13, 5, 236, 67, 107,
- 236, 66, 13, 5, 236, 59, 13, 5, 236, 60, 245, 204, 13, 5, 236, 46, 13, 5,
- 236, 35, 13, 5, 236, 32, 13, 5, 236, 33, 24, 57, 13, 5, 236, 33, 24, 238,
- 91, 13, 5, 236, 33, 24, 223, 117, 13, 5, 236, 33, 107, 236, 32, 13, 5,
- 236, 33, 107, 236, 33, 24, 102, 79, 236, 1, 13, 5, 236, 33, 250, 238,
- 236, 32, 13, 5, 236, 30, 13, 5, 236, 31, 24, 57, 13, 5, 236, 31, 24, 102,
- 79, 250, 4, 13, 5, 236, 31, 24, 250, 4, 13, 5, 236, 31, 245, 204, 13, 5,
- 236, 1, 13, 5, 236, 0, 13, 5, 235, 246, 13, 5, 235, 247, 239, 222, 13, 5,
- 235, 247, 24, 229, 44, 227, 19, 13, 5, 235, 247, 234, 35, 235, 246, 13,
- 5, 235, 245, 13, 5, 235, 241, 234, 182, 13, 5, 235, 240, 13, 5, 235, 239,
- 13, 5, 235, 162, 13, 5, 235, 163, 24, 57, 13, 5, 235, 163, 24, 225, 163,
- 13, 5, 235, 163, 229, 96, 13, 5, 235, 89, 13, 5, 235, 90, 24, 72, 13, 5,
- 235, 88, 13, 5, 235, 64, 13, 5, 235, 65, 24, 246, 167, 227, 19, 13, 5,
- 235, 65, 24, 246, 161, 79, 246, 167, 227, 19, 13, 5, 235, 62, 13, 5, 235,
- 63, 24, 254, 190, 13, 5, 235, 63, 24, 254, 80, 13, 5, 235, 63, 24, 254,
- 81, 79, 254, 80, 13, 5, 235, 63, 24, 245, 212, 13, 5, 235, 63, 24, 236,
- 236, 79, 246, 167, 227, 19, 13, 5, 235, 63, 24, 235, 162, 13, 5, 235, 63,
- 24, 234, 194, 13, 5, 235, 63, 24, 229, 114, 13, 5, 235, 63, 24, 229, 115,
- 79, 102, 254, 190, 13, 5, 235, 63, 24, 229, 115, 79, 254, 80, 13, 5, 235,
- 63, 24, 229, 115, 79, 254, 81, 79, 254, 80, 13, 5, 235, 63, 24, 225, 172,
- 79, 254, 80, 13, 5, 235, 63, 24, 225, 83, 13, 5, 235, 53, 13, 5, 234,
- 206, 13, 5, 234, 205, 13, 5, 234, 194, 13, 5, 234, 195, 238, 30, 24, 246,
- 160, 13, 5, 234, 195, 238, 30, 24, 237, 7, 13, 5, 234, 195, 238, 30, 24,
- 231, 12, 13, 5, 234, 195, 238, 30, 24, 231, 13, 107, 234, 195, 238, 30,
- 24, 231, 12, 13, 5, 234, 195, 238, 30, 24, 225, 83, 13, 5, 234, 195, 227,
- 19, 13, 5, 234, 195, 107, 234, 194, 13, 5, 234, 195, 250, 238, 234, 194,
- 13, 5, 234, 195, 250, 238, 234, 195, 238, 30, 107, 238, 29, 13, 5, 234,
- 190, 13, 5, 234, 191, 255, 51, 24, 254, 76, 13, 5, 234, 191, 255, 51, 24,
- 252, 181, 13, 5, 234, 191, 255, 51, 24, 248, 103, 13, 5, 234, 191, 255,
- 51, 24, 245, 212, 13, 5, 234, 191, 255, 51, 24, 240, 50, 245, 204, 13, 5,
- 234, 191, 255, 51, 24, 239, 64, 13, 5, 234, 191, 255, 51, 24, 238, 43,
- 13, 5, 234, 191, 255, 51, 24, 235, 162, 13, 5, 234, 191, 255, 51, 24,
- 228, 252, 13, 5, 234, 191, 255, 51, 24, 225, 171, 13, 5, 234, 191, 238,
- 178, 24, 252, 181, 13, 5, 234, 191, 238, 178, 24, 252, 182, 66, 13, 5,
- 213, 13, 5, 233, 235, 13, 5, 233, 212, 13, 5, 233, 197, 13, 5, 233, 107,
- 13, 5, 233, 69, 13, 5, 233, 70, 24, 57, 13, 5, 233, 70, 24, 255, 52, 13,
- 5, 233, 70, 24, 252, 181, 13, 5, 233, 70, 24, 252, 90, 13, 5, 233, 70,
- 24, 72, 13, 5, 233, 70, 24, 74, 13, 5, 233, 70, 24, 244, 71, 13, 5, 233,
- 70, 24, 66, 13, 5, 233, 70, 24, 225, 171, 13, 5, 233, 70, 250, 238, 233,
- 69, 13, 5, 233, 32, 13, 5, 233, 33, 24, 239, 49, 13, 5, 233, 33, 24, 225,
- 163, 13, 5, 233, 33, 24, 223, 117, 13, 5, 233, 33, 234, 35, 233, 32, 13,
- 5, 208, 13, 5, 232, 20, 13, 5, 231, 180, 13, 5, 231, 70, 13, 5, 231, 31,
- 13, 5, 231, 20, 234, 182, 13, 5, 231, 19, 13, 5, 231, 20, 24, 57, 13, 5,
- 231, 20, 24, 248, 107, 13, 5, 231, 20, 24, 248, 105, 13, 5, 231, 20, 24,
- 154, 13, 5, 231, 20, 24, 239, 53, 13, 5, 231, 20, 24, 238, 91, 13, 5,
- 231, 20, 24, 237, 100, 13, 5, 231, 20, 24, 236, 157, 13, 5, 231, 20, 24,
- 234, 194, 13, 5, 231, 20, 24, 231, 12, 13, 5, 231, 20, 24, 229, 88, 13,
- 5, 231, 20, 24, 227, 100, 13, 5, 231, 20, 24, 225, 171, 13, 5, 231, 20,
- 24, 225, 168, 13, 5, 231, 20, 24, 225, 145, 13, 5, 231, 20, 24, 225, 103,
- 13, 5, 231, 20, 24, 225, 83, 13, 5, 231, 20, 107, 231, 19, 13, 5, 231,
- 20, 245, 204, 13, 5, 231, 12, 13, 5, 231, 13, 215, 24, 254, 78, 13, 5,
- 230, 251, 13, 5, 230, 244, 13, 5, 229, 146, 13, 5, 229, 144, 13, 5, 229,
- 145, 24, 57, 13, 5, 229, 145, 24, 253, 61, 13, 5, 229, 145, 24, 246, 24,
- 13, 5, 229, 145, 24, 235, 162, 13, 5, 229, 145, 24, 229, 41, 13, 5, 229,
- 145, 24, 225, 236, 13, 5, 229, 145, 24, 66, 13, 5, 229, 145, 24, 97, 79,
- 57, 13, 5, 229, 143, 13, 5, 229, 141, 13, 5, 229, 125, 13, 5, 229, 114,
- 13, 5, 229, 115, 244, 145, 13, 5, 229, 115, 107, 229, 115, 246, 185, 107,
- 246, 185, 246, 161, 107, 246, 160, 13, 5, 229, 115, 107, 229, 115, 227,
- 101, 107, 227, 101, 246, 161, 107, 246, 160, 13, 5, 229, 107, 13, 5, 229,
- 102, 13, 5, 229, 99, 13, 5, 229, 98, 13, 5, 229, 95, 13, 5, 229, 88, 13,
- 5, 229, 89, 24, 57, 13, 5, 229, 89, 24, 240, 30, 13, 5, 229, 82, 13, 5,
- 229, 83, 24, 57, 13, 5, 229, 83, 24, 253, 51, 13, 5, 229, 83, 24, 252,
- 79, 13, 5, 229, 83, 24, 249, 210, 13, 5, 229, 83, 24, 246, 160, 13, 5,
- 229, 83, 24, 240, 49, 13, 5, 229, 83, 24, 240, 50, 245, 204, 13, 5, 229,
- 83, 24, 238, 86, 13, 5, 229, 83, 24, 237, 102, 13, 5, 229, 83, 24, 236,
- 59, 13, 5, 229, 83, 24, 231, 12, 13, 5, 229, 77, 13, 5, 229, 74, 13, 5,
- 229, 75, 227, 19, 13, 5, 229, 75, 107, 229, 75, 252, 71, 107, 252, 70,
- 13, 5, 229, 72, 13, 5, 229, 43, 13, 5, 229, 44, 107, 239, 223, 229, 43,
- 13, 5, 229, 41, 13, 5, 229, 40, 13, 5, 229, 15, 13, 5, 229, 16, 245, 204,
- 13, 5, 229, 7, 13, 5, 229, 5, 13, 5, 229, 6, 107, 229, 6, 229, 41, 13, 5,
- 228, 254, 13, 5, 228, 252, 13, 5, 228, 6, 13, 5, 228, 7, 107, 228, 6, 13,
- 5, 227, 242, 13, 5, 227, 241, 13, 5, 227, 240, 13, 5, 227, 233, 13, 5,
- 227, 232, 13, 5, 227, 213, 13, 5, 227, 212, 13, 5, 227, 107, 13, 5, 227,
- 108, 254, 69, 13, 5, 227, 108, 24, 245, 75, 13, 5, 227, 108, 24, 236,
- 157, 13, 5, 227, 108, 245, 204, 13, 5, 227, 100, 13, 5, 227, 101, 107,
- 227, 101, 235, 90, 107, 235, 90, 249, 196, 107, 249, 195, 13, 5, 227,
- 101, 228, 118, 13, 5, 227, 95, 13, 5, 108, 24, 252, 181, 13, 5, 108, 24,
- 245, 212, 13, 5, 108, 24, 229, 114, 13, 5, 108, 24, 229, 43, 13, 5, 108,
- 24, 225, 247, 13, 5, 108, 24, 225, 163, 13, 5, 227, 84, 13, 5, 227, 67,
- 13, 5, 227, 44, 13, 5, 227, 45, 245, 204, 13, 5, 226, 175, 13, 5, 226,
- 176, 227, 19, 13, 5, 226, 160, 13, 5, 226, 146, 13, 5, 226, 147, 24, 227,
- 84, 13, 5, 226, 147, 107, 226, 146, 13, 5, 226, 147, 107, 226, 147, 246,
- 185, 107, 246, 185, 246, 161, 107, 246, 160, 13, 5, 225, 250, 13, 5, 225,
- 247, 13, 5, 225, 245, 13, 5, 225, 244, 13, 5, 225, 236, 13, 5, 225, 237,
- 107, 225, 237, 223, 118, 107, 223, 117, 13, 5, 66, 13, 5, 97, 245, 212,
- 13, 5, 97, 97, 66, 13, 5, 97, 107, 97, 233, 242, 107, 233, 242, 246, 161,
- 107, 246, 160, 13, 5, 97, 107, 97, 227, 214, 107, 227, 213, 13, 5, 97,
- 107, 97, 97, 200, 107, 97, 231, 192, 13, 5, 225, 171, 13, 5, 225, 168,
- 13, 5, 225, 163, 13, 5, 225, 164, 238, 86, 13, 5, 225, 164, 24, 253, 61,
- 13, 5, 225, 164, 24, 236, 157, 13, 5, 225, 164, 24, 97, 79, 97, 79, 66,
- 13, 5, 225, 164, 24, 97, 79, 97, 79, 97, 245, 204, 13, 5, 225, 164, 245,
- 204, 13, 5, 225, 164, 229, 96, 13, 5, 225, 164, 229, 97, 24, 253, 61, 13,
- 5, 225, 160, 13, 5, 225, 145, 13, 5, 225, 146, 24, 238, 31, 13, 5, 225,
- 146, 24, 236, 236, 79, 250, 189, 13, 5, 225, 146, 24, 229, 144, 13, 5,
- 225, 146, 24, 66, 13, 5, 225, 144, 13, 5, 225, 140, 13, 5, 225, 141, 24,
- 239, 25, 13, 5, 225, 141, 24, 213, 13, 5, 225, 138, 13, 5, 225, 139, 245,
- 204, 13, 5, 225, 103, 13, 5, 225, 104, 250, 238, 225, 103, 13, 5, 225,
- 104, 229, 96, 13, 5, 225, 101, 13, 5, 225, 102, 24, 102, 79, 154, 13, 5,
- 225, 102, 24, 102, 79, 236, 1, 13, 5, 225, 102, 24, 254, 233, 13, 5, 225,
- 102, 24, 154, 13, 5, 225, 102, 24, 234, 194, 13, 5, 225, 102, 24, 225,
- 171, 13, 5, 225, 102, 24, 225, 172, 79, 254, 80, 13, 5, 225, 102, 24,
- 225, 172, 79, 252, 181, 13, 5, 225, 100, 13, 5, 225, 97, 13, 5, 225, 96,
- 13, 5, 225, 93, 13, 5, 225, 94, 24, 57, 13, 5, 225, 94, 24, 254, 76, 13,
- 5, 225, 94, 24, 125, 13, 5, 225, 94, 24, 248, 97, 13, 5, 225, 94, 24,
- 246, 193, 13, 5, 225, 94, 24, 246, 177, 13, 5, 225, 94, 24, 246, 167,
- 227, 19, 13, 5, 225, 94, 24, 246, 160, 13, 5, 225, 94, 24, 245, 218, 13,
- 5, 225, 94, 24, 154, 13, 5, 225, 94, 24, 240, 49, 13, 5, 225, 94, 24,
- 240, 30, 13, 5, 225, 94, 24, 239, 200, 13, 5, 225, 94, 24, 238, 199, 13,
- 5, 225, 94, 24, 237, 100, 13, 5, 225, 94, 24, 236, 125, 13, 5, 225, 94,
- 24, 213, 13, 5, 225, 94, 24, 229, 114, 13, 5, 225, 94, 24, 229, 5, 13, 5,
- 225, 94, 24, 225, 250, 13, 5, 225, 94, 24, 97, 79, 245, 212, 13, 5, 225,
- 94, 24, 225, 163, 13, 5, 225, 94, 24, 225, 91, 13, 5, 225, 91, 13, 5,
- 225, 92, 24, 66, 13, 5, 225, 83, 13, 5, 225, 84, 24, 57, 13, 5, 225, 84,
- 24, 238, 107, 13, 5, 225, 84, 24, 238, 91, 13, 5, 225, 84, 24, 227, 84,
- 13, 5, 225, 80, 13, 5, 225, 82, 13, 5, 225, 81, 13, 5, 225, 77, 13, 5,
- 225, 67, 13, 5, 225, 68, 24, 239, 25, 13, 5, 225, 66, 13, 5, 223, 117,
- 13, 5, 223, 118, 227, 19, 13, 5, 223, 118, 228, 119, 24, 238, 91, 13, 5,
- 223, 115, 13, 5, 223, 108, 13, 5, 223, 96, 13, 5, 223, 47, 13, 5, 223,
- 48, 107, 223, 47, 13, 5, 223, 46, 13, 5, 223, 44, 13, 5, 223, 45, 239,
- 67, 227, 19, 13, 5, 223, 39, 13, 5, 223, 32, 13, 5, 223, 19, 13, 5, 223,
- 17, 13, 5, 223, 18, 24, 57, 13, 5, 223, 16, 13, 5, 223, 15, 13, 111, 5,
- 135, 254, 80, 13, 111, 5, 152, 254, 80, 13, 111, 5, 246, 243, 254, 80,
- 13, 111, 5, 247, 37, 254, 80, 13, 111, 5, 228, 217, 254, 80, 13, 111, 5,
- 229, 163, 254, 80, 13, 111, 5, 248, 20, 254, 80, 13, 111, 5, 235, 61,
- 254, 80, 13, 111, 5, 152, 249, 195, 13, 111, 5, 246, 243, 249, 195, 13,
- 111, 5, 247, 37, 249, 195, 13, 111, 5, 228, 217, 249, 195, 13, 111, 5,
- 229, 163, 249, 195, 13, 111, 5, 248, 20, 249, 195, 13, 111, 5, 235, 61,
- 249, 195, 13, 111, 5, 246, 243, 66, 13, 111, 5, 247, 37, 66, 13, 111, 5,
- 228, 217, 66, 13, 111, 5, 229, 163, 66, 13, 111, 5, 248, 20, 66, 13, 111,
- 5, 235, 61, 66, 13, 111, 5, 168, 246, 109, 13, 111, 5, 135, 246, 109, 13,
- 111, 5, 152, 246, 109, 13, 111, 5, 246, 243, 246, 109, 13, 111, 5, 247,
- 37, 246, 109, 13, 111, 5, 228, 217, 246, 109, 13, 111, 5, 229, 163, 246,
- 109, 13, 111, 5, 248, 20, 246, 109, 13, 111, 5, 235, 61, 246, 109, 13,
- 111, 5, 168, 246, 106, 13, 111, 5, 135, 246, 106, 13, 111, 5, 152, 246,
- 106, 13, 111, 5, 246, 243, 246, 106, 13, 111, 5, 247, 37, 246, 106, 13,
- 111, 5, 135, 229, 125, 13, 111, 5, 152, 229, 125, 13, 111, 5, 152, 229,
- 126, 225, 54, 15, 13, 111, 5, 246, 243, 229, 125, 13, 111, 5, 247, 37,
- 229, 125, 13, 111, 5, 228, 217, 229, 125, 13, 111, 5, 229, 163, 229, 125,
- 13, 111, 5, 248, 20, 229, 125, 13, 111, 5, 235, 61, 229, 125, 13, 111, 5,
- 168, 229, 121, 13, 111, 5, 135, 229, 121, 13, 111, 5, 152, 229, 121, 13,
- 111, 5, 152, 229, 122, 225, 54, 15, 13, 111, 5, 246, 243, 229, 121, 13,
- 111, 5, 247, 37, 229, 121, 13, 111, 5, 229, 126, 24, 246, 178, 79, 249,
- 195, 13, 111, 5, 229, 126, 24, 246, 178, 79, 236, 125, 13, 111, 5, 168,
- 252, 67, 13, 111, 5, 135, 252, 67, 13, 111, 5, 152, 252, 67, 13, 111, 5,
- 152, 252, 68, 225, 54, 15, 13, 111, 5, 246, 243, 252, 67, 13, 111, 5,
- 247, 37, 252, 67, 13, 111, 5, 152, 225, 54, 211, 247, 182, 13, 111, 5,
- 152, 225, 54, 211, 247, 179, 13, 111, 5, 246, 243, 225, 54, 211, 237,
- 174, 13, 111, 5, 246, 243, 225, 54, 211, 237, 172, 13, 111, 5, 246, 243,
- 225, 54, 211, 237, 175, 57, 13, 111, 5, 246, 243, 225, 54, 211, 237, 175,
- 254, 27, 13, 111, 5, 228, 217, 225, 54, 211, 254, 77, 13, 111, 5, 229,
- 163, 225, 54, 211, 240, 22, 13, 111, 5, 229, 163, 225, 54, 211, 240, 24,
- 57, 13, 111, 5, 229, 163, 225, 54, 211, 240, 24, 254, 27, 13, 111, 5,
- 248, 20, 225, 54, 211, 225, 79, 13, 111, 5, 248, 20, 225, 54, 211, 225,
- 78, 13, 111, 5, 235, 61, 225, 54, 211, 240, 38, 13, 111, 5, 235, 61, 225,
- 54, 211, 240, 37, 13, 111, 5, 235, 61, 225, 54, 211, 240, 36, 13, 111, 5,
- 235, 61, 225, 54, 211, 240, 39, 57, 13, 111, 5, 135, 254, 81, 227, 19,
- 13, 111, 5, 152, 254, 81, 227, 19, 13, 111, 5, 246, 243, 254, 81, 227,
- 19, 13, 111, 5, 247, 37, 254, 81, 227, 19, 13, 111, 5, 228, 217, 254, 81,
- 227, 19, 13, 111, 5, 168, 253, 42, 13, 111, 5, 135, 253, 42, 13, 111, 5,
- 152, 253, 42, 13, 111, 5, 246, 243, 253, 42, 13, 111, 5, 246, 243, 253,
- 43, 225, 54, 15, 13, 111, 5, 247, 37, 253, 42, 13, 111, 5, 247, 37, 253,
- 43, 225, 54, 15, 13, 111, 5, 235, 69, 13, 111, 5, 235, 70, 13, 111, 5,
- 168, 247, 178, 13, 111, 5, 135, 247, 178, 13, 111, 5, 168, 226, 214, 249,
- 195, 13, 111, 5, 135, 226, 212, 249, 195, 13, 111, 5, 247, 37, 228, 209,
- 249, 195, 13, 111, 5, 168, 226, 214, 225, 54, 211, 57, 13, 111, 5, 135,
- 226, 212, 225, 54, 211, 57, 13, 111, 5, 168, 248, 17, 254, 80, 13, 111,
- 5, 168, 232, 77, 254, 80, 13, 111, 5, 84, 254, 72, 168, 228, 210, 13,
- 111, 5, 84, 254, 72, 168, 232, 76, 13, 232, 171, 5, 84, 254, 72, 224, 92,
- 249, 184, 13, 232, 171, 5, 61, 251, 61, 13, 232, 171, 5, 250, 1, 251, 61,
- 13, 232, 171, 5, 250, 1, 226, 74, 43, 23, 14, 232, 177, 43, 23, 14, 250,
- 132, 43, 23, 14, 233, 117, 43, 23, 14, 233, 252, 248, 6, 43, 23, 14, 233,
- 252, 249, 205, 43, 23, 14, 225, 58, 248, 6, 43, 23, 14, 225, 58, 249,
- 205, 43, 23, 14, 239, 16, 43, 23, 14, 227, 125, 43, 23, 14, 233, 186, 43,
- 23, 14, 223, 163, 43, 23, 14, 223, 164, 249, 205, 43, 23, 14, 238, 112,
- 43, 23, 14, 254, 154, 248, 6, 43, 23, 14, 247, 144, 248, 6, 43, 23, 14,
- 227, 30, 43, 23, 14, 238, 239, 43, 23, 14, 254, 145, 43, 23, 14, 254,
- 146, 249, 205, 43, 23, 14, 227, 130, 43, 23, 14, 226, 204, 43, 23, 14,
- 234, 71, 254, 118, 43, 23, 14, 246, 0, 254, 118, 43, 23, 14, 232, 176,
- 43, 23, 14, 251, 198, 43, 23, 14, 225, 48, 43, 23, 14, 239, 199, 254,
- 118, 43, 23, 14, 238, 241, 254, 118, 43, 23, 14, 238, 240, 254, 118, 43,
- 23, 14, 230, 235, 43, 23, 14, 233, 177, 43, 23, 14, 228, 53, 254, 148,
- 43, 23, 14, 233, 251, 254, 118, 43, 23, 14, 225, 57, 254, 118, 43, 23,
- 14, 254, 149, 254, 118, 43, 23, 14, 254, 143, 43, 23, 14, 238, 158, 43,
- 23, 14, 231, 190, 43, 23, 14, 233, 67, 254, 118, 43, 23, 14, 226, 155,
- 43, 23, 14, 254, 189, 43, 23, 14, 230, 194, 43, 23, 14, 227, 133, 254,
- 118, 43, 23, 14, 227, 133, 236, 200, 228, 51, 43, 23, 14, 233, 246, 254,
- 118, 43, 23, 14, 226, 234, 43, 23, 14, 237, 222, 43, 23, 14, 248, 73, 43,
- 23, 14, 226, 80, 43, 23, 14, 227, 12, 43, 23, 14, 238, 115, 43, 23, 14,
- 254, 154, 247, 144, 235, 152, 43, 23, 14, 246, 220, 254, 118, 43, 23, 14,
- 240, 26, 43, 23, 14, 226, 56, 254, 118, 43, 23, 14, 239, 18, 226, 55, 43,
- 23, 14, 233, 135, 43, 23, 14, 232, 180, 43, 23, 14, 238, 140, 43, 23, 14,
- 251, 145, 254, 118, 43, 23, 14, 232, 0, 43, 23, 14, 233, 189, 254, 118,
- 43, 23, 14, 233, 187, 254, 118, 43, 23, 14, 244, 67, 43, 23, 14, 235,
- 236, 43, 23, 14, 233, 103, 43, 23, 14, 238, 141, 254, 211, 43, 23, 14,
- 226, 56, 254, 211, 43, 23, 14, 228, 34, 43, 23, 14, 245, 226, 43, 23, 14,
- 239, 199, 235, 152, 43, 23, 14, 234, 71, 235, 152, 43, 23, 14, 233, 252,
- 235, 152, 43, 23, 14, 233, 102, 43, 23, 14, 238, 128, 43, 23, 14, 233,
- 101, 43, 23, 14, 238, 114, 43, 23, 14, 233, 136, 235, 152, 43, 23, 14,
- 238, 240, 235, 153, 254, 172, 43, 23, 14, 238, 241, 235, 153, 254, 172,
- 43, 23, 14, 223, 161, 43, 23, 14, 254, 146, 235, 152, 43, 23, 14, 254,
- 147, 227, 131, 235, 152, 43, 23, 14, 223, 162, 43, 23, 14, 238, 113, 43,
- 23, 14, 248, 1, 43, 23, 14, 251, 199, 43, 23, 14, 236, 134, 239, 198, 43,
- 23, 14, 225, 58, 235, 152, 43, 23, 14, 233, 67, 235, 152, 43, 23, 14,
- 232, 181, 235, 152, 43, 23, 14, 234, 68, 43, 23, 14, 254, 164, 43, 23,
- 14, 237, 77, 43, 23, 14, 233, 187, 235, 152, 43, 23, 14, 233, 189, 235,
- 152, 43, 23, 14, 247, 169, 233, 188, 43, 23, 14, 238, 51, 43, 23, 14,
- 254, 165, 43, 23, 14, 226, 56, 235, 152, 43, 23, 14, 248, 4, 43, 23, 14,
- 227, 133, 235, 152, 43, 23, 14, 227, 126, 43, 23, 14, 251, 145, 235, 152,
- 43, 23, 14, 247, 210, 43, 23, 14, 230, 195, 235, 152, 43, 23, 14, 224,
- 58, 238, 158, 43, 23, 14, 226, 53, 43, 23, 14, 232, 182, 43, 23, 14, 226,
- 57, 43, 23, 14, 226, 54, 43, 23, 14, 232, 179, 43, 23, 14, 226, 52, 43,
- 23, 14, 232, 178, 43, 23, 14, 245, 255, 43, 23, 14, 254, 113, 43, 23, 14,
- 247, 169, 254, 113, 43, 23, 14, 233, 246, 235, 152, 43, 23, 14, 226, 233,
- 247, 177, 43, 23, 14, 226, 233, 247, 143, 43, 23, 14, 226, 235, 254, 150,
- 43, 23, 14, 226, 228, 239, 57, 254, 142, 43, 23, 14, 239, 17, 43, 23, 14,
- 247, 229, 43, 23, 14, 223, 205, 239, 15, 43, 23, 14, 223, 205, 254, 172,
- 43, 23, 14, 228, 52, 43, 23, 14, 238, 159, 254, 172, 43, 23, 14, 249,
- 206, 254, 118, 43, 23, 14, 238, 116, 254, 118, 43, 23, 14, 238, 116, 254,
- 211, 43, 23, 14, 238, 116, 235, 152, 43, 23, 14, 254, 149, 235, 152, 43,
- 23, 14, 254, 151, 43, 23, 14, 249, 205, 43, 23, 14, 226, 65, 43, 23, 14,
- 227, 4, 43, 23, 14, 238, 132, 43, 23, 14, 237, 225, 247, 225, 251, 138,
- 43, 23, 14, 237, 225, 248, 74, 251, 139, 43, 23, 14, 237, 225, 226, 67,
- 251, 139, 43, 23, 14, 237, 225, 227, 14, 251, 139, 43, 23, 14, 237, 225,
- 240, 21, 251, 138, 43, 23, 14, 246, 0, 235, 153, 254, 172, 43, 23, 14,
- 246, 0, 233, 178, 254, 109, 43, 23, 14, 246, 0, 233, 178, 250, 26, 43,
- 23, 14, 249, 228, 43, 23, 14, 249, 229, 233, 178, 254, 110, 239, 15, 43,
- 23, 14, 249, 229, 233, 178, 254, 110, 254, 172, 43, 23, 14, 249, 229,
- 233, 178, 250, 26, 43, 23, 14, 226, 71, 43, 23, 14, 254, 114, 43, 23, 14,
- 240, 28, 43, 23, 14, 249, 249, 43, 23, 14, 255, 4, 232, 246, 254, 115,
- 43, 23, 14, 255, 4, 254, 112, 43, 23, 14, 255, 4, 254, 115, 43, 23, 14,
- 255, 4, 236, 195, 43, 23, 14, 255, 4, 236, 203, 43, 23, 14, 255, 4, 246,
- 1, 43, 23, 14, 255, 4, 245, 254, 43, 23, 14, 255, 4, 232, 246, 246, 1,
- 43, 23, 14, 237, 10, 232, 187, 244, 65, 43, 23, 14, 237, 10, 254, 213,
- 232, 187, 244, 65, 43, 23, 14, 237, 10, 250, 25, 244, 65, 43, 23, 14,
- 237, 10, 254, 213, 250, 25, 244, 65, 43, 23, 14, 237, 10, 226, 60, 244,
- 65, 43, 23, 14, 237, 10, 226, 72, 43, 23, 14, 237, 10, 227, 8, 244, 65,
- 43, 23, 14, 237, 10, 227, 8, 237, 228, 244, 65, 43, 23, 14, 237, 10, 237,
- 228, 244, 65, 43, 23, 14, 237, 10, 233, 22, 244, 65, 43, 23, 14, 239,
- 203, 227, 26, 244, 66, 43, 23, 14, 254, 147, 227, 26, 244, 66, 43, 23,
- 14, 247, 110, 227, 5, 43, 23, 14, 247, 110, 236, 93, 43, 23, 14, 247,
- 110, 249, 233, 43, 23, 14, 237, 10, 225, 52, 244, 65, 43, 23, 14, 237,
- 10, 232, 186, 244, 65, 43, 23, 14, 237, 10, 233, 22, 227, 8, 244, 65, 43,
- 23, 14, 245, 252, 236, 5, 254, 150, 43, 23, 14, 245, 252, 236, 5, 249,
- 204, 43, 23, 14, 247, 237, 239, 57, 246, 220, 224, 195, 43, 23, 14, 240,
- 27, 43, 23, 14, 240, 25, 43, 23, 14, 246, 220, 254, 119, 250, 24, 244,
- 64, 43, 23, 14, 246, 220, 249, 247, 213, 43, 23, 14, 246, 220, 249, 247,
- 235, 236, 43, 23, 14, 246, 220, 235, 232, 244, 65, 43, 23, 14, 246, 220,
- 249, 247, 250, 4, 43, 23, 14, 246, 220, 228, 200, 249, 246, 250, 4, 43,
- 23, 14, 246, 220, 249, 247, 239, 3, 43, 23, 14, 246, 220, 249, 247, 223,
- 27, 43, 23, 14, 246, 220, 249, 247, 235, 90, 239, 15, 43, 23, 14, 246,
- 220, 249, 247, 235, 90, 254, 172, 43, 23, 14, 246, 220, 237, 40, 251,
- 140, 249, 233, 43, 23, 14, 246, 220, 237, 40, 251, 140, 236, 93, 43, 23,
- 14, 247, 71, 228, 200, 251, 140, 225, 51, 43, 23, 14, 246, 220, 228, 200,
- 251, 140, 227, 134, 43, 23, 14, 246, 220, 235, 154, 43, 23, 14, 251, 141,
- 223, 3, 43, 23, 14, 251, 141, 238, 157, 43, 23, 14, 251, 141, 228, 141,
- 43, 23, 14, 246, 220, 244, 81, 223, 204, 227, 9, 43, 23, 14, 246, 220,
- 247, 238, 254, 166, 43, 23, 14, 223, 204, 226, 61, 43, 23, 14, 249, 241,
- 226, 61, 43, 23, 14, 249, 241, 227, 9, 43, 23, 14, 249, 241, 254, 152,
- 248, 74, 249, 155, 43, 23, 14, 249, 241, 236, 91, 227, 13, 249, 155, 43,
- 23, 14, 249, 241, 249, 225, 247, 153, 249, 155, 43, 23, 14, 249, 241,
- 226, 69, 234, 75, 249, 155, 43, 23, 14, 223, 204, 254, 152, 248, 74, 249,
- 155, 43, 23, 14, 223, 204, 236, 91, 227, 13, 249, 155, 43, 23, 14, 223,
- 204, 249, 225, 247, 153, 249, 155, 43, 23, 14, 223, 204, 226, 69, 234,
- 75, 249, 155, 43, 23, 14, 246, 120, 249, 240, 43, 23, 14, 246, 120, 223,
- 203, 43, 23, 14, 249, 248, 254, 152, 236, 135, 43, 23, 14, 249, 248, 254,
- 152, 236, 220, 43, 23, 14, 249, 248, 249, 205, 43, 23, 14, 249, 248, 226,
- 226, 43, 23, 14, 228, 248, 226, 226, 43, 23, 14, 228, 248, 226, 227, 249,
- 194, 43, 23, 14, 228, 248, 226, 227, 226, 62, 43, 23, 14, 228, 248, 226,
- 227, 227, 2, 43, 23, 14, 228, 248, 254, 90, 43, 23, 14, 228, 248, 254,
- 91, 249, 194, 43, 23, 14, 228, 248, 254, 91, 226, 62, 43, 23, 14, 228,
- 248, 254, 91, 227, 2, 43, 23, 14, 249, 226, 246, 102, 43, 23, 14, 249,
- 232, 234, 13, 43, 23, 14, 228, 46, 43, 23, 14, 254, 107, 213, 43, 23, 14,
- 254, 107, 224, 195, 43, 23, 14, 254, 107, 246, 193, 43, 23, 14, 254, 107,
- 250, 4, 43, 23, 14, 254, 107, 239, 3, 43, 23, 14, 254, 107, 223, 27, 43,
- 23, 14, 254, 107, 235, 89, 43, 23, 14, 238, 240, 235, 153, 236, 202, 43,
- 23, 14, 238, 241, 235, 153, 236, 202, 43, 23, 14, 238, 240, 235, 153,
- 239, 15, 43, 23, 14, 238, 241, 235, 153, 239, 15, 43, 23, 14, 238, 159,
- 239, 15, 43, 23, 14, 246, 0, 235, 153, 239, 15, 23, 14, 228, 241, 253,
- 32, 23, 14, 47, 253, 32, 23, 14, 35, 253, 32, 23, 14, 231, 193, 35, 253,
- 32, 23, 14, 250, 129, 253, 32, 23, 14, 229, 63, 253, 32, 23, 14, 42, 231,
- 212, 53, 23, 14, 41, 231, 212, 53, 23, 14, 231, 212, 249, 138, 23, 14,
- 250, 166, 230, 198, 23, 14, 250, 190, 252, 14, 23, 14, 230, 198, 23, 14,
- 251, 66, 23, 14, 231, 210, 247, 60, 23, 14, 231, 210, 247, 59, 23, 14,
- 231, 210, 247, 58, 23, 14, 247, 76, 23, 14, 247, 77, 51, 23, 14, 252,
- 108, 76, 23, 14, 252, 34, 23, 14, 252, 116, 23, 14, 104, 23, 14, 234, 60,
- 228, 65, 23, 14, 225, 202, 228, 65, 23, 14, 226, 190, 228, 65, 23, 14,
- 246, 242, 228, 65, 23, 14, 247, 36, 228, 65, 23, 14, 228, 216, 228, 65,
- 23, 14, 228, 214, 246, 228, 23, 14, 246, 240, 246, 228, 23, 14, 246, 196,
- 251, 92, 23, 14, 246, 196, 251, 93, 234, 15, 254, 204, 23, 14, 246, 196,
- 251, 93, 234, 15, 253, 22, 23, 14, 252, 45, 251, 92, 23, 14, 247, 131,
- 251, 92, 23, 14, 247, 131, 251, 93, 234, 15, 254, 204, 23, 14, 247, 131,
- 251, 93, 234, 15, 253, 22, 23, 14, 248, 112, 251, 91, 23, 14, 248, 112,
- 251, 90, 23, 14, 236, 53, 236, 234, 231, 199, 23, 14, 47, 229, 123, 23,
- 14, 47, 247, 24, 23, 14, 247, 25, 225, 116, 23, 14, 247, 25, 248, 127,
- 23, 14, 235, 224, 225, 116, 23, 14, 235, 224, 248, 127, 23, 14, 229, 124,
- 225, 116, 23, 14, 229, 124, 248, 127, 23, 14, 232, 77, 206, 229, 123, 23,
- 14, 232, 77, 206, 247, 24, 23, 14, 251, 52, 226, 157, 23, 14, 250, 213,
- 226, 157, 23, 14, 234, 15, 254, 204, 23, 14, 234, 15, 253, 22, 23, 14,
- 232, 62, 254, 204, 23, 14, 232, 62, 253, 22, 23, 14, 236, 56, 231, 199,
- 23, 14, 224, 119, 231, 199, 23, 14, 132, 231, 199, 23, 14, 232, 77, 231,
- 199, 23, 14, 248, 17, 231, 199, 23, 14, 228, 211, 231, 199, 23, 14, 226,
- 205, 231, 199, 23, 14, 228, 205, 231, 199, 23, 14, 168, 244, 136, 225,
- 214, 231, 199, 23, 14, 224, 74, 234, 236, 23, 14, 79, 234, 236, 23, 14,
- 251, 107, 224, 74, 234, 236, 23, 14, 37, 234, 237, 224, 121, 23, 14, 37,
- 234, 237, 252, 150, 23, 14, 226, 79, 234, 237, 99, 224, 121, 23, 14, 226,
- 79, 234, 237, 99, 252, 150, 23, 14, 226, 79, 234, 237, 42, 224, 121, 23,
- 14, 226, 79, 234, 237, 42, 252, 150, 23, 14, 226, 79, 234, 237, 41, 224,
- 121, 23, 14, 226, 79, 234, 237, 41, 252, 150, 23, 14, 226, 79, 234, 237,
- 103, 224, 121, 23, 14, 226, 79, 234, 237, 103, 252, 150, 23, 14, 226, 79,
- 234, 237, 99, 41, 224, 121, 23, 14, 226, 79, 234, 237, 99, 41, 252, 150,
- 23, 14, 236, 85, 234, 237, 224, 121, 23, 14, 236, 85, 234, 237, 252, 150,
- 23, 14, 226, 76, 234, 237, 103, 224, 121, 23, 14, 226, 76, 234, 237, 103,
- 252, 150, 23, 14, 233, 181, 234, 236, 23, 14, 224, 201, 234, 236, 23, 14,
- 234, 237, 252, 150, 23, 14, 234, 201, 234, 236, 23, 14, 251, 71, 234,
- 237, 224, 121, 23, 14, 251, 71, 234, 237, 252, 150, 23, 14, 252, 106, 23,
- 14, 224, 119, 234, 238, 23, 14, 132, 234, 238, 23, 14, 232, 77, 234, 238,
- 23, 14, 248, 17, 234, 238, 23, 14, 228, 211, 234, 238, 23, 14, 226, 205,
- 234, 238, 23, 14, 228, 205, 234, 238, 23, 14, 168, 244, 136, 225, 214,
- 234, 238, 23, 14, 36, 228, 48, 23, 14, 36, 228, 126, 228, 48, 23, 14, 36,
- 226, 85, 23, 14, 36, 226, 84, 23, 14, 36, 226, 83, 23, 14, 247, 50, 226,
- 85, 23, 14, 247, 50, 226, 84, 23, 14, 247, 50, 226, 83, 23, 14, 36, 254,
- 51, 249, 140, 23, 14, 36, 247, 30, 23, 14, 36, 247, 29, 23, 14, 36, 247,
- 28, 23, 14, 36, 247, 27, 23, 14, 36, 247, 26, 23, 14, 252, 226, 252, 237,
- 23, 14, 247, 233, 252, 237, 23, 14, 252, 226, 226, 170, 23, 14, 247, 233,
- 226, 170, 23, 14, 252, 226, 228, 185, 23, 14, 247, 233, 228, 185, 23, 14,
- 252, 226, 233, 76, 23, 14, 247, 233, 233, 76, 23, 14, 36, 255, 41, 23,
- 14, 36, 228, 67, 23, 14, 36, 227, 18, 23, 14, 36, 228, 68, 23, 14, 36,
- 237, 21, 23, 14, 36, 237, 20, 23, 14, 36, 255, 40, 23, 14, 36, 237, 118,
- 23, 14, 254, 98, 225, 116, 23, 14, 254, 98, 248, 127, 23, 14, 36, 249,
- 152, 23, 14, 36, 231, 138, 23, 14, 36, 247, 18, 23, 14, 36, 228, 181, 23,
- 14, 36, 252, 209, 23, 14, 36, 47, 226, 110, 23, 14, 36, 226, 66, 226,
- 110, 23, 14, 231, 141, 23, 14, 228, 2, 23, 14, 223, 119, 23, 14, 233, 68,
- 23, 14, 236, 192, 23, 14, 246, 247, 23, 14, 250, 249, 23, 14, 250, 68,
- 23, 14, 245, 247, 234, 239, 228, 194, 23, 14, 245, 247, 234, 239, 235, 7,
- 228, 194, 23, 14, 226, 96, 23, 14, 225, 233, 23, 14, 239, 223, 225, 233,
- 23, 14, 225, 234, 228, 194, 23, 14, 225, 234, 225, 116, 23, 14, 234, 26,
- 228, 22, 23, 14, 234, 26, 228, 19, 23, 14, 234, 26, 228, 18, 23, 14, 234,
- 26, 228, 17, 23, 14, 234, 26, 228, 16, 23, 14, 234, 26, 228, 15, 23, 14,
- 234, 26, 228, 14, 23, 14, 234, 26, 228, 13, 23, 14, 234, 26, 228, 12, 23,
- 14, 234, 26, 228, 21, 23, 14, 234, 26, 228, 20, 23, 14, 245, 128, 23, 14,
- 235, 161, 23, 14, 247, 233, 106, 228, 42, 23, 14, 250, 62, 228, 194, 23,
- 14, 36, 103, 252, 121, 23, 14, 36, 99, 252, 121, 23, 14, 36, 245, 137,
- 23, 14, 36, 228, 175, 233, 25, 23, 14, 233, 148, 76, 23, 14, 233, 148,
- 99, 76, 23, 14, 132, 233, 148, 76, 23, 14, 246, 17, 225, 116, 23, 14,
- 246, 17, 248, 127, 23, 14, 2, 247, 49, 23, 14, 250, 152, 23, 14, 250,
- 153, 254, 216, 23, 14, 236, 253, 23, 14, 237, 126, 23, 14, 252, 103, 23,
- 14, 229, 190, 224, 121, 23, 14, 229, 190, 252, 150, 23, 14, 236, 123, 23,
- 14, 236, 124, 252, 150, 23, 14, 229, 184, 224, 121, 23, 14, 229, 184,
- 252, 150, 23, 14, 246, 210, 224, 121, 23, 14, 246, 210, 252, 150, 23, 14,
- 237, 127, 233, 121, 231, 199, 23, 14, 237, 127, 240, 20, 231, 199, 23,
- 14, 252, 104, 231, 199, 23, 14, 229, 190, 231, 199, 23, 14, 236, 124,
- 231, 199, 23, 14, 229, 184, 231, 199, 23, 14, 227, 25, 233, 119, 250,
- 230, 232, 195, 233, 120, 23, 14, 227, 25, 233, 119, 250, 230, 232, 195,
- 240, 19, 23, 14, 227, 25, 233, 119, 250, 230, 232, 195, 233, 121, 249,
- 215, 23, 14, 227, 25, 240, 18, 250, 230, 232, 195, 233, 120, 23, 14, 227,
- 25, 240, 18, 250, 230, 232, 195, 240, 19, 23, 14, 227, 25, 240, 18, 250,
- 230, 232, 195, 240, 20, 249, 215, 23, 14, 227, 25, 240, 18, 250, 230,
- 232, 195, 240, 20, 249, 214, 23, 14, 227, 25, 240, 18, 250, 230, 232,
- 195, 240, 20, 249, 213, 23, 14, 250, 246, 23, 14, 245, 227, 252, 45, 251,
- 92, 23, 14, 245, 227, 247, 131, 251, 92, 23, 14, 37, 254, 27, 23, 14,
- 224, 215, 23, 14, 233, 2, 23, 14, 251, 85, 23, 14, 230, 226, 23, 14, 251,
- 87, 23, 14, 226, 101, 23, 14, 232, 240, 23, 14, 232, 241, 247, 20, 23,
- 14, 230, 227, 247, 20, 23, 14, 226, 102, 231, 198, 23, 14, 233, 109, 227,
- 254, 19, 224, 205, 150, 227, 182, 19, 224, 205, 150, 227, 171, 19, 224,
- 205, 150, 227, 161, 19, 224, 205, 150, 227, 154, 19, 224, 205, 150, 227,
- 146, 19, 224, 205, 150, 227, 140, 19, 224, 205, 150, 227, 139, 19, 224,
- 205, 150, 227, 138, 19, 224, 205, 150, 227, 137, 19, 224, 205, 150, 227,
- 181, 19, 224, 205, 150, 227, 180, 19, 224, 205, 150, 227, 179, 19, 224,
- 205, 150, 227, 178, 19, 224, 205, 150, 227, 177, 19, 224, 205, 150, 227,
- 176, 19, 224, 205, 150, 227, 175, 19, 224, 205, 150, 227, 174, 19, 224,
- 205, 150, 227, 173, 19, 224, 205, 150, 227, 172, 19, 224, 205, 150, 227,
- 170, 19, 224, 205, 150, 227, 169, 19, 224, 205, 150, 227, 168, 19, 224,
- 205, 150, 227, 167, 19, 224, 205, 150, 227, 166, 19, 224, 205, 150, 227,
- 145, 19, 224, 205, 150, 227, 144, 19, 224, 205, 150, 227, 143, 19, 224,
- 205, 150, 227, 142, 19, 224, 205, 150, 227, 141, 19, 239, 242, 150, 227,
- 182, 19, 239, 242, 150, 227, 171, 19, 239, 242, 150, 227, 154, 19, 239,
- 242, 150, 227, 146, 19, 239, 242, 150, 227, 139, 19, 239, 242, 150, 227,
- 138, 19, 239, 242, 150, 227, 180, 19, 239, 242, 150, 227, 179, 19, 239,
- 242, 150, 227, 178, 19, 239, 242, 150, 227, 177, 19, 239, 242, 150, 227,
- 174, 19, 239, 242, 150, 227, 173, 19, 239, 242, 150, 227, 172, 19, 239,
- 242, 150, 227, 167, 19, 239, 242, 150, 227, 166, 19, 239, 242, 150, 227,
- 165, 19, 239, 242, 150, 227, 164, 19, 239, 242, 150, 227, 163, 19, 239,
- 242, 150, 227, 162, 19, 239, 242, 150, 227, 160, 19, 239, 242, 150, 227,
- 159, 19, 239, 242, 150, 227, 158, 19, 239, 242, 150, 227, 157, 19, 239,
- 242, 150, 227, 156, 19, 239, 242, 150, 227, 155, 19, 239, 242, 150, 227,
- 153, 19, 239, 242, 150, 227, 152, 19, 239, 242, 150, 227, 151, 19, 239,
- 242, 150, 227, 150, 19, 239, 242, 150, 227, 149, 19, 239, 242, 150, 227,
- 148, 19, 239, 242, 150, 227, 147, 19, 239, 242, 150, 227, 145, 19, 239,
- 242, 150, 227, 144, 19, 239, 242, 150, 227, 143, 19, 239, 242, 150, 227,
- 142, 19, 239, 242, 150, 227, 141, 36, 19, 23, 226, 63, 36, 19, 23, 227,
- 3, 36, 19, 23, 233, 128, 19, 23, 237, 224, 236, 92, 32, 248, 48, 249,
- 227, 32, 245, 111, 248, 48, 249, 227, 32, 244, 139, 248, 48, 249, 227,
- 32, 248, 47, 245, 112, 249, 227, 32, 248, 47, 244, 138, 249, 227, 32,
- 248, 48, 142, 32, 251, 218, 142, 32, 246, 218, 251, 106, 142, 32, 236,
- 116, 142, 32, 253, 27, 142, 32, 239, 0, 228, 184, 142, 32, 251, 19, 142,
- 32, 254, 82, 142, 32, 234, 34, 142, 32, 252, 111, 234, 10, 142, 32, 250,
- 64, 145, 249, 191, 142, 32, 249, 188, 142, 32, 223, 167, 142, 32, 240,
- 12, 142, 32, 233, 133, 142, 32, 231, 243, 142, 32, 251, 29, 142, 32, 244,
- 222, 253, 66, 142, 32, 224, 168, 142, 32, 247, 6, 142, 32, 255, 21, 142,
- 32, 231, 219, 142, 32, 231, 203, 142, 32, 248, 46, 142, 32, 239, 103,
- 142, 32, 251, 24, 142, 32, 247, 232, 142, 32, 248, 83, 142, 32, 251, 194,
- 142, 32, 250, 70, 142, 32, 18, 231, 202, 142, 32, 233, 236, 142, 32, 237,
- 227, 142, 32, 251, 80, 142, 32, 238, 188, 142, 32, 246, 151, 142, 32,
- 228, 28, 142, 32, 232, 163, 142, 32, 246, 217, 142, 32, 231, 204, 142,
- 32, 237, 253, 145, 236, 101, 142, 32, 231, 200, 142, 32, 246, 7, 180,
- 236, 223, 142, 32, 247, 234, 142, 32, 228, 35, 142, 32, 245, 229, 142,
- 32, 247, 227, 142, 32, 233, 162, 142, 32, 231, 132, 142, 32, 247, 19,
- 142, 32, 225, 50, 145, 224, 155, 142, 32, 251, 32, 142, 32, 236, 233,
- 142, 32, 247, 170, 142, 32, 225, 124, 142, 32, 249, 216, 142, 32, 251,
- 82, 236, 72, 142, 32, 245, 214, 142, 32, 246, 152, 240, 16, 142, 32, 237,
- 4, 142, 32, 255, 38, 142, 32, 247, 245, 142, 32, 248, 129, 142, 32, 224,
- 153, 142, 32, 228, 238, 142, 32, 239, 248, 142, 32, 250, 37, 142, 32,
- 250, 134, 142, 32, 249, 212, 142, 32, 247, 147, 142, 32, 229, 158, 142,
- 32, 228, 37, 142, 32, 245, 139, 142, 32, 251, 48, 142, 32, 251, 78, 142,
- 32, 247, 114, 142, 32, 255, 5, 142, 32, 251, 47, 142, 32, 234, 62, 226,
- 240, 225, 33, 142, 32, 249, 235, 142, 32, 238, 36, 142, 32, 246, 244,
- 250, 255, 231, 116, 225, 126, 21, 118, 250, 255, 231, 116, 225, 126, 21,
- 113, 250, 255, 231, 116, 225, 126, 21, 166, 250, 255, 231, 116, 225, 126,
- 21, 158, 250, 255, 231, 116, 225, 126, 21, 173, 250, 255, 231, 116, 225,
- 126, 21, 183, 250, 255, 231, 116, 225, 126, 21, 194, 250, 255, 231, 116,
- 225, 126, 21, 187, 250, 255, 231, 116, 225, 126, 21, 192, 250, 255, 231,
- 116, 227, 22, 21, 118, 250, 255, 231, 116, 227, 22, 21, 113, 250, 255,
- 231, 116, 227, 22, 21, 166, 250, 255, 231, 116, 227, 22, 21, 158, 250,
- 255, 231, 116, 227, 22, 21, 173, 250, 255, 231, 116, 227, 22, 21, 183,
- 250, 255, 231, 116, 227, 22, 21, 194, 250, 255, 231, 116, 227, 22, 21,
- 187, 250, 255, 231, 116, 227, 22, 21, 192, 12, 18, 6, 57, 12, 18, 6, 254,
- 27, 12, 18, 6, 252, 44, 12, 18, 6, 222, 222, 12, 18, 6, 72, 12, 18, 6,
- 247, 130, 12, 18, 6, 214, 12, 18, 6, 212, 12, 18, 6, 74, 12, 18, 6, 239,
- 182, 12, 18, 6, 239, 76, 12, 18, 6, 149, 12, 18, 6, 185, 12, 18, 6, 199,
- 12, 18, 6, 73, 12, 18, 6, 233, 244, 12, 18, 6, 232, 139, 12, 18, 6, 146,
- 12, 18, 6, 193, 12, 18, 6, 227, 109, 12, 18, 6, 66, 12, 18, 6, 196, 12,
- 18, 6, 224, 174, 12, 18, 6, 224, 73, 12, 18, 6, 224, 25, 12, 18, 6, 223,
- 119, 12, 18, 3, 57, 12, 18, 3, 254, 27, 12, 18, 3, 252, 44, 12, 18, 3,
- 222, 222, 12, 18, 3, 72, 12, 18, 3, 247, 130, 12, 18, 3, 214, 12, 18, 3,
- 212, 12, 18, 3, 74, 12, 18, 3, 239, 182, 12, 18, 3, 239, 76, 12, 18, 3,
- 149, 12, 18, 3, 185, 12, 18, 3, 199, 12, 18, 3, 73, 12, 18, 3, 233, 244,
- 12, 18, 3, 232, 139, 12, 18, 3, 146, 12, 18, 3, 193, 12, 18, 3, 227, 109,
- 12, 18, 3, 66, 12, 18, 3, 196, 12, 18, 3, 224, 174, 12, 18, 3, 224, 73,
- 12, 18, 3, 224, 25, 12, 18, 3, 223, 119, 12, 27, 6, 57, 12, 27, 6, 254,
- 27, 12, 27, 6, 252, 44, 12, 27, 6, 222, 222, 12, 27, 6, 72, 12, 27, 6,
- 247, 130, 12, 27, 6, 214, 12, 27, 6, 212, 12, 27, 6, 74, 12, 27, 6, 239,
- 182, 12, 27, 6, 239, 76, 12, 27, 6, 149, 12, 27, 6, 185, 12, 27, 6, 199,
- 12, 27, 6, 73, 12, 27, 6, 233, 244, 12, 27, 6, 232, 139, 12, 27, 6, 146,
- 12, 27, 6, 193, 12, 27, 6, 227, 109, 12, 27, 6, 66, 12, 27, 6, 196, 12,
- 27, 6, 224, 174, 12, 27, 6, 224, 73, 12, 27, 6, 224, 25, 12, 27, 6, 223,
- 119, 12, 27, 3, 57, 12, 27, 3, 254, 27, 12, 27, 3, 252, 44, 12, 27, 3,
- 222, 222, 12, 27, 3, 72, 12, 27, 3, 247, 130, 12, 27, 3, 214, 12, 27, 3,
- 74, 12, 27, 3, 239, 182, 12, 27, 3, 239, 76, 12, 27, 3, 149, 12, 27, 3,
- 185, 12, 27, 3, 199, 12, 27, 3, 73, 12, 27, 3, 233, 244, 12, 27, 3, 232,
- 139, 12, 27, 3, 146, 12, 27, 3, 193, 12, 27, 3, 227, 109, 12, 27, 3, 66,
- 12, 27, 3, 196, 12, 27, 3, 224, 174, 12, 27, 3, 224, 73, 12, 27, 3, 224,
- 25, 12, 27, 3, 223, 119, 12, 18, 27, 6, 57, 12, 18, 27, 6, 254, 27, 12,
- 18, 27, 6, 252, 44, 12, 18, 27, 6, 222, 222, 12, 18, 27, 6, 72, 12, 18,
- 27, 6, 247, 130, 12, 18, 27, 6, 214, 12, 18, 27, 6, 212, 12, 18, 27, 6,
- 74, 12, 18, 27, 6, 239, 182, 12, 18, 27, 6, 239, 76, 12, 18, 27, 6, 149,
- 12, 18, 27, 6, 185, 12, 18, 27, 6, 199, 12, 18, 27, 6, 73, 12, 18, 27, 6,
- 233, 244, 12, 18, 27, 6, 232, 139, 12, 18, 27, 6, 146, 12, 18, 27, 6,
- 193, 12, 18, 27, 6, 227, 109, 12, 18, 27, 6, 66, 12, 18, 27, 6, 196, 12,
- 18, 27, 6, 224, 174, 12, 18, 27, 6, 224, 73, 12, 18, 27, 6, 224, 25, 12,
- 18, 27, 6, 223, 119, 12, 18, 27, 3, 57, 12, 18, 27, 3, 254, 27, 12, 18,
- 27, 3, 252, 44, 12, 18, 27, 3, 222, 222, 12, 18, 27, 3, 72, 12, 18, 27,
- 3, 247, 130, 12, 18, 27, 3, 214, 12, 18, 27, 3, 212, 12, 18, 27, 3, 74,
- 12, 18, 27, 3, 239, 182, 12, 18, 27, 3, 239, 76, 12, 18, 27, 3, 149, 12,
- 18, 27, 3, 185, 12, 18, 27, 3, 199, 12, 18, 27, 3, 73, 12, 18, 27, 3,
- 233, 244, 12, 18, 27, 3, 232, 139, 12, 18, 27, 3, 146, 12, 18, 27, 3,
- 193, 12, 18, 27, 3, 227, 109, 12, 18, 27, 3, 66, 12, 18, 27, 3, 196, 12,
- 18, 27, 3, 224, 174, 12, 18, 27, 3, 224, 73, 12, 18, 27, 3, 224, 25, 12,
- 18, 27, 3, 223, 119, 12, 95, 6, 57, 12, 95, 6, 252, 44, 12, 95, 6, 222,
- 222, 12, 95, 6, 214, 12, 95, 6, 239, 182, 12, 95, 6, 239, 76, 12, 95, 6,
- 199, 12, 95, 6, 73, 12, 95, 6, 233, 244, 12, 95, 6, 232, 139, 12, 95, 6,
- 193, 12, 95, 6, 227, 109, 12, 95, 6, 66, 12, 95, 6, 196, 12, 95, 6, 224,
- 174, 12, 95, 6, 224, 73, 12, 95, 6, 224, 25, 12, 95, 6, 223, 119, 12, 95,
- 3, 57, 12, 95, 3, 254, 27, 12, 95, 3, 252, 44, 12, 95, 3, 222, 222, 12,
- 95, 3, 247, 130, 12, 95, 3, 212, 12, 95, 3, 74, 12, 95, 3, 239, 182, 12,
- 95, 3, 239, 76, 12, 95, 3, 149, 12, 95, 3, 185, 12, 95, 3, 199, 12, 95,
- 3, 233, 244, 12, 95, 3, 232, 139, 12, 95, 3, 146, 12, 95, 3, 193, 12, 95,
- 3, 227, 109, 12, 95, 3, 66, 12, 95, 3, 196, 12, 95, 3, 224, 174, 12, 95,
- 3, 224, 73, 12, 95, 3, 224, 25, 12, 95, 3, 223, 119, 12, 18, 95, 6, 57,
- 12, 18, 95, 6, 254, 27, 12, 18, 95, 6, 252, 44, 12, 18, 95, 6, 222, 222,
- 12, 18, 95, 6, 72, 12, 18, 95, 6, 247, 130, 12, 18, 95, 6, 214, 12, 18,
- 95, 6, 212, 12, 18, 95, 6, 74, 12, 18, 95, 6, 239, 182, 12, 18, 95, 6,
- 239, 76, 12, 18, 95, 6, 149, 12, 18, 95, 6, 185, 12, 18, 95, 6, 199, 12,
- 18, 95, 6, 73, 12, 18, 95, 6, 233, 244, 12, 18, 95, 6, 232, 139, 12, 18,
- 95, 6, 146, 12, 18, 95, 6, 193, 12, 18, 95, 6, 227, 109, 12, 18, 95, 6,
- 66, 12, 18, 95, 6, 196, 12, 18, 95, 6, 224, 174, 12, 18, 95, 6, 224, 73,
- 12, 18, 95, 6, 224, 25, 12, 18, 95, 6, 223, 119, 12, 18, 95, 3, 57, 12,
- 18, 95, 3, 254, 27, 12, 18, 95, 3, 252, 44, 12, 18, 95, 3, 222, 222, 12,
- 18, 95, 3, 72, 12, 18, 95, 3, 247, 130, 12, 18, 95, 3, 214, 12, 18, 95,
- 3, 212, 12, 18, 95, 3, 74, 12, 18, 95, 3, 239, 182, 12, 18, 95, 3, 239,
- 76, 12, 18, 95, 3, 149, 12, 18, 95, 3, 185, 12, 18, 95, 3, 199, 12, 18,
- 95, 3, 73, 12, 18, 95, 3, 233, 244, 12, 18, 95, 3, 232, 139, 12, 18, 95,
- 3, 146, 12, 18, 95, 3, 193, 12, 18, 95, 3, 227, 109, 12, 18, 95, 3, 66,
- 12, 18, 95, 3, 196, 12, 18, 95, 3, 224, 174, 12, 18, 95, 3, 224, 73, 12,
- 18, 95, 3, 224, 25, 12, 18, 95, 3, 223, 119, 12, 110, 6, 57, 12, 110, 6,
- 254, 27, 12, 110, 6, 222, 222, 12, 110, 6, 72, 12, 110, 6, 247, 130, 12,
- 110, 6, 214, 12, 110, 6, 239, 182, 12, 110, 6, 239, 76, 12, 110, 6, 149,
- 12, 110, 6, 185, 12, 110, 6, 199, 12, 110, 6, 73, 12, 110, 6, 233, 244,
- 12, 110, 6, 232, 139, 12, 110, 6, 193, 12, 110, 6, 227, 109, 12, 110, 6,
- 66, 12, 110, 6, 196, 12, 110, 6, 224, 174, 12, 110, 6, 224, 73, 12, 110,
- 6, 224, 25, 12, 110, 3, 57, 12, 110, 3, 254, 27, 12, 110, 3, 252, 44, 12,
- 110, 3, 222, 222, 12, 110, 3, 72, 12, 110, 3, 247, 130, 12, 110, 3, 214,
- 12, 110, 3, 212, 12, 110, 3, 74, 12, 110, 3, 239, 182, 12, 110, 3, 239,
- 76, 12, 110, 3, 149, 12, 110, 3, 185, 12, 110, 3, 199, 12, 110, 3, 73,
- 12, 110, 3, 233, 244, 12, 110, 3, 232, 139, 12, 110, 3, 146, 12, 110, 3,
- 193, 12, 110, 3, 227, 109, 12, 110, 3, 66, 12, 110, 3, 196, 12, 110, 3,
- 224, 174, 12, 110, 3, 224, 73, 12, 110, 3, 224, 25, 12, 110, 3, 223, 119,
- 12, 159, 6, 57, 12, 159, 6, 254, 27, 12, 159, 6, 222, 222, 12, 159, 6,
- 72, 12, 159, 6, 247, 130, 12, 159, 6, 214, 12, 159, 6, 74, 12, 159, 6,
- 239, 182, 12, 159, 6, 239, 76, 12, 159, 6, 149, 12, 159, 6, 185, 12, 159,
- 6, 73, 12, 159, 6, 193, 12, 159, 6, 227, 109, 12, 159, 6, 66, 12, 159, 6,
- 196, 12, 159, 6, 224, 174, 12, 159, 6, 224, 73, 12, 159, 6, 224, 25, 12,
- 159, 3, 57, 12, 159, 3, 254, 27, 12, 159, 3, 252, 44, 12, 159, 3, 222,
- 222, 12, 159, 3, 72, 12, 159, 3, 247, 130, 12, 159, 3, 214, 12, 159, 3,
- 212, 12, 159, 3, 74, 12, 159, 3, 239, 182, 12, 159, 3, 239, 76, 12, 159,
- 3, 149, 12, 159, 3, 185, 12, 159, 3, 199, 12, 159, 3, 73, 12, 159, 3,
- 233, 244, 12, 159, 3, 232, 139, 12, 159, 3, 146, 12, 159, 3, 193, 12,
- 159, 3, 227, 109, 12, 159, 3, 66, 12, 159, 3, 196, 12, 159, 3, 224, 174,
- 12, 159, 3, 224, 73, 12, 159, 3, 224, 25, 12, 159, 3, 223, 119, 12, 18,
- 110, 6, 57, 12, 18, 110, 6, 254, 27, 12, 18, 110, 6, 252, 44, 12, 18,
- 110, 6, 222, 222, 12, 18, 110, 6, 72, 12, 18, 110, 6, 247, 130, 12, 18,
- 110, 6, 214, 12, 18, 110, 6, 212, 12, 18, 110, 6, 74, 12, 18, 110, 6,
- 239, 182, 12, 18, 110, 6, 239, 76, 12, 18, 110, 6, 149, 12, 18, 110, 6,
- 185, 12, 18, 110, 6, 199, 12, 18, 110, 6, 73, 12, 18, 110, 6, 233, 244,
- 12, 18, 110, 6, 232, 139, 12, 18, 110, 6, 146, 12, 18, 110, 6, 193, 12,
- 18, 110, 6, 227, 109, 12, 18, 110, 6, 66, 12, 18, 110, 6, 196, 12, 18,
- 110, 6, 224, 174, 12, 18, 110, 6, 224, 73, 12, 18, 110, 6, 224, 25, 12,
- 18, 110, 6, 223, 119, 12, 18, 110, 3, 57, 12, 18, 110, 3, 254, 27, 12,
- 18, 110, 3, 252, 44, 12, 18, 110, 3, 222, 222, 12, 18, 110, 3, 72, 12,
- 18, 110, 3, 247, 130, 12, 18, 110, 3, 214, 12, 18, 110, 3, 212, 12, 18,
- 110, 3, 74, 12, 18, 110, 3, 239, 182, 12, 18, 110, 3, 239, 76, 12, 18,
- 110, 3, 149, 12, 18, 110, 3, 185, 12, 18, 110, 3, 199, 12, 18, 110, 3,
- 73, 12, 18, 110, 3, 233, 244, 12, 18, 110, 3, 232, 139, 12, 18, 110, 3,
- 146, 12, 18, 110, 3, 193, 12, 18, 110, 3, 227, 109, 12, 18, 110, 3, 66,
- 12, 18, 110, 3, 196, 12, 18, 110, 3, 224, 174, 12, 18, 110, 3, 224, 73,
- 12, 18, 110, 3, 224, 25, 12, 18, 110, 3, 223, 119, 12, 30, 6, 57, 12, 30,
- 6, 254, 27, 12, 30, 6, 252, 44, 12, 30, 6, 222, 222, 12, 30, 6, 72, 12,
- 30, 6, 247, 130, 12, 30, 6, 214, 12, 30, 6, 212, 12, 30, 6, 74, 12, 30,
- 6, 239, 182, 12, 30, 6, 239, 76, 12, 30, 6, 149, 12, 30, 6, 185, 12, 30,
- 6, 199, 12, 30, 6, 73, 12, 30, 6, 233, 244, 12, 30, 6, 232, 139, 12, 30,
- 6, 146, 12, 30, 6, 193, 12, 30, 6, 227, 109, 12, 30, 6, 66, 12, 30, 6,
- 196, 12, 30, 6, 224, 174, 12, 30, 6, 224, 73, 12, 30, 6, 224, 25, 12, 30,
- 6, 223, 119, 12, 30, 3, 57, 12, 30, 3, 254, 27, 12, 30, 3, 252, 44, 12,
- 30, 3, 222, 222, 12, 30, 3, 72, 12, 30, 3, 247, 130, 12, 30, 3, 214, 12,
- 30, 3, 212, 12, 30, 3, 74, 12, 30, 3, 239, 182, 12, 30, 3, 239, 76, 12,
- 30, 3, 149, 12, 30, 3, 185, 12, 30, 3, 199, 12, 30, 3, 73, 12, 30, 3,
- 233, 244, 12, 30, 3, 232, 139, 12, 30, 3, 146, 12, 30, 3, 193, 12, 30, 3,
- 227, 109, 12, 30, 3, 66, 12, 30, 3, 196, 12, 30, 3, 224, 174, 12, 30, 3,
- 224, 73, 12, 30, 3, 224, 25, 12, 30, 3, 223, 119, 12, 30, 18, 6, 57, 12,
- 30, 18, 6, 254, 27, 12, 30, 18, 6, 252, 44, 12, 30, 18, 6, 222, 222, 12,
- 30, 18, 6, 72, 12, 30, 18, 6, 247, 130, 12, 30, 18, 6, 214, 12, 30, 18,
- 6, 212, 12, 30, 18, 6, 74, 12, 30, 18, 6, 239, 182, 12, 30, 18, 6, 239,
- 76, 12, 30, 18, 6, 149, 12, 30, 18, 6, 185, 12, 30, 18, 6, 199, 12, 30,
- 18, 6, 73, 12, 30, 18, 6, 233, 244, 12, 30, 18, 6, 232, 139, 12, 30, 18,
- 6, 146, 12, 30, 18, 6, 193, 12, 30, 18, 6, 227, 109, 12, 30, 18, 6, 66,
- 12, 30, 18, 6, 196, 12, 30, 18, 6, 224, 174, 12, 30, 18, 6, 224, 73, 12,
- 30, 18, 6, 224, 25, 12, 30, 18, 6, 223, 119, 12, 30, 18, 3, 57, 12, 30,
- 18, 3, 254, 27, 12, 30, 18, 3, 252, 44, 12, 30, 18, 3, 222, 222, 12, 30,
- 18, 3, 72, 12, 30, 18, 3, 247, 130, 12, 30, 18, 3, 214, 12, 30, 18, 3,
- 212, 12, 30, 18, 3, 74, 12, 30, 18, 3, 239, 182, 12, 30, 18, 3, 239, 76,
- 12, 30, 18, 3, 149, 12, 30, 18, 3, 185, 12, 30, 18, 3, 199, 12, 30, 18,
- 3, 73, 12, 30, 18, 3, 233, 244, 12, 30, 18, 3, 232, 139, 12, 30, 18, 3,
- 146, 12, 30, 18, 3, 193, 12, 30, 18, 3, 227, 109, 12, 30, 18, 3, 66, 12,
- 30, 18, 3, 196, 12, 30, 18, 3, 224, 174, 12, 30, 18, 3, 224, 73, 12, 30,
- 18, 3, 224, 25, 12, 30, 18, 3, 223, 119, 12, 30, 27, 6, 57, 12, 30, 27,
- 6, 254, 27, 12, 30, 27, 6, 252, 44, 12, 30, 27, 6, 222, 222, 12, 30, 27,
- 6, 72, 12, 30, 27, 6, 247, 130, 12, 30, 27, 6, 214, 12, 30, 27, 6, 212,
- 12, 30, 27, 6, 74, 12, 30, 27, 6, 239, 182, 12, 30, 27, 6, 239, 76, 12,
- 30, 27, 6, 149, 12, 30, 27, 6, 185, 12, 30, 27, 6, 199, 12, 30, 27, 6,
- 73, 12, 30, 27, 6, 233, 244, 12, 30, 27, 6, 232, 139, 12, 30, 27, 6, 146,
- 12, 30, 27, 6, 193, 12, 30, 27, 6, 227, 109, 12, 30, 27, 6, 66, 12, 30,
- 27, 6, 196, 12, 30, 27, 6, 224, 174, 12, 30, 27, 6, 224, 73, 12, 30, 27,
- 6, 224, 25, 12, 30, 27, 6, 223, 119, 12, 30, 27, 3, 57, 12, 30, 27, 3,
- 254, 27, 12, 30, 27, 3, 252, 44, 12, 30, 27, 3, 222, 222, 12, 30, 27, 3,
- 72, 12, 30, 27, 3, 247, 130, 12, 30, 27, 3, 214, 12, 30, 27, 3, 212, 12,
- 30, 27, 3, 74, 12, 30, 27, 3, 239, 182, 12, 30, 27, 3, 239, 76, 12, 30,
- 27, 3, 149, 12, 30, 27, 3, 185, 12, 30, 27, 3, 199, 12, 30, 27, 3, 73,
- 12, 30, 27, 3, 233, 244, 12, 30, 27, 3, 232, 139, 12, 30, 27, 3, 146, 12,
- 30, 27, 3, 193, 12, 30, 27, 3, 227, 109, 12, 30, 27, 3, 66, 12, 30, 27,
- 3, 196, 12, 30, 27, 3, 224, 174, 12, 30, 27, 3, 224, 73, 12, 30, 27, 3,
- 224, 25, 12, 30, 27, 3, 223, 119, 12, 30, 18, 27, 6, 57, 12, 30, 18, 27,
- 6, 254, 27, 12, 30, 18, 27, 6, 252, 44, 12, 30, 18, 27, 6, 222, 222, 12,
- 30, 18, 27, 6, 72, 12, 30, 18, 27, 6, 247, 130, 12, 30, 18, 27, 6, 214,
- 12, 30, 18, 27, 6, 212, 12, 30, 18, 27, 6, 74, 12, 30, 18, 27, 6, 239,
- 182, 12, 30, 18, 27, 6, 239, 76, 12, 30, 18, 27, 6, 149, 12, 30, 18, 27,
- 6, 185, 12, 30, 18, 27, 6, 199, 12, 30, 18, 27, 6, 73, 12, 30, 18, 27, 6,
- 233, 244, 12, 30, 18, 27, 6, 232, 139, 12, 30, 18, 27, 6, 146, 12, 30,
- 18, 27, 6, 193, 12, 30, 18, 27, 6, 227, 109, 12, 30, 18, 27, 6, 66, 12,
- 30, 18, 27, 6, 196, 12, 30, 18, 27, 6, 224, 174, 12, 30, 18, 27, 6, 224,
- 73, 12, 30, 18, 27, 6, 224, 25, 12, 30, 18, 27, 6, 223, 119, 12, 30, 18,
- 27, 3, 57, 12, 30, 18, 27, 3, 254, 27, 12, 30, 18, 27, 3, 252, 44, 12,
- 30, 18, 27, 3, 222, 222, 12, 30, 18, 27, 3, 72, 12, 30, 18, 27, 3, 247,
- 130, 12, 30, 18, 27, 3, 214, 12, 30, 18, 27, 3, 212, 12, 30, 18, 27, 3,
- 74, 12, 30, 18, 27, 3, 239, 182, 12, 30, 18, 27, 3, 239, 76, 12, 30, 18,
- 27, 3, 149, 12, 30, 18, 27, 3, 185, 12, 30, 18, 27, 3, 199, 12, 30, 18,
- 27, 3, 73, 12, 30, 18, 27, 3, 233, 244, 12, 30, 18, 27, 3, 232, 139, 12,
- 30, 18, 27, 3, 146, 12, 30, 18, 27, 3, 193, 12, 30, 18, 27, 3, 227, 109,
- 12, 30, 18, 27, 3, 66, 12, 30, 18, 27, 3, 196, 12, 30, 18, 27, 3, 224,
- 174, 12, 30, 18, 27, 3, 224, 73, 12, 30, 18, 27, 3, 224, 25, 12, 30, 18,
- 27, 3, 223, 119, 12, 189, 6, 57, 12, 189, 6, 254, 27, 12, 189, 6, 252,
- 44, 12, 189, 6, 222, 222, 12, 189, 6, 72, 12, 189, 6, 247, 130, 12, 189,
- 6, 214, 12, 189, 6, 212, 12, 189, 6, 74, 12, 189, 6, 239, 182, 12, 189,
- 6, 239, 76, 12, 189, 6, 149, 12, 189, 6, 185, 12, 189, 6, 199, 12, 189,
- 6, 73, 12, 189, 6, 233, 244, 12, 189, 6, 232, 139, 12, 189, 6, 146, 12,
- 189, 6, 193, 12, 189, 6, 227, 109, 12, 189, 6, 66, 12, 189, 6, 196, 12,
- 189, 6, 224, 174, 12, 189, 6, 224, 73, 12, 189, 6, 224, 25, 12, 189, 6,
- 223, 119, 12, 189, 3, 57, 12, 189, 3, 254, 27, 12, 189, 3, 252, 44, 12,
- 189, 3, 222, 222, 12, 189, 3, 72, 12, 189, 3, 247, 130, 12, 189, 3, 214,
- 12, 189, 3, 212, 12, 189, 3, 74, 12, 189, 3, 239, 182, 12, 189, 3, 239,
- 76, 12, 189, 3, 149, 12, 189, 3, 185, 12, 189, 3, 199, 12, 189, 3, 73,
- 12, 189, 3, 233, 244, 12, 189, 3, 232, 139, 12, 189, 3, 146, 12, 189, 3,
- 193, 12, 189, 3, 227, 109, 12, 189, 3, 66, 12, 189, 3, 196, 12, 189, 3,
- 224, 174, 12, 189, 3, 224, 73, 12, 189, 3, 224, 25, 12, 189, 3, 223, 119,
- 12, 27, 3, 249, 139, 74, 12, 27, 3, 249, 139, 239, 182, 12, 18, 6, 254,
- 205, 12, 18, 6, 252, 198, 12, 18, 6, 246, 169, 12, 18, 6, 250, 47, 12,
- 18, 6, 247, 206, 12, 18, 6, 223, 88, 12, 18, 6, 247, 171, 12, 18, 6, 226,
- 223, 12, 18, 6, 239, 215, 12, 18, 6, 239, 35, 12, 18, 6, 238, 16, 12, 18,
- 6, 236, 66, 12, 18, 6, 234, 206, 12, 18, 6, 224, 64, 12, 18, 6, 234, 64,
- 12, 18, 6, 233, 69, 12, 18, 6, 231, 182, 12, 18, 6, 226, 224, 98, 12, 18,
- 6, 229, 2, 12, 18, 6, 227, 61, 12, 18, 6, 225, 110, 12, 18, 6, 233, 87,
- 12, 18, 6, 251, 169, 12, 18, 6, 232, 183, 12, 18, 6, 234, 66, 12, 18,
- 235, 250, 12, 18, 3, 254, 205, 12, 18, 3, 252, 198, 12, 18, 3, 246, 169,
- 12, 18, 3, 250, 47, 12, 18, 3, 247, 206, 12, 18, 3, 223, 88, 12, 18, 3,
- 247, 171, 12, 18, 3, 226, 223, 12, 18, 3, 239, 215, 12, 18, 3, 239, 35,
- 12, 18, 3, 238, 16, 12, 18, 3, 236, 66, 12, 18, 3, 234, 206, 12, 18, 3,
- 224, 64, 12, 18, 3, 234, 64, 12, 18, 3, 233, 69, 12, 18, 3, 231, 182, 12,
- 18, 3, 35, 229, 2, 12, 18, 3, 229, 2, 12, 18, 3, 227, 61, 12, 18, 3, 225,
- 110, 12, 18, 3, 233, 87, 12, 18, 3, 251, 169, 12, 18, 3, 232, 183, 12,
- 18, 3, 234, 66, 12, 18, 233, 175, 249, 236, 12, 18, 247, 207, 98, 12, 18,
- 226, 224, 98, 12, 18, 239, 36, 98, 12, 18, 233, 88, 98, 12, 18, 231, 183,
- 98, 12, 18, 233, 70, 98, 12, 27, 6, 254, 205, 12, 27, 6, 252, 198, 12,
- 27, 6, 246, 169, 12, 27, 6, 250, 47, 12, 27, 6, 247, 206, 12, 27, 6, 223,
- 88, 12, 27, 6, 247, 171, 12, 27, 6, 226, 223, 12, 27, 6, 239, 215, 12,
- 27, 6, 239, 35, 12, 27, 6, 238, 16, 12, 27, 6, 236, 66, 12, 27, 6, 234,
- 206, 12, 27, 6, 224, 64, 12, 27, 6, 234, 64, 12, 27, 6, 233, 69, 12, 27,
- 6, 231, 182, 12, 27, 6, 226, 224, 98, 12, 27, 6, 229, 2, 12, 27, 6, 227,
- 61, 12, 27, 6, 225, 110, 12, 27, 6, 233, 87, 12, 27, 6, 251, 169, 12, 27,
- 6, 232, 183, 12, 27, 6, 234, 66, 12, 27, 235, 250, 12, 27, 3, 254, 205,
- 12, 27, 3, 252, 198, 12, 27, 3, 246, 169, 12, 27, 3, 250, 47, 12, 27, 3,
- 247, 206, 12, 27, 3, 223, 88, 12, 27, 3, 247, 171, 12, 27, 3, 226, 223,
- 12, 27, 3, 239, 215, 12, 27, 3, 239, 35, 12, 27, 3, 238, 16, 12, 27, 3,
- 236, 66, 12, 27, 3, 234, 206, 12, 27, 3, 224, 64, 12, 27, 3, 234, 64, 12,
- 27, 3, 233, 69, 12, 27, 3, 231, 182, 12, 27, 3, 35, 229, 2, 12, 27, 3,
- 229, 2, 12, 27, 3, 227, 61, 12, 27, 3, 225, 110, 12, 27, 3, 233, 87, 12,
- 27, 3, 251, 169, 12, 27, 3, 232, 183, 12, 27, 3, 234, 66, 12, 27, 233,
- 175, 249, 236, 12, 27, 247, 207, 98, 12, 27, 226, 224, 98, 12, 27, 239,
- 36, 98, 12, 27, 233, 88, 98, 12, 27, 231, 183, 98, 12, 27, 233, 70, 98,
- 12, 18, 27, 6, 254, 205, 12, 18, 27, 6, 252, 198, 12, 18, 27, 6, 246,
- 169, 12, 18, 27, 6, 250, 47, 12, 18, 27, 6, 247, 206, 12, 18, 27, 6, 223,
- 88, 12, 18, 27, 6, 247, 171, 12, 18, 27, 6, 226, 223, 12, 18, 27, 6, 239,
- 215, 12, 18, 27, 6, 239, 35, 12, 18, 27, 6, 238, 16, 12, 18, 27, 6, 236,
- 66, 12, 18, 27, 6, 234, 206, 12, 18, 27, 6, 224, 64, 12, 18, 27, 6, 234,
- 64, 12, 18, 27, 6, 233, 69, 12, 18, 27, 6, 231, 182, 12, 18, 27, 6, 226,
- 224, 98, 12, 18, 27, 6, 229, 2, 12, 18, 27, 6, 227, 61, 12, 18, 27, 6,
- 225, 110, 12, 18, 27, 6, 233, 87, 12, 18, 27, 6, 251, 169, 12, 18, 27, 6,
- 232, 183, 12, 18, 27, 6, 234, 66, 12, 18, 27, 235, 250, 12, 18, 27, 3,
- 254, 205, 12, 18, 27, 3, 252, 198, 12, 18, 27, 3, 246, 169, 12, 18, 27,
- 3, 250, 47, 12, 18, 27, 3, 247, 206, 12, 18, 27, 3, 223, 88, 12, 18, 27,
- 3, 247, 171, 12, 18, 27, 3, 226, 223, 12, 18, 27, 3, 239, 215, 12, 18,
- 27, 3, 239, 35, 12, 18, 27, 3, 238, 16, 12, 18, 27, 3, 236, 66, 12, 18,
- 27, 3, 234, 206, 12, 18, 27, 3, 224, 64, 12, 18, 27, 3, 234, 64, 12, 18,
- 27, 3, 233, 69, 12, 18, 27, 3, 231, 182, 12, 18, 27, 3, 35, 229, 2, 12,
- 18, 27, 3, 229, 2, 12, 18, 27, 3, 227, 61, 12, 18, 27, 3, 225, 110, 12,
- 18, 27, 3, 233, 87, 12, 18, 27, 3, 251, 169, 12, 18, 27, 3, 232, 183, 12,
- 18, 27, 3, 234, 66, 12, 18, 27, 233, 175, 249, 236, 12, 18, 27, 247, 207,
- 98, 12, 18, 27, 226, 224, 98, 12, 18, 27, 239, 36, 98, 12, 18, 27, 233,
- 88, 98, 12, 18, 27, 231, 183, 98, 12, 18, 27, 233, 70, 98, 12, 30, 18, 6,
- 254, 205, 12, 30, 18, 6, 252, 198, 12, 30, 18, 6, 246, 169, 12, 30, 18,
- 6, 250, 47, 12, 30, 18, 6, 247, 206, 12, 30, 18, 6, 223, 88, 12, 30, 18,
- 6, 247, 171, 12, 30, 18, 6, 226, 223, 12, 30, 18, 6, 239, 215, 12, 30,
- 18, 6, 239, 35, 12, 30, 18, 6, 238, 16, 12, 30, 18, 6, 236, 66, 12, 30,
- 18, 6, 234, 206, 12, 30, 18, 6, 224, 64, 12, 30, 18, 6, 234, 64, 12, 30,
- 18, 6, 233, 69, 12, 30, 18, 6, 231, 182, 12, 30, 18, 6, 226, 224, 98, 12,
- 30, 18, 6, 229, 2, 12, 30, 18, 6, 227, 61, 12, 30, 18, 6, 225, 110, 12,
- 30, 18, 6, 233, 87, 12, 30, 18, 6, 251, 169, 12, 30, 18, 6, 232, 183, 12,
- 30, 18, 6, 234, 66, 12, 30, 18, 235, 250, 12, 30, 18, 3, 254, 205, 12,
- 30, 18, 3, 252, 198, 12, 30, 18, 3, 246, 169, 12, 30, 18, 3, 250, 47, 12,
- 30, 18, 3, 247, 206, 12, 30, 18, 3, 223, 88, 12, 30, 18, 3, 247, 171, 12,
- 30, 18, 3, 226, 223, 12, 30, 18, 3, 239, 215, 12, 30, 18, 3, 239, 35, 12,
- 30, 18, 3, 238, 16, 12, 30, 18, 3, 236, 66, 12, 30, 18, 3, 234, 206, 12,
- 30, 18, 3, 224, 64, 12, 30, 18, 3, 234, 64, 12, 30, 18, 3, 233, 69, 12,
- 30, 18, 3, 231, 182, 12, 30, 18, 3, 35, 229, 2, 12, 30, 18, 3, 229, 2,
- 12, 30, 18, 3, 227, 61, 12, 30, 18, 3, 225, 110, 12, 30, 18, 3, 233, 87,
- 12, 30, 18, 3, 251, 169, 12, 30, 18, 3, 232, 183, 12, 30, 18, 3, 234, 66,
- 12, 30, 18, 233, 175, 249, 236, 12, 30, 18, 247, 207, 98, 12, 30, 18,
- 226, 224, 98, 12, 30, 18, 239, 36, 98, 12, 30, 18, 233, 88, 98, 12, 30,
- 18, 231, 183, 98, 12, 30, 18, 233, 70, 98, 12, 30, 18, 27, 6, 254, 205,
- 12, 30, 18, 27, 6, 252, 198, 12, 30, 18, 27, 6, 246, 169, 12, 30, 18, 27,
- 6, 250, 47, 12, 30, 18, 27, 6, 247, 206, 12, 30, 18, 27, 6, 223, 88, 12,
- 30, 18, 27, 6, 247, 171, 12, 30, 18, 27, 6, 226, 223, 12, 30, 18, 27, 6,
- 239, 215, 12, 30, 18, 27, 6, 239, 35, 12, 30, 18, 27, 6, 238, 16, 12, 30,
- 18, 27, 6, 236, 66, 12, 30, 18, 27, 6, 234, 206, 12, 30, 18, 27, 6, 224,
- 64, 12, 30, 18, 27, 6, 234, 64, 12, 30, 18, 27, 6, 233, 69, 12, 30, 18,
- 27, 6, 231, 182, 12, 30, 18, 27, 6, 226, 224, 98, 12, 30, 18, 27, 6, 229,
- 2, 12, 30, 18, 27, 6, 227, 61, 12, 30, 18, 27, 6, 225, 110, 12, 30, 18,
- 27, 6, 233, 87, 12, 30, 18, 27, 6, 251, 169, 12, 30, 18, 27, 6, 232, 183,
- 12, 30, 18, 27, 6, 234, 66, 12, 30, 18, 27, 235, 250, 12, 30, 18, 27, 3,
- 254, 205, 12, 30, 18, 27, 3, 252, 198, 12, 30, 18, 27, 3, 246, 169, 12,
- 30, 18, 27, 3, 250, 47, 12, 30, 18, 27, 3, 247, 206, 12, 30, 18, 27, 3,
- 223, 88, 12, 30, 18, 27, 3, 247, 171, 12, 30, 18, 27, 3, 226, 223, 12,
- 30, 18, 27, 3, 239, 215, 12, 30, 18, 27, 3, 239, 35, 12, 30, 18, 27, 3,
- 238, 16, 12, 30, 18, 27, 3, 236, 66, 12, 30, 18, 27, 3, 234, 206, 12, 30,
- 18, 27, 3, 224, 64, 12, 30, 18, 27, 3, 234, 64, 12, 30, 18, 27, 3, 233,
- 69, 12, 30, 18, 27, 3, 231, 182, 12, 30, 18, 27, 3, 35, 229, 2, 12, 30,
- 18, 27, 3, 229, 2, 12, 30, 18, 27, 3, 227, 61, 12, 30, 18, 27, 3, 225,
- 110, 12, 30, 18, 27, 3, 233, 87, 12, 30, 18, 27, 3, 251, 169, 12, 30, 18,
- 27, 3, 232, 183, 12, 30, 18, 27, 3, 234, 66, 12, 30, 18, 27, 233, 175,
- 249, 236, 12, 30, 18, 27, 247, 207, 98, 12, 30, 18, 27, 226, 224, 98, 12,
- 30, 18, 27, 239, 36, 98, 12, 30, 18, 27, 233, 88, 98, 12, 30, 18, 27,
- 231, 183, 98, 12, 30, 18, 27, 233, 70, 98, 12, 18, 6, 249, 230, 12, 18,
- 3, 249, 230, 12, 18, 21, 223, 89, 12, 18, 21, 118, 12, 18, 21, 113, 12,
- 18, 21, 166, 12, 18, 21, 158, 12, 18, 21, 173, 12, 18, 21, 183, 12, 18,
- 21, 194, 12, 18, 21, 187, 12, 18, 21, 192, 12, 159, 21, 223, 89, 12, 159,
- 21, 118, 12, 159, 21, 113, 12, 159, 21, 166, 12, 159, 21, 158, 12, 159,
- 21, 173, 12, 159, 21, 183, 12, 159, 21, 194, 12, 159, 21, 187, 12, 159,
- 21, 192, 12, 30, 21, 223, 89, 12, 30, 21, 118, 12, 30, 21, 113, 12, 30,
- 21, 166, 12, 30, 21, 158, 12, 30, 21, 173, 12, 30, 21, 183, 12, 30, 21,
- 194, 12, 30, 21, 187, 12, 30, 21, 192, 12, 30, 18, 21, 223, 89, 12, 30,
- 18, 21, 118, 12, 30, 18, 21, 113, 12, 30, 18, 21, 166, 12, 30, 18, 21,
- 158, 12, 30, 18, 21, 173, 12, 30, 18, 21, 183, 12, 30, 18, 21, 194, 12,
- 30, 18, 21, 187, 12, 30, 18, 21, 192, 12, 189, 21, 223, 89, 12, 189, 21,
- 118, 12, 189, 21, 113, 12, 189, 21, 166, 12, 189, 21, 158, 12, 189, 21,
- 173, 12, 189, 21, 183, 12, 189, 21, 194, 12, 189, 21, 187, 12, 189, 21,
- 192, 237, 50, 75, 248, 45, 224, 111, 237, 50, 75, 228, 152, 224, 111,
- 237, 50, 75, 224, 131, 224, 111, 237, 50, 75, 234, 245, 224, 111, 237,
- 50, 75, 231, 231, 248, 118, 237, 50, 75, 245, 228, 248, 118, 237, 50, 75,
- 63, 248, 118, 237, 50, 75, 168, 106, 251, 190, 237, 50, 75, 135, 106,
- 251, 190, 237, 50, 75, 152, 106, 251, 190, 237, 50, 75, 246, 243, 106,
- 251, 190, 237, 50, 75, 247, 37, 106, 251, 190, 237, 50, 75, 228, 217,
- 106, 251, 190, 237, 50, 75, 229, 163, 106, 251, 190, 237, 50, 75, 248,
- 20, 106, 251, 190, 237, 50, 75, 235, 61, 106, 251, 190, 237, 50, 75, 168,
- 106, 253, 45, 237, 50, 75, 135, 106, 253, 45, 237, 50, 75, 152, 106, 253,
- 45, 237, 50, 75, 246, 243, 106, 253, 45, 237, 50, 75, 247, 37, 106, 253,
- 45, 237, 50, 75, 228, 217, 106, 253, 45, 237, 50, 75, 229, 163, 106, 253,
- 45, 237, 50, 75, 248, 20, 106, 253, 45, 237, 50, 75, 235, 61, 106, 253,
- 45, 237, 50, 75, 168, 106, 251, 105, 237, 50, 75, 135, 106, 251, 105,
- 237, 50, 75, 152, 106, 251, 105, 237, 50, 75, 246, 243, 106, 251, 105,
- 237, 50, 75, 247, 37, 106, 251, 105, 237, 50, 75, 228, 217, 106, 251,
- 105, 237, 50, 75, 229, 163, 106, 251, 105, 237, 50, 75, 248, 20, 106,
- 251, 105, 237, 50, 75, 235, 61, 106, 251, 105, 237, 50, 75, 233, 12, 237,
- 50, 75, 234, 30, 237, 50, 75, 253, 46, 237, 50, 75, 251, 137, 237, 50,
- 75, 228, 125, 237, 50, 75, 227, 229, 237, 50, 75, 254, 44, 237, 50, 75,
- 224, 107, 237, 50, 75, 239, 111, 237, 50, 75, 253, 66, 109, 75, 169, 253,
- 66, 109, 75, 244, 211, 109, 75, 244, 210, 109, 75, 244, 209, 109, 75,
- 244, 208, 109, 75, 244, 207, 109, 75, 244, 206, 109, 75, 244, 205, 109,
- 75, 244, 204, 109, 75, 244, 203, 109, 75, 244, 202, 109, 75, 244, 201,
- 109, 75, 244, 200, 109, 75, 244, 199, 109, 75, 244, 198, 109, 75, 244,
- 197, 109, 75, 244, 196, 109, 75, 244, 195, 109, 75, 244, 194, 109, 75,
- 244, 193, 109, 75, 244, 192, 109, 75, 244, 191, 109, 75, 244, 190, 109,
- 75, 244, 189, 109, 75, 244, 188, 109, 75, 244, 187, 109, 75, 244, 186,
- 109, 75, 244, 185, 109, 75, 244, 184, 109, 75, 244, 183, 109, 75, 244,
- 182, 109, 75, 244, 181, 109, 75, 244, 180, 109, 75, 244, 179, 109, 75,
- 244, 178, 109, 75, 244, 177, 109, 75, 244, 176, 109, 75, 244, 175, 109,
- 75, 244, 174, 109, 75, 244, 173, 109, 75, 244, 172, 109, 75, 244, 171,
- 109, 75, 244, 170, 109, 75, 244, 169, 109, 75, 244, 168, 109, 75, 244,
- 167, 109, 75, 244, 166, 109, 75, 244, 165, 109, 75, 244, 164, 109, 75,
- 244, 163, 109, 75, 61, 253, 66, 109, 75, 225, 29, 109, 75, 225, 28, 109,
- 75, 225, 27, 109, 75, 225, 26, 109, 75, 225, 25, 109, 75, 225, 24, 109,
- 75, 225, 23, 109, 75, 225, 22, 109, 75, 225, 21, 109, 75, 225, 20, 109,
- 75, 225, 19, 109, 75, 225, 18, 109, 75, 225, 17, 109, 75, 225, 16, 109,
- 75, 225, 15, 109, 75, 225, 14, 109, 75, 225, 13, 109, 75, 225, 12, 109,
- 75, 225, 11, 109, 75, 225, 10, 109, 75, 225, 9, 109, 75, 225, 8, 109, 75,
- 225, 7, 109, 75, 225, 6, 109, 75, 225, 5, 109, 75, 225, 4, 109, 75, 225,
- 3, 109, 75, 225, 2, 109, 75, 225, 1, 109, 75, 225, 0, 109, 75, 224, 255,
- 109, 75, 224, 254, 109, 75, 224, 253, 109, 75, 224, 252, 109, 75, 224,
- 251, 109, 75, 224, 250, 109, 75, 224, 249, 109, 75, 224, 248, 109, 75,
- 224, 247, 109, 75, 224, 246, 109, 75, 224, 245, 109, 75, 224, 244, 109,
- 75, 224, 243, 109, 75, 224, 242, 109, 75, 224, 241, 109, 75, 224, 240,
- 109, 75, 224, 239, 109, 75, 224, 238, 109, 75, 224, 237, 9, 11, 244, 61,
- 9, 11, 244, 60, 9, 11, 244, 59, 9, 11, 244, 58, 9, 11, 244, 57, 9, 11,
- 244, 56, 9, 11, 244, 55, 9, 11, 244, 54, 9, 11, 244, 53, 9, 11, 244, 52,
- 9, 11, 244, 51, 9, 11, 244, 50, 9, 11, 244, 49, 9, 11, 244, 48, 9, 11,
- 244, 47, 9, 11, 244, 46, 9, 11, 244, 45, 9, 11, 244, 44, 9, 11, 244, 43,
- 9, 11, 244, 42, 9, 11, 244, 41, 9, 11, 244, 40, 9, 11, 244, 39, 9, 11,
- 244, 38, 9, 11, 244, 37, 9, 11, 244, 36, 9, 11, 244, 35, 9, 11, 244, 34,
- 9, 11, 244, 33, 9, 11, 244, 32, 9, 11, 244, 31, 9, 11, 244, 30, 9, 11,
- 244, 29, 9, 11, 244, 28, 9, 11, 244, 27, 9, 11, 244, 26, 9, 11, 244, 25,
- 9, 11, 244, 24, 9, 11, 244, 23, 9, 11, 244, 22, 9, 11, 244, 21, 9, 11,
- 244, 20, 9, 11, 244, 19, 9, 11, 244, 18, 9, 11, 244, 17, 9, 11, 244, 16,
- 9, 11, 244, 15, 9, 11, 244, 14, 9, 11, 244, 13, 9, 11, 244, 12, 9, 11,
- 244, 11, 9, 11, 244, 10, 9, 11, 244, 9, 9, 11, 244, 8, 9, 11, 244, 7, 9,
- 11, 244, 6, 9, 11, 244, 5, 9, 11, 244, 4, 9, 11, 244, 3, 9, 11, 244, 2,
- 9, 11, 244, 1, 9, 11, 244, 0, 9, 11, 243, 255, 9, 11, 243, 254, 9, 11,
- 243, 253, 9, 11, 243, 252, 9, 11, 243, 251, 9, 11, 243, 250, 9, 11, 243,
- 249, 9, 11, 243, 248, 9, 11, 243, 247, 9, 11, 243, 246, 9, 11, 243, 245,
- 9, 11, 243, 244, 9, 11, 243, 243, 9, 11, 243, 242, 9, 11, 243, 241, 9,
- 11, 243, 240, 9, 11, 243, 239, 9, 11, 243, 238, 9, 11, 243, 237, 9, 11,
- 243, 236, 9, 11, 243, 235, 9, 11, 243, 234, 9, 11, 243, 233, 9, 11, 243,
- 232, 9, 11, 243, 231, 9, 11, 243, 230, 9, 11, 243, 229, 9, 11, 243, 228,
- 9, 11, 243, 227, 9, 11, 243, 226, 9, 11, 243, 225, 9, 11, 243, 224, 9,
- 11, 243, 223, 9, 11, 243, 222, 9, 11, 243, 221, 9, 11, 243, 220, 9, 11,
- 243, 219, 9, 11, 243, 218, 9, 11, 243, 217, 9, 11, 243, 216, 9, 11, 243,
- 215, 9, 11, 243, 214, 9, 11, 243, 213, 9, 11, 243, 212, 9, 11, 243, 211,
- 9, 11, 243, 210, 9, 11, 243, 209, 9, 11, 243, 208, 9, 11, 243, 207, 9,
- 11, 243, 206, 9, 11, 243, 205, 9, 11, 243, 204, 9, 11, 243, 203, 9, 11,
- 243, 202, 9, 11, 243, 201, 9, 11, 243, 200, 9, 11, 243, 199, 9, 11, 243,
- 198, 9, 11, 243, 197, 9, 11, 243, 196, 9, 11, 243, 195, 9, 11, 243, 194,
- 9, 11, 243, 193, 9, 11, 243, 192, 9, 11, 243, 191, 9, 11, 243, 190, 9,
- 11, 243, 189, 9, 11, 243, 188, 9, 11, 243, 187, 9, 11, 243, 186, 9, 11,
- 243, 185, 9, 11, 243, 184, 9, 11, 243, 183, 9, 11, 243, 182, 9, 11, 243,
- 181, 9, 11, 243, 180, 9, 11, 243, 179, 9, 11, 243, 178, 9, 11, 243, 177,
- 9, 11, 243, 176, 9, 11, 243, 175, 9, 11, 243, 174, 9, 11, 243, 173, 9,
- 11, 243, 172, 9, 11, 243, 171, 9, 11, 243, 170, 9, 11, 243, 169, 9, 11,
- 243, 168, 9, 11, 243, 167, 9, 11, 243, 166, 9, 11, 243, 165, 9, 11, 243,
- 164, 9, 11, 243, 163, 9, 11, 243, 162, 9, 11, 243, 161, 9, 11, 243, 160,
- 9, 11, 243, 159, 9, 11, 243, 158, 9, 11, 243, 157, 9, 11, 243, 156, 9,
- 11, 243, 155, 9, 11, 243, 154, 9, 11, 243, 153, 9, 11, 243, 152, 9, 11,
- 243, 151, 9, 11, 243, 150, 9, 11, 243, 149, 9, 11, 243, 148, 9, 11, 243,
- 147, 9, 11, 243, 146, 9, 11, 243, 145, 9, 11, 243, 144, 9, 11, 243, 143,
- 9, 11, 243, 142, 9, 11, 243, 141, 9, 11, 243, 140, 9, 11, 243, 139, 9,
- 11, 243, 138, 9, 11, 243, 137, 9, 11, 243, 136, 9, 11, 243, 135, 9, 11,
- 243, 134, 9, 11, 243, 133, 9, 11, 243, 132, 9, 11, 243, 131, 9, 11, 243,
- 130, 9, 11, 243, 129, 9, 11, 243, 128, 9, 11, 243, 127, 9, 11, 243, 126,
- 9, 11, 243, 125, 9, 11, 243, 124, 9, 11, 243, 123, 9, 11, 243, 122, 9,
- 11, 243, 121, 9, 11, 243, 120, 9, 11, 243, 119, 9, 11, 243, 118, 9, 11,
- 243, 117, 9, 11, 243, 116, 9, 11, 243, 115, 9, 11, 243, 114, 9, 11, 243,
- 113, 9, 11, 243, 112, 9, 11, 243, 111, 9, 11, 243, 110, 9, 11, 243, 109,
- 9, 11, 243, 108, 9, 11, 243, 107, 9, 11, 243, 106, 9, 11, 243, 105, 9,
- 11, 243, 104, 9, 11, 243, 103, 9, 11, 243, 102, 9, 11, 243, 101, 9, 11,
- 243, 100, 9, 11, 243, 99, 9, 11, 243, 98, 9, 11, 243, 97, 9, 11, 243, 96,
- 9, 11, 243, 95, 9, 11, 243, 94, 9, 11, 243, 93, 9, 11, 243, 92, 9, 11,
- 243, 91, 9, 11, 243, 90, 9, 11, 243, 89, 9, 11, 243, 88, 9, 11, 243, 87,
- 9, 11, 243, 86, 9, 11, 243, 85, 9, 11, 243, 84, 9, 11, 243, 83, 9, 11,
- 243, 82, 9, 11, 243, 81, 9, 11, 243, 80, 9, 11, 243, 79, 9, 11, 243, 78,
- 9, 11, 243, 77, 9, 11, 243, 76, 9, 11, 243, 75, 9, 11, 243, 74, 9, 11,
- 243, 73, 9, 11, 243, 72, 9, 11, 243, 71, 9, 11, 243, 70, 9, 11, 243, 69,
- 9, 11, 243, 68, 9, 11, 243, 67, 9, 11, 243, 66, 9, 11, 243, 65, 9, 11,
- 243, 64, 9, 11, 243, 63, 9, 11, 243, 62, 9, 11, 243, 61, 9, 11, 243, 60,
- 9, 11, 243, 59, 9, 11, 243, 58, 9, 11, 243, 57, 9, 11, 243, 56, 9, 11,
- 243, 55, 9, 11, 243, 54, 9, 11, 243, 53, 9, 11, 243, 52, 9, 11, 243, 51,
- 9, 11, 243, 50, 9, 11, 243, 49, 9, 11, 243, 48, 9, 11, 243, 47, 9, 11,
- 243, 46, 9, 11, 243, 45, 9, 11, 243, 44, 9, 11, 243, 43, 9, 11, 243, 42,
- 9, 11, 243, 41, 9, 11, 243, 40, 9, 11, 243, 39, 9, 11, 243, 38, 9, 11,
- 243, 37, 9, 11, 243, 36, 9, 11, 243, 35, 9, 11, 243, 34, 9, 11, 243, 33,
- 9, 11, 243, 32, 9, 11, 243, 31, 9, 11, 243, 30, 9, 11, 243, 29, 9, 11,
- 243, 28, 9, 11, 243, 27, 9, 11, 243, 26, 9, 11, 243, 25, 9, 11, 243, 24,
- 9, 11, 243, 23, 9, 11, 243, 22, 9, 11, 243, 21, 9, 11, 243, 20, 9, 11,
- 243, 19, 9, 11, 243, 18, 9, 11, 243, 17, 9, 11, 243, 16, 9, 11, 243, 15,
- 9, 11, 243, 14, 9, 11, 243, 13, 9, 11, 243, 12, 9, 11, 243, 11, 9, 11,
- 243, 10, 9, 11, 243, 9, 9, 11, 243, 8, 9, 11, 243, 7, 9, 11, 243, 6, 9,
- 11, 243, 5, 9, 11, 243, 4, 9, 11, 243, 3, 9, 11, 243, 2, 9, 11, 243, 1,
- 9, 11, 243, 0, 9, 11, 242, 255, 9, 11, 242, 254, 9, 11, 242, 253, 9, 11,
- 242, 252, 9, 11, 242, 251, 9, 11, 242, 250, 9, 11, 242, 249, 9, 11, 242,
- 248, 9, 11, 242, 247, 9, 11, 242, 246, 9, 11, 242, 245, 9, 11, 242, 244,
- 9, 11, 242, 243, 9, 11, 242, 242, 9, 11, 242, 241, 9, 11, 242, 240, 9,
- 11, 242, 239, 9, 11, 242, 238, 9, 11, 242, 237, 9, 11, 242, 236, 9, 11,
- 242, 235, 9, 11, 242, 234, 9, 11, 242, 233, 9, 11, 242, 232, 9, 11, 242,
- 231, 9, 11, 242, 230, 9, 11, 242, 229, 9, 11, 242, 228, 9, 11, 242, 227,
- 9, 11, 242, 226, 9, 11, 242, 225, 9, 11, 242, 224, 9, 11, 242, 223, 9,
- 11, 242, 222, 9, 11, 242, 221, 9, 11, 242, 220, 9, 11, 242, 219, 9, 11,
- 242, 218, 9, 11, 242, 217, 9, 11, 242, 216, 9, 11, 242, 215, 9, 11, 242,
- 214, 9, 11, 242, 213, 9, 11, 242, 212, 9, 11, 242, 211, 9, 11, 242, 210,
- 9, 11, 242, 209, 9, 11, 242, 208, 9, 11, 242, 207, 9, 11, 242, 206, 9,
- 11, 242, 205, 9, 11, 242, 204, 9, 11, 242, 203, 9, 11, 242, 202, 9, 11,
- 242, 201, 9, 11, 242, 200, 9, 11, 242, 199, 9, 11, 242, 198, 9, 11, 242,
- 197, 9, 11, 242, 196, 9, 11, 242, 195, 9, 11, 242, 194, 9, 11, 242, 193,
- 9, 11, 242, 192, 9, 11, 242, 191, 9, 11, 242, 190, 9, 11, 242, 189, 9,
- 11, 242, 188, 9, 11, 242, 187, 9, 11, 242, 186, 9, 11, 242, 185, 9, 11,
- 242, 184, 9, 11, 242, 183, 9, 11, 242, 182, 9, 11, 242, 181, 9, 11, 242,
- 180, 9, 11, 242, 179, 9, 11, 242, 178, 9, 11, 242, 177, 9, 11, 242, 176,
- 9, 11, 242, 175, 9, 11, 242, 174, 9, 11, 242, 173, 9, 11, 242, 172, 9,
- 11, 242, 171, 9, 11, 242, 170, 9, 11, 242, 169, 9, 11, 242, 168, 9, 11,
- 242, 167, 9, 11, 242, 166, 9, 11, 242, 165, 9, 11, 242, 164, 9, 11, 242,
- 163, 9, 11, 242, 162, 9, 11, 242, 161, 9, 11, 242, 160, 9, 11, 242, 159,
- 9, 11, 242, 158, 9, 11, 242, 157, 9, 11, 242, 156, 9, 11, 242, 155, 9,
- 11, 242, 154, 9, 11, 242, 153, 9, 11, 242, 152, 9, 11, 242, 151, 9, 11,
- 242, 150, 9, 11, 242, 149, 9, 11, 242, 148, 9, 11, 242, 147, 9, 11, 242,
- 146, 9, 11, 242, 145, 9, 11, 242, 144, 9, 11, 242, 143, 9, 11, 242, 142,
- 9, 11, 242, 141, 9, 11, 242, 140, 9, 11, 242, 139, 9, 11, 242, 138, 9,
- 11, 242, 137, 9, 11, 242, 136, 9, 11, 242, 135, 9, 11, 242, 134, 9, 11,
- 242, 133, 9, 11, 242, 132, 9, 11, 242, 131, 9, 11, 242, 130, 9, 11, 242,
- 129, 9, 11, 242, 128, 9, 11, 242, 127, 9, 11, 242, 126, 9, 11, 242, 125,
- 9, 11, 242, 124, 9, 11, 242, 123, 9, 11, 242, 122, 9, 11, 242, 121, 9,
- 11, 242, 120, 9, 11, 242, 119, 9, 11, 242, 118, 9, 11, 242, 117, 9, 11,
- 242, 116, 9, 11, 242, 115, 9, 11, 242, 114, 9, 11, 242, 113, 9, 11, 242,
- 112, 9, 11, 242, 111, 9, 11, 242, 110, 9, 11, 242, 109, 9, 11, 242, 108,
- 9, 11, 242, 107, 9, 11, 242, 106, 9, 11, 242, 105, 9, 11, 242, 104, 9,
- 11, 242, 103, 9, 11, 242, 102, 9, 11, 242, 101, 9, 11, 242, 100, 9, 11,
- 242, 99, 9, 11, 242, 98, 9, 11, 242, 97, 9, 11, 242, 96, 9, 11, 242, 95,
- 9, 11, 242, 94, 9, 11, 242, 93, 9, 11, 242, 92, 9, 11, 242, 91, 9, 11,
- 242, 90, 9, 11, 242, 89, 9, 11, 242, 88, 9, 11, 242, 87, 9, 11, 242, 86,
- 9, 11, 242, 85, 9, 11, 242, 84, 9, 11, 242, 83, 9, 11, 242, 82, 9, 11,
- 242, 81, 9, 11, 242, 80, 9, 11, 242, 79, 9, 11, 242, 78, 9, 11, 242, 77,
- 9, 11, 242, 76, 9, 11, 242, 75, 9, 11, 242, 74, 9, 11, 242, 73, 9, 11,
- 242, 72, 9, 11, 242, 71, 9, 11, 242, 70, 9, 11, 242, 69, 9, 11, 242, 68,
- 9, 11, 242, 67, 9, 11, 242, 66, 9, 11, 242, 65, 9, 11, 242, 64, 9, 11,
- 242, 63, 9, 11, 242, 62, 9, 11, 242, 61, 9, 11, 242, 60, 9, 11, 242, 59,
- 9, 11, 242, 58, 9, 11, 242, 57, 9, 11, 242, 56, 9, 11, 242, 55, 9, 11,
- 242, 54, 9, 11, 242, 53, 9, 11, 242, 52, 9, 11, 242, 51, 9, 11, 242, 50,
- 9, 11, 242, 49, 9, 11, 242, 48, 9, 11, 242, 47, 9, 11, 242, 46, 9, 11,
- 242, 45, 9, 11, 242, 44, 9, 11, 242, 43, 9, 11, 242, 42, 9, 11, 242, 41,
- 9, 11, 242, 40, 9, 11, 242, 39, 9, 11, 242, 38, 9, 11, 242, 37, 9, 11,
- 242, 36, 9, 11, 242, 35, 9, 11, 242, 34, 9, 11, 242, 33, 9, 11, 242, 32,
- 238, 11, 227, 95, 108, 228, 145, 108, 247, 149, 76, 108, 232, 57, 76,
- 108, 65, 53, 108, 249, 150, 53, 108, 233, 123, 53, 108, 254, 193, 108,
- 254, 144, 108, 42, 233, 180, 108, 41, 233, 180, 108, 254, 69, 108, 79,
- 53, 108, 251, 54, 108, 244, 94, 108, 246, 218, 228, 38, 108, 228, 161,
- 108, 21, 223, 89, 108, 21, 118, 108, 21, 113, 108, 21, 166, 108, 21, 158,
- 108, 21, 173, 108, 21, 183, 108, 21, 194, 108, 21, 187, 108, 21, 192,
- 108, 251, 61, 108, 229, 186, 108, 237, 213, 53, 108, 247, 204, 53, 108,
- 245, 231, 53, 108, 232, 69, 76, 108, 251, 53, 254, 62, 108, 7, 6, 1, 57,
- 108, 7, 6, 1, 254, 27, 108, 7, 6, 1, 252, 44, 108, 7, 6, 1, 222, 222,
- 108, 7, 6, 1, 72, 108, 7, 6, 1, 247, 130, 108, 7, 6, 1, 214, 108, 7, 6,
- 1, 212, 108, 7, 6, 1, 74, 108, 7, 6, 1, 239, 182, 108, 7, 6, 1, 239, 76,
- 108, 7, 6, 1, 149, 108, 7, 6, 1, 185, 108, 7, 6, 1, 199, 108, 7, 6, 1,
- 73, 108, 7, 6, 1, 233, 244, 108, 7, 6, 1, 232, 139, 108, 7, 6, 1, 146,
- 108, 7, 6, 1, 193, 108, 7, 6, 1, 227, 109, 108, 7, 6, 1, 66, 108, 7, 6,
- 1, 196, 108, 7, 6, 1, 224, 174, 108, 7, 6, 1, 224, 73, 108, 7, 6, 1, 224,
- 25, 108, 7, 6, 1, 223, 119, 108, 42, 37, 104, 108, 231, 193, 228, 161,
- 108, 41, 37, 104, 108, 251, 102, 255, 41, 108, 184, 237, 170, 108, 245,
- 237, 255, 41, 108, 7, 3, 1, 57, 108, 7, 3, 1, 254, 27, 108, 7, 3, 1, 252,
- 44, 108, 7, 3, 1, 222, 222, 108, 7, 3, 1, 72, 108, 7, 3, 1, 247, 130,
- 108, 7, 3, 1, 214, 108, 7, 3, 1, 212, 108, 7, 3, 1, 74, 108, 7, 3, 1,
- 239, 182, 108, 7, 3, 1, 239, 76, 108, 7, 3, 1, 149, 108, 7, 3, 1, 185,
- 108, 7, 3, 1, 199, 108, 7, 3, 1, 73, 108, 7, 3, 1, 233, 244, 108, 7, 3,
- 1, 232, 139, 108, 7, 3, 1, 146, 108, 7, 3, 1, 193, 108, 7, 3, 1, 227,
- 109, 108, 7, 3, 1, 66, 108, 7, 3, 1, 196, 108, 7, 3, 1, 224, 174, 108, 7,
- 3, 1, 224, 73, 108, 7, 3, 1, 224, 25, 108, 7, 3, 1, 223, 119, 108, 42,
- 250, 223, 104, 108, 61, 237, 170, 108, 41, 250, 223, 104, 108, 205, 252,
- 25, 227, 95, 38, 230, 114, 38, 230, 103, 38, 230, 92, 38, 230, 80, 38,
- 230, 69, 38, 230, 58, 38, 230, 47, 38, 230, 36, 38, 230, 25, 38, 230, 17,
- 38, 230, 16, 38, 230, 15, 38, 230, 14, 38, 230, 12, 38, 230, 11, 38, 230,
- 10, 38, 230, 9, 38, 230, 8, 38, 230, 7, 38, 230, 6, 38, 230, 5, 38, 230,
- 4, 38, 230, 3, 38, 230, 1, 38, 230, 0, 38, 229, 255, 38, 229, 254, 38,
- 229, 253, 38, 229, 252, 38, 229, 251, 38, 229, 250, 38, 229, 249, 38,
- 229, 248, 38, 229, 246, 38, 229, 245, 38, 229, 244, 38, 229, 243, 38,
- 229, 242, 38, 229, 241, 38, 229, 240, 38, 229, 239, 38, 229, 238, 38,
- 229, 237, 38, 229, 235, 38, 229, 234, 38, 229, 233, 38, 229, 232, 38,
- 229, 231, 38, 229, 230, 38, 229, 229, 38, 229, 228, 38, 229, 227, 38,
- 229, 226, 38, 229, 224, 38, 229, 223, 38, 229, 222, 38, 229, 221, 38,
- 229, 220, 38, 229, 219, 38, 229, 218, 38, 229, 217, 38, 229, 216, 38,
- 229, 215, 38, 229, 213, 38, 229, 212, 38, 229, 211, 38, 229, 210, 38,
- 229, 209, 38, 229, 208, 38, 229, 207, 38, 229, 206, 38, 229, 205, 38,
- 229, 204, 38, 229, 202, 38, 229, 201, 38, 229, 200, 38, 229, 199, 38,
- 229, 198, 38, 229, 197, 38, 229, 196, 38, 229, 195, 38, 229, 194, 38,
- 229, 193, 38, 230, 190, 38, 230, 189, 38, 230, 188, 38, 230, 187, 38,
- 230, 186, 38, 230, 185, 38, 230, 184, 38, 230, 183, 38, 230, 182, 38,
- 230, 181, 38, 230, 179, 38, 230, 178, 38, 230, 177, 38, 230, 176, 38,
- 230, 175, 38, 230, 174, 38, 230, 173, 38, 230, 172, 38, 230, 171, 38,
- 230, 170, 38, 230, 168, 38, 230, 167, 38, 230, 166, 38, 230, 165, 38,
- 230, 164, 38, 230, 163, 38, 230, 162, 38, 230, 161, 38, 230, 160, 38,
- 230, 159, 38, 230, 157, 38, 230, 156, 38, 230, 155, 38, 230, 154, 38,
- 230, 153, 38, 230, 152, 38, 230, 151, 38, 230, 150, 38, 230, 149, 38,
- 230, 148, 38, 230, 146, 38, 230, 145, 38, 230, 144, 38, 230, 143, 38,
- 230, 142, 38, 230, 141, 38, 230, 140, 38, 230, 139, 38, 230, 138, 38,
- 230, 137, 38, 230, 135, 38, 230, 134, 38, 230, 133, 38, 230, 132, 38,
- 230, 131, 38, 230, 130, 38, 230, 129, 38, 230, 128, 38, 230, 127, 38,
- 230, 126, 38, 230, 124, 38, 230, 123, 38, 230, 122, 38, 230, 121, 38,
- 230, 120, 38, 230, 119, 38, 230, 118, 38, 230, 117, 38, 230, 116, 38,
- 230, 115, 38, 230, 113, 38, 230, 112, 38, 230, 111, 38, 230, 110, 38,
- 230, 109, 38, 230, 108, 38, 230, 107, 38, 230, 106, 38, 230, 105, 38,
- 230, 104, 38, 230, 102, 38, 230, 101, 38, 230, 100, 38, 230, 99, 38, 230,
- 98, 38, 230, 97, 38, 230, 96, 38, 230, 95, 38, 230, 94, 38, 230, 93, 38,
- 230, 91, 38, 230, 90, 38, 230, 89, 38, 230, 88, 38, 230, 87, 38, 230, 86,
- 38, 230, 85, 38, 230, 84, 38, 230, 83, 38, 230, 82, 38, 230, 79, 38, 230,
- 78, 38, 230, 77, 38, 230, 76, 38, 230, 75, 38, 230, 74, 38, 230, 73, 38,
- 230, 72, 38, 230, 71, 38, 230, 70, 38, 230, 68, 38, 230, 67, 38, 230, 66,
- 38, 230, 65, 38, 230, 64, 38, 230, 63, 38, 230, 62, 38, 230, 61, 38, 230,
- 60, 38, 230, 59, 38, 230, 57, 38, 230, 56, 38, 230, 55, 38, 230, 54, 38,
- 230, 53, 38, 230, 52, 38, 230, 51, 38, 230, 50, 38, 230, 49, 38, 230, 48,
- 38, 230, 46, 38, 230, 45, 38, 230, 44, 38, 230, 43, 38, 230, 42, 38, 230,
- 41, 38, 230, 40, 38, 230, 39, 38, 230, 38, 38, 230, 37, 38, 230, 35, 38,
- 230, 34, 38, 230, 33, 38, 230, 32, 38, 230, 31, 38, 230, 30, 38, 230, 29,
- 38, 230, 28, 38, 230, 27, 38, 230, 26, 38, 230, 24, 38, 230, 23, 38, 230,
- 22, 38, 230, 21, 38, 230, 20, 38, 230, 19, 38, 230, 18,
+ 0, 219, 206, 244, 254, 77, 224, 143, 77, 50, 52, 247, 86, 52, 226, 57,
+ 52, 254, 35, 253, 226, 42, 226, 131, 46, 226, 131, 253, 132, 94, 52, 249,
+ 157, 240, 159, 243, 200, 219, 69, 219, 231, 21, 212, 79, 21, 116, 21,
+ 109, 21, 166, 21, 163, 21, 180, 21, 189, 21, 198, 21, 195, 21, 200, 249,
+ 164, 221, 70, 233, 39, 52, 245, 61, 52, 242, 107, 52, 224, 158, 77, 249,
+ 156, 253, 122, 7, 6, 1, 61, 7, 6, 1, 253, 74, 7, 6, 1, 250, 252, 7, 6, 1,
+ 249, 3, 7, 6, 1, 74, 7, 6, 1, 244, 230, 7, 6, 1, 243, 177, 7, 6, 1, 242,
+ 41, 7, 6, 1, 72, 7, 6, 1, 235, 142, 7, 6, 1, 235, 27, 7, 6, 1, 150, 7, 6,
+ 1, 183, 7, 6, 1, 204, 7, 6, 1, 75, 7, 6, 1, 226, 229, 7, 6, 1, 224, 240,
+ 7, 6, 1, 149, 7, 6, 1, 197, 7, 6, 1, 218, 99, 7, 6, 1, 69, 7, 6, 1, 215,
+ 79, 7, 6, 1, 214, 82, 7, 6, 1, 213, 166, 7, 6, 1, 213, 105, 7, 6, 1, 212,
+ 152, 42, 41, 125, 223, 203, 219, 231, 46, 41, 125, 249, 224, 254, 174,
+ 115, 232, 242, 242, 114, 254, 174, 7, 3, 1, 61, 7, 3, 1, 253, 74, 7, 3,
+ 1, 250, 252, 7, 3, 1, 249, 3, 7, 3, 1, 74, 7, 3, 1, 244, 230, 7, 3, 1,
+ 243, 177, 7, 3, 1, 242, 41, 7, 3, 1, 72, 7, 3, 1, 235, 142, 7, 3, 1, 235,
+ 27, 7, 3, 1, 150, 7, 3, 1, 183, 7, 3, 1, 204, 7, 3, 1, 75, 7, 3, 1, 226,
+ 229, 7, 3, 1, 224, 240, 7, 3, 1, 149, 7, 3, 1, 197, 7, 3, 1, 218, 99, 7,
+ 3, 1, 69, 7, 3, 1, 215, 79, 7, 3, 1, 214, 82, 7, 3, 1, 213, 166, 7, 3, 1,
+ 213, 105, 7, 3, 1, 212, 152, 42, 249, 40, 125, 71, 232, 242, 46, 249, 40,
+ 125, 217, 42, 228, 184, 219, 206, 235, 191, 244, 254, 77, 250, 110, 52,
+ 225, 108, 52, 249, 39, 52, 213, 31, 52, 251, 63, 134, 222, 92, 52, 247,
+ 209, 249, 102, 52, 244, 105, 227, 21, 235, 235, 233, 66, 51, 254, 19,
+ 224, 143, 77, 228, 163, 52, 219, 236, 240, 160, 223, 252, 52, 232, 37,
+ 248, 22, 52, 225, 155, 52, 218, 223, 109, 218, 223, 166, 254, 164, 254,
+ 174, 231, 41, 52, 225, 200, 52, 231, 37, 247, 74, 250, 117, 218, 223,
+ 116, 231, 211, 227, 21, 235, 235, 223, 144, 51, 254, 19, 224, 143, 77,
+ 214, 97, 243, 228, 122, 224, 166, 214, 97, 243, 228, 122, 242, 9, 214,
+ 97, 243, 228, 133, 224, 164, 235, 191, 224, 158, 77, 7, 6, 1, 118, 2,
+ 242, 113, 7, 6, 1, 118, 2, 179, 7, 6, 1, 118, 2, 249, 223, 7, 6, 1, 118,
+ 2, 217, 42, 7, 6, 1, 118, 2, 247, 209, 7, 6, 1, 118, 2, 223, 131, 49, 7,
+ 6, 1, 254, 148, 7, 6, 1, 250, 253, 2, 250, 117, 7, 6, 1, 191, 2, 242,
+ 113, 7, 6, 1, 191, 2, 179, 7, 6, 1, 191, 2, 249, 223, 7, 6, 1, 191, 2,
+ 247, 209, 7, 6, 1, 240, 146, 2, 242, 113, 7, 6, 1, 240, 146, 2, 179, 7,
+ 6, 1, 240, 146, 2, 249, 223, 7, 6, 1, 240, 146, 2, 247, 209, 7, 6, 1,
+ 245, 25, 7, 6, 1, 230, 98, 2, 217, 42, 7, 6, 1, 157, 2, 242, 113, 7, 6,
+ 1, 157, 2, 179, 7, 6, 1, 157, 2, 249, 223, 7, 6, 1, 157, 2, 217, 42, 7,
+ 6, 1, 157, 2, 247, 209, 230, 154, 52, 7, 6, 1, 157, 2, 90, 7, 6, 1, 111,
+ 2, 242, 113, 7, 6, 1, 111, 2, 179, 7, 6, 1, 111, 2, 249, 223, 7, 6, 1,
+ 111, 2, 247, 209, 7, 6, 1, 213, 106, 2, 179, 7, 6, 1, 217, 104, 7, 3, 1,
+ 220, 255, 197, 7, 3, 1, 118, 2, 242, 113, 7, 3, 1, 118, 2, 179, 7, 3, 1,
+ 118, 2, 249, 223, 7, 3, 1, 118, 2, 217, 42, 7, 3, 1, 118, 2, 247, 209, 7,
+ 3, 1, 118, 2, 223, 131, 49, 7, 3, 1, 254, 148, 7, 3, 1, 250, 253, 2, 250,
+ 117, 7, 3, 1, 191, 2, 242, 113, 7, 3, 1, 191, 2, 179, 7, 3, 1, 191, 2,
+ 249, 223, 7, 3, 1, 191, 2, 247, 209, 7, 3, 1, 240, 146, 2, 242, 113, 7,
+ 3, 1, 240, 146, 2, 179, 7, 3, 1, 240, 146, 2, 249, 223, 7, 3, 1, 240,
+ 146, 2, 247, 209, 7, 3, 1, 245, 25, 7, 3, 1, 230, 98, 2, 217, 42, 7, 3,
+ 1, 157, 2, 242, 113, 7, 3, 1, 157, 2, 179, 7, 3, 1, 157, 2, 249, 223, 7,
+ 3, 1, 157, 2, 217, 42, 7, 3, 1, 157, 2, 247, 209, 247, 121, 52, 7, 3, 1,
+ 157, 2, 90, 7, 3, 1, 111, 2, 242, 113, 7, 3, 1, 111, 2, 179, 7, 3, 1,
+ 111, 2, 249, 223, 7, 3, 1, 111, 2, 247, 209, 7, 3, 1, 213, 106, 2, 179,
+ 7, 3, 1, 217, 104, 7, 3, 1, 213, 106, 2, 247, 209, 7, 6, 1, 118, 2, 232,
+ 37, 7, 3, 1, 118, 2, 232, 37, 7, 6, 1, 118, 2, 251, 74, 7, 3, 1, 118, 2,
+ 251, 74, 7, 6, 1, 118, 2, 227, 90, 7, 3, 1, 118, 2, 227, 90, 7, 6, 1,
+ 250, 253, 2, 179, 7, 3, 1, 250, 253, 2, 179, 7, 6, 1, 250, 253, 2, 249,
+ 223, 7, 3, 1, 250, 253, 2, 249, 223, 7, 6, 1, 250, 253, 2, 62, 49, 7, 3,
+ 1, 250, 253, 2, 62, 49, 7, 6, 1, 250, 253, 2, 250, 166, 7, 3, 1, 250,
+ 253, 2, 250, 166, 7, 6, 1, 249, 4, 2, 250, 166, 7, 3, 1, 249, 4, 2, 250,
+ 166, 7, 6, 1, 249, 4, 2, 90, 7, 3, 1, 249, 4, 2, 90, 7, 6, 1, 191, 2,
+ 232, 37, 7, 3, 1, 191, 2, 232, 37, 7, 6, 1, 191, 2, 251, 74, 7, 3, 1,
+ 191, 2, 251, 74, 7, 6, 1, 191, 2, 62, 49, 7, 3, 1, 191, 2, 62, 49, 7, 6,
+ 1, 191, 2, 227, 90, 7, 3, 1, 191, 2, 227, 90, 7, 6, 1, 191, 2, 250, 166,
+ 7, 3, 1, 191, 2, 250, 166, 7, 6, 1, 243, 178, 2, 249, 223, 7, 3, 1, 243,
+ 178, 2, 249, 223, 7, 6, 1, 243, 178, 2, 251, 74, 7, 3, 1, 243, 178, 2,
+ 251, 74, 7, 6, 1, 243, 178, 2, 62, 49, 7, 3, 1, 243, 178, 2, 62, 49, 7,
+ 6, 1, 243, 178, 2, 250, 117, 7, 3, 1, 243, 178, 2, 250, 117, 7, 6, 1,
+ 242, 42, 2, 249, 223, 7, 3, 1, 242, 42, 2, 249, 223, 7, 6, 1, 242, 42, 2,
+ 90, 7, 3, 1, 242, 42, 2, 90, 7, 6, 1, 240, 146, 2, 217, 42, 7, 3, 1, 240,
+ 146, 2, 217, 42, 7, 6, 1, 240, 146, 2, 232, 37, 7, 3, 1, 240, 146, 2,
+ 232, 37, 7, 6, 1, 240, 146, 2, 251, 74, 7, 3, 1, 240, 146, 2, 251, 74, 7,
+ 6, 1, 240, 146, 2, 227, 90, 7, 3, 1, 240, 146, 2, 227, 90, 7, 6, 1, 240,
+ 146, 2, 62, 49, 7, 3, 1, 247, 73, 72, 7, 6, 26, 236, 26, 7, 3, 26, 236,
+ 26, 7, 6, 1, 235, 143, 2, 249, 223, 7, 3, 1, 235, 143, 2, 249, 223, 7, 6,
+ 1, 235, 28, 2, 250, 117, 7, 3, 1, 235, 28, 2, 250, 117, 7, 3, 1, 233,
+ 248, 7, 6, 1, 233, 171, 2, 179, 7, 3, 1, 233, 171, 2, 179, 7, 6, 1, 233,
+ 171, 2, 250, 117, 7, 3, 1, 233, 171, 2, 250, 117, 7, 6, 1, 233, 171, 2,
+ 250, 166, 7, 3, 1, 233, 171, 2, 250, 166, 7, 6, 1, 233, 171, 2, 231, 37,
+ 247, 74, 7, 3, 1, 233, 171, 2, 231, 37, 247, 74, 7, 6, 1, 233, 171, 2,
+ 90, 7, 3, 1, 233, 171, 2, 90, 7, 6, 1, 230, 98, 2, 179, 7, 3, 1, 230, 98,
+ 2, 179, 7, 6, 1, 230, 98, 2, 250, 117, 7, 3, 1, 230, 98, 2, 250, 117, 7,
+ 6, 1, 230, 98, 2, 250, 166, 7, 3, 1, 230, 98, 2, 250, 166, 7, 3, 1, 230,
+ 98, 225, 84, 251, 7, 253, 226, 7, 6, 1, 245, 96, 7, 3, 1, 245, 96, 7, 6,
+ 1, 157, 2, 232, 37, 7, 3, 1, 157, 2, 232, 37, 7, 6, 1, 157, 2, 251, 74,
+ 7, 3, 1, 157, 2, 251, 74, 7, 6, 1, 157, 2, 51, 179, 7, 3, 1, 157, 2, 51,
+ 179, 7, 6, 26, 227, 99, 7, 3, 26, 227, 99, 7, 6, 1, 224, 113, 2, 179, 7,
+ 3, 1, 224, 113, 2, 179, 7, 6, 1, 224, 113, 2, 250, 117, 7, 3, 1, 224,
+ 113, 2, 250, 117, 7, 6, 1, 224, 113, 2, 250, 166, 7, 3, 1, 224, 113, 2,
+ 250, 166, 7, 6, 1, 223, 4, 2, 179, 7, 3, 1, 223, 4, 2, 179, 7, 6, 1, 223,
+ 4, 2, 249, 223, 7, 3, 1, 223, 4, 2, 249, 223, 7, 6, 1, 223, 4, 2, 250,
+ 117, 7, 3, 1, 223, 4, 2, 250, 117, 7, 6, 1, 223, 4, 2, 250, 166, 7, 3, 1,
+ 223, 4, 2, 250, 166, 7, 6, 1, 218, 100, 2, 250, 117, 7, 3, 1, 218, 100,
+ 2, 250, 117, 7, 6, 1, 218, 100, 2, 250, 166, 7, 3, 1, 218, 100, 2, 250,
+ 166, 7, 6, 1, 218, 100, 2, 90, 7, 3, 1, 218, 100, 2, 90, 7, 6, 1, 111, 2,
+ 217, 42, 7, 3, 1, 111, 2, 217, 42, 7, 6, 1, 111, 2, 232, 37, 7, 3, 1,
+ 111, 2, 232, 37, 7, 6, 1, 111, 2, 251, 74, 7, 3, 1, 111, 2, 251, 74, 7,
+ 6, 1, 111, 2, 223, 131, 49, 7, 3, 1, 111, 2, 223, 131, 49, 7, 6, 1, 111,
+ 2, 51, 179, 7, 3, 1, 111, 2, 51, 179, 7, 6, 1, 111, 2, 227, 90, 7, 3, 1,
+ 111, 2, 227, 90, 7, 6, 1, 214, 83, 2, 249, 223, 7, 3, 1, 214, 83, 2, 249,
+ 223, 7, 6, 1, 213, 106, 2, 249, 223, 7, 3, 1, 213, 106, 2, 249, 223, 7,
+ 6, 1, 213, 106, 2, 247, 209, 7, 6, 1, 212, 153, 2, 179, 7, 3, 1, 212,
+ 153, 2, 179, 7, 6, 1, 212, 153, 2, 62, 49, 7, 3, 1, 212, 153, 2, 62, 49,
+ 7, 6, 1, 212, 153, 2, 250, 166, 7, 3, 1, 212, 153, 2, 250, 166, 7, 3, 1,
+ 184, 197, 7, 3, 1, 54, 2, 90, 7, 6, 1, 54, 2, 101, 7, 6, 1, 54, 2, 216,
+ 224, 7, 3, 1, 54, 2, 216, 224, 7, 6, 1, 160, 189, 7, 3, 1, 160, 189, 7,
+ 6, 1, 227, 40, 75, 7, 6, 1, 250, 253, 2, 101, 7, 3, 1, 250, 253, 2, 101,
+ 7, 6, 1, 254, 124, 249, 3, 7, 6, 1, 249, 4, 2, 101, 7, 6, 1, 249, 4, 2,
+ 216, 224, 7, 3, 1, 249, 4, 2, 216, 224, 7, 3, 1, 216, 58, 248, 5, 7, 6,
+ 1, 223, 202, 74, 7, 6, 1, 222, 113, 7, 6, 1, 227, 40, 74, 7, 6, 1, 244,
+ 231, 2, 101, 7, 3, 1, 244, 231, 2, 101, 7, 6, 1, 243, 178, 2, 101, 7, 6,
+ 1, 243, 83, 7, 3, 1, 240, 193, 7, 6, 1, 235, 183, 7, 6, 1, 240, 146, 2,
+ 90, 7, 6, 1, 235, 28, 2, 101, 7, 3, 1, 235, 28, 2, 101, 7, 3, 1, 233,
+ 171, 2, 134, 7, 3, 1, 233, 124, 2, 90, 7, 6, 1, 216, 58, 183, 7, 6, 1,
+ 230, 98, 2, 42, 101, 7, 3, 1, 230, 98, 2, 184, 46, 233, 60, 7, 6, 1, 157,
+ 2, 231, 37, 217, 42, 7, 6, 1, 157, 2, 240, 235, 7, 3, 1, 157, 2, 240,
+ 235, 7, 6, 1, 227, 85, 7, 3, 1, 227, 85, 7, 6, 1, 226, 230, 2, 101, 7, 3,
+ 1, 226, 230, 2, 101, 7, 1, 212, 205, 7, 6, 1, 160, 109, 7, 3, 1, 160,
+ 109, 7, 6, 1, 245, 40, 7, 1, 223, 202, 245, 41, 232, 177, 7, 3, 1, 218,
+ 100, 2, 226, 193, 101, 7, 6, 1, 218, 100, 2, 101, 7, 3, 1, 218, 100, 2,
+ 101, 7, 6, 1, 218, 100, 2, 223, 207, 101, 7, 6, 1, 111, 2, 240, 235, 7,
+ 3, 1, 111, 2, 240, 235, 7, 6, 1, 215, 128, 7, 6, 1, 215, 80, 2, 101, 7,
+ 6, 1, 213, 106, 2, 101, 7, 3, 1, 213, 106, 2, 101, 7, 6, 1, 212, 153, 2,
+ 90, 7, 3, 1, 212, 153, 2, 90, 7, 6, 1, 244, 232, 7, 6, 1, 244, 233, 223,
+ 201, 7, 3, 1, 244, 233, 223, 201, 7, 3, 1, 244, 233, 2, 218, 27, 7, 1,
+ 117, 2, 90, 7, 6, 1, 160, 180, 7, 3, 1, 160, 180, 7, 1, 235, 191, 242,
+ 156, 219, 70, 2, 90, 7, 1, 213, 169, 7, 1, 247, 254, 249, 204, 7, 1, 233,
+ 100, 249, 204, 7, 1, 254, 46, 249, 204, 7, 1, 223, 207, 249, 204, 7, 6,
+ 1, 245, 251, 2, 250, 166, 7, 6, 1, 249, 4, 2, 3, 1, 212, 153, 2, 250,
+ 166, 7, 3, 1, 245, 251, 2, 250, 166, 7, 6, 1, 232, 217, 7, 6, 1, 233,
+ 171, 2, 3, 1, 235, 142, 7, 3, 1, 232, 217, 7, 6, 1, 229, 17, 7, 6, 1,
+ 230, 98, 2, 3, 1, 235, 142, 7, 3, 1, 229, 17, 7, 6, 1, 118, 2, 250, 166,
+ 7, 3, 1, 118, 2, 250, 166, 7, 6, 1, 240, 146, 2, 250, 166, 7, 3, 1, 240,
+ 146, 2, 250, 166, 7, 6, 1, 157, 2, 250, 166, 7, 3, 1, 157, 2, 250, 166,
+ 7, 6, 1, 111, 2, 250, 166, 7, 3, 1, 111, 2, 250, 166, 7, 6, 1, 111, 2,
+ 247, 210, 24, 232, 37, 7, 3, 1, 111, 2, 247, 210, 24, 232, 37, 7, 6, 1,
+ 111, 2, 247, 210, 24, 179, 7, 3, 1, 111, 2, 247, 210, 24, 179, 7, 6, 1,
+ 111, 2, 247, 210, 24, 250, 166, 7, 3, 1, 111, 2, 247, 210, 24, 250, 166,
+ 7, 6, 1, 111, 2, 247, 210, 24, 242, 113, 7, 3, 1, 111, 2, 247, 210, 24,
+ 242, 113, 7, 3, 1, 216, 58, 74, 7, 6, 1, 118, 2, 247, 210, 24, 232, 37,
+ 7, 3, 1, 118, 2, 247, 210, 24, 232, 37, 7, 6, 1, 118, 2, 62, 78, 24, 232,
+ 37, 7, 3, 1, 118, 2, 62, 78, 24, 232, 37, 7, 6, 1, 254, 149, 2, 232, 37,
+ 7, 3, 1, 254, 149, 2, 232, 37, 7, 6, 1, 243, 178, 2, 90, 7, 3, 1, 243,
+ 178, 2, 90, 7, 6, 1, 243, 178, 2, 250, 166, 7, 3, 1, 243, 178, 2, 250,
+ 166, 7, 6, 1, 235, 28, 2, 250, 166, 7, 3, 1, 235, 28, 2, 250, 166, 7, 6,
+ 1, 157, 2, 227, 90, 7, 3, 1, 157, 2, 227, 90, 7, 6, 1, 157, 2, 227, 91,
+ 24, 232, 37, 7, 3, 1, 157, 2, 227, 91, 24, 232, 37, 7, 6, 1, 244, 233, 2,
+ 250, 166, 7, 3, 1, 244, 233, 2, 250, 166, 7, 3, 1, 235, 143, 2, 250, 166,
+ 7, 6, 1, 245, 250, 7, 6, 1, 249, 4, 2, 3, 1, 212, 152, 7, 3, 1, 245, 250,
+ 7, 6, 1, 243, 178, 2, 179, 7, 3, 1, 243, 178, 2, 179, 7, 6, 1, 240, 191,
+ 7, 6, 1, 213, 169, 7, 6, 1, 230, 98, 2, 242, 113, 7, 3, 1, 230, 98, 2,
+ 242, 113, 7, 6, 1, 118, 2, 223, 131, 78, 24, 179, 7, 3, 1, 118, 2, 223,
+ 131, 78, 24, 179, 7, 6, 1, 254, 149, 2, 179, 7, 3, 1, 254, 149, 2, 179,
+ 7, 6, 1, 157, 2, 219, 45, 24, 179, 7, 3, 1, 157, 2, 219, 45, 24, 179, 7,
+ 6, 1, 118, 2, 51, 242, 113, 7, 3, 1, 118, 2, 51, 242, 113, 7, 6, 1, 118,
+ 2, 235, 191, 251, 74, 7, 3, 1, 118, 2, 235, 191, 251, 74, 7, 6, 1, 191,
+ 2, 51, 242, 113, 7, 3, 1, 191, 2, 51, 242, 113, 7, 6, 1, 191, 2, 235,
+ 191, 251, 74, 7, 3, 1, 191, 2, 235, 191, 251, 74, 7, 6, 1, 240, 146, 2,
+ 51, 242, 113, 7, 3, 1, 240, 146, 2, 51, 242, 113, 7, 6, 1, 240, 146, 2,
+ 235, 191, 251, 74, 7, 3, 1, 240, 146, 2, 235, 191, 251, 74, 7, 6, 1, 157,
+ 2, 51, 242, 113, 7, 3, 1, 157, 2, 51, 242, 113, 7, 6, 1, 157, 2, 235,
+ 191, 251, 74, 7, 3, 1, 157, 2, 235, 191, 251, 74, 7, 6, 1, 224, 113, 2,
+ 51, 242, 113, 7, 3, 1, 224, 113, 2, 51, 242, 113, 7, 6, 1, 224, 113, 2,
+ 235, 191, 251, 74, 7, 3, 1, 224, 113, 2, 235, 191, 251, 74, 7, 6, 1, 111,
+ 2, 51, 242, 113, 7, 3, 1, 111, 2, 51, 242, 113, 7, 6, 1, 111, 2, 235,
+ 191, 251, 74, 7, 3, 1, 111, 2, 235, 191, 251, 74, 7, 6, 1, 223, 4, 2,
+ 249, 158, 55, 7, 3, 1, 223, 4, 2, 249, 158, 55, 7, 6, 1, 218, 100, 2,
+ 249, 158, 55, 7, 3, 1, 218, 100, 2, 249, 158, 55, 7, 6, 1, 212, 222, 7,
+ 3, 1, 212, 222, 7, 6, 1, 242, 42, 2, 250, 166, 7, 3, 1, 242, 42, 2, 250,
+ 166, 7, 6, 1, 230, 98, 2, 184, 46, 233, 60, 7, 3, 1, 249, 4, 2, 249, 41,
+ 7, 6, 1, 227, 2, 7, 3, 1, 227, 2, 7, 6, 1, 212, 153, 2, 101, 7, 3, 1,
+ 212, 153, 2, 101, 7, 6, 1, 118, 2, 62, 49, 7, 3, 1, 118, 2, 62, 49, 7, 6,
+ 1, 191, 2, 250, 117, 7, 3, 1, 191, 2, 250, 117, 7, 6, 1, 157, 2, 247,
+ 210, 24, 232, 37, 7, 3, 1, 157, 2, 247, 210, 24, 232, 37, 7, 6, 1, 157,
+ 2, 217, 43, 24, 232, 37, 7, 3, 1, 157, 2, 217, 43, 24, 232, 37, 7, 6, 1,
+ 157, 2, 62, 49, 7, 3, 1, 157, 2, 62, 49, 7, 6, 1, 157, 2, 62, 78, 24,
+ 232, 37, 7, 3, 1, 157, 2, 62, 78, 24, 232, 37, 7, 6, 1, 213, 106, 2, 232,
+ 37, 7, 3, 1, 213, 106, 2, 232, 37, 7, 3, 1, 233, 171, 2, 249, 41, 7, 3,
+ 1, 230, 98, 2, 249, 41, 7, 3, 1, 218, 100, 2, 249, 41, 7, 3, 1, 247, 73,
+ 235, 142, 7, 3, 1, 248, 89, 247, 172, 7, 3, 1, 224, 176, 247, 172, 7, 6,
+ 1, 118, 2, 90, 7, 6, 1, 250, 253, 2, 90, 7, 3, 1, 250, 253, 2, 90, 7, 6,
+ 1, 233, 171, 2, 134, 7, 6, 1, 218, 100, 2, 247, 207, 90, 7, 3, 1, 223, 4,
+ 2, 218, 195, 218, 27, 7, 3, 1, 212, 153, 2, 218, 195, 218, 27, 7, 6, 1,
+ 242, 156, 219, 69, 7, 3, 1, 242, 156, 219, 69, 7, 6, 1, 54, 2, 90, 7, 6,
+ 1, 111, 134, 7, 6, 1, 216, 58, 215, 79, 7, 6, 1, 191, 2, 90, 7, 3, 1,
+ 191, 2, 90, 7, 6, 1, 235, 143, 2, 90, 7, 3, 1, 235, 143, 2, 90, 7, 6, 1,
+ 3, 224, 241, 2, 241, 38, 218, 27, 7, 3, 1, 224, 241, 2, 241, 38, 218, 27,
+ 7, 6, 1, 224, 113, 2, 90, 7, 3, 1, 224, 113, 2, 90, 7, 6, 1, 213, 106, 2,
+ 90, 7, 3, 1, 213, 106, 2, 90, 7, 3, 1, 216, 58, 61, 7, 3, 1, 254, 52, 7,
+ 3, 1, 216, 58, 254, 52, 7, 3, 1, 54, 2, 101, 7, 3, 1, 227, 40, 75, 7, 3,
+ 1, 250, 253, 2, 249, 41, 7, 3, 1, 249, 4, 2, 218, 27, 7, 3, 1, 249, 4, 2,
+ 101, 7, 3, 1, 223, 202, 74, 7, 3, 1, 222, 113, 7, 3, 1, 222, 114, 2, 101,
+ 7, 3, 1, 227, 40, 74, 7, 3, 1, 223, 202, 227, 40, 74, 7, 3, 1, 223, 202,
+ 227, 40, 191, 2, 101, 7, 3, 1, 249, 193, 223, 202, 227, 40, 74, 7, 3, 1,
+ 247, 73, 235, 143, 2, 90, 7, 3, 1, 243, 178, 2, 101, 7, 3, 1, 113, 243,
+ 177, 7, 1, 3, 6, 243, 177, 7, 3, 1, 243, 83, 7, 3, 1, 224, 43, 240, 235,
+ 7, 3, 1, 216, 58, 242, 41, 7, 3, 1, 242, 42, 2, 101, 7, 3, 1, 241, 192,
+ 2, 101, 7, 3, 1, 240, 146, 2, 90, 7, 3, 1, 235, 183, 7, 1, 3, 6, 72, 7,
+ 3, 1, 233, 171, 2, 231, 37, 217, 42, 7, 3, 1, 233, 171, 2, 251, 218, 7,
+ 3, 1, 233, 171, 2, 223, 207, 101, 7, 3, 1, 233, 27, 7, 3, 1, 216, 58,
+ 183, 7, 3, 1, 216, 58, 232, 110, 2, 184, 233, 60, 7, 3, 1, 232, 110, 2,
+ 101, 7, 3, 1, 230, 98, 2, 42, 101, 7, 3, 1, 230, 98, 2, 223, 207, 101, 7,
+ 1, 3, 6, 204, 7, 3, 1, 252, 54, 75, 7, 1, 3, 6, 227, 99, 7, 3, 1, 249,
+ 193, 227, 67, 7, 3, 1, 226, 9, 7, 3, 1, 216, 58, 149, 7, 3, 1, 216, 58,
+ 224, 113, 2, 184, 233, 60, 7, 3, 1, 216, 58, 224, 113, 2, 101, 7, 3, 1,
+ 224, 113, 2, 184, 233, 60, 7, 3, 1, 224, 113, 2, 218, 27, 7, 3, 1, 224,
+ 113, 2, 244, 56, 7, 3, 1, 223, 202, 224, 113, 2, 244, 56, 7, 1, 3, 6,
+ 149, 7, 1, 3, 6, 235, 191, 149, 7, 3, 1, 223, 4, 2, 101, 7, 3, 1, 245,
+ 40, 7, 3, 1, 247, 73, 235, 143, 2, 219, 45, 24, 101, 7, 3, 1, 219, 163,
+ 223, 202, 245, 40, 7, 3, 1, 245, 41, 2, 249, 41, 7, 3, 1, 216, 58, 218,
+ 99, 7, 3, 1, 218, 100, 2, 223, 207, 101, 7, 3, 1, 111, 134, 7, 3, 1, 215,
+ 128, 7, 3, 1, 215, 80, 2, 101, 7, 3, 1, 216, 58, 215, 79, 7, 3, 1, 216,
+ 58, 214, 82, 7, 3, 1, 216, 58, 213, 105, 7, 1, 3, 6, 213, 105, 7, 3, 1,
+ 212, 153, 2, 223, 207, 101, 7, 3, 1, 212, 153, 2, 249, 41, 7, 3, 1, 244,
+ 232, 7, 3, 1, 244, 233, 2, 249, 41, 7, 1, 242, 156, 219, 69, 7, 1, 226,
+ 15, 214, 116, 243, 219, 7, 1, 235, 191, 242, 156, 219, 69, 7, 1, 219, 50,
+ 250, 252, 7, 1, 251, 169, 249, 204, 7, 1, 3, 6, 253, 74, 7, 3, 1, 249,
+ 193, 227, 40, 74, 7, 1, 3, 6, 243, 178, 2, 101, 7, 1, 3, 6, 242, 41, 7,
+ 3, 1, 235, 143, 2, 249, 67, 7, 3, 1, 216, 58, 235, 27, 7, 1, 3, 6, 150,
+ 7, 3, 1, 224, 241, 2, 101, 7, 1, 242, 156, 219, 70, 2, 90, 7, 1, 223,
+ 202, 242, 156, 219, 70, 2, 90, 7, 3, 1, 245, 251, 247, 172, 7, 3, 1, 247,
+ 233, 247, 172, 7, 3, 1, 245, 251, 247, 173, 2, 249, 41, 7, 3, 1, 216,
+ 143, 247, 172, 7, 3, 1, 217, 188, 247, 172, 7, 3, 1, 217, 236, 247, 173,
+ 2, 249, 41, 7, 3, 1, 244, 103, 247, 172, 7, 3, 1, 232, 158, 247, 172, 7,
+ 3, 1, 232, 111, 247, 172, 7, 1, 251, 169, 226, 56, 7, 1, 251, 177, 226,
+ 56, 7, 3, 1, 216, 58, 242, 42, 2, 244, 56, 7, 3, 1, 216, 58, 242, 42, 2,
+ 244, 57, 24, 218, 27, 59, 1, 3, 242, 41, 59, 1, 3, 242, 42, 2, 101, 59,
+ 1, 3, 235, 142, 59, 1, 3, 149, 59, 1, 3, 216, 58, 149, 59, 1, 3, 216, 58,
+ 224, 113, 2, 101, 59, 1, 3, 6, 235, 191, 149, 59, 1, 3, 214, 82, 59, 1,
+ 3, 213, 105, 59, 1, 225, 71, 59, 1, 51, 225, 71, 59, 1, 216, 58, 249,
+ 157, 59, 1, 253, 226, 59, 1, 223, 202, 249, 157, 59, 1, 46, 151, 223,
+ 130, 59, 1, 42, 151, 223, 130, 59, 1, 242, 156, 219, 69, 59, 1, 223, 202,
+ 242, 156, 219, 69, 59, 1, 42, 253, 164, 59, 1, 46, 253, 164, 59, 1, 114,
+ 253, 164, 59, 1, 119, 253, 164, 59, 1, 249, 224, 254, 174, 250, 166, 59,
+ 1, 71, 232, 242, 59, 1, 232, 37, 59, 1, 254, 164, 254, 174, 59, 1, 242,
+ 114, 254, 174, 59, 1, 115, 71, 232, 242, 59, 1, 115, 232, 37, 59, 1, 115,
+ 242, 114, 254, 174, 59, 1, 115, 254, 164, 254, 174, 59, 1, 216, 180, 249,
+ 164, 59, 1, 151, 216, 180, 249, 164, 59, 1, 250, 107, 46, 151, 223, 130,
+ 59, 1, 250, 107, 42, 151, 223, 130, 59, 1, 114, 218, 36, 59, 1, 119, 218,
+ 36, 59, 1, 94, 52, 59, 1, 230, 251, 52, 251, 74, 62, 49, 223, 131, 49,
+ 227, 90, 3, 217, 42, 51, 254, 164, 254, 174, 59, 1, 223, 189, 101, 59, 1,
+ 249, 71, 254, 174, 59, 1, 3, 243, 83, 59, 1, 3, 150, 59, 1, 3, 197, 59,
+ 1, 3, 213, 166, 59, 1, 3, 223, 202, 242, 156, 219, 69, 59, 1, 244, 244,
+ 160, 134, 59, 1, 124, 160, 134, 59, 1, 231, 38, 160, 134, 59, 1, 115,
+ 160, 134, 59, 1, 244, 243, 160, 134, 59, 1, 212, 245, 247, 251, 160, 77,
+ 59, 1, 213, 59, 247, 251, 160, 77, 59, 1, 214, 114, 59, 1, 215, 156, 59,
+ 1, 51, 253, 226, 59, 1, 115, 119, 253, 164, 59, 1, 115, 114, 253, 164,
+ 59, 1, 115, 42, 253, 164, 59, 1, 115, 46, 253, 164, 59, 1, 115, 223, 130,
+ 59, 1, 231, 37, 242, 114, 254, 174, 59, 1, 231, 37, 51, 242, 114, 254,
+ 174, 59, 1, 231, 37, 51, 254, 164, 254, 174, 59, 1, 115, 217, 42, 59, 1,
+ 224, 48, 249, 164, 59, 1, 251, 234, 124, 216, 241, 59, 1, 245, 101, 124,
+ 216, 241, 59, 1, 251, 234, 115, 216, 241, 59, 1, 245, 101, 115, 216, 241,
+ 59, 1, 220, 234, 59, 1, 227, 40, 220, 234, 59, 1, 115, 42, 68, 37, 242,
+ 114, 254, 174, 37, 254, 164, 254, 174, 37, 249, 224, 254, 174, 37, 217,
+ 42, 37, 232, 37, 37, 226, 243, 37, 251, 74, 37, 62, 49, 37, 247, 209, 37,
+ 241, 38, 49, 37, 223, 131, 49, 37, 51, 254, 164, 254, 174, 37, 250, 166,
+ 37, 71, 232, 243, 49, 37, 51, 71, 232, 243, 49, 37, 51, 242, 114, 254,
+ 174, 37, 250, 187, 37, 235, 191, 251, 74, 37, 216, 58, 249, 158, 49, 37,
+ 249, 158, 49, 37, 223, 202, 249, 158, 49, 37, 249, 158, 78, 223, 148, 37,
+ 242, 114, 254, 175, 55, 37, 254, 164, 254, 175, 55, 37, 42, 218, 37, 55,
+ 37, 46, 218, 37, 55, 37, 42, 254, 19, 49, 37, 240, 235, 37, 42, 151, 223,
+ 131, 55, 37, 114, 218, 37, 55, 37, 119, 218, 37, 55, 37, 94, 5, 55, 37,
+ 230, 251, 5, 55, 37, 226, 191, 241, 38, 55, 37, 223, 207, 241, 38, 55,
+ 37, 62, 55, 37, 247, 210, 55, 37, 223, 131, 55, 37, 249, 158, 55, 37,
+ 250, 117, 37, 227, 90, 37, 71, 232, 243, 55, 37, 251, 68, 55, 37, 235,
+ 191, 51, 253, 194, 55, 37, 250, 167, 55, 37, 249, 224, 254, 175, 55, 37,
+ 251, 75, 55, 37, 235, 191, 251, 75, 55, 37, 217, 43, 55, 37, 232, 38, 55,
+ 37, 115, 232, 242, 37, 51, 115, 232, 242, 37, 217, 43, 226, 244, 37, 220,
+ 175, 219, 45, 226, 244, 37, 184, 219, 45, 226, 244, 37, 220, 175, 219,
+ 232, 226, 244, 37, 184, 219, 232, 226, 244, 37, 46, 151, 223, 131, 55,
+ 37, 235, 191, 251, 68, 55, 37, 41, 55, 37, 222, 99, 55, 37, 213, 167, 49,
+ 37, 71, 217, 42, 37, 51, 226, 243, 37, 242, 114, 160, 77, 37, 254, 164,
+ 160, 77, 37, 25, 226, 50, 37, 25, 234, 11, 37, 25, 247, 204, 216, 231,
+ 37, 25, 212, 210, 37, 251, 68, 49, 37, 245, 61, 5, 55, 37, 51, 71, 232,
+ 243, 55, 37, 42, 254, 19, 55, 37, 228, 163, 217, 43, 49, 37, 241, 44, 49,
+ 37, 254, 57, 123, 211, 211, 49, 37, 42, 46, 76, 55, 37, 215, 124, 76, 55,
+ 37, 242, 118, 235, 66, 37, 46, 253, 165, 49, 37, 42, 151, 223, 131, 49,
+ 37, 244, 100, 37, 213, 167, 55, 37, 42, 253, 165, 55, 37, 46, 253, 165,
+ 55, 37, 46, 253, 165, 24, 114, 253, 165, 55, 37, 46, 151, 223, 131, 49,
+ 37, 62, 78, 223, 148, 37, 253, 133, 55, 37, 51, 223, 131, 55, 37, 212,
+ 28, 49, 37, 51, 251, 75, 55, 37, 51, 251, 74, 37, 51, 232, 37, 37, 51,
+ 232, 38, 55, 37, 51, 217, 42, 37, 51, 235, 191, 251, 74, 37, 51, 95, 76,
+ 55, 37, 7, 3, 1, 61, 37, 7, 3, 1, 74, 37, 7, 3, 1, 72, 37, 7, 3, 1, 75,
+ 37, 7, 3, 1, 69, 37, 7, 3, 1, 250, 252, 37, 7, 3, 1, 249, 3, 37, 7, 3, 1,
+ 242, 41, 37, 7, 3, 1, 183, 37, 7, 3, 1, 149, 37, 7, 3, 1, 218, 99, 37, 7,
+ 3, 1, 215, 79, 37, 7, 3, 1, 213, 166, 25, 6, 1, 241, 181, 25, 3, 1, 241,
+ 181, 25, 6, 1, 253, 193, 222, 161, 25, 3, 1, 253, 193, 222, 161, 25, 228,
+ 54, 52, 25, 232, 163, 228, 54, 52, 25, 6, 1, 226, 178, 247, 179, 25, 3,
+ 1, 226, 178, 247, 179, 25, 212, 210, 25, 3, 223, 202, 232, 141, 220, 104,
+ 87, 25, 3, 246, 72, 232, 141, 220, 104, 87, 25, 3, 223, 202, 246, 72,
+ 232, 141, 220, 104, 87, 25, 224, 158, 77, 25, 216, 231, 25, 247, 204,
+ 216, 231, 25, 6, 1, 254, 53, 2, 216, 231, 25, 254, 8, 217, 211, 25, 6, 1,
+ 245, 64, 2, 216, 231, 25, 6, 1, 245, 29, 2, 216, 231, 25, 6, 1, 235, 184,
+ 2, 216, 231, 25, 6, 1, 227, 66, 2, 216, 231, 25, 6, 1, 215, 129, 2, 216,
+ 231, 25, 6, 1, 227, 68, 2, 216, 231, 25, 3, 1, 235, 184, 2, 247, 204, 24,
+ 216, 231, 25, 6, 1, 254, 52, 25, 6, 1, 251, 203, 25, 6, 1, 243, 83, 25,
+ 6, 1, 248, 5, 25, 6, 1, 245, 63, 25, 6, 1, 212, 78, 25, 6, 1, 245, 28,
+ 25, 6, 1, 217, 132, 25, 6, 1, 235, 183, 25, 6, 1, 234, 227, 25, 6, 1,
+ 233, 122, 25, 6, 1, 230, 172, 25, 6, 1, 228, 92, 25, 6, 1, 213, 145, 25,
+ 6, 1, 227, 65, 25, 6, 1, 225, 240, 25, 6, 1, 223, 190, 25, 6, 1, 220,
+ 103, 25, 6, 1, 217, 248, 25, 6, 1, 215, 128, 25, 6, 1, 226, 9, 25, 6, 1,
+ 250, 47, 25, 6, 1, 225, 46, 25, 6, 1, 227, 67, 25, 6, 1, 235, 184, 2,
+ 247, 203, 25, 6, 1, 215, 129, 2, 247, 203, 25, 3, 1, 254, 53, 2, 216,
+ 231, 25, 3, 1, 245, 64, 2, 216, 231, 25, 3, 1, 245, 29, 2, 216, 231, 25,
+ 3, 1, 235, 184, 2, 216, 231, 25, 3, 1, 215, 129, 2, 247, 204, 24, 216,
+ 231, 25, 3, 1, 254, 52, 25, 3, 1, 251, 203, 25, 3, 1, 243, 83, 25, 3, 1,
+ 248, 5, 25, 3, 1, 245, 63, 25, 3, 1, 212, 78, 25, 3, 1, 245, 28, 25, 3,
+ 1, 217, 132, 25, 3, 1, 235, 183, 25, 3, 1, 234, 227, 25, 3, 1, 233, 122,
+ 25, 3, 1, 230, 172, 25, 3, 1, 228, 92, 25, 3, 1, 213, 145, 25, 3, 1, 227,
+ 65, 25, 3, 1, 225, 240, 25, 3, 1, 223, 190, 25, 3, 1, 40, 220, 103, 25,
+ 3, 1, 220, 103, 25, 3, 1, 217, 248, 25, 3, 1, 215, 128, 25, 3, 1, 226, 9,
+ 25, 3, 1, 250, 47, 25, 3, 1, 225, 46, 25, 3, 1, 227, 67, 25, 3, 1, 235,
+ 184, 2, 247, 203, 25, 3, 1, 215, 129, 2, 247, 203, 25, 3, 1, 227, 66, 2,
+ 216, 231, 25, 3, 1, 215, 129, 2, 216, 231, 25, 3, 1, 227, 68, 2, 216,
+ 231, 25, 6, 234, 251, 87, 25, 251, 204, 87, 25, 217, 133, 87, 25, 215,
+ 129, 2, 241, 38, 87, 25, 215, 129, 2, 254, 164, 24, 241, 38, 87, 25, 215,
+ 129, 2, 247, 210, 24, 241, 38, 87, 25, 226, 10, 87, 25, 225, 241, 87, 25,
+ 234, 251, 87, 25, 1, 253, 193, 234, 15, 25, 3, 1, 253, 193, 234, 15, 25,
+ 1, 219, 77, 25, 3, 1, 219, 77, 25, 1, 247, 179, 25, 3, 1, 247, 179, 25,
+ 1, 234, 15, 25, 3, 1, 234, 15, 25, 1, 222, 161, 25, 3, 1, 222, 161, 79,
+ 6, 1, 220, 235, 79, 3, 1, 220, 235, 79, 6, 1, 244, 109, 79, 3, 1, 244,
+ 109, 79, 6, 1, 234, 123, 79, 3, 1, 234, 123, 79, 6, 1, 241, 32, 79, 3, 1,
+ 241, 32, 79, 6, 1, 243, 78, 79, 3, 1, 243, 78, 79, 6, 1, 220, 202, 79, 3,
+ 1, 220, 202, 79, 6, 1, 248, 20, 79, 3, 1, 248, 20, 25, 234, 228, 87, 25,
+ 223, 191, 87, 25, 232, 141, 220, 104, 87, 25, 1, 212, 215, 25, 6, 217,
+ 133, 87, 25, 232, 141, 245, 64, 87, 25, 223, 202, 232, 141, 245, 64, 87,
+ 25, 6, 1, 220, 187, 25, 3, 1, 220, 187, 25, 6, 232, 141, 220, 104, 87,
+ 25, 6, 1, 222, 159, 25, 3, 1, 222, 159, 25, 223, 191, 2, 219, 45, 87, 25,
+ 6, 223, 202, 232, 141, 220, 104, 87, 25, 6, 246, 72, 232, 141, 220, 104,
+ 87, 25, 6, 223, 202, 246, 72, 232, 141, 220, 104, 87, 33, 6, 1, 236, 56,
+ 2, 242, 113, 33, 6, 1, 235, 187, 33, 6, 1, 247, 114, 33, 6, 1, 242, 163,
+ 33, 6, 1, 215, 172, 236, 55, 33, 6, 1, 245, 247, 33, 6, 1, 251, 5, 72,
+ 33, 6, 1, 212, 255, 33, 6, 1, 235, 127, 33, 6, 1, 232, 216, 33, 6, 1,
+ 229, 9, 33, 6, 1, 216, 132, 33, 6, 1, 234, 57, 33, 6, 1, 240, 146, 2,
+ 242, 113, 33, 6, 1, 220, 175, 69, 33, 6, 1, 245, 243, 33, 6, 1, 61, 33,
+ 6, 1, 251, 251, 33, 6, 1, 214, 232, 33, 6, 1, 242, 212, 33, 6, 1, 248,
+ 41, 33, 6, 1, 236, 55, 33, 6, 1, 212, 67, 33, 6, 1, 212, 87, 33, 6, 1,
+ 72, 33, 6, 1, 220, 175, 72, 33, 6, 1, 181, 33, 6, 1, 245, 131, 33, 6, 1,
+ 245, 117, 33, 6, 1, 245, 108, 33, 6, 1, 75, 33, 6, 1, 226, 96, 33, 6, 1,
+ 245, 55, 33, 6, 1, 245, 45, 33, 6, 1, 217, 229, 33, 6, 1, 69, 33, 6, 1,
+ 245, 159, 33, 6, 1, 159, 33, 6, 1, 216, 136, 33, 6, 1, 250, 67, 33, 6, 1,
+ 221, 24, 33, 6, 1, 220, 245, 33, 6, 1, 241, 242, 52, 33, 6, 1, 213, 18,
+ 33, 6, 1, 219, 236, 52, 33, 6, 1, 74, 33, 6, 1, 212, 203, 33, 6, 1, 186,
+ 33, 3, 1, 61, 33, 3, 1, 251, 251, 33, 3, 1, 214, 232, 33, 3, 1, 242, 212,
+ 33, 3, 1, 248, 41, 33, 3, 1, 236, 55, 33, 3, 1, 212, 67, 33, 3, 1, 212,
+ 87, 33, 3, 1, 72, 33, 3, 1, 220, 175, 72, 33, 3, 1, 181, 33, 3, 1, 245,
+ 131, 33, 3, 1, 245, 117, 33, 3, 1, 245, 108, 33, 3, 1, 75, 33, 3, 1, 226,
+ 96, 33, 3, 1, 245, 55, 33, 3, 1, 245, 45, 33, 3, 1, 217, 229, 33, 3, 1,
+ 69, 33, 3, 1, 245, 159, 33, 3, 1, 159, 33, 3, 1, 216, 136, 33, 3, 1, 250,
+ 67, 33, 3, 1, 221, 24, 33, 3, 1, 220, 245, 33, 3, 1, 241, 242, 52, 33, 3,
+ 1, 213, 18, 33, 3, 1, 219, 236, 52, 33, 3, 1, 74, 33, 3, 1, 212, 203, 33,
+ 3, 1, 186, 33, 3, 1, 236, 56, 2, 242, 113, 33, 3, 1, 235, 187, 33, 3, 1,
+ 247, 114, 33, 3, 1, 242, 163, 33, 3, 1, 215, 172, 236, 55, 33, 3, 1, 245,
+ 247, 33, 3, 1, 251, 5, 72, 33, 3, 1, 212, 255, 33, 3, 1, 235, 127, 33, 3,
+ 1, 232, 216, 33, 3, 1, 229, 9, 33, 3, 1, 216, 132, 33, 3, 1, 234, 57, 33,
+ 3, 1, 240, 146, 2, 242, 113, 33, 3, 1, 220, 175, 69, 33, 3, 1, 245, 243,
+ 33, 6, 1, 227, 67, 33, 3, 1, 227, 67, 33, 6, 1, 213, 49, 33, 3, 1, 213,
+ 49, 33, 6, 1, 235, 181, 74, 33, 3, 1, 235, 181, 74, 33, 6, 1, 232, 221,
+ 212, 174, 33, 3, 1, 232, 221, 212, 174, 33, 6, 1, 235, 181, 232, 221,
+ 212, 174, 33, 3, 1, 235, 181, 232, 221, 212, 174, 33, 6, 1, 251, 172,
+ 212, 174, 33, 3, 1, 251, 172, 212, 174, 33, 6, 1, 235, 181, 251, 172,
+ 212, 174, 33, 3, 1, 235, 181, 251, 172, 212, 174, 33, 6, 1, 233, 242, 33,
+ 3, 1, 233, 242, 33, 6, 1, 225, 46, 33, 3, 1, 225, 46, 33, 6, 1, 244, 51,
+ 33, 3, 1, 244, 51, 33, 6, 1, 235, 144, 33, 3, 1, 235, 144, 33, 6, 1, 235,
+ 145, 2, 51, 242, 114, 254, 174, 33, 3, 1, 235, 145, 2, 51, 242, 114, 254,
+ 174, 33, 6, 1, 215, 175, 33, 3, 1, 215, 175, 33, 6, 1, 223, 87, 227, 67,
+ 33, 3, 1, 223, 87, 227, 67, 33, 6, 1, 227, 68, 2, 217, 18, 33, 3, 1, 227,
+ 68, 2, 217, 18, 33, 6, 1, 227, 8, 33, 3, 1, 227, 8, 33, 6, 1, 234, 15,
+ 33, 3, 1, 234, 15, 33, 217, 99, 52, 37, 33, 217, 18, 37, 33, 226, 192,
+ 37, 33, 207, 225, 152, 37, 33, 225, 40, 225, 152, 37, 33, 225, 137, 37,
+ 33, 240, 201, 217, 99, 52, 37, 33, 231, 4, 52, 33, 6, 1, 220, 175, 240,
+ 146, 2, 218, 27, 33, 3, 1, 220, 175, 240, 146, 2, 218, 27, 33, 6, 1, 221,
+ 66, 52, 33, 3, 1, 221, 66, 52, 33, 6, 1, 245, 56, 2, 217, 68, 33, 3, 1,
+ 245, 56, 2, 217, 68, 33, 6, 1, 242, 213, 2, 215, 127, 33, 3, 1, 242, 213,
+ 2, 215, 127, 33, 6, 1, 242, 213, 2, 90, 33, 3, 1, 242, 213, 2, 90, 33, 6,
+ 1, 242, 213, 2, 231, 37, 101, 33, 3, 1, 242, 213, 2, 231, 37, 101, 33, 6,
+ 1, 212, 68, 2, 247, 246, 33, 3, 1, 212, 68, 2, 247, 246, 33, 6, 1, 212,
+ 88, 2, 247, 246, 33, 3, 1, 212, 88, 2, 247, 246, 33, 6, 1, 235, 17, 2,
+ 247, 246, 33, 3, 1, 235, 17, 2, 247, 246, 33, 6, 1, 235, 17, 2, 71, 90,
+ 33, 3, 1, 235, 17, 2, 71, 90, 33, 6, 1, 235, 17, 2, 90, 33, 3, 1, 235,
+ 17, 2, 90, 33, 6, 1, 252, 44, 181, 33, 3, 1, 252, 44, 181, 33, 6, 1, 245,
+ 109, 2, 247, 246, 33, 3, 1, 245, 109, 2, 247, 246, 33, 6, 26, 245, 109,
+ 242, 212, 33, 3, 26, 245, 109, 242, 212, 33, 6, 1, 226, 97, 2, 231, 37,
+ 101, 33, 3, 1, 226, 97, 2, 231, 37, 101, 33, 6, 1, 254, 180, 159, 33, 3,
+ 1, 254, 180, 159, 33, 6, 1, 245, 46, 2, 247, 246, 33, 3, 1, 245, 46, 2,
+ 247, 246, 33, 6, 1, 217, 230, 2, 247, 246, 33, 3, 1, 217, 230, 2, 247,
+ 246, 33, 6, 1, 219, 61, 69, 33, 3, 1, 219, 61, 69, 33, 6, 1, 219, 61,
+ 111, 2, 90, 33, 3, 1, 219, 61, 111, 2, 90, 33, 6, 1, 242, 30, 2, 247,
+ 246, 33, 3, 1, 242, 30, 2, 247, 246, 33, 6, 26, 217, 230, 216, 136, 33,
+ 3, 26, 217, 230, 216, 136, 33, 6, 1, 250, 68, 2, 247, 246, 33, 3, 1, 250,
+ 68, 2, 247, 246, 33, 6, 1, 250, 68, 2, 71, 90, 33, 3, 1, 250, 68, 2, 71,
+ 90, 33, 6, 1, 220, 213, 33, 3, 1, 220, 213, 33, 6, 1, 254, 180, 250, 67,
+ 33, 3, 1, 254, 180, 250, 67, 33, 6, 1, 254, 180, 250, 68, 2, 247, 246,
+ 33, 3, 1, 254, 180, 250, 68, 2, 247, 246, 33, 1, 226, 185, 33, 6, 1, 212,
+ 68, 2, 251, 74, 33, 3, 1, 212, 68, 2, 251, 74, 33, 6, 1, 235, 17, 2, 101,
+ 33, 3, 1, 235, 17, 2, 101, 33, 6, 1, 245, 132, 2, 218, 27, 33, 3, 1, 245,
+ 132, 2, 218, 27, 33, 6, 1, 245, 109, 2, 101, 33, 3, 1, 245, 109, 2, 101,
+ 33, 6, 1, 245, 109, 2, 218, 27, 33, 3, 1, 245, 109, 2, 218, 27, 33, 6, 1,
+ 234, 133, 250, 67, 33, 3, 1, 234, 133, 250, 67, 33, 6, 1, 245, 118, 2,
+ 218, 27, 33, 3, 1, 245, 118, 2, 218, 27, 33, 3, 1, 226, 185, 33, 6, 1,
+ 118, 2, 251, 74, 33, 3, 1, 118, 2, 251, 74, 33, 6, 1, 118, 2, 247, 209,
+ 33, 3, 1, 118, 2, 247, 209, 33, 6, 26, 118, 236, 55, 33, 3, 26, 118, 236,
+ 55, 33, 6, 1, 236, 56, 2, 251, 74, 33, 3, 1, 236, 56, 2, 251, 74, 33, 6,
+ 1, 222, 113, 33, 3, 1, 222, 113, 33, 6, 1, 222, 114, 2, 247, 209, 33, 3,
+ 1, 222, 114, 2, 247, 209, 33, 6, 1, 212, 68, 2, 247, 209, 33, 3, 1, 212,
+ 68, 2, 247, 209, 33, 6, 1, 212, 88, 2, 247, 209, 33, 3, 1, 212, 88, 2,
+ 247, 209, 33, 6, 1, 254, 180, 245, 247, 33, 3, 1, 254, 180, 245, 247, 33,
+ 6, 1, 240, 146, 2, 232, 37, 33, 3, 1, 240, 146, 2, 232, 37, 33, 6, 1,
+ 240, 146, 2, 247, 209, 33, 3, 1, 240, 146, 2, 247, 209, 33, 6, 1, 157, 2,
+ 247, 209, 33, 3, 1, 157, 2, 247, 209, 33, 6, 1, 252, 54, 75, 33, 3, 1,
+ 252, 54, 75, 33, 6, 1, 252, 54, 157, 2, 247, 209, 33, 3, 1, 252, 54, 157,
+ 2, 247, 209, 33, 6, 1, 191, 2, 247, 209, 33, 3, 1, 191, 2, 247, 209, 33,
+ 6, 1, 111, 2, 232, 37, 33, 3, 1, 111, 2, 232, 37, 33, 6, 1, 111, 2, 247,
+ 209, 33, 3, 1, 111, 2, 247, 209, 33, 6, 1, 111, 2, 51, 179, 33, 3, 1,
+ 111, 2, 51, 179, 33, 6, 1, 250, 68, 2, 247, 209, 33, 3, 1, 250, 68, 2,
+ 247, 209, 33, 6, 1, 242, 213, 2, 247, 246, 33, 3, 1, 242, 213, 2, 247,
+ 246, 33, 6, 1, 213, 19, 2, 247, 209, 33, 3, 1, 213, 19, 2, 247, 209, 33,
+ 6, 1, 242, 213, 2, 219, 45, 24, 101, 33, 3, 1, 242, 213, 2, 219, 45, 24,
+ 101, 33, 6, 1, 242, 30, 2, 101, 33, 3, 1, 242, 30, 2, 101, 33, 6, 1, 242,
+ 30, 2, 90, 33, 3, 1, 242, 30, 2, 90, 33, 6, 1, 234, 23, 248, 41, 33, 3,
+ 1, 234, 23, 248, 41, 33, 6, 1, 234, 23, 247, 114, 33, 3, 1, 234, 23, 247,
+ 114, 33, 6, 1, 234, 23, 212, 20, 33, 3, 1, 234, 23, 212, 20, 33, 6, 1,
+ 234, 23, 245, 241, 33, 3, 1, 234, 23, 245, 241, 33, 6, 1, 234, 23, 232,
+ 216, 33, 3, 1, 234, 23, 232, 216, 33, 6, 1, 234, 23, 229, 9, 33, 3, 1,
+ 234, 23, 229, 9, 33, 6, 1, 234, 23, 220, 37, 33, 3, 1, 234, 23, 220, 37,
+ 33, 6, 1, 234, 23, 217, 13, 33, 3, 1, 234, 23, 217, 13, 33, 6, 1, 223,
+ 202, 212, 87, 33, 3, 1, 223, 202, 212, 87, 33, 6, 1, 245, 132, 2, 101,
+ 33, 3, 1, 245, 132, 2, 101, 33, 6, 1, 233, 25, 33, 3, 1, 233, 25, 33, 6,
+ 1, 223, 192, 33, 3, 1, 223, 192, 33, 6, 1, 213, 80, 33, 3, 1, 213, 80,
+ 33, 6, 1, 224, 232, 33, 3, 1, 224, 232, 33, 6, 1, 214, 6, 33, 3, 1, 214,
+ 6, 33, 6, 1, 254, 75, 181, 33, 3, 1, 254, 75, 181, 33, 6, 1, 245, 132, 2,
+ 231, 37, 101, 33, 3, 1, 245, 132, 2, 231, 37, 101, 33, 6, 1, 245, 109, 2,
+ 231, 37, 101, 33, 3, 1, 245, 109, 2, 231, 37, 101, 33, 6, 1, 226, 97, 2,
+ 247, 246, 33, 3, 1, 226, 97, 2, 247, 246, 33, 6, 1, 220, 214, 2, 247,
+ 246, 33, 3, 1, 220, 214, 2, 247, 246, 141, 6, 1, 253, 80, 141, 6, 1, 251,
+ 216, 141, 6, 1, 242, 179, 141, 6, 1, 248, 164, 141, 6, 1, 245, 169, 141,
+ 6, 1, 212, 109, 141, 6, 1, 245, 154, 141, 6, 1, 245, 30, 141, 6, 1, 108,
+ 141, 6, 1, 212, 67, 141, 6, 1, 235, 224, 141, 6, 1, 232, 219, 141, 6, 1,
+ 213, 148, 141, 6, 1, 250, 219, 141, 6, 1, 234, 171, 141, 6, 1, 241, 54,
+ 141, 6, 1, 235, 139, 141, 6, 1, 242, 222, 141, 6, 1, 250, 62, 141, 6, 1,
+ 231, 122, 141, 6, 1, 212, 255, 141, 6, 1, 228, 150, 141, 6, 1, 221, 24,
+ 141, 6, 1, 214, 119, 141, 6, 1, 250, 92, 141, 6, 1, 226, 80, 141, 6, 1,
+ 235, 112, 141, 6, 1, 203, 141, 6, 1, 222, 80, 141, 6, 1, 214, 156, 141,
+ 6, 1, 217, 15, 141, 6, 1, 223, 245, 141, 6, 1, 249, 175, 141, 6, 1, 212,
+ 240, 141, 6, 1, 225, 178, 141, 6, 1, 234, 182, 141, 6, 1, 227, 88, 141,
+ 6, 1, 244, 111, 141, 59, 1, 42, 151, 223, 130, 141, 253, 226, 141, 245,
+ 112, 77, 141, 244, 254, 77, 141, 249, 157, 141, 224, 158, 77, 141, 254,
+ 181, 77, 141, 3, 1, 253, 80, 141, 3, 1, 251, 216, 141, 3, 1, 242, 179,
+ 141, 3, 1, 248, 164, 141, 3, 1, 245, 169, 141, 3, 1, 212, 109, 141, 3, 1,
+ 245, 154, 141, 3, 1, 245, 30, 141, 3, 1, 108, 141, 3, 1, 212, 67, 141, 3,
+ 1, 235, 224, 141, 3, 1, 232, 219, 141, 3, 1, 213, 148, 141, 3, 1, 250,
+ 219, 141, 3, 1, 234, 171, 141, 3, 1, 241, 54, 141, 3, 1, 235, 139, 141,
+ 3, 1, 242, 222, 141, 3, 1, 250, 62, 141, 3, 1, 231, 122, 141, 3, 1, 212,
+ 255, 141, 3, 1, 228, 150, 141, 3, 1, 221, 24, 141, 3, 1, 214, 119, 141,
+ 3, 1, 250, 92, 141, 3, 1, 226, 80, 141, 3, 1, 235, 112, 141, 3, 1, 203,
+ 141, 3, 1, 222, 80, 141, 3, 1, 214, 156, 141, 3, 1, 217, 15, 141, 3, 1,
+ 223, 245, 141, 3, 1, 249, 175, 141, 3, 1, 212, 240, 141, 3, 1, 225, 178,
+ 141, 3, 1, 234, 182, 141, 3, 1, 227, 88, 141, 3, 1, 244, 111, 141, 3, 26,
+ 245, 170, 212, 240, 141, 243, 200, 219, 69, 141, 240, 160, 93, 254, 175,
+ 245, 23, 93, 254, 175, 222, 81, 93, 254, 175, 221, 11, 93, 254, 175, 212,
+ 97, 224, 215, 93, 254, 175, 212, 97, 243, 100, 93, 254, 175, 217, 28, 93,
+ 254, 175, 223, 200, 93, 254, 175, 212, 96, 93, 254, 175, 226, 118, 93,
+ 254, 175, 213, 11, 93, 254, 175, 217, 167, 93, 254, 175, 243, 17, 93,
+ 254, 175, 243, 18, 230, 139, 93, 254, 175, 243, 15, 93, 254, 175, 224,
+ 216, 226, 144, 93, 254, 175, 217, 206, 243, 32, 93, 254, 175, 226, 100,
+ 93, 254, 175, 253, 116, 242, 22, 93, 254, 175, 230, 149, 93, 254, 175,
+ 232, 13, 93, 254, 175, 231, 113, 93, 254, 175, 231, 114, 234, 183, 93,
+ 254, 175, 248, 108, 93, 254, 175, 224, 227, 93, 254, 175, 217, 206, 224,
+ 211, 93, 254, 175, 213, 21, 251, 217, 212, 221, 93, 254, 175, 227, 73,
+ 93, 254, 175, 236, 14, 93, 254, 175, 248, 21, 93, 254, 175, 212, 26, 93,
+ 152, 231, 206, 249, 228, 93, 225, 145, 220, 216, 93, 225, 145, 241, 233,
+ 222, 81, 93, 225, 145, 241, 233, 226, 112, 93, 225, 145, 241, 233, 224,
+ 220, 93, 225, 145, 241, 144, 93, 225, 145, 216, 134, 93, 225, 145, 222,
+ 81, 93, 225, 145, 226, 112, 93, 225, 145, 224, 220, 93, 225, 145, 241,
+ 47, 93, 225, 145, 241, 48, 241, 235, 31, 214, 236, 93, 225, 145, 224,
+ 162, 93, 225, 145, 248, 151, 167, 231, 234, 93, 225, 145, 231, 105, 93,
+ 225, 27, 231, 231, 93, 225, 145, 224, 59, 93, 225, 27, 226, 120, 93, 225,
+ 145, 220, 201, 247, 74, 93, 225, 145, 220, 85, 247, 74, 93, 225, 27, 219,
+ 237, 226, 114, 93, 152, 215, 131, 247, 74, 93, 152, 232, 163, 247, 74,
+ 93, 225, 27, 228, 51, 242, 21, 93, 225, 145, 224, 221, 224, 215, 93, 1,
+ 254, 78, 93, 1, 251, 205, 93, 1, 242, 177, 93, 1, 248, 134, 93, 1, 241,
+ 222, 93, 1, 214, 236, 93, 1, 212, 90, 93, 1, 241, 182, 93, 1, 217, 183,
+ 93, 1, 212, 224, 93, 1, 40, 234, 254, 93, 1, 234, 254, 93, 1, 233, 118,
+ 93, 1, 40, 231, 129, 93, 1, 231, 129, 93, 1, 40, 228, 50, 93, 1, 228, 50,
+ 93, 1, 222, 164, 93, 1, 253, 78, 93, 1, 40, 226, 96, 93, 1, 226, 96, 93,
+ 1, 40, 216, 137, 93, 1, 216, 137, 93, 1, 224, 184, 93, 1, 223, 219, 93,
+ 1, 220, 200, 93, 1, 217, 245, 93, 26, 212, 253, 51, 214, 236, 93, 26,
+ 212, 253, 214, 237, 212, 224, 93, 26, 212, 253, 51, 212, 224, 93, 225,
+ 27, 243, 17, 93, 225, 27, 243, 15, 12, 50, 52, 12, 5, 222, 158, 12, 243,
+ 255, 231, 217, 12, 5, 222, 192, 253, 207, 249, 50, 223, 95, 253, 207,
+ 243, 230, 223, 95, 12, 224, 27, 253, 207, 226, 58, 231, 6, 52, 253, 207,
+ 226, 58, 217, 201, 217, 101, 52, 254, 126, 52, 12, 249, 157, 12, 248, 96,
+ 221, 57, 12, 225, 147, 214, 218, 52, 12, 5, 230, 243, 12, 5, 222, 174,
+ 254, 80, 214, 29, 12, 5, 254, 80, 253, 137, 12, 5, 224, 58, 254, 79, 12,
+ 5, 224, 65, 254, 61, 254, 14, 12, 5, 218, 20, 12, 3, 124, 218, 29, 12, 3,
+ 124, 26, 106, 2, 233, 127, 2, 213, 34, 12, 3, 124, 212, 101, 12, 3, 244,
+ 133, 12, 3, 248, 129, 12, 3, 234, 210, 12, 221, 70, 12, 216, 169, 62,
+ 225, 27, 77, 12, 224, 158, 77, 12, 1, 234, 214, 213, 34, 12, 1, 242, 2,
+ 12, 1, 106, 2, 232, 33, 49, 12, 1, 106, 2, 192, 49, 12, 1, 214, 15, 2,
+ 192, 49, 12, 1, 106, 2, 192, 55, 12, 1, 73, 2, 192, 49, 12, 1, 254, 78,
+ 12, 1, 251, 230, 12, 1, 217, 216, 231, 227, 12, 1, 217, 215, 12, 1, 217,
+ 145, 12, 1, 235, 124, 12, 1, 242, 18, 12, 1, 234, 135, 12, 1, 248, 140,
+ 12, 1, 217, 155, 12, 1, 223, 245, 12, 1, 212, 101, 12, 1, 222, 85, 12, 1,
+ 220, 239, 12, 1, 222, 195, 12, 1, 248, 159, 12, 1, 218, 29, 12, 1, 212,
+ 104, 12, 1, 254, 103, 12, 1, 242, 220, 12, 1, 234, 181, 2, 117, 176, 49,
+ 12, 1, 234, 181, 2, 133, 176, 55, 12, 1, 244, 136, 73, 2, 235, 191, 215,
+ 79, 12, 1, 244, 136, 73, 2, 117, 176, 49, 12, 1, 244, 136, 73, 2, 133,
+ 176, 49, 12, 217, 250, 12, 1, 244, 111, 12, 1, 224, 225, 12, 1, 234, 254,
+ 12, 1, 233, 126, 12, 1, 231, 143, 12, 1, 228, 173, 12, 1, 241, 202, 12,
+ 1, 214, 14, 12, 1, 106, 231, 255, 12, 1, 213, 34, 12, 244, 131, 12, 248,
+ 127, 12, 234, 208, 12, 244, 133, 12, 248, 129, 12, 234, 210, 12, 221, 15,
+ 12, 218, 246, 12, 232, 31, 49, 12, 192, 49, 12, 192, 55, 12, 219, 10,
+ 254, 78, 12, 235, 191, 248, 129, 12, 152, 228, 174, 242, 194, 12, 211,
+ 250, 12, 30, 5, 3, 215, 80, 49, 12, 30, 5, 235, 191, 3, 215, 80, 49, 12,
+ 30, 5, 62, 55, 12, 223, 202, 248, 129, 12, 244, 134, 2, 117, 247, 72, 12,
+ 214, 16, 192, 55, 253, 207, 21, 212, 79, 253, 207, 21, 116, 253, 207, 21,
+ 109, 253, 207, 21, 166, 253, 207, 21, 163, 253, 207, 21, 180, 253, 207,
+ 21, 189, 253, 207, 21, 198, 253, 207, 21, 195, 253, 207, 21, 200, 12,
+ 226, 57, 52, 12, 248, 34, 221, 57, 12, 217, 99, 221, 57, 12, 244, 50,
+ 225, 143, 219, 95, 12, 1, 247, 73, 251, 230, 12, 1, 247, 73, 224, 225,
+ 12, 1, 218, 223, 254, 78, 12, 1, 106, 214, 30, 12, 1, 106, 2, 214, 16,
+ 192, 49, 12, 1, 106, 2, 214, 16, 192, 55, 12, 1, 124, 242, 2, 12, 1, 124,
+ 192, 254, 78, 12, 1, 124, 192, 214, 14, 12, 1, 111, 2, 192, 49, 12, 1,
+ 124, 192, 213, 34, 12, 1, 216, 109, 12, 1, 216, 107, 12, 1, 251, 240, 12,
+ 1, 217, 216, 2, 223, 130, 12, 1, 217, 216, 2, 133, 176, 78, 246, 57, 12,
+ 1, 226, 80, 12, 1, 217, 213, 12, 1, 251, 228, 12, 1, 121, 2, 192, 49, 12,
+ 1, 121, 2, 117, 176, 71, 49, 12, 1, 228, 14, 12, 1, 245, 254, 12, 1, 121,
+ 2, 133, 176, 49, 12, 1, 217, 233, 12, 1, 217, 231, 12, 1, 248, 81, 12, 1,
+ 248, 141, 2, 223, 130, 12, 1, 248, 141, 2, 62, 55, 12, 1, 248, 141, 2,
+ 62, 251, 220, 24, 3, 218, 29, 12, 1, 248, 146, 12, 1, 248, 83, 12, 1,
+ 246, 25, 12, 1, 248, 141, 2, 133, 176, 78, 246, 57, 12, 1, 248, 141, 2,
+ 243, 237, 176, 49, 12, 1, 223, 77, 12, 1, 223, 246, 2, 3, 215, 79, 12, 1,
+ 223, 246, 2, 223, 130, 12, 1, 223, 246, 2, 62, 55, 12, 1, 223, 246, 2, 3,
+ 215, 80, 55, 12, 1, 223, 246, 2, 62, 251, 220, 24, 62, 49, 12, 1, 223,
+ 246, 2, 117, 176, 49, 12, 1, 235, 121, 12, 1, 223, 246, 2, 243, 237, 176,
+ 49, 12, 1, 222, 86, 2, 62, 251, 220, 24, 62, 49, 12, 1, 222, 86, 2, 133,
+ 176, 55, 12, 1, 222, 86, 2, 133, 176, 251, 220, 24, 133, 176, 49, 12, 1,
+ 222, 196, 2, 117, 176, 55, 12, 1, 222, 196, 2, 133, 176, 49, 12, 1, 218,
+ 30, 2, 133, 176, 49, 12, 1, 254, 104, 2, 133, 176, 49, 12, 1, 247, 73,
+ 244, 111, 12, 1, 244, 112, 2, 62, 230, 179, 55, 12, 1, 244, 112, 2, 62,
+ 55, 12, 1, 214, 225, 12, 1, 244, 112, 2, 133, 176, 55, 12, 1, 226, 78,
+ 12, 1, 224, 226, 2, 62, 49, 12, 1, 224, 226, 2, 133, 176, 49, 12, 1, 234,
+ 180, 12, 1, 218, 195, 234, 254, 12, 1, 234, 255, 2, 223, 130, 12, 1, 234,
+ 255, 2, 62, 49, 12, 1, 229, 161, 12, 1, 234, 255, 2, 133, 176, 55, 12, 1,
+ 243, 97, 12, 1, 243, 98, 2, 223, 130, 12, 1, 229, 88, 12, 1, 243, 98, 2,
+ 117, 176, 55, 12, 1, 242, 82, 12, 1, 243, 98, 2, 133, 176, 49, 12, 1,
+ 233, 127, 2, 3, 215, 79, 12, 1, 233, 127, 2, 62, 49, 12, 1, 233, 127, 2,
+ 133, 176, 49, 12, 1, 233, 127, 2, 133, 176, 55, 12, 1, 228, 174, 2, 62,
+ 55, 12, 1, 228, 174, 242, 194, 12, 1, 223, 115, 12, 1, 228, 174, 2, 223,
+ 130, 12, 1, 228, 174, 2, 133, 176, 49, 12, 1, 241, 203, 247, 95, 12, 1,
+ 217, 234, 2, 62, 49, 12, 1, 241, 203, 2, 73, 49, 12, 1, 241, 203, 242,
+ 147, 12, 1, 241, 203, 242, 148, 2, 192, 49, 12, 1, 217, 216, 231, 228,
+ 242, 147, 12, 1, 214, 15, 2, 223, 130, 12, 1, 234, 82, 227, 99, 12, 1,
+ 227, 99, 12, 1, 69, 12, 1, 212, 203, 12, 1, 234, 82, 212, 203, 12, 1,
+ 214, 15, 2, 117, 176, 49, 12, 1, 214, 232, 12, 1, 244, 136, 213, 34, 12,
+ 1, 73, 2, 218, 27, 12, 1, 73, 2, 3, 215, 79, 12, 1, 214, 15, 2, 62, 49,
+ 12, 1, 74, 12, 1, 73, 2, 133, 176, 55, 12, 1, 73, 252, 52, 12, 1, 73,
+ 252, 53, 2, 192, 49, 12, 243, 200, 219, 69, 12, 1, 254, 148, 12, 3, 124,
+ 26, 222, 196, 2, 233, 127, 2, 106, 231, 255, 12, 3, 124, 26, 224, 226, 2,
+ 233, 127, 2, 106, 231, 255, 12, 3, 124, 63, 70, 17, 12, 3, 124, 233, 127,
+ 254, 78, 12, 3, 124, 235, 124, 12, 3, 124, 133, 247, 72, 12, 3, 124, 222,
+ 85, 12, 245, 101, 65, 253, 82, 12, 219, 91, 65, 223, 49, 245, 132, 241,
+ 141, 12, 3, 124, 223, 85, 212, 79, 12, 3, 124, 215, 130, 224, 8, 212, 79,
+ 12, 3, 124, 247, 73, 241, 220, 65, 234, 135, 12, 3, 124, 63, 48, 17, 12,
+ 3, 115, 222, 85, 12, 3, 124, 232, 32, 12, 3, 214, 14, 12, 3, 213, 34, 12,
+ 3, 124, 213, 34, 12, 3, 124, 228, 173, 12, 225, 173, 65, 222, 184, 12,
+ 245, 110, 250, 109, 115, 219, 69, 12, 245, 110, 250, 109, 124, 219, 69,
+ 12, 223, 85, 124, 219, 70, 2, 244, 73, 250, 108, 12, 3, 115, 231, 143,
+ 12, 1, 248, 141, 2, 235, 191, 215, 79, 12, 1, 223, 246, 2, 235, 191, 215,
+ 79, 244, 246, 253, 207, 21, 212, 79, 244, 246, 253, 207, 21, 116, 244,
+ 246, 253, 207, 21, 109, 244, 246, 253, 207, 21, 166, 244, 246, 253, 207,
+ 21, 163, 244, 246, 253, 207, 21, 180, 244, 246, 253, 207, 21, 189, 244,
+ 246, 253, 207, 21, 198, 244, 246, 253, 207, 21, 195, 244, 246, 253, 207,
+ 21, 200, 12, 1, 220, 240, 2, 62, 55, 12, 1, 248, 160, 2, 62, 55, 12, 1,
+ 242, 221, 2, 62, 55, 12, 5, 220, 84, 254, 35, 12, 5, 220, 84, 225, 115,
+ 231, 122, 12, 1, 241, 203, 2, 235, 191, 215, 79, 175, 245, 101, 65, 226,
+ 142, 175, 218, 219, 243, 200, 219, 69, 175, 219, 12, 243, 200, 219, 69,
+ 175, 218, 219, 249, 164, 175, 219, 12, 249, 164, 175, 199, 249, 164, 175,
+ 249, 165, 220, 34, 233, 70, 175, 249, 165, 220, 34, 223, 148, 175, 218,
+ 219, 249, 165, 220, 34, 233, 70, 175, 219, 12, 249, 165, 220, 34, 223,
+ 148, 175, 249, 119, 175, 241, 240, 227, 114, 175, 241, 240, 231, 103,
+ 175, 241, 240, 253, 134, 175, 254, 181, 77, 175, 1, 254, 82, 175, 1, 218,
+ 223, 254, 82, 175, 1, 251, 202, 175, 1, 243, 89, 175, 1, 243, 90, 243,
+ 67, 175, 1, 248, 137, 175, 1, 247, 73, 248, 138, 223, 126, 175, 1, 241,
+ 222, 175, 1, 214, 14, 175, 1, 212, 101, 175, 1, 241, 180, 175, 1, 217,
+ 179, 175, 1, 217, 180, 243, 67, 175, 1, 212, 190, 175, 1, 212, 191, 241,
+ 222, 175, 1, 234, 230, 175, 1, 233, 125, 175, 1, 231, 3, 175, 1, 228, 50,
+ 175, 1, 221, 63, 175, 1, 40, 221, 63, 175, 1, 74, 175, 1, 226, 96, 175,
+ 1, 223, 202, 226, 96, 175, 1, 222, 193, 175, 1, 224, 219, 175, 1, 223,
+ 126, 175, 1, 220, 200, 175, 1, 217, 243, 175, 1, 226, 45, 251, 190, 175,
+ 1, 226, 45, 242, 218, 175, 1, 226, 45, 247, 228, 175, 225, 36, 49, 175,
+ 225, 36, 55, 175, 225, 36, 246, 71, 175, 212, 10, 49, 175, 212, 10, 55,
+ 175, 212, 10, 246, 71, 175, 224, 24, 49, 175, 224, 24, 55, 175, 246, 72,
+ 212, 17, 241, 31, 175, 246, 72, 212, 17, 254, 15, 175, 241, 225, 49, 175,
+ 241, 225, 55, 175, 241, 224, 246, 71, 175, 245, 43, 49, 175, 245, 43, 55,
+ 175, 223, 19, 175, 244, 105, 247, 74, 175, 224, 137, 175, 223, 45, 175,
+ 117, 71, 176, 49, 175, 117, 71, 176, 55, 175, 133, 176, 49, 175, 133,
+ 176, 55, 175, 227, 112, 232, 243, 49, 175, 227, 112, 232, 243, 55, 175,
+ 230, 126, 175, 252, 51, 175, 1, 219, 233, 212, 73, 175, 1, 219, 233, 234,
+ 128, 175, 1, 219, 233, 244, 123, 12, 1, 251, 231, 2, 133, 176, 240, 237,
+ 55, 12, 1, 251, 231, 2, 62, 251, 220, 24, 133, 176, 49, 12, 1, 251, 231,
+ 2, 133, 176, 225, 141, 215, 124, 55, 12, 1, 251, 231, 2, 133, 176, 225,
+ 141, 215, 124, 251, 220, 24, 117, 176, 49, 12, 1, 251, 231, 2, 117, 176,
+ 251, 220, 24, 62, 49, 12, 1, 251, 231, 2, 235, 191, 3, 215, 80, 55, 12,
+ 1, 251, 231, 2, 3, 215, 79, 12, 1, 121, 2, 117, 176, 49, 12, 1, 121, 2,
+ 133, 176, 225, 141, 215, 124, 55, 12, 1, 248, 141, 2, 117, 176, 214, 166,
+ 251, 220, 24, 3, 218, 29, 12, 1, 248, 141, 2, 235, 191, 3, 215, 80, 55,
+ 12, 1, 223, 246, 2, 90, 12, 1, 222, 86, 2, 243, 237, 176, 49, 12, 1, 254,
+ 104, 2, 117, 176, 49, 12, 1, 254, 104, 2, 133, 176, 225, 141, 246, 58,
+ 49, 12, 1, 254, 104, 2, 117, 176, 214, 166, 49, 12, 1, 244, 112, 2, 117,
+ 176, 55, 12, 1, 244, 112, 2, 133, 176, 225, 141, 215, 124, 55, 12, 1,
+ 234, 181, 2, 62, 49, 12, 1, 234, 181, 2, 133, 176, 49, 12, 1, 234, 181,
+ 2, 133, 176, 225, 141, 215, 124, 55, 12, 1, 63, 2, 62, 49, 12, 1, 63, 2,
+ 62, 55, 12, 1, 228, 174, 2, 117, 176, 55, 12, 1, 228, 174, 2, 3, 218, 29,
+ 12, 1, 228, 174, 2, 3, 215, 79, 12, 1, 233, 127, 2, 134, 12, 1, 223, 246,
+ 2, 117, 176, 214, 166, 49, 12, 1, 223, 246, 2, 192, 49, 12, 1, 222, 86,
+ 2, 117, 176, 214, 166, 49, 12, 1, 121, 2, 3, 12, 1, 218, 30, 55, 12, 1,
+ 121, 2, 3, 12, 1, 218, 30, 24, 117, 247, 72, 12, 1, 222, 86, 2, 3, 12, 1,
+ 218, 30, 24, 117, 247, 72, 12, 1, 223, 246, 2, 3, 12, 1, 218, 30, 24,
+ 117, 247, 72, 12, 1, 121, 2, 3, 12, 1, 218, 30, 49, 12, 1, 106, 2, 244,
+ 246, 253, 207, 21, 117, 49, 12, 1, 106, 2, 244, 246, 253, 207, 21, 133,
+ 49, 12, 1, 244, 136, 73, 2, 244, 246, 253, 207, 21, 117, 49, 12, 1, 244,
+ 136, 73, 2, 244, 246, 253, 207, 21, 133, 49, 12, 1, 244, 136, 73, 2, 244,
+ 246, 253, 207, 21, 243, 237, 55, 12, 1, 214, 15, 2, 244, 246, 253, 207,
+ 21, 117, 49, 12, 1, 214, 15, 2, 244, 246, 253, 207, 21, 133, 49, 12, 1,
+ 73, 252, 53, 2, 244, 246, 253, 207, 21, 117, 49, 12, 1, 73, 252, 53, 2,
+ 244, 246, 253, 207, 21, 133, 49, 12, 1, 121, 2, 244, 246, 253, 207, 21,
+ 243, 237, 55, 12, 1, 222, 86, 2, 244, 246, 253, 207, 21, 243, 237, 49,
+ 12, 1, 222, 86, 2, 235, 191, 215, 79, 12, 1, 234, 255, 2, 117, 176, 49,
+ 217, 158, 1, 242, 27, 217, 158, 1, 220, 248, 217, 158, 1, 228, 172, 217,
+ 158, 1, 224, 74, 217, 158, 1, 252, 106, 217, 158, 1, 233, 22, 217, 158,
+ 1, 235, 12, 217, 158, 1, 254, 68, 217, 158, 1, 214, 255, 217, 158, 1,
+ 231, 142, 217, 158, 1, 244, 162, 217, 158, 1, 247, 231, 217, 158, 1, 217,
+ 160, 217, 158, 1, 233, 153, 217, 158, 1, 243, 106, 217, 158, 1, 242, 153,
+ 217, 158, 1, 222, 84, 217, 158, 1, 248, 94, 217, 158, 1, 212, 93, 217,
+ 158, 1, 217, 244, 217, 158, 1, 213, 91, 217, 158, 1, 226, 107, 217, 158,
+ 1, 235, 129, 217, 158, 1, 250, 70, 217, 158, 1, 216, 114, 217, 158, 1,
+ 241, 173, 217, 158, 1, 234, 137, 217, 158, 1, 217, 159, 217, 158, 1, 212,
+ 108, 217, 158, 1, 220, 238, 217, 158, 1, 222, 199, 217, 158, 1, 248, 162,
+ 217, 158, 1, 108, 217, 158, 1, 212, 16, 217, 158, 1, 254, 101, 217, 158,
+ 1, 242, 219, 217, 158, 1, 224, 229, 217, 158, 1, 214, 47, 217, 158, 254,
+ 182, 217, 158, 254, 197, 217, 158, 240, 107, 217, 158, 245, 164, 217,
+ 158, 215, 191, 217, 158, 227, 48, 217, 158, 245, 172, 217, 158, 244, 240,
+ 217, 158, 227, 111, 217, 158, 227, 119, 217, 158, 218, 246, 217, 158, 1,
+ 230, 43, 228, 224, 21, 212, 79, 228, 224, 21, 116, 228, 224, 21, 109,
+ 228, 224, 21, 166, 228, 224, 21, 163, 228, 224, 21, 180, 228, 224, 21,
+ 189, 228, 224, 21, 198, 228, 224, 21, 195, 228, 224, 21, 200, 228, 224,
+ 1, 61, 228, 224, 1, 245, 165, 228, 224, 1, 72, 228, 224, 1, 74, 228, 224,
+ 1, 69, 228, 224, 1, 227, 49, 228, 224, 1, 75, 228, 224, 1, 248, 152, 228,
+ 224, 1, 204, 228, 224, 1, 252, 107, 228, 224, 1, 193, 228, 224, 1, 218,
+ 52, 228, 224, 1, 235, 139, 228, 224, 1, 250, 92, 228, 224, 1, 248, 164,
+ 228, 224, 1, 203, 228, 224, 1, 223, 81, 228, 224, 1, 222, 202, 228, 224,
+ 1, 243, 55, 228, 224, 1, 244, 164, 228, 224, 1, 181, 228, 224, 1, 233,
+ 157, 228, 224, 1, 230, 46, 213, 210, 228, 224, 1, 188, 228, 224, 1, 228,
+ 23, 228, 224, 1, 205, 228, 224, 1, 159, 228, 224, 1, 214, 49, 228, 224,
+ 1, 186, 228, 224, 1, 228, 24, 213, 210, 228, 224, 1, 235, 64, 235, 139,
+ 228, 224, 1, 235, 64, 250, 92, 228, 224, 1, 235, 64, 203, 228, 224, 37,
+ 220, 175, 124, 216, 241, 228, 224, 37, 220, 175, 115, 216, 241, 228, 224,
+ 37, 220, 175, 223, 125, 216, 241, 228, 224, 37, 184, 247, 245, 216, 241,
+ 228, 224, 37, 184, 124, 216, 241, 228, 224, 37, 184, 115, 216, 241, 228,
+ 224, 37, 184, 223, 125, 216, 241, 228, 224, 37, 230, 13, 77, 228, 224,
+ 37, 51, 62, 49, 228, 224, 124, 160, 253, 226, 228, 224, 115, 160, 253,
+ 226, 228, 224, 16, 227, 50, 248, 1, 228, 224, 16, 243, 54, 228, 224, 249,
+ 157, 228, 224, 244, 254, 77, 228, 224, 233, 132, 222, 167, 1, 254, 84,
+ 222, 167, 1, 251, 151, 222, 167, 1, 243, 88, 222, 167, 1, 248, 139, 222,
+ 167, 1, 235, 150, 222, 167, 1, 252, 106, 222, 167, 1, 212, 82, 222, 167,
+ 1, 235, 158, 222, 167, 1, 217, 20, 222, 167, 1, 212, 173, 222, 167, 1,
+ 235, 13, 222, 167, 1, 233, 150, 222, 167, 1, 231, 3, 222, 167, 1, 228,
+ 50, 222, 167, 1, 220, 82, 222, 167, 1, 235, 251, 222, 167, 1, 244, 90,
+ 222, 167, 1, 216, 139, 222, 167, 1, 224, 155, 222, 167, 1, 223, 126, 222,
+ 167, 1, 221, 8, 222, 167, 1, 218, 48, 222, 167, 152, 235, 251, 222, 167,
+ 152, 235, 250, 222, 167, 152, 227, 107, 222, 167, 152, 248, 150, 222,
+ 167, 59, 1, 245, 68, 212, 173, 222, 167, 152, 245, 68, 212, 173, 222,
+ 167, 30, 5, 184, 74, 222, 167, 30, 5, 74, 222, 167, 30, 5, 226, 242, 254,
+ 232, 222, 167, 30, 5, 184, 254, 232, 222, 167, 30, 5, 254, 232, 222, 167,
+ 30, 5, 226, 242, 61, 222, 167, 30, 5, 184, 61, 222, 167, 30, 5, 61, 222,
+ 167, 59, 1, 220, 175, 61, 222, 167, 30, 5, 220, 175, 61, 222, 167, 30, 5,
+ 184, 69, 222, 167, 30, 5, 69, 222, 167, 59, 1, 72, 222, 167, 30, 5, 184,
+ 72, 222, 167, 30, 5, 72, 222, 167, 30, 5, 75, 222, 167, 30, 5, 218, 246,
+ 222, 167, 152, 229, 174, 222, 167, 225, 27, 229, 174, 222, 167, 225, 27,
+ 254, 123, 222, 167, 225, 27, 254, 23, 222, 167, 225, 27, 252, 34, 222,
+ 167, 225, 27, 253, 117, 222, 167, 225, 27, 220, 188, 222, 167, 254, 181,
+ 77, 222, 167, 225, 27, 231, 132, 224, 190, 222, 167, 225, 27, 212, 24,
+ 222, 167, 225, 27, 224, 190, 222, 167, 225, 27, 212, 107, 222, 167, 225,
+ 27, 216, 54, 222, 167, 225, 27, 253, 180, 222, 167, 225, 27, 219, 237,
+ 231, 208, 222, 167, 225, 27, 254, 11, 231, 245, 1, 242, 7, 231, 245, 1,
+ 254, 185, 231, 245, 1, 254, 121, 231, 245, 1, 254, 160, 231, 245, 1, 254,
+ 114, 231, 245, 1, 215, 98, 231, 245, 1, 253, 76, 231, 245, 1, 235, 158,
+ 231, 245, 1, 253, 114, 231, 245, 1, 254, 89, 231, 245, 1, 254, 94, 231,
+ 245, 1, 254, 86, 231, 245, 1, 254, 45, 231, 245, 1, 254, 32, 231, 245, 1,
+ 253, 152, 231, 245, 1, 235, 251, 231, 245, 1, 253, 239, 231, 245, 1, 253,
+ 124, 231, 245, 1, 253, 215, 231, 245, 1, 253, 211, 231, 245, 1, 253, 146,
+ 231, 245, 1, 253, 122, 231, 245, 1, 246, 10, 231, 245, 1, 235, 6, 231,
+ 245, 1, 254, 103, 231, 245, 254, 127, 77, 231, 245, 214, 117, 77, 231,
+ 245, 243, 29, 77, 231, 245, 225, 26, 82, 5, 235, 191, 250, 187, 82, 5,
+ 250, 187, 82, 5, 253, 242, 82, 5, 214, 128, 82, 1, 220, 175, 61, 82, 1,
+ 61, 82, 1, 254, 232, 82, 1, 72, 82, 1, 236, 28, 82, 1, 69, 82, 1, 215,
+ 92, 82, 1, 161, 149, 82, 1, 161, 150, 82, 1, 250, 190, 74, 82, 1, 220,
+ 175, 74, 82, 1, 74, 82, 1, 254, 108, 82, 1, 250, 190, 75, 82, 1, 220,
+ 175, 75, 82, 1, 75, 82, 1, 253, 108, 82, 1, 181, 82, 1, 234, 138, 82, 1,
+ 243, 110, 82, 1, 242, 225, 82, 1, 229, 159, 82, 1, 250, 219, 82, 1, 250,
+ 92, 82, 1, 235, 139, 82, 1, 235, 115, 82, 1, 228, 23, 82, 1, 216, 115,
+ 82, 1, 216, 105, 82, 1, 248, 86, 82, 1, 248, 70, 82, 1, 228, 198, 82, 1,
+ 218, 52, 82, 1, 217, 161, 82, 1, 248, 164, 82, 1, 247, 232, 82, 1, 205,
+ 82, 1, 228, 189, 82, 1, 193, 82, 1, 226, 23, 82, 1, 252, 107, 82, 1, 251,
+ 195, 82, 1, 188, 82, 1, 186, 82, 1, 203, 82, 1, 223, 81, 82, 1, 233, 157,
+ 82, 1, 232, 213, 82, 1, 232, 212, 82, 1, 215, 1, 82, 1, 221, 24, 82, 1,
+ 219, 157, 82, 1, 222, 202, 82, 1, 159, 82, 30, 5, 227, 99, 82, 30, 5,
+ 227, 47, 82, 5, 228, 60, 82, 5, 253, 91, 82, 30, 5, 254, 232, 82, 30, 5,
+ 72, 82, 30, 5, 236, 28, 82, 30, 5, 69, 82, 30, 5, 215, 92, 82, 30, 5,
+ 161, 149, 82, 30, 5, 161, 223, 82, 82, 30, 5, 250, 190, 74, 82, 30, 5,
+ 220, 175, 74, 82, 30, 5, 74, 82, 30, 5, 254, 108, 82, 30, 5, 250, 190,
+ 75, 82, 30, 5, 220, 175, 75, 82, 30, 5, 75, 82, 30, 5, 253, 108, 82, 5,
+ 214, 133, 82, 30, 5, 225, 66, 74, 82, 30, 5, 253, 87, 82, 227, 70, 82,
+ 219, 51, 5, 215, 185, 82, 219, 51, 5, 253, 244, 82, 242, 114, 254, 174,
+ 82, 254, 164, 254, 174, 82, 30, 5, 250, 190, 184, 74, 82, 30, 5, 215,
+ 183, 82, 30, 5, 215, 91, 82, 1, 224, 232, 82, 1, 234, 121, 82, 1, 242,
+ 202, 82, 1, 212, 109, 82, 1, 248, 75, 82, 1, 223, 192, 82, 1, 244, 164,
+ 82, 1, 212, 160, 82, 1, 161, 223, 82, 82, 1, 161, 232, 214, 82, 30, 5,
+ 161, 150, 82, 30, 5, 161, 232, 214, 82, 248, 123, 82, 51, 248, 123, 82,
+ 21, 212, 79, 82, 21, 116, 82, 21, 109, 82, 21, 166, 82, 21, 163, 82, 21,
+ 180, 82, 21, 189, 82, 21, 198, 82, 21, 195, 82, 21, 200, 82, 254, 181,
+ 52, 82, 5, 124, 219, 205, 247, 74, 82, 1, 250, 190, 61, 82, 1, 227, 99,
+ 82, 1, 227, 47, 82, 1, 253, 87, 82, 1, 215, 183, 82, 1, 215, 91, 82, 1,
+ 212, 75, 82, 1, 107, 186, 82, 1, 243, 5, 82, 1, 235, 99, 82, 1, 242, 156,
+ 219, 69, 82, 1, 248, 76, 82, 1, 252, 31, 140, 5, 250, 187, 140, 5, 253,
+ 242, 140, 5, 214, 128, 140, 1, 61, 140, 1, 254, 232, 140, 1, 72, 140, 1,
+ 236, 28, 140, 1, 69, 140, 1, 215, 92, 140, 1, 161, 149, 140, 1, 161, 150,
+ 140, 1, 74, 140, 1, 254, 108, 140, 1, 75, 140, 1, 253, 108, 140, 1, 181,
+ 140, 1, 234, 138, 140, 1, 243, 110, 140, 1, 242, 225, 140, 1, 229, 159,
+ 140, 1, 250, 219, 140, 1, 250, 92, 140, 1, 235, 139, 140, 1, 235, 115,
+ 140, 1, 228, 23, 140, 1, 216, 115, 140, 1, 216, 105, 140, 1, 248, 86,
+ 140, 1, 248, 70, 140, 1, 228, 198, 140, 1, 218, 52, 140, 1, 217, 161,
+ 140, 1, 248, 164, 140, 1, 247, 232, 140, 1, 205, 140, 1, 193, 140, 1,
+ 226, 23, 140, 1, 252, 107, 140, 1, 251, 195, 140, 1, 188, 140, 1, 186,
+ 140, 1, 203, 140, 1, 233, 157, 140, 1, 221, 24, 140, 1, 219, 157, 140, 1,
+ 222, 202, 140, 1, 159, 140, 5, 228, 60, 140, 5, 253, 91, 140, 30, 5, 254,
+ 232, 140, 30, 5, 72, 140, 30, 5, 236, 28, 140, 30, 5, 69, 140, 30, 5,
+ 215, 92, 140, 30, 5, 161, 149, 140, 30, 5, 161, 223, 82, 140, 30, 5, 74,
+ 140, 30, 5, 254, 108, 140, 30, 5, 75, 140, 30, 5, 253, 108, 140, 5, 214,
+ 133, 140, 1, 234, 130, 218, 52, 140, 253, 109, 233, 47, 77, 140, 1, 223,
+ 81, 140, 1, 223, 192, 140, 1, 212, 160, 140, 1, 161, 223, 82, 140, 1,
+ 161, 232, 214, 140, 30, 5, 161, 150, 140, 30, 5, 161, 232, 214, 140, 21,
+ 212, 79, 140, 21, 116, 140, 21, 109, 140, 21, 166, 140, 21, 163, 140, 21,
+ 180, 140, 21, 189, 140, 21, 198, 140, 21, 195, 140, 21, 200, 140, 1, 224,
+ 77, 2, 231, 37, 247, 206, 140, 1, 224, 77, 2, 232, 163, 247, 206, 140,
+ 223, 29, 77, 140, 223, 29, 52, 140, 249, 39, 228, 53, 116, 140, 249, 39,
+ 228, 53, 109, 140, 249, 39, 228, 53, 166, 140, 249, 39, 228, 53, 163,
+ 140, 249, 39, 228, 53, 122, 233, 40, 217, 154, 217, 149, 247, 255, 140,
+ 249, 39, 248, 0, 220, 47, 140, 235, 159, 140, 243, 79, 77, 173, 5, 254,
+ 159, 251, 166, 173, 5, 251, 166, 173, 5, 214, 128, 173, 1, 61, 173, 1,
+ 254, 232, 173, 1, 72, 173, 1, 236, 28, 173, 1, 69, 173, 1, 215, 92, 173,
+ 1, 245, 165, 173, 1, 254, 108, 173, 1, 227, 49, 173, 1, 253, 108, 173, 1,
+ 181, 173, 1, 234, 138, 173, 1, 243, 110, 173, 1, 242, 225, 173, 1, 229,
+ 159, 173, 1, 250, 219, 173, 1, 250, 92, 173, 1, 235, 139, 173, 1, 235,
+ 115, 173, 1, 228, 23, 173, 1, 216, 115, 173, 1, 216, 105, 173, 1, 248,
+ 86, 173, 1, 248, 70, 173, 1, 228, 198, 173, 1, 218, 52, 173, 1, 217, 161,
+ 173, 1, 248, 164, 173, 1, 247, 232, 173, 1, 205, 173, 1, 193, 173, 1,
+ 226, 23, 173, 1, 252, 107, 173, 1, 251, 195, 173, 1, 188, 173, 1, 186,
+ 173, 1, 203, 173, 1, 233, 157, 173, 1, 232, 213, 173, 1, 215, 1, 173, 1,
+ 221, 24, 173, 1, 222, 202, 173, 1, 159, 173, 5, 228, 60, 173, 30, 5, 254,
+ 232, 173, 30, 5, 72, 173, 30, 5, 236, 28, 173, 30, 5, 69, 173, 30, 5,
+ 215, 92, 173, 30, 5, 245, 165, 173, 30, 5, 254, 108, 173, 30, 5, 227, 49,
+ 173, 30, 5, 253, 108, 173, 5, 214, 133, 173, 5, 215, 187, 173, 1, 234,
+ 121, 173, 1, 242, 202, 173, 1, 212, 109, 173, 1, 223, 81, 173, 1, 244,
+ 164, 173, 21, 212, 79, 173, 21, 116, 173, 21, 109, 173, 21, 166, 173, 21,
+ 163, 173, 21, 180, 173, 21, 189, 173, 21, 198, 173, 21, 195, 173, 21,
+ 200, 173, 217, 27, 173, 254, 158, 173, 235, 176, 173, 215, 117, 173, 245,
+ 138, 227, 54, 173, 5, 213, 67, 164, 5, 250, 187, 164, 5, 253, 242, 164,
+ 5, 214, 128, 164, 1, 61, 164, 1, 254, 232, 164, 1, 72, 164, 1, 236, 28,
+ 164, 1, 69, 164, 1, 215, 92, 164, 1, 161, 149, 164, 1, 161, 150, 164, 30,
+ 250, 190, 74, 164, 1, 74, 164, 1, 254, 108, 164, 30, 250, 190, 75, 164,
+ 1, 75, 164, 1, 253, 108, 164, 1, 181, 164, 1, 234, 138, 164, 1, 243, 110,
+ 164, 1, 242, 225, 164, 1, 229, 159, 164, 1, 250, 219, 164, 1, 250, 92,
+ 164, 1, 235, 139, 164, 1, 235, 115, 164, 1, 228, 23, 164, 1, 216, 115,
+ 164, 1, 216, 105, 164, 1, 248, 86, 164, 1, 248, 70, 164, 1, 228, 198,
+ 164, 1, 218, 52, 164, 1, 217, 161, 164, 1, 248, 164, 164, 1, 247, 232,
+ 164, 1, 205, 164, 1, 193, 164, 1, 226, 23, 164, 1, 252, 107, 164, 1, 251,
+ 195, 164, 1, 188, 164, 1, 186, 164, 1, 203, 164, 1, 233, 157, 164, 1,
+ 232, 213, 164, 1, 215, 1, 164, 1, 221, 24, 164, 1, 219, 157, 164, 1, 222,
+ 202, 164, 1, 159, 164, 5, 228, 60, 164, 5, 253, 91, 164, 30, 5, 254, 232,
+ 164, 30, 5, 72, 164, 30, 5, 236, 28, 164, 30, 5, 69, 164, 30, 5, 215, 92,
+ 164, 30, 5, 161, 149, 164, 30, 5, 161, 223, 82, 164, 30, 5, 250, 190, 74,
+ 164, 30, 5, 74, 164, 30, 5, 254, 108, 164, 30, 5, 250, 190, 75, 164, 30,
+ 5, 75, 164, 30, 5, 253, 108, 164, 5, 214, 133, 164, 227, 70, 164, 1, 161,
+ 223, 82, 164, 1, 161, 232, 214, 164, 30, 5, 161, 150, 164, 30, 5, 161,
+ 232, 214, 164, 21, 212, 79, 164, 21, 116, 164, 21, 109, 164, 21, 166,
+ 164, 21, 163, 164, 21, 180, 164, 21, 189, 164, 21, 198, 164, 21, 195,
+ 164, 21, 200, 164, 223, 29, 52, 147, 5, 250, 187, 147, 5, 253, 242, 147,
+ 5, 214, 128, 147, 1, 61, 147, 1, 254, 232, 147, 1, 72, 147, 1, 236, 28,
+ 147, 1, 69, 147, 1, 215, 92, 147, 1, 161, 149, 147, 1, 161, 150, 147, 1,
+ 74, 147, 1, 254, 108, 147, 1, 75, 147, 1, 253, 108, 147, 1, 181, 147, 1,
+ 234, 138, 147, 1, 243, 110, 147, 1, 242, 225, 147, 1, 229, 159, 147, 1,
+ 250, 219, 147, 1, 250, 92, 147, 1, 235, 139, 147, 1, 235, 115, 147, 1,
+ 228, 23, 147, 1, 216, 115, 147, 1, 216, 105, 147, 1, 248, 86, 147, 1,
+ 248, 70, 147, 1, 228, 198, 147, 1, 218, 52, 147, 1, 217, 161, 147, 1,
+ 248, 164, 147, 1, 247, 232, 147, 1, 205, 147, 1, 193, 147, 1, 226, 23,
+ 147, 1, 252, 107, 147, 1, 251, 195, 147, 1, 188, 147, 1, 186, 147, 1,
+ 203, 147, 1, 233, 157, 147, 1, 232, 213, 147, 1, 215, 1, 147, 1, 221, 24,
+ 147, 1, 219, 157, 147, 1, 222, 202, 147, 1, 159, 147, 5, 228, 60, 147, 5,
+ 253, 91, 147, 30, 5, 254, 232, 147, 30, 5, 72, 147, 30, 5, 236, 28, 147,
+ 30, 5, 69, 147, 30, 5, 215, 92, 147, 30, 5, 161, 149, 147, 30, 5, 161,
+ 223, 82, 147, 30, 5, 74, 147, 30, 5, 254, 108, 147, 30, 5, 75, 147, 30,
+ 5, 253, 108, 147, 5, 214, 133, 147, 254, 109, 233, 47, 77, 147, 253, 109,
+ 233, 47, 77, 147, 1, 223, 81, 147, 1, 223, 192, 147, 1, 212, 160, 147, 1,
+ 161, 223, 82, 147, 1, 161, 232, 214, 147, 30, 5, 161, 150, 147, 30, 5,
+ 161, 232, 214, 147, 21, 212, 79, 147, 21, 116, 147, 21, 109, 147, 21,
+ 166, 147, 21, 163, 147, 21, 180, 147, 21, 189, 147, 21, 198, 147, 21,
+ 195, 147, 21, 200, 147, 235, 159, 147, 1, 214, 49, 147, 243, 228, 122,
+ 224, 166, 147, 243, 228, 122, 242, 9, 147, 243, 228, 133, 224, 164, 147,
+ 243, 228, 122, 220, 45, 147, 243, 228, 122, 245, 145, 147, 243, 228, 133,
+ 220, 44, 178, 5, 253, 242, 178, 5, 214, 128, 178, 1, 61, 178, 1, 254,
+ 232, 178, 1, 72, 178, 1, 236, 28, 178, 1, 69, 178, 1, 215, 92, 178, 1,
+ 74, 178, 1, 245, 165, 178, 1, 254, 108, 178, 1, 75, 178, 1, 227, 49, 178,
+ 1, 253, 108, 178, 1, 181, 178, 1, 229, 159, 178, 1, 250, 219, 178, 1,
+ 235, 139, 178, 1, 228, 23, 178, 1, 216, 115, 178, 1, 228, 198, 178, 1,
+ 218, 52, 178, 1, 205, 178, 1, 228, 189, 178, 1, 193, 178, 1, 188, 178, 1,
+ 186, 178, 1, 203, 178, 1, 223, 81, 178, 1, 233, 157, 178, 1, 232, 213,
+ 178, 1, 232, 212, 178, 1, 215, 1, 178, 1, 221, 24, 178, 1, 219, 157, 178,
+ 1, 222, 202, 178, 1, 159, 178, 30, 5, 254, 232, 178, 30, 5, 72, 178, 30,
+ 5, 236, 28, 178, 30, 5, 69, 178, 30, 5, 215, 92, 178, 30, 5, 74, 178, 30,
+ 5, 245, 165, 178, 30, 5, 254, 108, 178, 30, 5, 75, 178, 30, 5, 227, 49,
+ 178, 30, 5, 253, 108, 178, 5, 214, 133, 178, 227, 70, 178, 253, 109, 233,
+ 47, 77, 178, 21, 212, 79, 178, 21, 116, 178, 21, 109, 178, 21, 166, 178,
+ 21, 163, 178, 21, 180, 178, 21, 189, 178, 21, 198, 178, 21, 195, 178, 21,
+ 200, 178, 50, 217, 200, 178, 50, 122, 240, 200, 178, 50, 122, 217, 100,
+ 178, 248, 92, 52, 178, 230, 205, 52, 178, 213, 36, 52, 178, 248, 38, 52,
+ 178, 249, 79, 52, 178, 253, 153, 78, 52, 178, 223, 29, 52, 178, 50, 52,
+ 139, 5, 250, 187, 139, 5, 253, 242, 139, 5, 214, 128, 139, 1, 61, 139, 1,
+ 254, 232, 139, 1, 72, 139, 1, 236, 28, 139, 1, 69, 139, 1, 215, 92, 139,
+ 1, 161, 149, 139, 1, 161, 150, 139, 1, 74, 139, 1, 245, 165, 139, 1, 254,
+ 108, 139, 1, 75, 139, 1, 227, 49, 139, 1, 253, 108, 139, 1, 181, 139, 1,
+ 234, 138, 139, 1, 243, 110, 139, 1, 242, 225, 139, 1, 229, 159, 139, 1,
+ 250, 219, 139, 1, 250, 92, 139, 1, 235, 139, 139, 1, 235, 115, 139, 1,
+ 228, 23, 139, 1, 216, 115, 139, 1, 216, 105, 139, 1, 248, 86, 139, 1,
+ 248, 70, 139, 1, 228, 198, 139, 1, 218, 52, 139, 1, 217, 161, 139, 1,
+ 248, 164, 139, 1, 247, 232, 139, 1, 205, 139, 1, 193, 139, 1, 226, 23,
+ 139, 1, 252, 107, 139, 1, 251, 195, 139, 1, 188, 139, 1, 186, 139, 1,
+ 203, 139, 1, 223, 81, 139, 1, 233, 157, 139, 1, 232, 213, 139, 1, 215, 1,
+ 139, 1, 221, 24, 139, 1, 219, 157, 139, 1, 222, 202, 139, 1, 159, 139, 5,
+ 253, 91, 139, 30, 5, 254, 232, 139, 30, 5, 72, 139, 30, 5, 236, 28, 139,
+ 30, 5, 69, 139, 30, 5, 215, 92, 139, 30, 5, 161, 149, 139, 30, 5, 161,
+ 223, 82, 139, 30, 5, 74, 139, 30, 5, 245, 165, 139, 30, 5, 254, 108, 139,
+ 30, 5, 75, 139, 30, 5, 227, 49, 139, 30, 5, 253, 108, 139, 5, 214, 133,
+ 139, 233, 47, 77, 139, 254, 109, 233, 47, 77, 139, 1, 216, 141, 139, 1,
+ 245, 249, 139, 1, 161, 223, 82, 139, 1, 161, 232, 214, 139, 30, 5, 161,
+ 150, 139, 30, 5, 161, 232, 214, 139, 21, 212, 79, 139, 21, 116, 139, 21,
+ 109, 139, 21, 166, 139, 21, 163, 139, 21, 180, 139, 21, 189, 139, 21,
+ 198, 139, 21, 195, 139, 21, 200, 139, 243, 228, 21, 212, 80, 31, 227,
+ 102, 225, 103, 65, 163, 139, 243, 228, 21, 122, 31, 227, 102, 225, 103,
+ 65, 163, 139, 243, 228, 21, 117, 31, 227, 102, 225, 103, 65, 163, 139,
+ 243, 228, 21, 133, 31, 227, 102, 225, 103, 65, 163, 139, 243, 228, 21,
+ 122, 31, 245, 9, 225, 103, 65, 163, 139, 243, 228, 21, 117, 31, 245, 9,
+ 225, 103, 65, 163, 139, 243, 228, 21, 133, 31, 245, 9, 225, 103, 65, 163,
+ 139, 5, 216, 49, 155, 5, 253, 242, 155, 5, 214, 128, 155, 1, 61, 155, 1,
+ 254, 232, 155, 1, 72, 155, 1, 236, 28, 155, 1, 69, 155, 1, 215, 92, 155,
+ 1, 161, 149, 155, 1, 161, 150, 155, 1, 74, 155, 1, 245, 165, 155, 1, 254,
+ 108, 155, 1, 75, 155, 1, 227, 49, 155, 1, 253, 108, 155, 1, 181, 155, 1,
+ 234, 138, 155, 1, 243, 110, 155, 1, 242, 225, 155, 1, 229, 159, 155, 1,
+ 250, 219, 155, 1, 250, 92, 155, 1, 235, 139, 155, 1, 235, 115, 155, 1,
+ 228, 23, 155, 1, 216, 115, 155, 1, 216, 105, 155, 1, 248, 86, 155, 1,
+ 248, 70, 155, 1, 228, 198, 155, 1, 218, 52, 155, 1, 217, 161, 155, 1,
+ 248, 164, 155, 1, 247, 232, 155, 1, 205, 155, 1, 193, 155, 1, 226, 23,
+ 155, 1, 252, 107, 155, 1, 251, 195, 155, 1, 188, 155, 1, 186, 155, 1,
+ 203, 155, 1, 223, 81, 155, 1, 233, 157, 155, 1, 232, 213, 155, 1, 215, 1,
+ 155, 1, 221, 24, 155, 1, 219, 157, 155, 1, 222, 202, 155, 1, 159, 155, 5,
+ 228, 60, 155, 5, 253, 91, 155, 30, 5, 254, 232, 155, 30, 5, 72, 155, 30,
+ 5, 236, 28, 155, 30, 5, 69, 155, 30, 5, 215, 92, 155, 30, 5, 161, 149,
+ 155, 30, 5, 161, 223, 82, 155, 30, 5, 74, 155, 30, 5, 245, 165, 155, 30,
+ 5, 254, 108, 155, 30, 5, 75, 155, 30, 5, 227, 49, 155, 30, 5, 253, 108,
+ 155, 5, 214, 133, 155, 233, 47, 77, 155, 254, 109, 233, 47, 77, 155, 1,
+ 244, 164, 155, 1, 161, 223, 82, 155, 1, 161, 232, 214, 155, 30, 5, 161,
+ 150, 155, 30, 5, 161, 232, 214, 155, 21, 212, 79, 155, 21, 116, 155, 21,
+ 109, 155, 21, 166, 155, 21, 163, 155, 21, 180, 155, 21, 189, 155, 21,
+ 198, 155, 21, 195, 155, 21, 200, 155, 5, 235, 104, 155, 5, 215, 132, 130,
+ 5, 253, 242, 130, 5, 214, 128, 130, 1, 61, 130, 1, 254, 232, 130, 1, 72,
+ 130, 1, 236, 28, 130, 1, 69, 130, 1, 215, 92, 130, 1, 161, 149, 130, 1,
+ 161, 150, 130, 1, 74, 130, 1, 245, 165, 130, 1, 254, 108, 130, 1, 75,
+ 130, 1, 227, 49, 130, 1, 253, 108, 130, 1, 181, 130, 1, 234, 138, 130, 1,
+ 243, 110, 130, 1, 242, 225, 130, 1, 229, 159, 130, 1, 250, 219, 130, 1,
+ 250, 92, 130, 1, 235, 139, 130, 1, 235, 115, 130, 1, 228, 23, 130, 1,
+ 216, 115, 130, 1, 216, 105, 130, 1, 248, 86, 130, 1, 248, 70, 130, 1,
+ 228, 198, 130, 1, 218, 52, 130, 1, 217, 161, 130, 1, 248, 164, 130, 1,
+ 247, 232, 130, 1, 205, 130, 1, 228, 189, 130, 1, 193, 130, 1, 226, 23,
+ 130, 1, 252, 107, 130, 1, 251, 195, 130, 1, 188, 130, 1, 186, 130, 1,
+ 203, 130, 1, 223, 81, 130, 1, 233, 157, 130, 1, 232, 213, 130, 1, 232,
+ 212, 130, 1, 215, 1, 130, 1, 221, 24, 130, 1, 219, 157, 130, 1, 222, 202,
+ 130, 1, 159, 130, 1, 216, 88, 130, 5, 253, 91, 130, 30, 5, 254, 232, 130,
+ 30, 5, 72, 130, 30, 5, 236, 28, 130, 30, 5, 69, 130, 30, 5, 215, 92, 130,
+ 30, 5, 161, 149, 130, 30, 5, 161, 223, 82, 130, 30, 5, 74, 130, 30, 5,
+ 245, 165, 130, 30, 5, 254, 108, 130, 30, 5, 75, 130, 30, 5, 227, 49, 130,
+ 30, 5, 253, 108, 130, 5, 214, 133, 130, 1, 62, 223, 225, 130, 253, 109,
+ 233, 47, 77, 130, 1, 161, 223, 82, 130, 1, 161, 232, 214, 130, 30, 5,
+ 161, 150, 130, 30, 5, 161, 232, 214, 130, 21, 212, 79, 130, 21, 116, 130,
+ 21, 109, 130, 21, 166, 130, 21, 163, 130, 21, 180, 130, 21, 189, 130, 21,
+ 198, 130, 21, 195, 130, 21, 200, 130, 50, 217, 200, 130, 50, 122, 240,
+ 200, 130, 50, 122, 217, 100, 130, 243, 228, 122, 224, 166, 130, 243, 228,
+ 122, 242, 9, 130, 243, 228, 133, 224, 164, 130, 248, 96, 77, 130, 1, 250,
+ 36, 228, 199, 130, 1, 250, 36, 204, 130, 1, 250, 36, 223, 82, 130, 1,
+ 250, 36, 150, 130, 1, 250, 36, 232, 214, 130, 1, 250, 36, 235, 27, 172,
+ 5, 253, 241, 172, 5, 214, 127, 172, 1, 253, 81, 172, 1, 254, 187, 172, 1,
+ 254, 128, 172, 1, 254, 143, 172, 1, 235, 149, 172, 1, 236, 27, 172, 1,
+ 215, 84, 172, 1, 215, 86, 172, 1, 235, 171, 172, 1, 235, 172, 172, 1,
+ 236, 13, 172, 1, 236, 15, 172, 1, 244, 241, 172, 1, 245, 161, 172, 1,
+ 254, 96, 172, 1, 226, 232, 172, 1, 227, 43, 172, 1, 253, 94, 172, 1, 254,
+ 55, 234, 193, 172, 1, 232, 14, 234, 193, 172, 1, 254, 55, 243, 58, 172,
+ 1, 232, 14, 243, 58, 172, 1, 234, 234, 230, 40, 172, 1, 222, 152, 243,
+ 58, 172, 1, 254, 55, 250, 149, 172, 1, 232, 14, 250, 149, 172, 1, 254,
+ 55, 235, 128, 172, 1, 232, 14, 235, 128, 172, 1, 218, 46, 230, 40, 172,
+ 1, 218, 46, 222, 151, 230, 41, 172, 1, 222, 152, 235, 128, 172, 1, 254,
+ 55, 216, 113, 172, 1, 232, 14, 216, 113, 172, 1, 254, 55, 248, 77, 172,
+ 1, 232, 14, 248, 77, 172, 1, 230, 124, 230, 2, 172, 1, 222, 152, 248, 77,
+ 172, 1, 254, 55, 217, 237, 172, 1, 232, 14, 217, 237, 172, 1, 254, 55,
+ 248, 90, 172, 1, 232, 14, 248, 90, 172, 1, 248, 119, 230, 2, 172, 1, 222,
+ 152, 248, 90, 172, 1, 254, 55, 226, 102, 172, 1, 232, 14, 226, 102, 172,
+ 1, 254, 55, 252, 32, 172, 1, 232, 14, 252, 32, 172, 1, 231, 195, 172, 1,
+ 254, 40, 252, 32, 172, 1, 213, 42, 172, 1, 224, 26, 172, 1, 248, 119,
+ 233, 91, 172, 1, 214, 234, 172, 1, 218, 46, 222, 128, 172, 1, 230, 124,
+ 222, 128, 172, 1, 248, 119, 222, 128, 172, 1, 241, 226, 172, 1, 230, 124,
+ 233, 91, 172, 1, 244, 125, 172, 5, 254, 85, 172, 30, 5, 254, 138, 172,
+ 30, 5, 234, 161, 254, 145, 172, 30, 5, 247, 180, 254, 145, 172, 30, 5,
+ 234, 161, 235, 168, 172, 30, 5, 247, 180, 235, 168, 172, 30, 5, 234, 161,
+ 226, 212, 172, 30, 5, 247, 180, 226, 212, 172, 30, 5, 243, 99, 172, 30,
+ 5, 234, 24, 172, 30, 5, 247, 180, 234, 24, 172, 30, 5, 234, 26, 248, 18,
+ 172, 30, 5, 234, 25, 242, 28, 254, 138, 172, 30, 5, 234, 25, 242, 28,
+ 247, 180, 254, 138, 172, 30, 5, 234, 25, 242, 28, 243, 57, 172, 30, 5,
+ 243, 57, 172, 30, 5, 247, 180, 243, 99, 172, 30, 5, 247, 180, 243, 57,
+ 172, 225, 27, 233, 228, 154, 137, 234, 38, 234, 250, 154, 137, 234, 114,
+ 234, 134, 154, 137, 234, 114, 234, 107, 154, 137, 234, 114, 234, 104,
+ 154, 137, 234, 114, 234, 111, 154, 137, 234, 114, 224, 46, 154, 137, 229,
+ 91, 229, 78, 154, 137, 250, 24, 250, 83, 154, 137, 250, 24, 250, 32, 154,
+ 137, 250, 24, 250, 82, 154, 137, 219, 243, 219, 242, 154, 137, 250, 24,
+ 250, 20, 154, 137, 212, 236, 212, 243, 154, 137, 247, 100, 250, 89, 154,
+ 137, 211, 211, 226, 111, 154, 137, 217, 110, 217, 153, 154, 137, 217,
+ 110, 230, 21, 154, 137, 217, 110, 225, 243, 154, 137, 228, 186, 229, 180,
+ 154, 137, 247, 100, 248, 19, 154, 137, 211, 211, 218, 6, 154, 137, 217,
+ 110, 217, 85, 154, 137, 217, 110, 217, 157, 154, 137, 217, 110, 217, 107,
+ 154, 137, 228, 186, 228, 92, 154, 137, 251, 129, 252, 83, 154, 137, 225,
+ 151, 225, 174, 154, 137, 225, 254, 225, 245, 154, 137, 244, 13, 244, 164,
+ 154, 137, 225, 254, 226, 17, 154, 137, 244, 13, 244, 141, 154, 137, 225,
+ 254, 222, 162, 154, 137, 230, 232, 188, 154, 137, 212, 236, 213, 68, 154,
+ 137, 223, 113, 223, 50, 154, 137, 223, 51, 154, 137, 232, 209, 232, 235,
+ 154, 137, 232, 156, 154, 137, 213, 215, 214, 45, 154, 137, 219, 243, 222,
+ 177, 154, 137, 219, 243, 223, 25, 154, 137, 219, 243, 219, 26, 154, 137,
+ 241, 55, 241, 145, 154, 137, 232, 209, 250, 5, 154, 137, 157, 254, 24,
+ 154, 137, 241, 55, 228, 181, 154, 137, 226, 195, 154, 137, 222, 146, 61,
+ 154, 137, 232, 9, 242, 0, 154, 137, 222, 146, 254, 232, 154, 137, 222,
+ 146, 254, 45, 154, 137, 222, 146, 72, 154, 137, 222, 146, 236, 28, 154,
+ 137, 222, 146, 215, 183, 154, 137, 222, 146, 215, 181, 154, 137, 222,
+ 146, 69, 154, 137, 222, 146, 215, 92, 154, 137, 226, 0, 154, 249, 39, 16,
+ 252, 84, 154, 137, 222, 146, 74, 154, 137, 222, 146, 254, 148, 154, 137,
+ 222, 146, 75, 154, 137, 222, 146, 254, 109, 232, 4, 154, 137, 222, 146,
+ 254, 109, 232, 5, 154, 137, 233, 130, 154, 137, 232, 1, 154, 137, 232, 2,
+ 154, 137, 232, 9, 245, 137, 154, 137, 232, 9, 217, 109, 154, 137, 232, 9,
+ 216, 186, 154, 137, 232, 9, 250, 71, 154, 137, 217, 151, 154, 137, 229,
+ 36, 154, 137, 213, 62, 154, 137, 244, 4, 154, 21, 212, 79, 154, 21, 116,
+ 154, 21, 109, 154, 21, 166, 154, 21, 163, 154, 21, 180, 154, 21, 189,
+ 154, 21, 198, 154, 21, 195, 154, 21, 200, 154, 137, 254, 20, 154, 137,
+ 234, 112, 233, 112, 1, 234, 37, 233, 112, 1, 234, 114, 218, 235, 233,
+ 112, 1, 234, 114, 218, 13, 233, 112, 1, 229, 90, 233, 112, 1, 249, 175,
+ 233, 112, 1, 219, 243, 218, 13, 233, 112, 1, 227, 253, 233, 112, 1, 247,
+ 99, 233, 112, 1, 108, 233, 112, 1, 217, 110, 218, 235, 233, 112, 1, 217,
+ 110, 218, 13, 233, 112, 1, 228, 185, 233, 112, 1, 251, 128, 233, 112, 1,
+ 225, 150, 233, 112, 1, 225, 254, 218, 235, 233, 112, 1, 244, 13, 218, 13,
+ 233, 112, 1, 225, 254, 218, 13, 233, 112, 1, 244, 13, 218, 235, 233, 112,
+ 1, 230, 231, 233, 112, 1, 212, 235, 233, 112, 1, 232, 209, 232, 235, 233,
+ 112, 1, 232, 209, 232, 176, 233, 112, 1, 213, 214, 233, 112, 1, 219, 243,
+ 218, 235, 233, 112, 1, 241, 55, 218, 235, 233, 112, 1, 75, 233, 112, 1,
+ 241, 55, 218, 13, 233, 112, 245, 120, 233, 112, 30, 5, 61, 233, 112, 30,
+ 5, 232, 9, 234, 239, 233, 112, 30, 5, 254, 232, 233, 112, 30, 5, 254, 45,
+ 233, 112, 30, 5, 72, 233, 112, 30, 5, 236, 28, 233, 112, 30, 5, 213, 105,
+ 233, 112, 30, 5, 212, 161, 233, 112, 30, 5, 69, 233, 112, 30, 5, 215, 92,
+ 233, 112, 30, 5, 232, 9, 234, 22, 233, 112, 221, 65, 5, 232, 208, 233,
+ 112, 221, 65, 5, 227, 253, 233, 112, 30, 5, 74, 233, 112, 30, 5, 245,
+ 152, 233, 112, 30, 5, 75, 233, 112, 30, 5, 253, 83, 233, 112, 30, 5, 254,
+ 108, 233, 112, 234, 38, 233, 157, 233, 112, 160, 232, 9, 245, 137, 233,
+ 112, 160, 232, 9, 217, 109, 233, 112, 160, 232, 9, 217, 71, 233, 112,
+ 160, 232, 9, 250, 155, 233, 112, 250, 192, 77, 233, 112, 229, 45, 233,
+ 112, 21, 212, 79, 233, 112, 21, 116, 233, 112, 21, 109, 233, 112, 21,
+ 166, 233, 112, 21, 163, 233, 112, 21, 180, 233, 112, 21, 189, 233, 112,
+ 21, 198, 233, 112, 21, 195, 233, 112, 21, 200, 233, 112, 241, 55, 228,
+ 185, 233, 112, 241, 55, 230, 231, 60, 4, 227, 70, 60, 152, 242, 94, 212,
+ 247, 231, 59, 216, 147, 61, 60, 152, 242, 94, 212, 247, 231, 59, 255, 62,
+ 223, 117, 251, 253, 188, 60, 152, 242, 94, 212, 247, 231, 59, 255, 62,
+ 242, 94, 216, 131, 188, 60, 152, 70, 212, 247, 231, 59, 231, 158, 188,
+ 60, 152, 249, 189, 212, 247, 231, 59, 221, 30, 188, 60, 152, 250, 171,
+ 212, 247, 231, 59, 225, 244, 221, 18, 188, 60, 152, 212, 247, 231, 59,
+ 216, 131, 221, 18, 188, 60, 152, 222, 126, 221, 17, 60, 152, 251, 57,
+ 212, 247, 231, 58, 60, 152, 251, 146, 220, 183, 212, 247, 231, 58, 60,
+ 152, 235, 194, 216, 130, 60, 152, 248, 12, 216, 131, 251, 56, 60, 152,
+ 221, 17, 60, 152, 228, 2, 221, 17, 60, 152, 216, 131, 221, 17, 60, 152,
+ 228, 2, 216, 131, 221, 17, 60, 152, 223, 133, 250, 59, 219, 168, 221, 17,
+ 60, 152, 223, 195, 242, 122, 221, 17, 60, 152, 250, 171, 255, 66, 223,
+ 55, 231, 157, 184, 250, 195, 60, 152, 242, 94, 216, 130, 60, 232, 197, 5,
+ 250, 90, 223, 54, 60, 232, 197, 5, 233, 23, 223, 54, 60, 253, 128, 5,
+ 221, 27, 243, 41, 255, 67, 223, 54, 60, 253, 128, 5, 255, 64, 193, 60,
+ 253, 128, 5, 222, 101, 216, 126, 60, 5, 224, 23, 247, 111, 243, 40, 60,
+ 5, 224, 23, 247, 111, 242, 152, 60, 5, 224, 23, 247, 111, 242, 95, 60, 5,
+ 224, 23, 230, 37, 243, 40, 60, 5, 224, 23, 230, 37, 242, 152, 60, 5, 224,
+ 23, 247, 111, 224, 23, 230, 36, 60, 21, 212, 79, 60, 21, 116, 60, 21,
+ 109, 60, 21, 166, 60, 21, 163, 60, 21, 180, 60, 21, 189, 60, 21, 198, 60,
+ 21, 195, 60, 21, 200, 60, 21, 151, 116, 60, 21, 151, 109, 60, 21, 151,
+ 166, 60, 21, 151, 163, 60, 21, 151, 180, 60, 21, 151, 189, 60, 21, 151,
+ 198, 60, 21, 151, 195, 60, 21, 151, 200, 60, 21, 151, 212, 79, 60, 152,
+ 251, 59, 223, 54, 60, 152, 229, 151, 250, 254, 228, 11, 212, 18, 60, 152,
+ 250, 171, 255, 66, 223, 55, 250, 255, 231, 15, 250, 195, 60, 152, 229,
+ 151, 250, 254, 221, 28, 223, 54, 60, 152, 250, 68, 231, 58, 60, 152, 216,
+ 142, 255, 63, 60, 152, 242, 81, 223, 55, 242, 44, 60, 152, 242, 81, 223,
+ 55, 242, 50, 60, 152, 254, 25, 234, 129, 242, 44, 60, 152, 254, 25, 234,
+ 129, 242, 50, 60, 5, 213, 55, 216, 129, 60, 5, 231, 230, 216, 129, 60, 1,
+ 181, 60, 1, 234, 138, 60, 1, 243, 110, 60, 1, 242, 225, 60, 1, 229, 159,
+ 60, 1, 250, 219, 60, 1, 250, 92, 60, 1, 235, 139, 60, 1, 228, 23, 60, 1,
+ 216, 115, 60, 1, 216, 105, 60, 1, 248, 86, 60, 1, 248, 70, 60, 1, 228,
+ 198, 60, 1, 218, 52, 60, 1, 217, 161, 60, 1, 248, 164, 60, 1, 247, 232,
+ 60, 1, 205, 60, 1, 193, 60, 1, 226, 23, 60, 1, 252, 107, 60, 1, 251, 195,
+ 60, 1, 188, 60, 1, 216, 141, 60, 1, 216, 133, 60, 1, 245, 249, 60, 1,
+ 245, 244, 60, 1, 214, 49, 60, 1, 212, 75, 60, 1, 212, 109, 60, 1, 255,
+ 69, 60, 1, 186, 60, 1, 203, 60, 1, 233, 157, 60, 1, 221, 24, 60, 1, 219,
+ 157, 60, 1, 222, 202, 60, 1, 159, 60, 1, 61, 60, 1, 233, 241, 60, 1, 244,
+ 46, 203, 60, 1, 234, 55, 60, 1, 223, 81, 60, 30, 5, 254, 232, 60, 30, 5,
+ 72, 60, 30, 5, 236, 28, 60, 30, 5, 69, 60, 30, 5, 215, 92, 60, 30, 5,
+ 161, 149, 60, 30, 5, 161, 223, 82, 60, 30, 5, 161, 150, 60, 30, 5, 161,
+ 232, 214, 60, 30, 5, 74, 60, 30, 5, 245, 165, 60, 30, 5, 75, 60, 30, 5,
+ 227, 49, 60, 5, 223, 118, 219, 28, 229, 160, 223, 112, 60, 5, 223, 117,
+ 251, 252, 60, 30, 5, 223, 202, 72, 60, 30, 5, 223, 202, 236, 28, 60, 5,
+ 228, 11, 212, 19, 230, 44, 248, 164, 60, 5, 219, 255, 233, 84, 60, 152,
+ 242, 11, 60, 152, 226, 184, 60, 5, 233, 87, 223, 54, 60, 5, 213, 59, 223,
+ 54, 60, 5, 233, 88, 216, 142, 250, 195, 60, 5, 231, 159, 250, 195, 60, 5,
+ 242, 97, 250, 196, 223, 193, 60, 5, 242, 97, 231, 150, 223, 193, 60, 5,
+ 235, 191, 231, 159, 250, 195, 60, 219, 18, 5, 233, 88, 216, 142, 250,
+ 195, 60, 219, 18, 5, 231, 159, 250, 195, 60, 219, 18, 5, 235, 191, 231,
+ 159, 250, 195, 60, 219, 18, 1, 181, 60, 219, 18, 1, 234, 138, 60, 219,
+ 18, 1, 243, 110, 60, 219, 18, 1, 242, 225, 60, 219, 18, 1, 229, 159, 60,
+ 219, 18, 1, 250, 219, 60, 219, 18, 1, 250, 92, 60, 219, 18, 1, 235, 139,
+ 60, 219, 18, 1, 228, 23, 60, 219, 18, 1, 216, 115, 60, 219, 18, 1, 216,
+ 105, 60, 219, 18, 1, 248, 86, 60, 219, 18, 1, 248, 70, 60, 219, 18, 1,
+ 228, 198, 60, 219, 18, 1, 218, 52, 60, 219, 18, 1, 217, 161, 60, 219, 18,
+ 1, 248, 164, 60, 219, 18, 1, 247, 232, 60, 219, 18, 1, 205, 60, 219, 18,
+ 1, 193, 60, 219, 18, 1, 226, 23, 60, 219, 18, 1, 252, 107, 60, 219, 18,
+ 1, 251, 195, 60, 219, 18, 1, 188, 60, 219, 18, 1, 216, 141, 60, 219, 18,
+ 1, 216, 133, 60, 219, 18, 1, 245, 249, 60, 219, 18, 1, 245, 244, 60, 219,
+ 18, 1, 214, 49, 60, 219, 18, 1, 212, 75, 60, 219, 18, 1, 212, 109, 60,
+ 219, 18, 1, 255, 69, 60, 219, 18, 1, 186, 60, 219, 18, 1, 203, 60, 219,
+ 18, 1, 233, 157, 60, 219, 18, 1, 221, 24, 60, 219, 18, 1, 219, 157, 60,
+ 219, 18, 1, 222, 202, 60, 219, 18, 1, 159, 60, 219, 18, 1, 61, 60, 219,
+ 18, 1, 233, 241, 60, 219, 18, 1, 244, 46, 214, 49, 60, 219, 18, 1, 244,
+ 46, 186, 60, 219, 18, 1, 244, 46, 203, 60, 233, 239, 223, 52, 234, 138,
+ 60, 233, 239, 223, 52, 234, 139, 250, 255, 231, 15, 250, 195, 60, 250,
+ 184, 5, 107, 251, 246, 60, 250, 184, 5, 177, 251, 246, 60, 250, 184, 5,
+ 250, 185, 217, 228, 60, 250, 184, 5, 222, 125, 255, 68, 60, 16, 246, 46,
+ 251, 54, 60, 16, 224, 22, 223, 119, 60, 16, 226, 202, 243, 39, 60, 16,
+ 224, 22, 223, 120, 223, 195, 242, 121, 60, 16, 225, 244, 193, 60, 16,
+ 228, 170, 251, 54, 60, 16, 228, 170, 251, 55, 228, 2, 255, 65, 60, 16,
+ 228, 170, 251, 55, 242, 96, 255, 65, 60, 16, 228, 170, 251, 55, 250, 255,
+ 255, 65, 60, 5, 224, 23, 230, 37, 224, 23, 247, 110, 60, 5, 224, 23, 230,
+ 37, 242, 95, 60, 152, 251, 58, 220, 183, 242, 191, 231, 59, 223, 194, 60,
+ 152, 230, 233, 212, 247, 242, 191, 231, 59, 223, 194, 60, 152, 228, 2,
+ 216, 130, 60, 152, 70, 251, 79, 223, 114, 212, 247, 231, 59, 231, 158,
+ 188, 60, 152, 249, 189, 251, 79, 223, 114, 212, 247, 231, 59, 221, 30,
+ 188, 223, 147, 218, 200, 52, 233, 69, 218, 200, 52, 223, 147, 218, 200,
+ 5, 2, 247, 72, 233, 69, 218, 200, 5, 2, 247, 72, 60, 152, 233, 79, 231,
+ 160, 223, 54, 60, 152, 216, 207, 231, 160, 223, 54, 64, 1, 181, 64, 1,
+ 234, 138, 64, 1, 243, 110, 64, 1, 242, 225, 64, 1, 229, 159, 64, 1, 250,
+ 219, 64, 1, 250, 92, 64, 1, 235, 139, 64, 1, 235, 115, 64, 1, 228, 23,
+ 64, 1, 228, 187, 64, 1, 216, 115, 64, 1, 216, 105, 64, 1, 248, 86, 64, 1,
+ 248, 70, 64, 1, 228, 198, 64, 1, 218, 52, 64, 1, 217, 161, 64, 1, 248,
+ 164, 64, 1, 247, 232, 64, 1, 205, 64, 1, 193, 64, 1, 226, 23, 64, 1, 252,
+ 107, 64, 1, 251, 195, 64, 1, 188, 64, 1, 186, 64, 1, 203, 64, 1, 233,
+ 157, 64, 1, 214, 49, 64, 1, 222, 202, 64, 1, 159, 64, 1, 232, 213, 64, 1,
+ 61, 64, 1, 221, 9, 61, 64, 1, 72, 64, 1, 236, 28, 64, 1, 69, 64, 1, 215,
+ 92, 64, 1, 74, 64, 1, 230, 221, 74, 64, 1, 75, 64, 1, 253, 108, 64, 30,
+ 5, 218, 15, 254, 232, 64, 30, 5, 254, 232, 64, 30, 5, 72, 64, 30, 5, 236,
+ 28, 64, 30, 5, 69, 64, 30, 5, 215, 92, 64, 30, 5, 74, 64, 30, 5, 254,
+ 108, 64, 30, 5, 230, 221, 236, 28, 64, 30, 5, 230, 221, 75, 64, 30, 5,
+ 191, 49, 64, 5, 253, 242, 64, 5, 62, 55, 64, 5, 214, 128, 64, 5, 214,
+ 133, 64, 5, 253, 150, 64, 249, 133, 5, 138, 186, 64, 249, 133, 5, 138,
+ 203, 64, 249, 133, 5, 138, 214, 49, 64, 249, 133, 5, 138, 159, 64, 1,
+ 242, 109, 222, 202, 64, 21, 212, 79, 64, 21, 116, 64, 21, 109, 64, 21,
+ 166, 64, 21, 163, 64, 21, 180, 64, 21, 189, 64, 21, 198, 64, 21, 195, 64,
+ 21, 200, 64, 5, 232, 221, 222, 91, 64, 5, 222, 91, 64, 16, 232, 205, 64,
+ 16, 249, 152, 64, 16, 254, 125, 64, 16, 243, 24, 64, 1, 221, 24, 64, 1,
+ 219, 157, 64, 1, 161, 149, 64, 1, 161, 223, 82, 64, 1, 161, 150, 64, 1,
+ 161, 232, 214, 64, 30, 5, 161, 149, 64, 30, 5, 161, 223, 82, 64, 30, 5,
+ 161, 150, 64, 30, 5, 161, 232, 214, 64, 1, 230, 221, 229, 159, 64, 1,
+ 230, 221, 235, 115, 64, 1, 230, 221, 252, 31, 64, 1, 230, 221, 252, 26,
+ 64, 249, 133, 5, 230, 221, 138, 205, 64, 249, 133, 5, 230, 221, 138, 188,
+ 64, 249, 133, 5, 230, 221, 138, 233, 157, 64, 1, 221, 29, 234, 218, 221,
+ 24, 64, 30, 5, 221, 29, 234, 218, 245, 22, 64, 160, 152, 221, 29, 234,
+ 218, 241, 230, 64, 160, 152, 221, 29, 234, 218, 234, 189, 225, 253, 64,
+ 1, 213, 248, 224, 252, 234, 218, 217, 161, 64, 1, 213, 248, 224, 252,
+ 234, 218, 225, 2, 64, 30, 5, 213, 248, 224, 252, 234, 218, 245, 22, 64,
+ 30, 5, 213, 248, 224, 252, 234, 218, 215, 183, 64, 5, 213, 248, 224, 252,
+ 234, 218, 216, 240, 64, 5, 213, 248, 224, 252, 234, 218, 216, 239, 64, 5,
+ 213, 248, 224, 252, 234, 218, 216, 238, 64, 5, 213, 248, 224, 252, 234,
+ 218, 216, 237, 64, 5, 213, 248, 224, 252, 234, 218, 216, 236, 64, 1, 245,
+ 175, 224, 252, 234, 218, 228, 198, 64, 1, 245, 175, 224, 252, 234, 218,
+ 212, 168, 64, 1, 245, 175, 224, 252, 234, 218, 242, 193, 64, 30, 5, 243,
+ 35, 234, 218, 72, 64, 30, 5, 234, 194, 227, 99, 64, 30, 5, 234, 194, 69,
+ 64, 30, 5, 234, 194, 245, 165, 64, 1, 221, 9, 181, 64, 1, 221, 9, 234,
+ 138, 64, 1, 221, 9, 243, 110, 64, 1, 221, 9, 250, 219, 64, 1, 221, 9,
+ 212, 109, 64, 1, 221, 9, 228, 23, 64, 1, 221, 9, 248, 164, 64, 1, 221, 9,
+ 205, 64, 1, 221, 9, 226, 23, 64, 1, 221, 9, 244, 164, 64, 1, 221, 9, 252,
+ 107, 64, 1, 221, 9, 217, 161, 64, 1, 221, 9, 159, 64, 249, 133, 5, 221,
+ 9, 138, 214, 49, 64, 30, 5, 221, 9, 254, 232, 64, 30, 5, 221, 9, 74, 64,
+ 30, 5, 221, 9, 191, 49, 64, 30, 5, 221, 9, 40, 213, 105, 64, 5, 221, 9,
+ 216, 239, 64, 5, 221, 9, 216, 238, 64, 5, 221, 9, 216, 236, 64, 5, 221,
+ 9, 216, 235, 64, 5, 221, 9, 249, 91, 216, 239, 64, 5, 221, 9, 249, 91,
+ 216, 238, 64, 5, 221, 9, 249, 91, 245, 111, 216, 241, 64, 1, 223, 39,
+ 226, 190, 244, 164, 64, 5, 223, 39, 226, 190, 216, 236, 64, 221, 9, 21,
+ 212, 79, 64, 221, 9, 21, 116, 64, 221, 9, 21, 109, 64, 221, 9, 21, 166,
+ 64, 221, 9, 21, 163, 64, 221, 9, 21, 180, 64, 221, 9, 21, 189, 64, 221,
+ 9, 21, 198, 64, 221, 9, 21, 195, 64, 221, 9, 21, 200, 64, 5, 234, 132,
+ 216, 240, 64, 5, 234, 132, 216, 238, 64, 30, 5, 254, 98, 61, 64, 30, 5,
+ 254, 98, 254, 108, 64, 16, 221, 9, 116, 64, 16, 221, 9, 244, 253, 100, 6,
+ 1, 254, 32, 100, 6, 1, 252, 71, 100, 6, 1, 243, 82, 100, 6, 1, 247, 82,
+ 100, 6, 1, 245, 108, 100, 6, 1, 214, 141, 100, 6, 1, 212, 82, 100, 6, 1,
+ 218, 11, 100, 6, 1, 235, 251, 100, 6, 1, 234, 239, 100, 6, 1, 233, 104,
+ 100, 6, 1, 231, 248, 100, 6, 1, 230, 15, 100, 6, 1, 227, 62, 100, 6, 1,
+ 226, 145, 100, 6, 1, 212, 71, 100, 6, 1, 224, 61, 100, 6, 1, 222, 159,
+ 100, 6, 1, 218, 1, 100, 6, 1, 215, 160, 100, 6, 1, 226, 16, 100, 6, 1,
+ 234, 127, 100, 6, 1, 242, 217, 100, 6, 1, 224, 217, 100, 6, 1, 220, 200,
+ 100, 6, 1, 250, 34, 100, 6, 1, 250, 195, 100, 6, 1, 235, 103, 100, 6, 1,
+ 249, 233, 100, 6, 1, 250, 79, 100, 6, 1, 213, 151, 100, 6, 1, 235, 113,
+ 100, 6, 1, 242, 24, 100, 6, 1, 241, 222, 100, 6, 1, 241, 160, 100, 6, 1,
+ 214, 6, 100, 6, 1, 241, 243, 100, 6, 1, 241, 51, 100, 1, 254, 32, 100, 1,
+ 252, 71, 100, 1, 243, 82, 100, 1, 247, 82, 100, 1, 245, 108, 100, 1, 214,
+ 141, 100, 1, 212, 82, 100, 1, 218, 11, 100, 1, 235, 251, 100, 1, 234,
+ 239, 100, 1, 233, 104, 100, 1, 231, 248, 100, 1, 230, 15, 100, 1, 227,
+ 62, 100, 1, 226, 145, 100, 1, 212, 71, 100, 1, 224, 61, 100, 1, 222, 159,
+ 100, 1, 218, 1, 100, 1, 215, 160, 100, 1, 226, 16, 100, 1, 234, 127, 100,
+ 1, 242, 217, 100, 1, 224, 217, 100, 1, 220, 200, 100, 1, 250, 34, 100, 1,
+ 250, 195, 100, 1, 235, 103, 100, 1, 249, 233, 100, 1, 250, 79, 100, 1,
+ 213, 151, 100, 1, 235, 113, 100, 1, 242, 24, 100, 1, 241, 222, 100, 1,
+ 241, 160, 100, 1, 214, 6, 100, 1, 241, 243, 100, 1, 241, 51, 100, 1, 244,
+ 90, 100, 1, 212, 237, 100, 1, 245, 122, 100, 1, 216, 58, 243, 82, 100, 1,
+ 254, 103, 100, 226, 143, 221, 57, 59, 1, 100, 230, 15, 23, 97, 234, 67,
+ 23, 97, 219, 150, 23, 97, 229, 57, 23, 97, 217, 55, 23, 97, 219, 139, 23,
+ 97, 223, 179, 23, 97, 231, 30, 23, 97, 225, 227, 23, 97, 219, 147, 23,
+ 97, 220, 76, 23, 97, 219, 144, 23, 97, 236, 51, 23, 97, 249, 239, 23, 97,
+ 219, 154, 23, 97, 250, 43, 23, 97, 234, 116, 23, 97, 217, 126, 23, 97,
+ 226, 7, 23, 97, 241, 158, 23, 97, 229, 53, 23, 97, 219, 148, 23, 97, 229,
+ 47, 23, 97, 229, 51, 23, 97, 217, 52, 23, 97, 223, 167, 23, 97, 219, 146,
+ 23, 97, 223, 177, 23, 97, 234, 223, 23, 97, 231, 23, 23, 97, 234, 226,
+ 23, 97, 225, 222, 23, 97, 225, 220, 23, 97, 225, 208, 23, 97, 225, 216,
+ 23, 97, 225, 214, 23, 97, 225, 211, 23, 97, 225, 213, 23, 97, 225, 210,
+ 23, 97, 225, 215, 23, 97, 225, 225, 23, 97, 225, 226, 23, 97, 225, 209,
+ 23, 97, 225, 219, 23, 97, 234, 224, 23, 97, 234, 222, 23, 97, 220, 69,
+ 23, 97, 220, 67, 23, 97, 220, 59, 23, 97, 220, 62, 23, 97, 220, 68, 23,
+ 97, 220, 64, 23, 97, 220, 63, 23, 97, 220, 61, 23, 97, 220, 72, 23, 97,
+ 220, 74, 23, 97, 220, 75, 23, 97, 220, 70, 23, 97, 220, 60, 23, 97, 220,
+ 65, 23, 97, 220, 73, 23, 97, 250, 27, 23, 97, 250, 25, 23, 97, 250, 102,
+ 23, 97, 250, 100, 23, 97, 226, 160, 23, 97, 236, 46, 23, 97, 236, 37, 23,
+ 97, 236, 45, 23, 97, 236, 42, 23, 97, 236, 40, 23, 97, 236, 44, 23, 97,
+ 219, 151, 23, 97, 236, 49, 23, 97, 236, 50, 23, 97, 236, 38, 23, 97, 236,
+ 43, 23, 97, 213, 17, 23, 97, 249, 238, 23, 97, 250, 28, 23, 97, 250, 26,
+ 23, 97, 250, 103, 23, 97, 250, 101, 23, 97, 250, 41, 23, 97, 250, 42, 23,
+ 97, 250, 29, 23, 97, 250, 104, 23, 97, 226, 5, 23, 97, 234, 225, 23, 97,
+ 219, 152, 23, 97, 213, 23, 23, 97, 234, 58, 23, 97, 229, 49, 23, 97, 229,
+ 55, 23, 97, 229, 54, 23, 97, 217, 49, 23, 97, 244, 72, 23, 135, 244, 72,
+ 23, 135, 61, 23, 135, 254, 148, 23, 135, 186, 23, 135, 213, 80, 23, 135,
+ 245, 76, 23, 135, 74, 23, 135, 213, 27, 23, 135, 213, 38, 23, 135, 75,
+ 23, 135, 214, 49, 23, 135, 214, 46, 23, 135, 227, 99, 23, 135, 212, 235,
+ 23, 135, 69, 23, 135, 213, 252, 23, 135, 214, 6, 23, 135, 213, 235, 23,
+ 135, 212, 203, 23, 135, 245, 22, 23, 135, 212, 255, 23, 135, 72, 23, 135,
+ 255, 60, 23, 135, 255, 59, 23, 135, 213, 94, 23, 135, 213, 92, 23, 135,
+ 245, 74, 23, 135, 245, 73, 23, 135, 245, 75, 23, 135, 213, 26, 23, 135,
+ 213, 25, 23, 135, 227, 204, 23, 135, 227, 205, 23, 135, 227, 198, 23,
+ 135, 227, 203, 23, 135, 227, 201, 23, 135, 212, 229, 23, 135, 212, 228,
+ 23, 135, 212, 227, 23, 135, 212, 230, 23, 135, 212, 231, 23, 135, 215,
+ 252, 23, 135, 215, 251, 23, 135, 215, 250, 23, 135, 215, 247, 23, 135,
+ 215, 248, 23, 135, 212, 202, 23, 135, 212, 199, 23, 135, 212, 200, 23,
+ 135, 212, 194, 23, 135, 212, 195, 23, 135, 212, 196, 23, 135, 212, 198,
+ 23, 135, 245, 16, 23, 135, 245, 18, 23, 135, 212, 254, 23, 135, 240, 145,
+ 23, 135, 240, 137, 23, 135, 240, 140, 23, 135, 240, 138, 23, 135, 240,
+ 142, 23, 135, 240, 144, 23, 135, 253, 204, 23, 135, 253, 201, 23, 135,
+ 253, 199, 23, 135, 253, 200, 23, 135, 219, 155, 23, 135, 255, 61, 23,
+ 135, 213, 93, 23, 135, 213, 24, 23, 135, 227, 200, 23, 135, 227, 199, 23,
+ 89, 234, 67, 23, 89, 219, 150, 23, 89, 234, 60, 23, 89, 229, 57, 23, 89,
+ 229, 55, 23, 89, 229, 54, 23, 89, 217, 55, 23, 89, 223, 179, 23, 89, 223,
+ 174, 23, 89, 223, 171, 23, 89, 223, 164, 23, 89, 223, 159, 23, 89, 223,
+ 154, 23, 89, 223, 165, 23, 89, 223, 177, 23, 89, 231, 30, 23, 89, 225,
+ 227, 23, 89, 225, 216, 23, 89, 220, 76, 23, 89, 219, 144, 23, 89, 236,
+ 51, 23, 89, 249, 239, 23, 89, 250, 43, 23, 89, 234, 116, 23, 89, 217,
+ 126, 23, 89, 226, 7, 23, 89, 241, 158, 23, 89, 234, 61, 23, 89, 234, 59,
+ 23, 89, 229, 53, 23, 89, 229, 47, 23, 89, 229, 49, 23, 89, 229, 52, 23,
+ 89, 229, 48, 23, 89, 217, 52, 23, 89, 217, 49, 23, 89, 223, 172, 23, 89,
+ 223, 167, 23, 89, 223, 153, 23, 89, 223, 152, 23, 89, 219, 146, 23, 89,
+ 223, 169, 23, 89, 223, 168, 23, 89, 223, 161, 23, 89, 223, 163, 23, 89,
+ 223, 176, 23, 89, 223, 156, 23, 89, 223, 166, 23, 89, 223, 175, 23, 89,
+ 223, 151, 23, 89, 231, 26, 23, 89, 231, 21, 23, 89, 231, 23, 23, 89, 231,
+ 20, 23, 89, 231, 18, 23, 89, 231, 24, 23, 89, 231, 29, 23, 89, 231, 27,
+ 23, 89, 234, 226, 23, 89, 225, 218, 23, 89, 225, 219, 23, 89, 225, 224,
+ 23, 89, 234, 224, 23, 89, 220, 69, 23, 89, 220, 59, 23, 89, 220, 62, 23,
+ 89, 220, 64, 23, 89, 226, 160, 23, 89, 236, 46, 23, 89, 236, 39, 23, 89,
+ 219, 151, 23, 89, 236, 47, 23, 89, 213, 17, 23, 89, 213, 13, 23, 89, 213,
+ 14, 23, 89, 226, 5, 23, 89, 234, 225, 23, 89, 241, 156, 23, 89, 241, 154,
+ 23, 89, 241, 157, 23, 89, 241, 155, 23, 89, 213, 23, 23, 89, 234, 63, 23,
+ 89, 234, 62, 23, 89, 234, 66, 23, 89, 234, 64, 23, 89, 234, 65, 23, 89,
+ 219, 148, 28, 4, 159, 28, 4, 240, 212, 28, 4, 241, 165, 28, 4, 242, 27,
+ 28, 4, 241, 204, 28, 4, 241, 222, 28, 4, 241, 54, 28, 4, 241, 53, 28, 4,
+ 233, 157, 28, 4, 232, 156, 28, 4, 233, 13, 28, 4, 233, 156, 28, 4, 233,
+ 74, 28, 4, 233, 82, 28, 4, 232, 208, 28, 4, 232, 129, 28, 4, 241, 174,
+ 28, 4, 241, 168, 28, 4, 241, 170, 28, 4, 241, 173, 28, 4, 241, 171, 28,
+ 4, 241, 172, 28, 4, 241, 169, 28, 4, 241, 167, 28, 4, 188, 28, 4, 230,
+ 172, 28, 4, 231, 42, 28, 4, 232, 41, 28, 4, 231, 145, 28, 4, 231, 156,
+ 28, 4, 230, 231, 28, 4, 230, 114, 28, 4, 218, 110, 28, 4, 218, 104, 28,
+ 4, 218, 106, 28, 4, 218, 109, 28, 4, 218, 107, 28, 4, 218, 108, 28, 4,
+ 218, 105, 28, 4, 218, 103, 28, 4, 203, 28, 4, 223, 51, 28, 4, 223, 188,
+ 28, 4, 224, 74, 28, 4, 224, 1, 28, 4, 224, 21, 28, 4, 223, 112, 28, 4,
+ 223, 21, 28, 4, 222, 202, 28, 4, 219, 27, 28, 4, 220, 117, 28, 4, 222,
+ 200, 28, 4, 222, 89, 28, 4, 222, 100, 28, 4, 219, 242, 28, 4, 218, 198,
+ 28, 4, 221, 24, 28, 4, 220, 150, 28, 4, 220, 212, 28, 4, 221, 20, 28, 4,
+ 220, 241, 28, 4, 220, 243, 28, 4, 220, 187, 28, 4, 220, 134, 28, 4, 224,
+ 232, 28, 4, 224, 175, 28, 4, 224, 198, 28, 4, 224, 231, 28, 4, 224, 212,
+ 28, 4, 224, 213, 28, 4, 224, 187, 28, 4, 224, 186, 28, 4, 224, 131, 28,
+ 4, 224, 127, 28, 4, 224, 130, 28, 4, 224, 128, 28, 4, 224, 129, 28, 4,
+ 224, 210, 28, 4, 224, 204, 28, 4, 224, 206, 28, 4, 224, 209, 28, 4, 224,
+ 207, 28, 4, 224, 208, 28, 4, 224, 205, 28, 4, 224, 203, 28, 4, 224, 199,
+ 28, 4, 224, 202, 28, 4, 224, 200, 28, 4, 224, 201, 28, 4, 252, 107, 28,
+ 4, 251, 54, 28, 4, 251, 184, 28, 4, 252, 106, 28, 4, 251, 242, 28, 4,
+ 251, 251, 28, 4, 251, 128, 28, 4, 251, 12, 28, 4, 215, 1, 28, 4, 214, 99,
+ 28, 4, 214, 154, 28, 4, 215, 0, 28, 4, 214, 227, 28, 4, 214, 232, 28, 4,
+ 214, 119, 28, 4, 214, 91, 28, 4, 218, 52, 28, 4, 216, 82, 28, 4, 217, 71,
+ 28, 4, 218, 49, 28, 4, 217, 219, 28, 4, 217, 229, 28, 4, 108, 28, 4, 216,
+ 45, 28, 4, 250, 219, 28, 4, 249, 53, 28, 4, 249, 244, 28, 4, 250, 218,
+ 28, 4, 250, 116, 28, 4, 250, 124, 28, 4, 249, 175, 28, 4, 249, 24, 28, 4,
+ 213, 153, 28, 4, 213, 129, 28, 4, 213, 145, 28, 4, 213, 152, 28, 4, 213,
+ 149, 28, 4, 213, 150, 28, 4, 213, 136, 28, 4, 213, 135, 28, 4, 213, 124,
+ 28, 4, 213, 120, 28, 4, 213, 123, 28, 4, 213, 121, 28, 4, 213, 122, 28,
+ 4, 205, 28, 4, 228, 92, 28, 4, 229, 64, 28, 4, 230, 43, 28, 4, 229, 184,
+ 28, 4, 229, 187, 28, 4, 228, 185, 28, 4, 228, 31, 28, 4, 228, 23, 28, 4,
+ 227, 247, 28, 4, 228, 10, 28, 4, 228, 22, 28, 4, 228, 16, 28, 4, 228, 17,
+ 28, 4, 227, 253, 28, 4, 227, 239, 28, 4, 242, 156, 61, 28, 4, 242, 156,
+ 69, 28, 4, 242, 156, 72, 28, 4, 242, 156, 254, 232, 28, 4, 242, 156, 245,
+ 165, 28, 4, 242, 156, 74, 28, 4, 242, 156, 75, 28, 4, 242, 156, 214, 49,
+ 28, 4, 181, 28, 4, 233, 238, 28, 4, 234, 101, 28, 4, 235, 14, 28, 4, 234,
+ 187, 28, 4, 234, 188, 28, 4, 234, 37, 28, 4, 234, 36, 28, 4, 233, 204,
+ 28, 4, 233, 198, 28, 4, 233, 203, 28, 4, 233, 199, 28, 4, 233, 200, 28,
+ 4, 233, 193, 28, 4, 233, 187, 28, 4, 233, 189, 28, 4, 233, 192, 28, 4,
+ 233, 190, 28, 4, 233, 191, 28, 4, 233, 188, 28, 4, 233, 186, 28, 4, 233,
+ 182, 28, 4, 233, 185, 28, 4, 233, 183, 28, 4, 233, 184, 28, 4, 214, 49,
+ 28, 4, 213, 183, 28, 4, 213, 235, 28, 4, 214, 48, 28, 4, 214, 1, 28, 4,
+ 214, 6, 28, 4, 213, 214, 28, 4, 213, 213, 28, 4, 226, 15, 61, 28, 4, 226,
+ 15, 69, 28, 4, 226, 15, 72, 28, 4, 226, 15, 254, 232, 28, 4, 226, 15,
+ 245, 165, 28, 4, 226, 15, 74, 28, 4, 226, 15, 75, 28, 4, 212, 109, 28, 4,
+ 212, 8, 28, 4, 212, 37, 28, 4, 212, 108, 28, 4, 212, 85, 28, 4, 212, 87,
+ 28, 4, 212, 16, 28, 4, 211, 251, 28, 4, 212, 75, 28, 4, 212, 55, 28, 4,
+ 212, 62, 28, 4, 212, 74, 28, 4, 212, 66, 28, 4, 212, 67, 28, 4, 212, 60,
+ 28, 4, 212, 46, 28, 4, 186, 28, 4, 212, 203, 28, 4, 212, 255, 28, 4, 213,
+ 91, 28, 4, 213, 35, 28, 4, 213, 38, 28, 4, 212, 235, 28, 4, 212, 226, 28,
+ 4, 248, 164, 28, 4, 246, 33, 28, 4, 247, 211, 28, 4, 248, 163, 28, 4,
+ 248, 28, 28, 4, 248, 41, 28, 4, 247, 99, 28, 4, 246, 2, 28, 4, 248, 86,
+ 28, 4, 248, 51, 28, 4, 248, 63, 28, 4, 248, 85, 28, 4, 248, 73, 28, 4,
+ 248, 74, 28, 4, 248, 56, 28, 4, 248, 42, 28, 4, 235, 139, 28, 4, 235, 54,
+ 28, 4, 235, 110, 28, 4, 235, 138, 28, 4, 235, 125, 28, 4, 235, 127, 28,
+ 4, 235, 71, 28, 4, 235, 35, 28, 4, 243, 110, 28, 4, 242, 92, 28, 4, 242,
+ 190, 28, 4, 243, 107, 28, 4, 243, 31, 28, 4, 243, 38, 28, 4, 242, 150,
+ 28, 4, 242, 149, 28, 4, 242, 59, 28, 4, 242, 55, 28, 4, 242, 58, 28, 4,
+ 242, 56, 28, 4, 242, 57, 28, 4, 243, 5, 28, 4, 242, 241, 28, 4, 242, 251,
+ 28, 4, 243, 4, 28, 4, 242, 255, 28, 4, 243, 0, 28, 4, 242, 245, 28, 4,
+ 242, 230, 28, 4, 217, 161, 28, 4, 217, 90, 28, 4, 217, 128, 28, 4, 217,
+ 160, 28, 4, 217, 147, 28, 4, 217, 148, 28, 4, 217, 109, 28, 4, 217, 82,
+ 28, 4, 250, 92, 28, 4, 250, 6, 28, 4, 250, 47, 28, 4, 250, 91, 28, 4,
+ 250, 64, 28, 4, 250, 67, 28, 4, 250, 23, 28, 4, 249, 251, 28, 4, 226, 23,
+ 28, 4, 225, 246, 28, 4, 226, 9, 28, 4, 226, 22, 28, 4, 226, 11, 28, 4,
+ 226, 12, 28, 4, 225, 253, 28, 4, 225, 242, 28, 4, 216, 141, 28, 4, 216,
+ 122, 28, 4, 216, 125, 28, 4, 216, 140, 28, 4, 216, 135, 28, 4, 216, 136,
+ 28, 4, 216, 124, 28, 4, 216, 120, 28, 4, 216, 5, 28, 4, 215, 253, 28, 4,
+ 216, 1, 28, 4, 216, 4, 28, 4, 216, 2, 28, 4, 216, 3, 28, 4, 215, 255, 28,
+ 4, 215, 254, 28, 4, 244, 164, 28, 4, 243, 205, 28, 4, 244, 90, 28, 4,
+ 244, 163, 28, 4, 244, 116, 28, 4, 244, 123, 28, 4, 244, 12, 28, 4, 243,
+ 188, 28, 4, 193, 28, 4, 225, 35, 28, 4, 225, 240, 28, 4, 226, 213, 28, 4,
+ 226, 86, 28, 4, 226, 96, 28, 4, 225, 150, 28, 4, 225, 2, 28, 4, 223, 11,
+ 28, 4, 230, 103, 28, 4, 243, 182, 28, 37, 243, 29, 24, 30, 233, 47, 77,
+ 28, 37, 30, 233, 47, 77, 28, 37, 243, 29, 77, 28, 222, 92, 77, 28, 213,
+ 195, 28, 243, 200, 219, 69, 28, 249, 157, 28, 221, 70, 28, 249, 164, 28,
+ 225, 79, 249, 164, 28, 224, 158, 77, 28, 226, 143, 221, 57, 28, 21, 116,
+ 28, 21, 109, 28, 21, 166, 28, 21, 163, 28, 21, 180, 28, 21, 189, 28, 21,
+ 198, 28, 21, 195, 28, 21, 200, 28, 50, 217, 200, 28, 50, 216, 38, 28, 50,
+ 217, 115, 28, 50, 243, 240, 28, 50, 244, 83, 28, 50, 220, 39, 28, 50,
+ 221, 37, 28, 50, 245, 141, 28, 50, 229, 26, 28, 50, 240, 200, 28, 50,
+ 217, 201, 217, 100, 28, 4, 222, 96, 230, 114, 28, 4, 230, 110, 28, 4,
+ 230, 111, 28, 4, 230, 112, 28, 4, 222, 96, 251, 12, 28, 4, 251, 9, 28, 4,
+ 251, 10, 28, 4, 251, 11, 28, 4, 222, 96, 243, 188, 28, 4, 243, 184, 28,
+ 4, 243, 185, 28, 4, 243, 186, 28, 4, 222, 96, 225, 2, 28, 4, 224, 254,
+ 28, 4, 224, 255, 28, 4, 225, 0, 28, 216, 242, 152, 212, 238, 28, 216,
+ 242, 152, 247, 248, 28, 216, 242, 152, 223, 135, 28, 216, 242, 152, 220,
+ 175, 223, 135, 28, 216, 242, 152, 247, 187, 28, 216, 242, 152, 234, 170,
+ 28, 216, 242, 152, 250, 31, 28, 216, 242, 152, 241, 162, 28, 216, 242,
+ 152, 247, 247, 28, 216, 242, 152, 233, 215, 158, 1, 61, 158, 1, 74, 158,
+ 1, 72, 158, 1, 75, 158, 1, 69, 158, 1, 215, 79, 158, 1, 243, 110, 158, 1,
+ 181, 158, 1, 243, 38, 158, 1, 242, 190, 158, 1, 242, 150, 158, 1, 242,
+ 92, 158, 1, 242, 60, 158, 1, 159, 158, 1, 241, 222, 158, 1, 241, 165,
+ 158, 1, 241, 54, 158, 1, 240, 212, 158, 1, 240, 193, 158, 1, 233, 157,
+ 158, 1, 233, 82, 158, 1, 233, 13, 158, 1, 232, 208, 158, 1, 232, 156,
+ 158, 1, 232, 130, 158, 1, 188, 158, 1, 231, 156, 158, 1, 231, 42, 158, 1,
+ 230, 231, 158, 1, 230, 172, 158, 1, 205, 158, 1, 241, 76, 158, 1, 230,
+ 31, 158, 1, 229, 187, 158, 1, 229, 64, 158, 1, 228, 185, 158, 1, 228, 92,
+ 158, 1, 228, 33, 158, 1, 224, 174, 158, 1, 224, 161, 158, 1, 224, 154,
+ 158, 1, 224, 146, 158, 1, 224, 135, 158, 1, 224, 133, 158, 1, 222, 202,
+ 158, 1, 197, 158, 1, 222, 100, 158, 1, 220, 117, 158, 1, 219, 242, 158,
+ 1, 219, 27, 158, 1, 218, 203, 158, 1, 248, 164, 158, 1, 218, 52, 158, 1,
+ 248, 41, 158, 1, 217, 229, 158, 1, 247, 211, 158, 1, 217, 71, 158, 1,
+ 247, 99, 158, 1, 246, 33, 158, 1, 246, 5, 158, 1, 247, 108, 158, 1, 217,
+ 12, 158, 1, 217, 11, 158, 1, 217, 1, 158, 1, 217, 0, 158, 1, 216, 255,
+ 158, 1, 216, 254, 158, 1, 216, 141, 158, 1, 216, 136, 158, 1, 216, 125,
+ 158, 1, 216, 124, 158, 1, 216, 122, 158, 1, 216, 121, 158, 1, 214, 49,
+ 158, 1, 214, 6, 158, 1, 213, 235, 158, 1, 213, 214, 158, 1, 213, 183,
+ 158, 1, 213, 171, 158, 1, 186, 158, 1, 213, 38, 158, 1, 212, 255, 158, 1,
+ 212, 235, 158, 1, 212, 203, 158, 1, 212, 169, 18, 19, 240, 160, 18, 19,
+ 74, 18, 19, 254, 196, 18, 19, 72, 18, 19, 236, 28, 18, 19, 75, 18, 19,
+ 227, 49, 18, 19, 213, 104, 227, 49, 18, 19, 66, 245, 165, 18, 19, 66, 72,
+ 18, 19, 61, 18, 19, 254, 232, 18, 19, 214, 6, 18, 19, 148, 214, 6, 18,
+ 19, 213, 235, 18, 19, 148, 213, 235, 18, 19, 213, 227, 18, 19, 148, 213,
+ 227, 18, 19, 213, 214, 18, 19, 148, 213, 214, 18, 19, 213, 202, 18, 19,
+ 148, 213, 202, 18, 19, 230, 11, 213, 202, 18, 19, 214, 49, 18, 19, 148,
+ 214, 49, 18, 19, 214, 48, 18, 19, 148, 214, 48, 18, 19, 230, 11, 214, 48,
+ 18, 19, 254, 108, 18, 19, 213, 104, 214, 82, 18, 19, 242, 156, 219, 69,
+ 18, 19, 40, 179, 18, 19, 40, 242, 113, 18, 19, 40, 251, 101, 151, 223,
+ 130, 18, 19, 40, 216, 227, 151, 223, 130, 18, 19, 40, 46, 151, 223, 130,
+ 18, 19, 40, 223, 130, 18, 19, 40, 51, 179, 18, 19, 40, 51, 220, 175, 71,
+ 219, 32, 18, 19, 40, 231, 37, 247, 74, 18, 19, 40, 220, 175, 199, 90, 18,
+ 19, 40, 225, 156, 18, 19, 40, 119, 218, 36, 18, 19, 245, 108, 18, 19,
+ 235, 251, 18, 19, 227, 62, 18, 19, 254, 32, 18, 19, 226, 96, 18, 19, 226,
+ 211, 18, 19, 225, 240, 18, 19, 225, 203, 18, 19, 225, 150, 18, 19, 225,
+ 129, 18, 19, 213, 104, 225, 129, 18, 19, 66, 241, 204, 18, 19, 66, 241,
+ 165, 18, 19, 193, 18, 19, 226, 213, 18, 19, 225, 0, 18, 19, 148, 225, 0,
+ 18, 19, 224, 254, 18, 19, 148, 224, 254, 18, 19, 224, 253, 18, 19, 148,
+ 224, 253, 18, 19, 224, 251, 18, 19, 148, 224, 251, 18, 19, 224, 250, 18,
+ 19, 148, 224, 250, 18, 19, 225, 2, 18, 19, 148, 225, 2, 18, 19, 225, 1,
+ 18, 19, 148, 225, 1, 18, 19, 213, 104, 225, 1, 18, 19, 226, 229, 18, 19,
+ 148, 226, 229, 18, 19, 66, 242, 41, 18, 19, 217, 229, 18, 19, 218, 47,
+ 18, 19, 217, 71, 18, 19, 217, 57, 18, 19, 108, 18, 19, 216, 230, 18, 19,
+ 213, 104, 216, 230, 18, 19, 66, 248, 28, 18, 19, 66, 247, 211, 18, 19,
+ 218, 52, 18, 19, 218, 49, 18, 19, 216, 43, 18, 19, 148, 216, 43, 18, 19,
+ 216, 27, 18, 19, 148, 216, 27, 18, 19, 216, 26, 18, 19, 148, 216, 26, 18,
+ 19, 109, 18, 19, 148, 109, 18, 19, 216, 20, 18, 19, 148, 216, 20, 18, 19,
+ 216, 45, 18, 19, 148, 216, 45, 18, 19, 216, 44, 18, 19, 148, 216, 44, 18,
+ 19, 230, 11, 216, 44, 18, 19, 218, 99, 18, 19, 216, 112, 18, 19, 216, 96,
+ 18, 19, 216, 95, 18, 19, 216, 115, 18, 19, 234, 188, 18, 19, 235, 11, 18,
+ 19, 234, 101, 18, 19, 234, 92, 18, 19, 234, 37, 18, 19, 234, 19, 18, 19,
+ 213, 104, 234, 19, 18, 19, 181, 18, 19, 235, 14, 18, 19, 233, 200, 18,
+ 19, 148, 233, 200, 18, 19, 233, 198, 18, 19, 148, 233, 198, 18, 19, 233,
+ 197, 18, 19, 148, 233, 197, 18, 19, 233, 196, 18, 19, 148, 233, 196, 18,
+ 19, 233, 195, 18, 19, 148, 233, 195, 18, 19, 233, 204, 18, 19, 148, 233,
+ 204, 18, 19, 233, 203, 18, 19, 148, 233, 203, 18, 19, 230, 11, 233, 203,
+ 18, 19, 235, 27, 18, 19, 233, 205, 18, 19, 219, 214, 234, 182, 18, 19,
+ 219, 214, 234, 93, 18, 19, 219, 214, 234, 32, 18, 19, 219, 214, 234, 252,
+ 18, 19, 250, 124, 18, 19, 250, 217, 18, 19, 249, 244, 18, 19, 249, 234,
+ 18, 19, 249, 175, 18, 19, 249, 113, 18, 19, 213, 104, 249, 113, 18, 19,
+ 250, 219, 18, 19, 250, 218, 18, 19, 249, 22, 18, 19, 148, 249, 22, 18,
+ 19, 249, 20, 18, 19, 148, 249, 20, 18, 19, 249, 19, 18, 19, 148, 249, 19,
+ 18, 19, 249, 18, 18, 19, 148, 249, 18, 18, 19, 249, 17, 18, 19, 148, 249,
+ 17, 18, 19, 249, 24, 18, 19, 148, 249, 24, 18, 19, 249, 23, 18, 19, 148,
+ 249, 23, 18, 19, 230, 11, 249, 23, 18, 19, 250, 252, 18, 19, 222, 127,
+ 217, 163, 18, 19, 231, 156, 18, 19, 232, 40, 18, 19, 231, 42, 18, 19,
+ 231, 14, 18, 19, 230, 231, 18, 19, 230, 202, 18, 19, 213, 104, 230, 202,
+ 18, 19, 188, 18, 19, 232, 41, 18, 19, 230, 112, 18, 19, 148, 230, 112,
+ 18, 19, 230, 110, 18, 19, 148, 230, 110, 18, 19, 230, 109, 18, 19, 148,
+ 230, 109, 18, 19, 230, 108, 18, 19, 148, 230, 108, 18, 19, 230, 107, 18,
+ 19, 148, 230, 107, 18, 19, 230, 114, 18, 19, 148, 230, 114, 18, 19, 230,
+ 113, 18, 19, 148, 230, 113, 18, 19, 230, 11, 230, 113, 18, 19, 183, 18,
+ 19, 148, 183, 18, 19, 231, 45, 18, 19, 253, 121, 183, 18, 19, 222, 127,
+ 183, 18, 19, 229, 187, 18, 19, 230, 42, 18, 19, 229, 64, 18, 19, 229, 39,
+ 18, 19, 228, 185, 18, 19, 228, 175, 18, 19, 213, 104, 228, 175, 18, 19,
+ 205, 18, 19, 230, 43, 18, 19, 228, 29, 18, 19, 148, 228, 29, 18, 19, 228,
+ 31, 18, 19, 148, 228, 31, 18, 19, 228, 30, 18, 19, 148, 228, 30, 18, 19,
+ 230, 11, 228, 30, 18, 19, 204, 18, 19, 66, 229, 161, 18, 19, 229, 69, 18,
+ 19, 233, 82, 18, 19, 233, 155, 18, 19, 233, 13, 18, 19, 232, 255, 18, 19,
+ 232, 208, 18, 19, 232, 180, 18, 19, 213, 104, 232, 180, 18, 19, 233, 157,
+ 18, 19, 233, 156, 18, 19, 232, 127, 18, 19, 148, 232, 127, 18, 19, 232,
+ 126, 18, 19, 148, 232, 126, 18, 19, 232, 125, 18, 19, 148, 232, 125, 18,
+ 19, 232, 124, 18, 19, 148, 232, 124, 18, 19, 232, 123, 18, 19, 148, 232,
+ 123, 18, 19, 232, 129, 18, 19, 148, 232, 129, 18, 19, 232, 128, 18, 19,
+ 148, 232, 128, 18, 19, 150, 18, 19, 148, 150, 18, 19, 138, 150, 18, 19,
+ 222, 100, 18, 19, 222, 198, 18, 19, 220, 117, 18, 19, 220, 101, 18, 19,
+ 219, 242, 18, 19, 219, 226, 18, 19, 213, 104, 219, 226, 18, 19, 222, 202,
+ 18, 19, 222, 200, 18, 19, 218, 194, 18, 19, 148, 218, 194, 18, 19, 218,
+ 188, 18, 19, 148, 218, 188, 18, 19, 218, 187, 18, 19, 148, 218, 187, 18,
+ 19, 218, 183, 18, 19, 148, 218, 183, 18, 19, 218, 182, 18, 19, 148, 218,
+ 182, 18, 19, 218, 198, 18, 19, 148, 218, 198, 18, 19, 218, 197, 18, 19,
+ 148, 218, 197, 18, 19, 230, 11, 218, 197, 18, 19, 197, 18, 19, 253, 121,
+ 197, 18, 19, 218, 199, 18, 19, 251, 141, 197, 18, 19, 230, 197, 220, 36,
+ 18, 19, 230, 11, 220, 27, 18, 19, 230, 11, 223, 2, 18, 19, 230, 11, 219,
+ 167, 18, 19, 230, 11, 219, 29, 18, 19, 230, 11, 220, 26, 18, 19, 230, 11,
+ 222, 103, 18, 19, 220, 243, 18, 19, 220, 212, 18, 19, 220, 207, 18, 19,
+ 220, 187, 18, 19, 220, 181, 18, 19, 221, 24, 18, 19, 221, 20, 18, 19,
+ 220, 132, 18, 19, 148, 220, 132, 18, 19, 220, 131, 18, 19, 148, 220, 131,
+ 18, 19, 220, 130, 18, 19, 148, 220, 130, 18, 19, 220, 129, 18, 19, 148,
+ 220, 129, 18, 19, 220, 128, 18, 19, 148, 220, 128, 18, 19, 220, 134, 18,
+ 19, 148, 220, 134, 18, 19, 220, 133, 18, 19, 148, 220, 133, 18, 19, 221,
+ 26, 18, 19, 213, 38, 18, 19, 213, 89, 18, 19, 212, 255, 18, 19, 212, 246,
+ 18, 19, 212, 235, 18, 19, 212, 220, 18, 19, 213, 104, 212, 220, 18, 19,
+ 186, 18, 19, 213, 91, 18, 19, 212, 166, 18, 19, 148, 212, 166, 18, 19,
+ 212, 165, 18, 19, 148, 212, 165, 18, 19, 212, 164, 18, 19, 148, 212, 164,
+ 18, 19, 212, 163, 18, 19, 148, 212, 163, 18, 19, 212, 162, 18, 19, 148,
+ 212, 162, 18, 19, 212, 168, 18, 19, 148, 212, 168, 18, 19, 212, 167, 18,
+ 19, 148, 212, 167, 18, 19, 230, 11, 212, 167, 18, 19, 213, 105, 18, 19,
+ 251, 182, 213, 105, 18, 19, 148, 213, 105, 18, 19, 222, 127, 212, 255,
+ 18, 19, 224, 21, 18, 19, 224, 112, 224, 21, 18, 19, 148, 233, 82, 18, 19,
+ 224, 73, 18, 19, 223, 188, 18, 19, 223, 136, 18, 19, 223, 112, 18, 19,
+ 223, 99, 18, 19, 148, 232, 208, 18, 19, 203, 18, 19, 224, 74, 18, 19,
+ 148, 233, 157, 18, 19, 223, 20, 18, 19, 148, 223, 20, 18, 19, 149, 18,
+ 19, 148, 149, 18, 19, 138, 149, 18, 19, 244, 123, 18, 19, 244, 161, 18,
+ 19, 244, 90, 18, 19, 244, 77, 18, 19, 244, 12, 18, 19, 244, 3, 18, 19,
+ 244, 164, 18, 19, 244, 163, 18, 19, 243, 187, 18, 19, 148, 243, 187, 18,
+ 19, 244, 230, 18, 19, 217, 148, 18, 19, 230, 96, 217, 148, 18, 19, 217,
+ 128, 18, 19, 230, 96, 217, 128, 18, 19, 217, 124, 18, 19, 230, 96, 217,
+ 124, 18, 19, 217, 109, 18, 19, 217, 106, 18, 19, 217, 161, 18, 19, 217,
+ 160, 18, 19, 217, 81, 18, 19, 148, 217, 81, 18, 19, 217, 163, 18, 19,
+ 216, 103, 18, 19, 216, 101, 18, 19, 216, 100, 18, 19, 216, 105, 18, 19,
+ 216, 106, 18, 19, 216, 18, 18, 19, 216, 17, 18, 19, 216, 16, 18, 19, 216,
+ 19, 18, 19, 228, 49, 241, 222, 18, 19, 228, 49, 241, 165, 18, 19, 228,
+ 49, 241, 147, 18, 19, 228, 49, 241, 54, 18, 19, 228, 49, 241, 39, 18, 19,
+ 228, 49, 159, 18, 19, 228, 49, 242, 27, 18, 19, 228, 49, 242, 41, 18, 19,
+ 228, 48, 242, 41, 18, 19, 241, 140, 18, 19, 224, 228, 18, 19, 224, 198,
+ 18, 19, 224, 193, 18, 19, 224, 187, 18, 19, 224, 182, 18, 19, 224, 232,
+ 18, 19, 224, 231, 18, 19, 224, 240, 18, 19, 217, 8, 18, 19, 217, 6, 18,
+ 19, 217, 5, 18, 19, 217, 9, 18, 19, 148, 224, 21, 18, 19, 148, 223, 188,
+ 18, 19, 148, 223, 112, 18, 19, 148, 203, 18, 19, 229, 157, 18, 19, 229,
+ 113, 18, 19, 229, 109, 18, 19, 229, 90, 18, 19, 229, 85, 18, 19, 229,
+ 159, 18, 19, 229, 158, 18, 19, 229, 161, 18, 19, 228, 196, 18, 19, 222,
+ 127, 220, 243, 18, 19, 222, 127, 220, 212, 18, 19, 222, 127, 220, 187,
+ 18, 19, 222, 127, 221, 24, 18, 19, 213, 200, 217, 148, 18, 19, 213, 200,
+ 217, 128, 18, 19, 213, 200, 217, 109, 18, 19, 213, 200, 217, 161, 18, 19,
+ 213, 200, 217, 163, 18, 19, 233, 19, 18, 19, 233, 18, 18, 19, 233, 17,
+ 18, 19, 233, 16, 18, 19, 233, 25, 18, 19, 233, 24, 18, 19, 233, 26, 18,
+ 19, 217, 162, 217, 148, 18, 19, 217, 162, 217, 128, 18, 19, 217, 162,
+ 217, 124, 18, 19, 217, 162, 217, 109, 18, 19, 217, 162, 217, 106, 18, 19,
+ 217, 162, 217, 161, 18, 19, 217, 162, 217, 160, 18, 19, 217, 162, 217,
+ 163, 18, 19, 254, 97, 253, 74, 18, 19, 251, 141, 74, 18, 19, 251, 141,
+ 72, 18, 19, 251, 141, 75, 18, 19, 251, 141, 61, 18, 19, 251, 141, 214, 6,
+ 18, 19, 251, 141, 213, 235, 18, 19, 251, 141, 213, 214, 18, 19, 251, 141,
+ 214, 49, 18, 19, 251, 141, 229, 187, 18, 19, 251, 141, 229, 64, 18, 19,
+ 251, 141, 228, 185, 18, 19, 251, 141, 205, 18, 19, 251, 141, 234, 188,
+ 18, 19, 251, 141, 234, 101, 18, 19, 251, 141, 234, 37, 18, 19, 251, 141,
+ 181, 18, 19, 222, 127, 241, 222, 18, 19, 222, 127, 241, 165, 18, 19, 222,
+ 127, 241, 54, 18, 19, 222, 127, 159, 18, 19, 66, 242, 196, 18, 19, 66,
+ 242, 200, 18, 19, 66, 242, 212, 18, 19, 66, 242, 211, 18, 19, 66, 242,
+ 201, 18, 19, 66, 242, 225, 18, 19, 66, 223, 51, 18, 19, 66, 223, 112, 18,
+ 19, 66, 224, 21, 18, 19, 66, 224, 1, 18, 19, 66, 223, 188, 18, 19, 66,
+ 203, 18, 19, 66, 213, 183, 18, 19, 66, 213, 214, 18, 19, 66, 214, 6, 18,
+ 19, 66, 214, 1, 18, 19, 66, 213, 235, 18, 19, 66, 214, 49, 18, 19, 66,
+ 240, 186, 18, 19, 66, 240, 187, 18, 19, 66, 240, 190, 18, 19, 66, 240,
+ 189, 18, 19, 66, 240, 188, 18, 19, 66, 240, 192, 18, 19, 66, 217, 90, 18,
+ 19, 66, 217, 109, 18, 19, 66, 217, 148, 18, 19, 66, 217, 147, 18, 19, 66,
+ 217, 128, 18, 19, 66, 217, 161, 18, 19, 66, 216, 86, 18, 19, 66, 216, 95,
+ 18, 19, 66, 216, 112, 18, 19, 66, 216, 111, 18, 19, 66, 216, 96, 18, 19,
+ 66, 216, 115, 18, 19, 66, 225, 35, 18, 19, 66, 225, 150, 18, 19, 66, 226,
+ 96, 18, 19, 66, 226, 86, 18, 19, 66, 225, 240, 18, 19, 66, 193, 18, 19,
+ 66, 226, 229, 18, 19, 66, 242, 92, 18, 19, 66, 242, 150, 18, 19, 66, 243,
+ 38, 18, 19, 66, 243, 31, 18, 19, 66, 242, 190, 18, 19, 66, 243, 110, 18,
+ 19, 66, 234, 108, 18, 19, 66, 234, 113, 18, 19, 66, 234, 125, 18, 19, 66,
+ 234, 124, 18, 19, 66, 234, 118, 18, 19, 66, 234, 138, 18, 19, 66, 234,
+ 50, 18, 19, 66, 234, 51, 18, 19, 66, 234, 54, 18, 19, 66, 234, 53, 18,
+ 19, 66, 234, 52, 18, 19, 66, 234, 55, 18, 19, 66, 234, 56, 18, 19, 66,
+ 228, 92, 18, 19, 66, 228, 185, 18, 19, 66, 229, 187, 18, 19, 66, 229,
+ 184, 18, 19, 66, 229, 64, 18, 19, 66, 205, 18, 19, 66, 230, 172, 18, 19,
+ 66, 230, 231, 18, 19, 66, 231, 156, 18, 19, 66, 231, 145, 18, 19, 66,
+ 231, 42, 18, 19, 66, 188, 18, 19, 66, 212, 203, 18, 19, 66, 212, 235, 18,
+ 19, 66, 213, 38, 18, 19, 66, 213, 35, 18, 19, 66, 212, 255, 18, 19, 66,
+ 186, 18, 19, 66, 235, 54, 18, 19, 222, 127, 235, 54, 18, 19, 66, 235, 71,
+ 18, 19, 66, 235, 127, 18, 19, 66, 235, 125, 18, 19, 66, 235, 110, 18, 19,
+ 222, 127, 235, 110, 18, 19, 66, 235, 139, 18, 19, 66, 235, 84, 18, 19,
+ 66, 235, 88, 18, 19, 66, 235, 98, 18, 19, 66, 235, 97, 18, 19, 66, 235,
+ 96, 18, 19, 66, 235, 99, 18, 19, 66, 232, 156, 18, 19, 66, 232, 208, 18,
+ 19, 66, 233, 82, 18, 19, 66, 233, 74, 18, 19, 66, 233, 13, 18, 19, 66,
+ 233, 157, 18, 19, 66, 247, 103, 18, 19, 66, 247, 104, 18, 19, 66, 247,
+ 107, 18, 19, 66, 247, 106, 18, 19, 66, 247, 105, 18, 19, 66, 247, 108,
+ 18, 19, 66, 233, 15, 18, 19, 66, 233, 17, 18, 19, 66, 233, 21, 18, 19,
+ 66, 233, 20, 18, 19, 66, 233, 19, 18, 19, 66, 233, 25, 18, 19, 66, 217,
+ 3, 18, 19, 66, 217, 5, 18, 19, 66, 217, 8, 18, 19, 66, 217, 7, 18, 19,
+ 66, 217, 6, 18, 19, 66, 217, 9, 18, 19, 66, 216, 255, 18, 19, 66, 217, 0,
+ 18, 19, 66, 217, 11, 18, 19, 66, 217, 10, 18, 19, 66, 217, 1, 18, 19, 66,
+ 217, 12, 18, 19, 66, 212, 8, 18, 19, 66, 212, 16, 18, 19, 66, 212, 87,
+ 18, 19, 66, 212, 85, 18, 19, 66, 212, 37, 18, 19, 66, 212, 109, 18, 19,
+ 66, 212, 152, 18, 19, 66, 70, 212, 152, 18, 19, 66, 245, 239, 18, 19, 66,
+ 245, 240, 18, 19, 66, 245, 247, 18, 19, 66, 245, 246, 18, 19, 66, 245,
+ 242, 18, 19, 66, 245, 249, 18, 19, 66, 219, 27, 18, 19, 66, 219, 242, 18,
+ 19, 66, 222, 100, 18, 19, 66, 222, 89, 18, 19, 66, 220, 117, 18, 19, 66,
+ 222, 202, 18, 19, 66, 220, 150, 18, 19, 66, 220, 187, 18, 19, 66, 220,
+ 243, 18, 19, 66, 220, 241, 18, 19, 66, 220, 212, 18, 19, 66, 221, 24, 18,
+ 19, 66, 221, 26, 18, 19, 66, 216, 122, 18, 19, 66, 216, 124, 18, 19, 66,
+ 216, 136, 18, 19, 66, 216, 135, 18, 19, 66, 216, 125, 18, 19, 66, 216,
+ 141, 18, 19, 66, 250, 6, 18, 19, 66, 250, 23, 18, 19, 66, 250, 67, 18,
+ 19, 66, 250, 64, 18, 19, 66, 250, 47, 18, 19, 66, 250, 92, 18, 19, 66,
+ 216, 89, 18, 19, 66, 216, 90, 18, 19, 66, 216, 93, 18, 19, 66, 216, 92,
+ 18, 19, 66, 216, 91, 18, 19, 66, 216, 94, 18, 19, 250, 48, 52, 18, 19,
+ 243, 200, 219, 69, 18, 19, 224, 224, 18, 19, 229, 156, 18, 19, 228, 193,
+ 18, 19, 228, 192, 18, 19, 228, 191, 18, 19, 228, 190, 18, 19, 228, 195,
+ 18, 19, 228, 194, 18, 19, 213, 200, 217, 79, 18, 19, 213, 200, 217, 78,
+ 18, 19, 213, 200, 217, 77, 18, 19, 213, 200, 217, 76, 18, 19, 213, 200,
+ 217, 75, 18, 19, 213, 200, 217, 82, 18, 19, 213, 200, 217, 81, 18, 19,
+ 213, 200, 40, 217, 163, 18, 19, 251, 141, 214, 82, 227, 92, 219, 207, 77,
+ 227, 92, 1, 251, 224, 227, 92, 1, 232, 145, 227, 92, 1, 244, 120, 227,
+ 92, 1, 222, 186, 227, 92, 1, 229, 24, 227, 92, 1, 215, 195, 227, 92, 1,
+ 248, 142, 227, 92, 1, 217, 33, 227, 92, 1, 249, 167, 227, 92, 1, 250,
+ 114, 227, 92, 1, 230, 161, 227, 92, 1, 242, 132, 227, 92, 1, 229, 147,
+ 227, 92, 1, 219, 62, 227, 92, 1, 223, 46, 227, 92, 1, 254, 105, 227, 92,
+ 1, 227, 53, 227, 92, 1, 215, 121, 227, 92, 1, 245, 187, 227, 92, 1, 235,
+ 186, 227, 92, 1, 245, 188, 227, 92, 1, 227, 24, 227, 92, 1, 215, 176,
+ 227, 92, 1, 236, 34, 227, 92, 1, 245, 185, 227, 92, 1, 226, 77, 227, 92,
+ 244, 119, 77, 227, 92, 223, 202, 244, 119, 77, 168, 1, 244, 110, 244,
+ 102, 244, 124, 244, 230, 168, 1, 215, 79, 168, 1, 215, 106, 215, 122, 69,
+ 168, 1, 212, 205, 168, 1, 213, 105, 168, 1, 214, 82, 168, 1, 217, 84,
+ 217, 83, 217, 104, 168, 1, 245, 25, 168, 1, 254, 4, 61, 168, 1, 227, 10,
+ 75, 168, 1, 254, 177, 61, 168, 1, 254, 132, 168, 1, 232, 186, 75, 168, 1,
+ 220, 168, 75, 168, 1, 75, 168, 1, 227, 99, 168, 1, 227, 62, 168, 1, 224,
+ 55, 224, 67, 223, 244, 149, 168, 1, 234, 199, 168, 1, 250, 111, 168, 1,
+ 234, 200, 235, 27, 168, 1, 243, 177, 168, 1, 245, 96, 168, 1, 243, 34,
+ 242, 47, 243, 177, 168, 1, 243, 72, 168, 1, 213, 176, 213, 170, 214, 82,
+ 168, 1, 242, 19, 242, 41, 168, 1, 242, 23, 242, 41, 168, 1, 232, 188,
+ 242, 41, 168, 1, 220, 171, 242, 41, 168, 1, 230, 7, 228, 18, 230, 8, 204,
+ 168, 1, 220, 169, 204, 168, 1, 246, 69, 168, 1, 235, 166, 235, 170, 235,
+ 160, 72, 168, 1, 74, 168, 1, 235, 118, 235, 142, 168, 1, 243, 19, 168, 1,
+ 232, 189, 254, 148, 168, 1, 220, 173, 61, 168, 1, 235, 152, 245, 72, 168,
+ 1, 226, 40, 226, 61, 226, 229, 168, 1, 254, 72, 245, 71, 168, 1, 219,
+ 211, 197, 168, 1, 220, 105, 232, 185, 197, 168, 1, 220, 167, 197, 168, 1,
+ 250, 252, 168, 1, 212, 152, 168, 1, 217, 16, 217, 26, 216, 7, 218, 99,
+ 168, 1, 220, 166, 218, 99, 168, 1, 249, 3, 168, 1, 251, 208, 251, 211,
+ 251, 147, 253, 74, 168, 1, 220, 172, 253, 74, 168, 1, 246, 68, 168, 1,
+ 227, 36, 168, 1, 245, 153, 245, 155, 74, 168, 1, 231, 241, 231, 249, 183,
+ 168, 1, 232, 187, 183, 168, 1, 220, 170, 183, 168, 1, 233, 97, 233, 137,
+ 232, 196, 150, 168, 1, 246, 70, 168, 1, 235, 227, 168, 1, 235, 228, 168,
+ 1, 248, 153, 248, 158, 249, 3, 168, 1, 227, 6, 245, 24, 75, 168, 1, 245,
+ 183, 168, 1, 235, 185, 168, 1, 249, 21, 168, 1, 250, 205, 168, 1, 250,
+ 123, 168, 1, 219, 100, 168, 1, 232, 184, 168, 1, 220, 165, 168, 1, 240,
+ 103, 168, 1, 224, 240, 168, 1, 213, 166, 168, 220, 81, 225, 26, 168, 230,
+ 155, 225, 26, 168, 249, 71, 225, 26, 168, 253, 177, 87, 168, 216, 47, 87,
+ 168, 251, 223, 87, 218, 32, 1, 61, 218, 32, 1, 72, 218, 32, 1, 69, 218,
+ 32, 1, 181, 218, 32, 1, 243, 110, 218, 32, 1, 229, 159, 218, 32, 1, 218,
+ 52, 218, 32, 1, 248, 164, 218, 32, 1, 205, 218, 32, 1, 193, 218, 32, 1,
+ 252, 107, 218, 32, 1, 188, 218, 32, 1, 186, 218, 32, 1, 233, 157, 218,
+ 32, 1, 214, 49, 218, 32, 1, 222, 202, 218, 32, 1, 159, 218, 32, 30, 5,
+ 72, 218, 32, 30, 5, 69, 218, 32, 5, 214, 133, 241, 246, 1, 61, 241, 246,
+ 1, 72, 241, 246, 1, 69, 241, 246, 1, 181, 241, 246, 1, 243, 110, 241,
+ 246, 1, 229, 159, 241, 246, 1, 218, 52, 241, 246, 1, 248, 164, 241, 246,
+ 1, 205, 241, 246, 1, 193, 241, 246, 1, 252, 107, 241, 246, 1, 188, 241,
+ 246, 1, 186, 241, 246, 1, 203, 241, 246, 1, 233, 157, 241, 246, 1, 214,
+ 49, 241, 246, 1, 222, 202, 241, 246, 1, 159, 241, 246, 30, 5, 72, 241,
+ 246, 30, 5, 69, 241, 246, 5, 226, 176, 226, 2, 220, 81, 225, 26, 226, 2,
+ 51, 225, 26, 251, 49, 1, 61, 251, 49, 1, 72, 251, 49, 1, 69, 251, 49, 1,
+ 181, 251, 49, 1, 243, 110, 251, 49, 1, 229, 159, 251, 49, 1, 218, 52,
+ 251, 49, 1, 248, 164, 251, 49, 1, 205, 251, 49, 1, 193, 251, 49, 1, 252,
+ 107, 251, 49, 1, 188, 251, 49, 1, 186, 251, 49, 1, 203, 251, 49, 1, 233,
+ 157, 251, 49, 1, 214, 49, 251, 49, 1, 222, 202, 251, 49, 1, 159, 251, 49,
+ 30, 5, 72, 251, 49, 30, 5, 69, 218, 31, 1, 61, 218, 31, 1, 72, 218, 31,
+ 1, 69, 218, 31, 1, 181, 218, 31, 1, 243, 110, 218, 31, 1, 229, 159, 218,
+ 31, 1, 218, 52, 218, 31, 1, 248, 164, 218, 31, 1, 205, 218, 31, 1, 193,
+ 218, 31, 1, 252, 107, 218, 31, 1, 188, 218, 31, 1, 186, 218, 31, 1, 233,
+ 157, 218, 31, 1, 214, 49, 218, 31, 1, 222, 202, 218, 31, 30, 5, 72, 218,
+ 31, 30, 5, 69, 84, 1, 181, 84, 1, 234, 138, 84, 1, 234, 37, 84, 1, 234,
+ 113, 84, 1, 229, 90, 84, 1, 250, 219, 84, 1, 250, 92, 84, 1, 249, 175,
+ 84, 1, 250, 23, 84, 1, 227, 253, 84, 1, 248, 164, 84, 1, 216, 105, 84, 1,
+ 247, 99, 84, 1, 216, 100, 84, 1, 228, 188, 84, 1, 218, 52, 84, 1, 217,
+ 161, 84, 1, 108, 84, 1, 217, 109, 84, 1, 228, 185, 84, 1, 252, 107, 84,
+ 1, 226, 23, 84, 1, 225, 150, 84, 1, 225, 253, 84, 1, 230, 231, 84, 1,
+ 212, 235, 84, 1, 223, 112, 84, 1, 232, 208, 84, 1, 214, 119, 84, 1, 221,
+ 24, 84, 1, 219, 121, 84, 1, 222, 202, 84, 1, 159, 84, 1, 233, 157, 84, 1,
+ 224, 232, 84, 235, 240, 30, 224, 218, 84, 235, 240, 30, 224, 231, 84,
+ 235, 240, 30, 224, 198, 84, 235, 240, 30, 224, 193, 84, 235, 240, 30,
+ 224, 175, 84, 235, 240, 30, 224, 147, 84, 235, 240, 30, 224, 135, 84,
+ 235, 240, 30, 224, 134, 84, 235, 240, 30, 223, 12, 84, 235, 240, 30, 223,
+ 5, 84, 235, 240, 30, 232, 121, 84, 235, 240, 30, 232, 112, 84, 235, 240,
+ 30, 224, 213, 84, 235, 240, 30, 224, 224, 84, 235, 240, 30, 224, 183,
+ 216, 15, 116, 84, 235, 240, 30, 224, 183, 216, 15, 109, 84, 235, 240, 30,
+ 224, 214, 84, 30, 235, 226, 253, 215, 84, 30, 235, 226, 254, 232, 84, 30,
+ 5, 254, 232, 84, 30, 5, 72, 84, 30, 5, 236, 28, 84, 30, 5, 213, 105, 84,
+ 30, 5, 212, 161, 84, 30, 5, 69, 84, 30, 5, 215, 92, 84, 30, 5, 215, 196,
+ 84, 30, 5, 227, 99, 84, 30, 5, 186, 84, 30, 5, 236, 55, 84, 30, 5, 74,
+ 84, 30, 5, 254, 148, 84, 30, 5, 254, 108, 84, 30, 5, 227, 49, 84, 30, 5,
+ 253, 108, 84, 5, 229, 37, 84, 5, 224, 19, 84, 5, 212, 172, 84, 5, 230,
+ 123, 84, 5, 216, 171, 84, 5, 252, 62, 84, 5, 223, 107, 84, 5, 216, 251,
+ 84, 5, 234, 246, 84, 5, 254, 110, 84, 5, 222, 160, 222, 154, 84, 5, 214,
+ 130, 84, 5, 249, 170, 84, 5, 252, 37, 84, 5, 234, 131, 84, 5, 252, 57,
+ 84, 5, 250, 197, 225, 204, 233, 209, 84, 5, 233, 54, 216, 230, 84, 5,
+ 251, 197, 84, 5, 225, 255, 230, 169, 84, 5, 234, 18, 84, 249, 39, 16,
+ 223, 181, 84, 5, 253, 90, 84, 5, 253, 111, 84, 21, 212, 79, 84, 21, 116,
+ 84, 21, 109, 84, 21, 166, 84, 21, 163, 84, 21, 180, 84, 21, 189, 84, 21,
+ 198, 84, 21, 195, 84, 21, 200, 84, 16, 233, 54, 253, 113, 219, 229, 84,
+ 16, 233, 54, 253, 113, 230, 141, 84, 16, 233, 54, 253, 113, 225, 203, 84,
+ 16, 233, 54, 253, 113, 251, 225, 84, 16, 233, 54, 253, 113, 251, 32, 84,
+ 16, 233, 54, 253, 113, 225, 95, 84, 16, 233, 54, 253, 113, 225, 89, 84,
+ 16, 233, 54, 253, 113, 225, 87, 84, 16, 233, 54, 253, 113, 225, 93, 84,
+ 16, 233, 54, 253, 113, 225, 91, 81, 251, 159, 81, 245, 120, 81, 249, 157,
+ 81, 243, 200, 219, 69, 81, 249, 164, 81, 243, 237, 247, 72, 81, 216, 250,
+ 219, 236, 240, 160, 81, 220, 116, 4, 251, 98, 231, 217, 81, 231, 246,
+ 249, 157, 81, 231, 246, 243, 200, 219, 69, 81, 229, 22, 81, 243, 223, 43,
+ 222, 77, 116, 81, 243, 223, 43, 222, 77, 109, 81, 243, 223, 43, 222, 77,
+ 166, 81, 30, 221, 57, 81, 21, 212, 79, 81, 21, 116, 81, 21, 109, 81, 21,
+ 166, 81, 21, 163, 81, 21, 180, 81, 21, 189, 81, 21, 198, 81, 21, 195, 81,
+ 21, 200, 81, 1, 61, 81, 1, 74, 81, 1, 72, 81, 1, 75, 81, 1, 69, 81, 1,
+ 227, 99, 81, 1, 215, 183, 81, 1, 245, 165, 81, 1, 205, 81, 1, 254, 24,
+ 81, 1, 252, 107, 81, 1, 193, 81, 1, 224, 232, 81, 1, 243, 110, 81, 1,
+ 188, 81, 1, 233, 157, 81, 1, 222, 202, 81, 1, 221, 24, 81, 1, 218, 52,
+ 81, 1, 248, 164, 81, 1, 250, 92, 81, 1, 235, 139, 81, 1, 186, 81, 1, 203,
+ 81, 1, 214, 49, 81, 1, 244, 164, 81, 1, 181, 81, 1, 234, 138, 81, 1, 216,
+ 141, 81, 1, 212, 109, 81, 1, 242, 27, 81, 1, 212, 9, 81, 1, 233, 25, 81,
+ 1, 212, 62, 81, 1, 250, 47, 81, 1, 216, 250, 184, 30, 52, 81, 1, 216,
+ 250, 74, 81, 1, 216, 250, 72, 81, 1, 216, 250, 75, 81, 1, 216, 250, 69,
+ 81, 1, 216, 250, 227, 99, 81, 1, 216, 250, 215, 183, 81, 1, 216, 250,
+ 254, 24, 81, 1, 216, 250, 252, 107, 81, 1, 216, 250, 193, 81, 1, 216,
+ 250, 224, 232, 81, 1, 216, 250, 243, 110, 81, 1, 216, 250, 188, 81, 1,
+ 216, 250, 218, 52, 81, 1, 216, 250, 248, 164, 81, 1, 216, 250, 250, 92,
+ 81, 1, 216, 250, 235, 139, 81, 1, 216, 250, 216, 141, 81, 1, 216, 250,
+ 186, 81, 1, 216, 250, 214, 49, 81, 1, 216, 250, 181, 81, 1, 216, 250,
+ 243, 107, 81, 1, 216, 250, 242, 27, 81, 1, 216, 250, 235, 109, 81, 1,
+ 216, 250, 229, 62, 81, 1, 216, 250, 245, 249, 81, 1, 220, 116, 74, 81, 1,
+ 220, 116, 72, 81, 1, 220, 116, 235, 150, 81, 1, 220, 116, 215, 183, 81,
+ 1, 220, 116, 69, 81, 1, 220, 116, 254, 24, 81, 1, 220, 116, 181, 81, 1,
+ 220, 116, 243, 110, 81, 1, 220, 116, 159, 81, 1, 220, 116, 193, 81, 1,
+ 220, 116, 221, 24, 81, 1, 220, 116, 218, 52, 81, 1, 220, 116, 248, 164,
+ 81, 1, 220, 116, 235, 139, 81, 1, 220, 116, 244, 164, 81, 1, 220, 116,
+ 243, 107, 81, 1, 220, 116, 242, 27, 81, 1, 220, 116, 216, 141, 81, 1,
+ 220, 116, 212, 109, 81, 1, 220, 116, 224, 74, 81, 1, 220, 116, 250, 92,
+ 81, 1, 220, 116, 212, 75, 81, 1, 231, 246, 72, 81, 1, 231, 246, 181, 81,
+ 1, 231, 246, 203, 81, 1, 231, 246, 244, 164, 81, 1, 231, 246, 212, 75,
+ 81, 1, 254, 71, 243, 92, 253, 243, 116, 81, 1, 254, 71, 243, 92, 214,
+ 129, 116, 81, 1, 254, 71, 243, 92, 248, 131, 81, 1, 254, 71, 243, 92,
+ 215, 193, 81, 1, 254, 71, 243, 92, 235, 191, 215, 193, 81, 1, 254, 71,
+ 243, 92, 252, 74, 81, 1, 254, 71, 243, 92, 133, 252, 74, 81, 1, 254, 71,
+ 243, 92, 61, 81, 1, 254, 71, 243, 92, 72, 81, 1, 254, 71, 243, 92, 181,
+ 81, 1, 254, 71, 243, 92, 229, 159, 81, 1, 254, 71, 243, 92, 250, 219, 81,
+ 1, 254, 71, 243, 92, 216, 115, 81, 1, 254, 71, 243, 92, 216, 105, 81, 1,
+ 254, 71, 243, 92, 248, 86, 81, 1, 254, 71, 243, 92, 228, 198, 81, 1, 254,
+ 71, 243, 92, 218, 52, 81, 1, 254, 71, 243, 92, 248, 164, 81, 1, 254, 71,
+ 243, 92, 193, 81, 1, 254, 71, 243, 92, 226, 23, 81, 1, 254, 71, 243, 92,
+ 219, 157, 81, 1, 254, 71, 243, 92, 212, 75, 81, 1, 254, 71, 243, 92, 212,
+ 109, 81, 1, 254, 71, 243, 92, 254, 114, 81, 1, 216, 250, 254, 71, 243,
+ 92, 218, 52, 81, 1, 216, 250, 254, 71, 243, 92, 212, 75, 81, 1, 231, 246,
+ 254, 71, 243, 92, 242, 225, 81, 1, 231, 246, 254, 71, 243, 92, 229, 159,
+ 81, 1, 231, 246, 254, 71, 243, 92, 250, 219, 81, 1, 231, 246, 254, 71,
+ 243, 92, 235, 115, 81, 1, 231, 246, 254, 71, 243, 92, 216, 115, 81, 1,
+ 231, 246, 254, 71, 243, 92, 248, 70, 81, 1, 231, 246, 254, 71, 243, 92,
+ 218, 52, 81, 1, 231, 246, 254, 71, 243, 92, 247, 232, 81, 1, 231, 246,
+ 254, 71, 243, 92, 219, 157, 81, 1, 231, 246, 254, 71, 243, 92, 249, 15,
+ 81, 1, 231, 246, 254, 71, 243, 92, 212, 75, 81, 1, 231, 246, 254, 71,
+ 243, 92, 212, 109, 81, 1, 254, 71, 243, 92, 151, 69, 81, 1, 254, 71, 243,
+ 92, 151, 186, 81, 1, 231, 246, 254, 71, 243, 92, 251, 195, 81, 1, 254,
+ 71, 243, 92, 248, 154, 81, 1, 231, 246, 254, 71, 243, 92, 233, 25, 18,
+ 19, 226, 233, 18, 19, 253, 83, 18, 19, 254, 188, 18, 19, 214, 9, 18, 19,
+ 225, 101, 18, 19, 226, 103, 18, 19, 224, 249, 18, 19, 217, 238, 18, 19,
+ 234, 195, 18, 19, 233, 201, 18, 19, 231, 196, 18, 19, 228, 148, 18, 19,
+ 230, 3, 18, 19, 233, 92, 18, 19, 219, 209, 18, 19, 222, 129, 18, 19, 220,
+ 156, 18, 19, 220, 246, 18, 19, 220, 127, 18, 19, 212, 211, 18, 19, 213,
+ 43, 18, 19, 224, 27, 18, 19, 228, 28, 18, 19, 227, 82, 228, 28, 18, 19,
+ 228, 27, 18, 19, 227, 82, 228, 27, 18, 19, 228, 26, 18, 19, 227, 82, 228,
+ 26, 18, 19, 228, 25, 18, 19, 227, 82, 228, 25, 18, 19, 223, 17, 18, 19,
+ 223, 16, 18, 19, 223, 15, 18, 19, 223, 14, 18, 19, 223, 13, 18, 19, 223,
+ 21, 18, 19, 227, 82, 226, 229, 18, 19, 227, 82, 218, 99, 18, 19, 227, 82,
+ 235, 27, 18, 19, 227, 82, 250, 252, 18, 19, 227, 82, 183, 18, 19, 227,
+ 82, 204, 18, 19, 227, 82, 197, 18, 19, 227, 82, 221, 26, 18, 19, 245,
+ 175, 214, 82, 18, 19, 213, 248, 214, 82, 18, 19, 40, 3, 223, 130, 18, 19,
+ 40, 224, 48, 247, 74, 18, 19, 224, 112, 223, 18, 18, 19, 148, 232, 180,
+ 18, 19, 148, 233, 156, 18, 19, 217, 80, 18, 19, 217, 82, 18, 19, 216, 97,
+ 18, 19, 216, 99, 18, 19, 216, 104, 18, 19, 217, 2, 18, 19, 217, 4, 18,
+ 19, 222, 127, 220, 132, 18, 19, 222, 127, 220, 181, 18, 19, 222, 127,
+ 241, 39, 18, 19, 66, 242, 54, 18, 19, 66, 248, 3, 243, 31, 18, 19, 66,
+ 243, 107, 18, 19, 66, 242, 59, 18, 19, 222, 127, 235, 37, 18, 19, 66,
+ 235, 35, 18, 19, 251, 244, 248, 3, 150, 18, 19, 251, 244, 248, 3, 149,
+ 18, 19, 66, 247, 254, 197, 209, 214, 103, 233, 34, 209, 1, 181, 209, 1,
+ 234, 138, 209, 1, 243, 110, 209, 1, 242, 225, 209, 1, 229, 159, 209, 1,
+ 250, 219, 209, 1, 250, 92, 209, 1, 235, 139, 209, 1, 235, 115, 209, 1,
+ 213, 60, 209, 1, 218, 52, 209, 1, 217, 161, 209, 1, 248, 164, 209, 1,
+ 247, 232, 209, 1, 205, 209, 1, 193, 209, 1, 226, 23, 209, 1, 252, 107,
+ 209, 1, 251, 195, 209, 1, 188, 209, 1, 186, 209, 1, 203, 209, 1, 233,
+ 157, 209, 1, 214, 49, 209, 1, 221, 24, 209, 1, 219, 157, 209, 1, 222,
+ 202, 209, 1, 159, 209, 30, 5, 61, 209, 30, 5, 72, 209, 30, 5, 69, 209,
+ 30, 5, 245, 165, 209, 30, 5, 254, 108, 209, 30, 5, 227, 49, 209, 30, 5,
+ 253, 108, 209, 30, 5, 74, 209, 30, 5, 75, 209, 219, 18, 1, 186, 209, 219,
+ 18, 1, 203, 209, 219, 18, 1, 214, 49, 209, 3, 1, 181, 209, 3, 1, 229,
+ 159, 209, 3, 1, 253, 242, 209, 3, 1, 218, 52, 209, 3, 1, 205, 209, 3, 1,
+ 193, 209, 3, 1, 188, 209, 3, 1, 203, 209, 3, 1, 233, 157, 209, 5, 230,
+ 159, 209, 5, 234, 177, 209, 5, 222, 201, 209, 5, 232, 180, 209, 244, 254,
+ 77, 209, 224, 158, 77, 209, 21, 212, 79, 209, 21, 116, 209, 21, 109, 209,
+ 21, 166, 209, 21, 163, 209, 21, 180, 209, 21, 189, 209, 21, 198, 209, 21,
+ 195, 209, 21, 200, 38, 233, 83, 1, 181, 38, 233, 83, 1, 213, 153, 38,
+ 233, 83, 1, 229, 159, 38, 233, 83, 1, 216, 141, 38, 233, 83, 1, 222, 202,
+ 38, 233, 83, 1, 186, 38, 233, 83, 1, 218, 52, 38, 233, 83, 1, 217, 161,
+ 38, 233, 83, 1, 233, 157, 38, 233, 83, 1, 193, 38, 233, 83, 1, 226, 23,
+ 38, 233, 83, 1, 188, 38, 233, 83, 1, 244, 164, 38, 233, 83, 1, 215, 1,
+ 38, 233, 83, 1, 159, 38, 233, 83, 1, 224, 232, 38, 233, 83, 1, 234, 138,
+ 38, 233, 83, 1, 216, 133, 38, 233, 83, 1, 205, 38, 233, 83, 1, 61, 38,
+ 233, 83, 1, 72, 38, 233, 83, 1, 245, 165, 38, 233, 83, 1, 245, 154, 38,
+ 233, 83, 1, 69, 38, 233, 83, 1, 227, 49, 38, 233, 83, 1, 75, 38, 233, 83,
+ 1, 215, 183, 38, 233, 83, 1, 74, 38, 233, 83, 1, 253, 106, 38, 233, 83,
+ 1, 254, 108, 38, 233, 83, 1, 216, 239, 38, 233, 83, 1, 216, 238, 38, 233,
+ 83, 1, 216, 237, 38, 233, 83, 1, 216, 236, 38, 233, 83, 1, 216, 235, 156,
+ 38, 165, 1, 124, 224, 232, 156, 38, 165, 1, 115, 224, 232, 156, 38, 165,
+ 1, 124, 181, 156, 38, 165, 1, 124, 213, 153, 156, 38, 165, 1, 124, 229,
+ 159, 156, 38, 165, 1, 115, 181, 156, 38, 165, 1, 115, 213, 153, 156, 38,
+ 165, 1, 115, 229, 159, 156, 38, 165, 1, 124, 216, 141, 156, 38, 165, 1,
+ 124, 222, 202, 156, 38, 165, 1, 124, 186, 156, 38, 165, 1, 115, 216, 141,
+ 156, 38, 165, 1, 115, 222, 202, 156, 38, 165, 1, 115, 186, 156, 38, 165,
+ 1, 124, 218, 52, 156, 38, 165, 1, 124, 217, 161, 156, 38, 165, 1, 124,
+ 205, 156, 38, 165, 1, 115, 218, 52, 156, 38, 165, 1, 115, 217, 161, 156,
+ 38, 165, 1, 115, 205, 156, 38, 165, 1, 124, 193, 156, 38, 165, 1, 124,
+ 226, 23, 156, 38, 165, 1, 124, 188, 156, 38, 165, 1, 115, 193, 156, 38,
+ 165, 1, 115, 226, 23, 156, 38, 165, 1, 115, 188, 156, 38, 165, 1, 124,
+ 244, 164, 156, 38, 165, 1, 124, 215, 1, 156, 38, 165, 1, 124, 233, 157,
+ 156, 38, 165, 1, 115, 244, 164, 156, 38, 165, 1, 115, 215, 1, 156, 38,
+ 165, 1, 115, 233, 157, 156, 38, 165, 1, 124, 159, 156, 38, 165, 1, 124,
+ 248, 164, 156, 38, 165, 1, 124, 252, 107, 156, 38, 165, 1, 115, 159, 156,
+ 38, 165, 1, 115, 248, 164, 156, 38, 165, 1, 115, 252, 107, 156, 38, 165,
+ 1, 124, 233, 206, 156, 38, 165, 1, 124, 213, 126, 156, 38, 165, 1, 115,
+ 233, 206, 156, 38, 165, 1, 115, 213, 126, 156, 38, 165, 1, 124, 219, 26,
+ 156, 38, 165, 1, 115, 219, 26, 156, 38, 165, 30, 5, 30, 220, 163, 156,
+ 38, 165, 30, 5, 254, 232, 156, 38, 165, 30, 5, 236, 28, 156, 38, 165, 30,
+ 5, 69, 156, 38, 165, 30, 5, 215, 92, 156, 38, 165, 30, 5, 74, 156, 38,
+ 165, 30, 5, 254, 148, 156, 38, 165, 30, 5, 75, 156, 38, 165, 30, 5, 227,
+ 120, 156, 38, 165, 30, 5, 215, 183, 156, 38, 165, 30, 5, 253, 83, 156,
+ 38, 165, 30, 5, 254, 188, 156, 38, 165, 30, 5, 215, 85, 156, 38, 165, 30,
+ 5, 226, 233, 156, 38, 165, 30, 5, 227, 117, 156, 38, 165, 30, 5, 215,
+ 180, 156, 38, 165, 30, 5, 235, 150, 156, 38, 165, 1, 40, 215, 79, 156,
+ 38, 165, 1, 40, 229, 161, 156, 38, 165, 1, 40, 204, 156, 38, 165, 1, 40,
+ 183, 156, 38, 165, 1, 40, 235, 27, 156, 38, 165, 1, 40, 249, 3, 156, 38,
+ 165, 1, 40, 253, 74, 156, 38, 165, 160, 231, 221, 156, 38, 165, 160, 231,
+ 220, 156, 38, 165, 21, 212, 79, 156, 38, 165, 21, 116, 156, 38, 165, 21,
+ 109, 156, 38, 165, 21, 166, 156, 38, 165, 21, 163, 156, 38, 165, 21, 180,
+ 156, 38, 165, 21, 189, 156, 38, 165, 21, 198, 156, 38, 165, 21, 195, 156,
+ 38, 165, 21, 200, 156, 38, 165, 88, 21, 116, 156, 38, 165, 5, 233, 143,
+ 156, 38, 165, 5, 233, 142, 84, 16, 226, 109, 84, 16, 230, 142, 234, 34,
+ 84, 16, 225, 204, 234, 34, 84, 16, 251, 226, 234, 34, 84, 16, 251, 33,
+ 234, 34, 84, 16, 225, 96, 234, 34, 84, 16, 225, 90, 234, 34, 84, 16, 225,
+ 88, 234, 34, 84, 16, 225, 94, 234, 34, 84, 16, 225, 92, 234, 34, 84, 16,
+ 248, 118, 234, 34, 84, 16, 248, 114, 234, 34, 84, 16, 248, 113, 234, 34,
+ 84, 16, 248, 116, 234, 34, 84, 16, 248, 115, 234, 34, 84, 16, 248, 112,
+ 234, 34, 84, 16, 216, 51, 84, 16, 230, 142, 223, 106, 84, 16, 225, 204,
+ 223, 106, 84, 16, 251, 226, 223, 106, 84, 16, 251, 33, 223, 106, 84, 16,
+ 225, 96, 223, 106, 84, 16, 225, 90, 223, 106, 84, 16, 225, 88, 223, 106,
+ 84, 16, 225, 94, 223, 106, 84, 16, 225, 92, 223, 106, 84, 16, 248, 118,
+ 223, 106, 84, 16, 248, 114, 223, 106, 84, 16, 248, 113, 223, 106, 84, 16,
+ 248, 116, 223, 106, 84, 16, 248, 115, 223, 106, 84, 16, 248, 112, 223,
+ 106, 251, 50, 1, 181, 251, 50, 1, 243, 110, 251, 50, 1, 229, 159, 251,
+ 50, 1, 229, 108, 251, 50, 1, 193, 251, 50, 1, 252, 107, 251, 50, 1, 188,
+ 251, 50, 1, 230, 175, 251, 50, 1, 218, 52, 251, 50, 1, 248, 164, 251, 50,
+ 1, 205, 251, 50, 1, 228, 147, 251, 50, 1, 250, 219, 251, 50, 1, 235, 139,
+ 251, 50, 1, 228, 23, 251, 50, 1, 228, 19, 251, 50, 1, 186, 251, 50, 1,
+ 203, 251, 50, 1, 233, 157, 251, 50, 1, 215, 1, 251, 50, 1, 222, 202, 251,
+ 50, 1, 61, 251, 50, 1, 159, 251, 50, 30, 5, 72, 251, 50, 30, 5, 69, 251,
+ 50, 30, 5, 74, 251, 50, 30, 5, 75, 251, 50, 30, 5, 254, 148, 251, 50,
+ 226, 187, 251, 50, 245, 101, 65, 222, 91, 38, 88, 1, 124, 181, 38, 88, 1,
+ 124, 234, 138, 38, 88, 1, 124, 233, 193, 38, 88, 1, 115, 181, 38, 88, 1,
+ 115, 233, 193, 38, 88, 1, 115, 234, 138, 38, 88, 1, 229, 159, 38, 88, 1,
+ 124, 250, 219, 38, 88, 1, 124, 250, 92, 38, 88, 1, 115, 250, 219, 38, 88,
+ 1, 115, 222, 202, 38, 88, 1, 115, 250, 92, 38, 88, 1, 228, 23, 38, 88, 1,
+ 224, 32, 38, 88, 1, 124, 224, 30, 38, 88, 1, 248, 164, 38, 88, 1, 115,
+ 224, 30, 38, 88, 1, 224, 41, 38, 88, 1, 124, 218, 52, 38, 88, 1, 124,
+ 217, 161, 38, 88, 1, 115, 218, 52, 38, 88, 1, 115, 217, 161, 38, 88, 1,
+ 205, 38, 88, 1, 252, 107, 38, 88, 1, 124, 193, 38, 88, 1, 124, 226, 23,
+ 38, 88, 1, 124, 244, 164, 38, 88, 1, 115, 193, 38, 88, 1, 115, 244, 164,
+ 38, 88, 1, 115, 226, 23, 38, 88, 1, 188, 38, 88, 1, 115, 186, 38, 88, 1,
+ 124, 186, 38, 88, 1, 203, 38, 88, 1, 223, 48, 38, 88, 1, 233, 157, 38,
+ 88, 1, 232, 151, 38, 88, 1, 214, 49, 38, 88, 1, 124, 221, 24, 38, 88, 1,
+ 124, 219, 157, 38, 88, 1, 124, 222, 202, 38, 88, 1, 124, 159, 38, 88, 1,
+ 232, 213, 38, 88, 1, 61, 38, 88, 1, 115, 159, 38, 88, 1, 72, 38, 88, 1,
+ 236, 28, 38, 88, 1, 69, 38, 88, 1, 215, 92, 38, 88, 1, 245, 165, 38, 88,
+ 1, 227, 49, 38, 88, 1, 233, 143, 38, 88, 1, 242, 109, 222, 202, 38, 88,
+ 249, 133, 5, 138, 203, 38, 88, 249, 133, 5, 138, 233, 157, 38, 88, 249,
+ 133, 5, 233, 158, 218, 9, 233, 133, 38, 88, 5, 232, 9, 234, 236, 233,
+ 133, 38, 88, 249, 133, 5, 40, 229, 159, 38, 88, 249, 133, 5, 115, 193,
+ 38, 88, 249, 133, 5, 124, 224, 31, 167, 115, 193, 38, 88, 249, 133, 5,
+ 188, 38, 88, 249, 133, 5, 252, 107, 38, 88, 249, 133, 5, 222, 202, 38,
+ 88, 5, 222, 181, 38, 88, 30, 5, 61, 38, 88, 30, 5, 232, 9, 222, 142, 38,
+ 88, 30, 5, 254, 232, 38, 88, 30, 5, 218, 15, 254, 232, 38, 88, 30, 5, 72,
+ 38, 88, 30, 5, 236, 28, 38, 88, 30, 5, 215, 183, 38, 88, 30, 5, 215, 91,
+ 38, 88, 30, 5, 69, 38, 88, 30, 5, 215, 92, 38, 88, 30, 5, 75, 38, 88, 30,
+ 5, 227, 121, 55, 38, 88, 30, 5, 226, 233, 38, 88, 30, 5, 74, 38, 88, 30,
+ 5, 254, 148, 38, 88, 30, 5, 227, 49, 38, 88, 30, 5, 254, 108, 38, 88, 30,
+ 5, 88, 254, 108, 38, 88, 30, 5, 227, 121, 49, 38, 88, 5, 232, 9, 234,
+ 235, 38, 88, 5, 216, 240, 38, 88, 5, 216, 239, 38, 88, 5, 234, 106, 216,
+ 238, 38, 88, 5, 234, 106, 216, 237, 38, 88, 5, 234, 106, 216, 236, 38,
+ 88, 5, 224, 77, 242, 26, 38, 88, 5, 232, 9, 222, 168, 38, 88, 5, 234,
+ 105, 234, 220, 38, 88, 37, 249, 55, 247, 74, 38, 88, 241, 33, 21, 212,
+ 79, 38, 88, 241, 33, 21, 116, 38, 88, 241, 33, 21, 109, 38, 88, 241, 33,
+ 21, 166, 38, 88, 241, 33, 21, 163, 38, 88, 241, 33, 21, 180, 38, 88, 241,
+ 33, 21, 189, 38, 88, 241, 33, 21, 198, 38, 88, 241, 33, 21, 195, 38, 88,
+ 241, 33, 21, 200, 38, 88, 88, 21, 212, 79, 38, 88, 88, 21, 116, 38, 88,
+ 88, 21, 109, 38, 88, 88, 21, 166, 38, 88, 88, 21, 163, 38, 88, 88, 21,
+ 180, 38, 88, 88, 21, 189, 38, 88, 88, 21, 198, 38, 88, 88, 21, 195, 38,
+ 88, 88, 21, 200, 38, 88, 5, 213, 234, 38, 88, 5, 213, 233, 38, 88, 5,
+ 222, 133, 38, 88, 5, 234, 166, 38, 88, 5, 240, 219, 38, 88, 5, 247, 88,
+ 38, 88, 5, 223, 202, 223, 89, 224, 41, 38, 88, 5, 232, 9, 213, 61, 38,
+ 88, 5, 235, 10, 38, 88, 5, 235, 9, 38, 88, 5, 222, 139, 38, 88, 5, 222,
+ 138, 38, 88, 5, 241, 248, 38, 88, 5, 250, 216, 99, 5, 215, 170, 223, 183,
+ 99, 5, 215, 170, 250, 189, 99, 5, 250, 120, 99, 5, 218, 215, 99, 5, 251,
+ 156, 99, 1, 254, 92, 99, 1, 254, 93, 217, 221, 99, 1, 236, 24, 99, 1,
+ 236, 25, 217, 221, 99, 1, 215, 173, 99, 1, 215, 174, 217, 221, 99, 1,
+ 224, 77, 223, 229, 99, 1, 224, 77, 223, 230, 217, 221, 99, 1, 233, 158,
+ 233, 48, 99, 1, 233, 158, 233, 49, 217, 221, 99, 1, 245, 136, 99, 1, 254,
+ 106, 99, 1, 227, 78, 99, 1, 227, 79, 217, 221, 99, 1, 181, 99, 1, 235,
+ 17, 232, 12, 99, 1, 243, 110, 99, 1, 243, 111, 242, 137, 99, 1, 229, 159,
+ 99, 1, 250, 219, 99, 1, 250, 220, 233, 146, 99, 1, 235, 139, 99, 1, 235,
+ 140, 235, 119, 99, 1, 228, 23, 99, 1, 218, 53, 233, 99, 99, 1, 218, 53,
+ 230, 137, 232, 12, 99, 1, 248, 165, 230, 137, 254, 54, 99, 1, 248, 165,
+ 230, 137, 232, 12, 99, 1, 230, 46, 224, 44, 99, 1, 218, 52, 99, 1, 218,
+ 53, 217, 242, 99, 1, 248, 164, 99, 1, 248, 165, 232, 30, 99, 1, 205, 99,
+ 1, 193, 99, 1, 226, 214, 234, 231, 99, 1, 252, 107, 99, 1, 252, 108, 234,
+ 178, 99, 1, 188, 99, 1, 186, 99, 1, 203, 99, 1, 233, 157, 99, 1, 214, 49,
+ 99, 1, 222, 203, 222, 189, 99, 1, 222, 203, 222, 149, 99, 1, 222, 202,
+ 99, 1, 159, 99, 5, 223, 222, 99, 30, 5, 217, 221, 99, 30, 5, 215, 169,
+ 99, 30, 5, 215, 170, 222, 145, 99, 30, 5, 218, 248, 99, 30, 5, 218, 249,
+ 236, 16, 99, 30, 5, 224, 77, 223, 229, 99, 30, 5, 224, 77, 223, 230, 217,
+ 221, 99, 30, 5, 233, 158, 233, 48, 99, 30, 5, 233, 158, 233, 49, 217,
+ 221, 99, 30, 5, 218, 16, 99, 30, 5, 218, 17, 223, 229, 99, 30, 5, 218,
+ 17, 217, 221, 99, 30, 5, 218, 17, 223, 230, 217, 221, 99, 30, 5, 226, 59,
+ 99, 30, 5, 226, 60, 217, 221, 99, 254, 155, 254, 154, 99, 1, 234, 255,
+ 222, 144, 99, 1, 234, 110, 222, 144, 99, 1, 216, 0, 222, 144, 99, 1, 245,
+ 160, 222, 144, 99, 1, 214, 233, 222, 144, 99, 1, 212, 100, 222, 144, 99,
+ 1, 253, 125, 222, 144, 99, 21, 212, 79, 99, 21, 116, 99, 21, 109, 99, 21,
+ 166, 99, 21, 163, 99, 21, 180, 99, 21, 189, 99, 21, 198, 99, 21, 195, 99,
+ 21, 200, 99, 226, 157, 99, 226, 182, 99, 213, 223, 99, 250, 168, 226,
+ 175, 99, 250, 168, 220, 98, 99, 250, 168, 226, 130, 99, 226, 181, 99, 27,
+ 16, 247, 80, 99, 27, 16, 248, 2, 99, 27, 16, 246, 19, 99, 27, 16, 248,
+ 121, 99, 27, 16, 248, 122, 218, 215, 99, 27, 16, 247, 157, 99, 27, 16,
+ 248, 157, 99, 27, 16, 247, 240, 99, 27, 16, 248, 143, 99, 27, 16, 248,
+ 122, 243, 33, 99, 27, 16, 37, 217, 217, 99, 27, 16, 37, 245, 99, 99, 27,
+ 16, 37, 234, 173, 99, 27, 16, 37, 234, 175, 99, 27, 16, 37, 235, 123, 99,
+ 27, 16, 37, 234, 174, 2, 235, 123, 99, 27, 16, 37, 234, 176, 2, 235, 123,
+ 99, 27, 16, 37, 251, 214, 99, 27, 16, 37, 242, 141, 99, 27, 16, 223, 146,
+ 227, 40, 246, 29, 99, 27, 16, 223, 146, 227, 40, 248, 155, 99, 27, 16,
+ 223, 146, 249, 193, 216, 75, 99, 27, 16, 223, 146, 249, 193, 218, 23, 99,
+ 27, 16, 233, 68, 227, 40, 226, 170, 99, 27, 16, 233, 68, 227, 40, 225,
+ 25, 99, 27, 16, 233, 68, 249, 193, 225, 170, 99, 27, 16, 233, 68, 249,
+ 193, 225, 160, 99, 27, 16, 233, 68, 227, 40, 225, 193, 218, 237, 5, 226,
+ 154, 218, 237, 5, 226, 166, 218, 237, 5, 226, 163, 218, 237, 1, 61, 218,
+ 237, 1, 72, 218, 237, 1, 69, 218, 237, 1, 254, 148, 218, 237, 1, 75, 218,
+ 237, 1, 74, 218, 237, 1, 245, 22, 218, 237, 1, 181, 218, 237, 1, 224,
+ 232, 218, 237, 1, 243, 110, 218, 237, 1, 229, 159, 218, 237, 1, 250, 219,
+ 218, 237, 1, 235, 139, 218, 237, 1, 212, 109, 218, 237, 1, 228, 23, 218,
+ 237, 1, 218, 52, 218, 237, 1, 248, 164, 218, 237, 1, 205, 218, 237, 1,
+ 193, 218, 237, 1, 244, 164, 218, 237, 1, 215, 1, 218, 237, 1, 252, 107,
+ 218, 237, 1, 188, 218, 237, 1, 186, 218, 237, 1, 203, 218, 237, 1, 233,
+ 157, 218, 237, 1, 214, 49, 218, 237, 1, 222, 202, 218, 237, 1, 213, 153,
+ 218, 237, 1, 159, 218, 237, 249, 133, 5, 226, 179, 218, 237, 249, 133, 5,
+ 226, 156, 218, 237, 249, 133, 5, 226, 153, 218, 237, 30, 5, 226, 169,
+ 218, 237, 30, 5, 226, 152, 218, 237, 30, 5, 226, 173, 218, 237, 30, 5,
+ 226, 162, 218, 237, 30, 5, 226, 180, 218, 237, 30, 5, 226, 171, 218, 237,
+ 5, 226, 183, 218, 237, 1, 234, 138, 218, 237, 1, 218, 176, 218, 237, 21,
+ 212, 79, 218, 237, 21, 116, 218, 237, 21, 109, 218, 237, 21, 166, 218,
+ 237, 21, 163, 218, 237, 21, 180, 218, 237, 21, 189, 218, 237, 21, 198,
+ 218, 237, 21, 195, 218, 237, 21, 200, 252, 40, 1, 61, 252, 40, 1, 220,
+ 90, 61, 252, 40, 1, 159, 252, 40, 1, 220, 90, 159, 252, 40, 1, 231, 244,
+ 159, 252, 40, 1, 252, 107, 252, 40, 1, 234, 217, 252, 107, 252, 40, 1,
+ 193, 252, 40, 1, 220, 90, 193, 252, 40, 1, 205, 252, 40, 1, 231, 244,
+ 205, 252, 40, 1, 214, 49, 252, 40, 1, 220, 90, 214, 49, 252, 40, 1, 226,
+ 194, 214, 49, 252, 40, 1, 243, 110, 252, 40, 1, 220, 90, 243, 110, 252,
+ 40, 1, 235, 139, 252, 40, 1, 248, 164, 252, 40, 1, 203, 252, 40, 1, 220,
+ 90, 203, 252, 40, 1, 188, 252, 40, 1, 220, 90, 188, 252, 40, 1, 219, 213,
+ 218, 52, 252, 40, 1, 228, 166, 218, 52, 252, 40, 1, 222, 202, 252, 40, 1,
+ 220, 90, 222, 202, 252, 40, 1, 231, 244, 222, 202, 252, 40, 1, 186, 252,
+ 40, 1, 220, 90, 186, 252, 40, 1, 229, 159, 252, 40, 1, 233, 157, 252, 40,
+ 1, 220, 90, 233, 157, 252, 40, 1, 228, 23, 252, 40, 1, 250, 219, 252, 40,
+ 1, 229, 228, 252, 40, 1, 231, 187, 252, 40, 1, 72, 252, 40, 1, 69, 252,
+ 40, 5, 216, 244, 252, 40, 30, 5, 74, 252, 40, 30, 5, 226, 194, 74, 252,
+ 40, 30, 5, 245, 165, 252, 40, 30, 5, 72, 252, 40, 30, 5, 234, 217, 72,
+ 252, 40, 30, 5, 75, 252, 40, 30, 5, 234, 217, 75, 252, 40, 30, 5, 69,
+ 252, 40, 30, 5, 111, 31, 220, 90, 222, 202, 252, 40, 249, 133, 5, 229,
+ 161, 252, 40, 249, 133, 5, 242, 41, 252, 40, 226, 165, 252, 40, 226, 161,
+ 252, 40, 16, 251, 164, 230, 46, 231, 104, 252, 40, 16, 251, 164, 225,
+ 196, 252, 40, 16, 251, 164, 235, 51, 252, 40, 16, 251, 164, 226, 165,
+ 182, 1, 181, 182, 1, 234, 48, 182, 1, 234, 138, 182, 1, 243, 110, 182, 1,
+ 242, 162, 182, 1, 229, 159, 182, 1, 250, 219, 182, 1, 250, 92, 182, 1,
+ 235, 139, 182, 1, 228, 23, 182, 1, 218, 52, 182, 1, 217, 161, 182, 1,
+ 248, 164, 182, 1, 205, 182, 1, 193, 182, 1, 225, 174, 182, 1, 226, 23,
+ 182, 1, 244, 164, 182, 1, 244, 44, 182, 1, 252, 107, 182, 1, 251, 145,
+ 182, 1, 188, 182, 1, 230, 237, 182, 1, 216, 141, 182, 1, 216, 133, 182,
+ 1, 245, 249, 182, 1, 186, 182, 1, 203, 182, 1, 233, 157, 182, 1, 159,
+ 182, 1, 241, 139, 182, 1, 215, 1, 182, 1, 222, 202, 182, 1, 221, 24, 182,
+ 1, 214, 49, 182, 1, 61, 182, 219, 18, 1, 186, 182, 219, 18, 1, 203, 182,
+ 30, 5, 254, 232, 182, 30, 5, 72, 182, 30, 5, 75, 182, 30, 5, 227, 49,
+ 182, 30, 5, 69, 182, 30, 5, 215, 92, 182, 30, 5, 74, 182, 249, 133, 5,
+ 235, 27, 182, 249, 133, 5, 183, 182, 249, 133, 5, 150, 182, 249, 133, 5,
+ 204, 182, 249, 133, 5, 226, 229, 182, 249, 133, 5, 149, 182, 249, 133, 5,
+ 218, 99, 182, 249, 133, 5, 228, 5, 182, 249, 133, 5, 234, 235, 182, 5,
+ 224, 42, 182, 5, 228, 60, 182, 225, 27, 218, 51, 182, 225, 27, 228, 13,
+ 217, 74, 218, 51, 182, 225, 27, 250, 98, 182, 225, 27, 216, 128, 250, 98,
+ 182, 225, 27, 216, 127, 182, 21, 212, 79, 182, 21, 116, 182, 21, 109,
+ 182, 21, 166, 182, 21, 163, 182, 21, 180, 182, 21, 189, 182, 21, 198,
+ 182, 21, 195, 182, 21, 200, 182, 1, 216, 115, 182, 1, 216, 105, 182, 1,
+ 248, 86, 227, 76, 250, 40, 21, 212, 79, 227, 76, 250, 40, 21, 116, 227,
+ 76, 250, 40, 21, 109, 227, 76, 250, 40, 21, 166, 227, 76, 250, 40, 21,
+ 163, 227, 76, 250, 40, 21, 180, 227, 76, 250, 40, 21, 189, 227, 76, 250,
+ 40, 21, 198, 227, 76, 250, 40, 21, 195, 227, 76, 250, 40, 21, 200, 227,
+ 76, 250, 40, 1, 233, 157, 227, 76, 250, 40, 1, 253, 122, 227, 76, 250,
+ 40, 1, 254, 121, 227, 76, 250, 40, 1, 254, 24, 227, 76, 250, 40, 1, 254,
+ 86, 227, 76, 250, 40, 1, 233, 156, 227, 76, 250, 40, 1, 254, 194, 227,
+ 76, 250, 40, 1, 254, 195, 227, 76, 250, 40, 1, 254, 193, 227, 76, 250,
+ 40, 1, 254, 189, 227, 76, 250, 40, 1, 233, 13, 227, 76, 250, 40, 1, 235,
+ 169, 227, 76, 250, 40, 1, 236, 29, 227, 76, 250, 40, 1, 235, 188, 227,
+ 76, 250, 40, 1, 235, 177, 227, 76, 250, 40, 1, 232, 156, 227, 76, 250,
+ 40, 1, 215, 190, 227, 76, 250, 40, 1, 215, 188, 227, 76, 250, 40, 1, 215,
+ 139, 227, 76, 250, 40, 1, 215, 85, 227, 76, 250, 40, 1, 233, 82, 227, 76,
+ 250, 40, 1, 245, 70, 227, 76, 250, 40, 1, 245, 168, 227, 76, 250, 40, 1,
+ 245, 108, 227, 76, 250, 40, 1, 245, 49, 227, 76, 250, 40, 1, 232, 208,
+ 227, 76, 250, 40, 1, 227, 5, 227, 76, 250, 40, 1, 227, 116, 227, 76, 250,
+ 40, 1, 226, 249, 227, 76, 250, 40, 1, 227, 88, 227, 76, 250, 40, 230,
+ 173, 216, 84, 227, 76, 250, 40, 243, 105, 216, 85, 227, 76, 250, 40, 230,
+ 171, 216, 85, 227, 76, 250, 40, 223, 242, 227, 76, 250, 40, 226, 21, 227,
+ 76, 250, 40, 254, 113, 227, 76, 250, 40, 225, 27, 230, 168, 227, 76, 250,
+ 40, 225, 27, 51, 230, 168, 214, 229, 160, 234, 215, 214, 229, 160, 221,
+ 0, 214, 229, 160, 225, 78, 214, 229, 5, 229, 40, 214, 229, 5, 213, 69,
+ 231, 35, 218, 201, 214, 229, 160, 213, 69, 254, 118, 235, 240, 218, 201,
+ 214, 229, 160, 213, 69, 235, 240, 218, 201, 214, 229, 160, 213, 69, 234,
+ 203, 235, 240, 218, 201, 214, 229, 160, 250, 190, 55, 214, 229, 160, 213,
+ 69, 234, 203, 235, 240, 218, 202, 222, 115, 214, 229, 160, 51, 218, 201,
+ 214, 229, 160, 216, 169, 218, 201, 214, 229, 160, 234, 203, 253, 244,
+ 214, 229, 160, 62, 55, 214, 229, 160, 117, 176, 55, 214, 229, 160, 133,
+ 176, 55, 214, 229, 160, 223, 137, 234, 214, 235, 240, 218, 201, 214, 229,
+ 160, 253, 120, 235, 240, 218, 201, 214, 229, 5, 214, 129, 218, 201, 214,
+ 229, 5, 214, 129, 215, 185, 214, 229, 5, 223, 202, 214, 129, 215, 185,
+ 214, 229, 5, 214, 129, 253, 244, 214, 229, 5, 223, 202, 214, 129, 253,
+ 244, 214, 229, 5, 214, 129, 215, 186, 2, 218, 27, 214, 229, 5, 214, 129,
+ 253, 245, 2, 218, 27, 214, 229, 5, 253, 243, 254, 2, 214, 229, 5, 253,
+ 243, 252, 85, 214, 229, 5, 253, 243, 214, 252, 214, 229, 5, 253, 243,
+ 214, 253, 2, 218, 27, 214, 229, 5, 217, 21, 214, 229, 5, 241, 176, 184,
+ 253, 242, 214, 229, 5, 184, 253, 242, 214, 229, 5, 223, 53, 184, 253,
+ 242, 214, 229, 5, 253, 243, 215, 192, 230, 160, 214, 229, 5, 253, 190, 7,
+ 1, 3, 6, 61, 7, 1, 3, 6, 254, 148, 7, 3, 1, 216, 58, 254, 148, 7, 1, 3,
+ 6, 252, 54, 253, 74, 7, 1, 3, 6, 250, 252, 7, 1, 3, 6, 249, 3, 7, 1, 3,
+ 6, 245, 25, 7, 1, 3, 6, 74, 7, 3, 1, 216, 58, 227, 40, 74, 7, 3, 1, 216,
+ 58, 72, 7, 1, 3, 6, 235, 142, 7, 1, 3, 6, 235, 27, 7, 1, 3, 6, 233, 171,
+ 2, 90, 7, 1, 3, 6, 183, 7, 1, 3, 6, 223, 202, 204, 7, 1, 3, 6, 75, 7, 1,
+ 3, 6, 227, 40, 75, 7, 3, 1, 220, 113, 75, 7, 3, 1, 220, 113, 227, 40, 75,
+ 7, 3, 1, 220, 113, 157, 2, 90, 7, 3, 1, 216, 58, 227, 99, 7, 1, 3, 6,
+ 227, 2, 7, 3, 1, 216, 227, 151, 75, 7, 3, 1, 251, 101, 151, 75, 7, 1, 3,
+ 6, 226, 229, 7, 1, 3, 6, 223, 202, 149, 7, 1, 3, 6, 216, 58, 149, 7, 1,
+ 3, 6, 218, 99, 7, 1, 3, 6, 69, 7, 3, 1, 220, 113, 69, 7, 3, 1, 220, 113,
+ 247, 208, 69, 7, 3, 1, 220, 113, 216, 58, 183, 7, 1, 3, 6, 215, 79, 7, 1,
+ 3, 6, 214, 82, 7, 1, 3, 6, 212, 152, 7, 1, 3, 6, 244, 232, 7, 1, 214,
+ 116, 233, 105, 219, 182, 7, 1, 254, 103, 25, 1, 3, 6, 243, 83, 25, 1, 3,
+ 6, 233, 122, 25, 1, 3, 6, 225, 240, 25, 1, 3, 6, 223, 190, 25, 1, 3, 6,
+ 225, 46, 33, 1, 3, 6, 245, 131, 59, 1, 6, 61, 59, 1, 6, 254, 148, 59, 1,
+ 6, 253, 74, 59, 1, 6, 252, 54, 253, 74, 59, 1, 6, 249, 3, 59, 1, 6, 74,
+ 59, 1, 6, 223, 202, 74, 59, 1, 6, 243, 177, 59, 1, 6, 242, 41, 59, 1, 6,
+ 72, 59, 1, 6, 235, 142, 59, 1, 6, 235, 27, 59, 1, 6, 150, 59, 1, 6, 183,
+ 59, 1, 6, 204, 59, 1, 6, 223, 202, 204, 59, 1, 6, 75, 59, 1, 6, 227, 2,
+ 59, 1, 6, 226, 229, 59, 1, 6, 149, 59, 1, 6, 218, 99, 59, 1, 6, 69, 59,
+ 1, 6, 214, 82, 59, 1, 3, 61, 59, 1, 3, 216, 58, 61, 59, 1, 3, 254, 52,
+ 59, 1, 3, 216, 58, 254, 148, 59, 1, 3, 253, 74, 59, 1, 3, 249, 3, 59, 1,
+ 3, 74, 59, 1, 3, 222, 113, 59, 1, 3, 227, 40, 74, 59, 1, 3, 216, 58, 227,
+ 40, 74, 59, 1, 3, 243, 177, 59, 1, 3, 216, 58, 72, 59, 1, 3, 235, 27, 59,
+ 1, 3, 183, 59, 1, 3, 245, 96, 59, 1, 3, 75, 59, 1, 3, 227, 40, 75, 59, 1,
+ 3, 216, 227, 151, 75, 59, 1, 3, 251, 101, 151, 75, 59, 1, 3, 226, 229,
+ 59, 1, 3, 218, 99, 59, 1, 3, 69, 59, 1, 3, 220, 113, 69, 59, 1, 3, 216,
+ 58, 183, 59, 1, 3, 215, 79, 59, 1, 3, 254, 103, 59, 1, 3, 251, 203, 59,
+ 1, 3, 25, 243, 83, 59, 1, 3, 248, 5, 59, 1, 3, 25, 226, 9, 59, 1, 3, 250,
+ 47, 7, 219, 10, 3, 1, 72, 7, 219, 10, 3, 1, 149, 7, 219, 10, 3, 1, 69, 7,
+ 219, 10, 3, 1, 215, 79, 25, 219, 10, 3, 1, 251, 203, 25, 219, 10, 3, 1,
+ 243, 83, 25, 219, 10, 3, 1, 223, 190, 25, 219, 10, 3, 1, 226, 9, 25, 219,
+ 10, 3, 1, 250, 47, 7, 3, 1, 215, 183, 7, 3, 1, 54, 2, 231, 37, 217, 42,
+ 7, 3, 1, 249, 4, 2, 231, 37, 217, 42, 7, 3, 1, 244, 231, 2, 231, 37, 217,
+ 42, 7, 3, 1, 232, 110, 2, 231, 37, 217, 42, 7, 3, 1, 230, 98, 2, 231, 37,
+ 217, 42, 7, 3, 1, 226, 230, 2, 231, 37, 217, 42, 7, 3, 1, 224, 113, 2,
+ 231, 37, 217, 42, 7, 3, 1, 224, 113, 2, 244, 57, 24, 231, 37, 217, 42, 7,
+ 3, 1, 223, 4, 2, 231, 37, 217, 42, 7, 3, 1, 218, 100, 2, 231, 37, 217,
+ 42, 7, 3, 1, 212, 153, 2, 231, 37, 217, 42, 7, 3, 1, 216, 58, 243, 177,
+ 59, 1, 33, 245, 108, 7, 3, 1, 235, 210, 243, 177, 7, 3, 1, 217, 164, 2,
+ 219, 47, 7, 3, 6, 1, 240, 146, 2, 90, 7, 3, 1, 235, 184, 2, 90, 7, 3, 1,
+ 226, 230, 2, 90, 7, 3, 6, 1, 111, 2, 90, 7, 3, 1, 215, 129, 2, 90, 7, 3,
+ 1, 54, 2, 226, 193, 101, 7, 3, 1, 249, 4, 2, 226, 193, 101, 7, 3, 1, 244,
+ 231, 2, 226, 193, 101, 7, 3, 1, 243, 178, 2, 226, 193, 101, 7, 3, 1, 235,
+ 28, 2, 226, 193, 101, 7, 3, 1, 233, 171, 2, 226, 193, 101, 7, 3, 1, 232,
+ 110, 2, 226, 193, 101, 7, 3, 1, 230, 98, 2, 226, 193, 101, 7, 3, 1, 226,
+ 230, 2, 226, 193, 101, 7, 3, 1, 224, 113, 2, 226, 193, 101, 7, 3, 1, 223,
+ 4, 2, 226, 193, 101, 7, 3, 1, 245, 41, 2, 226, 193, 101, 7, 3, 1, 215,
+ 80, 2, 226, 193, 101, 7, 3, 1, 213, 167, 2, 226, 193, 101, 7, 3, 1, 212,
+ 153, 2, 226, 193, 101, 7, 3, 1, 118, 2, 223, 207, 101, 7, 3, 1, 254, 53,
+ 2, 223, 207, 101, 7, 3, 1, 249, 4, 2, 241, 38, 24, 218, 27, 7, 3, 1, 191,
+ 2, 223, 207, 101, 7, 3, 1, 227, 40, 191, 2, 223, 207, 101, 7, 3, 1, 223,
+ 202, 227, 40, 191, 2, 223, 207, 101, 7, 3, 1, 222, 114, 2, 223, 207, 101,
+ 7, 3, 1, 240, 146, 2, 223, 207, 101, 7, 3, 1, 227, 40, 157, 2, 223, 207,
+ 101, 7, 3, 1, 245, 41, 2, 223, 207, 101, 7, 3, 1, 111, 2, 223, 207, 101,
+ 7, 3, 1, 244, 233, 2, 223, 207, 101, 59, 1, 3, 216, 58, 254, 52, 59, 1,
+ 3, 250, 252, 59, 1, 3, 250, 253, 2, 249, 41, 59, 1, 3, 245, 25, 59, 1, 3,
+ 223, 202, 227, 40, 74, 59, 1, 3, 244, 230, 59, 1, 3, 247, 73, 235, 143,
+ 2, 90, 59, 1, 3, 113, 243, 177, 59, 1, 3, 216, 58, 242, 41, 59, 1, 3,
+ 240, 146, 2, 90, 59, 1, 3, 235, 183, 59, 1, 3, 6, 72, 59, 1, 3, 6, 240,
+ 146, 2, 90, 59, 1, 3, 235, 143, 2, 249, 67, 59, 1, 3, 233, 171, 2, 223,
+ 207, 101, 59, 1, 3, 233, 171, 2, 226, 193, 101, 59, 1, 3, 6, 150, 59, 1,
+ 3, 232, 110, 2, 101, 59, 1, 3, 216, 58, 232, 110, 2, 184, 233, 60, 59, 1,
+ 3, 230, 98, 2, 42, 101, 59, 1, 3, 230, 98, 2, 223, 207, 101, 59, 1, 3, 6,
+ 204, 59, 1, 3, 252, 54, 75, 59, 1, 3, 226, 9, 59, 1, 3, 223, 4, 2, 101,
+ 59, 1, 3, 245, 40, 59, 1, 3, 218, 100, 2, 226, 193, 101, 59, 1, 3, 111,
+ 134, 59, 1, 3, 215, 128, 59, 1, 3, 6, 69, 59, 1, 3, 215, 80, 2, 101, 59,
+ 1, 3, 216, 58, 215, 79, 59, 1, 3, 212, 152, 59, 1, 3, 212, 153, 2, 223,
+ 207, 101, 59, 1, 3, 212, 153, 2, 249, 41, 59, 1, 3, 244, 232, 59, 1, 3,
+ 217, 132, 37, 246, 72, 242, 114, 254, 174, 37, 246, 72, 254, 164, 254,
+ 174, 37, 219, 253, 55, 37, 218, 207, 77, 37, 232, 36, 37, 242, 111, 37,
+ 232, 34, 37, 254, 162, 37, 242, 112, 37, 254, 163, 37, 7, 3, 1, 224, 113,
+ 55, 37, 251, 73, 37, 232, 35, 37, 51, 249, 224, 49, 37, 227, 91, 49, 37,
+ 212, 28, 55, 37, 235, 170, 55, 37, 215, 122, 49, 37, 215, 105, 49, 37, 7,
+ 3, 1, 244, 32, 227, 40, 118, 49, 37, 7, 3, 1, 254, 148, 37, 7, 3, 1, 253,
+ 240, 37, 7, 3, 1, 253, 92, 37, 7, 3, 1, 250, 253, 250, 117, 37, 7, 3, 1,
+ 235, 210, 249, 3, 37, 7, 3, 1, 245, 25, 37, 7, 3, 1, 243, 177, 37, 7, 1,
+ 3, 6, 243, 177, 37, 7, 3, 1, 235, 27, 37, 7, 3, 1, 150, 37, 7, 1, 3, 6,
+ 150, 37, 7, 1, 3, 6, 183, 37, 7, 3, 1, 204, 37, 7, 1, 3, 6, 204, 37, 7,
+ 1, 3, 6, 149, 37, 7, 3, 1, 224, 113, 223, 88, 37, 7, 3, 1, 197, 37, 7, 3,
+ 1, 184, 197, 37, 7, 3, 1, 212, 152, 37, 51, 235, 191, 251, 75, 55, 37,
+ 254, 57, 123, 211, 211, 55, 37, 42, 253, 165, 49, 37, 46, 253, 165, 24,
+ 119, 253, 165, 55, 7, 6, 1, 118, 2, 223, 131, 55, 7, 3, 1, 118, 2, 223,
+ 131, 55, 7, 6, 1, 54, 2, 62, 49, 7, 3, 1, 54, 2, 62, 49, 7, 6, 1, 54, 2,
+ 62, 55, 7, 3, 1, 54, 2, 62, 55, 7, 6, 1, 54, 2, 232, 243, 55, 7, 3, 1,
+ 54, 2, 232, 243, 55, 7, 6, 1, 250, 253, 2, 250, 118, 24, 179, 7, 3, 1,
+ 250, 253, 2, 250, 118, 24, 179, 7, 6, 1, 249, 4, 2, 62, 49, 7, 3, 1, 249,
+ 4, 2, 62, 49, 7, 6, 1, 249, 4, 2, 62, 55, 7, 3, 1, 249, 4, 2, 62, 55, 7,
+ 6, 1, 249, 4, 2, 232, 243, 55, 7, 3, 1, 249, 4, 2, 232, 243, 55, 7, 6, 1,
+ 249, 4, 2, 250, 117, 7, 3, 1, 249, 4, 2, 250, 117, 7, 6, 1, 249, 4, 2,
+ 249, 224, 55, 7, 3, 1, 249, 4, 2, 249, 224, 55, 7, 6, 1, 191, 2, 232, 38,
+ 24, 242, 113, 7, 3, 1, 191, 2, 232, 38, 24, 242, 113, 7, 6, 1, 191, 2,
+ 232, 38, 24, 179, 7, 3, 1, 191, 2, 232, 38, 24, 179, 7, 6, 1, 191, 2,
+ 249, 224, 55, 7, 3, 1, 191, 2, 249, 224, 55, 7, 6, 1, 191, 2, 217, 43,
+ 55, 7, 3, 1, 191, 2, 217, 43, 55, 7, 6, 1, 191, 2, 250, 118, 24, 251, 74,
+ 7, 3, 1, 191, 2, 250, 118, 24, 251, 74, 7, 6, 1, 244, 231, 2, 62, 49, 7,
+ 3, 1, 244, 231, 2, 62, 49, 7, 6, 1, 243, 178, 2, 232, 37, 7, 3, 1, 243,
+ 178, 2, 232, 37, 7, 6, 1, 242, 42, 2, 62, 49, 7, 3, 1, 242, 42, 2, 62,
+ 49, 7, 6, 1, 242, 42, 2, 62, 55, 7, 3, 1, 242, 42, 2, 62, 55, 7, 6, 1,
+ 242, 42, 2, 247, 209, 7, 3, 1, 242, 42, 2, 247, 209, 7, 6, 1, 242, 42, 2,
+ 250, 117, 7, 3, 1, 242, 42, 2, 250, 117, 7, 6, 1, 242, 42, 2, 251, 75,
+ 55, 7, 3, 1, 242, 42, 2, 251, 75, 55, 7, 6, 1, 240, 146, 2, 217, 43, 55,
+ 7, 3, 1, 240, 146, 2, 217, 43, 55, 7, 6, 1, 240, 146, 2, 247, 210, 24,
+ 179, 7, 3, 1, 240, 146, 2, 247, 210, 24, 179, 7, 6, 1, 235, 28, 2, 179,
+ 7, 3, 1, 235, 28, 2, 179, 7, 6, 1, 235, 28, 2, 62, 55, 7, 3, 1, 235, 28,
+ 2, 62, 55, 7, 6, 1, 235, 28, 2, 232, 243, 55, 7, 3, 1, 235, 28, 2, 232,
+ 243, 55, 7, 6, 1, 233, 171, 2, 62, 55, 7, 3, 1, 233, 171, 2, 62, 55, 7,
+ 6, 1, 233, 171, 2, 62, 251, 220, 24, 232, 37, 7, 3, 1, 233, 171, 2, 62,
+ 251, 220, 24, 232, 37, 7, 6, 1, 233, 171, 2, 232, 243, 55, 7, 3, 1, 233,
+ 171, 2, 232, 243, 55, 7, 6, 1, 233, 171, 2, 249, 224, 55, 7, 3, 1, 233,
+ 171, 2, 249, 224, 55, 7, 6, 1, 232, 110, 2, 179, 7, 3, 1, 232, 110, 2,
+ 179, 7, 6, 1, 232, 110, 2, 62, 49, 7, 3, 1, 232, 110, 2, 62, 49, 7, 6, 1,
+ 232, 110, 2, 62, 55, 7, 3, 1, 232, 110, 2, 62, 55, 7, 6, 1, 230, 98, 2,
+ 62, 49, 7, 3, 1, 230, 98, 2, 62, 49, 7, 6, 1, 230, 98, 2, 62, 55, 7, 3,
+ 1, 230, 98, 2, 62, 55, 7, 6, 1, 230, 98, 2, 232, 243, 55, 7, 3, 1, 230,
+ 98, 2, 232, 243, 55, 7, 6, 1, 230, 98, 2, 249, 224, 55, 7, 3, 1, 230, 98,
+ 2, 249, 224, 55, 7, 6, 1, 157, 2, 217, 43, 24, 179, 7, 3, 1, 157, 2, 217,
+ 43, 24, 179, 7, 6, 1, 157, 2, 217, 43, 24, 247, 209, 7, 3, 1, 157, 2,
+ 217, 43, 24, 247, 209, 7, 6, 1, 157, 2, 232, 38, 24, 242, 113, 7, 3, 1,
+ 157, 2, 232, 38, 24, 242, 113, 7, 6, 1, 157, 2, 232, 38, 24, 179, 7, 3,
+ 1, 157, 2, 232, 38, 24, 179, 7, 6, 1, 226, 230, 2, 179, 7, 3, 1, 226,
+ 230, 2, 179, 7, 6, 1, 226, 230, 2, 62, 49, 7, 3, 1, 226, 230, 2, 62, 49,
+ 7, 6, 1, 224, 113, 2, 62, 49, 7, 3, 1, 224, 113, 2, 62, 49, 7, 6, 1, 224,
+ 113, 2, 62, 55, 7, 3, 1, 224, 113, 2, 62, 55, 7, 6, 1, 224, 113, 2, 62,
+ 251, 220, 24, 232, 37, 7, 3, 1, 224, 113, 2, 62, 251, 220, 24, 232, 37,
+ 7, 6, 1, 224, 113, 2, 232, 243, 55, 7, 3, 1, 224, 113, 2, 232, 243, 55,
+ 7, 6, 1, 223, 4, 2, 62, 49, 7, 3, 1, 223, 4, 2, 62, 49, 7, 6, 1, 223, 4,
+ 2, 62, 55, 7, 3, 1, 223, 4, 2, 62, 55, 7, 6, 1, 223, 4, 2, 254, 164, 24,
+ 62, 49, 7, 3, 1, 223, 4, 2, 254, 164, 24, 62, 49, 7, 6, 1, 223, 4, 2,
+ 250, 167, 24, 62, 49, 7, 3, 1, 223, 4, 2, 250, 167, 24, 62, 49, 7, 6, 1,
+ 223, 4, 2, 62, 251, 220, 24, 62, 49, 7, 3, 1, 223, 4, 2, 62, 251, 220,
+ 24, 62, 49, 7, 6, 1, 218, 100, 2, 62, 49, 7, 3, 1, 218, 100, 2, 62, 49,
+ 7, 6, 1, 218, 100, 2, 62, 55, 7, 3, 1, 218, 100, 2, 62, 55, 7, 6, 1, 218,
+ 100, 2, 232, 243, 55, 7, 3, 1, 218, 100, 2, 232, 243, 55, 7, 6, 1, 218,
+ 100, 2, 249, 224, 55, 7, 3, 1, 218, 100, 2, 249, 224, 55, 7, 6, 1, 111,
+ 2, 247, 210, 55, 7, 3, 1, 111, 2, 247, 210, 55, 7, 6, 1, 111, 2, 217, 43,
+ 55, 7, 3, 1, 111, 2, 217, 43, 55, 7, 6, 1, 111, 2, 249, 224, 55, 7, 3, 1,
+ 111, 2, 249, 224, 55, 7, 6, 1, 111, 2, 217, 43, 24, 179, 7, 3, 1, 111, 2,
+ 217, 43, 24, 179, 7, 6, 1, 111, 2, 232, 38, 24, 247, 209, 7, 3, 1, 111,
+ 2, 232, 38, 24, 247, 209, 7, 6, 1, 215, 80, 2, 217, 42, 7, 3, 1, 215, 80,
+ 2, 217, 42, 7, 6, 1, 215, 80, 2, 62, 55, 7, 3, 1, 215, 80, 2, 62, 55, 7,
+ 6, 1, 214, 83, 2, 242, 113, 7, 3, 1, 214, 83, 2, 242, 113, 7, 6, 1, 214,
+ 83, 2, 179, 7, 3, 1, 214, 83, 2, 179, 7, 6, 1, 214, 83, 2, 247, 209, 7,
+ 3, 1, 214, 83, 2, 247, 209, 7, 6, 1, 214, 83, 2, 62, 49, 7, 3, 1, 214,
+ 83, 2, 62, 49, 7, 6, 1, 214, 83, 2, 62, 55, 7, 3, 1, 214, 83, 2, 62, 55,
+ 7, 6, 1, 213, 167, 2, 62, 49, 7, 3, 1, 213, 167, 2, 62, 49, 7, 6, 1, 213,
+ 167, 2, 247, 209, 7, 3, 1, 213, 167, 2, 247, 209, 7, 6, 1, 213, 106, 2,
+ 62, 49, 7, 3, 1, 213, 106, 2, 62, 49, 7, 6, 1, 212, 153, 2, 249, 223, 7,
+ 3, 1, 212, 153, 2, 249, 223, 7, 6, 1, 212, 153, 2, 62, 55, 7, 3, 1, 212,
+ 153, 2, 62, 55, 7, 6, 1, 212, 153, 2, 232, 243, 55, 7, 3, 1, 212, 153, 2,
+ 232, 243, 55, 7, 3, 1, 242, 42, 2, 232, 243, 55, 7, 3, 1, 218, 100, 2,
+ 247, 209, 7, 3, 1, 214, 83, 2, 223, 131, 49, 7, 3, 1, 213, 106, 2, 223,
+ 131, 49, 7, 3, 1, 118, 2, 46, 151, 223, 130, 7, 3, 1, 184, 223, 4, 2, 62,
+ 49, 7, 3, 1, 184, 223, 4, 2, 247, 207, 90, 7, 3, 1, 184, 223, 4, 2, 124,
+ 90, 7, 6, 1, 220, 255, 197, 7, 3, 1, 248, 5, 7, 6, 1, 118, 2, 62, 55, 7,
+ 3, 1, 118, 2, 62, 55, 7, 6, 1, 118, 2, 241, 38, 49, 7, 3, 1, 118, 2, 241,
+ 38, 49, 7, 6, 1, 118, 2, 249, 224, 24, 179, 7, 3, 1, 118, 2, 249, 224,
+ 24, 179, 7, 6, 1, 118, 2, 249, 224, 24, 242, 113, 7, 3, 1, 118, 2, 249,
+ 224, 24, 242, 113, 7, 6, 1, 118, 2, 249, 224, 24, 241, 38, 49, 7, 3, 1,
+ 118, 2, 249, 224, 24, 241, 38, 49, 7, 6, 1, 118, 2, 249, 224, 24, 217,
+ 42, 7, 3, 1, 118, 2, 249, 224, 24, 217, 42, 7, 6, 1, 118, 2, 249, 224,
+ 24, 62, 55, 7, 3, 1, 118, 2, 249, 224, 24, 62, 55, 7, 6, 1, 118, 2, 251,
+ 75, 24, 179, 7, 3, 1, 118, 2, 251, 75, 24, 179, 7, 6, 1, 118, 2, 251, 75,
+ 24, 242, 113, 7, 3, 1, 118, 2, 251, 75, 24, 242, 113, 7, 6, 1, 118, 2,
+ 251, 75, 24, 241, 38, 49, 7, 3, 1, 118, 2, 251, 75, 24, 241, 38, 49, 7,
+ 6, 1, 118, 2, 251, 75, 24, 217, 42, 7, 3, 1, 118, 2, 251, 75, 24, 217,
+ 42, 7, 6, 1, 118, 2, 251, 75, 24, 62, 55, 7, 3, 1, 118, 2, 251, 75, 24,
+ 62, 55, 7, 6, 1, 191, 2, 62, 55, 7, 3, 1, 191, 2, 62, 55, 7, 6, 1, 191,
+ 2, 241, 38, 49, 7, 3, 1, 191, 2, 241, 38, 49, 7, 6, 1, 191, 2, 217, 42,
+ 7, 3, 1, 191, 2, 217, 42, 7, 6, 1, 191, 2, 249, 224, 24, 179, 7, 3, 1,
+ 191, 2, 249, 224, 24, 179, 7, 6, 1, 191, 2, 249, 224, 24, 242, 113, 7, 3,
+ 1, 191, 2, 249, 224, 24, 242, 113, 7, 6, 1, 191, 2, 249, 224, 24, 241,
+ 38, 49, 7, 3, 1, 191, 2, 249, 224, 24, 241, 38, 49, 7, 6, 1, 191, 2, 249,
+ 224, 24, 217, 42, 7, 3, 1, 191, 2, 249, 224, 24, 217, 42, 7, 6, 1, 191,
+ 2, 249, 224, 24, 62, 55, 7, 3, 1, 191, 2, 249, 224, 24, 62, 55, 7, 6, 1,
+ 240, 146, 2, 241, 38, 49, 7, 3, 1, 240, 146, 2, 241, 38, 49, 7, 6, 1,
+ 240, 146, 2, 62, 55, 7, 3, 1, 240, 146, 2, 62, 55, 7, 6, 1, 157, 2, 62,
+ 55, 7, 3, 1, 157, 2, 62, 55, 7, 6, 1, 157, 2, 241, 38, 49, 7, 3, 1, 157,
+ 2, 241, 38, 49, 7, 6, 1, 157, 2, 249, 224, 24, 179, 7, 3, 1, 157, 2, 249,
+ 224, 24, 179, 7, 6, 1, 157, 2, 249, 224, 24, 242, 113, 7, 3, 1, 157, 2,
+ 249, 224, 24, 242, 113, 7, 6, 1, 157, 2, 249, 224, 24, 241, 38, 49, 7, 3,
+ 1, 157, 2, 249, 224, 24, 241, 38, 49, 7, 6, 1, 157, 2, 249, 224, 24, 217,
+ 42, 7, 3, 1, 157, 2, 249, 224, 24, 217, 42, 7, 6, 1, 157, 2, 249, 224,
+ 24, 62, 55, 7, 3, 1, 157, 2, 249, 224, 24, 62, 55, 7, 6, 1, 157, 2, 240,
+ 236, 24, 179, 7, 3, 1, 157, 2, 240, 236, 24, 179, 7, 6, 1, 157, 2, 240,
+ 236, 24, 242, 113, 7, 3, 1, 157, 2, 240, 236, 24, 242, 113, 7, 6, 1, 157,
+ 2, 240, 236, 24, 241, 38, 49, 7, 3, 1, 157, 2, 240, 236, 24, 241, 38, 49,
+ 7, 6, 1, 157, 2, 240, 236, 24, 217, 42, 7, 3, 1, 157, 2, 240, 236, 24,
+ 217, 42, 7, 6, 1, 157, 2, 240, 236, 24, 62, 55, 7, 3, 1, 157, 2, 240,
+ 236, 24, 62, 55, 7, 6, 1, 111, 2, 62, 55, 7, 3, 1, 111, 2, 62, 55, 7, 6,
+ 1, 111, 2, 241, 38, 49, 7, 3, 1, 111, 2, 241, 38, 49, 7, 6, 1, 111, 2,
+ 240, 236, 24, 179, 7, 3, 1, 111, 2, 240, 236, 24, 179, 7, 6, 1, 111, 2,
+ 240, 236, 24, 242, 113, 7, 3, 1, 111, 2, 240, 236, 24, 242, 113, 7, 6, 1,
+ 111, 2, 240, 236, 24, 241, 38, 49, 7, 3, 1, 111, 2, 240, 236, 24, 241,
+ 38, 49, 7, 6, 1, 111, 2, 240, 236, 24, 217, 42, 7, 3, 1, 111, 2, 240,
+ 236, 24, 217, 42, 7, 6, 1, 111, 2, 240, 236, 24, 62, 55, 7, 3, 1, 111, 2,
+ 240, 236, 24, 62, 55, 7, 6, 1, 213, 106, 2, 242, 113, 7, 3, 1, 213, 106,
+ 2, 242, 113, 7, 6, 1, 213, 106, 2, 62, 55, 7, 3, 1, 213, 106, 2, 62, 55,
+ 7, 6, 1, 213, 106, 2, 241, 38, 49, 7, 3, 1, 213, 106, 2, 241, 38, 49, 7,
+ 6, 1, 213, 106, 2, 217, 42, 7, 3, 1, 213, 106, 2, 217, 42, 7, 6, 1, 231,
+ 36, 232, 214, 7, 3, 1, 231, 36, 232, 214, 7, 6, 1, 231, 36, 215, 79, 7,
+ 3, 1, 231, 36, 215, 79, 7, 6, 1, 213, 106, 2, 232, 177, 7, 3, 1, 213,
+ 106, 2, 232, 177, 25, 3, 1, 254, 53, 2, 225, 39, 25, 3, 1, 254, 53, 2,
+ 248, 99, 25, 3, 1, 254, 53, 2, 225, 40, 24, 214, 245, 25, 3, 1, 254, 53,
+ 2, 207, 24, 214, 245, 25, 3, 1, 254, 53, 2, 225, 40, 24, 226, 234, 25, 3,
+ 1, 254, 53, 2, 207, 24, 226, 234, 25, 3, 1, 254, 53, 2, 225, 40, 24, 226,
+ 50, 25, 3, 1, 254, 53, 2, 207, 24, 226, 50, 25, 6, 1, 254, 53, 2, 225,
+ 39, 25, 6, 1, 254, 53, 2, 248, 99, 25, 6, 1, 254, 53, 2, 225, 40, 24,
+ 214, 245, 25, 6, 1, 254, 53, 2, 207, 24, 214, 245, 25, 6, 1, 254, 53, 2,
+ 225, 40, 24, 226, 234, 25, 6, 1, 254, 53, 2, 207, 24, 226, 234, 25, 6, 1,
+ 254, 53, 2, 225, 40, 24, 226, 50, 25, 6, 1, 254, 53, 2, 207, 24, 226, 50,
+ 25, 3, 1, 245, 64, 2, 225, 39, 25, 3, 1, 245, 64, 2, 248, 99, 25, 3, 1,
+ 245, 64, 2, 225, 40, 24, 214, 245, 25, 3, 1, 245, 64, 2, 207, 24, 214,
+ 245, 25, 3, 1, 245, 64, 2, 225, 40, 24, 226, 234, 25, 3, 1, 245, 64, 2,
+ 207, 24, 226, 234, 25, 6, 1, 245, 64, 2, 225, 39, 25, 6, 1, 245, 64, 2,
+ 248, 99, 25, 6, 1, 245, 64, 2, 225, 40, 24, 214, 245, 25, 6, 1, 245, 64,
+ 2, 207, 24, 214, 245, 25, 6, 1, 245, 64, 2, 225, 40, 24, 226, 234, 25, 6,
+ 1, 245, 64, 2, 207, 24, 226, 234, 25, 3, 1, 245, 29, 2, 225, 39, 25, 3,
+ 1, 245, 29, 2, 248, 99, 25, 3, 1, 245, 29, 2, 225, 40, 24, 214, 245, 25,
+ 3, 1, 245, 29, 2, 207, 24, 214, 245, 25, 3, 1, 245, 29, 2, 225, 40, 24,
+ 226, 234, 25, 3, 1, 245, 29, 2, 207, 24, 226, 234, 25, 3, 1, 245, 29, 2,
+ 225, 40, 24, 226, 50, 25, 3, 1, 245, 29, 2, 207, 24, 226, 50, 25, 6, 1,
+ 245, 29, 2, 225, 39, 25, 6, 1, 245, 29, 2, 248, 99, 25, 6, 1, 245, 29, 2,
+ 225, 40, 24, 214, 245, 25, 6, 1, 245, 29, 2, 207, 24, 214, 245, 25, 6, 1,
+ 245, 29, 2, 225, 40, 24, 226, 234, 25, 6, 1, 245, 29, 2, 207, 24, 226,
+ 234, 25, 6, 1, 245, 29, 2, 225, 40, 24, 226, 50, 25, 6, 1, 245, 29, 2,
+ 207, 24, 226, 50, 25, 3, 1, 235, 184, 2, 225, 39, 25, 3, 1, 235, 184, 2,
+ 248, 99, 25, 3, 1, 235, 184, 2, 225, 40, 24, 214, 245, 25, 3, 1, 235,
+ 184, 2, 207, 24, 214, 245, 25, 3, 1, 235, 184, 2, 225, 40, 24, 226, 234,
+ 25, 3, 1, 235, 184, 2, 207, 24, 226, 234, 25, 3, 1, 235, 184, 2, 225, 40,
+ 24, 226, 50, 25, 3, 1, 235, 184, 2, 207, 24, 226, 50, 25, 6, 1, 235, 184,
+ 2, 225, 39, 25, 6, 1, 235, 184, 2, 248, 99, 25, 6, 1, 235, 184, 2, 225,
+ 40, 24, 214, 245, 25, 6, 1, 235, 184, 2, 207, 24, 214, 245, 25, 6, 1,
+ 235, 184, 2, 225, 40, 24, 226, 234, 25, 6, 1, 235, 184, 2, 207, 24, 226,
+ 234, 25, 6, 1, 235, 184, 2, 225, 40, 24, 226, 50, 25, 6, 1, 235, 184, 2,
+ 207, 24, 226, 50, 25, 3, 1, 227, 66, 2, 225, 39, 25, 3, 1, 227, 66, 2,
+ 248, 99, 25, 3, 1, 227, 66, 2, 225, 40, 24, 214, 245, 25, 3, 1, 227, 66,
+ 2, 207, 24, 214, 245, 25, 3, 1, 227, 66, 2, 225, 40, 24, 226, 234, 25, 3,
+ 1, 227, 66, 2, 207, 24, 226, 234, 25, 6, 1, 227, 66, 2, 225, 39, 25, 6,
+ 1, 227, 66, 2, 248, 99, 25, 6, 1, 227, 66, 2, 225, 40, 24, 214, 245, 25,
+ 6, 1, 227, 66, 2, 207, 24, 214, 245, 25, 6, 1, 227, 66, 2, 225, 40, 24,
+ 226, 234, 25, 6, 1, 227, 66, 2, 207, 24, 226, 234, 25, 3, 1, 215, 129, 2,
+ 225, 39, 25, 3, 1, 215, 129, 2, 248, 99, 25, 3, 1, 215, 129, 2, 225, 40,
+ 24, 214, 245, 25, 3, 1, 215, 129, 2, 207, 24, 214, 245, 25, 3, 1, 215,
+ 129, 2, 225, 40, 24, 226, 234, 25, 3, 1, 215, 129, 2, 207, 24, 226, 234,
+ 25, 3, 1, 215, 129, 2, 225, 40, 24, 226, 50, 25, 3, 1, 215, 129, 2, 207,
+ 24, 226, 50, 25, 6, 1, 215, 129, 2, 248, 99, 25, 6, 1, 215, 129, 2, 207,
+ 24, 214, 245, 25, 6, 1, 215, 129, 2, 207, 24, 226, 234, 25, 6, 1, 215,
+ 129, 2, 207, 24, 226, 50, 25, 3, 1, 227, 68, 2, 225, 39, 25, 3, 1, 227,
+ 68, 2, 248, 99, 25, 3, 1, 227, 68, 2, 225, 40, 24, 214, 245, 25, 3, 1,
+ 227, 68, 2, 207, 24, 214, 245, 25, 3, 1, 227, 68, 2, 225, 40, 24, 226,
+ 234, 25, 3, 1, 227, 68, 2, 207, 24, 226, 234, 25, 3, 1, 227, 68, 2, 225,
+ 40, 24, 226, 50, 25, 3, 1, 227, 68, 2, 207, 24, 226, 50, 25, 6, 1, 227,
+ 68, 2, 225, 39, 25, 6, 1, 227, 68, 2, 248, 99, 25, 6, 1, 227, 68, 2, 225,
+ 40, 24, 214, 245, 25, 6, 1, 227, 68, 2, 207, 24, 214, 245, 25, 6, 1, 227,
+ 68, 2, 225, 40, 24, 226, 234, 25, 6, 1, 227, 68, 2, 207, 24, 226, 234,
+ 25, 6, 1, 227, 68, 2, 225, 40, 24, 226, 50, 25, 6, 1, 227, 68, 2, 207,
+ 24, 226, 50, 25, 3, 1, 254, 53, 2, 214, 245, 25, 3, 1, 254, 53, 2, 226,
+ 234, 25, 3, 1, 245, 64, 2, 214, 245, 25, 3, 1, 245, 64, 2, 226, 234, 25,
+ 3, 1, 245, 29, 2, 214, 245, 25, 3, 1, 245, 29, 2, 226, 234, 25, 3, 1,
+ 235, 184, 2, 214, 245, 25, 3, 1, 235, 184, 2, 226, 234, 25, 3, 1, 227,
+ 66, 2, 214, 245, 25, 3, 1, 227, 66, 2, 226, 234, 25, 3, 1, 215, 129, 2,
+ 214, 245, 25, 3, 1, 215, 129, 2, 226, 234, 25, 3, 1, 227, 68, 2, 214,
+ 245, 25, 3, 1, 227, 68, 2, 226, 234, 25, 3, 1, 254, 53, 2, 225, 40, 24,
+ 212, 210, 25, 3, 1, 254, 53, 2, 207, 24, 212, 210, 25, 3, 1, 254, 53, 2,
+ 225, 40, 24, 214, 246, 24, 212, 210, 25, 3, 1, 254, 53, 2, 207, 24, 214,
+ 246, 24, 212, 210, 25, 3, 1, 254, 53, 2, 225, 40, 24, 226, 235, 24, 212,
+ 210, 25, 3, 1, 254, 53, 2, 207, 24, 226, 235, 24, 212, 210, 25, 3, 1,
+ 254, 53, 2, 225, 40, 24, 226, 51, 24, 212, 210, 25, 3, 1, 254, 53, 2,
+ 207, 24, 226, 51, 24, 212, 210, 25, 6, 1, 254, 53, 2, 225, 40, 24, 225,
+ 51, 25, 6, 1, 254, 53, 2, 207, 24, 225, 51, 25, 6, 1, 254, 53, 2, 225,
+ 40, 24, 214, 246, 24, 225, 51, 25, 6, 1, 254, 53, 2, 207, 24, 214, 246,
+ 24, 225, 51, 25, 6, 1, 254, 53, 2, 225, 40, 24, 226, 235, 24, 225, 51,
+ 25, 6, 1, 254, 53, 2, 207, 24, 226, 235, 24, 225, 51, 25, 6, 1, 254, 53,
+ 2, 225, 40, 24, 226, 51, 24, 225, 51, 25, 6, 1, 254, 53, 2, 207, 24, 226,
+ 51, 24, 225, 51, 25, 3, 1, 245, 29, 2, 225, 40, 24, 212, 210, 25, 3, 1,
+ 245, 29, 2, 207, 24, 212, 210, 25, 3, 1, 245, 29, 2, 225, 40, 24, 214,
+ 246, 24, 212, 210, 25, 3, 1, 245, 29, 2, 207, 24, 214, 246, 24, 212, 210,
+ 25, 3, 1, 245, 29, 2, 225, 40, 24, 226, 235, 24, 212, 210, 25, 3, 1, 245,
+ 29, 2, 207, 24, 226, 235, 24, 212, 210, 25, 3, 1, 245, 29, 2, 225, 40,
+ 24, 226, 51, 24, 212, 210, 25, 3, 1, 245, 29, 2, 207, 24, 226, 51, 24,
+ 212, 210, 25, 6, 1, 245, 29, 2, 225, 40, 24, 225, 51, 25, 6, 1, 245, 29,
+ 2, 207, 24, 225, 51, 25, 6, 1, 245, 29, 2, 225, 40, 24, 214, 246, 24,
+ 225, 51, 25, 6, 1, 245, 29, 2, 207, 24, 214, 246, 24, 225, 51, 25, 6, 1,
+ 245, 29, 2, 225, 40, 24, 226, 235, 24, 225, 51, 25, 6, 1, 245, 29, 2,
+ 207, 24, 226, 235, 24, 225, 51, 25, 6, 1, 245, 29, 2, 225, 40, 24, 226,
+ 51, 24, 225, 51, 25, 6, 1, 245, 29, 2, 207, 24, 226, 51, 24, 225, 51, 25,
+ 3, 1, 227, 68, 2, 225, 40, 24, 212, 210, 25, 3, 1, 227, 68, 2, 207, 24,
+ 212, 210, 25, 3, 1, 227, 68, 2, 225, 40, 24, 214, 246, 24, 212, 210, 25,
+ 3, 1, 227, 68, 2, 207, 24, 214, 246, 24, 212, 210, 25, 3, 1, 227, 68, 2,
+ 225, 40, 24, 226, 235, 24, 212, 210, 25, 3, 1, 227, 68, 2, 207, 24, 226,
+ 235, 24, 212, 210, 25, 3, 1, 227, 68, 2, 225, 40, 24, 226, 51, 24, 212,
+ 210, 25, 3, 1, 227, 68, 2, 207, 24, 226, 51, 24, 212, 210, 25, 6, 1, 227,
+ 68, 2, 225, 40, 24, 225, 51, 25, 6, 1, 227, 68, 2, 207, 24, 225, 51, 25,
+ 6, 1, 227, 68, 2, 225, 40, 24, 214, 246, 24, 225, 51, 25, 6, 1, 227, 68,
+ 2, 207, 24, 214, 246, 24, 225, 51, 25, 6, 1, 227, 68, 2, 225, 40, 24,
+ 226, 235, 24, 225, 51, 25, 6, 1, 227, 68, 2, 207, 24, 226, 235, 24, 225,
+ 51, 25, 6, 1, 227, 68, 2, 225, 40, 24, 226, 51, 24, 225, 51, 25, 6, 1,
+ 227, 68, 2, 207, 24, 226, 51, 24, 225, 51, 25, 3, 1, 254, 53, 2, 214,
+ 101, 25, 3, 1, 254, 53, 2, 232, 37, 25, 3, 1, 254, 53, 2, 214, 246, 24,
+ 212, 210, 25, 3, 1, 254, 53, 2, 212, 210, 25, 3, 1, 254, 53, 2, 226, 235,
+ 24, 212, 210, 25, 3, 1, 254, 53, 2, 226, 50, 25, 3, 1, 254, 53, 2, 226,
+ 51, 24, 212, 210, 25, 6, 1, 254, 53, 2, 214, 101, 25, 6, 1, 254, 53, 2,
+ 232, 37, 25, 6, 1, 254, 53, 2, 214, 245, 25, 6, 1, 254, 53, 2, 226, 234,
+ 25, 6, 1, 254, 53, 2, 225, 51, 25, 234, 11, 25, 225, 51, 25, 225, 39, 25,
+ 226, 50, 25, 247, 204, 24, 226, 50, 25, 3, 1, 245, 29, 2, 214, 246, 24,
+ 212, 210, 25, 3, 1, 245, 29, 2, 212, 210, 25, 3, 1, 245, 29, 2, 226, 235,
+ 24, 212, 210, 25, 3, 1, 245, 29, 2, 226, 50, 25, 3, 1, 245, 29, 2, 226,
+ 51, 24, 212, 210, 25, 6, 1, 245, 64, 2, 214, 245, 25, 6, 1, 245, 64, 2,
+ 226, 234, 25, 6, 1, 245, 29, 2, 214, 245, 25, 6, 1, 245, 29, 2, 226, 234,
+ 25, 6, 1, 245, 29, 2, 225, 51, 25, 225, 40, 24, 214, 245, 25, 225, 40,
+ 24, 226, 234, 25, 225, 40, 24, 226, 50, 25, 3, 1, 235, 184, 2, 214, 101,
+ 25, 3, 1, 235, 184, 2, 232, 37, 25, 3, 1, 235, 184, 2, 247, 204, 24, 214,
+ 245, 25, 3, 1, 235, 184, 2, 247, 204, 24, 226, 234, 25, 3, 1, 235, 184,
+ 2, 226, 50, 25, 3, 1, 235, 184, 2, 247, 204, 24, 226, 50, 25, 6, 1, 235,
+ 184, 2, 214, 101, 25, 6, 1, 235, 184, 2, 232, 37, 25, 6, 1, 235, 184, 2,
+ 214, 245, 25, 6, 1, 235, 184, 2, 226, 234, 25, 207, 24, 214, 245, 25,
+ 207, 24, 226, 234, 25, 207, 24, 226, 50, 25, 3, 1, 215, 129, 2, 214, 101,
+ 25, 3, 1, 215, 129, 2, 232, 37, 25, 3, 1, 215, 129, 2, 247, 204, 24, 214,
+ 245, 25, 3, 1, 215, 129, 2, 247, 204, 24, 226, 234, 25, 3, 1, 223, 191,
+ 2, 225, 39, 25, 3, 1, 223, 191, 2, 248, 99, 25, 3, 1, 215, 129, 2, 226,
+ 50, 25, 3, 1, 215, 129, 2, 247, 204, 24, 226, 50, 25, 6, 1, 215, 129, 2,
+ 214, 101, 25, 6, 1, 215, 129, 2, 232, 37, 25, 6, 1, 215, 129, 2, 214,
+ 245, 25, 6, 1, 215, 129, 2, 226, 234, 25, 6, 1, 223, 191, 2, 248, 99, 25,
+ 247, 204, 24, 214, 245, 25, 247, 204, 24, 226, 234, 25, 214, 245, 25, 3,
+ 1, 227, 68, 2, 214, 246, 24, 212, 210, 25, 3, 1, 227, 68, 2, 212, 210,
+ 25, 3, 1, 227, 68, 2, 226, 235, 24, 212, 210, 25, 3, 1, 227, 68, 2, 226,
+ 50, 25, 3, 1, 227, 68, 2, 226, 51, 24, 212, 210, 25, 6, 1, 227, 66, 2,
+ 214, 245, 25, 6, 1, 227, 66, 2, 226, 234, 25, 6, 1, 227, 68, 2, 214, 245,
+ 25, 6, 1, 227, 68, 2, 226, 234, 25, 6, 1, 227, 68, 2, 225, 51, 25, 226,
+ 234, 25, 248, 99, 245, 109, 224, 172, 245, 118, 224, 172, 245, 109, 219,
+ 206, 245, 118, 219, 206, 217, 95, 219, 206, 243, 235, 219, 206, 220, 51,
+ 219, 206, 244, 81, 219, 206, 225, 27, 219, 206, 217, 123, 219, 206, 242,
+ 17, 219, 206, 212, 80, 213, 230, 219, 206, 212, 80, 213, 230, 228, 178,
+ 212, 80, 213, 230, 235, 66, 233, 62, 77, 223, 140, 77, 240, 160, 228,
+ 179, 240, 160, 244, 81, 248, 101, 245, 109, 248, 101, 245, 118, 248, 101,
+ 199, 134, 51, 71, 232, 242, 51, 115, 232, 242, 42, 220, 81, 224, 143, 77,
+ 46, 220, 81, 224, 143, 77, 220, 81, 232, 164, 224, 143, 77, 220, 81, 241,
+ 149, 224, 143, 77, 42, 51, 224, 143, 77, 46, 51, 224, 143, 77, 51, 232,
+ 164, 224, 143, 77, 51, 241, 149, 224, 143, 77, 248, 149, 51, 248, 149,
+ 251, 42, 216, 180, 251, 42, 122, 62, 233, 80, 117, 62, 233, 80, 199, 245,
+ 120, 240, 158, 225, 144, 232, 243, 221, 57, 226, 143, 221, 57, 233, 62,
+ 245, 116, 223, 140, 245, 116, 225, 126, 247, 148, 243, 244, 233, 62, 226,
+ 241, 223, 140, 226, 241, 230, 14, 228, 184, 219, 206, 226, 58, 231, 6,
+ 52, 226, 58, 217, 201, 217, 101, 52, 225, 71, 51, 225, 71, 216, 169, 225,
+ 71, 223, 202, 225, 71, 223, 202, 51, 225, 71, 223, 202, 216, 169, 225,
+ 71, 250, 170, 220, 81, 233, 66, 254, 19, 224, 143, 77, 220, 81, 223, 144,
+ 254, 19, 224, 143, 77, 224, 0, 77, 51, 244, 254, 77, 235, 198, 226, 243,
+ 215, 150, 137, 217, 65, 250, 171, 235, 213, 225, 144, 253, 130, 240, 161,
+ 251, 42, 243, 228, 220, 23, 42, 41, 251, 85, 2, 224, 152, 46, 41, 251,
+ 85, 2, 224, 152, 51, 224, 158, 77, 224, 158, 244, 254, 77, 244, 254, 224,
+ 158, 77, 217, 23, 5, 245, 30, 223, 202, 225, 200, 52, 83, 132, 251, 42,
+ 83, 95, 251, 42, 115, 253, 132, 223, 202, 221, 70, 249, 194, 215, 134,
+ 117, 253, 131, 254, 67, 214, 165, 249, 156, 230, 251, 52, 218, 179, 248,
+ 101, 235, 191, 215, 150, 244, 21, 225, 27, 77, 133, 62, 225, 26, 224,
+ 169, 225, 71, 243, 237, 62, 225, 26, 244, 50, 62, 225, 26, 117, 62, 225,
+ 26, 243, 237, 62, 77, 246, 72, 249, 70, 216, 179, 71, 243, 237, 247, 72,
+ 231, 147, 14, 219, 206, 213, 196, 235, 66, 243, 198, 253, 222, 235, 189,
+ 217, 38, 235, 189, 221, 57, 235, 189, 225, 156, 235, 225, 218, 127, 218,
+ 196, 254, 166, 218, 127, 218, 196, 235, 225, 12, 243, 245, 221, 3, 254,
+ 166, 12, 243, 245, 221, 3, 230, 10, 21, 221, 4, 228, 180, 21, 221, 4,
+ 218, 223, 212, 79, 218, 223, 7, 3, 1, 72, 218, 223, 163, 218, 223, 180,
+ 218, 223, 189, 218, 223, 198, 218, 223, 195, 218, 223, 200, 218, 223, 94,
+ 52, 218, 223, 230, 250, 218, 223, 245, 61, 52, 218, 223, 42, 226, 131,
+ 218, 223, 46, 226, 131, 218, 223, 7, 3, 1, 204, 219, 10, 212, 79, 219,
+ 10, 116, 219, 10, 109, 219, 10, 166, 219, 10, 163, 219, 10, 180, 219, 10,
+ 189, 219, 10, 198, 219, 10, 195, 219, 10, 200, 219, 10, 94, 52, 219, 10,
+ 230, 250, 219, 10, 245, 61, 52, 219, 10, 42, 226, 131, 219, 10, 46, 226,
+ 131, 7, 219, 10, 3, 1, 61, 7, 219, 10, 3, 1, 74, 7, 219, 10, 3, 1, 75, 7,
+ 219, 10, 3, 1, 213, 166, 7, 219, 10, 3, 1, 222, 113, 7, 219, 10, 3, 1,
+ 242, 41, 7, 219, 10, 3, 1, 235, 27, 7, 219, 10, 3, 1, 150, 7, 219, 10, 3,
+ 1, 183, 7, 219, 10, 3, 1, 204, 7, 219, 10, 3, 1, 226, 229, 7, 219, 10, 3,
+ 1, 197, 7, 219, 10, 3, 1, 218, 99, 245, 13, 52, 249, 165, 52, 249, 57,
+ 52, 243, 221, 243, 224, 52, 232, 227, 52, 231, 7, 52, 230, 29, 52, 226,
+ 38, 52, 223, 29, 52, 213, 204, 52, 156, 220, 229, 52, 247, 81, 52, 245,
+ 14, 52, 234, 85, 52, 216, 76, 52, 246, 55, 52, 243, 16, 226, 68, 52, 226,
+ 36, 52, 242, 88, 52, 253, 98, 52, 240, 215, 52, 250, 119, 52, 232, 220,
+ 216, 216, 52, 219, 188, 52, 217, 198, 52, 235, 238, 223, 29, 52, 37, 42,
+ 241, 238, 49, 37, 46, 241, 238, 49, 37, 184, 71, 232, 243, 226, 244, 37,
+ 220, 175, 71, 232, 243, 226, 244, 37, 253, 255, 76, 49, 37, 249, 195, 76,
+ 49, 37, 42, 76, 49, 37, 46, 76, 49, 37, 223, 131, 226, 244, 37, 249, 195,
+ 223, 131, 226, 244, 37, 253, 255, 223, 131, 226, 244, 37, 133, 176, 49,
+ 37, 243, 237, 176, 49, 37, 245, 104, 249, 228, 37, 245, 104, 219, 166,
+ 37, 245, 104, 247, 200, 37, 245, 104, 249, 229, 252, 97, 37, 42, 46, 76,
+ 49, 37, 245, 104, 222, 107, 37, 245, 104, 234, 141, 37, 245, 104, 215,
+ 126, 225, 141, 216, 183, 37, 223, 203, 219, 232, 226, 244, 37, 51, 71,
+ 219, 45, 226, 244, 37, 254, 9, 87, 37, 216, 169, 215, 152, 37, 213, 232,
+ 251, 68, 49, 37, 132, 76, 226, 244, 37, 184, 51, 219, 232, 226, 244, 37,
+ 95, 241, 238, 2, 206, 246, 57, 37, 132, 241, 238, 2, 206, 246, 57, 37,
+ 42, 76, 55, 37, 46, 76, 55, 37, 253, 133, 49, 254, 171, 227, 97, 254,
+ 156, 211, 211, 217, 149, 219, 19, 187, 6, 250, 252, 248, 22, 250, 112,
+ 250, 109, 232, 243, 87, 250, 172, 227, 97, 250, 212, 215, 159, 245, 15,
+ 249, 130, 222, 104, 248, 22, 244, 147, 113, 3, 243, 177, 113, 6, 242, 41,
+ 251, 142, 6, 242, 41, 187, 6, 242, 41, 225, 169, 249, 130, 225, 169, 249,
+ 131, 110, 117, 225, 240, 113, 6, 72, 251, 142, 6, 72, 113, 6, 150, 113,
+ 3, 150, 233, 171, 54, 252, 60, 87, 187, 6, 204, 228, 52, 52, 219, 218,
+ 224, 12, 249, 101, 113, 6, 226, 229, 187, 6, 226, 229, 187, 6, 224, 240,
+ 113, 6, 149, 251, 142, 6, 149, 187, 6, 149, 225, 76, 218, 21, 223, 214,
+ 221, 53, 77, 217, 210, 52, 216, 210, 152, 52, 214, 217, 187, 6, 212, 152,
+ 227, 1, 52, 227, 87, 52, 235, 191, 227, 87, 52, 251, 142, 6, 212, 152,
+ 216, 58, 25, 3, 1, 235, 183, 234, 179, 52, 254, 16, 52, 113, 6, 253, 74,
+ 251, 142, 6, 250, 252, 245, 33, 87, 113, 3, 74, 113, 6, 74, 113, 6, 244,
+ 230, 216, 58, 6, 244, 230, 113, 6, 183, 113, 3, 75, 106, 87, 251, 206,
+ 87, 242, 178, 87, 248, 135, 87, 235, 229, 219, 216, 223, 89, 6, 224, 240,
+ 244, 150, 52, 187, 3, 225, 240, 187, 3, 243, 83, 187, 6, 243, 83, 187, 6,
+ 225, 240, 187, 230, 97, 218, 241, 216, 58, 35, 6, 243, 177, 216, 58, 35,
+ 6, 150, 223, 202, 35, 6, 150, 216, 58, 35, 6, 213, 105, 187, 32, 6, 249,
+ 3, 187, 32, 3, 249, 3, 187, 32, 3, 74, 187, 32, 3, 72, 187, 32, 3, 235,
+ 142, 225, 54, 232, 242, 216, 58, 254, 35, 226, 58, 52, 254, 88, 216, 58,
+ 3, 244, 230, 16, 31, 222, 167, 219, 216, 214, 97, 243, 228, 122, 221, 39,
+ 214, 97, 243, 228, 122, 229, 25, 214, 97, 243, 228, 122, 217, 194, 214,
+ 97, 243, 228, 122, 217, 121, 214, 97, 243, 228, 117, 217, 119, 214, 97,
+ 243, 228, 122, 244, 86, 214, 97, 243, 228, 117, 244, 85, 214, 97, 243,
+ 228, 133, 244, 85, 214, 97, 243, 228, 243, 237, 244, 85, 214, 97, 243,
+ 228, 122, 220, 43, 214, 97, 243, 228, 244, 50, 220, 41, 214, 97, 243,
+ 228, 122, 245, 145, 214, 97, 243, 228, 133, 245, 143, 214, 97, 243, 228,
+ 244, 50, 245, 143, 214, 97, 243, 228, 221, 43, 245, 143, 243, 228, 228,
+ 53, 116, 223, 100, 228, 54, 116, 223, 100, 228, 54, 109, 223, 100, 228,
+ 54, 166, 223, 100, 228, 54, 163, 223, 100, 228, 54, 180, 223, 100, 228,
+ 54, 189, 223, 100, 228, 54, 198, 223, 100, 228, 54, 195, 223, 100, 228,
+ 54, 200, 223, 100, 228, 54, 217, 200, 223, 100, 228, 54, 245, 124, 223,
+ 100, 228, 54, 216, 41, 223, 100, 228, 54, 244, 83, 223, 100, 228, 54,
+ 122, 240, 200, 223, 100, 228, 54, 244, 50, 240, 200, 223, 100, 228, 54,
+ 122, 217, 100, 3, 223, 100, 228, 54, 116, 3, 223, 100, 228, 54, 109, 3,
+ 223, 100, 228, 54, 166, 3, 223, 100, 228, 54, 163, 3, 223, 100, 228, 54,
+ 180, 3, 223, 100, 228, 54, 189, 3, 223, 100, 228, 54, 198, 3, 223, 100,
+ 228, 54, 195, 3, 223, 100, 228, 54, 200, 3, 223, 100, 228, 54, 217, 200,
+ 3, 223, 100, 228, 54, 245, 124, 3, 223, 100, 228, 54, 216, 41, 3, 223,
+ 100, 228, 54, 244, 83, 3, 223, 100, 228, 54, 122, 240, 200, 3, 223, 100,
+ 228, 54, 244, 50, 240, 200, 3, 223, 100, 228, 54, 122, 217, 100, 223,
+ 100, 228, 54, 122, 217, 101, 250, 253, 249, 3, 223, 100, 228, 54, 244,
+ 50, 217, 100, 223, 100, 228, 54, 217, 201, 217, 100, 223, 100, 228, 54,
+ 223, 202, 122, 240, 200, 7, 3, 1, 223, 202, 250, 252, 223, 100, 228, 54,
+ 220, 53, 233, 101, 17, 223, 100, 228, 54, 244, 84, 245, 182, 17, 223,
+ 100, 228, 54, 244, 84, 217, 100, 223, 100, 228, 54, 122, 240, 201, 217,
+ 100, 214, 97, 243, 228, 212, 80, 217, 119, 132, 68, 215, 124, 68, 95, 68,
+ 246, 58, 68, 42, 46, 68, 114, 119, 68, 228, 167, 213, 250, 68, 228, 167,
+ 245, 176, 68, 219, 215, 245, 176, 68, 219, 215, 213, 250, 68, 132, 76, 2,
+ 90, 95, 76, 2, 90, 132, 214, 20, 68, 95, 214, 20, 68, 132, 117, 241, 218,
+ 68, 215, 124, 117, 241, 218, 68, 95, 117, 241, 218, 68, 246, 58, 117,
+ 241, 218, 68, 132, 76, 2, 218, 27, 95, 76, 2, 218, 27, 132, 76, 243, 213,
+ 134, 215, 124, 76, 243, 213, 134, 95, 76, 243, 213, 134, 246, 58, 76,
+ 243, 213, 134, 114, 119, 76, 2, 252, 47, 132, 76, 2, 101, 95, 76, 2, 101,
+ 132, 76, 2, 232, 177, 95, 76, 2, 232, 177, 42, 46, 214, 20, 68, 42, 46,
+ 76, 2, 90, 246, 58, 212, 28, 68, 215, 124, 76, 2, 217, 30, 233, 61, 215,
+ 124, 76, 2, 217, 30, 223, 138, 246, 58, 76, 2, 217, 30, 233, 61, 246, 58,
+ 76, 2, 217, 30, 223, 138, 95, 76, 2, 249, 100, 246, 57, 246, 58, 76, 2,
+ 249, 100, 233, 61, 253, 255, 216, 227, 221, 73, 68, 249, 195, 216, 227,
+ 221, 73, 68, 228, 167, 213, 250, 76, 211, 211, 184, 134, 132, 76, 211,
+ 211, 252, 60, 110, 95, 76, 211, 211, 134, 253, 255, 227, 40, 249, 229,
+ 68, 249, 195, 227, 40, 249, 229, 68, 132, 241, 238, 2, 206, 215, 123,
+ 132, 241, 238, 2, 206, 246, 57, 215, 124, 241, 238, 2, 206, 223, 138,
+ 215, 124, 241, 238, 2, 206, 233, 61, 95, 241, 238, 2, 206, 215, 123, 95,
+ 241, 238, 2, 206, 246, 57, 246, 58, 241, 238, 2, 206, 223, 138, 246, 58,
+ 241, 238, 2, 206, 233, 61, 95, 76, 110, 132, 68, 215, 124, 76, 132, 65,
+ 246, 58, 68, 132, 76, 110, 95, 68, 132, 226, 197, 253, 162, 215, 124,
+ 226, 197, 253, 162, 95, 226, 197, 253, 162, 246, 58, 226, 197, 253, 162,
+ 132, 241, 238, 110, 95, 241, 237, 95, 241, 238, 110, 132, 241, 237, 132,
+ 51, 76, 2, 90, 42, 46, 51, 76, 2, 90, 95, 51, 76, 2, 90, 132, 51, 68,
+ 215, 124, 51, 68, 95, 51, 68, 246, 58, 51, 68, 42, 46, 51, 68, 114, 119,
+ 51, 68, 228, 167, 213, 250, 51, 68, 228, 167, 245, 176, 51, 68, 219, 215,
+ 245, 176, 51, 68, 219, 215, 213, 250, 51, 68, 132, 216, 169, 68, 95, 216,
+ 169, 68, 132, 219, 162, 68, 95, 219, 162, 68, 215, 124, 76, 2, 51, 90,
+ 246, 58, 76, 2, 51, 90, 132, 248, 100, 68, 215, 124, 248, 100, 68, 95,
+ 248, 100, 68, 246, 58, 248, 100, 68, 132, 76, 211, 211, 134, 95, 76, 211,
+ 211, 134, 132, 67, 68, 215, 124, 67, 68, 95, 67, 68, 246, 58, 67, 68,
+ 215, 124, 67, 76, 243, 213, 134, 215, 124, 67, 76, 227, 63, 226, 89, 215,
+ 124, 67, 76, 227, 63, 226, 90, 2, 199, 134, 215, 124, 67, 76, 227, 63,
+ 226, 90, 2, 71, 134, 215, 124, 67, 51, 68, 215, 124, 67, 51, 76, 227, 63,
+ 226, 89, 95, 67, 76, 243, 213, 214, 40, 228, 167, 213, 250, 76, 211, 211,
+ 249, 99, 219, 215, 245, 176, 76, 211, 211, 249, 99, 114, 119, 67, 68, 46,
+ 76, 2, 3, 249, 228, 246, 58, 76, 132, 65, 215, 124, 68, 133, 95, 253,
+ 162, 132, 76, 2, 71, 90, 95, 76, 2, 71, 90, 42, 46, 76, 2, 71, 90, 132,
+ 76, 2, 51, 71, 90, 95, 76, 2, 51, 71, 90, 42, 46, 76, 2, 51, 71, 90, 132,
+ 227, 38, 68, 95, 227, 38, 68, 42, 46, 227, 38, 68, 31, 254, 63, 249, 153,
+ 226, 125, 247, 185, 217, 140, 244, 250, 217, 140, 247, 92, 228, 163, 244,
+ 251, 245, 110, 221, 48, 235, 241, 230, 39, 245, 127, 227, 97, 228, 163,
+ 254, 33, 245, 127, 227, 97, 3, 245, 127, 227, 97, 249, 125, 253, 153,
+ 231, 126, 247, 92, 228, 163, 249, 127, 253, 153, 231, 126, 3, 249, 125,
+ 253, 153, 231, 126, 245, 101, 65, 225, 56, 230, 97, 225, 63, 230, 97,
+ 249, 104, 230, 97, 218, 241, 230, 251, 52, 230, 249, 52, 62, 225, 156,
+ 247, 121, 220, 23, 221, 49, 230, 250, 253, 133, 227, 33, 223, 131, 227,
+ 33, 251, 43, 227, 33, 41, 223, 95, 249, 50, 223, 95, 243, 230, 223, 95,
+ 225, 52, 108, 235, 231, 46, 254, 18, 254, 18, 231, 153, 254, 18, 219,
+ 187, 254, 18, 247, 123, 247, 92, 228, 163, 247, 126, 226, 136, 108, 228,
+ 163, 226, 136, 108, 232, 199, 254, 27, 232, 199, 227, 24, 235, 195, 215,
+ 146, 235, 208, 51, 235, 208, 216, 169, 235, 208, 249, 121, 235, 208, 218,
+ 213, 235, 208, 214, 110, 235, 208, 249, 195, 235, 208, 249, 195, 249,
+ 121, 235, 208, 253, 255, 249, 121, 235, 208, 217, 139, 251, 243, 224, 29,
+ 225, 53, 62, 230, 250, 245, 0, 243, 22, 225, 53, 241, 43, 217, 43, 227,
+ 33, 223, 202, 217, 42, 235, 191, 233, 89, 197, 220, 83, 214, 19, 213,
+ 188, 225, 63, 228, 163, 217, 42, 230, 251, 217, 42, 253, 126, 123, 108,
+ 228, 163, 253, 126, 123, 108, 253, 218, 123, 108, 253, 218, 251, 17, 228,
+ 163, 254, 165, 123, 108, 229, 181, 253, 218, 228, 170, 254, 165, 123,
+ 108, 254, 57, 123, 108, 228, 163, 254, 57, 123, 108, 254, 57, 123, 167,
+ 123, 108, 216, 169, 217, 42, 254, 64, 123, 108, 245, 57, 108, 243, 21,
+ 245, 57, 108, 247, 186, 251, 200, 253, 220, 217, 149, 232, 250, 243, 21,
+ 123, 108, 253, 218, 123, 211, 211, 167, 217, 149, 236, 10, 227, 97, 236,
+ 10, 65, 167, 253, 218, 123, 108, 249, 165, 245, 60, 245, 61, 249, 164,
+ 223, 131, 235, 252, 123, 108, 223, 131, 123, 108, 249, 93, 108, 245, 32,
+ 245, 59, 108, 219, 96, 245, 60, 248, 6, 123, 108, 123, 211, 211, 251, 7,
+ 248, 23, 231, 153, 251, 6, 224, 156, 123, 108, 228, 163, 123, 108, 240,
+ 97, 108, 228, 163, 240, 97, 108, 219, 49, 245, 57, 108, 233, 39, 167,
+ 123, 108, 242, 107, 167, 123, 108, 233, 39, 110, 123, 108, 242, 107, 110,
+ 123, 108, 233, 39, 251, 17, 228, 163, 123, 108, 242, 107, 251, 17, 228,
+ 163, 123, 108, 230, 167, 233, 38, 230, 167, 242, 106, 251, 200, 228, 163,
+ 245, 57, 108, 228, 163, 233, 38, 228, 163, 242, 106, 229, 181, 233, 39,
+ 228, 170, 123, 108, 229, 181, 242, 107, 228, 170, 123, 108, 233, 39, 167,
+ 245, 57, 108, 242, 107, 167, 245, 57, 108, 229, 181, 233, 39, 228, 170,
+ 245, 57, 108, 229, 181, 242, 107, 228, 170, 245, 57, 108, 233, 39, 167,
+ 242, 106, 242, 107, 167, 233, 38, 229, 181, 233, 39, 228, 170, 242, 106,
+ 229, 181, 242, 107, 228, 170, 233, 38, 225, 82, 219, 0, 225, 83, 167,
+ 123, 108, 219, 1, 167, 123, 108, 225, 83, 167, 245, 57, 108, 219, 1, 167,
+ 245, 57, 108, 247, 92, 228, 163, 225, 85, 247, 92, 228, 163, 219, 2, 219,
+ 9, 227, 97, 218, 222, 227, 97, 228, 163, 118, 219, 9, 227, 97, 228, 163,
+ 118, 218, 222, 227, 97, 219, 9, 65, 167, 123, 108, 218, 222, 65, 167,
+ 123, 108, 229, 181, 118, 219, 9, 65, 228, 170, 123, 108, 229, 181, 118,
+ 218, 222, 65, 228, 170, 123, 108, 219, 9, 65, 2, 228, 163, 123, 108, 218,
+ 222, 65, 2, 228, 163, 123, 108, 230, 151, 230, 152, 230, 153, 230, 152,
+ 215, 146, 41, 236, 10, 227, 97, 41, 227, 17, 227, 97, 41, 236, 10, 65,
+ 167, 123, 108, 41, 227, 17, 65, 167, 123, 108, 41, 250, 183, 41, 249, 43,
+ 36, 225, 156, 36, 230, 250, 36, 217, 38, 36, 247, 121, 220, 23, 36, 62,
+ 227, 33, 36, 223, 131, 227, 33, 36, 253, 133, 227, 33, 36, 245, 60, 36,
+ 248, 101, 91, 225, 156, 91, 230, 250, 91, 217, 38, 91, 62, 227, 33, 46,
+ 218, 36, 42, 218, 36, 119, 218, 36, 114, 218, 36, 253, 136, 230, 226,
+ 216, 149, 243, 250, 216, 169, 71, 252, 60, 46, 216, 57, 51, 71, 252, 60,
+ 51, 46, 216, 57, 247, 92, 228, 163, 225, 48, 228, 163, 216, 149, 247, 92,
+ 228, 163, 243, 251, 229, 183, 51, 71, 252, 60, 51, 46, 216, 57, 225, 83,
+ 215, 154, 223, 241, 219, 1, 215, 154, 223, 241, 228, 168, 219, 22, 227,
+ 97, 249, 125, 253, 153, 228, 168, 219, 21, 228, 168, 219, 22, 65, 167,
+ 123, 108, 249, 125, 253, 153, 228, 168, 219, 22, 167, 123, 108, 227, 17,
+ 227, 97, 236, 10, 227, 97, 230, 157, 241, 185, 249, 136, 231, 200, 235,
+ 205, 213, 133, 230, 22, 228, 169, 46, 254, 19, 2, 253, 195, 46, 216, 183,
+ 230, 97, 232, 199, 254, 27, 230, 97, 232, 199, 227, 24, 230, 97, 235,
+ 195, 230, 97, 215, 146, 247, 201, 227, 33, 62, 227, 33, 219, 96, 227, 33,
+ 247, 121, 217, 38, 251, 90, 42, 228, 168, 244, 149, 221, 69, 225, 63, 46,
+ 228, 168, 244, 149, 221, 69, 225, 63, 42, 221, 69, 225, 63, 46, 221, 69,
+ 225, 63, 223, 202, 217, 43, 245, 60, 249, 40, 232, 199, 227, 24, 249, 40,
+ 232, 199, 254, 27, 51, 219, 8, 51, 218, 221, 51, 235, 195, 51, 215, 146,
+ 225, 179, 123, 24, 226, 136, 108, 233, 39, 2, 247, 74, 242, 107, 2, 247,
+ 74, 214, 164, 230, 167, 233, 38, 214, 164, 230, 167, 242, 106, 233, 39,
+ 123, 211, 211, 167, 242, 106, 242, 107, 123, 211, 211, 167, 233, 38, 123,
+ 211, 211, 167, 233, 38, 123, 211, 211, 167, 242, 106, 123, 211, 211, 167,
+ 225, 82, 123, 211, 211, 167, 219, 0, 247, 92, 228, 163, 225, 86, 167,
+ 245, 62, 247, 92, 228, 163, 219, 3, 167, 245, 62, 228, 163, 41, 236, 10,
+ 65, 167, 123, 108, 228, 163, 41, 227, 17, 65, 167, 123, 108, 41, 236, 10,
+ 65, 167, 228, 163, 123, 108, 41, 227, 17, 65, 167, 228, 163, 123, 108,
+ 233, 39, 251, 17, 228, 163, 245, 57, 108, 242, 107, 251, 17, 228, 163,
+ 245, 57, 108, 225, 83, 251, 17, 228, 163, 245, 57, 108, 219, 1, 251, 17,
+ 228, 163, 245, 57, 108, 228, 163, 228, 168, 219, 22, 227, 97, 247, 92,
+ 228, 163, 249, 127, 253, 153, 228, 168, 219, 21, 228, 163, 228, 168, 219,
+ 22, 65, 167, 123, 108, 247, 92, 228, 163, 249, 127, 253, 153, 228, 168,
+ 219, 22, 167, 245, 62, 71, 245, 120, 231, 35, 199, 245, 120, 114, 46,
+ 247, 207, 245, 120, 119, 46, 247, 207, 245, 120, 245, 127, 65, 2, 184,
+ 199, 90, 245, 127, 65, 2, 71, 252, 60, 253, 123, 245, 101, 65, 199, 90,
+ 3, 245, 127, 65, 2, 71, 252, 60, 253, 123, 245, 101, 65, 199, 90, 245,
+ 127, 65, 2, 62, 49, 245, 127, 65, 2, 226, 247, 3, 245, 127, 65, 2, 226,
+ 247, 245, 127, 65, 2, 215, 153, 245, 127, 65, 2, 117, 199, 219, 32, 249,
+ 125, 2, 184, 199, 90, 249, 125, 2, 71, 252, 60, 253, 123, 245, 101, 65,
+ 199, 90, 3, 249, 125, 2, 71, 252, 60, 253, 123, 245, 101, 65, 199, 90,
+ 249, 125, 2, 226, 247, 3, 249, 125, 2, 226, 247, 212, 153, 174, 252, 91,
+ 231, 125, 247, 202, 52, 245, 129, 68, 240, 221, 114, 253, 164, 119, 253,
+ 164, 225, 59, 226, 41, 214, 16, 232, 242, 42, 250, 115, 46, 250, 115, 42,
+ 244, 26, 46, 244, 26, 251, 101, 46, 249, 72, 251, 101, 42, 249, 72, 216,
+ 227, 46, 249, 72, 216, 227, 42, 249, 72, 223, 202, 228, 163, 52, 41, 232,
+ 159, 253, 195, 222, 83, 222, 90, 217, 210, 224, 13, 225, 121, 235, 235,
+ 214, 145, 219, 166, 225, 173, 65, 235, 204, 52, 216, 58, 228, 163, 52,
+ 214, 26, 240, 223, 216, 227, 42, 249, 99, 216, 227, 46, 249, 99, 251,
+ 101, 42, 249, 99, 251, 101, 46, 249, 99, 216, 227, 151, 235, 208, 251,
+ 101, 151, 235, 208, 243, 210, 220, 3, 114, 253, 165, 251, 201, 117, 199,
+ 252, 49, 227, 26, 234, 144, 245, 53, 211, 211, 217, 149, 223, 148, 213,
+ 167, 235, 252, 118, 224, 10, 251, 89, 234, 143, 233, 66, 254, 19, 125,
+ 223, 144, 254, 19, 125, 245, 53, 211, 211, 217, 149, 233, 70, 251, 212,
+ 223, 130, 249, 13, 254, 64, 253, 172, 218, 126, 216, 217, 223, 34, 247,
+ 167, 227, 18, 249, 138, 218, 3, 220, 14, 249, 90, 249, 89, 194, 196, 16,
+ 240, 143, 194, 196, 16, 219, 160, 224, 172, 194, 196, 16, 224, 173, 245,
+ 62, 194, 196, 16, 224, 173, 247, 126, 194, 196, 16, 224, 173, 247, 200,
+ 194, 196, 16, 224, 173, 235, 59, 194, 196, 16, 224, 173, 249, 228, 194,
+ 196, 16, 249, 229, 219, 75, 194, 196, 16, 249, 229, 235, 59, 194, 196,
+ 16, 220, 24, 134, 194, 196, 16, 252, 98, 134, 194, 196, 16, 224, 173,
+ 220, 23, 194, 196, 16, 224, 173, 252, 97, 194, 196, 16, 224, 173, 233,
+ 38, 194, 196, 16, 224, 173, 242, 106, 194, 196, 16, 132, 214, 251, 194,
+ 196, 16, 95, 214, 251, 194, 196, 16, 224, 173, 132, 68, 194, 196, 16,
+ 224, 173, 95, 68, 194, 196, 16, 249, 229, 252, 97, 194, 196, 16, 119,
+ 218, 37, 215, 153, 194, 196, 16, 248, 6, 219, 75, 194, 196, 16, 224, 173,
+ 119, 250, 170, 194, 196, 16, 224, 173, 248, 5, 194, 196, 16, 119, 218,
+ 37, 235, 59, 194, 196, 16, 215, 124, 214, 251, 194, 196, 16, 224, 173,
+ 215, 124, 68, 194, 196, 16, 114, 218, 37, 226, 247, 194, 196, 16, 248,
+ 17, 219, 75, 194, 196, 16, 224, 173, 114, 250, 170, 194, 196, 16, 224,
+ 173, 248, 16, 194, 196, 16, 114, 218, 37, 235, 59, 194, 196, 16, 246, 58,
+ 214, 251, 194, 196, 16, 224, 173, 246, 58, 68, 194, 196, 16, 224, 142,
+ 215, 153, 194, 196, 16, 248, 6, 215, 153, 194, 196, 16, 247, 201, 215,
+ 153, 194, 196, 16, 235, 60, 215, 153, 194, 196, 16, 249, 229, 215, 153,
+ 194, 196, 16, 114, 220, 185, 235, 59, 194, 196, 16, 224, 142, 224, 172,
+ 194, 196, 16, 249, 229, 219, 95, 194, 196, 16, 224, 173, 249, 164, 194,
+ 196, 16, 114, 218, 37, 247, 209, 194, 196, 16, 248, 17, 247, 209, 194,
+ 196, 16, 219, 96, 247, 209, 194, 196, 16, 235, 60, 247, 209, 194, 196,
+ 16, 249, 229, 247, 209, 194, 196, 16, 119, 220, 185, 219, 75, 194, 196,
+ 16, 42, 220, 185, 219, 75, 194, 196, 16, 217, 43, 247, 209, 194, 196, 16,
+ 242, 107, 247, 209, 194, 196, 16, 249, 158, 134, 194, 196, 16, 248, 17,
+ 217, 42, 194, 196, 16, 212, 27, 194, 196, 16, 219, 76, 217, 42, 194, 196,
+ 16, 221, 71, 215, 153, 194, 196, 16, 224, 173, 228, 163, 245, 62, 194,
+ 196, 16, 224, 173, 224, 157, 194, 196, 16, 119, 250, 171, 217, 42, 194,
+ 196, 16, 114, 250, 171, 217, 42, 194, 196, 16, 235, 183, 194, 196, 16,
+ 223, 190, 194, 196, 16, 227, 67, 194, 196, 16, 254, 53, 215, 153, 194,
+ 196, 16, 245, 64, 215, 153, 194, 196, 16, 235, 184, 215, 153, 194, 196,
+ 16, 227, 68, 215, 153, 194, 196, 16, 254, 52, 228, 163, 250, 66, 77, 46,
+ 254, 19, 2, 246, 58, 212, 28, 68, 220, 159, 227, 40, 251, 89, 251, 222,
+ 87, 71, 232, 243, 2, 231, 37, 247, 74, 235, 213, 87, 249, 122, 215, 151,
+ 87, 247, 141, 215, 151, 87, 245, 112, 87, 249, 149, 87, 67, 41, 2, 250,
+ 109, 71, 232, 242, 245, 89, 87, 254, 48, 234, 145, 87, 241, 197, 87, 36,
+ 199, 252, 60, 2, 228, 161, 36, 216, 184, 246, 60, 251, 63, 249, 229, 2,
+ 228, 165, 68, 215, 149, 87, 230, 207, 87, 240, 156, 87, 227, 39, 242, 40,
+ 87, 227, 39, 233, 169, 87, 226, 117, 87, 226, 116, 87, 247, 149, 249, 38,
+ 16, 243, 245, 109, 219, 234, 87, 194, 196, 16, 224, 172, 248, 34, 221,
+ 58, 234, 145, 87, 225, 73, 226, 200, 229, 164, 226, 200, 225, 69, 222,
+ 108, 87, 249, 210, 222, 108, 87, 42, 226, 132, 215, 131, 101, 42, 226,
+ 132, 244, 245, 42, 226, 132, 232, 163, 101, 46, 226, 132, 215, 131, 101,
+ 46, 226, 132, 244, 245, 46, 226, 132, 232, 163, 101, 42, 41, 251, 85,
+ 215, 131, 249, 99, 42, 41, 251, 85, 244, 245, 42, 41, 251, 85, 232, 163,
+ 249, 99, 46, 41, 251, 85, 215, 131, 249, 99, 46, 41, 251, 85, 244, 245,
+ 46, 41, 251, 85, 232, 163, 249, 99, 42, 249, 40, 251, 85, 215, 131, 101,
+ 42, 249, 40, 251, 85, 231, 37, 225, 233, 42, 249, 40, 251, 85, 232, 163,
+ 101, 249, 40, 251, 85, 244, 245, 46, 249, 40, 251, 85, 215, 131, 101, 46,
+ 249, 40, 251, 85, 231, 37, 225, 233, 46, 249, 40, 251, 85, 232, 163, 101,
+ 235, 209, 244, 245, 199, 232, 243, 244, 245, 215, 131, 42, 167, 232, 163,
+ 46, 249, 40, 251, 85, 222, 91, 215, 131, 46, 167, 232, 163, 42, 249, 40,
+ 251, 85, 222, 91, 218, 242, 216, 226, 218, 242, 251, 100, 216, 227, 41,
+ 125, 251, 101, 41, 125, 251, 101, 41, 251, 85, 110, 216, 227, 41, 125,
+ 34, 16, 251, 100, 42, 71, 92, 232, 242, 46, 71, 92, 232, 242, 199, 222,
+ 123, 232, 241, 199, 222, 123, 232, 240, 199, 222, 123, 232, 239, 199,
+ 222, 123, 232, 238, 247, 253, 16, 177, 71, 24, 216, 227, 223, 148, 247,
+ 253, 16, 177, 71, 24, 251, 101, 223, 148, 247, 253, 16, 177, 71, 2, 249,
+ 228, 247, 253, 16, 177, 119, 24, 199, 2, 249, 228, 247, 253, 16, 177,
+ 114, 24, 199, 2, 249, 228, 247, 253, 16, 177, 71, 2, 216, 183, 247, 253,
+ 16, 177, 119, 24, 199, 2, 216, 183, 247, 253, 16, 177, 114, 24, 199, 2,
+ 216, 183, 247, 253, 16, 177, 71, 24, 214, 19, 247, 253, 16, 177, 119, 24,
+ 199, 2, 214, 19, 247, 253, 16, 177, 114, 24, 199, 2, 214, 19, 247, 253,
+ 16, 177, 119, 24, 241, 31, 247, 253, 16, 177, 114, 24, 241, 31, 247, 253,
+ 16, 177, 71, 24, 216, 227, 233, 70, 247, 253, 16, 177, 71, 24, 251, 101,
+ 233, 70, 41, 244, 1, 223, 206, 87, 245, 139, 87, 71, 232, 243, 244, 245,
+ 231, 100, 251, 74, 231, 100, 184, 110, 220, 174, 231, 100, 220, 175, 110,
+ 232, 190, 231, 100, 184, 110, 117, 220, 161, 231, 100, 117, 220, 162,
+ 110, 232, 190, 231, 100, 117, 220, 162, 235, 67, 231, 100, 216, 166, 231,
+ 100, 217, 176, 231, 100, 226, 63, 245, 180, 242, 100, 243, 191, 216, 227,
+ 226, 131, 251, 101, 226, 131, 216, 227, 249, 40, 125, 251, 101, 249, 40,
+ 125, 216, 227, 216, 219, 220, 233, 125, 251, 101, 216, 219, 220, 233,
+ 125, 67, 216, 197, 251, 212, 223, 131, 2, 249, 228, 219, 60, 244, 33,
+ 254, 177, 249, 37, 245, 128, 235, 195, 248, 34, 244, 247, 87, 83, 223,
+ 144, 51, 216, 183, 83, 233, 66, 51, 216, 183, 83, 215, 133, 51, 216, 183,
+ 83, 246, 59, 51, 216, 183, 83, 223, 144, 51, 216, 184, 2, 71, 134, 83,
+ 233, 66, 51, 216, 184, 2, 71, 134, 83, 223, 144, 216, 184, 2, 51, 71,
+ 134, 254, 81, 249, 196, 219, 66, 217, 39, 249, 196, 240, 224, 2, 244, 19,
+ 222, 157, 16, 31, 228, 58, 16, 31, 219, 91, 65, 241, 217, 16, 31, 219,
+ 91, 65, 217, 165, 16, 31, 245, 101, 65, 217, 165, 16, 31, 245, 101, 65,
+ 216, 200, 16, 31, 245, 91, 16, 31, 254, 168, 16, 31, 251, 221, 16, 31,
+ 252, 96, 16, 31, 199, 218, 38, 16, 31, 232, 243, 244, 114, 16, 31, 71,
+ 218, 38, 16, 31, 243, 245, 244, 114, 16, 31, 250, 162, 223, 205, 16, 31,
+ 220, 208, 226, 254, 16, 31, 220, 208, 235, 251, 16, 31, 248, 97, 232,
+ 233, 245, 42, 16, 31, 247, 238, 249, 117, 116, 16, 31, 247, 238, 249,
+ 117, 109, 16, 31, 247, 238, 249, 117, 166, 16, 31, 247, 238, 249, 117,
+ 163, 16, 31, 146, 254, 168, 16, 31, 218, 123, 236, 57, 16, 31, 245, 101,
+ 65, 216, 201, 251, 136, 16, 31, 250, 193, 16, 31, 245, 101, 65, 231, 146,
+ 16, 31, 219, 6, 16, 31, 245, 42, 16, 31, 244, 76, 221, 57, 16, 31, 242,
+ 99, 221, 57, 16, 31, 224, 14, 221, 57, 16, 31, 215, 145, 221, 57, 16, 31,
+ 219, 206, 16, 31, 248, 14, 251, 139, 87, 227, 40, 251, 89, 16, 31, 229,
+ 167, 16, 31, 248, 15, 243, 245, 109, 16, 31, 219, 7, 243, 245, 109, 227,
+ 105, 101, 227, 105, 250, 87, 227, 105, 243, 248, 227, 105, 235, 191, 243,
+ 248, 227, 105, 251, 219, 251, 53, 227, 105, 251, 96, 217, 65, 227, 105,
+ 251, 82, 252, 65, 240, 96, 227, 105, 254, 36, 65, 250, 65, 227, 105, 248,
+ 101, 227, 105, 249, 29, 254, 171, 228, 56, 227, 105, 51, 252, 97, 36, 21,
+ 116, 36, 21, 109, 36, 21, 166, 36, 21, 163, 36, 21, 180, 36, 21, 189, 36,
+ 21, 198, 36, 21, 195, 36, 21, 200, 36, 50, 217, 200, 36, 50, 245, 124,
+ 36, 50, 216, 41, 36, 50, 217, 117, 36, 50, 243, 231, 36, 50, 244, 87, 36,
+ 50, 220, 47, 36, 50, 221, 40, 36, 50, 245, 147, 36, 50, 229, 28, 36, 50,
+ 216, 38, 86, 21, 116, 86, 21, 109, 86, 21, 166, 86, 21, 163, 86, 21, 180,
+ 86, 21, 189, 86, 21, 198, 86, 21, 195, 86, 21, 200, 86, 50, 217, 200, 86,
+ 50, 245, 124, 86, 50, 216, 41, 86, 50, 217, 117, 86, 50, 243, 231, 86,
+ 50, 244, 87, 86, 50, 220, 47, 86, 50, 221, 40, 86, 50, 245, 147, 86, 50,
+ 229, 28, 86, 50, 216, 38, 21, 122, 243, 200, 219, 69, 21, 117, 243, 200,
+ 219, 69, 21, 133, 243, 200, 219, 69, 21, 243, 237, 243, 200, 219, 69, 21,
+ 244, 50, 243, 200, 219, 69, 21, 220, 53, 243, 200, 219, 69, 21, 221, 43,
+ 243, 200, 219, 69, 21, 245, 150, 243, 200, 219, 69, 21, 229, 31, 243,
+ 200, 219, 69, 50, 217, 201, 243, 200, 219, 69, 50, 245, 125, 243, 200,
+ 219, 69, 50, 216, 42, 243, 200, 219, 69, 50, 217, 118, 243, 200, 219, 69,
+ 50, 243, 232, 243, 200, 219, 69, 50, 244, 88, 243, 200, 219, 69, 50, 220,
+ 48, 243, 200, 219, 69, 50, 221, 41, 243, 200, 219, 69, 50, 245, 148, 243,
+ 200, 219, 69, 50, 229, 29, 243, 200, 219, 69, 50, 216, 39, 243, 200, 219,
+ 69, 86, 7, 3, 1, 61, 86, 7, 3, 1, 253, 74, 86, 7, 3, 1, 250, 252, 86, 7,
+ 3, 1, 249, 3, 86, 7, 3, 1, 74, 86, 7, 3, 1, 244, 230, 86, 7, 3, 1, 243,
+ 177, 86, 7, 3, 1, 242, 41, 86, 7, 3, 1, 72, 86, 7, 3, 1, 235, 142, 86, 7,
+ 3, 1, 235, 27, 86, 7, 3, 1, 150, 86, 7, 3, 1, 183, 86, 7, 3, 1, 204, 86,
+ 7, 3, 1, 75, 86, 7, 3, 1, 226, 229, 86, 7, 3, 1, 224, 240, 86, 7, 3, 1,
+ 149, 86, 7, 3, 1, 197, 86, 7, 3, 1, 218, 99, 86, 7, 3, 1, 69, 86, 7, 3,
+ 1, 215, 79, 86, 7, 3, 1, 214, 82, 86, 7, 3, 1, 213, 166, 86, 7, 3, 1,
+ 213, 105, 86, 7, 3, 1, 212, 152, 36, 7, 6, 1, 61, 36, 7, 6, 1, 253, 74,
+ 36, 7, 6, 1, 250, 252, 36, 7, 6, 1, 249, 3, 36, 7, 6, 1, 74, 36, 7, 6, 1,
+ 244, 230, 36, 7, 6, 1, 243, 177, 36, 7, 6, 1, 242, 41, 36, 7, 6, 1, 72,
+ 36, 7, 6, 1, 235, 142, 36, 7, 6, 1, 235, 27, 36, 7, 6, 1, 150, 36, 7, 6,
+ 1, 183, 36, 7, 6, 1, 204, 36, 7, 6, 1, 75, 36, 7, 6, 1, 226, 229, 36, 7,
+ 6, 1, 224, 240, 36, 7, 6, 1, 149, 36, 7, 6, 1, 197, 36, 7, 6, 1, 218, 99,
+ 36, 7, 6, 1, 69, 36, 7, 6, 1, 215, 79, 36, 7, 6, 1, 214, 82, 36, 7, 6, 1,
+ 213, 166, 36, 7, 6, 1, 213, 105, 36, 7, 6, 1, 212, 152, 36, 7, 3, 1, 61,
+ 36, 7, 3, 1, 253, 74, 36, 7, 3, 1, 250, 252, 36, 7, 3, 1, 249, 3, 36, 7,
+ 3, 1, 74, 36, 7, 3, 1, 244, 230, 36, 7, 3, 1, 243, 177, 36, 7, 3, 1, 242,
+ 41, 36, 7, 3, 1, 72, 36, 7, 3, 1, 235, 142, 36, 7, 3, 1, 235, 27, 36, 7,
+ 3, 1, 150, 36, 7, 3, 1, 183, 36, 7, 3, 1, 204, 36, 7, 3, 1, 75, 36, 7, 3,
+ 1, 226, 229, 36, 7, 3, 1, 224, 240, 36, 7, 3, 1, 149, 36, 7, 3, 1, 197,
+ 36, 7, 3, 1, 218, 99, 36, 7, 3, 1, 69, 36, 7, 3, 1, 215, 79, 36, 7, 3, 1,
+ 214, 82, 36, 7, 3, 1, 213, 166, 36, 7, 3, 1, 213, 105, 36, 7, 3, 1, 212,
+ 152, 36, 21, 212, 79, 146, 36, 50, 245, 124, 146, 36, 50, 216, 41, 146,
+ 36, 50, 217, 117, 146, 36, 50, 243, 231, 146, 36, 50, 244, 87, 146, 36,
+ 50, 220, 47, 146, 36, 50, 221, 40, 146, 36, 50, 245, 147, 146, 36, 50,
+ 229, 28, 146, 36, 50, 216, 38, 51, 36, 21, 116, 51, 36, 21, 109, 51, 36,
+ 21, 166, 51, 36, 21, 163, 51, 36, 21, 180, 51, 36, 21, 189, 51, 36, 21,
+ 198, 51, 36, 21, 195, 51, 36, 21, 200, 51, 36, 50, 217, 200, 146, 36, 21,
+ 212, 79, 92, 96, 177, 241, 31, 92, 96, 107, 241, 31, 92, 96, 177, 214,
+ 216, 92, 96, 107, 214, 216, 92, 96, 177, 216, 169, 248, 102, 241, 31, 92,
+ 96, 107, 216, 169, 248, 102, 241, 31, 92, 96, 177, 216, 169, 248, 102,
+ 214, 216, 92, 96, 107, 216, 169, 248, 102, 214, 216, 92, 96, 177, 224,
+ 169, 248, 102, 241, 31, 92, 96, 107, 224, 169, 248, 102, 241, 31, 92, 96,
+ 177, 224, 169, 248, 102, 214, 216, 92, 96, 107, 224, 169, 248, 102, 214,
+ 216, 92, 96, 177, 119, 24, 223, 148, 92, 96, 119, 177, 24, 46, 241, 205,
+ 92, 96, 119, 107, 24, 46, 233, 2, 92, 96, 107, 119, 24, 223, 148, 92, 96,
+ 177, 119, 24, 233, 70, 92, 96, 119, 177, 24, 42, 241, 205, 92, 96, 119,
+ 107, 24, 42, 233, 2, 92, 96, 107, 119, 24, 233, 70, 92, 96, 177, 114, 24,
+ 223, 148, 92, 96, 114, 177, 24, 46, 241, 205, 92, 96, 114, 107, 24, 46,
+ 233, 2, 92, 96, 107, 114, 24, 223, 148, 92, 96, 177, 114, 24, 233, 70,
+ 92, 96, 114, 177, 24, 42, 241, 205, 92, 96, 114, 107, 24, 42, 233, 2, 92,
+ 96, 107, 114, 24, 233, 70, 92, 96, 177, 71, 24, 223, 148, 92, 96, 71,
+ 177, 24, 46, 241, 205, 92, 96, 114, 107, 24, 46, 119, 233, 2, 92, 96,
+ 119, 107, 24, 46, 114, 233, 2, 92, 96, 71, 107, 24, 46, 233, 2, 92, 96,
+ 119, 177, 24, 46, 114, 241, 205, 92, 96, 114, 177, 24, 46, 119, 241, 205,
+ 92, 96, 107, 71, 24, 223, 148, 92, 96, 177, 71, 24, 233, 70, 92, 96, 71,
+ 177, 24, 42, 241, 205, 92, 96, 114, 107, 24, 42, 119, 233, 2, 92, 96,
+ 119, 107, 24, 42, 114, 233, 2, 92, 96, 71, 107, 24, 42, 233, 2, 92, 96,
+ 119, 177, 24, 42, 114, 241, 205, 92, 96, 114, 177, 24, 42, 119, 241, 205,
+ 92, 96, 107, 71, 24, 233, 70, 92, 96, 177, 119, 24, 241, 31, 92, 96, 42,
+ 107, 24, 46, 119, 233, 2, 92, 96, 46, 107, 24, 42, 119, 233, 2, 92, 96,
+ 119, 177, 24, 199, 241, 205, 92, 96, 119, 107, 24, 199, 233, 2, 92, 96,
+ 46, 177, 24, 42, 119, 241, 205, 92, 96, 42, 177, 24, 46, 119, 241, 205,
+ 92, 96, 107, 119, 24, 241, 31, 92, 96, 177, 114, 24, 241, 31, 92, 96, 42,
+ 107, 24, 46, 114, 233, 2, 92, 96, 46, 107, 24, 42, 114, 233, 2, 92, 96,
+ 114, 177, 24, 199, 241, 205, 92, 96, 114, 107, 24, 199, 233, 2, 92, 96,
+ 46, 177, 24, 42, 114, 241, 205, 92, 96, 42, 177, 24, 46, 114, 241, 205,
+ 92, 96, 107, 114, 24, 241, 31, 92, 96, 177, 71, 24, 241, 31, 92, 96, 42,
+ 107, 24, 46, 71, 233, 2, 92, 96, 46, 107, 24, 42, 71, 233, 2, 92, 96, 71,
+ 177, 24, 199, 241, 205, 92, 96, 114, 107, 24, 119, 199, 233, 2, 92, 96,
+ 119, 107, 24, 114, 199, 233, 2, 92, 96, 71, 107, 24, 199, 233, 2, 92, 96,
+ 42, 114, 107, 24, 46, 119, 233, 2, 92, 96, 46, 114, 107, 24, 42, 119,
+ 233, 2, 92, 96, 42, 119, 107, 24, 46, 114, 233, 2, 92, 96, 46, 119, 107,
+ 24, 42, 114, 233, 2, 92, 96, 119, 177, 24, 114, 199, 241, 205, 92, 96,
+ 114, 177, 24, 119, 199, 241, 205, 92, 96, 46, 177, 24, 42, 71, 241, 205,
+ 92, 96, 42, 177, 24, 46, 71, 241, 205, 92, 96, 107, 71, 24, 241, 31, 92,
+ 96, 177, 51, 248, 102, 241, 31, 92, 96, 107, 51, 248, 102, 241, 31, 92,
+ 96, 177, 51, 248, 102, 214, 216, 92, 96, 107, 51, 248, 102, 214, 216, 92,
+ 96, 51, 241, 31, 92, 96, 51, 214, 216, 92, 96, 119, 220, 81, 24, 46, 246,
+ 67, 92, 96, 119, 51, 24, 46, 220, 80, 92, 96, 51, 119, 24, 223, 148, 92,
+ 96, 119, 220, 81, 24, 42, 246, 67, 92, 96, 119, 51, 24, 42, 220, 80, 92,
+ 96, 51, 119, 24, 233, 70, 92, 96, 114, 220, 81, 24, 46, 246, 67, 92, 96,
+ 114, 51, 24, 46, 220, 80, 92, 96, 51, 114, 24, 223, 148, 92, 96, 114,
+ 220, 81, 24, 42, 246, 67, 92, 96, 114, 51, 24, 42, 220, 80, 92, 96, 51,
+ 114, 24, 233, 70, 92, 96, 71, 220, 81, 24, 46, 246, 67, 92, 96, 71, 51,
+ 24, 46, 220, 80, 92, 96, 51, 71, 24, 223, 148, 92, 96, 71, 220, 81, 24,
+ 42, 246, 67, 92, 96, 71, 51, 24, 42, 220, 80, 92, 96, 51, 71, 24, 233,
+ 70, 92, 96, 119, 220, 81, 24, 199, 246, 67, 92, 96, 119, 51, 24, 199,
+ 220, 80, 92, 96, 51, 119, 24, 241, 31, 92, 96, 114, 220, 81, 24, 199,
+ 246, 67, 92, 96, 114, 51, 24, 199, 220, 80, 92, 96, 51, 114, 24, 241, 31,
+ 92, 96, 71, 220, 81, 24, 199, 246, 67, 92, 96, 71, 51, 24, 199, 220, 80,
+ 92, 96, 51, 71, 24, 241, 31, 92, 96, 177, 253, 196, 119, 24, 223, 148,
+ 92, 96, 177, 253, 196, 119, 24, 233, 70, 92, 96, 177, 253, 196, 114, 24,
+ 233, 70, 92, 96, 177, 253, 196, 114, 24, 223, 148, 92, 96, 177, 247, 207,
+ 215, 131, 46, 211, 211, 232, 163, 233, 70, 92, 96, 177, 247, 207, 215,
+ 131, 42, 211, 211, 232, 163, 223, 148, 92, 96, 177, 247, 207, 249, 70,
+ 92, 96, 177, 233, 70, 92, 96, 177, 215, 134, 92, 96, 177, 223, 148, 92,
+ 96, 177, 246, 60, 92, 96, 107, 233, 70, 92, 96, 107, 215, 134, 92, 96,
+ 107, 223, 148, 92, 96, 107, 246, 60, 92, 96, 177, 42, 24, 107, 223, 148,
+ 92, 96, 177, 114, 24, 107, 246, 60, 92, 96, 107, 42, 24, 177, 223, 148,
+ 92, 96, 107, 114, 24, 177, 246, 60, 215, 131, 151, 251, 136, 232, 163,
+ 122, 245, 146, 251, 136, 232, 163, 122, 224, 167, 251, 136, 232, 163,
+ 133, 245, 144, 251, 136, 232, 163, 151, 251, 136, 232, 163, 244, 50, 245,
+ 144, 251, 136, 232, 163, 133, 224, 165, 251, 136, 232, 163, 221, 43, 245,
+ 144, 251, 136, 243, 200, 251, 136, 42, 221, 43, 245, 144, 251, 136, 42,
+ 133, 224, 165, 251, 136, 42, 244, 50, 245, 144, 251, 136, 42, 151, 251,
+ 136, 42, 133, 245, 144, 251, 136, 42, 122, 224, 167, 251, 136, 42, 122,
+ 245, 146, 251, 136, 46, 151, 251, 136, 177, 221, 14, 231, 147, 221, 14,
+ 248, 107, 221, 14, 215, 131, 122, 245, 146, 251, 136, 46, 122, 245, 146,
+ 251, 136, 224, 171, 232, 163, 233, 70, 224, 171, 232, 163, 223, 148, 224,
+ 171, 215, 131, 233, 70, 224, 171, 215, 131, 42, 24, 232, 163, 42, 24,
+ 232, 163, 223, 148, 224, 171, 215, 131, 42, 24, 232, 163, 223, 148, 224,
+ 171, 215, 131, 42, 24, 215, 131, 46, 24, 232, 163, 233, 70, 224, 171,
+ 215, 131, 42, 24, 215, 131, 46, 24, 232, 163, 223, 148, 224, 171, 215,
+ 131, 223, 148, 224, 171, 215, 131, 46, 24, 232, 163, 233, 70, 224, 171,
+ 215, 131, 46, 24, 232, 163, 42, 24, 232, 163, 223, 148, 83, 219, 166, 67,
+ 219, 166, 67, 41, 2, 223, 85, 249, 98, 67, 41, 249, 126, 83, 3, 219, 166,
+ 41, 2, 199, 244, 74, 41, 2, 71, 244, 74, 41, 2, 227, 11, 249, 66, 244,
+ 74, 41, 2, 215, 131, 42, 211, 211, 232, 163, 46, 244, 74, 41, 2, 215,
+ 131, 46, 211, 211, 232, 163, 42, 244, 74, 41, 2, 247, 207, 249, 66, 244,
+ 74, 83, 3, 219, 166, 67, 3, 219, 166, 83, 224, 9, 67, 224, 9, 83, 71,
+ 224, 9, 67, 71, 224, 9, 83, 226, 134, 67, 226, 134, 83, 215, 133, 216,
+ 183, 67, 215, 133, 216, 183, 83, 215, 133, 3, 216, 183, 67, 215, 133, 3,
+ 216, 183, 83, 223, 144, 216, 183, 67, 223, 144, 216, 183, 83, 223, 144,
+ 3, 216, 183, 67, 223, 144, 3, 216, 183, 83, 223, 144, 225, 142, 67, 223,
+ 144, 225, 142, 83, 246, 59, 216, 183, 67, 246, 59, 216, 183, 83, 246, 59,
+ 3, 216, 183, 67, 246, 59, 3, 216, 183, 83, 233, 66, 216, 183, 67, 233,
+ 66, 216, 183, 83, 233, 66, 3, 216, 183, 67, 233, 66, 3, 216, 183, 83,
+ 233, 66, 225, 142, 67, 233, 66, 225, 142, 83, 247, 200, 67, 247, 200, 67,
+ 247, 201, 249, 126, 83, 3, 247, 200, 244, 58, 232, 159, 67, 249, 228,
+ 246, 72, 249, 228, 249, 229, 2, 71, 244, 74, 251, 40, 83, 249, 228, 249,
+ 229, 2, 42, 151, 251, 144, 249, 229, 2, 46, 151, 251, 144, 249, 229, 2,
+ 232, 163, 151, 251, 144, 249, 229, 2, 215, 131, 151, 251, 144, 249, 229,
+ 2, 215, 131, 46, 224, 171, 251, 144, 249, 229, 2, 254, 64, 251, 17, 215,
+ 131, 42, 224, 171, 251, 144, 42, 151, 83, 249, 228, 46, 151, 83, 249,
+ 228, 235, 192, 251, 42, 235, 192, 67, 249, 228, 215, 131, 151, 235, 192,
+ 67, 249, 228, 232, 163, 151, 235, 192, 67, 249, 228, 215, 131, 42, 224,
+ 171, 249, 226, 253, 195, 215, 131, 46, 224, 171, 249, 226, 253, 195, 232,
+ 163, 46, 224, 171, 249, 226, 253, 195, 232, 163, 42, 224, 171, 249, 226,
+ 253, 195, 215, 131, 151, 249, 228, 232, 163, 151, 249, 228, 83, 232, 163,
+ 46, 216, 183, 83, 232, 163, 42, 216, 183, 83, 215, 131, 42, 216, 183, 83,
+ 215, 131, 46, 216, 183, 67, 251, 42, 41, 2, 42, 151, 251, 144, 41, 2, 46,
+ 151, 251, 144, 41, 2, 215, 131, 42, 247, 207, 151, 251, 144, 41, 2, 232,
+ 163, 46, 247, 207, 151, 251, 144, 67, 41, 2, 71, 251, 155, 232, 242, 67,
+ 215, 133, 216, 184, 2, 247, 74, 215, 133, 216, 184, 2, 42, 151, 251, 144,
+ 215, 133, 216, 184, 2, 46, 151, 251, 144, 233, 108, 249, 228, 67, 41, 2,
+ 215, 131, 42, 224, 170, 67, 41, 2, 232, 163, 42, 224, 170, 67, 41, 2,
+ 232, 163, 46, 224, 170, 67, 41, 2, 215, 131, 46, 224, 170, 67, 249, 229,
+ 2, 215, 131, 42, 224, 170, 67, 249, 229, 2, 232, 163, 42, 224, 170, 67,
+ 249, 229, 2, 232, 163, 46, 224, 170, 67, 249, 229, 2, 215, 131, 46, 224,
+ 170, 215, 131, 42, 216, 183, 215, 131, 46, 216, 183, 232, 163, 42, 216,
+ 183, 67, 231, 147, 219, 166, 83, 231, 147, 219, 166, 67, 231, 147, 3,
+ 219, 166, 83, 231, 147, 3, 219, 166, 232, 163, 46, 216, 183, 83, 218,
+ 239, 2, 224, 25, 249, 184, 215, 164, 219, 244, 249, 160, 83, 219, 95, 67,
+ 219, 95, 233, 0, 217, 86, 218, 238, 253, 149, 228, 182, 247, 245, 228,
+ 182, 249, 135, 227, 29, 83, 217, 209, 67, 217, 209, 252, 75, 251, 89,
+ 252, 75, 92, 2, 250, 65, 252, 75, 92, 2, 213, 166, 222, 169, 215, 165, 2,
+ 224, 51, 246, 39, 240, 230, 251, 199, 67, 220, 182, 225, 233, 83, 220,
+ 182, 225, 233, 221, 10, 223, 202, 223, 89, 244, 24, 241, 212, 251, 42,
+ 83, 42, 225, 141, 235, 239, 83, 46, 225, 141, 235, 239, 67, 42, 225, 141,
+ 235, 239, 67, 114, 225, 141, 235, 239, 67, 46, 225, 141, 235, 239, 67,
+ 119, 225, 141, 235, 239, 220, 29, 24, 249, 69, 250, 152, 52, 224, 62, 52,
+ 251, 162, 52, 250, 211, 254, 13, 227, 12, 249, 70, 250, 48, 223, 190,
+ 249, 71, 65, 232, 173, 249, 71, 65, 235, 117, 219, 96, 24, 249, 76, 244,
+ 136, 87, 254, 153, 221, 12, 242, 5, 24, 220, 115, 226, 95, 87, 212, 245,
+ 213, 58, 216, 173, 31, 241, 207, 216, 173, 31, 233, 131, 216, 173, 31,
+ 244, 65, 216, 173, 31, 217, 87, 216, 173, 31, 213, 224, 216, 173, 31,
+ 214, 24, 216, 173, 31, 230, 185, 216, 173, 31, 245, 179, 213, 242, 65,
+ 247, 226, 67, 243, 209, 244, 158, 67, 220, 2, 244, 158, 83, 220, 2, 244,
+ 158, 67, 218, 239, 2, 224, 25, 244, 61, 224, 167, 230, 198, 233, 103,
+ 224, 167, 230, 198, 231, 118, 244, 107, 52, 245, 179, 231, 253, 52, 235,
+ 41, 222, 137, 215, 116, 229, 175, 225, 154, 253, 183, 217, 247, 243, 28,
+ 250, 191, 233, 43, 214, 131, 233, 10, 222, 110, 222, 188, 250, 180, 253,
+ 212, 225, 184, 67, 250, 54, 234, 87, 67, 250, 54, 224, 159, 67, 250, 54,
+ 223, 97, 67, 250, 54, 251, 154, 67, 250, 54, 234, 39, 67, 250, 54, 226,
+ 105, 83, 250, 54, 234, 87, 83, 250, 54, 224, 159, 83, 250, 54, 223, 97,
+ 83, 250, 54, 251, 154, 83, 250, 54, 234, 39, 83, 250, 54, 226, 105, 83,
+ 219, 204, 218, 251, 67, 241, 212, 218, 251, 67, 247, 201, 218, 251, 83,
+ 249, 182, 218, 251, 67, 219, 204, 218, 251, 83, 241, 212, 218, 251, 83,
+ 247, 201, 218, 251, 67, 249, 182, 218, 251, 240, 230, 219, 170, 224, 167,
+ 228, 158, 245, 146, 228, 158, 251, 249, 245, 146, 228, 153, 251, 249,
+ 220, 46, 228, 153, 230, 127, 244, 35, 52, 230, 127, 230, 9, 52, 230, 127,
+ 220, 255, 52, 213, 250, 175, 249, 70, 245, 176, 175, 249, 70, 215, 142,
+ 224, 5, 87, 224, 5, 16, 31, 216, 14, 225, 166, 224, 5, 16, 31, 216, 13,
+ 225, 166, 224, 5, 16, 31, 216, 12, 225, 166, 224, 5, 16, 31, 216, 11,
+ 225, 166, 224, 5, 16, 31, 216, 10, 225, 166, 224, 5, 16, 31, 216, 9, 225,
+ 166, 224, 5, 16, 31, 216, 8, 225, 166, 224, 5, 16, 31, 243, 26, 231, 201,
+ 83, 215, 142, 224, 5, 87, 224, 6, 226, 148, 87, 226, 124, 226, 148, 87,
+ 226, 49, 226, 148, 52, 213, 240, 87, 247, 193, 244, 157, 247, 193, 244,
+ 156, 247, 193, 244, 155, 247, 193, 244, 154, 247, 193, 244, 153, 247,
+ 193, 244, 152, 67, 249, 229, 2, 62, 223, 148, 67, 249, 229, 2, 117, 247,
+ 72, 83, 249, 229, 2, 67, 62, 223, 148, 83, 249, 229, 2, 117, 67, 247, 72,
+ 230, 212, 31, 213, 58, 230, 212, 31, 212, 244, 247, 176, 31, 242, 108,
+ 213, 58, 247, 176, 31, 233, 37, 212, 244, 247, 176, 31, 233, 37, 213, 58,
+ 247, 176, 31, 242, 108, 212, 244, 67, 244, 42, 83, 244, 42, 242, 5, 24,
+ 225, 236, 254, 29, 249, 68, 218, 180, 219, 103, 65, 254, 131, 222, 124,
+ 254, 77, 244, 20, 243, 36, 219, 103, 65, 241, 187, 253, 115, 87, 244, 31,
+ 226, 250, 67, 219, 95, 133, 232, 237, 249, 114, 223, 148, 133, 232, 237,
+ 249, 114, 233, 70, 214, 34, 52, 124, 214, 111, 52, 246, 64, 244, 107, 52,
+ 246, 64, 231, 253, 52, 235, 200, 244, 107, 24, 231, 253, 52, 231, 253,
+ 24, 244, 107, 52, 231, 253, 2, 219, 45, 52, 231, 253, 2, 219, 45, 24,
+ 231, 253, 24, 244, 107, 52, 71, 231, 253, 2, 219, 45, 52, 199, 231, 253,
+ 2, 219, 45, 52, 231, 147, 67, 249, 228, 231, 147, 83, 249, 228, 231, 147,
+ 3, 67, 249, 228, 231, 216, 87, 247, 119, 87, 215, 140, 226, 123, 87, 249,
+ 169, 243, 196, 215, 112, 229, 170, 250, 95, 226, 188, 235, 47, 214, 162,
+ 250, 30, 83, 230, 199, 232, 253, 221, 33, 221, 67, 224, 150, 221, 51,
+ 219, 239, 252, 78, 252, 46, 91, 234, 144, 67, 246, 48, 231, 248, 67, 246,
+ 48, 234, 87, 83, 246, 48, 231, 248, 83, 246, 48, 234, 87, 219, 245, 213,
+ 216, 219, 248, 218, 239, 251, 227, 249, 184, 224, 50, 83, 219, 244, 217,
+ 88, 249, 185, 24, 224, 50, 216, 58, 67, 220, 182, 225, 233, 216, 58, 83,
+ 220, 182, 225, 233, 67, 247, 201, 235, 252, 219, 166, 249, 65, 233, 115,
+ 247, 145, 250, 176, 227, 32, 225, 236, 250, 177, 220, 16, 241, 196, 2,
+ 67, 249, 70, 36, 249, 65, 233, 115, 250, 88, 228, 186, 245, 83, 254, 50,
+ 227, 57, 42, 214, 10, 216, 208, 83, 216, 21, 42, 214, 10, 216, 208, 67,
+ 216, 21, 42, 214, 10, 216, 208, 83, 42, 233, 116, 231, 117, 67, 42, 233,
+ 116, 231, 117, 246, 44, 220, 10, 52, 107, 67, 246, 59, 216, 183, 42, 249,
+ 193, 245, 83, 91, 222, 169, 244, 143, 247, 207, 235, 252, 67, 249, 229,
+ 235, 252, 83, 219, 166, 83, 216, 150, 223, 212, 42, 245, 82, 223, 212,
+ 42, 245, 81, 253, 127, 16, 31, 215, 116, 107, 249, 229, 2, 219, 45, 24,
+ 117, 176, 49, 226, 64, 223, 145, 235, 202, 226, 64, 233, 67, 235, 202,
+ 226, 64, 235, 191, 226, 64, 83, 249, 71, 227, 63, 220, 209, 220, 197,
+ 220, 154, 249, 254, 250, 158, 241, 143, 220, 54, 243, 37, 213, 216, 240,
+ 210, 243, 37, 2, 241, 251, 231, 236, 16, 31, 233, 1, 230, 185, 215, 165,
+ 227, 63, 242, 100, 243, 238, 244, 43, 235, 252, 241, 45, 244, 98, 222,
+ 185, 41, 243, 237, 249, 98, 220, 32, 240, 105, 220, 35, 226, 44, 2, 252,
+ 78, 217, 195, 235, 131, 252, 65, 87, 241, 215, 242, 110, 87, 243, 203,
+ 225, 28, 249, 44, 227, 63, 83, 219, 166, 67, 244, 43, 2, 199, 231, 37,
+ 83, 219, 46, 215, 131, 251, 140, 222, 112, 83, 222, 112, 232, 163, 251,
+ 140, 222, 112, 67, 222, 112, 67, 107, 250, 66, 77, 217, 210, 232, 206,
+ 52, 218, 4, 246, 43, 254, 99, 245, 78, 224, 48, 244, 54, 224, 48, 241,
+ 254, 214, 152, 241, 254, 213, 186, 241, 254, 232, 163, 46, 226, 73, 226,
+ 73, 215, 131, 46, 226, 73, 67, 229, 61, 83, 229, 61, 250, 66, 77, 107,
+ 250, 66, 77, 230, 154, 213, 166, 107, 230, 154, 213, 166, 252, 75, 213,
+ 166, 107, 252, 75, 213, 166, 226, 250, 25, 249, 70, 107, 25, 249, 70,
+ 227, 40, 250, 109, 249, 70, 107, 227, 40, 250, 109, 249, 70, 7, 249, 70,
+ 221, 13, 67, 7, 249, 70, 226, 250, 7, 249, 70, 231, 250, 249, 70, 219,
+ 96, 65, 248, 95, 243, 237, 217, 223, 253, 132, 243, 237, 252, 76, 253,
+ 132, 107, 243, 237, 252, 76, 253, 132, 243, 237, 249, 180, 253, 132, 83,
+ 243, 237, 225, 143, 219, 95, 67, 243, 237, 225, 143, 219, 95, 219, 199,
+ 219, 51, 226, 250, 67, 219, 95, 36, 67, 219, 95, 227, 40, 250, 109, 83,
+ 219, 95, 83, 250, 109, 67, 219, 95, 226, 250, 83, 219, 95, 107, 226, 250,
+ 83, 219, 95, 225, 192, 219, 95, 221, 13, 67, 219, 95, 107, 253, 132, 227,
+ 40, 250, 109, 253, 132, 245, 150, 219, 176, 253, 132, 245, 150, 225, 143,
+ 83, 219, 95, 245, 150, 225, 143, 225, 192, 219, 95, 220, 53, 225, 143,
+ 83, 219, 95, 245, 150, 225, 143, 224, 7, 83, 219, 95, 107, 245, 150, 225,
+ 143, 224, 7, 83, 219, 95, 216, 42, 225, 143, 83, 219, 95, 220, 48, 225,
+ 143, 253, 132, 217, 223, 253, 132, 227, 40, 250, 109, 217, 223, 253, 132,
+ 107, 217, 223, 253, 132, 220, 53, 226, 33, 83, 24, 67, 244, 23, 83, 244,
+ 23, 67, 244, 23, 245, 150, 226, 33, 226, 250, 83, 244, 23, 36, 227, 40,
+ 250, 109, 245, 150, 225, 143, 219, 95, 107, 217, 223, 225, 192, 253, 132,
+ 219, 246, 217, 59, 216, 176, 219, 246, 107, 250, 51, 219, 246, 219, 201,
+ 107, 219, 201, 252, 76, 253, 132, 245, 150, 217, 223, 225, 55, 253, 132,
+ 107, 245, 150, 217, 223, 225, 55, 253, 132, 249, 71, 77, 221, 13, 67,
+ 249, 228, 146, 91, 249, 71, 77, 232, 163, 46, 246, 41, 67, 219, 166, 215,
+ 131, 46, 246, 41, 67, 219, 166, 232, 163, 46, 221, 13, 67, 219, 166, 215,
+ 131, 46, 221, 13, 67, 219, 166, 83, 224, 158, 152, 227, 14, 67, 224, 158,
+ 152, 227, 14, 67, 244, 254, 152, 227, 14, 83, 247, 201, 230, 251, 67,
+ 213, 166, 107, 244, 254, 152, 87, 177, 71, 134, 231, 147, 71, 134, 107,
+ 71, 134, 107, 220, 81, 216, 58, 249, 158, 224, 143, 152, 227, 14, 107,
+ 220, 81, 249, 158, 224, 143, 152, 227, 14, 107, 51, 216, 58, 249, 158,
+ 224, 143, 152, 227, 14, 107, 51, 249, 158, 224, 143, 152, 227, 14, 107,
+ 115, 220, 81, 249, 158, 224, 143, 152, 227, 14, 107, 115, 51, 249, 158,
+ 224, 143, 152, 227, 14, 249, 33, 219, 80, 226, 143, 5, 227, 14, 107, 244,
+ 254, 152, 227, 14, 107, 241, 212, 244, 254, 152, 227, 14, 107, 83, 241,
+ 211, 223, 89, 107, 83, 241, 212, 251, 42, 244, 24, 241, 211, 223, 89,
+ 244, 24, 241, 212, 251, 42, 231, 147, 42, 226, 132, 227, 14, 231, 147,
+ 46, 226, 132, 227, 14, 231, 147, 244, 32, 42, 226, 132, 227, 14, 231,
+ 147, 244, 32, 46, 226, 132, 227, 14, 231, 147, 233, 66, 254, 19, 251, 85,
+ 227, 14, 231, 147, 223, 144, 254, 19, 251, 85, 227, 14, 107, 233, 66,
+ 254, 19, 224, 143, 152, 227, 14, 107, 223, 144, 254, 19, 224, 143, 152,
+ 227, 14, 107, 233, 66, 254, 19, 251, 85, 227, 14, 107, 223, 144, 254, 19,
+ 251, 85, 227, 14, 177, 42, 216, 219, 220, 233, 251, 85, 227, 14, 177, 46,
+ 216, 219, 220, 233, 251, 85, 227, 14, 231, 147, 42, 249, 40, 251, 85,
+ 227, 14, 231, 147, 46, 249, 40, 251, 85, 227, 14, 247, 156, 146, 36, 21,
+ 116, 247, 156, 146, 36, 21, 109, 247, 156, 146, 36, 21, 166, 247, 156,
+ 146, 36, 21, 163, 247, 156, 146, 36, 21, 180, 247, 156, 146, 36, 21, 189,
+ 247, 156, 146, 36, 21, 198, 247, 156, 146, 36, 21, 195, 247, 156, 146,
+ 36, 21, 200, 247, 156, 146, 36, 50, 217, 200, 247, 156, 36, 35, 21, 116,
+ 247, 156, 36, 35, 21, 109, 247, 156, 36, 35, 21, 166, 247, 156, 36, 35,
+ 21, 163, 247, 156, 36, 35, 21, 180, 247, 156, 36, 35, 21, 189, 247, 156,
+ 36, 35, 21, 198, 247, 156, 36, 35, 21, 195, 247, 156, 36, 35, 21, 200,
+ 247, 156, 36, 35, 50, 217, 200, 247, 156, 146, 36, 35, 21, 116, 247, 156,
+ 146, 36, 35, 21, 109, 247, 156, 146, 36, 35, 21, 166, 247, 156, 146, 36,
+ 35, 21, 163, 247, 156, 146, 36, 35, 21, 180, 247, 156, 146, 36, 35, 21,
+ 189, 247, 156, 146, 36, 35, 21, 198, 247, 156, 146, 36, 35, 21, 195, 247,
+ 156, 146, 36, 35, 21, 200, 247, 156, 146, 36, 35, 50, 217, 200, 107, 213,
+ 231, 95, 68, 107, 94, 52, 107, 230, 251, 52, 107, 247, 121, 52, 107, 219,
+ 215, 245, 176, 68, 107, 95, 68, 107, 228, 167, 245, 176, 68, 246, 52,
+ 225, 145, 95, 68, 107, 223, 86, 95, 68, 216, 182, 95, 68, 107, 216, 182,
+ 95, 68, 248, 100, 216, 182, 95, 68, 107, 248, 100, 216, 182, 95, 68, 83,
+ 95, 68, 217, 97, 216, 225, 95, 253, 164, 217, 97, 251, 99, 95, 253, 164,
+ 83, 95, 253, 164, 107, 83, 249, 33, 246, 58, 24, 95, 68, 107, 83, 249,
+ 33, 215, 124, 24, 95, 68, 219, 163, 83, 95, 68, 107, 249, 145, 83, 95,
+ 68, 223, 143, 67, 95, 68, 233, 65, 67, 95, 68, 252, 100, 221, 13, 67, 95,
+ 68, 243, 211, 221, 13, 67, 95, 68, 107, 232, 163, 223, 142, 67, 95, 68,
+ 107, 215, 131, 223, 142, 67, 95, 68, 228, 160, 232, 163, 223, 142, 67,
+ 95, 68, 249, 40, 232, 177, 228, 160, 215, 131, 223, 142, 67, 95, 68, 36,
+ 107, 67, 95, 68, 213, 237, 95, 68, 251, 143, 219, 215, 245, 176, 68, 251,
+ 143, 95, 68, 251, 143, 228, 167, 245, 176, 68, 107, 251, 143, 219, 215,
+ 245, 176, 68, 107, 251, 143, 95, 68, 107, 251, 143, 228, 167, 245, 176,
+ 68, 217, 225, 95, 68, 107, 217, 224, 95, 68, 214, 2, 95, 68, 107, 214, 2,
+ 95, 68, 227, 37, 95, 68, 51, 249, 40, 232, 177, 133, 247, 166, 254, 18,
+ 67, 216, 184, 249, 126, 3, 67, 216, 183, 226, 47, 227, 40, 219, 8, 227,
+ 40, 218, 221, 42, 223, 3, 252, 91, 248, 11, 46, 223, 3, 252, 91, 248, 11,
+ 167, 2, 62, 235, 212, 223, 203, 219, 232, 225, 81, 219, 8, 218, 222, 225,
+ 81, 219, 231, 71, 252, 60, 2, 199, 90, 184, 247, 120, 91, 232, 199, 254,
+ 27, 91, 232, 199, 227, 24, 67, 247, 201, 2, 250, 107, 247, 74, 24, 2,
+ 247, 74, 245, 127, 65, 227, 35, 215, 123, 232, 163, 46, 249, 100, 2, 247,
+ 74, 215, 131, 42, 249, 100, 2, 247, 74, 42, 226, 252, 235, 69, 46, 226,
+ 252, 235, 69, 243, 200, 226, 252, 235, 69, 233, 108, 114, 218, 36, 233,
+ 108, 119, 218, 36, 42, 24, 46, 51, 216, 57, 42, 24, 46, 218, 36, 42, 230,
+ 157, 184, 46, 218, 36, 184, 42, 218, 36, 114, 218, 37, 2, 249, 229, 49,
+ 232, 160, 247, 125, 251, 7, 199, 223, 44, 67, 249, 144, 247, 200, 67,
+ 249, 144, 247, 201, 2, 132, 217, 68, 67, 249, 144, 247, 201, 2, 95, 217,
+ 68, 67, 41, 2, 132, 217, 68, 67, 41, 2, 95, 217, 68, 14, 42, 67, 41, 125,
+ 14, 46, 67, 41, 125, 14, 42, 254, 19, 125, 14, 46, 254, 19, 125, 14, 42,
+ 51, 254, 19, 125, 14, 46, 51, 254, 19, 125, 14, 42, 67, 216, 219, 220,
+ 233, 125, 14, 46, 67, 216, 219, 220, 233, 125, 14, 42, 244, 32, 226, 131,
+ 14, 46, 244, 32, 226, 131, 215, 124, 224, 169, 68, 246, 58, 224, 169, 68,
+ 253, 255, 243, 74, 249, 229, 68, 249, 195, 243, 74, 249, 229, 68, 46, 76,
+ 2, 36, 225, 156, 184, 132, 68, 184, 95, 68, 184, 42, 46, 68, 184, 132,
+ 51, 68, 184, 95, 51, 68, 184, 42, 46, 51, 68, 184, 132, 76, 243, 213,
+ 134, 184, 95, 76, 243, 213, 134, 184, 132, 51, 76, 243, 213, 134, 184,
+ 95, 51, 76, 243, 213, 134, 184, 95, 219, 162, 68, 44, 45, 251, 138, 44,
+ 45, 247, 71, 44, 45, 246, 199, 44, 45, 247, 70, 44, 45, 246, 135, 44, 45,
+ 247, 6, 44, 45, 246, 198, 44, 45, 247, 69, 44, 45, 246, 103, 44, 45, 246,
+ 230, 44, 45, 246, 166, 44, 45, 247, 37, 44, 45, 246, 134, 44, 45, 247, 5,
+ 44, 45, 246, 197, 44, 45, 247, 68, 44, 45, 246, 87, 44, 45, 246, 214, 44,
+ 45, 246, 150, 44, 45, 247, 21, 44, 45, 246, 118, 44, 45, 246, 245, 44,
+ 45, 246, 181, 44, 45, 247, 52, 44, 45, 246, 102, 44, 45, 246, 229, 44,
+ 45, 246, 165, 44, 45, 247, 36, 44, 45, 246, 133, 44, 45, 247, 4, 44, 45,
+ 246, 196, 44, 45, 247, 67, 44, 45, 246, 79, 44, 45, 246, 206, 44, 45,
+ 246, 142, 44, 45, 247, 13, 44, 45, 246, 110, 44, 45, 246, 237, 44, 45,
+ 246, 173, 44, 45, 247, 44, 44, 45, 246, 94, 44, 45, 246, 221, 44, 45,
+ 246, 157, 44, 45, 247, 28, 44, 45, 246, 125, 44, 45, 246, 252, 44, 45,
+ 246, 188, 44, 45, 247, 59, 44, 45, 246, 86, 44, 45, 246, 213, 44, 45,
+ 246, 149, 44, 45, 247, 20, 44, 45, 246, 117, 44, 45, 246, 244, 44, 45,
+ 246, 180, 44, 45, 247, 51, 44, 45, 246, 101, 44, 45, 246, 228, 44, 45,
+ 246, 164, 44, 45, 247, 35, 44, 45, 246, 132, 44, 45, 247, 3, 44, 45, 246,
+ 195, 44, 45, 247, 66, 44, 45, 246, 75, 44, 45, 246, 202, 44, 45, 246,
+ 138, 44, 45, 247, 9, 44, 45, 246, 106, 44, 45, 246, 233, 44, 45, 246,
+ 169, 44, 45, 247, 40, 44, 45, 246, 90, 44, 45, 246, 217, 44, 45, 246,
+ 153, 44, 45, 247, 24, 44, 45, 246, 121, 44, 45, 246, 248, 44, 45, 246,
+ 184, 44, 45, 247, 55, 44, 45, 246, 82, 44, 45, 246, 209, 44, 45, 246,
+ 145, 44, 45, 247, 16, 44, 45, 246, 113, 44, 45, 246, 240, 44, 45, 246,
+ 176, 44, 45, 247, 47, 44, 45, 246, 97, 44, 45, 246, 224, 44, 45, 246,
+ 160, 44, 45, 247, 31, 44, 45, 246, 128, 44, 45, 246, 255, 44, 45, 246,
+ 191, 44, 45, 247, 62, 44, 45, 246, 78, 44, 45, 246, 205, 44, 45, 246,
+ 141, 44, 45, 247, 12, 44, 45, 246, 109, 44, 45, 246, 236, 44, 45, 246,
+ 172, 44, 45, 247, 43, 44, 45, 246, 93, 44, 45, 246, 220, 44, 45, 246,
+ 156, 44, 45, 247, 27, 44, 45, 246, 124, 44, 45, 246, 251, 44, 45, 246,
+ 187, 44, 45, 247, 58, 44, 45, 246, 85, 44, 45, 246, 212, 44, 45, 246,
+ 148, 44, 45, 247, 19, 44, 45, 246, 116, 44, 45, 246, 243, 44, 45, 246,
+ 179, 44, 45, 247, 50, 44, 45, 246, 100, 44, 45, 246, 227, 44, 45, 246,
+ 163, 44, 45, 247, 34, 44, 45, 246, 131, 44, 45, 247, 2, 44, 45, 246, 194,
+ 44, 45, 247, 65, 44, 45, 246, 73, 44, 45, 246, 200, 44, 45, 246, 136, 44,
+ 45, 247, 7, 44, 45, 246, 104, 44, 45, 246, 231, 44, 45, 246, 167, 44, 45,
+ 247, 38, 44, 45, 246, 88, 44, 45, 246, 215, 44, 45, 246, 151, 44, 45,
+ 247, 22, 44, 45, 246, 119, 44, 45, 246, 246, 44, 45, 246, 182, 44, 45,
+ 247, 53, 44, 45, 246, 80, 44, 45, 246, 207, 44, 45, 246, 143, 44, 45,
+ 247, 14, 44, 45, 246, 111, 44, 45, 246, 238, 44, 45, 246, 174, 44, 45,
+ 247, 45, 44, 45, 246, 95, 44, 45, 246, 222, 44, 45, 246, 158, 44, 45,
+ 247, 29, 44, 45, 246, 126, 44, 45, 246, 253, 44, 45, 246, 189, 44, 45,
+ 247, 60, 44, 45, 246, 76, 44, 45, 246, 203, 44, 45, 246, 139, 44, 45,
+ 247, 10, 44, 45, 246, 107, 44, 45, 246, 234, 44, 45, 246, 170, 44, 45,
+ 247, 41, 44, 45, 246, 91, 44, 45, 246, 218, 44, 45, 246, 154, 44, 45,
+ 247, 25, 44, 45, 246, 122, 44, 45, 246, 249, 44, 45, 246, 185, 44, 45,
+ 247, 56, 44, 45, 246, 83, 44, 45, 246, 210, 44, 45, 246, 146, 44, 45,
+ 247, 17, 44, 45, 246, 114, 44, 45, 246, 241, 44, 45, 246, 177, 44, 45,
+ 247, 48, 44, 45, 246, 98, 44, 45, 246, 225, 44, 45, 246, 161, 44, 45,
+ 247, 32, 44, 45, 246, 129, 44, 45, 247, 0, 44, 45, 246, 192, 44, 45, 247,
+ 63, 44, 45, 246, 74, 44, 45, 246, 201, 44, 45, 246, 137, 44, 45, 247, 8,
+ 44, 45, 246, 105, 44, 45, 246, 232, 44, 45, 246, 168, 44, 45, 247, 39,
+ 44, 45, 246, 89, 44, 45, 246, 216, 44, 45, 246, 152, 44, 45, 247, 23, 44,
+ 45, 246, 120, 44, 45, 246, 247, 44, 45, 246, 183, 44, 45, 247, 54, 44,
+ 45, 246, 81, 44, 45, 246, 208, 44, 45, 246, 144, 44, 45, 247, 15, 44, 45,
+ 246, 112, 44, 45, 246, 239, 44, 45, 246, 175, 44, 45, 247, 46, 44, 45,
+ 246, 96, 44, 45, 246, 223, 44, 45, 246, 159, 44, 45, 247, 30, 44, 45,
+ 246, 127, 44, 45, 246, 254, 44, 45, 246, 190, 44, 45, 247, 61, 44, 45,
+ 246, 77, 44, 45, 246, 204, 44, 45, 246, 140, 44, 45, 247, 11, 44, 45,
+ 246, 108, 44, 45, 246, 235, 44, 45, 246, 171, 44, 45, 247, 42, 44, 45,
+ 246, 92, 44, 45, 246, 219, 44, 45, 246, 155, 44, 45, 247, 26, 44, 45,
+ 246, 123, 44, 45, 246, 250, 44, 45, 246, 186, 44, 45, 247, 57, 44, 45,
+ 246, 84, 44, 45, 246, 211, 44, 45, 246, 147, 44, 45, 247, 18, 44, 45,
+ 246, 115, 44, 45, 246, 242, 44, 45, 246, 178, 44, 45, 247, 49, 44, 45,
+ 246, 99, 44, 45, 246, 226, 44, 45, 246, 162, 44, 45, 247, 33, 44, 45,
+ 246, 130, 44, 45, 247, 1, 44, 45, 246, 193, 44, 45, 247, 64, 95, 216, 24,
+ 76, 2, 71, 90, 95, 216, 24, 76, 2, 51, 71, 90, 132, 51, 76, 2, 71, 90,
+ 95, 51, 76, 2, 71, 90, 42, 46, 51, 76, 2, 71, 90, 95, 216, 24, 76, 243,
+ 213, 134, 132, 51, 76, 243, 213, 134, 95, 51, 76, 243, 213, 134, 246, 58,
+ 76, 2, 199, 90, 215, 124, 76, 2, 199, 90, 215, 124, 216, 169, 68, 246,
+ 58, 216, 169, 68, 132, 51, 248, 102, 68, 95, 51, 248, 102, 68, 132, 216,
+ 169, 248, 102, 68, 95, 216, 169, 248, 102, 68, 95, 216, 24, 216, 169,
+ 248, 102, 68, 95, 76, 2, 246, 72, 219, 79, 215, 124, 76, 211, 211, 134,
+ 246, 58, 76, 211, 211, 134, 95, 76, 2, 218, 28, 2, 71, 90, 95, 76, 2,
+ 218, 28, 2, 51, 71, 90, 95, 216, 24, 76, 2, 218, 27, 95, 216, 24, 76, 2,
+ 218, 28, 2, 71, 90, 95, 216, 24, 76, 2, 218, 28, 2, 51, 71, 90, 132, 253,
+ 166, 95, 253, 166, 132, 51, 253, 166, 95, 51, 253, 166, 132, 76, 211,
+ 211, 83, 247, 200, 95, 76, 211, 211, 83, 247, 200, 132, 76, 243, 213,
+ 252, 60, 211, 211, 83, 247, 200, 95, 76, 243, 213, 252, 60, 211, 211, 83,
+ 247, 200, 228, 167, 213, 250, 24, 219, 215, 245, 176, 68, 228, 167, 245,
+ 176, 24, 219, 215, 213, 250, 68, 228, 167, 213, 250, 76, 2, 101, 228,
+ 167, 245, 176, 76, 2, 101, 219, 215, 245, 176, 76, 2, 101, 219, 215, 213,
+ 250, 76, 2, 101, 228, 167, 213, 250, 76, 24, 228, 167, 245, 176, 68, 228,
+ 167, 245, 176, 76, 24, 219, 215, 245, 176, 68, 219, 215, 245, 176, 76,
+ 24, 219, 215, 213, 250, 68, 219, 215, 213, 250, 76, 24, 228, 167, 213,
+ 250, 68, 223, 125, 247, 207, 249, 65, 244, 143, 247, 206, 244, 143, 247,
+ 207, 249, 65, 223, 125, 247, 206, 219, 215, 245, 176, 76, 249, 65, 228,
+ 167, 245, 176, 68, 228, 167, 245, 176, 76, 249, 65, 219, 215, 245, 176,
+ 68, 244, 143, 247, 207, 249, 65, 228, 167, 245, 176, 68, 223, 125, 247,
+ 207, 249, 65, 219, 215, 245, 176, 68, 228, 167, 245, 176, 76, 249, 65,
+ 228, 167, 213, 250, 68, 228, 167, 213, 250, 76, 249, 65, 228, 167, 245,
+ 176, 68, 214, 20, 76, 225, 141, 247, 147, 223, 148, 76, 225, 141, 95,
+ 217, 141, 249, 32, 215, 123, 76, 225, 141, 95, 217, 141, 249, 32, 246,
+ 57, 76, 225, 141, 246, 58, 217, 141, 249, 32, 233, 61, 76, 225, 141, 246,
+ 58, 217, 141, 249, 32, 223, 138, 223, 141, 253, 196, 249, 195, 68, 233,
+ 64, 253, 196, 253, 255, 68, 216, 227, 253, 196, 253, 255, 68, 251, 101,
+ 253, 196, 253, 255, 68, 216, 227, 253, 196, 249, 195, 76, 2, 230, 250,
+ 216, 227, 253, 196, 253, 255, 76, 2, 225, 156, 232, 163, 46, 221, 72,
+ 249, 195, 68, 232, 163, 42, 221, 72, 253, 255, 68, 253, 255, 249, 193,
+ 249, 229, 68, 249, 195, 249, 193, 249, 229, 68, 95, 76, 78, 220, 175,
+ 132, 68, 132, 76, 78, 220, 175, 95, 68, 220, 175, 95, 76, 78, 132, 68,
+ 95, 76, 2, 94, 55, 132, 76, 2, 94, 55, 95, 76, 217, 93, 213, 166, 42, 46,
+ 76, 217, 93, 3, 249, 228, 215, 124, 216, 24, 76, 243, 213, 3, 249, 228,
+ 42, 206, 114, 46, 206, 119, 241, 237, 42, 206, 119, 46, 206, 114, 241,
+ 237, 114, 206, 46, 119, 206, 42, 241, 237, 114, 206, 42, 119, 206, 46,
+ 241, 237, 42, 206, 114, 46, 206, 114, 241, 237, 114, 206, 46, 119, 206,
+ 46, 241, 237, 42, 206, 119, 46, 206, 119, 241, 237, 114, 206, 42, 119,
+ 206, 42, 241, 237, 132, 241, 238, 2, 206, 114, 211, 211, 134, 95, 241,
+ 238, 2, 206, 114, 211, 211, 134, 215, 124, 241, 238, 2, 206, 46, 211,
+ 211, 134, 246, 58, 241, 238, 2, 206, 46, 211, 211, 134, 132, 241, 238, 2,
+ 206, 119, 211, 211, 134, 95, 241, 238, 2, 206, 119, 211, 211, 134, 215,
+ 124, 241, 238, 2, 206, 42, 211, 211, 134, 246, 58, 241, 238, 2, 206, 42,
+ 211, 211, 134, 132, 241, 238, 2, 206, 114, 243, 213, 134, 95, 241, 238,
+ 2, 206, 114, 243, 213, 134, 215, 124, 241, 238, 2, 206, 46, 243, 213,
+ 134, 246, 58, 241, 238, 2, 206, 46, 243, 213, 134, 132, 241, 238, 2, 206,
+ 119, 243, 213, 134, 95, 241, 238, 2, 206, 119, 243, 213, 134, 215, 124,
+ 241, 238, 2, 206, 42, 243, 213, 134, 246, 58, 241, 238, 2, 206, 42, 243,
+ 213, 134, 132, 241, 238, 2, 206, 114, 78, 132, 241, 238, 2, 206, 246, 60,
+ 215, 124, 241, 238, 2, 206, 42, 251, 207, 215, 124, 241, 238, 2, 206,
+ 223, 148, 95, 241, 238, 2, 206, 114, 78, 95, 241, 238, 2, 206, 246, 60,
+ 246, 58, 241, 238, 2, 206, 42, 251, 207, 246, 58, 241, 238, 2, 206, 223,
+ 148, 132, 241, 238, 2, 206, 114, 78, 95, 241, 238, 2, 206, 215, 134, 132,
+ 241, 238, 2, 206, 119, 78, 95, 241, 238, 2, 206, 246, 60, 95, 241, 238,
+ 2, 206, 114, 78, 132, 241, 238, 2, 206, 215, 134, 95, 241, 238, 2, 206,
+ 119, 78, 132, 241, 238, 2, 206, 246, 60, 132, 241, 238, 2, 206, 114, 78,
+ 184, 248, 101, 132, 241, 238, 2, 206, 119, 251, 220, 184, 248, 101, 95,
+ 241, 238, 2, 206, 114, 78, 184, 248, 101, 95, 241, 238, 2, 206, 119, 251,
+ 220, 184, 248, 101, 215, 124, 241, 238, 2, 206, 42, 251, 207, 246, 58,
+ 241, 238, 2, 206, 223, 148, 246, 58, 241, 238, 2, 206, 42, 251, 207, 215,
+ 124, 241, 238, 2, 206, 223, 148, 46, 51, 76, 2, 223, 85, 241, 219, 245,
+ 61, 5, 78, 95, 68, 217, 43, 227, 34, 78, 95, 68, 132, 76, 78, 217, 43,
+ 227, 33, 95, 76, 78, 217, 43, 227, 33, 95, 76, 78, 254, 57, 123, 108,
+ 233, 39, 78, 132, 68, 132, 76, 217, 93, 233, 38, 242, 107, 78, 95, 68,
+ 219, 9, 78, 95, 68, 132, 76, 217, 93, 219, 8, 218, 222, 78, 132, 68, 42,
+ 244, 60, 218, 27, 46, 244, 60, 218, 27, 114, 244, 60, 218, 27, 119, 244,
+ 60, 218, 27, 216, 169, 71, 252, 60, 248, 11, 212, 153, 174, 219, 174,
+ 212, 153, 174, 216, 15, 249, 164, 42, 67, 249, 40, 125, 46, 67, 249, 40,
+ 125, 42, 67, 226, 131, 46, 67, 226, 131, 212, 153, 174, 42, 236, 10, 125,
+ 212, 153, 174, 46, 236, 10, 125, 212, 153, 174, 42, 251, 165, 125, 212,
+ 153, 174, 46, 251, 165, 125, 42, 41, 251, 85, 2, 215, 153, 46, 41, 251,
+ 85, 2, 215, 153, 42, 41, 251, 85, 2, 217, 69, 235, 252, 216, 227, 249,
+ 99, 46, 41, 251, 85, 2, 217, 69, 235, 252, 251, 101, 249, 99, 42, 41,
+ 251, 85, 2, 217, 69, 235, 252, 251, 101, 249, 99, 46, 41, 251, 85, 2,
+ 217, 69, 235, 252, 216, 227, 249, 99, 42, 254, 19, 251, 85, 2, 247, 74,
+ 46, 254, 19, 251, 85, 2, 247, 74, 42, 253, 196, 233, 39, 125, 46, 253,
+ 196, 242, 107, 125, 51, 42, 253, 196, 242, 107, 125, 51, 46, 253, 196,
+ 233, 39, 125, 42, 83, 216, 219, 220, 233, 125, 46, 83, 216, 219, 220,
+ 233, 125, 246, 72, 244, 104, 71, 212, 28, 232, 242, 231, 153, 254, 19,
+ 227, 35, 233, 70, 46, 254, 19, 214, 244, 2, 219, 166, 231, 153, 46, 254,
+ 19, 2, 247, 74, 254, 19, 2, 223, 4, 235, 212, 254, 164, 254, 18, 219,
+ 187, 254, 19, 227, 35, 233, 70, 219, 187, 254, 19, 227, 35, 215, 134,
+ 216, 58, 254, 18, 223, 202, 254, 18, 254, 19, 2, 215, 153, 223, 202, 254,
+ 19, 2, 215, 153, 227, 112, 254, 19, 227, 35, 215, 134, 227, 112, 254, 19,
+ 227, 35, 246, 60, 231, 153, 254, 19, 2, 227, 40, 253, 176, 245, 98, 235,
+ 252, 76, 225, 141, 114, 24, 223, 148, 231, 153, 254, 19, 2, 227, 40, 253,
+ 176, 245, 98, 235, 252, 76, 225, 141, 114, 24, 233, 70, 231, 153, 254,
+ 19, 2, 227, 40, 253, 176, 245, 98, 235, 252, 76, 225, 141, 119, 24, 223,
+ 148, 231, 153, 254, 19, 2, 227, 40, 253, 176, 245, 98, 235, 252, 76, 225,
+ 141, 119, 24, 233, 70, 231, 153, 254, 19, 2, 227, 40, 253, 176, 245, 98,
+ 235, 252, 76, 225, 141, 46, 24, 215, 134, 231, 153, 254, 19, 2, 227, 40,
+ 253, 176, 245, 98, 235, 252, 76, 225, 141, 42, 24, 215, 134, 231, 153,
+ 254, 19, 2, 227, 40, 253, 176, 245, 98, 235, 252, 76, 225, 141, 46, 24,
+ 246, 60, 231, 153, 254, 19, 2, 227, 40, 253, 176, 245, 98, 235, 252, 76,
+ 225, 141, 42, 24, 246, 60, 223, 202, 245, 110, 221, 48, 245, 110, 221,
+ 49, 2, 226, 247, 245, 110, 221, 49, 2, 3, 249, 229, 49, 245, 110, 221,
+ 49, 2, 46, 76, 49, 245, 110, 221, 49, 2, 42, 76, 49, 249, 229, 2, 199,
+ 134, 36, 71, 134, 36, 226, 135, 36, 223, 203, 219, 231, 36, 226, 47, 249,
+ 229, 247, 125, 251, 7, 199, 252, 60, 24, 216, 227, 151, 247, 125, 251, 7,
+ 71, 134, 249, 229, 2, 218, 224, 213, 166, 36, 253, 254, 247, 121, 52,
+ 114, 76, 217, 93, 249, 228, 36, 67, 251, 42, 36, 251, 42, 36, 233, 38,
+ 36, 242, 106, 249, 229, 2, 3, 249, 229, 211, 211, 217, 149, 223, 148,
+ 249, 229, 2, 117, 199, 219, 33, 211, 211, 217, 149, 223, 148, 91, 223,
+ 125, 247, 207, 220, 23, 91, 244, 143, 247, 207, 220, 23, 91, 253, 132,
+ 91, 3, 249, 228, 91, 219, 166, 117, 235, 68, 219, 164, 216, 184, 2, 62,
+ 49, 216, 184, 2, 215, 153, 223, 4, 235, 252, 216, 183, 216, 184, 2, 221,
+ 55, 253, 123, 251, 100, 46, 216, 184, 78, 42, 216, 183, 42, 216, 184,
+ 251, 207, 71, 134, 71, 252, 60, 251, 207, 46, 216, 183, 251, 91, 2, 42,
+ 151, 251, 144, 251, 91, 2, 46, 151, 251, 144, 83, 251, 90, 29, 2, 42,
+ 151, 251, 144, 29, 2, 46, 151, 251, 144, 67, 240, 223, 83, 240, 223, 42,
+ 213, 229, 244, 104, 46, 213, 229, 244, 104, 42, 51, 213, 229, 244, 104,
+ 46, 51, 213, 229, 244, 104, 235, 244, 235, 231, 217, 66, 110, 235, 231,
+ 235, 232, 229, 183, 2, 71, 134, 246, 66, 230, 157, 41, 2, 249, 120, 226,
+ 251, 235, 242, 253, 152, 220, 144, 225, 63, 245, 61, 5, 24, 220, 25, 226,
+ 135, 245, 61, 5, 24, 220, 25, 226, 136, 2, 217, 43, 49, 240, 97, 211,
+ 211, 24, 220, 25, 226, 135, 242, 159, 219, 94, 217, 138, 246, 59, 216,
+ 184, 2, 42, 151, 251, 144, 246, 59, 216, 184, 2, 46, 151, 251, 144, 83,
+ 247, 201, 2, 119, 68, 83, 232, 159, 67, 249, 229, 2, 119, 68, 83, 249,
+ 229, 2, 119, 68, 245, 48, 67, 219, 166, 245, 48, 83, 219, 166, 245, 48,
+ 67, 247, 200, 245, 48, 83, 247, 200, 245, 48, 67, 249, 228, 245, 48, 83,
+ 249, 228, 223, 43, 223, 203, 219, 232, 227, 33, 219, 232, 2, 226, 247,
+ 223, 203, 219, 232, 2, 199, 90, 251, 172, 219, 231, 251, 172, 223, 203,
+ 219, 231, 51, 225, 156, 216, 169, 225, 156, 233, 66, 249, 33, 254, 19,
+ 125, 223, 144, 249, 33, 254, 19, 125, 217, 31, 230, 248, 230, 97, 36, 62,
+ 227, 33, 230, 97, 36, 94, 227, 33, 230, 97, 36, 29, 227, 33, 230, 97,
+ 215, 147, 227, 34, 2, 247, 74, 230, 97, 215, 147, 227, 34, 2, 225, 156,
+ 230, 97, 41, 235, 196, 227, 33, 230, 97, 41, 215, 147, 227, 33, 117, 232,
+ 199, 24, 227, 33, 117, 232, 199, 167, 227, 33, 230, 97, 29, 227, 33, 230,
+ 224, 117, 218, 244, 218, 242, 2, 235, 208, 224, 169, 235, 209, 227, 33,
+ 244, 68, 226, 127, 235, 208, 235, 209, 2, 51, 90, 235, 209, 253, 89, 2,
+ 220, 23, 249, 225, 243, 197, 253, 255, 235, 206, 232, 243, 235, 207, 2,
+ 224, 8, 226, 110, 253, 173, 225, 135, 232, 243, 235, 207, 2, 221, 72,
+ 226, 110, 253, 173, 225, 135, 232, 243, 235, 207, 228, 163, 235, 246,
+ 217, 149, 225, 135, 235, 209, 253, 173, 118, 225, 145, 227, 33, 224, 163,
+ 235, 209, 227, 33, 235, 209, 2, 132, 76, 2, 101, 235, 209, 2, 29, 52,
+ 235, 209, 2, 235, 195, 235, 209, 2, 215, 146, 235, 209, 2, 226, 247, 235,
+ 209, 2, 215, 153, 235, 69, 233, 108, 42, 216, 184, 227, 33, 212, 153,
+ 174, 222, 119, 249, 148, 212, 153, 174, 222, 119, 225, 188, 212, 153,
+ 174, 222, 119, 225, 60, 94, 5, 2, 3, 249, 229, 49, 94, 5, 2, 249, 224,
+ 254, 175, 49, 94, 5, 2, 217, 43, 49, 94, 5, 2, 62, 55, 94, 5, 2, 217, 43,
+ 55, 94, 5, 2, 219, 10, 109, 94, 5, 2, 83, 216, 183, 230, 251, 5, 2, 249,
+ 158, 49, 230, 251, 5, 2, 62, 55, 230, 251, 5, 2, 244, 143, 247, 72, 230,
+ 251, 5, 2, 223, 125, 247, 72, 94, 5, 235, 252, 42, 151, 249, 228, 94, 5,
+ 235, 252, 46, 151, 249, 228, 214, 231, 167, 249, 71, 225, 63, 230, 154,
+ 5, 2, 62, 49, 230, 154, 5, 2, 215, 153, 221, 69, 225, 64, 2, 251, 101,
+ 249, 192, 220, 5, 225, 63, 230, 154, 5, 235, 252, 42, 151, 249, 228, 230,
+ 154, 5, 235, 252, 46, 151, 249, 228, 36, 230, 154, 5, 2, 249, 224, 254,
+ 174, 230, 154, 5, 235, 252, 51, 249, 228, 36, 247, 121, 52, 94, 5, 235,
+ 252, 216, 183, 230, 251, 5, 235, 252, 216, 183, 230, 154, 5, 235, 252,
+ 216, 183, 235, 203, 225, 63, 223, 139, 235, 203, 225, 63, 212, 153, 174,
+ 223, 240, 249, 148, 254, 43, 167, 249, 104, 235, 196, 2, 247, 74, 215,
+ 147, 2, 230, 251, 52, 215, 147, 2, 226, 247, 235, 196, 2, 226, 247, 235,
+ 196, 2, 232, 199, 254, 27, 215, 147, 2, 232, 199, 227, 24, 215, 147, 78,
+ 235, 195, 235, 196, 78, 215, 146, 215, 147, 78, 252, 60, 78, 235, 195,
+ 235, 196, 78, 252, 60, 78, 215, 146, 215, 147, 251, 207, 24, 235, 68, 2,
+ 215, 146, 235, 196, 251, 207, 24, 235, 68, 2, 235, 195, 249, 193, 215,
+ 147, 2, 221, 54, 249, 193, 235, 196, 2, 221, 54, 51, 41, 235, 195, 51,
+ 41, 215, 146, 249, 193, 215, 147, 2, 221, 55, 24, 220, 5, 225, 63, 232,
+ 199, 24, 2, 62, 49, 232, 199, 167, 2, 62, 49, 51, 232, 199, 254, 27, 51,
+ 232, 199, 227, 24, 117, 235, 197, 232, 199, 254, 27, 117, 235, 197, 232,
+ 199, 227, 24, 220, 13, 233, 108, 227, 24, 220, 13, 233, 108, 254, 27,
+ 232, 199, 167, 226, 245, 232, 199, 254, 27, 232, 199, 24, 2, 231, 37,
+ 219, 79, 232, 199, 167, 2, 231, 37, 219, 79, 232, 199, 24, 2, 199, 248,
+ 101, 232, 199, 167, 2, 199, 248, 101, 232, 199, 24, 2, 51, 226, 247, 232,
+ 199, 24, 2, 215, 153, 232, 199, 24, 2, 51, 215, 153, 3, 214, 228, 2, 215,
+ 153, 232, 199, 167, 2, 51, 226, 247, 232, 199, 167, 2, 51, 215, 153, 212,
+ 153, 174, 247, 83, 253, 246, 212, 153, 174, 224, 40, 253, 246, 245, 61,
+ 5, 2, 62, 55, 240, 97, 2, 62, 49, 216, 169, 199, 252, 60, 2, 51, 71, 90,
+ 216, 169, 199, 252, 60, 2, 216, 169, 71, 90, 217, 43, 227, 34, 2, 62, 49,
+ 217, 43, 227, 34, 2, 223, 125, 247, 72, 220, 88, 230, 251, 220, 87, 249,
+ 139, 2, 62, 49, 245, 61, 2, 253, 132, 254, 57, 123, 211, 211, 2, 249,
+ 224, 254, 174, 253, 218, 123, 167, 123, 108, 245, 61, 5, 78, 94, 52, 94,
+ 5, 78, 245, 61, 52, 245, 61, 5, 78, 217, 43, 227, 33, 51, 249, 165, 245,
+ 62, 117, 249, 134, 245, 61, 220, 102, 133, 249, 134, 245, 61, 220, 102,
+ 245, 61, 5, 2, 117, 176, 78, 24, 117, 176, 55, 245, 57, 2, 243, 237, 176,
+ 49, 233, 39, 2, 249, 229, 235, 212, 242, 107, 2, 249, 229, 235, 212, 233,
+ 39, 2, 224, 158, 152, 49, 242, 107, 2, 224, 158, 152, 49, 233, 39, 167,
+ 220, 25, 123, 108, 242, 107, 167, 220, 25, 123, 108, 233, 39, 167, 220,
+ 25, 123, 211, 211, 2, 62, 235, 212, 242, 107, 167, 220, 25, 123, 211,
+ 211, 2, 62, 235, 212, 233, 39, 167, 220, 25, 123, 211, 211, 2, 62, 49,
+ 242, 107, 167, 220, 25, 123, 211, 211, 2, 62, 49, 233, 39, 167, 220, 25,
+ 123, 211, 211, 2, 62, 78, 223, 148, 242, 107, 167, 220, 25, 123, 211,
+ 211, 2, 62, 78, 233, 70, 233, 39, 167, 253, 219, 242, 107, 167, 253, 219,
+ 233, 39, 24, 220, 79, 228, 163, 123, 108, 242, 107, 24, 220, 79, 228,
+ 163, 123, 108, 233, 39, 24, 228, 163, 253, 219, 242, 107, 24, 228, 163,
+ 253, 219, 233, 39, 78, 246, 65, 123, 78, 242, 106, 242, 107, 78, 246, 65,
+ 123, 78, 233, 38, 233, 39, 78, 220, 88, 167, 245, 62, 242, 107, 78, 220,
+ 88, 167, 245, 62, 233, 39, 78, 220, 88, 78, 242, 106, 242, 107, 78, 220,
+ 88, 78, 233, 38, 233, 39, 78, 242, 107, 78, 246, 65, 245, 62, 242, 107,
+ 78, 233, 39, 78, 246, 65, 245, 62, 233, 39, 78, 220, 25, 123, 78, 242,
+ 107, 78, 220, 25, 245, 62, 242, 107, 78, 220, 25, 123, 78, 233, 39, 78,
+ 220, 25, 245, 62, 220, 25, 123, 211, 211, 167, 233, 38, 220, 25, 123,
+ 211, 211, 167, 242, 106, 220, 25, 123, 211, 211, 167, 233, 39, 2, 62,
+ 235, 212, 220, 25, 123, 211, 211, 167, 242, 107, 2, 62, 235, 212, 246,
+ 65, 123, 211, 211, 167, 233, 38, 246, 65, 123, 211, 211, 167, 242, 106,
+ 246, 65, 220, 25, 123, 211, 211, 167, 233, 38, 246, 65, 220, 25, 123,
+ 211, 211, 167, 242, 106, 220, 88, 167, 233, 38, 220, 88, 167, 242, 106,
+ 220, 88, 78, 233, 39, 78, 245, 61, 52, 220, 88, 78, 242, 107, 78, 245,
+ 61, 52, 51, 229, 173, 233, 38, 51, 229, 173, 242, 106, 51, 229, 173, 233,
+ 39, 2, 215, 153, 242, 107, 226, 245, 233, 38, 242, 107, 251, 207, 233,
+ 38, 233, 39, 249, 193, 251, 7, 249, 34, 242, 107, 249, 193, 251, 7, 249,
+ 34, 233, 39, 249, 193, 251, 7, 249, 35, 78, 220, 25, 245, 62, 242, 107,
+ 249, 193, 251, 7, 249, 35, 78, 220, 25, 245, 62, 220, 6, 217, 153, 233,
+ 106, 217, 153, 220, 6, 217, 154, 167, 123, 108, 233, 106, 217, 154, 167,
+ 123, 108, 245, 61, 5, 2, 251, 37, 49, 225, 83, 78, 220, 79, 245, 61, 52,
+ 219, 1, 78, 220, 79, 245, 61, 52, 225, 83, 78, 220, 79, 228, 163, 123,
+ 108, 219, 1, 78, 220, 79, 228, 163, 123, 108, 225, 83, 78, 245, 61, 52,
+ 219, 1, 78, 245, 61, 52, 225, 83, 78, 228, 163, 123, 108, 219, 1, 78,
+ 228, 163, 123, 108, 225, 83, 78, 254, 57, 123, 108, 219, 1, 78, 254, 57,
+ 123, 108, 225, 83, 78, 228, 163, 254, 57, 123, 108, 219, 1, 78, 228, 163,
+ 254, 57, 123, 108, 51, 225, 82, 51, 219, 0, 219, 9, 2, 247, 74, 218, 222,
+ 2, 247, 74, 219, 9, 2, 94, 5, 55, 218, 222, 2, 94, 5, 55, 219, 9, 2, 230,
+ 154, 5, 55, 218, 222, 2, 230, 154, 5, 55, 219, 9, 65, 167, 123, 211, 211,
+ 2, 62, 49, 218, 222, 65, 167, 123, 211, 211, 2, 62, 49, 219, 9, 65, 78,
+ 245, 61, 52, 218, 222, 65, 78, 245, 61, 52, 219, 9, 65, 78, 217, 43, 227,
+ 33, 218, 222, 65, 78, 217, 43, 227, 33, 219, 9, 65, 78, 254, 57, 123,
+ 108, 218, 222, 65, 78, 254, 57, 123, 108, 219, 9, 65, 78, 228, 163, 123,
+ 108, 218, 222, 65, 78, 228, 163, 123, 108, 41, 42, 227, 40, 92, 227, 33,
+ 41, 46, 227, 40, 92, 227, 33, 249, 193, 219, 8, 249, 193, 218, 221, 249,
+ 193, 219, 9, 167, 123, 108, 249, 193, 218, 222, 167, 123, 108, 219, 9,
+ 78, 218, 221, 218, 222, 78, 219, 8, 219, 9, 78, 219, 8, 218, 222, 78,
+ 218, 221, 218, 222, 251, 207, 219, 8, 218, 222, 251, 207, 24, 235, 68,
+ 251, 7, 248, 102, 2, 219, 8, 245, 127, 65, 227, 35, 246, 57, 225, 180, 2,
+ 217, 220, 216, 226, 216, 198, 235, 195, 243, 246, 228, 176, 220, 175, 42,
+ 218, 36, 220, 175, 119, 218, 36, 220, 175, 114, 218, 36, 226, 48, 2, 197,
+ 71, 252, 60, 216, 169, 46, 216, 57, 51, 71, 252, 60, 42, 216, 57, 71,
+ 252, 60, 51, 42, 216, 57, 51, 71, 252, 60, 51, 42, 216, 57, 184, 248,
+ 102, 243, 213, 42, 231, 127, 65, 51, 214, 216, 220, 175, 119, 218, 37, 2,
+ 226, 247, 220, 175, 114, 218, 37, 2, 215, 153, 220, 175, 114, 218, 37,
+ 78, 220, 175, 119, 218, 36, 51, 119, 218, 36, 51, 114, 218, 36, 51, 219,
+ 45, 228, 163, 52, 223, 202, 51, 219, 45, 228, 163, 52, 247, 92, 228, 163,
+ 247, 127, 2, 223, 202, 229, 182, 220, 23, 71, 232, 243, 2, 249, 229, 49,
+ 71, 232, 243, 2, 249, 229, 55, 119, 218, 37, 2, 249, 229, 55, 226, 136,
+ 2, 199, 90, 226, 136, 2, 217, 43, 227, 33, 216, 169, 71, 252, 60, 251,
+ 167, 223, 241, 216, 169, 71, 252, 60, 2, 199, 90, 216, 169, 249, 165,
+ 227, 33, 216, 169, 229, 173, 233, 38, 216, 169, 229, 173, 242, 106, 246,
+ 65, 220, 25, 233, 39, 167, 123, 108, 246, 65, 220, 25, 242, 107, 167,
+ 123, 108, 216, 169, 219, 232, 251, 167, 223, 241, 233, 108, 216, 169, 71,
+ 252, 60, 227, 33, 51, 219, 232, 227, 33, 67, 71, 134, 230, 97, 67, 71,
+ 134, 228, 167, 245, 176, 67, 68, 228, 167, 213, 250, 67, 68, 219, 215,
+ 245, 176, 67, 68, 219, 215, 213, 250, 67, 68, 42, 46, 67, 68, 132, 83,
+ 68, 215, 124, 83, 68, 246, 58, 83, 68, 228, 167, 245, 176, 83, 68, 228,
+ 167, 213, 250, 83, 68, 219, 215, 245, 176, 83, 68, 219, 215, 213, 250,
+ 83, 68, 42, 46, 83, 68, 114, 119, 83, 68, 95, 76, 2, 217, 30, 246, 57,
+ 95, 76, 2, 217, 30, 215, 123, 132, 76, 2, 217, 30, 246, 57, 132, 76, 2,
+ 217, 30, 215, 123, 41, 2, 216, 227, 151, 251, 144, 41, 2, 251, 101, 151,
+ 251, 144, 41, 2, 215, 131, 46, 247, 207, 151, 251, 144, 41, 2, 232, 163,
+ 42, 247, 207, 151, 251, 144, 247, 201, 2, 42, 151, 251, 144, 247, 201, 2,
+ 46, 151, 251, 144, 247, 201, 2, 216, 227, 151, 251, 144, 247, 201, 2,
+ 251, 101, 151, 251, 144, 246, 72, 219, 166, 83, 233, 108, 219, 166, 67,
+ 233, 108, 219, 166, 83, 214, 164, 3, 219, 166, 67, 214, 164, 3, 219, 166,
+ 83, 226, 65, 67, 226, 65, 67, 241, 178, 83, 241, 178, 199, 83, 241, 178,
+ 83, 233, 108, 249, 228, 83, 231, 147, 247, 200, 67, 231, 147, 247, 200,
+ 83, 231, 147, 232, 159, 67, 231, 147, 232, 159, 83, 3, 247, 200, 83, 3,
+ 232, 159, 67, 3, 232, 159, 83, 199, 245, 121, 67, 199, 245, 121, 83, 71,
+ 245, 121, 67, 71, 245, 121, 42, 76, 2, 3, 249, 228, 133, 132, 253, 162,
+ 42, 76, 2, 36, 225, 156, 184, 132, 219, 162, 68, 132, 216, 24, 76, 2, 71,
+ 90, 132, 216, 24, 76, 2, 51, 71, 90, 132, 216, 24, 76, 243, 213, 134,
+ 132, 216, 24, 216, 169, 248, 102, 68, 132, 76, 2, 246, 72, 219, 79, 132,
+ 76, 2, 218, 28, 2, 71, 90, 132, 76, 2, 218, 28, 2, 51, 71, 90, 132, 216,
+ 24, 76, 2, 218, 27, 132, 216, 24, 76, 2, 218, 28, 2, 71, 90, 132, 216,
+ 24, 76, 2, 218, 28, 2, 51, 71, 90, 132, 76, 217, 93, 213, 166, 214, 20,
+ 76, 225, 141, 247, 147, 233, 70, 245, 61, 5, 78, 132, 68, 223, 203, 217,
+ 43, 227, 34, 78, 132, 68, 132, 76, 78, 223, 203, 254, 57, 123, 108, 95,
+ 76, 217, 93, 242, 106, 95, 76, 217, 93, 218, 221, 132, 224, 169, 68, 95,
+ 224, 169, 68, 223, 203, 217, 43, 227, 34, 78, 95, 68, 95, 76, 78, 223,
+ 203, 254, 57, 123, 108, 217, 43, 227, 34, 78, 132, 68, 132, 76, 78, 254,
+ 57, 123, 108, 132, 76, 78, 223, 203, 217, 43, 227, 33, 95, 76, 78, 223,
+ 203, 217, 43, 227, 33, 67, 231, 147, 219, 95, 83, 3, 219, 95, 67, 3, 219,
+ 95, 83, 223, 144, 226, 65, 67, 223, 144, 226, 65, 107, 233, 108, 249,
+ 228, 107, 226, 248, 2, 226, 248, 235, 212, 107, 249, 229, 2, 249, 229,
+ 235, 212, 107, 249, 228, 107, 36, 222, 169, 136, 6, 1, 253, 75, 136, 6,
+ 1, 251, 46, 136, 6, 1, 214, 230, 136, 6, 1, 242, 161, 136, 6, 1, 247, 94,
+ 136, 6, 1, 213, 12, 136, 6, 1, 212, 61, 136, 6, 1, 245, 245, 136, 6, 1,
+ 212, 84, 136, 6, 1, 235, 146, 136, 6, 1, 70, 235, 146, 136, 6, 1, 72,
+ 136, 6, 1, 247, 112, 136, 6, 1, 234, 245, 136, 6, 1, 232, 215, 136, 6, 1,
+ 230, 101, 136, 6, 1, 230, 12, 136, 6, 1, 227, 51, 136, 6, 1, 225, 138,
+ 136, 6, 1, 223, 124, 136, 6, 1, 220, 11, 136, 6, 1, 216, 46, 136, 6, 1,
+ 215, 171, 136, 6, 1, 243, 216, 136, 6, 1, 241, 184, 136, 6, 1, 227, 3,
+ 136, 6, 1, 226, 96, 136, 6, 1, 220, 153, 136, 6, 1, 216, 125, 136, 6, 1,
+ 250, 12, 136, 6, 1, 221, 24, 136, 6, 1, 213, 18, 136, 6, 1, 213, 20, 136,
+ 6, 1, 213, 47, 136, 6, 1, 219, 185, 159, 136, 6, 1, 212, 203, 136, 6, 1,
+ 3, 212, 174, 136, 6, 1, 3, 212, 175, 2, 218, 27, 136, 6, 1, 212, 235,
+ 136, 6, 1, 235, 182, 3, 212, 174, 136, 6, 1, 251, 172, 212, 174, 136, 6,
+ 1, 235, 182, 251, 172, 212, 174, 136, 6, 1, 244, 51, 136, 6, 1, 235, 144,
+ 136, 6, 1, 220, 152, 136, 6, 1, 216, 160, 61, 136, 6, 1, 233, 98, 230,
+ 101, 136, 3, 1, 253, 75, 136, 3, 1, 251, 46, 136, 3, 1, 214, 230, 136, 3,
+ 1, 242, 161, 136, 3, 1, 247, 94, 136, 3, 1, 213, 12, 136, 3, 1, 212, 61,
+ 136, 3, 1, 245, 245, 136, 3, 1, 212, 84, 136, 3, 1, 235, 146, 136, 3, 1,
+ 70, 235, 146, 136, 3, 1, 72, 136, 3, 1, 247, 112, 136, 3, 1, 234, 245,
+ 136, 3, 1, 232, 215, 136, 3, 1, 230, 101, 136, 3, 1, 230, 12, 136, 3, 1,
+ 227, 51, 136, 3, 1, 225, 138, 136, 3, 1, 223, 124, 136, 3, 1, 220, 11,
+ 136, 3, 1, 216, 46, 136, 3, 1, 215, 171, 136, 3, 1, 243, 216, 136, 3, 1,
+ 241, 184, 136, 3, 1, 227, 3, 136, 3, 1, 226, 96, 136, 3, 1, 220, 153,
+ 136, 3, 1, 216, 125, 136, 3, 1, 250, 12, 136, 3, 1, 221, 24, 136, 3, 1,
+ 213, 18, 136, 3, 1, 213, 20, 136, 3, 1, 213, 47, 136, 3, 1, 219, 185,
+ 159, 136, 3, 1, 212, 203, 136, 3, 1, 3, 212, 174, 136, 3, 1, 3, 212, 175,
+ 2, 218, 27, 136, 3, 1, 212, 235, 136, 3, 1, 235, 182, 3, 212, 174, 136,
+ 3, 1, 251, 172, 212, 174, 136, 3, 1, 235, 182, 251, 172, 212, 174, 136,
+ 3, 1, 244, 51, 136, 3, 1, 235, 144, 136, 3, 1, 220, 152, 136, 3, 1, 216,
+ 160, 61, 136, 3, 1, 233, 98, 230, 101, 7, 6, 1, 233, 171, 2, 51, 134, 7,
+ 3, 1, 233, 171, 2, 51, 134, 7, 6, 1, 233, 171, 2, 231, 37, 217, 42, 7, 6,
+ 1, 226, 230, 2, 90, 7, 6, 1, 224, 113, 2, 218, 27, 7, 3, 1, 118, 2, 90,
+ 7, 3, 1, 218, 100, 2, 247, 207, 90, 7, 6, 1, 242, 42, 2, 247, 246, 7, 3,
+ 1, 242, 42, 2, 247, 246, 7, 6, 1, 235, 28, 2, 247, 246, 7, 3, 1, 235, 28,
+ 2, 247, 246, 7, 6, 1, 212, 153, 2, 247, 246, 7, 3, 1, 212, 153, 2, 247,
+ 246, 7, 6, 1, 254, 52, 7, 6, 1, 232, 110, 2, 101, 7, 6, 1, 216, 58, 61,
+ 7, 6, 1, 216, 58, 254, 52, 7, 3, 1, 215, 80, 2, 46, 101, 7, 6, 1, 214,
+ 83, 2, 101, 7, 3, 1, 214, 83, 2, 101, 7, 3, 1, 215, 80, 2, 249, 41, 7, 6,
+ 1, 151, 242, 41, 7, 3, 1, 151, 242, 41, 7, 3, 1, 218, 25, 226, 9, 7, 3,
+ 1, 191, 2, 228, 161, 7, 3, 1, 216, 58, 224, 113, 2, 218, 27, 7, 3, 1,
+ 157, 2, 115, 223, 131, 235, 212, 7, 1, 3, 6, 216, 58, 74, 7, 219, 10, 3,
+ 1, 235, 142, 59, 1, 6, 215, 79, 7, 6, 1, 223, 4, 2, 218, 195, 218, 27, 7,
+ 6, 1, 212, 153, 2, 218, 195, 218, 27, 79, 6, 1, 254, 73, 79, 3, 1, 254,
+ 73, 79, 6, 1, 214, 151, 79, 3, 1, 214, 151, 79, 6, 1, 243, 83, 79, 3, 1,
+ 243, 83, 79, 6, 1, 248, 136, 79, 3, 1, 248, 136, 79, 6, 1, 245, 151, 79,
+ 3, 1, 245, 151, 79, 6, 1, 219, 220, 79, 3, 1, 219, 220, 79, 6, 1, 212,
+ 94, 79, 3, 1, 212, 94, 79, 6, 1, 241, 231, 79, 3, 1, 241, 231, 79, 6, 1,
+ 217, 130, 79, 3, 1, 217, 130, 79, 6, 1, 240, 109, 79, 3, 1, 240, 109, 79,
+ 6, 1, 234, 232, 79, 3, 1, 234, 232, 79, 6, 1, 233, 96, 79, 3, 1, 233, 96,
+ 79, 6, 1, 231, 42, 79, 3, 1, 231, 42, 79, 6, 1, 229, 64, 79, 3, 1, 229,
+ 64, 79, 6, 1, 233, 242, 79, 3, 1, 233, 242, 79, 6, 1, 75, 79, 3, 1, 75,
+ 79, 6, 1, 225, 240, 79, 3, 1, 225, 240, 79, 6, 1, 223, 112, 79, 3, 1,
+ 223, 112, 79, 6, 1, 220, 91, 79, 3, 1, 220, 91, 79, 6, 1, 217, 248, 79,
+ 3, 1, 217, 248, 79, 6, 1, 215, 196, 79, 3, 1, 215, 196, 79, 6, 1, 244,
+ 90, 79, 3, 1, 244, 90, 79, 6, 1, 234, 118, 79, 3, 1, 234, 118, 79, 6, 1,
+ 225, 46, 79, 3, 1, 225, 46, 79, 6, 1, 227, 44, 79, 3, 1, 227, 44, 79, 6,
+ 1, 247, 205, 254, 78, 79, 3, 1, 247, 205, 254, 78, 79, 6, 1, 53, 79, 254,
+ 103, 79, 3, 1, 53, 79, 254, 103, 79, 6, 1, 249, 55, 245, 151, 79, 3, 1,
+ 249, 55, 245, 151, 79, 6, 1, 247, 205, 234, 232, 79, 3, 1, 247, 205, 234,
+ 232, 79, 6, 1, 247, 205, 229, 64, 79, 3, 1, 247, 205, 229, 64, 79, 6, 1,
+ 249, 55, 229, 64, 79, 3, 1, 249, 55, 229, 64, 79, 6, 1, 53, 79, 227, 44,
+ 79, 3, 1, 53, 79, 227, 44, 79, 6, 1, 222, 161, 79, 3, 1, 222, 161, 79, 6,
+ 1, 249, 68, 220, 235, 79, 3, 1, 249, 68, 220, 235, 79, 6, 1, 53, 79, 220,
+ 235, 79, 3, 1, 53, 79, 220, 235, 79, 6, 1, 53, 79, 245, 40, 79, 3, 1, 53,
+ 79, 245, 40, 79, 6, 1, 254, 90, 234, 123, 79, 3, 1, 254, 90, 234, 123,
+ 79, 6, 1, 247, 205, 241, 32, 79, 3, 1, 247, 205, 241, 32, 79, 6, 1, 53,
+ 79, 241, 32, 79, 3, 1, 53, 79, 241, 32, 79, 6, 1, 53, 79, 159, 79, 3, 1,
+ 53, 79, 159, 79, 6, 1, 233, 170, 159, 79, 3, 1, 233, 170, 159, 79, 6, 1,
+ 53, 79, 241, 201, 79, 3, 1, 53, 79, 241, 201, 79, 6, 1, 53, 79, 241, 234,
+ 79, 3, 1, 53, 79, 241, 234, 79, 6, 1, 53, 79, 243, 78, 79, 3, 1, 53, 79,
+ 243, 78, 79, 6, 1, 53, 79, 247, 115, 79, 3, 1, 53, 79, 247, 115, 79, 6,
+ 1, 53, 79, 220, 202, 79, 3, 1, 53, 79, 220, 202, 79, 6, 1, 53, 228, 63,
+ 220, 202, 79, 3, 1, 53, 228, 63, 220, 202, 79, 6, 1, 53, 228, 63, 229,
+ 113, 79, 3, 1, 53, 228, 63, 229, 113, 79, 6, 1, 53, 228, 63, 228, 10, 79,
+ 3, 1, 53, 228, 63, 228, 10, 79, 6, 1, 53, 228, 63, 214, 21, 79, 3, 1, 53,
+ 228, 63, 214, 21, 79, 16, 234, 250, 79, 16, 231, 43, 223, 112, 79, 16,
+ 225, 241, 223, 112, 79, 16, 219, 87, 79, 16, 217, 249, 223, 112, 79, 16,
+ 234, 119, 223, 112, 79, 16, 220, 203, 220, 91, 79, 6, 1, 249, 55, 220,
+ 235, 79, 3, 1, 249, 55, 220, 235, 79, 6, 1, 249, 55, 243, 78, 79, 3, 1,
+ 249, 55, 243, 78, 79, 37, 229, 65, 49, 79, 37, 219, 179, 253, 139, 79,
+ 37, 219, 179, 233, 45, 79, 53, 228, 63, 243, 200, 219, 69, 79, 53, 228,
+ 63, 247, 149, 224, 158, 77, 79, 53, 228, 63, 235, 234, 224, 158, 77, 79,
+ 53, 228, 63, 214, 218, 247, 124, 79, 243, 228, 122, 242, 9, 79, 243, 200,
+ 219, 69, 79, 230, 194, 247, 124, 100, 3, 1, 254, 32, 100, 3, 1, 252, 71,
+ 100, 3, 1, 243, 82, 100, 3, 1, 247, 82, 100, 3, 1, 245, 108, 100, 3, 1,
+ 214, 141, 100, 3, 1, 212, 82, 100, 3, 1, 218, 11, 100, 3, 1, 235, 251,
+ 100, 3, 1, 234, 239, 100, 3, 1, 233, 104, 100, 3, 1, 231, 248, 100, 3, 1,
+ 230, 15, 100, 3, 1, 227, 62, 100, 3, 1, 226, 145, 100, 3, 1, 212, 71,
+ 100, 3, 1, 224, 61, 100, 3, 1, 222, 159, 100, 3, 1, 218, 1, 100, 3, 1,
+ 215, 160, 100, 3, 1, 226, 16, 100, 3, 1, 234, 127, 100, 3, 1, 242, 217,
+ 100, 3, 1, 224, 217, 100, 3, 1, 220, 200, 100, 3, 1, 250, 34, 100, 3, 1,
+ 250, 195, 100, 3, 1, 235, 103, 100, 3, 1, 249, 233, 100, 3, 1, 250, 79,
+ 100, 3, 1, 213, 151, 100, 3, 1, 235, 113, 100, 3, 1, 242, 24, 100, 3, 1,
+ 241, 222, 100, 3, 1, 241, 160, 100, 3, 1, 214, 6, 100, 3, 1, 241, 243,
+ 100, 3, 1, 241, 51, 217, 62, 1, 186, 217, 62, 1, 213, 87, 217, 62, 1,
+ 213, 86, 217, 62, 1, 213, 76, 217, 62, 1, 213, 74, 217, 62, 1, 251, 209,
+ 254, 176, 213, 70, 217, 62, 1, 213, 70, 217, 62, 1, 213, 84, 217, 62, 1,
+ 213, 81, 217, 62, 1, 213, 83, 217, 62, 1, 213, 82, 217, 62, 1, 213, 3,
+ 217, 62, 1, 213, 78, 217, 62, 1, 213, 68, 217, 62, 1, 216, 79, 213, 68,
+ 217, 62, 1, 213, 65, 217, 62, 1, 213, 72, 217, 62, 1, 251, 209, 254, 176,
+ 213, 72, 217, 62, 1, 216, 79, 213, 72, 217, 62, 1, 213, 71, 217, 62, 1,
+ 213, 91, 217, 62, 1, 213, 66, 217, 62, 1, 216, 79, 213, 66, 217, 62, 1,
+ 213, 56, 217, 62, 1, 216, 79, 213, 56, 217, 62, 1, 212, 255, 217, 62, 1,
+ 213, 40, 217, 62, 1, 254, 112, 213, 40, 217, 62, 1, 216, 79, 213, 40,
+ 217, 62, 1, 213, 64, 217, 62, 1, 213, 63, 217, 62, 1, 213, 60, 217, 62,
+ 1, 216, 79, 213, 73, 217, 62, 1, 216, 79, 213, 58, 217, 62, 1, 213, 57,
+ 217, 62, 1, 212, 203, 217, 62, 1, 213, 54, 217, 62, 1, 213, 53, 217, 62,
+ 1, 213, 75, 217, 62, 1, 216, 79, 213, 75, 217, 62, 1, 253, 79, 213, 75,
+ 217, 62, 1, 213, 52, 217, 62, 1, 213, 50, 217, 62, 1, 213, 51, 217, 62,
+ 1, 213, 49, 217, 62, 1, 213, 48, 217, 62, 1, 213, 85, 217, 62, 1, 213,
+ 46, 217, 62, 1, 213, 45, 217, 62, 1, 213, 44, 217, 62, 1, 213, 43, 217,
+ 62, 1, 213, 41, 217, 62, 1, 217, 241, 213, 41, 217, 62, 1, 213, 39, 217,
+ 62, 59, 1, 233, 149, 77, 217, 62, 221, 58, 77, 217, 62, 249, 133, 235,
+ 66, 28, 4, 232, 207, 28, 4, 230, 230, 28, 4, 223, 110, 28, 4, 219, 241,
+ 28, 4, 220, 186, 28, 4, 251, 127, 28, 4, 216, 252, 28, 4, 249, 174, 28,
+ 4, 228, 183, 28, 4, 227, 252, 28, 4, 242, 156, 227, 120, 28, 4, 212, 15,
+ 28, 4, 247, 97, 28, 4, 248, 55, 28, 4, 235, 70, 28, 4, 217, 108, 28, 4,
+ 250, 22, 28, 4, 225, 252, 28, 4, 225, 149, 28, 4, 242, 231, 28, 4, 242,
+ 227, 28, 4, 242, 228, 28, 4, 242, 229, 28, 4, 219, 157, 28, 4, 219, 117,
+ 28, 4, 219, 128, 28, 4, 219, 156, 28, 4, 219, 132, 28, 4, 219, 133, 28,
+ 4, 219, 121, 28, 4, 250, 146, 28, 4, 250, 126, 28, 4, 250, 128, 28, 4,
+ 250, 145, 28, 4, 250, 143, 28, 4, 250, 144, 28, 4, 250, 127, 28, 4, 211,
+ 242, 28, 4, 211, 222, 28, 4, 211, 233, 28, 4, 211, 241, 28, 4, 211, 236,
+ 28, 4, 211, 237, 28, 4, 211, 225, 28, 4, 250, 142, 28, 4, 250, 129, 28,
+ 4, 250, 131, 28, 4, 250, 141, 28, 4, 250, 139, 28, 4, 250, 140, 28, 4,
+ 250, 130, 28, 4, 224, 125, 28, 4, 224, 115, 28, 4, 224, 121, 28, 4, 224,
+ 124, 28, 4, 224, 122, 28, 4, 224, 123, 28, 4, 224, 120, 28, 4, 233, 181,
+ 28, 4, 233, 173, 28, 4, 233, 176, 28, 4, 233, 180, 28, 4, 233, 177, 28,
+ 4, 233, 178, 28, 4, 233, 174, 28, 4, 213, 118, 28, 4, 213, 108, 28, 4,
+ 213, 114, 28, 4, 213, 117, 28, 4, 213, 115, 28, 4, 213, 116, 28, 4, 213,
+ 113, 28, 4, 242, 52, 28, 4, 242, 43, 28, 4, 242, 46, 28, 4, 242, 51, 28,
+ 4, 242, 48, 28, 4, 242, 49, 28, 4, 242, 45, 37, 33, 1, 251, 251, 37, 33,
+ 1, 214, 232, 37, 33, 1, 242, 212, 37, 33, 1, 248, 41, 37, 33, 1, 212, 67,
+ 37, 33, 1, 212, 87, 37, 33, 1, 181, 37, 33, 1, 245, 131, 37, 33, 1, 245,
+ 117, 37, 33, 1, 245, 108, 37, 33, 1, 75, 37, 33, 1, 226, 96, 37, 33, 1,
+ 245, 55, 37, 33, 1, 245, 45, 37, 33, 1, 217, 229, 37, 33, 1, 159, 37, 33,
+ 1, 216, 136, 37, 33, 1, 250, 67, 37, 33, 1, 221, 24, 37, 33, 1, 220, 245,
+ 37, 33, 1, 244, 51, 37, 33, 1, 245, 44, 37, 33, 1, 61, 37, 33, 1, 236,
+ 55, 37, 33, 1, 247, 113, 37, 33, 1, 230, 210, 215, 175, 37, 33, 1, 213,
+ 49, 37, 33, 1, 212, 203, 37, 33, 1, 235, 181, 61, 37, 33, 1, 232, 221,
+ 212, 174, 37, 33, 1, 251, 172, 212, 174, 37, 33, 1, 235, 181, 251, 172,
+ 212, 174, 46, 254, 19, 219, 5, 231, 217, 46, 254, 19, 246, 72, 219, 5,
+ 231, 217, 42, 219, 5, 125, 46, 219, 5, 125, 42, 246, 72, 219, 5, 125, 46,
+ 246, 72, 219, 5, 125, 224, 48, 235, 199, 231, 217, 224, 48, 246, 72, 235,
+ 199, 231, 217, 246, 72, 216, 199, 231, 217, 42, 216, 199, 125, 46, 216,
+ 199, 125, 224, 48, 219, 166, 42, 224, 48, 227, 64, 125, 46, 224, 48, 227,
+ 64, 125, 245, 166, 249, 97, 226, 141, 243, 247, 226, 141, 223, 202, 243,
+ 247, 226, 141, 240, 157, 246, 72, 227, 115, 246, 58, 254, 28, 215, 124,
+ 254, 28, 246, 72, 223, 144, 254, 18, 51, 227, 112, 240, 160, 235, 191,
+ 235, 198, 226, 186, 251, 81, 240, 161, 2, 247, 209, 217, 43, 2, 223, 131,
+ 49, 42, 115, 226, 133, 125, 46, 115, 226, 133, 125, 217, 43, 2, 62, 49,
+ 217, 43, 2, 62, 55, 42, 71, 252, 60, 2, 224, 152, 46, 71, 252, 60, 2,
+ 224, 152, 216, 227, 42, 151, 125, 216, 227, 46, 151, 125, 251, 101, 42,
+ 151, 125, 251, 101, 46, 151, 125, 42, 220, 113, 111, 125, 46, 220, 113,
+ 111, 125, 42, 51, 226, 131, 46, 51, 226, 131, 117, 176, 110, 122, 62,
+ 225, 26, 122, 62, 110, 117, 176, 225, 26, 91, 243, 237, 62, 225, 26, 244,
+ 50, 62, 77, 223, 202, 224, 158, 77, 71, 217, 42, 223, 131, 225, 144, 213,
+ 196, 221, 58, 231, 37, 247, 74, 9, 34, 223, 227, 9, 34, 249, 203, 9, 34,
+ 222, 95, 116, 9, 34, 222, 95, 109, 9, 34, 222, 95, 166, 9, 34, 226, 43,
+ 9, 34, 251, 89, 9, 34, 218, 40, 9, 34, 234, 42, 116, 9, 34, 234, 42, 109,
+ 9, 34, 247, 122, 9, 34, 222, 98, 9, 34, 3, 116, 9, 34, 3, 109, 9, 34,
+ 233, 121, 116, 9, 34, 233, 121, 109, 9, 34, 233, 121, 166, 9, 34, 233,
+ 121, 163, 9, 34, 219, 252, 9, 34, 217, 98, 9, 34, 219, 250, 116, 9, 34,
+ 219, 250, 109, 9, 34, 241, 212, 116, 9, 34, 241, 212, 109, 9, 34, 241,
+ 254, 9, 34, 224, 39, 9, 34, 250, 19, 9, 34, 218, 238, 9, 34, 230, 198, 9,
+ 34, 248, 39, 9, 34, 230, 190, 9, 34, 249, 218, 9, 34, 214, 25, 116, 9,
+ 34, 214, 25, 109, 9, 34, 244, 65, 9, 34, 226, 106, 116, 9, 34, 226, 106,
+ 109, 9, 34, 220, 86, 151, 216, 194, 216, 146, 9, 34, 249, 84, 9, 34, 247,
+ 90, 9, 34, 235, 135, 9, 34, 251, 122, 65, 249, 187, 9, 34, 244, 239, 9,
+ 34, 219, 181, 116, 9, 34, 219, 181, 109, 9, 34, 252, 73, 9, 34, 220, 93,
+ 9, 34, 250, 249, 220, 93, 9, 34, 229, 172, 116, 9, 34, 229, 172, 109, 9,
+ 34, 229, 172, 166, 9, 34, 229, 172, 163, 9, 34, 231, 111, 9, 34, 220,
+ 237, 9, 34, 224, 45, 9, 34, 245, 4, 9, 34, 227, 75, 9, 34, 251, 61, 116,
+ 9, 34, 251, 61, 109, 9, 34, 231, 151, 9, 34, 230, 193, 9, 34, 242, 117,
+ 116, 9, 34, 242, 117, 109, 9, 34, 242, 117, 166, 9, 34, 217, 60, 9, 34,
+ 249, 186, 9, 34, 213, 250, 116, 9, 34, 213, 250, 109, 9, 34, 250, 249,
+ 222, 89, 9, 34, 220, 86, 240, 235, 9, 34, 240, 235, 9, 34, 250, 249, 219,
+ 190, 9, 34, 250, 249, 220, 232, 9, 34, 244, 1, 9, 34, 250, 249, 250, 160,
+ 9, 34, 220, 86, 214, 41, 9, 34, 214, 42, 116, 9, 34, 214, 42, 109, 9, 34,
+ 249, 220, 9, 34, 250, 249, 242, 142, 9, 34, 184, 116, 9, 34, 184, 109, 9,
+ 34, 250, 249, 232, 190, 9, 34, 250, 249, 243, 64, 9, 34, 230, 189, 116,
+ 9, 34, 230, 189, 109, 9, 34, 224, 50, 9, 34, 251, 130, 9, 34, 250, 249,
+ 218, 7, 233, 76, 9, 34, 250, 249, 233, 77, 9, 34, 250, 249, 213, 224, 9,
+ 34, 250, 249, 244, 15, 9, 34, 245, 174, 116, 9, 34, 245, 174, 109, 9, 34,
+ 245, 174, 166, 9, 34, 250, 249, 245, 173, 9, 34, 241, 219, 9, 34, 250,
+ 249, 240, 232, 9, 34, 251, 119, 9, 34, 242, 198, 9, 34, 250, 249, 244,
+ 59, 9, 34, 250, 249, 251, 160, 9, 34, 250, 249, 222, 172, 9, 34, 220, 86,
+ 213, 243, 9, 34, 220, 86, 213, 32, 9, 34, 250, 249, 243, 214, 9, 34, 235,
+ 141, 245, 8, 9, 34, 250, 249, 245, 8, 9, 34, 235, 141, 216, 228, 9, 34,
+ 250, 249, 216, 228, 9, 34, 235, 141, 246, 50, 9, 34, 250, 249, 246, 50,
+ 9, 34, 216, 55, 9, 34, 235, 141, 216, 55, 9, 34, 250, 249, 216, 55, 57,
+ 34, 116, 57, 34, 232, 242, 57, 34, 247, 74, 57, 34, 220, 23, 57, 34, 222,
+ 94, 57, 34, 101, 57, 34, 109, 57, 34, 233, 9, 57, 34, 231, 248, 57, 34,
+ 233, 57, 57, 34, 245, 88, 57, 34, 195, 57, 34, 119, 251, 89, 57, 34, 249,
+ 86, 57, 34, 240, 104, 57, 34, 218, 40, 57, 34, 227, 40, 251, 89, 57, 34,
+ 234, 41, 57, 34, 225, 104, 57, 34, 213, 190, 57, 34, 219, 175, 57, 34,
+ 46, 227, 40, 251, 89, 57, 34, 241, 161, 245, 103, 57, 34, 217, 200, 57,
+ 34, 247, 122, 57, 34, 222, 98, 57, 34, 249, 203, 57, 34, 225, 65, 57, 34,
+ 254, 120, 57, 34, 230, 180, 57, 34, 245, 103, 57, 34, 245, 179, 57, 34,
+ 222, 118, 57, 34, 242, 150, 57, 34, 242, 151, 220, 9, 57, 34, 245, 7, 57,
+ 34, 251, 171, 57, 34, 213, 208, 57, 34, 250, 38, 57, 34, 223, 98, 57, 34,
+ 235, 247, 57, 34, 220, 7, 57, 34, 233, 120, 57, 34, 249, 95, 57, 34, 219,
+ 169, 57, 34, 230, 185, 57, 34, 223, 121, 57, 34, 213, 193, 57, 34, 227,
+ 56, 57, 34, 216, 61, 57, 34, 246, 35, 57, 34, 220, 175, 217, 98, 57, 34,
+ 246, 72, 249, 203, 57, 34, 184, 219, 48, 57, 34, 117, 241, 249, 57, 34,
+ 220, 180, 57, 34, 251, 95, 57, 34, 219, 249, 57, 34, 251, 65, 57, 34,
+ 219, 78, 57, 34, 241, 211, 57, 34, 242, 10, 57, 34, 247, 77, 57, 34, 241,
+ 254, 57, 34, 251, 81, 57, 34, 224, 39, 57, 34, 222, 106, 57, 34, 247,
+ 151, 57, 34, 253, 84, 57, 34, 219, 166, 57, 34, 228, 162, 57, 34, 218,
+ 238, 57, 34, 222, 129, 57, 34, 230, 198, 57, 34, 216, 193, 57, 34, 233,
+ 145, 57, 34, 219, 69, 57, 34, 248, 39, 57, 34, 214, 5, 57, 34, 247, 100,
+ 228, 162, 57, 34, 249, 154, 57, 34, 243, 194, 57, 34, 249, 214, 57, 34,
+ 219, 82, 57, 34, 214, 24, 57, 34, 244, 65, 57, 34, 249, 211, 57, 34, 244,
+ 129, 57, 34, 51, 213, 166, 57, 34, 151, 216, 194, 216, 146, 57, 34, 220,
+ 17, 57, 34, 244, 139, 57, 34, 249, 84, 57, 34, 247, 90, 57, 34, 225, 62,
+ 57, 34, 235, 135, 57, 34, 231, 131, 57, 34, 217, 41, 57, 34, 218, 190,
+ 57, 34, 233, 3, 57, 34, 215, 103, 57, 34, 244, 89, 57, 34, 251, 122, 65,
+ 249, 187, 57, 34, 220, 114, 57, 34, 246, 72, 217, 195, 57, 34, 213, 238,
+ 57, 34, 220, 31, 57, 34, 247, 139, 57, 34, 244, 239, 57, 34, 219, 193,
+ 57, 34, 68, 57, 34, 219, 71, 57, 34, 219, 180, 57, 34, 216, 212, 57, 34,
+ 242, 123, 57, 34, 250, 151, 57, 34, 219, 99, 57, 34, 252, 73, 57, 34,
+ 223, 184, 57, 34, 220, 93, 57, 34, 235, 130, 57, 34, 229, 171, 57, 34,
+ 220, 237, 57, 34, 244, 118, 57, 34, 227, 75, 57, 34, 254, 27, 57, 34,
+ 225, 162, 57, 34, 245, 183, 57, 34, 251, 60, 57, 34, 231, 151, 57, 34,
+ 230, 252, 57, 34, 221, 76, 57, 34, 253, 167, 57, 34, 230, 193, 57, 34,
+ 216, 232, 57, 34, 227, 31, 57, 34, 251, 124, 57, 34, 219, 67, 57, 34,
+ 249, 163, 57, 34, 242, 116, 57, 34, 217, 60, 57, 34, 235, 214, 57, 34,
+ 251, 134, 57, 34, 214, 42, 245, 103, 57, 34, 249, 186, 57, 34, 213, 249,
+ 57, 34, 222, 89, 57, 34, 240, 235, 57, 34, 219, 190, 57, 34, 214, 254,
+ 57, 34, 251, 248, 57, 34, 225, 205, 57, 34, 252, 92, 57, 34, 220, 232,
+ 57, 34, 224, 3, 57, 34, 223, 37, 57, 34, 244, 1, 57, 34, 251, 123, 57,
+ 34, 250, 160, 57, 34, 251, 149, 57, 34, 230, 195, 57, 34, 214, 41, 57,
+ 34, 249, 220, 57, 34, 213, 221, 57, 34, 247, 132, 57, 34, 214, 142, 57,
+ 34, 242, 142, 57, 34, 232, 190, 57, 34, 243, 64, 57, 34, 230, 188, 57,
+ 34, 220, 22, 57, 34, 220, 175, 218, 26, 251, 160, 57, 34, 224, 50, 57,
+ 34, 251, 130, 57, 34, 213, 185, 57, 34, 244, 158, 57, 34, 233, 76, 57,
+ 34, 218, 7, 233, 76, 57, 34, 233, 72, 57, 34, 219, 217, 57, 34, 233, 77,
+ 57, 34, 213, 224, 57, 34, 244, 15, 57, 34, 245, 173, 57, 34, 241, 219,
+ 57, 34, 243, 226, 57, 34, 240, 232, 57, 34, 251, 119, 57, 34, 218, 14,
+ 57, 34, 242, 16, 57, 34, 244, 82, 57, 34, 222, 197, 213, 221, 57, 34,
+ 250, 153, 57, 34, 242, 198, 57, 34, 244, 59, 57, 34, 251, 160, 57, 34,
+ 222, 172, 57, 34, 248, 25, 57, 34, 213, 243, 57, 34, 241, 194, 57, 34,
+ 213, 32, 57, 34, 231, 5, 57, 34, 251, 144, 57, 34, 245, 113, 57, 34, 243,
+ 214, 57, 34, 216, 167, 57, 34, 246, 37, 57, 34, 224, 33, 57, 34, 228,
+ 164, 57, 34, 245, 8, 57, 34, 216, 228, 57, 34, 246, 50, 57, 34, 216, 55,
+ 57, 34, 244, 17, 105, 247, 244, 137, 42, 211, 211, 223, 148, 105, 247,
+ 244, 137, 78, 211, 211, 55, 105, 247, 244, 137, 42, 211, 211, 231, 37,
+ 24, 223, 148, 105, 247, 244, 137, 78, 211, 211, 231, 37, 24, 55, 105,
+ 247, 244, 137, 243, 200, 218, 210, 105, 247, 244, 137, 218, 211, 243,
+ 213, 49, 105, 247, 244, 137, 218, 211, 243, 213, 55, 105, 247, 244, 137,
+ 218, 211, 243, 213, 233, 70, 105, 247, 244, 137, 218, 211, 243, 213, 215,
+ 131, 233, 70, 105, 247, 244, 137, 218, 211, 243, 213, 215, 131, 223, 148,
+ 105, 247, 244, 137, 218, 211, 243, 213, 232, 163, 233, 70, 105, 247, 244,
+ 137, 226, 246, 105, 219, 206, 105, 249, 157, 105, 243, 200, 219, 69, 247,
+ 129, 77, 235, 131, 235, 233, 219, 98, 87, 105, 235, 156, 77, 105, 249,
+ 189, 77, 105, 50, 212, 79, 42, 254, 19, 125, 46, 254, 19, 125, 42, 51,
+ 254, 19, 125, 46, 51, 254, 19, 125, 42, 249, 100, 125, 46, 249, 100, 125,
+ 42, 67, 249, 100, 125, 46, 67, 249, 100, 125, 42, 83, 233, 44, 125, 46,
+ 83, 233, 44, 125, 225, 117, 77, 243, 8, 77, 42, 216, 219, 220, 233, 125,
+ 46, 216, 219, 220, 233, 125, 42, 67, 233, 44, 125, 46, 67, 233, 44, 125,
+ 42, 67, 216, 219, 220, 233, 125, 46, 67, 216, 219, 220, 233, 125, 42, 67,
+ 41, 125, 46, 67, 41, 125, 214, 20, 248, 101, 223, 202, 51, 225, 72, 224,
+ 143, 77, 51, 225, 72, 224, 143, 77, 115, 51, 225, 72, 224, 143, 77, 225,
+ 117, 152, 244, 158, 241, 247, 228, 54, 116, 241, 247, 228, 54, 109, 241,
+ 247, 228, 54, 166, 241, 247, 228, 54, 163, 241, 247, 228, 54, 180, 241,
+ 247, 228, 54, 189, 241, 247, 228, 54, 198, 241, 247, 228, 54, 195, 241,
+ 247, 228, 54, 200, 105, 233, 29, 160, 77, 105, 223, 125, 160, 77, 105,
+ 247, 251, 160, 77, 105, 245, 87, 160, 77, 23, 220, 81, 62, 160, 77, 23,
+ 51, 62, 160, 77, 214, 16, 248, 101, 71, 234, 238, 223, 228, 77, 71, 234,
+ 238, 223, 228, 2, 214, 116, 219, 218, 77, 71, 234, 238, 223, 228, 152,
+ 215, 131, 242, 9, 71, 234, 238, 223, 228, 2, 214, 116, 219, 218, 152,
+ 215, 131, 242, 9, 71, 234, 238, 223, 228, 152, 232, 163, 242, 9, 36, 225,
+ 117, 77, 105, 201, 232, 243, 244, 115, 221, 58, 87, 241, 247, 228, 54,
+ 217, 200, 241, 247, 228, 54, 216, 38, 241, 247, 228, 54, 217, 115, 71,
+ 105, 235, 156, 77, 231, 203, 77, 226, 127, 254, 49, 77, 105, 43, 235,
+ 235, 105, 151, 244, 75, 219, 206, 142, 1, 3, 61, 142, 1, 61, 142, 1, 3,
+ 72, 142, 1, 72, 142, 1, 3, 69, 142, 1, 69, 142, 1, 3, 74, 142, 1, 74,
+ 142, 1, 3, 75, 142, 1, 75, 142, 1, 181, 142, 1, 243, 110, 142, 1, 234,
+ 101, 142, 1, 242, 190, 142, 1, 233, 238, 142, 1, 242, 92, 142, 1, 234,
+ 188, 142, 1, 243, 38, 142, 1, 234, 37, 142, 1, 242, 150, 142, 1, 222,
+ 202, 142, 1, 212, 109, 142, 1, 220, 117, 142, 1, 212, 37, 142, 1, 219,
+ 27, 142, 1, 212, 8, 142, 1, 222, 100, 142, 1, 212, 87, 142, 1, 219, 242,
+ 142, 1, 212, 16, 142, 1, 218, 52, 142, 1, 248, 164, 142, 1, 217, 71, 142,
+ 1, 247, 211, 142, 1, 3, 216, 82, 142, 1, 216, 82, 142, 1, 246, 33, 142,
+ 1, 217, 229, 142, 1, 248, 41, 142, 1, 108, 142, 1, 247, 99, 142, 1, 205,
+ 142, 1, 229, 64, 142, 1, 228, 92, 142, 1, 229, 187, 142, 1, 228, 185,
+ 142, 1, 159, 142, 1, 252, 107, 142, 1, 193, 142, 1, 241, 165, 142, 1,
+ 251, 184, 142, 1, 225, 240, 142, 1, 240, 212, 142, 1, 251, 54, 142, 1,
+ 225, 35, 142, 1, 241, 222, 142, 1, 251, 251, 142, 1, 226, 96, 142, 1,
+ 241, 54, 142, 1, 251, 128, 142, 1, 225, 150, 142, 1, 188, 142, 1, 231,
+ 42, 142, 1, 230, 172, 142, 1, 231, 156, 142, 1, 230, 231, 142, 1, 3, 186,
+ 142, 1, 186, 142, 1, 3, 212, 203, 142, 1, 212, 203, 142, 1, 3, 212, 235,
+ 142, 1, 212, 235, 142, 1, 203, 142, 1, 223, 188, 142, 1, 223, 51, 142, 1,
+ 224, 21, 142, 1, 223, 112, 142, 1, 3, 214, 49, 142, 1, 214, 49, 142, 1,
+ 213, 235, 142, 1, 214, 6, 142, 1, 213, 214, 142, 1, 204, 142, 1, 214, 99,
+ 142, 1, 3, 181, 142, 1, 3, 234, 188, 37, 234, 206, 214, 116, 219, 218,
+ 77, 37, 234, 206, 221, 75, 219, 218, 77, 234, 206, 214, 116, 219, 218,
+ 77, 234, 206, 221, 75, 219, 218, 77, 142, 235, 156, 77, 142, 214, 116,
+ 235, 156, 77, 142, 247, 173, 212, 216, 234, 206, 51, 240, 160, 56, 1, 3,
+ 61, 56, 1, 61, 56, 1, 3, 72, 56, 1, 72, 56, 1, 3, 69, 56, 1, 69, 56, 1,
+ 3, 74, 56, 1, 74, 56, 1, 3, 75, 56, 1, 75, 56, 1, 181, 56, 1, 243, 110,
+ 56, 1, 234, 101, 56, 1, 242, 190, 56, 1, 233, 238, 56, 1, 242, 92, 56, 1,
+ 234, 188, 56, 1, 243, 38, 56, 1, 234, 37, 56, 1, 242, 150, 56, 1, 222,
+ 202, 56, 1, 212, 109, 56, 1, 220, 117, 56, 1, 212, 37, 56, 1, 219, 27,
+ 56, 1, 212, 8, 56, 1, 222, 100, 56, 1, 212, 87, 56, 1, 219, 242, 56, 1,
+ 212, 16, 56, 1, 218, 52, 56, 1, 248, 164, 56, 1, 217, 71, 56, 1, 247,
+ 211, 56, 1, 3, 216, 82, 56, 1, 216, 82, 56, 1, 246, 33, 56, 1, 217, 229,
+ 56, 1, 248, 41, 56, 1, 108, 56, 1, 247, 99, 56, 1, 205, 56, 1, 229, 64,
+ 56, 1, 228, 92, 56, 1, 229, 187, 56, 1, 228, 185, 56, 1, 159, 56, 1, 252,
+ 107, 56, 1, 193, 56, 1, 241, 165, 56, 1, 251, 184, 56, 1, 225, 240, 56,
+ 1, 240, 212, 56, 1, 251, 54, 56, 1, 225, 35, 56, 1, 241, 222, 56, 1, 251,
+ 251, 56, 1, 226, 96, 56, 1, 241, 54, 56, 1, 251, 128, 56, 1, 225, 150,
+ 56, 1, 188, 56, 1, 231, 42, 56, 1, 230, 172, 56, 1, 231, 156, 56, 1, 230,
+ 231, 56, 1, 3, 186, 56, 1, 186, 56, 1, 3, 212, 203, 56, 1, 212, 203, 56,
+ 1, 3, 212, 235, 56, 1, 212, 235, 56, 1, 203, 56, 1, 223, 188, 56, 1, 223,
+ 51, 56, 1, 224, 21, 56, 1, 223, 112, 56, 1, 3, 214, 49, 56, 1, 214, 49,
+ 56, 1, 213, 235, 56, 1, 214, 6, 56, 1, 213, 214, 56, 1, 204, 56, 1, 214,
+ 99, 56, 1, 3, 181, 56, 1, 3, 234, 188, 56, 1, 215, 1, 56, 1, 214, 154,
+ 56, 1, 214, 232, 56, 1, 214, 119, 56, 231, 37, 247, 74, 234, 206, 225,
+ 57, 219, 218, 77, 56, 235, 156, 77, 56, 214, 116, 235, 156, 77, 56, 247,
+ 173, 234, 8, 202, 1, 253, 74, 202, 1, 226, 229, 202, 1, 183, 202, 1, 244,
+ 230, 202, 1, 249, 3, 202, 1, 218, 99, 202, 1, 204, 202, 1, 150, 202, 1,
+ 243, 177, 202, 1, 235, 27, 202, 1, 242, 41, 202, 1, 235, 142, 202, 1,
+ 224, 240, 202, 1, 213, 166, 202, 1, 212, 76, 202, 1, 250, 93, 202, 1,
+ 221, 26, 202, 1, 149, 202, 1, 212, 152, 202, 1, 250, 252, 202, 1, 197,
+ 202, 1, 61, 202, 1, 75, 202, 1, 74, 202, 1, 245, 154, 202, 1, 254, 108,
+ 202, 1, 245, 152, 202, 1, 253, 108, 202, 1, 227, 2, 202, 1, 254, 32, 202,
+ 1, 245, 108, 202, 1, 254, 24, 202, 1, 245, 96, 202, 1, 245, 55, 202, 1,
+ 72, 202, 1, 69, 202, 1, 235, 154, 202, 1, 215, 79, 202, 1, 229, 161, 202,
+ 1, 242, 154, 202, 1, 236, 29, 23, 1, 234, 67, 23, 1, 219, 150, 23, 1,
+ 234, 60, 23, 1, 229, 57, 23, 1, 229, 55, 23, 1, 229, 54, 23, 1, 217, 55,
+ 23, 1, 219, 139, 23, 1, 223, 179, 23, 1, 223, 174, 23, 1, 223, 171, 23,
+ 1, 223, 164, 23, 1, 223, 159, 23, 1, 223, 154, 23, 1, 223, 165, 23, 1,
+ 223, 177, 23, 1, 231, 30, 23, 1, 225, 227, 23, 1, 219, 147, 23, 1, 225,
+ 216, 23, 1, 220, 76, 23, 1, 219, 144, 23, 1, 236, 51, 23, 1, 249, 239,
+ 23, 1, 219, 154, 23, 1, 250, 43, 23, 1, 234, 116, 23, 1, 217, 126, 23, 1,
+ 226, 7, 23, 1, 241, 158, 23, 1, 61, 23, 1, 254, 148, 23, 1, 186, 23, 1,
+ 213, 80, 23, 1, 245, 76, 23, 1, 74, 23, 1, 213, 27, 23, 1, 213, 38, 23,
+ 1, 75, 23, 1, 214, 49, 23, 1, 214, 46, 23, 1, 227, 99, 23, 1, 212, 235,
+ 23, 1, 69, 23, 1, 213, 252, 23, 1, 214, 6, 23, 1, 213, 235, 23, 1, 212,
+ 203, 23, 1, 245, 22, 23, 1, 212, 255, 23, 1, 72, 23, 244, 72, 23, 1, 219,
+ 148, 23, 1, 229, 47, 23, 1, 229, 49, 23, 1, 229, 52, 23, 1, 223, 172, 23,
+ 1, 223, 153, 23, 1, 223, 161, 23, 1, 223, 166, 23, 1, 223, 151, 23, 1,
+ 231, 23, 23, 1, 231, 20, 23, 1, 231, 24, 23, 1, 234, 226, 23, 1, 225,
+ 222, 23, 1, 225, 208, 23, 1, 225, 214, 23, 1, 225, 211, 23, 1, 225, 225,
+ 23, 1, 225, 209, 23, 1, 234, 224, 23, 1, 234, 222, 23, 1, 220, 69, 23, 1,
+ 220, 67, 23, 1, 220, 59, 23, 1, 220, 64, 23, 1, 220, 74, 23, 1, 226, 160,
+ 23, 1, 219, 151, 23, 1, 213, 17, 23, 1, 213, 13, 23, 1, 213, 14, 23, 1,
+ 234, 225, 23, 1, 219, 152, 23, 1, 213, 23, 23, 1, 212, 229, 23, 1, 212,
+ 228, 23, 1, 212, 231, 23, 1, 212, 194, 23, 1, 212, 195, 23, 1, 212, 198,
+ 23, 1, 253, 204, 23, 1, 253, 198, 105, 254, 10, 232, 232, 77, 105, 254,
+ 10, 223, 203, 77, 105, 254, 10, 122, 77, 105, 254, 10, 117, 77, 105, 254,
+ 10, 133, 77, 105, 254, 10, 243, 237, 77, 105, 254, 10, 216, 227, 77, 105,
+ 254, 10, 231, 37, 77, 105, 254, 10, 251, 101, 77, 105, 254, 10, 244, 61,
+ 77, 105, 254, 10, 222, 95, 77, 105, 254, 10, 217, 122, 77, 105, 254, 10,
+ 243, 230, 77, 105, 254, 10, 241, 208, 77, 105, 254, 10, 245, 180, 77,
+ 105, 254, 10, 231, 249, 77, 202, 1, 251, 54, 202, 1, 212, 37, 202, 1,
+ 235, 110, 202, 1, 242, 92, 202, 1, 245, 165, 202, 1, 245, 93, 202, 1,
+ 227, 49, 202, 1, 227, 53, 202, 1, 235, 177, 202, 1, 254, 12, 202, 1, 235,
+ 221, 202, 1, 215, 139, 202, 1, 236, 11, 202, 1, 229, 142, 202, 1, 254,
+ 102, 202, 1, 253, 103, 202, 1, 254, 45, 202, 1, 227, 70, 202, 1, 227, 55,
+ 202, 1, 235, 218, 202, 40, 1, 226, 229, 202, 40, 1, 218, 99, 202, 40, 1,
+ 235, 27, 202, 40, 1, 242, 41, 202, 1, 242, 226, 202, 1, 233, 26, 202, 1,
+ 211, 249, 9, 219, 45, 218, 99, 9, 219, 45, 213, 245, 9, 219, 45, 213,
+ 146, 9, 219, 45, 251, 8, 9, 219, 45, 218, 199, 9, 219, 45, 240, 150, 9,
+ 219, 45, 240, 154, 9, 219, 45, 240, 218, 9, 219, 45, 240, 151, 9, 219,
+ 45, 218, 102, 9, 219, 45, 240, 153, 9, 219, 45, 240, 149, 9, 219, 45,
+ 240, 216, 9, 219, 45, 240, 152, 9, 219, 45, 240, 148, 9, 219, 45, 204, 9,
+ 219, 45, 242, 41, 9, 219, 45, 197, 9, 219, 45, 226, 229, 9, 219, 45, 219,
+ 208, 9, 219, 45, 249, 3, 9, 219, 45, 240, 155, 9, 219, 45, 241, 175, 9,
+ 219, 45, 218, 111, 9, 219, 45, 218, 178, 9, 219, 45, 219, 107, 9, 219,
+ 45, 221, 31, 9, 219, 45, 226, 98, 9, 219, 45, 224, 242, 9, 219, 45, 216,
+ 253, 9, 219, 45, 218, 101, 9, 219, 45, 218, 189, 9, 219, 45, 240, 162, 9,
+ 219, 45, 240, 147, 9, 219, 45, 226, 25, 9, 219, 45, 224, 240, 56, 1, 3,
+ 233, 238, 56, 1, 3, 220, 117, 56, 1, 3, 219, 27, 56, 1, 3, 108, 56, 1, 3,
+ 228, 92, 56, 1, 3, 159, 56, 1, 3, 241, 165, 56, 1, 3, 240, 212, 56, 1, 3,
+ 241, 222, 56, 1, 3, 241, 54, 56, 1, 3, 230, 172, 56, 1, 3, 203, 56, 1, 3,
+ 223, 188, 56, 1, 3, 223, 51, 56, 1, 3, 224, 21, 56, 1, 3, 223, 112, 86,
+ 23, 234, 67, 86, 23, 229, 57, 86, 23, 217, 55, 86, 23, 223, 179, 86, 23,
+ 231, 30, 86, 23, 225, 227, 86, 23, 220, 76, 86, 23, 236, 51, 86, 23, 249,
+ 239, 86, 23, 250, 43, 86, 23, 234, 116, 86, 23, 217, 126, 86, 23, 226, 7,
+ 86, 23, 241, 158, 86, 23, 234, 68, 61, 86, 23, 229, 58, 61, 86, 23, 217,
+ 56, 61, 86, 23, 223, 180, 61, 86, 23, 231, 31, 61, 86, 23, 225, 228, 61,
+ 86, 23, 220, 77, 61, 86, 23, 236, 52, 61, 86, 23, 249, 240, 61, 86, 23,
+ 250, 44, 61, 86, 23, 234, 117, 61, 86, 23, 217, 127, 61, 86, 23, 226, 8,
+ 61, 86, 23, 241, 159, 61, 86, 23, 249, 240, 69, 86, 234, 12, 137, 227,
+ 83, 86, 234, 12, 137, 157, 240, 212, 86, 143, 116, 86, 143, 109, 86, 143,
+ 166, 86, 143, 163, 86, 143, 180, 86, 143, 189, 86, 143, 198, 86, 143,
+ 195, 86, 143, 200, 86, 143, 217, 200, 86, 143, 230, 198, 86, 143, 244,
+ 65, 86, 143, 214, 24, 86, 143, 213, 201, 86, 143, 231, 106, 86, 143, 245,
+ 179, 86, 143, 218, 238, 86, 143, 219, 72, 86, 143, 241, 228, 86, 143,
+ 219, 238, 86, 143, 230, 24, 86, 143, 219, 192, 86, 143, 244, 71, 86, 143,
+ 249, 140, 86, 143, 233, 148, 86, 143, 223, 223, 86, 143, 250, 203, 86,
+ 143, 219, 30, 86, 143, 218, 220, 86, 143, 245, 86, 86, 143, 223, 215, 86,
+ 143, 254, 59, 86, 143, 244, 97, 86, 143, 223, 213, 86, 143, 221, 76, 86,
+ 143, 224, 20, 36, 143, 224, 157, 36, 143, 234, 89, 36, 143, 222, 116, 36,
+ 143, 234, 8, 36, 50, 217, 201, 227, 63, 83, 219, 166, 36, 50, 216, 39,
+ 227, 63, 83, 219, 166, 36, 50, 217, 116, 227, 63, 83, 219, 166, 36, 50,
+ 243, 241, 227, 63, 83, 219, 166, 36, 50, 244, 84, 227, 63, 83, 219, 166,
+ 36, 50, 220, 40, 227, 63, 83, 219, 166, 36, 50, 221, 38, 227, 63, 83,
+ 219, 166, 36, 50, 245, 142, 227, 63, 83, 219, 166, 226, 123, 52, 36, 50,
+ 216, 39, 116, 36, 50, 216, 39, 109, 36, 50, 216, 39, 166, 36, 50, 216,
+ 39, 163, 36, 50, 216, 39, 180, 36, 50, 216, 39, 189, 36, 50, 216, 39,
+ 198, 36, 50, 216, 39, 195, 36, 50, 216, 39, 200, 36, 50, 217, 115, 36,
+ 50, 217, 116, 116, 36, 50, 217, 116, 109, 36, 50, 217, 116, 166, 36, 50,
+ 217, 116, 163, 36, 50, 217, 116, 180, 36, 23, 234, 67, 36, 23, 229, 57,
+ 36, 23, 217, 55, 36, 23, 223, 179, 36, 23, 231, 30, 36, 23, 225, 227, 36,
+ 23, 220, 76, 36, 23, 236, 51, 36, 23, 249, 239, 36, 23, 250, 43, 36, 23,
+ 234, 116, 36, 23, 217, 126, 36, 23, 226, 7, 36, 23, 241, 158, 36, 23,
+ 234, 68, 61, 36, 23, 229, 58, 61, 36, 23, 217, 56, 61, 36, 23, 223, 180,
+ 61, 36, 23, 231, 31, 61, 36, 23, 225, 228, 61, 36, 23, 220, 77, 61, 36,
+ 23, 236, 52, 61, 36, 23, 249, 240, 61, 36, 23, 250, 44, 61, 36, 23, 234,
+ 117, 61, 36, 23, 217, 127, 61, 36, 23, 226, 8, 61, 36, 23, 241, 159, 61,
+ 36, 234, 12, 137, 250, 84, 36, 234, 12, 137, 235, 50, 36, 23, 236, 52,
+ 69, 234, 12, 219, 98, 87, 36, 143, 116, 36, 143, 109, 36, 143, 166, 36,
+ 143, 163, 36, 143, 180, 36, 143, 189, 36, 143, 198, 36, 143, 195, 36,
+ 143, 200, 36, 143, 217, 200, 36, 143, 230, 198, 36, 143, 244, 65, 36,
+ 143, 214, 24, 36, 143, 213, 201, 36, 143, 231, 106, 36, 143, 245, 179,
+ 36, 143, 218, 238, 36, 143, 219, 72, 36, 143, 241, 228, 36, 143, 219,
+ 238, 36, 143, 230, 24, 36, 143, 219, 192, 36, 143, 244, 71, 36, 143, 249,
+ 140, 36, 143, 233, 148, 36, 143, 222, 93, 36, 143, 231, 252, 36, 143,
+ 244, 106, 36, 143, 218, 250, 36, 143, 245, 1, 36, 143, 225, 68, 36, 143,
+ 253, 112, 36, 143, 235, 157, 36, 143, 223, 213, 36, 143, 249, 103, 36,
+ 143, 249, 94, 36, 143, 241, 151, 36, 143, 250, 108, 36, 143, 232, 165,
+ 36, 143, 233, 70, 36, 143, 223, 148, 36, 143, 231, 148, 36, 143, 223,
+ 237, 36, 143, 219, 30, 36, 143, 218, 220, 36, 143, 245, 86, 36, 143, 223,
+ 215, 36, 143, 254, 59, 36, 143, 229, 43, 36, 50, 217, 116, 189, 36, 50,
+ 217, 116, 198, 36, 50, 217, 116, 195, 36, 50, 217, 116, 200, 36, 50, 243,
+ 240, 36, 50, 243, 241, 116, 36, 50, 243, 241, 109, 36, 50, 243, 241, 166,
+ 36, 50, 243, 241, 163, 36, 50, 243, 241, 180, 36, 50, 243, 241, 189, 36,
+ 50, 243, 241, 198, 36, 50, 243, 241, 195, 36, 50, 243, 241, 200, 36, 50,
+ 244, 83, 105, 201, 16, 31, 235, 133, 105, 201, 16, 31, 244, 117, 105,
+ 201, 16, 31, 231, 223, 105, 201, 16, 31, 253, 217, 105, 201, 16, 31, 231,
+ 196, 105, 201, 16, 31, 235, 48, 105, 201, 16, 31, 235, 49, 105, 201, 16,
+ 31, 253, 104, 105, 201, 16, 31, 221, 56, 105, 201, 16, 31, 227, 104, 105,
+ 201, 16, 31, 228, 151, 105, 201, 16, 31, 248, 36, 41, 241, 175, 41, 245,
+ 51, 41, 245, 10, 232, 248, 233, 12, 52, 36, 56, 61, 36, 56, 72, 36, 56,
+ 69, 36, 56, 74, 36, 56, 75, 36, 56, 181, 36, 56, 234, 101, 36, 56, 233,
+ 238, 36, 56, 234, 188, 36, 56, 234, 37, 36, 56, 222, 202, 36, 56, 220,
+ 117, 36, 56, 219, 27, 36, 56, 222, 100, 36, 56, 219, 242, 36, 56, 218,
+ 52, 36, 56, 217, 71, 36, 56, 216, 82, 36, 56, 217, 229, 36, 56, 108, 36,
+ 56, 205, 36, 56, 229, 64, 36, 56, 228, 92, 36, 56, 229, 187, 36, 56, 228,
+ 185, 36, 56, 159, 36, 56, 241, 165, 36, 56, 240, 212, 36, 56, 241, 222,
+ 36, 56, 241, 54, 36, 56, 188, 36, 56, 231, 42, 36, 56, 230, 172, 36, 56,
+ 231, 156, 36, 56, 230, 231, 36, 56, 186, 36, 56, 212, 203, 36, 56, 212,
+ 235, 36, 56, 203, 36, 56, 223, 188, 36, 56, 223, 51, 36, 56, 224, 21, 36,
+ 56, 223, 112, 36, 56, 214, 49, 36, 56, 213, 235, 36, 56, 214, 6, 36, 56,
+ 213, 214, 41, 253, 238, 41, 253, 154, 41, 254, 6, 41, 254, 190, 41, 235,
+ 223, 41, 235, 193, 41, 215, 137, 41, 245, 31, 41, 245, 163, 41, 227, 52,
+ 41, 227, 46, 41, 234, 249, 41, 234, 219, 41, 234, 216, 41, 243, 68, 41,
+ 243, 77, 41, 242, 180, 41, 242, 176, 41, 233, 172, 41, 242, 169, 41, 234,
+ 81, 41, 234, 80, 41, 234, 79, 41, 234, 78, 41, 242, 67, 41, 242, 66, 41,
+ 233, 214, 41, 233, 216, 41, 234, 184, 41, 234, 10, 41, 234, 17, 41, 222,
+ 187, 41, 222, 153, 41, 220, 57, 41, 221, 61, 41, 221, 60, 41, 248, 161,
+ 41, 247, 243, 41, 247, 75, 41, 216, 243, 41, 230, 20, 41, 228, 152, 41,
+ 242, 14, 41, 226, 208, 41, 226, 207, 41, 252, 105, 41, 225, 237, 41, 225,
+ 201, 41, 225, 202, 41, 251, 157, 41, 240, 211, 41, 240, 207, 41, 251, 20,
+ 41, 240, 194, 41, 241, 199, 41, 226, 35, 41, 226, 69, 41, 241, 183, 41,
+ 226, 66, 41, 226, 82, 41, 251, 237, 41, 225, 140, 41, 251, 106, 41, 241,
+ 42, 41, 225, 130, 41, 241, 35, 41, 241, 37, 41, 232, 7, 41, 232, 3, 41,
+ 232, 11, 41, 231, 213, 41, 231, 238, 41, 231, 10, 41, 230, 245, 41, 230,
+ 244, 41, 231, 138, 41, 231, 135, 41, 231, 139, 41, 213, 90, 41, 213, 88,
+ 41, 212, 192, 41, 223, 123, 41, 223, 127, 41, 223, 28, 41, 223, 23, 41,
+ 223, 235, 41, 223, 232, 41, 214, 22, 105, 201, 16, 31, 240, 226, 212, 79,
+ 105, 201, 16, 31, 240, 226, 116, 105, 201, 16, 31, 240, 226, 109, 105,
+ 201, 16, 31, 240, 226, 166, 105, 201, 16, 31, 240, 226, 163, 105, 201,
+ 16, 31, 240, 226, 180, 105, 201, 16, 31, 240, 226, 189, 105, 201, 16, 31,
+ 240, 226, 198, 105, 201, 16, 31, 240, 226, 195, 105, 201, 16, 31, 240,
+ 226, 200, 105, 201, 16, 31, 240, 226, 217, 200, 105, 201, 16, 31, 240,
+ 226, 245, 124, 105, 201, 16, 31, 240, 226, 216, 41, 105, 201, 16, 31,
+ 240, 226, 217, 117, 105, 201, 16, 31, 240, 226, 243, 231, 105, 201, 16,
+ 31, 240, 226, 244, 87, 105, 201, 16, 31, 240, 226, 220, 47, 105, 201, 16,
+ 31, 240, 226, 221, 40, 105, 201, 16, 31, 240, 226, 245, 147, 105, 201,
+ 16, 31, 240, 226, 229, 28, 105, 201, 16, 31, 240, 226, 216, 38, 105, 201,
+ 16, 31, 240, 226, 216, 32, 105, 201, 16, 31, 240, 226, 216, 28, 105, 201,
+ 16, 31, 240, 226, 216, 29, 105, 201, 16, 31, 240, 226, 216, 34, 41, 240,
+ 217, 41, 248, 164, 41, 253, 108, 41, 134, 41, 226, 249, 41, 226, 99, 41,
+ 247, 101, 41, 247, 102, 219, 165, 41, 247, 102, 249, 49, 41, 235, 154,
+ 41, 245, 54, 230, 25, 241, 200, 41, 245, 54, 230, 25, 218, 120, 41, 245,
+ 54, 230, 25, 218, 24, 41, 245, 54, 230, 25, 231, 134, 41, 249, 96, 41,
+ 226, 214, 254, 34, 41, 205, 41, 230, 173, 61, 41, 188, 41, 181, 41, 234,
+ 191, 41, 231, 192, 41, 243, 56, 41, 250, 206, 41, 234, 190, 41, 226, 26,
+ 41, 229, 163, 41, 230, 173, 244, 230, 41, 230, 173, 243, 177, 41, 231,
+ 82, 41, 234, 140, 41, 240, 155, 41, 234, 103, 41, 231, 44, 41, 242, 192,
+ 41, 217, 73, 41, 230, 173, 150, 41, 230, 238, 41, 247, 109, 41, 234, 49,
+ 41, 244, 14, 41, 228, 200, 41, 230, 173, 183, 41, 230, 235, 41, 249, 176,
+ 41, 234, 43, 41, 230, 236, 219, 165, 41, 249, 177, 219, 165, 41, 232,
+ 110, 219, 165, 41, 234, 44, 219, 165, 41, 230, 236, 249, 49, 41, 249,
+ 177, 249, 49, 41, 232, 110, 249, 49, 41, 234, 44, 249, 49, 41, 232, 110,
+ 110, 197, 41, 232, 110, 110, 223, 4, 219, 165, 41, 193, 41, 234, 4, 41,
+ 230, 175, 41, 242, 127, 41, 224, 66, 41, 224, 67, 110, 197, 41, 224, 67,
+ 110, 223, 4, 219, 165, 41, 225, 47, 41, 228, 124, 41, 230, 173, 197, 41,
+ 230, 174, 41, 225, 4, 41, 228, 33, 41, 230, 173, 215, 79, 41, 230, 120,
+ 41, 233, 207, 41, 230, 121, 231, 138, 41, 225, 3, 41, 228, 32, 41, 230,
+ 173, 214, 82, 41, 230, 115, 41, 233, 205, 41, 230, 116, 231, 138, 41,
+ 235, 28, 227, 86, 41, 232, 110, 227, 86, 41, 254, 45, 41, 251, 87, 41,
+ 250, 147, 41, 250, 125, 41, 250, 253, 110, 234, 140, 41, 249, 175, 41,
+ 248, 88, 41, 242, 53, 41, 159, 41, 240, 218, 41, 235, 251, 41, 234, 56,
+ 41, 234, 44, 250, 182, 41, 233, 240, 41, 232, 211, 41, 232, 210, 41, 232,
+ 200, 41, 232, 122, 41, 231, 193, 220, 7, 41, 231, 9, 41, 230, 222, 41,
+ 226, 24, 41, 225, 153, 41, 225, 99, 41, 225, 97, 41, 219, 159, 41, 218,
+ 203, 41, 214, 8, 41, 215, 80, 110, 183, 41, 118, 110, 183, 105, 201, 16,
+ 31, 248, 92, 116, 105, 201, 16, 31, 248, 92, 109, 105, 201, 16, 31, 248,
+ 92, 166, 105, 201, 16, 31, 248, 92, 163, 105, 201, 16, 31, 248, 92, 180,
+ 105, 201, 16, 31, 248, 92, 189, 105, 201, 16, 31, 248, 92, 198, 105, 201,
+ 16, 31, 248, 92, 195, 105, 201, 16, 31, 248, 92, 200, 105, 201, 16, 31,
+ 248, 92, 217, 200, 105, 201, 16, 31, 248, 92, 245, 124, 105, 201, 16, 31,
+ 248, 92, 216, 41, 105, 201, 16, 31, 248, 92, 217, 117, 105, 201, 16, 31,
+ 248, 92, 243, 231, 105, 201, 16, 31, 248, 92, 244, 87, 105, 201, 16, 31,
+ 248, 92, 220, 47, 105, 201, 16, 31, 248, 92, 221, 40, 105, 201, 16, 31,
+ 248, 92, 245, 147, 105, 201, 16, 31, 248, 92, 229, 28, 105, 201, 16, 31,
+ 248, 92, 216, 38, 105, 201, 16, 31, 248, 92, 216, 32, 105, 201, 16, 31,
+ 248, 92, 216, 28, 105, 201, 16, 31, 248, 92, 216, 29, 105, 201, 16, 31,
+ 248, 92, 216, 34, 105, 201, 16, 31, 248, 92, 216, 35, 105, 201, 16, 31,
+ 248, 92, 216, 30, 105, 201, 16, 31, 248, 92, 216, 31, 105, 201, 16, 31,
+ 248, 92, 216, 37, 105, 201, 16, 31, 248, 92, 216, 33, 105, 201, 16, 31,
+ 248, 92, 217, 115, 105, 201, 16, 31, 248, 92, 217, 114, 41, 243, 94, 241,
+ 177, 31, 217, 149, 249, 80, 241, 207, 241, 177, 31, 217, 149, 224, 15,
+ 245, 179, 241, 177, 31, 247, 183, 253, 123, 217, 149, 251, 232, 241, 177,
+ 31, 212, 214, 244, 7, 241, 177, 31, 214, 43, 241, 177, 31, 249, 142, 241,
+ 177, 31, 217, 149, 253, 174, 241, 177, 31, 241, 46, 216, 249, 241, 177,
+ 31, 3, 218, 12, 241, 177, 31, 216, 195, 241, 177, 31, 226, 94, 241, 177,
+ 31, 219, 97, 241, 177, 31, 244, 108, 241, 177, 31, 242, 109, 225, 120,
+ 241, 177, 31, 230, 225, 241, 177, 31, 245, 85, 241, 177, 31, 244, 8, 241,
+ 177, 31, 213, 194, 227, 63, 217, 149, 248, 37, 241, 177, 31, 253, 221,
+ 241, 177, 31, 249, 124, 241, 177, 31, 251, 150, 217, 92, 241, 177, 31,
+ 242, 125, 241, 177, 31, 219, 177, 253, 237, 241, 177, 31, 223, 205, 241,
+ 177, 31, 235, 217, 241, 177, 31, 242, 109, 218, 12, 241, 177, 31, 230,
+ 181, 249, 98, 241, 177, 31, 242, 109, 225, 77, 241, 177, 31, 217, 149,
+ 254, 178, 214, 24, 241, 177, 31, 217, 149, 249, 201, 244, 65, 241, 177,
+ 31, 235, 230, 241, 177, 31, 246, 12, 241, 177, 31, 223, 208, 241, 177,
+ 31, 242, 109, 225, 104, 241, 177, 31, 225, 61, 241, 177, 31, 248, 106,
+ 65, 217, 149, 233, 2, 241, 177, 31, 217, 149, 244, 142, 241, 177, 31,
+ 227, 29, 241, 177, 31, 227, 108, 241, 177, 31, 248, 10, 241, 177, 31,
+ 248, 30, 241, 177, 31, 235, 243, 241, 177, 31, 251, 77, 241, 177, 31,
+ 249, 159, 211, 211, 231, 141, 241, 177, 31, 243, 63, 216, 249, 241, 177,
+ 31, 225, 12, 215, 125, 241, 177, 31, 227, 28, 241, 177, 31, 217, 149,
+ 213, 254, 241, 177, 31, 223, 198, 241, 177, 31, 217, 149, 250, 153, 241,
+ 177, 31, 217, 149, 253, 170, 217, 87, 241, 177, 31, 217, 149, 234, 185,
+ 219, 74, 230, 185, 241, 177, 31, 247, 239, 241, 177, 31, 217, 149, 231,
+ 215, 232, 8, 241, 177, 31, 254, 179, 241, 177, 31, 217, 149, 214, 38,
+ 241, 177, 31, 217, 149, 243, 23, 213, 224, 241, 177, 31, 217, 149, 235,
+ 55, 233, 131, 241, 177, 31, 247, 136, 241, 177, 31, 232, 249, 241, 177,
+ 31, 235, 220, 216, 145, 241, 177, 31, 3, 225, 77, 241, 177, 31, 254, 122,
+ 249, 151, 241, 177, 31, 251, 235, 249, 151, 8, 4, 235, 158, 8, 4, 235,
+ 151, 8, 4, 72, 8, 4, 235, 180, 8, 4, 236, 53, 8, 4, 236, 36, 8, 4, 236,
+ 55, 8, 4, 236, 54, 8, 4, 253, 122, 8, 4, 253, 85, 8, 4, 61, 8, 4, 253,
+ 239, 8, 4, 215, 135, 8, 4, 215, 138, 8, 4, 215, 136, 8, 4, 227, 8, 8, 4,
+ 226, 238, 8, 4, 75, 8, 4, 227, 41, 8, 4, 245, 2, 8, 4, 74, 8, 4, 213,
+ 183, 8, 4, 251, 151, 8, 4, 251, 148, 8, 4, 251, 184, 8, 4, 251, 161, 8,
+ 4, 251, 174, 8, 4, 251, 173, 8, 4, 251, 176, 8, 4, 251, 175, 8, 4, 252,
+ 41, 8, 4, 252, 33, 8, 4, 252, 107, 8, 4, 252, 61, 8, 4, 251, 30, 8, 4,
+ 251, 34, 8, 4, 251, 31, 8, 4, 251, 105, 8, 4, 251, 89, 8, 4, 251, 128, 8,
+ 4, 251, 110, 8, 4, 251, 198, 8, 4, 251, 251, 8, 4, 251, 210, 8, 4, 251,
+ 16, 8, 4, 251, 13, 8, 4, 251, 54, 8, 4, 251, 29, 8, 4, 251, 23, 8, 4,
+ 251, 27, 8, 4, 251, 1, 8, 4, 251, 0, 8, 4, 251, 6, 8, 4, 251, 4, 8, 4,
+ 251, 2, 8, 4, 251, 3, 8, 4, 225, 181, 8, 4, 225, 177, 8, 4, 225, 240, 8,
+ 4, 225, 191, 8, 4, 225, 207, 8, 4, 225, 234, 8, 4, 225, 230, 8, 4, 226,
+ 113, 8, 4, 226, 104, 8, 4, 193, 8, 4, 226, 149, 8, 4, 225, 21, 8, 4, 225,
+ 23, 8, 4, 225, 22, 8, 4, 225, 113, 8, 4, 225, 102, 8, 4, 225, 150, 8, 4,
+ 225, 125, 8, 4, 225, 8, 8, 4, 225, 5, 8, 4, 225, 35, 8, 4, 225, 20, 8, 4,
+ 225, 13, 8, 4, 225, 18, 8, 4, 224, 244, 8, 4, 224, 243, 8, 4, 224, 248,
+ 8, 4, 224, 247, 8, 4, 224, 245, 8, 4, 224, 246, 8, 4, 252, 16, 8, 4, 252,
+ 15, 8, 4, 252, 22, 8, 4, 252, 17, 8, 4, 252, 19, 8, 4, 252, 18, 8, 4,
+ 252, 21, 8, 4, 252, 20, 8, 4, 252, 28, 8, 4, 252, 27, 8, 4, 252, 31, 8,
+ 4, 252, 29, 8, 4, 252, 7, 8, 4, 252, 9, 8, 4, 252, 8, 8, 4, 252, 12, 8,
+ 4, 252, 11, 8, 4, 252, 14, 8, 4, 252, 13, 8, 4, 252, 23, 8, 4, 252, 26,
+ 8, 4, 252, 24, 8, 4, 252, 3, 8, 4, 252, 2, 8, 4, 252, 10, 8, 4, 252, 6,
+ 8, 4, 252, 4, 8, 4, 252, 5, 8, 4, 251, 255, 8, 4, 251, 254, 8, 4, 252, 1,
+ 8, 4, 252, 0, 8, 4, 229, 248, 8, 4, 229, 247, 8, 4, 229, 253, 8, 4, 229,
+ 249, 8, 4, 229, 250, 8, 4, 229, 252, 8, 4, 229, 251, 8, 4, 229, 255, 8,
+ 4, 229, 254, 8, 4, 230, 1, 8, 4, 230, 0, 8, 4, 229, 244, 8, 4, 229, 243,
+ 8, 4, 229, 246, 8, 4, 229, 245, 8, 4, 229, 238, 8, 4, 229, 237, 8, 4,
+ 229, 242, 8, 4, 229, 241, 8, 4, 229, 239, 8, 4, 229, 240, 8, 4, 229, 232,
+ 8, 4, 229, 231, 8, 4, 229, 236, 8, 4, 229, 235, 8, 4, 229, 233, 8, 4,
+ 229, 234, 8, 4, 241, 96, 8, 4, 241, 95, 8, 4, 241, 101, 8, 4, 241, 97, 8,
+ 4, 241, 98, 8, 4, 241, 100, 8, 4, 241, 99, 8, 4, 241, 104, 8, 4, 241,
+ 103, 8, 4, 241, 106, 8, 4, 241, 105, 8, 4, 241, 87, 8, 4, 241, 89, 8, 4,
+ 241, 88, 8, 4, 241, 92, 8, 4, 241, 91, 8, 4, 241, 94, 8, 4, 241, 93, 8,
+ 4, 241, 83, 8, 4, 241, 82, 8, 4, 241, 90, 8, 4, 241, 86, 8, 4, 241, 84,
+ 8, 4, 241, 85, 8, 4, 241, 77, 8, 4, 241, 81, 8, 4, 241, 80, 8, 4, 241,
+ 78, 8, 4, 241, 79, 8, 4, 230, 241, 8, 4, 230, 240, 8, 4, 231, 42, 8, 4,
+ 230, 247, 8, 4, 231, 16, 8, 4, 231, 34, 8, 4, 231, 32, 8, 4, 231, 202, 8,
+ 4, 231, 198, 8, 4, 188, 8, 4, 231, 235, 8, 4, 230, 144, 8, 4, 230, 143,
+ 8, 4, 230, 147, 8, 4, 230, 145, 8, 4, 230, 191, 8, 4, 230, 177, 8, 4,
+ 230, 231, 8, 4, 230, 196, 8, 4, 231, 93, 8, 4, 231, 156, 8, 4, 230, 125,
+ 8, 4, 230, 122, 8, 4, 230, 172, 8, 4, 230, 140, 8, 4, 230, 133, 8, 4,
+ 230, 138, 8, 4, 230, 100, 8, 4, 230, 99, 8, 4, 230, 105, 8, 4, 230, 102,
+ 8, 4, 244, 52, 8, 4, 244, 47, 8, 4, 244, 90, 8, 4, 244, 67, 8, 4, 244,
+ 135, 8, 4, 244, 126, 8, 4, 244, 164, 8, 4, 244, 138, 8, 4, 243, 229, 8,
+ 4, 244, 12, 8, 4, 243, 252, 8, 4, 243, 190, 8, 4, 243, 189, 8, 4, 243,
+ 205, 8, 4, 243, 195, 8, 4, 243, 193, 8, 4, 243, 194, 8, 4, 243, 180, 8,
+ 4, 243, 179, 8, 4, 243, 183, 8, 4, 243, 181, 8, 4, 214, 125, 8, 4, 214,
+ 120, 8, 4, 214, 154, 8, 4, 214, 134, 8, 4, 214, 146, 8, 4, 214, 143, 8,
+ 4, 214, 148, 8, 4, 214, 147, 8, 4, 214, 239, 8, 4, 214, 235, 8, 4, 215,
+ 1, 8, 4, 214, 250, 8, 4, 214, 106, 8, 4, 214, 102, 8, 4, 214, 119, 8, 4,
+ 214, 107, 8, 4, 214, 155, 8, 4, 214, 221, 8, 4, 214, 93, 8, 4, 214, 92,
+ 8, 4, 214, 99, 8, 4, 214, 96, 8, 4, 214, 94, 8, 4, 214, 95, 8, 4, 214,
+ 86, 8, 4, 214, 85, 8, 4, 214, 90, 8, 4, 214, 89, 8, 4, 214, 87, 8, 4,
+ 214, 88, 8, 4, 247, 130, 8, 4, 247, 118, 8, 4, 247, 211, 8, 4, 247, 155,
+ 8, 4, 247, 188, 8, 4, 247, 192, 8, 4, 247, 191, 8, 4, 248, 98, 8, 4, 248,
+ 93, 8, 4, 248, 164, 8, 4, 248, 117, 8, 4, 246, 17, 8, 4, 246, 18, 8, 4,
+ 247, 74, 8, 4, 246, 56, 8, 4, 247, 99, 8, 4, 247, 76, 8, 4, 247, 237, 8,
+ 4, 248, 41, 8, 4, 247, 252, 8, 4, 246, 8, 8, 4, 246, 6, 8, 4, 246, 33, 8,
+ 4, 246, 16, 8, 4, 246, 11, 8, 4, 246, 14, 8, 4, 217, 20, 8, 4, 217, 14,
+ 8, 4, 217, 71, 8, 4, 217, 29, 8, 4, 217, 63, 8, 4, 217, 65, 8, 4, 217,
+ 64, 8, 4, 217, 253, 8, 4, 217, 240, 8, 4, 218, 52, 8, 4, 218, 5, 8, 4,
+ 216, 66, 8, 4, 216, 65, 8, 4, 216, 68, 8, 4, 216, 67, 8, 4, 216, 218, 8,
+ 4, 216, 214, 8, 4, 108, 8, 4, 216, 226, 8, 4, 217, 166, 8, 4, 217, 229,
+ 8, 4, 217, 190, 8, 4, 216, 52, 8, 4, 216, 48, 8, 4, 216, 82, 8, 4, 216,
+ 64, 8, 4, 216, 53, 8, 4, 216, 62, 8, 4, 248, 58, 8, 4, 248, 57, 8, 4,
+ 248, 63, 8, 4, 248, 59, 8, 4, 248, 60, 8, 4, 248, 62, 8, 4, 248, 61, 8,
+ 4, 248, 79, 8, 4, 248, 78, 8, 4, 248, 86, 8, 4, 248, 80, 8, 4, 248, 48,
+ 8, 4, 248, 50, 8, 4, 248, 49, 8, 4, 248, 53, 8, 4, 248, 52, 8, 4, 248,
+ 56, 8, 4, 248, 54, 8, 4, 248, 71, 8, 4, 248, 74, 8, 4, 248, 72, 8, 4,
+ 248, 44, 8, 4, 248, 43, 8, 4, 248, 51, 8, 4, 248, 47, 8, 4, 248, 45, 8,
+ 4, 248, 46, 8, 4, 229, 206, 8, 4, 229, 205, 8, 4, 229, 213, 8, 4, 229,
+ 208, 8, 4, 229, 209, 8, 4, 229, 210, 8, 4, 229, 222, 8, 4, 229, 221, 8,
+ 4, 229, 228, 8, 4, 229, 223, 8, 4, 229, 198, 8, 4, 229, 197, 8, 4, 229,
+ 204, 8, 4, 229, 199, 8, 4, 229, 214, 8, 4, 229, 220, 8, 4, 229, 218, 8,
+ 4, 229, 190, 8, 4, 229, 189, 8, 4, 229, 195, 8, 4, 229, 193, 8, 4, 229,
+ 191, 8, 4, 229, 192, 8, 4, 241, 63, 8, 4, 241, 62, 8, 4, 241, 69, 8, 4,
+ 241, 64, 8, 4, 241, 66, 8, 4, 241, 65, 8, 4, 241, 68, 8, 4, 241, 67, 8,
+ 4, 241, 74, 8, 4, 241, 73, 8, 4, 241, 76, 8, 4, 241, 75, 8, 4, 241, 57,
+ 8, 4, 241, 58, 8, 4, 241, 60, 8, 4, 241, 59, 8, 4, 241, 61, 8, 4, 241,
+ 70, 8, 4, 241, 72, 8, 4, 241, 71, 8, 4, 241, 56, 8, 4, 229, 20, 8, 4,
+ 229, 18, 8, 4, 229, 64, 8, 4, 229, 23, 8, 4, 229, 46, 8, 4, 229, 60, 8,
+ 4, 229, 59, 8, 4, 230, 5, 8, 4, 205, 8, 4, 230, 17, 8, 4, 228, 42, 8, 4,
+ 228, 44, 8, 4, 228, 43, 8, 4, 228, 162, 8, 4, 228, 149, 8, 4, 228, 185,
+ 8, 4, 228, 171, 8, 4, 229, 165, 8, 4, 229, 187, 8, 4, 229, 176, 8, 4,
+ 228, 37, 8, 4, 228, 34, 8, 4, 228, 92, 8, 4, 228, 41, 8, 4, 228, 39, 8,
+ 4, 228, 40, 8, 4, 241, 127, 8, 4, 241, 126, 8, 4, 241, 132, 8, 4, 241,
+ 128, 8, 4, 241, 129, 8, 4, 241, 131, 8, 4, 241, 130, 8, 4, 241, 137, 8,
+ 4, 241, 136, 8, 4, 241, 139, 8, 4, 241, 138, 8, 4, 241, 119, 8, 4, 241,
+ 121, 8, 4, 241, 120, 8, 4, 241, 123, 8, 4, 241, 125, 8, 4, 241, 124, 8,
+ 4, 241, 133, 8, 4, 241, 135, 8, 4, 241, 134, 8, 4, 241, 115, 8, 4, 241,
+ 114, 8, 4, 241, 122, 8, 4, 241, 118, 8, 4, 241, 116, 8, 4, 241, 117, 8,
+ 4, 241, 109, 8, 4, 241, 108, 8, 4, 241, 113, 8, 4, 241, 112, 8, 4, 241,
+ 110, 8, 4, 241, 111, 8, 4, 232, 224, 8, 4, 232, 218, 8, 4, 233, 13, 8, 4,
+ 232, 231, 8, 4, 233, 5, 8, 4, 233, 4, 8, 4, 233, 8, 8, 4, 233, 6, 8, 4,
+ 233, 102, 8, 4, 233, 93, 8, 4, 233, 157, 8, 4, 233, 111, 8, 4, 232, 137,
+ 8, 4, 232, 136, 8, 4, 232, 139, 8, 4, 232, 138, 8, 4, 232, 171, 8, 4,
+ 232, 161, 8, 4, 232, 208, 8, 4, 232, 175, 8, 4, 233, 28, 8, 4, 233, 82,
+ 8, 4, 233, 41, 8, 4, 232, 132, 8, 4, 232, 131, 8, 4, 232, 156, 8, 4, 232,
+ 135, 8, 4, 232, 133, 8, 4, 232, 134, 8, 4, 232, 114, 8, 4, 232, 113, 8,
+ 4, 232, 121, 8, 4, 232, 117, 8, 4, 232, 115, 8, 4, 232, 116, 8, 4, 242,
+ 165, 8, 4, 242, 164, 8, 4, 242, 190, 8, 4, 242, 175, 8, 4, 242, 182, 8,
+ 4, 242, 181, 8, 4, 242, 184, 8, 4, 242, 183, 8, 4, 243, 65, 8, 4, 243,
+ 60, 8, 4, 243, 110, 8, 4, 243, 75, 8, 4, 242, 72, 8, 4, 242, 71, 8, 4,
+ 242, 74, 8, 4, 242, 73, 8, 4, 242, 130, 8, 4, 242, 128, 8, 4, 242, 150,
+ 8, 4, 242, 138, 8, 4, 243, 9, 8, 4, 243, 7, 8, 4, 243, 38, 8, 4, 243, 20,
+ 8, 4, 242, 62, 8, 4, 242, 61, 8, 4, 242, 92, 8, 4, 242, 70, 8, 4, 242,
+ 63, 8, 4, 242, 69, 8, 4, 234, 70, 8, 4, 234, 69, 8, 4, 234, 101, 8, 4,
+ 234, 84, 8, 4, 234, 94, 8, 4, 234, 97, 8, 4, 234, 95, 8, 4, 234, 207, 8,
+ 4, 234, 196, 8, 4, 181, 8, 4, 234, 233, 8, 4, 233, 221, 8, 4, 233, 226,
+ 8, 4, 233, 223, 8, 4, 234, 9, 8, 4, 234, 5, 8, 4, 234, 37, 8, 4, 234, 16,
+ 8, 4, 234, 162, 8, 4, 234, 146, 8, 4, 234, 188, 8, 4, 234, 165, 8, 4,
+ 233, 210, 8, 4, 233, 208, 8, 4, 233, 238, 8, 4, 233, 220, 8, 4, 233, 213,
+ 8, 4, 233, 217, 8, 4, 242, 247, 8, 4, 242, 246, 8, 4, 242, 251, 8, 4,
+ 242, 248, 8, 4, 242, 250, 8, 4, 242, 249, 8, 4, 243, 2, 8, 4, 243, 1, 8,
+ 4, 243, 5, 8, 4, 243, 3, 8, 4, 242, 238, 8, 4, 242, 237, 8, 4, 242, 240,
+ 8, 4, 242, 239, 8, 4, 242, 243, 8, 4, 242, 242, 8, 4, 242, 245, 8, 4,
+ 242, 244, 8, 4, 242, 253, 8, 4, 242, 252, 8, 4, 243, 0, 8, 4, 242, 254,
+ 8, 4, 242, 233, 8, 4, 242, 232, 8, 4, 242, 241, 8, 4, 242, 236, 8, 4,
+ 242, 234, 8, 4, 242, 235, 8, 4, 231, 60, 8, 4, 231, 61, 8, 4, 231, 79, 8,
+ 4, 231, 78, 8, 4, 231, 81, 8, 4, 231, 80, 8, 4, 231, 51, 8, 4, 231, 53,
+ 8, 4, 231, 52, 8, 4, 231, 56, 8, 4, 231, 55, 8, 4, 231, 58, 8, 4, 231,
+ 57, 8, 4, 231, 62, 8, 4, 231, 64, 8, 4, 231, 63, 8, 4, 231, 47, 8, 4,
+ 231, 46, 8, 4, 231, 54, 8, 4, 231, 50, 8, 4, 231, 48, 8, 4, 231, 49, 8,
+ 4, 240, 172, 8, 4, 240, 171, 8, 4, 240, 178, 8, 4, 240, 173, 8, 4, 240,
+ 175, 8, 4, 240, 174, 8, 4, 240, 177, 8, 4, 240, 176, 8, 4, 240, 183, 8,
+ 4, 240, 182, 8, 4, 240, 185, 8, 4, 240, 184, 8, 4, 240, 164, 8, 4, 240,
+ 163, 8, 4, 240, 166, 8, 4, 240, 165, 8, 4, 240, 168, 8, 4, 240, 167, 8,
+ 4, 240, 170, 8, 4, 240, 169, 8, 4, 240, 179, 8, 4, 240, 181, 8, 4, 240,
+ 180, 8, 4, 229, 110, 8, 4, 229, 112, 8, 4, 229, 111, 8, 4, 229, 150, 8,
+ 4, 229, 149, 8, 4, 229, 159, 8, 4, 229, 153, 8, 4, 229, 73, 8, 4, 229,
+ 72, 8, 4, 229, 74, 8, 4, 229, 82, 8, 4, 229, 79, 8, 4, 229, 90, 8, 4,
+ 229, 84, 8, 4, 229, 143, 8, 4, 229, 148, 8, 4, 229, 145, 8, 4, 241, 142,
+ 8, 4, 241, 152, 8, 4, 241, 160, 8, 4, 241, 234, 8, 4, 241, 227, 8, 4,
+ 159, 8, 4, 241, 245, 8, 4, 240, 196, 8, 4, 240, 195, 8, 4, 240, 198, 8,
+ 4, 240, 197, 8, 4, 240, 229, 8, 4, 240, 220, 8, 4, 241, 54, 8, 4, 241,
+ 34, 8, 4, 241, 179, 8, 4, 241, 222, 8, 4, 241, 190, 8, 4, 214, 27, 8, 4,
+ 214, 12, 8, 4, 214, 49, 8, 4, 214, 35, 8, 4, 213, 173, 8, 4, 213, 175, 8,
+ 4, 213, 174, 8, 4, 213, 191, 8, 4, 213, 214, 8, 4, 213, 197, 8, 4, 213,
+ 246, 8, 4, 214, 6, 8, 4, 213, 251, 8, 4, 212, 23, 8, 4, 212, 22, 8, 4,
+ 212, 37, 8, 4, 212, 25, 8, 4, 212, 30, 8, 4, 212, 32, 8, 4, 212, 31, 8,
+ 4, 212, 95, 8, 4, 212, 92, 8, 4, 212, 109, 8, 4, 212, 98, 8, 4, 212, 1,
+ 8, 4, 212, 3, 8, 4, 212, 2, 8, 4, 212, 12, 8, 4, 212, 11, 8, 4, 212, 16,
+ 8, 4, 212, 13, 8, 4, 212, 77, 8, 4, 212, 87, 8, 4, 212, 81, 8, 4, 211,
+ 253, 8, 4, 211, 252, 8, 4, 212, 8, 8, 4, 212, 0, 8, 4, 211, 254, 8, 4,
+ 211, 255, 8, 4, 211, 244, 8, 4, 211, 243, 8, 4, 211, 249, 8, 4, 211, 247,
+ 8, 4, 211, 245, 8, 4, 211, 246, 8, 4, 249, 221, 8, 4, 249, 217, 8, 4,
+ 249, 244, 8, 4, 249, 230, 8, 4, 249, 241, 8, 4, 249, 235, 8, 4, 249, 243,
+ 8, 4, 249, 242, 8, 4, 250, 156, 8, 4, 250, 150, 8, 4, 250, 219, 8, 4,
+ 250, 183, 8, 4, 249, 45, 8, 4, 249, 47, 8, 4, 249, 46, 8, 4, 249, 92, 8,
+ 4, 249, 83, 8, 4, 249, 175, 8, 4, 249, 108, 8, 4, 250, 94, 8, 4, 250,
+ 124, 8, 4, 250, 99, 8, 4, 249, 26, 8, 4, 249, 25, 8, 4, 249, 53, 8, 4,
+ 249, 43, 8, 4, 249, 31, 8, 4, 249, 42, 8, 4, 249, 6, 8, 4, 249, 5, 8, 4,
+ 249, 16, 8, 4, 249, 12, 8, 4, 249, 7, 8, 4, 249, 9, 8, 4, 211, 227, 8, 4,
+ 211, 226, 8, 4, 211, 233, 8, 4, 211, 228, 8, 4, 211, 230, 8, 4, 211, 229,
+ 8, 4, 211, 232, 8, 4, 211, 231, 8, 4, 211, 239, 8, 4, 211, 238, 8, 4,
+ 211, 242, 8, 4, 211, 240, 8, 4, 211, 223, 8, 4, 211, 225, 8, 4, 211, 224,
+ 8, 4, 211, 234, 8, 4, 211, 237, 8, 4, 211, 235, 8, 4, 211, 218, 8, 4,
+ 211, 222, 8, 4, 211, 221, 8, 4, 211, 219, 8, 4, 211, 220, 8, 4, 211, 213,
+ 8, 4, 211, 212, 8, 4, 211, 217, 8, 4, 211, 216, 8, 4, 211, 214, 8, 4,
+ 211, 215, 8, 4, 227, 224, 8, 4, 227, 223, 8, 4, 227, 229, 8, 4, 227, 225,
+ 8, 4, 227, 226, 8, 4, 227, 228, 8, 4, 227, 227, 8, 4, 227, 234, 8, 4,
+ 227, 233, 8, 4, 227, 237, 8, 4, 227, 236, 8, 4, 227, 217, 8, 4, 227, 218,
+ 8, 4, 227, 221, 8, 4, 227, 222, 8, 4, 227, 230, 8, 4, 227, 232, 8, 4,
+ 227, 212, 8, 4, 227, 220, 8, 4, 227, 216, 8, 4, 227, 213, 8, 4, 227, 214,
+ 8, 4, 227, 207, 8, 4, 227, 206, 8, 4, 227, 211, 8, 4, 227, 210, 8, 4,
+ 227, 208, 8, 4, 227, 209, 8, 4, 220, 55, 8, 4, 189, 8, 4, 220, 117, 8, 4,
+ 220, 58, 8, 4, 220, 109, 8, 4, 220, 112, 8, 4, 220, 110, 8, 4, 222, 142,
+ 8, 4, 222, 132, 8, 4, 222, 202, 8, 4, 222, 150, 8, 4, 218, 228, 8, 4,
+ 218, 230, 8, 4, 218, 229, 8, 4, 219, 221, 8, 4, 219, 210, 8, 4, 219, 242,
+ 8, 4, 219, 224, 8, 4, 221, 35, 8, 4, 222, 100, 8, 4, 221, 59, 8, 4, 218,
+ 206, 8, 4, 218, 204, 8, 4, 219, 27, 8, 4, 218, 227, 8, 4, 218, 209, 8, 4,
+ 218, 217, 8, 4, 218, 113, 8, 4, 218, 112, 8, 4, 218, 177, 8, 4, 218, 119,
+ 8, 4, 218, 114, 8, 4, 218, 118, 8, 4, 219, 123, 8, 4, 219, 122, 8, 4,
+ 219, 128, 8, 4, 219, 124, 8, 4, 219, 125, 8, 4, 219, 127, 8, 4, 219, 126,
+ 8, 4, 219, 135, 8, 4, 219, 134, 8, 4, 219, 157, 8, 4, 219, 136, 8, 4,
+ 219, 119, 8, 4, 219, 118, 8, 4, 219, 121, 8, 4, 219, 120, 8, 4, 219, 130,
+ 8, 4, 219, 133, 8, 4, 219, 131, 8, 4, 219, 115, 8, 4, 219, 114, 8, 4,
+ 219, 117, 8, 4, 219, 116, 8, 4, 219, 109, 8, 4, 219, 108, 8, 4, 219, 113,
+ 8, 4, 219, 112, 8, 4, 219, 110, 8, 4, 219, 111, 8, 4, 212, 70, 8, 4, 212,
+ 69, 8, 4, 212, 75, 8, 4, 212, 72, 8, 4, 212, 52, 8, 4, 212, 54, 8, 4,
+ 212, 53, 8, 4, 212, 57, 8, 4, 212, 56, 8, 4, 212, 60, 8, 4, 212, 58, 8,
+ 4, 212, 64, 8, 4, 212, 63, 8, 4, 212, 67, 8, 4, 212, 65, 8, 4, 212, 48,
+ 8, 4, 212, 47, 8, 4, 212, 55, 8, 4, 212, 51, 8, 4, 212, 49, 8, 4, 212,
+ 50, 8, 4, 212, 40, 8, 4, 212, 39, 8, 4, 212, 44, 8, 4, 212, 43, 8, 4,
+ 212, 41, 8, 4, 212, 42, 8, 4, 250, 72, 8, 4, 250, 69, 8, 4, 250, 92, 8,
+ 4, 250, 80, 8, 4, 250, 2, 8, 4, 250, 1, 8, 4, 250, 4, 8, 4, 250, 3, 8, 4,
+ 250, 16, 8, 4, 250, 15, 8, 4, 250, 23, 8, 4, 250, 18, 8, 4, 250, 52, 8,
+ 4, 250, 50, 8, 4, 250, 67, 8, 4, 250, 58, 8, 4, 249, 252, 8, 4, 250, 6,
+ 8, 4, 250, 0, 8, 4, 249, 253, 8, 4, 249, 255, 8, 4, 249, 246, 8, 4, 249,
+ 245, 8, 4, 249, 250, 8, 4, 249, 249, 8, 4, 249, 247, 8, 4, 249, 248, 8,
+ 4, 223, 80, 8, 4, 223, 81, 8, 4, 223, 67, 8, 4, 223, 68, 8, 4, 223, 71,
+ 8, 4, 223, 70, 8, 4, 223, 73, 8, 4, 223, 72, 8, 4, 223, 75, 8, 4, 223,
+ 74, 8, 4, 223, 79, 8, 4, 223, 76, 8, 4, 223, 63, 8, 4, 223, 62, 8, 4,
+ 223, 69, 8, 4, 223, 66, 8, 4, 223, 64, 8, 4, 223, 65, 8, 4, 223, 57, 8,
+ 4, 223, 56, 8, 4, 223, 61, 8, 4, 223, 60, 8, 4, 223, 58, 8, 4, 223, 59,
+ 8, 4, 228, 145, 8, 4, 228, 144, 8, 4, 228, 147, 8, 4, 228, 146, 8, 4,
+ 228, 137, 8, 4, 228, 139, 8, 4, 228, 138, 8, 4, 228, 141, 8, 4, 228, 140,
+ 8, 4, 228, 143, 8, 4, 228, 142, 8, 4, 228, 132, 8, 4, 228, 131, 8, 4,
+ 228, 136, 8, 4, 228, 135, 8, 4, 228, 133, 8, 4, 228, 134, 8, 4, 228, 126,
+ 8, 4, 228, 125, 8, 4, 228, 130, 8, 4, 228, 129, 8, 4, 228, 127, 8, 4,
+ 228, 128, 8, 4, 220, 251, 8, 4, 220, 247, 8, 4, 221, 24, 8, 4, 221, 6, 8,
+ 4, 220, 140, 8, 4, 220, 142, 8, 4, 220, 141, 8, 4, 220, 160, 8, 4, 220,
+ 157, 8, 4, 220, 187, 8, 4, 220, 178, 8, 4, 220, 222, 8, 4, 220, 215, 8,
+ 4, 220, 243, 8, 4, 220, 230, 8, 4, 220, 136, 8, 4, 220, 135, 8, 4, 220,
+ 150, 8, 4, 220, 139, 8, 4, 220, 137, 8, 4, 220, 138, 8, 4, 220, 120, 8,
+ 4, 220, 119, 8, 4, 220, 126, 8, 4, 220, 123, 8, 4, 220, 121, 8, 4, 220,
+ 122, 8, 4, 224, 33, 8, 4, 224, 28, 8, 4, 203, 8, 4, 224, 39, 8, 4, 223,
+ 31, 8, 4, 223, 33, 8, 4, 223, 32, 8, 4, 223, 90, 8, 4, 223, 83, 8, 4,
+ 223, 112, 8, 4, 223, 94, 8, 4, 223, 196, 8, 4, 224, 21, 8, 4, 223, 231,
+ 8, 4, 223, 24, 8, 4, 223, 22, 8, 4, 223, 51, 8, 4, 223, 30, 8, 4, 223,
+ 26, 8, 4, 223, 27, 8, 4, 223, 7, 8, 4, 223, 6, 8, 4, 223, 12, 8, 4, 223,
+ 10, 8, 4, 223, 8, 8, 4, 223, 9, 8, 4, 235, 101, 8, 4, 235, 100, 8, 4,
+ 235, 110, 8, 4, 235, 102, 8, 4, 235, 106, 8, 4, 235, 105, 8, 4, 235, 108,
+ 8, 4, 235, 107, 8, 4, 235, 44, 8, 4, 235, 43, 8, 4, 235, 46, 8, 4, 235,
+ 45, 8, 4, 235, 59, 8, 4, 235, 57, 8, 4, 235, 71, 8, 4, 235, 61, 8, 4,
+ 235, 38, 8, 4, 235, 36, 8, 4, 235, 54, 8, 4, 235, 42, 8, 4, 235, 39, 8,
+ 4, 235, 40, 8, 4, 235, 30, 8, 4, 235, 29, 8, 4, 235, 34, 8, 4, 235, 33,
+ 8, 4, 235, 31, 8, 4, 235, 32, 8, 4, 224, 191, 8, 4, 224, 189, 8, 4, 224,
+ 198, 8, 4, 224, 192, 8, 4, 224, 195, 8, 4, 224, 194, 8, 4, 224, 197, 8,
+ 4, 224, 196, 8, 4, 224, 144, 8, 4, 224, 141, 8, 4, 224, 146, 8, 4, 224,
+ 145, 8, 4, 224, 178, 8, 4, 224, 177, 8, 4, 224, 187, 8, 4, 224, 181, 8,
+ 4, 224, 136, 8, 4, 224, 132, 8, 4, 224, 175, 8, 4, 224, 140, 8, 4, 224,
+ 138, 8, 4, 224, 139, 8, 4, 224, 116, 8, 4, 224, 114, 8, 4, 224, 126, 8,
+ 4, 224, 119, 8, 4, 224, 117, 8, 4, 224, 118, 8, 4, 235, 90, 8, 4, 235,
+ 89, 8, 4, 235, 96, 8, 4, 235, 91, 8, 4, 235, 93, 8, 4, 235, 92, 8, 4,
+ 235, 95, 8, 4, 235, 94, 8, 4, 235, 81, 8, 4, 235, 83, 8, 4, 235, 82, 8,
+ 4, 235, 86, 8, 4, 235, 85, 8, 4, 235, 88, 8, 4, 235, 87, 8, 4, 235, 77,
+ 8, 4, 235, 76, 8, 4, 235, 84, 8, 4, 235, 80, 8, 4, 235, 78, 8, 4, 235,
+ 79, 8, 4, 235, 73, 8, 4, 235, 72, 8, 4, 235, 75, 8, 4, 235, 74, 8, 4,
+ 228, 249, 8, 4, 228, 248, 8, 4, 229, 0, 8, 4, 228, 250, 8, 4, 228, 252,
+ 8, 4, 228, 251, 8, 4, 228, 255, 8, 4, 228, 253, 8, 4, 228, 238, 8, 4,
+ 228, 239, 8, 4, 228, 244, 8, 4, 228, 243, 8, 4, 228, 247, 8, 4, 228, 245,
+ 8, 4, 228, 233, 8, 4, 228, 242, 8, 4, 228, 237, 8, 4, 228, 234, 8, 4,
+ 228, 235, 8, 4, 228, 228, 8, 4, 228, 227, 8, 4, 228, 232, 8, 4, 228, 231,
+ 8, 4, 228, 229, 8, 4, 228, 230, 8, 4, 228, 0, 8, 4, 227, 255, 8, 4, 228,
+ 10, 8, 4, 228, 4, 8, 4, 228, 7, 8, 4, 228, 6, 8, 4, 228, 9, 8, 4, 228, 8,
+ 8, 4, 227, 243, 8, 4, 227, 245, 8, 4, 227, 244, 8, 4, 227, 249, 8, 4,
+ 227, 248, 8, 4, 227, 253, 8, 4, 227, 250, 8, 4, 227, 241, 8, 4, 227, 240,
+ 8, 4, 227, 247, 8, 4, 227, 242, 8, 4, 213, 138, 8, 4, 213, 137, 8, 4,
+ 213, 145, 8, 4, 213, 140, 8, 4, 213, 142, 8, 4, 213, 141, 8, 4, 213, 144,
+ 8, 4, 213, 143, 8, 4, 213, 127, 8, 4, 213, 128, 8, 4, 213, 132, 8, 4,
+ 213, 131, 8, 4, 213, 136, 8, 4, 213, 134, 8, 4, 213, 109, 8, 4, 213, 107,
+ 8, 4, 213, 119, 8, 4, 213, 112, 8, 4, 213, 110, 8, 4, 213, 111, 8, 4,
+ 212, 241, 8, 4, 212, 239, 8, 4, 212, 255, 8, 4, 212, 242, 8, 4, 212, 249,
+ 8, 4, 212, 248, 8, 4, 212, 252, 8, 4, 212, 250, 8, 4, 212, 182, 8, 4,
+ 212, 181, 8, 4, 212, 185, 8, 4, 212, 183, 8, 4, 212, 215, 8, 4, 212, 212,
+ 8, 4, 212, 235, 8, 4, 212, 219, 8, 4, 212, 173, 8, 4, 212, 170, 8, 4,
+ 212, 203, 8, 4, 212, 180, 8, 4, 212, 176, 8, 4, 212, 177, 8, 4, 212, 155,
+ 8, 4, 212, 154, 8, 4, 212, 161, 8, 4, 212, 158, 8, 4, 212, 156, 8, 4,
+ 212, 157, 8, 34, 224, 178, 8, 34, 233, 13, 8, 34, 234, 70, 8, 34, 228, 4,
+ 8, 34, 249, 12, 8, 34, 219, 128, 8, 34, 242, 244, 8, 34, 243, 20, 8, 34,
+ 231, 42, 8, 34, 240, 172, 8, 34, 232, 116, 8, 34, 252, 3, 8, 34, 230,
+ 196, 8, 34, 212, 235, 8, 34, 225, 8, 8, 34, 240, 166, 8, 34, 217, 253, 8,
+ 34, 243, 110, 8, 34, 212, 0, 8, 34, 249, 6, 8, 34, 248, 46, 8, 34, 251,
+ 27, 8, 34, 242, 240, 8, 34, 227, 250, 8, 34, 216, 82, 8, 34, 227, 41, 8,
+ 34, 235, 77, 8, 34, 212, 12, 8, 34, 224, 244, 8, 34, 241, 94, 8, 34, 212,
+ 241, 8, 34, 214, 95, 8, 34, 220, 126, 8, 34, 214, 221, 8, 34, 212, 109,
+ 8, 34, 235, 71, 8, 34, 227, 216, 8, 34, 235, 75, 8, 34, 242, 130, 8, 34,
+ 235, 95, 8, 34, 213, 214, 8, 34, 246, 33, 8, 34, 220, 138, 8, 34, 233, 8,
+ 8, 34, 249, 16, 8, 34, 249, 46, 8, 34, 249, 230, 8, 34, 240, 169, 8, 34,
+ 220, 251, 8, 34, 211, 255, 8, 34, 220, 178, 8, 34, 250, 67, 8, 34, 211,
+ 230, 8, 34, 229, 252, 8, 34, 234, 188, 232, 225, 1, 252, 107, 232, 225,
+ 1, 193, 232, 225, 1, 226, 23, 232, 225, 1, 248, 164, 232, 225, 1, 218,
+ 52, 232, 225, 1, 217, 161, 232, 225, 1, 243, 110, 232, 225, 1, 181, 232,
+ 225, 1, 234, 138, 232, 225, 1, 235, 139, 232, 225, 1, 250, 219, 232, 225,
+ 1, 250, 92, 232, 225, 1, 245, 249, 232, 225, 1, 216, 141, 232, 225, 1,
+ 216, 133, 232, 225, 1, 188, 232, 225, 1, 205, 232, 225, 1, 233, 157, 232,
+ 225, 1, 222, 202, 232, 225, 1, 212, 75, 232, 225, 1, 212, 109, 232, 225,
+ 1, 229, 159, 232, 225, 1, 159, 232, 225, 1, 213, 153, 232, 225, 1, 241,
+ 174, 232, 225, 1, 244, 164, 232, 225, 1, 214, 49, 232, 225, 1, 221, 24,
+ 232, 225, 1, 186, 232, 225, 1, 242, 225, 232, 225, 1, 61, 232, 225, 1,
+ 254, 148, 232, 225, 1, 74, 232, 225, 1, 245, 22, 232, 225, 1, 72, 232,
+ 225, 1, 75, 232, 225, 1, 69, 232, 225, 1, 215, 183, 232, 225, 1, 215,
+ 178, 232, 225, 1, 227, 99, 232, 225, 1, 160, 230, 104, 217, 71, 232, 225,
+ 1, 160, 230, 46, 225, 150, 232, 225, 1, 160, 230, 104, 249, 15, 232, 225,
+ 1, 160, 230, 104, 251, 128, 232, 225, 1, 160, 230, 104, 205, 232, 225, 1,
+ 160, 230, 104, 235, 116, 232, 225, 225, 27, 249, 157, 232, 225, 225, 27,
+ 243, 200, 219, 69, 39, 4, 245, 165, 39, 4, 245, 162, 39, 4, 241, 204, 39,
+ 4, 214, 1, 39, 4, 214, 0, 39, 4, 226, 86, 39, 4, 251, 191, 39, 4, 251,
+ 242, 39, 4, 231, 179, 39, 4, 234, 0, 39, 4, 231, 73, 39, 4, 243, 51, 39,
+ 4, 244, 116, 39, 4, 214, 227, 39, 4, 217, 219, 39, 4, 217, 147, 39, 4,
+ 247, 224, 39, 4, 247, 221, 39, 4, 233, 74, 39, 4, 224, 1, 39, 4, 248, 28,
+ 39, 4, 229, 219, 39, 4, 222, 89, 39, 4, 220, 241, 39, 4, 212, 85, 39, 4,
+ 212, 66, 39, 4, 250, 116, 39, 4, 235, 125, 39, 4, 229, 7, 39, 4, 213, 35,
+ 39, 4, 234, 187, 39, 4, 229, 136, 39, 4, 243, 31, 39, 4, 231, 145, 39, 4,
+ 229, 184, 39, 4, 228, 16, 39, 4, 72, 39, 4, 235, 251, 39, 4, 241, 165,
+ 39, 4, 241, 146, 39, 4, 213, 235, 39, 4, 213, 226, 39, 4, 225, 240, 39,
+ 4, 251, 189, 39, 4, 251, 184, 39, 4, 231, 172, 39, 4, 233, 253, 39, 4,
+ 231, 70, 39, 4, 243, 47, 39, 4, 244, 90, 39, 4, 214, 154, 39, 4, 217, 71,
+ 39, 4, 217, 128, 39, 4, 247, 216, 39, 4, 247, 220, 39, 4, 233, 13, 39, 4,
+ 223, 188, 39, 4, 247, 211, 39, 4, 229, 213, 39, 4, 220, 117, 39, 4, 220,
+ 212, 39, 4, 212, 37, 39, 4, 212, 62, 39, 4, 249, 244, 39, 4, 235, 110,
+ 39, 4, 229, 0, 39, 4, 212, 255, 39, 4, 234, 101, 39, 4, 229, 128, 39, 4,
+ 242, 190, 39, 4, 231, 42, 39, 4, 229, 64, 39, 4, 228, 10, 39, 4, 61, 39,
+ 4, 254, 32, 39, 4, 229, 155, 39, 4, 159, 39, 4, 242, 1, 39, 4, 214, 49,
+ 39, 4, 214, 39, 39, 4, 193, 39, 4, 251, 195, 39, 4, 252, 107, 39, 4, 231,
+ 187, 39, 4, 234, 4, 39, 4, 234, 3, 39, 4, 231, 77, 39, 4, 243, 55, 39, 4,
+ 244, 164, 39, 4, 215, 1, 39, 4, 218, 52, 39, 4, 217, 161, 39, 4, 247,
+ 232, 39, 4, 247, 223, 39, 4, 233, 157, 39, 4, 203, 39, 4, 248, 164, 39,
+ 4, 229, 228, 39, 4, 222, 202, 39, 4, 221, 24, 39, 4, 212, 109, 39, 4,
+ 212, 75, 39, 4, 250, 219, 39, 4, 235, 139, 39, 4, 229, 16, 39, 4, 186,
+ 39, 4, 181, 39, 4, 234, 239, 39, 4, 229, 141, 39, 4, 243, 110, 39, 4,
+ 188, 39, 4, 205, 39, 4, 228, 23, 39, 4, 227, 49, 39, 4, 227, 45, 39, 4,
+ 241, 39, 39, 4, 213, 202, 39, 4, 213, 198, 39, 4, 225, 129, 39, 4, 251,
+ 187, 39, 4, 251, 118, 39, 4, 231, 167, 39, 4, 233, 251, 39, 4, 231, 66,
+ 39, 4, 243, 43, 39, 4, 244, 3, 39, 4, 214, 108, 39, 4, 216, 230, 39, 4,
+ 217, 106, 39, 4, 247, 214, 39, 4, 247, 218, 39, 4, 232, 180, 39, 4, 223,
+ 99, 39, 4, 247, 79, 39, 4, 229, 200, 39, 4, 219, 226, 39, 4, 220, 181,
+ 39, 4, 212, 14, 39, 4, 212, 59, 39, 4, 249, 113, 39, 4, 235, 62, 39, 4,
+ 228, 246, 39, 4, 212, 220, 39, 4, 234, 19, 39, 4, 229, 126, 39, 4, 242,
+ 140, 39, 4, 230, 202, 39, 4, 228, 175, 39, 4, 227, 251, 39, 4, 69, 39, 4,
+ 215, 160, 39, 4, 240, 212, 39, 4, 240, 202, 39, 4, 213, 183, 39, 4, 213,
+ 177, 39, 4, 225, 35, 39, 4, 251, 186, 39, 4, 251, 54, 39, 4, 231, 166,
+ 39, 4, 233, 249, 39, 4, 231, 65, 39, 4, 243, 42, 39, 4, 243, 205, 39, 4,
+ 214, 99, 39, 4, 216, 82, 39, 4, 217, 90, 39, 4, 247, 212, 39, 4, 247,
+ 217, 39, 4, 232, 156, 39, 4, 223, 51, 39, 4, 246, 33, 39, 4, 229, 195,
+ 39, 4, 219, 27, 39, 4, 220, 150, 39, 4, 212, 8, 39, 4, 212, 55, 39, 4,
+ 249, 53, 39, 4, 235, 54, 39, 4, 228, 242, 39, 4, 212, 203, 39, 4, 233,
+ 238, 39, 4, 229, 125, 39, 4, 242, 92, 39, 4, 230, 172, 39, 4, 228, 92,
+ 39, 4, 227, 247, 39, 4, 75, 39, 4, 227, 62, 39, 4, 229, 86, 39, 4, 241,
+ 54, 39, 4, 241, 42, 39, 4, 213, 214, 39, 4, 213, 203, 39, 4, 225, 150,
+ 39, 4, 251, 188, 39, 4, 251, 128, 39, 4, 231, 168, 39, 4, 233, 252, 39,
+ 4, 231, 68, 39, 4, 243, 45, 39, 4, 243, 44, 39, 4, 244, 12, 39, 4, 214,
+ 119, 39, 4, 108, 39, 4, 217, 109, 39, 4, 247, 215, 39, 4, 247, 219, 39,
+ 4, 232, 208, 39, 4, 223, 112, 39, 4, 247, 99, 39, 4, 229, 204, 39, 4,
+ 219, 242, 39, 4, 220, 187, 39, 4, 212, 16, 39, 4, 212, 60, 39, 4, 249,
+ 175, 39, 4, 235, 71, 39, 4, 228, 247, 39, 4, 212, 235, 39, 4, 234, 37,
+ 39, 4, 229, 127, 39, 4, 242, 150, 39, 4, 230, 231, 39, 4, 228, 185, 39,
+ 4, 227, 253, 39, 4, 74, 39, 4, 245, 108, 39, 4, 229, 146, 39, 4, 241,
+ 222, 39, 4, 241, 193, 39, 4, 214, 6, 39, 4, 213, 253, 39, 4, 226, 96, 39,
+ 4, 251, 192, 39, 4, 251, 251, 39, 4, 231, 180, 39, 4, 234, 1, 39, 4, 233,
+ 255, 39, 4, 231, 74, 39, 4, 243, 52, 39, 4, 243, 50, 39, 4, 244, 123, 39,
+ 4, 214, 232, 39, 4, 217, 229, 39, 4, 217, 148, 39, 4, 247, 225, 39, 4,
+ 247, 222, 39, 4, 233, 82, 39, 4, 224, 21, 39, 4, 248, 41, 39, 4, 229,
+ 220, 39, 4, 222, 100, 39, 4, 220, 243, 39, 4, 212, 87, 39, 4, 212, 67,
+ 39, 4, 250, 124, 39, 4, 235, 127, 39, 4, 229, 9, 39, 4, 213, 38, 39, 4,
+ 234, 188, 39, 4, 229, 137, 39, 4, 229, 133, 39, 4, 243, 38, 39, 4, 243,
+ 27, 39, 4, 231, 156, 39, 4, 229, 187, 39, 4, 228, 17, 39, 4, 229, 161,
+ 39, 4, 233, 46, 39, 249, 157, 39, 243, 200, 219, 69, 39, 224, 158, 77,
+ 39, 4, 229, 203, 244, 164, 39, 4, 229, 203, 181, 39, 4, 229, 203, 219,
+ 226, 39, 16, 244, 113, 39, 16, 234, 186, 39, 16, 217, 34, 39, 16, 229,
+ 39, 39, 16, 252, 66, 39, 16, 244, 163, 39, 16, 218, 49, 39, 16, 248, 121,
+ 39, 16, 247, 78, 39, 16, 233, 227, 39, 16, 216, 234, 39, 16, 247, 98, 39,
+ 16, 235, 63, 39, 21, 212, 79, 39, 21, 116, 39, 21, 109, 39, 21, 166, 39,
+ 21, 163, 39, 21, 180, 39, 21, 189, 39, 21, 198, 39, 21, 195, 39, 21, 200,
+ 39, 4, 229, 203, 188, 39, 4, 229, 203, 247, 99, 33, 6, 1, 212, 83, 33, 3,
+ 1, 212, 83, 33, 6, 1, 245, 245, 33, 3, 1, 245, 245, 33, 6, 1, 223, 202,
+ 245, 247, 33, 3, 1, 223, 202, 245, 247, 33, 6, 1, 235, 183, 33, 3, 1,
+ 235, 183, 33, 6, 1, 247, 113, 33, 3, 1, 247, 113, 33, 6, 1, 230, 210,
+ 215, 175, 33, 3, 1, 230, 210, 215, 175, 33, 6, 1, 251, 64, 227, 67, 33,
+ 3, 1, 251, 64, 227, 67, 33, 6, 1, 229, 169, 213, 22, 33, 3, 1, 229, 169,
+ 213, 22, 33, 6, 1, 213, 19, 2, 252, 102, 213, 22, 33, 3, 1, 213, 19, 2,
+ 252, 102, 213, 22, 33, 6, 1, 235, 181, 213, 49, 33, 3, 1, 235, 181, 213,
+ 49, 33, 6, 1, 223, 202, 212, 203, 33, 3, 1, 223, 202, 212, 203, 33, 6, 1,
+ 235, 181, 61, 33, 3, 1, 235, 181, 61, 33, 6, 1, 249, 193, 232, 221, 212,
+ 174, 33, 3, 1, 249, 193, 232, 221, 212, 174, 33, 6, 1, 251, 137, 212,
+ 174, 33, 3, 1, 251, 137, 212, 174, 33, 6, 1, 235, 181, 249, 193, 232,
+ 221, 212, 174, 33, 3, 1, 235, 181, 249, 193, 232, 221, 212, 174, 33, 6,
+ 1, 212, 237, 33, 3, 1, 212, 237, 33, 6, 1, 223, 202, 216, 136, 33, 3, 1,
+ 223, 202, 216, 136, 33, 6, 1, 219, 236, 248, 41, 33, 3, 1, 219, 236, 248,
+ 41, 33, 6, 1, 219, 236, 245, 131, 33, 3, 1, 219, 236, 245, 131, 33, 6, 1,
+ 219, 236, 245, 117, 33, 3, 1, 219, 236, 245, 117, 33, 6, 1, 230, 214, 75,
+ 33, 3, 1, 230, 214, 75, 33, 6, 1, 251, 163, 75, 33, 3, 1, 251, 163, 75,
+ 33, 6, 1, 51, 230, 214, 75, 33, 3, 1, 51, 230, 214, 75, 33, 1, 230, 156,
+ 75, 37, 33, 214, 84, 37, 33, 217, 201, 231, 4, 52, 37, 33, 240, 201, 231,
+ 4, 52, 37, 33, 217, 101, 231, 4, 52, 220, 21, 253, 132, 37, 33, 234, 198,
+ 37, 33, 226, 101, 33, 234, 198, 33, 226, 101, 33, 6, 1, 246, 1, 33, 3, 1,
+ 246, 1, 33, 6, 1, 245, 238, 33, 3, 1, 245, 238, 33, 6, 1, 212, 45, 33, 3,
+ 1, 212, 45, 33, 6, 1, 250, 140, 33, 3, 1, 250, 140, 33, 6, 1, 245, 237,
+ 33, 3, 1, 245, 237, 33, 6, 1, 217, 230, 2, 231, 37, 101, 33, 3, 1, 217,
+ 230, 2, 231, 37, 101, 33, 6, 1, 216, 43, 33, 3, 1, 216, 43, 33, 6, 1,
+ 216, 119, 33, 3, 1, 216, 119, 33, 6, 1, 216, 123, 33, 3, 1, 216, 123, 33,
+ 6, 1, 217, 235, 33, 3, 1, 217, 235, 33, 6, 1, 240, 190, 33, 3, 1, 240,
+ 190, 33, 6, 1, 220, 132, 33, 3, 1, 220, 132, 20, 1, 61, 20, 1, 181, 20,
+ 1, 69, 20, 1, 233, 238, 20, 1, 245, 165, 20, 1, 224, 1, 20, 1, 218, 35,
+ 20, 1, 75, 20, 1, 228, 10, 20, 1, 72, 20, 1, 233, 157, 20, 1, 193, 20, 1,
+ 223, 136, 20, 1, 223, 182, 20, 1, 233, 73, 20, 1, 231, 144, 20, 1, 218,
+ 49, 20, 1, 229, 226, 20, 1, 229, 14, 20, 1, 183, 20, 1, 218, 205, 20, 1,
+ 230, 172, 20, 1, 220, 207, 20, 1, 220, 117, 20, 1, 220, 217, 20, 1, 221,
+ 44, 20, 1, 233, 177, 20, 1, 234, 162, 20, 1, 228, 64, 20, 1, 228, 92, 20,
+ 1, 228, 241, 20, 1, 212, 217, 20, 1, 220, 150, 20, 1, 212, 178, 20, 1,
+ 186, 20, 1, 228, 120, 20, 1, 234, 148, 20, 1, 226, 27, 20, 1, 229, 7, 20,
+ 1, 228, 101, 20, 1, 225, 30, 20, 1, 213, 180, 20, 1, 226, 86, 20, 1, 244,
+ 116, 20, 1, 223, 51, 20, 1, 232, 156, 20, 1, 231, 42, 20, 1, 229, 64, 20,
+ 1, 223, 204, 20, 1, 224, 61, 20, 1, 234, 171, 20, 1, 229, 93, 20, 1, 229,
+ 141, 20, 1, 229, 159, 20, 1, 220, 187, 20, 1, 225, 33, 20, 1, 243, 205,
+ 20, 1, 244, 6, 20, 1, 214, 49, 20, 1, 205, 20, 1, 233, 13, 20, 1, 225,
+ 240, 20, 1, 232, 174, 20, 1, 234, 37, 20, 1, 231, 177, 20, 1, 223, 233,
+ 20, 1, 231, 122, 20, 1, 188, 20, 1, 217, 71, 20, 1, 234, 101, 20, 1, 230,
+ 231, 20, 1, 231, 185, 20, 1, 217, 183, 20, 1, 234, 4, 20, 1, 217, 200,
+ 20, 1, 228, 93, 20, 1, 222, 166, 20, 1, 244, 160, 20, 1, 234, 6, 20, 1,
+ 234, 33, 20, 37, 152, 234, 14, 20, 37, 152, 216, 74, 20, 229, 13, 20,
+ 243, 200, 219, 69, 20, 249, 164, 20, 249, 157, 20, 221, 70, 20, 224, 158,
+ 77, 59, 1, 250, 33, 160, 212, 245, 225, 193, 59, 1, 250, 33, 160, 213,
+ 59, 225, 193, 59, 1, 250, 33, 160, 212, 245, 221, 7, 59, 1, 250, 33, 160,
+ 213, 59, 221, 7, 59, 1, 250, 33, 160, 212, 245, 224, 175, 59, 1, 250, 33,
+ 160, 213, 59, 224, 175, 59, 1, 250, 33, 160, 212, 245, 223, 51, 59, 1,
+ 250, 33, 160, 213, 59, 223, 51, 59, 1, 244, 244, 246, 72, 160, 134, 59,
+ 1, 124, 246, 72, 160, 134, 59, 1, 231, 38, 246, 72, 160, 134, 59, 1, 115,
+ 246, 72, 160, 134, 59, 1, 244, 243, 246, 72, 160, 134, 59, 1, 244, 244,
+ 246, 72, 233, 63, 160, 134, 59, 1, 124, 246, 72, 233, 63, 160, 134, 59,
+ 1, 231, 38, 246, 72, 233, 63, 160, 134, 59, 1, 115, 246, 72, 233, 63,
+ 160, 134, 59, 1, 244, 243, 246, 72, 233, 63, 160, 134, 59, 1, 244, 244,
+ 233, 63, 160, 134, 59, 1, 124, 233, 63, 160, 134, 59, 1, 231, 38, 233,
+ 63, 160, 134, 59, 1, 115, 233, 63, 160, 134, 59, 1, 244, 243, 233, 63,
+ 160, 134, 59, 1, 62, 71, 134, 59, 1, 62, 220, 23, 59, 1, 62, 199, 134,
+ 59, 1, 232, 163, 46, 249, 100, 254, 18, 59, 1, 224, 48, 114, 68, 59, 1,
+ 224, 48, 119, 68, 59, 1, 224, 48, 244, 254, 77, 59, 1, 224, 48, 235, 191,
+ 244, 254, 77, 59, 1, 115, 235, 191, 244, 254, 77, 59, 1, 219, 51, 24,
+ 124, 216, 241, 59, 1, 219, 51, 24, 115, 216, 241, 7, 6, 1, 245, 156, 254,
+ 78, 7, 3, 1, 245, 156, 254, 78, 7, 6, 1, 245, 156, 254, 103, 7, 3, 1,
+ 245, 156, 254, 103, 7, 6, 1, 241, 191, 7, 3, 1, 241, 191, 7, 6, 1, 216,
+ 6, 7, 3, 1, 216, 6, 7, 6, 1, 216, 187, 7, 3, 1, 216, 187, 7, 6, 1, 249,
+ 51, 7, 3, 1, 249, 51, 7, 6, 1, 249, 52, 2, 249, 157, 7, 3, 1, 249, 52, 2,
+ 249, 157, 7, 1, 3, 6, 244, 230, 7, 1, 3, 6, 197, 7, 6, 1, 254, 232, 7, 3,
+ 1, 254, 232, 7, 6, 1, 253, 240, 7, 3, 1, 253, 240, 7, 6, 1, 253, 108, 7,
+ 3, 1, 253, 108, 7, 6, 1, 253, 92, 7, 3, 1, 253, 92, 7, 6, 1, 253, 93, 2,
+ 199, 134, 7, 3, 1, 253, 93, 2, 199, 134, 7, 6, 1, 253, 83, 7, 3, 1, 253,
+ 83, 7, 6, 1, 223, 202, 250, 253, 2, 247, 74, 7, 3, 1, 223, 202, 250, 253,
+ 2, 247, 74, 7, 6, 1, 235, 28, 2, 90, 7, 3, 1, 235, 28, 2, 90, 7, 6, 1,
+ 235, 28, 2, 247, 207, 90, 7, 3, 1, 235, 28, 2, 247, 207, 90, 7, 6, 1,
+ 235, 28, 2, 219, 45, 24, 247, 207, 90, 7, 3, 1, 235, 28, 2, 219, 45, 24,
+ 247, 207, 90, 7, 6, 1, 251, 63, 150, 7, 3, 1, 251, 63, 150, 7, 6, 1, 233,
+ 171, 2, 124, 90, 7, 3, 1, 233, 171, 2, 124, 90, 7, 6, 1, 157, 2, 184,
+ 219, 45, 226, 244, 7, 3, 1, 157, 2, 184, 219, 45, 226, 244, 7, 6, 1, 157,
+ 2, 232, 177, 7, 3, 1, 157, 2, 232, 177, 7, 6, 1, 227, 49, 7, 3, 1, 227,
+ 49, 7, 6, 1, 226, 230, 2, 219, 45, 217, 93, 247, 246, 7, 3, 1, 226, 230,
+ 2, 219, 45, 217, 93, 247, 246, 7, 6, 1, 226, 230, 2, 244, 22, 7, 3, 1,
+ 226, 230, 2, 244, 22, 7, 6, 1, 226, 230, 2, 219, 161, 218, 27, 7, 3, 1,
+ 226, 230, 2, 219, 161, 218, 27, 7, 6, 1, 224, 241, 2, 219, 45, 217, 93,
+ 247, 246, 7, 3, 1, 224, 241, 2, 219, 45, 217, 93, 247, 246, 7, 6, 1, 224,
+ 241, 2, 247, 207, 90, 7, 3, 1, 224, 241, 2, 247, 207, 90, 7, 6, 1, 224,
+ 113, 223, 88, 7, 3, 1, 224, 113, 223, 88, 7, 6, 1, 223, 41, 223, 88, 7,
+ 3, 1, 223, 41, 223, 88, 7, 6, 1, 215, 80, 2, 247, 207, 90, 7, 3, 1, 215,
+ 80, 2, 247, 207, 90, 7, 6, 1, 214, 90, 7, 3, 1, 214, 90, 7, 6, 1, 214,
+ 126, 212, 152, 7, 3, 1, 214, 126, 212, 152, 7, 6, 1, 217, 105, 2, 90, 7,
+ 3, 1, 217, 105, 2, 90, 7, 6, 1, 217, 105, 2, 219, 45, 217, 93, 247, 246,
+ 7, 3, 1, 217, 105, 2, 219, 45, 217, 93, 247, 246, 7, 6, 1, 214, 222, 7,
+ 3, 1, 214, 222, 7, 6, 1, 245, 30, 7, 3, 1, 245, 30, 7, 6, 1, 235, 169, 7,
+ 3, 1, 235, 169, 7, 6, 1, 249, 146, 7, 3, 1, 249, 146, 59, 1, 215, 104, 7,
+ 3, 1, 246, 24, 7, 3, 1, 232, 142, 7, 3, 1, 230, 150, 7, 3, 1, 228, 57, 7,
+ 3, 1, 223, 40, 7, 1, 3, 6, 223, 40, 7, 3, 1, 216, 72, 7, 3, 1, 215, 167,
+ 7, 6, 1, 235, 210, 249, 3, 7, 3, 1, 235, 210, 249, 3, 7, 6, 1, 235, 210,
+ 244, 230, 7, 3, 1, 235, 210, 244, 230, 7, 6, 1, 235, 210, 243, 177, 7, 6,
+ 1, 216, 58, 235, 210, 243, 177, 7, 3, 1, 216, 58, 235, 210, 243, 177, 7,
+ 6, 1, 216, 58, 150, 7, 3, 1, 216, 58, 150, 7, 6, 1, 235, 210, 149, 7, 3,
+ 1, 235, 210, 149, 7, 6, 1, 235, 210, 197, 7, 3, 1, 235, 210, 197, 7, 6,
+ 1, 235, 210, 218, 99, 7, 3, 1, 235, 210, 218, 99, 59, 1, 115, 249, 224,
+ 254, 174, 59, 1, 249, 164, 59, 1, 220, 175, 245, 61, 52, 7, 6, 1, 222,
+ 170, 7, 3, 1, 222, 170, 7, 6, 1, 216, 58, 242, 41, 7, 3, 1, 233, 171, 2,
+ 223, 207, 241, 38, 24, 251, 218, 7, 6, 1, 230, 98, 2, 247, 246, 7, 3, 1,
+ 230, 98, 2, 247, 246, 7, 6, 1, 243, 178, 2, 227, 112, 90, 7, 3, 1, 243,
+ 178, 2, 227, 112, 90, 7, 6, 1, 235, 28, 2, 227, 112, 90, 7, 3, 1, 235,
+ 28, 2, 227, 112, 90, 7, 6, 1, 230, 98, 2, 227, 112, 90, 7, 3, 1, 230, 98,
+ 2, 227, 112, 90, 7, 6, 1, 224, 113, 2, 227, 112, 90, 7, 3, 1, 224, 113,
+ 2, 227, 112, 90, 7, 6, 1, 223, 4, 2, 227, 112, 90, 7, 3, 1, 223, 4, 2,
+ 227, 112, 90, 7, 1, 3, 6, 216, 58, 183, 7, 245, 66, 1, 223, 202, 244,
+ 230, 7, 245, 66, 1, 223, 202, 226, 229, 7, 245, 66, 1, 235, 191, 183, 7,
+ 245, 66, 1, 240, 146, 232, 182, 7, 245, 66, 1, 253, 193, 183, 218, 175,
+ 230, 32, 1, 61, 218, 175, 230, 32, 1, 72, 218, 175, 230, 32, 5, 246, 3,
+ 218, 175, 230, 32, 1, 69, 218, 175, 230, 32, 1, 74, 218, 175, 230, 32, 1,
+ 75, 218, 175, 230, 32, 5, 241, 236, 218, 175, 230, 32, 1, 234, 37, 218,
+ 175, 230, 32, 1, 234, 113, 218, 175, 230, 32, 1, 242, 150, 218, 175, 230,
+ 32, 1, 242, 200, 218, 175, 230, 32, 5, 253, 242, 218, 175, 230, 32, 1,
+ 249, 175, 218, 175, 230, 32, 1, 250, 23, 218, 175, 230, 32, 1, 235, 71,
+ 218, 175, 230, 32, 1, 235, 111, 218, 175, 230, 32, 1, 216, 95, 218, 175,
+ 230, 32, 1, 216, 100, 218, 175, 230, 32, 1, 248, 56, 218, 175, 230, 32,
+ 1, 248, 65, 218, 175, 230, 32, 1, 108, 218, 175, 230, 32, 1, 217, 109,
+ 218, 175, 230, 32, 1, 247, 99, 218, 175, 230, 32, 1, 247, 215, 218, 175,
+ 230, 32, 1, 228, 185, 218, 175, 230, 32, 1, 225, 150, 218, 175, 230, 32,
+ 1, 225, 253, 218, 175, 230, 32, 1, 251, 128, 218, 175, 230, 32, 1, 251,
+ 188, 218, 175, 230, 32, 1, 230, 231, 218, 175, 230, 32, 1, 223, 112, 218,
+ 175, 230, 32, 1, 232, 208, 218, 175, 230, 32, 1, 223, 73, 218, 175, 230,
+ 32, 1, 219, 242, 218, 175, 230, 32, 1, 241, 54, 218, 175, 230, 32, 30, 5,
+ 61, 218, 175, 230, 32, 30, 5, 72, 218, 175, 230, 32, 30, 5, 69, 218, 175,
+ 230, 32, 30, 5, 74, 218, 175, 230, 32, 30, 5, 227, 49, 218, 175, 230, 32,
+ 225, 146, 231, 221, 218, 175, 230, 32, 225, 146, 231, 220, 218, 175, 230,
+ 32, 225, 146, 231, 219, 218, 175, 230, 32, 225, 146, 231, 218, 228, 167,
+ 235, 237, 243, 228, 122, 224, 166, 228, 167, 235, 237, 243, 228, 122,
+ 242, 9, 228, 167, 235, 237, 243, 228, 133, 224, 164, 228, 167, 235, 237,
+ 243, 228, 122, 220, 45, 228, 167, 235, 237, 243, 228, 122, 245, 145, 228,
+ 167, 235, 237, 243, 228, 133, 220, 44, 228, 167, 235, 237, 224, 167, 77,
+ 228, 167, 235, 237, 225, 172, 77, 228, 167, 235, 237, 223, 29, 77, 228,
+ 167, 235, 237, 224, 168, 77, 226, 20, 1, 181, 226, 20, 1, 234, 138, 226,
+ 20, 1, 243, 110, 226, 20, 1, 229, 159, 226, 20, 1, 250, 219, 226, 20, 1,
+ 250, 92, 226, 20, 1, 235, 139, 226, 20, 1, 228, 23, 226, 20, 1, 218, 52,
+ 226, 20, 1, 217, 161, 226, 20, 1, 248, 164, 226, 20, 1, 205, 226, 20, 1,
+ 193, 226, 20, 1, 226, 23, 226, 20, 1, 252, 107, 226, 20, 1, 188, 226, 20,
+ 1, 216, 141, 226, 20, 1, 216, 133, 226, 20, 1, 245, 249, 226, 20, 1, 214,
+ 49, 226, 20, 1, 212, 75, 226, 20, 1, 212, 109, 226, 20, 1, 3, 61, 226,
+ 20, 1, 186, 226, 20, 1, 203, 226, 20, 1, 233, 157, 226, 20, 1, 221, 24,
+ 226, 20, 1, 222, 202, 226, 20, 1, 159, 226, 20, 1, 61, 226, 20, 1, 72,
+ 226, 20, 1, 69, 226, 20, 1, 74, 226, 20, 1, 75, 226, 20, 1, 224, 232,
+ 226, 20, 1, 213, 153, 226, 20, 1, 244, 164, 226, 20, 1, 243, 5, 226, 20,
+ 1, 245, 165, 226, 20, 219, 18, 1, 214, 49, 226, 20, 219, 18, 1, 186, 226,
+ 20, 1, 216, 115, 226, 20, 1, 216, 105, 226, 20, 1, 248, 86, 226, 20, 1,
+ 228, 198, 226, 20, 1, 254, 50, 186, 226, 20, 1, 214, 115, 221, 24, 226,
+ 20, 1, 214, 116, 159, 226, 20, 1, 253, 138, 244, 164, 226, 20, 219, 18,
+ 1, 203, 226, 20, 218, 225, 1, 203, 226, 20, 1, 250, 187, 226, 20, 220,
+ 81, 241, 220, 77, 226, 20, 51, 241, 220, 77, 226, 20, 152, 221, 17, 226,
+ 20, 152, 51, 221, 17, 169, 5, 253, 242, 169, 5, 214, 128, 169, 1, 61,
+ 169, 1, 254, 232, 169, 1, 72, 169, 1, 236, 28, 169, 1, 69, 169, 1, 215,
+ 92, 169, 1, 161, 149, 169, 1, 161, 223, 82, 169, 1, 161, 150, 169, 1,
+ 161, 232, 214, 169, 1, 74, 169, 1, 245, 165, 169, 1, 254, 108, 169, 1,
+ 75, 169, 1, 227, 49, 169, 1, 253, 108, 169, 1, 181, 169, 1, 234, 138,
+ 169, 1, 243, 110, 169, 1, 242, 225, 169, 1, 229, 159, 169, 1, 250, 219,
+ 169, 1, 250, 92, 169, 1, 235, 139, 169, 1, 235, 115, 169, 1, 228, 23,
+ 169, 1, 216, 115, 169, 1, 216, 105, 169, 1, 248, 86, 169, 1, 248, 70,
+ 169, 1, 228, 198, 169, 1, 218, 52, 169, 1, 217, 161, 169, 1, 248, 164,
+ 169, 1, 247, 232, 169, 1, 205, 169, 1, 193, 169, 1, 226, 23, 169, 1, 252,
+ 107, 169, 1, 251, 195, 169, 1, 188, 169, 1, 186, 169, 1, 203, 169, 1,
+ 233, 157, 169, 1, 215, 1, 169, 1, 221, 24, 169, 1, 219, 157, 169, 1, 222,
+ 202, 169, 1, 159, 169, 1, 232, 213, 169, 249, 133, 5, 242, 25, 169, 30,
+ 5, 254, 232, 169, 30, 5, 72, 169, 30, 5, 236, 28, 169, 30, 5, 69, 169,
+ 30, 5, 215, 92, 169, 30, 5, 161, 149, 169, 30, 5, 161, 223, 82, 169, 30,
+ 5, 161, 150, 169, 30, 5, 161, 232, 214, 169, 30, 5, 74, 169, 30, 5, 245,
+ 165, 169, 30, 5, 254, 108, 169, 30, 5, 75, 169, 30, 5, 227, 49, 169, 30,
+ 5, 253, 108, 169, 5, 214, 133, 169, 248, 123, 169, 51, 248, 123, 169, 21,
+ 212, 79, 169, 21, 116, 169, 21, 109, 169, 21, 166, 169, 21, 163, 169, 21,
+ 180, 169, 21, 189, 169, 21, 198, 169, 21, 195, 169, 21, 200, 37, 82, 21,
+ 212, 79, 37, 82, 21, 116, 37, 82, 21, 109, 37, 82, 21, 166, 37, 82, 21,
+ 163, 37, 82, 21, 180, 37, 82, 21, 189, 37, 82, 21, 198, 37, 82, 21, 195,
+ 37, 82, 21, 200, 37, 82, 1, 61, 37, 82, 1, 69, 37, 82, 1, 181, 37, 82, 1,
+ 205, 37, 82, 1, 193, 37, 82, 1, 203, 37, 82, 1, 214, 154, 37, 82, 5, 253,
+ 91, 82, 5, 219, 205, 250, 187, 82, 5, 250, 188, 214, 133, 82, 5, 51, 250,
+ 188, 214, 133, 82, 5, 250, 188, 109, 82, 5, 250, 188, 166, 82, 5, 250,
+ 188, 253, 91, 82, 5, 225, 11, 82, 243, 76, 244, 72, 82, 250, 170, 82,
+ 241, 214, 234, 194, 233, 14, 21, 212, 79, 234, 194, 233, 14, 21, 116,
+ 234, 194, 233, 14, 21, 109, 234, 194, 233, 14, 21, 166, 234, 194, 233,
+ 14, 21, 163, 234, 194, 233, 14, 21, 180, 234, 194, 233, 14, 21, 189, 234,
+ 194, 233, 14, 21, 198, 234, 194, 233, 14, 21, 195, 234, 194, 233, 14, 21,
+ 200, 234, 194, 233, 14, 1, 181, 234, 194, 233, 14, 1, 234, 138, 234, 194,
+ 233, 14, 1, 243, 110, 234, 194, 233, 14, 1, 229, 159, 234, 194, 233, 14,
+ 1, 222, 202, 234, 194, 233, 14, 1, 221, 24, 234, 194, 233, 14, 1, 212,
+ 109, 234, 194, 233, 14, 1, 228, 23, 234, 194, 233, 14, 1, 218, 52, 234,
+ 194, 233, 14, 1, 240, 214, 234, 194, 233, 14, 1, 205, 234, 194, 233, 14,
+ 1, 193, 234, 194, 233, 14, 1, 226, 23, 234, 194, 233, 14, 1, 188, 234,
+ 194, 233, 14, 1, 248, 164, 234, 194, 233, 14, 1, 252, 107, 234, 194, 233,
+ 14, 1, 203, 234, 194, 233, 14, 1, 186, 234, 194, 233, 14, 1, 233, 157,
+ 234, 194, 233, 14, 1, 214, 49, 234, 194, 233, 14, 1, 217, 161, 234, 194,
+ 233, 14, 1, 159, 234, 194, 233, 14, 1, 215, 1, 234, 194, 233, 14, 1, 250,
+ 219, 234, 194, 233, 14, 1, 61, 234, 194, 233, 14, 1, 227, 99, 234, 194,
+ 233, 14, 1, 72, 234, 194, 233, 14, 1, 227, 49, 234, 194, 233, 14, 30,
+ 215, 183, 234, 194, 233, 14, 30, 74, 234, 194, 233, 14, 30, 69, 234, 194,
+ 233, 14, 30, 245, 165, 234, 194, 233, 14, 30, 75, 234, 194, 233, 14, 160,
+ 225, 163, 234, 194, 233, 14, 160, 250, 200, 234, 194, 233, 14, 160, 250,
+ 201, 225, 163, 234, 194, 233, 14, 5, 249, 20, 234, 194, 233, 14, 5, 220,
+ 125, 223, 243, 1, 181, 223, 243, 1, 243, 110, 223, 243, 1, 229, 159, 223,
+ 243, 1, 218, 52, 223, 243, 1, 248, 164, 223, 243, 1, 205, 223, 243, 1,
+ 193, 223, 243, 1, 252, 107, 223, 243, 1, 188, 223, 243, 1, 250, 219, 223,
+ 243, 1, 235, 139, 223, 243, 1, 228, 23, 223, 243, 1, 222, 202, 223, 243,
+ 1, 203, 223, 243, 1, 233, 157, 223, 243, 1, 186, 223, 243, 1, 214, 49,
+ 223, 243, 1, 159, 223, 243, 1, 231, 187, 223, 243, 1, 229, 141, 223, 243,
+ 1, 229, 228, 223, 243, 1, 227, 254, 223, 243, 1, 61, 223, 243, 30, 5, 72,
+ 223, 243, 30, 5, 69, 223, 243, 30, 5, 74, 223, 243, 30, 5, 254, 108, 223,
+ 243, 30, 5, 75, 223, 243, 30, 5, 253, 108, 223, 243, 30, 5, 245, 22, 223,
+ 243, 30, 5, 245, 189, 223, 243, 249, 133, 5, 229, 161, 223, 243, 249,
+ 133, 5, 204, 223, 243, 249, 133, 5, 149, 223, 243, 249, 133, 5, 242, 41,
+ 223, 243, 214, 133, 223, 243, 222, 92, 77, 23, 97, 217, 51, 23, 97, 217,
+ 50, 23, 97, 217, 48, 23, 97, 217, 53, 23, 97, 223, 174, 23, 97, 223, 158,
+ 23, 97, 223, 153, 23, 97, 223, 155, 23, 97, 223, 171, 23, 97, 223, 164,
+ 23, 97, 223, 157, 23, 97, 223, 176, 23, 97, 223, 159, 23, 97, 223, 178,
+ 23, 97, 223, 175, 23, 97, 231, 26, 23, 97, 231, 17, 23, 97, 231, 20, 23,
+ 97, 225, 212, 23, 97, 225, 223, 23, 97, 225, 224, 23, 97, 219, 142, 23,
+ 97, 236, 41, 23, 97, 236, 48, 23, 97, 219, 153, 23, 97, 219, 140, 23, 97,
+ 226, 6, 23, 97, 241, 153, 23, 97, 219, 137, 144, 5, 226, 155, 144, 5,
+ 250, 121, 144, 5, 233, 90, 144, 5, 213, 228, 144, 1, 61, 144, 1, 240,
+ 146, 234, 197, 144, 1, 72, 144, 1, 236, 28, 144, 1, 69, 144, 1, 226, 214,
+ 250, 97, 144, 1, 229, 160, 233, 52, 144, 1, 229, 160, 233, 53, 224, 34,
+ 144, 1, 74, 144, 1, 254, 108, 144, 1, 75, 144, 1, 181, 144, 1, 235, 17,
+ 222, 144, 144, 1, 235, 17, 230, 136, 144, 1, 243, 110, 144, 1, 243, 111,
+ 230, 136, 144, 1, 229, 159, 144, 1, 250, 219, 144, 1, 250, 220, 230, 136,
+ 144, 1, 235, 139, 144, 1, 228, 24, 230, 136, 144, 1, 235, 140, 232, 12,
+ 144, 1, 228, 23, 144, 1, 216, 115, 144, 1, 216, 116, 232, 12, 144, 1,
+ 248, 86, 144, 1, 248, 87, 232, 12, 144, 1, 230, 46, 230, 136, 144, 1,
+ 218, 52, 144, 1, 218, 53, 230, 136, 144, 1, 248, 164, 144, 1, 248, 165,
+ 232, 12, 144, 1, 205, 144, 1, 193, 144, 1, 226, 214, 230, 136, 144, 1,
+ 252, 107, 144, 1, 252, 108, 230, 136, 144, 1, 188, 144, 1, 186, 144, 1,
+ 203, 144, 1, 224, 77, 254, 115, 144, 1, 233, 157, 144, 1, 214, 49, 144,
+ 1, 222, 203, 230, 136, 144, 1, 222, 203, 232, 12, 144, 1, 222, 202, 144,
+ 1, 159, 144, 5, 250, 122, 217, 203, 144, 30, 5, 217, 254, 144, 30, 5,
+ 216, 246, 144, 30, 5, 213, 178, 144, 30, 5, 213, 179, 231, 133, 144, 30,
+ 5, 218, 248, 144, 30, 5, 218, 249, 231, 121, 144, 30, 5, 218, 16, 144,
+ 30, 5, 247, 146, 230, 135, 144, 30, 5, 226, 59, 144, 249, 133, 5, 234,
+ 164, 144, 249, 133, 5, 226, 71, 144, 249, 133, 5, 250, 207, 144, 226,
+ 167, 144, 42, 223, 221, 144, 46, 223, 221, 144, 226, 203, 254, 26, 144,
+ 226, 203, 232, 29, 144, 226, 203, 232, 146, 144, 226, 203, 213, 223, 144,
+ 226, 203, 226, 168, 144, 226, 203, 232, 234, 144, 226, 203, 232, 140,
+ 144, 226, 203, 254, 154, 144, 226, 203, 254, 155, 254, 154, 144, 226,
+ 203, 225, 183, 144, 216, 58, 226, 203, 225, 183, 144, 226, 164, 144, 21,
+ 212, 79, 144, 21, 116, 144, 21, 109, 144, 21, 166, 144, 21, 163, 144, 21,
+ 180, 144, 21, 189, 144, 21, 198, 144, 21, 195, 144, 21, 200, 144, 226,
+ 203, 217, 22, 216, 70, 144, 226, 203, 235, 165, 162, 1, 61, 162, 1, 72,
+ 162, 1, 69, 162, 1, 74, 162, 1, 254, 108, 162, 1, 75, 162, 1, 181, 162,
+ 1, 234, 138, 162, 1, 243, 110, 162, 1, 242, 225, 162, 1, 229, 75, 162, 1,
+ 229, 159, 162, 1, 250, 92, 162, 1, 250, 49, 162, 1, 235, 139, 162, 1,
+ 235, 115, 162, 1, 229, 66, 162, 1, 229, 68, 162, 1, 229, 67, 162, 1, 218,
+ 52, 162, 1, 217, 161, 162, 1, 248, 164, 162, 1, 247, 232, 162, 1, 228,
+ 62, 162, 1, 205, 162, 1, 248, 86, 162, 1, 193, 162, 1, 225, 100, 162, 1,
+ 226, 23, 162, 1, 252, 107, 162, 1, 251, 195, 162, 1, 230, 165, 162, 1,
+ 188, 162, 1, 252, 31, 162, 1, 186, 162, 1, 203, 162, 1, 233, 157, 162, 1,
+ 215, 1, 162, 1, 219, 157, 162, 1, 222, 202, 162, 1, 159, 162, 30, 5, 254,
+ 232, 162, 30, 5, 72, 162, 30, 5, 236, 28, 162, 30, 5, 245, 152, 162, 30,
+ 5, 69, 162, 30, 5, 227, 99, 162, 30, 5, 75, 162, 30, 5, 254, 108, 162,
+ 30, 5, 253, 108, 162, 30, 5, 215, 183, 162, 249, 133, 5, 186, 162, 249,
+ 133, 5, 203, 162, 249, 133, 5, 233, 157, 162, 249, 133, 5, 214, 49, 162,
+ 1, 40, 235, 27, 162, 1, 40, 243, 177, 162, 1, 40, 229, 161, 162, 249,
+ 133, 5, 40, 229, 161, 162, 1, 40, 250, 93, 162, 1, 40, 218, 99, 162, 1,
+ 40, 204, 162, 1, 40, 226, 229, 162, 1, 40, 213, 105, 162, 1, 40, 149,
+ 162, 1, 40, 150, 162, 1, 40, 219, 158, 162, 249, 133, 5, 40, 183, 162,
+ 249, 133, 5, 40, 242, 41, 162, 21, 212, 79, 162, 21, 116, 162, 21, 109,
+ 162, 21, 166, 162, 21, 163, 162, 21, 180, 162, 21, 189, 162, 21, 198,
+ 162, 21, 195, 162, 21, 200, 162, 225, 27, 219, 183, 162, 225, 27, 248,
+ 123, 162, 225, 27, 51, 248, 123, 162, 225, 27, 216, 169, 248, 123, 64, 1,
+ 234, 132, 243, 110, 64, 1, 234, 132, 250, 219, 64, 1, 234, 132, 250, 92,
+ 64, 1, 234, 132, 235, 139, 64, 1, 234, 132, 235, 115, 64, 1, 234, 132,
+ 228, 23, 64, 1, 234, 132, 216, 115, 64, 1, 234, 132, 216, 105, 64, 1,
+ 234, 132, 248, 86, 64, 1, 234, 132, 248, 70, 64, 1, 234, 132, 247, 232,
+ 64, 1, 234, 132, 205, 64, 1, 234, 132, 222, 202, 64, 1, 234, 132, 159,
+ 64, 1, 234, 132, 241, 174, 64, 1, 234, 132, 244, 164, 64, 59, 1, 234,
+ 132, 224, 2, 64, 1, 234, 132, 213, 153, 64, 1, 234, 132, 212, 109, 64, 1,
+ 234, 132, 203, 64, 232, 198, 234, 132, 227, 117, 64, 232, 198, 234, 132,
+ 224, 188, 64, 232, 198, 234, 132, 241, 107, 64, 16, 254, 98, 244, 253,
+ 64, 16, 254, 98, 116, 64, 16, 254, 98, 109, 64, 1, 254, 98, 203, 64, 5,
+ 226, 151, 234, 218, 216, 241, 38, 190, 1, 115, 234, 37, 38, 190, 1, 124,
+ 234, 37, 38, 190, 1, 115, 234, 113, 38, 190, 1, 124, 234, 113, 38, 190,
+ 1, 115, 234, 120, 38, 190, 1, 124, 234, 120, 38, 190, 1, 115, 242, 150,
+ 38, 190, 1, 124, 242, 150, 38, 190, 1, 115, 229, 90, 38, 190, 1, 124,
+ 229, 90, 38, 190, 1, 115, 249, 175, 38, 190, 1, 124, 249, 175, 38, 190,
+ 1, 115, 250, 23, 38, 190, 1, 124, 250, 23, 38, 190, 1, 115, 219, 242, 38,
+ 190, 1, 124, 219, 242, 38, 190, 1, 115, 227, 253, 38, 190, 1, 124, 227,
+ 253, 38, 190, 1, 115, 247, 99, 38, 190, 1, 124, 247, 99, 38, 190, 1, 115,
+ 108, 38, 190, 1, 124, 108, 38, 190, 1, 115, 217, 109, 38, 190, 1, 124,
+ 217, 109, 38, 190, 1, 115, 228, 185, 38, 190, 1, 124, 228, 185, 38, 190,
+ 1, 115, 251, 128, 38, 190, 1, 124, 251, 128, 38, 190, 1, 115, 225, 150,
+ 38, 190, 1, 124, 225, 150, 38, 190, 1, 115, 225, 253, 38, 190, 1, 124,
+ 225, 253, 38, 190, 1, 115, 244, 12, 38, 190, 1, 124, 244, 12, 38, 190, 1,
+ 115, 230, 231, 38, 190, 1, 124, 230, 231, 38, 190, 1, 115, 212, 235, 38,
+ 190, 1, 124, 212, 235, 38, 190, 1, 115, 223, 112, 38, 190, 1, 124, 223,
+ 112, 38, 190, 1, 115, 232, 208, 38, 190, 1, 124, 232, 208, 38, 190, 1,
+ 115, 214, 119, 38, 190, 1, 124, 214, 119, 38, 190, 1, 115, 241, 54, 38,
+ 190, 1, 124, 241, 54, 38, 190, 1, 115, 75, 38, 190, 1, 124, 75, 38, 190,
+ 232, 9, 234, 235, 38, 190, 30, 254, 232, 38, 190, 30, 72, 38, 190, 30,
+ 215, 183, 38, 190, 30, 69, 38, 190, 30, 74, 38, 190, 30, 75, 38, 190,
+ 232, 9, 234, 115, 38, 190, 30, 240, 111, 38, 190, 30, 215, 182, 38, 190,
+ 30, 215, 196, 38, 190, 30, 253, 106, 38, 190, 30, 253, 83, 38, 190, 30,
+ 254, 32, 38, 190, 30, 254, 45, 38, 190, 160, 232, 9, 245, 137, 38, 190,
+ 160, 232, 9, 228, 61, 38, 190, 160, 232, 9, 217, 109, 38, 190, 160, 232,
+ 9, 219, 228, 38, 190, 16, 234, 22, 38, 190, 16, 228, 61, 38, 190, 16,
+ 222, 168, 38, 190, 16, 241, 55, 241, 50, 38, 190, 16, 234, 31, 234, 30,
+ 28, 4, 216, 98, 28, 4, 216, 101, 28, 4, 216, 104, 28, 4, 216, 102, 28, 4,
+ 216, 103, 28, 4, 216, 100, 28, 4, 248, 64, 28, 4, 248, 66, 28, 4, 248,
+ 69, 28, 4, 248, 67, 28, 4, 248, 68, 28, 4, 248, 65, 28, 4, 245, 239, 28,
+ 4, 245, 242, 28, 4, 245, 248, 28, 4, 245, 246, 28, 4, 245, 247, 28, 4,
+ 245, 240, 28, 4, 250, 138, 28, 4, 250, 132, 28, 4, 250, 134, 28, 4, 250,
+ 137, 28, 4, 250, 135, 28, 4, 250, 136, 28, 4, 250, 133, 28, 4, 252, 31,
+ 28, 4, 252, 10, 28, 4, 252, 22, 28, 4, 252, 30, 28, 4, 252, 25, 28, 4,
+ 252, 26, 28, 4, 252, 14, 231, 140, 231, 194, 1, 234, 28, 231, 140, 231,
+ 194, 1, 222, 168, 231, 140, 231, 194, 1, 233, 133, 231, 140, 231, 194, 1,
+ 230, 241, 231, 140, 231, 194, 1, 193, 231, 140, 231, 194, 1, 205, 231,
+ 140, 231, 194, 1, 250, 39, 231, 140, 231, 194, 1, 217, 44, 231, 140, 231,
+ 194, 1, 234, 109, 231, 140, 231, 194, 1, 229, 80, 231, 140, 231, 194, 1,
+ 217, 103, 231, 140, 231, 194, 1, 214, 44, 231, 140, 231, 194, 1, 213, 58,
+ 231, 140, 231, 194, 1, 240, 206, 231, 140, 231, 194, 1, 215, 160, 231,
+ 140, 231, 194, 1, 72, 231, 140, 231, 194, 1, 226, 18, 231, 140, 231, 194,
+ 1, 253, 118, 231, 140, 231, 194, 1, 242, 143, 231, 140, 231, 194, 1, 235,
+ 114, 231, 140, 231, 194, 1, 224, 57, 231, 140, 231, 194, 1, 252, 107,
+ 231, 140, 231, 194, 1, 235, 103, 231, 140, 231, 194, 1, 247, 171, 231,
+ 140, 231, 194, 1, 242, 197, 231, 140, 231, 194, 1, 247, 213, 231, 140,
+ 231, 194, 1, 251, 194, 231, 140, 231, 194, 1, 234, 29, 232, 181, 231,
+ 140, 231, 194, 1, 233, 134, 232, 181, 231, 140, 231, 194, 1, 230, 242,
+ 232, 181, 231, 140, 231, 194, 1, 226, 214, 232, 181, 231, 140, 231, 194,
+ 1, 230, 46, 232, 181, 231, 140, 231, 194, 1, 217, 45, 232, 181, 231, 140,
+ 231, 194, 1, 229, 81, 232, 181, 231, 140, 231, 194, 1, 240, 146, 232,
+ 181, 231, 140, 231, 194, 30, 5, 227, 61, 231, 140, 231, 194, 30, 5, 235,
+ 249, 231, 140, 231, 194, 30, 5, 254, 31, 231, 140, 231, 194, 30, 5, 213,
+ 29, 231, 140, 231, 194, 30, 5, 219, 219, 231, 140, 231, 194, 30, 5, 215,
+ 157, 231, 140, 231, 194, 30, 5, 250, 60, 231, 140, 231, 194, 30, 5, 228,
+ 47, 231, 140, 231, 194, 250, 61, 231, 140, 231, 194, 232, 143, 235, 148,
+ 231, 140, 231, 194, 253, 216, 235, 148, 231, 140, 231, 194, 21, 212, 79,
+ 231, 140, 231, 194, 21, 116, 231, 140, 231, 194, 21, 109, 231, 140, 231,
+ 194, 21, 166, 231, 140, 231, 194, 21, 163, 231, 140, 231, 194, 21, 180,
+ 231, 140, 231, 194, 21, 189, 231, 140, 231, 194, 21, 198, 231, 140, 231,
+ 194, 21, 195, 231, 140, 231, 194, 21, 200, 23, 135, 227, 197, 23, 135,
+ 227, 202, 23, 135, 212, 234, 23, 135, 212, 233, 23, 135, 212, 232, 23,
+ 135, 215, 246, 23, 135, 215, 249, 23, 135, 212, 201, 23, 135, 212, 197,
+ 23, 135, 245, 21, 23, 135, 245, 19, 23, 135, 245, 20, 23, 135, 245, 17,
+ 23, 135, 240, 136, 23, 135, 240, 135, 23, 135, 240, 133, 23, 135, 240,
+ 134, 23, 135, 240, 139, 23, 135, 240, 132, 23, 135, 240, 131, 23, 135,
+ 240, 141, 23, 135, 253, 203, 23, 135, 253, 202, 23, 89, 229, 50, 23, 89,
+ 229, 56, 23, 89, 219, 139, 23, 89, 219, 138, 23, 89, 217, 50, 23, 89,
+ 217, 48, 23, 89, 217, 47, 23, 89, 217, 53, 23, 89, 217, 54, 23, 89, 217,
+ 46, 23, 89, 223, 158, 23, 89, 223, 173, 23, 89, 219, 145, 23, 89, 223,
+ 170, 23, 89, 223, 160, 23, 89, 223, 162, 23, 89, 223, 149, 23, 89, 223,
+ 150, 23, 89, 234, 223, 23, 89, 231, 25, 23, 89, 231, 19, 23, 89, 219,
+ 149, 23, 89, 231, 22, 23, 89, 231, 28, 23, 89, 225, 208, 23, 89, 225,
+ 217, 23, 89, 225, 221, 23, 89, 219, 147, 23, 89, 225, 211, 23, 89, 225,
+ 225, 23, 89, 225, 226, 23, 89, 220, 68, 23, 89, 220, 71, 23, 89, 219,
+ 143, 23, 89, 219, 141, 23, 89, 220, 66, 23, 89, 220, 74, 23, 89, 220, 75,
+ 23, 89, 220, 60, 23, 89, 220, 73, 23, 89, 226, 158, 23, 89, 226, 159, 23,
+ 89, 213, 15, 23, 89, 213, 16, 23, 89, 249, 237, 23, 89, 249, 236, 23, 89,
+ 219, 154, 23, 89, 226, 4, 23, 89, 226, 3, 9, 13, 238, 17, 9, 13, 238, 16,
+ 9, 13, 238, 15, 9, 13, 238, 14, 9, 13, 238, 13, 9, 13, 238, 12, 9, 13,
+ 238, 11, 9, 13, 238, 10, 9, 13, 238, 9, 9, 13, 238, 8, 9, 13, 238, 7, 9,
+ 13, 238, 6, 9, 13, 238, 5, 9, 13, 238, 4, 9, 13, 238, 3, 9, 13, 238, 2,
+ 9, 13, 238, 1, 9, 13, 238, 0, 9, 13, 237, 255, 9, 13, 237, 254, 9, 13,
+ 237, 253, 9, 13, 237, 252, 9, 13, 237, 251, 9, 13, 237, 250, 9, 13, 237,
+ 249, 9, 13, 237, 248, 9, 13, 237, 247, 9, 13, 237, 246, 9, 13, 237, 245,
+ 9, 13, 237, 244, 9, 13, 237, 243, 9, 13, 237, 242, 9, 13, 237, 241, 9,
+ 13, 237, 240, 9, 13, 237, 239, 9, 13, 237, 238, 9, 13, 237, 237, 9, 13,
+ 237, 236, 9, 13, 237, 235, 9, 13, 237, 234, 9, 13, 237, 233, 9, 13, 237,
+ 232, 9, 13, 237, 231, 9, 13, 237, 230, 9, 13, 237, 229, 9, 13, 237, 228,
+ 9, 13, 237, 227, 9, 13, 237, 226, 9, 13, 237, 225, 9, 13, 237, 224, 9,
+ 13, 237, 223, 9, 13, 237, 222, 9, 13, 237, 221, 9, 13, 237, 220, 9, 13,
+ 237, 219, 9, 13, 237, 218, 9, 13, 237, 217, 9, 13, 237, 216, 9, 13, 237,
+ 215, 9, 13, 237, 214, 9, 13, 237, 213, 9, 13, 237, 212, 9, 13, 237, 211,
+ 9, 13, 237, 210, 9, 13, 237, 209, 9, 13, 237, 208, 9, 13, 237, 207, 9,
+ 13, 237, 206, 9, 13, 237, 205, 9, 13, 237, 204, 9, 13, 237, 203, 9, 13,
+ 237, 202, 9, 13, 237, 201, 9, 13, 237, 200, 9, 13, 237, 199, 9, 13, 237,
+ 198, 9, 13, 237, 197, 9, 13, 237, 196, 9, 13, 237, 195, 9, 13, 237, 194,
+ 9, 13, 237, 193, 9, 13, 237, 192, 9, 13, 237, 191, 9, 13, 237, 190, 9,
+ 13, 237, 189, 9, 13, 237, 188, 9, 13, 237, 187, 9, 13, 237, 186, 9, 13,
+ 237, 185, 9, 13, 237, 184, 9, 13, 237, 183, 9, 13, 237, 182, 9, 13, 237,
+ 181, 9, 13, 237, 180, 9, 13, 237, 179, 9, 13, 237, 178, 9, 13, 237, 177,
+ 9, 13, 237, 176, 9, 13, 237, 175, 9, 13, 237, 174, 9, 13, 237, 173, 9,
+ 13, 237, 172, 9, 13, 237, 171, 9, 13, 237, 170, 9, 13, 237, 169, 9, 13,
+ 237, 168, 9, 13, 237, 167, 9, 13, 237, 166, 9, 13, 237, 165, 9, 13, 237,
+ 164, 9, 13, 237, 163, 9, 13, 237, 162, 9, 13, 237, 161, 9, 13, 237, 160,
+ 9, 13, 237, 159, 9, 13, 237, 158, 9, 13, 237, 157, 9, 13, 237, 156, 9,
+ 13, 237, 155, 9, 13, 237, 154, 9, 13, 237, 153, 9, 13, 237, 152, 9, 13,
+ 237, 151, 9, 13, 237, 150, 9, 13, 237, 149, 9, 13, 237, 148, 9, 13, 237,
+ 147, 9, 13, 237, 146, 9, 13, 237, 145, 9, 13, 237, 144, 9, 13, 237, 143,
+ 9, 13, 237, 142, 9, 13, 237, 141, 9, 13, 237, 140, 9, 13, 237, 139, 9,
+ 13, 237, 138, 9, 13, 237, 137, 9, 13, 237, 136, 9, 13, 237, 135, 9, 13,
+ 237, 134, 9, 13, 237, 133, 9, 13, 237, 132, 9, 13, 237, 131, 9, 13, 237,
+ 130, 9, 13, 237, 129, 9, 13, 237, 128, 9, 13, 237, 127, 9, 13, 237, 126,
+ 9, 13, 237, 125, 9, 13, 237, 124, 9, 13, 237, 123, 9, 13, 237, 122, 9,
+ 13, 237, 121, 9, 13, 237, 120, 9, 13, 237, 119, 9, 13, 237, 118, 9, 13,
+ 237, 117, 9, 13, 237, 116, 9, 13, 237, 115, 9, 13, 237, 114, 9, 13, 237,
+ 113, 9, 13, 237, 112, 9, 13, 237, 111, 9, 13, 237, 110, 9, 13, 237, 109,
+ 9, 13, 237, 108, 9, 13, 237, 107, 9, 13, 237, 106, 9, 13, 237, 105, 9,
+ 13, 237, 104, 9, 13, 237, 103, 9, 13, 237, 102, 9, 13, 237, 101, 9, 13,
+ 237, 100, 9, 13, 237, 99, 9, 13, 237, 98, 9, 13, 237, 97, 9, 13, 237, 96,
+ 9, 13, 237, 95, 9, 13, 237, 94, 9, 13, 237, 93, 9, 13, 237, 92, 9, 13,
+ 237, 91, 9, 13, 237, 90, 9, 13, 237, 89, 9, 13, 237, 88, 9, 13, 237, 87,
+ 9, 13, 237, 86, 9, 13, 237, 85, 9, 13, 237, 84, 9, 13, 237, 83, 9, 13,
+ 237, 82, 9, 13, 237, 81, 9, 13, 237, 80, 9, 13, 237, 79, 9, 13, 237, 78,
+ 9, 13, 237, 77, 9, 13, 237, 76, 9, 13, 237, 75, 9, 13, 237, 74, 9, 13,
+ 237, 73, 9, 13, 237, 72, 9, 13, 237, 71, 9, 13, 237, 70, 9, 13, 237, 69,
+ 9, 13, 237, 68, 9, 13, 237, 67, 9, 13, 237, 66, 9, 13, 237, 65, 9, 13,
+ 237, 64, 9, 13, 237, 63, 9, 13, 237, 62, 9, 13, 237, 61, 9, 13, 237, 60,
+ 9, 13, 237, 59, 9, 13, 237, 58, 9, 13, 237, 57, 9, 13, 237, 56, 9, 13,
+ 237, 55, 9, 13, 237, 54, 9, 13, 237, 53, 9, 13, 237, 52, 9, 13, 237, 51,
+ 9, 13, 237, 50, 9, 13, 237, 49, 9, 13, 237, 48, 9, 13, 237, 47, 9, 13,
+ 237, 46, 9, 13, 237, 45, 9, 13, 237, 44, 9, 13, 237, 43, 9, 13, 237, 42,
+ 9, 13, 237, 41, 9, 13, 237, 40, 9, 13, 237, 39, 9, 13, 237, 38, 9, 13,
+ 237, 37, 9, 13, 237, 36, 9, 13, 237, 35, 9, 13, 237, 34, 9, 13, 237, 33,
+ 9, 13, 237, 32, 9, 13, 237, 31, 9, 13, 237, 30, 9, 13, 237, 29, 9, 13,
+ 237, 28, 9, 13, 237, 27, 9, 13, 237, 26, 9, 13, 237, 25, 9, 13, 237, 24,
+ 9, 13, 237, 23, 9, 13, 237, 22, 9, 13, 237, 21, 9, 13, 237, 20, 9, 13,
+ 237, 19, 9, 13, 237, 18, 9, 13, 237, 17, 9, 13, 237, 16, 9, 13, 237, 15,
+ 9, 13, 237, 14, 9, 13, 237, 13, 9, 13, 237, 12, 9, 13, 237, 11, 9, 13,
+ 237, 10, 9, 13, 237, 9, 9, 13, 237, 8, 9, 13, 237, 7, 9, 13, 237, 6, 9,
+ 13, 237, 5, 9, 13, 237, 4, 9, 13, 237, 3, 9, 13, 237, 2, 9, 13, 237, 1,
+ 9, 13, 237, 0, 9, 13, 236, 255, 9, 13, 236, 254, 9, 13, 236, 253, 9, 13,
+ 236, 252, 9, 13, 236, 251, 9, 13, 236, 250, 9, 13, 236, 249, 9, 13, 236,
+ 248, 9, 13, 236, 247, 9, 13, 236, 246, 9, 13, 236, 245, 9, 13, 236, 244,
+ 9, 13, 236, 243, 9, 13, 236, 242, 9, 13, 236, 241, 9, 13, 236, 240, 9,
+ 13, 236, 239, 9, 13, 236, 238, 9, 13, 236, 237, 9, 13, 236, 236, 9, 13,
+ 236, 235, 9, 13, 236, 234, 9, 13, 236, 233, 9, 13, 236, 232, 9, 13, 236,
+ 231, 9, 13, 236, 230, 9, 13, 236, 229, 9, 13, 236, 228, 9, 13, 236, 227,
+ 9, 13, 236, 226, 9, 13, 236, 225, 9, 13, 236, 224, 9, 13, 236, 223, 9,
+ 13, 236, 222, 9, 13, 236, 221, 9, 13, 236, 220, 9, 13, 236, 219, 9, 13,
+ 236, 218, 9, 13, 236, 217, 9, 13, 236, 216, 9, 13, 236, 215, 9, 13, 236,
+ 214, 9, 13, 236, 213, 9, 13, 236, 212, 9, 13, 236, 211, 9, 13, 236, 210,
+ 9, 13, 236, 209, 9, 13, 236, 208, 9, 13, 236, 207, 9, 13, 236, 206, 9,
+ 13, 236, 205, 9, 13, 236, 204, 9, 13, 236, 203, 9, 13, 236, 202, 9, 13,
+ 236, 201, 9, 13, 236, 200, 9, 13, 236, 199, 9, 13, 236, 198, 9, 13, 236,
+ 197, 9, 13, 236, 196, 9, 13, 236, 195, 9, 13, 236, 194, 9, 13, 236, 193,
+ 9, 13, 236, 192, 9, 13, 236, 191, 9, 13, 236, 190, 9, 13, 236, 189, 9,
+ 13, 236, 188, 9, 13, 236, 187, 9, 13, 236, 186, 9, 13, 236, 185, 9, 13,
+ 236, 184, 9, 13, 236, 183, 9, 13, 236, 182, 9, 13, 236, 181, 9, 13, 236,
+ 180, 9, 13, 236, 179, 9, 13, 236, 178, 9, 13, 236, 177, 9, 13, 236, 176,
+ 9, 13, 236, 175, 9, 13, 236, 174, 9, 13, 236, 173, 9, 13, 236, 172, 9,
+ 13, 236, 171, 9, 13, 236, 170, 9, 13, 236, 169, 9, 13, 236, 168, 9, 13,
+ 236, 167, 9, 13, 236, 166, 9, 13, 236, 165, 9, 13, 236, 164, 9, 13, 236,
+ 163, 9, 13, 236, 162, 9, 13, 236, 161, 9, 13, 236, 160, 9, 13, 236, 159,
+ 9, 13, 236, 158, 9, 13, 236, 157, 9, 13, 236, 156, 9, 13, 236, 155, 9,
+ 13, 236, 154, 9, 13, 236, 153, 9, 13, 236, 152, 9, 13, 236, 151, 9, 13,
+ 236, 150, 9, 13, 236, 149, 9, 13, 236, 148, 9, 13, 236, 147, 9, 13, 236,
+ 146, 9, 13, 236, 145, 9, 13, 236, 144, 9, 13, 236, 143, 9, 13, 236, 142,
+ 9, 13, 236, 141, 9, 13, 236, 140, 9, 13, 236, 139, 9, 13, 236, 138, 9,
+ 13, 236, 137, 9, 13, 236, 136, 9, 13, 236, 135, 9, 13, 236, 134, 9, 13,
+ 236, 133, 9, 13, 236, 132, 9, 13, 236, 131, 9, 13, 236, 130, 9, 13, 236,
+ 129, 9, 13, 236, 128, 9, 13, 236, 127, 9, 13, 236, 126, 9, 13, 236, 125,
+ 9, 13, 236, 124, 9, 13, 236, 123, 9, 13, 236, 122, 9, 13, 236, 121, 9,
+ 13, 236, 120, 9, 13, 236, 119, 9, 13, 236, 118, 9, 13, 236, 117, 9, 13,
+ 236, 116, 9, 13, 236, 115, 9, 13, 236, 114, 9, 13, 236, 113, 9, 13, 236,
+ 112, 9, 13, 236, 111, 9, 13, 236, 110, 9, 13, 236, 109, 9, 13, 236, 108,
+ 9, 13, 236, 107, 9, 13, 236, 106, 9, 13, 236, 105, 9, 13, 236, 104, 9,
+ 13, 236, 103, 9, 13, 236, 102, 9, 13, 236, 101, 9, 13, 236, 100, 9, 13,
+ 236, 99, 9, 13, 236, 98, 9, 13, 236, 97, 9, 13, 236, 96, 9, 13, 236, 95,
+ 9, 13, 236, 94, 9, 13, 236, 93, 9, 13, 236, 92, 9, 13, 236, 91, 9, 13,
+ 236, 90, 9, 13, 236, 89, 9, 13, 236, 88, 9, 13, 236, 87, 9, 13, 236, 86,
+ 9, 13, 236, 85, 9, 13, 236, 84, 9, 13, 236, 83, 9, 13, 236, 82, 9, 13,
+ 236, 81, 9, 13, 236, 80, 9, 13, 236, 79, 9, 13, 236, 78, 9, 13, 236, 77,
+ 9, 13, 236, 76, 9, 13, 236, 75, 9, 13, 236, 74, 9, 13, 236, 73, 9, 13,
+ 236, 72, 9, 13, 236, 71, 9, 13, 236, 70, 9, 13, 236, 69, 9, 13, 236, 68,
+ 9, 13, 236, 67, 9, 13, 236, 66, 9, 13, 236, 65, 9, 13, 236, 64, 9, 13,
+ 236, 63, 9, 13, 236, 62, 9, 13, 236, 61, 9, 13, 236, 60, 7, 3, 26, 244,
+ 94, 7, 3, 26, 244, 90, 7, 3, 26, 244, 45, 7, 3, 26, 244, 93, 7, 3, 26,
+ 244, 92, 7, 3, 26, 184, 223, 4, 218, 99, 7, 3, 26, 219, 107, 141, 3, 26,
+ 231, 123, 228, 150, 141, 3, 26, 231, 123, 245, 169, 141, 3, 26, 231, 123,
+ 235, 224, 141, 3, 26, 214, 157, 228, 150, 141, 3, 26, 231, 123, 213, 148,
+ 93, 1, 212, 225, 2, 241, 144, 93, 225, 145, 235, 53, 214, 243, 93, 26,
+ 212, 253, 212, 225, 212, 225, 226, 112, 93, 1, 254, 48, 253, 78, 93, 1,
+ 213, 232, 254, 78, 93, 1, 213, 232, 248, 134, 93, 1, 213, 232, 241, 222,
+ 93, 1, 213, 232, 234, 254, 93, 1, 213, 232, 233, 118, 93, 1, 213, 232,
+ 40, 231, 129, 93, 1, 213, 232, 223, 219, 93, 1, 213, 232, 217, 245, 93,
+ 1, 254, 48, 94, 52, 93, 1, 220, 201, 2, 220, 201, 247, 74, 93, 1, 220,
+ 201, 2, 220, 85, 247, 74, 93, 1, 220, 201, 2, 248, 151, 24, 220, 201,
+ 247, 74, 93, 1, 220, 201, 2, 248, 151, 24, 220, 85, 247, 74, 93, 1, 106,
+ 2, 226, 112, 93, 1, 106, 2, 224, 220, 93, 1, 106, 2, 231, 234, 93, 1,
+ 251, 206, 2, 248, 150, 93, 1, 242, 178, 2, 248, 150, 93, 1, 248, 135, 2,
+ 248, 150, 93, 1, 241, 223, 2, 231, 234, 93, 1, 214, 237, 2, 248, 150, 93,
+ 1, 212, 91, 2, 248, 150, 93, 1, 217, 184, 2, 248, 150, 93, 1, 212, 225,
+ 2, 248, 150, 93, 1, 40, 234, 255, 2, 248, 150, 93, 1, 234, 255, 2, 248,
+ 150, 93, 1, 233, 119, 2, 248, 150, 93, 1, 231, 130, 2, 248, 150, 93, 1,
+ 228, 51, 2, 248, 150, 93, 1, 222, 165, 2, 248, 150, 93, 1, 40, 226, 97,
+ 2, 248, 150, 93, 1, 226, 97, 2, 248, 150, 93, 1, 216, 138, 2, 248, 150,
+ 93, 1, 224, 185, 2, 248, 150, 93, 1, 223, 220, 2, 248, 150, 93, 1, 220,
+ 201, 2, 248, 150, 93, 1, 217, 246, 2, 248, 150, 93, 1, 214, 237, 2, 241,
+ 47, 93, 1, 251, 206, 2, 224, 59, 93, 1, 234, 255, 2, 224, 59, 93, 1, 226,
+ 97, 2, 224, 59, 93, 26, 106, 233, 118, 12, 1, 106, 214, 31, 48, 17, 12,
+ 1, 106, 214, 31, 40, 17, 12, 1, 251, 241, 48, 17, 12, 1, 251, 241, 40,
+ 17, 12, 1, 251, 241, 70, 17, 12, 1, 251, 241, 138, 17, 12, 1, 226, 81,
+ 48, 17, 12, 1, 226, 81, 40, 17, 12, 1, 226, 81, 70, 17, 12, 1, 226, 81,
+ 138, 17, 12, 1, 251, 229, 48, 17, 12, 1, 251, 229, 40, 17, 12, 1, 251,
+ 229, 70, 17, 12, 1, 251, 229, 138, 17, 12, 1, 216, 108, 48, 17, 12, 1,
+ 216, 108, 40, 17, 12, 1, 216, 108, 70, 17, 12, 1, 216, 108, 138, 17, 12,
+ 1, 217, 214, 48, 17, 12, 1, 217, 214, 40, 17, 12, 1, 217, 214, 70, 17,
+ 12, 1, 217, 214, 138, 17, 12, 1, 216, 110, 48, 17, 12, 1, 216, 110, 40,
+ 17, 12, 1, 216, 110, 70, 17, 12, 1, 216, 110, 138, 17, 12, 1, 214, 226,
+ 48, 17, 12, 1, 214, 226, 40, 17, 12, 1, 214, 226, 70, 17, 12, 1, 214,
+ 226, 138, 17, 12, 1, 226, 79, 48, 17, 12, 1, 226, 79, 40, 17, 12, 1, 226,
+ 79, 70, 17, 12, 1, 226, 79, 138, 17, 12, 1, 245, 255, 48, 17, 12, 1, 245,
+ 255, 40, 17, 12, 1, 245, 255, 70, 17, 12, 1, 245, 255, 138, 17, 12, 1,
+ 228, 15, 48, 17, 12, 1, 228, 15, 40, 17, 12, 1, 228, 15, 70, 17, 12, 1,
+ 228, 15, 138, 17, 12, 1, 217, 234, 48, 17, 12, 1, 217, 234, 40, 17, 12,
+ 1, 217, 234, 70, 17, 12, 1, 217, 234, 138, 17, 12, 1, 217, 232, 48, 17,
+ 12, 1, 217, 232, 40, 17, 12, 1, 217, 232, 70, 17, 12, 1, 217, 232, 138,
+ 17, 12, 1, 248, 84, 48, 17, 12, 1, 248, 84, 40, 17, 12, 1, 248, 147, 48,
+ 17, 12, 1, 248, 147, 40, 17, 12, 1, 246, 26, 48, 17, 12, 1, 246, 26, 40,
+ 17, 12, 1, 248, 82, 48, 17, 12, 1, 248, 82, 40, 17, 12, 1, 235, 122, 48,
+ 17, 12, 1, 235, 122, 40, 17, 12, 1, 223, 78, 48, 17, 12, 1, 223, 78, 40,
+ 17, 12, 1, 234, 181, 48, 17, 12, 1, 234, 181, 40, 17, 12, 1, 234, 181,
+ 70, 17, 12, 1, 234, 181, 138, 17, 12, 1, 243, 98, 48, 17, 12, 1, 243, 98,
+ 40, 17, 12, 1, 243, 98, 70, 17, 12, 1, 243, 98, 138, 17, 12, 1, 242, 83,
+ 48, 17, 12, 1, 242, 83, 40, 17, 12, 1, 242, 83, 70, 17, 12, 1, 242, 83,
+ 138, 17, 12, 1, 229, 89, 48, 17, 12, 1, 229, 89, 40, 17, 12, 1, 229, 89,
+ 70, 17, 12, 1, 229, 89, 138, 17, 12, 1, 228, 174, 242, 195, 48, 17, 12,
+ 1, 228, 174, 242, 195, 40, 17, 12, 1, 223, 116, 48, 17, 12, 1, 223, 116,
+ 40, 17, 12, 1, 223, 116, 70, 17, 12, 1, 223, 116, 138, 17, 12, 1, 241,
+ 203, 2, 73, 78, 48, 17, 12, 1, 241, 203, 2, 73, 78, 40, 17, 12, 1, 241,
+ 203, 242, 148, 48, 17, 12, 1, 241, 203, 242, 148, 40, 17, 12, 1, 241,
+ 203, 242, 148, 70, 17, 12, 1, 241, 203, 242, 148, 138, 17, 12, 1, 241,
+ 203, 247, 96, 48, 17, 12, 1, 241, 203, 247, 96, 40, 17, 12, 1, 241, 203,
+ 247, 96, 70, 17, 12, 1, 241, 203, 247, 96, 138, 17, 12, 1, 73, 252, 53,
+ 48, 17, 12, 1, 73, 252, 53, 40, 17, 12, 1, 73, 252, 53, 2, 192, 78, 48,
+ 17, 12, 1, 73, 252, 53, 2, 192, 78, 40, 17, 12, 16, 62, 49, 12, 16, 62,
+ 55, 12, 16, 117, 176, 49, 12, 16, 117, 176, 55, 12, 16, 133, 176, 49, 12,
+ 16, 133, 176, 55, 12, 16, 133, 176, 225, 141, 246, 58, 49, 12, 16, 133,
+ 176, 225, 141, 246, 58, 55, 12, 16, 243, 237, 176, 49, 12, 16, 243, 237,
+ 176, 55, 12, 16, 51, 71, 252, 60, 55, 12, 16, 117, 176, 214, 166, 49, 12,
+ 16, 117, 176, 214, 166, 55, 12, 16, 223, 130, 12, 16, 3, 218, 30, 49, 12,
+ 16, 3, 218, 30, 55, 12, 1, 229, 162, 48, 17, 12, 1, 229, 162, 40, 17, 12,
+ 1, 229, 162, 70, 17, 12, 1, 229, 162, 138, 17, 12, 1, 111, 48, 17, 12, 1,
+ 111, 40, 17, 12, 1, 227, 100, 48, 17, 12, 1, 227, 100, 40, 17, 12, 1,
+ 212, 204, 48, 17, 12, 1, 212, 204, 40, 17, 12, 1, 111, 2, 192, 78, 48,
+ 17, 12, 1, 214, 233, 48, 17, 12, 1, 214, 233, 40, 17, 12, 1, 234, 82,
+ 227, 100, 48, 17, 12, 1, 234, 82, 227, 100, 40, 17, 12, 1, 234, 82, 212,
+ 204, 48, 17, 12, 1, 234, 82, 212, 204, 40, 17, 12, 1, 191, 48, 17, 12, 1,
+ 191, 40, 17, 12, 1, 191, 70, 17, 12, 1, 191, 138, 17, 12, 1, 215, 177,
+ 234, 192, 234, 82, 106, 210, 70, 17, 12, 1, 215, 177, 234, 192, 234, 82,
+ 106, 210, 138, 17, 12, 26, 73, 2, 192, 78, 2, 106, 48, 17, 12, 26, 73, 2,
+ 192, 78, 2, 106, 40, 17, 12, 26, 73, 2, 192, 78, 2, 254, 149, 48, 17, 12,
+ 26, 73, 2, 192, 78, 2, 254, 149, 40, 17, 12, 26, 73, 2, 192, 78, 2, 214,
+ 15, 48, 17, 12, 26, 73, 2, 192, 78, 2, 214, 15, 40, 17, 12, 26, 73, 2,
+ 192, 78, 2, 111, 48, 17, 12, 26, 73, 2, 192, 78, 2, 111, 40, 17, 12, 26,
+ 73, 2, 192, 78, 2, 227, 100, 48, 17, 12, 26, 73, 2, 192, 78, 2, 227, 100,
+ 40, 17, 12, 26, 73, 2, 192, 78, 2, 212, 204, 48, 17, 12, 26, 73, 2, 192,
+ 78, 2, 212, 204, 40, 17, 12, 26, 73, 2, 192, 78, 2, 191, 48, 17, 12, 26,
+ 73, 2, 192, 78, 2, 191, 40, 17, 12, 26, 73, 2, 192, 78, 2, 191, 70, 17,
+ 12, 26, 215, 177, 234, 82, 73, 2, 192, 78, 2, 106, 210, 48, 17, 12, 26,
+ 215, 177, 234, 82, 73, 2, 192, 78, 2, 106, 210, 40, 17, 12, 26, 215, 177,
+ 234, 82, 73, 2, 192, 78, 2, 106, 210, 70, 17, 12, 1, 244, 136, 73, 48,
+ 17, 12, 1, 244, 136, 73, 40, 17, 12, 1, 244, 136, 73, 70, 17, 12, 1, 244,
+ 136, 73, 138, 17, 12, 26, 73, 2, 192, 78, 2, 145, 48, 17, 12, 26, 73, 2,
+ 192, 78, 2, 121, 48, 17, 12, 26, 73, 2, 192, 78, 2, 63, 48, 17, 12, 26,
+ 73, 2, 192, 78, 2, 106, 210, 48, 17, 12, 26, 73, 2, 192, 78, 2, 73, 48,
+ 17, 12, 26, 251, 231, 2, 145, 48, 17, 12, 26, 251, 231, 2, 121, 48, 17,
+ 12, 26, 251, 231, 2, 234, 136, 48, 17, 12, 26, 251, 231, 2, 63, 48, 17,
+ 12, 26, 251, 231, 2, 106, 210, 48, 17, 12, 26, 251, 231, 2, 73, 48, 17,
+ 12, 26, 217, 216, 2, 145, 48, 17, 12, 26, 217, 216, 2, 121, 48, 17, 12,
+ 26, 217, 216, 2, 234, 136, 48, 17, 12, 26, 217, 216, 2, 63, 48, 17, 12,
+ 26, 217, 216, 2, 106, 210, 48, 17, 12, 26, 217, 216, 2, 73, 48, 17, 12,
+ 26, 217, 146, 2, 145, 48, 17, 12, 26, 217, 146, 2, 63, 48, 17, 12, 26,
+ 217, 146, 2, 106, 210, 48, 17, 12, 26, 217, 146, 2, 73, 48, 17, 12, 26,
+ 145, 2, 121, 48, 17, 12, 26, 145, 2, 63, 48, 17, 12, 26, 121, 2, 145, 48,
+ 17, 12, 26, 121, 2, 63, 48, 17, 12, 26, 234, 136, 2, 145, 48, 17, 12, 26,
+ 234, 136, 2, 121, 48, 17, 12, 26, 234, 136, 2, 63, 48, 17, 12, 26, 222,
+ 86, 2, 145, 48, 17, 12, 26, 222, 86, 2, 121, 48, 17, 12, 26, 222, 86, 2,
+ 234, 136, 48, 17, 12, 26, 222, 86, 2, 63, 48, 17, 12, 26, 222, 196, 2,
+ 121, 48, 17, 12, 26, 222, 196, 2, 63, 48, 17, 12, 26, 248, 160, 2, 145,
+ 48, 17, 12, 26, 248, 160, 2, 121, 48, 17, 12, 26, 248, 160, 2, 234, 136,
+ 48, 17, 12, 26, 248, 160, 2, 63, 48, 17, 12, 26, 218, 30, 2, 121, 48, 17,
+ 12, 26, 218, 30, 2, 63, 48, 17, 12, 26, 212, 105, 2, 63, 48, 17, 12, 26,
+ 254, 104, 2, 145, 48, 17, 12, 26, 254, 104, 2, 63, 48, 17, 12, 26, 242,
+ 221, 2, 145, 48, 17, 12, 26, 242, 221, 2, 63, 48, 17, 12, 26, 244, 112,
+ 2, 145, 48, 17, 12, 26, 244, 112, 2, 121, 48, 17, 12, 26, 244, 112, 2,
+ 234, 136, 48, 17, 12, 26, 244, 112, 2, 63, 48, 17, 12, 26, 244, 112, 2,
+ 106, 210, 48, 17, 12, 26, 244, 112, 2, 73, 48, 17, 12, 26, 224, 226, 2,
+ 121, 48, 17, 12, 26, 224, 226, 2, 63, 48, 17, 12, 26, 224, 226, 2, 106,
+ 210, 48, 17, 12, 26, 224, 226, 2, 73, 48, 17, 12, 26, 234, 255, 2, 106,
+ 48, 17, 12, 26, 234, 255, 2, 145, 48, 17, 12, 26, 234, 255, 2, 121, 48,
+ 17, 12, 26, 234, 255, 2, 234, 136, 48, 17, 12, 26, 234, 255, 2, 233, 127,
+ 48, 17, 12, 26, 234, 255, 2, 63, 48, 17, 12, 26, 234, 255, 2, 106, 210,
+ 48, 17, 12, 26, 234, 255, 2, 73, 48, 17, 12, 26, 233, 127, 2, 145, 48,
+ 17, 12, 26, 233, 127, 2, 121, 48, 17, 12, 26, 233, 127, 2, 234, 136, 48,
+ 17, 12, 26, 233, 127, 2, 63, 48, 17, 12, 26, 233, 127, 2, 106, 210, 48,
+ 17, 12, 26, 233, 127, 2, 73, 48, 17, 12, 26, 63, 2, 145, 48, 17, 12, 26,
+ 63, 2, 121, 48, 17, 12, 26, 63, 2, 234, 136, 48, 17, 12, 26, 63, 2, 63,
+ 48, 17, 12, 26, 63, 2, 106, 210, 48, 17, 12, 26, 63, 2, 73, 48, 17, 12,
+ 26, 228, 174, 2, 145, 48, 17, 12, 26, 228, 174, 2, 121, 48, 17, 12, 26,
+ 228, 174, 2, 234, 136, 48, 17, 12, 26, 228, 174, 2, 63, 48, 17, 12, 26,
+ 228, 174, 2, 106, 210, 48, 17, 12, 26, 228, 174, 2, 73, 48, 17, 12, 26,
+ 241, 203, 2, 145, 48, 17, 12, 26, 241, 203, 2, 63, 48, 17, 12, 26, 241,
+ 203, 2, 106, 210, 48, 17, 12, 26, 241, 203, 2, 73, 48, 17, 12, 26, 73, 2,
+ 145, 48, 17, 12, 26, 73, 2, 121, 48, 17, 12, 26, 73, 2, 234, 136, 48, 17,
+ 12, 26, 73, 2, 63, 48, 17, 12, 26, 73, 2, 106, 210, 48, 17, 12, 26, 73,
+ 2, 73, 48, 17, 12, 26, 217, 156, 2, 218, 223, 106, 48, 17, 12, 26, 223,
+ 246, 2, 218, 223, 106, 48, 17, 12, 26, 106, 210, 2, 218, 223, 106, 48,
+ 17, 12, 26, 221, 16, 2, 248, 128, 48, 17, 12, 26, 221, 16, 2, 234, 209,
+ 48, 17, 12, 26, 221, 16, 2, 244, 134, 48, 17, 12, 26, 221, 16, 2, 248,
+ 130, 48, 17, 12, 26, 221, 16, 2, 234, 211, 48, 17, 12, 26, 221, 16, 2,
+ 218, 223, 106, 48, 17, 12, 26, 73, 2, 192, 78, 2, 223, 246, 40, 17, 12,
+ 26, 73, 2, 192, 78, 2, 212, 102, 40, 17, 12, 26, 73, 2, 192, 78, 2, 63,
+ 40, 17, 12, 26, 73, 2, 192, 78, 2, 228, 174, 40, 17, 12, 26, 73, 2, 192,
+ 78, 2, 106, 210, 40, 17, 12, 26, 73, 2, 192, 78, 2, 73, 40, 17, 12, 26,
+ 251, 231, 2, 223, 246, 40, 17, 12, 26, 251, 231, 2, 212, 102, 40, 17, 12,
+ 26, 251, 231, 2, 63, 40, 17, 12, 26, 251, 231, 2, 228, 174, 40, 17, 12,
+ 26, 251, 231, 2, 106, 210, 40, 17, 12, 26, 251, 231, 2, 73, 40, 17, 12,
+ 26, 217, 216, 2, 223, 246, 40, 17, 12, 26, 217, 216, 2, 212, 102, 40, 17,
+ 12, 26, 217, 216, 2, 63, 40, 17, 12, 26, 217, 216, 2, 228, 174, 40, 17,
+ 12, 26, 217, 216, 2, 106, 210, 40, 17, 12, 26, 217, 216, 2, 73, 40, 17,
+ 12, 26, 217, 146, 2, 223, 246, 40, 17, 12, 26, 217, 146, 2, 212, 102, 40,
+ 17, 12, 26, 217, 146, 2, 63, 40, 17, 12, 26, 217, 146, 2, 228, 174, 40,
+ 17, 12, 26, 217, 146, 2, 106, 210, 40, 17, 12, 26, 217, 146, 2, 73, 40,
+ 17, 12, 26, 244, 112, 2, 106, 210, 40, 17, 12, 26, 244, 112, 2, 73, 40,
+ 17, 12, 26, 224, 226, 2, 106, 210, 40, 17, 12, 26, 224, 226, 2, 73, 40,
+ 17, 12, 26, 234, 255, 2, 106, 40, 17, 12, 26, 234, 255, 2, 233, 127, 40,
+ 17, 12, 26, 234, 255, 2, 63, 40, 17, 12, 26, 234, 255, 2, 106, 210, 40,
+ 17, 12, 26, 234, 255, 2, 73, 40, 17, 12, 26, 233, 127, 2, 63, 40, 17, 12,
+ 26, 233, 127, 2, 106, 210, 40, 17, 12, 26, 233, 127, 2, 73, 40, 17, 12,
+ 26, 63, 2, 106, 40, 17, 12, 26, 63, 2, 63, 40, 17, 12, 26, 228, 174, 2,
+ 223, 246, 40, 17, 12, 26, 228, 174, 2, 212, 102, 40, 17, 12, 26, 228,
+ 174, 2, 63, 40, 17, 12, 26, 228, 174, 2, 228, 174, 40, 17, 12, 26, 228,
+ 174, 2, 106, 210, 40, 17, 12, 26, 228, 174, 2, 73, 40, 17, 12, 26, 106,
+ 210, 2, 218, 223, 106, 40, 17, 12, 26, 73, 2, 223, 246, 40, 17, 12, 26,
+ 73, 2, 212, 102, 40, 17, 12, 26, 73, 2, 63, 40, 17, 12, 26, 73, 2, 228,
+ 174, 40, 17, 12, 26, 73, 2, 106, 210, 40, 17, 12, 26, 73, 2, 73, 40, 17,
+ 12, 26, 73, 2, 192, 78, 2, 145, 70, 17, 12, 26, 73, 2, 192, 78, 2, 121,
+ 70, 17, 12, 26, 73, 2, 192, 78, 2, 234, 136, 70, 17, 12, 26, 73, 2, 192,
+ 78, 2, 63, 70, 17, 12, 26, 73, 2, 192, 78, 2, 241, 203, 70, 17, 12, 26,
+ 251, 231, 2, 145, 70, 17, 12, 26, 251, 231, 2, 121, 70, 17, 12, 26, 251,
+ 231, 2, 234, 136, 70, 17, 12, 26, 251, 231, 2, 63, 70, 17, 12, 26, 251,
+ 231, 2, 241, 203, 70, 17, 12, 26, 217, 216, 2, 145, 70, 17, 12, 26, 217,
+ 216, 2, 121, 70, 17, 12, 26, 217, 216, 2, 234, 136, 70, 17, 12, 26, 217,
+ 216, 2, 63, 70, 17, 12, 26, 217, 216, 2, 241, 203, 70, 17, 12, 26, 217,
+ 146, 2, 63, 70, 17, 12, 26, 145, 2, 121, 70, 17, 12, 26, 145, 2, 63, 70,
+ 17, 12, 26, 121, 2, 145, 70, 17, 12, 26, 121, 2, 63, 70, 17, 12, 26, 234,
+ 136, 2, 145, 70, 17, 12, 26, 234, 136, 2, 63, 70, 17, 12, 26, 222, 86, 2,
+ 145, 70, 17, 12, 26, 222, 86, 2, 121, 70, 17, 12, 26, 222, 86, 2, 234,
+ 136, 70, 17, 12, 26, 222, 86, 2, 63, 70, 17, 12, 26, 222, 196, 2, 121,
+ 70, 17, 12, 26, 222, 196, 2, 234, 136, 70, 17, 12, 26, 222, 196, 2, 63,
+ 70, 17, 12, 26, 248, 160, 2, 145, 70, 17, 12, 26, 248, 160, 2, 121, 70,
+ 17, 12, 26, 248, 160, 2, 234, 136, 70, 17, 12, 26, 248, 160, 2, 63, 70,
+ 17, 12, 26, 218, 30, 2, 121, 70, 17, 12, 26, 212, 105, 2, 63, 70, 17, 12,
+ 26, 254, 104, 2, 145, 70, 17, 12, 26, 254, 104, 2, 63, 70, 17, 12, 26,
+ 242, 221, 2, 145, 70, 17, 12, 26, 242, 221, 2, 63, 70, 17, 12, 26, 244,
+ 112, 2, 145, 70, 17, 12, 26, 244, 112, 2, 121, 70, 17, 12, 26, 244, 112,
+ 2, 234, 136, 70, 17, 12, 26, 244, 112, 2, 63, 70, 17, 12, 26, 224, 226,
+ 2, 121, 70, 17, 12, 26, 224, 226, 2, 63, 70, 17, 12, 26, 234, 255, 2,
+ 145, 70, 17, 12, 26, 234, 255, 2, 121, 70, 17, 12, 26, 234, 255, 2, 234,
+ 136, 70, 17, 12, 26, 234, 255, 2, 233, 127, 70, 17, 12, 26, 234, 255, 2,
+ 63, 70, 17, 12, 26, 233, 127, 2, 145, 70, 17, 12, 26, 233, 127, 2, 121,
+ 70, 17, 12, 26, 233, 127, 2, 234, 136, 70, 17, 12, 26, 233, 127, 2, 63,
+ 70, 17, 12, 26, 233, 127, 2, 241, 203, 70, 17, 12, 26, 63, 2, 145, 70,
+ 17, 12, 26, 63, 2, 121, 70, 17, 12, 26, 63, 2, 234, 136, 70, 17, 12, 26,
+ 63, 2, 63, 70, 17, 12, 26, 228, 174, 2, 145, 70, 17, 12, 26, 228, 174, 2,
+ 121, 70, 17, 12, 26, 228, 174, 2, 234, 136, 70, 17, 12, 26, 228, 174, 2,
+ 63, 70, 17, 12, 26, 228, 174, 2, 241, 203, 70, 17, 12, 26, 241, 203, 2,
+ 145, 70, 17, 12, 26, 241, 203, 2, 63, 70, 17, 12, 26, 241, 203, 2, 218,
+ 223, 106, 70, 17, 12, 26, 73, 2, 145, 70, 17, 12, 26, 73, 2, 121, 70, 17,
+ 12, 26, 73, 2, 234, 136, 70, 17, 12, 26, 73, 2, 63, 70, 17, 12, 26, 73,
+ 2, 241, 203, 70, 17, 12, 26, 73, 2, 192, 78, 2, 63, 138, 17, 12, 26, 73,
+ 2, 192, 78, 2, 241, 203, 138, 17, 12, 26, 251, 231, 2, 63, 138, 17, 12,
+ 26, 251, 231, 2, 241, 203, 138, 17, 12, 26, 217, 216, 2, 63, 138, 17, 12,
+ 26, 217, 216, 2, 241, 203, 138, 17, 12, 26, 217, 146, 2, 63, 138, 17, 12,
+ 26, 217, 146, 2, 241, 203, 138, 17, 12, 26, 222, 86, 2, 63, 138, 17, 12,
+ 26, 222, 86, 2, 241, 203, 138, 17, 12, 26, 220, 240, 2, 63, 138, 17, 12,
+ 26, 220, 240, 2, 241, 203, 138, 17, 12, 26, 234, 255, 2, 233, 127, 138,
+ 17, 12, 26, 234, 255, 2, 63, 138, 17, 12, 26, 233, 127, 2, 63, 138, 17,
+ 12, 26, 228, 174, 2, 63, 138, 17, 12, 26, 228, 174, 2, 241, 203, 138, 17,
+ 12, 26, 73, 2, 63, 138, 17, 12, 26, 73, 2, 241, 203, 138, 17, 12, 26,
+ 221, 16, 2, 244, 134, 138, 17, 12, 26, 221, 16, 2, 248, 130, 138, 17, 12,
+ 26, 221, 16, 2, 234, 211, 138, 17, 12, 26, 218, 30, 2, 106, 210, 48, 17,
+ 12, 26, 218, 30, 2, 73, 48, 17, 12, 26, 254, 104, 2, 106, 210, 48, 17,
+ 12, 26, 254, 104, 2, 73, 48, 17, 12, 26, 242, 221, 2, 106, 210, 48, 17,
+ 12, 26, 242, 221, 2, 73, 48, 17, 12, 26, 222, 86, 2, 106, 210, 48, 17,
+ 12, 26, 222, 86, 2, 73, 48, 17, 12, 26, 220, 240, 2, 106, 210, 48, 17,
+ 12, 26, 220, 240, 2, 73, 48, 17, 12, 26, 121, 2, 106, 210, 48, 17, 12,
+ 26, 121, 2, 73, 48, 17, 12, 26, 145, 2, 106, 210, 48, 17, 12, 26, 145, 2,
+ 73, 48, 17, 12, 26, 234, 136, 2, 106, 210, 48, 17, 12, 26, 234, 136, 2,
+ 73, 48, 17, 12, 26, 222, 196, 2, 106, 210, 48, 17, 12, 26, 222, 196, 2,
+ 73, 48, 17, 12, 26, 248, 160, 2, 106, 210, 48, 17, 12, 26, 248, 160, 2,
+ 73, 48, 17, 12, 26, 220, 240, 2, 145, 48, 17, 12, 26, 220, 240, 2, 121,
+ 48, 17, 12, 26, 220, 240, 2, 234, 136, 48, 17, 12, 26, 220, 240, 2, 63,
+ 48, 17, 12, 26, 220, 240, 2, 223, 246, 48, 17, 12, 26, 222, 86, 2, 223,
+ 246, 48, 17, 12, 26, 222, 196, 2, 223, 246, 48, 17, 12, 26, 248, 160, 2,
+ 223, 246, 48, 17, 12, 26, 218, 30, 2, 106, 210, 40, 17, 12, 26, 218, 30,
+ 2, 73, 40, 17, 12, 26, 254, 104, 2, 106, 210, 40, 17, 12, 26, 254, 104,
+ 2, 73, 40, 17, 12, 26, 242, 221, 2, 106, 210, 40, 17, 12, 26, 242, 221,
+ 2, 73, 40, 17, 12, 26, 222, 86, 2, 106, 210, 40, 17, 12, 26, 222, 86, 2,
+ 73, 40, 17, 12, 26, 220, 240, 2, 106, 210, 40, 17, 12, 26, 220, 240, 2,
+ 73, 40, 17, 12, 26, 121, 2, 106, 210, 40, 17, 12, 26, 121, 2, 73, 40, 17,
+ 12, 26, 145, 2, 106, 210, 40, 17, 12, 26, 145, 2, 73, 40, 17, 12, 26,
+ 234, 136, 2, 106, 210, 40, 17, 12, 26, 234, 136, 2, 73, 40, 17, 12, 26,
+ 222, 196, 2, 106, 210, 40, 17, 12, 26, 222, 196, 2, 73, 40, 17, 12, 26,
+ 248, 160, 2, 106, 210, 40, 17, 12, 26, 248, 160, 2, 73, 40, 17, 12, 26,
+ 220, 240, 2, 145, 40, 17, 12, 26, 220, 240, 2, 121, 40, 17, 12, 26, 220,
+ 240, 2, 234, 136, 40, 17, 12, 26, 220, 240, 2, 63, 40, 17, 12, 26, 220,
+ 240, 2, 223, 246, 40, 17, 12, 26, 222, 86, 2, 223, 246, 40, 17, 12, 26,
+ 222, 196, 2, 223, 246, 40, 17, 12, 26, 248, 160, 2, 223, 246, 40, 17, 12,
+ 26, 220, 240, 2, 145, 70, 17, 12, 26, 220, 240, 2, 121, 70, 17, 12, 26,
+ 220, 240, 2, 234, 136, 70, 17, 12, 26, 220, 240, 2, 63, 70, 17, 12, 26,
+ 222, 86, 2, 241, 203, 70, 17, 12, 26, 220, 240, 2, 241, 203, 70, 17, 12,
+ 26, 218, 30, 2, 63, 70, 17, 12, 26, 222, 86, 2, 145, 138, 17, 12, 26,
+ 222, 86, 2, 121, 138, 17, 12, 26, 222, 86, 2, 234, 136, 138, 17, 12, 26,
+ 220, 240, 2, 145, 138, 17, 12, 26, 220, 240, 2, 121, 138, 17, 12, 26,
+ 220, 240, 2, 234, 136, 138, 17, 12, 26, 218, 30, 2, 63, 138, 17, 12, 26,
+ 212, 105, 2, 63, 138, 17, 12, 26, 106, 2, 244, 132, 40, 17, 12, 26, 106,
+ 2, 244, 132, 48, 17, 227, 13, 42, 226, 131, 227, 13, 46, 226, 131, 12,
+ 26, 217, 216, 2, 145, 2, 63, 70, 17, 12, 26, 217, 216, 2, 121, 2, 145,
+ 40, 17, 12, 26, 217, 216, 2, 121, 2, 145, 70, 17, 12, 26, 217, 216, 2,
+ 121, 2, 63, 70, 17, 12, 26, 217, 216, 2, 234, 136, 2, 63, 70, 17, 12, 26,
+ 217, 216, 2, 63, 2, 145, 70, 17, 12, 26, 217, 216, 2, 63, 2, 121, 70, 17,
+ 12, 26, 217, 216, 2, 63, 2, 234, 136, 70, 17, 12, 26, 145, 2, 63, 2, 121,
+ 40, 17, 12, 26, 145, 2, 63, 2, 121, 70, 17, 12, 26, 121, 2, 63, 2, 73,
+ 40, 17, 12, 26, 121, 2, 63, 2, 106, 210, 40, 17, 12, 26, 222, 86, 2, 121,
+ 2, 145, 70, 17, 12, 26, 222, 86, 2, 145, 2, 121, 70, 17, 12, 26, 222, 86,
+ 2, 145, 2, 106, 210, 40, 17, 12, 26, 222, 86, 2, 63, 2, 121, 40, 17, 12,
+ 26, 222, 86, 2, 63, 2, 121, 70, 17, 12, 26, 222, 86, 2, 63, 2, 145, 70,
+ 17, 12, 26, 222, 86, 2, 63, 2, 63, 40, 17, 12, 26, 222, 86, 2, 63, 2, 63,
+ 70, 17, 12, 26, 222, 196, 2, 121, 2, 121, 40, 17, 12, 26, 222, 196, 2,
+ 121, 2, 121, 70, 17, 12, 26, 222, 196, 2, 63, 2, 63, 40, 17, 12, 26, 220,
+ 240, 2, 121, 2, 63, 40, 17, 12, 26, 220, 240, 2, 121, 2, 63, 70, 17, 12,
+ 26, 220, 240, 2, 145, 2, 73, 40, 17, 12, 26, 220, 240, 2, 63, 2, 234,
+ 136, 40, 17, 12, 26, 220, 240, 2, 63, 2, 234, 136, 70, 17, 12, 26, 220,
+ 240, 2, 63, 2, 63, 40, 17, 12, 26, 220, 240, 2, 63, 2, 63, 70, 17, 12,
+ 26, 248, 160, 2, 121, 2, 106, 210, 40, 17, 12, 26, 248, 160, 2, 234, 136,
+ 2, 63, 40, 17, 12, 26, 248, 160, 2, 234, 136, 2, 63, 70, 17, 12, 26, 218,
+ 30, 2, 63, 2, 121, 40, 17, 12, 26, 218, 30, 2, 63, 2, 121, 70, 17, 12,
+ 26, 218, 30, 2, 63, 2, 63, 70, 17, 12, 26, 218, 30, 2, 63, 2, 73, 40, 17,
+ 12, 26, 254, 104, 2, 145, 2, 63, 40, 17, 12, 26, 254, 104, 2, 63, 2, 63,
+ 40, 17, 12, 26, 254, 104, 2, 63, 2, 63, 70, 17, 12, 26, 254, 104, 2, 63,
+ 2, 106, 210, 40, 17, 12, 26, 242, 221, 2, 63, 2, 63, 40, 17, 12, 26, 242,
+ 221, 2, 63, 2, 73, 40, 17, 12, 26, 242, 221, 2, 63, 2, 106, 210, 40, 17,
+ 12, 26, 244, 112, 2, 234, 136, 2, 63, 40, 17, 12, 26, 244, 112, 2, 234,
+ 136, 2, 63, 70, 17, 12, 26, 224, 226, 2, 63, 2, 121, 40, 17, 12, 26, 224,
+ 226, 2, 63, 2, 63, 40, 17, 12, 26, 233, 127, 2, 121, 2, 63, 40, 17, 12,
+ 26, 233, 127, 2, 121, 2, 73, 40, 17, 12, 26, 233, 127, 2, 121, 2, 106,
+ 210, 40, 17, 12, 26, 233, 127, 2, 145, 2, 145, 70, 17, 12, 26, 233, 127,
+ 2, 145, 2, 145, 40, 17, 12, 26, 233, 127, 2, 234, 136, 2, 63, 40, 17, 12,
+ 26, 233, 127, 2, 234, 136, 2, 63, 70, 17, 12, 26, 233, 127, 2, 63, 2,
+ 121, 40, 17, 12, 26, 233, 127, 2, 63, 2, 121, 70, 17, 12, 26, 63, 2, 121,
+ 2, 145, 70, 17, 12, 26, 63, 2, 121, 2, 63, 70, 17, 12, 26, 63, 2, 121, 2,
+ 73, 40, 17, 12, 26, 63, 2, 145, 2, 121, 70, 17, 12, 26, 63, 2, 145, 2,
+ 63, 70, 17, 12, 26, 63, 2, 234, 136, 2, 145, 70, 17, 12, 26, 63, 2, 234,
+ 136, 2, 63, 70, 17, 12, 26, 63, 2, 145, 2, 234, 136, 70, 17, 12, 26, 241,
+ 203, 2, 63, 2, 145, 70, 17, 12, 26, 241, 203, 2, 63, 2, 63, 70, 17, 12,
+ 26, 228, 174, 2, 121, 2, 63, 70, 17, 12, 26, 228, 174, 2, 121, 2, 106,
+ 210, 40, 17, 12, 26, 228, 174, 2, 145, 2, 63, 40, 17, 12, 26, 228, 174,
+ 2, 145, 2, 63, 70, 17, 12, 26, 228, 174, 2, 145, 2, 106, 210, 40, 17, 12,
+ 26, 228, 174, 2, 63, 2, 73, 40, 17, 12, 26, 228, 174, 2, 63, 2, 106, 210,
+ 40, 17, 12, 26, 73, 2, 63, 2, 63, 40, 17, 12, 26, 73, 2, 63, 2, 63, 70,
+ 17, 12, 26, 251, 231, 2, 234, 136, 2, 73, 40, 17, 12, 26, 217, 216, 2,
+ 145, 2, 73, 40, 17, 12, 26, 217, 216, 2, 145, 2, 106, 210, 40, 17, 12,
+ 26, 217, 216, 2, 234, 136, 2, 73, 40, 17, 12, 26, 217, 216, 2, 234, 136,
+ 2, 106, 210, 40, 17, 12, 26, 217, 216, 2, 63, 2, 73, 40, 17, 12, 26, 217,
+ 216, 2, 63, 2, 106, 210, 40, 17, 12, 26, 145, 2, 63, 2, 73, 40, 17, 12,
+ 26, 145, 2, 121, 2, 106, 210, 40, 17, 12, 26, 145, 2, 63, 2, 106, 210,
+ 40, 17, 12, 26, 222, 86, 2, 234, 136, 2, 106, 210, 40, 17, 12, 26, 222,
+ 196, 2, 121, 2, 73, 40, 17, 12, 26, 220, 240, 2, 121, 2, 73, 40, 17, 12,
+ 26, 248, 160, 2, 121, 2, 73, 40, 17, 12, 26, 233, 127, 2, 145, 2, 73, 40,
+ 17, 12, 26, 233, 127, 2, 63, 2, 73, 40, 17, 12, 26, 73, 2, 121, 2, 73,
+ 40, 17, 12, 26, 73, 2, 145, 2, 73, 40, 17, 12, 26, 73, 2, 63, 2, 73, 40,
+ 17, 12, 26, 63, 2, 63, 2, 73, 40, 17, 12, 26, 224, 226, 2, 63, 2, 73, 40,
+ 17, 12, 26, 228, 174, 2, 121, 2, 73, 40, 17, 12, 26, 224, 226, 2, 63, 2,
+ 121, 70, 17, 12, 26, 233, 127, 2, 121, 2, 63, 70, 17, 12, 26, 254, 104,
+ 2, 63, 2, 73, 40, 17, 12, 26, 234, 255, 2, 63, 2, 73, 40, 17, 12, 26,
+ 228, 174, 2, 145, 2, 121, 70, 17, 12, 26, 63, 2, 234, 136, 2, 73, 40, 17,
+ 12, 26, 233, 127, 2, 145, 2, 63, 70, 17, 12, 26, 234, 255, 2, 63, 2, 63,
+ 40, 17, 12, 26, 233, 127, 2, 145, 2, 63, 40, 17, 12, 26, 228, 174, 2,
+ 145, 2, 121, 40, 17, 12, 26, 145, 2, 121, 2, 73, 40, 17, 12, 26, 121, 2,
+ 145, 2, 73, 40, 17, 12, 26, 63, 2, 145, 2, 73, 40, 17, 12, 26, 244, 112,
+ 2, 63, 2, 73, 40, 17, 12, 26, 251, 231, 2, 121, 2, 73, 40, 17, 12, 26,
+ 234, 255, 2, 63, 2, 63, 70, 17, 12, 26, 254, 104, 2, 145, 2, 63, 70, 17,
+ 12, 26, 222, 196, 2, 63, 2, 63, 70, 17, 12, 26, 222, 86, 2, 234, 136, 2,
+ 73, 40, 17, 12, 26, 228, 174, 2, 145, 2, 73, 40, 17, 12, 26, 222, 175,
+ 215, 102, 253, 153, 234, 13, 219, 70, 5, 48, 17, 12, 26, 224, 222, 215,
+ 102, 253, 153, 234, 13, 219, 70, 5, 48, 17, 12, 26, 254, 62, 48, 17, 12,
+ 26, 254, 91, 48, 17, 12, 26, 230, 223, 48, 17, 12, 26, 222, 176, 48, 17,
+ 12, 26, 224, 35, 48, 17, 12, 26, 254, 80, 48, 17, 12, 26, 214, 33, 48,
+ 17, 12, 26, 222, 175, 48, 17, 12, 26, 222, 174, 254, 80, 214, 32, 12, 26,
+ 235, 134, 223, 187, 52, 12, 26, 251, 153, 253, 209, 253, 210, 43, 222,
+ 76, 43, 221, 221, 43, 221, 153, 43, 221, 142, 43, 221, 131, 43, 221, 120,
+ 43, 221, 109, 43, 221, 98, 43, 221, 87, 43, 222, 75, 43, 222, 64, 43,
+ 222, 53, 43, 222, 42, 43, 222, 31, 43, 222, 20, 43, 222, 9, 225, 74, 243,
+ 245, 31, 71, 249, 157, 225, 74, 243, 245, 31, 71, 105, 249, 157, 225, 74,
+ 243, 245, 31, 71, 105, 243, 200, 219, 69, 225, 74, 243, 245, 31, 71, 249,
+ 164, 225, 74, 243, 245, 31, 71, 221, 70, 225, 74, 243, 245, 31, 71, 244,
+ 254, 77, 225, 74, 243, 245, 31, 71, 224, 158, 77, 225, 74, 243, 245, 31,
+ 71, 42, 67, 233, 44, 125, 225, 74, 243, 245, 31, 71, 46, 67, 233, 44,
+ 251, 83, 225, 74, 243, 245, 31, 71, 199, 245, 120, 37, 26, 42, 242, 9,
+ 37, 26, 46, 242, 9, 37, 51, 217, 43, 42, 242, 9, 37, 51, 217, 43, 46,
+ 242, 9, 37, 232, 38, 42, 242, 9, 37, 232, 38, 46, 242, 9, 37, 249, 137,
+ 232, 37, 225, 74, 243, 245, 31, 71, 117, 62, 233, 80, 225, 74, 243, 245,
+ 31, 71, 245, 118, 248, 101, 225, 74, 243, 245, 31, 71, 245, 109, 248,
+ 101, 225, 74, 243, 245, 31, 71, 115, 232, 242, 225, 74, 243, 245, 31, 71,
+ 214, 16, 115, 232, 242, 225, 74, 243, 245, 31, 71, 42, 226, 131, 225, 74,
+ 243, 245, 31, 71, 46, 226, 131, 225, 74, 243, 245, 31, 71, 42, 249, 40,
+ 125, 225, 74, 243, 245, 31, 71, 46, 249, 40, 125, 225, 74, 243, 245, 31,
+ 71, 42, 216, 219, 220, 233, 125, 225, 74, 243, 245, 31, 71, 46, 216, 219,
+ 220, 233, 125, 225, 74, 243, 245, 31, 71, 42, 83, 233, 44, 125, 225, 74,
+ 243, 245, 31, 71, 46, 83, 233, 44, 125, 225, 74, 243, 245, 31, 71, 42,
+ 51, 254, 19, 125, 225, 74, 243, 245, 31, 71, 46, 51, 254, 19, 125, 225,
+ 74, 243, 245, 31, 71, 42, 254, 19, 125, 225, 74, 243, 245, 31, 71, 46,
+ 254, 19, 125, 225, 74, 243, 245, 31, 71, 42, 249, 100, 125, 225, 74, 243,
+ 245, 31, 71, 46, 249, 100, 125, 225, 74, 243, 245, 31, 71, 42, 67, 249,
+ 100, 125, 225, 74, 243, 245, 31, 71, 46, 67, 249, 100, 125, 221, 52, 247,
+ 74, 67, 221, 52, 247, 74, 225, 74, 243, 245, 31, 71, 42, 41, 125, 225,
+ 74, 243, 245, 31, 71, 46, 41, 125, 248, 100, 226, 243, 250, 106, 226,
+ 243, 214, 16, 226, 243, 51, 214, 16, 226, 243, 248, 100, 115, 232, 242,
+ 250, 106, 115, 232, 242, 214, 16, 115, 232, 242, 3, 249, 157, 3, 105,
+ 249, 157, 3, 243, 200, 219, 69, 3, 221, 70, 3, 249, 164, 3, 224, 158, 77,
+ 3, 244, 254, 77, 3, 245, 118, 248, 101, 3, 42, 226, 131, 3, 46, 226, 131,
+ 3, 42, 249, 40, 125, 3, 46, 249, 40, 125, 3, 42, 216, 219, 220, 233, 125,
+ 3, 46, 216, 219, 220, 233, 125, 3, 50, 52, 3, 254, 35, 3, 253, 132, 3,
+ 94, 52, 3, 240, 159, 3, 233, 39, 52, 3, 242, 107, 52, 3, 245, 61, 52, 3,
+ 223, 203, 219, 231, 3, 247, 86, 52, 3, 226, 57, 52, 3, 249, 156, 253,
+ 122, 12, 244, 132, 48, 17, 12, 217, 251, 2, 244, 132, 49, 12, 248, 128,
+ 48, 17, 12, 218, 28, 243, 227, 12, 234, 209, 48, 17, 12, 244, 134, 48,
+ 17, 12, 244, 134, 138, 17, 12, 248, 130, 48, 17, 12, 248, 130, 138, 17,
+ 12, 234, 211, 48, 17, 12, 234, 211, 138, 17, 12, 221, 16, 48, 17, 12,
+ 221, 16, 138, 17, 12, 218, 247, 48, 17, 12, 218, 247, 138, 17, 12, 1,
+ 192, 48, 17, 12, 1, 106, 2, 232, 33, 78, 48, 17, 12, 1, 106, 2, 232, 33,
+ 78, 40, 17, 12, 1, 106, 2, 192, 78, 48, 17, 12, 1, 106, 2, 192, 78, 40,
+ 17, 12, 1, 214, 15, 2, 192, 78, 48, 17, 12, 1, 214, 15, 2, 192, 78, 40,
+ 17, 12, 1, 106, 2, 192, 251, 220, 48, 17, 12, 1, 106, 2, 192, 251, 220,
+ 40, 17, 12, 1, 73, 2, 192, 78, 48, 17, 12, 1, 73, 2, 192, 78, 40, 17, 12,
+ 1, 73, 2, 192, 78, 70, 17, 12, 1, 73, 2, 192, 78, 138, 17, 12, 1, 106,
+ 48, 17, 12, 1, 106, 40, 17, 12, 1, 251, 231, 48, 17, 12, 1, 251, 231, 40,
+ 17, 12, 1, 251, 231, 70, 17, 12, 1, 251, 231, 138, 17, 12, 1, 217, 216,
+ 231, 228, 48, 17, 12, 1, 217, 216, 231, 228, 40, 17, 12, 1, 217, 216, 48,
+ 17, 12, 1, 217, 216, 40, 17, 12, 1, 217, 216, 70, 17, 12, 1, 217, 216,
+ 138, 17, 12, 1, 217, 146, 48, 17, 12, 1, 217, 146, 40, 17, 12, 1, 217,
+ 146, 70, 17, 12, 1, 217, 146, 138, 17, 12, 1, 145, 48, 17, 12, 1, 145,
+ 40, 17, 12, 1, 145, 70, 17, 12, 1, 145, 138, 17, 12, 1, 121, 48, 17, 12,
+ 1, 121, 40, 17, 12, 1, 121, 70, 17, 12, 1, 121, 138, 17, 12, 1, 234, 136,
+ 48, 17, 12, 1, 234, 136, 40, 17, 12, 1, 234, 136, 70, 17, 12, 1, 234,
+ 136, 138, 17, 12, 1, 248, 141, 48, 17, 12, 1, 248, 141, 40, 17, 12, 1,
+ 217, 156, 48, 17, 12, 1, 217, 156, 40, 17, 12, 1, 223, 246, 48, 17, 12,
+ 1, 223, 246, 40, 17, 12, 1, 212, 102, 48, 17, 12, 1, 212, 102, 40, 17,
+ 12, 1, 222, 86, 48, 17, 12, 1, 222, 86, 40, 17, 12, 1, 222, 86, 70, 17,
+ 12, 1, 222, 86, 138, 17, 12, 1, 220, 240, 48, 17, 12, 1, 220, 240, 40,
+ 17, 12, 1, 220, 240, 70, 17, 12, 1, 220, 240, 138, 17, 12, 1, 222, 196,
+ 48, 17, 12, 1, 222, 196, 40, 17, 12, 1, 222, 196, 70, 17, 12, 1, 222,
+ 196, 138, 17, 12, 1, 248, 160, 48, 17, 12, 1, 248, 160, 40, 17, 12, 1,
+ 248, 160, 70, 17, 12, 1, 248, 160, 138, 17, 12, 1, 218, 30, 48, 17, 12,
+ 1, 218, 30, 40, 17, 12, 1, 218, 30, 70, 17, 12, 1, 218, 30, 138, 17, 12,
+ 1, 212, 105, 48, 17, 12, 1, 212, 105, 40, 17, 12, 1, 212, 105, 70, 17,
+ 12, 1, 212, 105, 138, 17, 12, 1, 254, 104, 48, 17, 12, 1, 254, 104, 40,
+ 17, 12, 1, 254, 104, 70, 17, 12, 1, 254, 104, 138, 17, 12, 1, 242, 221,
+ 48, 17, 12, 1, 242, 221, 40, 17, 12, 1, 242, 221, 70, 17, 12, 1, 242,
+ 221, 138, 17, 12, 1, 244, 112, 48, 17, 12, 1, 244, 112, 40, 17, 12, 1,
+ 244, 112, 70, 17, 12, 1, 244, 112, 138, 17, 12, 1, 224, 226, 48, 17, 12,
+ 1, 224, 226, 40, 17, 12, 1, 224, 226, 70, 17, 12, 1, 224, 226, 138, 17,
+ 12, 1, 234, 255, 48, 17, 12, 1, 234, 255, 40, 17, 12, 1, 234, 255, 70,
+ 17, 12, 1, 234, 255, 138, 17, 12, 1, 233, 127, 48, 17, 12, 1, 233, 127,
+ 40, 17, 12, 1, 233, 127, 70, 17, 12, 1, 233, 127, 138, 17, 12, 1, 63, 48,
+ 17, 12, 1, 63, 40, 17, 12, 1, 63, 70, 17, 12, 1, 63, 138, 17, 12, 1, 228,
+ 174, 48, 17, 12, 1, 228, 174, 40, 17, 12, 1, 228, 174, 70, 17, 12, 1,
+ 228, 174, 138, 17, 12, 1, 241, 203, 48, 17, 12, 1, 241, 203, 40, 17, 12,
+ 1, 241, 203, 70, 17, 12, 1, 241, 203, 138, 17, 12, 1, 214, 15, 48, 17,
+ 12, 1, 214, 15, 40, 17, 12, 1, 106, 210, 48, 17, 12, 1, 106, 210, 40, 17,
+ 12, 1, 73, 48, 17, 12, 1, 73, 40, 17, 12, 1, 73, 70, 17, 12, 1, 73, 138,
+ 17, 12, 26, 233, 127, 2, 106, 2, 232, 33, 78, 48, 17, 12, 26, 233, 127,
+ 2, 106, 2, 232, 33, 78, 40, 17, 12, 26, 233, 127, 2, 106, 2, 192, 78, 48,
+ 17, 12, 26, 233, 127, 2, 106, 2, 192, 78, 40, 17, 12, 26, 233, 127, 2,
+ 106, 2, 192, 251, 220, 48, 17, 12, 26, 233, 127, 2, 106, 2, 192, 251,
+ 220, 40, 17, 12, 26, 233, 127, 2, 106, 48, 17, 12, 26, 233, 127, 2, 106,
+ 40, 17, 212, 80, 213, 230, 228, 184, 219, 206, 120, 244, 254, 77, 120,
+ 224, 143, 77, 120, 50, 52, 120, 247, 86, 52, 120, 226, 57, 52, 120, 254,
+ 35, 120, 253, 226, 120, 42, 226, 131, 120, 46, 226, 131, 120, 253, 132,
+ 120, 94, 52, 120, 249, 157, 120, 240, 159, 120, 243, 200, 219, 69, 120,
+ 219, 231, 120, 21, 212, 79, 120, 21, 116, 120, 21, 109, 120, 21, 166,
+ 120, 21, 163, 120, 21, 180, 120, 21, 189, 120, 21, 198, 120, 21, 195,
+ 120, 21, 200, 120, 249, 164, 120, 221, 70, 120, 233, 39, 52, 120, 245,
+ 61, 52, 120, 242, 107, 52, 120, 224, 158, 77, 120, 249, 156, 253, 122,
+ 120, 7, 6, 1, 61, 120, 7, 6, 1, 253, 74, 120, 7, 6, 1, 250, 252, 120, 7,
+ 6, 1, 249, 3, 120, 7, 6, 1, 74, 120, 7, 6, 1, 244, 230, 120, 7, 6, 1,
+ 243, 177, 120, 7, 6, 1, 242, 41, 120, 7, 6, 1, 72, 120, 7, 6, 1, 235,
+ 142, 120, 7, 6, 1, 235, 27, 120, 7, 6, 1, 150, 120, 7, 6, 1, 183, 120, 7,
+ 6, 1, 204, 120, 7, 6, 1, 75, 120, 7, 6, 1, 226, 229, 120, 7, 6, 1, 224,
+ 240, 120, 7, 6, 1, 149, 120, 7, 6, 1, 197, 120, 7, 6, 1, 218, 99, 120, 7,
+ 6, 1, 69, 120, 7, 6, 1, 215, 79, 120, 7, 6, 1, 214, 82, 120, 7, 6, 1,
+ 213, 166, 120, 7, 6, 1, 213, 105, 120, 7, 6, 1, 212, 152, 120, 42, 41,
+ 125, 120, 223, 203, 219, 231, 120, 46, 41, 125, 120, 249, 224, 254, 174,
+ 120, 115, 232, 242, 120, 242, 114, 254, 174, 120, 7, 3, 1, 61, 120, 7, 3,
+ 1, 253, 74, 120, 7, 3, 1, 250, 252, 120, 7, 3, 1, 249, 3, 120, 7, 3, 1,
+ 74, 120, 7, 3, 1, 244, 230, 120, 7, 3, 1, 243, 177, 120, 7, 3, 1, 242,
+ 41, 120, 7, 3, 1, 72, 120, 7, 3, 1, 235, 142, 120, 7, 3, 1, 235, 27, 120,
+ 7, 3, 1, 150, 120, 7, 3, 1, 183, 120, 7, 3, 1, 204, 120, 7, 3, 1, 75,
+ 120, 7, 3, 1, 226, 229, 120, 7, 3, 1, 224, 240, 120, 7, 3, 1, 149, 120,
+ 7, 3, 1, 197, 120, 7, 3, 1, 218, 99, 120, 7, 3, 1, 69, 120, 7, 3, 1, 215,
+ 79, 120, 7, 3, 1, 214, 82, 120, 7, 3, 1, 213, 166, 120, 7, 3, 1, 213,
+ 105, 120, 7, 3, 1, 212, 152, 120, 42, 249, 40, 125, 120, 71, 232, 242,
+ 120, 46, 249, 40, 125, 120, 217, 42, 120, 42, 67, 226, 131, 120, 46, 67,
+ 226, 131, 98, 105, 243, 200, 219, 69, 98, 42, 249, 100, 125, 98, 46, 249,
+ 100, 125, 98, 105, 249, 157, 98, 56, 231, 37, 247, 74, 98, 56, 1, 213,
+ 214, 98, 56, 1, 3, 61, 98, 56, 1, 3, 72, 98, 56, 1, 3, 69, 98, 56, 1, 3,
+ 74, 98, 56, 1, 3, 75, 98, 56, 1, 3, 186, 98, 56, 1, 3, 212, 203, 98, 56,
+ 1, 3, 212, 235, 98, 56, 1, 3, 216, 82, 98, 234, 206, 225, 57, 219, 218,
+ 77, 98, 56, 1, 61, 98, 56, 1, 72, 98, 56, 1, 69, 98, 56, 1, 74, 98, 56,
+ 1, 75, 98, 56, 1, 181, 98, 56, 1, 234, 101, 98, 56, 1, 233, 238, 98, 56,
+ 1, 234, 188, 98, 56, 1, 234, 37, 98, 56, 1, 222, 202, 98, 56, 1, 220,
+ 117, 98, 56, 1, 219, 27, 98, 56, 1, 222, 100, 98, 56, 1, 219, 242, 98,
+ 56, 1, 218, 52, 98, 56, 1, 217, 71, 98, 56, 1, 216, 82, 98, 56, 1, 217,
+ 229, 98, 56, 1, 108, 98, 56, 1, 205, 98, 56, 1, 229, 64, 98, 56, 1, 228,
+ 92, 98, 56, 1, 229, 187, 98, 56, 1, 228, 185, 98, 56, 1, 159, 98, 56, 1,
+ 241, 165, 98, 56, 1, 240, 212, 98, 56, 1, 241, 222, 98, 56, 1, 241, 54,
+ 98, 56, 1, 188, 98, 56, 1, 231, 42, 98, 56, 1, 230, 172, 98, 56, 1, 231,
+ 156, 98, 56, 1, 230, 231, 98, 56, 1, 186, 98, 56, 1, 212, 203, 98, 56, 1,
+ 212, 235, 98, 56, 1, 203, 98, 56, 1, 223, 188, 98, 56, 1, 223, 51, 98,
+ 56, 1, 224, 21, 98, 56, 1, 223, 112, 98, 56, 1, 214, 49, 98, 56, 1, 204,
+ 98, 56, 214, 116, 219, 218, 77, 98, 56, 221, 75, 219, 218, 77, 98, 23,
+ 244, 72, 98, 23, 1, 234, 67, 98, 23, 1, 219, 150, 98, 23, 1, 234, 60, 98,
+ 23, 1, 229, 57, 98, 23, 1, 229, 55, 98, 23, 1, 229, 54, 98, 23, 1, 217,
+ 55, 98, 23, 1, 219, 139, 98, 23, 1, 223, 179, 98, 23, 1, 223, 174, 98,
+ 23, 1, 223, 171, 98, 23, 1, 223, 164, 98, 23, 1, 223, 159, 98, 23, 1,
+ 223, 154, 98, 23, 1, 223, 165, 98, 23, 1, 223, 177, 98, 23, 1, 231, 30,
+ 98, 23, 1, 225, 227, 98, 23, 1, 219, 147, 98, 23, 1, 225, 216, 98, 23, 1,
+ 220, 76, 98, 23, 1, 219, 144, 98, 23, 1, 236, 51, 98, 23, 1, 249, 239,
+ 98, 23, 1, 219, 154, 98, 23, 1, 250, 43, 98, 23, 1, 234, 116, 98, 23, 1,
+ 217, 126, 98, 23, 1, 226, 7, 98, 23, 1, 241, 158, 98, 23, 1, 61, 98, 23,
+ 1, 254, 148, 98, 23, 1, 186, 98, 23, 1, 213, 80, 98, 23, 1, 245, 76, 98,
+ 23, 1, 74, 98, 23, 1, 213, 27, 98, 23, 1, 213, 38, 98, 23, 1, 75, 98, 23,
+ 1, 214, 49, 98, 23, 1, 214, 46, 98, 23, 1, 227, 99, 98, 23, 1, 212, 235,
+ 98, 23, 1, 69, 98, 23, 1, 213, 252, 98, 23, 1, 214, 6, 98, 23, 1, 213,
+ 235, 98, 23, 1, 212, 203, 98, 23, 1, 245, 22, 98, 23, 1, 212, 255, 98,
+ 23, 1, 72, 120, 250, 110, 52, 120, 225, 108, 52, 120, 228, 163, 52, 120,
+ 232, 37, 120, 251, 63, 134, 120, 213, 31, 52, 120, 213, 204, 52, 98, 243,
+ 243, 177, 214, 216, 98, 132, 68, 98, 215, 124, 68, 98, 95, 68, 98, 246,
+ 58, 68, 98, 83, 219, 166, 98, 67, 249, 228, 235, 201, 254, 10, 254, 29,
+ 235, 201, 254, 10, 221, 57, 235, 201, 254, 10, 217, 189, 227, 113, 223,
+ 224, 250, 78, 223, 224, 250, 78, 58, 54, 4, 253, 58, 61, 58, 54, 4, 253,
+ 27, 74, 58, 54, 4, 253, 36, 72, 58, 54, 4, 253, 4, 75, 58, 54, 4, 253,
+ 54, 69, 58, 54, 4, 253, 73, 248, 164, 58, 54, 4, 253, 20, 248, 41, 58,
+ 54, 4, 253, 60, 247, 211, 58, 54, 4, 253, 50, 247, 99, 58, 54, 4, 253,
+ 14, 246, 33, 58, 54, 4, 253, 8, 235, 139, 58, 54, 4, 253, 19, 235, 127,
+ 58, 54, 4, 253, 29, 235, 71, 58, 54, 4, 253, 0, 235, 54, 58, 54, 4, 252,
+ 244, 181, 58, 54, 4, 253, 21, 234, 188, 58, 54, 4, 252, 254, 234, 101,
+ 58, 54, 4, 252, 251, 234, 37, 58, 54, 4, 252, 240, 233, 238, 58, 54, 4,
+ 252, 241, 188, 58, 54, 4, 253, 51, 231, 156, 58, 54, 4, 252, 248, 231,
+ 42, 58, 54, 4, 253, 49, 230, 231, 58, 54, 4, 253, 41, 230, 172, 58, 54,
+ 4, 253, 62, 205, 58, 54, 4, 253, 40, 229, 187, 58, 54, 4, 253, 34, 229,
+ 64, 58, 54, 4, 253, 13, 228, 185, 58, 54, 4, 253, 10, 228, 92, 58, 54, 4,
+ 253, 69, 193, 58, 54, 4, 252, 249, 226, 96, 58, 54, 4, 253, 26, 225, 240,
+ 58, 54, 4, 253, 53, 225, 150, 58, 54, 4, 253, 15, 225, 35, 58, 54, 4,
+ 253, 48, 224, 232, 58, 54, 4, 252, 243, 224, 213, 58, 54, 4, 253, 43,
+ 224, 198, 58, 54, 4, 253, 32, 224, 187, 58, 54, 4, 253, 5, 203, 58, 54,
+ 4, 253, 37, 224, 21, 58, 54, 4, 253, 12, 223, 188, 58, 54, 4, 253, 71,
+ 223, 112, 58, 54, 4, 253, 38, 223, 51, 58, 54, 4, 253, 33, 222, 202, 58,
+ 54, 4, 253, 56, 222, 100, 58, 54, 4, 253, 24, 220, 117, 58, 54, 4, 253,
+ 52, 219, 242, 58, 54, 4, 253, 7, 219, 27, 58, 54, 4, 253, 6, 218, 52, 58,
+ 54, 4, 253, 67, 217, 229, 58, 54, 4, 253, 28, 217, 71, 58, 54, 4, 253,
+ 65, 108, 58, 54, 4, 252, 252, 216, 82, 58, 54, 4, 253, 11, 214, 49, 58,
+ 54, 4, 252, 246, 214, 6, 58, 54, 4, 253, 25, 213, 235, 58, 54, 4, 253,
+ 23, 213, 214, 58, 54, 4, 253, 47, 212, 109, 58, 54, 4, 252, 247, 212, 87,
+ 58, 54, 4, 253, 44, 212, 16, 58, 54, 4, 253, 39, 254, 234, 58, 54, 4,
+ 253, 22, 254, 233, 58, 54, 4, 252, 237, 253, 108, 58, 54, 4, 252, 250,
+ 246, 1, 58, 54, 4, 252, 233, 246, 0, 58, 54, 4, 253, 17, 228, 31, 58, 54,
+ 4, 253, 35, 225, 34, 58, 54, 4, 253, 3, 225, 37, 58, 54, 4, 252, 245,
+ 224, 76, 58, 54, 4, 253, 31, 224, 75, 58, 54, 4, 252, 253, 223, 111, 58,
+ 54, 4, 252, 255, 218, 50, 58, 54, 4, 252, 235, 216, 43, 58, 54, 4, 252,
+ 232, 109, 58, 54, 16, 253, 46, 58, 54, 16, 253, 45, 58, 54, 16, 253, 42,
+ 58, 54, 16, 253, 30, 58, 54, 16, 253, 18, 58, 54, 16, 253, 16, 58, 54,
+ 16, 253, 9, 58, 54, 16, 253, 2, 58, 54, 16, 253, 1, 58, 54, 16, 252, 242,
+ 58, 54, 16, 252, 239, 58, 54, 16, 252, 238, 58, 54, 16, 252, 236, 58, 54,
+ 16, 252, 234, 58, 54, 102, 252, 231, 231, 248, 58, 54, 102, 252, 230,
+ 213, 208, 58, 54, 102, 252, 229, 248, 25, 58, 54, 102, 252, 228, 245, 58,
+ 58, 54, 102, 252, 227, 231, 222, 58, 54, 102, 252, 226, 219, 101, 58, 54,
+ 102, 252, 225, 245, 4, 58, 54, 102, 252, 224, 224, 45, 58, 54, 102, 252,
+ 223, 220, 242, 58, 54, 102, 252, 222, 241, 221, 58, 54, 102, 252, 221,
+ 219, 212, 58, 54, 102, 252, 220, 251, 126, 58, 54, 102, 252, 219, 249,
+ 84, 58, 54, 102, 252, 218, 251, 44, 58, 54, 102, 252, 217, 213, 243, 58,
+ 54, 102, 252, 216, 252, 56, 58, 54, 102, 252, 215, 227, 71, 58, 54, 102,
+ 252, 214, 219, 186, 58, 54, 102, 252, 213, 249, 11, 58, 54, 230, 212,
+ 252, 212, 234, 229, 58, 54, 230, 212, 252, 211, 234, 237, 58, 54, 102,
+ 252, 210, 227, 84, 58, 54, 102, 252, 209, 213, 221, 58, 54, 102, 252,
+ 208, 58, 54, 230, 212, 252, 207, 253, 188, 58, 54, 230, 212, 252, 206,
+ 231, 116, 58, 54, 102, 252, 205, 251, 62, 58, 54, 102, 252, 204, 242,
+ 142, 58, 54, 102, 252, 203, 58, 54, 102, 252, 202, 213, 199, 58, 54, 102,
+ 252, 201, 58, 54, 102, 252, 200, 58, 54, 102, 252, 199, 240, 235, 58, 54,
+ 102, 252, 198, 58, 54, 102, 252, 197, 58, 54, 102, 252, 196, 58, 54, 230,
+ 212, 252, 194, 216, 56, 58, 54, 102, 252, 193, 58, 54, 102, 252, 192, 58,
+ 54, 102, 252, 191, 249, 187, 58, 54, 102, 252, 190, 58, 54, 102, 252,
+ 189, 58, 54, 102, 252, 188, 243, 69, 58, 54, 102, 252, 187, 253, 175, 58,
+ 54, 102, 252, 186, 58, 54, 102, 252, 185, 58, 54, 102, 252, 184, 58, 54,
+ 102, 252, 183, 58, 54, 102, 252, 182, 58, 54, 102, 252, 181, 58, 54, 102,
+ 252, 180, 58, 54, 102, 252, 179, 58, 54, 102, 252, 178, 58, 54, 102, 252,
+ 177, 230, 204, 58, 54, 102, 252, 176, 58, 54, 102, 252, 175, 216, 193,
+ 58, 54, 102, 252, 174, 58, 54, 102, 252, 173, 58, 54, 102, 252, 172, 58,
+ 54, 102, 252, 171, 58, 54, 102, 252, 170, 58, 54, 102, 252, 169, 58, 54,
+ 102, 252, 168, 58, 54, 102, 252, 167, 58, 54, 102, 252, 166, 58, 54, 102,
+ 252, 165, 58, 54, 102, 252, 164, 58, 54, 102, 252, 163, 241, 195, 58, 54,
+ 102, 252, 142, 243, 253, 58, 54, 102, 252, 139, 252, 36, 58, 54, 102,
+ 252, 134, 219, 193, 58, 54, 102, 252, 133, 68, 58, 54, 102, 252, 132, 58,
+ 54, 102, 252, 131, 218, 181, 58, 54, 102, 252, 130, 58, 54, 102, 252,
+ 129, 58, 54, 102, 252, 128, 213, 239, 250, 75, 58, 54, 102, 252, 127,
+ 250, 75, 58, 54, 102, 252, 126, 250, 76, 243, 225, 58, 54, 102, 252, 125,
+ 213, 241, 58, 54, 102, 252, 124, 58, 54, 102, 252, 123, 58, 54, 230, 212,
+ 252, 122, 247, 150, 58, 54, 102, 252, 121, 58, 54, 102, 252, 120, 58, 54,
+ 102, 252, 118, 58, 54, 102, 252, 117, 58, 54, 102, 252, 116, 58, 54, 102,
+ 252, 115, 248, 104, 58, 54, 102, 252, 114, 58, 54, 102, 252, 113, 58, 54,
+ 102, 252, 112, 58, 54, 102, 252, 111, 58, 54, 102, 252, 110, 58, 54, 102,
+ 214, 163, 252, 195, 58, 54, 102, 214, 163, 252, 162, 58, 54, 102, 214,
+ 163, 252, 161, 58, 54, 102, 214, 163, 252, 160, 58, 54, 102, 214, 163,
+ 252, 159, 58, 54, 102, 214, 163, 252, 158, 58, 54, 102, 214, 163, 252,
+ 157, 58, 54, 102, 214, 163, 252, 156, 58, 54, 102, 214, 163, 252, 155,
+ 58, 54, 102, 214, 163, 252, 154, 58, 54, 102, 214, 163, 252, 153, 58, 54,
+ 102, 214, 163, 252, 152, 58, 54, 102, 214, 163, 252, 151, 58, 54, 102,
+ 214, 163, 252, 150, 58, 54, 102, 214, 163, 252, 149, 58, 54, 102, 214,
+ 163, 252, 148, 58, 54, 102, 214, 163, 252, 147, 58, 54, 102, 214, 163,
+ 252, 146, 58, 54, 102, 214, 163, 252, 145, 58, 54, 102, 214, 163, 252,
+ 144, 58, 54, 102, 214, 163, 252, 143, 58, 54, 102, 214, 163, 252, 141,
+ 58, 54, 102, 214, 163, 252, 140, 58, 54, 102, 214, 163, 252, 138, 58, 54,
+ 102, 214, 163, 252, 137, 58, 54, 102, 214, 163, 252, 136, 58, 54, 102,
+ 214, 163, 252, 135, 58, 54, 102, 214, 163, 252, 119, 58, 54, 102, 214,
+ 163, 252, 109, 254, 141, 213, 196, 221, 58, 232, 242, 254, 141, 213, 196,
+ 221, 58, 247, 74, 254, 141, 250, 66, 77, 254, 141, 50, 116, 254, 141, 50,
+ 109, 254, 141, 50, 166, 254, 141, 50, 163, 254, 141, 50, 180, 254, 141,
+ 50, 189, 254, 141, 50, 198, 254, 141, 50, 195, 254, 141, 50, 200, 254,
+ 141, 50, 217, 200, 254, 141, 50, 216, 38, 254, 141, 50, 217, 115, 254,
+ 141, 50, 243, 240, 254, 141, 50, 244, 83, 254, 141, 50, 220, 39, 254,
+ 141, 50, 221, 37, 254, 141, 50, 245, 141, 254, 141, 50, 229, 26, 254,
+ 141, 50, 122, 240, 200, 254, 141, 50, 117, 240, 200, 254, 141, 50, 133,
+ 240, 200, 254, 141, 50, 243, 237, 240, 200, 254, 141, 50, 244, 50, 240,
+ 200, 254, 141, 50, 220, 53, 240, 200, 254, 141, 50, 221, 43, 240, 200,
+ 254, 141, 50, 245, 150, 240, 200, 254, 141, 50, 229, 31, 240, 200, 254,
+ 141, 50, 122, 217, 100, 254, 141, 50, 117, 217, 100, 254, 141, 50, 133,
+ 217, 100, 254, 141, 50, 243, 237, 217, 100, 254, 141, 50, 244, 50, 217,
+ 100, 254, 141, 50, 220, 53, 217, 100, 254, 141, 50, 221, 43, 217, 100,
+ 254, 141, 50, 245, 150, 217, 100, 254, 141, 50, 229, 31, 217, 100, 254,
+ 141, 50, 217, 201, 217, 100, 254, 141, 50, 216, 39, 217, 100, 254, 141,
+ 50, 217, 116, 217, 100, 254, 141, 50, 243, 241, 217, 100, 254, 141, 50,
+ 244, 84, 217, 100, 254, 141, 50, 220, 40, 217, 100, 254, 141, 50, 221,
+ 38, 217, 100, 254, 141, 50, 245, 142, 217, 100, 254, 141, 50, 229, 27,
+ 217, 100, 254, 141, 213, 255, 252, 48, 215, 144, 254, 141, 213, 255, 244,
+ 61, 219, 4, 254, 141, 213, 255, 222, 95, 219, 4, 254, 141, 213, 255, 217,
+ 122, 219, 4, 254, 141, 213, 255, 243, 230, 219, 4, 254, 141, 246, 36,
+ 231, 155, 244, 61, 219, 4, 254, 141, 232, 228, 231, 155, 244, 61, 219, 4,
+ 254, 141, 231, 155, 222, 95, 219, 4, 254, 141, 231, 155, 217, 122, 219,
+ 4, 25, 254, 167, 253, 110, 122, 224, 166, 25, 254, 167, 253, 110, 122,
+ 242, 9, 25, 254, 167, 253, 110, 122, 246, 54, 25, 254, 167, 253, 110,
+ 180, 25, 254, 167, 253, 110, 244, 83, 25, 254, 167, 253, 110, 244, 50,
+ 240, 200, 25, 254, 167, 253, 110, 244, 50, 217, 100, 25, 254, 167, 253,
+ 110, 244, 84, 217, 100, 25, 254, 167, 253, 110, 244, 50, 218, 18, 25,
+ 254, 167, 253, 110, 217, 201, 218, 18, 25, 254, 167, 253, 110, 244, 84,
+ 218, 18, 25, 254, 167, 253, 110, 122, 240, 201, 218, 18, 25, 254, 167,
+ 253, 110, 244, 50, 240, 201, 218, 18, 25, 254, 167, 253, 110, 122, 217,
+ 101, 218, 18, 25, 254, 167, 253, 110, 244, 50, 217, 101, 218, 18, 25,
+ 254, 167, 253, 110, 244, 50, 219, 90, 25, 254, 167, 253, 110, 217, 201,
+ 219, 90, 25, 254, 167, 253, 110, 244, 84, 219, 90, 25, 254, 167, 253,
+ 110, 122, 240, 201, 219, 90, 25, 254, 167, 253, 110, 244, 50, 240, 201,
+ 219, 90, 25, 254, 167, 253, 110, 122, 217, 101, 219, 90, 25, 254, 167,
+ 253, 110, 217, 201, 217, 101, 219, 90, 25, 254, 167, 253, 110, 244, 84,
+ 217, 101, 219, 90, 25, 254, 167, 253, 110, 217, 201, 230, 234, 25, 254,
+ 167, 241, 189, 122, 225, 164, 25, 254, 167, 217, 134, 116, 25, 254, 167,
+ 241, 186, 116, 25, 254, 167, 245, 67, 109, 25, 254, 167, 217, 134, 109,
+ 25, 254, 167, 249, 8, 117, 246, 53, 25, 254, 167, 245, 67, 117, 246, 53,
+ 25, 254, 167, 216, 161, 180, 25, 254, 167, 216, 161, 217, 200, 25, 254,
+ 167, 216, 161, 217, 201, 254, 50, 17, 25, 254, 167, 241, 186, 217, 200,
+ 25, 254, 167, 231, 108, 217, 200, 25, 254, 167, 217, 134, 217, 200, 25,
+ 254, 167, 217, 134, 217, 115, 25, 254, 167, 216, 161, 244, 83, 25, 254,
+ 167, 216, 161, 244, 84, 254, 50, 17, 25, 254, 167, 241, 186, 244, 83, 25,
+ 254, 167, 217, 134, 244, 83, 25, 254, 167, 217, 134, 122, 240, 200, 25,
+ 254, 167, 217, 134, 133, 240, 200, 25, 254, 167, 245, 67, 244, 50, 240,
+ 200, 25, 254, 167, 216, 161, 244, 50, 240, 200, 25, 254, 167, 217, 134,
+ 244, 50, 240, 200, 25, 254, 167, 250, 159, 244, 50, 240, 200, 25, 254,
+ 167, 230, 4, 244, 50, 240, 200, 25, 254, 167, 217, 134, 122, 217, 100,
+ 25, 254, 167, 217, 134, 244, 50, 217, 100, 25, 254, 167, 248, 8, 244, 50,
+ 230, 234, 25, 254, 167, 219, 58, 244, 84, 230, 234, 25, 122, 151, 52, 25,
+ 122, 151, 5, 254, 50, 17, 25, 117, 217, 120, 52, 25, 133, 224, 165, 52,
+ 25, 213, 36, 52, 25, 218, 19, 52, 25, 246, 55, 52, 25, 227, 110, 52, 25,
+ 117, 227, 109, 52, 25, 133, 227, 109, 52, 25, 243, 237, 227, 109, 52, 25,
+ 244, 50, 227, 109, 52, 25, 231, 102, 52, 25, 233, 179, 252, 48, 52, 25,
+ 232, 223, 52, 25, 226, 255, 52, 25, 213, 147, 52, 25, 253, 158, 52, 25,
+ 253, 171, 52, 25, 242, 120, 52, 25, 216, 144, 252, 48, 52, 25, 212, 80,
+ 52, 223, 100, 221, 34, 52, 223, 100, 215, 155, 52, 223, 100, 221, 62, 52,
+ 223, 100, 221, 32, 52, 223, 100, 247, 165, 221, 32, 52, 223, 100, 220,
+ 94, 52, 223, 100, 248, 4, 52, 223, 100, 224, 151, 52, 223, 100, 221, 50,
+ 52, 223, 100, 246, 15, 52, 223, 100, 253, 153, 52, 223, 100, 250, 105,
+ 52, 226, 19, 247, 143, 5, 226, 88, 226, 19, 247, 143, 5, 225, 158, 241,
+ 219, 226, 19, 247, 143, 5, 217, 252, 241, 219, 226, 19, 247, 143, 5, 250,
+ 179, 226, 19, 247, 143, 5, 250, 38, 226, 19, 247, 143, 5, 213, 208, 226,
+ 19, 247, 143, 5, 241, 195, 226, 19, 247, 143, 5, 243, 61, 226, 19, 247,
+ 143, 5, 217, 70, 226, 19, 247, 143, 5, 68, 226, 19, 247, 143, 5, 251, 95,
+ 226, 19, 247, 143, 5, 220, 209, 226, 19, 247, 143, 5, 249, 181, 226, 19,
+ 247, 143, 5, 231, 247, 226, 19, 247, 143, 5, 231, 199, 226, 19, 247, 143,
+ 5, 222, 134, 226, 19, 247, 143, 5, 233, 9, 226, 19, 247, 143, 5, 251,
+ 113, 226, 19, 247, 143, 5, 250, 163, 225, 167, 226, 19, 247, 143, 5, 247,
+ 87, 226, 19, 247, 143, 5, 249, 161, 226, 19, 247, 143, 5, 220, 15, 226,
+ 19, 247, 143, 5, 249, 162, 226, 19, 247, 143, 5, 251, 239, 226, 19, 247,
+ 143, 5, 220, 196, 226, 19, 247, 143, 5, 240, 235, 226, 19, 247, 143, 5,
+ 241, 163, 226, 19, 247, 143, 5, 251, 41, 233, 60, 226, 19, 247, 143, 5,
+ 250, 156, 226, 19, 247, 143, 5, 224, 45, 226, 19, 247, 143, 5, 245, 186,
+ 226, 19, 247, 143, 5, 246, 61, 226, 19, 247, 143, 5, 216, 69, 226, 19,
+ 247, 143, 5, 251, 242, 226, 19, 247, 143, 5, 225, 168, 216, 193, 226, 19,
+ 247, 143, 5, 214, 140, 226, 19, 247, 143, 5, 226, 146, 226, 19, 247, 143,
+ 5, 223, 92, 226, 19, 247, 143, 5, 232, 252, 226, 19, 247, 143, 5, 226,
+ 239, 252, 101, 226, 19, 247, 143, 5, 244, 17, 226, 19, 247, 143, 5, 242,
+ 115, 226, 19, 247, 143, 5, 219, 59, 226, 19, 247, 143, 5, 3, 253, 84,
+ 226, 19, 247, 143, 5, 214, 16, 252, 67, 226, 19, 247, 143, 5, 37, 227,
+ 112, 90, 232, 120, 1, 61, 232, 120, 1, 74, 232, 120, 1, 253, 74, 232,
+ 120, 1, 251, 196, 232, 120, 1, 243, 177, 232, 120, 1, 249, 3, 232, 120,
+ 1, 72, 232, 120, 1, 214, 82, 232, 120, 1, 212, 152, 232, 120, 1, 217,
+ 163, 232, 120, 1, 235, 142, 232, 120, 1, 235, 27, 232, 120, 1, 224, 240,
+ 232, 120, 1, 150, 232, 120, 1, 183, 232, 120, 1, 204, 232, 120, 1, 230,
+ 235, 232, 120, 1, 228, 199, 232, 120, 1, 69, 232, 120, 1, 226, 229, 232,
+ 120, 1, 234, 56, 232, 120, 1, 149, 232, 120, 1, 197, 232, 120, 1, 218,
+ 99, 232, 120, 1, 216, 118, 232, 120, 1, 254, 32, 232, 120, 1, 245, 108,
+ 232, 120, 1, 242, 41, 232, 120, 1, 213, 166, 250, 169, 1, 61, 250, 169,
+ 1, 226, 215, 250, 169, 1, 249, 3, 250, 169, 1, 150, 250, 169, 1, 215, 90,
+ 250, 169, 1, 149, 250, 169, 1, 233, 86, 250, 169, 1, 254, 234, 250, 169,
+ 1, 224, 240, 250, 169, 1, 253, 74, 250, 169, 1, 183, 250, 169, 1, 75,
+ 250, 169, 1, 248, 166, 250, 169, 1, 218, 99, 250, 169, 1, 221, 26, 250,
+ 169, 1, 221, 25, 250, 169, 1, 197, 250, 169, 1, 250, 251, 250, 169, 1,
+ 69, 250, 169, 1, 228, 199, 250, 169, 1, 213, 166, 250, 169, 1, 204, 250,
+ 169, 1, 216, 117, 250, 169, 1, 226, 229, 250, 169, 1, 219, 158, 250, 169,
+ 1, 72, 250, 169, 1, 74, 250, 169, 1, 215, 87, 250, 169, 1, 235, 27, 250,
+ 169, 1, 235, 18, 250, 169, 1, 229, 230, 250, 169, 1, 215, 92, 250, 169,
+ 1, 243, 177, 250, 169, 1, 243, 112, 250, 169, 1, 219, 107, 250, 169, 1,
+ 219, 106, 250, 169, 1, 229, 161, 250, 169, 1, 236, 28, 250, 169, 1, 250,
+ 250, 250, 169, 1, 216, 118, 250, 169, 1, 215, 89, 250, 169, 1, 223, 82,
+ 250, 169, 1, 231, 192, 250, 169, 1, 231, 191, 250, 169, 1, 231, 190, 250,
+ 169, 1, 231, 189, 250, 169, 1, 233, 85, 250, 169, 1, 245, 190, 250, 169,
+ 1, 215, 88, 53, 32, 1, 61, 53, 32, 1, 251, 251, 53, 32, 1, 234, 188, 53,
+ 32, 1, 248, 41, 53, 32, 1, 74, 53, 32, 1, 214, 232, 53, 32, 1, 212, 87,
+ 53, 32, 1, 241, 222, 53, 32, 1, 217, 148, 53, 32, 1, 72, 53, 32, 1, 181,
+ 53, 32, 1, 245, 131, 53, 32, 1, 245, 117, 53, 32, 1, 245, 108, 53, 32, 1,
+ 245, 40, 53, 32, 1, 75, 53, 32, 1, 226, 96, 53, 32, 1, 220, 243, 53, 32,
+ 1, 233, 238, 53, 32, 1, 245, 55, 53, 32, 1, 245, 45, 53, 32, 1, 217, 229,
+ 53, 32, 1, 69, 53, 32, 1, 245, 134, 53, 32, 1, 226, 12, 53, 32, 1, 234,
+ 125, 53, 32, 1, 245, 159, 53, 32, 1, 245, 47, 53, 32, 1, 250, 67, 53, 32,
+ 1, 236, 28, 53, 32, 1, 215, 92, 53, 32, 228, 54, 116, 53, 32, 228, 54,
+ 180, 53, 32, 228, 54, 217, 200, 53, 32, 228, 54, 244, 83, 242, 129, 1,
+ 254, 111, 242, 129, 1, 252, 82, 242, 129, 1, 242, 187, 242, 129, 1, 248,
+ 148, 242, 129, 1, 254, 107, 242, 129, 1, 224, 223, 242, 129, 1, 235, 153,
+ 242, 129, 1, 242, 20, 242, 129, 1, 217, 111, 242, 129, 1, 245, 140, 242,
+ 129, 1, 233, 211, 242, 129, 1, 233, 136, 242, 129, 1, 231, 242, 242, 129,
+ 1, 230, 6, 242, 129, 1, 235, 120, 242, 129, 1, 215, 107, 242, 129, 1,
+ 226, 196, 242, 129, 1, 229, 26, 242, 129, 1, 224, 56, 242, 129, 1, 222,
+ 136, 242, 129, 1, 217, 212, 242, 129, 1, 213, 219, 242, 129, 1, 244, 146,
+ 242, 129, 1, 236, 32, 242, 129, 1, 240, 191, 242, 129, 1, 227, 7, 242,
+ 129, 1, 229, 31, 240, 200, 215, 179, 1, 254, 56, 215, 179, 1, 251, 203,
+ 215, 179, 1, 243, 84, 215, 179, 1, 234, 138, 215, 179, 1, 248, 5, 215,
+ 179, 1, 241, 54, 215, 179, 1, 213, 214, 215, 179, 1, 212, 78, 215, 179,
+ 1, 240, 228, 215, 179, 1, 217, 183, 215, 179, 1, 212, 224, 215, 179, 1,
+ 234, 254, 215, 179, 1, 220, 200, 215, 179, 1, 233, 122, 215, 179, 1, 231,
+ 129, 215, 179, 1, 247, 229, 215, 179, 1, 228, 50, 215, 179, 1, 212, 8,
+ 215, 179, 1, 222, 163, 215, 179, 1, 254, 103, 215, 179, 1, 225, 35, 215,
+ 179, 1, 222, 194, 215, 179, 1, 224, 180, 215, 179, 1, 224, 36, 215, 179,
+ 1, 217, 152, 215, 179, 1, 242, 220, 215, 179, 1, 108, 215, 179, 1, 72,
+ 215, 179, 1, 69, 215, 179, 1, 219, 117, 215, 179, 213, 196, 247, 124, 53,
+ 226, 45, 5, 61, 53, 226, 45, 5, 72, 53, 226, 45, 5, 69, 53, 226, 45, 5,
+ 181, 53, 226, 45, 5, 233, 238, 53, 226, 45, 5, 243, 110, 53, 226, 45, 5,
+ 242, 92, 53, 226, 45, 5, 213, 153, 53, 226, 45, 5, 250, 219, 53, 226, 45,
+ 5, 235, 139, 53, 226, 45, 5, 235, 110, 53, 226, 45, 5, 218, 52, 53, 226,
+ 45, 5, 216, 82, 53, 226, 45, 5, 248, 164, 53, 226, 45, 5, 247, 211, 53,
+ 226, 45, 5, 246, 33, 53, 226, 45, 5, 217, 161, 53, 226, 45, 5, 193, 53,
+ 226, 45, 5, 252, 107, 53, 226, 45, 5, 244, 164, 53, 226, 45, 5, 205, 53,
+ 226, 45, 5, 228, 92, 53, 226, 45, 5, 188, 53, 226, 45, 5, 231, 42, 53,
+ 226, 45, 5, 230, 172, 53, 226, 45, 5, 186, 53, 226, 45, 5, 215, 1, 53,
+ 226, 45, 5, 214, 154, 53, 226, 45, 5, 203, 53, 226, 45, 5, 223, 51, 53,
+ 226, 45, 5, 233, 157, 53, 226, 45, 5, 222, 202, 53, 226, 45, 5, 212, 109,
+ 53, 226, 45, 5, 221, 24, 53, 226, 45, 5, 219, 157, 53, 226, 45, 5, 159,
+ 53, 226, 45, 5, 253, 102, 53, 226, 45, 5, 253, 101, 53, 226, 45, 5, 253,
+ 100, 53, 226, 45, 5, 213, 130, 53, 226, 45, 5, 248, 145, 53, 226, 45, 5,
+ 248, 144, 53, 226, 45, 5, 252, 88, 53, 226, 45, 5, 251, 14, 53, 226, 45,
+ 213, 196, 247, 124, 53, 226, 45, 50, 116, 53, 226, 45, 50, 109, 53, 226,
+ 45, 50, 217, 200, 53, 226, 45, 50, 216, 38, 53, 226, 45, 50, 240, 200,
+ 171, 6, 1, 184, 72, 171, 6, 1, 184, 74, 171, 6, 1, 184, 61, 171, 6, 1,
+ 184, 254, 114, 171, 6, 1, 184, 75, 171, 6, 1, 184, 227, 49, 171, 6, 1,
+ 220, 175, 72, 171, 6, 1, 220, 175, 74, 171, 6, 1, 220, 175, 61, 171, 6,
+ 1, 220, 175, 254, 114, 171, 6, 1, 220, 175, 75, 171, 6, 1, 220, 175, 227,
+ 49, 171, 6, 1, 253, 83, 171, 6, 1, 226, 240, 171, 6, 1, 213, 183, 171, 6,
+ 1, 213, 35, 171, 6, 1, 242, 41, 171, 6, 1, 226, 86, 171, 6, 1, 251, 242,
+ 171, 6, 1, 217, 219, 171, 6, 1, 248, 28, 171, 6, 1, 250, 64, 171, 6, 1,
+ 235, 125, 171, 6, 1, 234, 195, 171, 6, 1, 243, 59, 171, 6, 1, 245, 159,
+ 171, 6, 1, 214, 227, 171, 6, 1, 245, 25, 171, 6, 1, 217, 147, 171, 6, 1,
+ 245, 45, 171, 6, 1, 212, 85, 171, 6, 1, 245, 40, 171, 6, 1, 212, 66, 171,
+ 6, 1, 245, 55, 171, 6, 1, 245, 131, 171, 6, 1, 245, 117, 171, 6, 1, 245,
+ 108, 171, 6, 1, 245, 96, 171, 6, 1, 227, 85, 171, 6, 1, 245, 5, 171, 3,
+ 1, 184, 72, 171, 3, 1, 184, 74, 171, 3, 1, 184, 61, 171, 3, 1, 184, 254,
+ 114, 171, 3, 1, 184, 75, 171, 3, 1, 184, 227, 49, 171, 3, 1, 220, 175,
+ 72, 171, 3, 1, 220, 175, 74, 171, 3, 1, 220, 175, 61, 171, 3, 1, 220,
+ 175, 254, 114, 171, 3, 1, 220, 175, 75, 171, 3, 1, 220, 175, 227, 49,
+ 171, 3, 1, 253, 83, 171, 3, 1, 226, 240, 171, 3, 1, 213, 183, 171, 3, 1,
+ 213, 35, 171, 3, 1, 242, 41, 171, 3, 1, 226, 86, 171, 3, 1, 251, 242,
+ 171, 3, 1, 217, 219, 171, 3, 1, 248, 28, 171, 3, 1, 250, 64, 171, 3, 1,
+ 235, 125, 171, 3, 1, 234, 195, 171, 3, 1, 243, 59, 171, 3, 1, 245, 159,
+ 171, 3, 1, 214, 227, 171, 3, 1, 245, 25, 171, 3, 1, 217, 147, 171, 3, 1,
+ 245, 45, 171, 3, 1, 212, 85, 171, 3, 1, 245, 40, 171, 3, 1, 212, 66, 171,
+ 3, 1, 245, 55, 171, 3, 1, 245, 131, 171, 3, 1, 245, 117, 171, 3, 1, 245,
+ 108, 171, 3, 1, 245, 96, 171, 3, 1, 227, 85, 171, 3, 1, 245, 5, 220, 249,
+ 1, 226, 84, 220, 249, 1, 216, 218, 220, 249, 1, 234, 100, 220, 249, 1,
+ 244, 116, 220, 249, 1, 217, 125, 220, 249, 1, 219, 242, 220, 249, 1, 218,
+ 214, 220, 249, 1, 249, 254, 220, 249, 1, 213, 37, 220, 249, 1, 240, 199,
+ 220, 249, 1, 251, 183, 220, 249, 1, 248, 40, 220, 249, 1, 243, 96, 220,
+ 249, 1, 214, 104, 220, 249, 1, 217, 129, 220, 249, 1, 212, 14, 220, 249,
+ 1, 231, 154, 220, 249, 1, 235, 52, 220, 249, 1, 213, 212, 220, 249, 1,
+ 242, 29, 220, 249, 1, 232, 195, 220, 249, 1, 231, 2, 220, 249, 1, 236,
+ 35, 220, 249, 1, 245, 158, 220, 249, 1, 253, 146, 220, 249, 1, 254, 152,
+ 220, 249, 1, 227, 62, 220, 249, 1, 213, 199, 220, 249, 1, 226, 254, 220,
+ 249, 1, 254, 114, 220, 249, 1, 223, 109, 220, 249, 1, 228, 50, 220, 249,
+ 1, 245, 173, 220, 249, 1, 254, 119, 220, 249, 1, 240, 104, 220, 249, 1,
+ 215, 134, 220, 249, 1, 227, 118, 220, 249, 1, 227, 42, 220, 249, 1, 227,
+ 84, 220, 249, 1, 253, 86, 220, 249, 1, 253, 189, 220, 249, 1, 227, 24,
+ 220, 249, 1, 254, 100, 220, 249, 1, 245, 49, 220, 249, 1, 253, 168, 220,
+ 249, 1, 245, 183, 220, 249, 1, 240, 110, 220, 249, 1, 213, 4, 227, 9, 1,
+ 254, 78, 227, 9, 1, 252, 107, 227, 9, 1, 218, 52, 227, 9, 1, 235, 139,
+ 227, 9, 1, 213, 153, 227, 9, 1, 234, 138, 227, 9, 1, 248, 27, 227, 9, 1,
+ 203, 227, 9, 1, 222, 202, 227, 9, 1, 220, 206, 227, 9, 1, 247, 232, 227,
+ 9, 1, 250, 148, 227, 9, 1, 243, 110, 227, 9, 1, 244, 164, 227, 9, 1, 224,
+ 230, 227, 9, 1, 235, 13, 227, 9, 1, 233, 152, 227, 9, 1, 231, 13, 227, 9,
+ 1, 228, 35, 227, 9, 1, 214, 14, 227, 9, 1, 159, 227, 9, 1, 186, 227, 9,
+ 1, 61, 227, 9, 1, 74, 227, 9, 1, 72, 227, 9, 1, 75, 227, 9, 1, 69, 227,
+ 9, 1, 254, 232, 227, 9, 1, 245, 165, 227, 9, 1, 227, 49, 227, 9, 21, 212,
+ 79, 227, 9, 21, 116, 227, 9, 21, 109, 227, 9, 21, 166, 227, 9, 21, 163,
+ 227, 9, 21, 180, 227, 9, 21, 189, 227, 9, 21, 198, 227, 9, 21, 195, 227,
+ 9, 21, 200, 249, 10, 4, 61, 249, 10, 4, 74, 249, 10, 4, 72, 249, 10, 4,
+ 75, 249, 10, 4, 69, 249, 10, 4, 235, 139, 249, 10, 4, 235, 71, 249, 10,
+ 4, 181, 249, 10, 4, 234, 188, 249, 10, 4, 234, 101, 249, 10, 4, 234, 37,
+ 249, 10, 4, 233, 238, 249, 10, 4, 233, 157, 249, 10, 4, 233, 82, 249, 10,
+ 4, 233, 13, 249, 10, 4, 232, 208, 249, 10, 4, 232, 156, 249, 10, 4, 188,
+ 249, 10, 4, 231, 156, 249, 10, 4, 231, 42, 249, 10, 4, 230, 231, 249, 10,
+ 4, 230, 172, 249, 10, 4, 205, 249, 10, 4, 229, 187, 249, 10, 4, 229, 64,
+ 249, 10, 4, 228, 185, 249, 10, 4, 228, 92, 249, 10, 4, 193, 249, 10, 4,
+ 226, 96, 249, 10, 4, 225, 240, 249, 10, 4, 225, 150, 249, 10, 4, 225, 35,
+ 249, 10, 4, 203, 249, 10, 4, 224, 21, 249, 10, 4, 223, 188, 249, 10, 4,
+ 223, 112, 249, 10, 4, 223, 51, 249, 10, 4, 222, 202, 249, 10, 4, 222,
+ 100, 249, 10, 4, 220, 117, 249, 10, 4, 219, 242, 249, 10, 4, 219, 27,
+ 249, 10, 4, 218, 52, 249, 10, 4, 217, 229, 249, 10, 4, 217, 71, 249, 10,
+ 4, 108, 249, 10, 4, 216, 82, 249, 10, 4, 214, 49, 249, 10, 4, 214, 6,
+ 249, 10, 4, 213, 235, 249, 10, 4, 213, 214, 249, 10, 4, 213, 153, 249,
+ 10, 4, 213, 150, 249, 10, 4, 212, 109, 249, 10, 4, 212, 16, 235, 253,
+ 253, 197, 1, 254, 76, 235, 253, 253, 197, 1, 251, 202, 235, 253, 253,
+ 197, 1, 242, 177, 235, 253, 253, 197, 1, 248, 133, 235, 253, 253, 197, 1,
+ 241, 222, 235, 253, 253, 197, 1, 214, 14, 235, 253, 253, 197, 1, 212, 90,
+ 235, 253, 253, 197, 1, 241, 180, 235, 253, 253, 197, 1, 217, 179, 235,
+ 253, 253, 197, 1, 212, 223, 235, 253, 253, 197, 1, 234, 230, 235, 253,
+ 253, 197, 1, 233, 117, 235, 253, 253, 197, 1, 231, 129, 235, 253, 253,
+ 197, 1, 228, 50, 235, 253, 253, 197, 1, 222, 164, 235, 253, 253, 197, 1,
+ 253, 78, 235, 253, 253, 197, 1, 226, 96, 235, 253, 253, 197, 1, 222, 193,
+ 235, 253, 253, 197, 1, 224, 179, 235, 253, 253, 197, 1, 223, 219, 235,
+ 253, 253, 197, 1, 220, 200, 235, 253, 253, 197, 1, 217, 243, 235, 253,
+ 253, 197, 222, 92, 52, 235, 253, 253, 197, 50, 116, 235, 253, 253, 197,
+ 50, 109, 235, 253, 253, 197, 50, 166, 235, 253, 253, 197, 50, 217, 200,
+ 235, 253, 253, 197, 50, 216, 38, 235, 253, 253, 197, 50, 122, 240, 200,
+ 235, 253, 253, 197, 50, 122, 217, 100, 235, 253, 253, 197, 50, 217, 201,
+ 217, 100, 225, 251, 1, 254, 74, 225, 251, 1, 251, 205, 225, 251, 1, 243,
+ 85, 225, 251, 1, 248, 7, 225, 251, 1, 241, 222, 225, 251, 1, 214, 21,
+ 225, 251, 1, 212, 103, 225, 251, 1, 241, 182, 225, 251, 1, 217, 183, 225,
+ 251, 1, 212, 224, 225, 251, 1, 234, 254, 225, 251, 1, 233, 123, 225, 251,
+ 1, 231, 129, 225, 251, 1, 228, 50, 225, 251, 1, 221, 64, 225, 251, 1,
+ 254, 103, 225, 251, 1, 226, 96, 225, 251, 1, 222, 194, 225, 251, 1, 224,
+ 184, 225, 251, 1, 223, 91, 225, 251, 1, 220, 200, 225, 251, 1, 217, 248,
+ 225, 251, 50, 116, 225, 251, 50, 217, 200, 225, 251, 50, 216, 38, 225,
+ 251, 50, 122, 240, 200, 225, 251, 50, 109, 225, 251, 50, 166, 225, 251,
+ 213, 196, 221, 57, 232, 119, 1, 61, 232, 119, 1, 253, 74, 232, 119, 1,
+ 243, 177, 232, 119, 1, 249, 3, 232, 119, 1, 74, 232, 119, 1, 215, 79,
+ 232, 119, 1, 72, 232, 119, 1, 213, 105, 232, 119, 1, 235, 27, 232, 119,
+ 1, 150, 232, 119, 1, 183, 232, 119, 1, 204, 232, 119, 1, 75, 232, 119, 1,
+ 149, 232, 119, 1, 219, 158, 232, 119, 1, 218, 99, 232, 119, 1, 69, 232,
+ 119, 1, 244, 230, 232, 119, 1, 224, 240, 232, 119, 1, 197, 232, 119, 1,
+ 216, 118, 232, 119, 1, 254, 32, 232, 119, 1, 245, 108, 232, 119, 1, 232,
+ 121, 232, 119, 1, 228, 199, 232, 119, 1, 250, 252, 232, 119, 216, 180,
+ 77, 234, 126, 1, 61, 234, 126, 30, 5, 72, 234, 126, 30, 5, 69, 234, 126,
+ 30, 5, 161, 149, 234, 126, 30, 5, 74, 234, 126, 30, 5, 75, 234, 126, 30,
+ 233, 47, 77, 234, 126, 5, 51, 223, 131, 55, 234, 126, 5, 253, 242, 234,
+ 126, 5, 214, 128, 234, 126, 1, 181, 234, 126, 1, 234, 138, 234, 126, 1,
+ 243, 110, 234, 126, 1, 242, 225, 234, 126, 1, 250, 219, 234, 126, 1, 250,
+ 92, 234, 126, 1, 235, 139, 234, 126, 1, 228, 23, 234, 126, 1, 216, 115,
+ 234, 126, 1, 216, 105, 234, 126, 1, 248, 86, 234, 126, 1, 248, 70, 234,
+ 126, 1, 228, 198, 234, 126, 1, 218, 52, 234, 126, 1, 217, 161, 234, 126,
+ 1, 248, 164, 234, 126, 1, 247, 232, 234, 126, 1, 205, 234, 126, 1, 193,
+ 234, 126, 1, 226, 23, 234, 126, 1, 252, 107, 234, 126, 1, 251, 195, 234,
+ 126, 1, 188, 234, 126, 1, 186, 234, 126, 1, 203, 234, 126, 1, 233, 157,
+ 234, 126, 1, 215, 1, 234, 126, 1, 221, 24, 234, 126, 1, 219, 157, 234,
+ 126, 1, 222, 202, 234, 126, 1, 212, 109, 234, 126, 1, 159, 234, 126, 1,
+ 234, 55, 234, 126, 1, 216, 87, 234, 126, 5, 252, 60, 49, 234, 126, 5,
+ 250, 154, 234, 126, 5, 62, 55, 234, 126, 214, 133, 234, 126, 21, 116,
+ 234, 126, 21, 109, 234, 126, 21, 166, 234, 126, 21, 163, 234, 126, 50,
+ 217, 200, 234, 126, 50, 216, 38, 234, 126, 50, 122, 240, 200, 234, 126,
+ 50, 122, 217, 100, 234, 126, 225, 27, 247, 74, 234, 126, 225, 27, 3, 249,
+ 228, 234, 126, 225, 27, 249, 228, 234, 126, 225, 27, 249, 77, 134, 234,
+ 126, 225, 27, 231, 243, 234, 126, 225, 27, 232, 170, 234, 126, 225, 27,
+ 248, 123, 234, 126, 225, 27, 51, 248, 123, 234, 126, 225, 27, 232, 236,
+ 53, 219, 215, 253, 208, 1, 241, 222, 53, 219, 215, 253, 208, 1, 233, 117,
+ 53, 219, 215, 253, 208, 1, 241, 180, 53, 219, 215, 253, 208, 1, 231, 129,
+ 53, 219, 215, 253, 208, 1, 224, 179, 53, 219, 215, 253, 208, 1, 214, 14,
+ 53, 219, 215, 253, 208, 1, 220, 200, 53, 219, 215, 253, 208, 1, 223, 219,
+ 53, 219, 215, 253, 208, 1, 251, 202, 53, 219, 215, 253, 208, 1, 217, 243,
+ 53, 219, 215, 253, 208, 1, 222, 142, 53, 219, 215, 253, 208, 1, 234, 230,
+ 53, 219, 215, 253, 208, 1, 228, 50, 53, 219, 215, 253, 208, 1, 234, 122,
+ 53, 219, 215, 253, 208, 1, 222, 193, 53, 219, 215, 253, 208, 1, 222, 164,
+ 53, 219, 215, 253, 208, 1, 244, 123, 53, 219, 215, 253, 208, 1, 254, 78,
+ 53, 219, 215, 253, 208, 1, 253, 77, 53, 219, 215, 253, 208, 1, 247, 230,
+ 53, 219, 215, 253, 208, 1, 242, 177, 53, 219, 215, 253, 208, 1, 248, 133,
+ 53, 219, 215, 253, 208, 1, 242, 214, 53, 219, 215, 253, 208, 1, 217, 179,
+ 53, 219, 215, 253, 208, 1, 212, 89, 53, 219, 215, 253, 208, 1, 247, 227,
+ 53, 219, 215, 253, 208, 1, 212, 223, 53, 219, 215, 253, 208, 1, 217, 150,
+ 53, 219, 215, 253, 208, 1, 217, 131, 53, 219, 215, 253, 208, 50, 116, 53,
+ 219, 215, 253, 208, 50, 244, 83, 53, 219, 215, 253, 208, 128, 235, 235,
+ 253, 88, 1, 61, 253, 88, 1, 254, 232, 253, 88, 1, 253, 240, 253, 88, 1,
+ 254, 191, 253, 88, 1, 254, 32, 253, 88, 1, 254, 192, 253, 88, 1, 254,
+ 148, 253, 88, 1, 254, 144, 253, 88, 1, 74, 253, 88, 1, 245, 165, 253, 88,
+ 1, 75, 253, 88, 1, 227, 49, 253, 88, 1, 72, 253, 88, 1, 236, 28, 253, 88,
+ 1, 69, 253, 88, 1, 215, 92, 253, 88, 1, 234, 188, 253, 88, 1, 213, 150,
+ 253, 88, 1, 213, 116, 253, 88, 1, 213, 125, 253, 88, 1, 243, 38, 253, 88,
+ 1, 243, 0, 253, 88, 1, 242, 212, 253, 88, 1, 250, 124, 253, 88, 1, 235,
+ 127, 253, 88, 1, 217, 229, 253, 88, 1, 217, 148, 253, 88, 1, 248, 41,
+ 253, 88, 1, 247, 225, 253, 88, 1, 216, 112, 253, 88, 1, 226, 96, 253, 88,
+ 1, 244, 123, 253, 88, 1, 251, 251, 253, 88, 1, 251, 192, 253, 88, 1, 229,
+ 148, 253, 88, 1, 229, 70, 253, 88, 1, 229, 71, 253, 88, 1, 229, 187, 253,
+ 88, 1, 228, 17, 253, 88, 1, 228, 197, 253, 88, 1, 231, 156, 253, 88, 1,
+ 241, 102, 253, 88, 1, 212, 159, 253, 88, 1, 213, 38, 253, 88, 1, 214,
+ 232, 253, 88, 1, 224, 21, 253, 88, 1, 233, 82, 253, 88, 1, 222, 100, 253,
+ 88, 1, 212, 87, 253, 88, 1, 220, 243, 253, 88, 1, 212, 67, 253, 88, 1,
+ 220, 124, 253, 88, 1, 219, 129, 253, 88, 1, 241, 222, 253, 88, 254, 181,
+ 77, 217, 32, 117, 176, 110, 122, 62, 225, 26, 3, 117, 176, 110, 122, 62,
+ 225, 26, 233, 108, 117, 176, 110, 122, 62, 225, 26, 233, 108, 122, 62,
+ 110, 117, 176, 225, 26, 233, 108, 117, 223, 129, 110, 122, 223, 131, 225,
+ 26, 233, 108, 122, 223, 131, 110, 117, 223, 129, 225, 26, 235, 215, 226,
+ 126, 1, 254, 76, 235, 215, 226, 126, 1, 251, 202, 235, 215, 226, 126, 1,
+ 242, 177, 235, 215, 226, 126, 1, 248, 133, 235, 215, 226, 126, 1, 241,
+ 222, 235, 215, 226, 126, 1, 214, 14, 235, 215, 226, 126, 1, 212, 90, 235,
+ 215, 226, 126, 1, 241, 180, 235, 215, 226, 126, 1, 217, 179, 235, 215,
+ 226, 126, 1, 212, 223, 235, 215, 226, 126, 1, 234, 230, 235, 215, 226,
+ 126, 1, 233, 117, 235, 215, 226, 126, 1, 231, 129, 235, 215, 226, 126, 1,
+ 228, 50, 235, 215, 226, 126, 1, 222, 164, 235, 215, 226, 126, 1, 253, 78,
+ 235, 215, 226, 126, 1, 226, 96, 235, 215, 226, 126, 1, 222, 193, 235,
+ 215, 226, 126, 1, 224, 179, 235, 215, 226, 126, 1, 223, 219, 235, 215,
+ 226, 126, 1, 220, 200, 235, 215, 226, 126, 1, 217, 243, 235, 215, 226,
+ 126, 50, 116, 235, 215, 226, 126, 50, 109, 235, 215, 226, 126, 50, 166,
+ 235, 215, 226, 126, 50, 163, 235, 215, 226, 126, 50, 217, 200, 235, 215,
+ 226, 126, 50, 216, 38, 235, 215, 226, 126, 50, 122, 240, 200, 235, 215,
+ 226, 126, 50, 122, 217, 100, 235, 215, 226, 198, 1, 254, 76, 235, 215,
+ 226, 198, 1, 251, 202, 235, 215, 226, 198, 1, 242, 177, 235, 215, 226,
+ 198, 1, 248, 133, 235, 215, 226, 198, 1, 241, 222, 235, 215, 226, 198, 1,
+ 214, 13, 235, 215, 226, 198, 1, 212, 90, 235, 215, 226, 198, 1, 241, 180,
+ 235, 215, 226, 198, 1, 217, 179, 235, 215, 226, 198, 1, 212, 223, 235,
+ 215, 226, 198, 1, 234, 230, 235, 215, 226, 198, 1, 233, 117, 235, 215,
+ 226, 198, 1, 231, 128, 235, 215, 226, 198, 1, 228, 50, 235, 215, 226,
+ 198, 1, 222, 164, 235, 215, 226, 198, 1, 226, 96, 235, 215, 226, 198, 1,
+ 222, 193, 235, 215, 226, 198, 1, 220, 200, 235, 215, 226, 198, 1, 217,
+ 243, 235, 215, 226, 198, 50, 116, 235, 215, 226, 198, 50, 109, 235, 215,
+ 226, 198, 50, 166, 235, 215, 226, 198, 50, 163, 235, 215, 226, 198, 50,
+ 217, 200, 235, 215, 226, 198, 50, 216, 38, 235, 215, 226, 198, 50, 122,
+ 240, 200, 235, 215, 226, 198, 50, 122, 217, 100, 53, 185, 1, 227, 16, 61,
+ 53, 185, 1, 213, 28, 61, 53, 185, 1, 213, 28, 254, 148, 53, 185, 1, 227,
+ 16, 72, 53, 185, 1, 213, 28, 72, 53, 185, 1, 213, 28, 74, 53, 185, 1,
+ 227, 16, 75, 53, 185, 1, 227, 16, 227, 99, 53, 185, 1, 213, 28, 227, 99,
+ 53, 185, 1, 227, 16, 254, 185, 53, 185, 1, 213, 28, 254, 185, 53, 185, 1,
+ 227, 16, 254, 147, 53, 185, 1, 213, 28, 254, 147, 53, 185, 1, 227, 16,
+ 254, 121, 53, 185, 1, 213, 28, 254, 121, 53, 185, 1, 227, 16, 254, 142,
+ 53, 185, 1, 213, 28, 254, 142, 53, 185, 1, 227, 16, 254, 160, 53, 185, 1,
+ 213, 28, 254, 160, 53, 185, 1, 227, 16, 254, 146, 53, 185, 1, 227, 16,
+ 244, 236, 53, 185, 1, 213, 28, 244, 236, 53, 185, 1, 227, 16, 253, 83,
+ 53, 185, 1, 213, 28, 253, 83, 53, 185, 1, 227, 16, 254, 129, 53, 185, 1,
+ 213, 28, 254, 129, 53, 185, 1, 227, 16, 254, 140, 53, 185, 1, 213, 28,
+ 254, 140, 53, 185, 1, 227, 16, 227, 98, 53, 185, 1, 213, 28, 227, 98, 53,
+ 185, 1, 227, 16, 254, 86, 53, 185, 1, 213, 28, 254, 86, 53, 185, 1, 227,
+ 16, 254, 139, 53, 185, 1, 227, 16, 245, 119, 53, 185, 1, 227, 16, 245,
+ 117, 53, 185, 1, 227, 16, 254, 32, 53, 185, 1, 227, 16, 254, 137, 53,
+ 185, 1, 213, 28, 254, 137, 53, 185, 1, 227, 16, 245, 90, 53, 185, 1, 213,
+ 28, 245, 90, 53, 185, 1, 227, 16, 245, 105, 53, 185, 1, 213, 28, 245,
+ 105, 53, 185, 1, 227, 16, 245, 77, 53, 185, 1, 213, 28, 245, 77, 53, 185,
+ 1, 213, 28, 254, 24, 53, 185, 1, 227, 16, 245, 96, 53, 185, 1, 213, 28,
+ 254, 136, 53, 185, 1, 227, 16, 245, 70, 53, 185, 1, 227, 16, 227, 41, 53,
+ 185, 1, 227, 16, 240, 106, 53, 185, 1, 227, 16, 245, 171, 53, 185, 1,
+ 213, 28, 245, 171, 53, 185, 1, 227, 16, 253, 215, 53, 185, 1, 213, 28,
+ 253, 215, 53, 185, 1, 227, 16, 235, 179, 53, 185, 1, 213, 28, 235, 179,
+ 53, 185, 1, 227, 16, 227, 25, 53, 185, 1, 213, 28, 227, 25, 53, 185, 1,
+ 227, 16, 253, 211, 53, 185, 1, 213, 28, 253, 211, 53, 185, 1, 227, 16,
+ 254, 135, 53, 185, 1, 227, 16, 253, 152, 53, 185, 1, 227, 16, 254, 133,
+ 53, 185, 1, 227, 16, 253, 146, 53, 185, 1, 213, 28, 253, 146, 53, 185, 1,
+ 227, 16, 245, 40, 53, 185, 1, 213, 28, 245, 40, 53, 185, 1, 227, 16, 253,
+ 122, 53, 185, 1, 213, 28, 253, 122, 53, 185, 1, 227, 16, 254, 130, 53,
+ 185, 1, 213, 28, 254, 130, 53, 185, 1, 227, 16, 227, 8, 53, 185, 1, 227,
+ 16, 252, 45, 223, 38, 21, 116, 223, 38, 21, 109, 223, 38, 21, 166, 223,
+ 38, 21, 163, 223, 38, 21, 180, 223, 38, 21, 189, 223, 38, 21, 198, 223,
+ 38, 21, 195, 223, 38, 21, 200, 223, 38, 50, 217, 200, 223, 38, 50, 216,
+ 38, 223, 38, 50, 217, 115, 223, 38, 50, 243, 240, 223, 38, 50, 244, 83,
+ 223, 38, 50, 220, 39, 223, 38, 50, 221, 37, 223, 38, 50, 245, 141, 223,
+ 38, 50, 229, 26, 223, 38, 50, 122, 240, 200, 223, 38, 50, 117, 240, 200,
+ 223, 38, 50, 133, 240, 200, 223, 38, 50, 243, 237, 240, 200, 223, 38, 50,
+ 244, 50, 240, 200, 223, 38, 50, 220, 53, 240, 200, 223, 38, 50, 221, 43,
+ 240, 200, 223, 38, 50, 245, 150, 240, 200, 223, 38, 50, 229, 31, 240,
+ 200, 223, 38, 243, 228, 122, 242, 9, 223, 38, 243, 228, 122, 224, 166,
+ 223, 38, 243, 228, 122, 217, 121, 223, 38, 243, 228, 117, 217, 119, 112,
+ 5, 250, 187, 112, 5, 253, 242, 112, 5, 214, 128, 112, 5, 235, 104, 112,
+ 5, 215, 132, 112, 1, 61, 112, 1, 254, 232, 112, 1, 72, 112, 1, 236, 28,
+ 112, 1, 69, 112, 1, 215, 92, 112, 1, 161, 149, 112, 1, 161, 223, 82, 112,
+ 1, 161, 150, 112, 1, 161, 232, 214, 112, 1, 74, 112, 1, 254, 108, 112, 1,
+ 75, 112, 1, 253, 108, 112, 1, 181, 112, 1, 234, 138, 112, 1, 243, 110,
+ 112, 1, 242, 225, 112, 1, 229, 159, 112, 1, 250, 219, 112, 1, 250, 92,
+ 112, 1, 235, 139, 112, 1, 235, 115, 112, 1, 228, 23, 112, 1, 216, 115,
+ 112, 1, 216, 105, 112, 1, 248, 86, 112, 1, 248, 70, 112, 1, 228, 198,
+ 112, 1, 218, 52, 112, 1, 217, 161, 112, 1, 248, 164, 112, 1, 247, 232,
+ 112, 1, 205, 112, 1, 193, 112, 1, 226, 23, 112, 1, 252, 107, 112, 1, 251,
+ 195, 112, 1, 188, 112, 1, 186, 112, 1, 203, 112, 1, 233, 157, 112, 1,
+ 215, 1, 112, 1, 221, 24, 112, 1, 219, 157, 112, 1, 222, 202, 112, 1, 159,
+ 112, 1, 232, 213, 112, 1, 53, 178, 232, 212, 112, 1, 53, 178, 223, 81,
+ 112, 1, 53, 178, 228, 189, 112, 30, 5, 254, 232, 112, 30, 5, 251, 193,
+ 254, 232, 112, 30, 5, 72, 112, 30, 5, 236, 28, 112, 30, 5, 69, 112, 30,
+ 5, 215, 92, 112, 30, 5, 161, 149, 112, 30, 5, 161, 223, 82, 112, 30, 5,
+ 161, 150, 112, 30, 5, 161, 232, 214, 112, 30, 5, 74, 112, 30, 5, 254,
+ 108, 112, 30, 5, 75, 112, 30, 5, 253, 108, 112, 214, 133, 112, 248, 123,
+ 112, 51, 248, 123, 112, 225, 27, 247, 74, 112, 225, 27, 51, 247, 74, 112,
+ 225, 27, 232, 242, 112, 225, 27, 249, 77, 134, 112, 225, 27, 232, 170,
+ 112, 50, 116, 112, 50, 109, 112, 50, 166, 112, 50, 163, 112, 50, 180,
+ 112, 50, 189, 112, 50, 198, 112, 50, 195, 112, 50, 200, 112, 50, 217,
+ 200, 112, 50, 216, 38, 112, 50, 217, 115, 112, 50, 243, 240, 112, 50,
+ 244, 83, 112, 50, 220, 39, 112, 50, 221, 37, 112, 50, 245, 141, 112, 50,
+ 229, 26, 112, 50, 122, 240, 200, 112, 50, 122, 217, 100, 112, 21, 212,
+ 79, 112, 21, 116, 112, 21, 109, 112, 21, 166, 112, 21, 163, 112, 21, 180,
+ 112, 21, 189, 112, 21, 198, 112, 21, 195, 112, 21, 200, 208, 5, 250, 187,
+ 208, 5, 253, 242, 208, 5, 214, 128, 208, 1, 61, 208, 1, 254, 232, 208, 1,
+ 72, 208, 1, 236, 28, 208, 1, 69, 208, 1, 215, 92, 208, 1, 74, 208, 1,
+ 254, 108, 208, 1, 75, 208, 1, 253, 108, 208, 1, 181, 208, 1, 234, 138,
+ 208, 1, 243, 110, 208, 1, 242, 225, 208, 1, 229, 159, 208, 1, 250, 219,
+ 208, 1, 250, 92, 208, 1, 235, 139, 208, 1, 235, 115, 208, 1, 228, 23,
+ 208, 1, 216, 115, 208, 1, 216, 105, 208, 1, 248, 86, 208, 1, 248, 75,
+ 208, 1, 248, 70, 208, 1, 223, 192, 208, 1, 228, 198, 208, 1, 218, 52,
+ 208, 1, 217, 161, 208, 1, 248, 164, 208, 1, 247, 232, 208, 1, 205, 208,
+ 1, 193, 208, 1, 226, 23, 208, 1, 252, 107, 208, 1, 251, 195, 208, 1, 188,
+ 208, 1, 186, 208, 1, 203, 208, 1, 233, 157, 208, 1, 215, 1, 208, 1, 221,
+ 24, 208, 1, 219, 157, 208, 1, 222, 202, 208, 1, 159, 208, 30, 5, 254,
+ 232, 208, 30, 5, 72, 208, 30, 5, 236, 28, 208, 30, 5, 69, 208, 30, 5,
+ 215, 92, 208, 30, 5, 74, 208, 30, 5, 254, 108, 208, 30, 5, 75, 208, 30,
+ 5, 253, 108, 208, 5, 214, 133, 208, 5, 228, 60, 208, 254, 181, 52, 208,
+ 245, 80, 52, 208, 50, 52, 208, 222, 92, 77, 208, 51, 222, 92, 77, 208,
+ 248, 123, 208, 51, 248, 123, 15, 5, 61, 15, 5, 118, 29, 61, 15, 5, 118,
+ 29, 252, 94, 15, 5, 118, 29, 243, 81, 217, 192, 15, 5, 118, 29, 159, 15,
+ 5, 118, 29, 236, 30, 15, 5, 118, 29, 233, 139, 242, 75, 15, 5, 118, 29,
+ 230, 131, 15, 5, 118, 29, 222, 190, 15, 5, 254, 234, 15, 5, 254, 185, 15,
+ 5, 254, 186, 29, 253, 144, 15, 5, 254, 186, 29, 246, 22, 242, 75, 15, 5,
+ 254, 186, 29, 243, 94, 15, 5, 254, 186, 29, 243, 81, 217, 192, 15, 5,
+ 254, 186, 29, 159, 15, 5, 254, 186, 29, 236, 31, 242, 75, 15, 5, 254,
+ 186, 29, 236, 4, 15, 5, 254, 186, 29, 233, 140, 15, 5, 254, 186, 29, 220,
+ 228, 15, 5, 254, 186, 29, 111, 94, 111, 94, 69, 15, 5, 254, 186, 242, 75,
+ 15, 5, 254, 183, 15, 5, 254, 184, 29, 252, 79, 15, 5, 254, 184, 29, 243,
+ 81, 217, 192, 15, 5, 254, 184, 29, 231, 157, 94, 245, 108, 15, 5, 254,
+ 184, 29, 221, 22, 15, 5, 254, 184, 29, 218, 22, 15, 5, 254, 160, 15, 5,
+ 254, 94, 15, 5, 254, 95, 29, 245, 50, 15, 5, 254, 95, 29, 220, 190, 94,
+ 242, 166, 15, 5, 254, 86, 15, 5, 254, 87, 29, 254, 86, 15, 5, 254, 87,
+ 29, 247, 168, 15, 5, 254, 87, 29, 242, 166, 15, 5, 254, 87, 29, 159, 15,
+ 5, 254, 87, 29, 235, 3, 15, 5, 254, 87, 29, 234, 101, 15, 5, 254, 87, 29,
+ 220, 243, 15, 5, 254, 87, 29, 215, 100, 15, 5, 254, 83, 15, 5, 254, 76,
+ 15, 5, 254, 41, 15, 5, 254, 42, 29, 220, 243, 15, 5, 254, 32, 15, 5, 254,
+ 33, 110, 254, 32, 15, 5, 254, 33, 133, 217, 38, 15, 5, 254, 33, 94, 230,
+ 35, 227, 30, 254, 33, 94, 230, 34, 15, 5, 254, 33, 94, 230, 35, 219, 165,
+ 15, 5, 254, 5, 15, 5, 253, 235, 15, 5, 253, 205, 15, 5, 253, 206, 29,
+ 233, 217, 15, 5, 253, 179, 15, 5, 253, 151, 15, 5, 253, 146, 15, 5, 253,
+ 147, 212, 33, 217, 192, 15, 5, 253, 147, 235, 7, 217, 192, 15, 5, 253,
+ 147, 110, 253, 147, 216, 78, 110, 216, 78, 216, 78, 110, 216, 78, 226,
+ 149, 15, 5, 253, 147, 110, 253, 147, 110, 253, 146, 15, 5, 253, 147, 110,
+ 253, 147, 110, 253, 147, 249, 65, 253, 147, 110, 253, 147, 110, 253, 146,
+ 15, 5, 253, 144, 15, 5, 253, 141, 15, 5, 252, 107, 15, 5, 252, 94, 15, 5,
+ 252, 89, 15, 5, 252, 86, 15, 5, 252, 80, 15, 5, 252, 81, 110, 252, 80,
+ 15, 5, 252, 79, 15, 5, 134, 15, 5, 252, 59, 15, 5, 251, 184, 15, 5, 251,
+ 185, 29, 61, 15, 5, 251, 185, 29, 243, 72, 15, 5, 251, 185, 29, 236, 31,
+ 242, 75, 15, 5, 251, 54, 15, 5, 251, 55, 110, 251, 55, 254, 185, 15, 5,
+ 251, 55, 110, 251, 55, 215, 160, 15, 5, 251, 55, 249, 65, 251, 54, 15, 5,
+ 251, 38, 15, 5, 251, 39, 110, 251, 38, 15, 5, 251, 27, 15, 5, 251, 26,
+ 15, 5, 248, 164, 15, 5, 248, 155, 15, 5, 248, 156, 234, 75, 29, 118, 94,
+ 231, 210, 15, 5, 248, 156, 234, 75, 29, 254, 41, 15, 5, 248, 156, 234,
+ 75, 29, 252, 79, 15, 5, 248, 156, 234, 75, 29, 251, 184, 15, 5, 248, 156,
+ 234, 75, 29, 243, 110, 15, 5, 248, 156, 234, 75, 29, 243, 111, 94, 231,
+ 210, 15, 5, 248, 156, 234, 75, 29, 242, 190, 15, 5, 248, 156, 234, 75,
+ 29, 242, 173, 15, 5, 248, 156, 234, 75, 29, 242, 84, 15, 5, 248, 156,
+ 234, 75, 29, 159, 15, 5, 248, 156, 234, 75, 29, 235, 177, 15, 5, 248,
+ 156, 234, 75, 29, 235, 178, 94, 232, 156, 15, 5, 248, 156, 234, 75, 29,
+ 234, 247, 15, 5, 248, 156, 234, 75, 29, 233, 157, 15, 5, 248, 156, 234,
+ 75, 29, 232, 156, 15, 5, 248, 156, 234, 75, 29, 232, 157, 94, 231, 209,
+ 15, 5, 248, 156, 234, 75, 29, 232, 142, 15, 5, 248, 156, 234, 75, 29,
+ 229, 187, 15, 5, 248, 156, 234, 75, 29, 226, 150, 94, 226, 149, 15, 5,
+ 248, 156, 234, 75, 29, 220, 117, 15, 5, 248, 156, 234, 75, 29, 218, 22,
+ 15, 5, 248, 156, 234, 75, 29, 215, 198, 94, 242, 173, 15, 5, 248, 156,
+ 234, 75, 29, 215, 100, 15, 5, 248, 132, 15, 5, 248, 111, 15, 5, 248, 110,
+ 15, 5, 248, 109, 15, 5, 247, 211, 15, 5, 247, 194, 15, 5, 247, 169, 15,
+ 5, 247, 170, 29, 220, 243, 15, 5, 247, 168, 15, 5, 247, 158, 15, 5, 247,
+ 159, 234, 213, 111, 242, 76, 247, 139, 15, 5, 247, 139, 15, 5, 246, 33,
+ 15, 5, 246, 34, 110, 246, 33, 15, 5, 246, 34, 242, 75, 15, 5, 246, 34,
+ 220, 225, 15, 5, 246, 31, 15, 5, 246, 32, 29, 245, 37, 15, 5, 246, 30,
+ 15, 5, 246, 29, 15, 5, 246, 28, 15, 5, 246, 27, 15, 5, 246, 23, 15, 5,
+ 246, 21, 15, 5, 246, 22, 242, 75, 15, 5, 246, 22, 242, 76, 242, 75, 15,
+ 5, 246, 20, 15, 5, 246, 13, 15, 5, 74, 15, 5, 191, 29, 226, 149, 15, 5,
+ 191, 110, 191, 228, 51, 110, 228, 50, 15, 5, 245, 190, 15, 5, 245, 191,
+ 29, 118, 94, 242, 30, 94, 248, 164, 15, 5, 245, 191, 29, 243, 72, 15, 5,
+ 245, 191, 29, 231, 42, 15, 5, 245, 191, 29, 222, 179, 15, 5, 245, 191,
+ 29, 220, 243, 15, 5, 245, 191, 29, 69, 15, 5, 245, 167, 15, 5, 245, 157,
+ 15, 5, 245, 131, 15, 5, 245, 108, 15, 5, 245, 109, 29, 243, 80, 15, 5,
+ 245, 109, 29, 243, 81, 217, 192, 15, 5, 245, 109, 29, 231, 156, 15, 5,
+ 245, 109, 249, 65, 245, 108, 15, 5, 245, 109, 227, 30, 245, 108, 15, 5,
+ 245, 109, 219, 165, 15, 5, 245, 52, 15, 5, 245, 50, 15, 5, 245, 37, 15,
+ 5, 244, 234, 15, 5, 244, 235, 29, 61, 15, 5, 244, 235, 29, 118, 94, 233,
+ 128, 15, 5, 244, 235, 29, 118, 94, 233, 129, 29, 233, 128, 15, 5, 244,
+ 235, 29, 254, 32, 15, 5, 244, 235, 29, 252, 94, 15, 5, 244, 235, 29, 246,
+ 22, 242, 75, 15, 5, 244, 235, 29, 246, 22, 242, 76, 242, 75, 15, 5, 244,
+ 235, 29, 159, 15, 5, 244, 235, 29, 242, 30, 242, 75, 15, 5, 244, 235, 29,
+ 236, 31, 242, 75, 15, 5, 244, 235, 29, 234, 212, 15, 5, 244, 235, 29,
+ 234, 213, 219, 165, 15, 5, 244, 235, 29, 233, 236, 15, 5, 244, 235, 29,
+ 233, 157, 15, 5, 244, 235, 29, 233, 129, 29, 233, 128, 15, 5, 244, 235,
+ 29, 233, 13, 15, 5, 244, 235, 29, 232, 156, 15, 5, 244, 235, 29, 215,
+ 197, 15, 5, 244, 235, 29, 215, 188, 15, 5, 243, 110, 15, 5, 243, 111,
+ 242, 75, 15, 5, 243, 108, 15, 5, 243, 109, 29, 118, 94, 248, 165, 94,
+ 159, 15, 5, 243, 109, 29, 118, 94, 159, 15, 5, 243, 109, 29, 118, 94,
+ 236, 30, 15, 5, 243, 109, 29, 254, 184, 217, 193, 94, 218, 41, 15, 5,
+ 243, 109, 29, 254, 32, 15, 5, 243, 109, 29, 253, 146, 15, 5, 243, 109,
+ 29, 253, 145, 94, 243, 94, 15, 5, 243, 109, 29, 252, 94, 15, 5, 243, 109,
+ 29, 252, 60, 94, 203, 15, 5, 243, 109, 29, 251, 27, 15, 5, 243, 109, 29,
+ 251, 28, 94, 203, 15, 5, 243, 109, 29, 248, 164, 15, 5, 243, 109, 29,
+ 247, 211, 15, 5, 243, 109, 29, 247, 170, 29, 220, 243, 15, 5, 243, 109,
+ 29, 246, 31, 15, 5, 243, 109, 29, 245, 131, 15, 5, 243, 109, 29, 245,
+ 132, 94, 233, 157, 15, 5, 243, 109, 29, 245, 108, 15, 5, 243, 109, 29,
+ 245, 109, 29, 243, 81, 217, 192, 15, 5, 243, 109, 29, 243, 81, 217, 192,
+ 15, 5, 243, 109, 29, 243, 72, 15, 5, 243, 109, 29, 242, 190, 15, 5, 243,
+ 109, 29, 242, 188, 15, 5, 243, 109, 29, 242, 189, 94, 61, 15, 5, 243,
+ 109, 29, 242, 174, 94, 219, 27, 15, 5, 243, 109, 29, 242, 30, 94, 232,
+ 157, 94, 245, 37, 15, 5, 243, 109, 29, 242, 12, 15, 5, 243, 109, 29, 242,
+ 13, 94, 233, 157, 15, 5, 243, 109, 29, 241, 166, 94, 233, 13, 15, 5, 243,
+ 109, 29, 240, 208, 15, 5, 243, 109, 29, 236, 31, 242, 75, 15, 5, 243,
+ 109, 29, 235, 164, 94, 240, 213, 94, 253, 146, 15, 5, 243, 109, 29, 234,
+ 247, 15, 5, 243, 109, 29, 234, 212, 15, 5, 243, 109, 29, 234, 98, 15, 5,
+ 243, 109, 29, 234, 99, 94, 233, 128, 15, 5, 243, 109, 29, 233, 237, 94,
+ 254, 32, 15, 5, 243, 109, 29, 233, 157, 15, 5, 243, 109, 29, 231, 157,
+ 94, 245, 108, 15, 5, 243, 109, 29, 231, 42, 15, 5, 243, 109, 29, 228, 50,
+ 15, 5, 243, 109, 29, 228, 51, 110, 228, 50, 15, 5, 243, 109, 29, 193, 15,
+ 5, 243, 109, 29, 222, 179, 15, 5, 243, 109, 29, 222, 147, 15, 5, 243,
+ 109, 29, 220, 243, 15, 5, 243, 109, 29, 220, 244, 94, 216, 62, 15, 5,
+ 243, 109, 29, 220, 210, 15, 5, 243, 109, 29, 218, 244, 15, 5, 243, 109,
+ 29, 218, 22, 15, 5, 243, 109, 29, 69, 15, 5, 243, 109, 29, 215, 188, 15,
+ 5, 243, 109, 29, 215, 189, 94, 246, 33, 15, 5, 243, 109, 110, 243, 108,
+ 15, 5, 243, 103, 15, 5, 243, 104, 249, 65, 243, 103, 15, 5, 243, 101, 15,
+ 5, 243, 102, 110, 243, 102, 243, 73, 110, 243, 72, 15, 5, 243, 94, 15, 5,
+ 243, 95, 243, 102, 110, 243, 102, 243, 73, 110, 243, 72, 15, 5, 243, 93,
+ 15, 5, 243, 91, 15, 5, 243, 82, 15, 5, 243, 80, 15, 5, 243, 81, 217, 192,
+ 15, 5, 243, 81, 110, 243, 80, 15, 5, 243, 81, 249, 65, 243, 80, 15, 5,
+ 243, 72, 15, 5, 243, 71, 15, 5, 243, 66, 15, 5, 243, 12, 15, 5, 243, 13,
+ 29, 233, 217, 15, 5, 242, 190, 15, 5, 242, 191, 29, 74, 15, 5, 242, 191,
+ 29, 69, 15, 5, 242, 191, 249, 65, 242, 190, 15, 5, 242, 188, 15, 5, 242,
+ 189, 110, 242, 188, 15, 5, 242, 189, 249, 65, 242, 188, 15, 5, 242, 185,
+ 15, 5, 242, 173, 15, 5, 242, 174, 242, 75, 15, 5, 242, 171, 15, 5, 242,
+ 172, 29, 118, 94, 236, 30, 15, 5, 242, 172, 29, 243, 81, 217, 192, 15, 5,
+ 242, 172, 29, 236, 30, 15, 5, 242, 172, 29, 232, 157, 94, 236, 30, 15, 5,
+ 242, 172, 29, 193, 15, 5, 242, 168, 15, 5, 242, 166, 15, 5, 242, 167,
+ 249, 65, 242, 166, 15, 5, 242, 167, 29, 252, 94, 15, 5, 242, 167, 29,
+ 218, 22, 15, 5, 242, 167, 217, 192, 15, 5, 242, 92, 15, 5, 242, 93, 249,
+ 65, 242, 92, 15, 5, 242, 90, 15, 5, 242, 91, 29, 234, 247, 15, 5, 242,
+ 91, 29, 234, 248, 29, 236, 31, 242, 75, 15, 5, 242, 91, 29, 228, 50, 15,
+ 5, 242, 91, 29, 222, 180, 94, 216, 77, 15, 5, 242, 91, 242, 75, 15, 5,
+ 242, 84, 15, 5, 242, 85, 29, 118, 94, 233, 217, 15, 5, 242, 85, 29, 233,
+ 217, 15, 5, 242, 85, 110, 242, 85, 232, 149, 15, 5, 242, 79, 15, 5, 242,
+ 77, 15, 5, 242, 78, 29, 220, 243, 15, 5, 242, 69, 15, 5, 242, 68, 15, 5,
+ 242, 65, 15, 5, 242, 64, 15, 5, 159, 15, 5, 242, 30, 217, 192, 15, 5,
+ 242, 30, 242, 75, 15, 5, 242, 12, 15, 5, 241, 165, 15, 5, 241, 166, 29,
+ 253, 146, 15, 5, 241, 166, 29, 253, 144, 15, 5, 241, 166, 29, 252, 94,
+ 15, 5, 241, 166, 29, 247, 139, 15, 5, 241, 166, 29, 243, 101, 15, 5, 241,
+ 166, 29, 234, 90, 15, 5, 241, 166, 29, 228, 50, 15, 5, 241, 166, 29, 220,
+ 243, 15, 5, 241, 166, 29, 69, 15, 5, 240, 212, 15, 5, 240, 208, 15, 5,
+ 240, 209, 29, 254, 32, 15, 5, 240, 209, 29, 242, 12, 15, 5, 240, 209, 29,
+ 234, 212, 15, 5, 240, 209, 29, 232, 226, 15, 5, 240, 209, 29, 215, 188,
+ 15, 5, 240, 205, 15, 5, 72, 15, 5, 240, 146, 61, 15, 5, 240, 108, 15, 5,
+ 236, 58, 15, 5, 236, 59, 110, 236, 59, 251, 27, 15, 5, 236, 59, 110, 236,
+ 59, 219, 165, 15, 5, 236, 33, 15, 5, 236, 30, 15, 5, 236, 31, 247, 194,
+ 15, 5, 236, 31, 223, 188, 15, 5, 236, 31, 110, 236, 31, 220, 194, 110,
+ 220, 194, 215, 189, 110, 215, 188, 15, 5, 236, 31, 242, 75, 15, 5, 236,
+ 22, 15, 5, 236, 23, 29, 243, 81, 217, 192, 15, 5, 236, 21, 15, 5, 236,
+ 11, 15, 5, 236, 12, 29, 218, 22, 15, 5, 236, 12, 249, 65, 236, 11, 15, 5,
+ 236, 12, 227, 30, 236, 11, 15, 5, 236, 12, 219, 165, 15, 5, 236, 4, 15,
+ 5, 235, 251, 15, 5, 235, 177, 15, 5, 235, 163, 15, 5, 181, 15, 5, 235,
+ 17, 29, 61, 15, 5, 235, 17, 29, 254, 160, 15, 5, 235, 17, 29, 254, 161,
+ 94, 233, 236, 15, 5, 235, 17, 29, 253, 144, 15, 5, 235, 17, 29, 252, 94,
+ 15, 5, 235, 17, 29, 252, 79, 15, 5, 235, 17, 29, 134, 15, 5, 235, 17, 29,
+ 251, 184, 15, 5, 235, 17, 29, 245, 50, 15, 5, 235, 17, 29, 245, 37, 15,
+ 5, 235, 17, 29, 243, 110, 15, 5, 235, 17, 29, 243, 94, 15, 5, 235, 17,
+ 29, 243, 81, 217, 192, 15, 5, 235, 17, 29, 243, 72, 15, 5, 235, 17, 29,
+ 243, 73, 94, 221, 23, 94, 61, 15, 5, 235, 17, 29, 242, 190, 15, 5, 235,
+ 17, 29, 242, 173, 15, 5, 235, 17, 29, 242, 167, 94, 222, 147, 15, 5, 235,
+ 17, 29, 242, 167, 249, 65, 242, 166, 15, 5, 235, 17, 29, 242, 92, 15, 5,
+ 235, 17, 29, 242, 68, 15, 5, 235, 17, 29, 236, 30, 15, 5, 235, 17, 29,
+ 236, 11, 15, 5, 235, 17, 29, 234, 247, 15, 5, 235, 17, 29, 234, 101, 15,
+ 5, 235, 17, 29, 234, 98, 15, 5, 235, 17, 29, 233, 13, 15, 5, 235, 17, 29,
+ 232, 156, 15, 5, 235, 17, 29, 231, 156, 15, 5, 235, 17, 29, 231, 157, 94,
+ 246, 33, 15, 5, 235, 17, 29, 231, 157, 94, 242, 190, 15, 5, 235, 17, 29,
+ 231, 157, 94, 217, 229, 15, 5, 235, 17, 29, 231, 42, 15, 5, 235, 17, 29,
+ 231, 43, 94, 228, 45, 15, 5, 235, 17, 29, 229, 187, 15, 5, 235, 17, 29,
+ 228, 50, 15, 5, 235, 17, 29, 225, 240, 15, 5, 235, 17, 29, 223, 51, 15,
+ 5, 235, 17, 29, 222, 202, 15, 5, 235, 17, 29, 222, 147, 15, 5, 235, 17,
+ 29, 221, 24, 15, 5, 235, 17, 29, 220, 243, 15, 5, 235, 17, 29, 220, 210,
+ 15, 5, 235, 17, 29, 220, 150, 15, 5, 235, 17, 29, 220, 108, 15, 5, 235,
+ 17, 29, 218, 252, 15, 5, 235, 17, 29, 218, 1, 15, 5, 235, 17, 29, 69, 15,
+ 5, 235, 17, 29, 215, 197, 15, 5, 235, 17, 29, 215, 188, 15, 5, 235, 17,
+ 29, 215, 163, 29, 193, 15, 5, 235, 17, 29, 215, 100, 15, 5, 235, 17, 29,
+ 212, 37, 15, 5, 235, 15, 15, 5, 235, 16, 249, 65, 235, 15, 15, 5, 235, 8,
+ 15, 5, 235, 5, 15, 5, 235, 3, 15, 5, 235, 2, 15, 5, 235, 0, 15, 5, 235,
+ 1, 110, 235, 0, 15, 5, 234, 247, 15, 5, 234, 248, 29, 236, 31, 242, 75,
+ 15, 5, 234, 243, 15, 5, 234, 244, 29, 252, 94, 15, 5, 234, 244, 249, 65,
+ 234, 243, 15, 5, 234, 241, 15, 5, 234, 240, 15, 5, 234, 212, 15, 5, 234,
+ 213, 233, 141, 29, 111, 110, 233, 141, 29, 69, 15, 5, 234, 213, 110, 234,
+ 213, 233, 141, 29, 111, 110, 233, 141, 29, 69, 15, 5, 234, 163, 15, 5,
+ 234, 101, 15, 5, 234, 102, 29, 252, 94, 15, 5, 234, 102, 29, 69, 15, 5,
+ 234, 102, 29, 215, 188, 15, 5, 234, 98, 15, 5, 234, 90, 15, 5, 234, 77,
+ 15, 5, 234, 76, 15, 5, 234, 74, 15, 5, 234, 75, 110, 234, 74, 15, 5, 233,
+ 238, 15, 5, 233, 239, 110, 241, 166, 29, 253, 145, 233, 239, 110, 241,
+ 166, 29, 253, 144, 15, 5, 233, 236, 15, 5, 233, 234, 15, 5, 233, 235,
+ 214, 244, 17, 15, 5, 233, 233, 15, 5, 233, 230, 15, 5, 233, 231, 242, 75,
+ 15, 5, 233, 229, 15, 5, 233, 217, 15, 5, 233, 218, 227, 30, 233, 217, 15,
+ 5, 233, 212, 15, 5, 233, 194, 15, 5, 233, 157, 15, 5, 233, 140, 15, 5,
+ 233, 141, 29, 61, 15, 5, 233, 141, 29, 118, 94, 248, 165, 94, 159, 15, 5,
+ 233, 141, 29, 118, 94, 243, 72, 15, 5, 233, 141, 29, 118, 94, 233, 128,
+ 15, 5, 233, 141, 29, 254, 86, 15, 5, 233, 141, 29, 254, 32, 15, 5, 233,
+ 141, 29, 253, 147, 212, 33, 217, 192, 15, 5, 233, 141, 29, 252, 94, 15,
+ 5, 233, 141, 29, 251, 184, 15, 5, 233, 141, 29, 248, 111, 15, 5, 233,
+ 141, 29, 245, 108, 15, 5, 233, 141, 29, 243, 110, 15, 5, 233, 141, 29,
+ 243, 72, 15, 5, 233, 141, 29, 242, 84, 15, 5, 233, 141, 29, 242, 85, 94,
+ 242, 84, 15, 5, 233, 141, 29, 159, 15, 5, 233, 141, 29, 242, 12, 15, 5,
+ 233, 141, 29, 241, 166, 29, 228, 50, 15, 5, 233, 141, 29, 236, 31, 242,
+ 75, 15, 5, 233, 141, 29, 236, 11, 15, 5, 233, 141, 29, 236, 12, 94, 159,
+ 15, 5, 233, 141, 29, 236, 12, 94, 232, 156, 15, 5, 233, 141, 29, 234,
+ 101, 15, 5, 233, 141, 29, 234, 90, 15, 5, 233, 141, 29, 233, 236, 15, 5,
+ 233, 141, 29, 233, 230, 15, 5, 233, 141, 29, 233, 231, 94, 241, 166, 94,
+ 61, 15, 5, 233, 141, 29, 233, 140, 15, 5, 233, 141, 29, 232, 226, 15, 5,
+ 233, 141, 29, 232, 156, 15, 5, 233, 141, 29, 232, 144, 15, 5, 233, 141,
+ 29, 231, 156, 15, 5, 233, 141, 29, 231, 157, 94, 245, 108, 15, 5, 233,
+ 141, 29, 230, 131, 15, 5, 233, 141, 29, 229, 187, 15, 5, 233, 141, 29,
+ 220, 244, 94, 218, 244, 15, 5, 233, 141, 29, 220, 190, 94, 242, 167, 94,
+ 245, 50, 15, 5, 233, 141, 29, 220, 190, 94, 242, 167, 217, 192, 15, 5,
+ 233, 141, 29, 220, 148, 15, 5, 233, 141, 29, 220, 149, 94, 220, 148, 15,
+ 5, 233, 141, 29, 218, 244, 15, 5, 233, 141, 29, 218, 33, 15, 5, 233, 141,
+ 29, 218, 22, 15, 5, 233, 141, 29, 217, 230, 94, 118, 94, 219, 28, 94,
+ 205, 15, 5, 233, 141, 29, 69, 15, 5, 233, 141, 29, 111, 94, 61, 15, 5,
+ 233, 141, 29, 111, 94, 111, 94, 69, 15, 5, 233, 141, 29, 215, 198, 94,
+ 253, 146, 15, 5, 233, 141, 29, 215, 188, 15, 5, 233, 141, 29, 215, 100,
+ 15, 5, 233, 141, 219, 165, 15, 5, 233, 138, 15, 5, 233, 139, 29, 220,
+ 243, 15, 5, 233, 139, 29, 220, 244, 94, 218, 244, 15, 5, 233, 139, 242,
+ 75, 15, 5, 233, 139, 242, 76, 110, 233, 139, 242, 76, 220, 243, 15, 5,
+ 233, 135, 15, 5, 233, 128, 15, 5, 233, 129, 29, 233, 128, 15, 5, 233,
+ 126, 15, 5, 233, 127, 29, 233, 217, 15, 5, 233, 127, 29, 233, 218, 94,
+ 223, 51, 15, 5, 233, 13, 15, 5, 232, 254, 15, 5, 232, 245, 15, 5, 232,
+ 226, 15, 5, 232, 156, 15, 5, 232, 157, 29, 252, 94, 15, 5, 232, 154, 15,
+ 5, 232, 155, 29, 254, 86, 15, 5, 232, 155, 29, 252, 94, 15, 5, 232, 155,
+ 29, 245, 37, 15, 5, 232, 155, 29, 245, 38, 217, 192, 15, 5, 232, 155, 29,
+ 243, 81, 217, 192, 15, 5, 232, 155, 29, 241, 166, 29, 252, 94, 15, 5,
+ 232, 155, 29, 236, 11, 15, 5, 232, 155, 29, 235, 5, 15, 5, 232, 155, 29,
+ 235, 3, 15, 5, 232, 155, 29, 235, 4, 94, 253, 146, 15, 5, 232, 155, 29,
+ 234, 101, 15, 5, 232, 155, 29, 233, 158, 94, 253, 146, 15, 5, 232, 155,
+ 29, 233, 140, 15, 5, 232, 155, 29, 231, 157, 94, 245, 108, 15, 5, 232,
+ 155, 29, 229, 187, 15, 5, 232, 155, 29, 228, 92, 15, 5, 232, 155, 29,
+ 220, 118, 94, 253, 146, 15, 5, 232, 155, 29, 220, 100, 94, 251, 54, 15,
+ 5, 232, 155, 29, 216, 77, 15, 5, 232, 155, 217, 192, 15, 5, 232, 155,
+ 249, 65, 232, 154, 15, 5, 232, 155, 227, 30, 232, 154, 15, 5, 232, 155,
+ 219, 165, 15, 5, 232, 155, 220, 225, 15, 5, 232, 153, 15, 5, 232, 149,
+ 15, 5, 232, 150, 110, 232, 149, 15, 5, 232, 150, 227, 30, 232, 149, 15,
+ 5, 232, 150, 220, 225, 15, 5, 232, 147, 15, 5, 232, 144, 15, 5, 232, 142,
+ 15, 5, 232, 143, 110, 232, 142, 15, 5, 232, 143, 110, 232, 143, 243, 73,
+ 110, 243, 72, 15, 5, 188, 15, 5, 232, 43, 29, 218, 22, 15, 5, 232, 43,
+ 242, 75, 15, 5, 232, 42, 15, 5, 232, 15, 15, 5, 231, 229, 15, 5, 231,
+ 210, 15, 5, 231, 209, 15, 5, 231, 156, 15, 5, 231, 112, 15, 5, 231, 42,
+ 15, 5, 231, 1, 15, 5, 230, 172, 15, 5, 230, 173, 110, 230, 172, 15, 5,
+ 230, 163, 15, 5, 230, 164, 242, 75, 15, 5, 230, 148, 15, 5, 230, 134, 15,
+ 5, 230, 131, 15, 5, 230, 132, 29, 61, 15, 5, 230, 132, 29, 233, 217, 15,
+ 5, 230, 132, 29, 212, 109, 15, 5, 230, 132, 110, 230, 131, 15, 5, 230,
+ 132, 110, 230, 132, 29, 118, 94, 205, 15, 5, 230, 132, 249, 65, 230, 131,
+ 15, 5, 230, 129, 15, 5, 230, 130, 29, 61, 15, 5, 230, 130, 29, 118, 94,
+ 247, 211, 15, 5, 230, 130, 29, 247, 211, 15, 5, 230, 130, 242, 75, 15, 5,
+ 205, 15, 5, 230, 45, 15, 5, 230, 34, 15, 5, 230, 35, 235, 190, 15, 5,
+ 230, 35, 29, 220, 151, 217, 192, 15, 5, 230, 35, 227, 30, 230, 34, 15, 5,
+ 230, 33, 15, 5, 230, 28, 228, 36, 15, 5, 230, 27, 15, 5, 230, 26, 15, 5,
+ 229, 187, 15, 5, 229, 188, 29, 61, 15, 5, 229, 188, 29, 215, 188, 15, 5,
+ 229, 188, 220, 225, 15, 5, 229, 64, 15, 5, 229, 65, 29, 74, 15, 5, 229,
+ 63, 15, 5, 229, 34, 15, 5, 229, 35, 29, 243, 81, 217, 192, 15, 5, 229,
+ 35, 29, 243, 73, 94, 243, 81, 217, 192, 15, 5, 229, 32, 15, 5, 229, 33,
+ 29, 254, 32, 15, 5, 229, 33, 29, 253, 146, 15, 5, 229, 33, 29, 253, 147,
+ 94, 253, 146, 15, 5, 229, 33, 29, 242, 84, 15, 5, 229, 33, 29, 231, 157,
+ 94, 243, 81, 217, 192, 15, 5, 229, 33, 29, 229, 187, 15, 5, 229, 33, 29,
+ 228, 50, 15, 5, 229, 33, 29, 220, 243, 15, 5, 229, 33, 29, 220, 244, 94,
+ 118, 254, 32, 15, 5, 229, 33, 29, 220, 244, 94, 253, 146, 15, 5, 229, 33,
+ 29, 220, 244, 94, 253, 147, 94, 253, 146, 15, 5, 229, 33, 29, 215, 198,
+ 94, 253, 146, 15, 5, 229, 33, 29, 215, 100, 15, 5, 229, 21, 15, 5, 228,
+ 92, 15, 5, 228, 65, 15, 5, 228, 50, 15, 5, 228, 51, 233, 139, 29, 243,
+ 72, 15, 5, 228, 51, 233, 139, 29, 231, 210, 15, 5, 228, 51, 233, 139, 29,
+ 222, 179, 15, 5, 228, 51, 233, 139, 29, 222, 180, 110, 228, 51, 233, 139,
+ 29, 222, 179, 15, 5, 228, 51, 233, 139, 29, 215, 100, 15, 5, 228, 51,
+ 217, 192, 15, 5, 228, 51, 110, 228, 50, 15, 5, 228, 51, 249, 65, 228, 50,
+ 15, 5, 228, 51, 249, 65, 228, 51, 233, 139, 110, 233, 138, 15, 5, 228,
+ 45, 15, 5, 228, 46, 254, 184, 29, 253, 141, 15, 5, 228, 46, 254, 184, 29,
+ 251, 184, 15, 5, 228, 46, 254, 184, 29, 246, 29, 15, 5, 228, 46, 254,
+ 184, 29, 242, 84, 15, 5, 228, 46, 254, 184, 29, 236, 31, 242, 75, 15, 5,
+ 228, 46, 254, 184, 29, 235, 3, 15, 5, 228, 46, 254, 184, 29, 233, 157,
+ 15, 5, 228, 46, 254, 184, 29, 229, 187, 15, 5, 228, 46, 254, 184, 29,
+ 220, 97, 15, 5, 228, 46, 254, 184, 29, 215, 197, 15, 5, 228, 46, 234, 75,
+ 29, 251, 184, 15, 5, 228, 46, 234, 75, 29, 251, 185, 69, 15, 5, 193, 15,
+ 5, 226, 204, 15, 5, 226, 174, 15, 5, 226, 149, 15, 5, 226, 37, 15, 5,
+ 225, 240, 15, 5, 225, 241, 29, 61, 15, 5, 225, 241, 29, 254, 185, 15, 5,
+ 225, 241, 29, 251, 184, 15, 5, 225, 241, 29, 251, 54, 15, 5, 225, 241,
+ 29, 74, 15, 5, 225, 241, 29, 72, 15, 5, 225, 241, 29, 240, 108, 15, 5,
+ 225, 241, 29, 69, 15, 5, 225, 241, 29, 215, 197, 15, 5, 225, 241, 249,
+ 65, 225, 240, 15, 5, 225, 185, 15, 5, 225, 186, 29, 234, 243, 15, 5, 225,
+ 186, 29, 215, 188, 15, 5, 225, 186, 29, 212, 109, 15, 5, 225, 186, 227,
+ 30, 225, 185, 15, 5, 203, 15, 5, 224, 72, 15, 5, 223, 188, 15, 5, 223,
+ 51, 15, 5, 222, 202, 15, 5, 222, 191, 228, 36, 15, 5, 222, 190, 15, 5,
+ 222, 191, 29, 61, 15, 5, 222, 191, 29, 246, 33, 15, 5, 222, 191, 29, 246,
+ 31, 15, 5, 222, 191, 29, 159, 15, 5, 222, 191, 29, 234, 247, 15, 5, 222,
+ 191, 29, 233, 217, 15, 5, 222, 191, 29, 232, 142, 15, 5, 222, 191, 29,
+ 231, 42, 15, 5, 222, 191, 29, 228, 50, 15, 5, 222, 191, 29, 222, 179, 15,
+ 5, 222, 191, 29, 220, 210, 15, 5, 222, 191, 29, 218, 41, 15, 5, 222, 191,
+ 29, 215, 197, 15, 5, 222, 191, 29, 215, 194, 15, 5, 222, 191, 29, 215,
+ 167, 15, 5, 222, 191, 29, 215, 121, 15, 5, 222, 191, 29, 215, 100, 15, 5,
+ 222, 191, 110, 222, 190, 15, 5, 222, 191, 242, 75, 15, 5, 222, 179, 15,
+ 5, 222, 180, 233, 141, 29, 253, 144, 15, 5, 222, 155, 15, 5, 222, 147,
+ 15, 5, 221, 24, 15, 5, 221, 22, 15, 5, 221, 23, 29, 61, 15, 5, 221, 23,
+ 29, 252, 94, 15, 5, 221, 23, 29, 242, 166, 15, 5, 221, 23, 29, 229, 187,
+ 15, 5, 221, 23, 29, 220, 148, 15, 5, 221, 23, 29, 216, 62, 15, 5, 221,
+ 23, 29, 69, 15, 5, 221, 23, 29, 111, 94, 61, 15, 5, 221, 21, 15, 5, 221,
+ 19, 15, 5, 221, 1, 15, 5, 220, 243, 15, 5, 220, 244, 240, 212, 15, 5,
+ 220, 244, 110, 220, 244, 243, 102, 110, 243, 102, 243, 73, 110, 243, 72,
+ 15, 5, 220, 244, 110, 220, 244, 218, 42, 110, 218, 42, 243, 73, 110, 243,
+ 72, 15, 5, 220, 236, 15, 5, 220, 231, 15, 5, 220, 228, 15, 5, 220, 227,
+ 15, 5, 220, 224, 15, 5, 220, 210, 15, 5, 220, 211, 29, 61, 15, 5, 220,
+ 211, 29, 236, 11, 15, 5, 220, 204, 15, 5, 220, 205, 29, 61, 15, 5, 220,
+ 205, 29, 252, 80, 15, 5, 220, 205, 29, 251, 38, 15, 5, 220, 205, 29, 247,
+ 158, 15, 5, 220, 205, 29, 243, 72, 15, 5, 220, 205, 29, 236, 30, 15, 5,
+ 220, 205, 29, 236, 31, 242, 75, 15, 5, 220, 205, 29, 233, 212, 15, 5,
+ 220, 205, 29, 232, 144, 15, 5, 220, 205, 29, 230, 163, 15, 5, 220, 205,
+ 29, 222, 179, 15, 5, 220, 198, 15, 5, 220, 193, 15, 5, 220, 194, 217,
+ 192, 15, 5, 220, 194, 110, 220, 194, 251, 28, 110, 251, 27, 15, 5, 220,
+ 189, 15, 5, 220, 150, 15, 5, 220, 151, 110, 235, 191, 220, 150, 15, 5,
+ 220, 148, 15, 5, 220, 147, 15, 5, 220, 117, 15, 5, 220, 118, 242, 75, 15,
+ 5, 220, 108, 15, 5, 220, 106, 15, 5, 220, 107, 110, 220, 107, 220, 148,
+ 15, 5, 220, 99, 15, 5, 220, 97, 15, 5, 219, 27, 15, 5, 219, 28, 110, 219,
+ 27, 15, 5, 218, 255, 15, 5, 218, 254, 15, 5, 218, 252, 15, 5, 218, 244,
+ 15, 5, 218, 243, 15, 5, 218, 217, 15, 5, 218, 216, 15, 5, 218, 52, 15, 5,
+ 218, 53, 253, 132, 15, 5, 218, 53, 29, 241, 165, 15, 5, 218, 53, 29, 231,
+ 42, 15, 5, 218, 53, 242, 75, 15, 5, 218, 41, 15, 5, 218, 42, 110, 218,
+ 42, 229, 65, 110, 229, 65, 247, 140, 110, 247, 139, 15, 5, 218, 42, 219,
+ 165, 15, 5, 218, 33, 15, 5, 126, 29, 251, 184, 15, 5, 126, 29, 242, 84,
+ 15, 5, 126, 29, 220, 243, 15, 5, 126, 29, 220, 150, 15, 5, 126, 29, 216,
+ 77, 15, 5, 126, 29, 215, 188, 15, 5, 218, 22, 15, 5, 218, 1, 15, 5, 217,
+ 229, 15, 5, 217, 230, 242, 75, 15, 5, 217, 71, 15, 5, 217, 72, 217, 192,
+ 15, 5, 217, 44, 15, 5, 217, 25, 15, 5, 217, 26, 29, 218, 22, 15, 5, 217,
+ 26, 110, 217, 25, 15, 5, 217, 26, 110, 217, 26, 243, 102, 110, 243, 102,
+ 243, 73, 110, 243, 72, 15, 5, 216, 82, 15, 5, 216, 77, 15, 5, 216, 75,
+ 15, 5, 216, 72, 15, 5, 216, 62, 15, 5, 216, 63, 110, 216, 63, 212, 110,
+ 110, 212, 109, 15, 5, 69, 15, 5, 111, 242, 84, 15, 5, 111, 111, 69, 15,
+ 5, 111, 110, 111, 226, 214, 110, 226, 214, 243, 73, 110, 243, 72, 15, 5,
+ 111, 110, 111, 218, 218, 110, 218, 217, 15, 5, 111, 110, 111, 111, 223,
+ 202, 110, 111, 223, 201, 15, 5, 215, 197, 15, 5, 215, 194, 15, 5, 215,
+ 188, 15, 5, 215, 189, 233, 212, 15, 5, 215, 189, 29, 252, 94, 15, 5, 215,
+ 189, 29, 231, 42, 15, 5, 215, 189, 29, 111, 94, 111, 94, 69, 15, 5, 215,
+ 189, 29, 111, 94, 111, 94, 111, 242, 75, 15, 5, 215, 189, 242, 75, 15, 5,
+ 215, 189, 220, 225, 15, 5, 215, 189, 220, 226, 29, 252, 94, 15, 5, 215,
+ 184, 15, 5, 215, 167, 15, 5, 215, 168, 29, 233, 140, 15, 5, 215, 168, 29,
+ 231, 157, 94, 248, 164, 15, 5, 215, 168, 29, 221, 22, 15, 5, 215, 168,
+ 29, 69, 15, 5, 215, 166, 15, 5, 215, 162, 15, 5, 215, 163, 29, 234, 212,
+ 15, 5, 215, 163, 29, 193, 15, 5, 215, 160, 15, 5, 215, 161, 242, 75, 15,
+ 5, 215, 121, 15, 5, 215, 122, 249, 65, 215, 121, 15, 5, 215, 122, 220,
+ 225, 15, 5, 215, 119, 15, 5, 215, 120, 29, 118, 94, 159, 15, 5, 215, 120,
+ 29, 118, 94, 205, 15, 5, 215, 120, 29, 254, 86, 15, 5, 215, 120, 29, 159,
+ 15, 5, 215, 120, 29, 228, 50, 15, 5, 215, 120, 29, 215, 197, 15, 5, 215,
+ 120, 29, 215, 198, 94, 253, 146, 15, 5, 215, 120, 29, 215, 198, 94, 251,
+ 184, 15, 5, 215, 118, 15, 5, 215, 115, 15, 5, 215, 114, 15, 5, 215, 110,
+ 15, 5, 215, 111, 29, 61, 15, 5, 215, 111, 29, 253, 141, 15, 5, 215, 111,
+ 29, 134, 15, 5, 215, 111, 29, 246, 23, 15, 5, 215, 111, 29, 243, 110, 15,
+ 5, 215, 111, 29, 243, 94, 15, 5, 215, 111, 29, 243, 81, 217, 192, 15, 5,
+ 215, 111, 29, 243, 72, 15, 5, 215, 111, 29, 242, 92, 15, 5, 215, 111, 29,
+ 159, 15, 5, 215, 111, 29, 236, 30, 15, 5, 215, 111, 29, 236, 11, 15, 5,
+ 215, 111, 29, 235, 163, 15, 5, 215, 111, 29, 234, 101, 15, 5, 215, 111,
+ 29, 232, 142, 15, 5, 215, 111, 29, 231, 1, 15, 5, 215, 111, 29, 193, 15,
+ 5, 215, 111, 29, 220, 243, 15, 5, 215, 111, 29, 220, 106, 15, 5, 215,
+ 111, 29, 216, 82, 15, 5, 215, 111, 29, 111, 94, 242, 84, 15, 5, 215, 111,
+ 29, 215, 188, 15, 5, 215, 111, 29, 215, 108, 15, 5, 215, 108, 15, 5, 215,
+ 109, 29, 69, 15, 5, 215, 100, 15, 5, 215, 101, 29, 61, 15, 5, 215, 101,
+ 29, 233, 238, 15, 5, 215, 101, 29, 233, 217, 15, 5, 215, 101, 29, 218,
+ 22, 15, 5, 215, 96, 15, 5, 215, 99, 15, 5, 215, 97, 15, 5, 215, 93, 15,
+ 5, 215, 82, 15, 5, 215, 83, 29, 234, 212, 15, 5, 215, 81, 15, 5, 212,
+ 109, 15, 5, 212, 110, 217, 192, 15, 5, 212, 110, 91, 29, 233, 217, 15, 5,
+ 212, 106, 15, 5, 212, 99, 15, 5, 212, 86, 15, 5, 212, 37, 15, 5, 212, 38,
+ 110, 212, 37, 15, 5, 212, 36, 15, 5, 212, 34, 15, 5, 212, 35, 235, 7,
+ 217, 192, 15, 5, 212, 29, 15, 5, 212, 21, 15, 5, 212, 8, 15, 5, 212, 6,
+ 15, 5, 212, 7, 29, 61, 15, 5, 212, 5, 15, 5, 212, 4, 15, 128, 5, 117,
+ 253, 146, 15, 128, 5, 133, 253, 146, 15, 128, 5, 243, 237, 253, 146, 15,
+ 128, 5, 244, 50, 253, 146, 15, 128, 5, 220, 53, 253, 146, 15, 128, 5,
+ 221, 43, 253, 146, 15, 128, 5, 245, 150, 253, 146, 15, 128, 5, 229, 31,
+ 253, 146, 15, 128, 5, 133, 247, 139, 15, 128, 5, 243, 237, 247, 139, 15,
+ 128, 5, 244, 50, 247, 139, 15, 128, 5, 220, 53, 247, 139, 15, 128, 5,
+ 221, 43, 247, 139, 15, 128, 5, 245, 150, 247, 139, 15, 128, 5, 229, 31,
+ 247, 139, 15, 128, 5, 243, 237, 69, 15, 128, 5, 244, 50, 69, 15, 128, 5,
+ 220, 53, 69, 15, 128, 5, 221, 43, 69, 15, 128, 5, 245, 150, 69, 15, 128,
+ 5, 229, 31, 69, 15, 128, 5, 122, 243, 14, 15, 128, 5, 117, 243, 14, 15,
+ 128, 5, 133, 243, 14, 15, 128, 5, 243, 237, 243, 14, 15, 128, 5, 244, 50,
+ 243, 14, 15, 128, 5, 220, 53, 243, 14, 15, 128, 5, 221, 43, 243, 14, 15,
+ 128, 5, 245, 150, 243, 14, 15, 128, 5, 229, 31, 243, 14, 15, 128, 5, 122,
+ 243, 11, 15, 128, 5, 117, 243, 11, 15, 128, 5, 133, 243, 11, 15, 128, 5,
+ 243, 237, 243, 11, 15, 128, 5, 244, 50, 243, 11, 15, 128, 5, 117, 221, 1,
+ 15, 128, 5, 133, 221, 1, 15, 128, 5, 133, 221, 2, 214, 244, 17, 15, 128,
+ 5, 243, 237, 221, 1, 15, 128, 5, 244, 50, 221, 1, 15, 128, 5, 220, 53,
+ 221, 1, 15, 128, 5, 221, 43, 221, 1, 15, 128, 5, 245, 150, 221, 1, 15,
+ 128, 5, 229, 31, 221, 1, 15, 128, 5, 122, 220, 252, 15, 128, 5, 117, 220,
+ 252, 15, 128, 5, 133, 220, 252, 15, 128, 5, 133, 220, 253, 214, 244, 17,
+ 15, 128, 5, 243, 237, 220, 252, 15, 128, 5, 244, 50, 220, 252, 15, 128,
+ 5, 221, 2, 29, 243, 95, 94, 247, 139, 15, 128, 5, 221, 2, 29, 243, 95,
+ 94, 231, 1, 15, 128, 5, 122, 251, 24, 15, 128, 5, 117, 251, 24, 15, 128,
+ 5, 133, 251, 24, 15, 128, 5, 133, 251, 25, 214, 244, 17, 15, 128, 5, 243,
+ 237, 251, 24, 15, 128, 5, 244, 50, 251, 24, 15, 128, 5, 133, 214, 244,
+ 243, 245, 245, 39, 15, 128, 5, 133, 214, 244, 243, 245, 245, 36, 15, 128,
+ 5, 243, 237, 214, 244, 243, 245, 232, 246, 15, 128, 5, 243, 237, 214,
+ 244, 243, 245, 232, 244, 15, 128, 5, 243, 237, 214, 244, 243, 245, 232,
+ 247, 61, 15, 128, 5, 243, 237, 214, 244, 243, 245, 232, 247, 253, 74, 15,
+ 128, 5, 220, 53, 214, 244, 243, 245, 253, 143, 15, 128, 5, 221, 43, 214,
+ 244, 243, 245, 236, 3, 15, 128, 5, 221, 43, 214, 244, 243, 245, 236, 5,
+ 61, 15, 128, 5, 221, 43, 214, 244, 243, 245, 236, 5, 253, 74, 15, 128, 5,
+ 245, 150, 214, 244, 243, 245, 215, 95, 15, 128, 5, 245, 150, 214, 244,
+ 243, 245, 215, 94, 15, 128, 5, 229, 31, 214, 244, 243, 245, 236, 19, 15,
+ 128, 5, 229, 31, 214, 244, 243, 245, 236, 18, 15, 128, 5, 229, 31, 214,
+ 244, 243, 245, 236, 17, 15, 128, 5, 229, 31, 214, 244, 243, 245, 236, 20,
+ 61, 15, 128, 5, 117, 253, 147, 217, 192, 15, 128, 5, 133, 253, 147, 217,
+ 192, 15, 128, 5, 243, 237, 253, 147, 217, 192, 15, 128, 5, 244, 50, 253,
+ 147, 217, 192, 15, 128, 5, 220, 53, 253, 147, 217, 192, 15, 128, 5, 122,
+ 252, 69, 15, 128, 5, 117, 252, 69, 15, 128, 5, 133, 252, 69, 15, 128, 5,
+ 243, 237, 252, 69, 15, 128, 5, 243, 237, 252, 70, 214, 244, 17, 15, 128,
+ 5, 244, 50, 252, 69, 15, 128, 5, 244, 50, 252, 70, 214, 244, 17, 15, 128,
+ 5, 229, 41, 15, 128, 5, 229, 42, 15, 128, 5, 122, 245, 35, 15, 128, 5,
+ 117, 245, 35, 15, 128, 5, 122, 217, 122, 247, 139, 15, 128, 5, 117, 217,
+ 120, 247, 139, 15, 128, 5, 244, 50, 220, 42, 247, 139, 15, 128, 5, 122,
+ 217, 122, 214, 244, 243, 245, 61, 15, 128, 5, 117, 217, 120, 214, 244,
+ 243, 245, 61, 15, 128, 5, 122, 245, 146, 253, 146, 15, 128, 5, 122, 224,
+ 167, 253, 146, 15, 128, 5, 53, 253, 135, 122, 220, 43, 15, 128, 5, 53,
+ 253, 135, 122, 224, 166, 15, 225, 27, 5, 53, 253, 135, 213, 196, 247,
+ 124, 15, 225, 27, 5, 71, 249, 164, 15, 225, 27, 5, 247, 207, 249, 164,
+ 15, 225, 27, 5, 247, 207, 216, 179, 10, 11, 255, 58, 10, 11, 255, 57, 10,
+ 11, 255, 56, 10, 11, 255, 55, 10, 11, 255, 54, 10, 11, 255, 53, 10, 11,
+ 255, 52, 10, 11, 255, 51, 10, 11, 255, 50, 10, 11, 255, 49, 10, 11, 255,
+ 48, 10, 11, 255, 47, 10, 11, 255, 46, 10, 11, 255, 45, 10, 11, 255, 44,
+ 10, 11, 255, 43, 10, 11, 255, 42, 10, 11, 255, 41, 10, 11, 255, 40, 10,
+ 11, 255, 39, 10, 11, 255, 38, 10, 11, 255, 37, 10, 11, 255, 36, 10, 11,
+ 255, 35, 10, 11, 255, 34, 10, 11, 255, 33, 10, 11, 255, 32, 10, 11, 255,
+ 31, 10, 11, 255, 30, 10, 11, 255, 29, 10, 11, 255, 28, 10, 11, 255, 27,
+ 10, 11, 255, 26, 10, 11, 255, 25, 10, 11, 255, 24, 10, 11, 255, 23, 10,
+ 11, 255, 22, 10, 11, 255, 21, 10, 11, 255, 20, 10, 11, 255, 19, 10, 11,
+ 255, 18, 10, 11, 255, 17, 10, 11, 255, 16, 10, 11, 255, 15, 10, 11, 255,
+ 14, 10, 11, 255, 13, 10, 11, 255, 12, 10, 11, 255, 11, 10, 11, 255, 10,
+ 10, 11, 255, 9, 10, 11, 255, 8, 10, 11, 255, 7, 10, 11, 255, 6, 10, 11,
+ 255, 5, 10, 11, 255, 4, 10, 11, 255, 3, 10, 11, 255, 2, 10, 11, 255, 1,
+ 10, 11, 255, 0, 10, 11, 254, 255, 10, 11, 254, 254, 10, 11, 254, 253, 10,
+ 11, 254, 252, 10, 11, 254, 251, 10, 11, 254, 250, 10, 11, 254, 249, 10,
+ 11, 254, 248, 10, 11, 254, 247, 10, 11, 254, 246, 10, 11, 254, 245, 10,
+ 11, 254, 244, 10, 11, 254, 243, 10, 11, 254, 242, 10, 11, 254, 241, 10,
+ 11, 254, 240, 10, 11, 254, 239, 10, 11, 254, 238, 10, 11, 254, 237, 10,
+ 11, 254, 236, 10, 11, 254, 235, 10, 11, 253, 72, 10, 11, 253, 70, 10, 11,
+ 253, 68, 10, 11, 253, 66, 10, 11, 253, 64, 10, 11, 253, 63, 10, 11, 253,
+ 61, 10, 11, 253, 59, 10, 11, 253, 57, 10, 11, 253, 55, 10, 11, 250, 248,
+ 10, 11, 250, 247, 10, 11, 250, 246, 10, 11, 250, 245, 10, 11, 250, 244,
+ 10, 11, 250, 243, 10, 11, 250, 242, 10, 11, 250, 241, 10, 11, 250, 240,
+ 10, 11, 250, 239, 10, 11, 250, 238, 10, 11, 250, 237, 10, 11, 250, 236,
+ 10, 11, 250, 235, 10, 11, 250, 234, 10, 11, 250, 233, 10, 11, 250, 232,
+ 10, 11, 250, 231, 10, 11, 250, 230, 10, 11, 250, 229, 10, 11, 250, 228,
+ 10, 11, 250, 227, 10, 11, 250, 226, 10, 11, 250, 225, 10, 11, 250, 224,
+ 10, 11, 250, 223, 10, 11, 250, 222, 10, 11, 250, 221, 10, 11, 249, 2, 10,
+ 11, 249, 1, 10, 11, 249, 0, 10, 11, 248, 255, 10, 11, 248, 254, 10, 11,
+ 248, 253, 10, 11, 248, 252, 10, 11, 248, 251, 10, 11, 248, 250, 10, 11,
+ 248, 249, 10, 11, 248, 248, 10, 11, 248, 247, 10, 11, 248, 246, 10, 11,
+ 248, 245, 10, 11, 248, 244, 10, 11, 248, 243, 10, 11, 248, 242, 10, 11,
+ 248, 241, 10, 11, 248, 240, 10, 11, 248, 239, 10, 11, 248, 238, 10, 11,
+ 248, 237, 10, 11, 248, 236, 10, 11, 248, 235, 10, 11, 248, 234, 10, 11,
+ 248, 233, 10, 11, 248, 232, 10, 11, 248, 231, 10, 11, 248, 230, 10, 11,
+ 248, 229, 10, 11, 248, 228, 10, 11, 248, 227, 10, 11, 248, 226, 10, 11,
+ 248, 225, 10, 11, 248, 224, 10, 11, 248, 223, 10, 11, 248, 222, 10, 11,
+ 248, 221, 10, 11, 248, 220, 10, 11, 248, 219, 10, 11, 248, 218, 10, 11,
+ 248, 217, 10, 11, 248, 216, 10, 11, 248, 215, 10, 11, 248, 214, 10, 11,
+ 248, 213, 10, 11, 248, 212, 10, 11, 248, 211, 10, 11, 248, 210, 10, 11,
+ 248, 209, 10, 11, 248, 208, 10, 11, 248, 207, 10, 11, 248, 206, 10, 11,
+ 248, 205, 10, 11, 248, 204, 10, 11, 248, 203, 10, 11, 248, 202, 10, 11,
+ 248, 201, 10, 11, 248, 200, 10, 11, 248, 199, 10, 11, 248, 198, 10, 11,
+ 248, 197, 10, 11, 248, 196, 10, 11, 248, 195, 10, 11, 248, 194, 10, 11,
+ 248, 193, 10, 11, 248, 192, 10, 11, 248, 191, 10, 11, 248, 190, 10, 11,
+ 248, 189, 10, 11, 248, 188, 10, 11, 248, 187, 10, 11, 248, 186, 10, 11,
+ 248, 185, 10, 11, 248, 184, 10, 11, 248, 183, 10, 11, 248, 182, 10, 11,
+ 248, 181, 10, 11, 248, 180, 10, 11, 248, 179, 10, 11, 248, 178, 10, 11,
+ 248, 177, 10, 11, 248, 176, 10, 11, 248, 175, 10, 11, 248, 174, 10, 11,
+ 248, 173, 10, 11, 248, 172, 10, 11, 248, 171, 10, 11, 248, 170, 10, 11,
+ 248, 169, 10, 11, 248, 168, 10, 11, 248, 167, 10, 11, 245, 235, 10, 11,
+ 245, 234, 10, 11, 245, 233, 10, 11, 245, 232, 10, 11, 245, 231, 10, 11,
+ 245, 230, 10, 11, 245, 229, 10, 11, 245, 228, 10, 11, 245, 227, 10, 11,
+ 245, 226, 10, 11, 245, 225, 10, 11, 245, 224, 10, 11, 245, 223, 10, 11,
+ 245, 222, 10, 11, 245, 221, 10, 11, 245, 220, 10, 11, 245, 219, 10, 11,
+ 245, 218, 10, 11, 245, 217, 10, 11, 245, 216, 10, 11, 245, 215, 10, 11,
+ 245, 214, 10, 11, 245, 213, 10, 11, 245, 212, 10, 11, 245, 211, 10, 11,
+ 245, 210, 10, 11, 245, 209, 10, 11, 245, 208, 10, 11, 245, 207, 10, 11,
+ 245, 206, 10, 11, 245, 205, 10, 11, 245, 204, 10, 11, 245, 203, 10, 11,
+ 245, 202, 10, 11, 245, 201, 10, 11, 245, 200, 10, 11, 245, 199, 10, 11,
+ 245, 198, 10, 11, 245, 197, 10, 11, 245, 196, 10, 11, 245, 195, 10, 11,
+ 245, 194, 10, 11, 245, 193, 10, 11, 245, 192, 10, 11, 244, 229, 10, 11,
+ 244, 228, 10, 11, 244, 227, 10, 11, 244, 226, 10, 11, 244, 225, 10, 11,
+ 244, 224, 10, 11, 244, 223, 10, 11, 244, 222, 10, 11, 244, 221, 10, 11,
+ 244, 220, 10, 11, 244, 219, 10, 11, 244, 218, 10, 11, 244, 217, 10, 11,
+ 244, 216, 10, 11, 244, 215, 10, 11, 244, 214, 10, 11, 244, 213, 10, 11,
+ 244, 212, 10, 11, 244, 211, 10, 11, 244, 210, 10, 11, 244, 209, 10, 11,
+ 244, 208, 10, 11, 244, 207, 10, 11, 244, 206, 10, 11, 244, 205, 10, 11,
+ 244, 204, 10, 11, 244, 203, 10, 11, 244, 202, 10, 11, 244, 201, 10, 11,
+ 244, 200, 10, 11, 244, 199, 10, 11, 244, 198, 10, 11, 244, 197, 10, 11,
+ 244, 196, 10, 11, 244, 195, 10, 11, 244, 194, 10, 11, 244, 193, 10, 11,
+ 244, 192, 10, 11, 244, 191, 10, 11, 244, 190, 10, 11, 244, 189, 10, 11,
+ 244, 188, 10, 11, 244, 187, 10, 11, 244, 186, 10, 11, 244, 185, 10, 11,
+ 244, 184, 10, 11, 244, 183, 10, 11, 244, 182, 10, 11, 244, 181, 10, 11,
+ 244, 180, 10, 11, 244, 179, 10, 11, 244, 178, 10, 11, 244, 177, 10, 11,
+ 244, 176, 10, 11, 244, 175, 10, 11, 244, 174, 10, 11, 244, 173, 10, 11,
+ 244, 172, 10, 11, 244, 171, 10, 11, 244, 170, 10, 11, 244, 169, 10, 11,
+ 244, 168, 10, 11, 244, 167, 10, 11, 244, 166, 10, 11, 244, 165, 10, 11,
+ 243, 176, 10, 11, 243, 175, 10, 11, 243, 174, 10, 11, 243, 173, 10, 11,
+ 243, 172, 10, 11, 243, 171, 10, 11, 243, 170, 10, 11, 243, 169, 10, 11,
+ 243, 168, 10, 11, 243, 167, 10, 11, 243, 166, 10, 11, 243, 165, 10, 11,
+ 243, 164, 10, 11, 243, 163, 10, 11, 243, 162, 10, 11, 243, 161, 10, 11,
+ 243, 160, 10, 11, 243, 159, 10, 11, 243, 158, 10, 11, 243, 157, 10, 11,
+ 243, 156, 10, 11, 243, 155, 10, 11, 243, 154, 10, 11, 243, 153, 10, 11,
+ 243, 152, 10, 11, 243, 151, 10, 11, 243, 150, 10, 11, 243, 149, 10, 11,
+ 243, 148, 10, 11, 243, 147, 10, 11, 243, 146, 10, 11, 243, 145, 10, 11,
+ 243, 144, 10, 11, 243, 143, 10, 11, 243, 142, 10, 11, 243, 141, 10, 11,
+ 243, 140, 10, 11, 243, 139, 10, 11, 243, 138, 10, 11, 243, 137, 10, 11,
+ 243, 136, 10, 11, 243, 135, 10, 11, 243, 134, 10, 11, 243, 133, 10, 11,
+ 243, 132, 10, 11, 243, 131, 10, 11, 243, 130, 10, 11, 243, 129, 10, 11,
+ 243, 128, 10, 11, 243, 127, 10, 11, 243, 126, 10, 11, 243, 125, 10, 11,
+ 243, 124, 10, 11, 243, 123, 10, 11, 243, 122, 10, 11, 243, 121, 10, 11,
+ 243, 120, 10, 11, 243, 119, 10, 11, 243, 118, 10, 11, 243, 117, 10, 11,
+ 243, 116, 10, 11, 243, 115, 10, 11, 243, 114, 10, 11, 243, 113, 10, 11,
+ 242, 39, 10, 11, 242, 38, 10, 11, 242, 37, 10, 11, 242, 36, 10, 11, 242,
+ 35, 10, 11, 242, 34, 10, 11, 242, 33, 10, 11, 242, 32, 10, 11, 242, 31,
+ 10, 11, 240, 130, 10, 11, 240, 129, 10, 11, 240, 128, 10, 11, 240, 127,
+ 10, 11, 240, 126, 10, 11, 240, 125, 10, 11, 240, 124, 10, 11, 240, 123,
+ 10, 11, 240, 122, 10, 11, 240, 121, 10, 11, 240, 120, 10, 11, 240, 119,
+ 10, 11, 240, 118, 10, 11, 240, 117, 10, 11, 240, 116, 10, 11, 240, 115,
+ 10, 11, 240, 114, 10, 11, 240, 113, 10, 11, 240, 112, 10, 11, 235, 26,
+ 10, 11, 235, 25, 10, 11, 235, 24, 10, 11, 235, 23, 10, 11, 235, 22, 10,
+ 11, 235, 21, 10, 11, 235, 20, 10, 11, 235, 19, 10, 11, 233, 168, 10, 11,
+ 233, 167, 10, 11, 233, 166, 10, 11, 233, 165, 10, 11, 233, 164, 10, 11,
+ 233, 163, 10, 11, 233, 162, 10, 11, 233, 161, 10, 11, 233, 160, 10, 11,
+ 233, 159, 10, 11, 232, 109, 10, 11, 232, 108, 10, 11, 232, 107, 10, 11,
+ 232, 106, 10, 11, 232, 105, 10, 11, 232, 104, 10, 11, 232, 103, 10, 11,
+ 232, 102, 10, 11, 232, 101, 10, 11, 232, 100, 10, 11, 232, 99, 10, 11,
+ 232, 98, 10, 11, 232, 97, 10, 11, 232, 96, 10, 11, 232, 95, 10, 11, 232,
+ 94, 10, 11, 232, 93, 10, 11, 232, 92, 10, 11, 232, 91, 10, 11, 232, 90,
+ 10, 11, 232, 89, 10, 11, 232, 88, 10, 11, 232, 87, 10, 11, 232, 86, 10,
+ 11, 232, 85, 10, 11, 232, 84, 10, 11, 232, 83, 10, 11, 232, 82, 10, 11,
+ 232, 81, 10, 11, 232, 80, 10, 11, 232, 79, 10, 11, 232, 78, 10, 11, 232,
+ 77, 10, 11, 232, 76, 10, 11, 232, 75, 10, 11, 232, 74, 10, 11, 232, 73,
+ 10, 11, 232, 72, 10, 11, 232, 71, 10, 11, 232, 70, 10, 11, 232, 69, 10,
+ 11, 232, 68, 10, 11, 232, 67, 10, 11, 232, 66, 10, 11, 232, 65, 10, 11,
+ 232, 64, 10, 11, 232, 63, 10, 11, 232, 62, 10, 11, 232, 61, 10, 11, 232,
+ 60, 10, 11, 232, 59, 10, 11, 232, 58, 10, 11, 232, 57, 10, 11, 232, 56,
+ 10, 11, 232, 55, 10, 11, 232, 54, 10, 11, 232, 53, 10, 11, 232, 52, 10,
+ 11, 232, 51, 10, 11, 232, 50, 10, 11, 232, 49, 10, 11, 232, 48, 10, 11,
+ 232, 47, 10, 11, 232, 46, 10, 11, 232, 45, 10, 11, 232, 44, 10, 11, 230,
+ 95, 10, 11, 230, 94, 10, 11, 230, 93, 10, 11, 230, 92, 10, 11, 230, 91,
+ 10, 11, 230, 90, 10, 11, 230, 89, 10, 11, 230, 88, 10, 11, 230, 87, 10,
+ 11, 230, 86, 10, 11, 230, 85, 10, 11, 230, 84, 10, 11, 230, 83, 10, 11,
+ 230, 82, 10, 11, 230, 81, 10, 11, 230, 80, 10, 11, 230, 79, 10, 11, 230,
+ 78, 10, 11, 230, 77, 10, 11, 230, 76, 10, 11, 230, 75, 10, 11, 230, 74,
+ 10, 11, 230, 73, 10, 11, 230, 72, 10, 11, 230, 71, 10, 11, 230, 70, 10,
+ 11, 230, 69, 10, 11, 230, 68, 10, 11, 230, 67, 10, 11, 230, 66, 10, 11,
+ 230, 65, 10, 11, 230, 64, 10, 11, 230, 63, 10, 11, 230, 62, 10, 11, 230,
+ 61, 10, 11, 230, 60, 10, 11, 230, 59, 10, 11, 230, 58, 10, 11, 230, 57,
+ 10, 11, 230, 56, 10, 11, 230, 55, 10, 11, 230, 54, 10, 11, 230, 53, 10,
+ 11, 230, 52, 10, 11, 230, 51, 10, 11, 230, 50, 10, 11, 230, 49, 10, 11,
+ 230, 48, 10, 11, 230, 47, 10, 11, 228, 222, 10, 11, 228, 221, 10, 11,
+ 228, 220, 10, 11, 228, 219, 10, 11, 228, 218, 10, 11, 228, 217, 10, 11,
+ 228, 216, 10, 11, 228, 215, 10, 11, 228, 214, 10, 11, 228, 213, 10, 11,
+ 228, 212, 10, 11, 228, 211, 10, 11, 228, 210, 10, 11, 228, 209, 10, 11,
+ 228, 208, 10, 11, 228, 207, 10, 11, 228, 206, 10, 11, 228, 205, 10, 11,
+ 228, 204, 10, 11, 228, 203, 10, 11, 228, 202, 10, 11, 228, 201, 10, 11,
+ 228, 91, 10, 11, 228, 90, 10, 11, 228, 89, 10, 11, 228, 88, 10, 11, 228,
+ 87, 10, 11, 228, 86, 10, 11, 228, 85, 10, 11, 228, 84, 10, 11, 228, 83,
+ 10, 11, 228, 82, 10, 11, 228, 81, 10, 11, 228, 80, 10, 11, 228, 79, 10,
+ 11, 228, 78, 10, 11, 228, 77, 10, 11, 228, 76, 10, 11, 228, 75, 10, 11,
+ 228, 74, 10, 11, 228, 73, 10, 11, 228, 72, 10, 11, 228, 71, 10, 11, 228,
+ 70, 10, 11, 228, 69, 10, 11, 228, 68, 10, 11, 228, 67, 10, 11, 228, 66,
+ 10, 11, 227, 196, 10, 11, 227, 195, 10, 11, 227, 194, 10, 11, 227, 193,
+ 10, 11, 227, 192, 10, 11, 227, 191, 10, 11, 227, 190, 10, 11, 227, 189,
+ 10, 11, 227, 188, 10, 11, 227, 187, 10, 11, 227, 186, 10, 11, 227, 185,
+ 10, 11, 227, 184, 10, 11, 227, 183, 10, 11, 227, 182, 10, 11, 227, 181,
+ 10, 11, 227, 180, 10, 11, 227, 179, 10, 11, 227, 178, 10, 11, 227, 177,
+ 10, 11, 227, 176, 10, 11, 227, 175, 10, 11, 227, 174, 10, 11, 227, 173,
+ 10, 11, 227, 172, 10, 11, 227, 171, 10, 11, 227, 170, 10, 11, 227, 169,
+ 10, 11, 227, 168, 10, 11, 227, 167, 10, 11, 227, 166, 10, 11, 227, 165,
+ 10, 11, 227, 164, 10, 11, 227, 163, 10, 11, 227, 162, 10, 11, 227, 161,
+ 10, 11, 227, 160, 10, 11, 227, 159, 10, 11, 227, 158, 10, 11, 227, 157,
+ 10, 11, 227, 156, 10, 11, 227, 155, 10, 11, 227, 154, 10, 11, 227, 153,
+ 10, 11, 227, 152, 10, 11, 227, 151, 10, 11, 227, 150, 10, 11, 227, 149,
+ 10, 11, 227, 148, 10, 11, 227, 147, 10, 11, 227, 146, 10, 11, 227, 145,
+ 10, 11, 227, 144, 10, 11, 227, 143, 10, 11, 227, 142, 10, 11, 227, 141,
+ 10, 11, 227, 140, 10, 11, 227, 139, 10, 11, 227, 138, 10, 11, 227, 137,
+ 10, 11, 227, 136, 10, 11, 227, 135, 10, 11, 227, 134, 10, 11, 227, 133,
+ 10, 11, 227, 132, 10, 11, 227, 131, 10, 11, 227, 130, 10, 11, 227, 129,
+ 10, 11, 227, 128, 10, 11, 227, 127, 10, 11, 227, 126, 10, 11, 227, 125,
+ 10, 11, 227, 124, 10, 11, 227, 123, 10, 11, 227, 122, 10, 11, 226, 228,
+ 10, 11, 226, 227, 10, 11, 226, 226, 10, 11, 226, 225, 10, 11, 226, 224,
+ 10, 11, 226, 223, 10, 11, 226, 222, 10, 11, 226, 221, 10, 11, 226, 220,
+ 10, 11, 226, 219, 10, 11, 226, 218, 10, 11, 226, 217, 10, 11, 226, 216,
+ 10, 11, 224, 239, 10, 11, 224, 238, 10, 11, 224, 237, 10, 11, 224, 236,
+ 10, 11, 224, 235, 10, 11, 224, 234, 10, 11, 224, 233, 10, 11, 224, 111,
+ 10, 11, 224, 110, 10, 11, 224, 109, 10, 11, 224, 108, 10, 11, 224, 107,
+ 10, 11, 224, 106, 10, 11, 224, 105, 10, 11, 224, 104, 10, 11, 224, 103,
+ 10, 11, 224, 102, 10, 11, 224, 101, 10, 11, 224, 100, 10, 11, 224, 99,
+ 10, 11, 224, 98, 10, 11, 224, 97, 10, 11, 224, 96, 10, 11, 224, 95, 10,
+ 11, 224, 94, 10, 11, 224, 93, 10, 11, 224, 92, 10, 11, 224, 91, 10, 11,
+ 224, 90, 10, 11, 224, 89, 10, 11, 224, 88, 10, 11, 224, 87, 10, 11, 224,
+ 86, 10, 11, 224, 85, 10, 11, 224, 84, 10, 11, 224, 83, 10, 11, 224, 82,
+ 10, 11, 224, 81, 10, 11, 224, 80, 10, 11, 224, 79, 10, 11, 224, 78, 10,
+ 11, 223, 1, 10, 11, 223, 0, 10, 11, 222, 255, 10, 11, 222, 254, 10, 11,
+ 222, 253, 10, 11, 222, 252, 10, 11, 222, 251, 10, 11, 222, 250, 10, 11,
+ 222, 249, 10, 11, 222, 248, 10, 11, 222, 247, 10, 11, 222, 246, 10, 11,
+ 222, 245, 10, 11, 222, 244, 10, 11, 222, 243, 10, 11, 222, 242, 10, 11,
+ 222, 241, 10, 11, 222, 240, 10, 11, 222, 239, 10, 11, 222, 238, 10, 11,
+ 222, 237, 10, 11, 222, 236, 10, 11, 222, 235, 10, 11, 222, 234, 10, 11,
+ 222, 233, 10, 11, 222, 232, 10, 11, 222, 231, 10, 11, 222, 230, 10, 11,
+ 222, 229, 10, 11, 222, 228, 10, 11, 222, 227, 10, 11, 222, 226, 10, 11,
+ 222, 225, 10, 11, 222, 224, 10, 11, 222, 223, 10, 11, 222, 222, 10, 11,
+ 222, 221, 10, 11, 222, 220, 10, 11, 222, 219, 10, 11, 222, 218, 10, 11,
+ 222, 217, 10, 11, 222, 216, 10, 11, 222, 215, 10, 11, 222, 214, 10, 11,
+ 222, 213, 10, 11, 222, 212, 10, 11, 222, 211, 10, 11, 222, 210, 10, 11,
+ 222, 209, 10, 11, 222, 208, 10, 11, 222, 207, 10, 11, 222, 206, 10, 11,
+ 222, 205, 10, 11, 222, 204, 10, 11, 218, 97, 10, 11, 218, 96, 10, 11,
+ 218, 95, 10, 11, 218, 94, 10, 11, 218, 93, 10, 11, 218, 92, 10, 11, 218,
+ 91, 10, 11, 218, 90, 10, 11, 218, 89, 10, 11, 218, 88, 10, 11, 218, 87,
+ 10, 11, 218, 86, 10, 11, 218, 85, 10, 11, 218, 84, 10, 11, 218, 83, 10,
+ 11, 218, 82, 10, 11, 218, 81, 10, 11, 218, 80, 10, 11, 218, 79, 10, 11,
+ 218, 78, 10, 11, 218, 77, 10, 11, 218, 76, 10, 11, 218, 75, 10, 11, 218,
+ 74, 10, 11, 218, 73, 10, 11, 218, 72, 10, 11, 218, 71, 10, 11, 218, 70,
+ 10, 11, 218, 69, 10, 11, 218, 68, 10, 11, 218, 67, 10, 11, 218, 66, 10,
+ 11, 218, 65, 10, 11, 218, 64, 10, 11, 218, 63, 10, 11, 218, 62, 10, 11,
+ 218, 61, 10, 11, 218, 60, 10, 11, 218, 59, 10, 11, 218, 58, 10, 11, 218,
+ 57, 10, 11, 218, 56, 10, 11, 218, 55, 10, 11, 218, 54, 10, 11, 215, 245,
+ 10, 11, 215, 244, 10, 11, 215, 243, 10, 11, 215, 242, 10, 11, 215, 241,
+ 10, 11, 215, 240, 10, 11, 215, 239, 10, 11, 215, 238, 10, 11, 215, 237,
+ 10, 11, 215, 236, 10, 11, 215, 235, 10, 11, 215, 234, 10, 11, 215, 233,
+ 10, 11, 215, 232, 10, 11, 215, 231, 10, 11, 215, 230, 10, 11, 215, 229,
+ 10, 11, 215, 228, 10, 11, 215, 227, 10, 11, 215, 226, 10, 11, 215, 225,
+ 10, 11, 215, 224, 10, 11, 215, 223, 10, 11, 215, 222, 10, 11, 215, 221,
+ 10, 11, 215, 220, 10, 11, 215, 219, 10, 11, 215, 218, 10, 11, 215, 217,
+ 10, 11, 215, 216, 10, 11, 215, 215, 10, 11, 215, 214, 10, 11, 215, 213,
+ 10, 11, 215, 212, 10, 11, 215, 211, 10, 11, 215, 210, 10, 11, 215, 209,
+ 10, 11, 215, 208, 10, 11, 215, 207, 10, 11, 215, 206, 10, 11, 215, 205,
+ 10, 11, 215, 204, 10, 11, 215, 203, 10, 11, 215, 202, 10, 11, 215, 201,
+ 10, 11, 215, 200, 10, 11, 215, 199, 10, 11, 215, 78, 10, 11, 215, 77, 10,
+ 11, 215, 76, 10, 11, 215, 75, 10, 11, 215, 74, 10, 11, 215, 73, 10, 11,
+ 215, 72, 10, 11, 215, 71, 10, 11, 215, 70, 10, 11, 215, 69, 10, 11, 215,
+ 68, 10, 11, 215, 67, 10, 11, 215, 66, 10, 11, 215, 65, 10, 11, 215, 64,
+ 10, 11, 215, 63, 10, 11, 215, 62, 10, 11, 215, 61, 10, 11, 215, 60, 10,
+ 11, 215, 59, 10, 11, 215, 58, 10, 11, 215, 57, 10, 11, 215, 56, 10, 11,
+ 215, 55, 10, 11, 215, 54, 10, 11, 215, 53, 10, 11, 215, 52, 10, 11, 215,
+ 51, 10, 11, 215, 50, 10, 11, 215, 49, 10, 11, 215, 48, 10, 11, 215, 47,
+ 10, 11, 215, 46, 10, 11, 215, 45, 10, 11, 215, 44, 10, 11, 215, 43, 10,
+ 11, 215, 42, 10, 11, 215, 41, 10, 11, 215, 40, 10, 11, 215, 39, 10, 11,
+ 215, 38, 10, 11, 215, 37, 10, 11, 215, 36, 10, 11, 215, 35, 10, 11, 215,
+ 34, 10, 11, 215, 33, 10, 11, 215, 32, 10, 11, 215, 31, 10, 11, 215, 30,
+ 10, 11, 215, 29, 10, 11, 215, 28, 10, 11, 215, 27, 10, 11, 215, 26, 10,
+ 11, 215, 25, 10, 11, 215, 24, 10, 11, 215, 23, 10, 11, 215, 22, 10, 11,
+ 215, 21, 10, 11, 215, 20, 10, 11, 215, 19, 10, 11, 215, 18, 10, 11, 215,
+ 17, 10, 11, 215, 16, 10, 11, 215, 15, 10, 11, 215, 14, 10, 11, 215, 13,
+ 10, 11, 215, 12, 10, 11, 215, 11, 10, 11, 215, 10, 10, 11, 215, 9, 10,
+ 11, 215, 8, 10, 11, 215, 7, 10, 11, 215, 6, 10, 11, 215, 5, 10, 11, 215,
+ 4, 10, 11, 215, 3, 10, 11, 215, 2, 10, 11, 214, 81, 10, 11, 214, 80, 10,
+ 11, 214, 79, 10, 11, 214, 78, 10, 11, 214, 77, 10, 11, 214, 76, 10, 11,
+ 214, 75, 10, 11, 214, 74, 10, 11, 214, 73, 10, 11, 214, 72, 10, 11, 214,
+ 71, 10, 11, 214, 70, 10, 11, 214, 69, 10, 11, 214, 68, 10, 11, 214, 67,
+ 10, 11, 214, 66, 10, 11, 214, 65, 10, 11, 214, 64, 10, 11, 214, 63, 10,
+ 11, 214, 62, 10, 11, 214, 61, 10, 11, 214, 60, 10, 11, 214, 59, 10, 11,
+ 214, 58, 10, 11, 214, 57, 10, 11, 214, 56, 10, 11, 214, 55, 10, 11, 214,
+ 54, 10, 11, 214, 53, 10, 11, 214, 52, 10, 11, 214, 51, 10, 11, 214, 50,
+ 10, 11, 213, 165, 10, 11, 213, 164, 10, 11, 213, 163, 10, 11, 213, 162,
+ 10, 11, 213, 161, 10, 11, 213, 160, 10, 11, 213, 159, 10, 11, 213, 158,
+ 10, 11, 213, 157, 10, 11, 213, 156, 10, 11, 213, 155, 10, 11, 213, 154,
+ 10, 11, 213, 103, 10, 11, 213, 102, 10, 11, 213, 101, 10, 11, 213, 100,
+ 10, 11, 213, 99, 10, 11, 213, 98, 10, 11, 213, 97, 10, 11, 213, 96, 10,
+ 11, 213, 95, 10, 11, 212, 151, 10, 11, 212, 150, 10, 11, 212, 149, 10,
+ 11, 212, 148, 10, 11, 212, 147, 10, 11, 212, 146, 10, 11, 212, 145, 10,
+ 11, 212, 144, 10, 11, 212, 143, 10, 11, 212, 142, 10, 11, 212, 141, 10,
+ 11, 212, 140, 10, 11, 212, 139, 10, 11, 212, 138, 10, 11, 212, 137, 10,
+ 11, 212, 136, 10, 11, 212, 135, 10, 11, 212, 134, 10, 11, 212, 133, 10,
+ 11, 212, 132, 10, 11, 212, 131, 10, 11, 212, 130, 10, 11, 212, 129, 10,
+ 11, 212, 128, 10, 11, 212, 127, 10, 11, 212, 126, 10, 11, 212, 125, 10,
+ 11, 212, 124, 10, 11, 212, 123, 10, 11, 212, 122, 10, 11, 212, 121, 10,
+ 11, 212, 120, 10, 11, 212, 119, 10, 11, 212, 118, 10, 11, 212, 117, 10,
+ 11, 212, 116, 10, 11, 212, 115, 10, 11, 212, 114, 10, 11, 212, 113, 10,
+ 11, 212, 112, 10, 11, 212, 111, 10, 11, 254, 231, 10, 11, 254, 230, 10,
+ 11, 254, 229, 10, 11, 254, 228, 10, 11, 254, 227, 10, 11, 254, 226, 10,
+ 11, 254, 225, 10, 11, 254, 224, 10, 11, 254, 223, 10, 11, 254, 222, 10,
+ 11, 254, 221, 10, 11, 254, 220, 10, 11, 254, 219, 10, 11, 254, 218, 10,
+ 11, 254, 217, 10, 11, 254, 216, 10, 11, 254, 215, 10, 11, 254, 214, 10,
+ 11, 254, 213, 10, 11, 254, 212, 10, 11, 254, 211, 10, 11, 254, 210, 10,
+ 11, 254, 209, 10, 11, 254, 208, 10, 11, 254, 207, 10, 11, 254, 206, 10,
+ 11, 254, 205, 10, 11, 254, 204, 10, 11, 254, 203, 10, 11, 254, 202, 10,
+ 11, 254, 201, 10, 11, 254, 200, 10, 11, 254, 199, 10, 11, 254, 198, 20,
+ 1, 153, 229, 98, 231, 83, 20, 1, 153, 243, 46, 244, 5, 20, 1, 153, 225,
+ 131, 231, 84, 225, 189, 20, 1, 153, 225, 131, 231, 84, 225, 190, 20, 1,
+ 153, 230, 44, 231, 83, 20, 1, 153, 220, 146, 20, 1, 153, 217, 19, 231,
+ 83, 20, 1, 153, 227, 238, 231, 83, 20, 1, 153, 220, 199, 226, 214, 229,
+ 0, 20, 1, 153, 225, 131, 226, 214, 229, 1, 225, 189, 20, 1, 153, 225,
+ 131, 226, 214, 229, 1, 225, 190, 20, 1, 153, 232, 23, 20, 1, 153, 216,
+ 83, 232, 24, 20, 1, 153, 229, 154, 20, 1, 153, 232, 20, 20, 1, 153, 231,
+ 239, 20, 1, 153, 230, 119, 20, 1, 153, 221, 45, 20, 1, 153, 228, 96, 20,
+ 1, 153, 234, 155, 20, 1, 153, 228, 225, 20, 1, 153, 218, 205, 20, 1, 153,
+ 229, 97, 20, 1, 153, 233, 110, 20, 1, 153, 233, 36, 233, 210, 20, 1, 153,
+ 228, 103, 231, 91, 20, 1, 153, 232, 27, 20, 1, 153, 226, 119, 20, 1, 153,
+ 242, 207, 20, 1, 153, 226, 177, 20, 1, 153, 230, 221, 229, 130, 20, 1,
+ 153, 227, 219, 231, 94, 20, 1, 153, 111, 212, 179, 230, 38, 20, 1, 153,
+ 242, 208, 20, 1, 153, 228, 103, 228, 104, 20, 1, 153, 220, 56, 20, 1,
+ 153, 231, 76, 20, 1, 153, 231, 97, 20, 1, 153, 230, 200, 20, 1, 153, 234,
+ 253, 20, 1, 153, 226, 214, 233, 71, 20, 1, 153, 229, 229, 233, 71, 20, 1,
+ 153, 226, 34, 20, 1, 153, 232, 21, 20, 1, 153, 229, 38, 20, 1, 153, 225,
+ 20, 20, 1, 153, 216, 80, 20, 1, 153, 232, 152, 20, 1, 153, 219, 227, 20,
+ 1, 153, 217, 169, 20, 1, 153, 232, 18, 20, 1, 153, 234, 162, 20, 1, 153,
+ 229, 225, 20, 1, 153, 233, 222, 20, 1, 153, 230, 201, 20, 1, 153, 220,
+ 143, 20, 1, 153, 232, 191, 20, 1, 153, 244, 62, 20, 1, 153, 223, 101, 20,
+ 1, 153, 233, 250, 20, 1, 153, 219, 223, 20, 1, 153, 231, 236, 225, 231,
+ 20, 1, 153, 220, 192, 20, 1, 153, 228, 102, 20, 1, 153, 220, 177, 228,
+ 113, 212, 187, 20, 1, 153, 228, 1, 230, 218, 20, 1, 153, 226, 209, 20, 1,
+ 153, 228, 226, 20, 1, 153, 215, 141, 20, 1, 153, 229, 133, 20, 1, 153,
+ 232, 17, 20, 1, 153, 229, 12, 20, 1, 153, 231, 182, 20, 1, 153, 228, 12,
+ 20, 1, 153, 217, 173, 20, 1, 153, 219, 221, 20, 1, 153, 226, 210, 20, 1,
+ 153, 228, 117, 20, 1, 153, 232, 25, 20, 1, 153, 228, 10, 20, 1, 153, 234,
+ 221, 20, 1, 153, 228, 120, 20, 1, 153, 214, 227, 20, 1, 153, 232, 156,
+ 20, 1, 153, 229, 180, 20, 1, 153, 230, 16, 20, 1, 153, 231, 181, 20, 1,
+ 226, 14, 228, 115, 20, 1, 226, 14, 216, 83, 232, 22, 20, 1, 226, 14, 220,
+ 111, 20, 1, 226, 14, 221, 49, 216, 82, 20, 1, 226, 14, 232, 193, 228, 99,
+ 20, 1, 226, 14, 231, 188, 232, 26, 20, 1, 226, 14, 234, 96, 20, 1, 226,
+ 14, 213, 6, 20, 1, 226, 14, 231, 183, 20, 1, 226, 14, 234, 242, 20, 1,
+ 226, 14, 226, 83, 20, 1, 226, 14, 213, 77, 233, 71, 20, 1, 226, 14, 233,
+ 127, 228, 113, 228, 20, 20, 1, 226, 14, 228, 97, 220, 218, 20, 1, 226,
+ 14, 229, 196, 229, 15, 20, 1, 226, 14, 242, 205, 20, 1, 226, 14, 225,
+ 181, 20, 1, 226, 14, 216, 83, 228, 111, 20, 1, 226, 14, 220, 223, 229,
+ 10, 20, 1, 226, 14, 220, 219, 20, 1, 226, 14, 231, 84, 217, 172, 20, 1,
+ 226, 14, 231, 170, 231, 184, 20, 1, 226, 14, 228, 11, 228, 99, 20, 1,
+ 226, 14, 234, 151, 20, 1, 226, 14, 242, 206, 20, 1, 226, 14, 234, 147,
+ 20, 1, 226, 14, 233, 151, 20, 1, 226, 14, 226, 121, 20, 1, 226, 14, 214,
+ 159, 20, 1, 226, 14, 229, 99, 230, 117, 20, 1, 226, 14, 229, 132, 231,
+ 166, 20, 1, 226, 14, 213, 181, 20, 1, 226, 14, 222, 182, 20, 1, 226, 14,
+ 218, 45, 20, 1, 226, 14, 231, 96, 20, 1, 226, 14, 229, 117, 20, 1, 226,
+ 14, 229, 118, 233, 107, 20, 1, 226, 14, 231, 86, 20, 1, 226, 14, 218,
+ 253, 20, 1, 226, 14, 231, 174, 20, 1, 226, 14, 230, 203, 20, 1, 226, 14,
+ 228, 21, 20, 1, 226, 14, 225, 24, 20, 1, 226, 14, 231, 95, 229, 134, 20,
+ 1, 226, 14, 244, 95, 20, 1, 226, 14, 231, 161, 20, 1, 226, 14, 244, 116,
+ 20, 1, 226, 14, 234, 159, 20, 1, 226, 14, 232, 43, 229, 4, 20, 1, 226,
+ 14, 232, 43, 228, 236, 20, 1, 226, 14, 233, 35, 20, 1, 226, 14, 229, 140,
+ 20, 1, 226, 14, 228, 122, 20, 1, 226, 14, 188, 20, 1, 226, 14, 234, 83,
+ 20, 1, 226, 14, 229, 87, 20, 1, 131, 229, 98, 232, 24, 20, 1, 131, 227,
+ 237, 20, 1, 131, 212, 187, 20, 1, 131, 214, 37, 20, 1, 131, 229, 133, 20,
+ 1, 131, 229, 217, 20, 1, 131, 229, 105, 20, 1, 131, 242, 215, 20, 1, 131,
+ 231, 178, 20, 1, 131, 243, 53, 20, 1, 131, 228, 3, 230, 239, 231, 98, 20,
+ 1, 131, 228, 95, 231, 169, 20, 1, 131, 231, 175, 20, 1, 131, 225, 187,
+ 20, 1, 131, 229, 202, 20, 1, 131, 231, 186, 250, 215, 20, 1, 131, 234,
+ 149, 20, 1, 131, 242, 216, 20, 1, 131, 234, 156, 20, 1, 131, 212, 204,
+ 230, 146, 20, 1, 131, 227, 231, 20, 1, 131, 231, 163, 20, 1, 131, 228,
+ 121, 20, 1, 131, 231, 169, 20, 1, 131, 213, 7, 20, 1, 131, 234, 2, 20, 1,
+ 131, 235, 14, 20, 1, 131, 221, 44, 20, 1, 131, 229, 211, 20, 1, 131, 218,
+ 43, 20, 1, 131, 228, 240, 20, 1, 131, 217, 19, 212, 189, 20, 1, 131, 219,
+ 23, 20, 1, 131, 229, 124, 228, 20, 20, 1, 131, 214, 158, 20, 1, 131, 230,
+ 19, 20, 1, 131, 232, 43, 234, 158, 20, 1, 131, 228, 104, 20, 1, 131, 229,
+ 119, 20, 1, 131, 233, 111, 20, 1, 131, 231, 171, 20, 1, 131, 231, 75, 20,
+ 1, 131, 228, 98, 20, 1, 131, 217, 168, 20, 1, 131, 229, 121, 20, 1, 131,
+ 243, 204, 20, 1, 131, 229, 216, 20, 1, 131, 228, 123, 20, 1, 131, 228,
+ 119, 20, 1, 131, 251, 36, 20, 1, 131, 214, 160, 20, 1, 131, 231, 176, 20,
+ 1, 131, 223, 51, 20, 1, 131, 229, 14, 20, 1, 131, 233, 126, 20, 1, 131,
+ 217, 17, 20, 1, 131, 228, 105, 229, 87, 20, 1, 131, 229, 6, 20, 1, 131,
+ 234, 162, 20, 1, 131, 229, 125, 20, 1, 131, 232, 17, 20, 1, 131, 231,
+ 164, 20, 1, 131, 232, 156, 20, 1, 131, 233, 210, 20, 1, 131, 229, 12, 20,
+ 1, 131, 229, 87, 20, 1, 131, 213, 172, 20, 1, 131, 229, 122, 20, 1, 131,
+ 228, 108, 20, 1, 131, 228, 100, 20, 1, 131, 233, 224, 228, 226, 20, 1,
+ 131, 228, 106, 20, 1, 131, 229, 224, 20, 1, 131, 232, 43, 228, 111, 20,
+ 1, 131, 213, 91, 20, 1, 131, 229, 223, 20, 1, 131, 220, 145, 20, 1, 131,
+ 221, 47, 20, 1, 131, 231, 172, 20, 1, 131, 232, 24, 20, 1, 131, 231, 182,
+ 20, 1, 131, 234, 150, 20, 1, 131, 231, 173, 20, 1, 131, 234, 154, 20, 1,
+ 131, 231, 186, 225, 235, 20, 1, 131, 212, 171, 20, 1, 131, 229, 2, 20, 1,
+ 131, 231, 33, 20, 1, 131, 230, 170, 20, 1, 131, 220, 195, 20, 1, 131,
+ 234, 172, 233, 94, 20, 1, 131, 234, 172, 244, 128, 20, 1, 131, 229, 152,
+ 20, 1, 131, 230, 16, 20, 1, 131, 232, 229, 20, 1, 131, 225, 197, 20, 1,
+ 131, 226, 74, 20, 1, 131, 217, 183, 20, 1, 103, 231, 162, 20, 1, 103,
+ 214, 35, 20, 1, 103, 229, 0, 20, 1, 103, 231, 83, 20, 1, 103, 228, 254,
+ 20, 1, 103, 233, 7, 20, 1, 103, 229, 3, 20, 1, 103, 228, 118, 20, 1, 103,
+ 229, 139, 20, 1, 103, 228, 20, 20, 1, 103, 213, 182, 20, 1, 103, 229, 95,
+ 20, 1, 103, 220, 241, 20, 1, 103, 229, 106, 20, 1, 103, 234, 157, 20, 1,
+ 103, 217, 170, 20, 1, 103, 220, 221, 20, 1, 103, 229, 11, 20, 1, 103,
+ 218, 253, 20, 1, 103, 234, 162, 20, 1, 103, 213, 79, 20, 1, 103, 233,
+ 225, 20, 1, 103, 222, 150, 20, 1, 103, 231, 88, 20, 1, 103, 229, 215, 20,
+ 1, 103, 231, 251, 20, 1, 103, 231, 94, 20, 1, 103, 221, 46, 20, 1, 103,
+ 213, 30, 20, 1, 103, 229, 5, 20, 1, 103, 234, 153, 231, 165, 20, 1, 103,
+ 229, 102, 20, 1, 103, 216, 82, 20, 1, 103, 242, 224, 20, 1, 103, 229, 92,
+ 20, 1, 103, 244, 96, 20, 1, 103, 229, 219, 20, 1, 103, 231, 67, 20, 1,
+ 103, 233, 31, 20, 1, 103, 229, 201, 20, 1, 103, 230, 217, 20, 1, 103,
+ 231, 71, 20, 1, 103, 225, 6, 20, 1, 103, 231, 69, 20, 1, 103, 231, 85,
+ 20, 1, 103, 232, 142, 20, 1, 103, 228, 110, 20, 1, 103, 231, 185, 20, 1,
+ 103, 233, 202, 20, 1, 103, 228, 12, 20, 1, 103, 217, 173, 20, 1, 103,
+ 219, 221, 20, 1, 103, 212, 171, 20, 1, 103, 234, 154, 20, 1, 103, 224,
+ 60, 20, 1, 103, 217, 218, 20, 1, 103, 229, 103, 20, 1, 103, 231, 90, 20,
+ 1, 103, 228, 109, 20, 1, 103, 234, 152, 20, 1, 103, 225, 191, 20, 1, 103,
+ 226, 28, 20, 1, 103, 227, 246, 20, 1, 103, 233, 35, 20, 1, 103, 229, 140,
+ 20, 1, 103, 231, 87, 20, 1, 103, 229, 114, 20, 1, 103, 212, 184, 20, 1,
+ 103, 226, 149, 20, 1, 103, 212, 183, 20, 1, 103, 229, 224, 20, 1, 103,
+ 228, 99, 20, 1, 103, 219, 25, 20, 1, 103, 233, 229, 20, 1, 103, 229, 129,
+ 20, 1, 103, 229, 100, 20, 1, 103, 216, 66, 20, 1, 103, 231, 98, 20, 1,
+ 103, 233, 219, 20, 1, 103, 228, 107, 20, 1, 103, 217, 171, 20, 1, 103,
+ 232, 19, 20, 1, 103, 229, 138, 20, 1, 103, 233, 30, 20, 1, 103, 229, 120,
+ 20, 1, 103, 228, 112, 20, 1, 103, 228, 240, 20, 1, 103, 242, 209, 20, 1,
+ 103, 233, 238, 20, 1, 103, 223, 234, 227, 75, 20, 1, 103, 218, 35, 20, 1,
+ 103, 216, 223, 20, 1, 103, 228, 10, 20, 1, 103, 223, 136, 20, 1, 103,
+ 233, 73, 20, 1, 103, 231, 144, 20, 1, 103, 183, 20, 1, 103, 218, 205, 20,
+ 1, 103, 230, 172, 20, 1, 103, 220, 207, 20, 1, 103, 220, 217, 20, 1, 103,
+ 233, 177, 20, 1, 103, 228, 92, 20, 1, 103, 220, 150, 20, 1, 103, 228,
+ 101, 20, 1, 103, 226, 86, 20, 1, 103, 229, 64, 20, 1, 103, 220, 176, 20,
+ 1, 103, 225, 19, 20, 1, 103, 230, 117, 20, 1, 103, 232, 174, 20, 1, 103,
+ 223, 234, 230, 166, 20, 1, 103, 217, 71, 20, 1, 103, 228, 93, 20, 1, 103,
+ 231, 186, 198, 20, 1, 103, 222, 148, 20, 1, 103, 244, 163, 20, 1, 80,
+ 229, 223, 20, 1, 80, 216, 229, 20, 1, 80, 231, 175, 20, 1, 80, 233, 111,
+ 20, 1, 80, 214, 109, 20, 1, 80, 232, 178, 20, 1, 80, 226, 213, 20, 1, 80,
+ 219, 230, 20, 1, 80, 224, 37, 20, 1, 80, 228, 114, 20, 1, 80, 229, 194,
+ 20, 1, 80, 225, 33, 20, 1, 80, 218, 13, 20, 1, 80, 229, 108, 20, 1, 80,
+ 233, 254, 20, 1, 80, 213, 175, 20, 1, 80, 222, 89, 20, 1, 80, 229, 130,
+ 20, 1, 80, 226, 210, 20, 1, 80, 216, 230, 20, 1, 80, 233, 223, 20, 1, 80,
+ 232, 192, 20, 1, 80, 228, 117, 20, 1, 80, 229, 84, 20, 1, 80, 232, 25,
+ 20, 1, 80, 229, 101, 20, 1, 80, 229, 83, 20, 1, 80, 228, 116, 20, 1, 80,
+ 223, 134, 20, 1, 80, 229, 2, 20, 1, 80, 226, 85, 20, 1, 80, 222, 200, 20,
+ 1, 80, 229, 115, 20, 1, 80, 231, 77, 20, 1, 80, 242, 203, 20, 1, 80, 229,
+ 104, 20, 1, 80, 229, 13, 20, 1, 80, 231, 235, 20, 1, 80, 232, 176, 20, 1,
+ 80, 229, 135, 20, 1, 80, 229, 207, 20, 1, 80, 218, 34, 228, 99, 20, 1,
+ 80, 221, 48, 20, 1, 80, 225, 29, 20, 1, 80, 229, 227, 219, 235, 20, 1,
+ 80, 229, 123, 228, 20, 20, 1, 80, 212, 251, 20, 1, 80, 242, 204, 20, 1,
+ 80, 216, 81, 20, 1, 80, 213, 10, 20, 1, 80, 225, 150, 20, 1, 80, 216, 71,
+ 20, 1, 80, 234, 160, 20, 1, 80, 219, 24, 20, 1, 80, 217, 172, 20, 1, 80,
+ 214, 161, 20, 1, 80, 213, 247, 20, 1, 80, 233, 154, 20, 1, 80, 225, 35,
+ 20, 1, 80, 218, 44, 20, 1, 80, 242, 223, 20, 1, 80, 229, 144, 20, 1, 80,
+ 220, 220, 20, 1, 80, 231, 72, 20, 1, 80, 231, 179, 20, 1, 80, 227, 235,
+ 20, 1, 80, 228, 223, 20, 1, 80, 243, 49, 20, 1, 80, 216, 72, 20, 1, 80,
+ 233, 232, 20, 1, 80, 213, 57, 20, 1, 80, 228, 11, 249, 209, 20, 1, 80,
+ 212, 241, 20, 1, 80, 231, 89, 20, 1, 80, 229, 212, 20, 1, 80, 225, 232,
+ 20, 1, 80, 212, 188, 20, 1, 80, 233, 32, 20, 1, 80, 243, 204, 20, 1, 80,
+ 243, 48, 20, 1, 80, 229, 94, 20, 1, 80, 234, 162, 20, 1, 80, 232, 28, 20,
+ 1, 80, 229, 107, 20, 1, 80, 242, 210, 20, 1, 80, 244, 164, 20, 1, 80,
+ 228, 94, 20, 1, 80, 226, 29, 20, 1, 80, 213, 8, 20, 1, 80, 229, 131, 20,
+ 1, 80, 228, 11, 251, 200, 20, 1, 80, 227, 215, 20, 1, 80, 225, 127, 20,
+ 1, 80, 231, 33, 20, 1, 80, 243, 202, 20, 1, 80, 230, 38, 20, 1, 80, 230,
+ 170, 20, 1, 80, 242, 209, 20, 1, 80, 243, 206, 72, 20, 1, 80, 230, 118,
+ 20, 1, 80, 225, 32, 20, 1, 80, 229, 96, 20, 1, 80, 233, 210, 20, 1, 80,
+ 225, 229, 20, 1, 80, 228, 102, 20, 1, 80, 213, 9, 20, 1, 80, 229, 116,
+ 20, 1, 80, 226, 214, 226, 62, 20, 1, 80, 243, 206, 250, 203, 20, 1, 80,
+ 244, 6, 20, 1, 80, 229, 7, 20, 1, 80, 61, 20, 1, 80, 216, 223, 20, 1, 80,
+ 75, 20, 1, 80, 72, 20, 1, 80, 233, 109, 20, 1, 80, 226, 214, 225, 157,
+ 20, 1, 80, 218, 49, 20, 1, 80, 218, 2, 20, 1, 80, 229, 227, 230, 106,
+ 240, 221, 20, 1, 80, 220, 195, 20, 1, 80, 213, 5, 20, 1, 80, 229, 77, 20,
+ 1, 80, 212, 193, 20, 1, 80, 212, 218, 218, 185, 20, 1, 80, 212, 218, 249,
+ 86, 20, 1, 80, 212, 178, 20, 1, 80, 212, 186, 20, 1, 80, 234, 148, 20, 1,
+ 80, 226, 27, 20, 1, 80, 229, 8, 245, 65, 20, 1, 80, 225, 30, 20, 1, 80,
+ 213, 180, 20, 1, 80, 244, 116, 20, 1, 80, 214, 227, 20, 1, 80, 232, 156,
+ 20, 1, 80, 231, 42, 20, 1, 80, 223, 204, 20, 1, 80, 224, 61, 20, 1, 80,
+ 229, 76, 20, 1, 80, 229, 159, 20, 1, 80, 220, 187, 20, 1, 80, 220, 176,
+ 20, 1, 80, 243, 206, 223, 236, 20, 1, 80, 205, 20, 1, 80, 225, 240, 20,
+ 1, 80, 232, 174, 20, 1, 80, 234, 37, 20, 1, 80, 231, 122, 20, 1, 80, 188,
+ 20, 1, 80, 231, 232, 20, 1, 80, 217, 174, 20, 1, 80, 234, 101, 20, 1, 80,
+ 230, 220, 20, 1, 80, 217, 200, 20, 1, 80, 244, 137, 20, 1, 80, 242, 199,
+ 20, 1, 226, 13, 181, 20, 1, 226, 13, 69, 20, 1, 226, 13, 233, 238, 20, 1,
+ 226, 13, 245, 165, 20, 1, 226, 13, 224, 1, 20, 1, 226, 13, 218, 35, 20,
+ 1, 226, 13, 228, 10, 20, 1, 226, 13, 233, 157, 20, 1, 226, 13, 223, 136,
+ 20, 1, 226, 13, 223, 182, 20, 1, 226, 13, 231, 144, 20, 1, 226, 13, 218,
+ 49, 20, 1, 226, 13, 229, 226, 20, 1, 226, 13, 229, 14, 20, 1, 226, 13,
+ 183, 20, 1, 226, 13, 218, 205, 20, 1, 226, 13, 220, 207, 20, 1, 226, 13,
+ 220, 117, 20, 1, 226, 13, 221, 44, 20, 1, 226, 13, 233, 177, 20, 1, 226,
+ 13, 234, 162, 20, 1, 226, 13, 228, 64, 20, 1, 226, 13, 228, 92, 20, 1,
+ 226, 13, 228, 241, 20, 1, 226, 13, 212, 217, 20, 1, 226, 13, 220, 150,
+ 20, 1, 226, 13, 186, 20, 1, 226, 13, 228, 120, 20, 1, 226, 13, 226, 27,
+ 20, 1, 226, 13, 228, 101, 20, 1, 226, 13, 213, 180, 20, 1, 226, 13, 226,
+ 86, 20, 1, 226, 13, 223, 51, 20, 1, 226, 13, 229, 64, 20, 1, 226, 13,
+ 223, 204, 20, 1, 226, 13, 234, 171, 20, 1, 226, 13, 229, 93, 20, 1, 226,
+ 13, 229, 141, 20, 1, 226, 13, 220, 187, 20, 1, 226, 13, 225, 33, 20, 1,
+ 226, 13, 244, 6, 20, 1, 226, 13, 214, 49, 20, 1, 226, 13, 233, 13, 20, 1,
+ 226, 13, 232, 174, 20, 1, 226, 13, 234, 37, 20, 1, 226, 13, 231, 177, 20,
+ 1, 226, 13, 223, 233, 20, 1, 226, 13, 188, 20, 1, 226, 13, 230, 231, 20,
+ 1, 226, 13, 231, 185, 20, 1, 226, 13, 217, 183, 20, 1, 226, 13, 234, 4,
+ 20, 1, 226, 13, 222, 166, 20, 1, 226, 13, 214, 98, 56, 1, 253, 193, 74,
+ 142, 1, 253, 193, 213, 38, 47, 27, 16, 225, 39, 47, 27, 16, 248, 103, 47,
+ 27, 16, 226, 50, 47, 27, 16, 226, 237, 245, 135, 47, 27, 16, 226, 237,
+ 247, 153, 47, 27, 16, 214, 248, 245, 135, 47, 27, 16, 214, 248, 247, 153,
+ 47, 27, 16, 234, 202, 47, 27, 16, 218, 115, 47, 27, 16, 226, 137, 47, 27,
+ 16, 212, 208, 47, 27, 16, 212, 209, 247, 153, 47, 27, 16, 233, 243, 47,
+ 27, 16, 253, 236, 245, 135, 47, 27, 16, 244, 249, 245, 135, 47, 27, 16,
+ 217, 211, 47, 27, 16, 234, 167, 47, 27, 16, 253, 227, 47, 27, 16, 253,
+ 228, 247, 153, 47, 27, 16, 218, 121, 47, 27, 16, 217, 112, 47, 27, 16,
+ 227, 72, 253, 191, 47, 27, 16, 242, 135, 253, 191, 47, 27, 16, 225, 38,
+ 47, 27, 16, 250, 85, 47, 27, 16, 214, 238, 47, 27, 16, 235, 162, 253,
+ 191, 47, 27, 16, 234, 169, 253, 191, 47, 27, 16, 234, 168, 253, 191, 47,
+ 27, 16, 222, 131, 47, 27, 16, 226, 128, 47, 27, 16, 219, 86, 253, 230,
+ 47, 27, 16, 226, 236, 253, 191, 47, 27, 16, 214, 247, 253, 191, 47, 27,
+ 16, 253, 231, 253, 191, 47, 27, 16, 253, 225, 47, 27, 16, 234, 46, 47,
+ 27, 16, 223, 199, 47, 27, 16, 225, 238, 253, 191, 47, 27, 16, 217, 36,
+ 47, 27, 16, 254, 30, 47, 27, 16, 222, 78, 47, 27, 16, 218, 124, 253, 191,
+ 47, 27, 16, 218, 124, 231, 107, 219, 84, 47, 27, 16, 226, 231, 253, 191,
+ 47, 27, 16, 217, 143, 47, 27, 16, 233, 51, 47, 27, 16, 245, 252, 47, 27,
+ 16, 216, 185, 47, 27, 16, 217, 185, 47, 27, 16, 233, 246, 47, 27, 16,
+ 253, 236, 244, 249, 229, 177, 47, 27, 16, 243, 207, 253, 191, 47, 27, 16,
+ 236, 7, 47, 27, 16, 216, 157, 253, 191, 47, 27, 16, 234, 205, 216, 156,
+ 47, 27, 16, 226, 75, 47, 27, 16, 225, 43, 47, 27, 16, 234, 20, 47, 27,
+ 16, 250, 17, 253, 191, 47, 27, 16, 224, 38, 47, 27, 16, 226, 140, 253,
+ 191, 47, 27, 16, 226, 138, 253, 191, 47, 27, 16, 240, 102, 47, 27, 16,
+ 230, 23, 47, 27, 16, 226, 32, 47, 27, 16, 234, 21, 254, 58, 47, 27, 16,
+ 216, 157, 254, 58, 47, 27, 16, 219, 63, 47, 27, 16, 242, 101, 47, 27, 16,
+ 235, 162, 229, 177, 47, 27, 16, 227, 72, 229, 177, 47, 27, 16, 226, 237,
+ 229, 177, 47, 27, 16, 226, 31, 47, 27, 16, 234, 7, 47, 27, 16, 226, 30,
+ 47, 27, 16, 233, 245, 47, 27, 16, 226, 76, 229, 177, 47, 27, 16, 234,
+ 168, 229, 178, 254, 7, 47, 27, 16, 234, 169, 229, 178, 254, 7, 47, 27,
+ 16, 212, 206, 47, 27, 16, 253, 228, 229, 177, 47, 27, 16, 253, 229, 218,
+ 122, 229, 177, 47, 27, 16, 212, 207, 47, 27, 16, 233, 244, 47, 27, 16,
+ 245, 130, 47, 27, 16, 250, 86, 47, 27, 16, 231, 11, 235, 161, 47, 27, 16,
+ 214, 248, 229, 177, 47, 27, 16, 225, 238, 229, 177, 47, 27, 16, 225, 44,
+ 229, 177, 47, 27, 16, 227, 69, 47, 27, 16, 253, 251, 47, 27, 16, 232,
+ 118, 47, 27, 16, 226, 138, 229, 177, 47, 27, 16, 226, 140, 229, 177, 47,
+ 27, 16, 245, 26, 226, 139, 47, 27, 16, 233, 175, 47, 27, 16, 253, 252,
+ 47, 27, 16, 216, 157, 229, 177, 47, 27, 16, 245, 133, 47, 27, 16, 218,
+ 124, 229, 177, 47, 27, 16, 218, 116, 47, 27, 16, 250, 17, 229, 177, 47,
+ 27, 16, 245, 69, 47, 27, 16, 222, 79, 229, 177, 47, 27, 16, 213, 139,
+ 234, 46, 47, 27, 16, 216, 154, 47, 27, 16, 225, 45, 47, 27, 16, 216, 158,
+ 47, 27, 16, 216, 155, 47, 27, 16, 225, 42, 47, 27, 16, 216, 153, 47, 27,
+ 16, 225, 41, 47, 27, 16, 242, 134, 47, 27, 16, 253, 185, 47, 27, 16, 245,
+ 26, 253, 185, 47, 27, 16, 226, 231, 229, 177, 47, 27, 16, 217, 142, 245,
+ 34, 47, 27, 16, 217, 142, 244, 248, 47, 27, 16, 217, 144, 253, 232, 47,
+ 27, 16, 217, 137, 234, 251, 253, 224, 47, 27, 16, 234, 204, 47, 27, 16,
+ 245, 97, 47, 27, 16, 213, 2, 234, 201, 47, 27, 16, 213, 2, 254, 7, 47,
+ 27, 16, 219, 85, 47, 27, 16, 234, 47, 254, 7, 47, 27, 16, 247, 154, 253,
+ 191, 47, 27, 16, 233, 247, 253, 191, 47, 27, 16, 233, 247, 254, 58, 47,
+ 27, 16, 233, 247, 229, 177, 47, 27, 16, 253, 231, 229, 177, 47, 27, 16,
+ 253, 233, 47, 27, 16, 247, 153, 47, 27, 16, 216, 168, 47, 27, 16, 217,
+ 177, 47, 27, 16, 234, 11, 47, 27, 16, 233, 56, 245, 92, 250, 8, 47, 27,
+ 16, 233, 56, 245, 253, 250, 9, 47, 27, 16, 233, 56, 216, 170, 250, 9, 47,
+ 27, 16, 233, 56, 217, 187, 250, 9, 47, 27, 16, 233, 56, 236, 2, 250, 8,
+ 47, 27, 16, 242, 135, 229, 178, 254, 7, 47, 27, 16, 242, 135, 226, 129,
+ 253, 181, 47, 27, 16, 242, 135, 226, 129, 247, 236, 47, 27, 16, 247, 177,
+ 47, 27, 16, 247, 178, 226, 129, 253, 182, 234, 201, 47, 27, 16, 247, 178,
+ 226, 129, 253, 182, 254, 7, 47, 27, 16, 247, 178, 226, 129, 247, 236, 47,
+ 27, 16, 216, 174, 47, 27, 16, 253, 186, 47, 27, 16, 236, 9, 47, 27, 16,
+ 247, 198, 47, 27, 16, 254, 116, 225, 134, 253, 187, 47, 27, 16, 254, 116,
+ 253, 184, 47, 27, 16, 254, 116, 253, 187, 47, 27, 16, 254, 116, 231, 101,
+ 47, 27, 16, 254, 116, 231, 110, 47, 27, 16, 254, 116, 242, 136, 47, 27,
+ 16, 254, 116, 242, 133, 47, 27, 16, 254, 116, 225, 134, 242, 136, 47, 27,
+ 16, 231, 214, 225, 50, 240, 100, 47, 27, 16, 231, 214, 254, 60, 225, 50,
+ 240, 100, 47, 27, 16, 231, 214, 247, 235, 240, 100, 47, 27, 16, 231, 214,
+ 254, 60, 247, 235, 240, 100, 47, 27, 16, 231, 214, 216, 163, 240, 100,
+ 47, 27, 16, 231, 214, 216, 175, 47, 27, 16, 231, 214, 217, 181, 240, 100,
+ 47, 27, 16, 231, 214, 217, 181, 233, 59, 240, 100, 47, 27, 16, 231, 214,
+ 233, 59, 240, 100, 47, 27, 16, 231, 214, 225, 171, 240, 100, 47, 27, 16,
+ 235, 167, 217, 204, 240, 101, 47, 27, 16, 253, 229, 217, 204, 240, 101,
+ 47, 27, 16, 244, 140, 217, 178, 47, 27, 16, 244, 140, 230, 213, 47, 27,
+ 16, 244, 140, 247, 182, 47, 27, 16, 231, 214, 214, 242, 240, 100, 47, 27,
+ 16, 231, 214, 225, 49, 240, 100, 47, 27, 16, 231, 214, 225, 171, 217,
+ 181, 240, 100, 47, 27, 16, 242, 131, 230, 98, 253, 232, 47, 27, 16, 242,
+ 131, 230, 98, 247, 152, 47, 27, 16, 245, 106, 234, 251, 243, 207, 214,
+ 105, 47, 27, 16, 236, 8, 47, 27, 16, 236, 6, 47, 27, 16, 243, 207, 253,
+ 192, 247, 234, 240, 99, 47, 27, 16, 243, 207, 247, 196, 193, 47, 27, 16,
+ 243, 207, 247, 196, 230, 23, 47, 27, 16, 243, 207, 230, 18, 240, 100, 47,
+ 27, 16, 243, 207, 247, 196, 247, 211, 47, 27, 16, 243, 207, 220, 30, 247,
+ 195, 247, 211, 47, 27, 16, 243, 207, 247, 196, 234, 188, 47, 27, 16, 243,
+ 207, 247, 196, 212, 16, 47, 27, 16, 243, 207, 247, 196, 229, 65, 234,
+ 201, 47, 27, 16, 243, 207, 247, 196, 229, 65, 254, 7, 47, 27, 16, 243,
+ 207, 231, 254, 250, 10, 247, 182, 47, 27, 16, 243, 207, 231, 254, 250,
+ 10, 230, 213, 47, 27, 16, 244, 91, 220, 30, 250, 10, 214, 241, 47, 27,
+ 16, 243, 207, 220, 30, 250, 10, 218, 125, 47, 27, 16, 243, 207, 229, 179,
+ 47, 27, 16, 250, 11, 211, 248, 47, 27, 16, 250, 11, 234, 45, 47, 27, 16,
+ 250, 11, 219, 197, 47, 27, 16, 243, 207, 240, 146, 213, 1, 217, 182, 47,
+ 27, 16, 243, 207, 245, 107, 253, 253, 47, 27, 16, 213, 1, 216, 164, 47,
+ 27, 16, 247, 190, 216, 164, 47, 27, 16, 247, 190, 217, 182, 47, 27, 16,
+ 247, 190, 253, 234, 245, 253, 247, 93, 47, 27, 16, 247, 190, 230, 211,
+ 217, 186, 247, 93, 47, 27, 16, 247, 190, 247, 174, 245, 3, 247, 93, 47,
+ 27, 16, 247, 190, 216, 172, 227, 77, 247, 93, 47, 27, 16, 213, 1, 253,
+ 234, 245, 253, 247, 93, 47, 27, 16, 213, 1, 230, 211, 217, 186, 247, 93,
+ 47, 27, 16, 213, 1, 247, 174, 245, 3, 247, 93, 47, 27, 16, 213, 1, 216,
+ 172, 227, 77, 247, 93, 47, 27, 16, 243, 25, 247, 189, 47, 27, 16, 243,
+ 25, 213, 0, 47, 27, 16, 247, 197, 253, 234, 231, 12, 47, 27, 16, 247,
+ 197, 253, 234, 231, 137, 47, 27, 16, 247, 197, 247, 153, 47, 27, 16, 247,
+ 197, 217, 135, 47, 27, 16, 220, 89, 217, 135, 47, 27, 16, 220, 89, 217,
+ 136, 247, 138, 47, 27, 16, 220, 89, 217, 136, 216, 165, 47, 27, 16, 220,
+ 89, 217, 136, 217, 175, 47, 27, 16, 220, 89, 253, 159, 47, 27, 16, 220,
+ 89, 253, 160, 247, 138, 47, 27, 16, 220, 89, 253, 160, 216, 165, 47, 27,
+ 16, 220, 89, 253, 160, 217, 175, 47, 27, 16, 247, 175, 243, 6, 47, 27,
+ 16, 247, 181, 227, 2, 47, 27, 16, 219, 77, 47, 27, 16, 253, 178, 193, 47,
+ 27, 16, 253, 178, 214, 105, 47, 27, 16, 253, 178, 243, 110, 47, 27, 16,
+ 253, 178, 247, 211, 47, 27, 16, 253, 178, 234, 188, 47, 27, 16, 253, 178,
+ 212, 16, 47, 27, 16, 253, 178, 229, 64, 47, 27, 16, 234, 168, 229, 178,
+ 231, 109, 47, 27, 16, 234, 169, 229, 178, 231, 109, 47, 27, 16, 234, 168,
+ 229, 178, 234, 201, 47, 27, 16, 234, 169, 229, 178, 234, 201, 47, 27, 16,
+ 234, 47, 234, 201, 47, 27, 16, 242, 135, 229, 178, 234, 201, 27, 16, 220,
+ 81, 252, 55, 27, 16, 51, 252, 55, 27, 16, 40, 252, 55, 27, 16, 223, 203,
+ 40, 252, 55, 27, 16, 248, 100, 252, 55, 27, 16, 220, 175, 252, 55, 27,
+ 16, 42, 223, 228, 52, 27, 16, 46, 223, 228, 52, 27, 16, 223, 228, 247,
+ 72, 27, 16, 248, 141, 222, 82, 27, 16, 248, 165, 250, 181, 27, 16, 222,
+ 82, 27, 16, 249, 171, 27, 16, 223, 226, 244, 80, 27, 16, 223, 226, 244,
+ 79, 27, 16, 223, 226, 244, 78, 27, 16, 244, 100, 27, 16, 244, 101, 55,
+ 27, 16, 251, 76, 77, 27, 16, 250, 210, 27, 16, 251, 86, 27, 16, 125, 27,
+ 16, 227, 59, 219, 102, 27, 16, 216, 23, 219, 102, 27, 16, 217, 96, 219,
+ 102, 27, 16, 243, 236, 219, 102, 27, 16, 244, 49, 219, 102, 27, 16, 220,
+ 52, 219, 102, 27, 16, 220, 50, 243, 220, 27, 16, 243, 234, 243, 220, 27,
+ 16, 243, 178, 249, 207, 27, 16, 243, 178, 249, 208, 227, 4, 254, 51, 27,
+ 16, 243, 178, 249, 208, 227, 4, 252, 42, 27, 16, 250, 253, 249, 207, 27,
+ 16, 244, 231, 249, 207, 27, 16, 244, 231, 249, 208, 227, 4, 254, 51, 27,
+ 16, 244, 231, 249, 208, 227, 4, 252, 42, 27, 16, 246, 38, 249, 206, 27,
+ 16, 246, 38, 249, 205, 27, 16, 230, 155, 231, 155, 223, 213, 27, 16, 51,
+ 220, 254, 27, 16, 51, 244, 34, 27, 16, 244, 35, 215, 134, 27, 16, 244,
+ 35, 246, 60, 27, 16, 230, 9, 215, 134, 27, 16, 230, 9, 246, 60, 27, 16,
+ 220, 255, 215, 134, 27, 16, 220, 255, 246, 60, 27, 16, 224, 167, 160,
+ 220, 254, 27, 16, 224, 167, 160, 244, 34, 27, 16, 249, 155, 217, 40, 27,
+ 16, 249, 27, 217, 40, 27, 16, 227, 4, 254, 51, 27, 16, 227, 4, 252, 42,
+ 27, 16, 224, 149, 254, 51, 27, 16, 224, 149, 252, 42, 27, 16, 230, 158,
+ 223, 213, 27, 16, 213, 236, 223, 213, 27, 16, 151, 223, 213, 27, 16, 224,
+ 167, 223, 213, 27, 16, 245, 146, 223, 213, 27, 16, 220, 46, 223, 213, 27,
+ 16, 217, 113, 223, 213, 27, 16, 220, 38, 223, 213, 27, 16, 122, 240, 201,
+ 216, 36, 223, 213, 27, 16, 213, 167, 228, 154, 27, 16, 94, 228, 154, 27,
+ 16, 249, 229, 213, 167, 228, 154, 27, 16, 41, 228, 155, 213, 238, 27, 16,
+ 41, 228, 155, 251, 144, 27, 16, 216, 184, 228, 155, 114, 213, 238, 27,
+ 16, 216, 184, 228, 155, 114, 251, 144, 27, 16, 216, 184, 228, 155, 42,
+ 213, 238, 27, 16, 216, 184, 228, 155, 42, 251, 144, 27, 16, 216, 184,
+ 228, 155, 46, 213, 238, 27, 16, 216, 184, 228, 155, 46, 251, 144, 27, 16,
+ 216, 184, 228, 155, 119, 213, 238, 27, 16, 216, 184, 228, 155, 119, 251,
+ 144, 27, 16, 216, 184, 228, 155, 114, 46, 213, 238, 27, 16, 216, 184,
+ 228, 155, 114, 46, 251, 144, 27, 16, 230, 199, 228, 155, 213, 238, 27,
+ 16, 230, 199, 228, 155, 251, 144, 27, 16, 216, 181, 228, 155, 119, 213,
+ 238, 27, 16, 216, 181, 228, 155, 119, 251, 144, 27, 16, 226, 132, 228,
+ 154, 27, 16, 214, 113, 228, 154, 27, 16, 228, 155, 251, 144, 27, 16, 228,
+ 59, 228, 154, 27, 16, 249, 178, 228, 155, 213, 238, 27, 16, 249, 178,
+ 228, 155, 251, 144, 27, 16, 251, 74, 27, 16, 213, 236, 228, 158, 27, 16,
+ 151, 228, 158, 27, 16, 224, 167, 228, 158, 27, 16, 245, 146, 228, 158,
+ 27, 16, 220, 46, 228, 158, 27, 16, 217, 113, 228, 158, 27, 16, 220, 38,
+ 228, 158, 27, 16, 122, 240, 201, 216, 36, 228, 158, 27, 16, 37, 219, 79,
+ 27, 16, 37, 219, 172, 219, 79, 27, 16, 37, 216, 192, 27, 16, 37, 216,
+ 191, 27, 16, 37, 216, 190, 27, 16, 244, 70, 216, 192, 27, 16, 244, 70,
+ 216, 191, 27, 16, 244, 70, 216, 190, 27, 16, 37, 253, 105, 247, 74, 27,
+ 16, 37, 244, 41, 27, 16, 37, 244, 40, 27, 16, 37, 244, 39, 27, 16, 37,
+ 244, 38, 27, 16, 37, 244, 37, 27, 16, 251, 234, 251, 250, 27, 16, 245,
+ 101, 251, 250, 27, 16, 251, 234, 217, 65, 27, 16, 245, 101, 217, 65, 27,
+ 16, 251, 234, 220, 8, 27, 16, 245, 101, 220, 8, 27, 16, 251, 234, 225,
+ 247, 27, 16, 245, 101, 225, 247, 27, 16, 37, 254, 174, 27, 16, 37, 219,
+ 104, 27, 16, 37, 217, 191, 27, 16, 37, 219, 105, 27, 16, 37, 231, 225,
+ 27, 16, 37, 231, 224, 27, 16, 37, 254, 173, 27, 16, 37, 232, 167, 27, 16,
+ 253, 169, 215, 134, 27, 16, 253, 169, 246, 60, 27, 16, 37, 247, 89, 27,
+ 16, 37, 223, 128, 27, 16, 37, 244, 27, 27, 16, 37, 220, 4, 27, 16, 37,
+ 251, 215, 27, 16, 37, 51, 216, 232, 27, 16, 37, 216, 169, 216, 232, 27,
+ 16, 223, 132, 27, 16, 219, 20, 27, 16, 212, 152, 27, 16, 225, 239, 27,
+ 16, 231, 92, 27, 16, 243, 242, 27, 16, 249, 78, 27, 16, 248, 29, 27, 16,
+ 242, 126, 228, 159, 220, 23, 27, 16, 242, 126, 228, 159, 228, 186, 220,
+ 23, 27, 16, 216, 213, 27, 16, 216, 59, 27, 16, 235, 191, 216, 59, 27, 16,
+ 216, 60, 220, 23, 27, 16, 216, 60, 215, 134, 27, 16, 227, 15, 219, 44,
+ 27, 16, 227, 15, 219, 41, 27, 16, 227, 15, 219, 40, 27, 16, 227, 15, 219,
+ 39, 27, 16, 227, 15, 219, 38, 27, 16, 227, 15, 219, 37, 27, 16, 227, 15,
+ 219, 36, 27, 16, 227, 15, 219, 35, 27, 16, 227, 15, 219, 34, 27, 16, 227,
+ 15, 219, 43, 27, 16, 227, 15, 219, 42, 27, 16, 241, 229, 27, 16, 229,
+ 186, 27, 16, 245, 101, 65, 219, 73, 27, 16, 248, 22, 220, 23, 27, 16, 37,
+ 119, 251, 95, 27, 16, 37, 114, 251, 95, 27, 16, 37, 241, 239, 27, 16, 37,
+ 219, 251, 225, 175, 27, 16, 226, 91, 77, 27, 16, 226, 91, 114, 77, 27,
+ 16, 151, 226, 91, 77, 27, 16, 242, 158, 215, 134, 27, 16, 242, 158, 246,
+ 60, 27, 16, 2, 244, 69, 27, 16, 248, 125, 27, 16, 248, 126, 254, 63, 27,
+ 16, 231, 197, 27, 16, 232, 182, 27, 16, 251, 71, 27, 16, 221, 74, 213,
+ 238, 27, 16, 221, 74, 251, 144, 27, 16, 230, 253, 27, 16, 230, 254, 251,
+ 144, 27, 16, 221, 68, 213, 238, 27, 16, 221, 68, 251, 144, 27, 16, 243,
+ 192, 213, 238, 27, 16, 243, 192, 251, 144, 27, 16, 232, 183, 226, 55,
+ 223, 213, 27, 16, 232, 183, 236, 0, 223, 213, 27, 16, 251, 72, 223, 213,
+ 27, 16, 221, 74, 223, 213, 27, 16, 230, 254, 223, 213, 27, 16, 221, 68,
+ 223, 213, 27, 16, 217, 202, 226, 53, 249, 48, 225, 58, 226, 54, 27, 16,
+ 217, 202, 226, 53, 249, 48, 225, 58, 235, 255, 27, 16, 217, 202, 226, 53,
+ 249, 48, 225, 58, 226, 55, 247, 163, 27, 16, 217, 202, 235, 254, 249, 48,
+ 225, 58, 226, 54, 27, 16, 217, 202, 235, 254, 249, 48, 225, 58, 235, 255,
+ 27, 16, 217, 202, 235, 254, 249, 48, 225, 58, 236, 0, 247, 163, 27, 16,
+ 217, 202, 235, 254, 249, 48, 225, 58, 236, 0, 247, 162, 27, 16, 217, 202,
+ 235, 254, 249, 48, 225, 58, 236, 0, 247, 161, 27, 16, 249, 73, 27, 16,
+ 242, 103, 250, 253, 249, 207, 27, 16, 242, 103, 244, 231, 249, 207, 27,
+ 16, 41, 253, 74, 27, 16, 214, 132, 27, 16, 225, 148, 27, 16, 249, 198,
+ 27, 16, 222, 121, 27, 16, 249, 202, 27, 16, 216, 220, 27, 16, 225, 122,
+ 27, 16, 225, 123, 244, 29, 27, 16, 222, 122, 244, 29, 27, 16, 216, 221,
+ 223, 210, 27, 16, 226, 39, 219, 11, 25, 214, 118, 174, 218, 174, 25, 214,
+ 118, 174, 218, 163, 25, 214, 118, 174, 218, 153, 25, 214, 118, 174, 218,
+ 146, 25, 214, 118, 174, 218, 138, 25, 214, 118, 174, 218, 132, 25, 214,
+ 118, 174, 218, 131, 25, 214, 118, 174, 218, 130, 25, 214, 118, 174, 218,
+ 129, 25, 214, 118, 174, 218, 173, 25, 214, 118, 174, 218, 172, 25, 214,
+ 118, 174, 218, 171, 25, 214, 118, 174, 218, 170, 25, 214, 118, 174, 218,
+ 169, 25, 214, 118, 174, 218, 168, 25, 214, 118, 174, 218, 167, 25, 214,
+ 118, 174, 218, 166, 25, 214, 118, 174, 218, 165, 25, 214, 118, 174, 218,
+ 164, 25, 214, 118, 174, 218, 162, 25, 214, 118, 174, 218, 161, 25, 214,
+ 118, 174, 218, 160, 25, 214, 118, 174, 218, 159, 25, 214, 118, 174, 218,
+ 158, 25, 214, 118, 174, 218, 137, 25, 214, 118, 174, 218, 136, 25, 214,
+ 118, 174, 218, 135, 25, 214, 118, 174, 218, 134, 25, 214, 118, 174, 218,
+ 133, 25, 235, 211, 174, 218, 174, 25, 235, 211, 174, 218, 163, 25, 235,
+ 211, 174, 218, 146, 25, 235, 211, 174, 218, 138, 25, 235, 211, 174, 218,
+ 131, 25, 235, 211, 174, 218, 130, 25, 235, 211, 174, 218, 172, 25, 235,
+ 211, 174, 218, 171, 25, 235, 211, 174, 218, 170, 25, 235, 211, 174, 218,
+ 169, 25, 235, 211, 174, 218, 166, 25, 235, 211, 174, 218, 165, 25, 235,
+ 211, 174, 218, 164, 25, 235, 211, 174, 218, 159, 25, 235, 211, 174, 218,
+ 158, 25, 235, 211, 174, 218, 157, 25, 235, 211, 174, 218, 156, 25, 235,
+ 211, 174, 218, 155, 25, 235, 211, 174, 218, 154, 25, 235, 211, 174, 218,
+ 152, 25, 235, 211, 174, 218, 151, 25, 235, 211, 174, 218, 150, 25, 235,
+ 211, 174, 218, 149, 25, 235, 211, 174, 218, 148, 25, 235, 211, 174, 218,
+ 147, 25, 235, 211, 174, 218, 145, 25, 235, 211, 174, 218, 144, 25, 235,
+ 211, 174, 218, 143, 25, 235, 211, 174, 218, 142, 25, 235, 211, 174, 218,
+ 141, 25, 235, 211, 174, 218, 140, 25, 235, 211, 174, 218, 139, 25, 235,
+ 211, 174, 218, 137, 25, 235, 211, 174, 218, 136, 25, 235, 211, 174, 218,
+ 135, 25, 235, 211, 174, 218, 134, 25, 235, 211, 174, 218, 133, 37, 25,
+ 27, 216, 166, 37, 25, 27, 217, 176, 37, 25, 27, 226, 63, 25, 27, 233, 55,
+ 230, 212, 31, 245, 179, 247, 176, 31, 241, 206, 245, 179, 247, 176, 31,
+ 240, 204, 245, 179, 247, 176, 31, 245, 178, 241, 207, 247, 176, 31, 245,
+ 178, 240, 203, 247, 176, 31, 245, 179, 170, 31, 250, 108, 170, 31, 243,
+ 200, 249, 228, 170, 31, 230, 246, 170, 31, 252, 50, 170, 31, 234, 185,
+ 220, 7, 170, 31, 249, 118, 170, 31, 253, 148, 170, 31, 227, 29, 170, 31,
+ 251, 80, 226, 254, 170, 31, 248, 24, 167, 247, 131, 170, 31, 247, 128,
+ 170, 31, 212, 213, 170, 31, 235, 243, 170, 31, 226, 72, 170, 31, 224, 20,
+ 170, 31, 249, 128, 170, 31, 241, 46, 252, 101, 170, 31, 214, 43, 170, 31,
+ 244, 8, 170, 31, 254, 151, 170, 31, 223, 239, 170, 31, 223, 217, 170, 31,
+ 245, 177, 170, 31, 235, 56, 170, 31, 249, 123, 170, 31, 245, 100, 170,
+ 31, 246, 7, 170, 31, 250, 81, 170, 31, 248, 33, 170, 31, 22, 223, 216,
+ 170, 31, 226, 205, 170, 31, 233, 58, 170, 31, 249, 191, 170, 31, 234, 86,
+ 170, 31, 243, 62, 170, 31, 219, 52, 170, 31, 225, 16, 170, 31, 243, 199,
+ 170, 31, 223, 218, 170, 31, 233, 95, 167, 230, 227, 170, 31, 223, 214,
+ 170, 31, 242, 144, 211, 211, 231, 141, 170, 31, 245, 102, 170, 31, 219,
+ 64, 170, 31, 242, 105, 170, 31, 245, 94, 170, 31, 226, 108, 170, 31, 223,
+ 122, 170, 31, 244, 28, 170, 31, 214, 240, 167, 214, 28, 170, 31, 249,
+ 132, 170, 31, 231, 154, 170, 31, 245, 27, 170, 31, 215, 143, 170, 31,
+ 247, 164, 170, 31, 249, 193, 230, 180, 170, 31, 242, 87, 170, 31, 243,
+ 63, 235, 251, 170, 31, 231, 204, 170, 31, 254, 170, 170, 31, 245, 115,
+ 170, 31, 246, 63, 170, 31, 214, 26, 170, 31, 220, 78, 170, 31, 235, 219,
+ 170, 31, 247, 249, 170, 31, 248, 105, 170, 31, 247, 160, 170, 31, 244,
+ 252, 170, 31, 221, 36, 170, 31, 219, 68, 170, 31, 241, 241, 170, 31, 249,
+ 151, 170, 31, 249, 188, 170, 31, 244, 145, 170, 31, 254, 117, 170, 31,
+ 249, 150, 170, 31, 227, 63, 217, 149, 214, 219, 170, 31, 247, 184, 170,
+ 31, 233, 147, 170, 31, 243, 239, 249, 88, 223, 103, 215, 145, 21, 116,
+ 249, 88, 223, 103, 215, 145, 21, 109, 249, 88, 223, 103, 215, 145, 21,
+ 166, 249, 88, 223, 103, 215, 145, 21, 163, 249, 88, 223, 103, 215, 145,
+ 21, 180, 249, 88, 223, 103, 215, 145, 21, 189, 249, 88, 223, 103, 215,
+ 145, 21, 198, 249, 88, 223, 103, 215, 145, 21, 195, 249, 88, 223, 103,
+ 215, 145, 21, 200, 249, 88, 223, 103, 217, 196, 21, 116, 249, 88, 223,
+ 103, 217, 196, 21, 109, 249, 88, 223, 103, 217, 196, 21, 166, 249, 88,
+ 223, 103, 217, 196, 21, 163, 249, 88, 223, 103, 217, 196, 21, 180, 249,
+ 88, 223, 103, 217, 196, 21, 189, 249, 88, 223, 103, 217, 196, 21, 198,
+ 249, 88, 223, 103, 217, 196, 21, 195, 249, 88, 223, 103, 217, 196, 21,
+ 200, 14, 22, 6, 61, 14, 22, 6, 253, 74, 14, 22, 6, 250, 252, 14, 22, 6,
+ 249, 3, 14, 22, 6, 74, 14, 22, 6, 244, 230, 14, 22, 6, 243, 177, 14, 22,
+ 6, 242, 41, 14, 22, 6, 72, 14, 22, 6, 235, 142, 14, 22, 6, 235, 27, 14,
+ 22, 6, 150, 14, 22, 6, 183, 14, 22, 6, 204, 14, 22, 6, 75, 14, 22, 6,
+ 226, 229, 14, 22, 6, 224, 240, 14, 22, 6, 149, 14, 22, 6, 197, 14, 22, 6,
+ 218, 99, 14, 22, 6, 69, 14, 22, 6, 215, 79, 14, 22, 6, 214, 82, 14, 22,
+ 6, 213, 166, 14, 22, 6, 213, 105, 14, 22, 6, 212, 152, 14, 22, 3, 61, 14,
+ 22, 3, 253, 74, 14, 22, 3, 250, 252, 14, 22, 3, 249, 3, 14, 22, 3, 74,
+ 14, 22, 3, 244, 230, 14, 22, 3, 243, 177, 14, 22, 3, 242, 41, 14, 22, 3,
+ 72, 14, 22, 3, 235, 142, 14, 22, 3, 235, 27, 14, 22, 3, 150, 14, 22, 3,
+ 183, 14, 22, 3, 204, 14, 22, 3, 75, 14, 22, 3, 226, 229, 14, 22, 3, 224,
+ 240, 14, 22, 3, 149, 14, 22, 3, 197, 14, 22, 3, 218, 99, 14, 22, 3, 69,
+ 14, 22, 3, 215, 79, 14, 22, 3, 214, 82, 14, 22, 3, 213, 166, 14, 22, 3,
+ 213, 105, 14, 22, 3, 212, 152, 14, 32, 6, 61, 14, 32, 6, 253, 74, 14, 32,
+ 6, 250, 252, 14, 32, 6, 249, 3, 14, 32, 6, 74, 14, 32, 6, 244, 230, 14,
+ 32, 6, 243, 177, 14, 32, 6, 242, 41, 14, 32, 6, 72, 14, 32, 6, 235, 142,
+ 14, 32, 6, 235, 27, 14, 32, 6, 150, 14, 32, 6, 183, 14, 32, 6, 204, 14,
+ 32, 6, 75, 14, 32, 6, 226, 229, 14, 32, 6, 224, 240, 14, 32, 6, 149, 14,
+ 32, 6, 197, 14, 32, 6, 218, 99, 14, 32, 6, 69, 14, 32, 6, 215, 79, 14,
+ 32, 6, 214, 82, 14, 32, 6, 213, 166, 14, 32, 6, 213, 105, 14, 32, 6, 212,
+ 152, 14, 32, 3, 61, 14, 32, 3, 253, 74, 14, 32, 3, 250, 252, 14, 32, 3,
+ 249, 3, 14, 32, 3, 74, 14, 32, 3, 244, 230, 14, 32, 3, 243, 177, 14, 32,
+ 3, 72, 14, 32, 3, 235, 142, 14, 32, 3, 235, 27, 14, 32, 3, 150, 14, 32,
+ 3, 183, 14, 32, 3, 204, 14, 32, 3, 75, 14, 32, 3, 226, 229, 14, 32, 3,
+ 224, 240, 14, 32, 3, 149, 14, 32, 3, 197, 14, 32, 3, 218, 99, 14, 32, 3,
+ 69, 14, 32, 3, 215, 79, 14, 32, 3, 214, 82, 14, 32, 3, 213, 166, 14, 32,
+ 3, 213, 105, 14, 32, 3, 212, 152, 14, 22, 32, 6, 61, 14, 22, 32, 6, 253,
+ 74, 14, 22, 32, 6, 250, 252, 14, 22, 32, 6, 249, 3, 14, 22, 32, 6, 74,
+ 14, 22, 32, 6, 244, 230, 14, 22, 32, 6, 243, 177, 14, 22, 32, 6, 242, 41,
+ 14, 22, 32, 6, 72, 14, 22, 32, 6, 235, 142, 14, 22, 32, 6, 235, 27, 14,
+ 22, 32, 6, 150, 14, 22, 32, 6, 183, 14, 22, 32, 6, 204, 14, 22, 32, 6,
+ 75, 14, 22, 32, 6, 226, 229, 14, 22, 32, 6, 224, 240, 14, 22, 32, 6, 149,
+ 14, 22, 32, 6, 197, 14, 22, 32, 6, 218, 99, 14, 22, 32, 6, 69, 14, 22,
+ 32, 6, 215, 79, 14, 22, 32, 6, 214, 82, 14, 22, 32, 6, 213, 166, 14, 22,
+ 32, 6, 213, 105, 14, 22, 32, 6, 212, 152, 14, 22, 32, 3, 61, 14, 22, 32,
+ 3, 253, 74, 14, 22, 32, 3, 250, 252, 14, 22, 32, 3, 249, 3, 14, 22, 32,
+ 3, 74, 14, 22, 32, 3, 244, 230, 14, 22, 32, 3, 243, 177, 14, 22, 32, 3,
+ 242, 41, 14, 22, 32, 3, 72, 14, 22, 32, 3, 235, 142, 14, 22, 32, 3, 235,
+ 27, 14, 22, 32, 3, 150, 14, 22, 32, 3, 183, 14, 22, 32, 3, 204, 14, 22,
+ 32, 3, 75, 14, 22, 32, 3, 226, 229, 14, 22, 32, 3, 224, 240, 14, 22, 32,
+ 3, 149, 14, 22, 32, 3, 197, 14, 22, 32, 3, 218, 99, 14, 22, 32, 3, 69,
+ 14, 22, 32, 3, 215, 79, 14, 22, 32, 3, 214, 82, 14, 22, 32, 3, 213, 166,
+ 14, 22, 32, 3, 213, 105, 14, 22, 32, 3, 212, 152, 14, 113, 6, 61, 14,
+ 113, 6, 250, 252, 14, 113, 6, 249, 3, 14, 113, 6, 243, 177, 14, 113, 6,
+ 235, 142, 14, 113, 6, 235, 27, 14, 113, 6, 204, 14, 113, 6, 75, 14, 113,
+ 6, 226, 229, 14, 113, 6, 224, 240, 14, 113, 6, 197, 14, 113, 6, 218, 99,
+ 14, 113, 6, 69, 14, 113, 6, 215, 79, 14, 113, 6, 214, 82, 14, 113, 6,
+ 213, 166, 14, 113, 6, 213, 105, 14, 113, 6, 212, 152, 14, 113, 3, 61, 14,
+ 113, 3, 253, 74, 14, 113, 3, 250, 252, 14, 113, 3, 249, 3, 14, 113, 3,
+ 244, 230, 14, 113, 3, 242, 41, 14, 113, 3, 72, 14, 113, 3, 235, 142, 14,
+ 113, 3, 235, 27, 14, 113, 3, 150, 14, 113, 3, 183, 14, 113, 3, 204, 14,
+ 113, 3, 226, 229, 14, 113, 3, 224, 240, 14, 113, 3, 149, 14, 113, 3, 197,
+ 14, 113, 3, 218, 99, 14, 113, 3, 69, 14, 113, 3, 215, 79, 14, 113, 3,
+ 214, 82, 14, 113, 3, 213, 166, 14, 113, 3, 213, 105, 14, 113, 3, 212,
+ 152, 14, 22, 113, 6, 61, 14, 22, 113, 6, 253, 74, 14, 22, 113, 6, 250,
+ 252, 14, 22, 113, 6, 249, 3, 14, 22, 113, 6, 74, 14, 22, 113, 6, 244,
+ 230, 14, 22, 113, 6, 243, 177, 14, 22, 113, 6, 242, 41, 14, 22, 113, 6,
+ 72, 14, 22, 113, 6, 235, 142, 14, 22, 113, 6, 235, 27, 14, 22, 113, 6,
+ 150, 14, 22, 113, 6, 183, 14, 22, 113, 6, 204, 14, 22, 113, 6, 75, 14,
+ 22, 113, 6, 226, 229, 14, 22, 113, 6, 224, 240, 14, 22, 113, 6, 149, 14,
+ 22, 113, 6, 197, 14, 22, 113, 6, 218, 99, 14, 22, 113, 6, 69, 14, 22,
+ 113, 6, 215, 79, 14, 22, 113, 6, 214, 82, 14, 22, 113, 6, 213, 166, 14,
+ 22, 113, 6, 213, 105, 14, 22, 113, 6, 212, 152, 14, 22, 113, 3, 61, 14,
+ 22, 113, 3, 253, 74, 14, 22, 113, 3, 250, 252, 14, 22, 113, 3, 249, 3,
+ 14, 22, 113, 3, 74, 14, 22, 113, 3, 244, 230, 14, 22, 113, 3, 243, 177,
+ 14, 22, 113, 3, 242, 41, 14, 22, 113, 3, 72, 14, 22, 113, 3, 235, 142,
+ 14, 22, 113, 3, 235, 27, 14, 22, 113, 3, 150, 14, 22, 113, 3, 183, 14,
+ 22, 113, 3, 204, 14, 22, 113, 3, 75, 14, 22, 113, 3, 226, 229, 14, 22,
+ 113, 3, 224, 240, 14, 22, 113, 3, 149, 14, 22, 113, 3, 197, 14, 22, 113,
+ 3, 218, 99, 14, 22, 113, 3, 69, 14, 22, 113, 3, 215, 79, 14, 22, 113, 3,
+ 214, 82, 14, 22, 113, 3, 213, 166, 14, 22, 113, 3, 213, 105, 14, 22, 113,
+ 3, 212, 152, 14, 129, 6, 61, 14, 129, 6, 253, 74, 14, 129, 6, 249, 3, 14,
+ 129, 6, 74, 14, 129, 6, 244, 230, 14, 129, 6, 243, 177, 14, 129, 6, 235,
+ 142, 14, 129, 6, 235, 27, 14, 129, 6, 150, 14, 129, 6, 183, 14, 129, 6,
+ 204, 14, 129, 6, 75, 14, 129, 6, 226, 229, 14, 129, 6, 224, 240, 14, 129,
+ 6, 197, 14, 129, 6, 218, 99, 14, 129, 6, 69, 14, 129, 6, 215, 79, 14,
+ 129, 6, 214, 82, 14, 129, 6, 213, 166, 14, 129, 6, 213, 105, 14, 129, 3,
+ 61, 14, 129, 3, 253, 74, 14, 129, 3, 250, 252, 14, 129, 3, 249, 3, 14,
+ 129, 3, 74, 14, 129, 3, 244, 230, 14, 129, 3, 243, 177, 14, 129, 3, 242,
+ 41, 14, 129, 3, 72, 14, 129, 3, 235, 142, 14, 129, 3, 235, 27, 14, 129,
+ 3, 150, 14, 129, 3, 183, 14, 129, 3, 204, 14, 129, 3, 75, 14, 129, 3,
+ 226, 229, 14, 129, 3, 224, 240, 14, 129, 3, 149, 14, 129, 3, 197, 14,
+ 129, 3, 218, 99, 14, 129, 3, 69, 14, 129, 3, 215, 79, 14, 129, 3, 214,
+ 82, 14, 129, 3, 213, 166, 14, 129, 3, 213, 105, 14, 129, 3, 212, 152, 14,
+ 187, 6, 61, 14, 187, 6, 253, 74, 14, 187, 6, 249, 3, 14, 187, 6, 74, 14,
+ 187, 6, 244, 230, 14, 187, 6, 243, 177, 14, 187, 6, 72, 14, 187, 6, 235,
+ 142, 14, 187, 6, 235, 27, 14, 187, 6, 150, 14, 187, 6, 183, 14, 187, 6,
+ 75, 14, 187, 6, 197, 14, 187, 6, 218, 99, 14, 187, 6, 69, 14, 187, 6,
+ 215, 79, 14, 187, 6, 214, 82, 14, 187, 6, 213, 166, 14, 187, 6, 213, 105,
+ 14, 187, 3, 61, 14, 187, 3, 253, 74, 14, 187, 3, 250, 252, 14, 187, 3,
+ 249, 3, 14, 187, 3, 74, 14, 187, 3, 244, 230, 14, 187, 3, 243, 177, 14,
+ 187, 3, 242, 41, 14, 187, 3, 72, 14, 187, 3, 235, 142, 14, 187, 3, 235,
+ 27, 14, 187, 3, 150, 14, 187, 3, 183, 14, 187, 3, 204, 14, 187, 3, 75,
+ 14, 187, 3, 226, 229, 14, 187, 3, 224, 240, 14, 187, 3, 149, 14, 187, 3,
+ 197, 14, 187, 3, 218, 99, 14, 187, 3, 69, 14, 187, 3, 215, 79, 14, 187,
+ 3, 214, 82, 14, 187, 3, 213, 166, 14, 187, 3, 213, 105, 14, 187, 3, 212,
+ 152, 14, 22, 129, 6, 61, 14, 22, 129, 6, 253, 74, 14, 22, 129, 6, 250,
+ 252, 14, 22, 129, 6, 249, 3, 14, 22, 129, 6, 74, 14, 22, 129, 6, 244,
+ 230, 14, 22, 129, 6, 243, 177, 14, 22, 129, 6, 242, 41, 14, 22, 129, 6,
+ 72, 14, 22, 129, 6, 235, 142, 14, 22, 129, 6, 235, 27, 14, 22, 129, 6,
+ 150, 14, 22, 129, 6, 183, 14, 22, 129, 6, 204, 14, 22, 129, 6, 75, 14,
+ 22, 129, 6, 226, 229, 14, 22, 129, 6, 224, 240, 14, 22, 129, 6, 149, 14,
+ 22, 129, 6, 197, 14, 22, 129, 6, 218, 99, 14, 22, 129, 6, 69, 14, 22,
+ 129, 6, 215, 79, 14, 22, 129, 6, 214, 82, 14, 22, 129, 6, 213, 166, 14,
+ 22, 129, 6, 213, 105, 14, 22, 129, 6, 212, 152, 14, 22, 129, 3, 61, 14,
+ 22, 129, 3, 253, 74, 14, 22, 129, 3, 250, 252, 14, 22, 129, 3, 249, 3,
+ 14, 22, 129, 3, 74, 14, 22, 129, 3, 244, 230, 14, 22, 129, 3, 243, 177,
+ 14, 22, 129, 3, 242, 41, 14, 22, 129, 3, 72, 14, 22, 129, 3, 235, 142,
+ 14, 22, 129, 3, 235, 27, 14, 22, 129, 3, 150, 14, 22, 129, 3, 183, 14,
+ 22, 129, 3, 204, 14, 22, 129, 3, 75, 14, 22, 129, 3, 226, 229, 14, 22,
+ 129, 3, 224, 240, 14, 22, 129, 3, 149, 14, 22, 129, 3, 197, 14, 22, 129,
+ 3, 218, 99, 14, 22, 129, 3, 69, 14, 22, 129, 3, 215, 79, 14, 22, 129, 3,
+ 214, 82, 14, 22, 129, 3, 213, 166, 14, 22, 129, 3, 213, 105, 14, 22, 129,
+ 3, 212, 152, 14, 35, 6, 61, 14, 35, 6, 253, 74, 14, 35, 6, 250, 252, 14,
+ 35, 6, 249, 3, 14, 35, 6, 74, 14, 35, 6, 244, 230, 14, 35, 6, 243, 177,
+ 14, 35, 6, 242, 41, 14, 35, 6, 72, 14, 35, 6, 235, 142, 14, 35, 6, 235,
+ 27, 14, 35, 6, 150, 14, 35, 6, 183, 14, 35, 6, 204, 14, 35, 6, 75, 14,
+ 35, 6, 226, 229, 14, 35, 6, 224, 240, 14, 35, 6, 149, 14, 35, 6, 197, 14,
+ 35, 6, 218, 99, 14, 35, 6, 69, 14, 35, 6, 215, 79, 14, 35, 6, 214, 82,
+ 14, 35, 6, 213, 166, 14, 35, 6, 213, 105, 14, 35, 6, 212, 152, 14, 35, 3,
+ 61, 14, 35, 3, 253, 74, 14, 35, 3, 250, 252, 14, 35, 3, 249, 3, 14, 35,
+ 3, 74, 14, 35, 3, 244, 230, 14, 35, 3, 243, 177, 14, 35, 3, 242, 41, 14,
+ 35, 3, 72, 14, 35, 3, 235, 142, 14, 35, 3, 235, 27, 14, 35, 3, 150, 14,
+ 35, 3, 183, 14, 35, 3, 204, 14, 35, 3, 75, 14, 35, 3, 226, 229, 14, 35,
+ 3, 224, 240, 14, 35, 3, 149, 14, 35, 3, 197, 14, 35, 3, 218, 99, 14, 35,
+ 3, 69, 14, 35, 3, 215, 79, 14, 35, 3, 214, 82, 14, 35, 3, 213, 166, 14,
+ 35, 3, 213, 105, 14, 35, 3, 212, 152, 14, 35, 22, 6, 61, 14, 35, 22, 6,
+ 253, 74, 14, 35, 22, 6, 250, 252, 14, 35, 22, 6, 249, 3, 14, 35, 22, 6,
+ 74, 14, 35, 22, 6, 244, 230, 14, 35, 22, 6, 243, 177, 14, 35, 22, 6, 242,
+ 41, 14, 35, 22, 6, 72, 14, 35, 22, 6, 235, 142, 14, 35, 22, 6, 235, 27,
+ 14, 35, 22, 6, 150, 14, 35, 22, 6, 183, 14, 35, 22, 6, 204, 14, 35, 22,
+ 6, 75, 14, 35, 22, 6, 226, 229, 14, 35, 22, 6, 224, 240, 14, 35, 22, 6,
+ 149, 14, 35, 22, 6, 197, 14, 35, 22, 6, 218, 99, 14, 35, 22, 6, 69, 14,
+ 35, 22, 6, 215, 79, 14, 35, 22, 6, 214, 82, 14, 35, 22, 6, 213, 166, 14,
+ 35, 22, 6, 213, 105, 14, 35, 22, 6, 212, 152, 14, 35, 22, 3, 61, 14, 35,
+ 22, 3, 253, 74, 14, 35, 22, 3, 250, 252, 14, 35, 22, 3, 249, 3, 14, 35,
+ 22, 3, 74, 14, 35, 22, 3, 244, 230, 14, 35, 22, 3, 243, 177, 14, 35, 22,
+ 3, 242, 41, 14, 35, 22, 3, 72, 14, 35, 22, 3, 235, 142, 14, 35, 22, 3,
+ 235, 27, 14, 35, 22, 3, 150, 14, 35, 22, 3, 183, 14, 35, 22, 3, 204, 14,
+ 35, 22, 3, 75, 14, 35, 22, 3, 226, 229, 14, 35, 22, 3, 224, 240, 14, 35,
+ 22, 3, 149, 14, 35, 22, 3, 197, 14, 35, 22, 3, 218, 99, 14, 35, 22, 3,
+ 69, 14, 35, 22, 3, 215, 79, 14, 35, 22, 3, 214, 82, 14, 35, 22, 3, 213,
+ 166, 14, 35, 22, 3, 213, 105, 14, 35, 22, 3, 212, 152, 14, 35, 32, 6, 61,
+ 14, 35, 32, 6, 253, 74, 14, 35, 32, 6, 250, 252, 14, 35, 32, 6, 249, 3,
+ 14, 35, 32, 6, 74, 14, 35, 32, 6, 244, 230, 14, 35, 32, 6, 243, 177, 14,
+ 35, 32, 6, 242, 41, 14, 35, 32, 6, 72, 14, 35, 32, 6, 235, 142, 14, 35,
+ 32, 6, 235, 27, 14, 35, 32, 6, 150, 14, 35, 32, 6, 183, 14, 35, 32, 6,
+ 204, 14, 35, 32, 6, 75, 14, 35, 32, 6, 226, 229, 14, 35, 32, 6, 224, 240,
+ 14, 35, 32, 6, 149, 14, 35, 32, 6, 197, 14, 35, 32, 6, 218, 99, 14, 35,
+ 32, 6, 69, 14, 35, 32, 6, 215, 79, 14, 35, 32, 6, 214, 82, 14, 35, 32, 6,
+ 213, 166, 14, 35, 32, 6, 213, 105, 14, 35, 32, 6, 212, 152, 14, 35, 32,
+ 3, 61, 14, 35, 32, 3, 253, 74, 14, 35, 32, 3, 250, 252, 14, 35, 32, 3,
+ 249, 3, 14, 35, 32, 3, 74, 14, 35, 32, 3, 244, 230, 14, 35, 32, 3, 243,
+ 177, 14, 35, 32, 3, 242, 41, 14, 35, 32, 3, 72, 14, 35, 32, 3, 235, 142,
+ 14, 35, 32, 3, 235, 27, 14, 35, 32, 3, 150, 14, 35, 32, 3, 183, 14, 35,
+ 32, 3, 204, 14, 35, 32, 3, 75, 14, 35, 32, 3, 226, 229, 14, 35, 32, 3,
+ 224, 240, 14, 35, 32, 3, 149, 14, 35, 32, 3, 197, 14, 35, 32, 3, 218, 99,
+ 14, 35, 32, 3, 69, 14, 35, 32, 3, 215, 79, 14, 35, 32, 3, 214, 82, 14,
+ 35, 32, 3, 213, 166, 14, 35, 32, 3, 213, 105, 14, 35, 32, 3, 212, 152,
+ 14, 35, 22, 32, 6, 61, 14, 35, 22, 32, 6, 253, 74, 14, 35, 22, 32, 6,
+ 250, 252, 14, 35, 22, 32, 6, 249, 3, 14, 35, 22, 32, 6, 74, 14, 35, 22,
+ 32, 6, 244, 230, 14, 35, 22, 32, 6, 243, 177, 14, 35, 22, 32, 6, 242, 41,
+ 14, 35, 22, 32, 6, 72, 14, 35, 22, 32, 6, 235, 142, 14, 35, 22, 32, 6,
+ 235, 27, 14, 35, 22, 32, 6, 150, 14, 35, 22, 32, 6, 183, 14, 35, 22, 32,
+ 6, 204, 14, 35, 22, 32, 6, 75, 14, 35, 22, 32, 6, 226, 229, 14, 35, 22,
+ 32, 6, 224, 240, 14, 35, 22, 32, 6, 149, 14, 35, 22, 32, 6, 197, 14, 35,
+ 22, 32, 6, 218, 99, 14, 35, 22, 32, 6, 69, 14, 35, 22, 32, 6, 215, 79,
+ 14, 35, 22, 32, 6, 214, 82, 14, 35, 22, 32, 6, 213, 166, 14, 35, 22, 32,
+ 6, 213, 105, 14, 35, 22, 32, 6, 212, 152, 14, 35, 22, 32, 3, 61, 14, 35,
+ 22, 32, 3, 253, 74, 14, 35, 22, 32, 3, 250, 252, 14, 35, 22, 32, 3, 249,
+ 3, 14, 35, 22, 32, 3, 74, 14, 35, 22, 32, 3, 244, 230, 14, 35, 22, 32, 3,
+ 243, 177, 14, 35, 22, 32, 3, 242, 41, 14, 35, 22, 32, 3, 72, 14, 35, 22,
+ 32, 3, 235, 142, 14, 35, 22, 32, 3, 235, 27, 14, 35, 22, 32, 3, 150, 14,
+ 35, 22, 32, 3, 183, 14, 35, 22, 32, 3, 204, 14, 35, 22, 32, 3, 75, 14,
+ 35, 22, 32, 3, 226, 229, 14, 35, 22, 32, 3, 224, 240, 14, 35, 22, 32, 3,
+ 149, 14, 35, 22, 32, 3, 197, 14, 35, 22, 32, 3, 218, 99, 14, 35, 22, 32,
+ 3, 69, 14, 35, 22, 32, 3, 215, 79, 14, 35, 22, 32, 3, 214, 82, 14, 35,
+ 22, 32, 3, 213, 166, 14, 35, 22, 32, 3, 213, 105, 14, 35, 22, 32, 3, 212,
+ 152, 14, 230, 208, 6, 61, 14, 230, 208, 6, 253, 74, 14, 230, 208, 6, 250,
+ 252, 14, 230, 208, 6, 249, 3, 14, 230, 208, 6, 74, 14, 230, 208, 6, 244,
+ 230, 14, 230, 208, 6, 243, 177, 14, 230, 208, 6, 242, 41, 14, 230, 208,
+ 6, 72, 14, 230, 208, 6, 235, 142, 14, 230, 208, 6, 235, 27, 14, 230, 208,
+ 6, 150, 14, 230, 208, 6, 183, 14, 230, 208, 6, 204, 14, 230, 208, 6, 75,
+ 14, 230, 208, 6, 226, 229, 14, 230, 208, 6, 224, 240, 14, 230, 208, 6,
+ 149, 14, 230, 208, 6, 197, 14, 230, 208, 6, 218, 99, 14, 230, 208, 6, 69,
+ 14, 230, 208, 6, 215, 79, 14, 230, 208, 6, 214, 82, 14, 230, 208, 6, 213,
+ 166, 14, 230, 208, 6, 213, 105, 14, 230, 208, 6, 212, 152, 14, 230, 208,
+ 3, 61, 14, 230, 208, 3, 253, 74, 14, 230, 208, 3, 250, 252, 14, 230, 208,
+ 3, 249, 3, 14, 230, 208, 3, 74, 14, 230, 208, 3, 244, 230, 14, 230, 208,
+ 3, 243, 177, 14, 230, 208, 3, 242, 41, 14, 230, 208, 3, 72, 14, 230, 208,
+ 3, 235, 142, 14, 230, 208, 3, 235, 27, 14, 230, 208, 3, 150, 14, 230,
+ 208, 3, 183, 14, 230, 208, 3, 204, 14, 230, 208, 3, 75, 14, 230, 208, 3,
+ 226, 229, 14, 230, 208, 3, 224, 240, 14, 230, 208, 3, 149, 14, 230, 208,
+ 3, 197, 14, 230, 208, 3, 218, 99, 14, 230, 208, 3, 69, 14, 230, 208, 3,
+ 215, 79, 14, 230, 208, 3, 214, 82, 14, 230, 208, 3, 213, 166, 14, 230,
+ 208, 3, 213, 105, 14, 230, 208, 3, 212, 152, 14, 32, 3, 247, 73, 72, 14,
+ 32, 3, 247, 73, 235, 142, 14, 22, 6, 254, 52, 14, 22, 6, 251, 203, 14,
+ 22, 6, 243, 83, 14, 22, 6, 248, 5, 14, 22, 6, 245, 63, 14, 22, 6, 212,
+ 78, 14, 22, 6, 245, 28, 14, 22, 6, 217, 132, 14, 22, 6, 235, 183, 14, 22,
+ 6, 234, 227, 14, 22, 6, 233, 122, 14, 22, 6, 230, 172, 14, 22, 6, 228,
+ 92, 14, 22, 6, 213, 145, 14, 22, 6, 227, 65, 14, 22, 6, 225, 240, 14, 22,
+ 6, 223, 190, 14, 22, 6, 217, 133, 87, 14, 22, 6, 220, 103, 14, 22, 6,
+ 217, 248, 14, 22, 6, 215, 128, 14, 22, 6, 226, 9, 14, 22, 6, 250, 47, 14,
+ 22, 6, 225, 46, 14, 22, 6, 227, 67, 14, 22, 230, 39, 14, 22, 3, 254, 52,
+ 14, 22, 3, 251, 203, 14, 22, 3, 243, 83, 14, 22, 3, 248, 5, 14, 22, 3,
+ 245, 63, 14, 22, 3, 212, 78, 14, 22, 3, 245, 28, 14, 22, 3, 217, 132, 14,
+ 22, 3, 235, 183, 14, 22, 3, 234, 227, 14, 22, 3, 233, 122, 14, 22, 3,
+ 230, 172, 14, 22, 3, 228, 92, 14, 22, 3, 213, 145, 14, 22, 3, 227, 65,
+ 14, 22, 3, 225, 240, 14, 22, 3, 223, 190, 14, 22, 3, 40, 220, 103, 14,
+ 22, 3, 220, 103, 14, 22, 3, 217, 248, 14, 22, 3, 215, 128, 14, 22, 3,
+ 226, 9, 14, 22, 3, 250, 47, 14, 22, 3, 225, 46, 14, 22, 3, 227, 67, 14,
+ 22, 226, 125, 247, 185, 14, 22, 245, 64, 87, 14, 22, 217, 133, 87, 14,
+ 22, 234, 228, 87, 14, 22, 226, 10, 87, 14, 22, 223, 191, 87, 14, 22, 225,
+ 241, 87, 14, 32, 6, 254, 52, 14, 32, 6, 251, 203, 14, 32, 6, 243, 83, 14,
+ 32, 6, 248, 5, 14, 32, 6, 245, 63, 14, 32, 6, 212, 78, 14, 32, 6, 245,
+ 28, 14, 32, 6, 217, 132, 14, 32, 6, 235, 183, 14, 32, 6, 234, 227, 14,
+ 32, 6, 233, 122, 14, 32, 6, 230, 172, 14, 32, 6, 228, 92, 14, 32, 6, 213,
+ 145, 14, 32, 6, 227, 65, 14, 32, 6, 225, 240, 14, 32, 6, 223, 190, 14,
+ 32, 6, 217, 133, 87, 14, 32, 6, 220, 103, 14, 32, 6, 217, 248, 14, 32, 6,
+ 215, 128, 14, 32, 6, 226, 9, 14, 32, 6, 250, 47, 14, 32, 6, 225, 46, 14,
+ 32, 6, 227, 67, 14, 32, 230, 39, 14, 32, 3, 254, 52, 14, 32, 3, 251, 203,
+ 14, 32, 3, 243, 83, 14, 32, 3, 248, 5, 14, 32, 3, 245, 63, 14, 32, 3,
+ 212, 78, 14, 32, 3, 245, 28, 14, 32, 3, 217, 132, 14, 32, 3, 235, 183,
+ 14, 32, 3, 234, 227, 14, 32, 3, 233, 122, 14, 32, 3, 230, 172, 14, 32, 3,
+ 228, 92, 14, 32, 3, 213, 145, 14, 32, 3, 227, 65, 14, 32, 3, 225, 240,
+ 14, 32, 3, 223, 190, 14, 32, 3, 40, 220, 103, 14, 32, 3, 220, 103, 14,
+ 32, 3, 217, 248, 14, 32, 3, 215, 128, 14, 32, 3, 226, 9, 14, 32, 3, 250,
+ 47, 14, 32, 3, 225, 46, 14, 32, 3, 227, 67, 14, 32, 226, 125, 247, 185,
+ 14, 32, 245, 64, 87, 14, 32, 217, 133, 87, 14, 32, 234, 228, 87, 14, 32,
+ 226, 10, 87, 14, 32, 223, 191, 87, 14, 32, 225, 241, 87, 14, 22, 32, 6,
+ 254, 52, 14, 22, 32, 6, 251, 203, 14, 22, 32, 6, 243, 83, 14, 22, 32, 6,
+ 248, 5, 14, 22, 32, 6, 245, 63, 14, 22, 32, 6, 212, 78, 14, 22, 32, 6,
+ 245, 28, 14, 22, 32, 6, 217, 132, 14, 22, 32, 6, 235, 183, 14, 22, 32, 6,
+ 234, 227, 14, 22, 32, 6, 233, 122, 14, 22, 32, 6, 230, 172, 14, 22, 32,
+ 6, 228, 92, 14, 22, 32, 6, 213, 145, 14, 22, 32, 6, 227, 65, 14, 22, 32,
+ 6, 225, 240, 14, 22, 32, 6, 223, 190, 14, 22, 32, 6, 217, 133, 87, 14,
+ 22, 32, 6, 220, 103, 14, 22, 32, 6, 217, 248, 14, 22, 32, 6, 215, 128,
+ 14, 22, 32, 6, 226, 9, 14, 22, 32, 6, 250, 47, 14, 22, 32, 6, 225, 46,
+ 14, 22, 32, 6, 227, 67, 14, 22, 32, 230, 39, 14, 22, 32, 3, 254, 52, 14,
+ 22, 32, 3, 251, 203, 14, 22, 32, 3, 243, 83, 14, 22, 32, 3, 248, 5, 14,
+ 22, 32, 3, 245, 63, 14, 22, 32, 3, 212, 78, 14, 22, 32, 3, 245, 28, 14,
+ 22, 32, 3, 217, 132, 14, 22, 32, 3, 235, 183, 14, 22, 32, 3, 234, 227,
+ 14, 22, 32, 3, 233, 122, 14, 22, 32, 3, 230, 172, 14, 22, 32, 3, 228, 92,
+ 14, 22, 32, 3, 213, 145, 14, 22, 32, 3, 227, 65, 14, 22, 32, 3, 225, 240,
+ 14, 22, 32, 3, 223, 190, 14, 22, 32, 3, 40, 220, 103, 14, 22, 32, 3, 220,
+ 103, 14, 22, 32, 3, 217, 248, 14, 22, 32, 3, 215, 128, 14, 22, 32, 3,
+ 226, 9, 14, 22, 32, 3, 250, 47, 14, 22, 32, 3, 225, 46, 14, 22, 32, 3,
+ 227, 67, 14, 22, 32, 226, 125, 247, 185, 14, 22, 32, 245, 64, 87, 14, 22,
+ 32, 217, 133, 87, 14, 22, 32, 234, 228, 87, 14, 22, 32, 226, 10, 87, 14,
+ 22, 32, 223, 191, 87, 14, 22, 32, 225, 241, 87, 14, 35, 22, 6, 254, 52,
+ 14, 35, 22, 6, 251, 203, 14, 35, 22, 6, 243, 83, 14, 35, 22, 6, 248, 5,
+ 14, 35, 22, 6, 245, 63, 14, 35, 22, 6, 212, 78, 14, 35, 22, 6, 245, 28,
+ 14, 35, 22, 6, 217, 132, 14, 35, 22, 6, 235, 183, 14, 35, 22, 6, 234,
+ 227, 14, 35, 22, 6, 233, 122, 14, 35, 22, 6, 230, 172, 14, 35, 22, 6,
+ 228, 92, 14, 35, 22, 6, 213, 145, 14, 35, 22, 6, 227, 65, 14, 35, 22, 6,
+ 225, 240, 14, 35, 22, 6, 223, 190, 14, 35, 22, 6, 217, 133, 87, 14, 35,
+ 22, 6, 220, 103, 14, 35, 22, 6, 217, 248, 14, 35, 22, 6, 215, 128, 14,
+ 35, 22, 6, 226, 9, 14, 35, 22, 6, 250, 47, 14, 35, 22, 6, 225, 46, 14,
+ 35, 22, 6, 227, 67, 14, 35, 22, 230, 39, 14, 35, 22, 3, 254, 52, 14, 35,
+ 22, 3, 251, 203, 14, 35, 22, 3, 243, 83, 14, 35, 22, 3, 248, 5, 14, 35,
+ 22, 3, 245, 63, 14, 35, 22, 3, 212, 78, 14, 35, 22, 3, 245, 28, 14, 35,
+ 22, 3, 217, 132, 14, 35, 22, 3, 235, 183, 14, 35, 22, 3, 234, 227, 14,
+ 35, 22, 3, 233, 122, 14, 35, 22, 3, 230, 172, 14, 35, 22, 3, 228, 92, 14,
+ 35, 22, 3, 213, 145, 14, 35, 22, 3, 227, 65, 14, 35, 22, 3, 225, 240, 14,
+ 35, 22, 3, 223, 190, 14, 35, 22, 3, 40, 220, 103, 14, 35, 22, 3, 220,
+ 103, 14, 35, 22, 3, 217, 248, 14, 35, 22, 3, 215, 128, 14, 35, 22, 3,
+ 226, 9, 14, 35, 22, 3, 250, 47, 14, 35, 22, 3, 225, 46, 14, 35, 22, 3,
+ 227, 67, 14, 35, 22, 226, 125, 247, 185, 14, 35, 22, 245, 64, 87, 14, 35,
+ 22, 217, 133, 87, 14, 35, 22, 234, 228, 87, 14, 35, 22, 226, 10, 87, 14,
+ 35, 22, 223, 191, 87, 14, 35, 22, 225, 241, 87, 14, 35, 22, 32, 6, 254,
+ 52, 14, 35, 22, 32, 6, 251, 203, 14, 35, 22, 32, 6, 243, 83, 14, 35, 22,
+ 32, 6, 248, 5, 14, 35, 22, 32, 6, 245, 63, 14, 35, 22, 32, 6, 212, 78,
+ 14, 35, 22, 32, 6, 245, 28, 14, 35, 22, 32, 6, 217, 132, 14, 35, 22, 32,
+ 6, 235, 183, 14, 35, 22, 32, 6, 234, 227, 14, 35, 22, 32, 6, 233, 122,
+ 14, 35, 22, 32, 6, 230, 172, 14, 35, 22, 32, 6, 228, 92, 14, 35, 22, 32,
+ 6, 213, 145, 14, 35, 22, 32, 6, 227, 65, 14, 35, 22, 32, 6, 225, 240, 14,
+ 35, 22, 32, 6, 223, 190, 14, 35, 22, 32, 6, 217, 133, 87, 14, 35, 22, 32,
+ 6, 220, 103, 14, 35, 22, 32, 6, 217, 248, 14, 35, 22, 32, 6, 215, 128,
+ 14, 35, 22, 32, 6, 226, 9, 14, 35, 22, 32, 6, 250, 47, 14, 35, 22, 32, 6,
+ 225, 46, 14, 35, 22, 32, 6, 227, 67, 14, 35, 22, 32, 230, 39, 14, 35, 22,
+ 32, 3, 254, 52, 14, 35, 22, 32, 3, 251, 203, 14, 35, 22, 32, 3, 243, 83,
+ 14, 35, 22, 32, 3, 248, 5, 14, 35, 22, 32, 3, 245, 63, 14, 35, 22, 32, 3,
+ 212, 78, 14, 35, 22, 32, 3, 245, 28, 14, 35, 22, 32, 3, 217, 132, 14, 35,
+ 22, 32, 3, 235, 183, 14, 35, 22, 32, 3, 234, 227, 14, 35, 22, 32, 3, 233,
+ 122, 14, 35, 22, 32, 3, 230, 172, 14, 35, 22, 32, 3, 228, 92, 14, 35, 22,
+ 32, 3, 213, 145, 14, 35, 22, 32, 3, 227, 65, 14, 35, 22, 32, 3, 225, 240,
+ 14, 35, 22, 32, 3, 223, 190, 14, 35, 22, 32, 3, 40, 220, 103, 14, 35, 22,
+ 32, 3, 220, 103, 14, 35, 22, 32, 3, 217, 248, 14, 35, 22, 32, 3, 215,
+ 128, 14, 35, 22, 32, 3, 226, 9, 14, 35, 22, 32, 3, 250, 47, 14, 35, 22,
+ 32, 3, 225, 46, 14, 35, 22, 32, 3, 227, 67, 14, 35, 22, 32, 226, 125,
+ 247, 185, 14, 35, 22, 32, 245, 64, 87, 14, 35, 22, 32, 217, 133, 87, 14,
+ 35, 22, 32, 234, 228, 87, 14, 35, 22, 32, 226, 10, 87, 14, 35, 22, 32,
+ 223, 191, 87, 14, 35, 22, 32, 225, 241, 87, 14, 22, 6, 247, 179, 14, 22,
+ 3, 247, 179, 14, 22, 21, 212, 79, 14, 22, 21, 116, 14, 22, 21, 109, 14,
+ 22, 21, 166, 14, 22, 21, 163, 14, 22, 21, 180, 14, 22, 21, 189, 14, 22,
+ 21, 198, 14, 22, 21, 195, 14, 22, 21, 200, 14, 187, 21, 212, 79, 14, 187,
+ 21, 116, 14, 187, 21, 109, 14, 187, 21, 166, 14, 187, 21, 163, 14, 187,
+ 21, 180, 14, 187, 21, 189, 14, 187, 21, 198, 14, 187, 21, 195, 14, 187,
+ 21, 200, 14, 35, 21, 212, 79, 14, 35, 21, 116, 14, 35, 21, 109, 14, 35,
+ 21, 166, 14, 35, 21, 163, 14, 35, 21, 180, 14, 35, 21, 189, 14, 35, 21,
+ 198, 14, 35, 21, 195, 14, 35, 21, 200, 14, 35, 22, 21, 212, 79, 14, 35,
+ 22, 21, 116, 14, 35, 22, 21, 109, 14, 35, 22, 21, 166, 14, 35, 22, 21,
+ 163, 14, 35, 22, 21, 180, 14, 35, 22, 21, 189, 14, 35, 22, 21, 198, 14,
+ 35, 22, 21, 195, 14, 35, 22, 21, 200, 14, 230, 208, 21, 212, 79, 14, 230,
+ 208, 21, 116, 14, 230, 208, 21, 109, 14, 230, 208, 21, 166, 14, 230, 208,
+ 21, 163, 14, 230, 208, 21, 180, 14, 230, 208, 21, 189, 14, 230, 208, 21,
+ 198, 14, 230, 208, 21, 195, 14, 230, 208, 21, 200, 232, 10, 85, 245, 176,
+ 213, 224, 232, 10, 85, 219, 215, 213, 224, 232, 10, 85, 213, 250, 213,
+ 224, 232, 10, 85, 228, 167, 213, 224, 232, 10, 85, 224, 4, 246, 50, 232,
+ 10, 85, 242, 104, 246, 50, 232, 10, 85, 67, 246, 50, 232, 10, 85, 122,
+ 65, 250, 77, 232, 10, 85, 117, 65, 250, 77, 232, 10, 85, 133, 65, 250,
+ 77, 232, 10, 85, 243, 237, 65, 250, 77, 232, 10, 85, 244, 50, 65, 250,
+ 77, 232, 10, 85, 220, 53, 65, 250, 77, 232, 10, 85, 221, 43, 65, 250, 77,
+ 232, 10, 85, 245, 150, 65, 250, 77, 232, 10, 85, 229, 31, 65, 250, 77,
+ 232, 10, 85, 122, 65, 252, 72, 232, 10, 85, 117, 65, 252, 72, 232, 10,
+ 85, 133, 65, 252, 72, 232, 10, 85, 243, 237, 65, 252, 72, 232, 10, 85,
+ 244, 50, 65, 252, 72, 232, 10, 85, 220, 53, 65, 252, 72, 232, 10, 85,
+ 221, 43, 65, 252, 72, 232, 10, 85, 245, 150, 65, 252, 72, 232, 10, 85,
+ 229, 31, 65, 252, 72, 232, 10, 85, 122, 65, 249, 227, 232, 10, 85, 117,
+ 65, 249, 227, 232, 10, 85, 133, 65, 249, 227, 232, 10, 85, 243, 237, 65,
+ 249, 227, 232, 10, 85, 244, 50, 65, 249, 227, 232, 10, 85, 220, 53, 65,
+ 249, 227, 232, 10, 85, 221, 43, 65, 249, 227, 232, 10, 85, 245, 150, 65,
+ 249, 227, 232, 10, 85, 229, 31, 65, 249, 227, 232, 10, 85, 225, 159, 232,
+ 10, 85, 227, 22, 232, 10, 85, 252, 73, 232, 10, 85, 250, 7, 232, 10, 85,
+ 219, 171, 232, 10, 85, 218, 240, 232, 10, 85, 253, 95, 232, 10, 85, 213,
+ 217, 232, 10, 85, 235, 65, 232, 10, 85, 252, 101, 127, 85, 199, 252, 101,
+ 127, 85, 241, 30, 127, 85, 241, 29, 127, 85, 241, 28, 127, 85, 241, 27,
+ 127, 85, 241, 26, 127, 85, 241, 25, 127, 85, 241, 24, 127, 85, 241, 23,
+ 127, 85, 241, 22, 127, 85, 241, 21, 127, 85, 241, 20, 127, 85, 241, 19,
+ 127, 85, 241, 18, 127, 85, 241, 17, 127, 85, 241, 16, 127, 85, 241, 15,
+ 127, 85, 241, 14, 127, 85, 241, 13, 127, 85, 241, 12, 127, 85, 241, 11,
+ 127, 85, 241, 10, 127, 85, 241, 9, 127, 85, 241, 8, 127, 85, 241, 7, 127,
+ 85, 241, 6, 127, 85, 241, 5, 127, 85, 241, 4, 127, 85, 241, 3, 127, 85,
+ 241, 2, 127, 85, 241, 1, 127, 85, 241, 0, 127, 85, 240, 255, 127, 85,
+ 240, 254, 127, 85, 240, 253, 127, 85, 240, 252, 127, 85, 240, 251, 127,
+ 85, 240, 250, 127, 85, 240, 249, 127, 85, 240, 248, 127, 85, 240, 247,
+ 127, 85, 240, 246, 127, 85, 240, 245, 127, 85, 240, 244, 127, 85, 240,
+ 243, 127, 85, 240, 242, 127, 85, 240, 241, 127, 85, 240, 240, 127, 85,
+ 240, 239, 127, 85, 240, 238, 127, 85, 71, 252, 101, 127, 85, 214, 215,
+ 127, 85, 214, 214, 127, 85, 214, 213, 127, 85, 214, 212, 127, 85, 214,
+ 211, 127, 85, 214, 210, 127, 85, 214, 209, 127, 85, 214, 208, 127, 85,
+ 214, 207, 127, 85, 214, 206, 127, 85, 214, 205, 127, 85, 214, 204, 127,
+ 85, 214, 203, 127, 85, 214, 202, 127, 85, 214, 201, 127, 85, 214, 200,
+ 127, 85, 214, 199, 127, 85, 214, 198, 127, 85, 214, 197, 127, 85, 214,
+ 196, 127, 85, 214, 195, 127, 85, 214, 194, 127, 85, 214, 193, 127, 85,
+ 214, 192, 127, 85, 214, 191, 127, 85, 214, 190, 127, 85, 214, 189, 127,
+ 85, 214, 188, 127, 85, 214, 187, 127, 85, 214, 186, 127, 85, 214, 185,
+ 127, 85, 214, 184, 127, 85, 214, 183, 127, 85, 214, 182, 127, 85, 214,
+ 181, 127, 85, 214, 180, 127, 85, 214, 179, 127, 85, 214, 178, 127, 85,
+ 214, 177, 127, 85, 214, 176, 127, 85, 214, 175, 127, 85, 214, 174, 127,
+ 85, 214, 173, 127, 85, 214, 172, 127, 85, 214, 171, 127, 85, 214, 170,
+ 127, 85, 214, 169, 127, 85, 214, 168, 127, 85, 214, 167, 225, 165, 250,
+ 175, 252, 101, 225, 165, 250, 175, 254, 169, 65, 219, 203, 225, 165, 250,
+ 175, 117, 65, 219, 203, 225, 165, 250, 175, 133, 65, 219, 203, 225, 165,
+ 250, 175, 243, 237, 65, 219, 203, 225, 165, 250, 175, 244, 50, 65, 219,
+ 203, 225, 165, 250, 175, 220, 53, 65, 219, 203, 225, 165, 250, 175, 221,
+ 43, 65, 219, 203, 225, 165, 250, 175, 245, 150, 65, 219, 203, 225, 165,
+ 250, 175, 229, 31, 65, 219, 203, 225, 165, 250, 175, 217, 201, 65, 219,
+ 203, 225, 165, 250, 175, 235, 137, 65, 219, 203, 225, 165, 250, 175, 234,
+ 40, 65, 219, 203, 225, 165, 250, 175, 224, 160, 65, 219, 203, 225, 165,
+ 250, 175, 234, 88, 65, 219, 203, 225, 165, 250, 175, 254, 169, 65, 241,
+ 209, 225, 165, 250, 175, 117, 65, 241, 209, 225, 165, 250, 175, 133, 65,
+ 241, 209, 225, 165, 250, 175, 243, 237, 65, 241, 209, 225, 165, 250, 175,
+ 244, 50, 65, 241, 209, 225, 165, 250, 175, 220, 53, 65, 241, 209, 225,
+ 165, 250, 175, 221, 43, 65, 241, 209, 225, 165, 250, 175, 245, 150, 65,
+ 241, 209, 225, 165, 250, 175, 229, 31, 65, 241, 209, 225, 165, 250, 175,
+ 217, 201, 65, 241, 209, 225, 165, 250, 175, 235, 137, 65, 241, 209, 225,
+ 165, 250, 175, 234, 40, 65, 241, 209, 225, 165, 250, 175, 224, 160, 65,
+ 241, 209, 225, 165, 250, 175, 234, 88, 65, 241, 209, 225, 165, 250, 175,
+ 254, 169, 65, 247, 199, 225, 165, 250, 175, 117, 65, 247, 199, 225, 165,
+ 250, 175, 133, 65, 247, 199, 225, 165, 250, 175, 243, 237, 65, 247, 199,
+ 225, 165, 250, 175, 244, 50, 65, 247, 199, 225, 165, 250, 175, 220, 53,
+ 65, 247, 199, 225, 165, 250, 175, 221, 43, 65, 247, 199, 225, 165, 250,
+ 175, 245, 150, 65, 247, 199, 225, 165, 250, 175, 229, 31, 65, 247, 199,
+ 225, 165, 250, 175, 217, 201, 65, 247, 199, 225, 165, 250, 175, 235, 137,
+ 65, 247, 199, 225, 165, 250, 175, 234, 40, 65, 247, 199, 225, 165, 250,
+ 175, 224, 160, 65, 247, 199, 225, 165, 250, 175, 234, 88, 65, 247, 199,
+ 225, 165, 250, 175, 83, 235, 65, 225, 165, 250, 175, 254, 169, 65, 249,
+ 179, 225, 165, 250, 175, 117, 65, 249, 179, 225, 165, 250, 175, 133, 65,
+ 249, 179, 225, 165, 250, 175, 243, 237, 65, 249, 179, 225, 165, 250, 175,
+ 244, 50, 65, 249, 179, 225, 165, 250, 175, 220, 53, 65, 249, 179, 225,
+ 165, 250, 175, 221, 43, 65, 249, 179, 225, 165, 250, 175, 245, 150, 65,
+ 249, 179, 225, 165, 250, 175, 229, 31, 65, 249, 179, 225, 165, 250, 175,
+ 217, 201, 65, 249, 179, 225, 165, 250, 175, 235, 137, 65, 249, 179, 225,
+ 165, 250, 175, 234, 40, 65, 249, 179, 225, 165, 250, 175, 224, 160, 65,
+ 249, 179, 225, 165, 250, 175, 234, 88, 65, 249, 179, 225, 165, 250, 175,
+ 67, 235, 65, 21, 212, 80, 243, 200, 219, 69, 21, 212, 80, 249, 157, 21,
+ 122, 249, 157, 21, 117, 249, 157, 21, 133, 249, 157, 21, 243, 237, 249,
+ 157, 21, 244, 50, 249, 157, 21, 220, 53, 249, 157, 21, 221, 43, 249, 157,
+ 21, 245, 150, 249, 157, 21, 229, 31, 249, 157, 86, 7, 6, 1, 61, 86, 7, 6,
+ 1, 253, 74, 86, 7, 6, 1, 250, 252, 86, 7, 6, 1, 249, 3, 86, 7, 6, 1, 74,
+ 86, 7, 6, 1, 244, 230, 86, 7, 6, 1, 243, 177, 86, 7, 6, 1, 242, 41, 86,
+ 7, 6, 1, 72, 86, 7, 6, 1, 235, 142, 86, 7, 6, 1, 235, 27, 86, 7, 6, 1,
+ 150, 86, 7, 6, 1, 183, 86, 7, 6, 1, 204, 86, 7, 6, 1, 75, 86, 7, 6, 1,
+ 226, 229, 86, 7, 6, 1, 224, 240, 86, 7, 6, 1, 149, 86, 7, 6, 1, 197, 86,
+ 7, 6, 1, 218, 99, 86, 7, 6, 1, 69, 86, 7, 6, 1, 215, 79, 86, 7, 6, 1,
+ 214, 82, 86, 7, 6, 1, 213, 166, 86, 7, 6, 1, 213, 105, 86, 7, 6, 1, 212,
+ 152, 216, 219, 220, 233, 251, 84, 7, 6, 1, 197, 36, 32, 7, 6, 1, 250,
+ 252, 36, 32, 7, 6, 1, 149, 36, 250, 125, 36, 213, 168, 91, 7, 6, 1, 61,
+ 91, 7, 6, 1, 253, 74, 91, 7, 6, 1, 250, 252, 91, 7, 6, 1, 249, 3, 91, 7,
+ 6, 1, 74, 91, 7, 6, 1, 244, 230, 91, 7, 6, 1, 243, 177, 91, 7, 6, 1, 242,
+ 41, 91, 7, 6, 1, 72, 91, 7, 6, 1, 235, 142, 91, 7, 6, 1, 235, 27, 91, 7,
+ 6, 1, 150, 91, 7, 6, 1, 183, 91, 7, 6, 1, 204, 91, 7, 6, 1, 75, 91, 7, 6,
+ 1, 226, 229, 91, 7, 6, 1, 224, 240, 91, 7, 6, 1, 149, 91, 7, 6, 1, 197,
+ 91, 7, 6, 1, 218, 99, 91, 7, 6, 1, 69, 91, 7, 6, 1, 215, 79, 91, 7, 6, 1,
+ 214, 82, 91, 7, 6, 1, 213, 166, 91, 7, 6, 1, 213, 105, 91, 7, 6, 1, 212,
+ 152, 91, 240, 193, 91, 230, 120, 91, 222, 102, 91, 219, 158, 91, 225, 98,
+ 91, 214, 7, 146, 36, 7, 6, 1, 61, 146, 36, 7, 6, 1, 253, 74, 146, 36, 7,
+ 6, 1, 250, 252, 146, 36, 7, 6, 1, 249, 3, 146, 36, 7, 6, 1, 74, 146, 36,
+ 7, 6, 1, 244, 230, 146, 36, 7, 6, 1, 243, 177, 146, 36, 7, 6, 1, 242, 41,
+ 146, 36, 7, 6, 1, 72, 146, 36, 7, 6, 1, 235, 142, 146, 36, 7, 6, 1, 235,
+ 27, 146, 36, 7, 6, 1, 150, 146, 36, 7, 6, 1, 183, 146, 36, 7, 6, 1, 204,
+ 146, 36, 7, 6, 1, 75, 146, 36, 7, 6, 1, 226, 229, 146, 36, 7, 6, 1, 224,
+ 240, 146, 36, 7, 6, 1, 149, 146, 36, 7, 6, 1, 197, 146, 36, 7, 6, 1, 218,
+ 99, 146, 36, 7, 6, 1, 69, 146, 36, 7, 6, 1, 215, 79, 146, 36, 7, 6, 1,
+ 214, 82, 146, 36, 7, 6, 1, 213, 166, 146, 36, 7, 6, 1, 213, 105, 146, 36,
+ 7, 6, 1, 212, 152, 146, 91, 7, 6, 1, 61, 146, 91, 7, 6, 1, 253, 74, 146,
+ 91, 7, 6, 1, 250, 252, 146, 91, 7, 6, 1, 249, 3, 146, 91, 7, 6, 1, 74,
+ 146, 91, 7, 6, 1, 244, 230, 146, 91, 7, 6, 1, 243, 177, 146, 91, 7, 6, 1,
+ 242, 41, 146, 91, 7, 6, 1, 72, 146, 91, 7, 6, 1, 235, 142, 146, 91, 7, 6,
+ 1, 235, 27, 146, 91, 7, 6, 1, 150, 146, 91, 7, 6, 1, 183, 146, 91, 7, 6,
+ 1, 204, 146, 91, 7, 6, 1, 75, 146, 91, 7, 6, 1, 226, 229, 146, 91, 7, 6,
+ 1, 224, 240, 146, 91, 7, 6, 1, 149, 146, 91, 7, 6, 1, 197, 146, 91, 7, 6,
+ 1, 218, 99, 146, 91, 7, 6, 1, 69, 146, 91, 7, 6, 1, 215, 79, 146, 91, 7,
+ 6, 1, 214, 82, 146, 91, 7, 6, 1, 213, 166, 146, 91, 7, 6, 1, 213, 105,
+ 146, 91, 7, 6, 1, 212, 152, 249, 68, 146, 91, 7, 6, 1, 226, 229, 146, 91,
+ 240, 106, 146, 91, 193, 146, 91, 222, 202, 146, 91, 254, 185, 146, 91,
+ 214, 7, 41, 247, 116, 91, 249, 216, 91, 249, 109, 91, 243, 222, 91, 240,
+ 98, 91, 229, 168, 91, 229, 161, 91, 227, 80, 91, 219, 222, 91, 114, 2,
+ 244, 254, 77, 91, 214, 100, 223, 253, 235, 236, 16, 1, 61, 223, 253, 235,
+ 236, 16, 1, 253, 74, 223, 253, 235, 236, 16, 1, 250, 252, 223, 253, 235,
+ 236, 16, 1, 249, 3, 223, 253, 235, 236, 16, 1, 74, 223, 253, 235, 236,
+ 16, 1, 244, 230, 223, 253, 235, 236, 16, 1, 243, 177, 223, 253, 235, 236,
+ 16, 1, 242, 41, 223, 253, 235, 236, 16, 1, 72, 223, 253, 235, 236, 16, 1,
+ 235, 142, 223, 253, 235, 236, 16, 1, 235, 27, 223, 253, 235, 236, 16, 1,
+ 150, 223, 253, 235, 236, 16, 1, 183, 223, 253, 235, 236, 16, 1, 204, 223,
+ 253, 235, 236, 16, 1, 75, 223, 253, 235, 236, 16, 1, 226, 229, 223, 253,
+ 235, 236, 16, 1, 224, 240, 223, 253, 235, 236, 16, 1, 149, 223, 253, 235,
+ 236, 16, 1, 197, 223, 253, 235, 236, 16, 1, 218, 99, 223, 253, 235, 236,
+ 16, 1, 69, 223, 253, 235, 236, 16, 1, 215, 79, 223, 253, 235, 236, 16, 1,
+ 214, 82, 223, 253, 235, 236, 16, 1, 213, 166, 223, 253, 235, 236, 16, 1,
+ 213, 105, 223, 253, 235, 236, 16, 1, 212, 152, 41, 142, 241, 49, 91, 56,
+ 234, 27, 91, 56, 222, 202, 91, 9, 215, 148, 238, 43, 91, 9, 215, 148,
+ 238, 47, 91, 9, 215, 148, 238, 55, 91, 56, 248, 41, 91, 9, 215, 148, 238,
+ 62, 91, 9, 215, 148, 238, 49, 91, 9, 215, 148, 238, 21, 91, 9, 215, 148,
+ 238, 48, 91, 9, 215, 148, 238, 61, 91, 9, 215, 148, 238, 35, 91, 9, 215,
+ 148, 238, 28, 91, 9, 215, 148, 238, 37, 91, 9, 215, 148, 238, 58, 91, 9,
+ 215, 148, 238, 44, 91, 9, 215, 148, 238, 60, 91, 9, 215, 148, 238, 36,
+ 91, 9, 215, 148, 238, 59, 91, 9, 215, 148, 238, 22, 91, 9, 215, 148, 238,
+ 27, 91, 9, 215, 148, 238, 20, 91, 9, 215, 148, 238, 50, 91, 9, 215, 148,
+ 238, 52, 91, 9, 215, 148, 238, 30, 91, 9, 215, 148, 238, 41, 91, 9, 215,
+ 148, 238, 39, 91, 9, 215, 148, 238, 65, 91, 9, 215, 148, 238, 64, 91, 9,
+ 215, 148, 238, 18, 91, 9, 215, 148, 238, 45, 91, 9, 215, 148, 238, 63,
+ 91, 9, 215, 148, 238, 54, 91, 9, 215, 148, 238, 40, 91, 9, 215, 148, 238,
+ 19, 91, 9, 215, 148, 238, 42, 91, 9, 215, 148, 238, 24, 91, 9, 215, 148,
+ 238, 23, 91, 9, 215, 148, 238, 53, 91, 9, 215, 148, 238, 31, 91, 9, 215,
+ 148, 238, 33, 91, 9, 215, 148, 238, 34, 91, 9, 215, 148, 238, 26, 91, 9,
+ 215, 148, 238, 57, 91, 9, 215, 148, 238, 51, 216, 219, 220, 233, 251, 84,
+ 9, 215, 148, 238, 32, 216, 219, 220, 233, 251, 84, 9, 215, 148, 238, 64,
+ 216, 219, 220, 233, 251, 84, 9, 215, 148, 238, 62, 216, 219, 220, 233,
+ 251, 84, 9, 215, 148, 238, 46, 216, 219, 220, 233, 251, 84, 9, 215, 148,
+ 238, 29, 216, 219, 220, 233, 251, 84, 9, 215, 148, 238, 42, 216, 219,
+ 220, 233, 251, 84, 9, 215, 148, 238, 25, 216, 219, 220, 233, 251, 84, 9,
+ 215, 148, 238, 56, 216, 219, 220, 233, 251, 84, 9, 215, 148, 238, 38, 36,
+ 143, 254, 150, 36, 143, 254, 172, 249, 14, 244, 11, 249, 193, 215, 164,
+ 229, 44, 2, 219, 92, 218, 233, 110, 230, 184, 218, 232, 249, 219, 253,
+ 123, 246, 9, 218, 231, 110, 251, 47, 224, 49, 251, 68, 253, 123, 229, 43,
+ 214, 25, 214, 19, 214, 112, 231, 8, 214, 9, 245, 180, 242, 157, 245, 12,
+ 245, 180, 242, 157, 254, 37, 245, 180, 242, 157, 253, 140, 242, 157, 2,
+ 231, 115, 156, 230, 199, 87, 214, 11, 249, 77, 230, 199, 87, 244, 61,
+ 224, 167, 230, 199, 87, 214, 11, 242, 186, 230, 199, 87, 243, 200, 230,
+ 199, 87, 214, 36, 242, 186, 230, 199, 87, 233, 103, 224, 167, 230, 199,
+ 87, 214, 36, 249, 77, 230, 199, 87, 249, 77, 230, 198, 156, 230, 199, 2,
+ 244, 158, 244, 61, 224, 167, 230, 199, 2, 244, 158, 233, 103, 224, 167,
+ 230, 199, 2, 244, 158, 243, 200, 230, 199, 2, 244, 158, 218, 239, 2, 244,
+ 158, 242, 155, 219, 95, 220, 179, 219, 95, 250, 53, 222, 87, 245, 6, 216,
+ 193, 248, 35, 216, 193, 226, 186, 216, 193, 250, 213, 216, 73, 250, 55,
+ 251, 133, 223, 93, 241, 164, 218, 236, 251, 133, 245, 184, 65, 232, 0,
+ 245, 184, 65, 223, 184, 241, 188, 243, 237, 233, 78, 249, 183, 231, 233,
+ 233, 77, 244, 144, 233, 77, 233, 78, 244, 16, 235, 252, 213, 224, 230,
+ 128, 216, 245, 253, 107, 242, 119, 231, 131, 214, 23, 218, 8, 233, 50,
+ 252, 68, 225, 194, 224, 4, 253, 223, 242, 104, 253, 223, 226, 92, 226,
+ 93, 250, 56, 219, 54, 242, 6, 220, 18, 65, 225, 176, 231, 152, 227, 63,
+ 251, 119, 225, 109, 233, 60, 223, 185, 249, 82, 223, 185, 252, 78, 249,
+ 112, 223, 184, 249, 36, 24, 223, 184, 219, 81, 251, 93, 219, 202, 251,
+ 78, 243, 221, 243, 217, 223, 108, 218, 191, 225, 111, 248, 120, 227, 101,
+ 218, 208, 243, 218, 220, 155, 244, 60, 250, 209, 2, 218, 184, 247, 242,
+ 219, 236, 240, 105, 249, 81, 220, 250, 240, 104, 240, 105, 249, 81, 246,
+ 62, 249, 111, 250, 21, 134, 250, 186, 232, 194, 249, 30, 241, 41, 225,
+ 113, 220, 164, 251, 213, 251, 89, 225, 114, 65, 244, 2, 249, 110, 243,
+ 249, 24, 234, 41, 217, 227, 213, 216, 241, 252, 222, 183, 251, 103, 24,
+ 249, 43, 213, 222, 242, 160, 249, 172, 242, 160, 216, 151, 246, 45, 251,
+ 238, 230, 163, 249, 200, 251, 238, 230, 162, 252, 104, 251, 102, 223,
+ 186, 213, 189, 225, 75, 251, 158, 250, 208, 235, 136, 250, 14, 216, 193,
+ 244, 130, 250, 13, 244, 63, 244, 64, 219, 200, 252, 77, 226, 122, 225,
+ 124, 249, 143, 252, 78, 218, 10, 216, 193, 249, 68, 244, 36, 225, 195,
+ 248, 32, 235, 131, 247, 85, 250, 164, 219, 53, 213, 225, 250, 35, 230,
+ 199, 214, 144, 250, 96, 222, 117, 222, 141, 242, 124, 250, 183, 250, 165,
+ 240, 232, 244, 99, 213, 241, 223, 102, 249, 173, 244, 55, 225, 136, 24,
+ 244, 59, 231, 40, 230, 178, 250, 198, 249, 232, 241, 216, 253, 156, 226,
+ 189, 216, 227, 241, 234, 249, 222, 217, 195, 217, 67, 249, 213, 251, 125,
+ 226, 52, 253, 155, 214, 150, 243, 86, 247, 149, 241, 142, 220, 12, 232,
+ 39, 251, 168, 243, 87, 247, 192, 251, 92, 244, 21, 225, 165, 250, 173,
+ 27, 228, 158, 230, 155, 27, 228, 153, 222, 130, 242, 80, 27, 234, 143,
+ 216, 148, 214, 135, 27, 222, 111, 223, 35, 220, 191, 2, 222, 143, 217,
+ 197, 224, 68, 24, 252, 78, 220, 33, 24, 220, 33, 251, 112, 252, 43, 24,
+ 241, 36, 250, 57, 244, 42, 219, 247, 223, 36, 218, 212, 216, 152, 240,
+ 233, 224, 69, 254, 38, 244, 0, 223, 47, 244, 0, 218, 186, 240, 222, 251,
+ 48, 240, 222, 2, 243, 70, 227, 95, 251, 48, 235, 131, 225, 119, 227, 94,
+ 245, 11, 225, 119, 227, 94, 240, 231, 252, 64, 253, 97, 217, 205, 232,
+ 39, 240, 227, 232, 166, 240, 227, 249, 115, 219, 65, 222, 116, 247, 250,
+ 219, 65, 244, 148, 235, 147, 233, 113, 235, 131, 250, 158, 245, 11, 250,
+ 158, 224, 33, 230, 182, 226, 238, 214, 25, 251, 52, 249, 84, 217, 60,
+ 233, 42, 224, 70, 250, 156, 246, 50, 249, 75, 213, 244, 219, 254, 219,
+ 252, 240, 232, 224, 45, 242, 146, 220, 237, 230, 215, 223, 96, 250, 45,
+ 247, 90, 225, 205, 251, 126, 245, 126, 227, 103, 219, 184, 220, 232, 251,
+ 51, 254, 3, 241, 40, 233, 144, 251, 236, 244, 59, 216, 151, 244, 59, 251,
+ 132, 216, 55, 241, 232, 250, 46, 252, 104, 250, 46, 243, 212, 252, 104,
+ 250, 46, 251, 160, 226, 70, 234, 35, 225, 128, 246, 42, 250, 199, 252,
+ 95, 250, 199, 247, 84, 230, 183, 244, 158, 249, 85, 244, 158, 217, 61,
+ 244, 158, 224, 71, 244, 158, 250, 157, 244, 158, 246, 51, 244, 158, 219,
+ 173, 213, 244, 240, 233, 244, 158, 230, 216, 244, 158, 247, 91, 244, 158,
+ 225, 206, 244, 158, 243, 215, 244, 158, 242, 3, 244, 158, 213, 211, 244,
+ 158, 251, 247, 244, 158, 226, 172, 244, 158, 225, 206, 228, 164, 226,
+ 106, 225, 67, 244, 237, 245, 183, 228, 164, 230, 180, 216, 232, 67, 114,
+ 225, 141, 252, 99, 235, 239, 67, 119, 225, 141, 252, 99, 235, 239, 67,
+ 42, 225, 141, 252, 99, 235, 239, 67, 46, 225, 141, 252, 99, 235, 239,
+ 244, 53, 241, 255, 52, 214, 17, 241, 255, 52, 227, 81, 241, 255, 52, 217,
+ 89, 114, 52, 217, 89, 119, 52, 249, 212, 241, 250, 52, 227, 40, 241, 250,
+ 52, 249, 63, 213, 207, 241, 234, 244, 238, 229, 185, 218, 98, 235, 126,
+ 246, 47, 234, 91, 251, 170, 213, 207, 249, 186, 225, 14, 241, 253, 225,
+ 110, 231, 240, 220, 184, 253, 119, 220, 184, 241, 150, 220, 184, 213,
+ 207, 222, 156, 213, 207, 251, 111, 243, 254, 251, 19, 235, 252, 220, 95,
+ 251, 18, 235, 252, 220, 95, 251, 88, 242, 170, 231, 248, 213, 208, 244,
+ 142, 231, 249, 24, 213, 209, 241, 46, 241, 249, 117, 231, 123, 241, 46,
+ 241, 249, 117, 213, 206, 241, 46, 241, 249, 225, 133, 227, 93, 213, 209,
+ 2, 251, 35, 245, 181, 251, 69, 2, 214, 223, 226, 44, 2, 251, 135, 242,
+ 16, 231, 249, 2, 242, 89, 225, 241, 231, 237, 231, 249, 2, 216, 61, 227,
+ 74, 231, 248, 227, 74, 213, 208, 252, 103, 249, 129, 213, 192, 225, 70,
+ 235, 131, 227, 89, 235, 131, 242, 145, 242, 198, 252, 104, 254, 22, 244,
+ 242, 254, 69, 254, 70, 230, 206, 236, 1, 220, 28, 235, 229, 247, 241,
+ 226, 43, 242, 86, 248, 124, 232, 230, 230, 30, 225, 132, 244, 159, 231,
+ 205, 242, 15, 252, 58, 225, 135, 218, 117, 225, 198, 234, 73, 77, 232,
+ 166, 233, 34, 223, 130, 243, 30, 219, 71, 234, 72, 251, 97, 249, 87, 2,
+ 241, 211, 214, 3, 251, 245, 241, 211, 251, 63, 241, 211, 117, 241, 209,
+ 219, 198, 241, 211, 242, 98, 241, 211, 241, 212, 2, 68, 251, 131, 241,
+ 211, 242, 104, 241, 211, 213, 33, 241, 211, 225, 15, 241, 211, 241, 212,
+ 2, 223, 186, 223, 197, 241, 209, 241, 212, 248, 32, 247, 201, 221, 5, 2,
+ 118, 62, 235, 212, 245, 129, 177, 251, 45, 254, 21, 87, 251, 120, 220,
+ 20, 87, 249, 166, 87, 219, 178, 218, 193, 87, 246, 40, 248, 102, 87, 225,
+ 199, 65, 225, 129, 244, 30, 251, 181, 247, 117, 87, 219, 191, 252, 77,
+ 217, 102, 252, 77, 67, 244, 20, 240, 201, 225, 139, 87, 230, 219, 252,
+ 90, 249, 39, 244, 255, 107, 247, 86, 52, 249, 79, 250, 174, 252, 63, 2,
+ 213, 31, 52, 252, 63, 2, 247, 86, 52, 252, 63, 2, 245, 14, 52, 252, 63,
+ 2, 225, 108, 52, 230, 219, 2, 213, 220, 250, 74, 2, 215, 124, 216, 189,
+ 24, 213, 31, 52, 222, 97, 226, 42, 249, 147, 251, 67, 230, 255, 244, 25,
+ 247, 137, 227, 27, 247, 142, 246, 4, 244, 76, 244, 9, 227, 40, 244, 76,
+ 244, 9, 226, 201, 2, 249, 41, 226, 201, 244, 151, 215, 134, 250, 204,
+ 217, 226, 250, 204, 250, 175, 235, 239, 250, 74, 2, 215, 124, 216, 188,
+ 250, 74, 2, 246, 58, 216, 188, 252, 60, 250, 73, 249, 199, 225, 10, 223,
+ 87, 225, 10, 226, 147, 219, 61, 223, 42, 216, 180, 223, 42, 251, 116,
+ 218, 39, 233, 75, 228, 156, 228, 157, 2, 248, 31, 249, 86, 249, 193, 251,
+ 117, 227, 40, 251, 117, 242, 104, 251, 117, 251, 131, 251, 117, 227, 23,
+ 251, 117, 251, 114, 230, 25, 252, 93, 222, 105, 231, 124, 217, 210, 224,
+ 16, 226, 199, 244, 127, 232, 39, 222, 140, 254, 0, 225, 31, 254, 157,
+ 232, 168, 250, 63, 231, 136, 226, 253, 216, 196, 235, 248, 216, 196, 226,
+ 206, 245, 236, 87, 235, 245, 245, 78, 245, 79, 2, 246, 58, 76, 49, 249,
+ 193, 232, 6, 2, 232, 162, 244, 42, 249, 193, 232, 6, 2, 224, 48, 244, 42,
+ 227, 40, 232, 6, 2, 224, 48, 244, 42, 227, 40, 232, 6, 2, 232, 162, 244,
+ 42, 225, 116, 225, 117, 240, 235, 229, 166, 230, 229, 225, 249, 230, 229,
+ 225, 250, 2, 95, 76, 253, 123, 233, 70, 214, 153, 230, 228, 230, 229,
+ 225, 250, 227, 96, 228, 186, 230, 229, 225, 248, 254, 1, 2, 252, 49, 250,
+ 198, 214, 150, 250, 198, 217, 207, 224, 63, 214, 149, 216, 25, 95, 253,
+ 162, 249, 195, 95, 24, 132, 227, 40, 249, 229, 253, 162, 249, 195, 95,
+ 24, 132, 227, 40, 249, 229, 253, 163, 2, 36, 122, 226, 244, 249, 195,
+ 246, 58, 24, 215, 124, 227, 40, 249, 229, 253, 162, 253, 255, 246, 58,
+ 24, 215, 124, 227, 40, 249, 229, 253, 162, 115, 251, 66, 87, 124, 251,
+ 66, 87, 219, 195, 2, 250, 192, 90, 219, 194, 219, 195, 2, 122, 219, 218,
+ 214, 19, 219, 195, 2, 133, 219, 218, 214, 18, 252, 35, 245, 129, 225,
+ 161, 233, 66, 232, 16, 242, 160, 223, 144, 232, 16, 242, 160, 232, 204,
+ 2, 235, 222, 226, 74, 249, 193, 232, 204, 2, 234, 144, 234, 144, 232,
+ 203, 227, 40, 232, 203, 251, 221, 251, 222, 2, 250, 192, 90, 251, 115,
+ 232, 233, 87, 224, 64, 251, 15, 252, 102, 2, 132, 76, 49, 245, 101, 2,
+ 132, 76, 49, 227, 63, 2, 244, 254, 152, 2, 42, 46, 76, 49, 219, 225, 2,
+ 95, 76, 49, 216, 227, 2, 215, 124, 76, 49, 228, 186, 122, 215, 154, 245,
+ 148, 87, 234, 142, 217, 200, 235, 216, 16, 31, 7, 6, 233, 33, 235, 216,
+ 16, 31, 7, 3, 233, 33, 235, 216, 16, 31, 228, 55, 235, 216, 16, 31, 218,
+ 128, 235, 216, 16, 31, 7, 233, 33, 244, 65, 245, 129, 216, 222, 213, 187,
+ 242, 4, 228, 38, 24, 251, 121, 241, 52, 225, 182, 231, 39, 217, 208, 249,
+ 54, 252, 78, 220, 53, 225, 143, 219, 96, 2, 231, 37, 247, 74, 235, 131,
+ 16, 31, 251, 233, 216, 178, 245, 114, 83, 41, 251, 15, 67, 41, 251, 15,
+ 233, 108, 224, 4, 249, 228, 233, 108, 251, 131, 249, 228, 233, 108, 227,
+ 23, 247, 200, 233, 108, 251, 131, 247, 200, 3, 227, 23, 247, 200, 3, 251,
+ 131, 247, 200, 215, 133, 224, 4, 216, 183, 246, 59, 224, 4, 216, 183,
+ 215, 133, 3, 224, 4, 216, 183, 246, 59, 3, 224, 4, 216, 183, 249, 197,
+ 244, 159, 122, 227, 106, 249, 197, 244, 159, 117, 227, 106, 249, 197,
+ 244, 159, 133, 227, 106, 249, 197, 244, 159, 243, 237, 227, 106, 249,
+ 197, 244, 159, 244, 50, 227, 106, 249, 197, 244, 159, 220, 53, 227, 106,
+ 249, 197, 244, 159, 221, 43, 227, 106, 249, 197, 244, 159, 245, 150, 227,
+ 106, 249, 197, 244, 159, 229, 31, 227, 106, 249, 197, 244, 159, 217, 201,
+ 227, 106, 249, 197, 244, 159, 245, 125, 227, 106, 249, 197, 244, 159,
+ 216, 42, 227, 106, 249, 197, 244, 159, 227, 58, 249, 197, 244, 159, 216,
+ 22, 249, 197, 244, 159, 217, 94, 249, 197, 244, 159, 243, 233, 249, 197,
+ 244, 159, 244, 48, 249, 197, 244, 159, 220, 49, 249, 197, 244, 159, 221,
+ 42, 249, 197, 244, 159, 245, 149, 249, 197, 244, 159, 229, 30, 249, 197,
+ 244, 159, 217, 199, 249, 197, 244, 159, 245, 123, 249, 197, 244, 159,
+ 216, 40, 230, 187, 243, 201, 216, 247, 216, 215, 219, 88, 65, 233, 11,
+ 220, 96, 65, 235, 132, 230, 176, 242, 102, 244, 159, 2, 220, 2, 244, 237,
+ 244, 159, 2, 217, 222, 65, 235, 56, 220, 2, 244, 159, 2, 227, 40, 230,
+ 180, 220, 2, 244, 159, 2, 227, 40, 230, 181, 24, 220, 2, 244, 237, 220,
+ 2, 244, 159, 2, 227, 40, 230, 181, 24, 249, 168, 218, 192, 220, 2, 244,
+ 159, 2, 227, 40, 230, 181, 24, 217, 58, 244, 237, 220, 2, 244, 159, 2,
+ 242, 8, 220, 2, 244, 159, 2, 240, 234, 213, 218, 244, 158, 220, 2, 244,
+ 159, 2, 220, 2, 244, 237, 244, 159, 222, 135, 248, 13, 244, 2, 223, 238,
+ 244, 158, 220, 2, 244, 159, 2, 241, 210, 244, 237, 220, 2, 244, 159, 2,
+ 218, 234, 220, 1, 244, 158, 229, 169, 244, 158, 215, 158, 244, 158, 244,
+ 159, 2, 249, 168, 218, 192, 226, 67, 244, 158, 249, 141, 244, 158, 244,
+ 159, 217, 91, 118, 234, 72, 234, 71, 244, 159, 2, 249, 193, 244, 237,
+ 244, 159, 2, 219, 31, 216, 233, 24, 213, 218, 244, 239, 244, 159, 2, 219,
+ 31, 216, 233, 24, 217, 58, 244, 237, 247, 144, 244, 158, 254, 17, 244,
+ 158, 225, 107, 244, 158, 249, 56, 244, 158, 226, 46, 244, 158, 244, 159,
+ 2, 232, 179, 65, 216, 162, 247, 144, 251, 17, 223, 238, 244, 158, 244,
+ 121, 244, 158, 214, 4, 244, 158, 220, 19, 244, 158, 217, 24, 244, 158,
+ 232, 169, 249, 56, 244, 158, 244, 159, 2, 227, 40, 230, 181, 24, 249,
+ 168, 218, 192, 244, 159, 222, 109, 235, 252, 244, 122, 253, 129, 244,
+ 158, 244, 18, 244, 158, 247, 117, 244, 158, 244, 159, 213, 216, 230, 180,
+ 244, 159, 2, 231, 149, 231, 207, 242, 102, 250, 157, 244, 159, 2, 220, 2,
+ 244, 237, 250, 157, 244, 159, 2, 217, 222, 65, 235, 56, 220, 2, 250, 157,
+ 244, 159, 2, 227, 40, 230, 180, 220, 2, 250, 157, 244, 159, 2, 241, 210,
+ 244, 237, 250, 157, 244, 159, 2, 213, 184, 220, 3, 234, 71, 250, 157,
+ 244, 159, 2, 249, 193, 244, 237, 225, 107, 250, 157, 244, 158, 249, 56,
+ 250, 157, 244, 158, 214, 4, 250, 157, 244, 158, 244, 159, 2, 228, 186,
+ 242, 139, 243, 10, 244, 159, 2, 227, 81, 243, 10, 226, 44, 251, 94, 248,
+ 26, 222, 88, 230, 215, 241, 213, 230, 215, 219, 196, 230, 215, 241, 244,
+ 226, 44, 224, 47, 122, 241, 254, 226, 44, 224, 47, 251, 104, 241, 250,
+ 235, 252, 250, 113, 226, 44, 243, 208, 226, 44, 2, 225, 107, 244, 158,
+ 226, 44, 2, 244, 10, 241, 249, 223, 104, 241, 198, 219, 83, 232, 202,
+ 224, 53, 250, 176, 241, 148, 216, 205, 241, 148, 216, 206, 2, 251, 43,
+ 228, 164, 216, 205, 231, 99, 177, 224, 54, 219, 89, 216, 203, 216, 204,
+ 250, 176, 251, 21, 227, 60, 251, 21, 216, 159, 251, 22, 219, 69, 231, 0,
+ 254, 39, 244, 66, 245, 95, 225, 133, 250, 176, 227, 60, 225, 133, 250,
+ 176, 217, 239, 227, 60, 217, 239, 253, 96, 227, 60, 253, 96, 224, 11,
+ 214, 224, 248, 9, 216, 150, 253, 157, 232, 172, 216, 211, 230, 209, 230,
+ 186, 224, 52, 218, 207, 224, 52, 230, 186, 250, 214, 254, 134, 216, 202,
+ 220, 196, 223, 84, 219, 189, 199, 216, 209, 233, 2, 71, 216, 209, 233, 2,
+ 249, 129, 52, 225, 133, 250, 161, 223, 197, 233, 2, 216, 180, 244, 43,
+ 227, 63, 225, 118, 247, 77, 228, 186, 245, 84, 52, 220, 0, 87, 228, 186,
+ 220, 0, 87, 225, 9, 232, 222, 235, 252, 235, 155, 225, 173, 87, 247, 100,
+ 228, 163, 232, 222, 87, 225, 112, 214, 25, 87, 228, 177, 214, 25, 87,
+ 251, 180, 228, 186, 251, 179, 251, 178, 230, 186, 251, 178, 226, 88, 228,
+ 186, 226, 87, 250, 37, 249, 64, 231, 120, 87, 213, 205, 87, 223, 211,
+ 252, 104, 87, 216, 248, 214, 25, 249, 190, 220, 158, 252, 38, 252, 36,
+ 226, 115, 249, 116, 249, 28, 252, 87, 249, 215, 42, 232, 148, 104, 16,
+ 31, 224, 148, 104, 16, 31, 254, 100, 104, 16, 31, 244, 65, 104, 16, 31,
+ 245, 179, 104, 16, 31, 214, 24, 104, 16, 31, 253, 213, 104, 16, 31, 253,
+ 214, 223, 255, 104, 16, 31, 253, 214, 223, 254, 104, 16, 31, 253, 214,
+ 214, 124, 104, 16, 31, 253, 214, 214, 123, 104, 16, 31, 214, 138, 104,
+ 16, 31, 214, 137, 104, 16, 31, 214, 136, 104, 16, 31, 218, 245, 104, 16,
+ 31, 226, 1, 218, 245, 104, 16, 31, 83, 218, 245, 104, 16, 31, 231, 119,
+ 219, 16, 104, 16, 31, 231, 119, 219, 15, 104, 16, 31, 231, 119, 219, 14,
+ 104, 16, 31, 249, 231, 104, 16, 31, 222, 172, 104, 16, 31, 229, 19, 104,
+ 16, 31, 214, 122, 104, 16, 31, 214, 121, 104, 16, 31, 223, 105, 222, 172,
+ 104, 16, 31, 223, 105, 222, 171, 104, 16, 31, 242, 142, 104, 16, 31, 220,
+ 92, 104, 16, 31, 235, 175, 227, 20, 104, 16, 31, 235, 175, 227, 19, 104,
+ 16, 31, 249, 74, 65, 235, 174, 104, 16, 31, 223, 251, 65, 235, 174, 104,
+ 16, 31, 249, 107, 227, 20, 104, 16, 31, 235, 173, 227, 20, 104, 16, 31,
+ 219, 17, 65, 249, 106, 104, 16, 31, 249, 74, 65, 249, 106, 104, 16, 31,
+ 249, 74, 65, 249, 105, 104, 16, 31, 249, 107, 253, 250, 104, 16, 31, 222,
+ 173, 65, 249, 107, 253, 250, 104, 16, 31, 219, 17, 65, 222, 173, 65, 249,
+ 106, 104, 16, 31, 214, 220, 104, 16, 31, 217, 37, 227, 20, 104, 16, 31,
+ 233, 81, 227, 20, 104, 16, 31, 253, 249, 227, 20, 104, 16, 31, 219, 17,
+ 65, 253, 248, 104, 16, 31, 222, 173, 65, 253, 248, 104, 16, 31, 219, 17,
+ 65, 222, 173, 65, 253, 248, 104, 16, 31, 214, 139, 65, 253, 248, 104, 16,
+ 31, 223, 251, 65, 253, 248, 104, 16, 31, 223, 251, 65, 253, 247, 104, 16,
+ 31, 223, 250, 104, 16, 31, 223, 249, 104, 16, 31, 223, 248, 104, 16, 31,
+ 223, 247, 104, 16, 31, 254, 66, 104, 16, 31, 254, 65, 104, 16, 31, 231,
+ 226, 104, 16, 31, 222, 178, 104, 16, 31, 253, 161, 104, 16, 31, 224, 18,
+ 104, 16, 31, 224, 17, 104, 16, 31, 253, 99, 104, 16, 31, 251, 152, 227,
+ 20, 104, 16, 31, 218, 0, 104, 16, 31, 217, 255, 104, 16, 31, 224, 153,
+ 232, 251, 104, 16, 31, 251, 109, 104, 16, 31, 251, 108, 104, 16, 31, 251,
+ 107, 104, 16, 31, 254, 47, 104, 16, 31, 227, 84, 104, 16, 31, 219, 180,
+ 104, 16, 31, 217, 35, 104, 16, 31, 242, 77, 104, 16, 31, 214, 12, 104,
+ 16, 31, 225, 106, 104, 16, 31, 250, 202, 104, 16, 31, 216, 50, 104, 16,
+ 31, 250, 178, 230, 192, 104, 16, 31, 222, 120, 65, 235, 58, 104, 16, 31,
+ 250, 211, 104, 16, 31, 216, 177, 104, 16, 31, 219, 93, 216, 177, 104, 16,
+ 31, 232, 201, 104, 16, 31, 219, 240, 104, 16, 31, 215, 113, 104, 16, 31,
+ 240, 233, 246, 19, 104, 16, 31, 253, 142, 104, 16, 31, 225, 114, 253,
+ 142, 104, 16, 31, 251, 70, 104, 16, 31, 225, 105, 251, 70, 104, 16, 31,
+ 254, 44, 104, 16, 31, 219, 57, 218, 226, 219, 56, 104, 16, 31, 219, 57,
+ 218, 226, 219, 55, 104, 16, 31, 219, 13, 104, 16, 31, 225, 80, 104, 16,
+ 31, 247, 133, 104, 16, 31, 247, 135, 104, 16, 31, 247, 134, 104, 16, 31,
+ 225, 17, 104, 16, 31, 225, 7, 104, 16, 31, 249, 62, 104, 16, 31, 249, 61,
+ 104, 16, 31, 249, 60, 104, 16, 31, 249, 59, 104, 16, 31, 249, 58, 104,
+ 16, 31, 254, 77, 104, 16, 31, 252, 39, 65, 231, 212, 104, 16, 31, 252,
+ 39, 65, 214, 249, 104, 16, 31, 223, 209, 104, 16, 31, 240, 225, 104, 16,
+ 31, 229, 43, 104, 16, 31, 248, 91, 104, 16, 31, 230, 204, 104, 16, 31,
+ 151, 246, 49, 104, 16, 31, 151, 227, 0, 9, 13, 240, 95, 9, 13, 240, 94,
+ 9, 13, 240, 93, 9, 13, 240, 92, 9, 13, 240, 91, 9, 13, 240, 90, 9, 13,
+ 240, 89, 9, 13, 240, 88, 9, 13, 240, 87, 9, 13, 240, 86, 9, 13, 240, 85,
+ 9, 13, 240, 84, 9, 13, 240, 83, 9, 13, 240, 82, 9, 13, 240, 81, 9, 13,
+ 240, 80, 9, 13, 240, 79, 9, 13, 240, 78, 9, 13, 240, 77, 9, 13, 240, 76,
+ 9, 13, 240, 75, 9, 13, 240, 74, 9, 13, 240, 73, 9, 13, 240, 72, 9, 13,
+ 240, 71, 9, 13, 240, 70, 9, 13, 240, 69, 9, 13, 240, 68, 9, 13, 240, 67,
+ 9, 13, 240, 66, 9, 13, 240, 65, 9, 13, 240, 64, 9, 13, 240, 63, 9, 13,
+ 240, 62, 9, 13, 240, 61, 9, 13, 240, 60, 9, 13, 240, 59, 9, 13, 240, 58,
+ 9, 13, 240, 57, 9, 13, 240, 56, 9, 13, 240, 55, 9, 13, 240, 54, 9, 13,
+ 240, 53, 9, 13, 240, 52, 9, 13, 240, 51, 9, 13, 240, 50, 9, 13, 240, 49,
+ 9, 13, 240, 48, 9, 13, 240, 47, 9, 13, 240, 46, 9, 13, 240, 45, 9, 13,
+ 240, 44, 9, 13, 240, 43, 9, 13, 240, 42, 9, 13, 240, 41, 9, 13, 240, 40,
+ 9, 13, 240, 39, 9, 13, 240, 38, 9, 13, 240, 37, 9, 13, 240, 36, 9, 13,
+ 240, 35, 9, 13, 240, 34, 9, 13, 240, 33, 9, 13, 240, 32, 9, 13, 240, 31,
+ 9, 13, 240, 30, 9, 13, 240, 29, 9, 13, 240, 28, 9, 13, 240, 27, 9, 13,
+ 240, 26, 9, 13, 240, 25, 9, 13, 240, 24, 9, 13, 240, 23, 9, 13, 240, 22,
+ 9, 13, 240, 21, 9, 13, 240, 20, 9, 13, 240, 19, 9, 13, 240, 18, 9, 13,
+ 240, 17, 9, 13, 240, 16, 9, 13, 240, 15, 9, 13, 240, 14, 9, 13, 240, 13,
+ 9, 13, 240, 12, 9, 13, 240, 11, 9, 13, 240, 10, 9, 13, 240, 9, 9, 13,
+ 240, 8, 9, 13, 240, 7, 9, 13, 240, 6, 9, 13, 240, 5, 9, 13, 240, 4, 9,
+ 13, 240, 3, 9, 13, 240, 2, 9, 13, 240, 1, 9, 13, 240, 0, 9, 13, 239, 255,
+ 9, 13, 239, 254, 9, 13, 239, 253, 9, 13, 239, 252, 9, 13, 239, 251, 9,
+ 13, 239, 250, 9, 13, 239, 249, 9, 13, 239, 248, 9, 13, 239, 247, 9, 13,
+ 239, 246, 9, 13, 239, 245, 9, 13, 239, 244, 9, 13, 239, 243, 9, 13, 239,
+ 242, 9, 13, 239, 241, 9, 13, 239, 240, 9, 13, 239, 239, 9, 13, 239, 238,
+ 9, 13, 239, 237, 9, 13, 239, 236, 9, 13, 239, 235, 9, 13, 239, 234, 9,
+ 13, 239, 233, 9, 13, 239, 232, 9, 13, 239, 231, 9, 13, 239, 230, 9, 13,
+ 239, 229, 9, 13, 239, 228, 9, 13, 239, 227, 9, 13, 239, 226, 9, 13, 239,
+ 225, 9, 13, 239, 224, 9, 13, 239, 223, 9, 13, 239, 222, 9, 13, 239, 221,
+ 9, 13, 239, 220, 9, 13, 239, 219, 9, 13, 239, 218, 9, 13, 239, 217, 9,
+ 13, 239, 216, 9, 13, 239, 215, 9, 13, 239, 214, 9, 13, 239, 213, 9, 13,
+ 239, 212, 9, 13, 239, 211, 9, 13, 239, 210, 9, 13, 239, 209, 9, 13, 239,
+ 208, 9, 13, 239, 207, 9, 13, 239, 206, 9, 13, 239, 205, 9, 13, 239, 204,
+ 9, 13, 239, 203, 9, 13, 239, 202, 9, 13, 239, 201, 9, 13, 239, 200, 9,
+ 13, 239, 199, 9, 13, 239, 198, 9, 13, 239, 197, 9, 13, 239, 196, 9, 13,
+ 239, 195, 9, 13, 239, 194, 9, 13, 239, 193, 9, 13, 239, 192, 9, 13, 239,
+ 191, 9, 13, 239, 190, 9, 13, 239, 189, 9, 13, 239, 188, 9, 13, 239, 187,
+ 9, 13, 239, 186, 9, 13, 239, 185, 9, 13, 239, 184, 9, 13, 239, 183, 9,
+ 13, 239, 182, 9, 13, 239, 181, 9, 13, 239, 180, 9, 13, 239, 179, 9, 13,
+ 239, 178, 9, 13, 239, 177, 9, 13, 239, 176, 9, 13, 239, 175, 9, 13, 239,
+ 174, 9, 13, 239, 173, 9, 13, 239, 172, 9, 13, 239, 171, 9, 13, 239, 170,
+ 9, 13, 239, 169, 9, 13, 239, 168, 9, 13, 239, 167, 9, 13, 239, 166, 9,
+ 13, 239, 165, 9, 13, 239, 164, 9, 13, 239, 163, 9, 13, 239, 162, 9, 13,
+ 239, 161, 9, 13, 239, 160, 9, 13, 239, 159, 9, 13, 239, 158, 9, 13, 239,
+ 157, 9, 13, 239, 156, 9, 13, 239, 155, 9, 13, 239, 154, 9, 13, 239, 153,
+ 9, 13, 239, 152, 9, 13, 239, 151, 9, 13, 239, 150, 9, 13, 239, 149, 9,
+ 13, 239, 148, 9, 13, 239, 147, 9, 13, 239, 146, 9, 13, 239, 145, 9, 13,
+ 239, 144, 9, 13, 239, 143, 9, 13, 239, 142, 9, 13, 239, 141, 9, 13, 239,
+ 140, 9, 13, 239, 139, 9, 13, 239, 138, 9, 13, 239, 137, 9, 13, 239, 136,
+ 9, 13, 239, 135, 9, 13, 239, 134, 9, 13, 239, 133, 9, 13, 239, 132, 9,
+ 13, 239, 131, 9, 13, 239, 130, 9, 13, 239, 129, 9, 13, 239, 128, 9, 13,
+ 239, 127, 9, 13, 239, 126, 9, 13, 239, 125, 9, 13, 239, 124, 9, 13, 239,
+ 123, 9, 13, 239, 122, 9, 13, 239, 121, 9, 13, 239, 120, 9, 13, 239, 119,
+ 9, 13, 239, 118, 9, 13, 239, 117, 9, 13, 239, 116, 9, 13, 239, 115, 9,
+ 13, 239, 114, 9, 13, 239, 113, 9, 13, 239, 112, 9, 13, 239, 111, 9, 13,
+ 239, 110, 9, 13, 239, 109, 9, 13, 239, 108, 9, 13, 239, 107, 9, 13, 239,
+ 106, 9, 13, 239, 105, 9, 13, 239, 104, 9, 13, 239, 103, 9, 13, 239, 102,
+ 9, 13, 239, 101, 9, 13, 239, 100, 9, 13, 239, 99, 9, 13, 239, 98, 9, 13,
+ 239, 97, 9, 13, 239, 96, 9, 13, 239, 95, 9, 13, 239, 94, 9, 13, 239, 93,
+ 9, 13, 239, 92, 9, 13, 239, 91, 9, 13, 239, 90, 9, 13, 239, 89, 9, 13,
+ 239, 88, 9, 13, 239, 87, 9, 13, 239, 86, 9, 13, 239, 85, 9, 13, 239, 84,
+ 9, 13, 239, 83, 9, 13, 239, 82, 9, 13, 239, 81, 9, 13, 239, 80, 9, 13,
+ 239, 79, 9, 13, 239, 78, 9, 13, 239, 77, 9, 13, 239, 76, 9, 13, 239, 75,
+ 9, 13, 239, 74, 9, 13, 239, 73, 9, 13, 239, 72, 9, 13, 239, 71, 9, 13,
+ 239, 70, 9, 13, 239, 69, 9, 13, 239, 68, 9, 13, 239, 67, 9, 13, 239, 66,
+ 9, 13, 239, 65, 9, 13, 239, 64, 9, 13, 239, 63, 9, 13, 239, 62, 9, 13,
+ 239, 61, 9, 13, 239, 60, 9, 13, 239, 59, 9, 13, 239, 58, 9, 13, 239, 57,
+ 9, 13, 239, 56, 9, 13, 239, 55, 9, 13, 239, 54, 9, 13, 239, 53, 9, 13,
+ 239, 52, 9, 13, 239, 51, 9, 13, 239, 50, 9, 13, 239, 49, 9, 13, 239, 48,
+ 9, 13, 239, 47, 9, 13, 239, 46, 9, 13, 239, 45, 9, 13, 239, 44, 9, 13,
+ 239, 43, 9, 13, 239, 42, 9, 13, 239, 41, 9, 13, 239, 40, 9, 13, 239, 39,
+ 9, 13, 239, 38, 9, 13, 239, 37, 9, 13, 239, 36, 9, 13, 239, 35, 9, 13,
+ 239, 34, 9, 13, 239, 33, 9, 13, 239, 32, 9, 13, 239, 31, 9, 13, 239, 30,
+ 9, 13, 239, 29, 9, 13, 239, 28, 9, 13, 239, 27, 9, 13, 239, 26, 9, 13,
+ 239, 25, 9, 13, 239, 24, 9, 13, 239, 23, 9, 13, 239, 22, 9, 13, 239, 21,
+ 9, 13, 239, 20, 9, 13, 239, 19, 9, 13, 239, 18, 9, 13, 239, 17, 9, 13,
+ 239, 16, 9, 13, 239, 15, 9, 13, 239, 14, 9, 13, 239, 13, 9, 13, 239, 12,
+ 9, 13, 239, 11, 9, 13, 239, 10, 9, 13, 239, 9, 9, 13, 239, 8, 9, 13, 239,
+ 7, 9, 13, 239, 6, 9, 13, 239, 5, 9, 13, 239, 4, 9, 13, 239, 3, 9, 13,
+ 239, 2, 9, 13, 239, 1, 9, 13, 239, 0, 9, 13, 238, 255, 9, 13, 238, 254,
+ 9, 13, 238, 253, 9, 13, 238, 252, 9, 13, 238, 251, 9, 13, 238, 250, 9,
+ 13, 238, 249, 9, 13, 238, 248, 9, 13, 238, 247, 9, 13, 238, 246, 9, 13,
+ 238, 245, 9, 13, 238, 244, 9, 13, 238, 243, 9, 13, 238, 242, 9, 13, 238,
+ 241, 9, 13, 238, 240, 9, 13, 238, 239, 9, 13, 238, 238, 9, 13, 238, 237,
+ 9, 13, 238, 236, 9, 13, 238, 235, 9, 13, 238, 234, 9, 13, 238, 233, 9,
+ 13, 238, 232, 9, 13, 238, 231, 9, 13, 238, 230, 9, 13, 238, 229, 9, 13,
+ 238, 228, 9, 13, 238, 227, 9, 13, 238, 226, 9, 13, 238, 225, 9, 13, 238,
+ 224, 9, 13, 238, 223, 9, 13, 238, 222, 9, 13, 238, 221, 9, 13, 238, 220,
+ 9, 13, 238, 219, 9, 13, 238, 218, 9, 13, 238, 217, 9, 13, 238, 216, 9,
+ 13, 238, 215, 9, 13, 238, 214, 9, 13, 238, 213, 9, 13, 238, 212, 9, 13,
+ 238, 211, 9, 13, 238, 210, 9, 13, 238, 209, 9, 13, 238, 208, 9, 13, 238,
+ 207, 9, 13, 238, 206, 9, 13, 238, 205, 9, 13, 238, 204, 9, 13, 238, 203,
+ 9, 13, 238, 202, 9, 13, 238, 201, 9, 13, 238, 200, 9, 13, 238, 199, 9,
+ 13, 238, 198, 9, 13, 238, 197, 9, 13, 238, 196, 9, 13, 238, 195, 9, 13,
+ 238, 194, 9, 13, 238, 193, 9, 13, 238, 192, 9, 13, 238, 191, 9, 13, 238,
+ 190, 9, 13, 238, 189, 9, 13, 238, 188, 9, 13, 238, 187, 9, 13, 238, 186,
+ 9, 13, 238, 185, 9, 13, 238, 184, 9, 13, 238, 183, 9, 13, 238, 182, 9,
+ 13, 238, 181, 9, 13, 238, 180, 9, 13, 238, 179, 9, 13, 238, 178, 9, 13,
+ 238, 177, 9, 13, 238, 176, 9, 13, 238, 175, 9, 13, 238, 174, 9, 13, 238,
+ 173, 9, 13, 238, 172, 9, 13, 238, 171, 9, 13, 238, 170, 9, 13, 238, 169,
+ 9, 13, 238, 168, 9, 13, 238, 167, 9, 13, 238, 166, 9, 13, 238, 165, 9,
+ 13, 238, 164, 9, 13, 238, 163, 9, 13, 238, 162, 9, 13, 238, 161, 9, 13,
+ 238, 160, 9, 13, 238, 159, 9, 13, 238, 158, 9, 13, 238, 157, 9, 13, 238,
+ 156, 9, 13, 238, 155, 9, 13, 238, 154, 9, 13, 238, 153, 9, 13, 238, 152,
+ 9, 13, 238, 151, 9, 13, 238, 150, 9, 13, 238, 149, 9, 13, 238, 148, 9,
+ 13, 238, 147, 9, 13, 238, 146, 9, 13, 238, 145, 9, 13, 238, 144, 9, 13,
+ 238, 143, 9, 13, 238, 142, 9, 13, 238, 141, 9, 13, 238, 140, 9, 13, 238,
+ 139, 9, 13, 238, 138, 9, 13, 238, 137, 9, 13, 238, 136, 9, 13, 238, 135,
+ 9, 13, 238, 134, 9, 13, 238, 133, 9, 13, 238, 132, 9, 13, 238, 131, 9,
+ 13, 238, 130, 9, 13, 238, 129, 9, 13, 238, 128, 9, 13, 238, 127, 9, 13,
+ 238, 126, 9, 13, 238, 125, 9, 13, 238, 124, 9, 13, 238, 123, 9, 13, 238,
+ 122, 9, 13, 238, 121, 9, 13, 238, 120, 9, 13, 238, 119, 9, 13, 238, 118,
+ 9, 13, 238, 117, 9, 13, 238, 116, 9, 13, 238, 115, 9, 13, 238, 114, 9,
+ 13, 238, 113, 9, 13, 238, 112, 9, 13, 238, 111, 9, 13, 238, 110, 9, 13,
+ 238, 109, 9, 13, 238, 108, 9, 13, 238, 107, 9, 13, 238, 106, 9, 13, 238,
+ 105, 9, 13, 238, 104, 9, 13, 238, 103, 9, 13, 238, 102, 9, 13, 238, 101,
+ 9, 13, 238, 100, 9, 13, 238, 99, 9, 13, 238, 98, 9, 13, 238, 97, 9, 13,
+ 238, 96, 9, 13, 238, 95, 9, 13, 238, 94, 9, 13, 238, 93, 9, 13, 238, 92,
+ 9, 13, 238, 91, 9, 13, 238, 90, 9, 13, 238, 89, 9, 13, 238, 88, 9, 13,
+ 238, 87, 9, 13, 238, 86, 9, 13, 238, 85, 9, 13, 238, 84, 9, 13, 238, 83,
+ 9, 13, 238, 82, 9, 13, 238, 81, 9, 13, 238, 80, 9, 13, 238, 79, 9, 13,
+ 238, 78, 9, 13, 238, 77, 9, 13, 238, 76, 9, 13, 238, 75, 9, 13, 238, 74,
+ 9, 13, 238, 73, 9, 13, 238, 72, 9, 13, 238, 71, 9, 13, 238, 70, 9, 13,
+ 238, 69, 9, 13, 238, 68, 9, 13, 238, 67, 9, 13, 238, 66, 233, 114, 218,
+ 33, 126, 219, 206, 126, 244, 254, 77, 126, 224, 143, 77, 126, 50, 52,
+ 126, 247, 86, 52, 126, 226, 57, 52, 126, 254, 35, 126, 253, 226, 126, 42,
+ 226, 131, 126, 46, 226, 131, 126, 253, 132, 126, 94, 52, 126, 249, 157,
+ 126, 240, 159, 126, 243, 200, 219, 69, 126, 219, 231, 126, 21, 212, 79,
+ 126, 21, 116, 126, 21, 109, 126, 21, 166, 126, 21, 163, 126, 21, 180,
+ 126, 21, 189, 126, 21, 198, 126, 21, 195, 126, 21, 200, 126, 249, 164,
+ 126, 221, 70, 126, 233, 39, 52, 126, 245, 61, 52, 126, 242, 107, 52, 126,
+ 224, 158, 77, 126, 249, 156, 253, 122, 126, 7, 6, 1, 61, 126, 7, 6, 1,
+ 253, 74, 126, 7, 6, 1, 250, 252, 126, 7, 6, 1, 249, 3, 126, 7, 6, 1, 74,
+ 126, 7, 6, 1, 244, 230, 126, 7, 6, 1, 243, 177, 126, 7, 6, 1, 242, 41,
+ 126, 7, 6, 1, 72, 126, 7, 6, 1, 235, 142, 126, 7, 6, 1, 235, 27, 126, 7,
+ 6, 1, 150, 126, 7, 6, 1, 183, 126, 7, 6, 1, 204, 126, 7, 6, 1, 75, 126,
+ 7, 6, 1, 226, 229, 126, 7, 6, 1, 224, 240, 126, 7, 6, 1, 149, 126, 7, 6,
+ 1, 197, 126, 7, 6, 1, 218, 99, 126, 7, 6, 1, 69, 126, 7, 6, 1, 215, 79,
+ 126, 7, 6, 1, 214, 82, 126, 7, 6, 1, 213, 166, 126, 7, 6, 1, 213, 105,
+ 126, 7, 6, 1, 212, 152, 126, 42, 41, 125, 126, 223, 203, 219, 231, 126,
+ 46, 41, 125, 126, 249, 224, 254, 174, 126, 115, 232, 242, 126, 242, 114,
+ 254, 174, 126, 7, 3, 1, 61, 126, 7, 3, 1, 253, 74, 126, 7, 3, 1, 250,
+ 252, 126, 7, 3, 1, 249, 3, 126, 7, 3, 1, 74, 126, 7, 3, 1, 244, 230, 126,
+ 7, 3, 1, 243, 177, 126, 7, 3, 1, 242, 41, 126, 7, 3, 1, 72, 126, 7, 3, 1,
+ 235, 142, 126, 7, 3, 1, 235, 27, 126, 7, 3, 1, 150, 126, 7, 3, 1, 183,
+ 126, 7, 3, 1, 204, 126, 7, 3, 1, 75, 126, 7, 3, 1, 226, 229, 126, 7, 3,
+ 1, 224, 240, 126, 7, 3, 1, 149, 126, 7, 3, 1, 197, 126, 7, 3, 1, 218, 99,
+ 126, 7, 3, 1, 69, 126, 7, 3, 1, 215, 79, 126, 7, 3, 1, 214, 82, 126, 7,
+ 3, 1, 213, 166, 126, 7, 3, 1, 213, 105, 126, 7, 3, 1, 212, 152, 126, 42,
+ 249, 40, 125, 126, 71, 232, 242, 126, 46, 249, 40, 125, 126, 217, 42,
+ 250, 194, 218, 33, 43, 221, 254, 43, 221, 243, 43, 221, 232, 43, 221,
+ 220, 43, 221, 209, 43, 221, 198, 43, 221, 187, 43, 221, 176, 43, 221,
+ 165, 43, 221, 157, 43, 221, 156, 43, 221, 155, 43, 221, 154, 43, 221,
+ 152, 43, 221, 151, 43, 221, 150, 43, 221, 149, 43, 221, 148, 43, 221,
+ 147, 43, 221, 146, 43, 221, 145, 43, 221, 144, 43, 221, 143, 43, 221,
+ 141, 43, 221, 140, 43, 221, 139, 43, 221, 138, 43, 221, 137, 43, 221,
+ 136, 43, 221, 135, 43, 221, 134, 43, 221, 133, 43, 221, 132, 43, 221,
+ 130, 43, 221, 129, 43, 221, 128, 43, 221, 127, 43, 221, 126, 43, 221,
+ 125, 43, 221, 124, 43, 221, 123, 43, 221, 122, 43, 221, 121, 43, 221,
+ 119, 43, 221, 118, 43, 221, 117, 43, 221, 116, 43, 221, 115, 43, 221,
+ 114, 43, 221, 113, 43, 221, 112, 43, 221, 111, 43, 221, 110, 43, 221,
+ 108, 43, 221, 107, 43, 221, 106, 43, 221, 105, 43, 221, 104, 43, 221,
+ 103, 43, 221, 102, 43, 221, 101, 43, 221, 100, 43, 221, 99, 43, 221, 97,
+ 43, 221, 96, 43, 221, 95, 43, 221, 94, 43, 221, 93, 43, 221, 92, 43, 221,
+ 91, 43, 221, 90, 43, 221, 89, 43, 221, 88, 43, 221, 86, 43, 221, 85, 43,
+ 221, 84, 43, 221, 83, 43, 221, 82, 43, 221, 81, 43, 221, 80, 43, 221, 79,
+ 43, 221, 78, 43, 221, 77, 43, 222, 74, 43, 222, 73, 43, 222, 72, 43, 222,
+ 71, 43, 222, 70, 43, 222, 69, 43, 222, 68, 43, 222, 67, 43, 222, 66, 43,
+ 222, 65, 43, 222, 63, 43, 222, 62, 43, 222, 61, 43, 222, 60, 43, 222, 59,
+ 43, 222, 58, 43, 222, 57, 43, 222, 56, 43, 222, 55, 43, 222, 54, 43, 222,
+ 52, 43, 222, 51, 43, 222, 50, 43, 222, 49, 43, 222, 48, 43, 222, 47, 43,
+ 222, 46, 43, 222, 45, 43, 222, 44, 43, 222, 43, 43, 222, 41, 43, 222, 40,
+ 43, 222, 39, 43, 222, 38, 43, 222, 37, 43, 222, 36, 43, 222, 35, 43, 222,
+ 34, 43, 222, 33, 43, 222, 32, 43, 222, 30, 43, 222, 29, 43, 222, 28, 43,
+ 222, 27, 43, 222, 26, 43, 222, 25, 43, 222, 24, 43, 222, 23, 43, 222, 22,
+ 43, 222, 21, 43, 222, 19, 43, 222, 18, 43, 222, 17, 43, 222, 16, 43, 222,
+ 15, 43, 222, 14, 43, 222, 13, 43, 222, 12, 43, 222, 11, 43, 222, 10, 43,
+ 222, 8, 43, 222, 7, 43, 222, 6, 43, 222, 5, 43, 222, 4, 43, 222, 3, 43,
+ 222, 2, 43, 222, 1, 43, 222, 0, 43, 221, 255, 43, 221, 253, 43, 221, 252,
+ 43, 221, 251, 43, 221, 250, 43, 221, 249, 43, 221, 248, 43, 221, 247, 43,
+ 221, 246, 43, 221, 245, 43, 221, 244, 43, 221, 242, 43, 221, 241, 43,
+ 221, 240, 43, 221, 239, 43, 221, 238, 43, 221, 237, 43, 221, 236, 43,
+ 221, 235, 43, 221, 234, 43, 221, 233, 43, 221, 231, 43, 221, 230, 43,
+ 221, 229, 43, 221, 228, 43, 221, 227, 43, 221, 226, 43, 221, 225, 43,
+ 221, 224, 43, 221, 223, 43, 221, 222, 43, 221, 219, 43, 221, 218, 43,
+ 221, 217, 43, 221, 216, 43, 221, 215, 43, 221, 214, 43, 221, 213, 43,
+ 221, 212, 43, 221, 211, 43, 221, 210, 43, 221, 208, 43, 221, 207, 43,
+ 221, 206, 43, 221, 205, 43, 221, 204, 43, 221, 203, 43, 221, 202, 43,
+ 221, 201, 43, 221, 200, 43, 221, 199, 43, 221, 197, 43, 221, 196, 43,
+ 221, 195, 43, 221, 194, 43, 221, 193, 43, 221, 192, 43, 221, 191, 43,
+ 221, 190, 43, 221, 189, 43, 221, 188, 43, 221, 186, 43, 221, 185, 43,
+ 221, 184, 43, 221, 183, 43, 221, 182, 43, 221, 181, 43, 221, 180, 43,
+ 221, 179, 43, 221, 178, 43, 221, 177, 43, 221, 175, 43, 221, 174, 43,
+ 221, 173, 43, 221, 172, 43, 221, 171, 43, 221, 170, 43, 221, 169, 43,
+ 221, 168, 43, 221, 167, 43, 221, 166, 43, 221, 164, 43, 221, 163, 43,
+ 221, 162, 43, 221, 161, 43, 221, 160, 43, 221, 159, 43, 221, 158,
};
static unsigned char phrasebook_offset1[] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 16, 52, 53, 54,
- 16, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 16, 84, 85, 86, 87, 88,
- 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 100, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 101, 102, 103, 104, 105, 106,
- 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 16, 120,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 121, 122, 123, 124,
- 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 16,
- 139, 140, 141, 142, 143, 16, 16, 16, 16, 16, 16, 144, 16, 145, 16, 146,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 147, 148, 149, 150, 151, 152, 153, 16, 154,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 155, 156, 157, 158, 159, 16, 160, 16, 161, 162, 163, 164, 165, 166,
- 167, 168, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 169, 170, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 171, 172, 173, 174, 175, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 176,
- 16, 177, 178, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 17, 87, 88, 89, 90, 91,
+ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 103, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 104, 105, 106, 107, 108,
+ 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
+ 123, 124, 125, 126, 127, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 128, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 129, 130,
+ 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
+ 145, 146, 17, 147, 148, 149, 150, 151, 17, 17, 17, 17, 17, 17, 152, 17,
+ 153, 17, 154, 17, 155, 17, 156, 17, 17, 17, 157, 17, 17, 17, 158, 159,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 160, 161, 162, 163, 164,
+ 165, 166, 17, 167, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 168, 169, 170, 171, 172, 173,
+ 174, 175, 176, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 177,
+ 178, 179, 180, 181, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 182, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 183, 184, 185, 186, 187, 17, 188,
+ 17, 189, 190, 191, 192, 193, 194, 195, 196, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 197, 198, 199, 200, 201, 17, 202, 203, 204, 205, 206,
+ 207, 208, 209, 210, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 211, 212, 213,
+ 214, 215, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 216, 17, 217, 218, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
};
static unsigned int phrasebook_offset2[] = {
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, 1, 3, 6, 9, 11, 14, 17, 19, 21, 24, 27, 29, 31,
33, 35, 39, 41, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 69, 72,
- 75, 78, 82, 86, 91, 96, 101, 105, 110, 114, 118, 122, 127, 132, 136, 140,
- 144, 148, 153, 158, 162, 166, 171, 175, 179, 184, 189, 194, 199, 202,
- 206, 209, 213, 216, 220, 224, 229, 234, 239, 243, 248, 252, 256, 260,
- 265, 270, 274, 278, 282, 286, 291, 296, 300, 304, 309, 313, 317, 322,
- 327, 332, 337, 341, 344, 348, 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, 349, 353, 358,
- 361, 364, 367, 370, 373, 376, 377, 380, 386, 394, 396, 400, 403, 405,
- 408, 411, 414, 417, 421, 424, 427, 431, 433, 436, 442, 450, 457, 464,
- 471, 476, 483, 489, 496, 502, 508, 516, 521, 529, 536, 542, 549, 555,
- 563, 570, 578, 585, 590, 597, 604, 610, 617, 623, 629, 632, 638, 645,
- 651, 658, 664, 671, 676, 682, 689, 695, 702, 708, 714, 722, 727, 735,
- 742, 748, 755, 761, 769, 776, 784, 791, 796, 803, 810, 816, 823, 829,
- 835, 838, 844, 851, 857, 864, 870, 877, 882, 889, 896, 903, 910, 917,
- 924, 931, 938, 945, 953, 961, 969, 977, 985, 993, 1001, 1009, 1016, 1023,
- 1030, 1037, 1044, 1051, 1058, 1065, 1072, 1079, 1086, 1093, 1101, 1109,
- 1117, 1125, 1133, 1141, 1149, 1157, 1165, 1173, 1180, 1187, 1194, 1201,
- 1209, 1217, 1225, 1233, 1241, 1249, 1257, 1263, 1268, 1273, 1281, 1289,
- 1297, 1305, 1310, 1317, 1324, 1332, 1340, 1348, 1356, 1366, 1376, 1383,
- 1390, 1397, 1404, 1412, 1420, 1428, 1436, 1447, 1452, 1457, 1464, 1471,
- 1478, 1485, 1492, 1499, 1504, 1509, 1516, 1523, 1531, 1539, 1547, 1555,
- 1562, 1569, 1577, 1585, 1593, 1601, 1609, 1617, 1625, 1633, 1641, 1649,
- 1656, 1663, 1669, 1675, 1682, 1689, 1696, 1703, 1711, 1719, 1726, 1733,
- 1740, 1747, 1755, 1763, 1771, 1779, 1786, 1793, 1800, 1808, 1816, 1824,
- 1832, 1837, 1843, 1849, 1856, 1863, 1868, 1873, 1879, 1886, 1893, 1900,
- 1907, 1915, 1923, 1929, 1934, 1939, 1945, 1952, 1959, 1966, 1971, 1976,
- 1981, 1988, 1995, 2002, 2009, 2016, 2021, 2029, 2039, 2047, 2054, 2061,
- 2066, 2071, 2078, 2085, 2089, 2094, 2099, 2104, 2111, 2120, 2127, 2134,
- 2143, 2150, 2157, 2162, 2169, 2176, 2183, 2190, 2197, 2202, 2209, 2216,
- 2224, 2229, 2234, 2239, 2249, 2253, 2259, 2265, 2271, 2277, 2285, 2298,
- 2306, 2311, 2321, 2326, 2331, 2341, 2346, 2353, 2360, 2368, 2376, 2383,
- 2390, 2397, 2404, 2414, 2424, 2433, 2442, 2452, 2462, 2472, 2482, 2487,
- 2497, 2507, 2517, 2527, 2535, 2543, 2550, 2557, 2565, 2573, 2581, 2589,
- 2596, 2603, 2613, 2623, 2631, 2639, 2647, 2652, 2662, 2667, 2674, 2681,
- 2686, 2691, 2699, 2707, 2717, 2727, 2734, 2741, 2749, 2757, 2765, 2773,
- 2782, 2791, 2799, 2807, 2816, 2825, 2834, 2843, 2853, 2863, 2871, 2879,
- 2888, 2897, 2906, 2915, 2925, 2935, 2943, 2951, 2960, 2969, 2978, 2987,
- 2996, 3005, 3010, 3015, 3023, 3031, 3041, 3049, 3054, 3059, 3066, 3073,
- 3080, 3087, 3094, 3101, 3111, 3121, 3131, 3141, 3148, 3155, 3165, 3175,
- 3183, 3191, 3199, 3207, 3215, 3222, 3229, 3236, 3242, 3249, 3256, 3263,
- 3272, 3282, 3292, 3299, 3306, 3312, 3317, 3322, 3328, 3334, 3341, 3348,
- 3359, 3369, 3376, 3383, 3390, 3397, 3402, 3407, 3413, 3419, 3425, 3433,
- 3441, 3448, 3453, 3458, 3465, 3471, 3478, 3487, 3496, 3505, 3512, 3517,
- 3522, 3527, 3534, 3539, 3546, 3553, 3560, 3565, 3570, 3579, 3587, 3596,
- 3601, 3606, 3616, 3623, 3631, 3640, 3645, 3651, 3657, 3664, 3669, 3674,
- 3684, 3692, 3701, 3709, 3717, 3726, 3731, 3738, 3745, 3750, 3761, 3769,
- 3777, 3783, 3792, 3797, 3802, 3809, 3814, 3820, 3826, 3832, 3841, 3849,
- 3854, 3862, 3868, 3876, 3884, 3890, 3896, 3902, 3910, 3918, 3923, 3931,
- 3937, 3942, 3949, 3957, 3966, 3973, 3980, 3990, 3997, 4004, 4014, 4021,
- 4028, 4035, 4041, 4047, 4056, 4068, 4072, 4079, 4084, 4088, 4093, 4101,
- 4108, 4113, 4118, 4122, 4127, 4132, 4136, 4141, 4147, 4153, 4159, 4166,
- 4171, 4176, 4181, 4186, 4192, 4194, 4199, 4203, 4209, 4215, 4221, 4226,
- 4233, 4240, 4246, 4253, 4261, 4269, 4274, 4279, 4283, 4288, 4290, 4292,
- 4295, 4297, 4299, 4304, 4309, 4315, 4320, 4324, 4328, 4333, 4341, 4347,
- 4352, 4358, 4363, 4369, 4377, 4385, 4389, 4393, 4398, 4404, 4410, 4416,
- 4422, 4427, 4435, 4444, 4453, 4457, 4463, 4470, 4477, 4484, 4491, 4495,
- 4501, 4506, 4511, 4516, 4521, 4523, 4526, 4529, 4532, 4535, 4537, 4541,
- 4545, 4551, 4554, 4559, 4565, 4571, 4574, 4579, 4584, 4588, 4593, 4599,
- 4605, 4611, 4616, 4621, 4626, 4629, 4635, 4640, 4645, 4649, 4654, 4660,
- 4666, 4669, 4673, 4677, 4681, 4684, 4687, 4692, 4696, 4703, 4707, 4713,
- 4717, 4723, 4727, 4731, 4735, 4740, 4745, 4751, 4756, 4763, 4769, 4775,
- 4781, 4784, 4788, 4792, 4795, 4799, 4804, 4809, 4813, 4817, 4823, 4827,
- 4831, 4836, 4842, 4847, 4852, 4856, 4862, 4867, 4872, 4877, 4882, 4888,
- 4891, 4895, 4900, 4905, 4914, 4920, 4925, 4929, 4934, 4938, 4943, 4947,
- 4951, 4956, 4959, 4965, 4970, 4975, 4980, 4985, 4990, 4995, 5001, 5007,
- 5012, 5017, 5022, 5028, 5033, 5039, 5044, 5049, 5056, 5063, 5066, 5070,
- 5077, 0, 0, 5084, 5087, 5095, 5104, 5114, 0, 0, 0, 0, 0, 5118, 5121,
- 5126, 5134, 5139, 5147, 5155, 0, 5163, 0, 5171, 5179, 5187, 5198, 5203,
- 5208, 5213, 5218, 5223, 5228, 5233, 5238, 5243, 5248, 5253, 5258, 5263,
- 5268, 5273, 5278, 0, 5283, 5288, 5293, 5298, 5303, 5308, 5313, 5318,
- 5326, 5334, 5342, 5350, 5358, 5366, 5377, 5382, 5387, 5392, 5397, 5402,
- 5407, 5412, 5417, 5422, 5427, 5432, 5437, 5442, 5447, 5452, 5457, 5462,
- 5468, 5473, 5478, 5483, 5488, 5493, 5498, 5503, 5511, 5519, 5527, 5535,
- 5543, 5548, 5552, 5556, 5563, 5573, 5583, 5587, 5591, 5595, 5601, 5608,
- 5612, 5617, 5621, 5626, 5630, 5635, 5639, 5644, 5649, 5654, 5659, 5664,
- 5669, 5674, 5679, 5684, 5689, 5694, 5699, 5704, 5709, 5714, 5718, 5722,
- 5728, 5732, 5737, 5743, 5750, 5755, 5760, 5767, 5772, 5777, 5783, 5791,
- 5800, 5810, 5818, 5823, 5828, 5833, 5840, 5845, 5851, 5856, 5861, 5866,
- 5871, 5876, 5881, 5889, 5895, 5900, 5904, 5909, 5914, 5919, 5924, 5929,
- 5934, 5939, 5943, 5949, 5953, 5958, 5963, 5968, 5972, 5977, 5982, 5987,
- 5992, 5996, 6001, 6005, 6010, 6015, 6020, 6025, 6031, 6036, 6042, 6046,
- 6051, 6055, 6059, 6064, 6069, 6074, 6079, 6084, 6089, 6094, 6098, 6104,
- 6108, 6113, 6118, 6123, 6127, 6132, 6137, 6142, 6147, 6151, 6156, 6160,
- 6165, 6170, 6175, 6180, 6186, 6191, 6197, 6201, 6206, 6210, 6218, 6223,
- 6228, 6233, 6240, 6245, 6251, 6256, 6261, 6266, 6271, 6276, 6281, 6289,
- 6295, 6300, 6305, 6310, 6315, 6320, 6326, 6332, 6339, 6346, 6355, 6364,
- 6371, 6378, 6387, 6396, 6401, 6406, 6411, 6416, 6421, 6426, 6431, 6436,
- 6447, 6458, 6463, 6468, 6475, 6482, 6490, 6498, 6503, 6508, 6513, 6518,
- 6522, 6526, 6530, 6535, 6540, 6544, 6551, 6556, 6566, 6576, 6582, 6588,
- 6596, 6604, 6612, 6620, 6627, 6634, 6643, 6652, 6660, 6668, 6676, 6684,
- 6691, 6698, 6705, 6712, 6718, 6724, 6730, 6736, 6744, 6752, 6759, 6766,
- 6775, 6784, 6790, 6796, 6804, 6812, 6820, 6828, 6834, 6840, 6848, 6856,
- 6864, 6872, 6879, 6886, 6894, 6902, 6910, 6918, 6923, 6928, 6935, 6942,
- 6952, 6962, 6966, 6974, 6982, 6988, 6994, 7002, 7010, 7017, 7024, 7032,
- 7040, 7047, 7054, 7062, 7070, 7075, 7082, 7089, 7095, 7101, 7107, 7113,
- 7121, 7129, 7134, 7139, 7146, 7153, 7160, 7167, 7174, 7181, 7188, 7195,
- 7203, 7211, 7218, 7225, 7231, 7237, 7243, 7249, 7257, 7265, 7271, 7277,
- 7284, 7291, 7297, 7303, 7310, 7317, 7324, 7331, 7339, 7347, 7354, 7361,
- 7370, 7379, 7386, 7393, 7400, 7407, 7414, 7421, 7428, 7435, 7442, 7449,
- 7456, 7463, 7470, 7477, 7484, 7491, 7498, 7505, 7512, 7519, 7525, 7531,
- 7538, 7545, 7550, 7555, 7560, 7565, 7570, 7575, 7580, 7585, 7590, 7595,
- 7601, 7607, 7616, 7625, 7634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7643, 7648, 7653, 7658, 7663, 7668, 7673, 7678, 7683, 7687, 7692, 7697,
- 7702, 7707, 7712, 7717, 7722, 7727, 7732, 7737, 7742, 7747, 7752, 7757,
- 7762, 7767, 7772, 7777, 7781, 7786, 7791, 7796, 7801, 7806, 7811, 7816,
- 7821, 7826, 0, 0, 7831, 7838, 7841, 7845, 7849, 7852, 7856, 0, 7860,
- 7865, 7870, 7875, 7880, 7885, 7890, 7895, 7900, 7904, 7909, 7914, 7919,
- 7924, 7929, 7934, 7939, 7944, 7949, 7954, 7959, 7964, 7969, 7974, 7979,
- 7984, 7989, 7994, 7998, 8003, 8008, 8013, 8018, 8023, 8028, 8033, 8038,
- 8043, 8048, 0, 8055, 8060, 0, 0, 0, 0, 0, 0, 8063, 8068, 8073, 8078,
- 8085, 8092, 8097, 8102, 8107, 8112, 8117, 8122, 8127, 8134, 8139, 8146,
- 8153, 8158, 8165, 8170, 8175, 8180, 8187, 8192, 8197, 8204, 8213, 8218,
- 8223, 8228, 8233, 8239, 8244, 8251, 8258, 8265, 8270, 8275, 8280, 8285,
- 8290, 8295, 8305, 8310, 8318, 8323, 8328, 8333, 8338, 8345, 8352, 8359,
- 8365, 8370, 8377, 0, 0, 0, 0, 0, 0, 0, 0, 8384, 8388, 8392, 8396, 8400,
- 8404, 8408, 8412, 8416, 8420, 8424, 8429, 8433, 8437, 8442, 8446, 8451,
- 8455, 8459, 8463, 8468, 8472, 8477, 8481, 8485, 8489, 8493, 0, 0, 0, 0,
- 0, 8497, 8504, 8512, 8519, 8524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8529,
- 8532, 8536, 8541, 0, 0, 8545, 8551, 8557, 8560, 8567, 8576, 8579, 8582,
- 8587, 8593, 8597, 8605, 8611, 8617, 8625, 8629, 8634, 8644, 8649, 8653,
- 8657, 8661, 0, 0, 8664, 8671, 0, 8675, 8679, 8686, 8692, 8699, 8705,
- 8711, 8715, 8719, 8725, 8729, 8733, 8737, 8741, 8745, 8749, 8753, 8757,
- 8761, 8765, 8769, 8773, 8777, 8781, 8785, 8789, 8793, 8801, 8809, 8818,
- 8827, 8836, 8839, 8843, 8847, 8851, 8855, 8859, 8863, 8867, 8871, 8876,
- 8880, 8883, 8886, 8889, 8892, 8895, 8898, 8901, 8904, 8908, 8911, 8914,
- 8919, 8924, 8930, 8933, 8940, 8949, 8954, 8958, 0, 8965, 8970, 8974,
- 8978, 8982, 8986, 8990, 8994, 8998, 9002, 9006, 9010, 9015, 9020, 9027,
- 9033, 9039, 9045, 9050, 9058, 9066, 9071, 9077, 9083, 9089, 9095, 9099,
- 9103, 9107, 9114, 9124, 9128, 9132, 9136, 9142, 9150, 9154, 9158, 9165,
- 9169, 9173, 9177, 9184, 9191, 9203, 9207, 9211, 9215, 9225, 9234, 9238,
- 9245, 9252, 9259, 9268, 9279, 9287, 9291, 9300, 9311, 9319, 9332, 9340,
- 9348, 9356, 9364, 9370, 9379, 9386, 9390, 9398, 9402, 9409, 9417, 9421,
- 9427, 9434, 9441, 9445, 9453, 9457, 9464, 9468, 9476, 9480, 9488, 9494,
- 9500, 9507, 9514, 9521, 9527, 9531, 9538, 9546, 9552, 9559, 9566, 9572,
- 9581, 9589, 9596, 9602, 9606, 9609, 9613, 9619, 9627, 9631, 9637, 9643,
- 9649, 9656, 9659, 9666, 9671, 9679, 9684, 9688, 9700, 9712, 9718, 9724,
- 9729, 9735, 9740, 9746, 9756, 9763, 9772, 9782, 9788, 9793, 9798, 9802,
- 9806, 9811, 9816, 9822, 9830, 9838, 9849, 9854, 9862, 9870, 9877, 9883,
- 9889, 9895, 9901, 9907, 9913, 9919, 9925, 9931, 9938, 9945, 9952, 9958,
- 9966, 9974, 9980, 9987, 9994, 9999, 10004, 10008, 10015, 10022, 10031,
- 10040, 10043, 10048, 10053, 0, 10058, 10062, 10066, 10072, 10076, 10080,
- 10086, 10090, 10098, 10102, 10106, 10110, 10114, 10118, 10124, 10128,
- 10134, 10138, 10142, 10146, 10150, 10154, 10159, 10162, 10166, 10171,
- 10175, 10179, 10183, 10187, 10191, 10197, 10203, 10209, 10213, 10217,
- 10222, 10226, 10230, 10235, 10239, 10243, 10250, 10257, 10261, 10265,
- 10270, 10274, 10278, 10281, 10286, 10289, 10292, 10297, 10302, 10306,
- 10310, 10316, 10322, 10325, 0, 0, 10328, 10334, 10340, 10346, 10356,
- 10368, 10380, 10397, 10409, 10420, 10427, 10434, 10445, 10460, 10471,
- 10477, 10486, 10494, 10506, 10516, 10524, 10536, 10543, 10551, 10563,
- 10569, 10575, 10583, 10591, 10598, 10603, 10613, 10620, 10630, 10640,
- 10653, 10667, 10681, 10691, 10702, 10713, 10726, 10739, 10753, 10765,
- 10777, 10790, 10803, 10815, 10828, 10836, 10844, 10849, 10854, 10859,
- 10864, 10869, 10874, 10879, 10884, 10889, 10894, 10899, 10904, 10909,
- 10914, 10919, 10924, 10929, 10934, 10939, 10944, 10949, 10954, 10959,
- 10964, 10969, 10974, 10979, 10984, 10989, 10994, 10999, 11004, 11008,
- 11013, 11018, 11023, 11028, 11033, 11037, 11041, 11045, 11049, 11053,
- 11057, 11061, 11065, 11069, 11073, 11077, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 11082, 11086, 11089, 11092, 11095, 11098, 11101, 11104,
- 11107, 11110, 11113, 11116, 11120, 11123, 11126, 11129, 11133, 11136,
- 11140, 11143, 11147, 11150, 11154, 11158, 11162, 11166, 11169, 11173,
- 11177, 11181, 11185, 11188, 11192, 11198, 11201, 11205, 11209, 11212,
- 11216, 11219, 11225, 11231, 11237, 11242, 11249, 11256, 11264, 11271,
- 11277, 11283, 11290, 11295, 11300, 11305, 11310, 11316, 11320, 11323,
- 11327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 75, 78, 82, 86, 91, 96, 101, 105, 110, 115, 120, 124, 129, 134, 138, 142,
+ 146, 150, 155, 160, 164, 168, 173, 177, 182, 187, 192, 197, 202, 205,
+ 209, 212, 216, 219, 223, 227, 232, 237, 242, 246, 251, 256, 261, 265,
+ 270, 275, 279, 283, 287, 291, 296, 301, 305, 309, 314, 318, 323, 328,
+ 333, 338, 343, 347, 350, 354, 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, 356, 360, 365,
+ 368, 371, 374, 377, 380, 383, 385, 388, 394, 402, 405, 409, 412, 414,
+ 417, 420, 423, 426, 430, 433, 436, 440, 442, 445, 451, 459, 466, 473,
+ 480, 485, 492, 498, 505, 512, 519, 527, 532, 540, 547, 553, 560, 567,
+ 575, 582, 590, 598, 603, 611, 618, 624, 631, 638, 645, 648, 654, 661,
+ 667, 674, 681, 688, 693, 699, 706, 712, 719, 726, 733, 741, 746, 754,
+ 761, 767, 774, 781, 789, 796, 804, 812, 817, 825, 832, 838, 845, 852,
+ 859, 862, 868, 875, 881, 888, 895, 902, 907, 915, 922, 929, 936, 943,
+ 950, 957, 964, 971, 979, 987, 995, 1003, 1011, 1019, 1027, 1035, 1042,
+ 1049, 1056, 1063, 1070, 1077, 1084, 1091, 1098, 1105, 1112, 1119, 1127,
+ 1135, 1143, 1151, 1159, 1167, 1175, 1183, 1191, 1199, 1206, 1213, 1221,
+ 1229, 1237, 1245, 1253, 1261, 1269, 1277, 1285, 1291, 1296, 1301, 1309,
+ 1317, 1325, 1333, 1338, 1345, 1352, 1360, 1368, 1376, 1384, 1394, 1404,
+ 1411, 1418, 1425, 1432, 1440, 1448, 1456, 1464, 1475, 1480, 1485, 1492,
+ 1499, 1506, 1513, 1520, 1527, 1532, 1537, 1544, 1551, 1559, 1567, 1575,
+ 1583, 1590, 1597, 1605, 1613, 1621, 1629, 1637, 1645, 1653, 1661, 1669,
+ 1677, 1684, 1691, 1698, 1705, 1712, 1719, 1726, 1733, 1741, 1749, 1756,
+ 1763, 1770, 1777, 1785, 1793, 1801, 1809, 1817, 1824, 1831, 1839, 1847,
+ 1855, 1863, 1868, 1874, 1880, 1887, 1894, 1899, 1904, 1910, 1917, 1924,
+ 1931, 1938, 1946, 1954, 1961, 1967, 1972, 1978, 1985, 1992, 1999, 2004,
+ 2009, 2014, 2021, 2028, 2035, 2042, 2049, 2055, 2063, 2073, 2082, 2089,
+ 2096, 2101, 2106, 2113, 2120, 2124, 2129, 2134, 2139, 2147, 2156, 2163,
+ 2170, 2179, 2186, 2193, 2198, 2205, 2212, 2219, 2226, 2233, 2238, 2245,
+ 2252, 2260, 2265, 2270, 2275, 2285, 2289, 2295, 2301, 2307, 2313, 2321,
+ 2334, 2342, 2347, 2357, 2362, 2367, 2377, 2382, 2389, 2396, 2404, 2412,
+ 2419, 2426, 2433, 2440, 2450, 2460, 2469, 2478, 2488, 2498, 2508, 2518,
+ 2524, 2534, 2544, 2554, 2564, 2572, 2580, 2587, 2594, 2602, 2610, 2618,
+ 2626, 2633, 2640, 2650, 2660, 2668, 2676, 2684, 2689, 2699, 2704, 2711,
+ 2718, 2723, 2728, 2736, 2744, 2754, 2764, 2771, 2778, 2787, 2796, 2804,
+ 2812, 2821, 2830, 2838, 2846, 2855, 2864, 2873, 2882, 2892, 2902, 2910,
+ 2918, 2927, 2936, 2945, 2954, 2964, 2974, 2982, 2990, 2999, 3008, 3017,
+ 3026, 3035, 3044, 3049, 3054, 3062, 3070, 3080, 3088, 3093, 3098, 3105,
+ 3112, 3119, 3126, 3133, 3140, 3150, 3160, 3170, 3180, 3187, 3194, 3204,
+ 3214, 3222, 3230, 3238, 3246, 3254, 3261, 3268, 3275, 3281, 3288, 3295,
+ 3302, 3311, 3321, 3331, 3338, 3345, 3351, 3356, 3363, 3369, 3375, 3382,
+ 3389, 3400, 3410, 3417, 3424, 3431, 3438, 3444, 3449, 3456, 3462, 3468,
+ 3476, 3484, 3491, 3497, 3502, 3509, 3515, 3523, 3533, 3543, 3552, 3559,
+ 3565, 3571, 3576, 3583, 3590, 3597, 3604, 3611, 3616, 3621, 3631, 3639,
+ 3648, 3653, 3659, 3670, 3677, 3685, 3694, 3699, 3705, 3711, 3718, 3723,
+ 3729, 3740, 3749, 3758, 3766, 3774, 3784, 3789, 3796, 3803, 3808, 3820,
+ 3829, 3837, 3844, 3853, 3858, 3863, 3870, 3877, 3884, 3891, 3897, 3906,
+ 3914, 3919, 3927, 3933, 3941, 3949, 3955, 3961, 3967, 3975, 3983, 3989,
+ 3997, 4004, 4009, 4016, 4024, 4034, 4041, 4048, 4058, 4065, 4072, 4082,
+ 4089, 4096, 4103, 4109, 4115, 4125, 4138, 4143, 4150, 4155, 4159, 4165,
+ 4174, 4181, 4186, 4191, 4195, 4200, 4206, 4210, 4216, 4222, 4228, 4234,
+ 4242, 4247, 4252, 4257, 4262, 4268, 4270, 4275, 4279, 4285, 4291, 4297,
+ 4302, 4309, 4316, 4322, 4329, 4337, 4345, 4350, 4355, 4359, 4364, 4366,
+ 4368, 4371, 4373, 4376, 4381, 4386, 4392, 4397, 4401, 4405, 4410, 4419,
+ 4425, 4430, 4436, 4441, 4447, 4455, 4463, 4467, 4471, 4476, 4482, 4488,
+ 4494, 4500, 4505, 4513, 4522, 4531, 4536, 4542, 4549, 4556, 4563, 4570,
+ 4574, 4580, 4585, 4590, 4595, 4600, 4603, 4606, 4609, 4612, 4615, 4618,
+ 4622, 4626, 4632, 4635, 4640, 4646, 4652, 4655, 4660, 4666, 4670, 4676,
+ 4682, 4688, 4694, 4699, 4704, 4709, 4712, 4718, 4723, 4728, 4732, 4737,
+ 4743, 4749, 4752, 4756, 4760, 4764, 4767, 4770, 4775, 4779, 4786, 4790,
+ 4796, 4800, 4806, 4810, 4814, 4818, 4823, 4828, 4835, 4841, 4848, 4854,
+ 4860, 4866, 4869, 4873, 4877, 4881, 4885, 4890, 4895, 4899, 4903, 4909,
+ 4913, 4917, 4922, 4928, 4933, 4939, 4943, 4950, 4955, 4960, 4965, 4970,
+ 4976, 4979, 4983, 4988, 4993, 5002, 5008, 5013, 5017, 5022, 5026, 5031,
+ 5035, 5039, 5044, 5048, 5054, 5059, 5064, 5069, 5074, 5079, 5084, 5090,
+ 5096, 5102, 5107, 5112, 5118, 5124, 5130, 5135, 5140, 5147, 5154, 5158,
+ 5164, 5171, 0, 0, 5178, 5181, 5190, 5199, 5210, 0, 0, 0, 0, 0, 5214,
+ 5217, 5222, 5230, 5235, 5243, 5251, 0, 5259, 0, 5267, 5275, 5283, 5294,
+ 5299, 5304, 5309, 5314, 5319, 5324, 5329, 5334, 5339, 5344, 5349, 5354,
+ 5359, 5364, 5369, 5374, 0, 5379, 5384, 5389, 5394, 5399, 5404, 5409,
+ 5414, 5422, 5430, 5438, 5446, 5454, 5462, 5473, 5478, 5483, 5488, 5493,
+ 5498, 5503, 5508, 5513, 5518, 5523, 5528, 5533, 5538, 5543, 5548, 5553,
+ 5558, 5564, 5569, 5574, 5579, 5584, 5589, 5594, 5599, 5607, 5615, 5623,
+ 5631, 5639, 5644, 5648, 5652, 5659, 5669, 5679, 5683, 5687, 5691, 5697,
+ 5704, 5708, 5713, 5717, 5722, 5726, 5731, 5735, 5740, 5745, 5750, 5755,
+ 5760, 5765, 5770, 5775, 5780, 5785, 5790, 5795, 5800, 5805, 5810, 5814,
+ 5818, 5824, 5828, 5833, 5839, 5847, 5852, 5857, 5864, 5869, 5874, 5881,
+ 5890, 5899, 5910, 5918, 5923, 5928, 5933, 5940, 5945, 5951, 5956, 5961,
+ 5966, 5971, 5976, 5981, 5989, 5995, 6000, 6004, 6009, 6014, 6019, 6024,
+ 6029, 6034, 6039, 6043, 6049, 6053, 6058, 6063, 6068, 6072, 6077, 6082,
+ 6087, 6092, 6096, 6101, 6105, 6110, 6115, 6120, 6125, 6131, 6136, 6142,
+ 6146, 6151, 6155, 6159, 6164, 6169, 6174, 6179, 6184, 6189, 6194, 6198,
+ 6204, 6208, 6213, 6218, 6223, 6227, 6232, 6237, 6242, 6247, 6251, 6256,
+ 6260, 6265, 6270, 6275, 6280, 6286, 6291, 6297, 6301, 6306, 6310, 6318,
+ 6323, 6328, 6333, 6340, 6345, 6351, 6356, 6361, 6366, 6371, 6376, 6381,
+ 6389, 6395, 6400, 6405, 6410, 6415, 6420, 6426, 6432, 6439, 6446, 6455,
+ 6464, 6471, 6478, 6487, 6496, 6501, 6506, 6511, 6516, 6521, 6526, 6531,
+ 6536, 6547, 6558, 6563, 6568, 6575, 6582, 6590, 6598, 6603, 6608, 6613,
+ 6618, 6622, 6626, 6630, 6635, 6641, 6645, 6652, 6657, 6667, 6677, 6683,
+ 6689, 6697, 6705, 6713, 6721, 6728, 6735, 6744, 6753, 6761, 6769, 6777,
+ 6785, 6793, 6801, 6809, 6817, 6824, 6831, 6837, 6843, 6851, 6859, 6866,
+ 6873, 6882, 6891, 6897, 6903, 6911, 6919, 6927, 6935, 6941, 6947, 6955,
+ 6963, 6971, 6979, 6986, 6993, 7001, 7009, 7017, 7025, 7030, 7035, 7042,
+ 7049, 7059, 7069, 7073, 7081, 7089, 7096, 7103, 7111, 7119, 7126, 7133,
+ 7141, 7149, 7156, 7163, 7171, 7179, 7184, 7191, 7198, 7205, 7212, 7218,
+ 7224, 7232, 7240, 7245, 7250, 7258, 7266, 7274, 7282, 7290, 7298, 7305,
+ 7312, 7320, 7328, 7336, 7344, 7351, 7358, 7364, 7370, 7379, 7388, 7395,
+ 7402, 7409, 7416, 7423, 7430, 7437, 7444, 7452, 7460, 7468, 7476, 7484,
+ 7492, 7502, 7512, 7519, 7526, 7533, 7540, 7547, 7554, 7561, 7568, 7575,
+ 7582, 7589, 7596, 7603, 7610, 7617, 7624, 7631, 7638, 7645, 7652, 7659,
+ 7666, 7673, 7680, 7685, 7690, 7695, 7700, 7705, 7710, 7715, 7720, 7725,
+ 7730, 7736, 7742, 7751, 7760, 7769, 7778, 7786, 7794, 7802, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7810, 7815, 7820, 7825, 7830, 7835, 7840, 7845, 7850,
+ 7854, 7859, 7864, 7869, 7874, 7879, 7884, 7889, 7894, 7899, 7904, 7909,
+ 7914, 7919, 7924, 7929, 7934, 7939, 7944, 7948, 7953, 7958, 7963, 7968,
+ 7973, 7978, 7983, 7988, 7993, 0, 0, 7998, 8005, 8008, 8012, 8016, 8019,
+ 8023, 0, 8027, 8032, 8037, 8042, 8047, 8052, 8057, 8062, 8067, 8071,
+ 8076, 8081, 8086, 8091, 8096, 8101, 8106, 8111, 8116, 8121, 8126, 8131,
+ 8136, 8141, 8146, 8151, 8156, 8161, 8165, 8170, 8175, 8180, 8185, 8190,
+ 8195, 8200, 8205, 8210, 8215, 0, 8222, 8227, 0, 0, 0, 0, 0, 0, 8230,
+ 8235, 8240, 8245, 8252, 8259, 8264, 8269, 8274, 8279, 8284, 8289, 8294,
+ 8301, 8306, 8313, 8320, 8325, 8332, 8337, 8342, 8347, 8354, 8359, 8364,
+ 8371, 8380, 8385, 8390, 8395, 8400, 8406, 8411, 8418, 8425, 8432, 8437,
+ 8442, 8447, 8452, 8457, 8462, 8472, 8477, 8485, 8490, 8495, 8500, 8505,
+ 8512, 8519, 8526, 8532, 8538, 8545, 0, 0, 0, 0, 0, 0, 0, 0, 8552, 8556,
+ 8560, 8564, 8568, 8572, 8576, 8580, 8584, 8588, 8592, 8597, 8601, 8605,
+ 8610, 8614, 8619, 8623, 8627, 8631, 8636, 8640, 8645, 8649, 8653, 8657,
+ 8661, 0, 0, 0, 0, 0, 8665, 8672, 8680, 8687, 8692, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 8697, 8700, 8704, 8709, 0, 0, 8713, 8719, 8725, 8728, 8735,
+ 8744, 8747, 8750, 8755, 8761, 8765, 8773, 8779, 8785, 8793, 8797, 8802,
+ 8813, 8818, 8822, 8826, 8830, 0, 0, 8833, 8840, 8844, 8850, 8854, 8861,
+ 8867, 8874, 8880, 8886, 8890, 8894, 8900, 8904, 8908, 8912, 8916, 8920,
+ 8924, 8928, 8932, 8936, 8940, 8944, 8948, 8952, 8956, 8960, 8964, 8968,
+ 8976, 8984, 8994, 9003, 9012, 9015, 9019, 9023, 9027, 9031, 9035, 9039,
+ 9043, 9047, 9052, 9056, 9059, 9062, 9065, 9068, 9071, 9074, 9077, 9080,
+ 9084, 9087, 9090, 9095, 9100, 9106, 9109, 9116, 9125, 9130, 9135, 9142,
+ 9147, 9152, 9156, 9160, 9164, 9168, 9172, 9176, 9180, 9184, 9188, 9192,
+ 9197, 9202, 9209, 9215, 9221, 9227, 9232, 9240, 9248, 9253, 9259, 9265,
+ 9271, 9277, 9281, 9285, 9289, 9296, 9306, 9310, 9314, 9318, 9324, 9332,
+ 9336, 9340, 9347, 9351, 9355, 9359, 9366, 9373, 9385, 9389, 9393, 9397,
+ 9407, 9416, 9420, 9428, 9435, 9442, 9451, 9462, 9470, 9474, 9483, 9494,
+ 9502, 9515, 9523, 9531, 9539, 9547, 9553, 9562, 9569, 9573, 9581, 9585,
+ 9592, 9600, 9604, 9610, 9617, 9624, 9628, 9636, 9640, 9647, 9651, 9659,
+ 9663, 9671, 9679, 9686, 9694, 9702, 9709, 9715, 9719, 9726, 9734, 9740,
+ 9747, 9754, 9760, 9769, 9777, 9784, 9790, 9794, 9797, 9801, 9807, 9815,
+ 9819, 9825, 9831, 9838, 9845, 9848, 9855, 9860, 9868, 9873, 9877, 9890,
+ 9903, 9909, 9916, 9921, 9927, 9932, 9938, 9948, 9955, 9964, 9974, 9980,
+ 9985, 9990, 9994, 9998, 10003, 10008, 10014, 10022, 10030, 10041, 10046,
+ 10055, 10064, 10071, 10077, 10083, 10089, 10095, 10101, 10107, 10113,
+ 10119, 10125, 10132, 10139, 10146, 10152, 10160, 10169, 10175, 10182,
+ 10189, 10194, 10199, 10203, 10210, 10217, 10226, 10235, 10238, 10243,
+ 10248, 0, 10253, 10257, 10261, 10267, 10271, 10275, 10281, 10285, 10293,
+ 10297, 10301, 10305, 10309, 10313, 10319, 10323, 10329, 10333, 10337,
+ 10341, 10345, 10349, 10354, 10357, 10361, 10367, 10371, 10375, 10379,
+ 10383, 10387, 10393, 10399, 10405, 10409, 10413, 10418, 10422, 10426,
+ 10431, 10435, 10439, 10446, 10453, 10457, 10461, 10466, 10470, 10474,
+ 10477, 10482, 10485, 10488, 10493, 10498, 10502, 10506, 10512, 10518,
+ 10521, 0, 0, 10524, 10530, 10536, 10542, 10552, 10564, 10576, 10593,
+ 10605, 10616, 10624, 10631, 10642, 10657, 10668, 10674, 10683, 10691,
+ 10703, 10713, 10721, 10733, 10740, 10748, 10760, 10766, 10772, 10780,
+ 10788, 10796, 10802, 10812, 10819, 10829, 10839, 10852, 10866, 10880,
+ 10890, 10901, 10912, 10925, 10938, 10952, 10964, 10976, 10989, 11002,
+ 11014, 11027, 11036, 11044, 11049, 11054, 11059, 11064, 11069, 11074,
+ 11079, 11084, 11089, 11094, 11099, 11104, 11109, 11114, 11119, 11124,
+ 11129, 11134, 11139, 11144, 11149, 11154, 11159, 11164, 11169, 11174,
+ 11179, 11184, 11189, 11194, 11199, 11204, 11208, 11213, 11218, 11223,
+ 11228, 11233, 11237, 11241, 11245, 11249, 11253, 11257, 11261, 11265,
+ 11269, 11273, 11277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11282,
+ 11287, 11291, 11295, 11299, 11303, 11307, 11311, 11315, 11319, 11323,
+ 11327, 11332, 11336, 11340, 11344, 11349, 11353, 11358, 11362, 11367,
+ 11371, 11376, 11381, 11386, 11391, 11395, 11400, 11405, 11410, 11415,
+ 11419, 11424, 11431, 11435, 11440, 11444, 11448, 11453, 11457, 11464,
+ 11471, 11478, 11484, 11492, 11500, 11509, 11517, 11524, 11531, 11539,
+ 11545, 11551, 11557, 11563, 11570, 11575, 11579, 11584, 0, 0, 0, 0, 0,
+ 11588, 11593, 11598, 11603, 11608, 11613, 11618, 11623, 11628, 11633,
+ 11638, 11643, 11648, 11653, 11658, 11663, 11668, 11673, 11678, 11683,
+ 11688, 11693, 11698, 11703, 11708, 11713, 11718, 11726, 11733, 11739,
+ 11744, 11752, 11759, 11765, 11772, 11778, 11783, 11790, 11797, 11803,
+ 11808, 11813, 11819, 11824, 11829, 11835, 0, 0, 11840, 11846, 11852,
+ 11858, 11864, 11870, 11876, 11881, 11889, 11895, 11901, 11907, 11913,
+ 11919, 11927, 0, 11933, 11938, 11943, 11948, 11953, 11958, 11963, 11968,
+ 11973, 11978, 11983, 11988, 11993, 11998, 12003, 12008, 12013, 12018,
+ 12023, 12028, 12033, 12038, 12043, 12048, 12053, 12058, 12063, 12068, 0,
+ 0, 12073, 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, 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, 0, 0, 0, 0, 0, 11330, 11334, 11338,
- 11342, 11347, 11350, 11354, 11357, 11361, 11364, 11368, 11372, 11376,
- 11381, 11386, 11389, 11393, 11398, 11403, 11406, 11410, 11413, 11417,
- 11421, 11425, 11429, 11433, 11437, 11441, 11445, 11449, 11453, 11457,
- 11461, 11465, 11469, 11473, 11477, 11481, 11485, 11489, 11493, 11496,
- 11500, 11504, 11508, 11511, 11514, 11517, 11521, 11525, 11529, 11533,
- 11537, 11541, 11545, 11549, 0, 0, 11552, 11556, 11560, 11565, 11569,
- 11574, 11578, 11583, 11588, 11594, 11600, 11606, 11610, 11615, 11621,
- 11627, 11631, 11636, 0, 0, 11640, 11643, 11649, 11655, 11660, 0, 0, 0,
- 11665, 11669, 11673, 11677, 11681, 11685, 11689, 11693, 11697, 11702,
- 11707, 11712, 11718, 11721, 11725, 11729, 11732, 11735, 11738, 11741,
- 11744, 11747, 11750, 11753, 11756, 11760, 11767, 0, 0, 0, 0, 0, 0, 0, 0,
- 11772, 11776, 11780, 11786, 11790, 0, 11794, 11798, 11802, 0, 11806,
- 11809, 11813, 11816, 11820, 11823, 11827, 11831, 0, 0, 11835, 11838, 0,
- 0, 11842, 11845, 11849, 11852, 11856, 11860, 11864, 11868, 11872, 11876,
- 11880, 11884, 11888, 11892, 11896, 11900, 11904, 11908, 11912, 11916,
- 11920, 11924, 0, 11928, 11931, 11935, 11939, 11943, 11946, 11949, 0,
- 11952, 0, 0, 0, 11956, 11960, 11964, 11968, 0, 0, 11971, 11975, 11979,
- 11984, 11988, 11993, 11997, 12002, 12007, 0, 0, 12013, 12017, 0, 0,
- 12022, 12026, 12031, 12035, 0, 0, 0, 0, 0, 0, 0, 0, 12041, 0, 0, 0, 0,
- 12047, 12051, 0, 12055, 12059, 12064, 12069, 12074, 0, 0, 12080, 12084,
- 12087, 12090, 12093, 12096, 12099, 12102, 12105, 12108, 12111, 12120,
- 12128, 12132, 12136, 12142, 12148, 12154, 12160, 12174, 12181, 0, 0, 0,
- 0, 0, 0, 12184, 12190, 12194, 0, 12198, 12201, 12205, 12208, 12212,
- 12215, 0, 0, 0, 0, 12219, 12223, 0, 0, 12227, 12231, 12235, 12238, 12242,
- 12246, 12250, 12254, 12258, 12262, 12266, 12270, 12274, 12278, 12282,
- 12286, 12290, 12294, 12298, 12302, 12306, 12310, 0, 12314, 12317, 12321,
- 12325, 12329, 12332, 12335, 0, 12338, 12342, 0, 12346, 12350, 0, 12354,
- 12358, 0, 0, 12361, 0, 12365, 12370, 12374, 12379, 12383, 0, 0, 0, 0,
- 12388, 12393, 0, 0, 12398, 12403, 12408, 0, 0, 0, 12412, 0, 0, 0, 0, 0,
- 0, 0, 12416, 12420, 12424, 12428, 0, 12432, 0, 0, 0, 0, 0, 0, 0, 12436,
- 12440, 12443, 12446, 12449, 12452, 12455, 12458, 12461, 12464, 12467,
- 12470, 12473, 12476, 12479, 12484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 12488, 12492, 12496, 0, 12500, 12503, 12507, 12510, 12514, 12517, 12521,
- 12525, 12529, 0, 12534, 12537, 12541, 0, 12546, 12549, 12553, 12556,
- 12560, 12564, 12568, 12572, 12576, 12580, 12584, 12588, 12592, 12596,
- 12600, 12604, 12608, 12612, 12616, 12620, 12624, 12628, 0, 12632, 12635,
- 12639, 12643, 12647, 12650, 12653, 0, 12656, 12660, 0, 12664, 12668,
- 12672, 12676, 12680, 0, 0, 12683, 12687, 12691, 12696, 12700, 12705,
- 12709, 12714, 12719, 12725, 0, 12731, 12735, 12740, 0, 12746, 12750,
- 12755, 0, 0, 12759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12762,
- 12767, 12772, 12777, 0, 0, 12783, 12787, 12790, 12793, 12796, 12799,
- 12802, 12805, 12808, 12811, 0, 12814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 12818, 12822, 12826, 0, 12830, 12833, 12837, 12840, 12844,
- 12847, 12851, 12855, 0, 0, 12859, 12862, 0, 0, 12866, 12869, 12873,
- 12876, 12880, 12884, 12888, 12892, 12896, 12900, 12904, 12908, 12912,
- 12916, 12920, 12924, 12928, 12932, 12936, 12940, 12944, 12948, 0, 12952,
- 12955, 12959, 12963, 12967, 12970, 12973, 0, 12976, 12980, 0, 12984,
- 12988, 12992, 12996, 13000, 0, 0, 13003, 13007, 13011, 13016, 13020,
- 13025, 13029, 13034, 13039, 0, 0, 13045, 13049, 0, 0, 13054, 13058,
- 13063, 0, 0, 0, 0, 0, 0, 0, 0, 13067, 13073, 0, 0, 0, 0, 13079, 13083, 0,
- 13087, 13091, 13096, 13101, 13106, 0, 0, 13112, 13116, 13119, 13122,
- 13125, 13128, 13131, 13134, 13137, 13140, 13143, 13146, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13150, 13154, 0, 13158, 13161, 13165,
- 13168, 13172, 13175, 0, 0, 0, 13179, 13182, 13186, 0, 13190, 13193,
- 13197, 13201, 0, 0, 0, 13204, 13208, 0, 13212, 0, 13216, 13220, 0, 0, 0,
- 13224, 13228, 0, 0, 0, 13232, 13236, 13240, 0, 0, 0, 13243, 13246, 13249,
- 13252, 13256, 13260, 13264, 13268, 13272, 13276, 13280, 13284, 0, 0, 0,
- 0, 13287, 13292, 13296, 13301, 13305, 0, 0, 0, 13310, 13314, 13319, 0,
- 13324, 13328, 13333, 13338, 0, 0, 13342, 0, 0, 0, 0, 0, 0, 13345, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13351, 13355, 13358, 13361, 13364,
- 13367, 13370, 13373, 13376, 13379, 13382, 13386, 13391, 13396, 13400,
- 13404, 13408, 13412, 13416, 13421, 13425, 0, 0, 0, 0, 0, 0, 13428, 13432,
- 13436, 0, 13440, 13443, 13447, 13450, 13454, 13457, 13461, 13465, 0,
- 13469, 13472, 13476, 0, 13480, 13483, 13487, 13491, 13494, 13498, 13502,
- 13506, 13510, 13514, 13518, 13522, 13526, 13530, 13534, 13538, 13542,
- 13546, 13550, 13554, 13558, 13562, 13566, 0, 13570, 13573, 13577, 13581,
- 13585, 13588, 13591, 13594, 13598, 13602, 0, 13606, 13610, 13614, 13618,
- 13622, 0, 0, 0, 13625, 13629, 13634, 13638, 13643, 13647, 13652, 13657,
- 0, 13663, 13667, 13672, 0, 13677, 13681, 13686, 13691, 0, 0, 0, 0, 0, 0,
- 0, 13695, 13699, 0, 13705, 13709, 0, 0, 0, 0, 0, 0, 13713, 13718, 13723,
- 13728, 0, 0, 13734, 13738, 13741, 13744, 13747, 13750, 13753, 13756,
- 13759, 13762, 0, 0, 0, 0, 0, 0, 0, 0, 13765, 13778, 13790, 13802, 13814,
- 13826, 13838, 13850, 0, 0, 13854, 13858, 0, 13862, 13865, 13869, 13872,
- 13876, 13879, 13883, 13887, 0, 13891, 13894, 13898, 0, 13902, 13905,
- 13909, 13913, 13916, 13920, 13924, 13928, 13932, 13936, 13940, 13944,
- 13948, 13952, 13956, 13960, 13964, 13968, 13972, 13976, 13980, 13984,
- 13988, 0, 13992, 13995, 13999, 14003, 14007, 14010, 14013, 14016, 14020,
- 14024, 0, 14028, 14032, 14036, 14040, 14044, 0, 0, 14047, 14051, 14055,
- 14060, 14064, 14069, 14073, 14078, 14083, 0, 14089, 14093, 14098, 0,
- 14103, 14107, 14112, 14117, 0, 0, 0, 0, 0, 0, 0, 14121, 14125, 0, 0, 0,
- 0, 0, 0, 0, 14131, 0, 14135, 14140, 14145, 14150, 0, 0, 14156, 14160,
- 14163, 14166, 14169, 14172, 14175, 14178, 14181, 14184, 0, 14187, 14191,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14195, 14199, 0, 14203,
- 14206, 14210, 14213, 14217, 14220, 14224, 14228, 0, 14232, 14235, 14239,
- 0, 14243, 14246, 14250, 14254, 14257, 14261, 14265, 14269, 14273, 14277,
- 14281, 14285, 14289, 14293, 14297, 14301, 14305, 14309, 14313, 14317,
- 14321, 14325, 14329, 0, 14333, 14336, 14340, 14344, 14348, 14351, 14354,
- 14357, 14361, 14365, 14369, 14373, 14377, 14381, 14385, 14389, 0, 0, 0,
- 14392, 14396, 14401, 14405, 14410, 14414, 14419, 14424, 0, 14430, 14434,
- 14439, 0, 14444, 14448, 14453, 14458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14462,
- 0, 0, 0, 0, 0, 0, 0, 0, 14468, 14473, 14478, 14483, 0, 0, 14489, 14493,
- 14496, 14499, 14502, 14505, 14508, 14511, 14514, 14517, 14520, 14524,
- 14529, 14534, 14540, 14546, 0, 0, 0, 14552, 14556, 14562, 14567, 14573,
- 14578, 14584, 0, 0, 14590, 14594, 0, 14598, 14602, 14606, 14610, 14614,
- 14618, 14622, 14626, 14630, 14634, 14638, 14642, 14646, 14650, 14654,
- 14658, 14662, 14666, 0, 0, 0, 14670, 14676, 14682, 14688, 14694, 14700,
- 14706, 14712, 14718, 14724, 14730, 14736, 14744, 14750, 14756, 14762,
- 14768, 14774, 14780, 14786, 14792, 14798, 14804, 14810, 0, 14816, 14822,
- 14828, 14834, 14840, 14846, 14850, 14856, 14860, 0, 14864, 0, 0, 14870,
- 14874, 14880, 14886, 14892, 14896, 14902, 0, 0, 0, 14906, 0, 0, 0, 0,
- 14910, 14915, 14922, 14929, 14936, 14943, 0, 14950, 0, 14957, 14962,
- 14967, 14974, 14981, 14990, 15001, 15010, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 15015, 15022, 15029, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 15034, 15040, 15046, 15052, 15058, 15064, 15070, 15076, 15082,
- 15088, 15094, 15100, 15106, 15112, 15118, 15123, 15129, 15135, 15141,
- 15147, 15153, 15158, 15164, 15170, 15176, 15182, 15188, 15194, 15200,
- 15206, 15212, 15218, 15224, 15229, 15235, 15241, 15245, 15251, 15255,
- 15261, 15267, 15273, 15279, 15285, 15291, 15296, 15302, 15306, 15311,
- 15317, 15323, 15329, 15334, 15340, 15346, 15352, 15357, 15363, 0, 0, 0,
- 0, 15367, 15373, 15378, 15384, 15389, 15397, 15405, 15409, 15413, 15417,
- 15423, 15429, 15435, 15441, 15445, 15449, 15453, 15457, 15461, 15464,
- 15467, 15470, 15473, 15476, 15479, 15482, 15485, 15488, 15492, 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, 15496, 15500, 0, 15506, 0, 0, 15512, 15516,
- 0, 15520, 0, 0, 15526, 0, 0, 0, 0, 0, 0, 15530, 15534, 15537, 15543, 0,
- 15549, 15553, 15557, 15561, 15567, 15573, 15579, 0, 15585, 15589, 15593,
- 0, 15599, 0, 15605, 0, 0, 15609, 15615, 0, 15621, 15624, 15630, 15633,
- 15637, 15644, 15649, 15654, 15658, 15663, 15668, 15673, 15677, 0, 15682,
- 15689, 15695, 0, 0, 15701, 15705, 15710, 15714, 15719, 0, 15724, 0,
- 15729, 15735, 15741, 15747, 15753, 15757, 0, 0, 15760, 15764, 15767,
- 15770, 15773, 15776, 15779, 15782, 15785, 15788, 0, 0, 15791, 15796, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12077, 12083,
+ 12087, 12091, 12095, 12100, 12103, 12107, 12110, 12114, 12117, 12121,
+ 12125, 12129, 12134, 12139, 12142, 12146, 12151, 12156, 12159, 12163,
+ 12166, 12170, 12174, 12178, 12182, 12186, 12190, 12194, 12198, 12202,
+ 12206, 12210, 12214, 12218, 12222, 12226, 12230, 12234, 12238, 12241,
+ 12245, 12248, 12252, 12256, 12260, 12263, 12266, 12269, 12273, 12277,
+ 12281, 12285, 12289, 12293, 12297, 12301, 12304, 12309, 12314, 12318,
+ 12322, 12327, 12331, 12336, 12340, 12345, 12350, 12356, 12362, 12368,
+ 12372, 12377, 12383, 12389, 12393, 12398, 12402, 12408, 12413, 12416,
+ 12422, 12428, 12433, 12438, 12445, 12450, 12455, 12459, 12463, 12467,
+ 12471, 12475, 12479, 12483, 12487, 12492, 12497, 12502, 12508, 12511,
+ 12515, 12519, 12522, 12525, 12528, 12531, 12534, 12537, 12540, 12543,
+ 12546, 12550, 12557, 12562, 12566, 12570, 12574, 12578, 0, 12582, 12586,
+ 12590, 12594, 12598, 12604, 12608, 0, 12612, 12616, 12620, 0, 12624,
+ 12627, 12631, 12634, 12638, 12641, 12645, 12649, 0, 0, 12653, 12656, 0,
+ 0, 12660, 12663, 12667, 12670, 12674, 12678, 12682, 12686, 12690, 12694,
+ 12698, 12702, 12706, 12710, 12714, 12718, 12722, 12726, 12730, 12734,
+ 12738, 12742, 0, 12745, 12748, 12752, 12756, 12760, 12763, 12766, 0,
+ 12769, 0, 0, 0, 12773, 12777, 12781, 12785, 0, 0, 12788, 12792, 12796,
+ 12801, 12805, 12810, 12814, 12819, 12824, 0, 0, 12830, 12834, 0, 0,
+ 12839, 12843, 12848, 12852, 0, 0, 0, 0, 0, 0, 0, 0, 12858, 0, 0, 0, 0,
+ 12864, 12868, 0, 12872, 12876, 12881, 12886, 12891, 0, 0, 12897, 12901,
+ 12904, 12907, 12910, 12913, 12916, 12919, 12922, 12925, 12928, 12937,
+ 12946, 12950, 12954, 12960, 12966, 12972, 12978, 12992, 12999, 13002, 0,
+ 0, 0, 0, 0, 13006, 13012, 13016, 0, 13020, 13023, 13027, 13030, 13034,
+ 13037, 0, 0, 0, 0, 13041, 13045, 0, 0, 13049, 13053, 13057, 13060, 13064,
+ 13068, 13072, 13076, 13080, 13084, 13088, 13092, 13096, 13100, 13104,
+ 13108, 13112, 13116, 13120, 13124, 13128, 13132, 0, 13135, 13138, 13142,
+ 13146, 13150, 13153, 13156, 0, 13159, 13163, 0, 13167, 13171, 0, 13175,
+ 13179, 0, 0, 13182, 0, 13186, 13191, 13195, 13200, 13204, 0, 0, 0, 0,
+ 13209, 13214, 0, 0, 13219, 13224, 13229, 0, 0, 0, 13233, 0, 0, 0, 0, 0,
+ 0, 0, 13237, 13241, 13245, 13249, 0, 13253, 0, 0, 0, 0, 0, 0, 0, 13257,
+ 13261, 13264, 13267, 13270, 13273, 13276, 13279, 13282, 13285, 13288,
+ 13291, 13294, 13297, 13300, 13305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 13309, 13313, 13317, 0, 13321, 13324, 13328, 13331, 13335, 13338, 13342,
+ 13346, 13350, 0, 13355, 13358, 13362, 0, 13367, 13370, 13374, 13377,
+ 13381, 13385, 13389, 13393, 13397, 13401, 13405, 13409, 13413, 13417,
+ 13421, 13425, 13429, 13433, 13437, 13441, 13445, 13449, 0, 13452, 13455,
+ 13459, 13463, 13467, 13470, 13473, 0, 13476, 13480, 0, 13484, 13488,
+ 13492, 13496, 13500, 0, 0, 13503, 13507, 13511, 13516, 13520, 13525,
+ 13529, 13534, 13539, 13545, 0, 13551, 13555, 13560, 0, 13566, 13570,
+ 13575, 0, 0, 13579, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13582,
+ 13587, 13592, 13597, 0, 0, 13603, 13607, 13610, 13613, 13616, 13619,
+ 13622, 13625, 13628, 13631, 0, 13634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 13638, 13642, 13646, 0, 13650, 13653, 13657, 13660, 13664,
+ 13667, 13671, 13675, 0, 0, 13679, 13682, 0, 0, 13686, 13689, 13693,
+ 13696, 13700, 13704, 13708, 13712, 13716, 13720, 13724, 13728, 13732,
+ 13736, 13740, 13744, 13748, 13752, 13756, 13760, 13764, 13768, 0, 13771,
+ 13774, 13778, 13782, 13786, 13789, 13792, 0, 13795, 13799, 0, 13803,
+ 13807, 13811, 13815, 13819, 0, 0, 13822, 13826, 13830, 13835, 13839,
+ 13844, 13848, 13853, 13858, 0, 0, 13864, 13868, 0, 0, 13873, 13877,
+ 13882, 0, 0, 0, 0, 0, 0, 0, 0, 13886, 13892, 0, 0, 0, 0, 13898, 13902, 0,
+ 13906, 13910, 13915, 13920, 13925, 0, 0, 13931, 13935, 13938, 13941,
+ 13944, 13947, 13950, 13953, 13956, 13959, 13962, 13965, 13969, 13975,
+ 13981, 13987, 13993, 13999, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14005, 14009,
+ 0, 14013, 14016, 14020, 14023, 14027, 14030, 0, 0, 0, 14034, 14037,
+ 14041, 0, 14045, 14048, 14052, 14056, 0, 0, 0, 14059, 14063, 0, 14067, 0,
+ 14071, 14075, 0, 0, 0, 14079, 14083, 0, 0, 0, 14087, 14090, 14094, 0, 0,
+ 0, 14097, 14100, 14103, 14106, 14110, 14114, 14118, 14122, 14126, 14130,
+ 14134, 14138, 0, 0, 0, 0, 14141, 14146, 14150, 14155, 14159, 0, 0, 0,
+ 14164, 14168, 14173, 0, 14178, 14182, 14187, 14192, 0, 0, 14196, 0, 0, 0,
+ 0, 0, 0, 14199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14205, 14209,
+ 14212, 14215, 14218, 14221, 14224, 14227, 14230, 14233, 14236, 14240,
+ 14245, 14250, 14254, 14258, 14262, 14266, 14270, 14275, 14279, 0, 0, 0,
+ 0, 0, 0, 14282, 14286, 14290, 0, 14294, 14297, 14301, 14304, 14308,
+ 14311, 14315, 14319, 0, 14323, 14326, 14330, 0, 14334, 14337, 14341,
+ 14345, 14348, 14352, 14356, 14360, 14364, 14368, 14372, 14376, 14380,
+ 14384, 14388, 14392, 14396, 14400, 14404, 14408, 14412, 14416, 14420, 0,
+ 14423, 14426, 14430, 14434, 14438, 14441, 14444, 14447, 14451, 14455, 0,
+ 14459, 14463, 14467, 14471, 14475, 0, 0, 0, 14478, 14482, 14487, 14491,
+ 14496, 14500, 14505, 14510, 0, 14516, 14520, 14525, 0, 14530, 14534,
+ 14539, 14544, 0, 0, 0, 0, 0, 0, 0, 14548, 14552, 0, 14558, 14562, 0, 0,
+ 0, 0, 0, 0, 14566, 14571, 14576, 14581, 0, 0, 14587, 14591, 14594, 14597,
+ 14600, 14603, 14606, 14609, 14612, 14615, 0, 0, 0, 0, 0, 0, 0, 0, 14618,
+ 14631, 14643, 14655, 14667, 14679, 14691, 14703, 0, 0, 14707, 14711, 0,
+ 14715, 14718, 14722, 14725, 14729, 14732, 14736, 14740, 0, 14744, 14747,
+ 14751, 0, 14755, 14758, 14762, 14766, 14769, 14773, 14777, 14781, 14785,
+ 14789, 14793, 14797, 14801, 14805, 14809, 14813, 14817, 14821, 14825,
+ 14829, 14833, 14837, 14841, 0, 14844, 14847, 14851, 14855, 14859, 14862,
+ 14865, 14868, 14872, 14876, 0, 14880, 14884, 14888, 14892, 14896, 0, 0,
+ 14899, 14903, 14907, 14912, 14916, 14921, 14925, 14930, 14935, 0, 14941,
+ 14945, 14950, 0, 14955, 14959, 14964, 14969, 0, 0, 0, 0, 0, 0, 0, 14973,
+ 14977, 0, 0, 0, 0, 0, 0, 0, 14983, 0, 14987, 14992, 14997, 15002, 0, 0,
+ 15008, 15012, 15015, 15018, 15021, 15024, 15027, 15030, 15033, 15036, 0,
+ 15039, 15043, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15047, 15051,
+ 0, 15055, 15058, 15062, 15065, 15069, 15072, 15076, 15080, 0, 15084,
+ 15087, 15091, 0, 15095, 15098, 15102, 15106, 15109, 15113, 15117, 15121,
+ 15125, 15129, 15133, 15137, 15141, 15145, 15149, 15153, 15157, 15161,
+ 15165, 15169, 15173, 15177, 15181, 15184, 15188, 15191, 15195, 15199,
+ 15203, 15206, 15209, 15212, 15216, 15220, 15224, 15228, 15232, 15236,
+ 15240, 15244, 15247, 0, 0, 15251, 15255, 15260, 15264, 15269, 15273,
+ 15278, 15283, 0, 15289, 15293, 15298, 0, 15303, 15307, 15312, 15317,
+ 15321, 0, 0, 0, 0, 0, 0, 0, 0, 15326, 0, 0, 0, 0, 0, 0, 0, 0, 15332,
+ 15337, 15342, 15347, 0, 0, 15353, 15357, 15360, 15363, 15366, 15369,
+ 15372, 15375, 15378, 15381, 15384, 15388, 15393, 15398, 15404, 15410, 0,
+ 0, 0, 15416, 15420, 15426, 15431, 15437, 15442, 15448, 0, 0, 15454,
+ 15458, 0, 15462, 15466, 15470, 15474, 15478, 15482, 15486, 15490, 15494,
+ 15498, 15502, 15506, 15510, 15514, 15518, 15522, 15526, 15530, 0, 0, 0,
+ 15534, 15540, 15546, 15552, 15558, 15564, 15570, 15576, 15582, 15588,
+ 15594, 15600, 15608, 15614, 15620, 15626, 15632, 15638, 15644, 15650,
+ 15656, 15662, 15668, 15674, 0, 15680, 15686, 15692, 15698, 15704, 15710,
+ 15714, 15720, 15724, 0, 15728, 0, 0, 15734, 15738, 15744, 15750, 15756,
+ 15760, 15766, 0, 0, 0, 15770, 0, 0, 0, 0, 15774, 15779, 15786, 15793,
+ 15800, 15807, 0, 15814, 0, 15821, 15826, 15831, 15838, 15845, 15854,
+ 15865, 15874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 15879, 15886, 15893, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15898, 15904,
+ 15910, 15916, 15922, 15928, 15934, 15940, 15946, 15952, 15958, 15964,
+ 15970, 15976, 15982, 15988, 15994, 16000, 16006, 16012, 16018, 16024,
+ 16030, 16036, 16042, 16048, 16054, 16060, 16066, 16072, 16078, 16084,
+ 16090, 16095, 16101, 16107, 16111, 16117, 16121, 16127, 16133, 16139,
+ 16145, 16151, 16157, 16162, 16168, 16172, 16177, 16183, 16189, 16195,
+ 16200, 16206, 16212, 16218, 16223, 16229, 0, 0, 0, 0, 16233, 16239,
+ 16244, 16250, 16255, 16263, 16271, 16275, 16279, 16283, 16289, 16295,
+ 16301, 16307, 16311, 16315, 16319, 16323, 16327, 16330, 16333, 16336,
+ 16339, 16342, 16345, 16348, 16351, 16354, 16358, 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, 15801, 15805, 15816, 15831, 15846, 15856,
- 15867, 15880, 15891, 15897, 15905, 15915, 15921, 15929, 15933, 15939,
- 15945, 15953, 15963, 15971, 15984, 15990, 15998, 16006, 16018, 16025,
- 16033, 16041, 16049, 16057, 16065, 16073, 16083, 16087, 16090, 16093,
- 16096, 16099, 16102, 16105, 16108, 16111, 16114, 16118, 16122, 16126,
- 16130, 16134, 16138, 16142, 16146, 16150, 16155, 16161, 16171, 16185,
- 16195, 16201, 16207, 16215, 16223, 16231, 16239, 16245, 16251, 16254,
- 16258, 16262, 16266, 16270, 16274, 16278, 0, 16282, 16286, 16290, 16294,
- 16298, 16302, 16306, 16310, 16314, 16318, 16322, 16326, 16329, 16333,
- 16337, 16341, 16344, 16348, 16352, 16356, 16360, 16364, 16368, 16372,
- 16376, 16379, 16382, 16386, 16390, 16394, 16398, 16401, 16404, 16408,
- 16413, 16417, 0, 0, 0, 0, 16421, 16426, 16430, 16435, 16439, 16444,
- 16449, 16455, 16460, 16466, 16470, 16475, 16479, 16484, 16494, 16500,
- 16505, 16511, 16521, 16527, 16531, 16535, 16541, 16547, 16555, 16561,
- 16569, 0, 0, 0, 0, 16577, 16582, 16588, 16594, 16600, 16606, 16612,
- 16618, 0, 16624, 16630, 16636, 16642, 16648, 16654, 16660, 16666, 16672,
- 16678, 16684, 16690, 16695, 16701, 16707, 16713, 16718, 16724, 16730,
- 16736, 16742, 16748, 16754, 16760, 16766, 16771, 16776, 16782, 16788,
- 16794, 16800, 16805, 16810, 16816, 16824, 16831, 0, 16838, 16845, 16858,
- 16865, 16872, 16880, 16888, 16894, 16900, 16906, 16916, 16921, 16927,
- 16937, 16947, 0, 16957, 16967, 16975, 16987, 16999, 17005, 17019, 0, 0,
+ 0, 0, 0, 0, 0, 16362, 16367, 0, 16374, 0, 0, 16381, 16386, 0, 16391, 0,
+ 0, 16398, 0, 0, 0, 0, 0, 0, 16403, 16408, 16412, 16419, 0, 16426, 16431,
+ 16436, 16441, 16448, 16455, 16462, 0, 16469, 16474, 16479, 0, 16486, 0,
+ 16493, 0, 0, 16498, 16505, 0, 16512, 16516, 16523, 16527, 16532, 16540,
+ 16546, 16552, 16557, 16563, 16569, 16575, 16580, 0, 16586, 16594, 16601,
+ 0, 0, 16608, 16613, 16619, 16624, 16630, 0, 16636, 0, 16642, 16649,
+ 16656, 16663, 16670, 16675, 0, 0, 16679, 16684, 16688, 16692, 16696,
+ 16700, 16704, 16708, 16712, 16716, 0, 0, 16720, 16726, 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, 17034, 17037, 17041,
- 17045, 17049, 17053, 17057, 17061, 17065, 17069, 17073, 17077, 17081,
- 17085, 17089, 17093, 17097, 17101, 17105, 17109, 17113, 17117, 17120,
- 17124, 17128, 17132, 17135, 17138, 17141, 17145, 17149, 17153, 17156,
- 17160, 17163, 17168, 17171, 17175, 17178, 17182, 17185, 17190, 17193,
- 17197, 17204, 17209, 17213, 17218, 17222, 17227, 17231, 17236, 17243,
- 17249, 17254, 17258, 17262, 17266, 17270, 17274, 17280, 17286, 17293,
- 17299, 17305, 17309, 17312, 17315, 17318, 17321, 17324, 17327, 17330,
- 17333, 17336, 17342, 17346, 17350, 17354, 17358, 17362, 17366, 17370,
- 17374, 17379, 17383, 17388, 17393, 17399, 17404, 17410, 17416, 17422,
- 17428, 17434, 17443, 17451, 17460, 17468, 17477, 17486, 17497, 17507,
- 17517, 17528, 17539, 17549, 17559, 17569, 17579, 17589, 17599, 17609,
- 17619, 17627, 17634, 17640, 17647, 17652, 17658, 17664, 17670, 17676,
- 17682, 17688, 17694, 17700, 17706, 17712, 17718, 17723, 17732, 17739,
- 17745, 17752, 17760, 17766, 17772, 17778, 17784, 17792, 17800, 17810,
- 17818, 17826, 17832, 17837, 17842, 17847, 17852, 17857, 17862, 17867,
- 17872, 0, 0, 0, 0, 17877, 17882, 17888, 17893, 17898, 17903, 17908,
- 17913, 17918, 17923, 17928, 17933, 17938, 17943, 17948, 17953, 17958,
- 17963, 17968, 17973, 17978, 17983, 17988, 17993, 17998, 18003, 18008,
- 18013, 18018, 18023, 18028, 18033, 18038, 18043, 18048, 18053, 18058,
- 18063, 18068, 18073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18078, 18082, 18086,
- 18090, 18094, 18098, 18102, 18106, 18110, 18114, 18118, 18122, 18126,
- 18130, 18134, 18138, 18142, 18146, 18150, 18154, 18158, 18162, 18166,
- 18170, 18174, 18178, 18182, 18186, 18190, 18194, 18198, 18202, 18206,
- 18210, 18214, 18218, 18222, 18226, 18230, 18234, 18238, 18242, 18247,
- 18251, 18256, 0, 0, 0, 18261, 18265, 18269, 18273, 18277, 18281, 18285,
- 18289, 18293, 18297, 18301, 18305, 18309, 18313, 18317, 18321, 18325,
- 18329, 18333, 18337, 18341, 18345, 18349, 18353, 18357, 18361, 18365,
- 18369, 18373, 18377, 18381, 18385, 18389, 18393, 18397, 18401, 18405,
- 18409, 18413, 18417, 18421, 18425, 18429, 18433, 18437, 18441, 18445,
- 18449, 18453, 18457, 18461, 18465, 18469, 18473, 18477, 18481, 18485,
- 18489, 18493, 18497, 18501, 18505, 18509, 18513, 18517, 18521, 18525,
- 18529, 18533, 18537, 18541, 18545, 18549, 18553, 18557, 18561, 18565,
- 18569, 18573, 18577, 18581, 18585, 18589, 18593, 18597, 18601, 18605,
- 18609, 18613, 18617, 0, 0, 0, 0, 0, 18621, 18625, 18629, 18632, 18636,
- 18639, 18643, 18647, 18650, 18654, 18658, 18661, 18665, 18669, 18673,
- 18677, 18680, 18684, 18688, 18692, 18696, 18700, 18704, 18707, 18711,
- 18715, 18719, 18723, 18727, 18731, 18735, 18739, 18743, 18747, 18751,
- 18755, 18759, 18763, 18767, 18771, 18775, 18779, 18783, 18787, 18791,
- 18795, 18799, 18803, 18807, 18811, 18815, 18819, 18823, 18827, 18831,
- 18835, 18839, 18843, 18847, 18851, 18855, 18859, 18863, 18867, 18871,
- 18875, 18879, 18883, 0, 0, 0, 0, 0, 18887, 18891, 18895, 18899, 18903,
- 18907, 18911, 18915, 18919, 18923, 18927, 18931, 18935, 18939, 18943,
- 18947, 18951, 18955, 18959, 18963, 18967, 18971, 18975, 18979, 18983,
- 18987, 18991, 18995, 18999, 19003, 19007, 19011, 19015, 19019, 19023,
- 19027, 19031, 19035, 19039, 19043, 19047, 19051, 19055, 19059, 19063,
- 19067, 19071, 19075, 19079, 19083, 19087, 19091, 19095, 19099, 19103,
- 19107, 19111, 19115, 19119, 19123, 19127, 19131, 19135, 19139, 19143,
- 19147, 19151, 19155, 19159, 19163, 19167, 19171, 19175, 19179, 19183,
- 19187, 19191, 19195, 19199, 19203, 19207, 19211, 0, 0, 0, 0, 0, 0, 19215,
- 19218, 19222, 19226, 19230, 19234, 19238, 19242, 19246, 19250, 19254,
- 19258, 19262, 19266, 19270, 19274, 19278, 19282, 19286, 19290, 19294,
- 19298, 19302, 19306, 19310, 19313, 19317, 19321, 19325, 19329, 19333,
- 19337, 19341, 19345, 19349, 19353, 19357, 19361, 19365, 19369, 19373,
- 19376, 19380, 19384, 19388, 19392, 19396, 19400, 19404, 19408, 19412,
- 19416, 19420, 19424, 19428, 19432, 19436, 19440, 19444, 19448, 19452,
- 19456, 19460, 19464, 19468, 19472, 19476, 19480, 19484, 19488, 19492,
- 19496, 19500, 0, 19504, 19508, 19512, 19516, 0, 0, 19520, 19524, 19528,
- 19532, 19536, 19540, 19544, 0, 19548, 0, 19552, 19556, 19560, 19564, 0,
- 0, 19568, 19572, 19576, 19580, 19584, 19588, 19592, 19596, 19600, 19604,
- 19608, 19612, 19616, 19620, 19624, 19628, 19632, 19636, 19640, 19644,
- 19648, 19652, 19656, 19659, 19663, 19667, 19671, 19675, 19679, 19683,
- 19687, 19691, 19695, 19699, 19703, 19707, 19711, 19715, 19719, 19723,
- 19727, 0, 19731, 19735, 19739, 19743, 0, 0, 19747, 19751, 19755, 19759,
- 19763, 19767, 19771, 19775, 19779, 19783, 19787, 19791, 19795, 19799,
- 19803, 19807, 19811, 19816, 19821, 19826, 19832, 19838, 19843, 19848,
- 19854, 19857, 19861, 19865, 19869, 19873, 19877, 19881, 19885, 0, 19889,
- 19893, 19897, 19901, 0, 0, 19905, 19909, 19913, 19917, 19921, 19925,
- 19929, 0, 19933, 0, 19937, 19941, 19945, 19949, 0, 0, 19953, 19957,
- 19961, 19965, 19969, 19973, 19977, 19981, 19985, 19990, 19995, 20000,
- 20006, 20012, 20017, 0, 20022, 20026, 20030, 20034, 20038, 20042, 20046,
- 20050, 20054, 20058, 20062, 20066, 20070, 20074, 20078, 20082, 20086,
- 20089, 20093, 20097, 20101, 20105, 20109, 20113, 20117, 20121, 20125,
- 20129, 20133, 20137, 20141, 20145, 20149, 20153, 20157, 20161, 20165,
- 20169, 20173, 20177, 20181, 20185, 20189, 20193, 20197, 20201, 20205,
- 20209, 20213, 20217, 20221, 20225, 20229, 20233, 20237, 20241, 20245, 0,
- 20249, 20253, 20257, 20261, 0, 0, 20265, 20269, 20273, 20277, 20281,
- 20285, 20289, 20293, 20297, 20301, 20305, 20309, 20313, 20317, 20321,
- 20325, 20329, 20333, 20337, 20341, 20345, 20349, 20353, 20357, 20361,
- 20365, 20369, 20373, 20377, 20381, 20385, 20389, 20393, 20397, 20401,
- 20405, 20409, 20413, 20417, 20421, 20425, 20429, 20433, 20437, 20441,
- 20445, 20449, 20453, 20457, 20461, 20465, 20469, 20473, 20477, 20481,
- 20485, 20489, 20492, 20496, 20500, 20504, 20508, 20512, 20516, 20520,
- 20524, 20528, 0, 0, 0, 0, 20532, 20537, 20541, 20544, 20549, 20552,
- 20555, 20558, 20563, 20567, 20572, 20575, 20578, 20581, 20584, 20587,
- 20590, 20593, 20596, 20599, 20603, 20607, 20611, 20615, 20619, 20623,
- 20627, 20631, 20635, 20639, 0, 0, 0, 20645, 20651, 20655, 20659, 20663,
- 20669, 20673, 20677, 20681, 20687, 20691, 20695, 20699, 20705, 20709,
- 20713, 20717, 20723, 20729, 20735, 20743, 20749, 20755, 20761, 20767,
- 20773, 0, 0, 0, 0, 0, 0, 20779, 20782, 20785, 20788, 20791, 20794, 20797,
- 20801, 20804, 20808, 20812, 20816, 20820, 20824, 20827, 20831, 20835,
- 20839, 20843, 20847, 20851, 20855, 20859, 20863, 20867, 20871, 20874,
- 20878, 20882, 20886, 20890, 20894, 20898, 20902, 20906, 20910, 20914,
- 20918, 20922, 20926, 20930, 20934, 20938, 20942, 20946, 20950, 20953,
- 20957, 20961, 20965, 20969, 20973, 20977, 20981, 20985, 20989, 20993,
- 20997, 21001, 21005, 21009, 21013, 21017, 21021, 21025, 21029, 21033,
- 21037, 21041, 21045, 21049, 21053, 21057, 21061, 21065, 21069, 21073,
- 21077, 21081, 21085, 21088, 21092, 21096, 21100, 21104, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 21108, 21111, 21115, 21118, 21122, 21125, 21129, 21135,
- 21140, 21144, 21147, 21151, 21155, 21160, 21164, 21169, 21173, 21178,
- 21182, 21187, 21191, 21196, 21202, 21206, 21211, 21215, 21220, 21226,
- 21230, 21236, 21242, 21246, 21251, 21259, 21267, 21274, 21279, 21284,
- 21293, 21300, 21307, 21312, 21318, 21322, 21326, 21330, 21334, 21338,
- 21342, 21346, 21350, 21354, 21358, 21364, 21369, 21374, 21377, 21381,
- 21385, 21390, 21394, 21399, 21403, 21408, 21412, 21417, 21421, 21426,
- 21430, 21435, 21439, 21444, 21450, 21454, 21459, 21463, 21467, 21471,
- 21475, 21479, 21482, 21486, 21492, 21497, 21502, 21506, 21510, 21514,
- 21519, 21523, 21528, 21532, 21537, 21540, 21544, 21548, 21553, 21557,
- 21562, 21566, 21571, 21577, 21581, 21585, 21589, 21593, 21597, 21601,
- 21605, 21609, 21613, 21617, 21621, 21627, 21630, 21634, 21638, 21643,
- 21647, 21652, 21656, 21661, 21665, 21670, 21674, 21679, 21683, 21688,
- 21692, 21697, 21703, 21707, 21711, 21717, 21723, 21729, 21735, 21739,
- 21743, 21747, 21751, 21755, 21759, 21765, 21769, 21773, 21777, 21782,
- 21786, 21791, 21795, 21800, 21804, 21809, 21813, 21818, 21822, 21827,
- 21831, 21836, 21842, 21846, 21852, 21856, 21860, 21864, 21868, 21872,
- 21876, 21882, 21885, 21889, 21893, 21898, 21902, 21907, 21911, 21916,
- 21920, 21925, 21929, 21934, 21938, 21943, 21947, 21952, 21958, 21961,
- 21965, 21969, 21974, 21979, 21983, 21987, 21991, 21995, 21999, 22003,
- 22009, 22013, 22017, 22021, 22026, 22030, 22035, 22039, 22044, 22050,
- 22053, 22058, 22062, 22066, 22070, 22074, 22078, 22082, 22086, 22092,
- 22096, 22100, 22104, 22109, 22113, 22118, 22122, 22127, 22131, 22136,
- 22140, 22145, 22149, 22154, 22158, 22163, 22166, 22170, 22174, 22178,
- 22182, 22186, 22190, 22194, 22198, 22204, 22208, 22212, 22216, 22221,
- 22225, 22230, 22234, 22239, 22243, 22248, 22252, 22257, 22261, 22266,
- 22270, 22275, 22281, 22284, 22289, 22293, 22298, 22304, 22310, 22316,
- 22322, 22328, 22334, 22340, 22344, 22348, 22352, 22356, 22360, 22364,
- 22368, 22372, 22377, 22381, 22386, 22390, 22395, 22399, 22404, 22408,
- 22413, 22417, 22422, 22426, 22431, 22435, 22439, 22443, 22447, 22451,
- 22455, 22459, 22465, 22468, 22472, 22476, 22481, 22485, 22490, 22494,
- 22499, 22503, 22508, 22512, 22517, 22521, 22526, 22530, 22535, 22541,
- 22545, 22551, 22556, 22562, 22566, 22572, 22577, 22581, 22585, 22589,
- 22593, 22597, 22602, 22605, 22609, 22614, 22618, 22623, 22626, 22630,
- 22634, 22638, 22642, 22646, 22650, 22654, 22658, 22662, 22666, 22670,
- 22675, 22679, 22683, 22689, 22693, 22699, 22703, 22709, 22713, 22717,
- 22721, 22725, 22729, 22734, 22738, 22742, 22746, 22750, 22754, 22758,
- 22762, 22766, 22770, 22774, 22780, 22786, 22792, 22798, 22804, 22809,
- 22815, 22820, 22825, 22829, 22833, 22837, 22841, 22845, 22849, 22853,
- 22857, 22861, 22865, 22869, 22873, 22877, 22882, 22887, 22892, 22896,
- 22900, 22904, 22908, 22912, 22916, 22920, 22924, 22928, 22932, 22938,
- 22944, 22950, 22956, 22962, 22968, 22974, 22980, 22986, 22990, 22994,
- 22998, 23002, 23006, 23010, 23014, 23020, 23026, 23032, 23038, 23044,
- 23050, 23056, 23062, 23068, 23073, 23078, 23083, 23088, 23094, 23100,
- 23106, 23112, 23118, 23124, 23130, 23136, 23142, 23148, 23154, 23159,
- 23165, 23171, 23177, 23182, 23187, 23192, 23197, 23202, 23207, 23212,
- 23217, 23222, 23227, 23232, 23237, 23241, 23246, 23251, 23256, 23261,
- 23266, 23271, 23276, 23281, 23286, 23291, 23296, 23301, 23306, 23311,
- 23316, 23321, 23326, 23331, 23336, 23341, 23346, 23351, 23356, 23361,
- 23366, 23371, 23376, 23381, 23386, 23390, 23395, 23400, 23405, 23410,
- 23415, 23420, 23425, 23430, 23435, 23440, 23445, 23450, 23455, 23460,
- 23465, 23470, 23475, 23480, 23485, 23490, 23495, 23500, 23505, 23510,
- 23515, 23520, 23525, 23530, 23535, 23540, 23545, 23549, 23554, 23559,
- 23564, 23569, 23574, 23578, 23583, 23589, 23594, 23599, 23604, 23609,
- 23615, 23620, 23625, 23630, 23635, 23640, 23645, 23650, 23655, 23660,
- 23665, 23670, 23675, 23680, 23685, 23690, 23695, 23700, 23705, 23710,
- 23715, 23720, 23725, 23730, 23735, 23740, 23745, 23750, 23755, 23760,
- 23765, 23770, 23775, 23780, 23785, 23790, 23795, 23800, 23805, 23810,
- 23815, 23820, 23825, 23830, 23835, 23841, 23846, 23851, 23856, 23861,
- 23866, 23871, 23876, 23881, 23886, 23891, 23896, 23901, 23906, 23911,
- 23916, 23921, 23926, 23931, 23936, 23941, 23946, 23951, 23956, 23961,
- 23966, 23971, 23976, 23981, 23986, 23991, 23996, 24001, 24006, 24011,
- 24016, 24021, 24026, 24031, 24037, 24041, 24045, 24049, 24053, 24057,
- 24061, 24065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24069, 24074, 24079, 24084,
- 24089, 24094, 24099, 24104, 24109, 24114, 24119, 24124, 24129, 24134,
- 24139, 24144, 24149, 24154, 24159, 24164, 24169, 24174, 24179, 24184,
- 24189, 24194, 24199, 24204, 24209, 0, 0, 0, 24215, 24225, 24228, 24235,
- 24239, 24243, 24247, 24255, 24259, 24264, 24269, 24274, 24278, 24283,
- 24288, 24291, 24295, 24299, 24308, 24312, 24316, 24322, 24325, 24329,
- 24336, 24340, 24348, 24353, 24358, 24363, 24368, 24377, 24382, 24386,
- 24395, 24398, 24404, 24408, 24414, 24419, 24425, 24433, 24439, 24444,
- 24451, 24456, 24460, 24464, 24474, 24480, 24484, 24494, 24500, 24504,
- 24508, 24515, 24522, 24527, 24532, 24541, 24545, 24549, 24553, 24561,
- 24568, 24572, 24576, 24580, 24584, 24588, 24592, 24596, 24600, 24604,
- 24608, 24612, 24617, 24622, 24627, 24631, 24635, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 24639, 24643, 24647, 24651, 24655, 24660, 24665,
- 24670, 24675, 24680, 24684, 24689, 24693, 0, 24697, 24702, 24707, 24712,
- 24716, 24721, 24726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24731, 24735,
- 24739, 24743, 24747, 24752, 24757, 24762, 24767, 24772, 24776, 24781,
- 24785, 24789, 24793, 24798, 24803, 24808, 24812, 24817, 24822, 24827,
- 24833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24838, 24842, 24846, 24850, 24854,
- 24859, 24864, 24869, 24874, 24879, 24883, 24888, 24892, 24896, 24900,
- 24905, 24910, 24915, 24919, 24924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 24929, 24933, 24937, 24941, 24945, 24950, 24955, 24960, 24965, 24970,
- 24974, 24979, 24983, 0, 24987, 24992, 24997, 0, 25002, 25007, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 25012, 25015, 25019, 25023, 25027, 25031, 25035,
- 25039, 25043, 25047, 25051, 25055, 25059, 25063, 25067, 25071, 25075,
- 25079, 25082, 25086, 25090, 25094, 25098, 25102, 25106, 25110, 25114,
- 25118, 25122, 25126, 25130, 25134, 25138, 25141, 25145, 25149, 25155,
- 25161, 25167, 25173, 25179, 25185, 25191, 25197, 25203, 25209, 25215,
- 25221, 25227, 25233, 25242, 25251, 25257, 25263, 25269, 25274, 25278,
- 25283, 25288, 25293, 25297, 25302, 25307, 25312, 25316, 25321, 25325,
- 25330, 25335, 25340, 25345, 25349, 25353, 25357, 25361, 25365, 25369,
- 25373, 25377, 25381, 25385, 25391, 25395, 25399, 25403, 25407, 25411,
- 25419, 25425, 25429, 25435, 25439, 25445, 25449, 0, 0, 25453, 25457,
- 25460, 25463, 25466, 25469, 25472, 25475, 25478, 25481, 0, 0, 0, 0, 0, 0,
- 25484, 25492, 25500, 25508, 25516, 25524, 25532, 25540, 25548, 25556, 0,
- 0, 0, 0, 0, 0, 25564, 25567, 25570, 25573, 25578, 25581, 25586, 25593,
- 25601, 25606, 25613, 25616, 25623, 25630, 25637, 0, 25641, 25645, 25648,
- 25651, 25654, 25657, 25660, 25663, 25666, 25669, 0, 0, 0, 0, 0, 0, 25672,
- 25675, 25678, 25681, 25684, 25687, 25691, 25695, 25699, 25703, 25707,
- 25711, 25714, 25718, 25722, 25725, 25729, 25733, 25737, 25741, 25745,
- 25749, 25753, 25756, 25759, 25763, 25767, 25770, 25774, 25778, 25782,
- 25786, 25790, 25794, 25798, 25802, 25809, 25814, 25819, 25824, 25829,
- 25835, 25841, 25847, 25853, 25858, 25864, 25870, 25875, 25881, 25887,
- 25893, 25899, 25905, 25910, 25916, 25921, 25927, 25933, 25939, 25945,
- 25951, 25956, 25961, 25967, 25973, 25978, 25984, 25989, 25995, 26000,
- 26005, 26011, 26017, 26023, 26029, 26035, 26041, 26047, 26053, 26059,
- 26065, 26071, 26077, 26082, 26087, 26092, 26098, 0, 0, 0, 0, 0, 0, 0, 0,
- 26104, 26113, 26122, 26130, 26138, 26148, 26156, 26165, 26172, 26179,
- 26186, 26194, 26202, 26210, 26218, 26226, 26234, 26242, 26250, 26257,
- 26265, 26273, 26281, 26289, 26297, 26307, 26317, 26327, 26337, 26347,
- 26357, 26367, 26377, 26387, 26397, 26407, 26417, 26427, 26437, 26445,
- 26453, 26463, 26471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 16732, 16736, 16747, 16762, 16777, 16787, 16798, 16811,
+ 16822, 16828, 16836, 16846, 16852, 16860, 16864, 16870, 16876, 16884,
+ 16894, 16902, 16915, 16921, 16929, 16937, 16949, 16956, 16964, 16972,
+ 16980, 16988, 16996, 17004, 17014, 17018, 17021, 17024, 17027, 17030,
+ 17033, 17036, 17039, 17042, 17045, 17049, 17053, 17057, 17061, 17065,
+ 17069, 17073, 17077, 17081, 17086, 17092, 17102, 17116, 17126, 17132,
+ 17138, 17146, 17154, 17162, 17170, 17176, 17182, 17185, 17189, 17193,
+ 17197, 17201, 17205, 17209, 0, 17213, 17217, 17221, 17225, 17229, 17233,
+ 17237, 17241, 17245, 17249, 17253, 17256, 17259, 17263, 17267, 17271,
+ 17274, 17278, 17282, 17286, 17290, 17294, 17298, 17302, 17306, 17309,
+ 17312, 17316, 17320, 17324, 17328, 17331, 17334, 17338, 17343, 17347, 0,
+ 0, 0, 0, 17351, 17356, 17360, 17365, 17369, 17374, 17379, 17385, 17390,
+ 17396, 17400, 17405, 17409, 17414, 17424, 17430, 17436, 17443, 17453,
+ 17459, 17463, 17467, 17473, 17479, 17487, 17493, 17501, 17509, 17517,
+ 17527, 17535, 17545, 17550, 17556, 17562, 17568, 17574, 17580, 17586, 0,
+ 17592, 17598, 17604, 17610, 17616, 17622, 17628, 17634, 17640, 17646,
+ 17652, 17657, 17662, 17668, 17674, 17680, 17685, 17691, 17697, 17703,
+ 17709, 17715, 17721, 17727, 17733, 17738, 17743, 17749, 17755, 17761,
+ 17767, 17772, 17777, 17783, 17791, 17798, 0, 17805, 17812, 17825, 17832,
+ 17839, 17847, 17855, 17861, 17867, 17873, 17883, 17888, 17894, 17904,
+ 17914, 0, 17924, 17934, 17942, 17954, 17966, 17972, 17986, 18001, 18006,
+ 18011, 18019, 18027, 18035, 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, 18043,
+ 18046, 18050, 18054, 18058, 18062, 18066, 18070, 18074, 18078, 18082,
+ 18086, 18090, 18094, 18098, 18102, 18106, 18110, 18114, 18118, 18122,
+ 18125, 18128, 18132, 18136, 18140, 18143, 18146, 18149, 18153, 18157,
+ 18161, 18164, 18168, 18171, 18176, 18179, 18183, 18186, 18190, 18193,
+ 18198, 18201, 18205, 18212, 18217, 18221, 18226, 18230, 18235, 18239,
+ 18244, 18251, 18257, 18262, 18266, 18270, 18274, 18278, 18282, 18288,
+ 18294, 18301, 18307, 18313, 18317, 18320, 18323, 18326, 18329, 18332,
+ 18335, 18338, 18341, 18344, 18350, 18354, 18358, 18362, 18366, 18370,
+ 18374, 18378, 18382, 18387, 18391, 18396, 18401, 18407, 18412, 18418,
+ 18424, 18430, 18436, 18442, 18450, 18458, 18467, 18475, 18484, 18493,
+ 18504, 18514, 18524, 18535, 18546, 18556, 18566, 18576, 18586, 18596,
+ 18606, 18616, 18626, 18634, 18641, 18647, 18654, 18659, 18665, 18671,
+ 18677, 18683, 18689, 18695, 18700, 18706, 18712, 18718, 18724, 18729,
+ 18738, 18745, 18751, 18758, 18766, 18772, 18778, 18784, 18790, 18798,
+ 18806, 18816, 18824, 18832, 18838, 18843, 18848, 18853, 18858, 18863,
+ 18868, 18873, 18878, 18883, 18889, 18895, 18901, 18908, 18913, 18919,
+ 18924, 18929, 18934, 18939, 18944, 18949, 18954, 18959, 18964, 18969,
+ 18974, 18979, 18984, 18989, 18994, 18999, 19004, 19009, 19014, 19019,
+ 19024, 19029, 19034, 19039, 19044, 19049, 19054, 19059, 19064, 19069,
+ 19074, 19079, 19084, 19089, 19094, 19099, 19104, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 19109, 19113, 19117, 19121, 19125, 19129, 19133, 19137, 19141,
+ 19145, 19149, 19153, 19157, 19161, 19165, 19169, 19173, 19177, 19181,
+ 19185, 19189, 19193, 19197, 19201, 19205, 19209, 19213, 19217, 19221,
+ 19225, 19229, 19233, 19237, 19241, 19245, 19249, 19253, 19257, 19261,
+ 19265, 19269, 19273, 19279, 19283, 19288, 0, 0, 0, 19293, 19297, 19301,
+ 19305, 19309, 19313, 19317, 19321, 19325, 19329, 19333, 19337, 19341,
+ 19345, 19349, 19353, 19357, 19361, 19365, 19369, 19373, 19377, 19381,
+ 19385, 19389, 19393, 19397, 19401, 19405, 19409, 19413, 19417, 19421,
+ 19425, 19429, 19433, 19437, 19441, 19445, 19449, 19453, 19457, 19461,
+ 19465, 19469, 19473, 19477, 19481, 19485, 19489, 19493, 19497, 19501,
+ 19505, 19509, 19513, 19517, 19521, 19525, 19529, 19533, 19537, 19541,
+ 19545, 19549, 19553, 19557, 19561, 19565, 19569, 19573, 19577, 19581,
+ 19585, 19589, 19593, 19597, 19601, 19605, 19609, 19613, 19617, 19621,
+ 19625, 19629, 19633, 19637, 19641, 19645, 19649, 19653, 19657, 19661,
+ 19665, 19669, 19673, 19677, 19681, 19684, 19688, 19691, 19695, 19699,
+ 19702, 19706, 19710, 19713, 19717, 19721, 19725, 19729, 19732, 19736,
+ 19740, 19744, 19748, 19752, 19756, 19759, 19763, 19767, 19771, 19775,
+ 19779, 19783, 19787, 19791, 19795, 19799, 19803, 19807, 19811, 19815,
+ 19819, 19823, 19827, 19831, 19835, 19839, 19843, 19847, 19851, 19855,
+ 19859, 19863, 19867, 19871, 19875, 19879, 19883, 19887, 19891, 19895,
+ 19899, 19903, 19907, 19911, 19915, 19919, 19923, 19927, 19931, 19935,
+ 19939, 19943, 19947, 19951, 19955, 19959, 19963, 19967, 19971, 19975,
+ 19979, 19983, 19987, 19991, 19995, 19999, 20003, 20007, 20011, 20015,
+ 20019, 20023, 20027, 20031, 20035, 20039, 20043, 20047, 20051, 20055,
+ 20059, 20063, 20067, 20071, 20075, 20079, 20083, 20087, 20091, 20095,
+ 20099, 20103, 20107, 20111, 20115, 20119, 20123, 20127, 20131, 20135,
+ 20139, 20143, 20147, 20151, 20155, 20159, 20163, 20167, 20171, 20175,
+ 20179, 20183, 20187, 20191, 20195, 20199, 20203, 20207, 20211, 20215,
+ 20219, 20223, 20227, 20231, 20235, 20239, 20243, 20247, 20251, 20255,
+ 20259, 20263, 20267, 20271, 20275, 20279, 20283, 20287, 20291, 20295,
+ 20299, 20303, 20307, 20311, 20314, 20318, 20322, 20326, 20330, 20334,
+ 20338, 20342, 20346, 20350, 20354, 20358, 20362, 20366, 20370, 20374,
+ 20378, 20382, 20386, 20390, 20394, 20398, 20402, 20406, 20409, 20413,
+ 20417, 20421, 20425, 20429, 20433, 20437, 20441, 20445, 20449, 20453,
+ 20457, 20461, 20465, 20469, 20472, 20476, 20480, 20484, 20488, 20492,
+ 20496, 20500, 20504, 20508, 20512, 20516, 20520, 20524, 20528, 20532,
+ 20536, 20540, 20544, 20548, 20552, 20556, 20560, 20564, 20568, 20572,
+ 20576, 20580, 20584, 20588, 20592, 20596, 0, 20600, 20604, 20608, 20612,
+ 0, 0, 20616, 20620, 20624, 20628, 20632, 20636, 20640, 0, 20644, 0,
+ 20648, 20652, 20656, 20660, 0, 0, 20664, 20668, 20672, 20676, 20680,
+ 20684, 20688, 20692, 20696, 20700, 20704, 20708, 20712, 20716, 20720,
+ 20724, 20728, 20732, 20736, 20740, 20744, 20748, 20752, 20755, 20759,
+ 20763, 20767, 20771, 20775, 20779, 20783, 20787, 20791, 20795, 20799,
+ 20803, 20807, 20811, 20815, 20819, 20823, 0, 20827, 20831, 20835, 20839,
+ 0, 0, 20843, 20846, 20850, 20854, 20858, 20862, 20866, 20870, 20874,
+ 20878, 20882, 20886, 20890, 20894, 20898, 20902, 20906, 20911, 20916,
+ 20921, 20927, 20933, 20938, 20943, 20949, 20952, 20956, 20960, 20964,
+ 20968, 20972, 20976, 20980, 0, 20984, 20988, 20992, 20996, 0, 0, 21000,
+ 21004, 21008, 21012, 21016, 21020, 21024, 0, 21028, 0, 21032, 21036,
+ 21040, 21044, 0, 0, 21048, 21052, 21056, 21060, 21064, 21068, 21072,
+ 21076, 21080, 21085, 21090, 21095, 21101, 21107, 21112, 0, 21117, 21121,
+ 21125, 21129, 21133, 21137, 21141, 21145, 21149, 21153, 21157, 21161,
+ 21165, 21169, 21173, 21177, 21181, 21184, 21188, 21192, 21196, 21200,
+ 21204, 21208, 21212, 21216, 21220, 21224, 21228, 21232, 21236, 21240,
+ 21244, 21248, 21252, 21256, 21260, 21264, 21268, 21272, 21276, 21280,
+ 21284, 21288, 21292, 21296, 21300, 21304, 21308, 21312, 21316, 21320,
+ 21324, 21328, 21332, 21336, 21340, 0, 21344, 21348, 21352, 21356, 0, 0,
+ 21360, 21364, 21368, 21372, 21376, 21380, 21384, 21388, 21392, 21396,
+ 21400, 21404, 21408, 21412, 21416, 21420, 21424, 21428, 21432, 21436,
+ 21440, 21444, 21448, 21452, 21456, 21460, 21464, 21468, 21472, 21476,
+ 21480, 21484, 21488, 21492, 21496, 21500, 21504, 21508, 21512, 21516,
+ 21520, 21524, 21528, 21532, 21536, 21540, 21544, 21548, 21552, 21556,
+ 21560, 21564, 21568, 21572, 21576, 21580, 21584, 21587, 21591, 21595,
+ 21599, 21603, 21607, 21611, 21615, 21619, 21623, 0, 0, 21627, 21636,
+ 21642, 21647, 21651, 21654, 21659, 21662, 21665, 21668, 21673, 21677,
+ 21682, 21685, 21688, 21691, 21694, 21697, 21700, 21703, 21706, 21709,
+ 21713, 21717, 21721, 21725, 21729, 21733, 21737, 21741, 21745, 21749, 0,
+ 0, 0, 21755, 21761, 21765, 21769, 21773, 21779, 21783, 21787, 21791,
+ 21797, 21801, 21805, 21809, 21815, 21819, 21823, 21827, 21833, 21839,
+ 21845, 21853, 21859, 21865, 21871, 21877, 21883, 0, 0, 0, 0, 0, 0, 21889,
+ 21892, 21895, 21898, 21901, 21904, 21908, 21912, 21915, 21919, 21923,
+ 21927, 21931, 21935, 21938, 21942, 21946, 21950, 21954, 21958, 21962,
+ 21966, 21970, 21974, 21978, 21982, 21985, 21989, 21993, 21997, 22001,
+ 22004, 22008, 22012, 22016, 22020, 22024, 22028, 22032, 22036, 22040,
+ 22044, 22048, 22052, 22056, 22060, 22063, 22067, 22071, 22075, 22079,
+ 22083, 22087, 22091, 22095, 22099, 22103, 22107, 22111, 22115, 22119,
+ 22123, 22127, 22131, 22135, 22139, 22143, 22147, 22151, 22155, 22159,
+ 22163, 22167, 22171, 22175, 22179, 22183, 22187, 22191, 22195, 22198,
+ 22202, 22206, 22210, 22214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22218,
+ 22222, 22225, 22229, 22232, 22236, 22239, 22243, 22249, 22254, 22258,
+ 22261, 22265, 22269, 22274, 22278, 22283, 22287, 22292, 22296, 22301,
+ 22305, 22310, 22316, 22320, 22325, 22329, 22334, 22340, 22344, 22350,
+ 22356, 22360, 22365, 22373, 22381, 22388, 22393, 22398, 22407, 22414,
+ 22421, 22426, 22432, 22436, 22440, 22444, 22448, 22452, 22456, 22460,
+ 22464, 22468, 22472, 22478, 22483, 22488, 22491, 22495, 22499, 22504,
+ 22508, 22513, 22517, 22522, 22526, 22531, 22535, 22540, 22544, 22549,
+ 22553, 22558, 22564, 22568, 22573, 22578, 22582, 22586, 22590, 22594,
+ 22597, 22601, 22607, 22612, 22617, 22621, 22625, 22629, 22634, 22638,
+ 22643, 22647, 22652, 22655, 22659, 22663, 22668, 22672, 22677, 22681,
+ 22686, 22692, 22696, 22700, 22704, 22708, 22712, 22716, 22720, 22724,
+ 22728, 22732, 22736, 22742, 22745, 22749, 22753, 22758, 22762, 22767,
+ 22771, 22776, 22780, 22785, 22789, 22794, 22798, 22803, 22807, 22812,
+ 22818, 22822, 22826, 22832, 22838, 22844, 22850, 22854, 22858, 22862,
+ 22866, 22870, 22874, 22880, 22884, 22888, 22892, 22897, 22901, 22906,
+ 22910, 22915, 22919, 22924, 22928, 22933, 22937, 22942, 22946, 22951,
+ 22957, 22961, 22967, 22971, 22975, 22979, 22983, 22987, 22991, 22997,
+ 23000, 23004, 23008, 23013, 23017, 23022, 23026, 23031, 23035, 23040,
+ 23044, 23049, 23053, 23058, 23062, 23067, 23073, 23076, 23080, 23084,
+ 23089, 23094, 23098, 23102, 23106, 23110, 23114, 23118, 23124, 23127,
+ 23131, 23135, 23140, 23144, 23149, 23153, 23158, 23164, 23167, 23172,
+ 23176, 23180, 23184, 23188, 23192, 23196, 23200, 23206, 23210, 23214,
+ 23218, 23223, 23227, 23232, 23236, 23241, 23245, 23250, 23254, 23259,
+ 23263, 23268, 23272, 23277, 23280, 23284, 23288, 23292, 23296, 23300,
+ 23304, 23308, 23312, 23318, 23322, 23326, 23330, 23335, 23339, 23344,
+ 23348, 23353, 23357, 23362, 23366, 23371, 23375, 23380, 23384, 23389,
+ 23395, 23398, 23403, 23407, 23412, 23418, 23424, 23430, 23436, 23442,
+ 23448, 23454, 23458, 23462, 23466, 23470, 23474, 23478, 23482, 23486,
+ 23491, 23495, 23500, 23504, 23509, 23513, 23518, 23522, 23527, 23531,
+ 23536, 23540, 23545, 23549, 23553, 23557, 23561, 23565, 23569, 23573,
+ 23579, 23582, 23586, 23590, 23595, 23599, 23604, 23608, 23613, 23617,
+ 23622, 23626, 23631, 23635, 23640, 23644, 23649, 23655, 23659, 23665,
+ 23670, 23676, 23680, 23686, 23691, 23695, 23699, 23703, 23707, 23711,
+ 23716, 23719, 23723, 23728, 23732, 23737, 23740, 23744, 23748, 23752,
+ 23756, 23760, 23764, 23768, 23772, 23776, 23780, 23784, 23789, 23793,
+ 23797, 23803, 23807, 23813, 23817, 23823, 23827, 23831, 23835, 23839,
+ 23843, 23848, 23852, 23856, 23860, 23864, 23868, 23872, 23876, 23880,
+ 23884, 23888, 23894, 23900, 23906, 23912, 23918, 23923, 23929, 23935,
+ 23941, 23945, 23949, 23953, 23957, 23961, 23965, 23969, 23973, 23977,
+ 23981, 23985, 23989, 23993, 23998, 24003, 24008, 24012, 24016, 24020,
+ 24024, 24028, 24032, 24036, 24040, 24044, 24048, 24054, 24060, 24066,
+ 24072, 24078, 24084, 24090, 24096, 24102, 24106, 24110, 24114, 24118,
+ 24122, 24126, 24130, 24136, 24142, 24148, 24154, 24160, 24166, 24172,
+ 24178, 24184, 24189, 24194, 24199, 24204, 24210, 24216, 24222, 24228,
+ 24234, 24240, 24246, 24251, 24257, 24263, 24269, 24274, 24280, 24286,
+ 24292, 24297, 24302, 24307, 24312, 24317, 24322, 24327, 24332, 24337,
+ 24342, 24347, 24352, 24356, 24361, 24366, 24371, 24376, 24381, 24386,
+ 24391, 24396, 24401, 24406, 24411, 24416, 24421, 24426, 24431, 24436,
+ 24441, 24446, 24451, 24456, 24461, 24466, 24471, 24476, 24481, 24486,
+ 24491, 24496, 24501, 24505, 24510, 24515, 24520, 24525, 24530, 24535,
+ 24540, 24545, 24550, 24555, 24560, 24565, 24570, 24575, 24580, 24585,
+ 24590, 24595, 24600, 24605, 24610, 24615, 24620, 24625, 24630, 24634,
+ 24639, 24644, 24649, 24654, 24659, 24663, 24668, 24673, 24678, 24683,
+ 24688, 24692, 24697, 24703, 24708, 24713, 24718, 24723, 24729, 24734,
+ 24739, 24744, 24749, 24754, 24759, 24764, 24769, 24774, 24779, 24784,
+ 24789, 24794, 24799, 24804, 24809, 24814, 24819, 24824, 24829, 24834,
+ 24839, 24844, 24849, 24854, 24859, 24864, 24869, 24874, 24879, 24884,
+ 24889, 24894, 24899, 24904, 24909, 24914, 24919, 24924, 24929, 24934,
+ 24939, 24944, 24949, 24955, 24960, 24965, 24970, 24975, 24980, 24985,
+ 24990, 24995, 25000, 25005, 25010, 25015, 25020, 25025, 25030, 25035,
+ 25040, 25045, 25050, 25055, 25060, 25065, 25070, 25075, 25080, 25085,
+ 25090, 25095, 25100, 25105, 25110, 25115, 25120, 25125, 25130, 25135,
+ 25140, 25145, 25151, 25155, 25159, 25163, 25167, 25171, 25175, 25179,
+ 25183, 25189, 25195, 25201, 25207, 25213, 25219, 25225, 25232, 25238,
+ 25243, 25248, 25253, 25258, 25263, 25268, 25273, 25278, 25283, 25288,
+ 25293, 25298, 25303, 25308, 25313, 25318, 25323, 25328, 25333, 25338,
+ 25343, 25348, 25353, 25358, 25363, 25368, 25373, 25378, 0, 0, 0, 25385,
+ 25395, 25399, 25406, 25410, 25414, 25418, 25426, 25430, 25435, 25440,
+ 25445, 25449, 25454, 25459, 25462, 25466, 25470, 25479, 25483, 25487,
+ 25493, 25497, 25501, 25509, 25513, 25521, 25527, 25533, 25539, 25545,
+ 25554, 25559, 25563, 25572, 25575, 25581, 25585, 25591, 25596, 25602,
+ 25610, 25616, 25621, 25628, 25633, 25637, 25641, 25651, 25657, 25661,
+ 25671, 25677, 25681, 25685, 25692, 25699, 25704, 25709, 25718, 25722,
+ 25726, 25730, 25738, 25745, 25749, 25753, 25757, 25761, 25765, 25769,
+ 25773, 25777, 25781, 25785, 25789, 25794, 25799, 25804, 25808, 25812, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25816, 25820, 25824, 25828,
+ 25832, 25837, 25842, 25847, 25852, 25856, 25860, 25865, 25869, 0, 25873,
+ 25878, 25883, 25888, 25892, 25897, 25902, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 25907, 25911, 25915, 25919, 25923, 25928, 25933, 25938, 25943, 25947,
+ 25951, 25956, 25960, 25964, 25968, 25973, 25978, 25983, 25987, 25992,
+ 25997, 26002, 26008, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26013, 26017, 26021,
+ 26025, 26029, 26034, 26039, 26044, 26049, 26053, 26057, 26062, 26066,
+ 26070, 26074, 26079, 26084, 26089, 26093, 26098, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 26103, 26107, 26111, 26115, 26119, 26124, 26129, 26134,
+ 26139, 26143, 26147, 26152, 26156, 0, 26160, 26165, 26170, 0, 26175,
+ 26180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26185, 26188, 26192, 26196,
+ 26200, 26204, 26208, 26212, 26216, 26220, 26224, 26228, 26232, 26236,
+ 26240, 26244, 26248, 26252, 26255, 26259, 26263, 26267, 26271, 26275,
+ 26279, 26283, 26287, 26291, 26295, 26299, 26303, 26307, 26311, 26314,
+ 26318, 26322, 26328, 26334, 26340, 26346, 26352, 26358, 26364, 26370,
+ 26376, 26382, 26388, 26394, 26400, 26406, 26415, 26424, 26430, 26436,
+ 26442, 26447, 26451, 26456, 26461, 26466, 26470, 26475, 26480, 26485,
+ 26489, 26494, 26498, 26503, 26508, 26513, 26518, 26522, 26526, 26530,
+ 26534, 26538, 26542, 26546, 26550, 26554, 26558, 26564, 26568, 26572,
+ 26576, 26580, 26584, 26592, 26598, 26602, 26608, 26612, 26618, 26622, 0,
+ 0, 26626, 26630, 26633, 26636, 26639, 26642, 26645, 26648, 26651, 26654,
+ 0, 0, 0, 0, 0, 0, 26657, 26665, 26673, 26681, 26689, 26697, 26705, 26713,
+ 26721, 26729, 0, 0, 0, 0, 0, 0, 26737, 26740, 26743, 26746, 26751, 26754,
+ 26759, 26766, 26774, 26779, 26786, 26789, 26796, 26803, 26810, 0, 26814,
+ 26818, 26821, 26824, 26827, 26830, 26833, 26836, 26839, 26842, 0, 0, 0,
+ 0, 0, 0, 26845, 26848, 26851, 26854, 26857, 26860, 26864, 26868, 26872,
+ 26875, 26879, 26883, 26886, 26890, 26894, 26897, 26901, 26905, 26909,
+ 26913, 26917, 26921, 26925, 26928, 26931, 26935, 26939, 26942, 26946,
+ 26950, 26954, 26958, 26962, 26966, 26970, 26974, 26981, 26986, 26991,
+ 26996, 27001, 27007, 27013, 27019, 27025, 27030, 27036, 27042, 27047,
+ 27053, 27059, 27065, 27071, 27077, 27082, 27088, 27093, 27099, 27105,
+ 27111, 27117, 27123, 27128, 27133, 27139, 27145, 27150, 27156, 27161,
+ 27167, 27172, 27177, 27183, 27189, 27195, 27201, 27207, 27213, 27219,
+ 27225, 27231, 27237, 27243, 27249, 27254, 27259, 27264, 27270, 0, 0, 0,
+ 0, 0, 0, 0, 0, 27276, 27285, 27294, 27302, 27310, 27320, 27328, 27337,
+ 27344, 27351, 27358, 27366, 27374, 27382, 27390, 27398, 27406, 27414,
+ 27422, 27429, 27437, 27445, 27453, 27461, 27469, 27479, 27489, 27499,
+ 27509, 27519, 27529, 27539, 27549, 27559, 27569, 27579, 27589, 27599,
+ 27609, 27617, 27625, 27635, 27643, 0, 0, 0, 0, 0, 27653, 27657, 27661,
+ 27665, 27669, 27673, 27677, 27681, 27685, 27689, 27693, 27697, 27701,
+ 27705, 27709, 27713, 27717, 27721, 27725, 27729, 27733, 27737, 27741,
+ 27745, 27751, 27755, 27761, 27765, 27771, 27775, 27781, 27785, 27789,
+ 27793, 27797, 27801, 27805, 27811, 27817, 27823, 27829, 27834, 27839,
+ 27844, 27850, 27856, 27862, 27868, 27875, 27881, 27886, 27891, 27895,
+ 27899, 27903, 27907, 27911, 27915, 27919, 27925, 27931, 27937, 27942,
+ 27949, 27954, 27959, 27965, 27970, 27977, 27984, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 27990, 27995, 27998, 28002, 28006, 28010, 28014, 28018, 28022,
+ 28026, 28030, 28034, 28038, 28042, 28046, 28050, 28053, 28056, 28060,
+ 28064, 28068, 28071, 28074, 28077, 28081, 28085, 28089, 28093, 28097, 0,
+ 0, 0, 28100, 28104, 28108, 28112, 28117, 28122, 28127, 28132, 28136,
+ 28140, 28145, 28150, 0, 0, 0, 0, 28156, 28160, 28165, 28170, 28175,
+ 28179, 28183, 28187, 28191, 28196, 28200, 28204, 0, 0, 0, 0, 28208, 0, 0,
+ 0, 28212, 28216, 28220, 28224, 28227, 28230, 28233, 28236, 28239, 28242,
+ 28245, 28248, 28251, 28256, 28262, 28268, 28274, 28280, 28285, 28291,
+ 28297, 28303, 28308, 28314, 28319, 28325, 28331, 28336, 28342, 28348,
+ 28354, 28359, 28364, 28369, 28375, 28381, 28386, 28392, 28397, 28403,
+ 28408, 28414, 0, 0, 28420, 28426, 28432, 28438, 28444, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 28450, 28457, 28464, 28470, 28477, 28484, 28490, 28497,
+ 28504, 28511, 28518, 28524, 28531, 28538, 28544, 28551, 28558, 28564,
+ 28571, 28578, 28584, 28590, 28597, 28603, 28609, 28616, 28622, 28629,
+ 28636, 28643, 28650, 28657, 28664, 28670, 28677, 28684, 28690, 28697,
+ 28704, 28711, 28718, 28725, 28732, 28739, 0, 0, 0, 0, 28746, 28754,
+ 28761, 28768, 28774, 28781, 28787, 28794, 28800, 28807, 28814, 28821,
+ 28828, 28835, 28842, 28849, 28856, 28863, 28870, 28877, 28883, 28889,
+ 28896, 28903, 28910, 28916, 0, 0, 0, 0, 0, 0, 28922, 28928, 28933, 28938,
+ 28943, 28948, 28953, 28958, 28963, 28968, 28973, 0, 0, 0, 28979, 28985,
+ 28991, 28995, 29001, 29007, 29013, 29019, 29025, 29031, 29037, 29043,
+ 29049, 29055, 29061, 29067, 29073, 29079, 29085, 29089, 29095, 29101,
+ 29107, 29113, 29119, 29125, 29131, 29137, 29143, 29149, 29155, 29161,
+ 29167, 29173, 29179, 29183, 29188, 29193, 29198, 29202, 29207, 29211,
+ 29216, 29221, 29226, 29230, 29235, 29240, 29245, 29250, 29255, 29259,
+ 29263, 29268, 29273, 29278, 29282, 29286, 29291, 29296, 29301, 29306, 0,
+ 0, 29312, 29316, 29323, 29328, 29334, 29340, 29345, 29351, 29357, 29362,
+ 29368, 29374, 29380, 29386, 29392, 29397, 29402, 29408, 29413, 29419,
+ 29424, 29430, 29436, 29442, 29448, 29452, 29457, 29462, 29468, 29474,
+ 29479, 29485, 29491, 29495, 29500, 29505, 29509, 29514, 29519, 29524,
+ 29529, 29535, 29541, 29547, 29552, 29557, 29561, 29566, 29570, 29575,
+ 29579, 29584, 29589, 29594, 29599, 29606, 29613, 29621, 29632, 29641,
+ 29649, 29656, 29667, 29673, 29680, 0, 29687, 29692, 29697, 29705, 29711,
+ 29719, 29724, 29730, 29736, 29742, 29747, 29753, 29758, 29765, 29771,
+ 29776, 29782, 29788, 29794, 29801, 29808, 29815, 29820, 29825, 29832,
+ 29839, 29846, 29853, 29860, 0, 0, 29867, 29874, 29881, 29887, 29893,
+ 29899, 29905, 29911, 29917, 29923, 29929, 0, 0, 0, 0, 0, 0, 29935, 29941,
+ 29946, 29951, 29956, 29961, 29966, 29971, 29976, 29981, 0, 0, 0, 0, 0, 0,
+ 29986, 29991, 29996, 30001, 30006, 30011, 30016, 30025, 30032, 30037,
+ 30042, 30047, 30052, 30057, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26481, 26486,
- 26489, 26493, 26497, 26501, 26505, 26509, 26513, 26517, 26521, 26525,
- 26529, 26533, 26537, 26541, 26545, 26548, 26552, 26556, 26560, 26563,
- 26566, 26569, 26573, 26577, 26581, 26585, 26589, 0, 0, 0, 26592, 26596,
- 26600, 26604, 26609, 26614, 26619, 26624, 26628, 26632, 26637, 26642, 0,
- 0, 0, 0, 26648, 26652, 26657, 26662, 26667, 26672, 26676, 26680, 26684,
- 26689, 26693, 26697, 0, 0, 0, 0, 26701, 0, 0, 0, 26705, 26709, 26713,
- 26717, 26720, 26723, 26726, 26729, 26732, 26735, 26738, 26741, 26744,
- 26749, 26755, 26761, 26767, 26773, 26778, 26784, 26790, 26796, 26801,
- 26807, 26812, 26818, 26824, 26829, 26835, 26841, 26847, 26853, 26858,
- 26863, 26869, 26875, 26880, 26886, 26891, 26897, 26902, 26908, 0, 0,
- 26914, 26920, 26926, 26932, 26938, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 26944, 26951, 26958, 26964, 26971, 26978, 26984, 26991, 26998, 27005,
- 27012, 27018, 27025, 27032, 27038, 27045, 27052, 27059, 27066, 27073,
- 27080, 27086, 27093, 27099, 27105, 27112, 27118, 27125, 27132, 27139,
- 27146, 27153, 27160, 27166, 27173, 27180, 27186, 27193, 27200, 27207,
- 27214, 27221, 0, 0, 0, 0, 0, 0, 27228, 27236, 27243, 27250, 27256, 27263,
- 27269, 27276, 27282, 27289, 27296, 27303, 27310, 27317, 27324, 27331,
- 27338, 27345, 27351, 27358, 27364, 27370, 27377, 27384, 27391, 27397, 0,
- 0, 0, 0, 0, 0, 27403, 27409, 27414, 27419, 27424, 27429, 27434, 27439,
- 27444, 27449, 0, 0, 0, 0, 27454, 27460, 27466, 27470, 27476, 27482,
- 27488, 27494, 27500, 27506, 27512, 27518, 27524, 27530, 27536, 27542,
- 27548, 27554, 27560, 27564, 27570, 27576, 27582, 27588, 27594, 27600,
- 27606, 27612, 27618, 27624, 27630, 27636, 27642, 27648, 27654, 27658,
- 27663, 27668, 27673, 27677, 27682, 27686, 27691, 27696, 27701, 27706,
- 27711, 27716, 27721, 27726, 27731, 27735, 27739, 27744, 27749, 27754,
- 27758, 27762, 27767, 27772, 27777, 27782, 0, 0, 27788, 27792, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30062, 30068,
+ 30074, 30078, 30082, 30086, 30090, 30096, 30100, 30106, 30110, 30116,
+ 30122, 30130, 30136, 30144, 30148, 30152, 30156, 30162, 30165, 30171,
+ 30175, 30181, 30185, 30189, 30195, 30199, 30205, 30209, 30215, 30223,
+ 30231, 30239, 30245, 30249, 30255, 30259, 30265, 30268, 30271, 30277,
+ 30281, 30287, 30290, 30293, 30296, 30300, 30304, 30310, 30316, 30320,
+ 30323, 30327, 30332, 30337, 30344, 30349, 30356, 30363, 30372, 30379,
+ 30388, 30393, 30400, 30407, 30416, 30421, 30428, 30433, 30439, 30445,
+ 30451, 30457, 30463, 30469, 0, 0, 0, 0, 30475, 30479, 30482, 30485,
+ 30488, 30491, 30494, 30497, 30500, 30503, 30506, 30509, 30512, 30515,
+ 30520, 30525, 30530, 30533, 30538, 30543, 30548, 30553, 30560, 30565,
+ 30570, 30575, 30580, 30587, 30593, 30599, 30605, 30611, 30617, 30626,
+ 30635, 30641, 30647, 30656, 30665, 30674, 30683, 30692, 30701, 30710,
+ 30719, 0, 0, 0, 30728, 30733, 30738, 30743, 30747, 30751, 30755, 30760,
+ 30764, 30768, 30773, 30777, 30782, 30787, 30792, 30797, 30802, 30807,
+ 30812, 30817, 30822, 30826, 30830, 30835, 30840, 30845, 30849, 30853,
+ 30857, 30862, 30867, 30872, 30877, 30881, 30888, 30895, 30902, 30908,
+ 30914, 30920, 30926, 30932, 30938, 0, 0, 0, 30943, 30948, 30953, 30958,
+ 30962, 30966, 30970, 30974, 30978, 30982, 30986, 30990, 0, 0, 0, 0, 0, 0,
+ 30994, 30998, 31004, 31008, 31014, 31020, 31025, 31032, 31036, 31042,
+ 31046, 31052, 31057, 31064, 31071, 31076, 31083, 31088, 31093, 31097,
+ 31103, 31107, 31113, 31120, 31127, 31132, 31139, 31146, 31150, 31156,
+ 31161, 31166, 31173, 31178, 31183, 31188, 31193, 31197, 31201, 31206,
+ 31211, 31218, 31224, 31229, 31236, 31241, 31248, 31253, 31263, 31270,
+ 31277, 31281, 0, 0, 0, 0, 0, 0, 0, 0, 31285, 31294, 31301, 31308, 31315,
+ 31318, 31322, 31326, 31330, 31334, 31338, 31342, 31346, 31350, 31354,
+ 31358, 31362, 31366, 31369, 31372, 31376, 31380, 31384, 31388, 31392,
+ 31396, 31399, 31403, 31407, 31411, 31415, 31418, 31421, 31425, 31428,
+ 31432, 31436, 31440, 31444, 31448, 31451, 31456, 31461, 31466, 31470,
+ 31474, 31479, 31483, 31488, 31492, 31498, 31503, 31508, 31513, 31519,
+ 31524, 31530, 31536, 31542, 31546, 0, 0, 0, 31550, 31555, 31564, 31569,
+ 31576, 31581, 31585, 31588, 31591, 31594, 31597, 31600, 31603, 31606,
+ 31609, 0, 0, 0, 31612, 31616, 31620, 31624, 31631, 31637, 31643, 31649,
+ 31655, 31661, 31667, 31673, 31679, 31685, 31692, 31699, 31706, 31713,
+ 31720, 31727, 31734, 31741, 31748, 31755, 31762, 31769, 31776, 31783,
+ 31790, 31797, 31804, 31811, 31818, 31825, 31832, 31839, 31846, 31853,
+ 31860, 31867, 31874, 31881, 31888, 31895, 31903, 31911, 31919, 31925,
+ 31931, 31937, 31945, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31954, 31959, 31964, 31969,
+ 31974, 31983, 31994, 32003, 32014, 32020, 32033, 32039, 32046, 32053,
+ 32058, 32064, 32070, 32081, 32090, 32097, 32104, 32113, 32120, 32129,
+ 32139, 32149, 32156, 32163, 32170, 32180, 32185, 32193, 32199, 32207,
+ 32216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32221, 32226, 32232, 32239,
+ 32247, 32253, 32259, 32265, 32270, 32278, 32284, 32290, 32296, 32304,
+ 32309, 32316, 32321, 32328, 32334, 32342, 32350, 32357, 32363, 32370,
+ 32377, 32383, 32390, 32397, 32403, 32408, 32414, 32422, 32430, 32436,
+ 32442, 32448, 32454, 32462, 32466, 32472, 32478, 32484, 32490, 32496,
+ 32502, 32506, 32511, 32516, 32523, 32528, 32532, 32538, 32543, 32548,
+ 32552, 32557, 32562, 32566, 32570, 32574, 32580, 32584, 32589, 32594,
+ 32598, 32603, 32607, 32612, 32616, 32622, 32627, 32634, 32639, 32644,
+ 32648, 32653, 32659, 32667, 32672, 32678, 32683, 32687, 32692, 32696,
+ 32702, 32709, 32716, 32721, 32726, 32730, 32736, 32742, 32747, 32752,
+ 32757, 32763, 32768, 32774, 32779, 32785, 32791, 32797, 32804, 32811,
+ 32818, 32825, 32832, 32839, 32844, 32853, 32863, 32873, 32883, 32893,
+ 32903, 32913, 32926, 32936, 32946, 32956, 32963, 32968, 32975, 32983,
+ 32991, 32998, 33005, 33012, 33019, 33027, 33036, 33045, 33054, 33063,
+ 33072, 33081, 33090, 33099, 33108, 33117, 33126, 33135, 33144, 33153,
+ 33161, 33170, 33181, 33189, 33199, 33211, 33220, 33229, 33239, 33248,
+ 33256, 33265, 33272, 33277, 33285, 33290, 33298, 33303, 33312, 33318,
+ 33325, 33332, 33337, 33342, 33350, 33358, 33367, 33376, 33381, 33388,
+ 33399, 33407, 33416, 33421, 33427, 33432, 33439, 33444, 33453, 33458,
+ 33463, 33468, 33475, 33482, 33487, 33496, 33504, 33509, 33514, 33521,
+ 33528, 33532, 33536, 33539, 33542, 33545, 33548, 33551, 33554, 33561,
+ 33564, 33567, 33572, 33576, 33580, 33584, 33588, 33592, 33602, 33608,
+ 33614, 33620, 33628, 33636, 33642, 33648, 33655, 33661, 33666, 33672,
+ 33678, 33683, 33689, 33695, 33703, 33708, 33714, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33720, 33727, 33734, 33739, 33748,
+ 33756, 33764, 33771, 33778, 33785, 33792, 33800, 33808, 33818, 33828,
+ 33836, 33844, 33852, 33860, 33869, 33878, 33886, 33894, 33903, 33912,
+ 33922, 33932, 33941, 33950, 33958, 33966, 33974, 33982, 33992, 34002,
+ 34010, 34018, 34026, 34034, 34042, 34050, 34058, 34066, 34074, 34082,
+ 34090, 34098, 34107, 34116, 34125, 34134, 34144, 34154, 34161, 34168,
+ 34176, 34184, 34193, 34202, 34210, 34218, 34230, 34242, 34251, 34260,
+ 34269, 34278, 34285, 34292, 34300, 34308, 34316, 34324, 34332, 34340,
+ 34348, 34356, 34365, 34374, 34383, 34392, 34401, 34410, 34420, 34430,
+ 34440, 34450, 34459, 34468, 34475, 34482, 34490, 34498, 34506, 34514,
+ 34522, 34530, 34542, 34554, 34563, 34572, 34580, 34588, 34596, 34604,
+ 34615, 34626, 34637, 34648, 34660, 34672, 34680, 34688, 34696, 34704,
+ 34713, 34722, 34731, 34740, 34748, 34756, 34764, 34772, 34780, 34788,
+ 34797, 34806, 34816, 34826, 34834, 34842, 34850, 34858, 34866, 34874,
+ 34881, 34888, 34896, 34904, 34912, 34920, 34928, 34936, 34944, 34952,
+ 34960, 34968, 34976, 34984, 34992, 35000, 35008, 35016, 35025, 35034,
+ 35043, 35051, 35060, 35069, 35078, 35087, 35097, 35106, 35112, 35117,
+ 35124, 35131, 35139, 35147, 35156, 35165, 35175, 35185, 35196, 35207,
+ 35217, 35227, 35237, 35247, 35256, 35265, 35275, 35285, 35296, 35307,
+ 35317, 35327, 35337, 35347, 35354, 35361, 35369, 35377, 35384, 35391,
+ 35400, 35409, 35419, 35429, 35440, 35451, 35461, 35471, 35481, 35491,
+ 35500, 35509, 35517, 35525, 35532, 35539, 35547, 35555, 35564, 35573,
+ 35583, 35593, 35604, 35615, 35625, 35635, 35645, 35655, 35664, 35673,
+ 35683, 35693, 35704, 35715, 35725, 35735, 35745, 35755, 35762, 35769,
+ 35777, 35785, 35794, 35803, 35813, 35823, 35834, 35845, 35855, 35865,
+ 35875, 35885, 35893, 35901, 35909, 35917, 35926, 35935, 35943, 35951,
+ 35958, 35965, 35972, 35979, 35987, 35995, 36003, 36011, 36022, 36032,
+ 36043, 36053, 36064, 36074, 36082, 36090, 36101, 36111, 36122, 36132,
+ 36143, 36153, 36161, 36169, 36180, 36190, 36201, 0, 0, 36211, 36219,
+ 36227, 36238, 36248, 36259, 0, 0, 36269, 36277, 36285, 36296, 36306,
+ 36317, 36327, 36338, 36348, 36356, 36364, 36375, 36385, 36396, 36406,
+ 36417, 36427, 36435, 36443, 36454, 36464, 36475, 36485, 36496, 36506,
+ 36514, 36522, 36533, 36543, 36554, 36564, 36575, 36585, 36593, 36601,
+ 36612, 36622, 36633, 0, 0, 36643, 36651, 36659, 36670, 36680, 36691, 0,
+ 0, 36701, 36709, 36717, 36728, 36738, 36749, 36759, 36770, 0, 36780, 0,
+ 36788, 0, 36798, 0, 36808, 36818, 36826, 36834, 36845, 36855, 36866,
+ 36876, 36887, 36897, 36905, 36913, 36924, 36934, 36945, 36955, 36966,
+ 36976, 36984, 36992, 37000, 37008, 37016, 37024, 37032, 37040, 37048,
+ 37056, 37064, 37072, 37080, 0, 0, 37088, 37099, 37109, 37123, 37136,
+ 37150, 37163, 37177, 37190, 37201, 37211, 37225, 37238, 37252, 37265,
+ 37279, 37292, 37303, 37313, 37327, 37340, 37354, 37367, 37381, 37394,
+ 37405, 37415, 37429, 37442, 37456, 37469, 37483, 37496, 37507, 37517,
+ 37531, 37544, 37558, 37571, 37585, 37598, 37609, 37619, 37633, 37646,
+ 37660, 37673, 37687, 37700, 37708, 37716, 37727, 37735, 0, 37746, 37754,
+ 37765, 37773, 37781, 37789, 37797, 37805, 37808, 37811, 37814, 37817,
+ 37823, 37834, 37842, 0, 37853, 37861, 37872, 37880, 37888, 37896, 37904,
+ 37912, 37918, 37924, 37930, 37938, 37946, 37957, 0, 0, 37968, 37976,
+ 37987, 37995, 38003, 38011, 0, 38019, 38024, 38029, 38034, 38042, 38050,
+ 38061, 38072, 38080, 38088, 38096, 38107, 38115, 38123, 38131, 38139,
+ 38147, 38153, 38159, 0, 0, 38162, 38173, 38181, 0, 38192, 38200, 38211,
+ 38219, 38227, 38235, 38243, 38251, 38254, 0, 38257, 38261, 38265, 38269,
+ 38273, 38277, 38281, 38285, 38289, 38293, 38297, 38301, 38307, 38313,
+ 38319, 38322, 38325, 38327, 38331, 38335, 38339, 38343, 38345, 38349,
+ 38353, 38359, 38365, 38372, 38379, 38384, 38389, 38395, 38401, 38403,
+ 38406, 38408, 38412, 38416, 38420, 38423, 38427, 38431, 38435, 38439,
+ 38443, 38449, 38453, 38457, 38463, 38468, 38475, 38477, 38480, 38484,
+ 38488, 38493, 38499, 38501, 38510, 38519, 38522, 38526, 38528, 38530,
+ 38532, 38535, 38541, 38543, 38547, 38551, 38558, 38565, 38569, 38574,
+ 38579, 38584, 38589, 38593, 38597, 38600, 38604, 38608, 38615, 38620,
+ 38624, 38628, 38633, 38637, 38641, 38646, 38651, 38655, 38659, 38663,
+ 38665, 38670, 38675, 38679, 38683, 38687, 38691, 0, 0, 0, 0, 0, 38695,
+ 38701, 38707, 38714, 38721, 38726, 38731, 38735, 0, 0, 38741, 38744,
+ 38747, 38750, 38753, 38756, 38759, 38763, 38767, 38772, 38777, 38782,
+ 38788, 38792, 38795, 38798, 38801, 38804, 38807, 38810, 38813, 38816,
+ 38819, 38823, 38827, 38832, 38837, 0, 38842, 38848, 38854, 38860, 38867,
+ 38874, 38881, 38888, 38894, 38900, 38906, 38913, 38919, 0, 0, 0, 38926,
+ 38929, 38932, 38935, 38940, 38943, 38946, 38949, 38952, 38955, 38958,
+ 38962, 38965, 38968, 38971, 38974, 38977, 38982, 38985, 38988, 38991,
+ 38994, 38997, 39002, 39005, 39008, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 39013, 39018, 39023, 39030, 39038, 39043,
+ 39048, 39052, 39056, 39061, 39068, 39075, 39079, 39084, 39089, 39094,
+ 39099, 39106, 39111, 39116, 39121, 39130, 39137, 39144, 39148, 39153,
+ 39159, 39164, 39171, 39179, 39187, 39191, 39195, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 39199, 39203, 39211, 39215, 39219, 39224, 39228,
+ 39232, 39236, 39238, 39242, 39246, 39250, 39255, 39259, 39263, 39271,
+ 39274, 39278, 39281, 39284, 39290, 39293, 39296, 39302, 39306, 39310,
+ 39314, 39317, 39321, 39324, 39328, 39330, 39333, 39336, 39340, 39342,
+ 39346, 39349, 39352, 39357, 39362, 39369, 39372, 39375, 39379, 39384,
+ 39387, 39390, 39393, 39397, 39402, 39405, 39408, 39410, 39413, 39416,
+ 39419, 39423, 39428, 39431, 39435, 39439, 39443, 39447, 39452, 39458,
+ 39463, 39468, 39474, 39479, 39484, 39488, 39492, 39497, 39501, 39505,
+ 39508, 39510, 39515, 39521, 39528, 39535, 39542, 39549, 39556, 39563,
+ 39570, 39577, 39585, 39592, 39600, 39607, 39614, 39622, 39630, 39635,
+ 39640, 39645, 39650, 39655, 39660, 39665, 39670, 39675, 39680, 39686,
+ 39692, 39698, 39704, 39711, 39719, 39726, 39732, 39738, 39744, 39750,
+ 39756, 39762, 39768, 39774, 39780, 39787, 39794, 39801, 39808, 39816,
+ 39825, 39833, 39844, 39852, 39860, 39869, 39876, 39885, 39894, 39902,
+ 39911, 0, 0, 0, 0, 0, 0, 39919, 39921, 39924, 39926, 39929, 39932, 39935,
+ 39940, 39945, 39950, 39955, 39959, 39963, 39967, 39971, 39976, 39982,
+ 39987, 39993, 39998, 40003, 40008, 40014, 40019, 40025, 40031, 40035,
+ 40039, 40044, 40049, 40054, 40059, 40064, 40072, 40080, 40088, 40096,
+ 40103, 40111, 40118, 40125, 40134, 40146, 40153, 40160, 40167, 40174,
+ 40182, 40190, 40197, 40204, 40212, 40220, 40225, 40233, 40238, 40243,
+ 40249, 40254, 40260, 40267, 40274, 40279, 40285, 40290, 40293, 40297,
+ 40300, 40304, 40308, 40312, 40318, 40324, 40330, 40336, 40340, 40344,
+ 40348, 40352, 40358, 40364, 40368, 40373, 40377, 40382, 40387, 40392,
+ 40395, 40399, 40402, 40406, 40413, 40421, 40432, 40443, 40448, 40457,
+ 40464, 40473, 40482, 40486, 40492, 40500, 40504, 40509, 40514, 40520,
+ 40526, 40532, 40539, 40543, 40547, 40552, 40555, 40557, 40561, 40565,
+ 40573, 40577, 40579, 40581, 40585, 40593, 40598, 40604, 40614, 40621,
+ 40626, 40630, 40634, 40638, 40641, 40644, 40647, 40651, 40655, 40659,
+ 40663, 40667, 40670, 40674, 40678, 40681, 40683, 40686, 40688, 40692,
+ 40696, 40698, 40704, 40707, 40712, 40716, 40720, 40722, 40724, 40726,
+ 40729, 40733, 40737, 40741, 40745, 40749, 40755, 40761, 40763, 40765,
+ 40767, 40769, 40772, 40774, 40778, 40780, 40784, 40788, 40793, 40797,
+ 40801, 40805, 40809, 40813, 40819, 40823, 40833, 40843, 40847, 40853,
+ 40859, 40863, 40867, 40870, 40875, 40879, 40885, 40889, 40901, 40909,
+ 40913, 40917, 40923, 40927, 40930, 40932, 40935, 40939, 40943, 40950,
+ 40954, 40958, 40962, 40965, 40970, 40975, 40980, 40985, 40990, 40995,
+ 41003, 41011, 41015, 41019, 41021, 41026, 41030, 41034, 41042, 41050,
+ 41056, 41062, 41071, 41080, 41085, 41090, 41098, 41106, 41108, 41110,
+ 41115, 41120, 41126, 41132, 41138, 41144, 41148, 41152, 41159, 41166,
+ 41172, 41178, 41188, 41198, 41206, 41214, 41216, 41220, 41224, 41229,
+ 41234, 41241, 41248, 41251, 41254, 41257, 41260, 41263, 41268, 41272,
+ 41277, 41282, 41285, 41288, 41291, 41294, 41297, 41301, 41304, 41307,
+ 41310, 41313, 41315, 41317, 41319, 41321, 41329, 41337, 41343, 41347,
+ 41353, 41363, 41369, 41375, 41381, 41389, 41397, 41408, 41412, 41416,
+ 41418, 41424, 41426, 41428, 41430, 41432, 41438, 41441, 41447, 41453,
+ 41457, 41461, 41465, 41468, 41472, 41476, 41478, 41487, 41496, 41501,
+ 41506, 41512, 41518, 41524, 41527, 41530, 41533, 41536, 41538, 41543,
+ 41548, 41553, 41559, 41565, 41573, 41581, 41587, 41593, 41599, 41605,
+ 41614, 41623, 41632, 41641, 41650, 41659, 41668, 41677, 41686, 41695,
+ 41703, 41715, 41725, 41740, 41743, 41748, 41754, 41760, 41767, 41781,
+ 41796, 41802, 41808, 41815, 41821, 41829, 41835, 41848, 41862, 41867,
+ 41873, 41880, 41883, 41886, 41888, 41891, 41894, 41896, 41898, 41902,
+ 41905, 41908, 41911, 41914, 41919, 41924, 41929, 41934, 41939, 41942,
+ 41944, 41946, 41948, 41952, 41956, 41960, 41966, 41971, 41973, 41975,
+ 41980, 41985, 41990, 41995, 42000, 42005, 42007, 42009, 42018, 42022,
+ 42030, 42039, 42041, 42046, 42051, 42059, 42063, 42065, 42069, 42071,
+ 42075, 42079, 42083, 42085, 42087, 42089, 42094, 42101, 42108, 42115,
+ 42122, 42129, 42136, 42143, 42150, 42156, 42162, 42169, 42176, 42183,
+ 42190, 42196, 42202, 42209, 42216, 42223, 42231, 42238, 42246, 42253,
+ 42261, 42268, 42276, 42284, 42291, 42299, 42306, 42314, 42321, 42329,
+ 42336, 42343, 42350, 42357, 42364, 42372, 42379, 42386, 42393, 42401,
+ 42408, 42415, 42422, 42429, 42437, 42445, 42452, 42459, 42465, 42472,
+ 42477, 42484, 42491, 42500, 42507, 42515, 42523, 42528, 42533, 42538,
+ 42545, 42552, 42559, 42566, 42571, 42576, 42585, 42591, 42594, 42602,
+ 42605, 42610, 42615, 42618, 42621, 42629, 42632, 42637, 42640, 42647,
+ 42652, 42660, 42663, 42666, 42669, 42674, 42679, 42682, 42685, 42693,
+ 42696, 42701, 42708, 42712, 42716, 42721, 42726, 42732, 42737, 42743,
+ 42749, 42754, 42760, 42768, 42774, 42782, 42790, 42796, 42804, 42812,
+ 42821, 42829, 42835, 42843, 42852, 42860, 42864, 42869, 42882, 42895,
+ 42899, 42903, 42907, 42911, 42921, 42925, 42930, 42935, 42940, 42945,
+ 42950, 42955, 42965, 42975, 42983, 42993, 43003, 43011, 43021, 43031,
+ 43039, 43049, 43059, 43067, 43075, 43085, 43095, 43098, 43101, 43104,
+ 43109, 43113, 43119, 43126, 43133, 43141, 43148, 43152, 43156, 43160,
+ 43164, 43166, 43170, 43174, 43179, 43184, 43191, 43198, 43201, 43208,
+ 43210, 43212, 43216, 43220, 43225, 43231, 43237, 43243, 43249, 43258,
+ 43267, 43276, 43280, 43282, 43286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 43293, 43297, 43304, 43311, 43318, 43325, 43329, 43333, 43337, 43341,
+ 43346, 43352, 43357, 43363, 43369, 43375, 43381, 43389, 43396, 43403,
+ 43410, 43417, 43422, 43428, 43437, 43441, 43448, 43452, 43456, 43462,
+ 43468, 43474, 43480, 43484, 43488, 43491, 43495, 43499, 43506, 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, 43513,
+ 43516, 43520, 43524, 43530, 43536, 43542, 43550, 43557, 43561, 43569, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43574, 43577,
+ 43580, 43583, 43586, 43589, 43592, 43595, 43598, 43601, 43605, 43609,
+ 43613, 43617, 43621, 43625, 43629, 43633, 43637, 43641, 43645, 43648,
+ 43651, 43654, 43657, 43660, 43663, 43666, 43669, 43672, 43676, 43680,
+ 43684, 43688, 43692, 43696, 43700, 43704, 43708, 43712, 43716, 43722,
+ 43728, 43734, 43741, 43748, 43755, 43762, 43769, 43776, 43783, 43790,
+ 43797, 43804, 43811, 43818, 43825, 43832, 43839, 43846, 43853, 43858,
+ 43864, 43870, 43876, 43881, 43887, 43893, 43899, 43904, 43910, 43916,
+ 43921, 43926, 43931, 43936, 43942, 43948, 43953, 43958, 43964, 43969,
+ 43975, 43981, 43987, 43993, 43999, 44004, 44010, 44016, 44022, 44027,
+ 44033, 44039, 44045, 44050, 44056, 44062, 44067, 44072, 44077, 44082,
+ 44088, 44094, 44099, 44104, 44110, 44115, 44121, 44127, 44133, 44139,
+ 44145, 44150, 44156, 44162, 44168, 44173, 44179, 44185, 44191, 44196,
+ 44202, 44208, 44213, 44218, 44223, 44228, 44234, 44240, 44245, 44250,
+ 44256, 44261, 44267, 44273, 44279, 44285, 44291, 44295, 44300, 44305,
+ 44310, 44315, 44320, 44325, 44330, 44335, 44340, 44345, 44349, 44353,
+ 44357, 44361, 44365, 44369, 44373, 44377, 44381, 44386, 44391, 44396,
+ 44401, 44406, 44411, 44420, 44429, 44438, 44447, 44456, 44465, 44474,
+ 44483, 44490, 44498, 44506, 44513, 44520, 44528, 44536, 44543, 44550,
+ 44558, 44566, 44573, 44580, 44588, 44596, 44603, 44610, 44618, 44627,
+ 44636, 44644, 44653, 44662, 44669, 44676, 44684, 44693, 44702, 44710,
+ 44719, 44728, 44735, 44742, 44751, 44760, 44768, 44776, 44785, 44794,
+ 44801, 44808, 44817, 44826, 44834, 44842, 44851, 44860, 44867, 44874,
+ 44883, 44892, 44900, 44909, 44918, 44926, 44936, 44946, 44956, 44966,
+ 44975, 44984, 44993, 45002, 45009, 45017, 45025, 45033, 45041, 45046,
+ 45051, 45060, 45068, 45075, 45084, 45092, 45099, 45108, 45116, 45123,
+ 45132, 45140, 45147, 45156, 45164, 45171, 45180, 45188, 45195, 45204,
+ 45212, 45219, 45228, 45236, 45243, 45252, 45260, 45267, 45276, 45285,
+ 45294, 45303, 45317, 45331, 45338, 45343, 45348, 45353, 45358, 45363,
+ 45368, 45373, 45378, 45386, 45394, 45402, 45410, 45415, 45422, 45429,
+ 45436, 45441, 45449, 45456, 45464, 45468, 45475, 45481, 45488, 45492,
+ 45498, 45504, 45510, 45514, 45517, 45521, 45525, 45532, 45538, 45544,
+ 45550, 45556, 45570, 45580, 45594, 45608, 45614, 45624, 45638, 45641,
+ 45644, 45651, 45659, 45664, 45669, 45677, 45689, 45701, 45709, 45713,
+ 45717, 45720, 45723, 45727, 45731, 45734, 45737, 45742, 45747, 45753,
+ 45759, 45764, 45769, 45775, 45781, 45786, 45791, 45796, 45801, 45807,
+ 45813, 45818, 45823, 45829, 45835, 45840, 45845, 45848, 45851, 45860,
+ 45862, 45864, 45867, 45871, 45877, 45879, 45882, 45889, 45896, 45904,
+ 45912, 45922, 45936, 45941, 45946, 45950, 45955, 45963, 45971, 45980,
+ 45989, 45998, 46007, 46012, 46017, 46023, 46029, 46035, 46041, 46044,
+ 46050, 46056, 46066, 46076, 46084, 46092, 46101, 46110, 46114, 46122,
+ 46130, 46138, 46146, 46155, 46164, 46173, 46182, 46187, 46192, 46197,
+ 46202, 46207, 46213, 46219, 46224, 46230, 46232, 46234, 46236, 46238,
+ 46241, 46244, 46246, 46248, 46250, 46254, 46258, 46260, 46262, 46265,
+ 46268, 46272, 46278, 46284, 46286, 46293, 46297, 46302, 46307, 46309,
+ 46319, 46325, 46331, 46337, 46343, 46349, 46355, 46360, 46363, 46366,
+ 46369, 46371, 46373, 46377, 46381, 46386, 46391, 46396, 46399, 46403,
+ 46408, 46411, 46415, 46420, 46425, 46430, 46435, 46440, 46445, 46450,
+ 46455, 46460, 46465, 46470, 46475, 46481, 46487, 46493, 46495, 46498,
+ 46500, 46503, 46505, 46507, 46509, 46511, 46513, 46515, 46517, 46519,
+ 46521, 46523, 46525, 46527, 46529, 46531, 46533, 46535, 46537, 46542,
+ 46547, 46552, 46557, 46562, 46567, 46572, 46577, 46582, 46587, 46592,
+ 46597, 46602, 46607, 46612, 46617, 46622, 46627, 46632, 46637, 46641,
+ 46645, 46649, 46655, 46661, 46666, 46671, 46676, 46681, 46686, 46691,
+ 46699, 46707, 46715, 46723, 46731, 46739, 46747, 46755, 46761, 46766,
+ 46771, 46776, 46779, 46783, 46787, 46791, 46795, 46799, 46803, 46810,
+ 46817, 46825, 46833, 46838, 46843, 46850, 46857, 46864, 46871, 46874,
+ 46877, 46882, 46884, 46888, 46893, 46895, 46897, 46899, 46901, 46906,
+ 46909, 46911, 46916, 46923, 46930, 46933, 46937, 46942, 46947, 46955,
+ 46961, 46967, 46979, 46986, 46993, 46998, 47003, 47009, 47012, 47015,
+ 47020, 47022, 47026, 47028, 47030, 47032, 47034, 47036, 47038, 47043,
+ 47045, 47047, 47049, 47051, 47055, 47057, 47060, 47065, 47070, 47075,
+ 47080, 47086, 47092, 47094, 47097, 47104, 47111, 47118, 47125, 47129,
+ 47133, 47135, 47137, 47141, 47147, 47152, 47154, 47158, 47167, 47175,
+ 47183, 47189, 47195, 47200, 47206, 47211, 47214, 47228, 47231, 47236,
+ 47241, 47247, 47257, 47259, 47265, 47271, 47275, 47282, 47286, 47288,
+ 47290, 47294, 47300, 47305, 47311, 47313, 47319, 47321, 47327, 47329,
+ 47331, 47336, 47338, 47342, 47347, 47349, 47354, 47359, 47363, 47370, 0,
+ 47380, 47386, 47389, 47395, 47398, 47403, 47408, 47412, 47414, 47416,
+ 47420, 47424, 47428, 47432, 47437, 47439, 47444, 47447, 47450, 47453,
+ 47457, 47461, 47466, 47470, 47475, 47480, 47484, 47490, 47497, 47500,
+ 47506, 47511, 47515, 47520, 47526, 47532, 47539, 47545, 47552, 47559,
+ 47561, 47568, 47572, 47579, 47585, 47590, 47596, 47600, 47605, 47608,
+ 47614, 47620, 47627, 47635, 47642, 47651, 47661, 47668, 47674, 47678,
+ 47686, 47691, 47700, 47703, 47706, 47715, 47726, 47733, 47735, 47741,
+ 47746, 47748, 47751, 47755, 47763, 47772, 47775, 47780, 47785, 47793,
+ 47801, 47809, 47817, 47823, 47829, 47835, 47843, 47848, 47851, 47855,
+ 47858, 47870, 47880, 47891, 47900, 47911, 47921, 47930, 47936, 47944,
+ 47948, 47956, 47960, 47968, 47975, 47982, 47991, 48000, 48010, 48020,
+ 48030, 48040, 48049, 48058, 48068, 48078, 48087, 48096, 48102, 48108,
+ 48114, 48120, 48126, 48132, 48138, 48144, 48150, 48157, 48163, 48169,
+ 48175, 48181, 48187, 48193, 48199, 48205, 48211, 48218, 48225, 48232,
+ 48239, 48246, 48253, 48260, 48267, 48274, 48281, 48289, 48294, 48297,
+ 48301, 48305, 48311, 48314, 48320, 48326, 48331, 48335, 48340, 48346,
+ 48353, 48356, 48363, 48370, 48374, 48383, 48392, 48397, 48403, 48408,
+ 48413, 48420, 48427, 48435, 48443, 48452, 48456, 48465, 48470, 48474,
+ 48481, 48485, 48492, 48500, 48505, 48513, 48517, 48522, 48526, 48531,
+ 48535, 48540, 48545, 48554, 48556, 48560, 48564, 48571, 48578, 48583,
+ 48591, 48597, 0, 48603, 0, 48606, 48611, 48616, 48624, 48628, 48635,
+ 48643, 48651, 48656, 48661, 48667, 48672, 48677, 48683, 48688, 48691,
+ 48695, 48699, 48706, 48715, 48720, 48729, 48738, 48744, 48750, 48755,
+ 48760, 48765, 48770, 48776, 48782, 48790, 48798, 48804, 48810, 48815,
+ 48820, 48827, 48834, 48840, 48843, 48846, 48850, 48854, 48858, 48863,
+ 48869, 48875, 48882, 48889, 48894, 48898, 48902, 48906, 48910, 48914,
+ 48918, 48922, 48926, 48930, 48934, 48938, 48942, 48946, 48950, 48954,
+ 48958, 48962, 48966, 48970, 48974, 48978, 48982, 48986, 48990, 48994,
+ 48998, 49002, 49006, 49010, 49014, 49018, 49022, 49026, 49030, 49034,
+ 49038, 49042, 49046, 49050, 49054, 49058, 49062, 49066, 49070, 49074,
+ 49078, 49082, 49086, 49090, 49094, 49098, 49102, 49106, 49110, 49114,
+ 49118, 49122, 49126, 49130, 49134, 49138, 49142, 49146, 49150, 49154,
+ 49158, 49162, 49166, 49170, 49174, 49178, 49182, 49186, 49190, 49194,
+ 49198, 49202, 49206, 49210, 49214, 49218, 49222, 49226, 49230, 49234,
+ 49238, 49242, 49246, 49250, 49254, 49258, 49262, 49266, 49270, 49274,
+ 49278, 49282, 49286, 49290, 49294, 49298, 49302, 49306, 49310, 49314,
+ 49318, 49322, 49326, 49330, 49334, 49338, 49342, 49346, 49350, 49354,
+ 49358, 49362, 49366, 49370, 49374, 49378, 49382, 49386, 49390, 49394,
+ 49398, 49402, 49406, 49410, 49414, 49418, 49422, 49426, 49430, 49434,
+ 49438, 49442, 49446, 49450, 49454, 49458, 49462, 49466, 49470, 49474,
+ 49478, 49482, 49486, 49490, 49494, 49498, 49502, 49506, 49510, 49514,
+ 49518, 49522, 49526, 49530, 49534, 49538, 49542, 49546, 49550, 49554,
+ 49558, 49562, 49566, 49570, 49574, 49578, 49582, 49586, 49590, 49594,
+ 49598, 49602, 49606, 49610, 49614, 49618, 49622, 49626, 49630, 49634,
+ 49638, 49642, 49646, 49650, 49654, 49658, 49662, 49666, 49670, 49674,
+ 49678, 49682, 49686, 49690, 49694, 49698, 49702, 49706, 49710, 49714,
+ 49718, 49722, 49726, 49730, 49734, 49738, 49742, 49746, 49750, 49754,
+ 49758, 49762, 49766, 49770, 49774, 49778, 49782, 49786, 49790, 49794,
+ 49798, 49802, 49806, 49810, 49814, 49818, 49822, 49826, 49830, 49834,
+ 49838, 49842, 49846, 49850, 49854, 49858, 49862, 49866, 49870, 49874,
+ 49878, 49882, 49886, 49890, 49894, 49898, 49902, 49906, 49910, 49914,
+ 49918, 49925, 49933, 49939, 49945, 49952, 49959, 49965, 49971, 49977,
+ 49983, 49988, 49993, 49998, 50003, 50009, 50015, 50023, 50030, 50036,
+ 50042, 50050, 50059, 50066, 50076, 50087, 50090, 50093, 50097, 50101,
+ 50108, 50115, 50126, 50137, 50147, 50157, 50164, 50171, 50178, 50185,
+ 50196, 50207, 50218, 50229, 50239, 50249, 50261, 50273, 50284, 50295,
+ 50307, 50319, 50328, 50338, 50348, 50359, 50370, 50377, 50384, 50391,
+ 50398, 50408, 50418, 50426, 50434, 50441, 50448, 50455, 50462, 50469,
+ 50474, 50479, 50485, 50493, 50503, 50511, 50519, 50527, 50535, 50543,
+ 50551, 50559, 50567, 50576, 50585, 50595, 50605, 50614, 50623, 50633,
+ 50643, 50652, 50661, 50671, 50681, 50690, 50699, 50709, 50719, 50733,
+ 50750, 50764, 50781, 50795, 50809, 50823, 50837, 50847, 50858, 50868,
+ 50879, 50896, 50913, 50921, 50927, 50934, 50941, 50948, 50955, 50960,
+ 50966, 50971, 50976, 50982, 50987, 50992, 50997, 51002, 51007, 51014,
+ 51019, 51026, 51031, 51036, 51040, 51044, 51051, 51058, 51065, 51072,
+ 51079, 51086, 51099, 51112, 51125, 51138, 51146, 51154, 51160, 51166,
+ 51173, 51180, 51187, 51194, 51198, 51203, 51211, 51219, 51227, 51234,
+ 51238, 51246, 51254, 51258, 51262, 51267, 51274, 51282, 51290, 51310,
+ 51330, 51350, 51370, 51390, 51410, 51430, 51450, 51456, 51463, 51472,
+ 51480, 51488, 51493, 51496, 51499, 51504, 51507, 51526, 51533, 51539,
+ 51545, 51549, 51552, 51555, 51558, 51570, 51583, 51590, 51597, 51600,
+ 51604, 51607, 51612, 51617, 51622, 51628, 51637, 51644, 51651, 51659,
+ 51666, 51673, 51676, 51682, 51688, 51691, 51694, 51699, 51704, 51710,
+ 51716, 51720, 51725, 51732, 51736, 51742, 51746, 51750, 51758, 51770,
+ 51779, 51783, 51785, 51794, 51803, 51809, 51812, 51818, 51824, 51829,
+ 51834, 51839, 51844, 51849, 51854, 51856, 51862, 51867, 51874, 51878,
+ 51884, 51887, 51891, 51898, 51905, 51907, 51909, 51915, 51921, 51927,
+ 51936, 51945, 51952, 51959, 51965, 51971, 51976, 51981, 51986, 51992,
+ 51998, 52003, 52010, 52014, 52018, 52031, 52044, 52056, 52065, 52071,
+ 52078, 52083, 52088, 52093, 52098, 52103, 52105, 52112, 52119, 52126,
+ 52133, 52140, 52148, 52154, 52159, 52165, 52171, 52177, 52184, 52190,
+ 52198, 52206, 52214, 52222, 52229, 52235, 52241, 52250, 52254, 52263,
+ 52272, 52281, 52289, 52293, 52299, 52306, 52313, 52317, 52323, 52330,
+ 52335, 52340, 52346, 52351, 52356, 52363, 52370, 52375, 52380, 52388,
+ 52396, 52406, 52416, 52423, 52430, 52434, 52438, 52450, 52456, 52462,
+ 52467, 52472, 52479, 52486, 52492, 52498, 52507, 52515, 52523, 52530,
+ 52537, 52544, 52550, 52557, 52563, 52570, 52577, 52584, 52591, 52597,
+ 52602, 52611, 52621, 52628, 52637, 52643, 52648, 52653, 52663, 52669,
+ 52675, 52681, 52689, 52694, 52701, 52708, 52719, 52726, 52733, 52740,
+ 52747, 52754, 52761, 52768, 52780, 52792, 52803, 52814, 52827, 52840,
+ 52845, 52850, 52859, 52868, 52875, 52882, 52891, 52900, 52908, 52916,
+ 52924, 52932, 52942, 52952, 52966, 52980, 52988, 52996, 53008, 53020,
+ 53028, 53036, 53046, 53056, 53061, 53066, 53075, 53084, 53089, 53094,
+ 53102, 53108, 53114, 53122, 53130, 53143, 53156, 53160, 53164, 53171,
+ 53178, 53185, 53193, 53201, 53210, 53219, 53225, 53231, 53238, 53245,
+ 53252, 53259, 53268, 53277, 53280, 53283, 53288, 53293, 53299, 53305,
+ 53312, 53319, 53329, 53339, 53346, 53353, 53361, 53369, 53377, 53385,
+ 53393, 53401, 53408, 53415, 53419, 53423, 53430, 53437, 53442, 53447,
+ 53452, 53457, 53463, 53477, 53484, 53491, 53495, 53497, 53499, 53504,
+ 53509, 53514, 53518, 53526, 53533, 53540, 53548, 53560, 53568, 53576,
+ 53587, 53591, 53595, 53601, 53609, 53622, 53629, 53636, 53643, 53648,
+ 53655, 53664, 53672, 53678, 53684, 53690, 53699, 53708, 53716, 53725,
+ 53730, 53733, 53738, 53744, 53750, 53756, 53762, 53766, 53769, 53773,
+ 53777, 53783, 53789, 53795, 53801, 53805, 53809, 53816, 53823, 53830,
+ 53837, 53844, 53851, 53861, 53871, 53878, 53885, 53893, 53901, 53905,
+ 53910, 53915, 53921, 53927, 53930, 53933, 53936, 53939, 53943, 53948,
+ 53953, 53958, 53963, 53968, 53972, 53976, 53980, 53984, 53988, 53992,
+ 53996, 54002, 54006, 54012, 54017, 54024, 54032, 54039, 54047, 54054,
+ 54062, 54071, 54078, 54088, 54099, 54105, 54114, 54120, 54129, 54138,
+ 54144, 54150, 54154, 54158, 54167, 54176, 54183, 54190, 54199, 0, 0, 0,
+ 54208, 54213, 54217, 54221, 54226, 54231, 54236, 54244, 54252, 54255, 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, 27799, 27805,
- 27811, 27815, 27819, 27823, 27827, 27833, 27837, 27843, 27847, 27853,
- 27859, 27867, 27873, 27881, 27885, 27889, 27893, 27899, 27902, 27907,
- 27911, 27917, 27921, 27925, 27931, 27935, 27941, 27945, 27951, 27959,
- 27967, 27975, 27981, 27985, 27991, 27995, 28001, 28005, 28008, 28014,
- 28018, 28024, 28027, 28030, 28033, 28037, 28041, 28047, 28053, 28057,
- 28060, 28064, 28069, 28074, 28081, 28086, 28093, 28100, 28109, 28116,
- 28125, 28130, 28137, 28144, 28153, 28158, 28165, 28170, 28176, 28182,
- 28188, 28194, 28200, 28206, 0, 0, 0, 0, 28212, 28216, 28219, 28222,
- 28225, 28228, 28231, 28234, 28237, 28240, 28243, 28246, 28249, 28252,
- 28257, 28262, 28267, 28270, 28275, 28280, 28285, 28290, 28297, 28302,
- 28307, 28312, 28317, 28324, 28330, 28336, 28342, 28348, 28354, 28363,
- 28372, 28378, 28384, 28393, 28402, 28411, 28420, 28429, 28438, 28447,
- 28456, 0, 0, 0, 28465, 28469, 28473, 28477, 28480, 28483, 28486, 28490,
- 28493, 28496, 28500, 28503, 28507, 28511, 28515, 28519, 28523, 28527,
- 28531, 28535, 28539, 28543, 28546, 28550, 28554, 28558, 28561, 28564,
- 28567, 28571, 28575, 28579, 28583, 28586, 28592, 28598, 28604, 28609,
- 28614, 28619, 28624, 28629, 28634, 0, 0, 0, 28638, 28642, 28646, 28650,
- 28653, 28656, 28659, 28662, 28665, 28668, 28671, 28674, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54259, 54264, 54269, 54274, 54279,
+ 54284, 54289, 54294, 54299, 54304, 54309, 54315, 54319, 54324, 54329,
+ 54334, 54339, 54344, 54349, 54354, 54359, 54364, 54369, 54374, 54379,
+ 54384, 54389, 54394, 54399, 54404, 54409, 54414, 54419, 54424, 54429,
+ 54435, 54440, 54446, 54455, 54460, 54468, 54475, 54484, 54489, 54494,
+ 54499, 54505, 0, 54512, 54517, 54522, 54527, 54532, 54537, 54542, 54547,
+ 54552, 54557, 54562, 54568, 54572, 54577, 54582, 54587, 54592, 54597,
+ 54602, 54607, 54612, 54617, 54622, 54627, 54632, 54637, 54642, 54647,
+ 54652, 54657, 54662, 54667, 54672, 54677, 54682, 54688, 54693, 54699,
+ 54708, 54713, 54721, 54728, 54737, 54742, 54747, 54752, 54758, 0, 54765,
+ 54773, 54781, 54791, 54798, 54806, 54812, 54821, 54829, 54837, 54845,
+ 54853, 54861, 54869, 54874, 54881, 54887, 54894, 54902, 54909, 54916,
+ 54924, 54930, 54936, 54943, 54950, 54960, 54970, 54977, 54984, 54989,
+ 54999, 55009, 55014, 55019, 55024, 55029, 55034, 55039, 55044, 55049,
+ 55054, 55059, 55064, 55069, 55074, 55079, 55084, 55089, 55094, 55099,
+ 55104, 55109, 55114, 55119, 55124, 55129, 55134, 55139, 55144, 55149,
+ 55154, 55159, 55163, 55167, 55172, 55177, 55182, 55187, 55192, 55197,
+ 55202, 55207, 55212, 55217, 55222, 55227, 55232, 55237, 55242, 55247,
+ 55252, 55257, 55264, 55271, 55278, 55285, 55292, 55299, 55306, 55313,
+ 55320, 55327, 55334, 55341, 55348, 55355, 55360, 55365, 55372, 55379,
+ 55386, 55393, 55400, 55407, 55414, 55421, 55428, 55435, 55442, 55449,
+ 55455, 55461, 55467, 55473, 55480, 55487, 55494, 55501, 55508, 55515,
+ 55522, 55529, 55536, 55543, 55551, 55559, 55567, 55575, 55583, 55591,
+ 55599, 55607, 55611, 55617, 55623, 55627, 55633, 55639, 55645, 55652,
+ 55659, 55666, 55673, 55678, 55684, 0, 0, 0, 0, 0, 0, 0, 55690, 55698,
+ 55707, 55716, 55724, 55730, 55735, 55740, 55745, 55750, 55755, 55760,
+ 55765, 55770, 55775, 55780, 55785, 55790, 55795, 55800, 55805, 55810,
+ 55815, 55820, 55825, 55830, 55835, 55840, 55845, 55850, 55855, 55860,
+ 55865, 55870, 55875, 55880, 55885, 55890, 55895, 55900, 55905, 55910,
+ 55915, 55920, 55925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55930, 55934, 55939,
+ 55944, 55949, 55954, 55963, 55968, 55973, 55978, 55983, 55988, 55993,
+ 55998, 56003, 56010, 56015, 56020, 56029, 56036, 56041, 56046, 56051,
+ 56058, 56063, 56070, 56075, 56080, 56087, 56094, 56099, 56104, 56109,
+ 56116, 56123, 56128, 56133, 56138, 56143, 56148, 56155, 56162, 56167,
+ 56172, 56177, 56182, 56187, 56192, 56197, 56202, 56207, 56212, 56217,
+ 56224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56229, 56236, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 56241, 56247, 56251, 56255, 56259, 56263, 56267, 56271,
+ 56275, 56279, 56283, 56287, 56293, 56297, 56301, 56305, 56309, 56313,
+ 56317, 56321, 56325, 56329, 56333, 56337, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 56341, 56345, 56349, 56353, 56357, 56361, 56365, 0, 56369, 56373, 56377,
+ 56381, 56385, 56389, 56393, 0, 56397, 56401, 56405, 56409, 56413, 56417,
+ 56421, 0, 56425, 56429, 56433, 56437, 56441, 56445, 56449, 0, 56453,
+ 56457, 56461, 56465, 56469, 56473, 56477, 0, 56481, 56485, 56489, 56493,
+ 56497, 56501, 56505, 0, 56509, 56513, 56517, 56521, 56525, 56529, 56533,
+ 0, 56537, 56541, 56545, 56549, 56553, 56557, 56561, 0, 56565, 56570,
+ 56575, 56580, 56585, 56590, 56595, 56599, 56604, 56609, 56614, 56618,
+ 56623, 56628, 56633, 56638, 56642, 56647, 56652, 56657, 56662, 56667,
+ 56672, 56676, 56681, 56686, 56693, 56698, 56703, 56709, 56716, 56723,
+ 56732, 56739, 56748, 56752, 56756, 56762, 56768, 56774, 56782, 56788,
+ 56792, 56796, 56800, 56806, 56812, 56816, 56818, 56822, 56828, 56830,
+ 56834, 56838, 56842, 56848, 56853, 56857, 56861, 56866, 56872, 56877,
+ 56882, 56887, 56892, 56899, 56906, 56911, 56916, 56921, 56926, 56931,
+ 56936, 56940, 56944, 56951, 56958, 56964, 56968, 56973, 56976, 56980, 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, 0, 28677, 28680, 28684,
- 28688, 28692, 28696, 28700, 28704, 28708, 28712, 28716, 28720, 28724,
- 28728, 28732, 28735, 28739, 28743, 28747, 28751, 28755, 28759, 28762,
- 28766, 28770, 28774, 28778, 28781, 28784, 28788, 28791, 28795, 28799,
- 28803, 28807, 28811, 28814, 28819, 28824, 28829, 28833, 28837, 28842,
- 28846, 28851, 28855, 28861, 28866, 28871, 28876, 28882, 28887, 28893,
- 28899, 28905, 28909, 0, 0, 0, 28913, 28918, 28927, 28932, 28939, 28944,
- 28948, 28951, 28954, 28957, 28960, 28963, 28966, 28969, 28972, 0, 0, 0,
- 28975, 28979, 28983, 28987, 28994, 29000, 29006, 29012, 29018, 29024,
- 29030, 29036, 29042, 29048, 29055, 29062, 29069, 29076, 29083, 29090,
- 29097, 29104, 29111, 29118, 29125, 29132, 29139, 29146, 29153, 29160,
- 29167, 29174, 29181, 29188, 29195, 29202, 29209, 29216, 29223, 29230,
- 29237, 29244, 29251, 29258, 29266, 29274, 29282, 29288, 29294, 29300,
- 29308, 29317, 29322, 29328, 29334, 29342, 29348, 29354, 29360, 29365,
- 29372, 29377, 29383, 29389, 29397, 29402, 29408, 29413, 29420, 29426,
- 29434, 29442, 29448, 29454, 29461, 29468, 29474, 29480, 29486, 29492,
- 29497, 29503, 29511, 29518, 29523, 29529, 29535, 29541, 29549, 29553,
- 29559, 29565, 29571, 29577, 29583, 29589, 29593, 29598, 29603, 29610,
- 29615, 29619, 29624, 29628, 29632, 29636, 29641, 29646, 29650, 29654,
- 29658, 29663, 29667, 29672, 29677, 29681, 29686, 29690, 29695, 29699,
- 29704, 29709, 29715, 29720, 29725, 29729, 29734, 29740, 29747, 29751,
- 29756, 29761, 29765, 29770, 29774, 29780, 29787, 29794, 29799, 29804,
- 29808, 29814, 29819, 29823, 29828, 29833, 29839, 29844, 29850, 29855,
- 29861, 29867, 29873, 29879, 29886, 29893, 29900, 29907, 29914, 29919,
- 29927, 29936, 29945, 29954, 29963, 29972, 29981, 29993, 30002, 30011,
- 30020, 30025, 30030, 30036, 30044, 30052, 30059, 30066, 30073, 30080,
- 30088, 30097, 30106, 30115, 30124, 30133, 30142, 30151, 30160, 30169,
- 30178, 30187, 30196, 30205, 30214, 30222, 30231, 30242, 30250, 30260,
- 30271, 30280, 30289, 30299, 30308, 30316, 30325, 30331, 30336, 30344,
- 30349, 30356, 30361, 30370, 30375, 30380, 30387, 30392, 30397, 30405,
- 30413, 30422, 30431, 30436, 30443, 30453, 30461, 30470, 30475, 30481,
- 30486, 30493, 30498, 30507, 30512, 30517, 30522, 30529, 30534, 30539,
- 30548, 30556, 30561, 30566, 30573, 30580, 30584, 30588, 30591, 30594,
- 30597, 30600, 30603, 30606, 30613, 30616, 30619, 30624, 30628, 30632,
- 30636, 30640, 30644, 30654, 30660, 30666, 30672, 30680, 30688, 30694,
- 30699, 30705, 30711, 30716, 30722, 30728, 30733, 30739, 30745, 30753,
- 30758, 30764, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 30770, 30775, 30784, 30792, 30800, 30807, 30814, 30821, 30828,
- 30836, 30844, 30854, 30864, 30872, 30880, 30888, 30896, 30905, 30914,
- 30922, 30930, 30939, 30948, 30958, 30968, 30977, 30986, 30994, 31002,
- 31010, 31018, 31028, 31038, 31046, 31054, 31062, 31070, 31078, 31086,
- 31094, 31102, 31109, 31116, 31124, 31132, 31141, 31150, 31159, 31168,
- 31178, 31188, 31195, 31202, 31210, 31218, 31227, 31236, 31244, 31252,
- 31264, 31276, 31285, 31294, 31303, 31312, 31319, 31326, 31334, 31342,
- 31350, 31358, 31366, 31374, 31382, 31390, 31399, 31408, 31417, 31426,
- 31435, 31444, 31453, 31462, 31472, 31482, 31491, 31500, 31507, 31514,
- 31522, 31530, 31538, 31546, 31554, 31562, 31574, 31586, 31595, 31604,
- 31612, 31620, 31628, 31636, 31647, 31658, 31669, 31680, 31692, 31704,
- 31712, 31720, 31728, 31736, 31745, 31754, 31763, 31772, 31780, 31788,
- 31796, 31804, 31812, 31820, 31829, 31838, 31847, 31856, 31863, 31870,
- 31878, 31886, 31894, 31902, 31909, 31916, 31923, 31930, 31938, 31946,
- 31954, 31962, 31970, 31978, 31985, 31992, 32000, 32008, 32016, 32024,
- 32032, 32040, 32049, 32058, 32067, 32074, 32083, 32092, 32101, 32110,
- 32120, 32129, 32135, 32140, 32147, 32154, 32162, 32170, 32179, 32188,
- 32198, 32208, 32219, 32230, 32239, 32248, 32258, 32268, 32277, 32286,
- 32296, 32306, 32317, 32328, 32337, 32346, 32356, 32366, 32373, 32380,
- 32388, 32396, 32402, 32408, 32417, 32426, 32436, 32446, 32457, 32468,
- 32477, 32486, 32496, 32506, 32515, 32524, 32532, 32540, 32547, 32554,
- 32562, 32570, 32579, 32588, 32598, 32608, 32619, 32630, 32639, 32648,
- 32658, 32668, 32677, 32686, 32696, 32706, 32717, 32728, 32737, 32746,
- 32756, 32766, 32773, 32780, 32788, 32796, 32805, 32814, 32824, 32834,
- 32845, 32856, 32865, 32874, 32884, 32894, 32902, 32910, 32918, 32926,
- 32935, 32944, 32951, 32958, 32965, 32972, 32978, 32984, 32992, 33000,
- 33008, 33016, 33026, 33036, 33046, 33056, 33066, 33076, 33084, 33092,
- 33102, 33112, 33122, 33132, 33142, 33152, 33160, 33168, 33178, 33188,
- 33198, 0, 0, 33208, 33216, 33224, 33234, 33244, 33254, 0, 0, 33264,
- 33272, 33280, 33290, 33300, 33310, 33320, 33330, 33340, 33348, 33356,
- 33366, 33376, 33386, 33396, 33406, 33416, 33424, 33432, 33442, 33452,
- 33462, 33472, 33482, 33492, 33500, 33508, 33518, 33528, 33538, 33548,
- 33558, 33568, 33576, 33584, 33594, 33604, 33614, 0, 0, 33624, 33632,
- 33640, 33650, 33660, 33670, 0, 0, 33680, 33688, 33696, 33706, 33716,
- 33726, 33736, 33746, 0, 33756, 0, 33764, 0, 33774, 0, 33784, 33794,
- 33802, 33810, 33820, 33830, 33840, 33850, 33860, 33870, 33878, 33886,
- 33896, 33906, 33916, 33926, 33936, 33946, 33954, 33962, 33970, 33978,
- 33986, 33994, 34002, 34010, 34018, 34026, 34034, 34042, 34050, 0, 0,
- 34058, 34068, 34078, 34091, 34104, 34117, 34130, 34143, 34156, 34166,
- 34176, 34189, 34202, 34215, 34228, 34241, 34254, 34264, 34274, 34287,
- 34300, 34313, 34326, 34339, 34352, 34362, 34372, 34385, 34398, 34411,
- 34424, 34437, 34450, 34460, 34470, 34483, 34496, 34509, 34522, 34535,
- 34548, 34558, 34568, 34581, 34594, 34607, 34620, 34633, 34646, 34654,
- 34662, 34673, 34681, 0, 34692, 34700, 34711, 34719, 34727, 34735, 34743,
- 34751, 34754, 34757, 34760, 34763, 34769, 34780, 34788, 0, 34799, 34807,
- 34818, 34826, 34834, 34842, 34850, 34858, 34863, 34868, 34873, 34881,
- 34889, 34900, 0, 0, 34911, 34919, 34930, 34938, 34946, 34954, 0, 34962,
- 34967, 34972, 34977, 34985, 34993, 35004, 35015, 35023, 35031, 35039,
- 35050, 35058, 35066, 35074, 35082, 35090, 35096, 35102, 0, 0, 35105,
- 35116, 35124, 0, 35135, 35143, 35154, 35162, 35170, 35178, 35186, 35194,
- 35197, 0, 35200, 35204, 35208, 35212, 35216, 35220, 35224, 35228, 35232,
- 35236, 35240, 35244, 35250, 35256, 35262, 35265, 35268, 35270, 35274,
- 35278, 35282, 35286, 35288, 35292, 35296, 35302, 35308, 35315, 35322,
- 35327, 35332, 35338, 35344, 35346, 35349, 35351, 35355, 35359, 35363,
- 35366, 35370, 35374, 35378, 35382, 35386, 35392, 35396, 35400, 35406,
- 35411, 35418, 35420, 35423, 35427, 35430, 35434, 35439, 35441, 35450,
- 35459, 35462, 35466, 35468, 35470, 35472, 35475, 35481, 35483, 35487,
- 35491, 35498, 35505, 35509, 35514, 35519, 35524, 35528, 35532, 35536,
- 35539, 35542, 35546, 35553, 35558, 35562, 35566, 35571, 35575, 35579,
- 35584, 35589, 35593, 35597, 35601, 35603, 35608, 35613, 35617, 35621,
- 35625, 35629, 0, 0, 0, 0, 0, 35633, 35639, 35645, 35651, 35657, 35662,
- 35667, 35671, 0, 0, 35677, 35680, 35683, 35686, 35689, 35692, 35695,
- 35699, 35703, 35708, 35713, 35718, 35724, 35728, 35731, 35734, 35737,
- 35740, 35743, 35746, 35749, 35752, 35755, 35759, 35763, 35768, 35773, 0,
- 35778, 35784, 35790, 35796, 35803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 35810, 35813, 35816, 35819, 35824, 35827, 35830, 35833, 35836, 35839,
- 35842, 35846, 35849, 35852, 35855, 35858, 35861, 35866, 35869, 35872,
- 35875, 35878, 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, 35881, 35886, 35891, 35898, 35906, 35911, 35916, 35920,
- 35924, 35929, 35936, 35943, 35947, 35952, 35957, 35962, 35967, 35974,
- 35979, 35984, 35989, 35998, 36005, 36011, 36015, 36020, 36026, 36031,
- 36038, 36046, 36054, 36058, 36062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 36066, 36070, 36077, 36081, 36085, 36090, 36094, 36098, 36102,
- 36104, 36108, 36111, 36114, 36118, 36121, 36125, 36133, 36136, 36140,
- 36143, 36146, 36152, 36155, 36158, 36164, 36168, 36172, 36176, 36179,
- 36183, 36186, 36190, 36192, 36195, 36198, 36202, 36204, 36208, 36211,
- 36214, 36219, 36224, 36230, 36233, 36236, 36240, 36245, 36248, 36251,
- 36254, 36258, 36262, 36265, 36268, 36270, 36273, 36276, 36279, 36283,
- 36288, 36291, 36295, 36299, 36303, 36307, 36312, 36316, 36320, 36324,
- 36329, 36334, 36339, 36343, 36347, 36352, 36356, 36359, 36362, 36364,
- 36368, 0, 0, 0, 36374, 36381, 36388, 36395, 36402, 36409, 36417, 36424,
- 36432, 36439, 36446, 36454, 36462, 36467, 36471, 36475, 36479, 36483,
- 36487, 36491, 36495, 36499, 36503, 36508, 36513, 36518, 36523, 36529,
- 36536, 36542, 36547, 36552, 36557, 36562, 36567, 36572, 36577, 36582,
- 36587, 36593, 36599, 36605, 36611, 36618, 36626, 36633, 36643, 36650,
- 36657, 36664, 36670, 36678, 36686, 36693, 0, 0, 0, 0, 0, 0, 0, 36701,
- 36703, 36706, 36708, 36711, 36714, 36717, 36722, 36727, 36732, 36737,
- 36741, 36745, 36749, 36753, 36758, 36764, 36769, 36775, 36780, 36785,
- 36790, 36796, 36801, 36807, 36813, 36817, 36821, 36826, 36831, 36836,
- 36841, 36846, 36854, 36862, 36870, 36878, 36885, 36893, 36900, 36907,
- 36915, 36925, 36932, 36939, 36946, 36953, 36961, 36969, 36976, 36983,
- 36991, 36999, 37004, 37012, 37017, 37022, 37028, 37033, 37039, 37046,
- 37053, 37058, 37064, 37069, 37072, 37076, 37079, 37083, 37087, 37091,
- 37097, 37103, 37109, 37115, 37119, 37123, 37127, 37131, 37137, 37143,
- 37147, 37152, 37156, 37161, 37165, 37169, 37172, 37176, 37179, 37183,
- 37190, 37198, 37209, 37220, 37225, 37234, 37241, 37249, 37257, 37261,
- 37267, 37275, 37279, 37284, 37289, 37295, 37301, 37307, 37314, 37318,
- 37322, 37327, 37330, 37332, 37336, 37340, 37347, 37351, 37353, 37355,
- 37359, 37366, 37371, 37377, 37386, 37393, 37398, 37402, 37406, 37410,
- 37413, 37416, 37419, 37423, 37427, 37431, 37435, 37439, 37442, 37446,
- 37450, 37453, 37455, 37458, 37460, 37464, 37468, 37470, 37475, 37478,
- 37482, 37486, 37490, 37492, 37494, 37496, 37499, 37503, 37507, 37511,
- 37515, 37519, 37525, 37531, 37533, 37535, 37537, 37539, 37542, 37544,
- 37548, 37550, 37554, 37556, 37561, 37565, 37569, 37571, 37574, 37578,
- 37583, 37587, 37596, 37606, 37610, 37615, 37621, 37624, 37628, 37631,
- 37636, 37640, 37646, 37650, 37661, 37669, 37673, 37677, 37683, 37687,
- 37690, 37692, 37695, 37699, 37703, 37709, 37713, 37717, 37720, 37723,
- 37727, 37732, 37737, 37742, 37747, 37752, 37759, 37766, 37770, 37774,
- 37776, 37780, 37783, 37786, 37794, 37802, 37808, 37814, 37823, 37832,
- 37837, 37842, 37850, 37858, 37860, 37862, 37867, 37872, 37878, 37884,
- 37889, 37894, 37898, 37902, 37908, 37914, 37920, 37926, 37936, 37946,
- 37953, 37960, 37962, 37966, 37970, 37975, 37980, 37987, 37994, 37997,
- 38000, 38003, 38006, 38009, 38014, 38018, 38023, 38028, 38031, 38034,
- 38038, 38042, 38046, 38051, 38054, 38057, 38060, 38063, 38065, 38067,
- 38069, 38071, 38079, 38087, 38092, 38095, 38100, 38110, 38116, 38122,
- 38128, 38136, 38144, 38155, 38159, 38163, 38165, 38171, 38173, 38175,
- 38177, 38179, 38185, 38188, 38194, 38200, 38204, 38208, 38212, 38215,
- 38219, 38223, 38225, 38234, 38243, 38248, 38253, 38258, 38264, 38270,
- 38273, 38276, 38279, 38282, 38284, 38289, 38294, 38299, 38305, 38311,
- 38318, 38325, 38330, 38335, 38340, 38345, 38353, 38361, 38369, 38377,
- 38385, 38393, 38401, 38409, 38417, 38425, 38432, 38443, 38452, 38466,
- 38469, 38474, 38480, 38486, 38493, 38507, 38522, 38528, 38534, 38541,
- 38547, 38555, 38561, 38574, 38588, 38593, 38599, 38606, 38609, 38612,
- 38614, 38617, 38620, 38622, 38624, 38628, 38631, 38634, 38637, 38640,
- 38645, 38650, 38655, 38660, 38663, 38666, 38668, 38670, 38672, 38676,
- 38680, 38684, 38690, 38693, 38695, 38697, 38702, 38707, 38712, 38717,
- 38722, 38727, 38729, 38731, 38740, 38744, 38751, 38760, 38762, 38767,
- 38772, 38779, 38783, 38785, 38789, 38791, 38795, 38799, 38803, 38805,
- 38807, 38809, 38814, 38821, 38828, 38835, 38842, 38849, 38856, 38863,
- 38870, 38876, 38882, 38889, 38896, 38903, 38910, 38916, 38922, 38929,
- 38936, 38943, 38951, 38958, 38966, 38973, 38981, 38988, 38996, 39004,
- 39011, 39019, 39026, 39034, 39041, 39049, 39056, 39063, 39070, 39077,
- 39084, 39092, 39099, 39106, 39113, 39120, 39126, 39132, 39138, 39144,
- 39152, 39160, 39166, 39172, 39178, 39184, 39189, 39195, 39202, 39210,
- 39217, 39224, 39231, 39236, 39241, 39246, 39253, 39260, 39267, 39274,
- 39279, 39283, 39292, 39298, 39301, 39309, 39312, 39317, 39322, 39325,
- 39328, 39336, 39339, 39344, 39347, 39354, 39359, 39367, 39370, 39373,
- 39376, 39381, 39386, 39389, 39392, 39399, 39402, 39407, 39414, 39418,
- 39422, 39427, 39432, 39438, 39443, 39448, 39454, 39459, 39464, 39472,
- 39478, 39485, 39493, 39499, 39506, 39514, 39523, 39530, 39536, 39544,
- 39553, 39560, 39564, 39569, 39581, 39593, 39597, 39601, 39605, 39609,
- 39619, 39623, 39628, 39633, 39638, 39643, 39648, 39653, 39663, 39673,
- 39681, 39691, 39701, 39709, 39719, 39729, 39737, 39747, 39757, 39765,
- 39773, 39783, 39793, 39796, 39799, 39802, 39807, 39811, 39817, 39824,
- 39831, 39839, 39846, 39850, 39854, 39858, 39862, 39864, 39868, 39872,
- 39877, 39882, 39889, 39896, 39899, 39906, 39908, 39910, 39914, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39918,
- 39922, 39929, 39936, 39943, 39950, 39954, 39958, 39962, 39966, 39971,
- 39977, 39982, 39987, 39993, 39999, 40005, 40013, 40020, 40027, 40034,
- 40041, 40047, 40053, 40062, 40066, 40073, 40077, 40081, 40087, 40093,
- 40099, 40105, 40109, 40113, 40116, 40120, 40124, 40130, 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, 40136, 40139,
- 40143, 40147, 40153, 40159, 40165, 40173, 40180, 40184, 40192, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40197, 40200,
- 40203, 40206, 40209, 40212, 40215, 40218, 40221, 40224, 40228, 40232,
- 40236, 40240, 40244, 40248, 40252, 40256, 40260, 40264, 40268, 40271,
- 40274, 40277, 40280, 40283, 40286, 40289, 40292, 40295, 40299, 40303,
- 40307, 40311, 40315, 40319, 40323, 40327, 40331, 40335, 40339, 40345,
- 40351, 40357, 40364, 40371, 40378, 40385, 40392, 40399, 40406, 40413,
- 40420, 40427, 40434, 40441, 40448, 40455, 40462, 40469, 40476, 40481,
- 40487, 40493, 40499, 40504, 40510, 40515, 40520, 40525, 40531, 40537,
- 40542, 40547, 40552, 40557, 40563, 40569, 40574, 40579, 40585, 40590,
- 40595, 40601, 40607, 40613, 40619, 40624, 40630, 40636, 40642, 40647,
- 40653, 40658, 40663, 40668, 40674, 40680, 40685, 40690, 40695, 40700,
- 40706, 40712, 40717, 40722, 40728, 40733, 40738, 40744, 40750, 40756,
- 40762, 40767, 40773, 40779, 40785, 40790, 40796, 40801, 40806, 40811,
- 40817, 40823, 40828, 40833, 40838, 40843, 40849, 40855, 40860, 40865,
- 40871, 40876, 40881, 40887, 40893, 40899, 40905, 40909, 40915, 40921,
- 40927, 40933, 40939, 40945, 40951, 40957, 40963, 40969, 40973, 40977,
- 40981, 40985, 40989, 40993, 40997, 41001, 41005, 41010, 41016, 41021,
- 41026, 41031, 41036, 41045, 41054, 41063, 41072, 41081, 41090, 41099,
- 41108, 41115, 41123, 41131, 41138, 41145, 41153, 41161, 41168, 41175,
- 41183, 41191, 41198, 41205, 41213, 41221, 41228, 41235, 41243, 41252,
- 41261, 41269, 41278, 41287, 41294, 41301, 41309, 41318, 41327, 41335,
- 41344, 41353, 41360, 41367, 41376, 41385, 41393, 41401, 41410, 41419,
- 41426, 41433, 41442, 41451, 41459, 41467, 41476, 41485, 41492, 41499,
- 41508, 41517, 41525, 41534, 41543, 41551, 41561, 41571, 41581, 41591,
- 41600, 41609, 41618, 41627, 41634, 41642, 41650, 41658, 41666, 41671,
- 41676, 41685, 41693, 41700, 41709, 41717, 41724, 41733, 41741, 41748,
- 41757, 41765, 41772, 41781, 41789, 41796, 41805, 41813, 41820, 41829,
- 41837, 41844, 41853, 41861, 41868, 41877, 41885, 41892, 41901, 41910,
- 41919, 41928, 41940, 41952, 41959, 41964, 41969, 41974, 41979, 41984,
- 41989, 41994, 41999, 42007, 42015, 42023, 42031, 42036, 42042, 42048,
- 42054, 42058, 42065, 42071, 42078, 42082, 42089, 42095, 42102, 42106,
- 42112, 42118, 42124, 42128, 42131, 42135, 42139, 42146, 42152, 42157,
- 42162, 42168, 42180, 42189, 42202, 42215, 42221, 42230, 42242, 42245,
- 42248, 42255, 42263, 42268, 42273, 42281, 42291, 42301, 42309, 42313,
- 42317, 42320, 42323, 42327, 42331, 42334, 42337, 42342, 42347, 42353,
- 42359, 42364, 42369, 42375, 42381, 42386, 42391, 42396, 42401, 42407,
- 42413, 42418, 42423, 42429, 42435, 42440, 42445, 42448, 42451, 42460,
- 42462, 42464, 42467, 42471, 42477, 42479, 42482, 42489, 42496, 42503,
- 42511, 42521, 42535, 42540, 42545, 42549, 42554, 42562, 42569, 42578,
- 42587, 42595, 42603, 42608, 42612, 42617, 42622, 42628, 42634, 42637,
- 42643, 42649, 42659, 42668, 42676, 42684, 42693, 42702, 42706, 42714,
- 42721, 42728, 42736, 42745, 42753, 42761, 42770, 42775, 42780, 42784,
- 42789, 42794, 42800, 42806, 42810, 42816, 42818, 42820, 42822, 42824,
- 42827, 42830, 42832, 42834, 42836, 42840, 42844, 42846, 42848, 42851,
- 42854, 42858, 42864, 42870, 42872, 42879, 42883, 42888, 42893, 42895,
- 42904, 42910, 42916, 42922, 42928, 42934, 42940, 42945, 42948, 42951,
- 42954, 42956, 42958, 42962, 42966, 42971, 42976, 42981, 42984, 42988,
- 42993, 42996, 43000, 43005, 43010, 43015, 43020, 43025, 43030, 43035,
- 43040, 43045, 43050, 43055, 43060, 43066, 43072, 43078, 43080, 43083,
- 43085, 43088, 43090, 43092, 43094, 43096, 43098, 43100, 43102, 43104,
- 43106, 43108, 43110, 43112, 43114, 43116, 43118, 43120, 43122, 43127,
- 43132, 43137, 43142, 43147, 43152, 43157, 43162, 43167, 43172, 43177,
- 43182, 43187, 43192, 43197, 43202, 43207, 43212, 43217, 43222, 43226,
- 43230, 43234, 43240, 43246, 43251, 43256, 43261, 43266, 43271, 43276,
- 43284, 43292, 43300, 43308, 43316, 43324, 43332, 43340, 43346, 43351,
- 43356, 43361, 43364, 43368, 43372, 43376, 43380, 43384, 43388, 43395,
- 43402, 43410, 43418, 43423, 43428, 43435, 43442, 43449, 43456, 43459,
- 43462, 43467, 43469, 43473, 43478, 43480, 43482, 43484, 43486, 43491,
- 43494, 43496, 0, 0, 43501, 43504, 43508, 43513, 43518, 43526, 43532,
- 43537, 43548, 43554, 43560, 43565, 43570, 43576, 43579, 43582, 43587,
- 43589, 43593, 43595, 43597, 43599, 43601, 43603, 43605, 43610, 43612,
- 43614, 43616, 0, 0, 0, 43618, 43623, 43628, 43633, 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, 43638, 43644, 43647, 43652, 0, 43655, 43660, 43664,
- 43666, 0, 0, 43668, 43672, 43676, 43680, 43682, 43687, 43690, 43693,
- 43696, 43700, 43704, 43709, 43713, 43718, 43723, 43727, 43733, 43740,
- 43743, 43749, 43754, 43758, 43763, 43769, 43775, 43782, 43788, 43795, 0,
- 43802, 43809, 43813, 43820, 43826, 43831, 43837, 43841, 43846, 43849,
- 43855, 43861, 43868, 43876, 43883, 43892, 43902, 43909, 43915, 43919,
- 43927, 43932, 43941, 43944, 43947, 43956, 43967, 43974, 43976, 43982,
- 43987, 43989, 43992, 43996, 44004, 0, 44013, 0, 44018, 44025, 44033,
- 44040, 0, 0, 0, 44048, 0, 44056, 44059, 44063, 44066, 44077, 44087,
- 44097, 0, 0, 44106, 44115, 44121, 44129, 44133, 44141, 44145, 44153,
- 44160, 44167, 44176, 44185, 44195, 44205, 44215, 44225, 44234, 44243,
- 44253, 44263, 44272, 44281, 44288, 44295, 44302, 44309, 44316, 44323,
- 44330, 44337, 44344, 44352, 44358, 44364, 44370, 44376, 44382, 44388,
- 44394, 44400, 44406, 44413, 44421, 44429, 44437, 44445, 44453, 44461,
- 44469, 44477, 44485, 44494, 0, 0, 0, 44499, 44505, 44508, 44514, 44520,
- 44525, 44529, 44534, 44540, 44547, 44550, 44557, 44564, 44568, 44577,
- 44586, 44591, 44597, 44602, 44607, 44614, 44621, 44628, 44636, 0, 44644,
- 44653, 44658, 44662, 44669, 44673, 44680, 44688, 44693, 44701, 44705,
- 44710, 44714, 44719, 0, 44723, 44728, 44737, 44739, 44743, 44747, 44754,
- 44761, 44766, 44774, 44780, 0, 44786, 0, 0, 0, 44789, 44797, 44801,
- 44808, 44815, 44823, 44828, 44833, 44839, 44844, 44849, 44855, 44860,
- 44863, 44867, 44871, 44878, 44887, 44892, 44901, 44910, 44916, 44922,
- 44927, 44932, 44937, 44942, 44948, 44954, 44962, 44970, 44976, 44982,
- 44987, 44992, 44999, 45006, 45012, 45015, 45018, 45022, 45026, 45030,
- 45035, 45041, 45047, 45054, 45061, 45066, 45070, 45074, 45078, 45082,
- 45086, 45090, 45094, 45098, 45102, 45106, 45110, 45114, 45118, 45122,
- 45126, 45130, 45134, 45138, 45142, 45146, 45150, 45154, 45158, 45162,
- 45166, 45170, 45174, 45178, 45182, 45186, 45190, 45194, 45198, 45202,
- 45206, 45210, 45214, 45218, 45222, 45226, 45230, 45234, 45238, 45242,
- 45246, 45250, 45254, 45258, 45262, 45266, 45270, 45274, 45278, 45282,
- 45286, 45290, 45294, 45298, 45302, 45306, 45310, 45314, 45318, 45322,
- 45326, 45330, 45334, 45338, 45342, 45346, 45350, 45354, 45358, 45362,
- 45366, 45370, 45374, 45378, 45382, 45386, 45390, 45394, 45398, 45402,
- 45406, 45410, 45414, 45418, 45422, 45426, 45430, 45434, 45438, 45442,
- 45446, 45450, 45454, 45458, 45462, 45466, 45470, 45474, 45478, 45482,
- 45486, 45490, 45494, 45498, 45502, 45506, 45510, 45514, 45518, 45522,
- 45526, 45530, 45534, 45538, 45542, 45546, 45550, 45554, 45558, 45562,
- 45566, 45570, 45574, 45578, 45582, 45586, 45590, 45594, 45598, 45602,
- 45606, 45610, 45614, 45618, 45622, 45626, 45630, 45634, 45638, 45642,
- 45646, 45650, 45654, 45658, 45662, 45666, 45670, 45674, 45678, 45682,
- 45686, 45690, 45694, 45698, 45702, 45706, 45710, 45714, 45718, 45722,
- 45726, 45730, 45734, 45738, 45742, 45746, 45750, 45754, 45758, 45762,
- 45766, 45770, 45774, 45778, 45782, 45786, 45790, 45794, 45798, 45802,
- 45806, 45810, 45814, 45818, 45822, 45826, 45830, 45834, 45838, 45842,
- 45846, 45850, 45854, 45858, 45862, 45866, 45870, 45874, 45878, 45882,
- 45886, 45890, 45894, 45898, 45902, 45906, 45910, 45914, 45918, 45922,
- 45926, 45930, 45934, 45938, 45942, 45946, 45950, 45954, 45958, 45962,
- 45966, 45970, 45974, 45978, 45982, 45986, 45990, 45994, 45998, 46002,
- 46006, 46010, 46014, 46018, 46022, 46026, 46030, 46034, 46038, 46042,
- 46046, 46050, 46054, 46058, 46062, 46066, 46070, 46074, 46078, 46082,
- 46086, 46090, 46097, 46105, 46111, 46117, 46124, 46131, 46137, 46143,
- 46149, 46155, 46160, 46165, 46170, 46175, 46181, 46187, 46195, 46202,
- 46207, 46212, 46220, 46229, 46236, 46246, 46257, 46260, 46263, 46267,
- 46271, 46277, 46283, 46293, 46303, 46313, 46323, 46330, 46337, 46344,
- 46351, 46362, 46373, 46384, 46395, 46405, 46415, 46427, 46439, 46450,
- 46461, 46473, 46485, 46494, 46504, 46514, 46525, 46536, 46543, 46550,
- 46557, 46564, 46574, 46584, 46591, 46598, 46605, 46612, 46619, 46626,
- 46633, 46638, 46643, 46649, 46657, 46667, 46675, 46683, 46691, 46699,
- 46707, 46715, 46723, 46731, 46739, 46747, 46756, 46765, 46773, 46781,
- 46790, 46799, 46808, 46817, 46827, 46837, 46846, 46855, 46865, 46875,
- 46889, 46906, 46920, 46937, 46951, 46965, 46979, 46993, 47003, 47014,
- 47024, 47035, 47052, 47069, 47077, 47083, 47090, 47097, 47104, 47111,
- 47116, 47122, 47127, 47132, 47138, 47143, 47148, 47153, 47158, 47163,
- 47170, 47175, 47182, 47187, 47192, 47196, 47200, 47207, 47214, 47221,
- 47228, 47235, 47242, 47255, 47268, 47281, 47294, 47302, 47310, 47316,
- 47322, 47329, 47336, 47343, 47350, 47354, 47359, 47367, 47375, 47383,
- 47390, 47394, 47402, 47410, 47413, 47416, 47421, 47427, 47435, 47443,
- 47463, 47483, 47503, 47523, 47543, 47563, 47583, 47603, 47608, 47615,
- 47624, 47632, 47640, 47645, 47648, 47651, 47656, 47659, 47678, 47685,
- 47691, 47697, 47701, 47704, 47707, 47710, 47721, 47733, 47741, 47749,
- 47753, 47758, 47762, 47767, 47772, 47777, 47783, 47792, 47799, 47806,
- 47814, 47821, 47828, 47831, 47837, 47843, 47846, 47849, 47854, 47859,
- 47865, 47871, 47875, 47880, 47887, 47891, 47897, 47901, 47905, 47913,
- 47925, 47933, 47937, 47939, 47948, 47957, 47963, 47966, 47972, 47978,
- 47983, 47988, 47993, 47998, 48003, 48008, 48010, 48016, 48021, 48028,
- 48032, 48038, 48041, 48045, 48052, 48059, 48061, 48063, 48069, 48075,
- 48081, 48090, 48099, 48106, 48113, 48119, 48125, 48130, 48135, 48140,
- 48146, 48152, 48157, 48164, 48168, 48172, 48185, 48198, 48209, 48218,
- 48224, 48231, 48236, 48241, 48246, 48251, 48256, 48258, 48265, 48272,
- 48279, 48286, 48293, 48301, 48307, 48312, 48318, 48324, 48330, 48337,
- 48343, 48351, 48359, 48367, 48375, 48382, 48388, 48394, 48403, 48407,
- 48416, 48425, 48434, 48442, 48446, 48452, 48459, 48466, 48470, 48476,
- 48483, 48488, 48493, 48499, 48504, 48509, 48516, 48523, 48528, 48533,
- 48541, 48549, 48559, 48569, 48576, 48583, 48587, 48591, 48603, 48609,
- 48615, 48620, 48625, 48632, 48639, 48645, 48651, 48660, 48668, 48676,
- 48683, 48690, 48697, 48703, 48710, 48716, 48723, 48730, 48737, 48744,
- 48750, 48755, 48764, 48774, 48781, 48790, 48796, 48801, 48806, 48815,
- 48821, 48827, 48833, 48841, 48846, 48853, 48860, 48871, 48878, 48885,
- 48892, 48899, 48906, 48913, 48920, 48931, 48942, 48952, 48962, 48974,
- 48986, 48991, 48996, 49004, 49012, 49018, 49024, 49033, 49042, 49050,
- 49058, 49066, 49074, 49084, 49094, 49108, 49122, 49129, 49136, 49147,
- 49158, 49165, 49172, 49181, 49190, 49195, 49200, 49209, 49218, 49223,
- 49228, 49236, 49242, 49248, 49256, 49264, 49277, 49290, 49294, 49298,
- 49305, 49312, 49319, 49327, 49335, 49343, 49351, 49357, 49363, 49369,
- 49375, 49382, 49389, 49397, 49405, 49408, 49411, 49416, 49421, 49427,
- 49433, 49440, 49447, 49456, 49465, 49472, 49479, 49487, 49495, 49503,
- 49511, 49518, 49525, 49532, 49539, 49543, 49547, 49554, 49561, 49566,
- 49571, 49576, 49581, 49587, 49601, 49608, 49615, 49619, 49621, 49623,
- 49628, 49633, 49638, 49642, 49650, 49657, 49664, 49672, 49684, 49692,
- 49700, 49711, 49715, 49719, 49723, 49728, 49739, 49746, 49753, 49760,
- 49765, 49772, 49781, 49789, 49795, 49801, 49807, 49816, 49825, 49833,
- 49842, 49847, 49850, 49855, 49861, 49867, 49873, 49879, 49883, 49886,
- 49890, 49894, 49900, 49906, 49912, 49918, 49922, 49926, 49933, 49940,
- 49947, 49954, 49961, 49968, 49978, 49987, 49994, 50001, 50009, 50017,
- 50021, 50026, 50031, 50037, 50043, 50046, 50049, 50052, 50055, 50059,
- 50064, 50069, 50074, 50079, 50084, 50088, 50092, 50096, 50100, 50104,
- 50108, 50112, 50118, 50122, 50128, 50133, 50140, 50148, 50155, 50163,
- 50170, 50178, 50187, 50194, 50204, 50215, 50221, 50230, 50236, 50245,
- 50254, 50260, 50266, 50270, 50274, 50283, 50292, 50299, 50306, 50315, 0,
- 0, 0, 50324, 50329, 50333, 50337, 50342, 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, 50347, 50352, 50357, 50362, 50367, 50372, 50377,
- 50382, 50387, 50392, 50397, 50403, 50407, 50412, 50417, 50422, 50427,
- 50432, 50437, 50442, 50447, 50452, 50457, 50462, 50467, 50472, 50477,
- 50482, 50487, 50492, 50497, 50502, 50507, 50512, 50517, 50523, 50528,
- 50534, 50543, 50548, 50556, 50563, 50572, 50577, 50582, 50587, 50593, 0,
- 50600, 50605, 50610, 50615, 50620, 50625, 50630, 50635, 50640, 50645,
- 50650, 50656, 50660, 50665, 50670, 50675, 50680, 50685, 50690, 50695,
- 50700, 50705, 50710, 50715, 50720, 50725, 50730, 50735, 50740, 50745,
- 50750, 50755, 50760, 50765, 50770, 50776, 50781, 50787, 50796, 50801,
- 50809, 50816, 50825, 50830, 50835, 50840, 50846, 0, 50853, 50861, 50869,
- 50878, 50885, 50893, 50899, 50908, 50916, 50924, 50932, 50940, 50948,
- 50956, 50961, 50968, 0, 50973, 50981, 50988, 50995, 51003, 51008, 51013,
- 51020, 51027, 51036, 51046, 51052, 51059, 0, 0, 51063, 51068, 51073,
- 51078, 51083, 51088, 51093, 51098, 51103, 51108, 51113, 51118, 51123,
- 51128, 51133, 51138, 51143, 51148, 51153, 51158, 51163, 51168, 51173,
- 51178, 51183, 51188, 51193, 51198, 51203, 51208, 51213, 51217, 51221,
- 51226, 51231, 51236, 51241, 51246, 51251, 51256, 51261, 51266, 51271,
- 51276, 51281, 51286, 51291, 51296, 51301, 51306, 51311, 51318, 51325,
- 51332, 51339, 51346, 51353, 51360, 51367, 51374, 51381, 51388, 51395,
- 51402, 51409, 51414, 51419, 51426, 51433, 51440, 51447, 51454, 51461,
- 51468, 51475, 51482, 51489, 51496, 51503, 51509, 51515, 51521, 51527,
- 51534, 51541, 51548, 51555, 51562, 51569, 51576, 51583, 51590, 51597,
- 51605, 51613, 51621, 51629, 51637, 51645, 51653, 51661, 51665, 51671,
- 51677, 51681, 51687, 51693, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 51699, 51707, 51716, 51725, 51733, 51739, 51744, 51749, 51754, 51759,
- 51764, 51769, 51774, 51779, 51784, 51789, 51794, 51799, 51804, 51809,
- 51814, 51819, 51824, 51829, 51834, 51839, 51844, 51849, 51854, 51859,
- 51864, 51869, 51874, 51879, 51884, 51889, 51894, 51899, 51904, 51909,
- 51914, 51919, 51924, 51929, 51934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51939,
- 51942, 51946, 51950, 51954, 51958, 51966, 51970, 51974, 51978, 51982,
- 51986, 51990, 51994, 51998, 52004, 52008, 52012, 52020, 52026, 52030,
- 52034, 52038, 52044, 52048, 52054, 52058, 52062, 52068, 52074, 52078,
- 52082, 52086, 52092, 52098, 52102, 52106, 52110, 52114, 52118, 52124,
- 52130, 52134, 52138, 52142, 52146, 52150, 52154, 52158, 52162, 52166,
- 52170, 52174, 52180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52184, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52190, 52194, 52198, 52202, 52206, 52210,
- 52214, 52218, 52222, 52226, 52230, 52236, 52240, 52244, 52248, 52252,
- 52256, 52260, 52264, 52268, 52272, 52276, 52280, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 52284, 52288, 52292, 52296, 52300, 52304, 52308, 0, 52312, 52316,
- 52320, 52324, 52328, 52332, 52336, 0, 52340, 52344, 52348, 52352, 52356,
- 52360, 52364, 0, 52368, 52372, 52376, 52380, 52384, 52388, 52392, 0,
- 52396, 52400, 52404, 52408, 52412, 52416, 52420, 0, 52424, 52428, 52432,
- 52436, 52440, 52444, 52448, 0, 52452, 52456, 52460, 52464, 52468, 52472,
- 52476, 0, 52480, 52484, 52488, 52492, 52496, 52500, 52504, 0, 52508,
- 52513, 52518, 52523, 52528, 52533, 52538, 52542, 52547, 52552, 52557,
- 52561, 52566, 52571, 52576, 52581, 52585, 52590, 52595, 52600, 52605,
- 52610, 52615, 52619, 52624, 52629, 52636, 52641, 52646, 52652, 52659,
- 52666, 52675, 52682, 52691, 52695, 52699, 52705, 52711, 52717, 52725,
- 52731, 52735, 52739, 52743, 52749, 52755, 52759, 52761, 52765, 52770,
- 52772, 52776, 52780, 52784, 52790, 52795, 52799, 52803, 52807, 52813,
- 52818, 52823, 52828, 52833, 52840, 52847, 52852, 52857, 52862, 52867,
- 52872, 52877, 52881, 52885, 52892, 52899, 52906, 52910, 52914, 52916, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 52920, 52924, 52928, 52933, 52938, 52943, 52947, 52951,
- 52955, 52960, 52965, 52969, 52973, 52977, 52981, 52986, 52991, 52996,
- 53001, 53005, 53009, 53014, 53019, 53024, 53029, 53033, 0, 53037, 53041,
- 53045, 53049, 53053, 53057, 53061, 53066, 53071, 53075, 53080, 53085,
- 53094, 53098, 53102, 53106, 53113, 53117, 53122, 53127, 53131, 53135,
- 53141, 53146, 53151, 53156, 53161, 53165, 53169, 53173, 53177, 53181,
- 53186, 53191, 53195, 53199, 53204, 53209, 53214, 53218, 53222, 53227,
- 53232, 53238, 53244, 53248, 53254, 53260, 53264, 53270, 53276, 53281,
- 53286, 53290, 53296, 53300, 53304, 53310, 53316, 53321, 53326, 53330,
- 53334, 53342, 53348, 53354, 53360, 53365, 53370, 53375, 53381, 53385,
- 53391, 53395, 53399, 53405, 53411, 53417, 53423, 53429, 53435, 53441,
- 53447, 53453, 53459, 53465, 53471, 53475, 53481, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 53487, 53490, 53494, 53498, 53502, 53506, 53509, 53512,
- 53516, 53520, 53524, 53528, 53531, 53536, 53540, 53544, 53548, 53554,
- 53558, 53562, 53566, 53570, 53577, 53583, 53587, 53591, 53595, 53599,
- 53603, 53607, 53611, 53615, 53619, 53623, 53627, 53633, 53637, 53641,
- 53645, 53649, 53653, 53657, 53661, 53665, 53669, 53673, 53677, 53681,
- 53685, 53689, 53693, 53697, 53703, 53709, 53714, 53719, 53723, 53727,
- 53731, 53735, 53739, 53743, 53747, 53751, 53755, 53759, 53763, 53767,
- 53771, 53775, 53779, 53783, 53787, 53791, 53795, 53799, 53803, 53807,
- 53811, 53815, 53821, 53825, 53829, 53833, 53837, 53841, 53845, 53849,
- 53853, 53858, 53865, 53869, 53873, 53877, 53881, 53885, 53889, 53893,
- 53897, 53901, 53905, 53909, 53913, 53920, 53924, 53930, 53934, 53938,
- 53942, 53946, 53950, 53953, 53957, 53961, 53965, 53969, 53973, 53977,
- 53981, 53985, 53989, 53993, 53997, 54001, 54005, 54009, 54013, 54017,
- 54021, 54025, 54029, 54033, 54037, 54041, 54045, 54049, 54053, 54057,
- 54061, 54065, 54069, 54073, 54077, 54081, 54087, 54091, 54095, 54099,
- 54103, 54107, 54111, 54115, 54119, 54123, 54127, 54131, 54135, 54139,
- 54143, 54147, 54151, 54155, 54159, 54163, 54167, 54171, 54175, 54179,
- 54183, 54187, 54191, 54195, 54203, 54207, 54211, 54215, 54219, 54223,
- 54229, 54233, 54237, 54241, 54245, 54249, 54253, 54257, 54261, 54265,
- 54269, 54273, 54277, 54281, 54287, 54291, 54295, 54299, 54303, 54307,
- 54311, 54315, 54319, 54323, 54327, 54331, 54335, 54339, 54343, 54347,
- 54351, 54355, 54359, 54363, 54367, 54371, 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, 54375, 54383, 54390,
- 54401, 54411, 54419, 54428, 54437, 54447, 54459, 54471, 54482, 0, 0, 0,
- 0, 54488, 54491, 54494, 54499, 54502, 54509, 54513, 54517, 54521, 54525,
- 54529, 54534, 54539, 54543, 54547, 54552, 54557, 54562, 54567, 54570,
- 54573, 54579, 54585, 54590, 54595, 54602, 54609, 54613, 54617, 54621,
- 54628, 54634, 54641, 54646, 54650, 54654, 54658, 54662, 54666, 54670,
- 54674, 54678, 54682, 54687, 54692, 54697, 54702, 54708, 54713, 54717,
- 54723, 54734, 54744, 54759, 54768, 54772, 54781, 54786, 54791, 54796,
- 54801, 54804, 54809, 54813, 0, 54819, 54823, 54826, 54830, 54833, 54837,
- 54840, 54844, 54847, 54851, 54854, 54857, 54861, 54865, 54869, 54873,
- 54877, 54881, 54885, 54889, 54893, 54897, 54901, 54905, 54909, 54913,
- 54917, 54921, 54925, 54929, 54933, 54937, 54941, 54945, 54949, 54954,
- 54958, 54962, 54966, 54970, 54973, 54977, 54981, 54985, 54989, 54993,
- 54997, 55000, 55004, 55007, 55011, 55015, 55019, 55023, 55027, 55031,
- 55035, 55039, 55043, 55047, 55051, 55055, 55058, 55062, 55066, 55070,
- 55074, 55078, 55081, 55086, 55090, 55095, 55099, 55102, 55106, 55110,
- 55114, 55118, 55123, 55127, 55131, 55135, 55139, 55142, 55146, 55150, 0,
- 0, 55155, 55163, 55171, 55178, 55185, 55189, 55195, 55200, 55205, 55209,
- 55212, 55216, 55219, 55223, 55226, 55230, 55233, 55237, 55240, 55243,
- 55247, 55251, 55255, 55259, 55263, 55267, 55271, 55275, 55279, 55283,
- 55287, 55291, 55295, 55299, 55303, 55307, 55311, 55315, 55319, 55323,
- 55327, 55331, 55335, 55340, 55344, 55348, 55352, 55356, 55359, 55363,
- 55367, 55371, 55375, 55379, 55383, 55386, 55390, 55393, 55397, 55401,
- 55405, 55409, 55413, 55417, 55421, 55425, 55429, 55433, 55437, 55441,
- 55444, 55448, 55452, 55456, 55460, 55464, 55467, 55472, 55476, 55481,
- 55485, 55488, 55492, 55496, 55500, 55504, 55509, 55513, 55517, 55521,
- 55525, 55528, 55532, 55536, 55541, 55545, 55549, 55553, 55557, 55562,
- 55569, 55573, 55579, 0, 0, 0, 0, 0, 55584, 55588, 55592, 55595, 55599,
- 55603, 55607, 55610, 55613, 55616, 55620, 55623, 55627, 55631, 55635,
- 55639, 55643, 55647, 55650, 55654, 55658, 55661, 55664, 55667, 55670,
- 55674, 55678, 55682, 55686, 55690, 55694, 55698, 55702, 55706, 55710,
- 55713, 55716, 55720, 55723, 55727, 55731, 0, 0, 0, 55735, 55739, 55743,
- 55747, 55751, 55755, 55759, 55763, 55767, 55771, 55775, 55779, 55783,
- 55787, 55791, 55795, 55799, 55803, 55807, 55811, 55815, 55819, 55823,
- 55827, 55831, 55835, 55839, 55843, 55847, 55851, 55855, 55858, 55862,
- 55865, 55869, 55873, 55876, 55880, 55884, 55887, 55891, 55895, 55899,
- 55903, 55906, 55910, 55914, 55918, 55922, 55926, 55930, 55933, 55936,
- 55940, 55944, 55948, 55952, 55956, 55960, 55964, 55968, 55972, 55976,
- 55980, 55984, 55988, 55992, 55996, 56000, 56004, 56008, 56012, 56016,
- 56020, 56024, 56028, 56032, 56036, 56040, 56044, 56048, 56052, 56056,
- 56060, 56064, 56068, 56072, 56076, 56080, 56084, 56088, 56092, 56096,
- 56100, 0, 56104, 56110, 56116, 56121, 56126, 56131, 56137, 56143, 56149,
- 56155, 56161, 56167, 56173, 56179, 56185, 56191, 56197, 56201, 56205,
- 56209, 56213, 56217, 56221, 56225, 56229, 56233, 56237, 56241, 56245,
- 56249, 56253, 56257, 56261, 56265, 56269, 56273, 56277, 56282, 56287,
- 56292, 0, 0, 0, 0, 0, 0, 0, 0, 56296, 56300, 56304, 56308, 56312, 56316,
- 56320, 56324, 56328, 56332, 56336, 56340, 56344, 56348, 56352, 56356,
- 56359, 56362, 56365, 56369, 56373, 56377, 56381, 56385, 56389, 56393,
- 56397, 56401, 56405, 56409, 56413, 56417, 56421, 56425, 56429, 56433, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56437, 56442, 56447, 56452, 56456,
- 56461, 56465, 56470, 56475, 56480, 56485, 56490, 56494, 56499, 56504,
- 56509, 56514, 56518, 56522, 56526, 56530, 56534, 56538, 56542, 56546,
- 56550, 56554, 56558, 56562, 56566, 56570, 56575, 56580, 56585, 56590,
- 56595, 56600, 56605, 56610, 56615, 56620, 56625, 56630, 56635, 56640,
- 56645, 56651, 0, 56658, 56661, 56664, 56667, 56670, 56673, 56676, 56679,
- 56682, 56685, 56689, 56693, 56697, 56701, 56705, 56709, 56713, 56717,
- 56721, 56725, 56729, 56733, 56737, 56741, 56745, 56749, 56753, 56757,
- 56761, 56765, 56769, 56773, 56777, 56781, 56785, 56789, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 56793, 56796, 56801, 56806, 56811, 56816, 56821, 56826,
- 56831, 56836, 56841, 56845, 56850, 56855, 56860, 56865, 56870, 56874,
- 56878, 56882, 56886, 56890, 56894, 56898, 56902, 56906, 56910, 56914,
- 56918, 56922, 56926, 56931, 56936, 56941, 56946, 56951, 56956, 56961,
- 56966, 56971, 56976, 56981, 56986, 56991, 56996, 57002, 57008, 57013,
- 57018, 57021, 57024, 57027, 57030, 57033, 57036, 57039, 57042, 57045,
- 57049, 57053, 57057, 57061, 57065, 57069, 57073, 57077, 57081, 57085,
- 57089, 57093, 57097, 57101, 57105, 57109, 57113, 57117, 57121, 57125,
- 57129, 57133, 57137, 57141, 57145, 57149, 57153, 57157, 57161, 57165,
- 57169, 57173, 57177, 57181, 57185, 57189, 57193, 57197, 57201, 57205,
- 57210, 57215, 57220, 57225, 57229, 57234, 57239, 57244, 57249, 57254,
- 57259, 57264, 57269, 57274, 57278, 57284, 57290, 57296, 57302, 57308,
- 57314, 57320, 57326, 57332, 57338, 57344, 57350, 57353, 57356, 57359,
- 57364, 57367, 57370, 57373, 57376, 57379, 57382, 57386, 57390, 57394,
- 57398, 57402, 57406, 57410, 57414, 57418, 57422, 57426, 57430, 57434,
- 57437, 57441, 57445, 57449, 57453, 57457, 57460, 57464, 57468, 57472,
- 57476, 57479, 57483, 57487, 57491, 57495, 57498, 57502, 57506, 57509,
- 57513, 57517, 57521, 57525, 57529, 57533, 57537, 0, 57541, 57544, 57547,
- 57550, 57553, 57556, 57559, 57562, 57565, 57568, 57571, 57574, 57577,
- 57580, 57583, 57586, 57589, 57592, 57595, 57598, 57601, 57604, 57607,
- 57610, 57613, 57616, 57619, 57622, 57625, 57628, 57631, 57634, 57637,
- 57640, 57643, 57646, 57649, 57652, 57655, 57658, 57661, 57664, 57667,
- 57670, 57673, 57676, 57679, 57682, 57685, 57688, 57691, 57694, 57697,
- 57700, 57703, 57706, 57709, 57712, 57715, 57718, 57721, 57724, 57727,
- 57730, 57733, 57736, 57739, 57742, 57745, 57748, 57751, 57754, 57757,
- 57760, 57763, 57766, 57769, 57772, 57775, 57778, 57781, 57784, 57787,
- 57790, 57793, 57796, 57799, 57802, 57805, 57813, 57820, 57827, 57834,
- 57841, 57848, 57855, 57862, 57869, 57876, 57884, 57892, 57900, 57908,
- 57916, 57924, 57932, 57940, 57948, 57956, 57964, 57972, 57980, 57988,
- 57996, 57999, 58002, 58005, 58007, 58010, 58013, 58016, 58021, 58026,
- 58029, 58036, 58043, 58050, 58057, 58060, 58065, 58068, 58072, 58074,
- 58076, 58079, 58082, 58085, 58088, 58091, 58094, 58097, 58102, 58106,
- 58109, 58112, 58115, 58118, 58121, 58124, 58127, 58131, 58134, 58137,
- 58140, 58143, 58146, 58150, 58153, 58156, 58159, 58164, 58169, 58174,
- 58179, 58184, 58189, 58194, 58199, 58204, 58212, 58214, 58217, 58220,
- 58223, 58226, 58231, 58239, 58242, 58245, 58249, 58252, 58255, 58258,
- 58262, 58265, 58268, 58273, 58276, 58279, 58284, 58287, 58290, 58295,
- 58300, 58305, 58308, 58311, 58314, 58317, 58323, 58326, 58329, 58332,
- 58334, 58337, 58340, 58343, 58348, 58351, 58354, 58357, 58360, 58363,
- 58368, 58371, 58374, 58377, 58380, 58383, 58386, 58389, 58392, 58395,
- 58400, 58404, 58411, 58418, 58425, 58432, 58439, 58446, 58453, 58460,
- 58467, 58475, 58483, 58491, 58499, 58507, 58515, 58523, 58531, 58539,
- 58547, 58555, 58563, 58571, 58579, 58587, 58595, 58603, 58611, 58619,
- 58627, 58635, 58643, 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,
- 58646, 58654, 58662, 58672, 58678, 58682, 58686, 58692, 58698, 58703,
- 58707, 58711, 58715, 58719, 58725, 58729, 58733, 58737, 58747, 58751,
- 58755, 58761, 58765, 58771, 58775, 58779, 58785, 58791, 58797, 58805,
- 58813, 58817, 58821, 58825, 58831, 58835, 58844, 58850, 58854, 58858,
- 58862, 58866, 58870, 58874, 58881, 58887, 58893, 58897, 58903, 58907,
- 58913, 58921, 58931, 58935, 58943, 58947, 58953, 58961, 58969, 58973,
- 58977, 58983, 58988, 58994, 59000, 59004, 59008, 59011, 59015, 59019,
- 59023, 59027, 59031, 59035, 59039, 59042, 59046, 59050, 59054, 59058,
- 59062, 59066, 59069, 59073, 59077, 59080, 59084, 59088, 59092, 59096,
- 59100, 59104, 59108, 59112, 59116, 59120, 59124, 59128, 59132, 59136,
- 59140, 59144, 59148, 59152, 59156, 59160, 59164, 59168, 59172, 59176,
- 59180, 59184, 59188, 59192, 59196, 59200, 59204, 59208, 59212, 59216,
- 59220, 59224, 59228, 59232, 59236, 59240, 59244, 59248, 59252, 59256,
- 59259, 59263, 59267, 59271, 59275, 59279, 59283, 59287, 59291, 59295,
- 59299, 59303, 59307, 59311, 59315, 59319, 59323, 59327, 59331, 59335,
- 59339, 59343, 59347, 59351, 59355, 59359, 59363, 59367, 59371, 59375,
- 59379, 59383, 59387, 59391, 59395, 59399, 59403, 59407, 59411, 59415,
- 59419, 59423, 59427, 59431, 59435, 59439, 59443, 59447, 59451, 59455,
- 59459, 59463, 59467, 59471, 59475, 59479, 59483, 59487, 59491, 59495,
- 59499, 59503, 59507, 59511, 59515, 59519, 59523, 59527, 59531, 59535,
- 59539, 59543, 59547, 59551, 59555, 59559, 59563, 59567, 59571, 59575,
- 59579, 59583, 59587, 59591, 59595, 59599, 59603, 59607, 59611, 59615,
- 59619, 59623, 59627, 59631, 59635, 59639, 59643, 59647, 59651, 59655,
- 59659, 59663, 59667, 59671, 59675, 59679, 59683, 59687, 59691, 59695,
- 59699, 59703, 59707, 59711, 59715, 59719, 59723, 59727, 59730, 59734,
- 59738, 59742, 59746, 59750, 59754, 59758, 59762, 59766, 59770, 59774,
- 59778, 59782, 59786, 59790, 59794, 59798, 59802, 59806, 59810, 59814,
- 59818, 59822, 59826, 59830, 59834, 59838, 59842, 59846, 59850, 59854,
- 59858, 59862, 59866, 59870, 59874, 59878, 59882, 59886, 59890, 59894,
- 59898, 59902, 59906, 59910, 59914, 59918, 59922, 59926, 59930, 59934,
- 59938, 59942, 59946, 59950, 59954, 59958, 59962, 59966, 59970, 59974,
- 59978, 59982, 59986, 59990, 59994, 59998, 60002, 60006, 60010, 60014,
- 60018, 60022, 60026, 60030, 60034, 60038, 60042, 60046, 60050, 60054,
- 60058, 60062, 60066, 60070, 60074, 60078, 60082, 60086, 60090, 60094,
- 60098, 60102, 60106, 60110, 60114, 60118, 60122, 60126, 60130, 60134,
- 60138, 60142, 60146, 60150, 60154, 60158, 60162, 60166, 60170, 60174,
- 60178, 60182, 60186, 60190, 60193, 60197, 60201, 60205, 60209, 60213,
- 60217, 60221, 60225, 60229, 60233, 60237, 60241, 60245, 60249, 60253,
- 60257, 60261, 60265, 60269, 60273, 60277, 60281, 60285, 60289, 60293,
+ 0, 0, 0, 0, 0, 56988, 56992, 56996, 57001, 57006, 57011, 57015, 57019,
+ 57023, 57028, 57033, 57037, 57041, 57045, 57049, 57054, 57059, 57064,
+ 57069, 57073, 57077, 57082, 57087, 57092, 57097, 57101, 0, 57105, 57109,
+ 57113, 57117, 57121, 57125, 57129, 57134, 57139, 57143, 57148, 57153,
+ 57162, 57166, 57170, 57174, 57181, 57185, 57190, 57195, 57199, 57203,
+ 57209, 57214, 57219, 57224, 57229, 57233, 57237, 57241, 57245, 57249,
+ 57254, 57259, 57263, 57267, 57272, 57277, 57282, 57286, 57290, 57295,
+ 57300, 57306, 57312, 57316, 57322, 57328, 57332, 57338, 57344, 57349,
+ 57354, 57358, 57364, 57368, 57372, 57378, 57384, 57389, 57394, 57398,
+ 57402, 57410, 57416, 57422, 57428, 57433, 57438, 57443, 57449, 57453,
+ 57459, 57463, 57467, 57473, 57479, 57485, 57491, 57497, 57503, 57509,
+ 57515, 57521, 57527, 57533, 57539, 57543, 57549, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 57555, 57558, 57562, 57566, 57570, 57574, 57577, 57580,
+ 57584, 57588, 57592, 57596, 57599, 57604, 57608, 57612, 57616, 57622,
+ 57626, 57630, 57634, 57638, 57645, 57651, 57655, 57659, 57663, 57667,
+ 57671, 57675, 57679, 57683, 57687, 57691, 57695, 57701, 57705, 57709,
+ 57713, 57717, 57721, 57725, 57729, 57733, 57737, 57741, 57745, 57749,
+ 57753, 57757, 57761, 57765, 57771, 57777, 57782, 57787, 57791, 57795,
+ 57799, 57803, 57807, 57811, 57815, 57819, 57823, 57827, 57831, 57835,
+ 57839, 57843, 57847, 57851, 57855, 57859, 57863, 57867, 57871, 57875,
+ 57879, 57883, 57889, 57893, 57897, 57901, 57905, 57909, 57913, 57917,
+ 57921, 57926, 57933, 57937, 57941, 57945, 57949, 57953, 57957, 57961,
+ 57965, 57969, 57973, 57977, 57981, 57988, 57992, 57998, 58002, 58006,
+ 58010, 58014, 58018, 58021, 58025, 58029, 58033, 58037, 58041, 58045,
+ 58049, 58053, 58057, 58061, 58065, 58069, 58073, 58077, 58081, 58085,
+ 58089, 58093, 58097, 58101, 58105, 58109, 58113, 58117, 58121, 58125,
+ 58129, 58133, 58137, 58141, 58145, 58149, 58155, 58159, 58163, 58167,
+ 58171, 58175, 58179, 58183, 58187, 58191, 58195, 58199, 58203, 58207,
+ 58211, 58215, 58219, 58223, 58227, 58231, 58235, 58239, 58243, 58247,
+ 58251, 58255, 58259, 58263, 58271, 58275, 58279, 58283, 58287, 58291,
+ 58297, 58301, 58305, 58309, 58313, 58317, 58321, 58325, 58329, 58333,
+ 58337, 58341, 58345, 58349, 58355, 58359, 58363, 58367, 58371, 58375,
+ 58379, 58383, 58387, 58391, 58395, 58399, 58403, 58407, 58411, 58415,
+ 58419, 58423, 58427, 58431, 58435, 58439, 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, 58443, 58452, 58460,
+ 58472, 58483, 58491, 58500, 58509, 58519, 58531, 58543, 58555, 0, 0, 0,
+ 0, 58561, 58564, 58567, 58572, 58575, 58582, 58586, 58590, 58594, 58598,
+ 58602, 58607, 58612, 58616, 58620, 58625, 58630, 58635, 58640, 58643,
+ 58646, 58652, 58658, 58663, 58668, 58675, 58682, 58686, 58690, 58694,
+ 58702, 58708, 58715, 58720, 58725, 58730, 58735, 58740, 58745, 58750,
+ 58755, 58760, 58765, 58770, 58775, 58780, 58785, 58791, 58796, 58800,
+ 58806, 58817, 58827, 58842, 58852, 58856, 58865, 58871, 58877, 58883,
+ 58888, 58891, 58896, 58900, 0, 58906, 58910, 58913, 58917, 58920, 58924,
+ 58927, 58931, 58934, 58938, 58941, 58944, 58948, 58952, 58956, 58960,
+ 58964, 58968, 58972, 58976, 58980, 58984, 58988, 58992, 58996, 59000,
+ 59004, 59008, 59012, 59016, 59020, 59024, 59028, 59032, 59036, 59041,
+ 59045, 59049, 59053, 59057, 59060, 59064, 59067, 59071, 59075, 59079,
+ 59083, 59086, 59090, 59093, 59097, 59101, 59105, 59109, 59113, 59117,
+ 59121, 59125, 59129, 59133, 59137, 59141, 59144, 59148, 59152, 59156,
+ 59160, 59164, 59167, 59172, 59176, 59181, 59185, 59188, 59192, 59196,
+ 59200, 59204, 59209, 59213, 59217, 59221, 59225, 59228, 59232, 59236, 0,
+ 0, 59241, 59249, 59257, 59264, 59271, 59275, 59281, 59286, 59291, 59295,
+ 59298, 59302, 59305, 59309, 59312, 59316, 59319, 59323, 59326, 59329,
+ 59333, 59337, 59341, 59345, 59349, 59353, 59357, 59361, 59365, 59369,
+ 59373, 59377, 59381, 59385, 59389, 59393, 59397, 59401, 59405, 59409,
+ 59413, 59417, 59421, 59426, 59430, 59434, 59438, 59442, 59445, 59449,
+ 59452, 59456, 59460, 59464, 59468, 59471, 59475, 59478, 59482, 59486,
+ 59490, 59494, 59498, 59502, 59506, 59510, 59514, 59518, 59522, 59526,
+ 59529, 59533, 59537, 59541, 59545, 59549, 59552, 59557, 59561, 59566,
+ 59570, 59573, 59577, 59581, 59585, 59589, 59594, 59598, 59602, 59606,
+ 59610, 59613, 59617, 59621, 59626, 59630, 59634, 59638, 59642, 59647,
+ 59654, 59658, 59664, 0, 0, 0, 0, 0, 59669, 59673, 59677, 59680, 59684,
+ 59688, 59692, 59695, 59698, 59702, 59706, 59710, 59714, 59718, 59722,
+ 59726, 59730, 59734, 59737, 59741, 59745, 59748, 59751, 59754, 59757,
+ 59761, 59765, 59769, 59773, 59777, 59781, 59785, 59789, 59793, 59797,
+ 59800, 59803, 59807, 59811, 59815, 59819, 0, 0, 0, 59823, 59827, 59831,
+ 59835, 59839, 59843, 59847, 59851, 59855, 59859, 59863, 59867, 59871,
+ 59875, 59879, 59883, 59887, 59891, 59895, 59899, 59903, 59907, 59911,
+ 59915, 59919, 59923, 59927, 59931, 59935, 59939, 59943, 59946, 59950,
+ 59953, 59957, 59961, 59964, 59968, 59972, 59975, 59979, 59983, 59987,
+ 59991, 59994, 59998, 60002, 60006, 60010, 60014, 60018, 60021, 60024,
+ 60028, 60032, 60036, 60040, 60044, 60048, 60052, 60056, 60060, 60064,
+ 60068, 60072, 60076, 60080, 60084, 60088, 60092, 60096, 60100, 60104,
+ 60108, 60112, 60116, 60120, 60124, 60128, 60132, 60136, 60140, 60144,
+ 60148, 60152, 60156, 60160, 60164, 60168, 60172, 60176, 60180, 60184,
+ 60188, 0, 60192, 60198, 60204, 60209, 60214, 60219, 60225, 60231, 60237,
+ 60243, 60249, 60255, 60261, 60267, 60273, 60279, 60285, 60289, 60293,
60297, 60301, 60305, 60309, 60313, 60317, 60321, 60325, 60329, 60333,
- 60337, 60341, 60345, 60349, 60353, 60357, 60361, 60365, 60369, 60373,
- 60377, 60381, 60385, 60389, 60393, 60397, 60401, 60405, 60409, 60413,
- 60417, 60421, 60425, 60429, 60433, 60437, 60441, 60445, 60449, 60453,
- 60457, 60461, 60465, 60469, 60473, 60477, 60481, 60485, 60489, 60493,
- 60497, 60501, 60505, 60509, 60513, 60517, 60521, 60525, 60529, 60533,
- 60537, 60541, 60545, 60549, 60553, 60557, 60561, 60565, 60569, 60573,
- 60577, 60581, 60585, 60589, 60593, 60597, 60601, 60605, 60609, 60613,
- 60617, 60621, 60625, 60629, 60633, 60637, 60641, 60645, 60649, 60653,
- 60657, 60661, 60665, 60669, 60673, 60677, 60681, 60685, 60689, 60693,
- 60697, 60701, 60705, 60709, 60713, 60717, 60721, 60725, 60729, 60733,
- 60737, 60741, 60745, 60749, 60753, 60757, 60761, 60765, 60769, 60773,
- 60777, 60781, 60785, 60789, 60793, 60797, 60801, 60805, 60809, 60813,
- 60817, 60821, 60825, 60829, 60833, 60837, 60841, 60845, 60849, 60853,
- 60857, 60861, 60865, 60869, 60873, 60877, 60881, 60885, 60889, 60893,
- 60897, 60901, 60905, 60909, 60913, 60917, 60921, 60925, 60929, 60933,
- 60937, 60941, 60945, 60949, 60953, 60957, 60961, 60965, 60969, 60973,
- 60977, 60981, 60985, 60989, 60993, 60997, 61001, 61005, 61009, 61013,
- 61017, 61021, 61025, 61029, 61033, 61037, 61041, 61045, 61048, 61052,
- 61056, 61060, 61064, 61068, 61072, 61076, 61080, 61084, 61088, 61092,
- 61096, 61100, 61104, 61108, 61112, 61116, 61120, 61124, 61128, 61132,
- 61136, 61140, 61144, 61148, 61152, 61156, 61160, 61164, 61168, 61172,
- 61176, 61180, 61184, 61188, 61192, 61196, 61200, 61204, 61208, 61212,
- 61216, 61220, 61224, 61228, 61232, 61236, 61240, 61244, 61248, 61252,
- 61256, 61260, 61264, 61268, 61272, 61276, 61280, 61284, 61288, 61292,
- 61296, 61300, 61304, 61308, 61312, 61316, 61320, 61324, 61328, 61332,
- 61336, 61340, 61344, 61348, 61352, 61356, 61360, 61364, 61368, 61372,
- 61376, 61380, 61384, 61388, 61392, 61396, 61400, 61404, 61408, 61412,
- 61416, 61420, 61424, 61428, 61432, 61436, 61440, 61444, 61448, 61452,
- 61456, 61460, 61464, 61468, 61472, 61476, 61480, 61484, 61488, 61492,
- 61496, 61500, 61503, 61507, 61511, 61515, 61519, 61523, 61527, 61531,
- 61535, 61539, 61543, 61547, 61551, 61555, 61559, 61563, 61567, 61571,
- 61575, 61579, 61583, 61587, 61591, 61595, 61599, 61603, 61607, 61611,
- 61615, 61619, 61623, 61627, 61631, 61635, 61639, 61643, 61647, 61651,
- 61655, 61659, 61663, 61667, 61671, 61675, 61679, 61683, 61687, 61691,
- 61695, 61699, 61703, 61707, 61711, 61715, 61719, 61723, 61727, 61731,
- 61735, 61739, 61743, 61747, 61751, 61755, 61759, 61763, 61767, 61771,
- 61775, 61779, 61783, 61787, 61791, 61795, 61799, 61803, 61807, 61811,
- 61815, 61819, 61823, 61827, 61831, 61835, 61839, 61843, 61847, 61851,
- 61855, 61859, 61863, 61867, 61871, 61875, 61879, 61883, 61887, 61891,
- 61895, 61899, 61903, 61907, 61911, 61915, 61919, 61923, 61927, 61931,
- 61935, 61939, 61943, 61947, 61951, 61955, 61959, 61963, 61967, 61971,
- 61975, 61979, 61983, 61987, 61991, 61995, 61999, 62003, 62007, 62011,
- 62015, 62019, 62023, 62027, 62031, 62035, 62039, 62043, 62047, 62051,
- 62055, 62059, 62063, 62067, 62071, 62075, 62079, 62083, 62087, 62091,
- 62095, 62099, 62103, 62106, 62110, 62114, 62118, 62122, 62126, 62130,
- 62134, 62138, 62142, 62146, 62150, 62154, 62158, 62162, 62166, 62170,
- 62174, 62178, 62182, 62186, 62190, 62194, 62198, 62202, 62206, 62210,
- 62214, 62218, 62222, 62226, 62230, 62234, 62238, 62242, 62246, 62250,
- 62254, 62258, 62262, 62266, 62270, 62274, 62278, 62282, 62286, 62290,
- 62294, 62298, 62302, 62306, 62310, 62314, 62318, 62322, 62326, 62330,
- 62334, 62338, 62342, 62346, 62350, 62354, 62358, 62362, 62366, 62370,
- 62374, 62378, 62382, 62386, 62390, 62394, 62398, 62402, 62406, 62410,
- 62414, 62418, 62422, 62426, 62430, 62434, 62438, 62442, 62446, 62450,
- 62454, 62458, 62462, 62466, 62470, 62474, 62478, 62482, 62486, 62490,
- 62494, 62498, 62502, 62506, 62510, 62514, 62518, 62522, 62526, 62530,
- 62534, 62538, 62542, 62546, 62550, 62554, 62558, 62562, 62566, 62570,
- 62574, 62578, 62582, 62586, 62590, 62594, 62598, 62602, 62606, 62610,
- 62614, 62618, 62622, 62626, 62630, 62634, 62638, 62642, 62646, 62650,
- 62654, 62658, 62662, 62666, 62670, 62674, 62678, 62682, 62686, 62690,
- 62694, 62698, 62702, 62706, 62710, 62714, 62718, 62722, 62726, 62730,
- 62734, 62738, 62742, 62746, 62750, 62754, 62758, 62762, 62766, 62770,
- 62774, 62778, 62782, 62786, 62790, 62794, 62798, 62802, 62806, 62810,
- 62814, 62818, 62822, 62826, 62830, 62834, 62838, 62842, 62846, 62850,
- 62854, 62858, 62862, 62865, 62869, 62873, 62877, 62881, 62885, 62889,
- 62893, 62897, 62901, 62905, 62909, 62913, 62917, 62921, 62925, 62929,
- 62933, 62937, 62941, 62945, 62949, 62953, 62957, 62961, 62965, 62969,
- 62973, 62977, 62981, 62985, 62989, 62993, 62997, 63001, 63005, 63009,
- 63013, 63017, 63021, 63025, 63029, 63033, 63037, 63041, 63045, 63049,
- 63053, 63057, 63061, 63065, 63069, 63073, 63077, 63081, 63085, 63089,
- 63093, 63097, 63101, 63105, 63109, 63113, 63117, 63121, 63125, 63129,
- 63133, 63137, 63141, 63145, 63149, 63153, 63157, 63161, 63165, 63169,
- 63173, 63177, 63181, 63185, 63189, 63193, 63197, 63201, 63205, 63209,
- 63213, 63217, 63221, 63225, 63229, 63233, 63237, 63241, 63245, 63249,
- 63253, 63257, 63261, 63265, 63269, 63273, 63277, 63281, 63285, 63289,
- 63293, 63297, 63301, 63305, 63309, 63313, 63317, 63321, 63325, 63329,
- 63333, 63337, 63341, 63345, 63349, 63353, 63357, 63361, 63365, 63369,
- 63373, 63377, 63381, 63385, 63389, 63393, 63397, 63401, 63405, 63409,
- 63413, 63417, 63421, 63425, 63429, 63433, 63437, 63441, 63445, 63449,
- 63453, 63457, 63461, 63465, 63469, 63473, 63477, 63481, 63485, 63489,
- 63493, 63497, 63501, 63505, 63509, 63513, 63517, 63521, 63525, 63529,
- 63533, 63537, 63541, 63545, 63549, 63553, 63557, 63561, 63565, 63569,
- 63573, 63577, 63581, 63585, 63589, 63593, 63597, 63601, 63605, 63609,
- 63613, 63617, 63621, 63625, 63629, 63633, 63637, 63641, 63645, 0, 0, 0,
- 63649, 63653, 63657, 63661, 63665, 63669, 63673, 63677, 63681, 63685,
- 63689, 63693, 63697, 63701, 63705, 63709, 63713, 63717, 63721, 63725,
- 63729, 63733, 63737, 63741, 63745, 63749, 63753, 63757, 63761, 63765,
- 63769, 63773, 63777, 63781, 63785, 63789, 63793, 63797, 63801, 63805,
- 63809, 63813, 63817, 63821, 63825, 63829, 63833, 63837, 63841, 63845,
- 63849, 63853, 63857, 63861, 63865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 60337, 60341, 60345, 60349, 60353, 60357, 60361, 60365, 60370, 60375,
+ 60380, 60385, 60389, 60393, 0, 0, 0, 0, 0, 60397, 60402, 60407, 60412,
+ 60417, 60422, 60427, 60432, 60437, 60442, 60447, 60452, 60457, 60462,
+ 60467, 60472, 60476, 60481, 60485, 60490, 60495, 60500, 60505, 60510,
+ 60515, 60520, 60525, 60530, 60535, 60540, 60545, 60550, 60555, 60560,
+ 60565, 60570, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60575, 60580, 60585,
+ 60590, 60594, 60599, 60603, 60608, 60613, 60618, 60623, 60628, 60632,
+ 60637, 60642, 60647, 60652, 60656, 60660, 60664, 60668, 60672, 60676,
+ 60680, 60684, 60688, 60692, 60696, 60700, 60704, 60708, 60713, 60718,
+ 60723, 60728, 60733, 60738, 60743, 60748, 60753, 60758, 60763, 60768,
+ 60773, 60778, 60783, 60789, 0, 60796, 60799, 60802, 60805, 60808, 60811,
+ 60814, 60817, 60820, 60823, 60827, 60831, 60835, 60839, 60843, 60847,
+ 60851, 60855, 60859, 60863, 60867, 60871, 60875, 60879, 60883, 60887,
+ 60891, 60895, 60899, 60903, 60907, 60911, 60915, 60919, 60923, 60927,
+ 60931, 60935, 60939, 60943, 60947, 60956, 60965, 60974, 60983, 60992,
+ 61001, 61010, 61019, 61022, 61027, 61032, 61037, 61042, 61047, 61052,
+ 61057, 61062, 61067, 61071, 61076, 61081, 61086, 61091, 61096, 61100,
+ 61104, 61108, 61112, 61116, 61120, 61124, 61128, 61132, 61136, 61140,
+ 61144, 61148, 61152, 61157, 61162, 61167, 61172, 61177, 61182, 61187,
+ 61192, 61197, 61202, 61207, 61212, 61217, 61222, 61228, 61234, 61239,
+ 61244, 61247, 61250, 61253, 61256, 61259, 61262, 61265, 61268, 61271,
+ 61275, 61279, 61283, 61287, 61291, 61295, 61299, 61303, 61307, 61311,
+ 61315, 61319, 61323, 61327, 61331, 61335, 61339, 61343, 61347, 61351,
+ 61355, 61359, 61363, 61367, 61371, 61375, 61379, 61383, 61387, 61391,
+ 61395, 61399, 61403, 61407, 61411, 61415, 61419, 61423, 61427, 61431,
+ 61436, 61441, 61446, 61451, 61455, 61460, 61465, 61470, 61475, 61480,
+ 61485, 61490, 61495, 61500, 61504, 61510, 61516, 61522, 61528, 61534,
+ 61540, 61546, 61552, 61558, 61564, 61570, 61576, 61579, 61582, 61585,
+ 61590, 61593, 61596, 61599, 61602, 61605, 61608, 61612, 61616, 61620,
+ 61624, 61628, 61632, 61636, 61640, 61644, 61648, 61652, 61656, 61660,
+ 61663, 61666, 61670, 61674, 61678, 61682, 61685, 61689, 61693, 61697,
+ 61701, 61704, 61708, 61712, 61716, 61720, 61723, 61727, 61731, 61734,
+ 61738, 61742, 61746, 61750, 61754, 61758, 61762, 0, 61766, 61769, 61772,
+ 61775, 61778, 61781, 61784, 61787, 61790, 61793, 61796, 61799, 61802,
+ 61805, 61808, 61811, 61814, 61817, 61820, 61823, 61826, 61829, 61832,
+ 61835, 61838, 61841, 61844, 61847, 61850, 61853, 61856, 61859, 61862,
+ 61865, 61868, 61871, 61874, 61877, 61880, 61883, 61886, 61889, 61892,
+ 61895, 61898, 61901, 61904, 61907, 61910, 61913, 61916, 61919, 61922,
+ 61925, 61928, 61931, 61934, 61937, 61940, 61943, 61946, 61949, 61952,
+ 61955, 61958, 61961, 61964, 61967, 61970, 61973, 61976, 61979, 61982,
+ 61985, 61988, 61991, 61994, 61997, 62000, 62003, 62006, 62009, 62012,
+ 62015, 62018, 62021, 62024, 62027, 62030, 62038, 62045, 62052, 62059,
+ 62066, 62073, 62080, 62087, 62094, 62101, 62109, 62117, 62125, 62133,
+ 62141, 62149, 62157, 62165, 62173, 62181, 62189, 62197, 62205, 62213,
+ 62221, 62224, 62227, 62230, 62232, 62235, 62238, 62241, 62246, 62251,
+ 62254, 62261, 62268, 62275, 62282, 62285, 62290, 62292, 62296, 62298,
+ 62300, 62303, 62306, 62309, 62312, 62315, 62318, 62321, 62326, 62331,
+ 62334, 62337, 62340, 62343, 62346, 62349, 62352, 62356, 62359, 62362,
+ 62365, 62368, 62371, 62375, 62378, 62381, 62384, 62389, 62394, 62399,
+ 62404, 62409, 62414, 62419, 62424, 62429, 62437, 62439, 62442, 62445,
+ 62448, 62451, 62456, 62464, 62467, 62470, 62474, 62477, 62480, 62483,
+ 62488, 62491, 62494, 62499, 62502, 62505, 62510, 62513, 62516, 62521,
+ 62526, 62531, 62534, 62537, 62540, 62543, 62549, 62552, 62555, 62558,
+ 62560, 62563, 62566, 62569, 62574, 62577, 62580, 62583, 62586, 62589,
+ 62594, 62597, 62600, 62603, 62606, 62609, 62612, 62615, 62618, 62621,
+ 62626, 62630, 62637, 62644, 62651, 62658, 62665, 62672, 62679, 62686,
+ 62693, 62701, 62709, 62717, 62725, 62733, 62741, 62749, 62757, 62765,
+ 62773, 62781, 62789, 62797, 62805, 62813, 62821, 62829, 62837, 62845,
+ 62853, 62861, 62869, 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, 63869, 63873,
- 63877, 63881, 63885, 63889, 63893, 63897, 63901, 63905, 63909, 63913,
- 63917, 63921, 63925, 63929, 63933, 63937, 63941, 63945, 63949, 63953,
- 63957, 63961, 63965, 63969, 63973, 63977, 63981, 63985, 63989, 63993,
- 63997, 64001, 64005, 64009, 64013, 64016, 64020, 64024, 64028, 64032,
- 64036, 64040, 64044, 64048, 64052, 64056, 64060, 64064, 64068, 64072,
- 64076, 64080, 64084, 64088, 64092, 64096, 64100, 64104, 64108, 64112,
- 64116, 64120, 64124, 64128, 64132, 64136, 64140, 64144, 64148, 64152,
- 64156, 64160, 64163, 64167, 64171, 64174, 64178, 64182, 64186, 64189,
- 64193, 64197, 64201, 64205, 64209, 64213, 64217, 64221, 64225, 64229,
- 64233, 64237, 64241, 64245, 64248, 64252, 64256, 64260, 64264, 64268,
- 64272, 64276, 64280, 64284, 64287, 64290, 64294, 64298, 64302, 64305,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 62872, 62881, 62890, 62901, 62908, 62913, 62918, 62925, 62932, 62938,
+ 62943, 62948, 62953, 62958, 62965, 62970, 62975, 62980, 62991, 62996,
+ 63001, 63008, 63013, 63020, 63025, 63030, 63037, 63044, 63051, 63060,
+ 63069, 63074, 63079, 63084, 63091, 63096, 63106, 63113, 63118, 63123,
+ 63128, 63133, 63138, 63143, 63152, 63159, 63166, 63171, 63178, 63183,
+ 63190, 63199, 63210, 63215, 63224, 63229, 63236, 63245, 63254, 63259,
+ 63264, 63271, 63277, 63284, 63291, 63295, 63299, 63302, 63306, 63310,
+ 63314, 63318, 63322, 63326, 63330, 63333, 63337, 63341, 63345, 63349,
+ 63353, 63357, 63360, 63364, 63368, 63371, 63375, 63379, 63383, 63387,
+ 63391, 63395, 63399, 63403, 63407, 63411, 63415, 63419, 63423, 63427,
+ 63431, 63435, 63439, 63443, 63447, 63451, 63455, 63459, 63463, 63467,
+ 63471, 63475, 63479, 63483, 63487, 63491, 63495, 63499, 63503, 63507,
+ 63511, 63515, 63519, 63523, 63527, 63531, 63535, 63539, 63543, 63547,
+ 63550, 63554, 63558, 63562, 63566, 63570, 63574, 63578, 63582, 63586,
+ 63590, 63594, 63598, 63602, 63606, 63610, 63614, 63618, 63622, 63626,
+ 63630, 63634, 63638, 63642, 63646, 63650, 63654, 63658, 63662, 63666,
+ 63670, 63674, 63678, 63682, 63686, 63690, 63694, 63698, 63702, 63706,
+ 63710, 63714, 63718, 63722, 63726, 63730, 63734, 63738, 63742, 63746,
+ 63750, 63754, 63758, 63762, 63766, 63770, 63774, 63778, 63782, 63786,
+ 63790, 63794, 63798, 63802, 63806, 63810, 63814, 63818, 63822, 63826,
+ 63830, 63834, 63838, 63842, 63846, 63850, 63854, 63858, 63862, 63866,
+ 63870, 63874, 63878, 63882, 63886, 63890, 63894, 63898, 63902, 63906,
+ 63910, 63914, 63918, 63922, 63926, 63930, 63934, 63938, 63942, 63946,
+ 63950, 63954, 63958, 63962, 63966, 63970, 63974, 63978, 63982, 63986,
+ 63990, 63994, 63998, 64002, 64006, 64010, 64014, 64018, 64021, 64025,
+ 64029, 64033, 64037, 64041, 64045, 64049, 64053, 64057, 64061, 64065,
+ 64069, 64073, 64077, 64081, 64085, 64089, 64093, 64097, 64101, 64105,
+ 64109, 64113, 64117, 64121, 64125, 64129, 64133, 64137, 64141, 64145,
+ 64149, 64153, 64157, 64161, 64165, 64169, 64173, 64177, 64181, 64185,
+ 64189, 64193, 64197, 64201, 64205, 64209, 64213, 64217, 64221, 64225,
+ 64229, 64233, 64237, 64241, 64245, 64249, 64253, 64257, 64261, 64265,
+ 64269, 64273, 64277, 64281, 64285, 64289, 64293, 64297, 64301, 64305,
64309, 64313, 64317, 64321, 64325, 64329, 64333, 64337, 64341, 64345,
64349, 64353, 64357, 64361, 64365, 64369, 64373, 64377, 64381, 64385,
64389, 64393, 64397, 64401, 64405, 64409, 64413, 64417, 64421, 64425,
- 64429, 64433, 64437, 64441, 64445, 64449, 64453, 64457, 64460, 64464,
- 64468, 64472, 64476, 64480, 64484, 64488, 64492, 64496, 64500, 64504,
+ 64429, 64433, 64437, 64441, 64445, 64449, 64453, 64457, 64461, 64465,
+ 64469, 64473, 64477, 64481, 64484, 64488, 64492, 64496, 64500, 64504,
64508, 64512, 64516, 64520, 64524, 64528, 64532, 64536, 64540, 64544,
64548, 64552, 64556, 64560, 64564, 64568, 64572, 64576, 64580, 64584,
- 64588, 64592, 64596, 64600, 64604, 64607, 64611, 64615, 64619, 64623,
- 64627, 64631, 64635, 64639, 64643, 64647, 64651, 64655, 64659, 64663,
- 64667, 64671, 64674, 64678, 64682, 64686, 64690, 64694, 64698, 64702,
- 64706, 64710, 64714, 64718, 64722, 64726, 64730, 64734, 64738, 64742,
- 64746, 64750, 64754, 64758, 64761, 64765, 64769, 64773, 64777, 64781,
- 64785, 64789, 64793, 64797, 64801, 64805, 64809, 64813, 64817, 64821,
- 64825, 64829, 64833, 64837, 64841, 64845, 64849, 64853, 64857, 64861,
- 64865, 64869, 64873, 64877, 64881, 64885, 64889, 64893, 64897, 64901,
- 64905, 64909, 64913, 64917, 64921, 64925, 64929, 64933, 64936, 64941,
- 64945, 64951, 64956, 64962, 64966, 64970, 64974, 64978, 64982, 64986,
- 64990, 64994, 64998, 65002, 65006, 65010, 65014, 65018, 65021, 65024,
- 65027, 65030, 65033, 65036, 65039, 65042, 65045, 65050, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65056, 65061, 65066, 65071,
- 65076, 65082, 65088, 65093, 65098, 65103, 65108, 65115, 65122, 65129,
- 65136, 65143, 65150, 65160, 65170, 65177, 65184, 65190, 65196, 65202,
- 65208, 65217, 65226, 65233, 65240, 65251, 65262, 65267, 0, 0, 65272,
- 65279, 65286, 65293, 65300, 65307, 65314, 65320, 65326, 65332, 65338,
- 65345, 65352, 65357, 65361, 65368, 65375, 65382, 0, 0, 0, 0, 0, 0, 0, 0,
- 65386, 65390, 65394, 65397, 65400, 65405, 65410, 65415, 65420, 65425,
- 65430, 65435, 65440, 65445, 65450, 65459, 65468, 65473, 65478, 65483,
- 65488, 65493, 65498, 65503, 65508, 65513, 65518, 65523, 0, 0, 0, 0, 0, 0,
+ 64588, 64592, 64596, 64600, 64604, 64608, 64612, 64616, 64620, 64624,
+ 64628, 64632, 64636, 64640, 64644, 64648, 64652, 64656, 64660, 64664,
+ 64668, 64672, 64676, 64680, 64684, 64688, 64692, 64696, 64700, 64704,
+ 64708, 64712, 64716, 64720, 64724, 64728, 64732, 64736, 64740, 64744,
+ 64748, 64752, 64756, 64760, 64764, 64768, 64772, 64776, 64780, 64784,
+ 64788, 64792, 64796, 64800, 64804, 64808, 64812, 64816, 64820, 64824,
+ 64828, 64832, 64836, 64840, 64843, 64847, 64851, 64855, 64859, 64863,
+ 64867, 64871, 64875, 64879, 64883, 64887, 64891, 64895, 64899, 64903,
+ 64907, 64911, 64915, 64919, 64923, 64927, 64931, 64935, 64939, 64943,
+ 64947, 64951, 64955, 64959, 64963, 64967, 64971, 64975, 64979, 64983,
+ 64987, 64991, 64995, 64999, 65003, 65007, 65011, 65015, 65019, 65023,
+ 65027, 65031, 65035, 65039, 65043, 65047, 65051, 65055, 65059, 65063,
+ 65067, 65071, 65075, 65079, 65083, 65087, 65091, 65095, 65099, 65103,
+ 65107, 65111, 65115, 65119, 65123, 65127, 65131, 65135, 65139, 65143,
+ 65147, 65151, 65155, 65159, 65163, 65167, 65171, 65175, 65179, 65183,
+ 65187, 65191, 65195, 65199, 65203, 65207, 65211, 65215, 65219, 65223,
+ 65227, 65231, 65235, 65239, 65243, 65247, 65251, 65255, 65259, 65263,
+ 65267, 65271, 65275, 65279, 65283, 65287, 65291, 65295, 65299, 65303,
+ 65307, 65311, 65315, 65319, 65323, 65327, 65331, 65335, 65338, 65342,
+ 65346, 65350, 65354, 65358, 65362, 65366, 65370, 65374, 65378, 65382,
+ 65386, 65390, 65394, 65398, 65402, 65406, 65410, 65414, 65418, 65422,
+ 65426, 65430, 65434, 65438, 65442, 65446, 65450, 65454, 65458, 65462,
+ 65466, 65470, 65474, 65478, 65482, 65486, 65490, 65494, 65498, 65502,
+ 65506, 65510, 65514, 65518, 65522, 65526, 65530, 65534, 65538, 65542,
+ 65546, 65550, 65554, 65558, 65562, 65566, 65570, 65574, 65578, 65582,
+ 65586, 65590, 65594, 65598, 65602, 65606, 65610, 65614, 65618, 65622,
+ 65626, 65630, 65634, 65638, 65642, 65646, 65650, 65654, 65658, 65662,
+ 65666, 65670, 65674, 65678, 65682, 65686, 65690, 65694, 65698, 65702,
+ 65706, 65710, 65714, 65718, 65722, 65726, 65730, 65734, 65738, 65742,
+ 65746, 65750, 65754, 65758, 65762, 65766, 65770, 65774, 65778, 65782,
+ 65786, 65790, 65793, 65797, 65801, 65805, 65809, 65813, 65817, 65821,
+ 65825, 65829, 65833, 65837, 65841, 65845, 65849, 65853, 65857, 65861,
+ 65865, 65869, 65873, 65877, 65881, 65885, 65889, 65893, 65897, 65901,
+ 65905, 65909, 65913, 65917, 65921, 65925, 65929, 65933, 65937, 65941,
+ 65945, 65949, 65953, 65957, 65961, 65965, 65969, 65973, 65977, 65981,
+ 65985, 65989, 65993, 65997, 66001, 66005, 66009, 66013, 66017, 66021,
+ 66025, 66029, 66033, 66037, 66041, 66045, 66049, 66053, 66057, 66061,
+ 66065, 66069, 66073, 66077, 66081, 66085, 66089, 66093, 66097, 66101,
+ 66105, 66109, 66113, 66117, 66121, 66125, 66129, 66133, 66137, 66141,
+ 66145, 66149, 66153, 66157, 66161, 66165, 66169, 66173, 66177, 66181,
+ 66185, 66189, 66193, 66197, 66201, 66205, 66209, 66213, 66217, 66221,
+ 66225, 66229, 66233, 66237, 66241, 66245, 66249, 66253, 66257, 66261,
+ 66265, 66269, 66273, 66277, 66281, 66285, 66289, 66293, 66297, 66301,
+ 66305, 66309, 66313, 66317, 66321, 66325, 66329, 66333, 66337, 66341,
+ 66345, 66349, 66353, 66357, 66361, 66365, 66369, 66373, 66377, 66381,
+ 66385, 66389, 66393, 66396, 66400, 66404, 66408, 66412, 66416, 66420,
+ 66424, 66428, 66432, 66436, 66440, 66444, 66448, 66452, 66456, 66460,
+ 66464, 66468, 66472, 66476, 66480, 66484, 66488, 66492, 66496, 66500,
+ 66504, 66508, 66512, 66516, 66520, 66524, 66528, 66532, 66536, 66540,
+ 66544, 66548, 66552, 66556, 66560, 66564, 66568, 66572, 66576, 66580,
+ 66584, 66588, 66592, 66596, 66600, 66604, 66608, 66612, 66616, 66620,
+ 66624, 66628, 66632, 66636, 66640, 66644, 66648, 66652, 66656, 66660,
+ 66664, 66668, 66672, 66676, 66680, 66684, 66688, 66692, 66696, 66700,
+ 66704, 66708, 66712, 66716, 66720, 66724, 66728, 66732, 66736, 66740,
+ 66744, 66748, 66752, 66756, 66760, 66764, 66768, 66772, 66776, 66780,
+ 66784, 66788, 66792, 66796, 66800, 66804, 66808, 66812, 66816, 66820,
+ 66824, 66828, 66832, 66836, 66840, 66844, 66848, 66852, 66856, 66860,
+ 66864, 66868, 66872, 66876, 66880, 66884, 66888, 66892, 66896, 66900,
+ 66904, 66908, 66912, 66916, 66920, 66924, 66928, 66932, 66936, 66940,
+ 66944, 66948, 66952, 66956, 66960, 66964, 66968, 66972, 66976, 66980,
+ 66984, 66988, 66992, 66996, 67000, 67004, 67008, 67012, 67016, 67020,
+ 67024, 67028, 67032, 67036, 67040, 67044, 67048, 67052, 67056, 67060,
+ 67064, 67068, 67072, 67076, 67080, 67084, 67088, 67092, 67096, 67100,
+ 67104, 67108, 67112, 67116, 67120, 67124, 67128, 67132, 67136, 67140,
+ 67144, 67148, 67152, 67155, 67159, 67163, 67167, 67171, 67175, 67179,
+ 67183, 67187, 67191, 67195, 67199, 67203, 67207, 67211, 67215, 67219,
+ 67223, 67227, 67231, 67235, 67239, 67243, 67247, 67251, 67255, 67259,
+ 67263, 67267, 67271, 67275, 67279, 67283, 67287, 67291, 67295, 67299,
+ 67303, 67307, 67311, 67315, 67319, 67323, 67327, 67331, 67335, 67339,
+ 67343, 67347, 67351, 67355, 67359, 67363, 67367, 67371, 67375, 67379,
+ 67383, 67387, 67391, 67395, 67399, 67403, 67407, 67411, 67415, 67419,
+ 67423, 67427, 67431, 67435, 67439, 67443, 67447, 67451, 67455, 67459,
+ 67463, 67467, 67471, 67475, 67479, 67483, 67487, 67491, 67495, 67499,
+ 67503, 67507, 67511, 67515, 67519, 67523, 67527, 67531, 67535, 67539,
+ 67543, 67547, 67551, 67555, 67559, 67563, 67567, 67571, 67575, 67579,
+ 67583, 67587, 67591, 67595, 67599, 67603, 67607, 67611, 67615, 67619,
+ 67623, 67627, 67631, 67635, 67639, 67643, 67647, 67651, 67655, 67659,
+ 67663, 67667, 67671, 67675, 67679, 67683, 67687, 67691, 67695, 67699,
+ 67703, 67707, 67711, 67715, 67719, 67723, 67727, 67731, 67735, 67739,
+ 67743, 67747, 67751, 67755, 67759, 67763, 67767, 67771, 67775, 67779,
+ 67783, 67787, 67791, 67795, 67799, 67803, 67807, 67811, 67815, 67819,
+ 67823, 67827, 67831, 67835, 67839, 67843, 67847, 67851, 67855, 67859,
+ 67863, 67867, 67871, 67875, 67879, 67883, 67887, 67891, 67895, 67899,
+ 67903, 67907, 67911, 67915, 67919, 67923, 67927, 67931, 67935, 0, 0, 0,
+ 67939, 67943, 67947, 67951, 67955, 67959, 67963, 67967, 67971, 67975,
+ 67979, 67983, 67987, 67991, 67995, 67999, 68003, 68007, 68011, 68015,
+ 68019, 68023, 68027, 68031, 68035, 68039, 68043, 68047, 68051, 68055,
+ 68059, 68063, 68067, 68071, 68075, 68079, 68083, 68087, 68091, 68095,
+ 68099, 68103, 68107, 68111, 68115, 68119, 68123, 68127, 68131, 68135,
+ 68139, 68143, 68147, 68151, 68155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68159,
+ 68164, 68168, 68173, 68178, 68183, 68188, 68193, 68197, 68202, 68207,
+ 68212, 68217, 68222, 68227, 68232, 68236, 68240, 68245, 68250, 68255,
+ 68260, 68265, 68269, 68274, 68279, 68284, 68289, 68294, 68298, 68303,
+ 68307, 68312, 68316, 68321, 68325, 68329, 68333, 68338, 68343, 68348,
+ 68356, 68364, 68372, 68380, 68387, 68395, 68401, 68409, 68413, 68417,
+ 68421, 68425, 68429, 68433, 68437, 68441, 68445, 68449, 68453, 68457,
+ 68461, 68465, 68469, 68473, 68477, 68481, 68485, 68489, 68493, 68497,
+ 68501, 68505, 68509, 68513, 68517, 68521, 68525, 68529, 68533, 68537,
+ 68541, 68545, 68549, 68553, 68556, 68560, 68564, 68568, 68572, 68576,
+ 68580, 68584, 68588, 68592, 68596, 68600, 68604, 68608, 68612, 68616,
+ 68620, 68624, 68628, 68632, 68636, 68640, 68644, 68648, 68652, 68656,
+ 68660, 68664, 68668, 68672, 68676, 68680, 68684, 68688, 68692, 68696,
+ 68700, 68703, 68707, 68711, 68714, 68718, 68722, 68726, 68729, 68733,
+ 68737, 68741, 68745, 68749, 68753, 68757, 68761, 68765, 68769, 68773,
+ 68777, 68781, 68785, 68788, 68792, 68796, 68800, 68804, 68808, 68812,
+ 68816, 68820, 68824, 68827, 68830, 68834, 68838, 68842, 68845, 68848,
+ 68852, 68856, 68860, 68864, 68868, 68872, 68876, 68880, 68884, 68888,
+ 68892, 68896, 68900, 68904, 68908, 68912, 68916, 68920, 68924, 68928,
+ 68932, 68936, 68940, 68944, 68948, 68952, 68956, 68960, 68964, 68968,
+ 68972, 68976, 68980, 68984, 68988, 68992, 68996, 68999, 69003, 69007,
+ 69011, 69015, 69019, 69023, 69027, 69031, 69035, 69039, 69043, 69047,
+ 69051, 69055, 69059, 69063, 69067, 69071, 69075, 69079, 69083, 69087,
+ 69091, 69095, 69099, 69103, 69107, 69111, 69115, 69119, 69123, 69127,
+ 69131, 69135, 69139, 69143, 69146, 69150, 69154, 69158, 69162, 69166,
+ 69170, 69174, 69178, 69182, 69186, 69190, 69194, 69198, 69202, 69206,
+ 69210, 69213, 69217, 69221, 69225, 69229, 69233, 69237, 69241, 69245,
+ 69249, 69253, 69257, 69261, 69265, 69269, 69273, 69277, 69281, 69285,
+ 69289, 69293, 69297, 69300, 69304, 69308, 69312, 69316, 69320, 69324,
+ 69328, 69332, 69336, 69340, 69344, 69348, 69352, 69356, 69360, 69364,
+ 69368, 69372, 69376, 69380, 69384, 69388, 69392, 69396, 69400, 69404,
+ 69408, 69412, 69416, 69420, 69424, 69428, 69432, 69436, 69440, 69444,
+ 69448, 69452, 69456, 69460, 69464, 69468, 69472, 69475, 69480, 69484,
+ 69490, 69495, 69501, 69505, 69509, 69513, 69517, 69521, 69525, 69529,
+ 69533, 69537, 69541, 69545, 69549, 69553, 69557, 69560, 69563, 69566,
+ 69569, 69572, 69575, 69578, 69581, 69584, 69589, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69595, 69600, 69605, 69610, 69615,
+ 69622, 69629, 69634, 69639, 69644, 69649, 69656, 69663, 69670, 69677,
+ 69684, 69691, 69701, 69711, 69718, 69725, 69732, 69739, 69745, 69751,
+ 69760, 69769, 69776, 69783, 69794, 69805, 69810, 69815, 69822, 69829,
+ 69836, 69843, 69850, 69857, 69864, 69871, 69877, 69883, 69889, 69895,
+ 69902, 69909, 69914, 69918, 69925, 69932, 69939, 0, 0, 0, 0, 0, 0, 0, 0,
+ 69943, 69947, 69951, 69954, 69957, 69962, 69967, 69972, 69977, 69982,
+ 69987, 69992, 69997, 70002, 70007, 70016, 70025, 70030, 70035, 70040,
+ 70045, 70050, 70055, 70060, 70065, 70070, 70075, 70080, 0, 0, 0, 0, 0, 0,
+ 0, 0, 70085, 70088, 70091, 70094, 70098, 70102, 70106, 70110, 70113,
+ 70117, 70120, 70124, 70127, 70131, 70135, 70139, 70143, 70147, 70151,
+ 70155, 70158, 70162, 70166, 70170, 70174, 70178, 70182, 70186, 70190,
+ 70194, 70198, 70202, 70206, 70210, 70214, 70217, 70221, 70225, 70229,
+ 70233, 70237, 70241, 70245, 70249, 70253, 70257, 70261, 70265, 70269,
+ 70273, 70277, 70281, 70285, 70289, 70293, 70297, 70301, 70305, 70309,
+ 70313, 70316, 70320, 70324, 70328, 70332, 70336, 70340, 70344, 70347,
+ 70351, 70355, 70359, 70363, 70367, 70371, 70375, 70379, 70383, 70387,
+ 70391, 70395, 70400, 70405, 70408, 70413, 70416, 70419, 70422, 0, 0, 0,
+ 0, 0, 0, 0, 0, 70426, 70435, 70444, 70453, 70462, 70471, 70480, 70489,
+ 70498, 70506, 70513, 70521, 70528, 70536, 70546, 70555, 70565, 70574,
+ 70584, 70592, 70599, 70607, 70614, 70622, 70627, 70632, 70637, 70646,
+ 70652, 70658, 70665, 70674, 70682, 70690, 70698, 70705, 70712, 70719,
+ 70726, 70731, 70736, 70741, 70746, 70751, 70756, 70761, 70766, 70774,
+ 70782, 70788, 70793, 70798, 70803, 70808, 70813, 70818, 70823, 70828,
+ 70833, 70841, 70849, 70854, 70859, 70869, 70879, 70886, 70893, 70902,
+ 70911, 70923, 70935, 70941, 70947, 70955, 70963, 70973, 70983, 70990,
+ 70997, 71002, 71007, 71019, 71031, 71039, 71047, 71057, 71067, 71079,
+ 71091, 71100, 71109, 71116, 71123, 71130, 71137, 71146, 71155, 71160,
+ 71165, 71172, 71179, 71186, 71193, 71205, 71217, 71222, 71227, 71232,
+ 71237, 71242, 71247, 71252, 71257, 71261, 71266, 71271, 71276, 71281,
+ 71286, 71292, 71297, 71302, 71309, 71316, 71323, 71330, 71337, 71346,
+ 71355, 71361, 71367, 71373, 71379, 71385, 71391, 71398, 71405, 71412,
+ 71416, 71423, 71428, 71433, 71440, 0, 71453, 71461, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 71469, 71478, 71487, 71496, 71505, 71514, 71523,
+ 71532, 71541, 71550, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71559, 71566, 71574, 71582,
+ 71589, 71597, 71604, 71610, 71616, 71623, 71629, 71635, 71641, 71648,
+ 71655, 71662, 71669, 71676, 71683, 71690, 71697, 71704, 71711, 71718,
+ 71725, 71732, 71739, 71745, 71752, 71759, 71766, 71773, 71780, 71787,
+ 71794, 71801, 71808, 71815, 71822, 71829, 71836, 71843, 71850, 71857,
+ 71864, 71871, 71879, 71887, 71895, 71903, 0, 0, 0, 0, 71911, 71920,
+ 71929, 71938, 71947, 71956, 71965, 71972, 71979, 71986, 0, 0, 0, 0, 0, 0,
+ 71993, 71997, 72002, 72007, 72012, 72017, 72022, 72027, 72032, 72037,
+ 72042, 72047, 72051, 72055, 72060, 72065, 72069, 72074, 72079, 72084,
+ 72089, 72094, 72099, 72104, 72108, 72112, 72117, 72122, 72127, 72131,
+ 72135, 72139, 72143, 72147, 72151, 72156, 72161, 72166, 72171, 72176,
+ 72183, 72189, 72194, 72199, 72204, 72209, 72215, 72222, 72228, 72235,
+ 72241, 72247, 72252, 72259, 72265, 72270, 0, 0, 0, 0, 0, 0, 0, 0, 72276,
+ 72280, 72284, 72287, 72291, 72294, 72298, 72301, 72305, 72309, 72314,
+ 72318, 72323, 72326, 72330, 72334, 72337, 72341, 72345, 72348, 72352,
+ 72356, 72360, 72364, 72368, 72372, 72376, 72380, 72384, 72388, 72392,
+ 72396, 72400, 72404, 72408, 72412, 72416, 72420, 72423, 72426, 72430,
+ 72434, 72438, 72441, 72444, 72447, 72451, 72455, 72459, 72463, 72467,
+ 72470, 72474, 72480, 72485, 72489, 72494, 72498, 72503, 72508, 72514,
+ 72519, 72525, 72529, 72534, 72539, 72543, 72548, 72553, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 72557, 72560, 72564, 72568, 72571, 72574, 72577, 72580, 72583,
+ 72586, 72589, 72592, 0, 0, 0, 0, 0, 0, 72595, 72600, 72604, 72608, 72612,
+ 72616, 72620, 72624, 72628, 72632, 72636, 72640, 72644, 72648, 72652,
+ 72656, 72660, 72665, 72670, 72676, 72682, 72689, 72694, 72699, 72705,
+ 72709, 72714, 72717, 0, 0, 0, 0, 72720, 72727, 72733, 72739, 72745,
+ 72751, 72757, 72763, 72769, 72775, 72781, 72787, 72794, 72801, 72808,
+ 72815, 72822, 72829, 72836, 72843, 72850, 72856, 72862, 72869, 72875,
+ 72882, 72889, 72895, 72901, 72908, 72915, 72922, 72928, 72935, 72942,
+ 72948, 72955, 72961, 72968, 72975, 72981, 72987, 72994, 73000, 73007,
+ 73014, 73023, 73030, 73037, 73041, 73046, 73051, 73056, 73061, 73065,
+ 73069, 73074, 73078, 73083, 73088, 73093, 73098, 73102, 73107, 73111,
+ 73116, 73120, 73125, 73130, 73135, 73140, 73144, 73149, 73154, 73159,
+ 73165, 73170, 73176, 73182, 73188, 73195, 73201, 73207, 73214, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 73218, 73223, 73227, 73231, 73235, 73239, 73243,
+ 73247, 73251, 73255, 73259, 73263, 73267, 73271, 73275, 73279, 73283,
+ 73287, 73291, 73295, 73299, 73303, 73307, 73311, 73315, 73319, 73323,
+ 73327, 73331, 73335, 0, 0, 0, 73339, 73343, 73347, 73351, 73355, 73358,
+ 73364, 73367, 73371, 73374, 73380, 73386, 73394, 73397, 73401, 73404,
+ 73407, 73413, 73419, 73423, 73429, 73433, 73437, 73443, 73447, 73453,
+ 73459, 73463, 73467, 73473, 73477, 73483, 73489, 73493, 73499, 73503,
+ 73509, 73512, 73515, 73521, 73525, 73531, 73534, 73537, 73540, 73546,
+ 73550, 73554, 73560, 73566, 73570, 73573, 73579, 73584, 73589, 73594,
+ 73601, 73606, 73613, 73618, 73625, 73630, 73636, 73642, 73648, 73651,
+ 73655, 73659, 73664, 73669, 73674, 73679, 73684, 73689, 73694, 73699,
+ 73706, 73711, 0, 73718, 73721, 73725, 73728, 73731, 73734, 73737, 73740,
+ 73743, 73746, 73749, 0, 0, 0, 0, 73752, 73759, 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,
+ 73764, 73767, 73770, 73773, 73776, 73780, 73783, 73786, 73790, 73794,
+ 73798, 73802, 73806, 73810, 73814, 73818, 73822, 73826, 73830, 73834,
+ 73838, 73842, 73846, 73850, 73854, 73857, 73861, 73864, 73868, 73872,
+ 73876, 73880, 73884, 73887, 73891, 73894, 73897, 73901, 73905, 73909,
+ 73913, 73916, 73921, 73925, 73930, 73935, 73939, 73944, 73948, 73953,
+ 73958, 73963, 73968, 73973, 73979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73985,
+ 73990, 73995, 74000, 74007, 74012, 74017, 74021, 74026, 74031, 74035,
+ 74039, 74044, 74050, 0, 0, 74057, 74061, 74064, 74067, 74070, 74073,
+ 74076, 74079, 74082, 74085, 0, 0, 74088, 74093, 74098, 74104, 74111,
+ 74117, 74123, 74129, 74135, 74141, 74147, 74153, 74159, 74165, 74171,
+ 74177, 74182, 74188, 74193, 74199, 74205, 74212, 74218, 74224, 74229,
+ 74236, 74243, 74250, 74256, 74261, 74266, 74271, 0, 0, 0, 0, 74279,
+ 74285, 74291, 74297, 74303, 74309, 74315, 74321, 74327, 74333, 74339,
+ 74345, 74351, 74357, 74363, 74369, 74375, 74381, 74387, 74393, 74399,
+ 74404, 74409, 74415, 74421, 74427, 74433, 74439, 74445, 74451, 74457,
+ 74463, 74469, 74475, 74481, 74487, 74493, 74499, 74505, 74511, 74517,
+ 74523, 74529, 74535, 74541, 74547, 74553, 74558, 74563, 74569, 74574,
+ 74578, 74583, 74587, 74591, 74595, 74601, 74606, 74611, 74616, 74621,
+ 74626, 74631, 74636, 74643, 74650, 74657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74664, 74669, 74674, 74679,
+ 74686, 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, 74693, 74697, 74701, 74705, 74709,
+ 74713, 0, 0, 74717, 74721, 74725, 74729, 74733, 74737, 0, 0, 74741,
+ 74745, 74749, 74753, 74757, 74761, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74765,
+ 74769, 74773, 74777, 74781, 74785, 74789, 0, 74793, 74797, 74801, 74805,
+ 74809, 74813, 74817, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 74821, 74828, 74835, 74842, 74849, 74855, 74861,
+ 74868, 74875, 74882, 74889, 74896, 74903, 74910, 74917, 74924, 74930,
+ 74937, 74944, 74951, 74958, 74965, 74972, 74979, 74986, 74993, 75000,
+ 75007, 75016, 75025, 75034, 75043, 75052, 75061, 75070, 75079, 75087,
+ 75095, 75103, 75111, 75119, 75127, 75135, 75143, 75149, 75157, 0, 0,
+ 75165, 75172, 75178, 75184, 75190, 75196, 75202, 75208, 75214, 75220, 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, 75226, 75230, 75234, 75238, 75242, 75246, 75250, 75254,
+ 75258, 75262, 75266, 75270, 75274, 75278, 75282, 75286, 75290, 75294,
+ 75298, 75302, 75306, 75310, 75314, 0, 0, 0, 0, 75318, 75322, 75326,
+ 75330, 75334, 75338, 75342, 75346, 75350, 75354, 75358, 75362, 75366,
+ 75370, 75374, 75378, 75382, 75386, 75390, 75394, 75398, 75402, 75406,
+ 75410, 75414, 75418, 75422, 75426, 75430, 75434, 75438, 75442, 75446,
+ 75450, 75454, 75458, 75462, 75466, 75470, 75474, 75478, 75482, 75486,
+ 75490, 75494, 75498, 75502, 75506, 75510, 0, 0, 0, 0, 75514, 75518,
+ 75522, 75526, 75530, 75534, 75538, 75542, 75546, 75550, 75554, 75558,
+ 75562, 75566, 75570, 75574, 75578, 75582, 75586, 75590, 75594, 75598,
+ 75602, 75606, 75610, 75614, 75618, 75622, 75626, 75630, 75634, 75638,
+ 75642, 75646, 75650, 75654, 75658, 75662, 75666, 75670, 75674, 75678,
+ 75682, 75686, 75690, 75694, 75698, 75702, 75706, 75710, 75714, 75718,
+ 75722, 75726, 75730, 75734, 75738, 75742, 75746, 75750, 75754, 75758,
+ 75762, 75766, 75770, 75774, 75778, 75782, 75786, 75790, 75794, 75798,
+ 75802, 75806, 75810, 75814, 75818, 75822, 75826, 75830, 75834, 75838,
+ 75842, 75846, 75850, 75854, 75858, 75862, 75866, 75870, 75874, 75878,
+ 75882, 75886, 75890, 75894, 75898, 75902, 75906, 75910, 75914, 75918,
+ 75922, 75926, 75930, 75934, 75938, 75942, 75946, 75950, 75954, 75958,
+ 75962, 75966, 75970, 75974, 75978, 75982, 75986, 75990, 75994, 75998,
+ 76002, 76006, 76010, 76014, 76018, 76022, 76026, 76030, 76034, 76038,
+ 76042, 76046, 76050, 76054, 76058, 76062, 76066, 76070, 76074, 76078,
+ 76082, 76086, 76090, 76094, 76098, 76102, 76106, 76110, 76114, 76118,
+ 76122, 76126, 76130, 76134, 76138, 76142, 76146, 76150, 76154, 76158,
+ 76162, 76166, 76170, 76174, 76178, 76182, 76186, 76190, 76194, 76198,
+ 76202, 76206, 76210, 76214, 76218, 76222, 76226, 76230, 76234, 76238,
+ 76242, 76246, 76250, 76254, 76258, 76262, 76266, 76270, 76274, 76278,
+ 76282, 76286, 76290, 76294, 76298, 76302, 76306, 76310, 76314, 76318,
+ 76322, 76326, 76330, 76334, 76338, 76342, 76346, 76350, 76354, 76358,
+ 76362, 76366, 76370, 76374, 76378, 76382, 76386, 76390, 76394, 76398,
+ 76402, 76406, 76410, 76414, 76418, 76422, 76426, 76430, 76434, 76438,
+ 76442, 76446, 76450, 76454, 76458, 76462, 76466, 76470, 76474, 76478,
+ 76482, 76486, 76490, 76494, 76498, 76502, 76506, 76510, 76514, 76518,
+ 76522, 76526, 76530, 76534, 76538, 76542, 76546, 76550, 76554, 76558,
+ 76562, 76566, 76570, 76574, 76578, 76582, 76586, 76590, 76594, 76598,
+ 76602, 76606, 76610, 76614, 76618, 76622, 76626, 76630, 76634, 76638,
+ 76642, 76646, 76650, 76654, 76658, 76662, 76666, 76670, 76674, 76678,
+ 76682, 76686, 76690, 76694, 76698, 76702, 76706, 76710, 76714, 76718, 0,
+ 0, 76722, 76726, 76730, 76734, 76738, 76742, 76746, 76750, 76754, 76758,
+ 76762, 76766, 76770, 76774, 76778, 76782, 76786, 76790, 76794, 76798,
+ 76802, 76806, 76810, 76814, 76818, 76822, 76826, 76830, 76834, 76838,
+ 76842, 76846, 76850, 76854, 76858, 76862, 76866, 76870, 76874, 76878,
+ 76882, 76886, 76890, 76894, 76898, 76902, 76906, 76910, 76914, 76918,
+ 76922, 76926, 76930, 76934, 76938, 76942, 76946, 76950, 76954, 76958,
+ 76962, 76966, 0, 0, 76970, 76974, 76978, 76982, 76986, 76990, 76994,
+ 76998, 77002, 77006, 77010, 77014, 77018, 77022, 77026, 77030, 77034,
+ 77038, 77042, 77046, 77050, 77054, 77058, 77062, 77066, 77070, 77074,
+ 77078, 77082, 77086, 77090, 77094, 77098, 77102, 77106, 77110, 77114,
+ 77118, 77122, 77126, 77130, 77134, 77138, 77142, 77146, 77150, 77154,
+ 77158, 77162, 77166, 77170, 77174, 77178, 77182, 77186, 77190, 77194,
+ 77198, 77202, 77206, 77210, 77214, 77218, 77222, 77226, 77230, 77234,
+ 77238, 77242, 77246, 77250, 77254, 77258, 77262, 77266, 77270, 77274,
+ 77278, 77282, 77286, 77290, 77294, 77298, 77302, 77306, 77310, 77314,
+ 77318, 77322, 77326, 77330, 77334, 77338, 77342, 77346, 77350, 77354,
+ 77358, 77362, 77366, 77370, 77374, 77378, 77382, 77386, 77390, 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, 77394, 77399, 77404, 77409, 77414,
+ 77419, 77427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77432, 77439, 77446,
+ 77453, 77460, 0, 0, 0, 0, 0, 77467, 77474, 77481, 77491, 77497, 77503,
+ 77509, 77515, 77521, 77527, 77534, 77540, 77546, 77552, 77561, 77570,
+ 77582, 77594, 77600, 77606, 77612, 77619, 77626, 77633, 77640, 77647, 0,
+ 77654, 77661, 77668, 77676, 77683, 0, 77690, 0, 77697, 77704, 0, 77711,
+ 77719, 0, 77726, 77733, 77740, 77747, 77754, 77761, 77768, 77775, 77782,
+ 77789, 77794, 77801, 77808, 77814, 77820, 77826, 77832, 77838, 77844,
+ 77850, 77856, 77862, 77868, 77874, 77880, 77886, 77892, 77898, 77904,
+ 77910, 77916, 77922, 77928, 77934, 77940, 77946, 77952, 77958, 77964,
+ 77970, 77976, 77982, 77988, 77994, 78000, 78006, 78012, 78018, 78024,
+ 78030, 78036, 78042, 78048, 78054, 78060, 78066, 78072, 78078, 78084,
+ 78090, 78096, 78102, 78108, 78114, 78120, 78126, 78132, 78138, 78144,
+ 78150, 78156, 78162, 78168, 78174, 78180, 78186, 78192, 78198, 78204,
+ 78210, 78216, 78222, 78228, 78234, 78240, 78246, 78252, 78258, 78264,
+ 78272, 78280, 78286, 78292, 78298, 78304, 78313, 78322, 78330, 78338,
+ 78346, 78354, 78362, 78370, 78378, 78386, 78393, 78400, 78410, 78420,
+ 78424, 78428, 78433, 78438, 78443, 78448, 78457, 78466, 78472, 78478,
+ 78485, 78492, 78499, 78503, 78509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 78515, 78521, 78527, 78533, 78539, 78544, 78549, 78555,
+ 78561, 78567, 78573, 78581, 78587, 78593, 78601, 78609, 78617, 78625,
+ 78630, 78635, 78640, 78645, 78657, 78669, 78679, 78689, 78700, 78711,
+ 78722, 78733, 78743, 78753, 78764, 78775, 78786, 78797, 78807, 78817,
+ 78827, 78842, 78857, 78872, 78879, 78886, 78893, 78900, 78910, 78920,
+ 78930, 78941, 78951, 78959, 78967, 78976, 78984, 78993, 79001, 79009,
+ 79017, 79026, 79034, 79043, 79051, 79059, 79067, 79076, 79084, 79091,
+ 79098, 79105, 79112, 79120, 79128, 79136, 79144, 79152, 79161, 79169,
+ 79177, 79185, 79193, 79201, 79210, 79218, 79226, 79234, 79242, 79250,
+ 79258, 79266, 79274, 79282, 79290, 79299, 79307, 79316, 79324, 79332,
+ 79340, 79349, 79357, 79365, 79373, 79381, 79390, 79399, 79407, 79416,
+ 79424, 79432, 79440, 79449, 79457, 79466, 79474, 79481, 79488, 79496,
+ 79503, 79511, 79518, 79526, 79534, 79543, 79551, 79560, 79568, 79576,
+ 79584, 79593, 79601, 79608, 79615, 79623, 79630, 79638, 79645, 79655,
+ 79665, 79675, 79684, 79693, 79702, 79711, 79720, 79730, 79741, 79752,
+ 79762, 79773, 79784, 79794, 79803, 79812, 79820, 79829, 79838, 79846,
+ 79855, 79864, 79872, 79881, 79890, 79898, 79907, 79916, 79924, 79933,
+ 79942, 79950, 79959, 79967, 79976, 79984, 79992, 80001, 80009, 80018,
+ 80026, 80034, 80043, 80051, 80058, 80065, 80074, 80083, 80091, 80100,
+ 80109, 80117, 80127, 80135, 80143, 80150, 80158, 80166, 80173, 80183,
+ 80193, 80204, 80214, 80225, 80233, 80241, 80250, 80258, 80267, 80275,
+ 80283, 80292, 80300, 80309, 80317, 80324, 80331, 80338, 80345, 80353,
+ 80361, 80369, 80377, 80386, 80394, 80402, 80411, 80419, 80427, 80435,
+ 80444, 80452, 80460, 80468, 80476, 80484, 80492, 80500, 80508, 80516,
+ 80525, 80533, 80541, 80549, 80557, 80565, 80574, 80583, 80591, 80599,
+ 80607, 80616, 80624, 80633, 80640, 80647, 80655, 80662, 80670, 80678,
+ 80687, 80695, 80704, 80712, 80720, 80730, 80737, 80744, 80752, 80759,
+ 80767, 80777, 80788, 80796, 80805, 80813, 80822, 80830, 80839, 80847,
+ 80856, 80864, 80873, 80882, 80890, 80898, 80906, 80915, 80922, 80930,
+ 80939, 80948, 80957, 80966, 80974, 80983, 80991, 81000, 81008, 81017,
+ 81025, 81034, 81042, 81050, 81057, 81065, 81072, 81081, 81089, 81098,
+ 81106, 81115, 81123, 81131, 81139, 81148, 81156, 81165, 81174, 81183,
+ 81192, 81201, 81209, 81218, 81226, 81235, 81243, 81252, 81260, 81269,
+ 81277, 81285, 81292, 81300, 81307, 81316, 81324, 81333, 81341, 81350,
+ 81358, 81366, 81374, 81383, 81391, 81400, 81409, 81418, 81427, 81435,
+ 81443, 81452, 81460, 81469, 81478, 81486, 81494, 81502, 81511, 81519,
+ 81527, 81536, 81544, 81552, 81560, 81568, 81573, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 81578, 81588, 81598, 81608, 81618, 81629, 81639,
+ 81649, 81660, 81669, 81678, 81687, 81697, 81707, 81717, 81728, 81738,
+ 81748, 81758, 81768, 81778, 81788, 81798, 81808, 81818, 81828, 81838,
+ 81849, 81860, 81870, 81880, 81891, 81902, 81913, 81923, 81933, 81943,
+ 81953, 81963, 81973, 81983, 81994, 82004, 82014, 82025, 82036, 82047,
+ 82057, 82067, 82077, 82087, 82098, 82108, 82118, 82129, 82140, 82150,
+ 82160, 82169, 82178, 82187, 82196, 82205, 82215, 0, 0, 82225, 82235,
+ 82245, 82255, 82265, 82276, 82286, 82296, 82307, 82317, 82328, 82337,
+ 82346, 82357, 82367, 82378, 82389, 82401, 82411, 82422, 82431, 82441,
+ 82451, 82463, 82473, 82483, 82493, 82503, 82513, 82522, 82531, 82540,
+ 82549, 82559, 82569, 82579, 82589, 82599, 82609, 82619, 82629, 82639,
+ 82649, 82659, 82669, 82678, 82687, 82696, 82706, 82716, 82726, 82736,
+ 82746, 82757, 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, 82767, 82782,
+ 82797, 82803, 82809, 82815, 82821, 82827, 82833, 82839, 82845, 82853,
+ 82857, 82860, 0, 0, 82868, 82871, 82874, 82877, 82880, 82883, 82886,
+ 82889, 82892, 82895, 82898, 82901, 82904, 82907, 82910, 82913, 82916,
+ 82924, 82933, 82944, 82952, 82960, 82969, 82978, 82989, 83001, 0, 0, 0,
+ 0, 0, 0, 83010, 83015, 83020, 83027, 83034, 83040, 83046, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 83051, 83061, 83071, 83081, 83090, 83101, 83110, 83119,
+ 83129, 83139, 83151, 83163, 83174, 83185, 83196, 83207, 83217, 83227,
+ 83237, 83247, 83258, 83269, 83273, 83278, 83287, 83296, 83300, 83304,
+ 83308, 83313, 83318, 83323, 83328, 83331, 83335, 0, 83340, 83343, 83346,
+ 83350, 83354, 83359, 83363, 83367, 83372, 83377, 83384, 83391, 83394,
+ 83397, 83400, 83403, 83406, 83410, 83414, 0, 83418, 83423, 83427, 83431,
+ 0, 0, 0, 0, 83436, 83441, 83448, 83453, 83458, 0, 83463, 83468, 83473,
+ 83478, 83483, 83488, 83493, 83498, 83503, 83508, 83513, 83518, 83527,
+ 83536, 83544, 83552, 83561, 83570, 83579, 83588, 83596, 83604, 83612,
+ 83620, 83625, 83630, 83636, 83642, 83648, 83654, 83662, 83670, 83676,
+ 83682, 83688, 83694, 83700, 83706, 83712, 83718, 83723, 83728, 83733,
+ 83738, 83743, 83748, 83753, 83758, 83764, 83770, 83776, 83782, 83788,
+ 83794, 83800, 83806, 83812, 83818, 83824, 83830, 83836, 83842, 83848,
+ 83854, 83860, 83866, 83872, 83878, 83884, 83890, 83896, 83902, 83908,
+ 83914, 83920, 83926, 83932, 83938, 83944, 83950, 83956, 83962, 83968,
+ 83974, 83980, 83986, 83992, 83998, 84004, 84010, 84016, 84022, 84028,
+ 84034, 84040, 84046, 84052, 84058, 84064, 84070, 84076, 84082, 84088,
+ 84094, 84100, 84106, 84112, 84118, 84123, 84128, 84133, 84138, 84144,
+ 84150, 84156, 84162, 84168, 84174, 84180, 84186, 84192, 84198, 84204,
+ 84210, 84215, 84220, 84225, 84230, 84242, 84254, 84265, 84276, 84288,
+ 84300, 84308, 0, 0, 84316, 0, 84324, 84328, 84332, 84335, 84339, 84343,
+ 84346, 84349, 84353, 84357, 84360, 84363, 84366, 84369, 84374, 84377,
+ 84381, 84384, 84387, 84390, 84393, 84396, 84399, 84402, 84405, 84408,
+ 84411, 84414, 84418, 84422, 84426, 84430, 84435, 84440, 84446, 84452,
+ 84458, 84463, 84469, 84475, 84481, 84486, 84492, 84498, 84503, 84508,
+ 84513, 84518, 84524, 84530, 84535, 84540, 84546, 84551, 84557, 84563,
+ 84569, 84575, 84581, 84585, 84590, 84594, 84599, 84603, 84608, 84613,
+ 84619, 84625, 84631, 84636, 84642, 84648, 84654, 84659, 84665, 84671,
+ 84676, 84681, 84686, 84691, 84697, 84703, 84708, 84713, 84719, 84724,
+ 84730, 84736, 84742, 84748, 84754, 84759, 84763, 84768, 84771, 84776,
+ 84781, 84787, 84792, 84797, 84801, 84807, 84812, 84817, 84822, 84827,
+ 84832, 84837, 84842, 84848, 84854, 84860, 84868, 84872, 84876, 84880,
+ 84884, 84888, 84892, 84897, 84902, 84907, 84912, 84917, 84922, 84927,
+ 84932, 84937, 84942, 84947, 84952, 84957, 84961, 84965, 84970, 84975,
+ 84980, 84985, 84989, 84994, 84999, 85004, 85009, 85013, 85018, 85023,
+ 85028, 85033, 85037, 85042, 85047, 85051, 85056, 85061, 85066, 85071,
+ 85076, 85080, 85087, 85094, 85098, 85103, 85108, 85113, 85118, 85123,
+ 85128, 85133, 85138, 85143, 85148, 85153, 85158, 85163, 85168, 85173,
+ 85178, 85183, 85188, 85193, 85198, 85203, 85208, 85213, 85218, 85223,
+ 85228, 85233, 85238, 85243, 0, 0, 0, 85248, 85252, 85257, 85261, 85266,
+ 85271, 0, 0, 85275, 85280, 85285, 85289, 85294, 85299, 0, 0, 85304,
+ 85309, 85313, 85318, 85323, 85328, 0, 0, 85333, 85338, 85343, 0, 0, 0,
+ 85347, 85351, 85355, 85359, 85362, 85366, 85370, 0, 85374, 85380, 85383,
+ 85387, 85390, 85394, 85398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85402, 85408,
+ 85414, 85420, 85426, 0, 0, 85430, 85436, 85442, 85448, 85454, 85460,
+ 85467, 85474, 85481, 85488, 85495, 85502, 0, 85509, 85516, 85523, 85529,
+ 85536, 85543, 85550, 85557, 85563, 85570, 85577, 85584, 85591, 85597,
+ 85604, 85611, 85618, 85625, 85631, 85638, 85645, 85652, 85659, 85666,
+ 85673, 85680, 0, 85687, 85693, 85700, 85707, 85714, 85721, 85728, 85735,
+ 85742, 85749, 85756, 85763, 85770, 85777, 85783, 85790, 85797, 85804,
+ 85811, 0, 85818, 85825, 0, 85832, 85839, 85846, 85853, 85860, 85867,
+ 85874, 85881, 85888, 85895, 85902, 85909, 85916, 85923, 85930, 0, 0,
+ 85936, 85941, 85946, 85951, 85956, 85961, 85966, 85971, 85976, 85981,
+ 85986, 85991, 85996, 86001, 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, 86006, 86013,
+ 86020, 86027, 86034, 86041, 86048, 86055, 86062, 86069, 86076, 86083,
+ 86090, 86097, 86104, 86111, 86118, 86125, 86132, 86139, 86147, 86155,
+ 86162, 86169, 86174, 86182, 86190, 86197, 86204, 86209, 86216, 86221,
+ 86226, 86233, 86238, 86243, 86248, 86256, 86261, 86266, 86273, 86278,
+ 86283, 86290, 86297, 86302, 86307, 86312, 86317, 86322, 86327, 86332,
+ 86337, 86342, 86349, 86354, 86361, 86366, 86371, 86376, 86381, 86386,
+ 86391, 86396, 86401, 86406, 86411, 86416, 86423, 86430, 86437, 86444,
+ 86450, 86455, 86462, 86467, 86472, 86481, 86488, 86497, 86504, 86509,
+ 86514, 86522, 86527, 86532, 86537, 86542, 86547, 86554, 86559, 86564,
+ 86569, 86574, 86579, 86586, 86593, 86600, 86607, 86614, 86621, 86628,
+ 86635, 86642, 86649, 86656, 86663, 86670, 86677, 86684, 86691, 86698,
+ 86705, 86712, 86719, 86726, 86733, 86740, 86747, 86754, 86761, 86768,
+ 86775, 0, 0, 0, 0, 0, 86782, 86790, 86798, 0, 0, 0, 0, 86803, 86807,
+ 86811, 86815, 86819, 86823, 86827, 86831, 86835, 86839, 86844, 86849,
+ 86854, 86859, 86864, 86869, 86874, 86879, 86884, 86890, 86896, 86902,
+ 86909, 86916, 86923, 86930, 86937, 86944, 86950, 86956, 86962, 86969,
+ 86976, 86983, 86990, 86997, 87004, 87011, 87018, 87025, 87032, 87039,
+ 87046, 87053, 87060, 0, 0, 0, 87067, 87075, 87083, 87091, 87099, 87107,
+ 87117, 87127, 87135, 87143, 87151, 87159, 87167, 87173, 87180, 87189,
+ 87198, 87207, 87216, 87225, 87234, 87244, 87255, 87265, 87276, 87285,
+ 87294, 87303, 87313, 87324, 87334, 87345, 87356, 87365, 87373, 87379,
+ 87385, 87391, 87397, 87405, 87413, 87419, 87426, 87436, 87443, 87450,
+ 87457, 87464, 87471, 87481, 87488, 87495, 87503, 87511, 87520, 87529,
+ 87538, 87547, 87556, 87564, 87573, 87582, 87591, 87595, 87602, 87607,
+ 87612, 87616, 87620, 87624, 87628, 87633, 87638, 87644, 87650, 87654,
+ 87660, 87664, 87668, 87672, 87676, 87680, 87684, 87690, 0, 0, 0, 0, 0,
+ 87694, 87699, 87704, 87709, 87714, 87721, 87726, 87731, 87736, 87741,
+ 87746, 87751, 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, 87756, 87763, 87772, 87781, 87788, 87795, 87802,
+ 87809, 87816, 87823, 87829, 87836, 87843, 87850, 87857, 87864, 87871,
+ 87878, 87885, 87894, 87901, 87908, 87915, 87922, 87929, 87936, 87943,
+ 87950, 87959, 87966, 87973, 87980, 87987, 87994, 88001, 88010, 88017,
+ 88024, 88031, 88038, 88047, 88054, 88061, 88068, 88076, 88085, 0, 0,
+ 88094, 88098, 88102, 88107, 88112, 88117, 88122, 88126, 88131, 88136,
+ 88141, 88146, 88151, 88156, 88160, 88164, 88168, 88173, 88178, 88182,
+ 88187, 88192, 88196, 88200, 88205, 88210, 88215, 88220, 88225, 0, 0, 0,
+ 88230, 88234, 88239, 88244, 88248, 88253, 88257, 88262, 88267, 88272,
+ 88277, 88281, 88285, 88290, 88295, 88300, 88305, 88309, 88314, 88318,
+ 88323, 88328, 88332, 88337, 88342, 88347, 88351, 88355, 88360, 88365,
+ 88370, 88375, 88380, 88385, 88390, 88395, 88400, 88405, 88410, 88415,
+ 88420, 88425, 88430, 88435, 88440, 88445, 88450, 88455, 88460, 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, 88465, 88469,
+ 88474, 88479, 88484, 88488, 88493, 88498, 88503, 88508, 88512, 88516,
+ 88521, 88526, 88531, 88536, 88540, 88545, 88550, 88555, 88560, 88565,
+ 88570, 88574, 88579, 88584, 88589, 88594, 88599, 88604, 88609, 0, 88614,
+ 88619, 88624, 88630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88636, 88641,
+ 88646, 88651, 88656, 88661, 88666, 88671, 88676, 88681, 88686, 88691,
+ 88696, 88701, 88706, 88711, 88716, 88721, 88726, 88731, 88736, 88741,
+ 88746, 88751, 88756, 88761, 88766, 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, 88773, 88778, 88783,
+ 88788, 88793, 88798, 88803, 88808, 88813, 88818, 88823, 88828, 88833,
+ 88838, 88843, 88848, 88853, 88858, 88863, 88868, 88873, 88878, 88883,
+ 88888, 88893, 88898, 88903, 88907, 88911, 88915, 0, 88920, 88926, 88931,
+ 88936, 88941, 88946, 88952, 88958, 88964, 88970, 88976, 88982, 88988,
+ 88994, 89000, 89006, 89012, 89018, 89024, 89029, 89035, 89041, 89046,
+ 89052, 89057, 89063, 89069, 89074, 89080, 89086, 89091, 89097, 89103,
+ 89109, 89115, 89121, 89127, 0, 0, 0, 0, 89132, 89138, 89144, 89150,
+ 89156, 89162, 89168, 89174, 89180, 89187, 89192, 89197, 89203, 89209, 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, 89215, 89220, 89225,
+ 89230, 89236, 89241, 89247, 89253, 89259, 89265, 89272, 89278, 89285,
+ 89290, 89295, 89300, 89305, 89310, 89315, 89320, 89325, 89330, 89335,
+ 89340, 89345, 89350, 89355, 89360, 89365, 89370, 89375, 89380, 89385,
+ 89390, 89395, 89400, 89405, 89410, 89415, 89420, 89425, 89430, 89435,
+ 89440, 89446, 89451, 89457, 89463, 89469, 89475, 89482, 89488, 89495,
+ 89500, 89505, 89510, 89515, 89520, 89525, 89530, 89535, 89540, 89545,
+ 89550, 89555, 89560, 89565, 89570, 89575, 89580, 89585, 89590, 89595,
+ 89600, 89605, 89610, 89615, 89620, 89625, 89630, 89635, 89640, 89645,
+ 89650, 89655, 89660, 89665, 89670, 89675, 89680, 89685, 89690, 89695,
+ 89700, 89705, 89710, 89715, 89720, 89725, 89730, 89735, 89740, 89745,
+ 89750, 89755, 89760, 89765, 89770, 89775, 89780, 89785, 89790, 89795,
+ 89800, 89805, 89810, 89815, 89820, 89825, 89830, 89835, 89840, 89845,
+ 89850, 89855, 89860, 89865, 89870, 89875, 89880, 89885, 89890, 89895,
+ 89900, 89905, 89910, 89914, 89919, 89924, 89929, 89934, 89939, 89944,
+ 89949, 89954, 89959, 89964, 89969, 89974, 89978, 89982, 89986, 89990,
+ 89994, 89998, 90002, 90007, 90012, 0, 0, 90017, 90022, 90026, 90030,
+ 90034, 90038, 90042, 90046, 90050, 90054, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 90058, 90062, 90066, 90070, 90074, 90078, 0, 0, 90083, 0,
+ 90088, 90092, 90097, 90102, 90107, 90112, 90117, 90122, 90127, 90132,
+ 90137, 90141, 90146, 90151, 90156, 90161, 90165, 90170, 90175, 90180,
+ 90185, 90189, 90194, 90199, 90204, 90209, 90213, 90218, 90223, 90228,
+ 90233, 90238, 90243, 90248, 90253, 90258, 90263, 90268, 90273, 90277,
+ 90282, 90287, 90292, 90297, 0, 90302, 90307, 0, 0, 0, 90312, 0, 0, 90317,
+ 90322, 90329, 90336, 90343, 90350, 90357, 90364, 90371, 90378, 90385,
+ 90392, 90399, 90406, 90413, 90420, 90427, 90434, 90441, 90448, 90455,
+ 90462, 90469, 0, 90476, 90483, 90489, 90495, 90501, 90508, 90515, 90523,
+ 90531, 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, 90540, 90545, 90550, 90555, 90560, 90565,
+ 90570, 90575, 90580, 90585, 90590, 90595, 90600, 90605, 90610, 90615,
+ 90620, 90625, 90630, 90635, 90640, 90645, 90650, 90654, 90659, 90664,
+ 90670, 90674, 0, 0, 0, 90678, 90684, 90688, 90693, 90698, 90703, 90707,
+ 90712, 90716, 90721, 90726, 90730, 90734, 90738, 90742, 90746, 90751,
+ 90756, 90760, 90765, 90770, 90774, 90779, 90784, 90789, 90794, 90799, 0,
+ 0, 0, 0, 0, 90804, 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, 90809,
+ 90813, 90818, 90823, 0, 90829, 90834, 0, 0, 0, 0, 0, 90839, 90845, 90852,
+ 90857, 90862, 90866, 90871, 90876, 0, 90881, 90886, 90891, 0, 90896,
+ 90901, 90906, 90911, 90916, 90921, 90926, 90931, 90936, 90941, 90946,
+ 90950, 90954, 90959, 90964, 90969, 90973, 90977, 90981, 90986, 90991,
+ 90996, 91001, 91006, 91011, 91015, 91020, 0, 0, 0, 0, 91025, 91031,
+ 91036, 0, 0, 0, 0, 91041, 91045, 91049, 91053, 91057, 91061, 91066,
+ 91071, 91077, 0, 0, 0, 0, 0, 0, 0, 0, 91083, 91089, 91096, 91102, 91109,
+ 91115, 91121, 91127, 91134, 0, 0, 0, 0, 0, 0, 0, 91140, 91148, 91156,
+ 91164, 91172, 91180, 91188, 91196, 91204, 91212, 91220, 91228, 91236,
+ 91244, 91252, 91260, 91268, 91276, 91284, 91292, 91300, 91308, 91316,
+ 91324, 91332, 91340, 91348, 91356, 91364, 91372, 91379, 91387, 91395,
+ 91399, 91404, 91409, 91414, 91419, 91424, 91429, 91434, 91438, 91443,
+ 91447, 91452, 91456, 91461, 91465, 91470, 91475, 91480, 91485, 91490,
+ 91495, 91500, 91505, 91510, 91515, 91520, 91525, 91530, 91535, 91540,
+ 91545, 91550, 91555, 91560, 91565, 91570, 91575, 91580, 91585, 91590,
+ 91595, 91600, 91605, 91610, 91615, 91620, 91625, 91630, 91635, 91640,
+ 91645, 91650, 91655, 0, 0, 0, 91660, 91665, 91674, 91682, 91691, 91700,
+ 91711, 91722, 91729, 91736, 91743, 91750, 91757, 91764, 91771, 91778,
+ 91785, 91792, 91799, 91806, 91813, 91820, 91827, 91834, 91841, 91848,
+ 91855, 91862, 91869, 0, 0, 91876, 91882, 91888, 91894, 91900, 91907,
+ 91914, 91922, 91930, 91937, 91944, 91951, 91958, 91965, 91972, 91979,
+ 91986, 91993, 92000, 92007, 92014, 92021, 92028, 92035, 92042, 92049,
+ 92056, 0, 0, 0, 0, 0, 92063, 92069, 92075, 92081, 92087, 92094, 92101,
+ 92109, 92117, 92123, 92129, 92136, 92142, 92148, 92154, 92160, 92167,
+ 92174, 92181, 92188, 92195, 92202, 92209, 92216, 92223, 92230, 92237,
+ 92244, 92251, 92258, 92265, 92272, 92279, 92286, 92293, 92300, 92307,
+ 92314, 92321, 92328, 92335, 92342, 92349, 92356, 92363, 92370, 92377,
+ 92384, 92391, 92398, 92405, 92412, 92419, 92426, 92433, 92440, 92447,
+ 92454, 92461, 92468, 92475, 92482, 92489, 92496, 92503, 92510, 92517,
+ 92524, 92531, 92538, 92545, 92552, 92559, 92566, 92573, 92580, 92587,
+ 92594, 92601, 92608, 92615, 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, 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, 65528, 65537, 65546, 65555, 65564, 65573, 65582, 65591, 65600,
- 65608, 65615, 65623, 65630, 65638, 65648, 65657, 65667, 65676, 65686,
- 65694, 65701, 65709, 65716, 65724, 65729, 65734, 65739, 65747, 65753,
- 65759, 65766, 65775, 65783, 65791, 65799, 65806, 65813, 65820, 65827,
- 65832, 65837, 65842, 65847, 65852, 65857, 65862, 65867, 65875, 65883,
- 65889, 65894, 65899, 65904, 65909, 65914, 65919, 65924, 65929, 65934,
- 65942, 65950, 65955, 65960, 65969, 65978, 65985, 65992, 66001, 66010,
- 66021, 66032, 66038, 66044, 66052, 66060, 66069, 66078, 66085, 66092,
- 66097, 66102, 66113, 66124, 66132, 66140, 66150, 66160, 66171, 66182,
- 66191, 66200, 66207, 66214, 66221, 66228, 66237, 66246, 66251, 66256,
- 66263, 66270, 66277, 66284, 66295, 66306, 66311, 66316, 66321, 66326,
- 66331, 66336, 66341, 66346, 66350, 66355, 66360, 66365, 66370, 66375,
- 66381, 66386, 66391, 66398, 66405, 66412, 66419, 66425, 66432, 66439,
- 66444, 66449, 66455, 66461, 66467, 66473, 66480, 66487, 66494, 66498,
- 66505, 66510, 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, 92622, 92626, 92630,
+ 92634, 92638, 92642, 92646, 92650, 92654, 92658, 92663, 92668, 92673,
+ 92678, 92683, 92688, 92693, 92698, 92703, 92709, 92715, 92721, 92728,
+ 92735, 92742, 92749, 92756, 92763, 92770, 92777, 92784, 0, 92791, 92795,
+ 92799, 92803, 92807, 92811, 92814, 92818, 92821, 92825, 92828, 92832,
+ 92836, 92841, 92845, 92850, 92853, 92857, 92860, 92864, 92867, 92871,
+ 92875, 92879, 92883, 92887, 92891, 92895, 92899, 92903, 92907, 92911,
+ 92915, 92919, 92923, 92927, 92931, 92935, 92939, 92942, 92945, 92949,
+ 92953, 92957, 92960, 92963, 92966, 92970, 92974, 92978, 92982, 92986,
+ 92989, 92993, 92999, 93005, 93011, 93016, 93023, 93027, 93032, 93036,
+ 93041, 93046, 93052, 93057, 93063, 93067, 93072, 93076, 93081, 93084,
+ 93087, 93091, 93096, 93102, 93107, 93113, 0, 0, 0, 0, 93118, 93121,
+ 93124, 93127, 93130, 93133, 93136, 93139, 93142, 93145, 93149, 93153,
+ 93157, 93161, 93165, 93169, 93173, 93177, 93181, 93186, 93191, 93195,
+ 93198, 93201, 93204, 93207, 93210, 93213, 93216, 93219, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93222, 93226, 93230, 93234, 93237, 93241,
+ 93244, 93248, 93251, 93255, 93258, 93262, 93265, 93269, 93272, 93276,
+ 93280, 93284, 93288, 93292, 93296, 93300, 93304, 93308, 93312, 93316,
+ 93320, 93324, 93328, 93332, 93336, 93340, 93344, 93348, 93352, 93355,
+ 93358, 93362, 93366, 93370, 93373, 93376, 93379, 93383, 93387, 93391,
+ 93395, 93399, 93402, 93407, 93411, 93416, 93420, 93425, 93429, 93434,
+ 93438, 93443, 93447, 93451, 93455, 93459, 93462, 93466, 93471, 93474, 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, 0, 0, 0, 66515, 66522,
- 66529, 66536, 66544, 66551, 66557, 66563, 66570, 66576, 66582, 66588,
- 66595, 66602, 66609, 66616, 66623, 66630, 66637, 66644, 66651, 66658,
- 66665, 66672, 66679, 66686, 66692, 66699, 66706, 66713, 66720, 66727,
- 66734, 66741, 66748, 66755, 66762, 66769, 66776, 66783, 66790, 66797,
- 66804, 66811, 66818, 66826, 66834, 66842, 66850, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66858, 66861, 66865, 66869, 66873,
- 66877, 66881, 66885, 66889, 66893, 66897, 66901, 66905, 66908, 66912,
- 66916, 66919, 66923, 66927, 66931, 66935, 66939, 66943, 66947, 66950,
- 66953, 66957, 66961, 66965, 66968, 66971, 66974, 66977, 66980, 66983,
- 66987, 66991, 66995, 66999, 67003, 67009, 67014, 67018, 67022, 67026,
- 67030, 67035, 67041, 67046, 67052, 67057, 67062, 67066, 67072, 67077,
- 67081, 0, 0, 0, 0, 0, 0, 0, 0, 67086, 67090, 67094, 67097, 67101, 67104,
- 67108, 67111, 67115, 67119, 67124, 67128, 67133, 67136, 67140, 67144,
- 67147, 67151, 67155, 67158, 67162, 67166, 67170, 67174, 67178, 67182,
- 67186, 67190, 67194, 67198, 67202, 67206, 67210, 67214, 67218, 67222,
- 67226, 67230, 67234, 67237, 67241, 67245, 67249, 67252, 67255, 67258,
- 67262, 67266, 67270, 67274, 67278, 67281, 67285, 67291, 67296, 67300,
- 67305, 67309, 67314, 67319, 67325, 67330, 67336, 67340, 67345, 67350,
- 67354, 67359, 67364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67368, 67371, 67375,
- 67379, 67382, 67385, 67388, 67391, 67394, 67397, 67400, 67403, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93478, 93481, 93486, 93492, 93500,
+ 93505, 93511, 93519, 93525, 93531, 93535, 93539, 93546, 93555, 93562,
+ 93571, 93577, 93586, 93593, 93600, 93607, 93617, 93623, 93627, 93634,
+ 93643, 93653, 93660, 93667, 93671, 93675, 93682, 93692, 93696, 93703,
+ 93710, 93717, 93723, 93730, 93737, 93744, 93751, 93755, 93759, 93763,
+ 93770, 93774, 93781, 93788, 93802, 93811, 93815, 93819, 93823, 93830,
+ 93834, 93838, 93842, 93850, 93858, 93877, 93887, 93907, 93911, 93915,
+ 93919, 93923, 93927, 93931, 93935, 93942, 93946, 93949, 93953, 93957,
+ 93963, 93970, 93979, 93983, 93992, 94001, 94009, 94013, 94020, 94024,
+ 94028, 94032, 94036, 94047, 94056, 94065, 94074, 94083, 94095, 94104,
+ 94113, 94122, 94130, 94139, 94151, 94160, 94169, 94178, 94190, 94199,
+ 94208, 94220, 94229, 94238, 94250, 94259, 94263, 94267, 94271, 94275,
+ 94279, 94283, 94287, 94294, 94298, 94302, 94313, 94317, 94321, 94328,
+ 94334, 94340, 94344, 94351, 94355, 94359, 94363, 94367, 94371, 94375,
+ 94381, 94389, 94393, 94397, 94400, 94406, 94416, 94420, 94432, 94439,
+ 94446, 94453, 94460, 94466, 94470, 94474, 94478, 94482, 94489, 94498,
+ 94505, 94513, 94521, 94527, 94531, 94535, 94539, 94543, 94549, 94558,
+ 94570, 94577, 94584, 94593, 94604, 94610, 94619, 94628, 94635, 94644,
+ 94651, 94658, 94668, 94675, 94682, 94689, 94696, 94700, 94706, 94710,
+ 94721, 94729, 94738, 94750, 94757, 94764, 94774, 94781, 94790, 94797,
+ 94806, 94813, 94820, 94830, 94837, 94844, 94854, 94861, 94873, 94882,
+ 94889, 94896, 94903, 94912, 94922, 94935, 94942, 94952, 94962, 94969,
+ 94978, 94991, 94998, 95005, 95012, 95022, 95032, 95039, 95049, 95056,
+ 95063, 95073, 95079, 95086, 95093, 95100, 95110, 95117, 95124, 95131,
+ 95137, 95144, 95154, 95161, 95165, 95173, 95177, 95189, 95193, 95207,
+ 95211, 95215, 95219, 95223, 95229, 95236, 95244, 95248, 95252, 95256,
+ 95260, 95267, 95271, 95277, 95283, 95291, 95295, 95302, 95310, 95314,
+ 95318, 95324, 95328, 95337, 95346, 95353, 95363, 95369, 95373, 95377,
+ 95385, 95392, 95399, 95405, 95409, 95417, 95421, 95428, 95440, 95447,
+ 95457, 95463, 95467, 95476, 95483, 95492, 95496, 95500, 95507, 95511,
+ 95515, 95519, 95523, 95526, 95532, 95538, 95542, 95546, 95553, 95560,
+ 95567, 95574, 95581, 95588, 95595, 95602, 95608, 95612, 95616, 95623,
+ 95630, 95637, 95644, 95651, 95655, 95658, 95663, 95667, 95671, 95680,
+ 95689, 95693, 95697, 95703, 95709, 95726, 95732, 95736, 95745, 95749,
+ 95753, 95760, 95768, 95776, 95782, 95786, 95790, 95794, 95798, 95801,
+ 95807, 95814, 95824, 95831, 95838, 95845, 95851, 95858, 95865, 95872,
+ 95879, 95886, 95895, 95902, 95914, 95921, 95928, 95938, 95949, 95956,
+ 95963, 95970, 95977, 95984, 95991, 95998, 96005, 96012, 96019, 96029,
+ 96039, 96049, 96056, 96066, 96073, 96080, 96087, 96094, 96101, 96108,
+ 96115, 96122, 96129, 96136, 96143, 96150, 96157, 96163, 96170, 96177,
+ 96186, 96193, 96200, 96204, 96212, 96216, 96220, 96224, 96228, 96232,
+ 96239, 96243, 96252, 96256, 96263, 96271, 96275, 96279, 96283, 96296,
+ 96312, 96316, 96320, 96327, 96333, 96340, 96344, 96348, 96352, 96356,
+ 96360, 96367, 96371, 96389, 96393, 96397, 96404, 96408, 96412, 96418,
+ 96422, 96426, 96434, 96438, 96442, 96446, 96450, 96456, 96467, 96476,
+ 96485, 96492, 96499, 96510, 96517, 96524, 96531, 96538, 96545, 96552,
+ 96559, 96569, 96575, 96582, 96592, 96601, 96608, 96617, 96627, 96634,
+ 96641, 96648, 96655, 96667, 96674, 96681, 96688, 96695, 96702, 96712,
+ 96719, 96726, 96736, 96749, 96761, 96768, 96778, 96785, 96792, 96799,
+ 96813, 96819, 96827, 96837, 96847, 96854, 96861, 96867, 96871, 96878,
+ 96888, 96894, 96907, 96911, 96915, 96922, 96926, 96933, 96943, 96947,
+ 96951, 96955, 96959, 96963, 96970, 96974, 96981, 96988, 96995, 97004,
+ 97013, 97023, 97030, 97037, 97044, 97054, 97061, 97071, 97078, 97088,
+ 97095, 97102, 97112, 97122, 97129, 97135, 97143, 97151, 97157, 97163,
+ 97167, 97171, 97178, 97186, 97192, 97196, 97200, 97204, 97211, 97223,
+ 97226, 97233, 97239, 97243, 97247, 97251, 97255, 97259, 97263, 97267,
+ 97271, 97275, 97279, 97286, 97290, 97296, 97300, 97304, 97308, 97314,
+ 97321, 97328, 97335, 97346, 97354, 97358, 97364, 97373, 97380, 97386,
+ 97389, 97393, 97397, 97403, 97412, 97420, 97424, 97430, 97434, 97438,
+ 97442, 97448, 97455, 97461, 97465, 97471, 97475, 97479, 97488, 97500,
+ 97504, 97511, 97518, 97528, 97535, 97547, 97554, 97561, 97568, 97579,
+ 97589, 97602, 97612, 97619, 97623, 97627, 97631, 97635, 97644, 97653,
+ 97662, 97679, 97688, 97694, 97701, 97709, 97722, 97726, 97735, 97744,
+ 97753, 97762, 97773, 97782, 97791, 97800, 97809, 97818, 97827, 97837,
+ 97840, 97844, 97848, 97852, 97856, 97860, 97866, 97873, 97880, 97887,
+ 97893, 97899, 97906, 97912, 97919, 97927, 97931, 97938, 97945, 97952,
+ 97960, 97963, 97967, 97971, 97975, 97979, 97985, 97989, 97995, 98002,
+ 98009, 98015, 98022, 98029, 98036, 98043, 98050, 98057, 98064, 98071,
+ 98078, 98085, 98092, 98099, 98106, 98113, 98119, 98123, 98132, 98136,
+ 98140, 98144, 98148, 98154, 98161, 98168, 98175, 98182, 98189, 98195,
+ 98203, 98207, 98211, 98215, 98219, 98225, 98242, 98259, 98263, 98267,
+ 98271, 98275, 98279, 98283, 98289, 98296, 98300, 98306, 98313, 98320,
+ 98327, 98334, 98341, 98350, 98357, 98364, 98371, 98378, 98382, 98386,
+ 98392, 98404, 98408, 98412, 98421, 98425, 98429, 98433, 98439, 98443,
+ 98447, 98456, 98460, 98464, 98468, 98475, 98479, 98483, 98487, 98491,
+ 98495, 98499, 98503, 98507, 98513, 98520, 98527, 98533, 98537, 98554,
+ 98560, 98564, 98570, 98576, 98582, 98588, 98594, 98600, 98604, 98608,
+ 98612, 98618, 98622, 98628, 98632, 98636, 98643, 98650, 98667, 98671,
+ 98675, 98679, 98683, 98687, 98699, 98702, 98707, 98712, 98727, 98737,
+ 98749, 98753, 98757, 98761, 98767, 98774, 98781, 98791, 98803, 98809,
+ 98815, 98824, 98828, 98832, 98839, 98849, 98856, 98862, 98866, 98870,
+ 98877, 98883, 98887, 98893, 98897, 98905, 98911, 98915, 98923, 98931,
+ 98938, 98944, 98951, 98958, 98968, 98978, 98982, 98986, 98990, 98994,
+ 99000, 99007, 99013, 99020, 99027, 99034, 99043, 99050, 99057, 99063,
+ 99070, 99077, 99084, 99091, 99098, 99105, 99111, 99118, 99125, 99132,
+ 99141, 99148, 99155, 99159, 99165, 99169, 99175, 99182, 99189, 99196,
+ 99200, 99204, 99208, 99212, 99216, 99223, 99227, 99231, 99237, 99245,
+ 99249, 99253, 99257, 99261, 99268, 99272, 99276, 99284, 99288, 99292,
+ 99296, 99300, 99306, 99310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 99314, 99320, 99326, 99333, 99340, 99347, 99354, 99361, 99368,
+ 99374, 99381, 99388, 99395, 99402, 99409, 99416, 99422, 99428, 99434,
+ 99440, 99446, 99452, 99458, 99464, 99470, 99477, 99484, 99491, 99498,
+ 99505, 99512, 99518, 99524, 99530, 99537, 99544, 99550, 99556, 99565,
+ 99572, 99579, 99586, 99593, 99600, 99607, 99613, 99619, 99625, 99634,
+ 99641, 99648, 99659, 99670, 99676, 99682, 99688, 99697, 99704, 99711,
+ 99721, 99731, 99742, 99753, 99765, 99778, 99789, 99800, 99812, 99825,
+ 99836, 99847, 99858, 99869, 99880, 99892, 99900, 99908, 99917, 99926,
+ 99935, 99941, 99947, 99953, 99960, 99970, 99977, 99987, 99992, 99997,
+ 100003, 100009, 100017, 100025, 100034, 100045, 100056, 100064, 100072,
+ 100081, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100090, 100101, 100108,
+ 100116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100124, 100128, 100132,
+ 100136, 100140, 100144, 100148, 100152, 100156, 100160, 100164, 100168,
+ 100172, 100176, 100180, 100184, 100188, 100192, 100196, 100200, 100204,
+ 100208, 100212, 100216, 100220, 100224, 100228, 100232, 100236, 100240,
+ 100244, 100248, 100252, 100256, 100260, 100264, 100268, 100272, 100276,
+ 100280, 100284, 100288, 100292, 100296, 100300, 100304, 100308, 100312,
+ 100316, 100320, 100324, 100328, 100332, 100336, 100340, 100344, 100348,
+ 100352, 100356, 100360, 100364, 100368, 100372, 100376, 100380, 100384,
+ 100388, 100392, 100396, 100400, 100404, 100408, 100412, 100416, 100420,
+ 100424, 100428, 100432, 100436, 100440, 100444, 100448, 100452, 100456,
+ 100460, 100464, 100468, 100472, 100476, 100480, 100484, 100488, 100492,
+ 100496, 100500, 100504, 100508, 100512, 100516, 100520, 100524, 100528,
+ 100532, 100536, 100540, 100544, 100548, 100552, 100556, 100560, 100564,
+ 100568, 100572, 100576, 100580, 100584, 100588, 100592, 100596, 100600,
+ 100604, 100608, 100612, 100616, 100620, 100624, 100628, 100632, 100636,
+ 100640, 100644, 100648, 100652, 100656, 100660, 100664, 100668, 100672,
+ 100676, 100680, 100684, 100688, 100692, 100696, 100700, 100704, 100708,
+ 100712, 100716, 100720, 100724, 100728, 100732, 100736, 100740, 100744,
+ 100748, 100752, 100756, 100760, 100764, 100768, 100772, 100776, 100780,
+ 100784, 100788, 100792, 100796, 100800, 100804, 100808, 100812, 100816,
+ 100820, 100824, 100828, 100832, 100836, 100840, 100844, 100848, 100852,
+ 100856, 100860, 100864, 100868, 100872, 100876, 100880, 100884, 100888,
+ 100892, 100896, 100900, 100904, 100908, 100912, 100916, 100920, 100924,
+ 100928, 100932, 100936, 100940, 100944, 100948, 100952, 100956, 100960,
+ 100964, 100968, 100972, 100976, 100980, 100984, 100988, 100992, 100996,
+ 101000, 101004, 101008, 101012, 101016, 101020, 101024, 101028, 101032,
+ 101036, 101040, 101044, 101048, 101052, 101056, 101060, 101064, 101068,
+ 101072, 101076, 101080, 101084, 101088, 101092, 101096, 101100, 101104,
+ 101108, 101112, 101116, 101120, 101124, 101128, 101132, 101136, 101140,
+ 101144, 101148, 101152, 101156, 101160, 101164, 101168, 101172, 101176,
+ 101180, 101184, 101188, 101192, 101196, 101200, 101204, 101208, 101212,
+ 101216, 101220, 101224, 101228, 101232, 101236, 101240, 101244, 101248,
+ 101252, 101256, 101260, 101264, 101268, 101272, 101276, 101280, 101284,
+ 101288, 101292, 101296, 101300, 101304, 101308, 101312, 101316, 101320,
+ 101324, 101328, 101332, 101336, 101340, 101344, 101348, 101352, 101356,
+ 101360, 101364, 101368, 101372, 101376, 101380, 101384, 101388, 101392,
+ 101396, 101400, 101404, 101408, 101412, 101416, 101420, 101424, 101428,
+ 101432, 101436, 101440, 101444, 101448, 101452, 101456, 101460, 101464,
+ 101468, 101472, 101476, 101480, 101484, 101488, 101492, 101496, 101500,
+ 101504, 101508, 101512, 101516, 101520, 101524, 101528, 101532, 101536,
+ 101540, 101544, 101548, 101552, 101556, 101560, 101564, 101568, 101572,
+ 101576, 101580, 101584, 101588, 101592, 101596, 101600, 101604, 101608,
+ 101612, 101616, 101620, 101624, 101628, 101632, 101636, 101640, 101644,
+ 101648, 101652, 101656, 101660, 101664, 101668, 101672, 101676, 101680,
+ 101684, 101688, 101692, 101696, 101700, 101704, 101708, 101712, 101716,
+ 101720, 101724, 101728, 101732, 101736, 101740, 101744, 101748, 101752,
+ 101756, 101760, 101764, 101768, 101772, 101776, 101780, 101784, 101788,
+ 101792, 101796, 101800, 101804, 101808, 101812, 101816, 101820, 101824,
+ 101828, 101832, 101836, 101840, 101844, 101848, 101852, 101856, 101860,
+ 101864, 101868, 101872, 101876, 101880, 101884, 101888, 101892, 101896,
+ 101900, 101904, 101908, 101912, 101916, 101920, 101924, 101928, 101932,
+ 101936, 101940, 101944, 101948, 101952, 101956, 101960, 101964, 101968,
+ 101972, 101976, 101980, 101984, 101988, 101992, 101996, 102000, 102004,
+ 102008, 102012, 102016, 102020, 102024, 102028, 102032, 102036, 102040,
+ 102044, 102048, 102052, 102056, 102060, 102064, 102068, 102072, 102076,
+ 102080, 102084, 102088, 102092, 102096, 102100, 102104, 102108, 102112,
+ 102116, 102120, 102124, 102128, 102132, 102136, 102140, 102144, 102148,
+ 102152, 102156, 102160, 102164, 102168, 102172, 102176, 102180, 102184,
+ 102188, 102192, 102196, 102200, 102204, 102208, 102212, 102216, 102220,
+ 102224, 102228, 102232, 102236, 102240, 102244, 102248, 102252, 102256,
+ 102260, 102264, 102268, 102272, 102276, 102280, 102284, 102288, 102292,
+ 102296, 102300, 102304, 102308, 102312, 102316, 102320, 102324, 102328,
+ 102332, 102336, 102340, 102344, 102348, 102352, 102356, 102360, 102364,
+ 102368, 102372, 102376, 102380, 102384, 102388, 102392, 102396, 102400,
+ 102404, 102408, 102412, 102416, 102420, 102424, 102428, 102432, 102436,
+ 102440, 102444, 102448, 102452, 102456, 102460, 102464, 102468, 102472,
+ 102476, 102480, 102484, 102488, 102492, 102496, 102500, 102504, 102508,
+ 102512, 102516, 102520, 102524, 102528, 102532, 102536, 102540, 102544,
+ 102548, 102552, 102556, 102560, 102564, 102568, 102572, 102576, 102580,
+ 102584, 102588, 102592, 102596, 102600, 102604, 102608, 102612, 102616,
+ 102620, 102624, 102628, 102632, 102636, 102640, 102644, 102648, 102652,
+ 102656, 102660, 102664, 102668, 102672, 102676, 102680, 102684, 102688,
+ 102692, 102696, 102700, 102704, 102708, 102712, 102716, 102720, 102724,
+ 102728, 102732, 102736, 102740, 102744, 102748, 102752, 102756, 102760,
+ 102764, 102768, 102772, 102776, 102780, 102784, 102788, 102792, 102796,
+ 102800, 102804, 102808, 102812, 102816, 102820, 102824, 102828, 102832,
+ 102836, 102840, 102844, 102848, 102852, 102856, 102860, 102864, 102868,
+ 102872, 102876, 102880, 102884, 102888, 102892, 102896, 102900, 102904,
+ 102908, 102912, 102916, 102920, 102924, 102928, 102932, 102936, 102940,
+ 102944, 102948, 102952, 102956, 102960, 102964, 102968, 102972, 102976,
+ 102980, 102984, 102988, 102992, 102996, 103000, 103004, 103008, 103012,
+ 103016, 103020, 103024, 103028, 103032, 103036, 103040, 103044, 103048,
+ 103052, 103056, 103060, 103064, 103068, 103072, 103076, 103080, 103084,
+ 103088, 103092, 103096, 103100, 103104, 103108, 103112, 103116, 103120,
+ 103124, 103128, 103132, 103136, 103140, 103144, 103148, 103152, 103156,
+ 103160, 103164, 103168, 103172, 103176, 103180, 103184, 103188, 103192,
+ 103196, 103200, 103204, 103208, 103212, 103216, 103220, 103224, 103228,
+ 103232, 103236, 103240, 103244, 103248, 103252, 103256, 103260, 103264,
+ 103268, 103272, 103276, 103280, 103284, 103288, 103292, 103296, 103300,
+ 103304, 103308, 103312, 103316, 103320, 103324, 103328, 103332, 103336,
+ 103340, 103344, 103348, 103352, 103356, 103360, 103364, 103368, 103372,
+ 103376, 103380, 103384, 103388, 103392, 103396, 103400, 103404, 103408,
+ 103412, 103416, 103420, 103424, 103428, 103432, 103436, 103440, 103444,
+ 103448, 103452, 103456, 103460, 103464, 103468, 103472, 103476, 103480,
+ 103484, 103488, 103492, 103496, 103500, 103504, 103508, 103512, 103516,
+ 103520, 103524, 103528, 103532, 103536, 103540, 103544, 103548, 103552,
+ 103556, 103560, 103564, 103568, 103572, 103576, 103580, 103584, 103588,
+ 103592, 103596, 103600, 103604, 103608, 103612, 103616, 103620, 103624,
+ 103628, 103632, 103636, 103640, 103644, 103648, 103652, 103656, 103660,
+ 103664, 103668, 103672, 103676, 103680, 103684, 103688, 103692, 103696,
+ 103700, 103704, 103708, 103712, 103716, 103720, 103724, 103728, 103732,
+ 103736, 103740, 103744, 103748, 103752, 103756, 103760, 103764, 103768,
+ 103772, 103776, 103780, 103784, 103788, 103792, 103796, 103800, 103804,
+ 103808, 103812, 103816, 103820, 103824, 103828, 103832, 103836, 103840,
+ 103844, 103848, 103852, 103856, 103860, 103864, 103868, 103872, 103876,
+ 103880, 103884, 103888, 103892, 103896, 103900, 103904, 103908, 103912,
+ 103916, 103920, 103924, 103928, 103932, 103936, 103940, 103944, 103948,
+ 103952, 103956, 103960, 103964, 103968, 103972, 103976, 103980, 103984,
+ 103988, 103992, 103996, 104000, 104004, 104008, 104012, 104016, 104020,
+ 104024, 104028, 104032, 104036, 104040, 104044, 104048, 104052, 104056,
+ 104060, 104064, 104068, 104072, 104076, 104080, 104084, 104088, 104092,
+ 104096, 104100, 104104, 104108, 104112, 104116, 104120, 104124, 104128,
+ 104132, 104136, 104140, 104144, 104148, 104152, 104156, 104160, 104164,
+ 104168, 104172, 104176, 104180, 104184, 104188, 104192, 104196, 104200,
+ 104204, 104208, 104212, 104216, 104220, 104224, 104228, 104232, 104236,
+ 104240, 104244, 104248, 104252, 104256, 104260, 104264, 104268, 104272,
+ 104276, 104280, 104284, 104288, 104292, 104296, 104300, 104304, 104308,
+ 104312, 104316, 104320, 104324, 104328, 104332, 104336, 104340, 104344,
+ 104348, 104352, 104356, 104360, 104364, 104368, 104372, 104376, 104380,
+ 104384, 104388, 104392, 104396, 104400, 104404, 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, 67406, 67413, 67419, 67425, 67431,
- 67437, 67443, 67449, 67455, 67461, 67467, 67473, 67480, 67487, 67494,
- 67501, 67508, 67515, 67522, 67529, 67536, 67543, 67549, 67556, 67562,
- 67569, 67576, 67582, 67588, 67595, 67602, 67609, 67615, 67622, 67629,
- 67635, 67642, 67648, 67655, 67662, 67668, 67674, 67681, 67687, 67694,
- 67701, 67710, 67717, 67724, 67728, 67733, 67738, 67743, 67748, 67753,
- 67757, 67762, 67766, 67771, 67776, 67781, 67786, 67790, 67795, 67799,
- 67804, 67808, 67813, 67818, 67823, 67828, 67832, 67837, 67842, 67847,
- 67853, 67858, 67864, 67870, 67876, 67883, 67889, 67895, 67901, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 67905, 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, 67910, 67913,
- 67916, 67919, 67922, 67926, 67929, 67932, 67936, 67940, 67944, 67948,
- 67952, 67956, 67960, 67964, 67968, 67972, 67976, 67980, 67984, 67988,
- 67992, 67996, 68000, 68004, 68008, 68011, 68015, 68019, 68023, 68027,
- 68031, 68034, 68038, 68041, 68044, 68048, 68052, 68056, 68060, 68063,
- 68068, 68072, 68077, 68082, 68086, 68091, 68095, 68100, 68105, 68110,
- 68115, 68120, 68126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68132, 68137, 68141,
- 68146, 68153, 68158, 68163, 68167, 68172, 68177, 68181, 68185, 68190,
- 68196, 0, 0, 68202, 68206, 68209, 68212, 68215, 68218, 68221, 68224,
- 68227, 68230, 0, 0, 68233, 68238, 68243, 68249, 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,
- 68256, 68260, 68264, 68268, 68272, 68276, 68280, 68284, 68288, 68292,
- 68296, 68300, 68304, 68308, 68312, 68316, 68320, 68324, 68328, 68332,
- 68336, 68340, 68344, 68348, 68352, 68356, 68360, 68364, 68368, 68372,
- 68376, 68380, 68384, 68388, 68392, 68396, 68400, 68404, 68408, 68412,
- 68416, 68420, 68424, 68428, 68432, 68436, 68440, 68444, 68448, 68452,
- 68456, 68460, 68464, 68468, 68472, 68476, 68480, 68484, 68488, 68492,
- 68496, 68500, 68504, 68508, 68512, 68516, 68520, 68524, 68528, 68532,
- 68536, 68540, 68544, 68548, 68552, 68556, 68560, 68564, 68568, 68572,
- 68576, 68580, 68584, 68588, 68592, 68596, 68600, 68604, 68608, 68612,
- 68616, 68620, 68624, 68628, 68632, 68636, 68640, 68644, 68648, 68652,
- 68656, 68660, 68664, 68668, 68672, 68676, 68680, 68684, 68688, 68692,
- 68696, 68700, 68704, 68708, 68712, 68716, 68720, 68724, 68728, 68732,
- 68736, 68740, 68744, 68748, 68752, 68756, 68760, 68764, 68768, 68772,
- 68776, 68780, 68784, 68788, 68792, 68796, 68800, 68804, 68808, 68812,
- 68816, 68820, 68824, 68828, 68832, 68836, 68840, 68844, 68848, 68852,
- 68856, 68860, 68864, 68868, 68872, 68876, 68880, 68884, 68888, 68892,
- 68896, 68900, 68904, 68908, 68912, 68916, 68920, 68924, 68928, 68932,
- 68936, 68940, 68944, 68948, 68952, 68956, 68960, 68964, 68968, 68972,
- 68976, 68980, 68984, 68988, 68992, 68996, 69000, 69004, 69008, 69012,
- 69016, 69020, 69024, 69028, 69032, 69036, 69040, 69044, 69048, 69052,
- 69056, 69060, 69064, 69068, 69072, 69076, 69080, 69084, 69088, 69092,
- 69096, 69100, 69104, 69108, 69112, 69116, 69120, 69124, 69128, 69132,
- 69136, 69140, 69144, 69148, 69152, 69156, 69160, 69164, 69168, 69172,
- 69176, 69180, 69184, 69188, 69192, 69196, 69200, 69204, 69208, 69212,
- 69216, 69220, 69224, 69228, 69232, 69236, 69240, 69244, 69248, 69252,
- 69256, 69260, 69264, 69268, 69272, 69276, 69280, 69284, 69288, 69292,
- 69296, 69300, 69304, 69308, 69312, 69316, 69320, 69324, 69328, 69332,
- 69336, 69340, 69344, 69348, 69352, 69356, 69360, 69364, 69368, 69372,
- 69376, 69380, 69384, 69388, 69392, 69396, 69400, 69404, 69408, 69412,
- 69416, 69420, 69424, 69428, 69432, 69436, 69440, 69444, 69448, 69452,
- 69456, 69460, 0, 0, 69464, 69468, 69472, 69476, 69480, 69484, 69488,
- 69492, 69496, 69500, 69504, 69508, 69512, 69516, 69520, 69524, 69528,
- 69532, 69536, 69540, 69544, 69548, 69552, 69556, 69560, 69564, 69568,
- 69572, 69576, 69580, 69584, 69588, 69592, 69596, 69600, 69604, 69608,
- 69612, 69616, 69620, 69624, 69628, 69632, 69636, 69640, 69644, 69648,
- 69652, 69656, 69660, 69664, 69668, 69672, 69676, 69680, 69684, 69688,
- 69692, 69696, 0, 0, 0, 0, 0, 69700, 69704, 69708, 69712, 69716, 69720,
- 69724, 69728, 69732, 69736, 69740, 69744, 69748, 69752, 69756, 69760,
- 69764, 69768, 69772, 69776, 69780, 69784, 69788, 69792, 69796, 69800,
- 69804, 69808, 69812, 69816, 69820, 69824, 69828, 69832, 69836, 69840,
- 69844, 69848, 69852, 69856, 69860, 69864, 69868, 69872, 69876, 69880,
- 69884, 69888, 69892, 69896, 69900, 69904, 69908, 69912, 69916, 69920,
- 69924, 69928, 69932, 69936, 69940, 69944, 69948, 69952, 69956, 69960,
- 69964, 69968, 69972, 69976, 69980, 69984, 69988, 69992, 69996, 70000,
- 70004, 70008, 70012, 70016, 70020, 70024, 70028, 70032, 70036, 70040,
- 70044, 70048, 70052, 70056, 70060, 70064, 70068, 70072, 70076, 70080,
- 70084, 70088, 70092, 70096, 70100, 70104, 70108, 70112, 70116, 70120, 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, 70124, 70129, 70134, 70139, 70144,
- 70149, 70157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70162, 70169, 70176,
- 70183, 70190, 0, 0, 0, 0, 0, 70197, 70204, 70211, 70221, 70227, 70233,
- 70239, 70245, 70251, 70257, 70264, 70270, 70276, 70282, 70291, 70300,
- 70312, 70324, 70330, 70336, 70342, 70349, 70356, 70363, 70370, 70377, 0,
- 70384, 70391, 70398, 70406, 70413, 0, 70420, 0, 70427, 70434, 0, 70441,
- 70449, 0, 70456, 70463, 70470, 70477, 70484, 70491, 70498, 70505, 70512,
- 70519, 70524, 70531, 70538, 70544, 70550, 70556, 70562, 70568, 70574,
- 70580, 70586, 70592, 70598, 70604, 70610, 70616, 70622, 70628, 70634,
- 70640, 70646, 70652, 70658, 70664, 70670, 70676, 70682, 70688, 70694,
- 70700, 70706, 70712, 70718, 70724, 70730, 70736, 70742, 70748, 70754,
- 70760, 70766, 70772, 70778, 70784, 70790, 70796, 70802, 70808, 70814,
- 70820, 70826, 70832, 70838, 70844, 70850, 70856, 70862, 70868, 70874,
- 70880, 70886, 70892, 70898, 70904, 70910, 70916, 70922, 70928, 70934,
- 70940, 70946, 70952, 70958, 70964, 70970, 70976, 70982, 70988, 70994,
- 71002, 71010, 71016, 71022, 71028, 71034, 71043, 71052, 71060, 71068,
- 71076, 71084, 71092, 71100, 71108, 71116, 71123, 71130, 71140, 0, 0, 0,
+ 0, 104408, 104415, 104422, 104431, 104440, 104447, 104452, 104459,
+ 104466, 104475, 104486, 104497, 104502, 104509, 104514, 104519, 104524,
+ 104529, 104534, 104539, 104544, 104549, 104554, 104559, 104564, 104571,
+ 104578, 104583, 104588, 104593, 104598, 104605, 104612, 104620, 104625,
+ 104632, 104637, 104642, 104647, 104652, 104657, 104664, 104671, 104676,
+ 104681, 104686, 104691, 104696, 104701, 104706, 104711, 104716, 104721,
+ 104726, 104731, 104736, 104741, 104746, 104751, 104756, 104761, 104766,
+ 104773, 104778, 104783, 104792, 104799, 104804, 104809, 104814, 104819,
+ 104824, 104829, 104834, 104839, 104844, 104849, 104854, 104859, 104864,
+ 104869, 104874, 104879, 104884, 104889, 104894, 104899, 104904, 104910,
+ 104918, 104924, 104932, 104940, 104948, 104954, 104960, 104966, 104972,
+ 104978, 104986, 104996, 105004, 105012, 105018, 105024, 105032, 105040,
+ 105046, 105054, 105062, 105070, 105076, 105082, 105088, 105094, 105100,
+ 105106, 105114, 105122, 105128, 105134, 105140, 105146, 105152, 105160,
+ 105166, 105172, 105178, 105184, 105190, 105196, 105204, 105210, 105216,
+ 105222, 105228, 105236, 105244, 105250, 105256, 105262, 105267, 105273,
+ 105279, 105286, 105291, 105296, 105301, 105306, 105311, 105316, 105321,
+ 105326, 105331, 105340, 105347, 105352, 105357, 105362, 105369, 105374,
+ 105379, 105384, 105391, 105396, 105401, 105406, 105411, 105416, 105421,
+ 105426, 105431, 105436, 105441, 105446, 105453, 105458, 105465, 105470,
+ 105475, 105482, 105487, 105492, 105497, 105502, 105507, 105512, 105517,
+ 105522, 105527, 105532, 105537, 105542, 105547, 105552, 105557, 105562,
+ 105567, 105572, 105577, 105584, 105589, 105594, 105599, 105604, 105609,
+ 105614, 105619, 105624, 105629, 105634, 105639, 105644, 105649, 105656,
+ 105661, 105666, 105673, 105678, 105683, 105688, 105693, 105698, 105703,
+ 105708, 105713, 105718, 105723, 105730, 105735, 105740, 105745, 105750,
+ 105755, 105762, 105769, 105774, 105779, 105784, 105789, 105794, 105799,
+ 105804, 105809, 105814, 105819, 105824, 105829, 105834, 105839, 105844,
+ 105849, 105854, 105859, 105864, 105869, 105874, 105879, 105884, 105889,
+ 105894, 105899, 105904, 105909, 105914, 105919, 105924, 105929, 105934,
+ 105939, 105944, 105949, 105956, 105961, 105966, 105971, 105976, 105981,
+ 105986, 105991, 105996, 106001, 106006, 106011, 106016, 106021, 106026,
+ 106031, 106036, 106041, 106046, 106051, 106056, 106061, 106066, 106071,
+ 106076, 106081, 106086, 106091, 106096, 106101, 106106, 106111, 106116,
+ 106121, 106126, 106131, 106136, 106141, 106146, 106151, 106156, 106161,
+ 106166, 106171, 106176, 106181, 106186, 106191, 106196, 106201, 106206,
+ 106211, 106216, 106221, 106226, 106231, 106236, 106241, 106246, 106253,
+ 106258, 106263, 106268, 106273, 106278, 106283, 106287, 106292, 106297,
+ 106302, 106307, 106312, 106317, 106322, 106327, 106332, 106337, 106342,
+ 106347, 106352, 106357, 106364, 106369, 106374, 106380, 106385, 106390,
+ 106395, 106400, 106405, 106410, 106415, 106420, 106425, 106430, 106435,
+ 106440, 106445, 106450, 106455, 106460, 106465, 106470, 106475, 106480,
+ 106485, 106490, 106495, 106500, 106505, 106510, 106515, 106520, 106525,
+ 106530, 106535, 106540, 106545, 106550, 106555, 106560, 106565, 106570,
+ 106575, 106580, 106585, 106590, 106595, 106602, 106607, 106612, 106619,
+ 106626, 106631, 106636, 106641, 106646, 106651, 106656, 106661, 106666,
+ 106671, 106676, 106681, 106686, 106691, 106696, 106701, 106706, 106711,
+ 106716, 106721, 106726, 106731, 106736, 106741, 106746, 106751, 106758,
+ 106763, 106768, 106773, 106778, 106783, 106788, 106793, 106798, 106803,
+ 106808, 106813, 106818, 106823, 106828, 106833, 106838, 106843, 106848,
+ 106855, 106860, 106865, 106870, 106875, 106880, 106885, 106890, 106896,
+ 106901, 106906, 106911, 106916, 106921, 106926, 106931, 106936, 106943,
+ 106950, 106955, 106960, 106964, 106969, 106973, 106977, 106982, 106989,
+ 106994, 106999, 107008, 107013, 107018, 107023, 107028, 107035, 107042,
+ 107047, 107052, 107057, 107062, 107069, 107074, 107079, 107084, 107089,
+ 107094, 107099, 107104, 107109, 107114, 107119, 107124, 107129, 107136,
+ 107140, 107145, 107150, 107155, 107160, 107164, 107169, 107174, 107179,
+ 107184, 107189, 107194, 107199, 107204, 107209, 107215, 107221, 107227,
+ 107233, 107239, 107245, 107251, 107257, 107263, 107269, 107275, 107281,
+ 107286, 107292, 107298, 107304, 107310, 107316, 107322, 107328, 107334,
+ 107340, 107346, 107352, 107357, 107363, 107369, 107375, 107381, 107387,
+ 107393, 107399, 107405, 107411, 107417, 107423, 107429, 107435, 107441,
+ 107447, 107453, 107459, 107465, 107471, 107477, 107482, 107488, 107494,
+ 107500, 107506, 107512, 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, 71150, 71156, 71162, 71168, 71174, 71179, 71184, 71190,
- 71196, 71202, 71208, 71216, 71222, 71228, 71236, 71244, 71252, 71260,
- 71265, 71270, 71275, 71280, 71292, 71304, 71314, 71324, 71335, 71346,
- 71357, 71368, 71378, 71388, 71399, 71410, 71421, 71432, 71442, 71452,
- 71462, 71477, 71492, 71507, 71514, 71521, 71528, 71535, 71545, 71555,
- 71565, 71576, 71586, 71594, 71602, 71610, 71618, 71627, 71635, 71643,
- 71651, 71659, 71667, 71676, 71684, 71692, 71700, 71709, 71717, 71724,
- 71731, 71738, 71745, 71752, 71759, 71766, 71774, 71782, 71790, 71798,
- 71806, 71814, 71822, 71830, 71838, 71846, 71854, 71862, 71870, 71878,
- 71886, 71894, 71902, 71910, 71918, 71926, 71934, 71943, 71951, 71959,
- 71967, 71976, 71984, 71992, 72000, 72008, 72016, 72024, 72032, 72041,
- 72049, 72056, 72063, 72070, 72077, 72085, 72092, 72099, 72106, 72113,
- 72120, 72128, 72135, 72143, 72151, 72159, 72167, 72176, 72184, 72192,
- 72200, 72209, 72217, 72224, 72231, 72238, 72245, 72253, 72260, 72270,
- 72280, 72290, 72299, 72308, 72317, 72326, 72335, 72345, 72356, 72367,
- 72377, 72388, 72399, 72409, 72418, 72427, 72435, 72444, 72453, 72461,
- 72470, 72479, 72487, 72496, 72505, 72513, 72522, 72531, 72539, 72548,
- 72557, 72565, 72574, 72582, 72591, 72599, 72607, 72615, 72623, 72632,
- 72640, 72647, 72655, 72662, 72669, 72676, 72685, 72694, 72702, 72711,
- 72720, 72728, 72738, 72746, 72754, 72761, 72769, 72777, 72784, 72794,
- 72804, 72814, 72824, 72835, 72843, 72851, 72859, 72867, 72876, 72884,
- 72892, 72900, 72908, 72917, 72925, 72932, 72939, 72946, 72953, 72960,
- 72967, 72975, 72983, 72991, 72999, 73007, 73015, 73023, 73031, 73039,
- 73047, 73055, 73063, 73071, 73079, 73087, 73095, 73103, 73111, 73119,
- 73127, 73135, 73143, 73151, 73159, 73167, 73175, 73183, 73191, 73198,
- 73205, 73212, 73219, 73227, 73234, 73241, 73248, 73255, 73263, 73271,
- 73279, 73287, 73296, 73304, 73312, 73322, 73329, 73336, 73343, 73350,
- 73358, 73368, 73379, 73387, 73396, 73404, 73413, 73421, 73430, 73438,
- 73447, 73455, 73464, 73472, 73480, 73487, 73495, 73504, 73511, 73519,
- 73528, 73537, 73546, 73555, 73563, 73572, 73580, 73589, 73597, 73606,
- 73614, 73623, 73631, 73639, 73646, 73654, 73661, 73669, 73676, 73685,
- 73693, 73702, 73710, 73718, 73726, 73734, 73742, 73751, 73760, 73769,
- 73778, 73787, 73795, 73804, 73812, 73821, 73829, 73838, 73846, 73855,
- 73863, 73871, 73878, 73886, 73893, 73901, 73908, 73917, 73925, 73934,
- 73942, 73950, 73958, 73966, 73974, 73983, 73992, 74001, 74010, 74018,
- 74026, 74034, 74042, 74051, 74060, 74068, 74076, 74084, 74092, 74100,
- 74108, 74116, 74124, 74132, 74140, 74148, 74153, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 74158, 74168, 74178, 74188, 74198, 74208, 74218,
- 74228, 74238, 74247, 74256, 74265, 74275, 74285, 74295, 74306, 74316,
- 74326, 74336, 74346, 74356, 74366, 74376, 74386, 74396, 74406, 74416,
- 74426, 74436, 74446, 74456, 74467, 74477, 74487, 74497, 74507, 74517,
- 74527, 74537, 74547, 74557, 74568, 74578, 74588, 74599, 74609, 74619,
- 74629, 74639, 74648, 74657, 74667, 74676, 74685, 74694, 74703, 74712,
- 74721, 74730, 74739, 74748, 74757, 74766, 74775, 0, 0, 74784, 74793,
- 74803, 74813, 74823, 74834, 74844, 74854, 74865, 74875, 74886, 74895,
- 74904, 74914, 74924, 74935, 74945, 74956, 74966, 74977, 74986, 74996,
- 75006, 75017, 75027, 75037, 75047, 75056, 75065, 75074, 75083, 75092,
- 75101, 75111, 75121, 75131, 75140, 75150, 75160, 75170, 75179, 75188,
- 75198, 75207, 75217, 75226, 75235, 75244, 75254, 75264, 75274, 75284,
- 75294, 75304, 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, 75314, 75329,
- 75344, 75350, 75356, 75362, 75368, 75374, 75380, 75386, 75392, 75400,
- 75404, 75407, 0, 0, 75415, 75418, 75421, 75424, 75427, 75430, 75433,
- 75436, 75439, 75442, 75445, 75448, 75451, 75454, 75457, 75460, 75463,
- 75470, 75478, 75488, 75495, 75502, 75510, 75518, 75528, 75539, 0, 0, 0,
- 0, 0, 0, 75547, 75552, 75557, 75564, 75571, 75577, 75583, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 75588, 75597, 75606, 75615, 75623, 75633, 75641, 75649,
- 75658, 75667, 75678, 75689, 75699, 75709, 75719, 75729, 75738, 75747,
- 75756, 75765, 75775, 75785, 75789, 75794, 75802, 75810, 75814, 75818,
- 75822, 75827, 75832, 75837, 75842, 75845, 75849, 0, 75854, 75857, 75860,
- 75864, 75868, 75873, 75877, 75881, 75886, 75891, 75898, 75905, 75908,
- 75911, 75914, 75917, 75920, 75924, 75928, 0, 75932, 75937, 75941, 75945,
- 0, 0, 0, 0, 75950, 75955, 75962, 75967, 75972, 0, 75977, 75982, 75987,
- 75992, 75997, 76002, 76007, 76012, 76017, 76022, 76027, 76032, 76041,
- 76050, 76058, 76066, 76075, 76084, 76093, 76102, 76110, 76118, 76126,
- 76134, 76139, 76144, 76150, 76156, 76162, 76168, 76176, 76184, 76190,
- 76196, 76202, 76208, 76214, 76220, 76226, 76232, 76237, 76242, 76247,
- 76252, 76257, 76262, 76267, 76272, 76277, 76282, 76287, 76292, 76298,
- 76304, 76310, 76316, 76322, 76328, 76334, 76340, 76346, 76352, 76358,
- 76364, 76370, 76376, 76382, 76388, 76394, 76400, 76406, 76412, 76418,
- 76424, 76430, 76436, 76442, 76448, 76454, 76460, 76466, 76472, 76478,
- 76484, 76490, 76496, 76502, 76508, 76514, 76520, 76526, 76532, 76538,
- 76544, 76550, 76556, 76562, 76568, 76574, 76580, 76586, 76592, 76598,
- 76604, 76609, 76614, 76619, 76624, 76629, 76634, 76639, 76644, 76650,
- 76656, 76662, 76668, 76674, 76680, 76686, 76692, 76698, 76704, 76710,
- 76716, 76721, 76726, 76731, 76736, 76747, 76758, 76768, 76778, 76789,
- 76800, 76807, 0, 0, 76814, 0, 76822, 76826, 76830, 76833, 76837, 76841,
- 76844, 76847, 76851, 76855, 76858, 76861, 76864, 76867, 76872, 76875,
- 76879, 76882, 76885, 76888, 76891, 76894, 76897, 76900, 76903, 76906,
- 76909, 76912, 76916, 76920, 76924, 76928, 76933, 76938, 76944, 76950,
- 76956, 76961, 76967, 76972, 76977, 76982, 76988, 76994, 76999, 77004,
- 77009, 77014, 77020, 77026, 77031, 77036, 77042, 77047, 77052, 77058,
- 77064, 77070, 77076, 77080, 77085, 77089, 77094, 77098, 77103, 77108,
- 77114, 77120, 77126, 77131, 77137, 77142, 77147, 77152, 77158, 77164,
- 77169, 77174, 77179, 77184, 77190, 77196, 77201, 77206, 77212, 77217,
- 77222, 77228, 77234, 77240, 77246, 77251, 77255, 77260, 77262, 77267,
- 77272, 77278, 77283, 77288, 77292, 77298, 77303, 77308, 77313, 77318,
- 77323, 77328, 77333, 77339, 77345, 77351, 77359, 77363, 77367, 77371,
- 77375, 77379, 77383, 77388, 77393, 77398, 77403, 77408, 77413, 77418,
- 77423, 77428, 77433, 77438, 77443, 77448, 77452, 77457, 77462, 77467,
- 77472, 77477, 77481, 77486, 77491, 77496, 77501, 77505, 77510, 77515,
- 77520, 77525, 77529, 77534, 77539, 77543, 77548, 77553, 77558, 77563,
- 77568, 77572, 77579, 77586, 77590, 77595, 77600, 77605, 77610, 77615,
- 77620, 77625, 77630, 77635, 77640, 77645, 77650, 77655, 77660, 77665,
- 77670, 77675, 77680, 77685, 77690, 77695, 77700, 77705, 77710, 77715,
- 77720, 77725, 77730, 77735, 0, 0, 0, 77740, 77744, 77749, 77753, 77758,
- 77763, 0, 0, 77767, 77772, 77777, 77781, 77786, 77791, 0, 0, 77796,
- 77801, 77805, 77810, 77815, 77820, 0, 0, 77825, 77830, 77835, 0, 0, 0,
- 77839, 77843, 77847, 77850, 77853, 77857, 77861, 0, 77865, 77871, 77874,
- 77878, 77881, 77885, 77889, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77893, 77899,
- 77905, 77911, 77917, 0, 0, 77921, 77927, 77933, 77939, 77945, 77951,
- 77958, 77965, 77972, 77979, 77986, 77993, 0, 78000, 78007, 78014, 78020,
- 78027, 78034, 78041, 78048, 78054, 78061, 78068, 78075, 78082, 78089,
- 78096, 78103, 78110, 78117, 78123, 78130, 78137, 78144, 78151, 78158,
- 78165, 78172, 0, 78179, 78185, 78192, 78199, 78206, 78213, 78220, 78227,
- 78234, 78241, 78248, 78255, 78262, 78269, 78275, 78282, 78289, 78296,
- 78303, 0, 78310, 78317, 0, 78324, 78331, 78338, 78345, 78352, 78359,
- 78366, 78373, 78380, 78387, 78394, 78401, 78408, 78415, 78422, 0, 0,
- 78428, 78433, 78438, 78443, 78448, 78453, 78458, 78463, 78468, 78473,
- 78478, 78483, 78488, 78493, 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, 78498, 78505,
- 78512, 78519, 78526, 78533, 78540, 78547, 78554, 78561, 78568, 78575,
- 78582, 78589, 78596, 78603, 78610, 78617, 78624, 78631, 78639, 78647,
- 78654, 78661, 78666, 78674, 78682, 78689, 78696, 78701, 78708, 78713,
- 78718, 78725, 78730, 78735, 78740, 78748, 78753, 78758, 78765, 78770,
- 78775, 78782, 78789, 78794, 78799, 78804, 78809, 78814, 78819, 78824,
- 78829, 78834, 78841, 78846, 78853, 78858, 78863, 78868, 78873, 78878,
- 78883, 78888, 78893, 78898, 78903, 78908, 78915, 78922, 78929, 78936,
- 78942, 78947, 78954, 78959, 78964, 78973, 78980, 78989, 78996, 79001,
- 79006, 79014, 79019, 79024, 79029, 79034, 79039, 79046, 79051, 79056,
- 79061, 79066, 79071, 79078, 79085, 79092, 79099, 79106, 79113, 79120,
- 79127, 79134, 79141, 79148, 79155, 79162, 79169, 79176, 79183, 79190,
- 79197, 79204, 79211, 79218, 79225, 79232, 79239, 79246, 79253, 79260,
- 79267, 0, 0, 0, 0, 0, 79274, 79281, 79288, 0, 0, 0, 0, 79292, 79295,
- 79298, 79301, 79304, 79307, 79310, 79313, 79316, 79319, 79323, 79327,
- 79331, 79335, 79339, 79343, 79347, 79351, 79355, 79360, 79365, 79370,
- 79376, 79382, 79388, 79394, 79400, 79406, 79411, 79416, 79421, 79427,
- 79433, 79439, 79445, 79451, 79457, 79463, 79469, 79475, 79481, 79487,
- 79493, 79499, 79505, 0, 0, 0, 79511, 79518, 79525, 79532, 79539, 79546,
- 79555, 79564, 79571, 79578, 79586, 79594, 79602, 79608, 79615, 79624,
- 79633, 79642, 79651, 79660, 79669, 79679, 79690, 79700, 79711, 79720,
- 79729, 79738, 79748, 79759, 79769, 79780, 79791, 79800, 79808, 79814,
- 79820, 79826, 79832, 79840, 79848, 79854, 79861, 79871, 79878, 79885,
- 79892, 79899, 79906, 79916, 79923, 79930, 79938, 79946, 79955, 79964,
- 79973, 79982, 79991, 79999, 80008, 80017, 80026, 80030, 80037, 80042,
- 80047, 80051, 80055, 80059, 80063, 80068, 80073, 80079, 80085, 80089,
- 80095, 80099, 80103, 80107, 80111, 80115, 80119, 80125, 0, 0, 0, 0, 0,
- 80129, 80134, 80139, 80144, 80149, 80156, 80161, 80166, 80171, 80176,
- 80181, 80186, 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, 80191, 80198, 80207, 80216, 80223, 80230, 80237,
- 80244, 80251, 80258, 80264, 80271, 80278, 80285, 80292, 80299, 80306,
- 80313, 80320, 80329, 80336, 80343, 80350, 80357, 80364, 80371, 80378,
- 80385, 80394, 80401, 80408, 80415, 80422, 80429, 80436, 80445, 80452,
- 80459, 80466, 80473, 80482, 80489, 80496, 80503, 80511, 80520, 0, 0,
- 80529, 80533, 80537, 80542, 80547, 80551, 80556, 80560, 80565, 80570,
- 80575, 80580, 80585, 80590, 80594, 80598, 80602, 80607, 80612, 80616,
- 80621, 80626, 80630, 80634, 80639, 80644, 80649, 80654, 80658, 0, 0, 0,
- 80663, 80667, 80672, 80677, 80681, 80686, 80690, 80695, 80700, 80705,
- 80710, 80714, 80718, 80723, 80728, 80733, 80738, 80742, 80747, 80751,
- 80756, 80761, 80765, 80770, 80775, 80780, 80784, 80788, 80793, 80798,
- 80803, 80808, 80813, 80817, 80822, 80827, 80832, 80837, 80842, 80847,
- 80852, 80857, 80862, 80867, 80872, 80877, 80882, 80887, 80892, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 107518, 107523, 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, 80897, 80901,
- 80906, 80911, 80916, 80920, 80925, 80930, 80935, 80940, 80944, 80948,
- 80953, 80958, 80963, 80968, 80972, 80977, 80982, 80987, 80992, 80997,
- 81002, 81006, 81011, 81016, 81021, 81026, 81031, 81036, 81041, 0, 81046,
- 81050, 81054, 81059, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81064, 81069,
- 81074, 81079, 81084, 81089, 81094, 81099, 81104, 81109, 81114, 81119,
- 81124, 81129, 81134, 81139, 81144, 81149, 81154, 81159, 81164, 81169,
- 81174, 81179, 81184, 81189, 81194, 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, 81201, 81206, 81211,
- 81216, 81221, 81226, 81231, 81236, 81241, 81246, 81251, 81256, 81261,
- 81266, 81271, 81276, 81281, 81286, 81291, 81296, 81301, 81306, 81311,
- 81316, 81321, 81326, 81331, 81335, 81339, 81343, 0, 81348, 81354, 81359,
- 81364, 81369, 81374, 81380, 81386, 81392, 81398, 81404, 81410, 81416,
- 81422, 81428, 81434, 81440, 81446, 81452, 81457, 81463, 81469, 81475,
- 81481, 81486, 81492, 81498, 81503, 81509, 81515, 81520, 81526, 81532,
- 81538, 81544, 81550, 81556, 0, 0, 0, 0, 81561, 81567, 81573, 81579,
- 81585, 81591, 81597, 81603, 81609, 81616, 81621, 81626, 81632, 81638, 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, 81644, 81649, 81654,
- 81659, 81665, 81670, 81676, 81682, 81688, 81694, 81701, 81707, 81714,
- 81719, 81724, 81729, 81734, 81738, 81743, 81748, 81753, 81758, 81763,
- 81768, 81773, 81778, 81783, 81788, 81793, 81798, 81803, 81808, 81813,
- 81818, 81823, 81828, 81833, 81838, 81843, 81848, 81853, 81858, 81863,
- 81868, 81874, 81879, 81885, 81891, 81897, 81903, 81910, 81916, 81923,
- 81928, 81933, 81938, 81943, 81947, 81952, 81957, 81962, 81967, 81972,
- 81977, 81982, 81987, 81992, 81997, 82002, 82007, 82012, 82017, 82022,
- 82027, 82032, 82037, 82042, 82047, 82052, 82057, 82062, 82067, 82072,
- 82077, 82082, 82087, 82092, 82097, 82102, 82107, 82112, 82117, 82122,
- 82127, 82132, 82137, 82142, 82147, 82152, 82157, 82162, 82167, 82172,
- 82177, 82182, 82187, 82192, 82197, 82202, 82207, 82212, 82217, 82222,
- 82227, 82232, 82237, 82242, 82247, 82252, 82257, 82262, 82267, 82272,
- 82277, 82282, 82287, 82292, 82297, 82302, 82307, 82312, 82317, 82322,
- 82327, 82332, 82337, 82341, 82346, 82351, 82356, 82361, 82366, 82371,
- 82376, 82381, 82386, 82391, 82396, 82401, 82405, 82409, 82413, 82417,
- 82421, 82425, 82429, 82434, 82439, 0, 0, 82444, 82449, 82453, 82457,
- 82461, 82465, 82469, 82473, 82477, 82481, 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, 107529, 107534,
+ 107539, 107544, 107551, 107558, 107565, 107572, 107577, 107582, 107587,
+ 107592, 107599, 107604, 107611, 107618, 107623, 107628, 107633, 107640,
+ 107645, 107650, 107657, 107664, 107669, 107674, 107679, 107686, 107693,
+ 107700, 107705, 107710, 107717, 107724, 107731, 107738, 107743, 107748,
+ 107753, 107760, 107765, 107770, 107775, 107782, 107791, 107798, 107803,
+ 107808, 107813, 107818, 107823, 107828, 107837, 107844, 107849, 107856,
+ 107863, 107868, 107873, 107878, 107885, 107890, 107897, 107904, 107909,
+ 107914, 107919, 107926, 107933, 107938, 107943, 107950, 107957, 107964,
+ 107969, 107974, 107979, 107984, 107991, 108000, 108009, 108014, 108021,
+ 108030, 108035, 108040, 108045, 108050, 108057, 108064, 108071, 108078,
+ 108083, 108088, 108093, 108100, 108107, 108114, 108119, 108124, 108131,
+ 108136, 108143, 108148, 108155, 108160, 108167, 108174, 108179, 108184,
+ 108189, 108194, 108199, 108204, 108209, 108214, 108219, 108226, 108233,
+ 108240, 108247, 108254, 108263, 108268, 108273, 108280, 108287, 108292,
+ 108299, 108306, 108313, 108320, 108327, 108334, 108339, 108344, 108349,
+ 108354, 108359, 108368, 108377, 108386, 108395, 108404, 108413, 108422,
+ 108431, 108436, 108447, 108458, 108467, 108472, 108477, 108482, 108487,
+ 108496, 108503, 108510, 108517, 108524, 108531, 108538, 108547, 108556,
+ 108567, 108576, 108587, 108596, 108603, 108612, 108623, 108632, 108641,
+ 108650, 108659, 108666, 108673, 108680, 108689, 108698, 108709, 108718,
+ 108727, 108738, 108743, 108748, 108759, 108767, 108776, 108785, 108794,
+ 108805, 108814, 108823, 108834, 108845, 108856, 108867, 108878, 108889,
+ 108896, 108903, 108910, 108917, 108928, 108937, 108944, 108951, 108958,
+ 108969, 108980, 108991, 109002, 109013, 109024, 109035, 109046, 109053,
+ 109060, 109069, 109078, 109085, 109092, 109099, 109108, 109117, 109126,
+ 109133, 109142, 109151, 109160, 109167, 109174, 109179, 109185, 109192,
+ 109199, 109206, 109213, 109220, 109227, 109236, 109245, 109254, 109263,
+ 109270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109279, 109285, 109290, 109295,
+ 109302, 109308, 109314, 109320, 109326, 109332, 109338, 109344, 109348,
+ 109352, 109358, 109364, 109370, 109374, 109379, 109384, 109388, 109392,
+ 109395, 109401, 109407, 109413, 109419, 109425, 109431, 109437, 109443,
+ 109449, 109459, 109469, 109475, 109481, 109491, 109501, 109507, 0, 0,
+ 109513, 109521, 109526, 109531, 109537, 109543, 109549, 109555, 109561,
+ 109567, 109574, 109581, 109587, 109593, 109599, 109605, 109611, 109617,
+ 109623, 109629, 109634, 109640, 109646, 109652, 109658, 109664, 109673,
+ 109679, 109684, 109692, 109699, 109706, 109715, 109724, 109733, 109742,
+ 109751, 109760, 109769, 109778, 109788, 109798, 109806, 109814, 109823,
+ 109832, 109838, 109844, 109850, 109856, 109864, 109872, 109876, 109882,
+ 109887, 109893, 109899, 109905, 109911, 109917, 109926, 109931, 109938,
+ 109943, 109948, 109953, 109959, 109965, 109971, 109978, 109983, 109988,
+ 109993, 109998, 110003, 110009, 110015, 110021, 110027, 110033, 110039,
+ 110045, 110051, 110056, 110061, 110066, 110071, 110076, 110081, 110086,
+ 110091, 110097, 110103, 110108, 110113, 110118, 110123, 110128, 110134,
+ 110141, 110145, 110149, 110153, 110157, 110161, 110165, 110169, 110173,
+ 110181, 110191, 110195, 110199, 110205, 110211, 110217, 110223, 110229,
+ 110235, 110241, 110247, 110253, 110259, 110265, 110271, 110277, 110283,
+ 110287, 110291, 110298, 110304, 110310, 110316, 110321, 110328, 110333,
+ 110339, 110345, 110351, 110357, 110362, 110366, 110372, 110376, 110380,
+ 110384, 110390, 110396, 110400, 110406, 110412, 110418, 110424, 110430,
+ 110438, 110446, 110452, 110458, 110464, 110470, 110482, 110494, 110508,
+ 110520, 110532, 110546, 110560, 110574, 110578, 110586, 110594, 110599,
+ 110603, 110607, 110611, 110615, 110619, 110623, 110627, 110633, 110639,
+ 110645, 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, 110651, 110657, 110663, 110669,
+ 110675, 110681, 110687, 110693, 110699, 110705, 110711, 110717, 110723,
+ 110729, 110735, 110741, 110747, 110753, 110759, 110765, 110771, 110777,
+ 110783, 110789, 110795, 110801, 110807, 110813, 110819, 110825, 110831,
+ 110837, 110843, 110849, 110855, 110861, 110867, 110873, 110879, 110885,
+ 110891, 110897, 110903, 110909, 110915, 110921, 110927, 110933, 110939,
+ 110945, 110951, 110957, 110963, 110969, 110975, 110981, 110987, 110993,
+ 110999, 111005, 111011, 111017, 111023, 111029, 111035, 111041, 111047,
+ 111052, 111057, 111062, 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, 111066, 111071,
+ 111078, 111085, 111092, 111099, 111104, 111108, 111114, 111118, 111122,
+ 111128, 111132, 111136, 111140, 111146, 111153, 111157, 111161, 111165,
+ 111169, 111173, 111177, 111183, 111187, 111191, 111195, 111199, 111203,
+ 111207, 111211, 111215, 111219, 111223, 111227, 111231, 111236, 111240,
+ 111244, 111248, 111252, 111256, 111260, 111264, 111268, 111272, 111279,
+ 111283, 111291, 111295, 111299, 111303, 111307, 111311, 111315, 111319,
+ 111326, 111330, 111334, 111338, 111342, 111346, 111352, 111356, 111362,
+ 111366, 111370, 111374, 111378, 111382, 111386, 111390, 111394, 111398,
+ 111402, 111406, 111410, 111414, 111418, 111422, 111426, 111430, 111434,
+ 111438, 111446, 111450, 111454, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111458,
+ 111466, 111474, 111482, 111490, 111498, 111506, 111514, 111522, 111530,
+ 111538, 111546, 111554, 111562, 111570, 111578, 111586, 111594, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111602, 111606, 111611, 111616, 111621,
+ 111625, 111630, 111635, 111640, 111644, 111649, 111654, 111658, 111662,
+ 111666, 111670, 111675, 111680, 111684, 111688, 111693, 111697, 111702,
+ 111707, 111712, 111717, 111722, 111726, 111731, 111736, 111741, 111745,
+ 111750, 111755, 111760, 111764, 111769, 111774, 111778, 111782, 111786,
+ 111790, 111795, 111800, 111804, 111808, 111813, 111817, 111822, 111827,
+ 111832, 111837, 111842, 111846, 111851, 111856, 111861, 111865, 111870,
+ 111875, 111880, 111884, 111889, 111894, 111898, 111902, 111906, 111910,
+ 111915, 111920, 111924, 111928, 111933, 111937, 111942, 111947, 111952,
+ 111957, 111962, 111966, 111971, 111976, 111981, 111985, 111990, 0,
+ 111995, 111999, 112004, 112009, 112013, 112017, 112021, 112025, 112030,
+ 112035, 112039, 112043, 112048, 112052, 112057, 112062, 112067, 112072,
+ 112077, 112082, 112088, 112094, 112100, 112105, 112111, 112117, 112123,
+ 112128, 112134, 112140, 112145, 112150, 112155, 112160, 112166, 112172,
+ 112177, 112182, 112188, 112193, 112199, 112205, 112211, 112217, 112223,
+ 112228, 112234, 112240, 112246, 112251, 112257, 112263, 112269, 112274,
+ 112280, 112286, 112291, 112296, 112301, 112306, 112312, 112318, 112323,
+ 112328, 112334, 112339, 112345, 112351, 112357, 112363, 112369, 0,
+ 112373, 112378, 0, 0, 112383, 0, 0, 112388, 112393, 0, 0, 112398, 112402,
+ 112406, 112411, 0, 112416, 112420, 112425, 112429, 112434, 112439,
+ 112444, 112449, 112454, 112458, 112463, 112468, 0, 112473, 0, 112478,
+ 112483, 112487, 112492, 112497, 112501, 112505, 0, 112509, 112514,
+ 112519, 112523, 112527, 112532, 112536, 112541, 112546, 112551, 112556,
+ 112561, 112566, 112572, 112578, 112584, 112589, 112595, 112601, 112607,
+ 112612, 112618, 112624, 112629, 112634, 112639, 112644, 112650, 112656,
+ 112661, 112666, 112672, 112677, 112683, 112689, 112695, 112701, 112707,
+ 112712, 112718, 112724, 112730, 112735, 112741, 112747, 112753, 112758,
+ 112764, 112770, 112775, 112780, 112785, 112790, 112796, 112802, 112807,
+ 112812, 112818, 112823, 112829, 112835, 112841, 112847, 112853, 112857,
+ 0, 112862, 112867, 112871, 112876, 0, 0, 112881, 112886, 112891, 112895,
+ 112899, 112903, 112907, 112912, 0, 112917, 112921, 112926, 112930,
+ 112935, 112940, 112945, 0, 112950, 112954, 112959, 112964, 112969,
+ 112973, 112978, 112983, 112988, 112992, 112997, 113002, 113006, 113010,
+ 113014, 113018, 113023, 113028, 113032, 113036, 113041, 113045, 113050,
+ 113055, 113060, 113065, 113070, 113074, 0, 113079, 113084, 113088,
+ 113093, 0, 113098, 113102, 113107, 113112, 113116, 0, 113120, 0, 0, 0,
+ 113124, 113128, 113133, 113137, 113142, 113147, 113152, 0, 113157,
+ 113161, 113166, 113171, 113176, 113180, 113185, 113190, 113195, 113199,
+ 113204, 113209, 113213, 113217, 113221, 113225, 113230, 113235, 113239,
+ 113243, 113248, 113252, 113257, 113262, 113267, 113272, 113277, 113282,
+ 113288, 113294, 113300, 113305, 113311, 113317, 113323, 113328, 113334,
+ 113340, 113345, 113350, 113355, 113360, 113366, 113372, 113377, 113382,
+ 113388, 113393, 113399, 113405, 113411, 113417, 113423, 113428, 113434,
+ 113440, 113446, 113451, 113457, 113463, 113469, 113474, 113480, 113486,
+ 113491, 113496, 113501, 113506, 113512, 113518, 113523, 113528, 113534,
+ 113539, 113545, 113551, 113557, 113563, 113569, 113573, 113578, 113583,
+ 113588, 113592, 113597, 113602, 113607, 113611, 113616, 113621, 113625,
+ 113629, 113633, 113637, 113642, 113647, 113651, 113655, 113660, 113664,
+ 113669, 113674, 113679, 113684, 113689, 113693, 113698, 113703, 113708,
+ 113712, 113717, 113722, 113727, 113731, 113736, 113741, 113745, 113749,
+ 113753, 113757, 113762, 113767, 113771, 113775, 113780, 113784, 113789,
+ 113794, 113799, 113804, 113809, 113814, 113820, 113826, 113832, 113837,
+ 113843, 113849, 113855, 113860, 113866, 113872, 113877, 113882, 113887,
+ 113892, 113898, 113904, 113909, 113914, 113920, 113925, 113931, 113937,
+ 113943, 113949, 113955, 113960, 113966, 113972, 113978, 113983, 113989,
+ 113995, 114001, 114006, 114012, 114018, 114023, 114028, 114033, 114038,
+ 114044, 114050, 114055, 114060, 114066, 114071, 114077, 114083, 114089,
+ 114095, 114101, 114106, 114112, 114118, 114124, 114129, 114135, 114141,
+ 114147, 114152, 114158, 114164, 114169, 114174, 114179, 114184, 114190,
+ 114196, 114201, 114206, 114212, 114217, 114223, 114229, 114235, 114241,
+ 114247, 114252, 114258, 114264, 114270, 114275, 114281, 114287, 114293,
+ 114298, 114304, 114310, 114315, 114320, 114325, 114330, 114336, 114342,
+ 114347, 114352, 114358, 114363, 114369, 114375, 114381, 114387, 114393,
+ 114399, 114406, 114413, 114420, 114426, 114433, 114440, 114447, 114453,
+ 114460, 114467, 114473, 114479, 114485, 114491, 114498, 114505, 114511,
+ 114517, 114524, 114530, 114537, 114544, 114551, 114558, 114565, 114571,
+ 114578, 114585, 114592, 114598, 114605, 114612, 114619, 114625, 114632,
+ 114639, 114645, 114651, 114657, 114663, 114670, 114677, 114683, 114689,
+ 114696, 114702, 114709, 114716, 114723, 114730, 114737, 114742, 114748,
+ 114754, 114760, 114765, 114771, 114777, 114783, 114788, 114794, 114800,
+ 114805, 114810, 114815, 114820, 114826, 114832, 114837, 114842, 114848,
+ 114853, 114859, 114865, 114871, 114877, 114883, 114888, 114894, 114900,
+ 114906, 114911, 114917, 114923, 114929, 114934, 114940, 114946, 114951,
+ 114956, 114961, 114966, 114972, 114978, 114983, 114988, 114994, 114999,
+ 115005, 115011, 115017, 115023, 115029, 115035, 0, 0, 115042, 115047,
+ 115052, 115057, 115062, 115067, 115072, 115077, 115082, 115087, 115092,
+ 115097, 115102, 115107, 115112, 115117, 115122, 115127, 115133, 115138,
+ 115143, 115148, 115153, 115158, 115163, 115168, 115172, 115177, 115182,
+ 115187, 115192, 115197, 115202, 115207, 115212, 115217, 115222, 115227,
+ 115232, 115237, 115242, 115247, 115252, 115257, 115263, 115268, 115273,
+ 115278, 115283, 115288, 115293, 115298, 115304, 115309, 115314, 115319,
+ 115324, 115329, 115334, 115339, 115344, 115349, 115354, 115359, 115364,
+ 115369, 115374, 115379, 115384, 115389, 115394, 115399, 115404, 115409,
+ 115414, 115419, 115425, 115430, 115435, 115440, 115445, 115450, 115455,
+ 115460, 115464, 115469, 115474, 115479, 115484, 115489, 115494, 115499,
+ 115504, 115509, 115514, 115519, 115524, 115529, 115534, 115539, 115544,
+ 115549, 115555, 115560, 115565, 115570, 115575, 115580, 115585, 115590,
+ 115596, 115601, 115606, 115611, 115616, 115621, 115626, 115632, 115638,
+ 115644, 115650, 115656, 115662, 115668, 115674, 115680, 115686, 115692,
+ 115698, 115704, 115710, 115716, 115722, 115728, 115735, 115741, 115747,
+ 115753, 115759, 115765, 115771, 115777, 115782, 115788, 115794, 115800,
+ 115806, 115812, 115818, 115824, 115830, 115836, 115842, 115848, 115854,
+ 115860, 115866, 115872, 115878, 115884, 115891, 115897, 115903, 115909,
+ 115915, 115921, 115927, 115933, 115940, 115946, 115952, 115958, 115964,
+ 115970, 115976, 115982, 115988, 115994, 116000, 116006, 116012, 116018,
+ 116024, 116030, 116036, 116042, 116048, 116054, 116060, 116066, 116072,
+ 116078, 116085, 116091, 116097, 116103, 116109, 116115, 116121, 116127,
+ 116132, 116138, 116144, 116150, 116156, 116162, 116168, 116174, 116180,
+ 116186, 116192, 116198, 116204, 116210, 116216, 116222, 116228, 116234,
+ 116241, 116247, 116253, 116259, 116265, 116271, 116277, 116283, 116290,
+ 116296, 116302, 116308, 116314, 116320, 116326, 116333, 116340, 116347,
+ 116354, 116361, 116368, 116375, 116382, 116389, 116396, 116403, 116410,
+ 116417, 116424, 116431, 116438, 116445, 116453, 116460, 116467, 116474,
+ 116481, 116488, 116495, 116502, 116508, 116515, 116522, 116529, 116536,
+ 116543, 116550, 116557, 116564, 116571, 116578, 116585, 116592, 116599,
+ 116606, 116613, 116620, 116627, 116635, 116642, 116649, 116656, 116663,
+ 116670, 116677, 116684, 116692, 116699, 116706, 116713, 116720, 116727,
+ 116734, 116739, 0, 0, 116744, 116749, 116753, 116757, 116761, 116765,
+ 116769, 116773, 116777, 116781, 116785, 116790, 116794, 116798, 116802,
+ 116806, 116810, 116814, 116818, 116822, 116826, 116831, 116835, 116839,
+ 116843, 116847, 116851, 116855, 116859, 116863, 116867, 116873, 116878,
+ 116883, 116888, 116893, 116898, 116903, 116908, 116913, 116918, 116924,
+ 116929, 116934, 116939, 116944, 116949, 116954, 116959, 116964, 116969,
+ 116976, 116983, 116990, 116997, 117004, 117011, 117017, 117024, 117031,
+ 117038, 117046, 117054, 117062, 117070, 117078, 117086, 117093, 117100,
+ 117107, 117115, 117123, 117131, 117139, 117147, 117155, 117162, 117169,
+ 117176, 117184, 117192, 117200, 117208, 117216, 117224, 117229, 117234,
+ 117239, 117244, 117249, 117254, 117259, 117264, 117269, 0, 0, 0, 0,
+ 117274, 117279, 117283, 117287, 117291, 117295, 117299, 117303, 117307,
+ 117311, 117315, 117319, 117323, 117327, 117331, 117335, 117339, 117343,
+ 117347, 117351, 117355, 117359, 117363, 117367, 117371, 117375, 117379,
+ 117383, 117387, 117391, 117395, 117399, 117403, 117407, 117411, 117415,
+ 117419, 117423, 117427, 117431, 117435, 117439, 117443, 117447, 117451,
+ 117455, 117459, 117463, 117467, 117471, 117475, 117480, 117484, 117488,
+ 117492, 117496, 117500, 117504, 117508, 117512, 117516, 117520, 117524,
+ 117528, 117532, 117536, 117540, 117544, 117548, 117552, 117556, 117560,
+ 117564, 117568, 117572, 117576, 117580, 117584, 117588, 117592, 117596,
+ 117600, 117604, 117608, 117612, 117616, 117620, 117624, 117628, 117632,
+ 117636, 117640, 117644, 117648, 117652, 117656, 117660, 117664, 117668,
+ 117672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117676, 117682, 117691,
+ 117699, 117707, 117716, 117725, 117734, 117743, 117752, 117761, 117770,
+ 117779, 117788, 117797, 0, 0, 117806, 117815, 117823, 117831, 117840,
+ 117849, 117858, 117867, 117876, 117885, 117894, 117903, 117912, 117921,
+ 0, 0, 117930, 117939, 117947, 117955, 117964, 117973, 117982, 117991,
+ 118000, 118009, 118018, 118027, 118036, 118045, 118054, 0, 118061,
+ 118070, 118078, 118086, 118095, 118104, 118113, 118122, 118131, 118140,
+ 118149, 118158, 118167, 118176, 118185, 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, 118192,
+ 118199, 118204, 118208, 118212, 118216, 118221, 118226, 118231, 118236,
+ 118241, 0, 0, 0, 0, 0, 118246, 118251, 118257, 118263, 118269, 118274,
+ 118280, 118286, 118292, 118297, 118303, 118309, 118314, 118319, 118324,
+ 118329, 118335, 118341, 118346, 118351, 118357, 118362, 118368, 118374,
+ 118380, 118386, 118392, 118402, 118409, 118415, 118418, 0, 118421,
+ 118426, 118432, 118438, 118444, 118449, 118455, 118461, 118467, 118472,
+ 118478, 118484, 118489, 118494, 118499, 118504, 118510, 118516, 118521,
+ 118526, 118532, 118537, 118543, 118549, 118555, 118561, 118567, 118570,
+ 118573, 118576, 118579, 118582, 118585, 118591, 118598, 118605, 118612,
+ 118618, 118625, 118632, 118639, 118645, 118652, 118659, 118665, 118671,
+ 118677, 118683, 118690, 118697, 118703, 118709, 118716, 118722, 118729,
+ 118736, 118743, 118750, 0, 0, 0, 0, 0, 0, 118757, 118763, 118770, 118777,
+ 118784, 118790, 118797, 118804, 118811, 118817, 118824, 118831, 118837,
+ 118843, 118849, 118855, 118862, 118869, 118875, 118881, 118888, 118894,
+ 118901, 118908, 118915, 118922, 118929, 118938, 118942, 118945, 118949,
+ 118953, 118957, 118960, 118963, 118966, 118969, 118972, 118975, 118978,
+ 118981, 118984, 118990, 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, 82485, 82488, 82491, 82494, 82497, 82500, 0, 0, 82504, 0,
- 82508, 82511, 82515, 82519, 82523, 82527, 82531, 82535, 82539, 82543,
- 82547, 82550, 82554, 82558, 82562, 82566, 82570, 82574, 82578, 82582,
- 82586, 82589, 82593, 82597, 82601, 82605, 82608, 82612, 82616, 82620,
- 82624, 82628, 82632, 82636, 82640, 82644, 82648, 82652, 82656, 82659,
- 82663, 82667, 82671, 82675, 0, 82679, 82683, 0, 0, 0, 82687, 0, 0, 82691,
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, 118993, 119000, 119008, 119016, 119024,
+ 119031, 119039, 119047, 119055, 119062, 119070, 119078, 119085, 119092,
+ 119099, 119106, 119114, 119122, 119129, 119136, 119144, 119151, 119159,
+ 119167, 119175, 119183, 119191, 119195, 119199, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 119203, 119209, 119215, 119221, 119225, 119231, 119237,
+ 119243, 119249, 119255, 119261, 119267, 119273, 119279, 119285, 119291,
+ 119297, 119303, 119309, 119315, 119321, 119327, 119333, 119339, 119345,
+ 119351, 119357, 119363, 119369, 119375, 119381, 119387, 119393, 119399,
+ 119405, 119411, 119417, 119423, 119429, 119435, 119441, 119447, 119453,
+ 0, 0, 0, 0, 0, 119459, 119470, 119481, 119492, 119503, 119514, 119525,
+ 119536, 119547, 0, 0, 0, 0, 0, 0, 0, 119558, 119562, 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, 82695, 82700, 82705,
- 82710, 82715, 82720, 82725, 82730, 82735, 82740, 82745, 82750, 82755,
- 82760, 82765, 82770, 82775, 82780, 82785, 82790, 82795, 82800, 82805,
- 82809, 82814, 82819, 0, 0, 0, 0, 0, 82825, 82831, 82835, 82840, 82844,
- 82849, 82853, 82857, 82861, 82866, 82871, 82875, 82879, 82883, 82887,
- 82891, 82896, 82901, 82905, 82910, 82915, 82919, 82924, 82929, 82934,
- 82939, 82944, 0, 0, 0, 0, 0, 82949, 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, 119566, 119568, 119570,
+ 119574, 119579, 119584, 119586, 119592, 119597, 119599, 119605, 119609,
+ 119611, 119615, 119621, 119627, 119633, 119638, 119642, 119649, 119656,
+ 119663, 119668, 119675, 119682, 119689, 119693, 119699, 119708, 119717,
+ 119724, 119729, 119733, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 119737, 119739, 119741, 119745, 119749, 119753, 0, 119755, 119757,
+ 119761, 119763, 119765, 119767, 119769, 119774, 119779, 119781, 119787,
+ 119791, 119795, 119803, 119805, 119807, 119809, 119811, 119813, 119815,
+ 119817, 119819, 119821, 119823, 119827, 119831, 119833, 119835, 119837,
+ 119839, 119841, 119846, 119852, 119856, 119860, 119864, 119868, 119873,
+ 119877, 119879, 119881, 119885, 119891, 119893, 119895, 119897, 119901,
+ 119910, 119916, 119920, 119924, 119926, 119928, 119931, 119933, 119935,
+ 119937, 119941, 119943, 119947, 119952, 119954, 119959, 119965, 119972,
+ 119976, 119980, 119984, 119988, 119994, 0, 0, 0, 119998, 120000, 120004,
+ 120008, 120010, 120014, 120018, 120020, 120024, 120026, 120030, 120034,
+ 120038, 120042, 120046, 120050, 120054, 120058, 120064, 120068, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 120072, 120076, 120080, 120084, 120091,
+ 120093, 120097, 120099, 120101, 120105, 120109, 120113, 120115, 120119,
+ 120123, 120127, 120131, 120135, 120137, 120141, 120143, 120149, 120152,
+ 120157, 120159, 120161, 120164, 120166, 120168, 120171, 120178, 120185,
+ 120192, 120197, 120201, 120203, 120205, 0, 120207, 120209, 120213,
+ 120217, 120221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 120223, 120227, 120232, 120236, 120242, 120248, 120250, 120252,
+ 120258, 120260, 120264, 120268, 120270, 120274, 120276, 120280, 120284,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120288, 120290, 120292,
+ 120294, 120298, 120300, 120302, 120304, 120306, 120308, 120310, 120312,
+ 120314, 120316, 120318, 120320, 120322, 120324, 120326, 120328, 120330,
+ 120332, 120334, 120336, 120338, 120340, 120342, 120346, 120348, 120350,
+ 120352, 120356, 120358, 120362, 120364, 120366, 120370, 120374, 120380,
+ 120382, 120384, 120386, 120388, 120392, 120396, 120398, 120402, 120406,
+ 120410, 120414, 120418, 120422, 120426, 120430, 120434, 120438, 120442,
+ 120446, 120450, 120454, 120458, 120462, 120466, 0, 120470, 0, 120472,
+ 120474, 120476, 120478, 120480, 120488, 120496, 120504, 120512, 120517,
+ 120522, 120527, 120531, 120535, 120540, 120545, 120547, 120551, 120553,
+ 120555, 120557, 120559, 120561, 120563, 120565, 120569, 120571, 120573,
+ 120575, 120579, 120583, 120587, 120591, 120595, 120597, 120603, 120609,
+ 120611, 120613, 120615, 120617, 120619, 120628, 120635, 120642, 120646,
+ 120653, 120658, 120665, 120674, 120679, 120683, 120687, 120689, 120693,
+ 120695, 120699, 120703, 120705, 120709, 120713, 120717, 120719, 120721,
+ 120727, 120729, 120731, 120733, 120737, 120741, 120743, 120747, 120749,
+ 120751, 120754, 120758, 120760, 120764, 120766, 120768, 120773, 120775,
+ 120779, 120783, 120786, 120790, 120794, 120798, 120802, 120806, 120810,
+ 120814, 120819, 120823, 120827, 120836, 120841, 120844, 120846, 120849,
+ 120852, 120857, 120859, 120862, 120867, 120871, 120874, 120878, 120882,
+ 120885, 120890, 120894, 120898, 120902, 120906, 120912, 120918, 120924,
+ 120930, 120935, 120946, 120948, 120952, 120954, 120956, 120960, 120964,
+ 120966, 120970, 120976, 120981, 120987, 120989, 120993, 120997, 121004,
+ 121011, 121015, 121017, 121019, 121023, 121025, 121029, 121033, 121037,
+ 121039, 121041, 121048, 121052, 121056, 121060, 121064, 121068, 121070,
+ 121074, 121076, 121078, 121082, 121084, 121088, 121092, 121098, 121102,
+ 121106, 121110, 121112, 121115, 121119, 121126, 121135, 121144, 121153,
+ 121162, 121164, 121168, 121170, 121174, 121185, 121189, 121195, 121201,
+ 121206, 0, 121208, 121212, 121214, 121216, 0, 0, 0, 121218, 121223,
+ 121234, 121250, 121263, 121276, 121280, 121284, 121290, 121292, 121300,
+ 121308, 121310, 121314, 121320, 121326, 121333, 121340, 121342, 121344,
+ 121348, 121350, 121356, 121358, 121361, 121365, 121371, 121377, 121388,
+ 121394, 121401, 121409, 121413, 121421, 121429, 121435, 121441, 121448,
+ 121450, 121454, 121456, 121458, 121463, 121465, 121467, 121469, 121471,
+ 121475, 121486, 121492, 121496, 121500, 121504, 121510, 121516, 121522,
+ 121528, 121533, 121538, 121544, 121550, 121557, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121564, 121571, 121578, 121585, 121593,
+ 121601, 121609, 121617, 121625, 121633, 121641, 121649, 121657, 121663,
+ 121669, 121675, 121681, 121687, 121693, 121699, 121705, 121711, 121717,
+ 121723, 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, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82954, 82957, 82961, 82965, 0, 82970, 82974, 0, 0, 0, 0, 0,
- 82978, 82983, 82989, 82993, 82997, 83000, 83004, 83008, 0, 83012, 83016,
- 83020, 0, 83024, 83028, 83032, 83036, 83040, 83044, 83048, 83052, 83056,
- 83060, 83064, 83068, 83071, 83075, 83079, 83083, 83086, 83089, 83092,
- 83096, 83100, 83104, 83108, 83112, 83116, 83119, 83123, 0, 0, 0, 0,
- 83127, 83132, 83136, 0, 0, 0, 0, 83140, 83143, 83146, 83149, 83152,
- 83155, 83159, 83163, 83168, 0, 0, 0, 0, 0, 0, 0, 0, 83173, 83178, 83184,
- 83189, 83195, 83200, 83205, 83210, 83216, 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, 83221, 83224, 83229, 83235, 83243, 83248, 83254, 83262,
- 83268, 83274, 83278, 83282, 83289, 83298, 83305, 83314, 83320, 83329,
- 83336, 83343, 83350, 83360, 83366, 83370, 83377, 83386, 83396, 83403,
- 83410, 83414, 83418, 83425, 83435, 83439, 83446, 83453, 83460, 83466,
- 83473, 83480, 83487, 83494, 83498, 83502, 83506, 83513, 83517, 83524,
- 83531, 83545, 83554, 83558, 83562, 83566, 83573, 83577, 83581, 83585,
- 83593, 83601, 83620, 83630, 83650, 83654, 83658, 83662, 83666, 83670,
- 83674, 83678, 83685, 83689, 83692, 83696, 83700, 83706, 83713, 83722,
- 83726, 83735, 83744, 83752, 83756, 83763, 83767, 83771, 83775, 83779,
- 83790, 83799, 83808, 83817, 83826, 83838, 83847, 83856, 83865, 83873,
- 83882, 83894, 83903, 83912, 83921, 83933, 83942, 83951, 83963, 83972,
- 83981, 83993, 84002, 84006, 84010, 84014, 84018, 84022, 84026, 84030,
- 84037, 84041, 84045, 84056, 84060, 84064, 84071, 84077, 84083, 84087,
- 84094, 84098, 84102, 84106, 84110, 84114, 84118, 84124, 84132, 84136,
- 84140, 84143, 84149, 84159, 84163, 84175, 84182, 84189, 84196, 84203,
- 84209, 84213, 84217, 84221, 84225, 84232, 84241, 84248, 84256, 84264,
- 84270, 84274, 84278, 84282, 84286, 84292, 84301, 84313, 84320, 84327,
- 84336, 84347, 84353, 84362, 84371, 84378, 84387, 84394, 84401, 84411,
- 84418, 84425, 84432, 84439, 84443, 84449, 84453, 84464, 84472, 84481,
- 84493, 84500, 84507, 84517, 84524, 84533, 84540, 84549, 84556, 84563,
- 84573, 84580, 84587, 84597, 84604, 84616, 84625, 84632, 84639, 84646,
- 84655, 84665, 84678, 84685, 84695, 84705, 84712, 84721, 84734, 84741,
- 84748, 84755, 84765, 84775, 84782, 84792, 84799, 84806, 84816, 84822,
- 84829, 84836, 84843, 84853, 84860, 84867, 84874, 84880, 84887, 84897,
- 84904, 84908, 84916, 84920, 84932, 84936, 84950, 84954, 84958, 84962,
- 84966, 84972, 84979, 84987, 84991, 84995, 84999, 85003, 85010, 85014,
- 85020, 85026, 85034, 85038, 85045, 85053, 85057, 85061, 85067, 85071,
- 85080, 85089, 85096, 85106, 85112, 85116, 85120, 85128, 85135, 85142,
- 85148, 85152, 85160, 85164, 85171, 85183, 85190, 85200, 85206, 85210,
- 85219, 85226, 85235, 85239, 85243, 85250, 85254, 85258, 85262, 85266,
- 85269, 85275, 85281, 85285, 85289, 85296, 85303, 85310, 85317, 85324,
- 85331, 85338, 85345, 85351, 85355, 85359, 85366, 85373, 85380, 85387,
- 85394, 85398, 85401, 85406, 85410, 85414, 85423, 85432, 85436, 85440,
- 85446, 85452, 85469, 85475, 85479, 85488, 85492, 85496, 85503, 85511,
- 85519, 85525, 85529, 85533, 85537, 85541, 85544, 85549, 85555, 85564,
- 85570, 85576, 85582, 85587, 85593, 85599, 85605, 85611, 85617, 85625,
- 85631, 85642, 85648, 85654, 85663, 85673, 85679, 85685, 85691, 85697,
- 85703, 85709, 85715, 85721, 85727, 85733, 85742, 85751, 85760, 85766,
- 85775, 85781, 85787, 85793, 85799, 85805, 85811, 85817, 85823, 85829,
- 85835, 85841, 85847, 85853, 85858, 85864, 85870, 85878, 85884, 85890,
- 85894, 85902, 85906, 85910, 85914, 85918, 85922, 85929, 85933, 85942,
- 85946, 85953, 85961, 85965, 85969, 85973, 85984, 85998, 86002, 86006,
- 86013, 86019, 86026, 86030, 86034, 86038, 86042, 86046, 86053, 86057,
- 86075, 86079, 86083, 86090, 86094, 86098, 86104, 86108, 86112, 86120,
- 86124, 86128, 86132, 86136, 86141, 86151, 86159, 86167, 86173, 86179,
- 86189, 86195, 86201, 86207, 86213, 86219, 86225, 86231, 86240, 86245,
- 86251, 86260, 86268, 86274, 86282, 86291, 86297, 86303, 86309, 86315,
- 86326, 86332, 86338, 86344, 86350, 86356, 86365, 86371, 86377, 86386,
- 86398, 86409, 86415, 86424, 86430, 86436, 86442, 86456, 86461, 86468,
- 86477, 86486, 86492, 86498, 86503, 86507, 86514, 86524, 86530, 86543,
- 86547, 86551, 86558, 86562, 86568, 86577, 86581, 86585, 86589, 86593,
- 86597, 86604, 86608, 86615, 86622, 86629, 86638, 86647, 86657, 86664,
- 86671, 86678, 86688, 86695, 86705, 86712, 86722, 86729, 86736, 86746,
- 86756, 86763, 86769, 86777, 86785, 86791, 86797, 86801, 86805, 86812,
- 86820, 86826, 86830, 86834, 86838, 86845, 86857, 86860, 86867, 86873,
- 86877, 86881, 86885, 86889, 86893, 86897, 86901, 86905, 86909, 86913,
- 86920, 86924, 86930, 86934, 86938, 86942, 86948, 86955, 86962, 86969,
- 86981, 86989, 86993, 86999, 87008, 87015, 87021, 87025, 87029, 87033,
- 87039, 87048, 87056, 87060, 87066, 87070, 87074, 87078, 87084, 87091,
- 87097, 87101, 87107, 87111, 87115, 87124, 87136, 87140, 87147, 87154,
- 87164, 87171, 87183, 87190, 87197, 87204, 87215, 87225, 87238, 87248,
- 87255, 87259, 87263, 87267, 87271, 87280, 87289, 87298, 87315, 87324,
- 87330, 87337, 87345, 87358, 87362, 87371, 87380, 87389, 87398, 87409,
- 87418, 87427, 87436, 87445, 87454, 87463, 87473, 87476, 87480, 87484,
- 87488, 87492, 87496, 87502, 87509, 87516, 87523, 87529, 87535, 87542,
- 87548, 87555, 87563, 87567, 87574, 87581, 87588, 87596, 87599, 87603,
- 87607, 87611, 87615, 87621, 87625, 87631, 87638, 87645, 87651, 87658,
- 87665, 87672, 87679, 87686, 87693, 87700, 87707, 87714, 87721, 87728,
- 87735, 87742, 87749, 87755, 87759, 87767, 87771, 87775, 87779, 87783,
- 87789, 87796, 87803, 87810, 87817, 87824, 87830, 87838, 87842, 87846,
- 87850, 87854, 87860, 87877, 87894, 87898, 87902, 87906, 87910, 87914,
- 87918, 87924, 87931, 87935, 87941, 87948, 87955, 87962, 87969, 87976,
- 87985, 87992, 87999, 88006, 88013, 88017, 88021, 88027, 88039, 88043,
- 88047, 88056, 88060, 88064, 88068, 88074, 88078, 88082, 88091, 88095,
- 88099, 88103, 88110, 88114, 88118, 88122, 88126, 88130, 88134, 88138,
- 88142, 88148, 88155, 88162, 88168, 88172, 88189, 88195, 88199, 88205,
- 88211, 88217, 88223, 88229, 88235, 88239, 88243, 88247, 88253, 88257,
- 88263, 88267, 88271, 88278, 88285, 88302, 88306, 88310, 88314, 88318,
- 88322, 88334, 88337, 88342, 88347, 88362, 88372, 88383, 88387, 88391,
- 88395, 88401, 88408, 88415, 88425, 88437, 88443, 88449, 88458, 88462,
- 88466, 88473, 88483, 88490, 88496, 88500, 88504, 88511, 88517, 88521,
- 88527, 88531, 88539, 88545, 88549, 88557, 88566, 88573, 88579, 88586,
- 88593, 88603, 88613, 88617, 88621, 88625, 88629, 88635, 88642, 88648,
- 88655, 88662, 88669, 88678, 88685, 88692, 88698, 88705, 88712, 88719,
- 88726, 88733, 88740, 88746, 88753, 88760, 88767, 88776, 88783, 88790,
- 88794, 88800, 88804, 88810, 88817, 88824, 88831, 88835, 88839, 88843,
- 88847, 88851, 88858, 88862, 88866, 88872, 88881, 88885, 88889, 88893,
- 88897, 88904, 88908, 88912, 88920, 88924, 88928, 88932, 88936, 88942,
- 88946, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88950, 88956,
- 88962, 88969, 88976, 88983, 88990, 88997, 89004, 89010, 89017, 89024,
- 89031, 89038, 89045, 89052, 89058, 89064, 89070, 89076, 89082, 89088,
- 89094, 89100, 89106, 89113, 89120, 89127, 89134, 89141, 89148, 89154,
- 89160, 89166, 89173, 89180, 89186, 89192, 89201, 89208, 89215, 89222,
- 89229, 89236, 89243, 89249, 89255, 89261, 89270, 89277, 89284, 89295,
- 89306, 89312, 89318, 89324, 89333, 89340, 89347, 89356, 89365, 89375,
- 89385, 89396, 89408, 89418, 89428, 89439, 89451, 89461, 89471, 89481,
- 89491, 89501, 89512, 89520, 89528, 89537, 89546, 89555, 89561, 89567,
- 89573, 89580, 89590, 89597, 89607, 89612, 89617, 89623, 89629, 89637,
- 89645, 89654, 89664, 89674, 89682, 89690, 89699, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 89708, 89719, 89726, 89734, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 89742, 89747, 89752, 89757, 89764, 89771, 89778, 89785, 89790,
- 89795, 89800, 89805, 89812, 89817, 89824, 89831, 89836, 89841, 89846,
- 89853, 89858, 89863, 89870, 89877, 89882, 89887, 89892, 89899, 89906,
- 89913, 89918, 89923, 89930, 89937, 89944, 89951, 89956, 89961, 89966,
- 89973, 89978, 89983, 89988, 89995, 90004, 90011, 90016, 90021, 90026,
- 90031, 90036, 90041, 90050, 90057, 90062, 90069, 90076, 90081, 90086,
- 90091, 90098, 90103, 90110, 90117, 90122, 90127, 90132, 90139, 90146,
- 90151, 90156, 90163, 90170, 90177, 90182, 90187, 90192, 90197, 90204,
- 90213, 90222, 90227, 90234, 90243, 90248, 90253, 90258, 90263, 90270,
- 90277, 90284, 90291, 90296, 90301, 90306, 90313, 90320, 90327, 90332,
- 90337, 90344, 90349, 90356, 90361, 90368, 90373, 90380, 90387, 90392,
- 90397, 90402, 90407, 90412, 90417, 90422, 90427, 90432, 90439, 90446,
- 90453, 90460, 90467, 90476, 90481, 90486, 90493, 90500, 90505, 90512,
- 90519, 90526, 90533, 90540, 90547, 90552, 90557, 90562, 90567, 90572,
- 90581, 90590, 90599, 90608, 90617, 90626, 90635, 90644, 90649, 90660,
- 90671, 90680, 90685, 90690, 90695, 90700, 90709, 90716, 90723, 90730,
- 90737, 90744, 90751, 90760, 90769, 90780, 90789, 90800, 90809, 90816,
- 90825, 90836, 90845, 90854, 90863, 90872, 90879, 90886, 90893, 90902,
- 90911, 90922, 90931, 90940, 90951, 90956, 90961, 90972, 90980, 90989,
- 90998, 91007, 91018, 91027, 91036, 91047, 91058, 91069, 91080, 91091,
- 91102, 91109, 91116, 91123, 91130, 91141, 91150, 91157, 91164, 91171,
- 91182, 91193, 91204, 91215, 91226, 91237, 91248, 91259, 91266, 91273,
- 91282, 91291, 91298, 91305, 91312, 91321, 91330, 91339, 91346, 91355,
- 91364, 91373, 91380, 91387, 91392, 91398, 91405, 91412, 91419, 91426,
- 91433, 91440, 91449, 91458, 91467, 91476, 91483, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 91492, 91498, 91503, 91508, 91515, 91521, 91527, 91533, 91539,
- 91545, 91551, 91557, 91561, 91565, 91571, 91577, 91583, 91587, 91592,
- 91597, 91601, 91605, 91608, 91614, 91620, 91626, 91632, 91638, 91644,
- 91650, 91656, 91662, 91672, 91682, 91688, 91694, 91704, 91714, 91720, 0,
- 0, 91726, 91734, 91739, 91744, 91750, 91756, 91762, 91768, 91774, 91780,
- 91787, 91794, 91800, 91806, 91812, 91818, 91824, 91830, 91836, 91842,
- 91847, 91853, 91859, 91865, 91871, 91877, 91886, 91892, 91897, 91905,
- 91912, 91919, 91928, 91937, 91946, 91955, 91964, 91973, 91982, 91991,
- 92001, 92011, 92019, 92027, 92036, 92045, 92051, 92057, 92063, 92069,
- 92077, 92085, 92089, 92095, 92100, 92106, 92112, 92118, 92124, 92130,
- 92139, 92144, 92151, 92156, 92161, 92166, 92172, 92178, 92184, 92191,
- 92196, 92201, 92206, 92211, 92216, 92222, 92228, 92234, 92240, 92246,
- 92252, 92258, 92264, 92269, 92274, 92279, 92284, 92289, 92294, 92299,
- 92304, 92310, 92316, 92321, 92326, 92331, 92336, 92341, 92347, 92354,
- 92358, 92362, 92366, 92370, 92374, 92378, 92382, 92386, 92394, 92404,
- 92408, 92412, 92418, 92424, 92430, 92436, 92442, 92448, 92454, 92460,
- 92466, 92472, 92478, 92484, 92490, 92496, 92500, 92504, 92511, 92517,
- 92523, 92529, 92534, 92541, 92546, 92552, 92558, 92564, 92570, 92575,
- 92579, 92585, 92589, 92593, 92597, 92603, 92609, 92613, 92619, 92625,
- 92631, 92637, 92643, 92651, 92659, 92665, 92671, 92677, 92683, 92695,
- 92707, 92721, 92733, 92745, 92759, 92773, 92787, 92791, 92799, 92807,
- 92812, 92816, 92820, 92824, 92828, 92832, 92836, 92840, 92846, 92852,
- 92858, 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, 92864, 92870, 92876, 92882, 92888,
- 92894, 92900, 92906, 92912, 92918, 92924, 92930, 92936, 92942, 92948,
- 92954, 92960, 92966, 92972, 92978, 92984, 92990, 92996, 93002, 93008,
- 93014, 93020, 93026, 93032, 93038, 93044, 93050, 93056, 93062, 93068,
- 93074, 93080, 93086, 93092, 93098, 93104, 93110, 93116, 93122, 93128,
- 93134, 93140, 93146, 93152, 93158, 93164, 93170, 93176, 93182, 93188,
- 93194, 93200, 93206, 93212, 93218, 93224, 93230, 93236, 93242, 93248,
- 93254, 93260, 93265, 93270, 93275, 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, 93279,
- 93284, 93291, 93298, 93305, 93312, 93317, 93321, 93327, 93331, 93335,
- 93341, 93345, 93349, 93353, 93359, 93366, 93370, 93374, 93378, 93382,
- 93386, 93390, 93396, 93400, 93404, 93408, 93412, 93416, 93420, 93424,
- 93428, 93432, 93436, 93440, 93444, 93449, 93453, 93457, 93461, 93465,
- 93469, 93473, 93477, 93481, 93485, 93492, 93496, 93503, 93507, 93511,
- 93515, 93519, 93523, 93527, 93531, 93538, 93542, 93546, 93550, 93554,
- 93558, 93564, 93568, 93574, 93578, 93582, 93586, 93590, 93594, 93598,
- 93602, 93606, 93610, 93614, 93618, 93622, 93626, 93630, 93634, 93638,
- 93642, 93646, 93650, 93658, 93662, 93666, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 93670, 93678, 93686, 93694, 93702, 93710, 93718, 93726, 93734, 93742,
- 93750, 93758, 93766, 93774, 93782, 93790, 93798, 93806, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 93814, 93818, 93823, 93828, 93833, 93837, 93842,
- 93846, 93850, 93854, 93859, 93864, 93868, 93872, 93876, 93880, 93885,
- 93890, 93894, 93898, 93903, 93907, 93911, 93916, 93921, 93926, 93931,
- 93935, 93940, 93945, 93950, 93954, 93959, 93963, 93967, 93971, 93976,
- 93981, 93985, 93989, 93993, 93997, 94002, 94007, 94011, 94015, 94020,
- 94024, 94028, 94033, 94038, 94043, 94048, 94052, 94057, 94062, 94067,
- 94071, 94076, 94080, 94084, 94088, 94093, 94098, 94102, 94106, 94110,
- 94114, 94119, 94124, 94128, 94132, 94137, 94141, 94145, 94150, 94155,
- 94160, 94165, 94169, 94174, 94179, 94184, 94188, 94193, 0, 94197, 94201,
- 94206, 94211, 94215, 94219, 94223, 94227, 94232, 94237, 94241, 94245,
- 94250, 94254, 94258, 94263, 94268, 94273, 94278, 94283, 94289, 94295,
- 94301, 94306, 94312, 94317, 94322, 94327, 94333, 94339, 94344, 94349,
- 94354, 94359, 94365, 94371, 94376, 94381, 94387, 94392, 94397, 94403,
- 94409, 94415, 94421, 94426, 94432, 94438, 94444, 94449, 94455, 94460,
- 94465, 94470, 94476, 94482, 94487, 94492, 94497, 94502, 94508, 94514,
- 94519, 94524, 94530, 94535, 94540, 94546, 94552, 94558, 94564, 0, 94568,
- 94573, 0, 0, 94578, 0, 0, 94582, 94587, 0, 0, 94592, 94596, 94600, 94605,
- 0, 94610, 94614, 94619, 94623, 94627, 94632, 94637, 94642, 94647, 94651,
- 94656, 94661, 0, 94666, 0, 94671, 94675, 94679, 94684, 94689, 94693,
- 94697, 0, 94701, 94706, 94711, 94715, 94719, 94724, 94728, 94732, 94737,
- 94742, 94747, 94752, 94757, 94763, 94769, 94775, 94780, 94786, 94791,
- 94796, 94801, 94807, 94813, 94818, 94823, 94828, 94833, 94839, 94845,
- 94850, 94855, 94861, 94866, 94871, 94877, 94883, 94889, 94895, 94900,
- 94906, 94912, 94918, 94923, 94929, 94934, 94939, 94944, 94950, 94956,
- 94961, 94966, 94971, 94976, 94982, 94988, 94993, 94998, 95004, 95009,
- 95014, 95020, 95026, 95032, 95038, 95042, 0, 95047, 95052, 95056, 95061,
- 0, 0, 95065, 95070, 95075, 95079, 95083, 95087, 95091, 95096, 0, 95101,
- 95105, 95110, 95114, 95118, 95123, 95128, 0, 95133, 95137, 95142, 95147,
- 95152, 95156, 95161, 95165, 95169, 95173, 95178, 95183, 95187, 95191,
- 95195, 95199, 95204, 95209, 95213, 95217, 95222, 95226, 95230, 95235,
- 95240, 95245, 95250, 95254, 0, 95259, 95264, 95268, 95273, 0, 95277,
- 95281, 95286, 95291, 95295, 0, 95299, 0, 0, 0, 95303, 95307, 95312,
- 95316, 95320, 95325, 95330, 0, 95335, 95339, 95344, 95349, 95354, 95358,
- 95363, 95367, 95371, 95375, 95380, 95385, 95389, 95393, 95397, 95401,
- 95406, 95411, 95415, 95419, 95424, 95428, 95432, 95437, 95442, 95447,
- 95452, 95457, 95463, 95469, 95475, 95480, 95486, 95491, 95496, 95501,
- 95507, 95513, 95518, 95523, 95528, 95533, 95539, 95545, 95550, 95555,
- 95561, 95566, 95571, 95577, 95583, 95589, 95595, 95600, 95606, 95612,
- 95618, 95623, 95629, 95634, 95639, 95644, 95650, 95656, 95661, 95666,
- 95671, 95676, 95682, 95688, 95693, 95698, 95704, 95709, 95714, 95720,
- 95726, 95732, 95738, 95742, 95747, 95752, 95757, 95761, 95766, 95770,
- 95774, 95778, 95783, 95788, 95792, 95796, 95800, 95804, 95809, 95814,
- 95818, 95822, 95827, 95831, 95835, 95840, 95845, 95850, 95855, 95859,
- 95864, 95869, 95874, 95878, 95883, 95887, 95891, 95895, 95900, 95905,
- 95909, 95913, 95917, 95921, 95926, 95931, 95935, 95939, 95944, 95948,
- 95952, 95957, 95962, 95967, 95972, 95977, 95983, 95989, 95995, 96000,
- 96006, 96011, 96016, 96021, 96027, 96033, 96038, 96043, 96048, 96053,
- 96059, 96065, 96070, 96075, 96081, 96086, 96091, 96097, 96103, 96109,
- 96115, 96120, 96126, 96132, 96138, 96143, 96149, 96154, 96159, 96164,
- 96170, 96176, 96181, 96186, 96191, 96196, 96202, 96208, 96213, 96218,
- 96224, 96229, 96234, 96240, 96246, 96252, 96258, 96263, 96269, 96275,
- 96281, 96286, 96292, 96297, 96302, 96307, 96313, 96319, 96324, 96329,
- 96334, 96339, 96345, 96351, 96356, 96361, 96367, 96372, 96377, 96383,
- 96389, 96395, 96401, 96406, 96412, 96418, 96424, 96429, 96435, 96440,
- 96445, 96450, 96456, 96462, 96467, 96472, 96477, 96482, 96488, 96494,
- 96499, 96504, 96510, 96515, 96520, 96526, 96532, 96538, 96544, 96550,
- 96557, 96564, 96571, 96577, 96584, 96590, 96596, 96602, 96609, 96616,
- 96622, 96628, 96634, 96640, 96647, 96654, 96660, 96666, 96673, 96679,
- 96685, 96692, 96699, 96706, 96713, 96719, 96726, 96733, 96740, 96746,
- 96753, 96759, 96765, 96771, 96778, 96785, 96791, 96797, 96803, 96809,
- 96816, 96823, 96829, 96835, 96842, 96848, 96854, 96861, 96868, 96875,
- 96882, 96886, 96891, 96896, 96901, 96905, 96910, 96914, 96918, 96922,
- 96927, 96932, 96936, 96940, 96944, 96948, 96953, 96958, 96962, 96966,
- 96971, 96975, 96979, 96984, 96989, 96994, 96999, 97003, 97008, 97013,
- 97018, 97022, 97027, 97031, 97035, 97039, 97044, 97049, 97053, 97057,
- 97061, 97065, 97070, 97075, 97079, 97083, 97088, 97092, 97096, 97101,
- 97106, 97111, 97116, 97122, 0, 0, 97129, 97134, 97139, 97144, 97149,
- 97154, 97159, 97164, 97169, 97174, 97179, 97184, 97189, 97194, 97199,
- 97204, 97209, 97214, 97220, 97225, 97230, 97235, 97240, 97245, 97250,
- 97255, 97259, 97264, 97269, 97274, 97279, 97284, 97289, 97294, 97299,
- 97304, 97309, 97314, 97319, 97324, 97329, 97334, 97339, 97344, 97350,
- 97355, 97360, 97365, 97370, 97375, 97380, 97385, 97391, 97396, 97401,
- 97406, 97411, 97416, 97421, 97426, 97431, 97436, 97441, 97446, 97451,
- 97456, 97461, 97466, 97471, 97476, 97481, 97486, 97491, 97496, 97501,
- 97506, 97512, 97517, 97522, 97527, 97532, 97537, 97542, 97547, 97551,
- 97556, 97561, 97566, 97571, 97576, 97581, 97586, 97591, 97596, 97601,
- 97606, 97611, 97616, 97621, 97626, 97631, 97636, 97642, 97647, 97652,
- 97657, 97662, 97667, 97672, 97677, 97683, 97688, 97693, 97698, 97703,
- 97708, 97713, 97719, 97725, 97731, 97737, 97743, 97749, 97755, 97761,
- 97767, 97773, 97779, 97785, 97791, 97797, 97803, 97809, 97815, 97822,
- 97828, 97834, 97840, 97846, 97852, 97858, 97864, 97869, 97875, 97881,
- 97887, 97893, 97899, 97905, 97911, 97917, 97923, 97929, 97935, 97941,
- 97947, 97953, 97959, 97965, 97971, 97978, 97984, 97990, 97996, 98002,
- 98008, 98014, 98020, 98027, 98033, 98039, 98045, 98051, 98057, 98063,
- 98069, 98075, 98081, 98087, 98093, 98099, 98105, 98111, 98117, 98123,
- 98129, 98135, 98141, 98147, 98153, 98159, 98165, 98172, 98178, 98184,
- 98190, 98196, 98202, 98208, 98214, 98219, 98225, 98231, 98237, 98243,
- 98249, 98255, 98261, 98267, 98273, 98279, 98285, 98291, 98297, 98303,
- 98309, 98315, 98321, 98328, 98334, 98340, 98346, 98352, 98358, 98364,
- 98370, 98377, 98383, 98389, 98395, 98401, 98407, 98413, 98420, 98427,
- 98434, 98441, 98448, 98455, 98462, 98469, 98476, 98483, 98490, 98497,
- 98504, 98511, 98518, 98525, 98532, 98540, 98547, 98554, 98561, 98568,
- 98575, 98582, 98589, 98595, 98602, 98609, 98616, 98623, 98630, 98637,
- 98644, 98651, 98658, 98665, 98672, 98679, 98686, 98693, 98700, 98707,
- 98714, 98722, 98729, 98736, 98743, 98750, 98757, 98764, 98771, 98779,
- 98786, 98793, 98800, 98807, 98814, 98821, 98826, 0, 0, 98831, 98836,
- 98840, 98844, 98848, 98852, 98856, 98860, 98864, 98868, 98872, 98877,
- 98881, 98885, 98889, 98893, 98897, 98901, 98905, 98909, 98913, 98918,
- 98922, 98926, 98930, 98934, 98938, 98942, 98946, 98950, 98954, 98960,
- 98965, 98970, 98975, 98980, 98985, 98990, 98995, 99000, 99005, 99010,
- 99014, 99018, 99022, 99026, 99030, 99034, 99038, 99042, 99046, 99053,
- 99060, 99067, 99074, 99081, 99088, 99094, 99101, 99108, 99115, 99123,
- 99131, 99139, 99147, 99155, 99163, 99170, 99177, 99184, 99192, 99200,
- 99208, 99216, 99224, 99232, 99239, 99246, 99253, 99261, 99269, 99277,
- 99285, 99293, 99301, 99306, 99311, 99316, 99321, 99326, 99331, 99336,
- 99341, 99346, 0, 0, 0, 0, 99351, 99356, 99360, 99364, 99368, 99372,
- 99376, 99380, 99384, 99388, 99392, 99396, 99400, 99404, 99408, 99412,
- 99416, 99420, 99424, 99428, 99432, 99436, 99440, 99444, 99448, 99452,
- 99456, 99460, 99464, 99468, 99472, 99476, 99480, 99484, 99488, 99492,
- 99496, 99500, 99504, 99508, 99512, 99516, 99520, 99524, 99528, 99532,
- 99536, 99540, 99544, 99548, 99552, 99557, 99561, 99565, 99569, 99573,
- 99577, 99581, 99585, 99589, 99593, 99597, 99601, 99605, 99609, 99613,
- 99617, 99621, 99625, 99629, 99633, 99637, 99641, 99645, 99649, 99653,
- 99657, 99661, 99665, 99669, 99673, 99677, 99681, 99685, 99689, 99693,
- 99697, 99701, 99705, 99709, 99713, 99717, 99721, 99725, 99729, 99733,
- 99737, 99741, 99745, 99749, 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, 121729, 121733, 121737, 121742, 121747, 0, 121749, 121758,
+ 121766, 121775, 121789, 121803, 121817, 121824, 121831, 121835, 121844,
+ 121852, 121856, 121865, 121872, 121876, 0, 121880, 121884, 121891, 0,
+ 121895, 0, 121899, 0, 121906, 0, 121915, 121927, 121939, 0, 121943,
+ 121947, 121951, 121955, 121959, 121967, 0, 0, 121975, 121979, 121983,
+ 121987, 0, 121991, 0, 0, 121997, 122009, 122017, 122021, 0, 122025,
+ 122029, 122035, 122042, 122053, 122063, 122074, 122085, 122094, 122105,
+ 122111, 122117, 0, 0, 0, 0, 122123, 122132, 122139, 122145, 122149,
+ 122153, 122157, 122166, 122178, 122182, 122189, 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, 122196, 122198, 122200,
+ 122204, 122208, 122212, 122221, 122223, 122225, 122228, 122230, 122232,
+ 122236, 122238, 122242, 122244, 122248, 122250, 122252, 122256, 122260,
+ 122266, 122268, 122272, 122274, 122278, 122282, 122286, 122290, 122292,
+ 122294, 122298, 122302, 122306, 122310, 122312, 122314, 122316, 122321,
+ 122326, 122329, 122337, 122345, 122347, 122352, 122355, 122360, 122371,
+ 122378, 122383, 122388, 122390, 122394, 122396, 122400, 122402, 122406,
+ 122410, 122413, 122416, 122418, 122421, 122423, 122427, 122429, 122431,
+ 122433, 122437, 122439, 122443, 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, 99753,
- 99757, 99761, 99765, 99769, 99773, 99777, 99781, 99785, 99789, 99793,
- 99797, 99801, 99805, 99809, 99813, 99817, 99821, 99825, 99829, 99833,
- 99837, 99841, 99845, 99849, 99853, 99857, 99861, 99865, 99869, 99873,
- 99877, 99881, 99885, 99889, 99893, 99897, 99901, 99905, 99909, 99913,
- 99917, 99921, 99925, 99929, 99933, 99937, 99941, 99945, 99949, 99953,
- 99957, 99961, 99965, 99969, 99973, 99977, 99981, 99985, 99989, 99993,
- 99997, 100001, 100005, 100009, 100013, 100017, 100021, 100025, 100029,
- 100033, 100037, 100041, 100045, 100049, 100053, 100057, 100061, 100065,
- 100069, 100073, 100077, 100081, 100085, 100089, 100093, 100097, 100101,
- 100105, 100109, 100113, 100117, 100121, 100125, 100129, 100133, 100137,
- 100141, 100145, 100149, 100153, 100157, 100161, 100165, 100169, 100173,
- 100177, 100181, 100185, 100189, 100193, 100197, 100201, 100205, 100209,
- 100213, 100217, 100221, 100225, 100229, 100233, 100237, 100241, 100245,
- 100249, 100253, 100257, 100261, 100265, 100269, 100273, 100277, 100281,
- 100285, 100289, 100293, 100297, 100301, 100305, 100309, 100313, 100317,
- 100321, 100325, 100329, 100333, 100337, 100341, 100345, 100349, 100353,
- 100357, 100361, 100365, 100369, 100373, 100377, 100381, 100385, 100389,
- 100393, 100397, 100401, 100405, 100409, 100413, 100417, 100421, 100425,
- 100429, 100433, 100437, 100441, 100445, 100449, 100453, 100457, 100461,
- 100465, 100469, 100473, 100477, 100481, 100485, 100489, 100493, 100497,
- 100501, 100505, 100509, 100513, 100517, 100521, 100525, 100529, 100533,
- 100537, 100541, 100545, 100549, 100553, 100557, 100561, 100565, 100569,
- 100573, 100577, 100581, 100585, 100589, 100593, 100597, 100601, 100605,
- 100609, 100613, 100617, 100621, 100625, 100629, 100633, 100637, 100641,
- 100645, 100649, 100653, 100657, 100661, 100665, 100669, 100673, 100677,
- 100681, 100685, 100689, 100693, 100697, 100701, 100705, 100709, 100713,
- 100717, 100721, 100725, 100729, 100733, 100737, 100741, 100745, 100749,
- 100753, 100757, 100761, 100765, 100769, 100773, 100777, 100781, 100785,
- 100789, 100793, 100797, 100801, 100805, 100809, 100813, 100817, 100821,
- 100825, 100829, 100833, 100837, 100841, 100845, 100849, 100853, 100857,
- 100861, 100865, 100869, 100873, 100877, 100881, 100885, 100889, 100893,
- 100897, 100901, 100905, 100909, 100913, 100917, 100921, 100925, 100929,
- 100933, 100937, 100941, 100945, 100949, 100953, 100957, 100961, 100965,
- 100969, 100973, 100977, 100981, 100985, 100989, 100993, 100997, 101001,
- 101005, 101009, 101013, 101017, 101021, 101025, 101029, 101033, 101037,
- 101041, 101045, 101049, 101053, 101057, 101061, 101065, 101069, 101073,
- 101077, 101081, 101085, 101089, 101093, 101097, 101101, 101105, 101109,
- 101113, 101117, 101121, 101125, 101129, 101133, 101137, 101141, 101145,
- 101149, 101153, 101157, 101161, 101165, 101169, 101173, 101177, 101181,
- 101185, 101189, 101193, 101197, 101201, 101205, 101209, 101213, 101217,
- 101221, 101225, 101229, 101233, 101237, 101241, 101245, 101249, 101253,
- 101257, 101261, 101265, 101269, 101273, 101277, 101281, 101285, 101289,
- 101293, 101297, 101301, 101305, 101309, 101313, 101317, 101321, 101325,
- 101329, 101333, 101337, 101341, 101345, 101349, 101353, 101357, 101361,
- 101365, 101369, 101373, 101377, 101381, 101385, 101389, 101393, 101397,
- 101401, 101405, 101409, 101413, 101417, 101421, 101425, 101429, 101433,
- 101437, 101441, 101445, 101449, 101453, 101457, 101461, 101465, 101469,
- 101473, 101477, 101481, 101485, 101489, 101493, 101497, 101501, 101505,
- 101509, 101513, 101517, 101521, 101525, 101529, 101533, 101537, 101541,
- 101545, 101549, 101553, 101557, 101561, 101565, 101569, 101573, 101577,
- 101581, 101585, 101589, 101593, 101597, 101601, 101605, 101609, 101613,
- 101617, 101621, 101625, 101629, 101633, 101637, 101641, 101645, 101649,
- 101653, 101657, 101661, 101665, 101669, 101673, 101677, 101681, 101685,
- 101689, 101693, 101697, 101701, 101705, 101709, 101713, 101717, 101721,
- 101725, 101729, 101733, 101737, 101741, 101745, 101749, 101753, 101757,
- 101761, 101765, 101769, 101773, 101777, 101781, 101785, 101789, 101793,
- 101797, 101801, 101805, 101809, 101813, 101817, 101821, 101825, 101829,
- 101833, 101837, 101841, 101845, 101849, 101853, 101857, 101861, 101865,
- 101869, 101873, 101877, 101881, 101885, 101889, 101893, 101897, 101901,
- 101905, 101909, 101913, 101917, 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, 122446,
+ 122451, 122456, 122461, 122466, 122471, 122476, 122483, 122490, 122497,
+ 122504, 122509, 122514, 122519, 122524, 122531, 122537, 122544, 122551,
+ 122558, 122563, 122568, 122573, 122578, 122583, 122590, 122597, 122602,
+ 122607, 122614, 122621, 122629, 122637, 122644, 122651, 122659, 122667,
+ 122675, 122682, 122692, 122703, 122708, 122715, 122722, 122729, 122737,
+ 122745, 122756, 122764, 122772, 122780, 122785, 122790, 122795, 122800,
+ 122805, 122810, 122815, 122820, 122825, 122830, 122835, 122840, 122847,
+ 122852, 122857, 122864, 122869, 122874, 122879, 122884, 122889, 122894,
+ 122899, 122904, 122909, 122914, 122919, 122924, 122931, 122939, 122944,
+ 122949, 122956, 122961, 122966, 122971, 122978, 122983, 122990, 122995,
+ 123002, 123007, 123016, 123025, 123030, 123035, 123040, 123045, 123050,
+ 123055, 123060, 123065, 123070, 123075, 123080, 123085, 123090, 123098,
+ 123106, 123111, 123116, 123121, 123126, 123131, 123137, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 123143, 123147, 123151, 123155, 123159, 123163, 123167,
+ 123171, 123175, 123179, 123183, 123187, 123191, 123195, 123199, 123203,
+ 123207, 123211, 123215, 123219, 123223, 123227, 123231, 123235, 123239,
+ 123243, 123247, 123251, 123255, 123259, 123263, 123267, 123271, 123275,
+ 123279, 123283, 123287, 123291, 123295, 123299, 123303, 123307, 123311,
+ 123315, 123319, 123323, 123327, 123331, 123335, 123339, 123343, 123347,
+ 123351, 123355, 123359, 123363, 123367, 123371, 123375, 123379, 123383,
+ 123387, 123391, 123395, 123399, 123403, 123407, 123411, 123415, 123419,
+ 123423, 123427, 123431, 123435, 123439, 123443, 123447, 123451, 123455,
+ 123459, 123463, 123467, 123471, 123475, 123479, 123483, 123487, 123491,
+ 123495, 123499, 123503, 123507, 123511, 123515, 123519, 123523, 123527,
+ 123531, 123535, 123539, 123543, 123547, 123551, 123555, 123559, 123563,
+ 123567, 123571, 123575, 123579, 123583, 123587, 123591, 123595, 123599,
+ 123603, 123607, 123611, 123615, 123619, 123623, 123627, 123631, 123635,
+ 123639, 123643, 123647, 123651, 123655, 123659, 123663, 123667, 123671,
+ 123675, 123679, 123683, 123687, 123691, 123695, 123699, 123703, 123707,
+ 123711, 123715, 123719, 123723, 123727, 123731, 123735, 123739, 123743,
+ 123747, 123751, 123755, 123759, 123763, 123767, 123771, 123775, 123779,
+ 123783, 123787, 123791, 123795, 123799, 123803, 123807, 123811, 123815,
+ 123819, 123823, 123827, 123831, 123835, 123839, 123843, 123847, 123851,
+ 123855, 123859, 123863, 123867, 123871, 123875, 123879, 123883, 123887,
+ 123891, 123895, 123899, 123903, 123907, 123911, 123915, 123919, 123923,
+ 123927, 123931, 123935, 123939, 123943, 123947, 123951, 123955, 123959,
+ 123963, 123967, 123971, 123975, 123979, 123983, 123987, 123991, 123995,
+ 123999, 124003, 124007, 124011, 124015, 124019, 124023, 124027, 124031,
+ 124035, 124039, 124043, 124047, 124051, 124055, 124059, 124063, 124067,
+ 124071, 124075, 124079, 124083, 124087, 124091, 124095, 124099, 124103,
+ 124107, 124111, 124115, 124119, 124123, 124127, 124131, 124135, 124139,
+ 124143, 124147, 124151, 124155, 124159, 124163, 124167, 124171, 124175,
+ 124179, 124183, 124187, 124191, 124195, 124199, 124203, 124207, 124211,
+ 124215, 124219, 124223, 124227, 124231, 124235, 124239, 124243, 124247,
+ 124251, 124255, 124259, 124263, 124267, 124271, 124275, 124279, 124283,
+ 124287, 124291, 124295, 124299, 124303, 124307, 124311, 124315, 124319,
+ 124323, 124327, 124331, 124335, 124339, 124343, 124347, 124351, 124355,
+ 124359, 124363, 124367, 124371, 124375, 124379, 124383, 124387, 124391,
+ 124395, 124399, 124403, 124407, 124411, 124415, 124419, 124423, 124427,
+ 124431, 124435, 124439, 124443, 124447, 124451, 124455, 124459, 124463,
+ 124467, 124471, 124475, 124479, 124483, 124487, 124491, 124495, 124499,
+ 124503, 124507, 124511, 124515, 124519, 124523, 124527, 124531, 124535,
+ 124539, 124543, 124547, 124551, 124555, 124559, 124563, 124567, 124571,
+ 124575, 124579, 124583, 124587, 124591, 124595, 124599, 124603, 124607,
+ 124611, 124615, 124619, 124623, 124627, 124631, 124635, 124639, 124643,
+ 124647, 124651, 124655, 124659, 124663, 124667, 124671, 124675, 124679,
+ 124683, 124687, 124691, 124695, 124699, 124703, 124707, 124711, 124715,
+ 124719, 124723, 124727, 124731, 124735, 124739, 124743, 124747, 124751,
+ 124755, 124759, 124763, 124767, 124771, 124775, 124779, 124783, 124787,
+ 124791, 124795, 124799, 124803, 124807, 124811, 124815, 124819, 124823,
+ 124827, 124831, 124835, 124839, 124843, 124847, 124851, 124855, 124859,
+ 124863, 124867, 124871, 124875, 124879, 124883, 124887, 124891, 124895,
+ 124899, 124903, 124907, 124911, 124915, 124919, 124923, 124927, 124931,
+ 124935, 124939, 124943, 124947, 124951, 124955, 124959, 124963, 124967,
+ 124971, 124975, 124979, 124983, 124987, 124991, 124995, 124999, 125003,
+ 125007, 125011, 125015, 125019, 125023, 125027, 125031, 125035, 125039,
+ 125043, 125047, 125051, 125055, 125059, 125063, 125067, 125071, 125075,
+ 125079, 125083, 125087, 125091, 125095, 125099, 125103, 125107, 125111,
+ 125115, 125119, 125123, 125127, 125131, 125135, 125139, 125143, 125147,
+ 125151, 125155, 125159, 125163, 125167, 125171, 125175, 125179, 125183,
+ 125187, 125191, 125195, 125199, 125203, 125207, 125211, 125215, 125219,
+ 125223, 125227, 125231, 125235, 125239, 125243, 125247, 125251, 125255,
+ 125259, 125263, 125267, 125271, 125275, 125279, 125283, 125287, 125291,
+ 125295, 125299, 125303, 125307, 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, 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, 101921, 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, 101925,
- 101928, 101932, 101936, 101939, 101943, 101947, 101950, 101953, 101957,
- 101961, 101964, 101967, 101970, 101973, 101978, 101981, 101985, 101988,
- 101991, 101994, 101997, 102000, 102003, 102006, 102009, 102012, 102015,
- 102018, 102022, 102026, 102030, 102034, 102039, 102044, 102050, 102056,
- 102062, 102067, 102073, 102078, 102083, 102088, 102094, 102100, 102105,
- 102110, 102115, 102120, 102126, 102132, 102137, 102142, 102148, 102153,
- 102158, 102164, 102170, 102176, 102182, 102186, 102191, 102195, 102200,
- 102204, 102209, 102214, 102220, 102226, 102232, 102237, 102243, 102248,
- 102253, 102258, 102264, 102270, 102275, 102280, 102285, 102290, 102296,
- 102302, 102307, 102312, 102318, 102323, 102328, 102334, 102340, 102346,
- 102352, 102357, 102361, 102366, 102368, 102372, 102375, 102378, 102381,
- 102384, 102387, 102390, 102393, 102396, 102399, 102402, 102405, 102408,
- 102411, 102414, 102417, 102420, 102423, 102426, 102429, 102432, 102435,
- 102438, 102441, 102444, 102447, 102450, 102453, 102456, 102459, 102462,
- 102465, 102468, 102471, 102474, 102477, 102480, 102483, 102486, 102489,
- 102492, 102495, 102498, 102501, 102504, 102507, 102510, 102513, 102516,
- 102519, 102522, 102525, 102528, 102531, 102534, 102537, 102540, 102543,
- 102546, 102549, 102552, 102555, 102558, 102561, 102564, 102567, 102570,
- 102573, 102576, 102579, 102582, 102585, 102588, 102591, 102594, 102597,
- 102600, 102603, 102606, 102609, 102612, 102615, 102618, 102621, 102624,
- 102627, 102630, 102633, 102636, 102639, 102642, 102645, 102648, 102651,
- 102654, 102657, 102660, 102663, 102666, 102669, 102672, 102675, 102678,
- 102681, 102684, 102687, 102690, 102693, 102696, 102699, 102702, 102705,
- 102708, 102711, 102714, 102717, 102720, 102723, 102726, 102729, 102732,
- 102735, 102738, 102741, 102744, 102747, 102750, 102753, 102756, 102759,
- 102762, 102765, 102768, 102771, 102774, 102777, 102780, 102783, 102786,
- 102789, 102792, 102795, 102798, 102801, 102804, 102807, 102810, 102813,
- 102816, 102819, 102822, 102825, 102828, 102831, 102834, 102837, 102840,
- 102843, 102846, 102849, 102852, 102855, 102858, 102861, 102864, 102867,
- 102870, 102873, 102876, 102879, 102882, 102885, 102888, 102891, 102894,
- 102897, 102900, 102903, 102906, 102909, 102912, 102915, 102918, 102921,
- 102924, 102927, 102930, 102933, 102936, 102939, 102942, 102945, 102948,
- 102951, 102954, 102957, 102960, 102963, 102966, 102969, 102972, 102975,
- 102978, 102981, 102984, 102987, 102990, 102993, 102996, 102999, 103002,
- 103005, 103008, 103011, 103014, 103017, 103020, 103023, 103026, 103029,
- 103032, 103035, 103038, 103041, 103044, 103047, 103050, 103053, 103056,
- 103059, 103062, 103065, 103068, 103071, 103074, 103077, 103080, 103083,
- 103086, 103089, 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, 125311, 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, 125315,
+ 125318, 125322, 125326, 125329, 125333, 125337, 125340, 125343, 125347,
+ 125351, 125354, 125357, 125360, 125363, 125368, 125371, 125375, 125378,
+ 125381, 125384, 125387, 125390, 125393, 125396, 125399, 125402, 125405,
+ 125408, 125412, 125416, 125420, 125424, 125429, 125434, 125440, 125446,
+ 125452, 125457, 125463, 125469, 125475, 125480, 125486, 125492, 125497,
+ 125502, 125507, 125512, 125518, 125524, 125529, 125534, 125540, 125545,
+ 125551, 125557, 125563, 125569, 125575, 125579, 125584, 125588, 125593,
+ 125597, 125602, 125607, 125613, 125619, 125625, 125630, 125636, 125642,
+ 125648, 125653, 125659, 125665, 125670, 125675, 125680, 125685, 125691,
+ 125697, 125702, 125707, 125713, 125718, 125724, 125730, 125736, 125742,
+ 125748, 125753, 125757, 125762, 125765, 125769, 125772, 125775, 125778,
+ 125781, 125784, 125787, 125790, 125793, 125796, 125799, 125802, 125805,
+ 125808, 125811, 125814, 125817, 125820, 125823, 125826, 125829, 125832,
+ 125835, 125838, 125841, 125844, 125847, 125850, 125853, 125856, 125859,
+ 125862, 125865, 125868, 125871, 125874, 125877, 125880, 125883, 125886,
+ 125889, 125892, 125895, 125898, 125901, 125904, 125907, 125910, 125913,
+ 125916, 125919, 125922, 125925, 125928, 125931, 125934, 125937, 125940,
+ 125943, 125946, 125949, 125952, 125955, 125958, 125961, 125964, 125967,
+ 125970, 125973, 125976, 125979, 125982, 125985, 125988, 125991, 125994,
+ 125997, 126000, 126003, 126006, 126009, 126012, 126015, 126018, 126021,
+ 126024, 126027, 126030, 126033, 126036, 126039, 126042, 126045, 126048,
+ 126051, 126054, 126057, 126060, 126063, 126066, 126069, 126072, 126075,
+ 126078, 126081, 126084, 126087, 126090, 126093, 126096, 126099, 126102,
+ 126105, 126108, 126111, 126114, 126117, 126120, 126123, 126126, 126129,
+ 126132, 126135, 126138, 126141, 126144, 126147, 126150, 126153, 126156,
+ 126159, 126162, 126165, 126168, 126171, 126174, 126177, 126180, 126183,
+ 126186, 126189, 126192, 126195, 126198, 126201, 126204, 126207, 126210,
+ 126213, 126216, 126219, 126222, 126225, 126228, 126231, 126234, 126237,
+ 126240, 126243, 126246, 126249, 126252, 126255, 126258, 126261, 126264,
+ 126267, 126270, 126273, 126276, 126279, 126282, 126285, 126288, 126291,
+ 126294, 126297, 126300, 126303, 126306, 126309, 126312, 126315, 126318,
+ 126321, 126324, 126327, 126330, 126333, 126336, 126339, 126342, 126345,
+ 126348, 126351, 126354, 126357, 126360, 126363, 126366, 126369, 126372,
+ 126375, 126378, 126381, 126384, 126387, 126390, 126393, 126396, 126399,
+ 126402, 126405, 126408, 126411, 126414, 126417, 126420, 126423, 126426,
+ 126429, 126432, 126435, 126438, 126441, 126444, 126447, 126450, 126453,
+ 126456, 126459, 126462, 126465, 126468, 126471, 126474, 126477, 126480,
+ 126483, 126486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
/* name->code dictionary */
static unsigned int code_hash[] = {
- 74224, 4851, 0, 0, 0, 0, 7929, 0, 194682, 0, 0, 66480, 0, 42833, 74529,
- 12064, 0, 596, 0, 0, 65842, 8651, 0, 0, 120218, 12995, 64865, 1373, 0, 0,
- 5816, 119067, 64810, 4231, 917833, 0, 4233, 4234, 4232, 917836, 0,
- 120210, 917841, 917840, 0, 8851, 0, 0, 0, 41601, 8874, 0, 7748, 0, 0, 0,
- 0, 41603, 9784, 0, 9188, 41600, 0, 0, 0, 1457, 3535, 0, 0, 0, 0, 65240,
- 11951, 0, 3404, 0, 0, 0, 1759, 0, 194964, 0, 0, 0, 66577, 0, 0, 65859, 0,
- 0, 0, 0, 0, 0, 65930, 9834, 3055, 9852, 0, 65288, 0, 11398, 0, 0, 119255,
- 0, 0, 603, 0, 43548, 0, 0, 917824, 3350, 120817, 64318, 917828, 127089,
- 3390, 74483, 43265, 120599, 917830, 917829, 0, 1919, 3400, 0, 917813, 0,
- 917540, 66446, 64141, 8562, 64139, 64138, 4043, 8712, 64134, 64133,
- 11297, 0, 0, 11966, 64128, 0, 0, 0, 64132, 10867, 64130, 64129, 0, 0,
- 9779, 2764, 66002, 0, 9471, 0, 66021, 0, 0, 5457, 5440, 8857, 0, 65282,
- 2843, 5355, 0, 0, 0, 5194, 11657, 0, 0, 0, 0, 0, 0, 127027, 10717, 64570,
- 5630, 74350, 64143, 10682, 0, 10602, 800, 42499, 66186, 0, 0, 64930,
- 11631, 64146, 64145, 64144, 762, 13172, 118859, 0, 0, 10906, 1353, 6960,
- 0, 0, 5828, 8724, 917806, 8933, 1601, 42244, 858, 7080, 917808, 917807,
- 8090, 0, 74401, 917811, 587, 0, 0, 0, 0, 0, 0, 2750, 0, 556, 64158,
- 64157, 0, 12213, 0, 2760, 0, 0, 0, 0, 64156, 64155, 42496, 0, 64151,
- 64150, 12679, 10053, 10421, 11787, 64153, 64152, 0, 0, 4839, 0, 0, 1874,
- 120352, 0, 6577, 64125, 64124, 64123, 0, 0, 0, 7007, 7590, 65443, 9036,
- 0, 64122, 74422, 66609, 0, 64117, 64116, 6287, 64114, 2725, 64120, 64119,
- 64118, 42128, 0, 1177, 65601, 12322, 64106, 0, 0, 64102, 7859, 1945,
- 64099, 0, 10453, 64104, 7188, 7997, 0, 0, 0, 8705, 64097, 64096, 9571,
- 528, 917989, 0, 11429, 0, 0, 0, 0, 73841, 0, 0, 9056, 0, 6188, 120019,
- 6155, 64068, 1823, 64066, 64065, 64072, 64071, 63, 7233, 0, 0, 41904,
- 6639, 64064, 0, 0, 0, 1176, 118959, 0, 8162, 0, 0, 0, 120519, 66376,
- 66242, 11415, 4333, 9855, 64112, 64642, 0, 5388, 0, 0, 0, 7714, 66222, 0,
- 7768, 0, 4199, 64708, 0, 0, 0, 8708, 9560, 64077, 64076, 8996, 4992,
- 4471, 42622, 64079, 64078, 0, 0, 0, 0, 64615, 0, 0, 12075, 0, 0, 5174, 0,
- 0, 0, 3123, 0, 12685, 0, 8408, 64704, 0, 0, 9223, 0, 41616, 0, 73797, 0,
- 1116, 0, 43049, 0, 43050, 8548, 0, 0, 119061, 0, 0, 13115, 64092, 64091,
- 9322, 0, 120595, 64095, 64094, 8111, 66247, 42332, 64089, 64088, 6199, 0,
- 0, 11434, 64083, 64082, 11329, 7737, 64087, 64086, 64085, 64084, 0, 0,
- 41335, 4118, 1797, 0, 41334, 0, 46, 0, 0, 298, 0, 0, 0, 42627, 0, 32,
- 6187, 119052, 11495, 11459, 3665, 0, 42871, 0, 19923, 74335, 0, 0, 66239,
- 0, 64403, 4412, 7240, 0, 0, 0, 65758, 12750, 4181, 8544, 0, 120199, 0,
- 120198, 120203, 6181, 65014, 0, 0, 0, 3639, 119588, 0, 0, 0, 10073,
- 120206, 0, 0, 0, 42844, 7498, 1098, 0, 0, 0, 0, 10207, 8789, 0, 0, 0, 0,
- 9234, 0, 6182, 0, 65058, 0, 0, 0, 0, 5471, 9461, 5573, 118936, 5473, 44,
- 0, 66244, 118907, 0, 66238, 12844, 0, 1622, 7767, 1900, 41339, 11458, 0,
- 0, 6581, 5576, 0, 64405, 41337, 0, 0, 8947, 0, 0, 41694, 0, 0, 7908, 0,
- 10408, 6579, 0, 194829, 0, 0, 0, 6583, 7761, 127010, 120504, 194828, 0,
- 5058, 41010, 9992, 0, 5057, 0, 0, 74538, 5054, 118951, 194971, 0, 0,
- 1437, 41617, 658, 3497, 0, 7486, 5061, 5060, 4235, 0, 0, 0, 12113, 4236,
- 4727, 0, 0, 7693, 10749, 0, 7488, 5773, 978, 0, 0, 41619, 10239, 0, 0,
- 66209, 0, 0, 9748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9341,
- 119596, 2379, 11325, 0, 64668, 67854, 8125, 120545, 0, 119175, 917940,
- 2369, 0, 0, 0, 119235, 74092, 73936, 7008, 0, 0, 0, 0, 2367, 0, 0, 264,
- 2375, 8060, 6194, 119858, 1844, 119084, 0, 12858, 0, 0, 6961, 0, 0, 0,
- 8800, 0, 42862, 4463, 65581, 6192, 194676, 42771, 0, 0, 725, 65042,
- 118797, 120800, 0, 12892, 0, 0, 0, 0, 0, 0, 0, 120707, 0, 0, 5074, 5073,
- 0, 8983, 0, 917939, 0, 5072, 0, 6198, 11614, 0, 196, 0, 0, 0, 4929,
- 120342, 0, 0, 0, 0, 42847, 0, 0, 0, 4934, 0, 41323, 9758, 0, 120341, 0,
- 42584, 0, 4329, 41321, 4979, 3048, 7752, 41320, 0, 74418, 12819, 0, 5071,
- 0, 3642, 0, 5070, 10042, 0, 3987, 5068, 0, 0, 120216, 0, 0, 10636, 73981,
- 11806, 43167, 4531, 1245, 9105, 66463, 4921, 120219, 4926, 65544, 73884,
- 194619, 0, 0, 64709, 0, 194620, 120790, 4922, 325, 992, 119568, 4925, 0,
- 0, 9526, 4920, 0, 948, 0, 120208, 4930, 0, 0, 120275, 4933, 0, 0, 0,
- 4928, 0, 0, 74770, 0, 0, 722, 0, 19908, 12637, 0, 119855, 8753, 1509, 0,
- 5468, 9511, 0, 0, 1672, 6205, 10864, 74586, 0, 0, 0, 0, 0, 73863, 0, 0,
- 41607, 120115, 1679, 120116, 194932, 120113, 0, 7005, 41609, 9580, 0,
- 401, 0, 120109, 6968, 5761, 342, 8553, 0, 8143, 127115, 11983, 127113,
- 624, 74508, 0, 119630, 5078, 74258, 12478, 0, 5076, 0, 194609, 0, 120097,
- 685, 9025, 1524, 12618, 0, 5539, 0, 120095, 120102, 120094, 120552, 0,
- 194611, 0, 0, 12520, 8058, 9732, 0, 5080, 64775, 5036, 5035, 120590,
- 42604, 0, 0, 8074, 275, 13291, 1907, 0, 4432, 0, 5033, 0, 0, 4836, 3888,
- 73792, 10729, 64546, 194600, 120681, 194937, 0, 67588, 119000, 0, 0,
- 8858, 6409, 0, 120252, 0, 0, 0, 66321, 0, 12814, 0, 3432, 10218, 0, 6094,
- 7641, 42445, 0, 0, 42406, 1676, 74320, 194607, 0, 5030, 0, 0, 0, 0, 9622,
- 0, 0, 0, 0, 0, 0, 0, 10544, 12919, 0, 0, 0, 0, 0, 0, 0, 947, 119835,
- 194586, 194585, 10969, 119935, 7613, 119937, 119936, 4795, 119930, 7018,
- 64914, 0, 120192, 120268, 0, 43567, 74056, 917910, 0, 119919, 7216,
- 65232, 7217, 251, 7218, 7895, 4395, 43538, 119926, 119929, 119928, 7213,
- 119922, 7214, 7215, 0, 74141, 8880, 7685, 0, 120173, 65540, 119618, 625,
- 8187, 42861, 1113, 7236, 7915, 3630, 120176, 8179, 74264, 67886, 9316,
- 10980, 2489, 65624, 8150, 1359, 0, 0, 0, 73756, 5042, 5041, 42769, 12084,
- 0, 0, 0, 0, 0, 0, 0, 0, 12283, 1616, 3795, 0, 8795, 66245, 0, 0, 0, 1138,
- 73905, 12677, 0, 0, 3239, 0, 0, 0, 8431, 0, 42164, 0, 11778, 12620, 0,
- 73773, 119073, 5040, 0, 0, 0, 0, 0, 5039, 0, 0, 0, 5038, 0, 0, 13184,
- 74293, 0, 64648, 0, 9359, 0, 0, 0, 65157, 6662, 0, 0, 3863, 73909, 4835,
- 0, 0, 0, 4309, 0, 194569, 0, 194568, 1301, 0, 119595, 569, 0, 0, 711,
- 119085, 0, 0, 73880, 11610, 11368, 0, 194571, 41331, 1006, 74240, 0,
- 1550, 8201, 73737, 7627, 5499, 5031, 0, 0, 65784, 0, 65267, 3758, 0,
- 65781, 64734, 0, 2440, 65780, 0, 8449, 0, 5008, 0, 8822, 0, 12121, 8255,
- 5512, 73875, 119560, 0, 64313, 2641, 5906, 1119, 127068, 13038, 0, 2455,
- 0, 118809, 0, 0, 0, 0, 8714, 0, 4211, 0, 0, 0, 0, 0, 5052, 66220, 5821,
- 6186, 65778, 65775, 5051, 65773, 1429, 42647, 5050, 302, 388, 41115, 735,
- 6637, 5907, 120670, 0, 12726, 74594, 9117, 0, 0, 5513, 6666, 5053, 74230,
- 5510, 0, 0, 0, 2470, 0, 0, 1925, 0, 0, 0, 0, 5048, 5047, 0, 0, 0, 194863,
- 0, 74497, 0, 8089, 6929, 639, 0, 68179, 0, 0, 0, 4599, 41402, 6674,
- 120631, 43294, 1476, 648, 0, 65819, 3233, 0, 0, 10164, 0, 0, 3530, 9750,
- 0, 0, 6656, 194858, 0, 5046, 8512, 65856, 74261, 8967, 0, 5045, 0, 1916,
- 7986, 5044, 120556, 9006, 13128, 5043, 0, 7853, 74068, 74004, 9669,
- 12341, 12703, 8402, 0, 119070, 0, 41750, 3586, 64508, 43148, 0, 0,
- 119606, 0, 13296, 517, 0, 0, 0, 41528, 123, 65454, 0, 0, 74478, 10531,
- 7784, 41526, 10829, 73991, 8057, 1126, 73895, 0, 194591, 0, 3925, 0,
- 8069, 43142, 120439, 489, 0, 0, 120441, 120452, 43151, 0, 0, 66200, 0, 0,
- 0, 0, 0, 0, 8711, 6183, 0, 0, 0, 120448, 7623, 118925, 194853, 9235,
- 12760, 74176, 0, 66445, 43540, 120437, 3743, 11514, 11078, 0, 12136, 0,
- 0, 120435, 0, 7726, 0, 19922, 267, 3393, 0, 1371, 194849, 0, 2458, 0,
- 6201, 0, 41074, 4266, 10652, 41612, 41077, 3402, 9050, 3398, 0, 0, 0,
- 3391, 41075, 2476, 0, 917550, 0, 10625, 0, 12767, 13017, 0, 64261, 64934,
- 0, 13014, 13013, 0, 6673, 0, 0, 0, 12438, 0, 0, 0, 0, 0, 9053, 13015,
- 74523, 0, 704, 66215, 6195, 0, 6660, 194941, 917760, 917793, 0, 12629,
- 11435, 0, 0, 65538, 0, 0, 0, 74547, 0, 65448, 0, 12948, 195003, 195002,
- 119238, 195004, 195007, 195006, 0, 0, 4287, 8276, 4902, 1131, 0, 0,
- 66728, 1816, 0, 42533, 168, 0, 4898, 64298, 0, 0, 4901, 1821, 0, 578,
- 3653, 0, 791, 9162, 6977, 0, 119298, 74561, 0, 73731, 8354, 43590, 0, 0,
- 7557, 0, 119301, 8234, 7241, 0, 194994, 119167, 194996, 12811, 65925,
- 3946, 195000, 10998, 0, 673, 194867, 64397, 0, 74599, 0, 0, 194977,
- 194976, 2448, 194978, 10267, 8424, 2452, 120760, 194864, 8729, 0, 0,
- 7845, 0, 0, 4408, 4122, 0, 11039, 8723, 194990, 194989, 119302, 731,
- 119304, 119303, 2438, 64855, 119300, 119299, 1175, 0, 42135, 373, 119172,
- 5396, 11457, 11521, 7723, 0, 0, 0, 41952, 0, 5273, 8248, 5269, 0, 5202,
- 2404, 5267, 42823, 11291, 19915, 5277, 12963, 0, 6189, 4125, 1314, 12133,
- 0, 118873, 1271, 0, 0, 66024, 41482, 3864, 74539, 0, 3879, 0, 12978,
- 4166, 4574, 0, 7567, 7459, 0, 41390, 5384, 41882, 67647, 0, 0, 0, 0,
- 41388, 0, 41392, 64288, 41387, 0, 8706, 5552, 0, 700, 0, 5553, 0, 7088,
- 5356, 7499, 0, 66596, 0, 0, 0, 5554, 0, 12344, 10311, 0, 6665, 0, 0,
- 7618, 8517, 11455, 0, 64632, 66017, 5555, 0, 0, 0, 0, 119204, 65033,
- 9143, 6668, 195067, 195066, 195069, 656, 195071, 65037, 4577, 64624, 0,
- 0, 0, 0, 4269, 73885, 917775, 42846, 917774, 950, 0, 0, 66580, 118895,
+ 74224, 4851, 0, 78156, 78499, 128685, 7929, 0, 194682, 127766, 78500,
+ 66480, 0, 42833, 74529, 12064, 0, 596, 0, 128103, 13192, 8651, 0, 0,
+ 120218, 12995, 64865, 1373, 0, 0, 5816, 119067, 64810, 4231, 6825, 42897,
+ 4233, 4234, 4232, 917836, 74415, 120210, 6384, 917840, 78108, 8851, 0,
+ 128553, 0, 41601, 8874, 0, 7748, 0, 0, 0, 127939, 41603, 9784, 0, 9188,
+ 41600, 0, 120618, 128343, 1457, 3535, 0, 0, 0, 0, 65240, 11951, 0, 3404,
+ 0, 0, 0, 1759, 0, 41076, 68383, 120572, 119205, 66577, 0, 127764, 65859,
+ 0, 7404, 0, 0, 0, 0, 65908, 9834, 3055, 9852, 0, 65288, 0, 11398, 0,
+ 92417, 119255, 0, 0, 603, 74398, 43548, 0, 0, 917824, 3350, 120817,
+ 64318, 917828, 127089, 3390, 74483, 43265, 120599, 917830, 78573, 0,
+ 1919, 3400, 120651, 127944, 11647, 917540, 66446, 64141, 8562, 2121,
+ 64138, 4043, 8712, 64134, 64133, 11297, 0, 0, 11966, 64128, 128587, 0, 0,
+ 64132, 10867, 64130, 64129, 0, 43374, 9779, 2764, 66002, 10167, 9471, 0,
+ 66021, 0, 0, 5457, 5440, 8857, 128771, 65282, 2843, 5355, 127928, 0, 0,
+ 5194, 11657, 43984, 128292, 0, 0, 0, 0, 127027, 10717, 64570, 5630,
+ 74350, 64143, 10682, 0, 10602, 800, 42499, 66186, 0, 0, 64930, 11631,
+ 64146, 64145, 64144, 762, 13172, 118859, 194661, 64468, 10906, 1353,
+ 6960, 0, 0, 5828, 8724, 917806, 8933, 1601, 42244, 858, 7080, 64109,
+ 64108, 8090, 0, 74401, 917811, 587, 0, 128131, 0, 0, 0, 78214, 2750,
+ 74218, 556, 64158, 64157, 0, 12213, 194678, 2760, 0, 0, 0, 194794, 64156,
+ 64155, 42496, 0, 64151, 64150, 12679, 10053, 10421, 11093, 64153, 64152,
+ 0, 0, 4839, 0, 0, 1874, 119016, 0, 6577, 64125, 64124, 64123, 0, 127531,
+ 92534, 7007, 7590, 65443, 9036, 92550, 64122, 74422, 66609, 0, 64117,
+ 64116, 6287, 64114, 2725, 64120, 64119, 43981, 42128, 127842, 1177,
+ 65601, 12322, 64106, 69640, 127306, 64102, 7859, 1945, 64099, 0, 10453,
+ 64104, 7188, 7997, 0, 7389, 0, 8705, 64097, 64096, 9571, 528, 128671,
+ 44017, 11429, 0, 0, 0, 917990, 73841, 0, 0, 9056, 64313, 6188, 120019,
+ 6155, 64068, 1823, 64066, 64065, 64072, 64071, 63, 7233, 92212, 0, 41904,
+ 6639, 64064, 0, 128344, 0, 1176, 118959, 127930, 8162, 128667, 0, 0,
+ 120519, 66376, 66242, 11415, 4333, 9855, 64112, 64642, 0, 5388, 0, 0, 0,
+ 7714, 66222, 0, 7768, 0, 4199, 64708, 0, 0, 0, 8708, 9560, 64077, 64076,
+ 8996, 4992, 4471, 42622, 64079, 64078, 92179, 0, 0, 0, 64615, 41915, 0,
+ 12075, 92211, 0, 5174, 0, 0, 127557, 3123, 0, 12685, 127904, 8408, 64704,
+ 0, 0, 9223, 0, 41616, 0, 73797, 0, 1116, 128204, 43049, 7136, 43050,
+ 8548, 120485, 0, 119061, 917999, 0, 13115, 43675, 64091, 9322, 0, 120595,
+ 64095, 64094, 8111, 66247, 42332, 64089, 64088, 6199, 0, 0, 11434, 64083,
+ 64082, 11329, 7737, 64087, 64086, 64085, 64084, 194817, 9927, 41335,
+ 4118, 1797, 0, 41334, 0, 46, 43448, 127881, 298, 0, 128114, 0, 42627, 0,
+ 32, 6187, 119052, 11495, 11459, 3665, 0, 42871, 0, 19923, 74335, 0,
+ 127192, 66239, 42264, 64403, 4412, 7240, 92495, 0, 0, 65758, 12750, 4181,
+ 8544, 0, 120199, 917897, 120198, 69809, 6181, 65014, 0, 0, 0, 3639,
+ 119588, 0, 0, 118904, 10073, 120206, 128862, 127186, 68409, 42844, 7498,
+ 1098, 92565, 120205, 0, 0, 10207, 8789, 0, 0, 0, 0, 9234, 0, 6182, 0,
+ 65058, 0, 0, 0, 0, 5471, 9461, 5573, 118936, 5473, 44, 0, 66244, 118907,
+ 0, 66238, 12844, 0, 1622, 7767, 1900, 41339, 11458, 0, 0, 6581, 5576, 0,
+ 64405, 41337, 0, 41631, 8947, 68390, 127844, 41694, 0, 0, 7908, 0, 10408,
+ 6579, 0, 64618, 0, 120147, 2138, 6583, 7761, 127010, 120504, 194828, 0,
+ 5058, 41010, 9992, 128299, 5057, 0, 0, 74538, 5054, 118951, 194971,
+ 78606, 0, 1437, 41617, 658, 3497, 128509, 7486, 5061, 5060, 4235, 0, 0,
+ 0, 12113, 4236, 4727, 0, 0, 7693, 10749, 0, 7488, 5773, 978, 128134, 0,
+ 41619, 10239, 68611, 0, 66209, 0, 128700, 9748, 0, 127524, 0, 0, 0, 0,
+ 195083, 0, 0, 0, 0, 0, 0, 0, 9341, 119596, 2379, 11325, 0, 64668, 67854,
+ 8125, 120545, 6743, 119175, 917940, 2369, 0, 0, 0, 119235, 74092, 73936,
+ 7008, 43660, 0, 0, 0, 2367, 127827, 0, 264, 2375, 8060, 6194, 119858,
+ 1844, 119084, 0, 6019, 0, 0, 6961, 0, 118839, 0, 8800, 0, 42862, 4463,
+ 65581, 6192, 194676, 42771, 0, 92333, 725, 65042, 118797, 120800, 0,
+ 12892, 0, 0, 0, 0, 0, 0, 127261, 120707, 0, 0, 5074, 5073, 128790, 8983,
+ 118981, 74493, 0, 5072, 128071, 6198, 11614, 0, 196, 0, 0, 0, 4929,
+ 120342, 0, 0, 0, 0, 42847, 0, 0, 0, 4934, 0, 41323, 9758, 0, 92289,
+ 127917, 42584, 0, 4329, 41321, 4979, 3048, 7752, 41320, 0, 74418, 12819,
+ 0, 5071, 0, 3642, 0, 5070, 10042, 118835, 3987, 5068, 0, 8909, 78650,
+ 78649, 0, 10636, 73981, 11806, 43167, 4531, 1245, 9105, 66463, 4921,
+ 120219, 4926, 65544, 73884, 194619, 0, 0, 64709, 0, 194620, 78880, 4922,
+ 325, 992, 119568, 4925, 0, 0, 9526, 4920, 0, 948, 0, 120208, 4930, 0,
+ 92175, 120275, 4933, 0, 0, 118985, 4928, 0, 0, 74770, 120194, 0, 722,
+ 194934, 19908, 12637, 127485, 119855, 8753, 1509, 0, 5468, 9511, 127474,
+ 127477, 1672, 6205, 10864, 74586, 127480, 92310, 127466, 78555, 127468,
+ 73863, 127470, 127473, 41607, 120115, 1679, 120116, 120180, 120113,
+ 127462, 7005, 41609, 9580, 0, 401, 0, 43779, 6968, 5761, 342, 8553, 0,
+ 8143, 127115, 11983, 92249, 624, 74508, 4057, 43788, 5078, 74258, 12478,
+ 0, 5076, 0, 194609, 0, 120097, 685, 9025, 1524, 12618, 0, 5539, 0, 92523,
+ 120102, 7138, 120552, 0, 194611, 78752, 0, 12520, 8058, 9732, 0, 5080,
+ 64775, 5036, 5035, 120590, 42604, 0, 0, 8074, 275, 13291, 1907, 78838,
+ 4432, 127271, 5033, 127273, 127272, 4836, 3888, 73792, 10729, 64546,
+ 127262, 43704, 127264, 127251, 67588, 119000, 127252, 127255, 8858, 6409,
+ 127256, 120252, 128100, 0, 0, 66321, 0, 12814, 127248, 3432, 10218, 0,
+ 6094, 7641, 42445, 0, 92487, 42406, 1676, 74320, 194607, 0, 5030, 0, 0,
+ 0, 73869, 9622, 0, 0, 6787, 0, 0, 0, 0, 10544, 12919, 0, 92218, 0, 0, 0,
+ 120789, 0, 947, 119835, 194586, 194585, 10969, 119935, 7613, 92562,
+ 119936, 4795, 119930, 7018, 7376, 120181, 120192, 120268, 0, 43567,
+ 74056, 917910, 118963, 119919, 7216, 65232, 7217, 251, 7218, 7895, 4395,
+ 43538, 119926, 119929, 119928, 7213, 119922, 7214, 7215, 0, 74141, 8880,
+ 7685, 66459, 120173, 65540, 119618, 625, 8187, 42861, 1113, 7236, 7915,
+ 3630, 120176, 8179, 74264, 67886, 9316, 10980, 2489, 65624, 8150, 1359,
+ 67652, 127329, 127330, 73756, 5042, 5041, 42769, 12084, 127324, 127321,
+ 92279, 127319, 127320, 127317, 127318, 127315, 12283, 1616, 3795, 0,
+ 8795, 66245, 0, 0, 0, 1138, 73905, 12677, 0, 0, 3239, 127311, 0, 0, 8431,
+ 0, 42164, 0, 11778, 12620, 6826, 73773, 119073, 5040, 0, 0, 0, 78420, 0,
+ 5039, 0, 78418, 0, 5038, 0, 0, 13184, 74293, 0, 64648, 0, 9359, 78416, 0,
+ 128770, 65157, 6662, 0, 0, 3863, 73909, 4835, 55266, 43432, 127822, 4309,
+ 7127, 194569, 0, 194568, 1301, 0, 42589, 569, 0, 73813, 711, 4389, 7133,
+ 0, 73880, 11610, 11368, 0, 194570, 41331, 1006, 74240, 0, 1550, 8201,
+ 73737, 7627, 5499, 5031, 77908, 42738, 65784, 77907, 65267, 3758, 0,
+ 65781, 64734, 0, 2440, 65780, 77913, 8449, 0, 5008, 0, 2118, 0, 12121,
+ 8255, 5512, 73875, 2128, 2130, 2131, 2126, 2133, 1119, 127068, 2114,
+ 2116, 2455, 0, 2122, 2123, 2124, 2125, 0, 8714, 0, 2113, 0, 2115, 128177,
+ 127907, 43713, 5052, 66220, 5821, 6186, 65778, 65775, 5051, 65773, 1429,
+ 42647, 5050, 302, 388, 41115, 735, 6637, 5907, 65088, 0, 12726, 74594,
+ 9117, 0, 12003, 5513, 6666, 5053, 74230, 5510, 78451, 0, 78447, 2470,
+ 78437, 0, 1925, 0, 92237, 74807, 0, 5048, 5047, 0, 0, 0, 92313, 0, 74497,
+ 92395, 8089, 6929, 639, 0, 68179, 64442, 0, 92348, 4599, 41402, 6674,
+ 43397, 43294, 1476, 648, 0, 65819, 3233, 0, 41782, 6951, 0, 0, 3530,
+ 9750, 128317, 0, 6656, 92367, 0, 5046, 8512, 65856, 74261, 8967, 0, 5045,
+ 0, 1916, 7986, 5044, 120556, 9006, 13128, 5043, 0, 7853, 74068, 74004,
+ 9669, 12341, 12703, 8402, 0, 119070, 917600, 41750, 3586, 64508, 43148,
+ 0, 0, 119606, 0, 13296, 517, 0, 128534, 194946, 41528, 123, 65454, 0, 0,
+ 74478, 10531, 7784, 41526, 10829, 73991, 8057, 1126, 73895, 0, 194591, 0,
+ 3925, 4251, 8069, 10517, 120439, 489, 0, 4250, 120441, 120452, 43151, 0,
+ 194851, 66200, 0, 0, 0, 78423, 0, 0, 8711, 6183, 0, 0, 0, 120448, 7623,
+ 118925, 194853, 9235, 12760, 74176, 69662, 66445, 43540, 10062, 3743,
+ 11514, 11078, 0, 12136, 0, 0, 120435, 0, 7726, 0, 19922, 267, 3393,
+ 42198, 1371, 194849, 69233, 2458, 0, 6201, 0, 41074, 4266, 10652, 41612,
+ 41077, 3402, 9050, 3398, 0, 0, 0, 3391, 41075, 2476, 0, 128017, 0, 10625,
+ 0, 12767, 13017, 78743, 64261, 64934, 127537, 13014, 13013, 0, 6673, 0,
+ 0, 0, 12438, 0, 0, 0, 0, 0, 9053, 13015, 74523, 0, 704, 66215, 6195, 0,
+ 6660, 78758, 917760, 917793, 42212, 12629, 11435, 0, 55256, 65538, 0,
+ 127940, 0, 74547, 0, 65448, 78100, 12948, 119001, 195002, 119238, 195004,
+ 78099, 127085, 0, 0, 4287, 8276, 4902, 1131, 0, 78458, 66728, 1816, 0,
+ 42533, 168, 42845, 4898, 64298, 0, 0, 4901, 1821, 0, 578, 3653, 0, 791,
+ 9162, 6977, 0, 119298, 74561, 0, 73731, 8354, 43590, 119303, 0, 7557,
+ 119339, 119301, 8234, 7241, 0, 194994, 119167, 194996, 12811, 65925,
+ 3946, 78078, 10998, 78080, 673, 194867, 64397, 128276, 74599, 78449,
+ 8890, 194977, 194976, 2448, 78085, 10267, 8424, 2452, 78083, 194864,
+ 8729, 78456, 0, 7845, 917917, 78692, 4408, 4122, 6772, 11039, 8723,
+ 194990, 127833, 119302, 731, 119304, 92286, 2438, 64855, 119300, 119299,
+ 1175, 0, 42135, 373, 119172, 2119, 11457, 11521, 7723, 0, 0, 0, 41952, 0,
+ 5273, 2127, 5269, 6337, 5202, 2404, 5267, 42823, 11291, 19915, 5277,
+ 12963, 127864, 6189, 4125, 1314, 12133, 0, 118873, 1271, 0, 0, 66024,
+ 41482, 3864, 74539, 0, 3879, 0, 12978, 4166, 4574, 0, 7567, 7459, 0,
+ 41390, 5384, 41882, 67647, 92548, 5759, 0, 0, 41388, 92362, 41392, 64288,
+ 41387, 0, 8706, 5552, 0, 700, 0, 5553, 0, 7088, 5356, 7499, 78110, 66596,
+ 0, 0, 10263, 5554, 0, 12344, 10311, 78113, 6665, 0, 0, 7618, 8517, 11455,
+ 78440, 64632, 64447, 5555, 78088, 78093, 78091, 0, 42803, 65033, 9143,
+ 6668, 195067, 195066, 195069, 656, 195071, 65037, 4577, 64624, 0, 0, 0,
+ 0, 4269, 73885, 917775, 42846, 69644, 950, 0, 92273, 66580, 118895,
66683, 10554, 917778, 119121, 0, 5098, 917770, 0, 119099, 5097, 4935,
- 9848, 10381, 0, 0, 0, 3651, 0, 0, 0, 5102, 5101, 10269, 12983, 8138, 0,
- 1932, 5100, 1439, 12093, 1247, 10034, 195064, 5099, 0, 1441, 42087, 3063,
- 650, 0, 7838, 0, 195041, 195040, 119142, 9031, 195045, 195044, 9078,
- 8545, 66356, 195048, 0, 9154, 9118, 0, 0, 2676, 7750, 0, 73812, 6190,
- 8599, 195053, 0, 10795, 9857, 7014, 9858, 195033, 0, 12129, 0, 8481, 0,
- 6202, 195035, 10920, 195037, 5203, 195039, 195038, 5108, 5107, 65818,
- 66019, 9762, 0, 5541, 74772, 0, 12613, 5284, 6657, 207, 0, 4275, 74819,
- 854, 68147, 74381, 0, 0, 5103, 0, 64348, 41368, 0, 488, 0, 0, 0, 10157,
- 0, 43034, 11438, 0, 0, 0, 118839, 41771, 5106, 6669, 8504, 65154, 195025,
- 41367, 5105, 195030, 195029, 6476, 5104, 0, 304, 3176, 0, 0, 932, 0,
- 6567, 238, 74522, 195011, 195010, 19905, 120577, 195015, 120187, 41044,
- 67640, 0, 64814, 9912, 65939, 10670, 74093, 13273, 0, 12552, 195019,
- 8803, 309, 6622, 8151, 10858, 194596, 67636, 0, 12568, 0, 12553, 0,
- 43275, 6950, 9712, 0, 0, 0, 65165, 0, 0, 66466, 0, 0, 0, 66725, 6191,
- 11351, 10437, 11316, 67634, 0, 0, 41754, 67635, 9370, 2720, 194975, 0,
- 8232, 118817, 0, 3222, 0, 0, 0, 66663, 0, 0, 10834, 0, 0, 65732, 0, 0,
- 119579, 0, 195020, 0, 7781, 41383, 64568, 0, 120738, 12077, 0, 0, 0,
- 42396, 0, 3475, 0, 2479, 0, 3632, 0, 10698, 0, 3648, 194960, 74844,
- 67639, 3636, 67894, 3650, 8837, 65229, 1843, 42283, 0, 41562, 0, 74548,
- 0, 3640, 0, 42321, 7284, 194974, 194973, 194950, 194949, 194952, 194951,
- 0, 194953, 42080, 2529, 0, 0, 0, 42083, 194955, 194606, 194957, 67619,
- 66367, 194958, 9634, 0, 9988, 0, 41068, 0, 0, 65264, 0, 0, 917923, 0,
- 785, 8236, 194942, 9027, 68160, 67623, 64383, 0, 925, 0, 0, 41985, 41071,
- 9586, 0, 41984, 9217, 0, 0, 0, 9186, 64580, 4016, 0, 0, 381, 0, 0, 42077,
- 0, 194946, 5184, 42078, 194947, 10810, 0, 4585, 19943, 5860, 67633, 0, 0,
- 812, 3615, 0, 5178, 194929, 120548, 120506, 5188, 74287, 67629, 3605,
- 10692, 1166, 64429, 42639, 924, 0, 67631, 0, 0, 2442, 10703, 194940,
- 67632, 0, 12771, 12736, 12753, 0, 73933, 67626, 42401, 0, 0, 0, 42288,
- 12751, 0, 8542, 13145, 0, 2468, 66706, 41294, 3626, 3883, 64388, 42479,
- 0, 41117, 0, 0, 0, 0, 67624, 0, 1290, 0, 65585, 2715, 806, 0, 41884, 0,
- 7027, 64731, 0, 0, 0, 66325, 3465, 2405, 9240, 0, 12756, 65259, 0, 0,
- 12752, 5833, 1432, 0, 41883, 73912, 9799, 0, 41886, 2480, 0, 43219, 0,
- 6494, 5537, 0, 0, 0, 0, 1211, 0, 0, 0, 118832, 12318, 0, 0, 0, 10622, 0,
- 0, 0, 6566, 0, 0, 73780, 0, 64864, 0, 194588, 0, 8284, 0, 0, 3589, 0,
- 4035, 6492, 0, 4265, 6642, 3977, 74186, 41778, 836, 119216, 2488, 0,
- 4582, 0, 0, 41777, 12926, 0, 7528, 10550, 0, 0, 0, 0, 0, 1374, 64878,
- 119014, 0, 42389, 41374, 0, 0, 0, 41377, 0, 0, 400, 12597, 0, 0, 0, 6661,
- 0, 64827, 0, 73817, 390, 0, 74755, 0, 3473, 7718, 0, 0, 0, 0, 0, 0, 0,
- 11969, 0, 0, 8004, 1887, 0, 0, 8080, 7006, 0, 0, 0, 0, 1544, 0, 0, 64677,
- 120716, 0, 6146, 0, 771, 0, 0, 12812, 13168, 42272, 12200, 917927, 7904,
- 0, 953, 12917, 0, 12300, 0, 11491, 9724, 10341, 0, 9524, 7490, 11389,
- 7489, 3379, 0, 7487, 0, 471, 7484, 7482, 7481, 7480, 7479, 7478, 7477,
- 6501, 7475, 6918, 7473, 7472, 2474, 7470, 7468, 10232, 10615, 10213, 0,
- 120222, 10049, 0, 3544, 0, 6017, 65311, 0, 0, 13306, 10533, 7870, 73949,
- 7625, 0, 120544, 0, 0, 0, 0, 0, 0, 19961, 2472, 0, 120699, 0, 6019, 4256,
- 120776, 74380, 0, 73847, 73844, 12845, 0, 0, 65138, 119355, 67862, 0, 0,
- 120000, 120008, 8066, 7678, 74865, 0, 0, 0, 0, 7186, 0, 120555, 0, 445,
- 120566, 0, 0, 0, 8330, 0, 0, 42797, 0, 120215, 0, 3902, 0, 1770, 0, 0,
- 1560, 120209, 0, 4584, 73843, 0, 11712, 10866, 0, 1118, 0, 0, 0, 1081,
- 7436, 0, 7252, 0, 5996, 0, 4903, 0, 41386, 5162, 119189, 1330, 0, 64530,
- 0, 12047, 41384, 0, 0, 1848, 4334, 0, 41975, 64777, 10674, 12308, 0, 0,
- 0, 0, 12715, 0, 0, 0, 2018, 66672, 41979, 66685, 119157, 0, 0, 0, 126984,
- 0, 9334, 0, 0, 0, 7975, 0, 0, 0, 66621, 4884, 66597, 0, 0, 0, 6313,
- 65513, 0, 0, 0, 0, 2345, 0, 463, 0, 0, 119607, 3117, 5460, 0, 0, 0, 0,
- 42279, 194577, 0, 0, 0, 0, 0, 13248, 0, 0, 0, 0, 0, 0, 5663, 0, 0, 0, 0,
- 2482, 1471, 0, 0, 42247, 12378, 73925, 0, 0, 12374, 0, 0, 0, 0, 2460, 0,
- 11944, 12376, 0, 64679, 0, 12380, 10557, 64473, 5870, 0, 2024, 0, 0, 0,
- 539, 0, 0, 0, 3853, 65180, 0, 120796, 120245, 0, 0, 8659, 0, 12474, 0,
- 9503, 194969, 2478, 0, 4162, 0, 4260, 12953, 0, 120089, 12470, 0, 74189,
- 2742, 12476, 11798, 10946, 0, 5000, 0, 0, 0, 0, 8213, 74017, 7771, 6161,
- 0, 0, 0, 0, 0, 0, 120582, 0, 0, 10301, 10333, 10397, 0, 0, 73791, 0, 0,
- 0, 0, 0, 4014, 12842, 73952, 12015, 0, 8275, 3893, 0, 0, 0, 7221, 42147,
- 0, 74550, 74465, 64747, 118841, 0, 12516, 0, 0, 119017, 74537, 10892,
- 8231, 0, 6473, 41968, 0, 41973, 3591, 41969, 0, 2453, 0, 0, 0, 0, 0,
- 10349, 10413, 43591, 41962, 3202, 74353, 0, 8316, 0, 0, 0, 687, 0, 0, 0,
- 1840, 0, 0, 119809, 4883, 285, 4723, 0, 0, 4459, 74577, 0, 41720, 11089,
- 240, 19906, 0, 119248, 0, 9743, 120232, 13134, 0, 0, 0, 0, 0, 42634, 0,
- 0, 3081, 11463, 120230, 0, 0, 10445, 0, 0, 66717, 2614, 9125, 119023,
- 1729, 0, 120236, 65221, 63883, 43334, 64852, 0, 120235, 66201, 0, 66578,
- 5001, 41879, 0, 4121, 5003, 884, 66700, 63879, 4943, 5150, 73889, 74182,
- 0, 643, 3086, 0, 42448, 42299, 58, 0, 0, 120083, 63873, 8491, 0, 0, 0,
- 4530, 42409, 0, 0, 2721, 120074, 119096, 19929, 0, 194574, 0, 4242, 4264,
- 0, 0, 66179, 42412, 65941, 13114, 64522, 10740, 3094, 0, 9754, 119102,
- 4437, 73948, 0, 0, 65179, 42174, 194925, 42430, 0, 0, 42355, 66026, 4306,
- 41380, 0, 0, 0, 66667, 0, 0, 0, 120578, 42566, 0, 0, 5088, 6948, 0, 8524,
- 0, 0, 12385, 0, 0, 0, 1386, 65034, 11480, 6116, 65039, 65038, 12392,
- 65036, 8064, 0, 12101, 5822, 119004, 0, 710, 0, 11663, 1666, 42091,
- 119657, 12383, 0, 42092, 0, 4289, 0, 63896, 12061, 42096, 0, 3362, 12377,
- 0, 0, 0, 7461, 73901, 1244, 331, 73786, 12683, 10662, 0, 8112, 0, 65852,
- 0, 12379, 0, 120818, 41964, 0, 63843, 12381, 41965, 0, 65866, 4327, 0,
- 63840, 0, 41220, 13032, 0, 584, 12933, 43177, 12373, 0, 13000, 1351, 0,
- 8698, 12665, 0, 1930, 0, 0, 12427, 0, 0, 13031, 0, 0, 0, 3657, 0, 65202,
- 6000, 0, 12426, 0, 0, 41740, 12428, 41283, 41916, 119210, 0, 0, 12429,
- 9695, 0, 7562, 0, 5170, 0, 41755, 676, 0, 0, 66664, 74427, 0, 3536, 0,
- 9752, 0, 6162, 0, 0, 10113, 41829, 65886, 5159, 12422, 41832, 439, 43077,
- 0, 120532, 74549, 11796, 40970, 41830, 0, 917799, 8308, 917797, 917796,
- 0, 67864, 917801, 917800, 12336, 4135, 0, 341, 2727, 4129, 3539, 0,
- 63861, 0, 7913, 0, 63859, 4131, 63868, 0, 63867, 4133, 11371, 210, 4600,
- 0, 74560, 4137, 8082, 0, 119062, 0, 0, 4591, 0, 0, 0, 9680, 0, 120623,
- 561, 12159, 195, 0, 41501, 0, 42031, 5719, 7172, 0, 8368, 0, 41499, 0, 0,
- 42242, 41498, 917794, 42025, 0, 65805, 42463, 0, 2924, 0, 120510, 0, 0,
- 119213, 73941, 0, 42330, 917784, 3969, 0, 0, 7169, 1992, 9652, 73977,
- 7246, 42086, 917790, 917789, 0, 0, 0, 0, 0, 327, 0, 9042, 917777, 917776,
- 65148, 12433, 917781, 917780, 917779, 12431, 8668, 12434, 0, 917782,
- 5999, 0, 7712, 12432, 0, 0, 1726, 1015, 0, 8212, 0, 0, 42423, 119066, 0,
- 0, 66709, 0, 8811, 927, 0, 0, 12436, 0, 42021, 0, 0, 1299, 12240, 42350,
- 65143, 0, 195016, 0, 0, 11348, 0, 0, 0, 0, 0, 19914, 12179, 0, 9648, 0,
- 63836, 63832, 917773, 10967, 63816, 2594, 3444, 63817, 64651, 0, 41503,
- 0, 11265, 0, 0, 0, 0, 5664, 3972, 0, 0, 0, 917766, 12416, 917764, 119608,
- 10816, 917769, 917768, 12418, 74111, 3882, 8532, 917771, 1573, 0, 119847,
- 4596, 66339, 12417, 66001, 65343, 194782, 12414, 8287, 0, 0, 68108, 1143,
- 119169, 0, 12415, 6626, 42763, 0, 118884, 9021, 120783, 0, 11724, 0, 0,
- 127104, 194794, 0, 0, 8027, 10997, 9171, 12741, 11400, 74197, 194799, 0,
- 0, 0, 0, 0, 0, 120190, 194773, 0, 194772, 42368, 0, 7715, 3881, 41487,
- 12118, 42514, 0, 0, 0, 3009, 41476, 41489, 0, 3007, 1448, 3018, 0, 3889,
- 8521, 5083, 5082, 119859, 120184, 8519, 0, 3014, 5081, 65853, 0, 0,
- 120183, 0, 5079, 64802, 65095, 4597, 65532, 0, 0, 12371, 0, 8407, 0,
- 10805, 8518, 10779, 120188, 0, 0, 12367, 42170, 0, 0, 629, 1924, 0,
- 12037, 74366, 5987, 8462, 8005, 12365, 66689, 0, 120815, 12369, 10649, 0,
- 5077, 127108, 10880, 63927, 5075, 0, 0, 65075, 0, 11007, 0, 66659, 0, 0,
- 66684, 0, 3434, 4954, 1904, 0, 5266, 126980, 5272, 10499, 4507, 9578,
- 63923, 120177, 7979, 0, 9831, 0, 194926, 461, 9803, 0, 4504, 1505, 0, 0,
- 5276, 43021, 0, 0, 0, 0, 66461, 5177, 41324, 12055, 8722, 0, 41327, 0,
- 66695, 4114, 409, 4383, 8900, 8948, 41325, 0, 721, 10182, 9108, 0, 0,
- 119185, 0, 0, 0, 5998, 0, 42353, 74825, 0, 12587, 0, 0, 0, 0, 0, 41576,
- 74121, 0, 119207, 0, 8578, 5995, 7573, 41575, 74789, 74752, 63944, 63949,
- 0, 2670, 4167, 0, 11723, 0, 74120, 0, 65076, 938, 73857, 73854, 11737,
- 9721, 0, 0, 0, 11742, 0, 0, 11493, 12334, 0, 4153, 12302, 10793, 5250,
- 12407, 11978, 4404, 9189, 12401, 42007, 5775, 42005, 65806, 0, 0, 42002,
- 12404, 0, 0, 4940, 12410, 7683, 1167, 0, 4983, 0, 861, 0, 0, 0, 0, 65577,
- 0, 0, 0, 11956, 0, 0, 0, 9616, 6631, 0, 12816, 74583, 0, 12710, 0, 12721,
- 4101, 66185, 0, 5992, 7616, 0, 0, 12577, 0, 0, 853, 0, 0, 0, 0, 5016,
- 43535, 0, 42835, 9491, 917913, 0, 917914, 0, 12712, 917919, 0, 65060,
- 120797, 9900, 0, 0, 194919, 0, 0, 0, 64778, 12585, 10565, 0, 12177, 0, 0,
- 0, 0, 0, 4900, 0, 0, 0, 8984, 4119, 0, 8971, 0, 43113, 9702, 0, 11025,
- 9245, 13048, 4927, 4138, 0, 194921, 0, 12397, 0, 0, 13054, 12394, 0, 0,
- 0, 13053, 0, 3948, 10781, 1546, 0, 5010, 1680, 10507, 0, 0, 0, 0, 0, 0,
- 7267, 0, 74833, 0, 5993, 2819, 0, 12706, 0, 1893, 7266, 63915, 7264,
- 7265, 0, 1363, 0, 63997, 63910, 63996, 3077, 0, 0, 1512, 0, 12589, 41479,
- 0, 0, 43339, 0, 9836, 120727, 0, 41481, 43335, 7832, 42343, 3090, 43337,
- 817, 1664, 1850, 0, 3079, 11340, 42408, 42447, 0, 120020, 42307, 12386,
- 42304, 0, 0, 12389, 0, 0, 41996, 11526, 63985, 5864, 1147, 66688, 42887,
- 1987, 0, 5480, 7858, 11653, 4116, 12391, 66193, 0, 4939, 12384, 0, 0,
- 41686, 63905, 119601, 0, 0, 0, 0, 0, 0, 8247, 507, 91, 2042, 120775, 0,
- 0, 66028, 10036, 41844, 119830, 774, 119831, 0, 119815, 5994, 12539, 0,
- 119817, 120597, 119833, 0, 0, 0, 0, 7719, 6026, 2486, 0, 0, 162, 0,
- 65219, 41073, 9687, 41681, 6304, 119812, 66196, 0, 5262, 0, 66658, 12681,
- 42379, 0, 7534, 12219, 0, 0, 42810, 10492, 0, 0, 0, 43119, 0, 120753,
- 12403, 2500, 195013, 0, 4899, 0, 0, 0, 74113, 2343, 4103, 19946, 74112,
- 0, 13112, 0, 0, 12859, 0, 0, 66369, 5861, 0, 11999, 12400, 0, 0, 12645,
- 5146, 11320, 0, 67612, 65040, 0, 64184, 12974, 64183, 67613, 120645,
- 5147, 0, 0, 74524, 0, 1928, 0, 0, 5991, 3445, 67609, 4976, 64176, 0,
- 67610, 8241, 0, 0, 4206, 0, 0, 0, 0, 0, 10138, 0, 0, 8897, 0, 0, 8357,
- 4124, 0, 65836, 120641, 0, 0, 0, 0, 1123, 963, 41553, 10120, 12405, 0, 0,
- 398, 13278, 9723, 41551, 120311, 7945, 0, 4402, 10896, 12402, 0, 42392,
- 1305, 12408, 0, 0, 0, 0, 41464, 12411, 12969, 120824, 41465, 0, 195017,
- 1575, 0, 63955, 165, 3024, 41467, 119163, 0, 9093, 0, 9147, 0, 0, 0,
- 9148, 9692, 4096, 53, 73776, 12368, 195018, 0, 9594, 0, 0, 43527, 0, 727,
- 0, 0, 5805, 0, 0, 0, 42176, 12370, 11655, 119095, 10591, 12364, 0, 12372,
- 120642, 0, 0, 0, 0, 12366, 10963, 6066, 1329, 0, 3052, 9220, 0, 64478, 0,
- 10803, 4132, 0, 0, 0, 0, 0, 74837, 0, 1499, 0, 8055, 0, 63965, 0, 63962,
- 74042, 8924, 43123, 5988, 3660, 63969, 11781, 63968, 8788, 1357, 64851,
- 65743, 0, 8774, 0, 127086, 67618, 120172, 0, 1933, 0, 9564, 0, 0, 73866,
- 0, 0, 2487, 67614, 3121, 1804, 3311, 67615, 0, 0, 12220, 67616, 120598,
- 0, 0, 0, 6675, 0, 0, 67592, 120685, 0, 64771, 1198, 9132, 0, 64619, 510,
- 64663, 0, 0, 4561, 7711, 1398, 0, 0, 74034, 41569, 0, 11406, 8167, 12127,
- 0, 840, 0, 0, 0, 6967, 0, 0, 9796, 0, 333, 0, 0, 8144, 0, 0, 0, 12406, 0,
- 0, 0, 6678, 7769, 0, 12621, 0, 0, 10227, 4764, 43101, 0, 0, 40986, 4127,
- 66487, 0, 0, 12754, 195022, 0, 0, 0, 67594, 65609, 12944, 4050, 67595, 0,
- 43102, 10581, 12985, 4533, 0, 0, 6490, 0, 12038, 0, 0, 120704, 65461,
- 9798, 0, 0, 1948, 119007, 0, 952, 0, 0, 0, 120802, 6449, 9494, 0, 0,
- 43098, 4843, 8142, 64160, 4098, 64170, 0, 0, 3436, 0, 0, 12817, 67597,
- 6676, 3930, 66708, 0, 0, 67598, 0, 0, 0, 65591, 41581, 65916, 1453, 0, 0,
- 0, 8500, 0, 120142, 73743, 120400, 4317, 120140, 0, 64676, 0, 0, 67606,
- 119083, 0, 0, 13102, 0, 66003, 6672, 0, 0, 0, 0, 63841, 9613, 9001, 4526,
- 11274, 67601, 64520, 64210, 6664, 0, 42056, 10228, 64957, 11281, 0,
- 64213, 1469, 66640, 65381, 0, 4988, 42372, 0, 9598, 904, 352, 0, 1451,
- 8061, 8453, 4134, 0, 74847, 67600, 0, 0, 10520, 8575, 0, 1201, 0, 12846,
- 0, 0, 11919, 64962, 0, 74864, 0, 8511, 9460, 823, 11587, 12305, 0, 64695,
- 0, 12387, 1253, 13183, 65766, 500, 42783, 65765, 64208, 64369, 65760,
- 65761, 119585, 11606, 64784, 11702, 66498, 9821, 0, 0, 5152, 11048, 7533,
- 120121, 64410, 0, 0, 4323, 120062, 0, 0, 0, 42587, 65339, 41394, 0, 4763,
- 4112, 118935, 0, 5260, 43143, 0, 326, 120131, 0, 0, 10771, 2876, 194915,
- 194835, 194924, 41398, 127079, 9802, 127077, 127076, 453, 41396, 120524,
- 0, 12140, 9572, 0, 7003, 194883, 42334, 7704, 0, 0, 43144, 4123, 0,
- 43146, 0, 0, 0, 65759, 10765, 64061, 4465, 9808, 64056, 65582, 4126, 0,
- 9521, 9589, 64755, 0, 64020, 0, 10464, 0, 0, 194869, 64514, 11528, 64024,
- 0, 679, 64013, 0, 5850, 758, 7536, 0, 0, 41441, 10693, 64006, 0, 64005,
- 10541, 119019, 0, 64660, 0, 119050, 0, 0, 1139, 43298, 64027, 64029,
- 8970, 0, 64000, 0, 10774, 0, 42522, 12421, 194876, 0, 1852, 3057, 0,
- 73744, 64034, 64041, 0, 0, 0, 0, 0, 7645, 12854, 74338, 3496, 0, 0, 0,
- 9102, 627, 0, 6158, 8327, 74553, 66632, 12419, 0, 11570, 0, 19960, 11696,
- 0, 1018, 0, 194909, 0, 1682, 194896, 0, 42756, 12951, 194906, 0, 0,
- 73814, 11412, 12563, 10728, 194830, 0, 118863, 43311, 64966, 11577, 0,
- 43040, 1833, 11576, 0, 74779, 0, 185, 65085, 74533, 64754, 194848, 7535,
- 8085, 42525, 120387, 9749, 41701, 6131, 1949, 4117, 7847, 120489, 0,
- 64483, 65693, 0, 0, 0, 0, 42240, 0, 0, 42864, 0, 64667, 41868, 1184, 0,
- 815, 11484, 0, 67840, 0, 0, 0, 0, 0, 64683, 0, 0, 0, 0, 0, 9879, 0, 0,
- 4158, 0, 68166, 0, 0, 0, 0, 0, 332, 118808, 0, 5142, 2407, 0, 0, 0, 0,
- 74373, 0, 0, 0, 63870, 43163, 0, 0, 119081, 42867, 1834, 0, 0, 0, 10940,
- 65249, 119040, 8662, 0, 0, 2652, 120527, 11539, 10784, 195093, 0, 0, 0,
- 0, 0, 118858, 917505, 1828, 74474, 120327, 0, 8531, 12499, 6280, 12324,
- 118854, 65238, 0, 4832, 65573, 0, 6279, 12508, 12904, 12502, 9161, 0,
- 1620, 0, 3601, 0, 0, 0, 609, 11555, 0, 12496, 0, 74181, 4343, 12505, 0,
- 0, 0, 11377, 239, 0, 637, 0, 0, 43029, 0, 0, 0, 43565, 127082, 0, 12696,
- 0, 0, 0, 12929, 0, 712, 0, 4197, 0, 42818, 0, 0, 120490, 0, 0, 1506,
- 43562, 0, 0, 0, 12651, 0, 64628, 74517, 12058, 74084, 917838, 7494, 0,
- 4924, 65592, 118844, 0, 127088, 355, 9719, 127087, 13066, 64796, 0, 0,
- 12033, 42178, 0, 0, 42571, 0, 0, 0, 0, 0, 0, 0, 3178, 0, 0, 0, 0, 9080,
- 127000, 0, 0, 0, 0, 11082, 0, 5699, 195100, 0, 9488, 65166, 119112, 0, 0,
- 0, 0, 0, 0, 5265, 0, 0, 11487, 67858, 12464, 0, 43045, 0, 0, 43345, 0,
- 10770, 118994, 43344, 465, 9829, 0, 74348, 0, 43346, 8116, 795, 0, 0,
- 12462, 10930, 10831, 0, 118952, 64362, 0, 0, 120811, 0, 12468, 8607,
- 1008, 0, 10092, 0, 917842, 67855, 0, 73771, 1766, 11282, 11996, 1820,
- 4547, 0, 0, 0, 0, 13223, 0, 64595, 0, 0, 0, 4345, 12616, 0, 0, 0, 74467,
- 0, 0, 0, 5382, 0, 0, 0, 119060, 64953, 5406, 19920, 0, 66510, 3590, 0,
- 1130, 0, 0, 42016, 11823, 43023, 0, 118896, 7742, 0, 13280, 0, 9326,
- 73826, 5310, 74812, 0, 119962, 8959, 43589, 74334, 66723, 0, 8568, 0,
- 120496, 73816, 120803, 0, 0, 0, 11621, 12460, 0, 0, 0, 0, 74519, 0, 0, 0,
- 0, 0, 11689, 5410, 5783, 10468, 8403, 5400, 11594, 0, 0, 118990, 10491,
- 0, 64412, 0, 0, 5587, 42865, 64404, 8268, 4923, 65086, 8981, 12382,
- 42133, 120755, 9706, 0, 0, 66610, 10461, 12103, 0, 8642, 0, 42766, 0, 0,
- 0, 0, 119105, 0, 0, 0, 8816, 41515, 0, 11802, 8041, 1461, 910, 119133, 0,
- 0, 3658, 0, 120525, 0, 7617, 0, 12888, 0, 0, 13143, 0, 41514, 0, 5703, 0,
- 41517, 41504, 41519, 10016, 64305, 0, 65864, 623, 781, 670, 10660, 5769,
- 613, 7543, 120774, 477, 41083, 0, 0, 592, 1578, 12459, 0, 0, 0, 8225, 0,
- 654, 11345, 653, 652, 0, 647, 0, 633, 120744, 0, 0, 12480, 74354, 0, 39,
- 12487, 0, 120529, 74199, 12482, 0, 12489, 0, 3195, 5550, 0, 7897, 0,
- 1203, 74396, 1813, 64544, 41311, 12090, 0, 2877, 0, 0, 1675, 0, 0, 0, 0,
- 10070, 10595, 0, 119077, 0, 0, 0, 0, 0, 118827, 0, 0, 0, 119561, 0, 0, 0,
- 0, 0, 0, 0, 120692, 0, 0, 270, 0, 10714, 0, 0, 0, 0, 0, 65372, 0, 74038,
- 119558, 6273, 66679, 364, 9595, 0, 0, 0, 707, 0, 0, 9282, 66489, 224, 0,
- 0, 9332, 4966, 0, 0, 0, 0, 3841, 0, 0, 10732, 0, 850, 4972, 0, 64699,
- 2909, 0, 65309, 0, 0, 11544, 10203, 9608, 0, 0, 11962, 0, 12507, 1196, 0,
- 0, 777, 0, 4375, 65271, 0, 0, 12198, 0, 64824, 0, 0, 9454, 63778, 8658,
- 42528, 0, 2705, 917975, 41520, 0, 0, 11986, 7765, 42502, 8280, 0, 2701,
- 0, 0, 5767, 0, 0, 9809, 8353, 63747, 66701, 63772, 0, 63745, 1748, 63770,
- 0, 0, 0, 65542, 63766, 0, 3061, 0, 63764, 63789, 9067, 6096, 0, 7694, 0,
- 7257, 63768, 3485, 12987, 0, 0, 0, 63807, 1591, 0, 0, 63783, 0, 0, 0, 0,
- 0, 0, 74575, 0, 65719, 13083, 64574, 65012, 0, 1640, 12495, 66691, 7624,
- 3138, 10996, 0, 1922, 0, 12498, 10987, 0, 0, 3894, 65543, 0, 194842, 0,
- 493, 0, 43197, 1717, 4228, 479, 10303, 917934, 0, 917935, 10335, 3520,
- 917932, 12490, 64315, 0, 127039, 12493, 6233, 64636, 1002, 12491, 0,
- 64911, 127040, 0, 65120, 0, 0, 0, 11611, 66228, 127041, 66213, 63864,
- 66221, 66226, 66229, 13218, 66231, 66216, 8507, 66236, 66211, 66218, 0,
- 66240, 0, 66233, 8928, 0, 7909, 66234, 11605, 63759, 0, 66208, 73999,
- 63799, 0, 244, 11542, 12898, 12494, 73761, 12492, 12669, 0, 0, 74153, 0,
- 0, 120680, 4882, 13040, 0, 8612, 4885, 74053, 0, 13042, 4880, 64662,
- 2429, 1360, 248, 0, 63797, 0, 63792, 0, 7292, 0, 63756, 42786, 66693, 0,
- 1870, 917916, 470, 0, 0, 120306, 0, 0, 4579, 0, 0, 12511, 74453, 12514,
- 0, 74579, 7239, 7001, 8623, 0, 0, 0, 0, 12512, 11615, 13041, 0, 0, 659,
- 6098, 0, 12234, 0, 127067, 8311, 12510, 41803, 13039, 127072, 12513,
- 10202, 12471, 0, 8747, 0, 0, 0, 2323, 0, 2319, 0, 12477, 0, 2311, 0,
- 4415, 237, 6281, 0, 0, 0, 2309, 1312, 8173, 0, 12469, 0, 0, 64335, 10609,
- 0, 0, 9397, 11524, 9395, 9396, 9393, 9394, 9391, 9392, 9389, 6209, 9387,
- 9388, 4932, 9386, 9383, 9384, 0, 0, 65451, 8185, 0, 917832, 43024, 43336,
- 74375, 2313, 0, 7948, 9236, 0, 0, 0, 10570, 0, 6289, 10484, 0, 0, 11998,
- 12082, 10924, 3147, 0, 0, 12524, 0, 2310, 11818, 9381, 9382, 9379, 9380,
- 9377, 9378, 9375, 9376, 1683, 9374, 0, 9372, 12444, 0, 0, 13016, 8210, 0,
- 42029, 11079, 12331, 0, 42032, 8744, 726, 0, 0, 4155, 0, 0, 42030, 5007,
- 12522, 43088, 0, 4951, 0, 0, 0, 9922, 43309, 0, 12525, 0, 12016, 65770,
- 9548, 0, 403, 0, 12503, 0, 0, 11030, 0, 0, 65691, 63998, 1819, 10496, 0,
- 0, 119920, 0, 0, 0, 12506, 0, 12231, 0, 12500, 67605, 12509, 64393, 0,
- 3389, 10589, 6608, 41047, 120321, 0, 0, 74069, 0, 0, 3608, 8281, 917839,
- 1107, 0, 9076, 8862, 0, 41052, 13084, 64766, 43217, 7803, 13222, 118963,
- 74782, 0, 8546, 11553, 63995, 13177, 9043, 6303, 0, 498, 64471, 120324,
- 0, 12529, 8042, 0, 2344, 12528, 8031, 2414, 0, 0, 3231, 0, 6422, 66512,
- 0, 12530, 2537, 0, 41429, 12658, 13036, 65772, 0, 0, 41433, 4719, 469, 0,
- 4363, 3313, 41428, 0, 2023, 1772, 0, 0, 65706, 10051, 64812, 0, 0, 9920,
- 12215, 0, 4931, 1951, 12497, 119363, 9607, 0, 9663, 0, 119634, 6503,
- 41110, 0, 1491, 0, 0, 0, 41061, 0, 0, 0, 65026, 41993, 41509, 11045,
- 65028, 0, 66476, 41108, 9738, 41995, 1075, 1958, 12535, 41992, 41506, 0,
- 41687, 0, 120717, 0, 917816, 0, 7692, 0, 8008, 0, 330, 8566, 65083,
- 41133, 9816, 0, 12532, 127055, 127056, 3508, 127058, 127059, 0, 917542,
- 917815, 0, 6411, 12910, 120505, 66644, 13028, 0, 12537, 0, 0, 64136,
- 12536, 2350, 13029, 0, 0, 0, 13030, 0, 4527, 0, 12538, 0, 0, 65599,
- 65717, 12607, 0, 4948, 12484, 4032, 0, 42803, 0, 6207, 0, 6117, 66000,
- 8412, 0, 7438, 1296, 2325, 41511, 0, 10149, 74118, 0, 0, 12481, 0, 12488,
- 0, 0, 41556, 64414, 118802, 2354, 0, 73766, 0, 6295, 901, 41510, 7953, 0,
- 65032, 41513, 0, 11927, 66584, 0, 0, 119010, 0, 0, 0, 848, 9868, 0, 6424,
- 0, 119338, 0, 74031, 0, 0, 2352, 0, 893, 64576, 11289, 1407, 0, 0, 13026,
- 0, 0, 0, 13023, 8903, 9777, 66715, 1871, 8099, 0, 0, 1343, 0, 0, 9325,
- 13025, 6283, 11738, 0, 0, 0, 11741, 0, 0, 9216, 8263, 11279, 194752, 0,
- 194754, 13021, 64494, 3136, 194758, 194757, 194760, 13022, 0, 64588, 0,
- 0, 74552, 10014, 0, 41260, 119340, 13020, 118993, 194764, 194767, 74340,
- 0, 0, 64945, 8029, 0, 0, 0, 3335, 0, 0, 9776, 120526, 194748, 5215,
- 42644, 3333, 1632, 194751, 64849, 3342, 0, 5363, 12957, 0, 4156, 0, 0,
- 6421, 0, 1611, 0, 13018, 74257, 0, 0, 3337, 4537, 67895, 11736, 0, 0,
- 6482, 4214, 73790, 11945, 0, 13046, 8838, 425, 4025, 10709, 0, 73927,
- 2392, 13047, 0, 0, 10617, 13049, 6499, 194739, 12424, 194741, 73944,
- 13050, 194742, 194745, 6507, 0, 0, 0, 3277, 8929, 4947, 41055, 0, 194722,
- 194721, 194724, 13045, 64626, 66034, 7751, 194727, 8371, 194729, 3997,
- 12806, 8768, 13044, 0, 12420, 4024, 194730, 41054, 1078, 9757, 194734,
- 41057, 0, 0, 0, 0, 0, 0, 0, 0, 41496, 0, 9165, 1572, 11911, 0, 118842,
- 2346, 13270, 8958, 0, 9646, 3773, 43183, 6401, 42536, 0, 0, 13043, 8056,
- 0, 65681, 208, 0, 0, 0, 0, 0, 10699, 6408, 0, 7825, 5661, 0, 120630,
- 3603, 41109, 2398, 3548, 0, 0, 0, 0, 3115, 0, 0, 11321, 0, 0, 0, 194726,
- 4876, 74286, 0, 0, 0, 0, 41558, 41471, 73950, 8158, 41561, 41472, 0,
- 13051, 194672, 3143, 194674, 194673, 41559, 1896, 66256, 13052, 194680,
- 5665, 0, 119071, 41986, 63974, 0, 74352, 74161, 4154, 9863, 43550, 12310,
- 5662, 42382, 194686, 73924, 1121, 194665, 63959, 0, 74378, 13231, 0,
- 64752, 4732, 194666, 11596, 194668, 65187, 1626, 63983, 10110, 194671,
- 42024, 6420, 42028, 0, 10509, 2795, 4910, 194728, 0, 64753, 6275, 0,
- 118830, 63978, 11044, 3229, 6423, 42774, 0, 0, 0, 12823, 2331, 917810,
- 42026, 6137, 0, 7524, 0, 0, 119343, 0, 8338, 0, 65043, 0, 822, 0, 9903,
- 64721, 194657, 194656, 194659, 194658, 194661, 194660, 0, 41265, 5311,
- 1795, 965, 118791, 10587, 0, 11278, 0, 194640, 0, 12946, 194641, 120705,
- 194643, 6294, 3144, 194648, 194647, 65019, 194649, 73990, 0, 0, 748,
- 41067, 2330, 535, 3148, 12375, 194652, 194629, 10556, 2475, 12388, 4889,
- 8968, 67863, 3593, 0, 0, 2342, 0, 194634, 65206, 4894, 194635, 4890,
- 194637, 0, 581, 4893, 0, 0, 65545, 4888, 4157, 917805, 0, 0, 0, 0, 10119,
- 6415, 0, 0, 0, 0, 0, 11375, 64746, 2332, 0, 412, 0, 64932, 42880, 43587,
- 0, 0, 0, 0, 65197, 0, 12203, 0, 0, 8913, 65854, 4875, 65811, 120381,
- 194624, 120397, 9344, 8826, 120386, 120395, 13104, 74781, 11997, 120393,
- 0, 0, 3134, 0, 65696, 0, 0, 66217, 0, 8334, 119344, 0, 3449, 0, 0, 0, 0,
- 118950, 74011, 0, 0, 0, 0, 1908, 0, 4328, 10734, 127014, 0, 0, 7804, 0,
- 10811, 6250, 11339, 4914, 11367, 0, 118971, 4917, 74516, 0, 64285, 4912,
- 5464, 0, 118893, 2361, 7971, 0, 0, 0, 118986, 0, 8086, 74317, 0, 8319,
- 2312, 40977, 10960, 40962, 8305, 12573, 0, 40980, 0, 13202, 0, 12582, 0,
- 0, 0, 42438, 0, 6288, 0, 0, 5653, 42400, 10891, 7698, 5658, 74045, 0, 0,
- 0, 4913, 0, 0, 0, 42326, 0, 0, 0, 42478, 2327, 0, 12959, 42287, 12705, 0,
- 0, 12588, 8821, 6153, 2867, 194708, 66312, 698, 194709, 194712, 10356,
- 74075, 194713, 651, 12641, 0, 0, 0, 0, 41552, 65115, 194691, 194690,
- 194693, 194692, 194695, 194694, 194697, 74356, 0, 4716, 43277, 0, 0,
- 12340, 120568, 0, 194700, 194699, 194702, 120676, 8703, 5462, 917629, 0,
- 10101, 0, 0, 8479, 4151, 41933, 0, 0, 66254, 120821, 0, 0, 0, 0, 119194,
- 74050, 0, 0, 0, 0, 0, 0, 12278, 0, 0, 0, 2700, 12576, 7842, 12899, 0, 0,
- 2699, 0, 0, 2985, 119222, 0, 0, 12192, 119314, 0, 119312, 9827, 119310,
- 119311, 119308, 119309, 119306, 11481, 41210, 119305, 0, 35, 0, 0, 66694,
- 74357, 0, 0, 43596, 6090, 64257, 7812, 10534, 0, 0, 73848, 0, 4272, 0,
- 40967, 40964, 917825, 12704, 0, 43306, 0, 64497, 12138, 7930, 0, 43303,
- 0, 0, 917826, 5244, 4189, 127098, 67596, 0, 4188, 1879, 0, 968, 0, 0, 0,
- 8873, 0, 0, 0, 65555, 12574, 0, 0, 0, 74490, 0, 0, 0, 0, 0, 0, 12578,
- 12720, 0, 41227, 0, 12346, 0, 64848, 0, 0, 7251, 0, 0, 118850, 119141, 0,
- 66015, 0, 959, 8885, 12564, 66457, 0, 9469, 9632, 0, 74761, 64323, 0, 0,
- 0, 0, 310, 0, 41564, 10976, 0, 0, 0, 0, 10054, 6497, 8574, 0, 9012,
- 19958, 74420, 65089, 13215, 65047, 65163, 74044, 374, 43195, 816, 0, 0,
- 0, 41934, 7465, 0, 0, 0, 4715, 6101, 0, 41936, 0, 4879, 0, 65446, 0, 307,
- 0, 9585, 5374, 0, 0, 0, 0, 0, 0, 0, 65567, 120614, 1929, 0, 12142, 0,
- 12236, 41419, 194618, 194621, 12982, 194623, 5378, 0, 0, 41421, 0, 4462,
- 0, 0, 0, 821, 0, 2498, 5800, 120157, 0, 1760, 0, 4469, 2324, 828, 3611,
- 0, 757, 1185, 0, 0, 43597, 10628, 74808, 194572, 7999, 0, 0, 0, 10634,
- 10942, 7713, 2348, 0, 64374, 4380, 194608, 119044, 194610, 64324, 41240,
- 862, 65626, 194613, 1810, 3673, 5137, 194617, 0, 7277, 65622, 0, 7566,
- 64688, 194593, 194592, 194595, 120812, 194597, 4748, 194599, 194598,
- 194601, 42260, 5871, 119075, 0, 74576, 0, 0, 194602, 3967, 194604, 13137,
- 8775, 194605, 0, 2963, 0, 8410, 4454, 723, 0, 966, 4449, 0, 127060, 0,
- 7819, 2320, 194589, 339, 4968, 194590, 120399, 8075, 0, 0, 8047, 0, 0,
- 12634, 41542, 0, 7466, 118822, 12174, 42610, 0, 74452, 0, 1584, 66645,
- 6045, 0, 120640, 65218, 0, 0, 0, 7537, 0, 11370, 0, 10330, 0, 10394, 0,
- 194783, 0, 0, 9780, 0, 13092, 194576, 119605, 194578, 7074, 120396,
- 194579, 194582, 11414, 194584, 2531, 13034, 0, 0, 0, 1259, 7517, 0, 0,
+ 9848, 10381, 0, 128870, 0, 3651, 0, 194610, 127556, 5102, 5101, 10269,
+ 12983, 8138, 4517, 1932, 5100, 1439, 12093, 1247, 10034, 195064, 5099,
+ 78373, 1441, 42087, 3063, 650, 0, 7838, 0, 195041, 195040, 119142, 9031,
+ 120790, 128582, 9078, 8545, 66356, 128799, 0, 9154, 9118, 0, 0, 2676,
+ 7750, 0, 73812, 6190, 8599, 195053, 0, 10795, 9857, 7014, 9856, 195033,
+ 92620, 12129, 0, 8481, 0, 6202, 195035, 10920, 128237, 5203, 195039,
+ 195038, 5108, 5107, 65818, 66019, 9762, 0, 5541, 74772, 0, 12613, 5284,
+ 6657, 207, 128806, 4275, 74819, 854, 68147, 74381, 0, 0, 5103, 127861,
+ 64348, 41368, 43974, 488, 69811, 0, 0, 10157, 0, 43034, 11438, 0, 0,
+ 92694, 68431, 41771, 5106, 6669, 8504, 65154, 69813, 41367, 5105, 195030,
+ 69720, 6476, 5104, 0, 304, 3176, 0, 0, 932, 128663, 6567, 238, 69656,
+ 195011, 194595, 19905, 120577, 195015, 78870, 41044, 67640, 194902,
+ 42055, 9912, 65939, 10670, 74093, 13273, 0, 12552, 195019, 8803, 309,
+ 6622, 8151, 10858, 194596, 67636, 0, 12568, 0, 12553, 10814, 43275, 6950,
+ 9712, 68680, 43970, 0, 65165, 92725, 0, 66466, 0, 0, 0, 66725, 6191,
+ 11351, 10437, 11316, 67634, 0, 0, 41754, 67635, 9370, 2720, 194975,
+ 68462, 8232, 118817, 0, 3222, 0, 0, 0, 66663, 0, 0, 10834, 0, 0, 65732,
+ 0, 917547, 92682, 67679, 195020, 0, 7781, 41383, 64568, 0, 120738, 12077,
+ 0, 64586, 917620, 42396, 55255, 3475, 128035, 2479, 0, 3632, 120728,
+ 10698, 8376, 3648, 194960, 74844, 67639, 3636, 67894, 3650, 8837, 65229,
+ 1843, 42283, 43250, 41562, 9100, 74548, 917630, 3640, 127190, 42321,
+ 7284, 194974, 194973, 194950, 194949, 194952, 194951, 0, 194953, 42080,
+ 2529, 0, 0, 0, 42083, 120678, 68398, 194957, 67619, 66367, 194958, 9634,
+ 92380, 9988, 0, 41068, 0, 0, 65264, 0, 0, 92545, 0, 785, 8236, 128647,
+ 9027, 68160, 67623, 64383, 128821, 925, 127156, 0, 41985, 41071, 9586, 0,
+ 41984, 9217, 0, 0, 0, 9186, 2067, 4016, 0, 0, 381, 0, 0, 42077, 0,
+ 127483, 5184, 42078, 194947, 10810, 128531, 4585, 19943, 5860, 67633, 0,
+ 0, 812, 3615, 0, 5178, 44000, 120548, 78807, 5188, 74287, 67629, 3605,
+ 10692, 1166, 64429, 42639, 924, 0, 67631, 0, 120670, 2442, 10703, 78789,
+ 67632, 917924, 12771, 12736, 12753, 0, 73933, 67626, 42401, 0, 0, 127373,
+ 42288, 12751, 0, 8542, 13145, 194963, 2468, 66706, 41294, 3626, 3883,
+ 64388, 42479, 0, 41117, 0, 92580, 0, 0, 67624, 0, 1290, 0, 65585, 2715,
+ 806, 65208, 41884, 917883, 1318, 64731, 0, 0, 0, 66325, 3465, 2405, 9240,
+ 0, 12756, 65259, 0, 0, 12752, 5833, 1432, 0, 41883, 73912, 9799, 0,
+ 41886, 2480, 0, 2062, 127293, 6494, 5537, 78656, 0, 194587, 0, 1211, 0,
+ 0, 0, 118832, 12318, 0, 0, 0, 10622, 0, 0, 78654, 6566, 78659, 0, 73780,
+ 0, 64864, 0, 78660, 0, 8284, 13081, 0, 3589, 42051, 4035, 6492, 92236,
+ 4265, 6642, 3977, 74186, 41778, 836, 119216, 2488, 0, 4582, 0, 0, 41777,
+ 12926, 0, 7528, 10550, 0, 92706, 0, 11439, 0, 1374, 64878, 119014, 0,
+ 42389, 41374, 0, 0, 78492, 41377, 127909, 0, 400, 12597, 120586, 0, 0,
+ 6661, 0, 64827, 0, 73817, 390, 0, 74755, 0, 3473, 7718, 0, 0, 0, 55285,
+ 0, 0, 0, 11969, 0, 127841, 6365, 1887, 6763, 0, 8080, 7006, 0, 0, 6757,
+ 64351, 1544, 0, 6766, 64677, 120716, 0, 6146, 0, 771, 0, 0, 12812, 13168,
+ 42272, 12200, 917927, 7904, 0, 953, 12917, 119560, 12300, 0, 11491, 9724,
+ 10341, 0, 9524, 7490, 11389, 7489, 3379, 0, 7487, 0, 471, 7484, 7482,
+ 6753, 7480, 7479, 7478, 7477, 6501, 7475, 6918, 7473, 7472, 2474, 7470,
+ 7468, 10232, 10615, 10213, 127288, 92357, 10049, 78884, 3544, 0, 6017,
+ 65311, 127481, 120216, 13306, 10533, 7870, 73949, 7625, 0, 120544, 0, 0,
+ 92660, 0, 0, 0, 19961, 2472, 42665, 92341, 0, 2139, 4256, 120776, 74380,
+ 0, 42675, 42658, 12845, 0, 0, 65138, 119355, 67862, 0, 65671, 120000,
+ 120008, 8066, 7678, 74865, 0, 0, 0, 0, 7186, 0, 120555, 0, 445, 120566,
+ 128308, 0, 0, 8330, 0, 0, 42797, 0, 120215, 0, 3902, 0, 1770, 0, 128866,
+ 1560, 120209, 194972, 4584, 73843, 0, 11712, 10866, 118928, 1118, 92209,
+ 0, 0, 1081, 7436, 68420, 7252, 0, 5996, 0, 4903, 0, 41386, 5162, 119189,
+ 1330, 0, 7139, 0, 12047, 41384, 0, 0, 1848, 4334, 6324, 41975, 64777,
+ 10674, 12308, 12186, 0, 0, 0, 12715, 128349, 0, 0, 2018, 66672, 41979,
+ 66685, 119157, 0, 92464, 0, 126984, 0, 9334, 92705, 92315, 0, 7975, 0,
+ 77957, 0, 66621, 4884, 66597, 69732, 0, 0, 6313, 65513, 0, 0, 0, 0, 2345,
+ 43697, 463, 0, 0, 119607, 3117, 5460, 0, 0, 0, 0, 42279, 194577, 0,
+ 78415, 0, 195008, 0, 13248, 0, 0, 0, 0, 0, 0, 5663, 0, 0, 0, 0, 2482,
+ 1471, 0, 0, 42247, 12378, 73925, 69664, 0, 12374, 0, 0, 0, 0, 2460, 0,
+ 11944, 12376, 127868, 64679, 0, 12380, 10557, 64473, 5870, 0, 2024,
+ 127180, 0, 0, 539, 0, 127765, 0, 3853, 65180, 127923, 120796, 120245,
+ 92324, 0, 8659, 0, 12474, 92579, 9503, 194969, 2478, 0, 4162, 0, 4260,
+ 12953, 69633, 120089, 12470, 0, 74189, 2742, 12476, 11798, 10946, 127310,
+ 5000, 0, 0, 0, 69672, 8213, 74017, 7771, 6161, 0, 6709, 0, 78885, 0,
+ 127971, 120582, 78547, 0, 10301, 10333, 10397, 0, 0, 73791, 0, 0, 0, 0,
+ 0, 4014, 12842, 73952, 12015, 127290, 8275, 3893, 0, 0, 12210, 7221,
+ 42147, 0, 74550, 74465, 64747, 118841, 0, 12516, 4444, 0, 92271, 74537,
+ 10892, 8231, 0, 6473, 41968, 78388, 41973, 3591, 41969, 0, 2453, 128549,
+ 92666, 64705, 0, 0, 10349, 10413, 43591, 41962, 3202, 74353, 0, 8316, 0,
+ 0, 0, 687, 0, 0, 0, 1840, 0, 68671, 119809, 4883, 285, 4723, 77927,
+ 92692, 4459, 74577, 42921, 41720, 11089, 240, 19906, 0, 42323, 0, 9743,
+ 120232, 13134, 0, 0, 0, 0, 0, 42634, 0, 43437, 3081, 11463, 120154, 0, 0,
+ 10445, 0, 0, 66717, 2614, 9125, 119023, 1729, 0, 120236, 65221, 63883,
+ 43334, 64852, 0, 120235, 66201, 0, 66578, 5001, 41879, 74427, 4121, 5003,
+ 884, 66700, 63879, 4943, 5150, 73889, 74182, 127915, 643, 3086, 0, 42448,
+ 42299, 58, 0, 917952, 120083, 63873, 8491, 0, 0, 0, 4530, 42409, 7126,
+ 194575, 2721, 120074, 119096, 19929, 0, 194574, 0, 4242, 4264, 120077,
+ 128132, 66179, 42412, 65941, 13114, 64522, 10740, 3094, 0, 9754, 119102,
+ 4437, 73948, 128692, 0, 55280, 42174, 194925, 42430, 0, 0, 42355, 66026,
+ 4306, 41380, 68432, 92586, 0, 66667, 127309, 0, 0, 42200, 42566, 0, 0,
+ 5088, 6948, 0, 8524, 0, 0, 12385, 0, 0, 69646, 1386, 64580, 11480, 6116,
+ 65039, 65038, 12392, 65036, 8064, 0, 12101, 5822, 119004, 2080, 710,
+ 77999, 11663, 1666, 42091, 119657, 12383, 43671, 42092, 68418, 4289, 0,
+ 63896, 12061, 42096, 43621, 3362, 12377, 0, 0, 68449, 7461, 73901, 1244,
+ 331, 73786, 12683, 10662, 0, 8112, 0, 65852, 0, 12379, 194877, 120818,
+ 41964, 42208, 63843, 2084, 41965, 0, 65866, 4327, 0, 63840, 78549, 41220,
+ 13032, 0, 584, 12933, 43177, 12373, 0, 13000, 1351, 2935, 8698, 12665, 0,
+ 1930, 0, 78229, 12427, 66514, 0, 13031, 0, 63901, 0, 3657, 128572, 65202,
+ 6000, 119206, 12426, 127181, 0, 41740, 12428, 41283, 41916, 119210, 0, 0,
+ 12429, 6727, 0, 7562, 0, 5170, 0, 41755, 676, 0, 66704, 66664, 9978,
+ 66491, 3536, 0, 9752, 92397, 6162, 0, 69228, 10113, 41829, 65886, 5159,
+ 12422, 41832, 439, 43077, 0, 42207, 74549, 11796, 40970, 41830, 0,
+ 917799, 8308, 917797, 917796, 0, 67864, 917801, 917800, 12336, 4135,
+ 69805, 341, 2727, 4129, 3539, 0, 63861, 0, 7913, 0, 63859, 4131, 63868,
+ 0, 63867, 4133, 11371, 210, 4600, 0, 74560, 4137, 8082, 78506, 119062,
+ 78504, 6704, 4591, 128029, 0, 0, 9680, 0, 120623, 561, 12159, 195, 78508,
+ 41501, 0, 42031, 5719, 7172, 42687, 8368, 0, 41499, 0, 0, 42242, 41498,
+ 917794, 42025, 78567, 65805, 42463, 0, 2924, 0, 120510, 0, 0, 119213,
+ 73941, 0, 42330, 917784, 3969, 0, 0, 7169, 1992, 9652, 73977, 7246,
+ 42086, 917790, 917789, 0, 0, 128801, 0, 0, 327, 0, 9042, 917777, 917776,
+ 65148, 12433, 917781, 127276, 917779, 12431, 8668, 12434, 0, 917782,
+ 5999, 0, 7712, 12432, 128243, 43653, 1726, 1015, 0, 8212, 0, 128014,
+ 42423, 119066, 0, 128108, 66709, 0, 8811, 927, 0, 0, 12436, 0, 42021, 0,
+ 0, 1299, 12240, 42350, 65143, 0, 195016, 0, 78197, 11348, 0, 78037, 9194,
+ 0, 0, 19914, 12179, 0, 9648, 194923, 63836, 63832, 917773, 10967, 63816,
+ 2594, 3444, 63817, 64651, 0, 41503, 127478, 11265, 0, 120756, 194922, 0,
+ 5664, 3972, 0, 0, 0, 128508, 12416, 917764, 119608, 10816, 917769,
+ 917768, 12418, 74111, 3882, 8532, 917771, 1573, 128648, 119847, 4596,
+ 66339, 12417, 66001, 65343, 194782, 12414, 8287, 68219, 195017, 68108,
+ 1143, 119169, 119846, 12415, 6626, 42763, 0, 118884, 9021, 120783, 0,
+ 11724, 0, 0, 127104, 128526, 0, 0, 8027, 10997, 9171, 12741, 11400,
+ 74197, 194799, 0, 128239, 0, 128881, 119604, 127523, 120190, 194773,
+ 67608, 128214, 42368, 0, 7715, 3881, 41487, 12118, 42514, 68651, 0, 0,
+ 3009, 41476, 41489, 69825, 3007, 1448, 3018, 194809, 3889, 8521, 5083,
+ 5082, 119859, 120184, 8519, 0, 3014, 5081, 65853, 120715, 0, 120183,
+ 78219, 5079, 64802, 42210, 4597, 65532, 78444, 120185, 12371, 0, 8407, 0,
+ 10805, 8518, 10779, 120188, 0, 0, 12367, 42170, 0, 92557, 629, 1924, 0,
+ 12037, 74366, 5987, 8462, 8005, 12365, 63933, 69735, 120815, 12369,
+ 10649, 0, 5077, 127108, 10880, 63927, 5075, 917881, 0, 65075, 0, 11007,
+ 0, 66659, 92607, 0, 66684, 0, 3434, 4954, 1904, 0, 5266, 126980, 5272,
+ 10499, 4507, 9578, 63923, 120177, 7979, 0, 9831, 0, 194926, 461, 9803, 0,
+ 4504, 1505, 0, 6325, 5276, 43021, 120488, 0, 55236, 0, 66461, 5177,
+ 41324, 12055, 8722, 0, 41327, 0, 66695, 4114, 409, 4383, 8900, 8948,
+ 41325, 0, 721, 10182, 9108, 0, 0, 119185, 42229, 194912, 0, 5998, 0,
+ 42353, 74825, 0, 12587, 0, 78571, 0, 0, 194562, 41576, 42215, 78570,
+ 119207, 0, 8578, 5995, 7573, 41575, 74789, 74752, 63944, 63949, 64767,
+ 2670, 4167, 0, 11723, 0, 74120, 0, 65076, 938, 43414, 73854, 11737, 9721,
+ 0, 0, 0, 11742, 2419, 0, 11493, 12334, 194913, 4153, 12302, 10793, 5250,
+ 12407, 11978, 4404, 9189, 12401, 42007, 5775, 6759, 65806, 43997, 0,
+ 42002, 12404, 0, 0, 4940, 12410, 7683, 1167, 73729, 4983, 0, 861, 0, 0,
+ 0, 0, 65577, 43370, 0, 0, 11956, 0, 0, 0, 9616, 6631, 0, 12816, 74583,
+ 42218, 12710, 68674, 12721, 4101, 66185, 0, 5992, 7616, 195044, 0, 12577,
+ 0, 0, 853, 42693, 195014, 0, 0, 5016, 43535, 63893, 42835, 9491, 917913,
+ 0, 917914, 0, 12712, 7105, 127807, 65060, 120797, 9900, 0, 0, 194919, 0,
+ 127830, 0, 64778, 12585, 10565, 128151, 12177, 0, 0, 0, 77824, 0, 4900,
+ 127874, 12878, 92630, 8984, 4119, 74768, 8971, 78593, 43113, 9702, 78594,
+ 11025, 9245, 13048, 4927, 4138, 74185, 92481, 92710, 12397, 77827, 0,
+ 13054, 12394, 0, 0, 0, 13053, 0, 3948, 10781, 1546, 0, 5010, 1680, 10507,
+ 78590, 78583, 0, 0, 0, 194915, 7267, 0, 74833, 128181, 5993, 2819, 0,
+ 12706, 77840, 1893, 7266, 63915, 7264, 7265, 0, 1363, 0, 63997, 63910,
+ 63996, 3077, 0, 0, 1512, 0, 12589, 41479, 128313, 0, 43339, 0, 9836,
+ 120727, 0, 41481, 43335, 7832, 42343, 3090, 43337, 817, 1664, 1850,
+ 128841, 3079, 11340, 42408, 42447, 127140, 120020, 42307, 12386, 42304,
+ 917555, 0, 12389, 0, 92366, 41996, 11526, 63985, 5864, 1147, 63992,
+ 42887, 1987, 92718, 5480, 7858, 11653, 4116, 12391, 66193, 0, 4939,
+ 12384, 0, 0, 41686, 63905, 119601, 194688, 0, 0, 12649, 0, 0, 8247, 507,
+ 91, 2042, 120775, 43643, 194689, 66028, 10036, 41844, 119813, 774,
+ 119831, 0, 119815, 5994, 12539, 0, 78375, 120597, 119833, 0, 119600, 0,
+ 0, 7719, 6026, 2486, 128312, 119808, 162, 0, 65219, 41073, 9687, 41681,
+ 6304, 119812, 66196, 194881, 5262, 0, 55233, 12681, 42379, 0, 7534,
+ 12219, 0, 127528, 42810, 10492, 0, 0, 0, 43119, 0, 120753, 12403, 2500,
+ 195013, 0, 4899, 12729, 0, 0, 74113, 2343, 4103, 19946, 74112, 77851,
+ 13112, 0, 195012, 12859, 0, 120148, 66369, 5861, 127758, 11999, 12400, 0,
+ 0, 12645, 5146, 11320, 68410, 6748, 65040, 0, 64184, 12974, 64183, 67613,
+ 120645, 5147, 0, 0, 74524, 0, 1928, 0, 67649, 5991, 3445, 67609, 4976,
+ 64176, 0, 67610, 8241, 0, 77868, 4206, 0, 0, 0, 128298, 0, 10138, 0, 0,
+ 8897, 0, 0, 8357, 4124, 77862, 65836, 120641, 127926, 77859, 0, 0, 1123,
+ 963, 41553, 10120, 12405, 120150, 92664, 398, 13278, 9723, 6366, 120311,
+ 7945, 0, 4402, 9970, 12402, 0, 42392, 1305, 12408, 0, 44007, 0, 0, 41464,
+ 12411, 12969, 120824, 41465, 0, 8528, 1575, 0, 63955, 165, 3024, 41467,
+ 119163, 0, 9093, 0, 9147, 0, 63958, 0, 9148, 9692, 4096, 53, 73776, 6750,
+ 195018, 0, 9594, 0, 0, 43527, 0, 727, 194703, 0, 5805, 0, 6726, 0, 42176,
+ 12370, 11655, 119095, 10591, 12364, 0, 12372, 120642, 120307, 0, 92343,
+ 0, 12366, 10963, 6066, 1329, 0, 3052, 9220, 0, 64478, 194701, 10803,
+ 4132, 120306, 68474, 92473, 0, 0, 74837, 120155, 1499, 0, 8055, 42740,
+ 63965, 0, 63962, 74042, 8924, 43123, 5988, 3660, 63969, 11781, 42718,
+ 8788, 1357, 64851, 65743, 0, 8774, 0, 127086, 9941, 120172, 0, 1933,
+ 69655, 9564, 0, 92435, 73866, 0, 0, 2487, 67614, 3121, 1804, 3311, 67615,
+ 0, 78302, 12220, 67616, 120598, 127475, 0, 68200, 6675, 128144, 0, 67592,
+ 120685, 0, 64771, 1198, 9132, 0, 64619, 510, 64663, 0, 0, 4561, 2101,
+ 1398, 0, 92554, 74034, 41569, 92684, 11406, 8167, 12127, 0, 840, 0, 0, 0,
+ 6967, 0, 0, 9796, 0, 333, 0, 0, 8144, 2117, 0, 0, 12406, 0, 19931,
+ 119089, 6678, 7769, 0, 12621, 0, 127366, 10227, 4764, 43101, 9981, 0,
+ 40986, 4127, 66487, 0, 42202, 12754, 195022, 0, 0, 0, 67594, 2048, 12944,
+ 4050, 67595, 917967, 43102, 10581, 12985, 4533, 195021, 74003, 6490, 0,
+ 12038, 0, 0, 120704, 65461, 9798, 69704, 0, 1948, 119007, 0, 952, 128235,
+ 0, 0, 120802, 6449, 9494, 120313, 0, 43098, 4843, 8142, 64160, 4098,
+ 64170, 0, 0, 3436, 119973, 0, 12817, 67597, 6676, 3930, 66708, 0, 0,
+ 67598, 0, 0, 0, 65591, 41581, 65916, 1453, 0, 0, 0, 8500, 42222, 120142,
+ 73743, 120400, 4317, 11543, 67676, 64676, 0, 0, 67606, 119083, 0, 42217,
+ 13102, 0, 66003, 6672, 0, 0, 0, 0, 63841, 9613, 9001, 4526, 11274, 67601,
+ 64520, 64210, 6664, 78704, 42056, 10228, 64957, 11281, 0, 64213, 1469,
+ 66640, 65381, 42197, 4988, 42372, 0, 9598, 904, 352, 42225, 1451, 8061,
+ 8453, 4134, 0, 74847, 66576, 127916, 0, 10520, 8575, 9960, 1201, 127289,
+ 12846, 127291, 127292, 11919, 64962, 127287, 43739, 127281, 8511, 9460,
+ 823, 11587, 12305, 0, 64695, 127305, 12387, 1253, 13183, 65766, 500,
+ 42783, 65765, 64208, 64369, 65760, 65761, 119585, 11606, 64784, 11702,
+ 66498, 9821, 64304, 0, 5152, 11048, 7533, 68366, 64410, 92305, 0, 4323,
+ 120062, 92669, 0, 127052, 42587, 42214, 41394, 0, 4763, 4112, 118935, 0,
+ 5260, 43143, 0, 326, 120131, 68423, 0, 10771, 2876, 74074, 92530, 194924,
+ 41398, 7382, 9802, 127077, 127076, 453, 41396, 120524, 42720, 12140,
+ 9572, 0, 7003, 194883, 42334, 7704, 0, 194885, 43144, 4123, 8494, 43146,
+ 9977, 0, 0, 65759, 10765, 64061, 4465, 9808, 64056, 65582, 4126, 0, 9521,
+ 9589, 64755, 0, 64020, 0, 10464, 0, 0, 194869, 64514, 11528, 64024,
+ 128072, 679, 64013, 0, 5850, 758, 7536, 0, 92234, 41441, 10693, 64006, 0,
+ 64005, 4058, 119019, 0, 64660, 0, 119050, 0, 0, 1139, 43298, 64027,
+ 64029, 8970, 0, 9934, 0, 10774, 128020, 42201, 12421, 128216, 0, 1852,
+ 3057, 128113, 73744, 64034, 64039, 0, 0, 0, 0, 92322, 7645, 12854, 74338,
+ 3496, 0, 0, 0, 9102, 627, 127795, 6158, 8327, 74553, 66632, 12419, 13309,
+ 11570, 127811, 19960, 11696, 0, 1018, 118970, 194909, 194897, 1682,
+ 194896, 194911, 42756, 6765, 194906, 0, 0, 73814, 11412, 6768, 10728,
+ 194830, 119010, 118863, 43311, 64966, 11577, 0, 43040, 1833, 11576, 0,
+ 74779, 0, 185, 65085, 74533, 64754, 194848, 7535, 8085, 42525, 120387,
+ 9749, 41701, 6131, 1949, 4117, 7847, 120489, 194711, 64483, 65693, 0, 0,
+ 0, 69695, 42240, 0, 0, 42864, 0, 64667, 41868, 1184, 0, 815, 11484,
+ 127535, 67840, 0, 0, 128793, 0, 10986, 64683, 0, 0, 194709, 0, 0, 9879,
+ 0, 0, 4158, 128050, 68166, 0, 0, 0, 0, 69645, 332, 118808, 0, 5142, 2407,
+ 69643, 42199, 0, 92404, 74373, 0, 55217, 0, 63870, 43163, 0, 0, 92390,
+ 42867, 1834, 0, 92461, 69817, 10940, 65249, 119040, 8662, 0, 0, 2652,
+ 120527, 7164, 10784, 195093, 67674, 0, 92233, 92482, 194749, 74562,
+ 917505, 1828, 74474, 120327, 78620, 8531, 12499, 6280, 12324, 118854,
+ 65238, 68374, 4832, 65573, 0, 6279, 12508, 12904, 12502, 9161, 0, 1620,
+ 64436, 3601, 195094, 128073, 0, 609, 11555, 0, 12496, 127839, 74181,
+ 4343, 12505, 0, 127863, 0, 11377, 239, 0, 637, 0, 0, 42671, 0, 0, 0,
+ 43565, 127082, 0, 12696, 128256, 0, 194796, 12929, 0, 712, 0, 4197, 0,
+ 42818, 128688, 0, 120490, 0, 119137, 1506, 43562, 0, 0, 0, 12651, 0,
+ 64628, 74517, 12058, 74084, 917838, 7494, 0, 4924, 65592, 118844, 0,
+ 127088, 355, 9719, 127087, 13066, 64796, 0, 0, 12033, 42178, 0, 69760,
+ 42571, 92635, 0, 0, 0, 0, 0, 127176, 3178, 0, 0, 92704, 0, 9080, 127000,
+ 120352, 0, 68209, 0, 11082, 0, 5699, 195100, 66000, 9488, 65166, 119112,
+ 0, 0, 0, 0, 128208, 0, 5265, 69235, 0, 11487, 67858, 12464, 0, 43045, 0,
+ 0, 43345, 0, 10770, 118994, 6807, 465, 9829, 0, 74348, 0, 43346, 8116,
+ 795, 0, 0, 12462, 10930, 10831, 0, 118952, 64362, 74334, 0, 120811, 0,
+ 12468, 8607, 1008, 0, 10092, 195078, 917842, 67855, 55257, 73771, 1766,
+ 11282, 11996, 1820, 4547, 0, 0, 0, 0, 13223, 128665, 64595, 127294, 0,
+ 92311, 4345, 12616, 0, 0, 0, 74467, 0, 0, 0, 5382, 0, 0, 0, 119060,
+ 64953, 5406, 19920, 92216, 66510, 3590, 0, 1130, 0, 0, 42016, 11823,
+ 43023, 0, 118896, 7742, 0, 13280, 0, 9326, 73826, 5310, 74812, 78584,
+ 92229, 8959, 43589, 6747, 66723, 0, 8568, 0, 120496, 73816, 120803, 0,
+ 42670, 0, 11621, 12460, 0, 120631, 0, 43063, 74519, 127182, 0, 0, 0,
+ 69783, 11689, 5410, 5783, 10468, 8403, 5400, 11594, 128247, 0, 118990,
+ 10491, 0, 64412, 0, 0, 5587, 42865, 64404, 8268, 4923, 65086, 8981,
+ 12382, 42133, 120755, 9706, 69738, 0, 66610, 10461, 12103, 0, 8642, 0,
+ 42766, 0, 66566, 9983, 0, 119105, 0, 0, 0, 7398, 41515, 0, 11802, 8041,
+ 1461, 910, 119133, 0, 6749, 3658, 0, 120525, 0, 7617, 194841, 12888, 0,
+ 67668, 13143, 0, 9193, 11097, 5703, 0, 41517, 41504, 41519, 10016, 64305,
+ 0, 65864, 623, 781, 670, 10660, 5769, 613, 7543, 120279, 477, 41083,
+ 92521, 0, 592, 1578, 12459, 43449, 0, 0, 8225, 0, 654, 11345, 653, 652,
+ 0, 647, 0, 633, 120744, 0, 0, 12480, 43243, 0, 39, 12487, 0, 120529,
+ 74199, 12482, 0, 12489, 0, 3195, 5550, 0, 7897, 0, 1203, 74396, 1813,
+ 64544, 41311, 12090, 0, 2877, 0, 0, 1675, 0, 0, 0, 0, 10070, 10595, 0,
+ 119077, 0, 0, 0, 0, 0, 43244, 0, 0, 0, 119561, 0, 0, 194921, 128160,
+ 9939, 0, 0, 77860, 0, 0, 270, 0, 10714, 0, 0, 0, 0, 0, 65372, 0, 74038,
+ 119558, 6273, 66679, 364, 9595, 194908, 0, 0, 707, 0, 0, 9282, 66489,
+ 224, 0, 68670, 9332, 4966, 68677, 0, 68644, 0, 3841, 68634, 0, 10732,
+ 68640, 850, 4972, 0, 64699, 2909, 68619, 44008, 68627, 0, 11544, 10203,
+ 9608, 0, 0, 11962, 194694, 12507, 1196, 128687, 128311, 777, 120187,
+ 4375, 65271, 67678, 0, 12198, 0, 64824, 119343, 0, 9454, 63778, 8658,
+ 42528, 78000, 2705, 917975, 41520, 0, 0, 11986, 7765, 42502, 8280, 0,
+ 2701, 0, 0, 5767, 0, 0, 9809, 8353, 63747, 66701, 63772, 0, 63745, 1748,
+ 63770, 0, 0, 0, 65542, 63766, 55244, 3061, 0, 63764, 63787, 9067, 6096,
+ 0, 7694, 0, 7257, 63768, 3485, 12987, 0, 127522, 120628, 63807, 1591, 0,
+ 6386, 63783, 0, 0, 127173, 0, 0, 0, 74575, 0, 65719, 13083, 64574, 65012,
+ 0, 1640, 12495, 66691, 7624, 3138, 10996, 92247, 1922, 0, 12498, 10987,
+ 0, 0, 3894, 65543, 0, 194842, 0, 493, 0, 43197, 1717, 4228, 479, 10303,
+ 74020, 0, 917935, 10335, 3520, 917932, 12490, 64315, 0, 127039, 12493,
+ 6233, 42681, 1002, 12491, 0, 64911, 92615, 2096, 65120, 0, 0, 0, 11611,
+ 11632, 127041, 66213, 63864, 66221, 66226, 66229, 13218, 66231, 66216,
+ 8507, 66236, 66211, 66218, 92672, 66240, 78041, 66233, 8928, 0, 7909,
+ 66234, 11605, 63759, 0, 66208, 73999, 63799, 63803, 244, 11542, 12898,
+ 12494, 73761, 12492, 12669, 0, 0, 74153, 0, 128278, 120680, 4882, 13040,
+ 0, 8612, 4885, 74053, 0, 13042, 4880, 64662, 2429, 1360, 248, 0, 63797,
+ 92394, 42358, 0, 7292, 0, 63756, 42786, 66693, 0, 1870, 78040, 470,
+ 78038, 78035, 78036, 0, 78034, 4579, 128090, 0, 12511, 74453, 12514, 0,
+ 74579, 7239, 7001, 8623, 0, 128052, 128048, 7378, 12512, 11615, 6104, 0,
+ 0, 659, 6098, 0, 12234, 127307, 127067, 8311, 12510, 41803, 13039,
+ 127072, 12513, 10202, 12471, 0, 8747, 0, 0, 0, 2323, 0, 2319, 77917,
+ 12477, 77916, 2311, 0, 4415, 237, 6281, 127280, 0, 0, 2309, 1312, 8173,
+ 128871, 12469, 0, 78505, 64335, 10609, 0, 128111, 9397, 11524, 9395,
+ 9396, 9393, 9394, 9391, 9392, 9389, 6209, 9387, 9388, 4932, 9386, 9383,
+ 9384, 6740, 0, 65451, 8185, 0, 917832, 43024, 43336, 67659, 2313, 128167,
+ 7948, 9236, 0, 0, 0, 10570, 43473, 6289, 10484, 0, 0, 11998, 12082,
+ 10924, 3147, 0, 120684, 12524, 119081, 2310, 11818, 9381, 9382, 9379,
+ 9380, 9377, 9378, 9375, 9376, 1683, 9374, 0, 9372, 12444, 0, 0, 13016,
+ 8210, 0, 42029, 11079, 12331, 43451, 42032, 8744, 726, 0, 0, 4155, 0, 0,
+ 42030, 5007, 12522, 43088, 0, 4951, 127805, 127240, 0, 9922, 43309, 0,
+ 12525, 0, 12016, 65770, 9548, 67665, 403, 78230, 12503, 0, 0, 11030, 0,
+ 92567, 65691, 63998, 1819, 10496, 0, 0, 119920, 0, 194668, 0, 12506, 0,
+ 12231, 0, 12500, 44023, 12509, 64393, 78830, 3389, 10589, 6608, 41047,
+ 120321, 78395, 78394, 74069, 77995, 78391, 3608, 8281, 120320, 1107, 0,
+ 9076, 8862, 69743, 41052, 13084, 64766, 43217, 7803, 13222, 74165, 74782,
+ 128817, 8546, 11553, 63995, 13177, 9043, 6303, 0, 498, 64471, 120324,
+ 128567, 12529, 8042, 0, 2344, 12528, 8031, 2414, 0, 69719, 3231, 0, 6422,
+ 66512, 69653, 12530, 2537, 78405, 41429, 12658, 13036, 65772, 0, 78738,
+ 41433, 4719, 469, 0, 4363, 3313, 41428, 78407, 2023, 1772, 78224, 78225,
+ 65706, 10051, 64812, 78220, 0, 9920, 12215, 0, 4931, 1951, 12497, 119363,
+ 9607, 0, 9663, 0, 119634, 6503, 41110, 0, 1491, 0, 0, 127304, 41061, 0,
+ 0, 127187, 65026, 41993, 41509, 11045, 65028, 78602, 66476, 41108, 9738,
+ 41995, 1075, 1958, 12535, 41992, 41506, 0, 41687, 0, 120717, 127776,
+ 9940, 127299, 7692, 0, 8008, 41131, 330, 8566, 65083, 41133, 9816,
+ 128074, 12532, 78550, 78546, 3508, 127058, 43235, 0, 127298, 64139,
+ 78231, 6411, 12910, 78554, 66644, 13028, 6737, 12537, 0, 0, 64136, 12536,
+ 2350, 13029, 78233, 0, 0, 13030, 6702, 4527, 0, 12538, 128810, 0, 65599,
+ 65717, 9966, 0, 4948, 12484, 4032, 128149, 12623, 0, 6207, 0, 6117,
+ 65930, 8412, 0, 7438, 1296, 2325, 41511, 0, 10149, 74118, 0, 127286,
+ 12481, 0, 12488, 0, 0, 41556, 64414, 118802, 2354, 128571, 73766, 0,
+ 6295, 901, 41510, 7953, 0, 65032, 41513, 0, 11927, 66584, 78559, 78560,
+ 78557, 78558, 0, 78556, 848, 9868, 0, 6424, 78568, 119338, 78565, 74031,
+ 78563, 78564, 2352, 78572, 893, 64576, 11289, 1407, 0, 0, 13026, 6762,
+ 78579, 78580, 13023, 8903, 9777, 66715, 1871, 8099, 0, 0, 1343, 0, 0,
+ 9325, 6818, 6283, 11738, 0, 0, 0, 11741, 0, 0, 9216, 8263, 11279, 194752,
+ 0, 194754, 13021, 64494, 3136, 194758, 194757, 194760, 13022, 42737,
+ 9956, 0, 0, 74552, 10014, 0, 41260, 119340, 13020, 10024, 194764, 194767,
+ 74340, 69681, 0, 64945, 8029, 0, 0, 0, 3335, 0, 0, 9776, 120526, 194748,
+ 5215, 42644, 3333, 1632, 194751, 64849, 3342, 78582, 5363, 12957, 78581,
+ 4156, 0, 0, 6421, 78591, 1611, 78589, 13018, 74257, 78588, 74542, 3337,
+ 4537, 67895, 11736, 0, 68608, 6482, 4214, 73790, 11945, 0, 13046, 8838,
+ 425, 4025, 10709, 78595, 2108, 2392, 13047, 0, 0, 6819, 13049, 6499,
+ 92243, 12424, 68614, 73944, 13050, 9924, 194745, 6507, 127919, 0, 128069,
+ 3277, 8929, 4947, 41055, 0, 194722, 194721, 194724, 13045, 64626, 66034,
+ 7751, 194727, 8371, 194729, 3997, 12806, 8768, 13044, 0, 12420, 4024,
+ 194730, 41054, 1078, 9757, 69736, 41057, 0, 0, 0, 0, 0, 92210, 92411, 0,
+ 41496, 0, 9165, 1572, 11911, 0, 118842, 2346, 13270, 8958, 0, 9646, 3773,
+ 43183, 6401, 5831, 0, 0, 13043, 8056, 92494, 65681, 208, 127382, 41514,
+ 0, 0, 0, 10699, 6408, 92227, 7825, 5661, 0, 120630, 3603, 41109, 2398,
+ 3548, 0, 0, 119933, 0, 3115, 9918, 0, 11321, 42912, 0, 0, 194726, 4876,
+ 65804, 0, 0, 43468, 0, 41558, 41471, 73950, 8158, 9944, 41472, 120298,
+ 13051, 78689, 3143, 194674, 6701, 41559, 1896, 66256, 13052, 194680,
+ 5665, 0, 119071, 7025, 63974, 0, 74352, 74161, 4154, 9863, 43550, 12310,
+ 5662, 42382, 194686, 73924, 1121, 194665, 63959, 0, 9942, 13231, 0,
+ 64752, 4732, 194666, 11596, 119931, 65187, 1626, 63983, 10110, 64772,
+ 42024, 6420, 42028, 0, 10509, 2795, 4910, 194728, 69231, 64753, 6275,
+ 917808, 118830, 63978, 11044, 3229, 6423, 42774, 0, 0, 0, 12823, 2331,
+ 917810, 42026, 6137, 0, 7524, 0, 917809, 8346, 0, 8338, 128315, 65043, 0,
+ 822, 127984, 9903, 64721, 42722, 194656, 194659, 78655, 78661, 194660,
+ 78662, 41265, 5311, 1795, 965, 118791, 10587, 78055, 11278, 78632,
+ 194640, 0, 12946, 194641, 119341, 120349, 6294, 3144, 194648, 194647,
+ 65019, 194649, 73990, 0, 0, 748, 41067, 2330, 535, 3148, 12375, 194652,
+ 194629, 10556, 2475, 12388, 4889, 8968, 67863, 3593, 0, 0, 2342, 0,
+ 194634, 65206, 4894, 194635, 4890, 194637, 917804, 581, 4893, 0, 6571,
+ 65545, 4888, 4157, 78048, 78049, 78046, 78047, 0, 10119, 6415, 42893, 0,
+ 69702, 0, 0, 11375, 64746, 2332, 78063, 412, 78061, 64932, 42880, 43587,
+ 0, 0, 0, 0, 65197, 78066, 12203, 78064, 78065, 8913, 65854, 4875, 65811,
+ 120381, 120389, 118888, 9344, 8826, 120386, 120395, 13104, 74781, 11997,
+ 120393, 78075, 0, 3134, 0, 65696, 92331, 0, 66217, 0, 8334, 119344, 0,
+ 3449, 0, 0, 78414, 78413, 118950, 74011, 0, 0, 0, 0, 1908, 120167, 4328,
+ 10734, 127014, 0, 127914, 7804, 78272, 10811, 6250, 11339, 4914, 11367,
+ 0, 78054, 4917, 74516, 74208, 64285, 4912, 5464, 127836, 118893, 2361,
+ 7971, 78072, 78073, 55243, 78071, 0, 8086, 74317, 6707, 8319, 2312,
+ 40977, 10960, 40962, 8305, 12573, 0, 40980, 0, 13202, 0, 12582, 78282, 0,
+ 0, 42438, 55221, 6288, 78280, 127946, 5653, 42400, 10891, 7698, 5658,
+ 74045, 120165, 0, 0, 4913, 0, 0, 0, 42326, 128194, 12728, 92685, 42478,
+ 2327, 0, 12563, 42287, 12705, 0, 0, 12588, 8821, 6153, 2867, 194708,
+ 66312, 698, 128007, 194606, 10356, 74075, 194713, 651, 12641, 0, 0, 0, 0,
+ 41552, 65115, 78465, 78467, 78463, 78464, 128851, 78461, 194697, 74356,
+ 92626, 4716, 43277, 0, 78474, 12340, 120568, 0, 194700, 55264, 41211,
+ 120676, 8703, 5462, 917629, 0, 10101, 0, 0, 8479, 4151, 41933, 0, 0,
+ 66254, 120821, 0, 0, 128654, 0, 119194, 74050, 92701, 0, 0, 0, 0, 0,
+ 12278, 0, 0, 0, 2700, 12576, 7842, 12899, 0, 0, 2699, 0, 73845, 2985,
+ 92568, 0, 917845, 12192, 119314, 0, 119312, 9827, 119310, 119311, 119308,
+ 119309, 119306, 11481, 41210, 119305, 0, 35, 78481, 78482, 66694, 68479,
+ 78477, 78478, 43596, 6090, 64257, 7812, 10534, 0, 78485, 73848, 78483,
+ 4272, 0, 40967, 40964, 917825, 12704, 78487, 43306, 0, 64497, 12138,
+ 7930, 0, 43303, 68216, 0, 917826, 5244, 4189, 127098, 67596, 127504,
+ 4188, 1879, 0, 968, 0, 43743, 0, 8873, 0, 0, 917827, 65555, 12574, 0, 0,
+ 0, 74490, 127099, 43657, 0, 0, 0, 42682, 12578, 12720, 0, 41227, 0,
+ 12346, 127101, 64848, 0, 0, 7251, 0, 0, 118850, 119141, 128546, 66015, 0,
+ 959, 8885, 12564, 66457, 78808, 9469, 9632, 92323, 74761, 64323, 0, 0, 0,
+ 0, 310, 0, 41281, 10976, 0, 92190, 0, 74266, 10054, 6497, 8574, 0, 9012,
+ 19958, 74420, 65089, 13215, 12730, 65163, 74044, 374, 43195, 816, 0, 0,
+ 0, 41934, 7465, 0, 128168, 0, 4715, 6101, 0, 41936, 0, 4879, 0, 65446, 0,
+ 307, 127147, 9585, 5374, 0, 128059, 0, 0, 0, 0, 0, 65567, 120614, 1929,
+ 0, 12142, 0, 12236, 41419, 194618, 120610, 12982, 194623, 5378, 78791,
+ 128679, 41421, 0, 4462, 0, 0, 128092, 821, 0, 2498, 5800, 120157, 0,
+ 1760, 2421, 4469, 2324, 828, 3611, 78400, 757, 1185, 0, 78770, 43597,
+ 10628, 74808, 194572, 7999, 43971, 0, 0, 10634, 10942, 7713, 2348, 0,
+ 64374, 4380, 194608, 119044, 9982, 64324, 41240, 862, 65626, 78462, 1810,
+ 3673, 5137, 194617, 0, 7277, 65622, 0, 7566, 64688, 194593, 194592,
+ 78092, 74357, 194597, 4748, 92228, 194598, 194601, 42260, 5871, 119075,
+ 0, 74576, 44019, 0, 128189, 3967, 194604, 13137, 8775, 127945, 0, 2963,
+ 0, 8410, 4454, 723, 127882, 966, 4449, 92330, 92238, 0, 7819, 2320,
+ 194589, 339, 4968, 194590, 120399, 8075, 55276, 0, 8047, 0, 78827, 12634,
+ 41542, 78780, 7466, 6705, 12174, 42610, 0, 74452, 0, 1584, 66645, 6045,
+ 6729, 120640, 65218, 78777, 0, 78062, 7537, 0, 11370, 0, 10330, 0, 10394,
+ 0, 74194, 0, 127929, 9780, 0, 13092, 194576, 119605, 194578, 7074, 92648,
+ 194579, 194582, 11414, 128868, 2531, 13034, 0, 0, 4211, 1259, 7517, 0, 0,
194561, 40996, 13037, 7092, 641, 5219, 194567, 194566, 11064, 41129, 0,
- 42850, 13035, 9075, 0, 5466, 194570, 0, 64098, 65793, 4535, 194573, 4271,
- 194575, 0, 0, 41410, 0, 64262, 0, 41407, 0, 0, 41131, 118864, 9046, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 64338, 2563, 13033, 247, 917787, 0, 12338, 4651,
- 0, 11270, 0, 0, 11933, 0, 0, 41903, 67892, 11001, 0, 42255, 0, 0, 0,
- 41905, 0, 0, 10775, 9793, 5009, 0, 42269, 64587, 0, 42535, 0, 64529,
- 41408, 42853, 3877, 0, 0, 8147, 43566, 119021, 0, 10236, 65918, 0, 0, 0,
- 64506, 0, 118921, 4747, 0, 0, 43200, 5832, 0, 0, 5141, 42600, 0, 43203,
- 0, 0, 43286, 0, 0, 0, 0, 0, 0, 74137, 11303, 65547, 0, 7031, 859, 0, 0,
- 0, 6059, 126985, 0, 0, 8535, 0, 0, 194787, 66032, 11488, 0, 120786, 0, 0,
- 10558, 63885, 0, 11822, 0, 43189, 0, 0, 1788, 1579, 120482, 917817, 0, 0,
- 0, 9028, 119571, 0, 0, 0, 1285, 64882, 41242, 0, 0, 12640, 0, 66642, 0,
- 12625, 0, 0, 0, 3940, 41597, 0, 3396, 12642, 8665, 0, 0, 12630, 1653, 0,
- 10153, 0, 6166, 120516, 120523, 0, 8815, 66673, 65046, 9285, 913, 42259,
- 119317, 119318, 119315, 119316, 42485, 118837, 7878, 8211, 42293, 64377,
- 0, 0, 0, 0, 12032, 0, 9725, 0, 0, 5263, 12818, 0, 41939, 10022, 65387,
- 118831, 42777, 10139, 980, 0, 65386, 0, 0, 0, 43198, 7184, 0, 194797,
- 917819, 10085, 119992, 0, 119999, 6634, 0, 0, 119323, 8072, 119321,
- 119322, 0, 8872, 7783, 917992, 12398, 8237, 0, 0, 12395, 0, 0, 120565,
- 9914, 127011, 917854, 73975, 74281, 0, 0, 0, 917853, 0, 64735, 41243, 0,
- 7808, 1829, 0, 41937, 4358, 43272, 0, 0, 0, 0, 0, 1710, 0, 0, 0, 0, 49,
- 6627, 0, 6258, 10683, 0, 9741, 120423, 5649, 917986, 0, 64418, 1643,
- 74104, 8405, 3470, 0, 13213, 42452, 917987, 0, 120009, 0, 1072, 0,
- 917990, 0, 6576, 41988, 41132, 65675, 1080, 120002, 74100, 0, 1101,
- 120001, 12309, 0, 0, 12632, 1086, 1869, 0, 7680, 0, 65458, 120714, 12639,
- 3380, 8123, 1091, 12638, 7977, 4501, 0, 0, 66309, 0, 0, 1494, 0, 0, 0,
- 11693, 0, 10494, 119230, 65872, 12363, 11386, 0, 0, 0, 0, 64582, 0,
- 73794, 0, 8022, 0, 0, 74106, 12413, 0, 0, 0, 0, 5570, 1881, 7210, 0,
- 1012, 66630, 0, 120709, 7208, 66442, 5569, 0, 42339, 0, 6063, 0, 0, 0,
- 6053, 65602, 0, 0, 64727, 9160, 194827, 0, 0, 0, 10503, 118810, 6055,
- 3870, 4279, 8490, 120114, 4319, 64786, 8602, 120110, 11326, 0, 0, 0,
- 120119, 120413, 120117, 120118, 120099, 120100, 65087, 5571, 3674, 9740,
- 9121, 5568, 120107, 120108, 42085, 10107, 64567, 42870, 120101, 589,
- 7050, 0, 43281, 10233, 41263, 66251, 65729, 66253, 0, 74099, 42645, 0,
- 194815, 8583, 0, 5847, 6928, 0, 0, 0, 0, 0, 66592, 12204, 0, 19966, 0,
- 42561, 120626, 0, 0, 8120, 120701, 0, 0, 0, 41063, 0, 10664, 0, 8369, 0,
- 4551, 0, 74759, 0, 0, 9673, 66334, 65580, 10478, 127002, 12517, 557,
- 9457, 12034, 0, 41056, 12519, 41004, 0, 0, 74094, 0, 0, 119001, 0, 0, 0,
- 12111, 3927, 0, 12515, 1474, 67893, 5492, 6923, 0, 10441, 73836, 0, 0,
- 5493, 0, 74319, 0, 66635, 12019, 0, 1618, 0, 0, 9645, 10430, 0, 5853,
- 13063, 10363, 0, 12956, 0, 0, 11314, 0, 12060, 0, 0, 12826, 0, 0, 10514,
- 65517, 74395, 2707, 8309, 0, 127054, 0, 43570, 2697, 0, 0, 127057, 2695,
- 42171, 0, 0, 0, 67617, 194814, 0, 2693, 12125, 12766, 0, 1164, 0, 0,
- 41918, 0, 0, 8687, 66009, 12178, 7053, 0, 7469, 0, 5248, 12218, 120538,
- 6427, 42884, 41123, 0, 0, 42873, 41126, 9991, 41128, 74371, 127031, 0,
- 9873, 0, 42877, 7994, 64762, 6104, 42843, 6591, 9340, 0, 1589, 0, 296,
- 74438, 0, 0, 67841, 74370, 0, 8922, 0, 74600, 74435, 74836, 0, 12579, 0,
- 12575, 6416, 5656, 2891, 13262, 65590, 5299, 0, 11473, 5449, 1252, 0, 0,
- 41431, 74369, 65373, 5295, 0, 74114, 1223, 1642, 174, 0, 883, 4161,
- 12691, 42603, 41413, 3212, 127025, 3211, 74810, 41425, 127029, 0, 74450,
- 9728, 3846, 8070, 6150, 6636, 4370, 0, 0, 74178, 74587, 74117, 0, 0, 0,
- 4986, 12189, 0, 0, 120499, 917553, 4257, 12104, 119182, 6220, 9004,
- 65561, 0, 0, 0, 68135, 917576, 0, 0, 0, 0, 9890, 0, 12971, 0, 0, 73898,
- 11979, 0, 118900, 0, 0, 9635, 12600, 8871, 0, 0, 0, 6469, 74227, 0,
- 65304, 4679, 10230, 64300, 64867, 3427, 4240, 0, 0, 0, 0, 917952, 0, 0,
- 0, 7282, 0, 65733, 64618, 0, 0, 3494, 74606, 6555, 0, 0, 0, 0, 0, 0, 0,
- 65898, 0, 65312, 5447, 0, 12895, 65593, 4010, 0, 41106, 0, 65804, 0,
- 41105, 0, 65820, 6232, 0, 0, 0, 43608, 119091, 0, 6538, 4335, 0, 3941,
- 41122, 11061, 0, 64892, 9113, 1954, 12155, 0, 42878, 0, 0, 0, 74578, 0,
- 65832, 0, 0, 0, 0, 0, 4586, 0, 350, 10951, 0, 509, 0, 0, 0, 0, 0, 5133,
- 0, 0, 9500, 0, 12162, 64741, 0, 9354, 0, 0, 0, 2496, 11516, 944, 118851,
- 3890, 12168, 1438, 0, 0, 0, 41947, 1220, 120828, 0, 0, 0, 1571, 42630,
- 41949, 42805, 8270, 943, 564, 0, 312, 41980, 0, 0, 0, 8877, 269, 4429,
- 6272, 9617, 1460, 6954, 0, 41120, 65121, 10862, 6060, 41119, 41416,
- 74355, 4173, 0, 0, 0, 1906, 0, 11532, 74073, 0, 0, 1985, 6296, 9582,
- 917895, 64287, 0, 0, 11428, 1730, 2457, 0, 19918, 10469, 0, 0, 7703,
- 8840, 8035, 0, 0, 0, 0, 6129, 0, 0, 0, 0, 7874, 8681, 0, 0, 13136, 0, 0,
- 74278, 63886, 118881, 9605, 73892, 13220, 0, 0, 5514, 0, 9228, 0, 0, 0,
- 5240, 9811, 10012, 3096, 0, 0, 0, 66676, 65873, 0, 0, 0, 9501, 0, 1272,
- 64536, 65465, 64654, 7467, 0, 1467, 10158, 10040, 0, 9519, 0, 0, 0,
- 118899, 12193, 0, 0, 0, 0, 0, 19935, 0, 0, 0, 0, 0, 0, 5275, 0, 0, 8637,
- 0, 0, 3789, 63880, 11471, 43554, 65862, 11474, 66332, 66603, 0, 0, 12042,
- 0, 0, 9537, 3961, 12115, 0, 2605, 4500, 64561, 0, 4981, 0, 0, 63876,
- 11667, 0, 0, 42362, 64686, 4499, 41649, 7589, 0, 0, 3237, 0, 120194, 0,
- 8541, 0, 0, 41866, 0, 0, 0, 0, 0, 43555, 2823, 9559, 0, 41940, 8299,
- 41945, 0, 41941, 3308, 7190, 64880, 8614, 65220, 41493, 0, 41699, 10762,
- 0, 12999, 0, 0, 8106, 4128, 0, 0, 4494, 0, 4012, 10395, 0, 119567, 65447,
- 0, 0, 11004, 695, 739, 696, 7611, 0, 42755, 74802, 9227, 7506, 7510, 0,
- 691, 738, 7511, 7512, 7515, 3868, 688, 41847, 690, 2548, 737, 974, 8003,
- 0, 0, 0, 0, 3985, 0, 65860, 63921, 7051, 74208, 4682, 0, 12809, 6406,
- 4685, 0, 10879, 10347, 4680, 9055, 0, 3851, 8132, 74325, 0, 917907, 0,
- 41958, 119176, 917908, 0, 0, 0, 0, 7643, 42373, 11714, 67587, 43568, 0,
- 11717, 7650, 10594, 64951, 7647, 7649, 0, 7646, 0, 0, 9651, 0, 3891, 0,
- 0, 2337, 1735, 74324, 67860, 5452, 0, 0, 43561, 0, 0, 74146, 1860, 7495,
- 7580, 5812, 7497, 7584, 0, 0, 0, 0, 7727, 0, 8498, 0, 8949, 3065, 0, 0,
- 1569, 0, 12534, 12124, 7690, 0, 12533, 0, 6418, 4543, 0, 6969, 0, 74800,
- 0, 0, 11980, 0, 0, 63894, 0, 12282, 66192, 0, 0, 8850, 74275, 9238, 0, 0,
- 0, 0, 0, 12791, 0, 0, 0, 0, 73732, 12793, 12900, 0, 10950, 0, 0, 12790,
- 41400, 119128, 0, 12792, 0, 0, 1744, 12789, 10366, 12317, 41310, 0,
- 41399, 0, 0, 0, 0, 12690, 0, 0, 0, 0, 41652, 2974, 0, 11315, 0, 278, 0,
- 41405, 119254, 0, 10077, 63853, 74557, 42586, 0, 0, 6002, 0, 43553, 0,
- 67903, 0, 12787, 41308, 7934, 65306, 0, 0, 0, 8646, 0, 0, 0, 0, 6413,
- 6550, 0, 1940, 0, 66223, 220, 65193, 43551, 10678, 10044, 0, 0, 0, 0,
- 6403, 5707, 10393, 0, 0, 66614, 0, 0, 0, 10297, 0, 3742, 0, 3959, 0, 0,
- 0, 2467, 0, 6003, 63844, 6663, 8040, 0, 63845, 4182, 0, 4676, 120501, 0,
- 0, 2510, 0, 10208, 0, 0, 11540, 43546, 12186, 0, 41060, 0, 0, 9083, 0, 0,
- 0, 1559, 63831, 9677, 120260, 0, 65256, 0, 74070, 0, 0, 365, 12056,
- 43027, 0, 41716, 0, 0, 0, 5516, 2845, 7717, 8036, 41717, 73827, 544,
- 12045, 6278, 0, 5515, 0, 0, 0, 0, 43221, 65194, 0, 5517, 0, 0, 0, 67884,
- 0, 67890, 67885, 67880, 67881, 67882, 67883, 0, 0, 67879, 0, 1902, 67887,
- 9638, 12976, 0, 12483, 67872, 41769, 0, 41765, 0, 6667, 67874, 7556,
- 67878, 74351, 11264, 989, 67876, 67889, 0, 1311, 0, 4326, 11000, 63824,
- 13068, 10932, 0, 6917, 0, 0, 949, 917595, 0, 6148, 8605, 42253, 917967,
- 0, 0, 0, 0, 0, 0, 63871, 0, 41796, 1269, 6530, 0, 65057, 0, 5144, 12221,
- 0, 0, 4431, 4331, 0, 0, 41834, 5279, 0, 10336, 8312, 0, 118861, 0, 0,
- 119654, 66036, 0, 0, 6428, 42270, 0, 0, 118866, 0, 5256, 1067, 255,
- 12131, 0, 9493, 0, 41014, 11793, 0, 0, 74394, 43594, 10653, 0, 0, 119632,
- 0, 6560, 7016, 74274, 0, 43556, 3929, 0, 6614, 2768, 0, 9746, 5135,
- 11811, 12796, 11953, 0, 0, 5139, 346, 74303, 6305, 12795, 4675, 5168, 0,
- 0, 74315, 74361, 8253, 8817, 1136, 0, 43563, 0, 0, 0, 65285, 8230, 9365,
- 0, 0, 0, 0, 0, 4041, 0, 2357, 0, 12786, 229, 119885, 119884, 0, 43552,
- 119881, 12350, 65554, 119882, 119877, 119876, 12785, 63863, 119873, 7770,
- 10712, 64853, 12686, 118916, 42375, 0, 0, 66352, 10470, 0, 11059, 10791,
- 0, 450, 0, 0, 10432, 12097, 5450, 64691, 1233, 0, 63856, 0, 66338, 0, 0,
- 1839, 118799, 0, 10927, 1701, 0, 2388, 41749, 41761, 5453, 8361, 119865,
- 41758, 5444, 41763, 64889, 119860, 119863, 119862, 0, 0, 0, 66432, 8801,
- 3053, 4340, 0, 0, 65812, 0, 0, 41824, 0, 194801, 194800, 194803, 118997,
- 194805, 194804, 194807, 194806, 194809, 194808, 0, 0, 4493, 4336, 0,
- 2314, 43602, 0, 119325, 194811, 42439, 64638, 42327, 43528, 4489, 194791,
- 0, 194793, 1912, 42385, 10306, 10370, 0, 0, 8867, 10250, 10258, 2712,
- 1635, 194798, 1410, 0, 0, 118878, 0, 0, 0, 0, 559, 0, 41825, 0, 0, 4892,
- 74016, 194781, 6542, 41957, 0, 5777, 0, 759, 65749, 65750, 65248, 12788,
- 64487, 64552, 0, 10223, 42062, 0, 0, 0, 3668, 65754, 43560, 12226, 0,
- 65149, 2340, 41959, 194786, 194785, 194788, 120154, 65747, 10937, 2962,
- 0, 2321, 3587, 65745, 0, 8921, 66013, 0, 0, 194769, 194768, 194771,
- 194770, 2949, 66012, 194775, 194774, 2958, 194776, 41820, 43038, 2395, 0,
- 0, 120043, 194778, 120058, 194780, 194779, 42809, 42807, 0, 120047,
- 10198, 4150, 64371, 8318, 41790, 0, 41898, 2360, 41794, 917942, 0, 0, 0,
- 0, 2418, 0, 2411, 11336, 799, 63823, 10276, 10308, 10372, 917541, 41772,
- 42813, 2317, 10260, 118980, 119576, 0, 0, 10384, 0, 0, 0, 7753, 2351,
- 6655, 64489, 0, 0, 0, 0, 42779, 230, 0, 0, 43549, 4855, 42150, 65739,
- 5441, 41896, 10288, 10320, 0, 855, 7046, 6109, 65045, 63839, 119116, 0,
- 10098, 0, 74145, 0, 10264, 10280, 9184, 10376, 7013, 4467, 0, 0, 0,
- 41887, 0, 4862, 9735, 6537, 120591, 0, 3914, 119604, 0, 9065, 12961, 0,
- 0, 0, 0, 289, 0, 4694, 11420, 4690, 0, 120514, 0, 4693, 0, 73919, 0,
- 4688, 120454, 0, 0, 119629, 8238, 3110, 120162, 0, 120163, 6528, 0,
- 43035, 120161, 218, 0, 1520, 0, 4786, 0, 43225, 0, 0, 120158, 10088,
- 6548, 0, 120156, 0, 8988, 8888, 0, 0, 0, 0, 10666, 0, 73902, 0, 0, 0, 0,
- 0, 0, 4689, 8932, 0, 65560, 119209, 74441, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 10065, 8207, 0, 0, 0, 0, 662, 0, 9244, 0, 0, 119261, 0, 0, 0, 0, 41929,
- 0, 0, 0, 41926, 0, 120443, 10513, 64637, 0, 0, 52, 13118, 6475, 0, 0,
- 12095, 10225, 4812, 0, 0, 0, 74085, 0, 3978, 0, 0, 0, 11582, 120761,
- 12281, 0, 6544, 13241, 0, 0, 0, 194860, 11765, 65258, 10369, 0, 1585,
- 7192, 10249, 422, 1500, 2036, 986, 194859, 64394, 5781, 5599, 64294,
- 2494, 120450, 4861, 74021, 64334, 0, 0, 0, 0, 65102, 8961, 0, 10243,
- 10245, 0, 0, 0, 120453, 64821, 9478, 2508, 0, 0, 202, 0, 74131, 1242, 0,
- 0, 63940, 0, 64533, 0, 0, 67842, 11990, 0, 63939, 0, 65440, 2504, 0, 0,
- 64829, 0, 6943, 0, 5859, 0, 2858, 0, 74294, 0, 74305, 0, 119027, 12992,
- 2753, 1936, 74491, 0, 2751, 12662, 2763, 8953, 64701, 10731, 12922, 0, 0,
- 0, 0, 0, 0, 74128, 2856, 119910, 47, 119911, 126986, 65858, 0, 0, 0,
- 7899, 0, 8417, 65903, 7072, 0, 0, 4033, 0, 66474, 0, 0, 212, 64600, 1903,
- 12320, 0, 0, 0, 0, 8915, 2759, 945, 0, 0, 0, 0, 0, 1291, 74828, 0, 0,
- 9531, 13155, 8505, 0, 12062, 0, 0, 65487, 0, 41837, 120611, 120432, 0, 0,
- 0, 120433, 0, 63935, 73962, 0, 64787, 43524, 0, 64426, 0, 0, 0, 0, 65664,
- 64785, 9843, 0, 8674, 0, 0, 0, 0, 12624, 0, 1673, 4811, 0, 5986, 9338,
- 3046, 74480, 5985, 917928, 119598, 9820, 0, 12187, 0, 0, 5984, 0, 43308,
- 4393, 0, 0, 0, 0, 0, 74826, 64733, 0, 0, 3491, 0, 0, 0, 3514, 65485, 0,
- 7492, 0, 0, 0, 7514, 0, 0, 194731, 7502, 7587, 0, 0, 0, 63925, 0, 7610,
- 219, 0, 0, 692, 43588, 74433, 41635, 0, 9688, 0, 9535, 0, 0, 0, 0, 0,
- 64610, 11804, 0, 0, 7453, 0, 8013, 0, 0, 0, 8895, 5253, 0, 5458, 0, 2866,
- 0, 0, 65111, 0, 12018, 120484, 0, 0, 0, 8962, 0, 9641, 66653, 7059, 0, 0,
- 9604, 0, 7441, 63826, 0, 118941, 64392, 0, 0, 2844, 0, 41974, 0, 12139,
- 0, 0, 0, 3358, 65295, 0, 3104, 0, 0, 0, 0, 5308, 0, 290, 0, 0, 2862,
- 2792, 195088, 0, 0, 3268, 66591, 0, 6552, 42367, 7035, 120558, 0, 0,
- 1814, 0, 10240, 0, 195092, 0, 119020, 0, 0, 42646, 7606, 2591, 2837,
- 4341, 0, 64482, 0, 8163, 65270, 0, 0, 0, 9112, 74431, 863, 9490, 0, 0,
- 43323, 120513, 0, 9071, 0, 0, 3654, 0, 9637, 0, 2535, 65504, 7653, 40993,
- 0, 66587, 195098, 0, 0, 0, 11006, 12927, 7807, 8073, 0, 10629, 0, 74088,
- 3056, 10823, 0, 0, 8762, 10508, 74506, 73770, 63994, 43193, 10737, 3463,
- 0, 0, 66633, 8695, 4815, 11322, 5811, 12345, 7049, 0, 5195, 0, 0, 66639,
- 0, 0, 0, 0, 0, 120561, 1262, 0, 6561, 19939, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 119907, 64612, 11991, 0, 0, 0, 1502, 0, 0, 9107, 0, 5702, 3655, 0, 8430,
- 0, 74132, 0, 0, 74057, 9603, 0, 5254, 120742, 7724, 74388, 74838, 10796,
- 5129, 0, 0, 590, 7579, 5614, 5893, 194744, 11720, 0, 11721, 0, 0, 0,
- 120541, 66038, 4793, 67851, 11726, 0, 74204, 0, 0, 917600, 894, 300, 0,
- 12306, 66235, 0, 0, 0, 2562, 0, 0, 42503, 0, 11652, 0, 0, 119241, 0, 0,
- 5096, 5095, 2863, 3424, 0, 10454, 42530, 5094, 119638, 0, 13156, 0,
- 10832, 5093, 0, 0, 0, 5092, 10708, 11327, 0, 5091, 176, 0, 9153, 4104, 0,
- 0, 1215, 0, 5744, 12272, 9832, 11777, 0, 0, 42881, 0, 8980, 118988,
- 67861, 8844, 7433, 0, 0, 4278, 0, 0, 0, 0, 9074, 4348, 0, 65558, 65946,
- 8113, 7087, 5255, 1786, 661, 0, 0, 0, 74423, 0, 586, 74414, 64359, 1267,
- 0, 0, 0, 65731, 0, 0, 3621, 0, 66666, 0, 0, 6562, 12928, 0, 1228, 65490,
- 11383, 0, 0, 0, 1714, 74406, 0, 0, 0, 0, 66225, 0, 0, 0, 11436, 119615,
- 64, 0, 0, 10291, 10323, 2826, 0, 0, 0, 42008, 9708, 0, 0, 42011, 41999,
- 0, 12206, 5839, 1702, 1240, 74065, 6286, 0, 0, 65833, 0, 0, 1765, 0, 0,
- 65588, 0, 0, 0, 8401, 0, 42014, 0, 7030, 0, 10479, 64959, 2852, 0, 0, 0,
- 0, 0, 0, 6963, 0, 12667, 0, 74786, 10147, 12935, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 64947, 12467, 2864, 64719, 1148, 10435, 11462, 41675, 0, 2765, 0,
- 0, 0, 0, 0, 0, 66662, 0, 0, 9364, 194685, 74416, 0, 0, 119244, 263,
- 10449, 41288, 0, 41839, 0, 0, 0, 0, 6931, 0, 64355, 7177, 120530, 0, 0,
- 0, 4262, 10285, 10722, 42020, 0, 0, 6992, 42019, 0, 41290, 0, 750, 0, 0,
- 10163, 0, 74066, 7032, 5954, 64931, 4314, 0, 198, 0, 730, 0, 0, 0, 0,
- 13165, 10814, 74171, 42804, 678, 8240, 118960, 0, 41378, 11008, 6938, 0,
- 0, 42812, 66246, 120560, 0, 0, 0, 3892, 0, 0, 0, 66045, 41470, 64805, 0,
- 0, 0, 118982, 0, 497, 12100, 5953, 0, 7796, 0, 0, 73831, 0, 10293, 5952,
- 1281, 0, 0, 0, 10677, 604, 41097, 9182, 1859, 0, 0, 3425, 0, 0, 2836, 0,
- 0, 9707, 0, 43202, 0, 0, 65199, 1738, 0, 0, 2832, 0, 9670, 12937, 0, 0,
- 0, 0, 2822, 0, 4436, 0, 0, 73752, 0, 64872, 0, 1331, 0, 0, 0, 12708, 0,
- 5090, 5089, 0, 0, 119109, 0, 0, 319, 118931, 0, 9477, 0, 0, 5087, 0,
- 7640, 96, 5086, 0, 0, 0, 5085, 64286, 0, 0, 41422, 0, 119901, 42356,
- 3772, 0, 0, 5011, 0, 0, 0, 0, 0, 0, 6677, 7601, 0, 591, 64419, 118953, 0,
- 0, 118923, 0, 0, 10939, 6106, 6933, 41271, 0, 119903, 4534, 41270, 0, 0,
- 65574, 0, 9224, 0, 3671, 8976, 0, 0, 41275, 0, 0, 0, 7963, 42013, 0, 568,
- 0, 41273, 0, 0, 0, 0, 9715, 0, 8258, 11753, 74820, 0, 9602, 118919, 42,
- 0, 0, 0, 0, 7458, 0, 0, 65385, 0, 0, 11958, 0, 0, 0, 6254, 0, 66336,
- 8045, 11550, 0, 0, 0, 42858, 11789, 65868, 5557, 917946, 9737, 13109, 0,
- 9467, 5558, 8878, 0, 195036, 7451, 7435, 10146, 0, 9086, 64566, 0, 64584,
- 7437, 7454, 12594, 0, 0, 4546, 7731, 0, 917948, 74243, 0, 3805, 0, 0, 0,
- 41008, 0, 6307, 19949, 0, 7544, 0, 43525, 0, 0, 10152, 64422, 65091,
- 119113, 7602, 64729, 0, 43521, 0, 42302, 0, 43523, 41447, 5559, 0, 8704,
- 2397, 5556, 0, 0, 0, 9011, 9630, 0, 0, 0, 5506, 0, 1911, 66652, 0, 12598,
- 8845, 66698, 0, 10792, 8889, 0, 6951, 0, 64751, 0, 66622, 0, 0, 74364, 0,
- 0, 0, 74365, 7552, 0, 0, 65384, 7223, 4559, 0, 1956, 43138, 7024, 65728,
- 64501, 1210, 0, 65175, 10184, 43140, 65727, 0, 0, 0, 38, 8533, 66669, 0,
- 0, 0, 0, 4357, 0, 0, 0, 74233, 119846, 119852, 42860, 119838, 10941,
- 65721, 6962, 0, 0, 0, 0, 11014, 0, 8942, 12000, 0, 0, 0, 11974, 0, 42772,
- 0, 11650, 5013, 0, 0, 66210, 118914, 6613, 0, 0, 0, 0, 0, 64714, 0, 0, 0,
- 12120, 0, 0, 11024, 74811, 0, 10563, 0, 0, 43522, 2462, 0, 1837, 0,
- 63972, 6957, 0, 120559, 4952, 65718, 65827, 5504, 65720, 65714, 65715,
- 65716, 0, 127005, 127119, 3109, 63975, 74028, 0, 8107, 119234, 1127, 455,
- 0, 0, 0, 3483, 127122, 1989, 0, 0, 9104, 3503, 65375, 0, 0, 42633, 1864,
- 0, 74306, 41446, 2540, 7736, 0, 74064, 0, 10521, 0, 42173, 9705, 74124,
- 8604, 6955, 10916, 0, 6149, 3887, 19956, 1411, 2824, 0, 10106, 0, 1403,
- 0, 1347, 9631, 74444, 0, 0, 0, 0, 8640, 0, 258, 1654, 0, 0, 0, 43314, 0,
- 0, 4042, 11478, 2873, 63977, 11522, 41668, 8549, 10861, 0, 0, 0, 0, 0,
- 74585, 41391, 0, 917903, 376, 6987, 9221, 0, 0, 8823, 0, 12943, 65185,
- 41869, 12619, 0, 10154, 0, 74439, 2039, 0, 7446, 1684, 63979, 10974, 458,
- 120620, 0, 0, 0, 11916, 65016, 0, 0, 42115, 0, 12288, 0, 0, 1493, 42111,
- 7553, 4097, 0, 13080, 0, 65808, 6610, 6030, 8059, 7508, 41636, 0, 0, 0,
- 8794, 41278, 41629, 12154, 0, 41277, 64658, 0, 64380, 6625, 0, 19904, 0,
- 0, 0, 65371, 7078, 0, 833, 0, 74592, 0, 10979, 41953, 0, 41434, 6062, 0,
- 0, 19916, 6913, 933, 1341, 9842, 0, 65744, 0, 0, 0, 0, 41615, 10105,
- 65810, 0, 41632, 7493, 0, 0, 41622, 0, 0, 119556, 74584, 7632, 9716,
- 19954, 9805, 5990, 900, 0, 63957, 0, 0, 3612, 0, 64376, 0, 5389, 0, 0,
- 65938, 2839, 9621, 582, 0, 74368, 3749, 6949, 7569, 74061, 0, 0, 6956,
- 4403, 19962, 65559, 3299, 0, 0, 119127, 9002, 0, 74372, 74236, 8478,
+ 42850, 13035, 9075, 92387, 5466, 128153, 0, 64098, 65793, 4535, 194573,
+ 4271, 78417, 128357, 6769, 41410, 0, 64262, 6767, 41407, 0, 0, 6755,
+ 118864, 9046, 127934, 0, 0, 0, 0, 0, 67675, 0, 0, 0, 64338, 2563, 13033,
+ 247, 118915, 0, 12338, 4651, 0, 11270, 0, 0, 11933, 0, 0, 41903, 43447,
+ 11001, 0, 42255, 0, 92661, 69821, 41905, 0, 0, 10775, 9793, 5009, 0,
+ 42269, 64587, 0, 42535, 69812, 64529, 41408, 42853, 3877, 120795, 42674,
+ 8147, 43566, 119021, 0, 10236, 65918, 43782, 0, 0, 64506, 69652, 118921,
+ 4747, 128058, 0, 43200, 5832, 0, 0, 5141, 42600, 0, 43203, 0, 0, 43286,
+ 0, 128211, 43778, 0, 41305, 78776, 43781, 11303, 65547, 0, 7031, 859, 0,
+ 0, 0, 6059, 126985, 55235, 0, 8535, 0, 65196, 194787, 66032, 11488, 0,
+ 120786, 42233, 64140, 9946, 63885, 0, 11822, 0, 43189, 0, 0, 1788, 1579,
+ 120482, 917817, 0, 0, 0, 9028, 119571, 69234, 0, 0, 1285, 64882, 41242,
+ 0, 0, 12640, 0, 7401, 0, 12625, 68198, 0, 92254, 3940, 41597, 55260,
+ 3396, 12642, 8665, 0, 0, 12630, 1653, 917815, 10153, 0, 6166, 120516,
+ 120523, 0, 8815, 66673, 65046, 9285, 913, 42259, 119317, 119318, 2142,
+ 68454, 42485, 118837, 7878, 8211, 42293, 64377, 0, 92643, 0, 194673,
+ 12032, 0, 9725, 0, 78431, 5263, 12818, 78430, 41939, 10022, 65387, 78419,
+ 42777, 10139, 980, 43698, 65386, 0, 0, 43701, 43198, 7184, 120673,
+ 194797, 917819, 10085, 119992, 0, 119993, 6634, 92373, 0, 119323, 8072,
+ 119321, 43700, 0, 8872, 7783, 917992, 12398, 8237, 0, 0, 12395, 0,
+ 126977, 120565, 9914, 127011, 917854, 73975, 6367, 6351, 66688, 0, 78107,
+ 0, 64735, 41243, 92199, 7808, 1829, 0, 41937, 4358, 43272, 6353, 0, 0,
+ 120422, 0, 1710, 0, 0, 65607, 0, 49, 6627, 0, 6258, 10683, 78672, 9741,
+ 78329, 5649, 78441, 43443, 64418, 1643, 65213, 8405, 3470, 128225, 13213,
+ 42452, 78331, 0, 78445, 0, 1072, 78457, 78452, 78454, 6576, 41988, 41132,
+ 65675, 1080, 120002, 9886, 55225, 1101, 68404, 12309, 55227, 0, 12632,
+ 1086, 1869, 78685, 7680, 0, 65458, 120714, 12639, 3380, 8123, 1091,
+ 12638, 7977, 4501, 41099, 0, 66309, 0, 0, 1494, 0, 0, 0, 11693, 0, 10494,
+ 92655, 65872, 12363, 11386, 0, 0, 0, 0, 64582, 0, 73794, 0, 8022, 0,
+ 120462, 74106, 12413, 194829, 917994, 0, 917995, 5570, 1881, 7210, 0,
+ 1012, 66630, 0, 120709, 7208, 66442, 5569, 0, 42339, 0, 6063, 0, 0,
+ 119594, 6053, 65602, 0, 92201, 64727, 9160, 194827, 0, 0, 92180, 10503,
+ 118810, 6055, 3870, 4279, 8490, 120114, 4319, 64786, 8602, 120110, 11326,
+ 92204, 0, 0, 120119, 78333, 120117, 120118, 120099, 120100, 65087, 5571,
+ 3674, 9740, 9121, 5568, 120107, 120108, 42085, 10107, 42159, 42870,
+ 120101, 589, 7050, 0, 43281, 10233, 41263, 66251, 65729, 66253, 0, 74099,
+ 42645, 0, 194815, 8583, 0, 5847, 6928, 0, 0, 0, 0, 0, 66592, 12204,
+ 917962, 19966, 77856, 42561, 120626, 0, 0, 8120, 120701, 0, 0, 128012,
+ 41063, 0, 10664, 0, 8369, 0, 4551, 194964, 3369, 0, 0, 9673, 66334,
+ 65580, 10478, 118960, 12517, 557, 9457, 12034, 0, 6355, 12519, 41004, 0,
+ 195025, 74094, 0, 0, 77970, 0, 0, 128175, 12111, 3927, 0, 12515, 1474,
+ 67893, 5492, 6923, 128099, 10441, 73836, 0, 43990, 5493, 0, 74319, 0,
+ 66635, 12019, 0, 1618, 0, 120474, 9645, 10430, 917959, 5853, 13063,
+ 10363, 0, 12956, 128169, 120729, 11314, 917582, 12060, 0, 78392, 12826,
+ 6329, 0, 10514, 65517, 74395, 2707, 8309, 0, 127054, 78398, 43570, 2697,
+ 43420, 78396, 127057, 2695, 42171, 0, 0, 0, 67617, 118971, 0, 2693,
+ 12125, 12766, 0, 1164, 0, 0, 41918, 0, 127542, 8687, 66009, 12178, 7053,
+ 128001, 7469, 0, 5248, 12218, 120538, 6427, 42884, 41123, 0, 0, 42873,
+ 41126, 9991, 41128, 74371, 127031, 0, 9873, 0, 42877, 7994, 64762, 2053,
+ 42843, 6591, 9340, 0, 1589, 0, 296, 74438, 78852, 0, 67841, 74370, 0,
+ 8922, 128068, 74600, 12700, 74836, 0, 12579, 0, 12575, 6416, 5656, 2891,
+ 13262, 65590, 5299, 0, 11473, 5449, 1252, 0, 78404, 41431, 74369, 65373,
+ 5295, 917569, 74114, 1223, 1642, 174, 78399, 883, 4161, 12691, 42603,
+ 41413, 3212, 41459, 3211, 74810, 41425, 127029, 78412, 74450, 9728, 3846,
+ 8070, 6150, 6636, 4370, 0, 0, 74178, 74587, 74117, 0, 0, 0, 4986, 12189,
+ 0, 67648, 120499, 917553, 4257, 12104, 77942, 6220, 9004, 65561, 0,
+ 77949, 0, 68135, 917576, 77946, 0, 69679, 69684, 9890, 78561, 12971,
+ 78453, 92556, 73898, 11979, 0, 118900, 917894, 0, 9635, 12600, 8871, 0,
+ 0, 0, 6469, 74227, 0, 65304, 4679, 10230, 64300, 64867, 3427, 4240, 0, 0,
+ 0, 0, 42916, 0, 0, 0, 7282, 78728, 65733, 4445, 127138, 128082, 3494,
+ 74606, 6555, 0, 77976, 0, 0, 78566, 0, 0, 65898, 0, 65312, 5447, 0,
+ 12895, 65593, 4010, 0, 41106, 0, 64448, 0, 41105, 0, 65820, 6232, 0,
+ 128280, 0, 43608, 119091, 0, 6538, 4335, 78364, 3941, 41122, 11061,
+ 78363, 64892, 9113, 1954, 12155, 0, 42878, 11500, 0, 0, 74578, 0, 65832,
+ 0, 0, 0, 77975, 119230, 4586, 0, 350, 10951, 0, 509, 0, 0, 92307, 0, 0,
+ 5133, 0, 0, 9500, 0, 4957, 64741, 2422, 9354, 0, 0, 0, 2496, 11516, 944,
+ 118851, 3890, 12168, 1438, 0, 0, 0, 41947, 1220, 120828, 128555, 0, 0,
+ 1571, 42630, 41949, 42805, 8270, 943, 564, 0, 312, 41980, 0, 0, 78120,
+ 8877, 269, 4429, 6272, 9617, 1460, 6954, 78657, 41120, 65121, 10862,
+ 6060, 41119, 41416, 74355, 4173, 0, 0, 0, 1906, 917986, 11532, 74073, 0,
+ 0, 1985, 6296, 9582, 917895, 64287, 0, 78115, 11428, 1730, 2457, 0,
+ 19918, 10469, 0, 0, 7703, 8840, 8035, 0, 0, 92491, 0, 6129, 0, 0, 128268,
+ 0, 7874, 8681, 119092, 0, 13136, 0, 0, 74278, 63886, 118881, 9605, 73892,
+ 13220, 128776, 120274, 5514, 0, 9228, 0, 0, 0, 5240, 9811, 10012, 3096,
+ 0, 0, 0, 66676, 65873, 0, 0, 0, 9501, 0, 1272, 64536, 65465, 64654, 7467,
+ 0, 1467, 10158, 10040, 0, 9519, 0, 917812, 0, 118899, 12193, 0, 0, 0, 0,
+ 0, 19935, 0, 92162, 69676, 0, 0, 0, 5275, 0, 0, 8637, 0, 0, 3789, 63880,
+ 11471, 43554, 65862, 11474, 66332, 66603, 128138, 2426, 12042, 92194, 0,
+ 9537, 3961, 12115, 77953, 2605, 4500, 64561, 55224, 4981, 0, 0, 63876,
+ 11667, 42686, 77973, 42362, 64686, 4499, 41649, 7589, 0, 0, 3237, 0,
+ 68215, 0, 8541, 78298, 0, 41866, 0, 0, 0, 0, 0, 43555, 2823, 9559, 10060,
+ 41940, 8299, 41945, 7132, 41941, 3308, 7190, 64880, 8614, 65220, 41493,
+ 0, 41699, 10762, 43780, 12999, 0, 0, 8106, 4128, 0, 0, 4494, 0, 4012,
+ 10395, 0, 43633, 65447, 0, 0, 11004, 695, 739, 696, 7611, 0, 42755,
+ 74802, 9227, 7506, 7510, 92281, 691, 738, 7511, 7512, 7515, 3868, 688,
+ 41847, 690, 2548, 737, 974, 8003, 7406, 917911, 0, 0, 3985, 917912,
+ 65860, 63921, 7051, 69777, 4682, 917805, 12809, 6406, 4685, 92505, 10879,
+ 10347, 4680, 6341, 0, 3851, 8132, 74325, 0, 917907, 0, 41958, 119176,
+ 917908, 0, 0, 42657, 92468, 7643, 42373, 11714, 67587, 43568, 0, 11717,
+ 7650, 10594, 64951, 7647, 7649, 128155, 7646, 0, 78082, 9651, 0, 3891, 0,
+ 0, 2337, 1735, 74324, 67860, 2363, 0, 0, 43561, 0, 0, 74146, 1860, 7495,
+ 7580, 5812, 7497, 7584, 119140, 127853, 0, 120347, 7727, 0, 8498, 69818,
+ 8949, 3065, 42719, 7135, 1569, 92375, 12534, 12124, 7690, 0, 12533, 0,
+ 6418, 4543, 78086, 6969, 0, 74800, 0, 0, 11980, 128650, 0, 63894, 120760,
+ 12282, 66192, 0, 74592, 8850, 74275, 9238, 10617, 917545, 0, 92625, 0,
+ 12791, 0, 0, 0, 4447, 73732, 12793, 12900, 92377, 10950, 0, 78087, 12790,
+ 41400, 119128, 66607, 12792, 42232, 194938, 1744, 12789, 10366, 12317,
+ 41310, 0, 41399, 0, 0, 55258, 0, 12690, 0, 0, 43672, 127840, 41652, 2974,
+ 9010, 11315, 0, 278, 0, 41405, 119254, 0, 10077, 63853, 74557, 42586, 0,
+ 0, 6002, 0, 43553, 0, 67903, 0, 12787, 41308, 7934, 65306, 0, 0, 0, 8646,
+ 0, 77829, 0, 0, 6413, 6550, 0, 1940, 0, 43637, 220, 65193, 43551, 10678,
+ 10044, 0, 0, 0, 68659, 6403, 5707, 10393, 127532, 0, 66614, 0, 0, 0,
+ 10297, 0, 3742, 0, 3959, 0, 0, 0, 2467, 0, 6003, 63844, 6663, 8040, 0,
+ 63845, 4182, 78171, 4676, 120501, 0, 0, 2510, 0, 10208, 78168, 92361,
+ 11540, 43546, 6692, 0, 41060, 0, 0, 9083, 0, 0, 78144, 1559, 63831, 9677,
+ 120260, 0, 65256, 0, 74070, 0, 0, 365, 12056, 43027, 120423, 41716,
+ 128236, 0, 120472, 5516, 2845, 7717, 8036, 41717, 73827, 544, 12045,
+ 6278, 0, 5515, 0, 0, 0, 65339, 43221, 65194, 0, 5517, 0, 0, 74841, 67884,
+ 0, 67890, 67885, 67880, 67881, 67882, 67883, 0, 0, 67879, 127188, 1902,
+ 67887, 9638, 12976, 0, 12483, 12368, 41769, 42726, 41765, 128819, 6667,
+ 67874, 7556, 67878, 74351, 11264, 989, 42677, 67889, 0, 1311, 917966,
+ 4326, 11000, 63824, 13068, 10932, 128880, 6917, 78155, 0, 949, 78162, 0,
+ 6148, 8605, 42253, 78177, 0, 0, 42715, 0, 0, 0, 63871, 0, 41796, 1269,
+ 6530, 0, 65057, 0, 5144, 12221, 42716, 0, 4431, 4331, 0, 128675, 41834,
+ 5279, 0, 10336, 8312, 0, 42701, 128825, 0, 78165, 66036, 0, 0, 6428,
+ 42270, 0, 0, 43059, 42666, 5256, 1067, 255, 12131, 0, 9493, 0, 41014,
+ 11793, 0, 0, 74394, 43460, 10653, 42723, 0, 119632, 0, 6560, 7016, 74274,
+ 0, 43556, 3929, 73900, 6614, 2768, 92504, 9746, 5135, 11811, 12796,
+ 11953, 0, 69761, 5139, 346, 74303, 6305, 12795, 4675, 5168, 78552,
+ 127753, 74315, 74361, 8253, 8817, 1136, 0, 43563, 92232, 0, 194750, 7392,
+ 8230, 9365, 0, 0, 0, 0, 0, 4041, 0, 2357, 43240, 12786, 229, 119885,
+ 119884, 44004, 7142, 119881, 12350, 65554, 119882, 119877, 119876, 12785,
+ 63863, 43795, 7770, 10712, 64853, 12686, 118916, 42375, 0, 127238, 66352,
+ 10470, 0, 11059, 10791, 917944, 450, 0, 0, 10432, 12097, 5450, 64691,
+ 1233, 0, 44009, 78284, 66338, 0, 0, 1839, 118799, 0, 10927, 1701, 0,
+ 2388, 41749, 41761, 5453, 8361, 119865, 41758, 5444, 41763, 64889, 7143,
+ 92493, 78677, 0, 92429, 78174, 66432, 8801, 3053, 4340, 0, 0, 65812,
+ 917831, 0, 41824, 0, 120203, 194800, 194803, 42700, 194805, 127980,
+ 194807, 78676, 92356, 194808, 0, 0, 4493, 4336, 0, 2314, 43602, 78826,
+ 119325, 194811, 42439, 64638, 42327, 43528, 4489, 194791, 0, 194793,
+ 1912, 42385, 10306, 10370, 0, 0, 8867, 10250, 10258, 2712, 1635, 78821,
+ 1410, 92671, 0, 118878, 0, 0, 9919, 0, 559, 128157, 41825, 127975, 78188,
+ 4892, 74016, 194781, 6542, 41957, 128865, 5777, 0, 759, 65749, 2079,
+ 65248, 12788, 64487, 64552, 0, 10223, 42062, 0, 0, 0, 3668, 65754, 43560,
+ 12226, 0, 65149, 2340, 41959, 194786, 194785, 194788, 43618, 65747,
+ 10937, 2962, 0, 2321, 3587, 65745, 92436, 8921, 9952, 0, 0, 42714, 9951,
+ 43409, 194770, 2949, 66012, 194775, 194774, 2958, 68359, 41820, 43038,
+ 2395, 0, 9976, 120043, 120050, 120058, 68220, 128143, 42809, 42807, 0,
+ 120046, 10198, 4150, 64371, 8318, 41790, 0, 41898, 2360, 41794, 917942,
+ 0, 127818, 0, 0, 2418, 0, 2411, 11336, 799, 63823, 10276, 10308, 10372,
+ 917541, 41772, 42813, 2317, 10260, 118980, 55284, 92203, 0, 10384, 0, 0,
+ 0, 7753, 2351, 6655, 64489, 0, 0, 77872, 4443, 42779, 230, 0, 0, 43549,
+ 4855, 42150, 65739, 5441, 41896, 10288, 10320, 0, 855, 7046, 6109, 65045,
+ 63839, 78198, 2049, 10098, 0, 74145, 127943, 10264, 10280, 9184, 10376,
+ 7013, 4467, 0, 0, 0, 41887, 0, 4862, 9735, 6537, 120591, 74286, 3914,
+ 92178, 0, 9065, 12961, 0, 0, 92253, 0, 289, 0, 4694, 11420, 4690, 0,
+ 120514, 917978, 4693, 0, 42724, 0, 4688, 120454, 0, 0, 119629, 8238,
+ 3110, 120162, 0, 120163, 6528, 127553, 43035, 120161, 218, 0, 1520, 0,
+ 4786, 0, 43225, 4602, 0, 78167, 10088, 6548, 0, 120156, 43978, 8988,
+ 8888, 0, 0, 0, 0, 10666, 0, 73902, 69740, 0, 0, 9975, 0, 119902, 4689,
+ 8932, 0, 65560, 119209, 74441, 78810, 0, 0, 0, 0, 0, 0, 0, 0, 10065,
+ 8207, 0, 92613, 128011, 0, 662, 0, 9244, 194863, 0, 119261, 0, 0, 0, 0,
+ 41929, 0, 0, 66674, 41926, 120408, 120443, 10513, 64637, 194862, 0, 52,
+ 13118, 6475, 0, 120341, 12095, 10225, 4812, 92578, 0, 0, 74085, 0, 3978,
+ 0, 917945, 127823, 11582, 120761, 12281, 0, 6544, 13241, 0, 69782,
+ 128557, 194860, 11765, 65258, 10369, 0, 1585, 7192, 10249, 422, 1500,
+ 2036, 986, 194859, 64394, 5781, 5599, 64294, 2494, 120450, 4861, 74021,
+ 64334, 78203, 127808, 0, 92266, 65102, 8961, 65842, 10243, 10245, 917933,
+ 120410, 0, 120453, 64821, 9478, 2508, 92683, 0, 202, 128246, 74131, 1242,
+ 65514, 0, 63940, 128706, 64533, 120129, 0, 67842, 11990, 92430, 63939,
+ 43375, 65440, 2504, 0, 78671, 64829, 0, 6943, 917934, 5859, 0, 2858, 0,
+ 74294, 0, 69239, 0, 119027, 12992, 2753, 1936, 74491, 92574, 2751, 12662,
+ 2763, 8953, 64701, 10731, 12922, 7052, 917839, 0, 0, 0, 63920, 74128,
+ 2856, 119910, 47, 119911, 126986, 65858, 0, 0, 0, 7899, 0, 8417, 43798,
+ 7072, 0, 0, 4033, 128164, 43992, 0, 0, 212, 64600, 1903, 12320, 0, 0, 0,
+ 0, 8915, 2759, 945, 6689, 0, 0, 0, 0, 1291, 74828, 0, 0, 9531, 13155,
+ 8505, 68379, 12062, 0, 0, 65487, 92189, 41837, 120611, 120432, 0, 0, 0,
+ 120433, 0, 63935, 73962, 120806, 64787, 43524, 0, 64426, 0, 194948, 0, 0,
+ 65664, 6693, 9843, 0, 8674, 119887, 128812, 92715, 0, 12624, 0, 1673,
+ 4811, 92383, 5986, 9338, 3046, 74480, 5985, 917928, 119598, 9820, 0,
+ 12187, 0, 0, 5984, 0, 43308, 4393, 0, 0, 0, 0, 0, 74826, 64733, 0, 0,
+ 3491, 0, 0, 128219, 3514, 65485, 0, 7492, 0, 74605, 92483, 7514, 0, 0,
+ 194731, 7502, 7587, 68353, 0, 0, 63925, 0, 7610, 219, 0, 0, 692, 43588,
+ 74433, 41635, 43241, 9688, 7147, 9535, 0, 0, 0, 64530, 0, 64610, 11804,
+ 0, 7149, 7453, 0, 8013, 0, 92301, 0, 8895, 5253, 0, 5458, 0, 2866, 0,
+ 127860, 65111, 68433, 6700, 120484, 0, 0, 0, 8962, 77960, 9641, 43694,
+ 7059, 0, 0, 9604, 78700, 7441, 63826, 78706, 118941, 64392, 194735, 0,
+ 2844, 0, 41974, 0, 12139, 0, 0, 0, 3358, 65295, 0, 3104, 194734, 0,
+ 194765, 0, 5308, 0, 290, 0, 0, 2862, 2792, 195088, 0, 0, 3268, 66591, 0,
+ 6552, 42367, 7035, 120558, 0, 0, 1814, 0, 10240, 92338, 74305, 0, 74528,
+ 65903, 0, 42646, 7606, 2591, 2837, 4341, 77956, 64482, 127337, 8163,
+ 65270, 0, 0, 0, 9112, 74431, 863, 9490, 119898, 917837, 43323, 120513,
+ 119897, 9071, 127333, 0, 3654, 7789, 9637, 0, 2535, 65504, 7653, 40993,
+ 119899, 66587, 195098, 0, 92401, 0, 11006, 12927, 7807, 8073, 0, 10629,
+ 0, 74088, 3056, 10823, 128797, 127327, 8762, 10508, 69689, 73770, 43969,
+ 43193, 10737, 3463, 0, 0, 66633, 8695, 4815, 11322, 5811, 12345, 7049, 0,
+ 5195, 195081, 0, 66639, 0, 0, 0, 128041, 0, 92385, 1262, 0, 6561, 19939,
+ 0, 0, 0, 119906, 0, 0, 0, 0, 0, 119907, 64612, 11991, 0, 0, 0, 1502, 0,
+ 0, 9107, 127316, 5702, 3655, 67661, 8430, 0, 74132, 120758, 0, 74057,
+ 9603, 0, 5254, 120742, 7724, 74388, 68375, 10796, 5129, 0, 0, 590, 7579,
+ 5614, 5893, 92280, 11720, 92496, 11721, 0, 4798, 0, 119316, 66038, 4793,
+ 67851, 11726, 127541, 74204, 68610, 0, 68626, 894, 300, 917813, 12306,
+ 66235, 8004, 0, 0, 2562, 0, 0, 42503, 0, 11652, 0, 0, 119241, 92649, 0,
+ 5096, 5095, 2863, 3424, 92244, 10454, 42530, 5094, 119638, 0, 13156, 0,
+ 10832, 5093, 0, 0, 0, 5092, 10708, 11327, 0, 5091, 176, 0, 9153, 4104,
+ 78599, 78601, 1215, 42712, 5744, 12272, 9832, 11777, 0, 127371, 42881, 0,
+ 8980, 118988, 67861, 8844, 7209, 0, 0, 4278, 0, 0, 194789, 0, 9074, 4348,
+ 0, 65558, 65946, 8113, 7087, 5255, 1786, 661, 0, 0, 0, 74423, 0, 586,
+ 74414, 64359, 1267, 0, 65468, 0, 65731, 0, 127179, 3621, 120473, 66666,
+ 64211, 0, 6562, 12928, 0, 1228, 65490, 11383, 0, 0, 0, 1714, 74406,
+ 127831, 0, 0, 0, 66225, 0, 0, 42660, 11436, 2070, 64, 120694, 0, 10291,
+ 10323, 2826, 0, 0, 0, 42008, 9708, 42710, 0, 42011, 41999, 92164, 12206,
+ 5839, 1702, 1240, 74065, 6286, 0, 0, 65833, 77848, 0, 1765, 0, 0, 65588,
+ 0, 0, 0, 8401, 0, 42014, 0, 7030, 194704, 10479, 64959, 2852, 0, 0, 0, 0,
+ 128586, 917951, 6963, 0, 12667, 64540, 74786, 10147, 12935, 127568, 0, 0,
+ 0, 0, 78757, 0, 0, 0, 0, 9994, 12467, 2864, 64719, 1148, 10435, 11462,
+ 41675, 0, 2765, 0, 0, 0, 120719, 128188, 92516, 66662, 0, 78133, 9364,
+ 194685, 74416, 0, 0, 77988, 263, 10449, 41288, 0, 41839, 78387, 0, 77986,
+ 0, 6931, 69722, 64355, 7177, 120530, 0, 0, 0, 4262, 10285, 10722, 42020,
+ 0, 6806, 6992, 42019, 0, 41290, 0, 750, 0, 0, 10163, 63913, 74066, 7032,
+ 5954, 64931, 4314, 0, 198, 68453, 730, 120094, 63907, 77993, 78891,
+ 13165, 7107, 74171, 42804, 678, 8240, 78015, 128784, 41378, 11008, 6938,
+ 92222, 92637, 2097, 66246, 120560, 0, 0, 0, 3892, 68632, 69642, 6712,
+ 66045, 41470, 64805, 0, 0, 0, 64801, 0, 497, 12100, 5953, 92667, 7796,
+ 69669, 43254, 73831, 0, 10293, 5952, 1281, 0, 0, 0, 10677, 604, 41097,
+ 9182, 1859, 0, 92603, 3425, 127488, 0, 2836, 0, 0, 9707, 0, 43202, 0, 0,
+ 65199, 1738, 917818, 128158, 2832, 92702, 9670, 12937, 0, 66374, 917956,
+ 0, 2822, 68122, 4436, 92519, 0, 73752, 0, 64872, 92340, 1331, 0, 0, 0,
+ 12708, 0, 5090, 5089, 0, 0, 119109, 0, 128681, 319, 118847, 43479, 9477,
+ 0, 0, 5087, 92325, 7640, 96, 5086, 0, 92379, 0, 5085, 64286, 92665, 0,
+ 41422, 0, 119901, 42356, 3772, 0, 0, 5011, 0, 0, 0, 0, 127165, 127241,
+ 6677, 7601, 0, 591, 64419, 118953, 92262, 0, 118923, 73734, 0, 10939,
+ 6106, 6933, 41271, 6760, 119903, 4534, 41270, 128876, 0, 65574, 0, 9224,
+ 0, 3671, 8976, 0, 0, 41275, 6372, 128084, 55261, 7963, 6371, 0, 568, 0,
+ 41273, 0, 0, 6728, 0, 9715, 0, 8258, 11753, 74820, 0, 9602, 118919, 42,
+ 0, 43688, 0, 0, 7458, 0, 0, 65385, 119900, 0, 11958, 0, 917822, 0, 6254,
+ 42721, 66336, 8045, 11550, 0, 0, 0, 42858, 11789, 65868, 5557, 10133,
+ 9737, 13109, 0, 9467, 5558, 8878, 128136, 195036, 7451, 6706, 10146, 0,
+ 9086, 64566, 0, 64584, 7437, 7454, 12594, 128690, 68362, 4546, 7731, 0,
+ 119909, 74243, 0, 3805, 0, 194565, 44001, 41008, 0, 6307, 19949, 0, 7544,
+ 0, 43469, 0, 0, 10152, 64422, 65091, 119113, 7602, 64729, 0, 43521, 0,
+ 42302, 43711, 43523, 41447, 5559, 0, 8704, 2397, 5556, 0, 0, 0, 9011,
+ 9630, 92633, 0, 0, 5506, 0, 1911, 66652, 0, 9961, 8845, 66698, 0, 10792,
+ 8889, 0, 2098, 0, 64751, 0, 66622, 0, 0, 74364, 0, 0, 0, 74365, 7552, 0,
+ 0, 65384, 7223, 4559, 0, 1956, 43138, 7024, 65728, 64501, 1210, 195077,
+ 65175, 10184, 43140, 43654, 0, 0, 0, 38, 8533, 66669, 119124, 0, 0, 0,
+ 4357, 0, 119837, 0, 74233, 9967, 119852, 42860, 119838, 10941, 65721,
+ 6962, 0, 0, 119324, 0, 11014, 127972, 8942, 12000, 69224, 92267, 128536,
+ 11974, 92213, 42772, 127518, 11650, 5013, 92663, 128677, 66210, 118914,
+ 6613, 92476, 0, 43819, 0, 0, 64714, 0, 0, 12162, 12120, 43476, 0, 11024,
+ 74811, 66228, 10563, 0, 127196, 43522, 2462, 0, 1837, 0, 63972, 6957, 0,
+ 120559, 4952, 65718, 65827, 5504, 65720, 65714, 65715, 65716, 0, 127005,
+ 127119, 3109, 63975, 74028, 0, 8107, 119234, 1127, 455, 0, 63968, 127924,
+ 3483, 119593, 1989, 0, 69678, 9104, 3503, 65375, 92509, 6694, 42633,
+ 1864, 0, 74306, 41446, 2540, 7736, 0, 74064, 0, 10521, 0, 42173, 9705,
+ 74124, 8604, 6955, 10916, 43684, 6149, 3887, 19956, 1411, 2824, 0, 10106,
+ 127862, 1403, 128839, 1347, 9631, 74444, 0, 0, 0, 0, 8640, 0, 258, 1654,
+ 0, 0, 0, 43314, 0, 0, 4042, 11478, 2873, 63977, 11522, 41668, 8549,
+ 10861, 0, 63976, 0, 68623, 0, 74585, 41391, 0, 917903, 376, 6987, 9221,
+ 0, 0, 8823, 128697, 12943, 65185, 41869, 12619, 0, 10154, 0, 74439, 2039,
+ 0, 7446, 1684, 63979, 10974, 458, 120620, 0, 69791, 127161, 11916, 65016,
+ 0, 69671, 42115, 0, 12288, 78057, 0, 1493, 42111, 7553, 4097, 128199,
+ 13080, 0, 65808, 6610, 6030, 8059, 7508, 13131, 0, 0, 0, 8794, 41278,
+ 41629, 12154, 128192, 41277, 64658, 0, 64380, 6625, 74354, 19904, 0, 0,
+ 0, 65371, 7078, 0, 833, 0, 6369, 0, 10979, 41953, 0, 41434, 6062, 0, 0,
+ 19916, 6913, 933, 1341, 9842, 6720, 65744, 0, 0, 128295, 0, 7405, 10105,
+ 65810, 0, 41632, 7493, 55290, 0, 41622, 0, 0, 119556, 74584, 7632, 9716,
+ 19954, 9805, 5990, 900, 0, 63957, 0, 0, 3612, 0, 64376, 0, 5389, 92597,
+ 0, 65938, 2839, 9621, 582, 0, 74368, 3749, 6949, 7569, 74061, 0, 0, 6956,
+ 4403, 19962, 65559, 3299, 0, 917566, 119127, 9002, 0, 74372, 74236, 8478,
7598, 546, 42469, 65569, 1918, 9542, 472, 7716, 10319, 10383, 6996, 0,
- 63952, 8425, 3602, 8328, 11764, 118894, 0, 0, 41183, 12907, 10271, 10287,
- 684, 74185, 0, 2854, 119586, 4592, 65755, 0, 0, 11963, 65753, 0, 0, 0, 0,
- 0, 9881, 0, 65757, 3415, 0, 0, 8648, 0, 118886, 43047, 0, 13180, 0, 418,
- 0, 0, 10295, 10327, 10391, 41752, 74339, 8641, 41449, 0, 0, 0, 10911,
- 6942, 0, 1024, 42849, 41751, 0, 8941, 0, 4554, 0, 9023, 11685, 0, 0, 0,
- 0, 11437, 0, 0, 120700, 63967, 0, 41206, 120724, 9049, 41185, 43166, 0,
- 11680, 0, 11686, 0, 65224, 4565, 4655, 119553, 0, 0, 64523, 10343, 10407,
- 0, 66671, 11466, 0, 0, 42890, 0, 12050, 194750, 2860, 0, 0, 0, 42792,
- 5743, 10424, 12065, 42872, 0, 0, 0, 8875, 0, 0, 917991, 7531, 12847,
- 2413, 0, 0, 962, 0, 12855, 41196, 42564, 0, 1582, 0, 5508, 0, 0, 0,
- 10801, 0, 118798, 0, 7173, 496, 10439, 4313, 64607, 119557, 7860, 0, 906,
- 42793, 2842, 6405, 64722, 13132, 798, 64694, 12801, 8406, 1153, 0, 64788,
- 0, 8054, 9174, 194749, 917976, 0, 0, 41611, 4642, 66574, 11556, 0, 0, 0,
- 42089, 0, 9008, 0, 0, 195096, 42079, 917981, 917996, 42513, 0, 42842,
- 73985, 0, 118974, 127003, 0, 0, 0, 0, 11335, 64069, 42093, 3920, 0, 0, 0,
- 0, 4580, 41967, 0, 64384, 0, 119158, 3021, 42004, 0, 0, 42317, 41998, 0,
- 6946, 0, 0, 0, 0, 65204, 0, 68113, 65196, 9880, 42010, 0, 64589, 10111,
- 64875, 0, 0, 0, 11360, 0, 0, 0, 0, 42149, 0, 0, 0, 64941, 0, 0, 0, 0,
- 65671, 4110, 66005, 6959, 10929, 119110, 0, 66703, 0, 8617, 41982, 6025,
- 0, 0, 0, 0, 0, 9597, 42099, 43172, 0, 10117, 0, 0, 41642, 0, 0, 0, 8301,
- 0, 0, 187, 0, 65669, 0, 4963, 0, 0, 0, 8964, 65676, 65785, 0, 41948, 0,
- 0, 0, 41942, 65449, 3160, 10081, 13226, 42121, 42475, 0, 0, 41766, 0,
- 65882, 0, 41760, 1189, 905, 480, 10985, 41733, 67859, 9629, 42436, 1745,
- 0, 73835, 7888, 0, 0, 0, 0, 41507, 8806, 7023, 0, 74279, 64540, 0, 7867,
- 0, 6236, 0, 0, 10505, 0, 12851, 118948, 348, 5474, 0, 3103, 0, 41753, 0,
- 0, 0, 0, 0, 41739, 0, 42515, 10931, 41756, 43347, 42560, 5391, 41746,
- 119147, 0, 41259, 5561, 74360, 2691, 0, 65553, 7933, 5562, 0, 0, 41262,
- 0, 64421, 74846, 41251, 0, 0, 3979, 0, 0, 74813, 0, 0, 0, 0, 118847,
- 41266, 0, 0, 917630, 10585, 65741, 41737, 9574, 2666, 0, 41738, 831, 419,
- 13126, 10716, 0, 42822, 0, 6434, 0, 6939, 7766, 6432, 0, 0, 916, 769,
- 41742, 11968, 120557, 6433, 5563, 547, 1943, 6439, 5560, 4994, 487, 0,
- 4497, 3754, 0, 120424, 9039, 0, 41776, 0, 8716, 1595, 119206, 0, 0,
- 74260, 0, 43267, 0, 0, 0, 12185, 0, 0, 0, 0, 0, 42856, 8634, 0, 0, 4209,
- 120702, 0, 65879, 41538, 65612, 0, 669, 5679, 0, 0, 118961, 0, 0, 5678,
- 11821, 0, 0, 460, 0, 0, 0, 0, 120747, 0, 0, 0, 119022, 0, 0, 0, 7782,
- 9044, 4974, 11760, 917547, 7577, 65711, 41912, 1216, 0, 0, 5792, 0, 0, 0,
- 0, 42264, 12244, 0, 5683, 0, 0, 0, 1549, 0, 0, 120398, 5682, 6206, 8670,
- 74520, 5680, 917568, 10001, 0, 0, 1449, 10241, 0, 0, 0, 10552, 64342,
- 41922, 0, 8584, 0, 5567, 2717, 0, 0, 5564, 42886, 41908, 42882, 5565, 0,
- 0, 0, 65708, 65709, 5566, 0, 65704, 65705, 11904, 42875, 0, 42539, 5942,
- 8468, 0, 10361, 10425, 65697, 65698, 65699, 0, 66598, 0, 64664, 10647, 0,
- 0, 0, 457, 0, 65701, 1934, 43006, 0, 8802, 0, 65130, 0, 0, 6087, 0, 0,
- 41757, 0, 8043, 8950, 65694, 64485, 43534, 10457, 0, 11961, 119006, 0, 0,
- 0, 0, 0, 65515, 9499, 10035, 13069, 0, 0, 9889, 68184, 42806, 0, 7256, 0,
- 0, 1667, 42161, 0, 42428, 0, 6934, 0, 10802, 64861, 6556, 0, 0, 8101,
- 3610, 0, 41748, 4995, 955, 65907, 119208, 5350, 64339, 0, 64549, 10875,
- 917956, 5477, 65692, 0, 0, 0, 12896, 10456, 917954, 0, 3874, 0, 0, 0, 0,
- 0, 0, 65603, 0, 65687, 0, 41038, 74009, 119570, 67857, 8536, 0, 0, 0,
- 74432, 724, 0, 1455, 0, 7183, 64583, 119233, 0, 4175, 917962, 0, 0, 939,
- 0, 43520, 0, 74569, 917958, 0, 917959, 917945, 194704, 10788, 6088, 0, 0,
- 190, 0, 12593, 0, 8188, 64408, 0, 4417, 0, 0, 41744, 0, 7827, 0, 6965, 0,
- 0, 13201, 0, 0, 0, 74382, 73781, 7918, 73988, 0, 0, 917884, 1728, 0,
- 120710, 178, 12972, 0, 0, 0, 120671, 0, 0, 0, 120405, 65690, 0, 0,
- 119054, 0, 9252, 917889, 4652, 74259, 0, 0, 0, 13065, 9923, 10806, 0,
- 11763, 0, 120688, 0, 119098, 0, 6993, 0, 0, 8333, 0, 0, 0, 0, 74464, 0,
- 0, 74080, 0, 0, 11910, 0, 8278, 8963, 4034, 0, 0, 65344, 120517, 41747,
- 0, 0, 8677, 0, 12707, 9350, 66037, 0, 8836, 12315, 12747, 8300, 0, 0,
- 7491, 8856, 0, 0, 43150, 0, 120404, 65389, 120402, 120403, 10813, 2592,
- 12853, 43269, 7263, 120244, 6536, 120238, 120239, 65516, 12321, 120391,
- 120388, 120389, 10007, 120246, 9588, 120248, 1596, 120383, 41994, 65801,
- 0, 0, 66572, 0, 0, 10613, 8092, 12805, 41928, 40981, 0, 0, 5006, 64328,
- 0, 65298, 0, 8825, 74555, 65940, 0, 0, 6107, 0, 119177, 0, 0, 0, 11783,
- 335, 120227, 64689, 438, 4510, 5765, 8721, 120233, 119227, 6092, 12840,
- 43112, 8876, 120231, 8096, 10284, 0, 0, 0, 10380, 8733, 0, 0, 41602, 0,
- 0, 74831, 917901, 0, 73747, 65399, 0, 64591, 42405, 0, 917897, 843,
- 11541, 0, 0, 0, 41935, 74496, 41902, 0, 0, 215, 41258, 0, 43159, 1953,
- 9579, 41938, 1256, 3910, 9407, 6242, 0, 0, 41257, 41900, 8675, 10700,
- 8805, 1742, 0, 9333, 8202, 0, 0, 0, 0, 0, 73882, 499, 0, 0, 0, 126983, 0,
- 1712, 5932, 0, 41762, 0, 0, 11967, 1775, 0, 0, 0, 0, 0, 9458, 0, 6470,
- 9180, 120380, 43176, 0, 0, 42782, 0, 0, 0, 917912, 74777, 120669, 9414,
- 120382, 73782, 73969, 565, 42484, 5794, 201, 2662, 42292, 0, 8254, 0,
- 10975, 0, 120625, 74763, 1022, 4108, 3880, 74247, 0, 0, 0, 917980, 7507,
- 0, 43149, 0, 65031, 7961, 1636, 0, 65029, 65024, 0, 12473, 6534, 0, 99,
- 98, 97, 120571, 67584, 4049, 0, 0, 7090, 0, 7892, 917969, 10777, 0,
- 65310, 65562, 66599, 0, 0, 8039, 3363, 66594, 0, 0, 0, 12596, 66595,
- 42258, 42570, 5593, 119148, 120711, 0, 10100, 6061, 64854, 119, 118, 117,
- 116, 12998, 122, 121, 120, 111, 110, 109, 108, 115, 114, 113, 112, 103,
- 102, 101, 100, 107, 106, 105, 104, 6436, 73974, 534, 41212, 0, 1536,
- 64093, 73970, 0, 0, 0, 6020, 12716, 127112, 12744, 475, 120394, 13266, 0,
- 127111, 0, 73926, 0, 10645, 1212, 6543, 0, 8134, 0, 2913, 73870, 0, 1866,
- 0, 195095, 0, 8923, 1645, 12059, 66585, 0, 3196, 0, 0, 5935, 1250, 0,
- 8174, 9787, 9856, 9859, 7916, 9861, 9860, 5258, 1882, 1892, 0, 10882,
- 405, 11454, 73911, 0, 0, 41169, 8939, 41245, 0, 41170, 1454, 11369, 6477,
- 12157, 0, 0, 0, 41172, 7855, 0, 0, 10480, 0, 0, 0, 8264, 12610, 0, 645,
- 0, 7609, 40973, 0, 0, 0, 5824, 984, 0, 10688, 5851, 0, 7729, 73982,
- 120518, 0, 195086, 66722, 0, 0, 0, 0, 4538, 120406, 43141, 0, 0, 74214,
- 0, 0, 0, 118902, 43005, 0, 9552, 0, 0, 0, 12997, 0, 0, 0, 0, 2381, 12883,
+ 63952, 8425, 3602, 8328, 11764, 118894, 0, 69796, 41183, 12907, 10271,
+ 10287, 684, 43525, 0, 2854, 119586, 4592, 65755, 0, 92256, 11963, 43620,
+ 0, 78889, 0, 0, 128809, 9881, 43115, 65757, 3415, 0, 0, 8648, 0, 6741,
+ 43047, 0, 13180, 128517, 418, 917972, 64495, 10295, 10327, 10391, 41752,
+ 74339, 8641, 41449, 0, 74100, 0, 10911, 6942, 0, 1024, 42849, 41751,
+ 69776, 8941, 0, 4554, 0, 9023, 11685, 0, 9928, 78617, 0, 11437, 43741,
+ 92163, 120700, 63967, 0, 41206, 120724, 9049, 41185, 43166, 0, 11680,
+ 92619, 11686, 78544, 65224, 4565, 4655, 119553, 0, 92183, 64523, 10343,
+ 10407, 0, 66671, 11466, 0, 128003, 42890, 0, 12050, 68201, 2860, 0, 0, 0,
+ 42792, 5743, 10424, 12065, 42872, 0, 92342, 0, 8875, 0, 0, 917991, 7531,
+ 12847, 2413, 0, 78635, 962, 0, 12855, 41196, 42564, 0, 1582, 0, 5508, 0,
+ 0, 0, 10801, 0, 92354, 0, 7173, 496, 10439, 4313, 64607, 69638, 7860, 0,
+ 906, 42793, 2842, 6405, 64722, 13132, 798, 64694, 12801, 8406, 1153,
+ 92173, 64788, 0, 8054, 9174, 128652, 917976, 9964, 0, 41611, 4642, 66574,
+ 11556, 917982, 0, 78857, 42089, 78855, 9008, 0, 0, 195096, 42079, 917981,
+ 77924, 42513, 0, 42842, 73985, 65285, 118974, 127003, 0, 0, 0, 0, 11335,
+ 64069, 42093, 3920, 0, 0, 0, 0, 4580, 41967, 0, 64384, 92167, 119158,
+ 3021, 42004, 0, 0, 42317, 41998, 0, 6946, 0, 0, 0, 128193, 65204, 0,
+ 68113, 42690, 9880, 42010, 74824, 64589, 10111, 64875, 127880, 68399,
+ 43998, 11360, 0, 0, 0, 118826, 42149, 0, 0, 0, 64941, 77919, 120421,
+ 128077, 0, 55247, 4110, 66005, 6959, 10929, 119110, 0, 66703, 77921,
+ 8617, 41982, 6025, 69242, 0, 0, 0, 0, 9597, 42099, 43172, 0, 10117, 0,
+ 92297, 41636, 0, 0, 120681, 8301, 0, 0, 187, 0, 65669, 128339, 4963, 0,
+ 127517, 0, 8964, 65676, 65785, 0, 41948, 0, 0, 0, 41942, 65449, 3160,
+ 10081, 13226, 42121, 42475, 42663, 128210, 41766, 0, 65882, 78849, 41760,
+ 1189, 905, 480, 10985, 41733, 67859, 9629, 6742, 1745, 43625, 73835,
+ 7888, 0, 3980, 0, 42656, 41507, 8806, 7023, 0, 74279, 9447, 78651, 7867,
+ 69218, 6236, 0, 0, 10505, 0, 12851, 118948, 348, 5474, 128843, 3103, 0,
+ 41753, 128540, 0, 0, 78844, 78845, 41739, 78843, 42515, 10931, 41756,
+ 43347, 42560, 5391, 41746, 119147, 92591, 41259, 5561, 74360, 2691, 0,
+ 65553, 7933, 5562, 69800, 128265, 41262, 128146, 64421, 74846, 41251, 0,
+ 0, 3979, 0, 0, 74813, 0, 0, 0, 0, 92524, 41266, 0, 0, 128836, 10585,
+ 65741, 41737, 9574, 2666, 0, 41738, 831, 419, 13126, 10716, 0, 42822, 0,
+ 6434, 0, 6939, 7766, 6432, 128106, 0, 916, 769, 41742, 11968, 74805,
+ 6433, 5563, 547, 1943, 6439, 5560, 4994, 487, 0, 4497, 3754, 127056,
+ 120424, 9039, 0, 41776, 0, 8716, 1595, 41615, 0, 0, 74260, 0, 42854,
+ 43219, 128709, 0, 12185, 128879, 0, 68355, 68357, 0, 42856, 8634, 0, 0,
+ 4209, 120702, 0, 65879, 41538, 65612, 127543, 669, 5679, 0, 69786, 92540,
+ 0, 0, 5678, 11821, 0, 6711, 460, 0, 0, 0, 0, 120747, 0, 0, 78050, 119022,
+ 0, 0, 0, 7782, 9044, 4974, 11760, 78494, 7577, 65711, 41912, 1216, 0,
+ 128079, 5792, 0, 0, 78501, 0, 2933, 12244, 0, 5683, 0, 0, 78119, 1549, 0,
+ 0, 120398, 5682, 6206, 8670, 10256, 5680, 917568, 10001, 0, 69768, 1449,
+ 10241, 78290, 128228, 0, 10552, 64342, 41922, 128548, 8584, 0, 5567,
+ 2717, 0, 0, 5564, 42886, 41908, 42882, 5565, 0, 128026, 0, 65708, 65709,
+ 5566, 69803, 65704, 65705, 11904, 42875, 43373, 42539, 5942, 8468,
+ 120561, 10361, 10425, 65697, 65698, 65699, 0, 66598, 0, 64664, 10647,
+ 78702, 78703, 78690, 457, 78502, 65701, 1934, 43006, 0, 8802, 78710,
+ 65130, 11747, 78709, 6087, 78705, 78716, 41757, 78711, 8043, 8950, 65694,
+ 64485, 43534, 10457, 0, 11961, 78725, 78722, 78723, 78720, 78721, 0,
+ 65515, 9499, 10035, 13069, 0, 0, 9889, 68184, 42806, 0, 7256, 0, 0, 1667,
+ 42161, 0, 42428, 0, 6934, 0, 10802, 64861, 6556, 78390, 0, 8101, 3610, 0,
+ 41748, 4995, 955, 65907, 119208, 5350, 64339, 78306, 64549, 10875,
+ 128662, 5477, 65692, 0, 128532, 120397, 12896, 10456, 917954, 0, 3874, 0,
+ 0, 0, 0, 0, 0, 65603, 0, 65687, 0, 41038, 74009, 119570, 42239, 8536,
+ 78740, 0, 78726, 74432, 724, 0, 1455, 78749, 7183, 64583, 78747, 68443,
+ 4175, 78741, 43614, 69801, 939, 0, 43520, 68613, 74569, 917958, 0, 78763,
+ 78764, 78760, 10788, 6088, 78759, 78755, 190, 0, 12593, 0, 8188, 64408,
+ 0, 4417, 0, 92261, 6370, 0, 7827, 68441, 6965, 0, 0, 13201, 128205, 0, 0,
+ 74382, 73781, 7918, 73988, 0, 0, 917884, 1728, 0, 120710, 178, 12972,
+ 92679, 0, 917887, 92563, 0, 0, 78327, 120405, 65690, 0, 0, 119054, 0,
+ 9252, 917889, 4652, 68371, 0, 0, 0, 13065, 9923, 10806, 0, 11763, 0,
+ 120688, 6723, 78187, 0, 6993, 0, 0, 8333, 0, 0, 11390, 0, 74464, 0,
+ 92320, 74080, 0, 0, 11910, 92559, 8278, 8963, 4034, 128560, 0, 65344,
+ 120517, 41747, 0, 0, 8677, 0, 12707, 9350, 66037, 128180, 8836, 12315,
+ 12747, 8300, 0, 0, 7491, 8856, 128064, 0, 43150, 127768, 120404, 65389,
+ 120402, 120403, 10813, 2592, 12853, 43269, 7263, 120244, 6536, 120238,
+ 120239, 65516, 12321, 120391, 120388, 55287, 10007, 120246, 9588, 120248,
+ 1596, 120383, 41994, 65801, 128808, 0, 66572, 0, 0, 10613, 6697, 12805,
+ 41928, 40981, 78403, 78409, 5006, 64328, 0, 9931, 0, 8825, 74555, 65940,
+ 43259, 0, 6107, 0, 119177, 0, 78401, 128641, 11783, 335, 120227, 64689,
+ 438, 4510, 5765, 8721, 120233, 119227, 6092, 12840, 43112, 8876, 120231,
+ 8096, 10284, 128515, 0, 0, 10380, 8733, 0, 128240, 41602, 0, 92308,
+ 74831, 917901, 0, 73747, 65399, 0, 64591, 42405, 0, 120820, 843, 11541,
+ 0, 917898, 2065, 41935, 74496, 41902, 0, 0, 215, 41258, 77875, 43159,
+ 1953, 9579, 41938, 1256, 3910, 9407, 6242, 0, 0, 41257, 41900, 8675,
+ 10700, 8805, 1742, 0, 9333, 8202, 127750, 0, 0, 0, 0, 73882, 499, 0,
+ 43467, 0, 43818, 0, 1712, 5932, 77845, 41762, 0, 0, 11967, 1775, 0, 0, 0,
+ 0, 128009, 9458, 0, 6470, 9180, 120380, 43176, 0, 0, 42782, 0, 0, 0,
+ 128309, 74777, 120669, 9414, 120382, 73782, 73969, 565, 42484, 5794, 201,
+ 2662, 42292, 0, 8254, 0, 10975, 0, 120625, 74763, 1022, 4108, 3880,
+ 74247, 0, 0, 92263, 917980, 7507, 0, 43149, 0, 65031, 7961, 1636, 0,
+ 65029, 65024, 0, 12473, 6534, 0, 99, 98, 97, 120571, 67584, 4049, 74163,
+ 127065, 7090, 0, 7892, 917969, 10777, 917803, 65310, 65562, 66599, 66722,
+ 0, 8039, 3363, 66594, 43434, 0, 0, 12596, 66595, 42258, 42570, 5593,
+ 119148, 120711, 92425, 10100, 6061, 64854, 119, 118, 117, 116, 12998,
+ 122, 121, 120, 111, 110, 109, 108, 115, 114, 113, 112, 103, 102, 101,
+ 100, 107, 106, 105, 104, 6436, 73974, 534, 41212, 77931, 1536, 64093,
+ 73970, 77930, 127157, 0, 6020, 12716, 127112, 12744, 475, 120394, 13266,
+ 127813, 127111, 0, 73926, 0, 10645, 1212, 6543, 0, 8134, 128028, 2913,
+ 73870, 127113, 1866, 0, 195095, 0, 8923, 1645, 12059, 66585, 78786, 3196,
+ 0, 0, 5935, 1250, 127066, 8174, 9787, 6733, 9859, 7916, 9861, 9860, 5258,
+ 1882, 1892, 6731, 10882, 405, 11454, 73911, 0, 128781, 41169, 8939,
+ 41245, 0, 41170, 1454, 11369, 6477, 12157, 0, 0, 0, 41172, 7855, 0, 0,
+ 10480, 0, 0, 77936, 8264, 12610, 0, 645, 0, 7609, 40973, 0, 73833, 78249,
+ 5824, 984, 77918, 10688, 5851, 0, 7729, 73982, 120518, 0, 195086, 43369,
+ 0, 128140, 68415, 0, 4538, 120406, 43141, 0, 0, 74214, 73886, 0, 0,
+ 118902, 43005, 78448, 9552, 0, 0, 0, 12997, 0, 0, 0, 0, 2381, 12883,
10994, 10529, 41906, 0, 0, 0, 12425, 10661, 10856, 9614, 2428, 41478,
- 8582, 10064, 73930, 0, 0, 0, 64896, 119162, 1952, 0, 8455, 10082, 11575,
- 0, 119566, 0, 12808, 12183, 6145, 0, 64929, 0, 0, 0, 43186, 42509, 0,
- 3922, 9187, 0, 0, 0, 119057, 11752, 3353, 9358, 0, 0, 66680, 120090,
- 11747, 7931, 8558, 9795, 0, 0, 0, 120082, 120081, 120084, 41027, 120086,
- 0, 120088, 120087, 7019, 120073, 0, 11751, 120078, 120077, 64657, 8657,
- 120048, 8594, 120068, 0, 0, 120069, 120072, 120071, 0, 0, 43154, 41029,
- 0, 11332, 65380, 7728, 0, 11294, 0, 66665, 7851, 0, 0, 8699, 0, 42524, 0,
- 9085, 0, 7504, 9327, 6160, 0, 0, 0, 8088, 0, 74012, 0, 0, 4439, 6926, 0,
- 12924, 0, 42369, 0, 65491, 65145, 9041, 43559, 64577, 10826, 0, 11296, 0,
- 0, 0, 65825, 9577, 120494, 0, 64670, 0, 0, 42159, 11295, 0, 0, 120779, 0,
- 0, 10902, 0, 0, 0, 0, 10472, 2995, 0, 0, 0, 2371, 0, 120808, 259, 1009,
- 0, 2402, 2333, 6440, 0, 0, 65125, 41244, 0, 13271, 9103, 41180, 0, 0, 0,
- 0, 10219, 0, 0, 0, 0, 43178, 127070, 41261, 119362, 917974, 8613, 0,
- 118989, 917978, 917979, 41492, 12005, 917982, 0, 1890, 120056, 0, 0, 0,
- 7293, 7991, 0, 10578, 0, 118840, 0, 0, 0, 0, 0, 0, 120054, 118815, 6635,
- 0, 6164, 65170, 0, 0, 0, 11664, 0, 0, 0, 0, 118812, 0, 0, 0, 9175, 11925,
- 0, 9088, 0, 64545, 1396, 0, 7546, 3847, 0, 0, 4985, 13288, 672, 8098,
- 43196, 194746, 0, 0, 0, 74043, 65072, 1577, 11772, 0, 5928, 4525, 10658,
- 65911, 1266, 10180, 0, 0, 12622, 0, 0, 0, 194714, 0, 13310, 773, 19933,
- 1539, 0, 0, 66374, 0, 0, 0, 0, 3051, 5862, 7823, 0, 0, 120411, 3250,
- 74020, 0, 66649, 9510, 66237, 0, 0, 41066, 64673, 917963, 917964, 0,
- 3505, 8707, 917968, 917965, 917966, 917971, 917972, 3471, 917970, 5479,
- 882, 6686, 119584, 11613, 120772, 42754, 0, 0, 0, 0, 0, 0, 0, 3225, 0,
- 4433, 41156, 73745, 43173, 1443, 4381, 0, 0, 10926, 11756, 11757, 64879,
- 917949, 917950, 917947, 13227, 0, 10021, 5160, 1387, 0, 917953, 41418, 0,
- 65914, 917957, 217, 917955, 917960, 917961, 10443, 10789, 41158, 119257,
- 4274, 0, 41483, 0, 41250, 0, 42179, 0, 5931, 11744, 0, 0, 41252, 66682,
- 0, 119637, 41249, 1366, 64635, 0, 12466, 0, 0, 4397, 0, 0, 41296, 9545,
- 41291, 0, 0, 41485, 3511, 41282, 5923, 10400, 0, 0, 760, 0, 12088, 5786,
- 0, 42256, 119869, 119861, 417, 41474, 119562, 41565, 0, 5934, 119867,
- 66583, 119231, 64877, 0, 64481, 0, 0, 41956, 0, 126995, 0, 0, 0, 42273,
- 5819, 0, 917556, 0, 0, 0, 65910, 0, 10246, 0, 0, 1237, 10274, 4552, 0, 0,
- 0, 1375, 66705, 43573, 65260, 42063, 0, 42811, 10312, 74192, 120794,
- 7840, 0, 64890, 10252, 0, 0, 43185, 0, 4396, 0, 119880, 10769, 10331,
+ 8582, 10064, 73930, 0, 0, 0, 64896, 119162, 1952, 92181, 8455, 10082,
+ 11575, 0, 119566, 0, 12808, 12183, 6145, 118955, 64929, 92433, 0, 0,
+ 43186, 42509, 0, 3922, 9187, 0, 0, 10191, 119057, 11752, 3353, 9358, 0,
+ 917957, 66680, 120090, 8248, 7931, 8558, 9795, 68380, 0, 0, 120082,
+ 120081, 120084, 41027, 120086, 0, 120088, 120087, 7019, 120073, 0, 11751,
+ 120078, 78294, 64657, 8657, 120048, 8594, 120068, 0, 0, 120069, 120072,
+ 120071, 0, 0, 43154, 41029, 0, 11332, 65380, 7728, 0, 11294, 0, 66665,
+ 7851, 0, 8375, 8699, 0, 42524, 0, 9085, 0, 7504, 9327, 6160, 128095, 0,
+ 0, 8088, 0, 74012, 92500, 0, 4439, 6926, 0, 12924, 128227, 42369, 0,
+ 65491, 65145, 9041, 43559, 64577, 10826, 0, 11296, 0, 0, 0, 65825, 9577,
+ 68199, 0, 64670, 0, 78056, 6793, 11295, 0, 78053, 73872, 0, 0, 10902, 0,
+ 0, 78070, 78068, 10472, 2995, 0, 0, 64682, 2371, 78069, 120808, 259,
+ 1009, 92171, 2402, 2333, 6440, 0, 0, 65125, 41244, 0, 13271, 9103, 41180,
+ 0, 0, 0, 0, 10219, 0, 0, 0, 0, 43178, 127070, 41261, 119362, 43640, 8613,
+ 0, 118989, 6736, 195092, 41492, 12005, 127889, 0, 1890, 120056, 0, 0, 0,
+ 7293, 7991, 0, 10578, 0, 78076, 194738, 78077, 0, 0, 78800, 92653, 64445,
+ 42668, 6635, 0, 6164, 65170, 0, 0, 7676, 11664, 0, 0, 69707, 0, 118812,
+ 0, 0, 128045, 9175, 11925, 78045, 9088, 0, 64545, 1396, 0, 7546, 3847, 0,
+ 127835, 4985, 13288, 672, 8098, 43196, 194746, 0, 128126, 0, 74043,
+ 65072, 1577, 11772, 13041, 5928, 4525, 10658, 65911, 1266, 10180, 0,
+ 128584, 12622, 0, 0, 0, 194714, 127139, 13310, 773, 19933, 1539, 0,
+ 126983, 42731, 92205, 0, 0, 0, 3051, 5862, 7823, 92478, 0, 120411, 3250,
+ 43991, 69687, 66649, 9510, 66237, 0, 0, 41066, 64673, 917963, 917964, 0,
+ 3505, 8707, 917968, 6725, 128013, 917971, 92314, 3471, 917970, 5479, 882,
+ 6686, 119584, 11613, 120772, 42754, 0, 0, 92696, 0, 0, 0, 128523, 3225,
+ 917996, 4433, 41156, 43973, 43173, 1443, 4381, 0, 0, 10926, 11756, 11757,
+ 64879, 917949, 917950, 127848, 13227, 0, 10021, 5160, 1387, 0, 917953,
+ 41418, 0, 65914, 6721, 217, 917955, 917960, 917961, 10443, 10789, 41158,
+ 119257, 4274, 0, 41483, 0, 41250, 0, 42179, 0, 5931, 11744, 69232, 0,
+ 41252, 66682, 0, 119637, 41249, 1366, 64635, 65047, 12466, 0, 0, 4397,
+ 128037, 128336, 41296, 9545, 41291, 128049, 0, 41485, 3511, 41282, 5923,
+ 10400, 0, 128818, 760, 0, 12088, 5786, 0, 42256, 119869, 119860, 417,
+ 41474, 119562, 41565, 0, 5934, 119867, 66583, 119231, 64877, 0, 64481,
+ 78614, 66013, 41956, 43455, 126995, 0, 0, 0, 42273, 5819, 0, 917556, 0,
+ 0, 0, 65910, 127747, 10246, 120816, 0, 1237, 10274, 4552, 119576, 0, 0,
+ 1375, 66705, 43573, 65260, 42063, 0, 42811, 10312, 74192, 120794, 7840,
+ 0, 43630, 10252, 0, 128104, 43185, 0, 4396, 0, 119880, 10769, 9676,
119041, 0, 9753, 0, 8944, 0, 0, 10473, 0, 0, 6072, 43025, 10299, 0, 0,
- 120608, 119874, 0, 0, 0, 0, 9330, 0, 7222, 10283, 10315, 10379, 4996, 0,
- 13281, 66517, 7865, 10087, 0, 0, 119092, 0, 0, 7565, 66363, 12952, 64806,
- 43180, 0, 68096, 0, 0, 74288, 622, 74023, 885, 64772, 1602, 0, 0, 852, 0,
- 12160, 0, 10212, 65435, 0, 12071, 9609, 12156, 917983, 917984, 43586,
- 11035, 10411, 917988, 10255, 10263, 10279, 4194, 10375, 917993, 0, 4315,
- 12644, 917997, 917994, 917995, 43343, 0, 917998, 917999, 41177, 0, 0,
- 917792, 0, 0, 8715, 0, 41179, 0, 43313, 0, 41176, 0, 994, 0, 8452,
- 127103, 73966, 0, 0, 5921, 0, 2597, 0, 5922, 118903, 127109, 4186,
- 127107, 127106, 127105, 73973, 0, 4406, 74601, 8480, 0, 9747, 0, 4413, 0,
- 42268, 3198, 5924, 5920, 0, 6921, 0, 74007, 42869, 8418, 11681, 43169,
- 10176, 0, 742, 0, 2893, 10772, 65276, 5937, 1914, 2553, 11682, 0, 0, 0,
- 8363, 0, 2993, 7772, 3916, 0, 0, 1141, 42407, 8159, 718, 7572, 973, 0,
- 120718, 3235, 2415, 43164, 0, 8018, 42333, 74756, 10675, 6937, 42486, 0,
- 65390, 0, 0, 1202, 0, 0, 127037, 0, 0, 0, 0, 64542, 3260, 73829, 65388,
- 0, 8419, 0, 127036, 0, 0, 74193, 0, 0, 0, 0, 1431, 0, 66565, 10821, 0,
- 12804, 0, 8229, 1235, 3307, 11472, 0, 0, 4544, 0, 0, 0, 1740, 0, 8758,
- 985, 12882, 64511, 0, 12068, 0, 0, 10141, 0, 63761, 8785, 4476, 0, 63763,
- 12655, 8907, 0, 0, 0, 0, 0, 119572, 10665, 64616, 41572, 0, 0, 0, 41573,
- 0, 3931, 0, 74143, 0, 0, 0, 0, 11982, 0, 0, 0, 0, 64484, 0, 41167, 0,
- 41735, 0, 717, 10754, 0, 0, 0, 0, 63767, 0, 1780, 6936, 0, 0, 819, 10611,
- 9694, 126978, 0, 0, 0, 0, 0, 0, 12820, 0, 6578, 7009, 7523, 6922, 74218,
- 67848, 7525, 3346, 8339, 0, 0, 575, 268, 0, 8563, 0, 120343, 41541,
- 65565, 8336, 5936, 7290, 0, 8337, 13081, 308, 11388, 7522, 120721, 0,
- 65466, 11090, 6953, 0, 120346, 0, 120345, 5926, 0, 0, 0, 0, 0, 0, 9038,
- 7887, 0, 7830, 11651, 13093, 64002, 0, 65742, 0, 119597, 11590, 0, 74048,
- 0, 8595, 0, 0, 0, 13097, 0, 64643, 13283, 12697, 0, 120621, 3488, 5933,
- 10033, 73738, 66241, 65570, 0, 12297, 119153, 1955, 0, 5349, 42538, 0, 0,
- 65308, 9462, 0, 0, 0, 0, 0, 0, 5831, 0, 7638, 0, 42764, 0, 43109, 7637,
- 11957, 120600, 0, 0, 0, 0, 0, 0, 0, 7636, 65171, 9124, 0, 120331, 0, 291,
- 0, 0, 2027, 66230, 0, 0, 10403, 0, 4640, 64713, 10224, 120429, 42512,
- 120431, 120430, 0, 0, 0, 0, 0, 0, 0, 119094, 74213, 7824, 0, 0, 41274,
- 5778, 6302, 0, 0, 12680, 119130, 1417, 0, 194914, 9452, 0, 0, 11552, 0,
- 0, 0, 65391, 0, 10172, 65453, 120408, 41264, 120410, 6426, 4641, 9179,
- 64819, 64906, 41255, 42036, 41469, 41269, 120412, 41267, 4646, 120425,
- 865, 42034, 120426, 120421, 4645, 42033, 120422, 0, 0, 64728, 0, 0, 0,
- 1659, 919, 42784, 1671, 195089, 6069, 9219, 195090, 1661, 13120, 63784,
- 195094, 10140, 9713, 119143, 0, 0, 0, 2306, 10485, 118943, 6068, 10612,
- 195099, 0, 195101, 195078, 41462, 195080, 195079, 5422, 195081, 0, 0, 0,
- 10229, 10635, 826, 195083, 195082, 195085, 195084, 195087, 6483, 0, 1808,
- 7848, 0, 8100, 0, 0, 0, 13301, 0, 9667, 0, 0, 0, 11003, 9904, 0, 0,
- 120690, 9144, 10921, 0, 0, 9840, 65131, 917560, 0, 10313, 0, 0, 64320,
- 10265, 0, 10962, 118970, 43008, 8945, 0, 0, 41, 195072, 1792, 120515,
- 195073, 8655, 195075, 0, 0, 12066, 0, 385, 4152, 2585, 0, 0, 3126, 0,
- 74136, 10957, 0, 0, 0, 0, 13157, 0, 0, 3570, 0, 7443, 0, 0, 6997, 0, 0,
- 7879, 8739, 11075, 0, 65216, 0, 0, 2593, 8463, 7810, 917862, 7839,
- 119913, 0, 917860, 9691, 4411, 917847, 0, 0, 0, 0, 65254, 10066, 0, 0, 0,
- 0, 13061, 8016, 0, 19932, 64831, 0, 0, 12390, 119171, 1634, 68115, 0,
- 11056, 0, 119925, 0, 41165, 11328, 12450, 0, 41166, 0, 12456, 119914,
- 171, 5941, 12452, 917544, 12458, 12531, 0, 43013, 63800, 74162, 0,
- 120483, 194920, 0, 12454, 63806, 42132, 12063, 195077, 0, 3230, 0, 0, 0,
- 5209, 297, 5810, 8522, 8415, 0, 0, 0, 7077, 2497, 0, 960, 74156, 6981, 0,
- 12938, 4292, 0, 74815, 10512, 0, 74814, 0, 0, 0, 2503, 73778, 1762,
- 73833, 2495, 0, 5844, 119124, 118838, 0, 12654, 4663, 1899, 0, 2507, 0,
- 8726, 65594, 0, 0, 0, 8892, 0, 0, 0, 0, 5782, 420, 0, 0, 120462, 10797,
- 63794, 0, 0, 0, 63796, 118965, 0, 66581, 119205, 41608, 0, 0, 0, 4659,
- 120788, 0, 0, 0, 0, 0, 0, 0, 329, 120472, 0, 917548, 0, 0, 41188, 13244,
- 120466, 42167, 0, 0, 5380, 0, 0, 1155, 11365, 43126, 0, 0, 65684, 0,
- 5601, 65192, 42765, 63752, 0, 7987, 0, 1172, 0, 0, 43601, 120476, 74126,
- 5603, 0, 4473, 0, 194823, 0, 65347, 65346, 65345, 0, 0, 5347, 0, 0,
- 73868, 118944, 10588, 0, 0, 63755, 0, 5343, 120473, 0, 4555, 5341, 0, 0,
- 0, 5351, 0, 43104, 65244, 917892, 64541, 42519, 74472, 0, 0, 74765,
- 917888, 0, 6638, 0, 65113, 271, 74180, 65370, 8835, 65368, 12653, 65366,
- 42172, 41086, 65363, 65362, 65361, 11912, 65359, 11323, 65357, 11800,
- 65355, 5345, 65353, 65352, 65351, 761, 65349, 19959, 0, 0, 0, 0, 0,
- 64647, 0, 0, 4699, 0, 0, 0, 0, 64605, 0, 0, 0, 4916, 0, 380, 10958,
- 66563, 917906, 0, 9773, 13167, 12918, 41096, 73980, 0, 917898, 917893,
- 10684, 0, 917896, 0, 7946, 12541, 8182, 0, 0, 0, 0, 0, 0, 9005, 1225,
- 6630, 0, 0, 0, 0, 8847, 0, 65876, 5535, 8329, 74590, 0, 0, 0, 0, 3127,
- 2595, 65713, 0, 0, 5607, 41089, 0, 0, 74256, 2665, 11304, 0, 74200, 4970,
- 8764, 120459, 8934, 0, 41566, 4492, 0, 65011, 41090, 0, 0, 1188, 7254,
- 1100, 0, 0, 41081, 2912, 11749, 0, 0, 0, 3572, 10023, 4959, 13079, 0, 0,
- 9729, 0, 0, 0, 0, 0, 0, 11803, 7996, 9907, 41450, 13304, 0, 0, 41451, 0,
- 0, 8273, 0, 3451, 0, 972, 41453, 0, 0, 73883, 0, 73945, 0, 3455, 19955,
- 9538, 0, 0, 0, 0, 0, 0, 11396, 0, 11019, 0, 0, 0, 120507, 41078, 0, 261,
- 5927, 7791, 0, 0, 0, 10696, 0, 6073, 9838, 118920, 0, 6075, 0, 282, 0,
- 6437, 74078, 0, 65861, 0, 0, 0, 0, 3474, 118787, 0, 120655, 6081, 0, 0,
- 74076, 0, 0, 0, 0, 0, 0, 8751, 12623, 120273, 7816, 12636, 4665, 12628,
- 4670, 120271, 120272, 0, 9642, 10912, 958, 0, 11387, 0, 4666, 0, 4915, 0,
- 4669, 0, 68099, 13287, 4664, 10836, 120550, 0, 0, 0, 43595, 7450, 0,
+ 120608, 66326, 0, 0, 0, 43811, 9330, 0, 7222, 10283, 10315, 10379, 4996,
+ 0, 13281, 66517, 7865, 10087, 78343, 0, 78347, 0, 0, 7565, 66363, 12952,
+ 64806, 43180, 77928, 68096, 77929, 43982, 74288, 622, 74023, 885, 43405,
+ 1602, 0, 0, 852, 0, 12160, 0, 10212, 65435, 0, 12071, 9609, 12156,
+ 917983, 917984, 43586, 11035, 10411, 917988, 10255, 6710, 10279, 4194,
+ 10375, 917993, 0, 4315, 12644, 127516, 77937, 43639, 43343, 0, 917998,
+ 11501, 41177, 128689, 0, 917792, 0, 92413, 8715, 0, 41179, 0, 43313, 0,
+ 41176, 0, 994, 0, 8452, 127103, 73966, 0, 0, 5921, 0, 2597, 0, 5922,
+ 118903, 77943, 4186, 92531, 127106, 127105, 6718, 0, 4406, 74601, 8480,
+ 9192, 9747, 128699, 4413, 92196, 42268, 3198, 5924, 5920, 92469, 6921,
+ 78081, 74007, 42869, 8418, 11681, 43169, 10176, 0, 742, 0, 2893, 10772,
+ 65276, 5937, 1914, 2553, 11682, 6756, 128590, 128646, 8363, 0, 2993,
+ 7772, 3916, 0, 120494, 1141, 42407, 8159, 718, 7572, 973, 0, 120718,
+ 3235, 2415, 43164, 0, 8018, 42333, 74756, 10675, 6937, 42486, 43381,
+ 65390, 10067, 0, 1202, 0, 0, 65863, 0, 0, 0, 78182, 64542, 3260, 73829,
+ 65388, 9945, 8419, 78042, 6738, 0, 43681, 69728, 2059, 0, 0, 55237, 1431,
+ 0, 66565, 10821, 0, 12804, 128076, 8229, 1235, 3307, 11472, 78089, 78184,
+ 4544, 0, 0, 0, 1740, 78097, 8758, 985, 12872, 64511, 78094, 12068, 78102,
+ 0, 10141, 0, 63761, 8785, 4476, 78109, 63763, 12655, 8907, 78105, 78106,
+ 78103, 78104, 0, 119572, 10665, 64616, 41572, 0, 127160, 0, 41573, 0,
+ 3931, 120295, 74143, 0, 0, 0, 0, 11982, 0, 0, 0, 128016, 64484, 0, 41167,
+ 0, 41735, 0, 717, 10754, 0, 0, 127979, 0, 63767, 0, 1780, 6936, 0, 0,
+ 819, 10611, 9694, 126978, 0, 0, 0, 0, 8343, 8342, 8345, 8344, 6578, 7009,
+ 7523, 6922, 8348, 8347, 7525, 3346, 8339, 128165, 128338, 575, 268,
+ 78111, 8563, 5754, 120343, 41541, 65565, 8336, 5936, 7290, 78117, 8337,
+ 8341, 308, 11388, 7522, 120721, 78123, 65466, 11090, 6953, 0, 120346, 0,
+ 78132, 5926, 78128, 78130, 78126, 78127, 78124, 78125, 9038, 7887, 43456,
+ 7830, 11651, 13093, 64002, 0, 65742, 12874, 119597, 11590, 0, 74048,
+ 128350, 8595, 0, 917947, 43703, 13097, 0, 64643, 13283, 12697, 0, 12381,
+ 3488, 5933, 10033, 73738, 66241, 65570, 0, 12297, 119153, 1955, 0, 5349,
+ 42538, 0, 0, 65308, 9462, 917554, 0, 0, 0, 42736, 0, 5756, 0, 7638,
+ 41642, 42764, 0, 43109, 7637, 5752, 120600, 0, 73832, 128827, 120635,
+ 128231, 78334, 0, 7636, 65171, 9124, 0, 78892, 0, 291, 0, 0, 2027, 66230,
+ 10080, 78136, 10403, 0, 4640, 64713, 10224, 120429, 42512, 120431,
+ 120430, 0, 128351, 127489, 127148, 0, 92499, 0, 119094, 74213, 7824, 0,
+ 0, 41274, 5778, 6302, 0, 0, 12680, 119130, 1417, 77889, 194914, 9452, 0,
+ 74393, 11552, 0, 127855, 0, 65391, 0, 10172, 65453, 63789, 41264, 78658,
+ 6426, 4641, 9179, 64819, 55278, 41255, 42036, 41469, 41269, 120412,
+ 41267, 4646, 120425, 865, 42034, 78274, 78273, 4645, 42033, 78270,
+ 127982, 0, 64728, 0, 78673, 78674, 1659, 919, 42784, 1671, 195089, 6069,
+ 9219, 195090, 1661, 13120, 63784, 69819, 10140, 9713, 119143, 0, 0, 0,
+ 2306, 10485, 118943, 6068, 10612, 195099, 119567, 195101, 92561, 41462,
+ 120470, 195079, 5422, 128234, 0, 0, 0, 10229, 10635, 826, 128081, 195082,
+ 195085, 195084, 195087, 6483, 0, 1808, 7848, 0, 8100, 78227, 78669,
+ 78670, 13301, 78667, 9667, 78665, 78872, 0, 11003, 9904, 0, 0, 120690,
+ 9144, 10921, 0, 78680, 9840, 65131, 78678, 77841, 10313, 0, 0, 64320,
+ 10265, 78686, 10962, 78684, 43008, 8945, 78683, 0, 41, 195072, 1792,
+ 120515, 195073, 8655, 195075, 92544, 77951, 12066, 0, 385, 4152, 2585,
+ 127804, 119068, 3126, 0, 74136, 10957, 0, 43258, 0, 127873, 13157, 0, 0,
+ 3570, 0, 7443, 0, 44006, 6997, 0, 0, 7879, 8739, 11075, 0, 65216, 0,
+ 69795, 2593, 8463, 7810, 917862, 7839, 119913, 78806, 119912, 9691, 4411,
+ 78802, 0, 0, 43442, 78799, 65254, 10066, 0, 0, 0, 0, 13061, 8016, 78687,
+ 19932, 64831, 0, 119923, 12390, 119171, 1634, 68115, 0, 11056, 0, 119925,
+ 0, 41165, 11328, 12450, 0, 41166, 0, 12456, 119914, 171, 5941, 12452,
+ 917544, 12458, 12531, 78779, 43013, 63800, 74162, 127569, 120483, 9969,
+ 0, 12454, 63806, 42132, 12063, 78425, 78424, 3230, 0, 0, 0, 5209, 297,
+ 5810, 8522, 8415, 119937, 78429, 78428, 7077, 2497, 128651, 960, 74156,
+ 6981, 92374, 12938, 4292, 0, 74815, 10512, 0, 74814, 78875, 127505,
+ 78876, 2503, 73778, 1762, 69794, 2495, 78873, 5844, 78874, 118838, 0,
+ 12654, 4663, 1899, 78877, 2507, 64121, 8726, 65594, 0, 0, 0, 8892, 0,
+ 92339, 0, 0, 5782, 420, 0, 0, 43796, 10797, 63794, 0, 0, 64814, 63796,
+ 77965, 0, 66581, 119204, 41608, 0, 0, 63792, 4659, 120788, 0, 43676, 0,
+ 69673, 0, 0, 0, 329, 77968, 92707, 917548, 7399, 0, 41188, 13244, 120466,
+ 42167, 7435, 78193, 5380, 119086, 69225, 1155, 11365, 43126, 77972, 0,
+ 65684, 0, 5601, 65192, 42765, 63752, 0, 7987, 0, 1172, 69799, 6786,
+ 43601, 120476, 74126, 5603, 0, 4473, 0, 194823, 0, 65347, 65346, 65345,
+ 0, 127384, 5347, 69802, 0, 73868, 118944, 10588, 0, 0, 63755, 0, 5343,
+ 78422, 0, 4555, 5341, 0, 0, 128670, 5351, 0, 43104, 65244, 917892, 64541,
+ 42519, 74472, 0, 0, 74765, 917888, 194892, 6638, 0, 65113, 271, 74180,
+ 65370, 8835, 65368, 12653, 65366, 42172, 41086, 65363, 65362, 65361,
+ 11912, 43410, 11323, 65357, 11800, 65355, 5345, 65353, 65352, 65351, 761,
+ 65349, 19959, 69718, 63856, 0, 2423, 77958, 64647, 77959, 11957, 4699, 0,
+ 0, 0, 0, 64605, 0, 0, 0, 4916, 0, 380, 10958, 66563, 77955, 69773, 9773,
+ 13167, 12918, 41096, 73980, 69245, 78254, 917893, 10684, 0, 917896, 0,
+ 7946, 12541, 8182, 67586, 69780, 0, 0, 0, 0, 9005, 1225, 6630, 0, 0, 0,
+ 0, 8847, 0, 65876, 5535, 8329, 74590, 0, 92609, 0, 0, 3127, 2595, 65713,
+ 42013, 0, 5607, 41089, 0, 0, 74256, 2665, 11304, 0, 74200, 4970, 8764,
+ 120459, 8934, 92726, 41566, 4492, 0, 65011, 41090, 0, 0, 1188, 7254,
+ 1100, 0, 128301, 41081, 2912, 11749, 69792, 0, 0, 3572, 10023, 4959,
+ 13079, 0, 0, 9729, 0, 0, 0, 43361, 0, 0, 11803, 7996, 9907, 41450, 13304,
+ 128290, 127260, 41451, 0, 11095, 8273, 127533, 3451, 0, 972, 41453, 0, 0,
+ 73883, 92408, 73945, 0, 3455, 19955, 9538, 0, 69807, 0, 0, 0, 0, 11396,
+ 0, 11019, 0, 0, 0, 120507, 41078, 0, 261, 5927, 7791, 0, 64446, 0, 10696,
+ 0, 6073, 9838, 118920, 0, 6075, 128563, 282, 0, 6437, 74078, 128000,
+ 9801, 0, 0, 0, 0, 3474, 118787, 0, 120655, 6081, 0, 127843, 74076, 78879,
+ 0, 0, 0, 0, 0, 8751, 11499, 120273, 7816, 12636, 4665, 12628, 4670,
+ 92608, 120272, 0, 9642, 10912, 958, 0, 11387, 78878, 4666, 0, 4915, 0,
+ 4669, 0, 68099, 13287, 4664, 10836, 120550, 0, 69775, 0, 43595, 7450, 0,
917875, 8664, 9697, 3606, 917873, 0, 0, 64815, 1063, 120250, 120251,
- 9772, 7255, 8886, 1389, 0, 120257, 120258, 120259, 12941, 120253, 120254,
- 120255, 120256, 12301, 120266, 120267, 41102, 66604, 120262, 120263,
- 120264, 1017, 66600, 523, 505, 1447, 74436, 0, 0, 0, 8608, 42789, 0, 0,
- 0, 119196, 11307, 66707, 917871, 0, 11745, 7919, 0, 1641, 0, 0, 8966, 0,
- 0, 5908, 0, 0, 74562, 0, 1699, 74191, 74843, 0, 0, 6306, 10169, 0,
- 119251, 0, 3766, 120457, 120456, 120455, 6611, 257, 43170, 13153, 0,
- 42386, 0, 9436, 2599, 0, 6496, 9449, 5930, 11476, 11033, 11447, 0, 5622,
- 120436, 8477, 3760, 1718, 9442, 66433, 3776, 0, 41435, 4352, 0, 2435,
- 120809, 5621, 0, 4201, 3778, 4203, 4202, 4205, 4204, 120447, 3768, 68142,
- 765, 41440, 3764, 8473, 120440, 8469, 120438, 12947, 4564, 0, 0, 74271,
- 73753, 0, 0, 0, 0, 5225, 0, 0, 0, 0, 0, 0, 74793, 5626, 73807, 11771, 0,
- 0, 0, 0, 5353, 5625, 74179, 0, 0, 1010, 64572, 0, 42623, 64277, 0, 6952,
- 0, 120752, 119003, 2590, 5629, 65552, 7551, 10325, 5632, 10471, 120038,
- 120027, 120028, 120025, 5628, 120031, 970, 120029, 4772, 2400, 5627,
- 120017, 120018, 120023, 64275, 120021, 10961, 0, 203, 0, 0, 0, 0, 0, 0,
- 64378, 42054, 0, 0, 554, 119649, 11358, 0, 12182, 42048, 11065, 0, 73891,
- 0, 0, 5694, 7689, 74528, 9323, 4325, 3047, 10317, 175, 0, 0, 74605, 0, 0,
- 1243, 42154, 5431, 6652, 0, 0, 0, 0, 68118, 0, 1129, 0, 0, 65900, 1986,
- 7846, 0, 8661, 0, 65255, 0, 3845, 4490, 0, 6649, 74400, 1456, 7530,
- 11977, 7249, 8366, 0, 7756, 12342, 0, 51, 41516, 0, 8570, 9568, 0, 456,
- 7026, 8145, 1168, 9251, 9082, 0, 64055, 42781, 3866, 12323, 41512, 73805,
- 68121, 0, 41494, 0, 4660, 0, 10405, 0, 0, 0, 0, 42040, 73918, 119627,
- 7944, 41454, 12605, 0, 0, 41455, 236, 0, 0, 8214, 0, 0, 0, 41457, 0,
- 119589, 1969, 2384, 8097, 0, 0, 0, 0, 8766, 0, 917863, 5854, 0, 10583, 0,
- 119989, 0, 10416, 917869, 3872, 0, 0, 8429, 0, 0, 2838, 917867, 0, 0, 0,
- 0, 0, 0, 0, 917864, 120813, 10553, 1662, 8483, 0, 43605, 5892, 917868, 0,
- 73742, 66, 65, 68, 67, 70, 69, 72, 71, 74, 73, 76, 75, 78, 77, 80, 79,
- 82, 81, 84, 83, 86, 85, 88, 87, 90, 89, 0, 10357, 0, 8170, 1704, 8556, 0,
- 9659, 0, 0, 0, 9556, 0, 4503, 11353, 9647, 0, 0, 0, 0, 0, 0, 0, 0, 74229,
- 66593, 6438, 0, 9109, 119565, 1289, 64599, 0, 0, 0, 65507, 2447, 0, 0, 0,
- 0, 0, 0, 73750, 0, 0, 19937, 0, 0, 0, 5675, 254, 0, 0, 0, 42425, 8918,
- 64003, 5716, 42312, 0, 0, 6972, 42826, 0, 42464, 120567, 0, 0, 74796,
- 64400, 64693, 0, 0, 65429, 9515, 4435, 0, 0, 0, 0, 11785, 0, 64671,
- 41978, 1412, 4594, 1391, 10536, 8067, 9901, 7775, 0, 0, 74588, 120748,
- 3140, 0, 7960, 43271, 0, 12518, 10909, 0, 1428, 12472, 0, 0, 7699, 12393,
- 0, 0, 0, 74518, 9063, 0, 4261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64554,
- 10574, 3878, 0, 42352, 1752, 73785, 0, 42506, 0, 10199, 0, 0, 0, 65919,
- 0, 0, 720, 324, 0, 0, 0, 0, 1464, 40985, 0, 7974, 0, 68123, 0, 64488, 0,
- 0, 0, 74787, 0, 0, 0, 65597, 0, 0, 0, 1302, 0, 0, 0, 0, 0, 5204, 74774,
- 0, 0, 0, 3995, 0, 65608, 3714, 0, 0, 0, 10999, 11750, 0, 127004, 0, 0, 0,
- 0, 8130, 8672, 10845, 11964, 0, 0, 0, 0, 0, 42863, 73839, 0, 0, 0, 0, 0,
- 0, 468, 612, 0, 64401, 66448, 0, 0, 1674, 0, 5823, 0, 12280, 0, 540,
- 74564, 0, 0, 8432, 0, 11073, 0, 64316, 0, 0, 820, 41741, 0, 120667, 0,
- 64684, 126992, 3359, 7800, 0, 65177, 6226, 353, 12396, 0, 119612, 64742,
- 0, 0, 0, 0, 12412, 19941, 0, 120277, 0, 1884, 9481, 42418, 0, 41157, 0,
- 1195, 64898, 7924, 0, 41151, 2010, 0, 41328, 42344, 0, 12409, 0, 4360,
- 127009, 9739, 0, 74392, 73921, 0, 42521, 8539, 0, 0, 0, 0, 4788, 0, 0,
- 65734, 0, 64353, 0, 13075, 74429, 0, 64569, 43532, 10837, 2492, 0,
- 118901, 0, 41136, 64351, 11813, 9649, 41154, 119617, 5128, 4038, 41143,
- 65604, 64859, 41592, 0, 1648, 5435, 0, 0, 41343, 119848, 65439, 12709,
- 6986, 0, 0, 0, 41349, 0, 12581, 10374, 5175, 0, 73806, 10254, 0, 10278,
- 10262, 120295, 41346, 0, 607, 0, 0, 0, 12923, 10314, 10282, 65477, 10378,
- 120297, 40976, 8265, 0, 119834, 40975, 5840, 42838, 0, 40978, 0, 119840,
- 0, 0, 0, 66444, 10538, 0, 2550, 119836, 0, 0, 0, 3525, 0, 0, 0, 0, 5619,
+ 9772, 7255, 8886, 1389, 127932, 120257, 120258, 120259, 12941, 42661,
+ 92381, 120255, 120256, 12301, 120266, 69820, 41102, 66604, 120262,
+ 120263, 120264, 1017, 66600, 523, 505, 1447, 74436, 0, 0, 0, 8608, 42789,
+ 120613, 128704, 0, 119196, 11307, 66707, 917871, 127751, 11745, 7919, 0,
+ 1641, 0, 0, 8966, 0, 0, 5908, 0, 0, 6744, 128355, 1699, 74191, 74843, 0,
+ 0, 6306, 10169, 0, 119251, 10068, 3766, 2389, 120456, 120455, 6611, 257,
+ 43170, 13153, 0, 42386, 0, 9436, 2599, 0, 6496, 9449, 5930, 11476, 11033,
+ 11447, 10541, 5622, 120436, 8477, 3760, 1718, 9442, 66433, 3776, 0,
+ 41435, 4352, 0, 2435, 120809, 5621, 120385, 4201, 3778, 4203, 4202, 4205,
+ 4204, 120447, 3768, 68142, 765, 41440, 3764, 8473, 6373, 8469, 120438,
+ 12947, 4564, 0, 0, 74271, 73753, 8374, 0, 0, 6829, 5225, 128807, 127385,
+ 0, 0, 119615, 0, 74793, 5626, 73807, 11771, 0, 127236, 128019, 0, 5353,
+ 5625, 74179, 0, 0, 1010, 64572, 41780, 42623, 64277, 0, 6952, 0, 120752,
+ 78762, 2590, 5629, 65552, 7551, 10325, 5632, 10471, 120038, 120027,
+ 120028, 120025, 5628, 120031, 970, 120029, 4772, 2400, 5627, 120017,
+ 120018, 120023, 64275, 120021, 10961, 0, 203, 0, 0, 0, 0, 78350, 0,
+ 64378, 42054, 0, 0, 554, 119649, 11358, 0, 12182, 42048, 11065, 127878,
+ 73891, 0, 0, 5694, 7689, 69798, 9323, 4325, 3047, 10317, 175, 0, 0,
+ 69764, 0, 0, 1243, 42154, 5431, 6652, 0, 69770, 43651, 0, 68118, 128024,
+ 1129, 0, 0, 65900, 1986, 7846, 78804, 8661, 917772, 65255, 0, 3845, 4490,
+ 118969, 6649, 74400, 1456, 7530, 11977, 7249, 8366, 0, 7756, 12342,
+ 128568, 51, 41516, 0, 8570, 9568, 917863, 456, 7026, 8145, 1168, 9251,
+ 9082, 119964, 64055, 42781, 3866, 12323, 41512, 73805, 68121, 0, 41494,
+ 92316, 4660, 0, 10405, 0, 78803, 0, 0, 42040, 73918, 119627, 7944, 41454,
+ 12605, 0, 42205, 41455, 236, 64051, 78867, 8214, 0, 0, 0, 41457, 0,
+ 119589, 1969, 2384, 8097, 917864, 0, 127380, 78029, 8766, 0, 78079, 5854,
+ 127974, 10583, 0, 119989, 0, 10416, 917869, 3872, 917868, 0, 8429, 0,
+ 118806, 2838, 128802, 0, 917866, 0, 0, 0, 0, 0, 11096, 120813, 10553,
+ 1662, 8483, 120396, 43605, 5892, 43418, 0, 73742, 66, 65, 68, 67, 70, 69,
+ 72, 71, 74, 73, 76, 75, 78, 77, 80, 79, 82, 81, 84, 83, 86, 85, 88, 87,
+ 90, 89, 119862, 10357, 7385, 8170, 1704, 8556, 0, 9659, 0, 0, 0, 9556, 0,
+ 4503, 11353, 9647, 0, 78185, 0, 0, 92713, 78886, 0, 0, 74229, 66593,
+ 6438, 917979, 9109, 78882, 1289, 64599, 0, 0, 0, 65507, 2447, 0, 0,
+ 128042, 0, 0, 0, 6334, 0, 0, 19937, 0, 92368, 0, 5675, 254, 0, 0, 69686,
+ 42425, 8918, 64003, 5716, 42312, 0, 0, 6972, 42826, 0, 42464, 120567, 0,
+ 92645, 74796, 64400, 64693, 0, 77861, 65429, 9515, 4435, 0, 42522, 0, 0,
+ 11785, 0, 64671, 41978, 1412, 4594, 1391, 10536, 8067, 9901, 7775,
+ 128293, 0, 74588, 120748, 3140, 128854, 7960, 43271, 0, 12518, 10909,
+ 127508, 1428, 12472, 0, 128787, 7699, 12393, 0, 0, 0, 74518, 8223, 0,
+ 4261, 0, 0, 0, 0, 0, 128302, 0, 128046, 43419, 0, 64554, 10574, 3878, 0,
+ 42352, 1752, 73785, 0, 42506, 128541, 10199, 0, 0, 0, 65919, 0, 6695,
+ 720, 324, 0, 0, 43406, 0, 1464, 40985, 0, 7974, 0, 43474, 0, 64488, 0, 0,
+ 64041, 74787, 0, 78865, 92258, 65597, 0, 78863, 0, 1302, 0, 78861, 0, 0,
+ 0, 5204, 74774, 43404, 43396, 0, 3995, 68360, 65608, 3714, 0, 0, 0,
+ 10999, 11750, 0, 43251, 68660, 43301, 0, 120557, 8130, 8672, 10845,
+ 11964, 0, 0, 0, 0, 68455, 42863, 73839, 0, 0, 0, 0, 0, 0, 468, 612, 0,
+ 64401, 66448, 68376, 0, 1674, 0, 5823, 0, 12280, 0, 540, 74564, 119017,
+ 0, 8432, 0, 11073, 0, 64316, 0, 0, 820, 41741, 0, 120667, 0, 64684,
+ 126992, 3359, 7800, 128644, 65177, 6226, 353, 12396, 0, 119612, 64742,
+ 128682, 120282, 0, 0, 12412, 19941, 0, 120277, 78847, 1884, 9481, 42418,
+ 0, 41157, 0, 1195, 64898, 7924, 0, 41151, 2010, 0, 41328, 42344, 0,
+ 12409, 0, 4360, 127009, 9739, 0, 74392, 73921, 0, 42521, 8539, 0, 0,
+ 118986, 0, 4788, 0, 0, 65734, 0, 43790, 0, 13075, 74429, 0, 64569, 43532,
+ 10837, 2492, 127197, 118901, 68637, 41136, 43785, 11813, 9649, 41154,
+ 119617, 5128, 4038, 41143, 65604, 64859, 41592, 6771, 1648, 5435, 0,
+ 6734, 41343, 119848, 65439, 12709, 6986, 92364, 0, 0, 41349, 119123,
+ 12581, 10374, 5175, 0, 73806, 10254, 0, 10278, 10262, 77950, 41346, 0,
+ 607, 0, 119853, 128846, 12923, 10314, 10282, 65477, 10378, 120297, 40976,
+ 8265, 0, 119834, 40975, 5840, 42838, 0, 40978, 0, 119840, 0, 0, 0, 66444,
+ 10538, 0, 2550, 119836, 6779, 0, 0, 3525, 6824, 118886, 0, 0, 5619,
65822, 0, 194882, 7455, 0, 5616, 11486, 9656, 0, 0, 10727, 5615, 0,
- 120551, 42380, 64895, 0, 66451, 808, 5455, 11347, 0, 1026, 5620, 194887,
- 0, 11350, 5617, 0, 9225, 64639, 127073, 9145, 0, 1338, 120581, 0, 12739,
- 0, 3084, 0, 0, 41025, 6037, 0, 3974, 0, 10290, 0, 3083, 10322, 0, 0, 0,
- 41036, 0, 0, 43321, 65606, 0, 41032, 42388, 0, 64700, 10011, 1445, 40961,
- 0, 194893, 0, 40960, 0, 0, 0, 40963, 0, 10402, 0, 0, 0, 10603, 0, 0, 0,
- 0, 194923, 10083, 127069, 0, 194922, 0, 0, 0, 9073, 42585, 64302, 10704,
- 65030, 4787, 0, 74829, 0, 65423, 0, 0, 9570, 0, 9525, 2689, 917626,
- 65426, 0, 917624, 0, 0, 40966, 917623, 13286, 3998, 42598, 42596, 503, 0,
- 8735, 2690, 66488, 42836, 194913, 41954, 917617, 1652, 772, 194877, 8310,
- 65428, 3487, 0, 3585, 10194, 43320, 119159, 0, 194874, 6468, 41976, 9720,
- 917606, 11767, 41970, 0, 5836, 12358, 0, 4355, 9048, 12180, 65027, 64680,
- 65025, 64757, 0, 41488, 0, 8527, 194917, 12362, 12435, 12360, 41053,
- 3266, 0, 12356, 8616, 41466, 0, 0, 11450, 0, 3638, 12354, 0, 3216, 0,
- 2358, 0, 8633, 0, 0, 0, 0, 0, 0, 11759, 0, 0, 74823, 0, 41423, 8078,
- 10504, 0, 0, 0, 0, 7002, 0, 41430, 42267, 41051, 41484, 0, 0, 41050,
- 41473, 10466, 13099, 0, 0, 0, 6435, 0, 11362, 0, 0, 65382, 0, 41420, 0,
- 3625, 0, 41409, 0, 0, 2041, 9178, 9672, 41427, 43541, 43317, 0, 0, 0,
- 41424, 917598, 120546, 0, 0, 0, 41417, 1261, 0, 0, 12102, 119662, 41401,
- 0, 0, 0, 0, 0, 42290, 3275, 0, 42329, 0, 0, 0, 0, 0, 0, 10989, 74234, 0,
- 10598, 0, 2669, 903, 0, 2920, 0, 0, 74603, 64504, 19928, 0, 0, 3917, 0,
- 11732, 0, 0, 41448, 41461, 0, 0, 917558, 0, 8819, 12663, 0, 41184, 74014,
- 232, 74835, 120646, 9168, 65786, 0, 0, 0, 9094, 0, 11758, 0, 0, 1064,
- 42467, 0, 10115, 19924, 0, 0, 7862, 64551, 13224, 8516, 41862, 66650,
- 7561, 0, 74018, 1878, 0, 0, 2911, 0, 41178, 5427, 64823, 0, 0, 12617,
- 41174, 0, 41458, 0, 41463, 42413, 11292, 2406, 775, 0, 65584, 0, 6074,
- 9618, 194903, 0, 0, 0, 194901, 41436, 3656, 0, 194899, 41456, 0, 1599,
- 11333, 0, 8514, 8513, 0, 1613, 0, 0, 0, 0, 0, 0, 74500, 41460, 10145,
- 10542, 0, 120379, 0, 9905, 0, 65730, 0, 120374, 8427, 120375, 0, 120376,
- 0, 11497, 64687, 74008, 120371, 3871, 0, 0, 9111, 5741, 0, 194846,
- 120366, 119111, 120745, 0, 120369, 0, 11648, 0, 0, 120364, 41587, 120365,
- 0, 74322, 42113, 0, 0, 12172, 0, 74530, 0, 65723, 0, 73871, 65724, 7928,
- 120354, 0, 41595, 73730, 0, 42118, 73830, 66042, 10355, 0, 7875, 0,
- 41598, 3993, 0, 1545, 40971, 536, 0, 119959, 0, 0, 65173, 65286, 0, 0, 0,
- 0, 0, 0, 41375, 5402, 0, 0, 1687, 120503, 0, 0, 0, 64326, 40969, 10526,
- 0, 8323, 40968, 1339, 11731, 0, 0, 65460, 12242, 0, 8020, 10843, 11554,
- 0, 0, 8266, 41006, 65722, 0, 10710, 0, 118942, 0, 0, 119155, 195091, 0,
- 119636, 0, 120687, 0, 0, 11755, 66305, 0, 0, 10917, 120767, 0, 11272,
- 2040, 41247, 41326, 0, 1741, 42370, 1227, 0, 0, 11413, 0, 0, 0, 1586,
- 4978, 0, 1984, 0, 0, 120651, 40984, 0, 9373, 0, 12916, 6284, 0, 41663, 0,
- 0, 0, 9237, 9385, 41648, 0, 0, 0, 41666, 1830, 73783, 41076, 41287, 0, 0,
- 0, 0, 0, 0, 41987, 41676, 0, 120823, 0, 41670, 0, 0, 2796, 65167, 11683,
- 9902, 74521, 0, 11451, 0, 0, 42631, 2359, 0, 67844, 74164, 41238, 548,
- 11405, 13133, 64368, 0, 0, 0, 397, 64678, 42139, 9547, 9590, 0, 1614, 0,
- 64356, 66307, 6651, 1358, 0, 428, 9620, 1466, 0, 10982, 0, 1333, 0, 407,
- 6425, 0, 74253, 0, 0, 0, 5804, 11976, 8554, 0, 0, 0, 9057, 42294, 41218,
- 0, 0, 0, 1883, 10952, 8048, 0, 41225, 0, 118955, 0, 0, 0, 4407, 0, 65809,
- 119074, 194821, 8448, 68122, 74183, 0, 12675, 12659, 0, 42363, 120624,
- 194824, 119058, 10766, 12012, 2386, 64732, 9170, 917821, 9123, 64585,
- 120500, 0, 0, 42051, 0, 4164, 9081, 0, 120569, 42049, 42042, 8709, 0, 0,
- 120637, 42419, 0, 42047, 0, 0, 8470, 11807, 65897, 577, 0, 0, 74300, 0,
- 0, 74840, 0, 0, 0, 0, 8736, 1414, 42643, 9683, 0, 74344, 0, 2536, 0,
- 66330, 0, 0, 0, 0, 0, 0, 0, 66317, 0, 66315, 66316, 0, 11273, 0, 43004,
- 7541, 0, 0, 961, 64307, 66324, 0, 0, 3106, 65917, 41284, 1696, 0, 891,
- 12105, 0, 42624, 12802, 3264, 8824, 13268, 43003, 10936, 0, 0, 0, 0, 0,
- 0, 2322, 0, 0, 11449, 0, 42868, 41285, 3547, 0, 0, 0, 0, 43216, 6089, 0,
- 0, 0, 4170, 1029, 0, 0, 119224, 42374, 0, 744, 0, 0, 0, 65823, 0, 0,
- 3551, 0, 0, 4623, 0, 0, 4598, 0, 65136, 0, 0, 0, 10851, 0, 6179, 0, 6180,
- 0, 11952, 120778, 0, 11972, 0, 0, 0, 0, 177, 0, 6176, 120580, 0, 0, 6177,
- 9020, 0, 0, 6178, 120249, 120242, 0, 120243, 7518, 8754, 0, 120237,
- 74551, 43081, 0, 0, 9136, 120240, 4401, 41280, 0, 8974, 2308, 0, 74149,
- 0, 2318, 0, 66361, 8198, 0, 64360, 12601, 0, 65266, 120827, 74307, 0,
- 6970, 5404, 43332, 3667, 7936, 12925, 126989, 42055, 0, 0, 118949, 10874,
- 65505, 0, 0, 42053, 0, 42057, 11083, 42052, 0, 0, 73845, 0, 9665, 0, 0,
- 13181, 0, 0, 0, 0, 74148, 0, 0, 120225, 120229, 120224, 74172, 41145, 0,
- 0, 0, 41148, 8683, 7594, 0, 0, 119090, 10869, 0, 41146, 0, 11441, 0,
- 3512, 917612, 0, 8103, 0, 0, 65184, 11780, 41563, 42796, 0, 119106,
- 41544, 65146, 0, 0, 0, 0, 19942, 0, 118908, 7988, 10436, 74273, 3271,
- 73804, 64711, 0, 0, 0, 0, 3804, 13070, 11557, 42044, 0, 1095, 0, 3599, 0,
- 0, 0, 0, 0, 0, 0, 74346, 66697, 0, 11684, 0, 0, 0, 0, 42043, 0, 66677, 0,
- 42046, 120751, 4036, 0, 0, 0, 194862, 0, 11954, 0, 1450, 12986, 1340, 0,
- 65441, 0, 0, 0, 0, 0, 0, 0, 0, 6539, 0, 0, 0, 0, 0, 0, 41190, 3973,
- 194852, 4575, 41193, 7982, 429, 0, 0, 0, 194854, 65792, 0, 118968, 6417,
- 118918, 0, 0, 194850, 0, 0, 4919, 10590, 0, 7755, 0, 0, 64548, 0, 1621,
- 10214, 65126, 0, 0, 0, 12188, 0, 1617, 8050, 0, 5015, 0, 119174, 42590,
- 194871, 1756, 0, 0, 65768, 120694, 41892, 0, 7555, 13103, 5408, 2817,
- 1214, 0, 0, 0, 0, 0, 0, 0, 7957, 8689, 64723, 1056, 0, 74147, 0, 0, 0,
- 7073, 65850, 12327, 0, 119028, 0, 0, 0, 2341, 8450, 8484, 8474, 0, 0, 0,
- 8461, 0, 12153, 12799, 0, 120654, 120684, 9451, 7571, 13073, 0, 0, 681,
- 0, 703, 0, 3272, 8781, 12894, 0, 11709, 0, 74446, 0, 0, 0, 11338, 120768,
- 3276, 0, 0, 65928, 0, 0, 65021, 64795, 74574, 0, 10047, 0, 3262, 0, 0, 0,
- 0, 74329, 163, 576, 9895, 1655, 0, 74591, 0, 0, 0, 0, 0, 0, 10039, 0, 0,
- 5623, 5717, 5776, 0, 0, 0, 41591, 120586, 65252, 120795, 0, 0, 0, 0, 0,
- 0, 0, 8887, 0, 7295, 11031, 0, 43157, 0, 8946, 10348, 10412, 8755, 0, 0,
- 5718, 13221, 0, 0, 0, 0, 0, 8810, 74499, 686, 0, 0, 4619, 118954, 6654,
- 73769, 0, 0, 12040, 65689, 10128, 65118, 0, 119151, 118891, 0, 0, 2401,
- 68144, 8792, 0, 0, 65455, 0, 0, 0, 119129, 0, 12886, 0, 66624, 0, 43557,
- 10300, 10161, 10396, 74135, 0, 0, 0, 73851, 3010, 6441, 0, 1458, 41475,
- 0, 0, 0, 11479, 0, 0, 9100, 12864, 0, 0, 1061, 64780, 2001, 43111, 0, 0,
- 4052, 0, 7626, 0, 0, 1045, 0, 5631, 0, 0, 0, 0, 74127, 0, 0, 8486, 0,
- 73758, 2335, 4362, 0, 0, 73867, 1025, 0, 42625, 0, 0, 41443, 0, 0, 0,
- 1774, 1523, 0, 0, 41445, 0, 0, 8567, 41442, 3988, 0, 0, 118910, 0, 65274,
- 8564, 0, 0, 0, 0, 0, 65908, 0, 66513, 6256, 0, 579, 0, 10206, 0, 0, 2673,
- 0, 11814, 0, 4488, 0, 0, 0, 10444, 120820, 0, 11799, 74407, 0, 4487, 0,
- 42832, 1032, 0, 120736, 0, 7203, 0, 614, 0, 0, 120615, 0, 0, 0, 0, 0,
- 43121, 0, 0, 0, 1050, 7549, 0, 0, 9314, 0, 0, 120616, 0, 10057, 0, 0, 0,
- 66504, 0, 0, 2307, 0, 64333, 0, 0, 73873, 0, 0, 0, 0, 0, 0, 10360, 0, 0,
- 0, 440, 0, 13085, 9233, 74216, 0, 0, 0, 0, 66447, 8046, 64963, 65777,
- 10125, 74212, 42819, 10910, 0, 1521, 9896, 0, 10487, 0, 12527, 0, 7970,
- 0, 0, 0, 65769, 5243, 9849, 5239, 65771, 0, 0, 5237, 0, 0, 10103, 5247,
- 4769, 0, 118977, 0, 5764, 0, 0, 3008, 4896, 0, 12087, 0, 0, 41103, 0,
- 64565, 4773, 0, 0, 0, 4770, 0, 917567, 8731, 65378, 0, 120619, 9122, 0,
- 0, 4774, 3019, 9997, 12834, 0, 9456, 10215, 0, 0, 0, 0, 0, 74776, 4281,
- 4768, 0, 41535, 4099, 9017, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42814, 880, 0,
- 0, 0, 0, 0, 10116, 9877, 0, 0, 0, 7095, 0, 0, 120632, 0, 0, 8243, 2427,
- 0, 7093, 0, 11585, 0, 0, 0, 12223, 0, 0, 1434, 0, 5637, 11573, 0, 0, 0,
- 19951, 0, 0, 0, 0, 64432, 0, 0, 118888, 1156, 8740, 0, 3782, 64331, 0,
- 41370, 1014, 8261, 0, 0, 10835, 0, 65536, 0, 120463, 0, 7702, 118824, 0,
- 43010, 65779, 65783, 1150, 10547, 5700, 0, 120603, 65383, 2339, 42594,
- 5697, 118788, 0, 0, 0, 42257, 5696, 120470, 120465, 3862, 9643, 0, 0,
- 7634, 0, 9845, 0, 0, 5701, 9722, 41490, 0, 1426, 120474, 0, 0, 0, 74345,
- 8571, 194991, 0, 0, 0, 0, 43182, 12184, 0, 42022, 0, 10281, 0, 5650,
- 43194, 64712, 0, 0, 990, 5647, 0, 0, 0, 41114, 11477, 5646, 0, 11018, 0,
- 3945, 0, 0, 0, 0, 0, 0, 0, 1020, 73763, 0, 0, 5648, 64748, 0, 0, 10205,
- 3545, 0, 6984, 0, 74051, 0, 118868, 120458, 2667, 0, 0, 0, 9911, 0,
- 65020, 10097, 119166, 0, 0, 118836, 0, 0, 1140, 0, 0, 10159, 0, 0, 8128,
- 0, 0, 0, 1815, 19910, 890, 0, 3267, 0, 0, 10123, 0, 4410, 1041, 10576,
- 8102, 0, 580, 74232, 0, 0, 0, 0, 0, 19938, 65906, 0, 0, 0, 3298, 5375,
- 10142, 0, 8215, 0, 6134, 41246, 64402, 0, 0, 0, 0, 0, 41382, 0, 0, 5173,
- 65348, 527, 0, 0, 0, 0, 0, 11915, 0, 0, 10072, 0, 66434, 2329, 42250, 0,
- 0, 0, 12245, 119237, 0, 0, 0, 0, 0, 74328, 0, 74769, 0, 0, 9069, 6144, 0,
- 0, 73822, 0, 0, 64917, 41521, 118934, 494, 13250, 0, 65098, 0, 956, 0,
- 12830, 10462, 73740, 0, 0, 0, 0, 66449, 13263, 0, 0, 13171, 0, 0, 0, 0,
- 0, 1044, 41276, 0, 0, 0, 42068, 11795, 0, 0, 0, 0, 42450, 3907, 0, 64526,
- 0, 0, 12295, 0, 11475, 0, 3020, 11537, 0, 66441, 0, 0, 0, 0, 1057, 566,
- 0, 0, 3016, 42274, 0, 66490, 12921, 66571, 0, 0, 3006, 4620, 0, 0, 0, 0,
- 64659, 0, 0, 0, 43333, 68129, 8626, 0, 0, 9090, 65377, 41596, 0, 0, 1698,
- 0, 64477, 0, 0, 1053, 0, 0, 0, 0, 1052, 1051, 459, 1060, 74349, 66479, 0,
- 0, 0, 0, 42490, 689, 6508, 4163, 42298, 8639, 66641, 4246, 0, 0, 12130,
- 0, 42337, 64596, 64375, 66481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1926, 0, 0, 7898, 8110, 10935, 0, 0, 5830, 0, 64594, 0, 0, 0, 0, 8693, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119187, 11439, 0, 0, 0, 0, 42313,
- 5579, 0, 0, 0, 0, 0, 5578, 41774, 0, 42023, 6234, 5669, 0, 0, 0, 0, 0, 0,
- 5583, 0, 0, 42426, 5580, 42276, 2923, 892, 5582, 42465, 41330, 0, 5795,
- 65512, 0, 65702, 0, 120801, 65251, 0, 65710, 0, 0, 0, 0, 5370, 0, 0,
- 1638, 10966, 10188, 65878, 118848, 0, 0, 0, 0, 8172, 42017, 0, 10844, 0,
- 0, 0, 0, 0, 0, 286, 0, 1062, 0, 0, 0, 0, 0, 1070, 64900, 0, 6095, 41865,
- 0, 3015, 0, 917763, 5211, 0, 6400, 0, 194983, 0, 8189, 11276, 0, 0, 372,
- 0, 0, 118874, 42102, 41585, 0, 0, 42101, 276, 0, 0, 33, 74226, 0, 9007,
- 118796, 41588, 66033, 427, 10763, 0, 0, 0, 0, 1031, 6257, 0, 42104, 0, 0,
- 2328, 0, 1071, 0, 0, 74848, 0, 0, 0, 1047, 0, 0, 64790, 0, 0, 10651, 0,
- 0, 0, 0, 0, 119181, 5711, 41633, 12098, 65571, 9166, 0, 5710, 0, 0,
- 65213, 13216, 0, 0, 0, 0, 64611, 41623, 0, 5715, 0, 0, 0, 5712, 2761,
- 41620, 68124, 3074, 5722, 0, 8643, 73768, 0, 118906, 2757, 11067, 9718,
- 74498, 8910, 10689, 6479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118911, 0, 0, 0,
- 0, 0, 120010, 0, 8701, 68130, 119616, 120522, 0, 42477, 0, 12123, 4495,
- 43569, 0, 0, 0, 64946, 10992, 0, 0, 0, 0, 9318, 120661, 13249, 65679,
- 73808, 0, 65457, 42249, 7639, 0, 67845, 42641, 5454, 0, 0, 194997,
- 120005, 0, 0, 5084, 0, 0, 119173, 0, 733, 0, 0, 0, 0, 41677, 0, 9218,
- 1731, 0, 0, 0, 0, 0, 0, 0, 0, 127018, 0, 5155, 0, 5358, 0, 0, 917767,
- 64424, 0, 3840, 64314, 41432, 0, 0, 0, 0, 0, 65943, 0, 3371, 10988, 0,
- 8771, 1479, 0, 0, 1109, 11580, 0, 64601, 12205, 0, 0, 64507, 8868, 399,
- 0, 74842, 0, 0, 12149, 13088, 551, 0, 10156, 12119, 0, 0, 2544, 65074, 0,
- 0, 0, 0, 351, 119149, 0, 0, 0, 0, 74268, 0, 0, 0, 42377, 0, 0, 0, 0, 0,
- 9013, 5588, 0, 0, 0, 0, 73960, 5585, 65881, 2549, 74469, 0, 0, 5584,
- 8358, 0, 74411, 0, 10919, 0, 7980, 0, 0, 0, 41800, 5589, 0, 2664, 41613,
- 5586, 118890, 0, 11356, 0, 0, 0, 0, 0, 42573, 67856, 0, 0, 0, 0, 0, 8135,
- 6450, 10055, 0, 0, 0, 0, 5657, 0, 9626, 0, 0, 10179, 5654, 12939, 0,
- 120799, 0, 0, 5652, 10945, 0, 0, 0, 3661, 7863, 0, 0, 0, 0, 0, 5659, 0,
- 0, 66729, 5655, 0, 42168, 0, 1055, 917628, 0, 66310, 74030, 0, 12146,
- 73955, 73956, 11618, 0, 126990, 0, 10272, 10304, 10368, 42518, 594,
- 10244, 10248, 10256, 0, 64870, 0, 3467, 0, 0, 3331, 946, 10231, 1495,
- 8131, 74330, 0, 9562, 0, 65927, 0, 0, 120155, 0, 64656, 0, 0, 194837, 0,
- 5666, 65227, 5318, 0, 0, 9091, 10798, 0, 0, 10186, 0, 7732, 0, 64556, 0,
- 0, 5668, 74445, 0, 0, 5670, 0, 0, 11820, 2992, 7826, 5667, 19952, 120807,
- 0, 12749, 0, 0, 0, 66496, 4361, 119260, 1306, 9286, 1497, 0, 0, 0, 0,
- 3571, 13247, 0, 7973, 66353, 0, 0, 67896, 43192, 0, 0, 553, 120653, 0, 0,
- 5829, 0, 4587, 0, 65912, 0, 12746, 0, 0, 119924, 5633, 119927, 0, 0, 0,
- 64905, 0, 9512, 0, 12742, 6443, 0, 0, 9135, 0, 0, 0, 0, 0, 0, 0, 12148,
- 0, 0, 0, 64256, 0, 11669, 0, 5634, 4524, 0, 0, 0, 118880, 74266, 65182,
- 0, 0, 5221, 0, 328, 0, 0, 0, 5636, 0, 5329, 0, 5638, 119918, 7940, 64938,
- 43223, 0, 5635, 3373, 2986, 0, 74223, 3437, 0, 6203, 4247, 0, 11920,
- 8274, 0, 0, 1657, 119921, 0, 0, 5639, 2954, 5660, 5640, 0, 0, 0, 0, 0, 0,
- 41637, 0, 0, 0, 41625, 0, 0, 120713, 11705, 5642, 0, 0, 0, 4356, 11710,
- 0, 12051, 0, 0, 5641, 8259, 0, 1058, 0, 67630, 0, 0, 1144, 0, 0, 0, 0,
- 73890, 118972, 0, 73734, 0, 5645, 64964, 8652, 2547, 66484, 0, 0, 5608,
- 65890, 0, 0, 67621, 119934, 9000, 0, 0, 0, 1865, 0, 5613, 74267, 0, 0,
- 5610, 0, 0, 65826, 5612, 0, 10787, 917551, 2997, 0, 5609, 0, 65319,
- 119933, 12316, 65376, 2412, 0, 8186, 9807, 74269, 0, 13130, 65874, 0,
- 5807, 0, 10030, 5306, 12936, 0, 0, 11704, 0, 0, 10211, 0, 0, 0, 0, 11706,
- 9710, 0, 0, 0, 413, 65623, 74237, 0, 9133, 74262, 0, 1042, 0, 64779,
- 12171, 119240, 6185, 64776, 4984, 0, 708, 0, 0, 12241, 0, 0, 1308, 0,
- 2534, 810, 0, 0, 0, 0, 0, 1917, 3000, 0, 0, 120739, 2364, 0, 74470,
- 66618, 65680, 0, 10027, 0, 0, 12337, 120722, 0, 0, 2980, 755, 0, 931,
- 13124, 68182, 0, 2748, 0, 0, 65041, 0, 73998, 8730, 0, 0, 119009, 7274,
- 119250, 0, 7275, 0, 935, 0, 65840, 377, 42325, 11649, 0, 65253, 64301, 0,
- 0, 42341, 65284, 2417, 0, 12884, 19912, 7907, 10768, 0, 194998, 0, 10673,
- 119217, 7248, 0, 0, 1781, 5496, 3627, 62, 1649, 0, 964, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 13142, 0, 42415, 66575, 4542, 74037, 43547, 0, 0, 0, 2991,
- 4946, 42454, 0, 7949, 0, 0, 11341, 42494, 3073, 65625, 9714, 11692, 0, 0,
- 0, 6478, 9898, 0, 65237, 6241, 0, 4877, 0, 6238, 0, 10548, 127049, 4409,
- 0, 0, 64798, 0, 5346, 0, 120528, 6237, 5461, 0, 9176, 0, 0, 65231, 65884,
- 12678, 0, 0, 11378, 0, 42785, 2408, 3251, 0, 0, 5685, 0, 2461, 11052,
- 7091, 5342, 8317, 0, 68163, 5340, 0, 0, 0, 73928, 0, 0, 0, 0, 0, 65482,
- 0, 9142, 0, 0, 0, 10938, 0, 118790, 1182, 2542, 4826, 0, 0, 0, 529, 8580,
- 0, 0, 10586, 10790, 11987, 66023, 41593, 41207, 0, 0, 41594, 225, 42828,
- 0, 0, 0, 64705, 74379, 10721, 0, 3438, 42097, 0, 11084, 3194, 41870, 266,
- 0, 0, 41873, 120575, 11324, 0, 0, 8420, 64918, 0, 41871, 41338, 3734,
- 7734, 0, 8750, 66605, 66011, 0, 40965, 0, 0, 5161, 10572, 0, 0, 0, 64349,
- 7287, 42162, 0, 0, 0, 11948, 0, 12359, 66674, 41369, 1697, 12191, 0, 0,
- 7286, 0, 0, 10031, 0, 9870, 0, 8620, 65824, 0, 11938, 0, 7285, 0, 119577,
- 0, 0, 0, 41583, 0, 65799, 0, 0, 0, 0, 0, 66199, 0, 3609, 0, 0, 832,
- 120693, 120770, 0, 66007, 0, 65703, 0, 0, 0, 5180, 0, 41395, 41530,
- 11691, 64773, 0, 74002, 0, 0, 0, 11036, 243, 13200, 0, 6024, 0, 74398,
- 10037, 41529, 10648, 8538, 0, 0, 0, 4285, 66195, 0, 4230, 0, 13307, 0, 0,
- 7563, 42376, 0, 0, 120512, 0, 0, 214, 0, 0, 0, 65893, 12208, 120488, 0,
- 66311, 65589, 0, 2603, 0, 0, 0, 0, 0, 6022, 0, 2884, 0, 11620, 0, 43, 0,
- 66453, 1016, 41107, 0, 41121, 3885, 92, 65456, 64608, 0, 74801, 0, 12451,
- 0, 0, 0, 12453, 0, 0, 74241, 0, 8890, 12457, 0, 0, 0, 0, 118819, 0, 0, 0,
- 66637, 7995, 8759, 0, 0, 12449, 0, 0, 0, 8752, 3197, 4720, 10165, 0,
- 119249, 0, 11595, 64893, 0, 120180, 0, 0, 4993, 0, 6168, 10934, 1946,
- 741, 0, 5494, 4639, 0, 1990, 66589, 4498, 0, 0, 0, 0, 0, 2960, 73779, 0,
- 8969, 0, 0, 0, 0, 2950, 0, 6210, 0, 370, 0, 0, 0, 4953, 0, 0, 0, 0, 0, 0,
- 0, 65688, 0, 5063, 3517, 2964, 0, 0, 65094, 74791, 10566, 10144, 66333,
- 8252, 729, 66016, 0, 0, 0, 64923, 0, 65208, 9032, 0, 0, 0, 41215, 0,
- 65883, 0, 0, 120602, 3761, 0, 0, 0, 0, 12912, 119012, 3850, 0, 0, 0, 0,
- 0, 908, 0, 8611, 0, 0, 0, 0, 0, 0, 8978, 120540, 119135, 41586, 10527, 0,
- 917848, 3848, 0, 0, 0, 65241, 5336, 0, 0, 663, 0, 10780, 0, 0, 0, 0, 0,
- 0, 347, 0, 0, 0, 64675, 41582, 119126, 0, 65579, 12980, 0, 12143, 73733,
- 0, 0, 0, 41804, 0, 0, 0, 0, 0, 41584, 10681, 0, 0, 73938, 0, 0, 4800,
- 66661, 0, 66306, 64715, 0, 9518, 6609, 10434, 0, 11319, 1097, 0, 917850,
- 41730, 0, 0, 0, 0, 65172, 41728, 41721, 0, 0, 0, 41203, 0, 13110, 41726,
- 0, 0, 1000, 0, 0, 41140, 1209, 0, 0, 0, 1073, 0, 0, 41138, 0, 0, 0,
- 12167, 1115, 41605, 9794, 127062, 127063, 127064, 12237, 127066, 66314,
- 6587, 9290, 0, 0, 9231, 0, 2959, 7926, 0, 0, 0, 64398, 0, 119970, 12311,
- 0, 0, 118846, 0, 0, 0, 119973, 0, 0, 0, 12290, 0, 0, 0, 42142, 10151,
- 8205, 0, 5131, 0, 9627, 0, 0, 0, 0, 1944, 1248, 10148, 0, 119990, 119991,
- 12701, 119993, 11308, 119995, 0, 119997, 119998, 65305, 74263, 4031,
- 42794, 120003, 7075, 8154, 120006, 120007, 41817, 73934, 42275, 120011,
- 120012, 120013, 120014, 120015, 6041, 0, 41899, 0, 8002, 0, 4364, 0, 0,
- 64332, 0, 7813, 9064, 119986, 10124, 7526, 8601, 7281, 0, 7279, 12041,
- 1418, 10885, 12673, 0, 0, 9660, 0, 13012, 4571, 0, 0, 0, 12078, 2970, 0,
- 10933, 0, 0, 0, 0, 0, 41599, 0, 0, 0, 12950, 0, 3486, 0, 0, 4239, 0, 0,
- 66511, 0, 2637, 64629, 8460, 127053, 8476, 0, 0, 0, 0, 65673, 1019, 0,
- 4148, 0, 12289, 0, 4316, 0, 13119, 0, 5412, 66243, 10744, 0, 73864, 0,
- 41734, 8206, 74081, 9163, 3286, 9072, 5867, 13302, 7622, 0, 41736, 0,
- 41731, 0, 9483, 5416, 0, 119593, 10817, 0, 41539, 0, 0, 73963, 41855,
- 41867, 65564, 11277, 65892, 11536, 10620, 0, 12210, 0, 73932, 5498,
- 73942, 41536, 0, 0, 0, 3459, 8997, 0, 0, 0, 0, 0, 0, 66377, 0, 0, 0, 0,
- 3161, 295, 0, 0, 0, 0, 0, 9016, 0, 63903, 63902, 63901, 0, 3971, 0,
- 73972, 2952, 0, 11038, 10901, 63900, 63899, 63898, 0, 667, 12332, 63887,
- 6086, 41722, 0, 5172, 0, 0, 4159, 0, 0, 9815, 63884, 19934, 63882, 41198,
- 8555, 63878, 63877, 42460, 6050, 0, 63881, 63872, 0, 42421, 0, 41723,
- 63875, 63874, 11460, 7432, 1913, 41913, 63852, 0, 0, 42348, 0, 74841,
- 446, 41911, 0, 63851, 63850, 41910, 0, 63846, 2972, 12932, 7262, 0,
- 63849, 63848, 63847, 0, 0, 8302, 7259, 63842, 4178, 10746, 7250, 13214,
- 10041, 8105, 63892, 0, 118983, 1105, 4180, 0, 12094, 9497, 0, 63891,
- 63890, 63889, 63888, 5538, 9987, 0, 118932, 1678, 13274, 552, 0, 0,
- 10785, 0, 119170, 4557, 0, 9159, 10171, 13125, 63860, 5540, 63858, 63865,
- 281, 13242, 63862, 74154, 0, 5536, 65568, 63857, 1388, 74169, 0, 1077, 0,
- 65099, 11531, 0, 0, 0, 0, 0, 42773, 0, 0, 0, 119220, 0, 3663, 0, 1112,
- 119122, 8686, 0, 5334, 65081, 0, 74778, 0, 11077, 0, 6509, 0, 5327, 0,
- 19907, 63869, 3478, 7583, 7679, 2903, 0, 3001, 1158, 8745, 0, 73748,
- 63866, 0, 1915, 4846, 0, 66371, 118984, 42105, 2990, 120128, 805, 120130,
- 120125, 12070, 8760, 1117, 118987, 12212, 120123, 65174, 42357, 63835,
- 63834, 0, 0, 12225, 63838, 63837, 0, 0, 63833, 6042, 66360, 8083, 0, 0,
- 63821, 63820, 63819, 63818, 0, 5227, 9047, 63822, 0, 6091, 0, 10691, 560,
- 5643, 8226, 119578, 63812, 63811, 63810, 63809, 5542, 63815, 63814,
- 63813, 6047, 1597, 120143, 780, 206, 0, 4936, 65147, 8168, 63930, 0,
- 1093, 9882, 63934, 63933, 63932, 917554, 63929, 3546, 1605, 0, 9806,
- 65566, 0, 8400, 11343, 63920, 0, 63926, 2984, 5968, 9287, 0, 4618, 0, 0,
- 13169, 5290, 5283, 1695, 10743, 1088, 63825, 7268, 1084, 1085, 63829,
- 1083, 10131, 7283, 0, 63970, 0, 1092, 4754, 7273, 5252, 0, 0, 0, 0, 0,
- 11809, 0, 0, 0, 2965, 7258, 8808, 0, 1089, 4187, 63937, 42119, 42120, 0,
- 940, 5787, 10099, 63938, 0, 74494, 12463, 2994, 0, 0, 0, 9664, 0, 0, 0,
- 0, 74343, 0, 0, 660, 10127, 666, 9022, 5532, 0, 5533, 0, 0, 6118, 222,
- 979, 3884, 0, 74151, 120445, 6502, 0, 127118, 0, 63951, 12465, 0, 0, 0,
+ 120551, 42380, 64895, 43693, 66451, 808, 5455, 11347, 0, 1026, 5620,
+ 194887, 0, 11350, 5617, 0, 9225, 64639, 127073, 9145, 128060, 1338,
+ 120581, 0, 12739, 4603, 3084, 0, 92484, 9858, 6037, 0, 3974, 78213,
+ 10290, 0, 3083, 10322, 0, 0, 0, 41036, 0, 0, 43321, 65606, 0, 41032,
+ 42388, 0, 64700, 10011, 1445, 40961, 0, 194893, 0, 40960, 0, 194891, 0,
+ 40963, 64952, 10402, 0, 0, 92304, 10603, 0, 0, 0, 0, 6714, 10083, 127069,
+ 194895, 78367, 127377, 0, 0, 9073, 42585, 64302, 10704, 65030, 4787, 0,
+ 74829, 0, 65423, 0, 128118, 9570, 0, 9525, 2689, 917626, 65426, 0,
+ 917624, 43740, 0, 40966, 917623, 13286, 3998, 42598, 42596, 503, 74237,
+ 8735, 2690, 66488, 42836, 127150, 41954, 917617, 1652, 772, 6688, 8310,
+ 65428, 3487, 43416, 3585, 10194, 43320, 119159, 128183, 194874, 6468,
+ 41976, 9720, 917606, 11767, 41970, 0, 5836, 12358, 0, 4355, 9048, 12180,
+ 65027, 64680, 13038, 43699, 0, 41488, 128087, 8527, 194917, 12362, 12435,
+ 12360, 41053, 3266, 0, 12356, 8616, 41466, 0, 92588, 11450, 0, 3638,
+ 12354, 0, 3216, 0, 2358, 92606, 8633, 0, 0, 119182, 69244, 0, 0, 11759,
+ 194903, 6368, 74823, 0, 41423, 8078, 10504, 0, 41698, 42237, 0, 7002, 0,
+ 41430, 42267, 41051, 41484, 0, 0, 41050, 41473, 10466, 13099, 0, 0, 0,
+ 6435, 0, 11362, 0, 0, 65382, 0, 41420, 0, 3625, 78157, 41409, 0, 69639,
+ 2041, 9178, 9672, 41427, 43541, 43317, 0, 0, 0, 41424, 917598, 120546, 0,
+ 128212, 0, 41417, 1261, 0, 0, 12102, 119662, 41401, 0, 127538, 0, 78251,
+ 0, 42290, 3275, 92472, 42329, 74759, 0, 0, 0, 92388, 69649, 10989, 74234,
+ 0, 10598, 7410, 2669, 903, 0, 2920, 0, 127232, 74603, 64504, 19928, 0, 0,
+ 3917, 0, 11732, 0, 0, 41448, 41461, 128823, 0, 127912, 0, 8819, 12663, 0,
+ 41184, 74014, 232, 74835, 120646, 9168, 65786, 0, 0, 0, 9094, 0, 11758,
+ 68425, 0, 1064, 42467, 128044, 10115, 19924, 92711, 0, 7862, 64551,
+ 13224, 8516, 41862, 66650, 7561, 78618, 69793, 1878, 0, 0, 2911, 0,
+ 41178, 5427, 64823, 0, 0, 3787, 41174, 0, 41458, 0, 41463, 42413, 11292,
+ 2406, 775, 0, 65584, 0, 6074, 9618, 128668, 0, 43440, 0, 194901, 41436,
+ 3656, 0, 194899, 41456, 0, 1599, 11333, 0, 6703, 8513, 0, 1613, 0, 68456,
+ 12598, 0, 120734, 78745, 74500, 41460, 10145, 10542, 9937, 78746, 0,
+ 9905, 0, 65730, 0, 120374, 8427, 120375, 55246, 120376, 0, 11497, 64687,
+ 74008, 42592, 3871, 0, 128305, 9111, 5741, 0, 194846, 120366, 119111,
+ 120745, 0, 120368, 0, 11648, 0, 194873, 120364, 41587, 120365, 0, 74322,
+ 42113, 0, 127155, 12172, 0, 74530, 65298, 65723, 194840, 73871, 65724,
+ 7928, 120354, 0, 41595, 73730, 0, 42118, 73830, 66042, 10355, 0, 7875, 0,
+ 41598, 3993, 0, 1545, 40971, 536, 128521, 43029, 0, 0, 65173, 65286, 0,
+ 0, 0, 0, 0, 0, 41375, 5402, 0, 0, 1687, 120503, 0, 0, 78194, 64326,
+ 40969, 10526, 78753, 8323, 40968, 1339, 11731, 78756, 0, 65460, 12242,
+ 128513, 8020, 10843, 11554, 0, 0, 8266, 41006, 65722, 0, 10710, 0,
+ 118942, 67667, 64567, 119155, 195091, 0, 119636, 67857, 120687, 0, 0,
+ 11755, 66305, 0, 0, 10917, 120767, 0, 11272, 2040, 41247, 41326, 195060,
+ 1741, 42370, 1227, 0, 0, 11413, 0, 0, 5283, 1586, 4978, 0, 1984, 194621,
+ 0, 92293, 40984, 128306, 9373, 0, 12916, 6284, 0, 41663, 0, 0, 0, 9237,
+ 9385, 41648, 0, 0, 0, 41666, 1830, 73783, 2056, 41287, 92610, 0, 0,
+ 42219, 128257, 0, 41987, 41676, 0, 120823, 0, 41670, 0, 92590, 2796,
+ 55291, 11683, 9902, 74521, 0, 11451, 0, 128822, 42631, 2359, 0, 67844,
+ 74164, 41238, 548, 11405, 13133, 64368, 0, 128795, 0, 397, 43622, 42139,
+ 9547, 9590, 128238, 1614, 43661, 64356, 66307, 6651, 1358, 0, 428, 9620,
+ 1466, 78112, 10982, 118831, 1333, 7104, 407, 6425, 128834, 74253, 0, 0,
+ 0, 5804, 11976, 8554, 92721, 0, 0, 9057, 42294, 41218, 0, 0, 78137, 1883,
+ 10952, 8048, 78142, 41225, 92621, 42915, 0, 128684, 0, 4407, 0, 65809,
+ 119074, 194821, 8448, 7141, 74183, 0, 12675, 12659, 0, 42363, 120624,
+ 194824, 55273, 10766, 12012, 2386, 64732, 9170, 917821, 9123, 64585,
+ 120500, 0, 7140, 10977, 127378, 4164, 9081, 0, 120569, 42049, 42042,
+ 8709, 128283, 0, 120637, 42419, 64799, 42047, 0, 0, 8470, 11807, 65897,
+ 577, 0, 0, 74300, 0, 127308, 74840, 0, 0, 128791, 92224, 8736, 1414,
+ 42643, 9683, 43486, 74344, 0, 2536, 0, 66330, 0, 0, 0, 0, 0, 0, 0, 66317,
+ 917612, 66315, 2106, 120222, 11273, 0, 43004, 7541, 0, 0, 961, 64307,
+ 66324, 64906, 128591, 3106, 65917, 41284, 1696, 0, 891, 12105, 0, 42624,
+ 12802, 3264, 8824, 13268, 43003, 10936, 0, 0, 0, 194826, 92688, 0, 2322,
+ 120371, 0, 11449, 128187, 42868, 41285, 3547, 0, 0, 0, 0, 43216, 6089,
+ 78682, 0, 120578, 4170, 1029, 127761, 127036, 119224, 42374, 0, 744, 0,
+ 0, 0, 65823, 127826, 0, 3551, 0, 0, 4623, 55268, 0, 4598, 0, 65136,
+ 127136, 0, 0, 10851, 0, 6179, 92602, 6180, 0, 11952, 120778, 78648,
+ 11972, 78646, 78647, 78644, 78645, 177, 78643, 6176, 120580, 0, 0, 6177,
+ 9020, 78652, 78653, 6178, 120249, 120242, 128027, 67673, 7518, 8754, 0,
+ 120237, 2137, 43081, 0, 0, 9136, 120240, 4401, 41280, 0, 8974, 2308, 0,
+ 74149, 0, 2318, 0, 66361, 8198, 0, 64360, 12601, 42536, 65266, 120827,
+ 74307, 0, 6970, 5404, 43332, 3667, 7936, 12925, 126989, 6385, 0, 0,
+ 118949, 10874, 65505, 128083, 0, 42053, 2075, 42057, 11083, 42052, 0, 0,
+ 67651, 0, 9665, 92300, 0, 13181, 0, 0, 0, 0, 74148, 0, 0, 120225, 120229,
+ 120224, 74172, 41145, 0, 0, 0, 41148, 8683, 7594, 127519, 0, 119090,
+ 10869, 43458, 41146, 92407, 11441, 0, 3512, 119633, 0, 8103, 0, 0, 65184,
+ 11780, 41563, 42796, 0, 69742, 41544, 65146, 0, 0, 0, 0, 19942, 0,
+ 118908, 7988, 10436, 74273, 3271, 73804, 64711, 0, 0, 0, 0, 3804, 13070,
+ 11557, 42044, 0, 1095, 0, 3599, 127774, 0, 128861, 8514, 0, 0, 0, 74346,
+ 66697, 0, 11684, 0, 92486, 0, 0, 42043, 43232, 66677, 0, 42046, 78241,
+ 4036, 0, 0, 128213, 194861, 0, 11954, 0, 1450, 12986, 1340, 0, 65441,
+ 92722, 0, 0, 127772, 0, 917542, 0, 0, 6539, 0, 0, 0, 194856, 0, 120492,
+ 41190, 3973, 119365, 4575, 41193, 7982, 429, 0, 127194, 0, 194854, 65792,
+ 0, 118968, 6417, 118918, 78178, 0, 194850, 0, 0, 4919, 10590, 0, 7755, 0,
+ 0, 64548, 120506, 1621, 10214, 65126, 0, 127004, 0, 12188, 0, 1617, 8050,
+ 0, 5015, 0, 119174, 42590, 194871, 1756, 78181, 0, 65768, 6352, 41892, 0,
+ 7555, 13103, 5408, 2817, 1214, 0, 92335, 0, 0, 0, 0, 127195, 7957, 8689,
+ 64723, 1056, 42896, 74147, 194813, 0, 55286, 7073, 65850, 12327, 0,
+ 119028, 0, 0, 0, 2341, 8450, 8484, 8474, 0, 0, 0, 8461, 128102, 12153,
+ 12799, 0, 43709, 43708, 9451, 7571, 13073, 0, 0, 681, 0, 703, 0, 3272,
+ 8781, 12894, 0, 11709, 92288, 74446, 0, 92532, 0, 11338, 120768, 3276, 0,
+ 0, 65928, 0, 0, 65021, 64795, 74574, 0, 10047, 78814, 3262, 78811, 42711,
+ 0, 0, 68478, 163, 576, 9895, 1655, 78817, 74591, 78815, 78816, 0, 0, 0,
+ 0, 10039, 0, 0, 5623, 5717, 5776, 0, 0, 0, 41591, 11036, 65252, 92382, 0,
+ 0, 0, 67848, 0, 0, 0, 8887, 0, 7295, 11031, 0, 43157, 0, 8946, 10348,
+ 10412, 8755, 0, 0, 5718, 13221, 0, 0, 78135, 0, 0, 8810, 74499, 686, 0,
+ 0, 4619, 118954, 6654, 73769, 74426, 0, 12040, 65689, 10128, 65118, 0,
+ 119151, 74205, 92651, 0, 2401, 68144, 8792, 0, 0, 65455, 0, 92246, 0,
+ 119129, 0, 12886, 127920, 66624, 0, 43557, 10300, 10161, 10396, 74135, 0,
+ 118945, 78118, 73851, 3010, 6441, 78122, 1458, 41475, 128672, 0, 0,
+ 11479, 0, 0, 6350, 12864, 69674, 78114, 1061, 64780, 2001, 43111, 55230,
+ 128686, 4052, 0, 7626, 0, 0, 1045, 0, 5631, 41113, 0, 0, 43707, 74127, 0,
+ 0, 8486, 0, 73758, 2335, 4362, 0, 0, 69221, 1025, 0, 42625, 917627,
+ 78084, 41443, 0, 128206, 0, 1774, 1523, 0, 0, 41445, 78236, 0, 8567,
+ 41442, 3988, 0, 78237, 118910, 0, 65274, 8564, 78199, 78238, 127515, 0,
+ 0, 43446, 0, 66513, 6256, 0, 579, 55218, 10206, 0, 6375, 2673, 0, 11814,
+ 0, 4488, 0, 127336, 68451, 10444, 118846, 127334, 11799, 74407, 68466,
+ 4487, 127849, 42832, 1032, 120267, 43450, 78257, 7203, 0, 614, 78191,
+ 127325, 120615, 0, 78262, 128669, 127323, 0, 43121, 0, 0, 92513, 1050,
+ 7549, 0, 0, 9314, 0, 0, 120616, 0, 10057, 0, 127313, 0, 66504, 0, 0,
+ 2307, 0, 64333, 127312, 128547, 73873, 0, 0, 0, 127973, 128708, 0, 10360,
+ 6746, 0, 92245, 440, 0, 13085, 9233, 74216, 0, 0, 9957, 0, 66447, 8046,
+ 64963, 65777, 10125, 74212, 42819, 10910, 0, 1521, 9896, 0, 10487, 0,
+ 12527, 0, 7970, 0, 128660, 0, 65769, 5243, 9849, 5239, 65771, 0, 0, 5237,
+ 69714, 0, 10103, 5247, 4769, 0, 118977, 12873, 5764, 0, 0, 3008, 4896, 0,
+ 12087, 0, 55231, 41103, 0, 64565, 4773, 0, 92717, 0, 4770, 0, 917567,
+ 8731, 65378, 127362, 120619, 9122, 128033, 0, 4774, 3019, 9997, 12834, 0,
+ 9456, 10215, 120547, 0, 0, 0, 0, 74776, 4281, 4768, 0, 41535, 4099, 9017,
+ 0, 0, 78095, 0, 78096, 0, 0, 0, 78098, 0, 42814, 880, 0, 0, 128021, 2134,
+ 0, 10116, 9877, 92329, 0, 0, 7095, 0, 74116, 6778, 0, 78090, 8243, 2427,
+ 128141, 7093, 0, 11585, 195003, 9962, 0, 12223, 0, 0, 1434, 120254, 5637,
+ 11573, 0, 0, 0, 19951, 0, 78121, 0, 0, 55283, 0, 0, 74437, 1156, 8740,
+ 92415, 3782, 64331, 0, 41370, 1014, 8261, 0, 0, 10835, 0, 65536, 0,
+ 120463, 0, 7702, 118824, 0, 43010, 65779, 65783, 1150, 10547, 5700, 0,
+ 120603, 65383, 2339, 42594, 5697, 118788, 0, 128576, 0, 42257, 5696,
+ 92677, 120465, 3862, 9643, 0, 0, 7634, 65167, 9845, 0, 0, 5701, 9722,
+ 41490, 0, 1426, 68217, 0, 68447, 42204, 55270, 8571, 194991, 78067, 0,
+ 78818, 92719, 43182, 12184, 0, 42022, 0, 10281, 0, 5650, 43194, 64712,
+ 10744, 0, 990, 5647, 0, 7387, 78734, 41114, 11477, 5646, 12879, 11018, 0,
+ 3945, 92589, 0, 0, 0, 0, 78212, 127746, 1020, 73763, 0, 78731, 5648,
+ 64748, 194910, 0, 10205, 3545, 0, 6984, 0, 74051, 0, 43242, 120458, 2667,
+ 0, 0, 0, 9911, 0, 65020, 10097, 119166, 127145, 0, 118836, 0, 78427,
+ 1140, 78426, 0, 10159, 0, 0, 8128, 0, 0, 917965, 1815, 19910, 890, 0,
+ 3267, 92291, 0, 10123, 0, 4410, 1041, 10576, 6354, 92581, 580, 74232, 0,
+ 128347, 0, 0, 0, 19938, 65906, 127819, 0, 0, 3298, 5375, 10142, 0, 8215,
+ 0, 6134, 41246, 64402, 0, 128215, 0, 0, 0, 41382, 0, 128653, 5173, 65348,
+ 527, 0, 0, 92612, 128250, 78797, 11915, 0, 0, 10072, 0, 42695, 2329,
+ 42250, 0, 128864, 69667, 12245, 1568, 0, 0, 0, 128120, 0, 74328, 92708,
+ 74769, 0, 119087, 9069, 6144, 0, 0, 73822, 0, 128010, 64917, 41521,
+ 118934, 494, 13250, 0, 65098, 6364, 956, 0, 12830, 10462, 73740, 0, 0, 0,
+ 0, 66449, 13263, 74281, 69217, 13171, 127796, 0, 0, 92294, 0, 1044,
+ 41276, 0, 0, 0, 42068, 11795, 0, 0, 0, 0, 42450, 3907, 0, 64526, 917847,
+ 68197, 12295, 0, 11475, 0, 3020, 11537, 0, 66441, 0, 0, 0, 0, 1057, 566,
+ 42696, 0, 3016, 42274, 43464, 66490, 12921, 66571, 78472, 92510, 3006,
+ 4620, 127237, 0, 0, 0, 64659, 0, 127749, 55253, 6357, 6362, 8626, 0, 0,
+ 9090, 65377, 41596, 0, 42920, 1698, 0, 64477, 0, 43813, 1053, 0, 78269,
+ 0, 0, 1052, 1051, 459, 1060, 74349, 66479, 0, 0, 0, 0, 42490, 689, 6508,
+ 4163, 42298, 8639, 66641, 4246, 0, 0, 12130, 0, 42337, 64596, 64375,
+ 66481, 127850, 0, 0, 6359, 0, 43471, 0, 0, 0, 127274, 0, 6358, 6361,
+ 1926, 6356, 92627, 7898, 8110, 10935, 0, 10069, 5830, 0, 43685, 0, 0, 0,
+ 0, 8693, 78611, 119565, 0, 120413, 0, 127257, 65894, 0, 0, 0, 0, 0, 0,
+ 119187, 2135, 78868, 0, 0, 78869, 42313, 5579, 92412, 0, 0, 0, 0, 5578,
+ 41774, 128115, 42023, 6234, 5669, 92275, 0, 0, 0, 127506, 68202, 5583, 0,
+ 0, 42426, 5580, 42276, 2923, 892, 5582, 42465, 41330, 194987, 5795,
+ 65512, 119006, 65702, 0, 120801, 65251, 0, 65710, 0, 0, 67672, 0, 5370,
+ 0, 2931, 1638, 10966, 10188, 65878, 118848, 0, 69694, 0, 128830, 8172,
+ 42017, 0, 10844, 0, 128195, 92424, 6374, 0, 0, 286, 78023, 1062, 0,
+ 119999, 0, 7395, 0, 1070, 64900, 7153, 6095, 41865, 0, 3015, 128023,
+ 917763, 5211, 0, 6400, 0, 194983, 0, 8189, 11276, 0, 0, 372, 128829, 0,
+ 118874, 42102, 41585, 128202, 0, 42101, 276, 78402, 0, 33, 74226, 127303,
+ 9007, 118796, 41588, 66033, 427, 10763, 118819, 0, 127884, 0, 1031, 6257,
+ 0, 42104, 0, 0, 2328, 92409, 1071, 0, 0, 74848, 0, 0, 0, 1047, 0, 0,
+ 64790, 0, 69723, 10651, 0, 0, 0, 0, 92206, 119181, 5711, 41633, 12098,
+ 65571, 9166, 0, 5710, 0, 6790, 65168, 13216, 0, 69716, 69726, 0, 64611,
+ 41623, 195001, 5715, 69654, 0, 0, 5712, 2761, 41620, 68124, 3074, 5722,
+ 0, 8643, 73768, 0, 118906, 2757, 11067, 9718, 74498, 8910, 10689, 6479,
+ 0, 0, 0, 78607, 9196, 69670, 0, 0, 0, 0, 118911, 0, 0, 0, 0, 0, 120010,
+ 0, 8701, 68130, 119616, 120522, 0, 42477, 0, 12123, 4495, 43569, 0, 0, 0,
+ 64946, 10992, 0, 120009, 0, 0, 9318, 120661, 13249, 65679, 73808, 0,
+ 65457, 42249, 7639, 43995, 67845, 42641, 5454, 0, 0, 194997, 120005, 0,
+ 0, 5084, 0, 0, 118861, 0, 733, 917876, 78014, 78436, 78435, 41677, 0,
+ 9218, 1731, 0, 0, 0, 195010, 0, 0, 0, 120001, 127018, 92492, 5155, 0,
+ 5358, 0, 0, 917767, 64424, 0, 3840, 64314, 41432, 0, 0, 68430, 119116,
+ 43253, 65943, 0, 3371, 10988, 0, 8771, 1479, 0, 0, 1109, 11580, 0, 64601,
+ 12205, 0, 0, 64507, 8868, 399, 0, 74842, 0, 0, 12149, 13088, 551, 0,
+ 10156, 12119, 92572, 0, 2544, 65074, 119211, 0, 0, 78011, 351, 119149, 0,
+ 0, 55229, 0, 74268, 0, 0, 0, 42377, 0, 0, 0, 0, 0, 9013, 4054, 0, 0, 0,
+ 0, 73960, 5585, 65881, 2549, 74469, 0, 0, 5584, 8358, 0, 74411, 92219,
+ 10919, 0, 7980, 0, 0, 0, 41800, 5589, 0, 2664, 41613, 5586, 118890, 0,
+ 11356, 0, 0, 43452, 78609, 0, 42573, 67856, 0, 78129, 0, 0, 92535, 8135,
+ 6450, 10055, 77996, 0, 0, 0, 5657, 0, 9626, 0, 77994, 10179, 5654, 12939,
+ 92573, 120799, 0, 0, 5652, 10945, 0, 66486, 0, 3661, 7863, 0, 0, 0,
+ 74509, 0, 5659, 0, 127510, 66729, 5655, 0, 42168, 0, 1055, 917628,
+ 127792, 66310, 74030, 0, 12146, 73955, 73956, 11618, 0, 126990, 0, 10272,
+ 10304, 10368, 42518, 594, 10244, 10248, 7407, 0, 64870, 0, 3467, 0, 0,
+ 3331, 946, 10231, 1495, 8131, 74330, 0, 9562, 69222, 65927, 0, 0, 69696,
+ 69769, 64656, 0, 0, 194837, 0, 5666, 65227, 5318, 63994, 0, 9091, 10798,
+ 0, 128166, 10186, 0, 7732, 0, 64556, 0, 0, 5668, 74445, 0, 0, 5670, 0,
+ 127297, 11820, 2992, 7826, 5667, 19952, 120807, 0, 12749, 74551, 0, 0,
+ 66496, 4361, 119260, 1306, 9286, 1497, 0, 0, 0, 0, 3571, 13247, 0, 7973,
+ 66353, 68435, 78278, 67896, 43192, 0, 78265, 553, 120653, 0, 128554,
+ 5829, 0, 4587, 78285, 65912, 0, 12746, 0, 0, 119924, 5633, 119927, 0, 0,
+ 0, 64905, 0, 9512, 120671, 12742, 6443, 0, 0, 9135, 0, 41564, 0, 55219,
+ 128832, 0, 0, 12148, 0, 78297, 0, 64256, 0, 11669, 0, 5634, 4524, 0,
+ 127270, 0, 118880, 2425, 65182, 128769, 43636, 5221, 78410, 328, 0, 0,
+ 69815, 5636, 0, 5329, 0, 5638, 119918, 7940, 64938, 43223, 0, 5635, 3373,
+ 2986, 78292, 74223, 3437, 78291, 6203, 4247, 0, 11920, 8274, 0, 0, 1657,
+ 41561, 78299, 78295, 5639, 2954, 5660, 5640, 78303, 0, 78300, 42227, 0,
+ 0, 41637, 67872, 0, 78310, 41625, 43362, 78309, 120713, 11705, 5642, 0,
+ 5486, 0, 4356, 11710, 0, 12051, 0, 0, 5641, 8259, 0, 1058, 0, 67630, 0,
+ 0, 1144, 78750, 0, 42228, 0, 73890, 118972, 0, 65322, 0, 5645, 64964,
+ 8652, 2547, 66484, 43634, 0, 5608, 65890, 43808, 0, 67621, 119934, 9000,
+ 0, 0, 92673, 1865, 0, 5613, 74267, 0, 0, 5610, 0, 0, 65826, 2069, 0,
+ 10787, 43999, 2997, 0, 5609, 78316, 65319, 78313, 12316, 65376, 2412, 0,
+ 8186, 9807, 74269, 0, 13130, 65874, 0, 5807, 0, 10030, 5306, 12936, 0, 0,
+ 11704, 0, 92583, 10211, 0, 0, 0, 0, 11706, 9710, 0, 0, 0, 413, 65623,
+ 7118, 0, 9133, 74262, 0, 1042, 0, 64779, 12171, 119240, 6185, 64776,
+ 4984, 0, 708, 11391, 0, 12241, 92720, 0, 1308, 0, 2534, 810, 0, 0, 0, 0,
+ 0, 1917, 3000, 0, 0, 120739, 2364, 92443, 74470, 66618, 65680, 0, 10027,
+ 0, 128154, 12337, 120722, 127368, 0, 2980, 755, 69774, 931, 13124, 68182,
+ 6363, 2748, 0, 0, 65041, 0, 44011, 8730, 0, 127854, 78312, 7274, 119250,
+ 0, 7275, 78304, 935, 0, 65840, 377, 42325, 11649, 127363, 65253, 64301,
+ 128835, 78308, 42341, 65284, 2417, 0, 12884, 19912, 7907, 10768, 0,
+ 194998, 0, 10673, 119217, 7248, 0, 128346, 1781, 5496, 3627, 62, 1649, 0,
+ 964, 0, 127876, 78226, 128775, 127512, 0, 0, 0, 0, 43689, 127911, 13142,
+ 78812, 42415, 66575, 4542, 74037, 43547, 0, 0, 7677, 2991, 4946, 42454,
+ 0, 7949, 0, 0, 11341, 42494, 3073, 65625, 9714, 11692, 4657, 0, 92724,
+ 6478, 9898, 43673, 65237, 6241, 7106, 4877, 0, 6238, 0, 10548, 127049,
+ 4409, 0, 0, 64798, 0, 5346, 0, 120528, 6237, 4874, 0, 9176, 0, 0, 65231,
+ 65884, 12678, 78748, 118912, 11378, 44018, 42785, 2408, 3251, 0, 0, 5685,
+ 0, 2461, 11052, 7091, 5342, 8317, 0, 68163, 5340, 0, 127820, 43635,
+ 73928, 127529, 0, 0, 0, 128510, 65482, 0, 9142, 0, 0, 0, 10938, 0,
+ 118790, 1182, 2542, 4826, 0, 0, 128176, 529, 8580, 0, 0, 10586, 10790,
+ 10839, 66023, 41593, 41207, 0, 0, 41594, 225, 42828, 0, 0, 0, 11376,
+ 74379, 10721, 67664, 3438, 42097, 127267, 11084, 3194, 41870, 266, 78305,
+ 0, 41873, 120575, 11324, 120531, 0, 8420, 64918, 128844, 41871, 41338,
+ 3734, 7734, 43683, 8750, 66605, 66011, 0, 40965, 127937, 0, 5161, 10572,
+ 0, 0, 0, 64349, 7287, 42162, 127552, 0, 0, 11948, 69220, 12359, 43429,
+ 41369, 1697, 12191, 0, 68633, 7286, 0, 68635, 10031, 0, 9870, 68645,
+ 8620, 65824, 0, 11938, 0, 7285, 0, 119577, 42678, 0, 43677, 41583, 0,
+ 65799, 92623, 0, 0, 0, 78169, 66199, 0, 3609, 68624, 0, 832, 120693,
+ 120770, 78473, 66007, 78471, 65703, 0, 0, 42732, 5180, 92699, 41395,
+ 41530, 11691, 64773, 92214, 74002, 0, 0, 128645, 6348, 243, 13200, 0,
+ 6024, 92309, 9979, 10037, 41529, 10648, 8538, 43687, 0, 0, 4285, 66195,
+ 0, 4230, 0, 13307, 43256, 92353, 7563, 42376, 0, 68442, 120512, 0, 0,
+ 214, 0, 0, 78466, 65893, 12208, 9973, 0, 66311, 65589, 128277, 2603, 0,
+ 0, 0, 0, 0, 6022, 0, 2884, 0, 11620, 0, 43, 0, 66453, 1016, 41107, 0,
+ 41121, 3885, 92, 65456, 64608, 0, 74801, 0, 2074, 0, 78283, 0, 12453,
+ 128128, 0, 74241, 0, 6791, 12457, 78268, 0, 0, 0, 78279, 0, 0, 92358,
+ 66637, 7995, 8759, 43421, 78277, 12449, 128552, 0, 0, 8752, 3197, 4720,
+ 10165, 0, 119249, 0, 11595, 64893, 0, 43435, 0, 0, 4993, 0, 6168, 10934,
+ 1946, 741, 0, 5494, 4639, 0, 1990, 66589, 4498, 78664, 119183, 0, 0,
+ 69734, 2960, 73779, 0, 8969, 128117, 43424, 127059, 0, 2950, 119579,
+ 6210, 65753, 370, 0, 0, 0, 4953, 0, 0, 0, 0, 69230, 0, 0, 65688, 0, 5063,
+ 3517, 2964, 43663, 917762, 6344, 74791, 10566, 10144, 66333, 8252, 729,
+ 66016, 78253, 0, 0, 64923, 128040, 43669, 9032, 78263, 78264, 0, 41215,
+ 0, 65883, 0, 917774, 120602, 3761, 0, 0, 0, 0, 12912, 119012, 3850,
+ 128191, 0, 0, 0, 0, 908, 0, 8611, 0, 0, 127555, 43691, 41197, 0, 8978,
+ 120540, 119135, 41586, 10527, 0, 917848, 3848, 78739, 194937, 127536,
+ 65241, 5336, 0, 128786, 663, 0, 10780, 0, 0, 78767, 0, 127163, 68193,
+ 347, 0, 0, 78775, 64675, 41582, 78774, 78744, 65579, 12980, 78769, 12143,
+ 69657, 78512, 0, 43441, 41804, 78523, 0, 78525, 0, 128859, 41584, 10681,
+ 0, 0, 73938, 0, 128022, 4800, 66661, 0, 66306, 64715, 78534, 9518, 6609,
+ 10434, 0, 11319, 1097, 0, 917850, 41730, 0, 0, 73847, 78761, 65172,
+ 41728, 41721, 0, 0, 0, 41203, 0, 13110, 41726, 0, 0, 1000, 69651, 0,
+ 41140, 1209, 73978, 0, 73750, 1073, 6321, 77878, 41138, 0, 68213, 0,
+ 12167, 1115, 41605, 9794, 127062, 67671, 55248, 12237, 78787, 66314,
+ 6587, 9290, 78782, 78783, 9231, 78781, 2959, 7926, 0, 0, 0, 64398, 0,
+ 119970, 12311, 0, 78796, 78798, 78794, 78795, 68434, 78793, 66670, 0, 0,
+ 12290, 120169, 0, 119873, 42142, 9968, 8205, 0, 5131, 0, 9627, 78536,
+ 78542, 78535, 0, 1944, 1248, 10148, 127755, 119990, 119991, 12701, 78376,
+ 11308, 119995, 0, 119997, 119998, 65305, 65100, 4031, 42794, 120003,
+ 7075, 8154, 119985, 120007, 41817, 73934, 42275, 120011, 120012, 78526,
+ 120014, 120015, 6041, 0, 41899, 0, 8002, 0, 4364, 0, 0, 64332, 0, 7813,
+ 9064, 119986, 10124, 7526, 8601, 7281, 78455, 7279, 12041, 1418, 10885,
+ 12673, 0, 0, 9660, 0, 13012, 4571, 0, 0, 0, 12078, 2970, 0, 10933, 0,
+ 77870, 0, 0, 0, 41599, 0, 128831, 0, 12950, 92160, 3486, 0, 78311, 4239,
+ 0, 127799, 66511, 0, 2637, 64629, 8460, 127053, 8476, 0, 0, 0, 0, 65673,
+ 1019, 78495, 4148, 0, 12289, 0, 4316, 0, 13119, 0, 5412, 66243, 9935, 0,
+ 73864, 0, 41734, 8206, 74081, 9163, 3286, 9072, 5867, 13302, 7622, 7120,
+ 41736, 92546, 41731, 0, 7400, 5416, 68663, 118924, 10817, 0, 41539,
+ 127284, 0, 73963, 41855, 41867, 65564, 11277, 65892, 11536, 10620, 92272,
+ 7115, 66030, 73932, 5498, 73942, 41536, 0, 68204, 92587, 3459, 8997, 0,
+ 0, 0, 0, 92512, 0, 66377, 69781, 0, 0, 78511, 3161, 295, 120207, 0,
+ 92223, 127856, 78742, 9016, 43454, 63903, 63902, 43641, 0, 3971, 0,
+ 73972, 2952, 78765, 11038, 10901, 63900, 63899, 63898, 0, 667, 12332,
+ 63887, 6086, 41722, 0, 5172, 0, 0, 4159, 0, 0, 9815, 63884, 19934, 63882,
+ 41198, 8555, 63878, 63877, 42460, 6050, 42708, 63881, 63872, 0, 42421, 0,
+ 41723, 63875, 63874, 11460, 7432, 1913, 41913, 63852, 0, 0, 42348, 0,
+ 6752, 446, 41911, 127906, 63851, 63850, 41910, 0, 63846, 2972, 12932,
+ 7262, 0, 63849, 63848, 63847, 128070, 6570, 8302, 7259, 63842, 4178,
+ 10746, 7250, 13214, 10041, 8105, 63892, 0, 118983, 1105, 4180, 0, 12094,
+ 9497, 0, 63891, 63890, 63889, 63888, 5538, 9987, 0, 118932, 1678, 13274,
+ 552, 120654, 44010, 10785, 0, 119170, 4557, 74459, 9159, 10171, 13125,
+ 63860, 5540, 63858, 63865, 281, 13242, 63862, 74154, 0, 5536, 65568,
+ 63857, 1388, 74169, 0, 1077, 0, 65099, 11531, 5834, 0, 0, 0, 0, 42773, 0,
+ 0, 0, 119220, 0, 3663, 0, 1112, 119122, 8686, 0, 5334, 65081, 43249,
+ 74778, 127968, 11077, 0, 6509, 0, 5327, 0, 19907, 63869, 3478, 7583,
+ 7679, 2903, 0, 3001, 1158, 8745, 0, 73748, 63866, 0, 1915, 4846, 0,
+ 66371, 118984, 42105, 2990, 120128, 805, 69238, 64438, 12070, 8760, 1117,
+ 118987, 12212, 120123, 65174, 42357, 63835, 63834, 0, 78240, 12225,
+ 63838, 63837, 0, 0, 63833, 6042, 66360, 8083, 0, 0, 63821, 63820, 63819,
+ 63818, 0, 5227, 9047, 63822, 127162, 6091, 0, 10691, 560, 5643, 8226,
+ 119578, 63812, 63811, 63810, 63809, 5542, 63815, 63814, 63813, 6047,
+ 1597, 120143, 780, 206, 77925, 4936, 65147, 8168, 63930, 2076, 1093,
+ 9882, 63934, 2082, 63932, 128150, 63929, 3546, 1605, 77934, 9806, 43472,
+ 77933, 8400, 11343, 2086, 0, 63926, 2984, 5968, 9287, 0, 4618, 42209,
+ 43431, 13169, 5290, 2089, 1695, 10743, 1088, 63825, 7268, 1084, 1085,
+ 63829, 1083, 10131, 7283, 0, 63970, 128358, 1092, 4754, 7273, 5252,
+ 44016, 43627, 127921, 0, 7408, 11809, 0, 0, 0, 2965, 7258, 8808, 0, 1089,
+ 4187, 63937, 42119, 42120, 0, 940, 5787, 10099, 63938, 0, 74494, 12463,
+ 2994, 0, 118827, 0, 9664, 77939, 77940, 67892, 77938, 74343, 0, 0, 660,
+ 10127, 666, 9022, 5532, 43667, 5533, 77941, 78507, 6118, 222, 979, 3884,
+ 0, 74151, 92652, 6502, 0, 127118, 128695, 63951, 12465, 0, 0, 128782,
63946, 1707, 63924, 12461, 63950, 63897, 63948, 63947, 63945, 6038,
- 63943, 63942, 64685, 63895, 65838, 0, 7776, 0, 0, 0, 120444, 0, 801,
- 43165, 1690, 63919, 63918, 63917, 13277, 63893, 0, 120638, 9906, 5486,
- 2334, 0, 63916, 5483, 63914, 120610, 63911, 5484, 63909, 63908, 2539, 0,
- 63913, 5485, 0, 195060, 9061, 5534, 10672, 4502, 0, 253, 0, 0, 0, 42854,
- 0, 0, 11530, 0, 0, 0, 0, 0, 10474, 0, 13257, 42354, 0, 0, 0, 195065, 0,
- 8413, 0, 0, 5693, 7272, 0, 13209, 64470, 65831, 0, 195063, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66608, 3111, 41863, 8804, 66607, 0, 7270, 0, 66606, 6628,
- 1076, 41305, 1436, 0, 0, 0, 63982, 10221, 12807, 63907, 63906, 1598,
- 63904, 0, 0, 41729, 4423, 1307, 0, 10515, 41589, 0, 0, 6218, 0, 1430, 0,
- 0, 120606, 119365, 5413, 7619, 3255, 3493, 74032, 11549, 10735, 0, 73937,
- 10517, 0, 0, 10990, 65073, 5167, 4481, 3771, 0, 2710, 0, 0, 41724, 0,
- 43073, 41690, 12479, 0, 0, 0, 0, 119659, 1628, 0, 0, 0, 65262, 63854,
- 10783, 42315, 0, 63855, 120683, 0, 0, 5339, 74323, 0, 13004, 0, 4457, 0,
- 0, 0, 0, 5684, 8678, 10914, 0, 5689, 65807, 0, 120617, 12633, 0, 0,
- 65183, 5688, 11926, 6033, 6310, 5686, 0, 0, 0, 120647, 0, 50, 0, 9871, 0,
- 0, 0, 0, 0, 66468, 0, 13259, 4448, 0, 0, 0, 0, 67853, 0, 10640, 0, 1151,
- 0, 0, 0, 0, 195050, 0, 0, 0, 0, 12501, 64604, 0, 11527, 118870, 8812, 0,
- 11538, 8673, 12650, 11020, 0, 66467, 10839, 8087, 0, 0, 9894, 0, 0, 0,
- 4636, 0, 118985, 8053, 0, 0, 0, 0, 120495, 0, 0, 12277, 194627, 11995,
- 194626, 0, 12158, 0, 8741, 10197, 0, 0, 0, 6531, 0, 0, 473, 0, 0, 0,
- 1873, 1087, 0, 0, 0, 0, 66439, 43218, 0, 194716, 7237, 12504, 74282, 0,
- 0, 0, 9489, 0, 0, 4384, 74220, 195055, 0, 917561, 13295, 43191, 0, 0,
- 1154, 3857, 1205, 0, 0, 13100, 12958, 120706, 74168, 0, 0, 4421, 10592,
- 0, 495, 0, 41712, 7983, 0, 0, 0, 8494, 0, 7654, 41710, 4196, 0, 437,
- 41709, 73772, 0, 0, 9465, 13290, 119180, 4997, 64306, 0, 0, 4999, 194642,
- 0, 0, 4711, 120769, 0, 2739, 0, 8044, 74834, 0, 41789, 0, 10809, 0, 0, 0,
- 1779, 6600, 6601, 41543, 5325, 642, 64187, 13058, 0, 0, 0, 0, 13229, 0,
- 10575, 0, 0, 0, 41791, 1104, 0, 0, 10655, 0, 0, 0, 0, 1082, 195049, 8428,
- 0, 0, 0, 0, 0, 10167, 0, 12993, 8049, 41548, 0, 6458, 0, 0, 4761, 63828,
- 4766, 64623, 1273, 194653, 0, 118876, 0, 6912, 1313, 7033, 10483, 0,
- 41545, 0, 0, 0, 0, 0, 0, 0, 3484, 74337, 0, 0, 8503, 5122, 41527, 0,
- 66320, 0, 0, 0, 0, 41537, 0, 8303, 8282, 11817, 0, 10003, 73859, 65904,
- 194663, 1686, 0, 0, 11467, 3664, 65921, 64299, 194664, 0, 0, 4324, 126,
- 42246, 119152, 0, 0, 65926, 7744, 194636, 74277, 74302, 0, 0, 6966, 0,
- 8136, 0, 65600, 1633, 0, 0, 4762, 1103, 0, 0, 4765, 0, 13078, 0, 4760,
- 63827, 0, 10871, 43199, 1102, 0, 0, 0, 0, 11546, 74794, 337, 0, 42591,
- 8627, 12279, 1111, 0, 0, 4707, 0, 10143, 7883, 127081, 7880, 4522, 8645,
- 5704, 13010, 0, 8304, 0, 0, 119575, 0, 0, 66654, 0, 0, 0, 13008, 0, 4385,
- 0, 13011, 0, 0, 119161, 13009, 160, 2677, 0, 0, 41793, 65763, 74221,
- 120141, 41792, 42770, 0, 65762, 118829, 64573, 5709, 0, 194638, 0, 0, 0,
- 1079, 3867, 5708, 0, 0, 0, 5706, 64768, 5705, 8791, 4005, 0, 10237,
- 10991, 0, 917579, 9173, 917581, 917580, 13170, 65942, 917577, 42605,
- 120765, 917570, 917573, 917572, 10058, 0, 74867, 194654, 127078, 3339,
- 11448, 1106, 917591, 917590, 917593, 3340, 917587, 917586, 917589,
- 917588, 917583, 10605, 1309, 63966, 120743, 1754, 127075, 13246, 864, 0,
- 118926, 8972, 0, 7849, 120092, 0, 13240, 195068, 5192, 4338, 0, 10948,
- 917601, 13199, 120169, 1236, 13208, 13261, 13189, 13188, 120164, 0, 7440,
- 0, 120153, 9553, 1590, 63777, 63776, 13178, 63782, 63781, 63780, 63779,
- 1583, 0, 13260, 4550, 0, 64205, 0, 0, 41522, 0, 0, 0, 0, 11354, 0, 0,
- 42795, 0, 119195, 11394, 194646, 13236, 13272, 13194, 1334, 0, 4479,
- 1178, 65586, 120663, 66681, 119193, 4601, 0, 0, 0, 0, 0, 0, 0, 63787,
- 63786, 6031, 0, 63791, 63790, 1145, 63788, 7910, 63785, 43153, 754,
- 10192, 13105, 8183, 120741, 2037, 0, 0, 10747, 125, 0, 0, 0, 0, 0, 41719,
- 63758, 3523, 1074, 13258, 9536, 74077, 0, 4427, 74242, 63757, 43145,
- 12217, 63754, 41532, 1349, 63750, 63749, 0, 0, 0, 63753, 63802, 41084,
- 120622, 0, 41930, 63805, 63804, 63803, 63801, 41082, 8140, 63798, 6260,
- 0, 0, 119225, 63793, 11988, 3898, 0, 10201, 12238, 63795, 42358, 10367,
- 12521, 10431, 42114, 41932, 1068, 0, 12523, 12945, 0, 0, 7950, 10804,
- 63771, 42787, 4386, 12224, 6973, 2793, 12475, 0, 0, 63769, 9530, 0,
- 12232, 13135, 8596, 5681, 63762, 4595, 63760, 792, 0, 64803, 0, 8742, 0,
- 11053, 0, 63744, 0, 0, 7588, 63748, 1693, 63746, 43204, 5055, 0, 0, 1090,
- 120679, 0, 11665, 74133, 4558, 65685, 9523, 0, 0, 0, 11513, 0, 6157,
- 63775, 63774, 63773, 13191, 12170, 3500, 3139, 0, 3170, 12485, 0, 10872,
- 0, 13006, 64433, 0, 0, 941, 0, 0, 0, 65541, 11063, 0, 8228, 0, 42065, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 43603, 0, 65397, 288, 0, 0, 0, 10025, 0, 2918,
- 0, 65300, 119871, 9883, 64726, 2790, 65395, 3793, 0, 0, 65393, 0, 74138,
- 0, 0, 0, 74139, 120613, 65394, 11548, 5270, 0, 65396, 0, 65813, 13256,
- 1282, 120771, 0, 0, 10888, 0, 65242, 0, 3330, 0, 0, 0, 0, 0, 0, 3304,
- 42753, 0, 0, 0, 1627, 0, 0, 0, 5371, 13116, 0, 1826, 0, 0, 43094, 0, 0,
- 0, 0, 9035, 0, 0, 0, 0, 0, 68125, 0, 164, 0, 0, 0, 6958, 0, 43116, 0, 0,
- 13245, 0, 0, 0, 0, 73893, 0, 12666, 13175, 13207, 120414, 66014, 120428,
- 7447, 5929, 0, 65509, 0, 7449, 11306, 0, 73920, 3180, 0, 63808, 9054,
- 971, 13062, 0, 0, 65195, 64767, 0, 74428, 0, 0, 0, 0, 0, 0, 10045, 64303,
- 13275, 0, 11057, 0, 13276, 0, 41525, 0, 7271, 11444, 0, 0, 0, 12229,
- 41523, 0, 0, 73751, 0, 64813, 0, 0, 10476, 3858, 0, 3932, 64958, 0, 0,
- 73989, 0, 0, 0, 369, 0, 41784, 0, 64163, 0, 0, 0, 65474, 4796, 41782, 0,
- 65479, 0, 41781, 10486, 41480, 120511, 9899, 0, 0, 404, 12821, 3741, 0,
- 5788, 0, 0, 41222, 1831, 66020, 0, 0, 4388, 0, 746, 120784, 0, 0, 13131,
- 65294, 0, 0, 0, 0, 4422, 4708, 3799, 74292, 119357, 0, 74430, 0, 11700,
- 4374, 0, 0, 1364, 0, 8038, 0, 917597, 0, 0, 0, 0, 73979, 13174, 73968,
- 13225, 0, 0, 65835, 0, 2365, 7841, 0, 42855, 118856, 42866, 0, 0, 0,
- 66438, 41785, 41171, 64172, 13173, 4372, 119354, 0, 0, 0, 0, 0, 0, 12965,
- 384, 64512, 10404, 10340, 119352, 1556, 5274, 13210, 0, 10017, 9733,
- 41787, 0, 0, 41373, 0, 12303, 0, 13232, 13233, 349, 4863, 41371, 11656,
- 0, 120703, 119883, 12861, 4398, 8543, 65618, 0, 1096, 0, 0, 0, 12441,
+ 63943, 63942, 64685, 63895, 65838, 0, 7776, 0, 0, 127773, 120444, 69730,
+ 801, 43165, 1690, 63919, 63918, 63917, 13277, 43659, 12951, 120638, 9906,
+ 2054, 2334, 78515, 63916, 5483, 63914, 69737, 63911, 5484, 63909, 63908,
+ 2539, 0, 43980, 5485, 0, 42697, 9061, 5534, 10672, 4502, 0, 253, 0,
+ 68208, 0, 9203, 74231, 0, 11530, 92542, 68668, 0, 128816, 0, 10474,
+ 43426, 13257, 42354, 0, 0, 0, 195065, 0, 8413, 0, 0, 5693, 7272, 0,
+ 13209, 64470, 65831, 78460, 195063, 0, 0, 0, 0, 0, 0, 0, 128133, 127767,
+ 66608, 3111, 41863, 8804, 42913, 92187, 7270, 0, 66606, 6628, 1076, 7433,
+ 1436, 73844, 55226, 128353, 63982, 7393, 12807, 43413, 63906, 1598,
+ 63904, 0, 0, 41729, 4423, 1307, 0, 10515, 41589, 128698, 0, 6218, 0,
+ 1430, 0, 0, 120606, 78754, 5413, 7619, 3255, 3493, 74032, 11549, 10735,
+ 41743, 73937, 6801, 0, 4518, 10990, 65073, 5167, 4481, 3771, 0, 2710, 0,
+ 69243, 41724, 0, 43073, 41690, 12479, 0, 0, 0, 0, 119659, 1628, 127149,
+ 0, 0, 65262, 6333, 10783, 42315, 0, 63855, 120683, 0, 0, 5339, 74323, 0,
+ 13004, 0, 4457, 0, 0, 0, 0, 5684, 8678, 10914, 0, 5689, 65807, 0, 68464,
+ 12633, 12870, 69705, 65183, 5688, 11926, 6033, 6310, 5686, 0, 74251, 0,
+ 120647, 0, 50, 10558, 9871, 0, 43655, 0, 0, 0, 66468, 0, 13259, 4448, 0,
+ 0, 0, 0, 67853, 0, 10640, 11539, 1151, 0, 917607, 127544, 127079, 195050,
+ 127852, 0, 0, 0, 12501, 64604, 0, 11527, 118870, 8812, 0, 11538, 8673,
+ 12650, 11020, 0, 66467, 2105, 8087, 78163, 69632, 9894, 0, 0, 0, 4636,
+ 55262, 78513, 4515, 2382, 0, 127055, 0, 120495, 0, 128284, 12277, 194627,
+ 11995, 92553, 0, 12158, 0, 8741, 10197, 0, 92426, 0, 6531, 0, 127846,
+ 473, 43415, 0, 0, 1873, 1087, 0, 0, 0, 78527, 66439, 43218, 0, 194716,
+ 7237, 12504, 74282, 0, 0, 0, 9489, 0, 0, 4384, 74220, 195055, 2058,
+ 128863, 13295, 43191, 128030, 0, 1154, 3857, 1205, 0, 0, 13100, 12958,
+ 120706, 74168, 0, 0, 4421, 10592, 0, 495, 0, 41712, 7983, 0, 120779, 0,
+ 6347, 0, 7654, 41710, 4196, 0, 437, 41709, 73772, 0, 0, 9465, 13290,
+ 119180, 4997, 64306, 0, 0, 4999, 194642, 0, 0, 4711, 120769, 0, 2739, 0,
+ 8044, 74834, 194643, 41789, 128142, 10809, 0, 0, 0, 1779, 6600, 6601,
+ 41543, 5325, 642, 64187, 13058, 120449, 12875, 0, 92186, 13229, 0, 10575,
+ 43399, 0, 0, 41791, 1104, 0, 0, 10655, 0, 0, 0, 0, 1082, 195049, 8428,
+ 6569, 0, 0, 0, 0, 6783, 0, 12993, 8049, 41548, 44021, 6458, 0, 128882,
+ 4761, 63828, 4766, 64623, 1273, 43407, 0, 118876, 195045, 6912, 1313,
+ 6322, 10483, 0, 41545, 0, 92449, 0, 0, 0, 0, 78624, 3484, 74337, 0, 0,
+ 8503, 5122, 41527, 0, 66320, 0, 0, 0, 0, 41537, 69683, 8303, 8282, 11817,
+ 73857, 10003, 73859, 65904, 194663, 1686, 0, 78406, 11467, 3664, 65921,
+ 64299, 194664, 0, 0, 4324, 126, 42246, 119152, 0, 74378, 65926, 7744,
+ 194636, 74277, 74302, 78052, 43817, 6966, 43822, 8136, 0, 65600, 1633, 0,
+ 0, 4762, 1103, 0, 0, 4765, 0, 13078, 0, 4760, 63827, 2050, 10871, 43199,
+ 1102, 0, 42236, 128867, 194667, 11546, 74794, 337, 0, 42591, 8627, 12279,
+ 1111, 0, 92161, 4707, 68206, 10143, 7883, 127081, 7880, 4522, 8645, 5704,
+ 13010, 0, 8304, 917561, 0, 119575, 0, 0, 66654, 0, 92676, 0, 13008, 0,
+ 4385, 0, 13011, 0, 92569, 119161, 13009, 160, 2677, 0, 0, 41793, 65763,
+ 74221, 120141, 41792, 42770, 0, 65762, 118829, 43821, 5709, 0, 127177,
+ 43816, 0, 0, 1079, 3867, 5708, 0, 0, 43797, 5706, 64768, 5705, 8791,
+ 4005, 0, 10237, 10991, 0, 43459, 9173, 917581, 917580, 13170, 12540,
+ 917577, 42605, 120765, 917570, 68647, 917572, 10058, 0, 74867, 194654,
+ 127078, 3339, 11448, 1106, 917591, 917590, 917593, 3340, 917587, 917586,
+ 917589, 917588, 120541, 10605, 1309, 63966, 120743, 1754, 92226, 13246,
+ 864, 0, 118926, 8972, 0, 7849, 120092, 92533, 13240, 195068, 5192, 4338,
+ 0, 10948, 917601, 13199, 92575, 1236, 13208, 13261, 13189, 13188, 120164,
+ 0, 7440, 0, 120153, 9553, 1590, 63777, 63776, 13178, 63782, 63781, 63780,
+ 63779, 1583, 0, 13260, 4550, 0, 64205, 0, 0, 41522, 0, 92168, 0, 917858,
+ 11354, 0, 0, 42795, 0, 119195, 11394, 194646, 13236, 13272, 13194, 1334,
+ 0, 4479, 1178, 65586, 120663, 66681, 119193, 4601, 0, 0, 0, 0, 0, 194658,
+ 0, 6809, 63786, 6031, 0, 63791, 63790, 1145, 63788, 7910, 63785, 43153,
+ 754, 10192, 13105, 8183, 120741, 2037, 0, 0, 10747, 125, 0, 64890, 0, 0,
+ 0, 41719, 63758, 3523, 1074, 13258, 9536, 74077, 0, 4427, 74242, 63757,
+ 43145, 12217, 63754, 41532, 1349, 63750, 63749, 0, 0, 0, 63753, 63802,
+ 41084, 120622, 68133, 41930, 63805, 63804, 43632, 63801, 41082, 8140,
+ 63798, 6260, 0, 0, 119225, 63793, 11988, 3898, 128241, 10201, 12238,
+ 63795, 42194, 10367, 12521, 10431, 42114, 41932, 1068, 0, 12523, 12945,
+ 0, 42203, 7950, 10804, 63771, 42787, 4386, 12224, 6973, 2793, 12475, 0,
+ 0, 63769, 9530, 0, 12232, 13135, 8596, 5681, 63762, 4595, 63760, 792, 0,
+ 64803, 0, 8742, 0, 11053, 128796, 63744, 128107, 0, 7588, 63748, 1693,
+ 63746, 43204, 5055, 68426, 917853, 1090, 120679, 128356, 11665, 74133,
+ 4558, 65685, 9523, 0, 0, 78681, 11513, 0, 6157, 63775, 63774, 63773,
+ 13191, 12170, 3500, 3139, 0, 3170, 12485, 0, 10872, 78271, 13006, 64433,
+ 0, 0, 941, 0, 0, 0, 65541, 11063, 0, 8228, 0, 42065, 0, 0, 0, 0, 92455,
+ 7386, 0, 64444, 0, 119863, 43603, 0, 65397, 288, 0, 0, 0, 10025, 917916,
+ 2918, 0, 65300, 119871, 9883, 64726, 2790, 65395, 3793, 0, 127829, 65393,
+ 0, 74138, 0, 0, 0, 74139, 92712, 65394, 11548, 5270, 0, 65396, 0, 65813,
+ 13256, 1282, 120771, 0, 0, 10888, 0, 65242, 0, 3330, 0, 0, 0, 0, 0,
+ 74259, 3304, 42753, 0, 0, 0, 1627, 0, 0, 0, 5371, 13116, 0, 1826, 118794,
+ 0, 43094, 0, 43650, 0, 0, 9035, 0, 0, 128005, 0, 92207, 68125, 0, 164, 0,
+ 0, 0, 6958, 0, 43116, 0, 0, 13245, 0, 0, 127376, 0, 73893, 127756, 12666,
+ 13175, 13207, 120414, 66014, 120428, 7447, 5929, 0, 65509, 0, 7449,
+ 11306, 0, 73920, 3180, 0, 63808, 9054, 971, 13062, 0, 0, 65195, 10164,
+ 92252, 74428, 0, 78146, 92611, 0, 0, 0, 10045, 12882, 13275, 128161,
+ 11057, 0, 13276, 0, 41525, 78150, 7271, 11444, 0, 0, 0, 12229, 41523, 0,
+ 43411, 73751, 0, 64813, 0, 0, 10476, 3858, 0, 3932, 64958, 0, 0, 73989,
+ 68192, 0, 0, 369, 0, 41784, 0, 64163, 0, 0, 0, 65474, 4796, 12292, 0,
+ 65479, 0, 41781, 10486, 41480, 43002, 9899, 0, 0, 404, 12821, 3741, 0,
+ 5788, 8092, 68212, 41222, 1831, 66020, 3982, 0, 4388, 0, 746, 120784, 0,
+ 0, 12018, 65294, 0, 0, 0, 0, 4422, 4708, 3799, 74292, 119357, 0, 74430,
+ 0, 11700, 4374, 0, 128179, 1364, 0, 8038, 0, 917597, 12868, 69814, 0,
+ 6735, 73979, 13174, 73968, 13225, 0, 69808, 65835, 0, 2365, 7841, 0,
+ 42855, 118856, 42866, 0, 0, 0, 66438, 41785, 12617, 64172, 13173, 4372,
+ 119354, 0, 0, 0, 0, 92402, 128062, 12965, 384, 64512, 10404, 10340,
+ 119352, 1556, 5274, 13210, 120125, 10017, 9733, 41787, 0, 126994, 41373,
+ 78039, 12303, 0, 13232, 13233, 349, 4863, 41371, 11656, 0, 120703,
+ 119883, 12861, 4398, 8543, 65618, 128018, 1096, 0, 0, 42688, 12441,
12355, 119348, 119347, 4318, 10452, 0, 8032, 13243, 13237, 12719, 0,
- 119101, 0, 64884, 119872, 119345, 8597, 0, 0, 9864, 0, 120785, 0, 0,
- 13195, 41452, 64961, 7722, 0, 10459, 119878, 0, 119879, 66590, 0, 41533,
- 66337, 0, 0, 0, 4965, 0, 917536, 73849, 0, 0, 0, 0, 6261, 119342, 43147,
- 66570, 1957, 10420, 982, 2756, 13292, 13206, 0, 0, 2925, 73809, 13056, 0,
- 13212, 65110, 0, 13190, 13187, 0, 13198, 118793, 0, 5242, 119179, 64476,
- 1694, 8216, 0, 0, 43331, 0, 65620, 0, 43544, 0, 0, 41444, 65621, 120325,
- 64799, 5246, 120326, 13185, 9709, 120323, 120322, 12314, 65616, 5238,
- 119333, 0, 119337, 5236, 40979, 0, 74201, 8286, 0, 3936, 119331, 11699,
- 41347, 0, 13235, 8842, 41248, 0, 4379, 13239, 12692, 7969, 0, 7219, 0, 0,
+ 119101, 0, 64884, 119872, 119345, 8597, 0, 0, 9864, 0, 120785, 119874, 0,
+ 13195, 41452, 64961, 7722, 0, 10459, 119878, 0, 119879, 66590, 128123,
+ 41533, 66337, 0, 92184, 0, 4965, 43445, 917536, 73849, 0, 43638, 78537,
+ 128287, 6261, 119342, 43147, 66570, 1957, 10420, 982, 2756, 13292, 13206,
+ 128828, 0, 2925, 73809, 13056, 127559, 13212, 43238, 0, 13190, 13187,
+ 92541, 13198, 118793, 0, 5242, 119179, 64476, 1694, 8216, 0, 6770, 43331,
+ 0, 65620, 0, 43544, 0, 0, 41444, 65621, 120325, 9197, 5246, 119106,
+ 13185, 9709, 120323, 120322, 12314, 65616, 5238, 119333, 0, 119337, 5236,
+ 40979, 0, 74201, 8286, 0, 3936, 119331, 11699, 41347, 127249, 13235,
+ 8842, 41248, 0, 4379, 13239, 12692, 7969, 127266, 7219, 127250, 0,
120509, 0, 66224, 734, 2979, 120303, 65619, 9872, 957, 64921, 1846,
66631, 41477, 119256, 120310, 74511, 41770, 1670, 6442, 120317, 42446,
- 5379, 120318, 41163, 74832, 120315, 120314, 0, 0, 42841, 13267, 0, 0,
- 41775, 0, 0, 41773, 0, 10663, 0, 0, 0, 6151, 12110, 0, 65572, 119602,
- 65250, 13265, 13264, 64518, 0, 6100, 0, 0, 5808, 65922, 0, 12967, 66041,
- 9676, 4583, 0, 0, 68097, 64575, 0, 11965, 0, 119211, 0, 0, 0, 0, 68102,
- 9698, 7814, 74476, 119651, 0, 0, 41921, 0, 9756, 6985, 119258, 0, 74219,
- 0, 0, 0, 8012, 5674, 12353, 0, 12361, 5677, 42323, 0, 41925, 0, 41920,
- 5673, 120534, 5676, 41923, 12694, 118978, 5672, 1294, 0, 0, 0, 42511,
- 1727, 0, 0, 0, 0, 0, 74222, 8718, 3550, 736, 10268, 4505, 10316, 74090,
- 5826, 74270, 5813, 0, 120712, 5841, 5837, 0, 0, 3105, 12829, 5838, 5796,
- 0, 119592, 5793, 0, 5866, 5797, 41011, 5865, 120091, 7956, 598, 0, 64649,
- 5806, 42398, 0, 9037, 5671, 120041, 0, 0, 0, 0, 0, 847, 0, 9529, 0,
- 66657, 6980, 0, 120035, 0, 0, 0, 120033, 0, 0, 0, 120039, 0, 0, 0, 9624,
- 0, 0, 43190, 65463, 1554, 0, 42611, 42563, 0, 5651, 2929, 0, 43201, 0,
- 19963, 5698, 0, 0, 0, 0, 5644, 10292, 65546, 120492, 68141, 8372, 0,
- 65116, 0, 120022, 0, 10388, 42799, 0, 41013, 10568, 0, 0, 2869, 0, 41015,
- 0, 2785, 4366, 0, 10954, 41802, 0, 42608, 194688, 9884, 4759, 0, 0,
- 10266, 41359, 1170, 127017, 0, 73908, 1609, 902, 0, 63936, 0, 11661,
- 8122, 5818, 0, 0, 3861, 9540, 11028, 2554, 5158, 5714, 127015, 0, 0, 807,
- 43079, 0, 0, 976, 5511, 64553, 0, 42155, 0, 41356, 74110, 118801, 0, 0,
- 8676, 0, 0, 11066, 451, 63941, 5798, 9349, 42018, 0, 0, 0, 43609, 194703,
- 120553, 1440, 0, 0, 120016, 74283, 11005, 0, 66656, 66044, 0, 194698, 0,
- 0, 0, 10094, 0, 11529, 10857, 120643, 66436, 6546, 93, 0, 0, 74440, 0, 0,
- 8171, 0, 119097, 127065, 917543, 383, 10377, 41656, 0, 0, 0, 5187, 0, 0,
- 11286, 0, 64217, 0, 5232, 0, 41009, 0, 41005, 0, 0, 0, 8292, 195074,
- 4980, 8860, 73947, 10028, 66478, 7076, 13182, 194705, 0, 0, 10631, 66031,
- 7972, 0, 0, 0, 7900, 0, 11309, 194711, 4198, 64211, 0, 0, 0, 0, 0, 0,
- 12931, 0, 0, 74285, 10185, 0, 64366, 65156, 8814, 0, 74771, 0, 0, 12836,
- 0, 0, 74342, 8593, 0, 0, 0, 13255, 0, 0, 7464, 0, 65865, 0, 194650, 0, 0,
- 9342, 120464, 0, 64516, 0, 0, 10129, 41007, 0, 0, 40995, 12209, 41012,
- 119136, 0, 0, 120633, 40992, 0, 0, 0, 43558, 5522, 0, 61, 0, 74105, 3633,
- 0, 65162, 41234, 12089, 0, 9771, 0, 13251, 0, 0, 6262, 2784, 0, 0, 8126,
- 66483, 0, 0, 441, 42621, 0, 0, 41002, 40999, 119623, 43266, 0, 0, 10890,
- 74481, 65834, 8324, 119103, 64417, 74817, 0, 64737, 0, 0, 8930, 0, 74249,
- 1193, 10056, 1800, 13253, 13252, 7829, 0, 0, 7743, 0, 0, 0, 0, 0, 9034,
- 6039, 0, 10075, 0, 41018, 65683, 10338, 66469, 0, 0, 0, 42815, 0, 41966,
- 0, 0, 0, 11792, 0, 0, 911, 7539, 0, 0, 120339, 65159, 64390, 0, 0, 5520,
- 11662, 0, 65330, 73886, 0, 0, 12326, 0, 0, 42808, 0, 9348, 64901, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5857, 65342, 0, 119120, 0, 8644, 0, 0, 0, 74296,
- 41909, 0, 120332, 2791, 0, 1891, 0, 0, 41907, 66647, 0, 8761, 12942,
- 5748, 0, 10773, 0, 0, 8796, 0, 6412, 120347, 8520, 13146, 0, 63931, 0,
- 65902, 2882, 0, 0, 12843, 4520, 0, 0, 0, 0, 0, 73860, 0, 0, 64345, 0, 0,
- 0, 0, 0, 0, 0, 917585, 65117, 0, 0, 10427, 0, 3844, 0, 9755, 1110, 6612,
- 12222, 0, 0, 0, 0, 783, 194935, 0, 0, 0, 0, 65056, 3620, 0, 118945, 4556,
- 0, 0, 194933, 74250, 0, 0, 10510, 4382, 66482, 0, 0, 0, 9177, 8902, 0,
- 9839, 0, 12891, 0, 0, 63999, 2016, 41917, 9788, 63928, 0, 1862, 65800,
- 9155, 66623, 9786, 65082, 41919, 8579, 41914, 7981, 0, 0, 4508, 64883, 0,
- 0, 0, 0, 64592, 74276, 120080, 41780, 120079, 68181, 0, 0, 0, 0, 12147,
- 9024, 66378, 66472, 0, 64289, 65289, 0, 0, 0, 64509, 0, 0, 0, 11051, 0,
- 0, 11355, 65885, 0, 0, 41214, 0, 12299, 0, 7500, 4506, 7773, 0, 0,
- 118912, 0, 0, 4040, 0, 6167, 0, 63922, 6594, 0, 0, 0, 3624, 43036, 0,
- 64655, 63990, 19947, 63988, 41955, 0, 63993, 63992, 9611, 0, 0, 0, 7738,
- 63986, 11446, 63984, 0, 3435, 119652, 0, 119108, 7029, 64258, 41292,
- 118898, 12748, 43115, 9517, 11518, 0, 0, 0, 194777, 63956, 42458, 63954,
- 63953, 63960, 9591, 63958, 10217, 118845, 11469, 0, 42306, 2723, 118947,
- 0, 0, 0, 0, 0, 11397, 2880, 0, 0, 2872, 0, 0, 3498, 4378, 917539, 4270,
- 0, 65551, 118928, 6633, 0, 0, 5230, 0, 0, 0, 0, 0, 8161, 393, 12013, 0,
+ 5379, 120318, 41163, 74832, 120315, 120314, 128025, 0, 42841, 13267, 0,
+ 0, 41775, 0, 7130, 41773, 0, 10663, 0, 0, 0, 6151, 12110, 42673, 65572,
+ 65293, 65250, 13265, 13264, 64518, 0, 6100, 0, 92647, 5808, 65922, 0,
+ 12967, 66041, 5612, 4583, 0, 0, 68097, 64575, 128524, 11965, 0, 68358, 0,
+ 69789, 0, 92260, 68102, 9698, 7814, 74476, 119651, 128514, 0, 41921,
+ 118858, 9756, 6985, 119258, 78490, 74219, 0, 0, 118997, 8012, 5674,
+ 12353, 0, 12361, 5677, 5588, 0, 41925, 128124, 41920, 5673, 120534, 5676,
+ 41923, 12694, 118978, 5672, 1294, 0, 78059, 0, 42511, 1727, 120725,
+ 42436, 0, 0, 0, 74222, 8718, 3550, 736, 10268, 4505, 10316, 74090, 5826,
+ 55232, 5813, 0, 120712, 5841, 5837, 55234, 0, 3105, 12829, 5838, 5796, 0,
+ 119592, 5793, 0, 5866, 5797, 41011, 5865, 120091, 7956, 598, 0, 64649,
+ 5806, 42398, 0, 9037, 5671, 120041, 0, 0, 0, 128855, 0, 847, 128242,
+ 9529, 0, 66657, 6980, 0, 120035, 78484, 0, 0, 120033, 78486, 0, 0,
+ 120039, 42683, 0, 0, 7114, 0, 0, 43190, 65463, 1554, 0, 42611, 42563, 0,
+ 5651, 2929, 6792, 43201, 0, 19963, 5698, 0, 0, 0, 0, 5644, 10292, 65546,
+ 69727, 68141, 8372, 0, 65116, 0, 120022, 10175, 10388, 42799, 0, 41013,
+ 10568, 0, 0, 2869, 0, 41015, 194692, 2785, 4366, 0, 10954, 41802, 0,
+ 42608, 78469, 9884, 4759, 0, 0, 10266, 41359, 1170, 43365, 69810, 73908,
+ 1609, 902, 0, 63936, 128875, 11661, 8122, 5818, 0, 0, 3861, 9540, 11028,
+ 2554, 5158, 5714, 127015, 0, 0, 807, 43079, 0, 78475, 976, 5511, 64553,
+ 0, 42155, 0, 41356, 74110, 118801, 0, 0, 8676, 0, 0, 11066, 451, 63941,
+ 5798, 9349, 42018, 127858, 0, 0, 43609, 5906, 120553, 1440, 0, 128853,
+ 120016, 74283, 11005, 0, 66656, 66044, 0, 194698, 0, 0, 43393, 10094, 0,
+ 11529, 10857, 120643, 66436, 6546, 93, 8102, 0, 68405, 0, 0, 8171, 0,
+ 119097, 127064, 917543, 383, 7154, 41656, 92634, 0, 0, 5187, 0, 127277,
+ 11286, 68620, 64217, 0, 5232, 0, 41009, 0, 41005, 0, 0, 0, 8292, 195074,
+ 4980, 8860, 73947, 10028, 65291, 7076, 13182, 194705, 0, 0, 10631, 66031,
+ 7972, 0, 78785, 0, 7900, 0, 11309, 78319, 4198, 42725, 0, 67656, 9995, 0,
+ 92552, 0, 12931, 0, 42684, 74285, 2088, 0, 64366, 65156, 8814, 42238,
+ 74771, 0, 0, 12836, 0, 0, 74342, 8593, 0, 0, 68445, 13255, 0, 0, 7464, 0,
+ 65865, 0, 194650, 127144, 0, 9342, 120464, 0, 64516, 0, 78792, 10129,
+ 41007, 74375, 0, 40995, 12209, 41012, 119136, 0, 0, 69724, 40992, 92264,
+ 127153, 68653, 43558, 5522, 0, 61, 0, 74105, 3633, 0, 65162, 41234,
+ 12089, 78281, 9771, 0, 13251, 128701, 0, 6262, 2784, 42743, 0, 8126,
+ 66483, 0, 0, 441, 42621, 0, 0, 41002, 40999, 119623, 43266, 7108, 194779,
+ 10890, 74481, 65834, 8324, 119103, 64417, 74817, 127465, 64737, 0, 0,
+ 8930, 66678, 74249, 1193, 10056, 1800, 13253, 13252, 7829, 0, 0, 7743, 0,
+ 0, 77904, 92640, 77905, 9034, 6039, 0, 10075, 0, 41018, 65683, 10338,
+ 66469, 0, 0, 0, 42815, 0, 41966, 0, 0, 0, 11792, 43064, 41025, 911, 7539,
+ 0, 0, 120339, 65159, 64390, 0, 0, 5520, 11662, 0, 65330, 42812, 0, 0,
+ 12326, 0, 0, 42808, 128337, 9348, 64901, 0, 0, 0, 0, 0, 0, 917584, 43702,
+ 0, 5857, 65342, 92727, 119120, 120079, 8644, 0, 0, 0, 74296, 41909, 0,
+ 120332, 2791, 69663, 1891, 69824, 0, 41907, 66647, 118939, 8761, 12942,
+ 5748, 0, 10773, 0, 0, 8796, 78149, 6412, 2061, 8520, 13146, 127185,
+ 63931, 0, 65902, 2882, 0, 0, 12843, 4520, 120345, 92459, 0, 0, 0, 73860,
+ 0, 0, 64345, 0, 9201, 128314, 194940, 0, 0, 43679, 917585, 65117, 92270,
+ 0, 10427, 0, 3844, 120675, 9755, 1110, 6612, 12222, 0, 128789, 0, 0, 783,
+ 194935, 0, 0, 0, 194720, 65056, 3620, 0, 68378, 4556, 0, 0, 194933,
+ 74250, 0, 67657, 10510, 4382, 66482, 0, 0, 127527, 9177, 8902, 0, 9839,
+ 0, 12891, 0, 0, 63999, 2016, 41917, 9788, 63928, 0, 1862, 65800, 9155,
+ 66623, 9786, 65082, 41919, 8579, 41914, 7981, 0, 66017, 4508, 64883,
+ 92456, 92522, 127814, 0, 64592, 74276, 120080, 6784, 78788, 68181, 0, 0,
+ 0, 127534, 12147, 9024, 66378, 66472, 0, 64289, 65289, 78151, 66658,
+ 194929, 64509, 78152, 0, 0, 11051, 0, 0, 11355, 65885, 0, 128310, 41214,
+ 0, 12299, 0, 7500, 4506, 7773, 0, 0, 9963, 68649, 0, 4040, 120570, 6167,
+ 0, 63922, 6594, 0, 0, 0, 3624, 43036, 0, 6387, 63990, 19947, 63988,
+ 41955, 0, 63993, 10440, 9611, 0, 6803, 0, 7738, 63986, 11446, 63984,
+ 92641, 3435, 78164, 43814, 43810, 7029, 64258, 41292, 118898, 12748,
+ 42742, 9517, 11518, 0, 78790, 0, 194777, 63956, 42458, 63954, 63953,
+ 63960, 9591, 4516, 10217, 68370, 11469, 69697, 42306, 2723, 118947, 0, 0,
+ 0, 0, 0, 11397, 2880, 0, 0, 2872, 0, 0, 3498, 4378, 917539, 4270, 0,
+ 65551, 68205, 6633, 43387, 0, 5230, 0, 0, 0, 0, 0, 8161, 393, 12013, 0,
0, 0, 415, 63964, 63963, 42345, 0, 5183, 1877, 42498, 0, 2927, 0, 63961,
- 4472, 0, 0, 0, 0, 917936, 42340, 4756, 0, 7081, 10730, 7691, 0, 63830,
- 119625, 194945, 42103, 8628, 9813, 0, 42453, 1604, 9565, 10539, 0, 65764,
- 41415, 65767, 0, 8457, 42301, 11372, 64873, 11992, 0, 0, 63980, 11801,
- 3622, 0, 64336, 12017, 10463, 63981, 4967, 64189, 1966, 63976, 0, 0, 0,
- 0, 63971, 4347, 4416, 42098, 11009, 10694, 63973, 402, 0, 13147, 0,
- 42100, 64646, 13228, 0, 41875, 3515, 74252, 11805, 0, 11302, 6259, 0, 0,
- 0, 0, 0, 0, 0, 74425, 11299, 1561, 0, 0, 64942, 0, 194733, 0, 194732, 0,
- 74301, 0, 11280, 0, 0, 74060, 0, 0, 119664, 5145, 12486, 65018, 66516,
- 5409, 0, 194669, 64347, 5399, 9685, 74089, 7952, 5401, 0, 66616, 0, 0, 0,
- 5405, 917555, 64866, 0, 0, 0, 0, 74248, 11330, 194723, 64690, 3254, 0, 0,
- 0, 42390, 0, 194725, 0, 65077, 0, 0, 3355, 9508, 9867, 5723, 11520, 5611,
- 0, 3377, 0, 0, 0, 0, 0, 0, 0, 119119, 0, 0, 119068, 0, 0, 1379, 246, 0,
- 0, 3788, 0, 11041, 0, 66304, 0, 0, 8917, 42403, 301, 0, 0, 0, 0, 0, 0,
- 10656, 0, 65214, 119242, 42567, 0, 13163, 0, 120831, 74597, 3182, 0, 0,
- 0, 0, 65889, 42169, 4755, 74244, 0, 11443, 0, 66326, 74598, 608, 600, 0,
- 1219, 3934, 64206, 11483, 74510, 0, 74485, 42442, 65470, 0, 64202, 13160,
- 7759, 42482, 485, 0, 0, 9828, 0, 0, 42280, 0, 9351, 7778, 64379, 7496,
- 42431, 6916, 1208, 0, 119631, 11002, 42470, 0, 0, 0, 0, 74041, 0, 0,
- 43539, 5411, 0, 0, 0, 0, 9150, 0, 42393, 13086, 1310, 194687, 9337,
- 12052, 10643, 64586, 0, 194684, 2546, 194683, 213, 118852, 65611, 0, 0,
- 194756, 74310, 6554, 0, 11914, 0, 0, 0, 0, 0, 0, 194681, 118826, 2713, 0,
- 9650, 43330, 0, 194675, 1406, 0, 0, 0, 0, 194678, 4143, 194677, 0, 65748,
- 4141, 9682, 65287, 1508, 0, 8779, 10569, 8725, 13299, 66638, 0, 42263,
- 4145, 0, 65751, 66613, 0, 65738, 73729, 9185, 9550, 0, 0, 0, 0, 0, 65736,
- 41951, 64816, 65756, 0, 12955, 10596, 2888, 0, 0, 0, 9657, 9019, 194766,
- 0, 2878, 5390, 0, 194961, 0, 0, 0, 7501, 13203, 0, 10429, 10365, 0, 0,
- 41946, 7503, 5235, 803, 0, 0, 0, 8986, 0, 10632, 11934, 11452, 1332, 0,
- 0, 0, 0, 917545, 1791, 5191, 9288, 64822, 2892, 0, 67849, 555, 0, 0,
- 66646, 0, 119002, 13151, 74512, 7289, 74055, 0, 0, 64162, 5858, 41927,
- 10582, 0, 1784, 1361, 195047, 0, 7905, 0, 64868, 0, 13158, 0, 7211, 0,
- 9371, 0, 0, 0, 1625, 0, 0, 1342, 0, 64171, 0, 10903, 0, 0, 0, 0, 0, 4482,
- 41606, 0, 0, 0, 0, 64381, 0, 0, 0, 42245, 0, 41972, 0, 444, 0, 9127,
- 66687, 66619, 0, 194972, 0, 11349, 40991, 0, 0, 119599, 120830, 0, 1197,
- 0, 1149, 194970, 0, 0, 40990, 0, 0, 3492, 0, 0, 0, 0, 0, 12838, 0, 19948,
- 0, 3099, 0, 0, 41087, 0, 0, 0, 119059, 12036, 0, 0, 0, 8152, 0, 64428,
- 12227, 0, 0, 12828, 0, 0, 0, 0, 0, 0, 10386, 119574, 0, 0, 0, 0, 68154,
- 0, 1743, 0, 0, 0, 65186, 0, 0, 9606, 0, 0, 0, 0, 0, 0, 0, 0, 194967, 0,
- 0, 3395, 9362, 10878, 0, 0, 0, 64830, 0, 0, 41091, 3426, 1344, 8870, 0,
- 0, 4735, 0, 6119, 12822, 0, 0, 0, 74818, 0, 0, 42637, 41080, 0, 12039,
- 10559, 0, 118892, 0, 9472, 0, 11929, 0, 7170, 9596, 6130, 0, 0, 11579, 0,
- 0, 194740, 0, 0, 66699, 0, 1004, 0, 194737, 0, 66008, 12627, 0, 0, 0, 0,
- 0, 11300, 43304, 9686, 5890, 11776, 7558, 0, 65627, 0, 10718, 13154,
- 3461, 9139, 0, 0, 0, 0, 0, 73877, 65628, 0, 0, 0, 41708, 12860, 41703,
- 12069, 10838, 5403, 10352, 73917, 10061, 0, 0, 5140, 209, 0, 41704, 0,
- 43078, 0, 0, 0, 10899, 65469, 0, 0, 0, 2410, 993, 0, 120589, 120689, 0,
- 0, 0, 7232, 0, 119253, 0, 0, 74462, 0, 10489, 42166, 0, 10659, 3600, 0,
- 4224, 1336, 41518, 0, 0, 0, 0, 41139, 64820, 0, 12966, 41134, 0, 0, 0, 0,
- 272, 4263, 8793, 0, 0, 41502, 0, 983, 12549, 0, 0, 1190, 4109, 1335, 841,
- 5888, 41358, 64863, 9544, 0, 0, 0, 0, 7209, 8223, 2409, 7799, 0, 74424,
- 0, 0, 4731, 0, 66629, 0, 0, 1255, 4149, 9247, 0, 9913, 0, 0, 0, 0, 65101,
- 0, 11694, 0, 11690, 5835, 0, 66625, 10842, 41354, 42123, 43097, 11688,
- 66634, 1094, 194, 64692, 0, 8180, 0, 0, 73872, 73865, 0, 6114, 10898,
- 43072, 0, 0, 0, 0, 0, 10695, 0, 7540, 0, 881, 7857, 6067, 65164, 0, 0, 0,
- 13311, 0, 41857, 64321, 8359, 0, 12689, 0, 194594, 0, 0, 0, 68183, 0, 0,
- 1287, 5436, 0, 0, 74142, 127013, 74152, 119078, 6051, 10497, 0, 8985,
- 12109, 0, 0, 0, 0, 0, 3652, 10537, 0, 1276, 0, 6549, 279, 0, 0, 0, 0,
- 1489, 0, 0, 0, 3899, 1007, 42124, 0, 42122, 0, 0, 0, 11985, 1345, 127006,
- 0, 0, 8956, 43083, 0, 42138, 0, 0, 12151, 0, 0, 0, 6285, 0, 0, 0, 74194,
- 492, 8685, 0, 0, 0, 0, 0, 2582, 11470, 64538, 7444, 0, 0, 41550, 0,
- 73837, 0, 2527, 119824, 197, 2799, 0, 0, 120276, 0, 0, 66515, 767, 5524,
- 7028, 0, 0, 119827, 0, 0, 0, 0, 0, 1799, 120497, 6971, 74336, 0, 0,
- 65340, 118979, 0, 2434, 0, 0, 120579, 0, 4631, 0, 0, 6407, 0, 19931,
- 43214, 0, 7570, 0, 3192, 0, 8414, 0, 0, 0, 0, 0, 9164, 66612, 0, 3171,
- 6623, 4961, 0, 886, 0, 8654, 0, 9993, 74390, 64603, 0, 0, 9599, 0, 43084,
- 0, 0, 0, 2399, 0, 8994, 10944, 41208, 0, 41168, 8178, 0, 3367, 195008,
- 42510, 0, 0, 7789, 0, 1947, 0, 0, 0, 42759, 11068, 1705, 9331, 0, 74798,
- 9181, 0, 0, 8017, 0, 65096, 66720, 0, 0, 0, 4909, 12126, 0, 120696, 4904,
- 0, 195012, 1365, 9253, 42757, 0, 7462, 0, 0, 0, 0, 119587, 64415, 0, 0,
- 5398, 0, 195014, 0, 0, 0, 0, 0, 0, 9476, 0, 0, 12763, 0, 3629, 0, 13005,
- 0, 3628, 0, 0, 0, 3469, 42107, 42116, 917578, 64809, 2928, 4905, 9853,
- 851, 9040, 0, 64665, 43086, 9114, 0, 42583, 9315, 4822, 4906, 3852, 2847,
- 0, 3236, 11317, 1251, 7777, 41852, 11410, 10964, 0, 43222, 12646, 120269,
- 10259, 9865, 65821, 0, 6018, 0, 0, 12276, 0, 0, 0, 0, 119613, 0, 0,
- 10467, 0, 2443, 10918, 0, 0, 1001, 9241, 1927, 0, 0, 73987, 0, 0, 0,
- 118828, 0, 65678, 12867, 0, 8260, 0, 7519, 118794, 12274, 8904, 518,
- 65857, 0, 0, 13204, 4387, 857, 0, 65369, 0, 119583, 43125, 120592, 0, 0,
- 0, 0, 5136, 1968, 0, 195023, 1337, 64967, 1629, 0, 796, 66506, 0, 74123,
- 0, 0, 42314, 195021, 0, 74403, 6120, 478, 65151, 68128, 0, 43082, 6016,
- 0, 42284, 0, 4276, 1206, 3619, 41638, 0, 3843, 12011, 8853, 3361, 0, 490,
- 10715, 7578, 0, 0, 65350, 10530, 12348, 8653, 74314, 42435, 6154, 9551,
- 65354, 0, 784, 42397, 334, 0, 42416, 65356, 65273, 0, 0, 7025, 10364, 0,
- 778, 41626, 42455, 7989, 74063, 3227, 0, 0, 73983, 2915, 41698, 41022,
- 41702, 10309, 127035, 0, 0, 6975, 0, 5415, 12176, 0, 0, 3462, 65215,
- 42629, 0, 73784, 0, 0, 9759, 0, 0, 0, 8114, 0, 0, 0, 0, 8710, 42495,
- 118956, 0, 4051, 10460, 74097, 118917, 1356, 12161, 0, 0, 0, 1619, 9703,
+ 4472, 0, 0, 78159, 69699, 917936, 42340, 4756, 128078, 7081, 10730, 7691,
+ 10331, 63830, 119625, 194945, 42103, 8628, 9813, 0, 42453, 1604, 9565,
+ 10539, 69701, 65764, 41415, 65767, 0, 8457, 42301, 11372, 64873, 11992,
+ 0, 0, 63980, 11801, 3622, 0, 64336, 12017, 10463, 63981, 4967, 64189,
+ 1966, 43628, 0, 0, 0, 0, 63971, 4347, 4416, 42098, 11009, 10694, 63973,
+ 402, 0, 13147, 0, 42100, 64646, 13228, 0, 41875, 3515, 74252, 11805, 0,
+ 11302, 6259, 43395, 0, 0, 194670, 0, 92351, 0, 74425, 11299, 1561, 0,
+ 92359, 64942, 0, 194733, 0, 194732, 0, 74301, 0, 11280, 0, 69784, 74060,
+ 0, 0, 119664, 5145, 12486, 65018, 66516, 5409, 127379, 194669, 7402,
+ 5399, 9685, 74089, 7952, 5401, 0, 66616, 68421, 0, 0, 5405, 127875,
+ 64866, 0, 119583, 128345, 78784, 74248, 11330, 194723, 64690, 3254, 0, 0,
+ 0, 42390, 43678, 194725, 0, 65077, 0, 6388, 3355, 9508, 9867, 5723,
+ 11520, 5611, 0, 3377, 0, 0, 0, 0, 78228, 0, 0, 42691, 917886, 127198,
+ 74767, 0, 127075, 1379, 246, 0, 0, 3788, 0, 11041, 92549, 66304, 0, 0,
+ 8917, 42403, 301, 0, 0, 0, 0, 0, 0, 10656, 0, 65214, 119242, 42567,
+ 92217, 13163, 0, 120831, 74597, 3182, 0, 0, 0, 65034, 65889, 42169, 4755,
+ 74244, 0, 11443, 0, 66319, 74598, 608, 600, 0, 1219, 3934, 64206, 11483,
+ 74510, 0, 74485, 42442, 65470, 0, 64202, 13160, 7759, 42482, 485, 128006,
+ 0, 9828, 0, 0, 42280, 0, 9351, 7778, 64379, 7496, 42431, 6916, 1208, 0,
+ 119631, 11002, 42470, 0, 118946, 0, 0, 74041, 0, 120633, 43539, 5411,
+ 42196, 0, 0, 0, 9150, 0, 42393, 13086, 1310, 194687, 9337, 12052, 10643,
+ 55271, 0, 12166, 2546, 194683, 213, 118852, 65611, 0, 0, 194756, 74310,
+ 6554, 0, 11914, 5452, 0, 0, 0, 0, 0, 194681, 92560, 2713, 0, 9650, 43330,
+ 0, 194675, 1406, 0, 0, 92659, 0, 68223, 4143, 194677, 0, 65748, 4141,
+ 9682, 65287, 1508, 127013, 8779, 10569, 8725, 13299, 66638, 65750, 42263,
+ 4145, 6380, 65751, 66613, 43994, 65738, 55250, 9185, 9550, 0, 43403, 0,
+ 0, 0, 65736, 41951, 64816, 65756, 0, 12955, 10596, 2888, 0, 0, 0, 9657,
+ 9019, 194766, 0, 2878, 5390, 0, 194961, 0, 68679, 43552, 7501, 6328, 0,
+ 10429, 10365, 0, 0, 41946, 7503, 5235, 803, 68381, 0, 0, 8986, 0, 10632,
+ 11934, 11452, 1332, 0, 0, 0, 0, 118887, 1791, 5191, 9288, 64822, 2892, 0,
+ 43394, 555, 0, 0, 66646, 0, 119002, 13151, 74512, 7289, 74055, 0, 8854,
+ 64162, 5858, 41927, 10582, 0, 1784, 1361, 195047, 0, 7905, 0, 64868,
+ 128813, 13158, 92166, 7211, 0, 9371, 73973, 0, 6828, 1625, 92302, 0,
+ 1342, 68440, 64171, 0, 10903, 0, 0, 0, 0, 0, 4482, 41606, 0, 128569, 0,
+ 0, 64381, 0, 0, 0, 42245, 0, 41972, 0, 444, 0, 9127, 66687, 66619, 0,
+ 78025, 0, 11349, 40991, 0, 0, 119599, 120830, 0, 1197, 128282, 1149,
+ 194970, 0, 0, 40990, 0, 0, 3492, 0, 127942, 0, 0, 0, 12838, 0, 19948, 0,
+ 3099, 0, 0, 41087, 0, 0, 0, 119059, 12036, 41309, 0, 0, 8152, 0, 64428,
+ 12227, 0, 0, 12828, 127511, 0, 0, 120708, 0, 0, 10386, 119574, 0, 0,
+ 92680, 0, 68154, 0, 1743, 0, 0, 92239, 65186, 0, 0, 9606, 0, 0, 64439, 0,
+ 0, 92686, 0, 0, 194967, 0, 0, 3395, 9362, 10878, 0, 0, 78362, 64830, 0,
+ 0, 41091, 3426, 1344, 8870, 0, 0, 4735, 127017, 6119, 12822, 42699, 0, 0,
+ 74818, 5396, 0, 42637, 41080, 0, 12039, 10559, 0, 118892, 0, 9472, 0,
+ 11929, 0, 7170, 9596, 6130, 128826, 43629, 11579, 194741, 0, 194740,
+ 128691, 92185, 66699, 64440, 1004, 92584, 194737, 43234, 66008, 12627, 0,
+ 68414, 0, 43619, 43382, 11300, 43304, 9686, 5890, 11776, 7558, 127158,
+ 65627, 0, 10718, 13154, 3461, 9139, 0, 0, 0, 0, 65365, 73877, 65628,
+ 78019, 0, 0, 41708, 12860, 2641, 12069, 10838, 5403, 10352, 73917, 10061,
+ 43237, 0, 5140, 209, 128847, 41704, 41056, 43078, 128125, 118809, 0,
+ 10899, 65469, 0, 0, 0, 2410, 993, 0, 120589, 120689, 78693, 0, 0, 7232,
+ 0, 119253, 0, 7110, 74462, 2066, 10489, 42166, 43463, 10659, 3600, 0,
+ 4224, 1336, 41518, 0, 0, 0, 0, 41139, 64820, 92538, 12966, 41134, 0, 0,
+ 0, 0, 272, 4263, 8793, 0, 0, 41502, 0, 983, 12549, 0, 0, 1190, 4109,
+ 1335, 841, 5888, 41358, 64863, 9544, 43481, 0, 0, 0, 2099, 5120, 2409,
+ 7799, 0, 74424, 0, 0, 4731, 0, 66629, 0, 0, 1255, 4149, 9247, 0, 9913, 0,
+ 0, 64914, 917787, 65101, 0, 11694, 92475, 11690, 5835, 127164, 66625,
+ 10842, 41354, 42123, 43097, 11688, 66634, 1094, 194, 64692, 0, 8180, 0,
+ 0, 9972, 73865, 4519, 6114, 10898, 43072, 0, 0, 128858, 0, 0, 10695, 0,
+ 7540, 0, 881, 7857, 6067, 65164, 0, 0, 0, 13311, 68403, 41857, 64321,
+ 8359, 0, 12689, 0, 194594, 0, 0, 0, 68183, 0, 0, 1287, 5436, 0, 0, 74142,
+ 92328, 74152, 119078, 6051, 10497, 69668, 8985, 12109, 0, 0, 0, 0, 0,
+ 3652, 10537, 0, 1276, 120440, 6549, 279, 73745, 0, 0, 0, 1489, 0, 0, 0,
+ 3899, 1007, 42124, 0, 42122, 92337, 0, 0, 11985, 1345, 78600, 0, 0, 8956,
+ 43083, 119830, 42138, 78610, 0, 12151, 78608, 78604, 78605, 6285, 78603,
+ 78612, 78613, 65942, 492, 8685, 0, 0, 0, 78622, 43712, 2582, 11470,
+ 64538, 7444, 78615, 78616, 41550, 0, 73837, 119823, 2527, 119824, 197,
+ 2799, 92594, 41944, 120276, 9933, 0, 66515, 767, 5524, 7028, 0, 0,
+ 119827, 119817, 119828, 78633, 10896, 0, 1799, 120497, 6971, 74336,
+ 128342, 0, 65340, 118979, 41551, 2434, 0, 0, 120579, 0, 4631, 0, 0, 6407,
+ 0, 6338, 43214, 0, 7570, 0, 3192, 0, 8414, 0, 0, 0, 0, 0, 9164, 66612, 0,
+ 3171, 6623, 4961, 68396, 886, 55216, 8654, 78832, 9993, 74390, 64603, 0,
+ 69241, 9599, 78629, 43084, 78627, 78628, 78625, 2399, 69693, 8994, 10944,
+ 41208, 0, 41168, 8178, 0, 3367, 92334, 42510, 78641, 78636, 6804, 78634,
+ 1947, 0, 0, 92681, 42759, 11068, 1705, 9331, 0, 74798, 9181, 65359, 0,
+ 8017, 0, 65096, 66720, 0, 43475, 0, 4909, 12126, 128673, 120696, 4904, 0,
+ 69650, 1365, 9253, 42757, 43436, 7462, 0, 0, 0, 0, 119587, 64415, 0, 0,
+ 5398, 0, 127386, 0, 0, 0, 119015, 0, 0, 9476, 0, 0, 12763, 0, 3629, 0,
+ 13005, 0, 3628, 0, 0, 92502, 3469, 42107, 42116, 917578, 64809, 2928,
+ 4905, 9853, 851, 9040, 0, 64665, 43086, 9114, 0, 42583, 9315, 4822, 4906,
+ 3852, 2847, 119821, 3236, 11317, 1251, 7777, 41852, 11410, 10964, 0,
+ 43222, 12646, 120269, 10259, 9865, 65821, 0, 6018, 92290, 0, 12276, 0,
+ 68372, 0, 92259, 119244, 0, 0, 10467, 0, 2443, 10918, 78217, 119825,
+ 1001, 9241, 1927, 0, 0, 73987, 127885, 0, 0, 118828, 120271, 65678,
+ 12867, 0, 8260, 77945, 7519, 11505, 12274, 8904, 518, 65857, 0, 128674,
+ 13204, 4387, 857, 0, 65369, 0, 92336, 43125, 120592, 0, 0, 0, 0, 5136,
+ 1968, 0, 195023, 1337, 64967, 1629, 0, 796, 66506, 0, 74123, 12877, 0,
+ 42314, 43388, 0, 74403, 6120, 478, 65151, 68128, 128147, 43082, 6016, 0,
+ 42284, 128507, 4276, 1206, 3619, 41638, 69691, 3843, 12011, 8853, 3361,
+ 0, 490, 10715, 7578, 68384, 0, 65350, 10530, 12348, 8653, 74314, 42435,
+ 6154, 9551, 65354, 78522, 784, 42397, 334, 0, 42416, 65356, 65273, 77987,
+ 69666, 4442, 10364, 0, 778, 41626, 42455, 7989, 74063, 3227, 0, 127275,
+ 73983, 2915, 11502, 41022, 41702, 10309, 127035, 78320, 0, 6975, 0, 5415,
+ 12176, 0, 74193, 3462, 65215, 42629, 78691, 73784, 0, 0, 9759, 0, 78324,
+ 127254, 8114, 78698, 78697, 78696, 78695, 8710, 42495, 118956, 0, 4051,
+ 10460, 43364, 118917, 1356, 12161, 42713, 128857, 127268, 1619, 9703,
43152, 42489, 42112, 0, 1875, 10808, 42109, 120284, 41860, 64862, 13305,
- 64907, 5289, 13144, 0, 0, 5575, 9675, 0, 5940, 226, 2649, 74493, 0, 0, 0,
- 3382, 42449, 6498, 1658, 11936, 0, 0, 11269, 0, 73759, 43100, 74449,
- 65508, 0, 0, 0, 8935, 917985, 0, 0, 0, 616, 0, 65178, 4684, 0, 119653, 0,
- 0, 0, 6048, 74460, 42110, 73965, 10870, 8557, 11054, 0, 0, 9681, 4475, 0,
- 0, 0, 0, 120731, 6035, 0, 7651, 10296, 0, 0, 0, 0, 0, 118966, 74144,
- 40997, 0, 10392, 10328, 40998, 0, 74488, 0, 9800, 8979, 0, 119131, 41000,
- 0, 119239, 6487, 10977, 0, 10344, 0, 65299, 5394, 0, 0, 10220, 66505,
- 41200, 0, 4425, 0, 0, 0, 43074, 73799, 0, 0, 0, 12173, 0, 0, 0, 65338, 0,
- 0, 119582, 4474, 0, 43093, 0, 1587, 0, 0, 64475, 0, 1369, 0, 0, 0, 0,
- 4560, 0, 0, 0, 0, 64948, 4430, 74347, 42601, 4514, 0, 0, 8194, 65462,
- 10626, 10965, 0, 8893, 0, 12542, 0, 65341, 0, 65829, 7925, 0, 10475, 0,
- 0, 1352, 11069, 7707, 0, 0, 65279, 127102, 127101, 127100, 65605, 6040,
- 127097, 10440, 0, 9336, 0, 0, 8899, 7798, 64474, 64259, 0, 65188, 7820,
- 43018, 0, 0, 7746, 1492, 0, 10884, 0, 0, 5127, 11285, 42501, 5495, 4273,
- 43095, 41426, 10849, 5730, 2999, 0, 120720, 74304, 371, 64373, 6023, 169,
- 5497, 11708, 0, 0, 0, 0, 8224, 0, 8938, 6043, 12738, 0, 0, 5321, 0, 0, 0,
- 2589, 74332, 1689, 7802, 4683, 74318, 0, 120296, 66704, 0, 0, 0, 0,
- 74513, 6049, 0, 4027, 834, 118962, 1803, 0, 1503, 0, 0, 0, 5731, 1381,
- 2387, 0, 0, 8289, 64525, 65817, 2881, 65514, 0, 9601, 2879, 9668, 9766,
- 0, 5729, 0, 74410, 6036, 64881, 4026, 9361, 127091, 2887, 0, 3526, 6298,
- 0, 0, 0, 0, 0, 8572, 6021, 0, 0, 0, 43155, 0, 0, 3146, 10959, 0, 0, 0,
- 10981, 166, 0, 8635, 0, 10623, 408, 0, 0, 13298, 0, 7426, 41641, 12717,
- 0, 7607, 10639, 66713, 0, 0, 41643, 74134, 0, 8713, 41640, 0, 41645,
- 66712, 6645, 646, 66726, 66711, 42129, 0, 0, 3472, 8697, 0, 0, 0, 0, 0,
- 0, 5809, 1950, 119356, 0, 74572, 0, 42136, 0, 0, 0, 0, 3247, 119854,
- 65017, 0, 0, 66668, 0, 0, 10983, 0, 0, 0, 41567, 0, 0, 0, 0, 0, 0, 0,
- 8285, 0, 4509, 0, 66471, 12216, 0, 40988, 0, 0, 41727, 0, 0, 2396, 0, 0,
- 0, 0, 64940, 0, 3886, 0, 42457, 0, 0, 996, 0, 917571, 4249, 0, 917594,
- 11707, 8222, 0, 7939, 0, 917574, 917582, 917592, 917569, 8534, 0, 40983,
- 0, 0, 0, 7201, 12561, 0, 42371, 12558, 0, 0, 10052, 40982, 0, 0, 1488, 0,
- 0, 0, 917559, 0, 0, 1563, 0, 9619, 0, 0, 0, 0, 0, 5803, 7797, 6070,
- 10006, 0, 2922, 6082, 0, 65009, 0, 12567, 0, 0, 0, 0, 0, 3607, 65863,
- 10046, 9612, 42153, 8218, 9485, 0, 2032, 0, 0, 0, 0, 0, 0, 43085, 6057,
- 508, 0, 0, 120265, 0, 0, 0, 0, 638, 6083, 119072, 0, 0, 2305, 0, 0, 0,
- 6056, 6659, 0, 0, 6085, 0, 0, 3915, 41634, 0, 41639, 63912, 11941, 0,
- 4028, 1787, 42180, 43096, 0, 3249, 1768, 0, 12328, 501, 127074, 10601, 0,
- 583, 0, 41977, 0, 66004, 119350, 6505, 74010, 0, 13064, 0, 120810, 6500,
- 5526, 65049, 0, 74531, 0, 0, 12745, 9678, 0, 120587, 9869, 0, 1771, 0,
- 8936, 0, 0, 4208, 0, 119115, 0, 0, 0, 74101, 0, 11762, 0, 0, 0, 0, 66475,
- 0, 5027, 0, 0, 0, 5069, 73862, 5028, 9897, 0, 73739, 5026, 0, 0, 0, 0,
- 8931, 0, 1415, 8866, 41901, 74790, 0, 119361, 0, 43106, 5029, 119360,
- 1580, 3598, 0, 41070, 0, 0, 3440, 119359, 1562, 0, 917827, 119358, 1716,
- 0, 10600, 0, 620, 41001, 6028, 0, 42892, 0, 74822, 5024, 120829, 41003,
- 0, 5025, 0, 0, 0, 119328, 0, 65557, 0, 0, 0, 11599, 0, 11602, 6243,
- 11574, 11581, 11597, 11598, 6253, 6105, 11584, 74195, 11569, 65275, 8906,
- 127096, 66491, 2636, 0, 10815, 11619, 0, 41540, 7815, 11616, 6979, 12080,
- 7721, 11604, 7869, 1592, 0, 42152, 0, 41048, 0, 829, 0, 0, 19950, 0, 0,
- 6616, 0, 118875, 10953, 391, 0, 0, 482, 42296, 11588, 0, 43606, 0, 0,
- 66370, 0, 42335, 0, 0, 0, 7538, 5315, 0, 42491, 0, 42061, 0, 4576, 0, 0,
- 120241, 4277, 0, 4039, 64472, 42338, 368, 42058, 3960, 11043, 11337,
- 120247, 917820, 63989, 3958, 12132, 1849, 0, 9921, 42451, 917818, 41147,
- 42064, 11959, 42404, 41160, 0, 3618, 0, 0, 43300, 5156, 0, 0, 929, 0,
- 917822, 42437, 1555, 0, 8691, 66435, 0, 41662, 0, 0, 0, 0, 0, 4578,
- 64513, 41664, 0, 42578, 0, 41661, 0, 43305, 9356, 0, 0, 0, 1286, 10166,
- 0, 0, 64707, 0, 42476, 7730, 0, 0, 42483, 0, 0, 42324, 42291, 10020,
- 43359, 0, 6641, 525, 41627, 0, 8763, 0, 41628, 533, 11931, 65225, 8321,
- 42504, 42581, 0, 6915, 42310, 4377, 8559, 0, 120234, 0, 13193, 64350,
- 11666, 8679, 41924, 1576, 7735, 0, 0, 73840, 0, 11374, 0, 10889, 917909,
- 7757, 42462, 120226, 126994, 66493, 2718, 4168, 73842, 13308, 120112, 0,
- 1179, 4440, 0, 0, 363, 11015, 0, 0, 64296, 127090, 66692, 120826, 0,
- 66492, 6593, 64625, 41963, 0, 119329, 0, 10013, 0, 0, 127095, 9492,
- 11782, 64382, 12833, 0, 0, 1297, 41630, 630, 127094, 0, 0, 0, 1043, 0, 0,
- 10090, 0, 0, 313, 917563, 41881, 0, 42311, 7445, 0, 5750, 10759, 9419, 0,
- 9405, 11268, 0, 9398, 8526, 9399, 9422, 0, 66495, 0, 0, 0, 41718, 10707,
- 1603, 0, 0, 0, 631, 0, 0, 13161, 65272, 0, 10546, 74210, 0, 11600, 0,
- 2797, 73821, 42427, 306, 714, 3058, 42381, 120036, 127080, 12351, 42395,
- 0, 11607, 0, 42282, 0, 0, 9157, 73765, 66364, 42433, 0, 7603, 12803, 180,
- 42141, 0, 120612, 66494, 12674, 8244, 362, 0, 0, 8037, 917804, 11535, 0,
- 74845, 5185, 66696, 5521, 10334, 5519, 0, 10302, 0, 10104, 1027, 5181, 0,
- 0, 10523, 1446, 42320, 41646, 991, 5189, 42472, 41647, 120105, 1722,
- 5581, 0, 3405, 0, 194644, 5523, 0, 42620, 0, 0, 9549, 0, 10549, 0, 9661,
- 66486, 0, 120537, 120026, 0, 0, 0, 0, 41991, 0, 0, 7630, 9846, 7684,
- 10350, 0, 1174, 0, 0, 0, 0, 66485, 0, 42277, 0, 42456, 65667, 0, 12330,
- 0, 0, 42417, 42383, 0, 41344, 6293, 0, 66252, 0, 74443, 0, 10209, 8313,
- 4195, 0, 9010, 66690, 0, 0, 64894, 0, 65871, 0, 1736, 0, 3901, 12228,
- 120151, 65200, 3383, 10446, 0, 693, 9130, 314, 64149, 42420, 11949, 0, 0,
- 11026, 0, 5332, 6940, 64154, 12635, 127007, 120628, 1751, 273, 8165,
- 13166, 120763, 0, 0, 12824, 0, 4528, 5320, 6301, 0, 6133, 9339, 9463,
- 42346, 10922, 64560, 3757, 0, 0, 0, 65869, 73760, 2569, 0, 2326, 65740,
- 2565, 42459, 7596, 7921, 0, 74095, 0, 41848, 2567, 66006, 0, 4044, 0, 0,
- 12233, 0, 1023, 474, 0, 119818, 0, 0, 42487, 65556, 0, 0, 42295, 0, 0, 0,
- 0, 9835, 66499, 0, 0, 12275, 10895, 0, 274, 0, 1858, 0, 0, 0, 10118,
- 3133, 0, 73795, 0, 9610, 8068, 8197, 0, 699, 0, 41665, 5868, 0, 0, 42182,
- 7581, 19940, 0, 41667, 0, 0, 1923, 65583, 65802, 0, 64597, 0, 119184, 0,
- 0, 6464, 7036, 2996, 1937, 0, 0, 41835, 4047, 41842, 0, 65217, 0, 0,
- 11017, 0, 0, 293, 0, 0, 64791, 41827, 42466, 65416, 10579, 8560, 0,
- 65413, 118835, 4803, 12964, 1739, 1941, 3900, 0, 1713, 0, 0, 73957,
- 11407, 42441, 41971, 6297, 120098, 64105, 0, 42481, 11716, 66473, 7179,
- 42289, 0, 64103, 969, 0, 9352, 0, 6165, 64100, 0, 6632, 73861, 42402,
- 74327, 7806, 0, 8914, 0, 0, 3183, 1435, 64876, 2969, 6046, 0, 6208, 0,
- 5746, 73749, 0, 64416, 42422, 0, 0, 7082, 73775, 338, 5059, 194719, 0,
- 42328, 10767, 0, 8115, 0, 0, 0, 8227, 0, 1218, 0, 0, 65848, 0, 0, 0, 0,
- 126987, 4486, 0, 0, 0, 10925, 0, 0, 0, 0, 42309, 10257, 0, 10273, 0,
- 10305, 42461, 0, 42349, 8832, 0, 64127, 10644, 0, 0, 42278, 74451,
- 126988, 917857, 7794, 0, 42429, 11081, 42316, 119026, 3669, 3968, 42468,
- 0, 0, 0, 65402, 119581, 0, 0, 64933, 0, 41960, 0, 0, 0, 0, 66678, 42391,
- 1588, 65400, 8409, 0, 19967, 65398, 787, 0, 0, 0, 6115, 118940, 41654,
- 42480, 0, 0, 41655, 65401, 0, 0, 0, 0, 644, 65500, 41657, 10778, 3659,
- 9533, 184, 1553, 13107, 65484, 0, 10502, 74457, 0, 0, 41554, 0, 8220, 0,
- 41557, 0, 0, 11070, 0, 5157, 4020, 73858, 41555, 9514, 64818, 65103,
- 64641, 0, 119633, 7520, 0, 74377, 11029, 66651, 0, 0, 118930, 64527, 0,
- 7877, 73803, 0, 0, 120096, 74602, 0, 0, 0, 42817, 0, 65212, 11715, 12190,
- 12319, 0, 0, 0, 9502, 65427, 0, 65424, 0, 0, 9734, 65425, 0, 0, 0, 0, 0,
- 10112, 10827, 0, 9866, 74527, 66675, 0, 8625, 64346, 11290, 10477, 0,
- 8636, 0, 8315, 65444, 0, 0, 74595, 6152, 0, 0, 6629, 0, 120171, 0, 74589,
- 0, 0, 0, 0, 0, 0, 11046, 11490, 43127, 4485, 0, 0, 64926, 0, 0, 0, 5869,
- 12437, 0, 0, 7040, 3588, 0, 12825, 0, 0, 12725, 0, 0, 120167, 223, 0, 0,
- 120166, 42444, 0, 64499, 65245, 0, 1171, 0, 120165, 0, 1805, 8772, 0, 0,
- 65078, 65247, 0, 120111, 2338, 0, 118853, 0, 0, 0, 64800, 65236, 67644,
- 68126, 1213, 0, 64075, 797, 64074, 8734, 4212, 0, 64387, 4115, 0, 5005,
- 64070, 64073, 10679, 0, 0, 0, 64276, 426, 0, 0, 8251, 10136, 65436, 0,
- 65088, 43302, 1224, 0, 65576, 0, 10701, 1764, 3101, 0, 65291, 120159, 0,
- 11373, 74566, 0, 120103, 8663, 9312, 41644, 4539, 3787, 0, 9222, 0, 0,
- 4259, 9092, 74567, 41961, 0, 12724, 66357, 42331, 64935, 0, 0, 1293,
- 7947, 12003, 0, 74593, 120308, 2454, 74807, 3613, 0, 0, 0, 65888, 120307,
- 10978, 10840, 0, 10668, 0, 43087, 12595, 120304, 0, 118806, 0, 1157,
- 64903, 8638, 0, 0, 0, 0, 120319, 8235, 0, 4405, 10086, 0, 0, 0, 0, 65430,
- 74013, 6079, 0, 10764, 0, 64291, 0, 998, 120312, 11062, 120313, 64327,
- 1558, 0, 1991, 7882, 42254, 0, 41700, 530, 0, 10428, 119335, 12002,
- 119336, 5742, 43076, 4692, 64630, 41823, 4007, 5004, 119334, 7896, 751,
- 6595, 6596, 0, 66373, 0, 0, 64908, 0, 6311, 0, 12004, 119192, 12049,
- 43108, 0, 0, 41705, 0, 6598, 0, 6599, 0, 0, 42148, 118825, 66027, 0,
- 6597, 9412, 8340, 11824, 64745, 0, 0, 0, 1988, 5407, 67865, 2430, 41678,
- 0, 0, 2336, 0, 0, 0, 120442, 0, 1921, 10947, 19927, 0, 65406, 0, 19913,
- 4284, 13217, 0, 0, 12841, 9229, 10956, 42285, 41674, 19964, 41679, 65084,
- 3521, 0, 5774, 8325, 0, 65403, 0, 1854, 10794, 0, 0, 0, 0, 0, 5280, 0,
- 4344, 12905, 65433, 6076, 64793, 41610, 768, 12074, 442, 0, 68162, 64081,
- 12934, 41682, 65432, 41693, 0, 6071, 65434, 0, 4804, 6994, 0, 0, 0,
- 41696, 467, 0, 0, 0, 0, 0, 8421, 0, 0, 64801, 502, 0, 65431, 0, 0, 12043,
- 1303, 316, 0, 2029, 65191, 119246, 11533, 64365, 0, 0, 4860, 194645, 0,
- 42488, 0, 9583, 0, 5546, 8019, 73856, 0, 0, 0, 5544, 2355, 12150, 65725,
- 5543, 119245, 63751, 12137, 5548, 0, 0, 0, 0, 65726, 6077, 0, 65452, 0,
- 11301, 0, 0, 0, 9874, 0, 0, 0, 3050, 65410, 0, 0, 0, 0, 42830, 0, 66716,
- 0, 4691, 0, 9345, 621, 0, 0, 0, 65411, 0, 41182, 73881, 65408, 73899, 0,
- 9474, 10545, 119118, 10887, 3786, 65409, 8894, 43179, 119611, 7923, 3716,
- 119341, 9996, 8508, 0, 7012, 8195, 0, 9566, 0, 3722, 0, 41707, 8493, 545,
- 9575, 41379, 10050, 12718, 0, 8859, 41459, 0, 0, 120740, 0, 0, 9119,
- 2787, 7920, 118823, 4021, 2012, 7985, 0, 119663, 0, 0, 0, 0, 410, 120449,
- 1802, 120789, 74107, 0, 41659, 41671, 1827, 0, 64396, 10126, 12116,
- 41673, 120370, 11422, 120372, 120373, 3860, 120367, 120368, 41345,
- 120362, 120363, 11748, 42158, 7941, 11076, 8749, 120361, 12698, 64858,
- 361, 120357, 845, 0, 41560, 11970, 4562, 917920, 2926, 0, 4569, 74130, 0,
- 119221, 194630, 611, 74129, 64871, 0, 65629, 0, 0, 0, 0, 0, 120543, 0, 0,
- 6291, 0, 0, 41669, 7094, 917921, 0, 0, 74054, 0, 0, 0, 839, 0, 7695,
- 8769, 65246, 4829, 0, 4859, 64467, 0, 0, 118998, 7206, 0, 6647, 0, 0, 0,
- 0, 64764, 4210, 0, 0, 804, 0, 0, 12298, 0, 0, 0, 64924, 10091, 73931,
- 9468, 74245, 0, 0, 74246, 0, 12839, 64669, 0, 0, 1279, 1425, 6224,
- 119229, 11049, 0, 917549, 0, 8482, 0, 0, 5032, 0, 11940, 67888, 664, 0,
- 5034, 0, 0, 0, 0, 73888, 0, 13294, 67873, 64869, 6032, 0, 9115, 7430,
- 120377, 0, 120819, 0, 120168, 73913, 120170, 41161, 5518, 4174, 10993,
- 41162, 120160, 64528, 1169, 434, 41437, 1905, 6034, 41164, 64744, 9528,
- 118867, 0, 524, 0, 74029, 788, 74027, 0, 0, 0, 1663, 10419, 74025, 42636,
- 0, 0, 0, 120656, 0, 0, 0, 0, 0, 67897, 74039, 0, 0, 11395, 0, 119107,
- 43612, 64344, 0, 0, 10855, 5445, 9355, 0, 65198, 0, 8989, 221, 65686, 0,
- 0, 8010, 7191, 4962, 0, 8855, 0, 0, 64469, 0, 10555, 0, 0, 0, 0, 120427,
- 10451, 0, 120152, 7245, 12443, 74405, 120148, 120149, 120150, 3873, 8367,
- 0, 120146, 120147, 0, 66507, 0, 0, 11010, 12723, 74059, 74062, 6217,
- 5896, 0, 7682, 74049, 1462, 10235, 0, 0, 0, 0, 0, 0, 42595, 0, 74402,
- 118860, 0, 120419, 0, 74052, 0, 0, 120549, 119082, 64295, 120418, 0,
- 64765, 73923, 120417, 120662, 120730, 0, 6216, 0, 10755, 9455, 0, 8124,
- 0, 9470, 6944, 0, 0, 0, 2828, 0, 531, 42638, 0, 0, 0, 73764, 8204, 3614,
- 2827, 9696, 0, 0, 8728, 4354, 10904, 120502, 19936, 7833, 120691, 0,
- 42599, 42597, 0, 120409, 0, 0, 8537, 0, 0, 0, 0, 0, 41199, 10121, 2028,
- 0, 0, 0, 0, 3062, 0, 74447, 12608, 0, 66440, 7545, 9700, 12580, 0,
- 120777, 0, 41155, 0, 74071, 0, 0, 12713, 0, 0, 0, 0, 0, 1734, 0, 0, 0, 0,
- 2456, 231, 0, 74167, 542, 0, 118786, 0, 0, 1230, 0, 0, 3597, 9761, 10584,
- 74235, 0, 4037, 0, 8352, 0, 5687, 0, 64515, 0, 0, 0, 67846, 0, 9704, 0,
- 0, 74284, 0, 0, 8660, 0, 0, 0, 0, 74482, 4483, 1709, 0, 9909, 6080, 0, 0,
- 1746, 1315, 8667, 0, 0, 13140, 65899, 10604, 0, 4480, 11266, 0, 1226,
- 6930, 0, 0, 0, 10897, 41230, 605, 0, 74785, 120356, 0, 0, 41500, 0, 311,
- 11453, 6221, 10608, 64943, 74280, 10877, 0, 64885, 74272, 0, 0, 0, 0,
- 74312, 345, 0, 74456, 64606, 42589, 0, 0, 5037, 0, 1776, 8422, 0, 118814,
- 41508, 41201, 323, 43328, 0, 120698, 1295, 0, 4625, 0, 4630, 13117, 0, 0,
- 65123, 11293, 2668, 11288, 0, 42640, 65666, 2519, 0, 65420, 0, 0, 917886,
- 5049, 0, 119011, 706, 7754, 10854, 8738, 0, 65419, 0, 0, 649, 65421, 0,
- 66702, 0, 12670, 1013, 0, 64919, 705, 0, 65422, 0, 1183, 0, 7017, 42852,
- 0, 8157, 9736, 64503, 65418, 0, 0, 74035, 0, 11913, 73874, 42848, 0,
- 8920, 0, 0, 7962, 12211, 9837, 0, 66227, 0, 4184, 0, 0, 10177, 73777,
- 1857, 0, 4626, 8464, 8472, 0, 4629, 8499, 0, 0, 4624, 7818, 194622, 0, 0,
- 7805, 0, 0, 6935, 0, 0, 0, 0, 43327, 0, 119046, 8492, 8250, 8459, 0,
- 8497, 8496, 0, 0, 0, 0, 9543, 0, 0, 0, 65849, 0, 0, 0, 0, 0, 8684, 0,
- 6102, 0, 5298, 0, 5294, 0, 0, 0, 0, 0, 119826, 0, 119215, 0, 12073, 0, 0,
- 0, 13108, 0, 74397, 41468, 0, 0, 5292, 0, 0, 1939, 5302, 3970, 0, 12455,
- 1793, 0, 0, 0, 6643, 0, 65263, 0, 0, 41293, 0, 119125, 0, 13219, 9569, 0,
- 74383, 0, 0, 0, 5500, 8813, 0, 0, 0, 5322, 0, 0, 0, 5324, 66443, 3784,
- 41614, 65269, 6230, 0, 0, 43324, 3360, 0, 11523, 0, 0, 41732, 7197, 0, 0,
- 0, 41821, 1249, 0, 0, 0, 118992, 0, 64899, 64763, 41149, 41807, 43162,
- 41815, 41150, 0, 10571, 10096, 0, 0, 0, 6947, 41152, 887, 9249, 6565, 0,
- 41990, 0, 41811, 74466, 0, 6670, 0, 0, 0, 43092, 43325, 0, 10168, 0,
- 9781, 0, 9190, 0, 9666, 8269, 65944, 74005, 13019, 11670, 0, 315, 12813,
- 0, 119648, 0, 0, 0, 0, 0, 0, 0, 1378, 9509, 0, 0, 74475, 3066, 0, 67847,
- 0, 0, 0, 0, 8787, 0, 194616, 41618, 194615, 0, 194614, 0, 64652, 0,
- 194612, 0, 0, 42088, 0, 0, 7176, 0, 10137, 6121, 10995, 0, 74534, 8119,
- 64874, 0, 0, 0, 0, 74525, 0, 0, 12930, 1394, 74514, 0, 74515, 0, 118804,
- 2998, 9527, 120659, 65190, 12977, 42090, 119165, 0, 119100, 41236, 0,
- 65168, 42003, 41237, 5848, 0, 0, 3670, 0, 0, 0, 0, 7890, 0, 11298, 43315,
- 0, 6229, 1593, 0, 0, 619, 4635, 65080, 0, 0, 4120, 65337, 65336, 0,
- 11808, 119214, 74115, 9366, 42790, 42006, 0, 65327, 65326, 65325, 10757,
- 1507, 65322, 65321, 65320, 65335, 65334, 65333, 65332, 65331, 42059,
- 65329, 65328, 0, 9128, 118885, 42073, 41631, 64590, 0, 4371, 7196, 65318,
- 2035, 65316, 4106, 65314, 65313, 42074, 0, 41228, 0, 119117, 41241, 7903,
- 41239, 43533, 127099, 7189, 0, 0, 0, 12357, 42802, 0, 8487, 9131, 0,
- 4615, 12695, 0, 0, 12175, 0, 64535, 0, 7809, 0, 0, 562, 12169, 6590, 0,
- 66455, 64738, 3219, 0, 0, 0, 1037, 0, 2025, 0, 13098, 0, 10637, 4568,
- 549, 1570, 0, 2835, 0, 10624, 194587, 11072, 0, 0, 0, 12606, 0, 2825, 0,
- 10825, 8079, 2821, 41046, 0, 0, 0, 120593, 13071, 0, 452, 41049, 42840,
- 43614, 2831, 0, 74596, 11465, 5212, 0, 64703, 119191, 42308, 7181, 0,
- 41332, 0, 12333, 0, 1668, 0, 0, 0, 1187, 0, 42628, 0, 0, 0, 0, 3240, 0,
- 12194, 0, 11591, 41065, 5323, 8166, 0, 0, 0, 74535, 1623, 65297, 0, 571,
- 0, 4918, 0, 5288, 0, 8916, 65048, 1909, 8864, 0, 0, 10736, 0, 11571,
- 7615, 0, 0, 4237, 0, 1035, 65815, 0, 7881, 701, 65936, 3489, 0, 0, 0,
- 11403, 0, 0, 0, 3796, 0, 0, 3994, 11421, 0, 0, 0, 0, 0, 0, 64857, 0,
- 2855, 0, 66308, 41621, 0, 0, 0, 10654, 0, 119226, 12164, 3246, 7906, 0,
- 65847, 7182, 0, 13024, 194822, 119931, 0, 0, 0, 0, 1496, 747, 0, 942,
- 2378, 43136, 0, 8466, 0, 9320, 8001, 1232, 8139, 11617, 0, 0, 11409, 0,
- 0, 0, 66319, 0, 0, 11612, 0, 0, 2374, 0, 8475, 11609, 66313, 0, 0, 5286,
- 119297, 0, 0, 64925, 0, 0, 0, 194583, 7705, 11942, 11305, 194581, 3309,
- 0, 0, 0, 0, 11975, 0, 41653, 1280, 1241, 7168, 12096, 0, 0, 42565, 41651,
- 0, 0, 0, 41650, 0, 66470, 0, 12914, 41491, 66010, 119552, 6078, 65100, 0,
- 1475, 0, 0, 6084, 917546, 41064, 41062, 0, 0, 3256, 0, 42076, 0, 0, 0,
- 8727, 0, 65875, 0, 0, 0, 10562, 74215, 67608, 0, 0, 3248, 74297, 3261,
- 9015, 0, 0, 3635, 64337, 0, 0, 0, 7195, 0, 2007, 64431, 0, 0, 0, 0, 635,
- 0, 0, 65613, 0, 0, 73997, 0, 0, 119218, 7984, 8600, 74434, 0, 4176, 0,
- 2034, 0, 120805, 65891, 127038, 0, 318, 2038, 0, 0, 0, 3649, 13149,
- 42145, 42798, 3634, 120291, 118927, 0, 120124, 7866, 0, 11402, 42146,
- 120134, 74238, 120129, 2849, 127034, 0, 7938, 12960, 1761, 11812, 65379,
- 74509, 0, 1159, 0, 0, 0, 0, 7178, 194632, 0, 41680, 0, 0, 11534, 1514,
- 11668, 67891, 9313, 7015, 0, 67877, 0, 12989, 194560, 9368, 12848, 1624,
- 43270, 0, 194563, 10818, 194562, 12649, 0, 0, 1194, 3242, 0, 9555, 8598,
- 120299, 6169, 0, 1551, 2798, 65176, 120298, 42752, 119025, 0, 67875,
- 120301, 3495, 66648, 0, 0, 0, 0, 4891, 0, 10641, 0, 73746, 0, 0, 0,
- 73787, 0, 0, 7199, 64955, 0, 0, 0, 0, 0, 64952, 0, 193, 0, 0, 0, 0, 0,
- 5271, 0, 119661, 118882, 1362, 13297, 0, 0, 0, 0, 73789, 0, 6658, 4426,
- 0, 0, 0, 119123, 7276, 42163, 5220, 0, 0, 0, 2416, 3310, 66030, 0, 379,
- 0, 0, 0, 0, 3223, 65492, 1284, 0, 4549, 0, 0, 0, 0, 10807, 9558, 0, 0,
- 8515, 8688, 12866, 0, 3294, 0, 0, 0, 0, 7564, 0, 43329, 0, 0, 73757,
- 66456, 42359, 0, 2031, 0, 7202, 0, 12676, 66615, 0, 3215, 0, 7710, 1610,
- 73801, 0, 0, 65682, 0, 0, 65924, 0, 228, 0, 1501, 0, 64395, 5179, 7200,
- 6225, 0, 65794, 1725, 65533, 8196, 7476, 74399, 0, 0, 0, 8502, 5762,
- 1967, 7483, 0, 0, 8104, 0, 7474, 0, 0, 0, 10414, 13001, 8141, 0, 42537,
- 1557, 0, 0, 0, 0, 8631, 2545, 120672, 0, 0, 74190, 0, 0, 0, 42762, 0, 0,
- 1650, 262, 1637, 0, 7901, 3238, 0, 41861, 0, 0, 65158, 10860, 0, 119134,
- 7527, 0, 43319, 6419, 0, 45, 0, 0, 0, 0, 119810, 7194, 5291, 0, 0, 13129,
- 0, 9084, 0, 8737, 0, 12881, 0, 12906, 9639, 7912, 2620, 0, 0, 0, 0, 179,
- 65896, 0, 64756, 2853, 0, 118813, 0, 118996, 0, 2850, 8084, 0, 73850,
- 2801, 119837, 42069, 119839, 74754, 119841, 42072, 119843, 119842, 74767,
- 0, 0, 0, 0, 8245, 119313, 3158, 119853, 4389, 73813, 923, 119857, 119856,
- 292, 13002, 119845, 119844, 3221, 1763, 119849, 4612, 119851, 119850,
- 7253, 127110, 120618, 0, 10782, 3637, 12996, 43542, 0, 64578, 0, 3228,
- 73869, 8783, 0, 119614, 2731, 0, 0, 118939, 4102, 7696, 73878, 0, 0, 0,
- 43316, 4177, 11283, 9089, 0, 73996, 0, 64500, 68133, 0, 0, 1856, 0, 0, 0,
- 0, 0, 0, 3208, 12975, 0, 0, 0, 0, 74072, 0, 0, 0, 0, 2033, 119008, 0,
- 195026, 0, 7740, 0, 0, 0, 73964, 0, 0, 0, 65674, 0, 0, 41689, 0, 74006,
- 64909, 6646, 11790, 74019, 0, 0, 0, 8561, 4573, 0, 5326, 0, 120605, 7230,
- 8257, 0, 8778, 41688, 0, 65776, 0, 8314, 6459, 0, 7628, 65092, 73903,
- 66721, 11342, 0, 0, 0, 0, 127001, 0, 11810, 13164, 10723, 967, 0, 0,
- 11946, 0, 3257, 0, 12307, 1845, 0, 43526, 0, 0, 1886, 42342, 10089, 870,
- 7648, 3499, 8609, 7652, 876, 871, 877, 0, 878, 42015, 879, 0, 4563, 0, 0,
- 7591, 65887, 867, 9520, 872, 0, 868, 873, 7642, 0, 869, 874, 7644, 0,
- 875, 790, 0, 0, 0, 0, 66182, 0, 5429, 0, 66180, 0, 66181, 0, 0, 0, 42067,
- 0, 5433, 10657, 7911, 0, 1547, 66176, 42012, 0, 5425, 4977, 9999, 5317,
- 5423, 4611, 0, 67637, 0, 9679, 74122, 0, 0, 0, 0, 4418, 66184, 4628,
- 4245, 0, 0, 0, 1851, 0, 0, 11908, 0, 9360, 118897, 0, 42776, 66187,
- 12837, 8829, 0, 0, 0, 0, 43318, 0, 8809, 119974, 0, 0, 120604, 0, 0, 0,
- 0, 0, 0, 7427, 0, 4588, 0, 0, 74484, 0, 2433, 0, 119622, 3352, 74363, 0,
- 0, 793, 74404, 0, 305, 567, 0, 842, 0, 8208, 0, 41695, 1647, 118877, 0,
+ 64907, 5289, 13144, 128658, 0, 5575, 9675, 0, 5940, 226, 2649, 6336, 0,
+ 0, 43236, 3382, 42449, 6498, 1658, 11936, 78232, 0, 11269, 10151, 73759,
+ 43100, 74449, 65508, 0, 0, 0, 8935, 917985, 0, 0, 0, 616, 74753, 65178,
+ 4684, 78701, 119653, 0, 0, 0, 6048, 74460, 42110, 73965, 10870, 8557,
+ 11054, 68664, 119049, 9681, 4475, 0, 41142, 2100, 0, 120731, 6035, 0,
+ 7651, 10296, 64443, 0, 0, 917987, 0, 118966, 74144, 40997, 0, 10392,
+ 10328, 40998, 43462, 74488, 0, 9800, 8979, 0, 119131, 41000, 0, 119239,
+ 6487, 3386, 0, 10344, 0, 65299, 5394, 43246, 78243, 10220, 66505, 41200,
+ 128583, 4425, 0, 0, 0, 43074, 73799, 0, 78147, 0, 12173, 78545, 0, 0,
+ 65338, 0, 0, 119582, 4474, 0, 43093, 0, 1587, 0, 127372, 64475, 128098,
+ 1369, 0, 9959, 7927, 0, 4560, 0, 0, 92277, 0, 64948, 4430, 74347, 42601,
+ 4514, 66434, 0, 8194, 65462, 10626, 10965, 0, 8893, 0, 12542, 0, 65341,
+ 0, 65829, 7925, 119822, 10475, 0, 0, 1352, 11069, 7707, 127560, 0, 65279,
+ 127102, 68207, 127100, 65605, 6040, 127097, 10071, 0, 9336, 128824, 0,
+ 8899, 7798, 64474, 64259, 0, 65188, 7820, 43018, 0, 0, 7746, 1492, 78551,
+ 10884, 77982, 0, 5127, 11285, 42501, 5495, 4273, 43095, 41426, 10849,
+ 5730, 2999, 6342, 68636, 74304, 371, 64373, 6023, 169, 5497, 11708, 0, 0,
+ 6323, 194684, 8224, 0, 8938, 6043, 12738, 0, 0, 5321, 0, 194798, 0, 2589,
+ 74332, 1689, 7802, 4683, 74318, 42704, 120296, 11905, 0, 0, 128516,
+ 128163, 74513, 6049, 0, 4027, 834, 118962, 1803, 0, 1503, 0, 0, 0, 5731,
+ 1381, 2387, 0, 0, 8289, 64525, 65817, 2881, 43142, 0, 9601, 2879, 9668,
+ 9766, 0, 5729, 917833, 74410, 6036, 64881, 4026, 9361, 127091, 2887, 0,
+ 3526, 6298, 0, 77897, 120095, 78519, 0, 8572, 6021, 77896, 128288, 77895,
+ 43155, 0, 119849, 3146, 10959, 9483, 0, 77893, 10981, 166, 917841, 8635,
+ 0, 10623, 408, 119058, 127507, 13298, 0, 7426, 41641, 12717, 0, 7607,
+ 10639, 66713, 0, 0, 41643, 74134, 0, 8713, 41640, 10221, 41645, 66712,
+ 6645, 646, 66726, 66711, 42129, 0, 77901, 3472, 8697, 0, 0, 0, 0, 0, 0,
+ 5809, 1950, 119356, 92432, 74572, 0, 42136, 0, 0, 0, 0, 3247, 119854,
+ 65017, 0, 68428, 66668, 0, 0, 10983, 0, 0, 0, 41567, 0, 0, 0, 194624, 0,
+ 0, 0, 8285, 0, 4509, 0, 66471, 12216, 0, 40988, 92592, 0, 41727, 0,
+ 42848, 2396, 917766, 0, 74018, 917538, 64940, 7027, 3886, 0, 42457,
+ 119008, 0, 996, 68123, 917571, 4249, 0, 917594, 11707, 8222, 0, 7939,
+ 92454, 92460, 127801, 917592, 128359, 8534, 127154, 40983, 0, 0, 0, 7201,
+ 12561, 0, 42371, 12558, 0, 917549, 10052, 40982, 0, 0, 1488, 0, 0, 0,
+ 917559, 0, 0, 1563, 128034, 9619, 0, 0, 0, 127872, 0, 5803, 7797, 6070,
+ 10006, 0, 2922, 6082, 0, 65009, 0, 12567, 128703, 0, 41412, 0, 0, 3607,
+ 9200, 10046, 9612, 42153, 8218, 9485, 0, 2032, 78354, 0, 0, 0, 0, 0,
+ 43085, 6057, 508, 128585, 128015, 120265, 0, 92405, 0, 0, 638, 6083,
+ 119072, 0, 0, 2305, 78348, 0, 0, 6056, 6659, 0, 0, 6085, 0, 0, 3915,
+ 41634, 0, 41639, 63912, 11941, 0, 4028, 1787, 42180, 43096, 92690, 3249,
+ 1768, 0, 12328, 501, 127074, 10601, 0, 583, 0, 41977, 0, 66004, 119350,
+ 6505, 74010, 0, 13064, 55267, 120810, 6500, 5526, 65049, 0, 73764, 0,
+ 92376, 12745, 9678, 0, 120587, 9869, 128815, 1771, 0, 8936, 0, 0, 4208,
+ 78341, 119115, 78342, 0, 0, 74101, 0, 11762, 0, 92422, 77997, 128788,
+ 66475, 0, 5027, 78172, 128878, 0, 5069, 73862, 5028, 9897, 0, 73739,
+ 5026, 0, 68639, 6331, 10079, 8931, 0, 1415, 8866, 41901, 74790, 78138,
+ 119361, 0, 43106, 5029, 65309, 1580, 3598, 68424, 41070, 77903, 0, 3440,
+ 78215, 1562, 128656, 127175, 119358, 1716, 0, 10600, 917867, 620, 41001,
+ 6028, 0, 42892, 0, 74822, 5024, 120829, 41003, 0, 5025, 128269, 0, 0,
+ 119328, 0, 65557, 0, 74541, 0, 11599, 128209, 11602, 6243, 11574, 11581,
+ 11597, 11598, 6253, 6105, 11584, 74195, 11569, 65275, 8906, 127096, 5755,
+ 2636, 0, 10815, 11619, 78717, 41540, 7815, 11616, 6979, 12080, 7721,
+ 11604, 7869, 1592, 0, 42152, 78498, 41048, 0, 829, 0, 92406, 19950, 0,
+ 128217, 6616, 0, 118875, 10953, 391, 0, 69785, 482, 42296, 11588, 0,
+ 43606, 0, 68397, 66370, 74506, 42335, 0, 0, 0, 7538, 5315, 120644, 42491,
+ 0, 42061, 128088, 4576, 0, 68417, 43809, 4277, 0, 4039, 64472, 42338,
+ 368, 42058, 3960, 11043, 11337, 78209, 917820, 63989, 3958, 12132, 1849,
+ 0, 9921, 42451, 4253, 41147, 42064, 11959, 42404, 41160, 0, 3618, 78338,
+ 0, 43300, 5156, 92629, 0, 929, 6827, 42035, 42437, 1555, 0, 8691, 66435,
+ 0, 41662, 0, 0, 0, 0, 0, 4578, 64513, 41664, 0, 42578, 128794, 41661,
+ 78715, 43267, 9356, 0, 0, 0, 1286, 10166, 0, 0, 64707, 0, 42476, 7730, 0,
+ 128522, 42483, 0, 0, 42324, 42291, 10020, 43359, 0, 6641, 525, 41627,
+ 917923, 8763, 128304, 41628, 533, 11931, 65225, 8321, 42504, 42581, 0,
+ 6915, 42310, 4377, 8559, 0, 120234, 0, 13193, 64350, 11666, 8679, 41924,
+ 1576, 7735, 92398, 0, 73840, 0, 11374, 78043, 10889, 43461, 7757, 42462,
+ 120226, 10029, 66493, 2718, 4168, 73842, 13308, 120112, 0, 1179, 4440, 0,
+ 77948, 363, 11015, 77947, 77944, 64296, 127090, 66692, 120826, 0, 66492,
+ 6593, 64625, 41963, 92177, 119329, 0, 10013, 64434, 92520, 127095, 9492,
+ 11782, 64382, 12833, 77830, 0, 1297, 41630, 630, 127094, 0, 120774,
+ 92465, 1043, 43652, 66223, 10090, 0, 128664, 313, 917563, 41881, 0,
+ 42311, 7445, 0, 5750, 10759, 9419, 55222, 9405, 11268, 42919, 9398, 8526,
+ 9399, 9422, 0, 66495, 0, 0, 127239, 41718, 10707, 1603, 0, 119003, 0,
+ 631, 77952, 69703, 13161, 65272, 0, 10546, 74210, 78101, 11600, 77961,
+ 2797, 73821, 42427, 306, 714, 3058, 42381, 77962, 127080, 12351, 42395,
+ 0, 11607, 0, 42282, 77971, 77967, 9157, 73765, 66364, 42433, 77964, 7603,
+ 12803, 180, 42141, 0, 120612, 66494, 12674, 8244, 362, 92439, 0, 8037,
+ 43777, 11535, 0, 74845, 5185, 7165, 5521, 10334, 2093, 77983, 10302,
+ 128112, 10104, 1027, 5181, 0, 0, 10523, 1446, 42320, 41646, 991, 5189,
+ 42472, 41647, 120105, 1722, 5581, 77979, 3405, 0, 194644, 5523, 0, 42620,
+ 92447, 0, 9549, 0, 10549, 55282, 9661, 43682, 0, 77910, 120026, 78708, 0,
+ 77911, 0, 41991, 0, 0, 7630, 9846, 7684, 10350, 0, 1174, 77981, 42733,
+ 77978, 77980, 66485, 77977, 42277, 77974, 42456, 65667, 127037, 12330,
+ 128272, 0, 42417, 42383, 0, 41344, 6293, 0, 66252, 77984, 74443, 0,
+ 10209, 8313, 4195, 74435, 1316, 66690, 120032, 6332, 64894, 0, 65871,
+ 78060, 1736, 0, 3901, 12228, 120151, 65200, 3383, 10446, 78841, 693,
+ 9130, 314, 64149, 42420, 11949, 0, 120152, 11026, 0, 5332, 6940, 64154,
+ 12635, 127007, 42706, 1751, 273, 8165, 13166, 120763, 78840, 0, 12824, 0,
+ 4528, 5320, 6301, 43662, 6133, 9339, 9463, 42346, 10922, 64560, 3757, 0,
+ 0, 0, 65869, 73760, 2569, 0, 2326, 65740, 2565, 42459, 7596, 7921, 0,
+ 74095, 127981, 41848, 2567, 66006, 0, 4044, 92646, 0, 12233, 0, 1023,
+ 474, 0, 119818, 0, 0, 42487, 65556, 0, 0, 42295, 0, 0, 0, 92518, 9835,
+ 66499, 0, 5417, 12275, 10895, 0, 274, 0, 1858, 0, 0, 55251, 10118, 3133,
+ 128008, 73795, 0, 9610, 8068, 8197, 0, 699, 0, 41665, 5868, 0, 92695,
+ 42182, 7581, 19940, 43668, 41667, 128057, 0, 1923, 65583, 65802, 0,
+ 64597, 43444, 119184, 92197, 0, 6464, 7036, 2996, 1937, 0, 0, 41835,
+ 4047, 41842, 0, 64107, 0, 0, 11017, 0, 0, 293, 77966, 92169, 64791,
+ 41827, 42466, 43422, 10579, 8560, 0, 65413, 77963, 4803, 12964, 1739,
+ 1941, 3900, 0, 1713, 77969, 0, 73957, 11407, 42441, 41971, 6297, 120098,
+ 64105, 128080, 42481, 11716, 66473, 7179, 42289, 0, 64103, 969, 0, 9352,
+ 0, 6165, 64100, 0, 6632, 73861, 42402, 74327, 7806, 0, 8914, 0, 0, 3183,
+ 1435, 64876, 2969, 6046, 64441, 6208, 67849, 5746, 73749, 0, 64416,
+ 42422, 0, 0, 7082, 73775, 338, 5059, 194719, 0, 42328, 10767, 0, 8115, 0,
+ 74758, 0, 8227, 2073, 1218, 0, 0, 65848, 0, 0, 0, 0, 126987, 4486, 0, 0,
+ 0, 10925, 0, 0, 0, 0, 42309, 10257, 65191, 10273, 0, 10305, 42461, 0,
+ 42349, 8832, 78051, 64127, 10644, 42662, 78828, 42278, 74451, 126988,
+ 917857, 7794, 0, 42429, 6377, 42316, 119026, 3669, 3968, 42468, 0, 69658,
+ 0, 65402, 119581, 0, 0, 64933, 0, 41960, 6699, 0, 0, 128354, 6823, 42391,
+ 1588, 65400, 8409, 78223, 19967, 65398, 787, 0, 917939, 127744, 6115,
+ 2078, 41654, 42480, 0, 92650, 41655, 65401, 43975, 0, 0, 0, 644, 65500,
+ 41657, 10778, 3659, 9533, 184, 1553, 13107, 65484, 69648, 10502, 74457,
+ 0, 0, 41554, 0, 8220, 917943, 41557, 0, 0, 11070, 119221, 5157, 4020,
+ 73858, 41555, 9514, 64818, 65103, 64641, 64303, 78131, 7520, 0, 74377,
+ 11029, 66651, 0, 0, 118930, 64527, 0, 7877, 73803, 0, 127348, 120096,
+ 74602, 9955, 119557, 4055, 42817, 0, 65212, 11715, 12190, 12319, 78630,
+ 0, 78631, 9502, 65427, 0, 65424, 12607, 0, 9734, 65425, 0, 0, 127357,
+ 78835, 92410, 10112, 10827, 0, 9866, 74527, 66675, 0, 8625, 64346, 11290,
+ 10477, 0, 8636, 0, 8315, 65444, 0, 0, 74595, 6152, 0, 0, 6629, 128251,
+ 120171, 0, 74589, 43993, 0, 69790, 64435, 0, 43690, 11046, 11490, 42730,
+ 4485, 127107, 0, 64926, 0, 0, 0, 5869, 12437, 42728, 0, 7040, 3588, 0,
+ 12825, 0, 0, 12725, 0, 0, 78642, 223, 0, 69675, 120166, 42444, 0, 64499,
+ 65245, 0, 1171, 0, 69717, 0, 1805, 8772, 43820, 0, 9930, 65247, 78619,
+ 120111, 2338, 0, 118853, 0, 42676, 0, 64800, 65236, 67644, 68126, 1213,
+ 0, 64075, 797, 64074, 8734, 4212, 0, 64387, 4115, 0, 5005, 64070, 64073,
+ 10679, 0, 77954, 9402, 64276, 426, 0, 0, 8251, 10136, 65436, 0, 2120,
+ 43302, 1224, 0, 65576, 120158, 10701, 1764, 3101, 127815, 12858, 120159,
+ 0, 11373, 6378, 127859, 120103, 8663, 9312, 41644, 4539, 2129, 0, 9222,
+ 0, 0, 4259, 9092, 74567, 41961, 0, 12724, 66357, 42331, 64935, 0, 0,
+ 1293, 7947, 2132, 0, 74593, 120308, 2454, 42717, 3613, 128837, 0, 0,
+ 65888, 8816, 10978, 10840, 0, 10668, 0, 43087, 12595, 120304, 0, 8822, 0,
+ 1157, 64903, 8638, 0, 0, 0, 0, 120319, 8235, 120316, 4405, 10086, 120247,
+ 0, 69216, 0, 65430, 74013, 6079, 6817, 10764, 127910, 64291, 128051, 998,
+ 120312, 11062, 1317, 64327, 1558, 0, 1991, 7882, 42254, 0, 41700, 530, 0,
+ 10428, 119335, 12002, 119336, 5742, 43076, 4692, 64630, 41823, 4007,
+ 5004, 119334, 7896, 751, 6595, 6596, 0, 66373, 0, 0, 64908, 92691, 6311,
+ 0, 12004, 119192, 12049, 43108, 120326, 0, 41705, 92188, 6598, 0, 6599,
+ 120334, 0, 42148, 118825, 66027, 0, 6597, 9412, 8340, 11824, 64745, 0, 0,
+ 0, 1988, 5407, 67865, 2430, 41678, 0, 120243, 2336, 0, 0, 78871, 120442,
+ 0, 1921, 10947, 19927, 0, 65406, 0, 19913, 4284, 13217, 0, 43789, 12841,
+ 9229, 10956, 42285, 41674, 19964, 41679, 65084, 3521, 0, 5774, 8325, 0,
+ 65403, 0, 1854, 10794, 0, 67660, 0, 0, 78359, 5280, 0, 4344, 12905,
+ 65433, 6076, 64793, 41610, 768, 12074, 442, 0, 68162, 64081, 12934,
+ 41682, 65432, 41693, 0, 6071, 65434, 127467, 4804, 4053, 0, 127469,
+ 194653, 41696, 467, 69823, 127463, 69797, 0, 0, 8421, 127472, 69682,
+ 43705, 502, 0, 65431, 119056, 0, 12043, 1303, 316, 92462, 2029, 2136,
+ 119246, 11533, 64365, 43480, 92639, 4860, 194645, 127877, 42488, 0, 9583,
+ 128849, 5546, 8019, 73856, 0, 0, 0, 5544, 2355, 12150, 65725, 5543,
+ 77989, 63751, 12137, 5548, 77985, 0, 65727, 68388, 65726, 6077, 128352,
+ 65452, 0, 11301, 78013, 78008, 78010, 9874, 78007, 0, 1319, 3050, 65410,
+ 0, 0, 78016, 78017, 42830, 43996, 66716, 128137, 4691, 92242, 9345, 621,
+ 92709, 128222, 0, 65411, 0, 41182, 73881, 65408, 73899, 78024, 9474,
+ 10545, 119118, 10887, 3786, 65409, 8894, 43179, 119611, 7923, 3716,
+ 92363, 9996, 8508, 0, 7012, 8195, 127834, 9566, 0, 3722, 0, 41707, 8493,
+ 545, 9575, 41379, 10050, 12718, 0, 8859, 6820, 74345, 65110, 120740, 0,
+ 0, 9119, 2787, 7920, 118823, 4021, 2012, 7985, 0, 119663, 0, 0, 78021,
+ 78022, 410, 78020, 1802, 78018, 74107, 0, 41659, 41671, 1827, 0, 64396,
+ 10126, 12116, 41673, 120370, 11422, 78141, 120373, 3860, 120367, 68412,
+ 41345, 120362, 120363, 11748, 42158, 7941, 11076, 8749, 120361, 2104,
+ 64858, 361, 120357, 845, 0, 41560, 11970, 4562, 917920, 2926, 917919,
+ 4569, 74130, 0, 43487, 194630, 611, 74129, 64871, 118891, 65629, 0,
+ 194858, 0, 0, 127545, 120543, 0, 0, 6291, 0, 78639, 41669, 7094, 917921,
+ 0, 0, 74054, 127754, 195029, 0, 839, 0, 7695, 8769, 65246, 4829, 0, 4859,
+ 64467, 0, 0, 118998, 7206, 0, 6647, 43986, 0, 69766, 0, 64764, 4210, 0,
+ 127936, 804, 0, 0, 12298, 0, 66653, 0, 64924, 10091, 73931, 9468, 74245,
+ 0, 0, 74246, 92503, 12839, 64669, 92202, 0, 1279, 1425, 6224, 119229,
+ 11049, 0, 92697, 43239, 8482, 92440, 0, 5032, 69677, 11940, 67888, 664,
+ 120437, 5034, 0, 0, 127525, 42702, 73888, 0, 13294, 67873, 64869, 6032,
+ 0, 9115, 7430, 120377, 0, 120819, 68387, 120168, 73913, 120170, 41161,
+ 5518, 4174, 10993, 41162, 120160, 64528, 1169, 434, 41437, 1905, 6034,
+ 41164, 64744, 9528, 118867, 128800, 524, 0, 74029, 788, 74027, 0, 194638,
+ 0, 1663, 10419, 74025, 42636, 0, 69725, 0, 120656, 0, 67876, 0, 0, 0,
+ 67897, 74039, 0, 0, 11395, 0, 119107, 43612, 64344, 0, 0, 10855, 5445,
+ 9355, 0, 65198, 7391, 8989, 221, 65686, 0, 0, 8010, 7191, 4962, 69772,
+ 8855, 0, 0, 64469, 120426, 10555, 0, 43333, 92299, 0, 120427, 10451, 0,
+ 67653, 7245, 12443, 74405, 9947, 120149, 78317, 3873, 8367, 0, 120146,
+ 43433, 43649, 11987, 0, 0, 11010, 12723, 74059, 74062, 6217, 5896, 0,
+ 7682, 74049, 1462, 10235, 0, 0, 0, 0, 0, 0, 42595, 0, 74402, 118860, 0,
+ 120419, 92497, 74052, 0, 0, 120549, 119082, 64295, 120418, 0, 64765,
+ 73923, 120417, 120662, 120730, 194702, 6216, 0, 10755, 9455, 0, 8124,
+ 127042, 9470, 6944, 127540, 0, 69680, 2828, 0, 531, 42638, 0, 0, 0,
+ 43428, 8204, 3614, 2827, 9696, 0, 0, 8728, 4354, 10904, 78562, 19936,
+ 7833, 120691, 0, 42599, 42597, 42709, 120409, 127044, 0, 8537, 0, 0, 0,
+ 0, 0, 41199, 10121, 2028, 0, 0, 69715, 0, 3062, 0, 74447, 12608, 0,
+ 66440, 7545, 9700, 12580, 0, 120777, 120502, 41155, 0, 74071, 0, 0,
+ 12713, 0, 0, 0, 78772, 0, 1734, 0, 0, 127040, 64594, 2456, 231, 0, 74167,
+ 542, 0, 118786, 0, 0, 1230, 0, 0, 3597, 4446, 10584, 74235, 92215, 4037,
+ 127938, 8352, 0, 5687, 0, 64515, 0, 194801, 55265, 67846, 78434, 9704, 0,
+ 0, 74284, 128285, 0, 8660, 0, 0, 0, 78773, 74482, 4483, 1709, 69721,
+ 9909, 6080, 0, 120358, 1746, 1315, 8667, 0, 0, 13140, 65899, 10604, 0,
+ 4480, 11266, 128152, 1226, 6930, 0, 0, 6360, 10897, 41230, 605, 0, 74785,
+ 120356, 0, 0, 41500, 0, 311, 11453, 6221, 10608, 64943, 74280, 10877,
+ 118868, 64885, 74272, 0, 0, 0, 120736, 74312, 345, 0, 74456, 64606, 9917,
+ 0, 92231, 5037, 0, 1776, 8422, 0, 118814, 41508, 41201, 323, 43328, 0,
+ 42698, 1295, 0, 4625, 0, 4630, 13117, 0, 128772, 65123, 11293, 2668,
+ 11288, 0, 42640, 65666, 2519, 92369, 65420, 92479, 0, 4252, 5049, 42659,
+ 119011, 706, 7754, 10854, 8738, 0, 65419, 0, 0, 649, 65421, 0, 66702, 0,
+ 12670, 1013, 0, 64919, 705, 0, 65422, 127803, 1183, 0, 7017, 42852, 0,
+ 8157, 9736, 64503, 65418, 0, 0, 74035, 0, 11913, 73874, 6696, 0, 8920, 0,
+ 0, 7962, 12211, 9837, 2051, 66227, 0, 4184, 0, 0, 10177, 73777, 1857, 0,
+ 4626, 8464, 8472, 0, 4629, 8499, 78321, 78322, 4624, 7818, 119173, 0, 0,
+ 7805, 0, 0, 6935, 92292, 78325, 78326, 78323, 43327, 43989, 119046, 8492,
+ 8250, 8459, 0, 8497, 8496, 0, 0, 78336, 78339, 9543, 78335, 78332, 77832,
+ 65849, 77831, 0, 0, 12451, 0, 8684, 0, 6102, 0, 5298, 0, 5294, 0, 0, 0,
+ 195062, 9949, 119826, 43617, 119215, 0, 12073, 0, 0, 77863, 13108,
+ 120617, 74397, 41468, 0, 0, 5292, 55272, 0, 1939, 5302, 3970, 917879,
+ 12455, 1793, 0, 0, 0, 6643, 92477, 65263, 0, 78330, 41293, 78328, 65923,
+ 0, 13219, 9569, 0, 74383, 0, 0, 0, 5500, 8813, 0, 0, 74566, 5322, 0,
+ 78340, 43631, 5324, 66443, 3784, 41614, 65269, 6230, 78349, 78345, 43324,
+ 3360, 78344, 11523, 0, 92488, 9926, 7197, 0, 68429, 42894, 41821, 1249,
+ 78360, 78361, 78356, 78358, 78353, 64899, 64763, 41149, 41807, 43162,
+ 41815, 41150, 0, 10571, 10096, 0, 0, 78074, 6947, 41152, 887, 9249, 6565,
+ 78510, 41990, 78509, 41811, 74466, 0, 6670, 77882, 0, 0, 43092, 43325, 0,
+ 10168, 0, 9781, 128655, 9190, 0, 9666, 8269, 65944, 74005, 13019, 11670,
+ 127383, 315, 12813, 0, 78432, 78256, 78351, 78352, 0, 0, 0, 0, 1378,
+ 9509, 0, 0, 74475, 3066, 92220, 67847, 0, 92355, 0, 78365, 8787, 120379,
+ 194616, 41618, 194615, 78261, 194614, 0, 64652, 0, 194612, 0, 78366,
+ 42088, 0, 195061, 7176, 128833, 10137, 6121, 10995, 78259, 74534, 8119,
+ 64874, 917816, 127199, 194939, 0, 74525, 0, 0, 12930, 1394, 74514, 0,
+ 74515, 0, 118804, 2998, 9527, 120659, 65190, 12977, 42090, 119165, 0,
+ 119100, 41236, 92235, 42005, 42003, 41237, 5848, 0, 0, 3670, 128657,
+ 194600, 0, 0, 7890, 0, 11298, 43315, 0, 6229, 1593, 0, 0, 619, 4635,
+ 65080, 0, 128002, 4120, 65337, 65336, 0, 11808, 119214, 74115, 9366,
+ 42790, 42006, 0, 65327, 65326, 65325, 10757, 1507, 42216, 65321, 65320,
+ 65335, 65334, 65333, 65332, 65331, 42059, 65329, 42689, 92427, 9128,
+ 118885, 42073, 6785, 64590, 0, 4371, 7196, 65318, 2035, 65316, 4106,
+ 65314, 65313, 42074, 127847, 41228, 0, 65609, 41241, 7903, 41239, 43533,
+ 78459, 7189, 0, 0, 0, 12357, 42802, 78450, 8487, 9131, 0, 4615, 12695,
+ 127752, 0, 12175, 0, 64535, 0, 7809, 0, 0, 562, 12169, 6590, 69762,
+ 66455, 64738, 3219, 68654, 0, 0, 1037, 0, 2025, 128263, 13098, 78442,
+ 10637, 4568, 549, 1570, 0, 2835, 0, 10624, 43623, 11072, 127191, 0, 0,
+ 12606, 78433, 2825, 0, 10825, 8079, 2821, 41046, 92327, 0, 0, 120593,
+ 13071, 0, 452, 41049, 42840, 6346, 2831, 5461, 74596, 11465, 5212, 0,
+ 64703, 119191, 42308, 7181, 0, 41332, 0, 12333, 0, 1668, 0, 0, 0, 1187,
+ 0, 42628, 78575, 0, 128777, 0, 3240, 128518, 12194, 0, 11591, 41065,
+ 5323, 8166, 0, 0, 0, 74535, 1623, 65297, 128856, 571, 0, 4918, 0, 5288,
+ 127295, 8916, 65048, 1909, 8864, 0, 0, 10736, 92508, 11571, 7615, 127300,
+ 92296, 4237, 92576, 1035, 65815, 0, 7881, 701, 65936, 3489, 0, 0, 120751,
+ 11403, 0, 0, 127146, 3796, 6800, 0, 3994, 11421, 0, 195076, 0, 0, 0, 0,
+ 64857, 128105, 2855, 127828, 66308, 41621, 68214, 127283, 127817, 10654,
+ 0, 119226, 12164, 3246, 7906, 43972, 65847, 7182, 0, 13024, 194822,
+ 74270, 128289, 0, 0, 0, 1496, 747, 0, 942, 2378, 43136, 127905, 8466, 0,
+ 9320, 8001, 1232, 8139, 11617, 0, 0, 11409, 68373, 6382, 0, 64634,
+ 128279, 0, 11612, 0, 67600, 2374, 0, 8475, 11609, 66313, 0, 0, 5286,
+ 119297, 0, 0, 64925, 120283, 194584, 118982, 194583, 7705, 11942, 11305,
+ 194581, 3309, 0, 0, 0, 0, 6802, 0, 41653, 1280, 1241, 7168, 12096, 0,
+ 66615, 42565, 41651, 0, 0, 0, 41650, 66507, 66470, 0, 12914, 41491,
+ 66010, 119552, 6078, 9954, 0, 1475, 0, 9938, 6084, 917546, 41064, 41062,
+ 0, 0, 3256, 128640, 42076, 43252, 78823, 917906, 8727, 0, 65875, 0, 0,
+ 127762, 10562, 74215, 43065, 0, 0, 3248, 74297, 3261, 9015, 0, 0, 3635,
+ 64337, 0, 0, 0, 7195, 0, 2007, 64431, 0, 0, 0, 0, 635, 0, 0, 65613,
+ 77909, 92420, 73997, 0, 0, 119218, 7984, 8600, 74434, 127770, 4176, 0,
+ 2034, 92551, 120805, 65891, 127038, 0, 318, 2038, 128860, 78596, 0, 3649,
+ 13149, 42145, 42798, 3634, 120291, 118927, 67677, 120124, 7866, 0, 11402,
+ 42146, 120134, 74238, 42664, 2849, 127034, 0, 7938, 12960, 1761, 11812,
+ 65379, 68386, 128185, 1159, 0, 69729, 0, 0, 7178, 194632, 0, 41680, 0,
+ 128203, 11534, 1514, 11668, 67891, 9313, 7015, 0, 67877, 0, 12989, 66474,
+ 9368, 12848, 1624, 43270, 0, 194563, 10818, 128207, 9953, 0, 78421, 1194,
+ 3242, 9761, 9555, 8598, 120299, 6169, 12871, 1551, 2798, 65176, 4958,
+ 42752, 119025, 0, 67875, 120301, 3495, 66648, 194768, 0, 68364, 0, 4891,
+ 0, 10641, 0, 73746, 0, 68352, 0, 73787, 0, 194633, 7199, 64955, 0, 0, 0,
+ 0, 0, 42685, 42679, 193, 0, 0, 0, 42667, 0, 5271, 92318, 92517, 118882,
+ 1362, 13297, 0, 128094, 0, 0, 73789, 0, 6658, 4426, 0, 92628, 0, 92319,
+ 7276, 42163, 5220, 0, 0, 0, 2416, 3310, 42703, 0, 379, 0, 127977, 0, 0,
+ 3223, 65492, 1284, 194771, 4549, 0, 0, 0, 127763, 10807, 9558, 194613, 0,
+ 8515, 8688, 12866, 0, 3294, 0, 8529, 128101, 43385, 7564, 0, 43329, 0,
+ 92458, 73757, 66456, 42359, 0, 2031, 0, 7202, 0, 12676, 42729, 92198,
+ 3215, 0, 7710, 1610, 73801, 0, 0, 65682, 0, 120537, 65924, 9974, 228,
+ 66354, 1501, 0, 64395, 5179, 7200, 6225, 0, 65794, 1725, 65533, 8196,
+ 7476, 74399, 0, 0, 7152, 8502, 5762, 1967, 7483, 0, 0, 8104, 0, 7474,
+ 92571, 0, 0, 10414, 13001, 8141, 0, 42537, 1557, 43594, 128642, 6330,
+ 6805, 8631, 2545, 120672, 127166, 0, 74190, 0, 0, 0, 42762, 0, 42914,
+ 1650, 262, 1637, 0, 7901, 3238, 128173, 41861, 0, 0, 65158, 10860, 0,
+ 43658, 7527, 0, 43319, 6419, 0, 45, 0, 64588, 0, 0, 119810, 7194, 5291,
+ 0, 43666, 13129, 0, 9084, 0, 8737, 0, 12881, 0, 12906, 9639, 7912, 2620,
+ 0, 0, 0, 0, 179, 65896, 0, 64756, 2853, 78443, 118813, 0, 118996, 119009,
+ 2850, 8084, 0, 73850, 2801, 92284, 42069, 119839, 74754, 119841, 42072,
+ 119843, 119842, 10398, 0, 0, 8377, 127116, 8245, 68401, 3158, 92396,
+ 3983, 43656, 923, 119857, 119856, 292, 13002, 119845, 119844, 3221, 1763,
+ 92463, 4612, 119851, 119850, 7253, 127110, 68391, 0, 10782, 3637, 12996,
+ 43542, 0, 64578, 0, 3228, 69636, 8783, 0, 119614, 2731, 0, 0, 78585,
+ 4102, 7696, 73878, 0, 0, 78586, 43316, 4177, 11283, 9089, 0, 73996, 0,
+ 64500, 43674, 0, 64947, 1856, 0, 0, 6379, 0, 0, 0, 3208, 12975, 74775, 0,
+ 0, 92389, 74072, 55269, 0, 0, 0, 2033, 78577, 78576, 195026, 55254, 7740,
+ 0, 0, 0, 73964, 0, 0, 67612, 65674, 0, 0, 41689, 0, 74006, 64909, 6646,
+ 11790, 74019, 0, 128066, 128031, 8561, 4573, 0, 5326, 0, 120605, 7230,
+ 8257, 0, 8778, 41688, 0, 65776, 2071, 8314, 6459, 0, 7628, 65092, 73903,
+ 66721, 11342, 128561, 0, 0, 128226, 127001, 0, 11810, 13164, 10723, 967,
+ 0, 0, 11946, 0, 3257, 0, 12307, 1845, 0, 43526, 0, 0, 1886, 42342, 10089,
+ 870, 7648, 3499, 8609, 7652, 876, 871, 877, 0, 878, 42015, 879, 43692,
+ 4563, 0, 0, 7591, 65887, 867, 9520, 872, 0, 868, 873, 7642, 0, 869, 874,
+ 7644, 0, 875, 790, 128303, 0, 0, 0, 66182, 0, 5429, 0, 66180, 0, 66181,
+ 68452, 0, 0, 42067, 0, 5433, 10657, 7911, 194622, 1547, 66176, 42012,
+ 120576, 5425, 4977, 9999, 5317, 5423, 4611, 0, 67637, 0, 9679, 74122, 0,
+ 0, 0, 66194, 4418, 66184, 4628, 4245, 119648, 0, 0, 1851, 0, 127189,
+ 11908, 0, 9360, 118897, 0, 42776, 66187, 12837, 8829, 7711, 92714, 0,
+ 92321, 43318, 0, 8809, 119974, 0, 0, 120604, 0, 0, 0, 0, 0, 0, 7427,
+ 9958, 4588, 43680, 0, 74484, 0, 2433, 0, 119622, 3352, 74363, 0, 0, 793,
+ 74404, 0, 305, 567, 67662, 842, 128519, 8208, 0, 41695, 1647, 118877, 0,
7837, 917625, 818, 5337, 917622, 917621, 41376, 119978, 917618, 120594,
- 74086, 917615, 917614, 917613, 10973, 66359, 1372, 917609, 917608, 4969,
- 1254, 917605, 917604, 917603, 917602, 65228, 0, 0, 0, 2840, 0, 119982, 0,
- 0, 3245, 9068, 119069, 64725, 0, 0, 12991, 0, 2651, 0, 0, 917611, 0, 0,
- 0, 0, 0, 0, 0, 43322, 0, 0, 0, 64372, 0, 3226, 655, 752, 7457, 7456,
- 7452, 3285, 0, 0, 119988, 65610, 0, 0, 0, 671, 250, 7434, 618, 668, 610,
- 42800, 7431, 1152, 42801, 640, 120666, 7448, 7439, 628, 3905, 73810, 0,
- 0, 64749, 67850, 0, 0, 0, 0, 194873, 0, 0, 65945, 0, 0, 119590, 0, 0, 0,
- 987, 6927, 11572, 42261, 11464, 3365, 0, 0, 0, 0, 0, 0, 0, 0, 11334,
- 43326, 12609, 11519, 0, 5530, 5210, 0, 4627, 0, 5208, 0, 0, 10332, 5218,
- 7976, 9156, 0, 3244, 5529, 0, 73894, 0, 5432, 64965, 5527, 74033, 10516,
- 7790, 5528, 0, 42140, 120281, 0, 0, 43545, 120282, 0, 4000, 7429, 7428,
- 665, 7424, 3206, 120279, 7884, 0, 0, 0, 0, 211, 2509, 0, 120573, 0, 3220,
- 0, 0, 10690, 8951, 5214, 42474, 8118, 0, 7048, 4590, 0, 5852, 0, 0, 0,
- 1708, 0, 0, 2623, 0, 0, 0, 0, 4698, 66509, 1066, 0, 4701, 0, 120285,
- 74225, 119114, 8267, 0, 0, 0, 7516, 0, 2625, 0, 8034, 74309, 0, 3631,
- 10955, 7850, 120293, 8416, 0, 0, 0, 0, 12660, 0, 0, 0, 74850, 41069, 0,
- 0, 12099, 4310, 10032, 6252, 713, 7990, 0, 3990, 0, 0, 66368, 5017,
- 64956, 7071, 0, 0, 1030, 118800, 0, 9513, 41059, 9357, 0, 1773, 0,
- 120350, 0, 0, 7745, 9844, 0, 64650, 94, 1880, 74766, 0, 8908, 0, 0,
- 65913, 0, 10752, 13003, 0, 0, 41307, 8732, 120338, 0, 1757, 6964, 4696,
- 0, 0, 120806, 10029, 3641, 5419, 0, 0, 0, 0, 120344, 0, 0, 8610, 65230,
- 7592, 856, 74299, 936, 13289, 0, 43171, 1459, 0, 65243, 0, 19953, 0,
- 1504, 0, 0, 0, 74206, 7529, 0, 0, 0, 120782, 4113, 0, 2372, 336, 0, 7509,
+ 74086, 917615, 917614, 917613, 10973, 66359, 1372, 127172, 917608, 4969,
+ 1254, 917605, 917604, 917603, 917602, 65228, 78221, 0, 0, 2840, 0,
+ 119982, 0, 0, 3245, 9068, 68194, 64725, 0, 0, 12991, 0, 2651, 128528, 0,
+ 917611, 127026, 128883, 0, 0, 43648, 120812, 0, 43322, 92662, 0, 0,
+ 64372, 92698, 3226, 655, 752, 7457, 7456, 7452, 3285, 128779, 127821,
+ 119988, 65610, 2391, 0, 92248, 671, 250, 7434, 618, 668, 610, 42800,
+ 7431, 1152, 42801, 640, 120666, 7448, 7439, 628, 3905, 73810, 0, 128266,
+ 64749, 67850, 2107, 0, 0, 4605, 128174, 0, 43372, 65945, 128838, 0,
+ 119590, 0, 0, 0, 987, 6927, 11572, 42261, 11464, 3365, 9971, 0, 0,
+ 128297, 0, 0, 0, 0, 11334, 43326, 12609, 11519, 11503, 5530, 5210, 0,
+ 4627, 0, 5208, 0, 128842, 10332, 5218, 7976, 9156, 0, 3244, 5529, 69647,
+ 73894, 128852, 5432, 64965, 5527, 74033, 10516, 7790, 5528, 0, 42140,
+ 120281, 0, 0, 43545, 9887, 0, 4000, 7429, 7428, 665, 7424, 3206, 120278,
+ 7884, 0, 128566, 917989, 128666, 211, 2509, 0, 120573, 68672, 3220,
+ 42235, 0, 10690, 8951, 5214, 42474, 8118, 0, 7048, 4590, 127258, 5852, 0,
+ 0, 127259, 1708, 0, 0, 2623, 11943, 0, 69226, 0, 4698, 66509, 1066,
+ 119921, 4701, 0, 120285, 74225, 119114, 8267, 0, 127265, 0, 7516, 0,
+ 2625, 0, 8034, 74309, 0, 3631, 10955, 7850, 120293, 8416, 0, 0, 0, 43384,
+ 12660, 0, 0, 0, 74850, 41069, 0, 128156, 12099, 4310, 10032, 6252, 713,
+ 7990, 0, 3990, 0, 0, 66368, 5017, 64956, 7071, 0, 119144, 1030, 118800,
+ 0, 9513, 41059, 9357, 0, 1773, 0, 120350, 0, 6339, 7745, 9844, 0, 64650,
+ 94, 1880, 74766, 0, 8908, 0, 128707, 65913, 78470, 10752, 13003, 0, 0,
+ 41307, 8732, 120338, 0, 1757, 6964, 4696, 0, 0, 64785, 7394, 3641, 5419,
+ 128055, 0, 127883, 0, 120344, 43988, 0, 8610, 43062, 7592, 856, 74299,
+ 936, 13289, 127521, 43171, 1459, 0, 65243, 78638, 19953, 0, 1504, 119108,
+ 0, 12913, 74206, 7529, 0, 0, 0, 120782, 4113, 0, 2372, 336, 0, 7509,
12152, 0, 682, 66458, 41505, 0, 64743, 10593, 1703, 0, 0, 8033, 0, 0,
- 9810, 0, 0, 12970, 0, 42351, 10109, 0, 0, 0, 0, 119247, 0, 0, 74291,
- 1965, 7069, 43312, 0, 73887, 0, 0, 64370, 6314, 41714, 8501, 0, 0, 74239,
- 41317, 0, 5417, 0, 0, 0, 9353, 0, 41315, 917616, 0, 0, 6569, 0, 0, 0,
- 119236, 634, 0, 0, 0, 917610, 4165, 8746, 0, 9654, 12856, 6924, 0, 7066,
- 0, 0, 0, 41037, 0, 7786, 917607, 41039, 0, 0, 680, 6274, 0, 1181, 7056,
- 3174, 0, 0, 0, 65665, 0, 0, 6920, 0, 0, 0, 0, 0, 64644, 126981, 0, 0,
- 41028, 0, 6231, 2613, 65302, 40989, 0, 0, 0, 42760, 0, 0, 0, 40987, 4667,
- 0, 0, 8828, 0, 0, 1246, 4746, 0, 0, 11021, 4749, 0, 0, 921, 4744, 0,
- 12702, 242, 0, 1566, 8217, 0, 64653, 0, 0, 74036, 74505, 43274, 5313,
- 951, 0, 0, 0, 7604, 0, 4009, 0, 0, 120562, 0, 0, 64860, 119138, 119902,
- 0, 0, 4048, 0, 0, 120596, 1646, 0, 64534, 73995, 0, 0, 119890, 2579,
- 119905, 3177, 11357, 9099, 4107, 3441, 119894, 2975, 74442, 9822, 0, 0,
- 10084, 73943, 0, 0, 917562, 0, 3399, 9851, 0, 11909, 9059, 0, 7687, 0,
- 8854, 0, 0, 0, 0, 0, 0, 1777, 9151, 1137, 0, 749, 42366, 0, 5385, 0, 0,
- 0, 0, 5989, 0, 0, 0, 0, 41685, 0, 0, 9769, 41684, 0, 519, 0, 11740, 5766,
- 0, 0, 2600, 8848, 120138, 41297, 0, 3666, 74473, 41300, 74468, 65160, 0,
- 74542, 0, 74479, 0, 6558, 0, 0, 0, 120750, 252, 0, 41302, 0, 0, 0, 0, 0,
- 11729, 8719, 9060, 0, 120139, 10761, 0, 0, 0, 118792, 11734, 0, 11730, 0,
- 9593, 119188, 2403, 64808, 0, 0, 11728, 65894, 0, 0, 7764, 0, 0, 120825,
- 0, 0, 4282, 8298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8456, 0, 74783, 65670, 0, 0,
- 0, 7774, 10607, 9792, 0, 0, 0, 0, 120764, 0, 10019, 74762, 0, 3458, 4365,
- 0, 0, 3647, 0, 2602, 0, 0, 194707, 41135, 0, 0, 0, 64631, 172, 4971,
- 41219, 41137, 1889, 7238, 6545, 0, 0, 7597, 10528, 0, 0, 3732, 73910, 0,
- 5344, 0, 0, 0, 9062, 119252, 0, 0, 0, 64479, 9232, 0, 0, 0, 0, 10900,
- 41531, 1263, 3720, 12048, 0, 64292, 41524, 7227, 119635, 6099, 41534, 0,
- 0, 0, 299, 0, 8525, 0, 3524, 0, 8831, 0, 0, 3075, 0, 0, 0, 66362, 0,
- 74758, 0, 0, 5845, 0, 0, 0, 2581, 8200, 65114, 74393, 0, 43283, 5551, 0,
- 127085, 0, 0, 118855, 0, 0, 8680, 7204, 0, 2588, 2914, 7011, 0, 0, 2471,
- 0, 2883, 2749, 119563, 73774, 10913, 0, 0, 8666, 675, 42493, 0, 0, 0,
- 6219, 0, 0, 41232, 10928, 0, 41153, 41229, 118967, 0, 3738, 0, 0, 12711,
- 3181, 66212, 74289, 0, 42857, 8262, 0, 0, 0, 0, 42347, 12092, 9615, 7234,
- 74047, 0, 0, 64674, 0, 0, 73846, 0, 12722, 0, 922, 74426, 74507, 0, 0,
- 3218, 120471, 74290, 120469, 64562, 120475, 8569, 11404, 11932, 73728,
- 3214, 120461, 120468, 12128, 3207, 65486, 0, 1901, 0, 0, 120460, 7425,
- 3205, 0, 0, 0, 0, 0, 0, 65459, 2606, 0, 73897, 0, 11496, 1173, 0, 41272,
- 0, 0, 0, 0, 120737, 0, 0, 0, 378, 2610, 0, 65079, 0, 65695, 0, 37, 7068,
- 0, 120480, 120479, 3209, 120477, 0, 10638, 9768, 120481, 0, 0, 0, 0, 0,
- 0, 65510, 0, 0, 5233, 0, 64792, 0, 0, 0, 0, 7060, 9847, 0, 1685, 595, 0,
- 73971, 1292, 8940, 0, 11088, 0, 10004, 126997, 0, 6541, 0, 0, 0, 3243,
- 9014, 5606, 0, 538, 64620, 5602, 8467, 74391, 6547, 0, 8203, 0, 0, 8458,
- 65211, 8495, 0, 0, 917552, 779, 0, 64367, 2465, 0, 8193, 0, 9730, 9280,
- 0, 7065, 74155, 4346, 0, 73798, 504, 0, 120715, 8982, 0, 0, 0, 782, 0,
- 10883, 0, 917876, 732, 3737, 0, 1548, 0, 0, 1832, 5604, 5735, 41141, 0,
- 4376, 0, 41142, 3745, 0, 0, 42888, 65712, 0, 3869, 11937, 5725, 0, 1783,
- 0, 5728, 0, 0, 0, 11918, 66567, 5724, 0, 5727, 0, 0, 0, 764, 0, 0, 43531,
- 0, 9033, 0, 42532, 6223, 11042, 0, 11423, 0, 0, 0, 0, 0, 0, 6559, 64557,
- 0, 0, 120648, 43019, 0, 10238, 0, 0, 0, 120675, 0, 1478, 9783, 0, 2607,
- 64740, 0, 7739, 74543, 0, 0, 0, 6132, 0, 63765, 0, 0, 41144, 0, 0, 43537,
- 0, 10093, 4369, 917791, 0, 0, 8820, 3947, 0, 0, 11515, 526, 0, 41295,
- 194603, 917785, 0, 0, 7688, 917786, 7686, 8288, 11815, 0, 0, 0, 1543,
- 3713, 41221, 12423, 42281, 917788, 74024, 12293, 0, 64357, 11794, 42082,
- 0, 1737, 8987, 42081, 0, 7205, 0, 9335, 12850, 119870, 6553, 7055, 0,
- 8277, 0, 0, 5475, 74795, 7052, 0, 0, 12990, 1160, 42084, 119650, 41217,
- 119660, 10018, 360, 0, 0, 68176, 5863, 3137, 0, 4147, 0, 41216, 7844,
- 2616, 119190, 0, 65234, 0, 13076, 3135, 0, 0, 119139, 3142, 194948, 0,
- 10819, 119580, 10183, 0, 2608, 1470, 73967, 0, 6227, 0, 0, 74775, 0,
- 6163, 0, 0, 0, 0, 0, 8603, 0, 119866, 3306, 10876, 0, 119573, 0, 5834, 0,
- 6222, 0, 0, 12086, 0, 1600, 64309, 64939, 0, 64783, 0, 11310, 0, 8882, 0,
- 0, 2570, 7021, 0, 0, 43110, 0, 1234, 6540, 6974, 0, 0, 0, 5002, 0, 41286,
- 0, 127019, 0, 43585, 0, 6551, 0, 0, 0, 41289, 0, 0, 0, 8977, 602, 120814,
- 0, 0, 0, 0, 0, 41279, 0, 0, 0, 0, 43615, 0, 0, 0, 0, 12727, 0, 0, 0,
- 9475, 0, 65105, 0, 9633, 10886, 43592, 7831, 0, 0, 0, 73915, 8076, 43048,
- 8290, 8291, 43051, 0, 0, 2596, 43584, 0, 13113, 0, 0, 2393, 7058, 9087,
- 74067, 0, 41574, 0, 0, 74058, 42035, 0, 0, 0, 0, 9854, 0, 64696, 0, 0, 0,
- 74165, 0, 1720, 0, 0, 0, 6529, 7063, 0, 3751, 9120, 0, 0, 1798, 709, 0,
- 1354, 1876, 13152, 6557, 12430, 8137, 0, 0, 0, 0, 245, 0, 11456, 41233,
- 7070, 0, 0, 6136, 0, 65677, 8682, 41235, 0, 42045, 9804, 0, 432, 3595, 0,
- 65437, 0, 74455, 42399, 0, 0, 0, 0, 119658, 0, 0, 0, 0, 8797, 0, 9052,
- 64888, 0, 2356, 95, 74784, 10580, 0, 42286, 0, 64640, 0, 119104, 0, 0, 0,
- 10063, 12652, 12199, 127030, 0, 2566, 11971, 0, 0, 1065, 0, 0, 0, 2576,
- 0, 0, 0, 43604, 0, 0, 74082, 514, 74502, 0, 2921, 43215, 64493, 5772,
- 12968, 0, 0, 74580, 917565, 2580, 0, 41341, 41223, 6564, 1463, 41342, 0,
- 5293, 0, 0, 3733, 11346, 0, 12054, 0, 74098, 42827, 0, 13091, 0, 0, 0,
- 917915, 0, 127026, 0, 74821, 0, 0, 119042, 0, 0, 13090, 66643, 0, 1270,
- 1132, 42360, 0, 74096, 66655, 42569, 0, 0, 64761, 0, 41021, 8510, 42432,
- 0, 0, 0, 0, 64496, 74109, 0, 9915, 0, 0, 7061, 41336, 3854, 0, 13141,
- 917564, 0, 42319, 13082, 0, 7067, 0, 0, 0, 0, 0, 0, 0, 9029, 43543, 0,
- 2353, 6308, 0, 74792, 2611, 119186, 0, 0, 0, 0, 0, 66627, 0, 4484, 8509,
- 118976, 0, 65233, 0, 41224, 41017, 0, 3747, 10522, 0, 0, 1691, 41226, 0,
- 12107, 0, 10905, 65010, 0, 697, 66018, 9284, 4244, 0, 0, 0, 13121, 0, 0,
- 12010, 0, 0, 0, 0, 0, 0, 65816, 68111, 0, 0, 65668, 0, 0, 118784, 66365,
- 0, 0, 12648, 0, 0, 0, 5785, 41309, 9764, 41316, 65877, 0, 13230, 41299,
- 0, 0, 0, 0, 0, 0, 0, 13122, 0, 191, 74119, 0, 8000, 64411, 120652, 42889,
+ 9810, 127269, 0, 12970, 0, 42351, 10109, 0, 0, 194693, 0, 119247, 0, 0,
+ 74291, 1965, 7069, 43312, 0, 73887, 0, 2087, 64370, 6314, 41714, 8501, 0,
+ 0, 74239, 41317, 92614, 2091, 74545, 2090, 0, 9353, 7117, 2077, 77886, 0,
+ 10498, 2083, 77888, 0, 0, 119236, 634, 0, 0, 0, 69779, 4165, 8746, 0,
+ 9654, 12856, 6924, 0, 7066, 0, 0, 128135, 41037, 42692, 7786, 12959,
+ 41039, 0, 0, 680, 6274, 128200, 1181, 7056, 3174, 0, 0, 92668, 65665,
+ 127375, 0, 6920, 0, 92295, 0, 118965, 0, 64644, 126981, 0, 0, 41028, 0,
+ 6231, 2613, 65302, 40989, 0, 194696, 0, 42760, 0, 0, 0, 40987, 4667, 0,
+ 0, 8828, 0, 0, 1246, 4746, 0, 0, 11021, 4749, 92675, 0, 921, 4744, 0,
+ 12702, 242, 0, 1566, 8217, 0, 64653, 78386, 128121, 74036, 74505, 43274,
+ 5313, 951, 0, 0, 0, 7604, 0, 4009, 127816, 0, 120562, 0, 0, 64860,
+ 119138, 119069, 0, 127370, 4048, 0, 0, 120596, 1646, 77890, 64534, 73995,
+ 120705, 0, 119890, 2579, 119905, 3177, 11357, 9099, 4107, 3441, 119894,
+ 2975, 74442, 9822, 0, 55220, 10084, 73943, 118840, 0, 917562, 0, 3399,
+ 9851, 0, 11909, 9059, 0, 7687, 0, 6789, 0, 0, 0, 0, 0, 0, 1777, 9151,
+ 1137, 69767, 749, 42366, 0, 5385, 128574, 128218, 0, 0, 5989, 0, 0,
+ 128091, 0, 41685, 69223, 0, 9769, 41684, 0, 519, 0, 11740, 5766, 0, 0,
+ 2600, 8848, 120138, 41297, 0, 3666, 74473, 41300, 74468, 65160, 0, 69688,
+ 69771, 74479, 0, 6558, 0, 0, 69765, 120750, 252, 0, 41302, 0, 0, 0,
+ 69763, 0, 11729, 8719, 9060, 0, 120139, 10761, 0, 0, 0, 118792, 11734, 0,
+ 11730, 0, 9593, 5757, 2403, 64808, 55275, 0, 11728, 43572, 0, 0, 7764, 0,
+ 11094, 120825, 0, 0, 4282, 8298, 0, 0, 0, 0, 0, 64449, 0, 127509, 63854,
+ 8456, 0, 74783, 65670, 0, 78250, 0, 7774, 10607, 9792, 0, 0, 0, 0,
+ 120764, 0, 10019, 74762, 0, 3458, 4365, 0, 0, 3647, 0, 2602, 128341, 0,
+ 194707, 41135, 0, 0, 0, 64631, 172, 4971, 41219, 41137, 1889, 7238, 6545,
+ 0, 92193, 7597, 10528, 0, 0, 3732, 73910, 194588, 5344, 0, 43366, 43363,
+ 9062, 119252, 0, 0, 0, 64479, 9232, 92596, 0, 0, 194712, 10900, 41531,
+ 1263, 3720, 12048, 0, 64292, 41524, 7227, 119635, 6099, 41534, 0, 127354,
+ 127345, 299, 0, 8525, 127347, 3524, 917565, 8831, 127349, 92564, 3075,
+ 67867, 127352, 0, 66362, 0, 64353, 0, 0, 5845, 0, 0, 0, 2581, 8200,
+ 65114, 68460, 0, 43283, 5551, 0, 120735, 0, 6340, 118855, 0, 78134, 8680,
+ 7204, 0, 2588, 2914, 7011, 55281, 0, 2471, 194631, 2883, 2749, 119563,
+ 73774, 10913, 0, 0, 8666, 675, 42493, 0, 43571, 0, 6219, 0, 9980, 41232,
+ 10928, 0, 41153, 41229, 118967, 0, 3738, 127369, 0, 12711, 3181, 66212,
+ 74289, 68472, 42857, 8262, 0, 0, 0, 0, 42347, 12092, 9615, 7234, 74047,
+ 0, 0, 64674, 0, 0, 73846, 2934, 12722, 120762, 922, 43983, 74507, 0,
+ 74461, 3218, 120471, 74290, 120469, 64562, 120475, 8569, 11404, 11932,
+ 73728, 3214, 120461, 120468, 12128, 3207, 65486, 78729, 1901, 78727,
+ 127326, 120460, 7425, 3205, 0, 78737, 78736, 78735, 43383, 78733, 65459,
+ 2606, 78730, 73897, 0, 11496, 1173, 0, 41272, 119661, 0, 0, 0, 120737, 0,
+ 0, 0, 378, 2610, 0, 65079, 0, 65695, 0, 37, 7068, 0, 120480, 120479,
+ 3209, 120477, 0, 10638, 9768, 120481, 0, 0, 0, 0, 0, 0, 65510, 0, 0,
+ 5233, 0, 64792, 0, 0, 0, 0, 7060, 9847, 120144, 1685, 595, 0, 73971,
+ 1292, 8940, 7380, 11088, 0, 10004, 126997, 0, 6541, 0, 0, 0, 3243, 9014,
+ 5606, 0, 538, 64620, 5602, 8467, 74391, 6547, 0, 8203, 78488, 0, 8458,
+ 65211, 8495, 119904, 0, 917552, 779, 78314, 64367, 2465, 0, 8193, 55279,
+ 9730, 9280, 0, 7065, 74155, 4346, 0, 73798, 504, 0, 92414, 8982, 0, 0, 0,
+ 782, 0, 10883, 0, 194852, 732, 3737, 127253, 1548, 68650, 0, 1832, 5604,
+ 5735, 41141, 119020, 4376, 0, 11787, 3745, 0, 0, 42888, 65712, 0, 3869,
+ 11937, 5725, 127539, 1783, 68648, 5728, 0, 0, 0, 11918, 66567, 5724, 0,
+ 5727, 78521, 0, 0, 764, 0, 128116, 43531, 0, 9033, 0, 42532, 6223, 11042,
+ 120749, 11423, 0, 119861, 0, 43465, 0, 128267, 6559, 64557, 0, 0, 120648,
+ 43019, 43477, 10238, 0, 0, 43377, 92282, 0, 1478, 9783, 11825, 2607,
+ 64740, 0, 7739, 74543, 0, 0, 0, 6132, 0, 63765, 0, 0, 41144, 0, 92438,
+ 43537, 6761, 10093, 4369, 917791, 0, 0, 8820, 3947, 0, 0, 11515, 526, 0,
+ 41295, 194603, 917785, 194932, 0, 7688, 917786, 7686, 8288, 11815, 0, 0,
+ 0, 1543, 3713, 41221, 12423, 42281, 917788, 74024, 12293, 0, 64357,
+ 11794, 42082, 0, 1737, 8987, 42081, 0, 7205, 0, 9335, 12850, 119870,
+ 6553, 7055, 0, 8277, 0, 0, 5475, 74795, 6780, 0, 0, 12990, 1160, 42084,
+ 119650, 41217, 119660, 10018, 360, 0, 0, 68176, 5863, 3137, 0, 4147, 0,
+ 41216, 7844, 2616, 119190, 68461, 65234, 0, 13076, 3135, 0, 78143,
+ 119139, 3142, 92451, 0, 10819, 119580, 10183, 0, 2608, 1470, 73967, 0,
+ 6227, 0, 0, 69741, 0, 6163, 0, 0, 127314, 0, 0, 8603, 0, 119866, 3306,
+ 10876, 43392, 119573, 127931, 5751, 0, 6222, 0, 0, 12086, 7403, 1600,
+ 64309, 64939, 0, 64783, 92658, 11310, 0, 8882, 0, 0, 2570, 7021, 0, 0,
+ 43110, 0, 1234, 6540, 6974, 0, 0, 0, 5002, 0, 41286, 0, 127019, 0, 43585,
+ 0, 6551, 0, 128229, 0, 41289, 0, 194602, 0, 8977, 602, 120814, 0, 128778,
+ 128661, 0, 0, 41279, 0, 0, 0, 11081, 43615, 0, 0, 0, 0, 12727, 0, 0,
+ 78397, 9475, 7112, 65105, 0, 9633, 10886, 43592, 7831, 0, 194571, 0,
+ 73915, 8076, 43048, 8290, 8291, 43051, 92570, 0, 2596, 43584, 0, 13113,
+ 0, 127757, 2393, 7058, 9087, 74067, 68673, 41574, 78337, 0, 74058, 6376,
+ 0, 0, 0, 0, 9854, 127748, 64696, 0, 128220, 0, 6994, 0, 1720, 0, 0, 0,
+ 6529, 7063, 0, 3751, 9120, 0, 0, 1798, 709, 0, 1354, 1876, 13152, 6557,
+ 12430, 8137, 0, 92642, 0, 0, 245, 128097, 11456, 41233, 7070, 0, 0, 6136,
+ 917609, 65677, 8682, 41235, 92595, 42045, 9804, 0, 432, 3595, 0, 65437,
+ 0, 74455, 42399, 0, 0, 128274, 0, 119658, 0, 0, 0, 77894, 8797, 0, 9052,
+ 64888, 7167, 2356, 95, 74784, 10580, 0, 42286, 0, 64640, 0, 119104, 0,
+ 74137, 0, 10063, 12652, 12199, 92480, 0, 2566, 11971, 0, 0, 1065, 0, 0,
+ 43400, 2576, 66696, 0, 0, 43604, 0, 0, 74082, 514, 74502, 0, 2921, 43215,
+ 64493, 5772, 12968, 0, 194944, 74580, 43398, 2580, 0, 41341, 41223, 6564,
+ 1463, 41342, 0, 5293, 0, 0, 3733, 11346, 0, 12054, 0, 74098, 42827, 0,
+ 13091, 0, 0, 0, 917915, 0, 127025, 0, 74821, 0, 0, 119042, 0, 127865,
+ 13090, 66643, 0, 1270, 1132, 42360, 0, 74096, 66655, 42569, 127824, 0,
+ 64761, 0, 41021, 8510, 42432, 0, 0, 0, 0, 64496, 74109, 0, 9915, 0, 0,
+ 7061, 41336, 3854, 69700, 13141, 68413, 43401, 42319, 13082, 0, 7067,
+ 68221, 0, 0, 127171, 0, 0, 127797, 9029, 43543, 119315, 2353, 6308, 0,
+ 74792, 2611, 119186, 0, 0, 0, 43664, 92399, 66627, 0, 4484, 8509, 118976,
+ 78116, 65233, 0, 41224, 41017, 0, 3747, 10522, 0, 0, 1691, 41226, 0,
+ 12107, 44002, 10905, 65010, 194986, 697, 66018, 9284, 4244, 0, 0, 92644,
+ 13121, 120036, 0, 12010, 128573, 128221, 0, 0, 0, 127193, 65816, 68111,
+ 0, 127933, 65668, 92257, 6618, 118784, 66365, 0, 42234, 12648, 128039,
+ 7123, 0, 5785, 9198, 9764, 41316, 65877, 7383, 13230, 41299, 0, 0, 68365,
+ 128258, 0, 0, 0, 13122, 0, 191, 74119, 8585, 8000, 64411, 120652, 42889,
64850, 41072, 41578, 0, 41577, 0, 10002, 0, 6533, 73802, 41570, 0, 683,
- 396, 41580, 68146, 0, 12901, 0, 0, 343, 0, 0, 41360, 0, 0, 4743, 0, 0,
- 74040, 74108, 8743, 1724, 1433, 119324, 0, 3739, 6263, 0, 0, 3964, 6592,
- 0, 0, 66040, 0, 42568, 0, 0, 1778, 3956, 0, 42070, 6563, 43075, 9018, 0,
- 0, 12067, 41312, 0, 5547, 0, 0, 0, 8175, 0, 284, 8108, 934, 0, 74001,
- 173, 66460, 7174, 0, 0, 1750, 0, 4394, 0, 1807, 0, 0, 0, 5889, 0, 7180,
- 0, 119145, 0, 0, 42471, 6982, 1721, 119144, 7891, 42243, 42160, 2583,
- 4512, 0, 0, 0, 0, 0, 3855, 0, 0, 0, 0, 74295, 0, 0, 119140, 3975, 0,
- 74087, 0, 12672, 3798, 2703, 0, 0, 0, 9774, 1275, 0, 0, 41095, 3962, 0,
- 7873, 41101, 3954, 6457, 4513, 0, 0, 73994, 73992, 1468, 0, 0, 41851, 0,
- 41846, 0, 0, 7633, 41849, 0, 4320, 3224, 0, 0, 0, 42531, 0, 1510, 0,
- 8256, 0, 11393, 0, 8879, 0, 0, 8770, 0, 0, 127120, 1910, 8671, 0, 4283,
- 0, 127117, 0, 0, 2654, 7893, 0, 0, 0, 0, 65106, 42761, 12857, 4581, 8411,
- 119029, 127121, 0, 0, 0, 0, 0, 0, 1733, 4392, 2568, 10786, 0, 0, 8184,
- 41486, 0, 0, 0, 0, 0, 0, 7185, 7965, 0, 0, 0, 0, 41350, 9129, 0, 0, 0, 0,
- 0, 0, 10481, 0, 0, 7171, 0, 340, 0, 0, 0, 0, 0, 0, 0, 917620, 0, 0, 0, 0,
- 0, 65203, 11392, 0, 0, 0, 3210, 0, 0, 0, 0, 0, 0, 917619, 0, 0, 10043, 0,
- 1186, 41571, 6999, 617, 9464, 0, 3675, 5207, 65062, 5213, 0, 2617, 41348,
- 41568, 0, 3253, 120535, 0, 8630, 0, 0, 5596, 5545, 7288, 2586, 64887, 0,
- 5217, 0, 0, 0, 0, 64293, 68098, 2635, 0, 0, 0, 0, 0, 7835, 0, 0, 194988,
- 0, 64558, 0, 0, 0, 0, 0, 0, 5784, 0, 0, 0, 0, 4011, 0, 68101, 0, 7864,
- 4254, 118975, 0, 5600, 3903, 127083, 10447, 5598, 1207, 120521, 0, 3501,
- 42582, 43600, 0, 0, 1124, 5597, 0, 0, 9321, 0, 0, 0, 0, 1719, 120576, 0,
- 9671, 1125, 4399, 0, 0, 0, 7631, 5488, 65223, 0, 0, 5491, 0, 8937, 43044,
- 2604, 74187, 5490, 43046, 5489, 7212, 11768, 43043, 6300, 0, 194789, 0,
- 4390, 454, 41397, 0, 9875, 7593, 194792, 0, 118913, 7207, 0, 65901, 2394,
- 2575, 0, 3746, 11016, 65752, 0, 0, 917944, 0, 11989, 0, 0, 0, 0, 0, 8249,
- 0, 0, 0, 6640, 74806, 2598, 513, 0, 6586, 8656, 0, 0, 65008, 0, 194784,
- 0, 194795, 0, 0, 194987, 0, 0, 0, 194986, 12647, 0, 194796, 0, 1036, 0,
- 0, 1723, 0, 0, 0, 41579, 2444, 0, 10705, 73876, 0, 74486, 0, 740, 194985,
- 0, 194984, 0, 4238, 11071, 9459, 917943, 0, 0, 0, 8121, 10438, 74487,
- 42574, 13285, 195001, 11907, 0, 5690, 194999, 0, 0, 43181, 13095, 0, 0,
- 64498, 0, 9506, 6978, 194993, 0, 0, 0, 194992, 0, 0, 1122, 317, 0, 0, 0,
- 0, 1920, 0, 10173, 827, 0, 0, 0, 120126, 5223, 1304, 0, 119564, 5226,
- 12602, 0, 0, 9329, 7758, 9239, 41173, 5224, 5487, 1222, 5692, 41725, 0,
- 9674, 5695, 41711, 64627, 19909, 0, 74604, 5691, 287, 866, 233, 0, 0,
- 42816, 0, 65140, 74797, 0, 8830, 6568, 42300, 10524, 41175, 0, 0, 0,
- 5296, 0, 42492, 0, 0, 3302, 0, 0, 6516, 6515, 6514, 6513, 6512, 0, 7856,
- 8690, 0, 0, 12122, 119628, 194813, 0, 1785, 0, 120635, 65153, 194810,
- 5138, 0, 0, 0, 0, 4540, 41181, 0, 6200, 0, 5134, 0, 322, 4643, 5132, 0,
- 0, 0, 5143, 0, 8790, 0, 0, 194802, 0, 8869, 120601, 0, 42060, 0, 0, 0, 0,
- 10270, 10286, 10318, 10382, 43529, 66477, 0, 0, 74170, 0, 3234, 0, 0,
- 74376, 43139, 118924, 127084, 120627, 8767, 0, 74489, 41281, 120746,
- 5201, 0, 6215, 12714, 6214, 13101, 0, 0, 65268, 0, 0, 0, 11027, 0, 10059,
- 10511, 42075, 9767, 789, 1749, 0, 127071, 0, 320, 0, 8647, 0, 3049, 0,
- 6471, 42071, 43156, 0, 0, 0, 0, 4960, 5549, 0, 0, 8485, 4671, 5418, 0,
- 3351, 0, 0, 10610, 5414, 3064, 6212, 4286, 5421, 0, 9554, 0, 0, 0, 6653,
- 0, 0, 64510, 6213, 12885, 0, 119045, 64720, 0, 120759, 73741, 12603, 0,
- 11430, 4566, 7843, 9317, 3801, 10342, 10406, 0, 119259, 42576, 0, 5200,
- 0, 0, 0, 9183, 0, 74458, 73825, 395, 5482, 5198, 8786, 10390, 74202,
- 5196, 43224, 6113, 42009, 5205, 0, 43307, 0, 118973, 0, 12134, 0, 0,
- 118843, 9126, 435, 0, 12014, 12893, 8093, 9079, 3203, 192, 65109, 3385,
- 0, 64430, 5383, 10294, 10326, 0, 5738, 0, 3336, 0, 5361, 3623, 41159, 0,
- 68112, 7872, 8581, 0, 1260, 3149, 5359, 0, 0, 7914, 5357, 0, 0, 2624,
- 5364, 0, 11431, 0, 9101, 11058, 0, 0, 0, 42271, 0, 65737, 120793, 0, 0,
- 0, 10619, 0, 0, 0, 0, 0, 0, 0, 0, 9319, 7097, 119055, 0, 3232, 73824,
- 74581, 0, 0, 0, 41889, 0, 0, 1161, 41895, 74103, 9701, 8622, 0, 0, 73819,
- 120588, 5012, 119049, 41362, 0, 917762, 11921, 0, 11769, 0, 0, 41364, 0,
- 74228, 41352, 41361, 0, 41366, 0, 3356, 0, 917, 0, 119915, 119923, 8199,
- 119912, 119917, 677, 119916, 0, 119932, 0, 0, 0, 0, 3349, 74125, 7022,
- 8927, 4739, 0, 5802, 0, 8615, 0, 0, 491, 0, 0, 0, 65837, 0, 8426, 11092,
- 9891, 0, 42497, 0, 7586, 42305, 10852, 0, 0, 0, 0, 9095, 7741, 12684,
- 41885, 1046, 0, 0, 0, 5815, 5171, 65539, 0, 6932, 0, 42394, 41878, 74849,
- 917951, 0, 5169, 11935, 0, 0, 3175, 120822, 1537, 120804, 5176, 8905,
- 4136, 4871, 0, 0, 9833, 0, 0, 1128, 65920, 0, 9711, 7057, 9408, 9409,
- 9410, 9411, 3662, 9413, 3378, 9415, 9416, 9417, 9418, 8909, 9420, 9421,
- 5897, 9423, 5165, 5126, 41385, 0, 41389, 917938, 8955, 3374, 9400, 9401,
- 9402, 9403, 9404, 3507, 9406, 7629, 0, 19925, 0, 73832, 183, 0, 2631, 0,
- 10627, 41130, 0, 3996, 0, 0, 0, 0, 119307, 0, 6580, 4332, 64825, 66329,
- 10726, 66686, 41125, 5899, 41365, 917918, 12085, 0, 574, 917922, 0,
- 73828, 5448, 41058, 5446, 73900, 41322, 74768, 5442, 4190, 0, 0, 5451, 0,
- 3616, 0, 0, 0, 7708, 0, 10859, 65867, 10345, 10409, 4191, 0, 120719,
- 73800, 42181, 0, 0, 4447, 0, 120708, 11788, 65587, 0, 10415, 74102, 0,
- 205, 0, 10351, 119076, 0, 9862, 6588, 0, 64697, 0, 41355, 5505, 119154,
- 5503, 8021, 0, 119150, 9819, 41357, 8011, 42885, 5507, 12044, 0, 0,
- 10026, 5472, 65108, 1191, 13106, 5470, 10329, 5476, 8991, 66322, 0, 0,
- 42874, 8550, 42876, 5592, 2919, 0, 2675, 5595, 0, 0, 4367, 0, 0, 5478,
- 5904, 5594, 0, 74150, 7291, 5590, 0, 13067, 118909, 0, 0, 9731, 0, 64633,
- 194565, 0, 0, 0, 0, 0, 10750, 0, 0, 74545, 0, 0, 12887, 10551, 194564, 0,
- 0, 0, 120570, 0, 5199, 0, 1120, 42387, 0, 1444, 9486, 7554, 65839, 0, 0,
- 1442, 0, 5894, 0, 0, 0, 0, 74313, 0, 13162, 0, 3334, 0, 118803, 0, 66022,
- 0, 0, 1651, 0, 8861, 0, 0, 1142, 0, 8271, 0, 0, 0, 12903, 0, 4002, 0,
- 10442, 10676, 3344, 0, 0, 12920, 0, 0, 0, 0, 1277, 0, 7871, 0, 0, 0, 0,
- 119015, 120360, 0, 11784, 0, 0, 4700, 66366, 0, 120359, 11012, 0, 0,
- 120358, 0, 4973, 8784, 0, 74804, 0, 0, 118981, 42440, 0, 43118, 0, 42364,
- 0, 11543, 0, 0, 10346, 10410, 0, 9243, 2464, 0, 6108, 3372, 0, 6247,
- 43117, 74526, 0, 74166, 0, 120355, 0, 0, 0, 0, 0, 0, 0, 74217, 3354, 0,
- 4192, 9289, 118999, 41191, 3876, 0, 0, 120660, 0, 0, 0, 0, 0, 0, 11603,
- 0, 0, 6589, 0, 194679, 0, 0, 0, 0, 0, 42572, 0, 10630, 74827, 1963,
- 118889, 0, 11654, 0, 7550, 10686, 5903, 0, 0, 41329, 9662, 917937, 64698,
- 3366, 10399, 0, 0, 11013, 0, 917933, 0, 0, 0, 6925, 0, 0, 917929, 0,
- 11568, 0, 917931, 64579, 917930, 7852, 0, 0, 12292, 6312, 0, 64672,
- 65296, 0, 118957, 0, 416, 12296, 74753, 73834, 0, 11050, 10984, 0, 0, 0,
- 0, 0, 0, 9532, 66355, 0, 0, 917925, 64343, 195032, 0, 195031, 0, 0,
- 195057, 11445, 0, 195028, 0, 195027, 0, 1021, 0, 9507, 10210, 74544,
- 8023, 1200, 12243, 195062, 5282, 195061, 12540, 11545, 0, 120493, 3343,
- 4424, 11047, 1885, 43268, 3896, 0, 66497, 2947, 392, 7894, 4391, 68139,
- 0, 13059, 74816, 0, 3381, 7942, 0, 0, 0, 0, 0, 3913, 0, 0, 0, 7044, 1265,
- 0, 6309, 7045, 7175, 7047, 0, 11791, 0, 0, 8221, 0, 41864, 0, 0, 0, 0,
- 167, 0, 917584, 0, 74211, 41897, 0, 0, 0, 0, 0, 2493, 0, 118811, 0, 0,
- 64354, 0, 8777, 0, 406, 8884, 2385, 0, 0, 0, 0, 43030, 42027, 12114, 0,
- 0, 64936, 0, 0, 120629, 10561, 0, 8365, 0, 0, 65841, 120787, 11601, 0, 0,
- 0, 917575, 7834, 74159, 0, 0, 10298, 6624, 4908, 917596, 1639, 0, 0,
- 74157, 0, 0, 0, 0, 0, 0, 4817, 0, 194759, 0, 7043, 9600, 11022, 0, 0, 0,
- 0, 0, 0, 7548, 64794, 42050, 12291, 0, 194761, 12343, 657, 195054, 64682,
- 4461, 1134, 1838, 0, 0, 0, 4468, 0, 0, 0, 4456, 5206, 10720, 0, 42523, 0,
- 0, 0, 0, 65550, 260, 4816, 74163, 10687, 0, 4821, 4466, 0, 195043, 4818,
- 0, 41403, 119977, 0, 0, 41406, 43273, 74160, 119983, 73939, 119985,
- 119984, 119979, 41404, 1165, 119980, 4451, 13087, 0, 11284, 119987,
- 73855, 65155, 43014, 5439, 9363, 0, 3375, 0, 5900, 0, 7889, 2722, 42262,
- 0, 0, 0, 0, 0, 0, 0, 11401, 0, 0, 0, 0, 0, 0, 0, 65438, 0, 7280, 0, 0, 0,
- 4868, 119967, 119966, 0, 0, 0, 43161, 0, 119964, 0, 5182, 0, 120542, 0,
- 0, 4226, 120798, 12135, 5732, 4464, 0, 0, 977, 4458, 0, 0, 64770, 0, 0,
- 344, 0, 194790, 1395, 64279, 0, 0, 0, 786, 0, 43174, 64340, 0, 0, 0,
- 43026, 7612, 10132, 64413, 0, 0, 0, 0, 0, 0, 120498, 0, 120734, 0,
- 119160, 10204, 0, 0, 0, 0, 1399, 0, 0, 0, 8852, 0, 241, 0, 4907, 0, 0,
- 7932, 9727, 0, 74255, 8748, 0, 0, 0, 0, 42780, 0, 0, 0, 4217, 0, 8650, 0,
- 0, 0, 0, 118872, 43099, 3965, 0, 0, 0, 13300, 0, 0, 0, 66588, 118991, 0,
- 0, 73815, 4420, 0, 6410, 7760, 0, 0, 0, 0, 0, 7294, 0, 0, 0, 9066, 0,
- 11993, 43188, 2626, 7762, 0, 0, 0, 0, 42825, 41854, 5304, 0, 0, 6919,
- 8619, 119655, 10038, 66454, 9592, 42851, 126993, 1542, 0, 0, 0, 0, 0,
- 74311, 0, 0, 10181, 0, 0, 0, 7779, 0, 10195, 9479, 6029, 0, 0, 9689, 0,
- 0, 8993, 66358, 0, 42378, 3368, 606, 0, 7697, 0, 0, 2030, 0, 6027, 8370,
- 4322, 0, 65207, 0, 0, 0, 0, 0, 2735, 42831, 0, 0, 74866, 8881, 119047, 0,
- 0, 73946, 0, 0, 0, 68140, 0, 9576, 0, 3347, 4160, 5154, 0, 3794, 66564,
- 66514, 0, 7709, 41112, 0, 66560, 42041, 4572, 0, 66561, 0, 41113, 0,
- 1615, 5855, 809, 0, 0, 0, 0, 5799, 0, 0, 0, 7260, 0, 43031, 64425, 65128,
- 127061, 64386, 65257, 0, 0, 120607, 9347, 0, 6532, 0, 0, 0, 0, 65828, 0,
- 283, 917917, 0, 532, 0, 0, 0, 120609, 0, 3370, 0, 11361, 5443, 0, 8153,
- 73767, 0, 10741, 0, 0, 0, 0, 65495, 64706, 0, 0, 0, 0, 9466, 119600,
- 9824, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 43264, 0, 0, 0, 0, 0, 0, 0,
- 68161, 64550, 5186, 12890, 0, 0, 12108, 0, 65124, 0, 66043, 0, 0, 43107,
- 0, 0, 42562, 0, 0, 0, 0, 11485, 6103, 127123, 0, 11718, 0, 12889, 0, 0,
- 0, 0, 0, 0, 0, 1630, 0, 65483, 0, 12565, 0, 65476, 0, 0, 119554, 9283,
- 7700, 917537, 9690, 65499, 0, 64593, 512, 3376, 118862, 0, 0, 0, 632,
- 12940, 0, 42529, 0, 0, 5957, 0, 8926, 0, 0, 0, 10745, 10174, 0, 64581,
- 5386, 120686, 11713, 10633, 120531, 5056, 0, 0, 0, 120773, 0, 9812, 0,
- 4460, 0, 0, 0, 0, 0, 0, 0, 64278, 0, 0, 0, 0, 64389, 2953, 73879, 1801,
- 12835, 917627, 0, 73823, 0, 66375, 0, 702, 42579, 0, 0, 13074, 0, 0, 0,
- 0, 12106, 0, 74207, 1755, 10482, 12863, 0, 1163, 2951, 9522, 74079,
- 195076, 120674, 0, 3384, 120728, 10702, 830, 0, 0, 0, 8451, 0, 0, 0,
- 120762, 0, 0, 0, 0, 2908, 0, 0, 64902, 4243, 0, 12239, 0, 0, 4441, 0, 0,
- 73940, 64352, 0, 0, 411, 0, 0, 0, 0, 0, 41890, 0, 2730, 41604, 0, 5428,
- 194743, 3364, 42265, 0, 0, 118816, 0, 9684, 216, 0, 1401, 0, 0, 0, 0, 0,
- 9158, 0, 120664, 5768, 0, 0, 0, 484, 0, 0, 0, 65895, 0, 0, 3338, 73935,
- 572, 7041, 2736, 0, 0, 0, 2794, 8807, 64491, 0, 5438, 5222, 5381, 43114,
- 0, 5193, 5125, 5456, 5509, 0, 194747, 9534, 0, 0, 0, 3430, 0, 0, 0, 0,
- 981, 0, 4330, 120673, 120536, 1824, 10908, 0, 7034, 41683, 64617, 0,
- 73754, 3957, 0, 64547, 0, 674, 63991, 0, 2946, 5354, 5251, 5328, 5307,
- 3759, 11411, 8364, 5123, 0, 5281, 5469, 5121, 0, 0, 0, 5130, 0, 0, 0, 0,
- 120726, 1221, 2733, 11746, 0, 5216, 0, 0, 0, 0, 3468, 0, 9230, 5939, 0,
- 0, 0, 120677, 120729, 7278, 10321, 10289, 64613, 10385, 41706, 0, 0, 0,
- 0, 11739, 0, 41981, 0, 5938, 0, 0, 12448, 7576, 10401, 10337, 73852, 0,
- 13057, 0, 126976, 0, 10009, 0, 64304, 0, 12165, 0, 0, 9885, 0, 8077, 0,
- 0, 0, 0, 0, 0, 0, 4220, 10725, 10433, 0, 0, 4987, 64519, 0, 0, 0, 0, 0,
- 10970, 11733, 0, 120792, 0, 19944, 0, 9009, 8551, 0, 11468, 74003, 7575,
- 0, 2724, 0, 0, 12313, 119949, 515, 119947, 42791, 63987, 119942, 119943,
- 119940, 119941, 119938, 9775, 4046, 4589, 4521, 0, 9141, 0, 0, 2741,
- 64399, 6197, 1370, 0, 0, 0, 0, 0, 0, 6184, 8606, 3303, 41372, 11786,
- 9473, 66203, 66177, 0, 11593, 43007, 4478, 66178, 0, 0, 2744, 0, 4477, 0,
- 814, 42066, 66183, 66204, 66194, 119961, 66198, 41880, 66188, 66197,
- 119954, 11955, 66190, 66191, 41111, 66189, 73788, 7788, 4847, 0, 0, 0, 0,
- 0, 1581, 6535, 0, 12954, 430, 194934, 194939, 0, 194938, 5278, 4945,
- 42883, 4950, 0, 120547, 0, 7269, 0, 5964, 12908, 0, 0, 74764, 74477,
- 119146, 194936, 4949, 0, 443, 0, 4944, 5467, 119603, 0, 65137, 6044,
- 65392, 0, 4213, 0, 41303, 0, 194931, 0, 41306, 73984, 2698, 0, 0, 12072,
- 3193, 0, 41304, 824, 0, 12091, 119814, 119813, 119816, 4673, 64804, 4678,
- 119820, 119819, 65059, 0, 119808, 0, 5481, 3490, 1199, 119811, 8356,
- 119829, 119832, 4677, 12688, 3102, 0, 4672, 119822, 119821, 5531, 119823,
- 42575, 119825, 119828, 4674, 4548, 0, 0, 0, 119946, 8025, 0, 127024,
- 1855, 0, 119945, 0, 120554, 0, 0, 0, 0, 2745, 11797, 0, 0, 119939, 4654,
- 0, 0, 194959, 73993, 10525, 4649, 65209, 0, 0, 4648, 43080, 0, 0, 0,
- 6246, 64950, 7828, 4650, 0, 0, 119086, 4653, 7822, 0, 0, 43187, 8669, 0,
- 0, 65093, 0, 0, 2716, 0, 0, 0, 0, 0, 0, 11060, 8547, 2711, 42165, 0,
- 119228, 7992, 0, 0, 4662, 0, 0, 9149, 9146, 599, 4657, 194963, 120754,
- 194962, 4656, 10130, 0, 7811, 40994, 194965, 6414, 5967, 4658, 3725,
- 5713, 5814, 4661, 42434, 0, 0, 0, 64904, 9026, 10833, 0, 7547, 4867, 0,
- 10008, 10222, 3054, 194956, 9744, 0, 7605, 4622, 119656, 0, 0, 0, 0, 0,
- 9045, 0, 4225, 19926, 0, 12880, 65307, 4617, 0, 0, 0, 4616, 10518, 10423,
- 10359, 0, 5958, 0, 0, 4215, 9789, 917941, 4321, 4621, 0, 41313, 522,
- 5368, 0, 65803, 0, 5366, 12201, 5372, 0, 0, 0, 7720, 0, 2696, 0, 0, 4638,
- 0, 1790, 0, 5965, 64363, 66569, 0, 194968, 5376, 1835, 5335, 194966, 0,
- 4633, 0, 68119, 1180, 4632, 0, 5387, 5333, 0, 0, 42094, 5331, 4634,
- 11928, 0, 5338, 4637, 0, 5971, 42414, 0, 1268, 65097, 42361, 0, 0, 73853,
- 1427, 0, 0, 5970, 3431, 0, 10358, 10422, 4758, 0, 1608, 2738, 0, 10455,
- 4753, 74026, 11344, 4222, 6240, 5231, 74384, 0, 0, 6248, 0, 0, 0, 42318,
- 0, 5229, 4757, 0, 0, 2728, 4752, 64563, 65235, 5234, 0, 0, 0, 10713, 0,
- 0, 2622, 7460, 0, 0, 0, 8954, 74760, 65189, 2632, 0, 10108, 1011, 5574,
- 1853, 2709, 65139, 5577, 0, 0, 118871, 0, 8965, 7635, 42177, 5316, 0,
- 5314, 6451, 5572, 0, 5312, 0, 5525, 5330, 5319, 0, 0, 194907, 119016, 0,
- 0, 0, 0, 0, 195009, 0, 74022, 0, 64609, 0, 0, 0, 5721, 0, 10398, 8632,
- 66465, 11267, 73961, 0, 5720, 0, 1692, 4219, 4610, 8696, 4305, 0, 4609,
- 0, 4614, 541, 0, 5287, 5309, 5285, 0, 5961, 4647, 56, 4216, 10577, 41381,
- 601, 4613, 0, 0, 0, 4608, 64260, 41124, 5190, 67628, 0, 68145, 7086, 0,
- 119243, 67620, 0, 2734, 11074, 0, 67627, 43593, 0, 67625, 5960, 0, 8992,
- 65293, 0, 1782, 67622, 68114, 119950, 0, 68180, 5501, 119952, 42508,
- 7442, 120749, 359, 41253, 119957, 6239, 119956, 41256, 0, 68134, 0,
- 74209, 0, 9346, 118904, 41254, 0, 43291, 3767, 5737, 0, 4865, 0, 5740, 0,
- 5736, 4368, 0, 7193, 68137, 0, 5739, 41024, 4866, 0, 73904, 0, 4869,
- 120563, 0, 4223, 0, 6650, 0, 0, 0, 0, 4870, 0, 74805, 66566, 0, 120758,
- 0, 0, 0, 10122, 4864, 66568, 4144, 7937, 0, 6245, 0, 2732, 66459, 745, 0,
- 195097, 0, 4777, 7821, 0, 0, 42775, 0, 194954, 0, 3097, 0, 5966, 0, 4778,
- 0, 10863, 0, 4781, 0, 64407, 0, 0, 8577, 0, 118964, 43285, 10216, 4782,
- 0, 0, 120757, 917924, 12325, 0, 8717, 0, 0, 4776, 0, 11492, 8700, 0,
- 13176, 0, 10426, 0, 917599, 10362, 0, 1715, 4849, 8242, 9561, 73922,
- 43278, 42635, 0, 0, 5963, 917926, 0, 0, 4850, 0, 1607, 466, 4853, 118995,
- 4854, 0, 5164, 0, 1350, 5124, 64420, 1993, 5362, 8471, 2708, 0, 12445,
- 3785, 234, 3199, 0, 41268, 4848, 2530, 0, 4798, 1964, 0, 73762, 10458, 0,
- 8576, 0, 0, 2704, 4794, 0, 0, 8322, 4797, 74074, 0, 2694, 4792, 0, 2439,
- 65104, 0, 0, 303, 0, 0, 0, 2437, 0, 4221, 4844, 118869, 0, 0, 0, 0, 0,
- 43292, 0, 2441, 10739, 65090, 0, 119327, 0, 2451, 2714, 119326, 0, 0,
- 4937, 74541, 753, 5849, 10597, 43089, 11722, 9248, 0, 42879, 11725, 0, 0,
- 2726, 3107, 73958, 4941, 64937, 917538, 9140, 1408, 5261, 41412, 0, 181,
+ 396, 41580, 68146, 0, 12901, 43058, 0, 343, 7129, 42680, 41360, 78154, 0,
+ 4743, 0, 0, 74040, 74108, 8743, 1724, 1433, 119322, 0, 3739, 6263, 92514,
+ 0, 3964, 6592, 0, 128693, 66040, 0, 42568, 69806, 0, 1778, 3956, 0,
+ 42070, 6563, 43075, 9018, 0, 0, 12067, 41312, 0, 5547, 74531, 127969, 0,
+ 8175, 0, 284, 8108, 934, 0, 74001, 173, 66460, 7174, 92703, 118822, 1750,
+ 0, 4394, 68368, 1807, 0, 92298, 0, 5889, 0, 7180, 0, 119145, 0, 917558,
+ 42471, 6982, 1721, 44022, 7891, 42243, 42160, 2583, 4512, 119360, 65230,
+ 128109, 0, 0, 3855, 0, 0, 0, 0, 74295, 0, 0, 92416, 3975, 0, 74087, 0,
+ 12672, 3798, 2703, 0, 0, 2109, 9774, 1275, 0, 0, 41095, 3962, 0, 2932,
+ 41101, 3954, 6457, 4513, 0, 0, 73994, 73992, 1468, 0, 0, 41851, 128230,
+ 41846, 0, 55238, 7633, 41849, 68385, 4320, 3224, 0, 128032, 0, 42531, 0,
+ 1510, 0, 8256, 0, 11393, 0, 8879, 128075, 92474, 8770, 0, 0, 78377, 1910,
+ 8671, 78374, 4283, 0, 127117, 68361, 78318, 2654, 7893, 195007, 0, 0, 0,
+ 65106, 42761, 12857, 4581, 8411, 78372, 78371, 78370, 78369, 78368, 0, 0,
+ 0, 1733, 4392, 2568, 10786, 69661, 0, 8184, 41486, 0, 7396, 7116, 0,
+ 69788, 0, 7185, 7965, 0, 0, 92347, 0, 41350, 9129, 0, 0, 0, 0, 92489, 0,
+ 10481, 0, 127486, 7171, 0, 340, 92498, 0, 0, 0, 92200, 0, 0, 6764,
+ 127487, 0, 0, 0, 0, 65203, 11392, 119098, 119359, 0, 3210, 0, 0, 0, 0, 0,
+ 127970, 917619, 0, 0, 10043, 0, 1186, 41571, 6999, 617, 9464, 128244,
+ 3675, 5207, 65062, 5213, 194769, 2617, 41348, 41568, 128803, 3253,
+ 120535, 0, 8630, 128544, 0, 5596, 5545, 7288, 2586, 64887, 0, 5217, 0, 0,
+ 0, 0, 64293, 68098, 2635, 0, 0, 0, 0, 0, 7835, 0, 0, 194988, 92285,
+ 64558, 127122, 0, 127121, 0, 127913, 0, 5784, 0, 0, 0, 0, 4011, 917616,
+ 68101, 0, 7864, 4254, 65095, 0, 5600, 3903, 127083, 10447, 5598, 1207,
+ 120521, 66689, 3501, 42582, 43600, 194780, 0, 1124, 5597, 194778, 194772,
+ 9321, 0, 0, 0, 0, 1719, 68356, 68354, 9671, 1125, 4399, 127479, 917610,
+ 0, 7631, 5488, 7128, 120532, 0, 5491, 0, 8937, 43044, 2604, 74187, 5490,
+ 43046, 5489, 7212, 11768, 43043, 6300, 0, 7122, 0, 4390, 454, 41397, 0,
+ 9875, 7593, 194792, 92274, 118913, 7207, 0, 65901, 2394, 2575, 0, 3746,
+ 11016, 65752, 120037, 0, 43423, 128683, 11989, 0, 0, 0, 0, 0, 8249,
+ 128172, 0, 78531, 6640, 74806, 2598, 513, 0, 6586, 8656, 0, 127002,
+ 65008, 0, 194784, 194989, 194795, 0, 92515, 68475, 0, 0, 0, 78637, 12647,
+ 0, 128043, 0, 1036, 0, 92419, 1723, 128056, 0, 0, 41579, 2444, 0, 10705,
+ 73876, 0, 74486, 0, 740, 119222, 194978, 194984, 0, 4238, 11071, 9459,
+ 68437, 78140, 78139, 194985, 8121, 10438, 74487, 42574, 13285, 55263,
+ 11907, 195000, 5690, 92255, 0, 0, 43181, 13095, 0, 127857, 64498, 0,
+ 9506, 6978, 194993, 77992, 0, 0, 194992, 0, 127845, 1122, 317, 0, 0, 0,
+ 0, 1920, 0, 10173, 827, 0, 0, 78378, 120126, 5223, 1304, 0, 119564, 5226,
+ 12602, 0, 0, 9329, 7758, 9239, 41173, 5224, 5487, 1222, 5692, 41725,
+ 69229, 9674, 5695, 41711, 64627, 19909, 0, 74604, 5691, 287, 866, 233,
+ 127490, 0, 42816, 0, 65140, 74797, 0, 8830, 6568, 42300, 10524, 41175, 0,
+ 0, 0, 5296, 0, 42492, 43402, 92466, 3302, 0, 0, 6516, 6515, 6514, 6513,
+ 6512, 0, 7856, 8690, 0, 0, 12122, 119602, 43976, 0, 1785, 92507, 68622,
+ 65153, 194810, 5138, 0, 0, 0, 0, 4540, 41181, 0, 6200, 0, 5134, 0, 322,
+ 4643, 5132, 0, 6389, 0, 5143, 0, 8790, 128694, 0, 194802, 0, 8869,
+ 120601, 0, 42060, 0, 0, 194804, 127012, 10270, 10286, 10318, 10382,
+ 43529, 66477, 0, 0, 74170, 0, 3234, 0, 0, 74376, 43139, 118815, 127084,
+ 120627, 8767, 0, 74489, 9695, 120746, 5201, 0, 6215, 12714, 6214, 13101,
+ 0, 194999, 65268, 0, 0, 0, 11027, 0, 10059, 10511, 42075, 9767, 789,
+ 1749, 78890, 127071, 0, 320, 0, 8647, 0, 3049, 0, 6471, 42071, 43156,
+ 9925, 127356, 127355, 66478, 4960, 5549, 127359, 127346, 8485, 4671,
+ 5418, 127350, 3351, 127006, 127351, 10610, 5414, 3064, 6212, 4286, 5421,
+ 127344, 9554, 0, 127794, 127109, 6653, 128811, 0, 64510, 6213, 12885, 0,
+ 119045, 64720, 0, 120759, 73741, 12603, 7131, 11430, 4566, 7843, 9317,
+ 3801, 10342, 10406, 0, 119259, 42576, 0, 5200, 0, 917948, 0, 9183,
+ 127361, 74458, 73825, 395, 5482, 5198, 8786, 10390, 74202, 5196, 43224,
+ 6113, 42009, 5205, 0, 43307, 0, 118973, 0, 12134, 0, 0, 118843, 9126,
+ 435, 0, 12014, 10377, 8093, 9079, 3203, 192, 65109, 3385, 0, 64430, 5383,
+ 10294, 10326, 128178, 5738, 0, 3336, 78355, 5361, 3623, 41159, 0, 68112,
+ 7872, 8581, 0, 1260, 3149, 5359, 0, 0, 7914, 5357, 92170, 128659, 2624,
+ 5364, 0, 11431, 120030, 9101, 11058, 78288, 0, 78293, 42271, 78289,
+ 42917, 120793, 0, 65566, 6717, 10619, 43360, 78385, 78384, 78383, 78382,
+ 78381, 78380, 78379, 9319, 7097, 119055, 77906, 3232, 73824, 74581,
+ 120632, 0, 0, 41889, 92453, 0, 1161, 41895, 74103, 9701, 8622, 0, 0,
+ 73819, 120588, 5012, 77912, 41362, 0, 78296, 11921, 0, 11769, 0, 68609,
+ 41364, 0, 74228, 41352, 41361, 0, 41366, 0, 3356, 0, 917, 68422, 119915,
+ 7134, 8199, 78389, 119917, 677, 119916, 0, 119932, 127169, 0, 0, 0, 3349,
+ 74125, 7022, 8927, 4739, 0, 5802, 0, 8615, 0, 0, 491, 0, 10190, 120698,
+ 65837, 128820, 8426, 11092, 9891, 0, 42497, 7113, 7586, 42305, 10852, 0,
+ 0, 4606, 68448, 9095, 7741, 12684, 41885, 1046, 7124, 0, 0, 5815, 5171,
+ 65539, 68612, 6932, 78315, 42394, 41878, 74849, 120621, 0, 5169, 11935,
+ 0, 0, 3175, 120822, 1537, 120804, 5176, 8905, 4136, 4871, 78287, 0, 9833,
+ 0, 0, 1128, 65920, 0, 9711, 7057, 9408, 9409, 9410, 9411, 3662, 9413,
+ 3378, 9415, 9416, 9417, 9418, 6320, 9420, 9421, 5897, 9423, 5165, 5126,
+ 41385, 0, 41389, 917938, 8955, 3374, 9400, 9401, 7119, 9403, 9404, 3507,
+ 9406, 7629, 0, 19925, 42669, 68463, 183, 43985, 2631, 0, 10627, 41130,
+ 78260, 3996, 0, 78771, 0, 119313, 119307, 78768, 6580, 4332, 64825,
+ 66329, 10726, 66686, 41125, 5899, 41365, 917918, 12085, 0, 574, 917922,
+ 77825, 73828, 5448, 41058, 5446, 69709, 41322, 42211, 5442, 4190, 77834,
+ 77835, 5451, 77833, 3616, 77828, 77837, 77838, 7708, 77836, 10859, 65867,
+ 10345, 10409, 4191, 0, 77844, 73800, 42181, 77843, 77839, 2060, 0, 7111,
+ 11788, 65587, 68129, 10415, 74102, 0, 205, 0, 10351, 119076, 0, 9862,
+ 6588, 43257, 64697, 73998, 41355, 5505, 119154, 5503, 8021, 0, 7125,
+ 9819, 41357, 8011, 42885, 5507, 12044, 92636, 0, 10026, 5472, 7109, 1191,
+ 13106, 5470, 10329, 5476, 8991, 66322, 69778, 78267, 42874, 8550, 42876,
+ 5592, 2919, 0, 2675, 5595, 78411, 0, 4367, 0, 0, 5478, 5904, 5594, 0,
+ 74150, 7291, 5590, 77849, 13067, 118909, 120372, 0, 9731, 69731, 64633,
+ 77857, 77854, 77855, 77852, 77853, 77850, 10750, 43714, 77858, 7137, 0,
+ 128296, 12887, 10551, 194564, 77866, 77867, 77864, 77865, 9929, 5199,
+ 9936, 1120, 42387, 0, 1444, 9486, 7554, 65839, 55252, 0, 1442, 0, 5894,
+ 0, 0, 41171, 92511, 74313, 0, 13162, 0, 3334, 0, 118803, 77881, 66022, 0,
+ 0, 1651, 0, 8861, 0, 0, 1142, 0, 8271, 0, 0, 0, 12903, 0, 4002, 43626,
+ 10442, 10676, 3344, 0, 0, 12920, 194560, 0, 0, 66642, 1277, 0, 7871, 0,
+ 0, 78853, 0, 78854, 120360, 0, 11784, 0, 78012, 4700, 66366, 78858,
+ 120359, 11012, 0, 78856, 92400, 77879, 4973, 8784, 77877, 74804, 77874,
+ 77869, 77871, 42440, 0, 43118, 0, 42364, 6774, 6773, 917560, 120369,
+ 10346, 10410, 78859, 9243, 2464, 74263, 6108, 3372, 0, 6247, 43117,
+ 74526, 7121, 74166, 0, 120355, 92537, 0, 0, 195034, 0, 0, 0, 74217, 3354,
+ 195037, 4192, 9289, 118999, 41191, 3876, 0, 127983, 120660, 43696, 43380,
+ 0, 0, 0, 0, 11603, 0, 0, 6589, 128588, 194679, 0, 0, 0, 0, 0, 42572,
+ 128264, 10630, 74827, 1963, 118889, 127978, 11654, 0, 7550, 10686, 5903,
+ 0, 78009, 41329, 9662, 917937, 64698, 3366, 10399, 0, 0, 11013, 127927,
+ 128300, 0, 78621, 194672, 6925, 0, 0, 917929, 0, 11568, 0, 43367, 64579,
+ 917930, 7852, 0, 0, 6754, 6312, 0, 64672, 65296, 0, 118957, 0, 416,
+ 12296, 68457, 73834, 68177, 11050, 10984, 92208, 0, 0, 92182, 0, 0, 9532,
+ 66355, 0, 0, 917925, 64343, 195032, 128281, 195031, 0, 0, 195057, 11445,
+ 0, 2112, 195056, 128814, 10185, 1021, 128130, 9507, 10210, 74544, 8023,
+ 1200, 12243, 78001, 5282, 78003, 9624, 11545, 0, 120493, 3343, 4424,
+ 11047, 1885, 43268, 3896, 78626, 66497, 2947, 392, 7894, 4391, 68139, 0,
+ 13059, 74816, 77998, 3381, 7942, 0, 69219, 0, 64757, 0, 3913, 0, 0,
+ 78235, 7044, 1265, 0, 6309, 7045, 7175, 7047, 78239, 11791, 0, 0, 8221,
+ 78307, 41864, 0, 0, 0, 0, 167, 0, 78301, 0, 74211, 41897, 68477, 0,
+ 917583, 0, 0, 2493, 0, 118811, 0, 0, 64354, 0, 8777, 0, 406, 8884, 2385,
+ 0, 92450, 0, 917573, 43030, 42027, 12114, 0, 917579, 64936, 194695, 0,
+ 120629, 10561, 0, 8365, 120539, 0, 65841, 120787, 11601, 0, 74121, 0,
+ 917575, 7834, 74159, 0, 917574, 10298, 6624, 4908, 917596, 1639, 0, 0,
+ 74157, 6327, 6724, 0, 128086, 92566, 0, 4817, 78446, 194759, 92536, 7043,
+ 9600, 11022, 0, 0, 0, 0, 0, 0, 7548, 64794, 42050, 12291, 55289, 194761,
+ 12343, 657, 195054, 42705, 4461, 1134, 1838, 78438, 2057, 0, 4468, 0, 0,
+ 0, 4456, 5206, 10720, 0, 42523, 127520, 0, 0, 917595, 65550, 260, 4816,
+ 67658, 10687, 0, 4821, 4466, 0, 195043, 4818, 195048, 41403, 119977, 0,
+ 0, 41406, 43273, 74160, 119983, 73939, 92638, 119984, 119979, 41404,
+ 1165, 119980, 4451, 13087, 0, 11284, 119987, 73855, 65155, 43014, 5439,
+ 9363, 127558, 3375, 128869, 5900, 0, 7889, 2722, 42262, 0, 0, 128774, 0,
+ 0, 0, 127810, 11401, 0, 0, 68459, 0, 0, 0, 0, 65438, 0, 7280, 127887, 0,
+ 127381, 4868, 119967, 119966, 118798, 0, 0, 43161, 0, 92360, 0, 5182, 0,
+ 120542, 0, 0, 4226, 120798, 12135, 5732, 4464, 0, 0, 977, 4458, 0, 0,
+ 64770, 74838, 0, 344, 0, 194790, 1395, 64279, 0, 92240, 0, 786, 0, 43174,
+ 64340, 0, 0, 120723, 43026, 7612, 10132, 64413, 65025, 0, 0, 0, 0, 0,
+ 68444, 0, 92437, 0, 119160, 10204, 92656, 0, 127809, 0, 1399, 0, 65217,
+ 0, 8852, 0, 241, 128780, 4907, 0, 0, 7932, 9727, 128873, 74255, 8748, 0,
+ 0, 0, 0, 42780, 0, 0, 0, 4217, 0, 8650, 0, 0, 0, 0, 118872, 43099, 3965,
+ 119119, 6719, 0, 13300, 78439, 128261, 43057, 66588, 118991, 0, 0, 73815,
+ 4420, 0, 6410, 7760, 0, 0, 0, 0, 0, 7294, 0, 0, 0, 9066, 0, 11993, 43188,
+ 2626, 7762, 0, 0, 0, 92601, 42825, 41854, 5304, 0, 78516, 6919, 8619,
+ 119655, 10038, 66454, 9592, 42851, 126993, 1542, 92303, 0, 0, 0, 0,
+ 74311, 78497, 0, 10181, 0, 43624, 0, 7779, 0, 10195, 9479, 6029, 0,
+ 92268, 9689, 0, 0, 8993, 66358, 0, 42378, 3368, 606, 127030, 7697, 69237,
+ 69787, 2030, 0, 6027, 8370, 4322, 0, 65207, 0, 0, 0, 0, 0, 2735, 42831,
+ 77935, 127120, 74866, 8881, 119047, 0, 0, 73946, 0, 0, 0, 68140, 0, 9576,
+ 128872, 3347, 4160, 5154, 55288, 3794, 66564, 8530, 127063, 7709, 41112,
+ 0, 66560, 42041, 4572, 12876, 66561, 0, 6758, 0, 1615, 5855, 809, 0,
+ 92283, 128316, 128004, 5799, 0, 0, 0, 7260, 0, 43031, 64425, 65128,
+ 78819, 64386, 65257, 0, 68616, 120607, 9347, 128067, 6532, 0, 0, 0,
+ 127060, 65828, 0, 283, 68665, 78813, 532, 78663, 0, 0, 120609, 0, 3370,
+ 0, 11361, 5443, 78778, 8153, 73767, 0, 10741, 0, 0, 0, 0, 65495, 64706,
+ 0, 43344, 0, 7144, 9466, 78866, 9824, 0, 0, 0, 0, 915, 43425, 0, 0, 0, 0,
+ 127178, 43264, 0, 0, 0, 0, 78864, 6730, 78862, 68161, 64550, 5186, 12890,
+ 127837, 0, 12108, 0, 65124, 43127, 66043, 0, 6326, 43107, 77826, 0,
+ 42562, 0, 0, 0, 128520, 11485, 6103, 127123, 0, 11718, 0, 12889, 92657,
+ 127137, 0, 0, 0, 55245, 0, 1630, 128232, 65483, 0, 12565, 0, 65476,
+ 120013, 0, 119554, 9283, 7700, 917537, 9690, 65499, 0, 64593, 512, 3376,
+ 68210, 0, 0, 77892, 632, 12940, 77891, 42529, 78587, 0, 5957, 110593,
+ 8926, 0, 0, 128273, 10745, 10174, 7379, 64581, 5386, 120686, 11713,
+ 10633, 69708, 5056, 0, 0, 0, 120773, 0, 9812, 0, 4460, 0, 0, 0, 128038,
+ 0, 0, 127174, 64278, 92370, 43466, 0, 0, 64389, 2953, 73879, 1801, 12835,
+ 119029, 0, 73823, 0, 66375, 2085, 702, 42579, 77884, 77885, 13074, 77883,
+ 0, 0, 128570, 12106, 0, 74207, 1755, 10482, 12863, 77898, 1163, 2951,
+ 9522, 74079, 78266, 120674, 0, 3384, 69227, 10702, 830, 77902, 77899,
+ 77900, 8451, 0, 0, 0, 69739, 0, 0, 0, 0, 2908, 0, 43386, 64902, 4243, 0,
+ 12239, 0, 0, 4441, 0, 0, 73940, 64352, 127513, 0, 411, 0, 9199, 0, 4056,
+ 118992, 41890, 0, 2730, 41604, 0, 5428, 194743, 3364, 42265, 64437,
+ 127935, 118816, 194742, 9684, 216, 0, 1401, 128053, 44012, 0, 0, 92585,
+ 9158, 77842, 120664, 5768, 0, 0, 0, 484, 194739, 0, 0, 65895, 0, 0, 3338,
+ 73935, 572, 7041, 2736, 67605, 0, 128680, 2794, 8807, 64491, 77847, 5438,
+ 5222, 5381, 43114, 0, 5193, 5125, 5456, 5509, 77846, 194747, 9534, 0, 0,
+ 0, 3430, 0, 0, 0, 0, 981, 0, 4330, 73929, 120536, 1824, 10908, 0, 7034,
+ 41683, 64617, 0, 73754, 3957, 64358, 64547, 128259, 674, 63991, 0, 2946,
+ 5354, 5251, 5328, 5307, 3759, 11411, 8364, 5123, 119628, 5281, 5469,
+ 5121, 119245, 118993, 0, 5130, 0, 0, 77990, 0, 120726, 1221, 2733, 11746,
+ 77991, 5216, 0, 0, 0, 0, 3468, 7033, 9230, 5939, 195052, 0, 0, 120677,
+ 68400, 7278, 10321, 10289, 64613, 10385, 41706, 0, 0, 0, 0, 11739, 0,
+ 41981, 0, 5938, 0, 0, 12448, 7576, 10401, 10337, 73852, 0, 13057, 0,
+ 126976, 0, 10009, 0, 41703, 0, 12165, 0, 0, 9885, 0, 8077, 0, 127908, 0,
+ 0, 0, 92457, 0, 4220, 10725, 10433, 0, 68395, 4987, 64519, 0, 128340, 0,
+ 0, 0, 10970, 11733, 0, 120792, 0, 19944, 0, 9009, 8551, 92345, 11468,
+ 64636, 7575, 0, 2724, 0, 0, 12313, 110592, 515, 119947, 42791, 63987,
+ 78286, 119943, 119940, 119941, 119938, 9775, 4046, 4589, 4521, 68629,
+ 9141, 0, 78850, 2741, 64399, 6197, 1370, 0, 0, 0, 0, 0, 0, 6184, 8606,
+ 3303, 41372, 11786, 9473, 66203, 66177, 92446, 11593, 43007, 4478, 66178,
+ 0, 0, 2744, 0, 4477, 118964, 814, 42066, 66183, 66204, 43786, 119961,
+ 66198, 41880, 66188, 66197, 78148, 11955, 66190, 66191, 41111, 66189,
+ 73788, 7788, 4847, 0, 127759, 0, 0, 0, 1581, 6535, 78161, 12954, 430,
+ 78160, 55259, 78158, 128036, 5278, 4945, 42883, 4950, 0, 68625, 0, 7269,
+ 0, 5964, 12908, 0, 0, 74764, 74477, 119146, 194936, 4949, 0, 443, 0,
+ 4944, 5467, 119603, 0, 65137, 6044, 65392, 0, 4213, 0, 41303, 0, 194931,
+ 119962, 41306, 73984, 2698, 127159, 0, 12072, 3193, 0, 41304, 824,
+ 128676, 12091, 78893, 78894, 119816, 4673, 64804, 4678, 119820, 119819,
+ 65059, 0, 6739, 0, 5481, 3490, 1199, 119811, 8356, 119829, 119832, 4677,
+ 12688, 3102, 0, 4672, 78173, 78175, 5531, 68367, 42575, 78170, 78166,
+ 4674, 4548, 44005, 119949, 68658, 119946, 8025, 68630, 127024, 1855, 0,
+ 68669, 0, 92445, 127554, 0, 0, 119652, 2745, 11797, 0, 128159, 9202,
+ 4654, 0, 0, 68638, 73993, 10525, 4649, 65209, 0, 0, 4648, 43080, 0, 0, 0,
+ 6246, 64950, 7828, 4650, 6777, 6776, 6775, 4653, 7822, 78005, 92384,
+ 43187, 8669, 0, 6821, 65093, 0, 78881, 2716, 0, 0, 0, 0, 68369, 120054,
+ 11060, 8547, 2711, 42165, 78027, 78026, 7992, 0, 0, 4662, 78033, 78032,
+ 9149, 9146, 599, 2081, 78031, 78030, 194962, 4656, 10130, 68450, 7811,
+ 40994, 194965, 6414, 5967, 4658, 3725, 5713, 5814, 4661, 42434, 0, 0, 0,
+ 64904, 9026, 10833, 74864, 7547, 4867, 0, 10008, 10222, 3054, 194956,
+ 9744, 78860, 7605, 4622, 119656, 0, 0, 0, 0, 0, 9045, 78888, 4225, 19926,
+ 78887, 12880, 65307, 4617, 78883, 0, 41732, 4616, 10518, 10423, 10359, 0,
+ 5958, 0, 0, 4215, 9789, 917941, 4321, 4621, 0, 41313, 522, 5368, 0,
+ 65803, 0, 5366, 12201, 5372, 0, 0, 0, 7720, 7390, 2696, 0, 0, 4638, 0,
+ 1790, 78242, 5965, 64363, 66569, 68646, 194968, 5376, 1835, 5335, 194966,
+ 128089, 4633, 0, 68119, 1180, 4632, 128093, 5387, 5333, 0, 0, 42094,
+ 5331, 4634, 11928, 0, 5338, 4637, 128170, 5971, 42414, 0, 1268, 65097,
+ 42361, 0, 0, 73853, 1427, 0, 0, 5970, 3431, 0, 10358, 10422, 4758, 0,
+ 1608, 2738, 0, 10455, 4753, 74026, 11344, 4222, 6240, 5231, 74384, 0,
+ 68377, 6248, 0, 0, 0, 42318, 92582, 5229, 4757, 0, 0, 2728, 4752, 64563,
+ 65235, 5234, 0, 128145, 0, 10713, 7166, 0, 2622, 7460, 127302, 0, 0,
+ 8954, 74760, 65189, 2632, 92230, 10108, 1011, 5574, 1853, 2709, 65139,
+ 5577, 0, 0, 118871, 68641, 8965, 7635, 42177, 5316, 0, 5314, 6451, 5572,
+ 0, 5312, 0, 5525, 5330, 5319, 0, 0, 194907, 44003, 0, 0, 0, 120498,
+ 127851, 195009, 0, 74022, 0, 64609, 68643, 120634, 0, 5721, 0, 5519,
+ 8632, 66465, 11267, 73961, 92278, 5720, 0, 1692, 4219, 4610, 8696, 4305,
+ 0, 4609, 43478, 4614, 541, 0, 5287, 5309, 5285, 68389, 5961, 4647, 56,
+ 4216, 10577, 41381, 601, 4613, 0, 0, 92276, 4608, 64260, 41124, 5190,
+ 67628, 0, 68145, 7086, 0, 119243, 67620, 0, 2734, 11074, 0, 67627, 43593,
+ 0, 67625, 5960, 0, 8992, 42593, 128260, 1782, 67622, 68114, 119939, 0,
+ 68180, 5501, 119952, 42508, 7442, 43665, 359, 41253, 68392, 6239, 119956,
+ 41256, 0, 68134, 0, 74209, 917550, 9346, 69660, 41254, 128047, 43291,
+ 3767, 5737, 0, 4865, 0, 5740, 917997, 5736, 4368, 64724, 7193, 68137, 0,
+ 5739, 41024, 4866, 0, 73904, 0, 4869, 120563, 0, 4223, 128201, 6650, 0,
+ 0, 0, 127890, 4870, 120445, 68661, 6716, 78176, 68667, 68382, 68676,
+ 127925, 10122, 4864, 66568, 4144, 7937, 0, 6245, 68652, 2732, 42734, 745,
+ 0, 195097, 92195, 4777, 7821, 0, 68631, 42775, 0, 194954, 0, 3097, 0,
+ 5966, 0, 4778, 0, 10863, 0, 4781, 0, 64407, 0, 0, 8577, 128562, 68196,
+ 43285, 10216, 4782, 0, 0, 120757, 68618, 12325, 43056, 8717, 0, 0, 4776,
+ 73818, 11492, 8700, 0, 13176, 68363, 10426, 0, 917599, 10362, 194706,
+ 1715, 4849, 8242, 9561, 73922, 43278, 42635, 0, 0, 5963, 917926, 0, 0,
+ 4850, 0, 1607, 466, 4853, 118995, 4854, 127918, 5164, 0, 1350, 5124,
+ 64420, 1993, 5362, 8471, 2708, 92471, 12445, 3785, 234, 3199, 0, 41268,
+ 4848, 2530, 917909, 2068, 1964, 0, 73762, 10458, 0, 8576, 78543, 0, 2704,
+ 4794, 0, 68211, 8322, 4797, 5753, 0, 2694, 4792, 0, 2439, 65104, 69804,
+ 0, 303, 0, 92622, 0, 2437, 0, 4221, 4844, 118869, 0, 0, 0, 0, 0, 43292,
+ 0, 2441, 10739, 65090, 0, 119327, 0, 2451, 2714, 119326, 0, 43379, 4937,
+ 43376, 753, 5849, 10597, 43089, 11722, 9248, 92555, 42879, 11725, 0, 0,
+ 2726, 3107, 73958, 4941, 64937, 119233, 9140, 1408, 5261, 4607, 0, 181,
0, 4942, 9539, 4938, 0, 65201, 5259, 9369, 64185, 4142, 5257, 0, 0, 4964,
- 5264, 64178, 64177, 12979, 0, 64182, 64181, 64180, 64179, 9482, 4873,
- 41231, 1822, 42526, 0, 12758, 3865, 0, 0, 10500, 0, 0, 0, 0, 9830, 0,
- 389, 10893, 7521, 0, 4872, 5463, 0, 3125, 9567, 0, 4878, 5459, 4874, 0,
- 9557, 5465, 0, 0, 11494, 0, 9563, 10865, 74570, 43279, 64186, 0, 0,
- 64191, 64190, 8898, 64188, 0, 41030, 0, 0, 917835, 0, 917834, 0, 917837,
- 41031, 0, 11960, 0, 3082, 0, 0, 0, 10573, 0, 7079, 5856, 127043, 5163,
- 127042, 0, 1817, 66724, 0, 0, 10564, 7763, 13077, 41813, 4400, 41745,
+ 5264, 64178, 64177, 12979, 41411, 64182, 64181, 64180, 64179, 9482, 4873,
+ 41231, 1822, 42526, 128581, 12758, 3865, 0, 0, 10500, 0, 0, 78028, 0,
+ 9830, 43642, 389, 10893, 7521, 127879, 4872, 5463, 0, 3125, 9567, 0,
+ 4878, 5459, 4604, 917931, 9557, 5465, 68617, 0, 11494, 0, 9563, 10865,
+ 74570, 43279, 64186, 0, 78714, 64191, 64190, 8898, 64188, 0, 41030,
+ 78836, 0, 917835, 78820, 917834, 0, 78805, 41031, 78801, 11960, 6745,
+ 3082, 0, 78539, 73919, 10573, 41744, 7079, 5856, 127043, 5163, 78809,
+ 128162, 1817, 66724, 78538, 0, 10564, 7763, 13077, 41813, 4400, 41745,
64207, 10275, 8925, 10371, 10307, 41814, 4248, 0, 0, 4541, 6299, 64204,
- 64203, 64201, 64200, 64199, 64198, 0, 42156, 0, 0, 64193, 64192, 0, 0,
- 64197, 64196, 64195, 64194, 13282, 64175, 64174, 64173, 0, 846, 0, 0, 0,
- 0, 0, 0, 2543, 12163, 3108, 9745, 64167, 64166, 64165, 64164, 41743, 0,
- 64169, 64168, 64949, 10972, 10251, 10247, 42768, 715, 64161, 43299, 9453,
- 5348, 10943, 120378, 0, 11352, 550, 9910, 0, 0, 66579, 11551, 0, 0, 9504,
- 7187, 0, 10373, 0, 120791, 10261, 10253, 6404, 10277, 0, 11984, 1552,
- 65222, 6998, 0, 0, 3128, 4789, 5067, 5066, 118849, 4784, 0, 8827, 1146,
- 5065, 0, 0, 68136, 0, 0, 5064, 2431, 0, 9450, 1809, 0, 0, 0, 5062, 1264,
- 64817, 13254, 11697, 0, 9785, 64716, 0, 3933, 74559, 4740, 7954, 0, 0,
- 42609, 0, 74175, 0, 127016, 0, 0, 42130, 0, 5151, 917831, 917823, 0, 0,
- 0, 7620, 3800, 65122, 0, 0, 8355, 7854, 0, 954, 64927, 4185, 41045, 0,
- 41438, 41439, 73978, 10711, 4593, 0, 120584, 0, 64774, 13309, 10532,
- 66727, 0, 0, 0, 64759, 0, 5166, 9888, 0, 5148, 42834, 0, 120634, 118946,
- 64140, 0, 64131, 3119, 917814, 0, 3060, 64135, 9986, 0, 0, 636, 11698, 0,
- 0, 9916, 11701, 7836, 0, 64137, 8320, 118969, 8863, 0, 119960, 1477,
- 43289, 0, 74358, 8618, 0, 9908, 0, 0, 0, 3937, 12312, 0, 0, 0, 64781,
- 912, 10498, 4536, 119963, 74532, 0, 6244, 0, 194580, 3935, 120665, 0, 0,
- 11950, 5392, 42248, 65129, 0, 5397, 0, 12046, 12599, 0, 0, 5395, 0, 5393,
- 354, 0, 119948, 0, 0, 0, 42039, 0, 0, 64142, 626, 0, 5895, 0, 0, 5780, 0,
- 0, 0, 0, 0, 43297, 0, 4311, 4644, 8818, 0, 0, 0, 73818, 3918, 66452,
- 3797, 1644, 119944, 9658, 4140, 11385, 65947, 6455, 9030, 813, 0, 68131,
- 4146, 0, 5360, 2466, 0, 0, 0, 6249, 42117, 0, 0, 0, 0, 74046, 120583,
- 4911, 988, 917809, 0, 0, 0, 7054, 64147, 0, 64920, 917812, 917803,
- 118933, 120349, 0, 0, 11981, 12202, 0, 11032, 120725, 6093, 11608, 975,
- 0, 65843, 170, 0, 0, 4169, 0, 41859, 6058, 120401, 0, 120657, 0, 0, 0,
- 9818, 10178, 10324, 42106, 5898, 74540, 4738, 41856, 7062, 917865, 4737,
- 11779, 4742, 120564, 917866, 73736, 0, 9825, 6448, 12700, 127008, 4831,
- 0, 0, 0, 5300, 4741, 42108, 0, 64159, 4736, 64148, 0, 849, 0, 0, 43288,
- 0, 66620, 0, 0, 65549, 9496, 64598, 0, 0, 7876, 68132, 917872, 3928,
- 917870, 65283, 10706, 7198, 0, 4842, 12053, 0, 0, 4841, 0, 4171, 12008,
- 6251, 3923, 1490, 0, 119591, 0, 40972, 5245, 0, 10114, 42001, 41888,
- 4845, 8332, 40974, 0, 4840, 9077, 917851, 1747, 917849, 4825, 0, 917852,
- 0, 0, 0, 0, 0, 0, 0, 9850, 118937, 367, 1472, 917859, 6687, 1274, 0,
- 5905, 12339, 8919, 73953, 10907, 65261, 11023, 119559, 4830, 9134, 0,
- 64126, 43011, 0, 0, 64101, 0, 0, 4824, 10614, 120390, 0, 1888, 1960,
- 7861, 917856, 0, 41836, 43012, 6052, 6064, 54, 43009, 12214, 0, 6211, 0,
- 358, 41997, 41833, 11442, 10758, 65774, 0, 120384, 64115, 120385, 0, 0,
- 0, 119053, 0, 12765, 64121, 126998, 12962, 0, 0, 4017, 12827, 5241,
+ 64203, 64201, 64200, 64199, 64198, 0, 42156, 78688, 0, 64193, 64192,
+ 65223, 9943, 64197, 64196, 64195, 64194, 13282, 64175, 64174, 64173,
+ 78189, 846, 78186, 9965, 0, 0, 0, 0, 2543, 12163, 3108, 9745, 64167,
+ 64166, 64165, 64164, 2110, 92176, 64169, 64168, 64949, 10972, 10251,
+ 10247, 42768, 715, 64161, 43299, 9453, 5348, 10943, 120378, 0, 11352,
+ 550, 9910, 0, 0, 66579, 11551, 0, 195080, 9504, 7187, 0, 10373, 0,
+ 120791, 10261, 10253, 6404, 10277, 78183, 11984, 1552, 65222, 6998,
+ 78180, 0, 3128, 4789, 5067, 5066, 118849, 4784, 0, 8827, 1146, 5065,
+ 78196, 78192, 68136, 78190, 43412, 5064, 2431, 0, 9450, 1809, 0, 78200,
+ 78201, 5062, 1264, 64817, 13254, 11697, 0, 9785, 64716, 0, 3933, 74559,
+ 4740, 7954, 0, 0, 42609, 0, 74175, 0, 127016, 0, 0, 42130, 0, 5151,
+ 917829, 917823, 0, 0, 0, 7620, 3800, 65122, 0, 0, 8355, 7854, 0, 954,
+ 64927, 4185, 41045, 127141, 41438, 41439, 68666, 10711, 4593, 127745,
+ 120584, 0, 64774, 8053, 10532, 66727, 0, 0, 0, 64759, 6381, 5166, 9888,
+ 127800, 5148, 42834, 0, 78205, 78206, 43787, 78204, 64131, 3119, 917814,
+ 0, 3060, 64135, 9986, 0, 77876, 636, 11698, 0, 0, 9916, 11701, 7836,
+ 42741, 64137, 8320, 78640, 8863, 92431, 119960, 1477, 43289, 0, 74358,
+ 8618, 0, 9908, 0, 0, 0, 3937, 12312, 0, 0, 0, 64781, 912, 6349, 4536,
+ 119963, 74532, 0, 6244, 0, 194580, 3935, 120665, 0, 0, 11950, 5392,
+ 42248, 65129, 68656, 5397, 0, 12046, 12599, 0, 0, 5395, 0, 5393, 354,
+ 68615, 119948, 78503, 0, 0, 42039, 0, 0, 64142, 626, 0, 5895, 0, 0, 5780,
+ 0, 0, 128874, 0, 0, 43297, 0, 4311, 4644, 8818, 0, 128186, 0, 7145, 3918,
+ 66452, 3797, 1644, 92346, 9658, 4140, 11385, 65947, 6455, 9030, 813,
+ 119945, 68131, 4146, 119957, 5360, 2466, 0, 67669, 119942, 6249, 42117,
+ 92287, 128224, 0, 0, 74046, 120583, 4911, 988, 917807, 0, 0, 43061, 7054,
+ 64147, 0, 64920, 68195, 6698, 118933, 92506, 0, 120006, 11981, 12202, 0,
+ 11032, 67654, 6093, 11608, 975, 68662, 65843, 170, 0, 0, 4169, 0, 41859,
+ 6058, 120401, 13203, 120657, 0, 0, 68657, 9818, 10178, 10324, 42106,
+ 5898, 74540, 4738, 41856, 7062, 917865, 4737, 11779, 4742, 120564, 92391,
+ 73736, 0, 9825, 6448, 6715, 127008, 4831, 0, 92525, 0, 5300, 4741, 42108,
+ 0, 64159, 4736, 64148, 0, 849, 92191, 78491, 43288, 0, 66620, 0, 127331,
+ 65549, 9496, 64598, 118866, 0, 7876, 68132, 917872, 3928, 917870, 43378,
+ 10706, 7198, 0, 4842, 12053, 128129, 0, 4841, 0, 4171, 12008, 6251, 3923,
+ 1490, 0, 119591, 0, 40972, 5245, 0, 10114, 42001, 41888, 4845, 8332,
+ 40974, 64347, 4840, 9077, 78346, 1747, 917849, 4825, 69240, 917852,
+ 68655, 0, 0, 0, 0, 68628, 0, 9850, 118937, 367, 1472, 917859, 6687, 1274,
+ 0, 5905, 12339, 8919, 73953, 10907, 65261, 11023, 119559, 4830, 9134,
+ 78666, 64126, 43011, 0, 0, 64101, 0, 0, 4824, 10614, 120390, 0, 1888,
+ 1960, 7861, 917856, 78524, 41836, 43012, 6052, 6064, 54, 43009, 12214, 0,
+ 6211, 0, 358, 41997, 41833, 11442, 10758, 65774, 0, 120384, 64115, 92221,
+ 0, 0, 0, 119053, 0, 12765, 64118, 126998, 12962, 0, 0, 4017, 12827, 5241,
120392, 0, 41118, 3924, 0, 11366, 917843, 0, 0, 917846, 41116, 917844,
- 917845, 0, 11363, 12057, 11917, 1567, 74000, 4721, 0, 66202, 8957, 4139,
- 0, 0, 0, 0, 0, 12740, 0, 4722, 12761, 0, 12759, 4725, 0, 4726, 0, 0, 0,
- 917904, 917905, 0, 12755, 12762, 4015, 0, 8052, 476, 0, 0, 0, 64212,
- 41020, 1382, 64209, 64216, 64215, 64214, 1656, 41831, 0, 0, 41843, 8720,
- 3908, 1452, 13111, 0, 64067, 0, 8552, 64113, 41845, 3849, 0, 66232, 9778,
- 120066, 5891, 7064, 55, 74437, 917911, 0, 0, 7935, 67586, 0, 1114, 0,
- 67585, 120052, 120053, 120050, 120051, 3938, 120057, 65417, 64717,
- 120060, 120061, 65415, 120059, 6292, 65303, 7955, 6452, 4713, 917887,
- 66249, 917885, 917890, 917891, 65152, 719, 120044, 120045, 120042, 41944,
- 4532, 65412, 120046, 10868, 4717, 2349, 5902, 66450, 4712, 917902,
- 917899, 917900, 0, 8155, 4718, 3942, 4714, 9625, 0, 0, 0, 12006, 0, 0, 0,
- 0, 0, 65414, 6454, 1229, 0, 66437, 66025, 917894, 0, 42500, 120508, 4809,
- 9623, 917874, 917879, 917880, 917877, 917878, 65405, 68159, 917881,
- 917882, 5365, 4545, 8901, 917566, 119555, 4813, 0, 0, 5925, 4808, 64330,
- 0, 65475, 0, 0, 4814, 0, 4810, 0, 0, 64928, 10543, 0, 3522, 0, 414,
- 65404, 0, 0, 6456, 73820, 0, 11905, 917883, 0, 0, 0, 74495, 0, 0, 0,
- 118820, 9751, 65407, 0, 11770, 3919, 0, 0, 65061, 0, 0, 0, 12235, 0, 0,
- 0, 66576, 0, 64080, 0, 64090, 0, 0, 10162, 10310, 0, 8454, 0, 42038, 387,
- 41363, 12737, 0, 4780, 0, 0, 64310, 64621, 0, 0, 0, 0, 0, 0, 8896, 0,
- 375, 6976, 0, 119005, 0, 0, 0, 119202, 119203, 12526, 43120, 2315, 0,
- 1938, 119197, 0, 4529, 119200, 119201, 119198, 119199, 0, 0, 0, 13150,
- 64492, 0, 0, 0, 12902, 0, 42891, 66327, 74298, 0, 10799, 0, 2587, 66372,
- 0, 4193, 120334, 4241, 0, 7998, 0, 0, 0, 0, 2316, 118821, 0, 0, 0, 64297,
- 74799, 0, 74140, 0, 5373, 0, 0, 3762, 10015, 0, 119232, 0, 41590, 0, 0,
- 3780, 7485, 5779, 0, 42037, 0, 3906, 12349, 0, 8326, 0, 65498, 3763,
- 6983, 5618, 0, 3779, 0, 43613, 0, 0, 0, 0, 0, 0, 280, 74558, 0, 68138,
- 13072, 1894, 0, 0, 65478, 43310, 7231, 0, 11773, 0, 0, 0, 0, 2551, 0,
- 6453, 10200, 6235, 0, 0, 0, 0, 4470, 0, 0, 7780, 5369, 118958, 5249, 0,
- 5367, 8756, 0, 0, 5377, 120585, 68143, 1688, 0, 0, 0, 0, 0, 0, 0, 41697,
- 41319, 1300, 10650, 41692, 64505, 4668, 0, 119624, 1465, 10850, 3943, 0,
- 41205, 0, 0, 0, 0, 5352, 0, 0, 8839, 41314, 0, 7785, 41204, 0, 41209, 0,
- 0, 43607, 0, 0, 5420, 3897, 0, 0, 74417, 4018, 0, 68127, 0, 0, 0, 0, 0,
- 2561, 0, 3542, 41915, 12076, 7951, 68152, 118857, 5303, 6276, 1706, 0, 0,
- 74116, 0, 65150, 41819, 0, 73951, 10847, 41822, 9985, 860, 0, 10506, 0,
- 0, 10753, 10830, 0, 615, 64490, 7574, 0, 0, 0, 12909, 43016, 64559,
- 127028, 0, 0, 0, 2020, 0, 4022, 0, 0, 0, 0, 41691, 0, 0, 0, 0, 64622,
- 9070, 0, 0, 3911, 42829, 43122, 1033, 0, 0, 7000, 3904, 0, 0, 0, 0,
- 127012, 13123, 10846, 3450, 0, 0, 118807, 0, 42778, 10000, 41088, 449, 0,
- 3777, 0, 0, 9636, 0, 10738, 0, 9367, 593, 41085, 3999, 65226, 41713,
- 12764, 0, 64409, 3596, 0, 0, 9763, 120280, 120283, 12347, 124, 12981,
- 41127, 120278, 0, 0, 0, 0, 10820, 0, 0, 0, 1769, 41715, 2463, 0, 0,
- 12770, 0, 1538, 0, 43124, 0, 195058, 7795, 120300, 0, 4828, 1258, 0,
- 2006, 0, 0, 9498, 127032, 127033, 120289, 120288, 3939, 120290, 8846,
- 8943, 120287, 120286, 2650, 4491, 1961, 42602, 11525, 120292, 1959,
- 120294, 0, 11774, 41016, 0, 0, 0, 1511, 9324, 0, 10519, 66331, 3454,
- 19930, 0, 41019, 0, 0, 65292, 0, 12862, 0, 0, 42143, 41828, 0, 65531, 0,
- 118879, 0, 0, 0, 41826, 8865, 6402, 0, 13279, 7917, 120340, 0, 7733, 0,
- 4998, 0, 0, 41950, 0, 4268, 0, 0, 0, 4013, 0, 10881, 0, 0, 0, 74788,
- 2014, 0, 0, 9765, 0, 0, 0, 195059, 0, 65281, 0, 10949, 0, 0, 0, 2015, 0,
- 0, 0, 66318, 74824, 0, 42517, 0, 0, 0, 0, 8094, 64468, 65909, 6474, 794,
- 0, 12656, 0, 119353, 0, 1665, 0, 4833, 0, 119351, 0, 0, 189, 12611, 0, 0,
- 2859, 4838, 0, 4834, 0, 0, 0, 4837, 0, 770, 0, 811, 0, 41042, 0, 41318,
- 64427, 0, 0, 0, 3895, 0, 74341, 3976, 0, 42859, 10193, 3116, 7747, 0, 0,
- 0, 0, 0, 0, 0, 41877, 0, 2871, 64614, 0, 999, 0, 68177, 41876, 2663,
- 2017, 0, 0, 11040, 10150, 0, 64308, 1522, 597, 4775, 12555, 12571, 12550,
- 12583, 12560, 2019, 12556, 12584, 3092, 0, 12562, 4783, 12566, 12569,
- 12554, 0, 10812, 0, 0, 0, 3078, 1402, 0, 0, 0, 0, 0, 394, 3088, 0, 0, 0,
- 3991, 64391, 0, 0, 424, 66328, 1999, 0, 73914, 0, 0, 0, 0, 0, 8246, 0, 0,
- 0, 41840, 0, 2377, 1298, 64011, 12572, 11318, 12557, 12559, 12570, 8488,
- 1003, 2373, 9446, 9447, 9448, 48, 0, 9480, 481, 0, 9438, 9439, 9440,
- 9441, 8465, 9443, 9444, 9445, 9430, 9431, 9432, 9433, 9434, 9435, 3984,
- 9437, 0, 0, 9424, 9425, 9426, 9427, 9428, 9429, 64758, 0, 9655, 0, 2004,
- 9096, 9782, 0, 9172, 0, 19965, 0, 5955, 120485, 1108, 0, 74773, 0, 0,
- 64782, 3926, 0, 65210, 8798, 0, 0, 1392, 0, 0, 917557, 10606, 8065,
- 118805, 10353, 10417, 0, 0, 64524, 0, 4019, 0, 0, 43280, 8219, 0, 1812,
- 0, 0, 0, 0, 42410, 74448, 119132, 6054, 10697, 3169, 42297, 42322, 10642,
- 3909, 74461, 0, 0, 0, 0, 0, 0, 1049, 0, 65707, 11943, 41806, 0, 42336,
- 3921, 0, 11775, 64760, 11766, 1038, 42303, 9823, 0, 0, 4008, 64004, 8773,
- 10733, 36, 0, 5153, 41805, 0, 73735, 763, 41808, 64910, 0, 2009, 0, 0, 0,
+ 917564, 0, 11363, 12057, 11917, 1567, 74000, 4721, 0, 66202, 8957, 4139,
+ 0, 0, 0, 0, 0, 12740, 128702, 4722, 6816, 127793, 12759, 4725, 0, 4726,
+ 0, 0, 0, 917904, 917905, 0, 12755, 12762, 4015, 0, 8052, 476, 0, 0,
+ 128294, 64212, 41020, 1382, 64209, 64216, 64215, 64214, 1656, 41831, 0,
+ 0, 41843, 8720, 3908, 1452, 13111, 0, 64067, 127328, 8552, 64113, 41845,
+ 3849, 78732, 66232, 9778, 120066, 5891, 7064, 55, 9948, 119085, 0, 0,
+ 7935, 2420, 0, 1114, 92599, 67585, 78675, 120053, 92350, 120051, 3938,
+ 120057, 65417, 64717, 120060, 120061, 65415, 120059, 6292, 65303, 7955,
+ 6452, 4713, 128196, 66249, 917885, 917890, 917891, 65152, 719, 120044,
+ 78623, 120042, 6713, 4532, 65412, 69822, 10868, 4717, 2349, 5902, 66450,
+ 4712, 917902, 917899, 917900, 65416, 8155, 4718, 3942, 4714, 9625, 0,
+ 6383, 194744, 12006, 128565, 0, 0, 0, 0, 65414, 6454, 1229, 0, 66437,
+ 66025, 78699, 0, 42500, 120508, 4809, 9623, 917874, 78694, 917880,
+ 917877, 917878, 65405, 68159, 12893, 917882, 5365, 4545, 8901, 92421,
+ 119555, 4813, 128262, 0, 5925, 4808, 64330, 0, 65475, 118940, 195028,
+ 4814, 0, 4810, 0, 0, 64928, 10543, 0, 3522, 0, 414, 65404, 0, 195027,
+ 6456, 73820, 0, 6691, 42193, 92225, 128171, 0, 74495, 0, 0, 0, 118820,
+ 9751, 65407, 128085, 11770, 3919, 0, 0, 65061, 0, 0, 0, 12235, 0, 0,
+ 127233, 64092, 0, 64080, 0, 64090, 0, 0, 10162, 10310, 0, 8454, 127888,
+ 42038, 387, 41363, 12737, 0, 4780, 43368, 0, 64310, 64621, 6732, 0, 0, 0,
+ 0, 0, 8896, 0, 375, 6976, 66582, 119005, 0, 0, 0, 119202, 119203, 12526,
+ 43120, 2315, 0, 1938, 119197, 0, 4529, 119200, 119201, 119198, 119199,
+ 69692, 0, 69698, 13150, 64492, 0, 0, 0, 12902, 0, 42891, 66327, 74298, 0,
+ 10799, 69690, 2587, 66372, 0, 4193, 92250, 4241, 0, 7998, 0, 0, 0, 0,
+ 2316, 118821, 0, 0, 0, 64297, 74799, 92442, 74140, 0, 5373, 0, 0, 3762,
+ 10015, 127335, 119232, 0, 41590, 0, 92378, 3780, 7485, 5779, 0, 42037, 0,
+ 3906, 12349, 0, 8326, 0, 65498, 3763, 6983, 5618, 0, 3779, 0, 43613, 0,
+ 0, 0, 0, 0, 0, 280, 74558, 127332, 68138, 13072, 1894, 0, 0, 65478,
+ 43310, 7231, 0, 11773, 0, 0, 0, 0, 2551, 0, 6453, 10200, 6235, 0, 119237,
+ 0, 128805, 4470, 119613, 917557, 7780, 5369, 118958, 5249, 0, 5367, 8756,
+ 127143, 0, 5377, 120585, 68143, 1688, 78245, 0, 69685, 0, 0, 0, 44020,
+ 6808, 41319, 1300, 10650, 41692, 64505, 4668, 0, 119624, 1465, 10850,
+ 3943, 0, 41205, 41315, 118961, 0, 0, 5352, 0, 0, 8839, 41314, 7384, 7785,
+ 41204, 127322, 41209, 69637, 92241, 43607, 0, 0, 5420, 3897, 10134, 0,
+ 74417, 4018, 7150, 68127, 0, 0, 0, 0, 127526, 2561, 68621, 3542, 7148,
+ 12076, 7951, 68152, 118857, 5303, 6276, 1706, 0, 78751, 7146, 0, 65150,
+ 41819, 0, 73951, 10847, 41822, 9985, 860, 0, 10506, 0, 69641, 10753,
+ 10830, 0, 615, 64490, 7574, 92617, 77922, 0, 12909, 43016, 64559, 127028,
+ 0, 0, 0, 2020, 0, 4022, 128783, 0, 77923, 0, 41691, 0, 0, 74329, 0,
+ 64622, 9070, 0, 68411, 3911, 42829, 43122, 1033, 74440, 0, 7000, 3904, 0,
+ 128198, 0, 118931, 119630, 13123, 10846, 3450, 127360, 7397, 118807, 0,
+ 42778, 10000, 41088, 449, 0, 3777, 68458, 0, 9636, 0, 10738, 69634, 9367,
+ 593, 41085, 3999, 65226, 41713, 12764, 0, 64409, 3596, 0, 0, 9763,
+ 120280, 92192, 12347, 124, 12981, 41127, 2092, 92687, 0, 0, 0, 10820,
+ 43987, 0, 0, 1769, 41715, 2463, 78489, 0, 12770, 0, 1538, 0, 43124, 0,
+ 195058, 7795, 120300, 0, 4828, 1258, 127802, 2006, 0, 0, 9498, 127032,
+ 127033, 120289, 120288, 3939, 120290, 8846, 8943, 120287, 120286, 2650,
+ 4491, 1961, 42602, 11525, 120292, 1959, 120294, 55228, 11774, 41016, 0,
+ 68675, 128054, 1511, 9324, 78211, 10519, 66331, 3454, 19930, 0, 41019, 0,
+ 0, 65292, 6822, 12862, 0, 0, 42143, 41828, 78207, 65531, 78208, 118879,
+ 55223, 0, 0, 41826, 8865, 6402, 0, 13279, 7917, 120340, 0, 7733, 0, 4998,
+ 0, 92332, 41950, 0, 4268, 0, 0, 0, 4013, 0, 10881, 0, 0, 0, 74788, 2014,
+ 0, 0, 9765, 0, 0, 0, 195059, 78357, 65281, 127825, 10949, 0, 0, 0, 2015,
+ 0, 0, 0, 66318, 43233, 0, 42517, 0, 0, 0, 12698, 8094, 10135, 65909,
+ 6474, 794, 0, 12656, 128122, 119353, 128270, 1665, 0, 4833, 0, 119351,
+ 127367, 0, 189, 12611, 0, 0, 2859, 4838, 0, 4834, 65078, 0, 0, 4837,
+ 127061, 770, 0, 811, 0, 41042, 917551, 41318, 64427, 0, 0, 78848, 3895,
+ 0, 74341, 3976, 0, 42859, 10193, 3116, 7747, 0, 0, 0, 0, 0, 43686, 78846,
+ 41877, 0, 2871, 64614, 128785, 999, 0, 6345, 41876, 2663, 2017, 0, 0,
+ 11040, 10150, 0, 64308, 1522, 597, 4775, 12555, 12571, 12550, 12583,
+ 12560, 2019, 12556, 12584, 3092, 0, 12562, 4783, 12566, 12569, 12554, 0,
+ 10812, 78851, 0, 0, 3078, 1402, 0, 128275, 0, 0, 119248, 394, 3088, 0,
+ 92172, 0, 3991, 64391, 0, 0, 424, 66328, 1999, 69659, 73914, 0, 0, 0, 0,
+ 42231, 8246, 0, 0, 0, 41840, 0, 2377, 1298, 64011, 12572, 11318, 12557,
+ 12559, 12570, 8488, 1003, 2373, 9446, 7481, 9448, 48, 0, 9480, 481, 0,
+ 9438, 9439, 9440, 9441, 8465, 9443, 9444, 9445, 9430, 9431, 9432, 9433,
+ 9434, 9435, 3984, 9437, 0, 0, 9424, 9425, 9426, 9427, 9428, 9429, 64758,
+ 2362, 9655, 0, 2004, 9096, 9782, 128848, 9172, 128545, 19965, 0, 5955,
+ 67666, 1108, 0, 74773, 0, 0, 64782, 3926, 92448, 65210, 8798, 0, 92165,
+ 1392, 0, 0, 127364, 10606, 8065, 118805, 10353, 10417, 0, 0, 64524,
+ 92418, 4019, 0, 0, 43280, 8219, 68402, 1812, 0, 0, 0, 0, 42410, 74448,
+ 119132, 6054, 10697, 3169, 42297, 42322, 10642, 3909, 9950, 0, 128139, 0,
+ 68678, 0, 0, 1049, 0, 65707, 2304, 41806, 92326, 42336, 3921, 0, 11775,
+ 64760, 11766, 1038, 42303, 9823, 127278, 69236, 4008, 64004, 8773, 10733,
+ 36, 0, 5153, 41805, 0, 73735, 763, 41808, 64910, 0, 2009, 0, 0, 127142,
9640, 119951, 0, 120695, 8621, 0, 12852, 3031, 0, 64361, 0, 182, 194718,
- 0, 0, 0, 0, 9058, 366, 0, 9892, 5969, 11754, 10848, 4570, 65301, 0, 4255,
- 0, 10102, 41189, 4003, 41026, 68109, 13293, 41192, 0, 0, 42251, 0, 42534,
- 0, 11287, 6128, 0, 11034, 10923, 64423, 0, 65506, 0, 0, 74083, 0, 66582,
- 0, 0, 119955, 0, 9817, 0, 0, 0, 12117, 66586, 4183, 10540, 66250, 127044,
- 127045, 0, 0, 0, 12897, 3792, 2011, 0, 6065, 43160, 0, 194715, 8692,
- 41186, 41816, 41023, 41818, 41187, 11659, 7922, 12614, 2005, 8523,
- 120144, 0, 7513, 1863, 4710, 0, 5956, 7621, 120274, 127116, 4705, 716, 0,
- 0, 4704, 120040, 120270, 42241, 161, 0, 74546, 66214, 4706, 0, 0, 120037,
- 4709, 10680, 0, 43293, 0, 0, 119164, 0, 0, 0, 1700, 119223, 0, 0, 0,
- 4004, 0, 10968, 43296, 0, 8506, 0, 0, 126996, 1005, 937, 120030, 4734,
- 2870, 0, 120032, 0, 7463, 4729, 0, 235, 1384, 4728, 0, 120420, 120644, 0,
- 8109, 43105, 0, 4730, 447, 13186, 1513, 4733, 120415, 0, 0, 42527, 12911,
- 0, 1383, 8565, 2469, 120024, 119089, 6156, 68117, 0, 7993, 4288, 120416,
- 2674, 13238, 11922, 0, 120330, 3510, 13234, 0, 120407, 5605, 42095,
- 11364, 0, 1380, 65617, 120320, 120261, 13196, 13197, 120309, 120682,
- 9495, 119346, 0, 5959, 0, 73976, 120305, 0, 6941, 119349, 13205, 13211,
- 5801, 12769, 65905, 120316, 1283, 120302, 4779, 0, 3719, 4006, 0, 19957,
- 0, 2021, 119332, 0, 0, 43028, 65493, 41838, 3875, 5962, 64341, 119339,
- 9814, 43571, 5827, 3314, 7787, 0, 65494, 68153, 0, 0, 120636, 64531, 0,
- 0, 0, 0, 0, 65467, 5771, 41298, 0, 9742, 521, 0, 10800, 0, 8404, 194625,
- 483, 7096, 7089, 66323, 928, 0, 0, 0, 10599, 11586, 3989, 10971, 0,
- 65782, 9841, 8843, 12145, 0, 10074, 120816, 0, 3769, 0, 0, 0, 0, 9573, 0,
- 65290, 8849, 0, 65855, 65112, 1796, 0, 0, 0, 8164, 41301, 3502, 0, 0,
- 10621, 73838, 0, 5825, 13007, 68165, 0, 0, 12661, 7608, 10354, 10418,
- 42411, 2022, 0, 1409, 12195, 4001, 3112, 10824, 120639, 1390, 0, 0, 421,
- 43536, 5846, 120120, 4130, 0, 7595, 42588, 7600, 0, 66035, 0, 0, 65851,
- 42607, 0, 0, 3168, 0, 42134, 0, 2370, 2846, 0, 0, 0, 120132, 0, 1836, 0,
- 0, 119137, 3740, 0, 6290, 65374, 120451, 65923, 3944, 66628, 120434, 0,
- 6135, 3118, 74265, 119093, 120446, 0, 0, 8127, 8975, 64739, 7943, 0, 0,
- 10618, 2584, 0, 0, 0, 9998, 0, 0, 0, 0, 0, 6204, 0, 0, 8279, 8776, 64954,
- 4975, 74809, 0, 4267, 0, 0, 0, 0, 195046, 65700, 66562, 0, 64645, 0, 0,
- 0, 12586, 0, 9242, 0, 0, 4523, 5842, 10495, 3122, 0, 7793, 0, 9328, 0, 0,
- 12604, 0, 6615, 0, 0, 3986, 0, 0, 8912, 64555, 0, 0, 0, 9541, 0, 0,
- 11275, 8540, 11498, 0, 0, 41040, 2459, 0, 13060, 41041, 74413, 0, 0, 0,
- 0, 10450, 12551, 41043, 7020, 120353, 3765, 0, 0, 1606, 120348, 120351,
- 3093, 0, 0, 0, 120649, 0, 0, 4312, 74091, 120337, 120336, 11923, 4023,
- 120333, 5763, 120335, 4827, 10894, 12810, 64406, 118785, 4455, 74321,
- 433, 119620, 66660, 2499, 0, 0, 0, 11973, 13089, 4293, 120329, 120328,
- 42758, 12196, 42837, 0, 119319, 0, 0, 5817, 0, 0, 3120, 9797, 0, 0, 0,
- 10389, 0, 0, 4895, 65358, 0, 4359, 585, 0, 3509, 0, 486, 4290, 0, 0, 0,
- 0, 7004, 0, 65880, 0, 119048, 2380, 11380, 0, 0, 2376, 0, 0, 0, 5197,
- 127046, 127047, 127048, 2366, 127050, 127051, 127052, 0, 0, 0, 0, 0, 0,
- 0, 0, 74188, 0, 0, 0, 0, 0, 0, 0, 120049, 0, 1847, 0, 10339, 0, 42384, 0,
- 4227, 74158, 0, 0, 43032, 0, 42365, 0, 12671, 11384, 0, 0, 0, 64797, 0,
- 5820, 0, 0, 120065, 0, 120064, 120650, 42137, 9893, 2754, 12664, 120063,
- 0, 13192, 0, 41799, 65530, 1711, 12984, 43039, 3114, 6255, 0, 118938, 0,
- 10853, 926, 0, 74184, 0, 120055, 0, 43175, 0, 43037, 41798, 41035, 11583,
- 0, 41801, 119088, 0, 520, 4200, 12699, 8331, 0, 3091, 41034, 0, 0, 8360,
- 0, 0, 321, 4229, 64543, 0, 65563, 0, 0, 2861, 0, 10095, 0, 0, 0, 1861, 0,
- 0, 0, 0, 43041, 0, 0, 0, 3859, 12181, 41660, 8209, 0, 120678, 12973, 0,
- 74757, 0, 41658, 0, 0, 5760, 0, 743, 4414, 120766, 0, 42632, 917973,
- 65161, 73896, 0, 0, 1405, 119063, 43220, 43341, 0, 19919, 0, 64532,
- 65367, 0, 0, 0, 3513, 0, 118883, 43342, 119064, 65529, 65364, 0, 0, 6485,
- 1397, 0, 65365, 0, 0, 0, 0, 0, 7471, 12079, 0, 12682, 43287, 0, 0, 0, 0,
- 0, 0, 1099, 10490, 0, 10501, 65181, 74463, 0, 464, 41624, 119594, 0, 0,
- 1346, 0, 917631, 64724, 64897, 423, 1818, 65144, 0, 8272, 0, 0, 4218,
- 3087, 64960, 0, 43564, 0, 0, 9584, 10465, 0, 74359, 12626, 9106, 0,
- 42642, 0, 64750, 9390, 0, 41797, 0, 0, 265, 41795, 64666, 0, 43530, 2752,
- 0, 0, 0, 59, 0, 0, 0, 0, 0, 41810, 0, 7010, 0, 41809, 41495, 119364, 0,
- 42252, 0, 8009, 3305, 43033, 511, 119320, 66255, 13127, 120067, 0, 0, 0,
- 917977, 65915, 1400, 41812, 10685, 194870, 41211, 10387, 4453, 43276,
- 917783, 13159, 0, 6481, 41213, 0, 0, 0, 0, 41983, 74198, 6617, 9116, 0,
- 0, 462, 68110, 10493, 0, 8129, 0, 0, 74471, 6644, 11658, 0, 0, 3452,
- 11906, 9581, 1385, 3098, 0, 119013, 43340, 0, 41033, 6493, 42626, 0, 0,
- 11426, 0, 1681, 118789, 1204, 3755, 64661, 7235, 10170, 3966, 8911, 0,
- 41841, 43338, 0, 0, 5726, 64915, 42175, 0, 0, 41497, 65044, 0, 2851,
- 43017, 0, 0, 4373, 0, 0, 9587, 1789, 6671, 0, 3100, 0, 65360, 0, 0, 0,
- 64922, 0, 8190, 12083, 0, 0, 6506, 64312, 74374, 2368, 0, 4419, 0, 0,
- 3439, 1825, 1192, 120106, 8891, 3080, 120228, 2347, 5430, 0, 8990, 2848,
- 0, 0, 0, 249, 0, 0, 0, 120658, 0, 0, 8883, 917802, 728, 68178, 995, 0, 0,
- 64826, 0, 917798, 0, 0, 19945, 8091, 558, 0, 12273, 0, 0, 12112, 0, 0, 0,
- 74419, 12335, 120104, 917795, 3443, 3129, 0, 12913, 65445, 0, 64891, 0,
- 7725, 0, 0, 0, 8624, 0, 12446, 43295, 0, 41894, 0, 6277, 41672, 41893,
- 10010, 0, 3540, 0, 835, 0, 0, 119868, 74408, 0, 73959, 5426, 4258, 0, 0,
- 5424, 0, 8283, 0, 5434, 0, 0, 19917, 11408, 0, 11947, 0, 1404, 3095,
- 11432, 0, 3464, 6486, 4819, 0, 0, 570, 8095, 3672, 119864, 1498, 0, 0, 0,
- 431, 0, 0, 0, 0, 68167, 0, 13096, 0, 0, 0, 9516, 0, 5268, 0, 0, 0, 4450,
- 120723, 11547, 64358, 0, 356, 3477, 227, 10488, 0, 382, 11418, 0, 0, 0,
- 0, 0, 0, 6484, 2541, 66039, 0, 0, 0, 3549, 0, 9110, 119665, 2743, 0,
- 43290, 194812, 9097, 0, 43015, 8782, 0, 776, 2524, 0, 8573, 0, 0, 0, 0,
- 120572, 64944, 8952, 3856, 118818, 0, 5872, 6495, 0, 0, 0, 0, 0, 120733,
- 12849, 3953, 1897, 0, 0, 11994, 4339, 74556, 0, 67843, 0, 0, 0, 74251, 0,
- 5228, 0, 7868, 43184, 0, 0, 73986, 0, 0, 43022, 0, 1162, 0, 2671, 0, 0,
- 0, 0, 118865, 4553, 73811, 0, 195005, 0, 0, 19921, 74331, 11424, 0, 4567,
- 41891, 0, 0, 119056, 4820, 65239, 194662, 0, 0, 43042, 119212, 1377, 0,
- 4897, 42821, 9250, 0, 4438, 64385, 0, 1753, 11331, 6147, 0, 43282, 8833,
- 0, 0, 6504, 194667, 126979, 10719, 0, 1898, 1413, 42443, 0, 802, 12141,
- 0, 0, 6648, 10671, 2528, 0, 64789, 9169, 838, 127092, 120697, 844, 5014,
- 0, 256, 0, 9990, 0, 43301, 0, 7542, 65464, 9726, 0, 6489, 10048, 74326,
- 0, 66573, 0, 0, 0, 11761, 194655, 0, 41094, 0, 0, 0, 0, 0, 6196, 6945,
- 194628, 194890, 194631, 120491, 11816, 194943, 5733, 0, 0, 0, 41098, 0,
- 41093, 0, 66626, 588, 9760, 0, 194717, 1238, 200, 0, 1660, 73916, 0,
- 118905, 74362, 0, 0, 194651, 0, 0, 3394, 0, 120668, 0, 0, 0, 66219, 0,
- 43284, 0, 7817, 1841, 11055, 120533, 194979, 194982, 1669, 10776, 194981,
- 7701, 194980, 0, 194995, 1732, 4030, 0, 3963, 66611, 0, 41768, 6491, 0,
- 65324, 914, 65323, 8071, 3538, 0, 0, 0, 0, 74367, 7614, 0, 11819, 0,
- 12009, 12399, 0, 67852, 65537, 0, 10841, 0, 5301, 0, 0, 5734, 8960, 0, 0,
- 65317, 0, 0, 0, 0, 12304, 0, 0, 65315, 0, 0, 0, 0, 0, 119621, 0, 74536,
- 12447, 64486, 0, 0, 0, 0, 0, 0, 42767, 10915, 0, 12007, 0, 120520, 0,
- 194878, 0, 0, 0, 8629, 0, 43168, 41872, 0, 4496, 0, 0, 0, 0, 0, 0, 0,
- 64730, 0, 66714, 0, 0, 0, 65596, 0, 11416, 4280, 119018, 8765, 12784,
- 7792, 1393, 0, 67871, 74386, 0, 8233, 43572, 0, 6683, 0, 3442, 12144,
- 2841, 12543, 0, 1473, 42820, 64329, 917772, 0, 0, 6488, 357, 1048, 41100,
- 0, 41104, 0, 41099, 1054, 119065, 1040, 65450, 0, 4434, 1069, 0, 0,
- 74231, 917765, 0, 0, 0, 9693, 41943, 0, 41931, 41759, 12757, 4353, 0,
- 1059, 9790, 8995, 0, 0, 65937, 0, 41764, 10646, 0, 118833, 0, 0, 74830,
- 0, 12743, 0, 6480, 917761, 41779, 42580, 66601, 12207, 119619, 10986,
- 66602, 11312, 64807, 0, 0, 41767, 0, 0, 43020, 0, 3955, 74254, 0, 0,
- 917861, 0, 120735, 9770, 9246, 12230, 0, 0, 0, 10448, 41783, 41786,
- 127093, 12797, 2755, 64571, 194912, 194927, 4857, 0, 4428, 12794, 73755,
- 0, 0, 0, 0, 0, 5747, 194720, 0, 7978, 41092, 74571, 0, 11924, 74205,
- 42144, 65015, 0, 563, 0, 0, 12798, 11271, 57, 0, 0, 0, 119043, 0, 0,
- 43137, 694, 0, 9876, 0, 119168, 0, 0, 64537, 0, 277, 74385, 7229, 74459,
- 0, 0, 64634, 64811, 8757, 119087, 0, 1574, 194633, 0, 2525, 4852, 5749,
- 0, 13027, 42824, 120574, 1039, 9801, 10155, 5745, 188, 41858, 11592, 0,
- 74015, 0, 41853, 4858, 0, 0, 436, 4771, 0, 2786, 0, 4856, 8051, 0,
- 119609, 0, 9644, 0, 0, 0, 194916, 120732, 66710, 118834, 0, 73906, 0,
- 127114, 0, 10234, 5843, 11939, 0, 42157, 0, 3157, 194918, 0, 0, 3504,
- 119178, 0, 10822, 5149, 66029, 10226, 65142, 0, 3594, 42424, 0, 40,
- 12657, 0, 0, 386, 0, 8834, 0, 12815, 43574, 0, 73907, 0, 74196, 7220,
- 74504, 0, 74316, 0, 0, 4304, 74503, 8160, 0, 194753, 0, 0, 0, 1348, 0, 0,
- 0, 13303, 0, 0, 194755, 7599, 1278, 0, 13269, 0, 0, 74387, 0, 0, 74492,
- 6097, 7568, 8780, 4982, 0, 74501, 194763, 0, 194762, 2672, 3735, 194735,
- 13138, 42266, 9484, 10724, 41202, 119024, 0, 0, 0, 9487, 0, 194765, 3842,
- 195034, 195056, 12442, 6193, 9791, 0, 0, 42516, 7228, 7559, 74803,
- 194689, 194851, 11399, 119219, 194856, 194855, 0, 194857, 3604, 0, 0, 0,
- 0, 0, 42507, 1962, 194861, 194696, 42505, 11660, 0, 0, 0, 6995, 74173,
- 5437, 74174, 10669, 8702, 7964, 194706, 0, 199, 194843, 4105, 194845,
- 194701, 194847, 194710, 119875, 13148, 7560, 0, 9226, 0, 195070, 6472,
- 65814, 73954, 0, 4724, 0, 0, 9191, 0, 0, 0, 0, 195024, 10196, 7886, 0,
- 6585, 0, 6680, 195042, 0, 195051, 6679, 74412, 0, 194866, 74421, 11382,
- 0, 0, 0, 0, 194833, 194832, 6681, 194834, 12693, 194836, 194839, 194838,
- 194841, 194840, 65442, 119610, 118887, 12166, 74415, 66248, 194816, 0,
- 194818, 194817, 194820, 194819, 5297, 7042, 13284, 6112, 7968, 194825,
- 73929, 194738, 194736, 65746, 0, 74409, 74389, 194826, 4342, 42839,
- 194831, 1677, 0, 0, 0, 917855, 11091, 11011, 2719, 0, 0, 0, 64495, 0, 0,
- 7585, 65169, 42845, 4308, 917858, 74177, 7505, 543, 64916, 64736, 0, 0,
- 66670, 0, 118922, 19911, 0, 43158, 7902, 0, 65265, 194639, 0, 0, 0, 0, 0,
- 0, 12994, 0, 10828, 0, 6228, 4307, 3482, 0, 0, 0, 0, 506, 74573, 41194,
- 65735, 0, 0, 41195, 0, 8169, 0, 8841, 0, 516, 0, 41197, 119051, 34, 0,
- 120186, 120185, 1612, 74333, 120182, 120181, 74308, 12001, 120178, 10242,
- 64564, 120179, 120174, 6584, 7749, 11037, 0, 1758, 0, 10667, 10560,
- 120197, 120756, 1935, 11517, 120193, 120196, 120195, 1931, 120189, 74839,
- 120191, 1217, 64702, 12643, 825, 0, 194905, 12294, 0, 194908, 9138,
- 194910, 194902, 12631, 194911, 11080, 74554, 0, 5591, 1239, 0, 11313, 0,
- 3403, 0, 0, 64364, 0, 0, 74582, 8998, 12988, 0, 9152, 0, 0, 194898,
- 67589, 41850, 64290, 3433, 0, 12615, 1594, 65607, 6914, 67603, 0, 119569,
- 74565, 41353, 67602, 67611, 4337, 0, 194897, 918, 65035, 41351, 7681,
- 194900, 42577, 41393, 12668, 194904, 2477, 0, 0, 0, 0, 67604, 194880, 0,
- 573, 194881, 194884, 11417, 194886, 194885, 194888, 67599, 0, 194889,
- 67607, 11482, 0, 0, 3357, 0, 194891, 4207, 1288, 194892, 194895, 194894,
- 0, 11589, 66354, 194872, 0, 0, 64602, 194670, 0, 0, 42788, 0, 64480,
- 194875, 8423, 3348, 448, 194879, 9717, 0, 0, 997, 0, 0, 0, 0, 11440,
- 11379, 42000, 13139, 0, 65013, 126999, 0, 73796, 0, 0, 12035, 0, 2818, 0,
- 0, 73793, 0, 4172, 0, 0, 8373, 10873, 12197, 0, 0, 0, 0, 0, 126977, 0, 0,
- 194865, 126982, 74563, 64828, 11419, 194868, 766, 1257, 0, 0, 11381,
- 3265, 66617, 3274, 0, 0, 0, 0, 0, 41989, 0, 0, 0, 3263, 0, 65672, 0,
- 3270, 64539, 11489, 0, 0, 0, 0, 9505, 65518, 0, 756, 195052, 0, 0, 0,
- 7261, 0, 186, 0, 119156, 5770, 13179, 65830, 12612, 12949, 64856, 12800,
- 0, 74203, 64718, 0, 0, 0, 118929, 0, 11578, 0, 119296, 0, 0, 0, 0, 74568,
- 9254, 0, 1794, 120217, 64521, 5624, 120220, 120221, 119958, 120223, 3617,
- 66636, 64886, 120211, 120212, 120213, 120214, 1872, 66508, 120467, 41079,
- 10748, 5502, 119330, 4452, 0, 0, 0, 4511, 0, 0, 0, 11425, 0, 0, 1231, 0,
- 0, 0, 9003, 8192, 0, 5305, 9653, 10616, 8694, 9546, 0, 0, 120478, 120200,
- 65205, 120202, 64063, 9878, 74780, 119626, 120207, 64058, 8799, 42131, 0,
- 64062, 1028, 64060, 64059, 837, 10567, 0, 43103, 0, 0, 11427, 2902,
- 64043, 64042, 66464, 10756, 0, 42606, 64045, 64044, 0, 10076, 64040,
- 64039, 0, 1034, 3392, 0, 43091, 64033, 64032, 65468, 64038, 64037, 64036,
- 64035, 4291, 194928, 64015, 64014, 64681, 194930, 0, 194944, 0, 43090, 0,
- 3476, 8973, 64012, 42473, 64010, 64008, 64007, 2003, 7706, 64517, 119183,
- 2538, 64009, 204, 0, 4802, 4111, 8239, 9098, 4805, 64001, 64057, 7885,
- 7247, 64054, 0, 0, 4767, 9343, 64049, 64048, 120034, 1133, 64053, 64052,
- 64051, 64050, 41340, 0, 0, 10005, 12329, 41333, 0, 8489, 1942, 0, 0,
- 42520, 0, 0, 0, 10760, 64023, 64022, 64021, 6582, 0, 0, 64025, 9167,
- 42151, 0, 0, 2026, 64019, 64018, 64017, 64016, 12768, 0, 7582, 0, 118915,
- 0, 0, 0, 0, 120539, 0, 41411, 13094, 0, 7532, 41414, 0, 3179, 0, 64769,
- 0, 0, 11461, 74454, 10751, 9051, 0, 0, 10535, 0, 0, 0, 2008, 64031,
- 64030, 294, 41874, 0, 126991, 65929, 0, 0, 0, 0, 64028, 8146, 64026,
- 41788, 194844, 0, 118795, 0, 119887, 119888, 0, 119886, 119891, 119892,
- 119889, 11433, 119895, 119896, 0, 7801, 65578, 0, 12915, 0, 3297, 9699,
- 0, 1135, 0, 0, 0, 1995, 7927, 0, 0, 2552, 41546, 60, 0, 8649, 41549, 0,
- 0, 0, 6682, 0, 0, 64710, 41547, 0, 2013, 0, 119899, 119900, 119897,
- 119898, 12832, 119904, 8081, 8362, 3537, 119908, 9137, 119906, 8999, 0,
- 119909, 3466, 0, 0, 1996, 0, 3453, 6282, 0, 2002, 2000, 120175, 537, 0,
- 4179, 65119, 1998, 0, 1842, 0, 0, 9628, 0, 12081, 9826, 64502, 1767, 0,
- 0, 0, 120201, 0, 0, 0, 3059, 0, 120204, 119953, 120205, 0, 0, 0, 4100,
- 920, 1811, 1355, 0, 0, 3592, 10078, 0, 0, 0, 8592, 65870, 68164, 0,
- 10742, 0, 0, 1994, 9281, 3296, 12865, 1997, 1895,
+ 92716, 92598, 119950, 0, 9058, 366, 0, 9892, 5969, 11754, 10848, 4570,
+ 65301, 44013, 4255, 0, 10102, 41189, 4003, 41026, 68109, 13293, 41192,
+ 69635, 0, 42251, 0, 42534, 65179, 11287, 6128, 0, 11034, 10923, 64423, 0,
+ 65506, 0, 65861, 74083, 92600, 9932, 0, 92423, 119955, 0, 9817, 0,
+ 120140, 0, 12117, 66586, 4183, 10540, 66250, 9063, 127045, 0, 119954, 0,
+ 12897, 3792, 2011, 0, 6065, 43160, 0, 194715, 8692, 41186, 41816, 41023,
+ 41818, 41187, 11659, 7922, 12614, 2005, 8523, 78002, 0, 7513, 1863, 4710,
+ 0, 5956, 7621, 78006, 92624, 4705, 716, 78004, 0, 4704, 120040, 120270,
+ 42241, 161, 43977, 74546, 66214, 4706, 0, 0, 42672, 4709, 10680, 0,
+ 43293, 119944, 0, 119164, 120328, 92467, 0, 1700, 119223, 0, 0, 128119,
+ 4004, 0, 10968, 43296, 0, 8506, 0, 0, 126996, 1005, 937, 78216, 4734,
+ 2870, 0, 78218, 0, 7463, 4729, 0, 235, 1384, 4728, 0, 120420, 92490,
+ 120331, 8109, 43105, 0, 4730, 447, 13186, 1513, 4733, 120415, 0, 0,
+ 42527, 12911, 43427, 1383, 8565, 2469, 120024, 6690, 6156, 68117, 43439,
+ 7993, 4288, 120416, 2674, 13238, 11922, 0, 120330, 3510, 13234, 0,
+ 120407, 5605, 42095, 11364, 0, 1380, 65617, 120253, 120261, 13196, 13197,
+ 120309, 120682, 9495, 119346, 0, 5959, 0, 73976, 120305, 43371, 6941,
+ 119349, 13205, 13211, 5801, 12769, 65905, 41697, 1283, 120302, 4779, 0,
+ 3719, 4006, 0, 19957, 128773, 2021, 119332, 120699, 119150, 43028, 65493,
+ 41838, 3875, 5962, 64341, 92616, 9814, 43457, 5827, 3314, 7787, 78234,
+ 65494, 68153, 0, 0, 120636, 64531, 120692, 194626, 0, 0, 66316, 65467,
+ 5771, 41298, 0, 9742, 521, 0, 10800, 0, 8404, 194625, 483, 7096, 7089,
+ 66323, 928, 0, 0, 119018, 10599, 11586, 3989, 10971, 0, 65782, 9841,
+ 8843, 12145, 92470, 10074, 78548, 0, 3769, 0, 0, 0, 0, 9573, 0, 65290,
+ 8849, 0, 65855, 65112, 1796, 120505, 0, 69665, 8164, 41301, 3502, 0,
+ 7388, 10621, 73838, 78553, 5825, 13007, 68165, 0, 120457, 12661, 7608,
+ 10354, 10418, 42411, 2022, 0, 1409, 12195, 4001, 3112, 10824, 120639,
+ 1390, 0, 0, 421, 43536, 5846, 120120, 4130, 127775, 7595, 42588, 7600,
+ 120121, 66035, 0, 0, 65851, 42607, 128190, 92403, 3168, 0, 42134, 0,
+ 2370, 2846, 92605, 0, 0, 120132, 0, 1836, 0, 0, 92558, 3740, 92547, 6290,
+ 65374, 120451, 2390, 3944, 66628, 120434, 0, 6135, 3118, 74265, 119093,
+ 120446, 0, 0, 8127, 8975, 64739, 7943, 0, 0, 10618, 2584, 0, 0, 0, 9998,
+ 0, 0, 0, 0, 0, 6204, 0, 0, 8279, 8776, 64954, 4975, 74809, 120130, 4267,
+ 1631, 42206, 127866, 0, 195046, 65700, 66562, 0, 64645, 0, 0, 0, 12586,
+ 0, 9242, 127922, 0, 4523, 5842, 10495, 3122, 0, 7793, 78275, 9328, 0,
+ 78393, 12604, 0, 6615, 67650, 92344, 3986, 44025, 0, 8912, 64555, 7409,
+ 0, 0, 9541, 78276, 0, 11275, 8540, 11498, 0, 0, 41040, 2459, 0, 13060,
+ 41041, 74413, 0, 0, 0, 68427, 10450, 12551, 41043, 7020, 120353, 3765, 0,
+ 0, 1606, 120348, 120351, 3093, 68436, 0, 0, 120649, 0, 0, 4312, 74091,
+ 120337, 120336, 11923, 4023, 120333, 5763, 120335, 4827, 10894, 12810,
+ 64406, 118785, 4455, 74321, 433, 119620, 66660, 2499, 0, 0, 0, 11973,
+ 13089, 4293, 120329, 42224, 42758, 12196, 42837, 42226, 119319, 0,
+ 119126, 5817, 127806, 55277, 3120, 9797, 0, 0, 0, 10389, 0, 0, 4895,
+ 65358, 0, 4359, 585, 2383, 3509, 194920, 486, 4290, 5758, 127546, 0, 0,
+ 7004, 0, 65880, 127886, 119048, 2380, 11380, 0, 0, 2376, 0, 119320, 0,
+ 5197, 127046, 127047, 127048, 2366, 127050, 127051, 120554, 120045, 0, 0,
+ 0, 0, 0, 0, 0, 74188, 120241, 0, 0, 120047, 128575, 0, 0, 120049, 0,
+ 1847, 0, 10339, 0, 42384, 0, 4227, 74158, 0, 92501, 43032, 0, 42365, 0,
+ 12671, 11384, 0, 0, 0, 64797, 0, 5820, 0, 120052, 120065, 0, 120064,
+ 120650, 42137, 9893, 2754, 12664, 120063, 0, 7377, 127867, 41799, 65530,
+ 1711, 12984, 43039, 3114, 6255, 0, 118938, 0, 10853, 926, 0, 74184, 0,
+ 120055, 0, 43175, 0, 43037, 41798, 41035, 11583, 127769, 41801, 119088,
+ 0, 520, 4200, 12699, 8331, 0, 3091, 41034, 127353, 0, 8360, 0, 78044,
+ 321, 4229, 64543, 917946, 65563, 0, 917974, 2861, 43793, 10095, 0, 9195,
+ 92386, 1861, 0, 73733, 0, 0, 43041, 0, 43794, 128530, 3859, 12181, 41660,
+ 8209, 0, 73867, 12973, 0, 74757, 127514, 41658, 0, 0, 5760, 0, 743, 4414,
+ 120766, 0, 42632, 917973, 65161, 73896, 128589, 0, 1405, 119063, 43220,
+ 43341, 0, 19919, 0, 64532, 65367, 43710, 0, 0, 3513, 0, 118883, 43342,
+ 119064, 65529, 65364, 128197, 0, 6485, 1397, 0, 41986, 92678, 0, 0,
+ 74097, 0, 7471, 12079, 0, 12682, 43287, 92317, 0, 0, 0, 0, 0, 1099,
+ 10490, 0, 10501, 65181, 74463, 0, 464, 41624, 65283, 67663, 78222, 1346,
+ 0, 917631, 64573, 64897, 423, 1818, 65144, 0, 8272, 127812, 19911, 4218,
+ 3087, 64960, 127234, 43564, 0, 0, 9584, 10465, 0, 74359, 12626, 9106, 0,
+ 42642, 120230, 64750, 9390, 0, 41797, 0, 0, 265, 41795, 64666, 0, 43530,
+ 2752, 0, 0, 0, 59, 0, 0, 0, 92371, 77873, 41810, 0, 7010, 0, 41809,
+ 41495, 119364, 0, 42252, 42213, 8009, 3305, 43033, 511, 92700, 66255,
+ 13127, 120067, 0, 0, 0, 917977, 65915, 1400, 41812, 10685, 194870, 2103,
+ 10387, 4453, 43276, 917783, 13159, 0, 6481, 41213, 0, 0, 0, 0, 41983,
+ 74198, 6617, 9116, 119654, 0, 462, 68110, 10493, 0, 8129, 0, 0, 74471,
+ 6644, 11658, 0, 128245, 3452, 11906, 9581, 1385, 3098, 0, 119013, 43340,
+ 0, 41033, 6493, 42626, 0, 0, 11426, 77887, 1681, 118789, 1204, 3755,
+ 64661, 7235, 10170, 3966, 8911, 0, 41841, 43338, 0, 0, 5726, 64915,
+ 42175, 0, 0, 41497, 65044, 120109, 2851, 43017, 0, 0, 4373, 78058, 0,
+ 9587, 1789, 6671, 128840, 3100, 0, 65360, 0, 92365, 0, 64922, 0, 8190,
+ 12083, 0, 0, 6506, 64312, 74374, 2368, 0, 4419, 0, 119125, 3439, 1825,
+ 1192, 120106, 8891, 3080, 120228, 2347, 5430, 0, 8990, 2848, 0, 128223,
+ 92528, 249, 0, 0, 0, 120658, 0, 0, 8883, 917802, 728, 68178, 995, 0, 0,
+ 64826, 0, 917798, 128348, 0, 19945, 8091, 558, 0, 12273, 194814, 0,
+ 12112, 0, 0, 0, 74419, 12335, 120104, 917795, 3443, 3129, 0, 2102, 65445,
+ 78258, 64891, 0, 7725, 65108, 78255, 0, 8624, 69246, 12446, 43295, 0,
+ 41894, 0, 6277, 41672, 41893, 10010, 128678, 3540, 128649, 835, 0, 69816,
+ 119868, 74408, 0, 73959, 5426, 4258, 0, 0, 5424, 128127, 8283, 0, 5434,
+ 0, 0, 19917, 11408, 0, 11947, 0, 1404, 3095, 11432, 128307, 3464, 6486,
+ 4819, 128233, 0, 570, 8095, 3672, 119864, 1498, 67866, 0, 0, 431, 0, 0,
+ 128182, 128096, 68167, 0, 13096, 128643, 0, 43408, 9516, 128538, 5268,
+ 42230, 42220, 0, 4450, 120511, 11547, 43417, 128542, 356, 3477, 227,
+ 10488, 68203, 382, 11418, 0, 0, 0, 0, 0, 0, 6484, 2541, 66039, 0, 78718,
+ 92723, 3549, 0, 9110, 119665, 2743, 0, 43290, 194812, 9097, 0, 43015,
+ 8782, 0, 776, 2524, 42707, 8573, 0, 0, 0, 0, 42694, 64944, 8952, 3856,
+ 118818, 0, 5872, 6495, 0, 0, 0, 92543, 0, 120733, 12849, 3953, 1897, 0,
+ 65094, 11994, 4339, 74556, 92654, 67843, 0, 0, 0, 68473, 74104, 5228,
+ 128804, 7868, 43184, 0, 0, 73986, 43438, 0, 43022, 0, 1162, 0, 2671, 0,
+ 0, 92632, 92631, 118865, 4553, 73811, 0, 195005, 0, 0, 19921, 74331,
+ 11424, 195006, 4567, 41891, 0, 0, 55249, 4820, 65239, 194662, 0, 0,
+ 43042, 119212, 1377, 12869, 4897, 42821, 9250, 0, 4438, 64385, 0, 1753,
+ 11331, 6147, 194941, 43282, 8833, 0, 0, 6504, 78408, 126979, 10719, 0,
+ 1898, 1413, 42443, 0, 802, 12141, 0, 194671, 6648, 10671, 2528, 0, 64789,
+ 9169, 838, 127092, 120697, 844, 5014, 0, 256, 0, 9990, 0, 42739, 917851,
+ 7542, 65464, 9726, 0, 6489, 10048, 74326, 78719, 66573, 0, 78724, 78712,
+ 11761, 194655, 0, 41094, 0, 0, 0, 0, 92689, 6196, 6945, 194628, 194890,
+ 128184, 120491, 11816, 194943, 5733, 2930, 0, 0, 41098, 0, 41093, 0,
+ 66626, 588, 9760, 0, 194717, 1238, 200, 0, 1660, 73916, 0, 118905, 74362,
+ 0, 92485, 194651, 0, 0, 3394, 194894, 120668, 0, 0, 127358, 66219,
+ 127183, 43284, 194657, 7817, 1841, 11055, 120533, 194979, 194982, 1669,
+ 10776, 194981, 7701, 194980, 0, 194995, 1732, 4030, 0, 3963, 66611,
+ 127530, 41768, 6491, 0, 65324, 914, 65323, 8071, 3538, 0, 78713, 65328,
+ 92441, 74367, 7614, 0, 11819, 0, 12009, 12399, 0, 67852, 65537, 0, 10841,
+ 43430, 5301, 0, 92618, 5734, 8960, 0, 92527, 65317, 77880, 0, 0, 0,
+ 12304, 0, 0, 65315, 92670, 128511, 0, 0, 0, 119621, 92529, 74536, 12447,
+ 64486, 127374, 0, 0, 0, 0, 0, 42767, 10915, 0, 12007, 43695, 120520,
+ 11975, 194878, 0, 92604, 2555, 8629, 0, 43168, 41872, 43706, 4496,
+ 194879, 128148, 0, 0, 0, 0, 0, 64730, 0, 66714, 68222, 0, 0, 65596,
+ 92306, 11416, 4280, 67655, 8765, 12784, 7792, 1393, 127242, 67871, 74386,
+ 0, 8233, 12820, 0, 6683, 194876, 3442, 12144, 2841, 12543, 0, 1473,
+ 42820, 64329, 127832, 0, 68642, 6488, 357, 1048, 41100, 0, 41104, 0,
+ 3406, 1054, 119065, 1040, 65450, 0, 4434, 1069, 0, 118862, 65737, 917765,
+ 128705, 0, 0, 9693, 41943, 0, 41931, 41759, 12757, 4353, 0, 1059, 9790,
+ 8995, 128286, 0, 65937, 0, 41764, 10646, 0, 118833, 92372, 0, 74830,
+ 78569, 12743, 0, 6480, 917761, 41779, 42580, 66601, 12207, 119619, 6335,
+ 66602, 11312, 64807, 0, 0, 41767, 0, 0, 43020, 128271, 3955, 74254, 0, 0,
+ 917861, 0, 77926, 9770, 9246, 12230, 0, 0, 0, 10448, 41783, 41786,
+ 127093, 12797, 2755, 64571, 78578, 194927, 4857, 0, 4428, 12794, 73755,
+ 128061, 78574, 0, 0, 0, 5747, 78825, 0, 7978, 41092, 74571, 0, 11924,
+ 43812, 42144, 65015, 0, 563, 0, 0, 12798, 11271, 57, 0, 0, 917860,
+ 119043, 0, 119134, 43137, 694, 0, 9876, 0, 119168, 0, 78822, 64537, 0,
+ 277, 74385, 7229, 12761, 0, 0, 13025, 64811, 8757, 78824, 0, 1574, 7381,
+ 0, 2525, 4852, 5749, 68465, 13027, 42824, 120574, 1039, 7151, 10155,
+ 5745, 188, 41858, 11592, 0, 74015, 9055, 41853, 4858, 917780, 0, 436,
+ 4771, 0, 2786, 0, 4856, 8051, 0, 119609, 0, 9644, 0, 0, 0, 194916,
+ 120732, 66710, 118834, 0, 73906, 0, 127114, 0, 10234, 5843, 11939, 0,
+ 42157, 0, 3157, 194918, 68393, 0, 3504, 119178, 0, 10822, 5149, 66029,
+ 10226, 65142, 0, 3594, 42424, 194959, 40, 12657, 0, 0, 386, 0, 8834, 0,
+ 12815, 43574, 0, 73907, 0, 74196, 7220, 74504, 0, 74316, 0, 77932, 4304,
+ 74503, 8160, 78707, 194753, 0, 0, 0, 1348, 92349, 78597, 0, 13303, 0,
+ 92392, 194755, 7599, 1278, 43616, 13269, 0, 0, 74387, 78179, 78598,
+ 74492, 6097, 7568, 8780, 4982, 127464, 74501, 194763, 78592, 194762,
+ 2672, 3735, 127471, 13138, 42266, 9484, 10724, 41202, 119024, 0, 43742,
+ 0, 9487, 119959, 119117, 3842, 128768, 78668, 12442, 6193, 9791, 127976,
+ 0, 42516, 7228, 7559, 74803, 78468, 7873, 11399, 119219, 194691, 194855,
+ 194690, 194857, 3604, 0, 119188, 128877, 78540, 78541, 42507, 1962,
+ 43305, 78476, 42505, 11660, 0, 2072, 92312, 6995, 74173, 5437, 74174,
+ 10669, 8702, 7964, 92352, 0, 199, 194843, 4105, 194845, 194699, 194847,
+ 194710, 119875, 13148, 7560, 78479, 9226, 78480, 195070, 6472, 65814,
+ 73954, 0, 4724, 0, 0, 9191, 0, 64432, 0, 0, 195024, 10196, 7886, 0, 6585,
+ 0, 6680, 195042, 0, 195051, 6679, 74412, 92251, 194866, 74421, 11382, 0,
+ 0, 127891, 127484, 194833, 194832, 6681, 127482, 12693, 194836, 42727,
+ 194838, 128252, 78195, 65442, 119610, 69733, 9989, 43248, 66248, 194816,
+ 0, 194818, 128845, 194820, 194819, 5297, 7042, 13284, 6112, 7968, 194825,
+ 73927, 92444, 194736, 65746, 127476, 74409, 74389, 128696, 4342, 42839,
+ 194831, 1677, 0, 0, 194806, 917855, 11091, 11011, 2719, 0, 0, 119595,
+ 10160, 0, 0, 7585, 65169, 2052, 4308, 92174, 74177, 7505, 543, 64916,
+ 64736, 0, 0, 64655, 0, 118922, 2064, 0, 43158, 7902, 0, 65265, 194639, 0,
+ 127170, 0, 0, 0, 0, 12994, 92728, 10828, 0, 6228, 4307, 3482, 128527, 0,
+ 0, 0, 506, 74573, 41194, 65735, 2055, 43255, 41195, 0, 8169, 0, 8841, 0,
+ 516, 0, 2063, 119051, 34, 128850, 120186, 11504, 1612, 74333, 120182,
+ 74520, 74308, 12001, 120178, 10242, 64564, 120179, 120174, 6584, 7749,
+ 11037, 0, 1758, 0, 10667, 10560, 120197, 92593, 1935, 11517, 120193,
+ 120196, 120195, 1931, 120189, 74839, 120191, 1217, 64702, 12643, 825,
+ 127838, 194905, 12294, 92428, 78834, 9138, 78831, 78833, 12631, 78829,
+ 11080, 74554, 64000, 5591, 1239, 0, 11313, 0, 3403, 0, 0, 64364, 92269,
+ 0, 74582, 8998, 12988, 0, 9152, 0, 0, 194898, 67589, 41850, 64290, 3433,
+ 92393, 12615, 1594, 42192, 6914, 67603, 0, 119569, 74565, 41353, 67602,
+ 67611, 4337, 0, 127296, 918, 65035, 41351, 7681, 194900, 42577, 41393,
+ 12668, 194904, 2477, 127285, 0, 127301, 0, 67604, 194880, 127235, 573,
+ 127282, 194884, 11417, 194886, 119814, 194888, 67599, 0, 194889, 67607,
+ 11482, 0, 3981, 3357, 0, 42223, 4207, 1288, 78842, 78839, 68419, 78837,
+ 11589, 42195, 194872, 194599, 127263, 64602, 67618, 92539, 0, 42788,
+ 68416, 64480, 194875, 8423, 3348, 448, 68476, 9717, 0, 0, 997, 0, 0,
+ 92577, 0, 11440, 11379, 42000, 13139, 42221, 65013, 126999, 127760,
+ 73796, 0, 119228, 12035, 0, 2818, 0, 0, 73793, 0, 4172, 0, 0, 8373,
+ 10873, 12197, 0, 0, 92265, 69706, 0, 78210, 0, 128110, 194865, 126982,
+ 74563, 64828, 11419, 194868, 766, 1257, 0, 118845, 11381, 3265, 66617,
+ 3274, 127365, 0, 0, 0, 74522, 41989, 0, 0, 128798, 3263, 0, 65672, 0,
+ 3270, 64539, 11489, 0, 0, 0, 0, 9505, 65518, 194776, 756, 194605, 0, 0,
+ 0, 7261, 0, 186, 0, 119156, 5770, 13179, 65830, 12612, 12949, 64856,
+ 12800, 0, 74203, 64718, 0, 0, 92434, 118929, 0, 11578, 0, 119296, 0, 0,
+ 0, 0, 74568, 9254, 0, 1794, 120217, 64521, 5624, 120220, 120221, 119958,
+ 120223, 3617, 66636, 64886, 120211, 120212, 120213, 120214, 1872, 66508,
+ 120467, 41079, 10748, 5502, 119330, 4452, 0, 0, 92526, 4511, 0, 0, 64678,
+ 11425, 0, 43245, 1231, 194783, 0, 0, 9003, 8192, 0, 5305, 9653, 10616,
+ 8694, 9546, 0, 0, 120478, 120200, 65205, 120202, 64063, 9878, 74780,
+ 119626, 78202, 64058, 8799, 42131, 0, 64062, 1028, 64060, 64059, 837,
+ 10567, 0, 43103, 0, 120754, 11427, 2902, 64043, 64042, 66464, 10756, 0,
+ 42606, 64045, 64044, 43979, 10076, 64040, 43060, 194942, 1034, 3392,
+ 127771, 43091, 64033, 64032, 42735, 64038, 64037, 64036, 64035, 4291,
+ 194928, 64015, 64014, 64681, 194930, 0, 78145, 0, 43090, 0, 3476, 8973,
+ 64012, 42473, 64010, 64008, 64007, 2003, 7706, 64517, 78153, 2538, 64009,
+ 204, 0, 4802, 4111, 8239, 9098, 4805, 64001, 64057, 7885, 7247, 64054, 0,
+ 0, 4767, 9343, 64049, 64048, 120034, 1133, 64053, 64052, 43453, 64050,
+ 41340, 118975, 194835, 10005, 12329, 41333, 0, 8489, 1942, 0, 194834,
+ 42520, 128249, 0, 0, 10760, 64023, 64022, 64021, 6582, 43670, 0, 64025,
+ 9167, 42151, 78244, 0, 2026, 64019, 64018, 64017, 64016, 12768, 0, 7582,
+ 78252, 78248, 77914, 78246, 78247, 0, 77915, 78766, 6788, 13094, 77920,
+ 7532, 41414, 78520, 3179, 78518, 64769, 78514, 78517, 11461, 74454,
+ 10751, 9051, 120720, 6708, 10535, 0, 68218, 55274, 2008, 64031, 64030,
+ 294, 41874, 0, 126991, 65929, 0, 0, 0, 0, 64028, 8146, 64026, 41788,
+ 194844, 0, 118795, 6343, 43247, 119888, 0, 119886, 119891, 119892,
+ 119889, 11433, 119895, 119896, 0, 7801, 65578, 194839, 12915, 43968,
+ 3297, 9699, 194955, 1135, 0, 0, 128525, 1995, 6722, 0, 0, 2552, 41546,
+ 60, 68394, 8649, 41549, 78496, 0, 0, 6682, 0, 78679, 64710, 41547, 0,
+ 2013, 128291, 78530, 78532, 78528, 78529, 12832, 78493, 8081, 8362, 3537,
+ 119908, 9137, 7155, 8999, 0, 78533, 3466, 0, 0, 1996, 0, 3453, 6282, 0,
+ 2002, 2000, 120175, 537, 0, 4179, 65119, 1998, 0, 1842, 0, 92674, 9628,
+ 68446, 12081, 9826, 64502, 1767, 0, 0, 0, 120201, 0, 0, 0, 3059, 44024,
+ 120204, 119953, 92693, 0, 0, 92452, 4100, 920, 1811, 1355, 0, 0, 3592,
+ 10078, 0, 0, 0, 8592, 65870, 68164, 128792, 10742, 0, 42918, 1994, 9281,
+ 3296, 12865, 1997, 1895,
};
#define code_magic 47
diff --git a/Modules/xxlimited.c b/Modules/xxlimited.c
new file mode 100644
index 0000000000..ec924f2117
--- /dev/null
+++ b/Modules/xxlimited.c
@@ -0,0 +1,287 @@
+
+/* Use this file as a template to start implementing a module that
+ also declares object types. All occurrences of 'Xxo' should be changed
+ to something reasonable for your objects. After that, all other
+ occurrences of 'xx' should be changed to something reasonable for your
+ module. If your module is named foo your sourcefile should be named
+ foomodule.c.
+
+ You will probably want to delete all references to 'x_attr' and add
+ your own types of attributes instead. Maybe you want to name your
+ local variables other than 'self'. If your object type is needed in
+ other files, you'll have to create a file "foobarobject.h"; see
+ floatobject.h for an example. */
+
+/* Xxo objects */
+
+#include "Python.h"
+
+static PyObject *ErrorObject;
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *x_attr; /* Attributes dictionary */
+} XxoObject;
+
+static PyObject *Xxo_Type;
+
+#define XxoObject_Check(v) (Py_TYPE(v) == Xxo_Type)
+
+static XxoObject *
+newXxoObject(PyObject *arg)
+{
+ XxoObject *self;
+ self = PyObject_New(XxoObject, (PyTypeObject*)Xxo_Type);
+ if (self == NULL)
+ return NULL;
+ self->x_attr = NULL;
+ return self;
+}
+
+/* Xxo methods */
+
+static void
+Xxo_dealloc(XxoObject *self)
+{
+ Py_XDECREF(self->x_attr);
+ PyObject_Del(self);
+}
+
+static PyObject *
+Xxo_demo(XxoObject *self, PyObject *args)
+{
+ PyObject *o = NULL;
+ if (!PyArg_ParseTuple(args, "|O:demo", &o))
+ return NULL;
+ /* Test availability of fast type checks */
+ if (o != NULL && PyUnicode_Check(o)) {
+ Py_INCREF(o);
+ return o;
+ }
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyMethodDef Xxo_methods[] = {
+ {"demo", (PyCFunction)Xxo_demo, METH_VARARGS,
+ PyDoc_STR("demo() -> None")},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyObject *
+Xxo_getattro(XxoObject *self, PyObject *name)
+{
+ if (self->x_attr != NULL) {
+ PyObject *v = PyDict_GetItem(self->x_attr, name);
+ if (v != NULL) {
+ Py_INCREF(v);
+ return v;
+ }
+ }
+ return PyObject_GenericGetAttr((PyObject *)self, name);
+}
+
+static int
+Xxo_setattr(XxoObject *self, char *name, PyObject *v)
+{
+ if (self->x_attr == NULL) {
+ self->x_attr = PyDict_New();
+ if (self->x_attr == NULL)
+ return -1;
+ }
+ if (v == NULL) {
+ int rv = PyDict_DelItemString(self->x_attr, name);
+ if (rv < 0)
+ PyErr_SetString(PyExc_AttributeError,
+ "delete non-existing Xxo attribute");
+ return rv;
+ }
+ else
+ return PyDict_SetItemString(self->x_attr, name, v);
+}
+
+static PyType_Slot Xxo_Type_slots[] = {
+ {Py_tp_doc, "The Xxo type"},
+ {Py_tp_dealloc, Xxo_dealloc},
+ {Py_tp_getattro, Xxo_getattro},
+ {Py_tp_setattr, Xxo_setattr},
+ {Py_tp_methods, Xxo_methods},
+ {0, 0},
+};
+
+static PyType_Spec Xxo_Type_spec = {
+ "xxlimited.Xxo",
+ sizeof(XxoObject),
+ 0,
+ Py_TPFLAGS_DEFAULT,
+ Xxo_Type_slots
+};
+
+/* --------------------------------------------------------------------- */
+
+/* Function of two integers returning integer */
+
+PyDoc_STRVAR(xx_foo_doc,
+"foo(i,j)\n\
+\n\
+Return the sum of i and j.");
+
+static PyObject *
+xx_foo(PyObject *self, PyObject *args)
+{
+ long i, j;
+ long res;
+ if (!PyArg_ParseTuple(args, "ll:foo", &i, &j))
+ return NULL;
+ res = i+j; /* XXX Do something here */
+ return PyLong_FromLong(res);
+}
+
+
+/* Function of no arguments returning new Xxo object */
+
+static PyObject *
+xx_new(PyObject *self, PyObject *args)
+{
+ XxoObject *rv;
+
+ if (!PyArg_ParseTuple(args, ":new"))
+ return NULL;
+ rv = newXxoObject(args);
+ if (rv == NULL)
+ return NULL;
+ return (PyObject *)rv;
+}
+
+/* Test bad format character */
+
+static PyObject *
+xx_roj(PyObject *self, PyObject *args)
+{
+ PyObject *a;
+ long b;
+ if (!PyArg_ParseTuple(args, "O#:roj", &a, &b))
+ return NULL;
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+/* ---------- */
+
+static PyType_Slot Str_Type_slots[] = {
+ {Py_tp_base, NULL}, /* filled out in module init function */
+ {0, 0},
+};
+
+static PyType_Spec Str_Type_spec = {
+ "xxlimited.Str",
+ 0,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ Str_Type_slots
+};
+
+/* ---------- */
+
+static PyObject *
+null_richcompare(PyObject *self, PyObject *other, int op)
+{
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+}
+
+static PyType_Slot Null_Type_slots[] = {
+ {Py_tp_base, NULL}, /* filled out in module init */
+ {Py_tp_new, NULL},
+ {Py_tp_richcompare, null_richcompare},
+ {0, 0}
+};
+
+static PyType_Spec Null_Type_spec = {
+ "xxlimited.Null",
+ 0, /* basicsize */
+ 0, /* itemsize */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ Null_Type_slots
+};
+
+/* ---------- */
+
+/* List of functions defined in the module */
+
+static PyMethodDef xx_methods[] = {
+ {"roj", xx_roj, METH_VARARGS,
+ PyDoc_STR("roj(a,b) -> None")},
+ {"foo", xx_foo, METH_VARARGS,
+ xx_foo_doc},
+ {"new", xx_new, METH_VARARGS,
+ PyDoc_STR("new() -> new Xx object")},
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(module_doc,
+"This is a template module just for instruction.");
+
+/* Initialization function for the module (*must* be called PyInit_xx) */
+
+
+static struct PyModuleDef xxmodule = {
+ PyModuleDef_HEAD_INIT,
+ "xxlimited",
+ module_doc,
+ -1,
+ xx_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit_xxlimited(void)
+{
+ PyObject *m = NULL;
+ PyObject *o;
+
+ /* Due to cross platform compiler issues the slots must be filled
+ * here. It's required for portability to Windows without requiring
+ * C++. */
+ Null_Type_slots[0].pfunc = &PyBaseObject_Type;
+ Null_Type_slots[1].pfunc = PyType_GenericNew;
+ Str_Type_slots[0].pfunc = &PyUnicode_Type;
+
+ Xxo_Type = PyType_FromSpec(&Xxo_Type_spec);
+ if (Xxo_Type == NULL)
+ goto fail;
+
+ /* Create the module and add the functions */
+ m = PyModule_Create(&xxmodule);
+ if (m == NULL)
+ goto fail;
+
+ /* Add some symbolic constants to the module */
+ if (ErrorObject == NULL) {
+ ErrorObject = PyErr_NewException("xxlimited.error", NULL, NULL);
+ if (ErrorObject == NULL)
+ goto fail;
+ }
+ Py_INCREF(ErrorObject);
+ PyModule_AddObject(m, "error", ErrorObject);
+
+ /* Add Str */
+ o = PyType_FromSpec(&Str_Type_spec);
+ if (o == NULL)
+ goto fail;
+ PyModule_AddObject(m, "Str", o);
+
+ /* Add Null */
+ o = PyType_FromSpec(&Null_Type_spec);
+ if (o == NULL)
+ goto fail;
+ PyModule_AddObject(m, "Null", o);
+ return m;
+ fail:
+ Py_XDECREF(m);
+ return NULL;
+}
diff --git a/Modules/xxmodule.c b/Modules/xxmodule.c
index 92c7673df9..a8a93606d7 100644
--- a/Modules/xxmodule.c
+++ b/Modules/xxmodule.c
@@ -10,7 +10,7 @@
your own types of attributes instead. Maybe you want to name your
local variables other than 'self'. If your object type is needed in
other files, you'll have to create a file "foobarobject.h"; see
- intobject.h for an example. */
+ floatobject.h for an example. */
/* Xxo objects */
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index fb5f42b58a..88a27c1d10 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -35,19 +35,22 @@ typedef struct _zipimporter ZipImporter;
struct _zipimporter {
PyObject_HEAD
- PyObject *archive; /* pathname of the Zip archive */
- PyObject *prefix; /* file prefix: "a/sub/directory/" */
+ PyObject *archive; /* pathname of the Zip archive,
+ decoded from the filesystem encoding */
+ PyObject *prefix; /* file prefix: "a/sub/directory/",
+ encoded to the filesystem encoding */
PyObject *files; /* dict with file info {path: toc_entry} */
};
static PyObject *ZipImportError;
+/* read_directory() cache */
static PyObject *zip_directory_cache = NULL;
/* forward decls */
-static PyObject *read_directory(char *archive);
-static PyObject *get_data(char *archive, PyObject *toc_entry);
+static PyObject *read_directory(PyObject *archive);
+static PyObject *get_data(PyObject *archive, PyObject *toc_entry);
static PyObject *get_module_code(ZipImporter *self, char *fullname,
- int *p_ispackage, char **p_modpath);
+ int *p_ispackage, PyObject **p_modpath);
#define ZipImporter_Check(op) PyObject_TypeCheck(op, &ZipImporter_Type)
@@ -60,26 +63,29 @@ static PyObject *get_module_code(ZipImporter *self, char *fullname,
static int
zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds)
{
- char *path, *p, *prefix, buf[MAXPATHLEN+2];
- size_t len;
+ PyObject *pathobj, *files;
+ Py_UNICODE *path, *p, *prefix, buf[MAXPATHLEN+2];
+ Py_ssize_t len;
if (!_PyArg_NoKeywords("zipimporter()", kwds))
return -1;
- if (!PyArg_ParseTuple(args, "s:zipimporter", &path))
+ if (!PyArg_ParseTuple(args, "O&:zipimporter",
+ PyUnicode_FSDecoder, &pathobj))
return -1;
- len = strlen(path);
+ /* copy path to buf */
+ len = PyUnicode_GET_SIZE(pathobj);
if (len == 0) {
PyErr_SetString(ZipImportError, "archive path is empty");
- return -1;
+ goto error;
}
if (len >= MAXPATHLEN) {
PyErr_SetString(ZipImportError,
"archive path too long");
- return -1;
+ goto error;
}
- strcpy(buf, path);
+ Py_UNICODE_strcpy(buf, PyUnicode_AS_UNICODE(pathobj));
#ifdef ALTSEP
for (p = buf; *p; p++) {
@@ -94,7 +100,12 @@ zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds)
struct stat statbuf;
int rv;
- rv = stat(buf, &statbuf);
+ if (pathobj == NULL) {
+ pathobj = PyUnicode_FromUnicode(buf, len);
+ if (pathobj == NULL)
+ goto error;
+ }
+ rv = _Py_stat(pathobj, &statbuf);
if (rv == 0) {
/* it exists */
if (S_ISREG(statbuf.st_mode))
@@ -102,56 +113,60 @@ zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds)
path = buf;
break;
}
+ else if (PyErr_Occurred())
+ goto error;
/* back up one path element */
- p = strrchr(buf, SEP);
+ p = Py_UNICODE_strrchr(buf, SEP);
if (prefix != NULL)
*prefix = SEP;
if (p == NULL)
break;
*p = '\0';
+ len = p - buf;
prefix = p;
+ Py_CLEAR(pathobj);
}
- if (path != NULL) {
- PyObject *files;
- files = PyDict_GetItemString(zip_directory_cache, path);
- if (files == NULL) {
- files = read_directory(buf);
- if (files == NULL)
- return -1;
- if (PyDict_SetItemString(zip_directory_cache, path,
- files) != 0)
- return -1;
- }
- else
- Py_INCREF(files);
- self->files = files;
- }
- else {
+ if (path == NULL) {
PyErr_SetString(ZipImportError, "not a Zip file");
- return -1;
+ goto error;
}
- if (prefix == NULL)
- prefix = "";
- else {
+ files = PyDict_GetItem(zip_directory_cache, pathobj);
+ if (files == NULL) {
+ files = read_directory(pathobj);
+ if (files == NULL)
+ goto error;
+ if (PyDict_SetItem(zip_directory_cache, pathobj, files) != 0)
+ goto error;
+ }
+ else
+ Py_INCREF(files);
+ self->files = files;
+
+ self->archive = pathobj;
+ pathobj = NULL;
+
+ if (prefix != NULL) {
prefix++;
- len = strlen(prefix);
+ len = Py_UNICODE_strlen(prefix);
if (prefix[len-1] != SEP) {
/* add trailing SEP */
prefix[len] = SEP;
prefix[len + 1] = '\0';
+ len++;
}
}
-
- self->archive = PyUnicode_FromString(buf);
- if (self->archive == NULL)
- return -1;
-
- self->prefix = PyUnicode_FromString(prefix);
+ else
+ len = 0;
+ self->prefix = PyUnicode_FromUnicode(prefix, len);
if (self->prefix == NULL)
- return -1;
+ goto error;
return 0;
+
+error:
+ Py_XDECREF(pathobj);
+ return -1;
}
/* GC support. */
@@ -176,19 +191,14 @@ zipimporter_dealloc(ZipImporter *self)
static PyObject *
zipimporter_repr(ZipImporter *self)
{
- char *archive = "???";
- char *prefix = "";
-
- if (self->archive != NULL && PyUnicode_Check(self->archive))
- archive = _PyUnicode_AsString(self->archive);
- if (self->prefix != NULL && PyUnicode_Check(self->prefix))
- prefix = _PyUnicode_AsString(self->prefix);
- if (prefix != NULL && *prefix)
- return PyUnicode_FromFormat("<zipimporter object \"%.300s%c%.150s\">",
- archive, SEP, prefix);
+ if (self->archive == NULL)
+ return PyUnicode_FromString("<zipimporter object \"???\">");
+ else if (self->prefix != NULL && PyUnicode_GET_SIZE(self->prefix) != 0)
+ return PyUnicode_FromFormat("<zipimporter object \"%U%c%U\">",
+ self->archive, SEP, self->prefix);
else
- return PyUnicode_FromFormat("<zipimporter object \"%.300s\">",
- archive);
+ return PyUnicode_FromFormat("<zipimporter object \"%U\">",
+ self->archive);
}
/* return fullname.split(".")[-1] */
@@ -207,20 +217,26 @@ get_subname(char *fullname)
archive (without extension) to the path buffer. Return the
length of the resulting string. */
static int
-make_filename(char *prefix, char *name, char *path)
+make_filename(PyObject *prefix_obj, char *name, char *path, size_t pathsize)
{
size_t len;
char *p;
+ PyObject *prefix;
- len = strlen(prefix);
+ prefix = PyUnicode_EncodeFSDefault(prefix_obj);
+ if (prefix == NULL)
+ return -1;
+ len = PyBytes_GET_SIZE(prefix);
/* self.prefix + name [+ SEP + "__init__"] + ".py[co]" */
- if (len + strlen(name) + 13 >= MAXPATHLEN) {
+ if (len + strlen(name) + 13 >= pathsize - 1) {
PyErr_SetString(ZipImportError, "path too long");
+ Py_DECREF(prefix);
return -1;
}
- strcpy(path, prefix);
+ strcpy(path, PyBytes_AS_STRING(prefix));
+ Py_DECREF(prefix);
strcpy(path + len, name);
for (p = path + len; *p; p++) {
if (*p == '.')
@@ -248,7 +264,7 @@ get_module_info(ZipImporter *self, char *fullname)
subname = get_subname(fullname);
- len = make_filename(_PyUnicode_AsString(self->prefix), subname, path);
+ len = make_filename(self->prefix, subname, path, sizeof(path));
if (len < 0)
return MI_ERROR;
@@ -294,8 +310,9 @@ static PyObject *
zipimporter_load_module(PyObject *obj, PyObject *args)
{
ZipImporter *self = (ZipImporter *)obj;
- PyObject *code, *mod, *dict;
- char *fullname, *modpath;
+ PyObject *code = NULL, *mod, *dict;
+ char *fullname;
+ PyObject *modpath = NULL, *modpath_bytes;
int ispackage;
if (!PyArg_ParseTuple(args, "s:zipimporter.load_module",
@@ -304,13 +321,11 @@ zipimporter_load_module(PyObject *obj, PyObject *args)
code = get_module_code(self, fullname, &ispackage, &modpath);
if (code == NULL)
- return NULL;
+ goto error;
mod = PyImport_AddModule(fullname);
- if (mod == NULL) {
- Py_DECREF(code);
- return NULL;
- }
+ if (mod == NULL)
+ goto error;
dict = PyModule_GetDict(mod);
/* mod.__loader__ = self */
@@ -339,15 +354,24 @@ zipimporter_load_module(PyObject *obj, PyObject *args)
if (err != 0)
goto error;
}
- mod = PyImport_ExecCodeModuleEx(fullname, code, modpath);
- Py_DECREF(code);
+ modpath_bytes = PyUnicode_EncodeFSDefault(modpath);
+ if (modpath_bytes == NULL)
+ goto error;
+ mod = PyImport_ExecCodeModuleEx(fullname, code,
+ PyBytes_AS_STRING(modpath_bytes));
+ Py_DECREF(modpath_bytes);
+ Py_CLEAR(code);
+ if (mod == NULL)
+ goto error;
+
if (Py_VerboseFlag)
- PySys_WriteStderr("import %s # loaded from Zip %s\n",
- fullname, modpath);
+ PySys_FormatStderr("import %s # loaded from Zip %U\n",
+ fullname, modpath);
+ Py_DECREF(modpath);
return mod;
error:
- Py_DECREF(code);
- Py_DECREF(mod);
+ Py_XDECREF(code);
+ Py_XDECREF(modpath);
return NULL;
}
@@ -357,21 +381,22 @@ zipimporter_get_filename(PyObject *obj, PyObject *args)
{
ZipImporter *self = (ZipImporter *)obj;
PyObject *code;
- char *fullname, *modpath;
+ char *fullname;
+ PyObject *modpath;
int ispackage;
if (!PyArg_ParseTuple(args, "s:zipimporter.get_filename",
- &fullname))
- return NULL;
+ &fullname))
+ return NULL;
/* Deciding the filename requires working out where the code
would come from if the module was actually loaded */
code = get_module_code(self, fullname, &ispackage, &modpath);
if (code == NULL)
- return NULL;
+ return NULL;
Py_DECREF(code); /* Only need the path info */
- return PyUnicode_FromString(modpath);
+ return modpath;
}
/* Return a bool signifying whether the module is a package or not. */
@@ -390,8 +415,7 @@ zipimporter_is_package(PyObject *obj, PyObject *args)
if (mi == MI_ERROR)
return NULL;
if (mi == MI_NOT_FOUND) {
- PyErr_Format(ZipImportError, "can't find module '%.200s'",
- fullname);
+ PyErr_Format(ZipImportError, "can't find module '%s'", fullname);
return NULL;
}
return PyBool_FromLong(mi == MI_PACKAGE);
@@ -401,42 +425,52 @@ static PyObject *
zipimporter_get_data(PyObject *obj, PyObject *args)
{
ZipImporter *self = (ZipImporter *)obj;
- char *path;
+ PyObject *pathobj, *key;
+ const Py_UNICODE *path;
#ifdef ALTSEP
- char *p, buf[MAXPATHLEN + 1];
+ Py_UNICODE *p, buf[MAXPATHLEN + 1];
#endif
+ Py_UNICODE *archive;
PyObject *toc_entry;
- Py_ssize_t len;
- char *archive_str;
+ Py_ssize_t path_len, len;
- if (!PyArg_ParseTuple(args, "s:zipimporter.get_data", &path))
+ if (!PyArg_ParseTuple(args, "U:zipimporter.get_data", &pathobj))
return NULL;
+ path_len = PyUnicode_GET_SIZE(pathobj);
+ path = PyUnicode_AS_UNICODE(pathobj);
#ifdef ALTSEP
- if (strlen(path) >= MAXPATHLEN) {
+ if (path_len >= MAXPATHLEN) {
PyErr_SetString(ZipImportError, "path too long");
return NULL;
}
- strcpy(buf, path);
+ Py_UNICODE_strcpy(buf, path);
for (p = buf; *p; p++) {
if (*p == ALTSEP)
*p = SEP;
}
path = buf;
#endif
- archive_str = _PyUnicode_AsStringAndSize(self->archive, &len);
- if ((size_t)len < strlen(path) &&
- strncmp(path, archive_str, len) == 0 &&
+ archive = PyUnicode_AS_UNICODE(self->archive);
+ len = PyUnicode_GET_SIZE(self->archive);
+ if ((size_t)len < Py_UNICODE_strlen(path) &&
+ Py_UNICODE_strncmp(path, archive, len) == 0 &&
path[len] == SEP) {
- path = path + len + 1;
+ path += len + 1;
+ path_len -= len + 1;
}
- toc_entry = PyDict_GetItemString(self->files, path);
+ key = PyUnicode_FromUnicode(path, path_len);
+ if (key == NULL)
+ return NULL;
+ toc_entry = PyDict_GetItem(self->files, key);
if (toc_entry == NULL) {
- PyErr_SetFromErrnoWithFilename(PyExc_IOError, path);
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, key);
+ Py_DECREF(key);
return NULL;
}
- return get_data(archive_str, toc_entry);
+ Py_DECREF(key);
+ return get_data(self->archive, toc_entry);
}
static PyObject *
@@ -467,13 +501,12 @@ zipimporter_get_source(PyObject *obj, PyObject *args)
if (mi == MI_ERROR)
return NULL;
if (mi == MI_NOT_FOUND) {
- PyErr_Format(ZipImportError, "can't find module '%.200s'",
- fullname);
+ PyErr_Format(ZipImportError, "can't find module '%s'", fullname);
return NULL;
}
subname = get_subname(fullname);
- len = make_filename(_PyUnicode_AsString(self->prefix), subname, path);
+ len = make_filename(self->prefix, subname, path, sizeof(path));
if (len < 0)
return NULL;
@@ -486,9 +519,13 @@ zipimporter_get_source(PyObject *obj, PyObject *args)
toc_entry = PyDict_GetItemString(self->files, path);
if (toc_entry != NULL) {
- PyObject *bytes = get_data(_PyUnicode_AsString(self->archive), toc_entry);
- PyObject *res = PyUnicode_FromString(PyBytes_AsString(bytes));
- Py_XDECREF(bytes);
+ PyObject *res, *bytes;
+ bytes = get_data(self->archive, toc_entry);
+ if (bytes == NULL)
+ return NULL;
+ res = PyUnicode_FromStringAndSize(PyBytes_AS_STRING(bytes),
+ PyBytes_GET_SIZE(bytes));
+ Py_DECREF(bytes);
return res;
}
@@ -656,7 +693,8 @@ get_long(unsigned char *buf) {
A toc_entry is a tuple:
- (__file__, # value to use for __file__, available for all files
+ (__file__, # value to use for __file__, available for all files,
+ # encoded to the filesystem encoding
compress, # compression kind; 0 for uncompressed
data_size, # size of compressed data on disk
file_size, # size of decompressed data
@@ -664,51 +702,54 @@ get_long(unsigned char *buf) {
time, # mod time of file (in dos format)
date, # mod data of file (in dos format)
crc, # crc checksum of the data
- )
+ )
Directories can be recognized by the trailing SEP in the name,
data_size and file_offset are 0.
*/
static PyObject *
-read_directory(char *archive)
+read_directory(PyObject *archive_obj)
{
+ /* FIXME: work on Py_UNICODE* instead of char* */
PyObject *files = NULL;
FILE *fp;
+ unsigned short flags;
long compress, crc, data_size, file_size, file_offset, date, time;
long header_offset, name_size, header_size, header_position;
long i, l, count;
size_t length;
- char path[MAXPATHLEN + 5];
+ Py_UNICODE path[MAXPATHLEN + 5];
char name[MAXPATHLEN + 5];
+ PyObject *nameobj = NULL;
char *p, endof_central_dir[22];
long arc_offset; /* offset from beginning of file to start of zip-archive */
+ PyObject *pathobj;
+ const char *charset;
+ int bootstrap;
- if (strlen(archive) > MAXPATHLEN) {
+ if (PyUnicode_GET_SIZE(archive_obj) > MAXPATHLEN) {
PyErr_SetString(PyExc_OverflowError,
"Zip path name is too long");
return NULL;
}
- strcpy(path, archive);
+ Py_UNICODE_strcpy(path, PyUnicode_AS_UNICODE(archive_obj));
- fp = fopen(archive, "rb");
+ fp = _Py_fopen(archive_obj, "rb");
if (fp == NULL) {
- PyErr_Format(ZipImportError, "can't open Zip file: "
- "'%.200s'", archive);
+ PyErr_Format(ZipImportError, "can't open Zip file: '%U'", archive_obj);
return NULL;
}
fseek(fp, -22, SEEK_END);
header_position = ftell(fp);
if (fread(endof_central_dir, 1, 22, fp) != 22) {
fclose(fp);
- PyErr_Format(ZipImportError, "can't read Zip file: "
- "'%.200s'", archive);
+ PyErr_Format(ZipImportError, "can't read Zip file: '%U'", archive_obj);
return NULL;
}
if (get_long((unsigned char *)endof_central_dir) != 0x06054B50) {
/* Bad: End of Central Dir signature */
fclose(fp);
- PyErr_Format(ZipImportError, "not a Zip file: "
- "'%.200s'", archive);
+ PyErr_Format(ZipImportError, "not a Zip file: '%U'", archive_obj);
return NULL;
}
@@ -721,7 +762,7 @@ read_directory(char *archive)
if (files == NULL)
goto error;
- length = (long)strlen(path);
+ length = Py_UNICODE_strlen(path);
path[length] = SEP;
/* Start of Central Directory */
@@ -734,7 +775,8 @@ read_directory(char *archive)
l = PyMarshal_ReadLongFromFile(fp);
if (l != 0x02014B50)
break; /* Bad: Central Dir File Header */
- fseek(fp, header_offset + 10, 0);
+ fseek(fp, header_offset + 8, 0);
+ flags = (unsigned short)PyMarshal_ReadShortFromFile(fp);
compress = PyMarshal_ReadShortFromFile(fp);
time = PyMarshal_ReadShortFromFile(fp);
date = PyMarshal_ReadShortFromFile(fp);
@@ -760,13 +802,41 @@ read_directory(char *archive)
*p = 0; /* Add terminating null byte */
header_offset += header_size;
- strncpy(path + length + 1, name, MAXPATHLEN - length - 1);
+ bootstrap = 0;
+ if (flags & 0x0800)
+ charset = "utf-8";
+ else if (!PyThreadState_GET()->interp->codecs_initialized) {
+ /* During bootstrap, we may need to load the encodings
+ package from a ZIP file. But the cp437 encoding is implemented
+ in Python in the encodings package.
+
+ Break out of this dependency by assuming that the path to
+ the encodings module is ASCII-only. */
+ charset = "ascii";
+ bootstrap = 1;
+ }
+ else
+ charset = "cp437";
+ nameobj = PyUnicode_Decode(name, name_size, charset, NULL);
+ if (nameobj == NULL) {
+ if (bootstrap)
+ PyErr_Format(PyExc_NotImplementedError,
+ "bootstrap issue: python%i%i.zip contains non-ASCII "
+ "filenames without the unicode flag",
+ PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ goto error;
+ }
+ Py_UNICODE_strncpy(path + length + 1, PyUnicode_AS_UNICODE(nameobj), MAXPATHLEN - length - 1);
- t = Py_BuildValue("siiiiiii", path, compress, data_size,
+ pathobj = PyUnicode_FromUnicode(path, Py_UNICODE_strlen(path));
+ if (pathobj == NULL)
+ goto error;
+ t = Py_BuildValue("Niiiiiii", pathobj, compress, data_size,
file_size, file_offset, time, date, crc);
if (t == NULL)
goto error;
- err = PyDict_SetItemString(files, name, t);
+ err = PyDict_SetItem(files, nameobj, t);
+ Py_CLEAR(nameobj);
Py_DECREF(t);
if (err != 0)
goto error;
@@ -774,12 +844,13 @@ read_directory(char *archive)
}
fclose(fp);
if (Py_VerboseFlag)
- PySys_WriteStderr("# zipimport: found %ld names in %s\n",
- count, archive);
+ PySys_FormatStderr("# zipimport: found %ld names in %U\n",
+ count, archive_obj);
return files;
error:
fclose(fp);
Py_XDECREF(files);
+ Py_XDECREF(nameobj);
return NULL;
}
@@ -820,7 +891,7 @@ get_decompress_func(void)
/* Given a path to a Zip file and a toc_entry, return the (uncompressed)
data as a new reference. */
static PyObject *
-get_data(char *archive, PyObject *toc_entry)
+get_data(PyObject *archive, PyObject *toc_entry)
{
PyObject *raw_data, *data = NULL, *decompress;
char *buf;
@@ -828,20 +899,20 @@ get_data(char *archive, PyObject *toc_entry)
int err;
Py_ssize_t bytes_read = 0;
long l;
- char *datapath;
+ PyObject *datapath;
long compress, data_size, file_size, file_offset, bytes_size;
long time, date, crc;
- if (!PyArg_ParseTuple(toc_entry, "slllllll", &datapath, &compress,
+ if (!PyArg_ParseTuple(toc_entry, "Olllllll", &datapath, &compress,
&data_size, &file_size, &file_offset, &time,
&date, &crc)) {
return NULL;
}
- fp = fopen(archive, "rb");
+ fp = _Py_fopen(archive, "rb");
if (!fp) {
PyErr_Format(PyExc_IOError,
- "zipimport: can not open file %s", archive);
+ "zipimport: can not open file %U", archive);
return NULL;
}
@@ -851,7 +922,7 @@ get_data(char *archive, PyObject *toc_entry)
if (l != 0x04034B50) {
/* Bad: Local File Header */
PyErr_Format(ZipImportError,
- "bad local file header in %s",
+ "bad local file header in %U",
archive);
fclose(fp);
return NULL;
@@ -963,7 +1034,7 @@ unmarshal_code(char *pathname, PyObject *data, time_t mtime)
if (!PyCode_Check(code)) {
Py_DECREF(code);
PyErr_Format(PyExc_TypeError,
- "compiled module %.200s is not a code object",
+ "compiled module %s is not a code object",
pathname);
return NULL;
}
@@ -1080,24 +1151,23 @@ get_code_from_data(ZipImporter *self, int ispackage, int isbytecode,
time_t mtime, PyObject *toc_entry)
{
PyObject *data, *code;
- char *modpath;
- char *archive = _PyUnicode_AsString(self->archive);
+ PyObject *modpath;
- if (archive == NULL)
- return NULL;
-
- data = get_data(archive, toc_entry);
+ data = get_data(self->archive, toc_entry);
if (data == NULL)
return NULL;
- modpath = _PyUnicode_AsString(PyTuple_GetItem(toc_entry, 0));
-
- if (isbytecode) {
- code = unmarshal_code(modpath, data, mtime);
- }
- else {
- code = compile_source(modpath, data);
+ modpath = PyUnicode_EncodeFSDefault(PyTuple_GetItem(toc_entry, 0));
+ if (modpath == NULL) {
+ Py_DECREF(data);
+ return NULL;
}
+
+ if (isbytecode)
+ code = unmarshal_code(PyBytes_AS_STRING(modpath), data, mtime);
+ else
+ code = compile_source(PyBytes_AS_STRING(modpath), data);
+ Py_DECREF(modpath);
Py_DECREF(data);
return code;
}
@@ -1106,7 +1176,7 @@ get_code_from_data(ZipImporter *self, int ispackage, int isbytecode,
'fullname'. */
static PyObject *
get_module_code(ZipImporter *self, char *fullname,
- int *p_ispackage, char **p_modpath)
+ int *p_ispackage, PyObject **p_modpath)
{
PyObject *toc_entry;
char *subname, path[MAXPATHLEN + 1];
@@ -1115,7 +1185,7 @@ get_module_code(ZipImporter *self, char *fullname,
subname = get_subname(fullname);
- len = make_filename(_PyUnicode_AsString(self->prefix), subname, path);
+ len = make_filename(self->prefix, subname, path, sizeof(path));
if (len < 0)
return NULL;
@@ -1124,9 +1194,8 @@ get_module_code(ZipImporter *self, char *fullname,
strcpy(path + len, zso->suffix);
if (Py_VerboseFlag > 1)
- PySys_WriteStderr("# trying %s%c%s\n",
- _PyUnicode_AsString(self->archive),
- (int)SEP, path);
+ PySys_FormatStderr("# trying %U%c%s\n",
+ self->archive, (int)SEP, path);
toc_entry = PyDict_GetItemString(self->files, path);
if (toc_entry != NULL) {
time_t mtime = 0;
@@ -1146,13 +1215,14 @@ get_module_code(ZipImporter *self, char *fullname,
Py_DECREF(code);
continue;
}
- if (code != NULL && p_modpath != NULL)
- *p_modpath = _PyUnicode_AsString(
- PyTuple_GetItem(toc_entry, 0));
+ if (code != NULL && p_modpath != NULL) {
+ *p_modpath = PyTuple_GetItem(toc_entry, 0);
+ Py_INCREF(*p_modpath);
+ }
return code;
}
}
- PyErr_Format(ZipImportError, "can't find module '%.200s'", fullname);
+ PyErr_Format(ZipImportError, "can't find module '%s'", fullname);
return NULL;
}
diff --git a/Modules/zlib/ChangeLog b/Modules/zlib/ChangeLog
index 7f6869d323..f310bb0fcd 100644
--- a/Modules/zlib/ChangeLog
+++ b/Modules/zlib/ChangeLog
@@ -1,6 +1,359 @@
ChangeLog file for zlib
+Changes in 1.2.5 (19 Apr 2010)
+- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev]
+- Default to libdir as sharedlibdir in configure [Nieder]
+- Update copyright dates on modified source files
+- Update trees.c to be able to generate modified trees.h
+- Exit configure for MinGW, suggesting win32/Makefile.gcc
+
+Changes in 1.2.4.5 (18 Apr 2010)
+- Set sharedlibdir in configure [Torok]
+- Set LDFLAGS in Makefile.in [Bar-Lev]
+- Avoid mkdir objs race condition in Makefile.in [Bowler]
+- Add ZLIB_INTERNAL in front of internal inter-module functions and arrays
+- Define ZLIB_INTERNAL to hide internal functions and arrays for GNU C
+- Don't use hidden attribute when it is a warning generator (e.g. Solaris)
+
+Changes in 1.2.4.4 (18 Apr 2010)
+- Fix CROSS_PREFIX executable testing, CHOST extract, mingw* [Torok]
+- Undefine _LARGEFILE64_SOURCE in zconf.h if it is zero, but not if empty
+- Try to use bash or ksh regardless of functionality of /bin/sh
+- Fix configure incompatibility with NetBSD sh
+- Remove attempt to run under bash or ksh since have better NetBSD fix
+- Fix win32/Makefile.gcc for MinGW [Bar-Lev]
+- Add diagnostic messages when using CROSS_PREFIX in configure
+- Added --sharedlibdir option to configure [Weigelt]
+- Use hidden visibility attribute when available [Frysinger]
+
+Changes in 1.2.4.3 (10 Apr 2010)
+- Only use CROSS_PREFIX in configure for ar and ranlib if they exist
+- Use CROSS_PREFIX for nm [Bar-Lev]
+- Assume _LARGEFILE64_SOURCE defined is equivalent to true
+- Avoid use of undefined symbols in #if with && and ||
+- Make *64 prototypes in gzguts.h consistent with functions
+- Add -shared load option for MinGW in configure [Bowler]
+- Move z_off64_t to public interface, use instead of off64_t
+- Remove ! from shell test in configure (not portable to Solaris)
+- Change +0 macro tests to -0 for possibly increased portability
+
+Changes in 1.2.4.2 (9 Apr 2010)
+- Add consistent carriage returns to readme.txt's in masmx86 and masmx64
+- Really provide prototypes for *64 functions when building without LFS
+- Only define unlink() in minigzip.c if unistd.h not included
+- Update README to point to contrib/vstudio project files
+- Move projects/vc6 to old/ and remove projects/
+- Include stdlib.h in minigzip.c for setmode() definition under WinCE
+- Clean up assembler builds in win32/Makefile.msc [Rowe]
+- Include sys/types.h for Microsoft for off_t definition
+- Fix memory leak on error in gz_open()
+- Symbolize nm as $NM in configure [Weigelt]
+- Use TEST_LDSHARED instead of LDSHARED to link test programs [Weigelt]
+- Add +0 to _FILE_OFFSET_BITS and _LFS64_LARGEFILE in case not defined
+- Fix bug in gzeof() to take into account unused input data
+- Avoid initialization of structures with variables in puff.c
+- Updated win32/README-WIN32.txt [Rowe]
+
+Changes in 1.2.4.1 (28 Mar 2010)
+- Remove the use of [a-z] constructs for sed in configure [gentoo 310225]
+- Remove $(SHAREDLIB) from LIBS in Makefile.in [Creech]
+- Restore "for debugging" comment on sprintf() in gzlib.c
+- Remove fdopen for MVS from gzguts.h
+- Put new README-WIN32.txt in win32 [Rowe]
+- Add check for shell to configure and invoke another shell if needed
+- Fix big fat stinking bug in gzseek() on uncompressed files
+- Remove vestigial F_OPEN64 define in zutil.h
+- Set and check the value of _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE
+- Avoid errors on non-LFS systems when applications define LFS macros
+- Set EXE to ".exe" in configure for MINGW [Kahle]
+- Match crc32() in crc32.c exactly to the prototype in zlib.h [Sherrill]
+- Add prefix for cross-compilation in win32/makefile.gcc [Bar-Lev]
+- Add DLL install in win32/makefile.gcc [Bar-Lev]
+- Allow Linux* or linux* from uname in configure [Bar-Lev]
+- Allow ldconfig to be redefined in configure and Makefile.in [Bar-Lev]
+- Add cross-compilation prefixes to configure [Bar-Lev]
+- Match type exactly in gz_load() invocation in gzread.c
+- Match type exactly of zcalloc() in zutil.c to zlib.h alloc_func
+- Provide prototypes for *64 functions when building zlib without LFS
+- Don't use -lc when linking shared library on MinGW
+- Remove errno.h check in configure and vestigial errno code in zutil.h
+
+Changes in 1.2.4 (14 Mar 2010)
+- Fix VER3 extraction in configure for no fourth subversion
+- Update zlib.3, add docs to Makefile.in to make .pdf out of it
+- Add zlib.3.pdf to distribution
+- Don't set error code in gzerror() if passed pointer is NULL
+- Apply destination directory fixes to CMakeLists.txt [Lowman]
+- Move #cmakedefine's to a new zconf.in.cmakein
+- Restore zconf.h for builds that don't use configure or cmake
+- Add distclean to dummy Makefile for convenience
+- Update and improve INDEX, README, and FAQ
+- Update CMakeLists.txt for the return of zconf.h [Lowman]
+- Update contrib/vstudio/vc9 and vc10 [Vollant]
+- Change libz.dll.a back to libzdll.a in win32/Makefile.gcc
+- Apply license and readme changes to contrib/asm686 [Raiter]
+- Check file name lengths and add -c option in minigzip.c [Li]
+- Update contrib/amd64 and contrib/masmx86/ [Vollant]
+- Avoid use of "eof" parameter in trees.c to not shadow library variable
+- Update make_vms.com for removal of zlibdefs.h [Zinser]
+- Update assembler code and vstudio projects in contrib [Vollant]
+- Remove outdated assembler code contrib/masm686 and contrib/asm586
+- Remove old vc7 and vc8 from contrib/vstudio
+- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe]
+- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open()
+- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant]
+- Remove *64 functions from win32/zlib.def (they're not 64-bit yet)
+- Fix bug in void-returning vsprintf() case in gzwrite.c
+- Fix name change from inflate.h in contrib/inflate86/inffas86.c
+- Check if temporary file exists before removing in make_vms.com [Zinser]
+- Fix make install and uninstall for --static option
+- Fix usage of _MSC_VER in gzguts.h and zutil.h [Truta]
+- Update readme.txt in contrib/masmx64 and masmx86 to assemble
+
+Changes in 1.2.3.9 (21 Feb 2010)
+- Expunge gzio.c
+- Move as400 build information to old
+- Fix updates in contrib/minizip and contrib/vstudio
+- Add const to vsnprintf test in configure to avoid warnings [Weigelt]
+- Delete zconf.h (made by configure) [Weigelt]
+- Change zconf.in.h to zconf.h.in per convention [Weigelt]
+- Check for NULL buf in gzgets()
+- Return empty string for gzgets() with len == 1 (like fgets())
+- Fix description of gzgets() in zlib.h for end-of-file, NULL return
+- Update minizip to 1.1 [Vollant]
+- Avoid MSVC loss of data warnings in gzread.c, gzwrite.c
+- Note in zlib.h that gzerror() should be used to distinguish from EOF
+- Remove use of snprintf() from gzlib.c
+- Fix bug in gzseek()
+- Update contrib/vstudio, adding vc9 and vc10 [Kuno, Vollant]
+- Fix zconf.h generation in CMakeLists.txt [Lowman]
+- Improve comments in zconf.h where modified by configure
+
+Changes in 1.2.3.8 (13 Feb 2010)
+- Clean up text files (tabs, trailing whitespace, etc.) [Oberhumer]
+- Use z_off64_t in gz_zero() and gz_skip() to match state->skip
+- Avoid comparison problem when sizeof(int) == sizeof(z_off64_t)
+- Revert to Makefile.in from 1.2.3.6 (live with the clutter)
+- Fix missing error return in gzflush(), add zlib.h note
+- Add *64 functions to zlib.map [Levin]
+- Fix signed/unsigned comparison in gz_comp()
+- Use SFLAGS when testing shared linking in configure
+- Add --64 option to ./configure to use -m64 with gcc
+- Fix ./configure --help to correctly name options
+- Have make fail if a test fails [Levin]
+- Avoid buffer overrun in contrib/masmx64/gvmat64.asm [Simpson]
+- Remove assembler object files from contrib
+
+Changes in 1.2.3.7 (24 Jan 2010)
+- Always gzopen() with O_LARGEFILE if available
+- Fix gzdirect() to work immediately after gzopen() or gzdopen()
+- Make gzdirect() more precise when the state changes while reading
+- Improve zlib.h documentation in many places
+- Catch memory allocation failure in gz_open()
+- Complete close operation if seek forward in gzclose_w() fails
+- Return Z_ERRNO from gzclose_r() if close() fails
+- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL
+- Return zero for gzwrite() errors to match zlib.h description
+- Return -1 on gzputs() error to match zlib.h description
+- Add zconf.in.h to allow recovery from configure modification [Weigelt]
+- Fix static library permissions in Makefile.in [Weigelt]
+- Avoid warnings in configure tests that hide functionality [Weigelt]
+- Add *BSD and DragonFly to Linux case in configure [gentoo 123571]
+- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212]
+- Avoid access of uninitialized data for first inflateReset2 call [Gomes]
+- Keep object files in subdirectories to reduce the clutter somewhat
+- Remove default Makefile and zlibdefs.h, add dummy Makefile
+- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_
+- Remove zlibdefs.h completely -- modify zconf.h instead
+
+Changes in 1.2.3.6 (17 Jan 2010)
+- Avoid void * arithmetic in gzread.c and gzwrite.c
+- Make compilers happier with const char * for gz_error message
+- Avoid unused parameter warning in inflate.c
+- Avoid signed-unsigned comparison warning in inflate.c
+- Indent #pragma's for traditional C
+- Fix usage of strwinerror() in glib.c, change to gz_strwinerror()
+- Correct email address in configure for system options
+- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser]
+- Update zlib.map [Brown]
+- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Torok]
+- Apply various fixes to CMakeLists.txt [Lowman]
+- Add checks on len in gzread() and gzwrite()
+- Add error message for no more room for gzungetc()
+- Remove zlib version check in gzwrite()
+- Defer compression of gzprintf() result until need to
+- Use snprintf() in gzdopen() if available
+- Remove USE_MMAP configuration determination (only used by minigzip)
+- Remove examples/pigz.c (available separately)
+- Update examples/gun.c to 1.6
+
+Changes in 1.2.3.5 (8 Jan 2010)
+- Add space after #if in zutil.h for some compilers
+- Fix relatively harmless bug in deflate_fast() [Exarevsky]
+- Fix same problem in deflate_slow()
+- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown]
+- Add deflate_rle() for faster Z_RLE strategy run-length encoding
+- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding
+- Change name of "write" variable in inffast.c to avoid library collisions
+- Fix premature EOF from gzread() in gzio.c [Brown]
+- Use zlib header window size if windowBits is 0 in inflateInit2()
+- Remove compressBound() call in deflate.c to avoid linking compress.o
+- Replace use of errno in gz* with functions, support WinCE [Alves]
+- Provide alternative to perror() in minigzip.c for WinCE [Alves]
+- Don't use _vsnprintf on later versions of MSVC [Lowman]
+- Add CMake build script and input file [Lowman]
+- Update contrib/minizip to 1.1 [Svensson, Vollant]
+- Moved nintendods directory from contrib to .
+- Replace gzio.c with a new set of routines with the same functionality
+- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
+- Update contrib/minizip to 1.1b
+- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
+
+Changes in 1.2.3.4 (21 Dec 2009)
+- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility
+- Update comments in configure and Makefile.in for default --shared
+- Fix test -z's in configure [Marquess]
+- Build examplesh and minigzipsh when not testing
+- Change NULL's to Z_NULL's in deflate.c and in comments in zlib.h
+- Import LDFLAGS from the environment in configure
+- Fix configure to populate SFLAGS with discovered CFLAGS options
+- Adapt make_vms.com to the new Makefile.in [Zinser]
+- Add zlib2ansi script for C++ compilation [Marquess]
+- Add _FILE_OFFSET_BITS=64 test to make test (when applicable)
+- Add AMD64 assembler code for longest match to contrib [Teterin]
+- Include options from $SFLAGS when doing $LDSHARED
+- Simplify 64-bit file support by introducing z_off64_t type
+- Make shared object files in objs directory to work around old Sun cc
+- Use only three-part version number for Darwin shared compiles
+- Add rc option to ar in Makefile.in for when ./configure not run
+- Add -WI,-rpath,. to LDFLAGS for OSF 1 V4*
+- Set LD_LIBRARYN32_PATH for SGI IRIX shared compile
+- Protect against _FILE_OFFSET_BITS being defined when compiling zlib
+- Rename Makefile.in targets allstatic to static and allshared to shared
+- Fix static and shared Makefile.in targets to be independent
+- Correct error return bug in gz_open() by setting state [Brown]
+- Put spaces before ;;'s in configure for better sh compatibility
+- Add pigz.c (parallel implementation of gzip) to examples/
+- Correct constant in crc32.c to UL [Leventhal]
+- Reject negative lengths in crc32_combine()
+- Add inflateReset2() function to work like inflateEnd()/inflateInit2()
+- Include sys/types.h for _LARGEFILE64_SOURCE [Brown]
+- Correct typo in doc/algorithm.txt [Janik]
+- Fix bug in adler32_combine() [Zhu]
+- Catch missing-end-of-block-code error in all inflates and in puff
+ Assures that random input to inflate eventually results in an error
+- Added enough.c (calculation of ENOUGH for inftrees.h) to examples/
+- Update ENOUGH and its usage to reflect discovered bounds
+- Fix gzerror() error report on empty input file [Brown]
+- Add ush casts in trees.c to avoid pedantic runtime errors
+- Fix typo in zlib.h uncompress() description [Reiss]
+- Correct inflate() comments with regard to automatic header detection
+- Remove deprecation comment on Z_PARTIAL_FLUSH (it stays)
+- Put new version of gzlog (2.0) in examples with interruption recovery
+- Add puff compile option to permit invalid distance-too-far streams
+- Add puff TEST command options, ability to read piped input
+- Prototype the *64 functions in zlib.h when _FILE_OFFSET_BITS == 64, but
+ _LARGEFILE64_SOURCE not defined
+- Fix Z_FULL_FLUSH to truly erase the past by resetting s->strstart
+- Fix deflateSetDictionary() to use all 32K for output consistency
+- Remove extraneous #define MIN_LOOKAHEAD in deflate.c (in deflate.h)
+- Clear bytes after deflate lookahead to avoid use of uninitialized data
+- Change a limit in inftrees.c to be more transparent to Coverity Prevent
+- Update win32/zlib.def with exported symbols from zlib.h
+- Correct spelling error in zlib.h [Willem]
+- Allow Z_BLOCK for deflate() to force a new block
+- Allow negative bits in inflatePrime() to delete existing bit buffer
+- Add Z_TREES flush option to inflate() to return at end of trees
+- Add inflateMark() to return current state information for random access
+- Add Makefile for NintendoDS to contrib [Costa]
+- Add -w in configure compile tests to avoid spurious warnings [Beucler]
+- Fix typos in zlib.h comments for deflateSetDictionary()
+- Fix EOF detection in transparent gzread() [Maier]
+
+Changes in 1.2.3.3 (2 October 2006)
+- Make --shared the default for configure, add a --static option
+- Add compile option to permit invalid distance-too-far streams
+- Add inflateUndermine() function which is required to enable above
+- Remove use of "this" variable name for C++ compatibility [Marquess]
+- Add testing of shared library in make test, if shared library built
+- Use ftello() and fseeko() if available instead of ftell() and fseek()
+- Provide two versions of all functions that use the z_off_t type for
+ binary compatibility -- a normal version and a 64-bit offset version,
+ per the Large File Support Extension when _LARGEFILE64_SOURCE is
+ defined; use the 64-bit versions by default when _FILE_OFFSET_BITS
+ is defined to be 64
+- Add a --uname= option to configure to perhaps help with cross-compiling
+
+Changes in 1.2.3.2 (3 September 2006)
+- Turn off silly Borland warnings [Hay]
+- Use off64_t and define _LARGEFILE64_SOURCE when present
+- Fix missing dependency on inffixed.h in Makefile.in
+- Rig configure --shared to build both shared and static [Teredesai, Truta]
+- Remove zconf.in.h and instead create a new zlibdefs.h file
+- Fix contrib/minizip/unzip.c non-encrypted after encrypted [Vollant]
+- Add treebuild.xml (see http://treebuild.metux.de/) [Weigelt]
+
+Changes in 1.2.3.1 (16 August 2006)
+- Add watcom directory with OpenWatcom make files [Daniel]
+- Remove #undef of FAR in zconf.in.h for MVS [Fedtke]
+- Update make_vms.com [Zinser]
+- Use -fPIC for shared build in configure [Teredesai, Nicholson]
+- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen]
+- Use fdopen() (not _fdopen()) for Interix in zutil.h [BŠck]
+- Add some FAQ entries about the contrib directory
+- Update the MVS question in the FAQ
+- Avoid extraneous reads after EOF in gzio.c [Brown]
+- Correct spelling of "successfully" in gzio.c [Randers-Pehrson]
+- Add comments to zlib.h about gzerror() usage [Brown]
+- Set extra flags in gzip header in gzopen() like deflate() does
+- Make configure options more compatible with double-dash conventions
+ [Weigelt]
+- Clean up compilation under Solaris SunStudio cc [Rowe, Reinholdtsen]
+- Fix uninstall target in Makefile.in [Truta]
+- Add pkgconfig support [Weigelt]
+- Use $(DESTDIR) macro in Makefile.in [Reinholdtsen, Weigelt]
+- Replace set_data_type() with a more accurate detect_data_type() in
+ trees.c, according to the txtvsbin.txt document [Truta]
+- Swap the order of #include <stdio.h> and #include "zlib.h" in
+ gzio.c, example.c and minigzip.c [Truta]
+- Shut up annoying VS2005 warnings about standard C deprecation [Rowe,
+ Truta] (where?)
+- Fix target "clean" from win32/Makefile.bor [Truta]
+- Create .pdb and .manifest files in win32/makefile.msc [Ziegler, Rowe]
+- Update zlib www home address in win32/DLL_FAQ.txt [Truta]
+- Update contrib/masmx86/inffas32.asm for VS2005 [Vollant, Van Wassenhove]
+- Enable browse info in the "Debug" and "ASM Debug" configurations in
+ the Visual C++ 6 project, and set (non-ASM) "Debug" as default [Truta]
+- Add pkgconfig support [Weigelt]
+- Add ZLIB_VER_MAJOR, ZLIB_VER_MINOR and ZLIB_VER_REVISION in zlib.h,
+ for use in win32/zlib1.rc [Polushin, Rowe, Truta]
+- Add a document that explains the new text detection scheme to
+ doc/txtvsbin.txt [Truta]
+- Add rfc1950.txt, rfc1951.txt and rfc1952.txt to doc/ [Truta]
+- Move algorithm.txt into doc/ [Truta]
+- Synchronize FAQ with website
+- Fix compressBound(), was low for some pathological cases [Fearnley]
+- Take into account wrapper variations in deflateBound()
+- Set examples/zpipe.c input and output to binary mode for Windows
+- Update examples/zlib_how.html with new zpipe.c (also web site)
+- Fix some warnings in examples/gzlog.c and examples/zran.c (it seems
+ that gcc became pickier in 4.0)
+- Add zlib.map for Linux: "All symbols from zlib-1.1.4 remain
+ un-versioned, the patch adds versioning only for symbols introduced in
+ zlib-1.2.0 or later. It also declares as local those symbols which are
+ not designed to be exported." [Levin]
+- Update Z_PREFIX list in zconf.in.h, add --zprefix option to configure
+- Do not initialize global static by default in trees.c, add a response
+ NO_INIT_GLOBAL_POINTERS to initialize them if needed [Marquess]
+- Don't use strerror() in gzio.c under WinCE [Yakimov]
+- Don't use errno.h in zutil.h under WinCE [Yakimov]
+- Move arguments for AR to its usage to allow replacing ar [Marot]
+- Add HAVE_VISIBILITY_PRAGMA in zconf.in.h for Mozilla [Randers-Pehrson]
+- Improve inflateInit() and inflateInit2() documentation
+- Fix structure size comment in inflate.h
+- Change configure help option from --h* to --help [Santos]
+
Changes in 1.2.3 (18 July 2005)
- Apply security vulnerability fixes to contrib/infback9 as well
- Clean up some text files (carriage returns, trailing space)
@@ -13,7 +366,7 @@ Changes in 1.2.2.4 (11 July 2005)
compile
- Fix some spelling errors in comments [Betts]
- Correct inflateInit2() error return documentation in zlib.h
-- Added zran.c example of compressed data random access to examples
+- Add zran.c example of compressed data random access to examples
directory, shows use of inflatePrime()
- Fix cast for assignments to strm->state in inflate.c and infback.c
- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer]
diff --git a/Modules/zlib/FAQ b/Modules/zlib/FAQ
index 441d910daa..1a22750a58 100644
--- a/Modules/zlib/FAQ
+++ b/Modules/zlib/FAQ
@@ -3,8 +3,8 @@
If your question is not there, please check the zlib home page
-http://www.zlib.org which may have more recent information.
-The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
+http://zlib.net/ which may have more recent information.
+The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
1. Is zlib Y2K-compliant?
@@ -13,54 +13,51 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
2. Where can I get a Windows DLL version?
- The zlib sources can be compiled without change to produce a DLL.
- See the file win32/DLL_FAQ.txt in the zlib distribution.
- Pointers to the precompiled DLL are found in the zlib web site at
- http://www.zlib.org.
+ The zlib sources can be compiled without change to produce a DLL. See the
+ file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the
+ precompiled DLL are found in the zlib web site at http://zlib.net/ .
3. Where can I get a Visual Basic interface to zlib?
See
- * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm
- * contrib/visual-basic.txt in the zlib distribution
+ * http://marknelson.us/1997/01/01/zlib-engine/
* win32/DLL_FAQ.txt in the zlib distribution
4. compress() returns Z_BUF_ERROR.
- Make sure that before the call of compress, the length of the compressed
- buffer is equal to the total size of the compressed buffer and not
- zero. For Visual Basic, check that this parameter is passed by reference
+ Make sure that before the call of compress(), the length of the compressed
+ buffer is equal to the available size of the compressed buffer and not
+ zero. For Visual Basic, check that this parameter is passed by reference
("as any"), not by value ("as long").
5. deflate() or inflate() returns Z_BUF_ERROR.
- Before making the call, make sure that avail_in and avail_out are not
- zero. When setting the parameter flush equal to Z_FINISH, also make sure
- that avail_out is big enough to allow processing all pending input.
- Note that a Z_BUF_ERROR is not fatal--another call to deflate() or
- inflate() can be made with more input or output space. A Z_BUF_ERROR
- may in fact be unavoidable depending on how the functions are used, since
- it is not possible to tell whether or not there is more output pending
- when strm.avail_out returns with zero.
+ Before making the call, make sure that avail_in and avail_out are not zero.
+ When setting the parameter flush equal to Z_FINISH, also make sure that
+ avail_out is big enough to allow processing all pending input. Note that a
+ Z_BUF_ERROR is not fatal--another call to deflate() or inflate() can be
+ made with more input or output space. A Z_BUF_ERROR may in fact be
+ unavoidable depending on how the functions are used, since it is not
+ possible to tell whether or not there is more output pending when
+ strm.avail_out returns with zero. See http://zlib.net/zlib_how.html for a
+ heavily annotated example.
6. Where's the zlib documentation (man pages, etc.)?
- It's in zlib.h for the moment, and Francis S. Lin has converted it to a
- web page zlib.html. Volunteers to transform this to Unix-style man pages,
- please contact us (zlib@gzip.org). Examples of zlib usage are in the files
- example.c and minigzip.c.
+ It's in zlib.h . Examples of zlib usage are in the files example.c and
+ minigzip.c, with more in examples/ .
7. Why don't you use GNU autoconf or libtool or ...?
- Because we would like to keep zlib as a very small and simple
- package. zlib is rather portable and doesn't need much configuration.
+ Because we would like to keep zlib as a very small and simple package.
+ zlib is rather portable and doesn't need much configuration.
8. I found a bug in zlib.
- Most of the time, such problems are due to an incorrect usage of
- zlib. Please try to reproduce the problem with a small program and send
- the corresponding source to us at zlib@gzip.org . Do not send
- multi-megabyte data files without prior agreement.
+ Most of the time, such problems are due to an incorrect usage of zlib.
+ Please try to reproduce the problem with a small program and send the
+ corresponding source to us at zlib@gzip.org . Do not send multi-megabyte
+ data files without prior agreement.
9. Why do I get "undefined reference to gzputc"?
@@ -82,7 +79,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
12. Can zlib handle .Z files?
- No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
+ No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
the code of uncompress on your own.
13. How can I make a Unix shared library?
@@ -99,8 +96,10 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
However, many flavors of Unix come with a shared zlib already installed.
Before going to the trouble of compiling a shared version of zlib and
- trying to install it, you may want to check if it's already there! If you
- can #include <zlib.h>, it's there. The -lz option will probably link to it.
+ trying to install it, you may want to check if it's already there! If you
+ can #include <zlib.h>, it's there. The -lz option will probably link to
+ it. You can check the version at the top of zlib.h or with the
+ ZLIB_VERSION symbol defined in zlib.h .
15. I have a question about OttoPDF.
@@ -109,8 +108,8 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
16. Can zlib decode Flate data in an Adobe PDF file?
- Yes. See http://www.fastio.com/ (ClibPDF), or http://www.pdflib.com/ .
- To modify PDF forms, see http://sourceforge.net/projects/acroformtool/ .
+ Yes. See http://www.pdflib.com/ . To modify PDF forms, see
+ http://sourceforge.net/projects/acroformtool/ .
17. Why am I getting this "register_frame_info not found" error on Solaris?
@@ -121,67 +120,67 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
symbol __register_frame_info: referenced symbol not found
The symbol __register_frame_info is not part of zlib, it is generated by
- the C compiler (cc or gcc). You must recompile applications using zlib
- which have this problem. This problem is specific to Solaris. See
+ the C compiler (cc or gcc). You must recompile applications using zlib
+ which have this problem. This problem is specific to Solaris. See
http://www.sunfreeware.com for Solaris versions of zlib and applications
using zlib.
18. Why does gzip give an error on a file I make with compress/deflate?
The compress and deflate functions produce data in the zlib format, which
- is different and incompatible with the gzip format. The gz* functions in
- zlib on the other hand use the gzip format. Both the zlib and gzip
- formats use the same compressed data format internally, but have different
- headers and trailers around the compressed data.
+ is different and incompatible with the gzip format. The gz* functions in
+ zlib on the other hand use the gzip format. Both the zlib and gzip formats
+ use the same compressed data format internally, but have different headers
+ and trailers around the compressed data.
19. Ok, so why are there two different formats?
- The gzip format was designed to retain the directory information about
- a single file, such as the name and last modification date. The zlib
- format on the other hand was designed for in-memory and communication
- channel applications, and has a much more compact header and trailer and
- uses a faster integrity check than gzip.
+ The gzip format was designed to retain the directory information about a
+ single file, such as the name and last modification date. The zlib format
+ on the other hand was designed for in-memory and communication channel
+ applications, and has a much more compact header and trailer and uses a
+ faster integrity check than gzip.
20. Well that's nice, but how do I make a gzip file in memory?
You can request that deflate write the gzip format instead of the zlib
- format using deflateInit2(). You can also request that inflate decode
- the gzip format using inflateInit2(). Read zlib.h for more details.
+ format using deflateInit2(). You can also request that inflate decode the
+ gzip format using inflateInit2(). Read zlib.h for more details.
21. Is zlib thread-safe?
- Yes. However any library routines that zlib uses and any application-
- provided memory allocation routines must also be thread-safe. zlib's gz*
+ Yes. However any library routines that zlib uses and any application-
+ provided memory allocation routines must also be thread-safe. zlib's gz*
functions use stdio library routines, and most of zlib's functions use the
- library memory allocation routines by default. zlib's Init functions allow
- for the application to provide custom memory allocation routines.
+ library memory allocation routines by default. zlib's *Init* functions
+ allow for the application to provide custom memory allocation routines.
Of course, you should only operate on any given zlib or gzip stream from a
single thread at a time.
22. Can I use zlib in my commercial application?
- Yes. Please read the license in zlib.h.
+ Yes. Please read the license in zlib.h.
23. Is zlib under the GNU license?
- No. Please read the license in zlib.h.
+ No. Please read the license in zlib.h.
24. The license says that altered source versions must be "plainly marked". So
what exactly do I need to do to meet that requirement?
- You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In
+ You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In
particular, the final version number needs to be changed to "f", and an
- identification string should be appended to ZLIB_VERSION. Version numbers
+ identification string should be appended to ZLIB_VERSION. Version numbers
x.x.x.f are reserved for modifications to zlib by others than the zlib
- maintainers. For example, if the version of the base zlib you are altering
+ maintainers. For example, if the version of the base zlib you are altering
is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and
- ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also
+ ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also
update the version strings in deflate.c and inftrees.c.
For altered source distributions, you should also note the origin and
nature of the changes in zlib.h, as well as in ChangeLog and README, along
- with the dates of the alterations. The origin should include at least your
+ with the dates of the alterations. The origin should include at least your
name (or your company's name), and an email address to contact for help or
issues with the library.
@@ -197,105 +196,112 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
26. Will zlib work on a 64-bit machine?
- It should. It has been tested on 64-bit machines, and has no dependence
- on any data types being limited to 32-bits in length. If you have any
+ Yes. It has been tested on 64-bit machines, and has no dependence on any
+ data types being limited to 32-bits in length. If you have any
difficulties, please provide a complete problem report to zlib@gzip.org
27. Will zlib decompress data from the PKWare Data Compression Library?
- No. The PKWare DCL uses a completely different compressed data format
- than does PKZIP and zlib. However, you can look in zlib's contrib/blast
+ No. The PKWare DCL uses a completely different compressed data format than
+ does PKZIP and zlib. However, you can look in zlib's contrib/blast
directory for a possible solution to your problem.
28. Can I access data randomly in a compressed stream?
- No, not without some preparation. If when compressing you periodically
- use Z_FULL_FLUSH, carefully write all the pending data at those points,
- and keep an index of those locations, then you can start decompression
- at those points. You have to be careful to not use Z_FULL_FLUSH too
- often, since it can significantly degrade compression.
+ No, not without some preparation. If when compressing you periodically use
+ Z_FULL_FLUSH, carefully write all the pending data at those points, and
+ keep an index of those locations, then you can start decompression at those
+ points. You have to be careful to not use Z_FULL_FLUSH too often, since it
+ can significantly degrade compression. Alternatively, you can scan a
+ deflate stream once to generate an index, and then use that index for
+ random access. See examples/zran.c .
29. Does zlib work on MVS, OS/390, CICS, etc.?
- We don't know for sure. We have heard occasional reports of success on
- these systems. If you do use it on one of these, please provide us with
- a report, instructions, and patches that we can reference when we get
- these questions. Thanks.
+ It has in the past, but we have not heard of any recent evidence. There
+ were working ports of zlib 1.1.4 to MVS, but those links no longer work.
+ If you know of recent, successful applications of zlib on these operating
+ systems, please let us know. Thanks.
-30. Is there some simpler, easier to read version of inflate I can look at
- to understand the deflate format?
+30. Is there some simpler, easier to read version of inflate I can look at to
+ understand the deflate format?
- First off, you should read RFC 1951. Second, yes. Look in zlib's
+ First off, you should read RFC 1951. Second, yes. Look in zlib's
contrib/puff directory.
31. Does zlib infringe on any patents?
- As far as we know, no. In fact, that was originally the whole point behind
- zlib. Look here for some more information:
+ As far as we know, no. In fact, that was originally the whole point behind
+ zlib. Look here for some more information:
http://www.gzip.org/#faq11
32. Can zlib work with greater than 4 GB of data?
- Yes. inflate() and deflate() will process any amount of data correctly.
+ Yes. inflate() and deflate() will process any amount of data correctly.
Each call of inflate() or deflate() is limited to input and output chunks
of the maximum value that can be stored in the compiler's "unsigned int"
- type, but there is no limit to the number of chunks. Note however that the
- strm.total_in and strm_total_out counters may be limited to 4 GB. These
+ type, but there is no limit to the number of chunks. Note however that the
+ strm.total_in and strm_total_out counters may be limited to 4 GB. These
counters are provided as a convenience and are not used internally by
- inflate() or deflate(). The application can easily set up its own counters
+ inflate() or deflate(). The application can easily set up its own counters
updated after each call of inflate() or deflate() to count beyond 4 GB.
compress() and uncompress() may be limited to 4 GB, since they operate in a
- single call. gzseek() and gztell() may be limited to 4 GB depending on how
- zlib is compiled. See the zlibCompileFlags() function in zlib.h.
+ single call. gzseek() and gztell() may be limited to 4 GB depending on how
+ zlib is compiled. See the zlibCompileFlags() function in zlib.h.
- The word "may" appears several times above since there is a 4 GB limit
- only if the compiler's "long" type is 32 bits. If the compiler's "long"
- type is 64 bits, then the limit is 16 exabytes.
+ The word "may" appears several times above since there is a 4 GB limit only
+ if the compiler's "long" type is 32 bits. If the compiler's "long" type is
+ 64 bits, then the limit is 16 exabytes.
33. Does zlib have any security vulnerabilities?
- The only one that we are aware of is potentially in gzprintf(). If zlib
- is compiled to use sprintf() or vsprintf(), then there is no protection
- against a buffer overflow of a 4K string space, other than the caller of
- gzprintf() assuring that the output will not exceed 4K. On the other
- hand, if zlib is compiled to use snprintf() or vsnprintf(), which should
- normally be the case, then there is no vulnerability. The ./configure
- script will display warnings if an insecure variation of sprintf() will
- be used by gzprintf(). Also the zlibCompileFlags() function will return
- information on what variant of sprintf() is used by gzprintf().
+ The only one that we are aware of is potentially in gzprintf(). If zlib is
+ compiled to use sprintf() or vsprintf(), then there is no protection
+ against a buffer overflow of an 8K string space (or other value as set by
+ gzbuffer()), other than the caller of gzprintf() assuring that the output
+ will not exceed 8K. On the other hand, if zlib is compiled to use
+ snprintf() or vsnprintf(), which should normally be the case, then there is
+ no vulnerability. The ./configure script will display warnings if an
+ insecure variation of sprintf() will be used by gzprintf(). Also the
+ zlibCompileFlags() function will return information on what variant of
+ sprintf() is used by gzprintf().
If you don't have snprintf() or vsnprintf() and would like one, you can
find a portable implementation here:
http://www.ijs.si/software/snprintf/
- Note that you should be using the most recent version of zlib. Versions
- 1.1.3 and before were subject to a double-free vulnerability.
+ Note that you should be using the most recent version of zlib. Versions
+ 1.1.3 and before were subject to a double-free vulnerability, and versions
+ 1.2.1 and 1.2.2 were subject to an access exception when decompressing
+ invalid compressed data.
34. Is there a Java version of zlib?
Probably what you want is to use zlib in Java. zlib is already included
as part of the Java SDK in the java.util.zip package. If you really want
a version of zlib written in the Java language, look on the zlib home
- page for links: http://www.zlib.org/
+ page for links: http://zlib.net/ .
35. I get this or that compiler or source-code scanner warning when I crank it
up to maximally-pedantic. Can't you guys write proper code?
Many years ago, we gave up attempting to avoid warnings on every compiler
- in the universe. It just got to be a waste of time, and some compilers
- were downright silly. So now, we simply make sure that the code always
- works.
+ in the universe. It just got to be a waste of time, and some compilers
+ were downright silly as well as contradicted each other. So now, we simply
+ make sure that the code always works.
36. Valgrind (or some similar memory access checker) says that deflate is
performing a conditional jump that depends on an uninitialized value.
Isn't that a bug?
- No. That is intentional for performance reasons, and the output of
- deflate is not affected. This only started showing up recently since
- zlib 1.2.x uses malloc() by default for allocations, whereas earlier
- versions used calloc(), which zeros out the allocated memory.
+ No. That is intentional for performance reasons, and the output of deflate
+ is not affected. This only started showing up recently since zlib 1.2.x
+ uses malloc() by default for allocations, whereas earlier versions used
+ calloc(), which zeros out the allocated memory. Even though the code was
+ correct, versions 1.2.4 and later was changed to not stimulate these
+ checkers.
37. Will zlib read the (insert any ancient or arcane format here) compressed
data format?
@@ -305,20 +311,21 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
38. How can I encrypt/decrypt zip files with zlib?
- zlib doesn't support encryption. The original PKZIP encryption is very weak
- and can be broken with freely available programs. To get strong encryption,
- use GnuPG, http://www.gnupg.org/ , which already includes zlib compression.
- For PKZIP compatible "encryption", look at http://www.info-zip.org/
+ zlib doesn't support encryption. The original PKZIP encryption is very
+ weak and can be broken with freely available programs. To get strong
+ encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib
+ compression. For PKZIP compatible "encryption", look at
+ http://www.info-zip.org/
39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?
- "gzip" is the gzip format, and "deflate" is the zlib format. They should
- probably have called the second one "zlib" instead to avoid confusion
- with the raw deflate compressed data format. While the HTTP 1.1 RFC 2616
+ "gzip" is the gzip format, and "deflate" is the zlib format. They should
+ probably have called the second one "zlib" instead to avoid confusion with
+ the raw deflate compressed data format. While the HTTP 1.1 RFC 2616
correctly points to the zlib specification in RFC 1950 for the "deflate"
transfer encoding, there have been reports of servers and browsers that
incorrectly produce or expect raw deflate data per the deflate
- specficiation in RFC 1951, most notably Microsoft. So even though the
+ specficiation in RFC 1951, most notably Microsoft. So even though the
"deflate" transfer encoding using the zlib format would be the more
efficient approach (and in fact exactly what the zlib format was designed
for), using the "gzip" transfer encoding is probably more reliable due to
@@ -328,12 +335,32 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
40. Does zlib support the new "Deflate64" format introduced by PKWare?
- No. PKWare has apparently decided to keep that format proprietary, since
- they have not documented it as they have previous compression formats.
- In any case, the compression improvements are so modest compared to other
- more modern approaches, that it's not worth the effort to implement.
+ No. PKWare has apparently decided to keep that format proprietary, since
+ they have not documented it as they have previous compression formats. In
+ any case, the compression improvements are so modest compared to other more
+ modern approaches, that it's not worth the effort to implement.
-41. Can you please sign these lengthy legal documents and fax them back to us
+41. I'm having a problem with the zip functions in zlib, can you help?
+
+ There are no zip functions in zlib. You are probably using minizip by
+ Giles Vollant, which is found in the contrib directory of zlib. It is not
+ part of zlib. In fact none of the stuff in contrib is part of zlib. The
+ files in there are not supported by the zlib authors. You need to contact
+ the authors of the respective contribution for help.
+
+42. The match.asm code in contrib is under the GNU General Public License.
+ Since it's part of zlib, doesn't that mean that all of zlib falls under the
+ GNU GPL?
+
+ No. The files in contrib are not part of zlib. They were contributed by
+ other authors and are provided as a convenience to the user within the zlib
+ distribution. Each item in contrib has its own license.
+
+43. Is zlib subject to export controls? What is its ECCN?
+
+ zlib is not subject to export controls, and so is classified as EAR99.
+
+44. Can you please sign these lengthy legal documents and fax them back to us
so that we can use your software in our product?
No. Go away. Shoo.
diff --git a/Modules/zlib/INDEX b/Modules/zlib/INDEX
index 0587e5902b..f6c51ca175 100644
--- a/Modules/zlib/INDEX
+++ b/Modules/zlib/INDEX
@@ -1,23 +1,32 @@
+CMakeLists.txt cmake build file
ChangeLog history of changes
FAQ Frequently Asked Questions about zlib
INDEX this file
-Makefile makefile for Unix (generated by configure)
-Makefile.in makefile for Unix (template for configure)
+Makefile dummy Makefile that tells you to ./configure
+Makefile.in template for Unix Makefile
README guess what
-algorithm.txt description of the (de)compression algorithm
configure configure script for Unix
-zconf.in.h template for zconf.h (used by configure)
+make_vms.com makefile for VMS
+treebuild.xml XML description of source file dependencies
+zconf.h.cmakein zconf.h template for cmake
+zconf.h.in zconf.h template for configure
+zlib.3 Man page for zlib
+zlib.3.pdf Man page in PDF format
+zlib.map Linux symbol information
+zlib.pc.in Template for pkg-config descriptor
+zlib2ansi perl script to convert source files for C++ compilation
amiga/ makefiles for Amiga SAS C
-as400/ makefiles for IBM AS/400
+doc/ documentation for formats and algorithms
msdos/ makefiles for MSDOS
+nintendods/ makefile for Nintendo DS
old/ makefiles for various architectures and zlib documentation
files that have not yet been updated for zlib 1.2.x
-projects/ projects for various Integrated Development Environments
qnx/ makefiles for QNX
+watcom/ makefiles for OpenWatcom
win32/ makefiles for Windows
- zlib public header files (must be kept):
+ zlib public header files (required for library use):
zconf.h
zlib.h
@@ -28,7 +37,11 @@ crc32.c
crc32.h
deflate.c
deflate.h
-gzio.c
+gzclose.c
+gzguts.h
+gzlib.c
+gzread.c
+gzwrite.c
infback.c
inffast.c
inffast.h
@@ -46,6 +59,7 @@ zutil.h
source files for sample programs:
example.c
minigzip.c
+See examples/README.examples for more
unsupported contribution by third parties
See contrib/README.contrib
diff --git a/Modules/zlib/Makefile b/Modules/zlib/Makefile
index 2fd6e45c48..6bba86c73f 100644
--- a/Modules/zlib/Makefile
+++ b/Modules/zlib/Makefile
@@ -1,154 +1,5 @@
-# Makefile for zlib
-# Copyright (C) 1995-2005 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h
+all:
+ -@echo "Please use ./configure first. Thank you."
-# To compile and test, type:
-# ./configure; make test
-# The call of configure is optional if you don't have special requirements
-# If you wish to build zlib as a shared library, use: ./configure -s
-
-# To use the asm code, type:
-# cp contrib/asm?86/match.S ./match.S
-# make LOC=-DASMV OBJA=match.o
-
-# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
-# make install
-# To install in $HOME instead of /usr/local, use:
-# make install prefix=$HOME
-
-CC=cc
-
-CFLAGS=-O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-g -DDEBUG
-#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-# -Wstrict-prototypes -Wmissing-prototypes
-
-LDFLAGS=libz.a
-LDSHARED=$(CC)
-CPP=$(CC) -E
-
-LIBS=libz.a
-SHAREDLIB=libz.so
-SHAREDLIBV=libz.so.1.2.3
-SHAREDLIBM=libz.so.1
-
-AR=ar rc
-RANLIB=ranlib
-TAR=tar
-SHELL=/bin/sh
-EXE=
-
-prefix = /usr/local
-exec_prefix = ${prefix}
-libdir = ${exec_prefix}/lib
-includedir = ${prefix}/include
-mandir = ${prefix}/share/man
-man3dir = ${mandir}/man3
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
- zutil.o inflate.o infback.o inftrees.o inffast.o
-
-OBJA =
-# to use the asm code: make OBJA=match.o
-
-TEST_OBJS = example.o minigzip.o
-
-all: example$(EXE) minigzip$(EXE)
-
-check: test
-test: all
- @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
- echo hello world | ./minigzip | ./minigzip -d || \
- echo ' *** minigzip test FAILED ***' ; \
- if ./example; then \
- echo ' *** zlib test OK ***'; \
- else \
- echo ' *** zlib test FAILED ***'; \
- fi
-
-libz.a: $(OBJS) $(OBJA)
- $(AR) $@ $(OBJS) $(OBJA)
- -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
-
-match.o: match.S
- $(CPP) match.S > _match.s
- $(CC) -c _match.s
- mv _match.o match.o
- rm -f _match.s
-
-$(SHAREDLIBV): $(OBJS)
- $(LDSHARED) -o $@ $(OBJS)
- rm -f $(SHAREDLIB) $(SHAREDLIBM)
- ln -s $@ $(SHAREDLIB)
- ln -s $@ $(SHAREDLIBM)
-
-example$(EXE): example.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
-
-minigzip$(EXE): minigzip.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
-
-install: $(LIBS)
- -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
- -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi
- -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
- -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
- cp zlib.h zconf.h $(includedir)
- chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
- cp $(LIBS) $(libdir)
- cd $(libdir); chmod 755 $(LIBS)
- -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
- cd $(libdir); if test -f $(SHAREDLIBV); then \
- rm -f $(SHAREDLIB) $(SHAREDLIBM); \
- ln -s $(SHAREDLIBV) $(SHAREDLIB); \
- ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
- (ldconfig || true) >/dev/null 2>&1; \
- fi
- cp zlib.3 $(man3dir)
- chmod 644 $(man3dir)/zlib.3
-# The ranlib in install is needed on NeXTSTEP which checks file times
-# ldconfig is for Linux
-
-uninstall:
- cd $(includedir); \
- cd $(libdir); rm -f libz.a; \
- if test -f $(SHAREDLIBV); then \
- rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
- fi
- cd $(man3dir); rm -f zlib.3
-
-mostlyclean: clean
-clean:
- rm -f *.o *~ example$(EXE) minigzip$(EXE) \
- libz.* foo.gz so_locations \
- _match.s maketree contrib/infback9/*.o
-
-maintainer-clean: distclean
-distclean: clean
- cp -p Makefile.in Makefile
- cp -p zconf.in.h zconf.h
- rm -f .DS_Store
-
-tags:
- etags *.[ch]
-
-depend:
- makedepend -- $(CFLAGS) -- *.[ch]
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-adler32.o: zlib.h zconf.h
-compress.o: zlib.h zconf.h
-crc32.o: crc32.h zlib.h zconf.h
-deflate.o: deflate.h zutil.h zlib.h zconf.h
-example.o: zlib.h zconf.h
-gzio.o: zutil.h zlib.h zconf.h
-inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
-inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
-infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
-inftrees.o: zutil.h zlib.h zconf.h inftrees.h
-minigzip.o: zlib.h zconf.h
-trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
-uncompr.o: zlib.h zconf.h
-zutil.o: zutil.h zlib.h zconf.h
+distclean:
+ make -f Makefile.in distclean
diff --git a/Modules/zlib/Makefile.in b/Modules/zlib/Makefile.in
index 2fd6e45c48..5b15bd00d7 100644
--- a/Modules/zlib/Makefile.in
+++ b/Modules/zlib/Makefile.in
@@ -1,11 +1,11 @@
# Makefile for zlib
-# Copyright (C) 1995-2005 Jean-loup Gailly.
+# Copyright (C) 1995-2010 Jean-loup Gailly.
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type:
# ./configure; make test
-# The call of configure is optional if you don't have special requirements
-# If you wish to build zlib as a shared library, use: ./configure -s
+# Normally configure builds both a static and a shared library.
+# If you want to build just a static library, use: ./configure --static
# To use the asm code, type:
# cp contrib/asm?86/match.S ./match.S
@@ -24,17 +24,22 @@ CFLAGS=-O
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes
-LDFLAGS=libz.a
+SFLAGS=-O
+LDFLAGS=
+TEST_LDFLAGS=-L. libz.a
LDSHARED=$(CC)
CPP=$(CC) -E
-LIBS=libz.a
+STATICLIB=libz.a
SHAREDLIB=libz.so
-SHAREDLIBV=libz.so.1.2.3
+SHAREDLIBV=libz.so.1.2.5
SHAREDLIBM=libz.so.1
+LIBS=$(STATICLIB) $(SHAREDLIBV)
AR=ar rc
RANLIB=ranlib
+LDCONFIG=ldconfig
+LDSHAREDLIBC=-lc
TAR=tar
SHELL=/bin/sh
EXE=
@@ -42,33 +47,68 @@ EXE=
prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
+sharedlibdir = ${libdir}
includedir = ${prefix}/include
mandir = ${prefix}/share/man
man3dir = ${mandir}/man3
+pkgconfigdir = ${libdir}/pkgconfig
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
- zutil.o inflate.o infback.o inftrees.o inffast.o
+OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
+ gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
+PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzlib.lo gzread.lo \
+ gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo
+
+# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
OBJA =
-# to use the asm code: make OBJA=match.o
+PIC_OBJA =
+
+OBJS = $(OBJC) $(OBJA)
+
+PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
+
+all: static shared
-TEST_OBJS = example.o minigzip.o
+static: example$(EXE) minigzip$(EXE)
-all: example$(EXE) minigzip$(EXE)
+shared: examplesh$(EXE) minigzipsh$(EXE)
+
+all64: example64$(EXE) minigzip64$(EXE)
check: test
-test: all
- @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
- echo hello world | ./minigzip | ./minigzip -d || \
- echo ' *** minigzip test FAILED ***' ; \
- if ./example; then \
+
+test: all teststatic testshared
+
+teststatic: static
+ @if echo hello world | ./minigzip | ./minigzip -d && ./example; then \
echo ' *** zlib test OK ***'; \
else \
- echo ' *** zlib test FAILED ***'; \
+ echo ' *** zlib test FAILED ***'; false; \
+ fi
+ -@rm -f foo.gz
+
+testshared: shared
+ @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
+ DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
+ SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
+ if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh; then \
+ echo ' *** zlib shared test OK ***'; \
+ else \
+ echo ' *** zlib shared test FAILED ***'; false; \
+ fi
+ -@rm -f foo.gz
+
+test64: all64
+ @if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64; then \
+ echo ' *** zlib 64-bit test OK ***'; \
+ else \
+ echo ' *** zlib 64-bit test FAILED ***'; false; \
fi
+ -@rm -f foo.gz
-libz.a: $(OBJS) $(OBJA)
- $(AR) $@ $(OBJS) $(OBJA)
+libz.a: $(OBJS)
+ $(AR) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
match.o: match.S
@@ -77,58 +117,116 @@ match.o: match.S
mv _match.o match.o
rm -f _match.s
-$(SHAREDLIBV): $(OBJS)
- $(LDSHARED) -o $@ $(OBJS)
+match.lo: match.S
+ $(CPP) match.S > _match.s
+ $(CC) -c -fPIC _match.s
+ mv _match.o match.lo
+ rm -f _match.s
+
+example64.o: example.c zlib.h zconf.h
+ $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
+
+minigzip64.o: minigzip.c zlib.h zconf.h
+ $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
+
+.SUFFIXES: .lo
+
+.c.lo:
+ -@mkdir objs 2>/dev/null || test -d objs
+ $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
+ -@mv objs/$*.o $@
+
+$(SHAREDLIBV): $(PIC_OBJS)
+ $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
rm -f $(SHAREDLIB) $(SHAREDLIBM)
ln -s $@ $(SHAREDLIB)
ln -s $@ $(SHAREDLIBM)
+ -@rmdir objs
+
+example$(EXE): example.o $(STATICLIB)
+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
+
+minigzip$(EXE): minigzip.o $(STATICLIB)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
+
+examplesh$(EXE): example.o $(SHAREDLIBV)
+ $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
+
+minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
+ $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
-example$(EXE): example.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
-
-minigzip$(EXE): minigzip.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
-
-install: $(LIBS)
- -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
- -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi
- -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
- -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
- cp zlib.h zconf.h $(includedir)
- chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
- cp $(LIBS) $(libdir)
- cd $(libdir); chmod 755 $(LIBS)
- -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
- cd $(libdir); if test -f $(SHAREDLIBV); then \
+example64$(EXE): example64.o $(STATICLIB)
+ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
+
+minigzip64$(EXE): minigzip64.o $(STATICLIB)
+ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
+
+install-libs: $(LIBS)
+ -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
+ -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
+ -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
+ -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
+ -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
+ cp $(STATICLIB) $(DESTDIR)$(libdir)
+ cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)
+ cd $(DESTDIR)$(libdir); chmod u=rw,go=r $(STATICLIB)
+ -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+ -@cd $(DESTDIR)$(sharedlibdir); if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
+ chmod 755 $(SHAREDLIBV); \
rm -f $(SHAREDLIB) $(SHAREDLIBM); \
ln -s $(SHAREDLIBV) $(SHAREDLIB); \
ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
- (ldconfig || true) >/dev/null 2>&1; \
+ ($(LDCONFIG) || true) >/dev/null 2>&1; \
fi
- cp zlib.3 $(man3dir)
- chmod 644 $(man3dir)/zlib.3
+ cp zlib.3 $(DESTDIR)$(man3dir)
+ chmod 644 $(DESTDIR)$(man3dir)/zlib.3
+ cp zlib.pc $(DESTDIR)$(pkgconfigdir)
+ chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
# The ranlib in install is needed on NeXTSTEP which checks file times
# ldconfig is for Linux
+install: install-libs
+ -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
+ cp zlib.h zconf.h $(DESTDIR)$(includedir)
+ chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
+
uninstall:
- cd $(includedir); \
- cd $(libdir); rm -f libz.a; \
- if test -f $(SHAREDLIBV); then \
+ cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
+ cd $(DESTDIR)$(libdir); rm -f libz.a; \
+ if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
fi
- cd $(man3dir); rm -f zlib.3
+ cd $(DESTDIR)$(man3dir); rm -f zlib.3
+ cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc
+
+docs: zlib.3.pdf
+
+zlib.3.pdf: zlib.3
+ groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf
+
+zconf.h.in: zconf.h.cmakein
+ sed "/^#cmakedefine/D" < zconf.h.cmakein > zconf.h.in
+ touch -r zconf.h.cmakein zconf.h.in
+
+zconf: zconf.h.in
+ cp -p zconf.h.in zconf.h
mostlyclean: clean
clean:
- rm -f *.o *~ example$(EXE) minigzip$(EXE) \
+ rm -f *.o *.lo *~ \
+ example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
+ example64$(EXE) minigzip64$(EXE) \
libz.* foo.gz so_locations \
_match.s maketree contrib/infback9/*.o
+ rm -rf objs
maintainer-clean: distclean
-distclean: clean
- cp -p Makefile.in Makefile
- cp -p zconf.in.h zconf.h
- rm -f .DS_Store
+distclean: clean zconf docs
+ rm -f Makefile zlib.pc
+ -@rm -f .DS_Store
+ -@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile
+ -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile
+ -@touch -r Makefile.in Makefile
tags:
etags *.[ch]
@@ -138,17 +236,22 @@ depend:
# DO NOT DELETE THIS LINE -- make depend depends on it.
-adler32.o: zlib.h zconf.h
-compress.o: zlib.h zconf.h
-crc32.o: crc32.h zlib.h zconf.h
+adler32.o zutil.o: zutil.h zlib.h zconf.h
+gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h
+compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h
+crc32.o: zutil.h zlib.h zconf.h crc32.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
-example.o: zlib.h zconf.h
-gzio.o: zutil.h zlib.h zconf.h
+infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
-inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
-infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
-minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
-uncompr.o: zlib.h zconf.h
-zutil.o: zutil.h zlib.h zconf.h
+
+adler32.lo zutil.lo: zutil.h zlib.h zconf.h
+gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h
+compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h
+crc32.lo: zutil.h zlib.h zconf.h crc32.h
+deflate.lo: deflate.h zutil.h zlib.h zconf.h
+infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
+inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inftrees.lo: zutil.h zlib.h zconf.h inftrees.h
+trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h
diff --git a/Modules/zlib/README b/Modules/zlib/README
index 02c29d47f4..d4219bf889 100644
--- a/Modules/zlib/README
+++ b/Modules/zlib/README
@@ -1,56 +1,52 @@
ZLIB DATA COMPRESSION LIBRARY
-zlib 1.2.3 is a general purpose data compression library. All the code is
+zlib 1.2.5 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
-and rfc1952.txt (gzip format). These documents are also available in other
-formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
+and rfc1952.txt (gzip format).
All functions of the compression library are documented in the file zlib.h
-(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
+(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
of the library is given in the file example.c which also tests that the library
-is working correctly. Another example is given in the file minigzip.c. The
+is working correctly. Another example is given in the file minigzip.c. The
compression library itself is composed of all source files except example.c and
minigzip.c.
To compile all files and run the test program, follow the instructions given at
-the top of Makefile. In short "make test; make install" should work for most
-machines. For Unix: "./configure; make test; make install". For MSDOS, use one
-of the special makefiles such as Makefile.msc. For VMS, use make_vms.com.
+the top of Makefile.in. In short "./configure; make test", and if that goes
+well, "make install" should work for most flavors of Unix. For Windows, use one
+of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
+make_vms.com.
Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
-<info@winimage.com> for the Windows DLL version. The zlib home page is
-http://www.zlib.org or http://www.gzip.org/zlib/ Before reporting a problem,
-please check this site to verify that you have the latest version of zlib;
-otherwise get the latest version and check whether the problem still exists or
-not.
+<info@winimage.com> for the Windows DLL version. The zlib home page is
+http://zlib.net/ . Before reporting a problem, please check this site to
+verify that you have the latest version of zlib; otherwise get the latest
+version and check whether the problem still exists or not.
-PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html before asking
-for help.
+PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
-Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
-issue of Dr. Dobb's Journal; a copy of the article is available in
-http://dogma.net/markn/articles/zlibtool/zlibtool.htm
+Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
+issue of Dr. Dobb's Journal; a copy of the article is available at
+http://marknelson.us/1997/01/01/zlib-engine/ .
-The changes made in version 1.2.3 are documented in the file ChangeLog.
+The changes made in version 1.2.5 are documented in the file ChangeLog.
-Unsupported third party contributions are provided in directory "contrib".
+Unsupported third party contributions are provided in directory contrib/ .
-A Java implementation of zlib is available in the Java Development Kit
-http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html
-See the zlib home page http://www.zlib.org for details.
+zlib is available in Java using the java.util.zip package, documented at
+http://java.sun.com/developer/technicalArticles/Programming/compression/ .
-A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is in the
-CPAN (Comprehensive Perl Archive Network) sites
-http://www.cpan.org/modules/by-module/Compress/
+A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
+at CPAN (Comprehensive Perl Archive Network) sites, including
+http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
available in Python 1.5 and later versions, see
-http://www.python.org/doc/lib/module-zlib.html
+http://www.python.org/doc/lib/module-zlib.html .
-A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> is
-availlable at http://www.oche.de/~akupries/soft/trf/trf_zip.html
+zlib is built into tcl: http://wiki.tcl.tk/4610 .
An experimental package to read and write files in .zip format, written on top
of zlib by Gilles Vollant <info@winimage.com>, is available in the
@@ -74,25 +70,21 @@ Notes for some targets:
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
other compilers. Use "make test" to check your compiler.
-- gzdopen is not supported on BEOS and by some Mac compilers.
+- gzdopen is not supported on RISCOS or BEOS.
- For PalmOs, see http://palmzlib.sourceforge.net/
-- When building a shared, i.e. dynamic library on Mac OS X, the library must be
- installed before testing (do "make install" before "make test"), since the
- library location is specified in the library.
-
Acknowledgments:
- The deflate format used by zlib was defined by Phil Katz. The deflate
- and zlib specifications were written by L. Peter Deutsch. Thanks to all the
- people who reported problems and suggested various improvements in zlib;
- they are too numerous to cite here.
+ The deflate format used by zlib was defined by Phil Katz. The deflate and
+ zlib specifications were written by L. Peter Deutsch. Thanks to all the
+ people who reported problems and suggested various improvements in zlib; they
+ are too numerous to cite here.
Copyright notice:
- (C) 1995-2004 Jean-loup Gailly and Mark Adler
+ (C) 1995-2010 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -113,13 +105,11 @@ Copyright notice:
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
-If you use the zlib library in a product, we would appreciate *not*
-receiving lengthy legal documents to sign. The sources are provided
-for free but without warranty of any kind. The library has been
-entirely written by Jean-loup Gailly and Mark Adler; it does not
-include third-party code.
+If you use the zlib library in a product, we would appreciate *not* receiving
+lengthy legal documents to sign. The sources are provided for free but without
+warranty of any kind. The library has been entirely written by Jean-loup
+Gailly and Mark Adler; it does not include third-party code.
-If you redistribute modified sources, we would appreciate that you include
-in the file ChangeLog history information documenting your changes. Please
-read the FAQ for more information on the distribution of modified source
-versions.
+If you redistribute modified sources, we would appreciate that you include in
+the file ChangeLog history information documenting your changes. Please read
+the FAQ for more information on the distribution of modified source versions.
diff --git a/Modules/zlib/adler32.c b/Modules/zlib/adler32.c
index 007ba26277..65ad6a5adc 100644
--- a/Modules/zlib/adler32.c
+++ b/Modules/zlib/adler32.c
@@ -1,12 +1,15 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2004 Mark Adler
+ * Copyright (C) 1995-2007 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
-#define ZLIB_INTERNAL
-#include "zlib.h"
+#include "zutil.h"
+
+#define local static
+
+local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
#define BASE 65521UL /* largest prime smaller than 65536 */
#define NMAX 5552
@@ -125,10 +128,10 @@ uLong ZEXPORT adler32(adler, buf, len)
}
/* ========================================================================= */
-uLong ZEXPORT adler32_combine(adler1, adler2, len2)
+local uLong adler32_combine_(adler1, adler2, len2)
uLong adler1;
uLong adler2;
- z_off_t len2;
+ z_off64_t len2;
{
unsigned long sum1;
unsigned long sum2;
@@ -141,9 +144,26 @@ uLong ZEXPORT adler32_combine(adler1, adler2, len2)
MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1;
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
- if (sum1 > BASE) sum1 -= BASE;
- if (sum1 > BASE) sum1 -= BASE;
- if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
- if (sum2 > BASE) sum2 -= BASE;
+ if (sum1 >= BASE) sum1 -= BASE;
+ if (sum1 >= BASE) sum1 -= BASE;
+ if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
+ if (sum2 >= BASE) sum2 -= BASE;
return sum1 | (sum2 << 16);
}
+
+/* ========================================================================= */
+uLong ZEXPORT adler32_combine(adler1, adler2, len2)
+ uLong adler1;
+ uLong adler2;
+ z_off_t len2;
+{
+ return adler32_combine_(adler1, adler2, len2);
+}
+
+uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
+ uLong adler1;
+ uLong adler2;
+ z_off64_t len2;
+{
+ return adler32_combine_(adler1, adler2, len2);
+}
diff --git a/Modules/zlib/compress.c b/Modules/zlib/compress.c
index df04f0148e..ea4dfbe9d7 100644
--- a/Modules/zlib/compress.c
+++ b/Modules/zlib/compress.c
@@ -1,5 +1,5 @@
/* compress.c -- compress a memory buffer
- * Copyright (C) 1995-2003 Jean-loup Gailly.
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -75,5 +75,6 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
uLong ZEXPORT compressBound (sourceLen)
uLong sourceLen;
{
- return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11;
+ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+ (sourceLen >> 25) + 13;
}
diff --git a/Modules/zlib/configure b/Modules/zlib/configure
index d7ffdc3458..bd9edd26cd 100755
--- a/Modules/zlib/configure
+++ b/Modules/zlib/configure
@@ -1,37 +1,61 @@
#!/bin/sh
-# configure script for zlib. This script is needed only if
-# you wish to build a shared library and your system supports them,
-# of if you need special compiler, flags or install directory.
-# Otherwise, you can just use directly "make test; make install"
+# configure script for zlib.
#
-# To create a shared library, use "configure --shared"; by default a static
-# library is created. If the primitive shared library support provided here
-# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz
+# Normally configure builds both a static and a shared library.
+# If you want to build just a static library, use: ./configure --static
#
# To impose specific compiler or flags or install directory, use for example:
# prefix=$HOME CC=cc CFLAGS="-O4" ./configure
# or for csh/tcsh users:
# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
-# LDSHARED is the command to be used to create a shared library
# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
# If you have problems, try without defining CC and CFLAGS before reporting
# an error.
-LIBS=libz.a
-LDFLAGS="-L. ${LIBS}"
+if [ -n "${CHOST}" ]; then
+ uname="$(echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/')"
+ CROSS_PREFIX="${CHOST}-"
+fi
+
+STATICLIB=libz.a
+LDFLAGS="${LDFLAGS} -L. ${STATICLIB}"
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
+VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h`
VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
-AR=${AR-"ar rc"}
-RANLIB=${RANLIB-"ranlib"}
+if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
+ AR=${AR-"${CROSS_PREFIX}ar"}
+ test -n "${CROSS_PREFIX}" && echo Using ${AR}
+else
+ AR=${AR-"ar"}
+ test -n "${CROSS_PREFIX}" && echo Using ${AR}
+fi
+AR_RC="${AR} rc"
+if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
+ RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
+ test -n "${CROSS_PREFIX}" && echo Using ${RANLIB}
+else
+ RANLIB=${RANLIB-"ranlib"}
+fi
+if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
+ NM=${NM-"${CROSS_PREFIX}nm"}
+ test -n "${CROSS_PREFIX}" && echo Using ${NM}
+else
+ NM=${NM-"nm"}
+fi
+LDCONFIG=${LDCONFIG-"ldconfig"}
+LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
prefix=${prefix-/usr/local}
exec_prefix=${exec_prefix-'${prefix}'}
libdir=${libdir-'${exec_prefix}/lib'}
+sharedlibdir=${sharedlibdir-'${libdir}'}
includedir=${includedir-'${prefix}/include'}
mandir=${mandir-'${prefix}/share/man'}
shared_ext='.so'
-shared=0
+shared=1
+zprefix=0
+build64=0
gcc=0
old_cc="$CC"
old_cflags="$CFLAGS"
@@ -39,21 +63,29 @@ old_cflags="$CFLAGS"
while test $# -ge 1
do
case "$1" in
- -h* | --h*)
+ -h* | --help)
echo 'usage:'
- echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]'
- echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
- exit 0;;
- -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
- -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
- -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
- -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;;
- -p* | --p*) prefix="$2"; shift; shift;;
- -e* | --e*) exec_prefix="$2"; shift; shift;;
- -l* | --l*) libdir="$2"; shift; shift;;
- -i* | --i*) includedir="$2"; shift; shift;;
- -s* | --s*) shared=1; shift;;
- *) echo "unknown option: $1"; echo "$0 --help for help"; exit 1;;
+ echo ' configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]'
+ echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]'
+ echo ' [--includedir=INCLUDEDIR]'
+ exit 0 ;;
+ -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
+ -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
+ -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
+ --sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
+ -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
+ -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
+ -p* | --prefix) prefix="$2"; shift; shift ;;
+ -e* | --eprefix) exec_prefix="$2"; shift; shift ;;
+ -l* | --libdir) libdir="$2"; shift; shift ;;
+ -i* | --includedir) includedir="$2"; shift; shift ;;
+ -s* | --shared | --enable-shared) shared=1; shift ;;
+ -t | --static) shared=0; shift ;;
+ -z* | --zprefix) zprefix=1; shift ;;
+ -6* | --64) build64=1; shift ;;
+ --sysconfdir=*) echo "ignored option: --sysconfdir"; shift ;;
+ --localstatedir=*) echo "ignored option: --localstatedir"; shift ;;
+ *) echo "unknown option: $1"; echo "$0 --help for help"; exit 1 ;;
esac
done
@@ -63,46 +95,68 @@ extern int getchar();
int hello() {return getchar();}
EOF
-test -z "$CC" && echo Checking for gcc...
-cc=${CC-gcc}
+test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc...
+cc=${CC-${CROSS_PREFIX}gcc}
cflags=${CFLAGS-"-O3"}
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
case "$cc" in
- *gcc*) gcc=1;;
+ *gcc*) gcc=1 ;;
esac
if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
CC="$cc"
- SFLAGS=${CFLAGS-"-fPIC -O3"}
- CFLAGS="$cflags"
- case `(uname -s || echo unknown) 2>/dev/null` in
- Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
- CYGWIN* | Cygwin* | cygwin* | OS/2* )
- EXE='.exe';;
+ SFLAGS="${CFLAGS--O3} -fPIC"
+ CFLAGS="${CFLAGS--O3}"
+ if test $build64 -eq 1; then
+ CFLAGS="${CFLAGS} -m64"
+ SFLAGS="${SFLAGS} -m64"
+ fi
+ if test "${ZLIBGCCWARN}" = "YES"; then
+ CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
+ fi
+ if test -z "$uname"; then
+ uname=`(uname -s || echo unknown) 2>/dev/null`
+ fi
+ case "$uname" in
+ Linux* | linux* | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
+ CYGWIN* | Cygwin* | cygwin* | OS/2*)
+ EXE='.exe' ;;
+ MINGW*|mingw*)
+# temporary bypass
+ rm -f $test.[co] $test $test$shared_ext
+ echo "Please use win32/Makefile.gcc instead."
+ exit 1
+ LDSHARED=${LDSHARED-"$cc -shared"}
+ LDSHAREDLIBC=""
+ EXE='.exe' ;;
QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
# (alain.bonnefoy@icbt.com)
- LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"};;
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
HP-UX*)
LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
case `(uname -m || echo unknown) 2>/dev/null` in
ia64)
shared_ext='.so'
- SHAREDLIB='libz.so';;
+ SHAREDLIB='libz.so' ;;
*)
shared_ext='.sl'
- SHAREDLIB='libz.sl';;
- esac;;
+ SHAREDLIB='libz.sl' ;;
+ esac ;;
Darwin*) shared_ext='.dylib'
SHAREDLIB=libz$shared_ext
SHAREDLIBV=libz.$VER$shared_ext
SHAREDLIBM=libz.$VER1$shared_ext
- LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER"};;
- *) LDSHARED=${LDSHARED-"$cc -shared"};;
+ LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} ;;
+ *) LDSHARED=${LDSHARED-"$cc -shared"} ;;
esac
else
# find system name and corresponding cc options
CC=${CC-cc}
- case `(uname -sr || echo unknown) 2>/dev/null` in
+ gcc=0
+ if test -z "$uname"; then
+ uname=`(uname -sr || echo unknown) 2>/dev/null`
+ fi
+ case "$uname" in
HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
CFLAGS=${CFLAGS-"-O"}
# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
@@ -110,57 +164,64 @@ else
case `(uname -m || echo unknown) 2>/dev/null` in
ia64)
shared_ext='.so'
- SHAREDLIB='libz.so';;
+ SHAREDLIB='libz.so' ;;
*)
shared_ext='.sl'
- SHAREDLIB='libz.sl';;
- esac;;
+ SHAREDLIB='libz.sl' ;;
+ esac ;;
IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
CFLAGS=${CFLAGS-"-ansi -O2"}
- LDSHARED=${LDSHARED-"cc -shared"};;
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"}
- LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
+ LDFLAGS="${LDFLAGS} -Wl,-rpath,."
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"}
- LDSHARED=${LDSHARED-"cc -shared"};;
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
QNX*) SFLAGS=${CFLAGS-"-4 -O"}
CFLAGS=${CFLAGS-"-4 -O"}
LDSHARED=${LDSHARED-"cc"}
RANLIB=${RANLIB-"true"}
- AR="cc -A";;
+ AR_RC="cc -A" ;;
SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
CFLAGS=${CFLAGS-"-O3"}
- LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};;
- SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."}
- CFLAGS=${CFLAGS-"-fast -xcg89"}
- LDSHARED=${LDSHARED-"cc -G"};;
+ LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
+ SunOS\ 5*) LDSHARED=${LDSHARED-"cc -G"}
+ case `(uname -m || echo unknown) 2>/dev/null` in
+ i86*)
+ SFLAGS=${CFLAGS-"-xpentium -fast -KPIC -R."}
+ CFLAGS=${CFLAGS-"-xpentium -fast"} ;;
+ *)
+ SFLAGS=${CFLAGS-"-fast -xcg92 -KPIC -R."}
+ CFLAGS=${CFLAGS-"-fast -xcg92"} ;;
+ esac ;;
SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
CFLAGS=${CFLAGS-"-O2"}
- LDSHARED=${LDSHARED-"ld"};;
- SunStudio\ 9*) SFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
- CFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xtarget=ultra3 -xarch=v9b"}
- LDSHARED=${LDSHARED-"cc -xarch=v9b"};;
+ LDSHARED=${LDSHARED-"ld"} ;;
+ SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
+ CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
+ LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
UNIX_System_V\ 4.2.0)
SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"}
- LDSHARED=${LDSHARED-"cc -G"};;
+ LDSHARED=${LDSHARED-"cc -G"} ;;
UNIX_SV\ 4.2MP)
SFLAGS=${CFLAGS-"-Kconform_pic -O"}
CFLAGS=${CFLAGS-"-O"}
- LDSHARED=${LDSHARED-"cc -G"};;
+ LDSHARED=${LDSHARED-"cc -G"} ;;
OpenUNIX\ 5)
SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"}
- LDSHARED=${LDSHARED-"cc -G"};;
+ LDSHARED=${LDSHARED-"cc -G"} ;;
AIX*) # Courtesy of dbakker@arrayasolutions.com
SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
- LDSHARED=${LDSHARED-"xlc -G"};;
- # send working options for other systems to support@gzip.org
+ LDSHARED=${LDSHARED-"xlc -G"} ;;
+ # send working options for other systems to zlib@gzip.org
*) SFLAGS=${CFLAGS-"-O"}
CFLAGS=${CFLAGS-"-O"}
- LDSHARED=${LDSHARED-"cc -shared"};;
+ LDSHARED=${LDSHARED-"cc -shared"} ;;
esac
fi
@@ -171,38 +232,83 @@ SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
if test $shared -eq 1; then
echo Checking for shared library support...
# we must test in two steps (cc then ld), required at least on SunOS 4.x
- if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
- test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
- CFLAGS="$SFLAGS"
- LIBS="$SHAREDLIBV"
+ if test "`($CC -w -c $SFLAGS $test.c) 2>&1`" = "" &&
+ test "`($LDSHARED $SFLAGS -o $test$shared_ext $test.o) 2>&1`" = ""; then
echo Building shared library $SHAREDLIBV with $CC.
elif test -z "$old_cc" -a -z "$old_cflags"; then
echo No shared library support.
shared=0;
else
+ echo Tested $CC -w -c $SFLAGS $test.c
+ $CC -w -c $SFLAGS $test.c
+ echo Tested $LDSHARED $SFLAGS -o $test$shared_ext $test.o
+ $LDSHARED $SFLAGS -o $test$shared_ext $test.o
echo 'No shared library support; try without defining CC and CFLAGS'
shared=0;
fi
fi
if test $shared -eq 0; then
LDSHARED="$CC"
- echo Building static library $LIBS version $VER with $CC.
+ ALL="static"
+ TEST="all teststatic"
+ SHAREDLIB=""
+ SHAREDLIBV=""
+ SHAREDLIBM=""
+ echo Building static library $STATICLIB version $VER with $CC.
else
- LDFLAGS="-L. ${SHAREDLIBV}"
+ ALL="static shared"
+ TEST="all teststatic testshared"
fi
cat > $test.c <<EOF
+#include <sys/types.h>
+off64_t dummy = 0;
+EOF
+if test "`($CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c) 2>&1`" = ""; then
+ CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
+ SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
+ ALL="${ALL} all64"
+ TEST="${TEST} test64"
+ echo "Checking for off64_t... Yes."
+ echo "Checking for fseeko... Yes."
+else
+ echo "Checking for off64_t... No."
+ cat > $test.c <<EOF
+#include <stdio.h>
+int main(void) {
+ fseeko(NULL, 0, 0);
+ return 0;
+}
+EOF
+ if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
+ echo "Checking for fseeko... Yes."
+ else
+ CFLAGS="${CFLAGS} -DNO_FSEEKO"
+ SFLAGS="${SFLAGS} -DNO_FSEEKO"
+ echo "Checking for fseeko... No."
+ fi
+fi
+
+cp -p zconf.h.in zconf.h
+
+cat > $test.c <<EOF
#include <unistd.h>
int main() { return 0; }
EOF
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
- sed < zconf.in.h "/HAVE_UNISTD_H/s%0%1%" > zconf.h
+ sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
+ mv zconf.temp.h zconf.h
echo "Checking for unistd.h... Yes."
else
- cp -p zconf.in.h zconf.h
echo "Checking for unistd.h... No."
fi
+if test $zprefix -eq 1; then
+ sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
+ mv zconf.temp.h zconf.h
+ echo "Using z_ prefix on all symbols."
+fi
+
cat > $test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
@@ -219,13 +325,13 @@ int main()
EOF
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
- echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()"
+ echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()."
cat > $test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
-int mytest(char *fmt, ...)
+int mytest(const char *fmt, ...)
{
char buf[20];
va_list ap;
@@ -249,7 +355,7 @@ EOF
#include <stdio.h>
#include <stdarg.h>
-int mytest(char *fmt, ...)
+int mytest(const char *fmt, ...)
{
int n;
char buf[20];
@@ -271,6 +377,7 @@ EOF
echo "Checking for return value of vsnprintf()... Yes."
else
CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
+ SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
echo "Checking for return value of vsnprintf()... No."
echo " WARNING: apparently vsnprintf() does not return a value. zlib"
echo " can build but will be open to possible string-format security"
@@ -278,6 +385,7 @@ EOF
fi
else
CFLAGS="$CFLAGS -DNO_vsnprintf"
+ SFLAGS="$SFLAGS -DNO_vsnprintf"
echo "Checking for vsnprintf() in stdio.h... No."
echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib"
echo " can build but will be open to possible buffer-overflow security"
@@ -287,7 +395,7 @@ EOF
#include <stdio.h>
#include <stdarg.h>
-int mytest(char *fmt, ...)
+int mytest(const char *fmt, ...)
{
int n;
char buf[20];
@@ -309,6 +417,7 @@ EOF
echo "Checking for return value of vsprintf()... Yes."
else
CFLAGS="$CFLAGS -DHAS_vsprintf_void"
+ SFLAGS="$SFLAGS -DHAS_vsprintf_void"
echo "Checking for return value of vsprintf()... No."
echo " WARNING: apparently vsprintf() does not return a value. zlib"
echo " can build but will be open to possible string-format security"
@@ -316,7 +425,7 @@ EOF
fi
fi
else
- echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()"
+ echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()."
cat >$test.c <<EOF
#include <stdio.h>
@@ -358,6 +467,7 @@ EOF
echo "Checking for return value of snprintf()... Yes."
else
CFLAGS="$CFLAGS -DHAS_snprintf_void"
+ SFLAGS="$SFLAGS -DHAS_snprintf_void"
echo "Checking for return value of snprintf()... No."
echo " WARNING: apparently snprintf() does not return a value. zlib"
echo " can build but will be open to possible string-format security"
@@ -365,6 +475,7 @@ EOF
fi
else
CFLAGS="$CFLAGS -DNO_snprintf"
+ SFLAGS="$SFLAGS -DNO_snprintf"
echo "Checking for snprintf() in stdio.h... No."
echo " WARNING: snprintf() not found, falling back to sprintf(). zlib"
echo " can build but will be open to possible buffer-overflow security"
@@ -390,6 +501,7 @@ EOF
echo "Checking for return value of sprintf()... Yes."
else
CFLAGS="$CFLAGS -DHAS_sprintf_void"
+ SFLAGS="$SFLAGS -DHAS_sprintf_void"
echo "Checking for return value of sprintf()... No."
echo " WARNING: apparently sprintf() does not return a value. zlib"
echo " can build but will be open to possible string-format security"
@@ -398,41 +510,37 @@ EOF
fi
fi
-cat >$test.c <<EOF
-#include <errno.h>
-int main() { return 0; }
-EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
- echo "Checking for errno.h... Yes."
-else
- echo "Checking for errno.h... No."
- CFLAGS="$CFLAGS -DNO_ERRNO_H"
-fi
-
-cat > $test.c <<EOF
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-caddr_t hello() {
- return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
+if test "$gcc" -eq 1; then
+ cat > $test.c <<EOF
+#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33)
+# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+# define ZLIB_INTERNAL
+#endif
+int ZLIB_INTERNAL foo;
+int main()
+{
+ return 0;
}
EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
- CFLAGS="$CFLAGS -DUSE_MMAP"
- echo Checking for mmap support... Yes.
-else
- echo Checking for mmap support... No.
+ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ echo "Checking for attribute(visibility) support... Yes."
+ else
+ CFLAGS="$CFLAGS -DNO_VIZ"
+ SFLAGS="$SFLAGS -DNO_VIZ"
+ echo "Checking for attribute(visibility) support... No."
+ fi
fi
CPP=${CPP-"$CC -E"}
case $CFLAGS in
*ASMV*)
- if test "`nm $test.o | grep _hello`" = ""; then
+ if test "`$NM $test.o | grep _hello`" = ""; then
CPP="$CPP -DNO_UNDERLINE"
echo Checking for underline in external names... No.
else
echo Checking for underline in external names... Yes.
- fi;;
+ fi ;;
esac
rm -f $test.[co] $test $test$shared_ext
@@ -441,19 +549,48 @@ rm -f $test.[co] $test $test$shared_ext
sed < Makefile.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
+/^SFLAGS *=/s#=.*#=$SFLAGS#
+/^LDFLAGS *=/s#=.*#=$LDFLAGS#
+/^LDSHARED *=/s#=.*#=$LDSHARED#
+/^CPP *=/s#=.*#=$CPP#
+/^STATICLIB *=/s#=.*#=$STATICLIB#
+/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
+/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
+/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
+/^AR *=/s#=.*#=$AR_RC#
+/^RANLIB *=/s#=.*#=$RANLIB#
+/^LDCONFIG *=/s#=.*#=$LDCONFIG#
+/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
+/^EXE *=/s#=.*#=$EXE#
+/^prefix *=/s#=.*#=$prefix#
+/^exec_prefix *=/s#=.*#=$exec_prefix#
+/^libdir *=/s#=.*#=$libdir#
+/^sharedlibdir *=/s#=.*#=$sharedlibdir#
+/^includedir *=/s#=.*#=$includedir#
+/^mandir *=/s#=.*#=$mandir#
+/^all: */s#:.*#: $ALL#
+/^test: */s#:.*#: $TEST#
+" > Makefile
+
+sed < zlib.pc.in "
+/^CC *=/s#=.*#=$CC#
+/^CFLAGS *=/s#=.*#=$CFLAGS#
/^CPP *=/s#=.*#=$CPP#
/^LDSHARED *=/s#=.*#=$LDSHARED#
-/^LIBS *=/s#=.*#=$LIBS#
+/^STATICLIB *=/s#=.*#=$STATICLIB#
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
-/^AR *=/s#=.*#=$AR#
+/^AR *=/s#=.*#=$AR_RC#
/^RANLIB *=/s#=.*#=$RANLIB#
/^EXE *=/s#=.*#=$EXE#
/^prefix *=/s#=.*#=$prefix#
/^exec_prefix *=/s#=.*#=$exec_prefix#
/^libdir *=/s#=.*#=$libdir#
+/^sharedlibdir *=/s#=.*#=$sharedlibdir#
/^includedir *=/s#=.*#=$includedir#
/^mandir *=/s#=.*#=$mandir#
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
-" > Makefile
+" | sed -e "
+s/\@VERSION\@/$VER/g;
+" > zlib.pc
diff --git a/Modules/zlib/crc32.c b/Modules/zlib/crc32.c
index f658a9ef55..91be372d22 100644
--- a/Modules/zlib/crc32.c
+++ b/Modules/zlib/crc32.c
@@ -1,5 +1,5 @@
/* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2006, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*
* Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
@@ -53,7 +53,7 @@
/* Definitions for doing the crc four data bytes at a time. */
#ifdef BYFOUR
-# define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \
+# define REV(w) ((((w)>>24)&0xff)+(((w)>>8)&0xff00)+ \
(((w)&0xff00)<<8)+(((w)&0xff)<<24))
local unsigned long crc32_little OF((unsigned long,
const unsigned char FAR *, unsigned));
@@ -68,6 +68,8 @@
local unsigned long gf2_matrix_times OF((unsigned long *mat,
unsigned long vec));
local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
+local uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2);
+
#ifdef DYNAMIC_CRC_TABLE
@@ -219,7 +221,7 @@ const unsigned long FAR * ZEXPORT get_crc_table()
unsigned long ZEXPORT crc32(crc, buf, len)
unsigned long crc;
const unsigned char FAR *buf;
- unsigned len;
+ uInt len;
{
if (buf == Z_NULL) return 0UL;
@@ -367,22 +369,22 @@ local void gf2_matrix_square(square, mat)
}
/* ========================================================================= */
-uLong ZEXPORT crc32_combine(crc1, crc2, len2)
+local uLong crc32_combine_(crc1, crc2, len2)
uLong crc1;
uLong crc2;
- z_off_t len2;
+ z_off64_t len2;
{
int n;
unsigned long row;
unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */
unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */
- /* degenerate case */
- if (len2 == 0)
+ /* degenerate case (also disallow negative lengths) */
+ if (len2 <= 0)
return crc1;
/* put operator for one zero bit in odd */
- odd[0] = 0xedb88320L; /* CRC-32 polynomial */
+ odd[0] = 0xedb88320UL; /* CRC-32 polynomial */
row = 1;
for (n = 1; n < GF2_DIM; n++) {
odd[n] = row;
@@ -421,3 +423,20 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2)
crc1 ^= crc2;
return crc1;
}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine(crc1, crc2, len2)
+ uLong crc1;
+ uLong crc2;
+ z_off_t len2;
+{
+ return crc32_combine_(crc1, crc2, len2);
+}
+
+uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
+ uLong crc1;
+ uLong crc2;
+ z_off64_t len2;
+{
+ return crc32_combine_(crc1, crc2, len2);
+}
diff --git a/Modules/zlib/deflate.c b/Modules/zlib/deflate.c
index 29ce1f64a5..5c4022f3d4 100644
--- a/Modules/zlib/deflate.c
+++ b/Modules/zlib/deflate.c
@@ -1,5 +1,5 @@
/* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -52,7 +52,7 @@
#include "deflate.h"
const char deflate_copyright[] =
- " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly ";
+ " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -79,19 +79,18 @@ local block_state deflate_fast OF((deflate_state *s, int flush));
#ifndef FASTEST
local block_state deflate_slow OF((deflate_state *s, int flush));
#endif
+local block_state deflate_rle OF((deflate_state *s, int flush));
+local block_state deflate_huff OF((deflate_state *s, int flush));
local void lm_init OF((deflate_state *s));
local void putShortMSB OF((deflate_state *s, uInt b));
local void flush_pending OF((z_streamp strm));
local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
-#ifndef FASTEST
#ifdef ASMV
void match_init OF((void)); /* asm code initialization */
uInt longest_match OF((deflate_state *s, IPos cur_match));
#else
local uInt longest_match OF((deflate_state *s, IPos cur_match));
#endif
-#endif
-local uInt longest_match_fast OF((deflate_state *s, IPos cur_match));
#ifdef DEBUG
local void check_match OF((deflate_state *s, IPos start, IPos match,
@@ -110,11 +109,6 @@ local void check_match OF((deflate_state *s, IPos start, IPos match,
#endif
/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
-#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
-/* Minimum amount of lookahead, except at the end of the input file.
- * See deflate.c for comments about the MIN_MATCH+1.
- */
-
/* Values for max_lazy_match, good_match and max_chain_length, depending on
* the desired pack level (0..9). The values given below have been tuned to
* exclude worst case performance for pathological files. Better values may be
@@ -288,6 +282,8 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
+ s->high_water = 0; /* nothing written to s->window yet */
+
s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
@@ -332,8 +328,8 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
strm->adler = adler32(strm->adler, dictionary, dictLength);
if (length < MIN_MATCH) return Z_OK;
- if (length > MAX_DIST(s)) {
- length = MAX_DIST(s);
+ if (length > s->w_size) {
+ length = s->w_size;
dictionary += dictLength - length; /* use the tail of the dictionary */
}
zmemcpy(s->window, dictionary, length);
@@ -435,9 +431,10 @@ int ZEXPORT deflateParams(strm, level, strategy)
}
func = configuration_table[s->level].func;
- if (func != configuration_table[level].func && strm->total_in != 0) {
+ if ((strategy != s->strategy || func != configuration_table[level].func) &&
+ strm->total_in != 0) {
/* Flush the last buffer: */
- err = deflate(strm, Z_PARTIAL_FLUSH);
+ err = deflate(strm, Z_BLOCK);
}
if (s->level != level) {
s->level = level;
@@ -481,33 +478,66 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
* resulting from using fixed blocks instead of stored blocks, which deflate
* can emit on compressed data for some combinations of the parameters.
*
- * This function could be more sophisticated to provide closer upper bounds
- * for every combination of windowBits and memLevel, as well as wrap.
- * But even the conservative upper bound of about 14% expansion does not
- * seem onerous for output buffer allocation.
+ * This function could be more sophisticated to provide closer upper bounds for
+ * every combination of windowBits and memLevel. But even the conservative
+ * upper bound of about 14% expansion does not seem onerous for output buffer
+ * allocation.
*/
uLong ZEXPORT deflateBound(strm, sourceLen)
z_streamp strm;
uLong sourceLen;
{
deflate_state *s;
- uLong destLen;
+ uLong complen, wraplen;
+ Bytef *str;
- /* conservative upper bound */
- destLen = sourceLen +
- ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11;
+ /* conservative upper bound for compressed data */
+ complen = sourceLen +
+ ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
- /* if can't get parameters, return conservative bound */
+ /* if can't get parameters, return conservative bound plus zlib wrapper */
if (strm == Z_NULL || strm->state == Z_NULL)
- return destLen;
+ return complen + 6;
- /* if not default parameters, return conservative bound */
+ /* compute wrapper length */
s = strm->state;
+ switch (s->wrap) {
+ case 0: /* raw deflate */
+ wraplen = 0;
+ break;
+ case 1: /* zlib wrapper */
+ wraplen = 6 + (s->strstart ? 4 : 0);
+ break;
+ case 2: /* gzip wrapper */
+ wraplen = 18;
+ if (s->gzhead != Z_NULL) { /* user-supplied gzip header */
+ if (s->gzhead->extra != Z_NULL)
+ wraplen += 2 + s->gzhead->extra_len;
+ str = s->gzhead->name;
+ if (str != Z_NULL)
+ do {
+ wraplen++;
+ } while (*str++);
+ str = s->gzhead->comment;
+ if (str != Z_NULL)
+ do {
+ wraplen++;
+ } while (*str++);
+ if (s->gzhead->hcrc)
+ wraplen += 2;
+ }
+ break;
+ default: /* for compiler happiness */
+ wraplen = 6;
+ }
+
+ /* if not default parameters, return conservative bound */
if (s->w_bits != 15 || s->hash_bits != 8 + 7)
- return destLen;
+ return complen + wraplen;
/* default settings: return tight bound for that case */
- return compressBound(sourceLen);
+ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+ (sourceLen >> 25) + 13 - 6 + wraplen;
}
/* =========================================================================
@@ -557,7 +587,7 @@ int ZEXPORT deflate (strm, flush)
deflate_state *s;
if (strm == Z_NULL || strm->state == Z_NULL ||
- flush > Z_FINISH || flush < 0) {
+ flush > Z_BLOCK || flush < 0) {
return Z_STREAM_ERROR;
}
s = strm->state;
@@ -581,7 +611,7 @@ int ZEXPORT deflate (strm, flush)
put_byte(s, 31);
put_byte(s, 139);
put_byte(s, 8);
- if (s->gzhead == NULL) {
+ if (s->gzhead == Z_NULL) {
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, 0);
@@ -608,7 +638,7 @@ int ZEXPORT deflate (strm, flush)
(s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
4 : 0));
put_byte(s, s->gzhead->os & 0xff);
- if (s->gzhead->extra != NULL) {
+ if (s->gzhead->extra != Z_NULL) {
put_byte(s, s->gzhead->extra_len & 0xff);
put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
}
@@ -650,7 +680,7 @@ int ZEXPORT deflate (strm, flush)
}
#ifdef GZIP
if (s->status == EXTRA_STATE) {
- if (s->gzhead->extra != NULL) {
+ if (s->gzhead->extra != Z_NULL) {
uInt beg = s->pending; /* start of bytes to update crc */
while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
@@ -678,7 +708,7 @@ int ZEXPORT deflate (strm, flush)
s->status = NAME_STATE;
}
if (s->status == NAME_STATE) {
- if (s->gzhead->name != NULL) {
+ if (s->gzhead->name != Z_NULL) {
uInt beg = s->pending; /* start of bytes to update crc */
int val;
@@ -709,7 +739,7 @@ int ZEXPORT deflate (strm, flush)
s->status = COMMENT_STATE;
}
if (s->status == COMMENT_STATE) {
- if (s->gzhead->comment != NULL) {
+ if (s->gzhead->comment != Z_NULL) {
uInt beg = s->pending; /* start of bytes to update crc */
int val;
@@ -787,7 +817,9 @@ int ZEXPORT deflate (strm, flush)
(flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
block_state bstate;
- bstate = (*(configuration_table[s->level].func))(s, flush);
+ bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
+ (s->strategy == Z_RLE ? deflate_rle(s, flush) :
+ (*(configuration_table[s->level].func))(s, flush));
if (bstate == finish_started || bstate == finish_done) {
s->status = FINISH_STATE;
@@ -808,13 +840,17 @@ int ZEXPORT deflate (strm, flush)
if (bstate == block_done) {
if (flush == Z_PARTIAL_FLUSH) {
_tr_align(s);
- } else { /* FULL_FLUSH or SYNC_FLUSH */
+ } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
_tr_stored_block(s, (char*)0, 0L, 0);
/* For a full flush, this empty block will be recognized
* as a special marker by inflate_sync().
*/
if (flush == Z_FULL_FLUSH) {
CLEAR_HASH(s); /* forget history */
+ if (s->lookahead == 0) {
+ s->strstart = 0;
+ s->block_start = 0L;
+ }
}
}
flush_pending(strm);
@@ -1167,12 +1203,13 @@ local uInt longest_match(s, cur_match)
return s->lookahead;
}
#endif /* ASMV */
-#endif /* FASTEST */
+
+#else /* FASTEST */
/* ---------------------------------------------------------------------------
- * Optimized version for level == 1 or strategy == Z_RLE only
+ * Optimized version for FASTEST only
*/
-local uInt longest_match_fast(s, cur_match)
+local uInt longest_match(s, cur_match)
deflate_state *s;
IPos cur_match; /* current match */
{
@@ -1225,6 +1262,8 @@ local uInt longest_match_fast(s, cur_match)
return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
}
+#endif /* FASTEST */
+
#ifdef DEBUG
/* ===========================================================================
* Check that the match at match_start is indeed a match.
@@ -1303,7 +1342,6 @@ local void fill_window(s)
later. (Using level 0 permanently is not an optimal usage of
zlib, so we don't care about this pathological case.)
*/
- /* %%% avoid this when Z_RLE */
n = s->hash_size;
p = &s->head[n];
do {
@@ -1355,27 +1393,61 @@ local void fill_window(s)
*/
} while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
+
+ /* If the WIN_INIT bytes after the end of the current data have never been
+ * written, then zero those bytes in order to avoid memory check reports of
+ * the use of uninitialized (or uninitialised as Julian writes) bytes by
+ * the longest match routines. Update the high water mark for the next
+ * time through here. WIN_INIT is set to MAX_MATCH since the longest match
+ * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
+ */
+ if (s->high_water < s->window_size) {
+ ulg curr = s->strstart + (ulg)(s->lookahead);
+ ulg init;
+
+ if (s->high_water < curr) {
+ /* Previous high water mark below current data -- zero WIN_INIT
+ * bytes or up to end of window, whichever is less.
+ */
+ init = s->window_size - curr;
+ if (init > WIN_INIT)
+ init = WIN_INIT;
+ zmemzero(s->window + curr, (unsigned)init);
+ s->high_water = curr + init;
+ }
+ else if (s->high_water < (ulg)curr + WIN_INIT) {
+ /* High water mark at or above current data, but below current data
+ * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
+ * to end of window, whichever is less.
+ */
+ init = (ulg)curr + WIN_INIT - s->high_water;
+ if (init > s->window_size - s->high_water)
+ init = s->window_size - s->high_water;
+ zmemzero(s->window + s->high_water, (unsigned)init);
+ s->high_water += init;
+ }
+ }
}
/* ===========================================================================
* Flush the current block, with given end-of-file flag.
* IN assertion: strstart is set to the end of the current match.
*/
-#define FLUSH_BLOCK_ONLY(s, eof) { \
+#define FLUSH_BLOCK_ONLY(s, last) { \
_tr_flush_block(s, (s->block_start >= 0L ? \
(charf *)&s->window[(unsigned)s->block_start] : \
(charf *)Z_NULL), \
(ulg)((long)s->strstart - s->block_start), \
- (eof)); \
+ (last)); \
s->block_start = s->strstart; \
flush_pending(s->strm); \
Tracev((stderr,"[FLUSH]")); \
}
/* Same but force premature exit if necessary. */
-#define FLUSH_BLOCK(s, eof) { \
- FLUSH_BLOCK_ONLY(s, eof); \
- if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
+#define FLUSH_BLOCK(s, last) { \
+ FLUSH_BLOCK_ONLY(s, last); \
+ if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
}
/* ===========================================================================
@@ -1449,7 +1521,7 @@ local block_state deflate_fast(s, flush)
deflate_state *s;
int flush;
{
- IPos hash_head = NIL; /* head of the hash chain */
+ IPos hash_head; /* head of the hash chain */
int bflush; /* set if current block must be flushed */
for (;;) {
@@ -1469,6 +1541,7 @@ local block_state deflate_fast(s, flush)
/* Insert the string window[strstart .. strstart+2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
+ hash_head = NIL;
if (s->lookahead >= MIN_MATCH) {
INSERT_STRING(s, s->strstart, hash_head);
}
@@ -1481,19 +1554,8 @@ local block_state deflate_fast(s, flush)
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
*/
-#ifdef FASTEST
- if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) ||
- (s->strategy == Z_RLE && s->strstart - hash_head == 1)) {
- s->match_length = longest_match_fast (s, hash_head);
- }
-#else
- if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
- s->match_length = longest_match (s, hash_head);
- } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
- s->match_length = longest_match_fast (s, hash_head);
- }
-#endif
- /* longest_match() or longest_match_fast() sets match_start */
+ s->match_length = longest_match (s, hash_head);
+ /* longest_match() sets match_start */
}
if (s->match_length >= MIN_MATCH) {
check_match(s, s->strstart, s->match_start, s->match_length);
@@ -1555,7 +1617,7 @@ local block_state deflate_slow(s, flush)
deflate_state *s;
int flush;
{
- IPos hash_head = NIL; /* head of hash chain */
+ IPos hash_head; /* head of hash chain */
int bflush; /* set if current block must be flushed */
/* Process the input block. */
@@ -1576,6 +1638,7 @@ local block_state deflate_slow(s, flush)
/* Insert the string window[strstart .. strstart+2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
+ hash_head = NIL;
if (s->lookahead >= MIN_MATCH) {
INSERT_STRING(s, s->strstart, hash_head);
}
@@ -1591,12 +1654,8 @@ local block_state deflate_slow(s, flush)
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
*/
- if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
- s->match_length = longest_match (s, hash_head);
- } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
- s->match_length = longest_match_fast (s, hash_head);
- }
- /* longest_match() or longest_match_fast() sets match_start */
+ s->match_length = longest_match (s, hash_head);
+ /* longest_match() sets match_start */
if (s->match_length <= 5 && (s->strategy == Z_FILTERED
#if TOO_FAR <= 32767
@@ -1674,7 +1733,6 @@ local block_state deflate_slow(s, flush)
}
#endif /* FASTEST */
-#if 0
/* ===========================================================================
* For Z_RLE, simply look for runs of bytes, generate matches only of distance
* one. Do not maintain a hash table. (It will be regenerated if this run of
@@ -1684,11 +1742,9 @@ local block_state deflate_rle(s, flush)
deflate_state *s;
int flush;
{
- int bflush; /* set if current block must be flushed */
- uInt run; /* length of run */
- uInt max; /* maximum length of run */
- uInt prev; /* byte at distance one to match */
- Bytef *scan; /* scan for end of run */
+ int bflush; /* set if current block must be flushed */
+ uInt prev; /* byte at distance one to match */
+ Bytef *scan, *strend; /* scan goes up to strend for length of run */
for (;;) {
/* Make sure that we always have enough lookahead, except
@@ -1704,23 +1760,33 @@ local block_state deflate_rle(s, flush)
}
/* See how many times the previous byte repeats */
- run = 0;
- if (s->strstart > 0) { /* if there is a previous byte, that is */
- max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH;
+ s->match_length = 0;
+ if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
scan = s->window + s->strstart - 1;
- prev = *scan++;
- do {
- if (*scan++ != prev)
- break;
- } while (++run < max);
+ prev = *scan;
+ if (prev == *++scan && prev == *++scan && prev == *++scan) {
+ strend = s->window + s->strstart + MAX_MATCH;
+ do {
+ } while (prev == *++scan && prev == *++scan &&
+ prev == *++scan && prev == *++scan &&
+ prev == *++scan && prev == *++scan &&
+ prev == *++scan && prev == *++scan &&
+ scan < strend);
+ s->match_length = MAX_MATCH - (int)(strend - scan);
+ if (s->match_length > s->lookahead)
+ s->match_length = s->lookahead;
+ }
}
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
- if (run >= MIN_MATCH) {
- check_match(s, s->strstart, s->strstart - 1, run);
- _tr_tally_dist(s, 1, run - MIN_MATCH, bflush);
- s->lookahead -= run;
- s->strstart += run;
+ if (s->match_length >= MIN_MATCH) {
+ check_match(s, s->strstart, s->strstart - 1, s->match_length);
+
+ _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
+
+ s->lookahead -= s->match_length;
+ s->strstart += s->match_length;
+ s->match_length = 0;
} else {
/* No match, output a literal byte */
Tracevv((stderr,"%c", s->window[s->strstart]));
@@ -1733,4 +1799,36 @@ local block_state deflate_rle(s, flush)
FLUSH_BLOCK(s, flush == Z_FINISH);
return flush == Z_FINISH ? finish_done : block_done;
}
-#endif
+
+/* ===========================================================================
+ * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
+ * (It will be regenerated if this run of deflate switches away from Huffman.)
+ */
+local block_state deflate_huff(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ int bflush; /* set if current block must be flushed */
+
+ for (;;) {
+ /* Make sure that we have a literal to write. */
+ if (s->lookahead == 0) {
+ fill_window(s);
+ if (s->lookahead == 0) {
+ if (flush == Z_NO_FLUSH)
+ return need_more;
+ break; /* flush the current block */
+ }
+ }
+
+ /* Output a literal byte */
+ s->match_length = 0;
+ Tracevv((stderr,"%c", s->window[s->strstart]));
+ _tr_tally_lit (s, s->window[s->strstart], bflush);
+ s->lookahead--;
+ s->strstart++;
+ if (bflush) FLUSH_BLOCK(s, 0);
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
diff --git a/Modules/zlib/deflate.h b/Modules/zlib/deflate.h
index 05a5ab3a2c..cbf0d1ea5d 100644
--- a/Modules/zlib/deflate.h
+++ b/Modules/zlib/deflate.h
@@ -1,5 +1,5 @@
/* deflate.h -- internal compression state
- * Copyright (C) 1995-2004 Jean-loup Gailly
+ * Copyright (C) 1995-2010 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -260,6 +260,13 @@ typedef struct internal_state {
* are always zero.
*/
+ ulg high_water;
+ /* High water mark offset in window for initialized bytes -- bytes above
+ * this are set to zero in order to avoid memory check warnings when
+ * longest match routines access bytes past the input. This is then
+ * updated to the new high water mark.
+ */
+
} FAR deflate_state;
/* Output a byte on the stream.
@@ -278,14 +285,18 @@ typedef struct internal_state {
* distances are limited to MAX_DIST instead of WSIZE.
*/
+#define WIN_INIT MAX_MATCH
+/* Number of bytes after end of data in window to initialize in order to avoid
+ memory checker errors from longest match routines */
+
/* in trees.c */
-void _tr_init OF((deflate_state *s));
-int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
-void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
- int eof));
-void _tr_align OF((deflate_state *s));
-void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
- int eof));
+void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
+int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
+void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
+ ulg stored_len, int last));
+void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
+void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
+ ulg stored_len, int last));
#define d_code(dist) \
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
@@ -298,11 +309,11 @@ void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
/* Inline versions of _tr_tally for speed: */
#if defined(GEN_TREES_H) || !defined(STDC)
- extern uch _length_code[];
- extern uch _dist_code[];
+ extern uch ZLIB_INTERNAL _length_code[];
+ extern uch ZLIB_INTERNAL _dist_code[];
#else
- extern const uch _length_code[];
- extern const uch _dist_code[];
+ extern const uch ZLIB_INTERNAL _length_code[];
+ extern const uch ZLIB_INTERNAL _dist_code[];
#endif
# define _tr_tally_lit(s, c, flush) \
diff --git a/Modules/zlib/example.c b/Modules/zlib/example.c
index 52bc261fd9..604736f15f 100644
--- a/Modules/zlib/example.c
+++ b/Modules/zlib/example.c
@@ -1,19 +1,19 @@
/* example.c -- usage example of the zlib compression library
- * Copyright (C) 1995-2004 Jean-loup Gailly.
+ * Copyright (C) 1995-2006 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
-#include <stdio.h>
#include "zlib.h"
+#include <stdio.h>
#ifdef STDC
# include <string.h>
# include <stdlib.h>
#endif
-#if defined(VMS)
+#if defined(VMS) || defined(RISCOS)
# define TESTFILE "foo-gz"
#else
# define TESTFILE "foo.gz"
diff --git a/Modules/zlib/gzclose.c b/Modules/zlib/gzclose.c
new file mode 100644
index 0000000000..caeb99a317
--- /dev/null
+++ b/Modules/zlib/gzclose.c
@@ -0,0 +1,25 @@
+/* gzclose.c -- zlib gzclose() function
+ * Copyright (C) 2004, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+/* gzclose() is in a separate file so that it is linked in only if it is used.
+ That way the other gzclose functions can be used instead to avoid linking in
+ unneeded compression or decompression routines. */
+int ZEXPORT gzclose(file)
+ gzFile file;
+{
+#ifndef NO_GZCOMPRESS
+ gz_statep state;
+
+ if (file == NULL)
+ return Z_STREAM_ERROR;
+ state = (gz_statep)file;
+
+ return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
+#else
+ return gzclose_r(file);
+#endif
+}
diff --git a/Modules/zlib/gzguts.h b/Modules/zlib/gzguts.h
new file mode 100644
index 0000000000..0f8fb79f87
--- /dev/null
+++ b/Modules/zlib/gzguts.h
@@ -0,0 +1,132 @@
+/* gzguts.h -- zlib internal header definitions for gz* operations
+ * Copyright (C) 2004, 2005, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#ifdef _LARGEFILE64_SOURCE
+# ifndef _LARGEFILE_SOURCE
+# define _LARGEFILE_SOURCE 1
+# endif
+# ifdef _FILE_OFFSET_BITS
+# undef _FILE_OFFSET_BITS
+# endif
+#endif
+
+#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+# define ZLIB_INTERNAL
+#endif
+
+#include <stdio.h>
+#include "zlib.h"
+#ifdef STDC
+# include <string.h>
+# include <stdlib.h>
+# include <limits.h>
+#endif
+#include <fcntl.h>
+
+#ifdef NO_DEFLATE /* for compatibility with old definition */
+# define NO_GZCOMPRESS
+#endif
+
+#ifdef _MSC_VER
+# include <io.h>
+# define vsnprintf _vsnprintf
+#endif
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+/* gz* functions always use library allocation functions */
+#ifndef STDC
+ extern voidp malloc OF((uInt size));
+ extern void free OF((voidpf ptr));
+#endif
+
+/* get errno and strerror definition */
+#if defined UNDER_CE
+# include <windows.h>
+# define zstrerror() gz_strwinerror((DWORD)GetLastError())
+#else
+# ifdef STDC
+# include <errno.h>
+# define zstrerror() strerror(errno)
+# else
+# define zstrerror() "stdio error (consult errno)"
+# endif
+#endif
+
+/* provide prototypes for these when building zlib without LFS */
+#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+ ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+#endif
+
+/* default i/o buffer size -- double this for output when reading */
+#define GZBUFSIZE 8192
+
+/* gzip modes, also provide a little integrity check on the passed structure */
+#define GZ_NONE 0
+#define GZ_READ 7247
+#define GZ_WRITE 31153
+#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */
+
+/* values for gz_state how */
+#define LOOK 0 /* look for a gzip header */
+#define COPY 1 /* copy input directly */
+#define GZIP 2 /* decompress a gzip stream */
+
+/* internal gzip file state data structure */
+typedef struct {
+ /* used for both reading and writing */
+ int mode; /* see gzip modes above */
+ int fd; /* file descriptor */
+ char *path; /* path or fd for error messages */
+ z_off64_t pos; /* current position in uncompressed data */
+ unsigned size; /* buffer size, zero if not allocated yet */
+ unsigned want; /* requested buffer size, default is GZBUFSIZE */
+ unsigned char *in; /* input buffer */
+ unsigned char *out; /* output buffer (double-sized when reading) */
+ unsigned char *next; /* next output data to deliver or write */
+ /* just for reading */
+ unsigned have; /* amount of output data unused at next */
+ int eof; /* true if end of input file reached */
+ z_off64_t start; /* where the gzip data started, for rewinding */
+ z_off64_t raw; /* where the raw data started, for seeking */
+ int how; /* 0: get header, 1: copy, 2: decompress */
+ int direct; /* true if last read direct, false if gzip */
+ /* just for writing */
+ int level; /* compression level */
+ int strategy; /* compression strategy */
+ /* seek request */
+ z_off64_t skip; /* amount to skip (already rewound if backwards) */
+ int seek; /* true if seek request pending */
+ /* error information */
+ int err; /* error code */
+ char *msg; /* error message */
+ /* zlib inflate or deflate stream */
+ z_stream strm; /* stream structure in-place (not a pointer) */
+} gz_state;
+typedef gz_state FAR *gz_statep;
+
+/* shared functions */
+void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
+#if defined UNDER_CE
+char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
+#endif
+
+/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
+ value -- needed when comparing unsigned to z_off64_t, which is signed
+ (possible z_off64_t types off_t, off64_t, and long are all signed) */
+#ifdef INT_MAX
+# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
+#else
+unsigned ZLIB_INTERNAL gz_intmax OF((void));
+# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
+#endif
diff --git a/Modules/zlib/gzlib.c b/Modules/zlib/gzlib.c
new file mode 100644
index 0000000000..603e60ed54
--- /dev/null
+++ b/Modules/zlib/gzlib.c
@@ -0,0 +1,537 @@
+/* gzlib.c -- zlib functions common to reading and writing gzip files
+ * Copyright (C) 2004, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+# define LSEEK lseek64
+#else
+# define LSEEK lseek
+#endif
+
+/* Local functions */
+local void gz_reset OF((gz_statep));
+local gzFile gz_open OF((const char *, int, const char *));
+
+#if defined UNDER_CE
+
+/* Map the Windows error number in ERROR to a locale-dependent error message
+ string and return a pointer to it. Typically, the values for ERROR come
+ from GetLastError.
+
+ The string pointed to shall not be modified by the application, but may be
+ overwritten by a subsequent call to gz_strwinerror
+
+ The gz_strwinerror function does not change the current setting of
+ GetLastError. */
+char ZLIB_INTERNAL *gz_strwinerror (error)
+ DWORD error;
+{
+ static char buf[1024];
+
+ wchar_t *msgbuf;
+ DWORD lasterr = GetLastError();
+ DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL,
+ error,
+ 0, /* Default language */
+ (LPVOID)&msgbuf,
+ 0,
+ NULL);
+ if (chars != 0) {
+ /* If there is an \r\n appended, zap it. */
+ if (chars >= 2
+ && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
+ chars -= 2;
+ msgbuf[chars] = 0;
+ }
+
+ if (chars > sizeof (buf) - 1) {
+ chars = sizeof (buf) - 1;
+ msgbuf[chars] = 0;
+ }
+
+ wcstombs(buf, msgbuf, chars + 1);
+ LocalFree(msgbuf);
+ }
+ else {
+ sprintf(buf, "unknown win32 error (%ld)", error);
+ }
+
+ SetLastError(lasterr);
+ return buf;
+}
+
+#endif /* UNDER_CE */
+
+/* Reset gzip file state */
+local void gz_reset(state)
+ gz_statep state;
+{
+ if (state->mode == GZ_READ) { /* for reading ... */
+ state->have = 0; /* no output data available */
+ state->eof = 0; /* not at end of file */
+ state->how = LOOK; /* look for gzip header */
+ state->direct = 1; /* default for empty file */
+ }
+ state->seek = 0; /* no seek request pending */
+ gz_error(state, Z_OK, NULL); /* clear error */
+ state->pos = 0; /* no uncompressed data yet */
+ state->strm.avail_in = 0; /* no input data yet */
+}
+
+/* Open a gzip file either by name or file descriptor. */
+local gzFile gz_open(path, fd, mode)
+ const char *path;
+ int fd;
+ const char *mode;
+{
+ gz_statep state;
+
+ /* allocate gzFile structure to return */
+ state = malloc(sizeof(gz_state));
+ if (state == NULL)
+ return NULL;
+ state->size = 0; /* no buffers allocated yet */
+ state->want = GZBUFSIZE; /* requested buffer size */
+ state->msg = NULL; /* no error message yet */
+
+ /* interpret mode */
+ state->mode = GZ_NONE;
+ state->level = Z_DEFAULT_COMPRESSION;
+ state->strategy = Z_DEFAULT_STRATEGY;
+ while (*mode) {
+ if (*mode >= '0' && *mode <= '9')
+ state->level = *mode - '0';
+ else
+ switch (*mode) {
+ case 'r':
+ state->mode = GZ_READ;
+ break;
+#ifndef NO_GZCOMPRESS
+ case 'w':
+ state->mode = GZ_WRITE;
+ break;
+ case 'a':
+ state->mode = GZ_APPEND;
+ break;
+#endif
+ case '+': /* can't read and write at the same time */
+ free(state);
+ return NULL;
+ case 'b': /* ignore -- will request binary anyway */
+ break;
+ case 'f':
+ state->strategy = Z_FILTERED;
+ break;
+ case 'h':
+ state->strategy = Z_HUFFMAN_ONLY;
+ break;
+ case 'R':
+ state->strategy = Z_RLE;
+ break;
+ case 'F':
+ state->strategy = Z_FIXED;
+ default: /* could consider as an error, but just ignore */
+ ;
+ }
+ mode++;
+ }
+
+ /* must provide an "r", "w", or "a" */
+ if (state->mode == GZ_NONE) {
+ free(state);
+ return NULL;
+ }
+
+ /* save the path name for error messages */
+ state->path = malloc(strlen(path) + 1);
+ if (state->path == NULL) {
+ free(state);
+ return NULL;
+ }
+ strcpy(state->path, path);
+
+ /* open the file with the appropriate mode (or just use fd) */
+ state->fd = fd != -1 ? fd :
+ open(path,
+#ifdef O_LARGEFILE
+ O_LARGEFILE |
+#endif
+#ifdef O_BINARY
+ O_BINARY |
+#endif
+ (state->mode == GZ_READ ?
+ O_RDONLY :
+ (O_WRONLY | O_CREAT | (
+ state->mode == GZ_WRITE ?
+ O_TRUNC :
+ O_APPEND))),
+ 0666);
+ if (state->fd == -1) {
+ free(state->path);
+ free(state);
+ return NULL;
+ }
+ if (state->mode == GZ_APPEND)
+ state->mode = GZ_WRITE; /* simplify later checks */
+
+ /* save the current position for rewinding (only if reading) */
+ if (state->mode == GZ_READ) {
+ state->start = LSEEK(state->fd, 0, SEEK_CUR);
+ if (state->start == -1) state->start = 0;
+ }
+
+ /* initialize stream */
+ gz_reset(state);
+
+ /* return stream */
+ return (gzFile)state;
+}
+
+/* -- see zlib.h -- */
+gzFile ZEXPORT gzopen(path, mode)
+ const char *path;
+ const char *mode;
+{
+ return gz_open(path, -1, mode);
+}
+
+/* -- see zlib.h -- */
+gzFile ZEXPORT gzopen64(path, mode)
+ const char *path;
+ const char *mode;
+{
+ return gz_open(path, -1, mode);
+}
+
+/* -- see zlib.h -- */
+gzFile ZEXPORT gzdopen(fd, mode)
+ int fd;
+ const char *mode;
+{
+ char *path; /* identifier for error messages */
+ gzFile gz;
+
+ if (fd == -1 || (path = malloc(7 + 3 * sizeof(int))) == NULL)
+ return NULL;
+ sprintf(path, "<fd:%d>", fd); /* for debugging */
+ gz = gz_open(path, fd, mode);
+ free(path);
+ return gz;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzbuffer(file, size)
+ gzFile file;
+ unsigned size;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return -1;
+
+ /* make sure we haven't already allocated memory */
+ if (state->size != 0)
+ return -1;
+
+ /* check and set requested size */
+ if (size == 0)
+ return -1;
+ state->want = size;
+ return 0;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzrewind(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+
+ /* check that we're reading and that there's no error */
+ if (state->mode != GZ_READ || state->err != Z_OK)
+ return -1;
+
+ /* back up and start over */
+ if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
+ return -1;
+ gz_reset(state);
+ return 0;
+}
+
+/* -- see zlib.h -- */
+z_off64_t ZEXPORT gzseek64(file, offset, whence)
+ gzFile file;
+ z_off64_t offset;
+ int whence;
+{
+ unsigned n;
+ z_off64_t ret;
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return -1;
+
+ /* check that there's no error */
+ if (state->err != Z_OK)
+ return -1;
+
+ /* can only seek from start or relative to current position */
+ if (whence != SEEK_SET && whence != SEEK_CUR)
+ return -1;
+
+ /* normalize offset to a SEEK_CUR specification */
+ if (whence == SEEK_SET)
+ offset -= state->pos;
+ else if (state->seek)
+ offset += state->skip;
+ state->seek = 0;
+
+ /* if within raw area while reading, just go there */
+ if (state->mode == GZ_READ && state->how == COPY &&
+ state->pos + offset >= state->raw) {
+ ret = LSEEK(state->fd, offset - state->have, SEEK_CUR);
+ if (ret == -1)
+ return -1;
+ state->have = 0;
+ state->eof = 0;
+ state->seek = 0;
+ gz_error(state, Z_OK, NULL);
+ state->strm.avail_in = 0;
+ state->pos += offset;
+ return state->pos;
+ }
+
+ /* calculate skip amount, rewinding if needed for back seek when reading */
+ if (offset < 0) {
+ if (state->mode != GZ_READ) /* writing -- can't go backwards */
+ return -1;
+ offset += state->pos;
+ if (offset < 0) /* before start of file! */
+ return -1;
+ if (gzrewind(file) == -1) /* rewind, then skip to offset */
+ return -1;
+ }
+
+ /* if reading, skip what's in output buffer (one less gzgetc() check) */
+ if (state->mode == GZ_READ) {
+ n = GT_OFF(state->have) || (z_off64_t)state->have > offset ?
+ (unsigned)offset : state->have;
+ state->have -= n;
+ state->next += n;
+ state->pos += n;
+ offset -= n;
+ }
+
+ /* request skip (if not zero) */
+ if (offset) {
+ state->seek = 1;
+ state->skip = offset;
+ }
+ return state->pos + offset;
+}
+
+/* -- see zlib.h -- */
+z_off_t ZEXPORT gzseek(file, offset, whence)
+ gzFile file;
+ z_off_t offset;
+ int whence;
+{
+ z_off64_t ret;
+
+ ret = gzseek64(file, (z_off64_t)offset, whence);
+ return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+}
+
+/* -- see zlib.h -- */
+z_off64_t ZEXPORT gztell64(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return -1;
+
+ /* return position */
+ return state->pos + (state->seek ? state->skip : 0);
+}
+
+/* -- see zlib.h -- */
+z_off_t ZEXPORT gztell(file)
+ gzFile file;
+{
+ z_off64_t ret;
+
+ ret = gztell64(file);
+ return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+}
+
+/* -- see zlib.h -- */
+z_off64_t ZEXPORT gzoffset64(file)
+ gzFile file;
+{
+ z_off64_t offset;
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return -1;
+
+ /* compute and return effective offset in file */
+ offset = LSEEK(state->fd, 0, SEEK_CUR);
+ if (offset == -1)
+ return -1;
+ if (state->mode == GZ_READ) /* reading */
+ offset -= state->strm.avail_in; /* don't count buffered input */
+ return offset;
+}
+
+/* -- see zlib.h -- */
+z_off_t ZEXPORT gzoffset(file)
+ gzFile file;
+{
+ z_off64_t ret;
+
+ ret = gzoffset64(file);
+ return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzeof(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return 0;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return 0;
+
+ /* return end-of-file state */
+ return state->mode == GZ_READ ?
+ (state->eof && state->strm.avail_in == 0 && state->have == 0) : 0;
+}
+
+/* -- see zlib.h -- */
+const char * ZEXPORT gzerror(file, errnum)
+ gzFile file;
+ int *errnum;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return NULL;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return NULL;
+
+ /* return error information */
+ if (errnum != NULL)
+ *errnum = state->err;
+ return state->msg == NULL ? "" : state->msg;
+}
+
+/* -- see zlib.h -- */
+void ZEXPORT gzclearerr(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return;
+
+ /* clear error and end-of-file */
+ if (state->mode == GZ_READ)
+ state->eof = 0;
+ gz_error(state, Z_OK, NULL);
+}
+
+/* Create an error message in allocated memory and set state->err and
+ state->msg accordingly. Free any previous error message already there. Do
+ not try to free or allocate space if the error is Z_MEM_ERROR (out of
+ memory). Simply save the error message as a static string. If there is an
+ allocation failure constructing the error message, then convert the error to
+ out of memory. */
+void ZLIB_INTERNAL gz_error(state, err, msg)
+ gz_statep state;
+ int err;
+ const char *msg;
+{
+ /* free previously allocated message and clear */
+ if (state->msg != NULL) {
+ if (state->err != Z_MEM_ERROR)
+ free(state->msg);
+ state->msg = NULL;
+ }
+
+ /* set error code, and if no message, then done */
+ state->err = err;
+ if (msg == NULL)
+ return;
+
+ /* for an out of memory error, save as static string */
+ if (err == Z_MEM_ERROR) {
+ state->msg = (char *)msg;
+ return;
+ }
+
+ /* construct error message with path */
+ if ((state->msg = malloc(strlen(state->path) + strlen(msg) + 3)) == NULL) {
+ state->err = Z_MEM_ERROR;
+ state->msg = (char *)"out of memory";
+ return;
+ }
+ strcpy(state->msg, state->path);
+ strcat(state->msg, ": ");
+ strcat(state->msg, msg);
+ return;
+}
+
+#ifndef INT_MAX
+/* portably return maximum value for an int (when limits.h presumed not
+ available) -- we need to do this to cover cases where 2's complement not
+ used, since C standard permits 1's complement and sign-bit representations,
+ otherwise we could just use ((unsigned)-1) >> 1 */
+unsigned ZLIB_INTERNAL gz_intmax()
+{
+ unsigned p, q;
+
+ p = 1;
+ do {
+ q = p;
+ p <<= 1;
+ p++;
+ } while (p > q);
+ return q >> 1;
+}
+#endif
diff --git a/Modules/zlib/gzread.c b/Modules/zlib/gzread.c
new file mode 100644
index 0000000000..548201ab00
--- /dev/null
+++ b/Modules/zlib/gzread.c
@@ -0,0 +1,653 @@
+/* gzread.c -- zlib functions for reading gzip files
+ * Copyright (C) 2004, 2005, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+/* Local functions */
+local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
+local int gz_avail OF((gz_statep));
+local int gz_next4 OF((gz_statep, unsigned long *));
+local int gz_head OF((gz_statep));
+local int gz_decomp OF((gz_statep));
+local int gz_make OF((gz_statep));
+local int gz_skip OF((gz_statep, z_off64_t));
+
+/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from
+ state->fd, and update state->eof, state->err, and state->msg as appropriate.
+ This function needs to loop on read(), since read() is not guaranteed to
+ read the number of bytes requested, depending on the type of descriptor. */
+local int gz_load(state, buf, len, have)
+ gz_statep state;
+ unsigned char *buf;
+ unsigned len;
+ unsigned *have;
+{
+ int ret;
+
+ *have = 0;
+ do {
+ ret = read(state->fd, buf + *have, len - *have);
+ if (ret <= 0)
+ break;
+ *have += ret;
+ } while (*have < len);
+ if (ret < 0) {
+ gz_error(state, Z_ERRNO, zstrerror());
+ return -1;
+ }
+ if (ret == 0)
+ state->eof = 1;
+ return 0;
+}
+
+/* Load up input buffer and set eof flag if last data loaded -- return -1 on
+ error, 0 otherwise. Note that the eof flag is set when the end of the input
+ file is reached, even though there may be unused data in the buffer. Once
+ that data has been used, no more attempts will be made to read the file.
+ gz_avail() assumes that strm->avail_in == 0. */
+local int gz_avail(state)
+ gz_statep state;
+{
+ z_streamp strm = &(state->strm);
+
+ if (state->err != Z_OK)
+ return -1;
+ if (state->eof == 0) {
+ if (gz_load(state, state->in, state->size,
+ (unsigned *)&(strm->avail_in)) == -1)
+ return -1;
+ strm->next_in = state->in;
+ }
+ return 0;
+}
+
+/* Get next byte from input, or -1 if end or error. */
+#define NEXT() ((strm->avail_in == 0 && gz_avail(state) == -1) ? -1 : \
+ (strm->avail_in == 0 ? -1 : \
+ (strm->avail_in--, *(strm->next_in)++)))
+
+/* Get a four-byte little-endian integer and return 0 on success and the value
+ in *ret. Otherwise -1 is returned and *ret is not modified. */
+local int gz_next4(state, ret)
+ gz_statep state;
+ unsigned long *ret;
+{
+ int ch;
+ unsigned long val;
+ z_streamp strm = &(state->strm);
+
+ val = NEXT();
+ val += (unsigned)NEXT() << 8;
+ val += (unsigned long)NEXT() << 16;
+ ch = NEXT();
+ if (ch == -1)
+ return -1;
+ val += (unsigned long)ch << 24;
+ *ret = val;
+ return 0;
+}
+
+/* Look for gzip header, set up for inflate or copy. state->have must be zero.
+ If this is the first time in, allocate required memory. state->how will be
+ left unchanged if there is no more input data available, will be set to COPY
+ if there is no gzip header and direct copying will be performed, or it will
+ be set to GZIP for decompression, and the gzip header will be skipped so
+ that the next available input data is the raw deflate stream. If direct
+ copying, then leftover input data from the input buffer will be copied to
+ the output buffer. In that case, all further file reads will be directly to
+ either the output buffer or a user buffer. If decompressing, the inflate
+ state and the check value will be initialized. gz_head() will return 0 on
+ success or -1 on failure. Failures may include read errors or gzip header
+ errors. */
+local int gz_head(state)
+ gz_statep state;
+{
+ z_streamp strm = &(state->strm);
+ int flags;
+ unsigned len;
+
+ /* allocate read buffers and inflate memory */
+ if (state->size == 0) {
+ /* allocate buffers */
+ state->in = malloc(state->want);
+ state->out = malloc(state->want << 1);
+ if (state->in == NULL || state->out == NULL) {
+ if (state->out != NULL)
+ free(state->out);
+ if (state->in != NULL)
+ free(state->in);
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+ state->size = state->want;
+
+ /* allocate inflate memory */
+ state->strm.zalloc = Z_NULL;
+ state->strm.zfree = Z_NULL;
+ state->strm.opaque = Z_NULL;
+ state->strm.avail_in = 0;
+ state->strm.next_in = Z_NULL;
+ if (inflateInit2(&(state->strm), -15) != Z_OK) { /* raw inflate */
+ free(state->out);
+ free(state->in);
+ state->size = 0;
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+ }
+
+ /* get some data in the input buffer */
+ if (strm->avail_in == 0) {
+ if (gz_avail(state) == -1)
+ return -1;
+ if (strm->avail_in == 0)
+ return 0;
+ }
+
+ /* look for the gzip magic header bytes 31 and 139 */
+ if (strm->next_in[0] == 31) {
+ strm->avail_in--;
+ strm->next_in++;
+ if (strm->avail_in == 0 && gz_avail(state) == -1)
+ return -1;
+ if (strm->avail_in && strm->next_in[0] == 139) {
+ /* we have a gzip header, woo hoo! */
+ strm->avail_in--;
+ strm->next_in++;
+
+ /* skip rest of header */
+ if (NEXT() != 8) { /* compression method */
+ gz_error(state, Z_DATA_ERROR, "unknown compression method");
+ return -1;
+ }
+ flags = NEXT();
+ if (flags & 0xe0) { /* reserved flag bits */
+ gz_error(state, Z_DATA_ERROR, "unknown header flags set");
+ return -1;
+ }
+ NEXT(); /* modification time */
+ NEXT();
+ NEXT();
+ NEXT();
+ NEXT(); /* extra flags */
+ NEXT(); /* operating system */
+ if (flags & 4) { /* extra field */
+ len = (unsigned)NEXT();
+ len += (unsigned)NEXT() << 8;
+ while (len--)
+ if (NEXT() < 0)
+ break;
+ }
+ if (flags & 8) /* file name */
+ while (NEXT() > 0)
+ ;
+ if (flags & 16) /* comment */
+ while (NEXT() > 0)
+ ;
+ if (flags & 2) { /* header crc */
+ NEXT();
+ NEXT();
+ }
+ /* an unexpected end of file is not checked for here -- it will be
+ noticed on the first request for uncompressed data */
+
+ /* set up for decompression */
+ inflateReset(strm);
+ strm->adler = crc32(0L, Z_NULL, 0);
+ state->how = GZIP;
+ state->direct = 0;
+ return 0;
+ }
+ else {
+ /* not a gzip file -- save first byte (31) and fall to raw i/o */
+ state->out[0] = 31;
+ state->have = 1;
+ }
+ }
+
+ /* doing raw i/o, save start of raw data for seeking, copy any leftover
+ input to output -- this assumes that the output buffer is larger than
+ the input buffer, which also assures space for gzungetc() */
+ state->raw = state->pos;
+ state->next = state->out;
+ if (strm->avail_in) {
+ memcpy(state->next + state->have, strm->next_in, strm->avail_in);
+ state->have += strm->avail_in;
+ strm->avail_in = 0;
+ }
+ state->how = COPY;
+ state->direct = 1;
+ return 0;
+}
+
+/* Decompress from input to the provided next_out and avail_out in the state.
+ If the end of the compressed data is reached, then verify the gzip trailer
+ check value and length (modulo 2^32). state->have and state->next are set
+ to point to the just decompressed data, and the crc is updated. If the
+ trailer is verified, state->how is reset to LOOK to look for the next gzip
+ stream or raw data, once state->have is depleted. Returns 0 on success, -1
+ on failure. Failures may include invalid compressed data or a failed gzip
+ trailer verification. */
+local int gz_decomp(state)
+ gz_statep state;
+{
+ int ret;
+ unsigned had;
+ unsigned long crc, len;
+ z_streamp strm = &(state->strm);
+
+ /* fill output buffer up to end of deflate stream */
+ had = strm->avail_out;
+ do {
+ /* get more input for inflate() */
+ if (strm->avail_in == 0 && gz_avail(state) == -1)
+ return -1;
+ if (strm->avail_in == 0) {
+ gz_error(state, Z_DATA_ERROR, "unexpected end of file");
+ return -1;
+ }
+
+ /* decompress and handle errors */
+ ret = inflate(strm, Z_NO_FLUSH);
+ if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
+ gz_error(state, Z_STREAM_ERROR,
+ "internal error: inflate stream corrupt");
+ return -1;
+ }
+ if (ret == Z_MEM_ERROR) {
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+ if (ret == Z_DATA_ERROR) { /* deflate stream invalid */
+ gz_error(state, Z_DATA_ERROR,
+ strm->msg == NULL ? "compressed data error" : strm->msg);
+ return -1;
+ }
+ } while (strm->avail_out && ret != Z_STREAM_END);
+
+ /* update available output and crc check value */
+ state->have = had - strm->avail_out;
+ state->next = strm->next_out - state->have;
+ strm->adler = crc32(strm->adler, state->next, state->have);
+
+ /* check gzip trailer if at end of deflate stream */
+ if (ret == Z_STREAM_END) {
+ if (gz_next4(state, &crc) == -1 || gz_next4(state, &len) == -1) {
+ gz_error(state, Z_DATA_ERROR, "unexpected end of file");
+ return -1;
+ }
+ if (crc != strm->adler) {
+ gz_error(state, Z_DATA_ERROR, "incorrect data check");
+ return -1;
+ }
+ if (len != (strm->total_out & 0xffffffffL)) {
+ gz_error(state, Z_DATA_ERROR, "incorrect length check");
+ return -1;
+ }
+ state->how = LOOK; /* ready for next stream, once have is 0 (leave
+ state->direct unchanged to remember how) */
+ }
+
+ /* good decompression */
+ return 0;
+}
+
+/* Make data and put in the output buffer. Assumes that state->have == 0.
+ Data is either copied from the input file or decompressed from the input
+ file depending on state->how. If state->how is LOOK, then a gzip header is
+ looked for (and skipped if found) to determine wither to copy or decompress.
+ Returns -1 on error, otherwise 0. gz_make() will leave state->have as COPY
+ or GZIP unless the end of the input file has been reached and all data has
+ been processed. */
+local int gz_make(state)
+ gz_statep state;
+{
+ z_streamp strm = &(state->strm);
+
+ if (state->how == LOOK) { /* look for gzip header */
+ if (gz_head(state) == -1)
+ return -1;
+ if (state->have) /* got some data from gz_head() */
+ return 0;
+ }
+ if (state->how == COPY) { /* straight copy */
+ if (gz_load(state, state->out, state->size << 1, &(state->have)) == -1)
+ return -1;
+ state->next = state->out;
+ }
+ else if (state->how == GZIP) { /* decompress */
+ strm->avail_out = state->size << 1;
+ strm->next_out = state->out;
+ if (gz_decomp(state) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+/* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */
+local int gz_skip(state, len)
+ gz_statep state;
+ z_off64_t len;
+{
+ unsigned n;
+
+ /* skip over len bytes or reach end-of-file, whichever comes first */
+ while (len)
+ /* skip over whatever is in output buffer */
+ if (state->have) {
+ n = GT_OFF(state->have) || (z_off64_t)state->have > len ?
+ (unsigned)len : state->have;
+ state->have -= n;
+ state->next += n;
+ state->pos += n;
+ len -= n;
+ }
+
+ /* output buffer empty -- return if we're at the end of the input */
+ else if (state->eof && state->strm.avail_in == 0)
+ break;
+
+ /* need more data to skip -- load up output buffer */
+ else {
+ /* get more output, looking for header if required */
+ if (gz_make(state) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzread(file, buf, len)
+ gzFile file;
+ voidp buf;
+ unsigned len;
+{
+ unsigned got, n;
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're reading and that there's no error */
+ if (state->mode != GZ_READ || state->err != Z_OK)
+ return -1;
+
+ /* since an int is returned, make sure len fits in one, otherwise return
+ with an error (this avoids the flaw in the interface) */
+ if ((int)len < 0) {
+ gz_error(state, Z_BUF_ERROR, "requested length does not fit in int");
+ return -1;
+ }
+
+ /* if len is zero, avoid unnecessary operations */
+ if (len == 0)
+ return 0;
+
+ /* process a skip request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_skip(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* get len bytes to buf, or less than len if at the end */
+ got = 0;
+ do {
+ /* first just try copying data from the output buffer */
+ if (state->have) {
+ n = state->have > len ? len : state->have;
+ memcpy(buf, state->next, n);
+ state->next += n;
+ state->have -= n;
+ }
+
+ /* output buffer empty -- return if we're at the end of the input */
+ else if (state->eof && strm->avail_in == 0)
+ break;
+
+ /* need output data -- for small len or new stream load up our output
+ buffer */
+ else if (state->how == LOOK || len < (state->size << 1)) {
+ /* get more output, looking for header if required */
+ if (gz_make(state) == -1)
+ return -1;
+ continue; /* no progress yet -- go back to memcpy() above */
+ /* the copy above assures that we will leave with space in the
+ output buffer, allowing at least one gzungetc() to succeed */
+ }
+
+ /* large len -- read directly into user buffer */
+ else if (state->how == COPY) { /* read directly */
+ if (gz_load(state, buf, len, &n) == -1)
+ return -1;
+ }
+
+ /* large len -- decompress directly into user buffer */
+ else { /* state->how == GZIP */
+ strm->avail_out = len;
+ strm->next_out = buf;
+ if (gz_decomp(state) == -1)
+ return -1;
+ n = state->have;
+ state->have = 0;
+ }
+
+ /* update progress */
+ len -= n;
+ buf = (char *)buf + n;
+ got += n;
+ state->pos += n;
+ } while (len);
+
+ /* return number of bytes read into user buffer (will fit in int) */
+ return (int)got;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzgetc(file)
+ gzFile file;
+{
+ int ret;
+ unsigned char buf[1];
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+
+ /* check that we're reading and that there's no error */
+ if (state->mode != GZ_READ || state->err != Z_OK)
+ return -1;
+
+ /* try output buffer (no need to check for skip request) */
+ if (state->have) {
+ state->have--;
+ state->pos++;
+ return *(state->next)++;
+ }
+
+ /* nothing there -- try gzread() */
+ ret = gzread(file, buf, 1);
+ return ret < 1 ? -1 : buf[0];
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzungetc(c, file)
+ int c;
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+
+ /* check that we're reading and that there's no error */
+ if (state->mode != GZ_READ || state->err != Z_OK)
+ return -1;
+
+ /* process a skip request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_skip(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* can't push EOF */
+ if (c < 0)
+ return -1;
+
+ /* if output buffer empty, put byte at end (allows more pushing) */
+ if (state->have == 0) {
+ state->have = 1;
+ state->next = state->out + (state->size << 1) - 1;
+ state->next[0] = c;
+ state->pos--;
+ return c;
+ }
+
+ /* if no room, give up (must have already done a gzungetc()) */
+ if (state->have == (state->size << 1)) {
+ gz_error(state, Z_BUF_ERROR, "out of room to push characters");
+ return -1;
+ }
+
+ /* slide output data if needed and insert byte before existing data */
+ if (state->next == state->out) {
+ unsigned char *src = state->out + state->have;
+ unsigned char *dest = state->out + (state->size << 1);
+ while (src > state->out)
+ *--dest = *--src;
+ state->next = dest;
+ }
+ state->have++;
+ state->next--;
+ state->next[0] = c;
+ state->pos--;
+ return c;
+}
+
+/* -- see zlib.h -- */
+char * ZEXPORT gzgets(file, buf, len)
+ gzFile file;
+ char *buf;
+ int len;
+{
+ unsigned left, n;
+ char *str;
+ unsigned char *eol;
+ gz_statep state;
+
+ /* check parameters and get internal structure */
+ if (file == NULL || buf == NULL || len < 1)
+ return NULL;
+ state = (gz_statep)file;
+
+ /* check that we're reading and that there's no error */
+ if (state->mode != GZ_READ || state->err != Z_OK)
+ return NULL;
+
+ /* process a skip request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_skip(state, state->skip) == -1)
+ return NULL;
+ }
+
+ /* copy output bytes up to new line or len - 1, whichever comes first --
+ append a terminating zero to the string (we don't check for a zero in
+ the contents, let the user worry about that) */
+ str = buf;
+ left = (unsigned)len - 1;
+ if (left) do {
+ /* assure that something is in the output buffer */
+ if (state->have == 0) {
+ if (gz_make(state) == -1)
+ return NULL; /* error */
+ if (state->have == 0) { /* end of file */
+ if (buf == str) /* got bupkus */
+ return NULL;
+ break; /* got something -- return it */
+ }
+ }
+
+ /* look for end-of-line in current output buffer */
+ n = state->have > left ? left : state->have;
+ eol = memchr(state->next, '\n', n);
+ if (eol != NULL)
+ n = (unsigned)(eol - state->next) + 1;
+
+ /* copy through end-of-line, or remainder if not found */
+ memcpy(buf, state->next, n);
+ state->have -= n;
+ state->next += n;
+ state->pos += n;
+ left -= n;
+ buf += n;
+ } while (left && eol == NULL);
+
+ /* found end-of-line or out of space -- terminate string and return it */
+ buf[0] = 0;
+ return str;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzdirect(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return 0;
+ state = (gz_statep)file;
+
+ /* check that we're reading */
+ if (state->mode != GZ_READ)
+ return 0;
+
+ /* if the state is not known, but we can find out, then do so (this is
+ mainly for right after a gzopen() or gzdopen()) */
+ if (state->how == LOOK && state->have == 0)
+ (void)gz_head(state);
+
+ /* return 1 if reading direct, 0 if decompressing a gzip stream */
+ return state->direct;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzclose_r(file)
+ gzFile file;
+{
+ int ret;
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return Z_STREAM_ERROR;
+ state = (gz_statep)file;
+
+ /* check that we're reading */
+ if (state->mode != GZ_READ)
+ return Z_STREAM_ERROR;
+
+ /* free memory and close file */
+ if (state->size) {
+ inflateEnd(&(state->strm));
+ free(state->out);
+ free(state->in);
+ }
+ gz_error(state, Z_OK, NULL);
+ free(state->path);
+ ret = close(state->fd);
+ free(state);
+ return ret ? Z_ERRNO : Z_OK;
+}
diff --git a/Modules/zlib/gzwrite.c b/Modules/zlib/gzwrite.c
new file mode 100644
index 0000000000..e8defc6887
--- /dev/null
+++ b/Modules/zlib/gzwrite.c
@@ -0,0 +1,531 @@
+/* gzwrite.c -- zlib functions for writing gzip files
+ * Copyright (C) 2004, 2005, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+/* Local functions */
+local int gz_init OF((gz_statep));
+local int gz_comp OF((gz_statep, int));
+local int gz_zero OF((gz_statep, z_off64_t));
+
+/* Initialize state for writing a gzip file. Mark initialization by setting
+ state->size to non-zero. Return -1 on failure or 0 on success. */
+local int gz_init(state)
+ gz_statep state;
+{
+ int ret;
+ z_streamp strm = &(state->strm);
+
+ /* allocate input and output buffers */
+ state->in = malloc(state->want);
+ state->out = malloc(state->want);
+ if (state->in == NULL || state->out == NULL) {
+ if (state->out != NULL)
+ free(state->out);
+ if (state->in != NULL)
+ free(state->in);
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+
+ /* allocate deflate memory, set up for gzip compression */
+ strm->zalloc = Z_NULL;
+ strm->zfree = Z_NULL;
+ strm->opaque = Z_NULL;
+ ret = deflateInit2(strm, state->level, Z_DEFLATED,
+ 15 + 16, 8, state->strategy);
+ if (ret != Z_OK) {
+ free(state->in);
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+
+ /* mark state as initialized */
+ state->size = state->want;
+
+ /* initialize write buffer */
+ strm->avail_out = state->size;
+ strm->next_out = state->out;
+ state->next = strm->next_out;
+ return 0;
+}
+
+/* Compress whatever is at avail_in and next_in and write to the output file.
+ Return -1 if there is an error writing to the output file, otherwise 0.
+ flush is assumed to be a valid deflate() flush value. If flush is Z_FINISH,
+ then the deflate() state is reset to start a new gzip stream. */
+local int gz_comp(state, flush)
+ gz_statep state;
+ int flush;
+{
+ int ret, got;
+ unsigned have;
+ z_streamp strm = &(state->strm);
+
+ /* allocate memory if this is the first time through */
+ if (state->size == 0 && gz_init(state) == -1)
+ return -1;
+
+ /* run deflate() on provided input until it produces no more output */
+ ret = Z_OK;
+ do {
+ /* write out current buffer contents if full, or if flushing, but if
+ doing Z_FINISH then don't write until we get to Z_STREAM_END */
+ if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
+ (flush != Z_FINISH || ret == Z_STREAM_END))) {
+ have = (unsigned)(strm->next_out - state->next);
+ if (have && ((got = write(state->fd, state->next, have)) < 0 ||
+ (unsigned)got != have)) {
+ gz_error(state, Z_ERRNO, zstrerror());
+ return -1;
+ }
+ if (strm->avail_out == 0) {
+ strm->avail_out = state->size;
+ strm->next_out = state->out;
+ }
+ state->next = strm->next_out;
+ }
+
+ /* compress */
+ have = strm->avail_out;
+ ret = deflate(strm, flush);
+ if (ret == Z_STREAM_ERROR) {
+ gz_error(state, Z_STREAM_ERROR,
+ "internal error: deflate stream corrupt");
+ return -1;
+ }
+ have -= strm->avail_out;
+ } while (have);
+
+ /* if that completed a deflate stream, allow another to start */
+ if (flush == Z_FINISH)
+ deflateReset(strm);
+
+ /* all done, no errors */
+ return 0;
+}
+
+/* Compress len zeros to output. Return -1 on error, 0 on success. */
+local int gz_zero(state, len)
+ gz_statep state;
+ z_off64_t len;
+{
+ int first;
+ unsigned n;
+ z_streamp strm = &(state->strm);
+
+ /* consume whatever's left in the input buffer */
+ if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+ return -1;
+
+ /* compress len zeros (len guaranteed > 0) */
+ first = 1;
+ while (len) {
+ n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
+ (unsigned)len : state->size;
+ if (first) {
+ memset(state->in, 0, n);
+ first = 0;
+ }
+ strm->avail_in = n;
+ strm->next_in = state->in;
+ state->pos += n;
+ if (gz_comp(state, Z_NO_FLUSH) == -1)
+ return -1;
+ len -= n;
+ }
+ return 0;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzwrite(file, buf, len)
+ gzFile file;
+ voidpc buf;
+ unsigned len;
+{
+ unsigned put = len;
+ unsigned n;
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return 0;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return 0;
+
+ /* since an int is returned, make sure len fits in one, otherwise return
+ with an error (this avoids the flaw in the interface) */
+ if ((int)len < 0) {
+ gz_error(state, Z_BUF_ERROR, "requested length does not fit in int");
+ return 0;
+ }
+
+ /* if len is zero, avoid unnecessary operations */
+ if (len == 0)
+ return 0;
+
+ /* allocate memory if this is the first time through */
+ if (state->size == 0 && gz_init(state) == -1)
+ return 0;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return 0;
+ }
+
+ /* for small len, copy to input buffer, otherwise compress directly */
+ if (len < state->size) {
+ /* copy to input buffer, compress when full */
+ do {
+ if (strm->avail_in == 0)
+ strm->next_in = state->in;
+ n = state->size - strm->avail_in;
+ if (n > len)
+ n = len;
+ memcpy(strm->next_in + strm->avail_in, buf, n);
+ strm->avail_in += n;
+ state->pos += n;
+ buf = (char *)buf + n;
+ len -= n;
+ if (len && gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+ } while (len);
+ }
+ else {
+ /* consume whatever's left in the input buffer */
+ if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+
+ /* directly compress user buffer to file */
+ strm->avail_in = len;
+ strm->next_in = (voidp)buf;
+ state->pos += len;
+ if (gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+ }
+
+ /* input was all buffered or compressed (put will fit in int) */
+ return (int)put;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzputc(file, c)
+ gzFile file;
+ int c;
+{
+ unsigned char buf[1];
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return -1;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* try writing to input buffer for speed (state->size == 0 if buffer not
+ initialized) */
+ if (strm->avail_in < state->size) {
+ if (strm->avail_in == 0)
+ strm->next_in = state->in;
+ strm->next_in[strm->avail_in++] = c;
+ state->pos++;
+ return c;
+ }
+
+ /* no room in buffer or not initialized, use gz_write() */
+ buf[0] = c;
+ if (gzwrite(file, buf, 1) != 1)
+ return -1;
+ return c;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzputs(file, str)
+ gzFile file;
+ const char *str;
+{
+ int ret;
+ unsigned len;
+
+ /* write string */
+ len = (unsigned)strlen(str);
+ ret = gzwrite(file, str, len);
+ return ret == 0 && len != 0 ? -1 : ret;
+}
+
+#ifdef STDC
+#include <stdarg.h>
+
+/* -- see zlib.h -- */
+int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
+{
+ int size, len;
+ gz_statep state;
+ z_streamp strm;
+ va_list va;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return 0;
+
+ /* make sure we have some buffer space */
+ if (state->size == 0 && gz_init(state) == -1)
+ return 0;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return 0;
+ }
+
+ /* consume whatever's left in the input buffer */
+ if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+
+ /* do the printf() into the input buffer, put length in len */
+ size = (int)(state->size);
+ state->in[size - 1] = 0;
+ va_start(va, format);
+#ifdef NO_vsnprintf
+# ifdef HAS_vsprintf_void
+ (void)vsprintf(state->in, format, va);
+ va_end(va);
+ for (len = 0; len < size; len++)
+ if (state->in[len] == 0) break;
+# else
+ len = vsprintf(state->in, format, va);
+ va_end(va);
+# endif
+#else
+# ifdef HAS_vsnprintf_void
+ (void)vsnprintf(state->in, size, format, va);
+ va_end(va);
+ len = strlen(state->in);
+# else
+ len = vsnprintf((char *)(state->in), size, format, va);
+ va_end(va);
+# endif
+#endif
+
+ /* check that printf() results fit in buffer */
+ if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
+ return 0;
+
+ /* update buffer and position, defer compression until needed */
+ strm->avail_in = (unsigned)len;
+ strm->next_in = state->in;
+ state->pos += len;
+ return len;
+}
+
+#else /* !STDC */
+
+/* -- see zlib.h -- */
+int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
+ gzFile file;
+ const char *format;
+ int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
+{
+ int size, len;
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return 0;
+
+ /* make sure we have some buffer space */
+ if (state->size == 0 && gz_init(state) == -1)
+ return 0;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return 0;
+ }
+
+ /* consume whatever's left in the input buffer */
+ if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+
+ /* do the printf() into the input buffer, put length in len */
+ size = (int)(state->size);
+ state->in[size - 1] = 0;
+#ifdef NO_snprintf
+# ifdef HAS_sprintf_void
+ sprintf(state->in, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+ for (len = 0; len < size; len++)
+ if (state->in[len] == 0) break;
+# else
+ len = sprintf(state->in, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+# endif
+#else
+# ifdef HAS_snprintf_void
+ snprintf(state->in, size, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+ len = strlen(state->in);
+# else
+ len = snprintf(state->in, size, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+# endif
+#endif
+
+ /* check that printf() results fit in buffer */
+ if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
+ return 0;
+
+ /* update buffer and position, defer compression until needed */
+ strm->avail_in = (unsigned)len;
+ strm->next_in = state->in;
+ state->pos += len;
+ return len;
+}
+
+#endif
+
+/* -- see zlib.h -- */
+int ZEXPORT gzflush(file, flush)
+ gzFile file;
+ int flush;
+{
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return Z_STREAM_ERROR;
+
+ /* check flush parameter */
+ if (flush < 0 || flush > Z_FINISH)
+ return Z_STREAM_ERROR;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* compress remaining data with requested flush */
+ gz_comp(state, flush);
+ return state->err;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzsetparams(file, level, strategy)
+ gzFile file;
+ int level;
+ int strategy;
+{
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return Z_STREAM_ERROR;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return Z_STREAM_ERROR;
+
+ /* if no change is requested, then do nothing */
+ if (level == state->level && strategy == state->strategy)
+ return Z_OK;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* change compression parameters for subsequent input */
+ if (state->size) {
+ /* flush previous input with previous parameters before changing */
+ if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)
+ return state->err;
+ deflateParams(strm, level, strategy);
+ }
+ state->level = level;
+ state->strategy = strategy;
+ return Z_OK;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzclose_w(file)
+ gzFile file;
+{
+ int ret = 0;
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return Z_STREAM_ERROR;
+ state = (gz_statep)file;
+
+ /* check that we're writing */
+ if (state->mode != GZ_WRITE)
+ return Z_STREAM_ERROR;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ ret += gz_zero(state, state->skip);
+ }
+
+ /* flush, free memory, and close file */
+ ret += gz_comp(state, Z_FINISH);
+ (void)deflateEnd(&(state->strm));
+ free(state->out);
+ free(state->in);
+ gz_error(state, Z_OK, NULL);
+ free(state->path);
+ ret += close(state->fd);
+ free(state);
+ return ret ? Z_ERRNO : Z_OK;
+}
diff --git a/Modules/zlib/infback.c b/Modules/zlib/infback.c
index 455dbc9ee8..af3a8c965d 100644
--- a/Modules/zlib/infback.c
+++ b/Modules/zlib/infback.c
@@ -1,5 +1,5 @@
/* infback.c -- inflate using a call-back interface
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2009 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -55,7 +55,7 @@ int stream_size;
state->wbits = windowBits;
state->wsize = 1U << windowBits;
state->window = window;
- state->write = 0;
+ state->wnext = 0;
state->whave = 0;
return Z_OK;
}
@@ -253,7 +253,7 @@ void FAR *out_desc;
unsigned bits; /* bits in bit buffer */
unsigned copy; /* number of stored or match bytes to copy */
unsigned char FAR *from; /* where to copy match bytes from */
- code this; /* current decoding table entry */
+ code here; /* current decoding table entry */
code last; /* parent table entry */
unsigned len; /* length to copy for repeats, bits to drop */
int ret; /* return code */
@@ -389,19 +389,19 @@ void FAR *out_desc;
state->have = 0;
while (state->have < state->nlen + state->ndist) {
for (;;) {
- this = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(this.bits) <= bits) break;
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
PULLBYTE();
}
- if (this.val < 16) {
- NEEDBITS(this.bits);
- DROPBITS(this.bits);
- state->lens[state->have++] = this.val;
+ if (here.val < 16) {
+ NEEDBITS(here.bits);
+ DROPBITS(here.bits);
+ state->lens[state->have++] = here.val;
}
else {
- if (this.val == 16) {
- NEEDBITS(this.bits + 2);
- DROPBITS(this.bits);
+ if (here.val == 16) {
+ NEEDBITS(here.bits + 2);
+ DROPBITS(here.bits);
if (state->have == 0) {
strm->msg = (char *)"invalid bit length repeat";
state->mode = BAD;
@@ -411,16 +411,16 @@ void FAR *out_desc;
copy = 3 + BITS(2);
DROPBITS(2);
}
- else if (this.val == 17) {
- NEEDBITS(this.bits + 3);
- DROPBITS(this.bits);
+ else if (here.val == 17) {
+ NEEDBITS(here.bits + 3);
+ DROPBITS(here.bits);
len = 0;
copy = 3 + BITS(3);
DROPBITS(3);
}
else {
- NEEDBITS(this.bits + 7);
- DROPBITS(this.bits);
+ NEEDBITS(here.bits + 7);
+ DROPBITS(here.bits);
len = 0;
copy = 11 + BITS(7);
DROPBITS(7);
@@ -438,7 +438,16 @@ void FAR *out_desc;
/* handle error breaks in while */
if (state->mode == BAD) break;
- /* build code tables */
+ /* check for end-of-block code (better have one) */
+ if (state->lens[256] == 0) {
+ strm->msg = (char *)"invalid code -- missing end-of-block";
+ state->mode = BAD;
+ break;
+ }
+
+ /* build code tables -- note: do not change the lenbits or distbits
+ values here (9 and 6) without reading the comments in inftrees.h
+ concerning the ENOUGH constants, which depend on those values */
state->next = state->codes;
state->lencode = (code const FAR *)(state->next);
state->lenbits = 9;
@@ -474,28 +483,28 @@ void FAR *out_desc;
/* get a literal, length, or end-of-block code */
for (;;) {
- this = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(this.bits) <= bits) break;
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
PULLBYTE();
}
- if (this.op && (this.op & 0xf0) == 0) {
- last = this;
+ if (here.op && (here.op & 0xf0) == 0) {
+ last = here;
for (;;) {
- this = state->lencode[last.val +
+ here = state->lencode[last.val +
(BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + this.bits) <= bits) break;
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
PULLBYTE();
}
DROPBITS(last.bits);
}
- DROPBITS(this.bits);
- state->length = (unsigned)this.val;
+ DROPBITS(here.bits);
+ state->length = (unsigned)here.val;
/* process literal */
- if (this.op == 0) {
- Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+ if (here.op == 0) {
+ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
"inflate: literal '%c'\n" :
- "inflate: literal 0x%02x\n", this.val));
+ "inflate: literal 0x%02x\n", here.val));
ROOM();
*put++ = (unsigned char)(state->length);
left--;
@@ -504,21 +513,21 @@ void FAR *out_desc;
}
/* process end of block */
- if (this.op & 32) {
+ if (here.op & 32) {
Tracevv((stderr, "inflate: end of block\n"));
state->mode = TYPE;
break;
}
/* invalid code */
- if (this.op & 64) {
+ if (here.op & 64) {
strm->msg = (char *)"invalid literal/length code";
state->mode = BAD;
break;
}
/* length code -- get extra bits, if any */
- state->extra = (unsigned)(this.op) & 15;
+ state->extra = (unsigned)(here.op) & 15;
if (state->extra != 0) {
NEEDBITS(state->extra);
state->length += BITS(state->extra);
@@ -528,30 +537,30 @@ void FAR *out_desc;
/* get distance code */
for (;;) {
- this = state->distcode[BITS(state->distbits)];
- if ((unsigned)(this.bits) <= bits) break;
+ here = state->distcode[BITS(state->distbits)];
+ if ((unsigned)(here.bits) <= bits) break;
PULLBYTE();
}
- if ((this.op & 0xf0) == 0) {
- last = this;
+ if ((here.op & 0xf0) == 0) {
+ last = here;
for (;;) {
- this = state->distcode[last.val +
+ here = state->distcode[last.val +
(BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + this.bits) <= bits) break;
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
PULLBYTE();
}
DROPBITS(last.bits);
}
- DROPBITS(this.bits);
- if (this.op & 64) {
+ DROPBITS(here.bits);
+ if (here.op & 64) {
strm->msg = (char *)"invalid distance code";
state->mode = BAD;
break;
}
- state->offset = (unsigned)this.val;
+ state->offset = (unsigned)here.val;
/* get distance extra bits, if any */
- state->extra = (unsigned)(this.op) & 15;
+ state->extra = (unsigned)(here.op) & 15;
if (state->extra != 0) {
NEEDBITS(state->extra);
state->offset += BITS(state->extra);
diff --git a/Modules/zlib/inffast.c b/Modules/zlib/inffast.c
index bbee92ed1e..2f1d60b43b 100644
--- a/Modules/zlib/inffast.c
+++ b/Modules/zlib/inffast.c
@@ -1,5 +1,5 @@
/* inffast.c -- fast decoding
- * Copyright (C) 1995-2004 Mark Adler
+ * Copyright (C) 1995-2008, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -64,7 +64,7 @@
requires strm->avail_out >= 258 for each loop to avoid checking for
output space.
*/
-void inflate_fast(strm, start)
+void ZLIB_INTERNAL inflate_fast(strm, start)
z_streamp strm;
unsigned start; /* inflate()'s starting value for strm->avail_out */
{
@@ -79,7 +79,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
#endif
unsigned wsize; /* window size or zero if not using window */
unsigned whave; /* valid bytes in the window */
- unsigned write; /* window write index */
+ unsigned wnext; /* window write index */
unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
unsigned long hold; /* local strm->hold */
unsigned bits; /* local strm->bits */
@@ -87,7 +87,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
code const FAR *dcode; /* local strm->distcode */
unsigned lmask; /* mask for first level of length codes */
unsigned dmask; /* mask for first level of distance codes */
- code this; /* retrieved table entry */
+ code here; /* retrieved table entry */
unsigned op; /* code bits, operation, extra bits, or */
/* window position, window bytes to copy */
unsigned len; /* match length, unused bytes */
@@ -106,7 +106,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
#endif
wsize = state->wsize;
whave = state->whave;
- write = state->write;
+ wnext = state->wnext;
window = state->window;
hold = state->hold;
bits = state->bits;
@@ -124,20 +124,20 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
}
- this = lcode[hold & lmask];
+ here = lcode[hold & lmask];
dolen:
- op = (unsigned)(this.bits);
+ op = (unsigned)(here.bits);
hold >>= op;
bits -= op;
- op = (unsigned)(this.op);
+ op = (unsigned)(here.op);
if (op == 0) { /* literal */
- Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
"inflate: literal '%c'\n" :
- "inflate: literal 0x%02x\n", this.val));
- PUP(out) = (unsigned char)(this.val);
+ "inflate: literal 0x%02x\n", here.val));
+ PUP(out) = (unsigned char)(here.val);
}
else if (op & 16) { /* length base */
- len = (unsigned)(this.val);
+ len = (unsigned)(here.val);
op &= 15; /* number of extra bits */
if (op) {
if (bits < op) {
@@ -155,14 +155,14 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
}
- this = dcode[hold & dmask];
+ here = dcode[hold & dmask];
dodist:
- op = (unsigned)(this.bits);
+ op = (unsigned)(here.bits);
hold >>= op;
bits -= op;
- op = (unsigned)(this.op);
+ op = (unsigned)(here.op);
if (op & 16) { /* distance base */
- dist = (unsigned)(this.val);
+ dist = (unsigned)(here.val);
op &= 15; /* number of extra bits */
if (bits < op) {
hold += (unsigned long)(PUP(in)) << bits;
@@ -187,12 +187,34 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
if (dist > op) { /* see if copy from window */
op = dist - op; /* distance back in window */
if (op > whave) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
+ if (state->sane) {
+ strm->msg =
+ (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ if (len <= op - whave) {
+ do {
+ PUP(out) = 0;
+ } while (--len);
+ continue;
+ }
+ len -= op - whave;
+ do {
+ PUP(out) = 0;
+ } while (--op > whave);
+ if (op == 0) {
+ from = out - dist;
+ do {
+ PUP(out) = PUP(from);
+ } while (--len);
+ continue;
+ }
+#endif
}
from = window - OFF;
- if (write == 0) { /* very common case */
+ if (wnext == 0) { /* very common case */
from += wsize - op;
if (op < len) { /* some from window */
len -= op;
@@ -202,17 +224,17 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
from = out - dist; /* rest from output */
}
}
- else if (write < op) { /* wrap around window */
- from += wsize + write - op;
- op -= write;
+ else if (wnext < op) { /* wrap around window */
+ from += wsize + wnext - op;
+ op -= wnext;
if (op < len) { /* some from end of window */
len -= op;
do {
PUP(out) = PUP(from);
} while (--op);
from = window - OFF;
- if (write < len) { /* some from start of window */
- op = write;
+ if (wnext < len) { /* some from start of window */
+ op = wnext;
len -= op;
do {
PUP(out) = PUP(from);
@@ -222,7 +244,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
}
}
else { /* contiguous in window */
- from += write - op;
+ from += wnext - op;
if (op < len) { /* some from window */
len -= op;
do {
@@ -259,7 +281,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
}
}
else if ((op & 64) == 0) { /* 2nd level distance code */
- this = dcode[this.val + (hold & ((1U << op) - 1))];
+ here = dcode[here.val + (hold & ((1U << op) - 1))];
goto dodist;
}
else {
@@ -269,7 +291,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
}
}
else if ((op & 64) == 0) { /* 2nd level length code */
- this = lcode[this.val + (hold & ((1U << op) - 1))];
+ here = lcode[here.val + (hold & ((1U << op) - 1))];
goto dolen;
}
else if (op & 32) { /* end-of-block */
@@ -305,7 +327,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
- Using bit fields for code structure
- Different op definition to avoid & for extra bits (do & for table bits)
- - Three separate decoding do-loops for direct, window, and write == 0
+ - Three separate decoding do-loops for direct, window, and wnext == 0
- Special case for distance > 1 copies to do overlapped load and store copy
- Explicit branch predictions (based on measured branch probabilities)
- Deferring match copy and interspersed it with decoding subsequent codes
diff --git a/Modules/zlib/inffast.h b/Modules/zlib/inffast.h
index 1e88d2d97b..e5c1aa4ca8 100644
--- a/Modules/zlib/inffast.h
+++ b/Modules/zlib/inffast.h
@@ -1,5 +1,5 @@
/* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-2003 Mark Adler
+ * Copyright (C) 1995-2003, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -8,4 +8,4 @@
subject to change. Applications should only use zlib.h.
*/
-void inflate_fast OF((z_streamp strm, unsigned start));
+void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
diff --git a/Modules/zlib/inflate.c b/Modules/zlib/inflate.c
index 792fdee8e9..a8431abeac 100644
--- a/Modules/zlib/inflate.c
+++ b/Modules/zlib/inflate.c
@@ -1,5 +1,5 @@
/* inflate.c -- zlib decompression
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -45,7 +45,7 @@
* - Rearrange window copies in inflate_fast() for speed and simplification
* - Unroll last copy for window match in inflate_fast()
* - Use local copies of window variables in inflate_fast() for speed
- * - Pull out common write == 0 case for speed in inflate_fast()
+ * - Pull out common wnext == 0 case for speed in inflate_fast()
* - Make op and len in inflate_fast() unsigned for consistency
* - Add FAR to lcode and dcode declarations in inflate_fast()
* - Simplified bad distance check in inflate_fast()
@@ -117,28 +117,52 @@ z_streamp strm;
state->head = Z_NULL;
state->wsize = 0;
state->whave = 0;
- state->write = 0;
+ state->wnext = 0;
state->hold = 0;
state->bits = 0;
state->lencode = state->distcode = state->next = state->codes;
+ state->sane = 1;
+ state->back = -1;
Tracev((stderr, "inflate: reset\n"));
return Z_OK;
}
-int ZEXPORT inflatePrime(strm, bits, value)
+int ZEXPORT inflateReset2(strm, windowBits)
z_streamp strm;
-int bits;
-int value;
+int windowBits;
{
+ int wrap;
struct inflate_state FAR *state;
+ /* get the state */
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
state = (struct inflate_state FAR *)strm->state;
- if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
- value &= (1L << bits) - 1;
- state->hold += value << state->bits;
- state->bits += bits;
- return Z_OK;
+
+ /* extract wrap request from windowBits parameter */
+ if (windowBits < 0) {
+ wrap = 0;
+ windowBits = -windowBits;
+ }
+ else {
+ wrap = (windowBits >> 4) + 1;
+#ifdef GUNZIP
+ if (windowBits < 48)
+ windowBits &= 15;
+#endif
+ }
+
+ /* set number of window bits, free window if different */
+ if (windowBits && (windowBits < 8 || windowBits > 15))
+ return Z_STREAM_ERROR;
+ if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
+ ZFREE(strm, state->window);
+ state->window = Z_NULL;
+ }
+
+ /* update state and reset the rest of it */
+ state->wrap = wrap;
+ state->wbits = (unsigned)windowBits;
+ return inflateReset(strm);
}
int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
@@ -147,6 +171,7 @@ int windowBits;
const char *version;
int stream_size;
{
+ int ret;
struct inflate_state FAR *state;
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
@@ -164,24 +189,13 @@ int stream_size;
if (state == Z_NULL) return Z_MEM_ERROR;
Tracev((stderr, "inflate: allocated\n"));
strm->state = (struct internal_state FAR *)state;
- if (windowBits < 0) {
- state->wrap = 0;
- windowBits = -windowBits;
- }
- else {
- state->wrap = (windowBits >> 4) + 1;
-#ifdef GUNZIP
- if (windowBits < 48) windowBits &= 15;
-#endif
- }
- if (windowBits < 8 || windowBits > 15) {
+ state->window = Z_NULL;
+ ret = inflateReset2(strm, windowBits);
+ if (ret != Z_OK) {
ZFREE(strm, state);
strm->state = Z_NULL;
- return Z_STREAM_ERROR;
}
- state->wbits = (unsigned)windowBits;
- state->window = Z_NULL;
- return inflateReset(strm);
+ return ret;
}
int ZEXPORT inflateInit_(strm, version, stream_size)
@@ -192,6 +206,27 @@ int stream_size;
return inflateInit2_(strm, DEF_WBITS, version, stream_size);
}
+int ZEXPORT inflatePrime(strm, bits, value)
+z_streamp strm;
+int bits;
+int value;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (bits < 0) {
+ state->hold = 0;
+ state->bits = 0;
+ return Z_OK;
+ }
+ if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
+ value &= (1L << bits) - 1;
+ state->hold += value << state->bits;
+ state->bits += bits;
+ return Z_OK;
+}
+
/*
Return state with length and distance decoding tables and index sizes set to
fixed code decoding. Normally this returns fixed tables from inffixed.h.
@@ -340,7 +375,7 @@ unsigned out;
/* if window not in use yet, initialize */
if (state->wsize == 0) {
state->wsize = 1U << state->wbits;
- state->write = 0;
+ state->wnext = 0;
state->whave = 0;
}
@@ -348,22 +383,22 @@ unsigned out;
copy = out - strm->avail_out;
if (copy >= state->wsize) {
zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
- state->write = 0;
+ state->wnext = 0;
state->whave = state->wsize;
}
else {
- dist = state->wsize - state->write;
+ dist = state->wsize - state->wnext;
if (dist > copy) dist = copy;
- zmemcpy(state->window + state->write, strm->next_out - copy, dist);
+ zmemcpy(state->window + state->wnext, strm->next_out - copy, dist);
copy -= dist;
if (copy) {
zmemcpy(state->window, strm->next_out - copy, copy);
- state->write = copy;
+ state->wnext = copy;
state->whave = state->wsize;
}
else {
- state->write += dist;
- if (state->write == state->wsize) state->write = 0;
+ state->wnext += dist;
+ if (state->wnext == state->wsize) state->wnext = 0;
if (state->whave < state->wsize) state->whave += dist;
}
}
@@ -564,7 +599,7 @@ int flush;
unsigned in, out; /* save starting available input and output */
unsigned copy; /* number of stored or match bytes to copy */
unsigned char FAR *from; /* where to copy match bytes from */
- code this; /* current decoding table entry */
+ code here; /* current decoding table entry */
code last; /* parent table entry */
unsigned len; /* length to copy for repeats, bits to drop */
int ret; /* return code */
@@ -619,7 +654,9 @@ int flush;
}
DROPBITS(4);
len = BITS(4) + 8;
- if (len > state->wbits) {
+ if (state->wbits == 0)
+ state->wbits = len;
+ else if (len > state->wbits) {
strm->msg = (char *)"invalid window size";
state->mode = BAD;
break;
@@ -771,7 +808,7 @@ int flush;
strm->adler = state->check = adler32(0L, Z_NULL, 0);
state->mode = TYPE;
case TYPE:
- if (flush == Z_BLOCK) goto inf_leave;
+ if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
case TYPEDO:
if (state->last) {
BYTEBITS();
@@ -791,7 +828,11 @@ int flush;
fixedtables(state);
Tracev((stderr, "inflate: fixed codes block%s\n",
state->last ? " (last)" : ""));
- state->mode = LEN; /* decode codes */
+ state->mode = LEN_; /* decode codes */
+ if (flush == Z_TREES) {
+ DROPBITS(2);
+ goto inf_leave;
+ }
break;
case 2: /* dynamic block */
Tracev((stderr, "inflate: dynamic codes block%s\n",
@@ -816,6 +857,9 @@ int flush;
Tracev((stderr, "inflate: stored length %u\n",
state->length));
INITBITS();
+ state->mode = COPY_;
+ if (flush == Z_TREES) goto inf_leave;
+ case COPY_:
state->mode = COPY;
case COPY:
copy = state->length;
@@ -876,19 +920,19 @@ int flush;
case CODELENS:
while (state->have < state->nlen + state->ndist) {
for (;;) {
- this = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(this.bits) <= bits) break;
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
PULLBYTE();
}
- if (this.val < 16) {
- NEEDBITS(this.bits);
- DROPBITS(this.bits);
- state->lens[state->have++] = this.val;
+ if (here.val < 16) {
+ NEEDBITS(here.bits);
+ DROPBITS(here.bits);
+ state->lens[state->have++] = here.val;
}
else {
- if (this.val == 16) {
- NEEDBITS(this.bits + 2);
- DROPBITS(this.bits);
+ if (here.val == 16) {
+ NEEDBITS(here.bits + 2);
+ DROPBITS(here.bits);
if (state->have == 0) {
strm->msg = (char *)"invalid bit length repeat";
state->mode = BAD;
@@ -898,16 +942,16 @@ int flush;
copy = 3 + BITS(2);
DROPBITS(2);
}
- else if (this.val == 17) {
- NEEDBITS(this.bits + 3);
- DROPBITS(this.bits);
+ else if (here.val == 17) {
+ NEEDBITS(here.bits + 3);
+ DROPBITS(here.bits);
len = 0;
copy = 3 + BITS(3);
DROPBITS(3);
}
else {
- NEEDBITS(this.bits + 7);
- DROPBITS(this.bits);
+ NEEDBITS(here.bits + 7);
+ DROPBITS(here.bits);
len = 0;
copy = 11 + BITS(7);
DROPBITS(7);
@@ -925,7 +969,16 @@ int flush;
/* handle error breaks in while */
if (state->mode == BAD) break;
- /* build code tables */
+ /* check for end-of-block code (better have one) */
+ if (state->lens[256] == 0) {
+ strm->msg = (char *)"invalid code -- missing end-of-block";
+ state->mode = BAD;
+ break;
+ }
+
+ /* build code tables -- note: do not change the lenbits or distbits
+ values here (9 and 6) without reading the comments in inftrees.h
+ concerning the ENOUGH constants, which depend on those values */
state->next = state->codes;
state->lencode = (code const FAR *)(state->next);
state->lenbits = 9;
@@ -946,88 +999,102 @@ int flush;
break;
}
Tracev((stderr, "inflate: codes ok\n"));
+ state->mode = LEN_;
+ if (flush == Z_TREES) goto inf_leave;
+ case LEN_:
state->mode = LEN;
case LEN:
if (have >= 6 && left >= 258) {
RESTORE();
inflate_fast(strm, out);
LOAD();
+ if (state->mode == TYPE)
+ state->back = -1;
break;
}
+ state->back = 0;
for (;;) {
- this = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(this.bits) <= bits) break;
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
PULLBYTE();
}
- if (this.op && (this.op & 0xf0) == 0) {
- last = this;
+ if (here.op && (here.op & 0xf0) == 0) {
+ last = here;
for (;;) {
- this = state->lencode[last.val +
+ here = state->lencode[last.val +
(BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + this.bits) <= bits) break;
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
PULLBYTE();
}
DROPBITS(last.bits);
+ state->back += last.bits;
}
- DROPBITS(this.bits);
- state->length = (unsigned)this.val;
- if ((int)(this.op) == 0) {
- Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+ DROPBITS(here.bits);
+ state->back += here.bits;
+ state->length = (unsigned)here.val;
+ if ((int)(here.op) == 0) {
+ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
"inflate: literal '%c'\n" :
- "inflate: literal 0x%02x\n", this.val));
+ "inflate: literal 0x%02x\n", here.val));
state->mode = LIT;
break;
}
- if (this.op & 32) {
+ if (here.op & 32) {
Tracevv((stderr, "inflate: end of block\n"));
+ state->back = -1;
state->mode = TYPE;
break;
}
- if (this.op & 64) {
+ if (here.op & 64) {
strm->msg = (char *)"invalid literal/length code";
state->mode = BAD;
break;
}
- state->extra = (unsigned)(this.op) & 15;
+ state->extra = (unsigned)(here.op) & 15;
state->mode = LENEXT;
case LENEXT:
if (state->extra) {
NEEDBITS(state->extra);
state->length += BITS(state->extra);
DROPBITS(state->extra);
+ state->back += state->extra;
}
Tracevv((stderr, "inflate: length %u\n", state->length));
+ state->was = state->length;
state->mode = DIST;
case DIST:
for (;;) {
- this = state->distcode[BITS(state->distbits)];
- if ((unsigned)(this.bits) <= bits) break;
+ here = state->distcode[BITS(state->distbits)];
+ if ((unsigned)(here.bits) <= bits) break;
PULLBYTE();
}
- if ((this.op & 0xf0) == 0) {
- last = this;
+ if ((here.op & 0xf0) == 0) {
+ last = here;
for (;;) {
- this = state->distcode[last.val +
+ here = state->distcode[last.val +
(BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + this.bits) <= bits) break;
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
PULLBYTE();
}
DROPBITS(last.bits);
+ state->back += last.bits;
}
- DROPBITS(this.bits);
- if (this.op & 64) {
+ DROPBITS(here.bits);
+ state->back += here.bits;
+ if (here.op & 64) {
strm->msg = (char *)"invalid distance code";
state->mode = BAD;
break;
}
- state->offset = (unsigned)this.val;
- state->extra = (unsigned)(this.op) & 15;
+ state->offset = (unsigned)here.val;
+ state->extra = (unsigned)(here.op) & 15;
state->mode = DISTEXT;
case DISTEXT:
if (state->extra) {
NEEDBITS(state->extra);
state->offset += BITS(state->extra);
DROPBITS(state->extra);
+ state->back += state->extra;
}
#ifdef INFLATE_STRICT
if (state->offset > state->dmax) {
@@ -1036,11 +1103,6 @@ int flush;
break;
}
#endif
- if (state->offset > state->whave + out - left) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
Tracevv((stderr, "inflate: distance %u\n", state->offset));
state->mode = MATCH;
case MATCH:
@@ -1048,12 +1110,32 @@ int flush;
copy = out - left;
if (state->offset > copy) { /* copy from window */
copy = state->offset - copy;
- if (copy > state->write) {
- copy -= state->write;
+ if (copy > state->whave) {
+ if (state->sane) {
+ strm->msg = (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ Trace((stderr, "inflate.c too far\n"));
+ copy -= state->whave;
+ if (copy > state->length) copy = state->length;
+ if (copy > left) copy = left;
+ left -= copy;
+ state->length -= copy;
+ do {
+ *put++ = 0;
+ } while (--copy);
+ if (state->length == 0) state->mode = LEN;
+ break;
+#endif
+ }
+ if (copy > state->wnext) {
+ copy -= state->wnext;
from = state->window + (state->wsize - copy);
}
else
- from = state->window + (state->write - copy);
+ from = state->window + (state->wnext - copy);
if (copy > state->length) copy = state->length;
}
else { /* copy from output */
@@ -1146,7 +1228,8 @@ int flush;
strm->adler = state->check =
UPDATE(state->check, strm->next_out - out, out);
strm->data_type = state->bits + (state->last ? 64 : 0) +
- (state->mode == TYPE ? 128 : 0);
+ (state->mode == TYPE ? 128 : 0) +
+ (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
ret = Z_BUF_ERROR;
return ret;
@@ -1366,3 +1449,32 @@ z_streamp source;
dest->state = (struct internal_state FAR *)copy;
return Z_OK;
}
+
+int ZEXPORT inflateUndermine(strm, subvert)
+z_streamp strm;
+int subvert;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ state->sane = !subvert;
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ return Z_OK;
+#else
+ state->sane = 1;
+ return Z_DATA_ERROR;
+#endif
+}
+
+long ZEXPORT inflateMark(strm)
+z_streamp strm;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
+ state = (struct inflate_state FAR *)strm->state;
+ return ((long)(state->back) << 16) +
+ (state->mode == COPY ? state->length :
+ (state->mode == MATCH ? state->was - state->length : 0));
+}
diff --git a/Modules/zlib/inflate.h b/Modules/zlib/inflate.h
index 07bd3e78a7..95f4986d40 100644
--- a/Modules/zlib/inflate.h
+++ b/Modules/zlib/inflate.h
@@ -1,5 +1,5 @@
/* inflate.h -- internal inflate state definition
- * Copyright (C) 1995-2004 Mark Adler
+ * Copyright (C) 1995-2009 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -32,11 +32,13 @@ typedef enum {
TYPE, /* i: waiting for type bits, including last-flag bit */
TYPEDO, /* i: same, but skip check to exit inflate on new block */
STORED, /* i: waiting for stored size (length and complement) */
+ COPY_, /* i/o: same as COPY below, but only first time in */
COPY, /* i/o: waiting for input or output to copy stored block */
TABLE, /* i: waiting for dynamic block table lengths */
LENLENS, /* i: waiting for code length code lengths */
CODELENS, /* i: waiting for length/lit and distance code lengths */
- LEN, /* i: waiting for length/lit code */
+ LEN_, /* i: same as LEN below, but only first time in */
+ LEN, /* i: waiting for length/lit/eob code */
LENEXT, /* i: waiting for length extra bits */
DIST, /* i: waiting for distance code */
DISTEXT, /* i: waiting for distance extra bits */
@@ -53,19 +55,21 @@ typedef enum {
/*
State transitions between above modes -
- (most modes can go to the BAD or MEM mode -- not shown for clarity)
+ (most modes can go to BAD or MEM on error -- not shown for clarity)
Process header:
- HEAD -> (gzip) or (zlib)
- (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
- NAME -> COMMENT -> HCRC -> TYPE
+ HEAD -> (gzip) or (zlib) or (raw)
+ (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
+ HCRC -> TYPE
(zlib) -> DICTID or TYPE
DICTID -> DICT -> TYPE
+ (raw) -> TYPEDO
Read deflate blocks:
- TYPE -> STORED or TABLE or LEN or CHECK
- STORED -> COPY -> TYPE
- TABLE -> LENLENS -> CODELENS -> LEN
- Read deflate codes:
+ TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
+ STORED -> COPY_ -> COPY -> TYPE
+ TABLE -> LENLENS -> CODELENS -> LEN_
+ LEN_ -> LEN
+ Read deflate codes in fixed or dynamic block:
LEN -> LENEXT or LIT or TYPE
LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
LIT -> LEN
@@ -73,7 +77,7 @@ typedef enum {
CHECK -> LENGTH -> DONE
*/
-/* state maintained between inflate() calls. Approximately 7K bytes. */
+/* state maintained between inflate() calls. Approximately 10K bytes. */
struct inflate_state {
inflate_mode mode; /* current inflate mode */
int last; /* true if processing last block */
@@ -88,7 +92,7 @@ struct inflate_state {
unsigned wbits; /* log base 2 of requested window size */
unsigned wsize; /* window size or zero if not using window */
unsigned whave; /* valid bytes in the window */
- unsigned write; /* window write index */
+ unsigned wnext; /* window write index */
unsigned char FAR *window; /* allocated sliding window, if needed */
/* bit accumulator */
unsigned long hold; /* input bit accumulator */
@@ -112,4 +116,7 @@ struct inflate_state {
unsigned short lens[320]; /* temporary storage for code lengths */
unsigned short work[288]; /* work area for code table building */
code codes[ENOUGH]; /* space for code tables */
+ int sane; /* if false, allow invalid distance too far */
+ int back; /* bits back of last unprocessed length/lit */
+ unsigned was; /* initial length of match */
};
diff --git a/Modules/zlib/inftrees.c b/Modules/zlib/inftrees.c
index 8a9c13ff03..11e9c52acc 100644
--- a/Modules/zlib/inftrees.c
+++ b/Modules/zlib/inftrees.c
@@ -1,5 +1,5 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate_copyright[] =
- " inflate 1.2.3 Copyright 1995-2005 Mark Adler ";
+ " inflate 1.2.5 Copyright 1995-2010 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -29,7 +29,7 @@ const char inflate_copyright[] =
table index bits. It will differ if the request is greater than the
longest code or if it is less than the shortest code.
*/
-int inflate_table(type, lens, codes, table, bits, work)
+int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
codetype type;
unsigned short FAR *lens;
unsigned codes;
@@ -50,7 +50,7 @@ unsigned short FAR *work;
unsigned fill; /* index for replicating entries */
unsigned low; /* low bits for current root entry */
unsigned mask; /* mask for low root bits */
- code this; /* table entry for duplication */
+ code here; /* table entry for duplication */
code FAR *next; /* next available space in table */
const unsigned short FAR *base; /* base value table to use */
const unsigned short FAR *extra; /* extra bits table to use */
@@ -62,7 +62,7 @@ unsigned short FAR *work;
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 73, 195};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
@@ -115,15 +115,15 @@ unsigned short FAR *work;
if (count[max] != 0) break;
if (root > max) root = max;
if (max == 0) { /* no symbols to code at all */
- this.op = (unsigned char)64; /* invalid code marker */
- this.bits = (unsigned char)1;
- this.val = (unsigned short)0;
- *(*table)++ = this; /* make a table to force an error */
- *(*table)++ = this;
+ here.op = (unsigned char)64; /* invalid code marker */
+ here.bits = (unsigned char)1;
+ here.val = (unsigned short)0;
+ *(*table)++ = here; /* make a table to force an error */
+ *(*table)++ = here;
*bits = 1;
return 0; /* no symbols, but wait for decoding to report error */
}
- for (min = 1; min <= MAXBITS; min++)
+ for (min = 1; min < max; min++)
if (count[min] != 0) break;
if (root < min) root = min;
@@ -166,11 +166,10 @@ unsigned short FAR *work;
entered in the tables.
used keeps track of how many table entries have been allocated from the
- provided *table space. It is checked when a LENS table is being made
- against the space in *table, ENOUGH, minus the maximum space needed by
- the worst case distance code, MAXD. This should never happen, but the
- sufficiency of ENOUGH has not been proven exhaustively, hence the check.
- This assumes that when type == LENS, bits == 9.
+ provided *table space. It is checked for LENS and DIST tables against
+ the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
+ the initial root table size constants. See the comments in inftrees.h
+ for more information.
sym increments through all symbols, and the loop terminates when
all codes of length max, i.e. all codes, have been processed. This
@@ -209,24 +208,25 @@ unsigned short FAR *work;
mask = used - 1; /* mask for comparing low */
/* check available table space */
- if (type == LENS && used >= ENOUGH - MAXD)
+ if ((type == LENS && used >= ENOUGH_LENS) ||
+ (type == DISTS && used >= ENOUGH_DISTS))
return 1;
/* process all codes and make table entries */
for (;;) {
/* create table entry */
- this.bits = (unsigned char)(len - drop);
+ here.bits = (unsigned char)(len - drop);
if ((int)(work[sym]) < end) {
- this.op = (unsigned char)0;
- this.val = work[sym];
+ here.op = (unsigned char)0;
+ here.val = work[sym];
}
else if ((int)(work[sym]) > end) {
- this.op = (unsigned char)(extra[work[sym]]);
- this.val = base[work[sym]];
+ here.op = (unsigned char)(extra[work[sym]]);
+ here.val = base[work[sym]];
}
else {
- this.op = (unsigned char)(32 + 64); /* end of block */
- this.val = 0;
+ here.op = (unsigned char)(32 + 64); /* end of block */
+ here.val = 0;
}
/* replicate for those indices with low len bits equal to huff */
@@ -235,7 +235,7 @@ unsigned short FAR *work;
min = fill; /* save offset to next table */
do {
fill -= incr;
- next[(huff >> drop) + fill] = this;
+ next[(huff >> drop) + fill] = here;
} while (fill != 0);
/* backwards increment the len-bit code huff */
@@ -277,7 +277,8 @@ unsigned short FAR *work;
/* check for enough space */
used += 1U << curr;
- if (type == LENS && used >= ENOUGH - MAXD)
+ if ((type == LENS && used >= ENOUGH_LENS) ||
+ (type == DISTS && used >= ENOUGH_DISTS))
return 1;
/* point entry in root table to sub-table */
@@ -295,20 +296,20 @@ unsigned short FAR *work;
through high index bits. When the current sub-table is filled, the loop
drops back to the root table to fill in any remaining entries there.
*/
- this.op = (unsigned char)64; /* invalid code marker */
- this.bits = (unsigned char)(len - drop);
- this.val = (unsigned short)0;
+ here.op = (unsigned char)64; /* invalid code marker */
+ here.bits = (unsigned char)(len - drop);
+ here.val = (unsigned short)0;
while (huff != 0) {
/* when done with sub-table, drop back to root table */
if (drop != 0 && (huff & mask) != low) {
drop = 0;
len = root;
next = *table;
- this.bits = (unsigned char)len;
+ here.bits = (unsigned char)len;
}
/* put invalid code marker in table */
- next[huff >> drop] = this;
+ next[huff >> drop] = here;
/* backwards increment the len-bit code huff */
incr = 1U << (len - 1);
diff --git a/Modules/zlib/inftrees.h b/Modules/zlib/inftrees.h
index b1104c87e7..baa53a0b1a 100644
--- a/Modules/zlib/inftrees.h
+++ b/Modules/zlib/inftrees.h
@@ -1,5 +1,5 @@
/* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2005, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -35,21 +35,28 @@ typedef struct {
01000000 - invalid code
*/
-/* Maximum size of dynamic tree. The maximum found in a long but non-
- exhaustive search was 1444 code structures (852 for length/literals
- and 592 for distances, the latter actually the result of an
- exhaustive search). The true maximum is not known, but the value
- below is more than safe. */
-#define ENOUGH 2048
-#define MAXD 592
+/* Maximum size of the dynamic table. The maximum number of code structures is
+ 1444, which is the sum of 852 for literal/length codes and 592 for distance
+ codes. These values were found by exhaustive searches using the program
+ examples/enough.c found in the zlib distribtution. The arguments to that
+ program are the number of symbols, the initial root table size, and the
+ maximum bit length of a code. "enough 286 9 15" for literal/length codes
+ returns returns 852, and "enough 30 6 15" for distance codes returns 592.
+ The initial root table size (9 or 6) is found in the fifth argument of the
+ inflate_table() calls in inflate.c and infback.c. If the root table size is
+ changed, then these maximum sizes would be need to be recalculated and
+ updated. */
+#define ENOUGH_LENS 852
+#define ENOUGH_DISTS 592
+#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
-/* Type of code to build for inftable() */
+/* Type of code to build for inflate_table() */
typedef enum {
CODES,
LENS,
DISTS
} codetype;
-extern int inflate_table OF((codetype type, unsigned short FAR *lens,
+int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
unsigned codes, code FAR * FAR *table,
unsigned FAR *bits, unsigned short FAR *work));
diff --git a/Modules/zlib/make_vms.com b/Modules/zlib/make_vms.com
index c2a1fb54b2..6576490e65 100644
--- a/Modules/zlib/make_vms.com
+++ b/Modules/zlib/make_vms.com
@@ -1,33 +1,57 @@
$! make libz under VMS written by
$! Martin P.J. Zinser
-$! <zinser@zinser.no-ip.info or zinser@sysdev.deutsche-boerse.com>
$!
-$ on error then goto err_exit
+$! In case of problems with the install you might contact me at
+$! zinser@zinser.no-ip.info(preferred) or
+$! zinser@sysdev.deutsche-boerse.com (work)
+$!
+$! Make procedure history for Zlib
$!
+$!------------------------------------------------------------------------------
+$! Version history
+$! 0.01 20060120 First version to receive a number
+$! 0.02 20061008 Adapt to new Makefile.in
+$! 0.03 20091224 Add support for large file check
+$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite
+$! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
$!
-$! Just some general constants...
+$ on error then goto err_exit
+$ set proc/parse=ext
$!
$ true = 1
$ false = 0
$ tmpnam = "temp_" + f$getjpi("","pid")
-$ SAY = "WRITE SYS$OUTPUT"
+$ tt = tmpnam + ".txt"
+$ tc = tmpnam + ".c"
+$ th = tmpnam + ".h"
+$ define/nolog tconfig 'th'
+$ its_decc = false
+$ its_vaxc = false
+$ its_gnuc = false
+$ s_case = False
$!
$! Setup variables holding "config" information
$!
-$ Make = ""
+$ Make = ""
$ name = "Zlib"
$ version = "?.?.?"
$ v_string = "ZLIB_VERSION"
$ v_file = "zlib.h"
-$ ccopt = ""
-$ lopts = ""
+$ ccopt = ""
+$ lopts = ""
+$ dnsrl = ""
+$ aconf_in_file = "zconf.h.in#zconf.h_in"
+$ conf_check_string = ""
$ linkonly = false
$ optfile = name + ".opt"
-$ its_decc = false
-$ its_vaxc = false
-$ its_gnuc = false
-$ axp = f$getsyi("HW_MODEL").ge.1024
-$ s_case = false
+$ libdefs = ""
+$ axp = f$getsyi("HW_MODEL").ge.1024 .and. f$getsyi("HW_MODEL").lt.4096
+$!
+$ whoami = f$parse(f$enviornment("Procedure"),,,,"NO_CONCEAL")
+$ mydef = F$parse(whoami,,,"DEVICE")
+$ mydir = f$parse(whoami,,,"DIRECTORY") - "]["
+$ myproc = f$parse(whoami,,,"Name") + f$parse(whoami,,,"type")
+$!
$! Check for MMK/MMS
$!
$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS"
@@ -36,11 +60,16 @@ $!
$!
$ gosub find_version
$!
+$ open/write topt tmp.opt
+$ open/write optf 'optfile'
+$!
$ gosub check_opts
$!
$! Look for the compiler used
$!
$ gosub check_compiler
+$ close topt
+$!
$ if its_decc
$ then
$ ccopt = "/prefix=all" + ccopt
@@ -60,6 +89,52 @@ $ then
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
$ endif
$!
+$! Build a fake configure input header
+$!
+$ open/write conf_hin config.hin
+$ write conf_hin "#undef _LARGEFILE64_SOURCE"
+$ close conf_hin
+$!
+$!
+$ i = 0
+$FIND_ACONF:
+$ fname = f$element(i,"#",aconf_in_file)
+$ if fname .eqs. "#" then goto AMISS_ERR
+$ if f$search(fname) .eqs. ""
+$ then
+$ i = i + 1
+$ goto find_aconf
+$ endif
+$ open/read/err=aconf_err aconf_in 'fname'
+$ open/write aconf zconf.h
+$ACONF_LOOP:
+$ read/end_of_file=aconf_exit aconf_in line
+$ work = f$edit(line, "compress,trim")
+$ if f$extract(0,6,work) .nes. "#undef"
+$ then
+$ if f$extract(0,12,work) .nes. "#cmakedefine"
+$ then
+$ write aconf line
+$ endif
+$ else
+$ cdef = f$element(1," ",work)
+$ gosub check_config
+$ endif
+$ goto aconf_loop
+$ACONF_EXIT:
+$ write aconf "#define VMS 1"
+$ write aconf "#include <unistd.h>"
+$ write aconf "#include <unixio.h>"
+$ write aconf "#ifdef _LARGEFILE"
+$ write aconf "#define off64_t __off64_t"
+$ write aconf "#define fopen64 fopen"
+$ write aconf "#define fseeko64 fseeko"
+$ write aconf "#define lseek64 lseek"
+$ write aconf "#define ftello64 ftell"
+$ write aconf "#endif"
+$ close aconf_in
+$ close aconf
+$ if f$search("''th'") .nes. "" then delete 'th';*
$! Build the thing plain or with mms
$!
$ write sys$output "Compiling Zlib sources ..."
@@ -74,8 +149,14 @@ $ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
crc32.c zlib.h zconf.h
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
deflate.c deflate.h zutil.h zlib.h zconf.h
-$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
- gzio.c zutil.h zlib.h zconf.h
+$ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" -
+ gzclose.c zutil.h zlib.h zconf.h
+$ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" -
+ gzlib.c zutil.h zlib.h zconf.h
+$ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" -
+ gzread.c zutil.h zlib.h zconf.h
+$ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" -
+ gzwrite.c zutil.h zlib.h zconf.h
$ CALL MAKE infback.OBJ "CC ''CCOPT' infback" -
infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
@@ -107,7 +188,7 @@ $ call make minigzip.exe -
$ endif
$ else
$ gosub crea_mms
-$ SAY "Make ''name' ''version' with ''Make' "
+$ write sys$output "Make ''name' ''version' with ''Make' "
$ 'make'
$ endif
$!
@@ -133,6 +214,15 @@ $ write sys$output "C compiler required to build ''name'"
$ goto err_exit
$ERR_EXIT:
$ set message/facil/ident/sever/text
+$ close/nolog optf
+$ close/nolog topt
+$ close/nolog conf_hin
+$ close/nolog aconf_in
+$ close/nolog aconf
+$ close/nolog out
+$ close/nolog min
+$ close/nolog mod
+$ close/nolog h_in
$ write sys$output "Exiting..."
$ exit 2
$!
@@ -180,61 +270,72 @@ $!------------------------------------------------------------------------------
$!
$! Check command line options and set symbols accordingly
$!
+$!------------------------------------------------------------------------------
+$! Version history
+$! 0.01 20041206 First version to receive a number
+$! 0.02 20060126 Add new "HELP" target
$ CHECK_OPTS:
$ i = 1
$ OPT_LOOP:
$ if i .lt. 9
$ then
$ cparm = f$edit(p'i',"upcase")
-$ if cparm .eqs. "DEBUG"
-$ then
-$ ccopt = ccopt + "/noopt/deb"
-$ lopts = lopts + "/deb"
-$ endif
-$ if f$locate("CCOPT=",cparm) .lt. f$length(cparm)
-$ then
-$ start = f$locate("=",cparm) + 1
-$ len = f$length(cparm) - start
-$ ccopt = ccopt + f$extract(start,len,cparm)
-$ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) -
- then s_case = true
-$ endif
-$ if cparm .eqs. "LINK" then linkonly = true
-$ if f$locate("LOPTS=",cparm) .lt. f$length(cparm)
-$ then
-$ start = f$locate("=",cparm) + 1
-$ len = f$length(cparm) - start
-$ lopts = lopts + f$extract(start,len,cparm)
-$ endif
-$ if f$locate("CC=",cparm) .lt. f$length(cparm)
+$!
+$! Check if parameter actually contains something
+$!
+$ if f$edit(cparm,"trim") .nes. ""
$ then
-$ start = f$locate("=",cparm) + 1
-$ len = f$length(cparm) - start
-$ cc_com = f$extract(start,len,cparm)
- if (cc_com .nes. "DECC") .and. -
- (cc_com .nes. "VAXC") .and. -
- (cc_com .nes. "GNUC")
+$ if cparm .eqs. "DEBUG"
$ then
-$ write sys$output "Unsupported compiler choice ''cc_com' ignored"
-$ write sys$output "Use DECC, VAXC, or GNUC instead"
-$ else
-$ if cc_com .eqs. "DECC" then its_decc = true
-$ if cc_com .eqs. "VAXC" then its_vaxc = true
-$ if cc_com .eqs. "GNUC" then its_gnuc = true
+$ ccopt = ccopt + "/noopt/deb"
+$ lopts = lopts + "/deb"
$ endif
-$ endif
-$ if f$locate("MAKE=",cparm) .lt. f$length(cparm)
-$ then
-$ start = f$locate("=",cparm) + 1
-$ len = f$length(cparm) - start
-$ mmks = f$extract(start,len,cparm)
-$ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS")
+$ if f$locate("CCOPT=",cparm) .lt. f$length(cparm)
$ then
-$ make = mmks
-$ else
-$ write sys$output "Unsupported make choice ''mmks' ignored"
-$ write sys$output "Use MMK or MMS instead"
+$ start = f$locate("=",cparm) + 1
+$ len = f$length(cparm) - start
+$ ccopt = ccopt + f$extract(start,len,cparm)
+$ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) -
+ then s_case = true
+$ endif
+$ if cparm .eqs. "LINK" then linkonly = true
+$ if f$locate("LOPTS=",cparm) .lt. f$length(cparm)
+$ then
+$ start = f$locate("=",cparm) + 1
+$ len = f$length(cparm) - start
+$ lopts = lopts + f$extract(start,len,cparm)
$ endif
+$ if f$locate("CC=",cparm) .lt. f$length(cparm)
+$ then
+$ start = f$locate("=",cparm) + 1
+$ len = f$length(cparm) - start
+$ cc_com = f$extract(start,len,cparm)
+ if (cc_com .nes. "DECC") .and. -
+ (cc_com .nes. "VAXC") .and. -
+ (cc_com .nes. "GNUC")
+$ then
+$ write sys$output "Unsupported compiler choice ''cc_com' ignored"
+$ write sys$output "Use DECC, VAXC, or GNUC instead"
+$ else
+$ if cc_com .eqs. "DECC" then its_decc = true
+$ if cc_com .eqs. "VAXC" then its_vaxc = true
+$ if cc_com .eqs. "GNUC" then its_gnuc = true
+$ endif
+$ endif
+$ if f$locate("MAKE=",cparm) .lt. f$length(cparm)
+$ then
+$ start = f$locate("=",cparm) + 1
+$ len = f$length(cparm) - start
+$ mmks = f$extract(start,len,cparm)
+$ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS")
+$ then
+$ make = mmks
+$ else
+$ write sys$output "Unsupported make choice ''mmks' ignored"
+$ write sys$output "Use MMK or MMS instead"
+$ endif
+$ endif
+$ if cparm .eqs. "HELP" then gosub bhelp
$ endif
$ i = i + 1
$ goto opt_loop
@@ -244,6 +345,11 @@ $!------------------------------------------------------------------------------
$!
$! Look for the compiler used
$!
+$! Version history
+$! 0.01 20040223 First version to receive a number
+$! 0.02 20040229 Save/set value of decc$no_rooted_search_lists
+$! 0.03 20060202 Extend handling of GNU C
+$! 0.04 20090402 Compaq -> hp
$CHECK_COMPILER:
$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
$ then
@@ -257,9 +363,26 @@ $!
$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
$ then goto CC_ERR
$ else
-$ if its_decc then write sys$output "CC compiler check ... Compaq C"
-$ if its_vaxc then write sys$output "CC compiler check ... VAX C"
-$ if its_gnuc then write sys$output "CC compiler check ... GNU C"
+$ if its_decc
+$ then
+$ write sys$output "CC compiler check ... hp C"
+$ if f$trnlnm("decc$no_rooted_search_lists") .nes. ""
+$ then
+$ dnrsl = f$trnlnm("decc$no_rooted_search_lists")
+$ endif
+$ define/nolog decc$no_rooted_search_lists 1
+$ else
+$ if its_vaxc then write sys$output "CC compiler check ... VAX C"
+$ if its_gnuc
+$ then
+$ write sys$output "CC compiler check ... GNU C"
+$ if f$trnlnm(topt) then write topt "gnu_cc:[000000]gcclib.olb/lib"
+$ if f$trnlnm(optf) then write optf "gnu_cc:[000000]gcclib.olb/lib"
+$ cc = "gcc"
+$ endif
+$ if f$trnlnm(topt) then write topt "sys$share:vaxcrtl.exe/share"
+$ if f$trnlnm(optf) then write optf "sys$share:vaxcrtl.exe/share"
+$ endif
$ endif
$ return
$!------------------------------------------------------------------------------
@@ -276,7 +399,8 @@ $ deck
# written by Martin P.J. Zinser
# <zinser@zinser.no-ip.info or zinser@sysdev.deutsche-boerse.com>
-OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj, infback.obj\
+OBJS = adler32.obj, compress.obj, crc32.obj, gzclose.obj, gzlib.obj\
+ gzread.obj, gzwrite.obj, uncompr.obj, infback.obj\
deflate.obj, trees.obj, zutil.obj, inflate.obj, \
inftrees.obj, inffast.obj
@@ -308,7 +432,10 @@ compress.obj : compress.c zlib.h zconf.h
crc32.obj : crc32.c zutil.h zlib.h zconf.h
deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h
example.obj : example.c zlib.h zconf.h
-gzio.obj : gzio.c zutil.h zlib.h zconf.h
+gzclose.obj : gzclose.c zutil.h zlib.h zconf.h
+gzlib.obj : gzlib.c zutil.h zlib.h zconf.h
+gzread.obj : gzread.c zutil.h zlib.h zconf.h
+gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h
inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h
inflate.obj : inflate.c zutil.h zlib.h zconf.h
inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h
@@ -328,7 +455,7 @@ $!
$CREA_OLIST:
$ open/read min makefile.in
$ open/write mod modules.opt
-$ src_check = "OBJS ="
+$ src_check = "OBJC ="
$MRLOOP:
$ read/end=mrdone min rec
$ if (f$extract(0,6,rec) .nes. src_check) then goto mrloop
@@ -382,13 +509,182 @@ $ close h_in
$ return
$!------------------------------------------------------------------------------
$!
+$CHECK_CONFIG:
+$!
+$ in_ldef = f$locate(cdef,libdefs)
+$ if (in_ldef .lt. f$length(libdefs))
+$ then
+$ write aconf "#define ''cdef' 1"
+$ libdefs = f$extract(0,in_ldef,libdefs) + -
+ f$extract(in_ldef + f$length(cdef) + 1, -
+ f$length(libdefs) - in_ldef - f$length(cdef) - 1, -
+ libdefs)
+$ else
+$ if (f$type('cdef') .eqs. "INTEGER")
+$ then
+$ write aconf "#define ''cdef' ", 'cdef'
+$ else
+$ if (f$type('cdef') .eqs. "STRING")
+$ then
+$ write aconf "#define ''cdef' ", """", '''cdef'', """"
+$ else
+$ gosub check_cc_def
+$ endif
+$ endif
+$ endif
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Check if this is a define relating to the properties of the C/C++
+$! compiler
+$!
+$ CHECK_CC_DEF:
+$ if (cdef .eqs. "_LARGEFILE64_SOURCE")
+$ then
+$ copy sys$input: 'tc'
+$ deck
+#include "tconfig"
+#define _LARGEFILE
+#include <stdio.h>
+
+int main(){
+FILE *fp;
+ fp = fopen("temp.txt","r");
+ fseeko(fp,1,SEEK_SET);
+ fclose(fp);
+}
+
+$ eod
+$ test_inv = false
+$ comm_h = false
+$ gosub cc_prop_check
+$ return
+$ endif
+$ write aconf "/* ", line, " */"
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Check for properties of C/C++ compiler
+$!
+$! Version history
+$! 0.01 20031020 First version to receive a number
+$! 0.02 20031022 Added logic for defines with value
+$! 0.03 20040309 Make sure local config file gets not deleted
+$! 0.04 20041230 Also write include for configure run
+$! 0.05 20050103 Add processing of "comment defines"
+$CC_PROP_CHECK:
+$ cc_prop = true
+$ is_need = false
+$ is_need = (f$extract(0,4,cdef) .eqs. "NEED") .or. (test_inv .eq. true)
+$ if f$search(th) .eqs. "" then create 'th'
+$ set message/nofac/noident/nosever/notext
+$ on error then continue
+$ cc 'tmpnam'
+$ if .not. ($status) then cc_prop = false
+$ on error then continue
+$! The headers might lie about the capabilities of the RTL
+$ link 'tmpnam',tmp.opt/opt
+$ if .not. ($status) then cc_prop = false
+$ set message/fac/ident/sever/text
+$ on error then goto err_exit
+$ delete/nolog 'tmpnam'.*;*/exclude='th'
+$ if (cc_prop .and. .not. is_need) .or. -
+ (.not. cc_prop .and. is_need)
+$ then
+$ write sys$output "Checking for ''cdef'... yes"
+$ if f$type('cdef_val'_yes) .nes. ""
+$ then
+$ if f$type('cdef_val'_yes) .eqs. "INTEGER" -
+ then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_yes)
+$ if f$type('cdef_val'_yes) .eqs. "STRING" -
+ then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_yes)
+$ else
+$ call write_config f$fao("#define !AS 1",cdef)
+$ endif
+$ if (cdef .eqs. "HAVE_FSEEKO") .or. (cdef .eqs. "_LARGE_FILES") .or. -
+ (cdef .eqs. "_LARGEFILE64_SOURCE") then -
+ call write_config f$string("#define _LARGEFILE 1")
+$ else
+$ write sys$output "Checking for ''cdef'... no"
+$ if (comm_h)
+$ then
+ call write_config f$fao("/* !AS */",line)
+$ else
+$ if f$type('cdef_val'_no) .nes. ""
+$ then
+$ if f$type('cdef_val'_no) .eqs. "INTEGER" -
+ then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_no)
+$ if f$type('cdef_val'_no) .eqs. "STRING" -
+ then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_no)
+$ else
+$ call write_config f$fao("#undef !AS",cdef)
+$ endif
+$ endif
+$ endif
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Check for properties of C/C++ compiler with multiple result values
+$!
+$! Version history
+$! 0.01 20040127 First version
+$! 0.02 20050103 Reconcile changes from cc_prop up to version 0.05
+$CC_MPROP_CHECK:
+$ cc_prop = true
+$ i = 1
+$ idel = 1
+$ MT_LOOP:
+$ if f$type(result_'i') .eqs. "STRING"
+$ then
+$ set message/nofac/noident/nosever/notext
+$ on error then continue
+$ cc 'tmpnam'_'i'
+$ if .not. ($status) then cc_prop = false
+$ on error then continue
+$! The headers might lie about the capabilities of the RTL
+$ link 'tmpnam'_'i',tmp.opt/opt
+$ if .not. ($status) then cc_prop = false
+$ set message/fac/ident/sever/text
+$ on error then goto err_exit
+$ delete/nolog 'tmpnam'_'i'.*;*
+$ if (cc_prop)
+$ then
+$ write sys$output "Checking for ''cdef'... ", mdef_'i'
+$ if f$type(mdef_'i') .eqs. "INTEGER" -
+ then call write_config f$fao("#define !AS !UL",cdef,mdef_'i')
+$ if f$type('cdef_val'_yes) .eqs. "STRING" -
+ then call write_config f$fao("#define !AS !AS",cdef,mdef_'i')
+$ goto msym_clean
+$ else
+$ i = i + 1
+$ goto mt_loop
+$ endif
+$ endif
+$ write sys$output "Checking for ''cdef'... no"
+$ call write_config f$fao("#undef !AS",cdef)
+$ MSYM_CLEAN:
+$ if (idel .le. msym_max)
+$ then
+$ delete/sym mdef_'idel'
+$ idel = idel + 1
+$ goto msym_clean
+$ endif
+$ return
+$!------------------------------------------------------------------------------
+$!
$! Analyze Object files for OpenVMS AXP to extract Procedure and Data
$! information to build a symbol vector for a shareable image
$! All the "brains" of this logic was suggested by Hartmut Becker
$! (Hartmut.Becker@compaq.com). All the bugs were introduced by me
-$! (zinser@decus.de), so if you do have problem reports please do not
+$! (zinser@zinser.no-ip.info), so if you do have problem reports please do not
$! bother Hartmut/HP, but get in touch with me
$!
+$! Version history
+$! 0.01 20040406 Skip over shareable images in option file
+$! 0.02 20041109 Fix option file for shareable images with case_sensitive=YES
+$! 0.03 20050107 Skip over Identification labels in option file
+$! 0.04 20060117 Add uppercase alias to code compiled with /name=as_is
+$!
$ ANAL_OBJ_AXP: Subroutine
$ V = 'F$Verify(0)
$ SAY := "WRITE_ SYS$OUTPUT"
@@ -409,6 +705,17 @@ $ create a.tmp
$ open/append atmp a.tmp
$ loop:
$ read/end=end_loop in line
+$ if f$locate("/SHARE",f$edit(line,"upcase")) .lt. f$length(line)
+$ then
+$ write sys$output "ANAL_SKP_SHR-i-skipshare, ''line'"
+$ goto loop
+$ endif
+$ if f$locate("IDENTIFICATION=",f$edit(line,"upcase")) .lt. f$length(line)
+$ then
+$ write sys$output "ANAL_OBJ_AXP-i-ident: Identification ", -
+ f$element(1,"=",line)
+$ goto loop
+$ endif
$ f= f$search(line)
$ if f .eqs. ""
$ then
@@ -450,8 +757,31 @@ $ edito/edt/command=sys$input f.tmp
sub/symbol: "/symbol_vector=(/whole
sub/"/=DATA)/whole
exit
-$ sort/nodupl d.tmp,f.tmp 'p2'
-$ delete a.tmp;*,b.tmp;*,c.tmp;*,d.tmp;*,e.tmp;*,f.tmp;*
+$ sort/nodupl d.tmp,f.tmp g.tmp
+$ open/read raw_vector g.tmp
+$ open/write case_vector 'p2'
+$ RAWLOOP:
+$ read/end=end_rawloop raw_vector raw_element
+$ write case_vector raw_element
+$ if f$locate("=PROCEDURE)",raw_element) .lt. f$length(raw_element)
+$ then
+$ name = f$element(1,"=",raw_element) - "("
+$ if f$edit(name,"UPCASE") .nes. name then -
+ write case_vector f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)", -
+ f$edit(name,"UPCASE"), name)
+$ endif
+$ if f$locate("=DATA)",raw_element) .lt. f$length(raw_element)
+$ then
+$ name = f$element(1,"=",raw_element) - "("
+$ if f$edit(name,"UPCASE") .nes. name then -
+ write case_vector f$fao(" symbol_vector=(!AS/!AS=DATA)", -
+ f$edit(name,"UPCASE"), name)
+$ endif
+$ goto rawloop
+$ END_RAWLOOP:
+$ close raw_vector
+$ close case_vector
+$ delete a.tmp;*,b.tmp;*,c.tmp;*,d.tmp;*,e.tmp;*,f.tmp;*,g.tmp;*
$ if f$search("x.tmp") .nes. "" -
then $ delete x.tmp;*
$!
@@ -459,3 +789,16 @@ $ EXIT_AA:
$ if V then set verify
$ endsubroutine
$!------------------------------------------------------------------------------
+$!
+$! Write configuration to both permanent and temporary config file
+$!
+$! Version history
+$! 0.01 20031029 First version to receive a number
+$!
+$WRITE_CONFIG: SUBROUTINE
+$ write aconf 'p1'
+$ open/append confh 'th'
+$ write confh 'p1'
+$ close confh
+$ENDSUBROUTINE
+$!------------------------------------------------------------------------------
diff --git a/Modules/zlib/minigzip.c b/Modules/zlib/minigzip.c
index 7f1de49d87..9825ccc3a7 100644
--- a/Modules/zlib/minigzip.c
+++ b/Modules/zlib/minigzip.c
@@ -1,5 +1,5 @@
/* minigzip.c -- simulate gzip using the zlib compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2006, 2010 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -15,8 +15,8 @@
/* @(#) $Id$ */
-#include <stdio.h>
#include "zlib.h"
+#include <stdio.h>
#ifdef STDC
# include <string.h>
@@ -32,6 +32,9 @@
#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
# include <fcntl.h>
# include <io.h>
+# ifdef UNDER_CE
+# include <stdlib.h>
+# endif
# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
#else
# define SET_BINARY_MODE(file)
@@ -41,13 +44,84 @@
# define unlink delete
# define GZ_SUFFIX "-gz"
#endif
+#ifdef RISCOS
+# define unlink remove
+# define GZ_SUFFIX "-gz"
+# define fileno(file) file->__file
+#endif
#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fileno */
#endif
+#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE)
#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
extern int unlink OF((const char *));
#endif
+#endif
+
+#if defined(UNDER_CE)
+# include <windows.h>
+# define perror(s) pwinerror(s)
+
+/* Map the Windows error number in ERROR to a locale-dependent error
+ message string and return a pointer to it. Typically, the values
+ for ERROR come from GetLastError.
+
+ The string pointed to shall not be modified by the application,
+ but may be overwritten by a subsequent call to strwinerror
+
+ The strwinerror function does not change the current setting
+ of GetLastError. */
+
+static char *strwinerror (error)
+ DWORD error;
+{
+ static char buf[1024];
+
+ wchar_t *msgbuf;
+ DWORD lasterr = GetLastError();
+ DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL,
+ error,
+ 0, /* Default language */
+ (LPVOID)&msgbuf,
+ 0,
+ NULL);
+ if (chars != 0) {
+ /* If there is an \r\n appended, zap it. */
+ if (chars >= 2
+ && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
+ chars -= 2;
+ msgbuf[chars] = 0;
+ }
+
+ if (chars > sizeof (buf) - 1) {
+ chars = sizeof (buf) - 1;
+ msgbuf[chars] = 0;
+ }
+
+ wcstombs(buf, msgbuf, chars + 1);
+ LocalFree(msgbuf);
+ }
+ else {
+ sprintf(buf, "unknown win32 error (%ld)", error);
+ }
+
+ SetLastError(lasterr);
+ return buf;
+}
+
+static void pwinerror (s)
+ const char *s;
+{
+ if (s && *s)
+ fprintf(stderr, "%s: %s\n", s, strwinerror(GetLastError ()));
+ else
+ fprintf(stderr, "%s\n", strwinerror(GetLastError ()));
+}
+
+#endif /* UNDER_CE */
#ifndef GZ_SUFFIX
# define GZ_SUFFIX ".gz"
@@ -193,6 +267,11 @@ void file_compress(file, mode)
FILE *in;
gzFile out;
+ if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) {
+ fprintf(stderr, "%s: filename too long\n", prog);
+ exit(1);
+ }
+
strcpy(outfile, file);
strcat(outfile, GZ_SUFFIX);
@@ -222,7 +301,12 @@ void file_uncompress(file)
char *infile, *outfile;
FILE *out;
gzFile in;
- uInt len = (uInt)strlen(file);
+ size_t len = strlen(file);
+
+ if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {
+ fprintf(stderr, "%s: filename too long\n", prog);
+ exit(1);
+ }
strcpy(buf, file);
@@ -253,7 +337,8 @@ void file_uncompress(file)
/* ===========================================================================
- * Usage: minigzip [-d] [-f] [-h] [-r] [-1 to -9] [files...]
+ * Usage: minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...]
+ * -c : write to standard output
* -d : decompress
* -f : compress with Z_FILTERED
* -h : compress with Z_HUFFMAN_ONLY
@@ -265,17 +350,30 @@ int main(argc, argv)
int argc;
char *argv[];
{
+ int copyout = 0;
int uncompr = 0;
gzFile file;
- char outmode[20];
+ char *bname, outmode[20];
strcpy(outmode, "wb6 ");
prog = argv[0];
+ bname = strrchr(argv[0], '/');
+ if (bname)
+ bname++;
+ else
+ bname = argv[0];
argc--, argv++;
+ if (!strcmp(bname, "gunzip"))
+ uncompr = 1;
+ else if (!strcmp(bname, "zcat"))
+ copyout = uncompr = 1;
+
while (argc > 0) {
- if (strcmp(*argv, "-d") == 0)
+ if (strcmp(*argv, "-c") == 0)
+ copyout = 1;
+ else if (strcmp(*argv, "-d") == 0)
uncompr = 1;
else if (strcmp(*argv, "-f") == 0)
outmode[3] = 'f';
@@ -305,11 +403,36 @@ int main(argc, argv)
gz_compress(stdin, file);
}
} else {
+ if (copyout) {
+ SET_BINARY_MODE(stdout);
+ }
do {
if (uncompr) {
- file_uncompress(*argv);
+ if (copyout) {
+ file = gzopen(*argv, "rb");
+ if (file == NULL)
+ fprintf(stderr, "%s: can't gzopen %s\n", prog, *argv);
+ else
+ gz_uncompress(file, stdout);
+ } else {
+ file_uncompress(*argv);
+ }
} else {
- file_compress(*argv, outmode);
+ if (copyout) {
+ FILE * in = fopen(*argv, "rb");
+
+ if (in == NULL) {
+ perror(*argv);
+ } else {
+ file = gzdopen(fileno(stdout), outmode);
+ if (file == NULL) error("can't gzdopen stdout");
+
+ gz_compress(in, file);
+ }
+
+ } else {
+ file_compress(*argv, outmode);
+ }
}
} while (argv++, --argc);
}
diff --git a/Modules/zlib/trees.c b/Modules/zlib/trees.c
index 395e4e1681..56e9bb1c11 100644
--- a/Modules/zlib/trees.c
+++ b/Modules/zlib/trees.c
@@ -1,5 +1,6 @@
/* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2005 Jean-loup Gailly
+ * Copyright (C) 1995-2010 Jean-loup Gailly
+ * detect_data_type() function provided freely by Cosmin Truta, 2006
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -152,7 +153,7 @@ local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
int blcodes));
local void compress_block OF((deflate_state *s, ct_data *ltree,
ct_data *dtree));
-local void set_data_type OF((deflate_state *s));
+local int detect_data_type OF((deflate_state *s));
local unsigned bi_reverse OF((unsigned value, int length));
local void bi_windup OF((deflate_state *s));
local void bi_flush OF((deflate_state *s));
@@ -203,12 +204,12 @@ local void send_bits(s, value, length)
* unused bits in value.
*/
if (s->bi_valid > (int)Buf_size - length) {
- s->bi_buf |= (value << s->bi_valid);
+ s->bi_buf |= (ush)value << s->bi_valid;
put_short(s, s->bi_buf);
s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
s->bi_valid += length - Buf_size;
} else {
- s->bi_buf |= value << s->bi_valid;
+ s->bi_buf |= (ush)value << s->bi_valid;
s->bi_valid += length;
}
}
@@ -218,12 +219,12 @@ local void send_bits(s, value, length)
{ int len = length;\
if (s->bi_valid > (int)Buf_size - len) {\
int val = value;\
- s->bi_buf |= (val << s->bi_valid);\
+ s->bi_buf |= (ush)val << s->bi_valid;\
put_short(s, s->bi_buf);\
s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
s->bi_valid += len - Buf_size;\
} else {\
- s->bi_buf |= (value) << s->bi_valid;\
+ s->bi_buf |= (ush)(value) << s->bi_valid;\
s->bi_valid += len;\
}\
}
@@ -250,11 +251,13 @@ local void tr_static_init()
if (static_init_done) return;
/* For some embedded targets, global variables are not initialized: */
+#ifdef NO_INIT_GLOBAL_POINTERS
static_l_desc.static_tree = static_ltree;
static_l_desc.extra_bits = extra_lbits;
static_d_desc.static_tree = static_dtree;
static_d_desc.extra_bits = extra_dbits;
static_bl_desc.extra_bits = extra_blbits;
+#endif
/* Initialize the mapping length (0..255) -> length code (0..28) */
length = 0;
@@ -348,13 +351,14 @@ void gen_trees_header()
static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
}
- fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
+ fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n");
for (i = 0; i < DIST_CODE_LEN; i++) {
fprintf(header, "%2u%s", _dist_code[i],
SEPARATOR(i, DIST_CODE_LEN-1, 20));
}
- fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+ fprintf(header,
+ "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
fprintf(header, "%2u%s", _length_code[i],
SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
@@ -379,7 +383,7 @@ void gen_trees_header()
/* ===========================================================================
* Initialize the tree data structures for a new zlib stream.
*/
-void _tr_init(s)
+void ZLIB_INTERNAL _tr_init(s)
deflate_state *s;
{
tr_static_init();
@@ -864,13 +868,13 @@ local void send_all_trees(s, lcodes, dcodes, blcodes)
/* ===========================================================================
* Send a stored block
*/
-void _tr_stored_block(s, buf, stored_len, eof)
+void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
deflate_state *s;
charf *buf; /* input block */
ulg stored_len; /* length of input block */
- int eof; /* true if this is the last block for a file */
+ int last; /* one if this is the last block for a file */
{
- send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
+ send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
#ifdef DEBUG
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
s->compressed_len += (stored_len + 4) << 3;
@@ -889,7 +893,7 @@ void _tr_stored_block(s, buf, stored_len, eof)
* To simplify the code, we assume the worst case of last real code encoded
* on one bit only.
*/
-void _tr_align(s)
+void ZLIB_INTERNAL _tr_align(s)
deflate_state *s;
{
send_bits(s, STATIC_TREES<<1, 3);
@@ -918,11 +922,11 @@ void _tr_align(s)
* Determine the best encoding for the current block: dynamic trees, static
* trees or store, and output the encoded block to the zip file.
*/
-void _tr_flush_block(s, buf, stored_len, eof)
+void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
deflate_state *s;
charf *buf; /* input block, or NULL if too old */
ulg stored_len; /* length of input block */
- int eof; /* true if this is the last block for a file */
+ int last; /* one if this is the last block for a file */
{
ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
int max_blindex = 0; /* index of last bit length code of non zero freq */
@@ -931,8 +935,8 @@ void _tr_flush_block(s, buf, stored_len, eof)
if (s->level > 0) {
/* Check if the file is binary or text */
- if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN)
- set_data_type(s);
+ if (s->strm->data_type == Z_UNKNOWN)
+ s->strm->data_type = detect_data_type(s);
/* Construct the literal and distance trees */
build_tree(s, (tree_desc *)(&(s->l_desc)));
@@ -978,20 +982,20 @@ void _tr_flush_block(s, buf, stored_len, eof)
* successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
* transform a block into a stored block.
*/
- _tr_stored_block(s, buf, stored_len, eof);
+ _tr_stored_block(s, buf, stored_len, last);
#ifdef FORCE_STATIC
} else if (static_lenb >= 0) { /* force static trees */
#else
} else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
#endif
- send_bits(s, (STATIC_TREES<<1)+eof, 3);
+ send_bits(s, (STATIC_TREES<<1)+last, 3);
compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
#ifdef DEBUG
s->compressed_len += 3 + s->static_len;
#endif
} else {
- send_bits(s, (DYN_TREES<<1)+eof, 3);
+ send_bits(s, (DYN_TREES<<1)+last, 3);
send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
max_blindex+1);
compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
@@ -1005,21 +1009,21 @@ void _tr_flush_block(s, buf, stored_len, eof)
*/
init_block(s);
- if (eof) {
+ if (last) {
bi_windup(s);
#ifdef DEBUG
s->compressed_len += 7; /* align on byte boundary */
#endif
}
Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
- s->compressed_len-7*eof));
+ s->compressed_len-7*last));
}
/* ===========================================================================
* Save the match info and tally the frequency counts. Return true if
* the current block must be flushed.
*/
-int _tr_tally (s, dist, lc)
+int ZLIB_INTERNAL _tr_tally (s, dist, lc)
deflate_state *s;
unsigned dist; /* distance of matched string */
unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
@@ -1118,24 +1122,45 @@ local void compress_block(s, ltree, dtree)
}
/* ===========================================================================
- * Set the data type to BINARY or TEXT, using a crude approximation:
- * set it to Z_TEXT if all symbols are either printable characters (33 to 255)
- * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise.
+ * Check if the data type is TEXT or BINARY, using the following algorithm:
+ * - TEXT if the two conditions below are satisfied:
+ * a) There are no non-portable control characters belonging to the
+ * "black list" (0..6, 14..25, 28..31).
+ * b) There is at least one printable character belonging to the
+ * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
+ * - BINARY otherwise.
+ * - The following partially-portable control characters form a
+ * "gray list" that is ignored in this detection algorithm:
+ * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
* IN assertion: the fields Freq of dyn_ltree are set.
*/
-local void set_data_type(s)
+local int detect_data_type(s)
deflate_state *s;
{
+ /* black_mask is the bit mask of black-listed bytes
+ * set bits 0..6, 14..25, and 28..31
+ * 0xf3ffc07f = binary 11110011111111111100000001111111
+ */
+ unsigned long black_mask = 0xf3ffc07fUL;
int n;
- for (n = 0; n < 9; n++)
+ /* Check for non-textual ("black-listed") bytes. */
+ for (n = 0; n <= 31; n++, black_mask >>= 1)
+ if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))
+ return Z_BINARY;
+
+ /* Check for textual ("white-listed") bytes. */
+ if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
+ || s->dyn_ltree[13].Freq != 0)
+ return Z_TEXT;
+ for (n = 32; n < LITERALS; n++)
if (s->dyn_ltree[n].Freq != 0)
- break;
- if (n == 9)
- for (n = 14; n < 32; n++)
- if (s->dyn_ltree[n].Freq != 0)
- break;
- s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY;
+ return Z_TEXT;
+
+ /* There are no "black-listed" or "white-listed" bytes:
+ * this stream either is empty or has tolerated ("gray-listed") bytes only.
+ */
+ return Z_BINARY;
}
/* ===========================================================================
diff --git a/Modules/zlib/trees.h b/Modules/zlib/trees.h
index 72facf900f..d35639d82a 100644
--- a/Modules/zlib/trees.h
+++ b/Modules/zlib/trees.h
@@ -70,7 +70,7 @@ local const ct_data static_dtree[D_CODES] = {
{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
};
-const uch _dist_code[DIST_CODE_LEN] = {
+const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
@@ -99,7 +99,7 @@ const uch _dist_code[DIST_CODE_LEN] = {
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
};
-const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
+const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
diff --git a/Modules/zlib/uncompr.c b/Modules/zlib/uncompr.c
index b59e3d0def..ad98be3a5d 100644
--- a/Modules/zlib/uncompr.c
+++ b/Modules/zlib/uncompr.c
@@ -1,5 +1,5 @@
/* uncompr.c -- decompress a memory buffer
- * Copyright (C) 1995-2003 Jean-loup Gailly.
+ * Copyright (C) 1995-2003, 2010 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -16,8 +16,6 @@
been saved previously by the compressor and transmitted to the decompressor
by some mechanism outside the scope of this compression library.)
Upon exit, destLen is the actual size of the compressed buffer.
- This function can be used to decompress a whole file at once if the
- input file is mmap'ed.
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
diff --git a/Modules/zlib/zconf.h b/Modules/zlib/zconf.h
index 03a9431c8b..02ce56c431 100644
--- a/Modules/zlib/zconf.h
+++ b/Modules/zlib/zconf.h
@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2010 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -11,52 +11,124 @@
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
*/
-#ifdef Z_PREFIX
-# define deflateInit_ z_deflateInit_
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+
+/* all linked symbols */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define adler32_combine64 z_adler32_combine64
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define crc32_combine64 z_crc32_combine64
# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
# define deflateEnd z_deflateEnd
-# define inflateInit_ z_inflateInit_
-# define inflate z_inflate
-# define inflateEnd z_inflateEnd
# define deflateInit2_ z_deflateInit2_
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateCopy z_deflateCopy
-# define deflateReset z_deflateReset
+# define deflateInit_ z_deflateInit_
# define deflateParams z_deflateParams
-# define deflateBound z_deflateBound
# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# define gzprintf z_gzprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetHeader z_inflateGetHeader
# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflateMark z_inflateMark
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateReset2 z_inflateReset2
# define inflateSetDictionary z_inflateSetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
-# define inflateCopy z_inflateCopy
-# define inflateReset z_inflateReset
-# define inflateBack z_inflateBack
-# define inflateBackEnd z_inflateBackEnd
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
+# define inflateUndermine z_inflateUndermine
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
# define uncompress z_uncompress
-# define adler32 z_adler32
-# define crc32 z_crc32
-# define get_crc_table z_get_crc_table
# define zError z_zError
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
# define alloc_func z_alloc_func
+# define charf z_charf
# define free_func z_free_func
+# define gzFile z_gzFile
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
# define in_func z_in_func
+# define intf z_intf
# define out_func z_out_func
-# define Byte z_Byte
# define uInt z_uInt
-# define uLong z_uLong
-# define Bytef z_Bytef
-# define charf z_charf
-# define intf z_intf
# define uIntf z_uIntf
+# define uLong z_uLong
# define uLongf z_uLongf
-# define voidpf z_voidpf
# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
@@ -284,49 +356,73 @@ typedef uLong FAR uLongf;
typedef Byte *voidp;
#endif
-#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
-# include <sys/types.h> /* for off_t */
-# include <unistd.h> /* for SEEK_* and off_t */
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef STDC
+# include <sys/types.h> /* for off_t */
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_* and off_t */
# ifdef VMS
-# include <unixio.h> /* for off_t */
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
# endif
-# define z_off_t off_t
#endif
+
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
+
#ifndef z_off_t
# define z_off_t long
#endif
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+# define z_off64_t off64_t
+#else
+# define z_off64_t z_off_t
+#endif
+
#if defined(__OS400__)
# define NO_vsnprintf
#endif
#if defined(__MVS__)
# define NO_vsnprintf
-# ifdef FAR
-# undef FAR
-# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
-# pragma map(deflateInit_,"DEIN")
-# pragma map(deflateInit2_,"DEIN2")
-# pragma map(deflateEnd,"DEEND")
-# pragma map(deflateBound,"DEBND")
-# pragma map(inflateInit_,"ININ")
-# pragma map(inflateInit2_,"ININ2")
-# pragma map(inflateEnd,"INEND")
-# pragma map(inflateSync,"INSY")
-# pragma map(inflateSetDictionary,"INSEDI")
-# pragma map(compressBound,"CMBND")
-# pragma map(inflate_table,"INTABL")
-# pragma map(inflate_fast,"INFA")
-# pragma map(inflate_copyright,"INCOPY")
+ #pragma map(deflateInit_,"DEIN")
+ #pragma map(deflateInit2_,"DEIN2")
+ #pragma map(deflateEnd,"DEEND")
+ #pragma map(deflateBound,"DEBND")
+ #pragma map(inflateInit_,"ININ")
+ #pragma map(inflateInit2_,"ININ2")
+ #pragma map(inflateEnd,"INEND")
+ #pragma map(inflateSync,"INSY")
+ #pragma map(inflateSetDictionary,"INSEDI")
+ #pragma map(compressBound,"CMBND")
+ #pragma map(inflate_table,"INTABL")
+ #pragma map(inflate_fast,"INFA")
+ #pragma map(inflate_copyright,"INCOPY")
#endif
#endif /* ZCONF_H */
diff --git a/Modules/zlib/zconf.h.cmakein b/Modules/zlib/zconf.h.cmakein
new file mode 100644
index 0000000000..a2f71b1f32
--- /dev/null
+++ b/Modules/zlib/zconf.h.cmakein
@@ -0,0 +1,430 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+#cmakedefine Z_PREFIX
+#cmakedefine Z_HAVE_UNISTD_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+
+/* all linked symbols */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define adler32_combine64 z_adler32_combine64
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define crc32_combine64 z_crc32_combine64
+# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
+# define deflateEnd z_deflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateInit_ z_deflateInit_
+# define deflateParams z_deflateParams
+# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# define gzprintf z_gzprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetHeader z_inflateGetHeader
+# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflateMark z_inflateMark
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateReset2 z_inflateReset2
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateUndermine z_inflateUndermine
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
+# define uncompress z_uncompress
+# define zError z_zError
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
+# define alloc_func z_alloc_func
+# define charf z_charf
+# define free_func z_free_func
+# define gzFile z_gzFile
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
+# define in_func z_in_func
+# define intf z_intf
+# define out_func z_out_func
+# define uInt z_uInt
+# define uIntf z_uIntf
+# define uLong z_uLong
+# define uLongf z_uLongf
+# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+# define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+# define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+# ifndef SYS16BIT
+# define SYS16BIT
+# endif
+# endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+# ifndef STDC
+# define STDC
+# endif
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+# define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
+# define STDC
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const /* note: need a more gentle solution here */
+# endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+# if defined(M_I86SM) || defined(M_I86MM)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+# if (defined(__SMALL__) || defined(__MEDIUM__))
+ /* Turbo C small or medium model */
+# define SMALL_MEDIUM
+# ifdef __BORLANDC__
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
+# ifdef ZLIB_DLL
+# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+# endif
+# endif /* ZLIB_DLL */
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
+# ifdef ZLIB_WINAPI
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+ /* No need for _export, use ZLIB.DEF instead. */
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR CDECL
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# ifdef ZLIB_DLL
+# ifdef ZLIB_INTERNAL
+# define ZEXPORT __declspec(dllexport)
+# define ZEXPORTVA __declspec(dllexport)
+# else
+# define ZEXPORT __declspec(dllimport)
+# define ZEXPORTVA __declspec(dllimport)
+# endif
+# endif
+#endif
+
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void const *voidpc;
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte const *voidpc;
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef STDC
+# include <sys/types.h> /* for off_t */
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_* and off_t */
+# ifdef VMS
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
+# endif
+#endif
+
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+# define z_off64_t off64_t
+#else
+# define z_off64_t z_off_t
+#endif
+
+#if defined(__OS400__)
+# define NO_vsnprintf
+#endif
+
+#if defined(__MVS__)
+# define NO_vsnprintf
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+ #pragma map(deflateInit_,"DEIN")
+ #pragma map(deflateInit2_,"DEIN2")
+ #pragma map(deflateEnd,"DEEND")
+ #pragma map(deflateBound,"DEBND")
+ #pragma map(inflateInit_,"ININ")
+ #pragma map(inflateInit2_,"ININ2")
+ #pragma map(inflateEnd,"INEND")
+ #pragma map(inflateSync,"INSY")
+ #pragma map(inflateSetDictionary,"INSEDI")
+ #pragma map(compressBound,"CMBND")
+ #pragma map(inflate_table,"INTABL")
+ #pragma map(inflate_fast,"INFA")
+ #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/Modules/zlib/zconf.h.in b/Modules/zlib/zconf.h.in
new file mode 100644
index 0000000000..02ce56c431
--- /dev/null
+++ b/Modules/zlib/zconf.h.in
@@ -0,0 +1,428 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+
+/* all linked symbols */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define adler32_combine64 z_adler32_combine64
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define crc32_combine64 z_crc32_combine64
+# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
+# define deflateEnd z_deflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateInit_ z_deflateInit_
+# define deflateParams z_deflateParams
+# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# define gzprintf z_gzprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetHeader z_inflateGetHeader
+# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflateMark z_inflateMark
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateReset2 z_inflateReset2
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateUndermine z_inflateUndermine
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
+# define uncompress z_uncompress
+# define zError z_zError
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
+# define alloc_func z_alloc_func
+# define charf z_charf
+# define free_func z_free_func
+# define gzFile z_gzFile
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
+# define in_func z_in_func
+# define intf z_intf
+# define out_func z_out_func
+# define uInt z_uInt
+# define uIntf z_uIntf
+# define uLong z_uLong
+# define uLongf z_uLongf
+# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+# define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+# define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+# ifndef SYS16BIT
+# define SYS16BIT
+# endif
+# endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+# ifndef STDC
+# define STDC
+# endif
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+# define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
+# define STDC
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const /* note: need a more gentle solution here */
+# endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+# if defined(M_I86SM) || defined(M_I86MM)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+# if (defined(__SMALL__) || defined(__MEDIUM__))
+ /* Turbo C small or medium model */
+# define SMALL_MEDIUM
+# ifdef __BORLANDC__
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
+# ifdef ZLIB_DLL
+# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+# endif
+# endif /* ZLIB_DLL */
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
+# ifdef ZLIB_WINAPI
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+ /* No need for _export, use ZLIB.DEF instead. */
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR CDECL
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# ifdef ZLIB_DLL
+# ifdef ZLIB_INTERNAL
+# define ZEXPORT __declspec(dllexport)
+# define ZEXPORTVA __declspec(dllexport)
+# else
+# define ZEXPORT __declspec(dllimport)
+# define ZEXPORTVA __declspec(dllimport)
+# endif
+# endif
+#endif
+
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void const *voidpc;
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte const *voidpc;
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef STDC
+# include <sys/types.h> /* for off_t */
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_* and off_t */
+# ifdef VMS
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
+# endif
+#endif
+
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+# define z_off64_t off64_t
+#else
+# define z_off64_t z_off_t
+#endif
+
+#if defined(__OS400__)
+# define NO_vsnprintf
+#endif
+
+#if defined(__MVS__)
+# define NO_vsnprintf
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+ #pragma map(deflateInit_,"DEIN")
+ #pragma map(deflateInit2_,"DEIN2")
+ #pragma map(deflateEnd,"DEEND")
+ #pragma map(deflateBound,"DEBND")
+ #pragma map(inflateInit_,"ININ")
+ #pragma map(inflateInit2_,"ININ2")
+ #pragma map(inflateEnd,"INEND")
+ #pragma map(inflateSync,"INSY")
+ #pragma map(inflateSetDictionary,"INSEDI")
+ #pragma map(compressBound,"CMBND")
+ #pragma map(inflate_table,"INTABL")
+ #pragma map(inflate_fast,"INFA")
+ #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/Modules/zlib/zlib.3 b/Modules/zlib/zlib.3
index 90b8162870..27adc4cd10 100644
--- a/Modules/zlib/zlib.3
+++ b/Modules/zlib/zlib.3
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "18 July 2005"
+.TH ZLIB 3 "19 Apr 2010"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
@@ -9,15 +9,15 @@ for full description]
The
.I zlib
library is a general purpose data compression library.
-The code is thread safe.
+The code is thread safe, assuming that the standard library functions
+used are thread safe, such as memory allocation routines.
It provides in-memory compression and decompression functions,
including integrity checks of the uncompressed data.
This version of the library supports only one compression method (deflation)
-but other algorithms will be added later
-and will have the same stream interface.
+but other algorithms may be added later
+with the same stream interface.
.LP
Compression can be done in a single step if the buffers are large enough
-(for example if an input file is mmap'ed),
or can be done by repeated calls of the compression function.
In the latter case,
the application must provide more input and/or consume the output
@@ -30,7 +30,7 @@ with an interface similar to that of stdio.
.LP
The library does not install any signal handler.
The decoder checks the consistency of the compressed data,
-so the library should never crash even in case of corrupted input.
+so the library should never crash even in the case of corrupted input.
.LP
All functions of the compression library are documented in the file
.IR zlib.h .
@@ -38,18 +38,19 @@ The distribution source includes examples of use of the library
in the files
.I example.c
and
-.IR minigzip.c .
+.IR minigzip.c,
+as well as other examples in the
+.IR examples/
+directory.
.LP
Changes to this version are documented in the file
.I ChangeLog
-that accompanies the source,
-and are concerned primarily with bug fixes and portability enhancements.
+that accompanies the source.
.LP
-A Java implementation of
.I zlib
-is available in the Java Development Kit 1.1:
+is available in Java using the java.util.zip package:
.IP
-http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
+http://java.sun.com/developer/technicalArticles/Programming/compression/
.LP
A Perl interface to
.IR zlib ,
@@ -57,7 +58,7 @@ written by Paul Marquess (pmqs@cpan.org),
is available at CPAN (Comprehensive Perl Archive Network) sites,
including:
.IP
-http://www.cpan.org/modules/by-module/Compress/
+http://search.cpan.org/~pmqs/IO-Compress-Zlib/
.LP
A Python interface to
.IR zlib ,
@@ -66,14 +67,11 @@ is available in Python 1.5 and later versions:
.IP
http://www.python.org/doc/lib/module-zlib.html
.LP
-A
.I zlib
-binding for
-.IR tcl (1),
-written by Andreas Kupries (a.kupries@westend.com),
-is availlable at:
+is built into
+.IR tcl:
.IP
-http://www.westend.com/~kupries/doc/trf/man/man.html
+http://wiki.tcl.tk/4610
.LP
An experimental package to read and write files in .zip format,
written on top of
@@ -81,40 +79,34 @@ written on top of
by Gilles Vollant (info@winimage.com),
is available at:
.IP
-http://www.winimage.com/zLibDll/unzip.html
+http://www.winimage.com/zLibDll/minizip.html
and also in the
.I contrib/minizip
directory of the main
.I zlib
-web site.
+source distribution.
.SH "SEE ALSO"
The
.I zlib
-web site can be found at either of these locations:
+web site can be found at:
.IP
-http://www.zlib.org
-.br
-http://www.gzip.org/zlib/
+http://zlib.net/
.LP
The data format used by the zlib library is described by RFC
(Request for Comments) 1950 to 1952 in the files:
.IP
-http://www.ietf.org/rfc/rfc1950.txt (concerning zlib format)
+http://www.ietf.org/rfc/rfc1950.txt (for the zlib header and trailer format)
.br
-http://www.ietf.org/rfc/rfc1951.txt (concerning deflate format)
+http://www.ietf.org/rfc/rfc1951.txt (for the deflate compressed data format)
.br
-http://www.ietf.org/rfc/rfc1952.txt (concerning gzip format)
-.LP
-These documents are also available in other formats from:
-.IP
-ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
+http://www.ietf.org/rfc/rfc1952.txt (for the gzip header and trailer format)
.LP
-Mark Nelson (markn@ieee.org) wrote an article about
+Mark Nelson wrote an article about
.I zlib
for the Jan. 1997 issue of Dr. Dobb's Journal;
a copy of the article is available at:
.IP
-http://dogma.net/markn/articles/zlibtool/zlibtool.htm
+http://marknelson.us/1997/01/01/zlib-engine/
.SH "REPORTING PROBLEMS"
Before reporting a problem,
please check the
@@ -127,14 +119,14 @@ Please read the
.I zlib
FAQ at:
.IP
-http://www.gzip.org/zlib/zlib_faq.html
+http://zlib.net/zlib_faq.html
.LP
before asking for help.
Send questions and/or comments to zlib@gzip.org,
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
.SH AUTHORS
-Version 1.2.3
-Copyright (C) 1995-2005 Jean-loup Gailly (jloup@gzip.org)
+Version 1.2.5
+Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org)
and Mark Adler (madler@alumni.caltech.edu).
.LP
This software is provided "as-is,"
diff --git a/Modules/zlib/zlib.h b/Modules/zlib/zlib.h
index 022817927c..bfbba83e8e 100644
--- a/Modules/zlib/zlib.h
+++ b/Modules/zlib/zlib.h
@@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.3, July 18th, 2005
+ version 1.2.5, April 19th, 2010
- Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+ Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -37,41 +37,44 @@
extern "C" {
#endif
-#define ZLIB_VERSION "1.2.3"
-#define ZLIB_VERNUM 0x1230
+#define ZLIB_VERSION "1.2.5"
+#define ZLIB_VERNUM 0x1250
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 5
+#define ZLIB_VER_SUBREVISION 0
/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed
- data. This version of the library supports only one compression method
- (deflation) but other algorithms will be added later and will have the same
- stream interface.
-
- Compression can be done in a single step if the buffers are large
- enough (for example if an input file is mmap'ed), or can be done by
- repeated calls of the compression function. In the latter case, the
- application must provide more input and/or consume the output
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed data.
+ This version of the library supports only one compression method (deflation)
+ but other algorithms will be added later and will have the same stream
+ interface.
+
+ Compression can be done in a single step if the buffers are large enough,
+ or can be done by repeated calls of the compression function. In the latter
+ case, the application must provide more input and/or consume the output
(providing more output space) before each call.
- The compressed data format used by default by the in-memory functions is
+ The compressed data format used by default by the in-memory functions is
the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
around a deflate stream, which is itself documented in RFC 1951.
- The library also supports reading and writing files in gzip (.gz) format
+ The library also supports reading and writing files in gzip (.gz) format
with an interface similar to that of stdio using the functions that start
with "gz". The gzip format is different from the zlib format. gzip is a
gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
- This library can optionally read and write gzip streams in memory as well.
+ This library can optionally read and write gzip streams in memory as well.
- The zlib format was designed to be compact and fast for use in memory
+ The zlib format was designed to be compact and fast for use in memory
and on communications channels. The gzip format was designed for single-
file compression on file systems, has a larger header than zlib to maintain
directory information, and uses a different, slower check method than zlib.
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never
- crash even in case of corrupted input.
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never crash
+ even in case of corrupted input.
*/
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
@@ -126,45 +129,45 @@ typedef struct gz_header_s {
typedef gz_header FAR *gz_headerp;
/*
- The application must update next_in and avail_in when avail_in has
- dropped to zero. It must update next_out and avail_out when avail_out
- has dropped to zero. The application must initialize zalloc, zfree and
- opaque before calling the init function. All other fields are set by the
- compression library and must not be updated by the application.
-
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
+ The application must update next_in and avail_in when avail_in has dropped
+ to zero. It must update next_out and avail_out when avail_out has dropped
+ to zero. The application must initialize zalloc, zfree and opaque before
+ calling the init function. All other fields are set by the compression
+ library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
opaque value.
- zalloc must return Z_NULL if there is not enough memory for the object.
+ zalloc must return Z_NULL if there is not enough memory for the object.
If zlib is used in a multi-threaded application, zalloc and zfree must be
thread safe.
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this
- if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
- pointers returned by zalloc for objects of exactly 65536 bytes *must*
- have their offset normalized to zero. The default allocation function
- provided by this library ensures this (see zutil.c). To reduce memory
- requirements and avoid any allocation of 64K objects, at the expense of
- compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or
- progress reports. After compression, total_in holds the total size of
- the uncompressed data and may be saved for use in the decompressor
- (particularly if the decompressor wants to decompress everything in
- a single step).
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this if
+ the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers
+ returned by zalloc for objects of exactly 65536 bytes *must* have their
+ offset normalized to zero. The default allocation function provided by this
+ library ensures this (see zutil.c). To reduce memory requirements and avoid
+ any allocation of 64K objects, at the expense of compression ratio, compile
+ the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or progress
+ reports. After compression, total_in holds the total size of the
+ uncompressed data and may be saved for use in the decompressor (particularly
+ if the decompressor wants to decompress everything in a single step).
*/
/* constants */
#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_PARTIAL_FLUSH 1
#define Z_SYNC_FLUSH 2
#define Z_FULL_FLUSH 3
#define Z_FINISH 4
#define Z_BLOCK 5
+#define Z_TREES 6
/* Allowed flush values; see deflate() and inflate() below for details */
#define Z_OK 0
@@ -176,8 +179,8 @@ typedef gz_header FAR *gz_headerp;
#define Z_MEM_ERROR (-4)
#define Z_BUF_ERROR (-5)
#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
*/
#define Z_NO_COMPRESSION 0
@@ -207,119 +210,140 @@ typedef gz_header FAR *gz_headerp;
#define zlib_version zlibVersion()
/* for compatibility with versions < 1.0.2 */
+
/* basic functions */
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
- If the first character differs, the library code actually used is
- not compatible with the zlib.h header file used by the application.
- This check is automatically made by deflateInit and inflateInit.
+ If the first character differs, the library code actually used is not
+ compatible with the zlib.h header file used by the application. This check
+ is automatically made by deflateInit and inflateInit.
*/
/*
ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
- Initializes the internal stream state for compression. The fields
- zalloc, zfree and opaque must be initialized before by the caller.
- If zalloc and zfree are set to Z_NULL, deflateInit updates them to
- use default allocation functions.
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller. If
+ zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
+ allocation functions.
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
- 1 gives best speed, 9 gives best compression, 0 gives no compression at
- all (the input data is simply copied a block at a time).
- Z_DEFAULT_COMPRESSION requests a default compromise between speed and
- compression (currently equivalent to level 6).
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at all
+ (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
+ requests a default compromise between speed and compression (currently
+ equivalent to level 6).
- deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if level is not a valid compression level, or
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
- with the version assumed by the caller (ZLIB_VERSION).
- msg is set to null if there is no error message. deflateInit does not
- perform any compression: this will be done by deflate().
+ with the version assumed by the caller (ZLIB_VERSION). msg is set to null
+ if there is no error message. deflateInit does not perform any compression:
+ this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
/*
deflate compresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce some
- output latency (reading input without producing any output) except when
+ buffer becomes empty or the output buffer becomes full. It may introduce
+ some output latency (reading input without producing any output) except when
forced to flush.
- The detailed semantics are as follows. deflate performs one or both of the
+ The detailed semantics are as follows. deflate performs one or both of the
following actions:
- Compress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
+ accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in and avail_in are updated and
processing will resume at this point for the next call of deflate().
- Provide more output starting at next_out and update next_out and avail_out
- accordingly. This action is forced if the parameter flush is non zero.
+ accordingly. This action is forced if the parameter flush is non zero.
Forcing flush frequently degrades the compression ratio, so this parameter
- should be set only when necessary (in interactive applications).
- Some output may be provided even if flush is not set.
-
- Before the call of deflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating avail_in or avail_out accordingly; avail_out
- should never be zero before the call. The application can consume the
- compressed output when it wants, for example when the output buffer is full
- (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
- and with zero avail_out, it must be called again after making room in the
- output buffer because there might be more output pending.
+ should be set only when necessary (in interactive applications). Some
+ output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming more
+ output, and updating avail_in or avail_out accordingly; avail_out should
+ never be zero before the call. The application can consume the compressed
+ output when it wants, for example when the output buffer is full (avail_out
+ == 0), or after each call of deflate(). If deflate returns Z_OK and with
+ zero avail_out, it must be called again after making room in the output
+ buffer because there might be more output pending.
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
- decide how much data to accumualte before producing output, in order to
+ decide how much data to accumulate before producing output, in order to
maximize compression.
If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
flushed to the output buffer and the output is aligned on a byte boundary, so
- that the decompressor can get all input data available so far. (In particular
- avail_in is zero after the call if enough output space has been provided
- before the call.) Flushing may degrade compression for some compression
- algorithms and so it should be used only when necessary.
+ that the decompressor can get all input data available so far. (In
+ particular avail_in is zero after the call if enough output space has been
+ provided before the call.) Flushing may degrade compression for some
+ compression algorithms and so it should be used only when necessary. This
+ completes the current deflate block and follows it with an empty stored block
+ that is three bits plus filler bits to the next byte, followed by four bytes
+ (00 00 ff ff).
+
+ If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
+ output buffer, but the output is not aligned to a byte boundary. All of the
+ input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
+ This completes the current deflate block and follows it with an empty fixed
+ codes block that is 10 bits long. This assures that enough bytes are output
+ in order for the decompressor to finish the block before the empty fixed code
+ block.
+
+ If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
+ for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
+ seven bits of the current block are held to be written as the next byte after
+ the next deflate block is completed. In this case, the decompressor may not
+ be provided enough bits at this point in order to complete decompression of
+ the data provided so far to the compressor. It may need to wait for the next
+ block to be emitted. This is for advanced applications that need to control
+ the emission of deflate blocks.
If flush is set to Z_FULL_FLUSH, all output is flushed as with
Z_SYNC_FLUSH, and the compression state is reset so that decompression can
restart from this point if previous compressed data has been damaged or if
- random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
compression.
If deflate returns with avail_out == 0, this function must be called again
with the same value of the flush parameter and more output space (updated
avail_out), until the flush is complete (deflate returns with non-zero
- avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+ avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
avail_out is greater than six to avoid repeated flush markers due to
avail_out == 0 on return.
If the parameter flush is set to Z_FINISH, pending input is processed,
- pending output is flushed and deflate returns with Z_STREAM_END if there
- was enough output space; if deflate returns with Z_OK, this function must be
+ pending output is flushed and deflate returns with Z_STREAM_END if there was
+ enough output space; if deflate returns with Z_OK, this function must be
called again with Z_FINISH and more output space (updated avail_out) but no
- more input data, until it returns with Z_STREAM_END or an error. After
- deflate has returned Z_STREAM_END, the only possible operations on the
- stream are deflateReset or deflateEnd.
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the stream
+ are deflateReset or deflateEnd.
Z_FINISH can be used immediately after deflateInit if all the compression
- is to be done in a single step. In this case, avail_out must be at least
- the value returned by deflateBound (see below). If deflate does not return
+ is to be done in a single step. In this case, avail_out must be at least the
+ value returned by deflateBound (see below). If deflate does not return
Z_STREAM_END, then it must be called again as described above.
deflate() sets strm->adler to the adler32 checksum of all input read
so far (that is, total_in bytes).
deflate() may update strm->data_type if it can make a good guess about
- the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
- binary. This field is only for information purposes and does not affect
- the compression algorithm in any manner.
+ the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect the
+ compression algorithm in any manner.
deflate() returns Z_OK if some progress has been made (more input
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
+ if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
fatal, and deflate() can be called again with more input and more output
space to continue compressing.
*/
@@ -328,13 +352,13 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
+ This function discards any unprocessed input and does not flush any pending
+ output.
deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
stream state was inconsistent, Z_DATA_ERROR if the stream was freed
- prematurely (some input or output was discarded). In the error case,
- msg may be set but then points to a static string (which must not be
+ prematurely (some input or output was discarded). In the error case, msg
+ may be set but then points to a static string (which must not be
deallocated).
*/
@@ -342,10 +366,10 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
- Initializes the internal stream state for decompression. The fields
+ Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
- the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
- value depends on the compression method), inflateInit determines the
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the
+ exact value depends on the compression method), inflateInit determines the
compression method from the zlib header and allocates all data structures
accordingly; otherwise the allocation will be deferred to the first call of
inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
@@ -353,95 +377,108 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller. msg is set to null if there is no error
- message. inflateInit does not perform any decompression apart from reading
- the zlib header if present: this will be done by inflate(). (So next_in and
- avail_in may be modified, but next_out and avail_out are unchanged.)
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit does not perform any decompression
+ apart from possibly reading the zlib header if present: actual decompression
+ will be done by inflate(). (So next_in and avail_in may be modified, but
+ next_out and avail_out are unused and unchanged.) The current implementation
+ of inflateInit() does not process any header information -- that is deferred
+ until inflate() is called.
*/
ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
/*
inflate decompresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce
+ buffer becomes empty or the output buffer becomes full. It may introduce
some output latency (reading input without producing any output) except when
forced to flush.
- The detailed semantics are as follows. inflate performs one or both of the
+ The detailed semantics are as follows. inflate performs one or both of the
following actions:
- Decompress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in is updated and processing
- will resume at this point for the next call of inflate().
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing will
+ resume at this point for the next call of inflate().
- Provide more output starting at next_out and update next_out and avail_out
- accordingly. inflate() provides as much output as possible, until there
- is no more input data or no more space in the output buffer (see below
- about the flush parameter).
-
- Before the call of inflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating the next_* and avail_* values accordingly.
- The application can consume the uncompressed output when it wants, for
- example when the output buffer is full (avail_out == 0), or after each
- call of inflate(). If inflate returns Z_OK and with zero avail_out, it
- must be called again after making room in the output buffer because there
- might be more output pending.
-
- The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
- Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
- output as possible to the output buffer. Z_BLOCK requests that inflate() stop
- if and when it gets to the next deflate block boundary. When decoding the
- zlib or gzip format, this will cause inflate() to return immediately after
- the header and before the first block. When doing a raw inflate, inflate()
- will go ahead and process the first block, and will return when it gets to
- the end of that block, or when it runs out of data.
+ accordingly. inflate() provides as much output as possible, until there is
+ no more input data or no more space in the output buffer (see below about
+ the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming more
+ output, and updating the next_* and avail_* values accordingly. The
+ application can consume the uncompressed output when it wants, for example
+ when the output buffer is full (avail_out == 0), or after each call of
+ inflate(). If inflate returns Z_OK and with zero avail_out, it must be
+ called again after making room in the output buffer because there might be
+ more output pending.
+
+ The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
+ Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much
+ output as possible to the output buffer. Z_BLOCK requests that inflate()
+ stop if and when it gets to the next deflate block boundary. When decoding
+ the zlib or gzip format, this will cause inflate() to return immediately
+ after the header and before the first block. When doing a raw inflate,
+ inflate() will go ahead and process the first block, and will return when it
+ gets to the end of that block, or when it runs out of data.
The Z_BLOCK option assists in appending to or combining deflate streams.
Also to assist in this, on return inflate() will set strm->data_type to the
- number of unused bits in the last byte taken from strm->next_in, plus 64
- if inflate() is currently decoding the last block in the deflate stream,
- plus 128 if inflate() returned immediately after decoding an end-of-block
- code or decoding the complete header up to just before the first byte of the
- deflate stream. The end-of-block will not be indicated until all of the
- uncompressed data from that block has been written to strm->next_out. The
- number of unused bits may in general be greater than seven, except when
- bit 7 of data_type is set, in which case the number of unused bits will be
- less than eight.
+ number of unused bits in the last byte taken from strm->next_in, plus 64 if
+ inflate() is currently decoding the last block in the deflate stream, plus
+ 128 if inflate() returned immediately after decoding an end-of-block code or
+ decoding the complete header up to just before the first byte of the deflate
+ stream. The end-of-block will not be indicated until all of the uncompressed
+ data from that block has been written to strm->next_out. The number of
+ unused bits may in general be greater than seven, except when bit 7 of
+ data_type is set, in which case the number of unused bits will be less than
+ eight. data_type is set as noted here every time inflate() returns for all
+ flush options, and so can be used to determine the amount of currently
+ consumed input in bits.
+
+ The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
+ end of each deflate block header is reached, before any actual data in that
+ block is decoded. This allows the caller to determine the length of the
+ deflate block header for later use in random access within a deflate block.
+ 256 is added to the value of strm->data_type when inflate() returns
+ immediately after reaching the end of the deflate block header.
inflate() should normally be called until it returns Z_STREAM_END or an
- error. However if all decompression is to be performed in a single step
- (a single call of inflate), the parameter flush should be set to
- Z_FINISH. In this case all pending input is processed and all pending
- output is flushed; avail_out must be large enough to hold all the
- uncompressed data. (The size of the uncompressed data may have been saved
- by the compressor for this purpose.) The next operation on this stream must
- be inflateEnd to deallocate the decompression state. The use of Z_FINISH
- is never required, but can be used to inform inflate that a faster approach
- may be used for the single inflate() call.
+ error. However if all decompression is to be performed in a single step (a
+ single call of inflate), the parameter flush should be set to Z_FINISH. In
+ this case all pending input is processed and all pending output is flushed;
+ avail_out must be large enough to hold all the uncompressed data. (The size
+ of the uncompressed data may have been saved by the compressor for this
+ purpose.) The next operation on this stream must be inflateEnd to deallocate
+ the decompression state. The use of Z_FINISH is never required, but can be
+ used to inform inflate that a faster approach may be used for the single
+ inflate() call.
In this implementation, inflate() always flushes as much output as
possible to the output buffer, and always uses the faster approach on the
- first call. So the only effect of the flush parameter in this implementation
+ first call. So the only effect of the flush parameter in this implementation
is on the return value of inflate(), as noted below, or when it returns early
- because Z_BLOCK is used.
+ because Z_BLOCK or Z_TREES is used.
If a preset dictionary is needed after this call (see inflateSetDictionary
below), inflate sets strm->adler to the adler32 checksum of the dictionary
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
strm->adler to the adler32 checksum of all output produced so far (that is,
total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
- below. At the end of the stream, inflate() checks that its computed adler32
+ below. At the end of the stream, inflate() checks that its computed adler32
checksum is equal to that saved by the compressor and returns Z_STREAM_END
only if the checksum is correct.
- inflate() will decompress and check either zlib-wrapped or gzip-wrapped
- deflate data. The header type is detected automatically. Any information
- contained in the gzip header is not retained, so applications that need that
- information should instead use raw inflate, see inflateInit2() below, or
- inflateBack() and perform their own processing of the gzip header and
- trailer.
+ inflate() can decompress and check either zlib-wrapped or gzip-wrapped
+ deflate data. The header type is detected automatically, if requested when
+ initializing with inflateInit2(). Any information contained in the gzip
+ header is not retained, so applications that need that information should
+ instead use raw inflate, see inflateInit2() below, or inflateBack() and
+ perform their own processing of the gzip header and trailer.
inflate() returns Z_OK if some progress has been made (more input processed
or more output produced), Z_STREAM_END if the end of the compressed data has
@@ -449,27 +486,28 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
corrupted (input stream not conforming to the zlib format or incorrect check
value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
- if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
+ next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
Z_BUF_ERROR if no progress is possible or if there was not enough room in the
- output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
+ output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
inflate() can be called again with more input and more output space to
- continue decompressing. If Z_DATA_ERROR is returned, the application may then
- call inflateSync() to look for a good compression block if a partial recovery
- of the data is desired.
+ continue decompressing. If Z_DATA_ERROR is returned, the application may
+ then call inflateSync() to look for a good compression block if a partial
+ recovery of the data is desired.
*/
ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
+ This function discards any unprocessed input and does not flush any pending
+ output.
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
- was inconsistent. In the error case, msg may be set but then points to a
+ was inconsistent. In the error case, msg may be set but then points to a
static string (which must not be deallocated).
*/
+
/* Advanced functions */
/*
@@ -484,55 +522,57 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
int memLevel,
int strategy));
- This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by
- the caller.
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by the
+ caller.
- The method parameter is the compression method. It must be Z_DEFLATED in
+ The method parameter is the compression method. It must be Z_DEFLATED in
this version of the library.
The windowBits parameter is the base two logarithm of the window size
- (the size of the history buffer). It should be in the range 8..15 for this
- version of the library. Larger values of this parameter result in better
- compression at the expense of memory usage. The default value is 15 if
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
deflateInit is used instead.
- windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
- determines the window size. deflate() will then generate raw deflate data
+ windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
+ determines the window size. deflate() will then generate raw deflate data
with no zlib header or trailer, and will not compute an adler32 check value.
- windowBits can also be greater than 15 for optional gzip encoding. Add
+ windowBits can also be greater than 15 for optional gzip encoding. Add
16 to windowBits to write a simple gzip header and trailer around the
- compressed data instead of a zlib wrapper. The gzip header will have no
- file name, no extra data, no comment, no modification time (set to zero),
- no header crc, and the operating system will be set to 255 (unknown). If a
+ compressed data instead of a zlib wrapper. The gzip header will have no
+ file name, no extra data, no comment, no modification time (set to zero), no
+ header crc, and the operating system will be set to 255 (unknown). If a
gzip stream is being written, strm->adler is a crc32 instead of an adler32.
The memLevel parameter specifies how much memory should be allocated
- for the internal compression state. memLevel=1 uses minimum memory but
- is slow and reduces compression ratio; memLevel=9 uses maximum memory
- for optimal speed. The default value is 8. See zconf.h for total memory
- usage as a function of windowBits and memLevel.
+ for the internal compression state. memLevel=1 uses minimum memory but is
+ slow and reduces compression ratio; memLevel=9 uses maximum memory for
+ optimal speed. The default value is 8. See zconf.h for total memory usage
+ as a function of windowBits and memLevel.
- The strategy parameter is used to tune the compression algorithm. Use the
+ The strategy parameter is used to tune the compression algorithm. Use the
value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
string match), or Z_RLE to limit match distances to one (run-length
- encoding). Filtered data consists mostly of small values with a somewhat
- random distribution. In this case, the compression algorithm is tuned to
- compress them better. The effect of Z_FILTERED is to force more Huffman
+ encoding). Filtered data consists mostly of small values with a somewhat
+ random distribution. In this case, the compression algorithm is tuned to
+ compress them better. The effect of Z_FILTERED is to force more Huffman
coding and less string matching; it is somewhat intermediate between
- Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
- Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
- parameter only affects the compression ratio but not the correctness of the
- compressed output even if it is not set appropriately. Z_FIXED prevents the
- use of dynamic Huffman codes, allowing for a simpler decoder for special
- applications.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
- method). msg is set to null if there is no error message. deflateInit2 does
- not perform any compression: this will be done by deflate().
+ Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
+ fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
+ strategy parameter only affects the compression ratio but not the
+ correctness of the compressed output even if it is not set appropriately.
+ Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
+ decoder for special applications.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
+ method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
+ incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
+ set to null if there is no error message. deflateInit2 does not perform any
+ compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
@@ -540,37 +580,37 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
uInt dictLength));
/*
Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any
- call of deflate. The compressor and decompressor must use exactly the same
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any call
+ of deflate. The compressor and decompressor must use exactly the same
dictionary (see inflateSetDictionary).
The dictionary should consist of strings (byte sequences) that are likely
to be encountered later in the data to be compressed, with the most commonly
- used strings preferably put towards the end of the dictionary. Using a
+ used strings preferably put towards the end of the dictionary. Using a
dictionary is most useful when the data to be compressed is short and can be
predicted with good accuracy; the data can then be compressed better than
with the default empty dictionary.
Depending on the size of the compression data structures selected by
deflateInit or deflateInit2, a part of the dictionary may in effect be
- discarded, for example if the dictionary is larger than the window size in
- deflate or deflate2. Thus the strings most likely to be useful should be
- put at the end of the dictionary, not at the front. In addition, the
- current implementation of deflate will use at most the window size minus
- 262 bytes of the provided dictionary.
+ discarded, for example if the dictionary is larger than the window size
+ provided in deflateInit or deflateInit2. Thus the strings most likely to be
+ useful should be put at the end of the dictionary, not at the front. In
+ addition, the current implementation of deflate will use at most the window
+ size minus 262 bytes of the provided dictionary.
Upon return of this function, strm->adler is set to the adler32 value
of the dictionary; the decompressor may later use this value to determine
- which dictionary has been used by the compressor. (The adler32 value
+ which dictionary has been used by the compressor. (The adler32 value
applies to the whole dictionary even if only a subset of the dictionary is
actually used by the compressor.) If a raw deflate was requested, then the
adler32 value is not computed and strm->adler is not set.
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
inconsistent (for example if deflate has already been called for this stream
- or if the compression method is bsort). deflateSetDictionary does not
+ or if the compression method is bsort). deflateSetDictionary does not
perform any compression: this will be done by deflate().
*/
@@ -581,26 +621,26 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
This function can be useful when several compression strategies will be
tried, for example when there are several ways of pre-processing the input
- data with a filter. The streams that will be discarded should then be freed
+ data with a filter. The streams that will be discarded should then be freed
by calling deflateEnd. Note that deflateCopy duplicates the internal
- compression state which can be quite large, so this strategy is slow and
- can consume lots of memory.
+ compression state which can be quite large, so this strategy is slow and can
+ consume lots of memory.
deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being NULL). msg is left unchanged in both source and
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
destination.
*/
ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
/*
This function is equivalent to deflateEnd followed by deflateInit,
- but does not free and reallocate all the internal compression state.
- The stream will keep the same compression level and any other attributes
- that may have been set by deflateInit2.
+ but does not free and reallocate all the internal compression state. The
+ stream will keep the same compression level and any other attributes that
+ may have been set by deflateInit2.
- deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
*/
ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
@@ -610,18 +650,18 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2. This can be
used to switch between compression and straight copy of the input data, or
- to switch to a different kind of input data requiring a different
- strategy. If the compression level is changed, the input available so far
- is compressed with the old level (and may be flushed); the new level will
- take effect only at the next call of deflate().
+ to switch to a different kind of input data requiring a different strategy.
+ If the compression level is changed, the input available so far is
+ compressed with the old level (and may be flushed); the new level will take
+ effect only at the next call of deflate().
Before the call of deflateParams, the stream state must be set as for
- a call of deflate(), since the currently available input may have to
- be compressed and flushed. In particular, strm->avail_out must be non-zero.
+ a call of deflate(), since the currently available input may have to be
+ compressed and flushed. In particular, strm->avail_out must be non-zero.
deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
- stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
- if strm->avail_out was zero.
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
+ strm->avail_out was zero.
*/
ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
@@ -645,9 +685,10 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
uLong sourceLen));
/*
deflateBound() returns an upper bound on the compressed size after
- deflation of sourceLen bytes. It must be called after deflateInit()
- or deflateInit2(). This would be used to allocate an output buffer
- for deflation in a single pass, and so would be called before deflate().
+ deflation of sourceLen bytes. It must be called after deflateInit() or
+ deflateInit2(), and after deflateSetHeader(), if used. This would be used
+ to allocate an output buffer for deflation in a single pass, and so would be
+ called before deflate().
*/
ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
@@ -655,21 +696,21 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
int value));
/*
deflatePrime() inserts bits in the deflate output stream. The intent
- is that this function is used to start off the deflate output with the
- bits leftover from a previous deflate stream when appending to it. As such,
- this function can only be used for raw deflate, and must be used before the
- first deflate() call after a deflateInit2() or deflateReset(). bits must be
- less than or equal to 16, and that many of the least significant bits of
- value will be inserted in the output.
-
- deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+ is that this function is used to start off the deflate output with the bits
+ leftover from a previous deflate stream when appending to it. As such, this
+ function can only be used for raw deflate, and must be used before the first
+ deflate() call after a deflateInit2() or deflateReset(). bits must be less
+ than or equal to 16, and that many of the least significant bits of value
+ will be inserted in the output.
+
+ deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
gz_headerp head));
/*
- deflateSetHeader() provides gzip header information for when a gzip
+ deflateSetHeader() provides gzip header information for when a gzip
stream is requested by deflateInit2(). deflateSetHeader() may be called
after deflateInit2() or deflateReset() and before the first call of
deflate(). The text, time, os, extra field, name, and comment information
@@ -682,11 +723,11 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
1.3.x) do not support header crc's, and will report that it is a "multi-part
gzip file" and give up.
- If deflateSetHeader is not used, the default gzip header has text false,
+ If deflateSetHeader is not used, the default gzip header has text false,
the time set to zero, and os set to 255, with no extra, name, or comment
fields. The gzip header is returned to the default state by deflateReset().
- deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
@@ -694,43 +735,50 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
int windowBits));
- This is another version of inflateInit with an extra parameter. The
+ This is another version of inflateInit with an extra parameter. The
fields next_in, avail_in, zalloc, zfree and opaque must be initialized
before by the caller.
The windowBits parameter is the base two logarithm of the maximum window
size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library. The default value is 15 if inflateInit is used
- instead. windowBits must be greater than or equal to the windowBits value
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. windowBits must be greater than or equal to the windowBits value
provided to deflateInit2() while compressing, or it must be equal to 15 if
- deflateInit2() was not used. If a compressed stream with a larger window
+ deflateInit2() was not used. If a compressed stream with a larger window
size is given as input, inflate() will return with the error code
Z_DATA_ERROR instead of trying to allocate a larger window.
- windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
- determines the window size. inflate() will then process raw deflate data,
+ windowBits can also be zero to request that inflate use the window size in
+ the zlib header of the compressed stream.
+
+ windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
+ determines the window size. inflate() will then process raw deflate data,
not looking for a zlib or gzip header, not generating a check value, and not
- looking for any check values for comparison at the end of the stream. This
+ looking for any check values for comparison at the end of the stream. This
is for use with other formats that use the deflate compressed data format
- such as zip. Those formats provide their own check values. If a custom
+ such as zip. Those formats provide their own check values. If a custom
format is developed using the raw deflate format for compressed data, it is
recommended that a check value such as an adler32 or a crc32 be applied to
the uncompressed data as is done in the zlib, gzip, and zip formats. For
- most applications, the zlib format should be used as is. Note that comments
+ most applications, the zlib format should be used as is. Note that comments
above on the use in deflateInit2() applies to the magnitude of windowBits.
- windowBits can also be greater than 15 for optional gzip decoding. Add
+ windowBits can also be greater than 15 for optional gzip decoding. Add
32 to windowBits to enable zlib and gzip decoding with automatic header
detection, or add 16 to decode only the gzip format (the zlib format will
- return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
- a crc32 instead of an adler32.
+ return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
+ crc32 instead of an adler32.
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
- is set to null if there is no error message. inflateInit2 does not perform
- any decompression apart from reading the zlib header if present: this will
- be done by inflate(). (So next_in and avail_in may be modified, but next_out
- and avail_out are unchanged.)
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit2 does not perform any decompression
+ apart from possibly reading the zlib header if present: actual decompression
+ will be done by inflate(). (So next_in and avail_in may be modified, but
+ next_out and avail_out are unused and unchanged.) The current implementation
+ of inflateInit2() does not process any header information -- that is
+ deferred until inflate() is called.
*/
ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
@@ -738,8 +786,8 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
uInt dictLength));
/*
Initializes the decompression dictionary from the given uncompressed byte
- sequence. This function must be called immediately after a call of inflate,
- if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ sequence. This function must be called immediately after a call of inflate,
+ if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
can be determined from the adler32 value returned by that call of inflate.
The compressor and decompressor must use exactly the same dictionary (see
deflateSetDictionary). For raw inflate, this function can be called
@@ -748,26 +796,26 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
dictionary that was used for compression is provided.
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
- expected one (incorrect adler32 value). inflateSetDictionary does not
+ expected one (incorrect adler32 value). inflateSetDictionary does not
perform any decompression: this will be done by subsequent calls of
inflate().
*/
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
/*
- Skips invalid compressed data until a full flush point (see above the
- description of deflate with Z_FULL_FLUSH) can be found, or until all
- available input is skipped. No output is provided.
-
- inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no flush point has been found,
- or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
- case, the application may save the current current value of total_in which
- indicates where valid compressed data was found. In the error case, the
- application may repeatedly call inflateSync, providing more input each time,
- until success or end of the input data.
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been
+ found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the
+ success case, the application may save the current current value of total_in
+ which indicates where valid compressed data was found. In the error case,
+ the application may repeatedly call inflateSync, providing more input each
+ time, until success or end of the input data.
*/
ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
@@ -782,18 +830,30 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being NULL). msg is left unchanged in both source and
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
destination.
*/
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
/*
This function is equivalent to inflateEnd followed by inflateInit,
- but does not free and reallocate all the internal decompression state.
- The stream will keep attributes that may have been set by inflateInit2.
+ but does not free and reallocate all the internal decompression state. The
+ stream will keep attributes that may have been set by inflateInit2.
- inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+ int windowBits));
+/*
+ This function is the same as inflateReset, but it also permits changing
+ the wrap and window size requests. The windowBits parameter is interpreted
+ the same as it is for inflateInit2.
+
+ inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL), or if
+ the windowBits parameter is invalid.
*/
ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
@@ -801,54 +861,87 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
int value));
/*
This function inserts bits in the inflate input stream. The intent is
- that this function is used to start inflating at a bit position in the
- middle of a byte. The provided bits will be used before any bytes are used
- from next_in. This function should only be used with raw inflate, and
- should be used before the first inflate() call after inflateInit2() or
- inflateReset(). bits must be less than or equal to 16, and that many of the
- least significant bits of value will be inserted in the input.
-
- inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+ that this function is used to start inflating at a bit position in the
+ middle of a byte. The provided bits will be used before any bytes are used
+ from next_in. This function should only be used with raw inflate, and
+ should be used before the first inflate() call after inflateInit2() or
+ inflateReset(). bits must be less than or equal to 16, and that many of the
+ least significant bits of value will be inserted in the input.
+
+ If bits is negative, then the input stream bit buffer is emptied. Then
+ inflatePrime() can be called again to put bits in the buffer. This is used
+ to clear out bits leftover after feeding inflate a block description prior
+ to feeding inflate codes.
+
+ inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
+ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+/*
+ This function returns two values, one in the lower 16 bits of the return
+ value, and the other in the remaining upper bits, obtained by shifting the
+ return value down 16 bits. If the upper value is -1 and the lower value is
+ zero, then inflate() is currently decoding information outside of a block.
+ If the upper value is -1 and the lower value is non-zero, then inflate is in
+ the middle of a stored block, with the lower value equaling the number of
+ bytes from the input remaining to copy. If the upper value is not -1, then
+ it is the number of bits back from the current bit position in the input of
+ the code (literal or length/distance pair) currently being processed. In
+ that case the lower value is the number of bytes already emitted for that
+ code.
+
+ A code is being processed if inflate is waiting for more input to complete
+ decoding of the code, or if it has completed decoding but is waiting for
+ more output space to write the literal or match data.
+
+ inflateMark() is used to mark locations in the input data for random
+ access, which may be at bit positions, and to note those cases where the
+ output of a code may span boundaries of random access blocks. The current
+ location in the input stream can be determined from avail_in and data_type
+ as noted in the description for the Z_BLOCK flush parameter for inflate.
+
+ inflateMark returns the value noted above or -1 << 16 if the provided
+ source stream state was inconsistent.
+*/
+
ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
gz_headerp head));
/*
- inflateGetHeader() requests that gzip header information be stored in the
+ inflateGetHeader() requests that gzip header information be stored in the
provided gz_header structure. inflateGetHeader() may be called after
inflateInit2() or inflateReset(), and before the first call of inflate().
As inflate() processes the gzip stream, head->done is zero until the header
is completed, at which time head->done is set to one. If a zlib stream is
being decoded, then head->done is set to -1 to indicate that there will be
- no gzip header information forthcoming. Note that Z_BLOCK can be used to
- force inflate() to return immediately after header processing is complete
- and before any actual data is decompressed.
+ no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be
+ used to force inflate() to return immediately after header processing is
+ complete and before any actual data is decompressed.
- The text, time, xflags, and os fields are filled in with the gzip header
+ The text, time, xflags, and os fields are filled in with the gzip header
contents. hcrc is set to true if there is a header CRC. (The header CRC
- was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+ was valid if done is set to one.) If extra is not Z_NULL, then extra_max
contains the maximum number of bytes to write to extra. Once done is true,
extra_len contains the actual extra field length, and extra contains the
extra field, or that field truncated if extra_max is less than extra_len.
If name is not Z_NULL, then up to name_max characters are written there,
terminated with a zero unless the length is greater than name_max. If
comment is not Z_NULL, then up to comm_max characters are written there,
- terminated with a zero unless the length is greater than comm_max. When
- any of extra, name, or comment are not Z_NULL and the respective field is
- not present in the header, then that field is set to Z_NULL to signal its
+ terminated with a zero unless the length is greater than comm_max. When any
+ of extra, name, or comment are not Z_NULL and the respective field is not
+ present in the header, then that field is set to Z_NULL to signal its
absence. This allows the use of deflateSetHeader() with the returned
structure to duplicate the header. However if those fields are set to
allocated memory, then the application will need to save those pointers
elsewhere so that they can be eventually freed.
- If inflateGetHeader is not used, then the header information is simply
+ If inflateGetHeader is not used, then the header information is simply
discarded. The header is always checked for validity, including the header
CRC if present. inflateReset() will reset the process to discard the header
information. The application would need to call inflateGetHeader() again to
retrieve the header from the next gzip stream.
- inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
@@ -869,9 +962,9 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
See inflateBack() for the usage of these routines.
inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
- the paramaters are invalid, Z_MEM_ERROR if the internal state could not
- be allocated, or Z_VERSION_ERROR if the version of the library does not
- match the version of the header file.
+ the paramaters are invalid, Z_MEM_ERROR if the internal state could not be
+ allocated, or Z_VERSION_ERROR if the version of the library does not match
+ the version of the header file.
*/
typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
@@ -891,15 +984,15 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
inflateBackInit() must be called first to allocate the internal state
and to initialize the state with the user-provided window buffer.
inflateBack() may then be used multiple times to inflate a complete, raw
- deflate stream with each call. inflateBackEnd() is then called to free
- the allocated state.
+ deflate stream with each call. inflateBackEnd() is then called to free the
+ allocated state.
A raw deflate stream is one with no zlib or gzip header or trailer.
This routine would normally be used in a utility that reads zip or gzip
files and writes out uncompressed files. The utility would decode the
- header and process the trailer on its own, hence this routine expects
- only the raw deflate stream to decompress. This is different from the
- normal behavior of inflate(), which expects either a zlib or gzip header and
+ header and process the trailer on its own, hence this routine expects only
+ the raw deflate stream to decompress. This is different from the normal
+ behavior of inflate(), which expects either a zlib or gzip header and
trailer around the deflate stream.
inflateBack() uses two subroutines supplied by the caller that are then
@@ -925,7 +1018,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
must also be initialized, and then if strm->avail_in is not zero, input will
- initially be taken from strm->next_in[0 .. strm->avail_in - 1].
+ initially be taken from strm->next_in[0 .. strm->avail_in - 1].
The in_desc and out_desc parameters of inflateBack() is passed as the
first parameter of in() and out() respectively when they are called. These
@@ -935,15 +1028,15 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
On return, inflateBack() will set strm->next_in and strm->avail_in to
pass back any unused input that was provided by the last in() call. The
return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
- if in() or out() returned an error, Z_DATA_ERROR if there was a format
- error in the deflate stream (in which case strm->msg is set to indicate the
- nature of the error), or Z_STREAM_ERROR if the stream was not properly
- initialized. In the case of Z_BUF_ERROR, an input or output error can be
- distinguished using strm->next_in which will be Z_NULL only if in() returned
- an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
- out() returning non-zero. (in() will always be called before out(), so
- strm->next_in is assured to be defined if out() returns non-zero.) Note
- that inflateBack() cannot return Z_OK.
+ if in() or out() returned an error, Z_DATA_ERROR if there was a format error
+ in the deflate stream (in which case strm->msg is set to indicate the nature
+ of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
+ In the case of Z_BUF_ERROR, an input or output error can be distinguished
+ using strm->next_in which will be Z_NULL only if in() returned an error. If
+ strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
+ non-zero. (in() will always be called before out(), so strm->next_in is
+ assured to be defined if out() returns non-zero.) Note that inflateBack()
+ cannot return Z_OK.
*/
ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
@@ -999,23 +1092,22 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
/* utility functions */
/*
- The following utility functions are implemented on top of the
- basic stream-oriented functions. To simplify the interface, some
- default options are assumed (compression level and memory usage,
- standard memory allocation functions). The source code of these
- utility functions can easily be modified if you need special options.
+ The following utility functions are implemented on top of the basic
+ stream-oriented functions. To simplify the interface, some default options
+ are assumed (compression level and memory usage, standard memory allocation
+ functions). The source code of these utility functions can be modified if
+ you need special options.
*/
ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
/*
Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be at least the value returned
- by compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ the byte length of the source buffer. Upon entry, destLen is the total size
+ of the destination buffer, which must be at least the value returned by
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer.
- This function can be used to compress a whole file at once if the
- input file is mmap'ed.
+
compress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer.
@@ -1025,11 +1117,11 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen,
int level));
/*
- Compresses the source buffer into the destination buffer. The level
+ Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
+ length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least the value returned by
- compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
@@ -1040,22 +1132,20 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
/*
compressBound() returns an upper bound on the compressed size after
- compress() or compress2() on sourceLen bytes. It would be used before
- a compress() or compress2() call to allocate the destination buffer.
+ compress() or compress2() on sourceLen bytes. It would be used before a
+ compress() or compress2() call to allocate the destination buffer.
*/
ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
/*
Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be large enough to hold the
- entire uncompressed data. (The size of the uncompressed data must have
- been saved previously by the compressor and transmitted to the decompressor
- by some mechanism outside the scope of this compression library.)
- Upon exit, destLen is the actual size of the compressed buffer.
- This function can be used to decompress a whole file at once if the
- input file is mmap'ed.
+ the byte length of the source buffer. Upon entry, destLen is the total size
+ of the destination buffer, which must be large enough to hold the entire
+ uncompressed data. (The size of the uncompressed data must have been saved
+ previously by the compressor and transmitted to the decompressor by some
+ mechanism outside the scope of this compression library.) Upon exit, destLen
+ is the actual size of the uncompressed buffer.
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
@@ -1063,136 +1153,199 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
*/
-typedef voidp gzFile;
+ /* gzip file access functions */
+
+/*
+ This library supports reading and writing files in gzip (.gz) format with
+ an interface similar to that of stdio, using the functions that start with
+ "gz". The gzip format is different from the zlib format. gzip is a gzip
+ wrapper, documented in RFC 1952, wrapped around a deflate stream.
+*/
+
+typedef voidp gzFile; /* opaque gzip file descriptor */
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
/*
- Opens a gzip (.gz) file for reading or writing. The mode parameter
- is as in fopen ("rb" or "wb") but can also include a compression level
- ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
- Huffman only compression as in "wb1h", or 'R' for run-length encoding
- as in "wb1R". (See the description of deflateInit2 for more information
- about the strategy parameter.)
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+ Opens a gzip (.gz) file for reading or writing. The mode parameter is as
+ in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
+ a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
+ compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
+ for fixed code compression as in "wb9F". (See the description of
+ deflateInit2 for more information about the strategy parameter.) Also "a"
+ can be used instead of "w" to request that the gzip stream that will be
+ written be appended to the file. "+" will result in an error, since reading
+ and writing to the same gzip file is not supported.
gzopen can be used to read a file which is not in gzip format; in this
case gzread will directly read from the file without decompression.
- gzopen returns NULL if the file could not be opened or if there was
- insufficient memory to allocate the (de)compression state; errno
- can be checked to distinguish the two cases (if errno is zero, the
- zlib error is Z_MEM_ERROR). */
+ gzopen returns NULL if the file could not be opened, if there was
+ insufficient memory to allocate the gzFile state, or if an invalid mode was
+ specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
+ errno can be checked to determine if the reason gzopen failed was that the
+ file could not be opened.
+*/
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
/*
- gzdopen() associates a gzFile with the file descriptor fd. File
- descriptors are obtained from calls like open, dup, creat, pipe or
- fileno (in the file has been previously opened with fopen).
- The mode parameter is as in gzopen.
- The next call of gzclose on the returned gzFile will also close the
- file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
- descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
- gzdopen returns NULL if there was insufficient memory to allocate
- the (de)compression state.
+ gzdopen associates a gzFile with the file descriptor fd. File descriptors
+ are obtained from calls like open, dup, creat, pipe or fileno (if the file
+ has been previously opened with fopen). The mode parameter is as in gzopen.
+
+ The next call of gzclose on the returned gzFile will also close the file
+ descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
+ fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
+ mode);. The duplicated descriptor should be saved to avoid a leak, since
+ gzdopen does not close fd if it fails.
+
+ gzdopen returns NULL if there was insufficient memory to allocate the
+ gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
+ provided, or '+' was provided), or if fd is -1. The file descriptor is not
+ used until the next gz* read, write, seek, or close operation, so gzdopen
+ will not detect if fd is invalid (unless fd is -1).
+*/
+
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
+/*
+ Set the internal buffer size used by this library's functions. The
+ default buffer size is 8192 bytes. This function must be called after
+ gzopen() or gzdopen(), and before any other calls that read or write the
+ file. The buffer memory allocation is always deferred to the first read or
+ write. Two buffers are allocated, either both of the specified size when
+ writing, or one of the specified size and the other twice that size when
+ reading. A larger buffer size of, for example, 64K or 128K bytes will
+ noticeably increase the speed of decompression (reading).
+
+ The new buffer size also affects the maximum length for gzprintf().
+
+ gzbuffer() returns 0 on success, or -1 on failure, such as being called
+ too late.
*/
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
/*
- Dynamically update the compression level or strategy. See the description
+ Dynamically update the compression level or strategy. See the description
of deflateInit2 for the meaning of these parameters.
+
gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
opened for writing.
*/
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
/*
- Reads the given number of uncompressed bytes from the compressed file.
- If the input file was not in gzip format, gzread copies the given number
- of bytes into the buffer.
- gzread returns the number of uncompressed bytes actually read (0 for
- end of file, -1 for error). */
+ Reads the given number of uncompressed bytes from the compressed file. If
+ the input file was not in gzip format, gzread copies the given number of
+ bytes into the buffer.
+
+ After reaching the end of a gzip stream in the input, gzread will continue
+ to read, looking for another gzip stream, or failing that, reading the rest
+ of the input file directly without decompression. The entire input file
+ will be read if gzread is called until it returns less than the requested
+ len.
+
+ gzread returns the number of uncompressed bytes actually read, less than
+ len for end of file, or -1 for error.
+*/
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- voidpc buf, unsigned len));
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ voidpc buf, unsigned len));
/*
Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes actually written
- (0 in case of error).
+ gzwrite returns the number of uncompressed bytes written or 0 in case of
+ error.
*/
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
/*
- Converts, formats, and writes the args to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written (0 in case of error). The number of
- uncompressed bytes written is limited to 4095. The caller should assure that
- this limit is not exceeded. If it is exceeded, then gzprintf() will return
- return an error (0) with nothing written. In this case, there may also be a
- buffer overflow with unpredictable consequences, which is possible only if
- zlib was compiled with the insecure functions sprintf() or vsprintf()
- because the secure snprintf() or vsnprintf() functions were not available.
+ Converts, formats, and writes the arguments to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written, or 0 in case of error. The number of
+ uncompressed bytes written is limited to 8191, or one less than the buffer
+ size given to gzbuffer(). The caller should assure that this limit is not
+ exceeded. If it is exceeded, then gzprintf() will return an error (0) with
+ nothing written. In this case, there may also be a buffer overflow with
+ unpredictable consequences, which is possible only if zlib was compiled with
+ the insecure functions sprintf() or vsprintf() because the secure snprintf()
+ or vsnprintf() functions were not available. This can be determined using
+ zlibCompileFlags().
*/
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
/*
- Writes the given null-terminated string to the compressed file, excluding
+ Writes the given null-terminated string to the compressed file, excluding
the terminating null character.
- gzputs returns the number of characters written, or -1 in case of error.
+
+ gzputs returns the number of characters written, or -1 in case of error.
*/
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
/*
- Reads bytes from the compressed file until len-1 characters are read, or
- a newline character is read and transferred to buf, or an end-of-file
- condition is encountered. The string is then terminated with a null
- character.
- gzgets returns buf, or Z_NULL in case of error.
+ Reads bytes from the compressed file until len-1 characters are read, or a
+ newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. If any characters are read or if len == 1, the
+ string is terminated with a null character. If no characters are read due
+ to an end-of-file or len < 1, then the buffer is left untouched.
+
+ gzgets returns buf which is a null-terminated string, or it returns NULL
+ for end-of-file or in case of error. If there was an error, the contents at
+ buf are indeterminate.
*/
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
/*
- Writes c, converted to an unsigned char, into the compressed file.
- gzputc returns the value that was written, or -1 in case of error.
+ Writes c, converted to an unsigned char, into the compressed file. gzputc
+ returns the value that was written, or -1 in case of error.
*/
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
/*
- Reads one byte from the compressed file. gzgetc returns this byte
- or -1 in case of end of file or error.
+ Reads one byte from the compressed file. gzgetc returns this byte or -1
+ in case of end of file or error.
*/
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
/*
- Push one character back onto the stream to be read again later.
- Only one character of push-back is allowed. gzungetc() returns the
- character pushed, or -1 on failure. gzungetc() will fail if a
- character has been pushed but not read yet, or if c is -1. The pushed
- character will be discarded if the stream is repositioned with gzseek()
- or gzrewind().
+ Push one character back onto the stream to be read as the first character
+ on the next read. At least one character of push-back is allowed.
+ gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
+ fail if c is -1, and may fail if a character has been pushed but not read
+ yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
+ output buffer size of pushed characters is allowed. (See gzbuffer above.)
+ The pushed character will be discarded if the stream is repositioned with
+ gzseek() or gzrewind().
*/
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
/*
- Flushes all pending output into the compressed file. The parameter
- flush is as in the deflate() function. The return value is the zlib
- error number (see function gzerror below). gzflush returns Z_OK if
- the flush parameter is Z_FINISH and all output could be flushed.
- gzflush should be called only when strictly necessary because it can
- degrade compression.
+ Flushes all pending output into the compressed file. The parameter flush
+ is as in the deflate() function. The return value is the zlib error number
+ (see function gzerror below). gzflush is only permitted when writing.
+
+ If the flush parameter is Z_FINISH, the remaining data is written and the
+ gzip stream is completed in the output. If gzwrite() is called again, a new
+ gzip stream will be started in the output. gzread() is able to read such
+ concatented gzip streams.
+
+ gzflush should be called only when strictly necessary because it will
+ degrade compression if called too often.
*/
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
/*
- Sets the starting position for the next gzread or gzwrite on the
- given compressed file. The offset represents a number of bytes in the
- uncompressed data stream. The whence parameter is defined as in lseek(2);
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+
+ Sets the starting position for the next gzread or gzwrite on the given
+ compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
the value SEEK_END is not supported.
+
If the file is opened for reading, this function is emulated but can be
- extremely slow. If the file is opened for writing, only forward seeks are
+ extremely slow. If the file is opened for writing, only forward seeks are
supported; gzseek then compresses a sequence of zeroes up to the new
starting position.
- gzseek returns the resulting offset location as measured in bytes from
+ gzseek returns the resulting offset location as measured in bytes from
the beginning of the uncompressed stream, or -1 in case of error, in
particular if the file is opened for writing and the new starting position
would be before the current position.
@@ -1202,68 +1355,127 @@ ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
/*
Rewinds the given file. This function is supported only for reading.
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
*/
+/*
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+
+ Returns the starting position for the next gzread or gzwrite on the given
+ compressed file. This position represents a number of bytes in the
+ uncompressed data stream, and is zero when starting, even if appending or
+ reading a gzip stream from the middle of a file using gzdopen().
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
/*
- Returns the starting position for the next gzread or gzwrite on the
- given compressed file. This position represents a number of bytes in the
- uncompressed data stream.
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
- gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+ Returns the current offset in the file being read or written. This offset
+ includes the count of bytes that precede the gzip stream, for example when
+ appending or when using gzdopen() for reading. When reading, the offset
+ does not include as yet unused buffered input. This information can be used
+ for a progress indicator. On error, gzoffset() returns -1.
*/
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
/*
- Returns 1 when EOF has previously been detected reading the given
- input stream, otherwise zero.
+ Returns true (1) if the end-of-file indicator has been set while reading,
+ false (0) otherwise. Note that the end-of-file indicator is set only if the
+ read tried to go past the end of the input, but came up short. Therefore,
+ just like feof(), gzeof() may return false even if there is no more data to
+ read, in the event that the last read request was for the exact number of
+ bytes remaining in the input file. This will happen if the input file size
+ is an exact multiple of the buffer size.
+
+ If gzeof() returns true, then the read functions will return no more data,
+ unless the end-of-file indicator is reset by gzclearerr() and the input file
+ has grown since the previous end of file was detected.
*/
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
/*
- Returns 1 if file is being read directly without decompression, otherwise
- zero.
+ Returns true (1) if file is being copied directly while reading, or false
+ (0) if file is a gzip stream being decompressed. This state can change from
+ false to true while reading the input file if the end of a gzip stream is
+ reached, but is followed by data that is not another gzip stream.
+
+ If the input file is empty, gzdirect() will return true, since the input
+ does not contain a gzip stream.
+
+ If gzdirect() is used immediately after gzopen() or gzdopen() it will
+ cause buffers to be allocated to allow reading the file to determine if it
+ is a gzip file. Therefore if gzbuffer() is used, it should be called before
+ gzdirect().
*/
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
/*
- Flushes all pending output if necessary, closes the compressed file
- and deallocates all the (de)compression state. The return value is the zlib
- error number (see function gzerror below).
+ Flushes all pending output if necessary, closes the compressed file and
+ deallocates the (de)compression state. Note that once file is closed, you
+ cannot call gzerror with file, since its structures have been deallocated.
+ gzclose must not be called more than once on the same file, just as free
+ must not be called more than once on the same allocation.
+
+ gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
+ file operation error, or Z_OK on success.
+*/
+
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+/*
+ Same as gzclose(), but gzclose_r() is only for use when reading, and
+ gzclose_w() is only for use when writing or appending. The advantage to
+ using these instead of gzclose() is that they avoid linking in zlib
+ compression or decompression code that is not used when only reading or only
+ writing respectively. If gzclose() is used, then both compression and
+ decompression code will be included the application when linking to a static
+ zlib library.
*/
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
/*
- Returns the error message for the last error which occurred on the
- given compressed file. errnum is set to zlib error number. If an
- error occurred in the file system and not in the compression library,
- errnum is set to Z_ERRNO and the application may consult errno
- to get the exact error code.
+ Returns the error message for the last error which occurred on the given
+ compressed file. errnum is set to zlib error number. If an error occurred
+ in the file system and not in the compression library, errnum is set to
+ Z_ERRNO and the application may consult errno to get the exact error code.
+
+ The application must not modify the returned string. Future calls to
+ this function may invalidate the previously returned string. If file is
+ closed, then the string previously returned by gzerror will no longer be
+ available.
+
+ gzerror() should be used to distinguish errors from end-of-file for those
+ functions above that do not distinguish those cases in their return values.
*/
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
/*
- Clears the error and end-of-file flags for file. This is analogous to the
- clearerr() function in stdio. This is useful for continuing to read a gzip
+ Clears the error and end-of-file flags for file. This is analogous to the
+ clearerr() function in stdio. This is useful for continuing to read a gzip
file that is being written concurrently.
*/
+
/* checksum functions */
/*
These functions are not related to compression but are exported
- anyway because they might be useful in applications using the
- compression library.
+ anyway because they might be useful in applications using the compression
+ library.
*/
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is NULL, this function returns
- the required initial value for the checksum.
- An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
- much faster. Usage example:
+ return the updated checksum. If buf is Z_NULL, this function returns the
+ required initial value for the checksum.
+
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster.
+
+ Usage example:
uLong adler = adler32(0L, Z_NULL, 0);
@@ -1273,9 +1485,10 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
if (adler != original_adler) error();
*/
+/*
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
z_off_t len2));
-/*
+
Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
@@ -1285,9 +1498,11 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
Update a running CRC-32 with the bytes buf[0..len-1] and return the
- updated CRC-32. If buf is NULL, this function returns the required initial
- value for the for the crc. Pre- and post-conditioning (one's complement) is
- performed within this function so it shouldn't be done by the application.
+ updated CRC-32. If buf is Z_NULL, this function returns the required
+ initial value for the for the crc. Pre- and post-conditioning (one's
+ complement) is performed within this function so it shouldn't be done by the
+ application.
+
Usage example:
uLong crc = crc32(0L, Z_NULL, 0);
@@ -1298,9 +1513,9 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
if (crc != original_crc) error();
*/
+/*
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
-/*
Combine two CRC-32 check values into one. For two sequences of bytes,
seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
@@ -1339,16 +1554,57 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
#define inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \
- ZLIB_VERSION, sizeof(z_stream))
+ ZLIB_VERSION, sizeof(z_stream))
+/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
+ * both are true, the application gets the *64 functions, and the regular
+ * functions are changed to 64 bits) -- in case these are set on systems
+ * without large file support, _LFS64_LARGEFILE must also be true
+ */
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+ ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+#endif
+
+#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
+# define gzopen gzopen64
+# define gzseek gzseek64
+# define gztell gztell64
+# define gzoffset gzoffset64
+# define adler32_combine adler32_combine64
+# define crc32_combine crc32_combine64
+# ifdef _LARGEFILE64_SOURCE
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+# endif
+#else
+ ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+#endif
+/* hack for buggy compilers */
#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
- struct internal_state {int dummy;}; /* hack for buggy compilers */
+ struct internal_state {int dummy;};
#endif
+/* undocumented functions */
ZEXTERN const char * ZEXPORT zError OF((int));
-ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
+ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
#ifdef __cplusplus
}
diff --git a/Modules/zlib/zlib.map b/Modules/zlib/zlib.map
new file mode 100644
index 0000000000..f282d3624a
--- /dev/null
+++ b/Modules/zlib/zlib.map
@@ -0,0 +1,68 @@
+ZLIB_1.2.0 {
+ global:
+ compressBound;
+ deflateBound;
+ inflateBack;
+ inflateBackEnd;
+ inflateBackInit_;
+ inflateCopy;
+ local:
+ deflate_copyright;
+ inflate_copyright;
+ inflate_fast;
+ inflate_table;
+ zcalloc;
+ zcfree;
+ z_errmsg;
+ gz_error;
+ gz_intmax;
+ _*;
+};
+
+ZLIB_1.2.0.2 {
+ gzclearerr;
+ gzungetc;
+ zlibCompileFlags;
+} ZLIB_1.2.0;
+
+ZLIB_1.2.0.8 {
+ deflatePrime;
+} ZLIB_1.2.0.2;
+
+ZLIB_1.2.2 {
+ adler32_combine;
+ crc32_combine;
+ deflateSetHeader;
+ inflateGetHeader;
+} ZLIB_1.2.0.8;
+
+ZLIB_1.2.2.3 {
+ deflateTune;
+ gzdirect;
+} ZLIB_1.2.2;
+
+ZLIB_1.2.2.4 {
+ inflatePrime;
+} ZLIB_1.2.2.3;
+
+ZLIB_1.2.3.3 {
+ adler32_combine64;
+ crc32_combine64;
+ gzopen64;
+ gzseek64;
+ gztell64;
+ inflateUndermine;
+} ZLIB_1.2.2.4;
+
+ZLIB_1.2.3.4 {
+ inflateReset2;
+ inflateMark;
+} ZLIB_1.2.3.3;
+
+ZLIB_1.2.3.5 {
+ gzbuffer;
+ gzoffset;
+ gzoffset64;
+ gzclose_r;
+ gzclose_w;
+} ZLIB_1.2.3.4;
diff --git a/Modules/zlib/zlib.pc.in b/Modules/zlib/zlib.pc.in
new file mode 100644
index 0000000000..7e5acf9c77
--- /dev/null
+++ b/Modules/zlib/zlib.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+sharedlibdir=@sharedlibdir@
+includedir=@includedir@
+
+Name: zlib
+Description: zlib compression library
+Version: @VERSION@
+
+Requires:
+Libs: -L${libdir} -L${sharedlibdir} -lz
+Cflags: -I${includedir}
diff --git a/Modules/zlib/zutil.c b/Modules/zlib/zutil.c
index d55f5948a3..898ed345b0 100644
--- a/Modules/zlib/zutil.c
+++ b/Modules/zlib/zutil.c
@@ -1,5 +1,5 @@
/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2005, 2010 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -34,25 +34,25 @@ uLong ZEXPORT zlibCompileFlags()
uLong flags;
flags = 0;
- switch (sizeof(uInt)) {
+ switch ((int)(sizeof(uInt))) {
case 2: break;
case 4: flags += 1; break;
case 8: flags += 2; break;
default: flags += 3;
}
- switch (sizeof(uLong)) {
+ switch ((int)(sizeof(uLong))) {
case 2: break;
case 4: flags += 1 << 2; break;
case 8: flags += 2 << 2; break;
default: flags += 3 << 2;
}
- switch (sizeof(voidpf)) {
+ switch ((int)(sizeof(voidpf))) {
case 2: break;
case 4: flags += 1 << 4; break;
case 8: flags += 2 << 4; break;
default: flags += 3 << 4;
}
- switch (sizeof(z_off_t)) {
+ switch ((int)(sizeof(z_off_t))) {
case 2: break;
case 4: flags += 1 << 6; break;
case 8: flags += 2 << 6; break;
@@ -117,9 +117,9 @@ uLong ZEXPORT zlibCompileFlags()
# ifndef verbose
# define verbose 0
# endif
-int z_verbose = verbose;
+int ZLIB_INTERNAL z_verbose = verbose;
-void z_error (m)
+void ZLIB_INTERNAL z_error (m)
char *m;
{
fprintf(stderr, "%s\n", m);
@@ -146,7 +146,7 @@ const char * ZEXPORT zError(err)
#ifndef HAVE_MEMCPY
-void zmemcpy(dest, source, len)
+void ZLIB_INTERNAL zmemcpy(dest, source, len)
Bytef* dest;
const Bytef* source;
uInt len;
@@ -157,7 +157,7 @@ void zmemcpy(dest, source, len)
} while (--len != 0);
}
-int zmemcmp(s1, s2, len)
+int ZLIB_INTERNAL zmemcmp(s1, s2, len)
const Bytef* s1;
const Bytef* s2;
uInt len;
@@ -170,7 +170,7 @@ int zmemcmp(s1, s2, len)
return 0;
}
-void zmemzero(dest, len)
+void ZLIB_INTERNAL zmemzero(dest, len)
Bytef* dest;
uInt len;
{
@@ -213,7 +213,7 @@ local ptr_table table[MAX_PTR];
* a protected system like OS/2. Use Microsoft C instead.
*/
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
{
voidpf buf = opaque; /* just to make some compilers happy */
ulg bsize = (ulg)items*size;
@@ -237,7 +237,7 @@ voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
return buf;
}
-void zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
{
int n;
if (*(ush*)&ptr != 0) { /* object < 64K */
@@ -272,13 +272,13 @@ void zcfree (voidpf opaque, voidpf ptr)
# define _hfree hfree
#endif
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
{
if (opaque) opaque = 0; /* to make compiler happy */
return _halloc((long)items, size);
}
-void zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
{
if (opaque) opaque = 0; /* to make compiler happy */
_hfree(ptr);
@@ -297,7 +297,7 @@ extern voidp calloc OF((uInt items, uInt size));
extern void free OF((voidpf ptr));
#endif
-voidpf zcalloc (opaque, items, size)
+voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
voidpf opaque;
unsigned items;
unsigned size;
@@ -307,7 +307,7 @@ voidpf zcalloc (opaque, items, size)
(voidpf)calloc(items, size);
}
-void zcfree (opaque, ptr)
+void ZLIB_INTERNAL zcfree (opaque, ptr)
voidpf opaque;
voidpf ptr;
{
diff --git a/Modules/zlib/zutil.h b/Modules/zlib/zutil.h
index 34646ebf1a..258fa88799 100644
--- a/Modules/zlib/zutil.h
+++ b/Modules/zlib/zutil.h
@@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2010 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -13,31 +13,21 @@
#ifndef ZUTIL_H
#define ZUTIL_H
-#define ZLIB_INTERNAL
+#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+# define ZLIB_INTERNAL
+#endif
+
#include "zlib.h"
#ifdef STDC
-# ifndef _WIN32_WCE
+# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
# include <stddef.h>
# endif
# include <string.h>
# include <stdlib.h>
#endif
-#ifdef NO_ERRNO_H
-# ifdef _WIN32_WCE
- /* The Microsoft C Run-Time Library for Windows CE doesn't have
- * errno. We define it as a global variable to simplify porting.
- * Its value is always 0 and should not be used. We rename it to
- * avoid conflict with other libraries that use the same workaround.
- */
-# define errno z_errno
-# endif
- extern int errno;
-#else
-# ifndef _WIN32_WCE
-# include <errno.h>
-# endif
-#endif
#ifndef local
# define local static
@@ -89,7 +79,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
# define OS_CODE 0x00
# if defined(__TURBOC__) || defined(__BORLANDC__)
-# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
/* Allow compilation with ANSI keywords only enabled */
void _Cdecl farfree( void *block );
void *_Cdecl farmalloc( unsigned long nbytes );
@@ -118,7 +108,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#ifdef OS2
# define OS_CODE 0x06
# ifdef M_I86
- #include <malloc.h>
+# include <malloc.h>
# endif
#endif
@@ -147,11 +137,11 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define OS_CODE 0x0f
#endif
-#if defined(_BEOS_)
+#if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
-#if (defined(_MSC_VER) && (_MSC_VER > 600))
+#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
# if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */
# ifndef _PTRDIFF_T_DEFINED
@@ -163,6 +153,18 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
#endif
+#if defined(__BORLANDC__)
+ #pragma warn -8004
+ #pragma warn -8008
+ #pragma warn -8066
+#endif
+
+/* provide prototypes for these when building zlib without LFS */
+#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+#endif
+
/* common defaults */
#ifndef OS_CODE
@@ -197,7 +199,9 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# ifdef WIN32
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
-# define vsnprintf _vsnprintf
+# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
+# define vsnprintf _vsnprintf
+# endif
# endif
# endif
# ifdef __SASC
@@ -232,16 +236,16 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
- extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
- extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
- extern void zmemzero OF((Bytef* dest, uInt len));
+ void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+ int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+ void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
#endif
/* Diagnostic functions */
#ifdef DEBUG
# include <stdio.h>
- extern int z_verbose;
- extern void z_error OF((char *m));
+ extern int ZLIB_INTERNAL z_verbose;
+ extern void ZLIB_INTERNAL z_error OF((char *m));
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
@@ -258,8 +262,9 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
-voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
-void zcfree OF((voidpf opaque, voidpf ptr));
+voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+ unsigned size));
+void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
#define ZALLOC(strm, items, size) \
(*((strm)->zalloc))((strm)->opaque, (items), (size))
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index c78cf42d1d..206ef0c6d8 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -117,14 +117,21 @@ PyZlib_compress(PyObject *self, PyObject *args)
PyObject *ReturnVal = NULL;
Py_buffer pinput;
Byte *input, *output;
- int length, level=Z_DEFAULT_COMPRESSION, err;
+ unsigned int length;
+ int level=Z_DEFAULT_COMPRESSION, err;
z_stream zst;
/* require Python string object, optional 'level' arg */
if (!PyArg_ParseTuple(args, "y*|i:compress", &pinput, &level))
return NULL;
- input = pinput.buf;
+
+ if (pinput.len > UINT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "size does not fit in an unsigned int");
+ return NULL;
+ }
length = pinput.len;
+ input = pinput.buf;
zst.avail_out = length + length/1000 + 12 + 1;
@@ -199,7 +206,8 @@ PyZlib_decompress(PyObject *self, PyObject *args)
PyObject *result_str;
Py_buffer pinput;
Byte *input;
- int length, err;
+ unsigned int length;
+ int err;
int wsize=DEF_WBITS;
Py_ssize_t r_strlen=DEFAULTALLOC;
z_stream zst;
@@ -207,8 +215,14 @@ PyZlib_decompress(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "y*|in:decompress",
&pinput, &wsize, &r_strlen))
return NULL;
- input = pinput.buf;
+
+ if (pinput.len > UINT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "size does not fit in an unsigned int");
+ return NULL;
+ }
length = pinput.len;
+ input = pinput.buf;
if (r_strlen <= 0)
r_strlen = 1;
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 2d4f2e1772..2f887aa056 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -693,48 +693,37 @@ PyBuffer_Release(Py_buffer *view)
PyObject *
PyObject_Format(PyObject *obj, PyObject *format_spec)
{
- static PyObject * str__format__ = NULL;
PyObject *meth;
PyObject *empty = NULL;
PyObject *result = NULL;
-
- /* Initialize cached value */
- if (str__format__ == NULL) {
- /* Initialize static variable needed by _PyType_Lookup */
- str__format__ = PyUnicode_FromString("__format__");
- if (str__format__ == NULL)
- goto done;
- }
+ static PyObject *format_cache = NULL;
/* If no format_spec is provided, use an empty string */
if (format_spec == NULL) {
- empty = PyUnicode_FromUnicode(NULL, 0);
- format_spec = empty;
+ empty = PyUnicode_FromUnicode(NULL, 0);
+ format_spec = empty;
}
- /* Make sure the type is initialized. float gets initialized late */
- if (Py_TYPE(obj)->tp_dict == NULL)
- if (PyType_Ready(Py_TYPE(obj)) < 0)
- goto done;
-
/* Find the (unbound!) __format__ method (a borrowed reference) */
- meth = _PyType_Lookup(Py_TYPE(obj), str__format__);
+ meth = _PyObject_LookupSpecial(obj, "__format__", &format_cache);
if (meth == NULL) {
- PyErr_Format(PyExc_TypeError,
- "Type %.100s doesn't define __format__",
- Py_TYPE(obj)->tp_name);
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_TypeError,
+ "Type %.100s doesn't define __format__",
+ Py_TYPE(obj)->tp_name);
goto done;
}
- /* And call it, binding it to the value */
- result = PyObject_CallFunctionObjArgs(meth, obj, format_spec, NULL);
+ /* And call it. */
+ result = PyObject_CallFunctionObjArgs(meth, format_spec, NULL);
+ Py_DECREF(meth);
if (result && !PyUnicode_Check(result)) {
- PyErr_SetString(PyExc_TypeError,
- "__format__ method did not return string");
- Py_DECREF(result);
- result = NULL;
- goto done;
+ PyErr_SetString(PyExc_TypeError,
+ "__format__ method did not return string");
+ Py_DECREF(result);
+ result = NULL;
+ goto done;
}
done:
@@ -1453,7 +1442,7 @@ PyNumber_ToBase(PyObject *n, int base)
int
PySequence_Check(PyObject *s)
{
- if (PyObject_IsInstance(s, (PyObject *)&PyDict_Type))
+ if (PyDict_Check(s))
return 0;
return s != NULL && s->ob_type->tp_as_sequence &&
s->ob_type->tp_as_sequence->sq_item != NULL;
@@ -2322,15 +2311,7 @@ objargs_mktuple(va_list va)
va_list countva;
PyObject *result, *tmp;
-#ifdef VA_LIST_IS_ARRAY
- memcpy(countva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(countva, va);
-#else
- countva = va;
-#endif
-#endif
+ Py_VA_COPY(countva, va);
while (((PyObject *)va_arg(countva, PyObject *)) != NULL)
++n;
@@ -2519,7 +2500,10 @@ recursive_isinstance(PyObject *inst, PyObject *cls)
if (retval == 0) {
PyObject *c = PyObject_GetAttr(inst, __class__);
if (c == NULL) {
- PyErr_Clear();
+ if (PyErr_ExceptionMatches(PyExc_AttributeError))
+ PyErr_Clear();
+ else
+ retval = -1;
}
else {
if (c != (PyObject *)(inst->ob_type) &&
@@ -2537,8 +2521,10 @@ recursive_isinstance(PyObject *inst, PyObject *cls)
return -1;
icls = PyObject_GetAttr(inst, __class__);
if (icls == NULL) {
- PyErr_Clear();
- retval = 0;
+ if (PyErr_ExceptionMatches(PyExc_AttributeError))
+ PyErr_Clear();
+ else
+ retval = -1;
}
else {
retval = abstract_issubclass(icls, cls);
@@ -2721,3 +2707,66 @@ PyIter_Next(PyObject *iter)
PyErr_Clear();
return result;
}
+
+
+/*
+ * Flatten a sequence of bytes() objects into a C array of
+ * NULL terminated string pointers with a NULL char* terminating the array.
+ * (ie: an argv or env list)
+ *
+ * Memory allocated for the returned list is allocated using malloc() and MUST
+ * be freed by the caller using a free() loop or _Py_FreeCharPArray().
+ */
+char *const *
+_PySequence_BytesToCharpArray(PyObject* self)
+{
+ char **array;
+ Py_ssize_t i, argc;
+ PyObject *item = NULL;
+
+ argc = PySequence_Size(self);
+ if (argc == -1)
+ return NULL;
+
+ array = malloc((argc + 1) * sizeof(char *));
+ if (array == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ for (i = 0; i < argc; ++i) {
+ char *data;
+ item = PySequence_GetItem(self, i);
+ data = PyBytes_AsString(item);
+ if (data == NULL) {
+ /* NULL terminate before freeing. */
+ array[i] = NULL;
+ goto fail;
+ }
+ array[i] = strdup(data);
+ if (!array[i]) {
+ PyErr_NoMemory();
+ goto fail;
+ }
+ Py_DECREF(item);
+ }
+ array[argc] = NULL;
+
+ return array;
+
+fail:
+ Py_XDECREF(item);
+ _Py_FreeCharPArray(array);
+ return NULL;
+}
+
+
+/* Free's a NULL terminated char** array of C strings. */
+void
+_Py_FreeCharPArray(char *const array[])
+{
+ Py_ssize_t i;
+ for (i = 0; array[i] != NULL; ++i) {
+ free(array[i]);
+ }
+ free((void*)array);
+}
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 27affb53d2..7a7410405e 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -5,24 +5,16 @@
#include "structmember.h"
#include "bytes_methods.h"
-static PyByteArrayObject *nullbytes = NULL;
char _PyByteArray_empty_string[] = "";
void
PyByteArray_Fini(void)
{
- Py_CLEAR(nullbytes);
}
int
PyByteArray_Init(void)
{
- nullbytes = PyObject_New(PyByteArrayObject, &PyByteArray_Type);
- if (nullbytes == NULL)
- return 0;
- nullbytes->ob_bytes = NULL;
- Py_SIZE(nullbytes) = nullbytes->ob_alloc = 0;
- nullbytes->ob_exports = 0;
return 1;
}
@@ -41,6 +33,7 @@ _getbytevalue(PyObject* arg, int *value)
PyObject *index = PyNumber_Index(arg);
if (index == NULL) {
PyErr_Format(PyExc_TypeError, "an integer is required");
+ *value = -1;
return 0;
}
face_value = PyLong_AsLong(index);
@@ -50,6 +43,7 @@ _getbytevalue(PyObject* arg, int *value)
if (face_value < 0 || face_value >= 256) {
/* this includes the OverflowError in case the long is too large */
PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)");
+ *value = -1;
return 0;
}
@@ -316,9 +310,9 @@ bytearray_repeat(PyByteArrayObject *self, Py_ssize_t count)
if (count < 0)
count = 0;
mysize = Py_SIZE(self);
- size = mysize * count;
- if (count != 0 && size / count != mysize)
+ if (count > 0 && mysize > PY_SSIZE_T_MAX / count)
return PyErr_NoMemory();
+ size = mysize * count;
result = (PyByteArrayObject *)PyByteArray_FromStringAndSize(NULL, size);
if (result != NULL && size != 0) {
if (mysize == 1)
@@ -341,9 +335,9 @@ bytearray_irepeat(PyByteArrayObject *self, Py_ssize_t count)
if (count < 0)
count = 0;
mysize = Py_SIZE(self);
- size = mysize * count;
- if (count != 0 && size / count != mysize)
+ if (count > 0 && mysize > PY_SSIZE_T_MAX / count)
return PyErr_NoMemory();
+ size = mysize * count;
if (size < self->ob_alloc) {
Py_SIZE(self) = size;
self->ob_bytes[Py_SIZE(self)] = '\0'; /* Trailing null byte */
@@ -395,7 +389,7 @@ bytearray_subscript(PyByteArrayObject *self, PyObject *index)
}
else if (PySlice_Check(index)) {
Py_ssize_t start, stop, step, slicelength, cur, i;
- if (PySlice_GetIndicesEx((PySliceObject *)index,
+ if (PySlice_GetIndicesEx(index,
PyByteArray_GET_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
@@ -579,7 +573,7 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu
}
}
else if (PySlice_Check(index)) {
- if (PySlice_GetIndicesEx((PySliceObject *)index,
+ if (PySlice_GetIndicesEx(index,
PyByteArray_GET_SIZE(self),
&start, &stop, &step, &slicelen) < 0) {
return -1;
@@ -655,6 +649,11 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu
if (!_canresize(self))
return -1;
+
+ if (slicelen == 0)
+ /* Nothing to do here. */
+ return 0;
+
if (step < 0) {
stop = start + 1;
start = stop + step * (slicelen - 1) - 1;
@@ -671,7 +670,7 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu
self->ob_bytes + cur + 1, lim);
}
/* Move the tail of the bytes, in one chunk */
- cur = start + slicelen*step;
+ cur = start + (size_t)slicelen*step;
if (cur < (size_t)PyByteArray_GET_SIZE(self)) {
memmove(self->ob_bytes + cur - slicelen,
self->ob_bytes + cur,
@@ -685,7 +684,8 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu
}
else {
/* Assign slice */
- Py_ssize_t cur, i;
+ Py_ssize_t i;
+ size_t cur;
if (needed != slicelen) {
PyErr_Format(PyExc_ValueError,
@@ -1038,19 +1038,19 @@ bytearray_dealloc(PyByteArrayObject *self)
/* Methods */
#define STRINGLIB_CHAR char
-#define STRINGLIB_CMP memcmp
#define STRINGLIB_LEN PyByteArray_GET_SIZE
#define STRINGLIB_STR PyByteArray_AS_STRING
#define STRINGLIB_NEW PyByteArray_FromStringAndSize
-#define STRINGLIB_EMPTY nullbytes
+#define STRINGLIB_ISSPACE Py_ISSPACE
+#define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r'))
#define STRINGLIB_CHECK_EXACT PyByteArray_CheckExact
#define STRINGLIB_MUTABLE 1
-#define FROM_BYTEARRAY 1
#include "stringlib/fastsearch.h"
#include "stringlib/count.h"
#include "stringlib/find.h"
#include "stringlib/partition.h"
+#include "stringlib/split.h"
#include "stringlib/ctype.h"
#include "stringlib/transmogrify.h"
@@ -1058,21 +1058,20 @@ bytearray_dealloc(PyByteArrayObject *self)
/* The following Py_LOCAL_INLINE and Py_LOCAL functions
were copied from the old char* style string object. */
-Py_LOCAL_INLINE(void)
-_adjust_indices(Py_ssize_t *start, Py_ssize_t *end, Py_ssize_t len)
-{
- if (*end > len)
- *end = len;
- else if (*end < 0)
- *end += len;
- if (*end < 0)
- *end = 0;
- if (*start < 0)
- *start += len;
- if (*start < 0)
- *start = 0;
-}
-
+/* helper macro to fixup start/end slice values */
+#define ADJUST_INDICES(start, end, len) \
+ if (end > len) \
+ end = len; \
+ else if (end < 0) { \
+ end += len; \
+ if (end < 0) \
+ end = 0; \
+ } \
+ if (start < 0) { \
+ start += len; \
+ if (start < 0) \
+ start = 0; \
+ }
Py_LOCAL_INLINE(Py_ssize_t)
bytearray_find_internal(PyByteArrayObject *self, PyObject *args, int dir)
@@ -1139,10 +1138,10 @@ bytearray_count(PyByteArrayObject *self, PyObject *args)
if (_getbuffer(sub_obj, &vsub) < 0)
return NULL;
- _adjust_indices(&start, &end, PyByteArray_GET_SIZE(self));
+ ADJUST_INDICES(start, end, PyByteArray_GET_SIZE(self));
count_obj = PyLong_FromSsize_t(
- stringlib_count(str + start, end - start, vsub.buf, vsub.len)
+ stringlib_count(str + start, end - start, vsub.buf, vsub.len, PY_SSIZE_T_MAX)
);
PyBuffer_Release(&vsub);
return count_obj;
@@ -1250,7 +1249,7 @@ _bytearray_tailmatch(PyByteArrayObject *self, PyObject *substr, Py_ssize_t start
if (_getbuffer(substr, &vsubstr) < 0)
return -1;
- _adjust_indices(&start, &end, len);
+ ADJUST_INDICES(start, end, len);
if (direction < 0) {
/* startswith */
@@ -1468,20 +1467,11 @@ bytearray_maketrans(PyObject *null, PyObject *args)
}
-#define FORWARD 1
-#define REVERSE -1
-
/* find and count characters and substrings */
#define findchar(target, target_len, c) \
((char *)memchr((const void *)(target), c, target_len))
-/* Don't call if length < 2 */
-#define Py_STRING_MATCH(target, offset, pattern, length) \
- (target[offset] == pattern[0] && \
- target[offset+length-1] == pattern[length-1] && \
- !memcmp(target+offset+1, pattern+1, length-2) )
-
/* Bytes ops must return a string, create a copy */
Py_LOCAL(PyByteArrayObject *)
@@ -1509,93 +1499,6 @@ countchar(const char *target, Py_ssize_t target_len, char c, Py_ssize_t maxcount
return count;
}
-Py_LOCAL(Py_ssize_t)
-findstring(const char *target, Py_ssize_t target_len,
- const char *pattern, Py_ssize_t pattern_len,
- Py_ssize_t start,
- Py_ssize_t end,
- int direction)
-{
- if (start < 0) {
- start += target_len;
- if (start < 0)
- start = 0;
- }
- if (end > target_len) {
- end = target_len;
- } else if (end < 0) {
- end += target_len;
- if (end < 0)
- end = 0;
- }
-
- /* zero-length substrings always match at the first attempt */
- if (pattern_len == 0)
- return (direction > 0) ? start : end;
-
- end -= pattern_len;
-
- if (direction < 0) {
- for (; end >= start; end--)
- if (Py_STRING_MATCH(target, end, pattern, pattern_len))
- return end;
- } else {
- for (; start <= end; start++)
- if (Py_STRING_MATCH(target, start, pattern, pattern_len))
- return start;
- }
- return -1;
-}
-
-Py_LOCAL_INLINE(Py_ssize_t)
-countstring(const char *target, Py_ssize_t target_len,
- const char *pattern, Py_ssize_t pattern_len,
- Py_ssize_t start,
- Py_ssize_t end,
- int direction, Py_ssize_t maxcount)
-{
- Py_ssize_t count=0;
-
- if (start < 0) {
- start += target_len;
- if (start < 0)
- start = 0;
- }
- if (end > target_len) {
- end = target_len;
- } else if (end < 0) {
- end += target_len;
- if (end < 0)
- end = 0;
- }
-
- /* zero-length substrings match everywhere */
- if (pattern_len == 0 || maxcount == 0) {
- if (target_len+1 < maxcount)
- return target_len+1;
- return maxcount;
- }
-
- end -= pattern_len;
- if (direction < 0) {
- for (; (end >= start); end--)
- if (Py_STRING_MATCH(target, end, pattern, pattern_len)) {
- count++;
- if (--maxcount <= 0) break;
- end -= pattern_len-1;
- }
- } else {
- for (; (start <= end); start++)
- if (Py_STRING_MATCH(target, start, pattern, pattern_len)) {
- count++;
- if (--maxcount <= 0)
- break;
- start += pattern_len-1;
- }
- }
- return count;
-}
-
/* Algorithms for different cases of string replacement */
@@ -1607,30 +1510,28 @@ replace_interleave(PyByteArrayObject *self,
{
char *self_s, *result_s;
Py_ssize_t self_len, result_len;
- Py_ssize_t count, i, product;
+ Py_ssize_t count, i;
PyByteArrayObject *result;
self_len = PyByteArray_GET_SIZE(self);
- /* 1 at the end plus 1 after every character */
- count = self_len+1;
- if (maxcount < count)
+ /* 1 at the end plus 1 after every character;
+ count = min(maxcount, self_len + 1) */
+ if (maxcount <= self_len)
count = maxcount;
+ else
+ /* Can't overflow: self_len + 1 <= maxcount <= PY_SSIZE_T_MAX. */
+ count = self_len + 1;
/* Check for overflow */
/* result_len = count * to_len + self_len; */
- product = count * to_len;
- if (product / to_len != count) {
- PyErr_SetString(PyExc_OverflowError,
- "replace string is too long");
- return NULL;
- }
- result_len = product + self_len;
- if (result_len < 0) {
+ assert(count > 0);
+ if (to_len > (PY_SSIZE_T_MAX - self_len) / count) {
PyErr_SetString(PyExc_OverflowError,
"replace string is too long");
return NULL;
}
+ result_len = count * to_len + self_len;
if (! (result = (PyByteArrayObject *)
PyByteArray_FromStringAndSize(NULL, result_len)) )
@@ -1717,10 +1618,9 @@ replace_delete_substring(PyByteArrayObject *self,
self_len = PyByteArray_GET_SIZE(self);
self_s = PyByteArray_AS_STRING(self);
- count = countstring(self_s, self_len,
- from_s, from_len,
- 0, self_len, 1,
- maxcount);
+ count = stringlib_count(self_s, self_len,
+ from_s, from_len,
+ maxcount);
if (count == 0) {
/* no matches */
@@ -1739,9 +1639,9 @@ replace_delete_substring(PyByteArrayObject *self,
start = self_s;
end = self_s + self_len;
while (count-- > 0) {
- offset = findstring(start, end-start,
- from_s, from_len,
- 0, end-start, FORWARD);
+ offset = stringlib_find(start, end-start,
+ from_s, from_len,
+ 0);
if (offset == -1)
break;
next = start + offset;
@@ -1817,9 +1717,9 @@ replace_substring_in_place(PyByteArrayObject *self,
self_s = PyByteArray_AS_STRING(self);
self_len = PyByteArray_GET_SIZE(self);
- offset = findstring(self_s, self_len,
- from_s, from_len,
- 0, self_len, FORWARD);
+ offset = stringlib_find(self_s, self_len,
+ from_s, from_len,
+ 0);
if (offset == -1) {
/* No matches; return the original bytes */
return return_self(self);
@@ -1839,9 +1739,9 @@ replace_substring_in_place(PyByteArrayObject *self,
end = result_s + self_len;
while ( --maxcount > 0) {
- offset = findstring(start, end-start,
- from_s, from_len,
- 0, end-start, FORWARD);
+ offset = stringlib_find(start, end-start,
+ from_s, from_len,
+ 0);
if (offset==-1)
break;
Py_MEMCPY(start+offset, to_s, from_len);
@@ -1861,7 +1761,7 @@ replace_single_character(PyByteArrayObject *self,
char *self_s, *result_s;
char *start, *next, *end;
Py_ssize_t self_len, result_len;
- Py_ssize_t count, product;
+ Py_ssize_t count;
PyByteArrayObject *result;
self_s = PyByteArray_AS_STRING(self);
@@ -1875,16 +1775,12 @@ replace_single_character(PyByteArrayObject *self,
/* use the difference between current and new, hence the "-1" */
/* result_len = self_len + count * (to_len-1) */
- product = count * (to_len-1);
- if (product / (to_len-1) != count) {
+ assert(count > 0);
+ if (to_len - 1 > (PY_SSIZE_T_MAX - self_len) / count) {
PyErr_SetString(PyExc_OverflowError, "replace bytes is too long");
return NULL;
}
- result_len = self_len + product;
- if (result_len < 0) {
- PyErr_SetString(PyExc_OverflowError, "replace bytes is too long");
- return NULL;
- }
+ result_len = self_len + count * (to_len - 1);
if ( (result = (PyByteArrayObject *)
PyByteArray_FromStringAndSize(NULL, result_len)) == NULL)
@@ -1928,15 +1824,16 @@ replace_substring(PyByteArrayObject *self,
char *self_s, *result_s;
char *start, *next, *end;
Py_ssize_t self_len, result_len;
- Py_ssize_t count, offset, product;
+ Py_ssize_t count, offset;
PyByteArrayObject *result;
self_s = PyByteArray_AS_STRING(self);
self_len = PyByteArray_GET_SIZE(self);
- count = countstring(self_s, self_len,
- from_s, from_len,
- 0, self_len, FORWARD, maxcount);
+ count = stringlib_count(self_s, self_len,
+ from_s, from_len,
+ maxcount);
+
if (count == 0) {
/* no matches, return unchanged */
return return_self(self);
@@ -1944,16 +1841,12 @@ replace_substring(PyByteArrayObject *self,
/* Check for overflow */
/* result_len = self_len + count * (to_len-from_len) */
- product = count * (to_len-from_len);
- if (product / (to_len-from_len) != count) {
- PyErr_SetString(PyExc_OverflowError, "replace bytes is too long");
- return NULL;
- }
- result_len = self_len + product;
- if (result_len < 0) {
+ assert(count > 0);
+ if (to_len - from_len > (PY_SSIZE_T_MAX - self_len) / count) {
PyErr_SetString(PyExc_OverflowError, "replace bytes is too long");
return NULL;
}
+ result_len = self_len + count * (to_len - from_len);
if ( (result = (PyByteArrayObject *)
PyByteArray_FromStringAndSize(NULL, result_len)) == NULL)
@@ -1963,9 +1856,9 @@ replace_substring(PyByteArrayObject *self,
start = self_s;
end = self_s + self_len;
while (count-- > 0) {
- offset = findstring(start, end-start,
- from_s, from_len,
- 0, end-start, FORWARD);
+ offset = stringlib_find(start, end-start,
+ from_s, from_len,
+ 0);
if (offset == -1)
break;
next = start+offset;
@@ -2094,123 +1987,6 @@ bytearray_replace(PyByteArrayObject *self, PyObject *args)
return res;
}
-
-/* Overallocate the initial list to reduce the number of reallocs for small
- split sizes. Eg, "A A A A A A A A A A".split() (10 elements) has three
- resizes, to sizes 4, 8, then 16. Most observed string splits are for human
- text (roughly 11 words per line) and field delimited data (usually 1-10
- fields). For large strings the split algorithms are bandwidth limited
- so increasing the preallocation likely will not improve things.*/
-
-#define MAX_PREALLOC 12
-
-/* 5 splits gives 6 elements */
-#define PREALLOC_SIZE(maxsplit) \
- (maxsplit >= MAX_PREALLOC ? MAX_PREALLOC : maxsplit+1)
-
-#define SPLIT_APPEND(data, left, right) \
- str = PyByteArray_FromStringAndSize((data) + (left), \
- (right) - (left)); \
- if (str == NULL) \
- goto onError; \
- if (PyList_Append(list, str)) { \
- Py_DECREF(str); \
- goto onError; \
- } \
- else \
- Py_DECREF(str);
-
-#define SPLIT_ADD(data, left, right) { \
- str = PyByteArray_FromStringAndSize((data) + (left), \
- (right) - (left)); \
- if (str == NULL) \
- goto onError; \
- if (count < MAX_PREALLOC) { \
- PyList_SET_ITEM(list, count, str); \
- } else { \
- if (PyList_Append(list, str)) { \
- Py_DECREF(str); \
- goto onError; \
- } \
- else \
- Py_DECREF(str); \
- } \
- count++; }
-
-/* Always force the list to the expected size. */
-#define FIX_PREALLOC_SIZE(list) Py_SIZE(list) = count
-
-
-Py_LOCAL_INLINE(PyObject *)
-split_char(const char *s, Py_ssize_t len, char ch, Py_ssize_t maxcount)
-{
- register Py_ssize_t i, j, count = 0;
- PyObject *str;
- PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
-
- if (list == NULL)
- return NULL;
-
- i = j = 0;
- while ((j < len) && (maxcount-- > 0)) {
- for(; j < len; j++) {
- /* I found that using memchr makes no difference */
- if (s[j] == ch) {
- SPLIT_ADD(s, i, j);
- i = j = j + 1;
- break;
- }
- }
- }
- if (i <= len) {
- SPLIT_ADD(s, i, len);
- }
- FIX_PREALLOC_SIZE(list);
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
-
-Py_LOCAL_INLINE(PyObject *)
-split_whitespace(const char *s, Py_ssize_t len, Py_ssize_t maxcount)
-{
- register Py_ssize_t i, j, count = 0;
- PyObject *str;
- PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
-
- if (list == NULL)
- return NULL;
-
- for (i = j = 0; i < len; ) {
- /* find a token */
- while (i < len && Py_ISSPACE(s[i]))
- i++;
- j = i;
- while (i < len && !Py_ISSPACE(s[i]))
- i++;
- if (j < i) {
- if (maxcount-- <= 0)
- break;
- SPLIT_ADD(s, j, i);
- while (i < len && Py_ISSPACE(s[i]))
- i++;
- j = i;
- }
- }
- if (j < len) {
- SPLIT_ADD(s, j, len);
- }
- FIX_PREALLOC_SIZE(list);
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
PyDoc_STRVAR(split__doc__,
"B.split([sep[, maxsplit]]) -> list of bytearrays\n\
\n\
@@ -2222,14 +1998,11 @@ If maxsplit is given, at most maxsplit splits are done.");
static PyObject *
bytearray_split(PyByteArrayObject *self, PyObject *args)
{
- Py_ssize_t len = PyByteArray_GET_SIZE(self), n, i, j;
- Py_ssize_t maxsplit = -1, count = 0;
+ Py_ssize_t len = PyByteArray_GET_SIZE(self), n;
+ Py_ssize_t maxsplit = -1;
const char *s = PyByteArray_AS_STRING(self), *sub;
- PyObject *list, *str, *subobj = Py_None;
+ PyObject *list, *subobj = Py_None;
Py_buffer vsub;
-#ifdef USE_FAST
- Py_ssize_t pos;
-#endif
if (!PyArg_ParseTuple(args, "|On:split", &subobj, &maxsplit))
return NULL;
@@ -2237,86 +2010,18 @@ bytearray_split(PyByteArrayObject *self, PyObject *args)
maxsplit = PY_SSIZE_T_MAX;
if (subobj == Py_None)
- return split_whitespace(s, len, maxsplit);
+ return stringlib_split_whitespace((PyObject*) self, s, len, maxsplit);
if (_getbuffer(subobj, &vsub) < 0)
return NULL;
sub = vsub.buf;
n = vsub.len;
- if (n == 0) {
- PyErr_SetString(PyExc_ValueError, "empty separator");
- PyBuffer_Release(&vsub);
- return NULL;
- }
- if (n == 1) {
- list = split_char(s, len, sub[0], maxsplit);
- PyBuffer_Release(&vsub);
- return list;
- }
-
- list = PyList_New(PREALLOC_SIZE(maxsplit));
- if (list == NULL) {
- PyBuffer_Release(&vsub);
- return NULL;
- }
-
-#ifdef USE_FAST
- i = j = 0;
- while (maxsplit-- > 0) {
- pos = fastsearch(s+i, len-i, sub, n, FAST_SEARCH);
- if (pos < 0)
- break;
- j = i+pos;
- SPLIT_ADD(s, i, j);
- i = j + n;
- }
-#else
- i = j = 0;
- while ((j+n <= len) && (maxsplit-- > 0)) {
- for (; j+n <= len; j++) {
- if (Py_STRING_MATCH(s, j, sub, n)) {
- SPLIT_ADD(s, i, j);
- i = j = j + n;
- break;
- }
- }
- }
-#endif
- SPLIT_ADD(s, i, len);
- FIX_PREALLOC_SIZE(list);
+ list = stringlib_split(
+ (PyObject*) self, s, len, sub, n, maxsplit
+ );
PyBuffer_Release(&vsub);
return list;
-
- onError:
- Py_DECREF(list);
- PyBuffer_Release(&vsub);
- return NULL;
-}
-
-/* stringlib's partition shares nullbytes in some cases.
- undo this, we don't want the nullbytes to be shared. */
-static PyObject *
-make_nullbytes_unique(PyObject *result)
-{
- if (result != NULL) {
- int i;
- assert(PyTuple_Check(result));
- assert(PyTuple_GET_SIZE(result) == 3);
- for (i = 0; i < 3; i++) {
- if (PyTuple_GET_ITEM(result, i) == (PyObject *)nullbytes) {
- PyObject *new = PyByteArray_FromStringAndSize(NULL, 0);
- if (new == NULL) {
- Py_DECREF(result);
- result = NULL;
- break;
- }
- Py_DECREF(nullbytes);
- PyTuple_SET_ITEM(result, i, new);
- }
- }
- }
- return result;
}
PyDoc_STRVAR(partition__doc__,
@@ -2343,7 +2048,7 @@ bytearray_partition(PyByteArrayObject *self, PyObject *sep_obj)
);
Py_DECREF(bytesep);
- return make_nullbytes_unique(result);
+ return result;
}
PyDoc_STRVAR(rpartition__doc__,
@@ -2371,81 +2076,7 @@ bytearray_rpartition(PyByteArrayObject *self, PyObject *sep_obj)
);
Py_DECREF(bytesep);
- return make_nullbytes_unique(result);
-}
-
-Py_LOCAL_INLINE(PyObject *)
-rsplit_char(const char *s, Py_ssize_t len, char ch, Py_ssize_t maxcount)
-{
- register Py_ssize_t i, j, count=0;
- PyObject *str;
- PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
-
- if (list == NULL)
- return NULL;
-
- i = j = len - 1;
- while ((i >= 0) && (maxcount-- > 0)) {
- for (; i >= 0; i--) {
- if (s[i] == ch) {
- SPLIT_ADD(s, i + 1, j + 1);
- j = i = i - 1;
- break;
- }
- }
- }
- if (j >= -1) {
- SPLIT_ADD(s, 0, j + 1);
- }
- FIX_PREALLOC_SIZE(list);
- if (PyList_Reverse(list) < 0)
- goto onError;
-
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
-Py_LOCAL_INLINE(PyObject *)
-rsplit_whitespace(const char *s, Py_ssize_t len, Py_ssize_t maxcount)
-{
- register Py_ssize_t i, j, count = 0;
- PyObject *str;
- PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
-
- if (list == NULL)
- return NULL;
-
- for (i = j = len - 1; i >= 0; ) {
- /* find a token */
- while (i >= 0 && Py_ISSPACE(s[i]))
- i--;
- j = i;
- while (i >= 0 && !Py_ISSPACE(s[i]))
- i--;
- if (j > i) {
- if (maxcount-- <= 0)
- break;
- SPLIT_ADD(s, i + 1, j + 1);
- while (i >= 0 && Py_ISSPACE(s[i]))
- i--;
- j = i;
- }
- }
- if (j >= 0) {
- SPLIT_ADD(s, 0, j + 1);
- }
- FIX_PREALLOC_SIZE(list);
- if (PyList_Reverse(list) < 0)
- goto onError;
-
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
+ return result;
}
PyDoc_STRVAR(rsplit__doc__,
@@ -2460,10 +2091,10 @@ If maxsplit is given, at most maxsplit splits are done.");
static PyObject *
bytearray_rsplit(PyByteArrayObject *self, PyObject *args)
{
- Py_ssize_t len = PyByteArray_GET_SIZE(self), n, i, j;
- Py_ssize_t maxsplit = -1, count = 0;
+ Py_ssize_t len = PyByteArray_GET_SIZE(self), n;
+ Py_ssize_t maxsplit = -1;
const char *s = PyByteArray_AS_STRING(self), *sub;
- PyObject *list, *str, *subobj = Py_None;
+ PyObject *list, *subobj = Py_None;
Py_buffer vsub;
if (!PyArg_ParseTuple(args, "|On:rsplit", &subobj, &maxsplit))
@@ -2472,54 +2103,18 @@ bytearray_rsplit(PyByteArrayObject *self, PyObject *args)
maxsplit = PY_SSIZE_T_MAX;
if (subobj == Py_None)
- return rsplit_whitespace(s, len, maxsplit);
+ return stringlib_rsplit_whitespace((PyObject*) self, s, len, maxsplit);
if (_getbuffer(subobj, &vsub) < 0)
return NULL;
sub = vsub.buf;
n = vsub.len;
- if (n == 0) {
- PyErr_SetString(PyExc_ValueError, "empty separator");
- PyBuffer_Release(&vsub);
- return NULL;
- }
- else if (n == 1) {
- list = rsplit_char(s, len, sub[0], maxsplit);
- PyBuffer_Release(&vsub);
- return list;
- }
-
- list = PyList_New(PREALLOC_SIZE(maxsplit));
- if (list == NULL) {
- PyBuffer_Release(&vsub);
- return NULL;
- }
-
- j = len;
- i = j - n;
-
- while ( (i >= 0) && (maxsplit-- > 0) ) {
- for (; i>=0; i--) {
- if (Py_STRING_MATCH(s, i, sub, n)) {
- SPLIT_ADD(s, i + n, j);
- j = i;
- i -= n;
- break;
- }
- }
- }
- SPLIT_ADD(s, 0, j);
- FIX_PREALLOC_SIZE(list);
- if (PyList_Reverse(list) < 0)
- goto onError;
+ list = stringlib_rsplit(
+ (PyObject*) self, s, len, sub, n, maxsplit
+ );
PyBuffer_Release(&vsub);
return list;
-
-onError:
- Py_DECREF(list);
- PyBuffer_Release(&vsub);
- return NULL;
}
PyDoc_STRVAR(reverse__doc__,
@@ -2695,8 +2290,8 @@ bytearray_pop(PyByteArrayObject *self, PyObject *args)
return NULL;
if (n == 0) {
- PyErr_SetString(PyExc_OverflowError,
- "cannot pop an empty bytearray");
+ PyErr_SetString(PyExc_IndexError,
+ "pop from empty bytearray");
return NULL;
}
if (where < 0)
@@ -2875,22 +2470,23 @@ bytearray_rstrip(PyByteArrayObject *self, PyObject *args)
}
PyDoc_STRVAR(decode_doc,
-"B.decode([encoding[, errors]]) -> str\n\
+"B.decode(encoding='utf-8', errors='strict') -> str\n\
\n\
-Decode B using the codec registered for encoding. encoding defaults\n\
-to the default encoding. errors may be given to set a different error\n\
+Decode B using the codec registered for encoding. Default encoding\n\
+is 'utf-8'. errors may be given to set a different error\n\
handling scheme. Default is 'strict' meaning that encoding errors raise\n\
a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n\
as well as any other name registered with codecs.register_error that is\n\
able to handle UnicodeDecodeErrors.");
static PyObject *
-bytearray_decode(PyObject *self, PyObject *args)
+bytearray_decode(PyObject *self, PyObject *args, PyObject *kwargs)
{
const char *encoding = NULL;
const char *errors = NULL;
+ static char *kwlist[] = {"encoding", "errors", 0};
- if (!PyArg_ParseTuple(args, "|ss:decode", &encoding, &errors))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:decode", kwlist, &encoding, &errors))
return NULL;
if (encoding == NULL)
encoding = PyUnicode_GetDefaultEncoding();
@@ -2984,6 +2580,27 @@ bytearray_join(PyByteArrayObject *self, PyObject *it)
return NULL;
}
+PyDoc_STRVAR(splitlines__doc__,
+"B.splitlines([keepends]) -> list of lines\n\
+\n\
+Return a list of the lines in B, breaking at line boundaries.\n\
+Line breaks are not included in the resulting list unless keepends\n\
+is given and true.");
+
+static PyObject*
+bytearray_splitlines(PyObject *self, PyObject *args)
+{
+ int keepends = 0;
+
+ if (!PyArg_ParseTuple(args, "|i:splitlines", &keepends))
+ return NULL;
+
+ return stringlib_splitlines(
+ (PyObject*) self, PyByteArray_AS_STRING(self),
+ PyByteArray_GET_SIZE(self), keepends
+ );
+}
+
PyDoc_STRVAR(fromhex_doc,
"bytearray.fromhex(string) -> bytearray (static method)\n\
\n\
@@ -3120,7 +2737,7 @@ bytearray_methods[] = {
_Py_capitalize__doc__},
{"center", (PyCFunction)stringlib_center, METH_VARARGS, center__doc__},
{"count", (PyCFunction)bytearray_count, METH_VARARGS, count__doc__},
- {"decode", (PyCFunction)bytearray_decode, METH_VARARGS, decode_doc},
+ {"decode", (PyCFunction)bytearray_decode, METH_VARARGS | METH_KEYWORDS, decode_doc},
{"endswith", (PyCFunction)bytearray_endswith, METH_VARARGS, endswith__doc__},
{"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS,
expandtabs__doc__},
@@ -3162,7 +2779,7 @@ bytearray_methods[] = {
{"rsplit", (PyCFunction)bytearray_rsplit, METH_VARARGS, rsplit__doc__},
{"rstrip", (PyCFunction)bytearray_rstrip, METH_VARARGS, rstrip__doc__},
{"split", (PyCFunction)bytearray_split, METH_VARARGS, split__doc__},
- {"splitlines", (PyCFunction)stringlib_splitlines, METH_VARARGS,
+ {"splitlines", (PyCFunction)bytearray_splitlines, METH_VARARGS,
splitlines__doc__},
{"startswith", (PyCFunction)bytearray_startswith, METH_VARARGS ,
startswith__doc__},
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index f2ee1310fa..38458ef9a6 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -56,7 +56,7 @@ static PyBytesObject *nullstring;
If `str' is NULL then PyBytes_FromStringAndSize() will allocate `size+1'
bytes (setting the last byte to the null terminating character) and you can
fill in the data yourself. If `str' is non-NULL then the resulting
- PyString object must be treated as immutable and you must not fill in nor
+ PyBytes object must be treated as immutable and you must not fill in nor
alter the data yourself, since the strings may be shared.
The PyObject member `op->ob_size', which denotes the number of "extra
@@ -173,20 +173,12 @@ PyBytes_FromFormatV(const char *format, va_list vargs)
char *s;
PyObject* string;
-#ifdef VA_LIST_IS_ARRAY
- Py_MEMCPY(count, vargs, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(count, vargs);
-#else
- count = vargs;
-#endif
-#endif
+ Py_VA_COPY(count, vargs);
/* step 1: figure out how large a buffer we need */
for (f = format; *f; f++) {
if (*f == '%') {
const char* p = f;
- while (*++f && *f != '%' && !ISALPHA(*f))
+ while (*++f && *f != '%' && !Py_ISALPHA(*f))
;
/* skip the 'l' or 'z' in {%ld, %zd, %lu, %zu} since
@@ -255,15 +247,15 @@ PyBytes_FromFormatV(const char *format, va_list vargs)
/* parse the width.precision part (we're only
interested in the precision value, if any) */
n = 0;
- while (ISDIGIT(*f))
+ while (Py_ISDIGIT(*f))
n = (n*10) + *f++ - '0';
if (*f == '.') {
f++;
n = 0;
- while (ISDIGIT(*f))
+ while (Py_ISDIGIT(*f))
n = (n*10) + *f++ - '0';
}
- while (*f && *f != '%' && !ISALPHA(*f))
+ while (*f && *f != '%' && !Py_ISALPHA(*f))
f++;
/* handle the long flag, but only for %ld and %lu.
others can be added when necessary. */
@@ -454,22 +446,22 @@ PyObject *PyBytes_DecodeEscape(const char *s,
*p++ = c;
break;
case 'x':
- if (s+1 < end && ISXDIGIT(s[0]) && ISXDIGIT(s[1])) {
+ if (s+1 < end && Py_ISXDIGIT(s[0]) && Py_ISXDIGIT(s[1])) {
unsigned int x = 0;
c = Py_CHARMASK(*s);
s++;
- if (ISDIGIT(c))
+ if (Py_ISDIGIT(c))
x = c - '0';
- else if (ISLOWER(c))
+ else if (Py_ISLOWER(c))
x = 10 + c - 'a';
else
x = 10 + c - 'A';
x = x << 4;
c = Py_CHARMASK(*s);
s++;
- if (ISDIGIT(c))
+ if (Py_ISDIGIT(c))
x += c - '0';
- else if (ISLOWER(c))
+ else if (Py_ISLOWER(c))
x += 10 + c - 'a';
else
x += 10 + c - 'A';
@@ -563,29 +555,15 @@ PyBytes_AsStringAndSize(register PyObject *obj,
/* Methods */
#include "stringlib/stringdefs.h"
-#define STRINGLIB_CHAR char
-
-#define STRINGLIB_CMP memcmp
-#define STRINGLIB_LEN PyBytes_GET_SIZE
-#define STRINGLIB_NEW PyBytes_FromStringAndSize
-#define STRINGLIB_STR PyBytes_AS_STRING
-/* #define STRINGLIB_WANT_CONTAINS_OBJ 1 */
-
-#define STRINGLIB_EMPTY nullstring
-#define STRINGLIB_CHECK_EXACT PyBytes_CheckExact
-#define STRINGLIB_MUTABLE 0
#include "stringlib/fastsearch.h"
-
#include "stringlib/count.h"
#include "stringlib/find.h"
#include "stringlib/partition.h"
+#include "stringlib/split.h"
#include "stringlib/ctype.h"
-#include "stringlib/transmogrify.h"
-#define _Py_InsertThousandsGrouping _PyBytes_InsertThousandsGrouping
-#define _Py_InsertThousandsGroupingLocale _PyBytes_InsertThousandsGroupingLocale
-#include "stringlib/localeutil.h"
+#include "stringlib/transmogrify.h"
PyObject *
PyBytes_Repr(PyObject *obj, int smartquotes)
@@ -593,13 +571,14 @@ PyBytes_Repr(PyObject *obj, int smartquotes)
static const char *hexdigits = "0123456789abcdef";
register PyBytesObject* op = (PyBytesObject*) obj;
Py_ssize_t length = Py_SIZE(op);
- size_t newsize = 3 + 4 * length;
+ size_t newsize;
PyObject *v;
- if (newsize > PY_SSIZE_T_MAX || (newsize-3) / 4 != length) {
+ if (length > (PY_SSIZE_T_MAX - 3) / 4) {
PyErr_SetString(PyExc_OverflowError,
"bytes object is too large to make repr");
return NULL;
}
+ newsize = 3 + 4 * length;
v = PyUnicode_FromUnicode(NULL, newsize);
if (v == NULL) {
return NULL;
@@ -746,12 +725,12 @@ bytes_repeat(register PyBytesObject *a, register Py_ssize_t n)
/* watch out for overflows: the size can overflow int,
* and the # of bytes needed can overflow size_t
*/
- size = Py_SIZE(a) * n;
- if (n && size / n != Py_SIZE(a)) {
+ if (n > 0 && Py_SIZE(a) > PY_SSIZE_T_MAX / n) {
PyErr_SetString(PyExc_OverflowError,
"repeated bytes are too long");
return NULL;
}
+ size = Py_SIZE(a) * n;
if (size == Py_SIZE(a) && PyBytes_CheckExact(a)) {
Py_INCREF(a);
return (PyObject *)a;
@@ -889,12 +868,12 @@ bytes_richcompare(PyBytesObject *a, PyBytesObject *b, int op)
return result;
}
-static long
+static Py_hash_t
bytes_hash(PyBytesObject *a)
{
register Py_ssize_t len;
register unsigned char *p;
- register long x;
+ register Py_hash_t x;
if (a->ob_shash != -1)
return a->ob_shash;
@@ -932,7 +911,7 @@ bytes_subscript(PyBytesObject* self, PyObject* item)
char* result_buf;
PyObject* result;
- if (PySlice_GetIndicesEx((PySliceObject*)item,
+ if (PySlice_GetIndicesEx(item,
PyBytes_GET_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
@@ -1014,133 +993,6 @@ static const char *stripformat[] = {"|O:lstrip", "|O:rstrip", "|O:strip"};
#define STRIPNAME(i) (stripformat[i]+3)
-
-/* Don't call if length < 2 */
-#define Py_STRING_MATCH(target, offset, pattern, length) \
- (target[offset] == pattern[0] && \
- target[offset+length-1] == pattern[length-1] && \
- !memcmp(target+offset+1, pattern+1, length-2) )
-
-
-/* Overallocate the initial list to reduce the number of reallocs for small
- split sizes. Eg, "A A A A A A A A A A".split() (10 elements) has three
- resizes, to sizes 4, 8, then 16. Most observed string splits are for human
- text (roughly 11 words per line) and field delimited data (usually 1-10
- fields). For large strings the split algorithms are bandwidth limited
- so increasing the preallocation likely will not improve things.*/
-
-#define MAX_PREALLOC 12
-
-/* 5 splits gives 6 elements */
-#define PREALLOC_SIZE(maxsplit) \
- (maxsplit >= MAX_PREALLOC ? MAX_PREALLOC : maxsplit+1)
-
-#define SPLIT_ADD(data, left, right) { \
- str = PyBytes_FromStringAndSize((data) + (left), \
- (right) - (left)); \
- if (str == NULL) \
- goto onError; \
- if (count < MAX_PREALLOC) { \
- PyList_SET_ITEM(list, count, str); \
- } else { \
- if (PyList_Append(list, str)) { \
- Py_DECREF(str); \
- goto onError; \
- } \
- else \
- Py_DECREF(str); \
- } \
- count++; }
-
-/* Always force the list to the expected size. */
-#define FIX_PREALLOC_SIZE(list) Py_SIZE(list) = count
-
-#define SKIP_SPACE(s, i, len) { while (i<len && ISSPACE(s[i])) i++; }
-#define SKIP_NONSPACE(s, i, len) { while (i<len && !ISSPACE(s[i])) i++; }
-#define RSKIP_SPACE(s, i) { while (i>=0 && ISSPACE(s[i])) i--; }
-#define RSKIP_NONSPACE(s, i) { while (i>=0 && !ISSPACE(s[i])) i--; }
-
-Py_LOCAL_INLINE(PyObject *)
-split_whitespace(PyBytesObject *self, Py_ssize_t len, Py_ssize_t maxsplit)
-{
- const char *s = PyBytes_AS_STRING(self);
- Py_ssize_t i, j, count=0;
- PyObject *str;
- PyObject *list = PyList_New(PREALLOC_SIZE(maxsplit));
-
- if (list == NULL)
- return NULL;
-
- i = j = 0;
-
- while (maxsplit-- > 0) {
- SKIP_SPACE(s, i, len);
- if (i==len) break;
- j = i; i++;
- SKIP_NONSPACE(s, i, len);
- if (j == 0 && i == len && PyBytes_CheckExact(self)) {
- /* No whitespace in self, so just use it as list[0] */
- Py_INCREF(self);
- PyList_SET_ITEM(list, 0, (PyObject *)self);
- count++;
- break;
- }
- SPLIT_ADD(s, j, i);
- }
-
- if (i < len) {
- /* Only occurs when maxsplit was reached */
- /* Skip any remaining whitespace and copy to end of string */
- SKIP_SPACE(s, i, len);
- if (i != len)
- SPLIT_ADD(s, i, len);
- }
- FIX_PREALLOC_SIZE(list);
- return list;
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
-Py_LOCAL_INLINE(PyObject *)
-split_char(PyBytesObject *self, Py_ssize_t len, char ch, Py_ssize_t maxcount)
-{
- const char *s = PyBytes_AS_STRING(self);
- register Py_ssize_t i, j, count=0;
- PyObject *str;
- PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
-
- if (list == NULL)
- return NULL;
-
- i = j = 0;
- while ((j < len) && (maxcount-- > 0)) {
- for(; j<len; j++) {
- /* I found that using memchr makes no difference */
- if (s[j] == ch) {
- SPLIT_ADD(s, i, j);
- i = j = j + 1;
- break;
- }
- }
- }
- if (i == 0 && count == 0 && PyBytes_CheckExact(self)) {
- /* ch not in self, so just use self as list[0] */
- Py_INCREF(self);
- PyList_SET_ITEM(list, 0, (PyObject *)self);
- count++;
- }
- else if (i <= len) {
- SPLIT_ADD(s, i, len);
- }
- FIX_PREALLOC_SIZE(list);
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
PyDoc_STRVAR(split__doc__,
"B.split([sep[, maxsplit]]) -> list of bytes\n\
\n\
@@ -1152,74 +1004,26 @@ If maxsplit is given, at most maxsplit splits are done.");
static PyObject *
bytes_split(PyBytesObject *self, PyObject *args)
{
- Py_ssize_t len = PyBytes_GET_SIZE(self), n, i, j;
- Py_ssize_t maxsplit = -1, count=0;
+ Py_ssize_t len = PyBytes_GET_SIZE(self), n;
+ Py_ssize_t maxsplit = -1;
const char *s = PyBytes_AS_STRING(self), *sub;
Py_buffer vsub;
- PyObject *list, *str, *subobj = Py_None;
-#ifdef USE_FAST
- Py_ssize_t pos;
-#endif
+ PyObject *list, *subobj = Py_None;
if (!PyArg_ParseTuple(args, "|On:split", &subobj, &maxsplit))
return NULL;
if (maxsplit < 0)
maxsplit = PY_SSIZE_T_MAX;
if (subobj == Py_None)
- return split_whitespace(self, len, maxsplit);
+ return stringlib_split_whitespace((PyObject*) self, s, len, maxsplit);
if (_getbuffer(subobj, &vsub) < 0)
return NULL;
sub = vsub.buf;
n = vsub.len;
- if (n == 0) {
- PyErr_SetString(PyExc_ValueError, "empty separator");
- PyBuffer_Release(&vsub);
- return NULL;
- }
- else if (n == 1) {
- list = split_char(self, len, sub[0], maxsplit);
- PyBuffer_Release(&vsub);
- return list;
- }
-
- list = PyList_New(PREALLOC_SIZE(maxsplit));
- if (list == NULL) {
- PyBuffer_Release(&vsub);
- return NULL;
- }
-
-#ifdef USE_FAST
- i = j = 0;
- while (maxsplit-- > 0) {
- pos = fastsearch(s+i, len-i, sub, n, FAST_SEARCH);
- if (pos < 0)
- break;
- j = i+pos;
- SPLIT_ADD(s, i, j);
- i = j + n;
- }
-#else
- i = j = 0;
- while ((j+n <= len) && (maxsplit-- > 0)) {
- for (; j+n <= len; j++) {
- if (Py_STRING_MATCH(s, j, sub, n)) {
- SPLIT_ADD(s, i, j);
- i = j = j + n;
- break;
- }
- }
- }
-#endif
- SPLIT_ADD(s, i, len);
- FIX_PREALLOC_SIZE(list);
+ list = stringlib_split((PyObject*) self, s, len, sub, n, maxsplit);
PyBuffer_Release(&vsub);
return list;
-
- onError:
- Py_DECREF(list);
- PyBuffer_Release(&vsub);
- return NULL;
}
PyDoc_STRVAR(partition__doc__,
@@ -1277,90 +1081,6 @@ bytes_rpartition(PyBytesObject *self, PyObject *sep_obj)
);
}
-Py_LOCAL_INLINE(PyObject *)
-rsplit_whitespace(PyBytesObject *self, Py_ssize_t len, Py_ssize_t maxsplit)
-{
- const char *s = PyBytes_AS_STRING(self);
- Py_ssize_t i, j, count=0;
- PyObject *str;
- PyObject *list = PyList_New(PREALLOC_SIZE(maxsplit));
-
- if (list == NULL)
- return NULL;
-
- i = j = len-1;
-
- while (maxsplit-- > 0) {
- RSKIP_SPACE(s, i);
- if (i<0) break;
- j = i; i--;
- RSKIP_NONSPACE(s, i);
- if (j == len-1 && i < 0 && PyBytes_CheckExact(self)) {
- /* No whitespace in self, so just use it as list[0] */
- Py_INCREF(self);
- PyList_SET_ITEM(list, 0, (PyObject *)self);
- count++;
- break;
- }
- SPLIT_ADD(s, i + 1, j + 1);
- }
- if (i >= 0) {
- /* Only occurs when maxsplit was reached. Skip any remaining
- whitespace and copy to beginning of string. */
- RSKIP_SPACE(s, i);
- if (i >= 0)
- SPLIT_ADD(s, 0, i + 1);
-
- }
- FIX_PREALLOC_SIZE(list);
- if (PyList_Reverse(list) < 0)
- goto onError;
- return list;
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
-Py_LOCAL_INLINE(PyObject *)
-rsplit_char(PyBytesObject *self, Py_ssize_t len, char ch, Py_ssize_t maxcount)
-{
- const char *s = PyBytes_AS_STRING(self);
- register Py_ssize_t i, j, count=0;
- PyObject *str;
- PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
-
- if (list == NULL)
- return NULL;
-
- i = j = len - 1;
- while ((i >= 0) && (maxcount-- > 0)) {
- for (; i >= 0; i--) {
- if (s[i] == ch) {
- SPLIT_ADD(s, i + 1, j + 1);
- j = i = i - 1;
- break;
- }
- }
- }
- if (i < 0 && count == 0 && PyBytes_CheckExact(self)) {
- /* ch not in self, so just use self as list[0] */
- Py_INCREF(self);
- PyList_SET_ITEM(list, 0, (PyObject *)self);
- count++;
- }
- else if (j >= -1) {
- SPLIT_ADD(s, 0, j + 1);
- }
- FIX_PREALLOC_SIZE(list);
- if (PyList_Reverse(list) < 0)
- goto onError;
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
PyDoc_STRVAR(rsplit__doc__,
"B.rsplit([sep[, maxsplit]]) -> list of bytes\n\
\n\
@@ -1374,71 +1094,28 @@ If maxsplit is given, at most maxsplit splits are done.");
static PyObject *
bytes_rsplit(PyBytesObject *self, PyObject *args)
{
- Py_ssize_t len = PyBytes_GET_SIZE(self), n, i, j;
- Py_ssize_t maxsplit = -1, count=0;
- const char *s, *sub;
+ Py_ssize_t len = PyBytes_GET_SIZE(self), n;
+ Py_ssize_t maxsplit = -1;
+ const char *s = PyBytes_AS_STRING(self), *sub;
Py_buffer vsub;
- PyObject *list, *str, *subobj = Py_None;
+ PyObject *list, *subobj = Py_None;
if (!PyArg_ParseTuple(args, "|On:rsplit", &subobj, &maxsplit))
return NULL;
if (maxsplit < 0)
maxsplit = PY_SSIZE_T_MAX;
if (subobj == Py_None)
- return rsplit_whitespace(self, len, maxsplit);
+ return stringlib_rsplit_whitespace((PyObject*) self, s, len, maxsplit);
if (_getbuffer(subobj, &vsub) < 0)
return NULL;
sub = vsub.buf;
n = vsub.len;
- if (n == 0) {
- PyErr_SetString(PyExc_ValueError, "empty separator");
- PyBuffer_Release(&vsub);
- return NULL;
- }
- else if (n == 1) {
- list = rsplit_char(self, len, sub[0], maxsplit);
- PyBuffer_Release(&vsub);
- return list;
- }
-
- list = PyList_New(PREALLOC_SIZE(maxsplit));
- if (list == NULL) {
- PyBuffer_Release(&vsub);
- return NULL;
- }
-
- j = len;
- i = j - n;
-
- s = PyBytes_AS_STRING(self);
- while ( (i >= 0) && (maxsplit-- > 0) ) {
- for (; i>=0; i--) {
- if (Py_STRING_MATCH(s, i, sub, n)) {
- SPLIT_ADD(s, i + n, j);
- j = i;
- i -= n;
- break;
- }
- }
- }
- SPLIT_ADD(s, 0, j);
- FIX_PREALLOC_SIZE(list);
- if (PyList_Reverse(list) < 0)
- goto onError;
+ list = stringlib_rsplit((PyObject*) self, s, len, sub, n, maxsplit);
PyBuffer_Release(&vsub);
return list;
-
-onError:
- Py_DECREF(list);
- PyBuffer_Release(&vsub);
- return NULL;
}
-#undef SPLIT_ADD
-#undef MAX_PREALLOC
-#undef PREALLOC_SIZE
-
PyDoc_STRVAR(join__doc__,
"B.join(iterable_of_bytes) -> bytes\n\
@@ -1545,20 +1222,20 @@ _PyBytes_Join(PyObject *sep, PyObject *x)
return bytes_join(sep, x);
}
-Py_LOCAL_INLINE(void)
-bytes_adjust_indices(Py_ssize_t *start, Py_ssize_t *end, Py_ssize_t len)
-{
- if (*end > len)
- *end = len;
- else if (*end < 0)
- *end += len;
- if (*end < 0)
- *end = 0;
- if (*start < 0)
- *start += len;
- if (*start < 0)
- *start = 0;
-}
+/* helper macro to fixup start/end slice values */
+#define ADJUST_INDICES(start, end, len) \
+ if (end > len) \
+ end = len; \
+ else if (end < 0) { \
+ end += len; \
+ if (end < 0) \
+ end = 0; \
+ } \
+ if (start < 0) { \
+ start += len; \
+ if (start < 0) \
+ start = 0; \
+ }
Py_LOCAL_INLINE(Py_ssize_t)
bytes_find_internal(PyBytesObject *self, PyObject *args, int dir)
@@ -1595,7 +1272,7 @@ bytes_find_internal(PyBytesObject *self, PyObject *args, int dir)
PyDoc_STRVAR(find__doc__,
"B.find(sub[, start[, end]]) -> int\n\
\n\
-Return the lowest index in S where substring sub is found,\n\
+Return the lowest index in B where substring sub is found,\n\
such that sub is contained within s[start:end]. Optional\n\
arguments start and end are interpreted as in slice notation.\n\
\n\
@@ -1719,7 +1396,7 @@ do_strip(PyBytesObject *self, int striptype)
i = 0;
if (striptype != RIGHTSTRIP) {
- while (i < len && ISSPACE(s[i])) {
+ while (i < len && Py_ISSPACE(s[i])) {
i++;
}
}
@@ -1728,7 +1405,7 @@ do_strip(PyBytesObject *self, int striptype)
if (striptype != LEFTSTRIP) {
do {
j--;
- } while (j >= i && ISSPACE(s[j]));
+ } while (j >= i && Py_ISSPACE(s[j]));
j++;
}
@@ -1805,7 +1482,7 @@ PyDoc_STRVAR(count__doc__,
"B.count(sub[, start[, end]]) -> int\n\
\n\
Return the number of non-overlapping occurrences of substring sub in\n\
-string S[start:end]. Optional arguments start and end are interpreted\n\
+string B[start:end]. Optional arguments start and end are interpreted\n\
as in slice notation.");
static PyObject *
@@ -1826,10 +1503,10 @@ bytes_count(PyBytesObject *self, PyObject *args)
else if (PyObject_AsCharBuffer(sub_obj, &sub, &sub_len))
return NULL;
- bytes_adjust_indices(&start, &end, PyBytes_GET_SIZE(self));
+ ADJUST_INDICES(start, end, PyBytes_GET_SIZE(self));
return PyLong_FromSsize_t(
- stringlib_count(str + start, end - start, sub, sub_len)
+ stringlib_count(str + start, end - start, sub, sub_len, PY_SSIZE_T_MAX)
);
}
@@ -1946,9 +1623,6 @@ bytes_maketrans(PyObject *null, PyObject *args)
return _Py_bytes_maketrans(args);
}
-#define FORWARD 1
-#define REVERSE -1
-
/* find and count characters and substrings */
#define findchar(target, target_len, c) \
@@ -1984,94 +1658,6 @@ countchar(const char *target, Py_ssize_t target_len, char c, Py_ssize_t maxcount
return count;
}
-Py_LOCAL(Py_ssize_t)
-findstring(const char *target, Py_ssize_t target_len,
- const char *pattern, Py_ssize_t pattern_len,
- Py_ssize_t start,
- Py_ssize_t end,
- int direction)
-{
- if (start < 0) {
- start += target_len;
- if (start < 0)
- start = 0;
- }
- if (end > target_len) {
- end = target_len;
- } else if (end < 0) {
- end += target_len;
- if (end < 0)
- end = 0;
- }
-
- /* zero-length substrings always match at the first attempt */
- if (pattern_len == 0)
- return (direction > 0) ? start : end;
-
- end -= pattern_len;
-
- if (direction < 0) {
- for (; end >= start; end--)
- if (Py_STRING_MATCH(target, end, pattern, pattern_len))
- return end;
- } else {
- for (; start <= end; start++)
- if (Py_STRING_MATCH(target, start,pattern,pattern_len))
- return start;
- }
- return -1;
-}
-
-Py_LOCAL_INLINE(Py_ssize_t)
-countstring(const char *target, Py_ssize_t target_len,
- const char *pattern, Py_ssize_t pattern_len,
- Py_ssize_t start,
- Py_ssize_t end,
- int direction, Py_ssize_t maxcount)
-{
- Py_ssize_t count=0;
-
- if (start < 0) {
- start += target_len;
- if (start < 0)
- start = 0;
- }
- if (end > target_len) {
- end = target_len;
- } else if (end < 0) {
- end += target_len;
- if (end < 0)
- end = 0;
- }
-
- /* zero-length substrings match everywhere */
- if (pattern_len == 0 || maxcount == 0) {
- if (target_len+1 < maxcount)
- return target_len+1;
- return maxcount;
- }
-
- end -= pattern_len;
- if (direction < 0) {
- for (; (end >= start); end--)
- if (Py_STRING_MATCH(target, end,pattern,pattern_len)) {
- count++;
- if (--maxcount <= 0) break;
- end -= pattern_len-1;
- }
- } else {
- for (; (start <= end); start++)
- if (Py_STRING_MATCH(target, start,
- pattern, pattern_len)) {
- count++;
- if (--maxcount <= 0)
- break;
- start += pattern_len-1;
- }
- }
- return count;
-}
-
/* Algorithms for different cases of string replacement */
@@ -2083,30 +1669,28 @@ replace_interleave(PyBytesObject *self,
{
char *self_s, *result_s;
Py_ssize_t self_len, result_len;
- Py_ssize_t count, i, product;
+ Py_ssize_t count, i;
PyBytesObject *result;
self_len = PyBytes_GET_SIZE(self);
- /* 1 at the end plus 1 after every character */
- count = self_len+1;
- if (maxcount < count)
+ /* 1 at the end plus 1 after every character;
+ count = min(maxcount, self_len + 1) */
+ if (maxcount <= self_len)
count = maxcount;
+ else
+ /* Can't overflow: self_len + 1 <= maxcount <= PY_SSIZE_T_MAX. */
+ count = self_len + 1;
/* Check for overflow */
/* result_len = count * to_len + self_len; */
- product = count * to_len;
- if (product / to_len != count) {
- PyErr_SetString(PyExc_OverflowError,
- "replacement bytes are too long");
- return NULL;
- }
- result_len = product + self_len;
- if (result_len < 0) {
+ assert(count > 0);
+ if (to_len > (PY_SSIZE_T_MAX - self_len) / count) {
PyErr_SetString(PyExc_OverflowError,
"replacement bytes are too long");
return NULL;
}
+ result_len = count * to_len + self_len;
if (! (result = (PyBytesObject *)
PyBytes_FromStringAndSize(NULL, result_len)) )
@@ -2192,10 +1776,9 @@ replace_delete_substring(PyBytesObject *self,
self_len = PyBytes_GET_SIZE(self);
self_s = PyBytes_AS_STRING(self);
- count = countstring(self_s, self_len,
- from_s, from_len,
- 0, self_len, 1,
- maxcount);
+ count = stringlib_count(self_s, self_len,
+ from_s, from_len,
+ maxcount);
if (count == 0) {
/* no matches */
@@ -2214,9 +1797,9 @@ replace_delete_substring(PyBytesObject *self,
start = self_s;
end = self_s + self_len;
while (count-- > 0) {
- offset = findstring(start, end-start,
- from_s, from_len,
- 0, end-start, FORWARD);
+ offset = stringlib_find(start, end-start,
+ from_s, from_len,
+ 0);
if (offset == -1)
break;
next = start + offset;
@@ -2292,9 +1875,9 @@ replace_substring_in_place(PyBytesObject *self,
self_s = PyBytes_AS_STRING(self);
self_len = PyBytes_GET_SIZE(self);
- offset = findstring(self_s, self_len,
- from_s, from_len,
- 0, self_len, FORWARD);
+ offset = stringlib_find(self_s, self_len,
+ from_s, from_len,
+ 0);
if (offset == -1) {
/* No matches; return the original string */
return return_self(self);
@@ -2314,9 +1897,9 @@ replace_substring_in_place(PyBytesObject *self,
end = result_s + self_len;
while ( --maxcount > 0) {
- offset = findstring(start, end-start,
- from_s, from_len,
- 0, end-start, FORWARD);
+ offset = stringlib_find(start, end-start,
+ from_s, from_len,
+ 0);
if (offset==-1)
break;
Py_MEMCPY(start+offset, to_s, from_len);
@@ -2336,7 +1919,7 @@ replace_single_character(PyBytesObject *self,
char *self_s, *result_s;
char *start, *next, *end;
Py_ssize_t self_len, result_len;
- Py_ssize_t count, product;
+ Py_ssize_t count;
PyBytesObject *result;
self_s = PyBytes_AS_STRING(self);
@@ -2350,18 +1933,13 @@ replace_single_character(PyBytesObject *self,
/* use the difference between current and new, hence the "-1" */
/* result_len = self_len + count * (to_len-1) */
- product = count * (to_len-1);
- if (product / (to_len-1) != count) {
+ assert(count > 0);
+ if (to_len - 1 > (PY_SSIZE_T_MAX - self_len) / count) {
PyErr_SetString(PyExc_OverflowError,
"replacement bytes are too long");
return NULL;
}
- result_len = self_len + product;
- if (result_len < 0) {
- PyErr_SetString(PyExc_OverflowError,
- "replacment bytes are too long");
- return NULL;
- }
+ result_len = self_len + count * (to_len - 1);
if ( (result = (PyBytesObject *)
PyBytes_FromStringAndSize(NULL, result_len)) == NULL)
@@ -2404,15 +1982,16 @@ replace_substring(PyBytesObject *self,
char *self_s, *result_s;
char *start, *next, *end;
Py_ssize_t self_len, result_len;
- Py_ssize_t count, offset, product;
+ Py_ssize_t count, offset;
PyBytesObject *result;
self_s = PyBytes_AS_STRING(self);
self_len = PyBytes_GET_SIZE(self);
- count = countstring(self_s, self_len,
- from_s, from_len,
- 0, self_len, FORWARD, maxcount);
+ count = stringlib_count(self_s, self_len,
+ from_s, from_len,
+ maxcount);
+
if (count == 0) {
/* no matches, return unchanged */
return return_self(self);
@@ -2420,18 +1999,13 @@ replace_substring(PyBytesObject *self,
/* Check for overflow */
/* result_len = self_len + count * (to_len-from_len) */
- product = count * (to_len-from_len);
- if (product / (to_len-from_len) != count) {
- PyErr_SetString(PyExc_OverflowError,
- "replacement bytes are too long");
- return NULL;
- }
- result_len = self_len + product;
- if (result_len < 0) {
+ assert(count > 0);
+ if (to_len - from_len > (PY_SSIZE_T_MAX - self_len) / count) {
PyErr_SetString(PyExc_OverflowError,
"replacement bytes are too long");
return NULL;
}
+ result_len = self_len + count * (to_len-from_len);
if ( (result = (PyBytesObject *)
PyBytes_FromStringAndSize(NULL, result_len)) == NULL)
@@ -2441,9 +2015,9 @@ replace_substring(PyBytesObject *self,
start = self_s;
end = self_s + self_len;
while (count-- > 0) {
- offset = findstring(start, end-start,
- from_s, from_len,
- 0, end-start, FORWARD);
+ offset = stringlib_find(start, end-start,
+ from_s, from_len,
+ 0);
if (offset == -1)
break;
next = start+offset;
@@ -2601,7 +2175,7 @@ _bytes_tailmatch(PyBytesObject *self, PyObject *substr, Py_ssize_t start,
return -1;
str = PyBytes_AS_STRING(self);
- bytes_adjust_indices(&start, &end, len);
+ ADJUST_INDICES(start, end, len);
if (direction < 0) {
/* startswith */
@@ -2710,22 +2284,23 @@ bytes_endswith(PyBytesObject *self, PyObject *args)
PyDoc_STRVAR(decode__doc__,
-"B.decode([encoding[, errors]]) -> str\n\
+"B.decode(encoding='utf-8', errors='strict') -> str\n\
\n\
-Decode S using the codec registered for encoding. encoding defaults\n\
-to the default encoding. errors may be given to set a different error\n\
+Decode B using the codec registered for encoding. Default encoding\n\
+is 'utf-8'. errors may be given to set a different error\n\
handling scheme. Default is 'strict' meaning that encoding errors raise\n\
a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n\
as well as any other name registerd with codecs.register_error that is\n\
able to handle UnicodeDecodeErrors.");
static PyObject *
-bytes_decode(PyObject *self, PyObject *args)
+bytes_decode(PyObject *self, PyObject *args, PyObject *kwargs)
{
const char *encoding = NULL;
const char *errors = NULL;
+ static char *kwlist[] = {"encoding", "errors", 0};
- if (!PyArg_ParseTuple(args, "|ss:decode", &encoding, &errors))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:decode", kwlist, &encoding, &errors))
return NULL;
if (encoding == NULL)
encoding = PyUnicode_GetDefaultEncoding();
@@ -2733,6 +2308,28 @@ bytes_decode(PyObject *self, PyObject *args)
}
+PyDoc_STRVAR(splitlines__doc__,
+"B.splitlines([keepends]) -> list of lines\n\
+\n\
+Return a list of the lines in B, breaking at line boundaries.\n\
+Line breaks are not included in the resulting list unless keepends\n\
+is given and true.");
+
+static PyObject*
+bytes_splitlines(PyObject *self, PyObject *args)
+{
+ int keepends = 0;
+
+ if (!PyArg_ParseTuple(args, "|i:splitlines", &keepends))
+ return NULL;
+
+ return stringlib_splitlines(
+ (PyObject*) self, PyBytes_AS_STRING(self),
+ PyBytes_GET_SIZE(self), keepends
+ );
+}
+
+
PyDoc_STRVAR(fromhex_doc,
"bytes.fromhex(string) -> bytes\n\
\n\
@@ -2745,11 +2342,11 @@ hex_digit_to_int(Py_UNICODE c)
{
if (c >= 128)
return -1;
- if (ISDIGIT(c))
+ if (Py_ISDIGIT(c))
return c - '0';
else {
- if (ISUPPER(c))
- c = TOLOWER(c);
+ if (Py_ISUPPER(c))
+ c = Py_TOLOWER(c);
if (c >= 'a' && c <= 'f')
return c - 'a' + 10;
}
@@ -2815,7 +2412,7 @@ bytes_sizeof(PyBytesObject *v)
static PyObject *
bytes_getnewargs(PyBytesObject *v)
{
- return Py_BuildValue("(s#)", v->ob_sval, Py_SIZE(v));
+ return Py_BuildValue("(y#)", v->ob_sval, Py_SIZE(v));
}
@@ -2826,7 +2423,7 @@ bytes_methods[] = {
_Py_capitalize__doc__},
{"center", (PyCFunction)stringlib_center, METH_VARARGS, center__doc__},
{"count", (PyCFunction)bytes_count, METH_VARARGS, count__doc__},
- {"decode", (PyCFunction)bytes_decode, METH_VARARGS, decode__doc__},
+ {"decode", (PyCFunction)bytes_decode, METH_VARARGS | METH_KEYWORDS, decode__doc__},
{"endswith", (PyCFunction)bytes_endswith, METH_VARARGS,
endswith__doc__},
{"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS,
@@ -2865,7 +2462,7 @@ bytes_methods[] = {
{"rsplit", (PyCFunction)bytes_rsplit, METH_VARARGS, rsplit__doc__},
{"rstrip", (PyCFunction)bytes_rstrip, METH_VARARGS, rstrip__doc__},
{"split", (PyCFunction)bytes_split, METH_VARARGS, split__doc__},
- {"splitlines", (PyCFunction)stringlib_splitlines, METH_VARARGS,
+ {"splitlines", (PyCFunction)bytes_splitlines, METH_VARARGS,
splitlines__doc__},
{"startswith", (PyCFunction)bytes_startswith, METH_VARARGS,
startswith__doc__},
@@ -2892,6 +2489,7 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
const char *encoding = NULL;
const char *errors = NULL;
PyObject *new = NULL;
+ Py_ssize_t size;
static char *kwlist[] = {"source", "encoding", "errors", 0};
if (type != &PyBytes_Type)
@@ -2922,28 +2520,7 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
assert(PyBytes_Check(new));
return new;
}
-
- /* If it's not unicode, there can't be encoding or errors */
- if (encoding != NULL || errors != NULL) {
- PyErr_SetString(PyExc_TypeError,
- "encoding or errors without a string argument");
- return NULL;
- }
- return PyObject_Bytes(x);
-}
-
-PyObject *
-PyBytes_FromObject(PyObject *x)
-{
- PyObject *new, *it;
- Py_ssize_t i, size;
-
- if (x == NULL) {
- PyErr_BadInternalCall();
- return NULL;
- }
-
- /* Is it an int? */
+ /* Is it an integer? */
size = PyNumber_AsSsize_t(x, PyExc_OverflowError);
if (size == -1 && PyErr_Occurred()) {
if (PyErr_ExceptionMatches(PyExc_OverflowError))
@@ -2965,6 +2542,25 @@ PyBytes_FromObject(PyObject *x)
return new;
}
+ /* If it's not unicode, there can't be encoding or errors */
+ if (encoding != NULL || errors != NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "encoding or errors without a string argument");
+ return NULL;
+ }
+ return PyObject_Bytes(x);
+}
+
+PyObject *
+PyBytes_FromObject(PyObject *x)
+{
+ PyObject *new, *it;
+ Py_ssize_t i, size;
+
+ if (x == NULL) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
/* Use the modern buffer interface */
if (PyObject_CheckBuffer(x)) {
Py_buffer view;
@@ -2984,18 +2580,68 @@ PyBytes_FromObject(PyObject *x)
PyBuffer_Release(&view);
return NULL;
}
+ if (PyUnicode_Check(x)) {
+ PyErr_SetString(PyExc_TypeError,
+ "cannot convert unicode object to bytes");
+ return NULL;
+ }
+
+ if (PyList_CheckExact(x)) {
+ new = PyBytes_FromStringAndSize(NULL, Py_SIZE(x));
+ if (new == NULL)
+ return NULL;
+ for (i = 0; i < Py_SIZE(x); i++) {
+ Py_ssize_t value = PyNumber_AsSsize_t(
+ PyList_GET_ITEM(x, i), PyExc_ValueError);
+ if (value == -1 && PyErr_Occurred()) {
+ Py_DECREF(new);
+ return NULL;
+ }
+ if (value < 0 || value >= 256) {
+ PyErr_SetString(PyExc_ValueError,
+ "bytes must be in range(0, 256)");
+ Py_DECREF(new);
+ return NULL;
+ }
+ ((PyBytesObject *)new)->ob_sval[i] = (char) value;
+ }
+ return new;
+ }
+ if (PyTuple_CheckExact(x)) {
+ new = PyBytes_FromStringAndSize(NULL, Py_SIZE(x));
+ if (new == NULL)
+ return NULL;
+ for (i = 0; i < Py_SIZE(x); i++) {
+ Py_ssize_t value = PyNumber_AsSsize_t(
+ PyTuple_GET_ITEM(x, i), PyExc_ValueError);
+ if (value == -1 && PyErr_Occurred()) {
+ Py_DECREF(new);
+ return NULL;
+ }
+ if (value < 0 || value >= 256) {
+ PyErr_SetString(PyExc_ValueError,
+ "bytes must be in range(0, 256)");
+ Py_DECREF(new);
+ return NULL;
+ }
+ ((PyBytesObject *)new)->ob_sval[i] = (char) value;
+ }
+ return new;
+ }
/* For iterator version, create a string object and resize as needed */
- /* XXX(gb): is 64 a good value? also, optimize if length is known */
- /* XXX(guido): perhaps use Pysequence_Fast() -- I can't imagine the
- input being a truly long iterator. */
- size = 64;
+ size = _PyObject_LengthHint(x, 64);
+ if (size == -1 && PyErr_Occurred())
+ return NULL;
+ /* Allocate an extra byte to prevent PyBytes_FromStringAndSize() from
+ returning a shared empty bytes string. This required because we
+ want to call _PyBytes_Resize() the returned object, which we can
+ only do on bytes objects with refcount == 1. */
+ size += 1;
new = PyBytes_FromStringAndSize(NULL, size);
if (new == NULL)
return NULL;
- /* XXX Optimize this if the arguments is a list, tuple */
-
/* Get the iterator */
it = PyObject_GetIter(x);
if (it == NULL)
@@ -3029,7 +2675,7 @@ PyBytes_FromObject(PyObject *x)
/* Append the byte */
if (i >= size) {
- size *= 2;
+ size = 2 * size + 1;
if (_PyBytes_Resize(&new, size) < 0)
goto error;
}
@@ -3200,7 +2846,7 @@ _PyBytes_Resize(PyObject **pv, Py_ssize_t newsize)
/* _PyBytes_FormatLong emulates the format codes d, u, o, x and X, and
* the F_ALT flag, for Python's long (unbounded) ints. It's not used for
* Python's regular ints.
- * Return value: a new PyString*, or NULL if error.
+ * Return value: a new PyBytes*, or NULL if error.
* . *pbuf is set to point into it,
* *plen set to the # of chars following that.
* Caller must decref it when done using pbuf.
diff --git a/Objects/capsule.c b/Objects/capsule.c
index e25af6c2aa..acd3de637d 100644
--- a/Objects/capsule.c
+++ b/Objects/capsule.c
@@ -298,27 +298,27 @@ Python import mechanism to link to one another.\n\
PyTypeObject PyCapsule_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "PyCapsule", /*tp_name*/
- sizeof(PyCapsule), /*tp_basicsize*/
- 0, /*tp_itemsize*/
+ "PyCapsule", /*tp_name*/
+ sizeof(PyCapsule), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
/* methods */
capsule_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_reserved*/
capsule_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- 0, /*tp_flags*/
- PyCapsule_Type__doc__ /*tp_doc*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ 0, /*tp_flags*/
+ PyCapsule_Type__doc__ /*tp_doc*/
};
diff --git a/Objects/classobject.c b/Objects/classobject.c
index afd4ec3dc6..6df930fdcf 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -263,10 +263,10 @@ method_repr(PyMethodObject *a)
return result;
}
-static long
+static Py_hash_t
method_hash(PyMethodObject *a)
{
- long x, y;
+ Py_hash_t x, y;
if (a->im_self == NULL)
x = PyObject_Hash(Py_None);
else
diff --git a/Objects/cobject.c b/Objects/cobject.c
deleted file mode 100644
index a69215021d..0000000000
--- a/Objects/cobject.c
+++ /dev/null
@@ -1,169 +0,0 @@
-
-/* Wrap void* pointers to be passed between C modules */
-
-#include "Python.h"
-
-
-/* Declarations for objects of type PyCObject */
-
-typedef void (*destructor1)(void *);
-typedef void (*destructor2)(void *, void*);
-
-
-static int deprecation_exception(void)
-{
- return PyErr_WarnEx(PyExc_PendingDeprecationWarning,
- "The CObject API is deprecated as of Python 3.1. "
- "Please convert to using the Capsule API.", 1);
-}
-
-PyObject *
-PyCObject_FromVoidPtr(void *cobj, void (*destr)(void *))
-{
- PyCObject *self;
-
- if (deprecation_exception()) {
- return NULL;
- }
-
- self = PyObject_NEW(PyCObject, &PyCObject_Type);
- if (self == NULL)
- return NULL;
- self->cobject=cobj;
- self->destructor=destr;
- self->desc=NULL;
-
- return (PyObject *)self;
-}
-
-PyObject *
-PyCObject_FromVoidPtrAndDesc(void *cobj, void *desc,
- void (*destr)(void *, void *))
-{
- PyCObject *self;
-
- if (deprecation_exception()) {
- return NULL;
- }
-
- if (!desc) {
- PyErr_SetString(PyExc_TypeError,
- "PyCObject_FromVoidPtrAndDesc called with null"
- " description");
- return NULL;
- }
- self = PyObject_NEW(PyCObject, &PyCObject_Type);
- if (self == NULL)
- return NULL;
- self->cobject = cobj;
- self->destructor = (destructor1)destr;
- self->desc = desc;
-
- return (PyObject *)self;
-}
-
-void *
-PyCObject_AsVoidPtr(PyObject *self)
-{
- if (self) {
- if (self->ob_type == &PyCObject_Type)
- return ((PyCObject *)self)->cobject;
- PyErr_SetString(PyExc_TypeError,
- "PyCObject_AsVoidPtr with non-C-object");
- }
- if (!PyErr_Occurred())
- PyErr_SetString(PyExc_TypeError,
- "PyCObject_AsVoidPtr called with null pointer");
- return NULL;
-}
-
-void *
-PyCObject_GetDesc(PyObject *self)
-{
- if (self) {
- if (self->ob_type == &PyCObject_Type)
- return ((PyCObject *)self)->desc;
- PyErr_SetString(PyExc_TypeError,
- "PyCObject_GetDesc with non-C-object");
- }
- if (!PyErr_Occurred())
- PyErr_SetString(PyExc_TypeError,
- "PyCObject_GetDesc called with null pointer");
- return NULL;
-}
-
-void *
-PyCObject_Import(char *module_name, char *name)
-{
- PyObject *m, *c;
- void *r = NULL;
-
- if ((m = PyImport_ImportModule(module_name))) {
- if ((c = PyObject_GetAttrString(m,name))) {
- r = PyCObject_AsVoidPtr(c);
- Py_DECREF(c);
- }
- Py_DECREF(m);
- }
- return r;
-}
-
-int
-PyCObject_SetVoidPtr(PyObject *self, void *cobj)
-{
- PyCObject* cself = (PyCObject*)self;
- if (cself == NULL || !PyCObject_Check(cself) ||
- cself->destructor != NULL) {
- PyErr_SetString(PyExc_TypeError,
- "Invalid call to PyCObject_SetVoidPtr");
- return 0;
- }
- cself->cobject = cobj;
- return 1;
-}
-
-static void
-PyCObject_dealloc(PyCObject *self)
-{
- if (self->destructor) {
- if(self->desc)
- ((destructor2)(self->destructor))(self->cobject, self->desc);
- else
- (self->destructor)(self->cobject);
- }
- PyObject_DEL(self);
-}
-
-
-PyDoc_STRVAR(PyCObject_Type__doc__,
-"C objects to be exported from one extension module to another\n\
-\n\
-C objects are used for communication between extension modules. They\n\
-provide a way for an extension module to export a C interface to other\n\
-extension modules, so that extension modules can use the Python import\n\
-mechanism to link to one another.");
-
-PyTypeObject PyCObject_Type = {
- PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "PyCObject", /*tp_name*/
- sizeof(PyCObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)PyCObject_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_reserved*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- 0, /*tp_flags*/
- PyCObject_Type__doc__ /*tp_doc*/
-};
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index e3eccf7768..bb938ea0aa 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -54,7 +54,7 @@ PyCode_New(int argcount, int kwonlyargcount,
Py_ssize_t i;
/* Check argument types */
- if (argcount < 0 || nlocals < 0 ||
+ if (argcount < 0 || kwonlyargcount < 0 || nlocals < 0 ||
code == NULL ||
consts == NULL || !PyTuple_Check(consts) ||
names == NULL || !PyTuple_Check(names) ||
@@ -108,10 +108,58 @@ PyCode_New(int argcount, int kwonlyargcount,
Py_INCREF(lnotab);
co->co_lnotab = lnotab;
co->co_zombieframe = NULL;
+ co->co_weakreflist = NULL;
}
return co;
}
+PyCodeObject *
+PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno)
+{
+ static PyObject *emptystring = NULL;
+ static PyObject *nulltuple = NULL;
+ PyObject *filename_ob = NULL;
+ PyObject *funcname_ob = NULL;
+ PyCodeObject *result = NULL;
+ if (emptystring == NULL) {
+ emptystring = PyBytes_FromString("");
+ if (emptystring == NULL)
+ goto failed;
+ }
+ if (nulltuple == NULL) {
+ nulltuple = PyTuple_New(0);
+ if (nulltuple == NULL)
+ goto failed;
+ }
+ funcname_ob = PyUnicode_FromString(funcname);
+ if (funcname_ob == NULL)
+ goto failed;
+ filename_ob = PyUnicode_DecodeFSDefault(filename);
+ if (filename_ob == NULL)
+ goto failed;
+
+ result = PyCode_New(0, /* argcount */
+ 0, /* kwonlyargcount */
+ 0, /* nlocals */
+ 0, /* stacksize */
+ 0, /* flags */
+ emptystring, /* code */
+ nulltuple, /* consts */
+ nulltuple, /* names */
+ nulltuple, /* varnames */
+ nulltuple, /* freevars */
+ nulltuple, /* cellvars */
+ filename_ob, /* filename */
+ funcname_ob, /* name */
+ firstlineno, /* firstlineno */
+ emptystring /* lnotab */
+ );
+
+failed:
+ Py_XDECREF(funcname_ob);
+ Py_XDECREF(filename_ob);
+ return result;
+}
#define OFF(x) offsetof(PyCodeObject, x)
@@ -284,22 +332,28 @@ code_dealloc(PyCodeObject *co)
Py_XDECREF(co->co_lnotab);
if (co->co_zombieframe != NULL)
PyObject_GC_Del(co->co_zombieframe);
+ if (co->co_weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject*)co);
PyObject_DEL(co);
}
static PyObject *
code_repr(PyCodeObject *co)
{
- int lineno = -1;
- char *filename = "???";
-
+ int lineno;
if (co->co_firstlineno != 0)
lineno = co->co_firstlineno;
- if (co->co_filename && PyUnicode_Check(co->co_filename))
- filename = _PyUnicode_AsString(co->co_filename);
- return PyUnicode_FromFormat(
- "<code object %.100U at %p, file \"%.300s\", line %d>",
- co->co_name, co, filename, lineno);
+ else
+ lineno = -1;
+ if (co->co_filename && PyUnicode_Check(co->co_filename)) {
+ return PyUnicode_FromFormat(
+ "<code object %U at %p, file \"%U\", line %d>",
+ co->co_name, co, co->co_filename, lineno);
+ } else {
+ return PyUnicode_FromFormat(
+ "<code object %U at %p, file ???, line %d>",
+ co->co_name, co, lineno);
+ }
}
static PyObject *
@@ -363,10 +417,10 @@ code_richcompare(PyObject *self, PyObject *other, int op)
return res;
}
-static long
+static Py_hash_t
code_hash(PyCodeObject *co)
{
- long h, h0, h1, h2, h3, h4, h5, h6;
+ Py_hash_t h, h0, h1, h2, h3, h4, h5, h6;
h0 = PyObject_Hash(co->co_name);
if (h0 == -1) return -1;
h1 = PyObject_Hash(co->co_code);
@@ -415,7 +469,7 @@ PyTypeObject PyCode_Type = {
0, /* tp_traverse */
0, /* tp_clear */
code_richcompare, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
+ offsetof(PyCodeObject, co_weakreflist), /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
@@ -431,54 +485,14 @@ PyTypeObject PyCode_Type = {
code_new, /* tp_new */
};
-/* All about c_lnotab.
-
-c_lnotab is an array of unsigned bytes disguised as a Python string. In -O
-mode, SET_LINENO opcodes aren't generated, and bytecode offsets are mapped
-to source code line #s (when needed for tracebacks) via c_lnotab instead.
-The array is conceptually a list of
- (bytecode offset increment, line number increment)
-pairs. The details are important and delicate, best illustrated by example:
-
- byte code offset source code line number
- 0 1
- 6 2
- 50 7
- 350 307
- 361 308
-
-The first trick is that these numbers aren't stored, only the increments
-from one row to the next (this doesn't really work, but it's a start):
-
- 0, 1, 6, 1, 44, 5, 300, 300, 11, 1
-
-The second trick is that an unsigned byte can't hold negative values, or
-values larger than 255, so (a) there's a deep assumption that byte code
-offsets and their corresponding line #s both increase monotonically, and (b)
-if at least one column jumps by more than 255 from one row to the next, more
-than one pair is written to the table. In case #b, there's no way to know
-from looking at the table later how many were written. That's the delicate
-part. A user of c_lnotab desiring to find the source line number
-corresponding to a bytecode address A should do something like this
-
- lineno = addr = 0
- for addr_incr, line_incr in c_lnotab:
- addr += addr_incr
- if addr > A:
- return lineno
- lineno += line_incr
-
-In order for this to work, when the addr field increments by more than 255,
-the line # increment in each pair generated must be 0 until the remaining addr
-increment is < 256. So, in the example above, com_set_lineno should not (as
-was actually done until 2.2) expand 300, 300 to 255, 255, 45, 45, but to
-255, 0, 45, 255, 0, 45.
+/* Use co_lnotab to compute the line number from a bytecode index, addrq. See
+ lnotab_notes.txt for the details of the lnotab representation.
*/
int
PyCode_Addr2Line(PyCodeObject *co, int addrq)
{
- int size = PyBytes_Size(co->co_lnotab) / 2;
+ Py_ssize_t size = PyBytes_Size(co->co_lnotab) / 2;
unsigned char *p = (unsigned char*)PyBytes_AsString(co->co_lnotab);
int line = co->co_firstlineno;
int addr = 0;
@@ -491,87 +505,13 @@ PyCode_Addr2Line(PyCodeObject *co, int addrq)
return line;
}
-/*
- Check whether the current instruction is at the start of a line.
-
- */
-
- /* The theory of SET_LINENO-less tracing.
-
- In a nutshell, we use the co_lnotab field of the code object
- to tell when execution has moved onto a different line.
-
- As mentioned above, the basic idea is so set things up so
- that
-
- *instr_lb <= frame->f_lasti < *instr_ub
-
- is true so long as execution does not change lines.
-
- This is all fairly simple. Digging the information out of
- co_lnotab takes some work, but is conceptually clear.
-
- Somewhat harder to explain is why we don't *always* call the
- line trace function when the above test fails.
-
- Consider this code:
-
- 1: def f(a):
- 2: if a:
- 3: print 1
- 4: else:
- 5: print 2
-
- which compiles to this:
-
- 2 0 LOAD_FAST 0 (a)
- 3 JUMP_IF_FALSE 9 (to 15)
- 6 POP_TOP
-
- 3 7 LOAD_CONST 1 (1)
- 10 PRINT_ITEM
- 11 PRINT_NEWLINE
- 12 JUMP_FORWARD 6 (to 21)
- >> 15 POP_TOP
-
- 5 16 LOAD_CONST 2 (2)
- 19 PRINT_ITEM
- 20 PRINT_NEWLINE
- >> 21 LOAD_CONST 0 (None)
- 24 RETURN_VALUE
-
- If 'a' is false, execution will jump to instruction at offset
- 15 and the co_lnotab will claim that execution has moved to
- line 3. This is at best misleading. In this case we could
- associate the POP_TOP with line 4, but that doesn't make
- sense in all cases (I think).
-
- What we do is only call the line trace function if the co_lnotab
- indicates we have jumped to the *start* of a line, i.e. if the
- current instruction offset matches the offset given for the
- start of a line by the co_lnotab.
-
- This also takes care of the situation where 'a' is true.
- Execution will jump from instruction offset 12 to offset 21.
- Then the co_lnotab would imply that execution has moved to line
- 5, which is again misleading.
-
- Why do we set f_lineno when tracing? Well, consider the code
- above when 'a' is true. If stepping through this with 'n' in
- pdb, you would stop at line 1 with a "call" type event, then
- line events on lines 2 and 3, then a "return" type event -- but
- you would be shown line 5 during this event. This is a change
- from the behaviour in 2.2 and before, and I've found it
- confusing in practice. By setting and using f_lineno when
- tracing, one can report a line number different from that
- suggested by f_lasti on this one occasion where it's desirable.
- */
-
-
+/* Update *bounds to describe the first and one-past-the-last instructions in
+ the same line as lasti. Return the number of that line. */
int
-PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds)
+_PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds)
{
- int size, addr, line;
+ Py_ssize_t size;
+ int addr, line;
unsigned char* p;
p = (unsigned char*)PyBytes_AS_STRING(co->co_lnotab);
@@ -586,11 +526,9 @@ PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds)
instr_lb -- if we stored the matching value of p
somwhere we could skip the first while loop. */
- /* see comments in compile.c for the description of
+ /* See lnotab_notes.txt for the description of
co_lnotab. A point to remember: increments to p
- should come in pairs -- although we don't care about
- the line increments here, treating them as byte
- increments gets confusing, to say the least. */
+ come in (addr, line) pairs. */
bounds->ap_lower = 0;
while (size > 0) {
@@ -603,13 +541,6 @@ PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds)
--size;
}
- /* If lasti and addr don't match exactly, we don't want to
- change the lineno slot on the frame or execute a trace
- function. Return -1 instead.
- */
- if (addr != lasti)
- line = -1;
-
if (size > 0) {
while (--size >= 0) {
addr += *p++;
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 4948a21fb0..e247ba9ba8 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -8,8 +8,6 @@
#include "Python.h"
#include "structmember.h"
-#ifndef WITHOUT_COMPLEX
-
/* elementary operations on complex numbers */
static Py_complex c_1 = {1., 0.};
@@ -264,12 +262,25 @@ PyComplex_ImagAsDouble(PyObject *op)
}
}
+static PyObject *
+try_complex_special_method(PyObject *op) {
+ PyObject *f;
+ static PyObject *complexstr;
+
+ f = _PyObject_LookupSpecial(op, "__complex__", &complexstr);
+ if (f) {
+ PyObject *res = PyObject_CallFunctionObjArgs(f, NULL);
+ Py_DECREF(f);
+ return res;
+ }
+ return NULL;
+}
+
Py_complex
PyComplex_AsCComplex(PyObject *op)
{
Py_complex cv;
PyObject *newop = NULL;
- static PyObject *complex_str = NULL;
assert(op);
/* If op is already of type PyComplex_Type, return its value */
@@ -282,21 +293,7 @@ PyComplex_AsCComplex(PyObject *op)
cv.real = -1.;
cv.imag = 0.;
- if (complex_str == NULL) {
- if (!(complex_str = PyUnicode_FromString("__complex__")))
- return cv;
- }
-
- {
- PyObject *complexfunc;
- complexfunc = _PyType_Lookup(op->ob_type, complex_str);
- /* complexfunc is a borrowed reference */
- if (complexfunc) {
- newop = PyObject_CallFunctionObjArgs(complexfunc, op, NULL);
- if (!newop)
- return cv;
- }
- }
+ newop = try_complex_special_method(op);
if (newop) {
if (!PyComplex_Check(newop)) {
@@ -309,6 +306,9 @@ PyComplex_AsCComplex(PyObject *op)
Py_DECREF(newop);
return cv;
}
+ else if (PyErr_Occurred()) {
+ return cv;
+ }
/* If neither of the above works, interpret op as a float giving the
real part of the result, and fill in the imaginary part as 0. */
else {
@@ -324,10 +324,11 @@ complex_dealloc(PyObject *op)
op->ob_type->tp_free(op);
}
-
static PyObject *
-complex_format(PyComplexObject *v, int precision, char format_code)
+complex_repr(PyComplexObject *v)
{
+ int precision = 0;
+ char format_code = 'r';
PyObject *result = NULL;
Py_ssize_t len;
@@ -344,6 +345,8 @@ complex_format(PyComplexObject *v, int precision, char format_code)
char *tail = "";
if (v->cval.real == 0. && copysign(1.0, v->cval.real)==1.0) {
+ /* Real part is +0: just output the imaginary part and do not
+ include parens. */
re = "";
im = PyOS_double_to_string(v->cval.imag, format_code,
precision, 0, NULL);
@@ -352,7 +355,8 @@ complex_format(PyComplexObject *v, int precision, char format_code)
goto done;
}
} else {
- /* Format imaginary part with sign, real part without */
+ /* Format imaginary part with sign, real part without. Include
+ parens in the result. */
pre = PyOS_double_to_string(v->cval.real, format_code,
precision, 0, NULL);
if (!pre) {
@@ -371,7 +375,7 @@ complex_format(PyComplexObject *v, int precision, char format_code)
tail = ")";
}
/* Alloc the final buffer. Add one for the "j" in the format string,
- and one for the trailing zero. */
+ and one for the trailing zero byte. */
len = strlen(lead) + strlen(re) + strlen(im) + strlen(tail) + 2;
buf = PyMem_Malloc(len);
if (!buf) {
@@ -388,27 +392,15 @@ complex_format(PyComplexObject *v, int precision, char format_code)
return result;
}
-static PyObject *
-complex_repr(PyComplexObject *v)
-{
- return complex_format(v, 0, 'r');
-}
-
-static PyObject *
-complex_str(PyComplexObject *v)
-{
- return complex_format(v, PyFloat_STR_PRECISION, 'g');
-}
-
-static long
+static Py_hash_t
complex_hash(PyComplexObject *v)
{
- long hashreal, hashimag, combined;
- hashreal = _Py_HashDouble(v->cval.real);
- if (hashreal == -1)
+ Py_uhash_t hashreal, hashimag, combined;
+ hashreal = (Py_uhash_t)_Py_HashDouble(v->cval.real);
+ if (hashreal == (Py_uhash_t)-1)
return -1;
- hashimag = _Py_HashDouble(v->cval.imag);
- if (hashimag == -1)
+ hashimag = (Py_uhash_t)_Py_HashDouble(v->cval.imag);
+ if (hashimag == (Py_uhash_t)-1)
return -1;
/* Note: if the imaginary part is 0, hashimag is 0 now,
* so the following returns hashreal unchanged. This is
@@ -416,10 +408,10 @@ complex_hash(PyComplexObject *v)
* compare equal must have the same hash value, so that
* hash(x + 0*j) must equal hash(x).
*/
- combined = hashreal + 1000003 * hashimag;
- if (combined == -1)
- combined = -2;
- return combined;
+ combined = hashreal + _PyHASH_IMAG * hashimag;
+ if (combined == (Py_uhash_t)-1)
+ combined = (Py_uhash_t)-2;
+ return (Py_hash_t)combined;
}
/* This macro may return! */
@@ -504,7 +496,7 @@ complex_div(PyObject *v, PyObject *w)
quot = c_quot(a, b);
PyFPE_END_PROTECT(quot)
if (errno == EDOM) {
- PyErr_SetString(PyExc_ZeroDivisionError, "complex division");
+ PyErr_SetString(PyExc_ZeroDivisionError, "complex division by zero");
return NULL;
}
return PyComplex_FromCComplex(quot);
@@ -620,24 +612,58 @@ static PyObject *
complex_richcompare(PyObject *v, PyObject *w, int op)
{
PyObject *res;
- Py_complex i, j;
- TO_COMPLEX(v, i);
- TO_COMPLEX(w, j);
+ Py_complex i;
+ int equal;
if (op != Py_EQ && op != Py_NE) {
- /* XXX Should eventually return NotImplemented */
- PyErr_SetString(PyExc_TypeError,
- "no ordering relation is defined for complex numbers");
- return NULL;
+ goto Unimplemented;
}
- if ((i.real == j.real && i.imag == j.imag) == (op == Py_EQ))
- res = Py_True;
+ assert(PyComplex_Check(v));
+ TO_COMPLEX(v, i);
+
+ if (PyLong_Check(w)) {
+ /* Check for 0.0 imaginary part first to avoid the rich
+ * comparison when possible.
+ */
+ if (i.imag == 0.0) {
+ PyObject *j, *sub_res;
+ j = PyFloat_FromDouble(i.real);
+ if (j == NULL)
+ return NULL;
+
+ sub_res = PyObject_RichCompare(j, w, op);
+ Py_DECREF(j);
+ return sub_res;
+ }
+ else {
+ equal = 0;
+ }
+ }
+ else if (PyFloat_Check(w)) {
+ equal = (i.real == PyFloat_AsDouble(w) && i.imag == 0.0);
+ }
+ else if (PyComplex_Check(w)) {
+ Py_complex j;
+
+ TO_COMPLEX(w, j);
+ equal = (i.real == j.real && i.imag == j.imag);
+ }
+ else {
+ goto Unimplemented;
+ }
+
+ if (equal == (op == Py_EQ))
+ res = Py_True;
else
- res = Py_False;
+ res = Py_False;
Py_INCREF(res);
return res;
+
+Unimplemented:
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
}
static PyObject *
@@ -738,26 +764,30 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
char *end;
double x=0.0, y=0.0, z;
int got_bracket=0;
- char s_buffer[256];
+ PyObject *s_buffer = NULL;
Py_ssize_t len;
if (PyUnicode_Check(v)) {
- if (PyUnicode_GET_SIZE(v) >= (Py_ssize_t)sizeof(s_buffer)) {
- PyErr_SetString(PyExc_ValueError,
- "complex() literal too large to convert");
+ Py_ssize_t i, buflen = PyUnicode_GET_SIZE(v);
+ Py_UNICODE *bufptr;
+ s_buffer = PyUnicode_TransformDecimalToASCII(
+ PyUnicode_AS_UNICODE(v), buflen);
+ if (s_buffer == NULL)
return NULL;
+ /* Replace non-ASCII whitespace with ' ' */
+ bufptr = PyUnicode_AS_UNICODE(s_buffer);
+ for (i = 0; i < buflen; i++) {
+ Py_UNICODE ch = bufptr[i];
+ if (ch > 127 && Py_UNICODE_ISSPACE(ch))
+ bufptr[i] = ' ';
}
- if (PyUnicode_EncodeDecimal(PyUnicode_AS_UNICODE(v),
- PyUnicode_GET_SIZE(v),
- s_buffer,
- NULL))
- return NULL;
- s = s_buffer;
- len = strlen(s);
+ s = _PyUnicode_AsStringAndSize(s_buffer, &len);
+ if (s == NULL)
+ goto error;
}
else if (PyObject_AsCharBuffer(v, &s, &len)) {
PyErr_SetString(PyExc_TypeError,
- "complex() arg is not a string");
+ "complex() argument must be a string or a number");
return NULL;
}
@@ -800,7 +830,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
if (PyErr_ExceptionMatches(PyExc_ValueError))
PyErr_Clear();
else
- return NULL;
+ goto error;
}
if (end != s) {
/* all 4 forms starting with <float> land here */
@@ -813,7 +843,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
if (PyErr_ExceptionMatches(PyExc_ValueError))
PyErr_Clear();
else
- return NULL;
+ goto error;
}
if (end != s)
/* <float><signed-float>j */
@@ -868,24 +898,26 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
if (s-start != len)
goto parse_error;
+ Py_XDECREF(s_buffer);
return complex_subtype_from_doubles(type, x, y);
parse_error:
PyErr_SetString(PyExc_ValueError,
"complex() arg is a malformed string");
+ error:
+ Py_XDECREF(s_buffer);
return NULL;
}
static PyObject *
complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
- PyObject *r, *i, *tmp, *f;
+ PyObject *r, *i, *tmp;
PyNumberMethods *nbr, *nbi = NULL;
Py_complex cr, ci;
int own_r = 0;
int cr_is_complex = 0;
int ci_is_complex = 0;
- static PyObject *complexstr;
static char *kwlist[] = {"real", "imag", 0};
r = Py_False;
@@ -920,26 +952,15 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
}
- /* XXX Hack to support classes with __complex__ method */
- if (complexstr == NULL) {
- complexstr = PyUnicode_InternFromString("__complex__");
- if (complexstr == NULL)
- return NULL;
- }
- f = PyObject_GetAttr(r, complexstr);
- if (f == NULL)
- PyErr_Clear();
- else {
- PyObject *args = PyTuple_New(0);
- if (args == NULL)
- return NULL;
- r = PyEval_CallObject(f, args);
- Py_DECREF(args);
- Py_DECREF(f);
- if (r == NULL)
- return NULL;
+ tmp = try_complex_special_method(r);
+ if (tmp) {
+ r = tmp;
own_r = 1;
}
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+
nbr = r->ob_type->tp_as_number;
if (i != NULL)
nbi = i->ob_type->tp_as_number;
@@ -1079,7 +1100,7 @@ PyTypeObject PyComplex_Type = {
0, /* tp_as_mapping */
(hashfunc)complex_hash, /* tp_hash */
0, /* tp_call */
- (reprfunc)complex_str, /* tp_str */
+ (reprfunc)complex_repr, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
@@ -1104,5 +1125,3 @@ PyTypeObject PyComplex_Type = {
complex_new, /* tp_new */
PyObject_Del, /* tp_free */
};
-
-#endif
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 9eda4bdd7d..93daefd75f 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -92,7 +92,7 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
"descriptor '%V' for type '%s' "
"needs either an object or a type",
descr_name((PyDescrObject *)descr), "?",
- descr->d_type->tp_name);
+ PyDescr_TYPE(descr)->tp_name);
return NULL;
}
}
@@ -101,16 +101,16 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
"descriptor '%V' for type '%s' "
"needs a type, not a '%s' as arg 2",
descr_name((PyDescrObject *)descr), "?",
- descr->d_type->tp_name,
+ PyDescr_TYPE(descr)->tp_name,
type->ob_type->tp_name);
return NULL;
}
- if (!PyType_IsSubtype((PyTypeObject *)type, descr->d_type)) {
+ if (!PyType_IsSubtype((PyTypeObject *)type, PyDescr_TYPE(descr))) {
PyErr_Format(PyExc_TypeError,
"descriptor '%V' for type '%s' "
"doesn't apply to type '%s'",
descr_name((PyDescrObject *)descr), "?",
- descr->d_type->tp_name,
+ PyDescr_TYPE(descr)->tp_name,
((PyTypeObject *)type)->tp_name);
return NULL;
}
@@ -149,7 +149,7 @@ getset_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *type)
PyErr_Format(PyExc_AttributeError,
"attribute '%V' of '%.100s' objects is not readable",
descr_name((PyDescrObject *)descr), "?",
- descr->d_type->tp_name);
+ PyDescr_TYPE(descr)->tp_name);
return NULL;
}
@@ -204,7 +204,7 @@ getset_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value)
PyErr_Format(PyExc_AttributeError,
"attribute '%V' of '%.100s' objects is not writable",
descr_name((PyDescrObject *)descr), "?",
- descr->d_type->tp_name);
+ PyDescr_TYPE(descr)->tp_name);
return -1;
}
@@ -222,18 +222,18 @@ methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwds)
"descriptor '%V' of '%.100s' "
"object needs an argument",
descr_name((PyDescrObject *)descr), "?",
- descr->d_type->tp_name);
+ PyDescr_TYPE(descr)->tp_name);
return NULL;
}
self = PyTuple_GET_ITEM(args, 0);
if (!_PyObject_RealIsSubclass((PyObject *)Py_TYPE(self),
- (PyObject *)(descr->d_type))) {
+ (PyObject *)PyDescr_TYPE(descr))) {
PyErr_Format(PyExc_TypeError,
"descriptor '%V' "
"requires a '%.100s' object "
"but received a '%.100s'",
descr_name((PyDescrObject *)descr), "?",
- descr->d_type->tp_name,
+ PyDescr_TYPE(descr)->tp_name,
self->ob_type->tp_name);
return NULL;
}
@@ -258,7 +258,7 @@ classmethoddescr_call(PyMethodDescrObject *descr, PyObject *args,
{
PyObject *func, *result;
- func = PyCFunction_New(descr->d_method, (PyObject *)descr->d_type);
+ func = PyCFunction_New(descr->d_method, (PyObject *)PyDescr_TYPE(descr));
if (func == NULL)
return NULL;
@@ -281,18 +281,18 @@ wrapperdescr_call(PyWrapperDescrObject *descr, PyObject *args, PyObject *kwds)
"descriptor '%V' of '%.100s' "
"object needs an argument",
descr_name((PyDescrObject *)descr), "?",
- descr->d_type->tp_name);
+ PyDescr_TYPE(descr)->tp_name);
return NULL;
}
self = PyTuple_GET_ITEM(args, 0);
if (!_PyObject_RealIsSubclass((PyObject *)Py_TYPE(self),
- (PyObject *)(descr->d_type))) {
+ (PyObject *)PyDescr_TYPE(descr))) {
PyErr_Format(PyExc_TypeError,
"descriptor '%V' "
"requires a '%.100s' object "
"but received a '%.100s'",
descr_name((PyDescrObject *)descr), "?",
- descr->d_type->tp_name,
+ PyDescr_TYPE(descr)->tp_name,
self->ob_type->tp_name);
return NULL;
}
@@ -712,19 +712,19 @@ proxy_get(proxyobject *pp, PyObject *args)
static PyObject *
proxy_keys(proxyobject *pp)
{
- return PyMapping_Keys(pp->dict);
+ return PyObject_CallMethod(pp->dict, "keys", NULL);
}
static PyObject *
proxy_values(proxyobject *pp)
{
- return PyMapping_Values(pp->dict);
+ return PyObject_CallMethod(pp->dict, "values", NULL);
}
static PyObject *
proxy_items(proxyobject *pp)
{
- return PyMapping_Items(pp->dict);
+ return PyObject_CallMethod(pp->dict, "items", NULL);
}
static PyObject *
@@ -924,10 +924,10 @@ wrapper_richcompare(PyObject *a, PyObject *b, int op)
return v;
}
-static long
+static Py_hash_t
wrapper_hash(wrapperobject *wp)
{
- int x, y;
+ Py_hash_t x, y;
x = _Py_HashPointer(wp->descr);
if (x == -1)
return -1;
@@ -957,7 +957,7 @@ static PyMemberDef wrapper_members[] = {
static PyObject *
wrapper_objclass(wrapperobject *wp)
{
- PyObject *c = (PyObject *)wp->descr->d_type;
+ PyObject *c = (PyObject *)PyDescr_TYPE(wp->descr);
Py_INCREF(c);
return c;
@@ -1068,7 +1068,7 @@ PyWrapper_New(PyObject *d, PyObject *self)
assert(PyObject_TypeCheck(d, &PyWrapperDescr_Type));
descr = (PyWrapperDescrObject *)d;
assert(_PyObject_RealIsSubclass((PyObject *)Py_TYPE(self),
- (PyObject *)(descr->d_type)));
+ (PyObject *)PyDescr_TYPE(descr)));
wp = PyObject_GC_New(wrapperobject, &wrappertype);
if (wp != NULL) {
@@ -1124,7 +1124,7 @@ typedef struct {
} propertyobject;
static PyObject * property_copy(PyObject *, PyObject *, PyObject *,
- PyObject *, PyObject *);
+ PyObject *);
static PyMemberDef property_members[] = {
{"fget", T_OBJECT, offsetof(propertyobject, prop_get), READONLY},
@@ -1141,7 +1141,7 @@ PyDoc_STRVAR(getter_doc,
static PyObject *
property_getter(PyObject *self, PyObject *getter)
{
- return property_copy(self, getter, NULL, NULL, NULL);
+ return property_copy(self, getter, NULL, NULL);
}
@@ -1151,7 +1151,7 @@ PyDoc_STRVAR(setter_doc,
static PyObject *
property_setter(PyObject *self, PyObject *setter)
{
- return property_copy(self, NULL, setter, NULL, NULL);
+ return property_copy(self, NULL, setter, NULL);
}
@@ -1161,7 +1161,7 @@ PyDoc_STRVAR(deleter_doc,
static PyObject *
property_deleter(PyObject *self, PyObject *deleter)
{
- return property_copy(self, NULL, NULL, deleter, NULL);
+ return property_copy(self, NULL, NULL, deleter);
}
@@ -1199,7 +1199,7 @@ property_descr_get(PyObject *self, PyObject *obj, PyObject *type)
PyErr_SetString(PyExc_AttributeError, "unreadable attribute");
return NULL;
}
- return PyObject_CallFunction(gs->prop_get, "(O)", obj);
+ return PyObject_CallFunctionObjArgs(gs->prop_get, obj, NULL);
}
static int
@@ -1220,9 +1220,9 @@ property_descr_set(PyObject *self, PyObject *obj, PyObject *value)
return -1;
}
if (value == NULL)
- res = PyObject_CallFunction(func, "(O)", obj);
+ res = PyObject_CallFunctionObjArgs(func, obj, NULL);
else
- res = PyObject_CallFunction(func, "(OO)", obj, value);
+ res = PyObject_CallFunctionObjArgs(func, obj, value, NULL);
if (res == NULL)
return -1;
Py_DECREF(res);
@@ -1230,11 +1230,10 @@ property_descr_set(PyObject *self, PyObject *obj, PyObject *value)
}
static PyObject *
-property_copy(PyObject *old, PyObject *get, PyObject *set, PyObject *del,
- PyObject *doc)
+property_copy(PyObject *old, PyObject *get, PyObject *set, PyObject *del)
{
propertyobject *pold = (propertyobject *)old;
- PyObject *new, *type;
+ PyObject *new, *type, *doc;
type = PyObject_Type(old);
if (type == NULL)
@@ -1252,15 +1251,12 @@ property_copy(PyObject *old, PyObject *get, PyObject *set, PyObject *del,
Py_XDECREF(del);
del = pold->prop_del ? pold->prop_del : Py_None;
}
- if (doc == NULL || doc == Py_None) {
- Py_XDECREF(doc);
- if (pold->getter_doc && get != Py_None) {
- /* make _init use __doc__ from getter */
- doc = Py_None;
- }
- else {
- doc = pold->prop_doc ? pold->prop_doc : Py_None;
- }
+ if (pold->getter_doc && get != Py_None) {
+ /* make _init use __doc__ from getter */
+ doc = Py_None;
+ }
+ else {
+ doc = pold->prop_doc ? pold->prop_doc : Py_None;
}
new = PyObject_CallFunction(type, "OOOO", get, set, del, doc);
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 8492c618d8..3fa5cc4b95 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -124,15 +124,6 @@ masked); and the PyDictObject struct required a member to hold the table's
polynomial. In Tim's experiments the current scheme ran faster, produced
equally good collision statistics, needed less code & used less memory.
-Theoretical Python 2.5 headache: hash codes are only C "long", but
-sizeof(Py_ssize_t) > sizeof(long) may be possible. In that case, and if a
-dict is genuinely huge, then only the slots directly reachable via indexing
-by a C long can be the first slot in a probe sequence. The probe sequence
-will still eventually reach every slot in the table, but the collision rate
-on initial probes may be much higher than this scheme was designed for.
-Getting a hash code as fat as Py_ssize_t is the only real cure. But in
-practice, this probably won't make a lick of difference for many years (at
-which point everyone will have terabytes of RAM on 64-bit boxes).
*/
/* Object used as dummy key to fill deleted entries */
@@ -148,7 +139,7 @@ _PyDict_Dummy(void)
/* forward declarations */
static PyDictEntry *
-lookdict_unicode(PyDictObject *mp, PyObject *key, long hash);
+lookdict_unicode(PyDictObject *mp, PyObject *key, Py_hash_t hash);
#ifdef SHOW_CONVERSION_COUNTS
static long created = 0L;
@@ -318,7 +309,7 @@ the caller can (if it wishes) add the <key, value> pair to the returned
PyDictEntry*.
*/
static PyDictEntry *
-lookdict(PyDictObject *mp, PyObject *key, register long hash)
+lookdict(PyDictObject *mp, PyObject *key, register Py_hash_t hash)
{
register size_t i;
register size_t perturb;
@@ -407,7 +398,7 @@ lookdict(PyDictObject *mp, PyObject *key, register long hash)
* This is valuable because dicts with only unicode keys are very common.
*/
static PyDictEntry *
-lookdict_unicode(PyDictObject *mp, PyObject *key, register long hash)
+lookdict_unicode(PyDictObject *mp, PyObject *key, register Py_hash_t hash)
{
register size_t i;
register size_t perturb;
@@ -458,6 +449,21 @@ lookdict_unicode(PyDictObject *mp, PyObject *key, register long hash)
return 0;
}
+int
+_PyDict_HasOnlyStringKeys(PyObject *dict)
+{
+ Py_ssize_t pos = 0;
+ PyObject *key, *value;
+ assert(PyDict_Check(dict));
+ /* Shortcut */
+ if (((PyDictObject *)dict)->ma_lookup == lookdict_unicode)
+ return 1;
+ while (PyDict_Next(dict, &pos, &key, &value))
+ if (!PyUnicode_Check(key))
+ return 0;
+ return 1;
+}
+
#ifdef SHOW_TRACK_COUNT
#define INCREASE_TRACK_COUNT \
(count_tracked++, count_untracked--);
@@ -512,11 +518,11 @@ Eats a reference to key and one to value.
Returns -1 if an error occurred, or 0 on success.
*/
static int
-insertdict(register PyDictObject *mp, PyObject *key, long hash, PyObject *value)
+insertdict(register PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject *value)
{
PyObject *old_value;
register PyDictEntry *ep;
- typedef PyDictEntry *(*lookupfunc)(PyDictObject *, PyObject *, long);
+ typedef PyDictEntry *(*lookupfunc)(PyDictObject *, PyObject *, Py_hash_t);
assert(mp->ma_lookup != NULL);
ep = mp->ma_lookup(mp, key, hash);
@@ -540,7 +546,7 @@ insertdict(register PyDictObject *mp, PyObject *key, long hash, PyObject *value)
Py_DECREF(dummy);
}
ep->me_key = key;
- ep->me_hash = (Py_ssize_t)hash;
+ ep->me_hash = hash;
ep->me_value = value;
mp->ma_used++;
}
@@ -556,7 +562,7 @@ Note that no refcounts are changed by this routine; if needed, the caller
is responsible for incref'ing `key` and `value`.
*/
static void
-insertdict_clean(register PyDictObject *mp, PyObject *key, long hash,
+insertdict_clean(register PyDictObject *mp, PyObject *key, Py_hash_t hash,
PyObject *value)
{
register size_t i;
@@ -575,7 +581,7 @@ insertdict_clean(register PyDictObject *mp, PyObject *key, long hash,
assert(ep->me_value == NULL);
mp->ma_fill++;
ep->me_key = key;
- ep->me_hash = (Py_ssize_t)hash;
+ ep->me_hash = hash;
ep->me_value = value;
mp->ma_used++;
}
@@ -652,8 +658,7 @@ dictresize(PyDictObject *mp, Py_ssize_t minused)
for (ep = oldtable; i > 0; ep++) {
if (ep->me_value != NULL) { /* active entry */
--i;
- insertdict_clean(mp, ep->me_key, (long)ep->me_hash,
- ep->me_value);
+ insertdict_clean(mp, ep->me_key, ep->me_hash, ep->me_value);
}
else if (ep->me_key != NULL) { /* dummy entry */
--i;
@@ -698,7 +703,7 @@ _PyDict_NewPresized(Py_ssize_t minused)
PyObject *
PyDict_GetItem(PyObject *op, PyObject *key)
{
- long hash;
+ Py_hash_t hash;
PyDictObject *mp = (PyDictObject *)op;
PyDictEntry *ep;
PyThreadState *tstate;
@@ -719,7 +724,8 @@ PyDict_GetItem(PyObject *op, PyObject *key)
Let's just hope that no exception occurs then... This must be
_PyThreadState_Current and not PyThreadState_GET() because in debug
mode, the latter complains if tstate is NULL. */
- tstate = _PyThreadState_Current;
+ tstate = (PyThreadState*)_Py_atomic_load_relaxed(
+ &_PyThreadState_Current);
if (tstate != NULL && tstate->curexc_type != NULL) {
/* preserve the existing exception */
PyObject *err_type, *err_value, *err_tb;
@@ -747,7 +753,7 @@ PyDict_GetItem(PyObject *op, PyObject *key)
PyObject *
PyDict_GetItemWithError(PyObject *op, PyObject *key)
{
- long hash;
+ Py_hash_t hash;
PyDictObject*mp = (PyDictObject *)op;
PyDictEntry *ep;
@@ -780,7 +786,7 @@ int
PyDict_SetItem(register PyObject *op, PyObject *key, PyObject *value)
{
register PyDictObject *mp;
- register long hash;
+ register Py_hash_t hash;
register Py_ssize_t n_used;
if (!PyDict_Check(op)) {
@@ -826,7 +832,7 @@ int
PyDict_DelItem(PyObject *op, PyObject *key)
{
register PyDictObject *mp;
- register long hash;
+ register Py_hash_t hash;
register PyDictEntry *ep;
PyObject *old_value, *old_key;
@@ -972,7 +978,7 @@ PyDict_Next(PyObject *op, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
/* Internal version of PyDict_Next that returns a hash value in addition to the key and value.*/
int
-_PyDict_Next(PyObject *op, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue, long *phash)
+_PyDict_Next(PyObject *op, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue, Py_hash_t *phash)
{
register Py_ssize_t i;
register Py_ssize_t mask;
@@ -990,7 +996,7 @@ _PyDict_Next(PyObject *op, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue,
*ppos = i+1;
if (i > mask)
return 0;
- *phash = (long)(ep[i].me_hash);
+ *phash = ep[i].me_hash;
if (pkey)
*pkey = ep[i].me_key;
if (pvalue)
@@ -1112,7 +1118,7 @@ static PyObject *
dict_subscript(PyDictObject *mp, register PyObject *key)
{
PyObject *v;
- long hash;
+ Py_hash_t hash;
PyDictEntry *ep;
assert(mp->ma_table != NULL);
if (!PyUnicode_CheckExact(key) ||
@@ -1306,7 +1312,7 @@ dict_fromkeys(PyObject *cls, PyObject *args)
PyObject *oldvalue;
Py_ssize_t pos = 0;
PyObject *key;
- long hash;
+ Py_hash_t hash;
if (dictresize(mp, Py_SIZE(seq)))
return NULL;
@@ -1324,7 +1330,7 @@ dict_fromkeys(PyObject *cls, PyObject *args)
PyDictObject *mp = (PyDictObject *)d;
Py_ssize_t pos = 0;
PyObject *key;
- long hash;
+ Py_hash_t hash;
if (dictresize(mp, PySet_GET_SIZE(seq)))
return NULL;
@@ -1386,8 +1392,12 @@ dict_update_common(PyObject *self, PyObject *args, PyObject *kwds, char *methnam
else
result = PyDict_MergeFromSeq2(self, arg, 1);
}
- if (result == 0 && kwds != NULL)
- result = PyDict_Merge(self, kwds, 1);
+ if (result == 0 && kwds != NULL) {
+ if (PyArg_ValidateKeywordArguments(kwds))
+ result = PyDict_Merge(self, kwds, 1);
+ else
+ result = -1;
+ }
return result;
}
@@ -1529,7 +1539,7 @@ PyDict_Merge(PyObject *a, PyObject *b, int override)
Py_INCREF(entry->me_key);
Py_INCREF(entry->me_value);
if (insertdict(mp, entry->me_key,
- (long)entry->me_hash,
+ entry->me_hash,
entry->me_value) != 0)
return -1;
}
@@ -1712,7 +1722,7 @@ dict_richcompare(PyObject *v, PyObject *w, int op)
static PyObject *
dict_contains(register PyDictObject *mp, PyObject *key)
{
- long hash;
+ Py_hash_t hash;
PyDictEntry *ep;
if (!PyUnicode_CheckExact(key) ||
@@ -1733,7 +1743,7 @@ dict_get(register PyDictObject *mp, PyObject *args)
PyObject *key;
PyObject *failobj = Py_None;
PyObject *val = NULL;
- long hash;
+ Py_hash_t hash;
PyDictEntry *ep;
if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &failobj))
@@ -1762,7 +1772,7 @@ dict_setdefault(register PyDictObject *mp, PyObject *args)
PyObject *key;
PyObject *failobj = Py_None;
PyObject *val = NULL;
- long hash;
+ Py_hash_t hash;
PyDictEntry *ep;
if (!PyArg_UnpackTuple(args, "setdefault", 1, 2, &key, &failobj))
@@ -1798,7 +1808,7 @@ dict_clear(register PyDictObject *mp)
static PyObject *
dict_pop(PyDictObject *mp, PyObject *args)
{
- long hash;
+ Py_hash_t hash;
PyDictEntry *ep;
PyObject *old_value, *old_key;
PyObject *key, *deflt = NULL;
@@ -1843,7 +1853,7 @@ dict_pop(PyDictObject *mp, PyObject *args)
static PyObject *
dict_popitem(PyDictObject *mp)
{
- Py_ssize_t i = 0;
+ Py_hash_t i = 0;
PyDictEntry *ep;
PyObject *res;
@@ -2018,7 +2028,7 @@ static PyMethodDef mapp_methods[] = {
int
PyDict_Contains(PyObject *op, PyObject *key)
{
- long hash;
+ Py_hash_t hash;
PyDictObject *mp = (PyDictObject *)op;
PyDictEntry *ep;
@@ -2034,7 +2044,7 @@ PyDict_Contains(PyObject *op, PyObject *key)
/* Internal version of PyDict_Contains used when the hash value is already known */
int
-_PyDict_Contains(PyObject *op, PyObject *key, long hash)
+_PyDict_Contains(PyObject *op, PyObject *key, Py_hash_t hash)
{
PyDictObject *mp = (PyDictObject *)op;
PyDictEntry *ep;
@@ -2123,7 +2133,7 @@ PyTypeObject PyDict_Type = {
0, /* tp_as_number */
&dict_as_sequence, /* tp_as_sequence */
&dict_as_mapping, /* tp_as_mapping */
- (hashfunc)PyObject_HashNotImplemented, /* tp_hash */
+ PyObject_HashNotImplemented, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
@@ -2786,7 +2796,63 @@ static PyNumberMethods dictviews_as_number = {
(binaryfunc)dictviews_or, /*nb_or*/
};
+static PyObject*
+dictviews_isdisjoint(PyObject *self, PyObject *other)
+{
+ PyObject *it;
+ PyObject *item = NULL;
+
+ if (self == other) {
+ if (dictview_len((dictviewobject *)self) == 0)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+ }
+
+ /* Iterate over the shorter object (only if other is a set,
+ * because PySequence_Contains may be expensive otherwise): */
+ if (PyAnySet_Check(other) || PyDictViewSet_Check(other)) {
+ Py_ssize_t len_self = dictview_len((dictviewobject *)self);
+ Py_ssize_t len_other = PyObject_Size(other);
+ if (len_other == -1)
+ return NULL;
+
+ if ((len_other > len_self)) {
+ PyObject *tmp = other;
+ other = self;
+ self = tmp;
+ }
+ }
+
+ it = PyObject_GetIter(other);
+ if (it == NULL)
+ return NULL;
+
+ while ((item = PyIter_Next(it)) != NULL) {
+ int contains = PySequence_Contains(self, item);
+ Py_DECREF(item);
+ if (contains == -1) {
+ Py_DECREF(it);
+ return NULL;
+ }
+
+ if (contains) {
+ Py_DECREF(it);
+ Py_RETURN_FALSE;
+ }
+ }
+ Py_DECREF(it);
+ if (PyErr_Occurred())
+ return NULL; /* PyIter_Next raised an exception. */
+ Py_RETURN_TRUE;
+}
+
+PyDoc_STRVAR(isdisjoint_doc,
+"Return True if the view and the given iterable have a null intersection.");
+
static PyMethodDef dictkeys_methods[] = {
+ {"isdisjoint", (PyCFunction)dictviews_isdisjoint, METH_O,
+ isdisjoint_doc},
{NULL, NULL} /* sentinel */
};
@@ -2871,6 +2937,8 @@ static PySequenceMethods dictitems_as_sequence = {
};
static PyMethodDef dictitems_methods[] = {
+ {"isdisjoint", (PyCFunction)dictviews_isdisjoint, METH_O,
+ isdisjoint_doc},
{NULL, NULL} /* sentinel */
};
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index b579f9672f..00a33463cd 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -159,12 +159,13 @@ enum_next(enumobject *en)
}
PyDoc_STRVAR(enum_doc,
-"enumerate(iterable) -> iterator for index, value of iterable\n"
+"enumerate(iterable[, start]) -> iterator for index, value of iterable\n"
"\n"
"Return an enumerate object. iterable must be another object that supports\n"
"iteration. The enumerate object yields pairs containing a count (from\n"
-"zero) and a value yielded by the iterable argument. enumerate is useful\n"
-"for obtaining an indexed list: (0, seq[0]), (1, seq[1]), (2, seq[2]), ...");
+"start, which defaults to zero) and a value yielded by the iterable argument.\n"
+"enumerate is useful for obtaining an indexed list:\n"
+" (0, seq[0]), (1, seq[1]), (2, seq[2]), ...");
PyTypeObject PyEnum_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 1531867d8d..0106ba3df5 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -959,20 +959,27 @@ SyntaxError_traverse(PySyntaxErrorObject *self, visitproc visit, void *arg)
/* This is called "my_basename" instead of just "basename" to avoid name
conflicts with glibc; basename is already prototyped if _GNU_SOURCE is
defined, and Python does define that. */
-static char *
-my_basename(char *name)
-{
- char *cp = name;
- char *result = name;
-
- if (name == NULL)
- return "???";
- while (*cp != '\0') {
- if (*cp == SEP)
- result = cp + 1;
- ++cp;
+static PyObject*
+my_basename(PyObject *name)
+{
+ Py_UNICODE *unicode;
+ Py_ssize_t i, size, offset;
+
+ unicode = PyUnicode_AS_UNICODE(name);
+ size = PyUnicode_GET_SIZE(name);
+ offset = 0;
+ for(i=0; i < size; i++) {
+ if (unicode[i] == SEP)
+ offset = i + 1;
+ }
+ if (offset != 0) {
+ return PyUnicode_FromUnicode(
+ PyUnicode_AS_UNICODE(name) + offset,
+ size - offset);
+ } else {
+ Py_INCREF(name);
+ return name;
}
- return result;
}
@@ -980,7 +987,8 @@ static PyObject *
SyntaxError_str(PySyntaxErrorObject *self)
{
int have_lineno = 0;
- char *filename = 0;
+ PyObject *filename;
+ PyObject *result;
/* Below, we always ignore overflow errors, just printing -1.
Still, we cannot allow an OverflowError to be raised, so
we need to call PyLong_AsLongAndOverflow. */
@@ -990,7 +998,11 @@ SyntaxError_str(PySyntaxErrorObject *self)
lineno here */
if (self->filename && PyUnicode_Check(self->filename)) {
- filename = _PyUnicode_AsString(self->filename);
+ filename = my_basename(self->filename);
+ if (filename == NULL)
+ return NULL;
+ } else {
+ filename = NULL;
}
have_lineno = (self->lineno != NULL) && PyLong_CheckExact(self->lineno);
@@ -998,18 +1010,20 @@ SyntaxError_str(PySyntaxErrorObject *self)
return PyObject_Str(self->msg ? self->msg : Py_None);
if (filename && have_lineno)
- return PyUnicode_FromFormat("%S (%s, line %ld)",
+ result = PyUnicode_FromFormat("%S (%U, line %ld)",
self->msg ? self->msg : Py_None,
- my_basename(filename),
+ filename,
PyLong_AsLongAndOverflow(self->lineno, &overflow));
else if (filename)
- return PyUnicode_FromFormat("%S (%s)",
+ result = PyUnicode_FromFormat("%S (%U)",
self->msg ? self->msg : Py_None,
- my_basename(filename));
+ filename);
else /* only have_lineno */
- return PyUnicode_FromFormat("%S (line %ld)",
+ result = PyUnicode_FromFormat("%S (line %ld)",
self->msg ? self->msg : Py_None,
PyLong_AsLongAndOverflow(self->lineno, &overflow));
+ Py_XDECREF(filename);
+ return result;
}
static PyMemberDef SyntaxError_members[] = {
@@ -1496,7 +1510,7 @@ PyUnicodeEncodeError_Create(
const char *encoding, const Py_UNICODE *object, Py_ssize_t length,
Py_ssize_t start, Py_ssize_t end, const char *reason)
{
- return PyObject_CallFunction(PyExc_UnicodeEncodeError, "Uu#nnU",
+ return PyObject_CallFunction(PyExc_UnicodeEncodeError, "su#nns",
encoding, object, length, start, end, reason);
}
@@ -1608,7 +1622,7 @@ PyUnicodeDecodeError_Create(
const char *encoding, const char *object, Py_ssize_t length,
Py_ssize_t start, Py_ssize_t end, const char *reason)
{
- return PyObject_CallFunction(PyExc_UnicodeDecodeError, "Uy#nnU",
+ return PyObject_CallFunction(PyExc_UnicodeDecodeError, "sy#nns",
encoding, object, length, start, end, reason);
}
@@ -1922,6 +1936,7 @@ SimpleExtendsException(PyExc_Warning, UnicodeWarning,
"Base class for warnings about Unicode related problems, mostly\n"
"related to conversion problems.");
+
/*
* BytesWarning extends Warning
*/
@@ -1930,6 +1945,13 @@ SimpleExtendsException(PyExc_Warning, BytesWarning,
"related to conversion from str or comparing to str.");
+/*
+ * ResourceWarning extends Warning
+ */
+SimpleExtendsException(PyExc_Warning, ResourceWarning,
+ "Base class for warnings about resource usage.");
+
+
/* Pre-computed RuntimeError instance for when recursion depth is reached.
Meant to be used when normalizing the exception for exceeding the recursion
@@ -2004,6 +2026,7 @@ _PyExc_Init(void)
PRE_INIT(ImportWarning)
PRE_INIT(UnicodeWarning)
PRE_INIT(BytesWarning)
+ PRE_INIT(ResourceWarning)
bltinmod = PyImport_ImportModule("builtins");
if (bltinmod == NULL)
@@ -2066,6 +2089,7 @@ _PyExc_Init(void)
POST_INIT(ImportWarning)
POST_INIT(UnicodeWarning)
POST_INIT(BytesWarning)
+ POST_INIT(ResourceWarning)
preallocate_memerrors();
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index b36aa02f0c..d20f196b27 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -29,7 +29,7 @@ PyObject *
PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding,
char *errors, char *newline, int closefd)
{
- PyObject *io, *stream, *nameobj = NULL;
+ PyObject *io, *stream;
io = PyImport_ImportModule("io");
if (io == NULL)
@@ -40,16 +40,8 @@ PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding,
Py_DECREF(io);
if (stream == NULL)
return NULL;
- if (name != NULL) {
- nameobj = PyUnicode_FromString(name);
- if (nameobj == NULL)
- PyErr_Clear();
- else {
- if (PyObject_SetAttrString(stream, "name", nameobj) < 0)
- PyErr_Clear();
- Py_DECREF(nameobj);
- }
- }
+ /* ignore name attribute because the name attribute of _BufferedIOMixin
+ and TextIOWrapper is read only */
return stream;
}
@@ -352,7 +344,7 @@ stdprinter_new(PyTypeObject *type, PyObject *args, PyObject *kews)
}
static int
-fileio_init(PyObject *self, PyObject *args, PyObject *kwds)
+stdprinter_init(PyObject *self, PyObject *args, PyObject *kwds)
{
PyErr_SetString(PyExc_TypeError,
"cannot create 'stderrprinter' instances");
@@ -398,7 +390,13 @@ stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS
errno = 0;
+#if defined(MS_WIN64) || defined(MS_WINDOWS)
+ if (n > INT_MAX)
+ n = INT_MAX;
+ n = write(self->fd, c, (int)n);
+#else
n = write(self->fd, c, n);
+#endif
Py_END_ALLOW_THREADS
if (n < 0) {
@@ -517,7 +515,7 @@ PyTypeObject PyStdPrinter_Type = {
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
- fileio_init, /* tp_init */
+ stdprinter_init, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
stdprinter_new, /* tp_new */
PyObject_Del, /* tp_free */
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 8161ed51e2..09c0e961ba 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -5,7 +5,6 @@
for any kind of float exception without losing portability. */
#include "Python.h"
-#include "structseq.h"
#include <ctype.h>
#include <float.h>
@@ -21,7 +20,22 @@
extern int finite(double);
#endif
-/* Special free list -- see comments for same code in intobject.c. */
+/* Special free list
+
+ Since some Python programs can spend much of their time allocating
+ and deallocating floats, these operations should be very fast.
+ Therefore we use a dedicated allocation scheme with a much lower
+ overhead (in space and time) than straight malloc(): a simple
+ dedicated free list, filled when necessary with memory from malloc().
+
+ block_list is a singly-linked list of all PyFloatBlocks ever allocated,
+ linked via their next members. PyFloatBlocks are never returned to the
+ system before shutdown (PyFloat_Fini).
+
+ free_list is a singly-linked list of available PyFloatObjects, linked
+ via abuse of their ob_type members.
+*/
+
#define BLOCK_SIZE 1000 /* 1K less typical malloc overhead */
#define BHEAD_SIZE 8 /* Enough for a 64-bit pointer */
#define N_FLOATOBJECTS ((BLOCK_SIZE - BHEAD_SIZE) / sizeof(PyFloatObject))
@@ -69,7 +83,7 @@ PyFloat_GetMin(void)
static PyTypeObject FloatInfoType;
PyDoc_STRVAR(floatinfo__doc__,
-"sys.floatinfo\n\
+"sys.float_info\n\
\n\
A structseq holding information about the float type. It contains low level\n\
information about the precision and internal representation. Please study\n\
@@ -96,7 +110,7 @@ static PyStructSequence_Field floatinfo_fields[] = {
};
static PyStructSequence_Desc floatinfo_desc = {
- "sys.floatinfo", /* name */
+ "sys.float_info", /* name */
floatinfo__doc__, /* doc */
floatinfo_fields, /* fields */
11
@@ -160,52 +174,58 @@ PyFloat_FromString(PyObject *v)
{
const char *s, *last, *end;
double x;
- char buffer[256]; /* for errors */
- char *s_buffer = NULL;
+ PyObject *s_buffer = NULL;
Py_ssize_t len;
PyObject *result = NULL;
if (PyUnicode_Check(v)) {
- s_buffer = (char *)PyMem_MALLOC(PyUnicode_GET_SIZE(v)+1);
+ Py_ssize_t i, buflen = PyUnicode_GET_SIZE(v);
+ Py_UNICODE *bufptr;
+ s_buffer = PyUnicode_TransformDecimalToASCII(
+ PyUnicode_AS_UNICODE(v), buflen);
if (s_buffer == NULL)
- return PyErr_NoMemory();
- if (PyUnicode_EncodeDecimal(PyUnicode_AS_UNICODE(v),
- PyUnicode_GET_SIZE(v),
- s_buffer,
- NULL))
- goto error;
- s = s_buffer;
- len = strlen(s);
+ return NULL;
+ /* Replace non-ASCII whitespace with ' ' */
+ bufptr = PyUnicode_AS_UNICODE(s_buffer);
+ for (i = 0; i < buflen; i++) {
+ Py_UNICODE ch = bufptr[i];
+ if (ch > 127 && Py_UNICODE_ISSPACE(ch))
+ bufptr[i] = ' ';
+ }
+ s = _PyUnicode_AsStringAndSize(s_buffer, &len);
+ if (s == NULL) {
+ Py_DECREF(s_buffer);
+ return NULL;
+ }
+ last = s + len;
}
else if (PyObject_AsCharBuffer(v, &s, &len)) {
PyErr_SetString(PyExc_TypeError,
- "float() argument must be a string or a number");
+ "float() argument must be a string or a number");
return NULL;
}
last = s + len;
-
- while (Py_ISSPACE(*s))
+ /* strip space */
+ while (s < last && Py_ISSPACE(*s))
s++;
+ while (s < last - 1 && Py_ISSPACE(last[-1]))
+ last--;
/* We don't care about overflow or underflow. If the platform
* supports them, infinities and signed zeroes (on underflow) are
* fine. */
x = PyOS_string_to_double(s, (char **)&end, NULL);
- if (x == -1.0 && PyErr_Occurred())
- goto error;
- while (Py_ISSPACE(*end))
- end++;
- if (end == last)
- result = PyFloat_FromDouble(x);
- else {
- PyOS_snprintf(buffer, sizeof(buffer),
- "invalid literal for float(): %.200s", s);
- PyErr_SetString(PyExc_ValueError, buffer);
+ if (end != last) {
+ PyErr_Format(PyExc_ValueError,
+ "could not convert string to float: "
+ "%R", v);
result = NULL;
}
+ else if (x == -1.0 && PyErr_Occurred())
+ result = NULL;
+ else
+ result = PyFloat_FromDouble(x);
- error:
- if (s_buffer)
- PyMem_FREE(s_buffer);
+ Py_XDECREF(s_buffer);
return result;
}
@@ -290,32 +310,20 @@ convert_to_double(PyObject **v, double *dbl)
}
static PyObject *
-float_str_or_repr(PyFloatObject *v, int precision, char format_code)
+float_repr(PyFloatObject *v)
{
PyObject *result;
char *buf = PyOS_double_to_string(PyFloat_AS_DOUBLE(v),
- format_code, precision,
+ 'r', 0,
Py_DTSF_ADD_DOT_0,
NULL);
if (!buf)
- return PyErr_NoMemory();
+ return PyErr_NoMemory();
result = PyUnicode_FromString(buf);
PyMem_Free(buf);
return result;
}
-static PyObject *
-float_repr(PyFloatObject *v)
-{
- return float_str_or_repr(v, 0, 'r');
-}
-
-static PyObject *
-float_str(PyFloatObject *v)
-{
- return float_str_or_repr(v, PyFloat_STR_PRECISION, 'g');
-}
-
/* Comparison is pretty much a nightmare. When comparing float to float,
* we do it as straightforwardly (and long-windedly) as conceivable, so
* that, e.g., Python x == y delivers the same result as the platform
@@ -519,7 +527,7 @@ float_richcompare(PyObject *v, PyObject *w, int op)
return Py_NotImplemented;
}
-static long
+static Py_hash_t
float_hash(PyFloatObject *v)
{
return _Py_HashDouble(v->ob_fval);
@@ -567,13 +575,11 @@ float_div(PyObject *v, PyObject *w)
double a,b;
CONVERT_TO_DOUBLE(v, a);
CONVERT_TO_DOUBLE(w, b);
-#ifdef Py_NAN
if (b == 0.0) {
PyErr_SetString(PyExc_ZeroDivisionError,
- "float division");
+ "float division by zero");
return NULL;
}
-#endif
PyFPE_START_PROTECT("divide", return 0)
a = a / b;
PyFPE_END_PROTECT(a)
@@ -587,13 +593,11 @@ float_rem(PyObject *v, PyObject *w)
double mod;
CONVERT_TO_DOUBLE(v, vx);
CONVERT_TO_DOUBLE(w, wx);
-#ifdef Py_NAN
if (wx == 0.0) {
PyErr_SetString(PyExc_ZeroDivisionError,
"float modulo");
return NULL;
}
-#endif
PyFPE_START_PROTECT("modulo", return 0)
mod = fmod(vx, wx);
if (mod) {
@@ -605,11 +609,8 @@ float_rem(PyObject *v, PyObject *w)
else {
/* the remainder is zero, and in the presence of signed zeroes
fmod returns different results across platforms; ensure
- it has the same sign as the denominator; we'd like to do
- "mod = wx * 0.0", but that may get optimized away */
- mod *= mod; /* hide "mod = +0" from optimizer */
- if (wx < 0.0)
- mod = -mod;
+ it has the same sign as the denominator. */
+ mod = copysign(0.0, wx);
}
PyFPE_END_PROTECT(mod)
return PyFloat_FromDouble(mod);
@@ -645,11 +646,8 @@ float_divmod(PyObject *v, PyObject *w)
else {
/* the remainder is zero, and in the presence of signed zeroes
fmod returns different results across platforms; ensure
- it has the same sign as the denominator; we'd like to do
- "mod = wx * 0.0", but that may get optimized away */
- mod *= mod; /* hide "mod = +0" from optimizer */
- if (wx < 0.0)
- mod = -mod;
+ it has the same sign as the denominator. */
+ mod = copysign(0.0, wx);
}
/* snap quotient to nearest integral value */
if (div) {
@@ -659,8 +657,7 @@ float_divmod(PyObject *v, PyObject *w)
}
else {
/* div is zero - get the same sign as the true quotient */
- div *= div; /* hide "div = +0" from optimizers */
- floordiv = div * vx / wx; /* zero w/ sign of vx/wx */
+ floordiv = copysign(0.0, vx / wx); /* zero w/ sign of vx/wx */
}
PyFPE_END_PROTECT(floordiv)
return Py_BuildValue("(dd)", floordiv, mod);
@@ -681,10 +678,15 @@ float_floor_div(PyObject *v, PyObject *w)
return r;
}
+/* determine whether x is an odd integer or not; assumes that
+ x is not an infinity or nan. */
+#define DOUBLE_IS_ODD_INTEGER(x) (fmod(fabs(x), 2.0) == 1.0)
+
static PyObject *
float_pow(PyObject *v, PyObject *w, PyObject *z)
{
double iv, iw, ix;
+ int negate_result = 0;
if ((PyObject *)z != Py_None) {
PyErr_SetString(PyExc_TypeError, "pow() 3rd argument not "
@@ -699,17 +701,53 @@ float_pow(PyObject *v, PyObject *w, PyObject *z)
if (iw == 0) { /* v**0 is 1, even 0**0 */
return PyFloat_FromDouble(1.0);
}
- if (iv == 0.0) { /* 0**w is error if w<0, else 1 */
+ if (Py_IS_NAN(iv)) { /* nan**w = nan, unless w == 0 */
+ return PyFloat_FromDouble(iv);
+ }
+ if (Py_IS_NAN(iw)) { /* v**nan = nan, unless v == 1; 1**nan = 1 */
+ return PyFloat_FromDouble(iv == 1.0 ? 1.0 : iw);
+ }
+ if (Py_IS_INFINITY(iw)) {
+ /* v**inf is: 0.0 if abs(v) < 1; 1.0 if abs(v) == 1; inf if
+ * abs(v) > 1 (including case where v infinite)
+ *
+ * v**-inf is: inf if abs(v) < 1; 1.0 if abs(v) == 1; 0.0 if
+ * abs(v) > 1 (including case where v infinite)
+ */
+ iv = fabs(iv);
+ if (iv == 1.0)
+ return PyFloat_FromDouble(1.0);
+ else if ((iw > 0.0) == (iv > 1.0))
+ return PyFloat_FromDouble(fabs(iw)); /* return inf */
+ else
+ return PyFloat_FromDouble(0.0);
+ }
+ if (Py_IS_INFINITY(iv)) {
+ /* (+-inf)**w is: inf for w positive, 0 for w negative; in
+ * both cases, we need to add the appropriate sign if w is
+ * an odd integer.
+ */
+ int iw_is_odd = DOUBLE_IS_ODD_INTEGER(iw);
+ if (iw > 0.0)
+ return PyFloat_FromDouble(iw_is_odd ? iv : fabs(iv));
+ else
+ return PyFloat_FromDouble(iw_is_odd ?
+ copysign(0.0, iv) : 0.0);
+ }
+ if (iv == 0.0) { /* 0**w is: 0 for w positive, 1 for w zero
+ (already dealt with above), and an error
+ if w is negative. */
+ int iw_is_odd = DOUBLE_IS_ODD_INTEGER(iw);
if (iw < 0.0) {
PyErr_SetString(PyExc_ZeroDivisionError,
- "0.0 cannot be raised to a negative power");
+ "0.0 cannot be raised to a "
+ "negative power");
return NULL;
}
- return PyFloat_FromDouble(0.0);
- }
- if (iv == 1.0) { /* 1**w is 1, even 1**inf and 1**nan */
- return PyFloat_FromDouble(1.0);
+ /* use correct sign if iw is odd */
+ return PyFloat_FromDouble(iw_is_odd ? iv : 0.0);
}
+
if (iv < 0.0) {
/* Whether this is an error is a mess, and bumps into libm
* bugs so we have to figure it out ourselves.
@@ -720,33 +758,41 @@ float_pow(PyObject *v, PyObject *w, PyObject *z)
*/
return PyComplex_Type.tp_as_number->nb_power(v, w, z);
}
- /* iw is an exact integer, albeit perhaps a very large one.
+ /* iw is an exact integer, albeit perhaps a very large
+ * one. Replace iv by its absolute value and remember
+ * to negate the pow result if iw is odd.
+ */
+ iv = -iv;
+ negate_result = DOUBLE_IS_ODD_INTEGER(iw);
+ }
+
+ if (iv == 1.0) { /* 1**w is 1, even 1**inf and 1**nan */
+ /* (-1) ** large_integer also ends up here. Here's an
+ * extract from the comments for the previous
+ * implementation explaining why this special case is
+ * necessary:
+ *
* -1 raised to an exact integer should never be exceptional.
* Alas, some libms (chiefly glibc as of early 2003) return
* NaN and set EDOM on pow(-1, large_int) if the int doesn't
* happen to be representable in a *C* integer. That's a
- * bug; we let that slide in math.pow() (which currently
- * reflects all platform accidents), but not for Python's **.
- */
- if (iv == -1.0 && Py_IS_FINITE(iw)) {
- /* Return 1 if iw is even, -1 if iw is odd; there's
- * no guarantee that any C integral type is big
- * enough to hold iw, so we have to check this
- * indirectly.
- */
- ix = floor(iw * 0.5) * 2.0;
- return PyFloat_FromDouble(ix == iw ? 1.0 : -1.0);
- }
- /* Else iv != -1.0, and overflow or underflow are possible.
- * Unless we're to write pow() ourselves, we have to trust
- * the platform to do this correctly.
+ * bug.
*/
+ return PyFloat_FromDouble(negate_result ? -1.0 : 1.0);
}
+
+ /* Now iv and iw are finite, iw is nonzero, and iv is
+ * positive and not equal to 1.0. We finally allow
+ * the platform pow to step in and do the rest.
+ */
errno = 0;
PyFPE_START_PROTECT("pow", return NULL)
ix = pow(iv, iw);
PyFPE_END_PROTECT(ix)
Py_ADJUST_ERANGE1(ix);
+ if (negate_result)
+ ix = -ix;
+
if (errno != 0) {
/* We don't expect any errno value other than ERANGE, but
* the range of libm bugs appears unbounded.
@@ -758,6 +804,8 @@ float_pow(PyObject *v, PyObject *w, PyObject *z)
return PyFloat_FromDouble(ix);
}
+#undef DOUBLE_IS_ODD_INTEGER
+
static PyObject *
float_neg(PyFloatObject *v)
{
@@ -1113,7 +1161,7 @@ float_hex(PyObject *v)
CONVERT_TO_DOUBLE(v, x);
if (Py_IS_NAN(x) || Py_IS_INFINITY(x))
- return float_str((PyFloatObject *)v);
+ return float_repr((PyFloatObject *)v);
if (x == 0.0) {
if (copysign(1.0, x) == -1.0)
@@ -1366,7 +1414,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
round_up = 1;
break;
}
- if (round_up == 1) {
+ if (round_up) {
x += 2*half_eps;
if (top_exp == DBL_MAX_EXP &&
x == ldexp((double)(2*half_eps), DBL_MANT_DIG))
@@ -1443,13 +1491,11 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
"Cannot pass infinity to float.as_integer_ratio.");
return NULL;
}
-#ifdef Py_NAN
if (Py_IS_NAN(self)) {
PyErr_SetString(PyExc_ValueError,
"Cannot pass NaN to float.as_integer_ratio.");
return NULL;
}
-#endif
PyFPE_START_PROTECT("as_integer_ratio", goto error);
float_part = frexp(self, &exponent); /* self == float_part * 2**exponent exactly */
@@ -1817,7 +1863,7 @@ PyTypeObject PyFloat_Type = {
0, /* tp_as_mapping */
(hashfunc)float_hash, /* tp_hash */
0, /* tp_call */
- (reprfunc)float_str, /* tp_str */
+ (reprfunc)float_repr, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 2cf2cdf12c..10fb8b350e 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -31,17 +31,19 @@ frame_getlocals(PyFrameObject *f, void *closure)
return f->f_locals;
}
-static PyObject *
-frame_getlineno(PyFrameObject *f, void *closure)
+int
+PyFrame_GetLineNumber(PyFrameObject *f)
{
- int lineno;
-
if (f->f_trace)
- lineno = f->f_lineno;
+ return f->f_lineno;
else
- lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
+ return PyCode_Addr2Line(f->f_code, f->f_lasti);
+}
- return PyLong_FromLong(lineno);
+static PyObject *
+frame_getlineno(PyFrameObject *f, void *closure)
+{
+ return PyLong_FromLong(PyFrame_GetLineNumber(f));
}
/* Setter for f_lineno - you can set f_lineno from within a trace function in
@@ -345,16 +347,14 @@ frame_gettrace(PyFrameObject *f, void *closure)
static int
frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
{
- /* We rely on f_lineno being accurate when f_trace is set. */
+ PyObject* old_value;
- PyObject* old_value = f->f_trace;
+ /* We rely on f_lineno being accurate when f_trace is set. */
+ f->f_lineno = PyFrame_GetLineNumber(f);
+ old_value = f->f_trace;
Py_XINCREF(v);
f->f_trace = v;
-
- if (v != NULL)
- f->f_lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
-
Py_XDECREF(old_value);
return 0;
@@ -391,7 +391,7 @@ static PyGetSetDef frame_getsetlist[] = {
the local variables in f_localsplus are NULL.
2. We also maintain a separate free list of stack frames (just like
- integers are allocated in a special way -- see intobject.c). When
+ floats are allocated in a special way -- see floatobject.c). When
a stack frame is on the free list, only the following members have
a meaning:
ob_type == &Frametype
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index c2ad964e58..45f9f57578 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -3,7 +3,6 @@
#include "Python.h"
#include "code.h"
-#include "eval.h"
#include "structmember.h"
PyObject *
@@ -628,7 +627,7 @@ function_call(PyObject *func, PyObject *arg, PyObject *kw)
}
result = PyEval_EvalCodeEx(
- (PyCodeObject *)PyFunction_GET_CODE(func),
+ PyFunction_GET_CODE(func),
PyFunction_GET_GLOBALS(func), (PyObject *)NULL,
&PyTuple_GET_ITEM(arg, 0), PyTuple_GET_SIZE(arg),
k, nk, d, nd,
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 34ee7dcc1f..3fa1b4e726 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -2,8 +2,6 @@
#include "Python.h"
#include "frameobject.h"
-#include "genobject.h"
-#include "ceval.h"
#include "structmember.h"
#include "opcode.h"
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index b534b4af8e..91a93f55be 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -177,9 +177,7 @@ calliter_iternext(calliterobject *it)
Py_DECREF(args);
if (result != NULL) {
int ok;
- ok = PyObject_RichCompareBool(result,
- it->it_sentinel,
- Py_EQ);
+ ok = PyObject_RichCompareBool(it->it_sentinel, result, Py_EQ);
if (ok == 0)
return result; /* Common case, fast path */
Py_DECREF(result);
diff --git a/Objects/listobject.c b/Objects/listobject.c
index b3bb21dbd0..73624f0b74 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -940,6 +940,71 @@ reverse_slice(PyObject **lo, PyObject **hi)
* pieces to this algorithm; read listsort.txt for overviews and details.
*/
+/* A sortslice contains a pointer to an array of keys and a pointer to
+ * an array of corresponding values. In other words, keys[i]
+ * corresponds with values[i]. If values == NULL, then the keys are
+ * also the values.
+ *
+ * Several convenience routines are provided here, so that keys and
+ * values are always moved in sync.
+ */
+
+typedef struct {
+ PyObject **keys;
+ PyObject **values;
+} sortslice;
+
+Py_LOCAL_INLINE(void)
+sortslice_copy(sortslice *s1, Py_ssize_t i, sortslice *s2, Py_ssize_t j)
+{
+ s1->keys[i] = s2->keys[j];
+ if (s1->values != NULL)
+ s1->values[i] = s2->values[j];
+}
+
+Py_LOCAL_INLINE(void)
+sortslice_copy_incr(sortslice *dst, sortslice *src)
+{
+ *dst->keys++ = *src->keys++;
+ if (dst->values != NULL)
+ *dst->values++ = *src->values++;
+}
+
+Py_LOCAL_INLINE(void)
+sortslice_copy_decr(sortslice *dst, sortslice *src)
+{
+ *dst->keys-- = *src->keys--;
+ if (dst->values != NULL)
+ *dst->values-- = *src->values--;
+}
+
+
+Py_LOCAL_INLINE(void)
+sortslice_memcpy(sortslice *s1, Py_ssize_t i, sortslice *s2, Py_ssize_t j,
+ Py_ssize_t n)
+{
+ memcpy(&s1->keys[i], &s2->keys[j], sizeof(PyObject *) * n);
+ if (s1->values != NULL)
+ memcpy(&s1->values[i], &s2->values[j], sizeof(PyObject *) * n);
+}
+
+Py_LOCAL_INLINE(void)
+sortslice_memmove(sortslice *s1, Py_ssize_t i, sortslice *s2, Py_ssize_t j,
+ Py_ssize_t n)
+{
+ memmove(&s1->keys[i], &s2->keys[j], sizeof(PyObject *) * n);
+ if (s1->values != NULL)
+ memmove(&s1->values[i], &s2->values[j], sizeof(PyObject *) * n);
+}
+
+Py_LOCAL_INLINE(void)
+sortslice_advance(sortslice *slice, Py_ssize_t n)
+{
+ slice->keys += n;
+ if (slice->values != NULL)
+ slice->values += n;
+}
+
/* Comparison function: PyObject_RichCompareBool with Py_LT.
* Returns -1 on error, 1 if x < y, 0 if x >= y.
*/
@@ -965,19 +1030,19 @@ reverse_slice(PyObject **lo, PyObject **hi)
the input (nothing is lost or duplicated).
*/
static int
-binarysort(PyObject **lo, PyObject **hi, PyObject **start)
+binarysort(sortslice lo, PyObject **hi, PyObject **start)
{
register Py_ssize_t k;
register PyObject **l, **p, **r;
register PyObject *pivot;
- assert(lo <= start && start <= hi);
+ assert(lo.keys <= start && start <= hi);
/* assert [lo, start) is sorted */
- if (lo == start)
+ if (lo.keys == start)
++start;
for (; start < hi; ++start) {
/* set l to where *start belongs */
- l = lo;
+ l = lo.keys;
r = start;
pivot = *r;
/* Invariants:
@@ -1004,6 +1069,15 @@ binarysort(PyObject **lo, PyObject **hi, PyObject **start)
for (p = start; p > l; --p)
*p = *(p-1);
*l = pivot;
+ if (lo.values != NULL) {
+ Py_ssize_t offset = lo.values - lo.keys;
+ p = start + offset;
+ pivot = *p;
+ l += offset;
+ for (p = start + offset; p > l; --p)
+ *p = *(p-1);
+ *l = pivot;
+ }
}
return 0;
@@ -1272,7 +1346,7 @@ fail:
* a convenient way to pass state around among the helper functions.
*/
struct s_slice {
- PyObject **base;
+ sortslice base;
Py_ssize_t len;
};
@@ -1286,7 +1360,7 @@ typedef struct s_MergeState {
/* 'a' is temp storage to help with merges. It contains room for
* alloced entries.
*/
- PyObject **a; /* may point to temparray below */
+ sortslice a; /* may point to temparray below */
Py_ssize_t alloced;
/* A stack of n pending runs yet to be merged. Run #i starts at
@@ -1307,11 +1381,29 @@ typedef struct s_MergeState {
/* Conceptually a MergeState's constructor. */
static void
-merge_init(MergeState *ms)
+merge_init(MergeState *ms, Py_ssize_t list_size, int has_keyfunc)
{
assert(ms != NULL);
- ms->a = ms->temparray;
- ms->alloced = MERGESTATE_TEMP_SIZE;
+ if (has_keyfunc) {
+ /* The temporary space for merging will need at most half the list
+ * size rounded up. Use the minimum possible space so we can use the
+ * rest of temparray for other things. In particular, if there is
+ * enough extra space, listsort() will use it to store the keys.
+ */
+ ms->alloced = (list_size + 1) / 2;
+
+ /* ms->alloced describes how many keys will be stored at
+ ms->temparray, but we also need to store the values. Hence,
+ ms->alloced is capped at half of MERGESTATE_TEMP_SIZE. */
+ if (MERGESTATE_TEMP_SIZE / 2 < ms->alloced)
+ ms->alloced = MERGESTATE_TEMP_SIZE / 2;
+ ms->a.values = &ms->temparray[ms->alloced];
+ }
+ else {
+ ms->alloced = MERGESTATE_TEMP_SIZE;
+ ms->a.values = NULL;
+ }
+ ms->a.keys = ms->temparray;
ms->n = 0;
ms->min_gallop = MIN_GALLOP;
}
@@ -1324,10 +1416,8 @@ static void
merge_freemem(MergeState *ms)
{
assert(ms != NULL);
- if (ms->a != ms->temparray)
- PyMem_Free(ms->a);
- ms->a = ms->temparray;
- ms->alloced = MERGESTATE_TEMP_SIZE;
+ if (ms->a.keys != ms->temparray)
+ PyMem_Free(ms->a.keys);
}
/* Ensure enough temp memory for 'need' array slots is available.
@@ -1336,52 +1426,60 @@ merge_freemem(MergeState *ms)
static int
merge_getmem(MergeState *ms, Py_ssize_t need)
{
+ int multiplier;
+
assert(ms != NULL);
if (need <= ms->alloced)
return 0;
+
+ multiplier = ms->a.values != NULL ? 2 : 1;
+
/* Don't realloc! That can cost cycles to copy the old data, but
* we don't care what's in the block.
*/
merge_freemem(ms);
- if ((size_t)need > PY_SSIZE_T_MAX / sizeof(PyObject*)) {
+ if ((size_t)need > PY_SSIZE_T_MAX / sizeof(PyObject*) / multiplier) {
PyErr_NoMemory();
return -1;
}
- ms->a = (PyObject **)PyMem_Malloc(need * sizeof(PyObject*));
- if (ms->a) {
+ ms->a.keys = (PyObject**)PyMem_Malloc(multiplier * need
+ * sizeof(PyObject *));
+ if (ms->a.keys != NULL) {
ms->alloced = need;
+ if (ms->a.values != NULL)
+ ms->a.values = &ms->a.keys[need];
return 0;
}
PyErr_NoMemory();
- merge_freemem(ms); /* reset to sane state */
return -1;
}
#define MERGE_GETMEM(MS, NEED) ((NEED) <= (MS)->alloced ? 0 : \
merge_getmem(MS, NEED))
-/* Merge the na elements starting at pa with the nb elements starting at pb
- * in a stable way, in-place. na and nb must be > 0, and pa + na == pb.
- * Must also have that *pb < *pa, that pa[na-1] belongs at the end of the
- * merge, and should have na <= nb. See listsort.txt for more info.
- * Return 0 if successful, -1 if error.
+/* Merge the na elements starting at ssa with the nb elements starting at
+ * ssb.keys = ssa.keys + na in a stable way, in-place. na and nb must be > 0.
+ * Must also have that ssa.keys[na-1] belongs at the end of the merge, and
+ * should have na <= nb. See listsort.txt for more info. Return 0 if
+ * successful, -1 if error.
*/
static Py_ssize_t
-merge_lo(MergeState *ms, PyObject **pa, Py_ssize_t na,
- PyObject **pb, Py_ssize_t nb)
+merge_lo(MergeState *ms, sortslice ssa, Py_ssize_t na,
+ sortslice ssb, Py_ssize_t nb)
{
Py_ssize_t k;
- PyObject **dest;
+ sortslice dest;
int result = -1; /* guilty until proved innocent */
Py_ssize_t min_gallop;
- assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb);
+ assert(ms && ssa.keys && ssb.keys && na > 0 && nb > 0);
+ assert(ssa.keys + na == ssb.keys);
if (MERGE_GETMEM(ms, na) < 0)
return -1;
- memcpy(ms->a, pa, na * sizeof(PyObject*));
- dest = pa;
- pa = ms->a;
+ sortslice_memcpy(&ms->a, 0, &ssa, 0, na);
+ dest = ssa;
+ ssa = ms->a;
- *dest++ = *pb++;
+ sortslice_copy_incr(&dest, &ssb);
--nb;
if (nb == 0)
goto Succeed;
@@ -1398,11 +1496,11 @@ merge_lo(MergeState *ms, PyObject **pa, Py_ssize_t na,
*/
for (;;) {
assert(na > 1 && nb > 0);
- k = ISLT(*pb, *pa);
+ k = ISLT(ssb.keys[0], ssa.keys[0]);
if (k) {
if (k < 0)
goto Fail;
- *dest++ = *pb++;
+ sortslice_copy_incr(&dest, &ssb);
++bcount;
acount = 0;
--nb;
@@ -1412,7 +1510,7 @@ merge_lo(MergeState *ms, PyObject **pa, Py_ssize_t na,
break;
}
else {
- *dest++ = *pa++;
+ sortslice_copy_incr(&dest, &ssa);
++acount;
bcount = 0;
--na;
@@ -1433,14 +1531,14 @@ merge_lo(MergeState *ms, PyObject **pa, Py_ssize_t na,
assert(na > 1 && nb > 0);
min_gallop -= min_gallop > 1;
ms->min_gallop = min_gallop;
- k = gallop_right(*pb, pa, na, 0);
+ k = gallop_right(ssb.keys[0], ssa.keys, na, 0);
acount = k;
if (k) {
if (k < 0)
goto Fail;
- memcpy(dest, pa, k * sizeof(PyObject *));
- dest += k;
- pa += k;
+ sortslice_memcpy(&dest, 0, &ssa, 0, k);
+ sortslice_advance(&dest, k);
+ sortslice_advance(&ssa, k);
na -= k;
if (na == 1)
goto CopyB;
@@ -1451,24 +1549,24 @@ merge_lo(MergeState *ms, PyObject **pa, Py_ssize_t na,
if (na == 0)
goto Succeed;
}
- *dest++ = *pb++;
+ sortslice_copy_incr(&dest, &ssb);
--nb;
if (nb == 0)
goto Succeed;
- k = gallop_left(*pa, pb, nb, 0);
+ k = gallop_left(ssa.keys[0], ssb.keys, nb, 0);
bcount = k;
if (k) {
if (k < 0)
goto Fail;
- memmove(dest, pb, k * sizeof(PyObject *));
- dest += k;
- pb += k;
+ sortslice_memmove(&dest, 0, &ssb, 0, k);
+ sortslice_advance(&dest, k);
+ sortslice_advance(&ssb, k);
nb -= k;
if (nb == 0)
goto Succeed;
}
- *dest++ = *pa++;
+ sortslice_copy_incr(&dest, &ssa);
--na;
if (na == 1)
goto CopyB;
@@ -1480,43 +1578,46 @@ Succeed:
result = 0;
Fail:
if (na)
- memcpy(dest, pa, na * sizeof(PyObject*));
+ sortslice_memcpy(&dest, 0, &ssa, 0, na);
return result;
CopyB:
assert(na == 1 && nb > 0);
- /* The last element of pa belongs at the end of the merge. */
- memmove(dest, pb, nb * sizeof(PyObject *));
- dest[nb] = *pa;
+ /* The last element of ssa belongs at the end of the merge. */
+ sortslice_memmove(&dest, 0, &ssb, 0, nb);
+ sortslice_copy(&dest, nb, &ssa, 0);
return 0;
}
-/* Merge the na elements starting at pa with the nb elements starting at pb
- * in a stable way, in-place. na and nb must be > 0, and pa + na == pb.
- * Must also have that *pb < *pa, that pa[na-1] belongs at the end of the
- * merge, and should have na >= nb. See listsort.txt for more info.
- * Return 0 if successful, -1 if error.
+/* Merge the na elements starting at pa with the nb elements starting at
+ * ssb.keys = ssa.keys + na in a stable way, in-place. na and nb must be > 0.
+ * Must also have that ssa.keys[na-1] belongs at the end of the merge, and
+ * should have na >= nb. See listsort.txt for more info. Return 0 if
+ * successful, -1 if error.
*/
static Py_ssize_t
-merge_hi(MergeState *ms, PyObject **pa, Py_ssize_t na, PyObject **pb, Py_ssize_t nb)
+merge_hi(MergeState *ms, sortslice ssa, Py_ssize_t na,
+ sortslice ssb, Py_ssize_t nb)
{
Py_ssize_t k;
- PyObject **dest;
+ sortslice dest, basea, baseb;
int result = -1; /* guilty until proved innocent */
- PyObject **basea;
- PyObject **baseb;
Py_ssize_t min_gallop;
- assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb);
+ assert(ms && ssa.keys && ssb.keys && na > 0 && nb > 0);
+ assert(ssa.keys + na == ssb.keys);
if (MERGE_GETMEM(ms, nb) < 0)
return -1;
- dest = pb + nb - 1;
- memcpy(ms->a, pb, nb * sizeof(PyObject*));
- basea = pa;
+ dest = ssb;
+ sortslice_advance(&dest, nb-1);
+ sortslice_memcpy(&ms->a, 0, &ssb, 0, nb);
+ basea = ssa;
baseb = ms->a;
- pb = ms->a + nb - 1;
- pa += na - 1;
+ ssb.keys = ms->a.keys + nb - 1;
+ if (ssb.values != NULL)
+ ssb.values = ms->a.values + nb - 1;
+ sortslice_advance(&ssa, na - 1);
- *dest-- = *pa--;
+ sortslice_copy_decr(&dest, &ssa);
--na;
if (na == 0)
goto Succeed;
@@ -1533,11 +1634,11 @@ merge_hi(MergeState *ms, PyObject **pa, Py_ssize_t na, PyObject **pb, Py_ssize_t
*/
for (;;) {
assert(na > 0 && nb > 1);
- k = ISLT(*pb, *pa);
+ k = ISLT(ssb.keys[0], ssa.keys[0]);
if (k) {
if (k < 0)
goto Fail;
- *dest-- = *pa--;
+ sortslice_copy_decr(&dest, &ssa);
++acount;
bcount = 0;
--na;
@@ -1547,7 +1648,7 @@ merge_hi(MergeState *ms, PyObject **pa, Py_ssize_t na, PyObject **pb, Py_ssize_t
break;
}
else {
- *dest-- = *pb--;
+ sortslice_copy_decr(&dest, &ssb);
++bcount;
acount = 0;
--nb;
@@ -1568,33 +1669,33 @@ merge_hi(MergeState *ms, PyObject **pa, Py_ssize_t na, PyObject **pb, Py_ssize_t
assert(na > 0 && nb > 1);
min_gallop -= min_gallop > 1;
ms->min_gallop = min_gallop;
- k = gallop_right(*pb, basea, na, na-1);
+ k = gallop_right(ssb.keys[0], basea.keys, na, na-1);
if (k < 0)
goto Fail;
k = na - k;
acount = k;
if (k) {
- dest -= k;
- pa -= k;
- memmove(dest+1, pa+1, k * sizeof(PyObject *));
+ sortslice_advance(&dest, -k);
+ sortslice_advance(&ssa, -k);
+ sortslice_memmove(&dest, 1, &ssa, 1, k);
na -= k;
if (na == 0)
goto Succeed;
}
- *dest-- = *pb--;
+ sortslice_copy_decr(&dest, &ssb);
--nb;
if (nb == 1)
goto CopyA;
- k = gallop_left(*pa, baseb, nb, nb-1);
+ k = gallop_left(ssa.keys[0], baseb.keys, nb, nb-1);
if (k < 0)
goto Fail;
k = nb - k;
bcount = k;
if (k) {
- dest -= k;
- pb -= k;
- memcpy(dest+1, pb+1, k * sizeof(PyObject *));
+ sortslice_advance(&dest, -k);
+ sortslice_advance(&ssb, -k);
+ sortslice_memcpy(&dest, 1, &ssb, 1, k);
nb -= k;
if (nb == 1)
goto CopyA;
@@ -1605,7 +1706,7 @@ merge_hi(MergeState *ms, PyObject **pa, Py_ssize_t na, PyObject **pb, Py_ssize_t
if (nb == 0)
goto Succeed;
}
- *dest-- = *pa--;
+ sortslice_copy_decr(&dest, &ssa);
--na;
if (na == 0)
goto Succeed;
@@ -1617,15 +1718,15 @@ Succeed:
result = 0;
Fail:
if (nb)
- memcpy(dest-(nb-1), baseb, nb * sizeof(PyObject*));
+ sortslice_memcpy(&dest, -(nb-1), &baseb, 0, nb);
return result;
CopyA:
assert(nb == 1 && na > 0);
- /* The first element of pb belongs at the front of the merge. */
- dest -= na;
- pa -= na;
- memmove(dest+1, pa+1, na * sizeof(PyObject *));
- *dest = *pb;
+ /* The first element of ssb belongs at the front of the merge. */
+ sortslice_memmove(&dest, 1-na, &ssa, 1-na, na);
+ sortslice_advance(&dest, -na);
+ sortslice_advance(&ssa, -na);
+ sortslice_copy(&dest, 0, &ssb, 0);
return 0;
}
@@ -1635,7 +1736,7 @@ CopyA:
static Py_ssize_t
merge_at(MergeState *ms, Py_ssize_t i)
{
- PyObject **pa, **pb;
+ sortslice ssa, ssb;
Py_ssize_t na, nb;
Py_ssize_t k;
@@ -1644,12 +1745,12 @@ merge_at(MergeState *ms, Py_ssize_t i)
assert(i >= 0);
assert(i == ms->n - 2 || i == ms->n - 3);
- pa = ms->pending[i].base;
+ ssa = ms->pending[i].base;
na = ms->pending[i].len;
- pb = ms->pending[i+1].base;
+ ssb = ms->pending[i+1].base;
nb = ms->pending[i+1].len;
assert(na > 0 && nb > 0);
- assert(pa + na == pb);
+ assert(ssa.keys + na == ssb.keys);
/* Record the length of the combined runs; if i is the 3rd-last
* run now, also slide over the last run (which isn't involved
@@ -1663,10 +1764,10 @@ merge_at(MergeState *ms, Py_ssize_t i)
/* Where does b start in a? Elements in a before that can be
* ignored (already in place).
*/
- k = gallop_right(*pb, pa, na, 0);
+ k = gallop_right(*ssb.keys, ssa.keys, na, 0);
if (k < 0)
return -1;
- pa += k;
+ sortslice_advance(&ssa, k);
na -= k;
if (na == 0)
return 0;
@@ -1674,7 +1775,7 @@ merge_at(MergeState *ms, Py_ssize_t i)
/* Where does a end in b? Elements in b after that can be
* ignored (already in place).
*/
- nb = gallop_left(pa[na-1], pb, nb, nb-1);
+ nb = gallop_left(ssa.keys[na-1], ssb.keys, nb, nb-1);
if (nb <= 0)
return nb;
@@ -1682,9 +1783,9 @@ merge_at(MergeState *ms, Py_ssize_t i)
* min(na, nb) elements.
*/
if (na <= nb)
- return merge_lo(ms, pa, na, pb, nb);
+ return merge_lo(ms, ssa, na, ssb, nb);
else
- return merge_hi(ms, pa, na, pb, nb);
+ return merge_hi(ms, ssa, na, ssb, nb);
}
/* Examine the stack of runs waiting to be merged, merging adjacent runs
@@ -1765,103 +1866,12 @@ merge_compute_minrun(Py_ssize_t n)
return n + r;
}
-/* Special wrapper to support stable sorting using the decorate-sort-undecorate
- pattern. Holds a key which is used for comparisons and the original record
- which is returned during the undecorate phase. By exposing only the key
- during comparisons, the underlying sort stability characteristics are left
- unchanged. Also, the comparison function will only see the key instead of
- a full record. */
-
-typedef struct {
- PyObject_HEAD
- PyObject *key;
- PyObject *value;
-} sortwrapperobject;
-
-PyDoc_STRVAR(sortwrapper_doc, "Object wrapper with a custom sort key.");
-static PyObject *
-sortwrapper_richcompare(sortwrapperobject *, sortwrapperobject *, int);
static void
-sortwrapper_dealloc(sortwrapperobject *);
-
-PyTypeObject PySortWrapper_Type = {
- PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "sortwrapper", /* tp_name */
- sizeof(sortwrapperobject), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- (destructor)sortwrapper_dealloc, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_reserved */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- PyObject_GenericGetAttr, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /* tp_flags */
- sortwrapper_doc, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- (richcmpfunc)sortwrapper_richcompare, /* tp_richcompare */
-};
-
-
-static PyObject *
-sortwrapper_richcompare(sortwrapperobject *a, sortwrapperobject *b, int op)
-{
- if (!PyObject_TypeCheck(b, &PySortWrapper_Type)) {
- PyErr_SetString(PyExc_TypeError,
- "expected a sortwrapperobject");
- return NULL;
- }
- return PyObject_RichCompare(a->key, b->key, op);
-}
-
-static void
-sortwrapper_dealloc(sortwrapperobject *so)
+reverse_sortslice(sortslice *s, Py_ssize_t n)
{
- Py_XDECREF(so->key);
- Py_XDECREF(so->value);
- PyObject_Del(so);
-}
-
-/* Returns a new reference to a sortwrapper.
- Consumes the references to the two underlying objects. */
-
-static PyObject *
-build_sortwrapper(PyObject *key, PyObject *value)
-{
- sortwrapperobject *so;
-
- so = PyObject_New(sortwrapperobject, &PySortWrapper_Type);
- if (so == NULL)
- return NULL;
- so->key = key;
- so->value = value;
- return (PyObject *)so;
-}
-
-/* Returns a new reference to the value underlying the wrapper. */
-static PyObject *
-sortwrapper_getvalue(PyObject *so)
-{
- PyObject *value;
-
- if (!PyObject_TypeCheck(so, &PySortWrapper_Type)) {
- PyErr_SetString(PyExc_TypeError,
- "expected a sortwrapperobject");
- return NULL;
- }
- value = ((sortwrapperobject *)so)->value;
- Py_INCREF(value);
- return value;
+ reverse_slice(s->keys, &s->keys[n]);
+ if (s->values != NULL)
+ reverse_slice(s->values, &s->values[n]);
}
/* An adaptive, stable, natural mergesort. See listsort.txt.
@@ -1873,9 +1883,9 @@ static PyObject *
listsort(PyListObject *self, PyObject *args, PyObject *kwds)
{
MergeState ms;
- PyObject **lo, **hi;
Py_ssize_t nremaining;
Py_ssize_t minrun;
+ sortslice lo;
Py_ssize_t saved_ob_size, saved_allocated;
PyObject **saved_ob_item;
PyObject **final_ob_item;
@@ -1883,8 +1893,8 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
int reverse = 0;
PyObject *keyfunc = NULL;
Py_ssize_t i;
- PyObject *key, *value, *kvpair;
static char *kwlist[] = {"key", "reverse", 0};
+ PyObject **keys;
assert(self != NULL);
assert (PyList_Check(self));
@@ -1913,59 +1923,70 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
self->ob_item = NULL;
self->allocated = -1; /* any operation will reset it to >= 0 */
- if (keyfunc != NULL) {
- for (i=0 ; i < saved_ob_size ; i++) {
- value = saved_ob_item[i];
- key = PyObject_CallFunctionObjArgs(keyfunc, value,
- NULL);
- if (key == NULL) {
- for (i=i-1 ; i>=0 ; i--) {
- kvpair = saved_ob_item[i];
- value = sortwrapper_getvalue(kvpair);
- saved_ob_item[i] = value;
- Py_DECREF(kvpair);
- }
- goto dsu_fail;
+ if (keyfunc == NULL) {
+ keys = NULL;
+ lo.keys = saved_ob_item;
+ lo.values = NULL;
+ }
+ else {
+ if (saved_ob_size < MERGESTATE_TEMP_SIZE/2)
+ /* Leverage stack space we allocated but won't otherwise use */
+ keys = &ms.temparray[saved_ob_size+1];
+ else {
+ keys = PyMem_MALLOC(sizeof(PyObject *) * saved_ob_size);
+ if (keys == NULL)
+ return NULL;
+ }
+
+ for (i = 0; i < saved_ob_size ; i++) {
+ keys[i] = PyObject_CallFunctionObjArgs(keyfunc, saved_ob_item[i],
+ NULL);
+ if (keys[i] == NULL) {
+ for (i=i-1 ; i>=0 ; i--)
+ Py_DECREF(keys[i]);
+ if (keys != &ms.temparray[saved_ob_size+1])
+ PyMem_FREE(keys);
+ goto keyfunc_fail;
}
- kvpair = build_sortwrapper(key, value);
- if (kvpair == NULL)
- goto dsu_fail;
- saved_ob_item[i] = kvpair;
}
- }
- /* Reverse sort stability achieved by initially reversing the list,
- applying a stable forward sort, then reversing the final result. */
- if (reverse && saved_ob_size > 1)
- reverse_slice(saved_ob_item, saved_ob_item + saved_ob_size);
+ lo.keys = keys;
+ lo.values = saved_ob_item;
+ }
- merge_init(&ms);
+ merge_init(&ms, saved_ob_size, keys != NULL);
nremaining = saved_ob_size;
if (nremaining < 2)
goto succeed;
+ /* Reverse sort stability achieved by initially reversing the list,
+ applying a stable forward sort, then reversing the final result. */
+ if (reverse) {
+ if (keys != NULL)
+ reverse_slice(&keys[0], &keys[saved_ob_size]);
+ reverse_slice(&saved_ob_item[0], &saved_ob_item[saved_ob_size]);
+ }
+
/* March over the array once, left to right, finding natural runs,
* and extending short natural runs to minrun elements.
*/
- lo = saved_ob_item;
- hi = lo + nremaining;
minrun = merge_compute_minrun(nremaining);
do {
int descending;
Py_ssize_t n;
/* Identify next run. */
- n = count_run(lo, hi, &descending);
+ n = count_run(lo.keys, lo.keys + nremaining, &descending);
if (n < 0)
goto fail;
if (descending)
- reverse_slice(lo, lo + n);
+ reverse_sortslice(&lo, n);
/* If short, extend to min(minrun, nremaining). */
if (n < minrun) {
const Py_ssize_t force = nremaining <= minrun ?
nremaining : minrun;
- if (binarysort(lo, lo + force, lo + n) < 0)
+ if (binarysort(lo, lo.keys + force, lo.keys + n) < 0)
goto fail;
n = force;
}
@@ -1977,27 +1998,27 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
if (merge_collapse(&ms) < 0)
goto fail;
/* Advance to find next run. */
- lo += n;
+ sortslice_advance(&lo, n);
nremaining -= n;
} while (nremaining);
- assert(lo == hi);
if (merge_force_collapse(&ms) < 0)
goto fail;
assert(ms.n == 1);
- assert(ms.pending[0].base == saved_ob_item);
+ assert(keys == NULL
+ ? ms.pending[0].base.keys == saved_ob_item
+ : ms.pending[0].base.keys == &keys[0]);
assert(ms.pending[0].len == saved_ob_size);
+ lo = ms.pending[0].base;
succeed:
result = Py_None;
fail:
- if (keyfunc != NULL) {
- for (i=0 ; i < saved_ob_size ; i++) {
- kvpair = saved_ob_item[i];
- value = sortwrapper_getvalue(kvpair);
- saved_ob_item[i] = value;
- Py_DECREF(kvpair);
- }
+ if (keys != NULL) {
+ for (i = 0; i < saved_ob_size; i++)
+ Py_DECREF(keys[i]);
+ if (keys != &ms.temparray[saved_ob_size+1])
+ PyMem_FREE(keys);
}
if (self->allocated != -1 && result != NULL) {
@@ -2013,7 +2034,7 @@ fail:
merge_freemem(&ms);
-dsu_fail:
+keyfunc_fail:
final_ob_item = self->ob_item;
i = Py_SIZE(self);
Py_SIZE(self) = saved_ob_size;
@@ -2098,7 +2119,8 @@ static PyObject *
listindex(PyListObject *self, PyObject *args)
{
Py_ssize_t i, start=0, stop=Py_SIZE(self);
- PyObject *v;
+ PyObject *v, *format_tuple, *err_string;
+ static PyObject *err_format = NULL;
if (!PyArg_ParseTuple(args, "O|O&O&:index", &v,
_PyEval_SliceIndex, &start,
@@ -2121,7 +2143,20 @@ listindex(PyListObject *self, PyObject *args)
else if (cmp < 0)
return NULL;
}
- PyErr_SetString(PyExc_ValueError, "list.index(x): x not in list");
+ if (err_format == NULL) {
+ err_format = PyUnicode_FromString("%r is not in list");
+ if (err_format == NULL)
+ return NULL;
+ }
+ format_tuple = PyTuple_Pack(1, v);
+ if (format_tuple == NULL)
+ return NULL;
+ err_string = PyUnicode_Format(err_format, format_tuple);
+ Py_DECREF(format_tuple);
+ if (err_string == NULL)
+ return NULL;
+ PyErr_SetObject(PyExc_ValueError, err_string);
+ Py_DECREF(err_string);
return NULL;
}
@@ -2364,7 +2399,7 @@ list_subscript(PyListObject* self, PyObject* item)
PyObject* it;
PyObject **src, **dest;
- if (PySlice_GetIndicesEx((PySliceObject*)item, Py_SIZE(self),
+ if (PySlice_GetIndicesEx(item, Py_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
@@ -2413,7 +2448,7 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, Py_SIZE(self),
+ if (PySlice_GetIndicesEx(item, Py_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return -1;
}
@@ -2582,7 +2617,7 @@ PyTypeObject PyList_Type = {
0, /* tp_as_number */
&list_as_sequence, /* tp_as_sequence */
&list_as_mapping, /* tp_as_mapping */
- (hashfunc)PyObject_HashNotImplemented, /* tp_hash */
+ PyObject_HashNotImplemented, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
@@ -2848,4 +2883,3 @@ listreviter_len(listreviterobject *it)
len = 0;
return PyLong_FromSsize_t(len);
}
-
diff --git a/Objects/lnotab_notes.txt b/Objects/lnotab_notes.txt
new file mode 100644
index 0000000000..d247eddd6f
--- /dev/null
+++ b/Objects/lnotab_notes.txt
@@ -0,0 +1,124 @@
+All about co_lnotab, the line number table.
+
+Code objects store a field named co_lnotab. This is an array of unsigned bytes
+disguised as a Python string. It is used to map bytecode offsets to source code
+line #s for tracebacks and to identify line number boundaries for line tracing.
+
+The array is conceptually a compressed list of
+ (bytecode offset increment, line number increment)
+pairs. The details are important and delicate, best illustrated by example:
+
+ byte code offset source code line number
+ 0 1
+ 6 2
+ 50 7
+ 350 307
+ 361 308
+
+Instead of storing these numbers literally, we compress the list by storing only
+the increments from one row to the next. Conceptually, the stored list might
+look like:
+
+ 0, 1, 6, 1, 44, 5, 300, 300, 11, 1
+
+The above doesn't really work, but it's a start. Note that an unsigned byte
+can't hold negative values, or values larger than 255, and the above example
+contains two such values. So we make two tweaks:
+
+ (a) there's a deep assumption that byte code offsets and their corresponding
+ line #s both increase monotonically, and
+ (b) if at least one column jumps by more than 255 from one row to the next,
+ more than one pair is written to the table. In case #b, there's no way to know
+ from looking at the table later how many were written. That's the delicate
+ part. A user of co_lnotab desiring to find the source line number
+ corresponding to a bytecode address A should do something like this
+
+ lineno = addr = 0
+ for addr_incr, line_incr in co_lnotab:
+ addr += addr_incr
+ if addr > A:
+ return lineno
+ lineno += line_incr
+
+(In C, this is implemented by PyCode_Addr2Line().) In order for this to work,
+when the addr field increments by more than 255, the line # increment in each
+pair generated must be 0 until the remaining addr increment is < 256. So, in
+the example above, assemble_lnotab in compile.c should not (as was actually done
+until 2.2) expand 300, 300 to
+ 255, 255, 45, 45,
+but to
+ 255, 0, 45, 255, 0, 45.
+
+The above is sufficient to reconstruct line numbers for tracebacks, but not for
+line tracing. Tracing is handled by PyCode_CheckLineNumber() in codeobject.c
+and maybe_call_line_trace() in ceval.c.
+
+*** Tracing ***
+
+To a first approximation, we want to call the tracing function when the line
+number of the current instruction changes. Re-computing the current line for
+every instruction is a little slow, though, so each time we compute the line
+number we save the bytecode indices where it's valid:
+
+ *instr_lb <= frame->f_lasti < *instr_ub
+
+is true so long as execution does not change lines. That is, *instr_lb holds
+the first bytecode index of the current line, and *instr_ub holds the first
+bytecode index of the next line. As long as the above expression is true,
+maybe_call_line_trace() does not need to call PyCode_CheckLineNumber(). Note
+that the same line may appear multiple times in the lnotab, either because the
+bytecode jumped more than 255 indices between line number changes or because
+the compiler inserted the same line twice. Even in that case, *instr_ub holds
+the first index of the next line.
+
+However, we don't *always* want to call the line trace function when the above
+test fails.
+
+Consider this code:
+
+1: def f(a):
+2: while a:
+3: print 1,
+4: break
+5: else:
+6: print 2,
+
+which compiles to this:
+
+ 2 0 SETUP_LOOP 19 (to 22)
+ >> 3 LOAD_FAST 0 (a)
+ 6 POP_JUMP_IF_FALSE 17
+
+ 3 9 LOAD_CONST 1 (1)
+ 12 PRINT_ITEM
+
+ 4 13 BREAK_LOOP
+ 14 JUMP_ABSOLUTE 3
+ >> 17 POP_BLOCK
+
+ 6 18 LOAD_CONST 2 (2)
+ 21 PRINT_ITEM
+ >> 22 LOAD_CONST 0 (None)
+ 25 RETURN_VALUE
+
+If 'a' is false, execution will jump to the POP_BLOCK instruction at offset 17
+and the co_lnotab will claim that execution has moved to line 4, which is wrong.
+In this case, we could instead associate the POP_BLOCK with line 5, but that
+would break jumps around loops without else clauses.
+
+We fix this by only calling the line trace function for a forward jump if the
+co_lnotab indicates we have jumped to the *start* of a line, i.e. if the current
+instruction offset matches the offset given for the start of a line by the
+co_lnotab. For backward jumps, however, we always call the line trace function,
+which lets a debugger stop on every evaluation of a loop guard (which usually
+won't be the first opcode in a line).
+
+Why do we set f_lineno when tracing, and only just before calling the trace
+function? Well, consider the code above when 'a' is true. If stepping through
+this with 'n' in pdb, you would stop at line 1 with a "call" type event, then
+line events on lines 2, 3, and 4, then a "return" type event -- but because the
+code for the return actually falls in the range of the "line 6" opcodes, you
+would be shown line 6 during this event. This is a change from the behaviour in
+2.2 and before, and I've found it confusing in practice. By setting and using
+f_lineno when tracing, one can report a line number different from that
+suggested by f_lasti on this one occasion where it's desirable.
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 6f998ce033..552f8f0b89 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -4,7 +4,6 @@
#include "Python.h"
#include "longintrepr.h"
-#include "structseq.h"
#include <float.h>
#include <ctype.h>
@@ -95,14 +94,10 @@ maybe_small_long(PyLongObject *v)
#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))
-#define SIGCHECK(PyTryBlock) \
- if (--_Py_Ticker < 0) { \
- _Py_Ticker = _Py_CheckInterval; \
- if (PyErr_CheckSignals()) PyTryBlock \
- }
-
-/* forward declaration */
-static int bits_in_digit(digit d);
+#define SIGCHECK(PyTryBlock) \
+ do { \
+ if (PyErr_CheckSignals()) PyTryBlock \
+ } while(0)
/* Normalize (remove leading zeros from) a long int object.
Doesn't attempt to free the storage--in most cases, due to the nature
@@ -284,12 +279,12 @@ PyLong_FromDouble(double dval)
neg = 0;
if (Py_IS_INFINITY(dval)) {
PyErr_SetString(PyExc_OverflowError,
- "cannot convert float infinity to integer");
+ "cannot convert float infinity to integer");
return NULL;
}
if (Py_IS_NAN(dval)) {
PyErr_SetString(PyExc_ValueError,
- "cannot convert float NaN to integer");
+ "cannot convert float NaN to integer");
return NULL;
}
if (dval < 0.0) {
@@ -349,9 +344,10 @@ PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
if (!PyLong_Check(vv)) {
PyNumberMethods *nb;
- if ((nb = vv->ob_type->tp_as_number) == NULL ||
- nb->nb_int == NULL) {
- PyErr_SetString(PyExc_TypeError, "an integer is required");
+ nb = vv->ob_type->tp_as_number;
+ if (nb == NULL || nb->nb_int == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
return -1;
}
vv = (*nb->nb_int) (vv);
@@ -389,14 +385,14 @@ PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
}
while (--i >= 0) {
prev = x;
- x = (x << PyLong_SHIFT) + v->ob_digit[i];
+ x = (x << PyLong_SHIFT) | v->ob_digit[i];
if ((x >> PyLong_SHIFT) != prev) {
- *overflow = Py_SIZE(v) > 0 ? 1 : -1;
+ *overflow = sign;
goto exit;
}
}
- /* Haven't lost any bits, but casting to long requires extra care
- * (see comment above).
+ /* Haven't lost any bits, but casting to long requires extra
+ * care (see comment above).
*/
if (x <= (unsigned long)LONG_MAX) {
res = (long)x * sign;
@@ -405,11 +401,11 @@ PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
res = LONG_MIN;
}
else {
- *overflow = Py_SIZE(v) > 0 ? 1 : -1;
+ *overflow = sign;
/* res is already set to -1 */
}
}
- exit:
+ exit:
if (do_decref) {
Py_DECREF(vv);
}
@@ -464,7 +460,7 @@ PyLong_AsSsize_t(PyObject *vv) {
}
while (--i >= 0) {
prev = x;
- x = (x << PyLong_SHIFT) + v->ob_digit[i];
+ x = (x << PyLong_SHIFT) | v->ob_digit[i];
if ((x >> PyLong_SHIFT) != prev)
goto overflow;
}
@@ -479,7 +475,7 @@ PyLong_AsSsize_t(PyObject *vv) {
}
/* else overflow */
- overflow:
+ overflow:
PyErr_SetString(PyExc_OverflowError,
"Python int too large to convert to C ssize_t");
return -1;
@@ -509,7 +505,7 @@ PyLong_AsUnsignedLong(PyObject *vv)
x = 0;
if (i < 0) {
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned int");
+ "can't convert negative value to unsigned int");
return (unsigned long) -1;
}
switch (i) {
@@ -518,10 +514,11 @@ PyLong_AsUnsignedLong(PyObject *vv)
}
while (--i >= 0) {
prev = x;
- x = (x << PyLong_SHIFT) + v->ob_digit[i];
+ x = (x << PyLong_SHIFT) | v->ob_digit[i];
if ((x >> PyLong_SHIFT) != prev) {
PyErr_SetString(PyExc_OverflowError,
- "python int too large to convert to C unsigned long");
+ "python int too large to convert "
+ "to C unsigned long");
return (unsigned long) -1;
}
}
@@ -561,7 +558,7 @@ PyLong_AsSize_t(PyObject *vv)
}
while (--i >= 0) {
prev = x;
- x = (x << PyLong_SHIFT) + v->ob_digit[i];
+ x = (x << PyLong_SHIFT) | v->ob_digit[i];
if ((x >> PyLong_SHIFT) != prev) {
PyErr_SetString(PyExc_OverflowError,
"Python int too large to convert to C size_t");
@@ -599,7 +596,7 @@ _PyLong_AsUnsignedLongMask(PyObject *vv)
i = -i;
}
while (--i >= 0) {
- x = (x << PyLong_SHIFT) + v->ob_digit[i];
+ x = (x << PyLong_SHIFT) | v->ob_digit[i];
}
return x * sign;
}
@@ -676,7 +673,7 @@ _PyLong_NumBits(PyObject *vv)
}
return result;
-Overflow:
+ Overflow:
PyErr_SetString(PyExc_OverflowError, "int has too many bits "
"to express in a platform size_t");
return (size_t)-1;
@@ -686,7 +683,7 @@ PyObject *
_PyLong_FromByteArray(const unsigned char* bytes, size_t n,
int little_endian, int is_signed)
{
- const unsigned char* pstartbyte;/* LSB of bytes */
+ const unsigned char* pstartbyte; /* LSB of bytes */
int incr; /* direction to move pstartbyte */
const unsigned char* pendbyte; /* MSB of bytes */
size_t numsignificantbytes; /* number of bytes that matter */
@@ -774,8 +771,7 @@ _PyLong_FromByteArray(const unsigned char* bytes, size_t n,
if (accumbits >= PyLong_SHIFT) {
/* There's enough to fill a Python digit. */
assert(idigit < ndigits);
- v->ob_digit[idigit] = (digit)(accum &
- PyLong_MASK);
+ v->ob_digit[idigit] = (digit)(accum & PyLong_MASK);
++idigit;
accum >>= PyLong_SHIFT;
accumbits -= PyLong_SHIFT;
@@ -800,9 +796,9 @@ _PyLong_AsByteArray(PyLongObject* v,
int little_endian, int is_signed)
{
Py_ssize_t i; /* index into v->ob_digit */
- Py_ssize_t ndigits; /* |v->ob_size| */
+ Py_ssize_t ndigits; /* |v->ob_size| */
twodigits accum; /* sliding register */
- unsigned int accumbits; /* # bits in accum */
+ unsigned int accumbits; /* # bits in accum */
int do_twos_comp; /* store 2's-comp? is_signed and v < 0 */
digit carry; /* for computing 2's-comp */
size_t j; /* # bytes filled */
@@ -815,7 +811,7 @@ _PyLong_AsByteArray(PyLongObject* v,
ndigits = -(Py_SIZE(v));
if (!is_signed) {
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative int to unsigned");
+ "can't convert negative int to unsigned");
return -1;
}
do_twos_comp = 1;
@@ -861,8 +857,7 @@ _PyLong_AsByteArray(PyLongObject* v,
/* Count # of sign bits -- they needn't be stored,
* although for signed conversion we need later to
* make sure at least one sign bit gets stored. */
- digit s = do_twos_comp ? thisdigit ^ PyLong_MASK :
- thisdigit;
+ digit s = do_twos_comp ? thisdigit ^ PyLong_MASK : thisdigit;
while (s != 0) {
s >>= 1;
accumbits++;
@@ -922,230 +917,12 @@ _PyLong_AsByteArray(PyLongObject* v,
return 0;
-Overflow:
+ Overflow:
PyErr_SetString(PyExc_OverflowError, "int too big to convert");
return -1;
}
-double
-_PyLong_AsScaledDouble(PyObject *vv, int *exponent)
-{
-/* NBITS_WANTED should be > the number of bits in a double's precision,
- but small enough so that 2**NBITS_WANTED is within the normal double
- range. nbitsneeded is set to 1 less than that because the most-significant
- Python digit contains at least 1 significant bit, but we don't want to
- bother counting them (catering to the worst case cheaply).
-
- 57 is one more than VAX-D double precision; I (Tim) don't know of a double
- format with more precision than that; it's 1 larger so that we add in at
- least one round bit to stand in for the ignored least-significant bits.
-*/
-#define NBITS_WANTED 57
- PyLongObject *v;
- double x;
- const double multiplier = (double)(1L << PyLong_SHIFT);
- Py_ssize_t i;
- int sign;
- int nbitsneeded;
-
- if (vv == NULL || !PyLong_Check(vv)) {
- PyErr_BadInternalCall();
- return -1;
- }
- v = (PyLongObject *)vv;
- i = Py_SIZE(v);
- sign = 1;
- if (i < 0) {
- sign = -1;
- i = -(i);
- }
- else if (i == 0) {
- *exponent = 0;
- return 0.0;
- }
- --i;
- x = (double)v->ob_digit[i];
- nbitsneeded = NBITS_WANTED - 1;
- /* Invariant: i Python digits remain unaccounted for. */
- while (i > 0 && nbitsneeded > 0) {
- --i;
- x = x * multiplier + (double)v->ob_digit[i];
- nbitsneeded -= PyLong_SHIFT;
- }
- /* There are i digits we didn't shift in. Pretending they're all
- zeroes, the true value is x * 2**(i*PyLong_SHIFT). */
- *exponent = i;
- assert(x > 0.0);
- return x * sign;
-#undef NBITS_WANTED
-}
-
-/* Get a C double from a long int object. Rounds to the nearest double,
- using the round-half-to-even rule in the case of a tie. */
-
-double
-PyLong_AsDouble(PyObject *vv)
-{
- PyLongObject *v = (PyLongObject *)vv;
- Py_ssize_t rnd_digit, rnd_bit, m, n;
- digit lsb, *d;
- int round_up = 0;
- double x;
-
- if (vv == NULL || !PyLong_Check(vv)) {
- PyErr_BadInternalCall();
- return -1.0;
- }
-
- /* Notes on the method: for simplicity, assume v is positive and >=
- 2**DBL_MANT_DIG. (For negative v we just ignore the sign until the
- end; for small v no rounding is necessary.) Write n for the number
- of bits in v, so that 2**(n-1) <= v < 2**n, and n > DBL_MANT_DIG.
-
- Some terminology: the *rounding bit* of v is the 1st bit of v that
- will be rounded away (bit n - DBL_MANT_DIG - 1); the *parity bit*
- is the bit immediately above. The round-half-to-even rule says
- that we round up if the rounding bit is set, unless v is exactly
- halfway between two floats and the parity bit is zero.
-
- Write d[0] ... d[m] for the digits of v, least to most significant.
- Let rnd_bit be the index of the rounding bit, and rnd_digit the
- index of the PyLong digit containing the rounding bit. Then the
- bits of the digit d[rnd_digit] look something like:
-
- rounding bit
- |
- v
- msb -> sssssrttttttttt <- lsb
- ^
- |
- parity bit
-
- where 's' represents a 'significant bit' that will be included in
- the mantissa of the result, 'r' is the rounding bit, and 't'
- represents a 'trailing bit' following the rounding bit. Note that
- if the rounding bit is at the top of d[rnd_digit] then the parity
- bit will be the lsb of d[rnd_digit+1]. If we set
-
- lsb = 1 << (rnd_bit % PyLong_SHIFT)
-
- then d[rnd_digit] & (PyLong_BASE - 2*lsb) selects just the
- significant bits of d[rnd_digit], d[rnd_digit] & (lsb-1) gets the
- trailing bits, and d[rnd_digit] & lsb gives the rounding bit.
-
- We initialize the double x to the integer given by digits
- d[rnd_digit:m-1], but with the rounding bit and trailing bits of
- d[rnd_digit] masked out. So the value of x comes from the top
- DBL_MANT_DIG bits of v, multiplied by 2*lsb. Note that in the loop
- that produces x, all floating-point operations are exact (assuming
- that FLT_RADIX==2). Now if we're rounding down, the value we want
- to return is simply
-
- x * 2**(PyLong_SHIFT * rnd_digit).
-
- and if we're rounding up, it's
-
- (x + 2*lsb) * 2**(PyLong_SHIFT * rnd_digit).
-
- Under the round-half-to-even rule, we round up if, and only
- if, the rounding bit is set *and* at least one of the
- following three conditions is satisfied:
-
- (1) the parity bit is set, or
- (2) at least one of the trailing bits of d[rnd_digit] is set, or
- (3) at least one of the digits d[i], 0 <= i < rnd_digit
- is nonzero.
-
- Finally, we have to worry about overflow. If v >= 2**DBL_MAX_EXP,
- or equivalently n > DBL_MAX_EXP, then overflow occurs. If v <
- 2**DBL_MAX_EXP then we're usually safe, but there's a corner case
- to consider: if v is very close to 2**DBL_MAX_EXP then it's
- possible that v is rounded up to exactly 2**DBL_MAX_EXP, and then
- again overflow occurs.
- */
-
- if (Py_SIZE(v) == 0)
- return 0.0;
- m = ABS(Py_SIZE(v)) - 1;
- d = v->ob_digit;
- assert(d[m]); /* v should be normalized */
-
- /* fast path for case where 0 < abs(v) < 2**DBL_MANT_DIG */
- if (m < DBL_MANT_DIG / PyLong_SHIFT ||
- (m == DBL_MANT_DIG / PyLong_SHIFT &&
- d[m] < (digit)1 << DBL_MANT_DIG%PyLong_SHIFT)) {
- x = d[m];
- while (--m >= 0)
- x = x*PyLong_BASE + d[m];
- return Py_SIZE(v) < 0 ? -x : x;
- }
-
- /* if m is huge then overflow immediately; otherwise, compute the
- number of bits n in v. The condition below implies n (= #bits) >=
- m * PyLong_SHIFT + 1 > DBL_MAX_EXP, hence v >= 2**DBL_MAX_EXP. */
- if (m > (DBL_MAX_EXP-1)/PyLong_SHIFT)
- goto overflow;
- n = m * PyLong_SHIFT + bits_in_digit(d[m]);
- if (n > DBL_MAX_EXP)
- goto overflow;
-
- /* find location of rounding bit */
- assert(n > DBL_MANT_DIG); /* dealt with |v| < 2**DBL_MANT_DIG above */
- rnd_bit = n - DBL_MANT_DIG - 1;
- rnd_digit = rnd_bit/PyLong_SHIFT;
- lsb = (digit)1 << (rnd_bit%PyLong_SHIFT);
-
- /* Get top DBL_MANT_DIG bits of v. Assumes PyLong_SHIFT <
- DBL_MANT_DIG, so we'll need bits from at least 2 digits of v. */
- x = d[m];
- assert(m > rnd_digit);
- while (--m > rnd_digit)
- x = x*PyLong_BASE + d[m];
- x = x*PyLong_BASE + (d[m] & (PyLong_BASE-2*lsb));
-
- /* decide whether to round up, using round-half-to-even */
- assert(m == rnd_digit);
- if (d[m] & lsb) { /* if (rounding bit is set) */
- digit parity_bit;
- if (lsb == PyLong_BASE/2)
- parity_bit = d[m+1] & 1;
- else
- parity_bit = d[m] & 2*lsb;
- if (parity_bit)
- round_up = 1;
- else if (d[m] & (lsb-1))
- round_up = 1;
- else {
- while (--m >= 0) {
- if (d[m]) {
- round_up = 1;
- break;
- }
- }
- }
- }
-
- /* and round up if necessary */
- if (round_up) {
- x += 2*lsb;
- if (n == DBL_MAX_EXP &&
- x == ldexp((double)(2*lsb), DBL_MANT_DIG)) {
- /* overflow corner case */
- goto overflow;
- }
- }
-
- /* shift, adjust for sign, and return */
- x = ldexp(x, rnd_digit*PyLong_SHIFT);
- return Py_SIZE(v) < 0 ? -x : x;
-
- overflow:
- PyErr_SetString(PyExc_OverflowError,
- "Python int too large to convert to C double");
- return -1.0;
-}
-
/* Create a new long (or int) object from a C pointer */
PyObject *
@@ -1209,6 +986,7 @@ PyLong_AsVoidPtr(PyObject *vv)
*/
#define IS_LITTLE_ENDIAN (int)*(unsigned char*)&one
+#define PY_ABS_LLONG_MIN (0-(unsigned PY_LONG_LONG)PY_LLONG_MIN)
/* Create a new long int object from a C PY_LONG_LONG int. */
@@ -1394,9 +1172,8 @@ PyLong_AsLongLong(PyObject *vv)
case 0: return 0;
case 1: return v->ob_digit[0];
}
- res = _PyLong_AsByteArray(
- (PyLongObject *)vv, (unsigned char *)&bytes,
- SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 1);
+ res = _PyLong_AsByteArray((PyLongObject *)vv, (unsigned char *)&bytes,
+ SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 1);
/* Plan 9 can't handle PY_LONG_LONG in ? : expressions */
if (res < 0)
@@ -1427,9 +1204,8 @@ PyLong_AsUnsignedLongLong(PyObject *vv)
case 1: return v->ob_digit[0];
}
- res = _PyLong_AsByteArray(
- (PyLongObject *)vv, (unsigned char *)&bytes,
- SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 0);
+ res = _PyLong_AsByteArray((PyLongObject *)vv, (unsigned char *)&bytes,
+ SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 0);
/* Plan 9 can't handle PY_LONG_LONG in ? : expressions */
if (res < 0)
@@ -1466,7 +1242,7 @@ _PyLong_AsUnsignedLongLongMask(PyObject *vv)
i = -i;
}
while (--i >= 0) {
- x = (x << PyLong_SHIFT) + v->ob_digit[i];
+ x = (x << PyLong_SHIFT) | v->ob_digit[i];
}
return x * sign;
}
@@ -1507,13 +1283,110 @@ PyLong_AsUnsignedLongLongMask(register PyObject *op)
}
#undef IS_LITTLE_ENDIAN
-#endif /* HAVE_LONG_LONG */
+/* Get a C long long int from a Python long or Python int object.
+ On overflow, returns -1 and sets *overflow to 1 or -1 depending
+ on the sign of the result. Otherwise *overflow is 0.
+
+ For other errors (e.g., type error), returns -1 and sets an error
+ condition.
+*/
+
+PY_LONG_LONG
+PyLong_AsLongLongAndOverflow(PyObject *vv, int *overflow)
+{
+ /* This version by Tim Peters */
+ register PyLongObject *v;
+ unsigned PY_LONG_LONG x, prev;
+ PY_LONG_LONG res;
+ Py_ssize_t i;
+ int sign;
+ int do_decref = 0; /* if nb_int was called */
+
+ *overflow = 0;
+ if (vv == NULL) {
+ PyErr_BadInternalCall();
+ return -1;
+ }
+
+ if (!PyLong_Check(vv)) {
+ PyNumberMethods *nb;
+ nb = vv->ob_type->tp_as_number;
+ if (nb == NULL || nb->nb_int == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ return -1;
+ }
+ vv = (*nb->nb_int) (vv);
+ if (vv == NULL)
+ return -1;
+ do_decref = 1;
+ if (!PyLong_Check(vv)) {
+ Py_DECREF(vv);
+ PyErr_SetString(PyExc_TypeError,
+ "nb_int should return int object");
+ return -1;
+ }
+ }
-#define CHECK_BINOP(v,w) \
- if (!PyLong_Check(v) || !PyLong_Check(w)) { \
- Py_INCREF(Py_NotImplemented); \
- return Py_NotImplemented; \
+ res = -1;
+ v = (PyLongObject *)vv;
+ i = Py_SIZE(v);
+
+ switch (i) {
+ case -1:
+ res = -(sdigit)v->ob_digit[0];
+ break;
+ case 0:
+ res = 0;
+ break;
+ case 1:
+ res = v->ob_digit[0];
+ break;
+ default:
+ sign = 1;
+ x = 0;
+ if (i < 0) {
+ sign = -1;
+ i = -(i);
+ }
+ while (--i >= 0) {
+ prev = x;
+ x = (x << PyLong_SHIFT) + v->ob_digit[i];
+ if ((x >> PyLong_SHIFT) != prev) {
+ *overflow = sign;
+ goto exit;
+ }
+ }
+ /* Haven't lost any bits, but casting to long requires extra
+ * care (see comment above).
+ */
+ if (x <= (unsigned PY_LONG_LONG)PY_LLONG_MAX) {
+ res = (PY_LONG_LONG)x * sign;
+ }
+ else if (sign < 0 && x == PY_ABS_LLONG_MIN) {
+ res = PY_LLONG_MIN;
+ }
+ else {
+ *overflow = sign;
+ /* res is already set to -1 */
+ }
}
+ exit:
+ if (do_decref) {
+ Py_DECREF(vv);
+ }
+ return res;
+}
+
+#endif /* HAVE_LONG_LONG */
+
+#define CHECK_BINOP(v,w) \
+ do { \
+ if (!PyLong_Check(v) || !PyLong_Check(w)) { \
+ Py_INCREF(Py_NotImplemented); \
+ return Py_NotImplemented; \
+ } \
+ } while(0)
/* bits_in_digit(d) returns the unique integer k such that 2**(k-1) <= d <
2**k if d is nonzero, else 0. */
@@ -1640,7 +1513,7 @@ inplace_divrem1(digit *pout, digit *pin, Py_ssize_t size, digit n)
pout += size;
while (--size >= 0) {
digit hi;
- rem = (rem << PyLong_SHIFT) + *--pin;
+ rem = (rem << PyLong_SHIFT) | *--pin;
*--pout = hi = (digit)(rem / n);
rem -= (twodigits)hi * n;
}
@@ -1665,8 +1538,122 @@ divrem1(PyLongObject *a, digit n, digit *prem)
return long_normalize(z);
}
-/* Convert a long int object to a string, using a given conversion base.
- Return a string object.
+/* Convert a long integer to a base 10 string. Returns a new non-shared
+ string. (Return value is non-shared so that callers can modify the
+ returned value if necessary.) */
+
+static PyObject *
+long_to_decimal_string(PyObject *aa)
+{
+ PyLongObject *scratch, *a;
+ PyObject *str;
+ Py_ssize_t size, strlen, size_a, i, j;
+ digit *pout, *pin, rem, tenpow;
+ Py_UNICODE *p;
+ int negative;
+
+ a = (PyLongObject *)aa;
+ if (a == NULL || !PyLong_Check(a)) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+ size_a = ABS(Py_SIZE(a));
+ negative = Py_SIZE(a) < 0;
+
+ /* quick and dirty upper bound for the number of digits
+ required to express a in base _PyLong_DECIMAL_BASE:
+
+ #digits = 1 + floor(log2(a) / log2(_PyLong_DECIMAL_BASE))
+
+ But log2(a) < size_a * PyLong_SHIFT, and
+ log2(_PyLong_DECIMAL_BASE) = log2(10) * _PyLong_DECIMAL_SHIFT
+ > 3 * _PyLong_DECIMAL_SHIFT
+ */
+ if (size_a > PY_SSIZE_T_MAX / PyLong_SHIFT) {
+ PyErr_SetString(PyExc_OverflowError,
+ "long is too large to format");
+ return NULL;
+ }
+ /* the expression size_a * PyLong_SHIFT is now safe from overflow */
+ size = 1 + size_a * PyLong_SHIFT / (3 * _PyLong_DECIMAL_SHIFT);
+ scratch = _PyLong_New(size);
+ if (scratch == NULL)
+ return NULL;
+
+ /* convert array of base _PyLong_BASE digits in pin to an array of
+ base _PyLong_DECIMAL_BASE digits in pout, following Knuth (TAOCP,
+ Volume 2 (3rd edn), section 4.4, Method 1b). */
+ pin = a->ob_digit;
+ pout = scratch->ob_digit;
+ size = 0;
+ for (i = size_a; --i >= 0; ) {
+ digit hi = pin[i];
+ for (j = 0; j < size; j++) {
+ twodigits z = (twodigits)pout[j] << PyLong_SHIFT | hi;
+ hi = (digit)(z / _PyLong_DECIMAL_BASE);
+ pout[j] = (digit)(z - (twodigits)hi *
+ _PyLong_DECIMAL_BASE);
+ }
+ while (hi) {
+ pout[size++] = hi % _PyLong_DECIMAL_BASE;
+ hi /= _PyLong_DECIMAL_BASE;
+ }
+ /* check for keyboard interrupt */
+ SIGCHECK({
+ Py_DECREF(scratch);
+ return NULL;
+ });
+ }
+ /* pout should have at least one digit, so that the case when a = 0
+ works correctly */
+ if (size == 0)
+ pout[size++] = 0;
+
+ /* calculate exact length of output string, and allocate */
+ strlen = negative + 1 + (size - 1) * _PyLong_DECIMAL_SHIFT;
+ tenpow = 10;
+ rem = pout[size-1];
+ while (rem >= tenpow) {
+ tenpow *= 10;
+ strlen++;
+ }
+ str = PyUnicode_FromUnicode(NULL, strlen);
+ if (str == NULL) {
+ Py_DECREF(scratch);
+ return NULL;
+ }
+
+ /* fill the string right-to-left */
+ p = PyUnicode_AS_UNICODE(str) + strlen;
+ *p = '\0';
+ /* pout[0] through pout[size-2] contribute exactly
+ _PyLong_DECIMAL_SHIFT digits each */
+ for (i=0; i < size - 1; i++) {
+ rem = pout[i];
+ for (j = 0; j < _PyLong_DECIMAL_SHIFT; j++) {
+ *--p = '0' + rem % 10;
+ rem /= 10;
+ }
+ }
+ /* pout[size-1]: always produce at least one decimal digit */
+ rem = pout[i];
+ do {
+ *--p = '0' + rem % 10;
+ rem /= 10;
+ } while (rem != 0);
+
+ /* and sign */
+ if (negative)
+ *--p = '-';
+
+ /* check we've counted correctly */
+ assert(p == PyUnicode_AS_UNICODE(str));
+ Py_DECREF(scratch);
+ return (PyObject *)str;
+}
+
+/* Convert a long int object to a string, using a given conversion base,
+ which should be one of 2, 8, 10 or 16. Return a string object.
If base is 2, 8 or 16, add the proper prefix '0b', '0o' or '0x'. */
PyObject *
@@ -1676,32 +1663,44 @@ _PyLong_Format(PyObject *aa, int base)
PyObject *str;
Py_ssize_t i, sz;
Py_ssize_t size_a;
- Py_UNICODE *p;
+ Py_UNICODE *p, sign = '\0';
int bits;
- char sign = '\0';
+
+ assert(base == 2 || base == 8 || base == 10 || base == 16);
+ if (base == 10)
+ return long_to_decimal_string((PyObject *)a);
if (a == NULL || !PyLong_Check(a)) {
PyErr_BadInternalCall();
return NULL;
}
- assert(base >= 2 && base <= 36);
size_a = ABS(Py_SIZE(a));
/* Compute a rough upper bound for the length of the string */
- i = base;
- bits = 0;
- while (i > 1) {
- ++bits;
- i >>= 1;
- }
- i = 5;
- /* ensure we don't get signed overflow in sz calculation */
- if (size_a > (PY_SSIZE_T_MAX - i) / PyLong_SHIFT) {
+ switch (base) {
+ case 16:
+ bits = 4;
+ break;
+ case 8:
+ bits = 3;
+ break;
+ case 2:
+ bits = 1;
+ break;
+ default:
+ assert(0); /* shouldn't ever get here */
+ bits = 0; /* to silence gcc warning */
+ }
+ /* compute length of output string: allow 2 characters for prefix and
+ 1 for possible '-' sign. */
+ if (size_a > (PY_SSIZE_T_MAX - 3) / PyLong_SHIFT) {
PyErr_SetString(PyExc_OverflowError,
"int is too large to format");
return NULL;
}
- sz = i + 1 + (size_a * PyLong_SHIFT - 1) / bits;
+ /* now size_a * PyLong_SHIFT + 3 <= PY_SSIZE_T_MAX, so the RHS below
+ is safe from overflow */
+ sz = 3 + (size_a * PyLong_SHIFT + (bits - 1)) / bits;
assert(sz >= 0);
str = PyUnicode_FromUnicode(NULL, sz);
if (str == NULL)
@@ -1714,106 +1713,33 @@ _PyLong_Format(PyObject *aa, int base)
if (Py_SIZE(a) == 0) {
*--p = '0';
}
- else if ((base & (base - 1)) == 0) {
+ else {
/* JRH: special case for power-of-2 bases */
twodigits accum = 0;
int accumbits = 0; /* # of bits in accum */
- int basebits = 1; /* # of bits in base-1 */
- i = base;
- while ((i >>= 1) > 1)
- ++basebits;
-
for (i = 0; i < size_a; ++i) {
accum |= (twodigits)a->ob_digit[i] << accumbits;
accumbits += PyLong_SHIFT;
- assert(accumbits >= basebits);
+ assert(accumbits >= bits);
do {
- char cdigit = (char)(accum & (base - 1));
+ Py_UNICODE cdigit;
+ cdigit = (Py_UNICODE)(accum & (base - 1));
cdigit += (cdigit < 10) ? '0' : 'a'-10;
assert(p > PyUnicode_AS_UNICODE(str));
*--p = cdigit;
- accumbits -= basebits;
- accum >>= basebits;
- } while (i < size_a-1 ? accumbits >= basebits :
- accum > 0);
- }
- }
- else {
- /* Not 0, and base not a power of 2. Divide repeatedly by
- base, but for speed use the highest power of base that
- fits in a digit. */
- Py_ssize_t size = size_a;
- digit *pin = a->ob_digit;
- PyLongObject *scratch;
- /* powbasw <- largest power of base that fits in a digit. */
- digit powbase = base; /* powbase == base ** power */
- int power = 1;
- for (;;) {
- twodigits newpow = powbase * (twodigits)base;
- if (newpow >> PyLong_SHIFT)
- /* doesn't fit in a digit */
- break;
- powbase = (digit)newpow;
- ++power;
- }
-
- /* Get a scratch area for repeated division. */
- scratch = _PyLong_New(size);
- if (scratch == NULL) {
- Py_DECREF(str);
- return NULL;
+ accumbits -= bits;
+ accum >>= bits;
+ } while (i < size_a-1 ? accumbits >= bits : accum > 0);
}
-
- /* Repeatedly divide by powbase. */
- do {
- int ntostore = power;
- digit rem = inplace_divrem1(scratch->ob_digit,
- pin, size, powbase);
- pin = scratch->ob_digit; /* no need to use a again */
- if (pin[size - 1] == 0)
- --size;
- SIGCHECK({
- Py_DECREF(scratch);
- Py_DECREF(str);
- return NULL;
- })
-
- /* Break rem into digits. */
- assert(ntostore > 0);
- do {
- digit nextrem = (digit)(rem / base);
- char c = (char)(rem - nextrem * base);
- assert(p > PyUnicode_AS_UNICODE(str));
- c += (c < 10) ? '0' : 'a'-10;
- *--p = c;
- rem = nextrem;
- --ntostore;
- /* Termination is a bit delicate: must not
- store leading zeroes, so must get out if
- remaining quotient and rem are both 0. */
- } while (ntostore && (size || rem));
- } while (size != 0);
- Py_DECREF(scratch);
}
- if (base == 16) {
+ if (base == 16)
*--p = 'x';
- *--p = '0';
- }
- else if (base == 8) {
+ else if (base == 8)
*--p = 'o';
- *--p = '0';
- }
- else if (base == 2) {
+ else /* (base == 2) */
*--p = 'b';
- *--p = '0';
- }
- else if (base != 10) {
- *--p = '#';
- *--p = '0' + base%10;
- if (base > 10)
- *--p = '0' + base/10;
- }
+ *--p = '0';
if (sign)
*--p = sign;
if (p != PyUnicode_AS_UNICODE(str)) {
@@ -2072,8 +1998,8 @@ digit beyond the first.
twodigits convmax = base;
int i = 1;
- log_base_BASE[base] = log((double)base) /
- log((double)PyLong_BASE);
+ log_base_BASE[base] = (log((double)base) /
+ log((double)PyLong_BASE));
for (;;) {
twodigits next = convmax * base;
if (next > PyLong_BASE)
@@ -2117,7 +2043,7 @@ digit beyond the first.
c = (digit)_PyLong_DigitValue[Py_CHARMASK(*str++)];
for (i = 1; i < convwidth && str != scan; ++i, ++str) {
c = (twodigits)(c * base +
- (int)_PyLong_DigitValue[Py_CHARMASK(*str)]);
+ (int)_PyLong_DigitValue[Py_CHARMASK(*str)]);
assert(c < PyLong_BASE);
}
@@ -2190,7 +2116,7 @@ digit beyond the first.
long_normalize(z);
return (PyObject *) maybe_small_long(z);
- onError:
+ onError:
Py_XDECREF(z);
slen = strlen(orig_str) < 200 ? strlen(orig_str) : 200;
strobj = PyUnicode_FromStringAndSize(orig_str, slen);
@@ -2207,17 +2133,34 @@ PyObject *
PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base)
{
PyObject *result;
- char *buffer = (char *)PyMem_MALLOC(length+1);
+ PyObject *asciidig;
+ char *buffer, *end;
+ Py_ssize_t i, buflen;
+ Py_UNICODE *ptr;
- if (buffer == NULL)
+ asciidig = PyUnicode_TransformDecimalToASCII(u, length);
+ if (asciidig == NULL)
return NULL;
-
- if (PyUnicode_EncodeDecimal(u, length, buffer, NULL)) {
- PyMem_FREE(buffer);
+ /* Replace non-ASCII whitespace with ' ' */
+ ptr = PyUnicode_AS_UNICODE(asciidig);
+ for (i = 0; i < length; i++) {
+ Py_UNICODE ch = ptr[i];
+ if (ch > 127 && Py_UNICODE_ISSPACE(ch))
+ ptr[i] = ' ';
+ }
+ buffer = _PyUnicode_AsStringAndSize(asciidig, &buflen);
+ if (buffer == NULL) {
+ Py_DECREF(asciidig);
return NULL;
}
- result = PyLong_FromString(buffer, NULL, base);
- PyMem_FREE(buffer);
+ result = PyLong_FromString(buffer, &end, base);
+ if (result != NULL && end != buffer + buflen) {
+ PyErr_SetString(PyExc_ValueError,
+ "null byte in argument for int()");
+ Py_DECREF(result);
+ result = NULL;
+ }
+ Py_DECREF(asciidig);
return result;
}
@@ -2346,12 +2289,12 @@ x_divrem(PyLongObject *v1, PyLongObject *w1, PyLongObject **prem)
single-digit quotient q, remainder in vk[0:size_w]. */
SIGCHECK({
- Py_DECREF(a);
- Py_DECREF(w);
- Py_DECREF(v);
- *prem = NULL;
- return NULL;
- })
+ Py_DECREF(a);
+ Py_DECREF(w);
+ Py_DECREF(v);
+ *prem = NULL;
+ return NULL;
+ });
/* estimate quotient digit q; may overestimate by 1 (rare) */
vtop = vk[size_w];
@@ -2377,7 +2320,7 @@ x_divrem(PyLongObject *v1, PyLongObject *w1, PyLongObject **prem)
(stwodigits)q * (stwodigits)w0[i];
vk[i] = (digit)z & PyLong_MASK;
zhi = (sdigit)Py_ARITHMETIC_RIGHT_SHIFT(stwodigits,
- z, PyLong_SHIFT);
+ z, PyLong_SHIFT);
}
/* add w back if q was too large (this branch taken rarely) */
@@ -2406,6 +2349,153 @@ x_divrem(PyLongObject *v1, PyLongObject *w1, PyLongObject **prem)
return long_normalize(a);
}
+/* For a nonzero PyLong a, express a in the form x * 2**e, with 0.5 <=
+ abs(x) < 1.0 and e >= 0; return x and put e in *e. Here x is
+ rounded to DBL_MANT_DIG significant bits using round-half-to-even.
+ If a == 0, return 0.0 and set *e = 0. If the resulting exponent
+ e is larger than PY_SSIZE_T_MAX, raise OverflowError and return
+ -1.0. */
+
+/* attempt to define 2.0**DBL_MANT_DIG as a compile-time constant */
+#if DBL_MANT_DIG == 53
+#define EXP2_DBL_MANT_DIG 9007199254740992.0
+#else
+#define EXP2_DBL_MANT_DIG (ldexp(1.0, DBL_MANT_DIG))
+#endif
+
+double
+_PyLong_Frexp(PyLongObject *a, Py_ssize_t *e)
+{
+ Py_ssize_t a_size, a_bits, shift_digits, shift_bits, x_size;
+ /* See below for why x_digits is always large enough. */
+ digit rem, x_digits[2 + (DBL_MANT_DIG + 1) / PyLong_SHIFT];
+ double dx;
+ /* Correction term for round-half-to-even rounding. For a digit x,
+ "x + half_even_correction[x & 7]" gives x rounded to the nearest
+ multiple of 4, rounding ties to a multiple of 8. */
+ static const int half_even_correction[8] = {0, -1, -2, 1, 0, -1, 2, 1};
+
+ a_size = ABS(Py_SIZE(a));
+ if (a_size == 0) {
+ /* Special case for 0: significand 0.0, exponent 0. */
+ *e = 0;
+ return 0.0;
+ }
+ a_bits = bits_in_digit(a->ob_digit[a_size-1]);
+ /* The following is an overflow-free version of the check
+ "if ((a_size - 1) * PyLong_SHIFT + a_bits > PY_SSIZE_T_MAX) ..." */
+ if (a_size >= (PY_SSIZE_T_MAX - 1) / PyLong_SHIFT + 1 &&
+ (a_size > (PY_SSIZE_T_MAX - 1) / PyLong_SHIFT + 1 ||
+ a_bits > (PY_SSIZE_T_MAX - 1) % PyLong_SHIFT + 1))
+ goto overflow;
+ a_bits = (a_size - 1) * PyLong_SHIFT + a_bits;
+
+ /* Shift the first DBL_MANT_DIG + 2 bits of a into x_digits[0:x_size]
+ (shifting left if a_bits <= DBL_MANT_DIG + 2).
+
+ Number of digits needed for result: write // for floor division.
+ Then if shifting left, we end up using
+
+ 1 + a_size + (DBL_MANT_DIG + 2 - a_bits) // PyLong_SHIFT
+
+ digits. If shifting right, we use
+
+ a_size - (a_bits - DBL_MANT_DIG - 2) // PyLong_SHIFT
+
+ digits. Using a_size = 1 + (a_bits - 1) // PyLong_SHIFT along with
+ the inequalities
+
+ m // PyLong_SHIFT + n // PyLong_SHIFT <= (m + n) // PyLong_SHIFT
+ m // PyLong_SHIFT - n // PyLong_SHIFT <=
+ 1 + (m - n - 1) // PyLong_SHIFT,
+
+ valid for any integers m and n, we find that x_size satisfies
+
+ x_size <= 2 + (DBL_MANT_DIG + 1) // PyLong_SHIFT
+
+ in both cases.
+ */
+ if (a_bits <= DBL_MANT_DIG + 2) {
+ shift_digits = (DBL_MANT_DIG + 2 - a_bits) / PyLong_SHIFT;
+ shift_bits = (DBL_MANT_DIG + 2 - a_bits) % PyLong_SHIFT;
+ x_size = 0;
+ while (x_size < shift_digits)
+ x_digits[x_size++] = 0;
+ rem = v_lshift(x_digits + x_size, a->ob_digit, a_size,
+ (int)shift_bits);
+ x_size += a_size;
+ x_digits[x_size++] = rem;
+ }
+ else {
+ shift_digits = (a_bits - DBL_MANT_DIG - 2) / PyLong_SHIFT;
+ shift_bits = (a_bits - DBL_MANT_DIG - 2) % PyLong_SHIFT;
+ rem = v_rshift(x_digits, a->ob_digit + shift_digits,
+ a_size - shift_digits, (int)shift_bits);
+ x_size = a_size - shift_digits;
+ /* For correct rounding below, we need the least significant
+ bit of x to be 'sticky' for this shift: if any of the bits
+ shifted out was nonzero, we set the least significant bit
+ of x. */
+ if (rem)
+ x_digits[0] |= 1;
+ else
+ while (shift_digits > 0)
+ if (a->ob_digit[--shift_digits]) {
+ x_digits[0] |= 1;
+ break;
+ }
+ }
+ assert(1 <= x_size &&
+ x_size <= (Py_ssize_t)(sizeof(x_digits)/sizeof(digit)));
+
+ /* Round, and convert to double. */
+ x_digits[0] += half_even_correction[x_digits[0] & 7];
+ dx = x_digits[--x_size];
+ while (x_size > 0)
+ dx = dx * PyLong_BASE + x_digits[--x_size];
+
+ /* Rescale; make correction if result is 1.0. */
+ dx /= 4.0 * EXP2_DBL_MANT_DIG;
+ if (dx == 1.0) {
+ if (a_bits == PY_SSIZE_T_MAX)
+ goto overflow;
+ dx = 0.5;
+ a_bits += 1;
+ }
+
+ *e = a_bits;
+ return Py_SIZE(a) < 0 ? -dx : dx;
+
+ overflow:
+ /* exponent > PY_SSIZE_T_MAX */
+ PyErr_SetString(PyExc_OverflowError,
+ "huge integer: number of bits overflows a Py_ssize_t");
+ *e = 0;
+ return -1.0;
+}
+
+/* Get a C double from a long int object. Rounds to the nearest double,
+ using the round-half-to-even rule in the case of a tie. */
+
+double
+PyLong_AsDouble(PyObject *v)
+{
+ Py_ssize_t exponent;
+ double x;
+
+ if (v == NULL || !PyLong_Check(v)) {
+ PyErr_BadInternalCall();
+ return -1.0;
+ }
+ x = _PyLong_Frexp((PyLongObject *)v, &exponent);
+ if ((x == -1.0 && PyErr_Occurred()) || exponent > DBL_MAX_EXP) {
+ PyErr_SetString(PyExc_OverflowError,
+ "long int too large to convert to float");
+ return -1.0;
+ }
+ return ldexp(x, (int)exponent);
+}
+
/* Methods */
static void
@@ -2414,22 +2504,13 @@ long_dealloc(PyObject *v)
Py_TYPE(v)->tp_free(v);
}
-static PyObject *
-long_repr(PyObject *v)
-{
- return _PyLong_Format(v, 10);
-}
-
static int
long_compare(PyLongObject *a, PyLongObject *b)
{
Py_ssize_t sign;
if (Py_SIZE(a) != Py_SIZE(b)) {
- if (ABS(Py_SIZE(a)) == 0 && ABS(Py_SIZE(b)) == 0)
- sign = 0;
- else
- sign = Py_SIZE(a) - Py_SIZE(b);
+ sign = Py_SIZE(a) - Py_SIZE(b);
}
else {
Py_ssize_t i = ABS(Py_SIZE(a));
@@ -2487,16 +2568,13 @@ long_richcompare(PyObject *self, PyObject *other, int op)
return v;
}
-static long
+static Py_hash_t
long_hash(PyLongObject *v)
{
- unsigned long x;
+ Py_uhash_t x;
Py_ssize_t i;
int sign;
- /* This is designed so that Python ints and longs with the
- same value hash to the same value, otherwise comparisons
- of mapping keys will turn out weird */
i = Py_SIZE(v);
switch(i) {
case -1: return v->ob_digit[0]==1 ? -2 : -(sdigit)v->ob_digit[0];
@@ -2509,23 +2587,42 @@ long_hash(PyLongObject *v)
sign = -1;
i = -(i);
}
- /* The following loop produces a C unsigned long x such that x is
- congruent to the absolute value of v modulo ULONG_MAX. The
- resulting x is nonzero if and only if v is. */
while (--i >= 0) {
- /* Force a native long #-bits (32 or 64) circular shift */
- x = (x >> (8*SIZEOF_LONG-PyLong_SHIFT)) | (x << PyLong_SHIFT);
+ /* Here x is a quantity in the range [0, _PyHASH_MODULUS); we
+ want to compute x * 2**PyLong_SHIFT + v->ob_digit[i] modulo
+ _PyHASH_MODULUS.
+
+ The computation of x * 2**PyLong_SHIFT % _PyHASH_MODULUS
+ amounts to a rotation of the bits of x. To see this, write
+
+ x * 2**PyLong_SHIFT = y * 2**_PyHASH_BITS + z
+
+ where y = x >> (_PyHASH_BITS - PyLong_SHIFT) gives the top
+ PyLong_SHIFT bits of x (those that are shifted out of the
+ original _PyHASH_BITS bits, and z = (x << PyLong_SHIFT) &
+ _PyHASH_MODULUS gives the bottom _PyHASH_BITS - PyLong_SHIFT
+ bits of x, shifted up. Then since 2**_PyHASH_BITS is
+ congruent to 1 modulo _PyHASH_MODULUS, y*2**_PyHASH_BITS is
+ congruent to y modulo _PyHASH_MODULUS. So
+
+ x * 2**PyLong_SHIFT = y + z (mod _PyHASH_MODULUS).
+
+ The right-hand side is just the result of rotating the
+ _PyHASH_BITS bits of x left by PyLong_SHIFT places; since
+ not all _PyHASH_BITS bits of x are 1s, the same is true
+ after rotation, so 0 <= y+z < _PyHASH_MODULUS and y + z is
+ the reduction of x*2**PyLong_SHIFT modulo
+ _PyHASH_MODULUS. */
+ x = ((x << PyLong_SHIFT) & _PyHASH_MODULUS) |
+ (x >> (_PyHASH_BITS - PyLong_SHIFT));
x += v->ob_digit[i];
- /* If the addition above overflowed we compensate by
- incrementing. This preserves the value modulo
- ULONG_MAX. */
- if (x < v->ob_digit[i])
- x++;
+ if (x >= _PyHASH_MODULUS)
+ x -= _PyHASH_MODULUS;
}
x = x * sign;
- if (x == (unsigned long)-1)
- x = (unsigned long)-2;
- return (long)x;
+ if (x == (Py_uhash_t)-1)
+ x = (Py_uhash_t)-2;
+ return (Py_hash_t)x;
}
@@ -2543,8 +2640,8 @@ x_add(PyLongObject *a, PyLongObject *b)
if (size_a < size_b) {
{ PyLongObject *temp = a; a = b; b = temp; }
{ Py_ssize_t size_temp = size_a;
- size_a = size_b;
- size_b = size_temp; }
+ size_a = size_b;
+ size_b = size_temp; }
}
z = _PyLong_New(size_a+1);
if (z == NULL)
@@ -2579,8 +2676,8 @@ x_sub(PyLongObject *a, PyLongObject *b)
sign = -1;
{ PyLongObject *temp = a; a = b; b = temp; }
{ Py_ssize_t size_temp = size_a;
- size_a = size_b;
- size_b = size_temp; }
+ size_a = size_b;
+ size_b = size_temp; }
}
else if (size_a == size_b) {
/* Find highest digit where a and b differ: */
@@ -2708,9 +2805,9 @@ x_mul(PyLongObject *a, PyLongObject *b)
digit *paend = a->ob_digit + size_a;
SIGCHECK({
- Py_DECREF(z);
- return NULL;
- })
+ Py_DECREF(z);
+ return NULL;
+ });
carry = *pz + f * f;
*pz++ = (digit)(carry & PyLong_MASK);
@@ -2746,9 +2843,9 @@ x_mul(PyLongObject *a, PyLongObject *b)
digit *pbend = b->ob_digit + size_b;
SIGCHECK({
- Py_DECREF(z);
- return NULL;
- })
+ Py_DECREF(z);
+ return NULL;
+ });
while (pb < pbend) {
carry += *pz + *pb++ * f;
@@ -2772,7 +2869,10 @@ x_mul(PyLongObject *a, PyLongObject *b)
Returns 0 on success, -1 on failure.
*/
static int
-kmul_split(PyLongObject *n, Py_ssize_t size, PyLongObject **high, PyLongObject **low)
+kmul_split(PyLongObject *n,
+ Py_ssize_t size,
+ PyLongObject **high,
+ PyLongObject **low)
{
PyLongObject *hi, *lo;
Py_ssize_t size_lo, size_hi;
@@ -2961,7 +3061,7 @@ k_mul(PyLongObject *a, PyLongObject *b)
return long_normalize(ret);
- fail:
+ fail:
Py_XDECREF(ret);
Py_XDECREF(ah);
Py_XDECREF(al);
@@ -3071,7 +3171,7 @@ k_lopsided_mul(PyLongObject *a, PyLongObject *b)
Py_DECREF(bslice);
return long_normalize(ret);
- fail:
+ fail:
Py_DECREF(ret);
Py_XDECREF(bslice);
return NULL;
@@ -3183,47 +3283,267 @@ long_div(PyObject *a, PyObject *b)
return (PyObject *)div;
}
+/* PyLong/PyLong -> float, with correctly rounded result. */
+
+#define MANT_DIG_DIGITS (DBL_MANT_DIG / PyLong_SHIFT)
+#define MANT_DIG_BITS (DBL_MANT_DIG % PyLong_SHIFT)
+
static PyObject *
-long_true_divide(PyObject *a, PyObject *b)
+long_true_divide(PyObject *v, PyObject *w)
{
- double ad, bd;
- int failed, aexp = -1, bexp = -1;
+ PyLongObject *a, *b, *x;
+ Py_ssize_t a_size, b_size, shift, extra_bits, diff, x_size, x_bits;
+ digit mask, low;
+ int inexact, negate, a_is_small, b_is_small;
+ double dx, result;
- CHECK_BINOP(a, b);
- ad = _PyLong_AsScaledDouble((PyObject *)a, &aexp);
- bd = _PyLong_AsScaledDouble((PyObject *)b, &bexp);
- failed = (ad == -1.0 || bd == -1.0) && PyErr_Occurred();
- if (failed)
- return NULL;
- /* 'aexp' and 'bexp' were initialized to -1 to silence gcc-4.0.x,
- but should really be set correctly after successful calls to
- _PyLong_AsScaledDouble() */
- assert(aexp >= 0 && bexp >= 0);
+ CHECK_BINOP(v, w);
+ a = (PyLongObject *)v;
+ b = (PyLongObject *)w;
+
+ /*
+ Method in a nutshell:
+
+ 0. reduce to case a, b > 0; filter out obvious underflow/overflow
+ 1. choose a suitable integer 'shift'
+ 2. use integer arithmetic to compute x = floor(2**-shift*a/b)
+ 3. adjust x for correct rounding
+ 4. convert x to a double dx with the same value
+ 5. return ldexp(dx, shift).
+
+ In more detail:
+
+ 0. For any a, a/0 raises ZeroDivisionError; for nonzero b, 0/b
+ returns either 0.0 or -0.0, depending on the sign of b. For a and
+ b both nonzero, ignore signs of a and b, and add the sign back in
+ at the end. Now write a_bits and b_bits for the bit lengths of a
+ and b respectively (that is, a_bits = 1 + floor(log_2(a)); likewise
+ for b). Then
+
+ 2**(a_bits - b_bits - 1) < a/b < 2**(a_bits - b_bits + 1).
+
+ So if a_bits - b_bits > DBL_MAX_EXP then a/b > 2**DBL_MAX_EXP and
+ so overflows. Similarly, if a_bits - b_bits < DBL_MIN_EXP -
+ DBL_MANT_DIG - 1 then a/b underflows to 0. With these cases out of
+ the way, we can assume that
+
+ DBL_MIN_EXP - DBL_MANT_DIG - 1 <= a_bits - b_bits <= DBL_MAX_EXP.
+
+ 1. The integer 'shift' is chosen so that x has the right number of
+ bits for a double, plus two or three extra bits that will be used
+ in the rounding decisions. Writing a_bits and b_bits for the
+ number of significant bits in a and b respectively, a
+ straightforward formula for shift is:
+
+ shift = a_bits - b_bits - DBL_MANT_DIG - 2
+
+ This is fine in the usual case, but if a/b is smaller than the
+ smallest normal float then it can lead to double rounding on an
+ IEEE 754 platform, giving incorrectly rounded results. So we
+ adjust the formula slightly. The actual formula used is:
+
+ shift = MAX(a_bits - b_bits, DBL_MIN_EXP) - DBL_MANT_DIG - 2
+
+ 2. The quantity x is computed by first shifting a (left -shift bits
+ if shift <= 0, right shift bits if shift > 0) and then dividing by
+ b. For both the shift and the division, we keep track of whether
+ the result is inexact, in a flag 'inexact'; this information is
+ needed at the rounding stage.
+
+ With the choice of shift above, together with our assumption that
+ a_bits - b_bits >= DBL_MIN_EXP - DBL_MANT_DIG - 1, it follows
+ that x >= 1.
+
+ 3. Now x * 2**shift <= a/b < (x+1) * 2**shift. We want to replace
+ this with an exactly representable float of the form
+
+ round(x/2**extra_bits) * 2**(extra_bits+shift).
+
+ For float representability, we need x/2**extra_bits <
+ 2**DBL_MANT_DIG and extra_bits + shift >= DBL_MIN_EXP -
+ DBL_MANT_DIG. This translates to the condition:
+
+ extra_bits >= MAX(x_bits, DBL_MIN_EXP - shift) - DBL_MANT_DIG
+
+ To round, we just modify the bottom digit of x in-place; this can
+ end up giving a digit with value > PyLONG_MASK, but that's not a
+ problem since digits can hold values up to 2*PyLONG_MASK+1.
+
+ With the original choices for shift above, extra_bits will always
+ be 2 or 3. Then rounding under the round-half-to-even rule, we
+ round up iff the most significant of the extra bits is 1, and
+ either: (a) the computation of x in step 2 had an inexact result,
+ or (b) at least one other of the extra bits is 1, or (c) the least
+ significant bit of x (above those to be rounded) is 1.
+
+ 4. Conversion to a double is straightforward; all floating-point
+ operations involved in the conversion are exact, so there's no
+ danger of rounding errors.
+
+ 5. Use ldexp(x, shift) to compute x*2**shift, the final result.
+ The result will always be exactly representable as a double, except
+ in the case that it overflows. To avoid dependence on the exact
+ behaviour of ldexp on overflow, we check for overflow before
+ applying ldexp. The result of ldexp is adjusted for sign before
+ returning.
+ */
- if (bd == 0.0) {
+ /* Reduce to case where a and b are both positive. */
+ a_size = ABS(Py_SIZE(a));
+ b_size = ABS(Py_SIZE(b));
+ negate = (Py_SIZE(a) < 0) ^ (Py_SIZE(b) < 0);
+ if (b_size == 0) {
PyErr_SetString(PyExc_ZeroDivisionError,
- "int division or modulo by zero");
- return NULL;
+ "division by zero");
+ goto error;
}
-
- /* True value is very close to ad/bd * 2**(PyLong_SHIFT*(aexp-bexp)) */
- ad /= bd; /* overflow/underflow impossible here */
- aexp -= bexp;
- if (aexp > INT_MAX / PyLong_SHIFT)
+ if (a_size == 0)
+ goto underflow_or_zero;
+
+ /* Fast path for a and b small (exactly representable in a double).
+ Relies on floating-point division being correctly rounded; results
+ may be subject to double rounding on x86 machines that operate with
+ the x87 FPU set to 64-bit precision. */
+ a_is_small = a_size <= MANT_DIG_DIGITS ||
+ (a_size == MANT_DIG_DIGITS+1 &&
+ a->ob_digit[MANT_DIG_DIGITS] >> MANT_DIG_BITS == 0);
+ b_is_small = b_size <= MANT_DIG_DIGITS ||
+ (b_size == MANT_DIG_DIGITS+1 &&
+ b->ob_digit[MANT_DIG_DIGITS] >> MANT_DIG_BITS == 0);
+ if (a_is_small && b_is_small) {
+ double da, db;
+ da = a->ob_digit[--a_size];
+ while (a_size > 0)
+ da = da * PyLong_BASE + a->ob_digit[--a_size];
+ db = b->ob_digit[--b_size];
+ while (b_size > 0)
+ db = db * PyLong_BASE + b->ob_digit[--b_size];
+ result = da / db;
+ goto success;
+ }
+
+ /* Catch obvious cases of underflow and overflow */
+ diff = a_size - b_size;
+ if (diff > PY_SSIZE_T_MAX/PyLong_SHIFT - 1)
+ /* Extreme overflow */
goto overflow;
- else if (aexp < -(INT_MAX / PyLong_SHIFT))
- return PyFloat_FromDouble(0.0); /* underflow to 0 */
- errno = 0;
- ad = ldexp(ad, aexp * PyLong_SHIFT);
- if (Py_OVERFLOWED(ad)) /* ignore underflow to 0.0 */
+ else if (diff < 1 - PY_SSIZE_T_MAX/PyLong_SHIFT)
+ /* Extreme underflow */
+ goto underflow_or_zero;
+ /* Next line is now safe from overflowing a Py_ssize_t */
+ diff = diff * PyLong_SHIFT + bits_in_digit(a->ob_digit[a_size - 1]) -
+ bits_in_digit(b->ob_digit[b_size - 1]);
+ /* Now diff = a_bits - b_bits. */
+ if (diff > DBL_MAX_EXP)
goto overflow;
- return PyFloat_FromDouble(ad);
+ else if (diff < DBL_MIN_EXP - DBL_MANT_DIG - 1)
+ goto underflow_or_zero;
+
+ /* Choose value for shift; see comments for step 1 above. */
+ shift = MAX(diff, DBL_MIN_EXP) - DBL_MANT_DIG - 2;
+
+ inexact = 0;
+
+ /* x = abs(a * 2**-shift) */
+ if (shift <= 0) {
+ Py_ssize_t i, shift_digits = -shift / PyLong_SHIFT;
+ digit rem;
+ /* x = a << -shift */
+ if (a_size >= PY_SSIZE_T_MAX - 1 - shift_digits) {
+ /* In practice, it's probably impossible to end up
+ here. Both a and b would have to be enormous,
+ using close to SIZE_T_MAX bytes of memory each. */
+ PyErr_SetString(PyExc_OverflowError,
+ "intermediate overflow during division");
+ goto error;
+ }
+ x = _PyLong_New(a_size + shift_digits + 1);
+ if (x == NULL)
+ goto error;
+ for (i = 0; i < shift_digits; i++)
+ x->ob_digit[i] = 0;
+ rem = v_lshift(x->ob_digit + shift_digits, a->ob_digit,
+ a_size, -shift % PyLong_SHIFT);
+ x->ob_digit[a_size + shift_digits] = rem;
+ }
+ else {
+ Py_ssize_t shift_digits = shift / PyLong_SHIFT;
+ digit rem;
+ /* x = a >> shift */
+ assert(a_size >= shift_digits);
+ x = _PyLong_New(a_size - shift_digits);
+ if (x == NULL)
+ goto error;
+ rem = v_rshift(x->ob_digit, a->ob_digit + shift_digits,
+ a_size - shift_digits, shift % PyLong_SHIFT);
+ /* set inexact if any of the bits shifted out is nonzero */
+ if (rem)
+ inexact = 1;
+ while (!inexact && shift_digits > 0)
+ if (a->ob_digit[--shift_digits])
+ inexact = 1;
+ }
+ long_normalize(x);
+ x_size = Py_SIZE(x);
+
+ /* x //= b. If the remainder is nonzero, set inexact. We own the only
+ reference to x, so it's safe to modify it in-place. */
+ if (b_size == 1) {
+ digit rem = inplace_divrem1(x->ob_digit, x->ob_digit, x_size,
+ b->ob_digit[0]);
+ long_normalize(x);
+ if (rem)
+ inexact = 1;
+ }
+ else {
+ PyLongObject *div, *rem;
+ div = x_divrem(x, b, &rem);
+ Py_DECREF(x);
+ x = div;
+ if (x == NULL)
+ goto error;
+ if (Py_SIZE(rem))
+ inexact = 1;
+ Py_DECREF(rem);
+ }
+ x_size = ABS(Py_SIZE(x));
+ assert(x_size > 0); /* result of division is never zero */
+ x_bits = (x_size-1)*PyLong_SHIFT+bits_in_digit(x->ob_digit[x_size-1]);
+
+ /* The number of extra bits that have to be rounded away. */
+ extra_bits = MAX(x_bits, DBL_MIN_EXP - shift) - DBL_MANT_DIG;
+ assert(extra_bits == 2 || extra_bits == 3);
+
+ /* Round by directly modifying the low digit of x. */
+ mask = (digit)1 << (extra_bits - 1);
+ low = x->ob_digit[0] | inexact;
+ if (low & mask && low & (3*mask-1))
+ low += mask;
+ x->ob_digit[0] = low & ~(mask-1U);
+
+ /* Convert x to a double dx; the conversion is exact. */
+ dx = x->ob_digit[--x_size];
+ while (x_size > 0)
+ dx = dx * PyLong_BASE + x->ob_digit[--x_size];
+ Py_DECREF(x);
+
+ /* Check whether ldexp result will overflow a double. */
+ if (shift + x_bits >= DBL_MAX_EXP &&
+ (shift + x_bits > DBL_MAX_EXP || dx == ldexp(1.0, (int)x_bits)))
+ goto overflow;
+ result = ldexp(dx, (int)shift);
+
+ success:
+ return PyFloat_FromDouble(negate ? -result : result);
-overflow:
+ underflow_or_zero:
+ return PyFloat_FromDouble(negate ? -0.0 : 0.0);
+
+ overflow:
PyErr_SetString(PyExc_OverflowError,
- "int/int too large for a float");
+ "integer division result too large for a float");
+ error:
return NULL;
-
}
static PyObject *
@@ -3298,7 +3618,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
if (Py_SIZE(b) < 0) { /* if exponent is negative */
if (c) {
PyErr_SetString(PyExc_TypeError, "pow() 2nd argument "
- "cannot be negative when 3rd argument specified");
+ "cannot be negative when 3rd argument specified");
goto Error;
}
else {
@@ -3364,26 +3684,28 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
* is NULL.
*/
#define REDUCE(X) \
- if (c != NULL) { \
- if (l_divmod(X, c, NULL, &temp) < 0) \
- goto Error; \
- Py_XDECREF(X); \
- X = temp; \
- temp = NULL; \
- }
+ do { \
+ if (c != NULL) { \
+ if (l_divmod(X, c, NULL, &temp) < 0) \
+ goto Error; \
+ Py_XDECREF(X); \
+ X = temp; \
+ temp = NULL; \
+ } \
+ } while(0)
/* Multiply two values, then reduce the result:
result = X*Y % c. If c is NULL, skip the mod. */
-#define MULT(X, Y, result) \
-{ \
- temp = (PyLongObject *)long_mul(X, Y); \
- if (temp == NULL) \
- goto Error; \
- Py_XDECREF(result); \
- result = temp; \
- temp = NULL; \
- REDUCE(result) \
-}
+#define MULT(X, Y, result) \
+ do { \
+ temp = (PyLongObject *)long_mul(X, Y); \
+ if (temp == NULL) \
+ goto Error; \
+ Py_XDECREF(result); \
+ result = temp; \
+ temp = NULL; \
+ REDUCE(result); \
+ } while(0)
if (Py_SIZE(b) <= FIVEARY_CUTOFF) {
/* Left-to-right binary exponentiation (HAC Algorithm 14.79) */
@@ -3392,9 +3714,9 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
digit bi = b->ob_digit[i];
for (j = (digit)1 << (PyLong_SHIFT-1); j != 0; j >>= 1) {
- MULT(z, z, z)
+ MULT(z, z, z);
if (bi & j)
- MULT(z, a, z)
+ MULT(z, a, z);
}
}
}
@@ -3403,7 +3725,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
Py_INCREF(z); /* still holds 1L */
table[0] = z;
for (i = 1; i < 32; ++i)
- MULT(table[i-1], a, table[i])
+ MULT(table[i-1], a, table[i]);
for (i = Py_SIZE(b) - 1; i >= 0; --i) {
const digit bi = b->ob_digit[i];
@@ -3411,9 +3733,9 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
for (j = PyLong_SHIFT - 5; j >= 0; j -= 5) {
const int index = (bi >> j) & 0x1f;
for (k = 0; k < 5; ++k)
- MULT(z, z, z)
+ MULT(z, z, z);
if (index)
- MULT(z, table[index], z)
+ MULT(z, table[index], z);
}
}
}
@@ -3428,13 +3750,13 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
}
goto Done;
- Error:
+ Error:
if (z != NULL) {
Py_DECREF(z);
z = NULL;
}
/* fall through */
- Done:
+ Done:
if (Py_SIZE(b) > FIVEARY_CUTOFF) {
for (i = 0; i < 32; ++i)
Py_XDECREF(table[i]);
@@ -3489,15 +3811,14 @@ long_abs(PyLongObject *v)
static int
long_bool(PyLongObject *v)
{
- return ABS(Py_SIZE(v)) != 0;
+ return Py_SIZE(v) != 0;
}
static PyObject *
long_rshift(PyLongObject *a, PyLongObject *b)
{
PyLongObject *z = NULL;
- long shiftby;
- Py_ssize_t newsize, wordshift, loshift, hishift, i, j;
+ Py_ssize_t shiftby, newsize, wordshift, loshift, hishift, i, j;
digit lomask, himask;
CHECK_BINOP(a, b);
@@ -3516,8 +3837,7 @@ long_rshift(PyLongObject *a, PyLongObject *b)
Py_DECREF(a2);
}
else {
-
- shiftby = PyLong_AsLong((PyObject *)b);
+ shiftby = PyLong_AsSsize_t((PyObject *)b);
if (shiftby == -1L && PyErr_Occurred())
goto rshift_error;
if (shiftby < 0) {
@@ -3541,12 +3861,11 @@ long_rshift(PyLongObject *a, PyLongObject *b)
for (i = 0, j = wordshift; i < newsize; i++, j++) {
z->ob_digit[i] = (a->ob_digit[j] >> loshift) & lomask;
if (i+1 < newsize)
- z->ob_digit[i] |=
- (a->ob_digit[j+1] << hishift) & himask;
+ z->ob_digit[i] |= (a->ob_digit[j+1] << hishift) & himask;
}
z = long_normalize(z);
}
-rshift_error:
+ rshift_error:
return (PyObject *) maybe_small_long(z);
}
@@ -3558,27 +3877,21 @@ long_lshift(PyObject *v, PyObject *w)
PyLongObject *a = (PyLongObject*)v;
PyLongObject *b = (PyLongObject*)w;
PyLongObject *z = NULL;
- long shiftby;
- Py_ssize_t oldsize, newsize, wordshift, remshift, i, j;
+ Py_ssize_t shiftby, oldsize, newsize, wordshift, remshift, i, j;
twodigits accum;
CHECK_BINOP(a, b);
- shiftby = PyLong_AsLong((PyObject *)b);
+ shiftby = PyLong_AsSsize_t((PyObject *)b);
if (shiftby == -1L && PyErr_Occurred())
goto lshift_error;
if (shiftby < 0) {
PyErr_SetString(PyExc_ValueError, "negative shift count");
goto lshift_error;
}
- if ((long)(int)shiftby != shiftby) {
- PyErr_SetString(PyExc_ValueError,
- "outrageous left shift count");
- goto lshift_error;
- }
/* wordshift, remshift = divmod(shiftby, PyLong_SHIFT) */
- wordshift = (int)shiftby / PyLong_SHIFT;
- remshift = (int)shiftby - wordshift * PyLong_SHIFT;
+ wordshift = shiftby / PyLong_SHIFT;
+ remshift = shiftby - wordshift * PyLong_SHIFT;
oldsize = ABS(Py_SIZE(a));
newsize = oldsize + wordshift;
@@ -3602,116 +3915,150 @@ long_lshift(PyObject *v, PyObject *w)
else
assert(!accum);
z = long_normalize(z);
-lshift_error:
+ lshift_error:
return (PyObject *) maybe_small_long(z);
}
+/* Compute two's complement of digit vector a[0:m], writing result to
+ z[0:m]. The digit vector a need not be normalized, but should not
+ be entirely zero. a and z may point to the same digit vector. */
+
+static void
+v_complement(digit *z, digit *a, Py_ssize_t m)
+{
+ Py_ssize_t i;
+ digit carry = 1;
+ for (i = 0; i < m; ++i) {
+ carry += a[i] ^ PyLong_MASK;
+ z[i] = carry & PyLong_MASK;
+ carry >>= PyLong_SHIFT;
+ }
+ assert(carry == 0);
+}
/* Bitwise and/xor/or operations */
static PyObject *
long_bitwise(PyLongObject *a,
int op, /* '&', '|', '^' */
- PyLongObject *b)
+ PyLongObject *b)
{
- digit maska, maskb; /* 0 or PyLong_MASK */
- int negz;
+ int nega, negb, negz;
Py_ssize_t size_a, size_b, size_z, i;
PyLongObject *z;
- digit diga, digb;
- PyObject *v;
- if (Py_SIZE(a) < 0) {
- a = (PyLongObject *) long_invert(a);
- if (a == NULL)
+ /* Bitwise operations for negative numbers operate as though
+ on a two's complement representation. So convert arguments
+ from sign-magnitude to two's complement, and convert the
+ result back to sign-magnitude at the end. */
+
+ /* If a is negative, replace it by its two's complement. */
+ size_a = ABS(Py_SIZE(a));
+ nega = Py_SIZE(a) < 0;
+ if (nega) {
+ z = _PyLong_New(size_a);
+ if (z == NULL)
return NULL;
- maska = PyLong_MASK;
+ v_complement(z->ob_digit, a->ob_digit, size_a);
+ a = z;
}
- else {
+ else
+ /* Keep reference count consistent. */
Py_INCREF(a);
- maska = 0;
- }
- if (Py_SIZE(b) < 0) {
- b = (PyLongObject *) long_invert(b);
- if (b == NULL) {
+
+ /* Same for b. */
+ size_b = ABS(Py_SIZE(b));
+ negb = Py_SIZE(b) < 0;
+ if (negb) {
+ z = _PyLong_New(size_b);
+ if (z == NULL) {
Py_DECREF(a);
return NULL;
}
- maskb = PyLong_MASK;
+ v_complement(z->ob_digit, b->ob_digit, size_b);
+ b = z;
}
- else {
+ else
Py_INCREF(b);
- maskb = 0;
+
+ /* Swap a and b if necessary to ensure size_a >= size_b. */
+ if (size_a < size_b) {
+ z = a; a = b; b = z;
+ size_z = size_a; size_a = size_b; size_b = size_z;
+ negz = nega; nega = negb; negb = negz;
}
- negz = 0;
+ /* JRH: The original logic here was to allocate the result value (z)
+ as the longer of the two operands. However, there are some cases
+ where the result is guaranteed to be shorter than that: AND of two
+ positives, OR of two negatives: use the shorter number. AND with
+ mixed signs: use the positive number. OR with mixed signs: use the
+ negative number.
+ */
switch (op) {
case '^':
- if (maska != maskb) {
- maska ^= PyLong_MASK;
- negz = -1;
- }
+ negz = nega ^ negb;
+ size_z = size_a;
break;
case '&':
- if (maska && maskb) {
- op = '|';
- maska ^= PyLong_MASK;
- maskb ^= PyLong_MASK;
- negz = -1;
- }
+ negz = nega & negb;
+ size_z = negb ? size_a : size_b;
break;
case '|':
- if (maska || maskb) {
- op = '&';
- maska ^= PyLong_MASK;
- maskb ^= PyLong_MASK;
- negz = -1;
- }
+ negz = nega | negb;
+ size_z = negb ? size_b : size_a;
break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
}
- /* JRH: The original logic here was to allocate the result value (z)
- as the longer of the two operands. However, there are some cases
- where the result is guaranteed to be shorter than that: AND of two
- positives, OR of two negatives: use the shorter number. AND with
- mixed signs: use the positive number. OR with mixed signs: use the
- negative number. After the transformations above, op will be '&'
- iff one of these cases applies, and mask will be non-0 for operands
- whose length should be ignored.
- */
-
- size_a = Py_SIZE(a);
- size_b = Py_SIZE(b);
- size_z = op == '&'
- ? (maska
- ? size_b
- : (maskb ? size_a : MIN(size_a, size_b)))
- : MAX(size_a, size_b);
- z = _PyLong_New(size_z);
+ /* We allow an extra digit if z is negative, to make sure that
+ the final two's complement of z doesn't overflow. */
+ z = _PyLong_New(size_z + negz);
if (z == NULL) {
Py_DECREF(a);
Py_DECREF(b);
return NULL;
}
- for (i = 0; i < size_z; ++i) {
- diga = (i < size_a ? a->ob_digit[i] : 0) ^ maska;
- digb = (i < size_b ? b->ob_digit[i] : 0) ^ maskb;
- switch (op) {
- case '&': z->ob_digit[i] = diga & digb; break;
- case '|': z->ob_digit[i] = diga | digb; break;
- case '^': z->ob_digit[i] = diga ^ digb; break;
- }
+ /* Compute digits for overlap of a and b. */
+ switch(op) {
+ case '&':
+ for (i = 0; i < size_b; ++i)
+ z->ob_digit[i] = a->ob_digit[i] & b->ob_digit[i];
+ break;
+ case '|':
+ for (i = 0; i < size_b; ++i)
+ z->ob_digit[i] = a->ob_digit[i] | b->ob_digit[i];
+ break;
+ case '^':
+ for (i = 0; i < size_b; ++i)
+ z->ob_digit[i] = a->ob_digit[i] ^ b->ob_digit[i];
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
+ }
+
+ /* Copy any remaining digits of a, inverting if necessary. */
+ if (op == '^' && negb)
+ for (; i < size_z; ++i)
+ z->ob_digit[i] = a->ob_digit[i] ^ PyLong_MASK;
+ else if (i < size_z)
+ memcpy(&z->ob_digit[i], &a->ob_digit[i],
+ (size_z-i)*sizeof(digit));
+
+ /* Complement result if negative. */
+ if (negz) {
+ Py_SIZE(z) = -(Py_SIZE(z));
+ z->ob_digit[size_z] = PyLong_MASK;
+ v_complement(z->ob_digit, z->ob_digit, size_z+1);
}
Py_DECREF(a);
Py_DECREF(b);
- z = long_normalize(z);
- if (negz == 0)
- return (PyObject *) maybe_small_long(z);
- v = long_invert(z);
- Py_DECREF(z);
- return v;
+ return (PyObject *)maybe_small_long(long_normalize(z));
}
static PyObject *
@@ -3767,23 +4114,34 @@ long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
static PyObject *
long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
- PyObject *x = NULL;
- int base = -909; /* unlikely! */
+ PyObject *obase = NULL, *x = NULL;
+ long base;
+ int overflow;
static char *kwlist[] = {"x", "base", 0};
if (type != &PyLong_Type)
return long_subtype_new(type, args, kwds); /* Wimp out */
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:int", kwlist,
- &x, &base))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO:int", kwlist,
+ &x, &obase))
return NULL;
if (x == NULL)
return PyLong_FromLong(0L);
- if (base == -909)
+ if (obase == NULL)
return PyNumber_Long(x);
- else if (PyUnicode_Check(x))
+
+ base = PyLong_AsLongAndOverflow(obase, &overflow);
+ if (base == -1 && PyErr_Occurred())
+ return NULL;
+ if (overflow || (base != 0 && base < 2) || base > 36) {
+ PyErr_SetString(PyExc_ValueError,
+ "int() arg 2 must be >= 2 and <= 36");
+ return NULL;
+ }
+
+ if (PyUnicode_Check(x))
return PyLong_FromUnicode(PyUnicode_AS_UNICODE(x),
PyUnicode_GET_SIZE(x),
- base);
+ (int)base);
else if (PyByteArray_Check(x) || PyBytes_Check(x)) {
/* Since PyLong_FromString doesn't have a length parameter,
* check here for possible NULs in the string. */
@@ -3797,15 +4155,15 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
/* We only see this if there's a null byte in x,
x is a bytes or buffer, *and* a base is given. */
PyErr_Format(PyExc_ValueError,
- "invalid literal for int() with base %d: %R",
- base, x);
+ "invalid literal for int() with base %d: %R",
+ (int)base, x);
return NULL;
}
- return PyLong_FromString(string, NULL, base);
+ return PyLong_FromString(string, NULL, (int)base);
}
else {
PyErr_SetString(PyExc_TypeError,
- "int() can't convert non-string with explicit base");
+ "int() can't convert non-string with explicit base");
return NULL;
}
}
@@ -3870,140 +4228,169 @@ long__format__(PyObject *self, PyObject *args)
PyUnicode_GET_SIZE(format_spec));
}
-static PyObject *
-long_round(PyObject *self, PyObject *args)
+/* Return a pair (q, r) such that a = b * q + r, and
+ abs(r) <= abs(b)/2, with equality possible only if q is even.
+ In other words, q == a / b, rounded to the nearest integer using
+ round-half-to-even. */
+
+PyObject *
+_PyLong_DivmodNear(PyObject *a, PyObject *b)
{
- PyObject *o_ndigits=NULL, *temp;
- PyLongObject *pow=NULL, *q=NULL, *r=NULL, *ndigits=NULL, *one;
- int errcode;
- digit q_mod_4;
-
- /* Notes on the algorithm: to round to the nearest 10**n (n positive),
- the straightforward method is:
-
- (1) divide by 10**n
- (2) round to nearest integer (round to even in case of tie)
- (3) multiply result by 10**n.
-
- But the rounding step involves examining the fractional part of the
- quotient to see whether it's greater than 0.5 or not. Since we
- want to do the whole calculation in integer arithmetic, it's
- simpler to do:
-
- (1) divide by (10**n)/2
- (2) round to nearest multiple of 2 (multiple of 4 in case of tie)
- (3) multiply result by (10**n)/2.
-
- Then all we need to know about the fractional part of the quotient
- arising in step (2) is whether it's zero or not.
-
- Doing both a multiplication and division is wasteful, and is easily
- avoided if we just figure out how much to adjust the original input
- by to do the rounding.
-
- Here's the whole algorithm expressed in Python.
-
- def round(self, ndigits = None):
- """round(int, int) -> int"""
- if ndigits is None or ndigits >= 0:
- return self
- pow = 10**-ndigits >> 1
- q, r = divmod(self, pow)
- self -= r
- if (q & 1 != 0):
- if (q & 2 == r == 0):
- self -= pow
- else:
- self += pow
- return self
+ PyLongObject *quo = NULL, *rem = NULL;
+ PyObject *one = NULL, *twice_rem, *result, *temp;
+ int cmp, quo_is_odd, quo_is_neg;
+
+ /* Equivalent Python code:
+
+ def divmod_near(a, b):
+ q, r = divmod(a, b)
+ # round up if either r / b > 0.5, or r / b == 0.5 and q is odd.
+ # The expression r / b > 0.5 is equivalent to 2 * r > b if b is
+ # positive, 2 * r < b if b negative.
+ greater_than_half = 2*r > b if b > 0 else 2*r < b
+ exactly_half = 2*r == b
+ if greater_than_half or exactly_half and q % 2 == 1:
+ q += 1
+ r -= b
+ return q, r
*/
+ if (!PyLong_Check(a) || !PyLong_Check(b)) {
+ PyErr_SetString(PyExc_TypeError,
+ "non-integer arguments in division");
+ return NULL;
+ }
+
+ /* Do a and b have different signs? If so, quotient is negative. */
+ quo_is_neg = (Py_SIZE(a) < 0) != (Py_SIZE(b) < 0);
+
+ one = PyLong_FromLong(1L);
+ if (one == NULL)
+ return NULL;
+
+ if (long_divrem((PyLongObject*)a, (PyLongObject*)b, &quo, &rem) < 0)
+ goto error;
+
+ /* compare twice the remainder with the divisor, to see
+ if we need to adjust the quotient and remainder */
+ twice_rem = long_lshift((PyObject *)rem, one);
+ if (twice_rem == NULL)
+ goto error;
+ if (quo_is_neg) {
+ temp = long_neg((PyLongObject*)twice_rem);
+ Py_DECREF(twice_rem);
+ twice_rem = temp;
+ if (twice_rem == NULL)
+ goto error;
+ }
+ cmp = long_compare((PyLongObject *)twice_rem, (PyLongObject *)b);
+ Py_DECREF(twice_rem);
+
+ quo_is_odd = Py_SIZE(quo) != 0 && ((quo->ob_digit[0] & 1) != 0);
+ if ((Py_SIZE(b) < 0 ? cmp < 0 : cmp > 0) || (cmp == 0 && quo_is_odd)) {
+ /* fix up quotient */
+ if (quo_is_neg)
+ temp = long_sub(quo, (PyLongObject *)one);
+ else
+ temp = long_add(quo, (PyLongObject *)one);
+ Py_DECREF(quo);
+ quo = (PyLongObject *)temp;
+ if (quo == NULL)
+ goto error;
+ /* and remainder */
+ if (quo_is_neg)
+ temp = long_add(rem, (PyLongObject *)b);
+ else
+ temp = long_sub(rem, (PyLongObject *)b);
+ Py_DECREF(rem);
+ rem = (PyLongObject *)temp;
+ if (rem == NULL)
+ goto error;
+ }
+
+ result = PyTuple_New(2);
+ if (result == NULL)
+ goto error;
+
+ /* PyTuple_SET_ITEM steals references */
+ PyTuple_SET_ITEM(result, 0, (PyObject *)quo);
+ PyTuple_SET_ITEM(result, 1, (PyObject *)rem);
+ Py_DECREF(one);
+ return result;
+
+ error:
+ Py_XDECREF(quo);
+ Py_XDECREF(rem);
+ Py_XDECREF(one);
+ return NULL;
+}
+
+static PyObject *
+long_round(PyObject *self, PyObject *args)
+{
+ PyObject *o_ndigits=NULL, *temp, *result, *ndigits;
+
+ /* To round an integer m to the nearest 10**n (n positive), we make use of
+ * the divmod_near operation, defined by:
+ *
+ * divmod_near(a, b) = (q, r)
+ *
+ * where q is the nearest integer to the quotient a / b (the
+ * nearest even integer in the case of a tie) and r == a - q * b.
+ * Hence q * b = a - r is the nearest multiple of b to a,
+ * preferring even multiples in the case of a tie.
+ *
+ * So the nearest multiple of 10**n to m is:
+ *
+ * m - divmod_near(m, 10**n)[1].
+ */
if (!PyArg_ParseTuple(args, "|O", &o_ndigits))
return NULL;
if (o_ndigits == NULL)
return long_long(self);
- ndigits = (PyLongObject *)PyNumber_Index(o_ndigits);
+ ndigits = PyNumber_Index(o_ndigits);
if (ndigits == NULL)
return NULL;
+ /* if ndigits >= 0 then no rounding is necessary; return self unchanged */
if (Py_SIZE(ndigits) >= 0) {
Py_DECREF(ndigits);
return long_long(self);
}
- Py_INCREF(self); /* to keep refcounting simple */
- /* we now own references to self, ndigits */
-
- /* pow = 10 ** -ndigits >> 1 */
- pow = (PyLongObject *)PyLong_FromLong(10L);
- if (pow == NULL)
- goto error;
- temp = long_neg(ndigits);
+ /* result = self - divmod_near(self, 10 ** -ndigits)[1] */
+ temp = long_neg((PyLongObject*)ndigits);
Py_DECREF(ndigits);
- ndigits = (PyLongObject *)temp;
+ ndigits = temp;
if (ndigits == NULL)
- goto error;
- temp = long_pow((PyObject *)pow, (PyObject *)ndigits, Py_None);
- Py_DECREF(pow);
- pow = (PyLongObject *)temp;
- if (pow == NULL)
- goto error;
- assert(PyLong_Check(pow)); /* check long_pow returned a long */
- one = (PyLongObject *)PyLong_FromLong(1L);
- if (one == NULL)
- goto error;
- temp = long_rshift(pow, one);
- Py_DECREF(one);
- Py_DECREF(pow);
- pow = (PyLongObject *)temp;
- if (pow == NULL)
- goto error;
+ return NULL;
- /* q, r = divmod(self, pow) */
- errcode = l_divmod((PyLongObject *)self, pow, &q, &r);
- if (errcode == -1)
- goto error;
+ result = PyLong_FromLong(10L);
+ if (result == NULL) {
+ Py_DECREF(ndigits);
+ return NULL;
+ }
- /* self -= r */
- temp = long_sub((PyLongObject *)self, r);
- Py_DECREF(self);
- self = temp;
- if (self == NULL)
- goto error;
+ temp = long_pow(result, ndigits, Py_None);
+ Py_DECREF(ndigits);
+ Py_DECREF(result);
+ result = temp;
+ if (result == NULL)
+ return NULL;
- /* get value of quotient modulo 4 */
- if (Py_SIZE(q) == 0)
- q_mod_4 = 0;
- else if (Py_SIZE(q) > 0)
- q_mod_4 = q->ob_digit[0] & 3;
- else
- q_mod_4 = (PyLong_BASE-q->ob_digit[0]) & 3;
+ temp = _PyLong_DivmodNear(self, result);
+ Py_DECREF(result);
+ result = temp;
+ if (result == NULL)
+ return NULL;
- if ((q_mod_4 & 1) == 1) {
- /* q is odd; round self up or down by adding or subtracting pow */
- if (q_mod_4 == 1 && Py_SIZE(r) == 0)
- temp = (PyObject *)long_sub((PyLongObject *)self, pow);
- else
- temp = (PyObject *)long_add((PyLongObject *)self, pow);
- Py_DECREF(self);
- self = temp;
- if (self == NULL)
- goto error;
- }
- Py_DECREF(q);
- Py_DECREF(r);
- Py_DECREF(pow);
- Py_DECREF(ndigits);
- return self;
+ temp = long_sub((PyLongObject *)self,
+ (PyLongObject *)PyTuple_GET_ITEM(result, 1));
+ Py_DECREF(result);
+ result = temp;
- error:
- Py_XDECREF(q);
- Py_XDECREF(r);
- Py_XDECREF(pow);
- Py_XDECREF(self);
- Py_XDECREF(ndigits);
- return NULL;
+ return result;
}
static PyObject *
@@ -4065,7 +4452,7 @@ long_bit_length(PyLongObject *v)
return (PyObject *)result;
-error:
+ error:
Py_DECREF(result);
return NULL;
}
@@ -4087,6 +4474,187 @@ long_is_finite(PyObject *v)
}
#endif
+
+static PyObject *
+long_to_bytes(PyLongObject *v, PyObject *args, PyObject *kwds)
+{
+ PyObject *byteorder_str;
+ PyObject *is_signed_obj = NULL;
+ Py_ssize_t length;
+ int little_endian;
+ int is_signed;
+ PyObject *bytes;
+ static char *kwlist[] = {"length", "byteorder", "signed", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "nU|O:to_bytes", kwlist,
+ &length, &byteorder_str,
+ &is_signed_obj))
+ return NULL;
+
+ if (args != NULL && Py_SIZE(args) > 2) {
+ PyErr_SetString(PyExc_TypeError,
+ "'signed' is a keyword-only argument");
+ return NULL;
+ }
+
+ if (!PyUnicode_CompareWithASCIIString(byteorder_str, "little"))
+ little_endian = 1;
+ else if (!PyUnicode_CompareWithASCIIString(byteorder_str, "big"))
+ little_endian = 0;
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "byteorder must be either 'little' or 'big'");
+ return NULL;
+ }
+
+ if (is_signed_obj != NULL) {
+ int cmp = PyObject_IsTrue(is_signed_obj);
+ if (cmp < 0)
+ return NULL;
+ is_signed = cmp ? 1 : 0;
+ }
+ else {
+ /* If the signed argument was omitted, use False as the
+ default. */
+ is_signed = 0;
+ }
+
+ if (length < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "length argument must be non-negative");
+ return NULL;
+ }
+
+ bytes = PyBytes_FromStringAndSize(NULL, length);
+ if (bytes == NULL)
+ return NULL;
+
+ if (_PyLong_AsByteArray(v, (unsigned char *)PyBytes_AS_STRING(bytes),
+ length, little_endian, is_signed) < 0) {
+ Py_DECREF(bytes);
+ return NULL;
+ }
+
+ return bytes;
+}
+
+PyDoc_STRVAR(long_to_bytes_doc,
+"int.to_bytes(length, byteorder, *, signed=False) -> bytes\n\
+\n\
+Return an array of bytes representing an integer.\n\
+\n\
+The integer is represented using length bytes. An OverflowError is\n\
+raised if the integer is not representable with the given number of\n\
+bytes.\n\
+\n\
+The byteorder argument determines the byte order used to represent the\n\
+integer. If byteorder is 'big', the most significant byte is at the\n\
+beginning of the byte array. If byteorder is 'little', the most\n\
+significant byte is at the end of the byte array. To request the native\n\
+byte order of the host system, use `sys.byteorder' as the byte order value.\n\
+\n\
+The signed keyword-only argument determines whether two's complement is\n\
+used to represent the integer. If signed is False and a negative integer\n\
+is given, an OverflowError is raised.");
+
+static PyObject *
+long_from_bytes(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyObject *byteorder_str;
+ PyObject *is_signed_obj = NULL;
+ int little_endian;
+ int is_signed;
+ PyObject *obj;
+ PyObject *bytes;
+ PyObject *long_obj;
+ static char *kwlist[] = {"bytes", "byteorder", "signed", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OU|O:from_bytes", kwlist,
+ &obj, &byteorder_str,
+ &is_signed_obj))
+ return NULL;
+
+ if (args != NULL && Py_SIZE(args) > 2) {
+ PyErr_SetString(PyExc_TypeError,
+ "'signed' is a keyword-only argument");
+ return NULL;
+ }
+
+ if (!PyUnicode_CompareWithASCIIString(byteorder_str, "little"))
+ little_endian = 1;
+ else if (!PyUnicode_CompareWithASCIIString(byteorder_str, "big"))
+ little_endian = 0;
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "byteorder must be either 'little' or 'big'");
+ return NULL;
+ }
+
+ if (is_signed_obj != NULL) {
+ int cmp = PyObject_IsTrue(is_signed_obj);
+ if (cmp < 0)
+ return NULL;
+ is_signed = cmp ? 1 : 0;
+ }
+ else {
+ /* If the signed argument was omitted, use False as the
+ default. */
+ is_signed = 0;
+ }
+
+ bytes = PyObject_Bytes(obj);
+ if (bytes == NULL)
+ return NULL;
+
+ long_obj = _PyLong_FromByteArray(
+ (unsigned char *)PyBytes_AS_STRING(bytes), Py_SIZE(bytes),
+ little_endian, is_signed);
+ Py_DECREF(bytes);
+
+ /* If from_bytes() was used on subclass, allocate new subclass
+ * instance, initialize it with decoded long value and return it.
+ */
+ if (type != &PyLong_Type && PyType_IsSubtype(type, &PyLong_Type)) {
+ PyLongObject *newobj;
+ int i;
+ Py_ssize_t n = ABS(Py_SIZE(long_obj));
+
+ newobj = (PyLongObject *)type->tp_alloc(type, n);
+ if (newobj == NULL) {
+ Py_DECREF(long_obj);
+ return NULL;
+ }
+ assert(PyLong_Check(newobj));
+ Py_SIZE(newobj) = Py_SIZE(long_obj);
+ for (i = 0; i < n; i++) {
+ newobj->ob_digit[i] =
+ ((PyLongObject *)long_obj)->ob_digit[i];
+ }
+ Py_DECREF(long_obj);
+ return (PyObject *)newobj;
+ }
+
+ return long_obj;
+}
+
+PyDoc_STRVAR(long_from_bytes_doc,
+"int.from_bytes(bytes, byteorder, *, signed=False) -> int\n\
+\n\
+Return the integer represented by the given array of bytes.\n\
+\n\
+The bytes argument must either support the buffer protocol or be an\n\
+iterable object producing bytes. Bytes and bytearray are examples of\n\
+built-in objects that support the buffer protocol.\n\
+\n\
+The byteorder argument determines the byte order used to represent the\n\
+integer. If byteorder is 'big', the most significant byte is at the\n\
+beginning of the byte array. If byteorder is 'little', the most\n\
+significant byte is at the end of the byte array. To request the native\n\
+byte order of the host system, use `sys.byteorder' as the byte order value.\n\
+\n\
+The signed keyword-only argument indicates whether two's complement is\n\
+used to represent the integer.");
+
static PyMethodDef long_methods[] = {
{"conjugate", (PyCFunction)long_long, METH_NOARGS,
"Returns self, the complex conjugate of any int."},
@@ -4096,6 +4664,10 @@ static PyMethodDef long_methods[] = {
{"is_finite", (PyCFunction)long_is_finite, METH_NOARGS,
"Returns always True."},
#endif
+ {"to_bytes", (PyCFunction)long_to_bytes,
+ METH_VARARGS|METH_KEYWORDS, long_to_bytes_doc},
+ {"from_bytes", (PyCFunction)long_from_bytes,
+ METH_VARARGS|METH_KEYWORDS|METH_CLASS, long_from_bytes_doc},
{"__trunc__", (PyCFunction)long_long, METH_NOARGS,
"Truncating an Integral returns itself."},
{"__floor__", (PyCFunction)long_long, METH_NOARGS,
@@ -4142,40 +4714,40 @@ string, use the optional base. It is an error to supply a base when\n\
converting a non-string.");
static PyNumberMethods long_as_number = {
- (binaryfunc) long_add, /*nb_add*/
- (binaryfunc) long_sub, /*nb_subtract*/
- (binaryfunc) long_mul, /*nb_multiply*/
- long_mod, /*nb_remainder*/
- long_divmod, /*nb_divmod*/
- long_pow, /*nb_power*/
- (unaryfunc) long_neg, /*nb_negative*/
- (unaryfunc) long_long, /*tp_positive*/
- (unaryfunc) long_abs, /*tp_absolute*/
- (inquiry) long_bool, /*tp_bool*/
- (unaryfunc) long_invert, /*nb_invert*/
- long_lshift, /*nb_lshift*/
- (binaryfunc) long_rshift, /*nb_rshift*/
- long_and, /*nb_and*/
- long_xor, /*nb_xor*/
- long_or, /*nb_or*/
- long_long, /*nb_int*/
- 0, /*nb_reserved*/
- long_float, /*nb_float*/
- 0, /* nb_inplace_add */
- 0, /* nb_inplace_subtract */
- 0, /* nb_inplace_multiply */
- 0, /* nb_inplace_remainder */
- 0, /* nb_inplace_power */
- 0, /* nb_inplace_lshift */
- 0, /* nb_inplace_rshift */
- 0, /* nb_inplace_and */
- 0, /* nb_inplace_xor */
- 0, /* nb_inplace_or */
- long_div, /* nb_floor_divide */
- long_true_divide, /* nb_true_divide */
- 0, /* nb_inplace_floor_divide */
- 0, /* nb_inplace_true_divide */
- long_long, /* nb_index */
+ (binaryfunc)long_add, /*nb_add*/
+ (binaryfunc)long_sub, /*nb_subtract*/
+ (binaryfunc)long_mul, /*nb_multiply*/
+ long_mod, /*nb_remainder*/
+ long_divmod, /*nb_divmod*/
+ long_pow, /*nb_power*/
+ (unaryfunc)long_neg, /*nb_negative*/
+ (unaryfunc)long_long, /*tp_positive*/
+ (unaryfunc)long_abs, /*tp_absolute*/
+ (inquiry)long_bool, /*tp_bool*/
+ (unaryfunc)long_invert, /*nb_invert*/
+ long_lshift, /*nb_lshift*/
+ (binaryfunc)long_rshift, /*nb_rshift*/
+ long_and, /*nb_and*/
+ long_xor, /*nb_xor*/
+ long_or, /*nb_or*/
+ long_long, /*nb_int*/
+ 0, /*nb_reserved*/
+ long_float, /*nb_float*/
+ 0, /* nb_inplace_add */
+ 0, /* nb_inplace_subtract */
+ 0, /* nb_inplace_multiply */
+ 0, /* nb_inplace_remainder */
+ 0, /* nb_inplace_power */
+ 0, /* nb_inplace_lshift */
+ 0, /* nb_inplace_rshift */
+ 0, /* nb_inplace_and */
+ 0, /* nb_inplace_xor */
+ 0, /* nb_inplace_or */
+ long_div, /* nb_floor_divide */
+ long_true_divide, /* nb_true_divide */
+ 0, /* nb_inplace_floor_divide */
+ 0, /* nb_inplace_true_divide */
+ long_long, /* nb_index */
};
PyTypeObject PyLong_Type = {
@@ -4188,13 +4760,13 @@ PyTypeObject PyLong_Type = {
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
- long_repr, /* tp_repr */
+ long_to_decimal_string, /* tp_repr */
&long_as_number, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
(hashfunc)long_hash, /* tp_hash */
0, /* tp_call */
- long_repr, /* tp_str */
+ long_to_decimal_string, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
@@ -4231,8 +4803,7 @@ internal representation of integers. The attributes are read only.");
static PyStructSequence_Field int_info_fields[] = {
{"bits_per_digit", "size of a digit in bits"},
- {"sizeof_digit", "size in bytes of the C type used to "
- "represent a digit"},
+ {"sizeof_digit", "size in bytes of the C type used to represent a digit"},
{NULL, NULL}
};
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index 9b77ea726c..2e32b2a0e9 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -3,6 +3,23 @@
#include "Python.h"
+#define IS_RELEASED(memobj) \
+ (((PyMemoryViewObject *) memobj)->view.buf == NULL)
+
+#define CHECK_RELEASED(memobj) \
+ if (IS_RELEASED(memobj)) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "operation forbidden on released memoryview object"); \
+ return NULL; \
+ }
+
+#define CHECK_RELEASED_INT(memobj) \
+ if (IS_RELEASED(memobj)) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "operation forbidden on released memoryview object"); \
+ return -1; \
+ }
+
static Py_ssize_t
get_shape0(Py_buffer *buf)
{
@@ -34,6 +51,7 @@ static int
memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags)
{
int res = 0;
+ CHECK_RELEASED_INT(self);
if (self->view.obj != NULL)
res = PyObject_GetBuffer(self->view.obj, view, flags);
if (view)
@@ -57,11 +75,15 @@ PyMemoryView_FromBuffer(Py_buffer *info)
{
PyMemoryViewObject *mview;
+ if (info->buf == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "cannot make memory view from a buffer with a NULL data pointer");
+ return NULL;
+ }
mview = (PyMemoryViewObject *)
PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type);
if (mview == NULL)
return NULL;
- mview->base = NULL;
dup_buffer(&mview->view, info);
/* NOTE: mview->view.obj should already have been incref'ed as
part of PyBuffer_FillInfo(). */
@@ -91,8 +113,6 @@ PyMemoryView_FromObject(PyObject *base)
return NULL;
}
- mview->base = base;
- Py_INCREF(base);
return (PyObject *)mview;
}
@@ -270,8 +290,6 @@ PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
if (PyBuffer_IsContiguous(view, fort)) {
/* no copy needed */
- Py_INCREF(obj);
- mem->base = obj;
_PyObject_GC_TRACK(mem);
return (PyObject *)mem;
}
@@ -303,21 +321,7 @@ PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
Py_DECREF(mem);
return NULL;
}
- }
- if (buffertype == PyBUF_SHADOW) {
- /* return a shadowed memory-view object */
- view->buf = dest;
- mem->base = PyTuple_Pack(2, obj, bytes);
- Py_DECREF(bytes);
- if (mem->base == NULL) {
- Py_DECREF(mem);
- return NULL;
- }
- }
- else {
PyBuffer_Release(view); /* XXX ? */
- /* steal the reference */
- mem->base = bytes;
}
_PyObject_GC_TRACK(mem);
return (PyObject *)mem;
@@ -327,12 +331,14 @@ PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
static PyObject *
memory_format_get(PyMemoryViewObject *self)
{
+ CHECK_RELEASED(self);
return PyUnicode_FromString(self->view.format);
}
static PyObject *
memory_itemsize_get(PyMemoryViewObject *self)
{
+ CHECK_RELEASED(self);
return PyLong_FromSsize_t(self->view.itemsize);
}
@@ -348,8 +354,9 @@ _IntTupleFromSsizet(int len, Py_ssize_t *vals)
return Py_None;
}
intTuple = PyTuple_New(len);
- if (!intTuple) return NULL;
- for(i=0; i<len; i++) {
+ if (!intTuple)
+ return NULL;
+ for (i=0; i<len; i++) {
o = PyLong_FromSsize_t(vals[i]);
if (!o) {
Py_DECREF(intTuple);
@@ -363,30 +370,35 @@ _IntTupleFromSsizet(int len, Py_ssize_t *vals)
static PyObject *
memory_shape_get(PyMemoryViewObject *self)
{
+ CHECK_RELEASED(self);
return _IntTupleFromSsizet(self->view.ndim, self->view.shape);
}
static PyObject *
memory_strides_get(PyMemoryViewObject *self)
{
+ CHECK_RELEASED(self);
return _IntTupleFromSsizet(self->view.ndim, self->view.strides);
}
static PyObject *
memory_suboffsets_get(PyMemoryViewObject *self)
{
+ CHECK_RELEASED(self);
return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets);
}
static PyObject *
memory_readonly_get(PyMemoryViewObject *self)
{
+ CHECK_RELEASED(self);
return PyBool_FromLong(self->view.readonly);
}
static PyObject *
memory_ndim_get(PyMemoryViewObject *self)
{
+ CHECK_RELEASED(self);
return PyLong_FromLong(self->view.ndim);
}
@@ -405,6 +417,7 @@ static PyGetSetDef memory_getsetlist[] ={
static PyObject *
memory_tobytes(PyMemoryViewObject *mem, PyObject *noargs)
{
+ CHECK_RELEASED(mem);
return PyObject_CallFunctionObjArgs(
(PyObject *) &PyBytes_Type, mem, NULL);
}
@@ -420,6 +433,7 @@ memory_tolist(PyMemoryViewObject *mem, PyObject *noargs)
PyObject *res, *item;
char *buf;
+ CHECK_RELEASED(mem);
if (strcmp(view->format, "B") || view->itemsize != 1) {
PyErr_SetString(PyExc_NotImplementedError,
"tolist() only supports byte views");
@@ -446,9 +460,37 @@ memory_tolist(PyMemoryViewObject *mem, PyObject *noargs)
return res;
}
+static void
+do_release(PyMemoryViewObject *self)
+{
+ if (self->view.obj != NULL) {
+ PyBuffer_Release(&(self->view));
+ }
+ self->view.obj = NULL;
+ self->view.buf = NULL;
+}
+
+static PyObject *
+memory_enter(PyObject *self, PyObject *args)
+{
+ CHECK_RELEASED(self);
+ Py_INCREF(self);
+ return self;
+}
+
+static PyObject *
+memory_exit(PyObject *self, PyObject *args)
+{
+ do_release((PyMemoryViewObject *) self);
+ Py_RETURN_NONE;
+}
+
static PyMethodDef memory_methods[] = {
+ {"release", memory_exit, METH_NOARGS},
{"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL},
{"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL},
+ {"__enter__", memory_enter, METH_NOARGS},
+ {"__exit__", memory_exit, METH_VARARGS},
{NULL, NULL} /* sentinel */
};
@@ -457,43 +499,24 @@ static void
memory_dealloc(PyMemoryViewObject *self)
{
_PyObject_GC_UNTRACK(self);
- if (self->view.obj != NULL) {
- if (self->base && PyTuple_Check(self->base)) {
- /* Special case when first element is generic object
- with buffer interface and the second element is a
- contiguous "shadow" that must be copied back into
- the data areay of the first tuple element before
- releasing the buffer on the first element.
- */
-
- PyObject_CopyData(PyTuple_GET_ITEM(self->base,0),
- PyTuple_GET_ITEM(self->base,1));
-
- /* The view member should have readonly == -1 in
- this instance indicating that the memory can
- be "locked" and was locked and will be unlocked
- again after this call.
- */
- PyBuffer_Release(&(self->view));
- }
- else {
- PyBuffer_Release(&(self->view));
- }
- Py_CLEAR(self->base);
- }
+ do_release(self);
PyObject_GC_Del(self);
}
static PyObject *
memory_repr(PyMemoryViewObject *self)
{
- return PyUnicode_FromFormat("<memory at %p>", self);
+ if (IS_RELEASED(self))
+ return PyUnicode_FromFormat("<released memory at %p>", self);
+ else
+ return PyUnicode_FromFormat("<memory at %p>", self);
}
/* Sequence methods */
static Py_ssize_t
memory_length(PyMemoryViewObject *self)
{
+ CHECK_RELEASED_INT(self);
return get_shape0(&self->view);
}
@@ -505,6 +528,7 @@ memory_item(PyMemoryViewObject *self, Py_ssize_t result)
{
Py_buffer *view = &(self->view);
+ CHECK_RELEASED(self);
if (view->ndim == 0) {
PyErr_SetString(PyExc_IndexError,
"invalid indexing of 0-dim memory");
@@ -554,6 +578,7 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
Py_buffer *view;
view = &(self->view);
+ CHECK_RELEASED(self);
if (view->ndim == 0) {
if (key == Py_Ellipsis ||
(PyTuple_Check(key) && PyTuple_GET_SIZE(key)==0)) {
@@ -576,7 +601,7 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
else if (PySlice_Check(key)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view),
+ if (PySlice_GetIndicesEx(key, get_shape0(view),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
@@ -623,6 +648,7 @@ memory_ass_sub(PyMemoryViewObject *self, PyObject *key, PyObject *value)
Py_buffer *view = &(self->view);
char *srcbuf, *destbuf;
+ CHECK_RELEASED_INT(self);
if (view->readonly) {
PyErr_SetString(PyExc_TypeError,
"cannot modify read-only memory");
@@ -654,7 +680,7 @@ memory_ass_sub(PyMemoryViewObject *self, PyObject *key, PyObject *value)
else if (PySlice_Check(key)) {
Py_ssize_t stop, step;
- if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view),
+ if (PySlice_GetIndicesEx(key, get_shape0(view),
&start, &stop, &step, &len) < 0) {
return -1;
}
@@ -715,6 +741,11 @@ memory_richcompare(PyObject *v, PyObject *w, int op)
ww.obj = NULL;
if (op != Py_EQ && op != Py_NE)
goto _notimpl;
+ if ((PyMemoryView_Check(v) && IS_RELEASED(v)) ||
+ (PyMemoryView_Check(w) && IS_RELEASED(w))) {
+ equal = (v == w);
+ goto _end;
+ }
if (PyObject_GetBuffer(v, &vv, PyBUF_CONTIG_RO) == -1) {
PyErr_Clear();
goto _notimpl;
@@ -750,8 +781,6 @@ _notimpl:
static int
memory_traverse(PyMemoryViewObject *self, visitproc visit, void *arg)
{
- if (self->base != NULL)
- Py_VISIT(self->base);
if (self->view.obj != NULL)
Py_VISIT(self->view.obj);
return 0;
@@ -760,7 +789,6 @@ memory_traverse(PyMemoryViewObject *self, visitproc visit, void *arg)
static int
memory_clear(PyMemoryViewObject *self)
{
- Py_CLEAR(self->base);
PyBuffer_Release(&self->view);
return 0;
}
@@ -774,10 +802,10 @@ static PyMappingMethods memory_as_mapping = {
};
static PySequenceMethods memory_as_sequence = {
- 0, /* sq_length */
- 0, /* sq_concat */
- 0, /* sq_repeat */
- (ssizeargfunc)memory_item, /* sq_item */
+ 0, /* sq_length */
+ 0, /* sq_concat */
+ 0, /* sq_repeat */
+ (ssizeargfunc)memory_item, /* sq_item */
};
/* Buffer methods */
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 356d161842..f1a9f4b702 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -224,10 +224,10 @@ meth_richcompare(PyObject *self, PyObject *other, int op)
return res;
}
-static long
+static Py_hash_t
meth_hash(PyCFunctionObject *a)
{
- long x,y;
+ Py_hash_t x, y;
if (a->m_self == NULL)
x = 0;
else {
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index d96d7bd16a..f31b5da26d 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -56,10 +56,6 @@ PyModule_New(const char *name)
return NULL;
}
-static char api_version_warning[] =
-"Python C API version mismatch for module %.100s:\
- This Python has API version %d, module %.100s has version %d.";
-
PyObject *
PyModule_Create2(struct PyModuleDef* module, int module_api_version)
{
@@ -79,13 +75,14 @@ PyModule_Create2(struct PyModuleDef* module, int module_api_version)
module->m_base.m_index = max_module_number;
}
name = module->m_name;
- if (module_api_version != PYTHON_API_VERSION) {
- char message[512];
- PyOS_snprintf(message, sizeof(message),
- api_version_warning, name,
- PYTHON_API_VERSION, name,
- module_api_version);
- if (PyErr_WarnEx(PyExc_RuntimeWarning, message, 1))
+ if (module_api_version != PYTHON_API_VERSION && module_api_version != PYTHON_ABI_VERSION) {
+ int err;
+ err = PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
+ "Python C API version mismatch for module %.100s: "
+ "This Python has API version %d, module %.100s has version %d.",
+ name,
+ PYTHON_API_VERSION, name, module_api_version);
+ if (err)
return NULL;
}
/* Make sure name is fully qualified.
@@ -192,8 +189,8 @@ PyModule_GetName(PyObject *m)
return _PyUnicode_AsString(nameobj);
}
-const char *
-PyModule_GetFilename(PyObject *m)
+PyObject*
+PyModule_GetFilenameObject(PyObject *m)
{
PyObject *d;
PyObject *fileobj;
@@ -209,7 +206,21 @@ PyModule_GetFilename(PyObject *m)
PyErr_SetString(PyExc_SystemError, "module filename missing");
return NULL;
}
- return _PyUnicode_AsString(fileobj);
+ Py_INCREF(fileobj);
+ return fileobj;
+}
+
+const char *
+PyModule_GetFilename(PyObject *m)
+{
+ PyObject *fileobj;
+ char *utf8;
+ fileobj = PyModule_GetFilenameObject(m);
+ if (fileobj == NULL)
+ return NULL;
+ utf8 = _PyUnicode_AsString(fileobj);
+ Py_DECREF(fileobj);
+ return utf8;
}
PyModuleDef*
@@ -254,10 +265,15 @@ _PyModule_Clear(PyObject *m)
pos = 0;
while (PyDict_Next(d, &pos, &key, &value)) {
if (value != Py_None && PyUnicode_Check(key)) {
- const char *s = _PyUnicode_AsString(key);
- if (s[0] == '_' && s[1] != '_') {
- if (Py_VerboseFlag > 1)
- PySys_WriteStderr("# clear[1] %s\n", s);
+ Py_UNICODE *u = PyUnicode_AS_UNICODE(key);
+ if (u[0] == '_' && u[1] != '_') {
+ if (Py_VerboseFlag > 1) {
+ const char *s = _PyUnicode_AsString(key);
+ if (s != NULL)
+ PySys_WriteStderr("# clear[1] %s\n", s);
+ else
+ PyErr_Clear();
+ }
PyDict_SetItem(d, key, Py_None);
}
}
@@ -267,10 +283,17 @@ _PyModule_Clear(PyObject *m)
pos = 0;
while (PyDict_Next(d, &pos, &key, &value)) {
if (value != Py_None && PyUnicode_Check(key)) {
- const char *s = _PyUnicode_AsString(key);
- if (s[0] != '_' || strcmp(s, "__builtins__") != 0) {
- if (Py_VerboseFlag > 1)
- PySys_WriteStderr("# clear[2] %s\n", s);
+ Py_UNICODE *u = PyUnicode_AS_UNICODE(key);
+ if (u[0] != '_'
+ || PyUnicode_CompareWithASCIIString(key, "__builtins__") != 0)
+ {
+ if (Py_VerboseFlag > 1) {
+ const char *s = _PyUnicode_AsString(key);
+ if (s != NULL)
+ PySys_WriteStderr("# clear[2] %s\n", s);
+ else
+ PyErr_Clear();
+ }
PyDict_SetItem(d, key, Py_None);
}
}
@@ -325,19 +348,21 @@ static PyObject *
module_repr(PyModuleObject *m)
{
const char *name;
- const char *filename;
+ PyObject *filename, *repr;
name = PyModule_GetName((PyObject *)m);
if (name == NULL) {
PyErr_Clear();
name = "?";
}
- filename = PyModule_GetFilename((PyObject *)m);
+ filename = PyModule_GetFilenameObject((PyObject *)m);
if (filename == NULL) {
PyErr_Clear();
return PyUnicode_FromFormat("<module '%s' (built-in)>", name);
}
- return PyUnicode_FromFormat("<module '%s' from '%s'>", name, filename);
+ repr = PyUnicode_FromFormat("<module '%s' from '%U'>", name, filename);
+ Py_DECREF(filename);
+ return repr;
}
static int
diff --git a/Objects/object.c b/Objects/object.c
index d5342738f4..17e5069ef5 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2,7 +2,6 @@
/* Generic object operations; and implementation of None (NoObject) */
#include "Python.h"
-#include "sliceobject.h" /* For PyEllipsis_Type */
#include "frameobject.h"
#ifdef __cplusplus
@@ -536,10 +535,12 @@ do_richcompare(PyObject *v, PyObject *w, int op)
{
richcmpfunc f;
PyObject *res;
+ int checked_reverse_op = 0;
if (v->ob_type != w->ob_type &&
PyType_IsSubtype(w->ob_type, v->ob_type) &&
(f = w->ob_type->tp_richcompare) != NULL) {
+ checked_reverse_op = 1;
res = (*f)(w, v, _Py_SwappedOp[op]);
if (res != Py_NotImplemented)
return res;
@@ -551,7 +552,7 @@ do_richcompare(PyObject *v, PyObject *w, int op)
return res;
Py_DECREF(res);
}
- if ((f = w->ob_type->tp_richcompare) != NULL) {
+ if (!checked_reverse_op && (f = w->ob_type->tp_richcompare) != NULL) {
res = (*f)(w, v, _Py_SwappedOp[op]);
if (res != Py_NotImplemented)
return res;
@@ -634,77 +635,118 @@ PyObject_RichCompareBool(PyObject *v, PyObject *w, int op)
All the utility functions (_Py_Hash*()) return "-1" to signify an error.
*/
-long
+/* For numeric types, the hash of a number x is based on the reduction
+ of x modulo the prime P = 2**_PyHASH_BITS - 1. It's designed so that
+ hash(x) == hash(y) whenever x and y are numerically equal, even if
+ x and y have different types.
+
+ A quick summary of the hashing strategy:
+
+ (1) First define the 'reduction of x modulo P' for any rational
+ number x; this is a standard extension of the usual notion of
+ reduction modulo P for integers. If x == p/q (written in lowest
+ terms), the reduction is interpreted as the reduction of p times
+ the inverse of the reduction of q, all modulo P; if q is exactly
+ divisible by P then define the reduction to be infinity. So we've
+ got a well-defined map
+
+ reduce : { rational numbers } -> { 0, 1, 2, ..., P-1, infinity }.
+
+ (2) Now for a rational number x, define hash(x) by:
+
+ reduce(x) if x >= 0
+ -reduce(-x) if x < 0
+
+ If the result of the reduction is infinity (this is impossible for
+ integers, floats and Decimals) then use the predefined hash value
+ _PyHASH_INF for x >= 0, or -_PyHASH_INF for x < 0, instead.
+ _PyHASH_INF, -_PyHASH_INF and _PyHASH_NAN are also used for the
+ hashes of float and Decimal infinities and nans.
+
+ A selling point for the above strategy is that it makes it possible
+ to compute hashes of decimal and binary floating-point numbers
+ efficiently, even if the exponent of the binary or decimal number
+ is large. The key point is that
+
+ reduce(x * y) == reduce(x) * reduce(y) (modulo _PyHASH_MODULUS)
+
+ provided that {reduce(x), reduce(y)} != {0, infinity}. The reduction of a
+ binary or decimal float is never infinity, since the denominator is a power
+ of 2 (for binary) or a divisor of a power of 10 (for decimal). So we have,
+ for nonnegative x,
+
+ reduce(x * 2**e) == reduce(x) * reduce(2**e) % _PyHASH_MODULUS
+
+ reduce(x * 10**e) == reduce(x) * reduce(10**e) % _PyHASH_MODULUS
+
+ and reduce(10**e) can be computed efficiently by the usual modular
+ exponentiation algorithm. For reduce(2**e) it's even better: since
+ P is of the form 2**n-1, reduce(2**e) is 2**(e mod n), and multiplication
+ by 2**(e mod n) modulo 2**n-1 just amounts to a rotation of bits.
+
+ */
+
+Py_hash_t
_Py_HashDouble(double v)
{
- double intpart, fractpart;
- int expo;
- long hipart;
- long x; /* the final hash value */
- /* This is designed so that Python numbers of different types
- * that compare equal hash to the same value; otherwise comparisons
- * of mapping keys will turn out weird.
- */
+ int e, sign;
+ double m;
+ Py_uhash_t x, y;
- fractpart = modf(v, &intpart);
- if (fractpart == 0.0) {
- /* This must return the same hash as an equal int or long. */
- if (intpart > LONG_MAX/2 || -intpart > LONG_MAX/2) {
- /* Convert to long and use its hash. */
- PyObject *plong; /* converted to Python long */
- if (Py_IS_INFINITY(intpart))
- /* can't convert to long int -- arbitrary */
- v = v < 0 ? -271828.0 : 314159.0;
- plong = PyLong_FromDouble(v);
- if (plong == NULL)
- return -1;
- x = PyObject_Hash(plong);
- Py_DECREF(plong);
- return x;
- }
- /* Fits in a C long == a Python int, so is its own hash. */
- x = (long)intpart;
- if (x == -1)
- x = -2;
- return x;
- }
- /* The fractional part is non-zero, so we don't have to worry about
- * making this match the hash of some other type.
- * Use frexp to get at the bits in the double.
- * Since the VAX D double format has 56 mantissa bits, which is the
- * most of any double format in use, each of these parts may have as
- * many as (but no more than) 56 significant bits.
- * So, assuming sizeof(long) >= 4, each part can be broken into two
- * longs; frexp and multiplication are used to do that.
- * Also, since the Cray double format has 15 exponent bits, which is
- * the most of any double format in use, shifting the exponent field
- * left by 15 won't overflow a long (again assuming sizeof(long) >= 4).
- */
- v = frexp(v, &expo);
- v *= 2147483648.0; /* 2**31 */
- hipart = (long)v; /* take the top 32 bits */
- v = (v - (double)hipart) * 2147483648.0; /* get the next 32 bits */
- x = hipart + (long)v + (expo << 15);
- if (x == -1)
- x = -2;
- return x;
+ if (!Py_IS_FINITE(v)) {
+ if (Py_IS_INFINITY(v))
+ return v > 0 ? _PyHASH_INF : -_PyHASH_INF;
+ else
+ return _PyHASH_NAN;
+ }
+
+ m = frexp(v, &e);
+
+ sign = 1;
+ if (m < 0) {
+ sign = -1;
+ m = -m;
+ }
+
+ /* process 28 bits at a time; this should work well both for binary
+ and hexadecimal floating point. */
+ x = 0;
+ while (m) {
+ x = ((x << 28) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - 28);
+ m *= 268435456.0; /* 2**28 */
+ e -= 28;
+ y = (Py_uhash_t)m; /* pull out integer part */
+ m -= y;
+ x += y;
+ if (x >= _PyHASH_MODULUS)
+ x -= _PyHASH_MODULUS;
+ }
+
+ /* adjust for the exponent; first reduce it modulo _PyHASH_BITS */
+ e = e >= 0 ? e % _PyHASH_BITS : _PyHASH_BITS-1-((-1-e) % _PyHASH_BITS);
+ x = ((x << e) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - e);
+
+ x = x * sign;
+ if (x == (Py_uhash_t)-1)
+ x = (Py_uhash_t)-2;
+ return (Py_hash_t)x;
}
-long
+Py_hash_t
_Py_HashPointer(void *p)
{
- long x;
+ Py_hash_t x;
size_t y = (size_t)p;
/* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
excessive hash collisions for dicts and sets */
y = (y >> 4) | (y << (8 * SIZEOF_VOID_P - 4));
- x = (long)y;
+ x = (Py_hash_t)y;
if (x == -1)
x = -2;
return x;
}
-long
+Py_hash_t
PyObject_HashNotImplemented(PyObject *v)
{
PyErr_Format(PyExc_TypeError, "unhashable type: '%.200s'",
@@ -712,7 +754,7 @@ PyObject_HashNotImplemented(PyObject *v)
return -1;
}
-long
+Py_hash_t
PyObject_Hash(PyObject *v)
{
PyTypeObject *tp = Py_TYPE(v);
@@ -934,31 +976,7 @@ _PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name, PyObject *dict)
goto done;
}
-#if 0 /* XXX this is not quite _PyType_Lookup anymore */
- /* Inline _PyType_Lookup */
- {
- Py_ssize_t i, n;
- PyObject *mro, *base, *dict;
-
- /* Look in tp_dict of types in MRO */
- mro = tp->tp_mro;
- assert(mro != NULL);
- assert(PyTuple_Check(mro));
- n = PyTuple_GET_SIZE(mro);
- for (i = 0; i < n; i++) {
- base = PyTuple_GET_ITEM(mro, i);
- assert(PyType_Check(base));
- dict = ((PyTypeObject *)base)->tp_dict;
- assert(dict && PyDict_Check(dict));
- descr = PyDict_GetItem(dict, name);
- if (descr != NULL)
- break;
- }
- }
-#else
descr = _PyType_Lookup(tp, name);
-#endif
-
Py_XINCREF(descr);
f = NULL;
@@ -1552,10 +1570,9 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&PyStaticMethod_Type) < 0)
Py_FatalError("Can't initialize static method type");
-#ifndef WITHOUT_COMPLEX
if (PyType_Ready(&PyComplex_Type) < 0)
Py_FatalError("Can't initialize complex type");
-#endif
+
if (PyType_Ready(&PyFloat_Type) < 0)
Py_FatalError("Can't initialize float type");
@@ -1738,10 +1755,6 @@ _Py_GetObjects(PyObject *self, PyObject *args)
#endif
-/* Hack to force loading of cobject.o */
-PyTypeObject *_Py_cobject_hack = &PyCObject_Type;
-
-
/* Hack to force loading of pycapsule.o */
PyTypeObject *_PyCapsule_hack = &PyCapsule_Type;
@@ -1886,6 +1899,19 @@ _PyTrash_destroy_chain(void)
}
}
+#ifndef Py_TRACE_REFS
+/* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc.
+ Define this here, so we can undefine the macro. */
+#undef _Py_Dealloc
+PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
+void
+_Py_Dealloc(PyObject *op)
+{
+ _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA
+ (*Py_TYPE(op)->tp_dealloc)(op);
+}
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index af12f41ed3..3916262120 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -2,6 +2,21 @@
#ifdef WITH_PYMALLOC
+#ifdef WITH_VALGRIND
+#include <valgrind/valgrind.h>
+
+/* If we're using GCC, use __builtin_expect() to reduce overhead of
+ the valgrind checks */
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
+# define UNLIKELY(value) __builtin_expect((value), 0)
+#else
+# define UNLIKELY(value) (value)
+#endif
+
+/* -1 indicates that we haven't checked that we're running on valgrind yet. */
+static int running_on_valgrind = -1;
+#endif
+
/* An object allocator for Python.
Here is an introduction to the layers of the Python memory architecture,
@@ -736,6 +751,13 @@ PyObject_Malloc(size_t nbytes)
poolp next;
uint size;
+#ifdef WITH_VALGRIND
+ if (UNLIKELY(running_on_valgrind == -1))
+ running_on_valgrind = RUNNING_ON_VALGRIND;
+ if (UNLIKELY(running_on_valgrind))
+ goto redirect;
+#endif
+
/*
* Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
* Most python internals blindly use a signed Py_ssize_t to track
@@ -938,6 +960,11 @@ PyObject_Free(void *p)
if (p == NULL) /* free(NULL) has no effect */
return;
+#ifdef WITH_VALGRIND
+ if (UNLIKELY(running_on_valgrind > 0))
+ goto redirect;
+#endif
+
pool = POOL_ADDR(p);
if (Py_ADDRESS_IN_RANGE(p, pool)) {
/* We allocated this address. */
@@ -1132,6 +1159,9 @@ PyObject_Free(void *p)
return;
}
+#ifdef WITH_VALGRIND
+redirect:
+#endif
/* We didn't allocate this address. */
free(p);
}
@@ -1164,6 +1194,12 @@ PyObject_Realloc(void *p, size_t nbytes)
if (nbytes > PY_SSIZE_T_MAX)
return NULL;
+#ifdef WITH_VALGRIND
+ /* Treat running_on_valgrind == -1 the same as 0 */
+ if (UNLIKELY(running_on_valgrind > 0))
+ goto redirect;
+#endif
+
pool = POOL_ADDR(p);
if (Py_ADDRESS_IN_RANGE(p, pool)) {
/* We're in charge of this block */
@@ -1191,6 +1227,9 @@ PyObject_Realloc(void *p, size_t nbytes)
}
return bp;
}
+#ifdef WITH_VALGRIND
+ redirect:
+#endif
/* We're not managing this block. If nbytes <=
* SMALL_REQUEST_THRESHOLD, it's tempting to try to take over this
* block. However, if we do, we need to copy the valid data from
@@ -1255,6 +1294,10 @@ PyObject_Free(void *p)
#define DEADBYTE 0xDB /* dead (newly freed) memory */
#define FORBIDDENBYTE 0xFB /* untouchable bytes at each end of a block */
+/* We tag each block with an API ID in order to tag API violations */
+#define _PYMALLOC_MEM_ID 'm' /* the PyMem_Malloc() API */
+#define _PYMALLOC_OBJ_ID 'o' /* The PyObject_Malloc() API */
+
static size_t serialno = 0; /* incremented on each debug {m,re}alloc */
/* serialno is always incremented via calling this routine. The point is
@@ -1345,9 +1388,50 @@ p[2*S+n+S: 2*S+n+2*S]
instant at which this block was passed out.
*/
+/* debug replacements for the PyMem_* memory API */
+void *
+_PyMem_DebugMalloc(size_t nbytes)
+{
+ return _PyObject_DebugMallocApi(_PYMALLOC_MEM_ID, nbytes);
+}
+void *
+_PyMem_DebugRealloc(void *p, size_t nbytes)
+{
+ return _PyObject_DebugReallocApi(_PYMALLOC_MEM_ID, p, nbytes);
+}
+void
+_PyMem_DebugFree(void *p)
+{
+ _PyObject_DebugFreeApi(_PYMALLOC_MEM_ID, p);
+}
+
+/* debug replacements for the PyObject_* memory API */
void *
_PyObject_DebugMalloc(size_t nbytes)
{
+ return _PyObject_DebugMallocApi(_PYMALLOC_OBJ_ID, nbytes);
+}
+void *
+_PyObject_DebugRealloc(void *p, size_t nbytes)
+{
+ return _PyObject_DebugReallocApi(_PYMALLOC_OBJ_ID, p, nbytes);
+}
+void
+_PyObject_DebugFree(void *p)
+{
+ _PyObject_DebugFreeApi(_PYMALLOC_OBJ_ID, p);
+}
+void
+_PyObject_DebugCheckAddress(const void *p)
+{
+ _PyObject_DebugCheckAddressApi(_PYMALLOC_OBJ_ID, p);
+}
+
+
+/* generic debug memory api, with an "id" to identify the API in use */
+void *
+_PyObject_DebugMallocApi(char id, size_t nbytes)
+{
uchar *p; /* base address of malloc'ed block */
uchar *tail; /* p + 2*SST + nbytes == pointer to tail pad bytes */
size_t total; /* nbytes + 4*SST */
@@ -1362,12 +1446,15 @@ _PyObject_DebugMalloc(size_t nbytes)
if (p == NULL)
return NULL;
+ /* at p, write size (SST bytes), id (1 byte), pad (SST-1 bytes) */
write_size_t(p, nbytes);
- memset(p + SST, FORBIDDENBYTE, SST);
+ p[SST] = (uchar)id;
+ memset(p + SST + 1 , FORBIDDENBYTE, SST-1);
if (nbytes > 0)
memset(p + 2*SST, CLEANBYTE, nbytes);
+ /* at tail, write pad (SST bytes) and serialno (SST bytes) */
tail = p + 2*SST + nbytes;
memset(tail, FORBIDDENBYTE, SST);
write_size_t(tail + SST, serialno);
@@ -1376,27 +1463,28 @@ _PyObject_DebugMalloc(size_t nbytes)
}
/* The debug free first checks the 2*SST bytes on each end for sanity (in
- particular, that the FORBIDDENBYTEs are still intact).
+ particular, that the FORBIDDENBYTEs with the api ID are still intact).
Then fills the original bytes with DEADBYTE.
Then calls the underlying free.
*/
void
-_PyObject_DebugFree(void *p)
+_PyObject_DebugFreeApi(char api, void *p)
{
uchar *q = (uchar *)p - 2*SST; /* address returned from malloc */
size_t nbytes;
if (p == NULL)
return;
- _PyObject_DebugCheckAddress(p);
+ _PyObject_DebugCheckAddressApi(api, p);
nbytes = read_size_t(q);
+ nbytes += 4*SST;
if (nbytes > 0)
memset(q, DEADBYTE, nbytes);
PyObject_Free(q);
}
void *
-_PyObject_DebugRealloc(void *p, size_t nbytes)
+_PyObject_DebugReallocApi(char api, void *p, size_t nbytes)
{
uchar *q = (uchar *)p;
uchar *tail;
@@ -1405,9 +1493,9 @@ _PyObject_DebugRealloc(void *p, size_t nbytes)
int i;
if (p == NULL)
- return _PyObject_DebugMalloc(nbytes);
+ return _PyObject_DebugMallocApi(api, nbytes);
- _PyObject_DebugCheckAddress(p);
+ _PyObject_DebugCheckAddressApi(api, p);
bumpserialno();
original_nbytes = read_size_t(q - 2*SST);
total = nbytes + 4*SST;
@@ -1417,16 +1505,20 @@ _PyObject_DebugRealloc(void *p, size_t nbytes)
if (nbytes < original_nbytes) {
/* shrinking: mark old extra memory dead */
- memset(q + nbytes, DEADBYTE, original_nbytes - nbytes);
+ memset(q + nbytes, DEADBYTE, original_nbytes - nbytes + 2*SST);
}
- /* Resize and add decorations. */
+ /* Resize and add decorations. We may get a new pointer here, in which
+ * case we didn't get the chance to mark the old memory with DEADBYTE,
+ * but we live with that.
+ */
q = (uchar *)PyObject_Realloc(q - 2*SST, total);
if (q == NULL)
return NULL;
write_size_t(q, nbytes);
- for (i = 0; i < SST; ++i)
+ assert(q[SST] == (uchar)api);
+ for (i = 1; i < SST; ++i)
assert(q[SST + i] == FORBIDDENBYTE);
q += 2*SST;
tail = q + nbytes;
@@ -1445,26 +1537,38 @@ _PyObject_DebugRealloc(void *p, size_t nbytes)
/* Check the forbidden bytes on both ends of the memory allocated for p.
* If anything is wrong, print info to stderr via _PyObject_DebugDumpAddress,
* and call Py_FatalError to kill the program.
+ * The API id, is also checked.
*/
void
-_PyObject_DebugCheckAddress(const void *p)
+_PyObject_DebugCheckAddressApi(char api, const void *p)
{
const uchar *q = (const uchar *)p;
+ char msgbuf[64];
char *msg;
size_t nbytes;
const uchar *tail;
int i;
+ char id;
if (p == NULL) {
msg = "didn't expect a NULL pointer";
goto error;
}
+ /* Check the API id */
+ id = (char)q[-SST];
+ if (id != api) {
+ msg = msgbuf;
+ snprintf(msg, sizeof(msgbuf), "bad ID: Allocated using API '%c', verified using API '%c'", id, api);
+ msgbuf[sizeof(msgbuf)-1] = 0;
+ goto error;
+ }
+
/* Check the stuff at the start of p first: if there's underwrite
* corruption, the number-of-bytes field may be nuts, and checking
* the tail could lead to a segfault then.
*/
- for (i = SST; i >= 1; --i) {
+ for (i = SST-1; i >= 1; --i) {
if (*(q-i) != FORBIDDENBYTE) {
msg = "bad leading pad byte";
goto error;
@@ -1496,19 +1600,24 @@ _PyObject_DebugDumpAddress(const void *p)
size_t nbytes, serial;
int i;
int ok;
+ char id;
- fprintf(stderr, "Debug memory block at address p=%p:\n", p);
- if (p == NULL)
+ fprintf(stderr, "Debug memory block at address p=%p:", p);
+ if (p == NULL) {
+ fprintf(stderr, "\n");
return;
+ }
+ id = (char)q[-SST];
+ fprintf(stderr, " API '%c'\n", id);
nbytes = read_size_t(q - 2*SST);
fprintf(stderr, " %" PY_FORMAT_SIZE_T "u bytes originally "
"requested\n", nbytes);
/* In case this is nuts, check the leading pad bytes first. */
- fprintf(stderr, " The %d pad bytes at p-%d are ", SST, SST);
+ fprintf(stderr, " The %d pad bytes at p-%d are ", SST-1, SST-1);
ok = 1;
- for (i = 1; i <= SST; ++i) {
+ for (i = 1; i <= SST-1; ++i) {
if (*(q-i) != FORBIDDENBYTE) {
ok = 0;
break;
@@ -1519,7 +1628,7 @@ _PyObject_DebugDumpAddress(const void *p)
else {
fprintf(stderr, "not all FORBIDDENBYTE (0x%02x):\n",
FORBIDDENBYTE);
- for (i = SST; i >= 1; --i) {
+ for (i = SST-1; i >= 1; --i) {
const uchar byte = *(q-i);
fprintf(stderr, " at p-%d: 0x%02x", i, byte);
if (byte != FORBIDDENBYTE)
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 33a4d9d63d..58d373c0b9 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -14,6 +14,7 @@ typedef struct {
PyObject *start;
PyObject *stop;
PyObject *step;
+ PyObject *length;
} rangeobject;
/* Helper function for validating step. Always returns a new reference or
@@ -43,6 +44,31 @@ validate_step(PyObject *step)
return step;
}
+static PyObject *
+compute_range_length(PyObject *start, PyObject *stop, PyObject *step);
+
+static rangeobject *
+make_range_object(PyTypeObject *type, PyObject *start,
+ PyObject *stop, PyObject *step)
+{
+ rangeobject *obj = NULL;
+ PyObject *length;
+ length = compute_range_length(start, stop, step);
+ if (length == NULL) {
+ return NULL;
+ }
+ obj = PyObject_New(rangeobject, type);
+ if (obj == NULL) {
+ Py_DECREF(length);
+ return NULL;
+ }
+ obj->start = start;
+ obj->stop = stop;
+ obj->step = step;
+ obj->length = length;
+ return obj;
+}
+
/* XXX(nnorwitz): should we error check if the user passes any empty ranges?
range(-10)
range(0, -5)
@@ -51,7 +77,7 @@ validate_step(PyObject *step)
static PyObject *
range_new(PyTypeObject *type, PyObject *args, PyObject *kw)
{
- rangeobject *obj = NULL;
+ rangeobject *obj;
PyObject *start = NULL, *stop = NULL, *step = NULL;
if (!_PyArg_NoKeywords("range()", kw))
@@ -97,15 +123,11 @@ range_new(PyTypeObject *type, PyObject *args, PyObject *kw)
}
}
- obj = PyObject_New(rangeobject, &PyRange_Type);
- if (obj == NULL)
- goto Fail;
- obj->start = start;
- obj->stop = stop;
- obj->step = step;
- return (PyObject *) obj;
+ obj = make_range_object(type, start, stop, step);
+ if (obj != NULL)
+ return (PyObject *) obj;
-Fail:
+ /* Failed to create object, release attributes */
Py_XDECREF(start);
Py_XDECREF(stop);
Py_XDECREF(step);
@@ -115,7 +137,7 @@ Fail:
PyDoc_STRVAR(range_doc,
"range([start,] stop[, step]) -> range object\n\
\n\
-Returns an iterator that generates the numbers in the range on demand.");
+Returns a virtual sequence of numbers from start to stop by step.");
static void
range_dealloc(rangeobject *r)
@@ -123,6 +145,7 @@ range_dealloc(rangeobject *r)
Py_DECREF(r->start);
Py_DECREF(r->stop);
Py_DECREF(r->step);
+ Py_DECREF(r->length);
PyObject_Del(r);
}
@@ -131,7 +154,7 @@ range_dealloc(rangeobject *r)
* PyLong_Check(). Return NULL when there is an error.
*/
static PyObject*
-range_length_obj(rangeobject *r)
+compute_range_length(PyObject *start, PyObject *stop, PyObject *step)
{
/* -------------------------------------------------------------
Algorithm is equal to that of get_len_of_range(), but it operates
@@ -139,7 +162,6 @@ range_length_obj(rangeobject *r)
---------------------------------------------------------------*/
int cmp_result;
PyObject *lo, *hi;
- PyObject *step = NULL;
PyObject *diff = NULL;
PyObject *one = NULL;
PyObject *tmp1 = NULL, *tmp2 = NULL, *result;
@@ -148,20 +170,19 @@ range_length_obj(rangeobject *r)
PyObject *zero = PyLong_FromLong(0);
if (zero == NULL)
return NULL;
- cmp_result = PyObject_RichCompareBool(r->step, zero, Py_GT);
+ cmp_result = PyObject_RichCompareBool(step, zero, Py_GT);
Py_DECREF(zero);
if (cmp_result == -1)
return NULL;
if (cmp_result == 1) {
- lo = r->start;
- hi = r->stop;
- step = r->step;
+ lo = start;
+ hi = stop;
Py_INCREF(step);
} else {
- lo = r->stop;
- hi = r->start;
- step = PyNumber_Negative(r->step);
+ lo = stop;
+ hi = start;
+ step = PyNumber_Negative(step);
if (!step)
return NULL;
}
@@ -206,45 +227,451 @@ range_length_obj(rangeobject *r)
static Py_ssize_t
range_length(rangeobject *r)
{
- PyObject *len = range_length_obj(r);
- Py_ssize_t result = -1;
- if (len) {
- result = PyLong_AsSsize_t(len);
- Py_DECREF(len);
- }
- return result;
+ return PyLong_AsSsize_t(r->length);
}
-/* range(...)[x] is necessary for: seq[:] = range(...) */
+static PyObject *
+compute_item(rangeobject *r, PyObject *i)
+{
+ PyObject *incr, *result;
+ /* PyLong equivalent to:
+ * return r->start + (i * r->step)
+ */
+ incr = PyNumber_Multiply(i, r->step);
+ if (!incr)
+ return NULL;
+ result = PyNumber_Add(r->start, incr);
+ Py_DECREF(incr);
+ return result;
+}
static PyObject *
-range_item(rangeobject *r, Py_ssize_t i)
+compute_range_item(rangeobject *r, PyObject *arg)
{
- Py_ssize_t len = range_length(r);
- PyObject *rem, *incr, *result;
-
- /* XXX(nnorwitz): should negative indices be supported? */
- /* XXX(nnorwitz): should support range[x] where x > PY_SSIZE_T_MAX? */
- if (i < 0 || i >= len) {
- if (!PyErr_Occurred())
- PyErr_SetString(PyExc_IndexError,
- "range object index out of range");
+ int cmp_result;
+ PyObject *i, *result;
+
+ PyObject *zero = PyLong_FromLong(0);
+ if (zero == NULL)
return NULL;
+
+ /* PyLong equivalent to:
+ * if (arg < 0) {
+ * i = r->length + arg
+ * } else {
+ * i = arg
+ * }
+ */
+ cmp_result = PyObject_RichCompareBool(arg, zero, Py_LT);
+ if (cmp_result == -1) {
+ Py_DECREF(zero);
+ return NULL;
+ }
+ if (cmp_result == 1) {
+ i = PyNumber_Add(r->length, arg);
+ if (!i) {
+ Py_DECREF(zero);
+ return NULL;
+ }
+ } else {
+ i = arg;
+ Py_INCREF(i);
}
- /* XXX(nnorwitz): optimize for short ints. */
- rem = PyLong_FromSsize_t(i);
- if (!rem)
+ /* PyLong equivalent to:
+ * if (i < 0 || i >= r->length) {
+ * <report index out of bounds>
+ * }
+ */
+ cmp_result = PyObject_RichCompareBool(i, zero, Py_LT);
+ Py_DECREF(zero);
+ if (cmp_result == 0) {
+ cmp_result = PyObject_RichCompareBool(i, r->length, Py_GE);
+ }
+ if (cmp_result == -1) {
+ Py_DECREF(i);
+ return NULL;
+ }
+ if (cmp_result == 1) {
+ Py_DECREF(i);
+ PyErr_SetString(PyExc_IndexError,
+ "range object index out of range");
return NULL;
- incr = PyNumber_Multiply(rem, r->step);
- Py_DECREF(rem);
- if (!incr)
+ }
+
+ result = compute_item(r, i);
+ Py_DECREF(i);
+ return result;
+}
+
+static PyObject *
+range_item(rangeobject *r, Py_ssize_t i)
+{
+ PyObject *res, *arg = PyLong_FromLong(i);
+ if (!arg) {
return NULL;
- result = PyNumber_Add(r->start, incr);
- Py_DECREF(incr);
+ }
+ res = compute_range_item(r, arg);
+ Py_DECREF(arg);
+ return res;
+}
+
+/* Additional helpers, since the standard slice helpers
+ * all clip to PY_SSIZE_T_MAX
+ */
+
+/* Replace _PyEval_SliceIndex */
+static PyObject *
+compute_slice_element(PyObject *obj)
+{
+ PyObject *result = NULL;
+ if (obj != NULL) {
+ if (PyIndex_Check(obj)) {
+ result = PyNumber_Index(obj);
+ }
+ }
+ if (result == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "slice indices must be integers or "
+ "None or have an __index__ method");
+ }
return result;
}
+/* Replace PySlice_GetIndicesEx
+ * Result indicates whether or not the slice is empty
+ * (-1 = error, 0 = empty slice, 1 = slice contains elements)
+ */
+static int
+compute_slice_indices(rangeobject *r, PySliceObject *slice,
+ PyObject **start, PyObject **stop, PyObject **step)
+{
+ int cmp_result, has_elements;
+ Py_ssize_t clamped_step = 0;
+ PyObject *zero = NULL, *one = NULL, *neg_one = NULL, *candidate = NULL;
+ PyObject *tmp_start = NULL, *tmp_stop = NULL, *tmp_step = NULL;
+ zero = PyLong_FromLong(0);
+ if (zero == NULL) goto Fail;
+ one = PyLong_FromLong(1);
+ if (one == NULL) goto Fail;
+ neg_one = PyLong_FromLong(-1);
+ if (neg_one == NULL) goto Fail;
+
+ /* Calculate step value */
+ if (slice->step == Py_None) {
+ clamped_step = 1;
+ tmp_step = one;
+ Py_INCREF(tmp_step);
+ } else {
+ if (!_PyEval_SliceIndex(slice->step, &clamped_step)) goto Fail;
+ if (clamped_step == 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "slice step cannot be zero");
+ goto Fail;
+ }
+ tmp_step = compute_slice_element(slice->step);
+ if (tmp_step == NULL) goto Fail;
+ }
+
+ /* Calculate start value */
+ if (slice->start == Py_None) {
+ if (clamped_step < 0) {
+ tmp_start = PyNumber_Subtract(r->length, one);
+ if (tmp_start == NULL) goto Fail;
+ } else {
+ tmp_start = zero;
+ Py_INCREF(tmp_start);
+ }
+ } else {
+ candidate = compute_slice_element(slice->start);
+ if (candidate == NULL) goto Fail;
+ cmp_result = PyObject_RichCompareBool(candidate, zero, Py_LT);
+ if (cmp_result == -1) goto Fail;
+ if (cmp_result) {
+ /* candidate < 0 */
+ tmp_start = PyNumber_Add(r->length, candidate);
+ if (tmp_start == NULL) goto Fail;
+ Py_CLEAR(candidate);
+ } else {
+ /* candidate >= 0 */
+ tmp_start = candidate;
+ candidate = NULL;
+ }
+ cmp_result = PyObject_RichCompareBool(tmp_start, zero, Py_LT);
+ if (cmp_result == -1) goto Fail;
+ if (cmp_result) {
+ /* tmp_start < 0 */
+ Py_CLEAR(tmp_start);
+ if (clamped_step < 0) {
+ tmp_start = neg_one;
+ } else {
+ tmp_start = zero;
+ }
+ Py_INCREF(tmp_start);
+ } else {
+ /* tmp_start >= 0 */
+ cmp_result = PyObject_RichCompareBool(tmp_start, r->length, Py_GE);
+ if (cmp_result == -1) goto Fail;
+ if (cmp_result) {
+ /* tmp_start >= r->length */
+ Py_CLEAR(tmp_start);
+ if (clamped_step < 0) {
+ tmp_start = PyNumber_Subtract(r->length, one);
+ if (tmp_start == NULL) goto Fail;
+ } else {
+ tmp_start = r->length;
+ Py_INCREF(tmp_start);
+ }
+ }
+ }
+ }
+
+ /* Calculate stop value */
+ if (slice->stop == Py_None) {
+ if (clamped_step < 0) {
+ tmp_stop = neg_one;
+ } else {
+ tmp_stop = r->length;
+ }
+ Py_INCREF(tmp_stop);
+ } else {
+ candidate = compute_slice_element(slice->stop);
+ if (candidate == NULL) goto Fail;
+ cmp_result = PyObject_RichCompareBool(candidate, zero, Py_LT);
+ if (cmp_result == -1) goto Fail;
+ if (cmp_result) {
+ /* candidate < 0 */
+ tmp_stop = PyNumber_Add(r->length, candidate);
+ if (tmp_stop == NULL) goto Fail;
+ Py_CLEAR(candidate);
+ } else {
+ /* candidate >= 0 */
+ tmp_stop = candidate;
+ candidate = NULL;
+ }
+ cmp_result = PyObject_RichCompareBool(tmp_stop, zero, Py_LT);
+ if (cmp_result == -1) goto Fail;
+ if (cmp_result) {
+ /* tmp_stop < 0 */
+ Py_CLEAR(tmp_stop);
+ if (clamped_step < 0) {
+ tmp_stop = neg_one;
+ } else {
+ tmp_stop = zero;
+ }
+ Py_INCREF(tmp_stop);
+ } else {
+ /* tmp_stop >= 0 */
+ cmp_result = PyObject_RichCompareBool(tmp_stop, r->length, Py_GE);
+ if (cmp_result == -1) goto Fail;
+ if (cmp_result) {
+ /* tmp_stop >= r->length */
+ Py_CLEAR(tmp_stop);
+ if (clamped_step < 0) {
+ tmp_stop = PyNumber_Subtract(r->length, one);
+ if (tmp_stop == NULL) goto Fail;
+ } else {
+ tmp_stop = r->length;
+ Py_INCREF(tmp_stop);
+ }
+ }
+ }
+ }
+
+ /* Check if the slice is empty or not */
+ if (clamped_step < 0) {
+ has_elements = PyObject_RichCompareBool(tmp_start, tmp_stop, Py_GT);
+ } else {
+ has_elements = PyObject_RichCompareBool(tmp_start, tmp_stop, Py_LT);
+ }
+ if (has_elements == -1) goto Fail;
+
+ *start = tmp_start;
+ *stop = tmp_stop;
+ *step = tmp_step;
+ Py_DECREF(neg_one);
+ Py_DECREF(one);
+ Py_DECREF(zero);
+ return has_elements;
+
+ Fail:
+ Py_XDECREF(tmp_start);
+ Py_XDECREF(tmp_stop);
+ Py_XDECREF(tmp_step);
+ Py_XDECREF(candidate);
+ Py_XDECREF(neg_one);
+ Py_XDECREF(one);
+ Py_XDECREF(zero);
+ return -1;
+}
+
+static PyObject *
+compute_slice(rangeobject *r, PyObject *_slice)
+{
+ PySliceObject *slice = (PySliceObject *) _slice;
+ rangeobject *result;
+ PyObject *start = NULL, *stop = NULL, *step = NULL;
+ PyObject *substart = NULL, *substop = NULL, *substep = NULL;
+ int has_elements;
+
+ has_elements = compute_slice_indices(r, slice, &start, &stop, &step);
+ if (has_elements == -1) return NULL;
+
+ substep = PyNumber_Multiply(r->step, step);
+ if (substep == NULL) goto fail;
+ Py_CLEAR(step);
+
+ substart = compute_item(r, start);
+ if (substart == NULL) goto fail;
+ Py_CLEAR(start);
+
+ if (has_elements) {
+ substop = compute_item(r, stop);
+ if (substop == NULL) goto fail;
+ } else {
+ substop = substart;
+ Py_INCREF(substop);
+ }
+ Py_CLEAR(stop);
+
+ result = make_range_object(Py_TYPE(r), substart, substop, substep);
+ if (result != NULL) {
+ return (PyObject *) result;
+ }
+fail:
+ Py_XDECREF(start);
+ Py_XDECREF(stop);
+ Py_XDECREF(step);
+ Py_XDECREF(substart);
+ Py_XDECREF(substop);
+ Py_XDECREF(substep);
+ return NULL;
+}
+
+/* Assumes (PyLong_CheckExact(ob) || PyBool_Check(ob)) */
+static int
+range_contains_long(rangeobject *r, PyObject *ob)
+{
+ int cmp1, cmp2, cmp3;
+ PyObject *tmp1 = NULL;
+ PyObject *tmp2 = NULL;
+ PyObject *zero = NULL;
+ int result = -1;
+
+ zero = PyLong_FromLong(0);
+ if (zero == NULL) /* MemoryError in int(0) */
+ goto end;
+
+ /* Check if the value can possibly be in the range. */
+
+ cmp1 = PyObject_RichCompareBool(r->step, zero, Py_GT);
+ if (cmp1 == -1)
+ goto end;
+ if (cmp1 == 1) { /* positive steps: start <= ob < stop */
+ cmp2 = PyObject_RichCompareBool(r->start, ob, Py_LE);
+ cmp3 = PyObject_RichCompareBool(ob, r->stop, Py_LT);
+ }
+ else { /* negative steps: stop < ob <= start */
+ cmp2 = PyObject_RichCompareBool(ob, r->start, Py_LE);
+ cmp3 = PyObject_RichCompareBool(r->stop, ob, Py_LT);
+ }
+
+ if (cmp2 == -1 || cmp3 == -1) /* TypeError */
+ goto end;
+ if (cmp2 == 0 || cmp3 == 0) { /* ob outside of range */
+ result = 0;
+ goto end;
+ }
+
+ /* Check that the stride does not invalidate ob's membership. */
+ tmp1 = PyNumber_Subtract(ob, r->start);
+ if (tmp1 == NULL)
+ goto end;
+ tmp2 = PyNumber_Remainder(tmp1, r->step);
+ if (tmp2 == NULL)
+ goto end;
+ /* result = (int(ob) - start % step) == 0 */
+ result = PyObject_RichCompareBool(tmp2, zero, Py_EQ);
+ end:
+ Py_XDECREF(tmp1);
+ Py_XDECREF(tmp2);
+ Py_XDECREF(zero);
+ return result;
+}
+
+static int
+range_contains(rangeobject *r, PyObject *ob)
+{
+ if (PyLong_CheckExact(ob) || PyBool_Check(ob))
+ return range_contains_long(r, ob);
+
+ return (int)_PySequence_IterSearch((PyObject*)r, ob,
+ PY_ITERSEARCH_CONTAINS);
+}
+
+static PyObject *
+range_count(rangeobject *r, PyObject *ob)
+{
+ if (PyLong_CheckExact(ob) || PyBool_Check(ob)) {
+ int result = range_contains_long(r, ob);
+ if (result == -1)
+ return NULL;
+ else if (result)
+ return PyLong_FromLong(1);
+ else
+ return PyLong_FromLong(0);
+ } else {
+ Py_ssize_t count;
+ count = _PySequence_IterSearch((PyObject*)r, ob, PY_ITERSEARCH_COUNT);
+ if (count == -1)
+ return NULL;
+ return PyLong_FromSsize_t(count);
+ }
+}
+
+static PyObject *
+range_index(rangeobject *r, PyObject *ob)
+{
+ int contains;
+
+ if (!PyLong_CheckExact(ob) && !PyBool_Check(ob)) {
+ Py_ssize_t index;
+ index = _PySequence_IterSearch((PyObject*)r, ob, PY_ITERSEARCH_INDEX);
+ if (index == -1)
+ return NULL;
+ return PyLong_FromSsize_t(index);
+ }
+
+ contains = range_contains_long(r, ob);
+ if (contains == -1)
+ return NULL;
+
+ if (contains) {
+ PyObject *idx, *tmp = PyNumber_Subtract(ob, r->start);
+ if (tmp == NULL)
+ return NULL;
+ /* idx = (ob - r.start) // r.step */
+ idx = PyNumber_FloorDivide(tmp, r->step);
+ Py_DECREF(tmp);
+ return idx;
+ }
+
+ /* object is not in the range */
+ PyErr_Format(PyExc_ValueError, "%R is not in range", ob);
+ return NULL;
+}
+
+static PySequenceMethods range_as_sequence = {
+ (lenfunc)range_length, /* sq_length */
+ 0, /* sq_concat */
+ 0, /* sq_repeat */
+ (ssizeargfunc)range_item, /* sq_item */
+ 0, /* sq_slice */
+ 0, /* sq_ass_item */
+ 0, /* sq_ass_slice */
+ (objobjproc)range_contains, /* sq_contains */
+};
+
static PyObject *
range_repr(rangeobject *r)
{
@@ -269,16 +696,36 @@ range_repr(rangeobject *r)
static PyObject *
range_reduce(rangeobject *r, PyObject *args)
{
- return Py_BuildValue("(O(OOO))", Py_TYPE(r),
+ return Py_BuildValue("(O(OOO))", Py_TYPE(r),
r->start, r->stop, r->step);
}
-static PySequenceMethods range_as_sequence = {
- (lenfunc)range_length, /* sq_length */
- 0, /* sq_concat */
- 0, /* sq_repeat */
- (ssizeargfunc)range_item, /* sq_item */
- 0, /* sq_slice */
+static PyObject *
+range_subscript(rangeobject* self, PyObject* item)
+{
+ if (PyIndex_Check(item)) {
+ PyObject *i, *result;
+ i = PyNumber_Index(item);
+ if (!i)
+ return NULL;
+ result = compute_range_item(self, i);
+ Py_DECREF(i);
+ return result;
+ }
+ if (PySlice_Check(item)) {
+ return compute_slice(self, item);
+ }
+ PyErr_Format(PyExc_TypeError,
+ "range indices must be integers or slices, not %.200s",
+ item->ob_type->tp_name);
+ return NULL;
+}
+
+
+static PyMappingMethods range_as_mapping = {
+ (lenfunc)range_length, /* mp_length */
+ (binaryfunc)range_subscript, /* mp_subscript */
+ (objobjargproc)0, /* mp_ass_subscript */
};
static PyObject * range_iter(PyObject *seq);
@@ -287,10 +734,18 @@ static PyObject * range_reverse(PyObject *seq);
PyDoc_STRVAR(reverse_doc,
"Returns a reverse iterator.");
+PyDoc_STRVAR(count_doc,
+"rangeobject.count(value) -> integer -- return number of occurrences of value");
+
+PyDoc_STRVAR(index_doc,
+"rangeobject.index(value, [start, [stop]]) -> integer -- return index of value.\n"
+"Raises ValueError if the value is not present.");
+
static PyMethodDef range_methods[] = {
- {"__reversed__", (PyCFunction)range_reverse, METH_NOARGS,
- reverse_doc},
- {"__reduce__", (PyCFunction)range_reduce, METH_VARARGS},
+ {"__reversed__", (PyCFunction)range_reverse, METH_NOARGS, reverse_doc},
+ {"__reduce__", (PyCFunction)range_reduce, METH_VARARGS},
+ {"count", (PyCFunction)range_count, METH_O, count_doc},
+ {"index", (PyCFunction)range_index, METH_O, index_doc},
{NULL, NULL} /* sentinel */
};
@@ -307,7 +762,7 @@ PyTypeObject PyRange_Type = {
(reprfunc)range_repr, /* tp_repr */
0, /* tp_as_number */
&range_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
+ &range_as_mapping, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
@@ -367,22 +822,6 @@ rangeiter_len(rangeiterobject *r)
return PyLong_FromLong(r->len - r->index);
}
-typedef struct {
- PyObject_HEAD
- PyObject *index;
- PyObject *start;
- PyObject *step;
- PyObject *len;
-} longrangeiterobject;
-
-static PyObject *
-longrangeiter_len(longrangeiterobject *r, PyObject *no_args)
-{
- return PyNumber_Subtract(r->len, r->index);
-}
-
-static PyObject *rangeiter_new(PyTypeObject *, PyObject *args, PyObject *kw);
-
PyDoc_STRVAR(length_hint_doc,
"Private method returning an estimate of len(list(it)).");
@@ -392,6 +831,8 @@ static PyMethodDef rangeiter_methods[] = {
{NULL, NULL} /* sentinel */
};
+static PyObject *rangeiter_new(PyTypeObject *, PyObject *args, PyObject *kw);
+
PyTypeObject PyRangeIter_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"range_iterator", /* tp_name */
@@ -466,7 +907,7 @@ get_len_of_range(long lo, long hi, long step)
is not representable as a C long, OverflowError is raised. */
static PyObject *
-int_range_iter(long start, long stop, long step)
+fast_range_iter(long start, long stop, long step)
{
rangeiterobject *it = PyObject_New(rangeiterobject, &PyRangeIter_Type);
unsigned long ulen;
@@ -498,7 +939,21 @@ rangeiter_new(PyTypeObject *type, PyObject *args, PyObject *kw)
&start, &stop, &step))
return NULL;
- return int_range_iter(start, stop, step);
+ return fast_range_iter(start, stop, step);
+}
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *index;
+ PyObject *start;
+ PyObject *step;
+ PyObject *len;
+} longrangeiterobject;
+
+static PyObject *
+longrangeiter_len(longrangeiterobject *r, PyObject *no_args)
+{
+ return PyNumber_Subtract(r->len, r->index);
}
static PyMethodDef longrangeiter_methods[] = {
@@ -612,7 +1067,7 @@ range_iter(PyObject *seq)
PyErr_Clear();
goto long_range;
}
- int_it = int_range_iter(lstart, lstop, lstep);
+ int_it = fast_range_iter(lstart, lstop, lstep);
if (int_it == NULL && PyErr_ExceptionMatches(PyExc_OverflowError)) {
PyErr_Clear();
goto long_range;
@@ -627,14 +1082,11 @@ range_iter(PyObject *seq)
/* Do all initialization here, so we can DECREF on failure. */
it->start = r->start;
it->step = r->step;
+ it->len = r->length;
Py_INCREF(it->start);
Py_INCREF(it->step);
+ Py_INCREF(it->len);
- it->len = it->index = NULL;
-
- it->len = range_length_obj(r);
- if (!it->len)
- goto create_failure;
it->index = PyLong_FromLong(0);
if (!it->index)
goto create_failure;
@@ -651,7 +1103,7 @@ range_reverse(PyObject *seq)
{
rangeobject *range = (rangeobject*) seq;
longrangeiterobject *it;
- PyObject *one, *sum, *diff, *len = NULL, *product;
+ PyObject *one, *sum, *diff, *product;
long lstart, lstop, lstep, new_start, new_stop;
unsigned long ulen;
@@ -714,7 +1166,7 @@ range_reverse(PyObject *seq)
new_stop = lstart - lstep;
new_start = (long)(new_stop + ulen * lstep);
- return int_range_iter(new_start, new_stop, -lstep);
+ return fast_range_iter(new_start, new_stop, -lstep);
long_range:
it = PyObject_New(longrangeiterobject, &PyLongRangeIter_Type);
@@ -722,18 +1174,14 @@ long_range:
return NULL;
/* start + (len - 1) * step */
- len = range_length_obj(range);
- if (!len)
- goto create_failure;
-
- /* Steal reference to len. */
- it->len = len;
+ it->len = range->length;
+ Py_INCREF(it->len);
one = PyLong_FromLong(1);
if (!one)
goto create_failure;
- diff = PyNumber_Subtract(len, one);
+ diff = PyNumber_Subtract(it->len, one);
Py_DECREF(one);
if (!diff)
goto create_failure;
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 7aa1a7faee..48edad8a31 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -75,7 +75,7 @@ NULL if the rich comparison returns an error.
*/
static setentry *
-set_lookkey(PySetObject *so, PyObject *key, register long hash)
+set_lookkey(PySetObject *so, PyObject *key, register Py_hash_t hash)
{
register Py_ssize_t i;
register size_t perturb;
@@ -157,7 +157,7 @@ set_lookkey(PySetObject *so, PyObject *key, register long hash)
* see if the comparison altered the table.
*/
static setentry *
-set_lookkey_unicode(PySetObject *so, PyObject *key, register long hash)
+set_lookkey_unicode(PySetObject *so, PyObject *key, register Py_hash_t hash)
{
register Py_ssize_t i;
register size_t perturb;
@@ -211,10 +211,10 @@ Used by the public insert routine.
Eats a reference to key.
*/
static int
-set_insert_key(register PySetObject *so, PyObject *key, long hash)
+set_insert_key(register PySetObject *so, PyObject *key, Py_hash_t hash)
{
register setentry *entry;
- typedef setentry *(*lookupfunc)(PySetObject *, PyObject *, long);
+ typedef setentry *(*lookupfunc)(PySetObject *, PyObject *, Py_hash_t);
assert(so->lookup != NULL);
entry = so->lookup(so, key, hash);
@@ -248,7 +248,7 @@ Note that no refcounts are changed by this routine; if needed, the caller
is responsible for incref'ing `key`.
*/
static void
-set_insert_clean(register PySetObject *so, PyObject *key, long hash)
+set_insert_clean(register PySetObject *so, PyObject *key, Py_hash_t hash)
{
register size_t i;
register size_t perturb;
@@ -349,7 +349,7 @@ set_table_resize(PySetObject *so, Py_ssize_t minused)
} else {
/* ACTIVE */
--i;
- set_insert_clean(so, entry->key, (long) entry->hash);
+ set_insert_clean(so, entry->key, entry->hash);
}
}
@@ -365,7 +365,7 @@ set_add_entry(register PySetObject *so, setentry *entry)
{
register Py_ssize_t n_used;
PyObject *key = entry->key;
- long hash = entry->hash;
+ Py_hash_t hash = entry->hash;
assert(so->fill <= so->mask); /* at least one empty slot */
n_used = so->used;
@@ -382,7 +382,7 @@ set_add_entry(register PySetObject *so, setentry *entry)
static int
set_add_key(register PySetObject *so, PyObject *key)
{
- register long hash;
+ register Py_hash_t hash;
register Py_ssize_t n_used;
if (!PyUnicode_CheckExact(key) ||
@@ -411,7 +411,7 @@ set_discard_entry(PySetObject *so, setentry *oldentry)
{ register setentry *entry;
PyObject *old_key;
- entry = (so->lookup)(so, oldentry->key, (long) oldentry->hash);
+ entry = (so->lookup)(so, oldentry->key, oldentry->hash);
if (entry == NULL)
return -1;
if (entry->key == NULL || entry->key == dummy)
@@ -427,7 +427,7 @@ set_discard_entry(PySetObject *so, setentry *oldentry)
static int
set_discard_key(PySetObject *so, PyObject *key)
{
- register long hash;
+ register Py_hash_t hash;
register setentry *entry;
PyObject *old_key;
@@ -640,7 +640,7 @@ set_merge(PySetObject *so, PyObject *otherset)
{
PySetObject *other;
PyObject *key;
- long hash;
+ Py_hash_t hash;
register Py_ssize_t i;
register setentry *entry;
@@ -678,7 +678,7 @@ set_merge(PySetObject *so, PyObject *otherset)
static int
set_contains_key(PySetObject *so, PyObject *key)
{
- long hash;
+ Py_hash_t hash;
setentry *entry;
if (!PyUnicode_CheckExact(key) ||
@@ -700,7 +700,7 @@ set_contains_entry(PySetObject *so, setentry *entry)
PyObject *key;
setentry *lu_entry;
- lu_entry = (so->lookup)(so, entry->key, (long) entry->hash);
+ lu_entry = (so->lookup)(so, entry->key, entry->hash);
if (lu_entry == NULL)
return -1;
key = lu_entry->key;
@@ -764,25 +764,25 @@ set_traverse(PySetObject *so, visitproc visit, void *arg)
return 0;
}
-static long
+static Py_hash_t
frozenset_hash(PyObject *self)
{
PySetObject *so = (PySetObject *)self;
- long h, hash = 1927868237L;
+ Py_hash_t h, hash = 1927868237L;
setentry *entry;
Py_ssize_t pos = 0;
if (so->hash != -1)
return so->hash;
- hash *= (long) PySet_GET_SIZE(self) + 1;
+ hash *= PySet_GET_SIZE(self) + 1;
while (set_next(so, &pos, &entry)) {
/* Work to increase the bit dispersion for closely spaced hash
values. The is important because some use cases have many
combinations of a small number of elements with nearby
hashes so that many distinct combinations collapse to only
a handful of distinct hash values. */
- h = (long) entry->hash;
+ h = entry->hash;
hash ^= (h ^ (h << 16) ^ 89869747L) * 3644798167u;
}
hash = hash * 69069L + 907133923L;
@@ -929,7 +929,7 @@ set_update_internal(PySetObject *so, PyObject *other)
if (PyDict_CheckExact(other)) {
PyObject *value;
Py_ssize_t pos = 0;
- long hash;
+ Py_hash_t hash;
Py_ssize_t dictsize = PyDict_Size(other);
/* Do one big resize at the start, rather than
@@ -1117,9 +1117,9 @@ set_swap_bodies(PySetObject *a, PySetObject *b)
{
Py_ssize_t t;
setentry *u;
- setentry *(*f)(PySetObject *so, PyObject *key, long hash);
+ setentry *(*f)(PySetObject *so, PyObject *key, Py_ssize_t hash);
setentry tab[PySet_MINSIZE];
- long h;
+ Py_hash_t h;
t = a->fill; a->fill = b->fill; b->fill = t;
t = a->used; a->used = b->used; b->used = t;
@@ -1288,7 +1288,7 @@ set_intersection(PySetObject *so, PyObject *other)
while ((key = PyIter_Next(it)) != NULL) {
int rv;
setentry entry;
- long hash = PyObject_Hash(key);
+ Py_hash_t hash = PyObject_Hash(key);
if (hash == -1) {
Py_DECREF(it);
@@ -1347,9 +1347,9 @@ set_intersection_multi(PySetObject *so, PyObject *args)
}
PyDoc_STRVAR(intersection_doc,
-"Return the intersection of two or more sets as a new set.\n\
+"Return the intersection of two sets as a new set.\n\
\n\
-(i.e. elements that are common to all of the sets.)");
+(i.e. all elements that are in both sets.)");
static PyObject *
set_intersection_update(PySetObject *so, PyObject *other)
@@ -1445,7 +1445,7 @@ set_isdisjoint(PySetObject *so, PyObject *other)
while ((key = PyIter_Next(it)) != NULL) {
int rv;
setentry entry;
- long hash = PyObject_Hash(key);;
+ Py_hash_t hash = PyObject_Hash(key);
if (hash == -1) {
Py_DECREF(key);
@@ -1528,6 +1528,20 @@ PyDoc_STRVAR(difference_update_doc,
"Remove all elements of another set from this set.");
static PyObject *
+set_copy_and_difference(PySetObject *so, PyObject *other)
+{
+ PyObject *result;
+
+ result = set_copy(so);
+ if (result == NULL)
+ return NULL;
+ if (set_difference_update_internal((PySetObject *) result, other) != -1)
+ return result;
+ Py_DECREF(result);
+ return NULL;
+}
+
+static PyObject *
set_difference(PySetObject *so, PyObject *other)
{
PyObject *result;
@@ -1535,13 +1549,13 @@ set_difference(PySetObject *so, PyObject *other)
Py_ssize_t pos = 0;
if (!PyAnySet_Check(other) && !PyDict_CheckExact(other)) {
- result = set_copy(so);
- if (result == NULL)
- return NULL;
- if (set_difference_update_internal((PySetObject *)result, other) != -1)
- return result;
- Py_DECREF(result);
- return NULL;
+ return set_copy_and_difference(so, other);
+ }
+
+ /* If len(so) much more than len(other), it's more efficient to simply copy
+ * so and then iterate other looking for common elements. */
+ if ((PySet_GET_SIZE(so) >> 2) > PyObject_Size(other)) {
+ return set_copy_and_difference(so, other);
}
result = make_new_set_basetype(Py_TYPE(so), NULL);
@@ -1553,7 +1567,7 @@ set_difference(PySetObject *so, PyObject *other)
setentry entrycopy;
entrycopy.hash = entry->hash;
entrycopy.key = entry->key;
- if (!_PyDict_Contains(other, entry->key, (long) entry->hash)) {
+ if (!_PyDict_Contains(other, entry->key, entry->hash)) {
if (set_add_entry((PySetObject *)result, &entrycopy) == -1) {
Py_DECREF(result);
return NULL;
@@ -1563,6 +1577,7 @@ set_difference(PySetObject *so, PyObject *other)
return result;
}
+ /* Iterate over so, checking for common elements in other. */
while (set_next(so, &pos, &entry)) {
int rv = set_contains_entry((PySetObject *)other, entry);
if (rv == -1) {
@@ -1644,7 +1659,7 @@ set_symmetric_difference_update(PySetObject *so, PyObject *other)
if (PyDict_CheckExact(other)) {
PyObject *value;
int rv;
- long hash;
+ Py_hash_t hash;
while (_PyDict_Next(other, &pos, &key, &value, &hash)) {
setentry an_entry;
@@ -2117,7 +2132,7 @@ PyTypeObject PySet_Type = {
&set_as_number, /* tp_as_number */
&set_as_sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
- (hashfunc)PyObject_HashNotImplemented, /* tp_hash */
+ PyObject_HashNotImplemented, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
@@ -2129,8 +2144,8 @@ PyTypeObject PySet_Type = {
(traverseproc)set_traverse, /* tp_traverse */
(inquiry)set_clear_internal, /* tp_clear */
(richcmpfunc)set_richcompare, /* tp_richcompare */
- offsetof(PySetObject, weakreflist), /* tp_weaklistoffset */
- (getiterfunc)set_iter, /* tp_iter */
+ offsetof(PySetObject, weakreflist), /* tp_weaklistoffset */
+ (getiterfunc)set_iter, /* tp_iter */
0, /* tp_iternext */
set_methods, /* tp_methods */
0, /* tp_members */
@@ -2311,7 +2326,7 @@ PySet_Add(PyObject *anyset, PyObject *key)
}
int
-_PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash)
+_PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash)
{
setentry *entry;
@@ -2322,7 +2337,7 @@ _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash)
if (set_next((PySetObject *)set, pos, &entry) == 0)
return 0;
*key = entry->key;
- *hash = (long) entry->hash;
+ *hash = entry->hash;
return 1;
}
@@ -2366,12 +2381,26 @@ test_c_api(PySetObject *so)
Py_ssize_t i;
PyObject *elem=NULL, *dup=NULL, *t, *f, *dup2, *x;
PyObject *ob = (PyObject *)so;
- long hash;
+ Py_hash_t hash;
+ PyObject *str;
- /* Verify preconditions and exercise type/size checks */
+ /* Verify preconditions */
assert(PyAnySet_Check(ob));
assert(PyAnySet_CheckExact(ob));
assert(!PyFrozenSet_CheckExact(ob));
+
+ /* so.clear(); so |= set("abc"); */
+ str = PyUnicode_FromString("abc");
+ if (str == NULL)
+ return NULL;
+ set_clear_internal(so);
+ if (set_update_internal(so, str) == -1) {
+ Py_DECREF(str);
+ return NULL;
+ }
+ Py_DECREF(str);
+
+ /* Exercise type/size checks */
assert(PySet_Size(ob) == 3);
assert(PySet_GET_SIZE(ob) == 3);
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index ee89006688..51c53a8a11 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -99,9 +99,10 @@ _PySlice_FromIndices(Py_ssize_t istart, Py_ssize_t istop)
}
int
-PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
+PySlice_GetIndices(PyObject *_r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
{
+ PySliceObject *r = (PySliceObject*)_r;
/* XXX support long ints */
if (r->step == Py_None) {
*step = 1;
@@ -130,9 +131,11 @@ PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
}
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)
+PySlice_GetIndicesEx(PyObject *_r, Py_ssize_t length,
+ Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
+ Py_ssize_t *slicelength)
{
+ PySliceObject *r = (PySliceObject*)_r;
/* this is harder to get right than you might think */
Py_ssize_t defstart, defstop;
@@ -147,6 +150,13 @@ PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
"slice step cannot be zero");
return -1;
}
+ /* Here *step might be -PY_SSIZE_T_MAX-1; in this case we replace it
+ * with -PY_SSIZE_T_MAX. This doesn't affect the semantics, and it
+ * guards against later undefined behaviour resulting from code that
+ * does "step = -step" as part of a slice reversal.
+ */
+ if (*step < -PY_SSIZE_T_MAX)
+ *step = -PY_SSIZE_T_MAX;
}
defstart = *step < 0 ? length-1 : 0;
@@ -248,7 +258,7 @@ slice_indices(PySliceObject* self, PyObject* len)
return NULL;
}
- if (PySlice_GetIndicesEx(self, ilen, &start, &stop,
+ if (PySlice_GetIndicesEx((PyObject*)self, ilen, &start, &stop,
&step, &slicelength) < 0) {
return NULL;
}
@@ -336,13 +346,6 @@ slice_richcompare(PyObject *v, PyObject *w, int op)
return res;
}
-static long
-slice_hash(PySliceObject *v)
-{
- PyErr_SetString(PyExc_TypeError, "unhashable type");
- return -1L;
-}
-
PyTypeObject PySlice_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"slice", /* Name of this type */
@@ -357,7 +360,7 @@ PyTypeObject PySlice_Type = {
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
- (hashfunc)slice_hash, /* tp_hash */
+ PyObject_HashNotImplemented, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
diff --git a/Objects/stringlib/README.txt b/Objects/stringlib/README.txt
index 60d919e272..ab506d60f9 100644
--- a/Objects/stringlib/README.txt
+++ b/Objects/stringlib/README.txt
@@ -16,10 +16,6 @@ STRINGLIB_EMPTY
a PyObject representing the empty string, only to be used if
STRINGLIB_MUTABLE is 0
-int STRINGLIB_CMP(STRINGLIB_CHAR*, STRINGLIB_CHAR*, Py_ssize_t)
-
- compares two strings. returns 0 if they match, and non-zero if not.
-
Py_ssize_t STRINGLIB_LEN(PyObject*)
returns the length of the given string object (which must be of the
diff --git a/Objects/stringlib/count.h b/Objects/stringlib/count.h
index eba37e9cc8..de34f96b3e 100644
--- a/Objects/stringlib/count.h
+++ b/Objects/stringlib/count.h
@@ -9,28 +9,22 @@
Py_LOCAL_INLINE(Py_ssize_t)
stringlib_count(const STRINGLIB_CHAR* str, Py_ssize_t str_len,
- const STRINGLIB_CHAR* sub, Py_ssize_t sub_len)
+ const STRINGLIB_CHAR* sub, Py_ssize_t sub_len,
+ Py_ssize_t maxcount)
{
Py_ssize_t count;
if (str_len < 0)
return 0; /* start > len(str) */
if (sub_len == 0)
- return str_len + 1;
+ return (str_len < maxcount) ? str_len + 1 : maxcount;
- count = fastsearch(str, str_len, sub, sub_len, FAST_COUNT);
+ count = fastsearch(str, str_len, sub, sub_len, maxcount, FAST_COUNT);
if (count < 0)
- count = 0; /* no match */
+ return 0; /* no match */
return count;
}
#endif
-
-/*
-Local variables:
-c-basic-offset: 4
-indent-tabs-mode: nil
-End:
-*/
diff --git a/Objects/stringlib/ctype.h b/Objects/stringlib/ctype.h
index 8951276814..739cf3d9eb 100644
--- a/Objects/stringlib/ctype.h
+++ b/Objects/stringlib/ctype.h
@@ -107,4 +107,3 @@ stringlib_swapcase(PyObject *self)
STRINGLIB_LEN(self));
return newobj;
}
-
diff --git a/Objects/stringlib/fastsearch.h b/Objects/stringlib/fastsearch.h
index 23bccfb01d..e231c587e4 100644
--- a/Objects/stringlib/fastsearch.h
+++ b/Objects/stringlib/fastsearch.h
@@ -5,7 +5,7 @@
/* fast search/count implementation, based on a mix between boyer-
moore and horspool, with a few more bells and whistles on the top.
- for some more background, see: http://effbot.org/stringlib.htm */
+ for some more background, see: http://effbot.org/zone/stringlib.htm */
/* note: fastsearch may access s[n], which isn't a problem when using
Python's ordinary string types, but may cause problems if you're
@@ -16,19 +16,35 @@
#define FAST_COUNT 0
#define FAST_SEARCH 1
+#define FAST_RSEARCH 2
+
+#if LONG_BIT >= 128
+#define STRINGLIB_BLOOM_WIDTH 128
+#elif LONG_BIT >= 64
+#define STRINGLIB_BLOOM_WIDTH 64
+#elif LONG_BIT >= 32
+#define STRINGLIB_BLOOM_WIDTH 32
+#else
+#error "LONG_BIT is smaller than 32"
+#endif
+
+#define STRINGLIB_BLOOM_ADD(mask, ch) \
+ ((mask |= (1UL << ((ch) & (STRINGLIB_BLOOM_WIDTH -1)))))
+#define STRINGLIB_BLOOM(mask, ch) \
+ ((mask & (1UL << ((ch) & (STRINGLIB_BLOOM_WIDTH -1)))))
Py_LOCAL_INLINE(Py_ssize_t)
fastsearch(const STRINGLIB_CHAR* s, Py_ssize_t n,
const STRINGLIB_CHAR* p, Py_ssize_t m,
- int mode)
+ Py_ssize_t maxcount, int mode)
{
- long mask;
+ unsigned long mask;
Py_ssize_t skip, count = 0;
Py_ssize_t i, j, mlast, w;
w = n - m;
- if (w < 0)
+ if (w < 0 || (mode == FAST_COUNT && maxcount == 0))
return -1;
/* look for special cases */
@@ -38,54 +54,101 @@ fastsearch(const STRINGLIB_CHAR* s, Py_ssize_t n,
/* use special case for 1-character strings */
if (mode == FAST_COUNT) {
for (i = 0; i < n; i++)
- if (s[i] == p[0])
+ if (s[i] == p[0]) {
count++;
+ if (count == maxcount)
+ return maxcount;
+ }
return count;
- } else {
+ } else if (mode == FAST_SEARCH) {
for (i = 0; i < n; i++)
if (s[i] == p[0])
return i;
+ } else { /* FAST_RSEARCH */
+ for (i = n - 1; i > -1; i--)
+ if (s[i] == p[0])
+ return i;
}
return -1;
}
mlast = m - 1;
-
- /* create compressed boyer-moore delta 1 table */
skip = mlast - 1;
- /* process pattern[:-1] */
- for (mask = i = 0; i < mlast; i++) {
- mask |= (1 << (p[i] & 0x1F));
- if (p[i] == p[mlast])
- skip = mlast - i - 1;
- }
- /* process pattern[-1] outside the loop */
- mask |= (1 << (p[mlast] & 0x1F));
-
- for (i = 0; i <= w; i++) {
- /* note: using mlast in the skip path slows things down on x86 */
- if (s[i+m-1] == p[m-1]) {
- /* candidate match */
- for (j = 0; j < mlast; j++)
- if (s[i+j] != p[j])
- break;
- if (j == mlast) {
- /* got a match! */
- if (mode != FAST_COUNT)
+ mask = 0;
+
+ if (mode != FAST_RSEARCH) {
+
+ /* create compressed boyer-moore delta 1 table */
+
+ /* process pattern[:-1] */
+ for (i = 0; i < mlast; i++) {
+ STRINGLIB_BLOOM_ADD(mask, p[i]);
+ if (p[i] == p[mlast])
+ skip = mlast - i - 1;
+ }
+ /* process pattern[-1] outside the loop */
+ STRINGLIB_BLOOM_ADD(mask, p[mlast]);
+
+ for (i = 0; i <= w; i++) {
+ /* note: using mlast in the skip path slows things down on x86 */
+ if (s[i+m-1] == p[m-1]) {
+ /* candidate match */
+ for (j = 0; j < mlast; j++)
+ if (s[i+j] != p[j])
+ break;
+ if (j == mlast) {
+ /* got a match! */
+ if (mode != FAST_COUNT)
+ return i;
+ count++;
+ if (count == maxcount)
+ return maxcount;
+ i = i + mlast;
+ continue;
+ }
+ /* miss: check if next character is part of pattern */
+ if (!STRINGLIB_BLOOM(mask, s[i+m]))
+ i = i + m;
+ else
+ i = i + skip;
+ } else {
+ /* skip: check if next character is part of pattern */
+ if (!STRINGLIB_BLOOM(mask, s[i+m]))
+ i = i + m;
+ }
+ }
+ } else { /* FAST_RSEARCH */
+
+ /* create compressed boyer-moore delta 1 table */
+
+ /* process pattern[0] outside the loop */
+ STRINGLIB_BLOOM_ADD(mask, p[0]);
+ /* process pattern[:0:-1] */
+ for (i = mlast; i > 0; i--) {
+ STRINGLIB_BLOOM_ADD(mask, p[i]);
+ if (p[i] == p[0])
+ skip = i - 1;
+ }
+
+ for (i = w; i >= 0; i--) {
+ if (s[i] == p[0]) {
+ /* candidate match */
+ for (j = mlast; j > 0; j--)
+ if (s[i+j] != p[j])
+ break;
+ if (j == 0)
+ /* got a match! */
return i;
- count++;
- i = i + mlast;
- continue;
+ /* miss: check if previous character is part of pattern */
+ if (i > 0 && !STRINGLIB_BLOOM(mask, s[i-1]))
+ i = i - m;
+ else
+ i = i - skip;
+ } else {
+ /* skip: check if previous character is part of pattern */
+ if (i > 0 && !STRINGLIB_BLOOM(mask, s[i-1]))
+ i = i - m;
}
- /* miss: check if next character is part of pattern */
- if (!(mask & (1 << (s[i+m] & 0x1F))))
- i = i + m;
- else
- i = i + skip;
- } else {
- /* skip: check if next character is part of pattern */
- if (!(mask & (1 << (s[i+m] & 0x1F))))
- i = i + m;
}
}
@@ -95,10 +158,3 @@ fastsearch(const STRINGLIB_CHAR* s, Py_ssize_t n,
}
#endif
-
-/*
-Local variables:
-c-basic-offset: 4
-indent-tabs-mode: nil
-End:
-*/
diff --git a/Objects/stringlib/find.h b/Objects/stringlib/find.h
index 4407d717d2..ce615dcb8a 100644
--- a/Objects/stringlib/find.h
+++ b/Objects/stringlib/find.h
@@ -19,7 +19,7 @@ stringlib_find(const STRINGLIB_CHAR* str, Py_ssize_t str_len,
if (sub_len == 0)
return offset;
- pos = fastsearch(str, str_len, sub, sub_len, FAST_SEARCH);
+ pos = fastsearch(str, str_len, sub, sub_len, -1, FAST_SEARCH);
if (pos >= 0)
pos += offset;
@@ -32,42 +32,43 @@ stringlib_rfind(const STRINGLIB_CHAR* str, Py_ssize_t str_len,
const STRINGLIB_CHAR* sub, Py_ssize_t sub_len,
Py_ssize_t offset)
{
- /* XXX - create reversefastsearch helper! */
- 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;
- }
+ Py_ssize_t pos;
+
+ if (str_len < 0)
+ return -1;
+ if (sub_len == 0)
+ return str_len + offset;
+
+ pos = fastsearch(str, str_len, sub, sub_len, -1, FAST_RSEARCH);
+
+ if (pos >= 0)
+ pos += offset;
+
+ return pos;
}
+/* helper macro to fixup start/end slice values */
+#define ADJUST_INDICES(start, end, len) \
+ if (end > len) \
+ end = len; \
+ else if (end < 0) { \
+ end += len; \
+ if (end < 0) \
+ end = 0; \
+ } \
+ if (start < 0) { \
+ start += len; \
+ if (start < 0) \
+ start = 0; \
+ }
+
Py_LOCAL_INLINE(Py_ssize_t)
stringlib_find_slice(const STRINGLIB_CHAR* str, Py_ssize_t str_len,
const STRINGLIB_CHAR* 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
- );
+ ADJUST_INDICES(start, end, str_len);
+ return stringlib_find(str + start, end - start, sub, sub_len, start);
}
Py_LOCAL_INLINE(Py_ssize_t)
@@ -75,17 +76,7 @@ stringlib_rfind_slice(const STRINGLIB_CHAR* str, Py_ssize_t str_len,
const STRINGLIB_CHAR* 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;
-
+ ADJUST_INDICES(start, end, str_len);
return stringlib_rfind(str + start, end - start, sub, sub_len, start);
}
@@ -100,7 +91,7 @@ stringlib_contains_obj(PyObject* str, PyObject* sub)
) != -1;
}
-#endif /* STRINGLIB_STR */
+#endif /* STRINGLIB_WANT_CONTAINS_OBJ */
/*
This function is a helper for the "find" family (find, rfind, index,
@@ -149,7 +140,7 @@ stringlib_parse_args_finds(const char * function_name, PyObject *args,
#undef FORMAT_BUFFER_SIZE
-#ifdef FROM_UNICODE
+#if STRINGLIB_IS_UNICODE
/*
Wraps stringlib_parse_args_finds() and additionally ensures that the
@@ -179,13 +170,6 @@ stringlib_parse_args_finds_unicode(const char * function_name, PyObject *args,
return 0;
}
-#endif /* FROM_UNICODE */
+#endif /* STRINGLIB_IS_UNICODE */
#endif /* STRINGLIB_FIND_H */
-
-/*
-Local variables:
-c-basic-offset: 4
-indent-tabs-mode: nil
-End:
-*/
diff --git a/Objects/stringlib/formatter.h b/Objects/stringlib/formatter.h
index 47708636be..4fdc62d650 100644
--- a/Objects/stringlib/formatter.h
+++ b/Objects/stringlib/formatter.h
@@ -32,7 +32,7 @@ unknown_presentation_type(STRINGLIB_CHAR presentation_type,
PyErr_Format(PyExc_ValueError,
"Unknown format code '%c' "
"for object of type '%.200s'",
- presentation_type,
+ (char)presentation_type,
type_name);
#if STRINGLIB_IS_UNICODE
else
@@ -44,6 +44,24 @@ unknown_presentation_type(STRINGLIB_CHAR presentation_type,
#endif
}
+static void
+invalid_comma_type(STRINGLIB_CHAR presentation_type)
+{
+#if STRINGLIB_IS_UNICODE
+ /* See comment in unknown_presentation_type */
+ if (presentation_type > 32 && presentation_type < 128)
+#endif
+ PyErr_Format(PyExc_ValueError,
+ "Cannot specify ',' with '%c'.",
+ (char)presentation_type);
+#if STRINGLIB_IS_UNICODE
+ else
+ PyErr_Format(PyExc_ValueError,
+ "Cannot specify ',' with '\\x%x'.",
+ (unsigned int)presentation_type);
+#endif
+}
+
/*
get_integer consumes 0 or more decimal digit characters from an
input string, updates *result with the corresponding positive
@@ -277,8 +295,7 @@ parse_internal_render_format_spec(STRINGLIB_CHAR *format_spec,
/* These are allowed. See PEP 378.*/
break;
default:
- PyErr_Format(PyExc_ValueError,
- "Cannot specify ',' with '%c'.", format->type);
+ invalid_comma_type(format->type);
return 0;
}
}
@@ -632,8 +649,8 @@ get_locale_info(int type, LocaleInfo *locale_info)
case LT_DEFAULT_LOCALE:
locale_info->decimal_point = ".";
locale_info->thousands_sep = ",";
- locale_info->grouping = "\3"; /* Group every 3 characters,
- trailing 0 means repeat
+ locale_info->grouping = "\3"; /* Group every 3 characters. The
+ (implicit) trailing 0 means repeat
infinitely. */
break;
case LT_NO_LOCALE:
@@ -759,14 +776,6 @@ format_int_or_long_internal(PyObject *value, const InternalFormatSpec *format,
goto done;
}
- /* Error to specify a comma. */
- if (format->thousands_separators) {
- PyErr_SetString(PyExc_ValueError,
- "Thousands separators not allowed with integer"
- " format specifier 'c'");
- goto done;
- }
-
/* taken from unicodeobject.c formatchar() */
/* Integer input truncated to a character */
/* XXX: won't work for int */
@@ -932,20 +941,16 @@ format_float_internal(PyObject *value,
from a hard-code pseudo-locale */
LocaleInfo locale;
- /* Alternate is not allowed on floats. */
- if (format->alternate) {
- PyErr_SetString(PyExc_ValueError,
- "Alternate form (#) not allowed in float format "
- "specifier");
- goto done;
- }
+ if (format->alternate)
+ flags |= Py_DTSF_ALT;
if (type == '\0') {
- /* Omitted type specifier. This is like 'g' but with at least one
- digit after the decimal point, and different default precision.*/
- type = 'g';
- default_precision = PyFloat_STR_PRECISION;
+ /* Omitted type specifier. Behaves in the same way as repr(x)
+ and str(x) if no precision is given, else like 'g', but with
+ at least one digit after the decimal point. */
flags |= Py_DTSF_ADD_DOT_0;
+ type = 'r';
+ default_precision = 0;
}
if (type == 'n')
@@ -953,13 +958,6 @@ format_float_internal(PyObject *value,
format the result. We take care of that later. */
type = 'g';
-#if PY_VERSION_HEX < 0x0301000
- /* 'F' is the same as 'f', per the PEP */
- /* This is no longer the case in 3.x */
- if (type == 'F')
- type = 'f';
-#endif
-
val = PyFloat_AsDouble(value);
if (val == -1.0 && PyErr_Occurred())
goto done;
@@ -972,12 +970,8 @@ format_float_internal(PyObject *value,
if (precision < 0)
precision = default_precision;
-
-#if PY_VERSION_HEX < 0x03010000
- /* 3.1 no longer converts large 'f' to 'g'. */
- if ((type == 'f' || type == 'F') && fabs(val) >= 1e50)
+ else if (type == 'r')
type = 'g';
-#endif
/* Cast "type", because if we're in unicode we need to pass a
8-bit char. This is safe, because we've restricted what "type"
@@ -1105,15 +1099,7 @@ format_complex_internal(PyObject *value,
from a hard-code pseudo-locale */
LocaleInfo locale;
- /* Alternate is not allowed on complex. */
- if (format->alternate) {
- PyErr_SetString(PyExc_ValueError,
- "Alternate form (#) not allowed in complex format "
- "specifier");
- goto done;
- }
-
- /* Neither is zero pading. */
+ /* Zero padding is not allowed. */
if (format->fill_char == '0') {
PyErr_SetString(PyExc_ValueError,
"Zero padding is not allowed in complex format "
@@ -1136,10 +1122,13 @@ format_complex_internal(PyObject *value,
if (im == -1.0 && PyErr_Occurred())
goto done;
+ if (format->alternate)
+ flags |= Py_DTSF_ALT;
+
if (type == '\0') {
/* Omitted type specifier. Should be like str(self). */
- type = 'g';
- default_precision = PyFloat_STR_PRECISION;
+ type = 'r';
+ default_precision = 0;
if (re == 0.0 && copysign(1.0, re) == 1.0)
skip_re = 1;
else
@@ -1151,15 +1140,10 @@ format_complex_internal(PyObject *value,
format the result. We take care of that later. */
type = 'g';
-#if PY_VERSION_HEX < 0x03010000
- /* This is no longer the case in 3.x */
- /* 'F' is the same as 'f', per the PEP */
- if (type == 'F')
- type = 'f';
-#endif
-
if (precision < 0)
precision = default_precision;
+ else if (type == 'r')
+ type = 'g';
/* Cast "type", because if we're in unicode we need to pass a
8-bit char. This is safe, because we've restricted what "type"
diff --git a/Objects/stringlib/partition.h b/Objects/stringlib/partition.h
index 20c75077b4..0170bddbf0 100644
--- a/Objects/stringlib/partition.h
+++ b/Objects/stringlib/partition.h
@@ -8,10 +8,10 @@
#endif
Py_LOCAL_INLINE(PyObject*)
-stringlib_partition(
- PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
- PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len
- )
+stringlib_partition(PyObject* str_obj,
+ const STRINGLIB_CHAR* str, Py_ssize_t str_len,
+ PyObject* sep_obj,
+ const STRINGLIB_CHAR* sep, Py_ssize_t sep_len)
{
PyObject* out;
Py_ssize_t pos;
@@ -25,15 +25,21 @@ stringlib_partition(
if (!out)
return NULL;
- pos = fastsearch(str, str_len, sep, sep_len, FAST_SEARCH);
+ pos = fastsearch(str, str_len, sep, sep_len, -1, FAST_SEARCH);
if (pos < 0) {
+#if STRINGLIB_MUTABLE
+ PyTuple_SET_ITEM(out, 0, STRINGLIB_NEW(str, str_len));
+ PyTuple_SET_ITEM(out, 1, STRINGLIB_NEW(NULL, 0));
+ PyTuple_SET_ITEM(out, 2, STRINGLIB_NEW(NULL, 0));
+#else
Py_INCREF(str_obj);
PyTuple_SET_ITEM(out, 0, (PyObject*) str_obj);
Py_INCREF(STRINGLIB_EMPTY);
PyTuple_SET_ITEM(out, 1, (PyObject*) STRINGLIB_EMPTY);
Py_INCREF(STRINGLIB_EMPTY);
PyTuple_SET_ITEM(out, 2, (PyObject*) STRINGLIB_EMPTY);
+#endif
return out;
}
@@ -52,13 +58,13 @@ stringlib_partition(
}
Py_LOCAL_INLINE(PyObject*)
-stringlib_rpartition(
- PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
- PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len
- )
+stringlib_rpartition(PyObject* str_obj,
+ const STRINGLIB_CHAR* str, Py_ssize_t str_len,
+ PyObject* sep_obj,
+ const STRINGLIB_CHAR* sep, Py_ssize_t sep_len)
{
PyObject* out;
- Py_ssize_t pos, j;
+ Py_ssize_t pos;
if (sep_len == 0) {
PyErr_SetString(PyExc_ValueError, "empty separator");
@@ -69,21 +75,21 @@ stringlib_rpartition(
if (!out)
return NULL;
- /* XXX - create reversefastsearch helper! */
- pos = -1;
- for (j = str_len - sep_len; j >= 0; --j)
- if (STRINGLIB_CMP(str+j, sep, sep_len) == 0) {
- pos = j;
- break;
- }
+ pos = fastsearch(str, str_len, sep, sep_len, -1, FAST_RSEARCH);
if (pos < 0) {
+#if STRINGLIB_MUTABLE
+ PyTuple_SET_ITEM(out, 0, STRINGLIB_NEW(NULL, 0));
+ PyTuple_SET_ITEM(out, 1, STRINGLIB_NEW(NULL, 0));
+ PyTuple_SET_ITEM(out, 2, STRINGLIB_NEW(str, str_len));
+#else
Py_INCREF(STRINGLIB_EMPTY);
PyTuple_SET_ITEM(out, 0, (PyObject*) STRINGLIB_EMPTY);
Py_INCREF(STRINGLIB_EMPTY);
PyTuple_SET_ITEM(out, 1, (PyObject*) STRINGLIB_EMPTY);
Py_INCREF(str_obj);
PyTuple_SET_ITEM(out, 2, (PyObject*) str_obj);
+#endif
return out;
}
@@ -102,10 +108,3 @@ stringlib_rpartition(
}
#endif
-
-/*
-Local variables:
-c-basic-offset: 4
-indent-tabs-mode: nil
-End:
-*/
diff --git a/Objects/stringlib/split.h b/Objects/stringlib/split.h
new file mode 100644
index 0000000000..60e77674f0
--- /dev/null
+++ b/Objects/stringlib/split.h
@@ -0,0 +1,394 @@
+/* stringlib: split implementation */
+
+#ifndef STRINGLIB_SPLIT_H
+#define STRINGLIB_SPLIT_H
+
+#ifndef STRINGLIB_FASTSEARCH_H
+#error must include "stringlib/fastsearch.h" before including this module
+#endif
+
+/* Overallocate the initial list to reduce the number of reallocs for small
+ split sizes. Eg, "A A A A A A A A A A".split() (10 elements) has three
+ resizes, to sizes 4, 8, then 16. Most observed string splits are for human
+ text (roughly 11 words per line) and field delimited data (usually 1-10
+ fields). For large strings the split algorithms are bandwidth limited
+ so increasing the preallocation likely will not improve things.*/
+
+#define MAX_PREALLOC 12
+
+/* 5 splits gives 6 elements */
+#define PREALLOC_SIZE(maxsplit) \
+ (maxsplit >= MAX_PREALLOC ? MAX_PREALLOC : maxsplit+1)
+
+#define SPLIT_APPEND(data, left, right) \
+ sub = STRINGLIB_NEW((data) + (left), \
+ (right) - (left)); \
+ if (sub == NULL) \
+ goto onError; \
+ if (PyList_Append(list, sub)) { \
+ Py_DECREF(sub); \
+ goto onError; \
+ } \
+ else \
+ Py_DECREF(sub);
+
+#define SPLIT_ADD(data, left, right) { \
+ sub = STRINGLIB_NEW((data) + (left), \
+ (right) - (left)); \
+ if (sub == NULL) \
+ goto onError; \
+ if (count < MAX_PREALLOC) { \
+ PyList_SET_ITEM(list, count, sub); \
+ } else { \
+ if (PyList_Append(list, sub)) { \
+ Py_DECREF(sub); \
+ goto onError; \
+ } \
+ else \
+ Py_DECREF(sub); \
+ } \
+ count++; }
+
+
+/* Always force the list to the expected size. */
+#define FIX_PREALLOC_SIZE(list) Py_SIZE(list) = count
+
+Py_LOCAL_INLINE(PyObject *)
+stringlib_split_whitespace(PyObject* str_obj,
+ const STRINGLIB_CHAR* str, Py_ssize_t str_len,
+ Py_ssize_t maxcount)
+{
+ Py_ssize_t i, j, count=0;
+ PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
+ PyObject *sub;
+
+ if (list == NULL)
+ return NULL;
+
+ i = j = 0;
+ while (maxcount-- > 0) {
+ while (i < str_len && STRINGLIB_ISSPACE(str[i]))
+ i++;
+ if (i == str_len) break;
+ j = i; i++;
+ while (i < str_len && !STRINGLIB_ISSPACE(str[i]))
+ i++;
+#ifndef STRINGLIB_MUTABLE
+ if (j == 0 && i == str_len && STRINGLIB_CHECK_EXACT(str_obj)) {
+ /* No whitespace in str_obj, so just use it as list[0] */
+ Py_INCREF(str_obj);
+ PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
+ count++;
+ break;
+ }
+#endif
+ SPLIT_ADD(str, j, i);
+ }
+
+ if (i < str_len) {
+ /* Only occurs when maxcount was reached */
+ /* Skip any remaining whitespace and copy to end of string */
+ while (i < str_len && STRINGLIB_ISSPACE(str[i]))
+ i++;
+ if (i != str_len)
+ SPLIT_ADD(str, i, str_len);
+ }
+ FIX_PREALLOC_SIZE(list);
+ return list;
+
+ onError:
+ Py_DECREF(list);
+ return NULL;
+}
+
+Py_LOCAL_INLINE(PyObject *)
+stringlib_split_char(PyObject* str_obj,
+ const STRINGLIB_CHAR* str, Py_ssize_t str_len,
+ const STRINGLIB_CHAR ch,
+ Py_ssize_t maxcount)
+{
+ Py_ssize_t i, j, count=0;
+ PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
+ PyObject *sub;
+
+ if (list == NULL)
+ return NULL;
+
+ i = j = 0;
+ while ((j < str_len) && (maxcount-- > 0)) {
+ for(; j < str_len; j++) {
+ /* I found that using memchr makes no difference */
+ if (str[j] == ch) {
+ SPLIT_ADD(str, i, j);
+ i = j = j + 1;
+ break;
+ }
+ }
+ }
+#ifndef STRINGLIB_MUTABLE
+ if (count == 0 && STRINGLIB_CHECK_EXACT(str_obj)) {
+ /* ch not in str_obj, so just use str_obj as list[0] */
+ Py_INCREF(str_obj);
+ PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
+ count++;
+ } else
+#endif
+ if (i <= str_len) {
+ SPLIT_ADD(str, i, str_len);
+ }
+ FIX_PREALLOC_SIZE(list);
+ return list;
+
+ onError:
+ Py_DECREF(list);
+ return NULL;
+}
+
+Py_LOCAL_INLINE(PyObject *)
+stringlib_split(PyObject* str_obj,
+ const STRINGLIB_CHAR* str, Py_ssize_t str_len,
+ const STRINGLIB_CHAR* sep, Py_ssize_t sep_len,
+ Py_ssize_t maxcount)
+{
+ Py_ssize_t i, j, pos, count=0;
+ PyObject *list, *sub;
+
+ if (sep_len == 0) {
+ PyErr_SetString(PyExc_ValueError, "empty separator");
+ return NULL;
+ }
+ else if (sep_len == 1)
+ return stringlib_split_char(str_obj, str, str_len, sep[0], maxcount);
+
+ list = PyList_New(PREALLOC_SIZE(maxcount));
+ if (list == NULL)
+ return NULL;
+
+ i = j = 0;
+ while (maxcount-- > 0) {
+ pos = fastsearch(str+i, str_len-i, sep, sep_len, -1, FAST_SEARCH);
+ if (pos < 0)
+ break;
+ j = i + pos;
+ SPLIT_ADD(str, i, j);
+ i = j + sep_len;
+ }
+#ifndef STRINGLIB_MUTABLE
+ if (count == 0 && STRINGLIB_CHECK_EXACT(str_obj)) {
+ /* No match in str_obj, so just use it as list[0] */
+ Py_INCREF(str_obj);
+ PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
+ count++;
+ } else
+#endif
+ {
+ SPLIT_ADD(str, i, str_len);
+ }
+ FIX_PREALLOC_SIZE(list);
+ return list;
+
+ onError:
+ Py_DECREF(list);
+ return NULL;
+}
+
+Py_LOCAL_INLINE(PyObject *)
+stringlib_rsplit_whitespace(PyObject* str_obj,
+ const STRINGLIB_CHAR* str, Py_ssize_t str_len,
+ Py_ssize_t maxcount)
+{
+ Py_ssize_t i, j, count=0;
+ PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
+ PyObject *sub;
+
+ if (list == NULL)
+ return NULL;
+
+ i = j = str_len - 1;
+ while (maxcount-- > 0) {
+ while (i >= 0 && STRINGLIB_ISSPACE(str[i]))
+ i--;
+ if (i < 0) break;
+ j = i; i--;
+ while (i >= 0 && !STRINGLIB_ISSPACE(str[i]))
+ i--;
+#ifndef STRINGLIB_MUTABLE
+ if (j == str_len - 1 && i < 0 && STRINGLIB_CHECK_EXACT(str_obj)) {
+ /* No whitespace in str_obj, so just use it as list[0] */
+ Py_INCREF(str_obj);
+ PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
+ count++;
+ break;
+ }
+#endif
+ SPLIT_ADD(str, i + 1, j + 1);
+ }
+
+ if (i >= 0) {
+ /* Only occurs when maxcount was reached */
+ /* Skip any remaining whitespace and copy to beginning of string */
+ while (i >= 0 && STRINGLIB_ISSPACE(str[i]))
+ i--;
+ if (i >= 0)
+ SPLIT_ADD(str, 0, i + 1);
+ }
+ FIX_PREALLOC_SIZE(list);
+ if (PyList_Reverse(list) < 0)
+ goto onError;
+ return list;
+
+ onError:
+ Py_DECREF(list);
+ return NULL;
+}
+
+Py_LOCAL_INLINE(PyObject *)
+stringlib_rsplit_char(PyObject* str_obj,
+ const STRINGLIB_CHAR* str, Py_ssize_t str_len,
+ const STRINGLIB_CHAR ch,
+ Py_ssize_t maxcount)
+{
+ Py_ssize_t i, j, count=0;
+ PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
+ PyObject *sub;
+
+ if (list == NULL)
+ return NULL;
+
+ i = j = str_len - 1;
+ while ((i >= 0) && (maxcount-- > 0)) {
+ for(; i >= 0; i--) {
+ if (str[i] == ch) {
+ SPLIT_ADD(str, i + 1, j + 1);
+ j = i = i - 1;
+ break;
+ }
+ }
+ }
+#ifndef STRINGLIB_MUTABLE
+ if (count == 0 && STRINGLIB_CHECK_EXACT(str_obj)) {
+ /* ch not in str_obj, so just use str_obj as list[0] */
+ Py_INCREF(str_obj);
+ PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
+ count++;
+ } else
+#endif
+ if (j >= -1) {
+ SPLIT_ADD(str, 0, j + 1);
+ }
+ FIX_PREALLOC_SIZE(list);
+ if (PyList_Reverse(list) < 0)
+ goto onError;
+ return list;
+
+ onError:
+ Py_DECREF(list);
+ return NULL;
+}
+
+Py_LOCAL_INLINE(PyObject *)
+stringlib_rsplit(PyObject* str_obj,
+ const STRINGLIB_CHAR* str, Py_ssize_t str_len,
+ const STRINGLIB_CHAR* sep, Py_ssize_t sep_len,
+ Py_ssize_t maxcount)
+{
+ Py_ssize_t j, pos, count=0;
+ PyObject *list, *sub;
+
+ if (sep_len == 0) {
+ PyErr_SetString(PyExc_ValueError, "empty separator");
+ return NULL;
+ }
+ else if (sep_len == 1)
+ return stringlib_rsplit_char(str_obj, str, str_len, sep[0], maxcount);
+
+ list = PyList_New(PREALLOC_SIZE(maxcount));
+ if (list == NULL)
+ return NULL;
+
+ j = str_len;
+ while (maxcount-- > 0) {
+ pos = fastsearch(str, j, sep, sep_len, -1, FAST_RSEARCH);
+ if (pos < 0)
+ break;
+ SPLIT_ADD(str, pos + sep_len, j);
+ j = pos;
+ }
+#ifndef STRINGLIB_MUTABLE
+ if (count == 0 && STRINGLIB_CHECK_EXACT(str_obj)) {
+ /* No match in str_obj, so just use it as list[0] */
+ Py_INCREF(str_obj);
+ PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
+ count++;
+ } else
+#endif
+ {
+ SPLIT_ADD(str, 0, j);
+ }
+ FIX_PREALLOC_SIZE(list);
+ if (PyList_Reverse(list) < 0)
+ goto onError;
+ return list;
+
+ onError:
+ Py_DECREF(list);
+ return NULL;
+}
+
+Py_LOCAL_INLINE(PyObject *)
+stringlib_splitlines(PyObject* str_obj,
+ const STRINGLIB_CHAR* str, Py_ssize_t str_len,
+ int keepends)
+{
+ /* This does not use the preallocated list because splitlines is
+ usually run with hundreds of newlines. The overhead of
+ switching between PyList_SET_ITEM and append causes about a
+ 2-3% slowdown for that common case. A smarter implementation
+ could move the if check out, so the SET_ITEMs are done first
+ and the appends only done when the prealloc buffer is full.
+ That's too much work for little gain.*/
+
+ register Py_ssize_t i;
+ register Py_ssize_t j;
+ PyObject *list = PyList_New(0);
+ PyObject *sub;
+
+ if (list == NULL)
+ return NULL;
+
+ for (i = j = 0; i < str_len; ) {
+ Py_ssize_t eol;
+
+ /* Find a line and append it */
+ while (i < str_len && !STRINGLIB_ISLINEBREAK(str[i]))
+ i++;
+
+ /* Skip the line break reading CRLF as one line break */
+ eol = i;
+ if (i < str_len) {
+ if (str[i] == '\r' && i + 1 < str_len && str[i+1] == '\n')
+ i += 2;
+ else
+ i++;
+ if (keepends)
+ eol = i;
+ }
+#ifndef STRINGLIB_MUTABLE
+ if (j == 0 && eol == str_len && STRINGLIB_CHECK_EXACT(str_obj)) {
+ /* No linebreak in str_obj, so just use it as list[0] */
+ if (PyList_Append(list, str_obj))
+ goto onError;
+ break;
+ }
+#endif
+ SPLIT_APPEND(str, j, eol);
+ j = i;
+ }
+ return list;
+
+ onError:
+ Py_DECREF(list);
+ return NULL;
+}
+
+#endif
diff --git a/Objects/stringlib/string_format.h b/Objects/stringlib/string_format.h
index b2095fd839..6f10727e24 100644
--- a/Objects/stringlib/string_format.h
+++ b/Objects/stringlib/string_format.h
@@ -499,13 +499,16 @@ get_field_object(SubString *input, PyObject *args, PyObject *kwargs,
PyObject *key = SubString_new_object(&first);
if (key == NULL)
goto error;
- if ((kwargs == NULL) || (obj = PyDict_GetItem(kwargs, key)) == NULL) {
+
+ /* Use PyObject_GetItem instead of PyDict_GetItem because this
+ code is no longer just used with kwargs. It might be passed
+ a non-dict when called through format_map. */
+ if ((kwargs == NULL) || (obj = PyObject_GetItem(kwargs, key)) == NULL) {
PyErr_SetObject(PyExc_KeyError, key);
Py_DECREF(key);
goto error;
}
Py_DECREF(key);
- Py_INCREF(obj);
}
else {
/* look up in args */
@@ -1039,6 +1042,11 @@ do_string_format(PyObject *self, PyObject *args, PyObject *kwargs)
return build_string(&input, args, kwargs, recursion_depth, &auto_number);
}
+static PyObject *
+do_string_format_map(PyObject *self, PyObject *obj)
+{
+ return do_string_format(self, NULL, obj);
+}
/************************************************************************/
@@ -1180,10 +1188,15 @@ static PyTypeObject PyFormatterIter_Type = {
describing the parsed elements. It's a wrapper around
stringlib/string_format.h's MarkupIterator */
static PyObject *
-formatter_parser(STRINGLIB_OBJECT *self)
+formatter_parser(PyObject *ignored, STRINGLIB_OBJECT *self)
{
formatteriterobject *it;
+ if (!PyUnicode_Check(self)) {
+ PyErr_Format(PyExc_TypeError, "expected str, got %s", Py_TYPE(self)->tp_name);
+ return NULL;
+ }
+
it = PyObject_New(formatteriterobject, &PyFormatterIter_Type);
if (it == NULL)
return NULL;
@@ -1315,7 +1328,7 @@ static PyTypeObject PyFieldNameIter_Type = {
field_name_split. The iterator it returns is a
FieldNameIterator */
static PyObject *
-formatter_field_name_split(STRINGLIB_OBJECT *self)
+formatter_field_name_split(PyObject *ignored, STRINGLIB_OBJECT *self)
{
SubString first;
Py_ssize_t first_idx;
@@ -1324,6 +1337,11 @@ formatter_field_name_split(STRINGLIB_OBJECT *self)
PyObject *first_obj = NULL;
PyObject *result = NULL;
+ if (!PyUnicode_Check(self)) {
+ PyErr_Format(PyExc_TypeError, "expected str, got %s", Py_TYPE(self)->tp_name);
+ return NULL;
+ }
+
it = PyObject_New(fieldnameiterobject, &PyFieldNameIter_Type);
if (it == NULL)
return NULL;
diff --git a/Objects/stringlib/stringdefs.h b/Objects/stringlib/stringdefs.h
index a5672c7e6b..1c49426ff6 100644
--- a/Objects/stringlib/stringdefs.h
+++ b/Objects/stringlib/stringdefs.h
@@ -11,6 +11,8 @@
#define STRINGLIB_TYPE_NAME "string"
#define STRINGLIB_PARSE_CODE "S"
#define STRINGLIB_EMPTY nullstring
+#define STRINGLIB_ISSPACE Py_ISSPACE
+#define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r'))
#define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))
#define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1)
#define STRINGLIB_TOUPPER Py_TOUPPER
@@ -21,7 +23,7 @@
#define STRINGLIB_NEW PyBytes_FromStringAndSize
#define STRINGLIB_RESIZE _PyBytes_Resize
#define STRINGLIB_CHECK PyBytes_Check
-#define STRINGLIB_CMP memcmp
+#define STRINGLIB_CHECK_EXACT PyBytes_CheckExact
#define STRINGLIB_TOSTR PyObject_Str
#define STRINGLIB_GROUPING _PyBytes_InsertThousandsGrouping
#define STRINGLIB_GROUPING_LOCALE _PyBytes_InsertThousandsGroupingLocale
diff --git a/Objects/stringlib/transmogrify.h b/Objects/stringlib/transmogrify.h
index 4390e2229a..1e132e54aa 100644
--- a/Objects/stringlib/transmogrify.h
+++ b/Objects/stringlib/transmogrify.h
@@ -1,13 +1,6 @@
/* NOTE: this API is -ONLY- for use with single byte character strings. */
/* Do not use it with Unicode. */
-#include "bytes_methods.h"
-
-#ifndef STRINGLIB_MUTABLE
-#warning "STRINGLIB_MUTABLE not defined before #include, assuming 0"
-#define STRINGLIB_MUTABLE 0
-#endif
-
/* the more complicated methods. parts of these should be pulled out into the
shared code in bytes_methods.c to cut down on duplicate code bloat. */
@@ -25,10 +18,10 @@ stringlib_expandtabs(PyObject *self, PyObject *args)
size_t i, j;
PyObject *u;
int tabsize = 8;
-
+
if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize))
return NULL;
-
+
/* First pass: determine size of output string */
i = j = 0;
e = STRINGLIB_STR(self) + STRINGLIB_LEN(self);
@@ -55,20 +48,20 @@ stringlib_expandtabs(PyObject *self, PyObject *args)
}
}
}
-
+
if ((i + j) > PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError, "result is too long");
return NULL;
}
-
+
/* Second pass: create output string and fill it */
u = STRINGLIB_NEW(NULL, i + j);
if (!u)
return NULL;
-
+
j = 0;
q = STRINGLIB_STR(u);
-
+
for (p = STRINGLIB_STR(self); p < e; p++)
if (*p == '\t') {
if (tabsize > 0) {
@@ -84,7 +77,7 @@ stringlib_expandtabs(PyObject *self, PyObject *args)
if (*p == '\n' || *p == '\r')
j = 0;
}
-
+
return u;
}
@@ -110,16 +103,16 @@ pad(PyObject *self, Py_ssize_t left, Py_ssize_t right, char fill)
}
u = STRINGLIB_NEW(NULL,
- left + STRINGLIB_LEN(self) + right);
+ left + STRINGLIB_LEN(self) + right);
if (u) {
if (left)
memset(STRINGLIB_STR(u), fill, left);
Py_MEMCPY(STRINGLIB_STR(u) + left,
- STRINGLIB_STR(self),
- STRINGLIB_LEN(self));
+ STRINGLIB_STR(self),
+ STRINGLIB_LEN(self));
if (right)
memset(STRINGLIB_STR(u) + left + STRINGLIB_LEN(self),
- fill, right);
+ fill, right);
}
return u;
@@ -269,87 +262,3 @@ stringlib_zfill(PyObject *self, PyObject *args)
return (PyObject*) s;
}
-
-
-#define _STRINGLIB_SPLIT_APPEND(data, left, right) \
- str = STRINGLIB_NEW((data) + (left), \
- (right) - (left)); \
- if (str == NULL) \
- goto onError; \
- if (PyList_Append(list, str)) { \
- Py_DECREF(str); \
- goto onError; \
- } \
- else \
- Py_DECREF(str);
-
-PyDoc_STRVAR(splitlines__doc__,
-"B.splitlines([keepends]) -> list of lines\n\
-\n\
-Return a list of the lines in B, breaking at line boundaries.\n\
-Line breaks are not included in the resulting list unless keepends\n\
-is given and true.");
-
-static PyObject*
-stringlib_splitlines(PyObject *self, PyObject *args)
-{
- register Py_ssize_t i;
- register Py_ssize_t j;
- Py_ssize_t len;
- int keepends = 0;
- PyObject *list;
- PyObject *str;
- char *data;
-
- if (!PyArg_ParseTuple(args, "|i:splitlines", &keepends))
- return NULL;
-
- data = STRINGLIB_STR(self);
- len = STRINGLIB_LEN(self);
-
- /* This does not use the preallocated list because splitlines is
- usually run with hundreds of newlines. The overhead of
- switching between PyList_SET_ITEM and append causes about a
- 2-3% slowdown for that common case. A smarter implementation
- could move the if check out, so the SET_ITEMs are done first
- and the appends only done when the prealloc buffer is full.
- That's too much work for little gain.*/
-
- list = PyList_New(0);
- if (!list)
- goto onError;
-
- for (i = j = 0; i < len; ) {
- Py_ssize_t eol;
-
- /* Find a line and append it */
- while (i < len && data[i] != '\n' && data[i] != '\r')
- i++;
-
- /* Skip the line break reading CRLF as one line break */
- eol = i;
- if (i < len) {
- if (data[i] == '\r' && i + 1 < len &&
- data[i+1] == '\n')
- i += 2;
- else
- i++;
- if (keepends)
- eol = i;
- }
- _STRINGLIB_SPLIT_APPEND(data, j, eol);
- j = i;
- }
- if (j < len) {
- _STRINGLIB_SPLIT_APPEND(data, j, len);
- }
-
- return list;
-
- onError:
- Py_XDECREF(list);
- return NULL;
-}
-
-#undef _STRINGLIB_SPLIT_APPEND
-
diff --git a/Objects/stringlib/unicodedefs.h b/Objects/stringlib/unicodedefs.h
index 366acfe001..09dae6dc9e 100644
--- a/Objects/stringlib/unicodedefs.h
+++ b/Objects/stringlib/unicodedefs.h
@@ -11,6 +11,8 @@
#define STRINGLIB_TYPE_NAME "unicode"
#define STRINGLIB_PARSE_CODE "U"
#define STRINGLIB_EMPTY unicode_empty
+#define STRINGLIB_ISSPACE Py_UNICODE_ISSPACE
+#define STRINGLIB_ISLINEBREAK BLOOM_LINEBREAK
#define STRINGLIB_ISDECIMAL Py_UNICODE_ISDECIMAL
#define STRINGLIB_TODECIMAL Py_UNICODE_TODECIMAL
#define STRINGLIB_TOUPPER Py_UNICODE_TOUPPER
@@ -21,6 +23,7 @@
#define STRINGLIB_NEW PyUnicode_FromUnicode
#define STRINGLIB_RESIZE PyUnicode_Resize
#define STRINGLIB_CHECK PyUnicode_Check
+#define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact
#define STRINGLIB_GROUPING _PyUnicode_InsertThousandsGrouping
#define STRINGLIB_GROUPING_LOCALE _PyUnicode_InsertThousandsGroupingLocale
@@ -34,23 +37,4 @@
#define STRINGLIB_WANT_CONTAINS_OBJ 1
-/* STRINGLIB_CMP was defined as:
-
-Py_LOCAL_INLINE(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));
-}
-
-but unfortunately that gives a error if the function isn't used in a file that
-includes this file. So, reluctantly convert it to a macro instead. */
-
-#define STRINGLIB_CMP(str, other, len) \
- (((str)[0] != (other)[0]) ? \
- 1 : \
- memcmp((void*) (str), (void*) (other), (len) * sizeof(Py_UNICODE)))
-
-
#endif /* !STRINGLIB_UNICODEDEFS_H */
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 7031225cb0..ef17f49a31 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -3,7 +3,6 @@
#include "Python.h"
#include "structmember.h"
-#include "structseq.h"
static char visible_length_key[] = "n_sequence_fields";
static char real_length_key[] = "n_fields";
@@ -30,113 +29,42 @@ PyObject *
PyStructSequence_New(PyTypeObject *type)
{
PyStructSequence *obj;
+ Py_ssize_t size = REAL_SIZE_TP(type), i;
- obj = PyObject_New(PyStructSequence, type);
+ obj = PyObject_GC_NewVar(PyStructSequence, type, size);
if (obj == NULL)
return NULL;
+ /* Hack the size of the variable object, so invisible fields don't appear
+ to Python code. */
Py_SIZE(obj) = VISIBLE_SIZE_TP(type);
+ for (i = 0; i < size; i++)
+ obj->ob_item[i] = NULL;
- return (PyObject*) obj;
+ return (PyObject*)obj;
}
-static void
-structseq_dealloc(PyStructSequence *obj)
-{
- Py_ssize_t i, size;
-
- size = REAL_SIZE(obj);
- for (i = 0; i < size; ++i) {
- Py_XDECREF(obj->ob_item[i]);
- }
- PyObject_Del(obj);
-}
-
-static Py_ssize_t
-structseq_length(PyStructSequence *obj)
+void
+PyStructSequence_SetItem(PyObject* op, Py_ssize_t i, PyObject* v)
{
- return VISIBLE_SIZE(obj);
+ PyStructSequence_SET_ITEM(op, i, v);
}
-static PyObject*
-structseq_item(PyStructSequence *obj, Py_ssize_t i)
+PyObject*
+PyStructSequence_GetItem(PyObject* op, Py_ssize_t i)
{
- if (i < 0 || i >= VISIBLE_SIZE(obj)) {
- PyErr_SetString(PyExc_IndexError, "tuple index out of range");
- return NULL;
- }
- Py_INCREF(obj->ob_item[i]);
- return obj->ob_item[i];
+ return PyStructSequence_GET_ITEM(op, i);
}
-static PyObject*
-structseq_slice(PyStructSequence *obj, Py_ssize_t low, Py_ssize_t high)
-{
- PyTupleObject *np;
- Py_ssize_t i;
-
- if (low < 0)
- low = 0;
- if (high > VISIBLE_SIZE(obj))
- high = VISIBLE_SIZE(obj);
- if (high < low)
- high = low;
- np = (PyTupleObject *)PyTuple_New(high-low);
- if (np == NULL)
- return NULL;
- for(i = low; i < high; ++i) {
- PyObject *v = obj->ob_item[i];
- Py_INCREF(v);
- PyTuple_SET_ITEM(np, i-low, v);
- }
- return (PyObject *) np;
-}
-
-static PyObject *
-structseq_subscript(PyStructSequence *self, PyObject *item)
+static void
+structseq_dealloc(PyStructSequence *obj)
{
- if (PyIndex_Check(item)) {
- Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
- if (i == -1 && PyErr_Occurred())
- return NULL;
-
- if (i < 0)
- i += VISIBLE_SIZE(self);
-
- if (i < 0 || i >= VISIBLE_SIZE(self)) {
- PyErr_SetString(PyExc_IndexError,
- "tuple index out of range");
- return NULL;
- }
- Py_INCREF(self->ob_item[i]);
- return self->ob_item[i];
- }
- else if (PySlice_Check(item)) {
- Py_ssize_t start, stop, step, slicelen, cur, i;
- PyObject *result;
-
- if (PySlice_GetIndicesEx((PySliceObject *)item,
- VISIBLE_SIZE(self), &start, &stop,
- &step, &slicelen) < 0) {
- return NULL;
- }
- if (slicelen <= 0)
- return PyTuple_New(0);
- result = PyTuple_New(slicelen);
- if (result == NULL)
- return NULL;
- for (cur = start, i = 0; i < slicelen;
- cur += step, i++) {
- PyObject *v = self->ob_item[cur];
- Py_INCREF(v);
- PyTuple_SET_ITEM(result, i, v);
- }
- return result;
- }
- else {
- PyErr_SetString(PyExc_TypeError,
- "structseq index must be integer");
- return NULL;
+ Py_ssize_t i, size;
+
+ size = REAL_SIZE(obj);
+ for (i = 0; i < size; ++i) {
+ Py_XDECREF(obj->ob_item[i]);
}
+ PyObject_GC_Del(obj);
}
static PyObject *
@@ -223,11 +151,6 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return (PyObject*) res;
}
-static PyObject *
-make_tuple(PyStructSequence *obj)
-{
- return structseq_slice(obj, 0, VISIBLE_SIZE(obj));
-}
static PyObject *
structseq_repr(PyStructSequence *obj)
@@ -236,7 +159,6 @@ structseq_repr(PyStructSequence *obj)
#define REPR_BUFFER_SIZE 512
#define TYPE_MAXSIZE 100
- PyObject *tup;
PyTypeObject *typ = Py_TYPE(obj);
int i, removelast = 0;
Py_ssize_t len;
@@ -246,10 +168,6 @@ structseq_repr(PyStructSequence *obj)
/* pointer to end of writeable buffer; safes space for "...)\0" */
endofbuf= &buf[REPR_BUFFER_SIZE-5];
- if ((tup = make_tuple(obj)) == NULL) {
- return NULL;
- }
-
/* "typename(", limited to TYPE_MAXSIZE */
len = strlen(typ->tp_name) > TYPE_MAXSIZE ? TYPE_MAXSIZE :
strlen(typ->tp_name);
@@ -262,19 +180,17 @@ structseq_repr(PyStructSequence *obj)
char *cname, *crepr;
cname = typ->tp_members[i].name;
-
- val = PyTuple_GetItem(tup, i);
- if (cname == NULL || val == NULL) {
+ if (cname == NULL) {
+ PyErr_Format(PyExc_SystemError, "In structseq_repr(), member %d name is NULL"
+ " for type %.500s", i, typ->tp_name);
return NULL;
}
+ val = PyStructSequence_GET_ITEM(obj, i);
repr = PyObject_Repr(val);
- if (repr == NULL) {
- Py_DECREF(tup);
+ if (repr == NULL)
return NULL;
- }
crepr = _PyUnicode_AsString(repr);
if (crepr == NULL) {
- Py_DECREF(tup);
Py_DECREF(repr);
return NULL;
}
@@ -300,7 +216,6 @@ structseq_repr(PyStructSequence *obj)
break;
}
}
- Py_DECREF(tup);
if (removelast) {
/* overwrite last ", " */
pbuf-=2;
@@ -312,62 +227,6 @@ structseq_repr(PyStructSequence *obj)
}
static PyObject *
-structseq_concat(PyStructSequence *obj, PyObject *b)
-{
- PyObject *tup, *result;
- tup = make_tuple(obj);
- result = PySequence_Concat(tup, b);
- Py_DECREF(tup);
- return result;
-}
-
-static PyObject *
-structseq_repeat(PyStructSequence *obj, Py_ssize_t n)
-{
- PyObject *tup, *result;
- tup = make_tuple(obj);
- result = PySequence_Repeat(tup, n);
- Py_DECREF(tup);
- return result;
-}
-
-static int
-structseq_contains(PyStructSequence *obj, PyObject *o)
-{
- PyObject *tup;
- int result;
- tup = make_tuple(obj);
- if (!tup)
- return -1;
- result = PySequence_Contains(tup, o);
- Py_DECREF(tup);
- return result;
-}
-
-static long
-structseq_hash(PyObject *obj)
-{
- PyObject *tup;
- long result;
- tup = make_tuple((PyStructSequence*) obj);
- if (!tup)
- return -1;
- result = PyObject_Hash(tup);
- Py_DECREF(tup);
- return result;
-}
-
-static PyObject *
-structseq_richcompare(PyObject *obj, PyObject *o2, int op)
-{
- PyObject *tup, *result;
- tup = make_tuple((PyStructSequence*) obj);
- result = PyObject_RichCompare(tup, o2, op);
- Py_DECREF(tup);
- return result;
-}
-
-static PyObject *
structseq_reduce(PyStructSequence* self)
{
PyObject* tup;
@@ -409,33 +268,16 @@ structseq_reduce(PyStructSequence* self)
return result;
}
-static PySequenceMethods structseq_as_sequence = {
- (lenfunc)structseq_length,
- (binaryfunc)structseq_concat, /* sq_concat */
- (ssizeargfunc)structseq_repeat, /* sq_repeat */
- (ssizeargfunc)structseq_item, /* sq_item */
- 0, /* sq_slice */
- 0, /* sq_ass_item */
- 0, /* sq_ass_slice */
- (objobjproc)structseq_contains, /* sq_contains */
-};
-
-static PyMappingMethods structseq_as_mapping = {
- (lenfunc)structseq_length,
- (binaryfunc)structseq_subscript,
-};
-
static PyMethodDef structseq_methods[] = {
- {"__reduce__", (PyCFunction)structseq_reduce,
- METH_NOARGS, NULL},
+ {"__reduce__", (PyCFunction)structseq_reduce, METH_NOARGS, NULL},
{NULL, NULL}
};
static PyTypeObject _struct_sequence_template = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
NULL, /* tp_name */
- 0, /* tp_basicsize */
- 0, /* tp_itemsize */
+ sizeof(PyStructSequence) - sizeof(PyObject *), /* tp_basicsize */
+ sizeof(PyObject *), /* tp_itemsize */
(destructor)structseq_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
@@ -443,19 +285,19 @@ static PyTypeObject _struct_sequence_template = {
0, /* tp_reserved */
(reprfunc)structseq_repr, /* tp_repr */
0, /* tp_as_number */
- &structseq_as_sequence, /* tp_as_sequence */
- &structseq_as_mapping, /* tp_as_mapping */
- structseq_hash, /* tp_hash */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /* tp_flags */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
NULL, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
- structseq_richcompare, /* tp_richcompare */
+ 0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
@@ -494,11 +336,9 @@ PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc)
n_members = i;
memcpy(type, &_struct_sequence_template, sizeof(PyTypeObject));
+ type->tp_base = &PyTuple_Type;
type->tp_name = desc->name;
type->tp_doc = desc->doc;
- type->tp_basicsize = sizeof(PyStructSequence)+
- sizeof(PyObject*)*(n_members-1);
- type->tp_itemsize = 0;
members = PyMem_NEW(PyMemberDef, n_members-n_unnamed_members+1);
if (members == NULL)
@@ -537,3 +377,11 @@ PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc)
SET_DICT_FROM_INT(real_length_key, n_members);
SET_DICT_FROM_INT(unnamed_fields_key, n_unnamed_members);
}
+
+PyTypeObject*
+PyStructSequence_NewType(PyStructSequence_Desc *desc)
+{
+ PyTypeObject *result = (PyTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
+ PyStructSequence_InitType(result, desc);
+ return result;
+}
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index aa3be821bb..72b79c917a 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -312,13 +312,13 @@ Done:
1330111, 1412633, 1165069, 1247599, 1495177, 1577699
*/
-static long
+static Py_hash_t
tuplehash(PyTupleObject *v)
{
- register long x, y;
+ register Py_hash_t x, y;
register Py_ssize_t len = Py_SIZE(v);
register PyObject **p;
- long mult = 1000003L;
+ Py_hash_t mult = 1000003L;
x = 0x345678L;
p = v->ob_item;
while (--len >= 0) {
@@ -327,7 +327,7 @@ tuplehash(PyTupleObject *v)
return -1;
x = (x ^ y) * mult;
/* the cast might truncate len; that doesn't change hash stability */
- mult += (long)(82520L + len + len);
+ mult += (Py_hash_t)(82520L + len + len);
}
x += 97531L;
if (x == -1)
@@ -689,7 +689,7 @@ tuplesubscript(PyTupleObject* self, PyObject* item)
PyObject* it;
PyObject **src, **dest;
- if (PySlice_GetIndicesEx((PySliceObject*)item,
+ if (PySlice_GetIndicesEx(item,
PyTuple_GET_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 310a56c4e5..8eaf51fb39 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1359,8 +1359,14 @@ consistent method resolution\norder (MRO) for bases");
i = 0;
while (PyDict_Next(set, &i, &k, &v) && (size_t)off < sizeof(buf)) {
PyObject *name = class_name(k);
- off += PyOS_snprintf(buf + off, sizeof(buf) - off, " %s",
- name ? _PyUnicode_AsString(name) : "?");
+ char *name_str;
+ if (name != NULL) {
+ name_str = _PyUnicode_AsString(name);
+ if (name_str == NULL)
+ name_str = "?";
+ } else
+ name_str = "?";
+ off += PyOS_snprintf(buf + off, sizeof(buf) - off, " %s", name_str);
Py_XDECREF(name);
if (--n && (size_t)(off+1) < sizeof(buf)) {
buf[off++] = ',';
@@ -1898,6 +1904,12 @@ type_init(PyObject *cls, PyObject *args, PyObject *kwds)
return res;
}
+long
+PyType_GetFlags(PyTypeObject *type)
+{
+ return type->tp_flags;
+}
+
static PyObject *
type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
{
@@ -2232,6 +2244,10 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
for (i = 0; i < nslots; i++, mp++) {
mp->name = _PyUnicode_AsString(
PyTuple_GET_ITEM(slots, i));
+ if (mp->name == NULL) {
+ Py_DECREF(type);
+ return NULL;
+ }
mp->type = T_OBJECT_EX;
mp->offset = slotoffset;
@@ -2303,6 +2319,57 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
return (PyObject *)type;
}
+static short slotoffsets[] = {
+ -1, /* invalid slot */
+#include "typeslots.inc"
+};
+
+PyObject* PyType_FromSpec(PyType_Spec *spec)
+{
+ PyHeapTypeObject *res = (PyHeapTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
+ char *res_start = (char*)res;
+ PyType_Slot *slot;
+
+ if (res == NULL)
+ return NULL;
+ res->ht_name = PyUnicode_FromString(spec->name);
+ if (!res->ht_name)
+ goto fail;
+ res->ht_type.tp_name = _PyUnicode_AsString(res->ht_name);
+ if (!res->ht_type.tp_name)
+ goto fail;
+
+ res->ht_type.tp_basicsize = spec->basicsize;
+ res->ht_type.tp_itemsize = spec->itemsize;
+ res->ht_type.tp_flags = spec->flags | Py_TPFLAGS_HEAPTYPE;
+
+ for (slot = spec->slots; slot->slot; slot++) {
+ if (slot->slot >= sizeof(slotoffsets)/sizeof(slotoffsets[0])) {
+ PyErr_SetString(PyExc_RuntimeError, "invalid slot offset");
+ goto fail;
+ }
+ *(void**)(res_start + slotoffsets[slot->slot]) = slot->pfunc;
+
+ /* need to make a copy of the docstring slot, which usually
+ points to a static string literal */
+ if (slot->slot == Py_tp_doc) {
+ ssize_t len = strlen(slot->pfunc)+1;
+ char *tp_doc = PyObject_MALLOC(len);
+ if (tp_doc == NULL)
+ goto fail;
+ memcpy(tp_doc, slot->pfunc, len);
+ res->ht_type.tp_doc = tp_doc;
+ }
+ }
+
+ return (PyObject*)res;
+
+ fail:
+ Py_DECREF(res);
+ return NULL;
+}
+
+
/* Internal API to look for a name through the MRO.
This returns a borrowed reference, and doesn't set an exception! */
PyObject *
@@ -3309,23 +3376,32 @@ object_format(PyObject *self, PyObject *args)
PyObject *format_spec;
PyObject *self_as_str = NULL;
PyObject *result = NULL;
- PyObject *format_meth = NULL;
if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
return NULL;
self_as_str = PyObject_Str(self);
if (self_as_str != NULL) {
- /* find the format function */
- format_meth = PyObject_GetAttrString(self_as_str, "__format__");
- if (format_meth != NULL) {
- /* and call it */
- result = PyObject_CallFunctionObjArgs(format_meth, format_spec, NULL);
- }
- }
-
+ /* Issue 7994: If we're converting to a string, we
+ should reject format specifications */
+ if (PyUnicode_GET_SIZE(format_spec) > 0) {
+ if (PyErr_WarnEx(PyExc_PendingDeprecationWarning,
+ "object.__format__ with a non-empty format "
+ "string is deprecated", 1) < 0) {
+ goto done;
+ }
+ /* Eventually this will become an error:
+ PyErr_Format(PyExc_TypeError,
+ "non-empty format string passed to object.__format__");
+ goto done;
+ */
+ }
+
+ result = PyObject_Format(self_as_str, format_spec);
+ }
+
+done:
Py_XDECREF(self_as_str);
- Py_XDECREF(format_meth);
return result;
}
@@ -3483,11 +3559,8 @@ add_getset(PyTypeObject *type, PyGetSetDef *gsp)
static void
inherit_special(PyTypeObject *type, PyTypeObject *base)
{
- Py_ssize_t oldsize, newsize;
/* Copying basicsize is connected to the GC flags */
- oldsize = base->tp_basicsize;
- newsize = type->tp_basicsize ? type->tp_basicsize : oldsize;
if (!(type->tp_flags & Py_TPFLAGS_HAVE_GC) &&
(base->tp_flags & Py_TPFLAGS_HAVE_GC) &&
(!type->tp_traverse && !type->tp_clear)) {
@@ -3514,7 +3587,8 @@ inherit_special(PyTypeObject *type, PyTypeObject *base)
type->tp_new = base->tp_new;
}
}
- type->tp_basicsize = newsize;
+ if (type->tp_basicsize == 0)
+ type->tp_basicsize = base->tp_basicsize;
/* Copy other non-function slots */
@@ -3901,13 +3975,10 @@ PyType_Ready(PyTypeObject *type)
tp_reserved) but not tp_richcompare. */
if (type->tp_reserved && !type->tp_richcompare) {
int error;
- char msg[240];
- PyOS_snprintf(msg, sizeof(msg),
- "Type %.100s defines tp_reserved (formerly "
- "tp_compare) but not tp_richcompare. "
- "Comparisons may not behave as intended.",
- type->tp_name);
- error = PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1);
+ error = PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "Type %.100s defines tp_reserved (formerly tp_compare) "
+ "but not tp_richcompare. Comparisons may not behave as intended.",
+ type->tp_name);
if (error == -1)
goto error;
}
@@ -4306,14 +4377,14 @@ static PyObject *
wrap_hashfunc(PyObject *self, PyObject *args, void *wrapped)
{
hashfunc func = (hashfunc)wrapped;
- long res;
+ Py_hash_t res;
if (!check_num_args(args, 0))
return NULL;
res = (*func)(self);
if (res == -1 && PyErr_Occurred())
return NULL;
- return PyLong_FromLong(res);
+ return PyLong_FromSsize_t(res);
}
static PyObject *
@@ -4910,12 +4981,12 @@ slot_tp_str(PyObject *self)
}
}
-static long
+static Py_hash_t
slot_tp_hash(PyObject *self)
{
PyObject *func, *res;
static PyObject *hash_str;
- long h;
+ Py_ssize_t h;
func = lookup_method(self, "__hash__", &hash_str);
@@ -4932,14 +5003,30 @@ slot_tp_hash(PyObject *self)
Py_DECREF(func);
if (res == NULL)
return -1;
- if (PyLong_Check(res))
+
+ if (!PyLong_Check(res)) {
+ PyErr_SetString(PyExc_TypeError,
+ "__hash__ method should return an integer");
+ return -1;
+ }
+ /* Transform the PyLong `res` to a Py_hash_t `h`. For an existing
+ hashable Python object x, hash(x) will always lie within the range of
+ Py_hash_t. Therefore our transformation must preserve values that
+ already lie within this range, to ensure that if x.__hash__() returns
+ hash(y) then hash(x) == hash(y). */
+ h = PyLong_AsSsize_t(res);
+ if (h == -1 && PyErr_Occurred()) {
+ /* res was not within the range of a Py_hash_t, so we're free to
+ use any sufficiently bit-mixing transformation;
+ long.__hash__ will do nicely. */
+ PyErr_Clear();
h = PyLong_Type.tp_hash(res);
- else
- h = PyLong_AsLong(res);
+ }
+ /* -1 is reserved for errors. */
+ if (h == -1)
+ h = -2;
Py_DECREF(res);
- if (h == -1 && !PyErr_Occurred())
- h = -2;
- return h;
+ return h;
}
static PyObject *
@@ -5078,7 +5165,7 @@ static char *name_op[] = {
};
static PyObject *
-half_richcompare(PyObject *self, PyObject *other, int op)
+slot_tp_richcompare(PyObject *self, PyObject *other, int op)
{
PyObject *func, *args, *res;
static PyObject *op_str[6];
@@ -5101,28 +5188,6 @@ half_richcompare(PyObject *self, PyObject *other, int op)
}
static PyObject *
-slot_tp_richcompare(PyObject *self, PyObject *other, int op)
-{
- PyObject *res;
-
- if (Py_TYPE(self)->tp_richcompare == slot_tp_richcompare) {
- res = half_richcompare(self, other, op);
- if (res != Py_NotImplemented)
- return res;
- Py_DECREF(res);
- }
- if (Py_TYPE(other)->tp_richcompare == slot_tp_richcompare) {
- res = half_richcompare(other, self, _Py_SwappedOp[op]);
- if (res != Py_NotImplemented) {
- return res;
- }
- Py_DECREF(res);
- }
- Py_INCREF(Py_NotImplemented);
- return Py_NotImplemented;
-}
-
-static PyObject *
slot_tp_iter(PyObject *self)
{
PyObject *func, *res;
@@ -5658,7 +5723,7 @@ update_one_slot(PyTypeObject *type, slotdef *p)
generic = p->function;
d = (PyWrapperDescrObject *)descr;
if (d->d_base->wrapper == p->wrapper &&
- PyType_IsSubtype(type, d->d_type))
+ PyType_IsSubtype(type, PyDescr_TYPE(d)))
{
if (specific == NULL ||
specific == d->d_wrapped)
@@ -6162,7 +6227,7 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
and first local variable on the stack. */
PyFrameObject *f = PyThreadState_GET()->frame;
PyCodeObject *co = f->f_code;
- int i, n;
+ Py_ssize_t i, n;
if (co == NULL) {
PyErr_SetString(PyExc_SystemError,
"super(): no code object");
diff --git a/Objects/typeslots.inc b/Objects/typeslots.inc
new file mode 100644
index 0000000000..5186dcf834
--- /dev/null
+++ b/Objects/typeslots.inc
@@ -0,0 +1,75 @@
+/* Generated by typeslots.py $Revision$ */
+0,
+0,
+offsetof(PyHeapTypeObject, as_mapping.mp_ass_subscript),
+offsetof(PyHeapTypeObject, as_mapping.mp_length),
+offsetof(PyHeapTypeObject, as_mapping.mp_subscript),
+offsetof(PyHeapTypeObject, as_number.nb_absolute),
+offsetof(PyHeapTypeObject, as_number.nb_add),
+offsetof(PyHeapTypeObject, as_number.nb_and),
+offsetof(PyHeapTypeObject, as_number.nb_bool),
+offsetof(PyHeapTypeObject, as_number.nb_divmod),
+offsetof(PyHeapTypeObject, as_number.nb_float),
+offsetof(PyHeapTypeObject, as_number.nb_floor_divide),
+offsetof(PyHeapTypeObject, as_number.nb_index),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_add),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_and),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_floor_divide),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_lshift),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_multiply),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_or),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_power),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_remainder),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_rshift),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_subtract),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_true_divide),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_xor),
+offsetof(PyHeapTypeObject, as_number.nb_int),
+offsetof(PyHeapTypeObject, as_number.nb_invert),
+offsetof(PyHeapTypeObject, as_number.nb_lshift),
+offsetof(PyHeapTypeObject, as_number.nb_multiply),
+offsetof(PyHeapTypeObject, as_number.nb_negative),
+offsetof(PyHeapTypeObject, as_number.nb_or),
+offsetof(PyHeapTypeObject, as_number.nb_positive),
+offsetof(PyHeapTypeObject, as_number.nb_power),
+offsetof(PyHeapTypeObject, as_number.nb_remainder),
+offsetof(PyHeapTypeObject, as_number.nb_rshift),
+offsetof(PyHeapTypeObject, as_number.nb_subtract),
+offsetof(PyHeapTypeObject, as_number.nb_true_divide),
+offsetof(PyHeapTypeObject, as_number.nb_xor),
+offsetof(PyHeapTypeObject, as_sequence.sq_ass_item),
+offsetof(PyHeapTypeObject, as_sequence.sq_concat),
+offsetof(PyHeapTypeObject, as_sequence.sq_contains),
+offsetof(PyHeapTypeObject, as_sequence.sq_inplace_concat),
+offsetof(PyHeapTypeObject, as_sequence.sq_inplace_repeat),
+offsetof(PyHeapTypeObject, as_sequence.sq_item),
+offsetof(PyHeapTypeObject, as_sequence.sq_length),
+offsetof(PyHeapTypeObject, as_sequence.sq_repeat),
+offsetof(PyHeapTypeObject, ht_type.tp_alloc),
+offsetof(PyHeapTypeObject, ht_type.tp_base),
+offsetof(PyHeapTypeObject, ht_type.tp_bases),
+offsetof(PyHeapTypeObject, ht_type.tp_call),
+offsetof(PyHeapTypeObject, ht_type.tp_clear),
+offsetof(PyHeapTypeObject, ht_type.tp_dealloc),
+offsetof(PyHeapTypeObject, ht_type.tp_del),
+offsetof(PyHeapTypeObject, ht_type.tp_descr_get),
+offsetof(PyHeapTypeObject, ht_type.tp_descr_set),
+offsetof(PyHeapTypeObject, ht_type.tp_doc),
+offsetof(PyHeapTypeObject, ht_type.tp_getattr),
+offsetof(PyHeapTypeObject, ht_type.tp_getattro),
+offsetof(PyHeapTypeObject, ht_type.tp_hash),
+offsetof(PyHeapTypeObject, ht_type.tp_init),
+offsetof(PyHeapTypeObject, ht_type.tp_is_gc),
+offsetof(PyHeapTypeObject, ht_type.tp_iter),
+offsetof(PyHeapTypeObject, ht_type.tp_iternext),
+offsetof(PyHeapTypeObject, ht_type.tp_methods),
+offsetof(PyHeapTypeObject, ht_type.tp_new),
+offsetof(PyHeapTypeObject, ht_type.tp_repr),
+offsetof(PyHeapTypeObject, ht_type.tp_richcompare),
+offsetof(PyHeapTypeObject, ht_type.tp_setattr),
+offsetof(PyHeapTypeObject, ht_type.tp_setattro),
+offsetof(PyHeapTypeObject, ht_type.tp_str),
+offsetof(PyHeapTypeObject, ht_type.tp_traverse),
+offsetof(PyHeapTypeObject, ht_type.tp_members),
+offsetof(PyHeapTypeObject, ht_type.tp_getset),
+offsetof(PyHeapTypeObject, ht_type.tp_free),
diff --git a/Objects/typeslots.py b/Objects/typeslots.py
new file mode 100644
index 0000000000..2e00c80fbb
--- /dev/null
+++ b/Objects/typeslots.py
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+# Usage: typeslots.py < Include/typeslots.h > typeslots.inc
+
+import sys, re
+
+print("/* Generated by typeslots.py $Revision$ */")
+res = {}
+for line in sys.stdin:
+ m = re.match("#define Py_([a-z_]+) ([0-9]+)", line)
+ if not m:
+ continue
+ member = m.group(1)
+ if member.startswith("tp_"):
+ member = "ht_type."+member
+ elif member.startswith("nb_"):
+ member = "as_number."+member
+ elif member.startswith("mp_"):
+ member = "as_mapping."+member
+ elif member.startswith("sq_"):
+ member = "as_sequence."+member
+ elif member.startswith("bf_"):
+ member = "as_buffer."+member
+ res[int(m.group(2))] = member
+
+M = max(res.keys())+1
+for i in range(1,M):
+ if i in res:
+ print("offsetof(PyHeapTypeObject, %s)," % res[i])
+ else:
+ print("0,")
diff --git a/Objects/unicodectype.c b/Objects/unicodectype.c
index 1597bbda04..9f6ac89b9f 100644
--- a/Objects/unicodectype.c
+++ b/Objects/unicodectype.c
@@ -9,7 +9,6 @@
*/
#include "Python.h"
-#include "unicodeobject.h"
#define ALPHA_MASK 0x01
#define DECIMAL_MASK 0x02
@@ -23,11 +22,12 @@
#define XID_CONTINUE_MASK 0x200
#define PRINTABLE_MASK 0x400
#define NODELTA_MASK 0x800
+#define NUMERIC_MASK 0x1000
typedef struct {
- const Py_UNICODE upper;
- const Py_UNICODE lower;
- const Py_UNICODE title;
+ const Py_UCS4 upper;
+ const Py_UCS4 lower;
+ const Py_UCS4 title;
const unsigned char decimal;
const unsigned char digit;
const unsigned short flags;
@@ -36,15 +36,13 @@ typedef struct {
#include "unicodetype_db.h"
static const _PyUnicode_TypeRecord *
-gettyperecord(Py_UNICODE code)
+gettyperecord(Py_UCS4 code)
{
int index;
-#ifdef Py_UNICODE_WIDE
if (code >= 0x110000)
index = 0;
else
-#endif
{
index = index1[(code>>SHIFT)];
index = index2[(index<<SHIFT)+(code&((1<<SHIFT)-1))];
@@ -53,30 +51,10 @@ gettyperecord(Py_UNICODE code)
return &_PyUnicode_TypeRecords[index];
}
-/* Returns 1 for Unicode characters having the category 'Zl', 'Zp' or
- type 'B', 0 otherwise. */
-
-int _PyUnicode_IsLinebreak(register const Py_UNICODE ch)
-{
- switch (ch) {
- case 0x000A: /* LINE FEED */
- case 0x000D: /* CARRIAGE RETURN */
- case 0x001C: /* FILE SEPARATOR */
- case 0x001D: /* GROUP SEPARATOR */
- case 0x001E: /* RECORD SEPARATOR */
- case 0x0085: /* NEXT LINE */
- case 0x2028: /* LINE SEPARATOR */
- case 0x2029: /* PARAGRAPH SEPARATOR */
- return 1;
- default:
- return 0;
- }
-}
-
/* Returns the titlecase Unicode characters corresponding to ch or just
ch if no titlecase mapping is known. */
-Py_UNICODE _PyUnicode_ToTitlecase(register Py_UNICODE ch)
+Py_UCS4 _PyUnicode_ToTitlecase(register Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
int delta = ctype->title;
@@ -93,7 +71,7 @@ Py_UNICODE _PyUnicode_ToTitlecase(register Py_UNICODE ch)
/* Returns 1 for Unicode characters having the category 'Lt', 0
otherwise. */
-int _PyUnicode_IsTitlecase(Py_UNICODE ch)
+int _PyUnicode_IsTitlecase(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
@@ -103,7 +81,7 @@ int _PyUnicode_IsTitlecase(Py_UNICODE ch)
/* Returns 1 for Unicode characters having the XID_Start property, 0
otherwise. */
-int _PyUnicode_IsXidStart(Py_UNICODE ch)
+int _PyUnicode_IsXidStart(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
@@ -113,7 +91,7 @@ int _PyUnicode_IsXidStart(Py_UNICODE ch)
/* Returns 1 for Unicode characters having the XID_Continue property,
0 otherwise. */
-int _PyUnicode_IsXidContinue(Py_UNICODE ch)
+int _PyUnicode_IsXidContinue(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
@@ -123,14 +101,14 @@ int _PyUnicode_IsXidContinue(Py_UNICODE ch)
/* Returns the integer decimal (0-9) for Unicode characters having
this property, -1 otherwise. */
-int _PyUnicode_ToDecimalDigit(Py_UNICODE ch)
+int _PyUnicode_ToDecimalDigit(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
return (ctype->flags & DECIMAL_MASK) ? ctype->decimal : -1;
}
-int _PyUnicode_IsDecimalDigit(Py_UNICODE ch)
+int _PyUnicode_IsDecimalDigit(Py_UCS4 ch)
{
if (_PyUnicode_ToDecimalDigit(ch) < 0)
return 0;
@@ -140,14 +118,14 @@ int _PyUnicode_IsDecimalDigit(Py_UNICODE ch)
/* Returns the integer digit (0-9) for Unicode characters having
this property, -1 otherwise. */
-int _PyUnicode_ToDigit(Py_UNICODE ch)
+int _PyUnicode_ToDigit(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
return (ctype->flags & DIGIT_MASK) ? ctype->digit : -1;
}
-int _PyUnicode_IsDigit(Py_UNICODE ch)
+int _PyUnicode_IsDigit(Py_UCS4 ch)
{
if (_PyUnicode_ToDigit(ch) < 0)
return 0;
@@ -157,522 +135,11 @@ int _PyUnicode_IsDigit(Py_UNICODE ch)
/* Returns the numeric value as double for Unicode characters having
this property, -1.0 otherwise. */
-/* TODO: replace with unicodetype_db.h table */
-
-double _PyUnicode_ToNumeric(Py_UNICODE ch)
+int _PyUnicode_IsNumeric(Py_UCS4 ch)
{
- switch (ch) {
- case 0x0F33:
- return (double) -1 / 2;
- case 0x17F0:
- case 0x3007:
-#ifdef Py_UNICODE_WIDE
- case 0x1018A:
-#endif
- return (double) 0;
- case 0x09F4:
- case 0x17F1:
- case 0x215F:
- case 0x2160:
- case 0x2170:
- case 0x3021:
- case 0x3192:
- case 0x3220:
- case 0x3280:
-#ifdef Py_UNICODE_WIDE
- case 0x10107:
- case 0x10142:
- case 0x10158:
- case 0x10159:
- case 0x1015A:
- case 0x10320:
- case 0x103D1:
-#endif
- return (double) 1;
- case 0x00BD:
- case 0x0F2A:
- case 0x2CFD:
-#ifdef Py_UNICODE_WIDE
- case 0x10141:
- case 0x10175:
- case 0x10176:
-#endif
- return (double) 1 / 2;
- case 0x2153:
- return (double) 1 / 3;
- case 0x00BC:
-#ifdef Py_UNICODE_WIDE
- case 0x10140:
-#endif
- return (double) 1 / 4;
- case 0x2155:
- return (double) 1 / 5;
- case 0x2159:
- return (double) 1 / 6;
- case 0x215B:
- return (double) 1 / 8;
- case 0x0BF0:
- case 0x1372:
- case 0x2169:
- case 0x2179:
- case 0x2469:
- case 0x247D:
- case 0x2491:
- case 0x24FE:
- case 0x277F:
- case 0x2789:
- case 0x2793:
- case 0x3038:
- case 0x3229:
- case 0x3289:
-#ifdef Py_UNICODE_WIDE
- case 0x10110:
- case 0x10149:
- case 0x10150:
- case 0x10157:
- case 0x10160:
- case 0x10161:
- case 0x10162:
- case 0x10163:
- case 0x10164:
- case 0x10322:
- case 0x103D3:
- case 0x10A44:
-#endif
- return (double) 10;
- case 0x0BF1:
- case 0x137B:
- case 0x216D:
- case 0x217D:
-#ifdef Py_UNICODE_WIDE
- case 0x10119:
- case 0x1014B:
- case 0x10152:
- case 0x1016A:
- case 0x103D5:
- case 0x10A46:
-#endif
- return (double) 100;
- case 0x0BF2:
- case 0x216F:
- case 0x217F:
- case 0x2180:
-#ifdef Py_UNICODE_WIDE
- case 0x10122:
- case 0x1014D:
- case 0x10154:
- case 0x10171:
- case 0x10A47:
-#endif
- return (double) 1000;
- case 0x137C:
- case 0x2182:
-#ifdef Py_UNICODE_WIDE
- case 0x1012B:
- case 0x10155:
-#endif
- return (double) 10000;
- case 0x216A:
- case 0x217A:
- case 0x246A:
- case 0x247E:
- case 0x2492:
- case 0x24EB:
- return (double) 11;
- case 0x0F2F:
- return (double) 11 / 2;
- case 0x216B:
- case 0x217B:
- case 0x246B:
- case 0x247F:
- case 0x2493:
- case 0x24EC:
- return (double) 12;
- case 0x246C:
- case 0x2480:
- case 0x2494:
- case 0x24ED:
- return (double) 13;
- case 0x0F30:
- return (double) 13 / 2;
- case 0x246D:
- case 0x2481:
- case 0x2495:
- case 0x24EE:
- return (double) 14;
- case 0x246E:
- case 0x2482:
- case 0x2496:
- case 0x24EF:
- return (double) 15;
- case 0x0F31:
- return (double) 15 / 2;
- case 0x09F9:
- case 0x246F:
- case 0x2483:
- case 0x2497:
- case 0x24F0:
- return (double) 16;
- case 0x16EE:
- case 0x2470:
- case 0x2484:
- case 0x2498:
- case 0x24F1:
- return (double) 17;
- case 0x0F32:
- return (double) 17 / 2;
- case 0x16EF:
- case 0x2471:
- case 0x2485:
- case 0x2499:
- case 0x24F2:
- return (double) 18;
- case 0x16F0:
- case 0x2472:
- case 0x2486:
- case 0x249A:
- case 0x24F3:
- return (double) 19;
- case 0x09F5:
- case 0x17F2:
- case 0x2161:
- case 0x2171:
- case 0x3022:
- case 0x3193:
- case 0x3221:
- case 0x3281:
-#ifdef Py_UNICODE_WIDE
- case 0x10108:
- case 0x1015B:
- case 0x1015C:
- case 0x1015D:
- case 0x1015E:
- case 0x103D2:
-#endif
- return (double) 2;
- case 0x2154:
-#ifdef Py_UNICODE_WIDE
- case 0x10177:
-#endif
- return (double) 2 / 3;
- case 0x2156:
- return (double) 2 / 5;
- case 0x1373:
- case 0x2473:
- case 0x2487:
- case 0x249B:
- case 0x24F4:
- case 0x3039:
-#ifdef Py_UNICODE_WIDE
- case 0x10111:
- case 0x103D4:
- case 0x10A45:
-#endif
- return (double) 20;
-#ifdef Py_UNICODE_WIDE
- case 0x1011A:
- return (double) 200;
- case 0x10123:
- return (double) 2000;
- case 0x1012C:
- return (double) 20000;
-#endif
- case 0x3251:
- return (double) 21;
- case 0x3252:
- return (double) 22;
- case 0x3253:
- return (double) 23;
- case 0x3254:
- return (double) 24;
- case 0x3255:
- return (double) 25;
- case 0x3256:
- return (double) 26;
- case 0x3257:
- return (double) 27;
- case 0x3258:
- return (double) 28;
- case 0x3259:
- return (double) 29;
- case 0x09F6:
- case 0x17F3:
- case 0x2162:
- case 0x2172:
- case 0x3023:
- case 0x3194:
- case 0x3222:
- case 0x3282:
-#ifdef Py_UNICODE_WIDE
- case 0x10109:
-#endif
- return (double) 3;
- case 0x0F2B:
- return (double) 3 / 2;
- case 0x00BE:
-#ifdef Py_UNICODE_WIDE
- case 0x10178:
-#endif
- return (double) 3 / 4;
- case 0x2157:
- return (double) 3 / 5;
- case 0x215C:
- return (double) 3 / 8;
- case 0x1374:
- case 0x303A:
- case 0x325A:
-#ifdef Py_UNICODE_WIDE
- case 0x10112:
- case 0x10165:
-#endif
- return (double) 30;
-#ifdef Py_UNICODE_WIDE
- case 0x1011B:
- case 0x1016B:
- return (double) 300;
- case 0x10124:
- return (double) 3000;
- case 0x1012D:
- return (double) 30000;
-#endif
- case 0x325B:
- return (double) 31;
- case 0x325C:
- return (double) 32;
- case 0x325D:
- return (double) 33;
- case 0x325E:
- return (double) 34;
- case 0x325F:
- return (double) 35;
- case 0x32B1:
- return (double) 36;
- case 0x32B2:
- return (double) 37;
- case 0x32B3:
- return (double) 38;
- case 0x32B4:
- return (double) 39;
- case 0x09F7:
- case 0x17F4:
- case 0x2163:
- case 0x2173:
- case 0x3024:
- case 0x3195:
- case 0x3223:
- case 0x3283:
-#ifdef Py_UNICODE_WIDE
- case 0x1010A:
-#endif
- return (double) 4;
- case 0x2158:
- return (double) 4 / 5;
- case 0x1375:
- case 0x32B5:
-#ifdef Py_UNICODE_WIDE
- case 0x10113:
-#endif
- return (double) 40;
-#ifdef Py_UNICODE_WIDE
- case 0x1011C:
- return (double) 400;
- case 0x10125:
- return (double) 4000;
- case 0x1012E:
- return (double) 40000;
-#endif
- case 0x32B6:
- return (double) 41;
- case 0x32B7:
- return (double) 42;
- case 0x32B8:
- return (double) 43;
- case 0x32B9:
- return (double) 44;
- case 0x32BA:
- return (double) 45;
- case 0x32BB:
- return (double) 46;
- case 0x32BC:
- return (double) 47;
- case 0x32BD:
- return (double) 48;
- case 0x32BE:
- return (double) 49;
- case 0x17F5:
- case 0x2164:
- case 0x2174:
- case 0x3025:
- case 0x3224:
- case 0x3284:
-#ifdef Py_UNICODE_WIDE
- case 0x1010B:
- case 0x10143:
- case 0x10148:
- case 0x1014F:
- case 0x1015F:
- case 0x10173:
- case 0x10321:
-#endif
- return (double) 5;
- case 0x0F2C:
- return (double) 5 / 2;
- case 0x215A:
- return (double) 5 / 6;
- case 0x215D:
- return (double) 5 / 8;
- case 0x1376:
- case 0x216C:
- case 0x217C:
- case 0x32BF:
-#ifdef Py_UNICODE_WIDE
- case 0x10114:
- case 0x10144:
- case 0x1014A:
- case 0x10151:
- case 0x10166:
- case 0x10167:
- case 0x10168:
- case 0x10169:
- case 0x10174:
- case 0x10323:
-#endif
- return (double) 50;
- case 0x216E:
- case 0x217E:
-#ifdef Py_UNICODE_WIDE
- case 0x1011D:
- case 0x10145:
- case 0x1014C:
- case 0x10153:
- case 0x1016C:
- case 0x1016D:
- case 0x1016E:
- case 0x1016F:
- case 0x10170:
-#endif
- return (double) 500;
- case 0x2181:
-#ifdef Py_UNICODE_WIDE
- case 0x10126:
- case 0x10146:
- case 0x1014E:
- case 0x10172:
-#endif
- return (double) 5000;
-#ifdef Py_UNICODE_WIDE
- case 0x1012F:
- case 0x10147:
- case 0x10156:
- return (double) 50000;
-#endif
- case 0x17F6:
- case 0x2165:
- case 0x2175:
- case 0x3026:
- case 0x3225:
- case 0x3285:
-#ifdef Py_UNICODE_WIDE
- case 0x1010C:
-#endif
- return (double) 6;
- case 0x1377:
-#ifdef Py_UNICODE_WIDE
- case 0x10115:
-#endif
- return (double) 60;
-#ifdef Py_UNICODE_WIDE
- case 0x1011E:
- return (double) 600;
- case 0x10127:
- return (double) 6000;
- case 0x10130:
- return (double) 60000;
-#endif
- case 0x17F7:
- case 0x2166:
- case 0x2176:
- case 0x3027:
- case 0x3226:
- case 0x3286:
-#ifdef Py_UNICODE_WIDE
- case 0x1010D:
-#endif
- return (double) 7;
- case 0x0F2D:
- return (double) 7 / 2;
- case 0x215E:
- return (double) 7 / 8;
- case 0x1378:
-#ifdef Py_UNICODE_WIDE
- case 0x10116:
-#endif
- return (double) 70;
-#ifdef Py_UNICODE_WIDE
- case 0x1011F:
- return (double) 700;
- case 0x10128:
- return (double) 7000;
- case 0x10131:
- return (double) 70000;
-#endif
- case 0x17F8:
- case 0x2167:
- case 0x2177:
- case 0x3028:
- case 0x3227:
- case 0x3287:
-#ifdef Py_UNICODE_WIDE
- case 0x1010E:
-#endif
- return (double) 8;
- case 0x1379:
-#ifdef Py_UNICODE_WIDE
- case 0x10117:
-#endif
- return (double) 80;
-#ifdef Py_UNICODE_WIDE
- case 0x10120:
- return (double) 800;
- case 0x10129:
- return (double) 8000;
- case 0x10132:
- return (double) 80000;
-#endif
- case 0x17F9:
- case 0x2168:
- case 0x2178:
- case 0x3029:
- case 0x3228:
- case 0x3288:
-#ifdef Py_UNICODE_WIDE
- case 0x1010F:
-#endif
- return (double) 9;
- case 0x0F2E:
- return (double) 9 / 2;
- case 0x137A:
-#ifdef Py_UNICODE_WIDE
- case 0x10118:
-#endif
- return (double) 90;
-#ifdef Py_UNICODE_WIDE
- case 0x10121:
- case 0x1034A:
- return (double) 900;
- case 0x1012A:
- return (double) 9000;
- case 0x10133:
- return (double) 90000;
-#endif
- default:
- return (double) _PyUnicode_ToDigit(ch);
- }
-}
+ const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
-int _PyUnicode_IsNumeric(Py_UNICODE ch)
-{
- return _PyUnicode_ToNumeric(ch) != -1.0;
+ return (ctype->flags & NUMERIC_MASK) != 0;
}
/* Returns 1 for Unicode characters to be hex-escaped when repr()ed,
@@ -688,61 +155,17 @@ int _PyUnicode_IsNumeric(Py_UNICODE ch)
* Zp Separator, Paragraph ('\u2029', PARAGRAPH SEPARATOR)
* Zs (Separator, Space) other than ASCII space('\x20').
*/
-int _PyUnicode_IsPrintable(Py_UNICODE ch)
+int _PyUnicode_IsPrintable(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
return (ctype->flags & PRINTABLE_MASK) != 0;
}
-#ifndef WANT_WCTYPE_FUNCTIONS
-
-/* Returns 1 for Unicode characters having the bidirectional type
- 'WS', 'B' or 'S' or the category 'Zs', 0 otherwise. */
-
-int _PyUnicode_IsWhitespace(register const Py_UNICODE ch)
-{
- switch (ch) {
- case 0x0009: /* HORIZONTAL TABULATION */
- case 0x000A: /* LINE FEED */
- case 0x000B: /* VERTICAL TABULATION */
- case 0x000C: /* FORM FEED */
- case 0x000D: /* CARRIAGE RETURN */
- case 0x001C: /* FILE SEPARATOR */
- case 0x001D: /* GROUP SEPARATOR */
- case 0x001E: /* RECORD SEPARATOR */
- case 0x001F: /* UNIT SEPARATOR */
- case 0x0020: /* SPACE */
- case 0x0085: /* NEXT LINE */
- case 0x00A0: /* NO-BREAK SPACE */
- case 0x1680: /* OGHAM SPACE MARK */
- case 0x2000: /* EN QUAD */
- case 0x2001: /* EM QUAD */
- case 0x2002: /* EN SPACE */
- case 0x2003: /* EM SPACE */
- case 0x2004: /* THREE-PER-EM SPACE */
- case 0x2005: /* FOUR-PER-EM SPACE */
- case 0x2006: /* SIX-PER-EM SPACE */
- case 0x2007: /* FIGURE SPACE */
- case 0x2008: /* PUNCTUATION SPACE */
- case 0x2009: /* THIN SPACE */
- case 0x200A: /* HAIR SPACE */
- case 0x200B: /* ZERO WIDTH SPACE */
- case 0x2028: /* LINE SEPARATOR */
- case 0x2029: /* PARAGRAPH SEPARATOR */
- case 0x202F: /* NARROW NO-BREAK SPACE */
- case 0x205F: /* MEDIUM MATHEMATICAL SPACE */
- case 0x3000: /* IDEOGRAPHIC SPACE */
- return 1;
- default:
- return 0;
- }
-}
-
/* Returns 1 for Unicode characters having the category 'Ll', 0
otherwise. */
-int _PyUnicode_IsLowercase(Py_UNICODE ch)
+int _PyUnicode_IsLowercase(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
@@ -752,7 +175,7 @@ int _PyUnicode_IsLowercase(Py_UNICODE ch)
/* Returns 1 for Unicode characters having the category 'Lu', 0
otherwise. */
-int _PyUnicode_IsUppercase(Py_UNICODE ch)
+int _PyUnicode_IsUppercase(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
@@ -762,7 +185,7 @@ int _PyUnicode_IsUppercase(Py_UNICODE ch)
/* Returns the uppercase Unicode characters corresponding to ch or just
ch if no uppercase mapping is known. */
-Py_UNICODE _PyUnicode_ToUppercase(Py_UNICODE ch)
+Py_UCS4 _PyUnicode_ToUppercase(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
int delta = ctype->upper;
@@ -776,7 +199,7 @@ Py_UNICODE _PyUnicode_ToUppercase(Py_UNICODE ch)
/* Returns the lowercase Unicode characters corresponding to ch or just
ch if no lowercase mapping is known. */
-Py_UNICODE _PyUnicode_ToLowercase(Py_UNICODE ch)
+Py_UCS4 _PyUnicode_ToLowercase(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
int delta = ctype->lower;
@@ -790,46 +213,10 @@ Py_UNICODE _PyUnicode_ToLowercase(Py_UNICODE ch)
/* Returns 1 for Unicode characters having the category 'Ll', 'Lu', 'Lt',
'Lo' or 'Lm', 0 otherwise. */
-int _PyUnicode_IsAlpha(Py_UNICODE ch)
+int _PyUnicode_IsAlpha(Py_UCS4 ch)
{
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
return (ctype->flags & ALPHA_MASK) != 0;
}
-#else
-
-/* Export the interfaces using the wchar_t type for portability
- reasons: */
-
-int _PyUnicode_IsWhitespace(Py_UNICODE ch)
-{
- return iswspace(ch);
-}
-
-int _PyUnicode_IsLowercase(Py_UNICODE ch)
-{
- return iswlower(ch);
-}
-
-int _PyUnicode_IsUppercase(Py_UNICODE ch)
-{
- return iswupper(ch);
-}
-
-Py_UNICODE _PyUnicode_ToLowercase(Py_UNICODE ch)
-{
- return towlower(ch);
-}
-
-Py_UNICODE _PyUnicode_ToUppercase(Py_UNICODE ch)
-{
- return towupper(ch);
-}
-
-int _PyUnicode_IsAlpha(Py_UNICODE ch)
-{
- return iswalpha(ch);
-}
-
-#endif
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 2cdbc0e689..7a70a5e917 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -41,9 +41,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define PY_SSIZE_T_CLEAN
#include "Python.h"
-#include "bytes_methods.h"
-
-#include "unicodeobject.h"
#include "ucnhash.h"
#ifdef MS_WINDOWS
@@ -114,21 +111,12 @@ static PyUnicodeObject *unicode_empty;
shared as well. */
static PyUnicodeObject *unicode_latin1[256];
-/* Default encoding to use and assume when NULL is passed as encoding
- parameter; it is fixed to "utf-8". Always use the
- PyUnicode_GetDefaultEncoding() API to access this global.
-
- Don't forget to alter Py_FileSystemDefaultEncoding if you change the
- hard coded default!
-*/
-static const char unicode_default_encoding[] = "utf-8";
-
/* Fast detection of the most frequent whitespace characters */
const unsigned char _Py_ascii_whitespace[] = {
0, 0, 0, 0, 0, 0, 0, 0,
-/* case 0x0009: * HORIZONTAL TABULATION */
+/* case 0x0009: * CHARACTER TABULATION */
/* case 0x000A: * LINE FEED */
-/* case 0x000B: * VERTICAL TABULATION */
+/* case 0x000B: * LINE TABULATION */
/* case 0x000C: * FORM FEED */
/* case 0x000D: * CARRIAGE RETURN */
0, 1, 1, 1, 1, 1, 0, 0,
@@ -169,8 +157,10 @@ static void raise_encode_exception(PyObject **exceptionObject,
static unsigned char ascii_linebreak[] = {
0, 0, 0, 0, 0, 0, 0, 0,
/* 0x000A, * LINE FEED */
+/* 0x000B, * LINE TABULATION */
+/* 0x000C, * FORM FEED */
/* 0x000D, * CARRIAGE RETURN */
- 0, 0, 1, 0, 0, 1, 0, 0,
+ 0, 0, 1, 1, 1, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
/* 0x001C, * FILE SEPARATOR */
/* 0x001D, * GROUP SEPARATOR */
@@ -212,11 +202,22 @@ PyUnicode_GetMax(void)
/* the linebreak mask is set up by Unicode_Init below */
+#if LONG_BIT >= 128
+#define BLOOM_WIDTH 128
+#elif LONG_BIT >= 64
+#define BLOOM_WIDTH 64
+#elif LONG_BIT >= 32
+#define BLOOM_WIDTH 32
+#else
+#error "LONG_BIT is smaller than 32"
+#endif
+
#define BLOOM_MASK unsigned long
static BLOOM_MASK bloom_linebreak;
-#define BLOOM(mask, ch) ((mask & (1 << ((ch) & 0x1F))))
+#define BLOOM_ADD(mask, ch) ((mask |= (1UL << ((ch) & (BLOOM_WIDTH - 1)))))
+#define BLOOM(mask, ch) ((mask & (1UL << ((ch) & (BLOOM_WIDTH - 1)))))
#define BLOOM_LINEBREAK(ch) \
((ch) < 128U ? ascii_linebreak[(ch)] : \
@@ -226,12 +227,12 @@ Py_LOCAL_INLINE(BLOOM_MASK) make_bloom_mask(Py_UNICODE* ptr, Py_ssize_t len)
{
/* calculate simple bloom-style bitmask for a given unicode string */
- long mask;
+ BLOOM_MASK mask;
Py_ssize_t i;
mask = 0;
for (i = 0; i < len; i++)
- mask |= (1 << (ptr[i] & 0x1F));
+ BLOOM_ADD(mask, ptr[i]);
return mask;
}
@@ -651,7 +652,7 @@ PyObject *PyUnicode_FromWideChar(register const wchar_t *w,
return NULL;
/* Copy the wchar_t data into the new object */
-#ifdef HAVE_USABLE_WCHAR_T
+#if Py_UNICODE_SIZE == SIZEOF_WCHAR_T
memcpy(unicode->str, w, size * sizeof(wchar_t));
#else
{
@@ -671,7 +672,8 @@ PyObject *PyUnicode_FromWideChar(register const wchar_t *w,
#undef CONVERT_WCHAR_TO_SURROGATES
static void
-makefmt(char *fmt, int longflag, int size_tflag, int zeropad, int width, int precision, char c)
+makefmt(char *fmt, int longflag, int longlongflag, int size_tflag,
+ int zeropad, int width, int precision, char c)
{
*fmt++ = '%';
if (width) {
@@ -683,6 +685,19 @@ makefmt(char *fmt, int longflag, int size_tflag, int zeropad, int width, int pre
fmt += sprintf(fmt, ".%d", precision);
if (longflag)
*fmt++ = 'l';
+ else if (longlongflag) {
+ /* longlongflag should only ever be nonzero on machines with
+ HAVE_LONG_LONG defined */
+#ifdef HAVE_LONG_LONG
+ char *f = PY_FORMAT_LONG_LONG;
+ while (*f)
+ *fmt++ = *f++;
+#else
+ /* we shouldn't ever get here */
+ assert(0);
+ *fmt++ = 'l';
+#endif
+ }
else if (size_tflag) {
char *f = PY_FORMAT_SIZE_T;
while (*f)
@@ -694,6 +709,16 @@ makefmt(char *fmt, int longflag, int size_tflag, int zeropad, int width, int pre
#define appendstring(string) {for (copy = string;*copy;) *s++ = *copy++;}
+/* size of fixed-size buffer for formatting single arguments */
+#define ITEM_BUFFER_LEN 21
+/* maximum number of characters required for output of %ld. 21 characters
+ allows for 64-bit integers (in decimal) and an optional sign. */
+#define MAX_LONG_CHARS 21
+/* maximum number of characters required for output of %lld.
+ We need at most ceil(log10(256)*SIZEOF_LONG_LONG) digits,
+ plus 1 for the sign. 53/22 is an upper bound for log10(256). */
+#define MAX_LONG_LONG_CHARS (2 + (SIZEOF_LONG_LONG*53-1) / 22)
+
PyObject *
PyUnicode_FromFormatV(const char *format, va_list vargs)
{
@@ -709,24 +734,16 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
Py_UNICODE *s;
PyObject *string;
/* used by sprintf */
- char buffer[21];
+ char buffer[ITEM_BUFFER_LEN+1];
/* use abuffer instead of buffer, if we need more space
* (which can happen if there's a format specifier with width). */
char *abuffer = NULL;
char *realbuffer;
Py_ssize_t abuffersize = 0;
- char fmt[60]; /* should be enough for %0width.precisionld */
+ char fmt[61]; /* should be enough for %0width.precisionlld */
const char *copy;
-#ifdef VA_LIST_IS_ARRAY
- Py_MEMCPY(count, vargs, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(count, vargs);
-#else
- count = vargs;
-#endif
-#endif
+ Py_VA_COPY(count, vargs);
/* step 1: count the number of %S/%R/%A/%s format specifications
* (we call PyObject_Str()/PyObject_Repr()/PyObject_ASCII()/
* PyUnicode_DecodeUTF8() for these objects once during step 3 and put the
@@ -735,15 +752,22 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
if (*f == '%') {
if (*(f+1)=='%')
continue;
- if (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')
+ if (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A' || *(f+1) == 'V')
++callcount;
- while (ISDIGIT((unsigned)*f))
+ while (Py_ISDIGIT((unsigned)*f))
width = (width*10) + *f++ - '0';
- while (*++f && *f != '%' && !ISALPHA((unsigned)*f))
+ while (*++f && *f != '%' && !Py_ISALPHA((unsigned)*f))
;
if (*f == 's')
++callcount;
}
+ else if (128 <= (unsigned char)*f) {
+ PyErr_Format(PyExc_ValueError,
+ "PyUnicode_FromFormatV() expects an ASCII-encoded format "
+ "string, got a non-ASCII byte: 0x%02x",
+ (unsigned char)*f);
+ return NULL;
+ }
}
/* step 2: allocate memory for the results of
* PyObject_Str()/PyObject_Repr()/PyUnicode_DecodeUTF8() calls */
@@ -758,37 +782,70 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
/* step 3: figure out how large a buffer we need */
for (f = format; *f; f++) {
if (*f == '%') {
+#ifdef HAVE_LONG_LONG
+ int longlongflag = 0;
+#endif
const char* p = f;
width = 0;
- while (ISDIGIT((unsigned)*f))
+ while (Py_ISDIGIT((unsigned)*f))
width = (width*10) + *f++ - '0';
- while (*++f && *f != '%' && !ISALPHA((unsigned)*f))
+ while (*++f && *f != '%' && !Py_ISALPHA((unsigned)*f))
;
/* skip the 'l' or 'z' in {%ld, %zd, %lu, %zu} since
* they don't affect the amount of space we reserve.
*/
- if ((*f == 'l' || *f == 'z') &&
- (f[1] == 'd' || f[1] == 'u'))
+ if (*f == 'l') {
+ if (f[1] == 'd' || f[1] == 'u') {
+ ++f;
+ }
+#ifdef HAVE_LONG_LONG
+ else if (f[1] == 'l' &&
+ (f[2] == 'd' || f[2] == 'u')) {
+ longlongflag = 1;
+ f += 2;
+ }
+#endif
+ }
+ else if (*f == 'z' && (f[1] == 'd' || f[1] == 'u')) {
++f;
+ }
switch (*f) {
case 'c':
+ {
+#ifndef Py_UNICODE_WIDE
+ int ordinal = va_arg(count, int);
+ if (ordinal > 0xffff)
+ n += 2;
+ else
+ n++;
+#else
(void)va_arg(count, int);
- /* fall through... */
+ n++;
+#endif
+ break;
+ }
case '%':
n++;
break;
case 'd': case 'u': case 'i': case 'x':
(void) va_arg(count, int);
- /* 20 bytes is enough to hold a 64-bit
- integer. Decimal takes the most space.
- This isn't enough for octal.
- If a width is specified we need more
- (which we allocate later). */
- if (width < 20)
- width = 20;
+#ifdef HAVE_LONG_LONG
+ if (longlongflag) {
+ if (width < MAX_LONG_LONG_CHARS)
+ width = MAX_LONG_LONG_CHARS;
+ }
+ else
+#endif
+ /* MAX_LONG_CHARS is enough to hold a 64-bit integer,
+ including sign. Decimal takes the most space. This
+ isn't enough for octal. If a width is specified we
+ need more (which we allocate later). */
+ if (width < MAX_LONG_CHARS)
+ width = MAX_LONG_CHARS;
n += width;
+ /* XXX should allow for large precision here too. */
if (abuffersize < width)
abuffersize = width;
break;
@@ -815,12 +872,20 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
{
PyObject *obj = va_arg(count, PyObject *);
const char *str = va_arg(count, const char *);
+ PyObject *str_obj;
assert(obj || str);
assert(!obj || PyUnicode_Check(obj));
- if (obj)
+ if (obj) {
n += PyUnicode_GET_SIZE(obj);
- else
- n += strlen(str);
+ *callresult++ = NULL;
+ }
+ else {
+ str_obj = PyUnicode_DecodeUTF8(str, strlen(str), "replace");
+ if (!str_obj)
+ goto fail;
+ n += PyUnicode_GET_SIZE(str_obj);
+ *callresult++ = str_obj;
+ }
break;
}
case 'S':
@@ -885,8 +950,9 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
n++;
}
expand:
- if (abuffersize > 20) {
- abuffer = PyObject_Malloc(abuffersize);
+ if (abuffersize > ITEM_BUFFER_LEN) {
+ /* add 1 for sprintf's trailing null byte */
+ abuffer = PyObject_Malloc(abuffersize + 1);
if (!abuffer) {
PyErr_NoMemory();
goto fail;
@@ -910,23 +976,32 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
if (*f == '%') {
const char* p = f++;
int longflag = 0;
+ int longlongflag = 0;
int size_tflag = 0;
zeropad = (*f == '0');
/* parse the width.precision part */
width = 0;
- while (ISDIGIT((unsigned)*f))
+ while (Py_ISDIGIT((unsigned)*f))
width = (width*10) + *f++ - '0';
precision = 0;
if (*f == '.') {
f++;
- while (ISDIGIT((unsigned)*f))
+ while (Py_ISDIGIT((unsigned)*f))
precision = (precision*10) + *f++ - '0';
}
- /* handle the long flag, but only for %ld and %lu.
- others can be added when necessary. */
- if (*f == 'l' && (f[1] == 'd' || f[1] == 'u')) {
- longflag = 1;
- ++f;
+ /* Handle %ld, %lu, %lld and %llu. */
+ if (*f == 'l') {
+ if (f[1] == 'd' || f[1] == 'u') {
+ longflag = 1;
+ ++f;
+ }
+#ifdef HAVE_LONG_LONG
+ else if (f[1] == 'l' &&
+ (f[2] == 'd' || f[2] == 'u')) {
+ longlongflag = 1;
+ f += 2;
+ }
+#endif
}
/* handle the size_t flag. */
if (*f == 'z' && (f[1] == 'd' || f[1] == 'u')) {
@@ -936,12 +1011,27 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
switch (*f) {
case 'c':
- *s++ = va_arg(vargs, int);
+ {
+ int ordinal = va_arg(vargs, int);
+#ifndef Py_UNICODE_WIDE
+ if (ordinal > 0xffff) {
+ ordinal -= 0x10000;
+ *s++ = 0xD800 | (ordinal >> 10);
+ *s++ = 0xDC00 | (ordinal & 0x3FF);
+ } else
+#endif
+ *s++ = ordinal;
break;
+ }
case 'd':
- makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'd');
+ makefmt(fmt, longflag, longlongflag, size_tflag, zeropad,
+ width, precision, 'd');
if (longflag)
sprintf(realbuffer, fmt, va_arg(vargs, long));
+#ifdef HAVE_LONG_LONG
+ else if (longlongflag)
+ sprintf(realbuffer, fmt, va_arg(vargs, PY_LONG_LONG));
+#endif
else if (size_tflag)
sprintf(realbuffer, fmt, va_arg(vargs, Py_ssize_t));
else
@@ -949,9 +1039,15 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
appendstring(realbuffer);
break;
case 'u':
- makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'u');
+ makefmt(fmt, longflag, longlongflag, size_tflag, zeropad,
+ width, precision, 'u');
if (longflag)
sprintf(realbuffer, fmt, va_arg(vargs, unsigned long));
+#ifdef HAVE_LONG_LONG
+ else if (longlongflag)
+ sprintf(realbuffer, fmt, va_arg(vargs,
+ unsigned PY_LONG_LONG));
+#endif
else if (size_tflag)
sprintf(realbuffer, fmt, va_arg(vargs, size_t));
else
@@ -959,12 +1055,12 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
appendstring(realbuffer);
break;
case 'i':
- makefmt(fmt, 0, 0, zeropad, width, precision, 'i');
+ makefmt(fmt, 0, 0, 0, zeropad, width, precision, 'i');
sprintf(realbuffer, fmt, va_arg(vargs, int));
appendstring(realbuffer);
break;
case 'x':
- makefmt(fmt, 0, 0, zeropad, width, precision, 'x');
+ makefmt(fmt, 0, 0, 0, zeropad, width, precision, 'x');
sprintf(realbuffer, fmt, va_arg(vargs, int));
appendstring(realbuffer);
break;
@@ -992,18 +1088,23 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
case 'V':
{
PyObject *obj = va_arg(vargs, PyObject *);
- const char *str = va_arg(vargs, const char *);
+ va_arg(vargs, const char *);
if (obj) {
Py_ssize_t size = PyUnicode_GET_SIZE(obj);
Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size);
s += size;
} else {
- appendstring(str);
+ Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(*callresult),
+ PyUnicode_GET_SIZE(*callresult));
+ s += PyUnicode_GET_SIZE(*callresult);
+ Py_DECREF(*callresult);
}
+ ++callresult;
break;
}
case 'S':
case 'R':
+ case 'A':
{
Py_UNICODE *ucopy;
Py_ssize_t usize;
@@ -1039,7 +1140,8 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
appendstring(p);
goto end;
}
- } else
+ }
+ else
*s++ = *f;
}
@@ -1054,7 +1156,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
if (callresults) {
PyObject **callresult2 = callresults;
while (callresult2 < callresult) {
- Py_DECREF(*callresult2);
+ Py_XDECREF(*callresult2);
++callresult2;
}
PyObject_Free(callresults);
@@ -1082,35 +1184,154 @@ PyUnicode_FromFormat(const char *format, ...)
return ret;
}
-Py_ssize_t PyUnicode_AsWideChar(PyUnicodeObject *unicode,
- wchar_t *w,
- Py_ssize_t size)
+/* Helper function for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString():
+ convert a Unicode object to a wide character string.
+
+ - If w is NULL: return the number of wide characters (including the nul
+ character) required to convert the unicode object. Ignore size argument.
+
+ - Otherwise: return the number of wide characters (excluding the nul
+ character) written into w. Write at most size wide characters (including
+ the nul character). */
+static Py_ssize_t
+unicode_aswidechar(PyUnicodeObject *unicode,
+ wchar_t *w,
+ Py_ssize_t size)
+{
+#if Py_UNICODE_SIZE == SIZEOF_WCHAR_T
+ Py_ssize_t res;
+ if (w != NULL) {
+ res = PyUnicode_GET_SIZE(unicode);
+ if (size > res)
+ size = res + 1;
+ else
+ res = size;
+ memcpy(w, unicode->str, size * sizeof(wchar_t));
+ return res;
+ }
+ else
+ return PyUnicode_GET_SIZE(unicode) + 1;
+#elif Py_UNICODE_SIZE == 2 && SIZEOF_WCHAR_T == 4
+ register const Py_UNICODE *u;
+ const Py_UNICODE *uend;
+ const wchar_t *worig, *wend;
+ Py_ssize_t nchar;
+
+ u = PyUnicode_AS_UNICODE(unicode);
+ uend = u + PyUnicode_GET_SIZE(unicode);
+ if (w != NULL) {
+ worig = w;
+ wend = w + size;
+ while (u != uend && w != wend) {
+ if (0xD800 <= u[0] && u[0] <= 0xDBFF
+ && 0xDC00 <= u[1] && u[1] <= 0xDFFF)
+ {
+ *w = (((u[0] & 0x3FF) << 10) | (u[1] & 0x3FF)) + 0x10000;
+ u += 2;
+ }
+ else {
+ *w = *u;
+ u++;
+ }
+ w++;
+ }
+ if (w != wend)
+ *w = L'\0';
+ return w - worig;
+ }
+ else {
+ nchar = 1; /* nul character at the end */
+ while (u != uend) {
+ if (0xD800 <= u[0] && u[0] <= 0xDBFF
+ && 0xDC00 <= u[1] && u[1] <= 0xDFFF)
+ u += 2;
+ else
+ u++;
+ nchar++;
+ }
+ }
+ return nchar;
+#elif Py_UNICODE_SIZE == 4 && SIZEOF_WCHAR_T == 2
+ register Py_UNICODE *u, *uend, ordinal;
+ register Py_ssize_t i;
+ wchar_t *worig, *wend;
+ Py_ssize_t nchar;
+
+ u = PyUnicode_AS_UNICODE(unicode);
+ uend = u + PyUnicode_GET_SIZE(u);
+ if (w != NULL) {
+ worig = w;
+ wend = w + size;
+ while (u != uend && w != wend) {
+ ordinal = *u;
+ if (ordinal > 0xffff) {
+ ordinal -= 0x10000;
+ *w++ = 0xD800 | (ordinal >> 10);
+ *w++ = 0xDC00 | (ordinal & 0x3FF);
+ }
+ else
+ *w++ = ordinal;
+ u++;
+ }
+ if (w != wend)
+ *w = 0;
+ return w - worig;
+ }
+ else {
+ nchar = 1; /* nul character */
+ while (u != uend) {
+ if (*u > 0xffff)
+ nchar += 2;
+ else
+ nchar++;
+ u++;
+ }
+ return nchar;
+ }
+#else
+# error "unsupported wchar_t and Py_UNICODE sizes, see issue #8670"
+#endif
+}
+
+Py_ssize_t
+PyUnicode_AsWideChar(PyObject *unicode,
+ wchar_t *w,
+ Py_ssize_t size)
{
if (unicode == NULL) {
PyErr_BadInternalCall();
return -1;
}
+ return unicode_aswidechar((PyUnicodeObject*)unicode, w, size);
+}
- /* If possible, try to copy the 0-termination as well */
- if (size > PyUnicode_GET_SIZE(unicode))
- size = PyUnicode_GET_SIZE(unicode) + 1;
+wchar_t*
+PyUnicode_AsWideCharString(PyObject *unicode,
+ Py_ssize_t *size)
+{
+ wchar_t* buffer;
+ Py_ssize_t buflen;
-#ifdef HAVE_USABLE_WCHAR_T
- memcpy(w, unicode->str, size * sizeof(wchar_t));
-#else
- {
- register Py_UNICODE *u;
- register Py_ssize_t i;
- u = PyUnicode_AS_UNICODE(unicode);
- for (i = size; i > 0; i--)
- *w++ = *u++;
+ if (unicode == NULL) {
+ PyErr_BadInternalCall();
+ return NULL;
}
-#endif
- if (size > PyUnicode_GET_SIZE(unicode))
- return PyUnicode_GET_SIZE(unicode);
- else
- return size;
+ buflen = unicode_aswidechar((PyUnicodeObject *)unicode, NULL, 0);
+ if (PY_SSIZE_T_MAX / sizeof(wchar_t) < buflen) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ buffer = PyMem_MALLOC(buflen * sizeof(wchar_t));
+ if (buffer == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ buflen = unicode_aswidechar((PyUnicodeObject *)unicode, buffer, buflen);
+ if (size != NULL)
+ *size = buflen;
+ return buffer;
}
#endif
@@ -1210,27 +1431,26 @@ PyObject *PyUnicode_FromEncodedObject(register PyObject *obj,
return v;
}
-PyObject *PyUnicode_Decode(const char *s,
- Py_ssize_t size,
- const char *encoding,
- const char *errors)
+/* Convert encoding to lower case and replace '_' with '-' in order to
+ catch e.g. UTF_8. Return 0 on error (encoding is longer than lower_len-1),
+ 1 on success. */
+static int
+normalize_encoding(const char *encoding,
+ char *lower,
+ size_t lower_len)
{
- PyObject *buffer = NULL, *unicode;
- Py_buffer info;
- char lower[20]; /* Enough for any encoding name we recognize */
- char *l;
const char *e;
+ char *l;
+ char *l_end;
- if (encoding == NULL)
- encoding = PyUnicode_GetDefaultEncoding();
-
- /* Convert encoding to lower case and replace '_' with '-' in order to
- catch e.g. UTF_8 */
e = encoding;
l = lower;
- while (*e && l < &lower[(sizeof lower) - 2]) {
- if (ISUPPER(*e)) {
- *l++ = TOLOWER(*e++);
+ l_end = &lower[lower_len - 1];
+ while (*e) {
+ if (l == l_end)
+ return 0;
+ if (Py_ISUPPER(*e)) {
+ *l++ = Py_TOLOWER(*e++);
}
else if (*e == '_') {
*l++ = '-';
@@ -1241,23 +1461,39 @@ PyObject *PyUnicode_Decode(const char *s,
}
}
*l = '\0';
+ return 1;
+}
+
+PyObject *PyUnicode_Decode(const char *s,
+ Py_ssize_t size,
+ const char *encoding,
+ const char *errors)
+{
+ PyObject *buffer = NULL, *unicode;
+ Py_buffer info;
+ char lower[11]; /* Enough for any encoding shortcut */
+
+ if (encoding == NULL)
+ encoding = PyUnicode_GetDefaultEncoding();
/* Shortcuts for common default encodings */
- if (strcmp(lower, "utf-8") == 0)
- return PyUnicode_DecodeUTF8(s, size, errors);
- else if ((strcmp(lower, "latin-1") == 0) ||
- (strcmp(lower, "iso-8859-1") == 0))
- return PyUnicode_DecodeLatin1(s, size, errors);
+ if (normalize_encoding(encoding, lower, sizeof(lower))) {
+ if (strcmp(lower, "utf-8") == 0)
+ return PyUnicode_DecodeUTF8(s, size, errors);
+ else if ((strcmp(lower, "latin-1") == 0) ||
+ (strcmp(lower, "iso-8859-1") == 0))
+ return PyUnicode_DecodeLatin1(s, size, errors);
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
- else if (strcmp(lower, "mbcs") == 0)
- return PyUnicode_DecodeMBCS(s, size, errors);
+ else if (strcmp(lower, "mbcs") == 0)
+ return PyUnicode_DecodeMBCS(s, size, errors);
#endif
- else if (strcmp(lower, "ascii") == 0)
- return PyUnicode_DecodeASCII(s, size, errors);
- else if (strcmp(lower, "utf-16") == 0)
- return PyUnicode_DecodeUTF16(s, size, errors, 0);
- else if (strcmp(lower, "utf-32") == 0)
- return PyUnicode_DecodeUTF32(s, size, errors, 0);
+ else if (strcmp(lower, "ascii") == 0)
+ return PyUnicode_DecodeASCII(s, size, errors);
+ else if (strcmp(lower, "utf-16") == 0)
+ return PyUnicode_DecodeUTF16(s, size, errors, 0);
+ else if (strcmp(lower, "utf-32") == 0)
+ return PyUnicode_DecodeUTF32(s, size, errors, 0);
+ }
/* Decode via the codec registry */
buffer = NULL;
@@ -1378,11 +1614,77 @@ PyObject *PyUnicode_AsEncodedObject(PyObject *unicode,
return NULL;
}
+PyObject *
+PyUnicode_EncodeFSDefault(PyObject *unicode)
+{
+#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
+ return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode),
+ PyUnicode_GET_SIZE(unicode),
+ NULL);
+#elif defined(__APPLE__)
+ return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode),
+ PyUnicode_GET_SIZE(unicode),
+ "surrogateescape");
+#else
+ PyInterpreterState *interp = PyThreadState_GET()->interp;
+ /* Bootstrap check: if the filesystem codec is implemented in Python, we
+ cannot use it to encode and decode filenames before it is loaded. Load
+ the Python codec requires to encode at least its own filename. Use the C
+ version of the locale codec until the codec registry is initialized and
+ the Python codec is loaded.
+
+ Py_FileSystemDefaultEncoding is shared between all interpreters, we
+ cannot only rely on it: check also interp->fscodec_initialized for
+ subinterpreters. */
+ if (Py_FileSystemDefaultEncoding && interp->fscodec_initialized) {
+ return PyUnicode_AsEncodedString(unicode,
+ Py_FileSystemDefaultEncoding,
+ "surrogateescape");
+ }
+ else {
+ /* locale encoding with surrogateescape */
+ wchar_t *wchar;
+ char *bytes;
+ PyObject *bytes_obj;
+ size_t error_pos;
+
+ wchar = PyUnicode_AsWideCharString(unicode, NULL);
+ if (wchar == NULL)
+ return NULL;
+ bytes = _Py_wchar2char(wchar, &error_pos);
+ if (bytes == NULL) {
+ if (error_pos != (size_t)-1) {
+ char *errmsg = strerror(errno);
+ PyObject *exc = NULL;
+ if (errmsg == NULL)
+ errmsg = "Py_wchar2char() failed";
+ raise_encode_exception(&exc,
+ "filesystemencoding",
+ PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode),
+ error_pos, error_pos+1,
+ errmsg);
+ Py_XDECREF(exc);
+ }
+ else
+ PyErr_NoMemory();
+ PyMem_Free(wchar);
+ return NULL;
+ }
+ PyMem_Free(wchar);
+
+ bytes_obj = PyBytes_FromString(bytes);
+ PyMem_Free(bytes);
+ return bytes_obj;
+ }
+#endif
+}
+
PyObject *PyUnicode_AsEncodedString(PyObject *unicode,
const char *encoding,
const char *errors)
{
PyObject *v;
+ char lower[11]; /* Enough for any encoding shortcut */
if (!PyUnicode_Check(unicode)) {
PyErr_BadArgument();
@@ -1393,31 +1695,42 @@ PyObject *PyUnicode_AsEncodedString(PyObject *unicode,
encoding = PyUnicode_GetDefaultEncoding();
/* Shortcuts for common default encodings */
- if (errors == NULL) {
- if (strcmp(encoding, "utf-8") == 0)
- return PyUnicode_AsUTF8String(unicode);
- else if (strcmp(encoding, "latin-1") == 0)
- return PyUnicode_AsLatin1String(unicode);
+ if (normalize_encoding(encoding, lower, sizeof(lower))) {
+ if (strcmp(lower, "utf-8") == 0)
+ return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode),
+ PyUnicode_GET_SIZE(unicode),
+ errors);
+ else if ((strcmp(lower, "latin-1") == 0) ||
+ (strcmp(lower, "iso-8859-1") == 0))
+ return PyUnicode_EncodeLatin1(PyUnicode_AS_UNICODE(unicode),
+ PyUnicode_GET_SIZE(unicode),
+ errors);
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
- else if (strcmp(encoding, "mbcs") == 0)
- return PyUnicode_AsMBCSString(unicode);
+ else if (strcmp(lower, "mbcs") == 0)
+ return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode),
+ PyUnicode_GET_SIZE(unicode),
+ errors);
#endif
- else if (strcmp(encoding, "ascii") == 0)
- return PyUnicode_AsASCIIString(unicode);
- /* During bootstrap, we may need to find the encodings
- package, to load the file system encoding, and require the
- file system encoding in order to load the encodings
- package.
-
- Break out of this dependency by assuming that the path to
- the encodings module is ASCII-only. XXX could try wcstombs
- instead, if the file system encoding is the locale's
- encoding. */
- else if (Py_FileSystemDefaultEncoding &&
- strcmp(encoding, Py_FileSystemDefaultEncoding) == 0 &&
- !PyThreadState_GET()->interp->codecs_initialized)
- return PyUnicode_AsASCIIString(unicode);
- }
+ else if (strcmp(lower, "ascii") == 0)
+ return PyUnicode_EncodeASCII(PyUnicode_AS_UNICODE(unicode),
+ PyUnicode_GET_SIZE(unicode),
+ errors);
+ }
+ /* During bootstrap, we may need to find the encodings
+ package, to load the file system encoding, and require the
+ file system encoding in order to load the encodings
+ package.
+
+ Break out of this dependency by assuming that the path to
+ the encodings module is ASCII-only. XXX could try wcstombs
+ instead, if the file system encoding is the locale's
+ encoding. */
+ if (Py_FileSystemDefaultEncoding &&
+ strcmp(encoding, Py_FileSystemDefaultEncoding) == 0 &&
+ !PyThreadState_GET()->interp->codecs_initialized)
+ return PyUnicode_EncodeASCII(PyUnicode_AS_UNICODE(unicode),
+ PyUnicode_GET_SIZE(unicode),
+ errors);
/* Encode via the codec registry */
v = PyCodec_Encode(unicode, encoding, errors);
@@ -1430,12 +1743,13 @@ PyObject *PyUnicode_AsEncodedString(PyObject *unicode,
/* If the codec returns a buffer, raise a warning and convert to bytes */
if (PyByteArray_Check(v)) {
- char msg[100];
+ int error;
PyObject *b;
- PyOS_snprintf(msg, sizeof(msg),
- "encoder %s returned buffer instead of bytes",
- encoding);
- if (PyErr_WarnEx(PyExc_RuntimeWarning, msg, 1) < 0) {
+
+ error = PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
+ "encoder %s returned bytearray instead of bytes",
+ encoding);
+ if (error) {
Py_DECREF(v);
return NULL;
}
@@ -1509,32 +1823,48 @@ PyUnicode_DecodeFSDefault(const char *s) {
PyObject*
PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
{
- /* During the early bootstrapping process, Py_FileSystemDefaultEncoding
- can be undefined. If it is case, decode using UTF-8. The following assumes
- that Py_FileSystemDefaultEncoding is set to a built-in encoding during the
- bootstrapping process where the codecs aren't ready yet.
- */
- if (Py_FileSystemDefaultEncoding) {
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
- if (strcmp(Py_FileSystemDefaultEncoding, "mbcs") == 0) {
- return PyUnicode_DecodeMBCS(s, size, "replace");
- }
+ return PyUnicode_DecodeMBCS(s, size, NULL);
#elif defined(__APPLE__)
- if (strcmp(Py_FileSystemDefaultEncoding, "utf-8") == 0) {
- return PyUnicode_DecodeUTF8(s, size, "replace");
- }
-#endif
+ return PyUnicode_DecodeUTF8(s, size, "surrogateescape");
+#else
+ PyInterpreterState *interp = PyThreadState_GET()->interp;
+ /* Bootstrap check: if the filesystem codec is implemented in Python, we
+ cannot use it to encode and decode filenames before it is loaded. Load
+ the Python codec requires to encode at least its own filename. Use the C
+ version of the locale codec until the codec registry is initialized and
+ the Python codec is loaded.
+
+ Py_FileSystemDefaultEncoding is shared between all interpreters, we
+ cannot only rely on it: check also interp->fscodec_initialized for
+ subinterpreters. */
+ if (Py_FileSystemDefaultEncoding && interp->fscodec_initialized) {
return PyUnicode_Decode(s, size,
Py_FileSystemDefaultEncoding,
- "replace");
+ "surrogateescape");
}
else {
- return PyUnicode_DecodeUTF8(s, size, "replace");
+ /* locale encoding with surrogateescape */
+ wchar_t *wchar;
+ PyObject *unicode;
+ size_t len;
+
+ if (s[size] != '\0' || size != strlen(s)) {
+ PyErr_SetString(PyExc_TypeError, "embedded NUL character");
+ return NULL;
+ }
+
+ wchar = _Py_char2wchar(s, &len);
+ if (wchar == NULL)
+ return PyErr_NoMemory();
+
+ unicode = PyUnicode_FromWideChar(wchar, len);
+ PyMem_Free(wchar);
+ return unicode;
}
+#endif
}
-/* Convert the argument to a bytes object, according to the file
- system encoding */
int
PyUnicode_FSConverter(PyObject* arg, void* addr)
@@ -1546,7 +1876,7 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
Py_DECREF(*(PyObject**)addr);
return 1;
}
- if (PyBytes_Check(arg) || PyByteArray_Check(arg)) {
+ if (PyBytes_Check(arg)) {
output = arg;
Py_INCREF(output);
}
@@ -1554,9 +1884,7 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
arg = PyUnicode_FromObject(arg);
if (!arg)
return 0;
- output = PyUnicode_AsEncodedObject(arg,
- Py_FileSystemDefaultEncoding,
- "surrogateescape");
+ output = PyUnicode_EncodeFSDefault(arg);
Py_DECREF(arg);
if (!output)
return 0;
@@ -1566,15 +1894,50 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
return 0;
}
}
- if (PyBytes_Check(output)) {
- size = PyBytes_GET_SIZE(output);
- data = PyBytes_AS_STRING(output);
+ size = PyBytes_GET_SIZE(output);
+ data = PyBytes_AS_STRING(output);
+ if (size != strlen(data)) {
+ PyErr_SetString(PyExc_TypeError, "embedded NUL character");
+ Py_DECREF(output);
+ return 0;
+ }
+ *(PyObject**)addr = output;
+ return Py_CLEANUP_SUPPORTED;
+}
+
+
+int
+PyUnicode_FSDecoder(PyObject* arg, void* addr)
+{
+ PyObject *output = NULL;
+ Py_ssize_t size;
+ void *data;
+ if (arg == NULL) {
+ Py_DECREF(*(PyObject**)addr);
+ return 1;
+ }
+ if (PyUnicode_Check(arg)) {
+ output = arg;
+ Py_INCREF(output);
}
else {
- size = PyByteArray_GET_SIZE(output);
- data = PyByteArray_AS_STRING(output);
+ arg = PyBytes_FromObject(arg);
+ if (!arg)
+ return 0;
+ output = PyUnicode_DecodeFSDefaultAndSize(PyBytes_AS_STRING(arg),
+ PyBytes_GET_SIZE(arg));
+ Py_DECREF(arg);
+ if (!output)
+ return 0;
+ if (!PyUnicode_Check(output)) {
+ Py_DECREF(output);
+ PyErr_SetString(PyExc_TypeError, "decoder failed to return unicode");
+ return 0;
+ }
}
- if (size != strlen(data)) {
+ size = PyUnicode_GET_SIZE(output);
+ data = PyUnicode_AS_UNICODE(output);
+ if (size != Py_UNICODE_strlen(data)) {
PyErr_SetString(PyExc_TypeError, "embedded NUL character");
Py_DECREF(output);
return 0;
@@ -1632,18 +1995,34 @@ Py_ssize_t PyUnicode_GetSize(PyObject *unicode)
const char *PyUnicode_GetDefaultEncoding(void)
{
- return unicode_default_encoding;
+ return "utf-8";
}
-int PyUnicode_SetDefaultEncoding(const char *encoding)
+/* create or adjust a UnicodeDecodeError */
+static void
+make_decode_exception(PyObject **exceptionObject,
+ const char *encoding,
+ const char *input, Py_ssize_t length,
+ Py_ssize_t startpos, Py_ssize_t endpos,
+ const char *reason)
{
- if (strcmp(encoding, unicode_default_encoding) != 0) {
- PyErr_Format(PyExc_ValueError,
- "Can only set default encoding to %s",
- unicode_default_encoding);
- return -1;
+ if (*exceptionObject == NULL) {
+ *exceptionObject = PyUnicodeDecodeError_Create(
+ encoding, input, length, startpos, endpos, reason);
}
- return 0;
+ else {
+ if (PyUnicodeDecodeError_SetStart(*exceptionObject, startpos))
+ goto onError;
+ if (PyUnicodeDecodeError_SetEnd(*exceptionObject, endpos))
+ goto onError;
+ if (PyUnicodeDecodeError_SetReason(*exceptionObject, reason))
+ goto onError;
+ }
+ return;
+
+onError:
+ Py_DECREF(*exceptionObject);
+ *exceptionObject = NULL;
}
/* error handling callback helper:
@@ -1679,20 +2058,13 @@ int unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler
goto onError;
}
- if (*exceptionObject == NULL) {
- *exceptionObject = PyUnicodeDecodeError_Create(
- encoding, *input, *inend-*input, *startinpos, *endinpos, reason);
- if (*exceptionObject == NULL)
- goto onError;
- }
- else {
- if (PyUnicodeDecodeError_SetStart(*exceptionObject, *startinpos))
- goto onError;
- if (PyUnicodeDecodeError_SetEnd(*exceptionObject, *endinpos))
- goto onError;
- if (PyUnicodeDecodeError_SetReason(*exceptionObject, reason))
- goto onError;
- }
+ make_decode_exception(exceptionObject,
+ encoding,
+ *input, *inend - *input,
+ *startinpos, *endinpos,
+ reason);
+ if (*exceptionObject == NULL)
+ goto onError;
restuple = PyObject_CallFunctionObjArgs(*errorHandler, *exceptionObject, NULL);
if (restuple == NULL)
@@ -2408,6 +2780,120 @@ PyObject *PyUnicode_DecodeUTF8Stateful(const char *s,
#undef ASCII_CHAR_MASK
+#ifdef __APPLE__
+
+/* Simplified UTF-8 decoder using surrogateescape error handler,
+ used to decode the command line arguments on Mac OS X. */
+
+wchar_t*
+_Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size)
+{
+ int n;
+ const char *e;
+ wchar_t *unicode, *p;
+
+ /* Note: size will always be longer than the resulting Unicode
+ character count */
+ if (PY_SSIZE_T_MAX / sizeof(wchar_t) < (size + 1)) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ unicode = PyMem_Malloc((size + 1) * sizeof(wchar_t));
+ if (!unicode)
+ return NULL;
+
+ /* Unpack UTF-8 encoded data */
+ p = unicode;
+ e = s + size;
+ while (s < e) {
+ Py_UCS4 ch = (unsigned char)*s;
+
+ if (ch < 0x80) {
+ *p++ = (wchar_t)ch;
+ s++;
+ continue;
+ }
+
+ n = utf8_code_length[ch];
+ if (s + n > e) {
+ goto surrogateescape;
+ }
+
+ switch (n) {
+ case 0:
+ case 1:
+ goto surrogateescape;
+
+ case 2:
+ if ((s[1] & 0xc0) != 0x80)
+ goto surrogateescape;
+ ch = ((s[0] & 0x1f) << 6) + (s[1] & 0x3f);
+ assert ((ch > 0x007F) && (ch <= 0x07FF));
+ *p++ = (wchar_t)ch;
+ break;
+
+ case 3:
+ /* Decoding UTF-8 sequences in range \xed\xa0\x80-\xed\xbf\xbf
+ will result in surrogates in range d800-dfff. Surrogates are
+ not valid UTF-8 so they are rejected.
+ See http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf
+ (table 3-7) and http://www.rfc-editor.org/rfc/rfc3629.txt */
+ if ((s[1] & 0xc0) != 0x80 ||
+ (s[2] & 0xc0) != 0x80 ||
+ ((unsigned char)s[0] == 0xE0 &&
+ (unsigned char)s[1] < 0xA0) ||
+ ((unsigned char)s[0] == 0xED &&
+ (unsigned char)s[1] > 0x9F)) {
+
+ goto surrogateescape;
+ }
+ ch = ((s[0] & 0x0f) << 12) + ((s[1] & 0x3f) << 6) + (s[2] & 0x3f);
+ assert ((ch > 0x07FF) && (ch <= 0xFFFF));
+ *p++ = (Py_UNICODE)ch;
+ break;
+
+ case 4:
+ if ((s[1] & 0xc0) != 0x80 ||
+ (s[2] & 0xc0) != 0x80 ||
+ (s[3] & 0xc0) != 0x80 ||
+ ((unsigned char)s[0] == 0xF0 &&
+ (unsigned char)s[1] < 0x90) ||
+ ((unsigned char)s[0] == 0xF4 &&
+ (unsigned char)s[1] > 0x8F)) {
+ goto surrogateescape;
+ }
+ ch = ((s[0] & 0x7) << 18) + ((s[1] & 0x3f) << 12) +
+ ((s[2] & 0x3f) << 6) + (s[3] & 0x3f);
+ assert ((ch > 0xFFFF) && (ch <= 0x10ffff));
+
+#if SIZEOF_WCHAR_T == 4
+ *p++ = (wchar_t)ch;
+#else
+ /* compute and append the two surrogates: */
+
+ /* translate from 10000..10FFFF to 0..FFFF */
+ ch -= 0x10000;
+
+ /* high surrogate = top 10 bits added to D800 */
+ *p++ = (wchar_t)(0xD800 + (ch >> 10));
+
+ /* low surrogate = bottom 10 bits added to DC00 */
+ *p++ = (wchar_t)(0xDC00 + (ch & 0x03FF));
+#endif
+ break;
+ }
+ s += n;
+ continue;
+
+ surrogateescape:
+ *p++ = 0xDC00 + ch;
+ s++;
+ }
+ *p = L'\0';
+ return unicode;
+}
+
+#endif /* __APPLE__ */
/* Allocation strategy: if the string is short, convert into a stack buffer
and allocate exactly as much space needed at the end. Else allocate the
@@ -3366,7 +3852,7 @@ PyObject *PyUnicode_DecodeUnicodeEscape(const char *s,
}
for (i = 0; i < digits; ++i) {
c = (unsigned char) s[i];
- if (!ISXDIGIT(c)) {
+ if (!Py_ISXDIGIT(c)) {
endinpos = (s+i+1)-starts;
if (unicode_decode_call_errorhandler(
errors, &errorHandler,
@@ -3732,7 +4218,7 @@ PyObject *PyUnicode_DecodeRawUnicodeEscape(const char *s,
outpos = p-PyUnicode_AS_UNICODE(v);
for (x = 0, i = 0; i < count; ++i, ++s) {
c = (unsigned char)*s;
- if (!ISXDIGIT(c)) {
+ if (!Py_ISXDIGIT(c)) {
endinpos = s-starts;
if (unicode_decode_call_errorhandler(
errors, &errorHandler,
@@ -4431,32 +4917,46 @@ static int is_dbcs_lead_byte(const char *s, int offset)
static int decode_mbcs(PyUnicodeObject **v,
const char *s, /* MBCS string */
int size, /* sizeof MBCS string */
- int final)
+ int final,
+ const char *errors)
{
Py_UNICODE *p;
- Py_ssize_t n = 0;
- int usize = 0;
+ Py_ssize_t n;
+ DWORD usize;
+ DWORD flags;
assert(size >= 0);
+ /* check and handle 'errors' arg */
+ if (errors==NULL || strcmp(errors, "strict")==0)
+ flags = MB_ERR_INVALID_CHARS;
+ else if (strcmp(errors, "ignore")==0)
+ flags = 0;
+ else {
+ PyErr_Format(PyExc_ValueError,
+ "mbcs encoding does not support errors='%s'",
+ errors);
+ return -1;
+ }
+
/* Skip trailing lead-byte unless 'final' is set */
if (!final && size >= 1 && is_dbcs_lead_byte(s, size - 1))
--size;
/* First get the size of the result */
if (size > 0) {
- usize = MultiByteToWideChar(CP_ACP, 0, s, size, NULL, 0);
- if (usize == 0) {
- PyErr_SetFromWindowsErrWithFilename(0, NULL);
- return -1;
- }
- }
+ usize = MultiByteToWideChar(CP_ACP, flags, s, size, NULL, 0);
+ if (usize==0)
+ goto mbcs_decode_error;
+ } else
+ usize = 0;
if (*v == NULL) {
/* Create unicode object */
*v = _PyUnicode_New(usize);
if (*v == NULL)
return -1;
+ n = 0;
}
else {
/* Extend unicode object */
@@ -4466,15 +4966,35 @@ static int decode_mbcs(PyUnicodeObject **v,
}
/* Do the conversion */
- if (size > 0) {
+ if (usize > 0) {
p = PyUnicode_AS_UNICODE(*v) + n;
- if (0 == MultiByteToWideChar(CP_ACP, 0, s, size, p, usize)) {
- PyErr_SetFromWindowsErrWithFilename(0, NULL);
- return -1;
+ if (0 == MultiByteToWideChar(CP_ACP, flags, s, size, p, usize)) {
+ goto mbcs_decode_error;
}
}
-
return size;
+
+mbcs_decode_error:
+ /* If the last error was ERROR_NO_UNICODE_TRANSLATION, then
+ we raise a UnicodeDecodeError - else it is a 'generic'
+ windows error
+ */
+ if (GetLastError()==ERROR_NO_UNICODE_TRANSLATION) {
+ /* Ideally, we should get reason from FormatMessage - this
+ is the Windows 2000 English version of the message
+ */
+ PyObject *exc = NULL;
+ const char *reason = "No mapping for the Unicode character exists "
+ "in the target multi-byte code page.";
+ make_decode_exception(&exc, "mbcs", s, size, 0, 0, reason);
+ if (exc != NULL) {
+ PyCodec_StrictErrors(exc);
+ Py_DECREF(exc);
+ }
+ } else {
+ PyErr_SetFromWindowsErrWithFilename(0, NULL);
+ }
+ return -1;
}
PyObject *PyUnicode_DecodeMBCSStateful(const char *s,
@@ -4491,10 +5011,10 @@ PyObject *PyUnicode_DecodeMBCSStateful(const char *s,
#ifdef NEED_RETRY
retry:
if (size > INT_MAX)
- done = decode_mbcs(&v, s, INT_MAX, 0);
+ done = decode_mbcs(&v, s, INT_MAX, 0, errors);
else
#endif
- done = decode_mbcs(&v, s, (int)size, !consumed);
+ done = decode_mbcs(&v, s, (int)size, !consumed, errors);
if (done < 0) {
Py_XDECREF(v);
@@ -4528,20 +5048,45 @@ PyObject *PyUnicode_DecodeMBCS(const char *s,
*/
static int encode_mbcs(PyObject **repr,
const Py_UNICODE *p, /* unicode */
- int size) /* size of unicode */
+ int size, /* size of unicode */
+ const char* errors)
{
- int mbcssize = 0;
- Py_ssize_t n = 0;
+ BOOL usedDefaultChar = FALSE;
+ BOOL *pusedDefaultChar;
+ int mbcssize;
+ Py_ssize_t n;
+ PyObject *exc = NULL;
+ DWORD flags;
assert(size >= 0);
+ /* check and handle 'errors' arg */
+ if (errors==NULL || strcmp(errors, "strict")==0) {
+ flags = WC_NO_BEST_FIT_CHARS;
+ pusedDefaultChar = &usedDefaultChar;
+ } else if (strcmp(errors, "replace")==0) {
+ flags = 0;
+ pusedDefaultChar = NULL;
+ } else {
+ PyErr_Format(PyExc_ValueError,
+ "mbcs encoding does not support errors='%s'",
+ errors);
+ return -1;
+ }
+
/* First get the size of the result */
if (size > 0) {
- mbcssize = WideCharToMultiByte(CP_ACP, 0, p, size, NULL, 0, NULL, NULL);
+ mbcssize = WideCharToMultiByte(CP_ACP, flags, p, size, NULL, 0,
+ NULL, pusedDefaultChar);
if (mbcssize == 0) {
PyErr_SetFromWindowsErrWithFilename(0, NULL);
return -1;
}
+ /* If we used a default char, then we failed! */
+ if (pusedDefaultChar && *pusedDefaultChar)
+ goto mbcs_encode_error;
+ } else {
+ mbcssize = 0;
}
if (*repr == NULL) {
@@ -4549,6 +5094,7 @@ static int encode_mbcs(PyObject **repr,
*repr = PyBytes_FromStringAndSize(NULL, mbcssize);
if (*repr == NULL)
return -1;
+ n = 0;
}
else {
/* Extend string object */
@@ -4560,13 +5106,20 @@ static int encode_mbcs(PyObject **repr,
/* Do the conversion */
if (size > 0) {
char *s = PyBytes_AS_STRING(*repr) + n;
- if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, NULL)) {
+ if (0 == WideCharToMultiByte(CP_ACP, flags, p, size, s, mbcssize,
+ NULL, pusedDefaultChar)) {
PyErr_SetFromWindowsErrWithFilename(0, NULL);
return -1;
}
+ if (pusedDefaultChar && *pusedDefaultChar)
+ goto mbcs_encode_error;
}
-
return 0;
+
+mbcs_encode_error:
+ raise_encode_exception(&exc, "mbcs", p, size, 0, 0, "invalid character");
+ Py_XDECREF(exc);
+ return -1;
}
PyObject *PyUnicode_EncodeMBCS(const Py_UNICODE *p,
@@ -4579,10 +5132,10 @@ PyObject *PyUnicode_EncodeMBCS(const Py_UNICODE *p,
#ifdef NEED_RETRY
retry:
if (size > INT_MAX)
- ret = encode_mbcs(&repr, p, INT_MAX);
+ ret = encode_mbcs(&repr, p, INT_MAX, errors);
else
#endif
- ret = encode_mbcs(&repr, p, (int)size);
+ ret = encode_mbcs(&repr, p, (int)size, errors);
if (ret < 0) {
Py_XDECREF(repr);
@@ -5699,6 +6252,30 @@ PyObject *PyUnicode_Translate(PyObject *str,
return NULL;
}
+PyObject *
+PyUnicode_TransformDecimalToASCII(Py_UNICODE *s,
+ Py_ssize_t length)
+{
+ PyObject *result;
+ Py_UNICODE *p; /* write pointer into result */
+ Py_ssize_t i;
+ /* Copy to a new string */
+ result = (PyObject *)_PyUnicode_New(length);
+ Py_UNICODE_COPY(PyUnicode_AS_UNICODE(result), s, length);
+ if (result == NULL)
+ return result;
+ p = PyUnicode_AS_UNICODE(result);
+ /* Iterate over code points */
+ for (i = 0; i < length; i++) {
+ Py_UNICODE ch =s[i];
+ if (ch > 127) {
+ int decimal = Py_UNICODE_TODECIMAL(ch);
+ if (decimal >= 0)
+ p[i] = '0' + decimal;
+ }
+ }
+ return result;
+}
/* --- Decimal Encoder ---------------------------------------------------- */
int PyUnicode_EncodeDecimal(Py_UNICODE *s,
@@ -5840,28 +6417,30 @@ int PyUnicode_EncodeDecimal(Py_UNICODE *s,
#include "stringlib/unicodedefs.h"
#include "stringlib/fastsearch.h"
+
#include "stringlib/count.h"
-/* Include _ParseTupleFinds from find.h */
-#define FROM_UNICODE
#include "stringlib/find.h"
#include "stringlib/partition.h"
+#include "stringlib/split.h"
#define _Py_InsertThousandsGrouping _PyUnicode_InsertThousandsGrouping
#define _Py_InsertThousandsGroupingLocale _PyUnicode_InsertThousandsGroupingLocale
#include "stringlib/localeutil.h"
/* helper macro to fixup start/end slice values */
-#define FIX_START_END(obj) \
- if (start < 0) \
- start += (obj)->length; \
- if (start < 0) \
- start = 0; \
- if (end > (obj)->length) \
- end = (obj)->length; \
- if (end < 0) \
- end += (obj)->length; \
- if (end < 0) \
- end = 0;
+#define ADJUST_INDICES(start, end, len) \
+ if (end > len) \
+ end = len; \
+ else if (end < 0) { \
+ end += len; \
+ if (end < 0) \
+ end = 0; \
+ } \
+ if (start < 0) { \
+ start += len; \
+ if (start < 0) \
+ start = 0; \
+ }
Py_ssize_t PyUnicode_Count(PyObject *str,
PyObject *substr,
@@ -5881,10 +6460,10 @@ Py_ssize_t PyUnicode_Count(PyObject *str,
return -1;
}
- FIX_START_END(str_obj);
-
+ ADJUST_INDICES(start, end, str_obj->length);
result = stringlib_count(
- str_obj->str + start, end - start, sub_obj->str, sub_obj->length
+ str_obj->str + start, end - start, sub_obj->str, sub_obj->length,
+ PY_SSIZE_T_MAX
);
Py_DECREF(sub_obj);
@@ -5939,8 +6518,7 @@ int tailmatch(PyUnicodeObject *self,
if (substring->length == 0)
return 1;
- FIX_START_END(self);
-
+ ADJUST_INDICES(start, end, self->length);
end -= substring->length;
if (end < start)
return 0;
@@ -6281,305 +6859,40 @@ PyUnicodeObject *pad(PyUnicodeObject *self,
return u;
}
-#define SPLIT_APPEND(data, left, right) \
- str = PyUnicode_FromUnicode((data) + (left), (right) - (left)); \
- if (!str) \
- goto onError; \
- if (PyList_Append(list, str)) { \
- Py_DECREF(str); \
- goto onError; \
- } \
- else \
- Py_DECREF(str);
-
-static
-PyObject *split_whitespace(PyUnicodeObject *self,
- PyObject *list,
- Py_ssize_t maxcount)
+PyObject *PyUnicode_Splitlines(PyObject *string, int keepends)
{
- register Py_ssize_t i;
- register Py_ssize_t j;
- Py_ssize_t len = self->length;
- PyObject *str;
- register const Py_UNICODE *buf = self->str;
-
- for (i = j = 0; i < len; ) {
- /* find a token */
- while (i < len && Py_UNICODE_ISSPACE(buf[i]))
- i++;
- j = i;
- while (i < len && !Py_UNICODE_ISSPACE(buf[i]))
- i++;
- if (j < i) {
- if (maxcount-- <= 0)
- break;
- SPLIT_APPEND(buf, j, i);
- while (i < len && Py_UNICODE_ISSPACE(buf[i]))
- i++;
- j = i;
- }
- }
- if (j < len) {
- SPLIT_APPEND(buf, j, len);
- }
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
-PyObject *PyUnicode_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 = PyUnicode_FromObject(string);
if (string == NULL)
return NULL;
- data = PyUnicode_AS_UNICODE(string);
- len = PyUnicode_GET_SIZE(string);
-
- list = PyList_New(0);
- if (!list)
- goto onError;
- for (i = j = 0; i < len; ) {
- Py_ssize_t eol;
+ list = stringlib_splitlines(
+ (PyObject*) string, PyUnicode_AS_UNICODE(string),
+ PyUnicode_GET_SIZE(string), keepends);
- /* Find a line and append it */
- while (i < len && !BLOOM_LINEBREAK(data[i]))
- i++;
-
- /* Skip the line break reading CRLF as one line break */
- eol = i;
- if (i < len) {
- if (data[i] == '\r' && i + 1 < len &&
- data[i+1] == '\n')
- i += 2;
- else
- i++;
- if (keepends)
- eol = i;
- }
- SPLIT_APPEND(data, j, eol);
- j = i;
- }
- if (j < len) {
- SPLIT_APPEND(data, j, len);
- }
-
- Py_DECREF(string);
- return list;
-
- onError:
- Py_XDECREF(list);
Py_DECREF(string);
- return NULL;
-}
-
-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;
- register const Py_UNICODE *buf = self->str;
-
- for (i = j = 0; i < len; ) {
- if (buf[i] == ch) {
- if (maxcount-- <= 0)
- break;
- SPLIT_APPEND(buf, j, i);
- i = j = i + 1;
- } else
- i++;
- }
- if (j <= len) {
- SPLIT_APPEND(buf, j, len);
- }
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
-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 (Py_UNICODE_MATCH(self, i, substring)) {
- if (maxcount-- <= 0)
- break;
- SPLIT_APPEND(self->str, j, i);
- i = j = i + sublen;
- } else
- i++;
- }
- if (j <= len) {
- SPLIT_APPEND(self->str, j, len);
- }
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
-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;
- register const Py_UNICODE *buf = self->str;
-
- for (i = j = len - 1; i >= 0; ) {
- /* find a token */
- while (i >= 0 && Py_UNICODE_ISSPACE(buf[i]))
- i--;
- j = i;
- while (i >= 0 && !Py_UNICODE_ISSPACE(buf[i]))
- i--;
- if (j > i) {
- if (maxcount-- <= 0)
- break;
- SPLIT_APPEND(buf, i + 1, j + 1);
- while (i >= 0 && Py_UNICODE_ISSPACE(buf[i]))
- i--;
- j = i;
- }
- }
- if (j >= 0) {
- SPLIT_APPEND(buf, 0, j + 1);
- }
- if (PyList_Reverse(list) < 0)
- goto onError;
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
-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;
- register const Py_UNICODE *buf = self->str;
-
- for (i = j = len - 1; i >= 0; ) {
- if (buf[i] == ch) {
- if (maxcount-- <= 0)
- break;
- SPLIT_APPEND(buf, i + 1, j + 1);
- j = i = i - 1;
- } else
- i--;
- }
- if (j >= -1) {
- SPLIT_APPEND(buf, 0, j + 1);
- }
- if (PyList_Reverse(list) < 0)
- goto onError;
return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
}
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 (Py_UNICODE_MATCH(self, i, substring)) {
- if (maxcount-- <= 0)
- break;
- SPLIT_APPEND(self->str, i + sublen, j);
- j = i;
- i -= sublen;
- } else
- i--;
- }
- if (j >= 0) {
- SPLIT_APPEND(self->str, 0, j);
- }
- if (PyList_Reverse(list) < 0)
- goto onError;
- return list;
-
- onError:
- Py_DECREF(list);
- return NULL;
-}
-
-#undef SPLIT_APPEND
-
-static
PyObject *split(PyUnicodeObject *self,
PyUnicodeObject *substring,
Py_ssize_t maxcount)
{
- PyObject *list;
-
if (maxcount < 0)
maxcount = PY_SSIZE_T_MAX;
- list = PyList_New(0);
- if (!list)
- return NULL;
-
if (substring == NULL)
- return split_whitespace(self,list,maxcount);
-
- else if (substring->length == 1)
- return split_char(self,list,substring->str[0],maxcount);
+ return stringlib_split_whitespace(
+ (PyObject*) self, self->str, self->length, maxcount
+ );
- else if (substring->length == 0) {
- Py_DECREF(list);
- PyErr_SetString(PyExc_ValueError, "empty separator");
- return NULL;
- }
- else
- return split_substring(self,list,substring,maxcount);
+ return stringlib_split(
+ (PyObject*) self, self->str, self->length,
+ substring->str, substring->length,
+ maxcount
+ );
}
static
@@ -6587,28 +6900,19 @@ PyObject *rsplit(PyUnicodeObject *self,
PyUnicodeObject *substring,
Py_ssize_t maxcount)
{
- PyObject *list;
-
if (maxcount < 0)
maxcount = PY_SSIZE_T_MAX;
- list = PyList_New(0);
- if (!list)
- return NULL;
-
if (substring == NULL)
- return rsplit_whitespace(self,list,maxcount);
-
- else if (substring->length == 1)
- return rsplit_char(self,list,substring->str[0],maxcount);
+ return stringlib_rsplit_whitespace(
+ (PyObject*) self, self->str, self->length, maxcount
+ );
- else if (substring->length == 0) {
- Py_DECREF(list);
- PyErr_SetString(PyExc_ValueError, "empty separator");
- return NULL;
- }
- else
- return rsplit_substring(self,list,substring,maxcount);
+ return stringlib_rsplit(
+ (PyObject*) self, self->str, self->length,
+ substring->str, substring->length,
+ maxcount
+ );
}
static
@@ -6621,10 +6925,14 @@ PyObject *replace(PyUnicodeObject *self,
if (maxcount < 0)
maxcount = PY_SSIZE_T_MAX;
+ else if (maxcount == 0 || self->length == 0)
+ goto nothing;
if (str1->length == str2->length) {
- /* same length */
Py_ssize_t i;
+ /* same length */
+ if (str1->length == 0)
+ goto nothing;
if (str1->length == 1) {
/* replace characters */
Py_UNICODE u1, u2;
@@ -6643,8 +6951,8 @@ PyObject *replace(PyUnicodeObject *self,
u->str[i] = u2;
}
} else {
- i = fastsearch(
- self->str, self->length, str1->str, str1->length, FAST_SEARCH
+ i = stringlib_find(
+ self->str, self->length, str1->str, str1->length, 0
);
if (i < 0)
goto nothing;
@@ -6652,14 +6960,20 @@ PyObject *replace(PyUnicodeObject *self,
if (!u)
return NULL;
Py_UNICODE_COPY(u->str, self->str, self->length);
- while (i <= self->length - str1->length)
- if (Py_UNICODE_MATCH(self, i, str1)) {
- if (--maxcount < 0)
- break;
- Py_UNICODE_COPY(u->str+i, str2->str, str2->length);
- i += str1->length;
- } else
- i++;
+
+ /* change everything in-place, starting with this one */
+ Py_UNICODE_COPY(u->str+i, str2->str, str2->length);
+ i += str1->length;
+
+ while ( --maxcount > 0) {
+ i = stringlib_find(self->str+i, self->length-i,
+ str1->str, str1->length,
+ i);
+ if (i == -1)
+ break;
+ Py_UNICODE_COPY(u->str+i, str2->str, str2->length);
+ i += str1->length;
+ }
}
} else {
@@ -6668,9 +6982,8 @@ PyObject *replace(PyUnicodeObject *self,
Py_UNICODE *p;
/* replace strings */
- n = stringlib_count(self->str, self->length, str1->str, str1->length);
- if (n > maxcount)
- n = maxcount;
+ n = stringlib_count(self->str, self->length, str1->str, str1->length,
+ maxcount);
if (n == 0)
goto nothing;
/* new_size = self->length + n * (str2->length - str1->length)); */
@@ -6700,15 +7013,12 @@ PyObject *replace(PyUnicodeObject *self,
if (str1->length > 0) {
while (n-- > 0) {
/* look for next match */
- j = i;
- while (j <= e) {
- if (Py_UNICODE_MATCH(self, j, str1))
- break;
- j++;
- }
- if (j > i) {
- if (j > e)
- break;
+ j = stringlib_find(self->str+i, self->length-i,
+ str1->str, str1->length,
+ i);
+ if (j == -1)
+ break;
+ else if (j > i) {
/* copy unchanged part [i:j] */
Py_UNICODE_COPY(p, self->str+i, j-i);
p += j - i;
@@ -6970,10 +7280,7 @@ PyUnicode_CompareWithASCIIString(PyObject* uni, const char* str)
return ((int)id[i] < (int)str[i]) ? -1 : 1;
/* This check keeps Python strings that end in '\0' from comparing equal
to C strings identical up to that point. */
- if (PyUnicode_GET_SIZE(uni) != i)
- /* We'll say the Python string is longer. */
- return 1;
- if (id[i])
+ if (PyUnicode_GET_SIZE(uni) != i || id[i])
return 1; /* uni is longer */
if (str[i])
return -1; /* str is longer */
@@ -7154,11 +7461,11 @@ unicode_count(PyUnicodeObject *self, PyObject *args)
&start, &end))
return NULL;
- FIX_START_END(self);
-
+ ADJUST_INDICES(start, end, self->length);
result = PyLong_FromSsize_t(
stringlib_count(self->str + start, end - start,
- substring->str, substring->length)
+ substring->str, substring->length,
+ PY_SSIZE_T_MAX)
);
Py_DECREF(substring);
@@ -7167,39 +7474,26 @@ unicode_count(PyUnicodeObject *self, PyObject *args)
}
PyDoc_STRVAR(encode__doc__,
- "S.encode([encoding[, errors]]) -> bytes\n\
+ "S.encode(encoding='utf-8', errors='strict') -> bytes\n\
\n\
-Encode S using the codec registered for encoding. encoding defaults\n\
-to the default encoding. errors may be given to set a different error\n\
+Encode S using the codec registered for encoding. Default encoding\n\
+is 'utf-8'. errors may be given to set a different error\n\
handling scheme. Default is 'strict' meaning that encoding errors raise\n\
a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and\n\
'xmlcharrefreplace' as well as any other name registered with\n\
codecs.register_error that can handle UnicodeEncodeErrors.");
static PyObject *
-unicode_encode(PyUnicodeObject *self, PyObject *args)
+unicode_encode(PyUnicodeObject *self, PyObject *args, PyObject *kwargs)
{
+ static char *kwlist[] = {"encoding", "errors", 0};
char *encoding = NULL;
char *errors = NULL;
- PyObject *v;
- if (!PyArg_ParseTuple(args, "|ss:encode", &encoding, &errors))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:encode",
+ kwlist, &encoding, &errors))
return NULL;
- v = PyUnicode_AsEncodedString((PyObject *)self, encoding, errors);
- if (v == NULL)
- goto onError;
- if (!PyBytes_Check(v)) {
- PyErr_Format(PyExc_TypeError,
- "encoder did not return a bytes object "
- "(type=%.400s)",
- Py_TYPE(v)->tp_name);
- Py_DECREF(v);
- return NULL;
- }
- return v;
-
- onError:
- return NULL;
+ return PyUnicode_AsEncodedString((PyObject *)self, encoding, errors);
}
PyDoc_STRVAR(expandtabs__doc__,
@@ -7334,12 +7628,12 @@ unicode_getitem(PyUnicodeObject *self, Py_ssize_t index)
/* Believe it or not, this produces the same value for ASCII strings
as string_hash(). */
-static long
+static Py_hash_t
unicode_hash(PyUnicodeObject *self)
{
Py_ssize_t len;
Py_UNICODE *p;
- long x;
+ Py_hash_t x;
if (self->hash != -1)
return self->hash;
@@ -8704,6 +8998,13 @@ unicode_freelistsize(PyUnicodeObject *self)
{
return PyLong_FromLong(numfree);
}
+
+static PyObject *
+unicode__decimal2ascii(PyObject *self)
+{
+ return PyUnicode_TransformDecimalToASCII(PyUnicode_AS_UNICODE(self),
+ PyUnicode_GET_SIZE(self));
+}
#endif
PyDoc_STRVAR(startswith__doc__,
@@ -8810,6 +9111,12 @@ PyDoc_STRVAR(format__doc__,
Return a formatted version of S, using substitutions from args and kwargs.\n\
The substitutions are identified by braces ('{' and '}').");
+PyDoc_STRVAR(format_map__doc__,
+ "S.format_map(mapping) -> str\n\
+\n\
+Return a formatted version of S, using substitutions from mapping.\n\
+The substitutions are identified by braces ('{' and '}').");
+
static PyObject *
unicode__format__(PyObject* self, PyObject* args)
{
@@ -8844,13 +9151,12 @@ unicode_getnewargs(PyUnicodeObject *v)
return Py_BuildValue("(u#)", v->str, v->length);
}
-
static PyMethodDef unicode_methods[] = {
/* Order is according to common usage: often used methods should
appear first, since lookup is done sequentially. */
- {"encode", (PyCFunction) unicode_encode, METH_VARARGS, encode__doc__},
+ {"encode", (PyCFunction) unicode_encode, METH_VARARGS | METH_KEYWORDS, encode__doc__},
{"replace", (PyCFunction) unicode_replace, METH_VARARGS, replace__doc__},
{"split", (PyCFunction) unicode_split, METH_VARARGS, split__doc__},
{"rsplit", (PyCFunction) unicode_rsplit, METH_VARARGS, rsplit__doc__},
@@ -8891,9 +9197,8 @@ static PyMethodDef unicode_methods[] = {
{"isprintable", (PyCFunction) unicode_isprintable, METH_NOARGS, isprintable__doc__},
{"zfill", (PyCFunction) unicode_zfill, METH_VARARGS, zfill__doc__},
{"format", (PyCFunction) do_string_format, METH_VARARGS | METH_KEYWORDS, format__doc__},
+ {"format_map", (PyCFunction) do_string_format_map, METH_O, format_map__doc__},
{"__format__", (PyCFunction) unicode__format__, METH_VARARGS, p_format__doc__},
- {"_formatter_field_name_split", (PyCFunction) formatter_field_name_split, METH_NOARGS},
- {"_formatter_parser", (PyCFunction) formatter_parser, METH_NOARGS},
{"maketrans", (PyCFunction) unicode_maketrans,
METH_VARARGS | METH_STATIC, maketrans__doc__},
{"__sizeof__", (PyCFunction) unicode__sizeof__, METH_NOARGS, sizeof__doc__},
@@ -8902,8 +9207,9 @@ static PyMethodDef unicode_methods[] = {
#endif
#if 0
- /* This one is just used for debugging the implementation. */
+ /* These methods are just used for debugging the implementation. */
{"freelistsize", (PyCFunction) unicode_freelistsize, METH_NOARGS},
+ {"_decimal2ascii", (PyCFunction) unicode__decimal2ascii, METH_NOARGS},
#endif
{"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS},
@@ -8954,7 +9260,7 @@ unicode_subscript(PyUnicodeObject* self, PyObject* item)
Py_UNICODE* result_buf;
PyObject* result;
- if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self),
+ if (PySlice_GetIndicesEx(item, PyUnicode_GET_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
@@ -10008,6 +10314,15 @@ Py_UNICODE_strncpy(Py_UNICODE *s1, const Py_UNICODE *s2, size_t n)
return s1;
}
+Py_UNICODE*
+Py_UNICODE_strcat(Py_UNICODE *s1, const Py_UNICODE *s2)
+{
+ Py_UNICODE *u1 = s1;
+ u1 += Py_UNICODE_strlen(u1);
+ Py_UNICODE_strcpy(u1, s2);
+ return s1;
+}
+
int
Py_UNICODE_strcmp(const Py_UNICODE *s1, const Py_UNICODE *s2)
{
@@ -10022,6 +10337,23 @@ Py_UNICODE_strcmp(const Py_UNICODE *s1, const Py_UNICODE *s2)
return 0;
}
+int
+Py_UNICODE_strncmp(const Py_UNICODE *s1, const Py_UNICODE *s2, size_t n)
+{
+ register Py_UNICODE u1, u2;
+ for (; n != 0; n--) {
+ u1 = *s1;
+ u2 = *s2;
+ if (u1 != u2)
+ return (u1 < u2) ? -1 : +1;
+ if (u1 == '\0')
+ return 0;
+ s1++;
+ s2++;
+ }
+ return 0;
+}
+
Py_UNICODE*
Py_UNICODE_strchr(const Py_UNICODE *s, Py_UNICODE c)
{
@@ -10032,15 +10364,72 @@ Py_UNICODE_strchr(const Py_UNICODE *s, Py_UNICODE c)
return NULL;
}
+Py_UNICODE*
+Py_UNICODE_strrchr(const Py_UNICODE *s, Py_UNICODE c)
+{
+ const Py_UNICODE *p;
+ p = s + Py_UNICODE_strlen(s);
+ while (p != s) {
+ p--;
+ if (*p == c)
+ return (Py_UNICODE*)p;
+ }
+ return NULL;
+}
-#ifdef __cplusplus
+Py_UNICODE*
+PyUnicode_AsUnicodeCopy(PyObject *object)
+{
+ PyUnicodeObject *unicode = (PyUnicodeObject *)object;
+ Py_UNICODE *copy;
+ Py_ssize_t size;
+
+ /* Ensure we won't overflow the size. */
+ if (PyUnicode_GET_SIZE(unicode) > ((PY_SSIZE_T_MAX / sizeof(Py_UNICODE)) - 1)) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ size = PyUnicode_GET_SIZE(unicode) + 1; /* copy the nul character */
+ size *= sizeof(Py_UNICODE);
+ copy = PyMem_Malloc(size);
+ if (copy == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ memcpy(copy, PyUnicode_AS_UNICODE(unicode), size);
+ return copy;
}
-#endif
+/* A _string module, to export formatter_parser and formatter_field_name_split
+ to the string.Formatter class implemented in Python. */
-/*
- Local variables:
- c-basic-offset: 4
- indent-tabs-mode: nil
- End:
-*/
+static PyMethodDef _string_methods[] = {
+ {"formatter_field_name_split", (PyCFunction) formatter_field_name_split,
+ METH_O, PyDoc_STR("split the argument as a field name")},
+ {"formatter_parser", (PyCFunction) formatter_parser,
+ METH_O, PyDoc_STR("parse the argument as a format string")},
+ {NULL, NULL}
+};
+
+static struct PyModuleDef _string_module = {
+ PyModuleDef_HEAD_INIT,
+ "_string",
+ PyDoc_STR("string helper module"),
+ 0,
+ _string_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__string(void)
+{
+ return PyModule_Create(&_string_module);
+}
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Objects/unicodetype_db.h b/Objects/unicodetype_db.h
index f46f1fb647..88a7912227 100644
--- a/Objects/unicodetype_db.h
+++ b/Objects/unicodetype_db.h
@@ -1,4 +1,4 @@
-/* this file was generated by Tools/unicode/makeunicodedata.py 2.6 */
+/* this file was generated by Tools/unicode/makeunicodedata.py 3.2 */
/* a list of unique character type descriptors */
const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {
@@ -8,24 +8,25 @@ const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {
{0, 0, 0, 0, 0, 48},
{0, 0, 0, 0, 0, 1056},
{0, 0, 0, 0, 0, 1024},
- {0, 0, 0, 0, 0, 1542},
- {0, 0, 0, 1, 1, 1542},
- {0, 0, 0, 2, 2, 1542},
- {0, 0, 0, 3, 3, 1542},
- {0, 0, 0, 4, 4, 1542},
- {0, 0, 0, 5, 5, 1542},
- {0, 0, 0, 6, 6, 1542},
- {0, 0, 0, 7, 7, 1542},
- {0, 0, 0, 8, 8, 1542},
- {0, 0, 0, 9, 9, 1542},
+ {0, 0, 0, 0, 0, 5638},
+ {0, 0, 0, 1, 1, 5638},
+ {0, 0, 0, 2, 2, 5638},
+ {0, 0, 0, 3, 3, 5638},
+ {0, 0, 0, 4, 4, 5638},
+ {0, 0, 0, 5, 5, 5638},
+ {0, 0, 0, 6, 6, 5638},
+ {0, 0, 0, 7, 7, 5638},
+ {0, 0, 0, 8, 8, 5638},
+ {0, 0, 0, 9, 9, 5638},
{0, 32, 0, 0, 0, 1921},
{0, 0, 0, 0, 0, 1536},
{65504, 0, 65504, 0, 0, 1801},
{0, 0, 0, 0, 0, 1801},
- {0, 0, 0, 0, 2, 1028},
- {0, 0, 0, 0, 3, 1028},
+ {0, 0, 0, 0, 2, 5124},
+ {0, 0, 0, 0, 3, 5124},
{743, 0, 743, 0, 0, 1801},
- {0, 0, 0, 0, 1, 1028},
+ {0, 0, 0, 0, 1, 5124},
+ {0, 0, 0, 0, 0, 5120},
{121, 0, 121, 0, 0, 1801},
{0, 1, 0, 0, 0, 1921},
{65535, 0, 65535, 0, 0, 1801},
@@ -63,17 +64,20 @@ const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {
{0, 10795, 0, 0, 0, 1921},
{0, 65373, 0, 0, 0, 1921},
{0, 10792, 0, 0, 0, 1921},
+ {10815, 0, 10815, 0, 0, 1801},
{0, 65341, 0, 0, 0, 1921},
{0, 69, 0, 0, 0, 1921},
{0, 71, 0, 0, 0, 1921},
{10783, 0, 10783, 0, 0, 1801},
{10780, 0, 10780, 0, 0, 1801},
+ {10782, 0, 10782, 0, 0, 1801},
{65326, 0, 65326, 0, 0, 1801},
{65330, 0, 65330, 0, 0, 1801},
{65331, 0, 65331, 0, 0, 1801},
{65334, 0, 65334, 0, 0, 1801},
{65333, 0, 65333, 0, 0, 1801},
{65329, 0, 65329, 0, 0, 1801},
+ {42893, 613, 42893, 0, 0, 3849},
{65327, 0, 65327, 0, 0, 1801},
{65325, 0, 65325, 0, 0, 1801},
{10743, 0, 10743, 0, 0, 1801},
@@ -117,16 +121,16 @@ const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {
{65488, 0, 65488, 0, 0, 1801},
{0, 0, 0, 0, 0, 1537},
{0, 7264, 0, 0, 0, 1921},
- {0, 0, 0, 0, 1, 1540},
- {0, 0, 0, 0, 2, 1540},
- {0, 0, 0, 0, 3, 1540},
- {0, 0, 0, 0, 4, 1540},
- {0, 0, 0, 0, 5, 1540},
- {0, 0, 0, 0, 6, 1540},
- {0, 0, 0, 0, 7, 1540},
- {0, 0, 0, 0, 8, 1540},
- {0, 0, 0, 0, 9, 1540},
- {0, 0, 0, 0, 0, 1792},
+ {0, 0, 0, 0, 1, 5636},
+ {0, 0, 0, 0, 2, 5636},
+ {0, 0, 0, 0, 3, 5636},
+ {0, 0, 0, 0, 4, 5636},
+ {0, 0, 0, 0, 5, 5636},
+ {0, 0, 0, 0, 6, 5636},
+ {0, 0, 0, 0, 7, 5636},
+ {0, 0, 0, 0, 8, 5636},
+ {0, 0, 0, 0, 9, 5636},
+ {0, 0, 0, 0, 0, 5888},
{42877, 7545, 42877, 0, 0, 3849},
{3814, 0, 3814, 0, 0, 1801},
{65477, 0, 65477, 0, 0, 1801},
@@ -149,20 +153,21 @@ const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {
{0, 65424, 0, 0, 0, 1921},
{0, 65408, 0, 0, 0, 1921},
{0, 65410, 0, 0, 0, 1921},
- {0, 0, 0, 0, 0, 1028},
- {0, 0, 0, 0, 4, 1028},
- {0, 0, 0, 0, 5, 1028},
- {0, 0, 0, 0, 6, 1028},
- {0, 0, 0, 0, 7, 1028},
- {0, 0, 0, 0, 8, 1028},
- {0, 0, 0, 0, 9, 1028},
+ {0, 0, 0, 0, 0, 5124},
+ {0, 0, 0, 0, 4, 5124},
+ {0, 0, 0, 0, 5, 5124},
+ {0, 0, 0, 0, 6, 5124},
+ {0, 0, 0, 0, 7, 5124},
+ {0, 0, 0, 0, 8, 5124},
+ {0, 0, 0, 0, 9, 5124},
+ {0, 0, 0, 0, 0, 1792},
{0, 58019, 0, 0, 0, 1921},
{0, 57153, 0, 0, 0, 1921},
{0, 57274, 0, 0, 0, 1921},
{0, 28, 0, 0, 0, 1921},
{65508, 0, 65508, 0, 0, 1801},
- {0, 16, 0, 0, 0, 1792},
- {65520, 0, 65520, 0, 0, 1792},
+ {0, 16, 0, 0, 0, 5888},
+ {65520, 0, 65520, 0, 0, 5888},
{0, 26, 0, 0, 0, 1024},
{65510, 0, 65510, 0, 0, 1024},
{0, 54793, 0, 0, 0, 1921},
@@ -173,214 +178,525 @@ const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {
{0, 54756, 0, 0, 0, 1921},
{0, 54787, 0, 0, 0, 1921},
{0, 54753, 0, 0, 0, 1921},
+ {0, 54754, 0, 0, 0, 1921},
+ {0, 54721, 0, 0, 0, 1921},
{58272, 0, 58272, 0, 0, 1801},
+ {0, 0, 0, 0, 0, 5889},
{42877, 7545, 42877, 0, 0, 3969},
+ {42893, 613, 42893, 0, 0, 3969},
{0, 40, 0, 0, 0, 1921},
{65496, 0, 65496, 0, 0, 1801},
};
/* type indexes */
-#define SHIFT 8
+#define SHIFT 7
static unsigned char index1[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 34, 37,
- 38, 34, 34, 34, 39, 40, 41, 42, 43, 44, 45, 46, 34, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 47, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 48, 21, 21, 21, 21, 49,
- 21, 50, 51, 52, 53, 54, 8, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 55, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 21, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 8, 8, 8, 68, 69, 70, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 21, 21, 21, 71, 72, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 73, 74,
- 75, 76, 77, 78, 79, 80, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 81, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 82, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 21, 21, 83, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 84, 85, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 86, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 86,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 34, 35, 36, 37,
+ 38, 39, 34, 34, 34, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 64, 65, 66, 67, 64,
+ 64, 64, 64, 68, 69, 64, 64, 64, 64, 64, 64, 70, 17, 71, 72, 73, 74, 75,
+ 76, 64, 77, 78, 79, 80, 81, 82, 83, 64, 64, 84, 85, 34, 34, 34, 34, 34,
+ 34, 86, 34, 34, 34, 34, 34, 87, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 88, 89, 90, 91, 34, 34, 34, 92, 34, 34,
+ 34, 93, 94, 34, 34, 34, 34, 34, 95, 34, 34, 34, 96, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 97, 98, 99, 34, 34, 34, 34, 34, 34, 100, 101, 34, 34,
+ 34, 34, 34, 34, 34, 34, 102, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 103, 34, 34, 34, 34, 34, 34, 34, 34, 104, 34, 34, 34, 34,
+ 100, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 103, 34, 34, 34, 34, 34, 34, 105, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 106, 107, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 108, 109, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 110, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 111, 34, 34, 112, 113, 114, 115, 116, 117, 118, 119, 120,
+ 121, 122, 123, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 126, 127, 128,
+ 129, 130, 131, 132, 34, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
+ 17, 143, 144, 145, 146, 147, 17, 17, 17, 17, 17, 17, 148, 17, 149, 17,
+ 150, 17, 151, 17, 152, 17, 17, 17, 153, 17, 17, 17, 154, 155, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 34, 34, 34, 34, 34, 34, 156, 17, 157,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 34, 34, 34, 34, 34, 34, 34, 34, 158, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 34, 34, 34, 34, 159, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 160, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 64, 161, 162, 163, 164, 17, 165, 17, 166, 167, 168, 169, 170, 171,
+ 172, 173, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 174, 175, 176,
+ 177, 178, 17, 179, 180, 181, 182, 183, 184, 185, 186, 65, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 187, 188, 189, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 86, 190, 34, 191,
+ 192, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 193, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 194, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 195, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 196, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 197, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 198, 34, 199, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 34, 193, 34, 34, 199, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 200, 17, 201, 202, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 203, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 203,
};
static unsigned char index2[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 3, 3, 3, 2, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 5, 5, 5, 5, 5, 5, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -388,455 +704,424 @@ static unsigned char index2[] = {
18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 5, 5,
5, 5, 1, 1, 1, 1, 1, 1, 3, 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, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 19, 5, 5,
- 1, 5, 5, 5, 5, 20, 21, 5, 22, 5, 17, 5, 23, 19, 5, 5, 5, 5, 5, 16, 16,
+ 1, 5, 5, 5, 5, 20, 21, 5, 22, 5, 17, 5, 23, 19, 5, 24, 24, 24, 5, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 5, 16, 16, 16, 16, 16, 16, 16, 19, 18, 18, 18, 18, 18, 18,
18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 5,
- 18, 18, 18, 18, 18, 18, 18, 24, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 27, 28, 25, 26, 25, 26, 25, 26, 19, 25, 26, 25, 26, 25, 26, 25,
- 26, 25, 26, 25, 26, 25, 26, 25, 26, 19, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 29, 25, 26, 25, 26, 25, 26, 30, 31, 32, 25, 26, 25, 26, 33, 25,
- 26, 34, 34, 25, 26, 19, 35, 36, 37, 25, 26, 34, 38, 39, 40, 41, 25, 26,
- 42, 19, 40, 43, 44, 45, 25, 26, 25, 26, 25, 26, 46, 25, 26, 46, 19, 19,
- 25, 26, 46, 25, 26, 47, 47, 25, 26, 25, 26, 48, 25, 26, 19, 49, 25, 26,
- 19, 50, 49, 49, 49, 49, 51, 52, 53, 51, 52, 53, 51, 52, 53, 25, 26, 25,
- 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 54, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 19, 51, 52, 53,
- 25, 26, 55, 56, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 57, 19, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 19, 19, 19, 19, 19, 19, 58, 25,
- 26, 59, 60, 19, 19, 25, 26, 61, 62, 63, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 64, 65, 19, 66, 67, 19, 68, 68, 19, 69, 19, 70, 19, 19, 19, 19,
- 68, 19, 19, 71, 19, 19, 19, 19, 72, 73, 19, 74, 19, 19, 19, 73, 19, 75,
- 76, 19, 19, 77, 19, 19, 19, 19, 19, 19, 19, 78, 19, 19, 79, 19, 19, 79,
- 19, 19, 19, 19, 79, 80, 81, 81, 82, 19, 19, 19, 19, 19, 83, 19, 49, 19,
+ 18, 18, 18, 18, 18, 18, 18, 25, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 28, 29, 26, 27, 26, 27, 26, 27, 19, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 19, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 30, 26, 27, 26, 27, 26, 27, 31, 32, 33, 26, 27, 26, 27, 34, 26,
+ 27, 35, 35, 26, 27, 19, 36, 37, 38, 26, 27, 35, 39, 40, 41, 42, 26, 27,
+ 43, 19, 41, 44, 45, 46, 26, 27, 26, 27, 26, 27, 47, 26, 27, 47, 19, 19,
+ 26, 27, 47, 26, 27, 48, 48, 26, 27, 26, 27, 49, 26, 27, 19, 50, 26, 27,
+ 19, 51, 50, 50, 50, 50, 52, 53, 54, 52, 53, 54, 52, 53, 54, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 55, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 19, 52, 53, 54,
+ 26, 27, 56, 57, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 58, 19, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 19, 19, 19, 19, 19, 19, 59, 26,
+ 27, 60, 61, 62, 62, 26, 27, 63, 64, 65, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 66, 67, 68, 69, 70, 19, 71, 71, 19, 72, 19, 73, 19, 19, 19, 19,
+ 71, 19, 19, 74, 19, 75, 19, 19, 76, 77, 19, 78, 19, 19, 19, 77, 19, 79,
+ 80, 19, 19, 81, 19, 19, 19, 19, 19, 19, 19, 82, 19, 19, 83, 19, 19, 83,
+ 19, 19, 19, 19, 83, 84, 85, 85, 86, 19, 19, 19, 19, 19, 87, 19, 50, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 5, 5, 5, 5, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 49, 49, 49,
- 49, 49, 5, 5, 5, 5, 5, 5, 5, 49, 5, 49, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 19, 19, 19, 19, 19, 19, 19, 19, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 5, 5, 5, 5, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 50, 50, 50,
+ 50, 50, 5, 5, 5, 5, 5, 5, 5, 50, 5, 50, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 84, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 88, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 25, 26, 25, 26, 49, 5, 25, 26, 0, 0, 85,
- 44, 44, 44, 5, 0, 0, 0, 0, 0, 5, 5, 86, 17, 87, 87, 87, 0, 88, 0, 89, 89,
+ 17, 17, 17, 17, 17, 17, 17, 17, 26, 27, 26, 27, 50, 5, 26, 27, 0, 0, 89,
+ 45, 45, 45, 5, 0, 0, 0, 0, 0, 5, 5, 90, 17, 91, 91, 91, 0, 92, 0, 93, 93,
19, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 90, 91, 91, 91, 19, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 92, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 93, 94, 94, 95, 96, 97, 98, 98, 98, 99, 100, 101,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 102, 103, 104, 19, 105, 106, 5, 25, 26, 107, 25,
- 26, 19, 57, 57, 57, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 94, 95, 95, 95, 19, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 96, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 97, 98, 98, 99, 100, 101, 102, 102, 102, 103,
+ 104, 105, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 106, 107, 108, 19, 109, 110, 5, 26, 27,
+ 111, 26, 27, 19, 58, 58, 58, 112, 112, 112, 112, 112, 112, 112, 112, 112,
+ 112, 112, 112, 112, 112, 112, 112, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 103,
- 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
- 103, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25,
- 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 5,
- 17, 17, 17, 17, 17, 5, 5, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 109, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25,
- 26, 25, 26, 110, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 0, 0, 49, 5, 5, 5, 5, 5, 5, 0, 112, 112, 112, 112, 112, 112,
- 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
- 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
- 112, 112, 112, 112, 19, 0, 5, 5, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 5, 17, 5, 17, 17, 5, 17, 17, 5, 17, 0, 0, 0, 0, 0, 0, 0,
- 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 0, 49, 49, 49, 5, 5,
+ 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 5, 17, 17, 17, 17, 17, 5, 5, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 113, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 114, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 115, 115, 115, 115, 115, 115,
+ 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
+ 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
+ 115, 115, 115, 0, 0, 50, 5, 5, 5, 5, 5, 5, 0, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 19, 0, 5, 5, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 5, 17, 5, 17, 17, 5, 17, 17, 5, 17, 0, 0, 0, 0, 0, 0,
+ 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 50, 50, 50, 5, 5,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 5, 0, 0, 5, 5, 0,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5,
- 5, 5, 5, 49, 49, 17, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 5, 49, 17, 17,
- 17, 17, 17, 17, 17, 1, 5, 17, 17, 17, 17, 17, 17, 49, 49, 17, 17, 5, 17,
- 17, 17, 17, 49, 49, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 49, 49, 49, 5, 5,
- 49, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 1, 49, 17, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 49, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 49, 49, 5, 5, 5, 5, 49, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 17, 17, 17, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 17, 49, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 49, 17, 17, 17, 17, 0, 0, 0,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 17, 17, 5, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 5, 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 0,
- 17, 17, 17, 0, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 49, 49, 0, 0, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 0, 49, 0, 0, 0, 49, 49, 49,
- 49, 0, 0, 17, 49, 17, 17, 17, 17, 17, 17, 17, 0, 0, 17, 17, 0, 0, 17, 17,
- 17, 49, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 49, 49, 0, 49, 49, 49,
- 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 49, 49, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 17, 17, 17, 0, 49, 49, 49, 49, 49, 49, 0,
- 0, 0, 0, 49, 49, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 0,
- 49, 49, 0, 49, 49, 0, 49, 49, 0, 0, 17, 0, 17, 17, 17, 17, 17, 0, 0, 0,
- 0, 17, 17, 0, 0, 17, 17, 17, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 49, 49,
- 49, 49, 0, 49, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 17, 17, 49, 49, 49, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 0,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 0, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0,
- 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 0, 49, 49, 49, 49, 49, 0, 0, 17,
- 49, 17, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 0, 17, 17, 17, 0, 0,
- 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 17, 17, 0, 0, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 17, 17, 17, 0, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 49, 49,
- 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 0, 49, 49,
- 49, 49, 49, 0, 0, 17, 49, 17, 17, 17, 17, 17, 17, 17, 0, 0, 17, 17, 0, 0,
- 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 0, 0, 0, 0, 49, 49, 0, 49,
- 49, 49, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 49, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 49, 0, 49, 49, 49, 49, 49, 49,
- 0, 0, 0, 49, 49, 49, 0, 49, 49, 49, 49, 0, 0, 0, 49, 49, 0, 49, 0, 49,
- 49, 0, 0, 0, 49, 49, 0, 0, 0, 49, 49, 49, 0, 0, 0, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 17, 17, 17, 17, 17, 0, 0, 0, 17,
- 17, 17, 0, 17, 17, 17, 17, 0, 0, 49, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 17, 17, 17, 0, 49, 49, 49, 49,
- 49, 49, 49, 49, 0, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 0, 0, 0, 49, 17, 17, 17,
+ 5, 5, 5, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 5, 0, 0, 5, 5, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 5, 5, 5, 5, 50, 50, 17, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, 50, 17,
+ 17, 17, 17, 17, 17, 17, 1, 5, 17, 17, 17, 17, 17, 17, 50, 50, 17, 17, 5,
+ 17, 17, 17, 17, 50, 50, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 50, 50, 50,
+ 5, 5, 50, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 1, 50, 17, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 50, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 50, 50, 5, 5, 5, 5, 50, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17,
+ 17, 17, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 50, 17, 17, 17, 50, 17,
+ 17, 17, 17, 17, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 17, 17, 17, 0, 0, 5, 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, 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, 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, 17, 17, 17, 17, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 50, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 50, 17, 17, 17,
+ 17, 17, 17, 17, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 5, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 50, 50, 50, 50, 50, 50, 50, 0, 50,
+ 50, 50, 50, 50, 50, 50, 0, 17, 17, 17, 0, 50, 50, 50, 50, 50, 50, 50, 50,
+ 0, 0, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 0, 50,
+ 0, 0, 0, 50, 50, 50, 50, 0, 0, 17, 50, 17, 17, 17, 17, 17, 17, 17, 0, 0,
+ 17, 17, 0, 0, 17, 17, 17, 50, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 50,
+ 50, 0, 50, 50, 50, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 50,
+ 50, 5, 5, 24, 24, 24, 24, 24, 24, 5, 5, 0, 0, 0, 0, 0, 17, 17, 17, 0, 50,
+ 50, 50, 50, 50, 50, 0, 0, 0, 0, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50,
+ 50, 50, 50, 50, 50, 0, 50, 50, 0, 50, 50, 0, 50, 50, 0, 0, 17, 0, 17, 17,
+ 17, 17, 17, 0, 0, 0, 0, 17, 17, 0, 0, 17, 17, 17, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0, 50, 50, 50, 50, 0, 50, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 17, 17, 50, 50, 50, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 17, 17, 17, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 0,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 0, 50, 50, 50,
+ 50, 50, 0, 0, 17, 50, 17, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 0,
+ 17, 17, 17, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
+ 50, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 5, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 0, 50, 50, 50, 50, 50, 50,
+ 50, 50, 0, 0, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50,
+ 50, 0, 50, 50, 0, 50, 50, 50, 50, 50, 0, 0, 17, 50, 17, 17, 17, 17, 17,
+ 17, 17, 0, 0, 17, 17, 0, 0, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17,
+ 0, 0, 0, 0, 50, 50, 0, 50, 50, 50, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12,
+ 13, 14, 15, 5, 50, 24, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 17, 50, 0, 50, 50, 50, 50, 50, 50, 0, 0, 0, 50, 50, 50, 0, 50, 50, 50,
+ 50, 0, 0, 0, 50, 50, 0, 50, 0, 50, 50, 0, 0, 0, 50, 50, 0, 0, 0, 50, 50,
+ 50, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0,
+ 17, 17, 17, 17, 17, 0, 0, 0, 17, 17, 17, 0, 17, 17, 17, 17, 0, 0, 50, 0,
+ 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 24, 24, 24, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 17, 17, 17, 0, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 0,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50,
+ 50, 50, 50, 0, 0, 0, 50, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 0,
+ 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 0, 50, 50, 0, 0, 0, 0, 0, 0,
+ 50, 50, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0,
+ 0, 0, 0, 24, 24, 24, 24, 24, 24, 24, 5, 0, 0, 17, 17, 0, 50, 50, 50, 50,
+ 50, 50, 50, 50, 0, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 0, 0, 17, 50, 17, 17, 17,
17, 17, 17, 17, 0, 17, 17, 17, 0, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 0, 49, 49, 0, 0, 0, 0, 0, 0, 49, 49, 17, 17, 0, 0, 6, 7, 8, 9,
- 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 17, 17, 0, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 0, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49,
- 49, 49, 0, 0, 17, 49, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 0, 17,
- 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 0, 0, 0, 0, 0, 0, 0, 49, 0, 49,
- 49, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 5, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 0, 49, 49, 49, 49, 49, 49,
- 49, 49, 0, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 49, 17, 17, 17, 17, 17,
- 17, 17, 0, 17, 17, 17, 0, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
- 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 5, 5, 5, 5, 5, 5, 0, 0, 0, 5, 49, 49, 49, 49, 49, 49, 0, 0, 17,
- 17, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 0, 49, 0, 0, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 17, 0, 0, 0, 0,
- 17, 17, 17, 17, 17, 17, 0, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 5, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 17,
- 49, 113, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 5, 49, 49, 49, 49, 49,
- 49, 49, 17, 17, 17, 17, 17, 17, 17, 17, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 5, 5, 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, 49, 49, 0, 49, 0, 0,
- 49, 49, 0, 49, 0, 0, 49, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 0, 49, 49, 49,
- 49, 49, 49, 49, 0, 49, 49, 49, 0, 49, 0, 49, 0, 0, 49, 49, 0, 49, 49, 49,
- 49, 17, 49, 113, 17, 17, 17, 17, 17, 17, 0, 17, 17, 49, 0, 0, 49, 49, 49,
- 49, 49, 0, 49, 0, 17, 17, 17, 17, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 0, 0, 49, 49, 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, 49, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 5, 5, 5, 5,
- 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 17, 5, 17, 5, 17, 5, 5, 5, 5, 17, 17, 49, 49, 49, 49, 49, 49, 49, 49,
- 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 5, 17, 17, 49, 49, 49, 49, 0, 0, 0, 0, 17, 17,
- 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 0, 5, 5, 5, 5, 5, 5, 5, 5, 17, 5, 5, 5, 5, 5,
- 5, 0, 5, 5, 5, 5, 5, 5, 5, 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, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 49, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 5, 5, 5, 5, 5, 5, 49, 49, 49, 49, 49, 49, 17, 17, 17, 17,
- 49, 49, 49, 49, 17, 17, 17, 49, 17, 17, 17, 49, 49, 17, 17, 17, 17, 17,
- 17, 17, 49, 49, 49, 17, 17, 17, 17, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 49, 17,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 5, 5, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 5, 49, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 0, 0, 49, 49, 49,
- 49, 49, 49, 49, 0, 49, 0, 49, 49, 49, 49, 0, 0, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0,
- 49, 49, 49, 49, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 0, 49, 49, 49, 49, 0, 0, 49, 49, 49, 49, 49, 49, 49, 0, 49, 0,
- 49, 49, 49, 49, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 0, 0, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 5, 5, 49, 49, 49, 49, 49, 49, 49, 49, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 2, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 5, 5, 0, 0,
- 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 5, 5, 5, 124, 124, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49,
- 49, 49, 49, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 17, 17, 17, 5, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 0, 17,
- 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 1, 1, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 5, 5, 5, 49, 5, 5, 5, 5, 49, 17, 0, 0, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 17, 2, 0, 6, 7, 8, 9,
- 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 17, 49, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
- 0, 0, 5, 0, 0, 0, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 49, 49, 49, 49, 49, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 0, 0, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 49, 49, 49, 49,
- 49, 49, 49, 17, 17, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 17, 17, 17,
- 17, 17, 0, 0, 5, 5, 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, 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, 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, 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, 17, 17, 17, 17, 17, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 17, 17, 17, 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 17, 17, 17, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 49, 49, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 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, 0, 0, 0,
- 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 0, 0, 0, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 0, 0, 0, 49, 49, 49, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 5, 5, 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, 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, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 17, 17, 0, 0, 0, 0, 0, 0, 0, 50, 0, 50, 50, 17, 17, 0, 0, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 0, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 17, 17, 0, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 0, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 0, 0, 50, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 0, 17,
+ 17, 17, 17, 50, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 50,
+ 50, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 24, 24, 24, 24, 24,
+ 24, 0, 0, 0, 5, 50, 50, 50, 50, 50, 50, 0, 0, 17, 17, 0, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 0, 0, 50,
+ 50, 50, 50, 50, 50, 50, 0, 0, 0, 17, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17,
+ 0, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 50, 117, 17, 17, 17,
+ 17, 17, 17, 17, 0, 0, 0, 0, 5, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17,
+ 17, 17, 17, 17, 17, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 5, 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, 50, 50, 0, 50, 0, 0, 50, 50, 0, 50, 0, 0,
+ 50, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 0,
+ 50, 50, 50, 0, 50, 0, 50, 0, 0, 50, 50, 0, 50, 50, 50, 50, 17, 50, 117,
+ 17, 17, 17, 17, 17, 17, 0, 17, 17, 50, 0, 0, 50, 50, 50, 50, 50, 0, 50,
+ 0, 17, 17, 17, 17, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0,
+ 0, 50, 50, 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, 50, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 5, 5, 5, 5, 5, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 5, 17,
+ 5, 17, 5, 17, 5, 5, 5, 5, 17, 17, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0,
+ 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 5, 17, 17, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 0, 5, 5, 5, 5, 5, 5, 5, 5, 17, 5, 5, 5, 5, 5, 5, 0,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 50, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 5, 5, 5, 5, 5, 5, 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 50, 50,
+ 50, 50, 17, 17, 17, 50, 17, 17, 17, 50, 50, 17, 17, 17, 17, 17, 17, 17,
+ 50, 50, 50, 17, 17, 17, 17, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 50, 17, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 17, 17, 17, 17, 5, 5, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 5, 50, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 0, 0, 50, 50,
+ 50, 50, 50, 50, 50, 0, 50, 0, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 0, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 0, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50, 0, 50,
+ 0, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 17, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 119, 120, 121, 122, 123, 124, 125, 126, 127, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 5, 5, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 2, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, 5, 0, 0, 0,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 5, 5, 5, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50,
+ 50, 50, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 5, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 0, 17, 17,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 1, 1, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 5, 5, 5, 50, 5, 5, 5, 5, 50, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12,
+ 13, 14, 15, 0, 0, 0, 0, 0, 0, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 17, 2, 0, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 17, 50, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 0, 0, 0, 0, 5, 0, 0, 0, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 50,
+ 50, 50, 50, 50, 50, 50, 17, 17, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12,
+ 13, 14, 15, 119, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 17, 17, 17, 17, 17, 0, 0, 5, 5, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 17, 6, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0,
+ 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 50, 5, 5, 5, 5, 5, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 17, 17, 17,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 0, 0, 0, 50, 50, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0,
+ 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 5, 5, 5, 5,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 50, 50, 50, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 5, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 5, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 50, 50, 50, 50, 17, 50, 50, 50, 50, 17, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 49, 125,
- 19, 19, 19, 126, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 19, 19, 19, 19, 19, 127, 19, 19, 128, 19,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 129, 129, 129, 129, 129, 129, 129, 129, 130, 130,
- 130, 130, 130, 130, 130, 130, 129, 129, 129, 129, 129, 129, 0, 0, 130,
- 130, 130, 130, 130, 130, 0, 0, 129, 129, 129, 129, 129, 129, 129, 129,
- 130, 130, 130, 130, 130, 130, 130, 130, 129, 129, 129, 129, 129, 129,
- 129, 129, 130, 130, 130, 130, 130, 130, 130, 130, 129, 129, 129, 129,
- 129, 129, 0, 0, 130, 130, 130, 130, 130, 130, 0, 0, 19, 129, 19, 129, 19,
- 129, 19, 129, 0, 130, 0, 130, 0, 130, 0, 130, 129, 129, 129, 129, 129,
- 129, 129, 129, 130, 130, 130, 130, 130, 130, 130, 130, 131, 131, 132,
- 132, 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, 0, 0, 129, 129,
- 129, 129, 129, 129, 129, 129, 137, 137, 137, 137, 137, 137, 137, 137,
- 129, 129, 129, 129, 129, 129, 129, 129, 137, 137, 137, 137, 137, 137,
- 137, 137, 129, 129, 129, 129, 129, 129, 129, 129, 137, 137, 137, 137,
- 137, 137, 137, 137, 129, 129, 19, 138, 19, 0, 19, 19, 130, 130, 139, 139,
- 140, 5, 141, 5, 5, 5, 19, 138, 19, 0, 19, 19, 142, 142, 142, 142, 140, 5,
- 5, 5, 129, 129, 19, 19, 0, 0, 19, 19, 130, 130, 143, 143, 0, 5, 5, 5,
- 129, 129, 19, 19, 19, 104, 19, 19, 130, 130, 144, 144, 107, 5, 5, 5, 0,
- 0, 19, 138, 19, 0, 19, 19, 145, 145, 146, 146, 140, 5, 5, 0, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 1, 1, 1, 1, 1, 2, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 1, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 147, 19, 0, 0, 148, 149, 150, 151,
- 152, 153, 5, 5, 5, 5, 5, 19, 147, 23, 20, 21, 148, 149, 150, 151, 152,
- 153, 5, 5, 5, 5, 5, 0, 49, 49, 49, 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 17, 5,
- 5, 5, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 98, 5, 5, 5, 5, 98, 5, 5, 19, 98, 98,
- 98, 19, 19, 98, 98, 98, 19, 5, 98, 5, 5, 124, 98, 98, 98, 98, 98, 5, 5,
- 5, 5, 5, 5, 98, 5, 154, 5, 98, 5, 155, 156, 98, 98, 124, 19, 98, 98, 157,
- 98, 19, 49, 49, 49, 49, 19, 5, 5, 19, 19, 98, 98, 5, 5, 5, 5, 5, 98, 19,
- 19, 19, 19, 5, 5, 5, 5, 158, 5, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159,
- 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 124, 124, 124, 25, 26, 124, 124, 124, 124, 0, 0,
- 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 50, 129,
+ 19, 19, 19, 130, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
+ 17, 17, 17, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 19, 19, 19, 19, 19, 131, 19, 19, 132,
+ 19, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 133, 133, 133, 133, 133, 133, 133, 133, 134,
+ 134, 134, 134, 134, 134, 134, 134, 133, 133, 133, 133, 133, 133, 0, 0,
+ 134, 134, 134, 134, 134, 134, 0, 0, 133, 133, 133, 133, 133, 133, 133,
+ 133, 134, 134, 134, 134, 134, 134, 134, 134, 133, 133, 133, 133, 133,
+ 133, 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, 133, 133, 133,
+ 133, 133, 133, 0, 0, 134, 134, 134, 134, 134, 134, 0, 0, 19, 133, 19,
+ 133, 19, 133, 19, 133, 0, 134, 0, 134, 0, 134, 0, 134, 133, 133, 133,
+ 133, 133, 133, 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, 135,
+ 135, 136, 136, 136, 136, 137, 137, 138, 138, 139, 139, 140, 140, 0, 0,
+ 133, 133, 133, 133, 133, 133, 133, 133, 141, 141, 141, 141, 141, 141,
+ 141, 141, 133, 133, 133, 133, 133, 133, 133, 133, 141, 141, 141, 141,
+ 141, 141, 141, 141, 133, 133, 133, 133, 133, 133, 133, 133, 141, 141,
+ 141, 141, 141, 141, 141, 141, 133, 133, 19, 142, 19, 0, 19, 19, 134, 134,
+ 143, 143, 144, 5, 145, 5, 5, 5, 19, 142, 19, 0, 19, 19, 146, 146, 146,
+ 146, 144, 5, 5, 5, 133, 133, 19, 19, 0, 0, 19, 19, 134, 134, 147, 147, 0,
+ 5, 5, 5, 133, 133, 19, 19, 19, 108, 19, 19, 134, 134, 148, 148, 111, 5,
+ 5, 5, 0, 0, 19, 142, 19, 0, 19, 19, 149, 149, 150, 150, 144, 5, 5, 0, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 1, 1, 1, 1, 1, 2, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 151, 50, 0, 0, 152, 153,
+ 154, 155, 156, 157, 5, 5, 5, 5, 5, 50, 151, 23, 20, 21, 152, 153, 154,
+ 155, 156, 157, 5, 5, 5, 5, 5, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 5, 5, 5, 5, 17, 5, 5, 5, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 102, 5, 5, 5, 5, 102,
+ 5, 5, 19, 102, 102, 102, 19, 19, 102, 102, 102, 19, 5, 102, 5, 5, 158,
+ 102, 102, 102, 102, 102, 5, 5, 5, 5, 5, 5, 102, 5, 159, 5, 102, 5, 160,
+ 161, 102, 102, 158, 19, 102, 102, 162, 102, 19, 50, 50, 50, 50, 19, 5, 5,
+ 19, 19, 102, 102, 5, 5, 5, 5, 5, 102, 19, 19, 19, 19, 5, 5, 5, 5, 163, 5,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 164, 164,
+ 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
+ 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
+ 165, 165, 128, 128, 128, 26, 27, 128, 128, 128, 128, 24, 0, 0, 0, 0, 0,
+ 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
@@ -850,86 +1135,70 @@ static unsigned char index2[] = {
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 23, 20, 21, 148, 149, 150, 151, 152, 153, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 23, 20, 21, 148, 149, 150, 151, 152, 153, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 23, 20, 21, 148, 149, 150, 151, 152, 153, 5, 5, 5,
+ 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 20, 21, 152, 153, 154, 155, 156, 157, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 20, 21, 152, 153, 154, 155,
+ 156, 157, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 20, 21, 152,
+ 153, 154, 155, 156, 157, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
- 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
- 162, 162, 147, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 23, 20, 21, 148, 149, 150,
- 151, 152, 153, 5, 147, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
+ 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, 167,
+ 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
+ 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 151, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 23, 20, 21, 152, 153, 154, 155, 156, 157, 24,
+ 151, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 23,
+ 20, 21, 152, 153, 154, 155, 156, 157, 24, 23, 20, 21, 152, 153, 154, 155,
+ 156, 157, 24, 23, 20, 21, 152, 153, 154, 155, 156, 157, 24, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 5,
+ 5, 5, 5, 0, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 5, 5, 5, 5, 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,
- 5, 5, 5, 5, 0, 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 0, 5, 0, 5, 5, 5, 5, 0, 0, 0, 5, 0, 5, 5, 5, 5, 5, 5, 5, 0, 0,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 23, 20,
- 21, 148, 149, 150, 151, 152, 153, 5, 23, 20, 21, 148, 149, 150, 151, 152,
- 153, 5, 23, 20, 21, 148, 149, 150, 151, 152, 153, 5, 5, 0, 0, 0, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 5, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 5, 5, 5, 5, 5, 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, 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, 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, 111, 111,
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 0, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
- 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
- 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
- 112, 112, 112, 112, 112, 112, 112, 112, 0, 25, 26, 163, 164, 165, 166,
- 167, 25, 26, 25, 26, 25, 26, 168, 169, 170, 0, 19, 25, 26, 19, 25, 26,
- 19, 19, 19, 19, 19, 19, 49, 0, 0, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 19, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 5, 5, 5, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
- 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
- 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
- 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49,
- 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49,
- 0, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49,
- 49, 49, 49, 49, 49, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 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, 115, 115, 115, 115, 115,
+ 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
+ 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
+ 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 0,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 0, 26, 27, 168, 169, 170, 171, 172, 26, 27, 26,
+ 27, 26, 27, 173, 174, 175, 176, 19, 26, 27, 19, 26, 27, 19, 19, 19, 19,
+ 19, 19, 50, 177, 177, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 19, 5, 5, 5,
+ 5, 5, 5, 26, 27, 26, 27, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 24,
+ 5, 5, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
+ 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
+ 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 17, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
+ 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50,
+ 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50,
+ 0, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50,
+ 50, 50, 50, 50, 50, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 85, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 89, 5, 5, 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, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
@@ -941,524 +1210,818 @@ static unsigned char index2[] = {
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 2, 5, 5, 5, 5, 50, 50, 128, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 17, 17, 17, 17, 17, 17, 5, 50, 50, 50, 50, 50, 5, 5, 128, 128,
+ 128, 50, 50, 5, 5, 5, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 0, 0, 17, 17, 5, 5, 50, 50, 50, 5, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, 50, 50, 50, 50, 0, 0, 0,
+ 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 5, 5, 24, 24, 24, 24,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 0, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 0, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 179, 50, 50, 179,
+ 50, 50, 50, 179, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50,
+ 179, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 179, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179,
+ 50, 179, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 179,
+ 179, 179, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 179, 179, 179, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179,
+ 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 179,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 179, 179, 50, 179,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179,
+ 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 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, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 2, 5, 5, 5, 5, 49, 49, 124, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 17, 17, 17, 17, 17, 17, 5, 49, 49, 49,
- 49, 49, 5, 5, 124, 124, 124, 49, 49, 5, 5, 5, 0, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 17, 17, 5, 5, 49, 49, 49, 5, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 5,
- 49, 49, 49, 49, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 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, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 5, 5, 5, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25,
- 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 0, 0,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 49, 17, 5, 5, 5, 5, 0, 0,
- 0, 0, 0, 0, 0, 0, 17, 17, 5, 49, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
- 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 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, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 49, 49, 49, 49, 49, 49, 49, 49, 49, 5, 5, 25, 26, 25, 26, 25, 26, 25,
- 26, 25, 26, 25, 26, 25, 26, 19, 19, 25, 26, 25, 26, 25, 26, 25, 26, 25,
- 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25,
- 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25,
- 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 49,
- 19, 19, 19, 19, 19, 19, 19, 19, 25, 26, 25, 26, 172, 25, 26, 25, 26, 25,
- 26, 25, 26, 25, 26, 49, 5, 5, 25, 26, 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, 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, 49, 49, 49, 49, 49, 49, 49, 17, 49, 49, 49, 17, 49, 49, 49, 49, 17,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 17, 17, 17, 17, 17, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 17,
- 17, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 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, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 17, 17, 17, 17, 17, 17, 17, 17, 5, 5, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5, 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,
- 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, 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,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 17, 49, 49, 49, 49, 49, 49,
- 49, 49, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 5, 5, 5,
- 5, 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, 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, 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, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 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, 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, 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,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, 5, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, 5, 5, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 50, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 50, 17, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 17, 17, 5, 50, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26,
+ 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 17, 17, 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, 5, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 19, 19, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 50, 19, 19, 19, 19, 19, 19, 19, 19, 26, 27, 26, 27, 180, 26, 27,
+ 26, 27, 26, 27, 26, 27, 26, 27, 50, 5, 5, 26, 27, 181, 19, 0, 26, 27, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, 26, 27, 26, 27, 26, 27,
+ 26, 27, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 50, 50, 50, 50, 50, 50, 50, 17, 50, 50,
+ 50, 17, 50, 50, 50, 50, 17, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 5, 5,
+ 5, 5, 0, 0, 0, 0, 24, 24, 24, 24, 24, 24, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, 5, 5,
+ 5, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 6, 7, 8, 9, 10, 11, 12,
+ 13, 14, 15, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 50, 50, 50, 50, 50, 50, 5, 5, 5, 50, 0, 0, 0,
+ 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 5, 5, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 5, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 17, 17, 17, 17,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 50,
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 5, 5, 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, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 17, 50, 50, 50, 50, 50,
+ 50, 50, 50, 17, 17, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 5, 5,
+ 5, 5, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 5, 5, 5, 50, 17, 0, 0, 0, 0, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 17, 50, 17, 17, 17, 50, 50, 17, 17, 50, 50,
+ 50, 50, 50, 17, 17, 50, 17, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 5, 5, 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, 50, 50, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 0, 0, 50, 50,
+ 50, 50, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 0,
+ 50, 50, 50, 50, 50, 50, 50, 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, 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, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 5, 17, 17, 0, 0,
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 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, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 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, 19, 19,
- 19, 19, 19, 19, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 19, 19, 19,
- 19, 0, 0, 0, 0, 0, 49, 17, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 5, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 0,
- 49, 0, 49, 49, 0, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 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, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 85, 85, 85, 85, 85, 85, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 5, 5, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 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, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 85, 85, 5, 5, 0, 0, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 17, 17, 17, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 0, 0, 0, 0, 85, 49, 85, 49, 85, 0,
- 85, 49, 85, 49, 85, 49, 85, 49, 85, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 1, 0, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 5, 5, 5, 5,
- 5, 5, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 5, 5, 5, 5, 17, 5, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 113, 113, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 49, 49, 49, 49, 49,
- 49, 0, 0, 49, 49, 49, 49, 49, 49, 0, 0, 49, 49, 49, 49, 49, 49, 0, 0, 49,
- 49, 49, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 1, 1, 5, 5, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 0,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 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, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0,
- 0, 0, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 17, 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, 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, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 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, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 5, 5, 5, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 124, 49, 49, 49, 49, 49, 49, 49, 49, 124, 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, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 5, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0, 0,
- 49, 49, 49, 49, 49, 49, 49, 49, 5, 124, 124, 124, 124, 124, 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, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49,
- 49, 0, 0, 49, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 0, 0, 0, 49,
- 0, 0, 49, 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, 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, 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, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 5, 5, 5, 5, 0, 0, 0, 0, 0, 5, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 0, 0, 0, 0, 0, 5, 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,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50,
+ 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 179, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 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, 19, 19, 19, 19, 19, 19,
+ 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 19, 19, 19, 19, 0, 0, 0, 0,
+ 0, 50, 17, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 0, 50, 0, 50, 50,
+ 0, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 89, 89, 89, 89, 89, 89, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 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, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 89, 89, 5, 5, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 17,
+ 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 17, 17, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17,
+ 17, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 5, 5, 5, 5, 0, 0, 0, 0, 89, 50, 89, 50, 89, 0, 89, 50, 89, 50, 89, 50,
+ 89, 50, 89, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 0, 0, 1, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 5, 5, 5, 5, 5, 5, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 5, 5, 5, 5, 17, 5, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 117, 117, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 0, 0, 0, 50, 50, 50, 50, 50, 50, 0, 0, 50, 50, 50,
+ 50, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 0, 0, 50, 50, 50, 0, 0, 0, 5,
+ 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 5, 5, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 0, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 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, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 5, 5, 5, 0, 0,
+ 0, 0, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 24, 24, 24, 24, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 24, 0, 0, 0, 0, 0, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 0, 0, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 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,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 24, 24, 24, 24, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 128, 50, 50, 50, 50, 50, 50, 50, 50, 128, 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, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 5, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0,
+ 0, 50, 50, 50, 50, 50, 50, 50, 50, 5, 128, 128, 128, 128, 128, 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, 182, 182, 182, 182, 182,
+ 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
+ 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
+ 182, 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 6, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50,
+ 50, 50, 0, 0, 50, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 50, 0, 0, 0,
+ 50, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 0, 5, 24, 24, 24, 24, 24, 24, 24, 24, 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, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 24, 24, 24, 24, 24, 24, 0, 0, 0, 5, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 5, 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, 0, 0, 0, 49, 17, 17, 17, 0, 17, 17, 0, 0, 0, 0, 0,
- 17, 17, 17, 17, 49, 49, 49, 49, 0, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 0, 0, 0, 0, 17, 17, 17, 0, 0, 0, 0, 17, 23, 20, 21, 148, 5,
- 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 50, 17, 17, 17, 0, 17, 17, 0, 0, 0, 0, 0, 17, 17,
+ 17, 17, 50, 50, 50, 50, 0, 50, 50, 50, 0, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 0, 0, 0, 0, 17, 17, 17, 0, 0, 0, 0, 17, 23, 20, 21, 152, 24, 24, 24,
+ 24, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
+ 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 24, 24, 5, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 5,
+ 5, 5, 5, 5, 5, 5, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 24, 24, 24, 24, 24, 24, 24, 24, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 0, 0, 0, 0, 0, 24, 24, 24, 24, 24, 24, 24, 24, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 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, 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, 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, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0,
+ 23, 20, 21, 152, 153, 154, 155, 156, 157, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 17, 17, 17,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5,
+ 5, 0, 0, 0, 0, 23, 20, 21, 152, 153, 154, 155, 156, 157, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 5, 5, 1, 5,
+ 5, 5, 5, 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, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 158, 158, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 158, 158, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
- 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 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, 50, 50, 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, 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, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 5, 5, 5,
+ 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 17, 17, 17,
+ 5, 5, 5, 17, 17, 17, 17, 17, 17, 1, 1, 1, 1, 1, 1, 1, 1, 17, 17, 17, 17,
+ 17, 17, 17, 17, 5, 5, 17, 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17,
+ 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 17, 17, 17, 5, 5, 5, 17, 17, 17, 17,
- 17, 17, 1, 1, 1, 1, 1, 1, 1, 1, 17, 17, 17, 17, 17, 17, 17, 17, 5, 5, 17,
- 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 17, 17, 5, 5, 5, 5, 5,
+ 5, 5, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17,
- 17, 17, 5, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 17, 17, 17, 5, 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, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 19, 19,
- 19, 19, 19, 19, 19, 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 19, 19, 19, 19,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 19, 19, 19, 19, 19, 19, 19, 0,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 98, 0, 98, 98, 0, 0, 98, 0, 0, 98, 98, 0, 0, 98, 98, 98,
- 98, 0, 98, 98, 98, 98, 98, 98, 98, 98, 19, 19, 19, 19, 0, 19, 0, 19, 19,
- 19, 19, 19, 19, 19, 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 98, 98, 0,
- 98, 98, 98, 98, 0, 0, 98, 98, 98, 98, 98, 98, 98, 98, 0, 98, 98, 98, 98,
- 98, 98, 98, 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 98, 98, 0, 98, 98, 98,
- 98, 0, 98, 98, 98, 98, 98, 0, 98, 0, 0, 0, 98, 98, 98, 98, 98, 98, 98, 0,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 19, 19,
+ 19, 19, 19, 19, 19, 102, 0, 102, 102, 0, 0, 102, 0, 0, 102, 102, 0, 0,
+ 102, 102, 102, 102, 0, 102, 102, 102, 102, 102, 102, 102, 102, 19, 19,
+ 19, 19, 0, 19, 0, 19, 19, 19, 19, 19, 19, 19, 0, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 102, 102, 0, 102, 102, 102, 102,
+ 0, 0, 102, 102, 102, 102, 102, 102, 102, 102, 0, 102, 102, 102, 102, 102,
+ 102, 102, 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 102, 102, 0, 102, 102, 102,
+ 102, 0, 102, 102, 102, 102, 102, 0, 102, 0, 0, 0, 102, 102, 102, 102,
+ 102, 102, 102, 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 19, 19, 19, 19,
+ 19, 19, 19, 19, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 19, 19, 19, 19, 19, 19,
+ 19, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 0, 0, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 5, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 5, 19, 19, 19, 19, 19, 19,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 5, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0, 0, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 5, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 5, 19, 19, 19,
- 19, 19, 19, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 5, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 5, 19, 19, 19, 19, 19, 19, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 5, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 5, 19, 19, 19, 19,
+ 19, 19, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 5, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 5, 19, 19, 19, 19, 19, 19, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 5, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 5, 19, 19, 19, 19, 19, 19, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 5, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 5, 19, 19, 19, 19, 19, 19, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 5, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 5, 19, 19, 19, 19, 19,
- 19, 98, 19, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 5, 5, 5, 5, 5, 5,
+ 19, 19, 19, 19, 19, 5, 19, 19, 19, 19, 19, 19, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 5, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 5, 19, 19,
+ 19, 19, 19, 19, 102, 19, 0, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 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, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 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, 151, 151, 23, 20, 21, 152, 153,
+ 154, 155, 156, 157, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 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, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 5, 5, 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, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5,
+ 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 0, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5,
+ 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 0, 5, 0, 5, 0, 5, 0, 5,
+ 5, 5, 0, 5, 5, 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 0, 5, 0, 0, 5, 5, 5, 5, 0,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179,
+ 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 179, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 179, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 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, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 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, 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, 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, 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, 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, 17, 17, 17, 17,
+ 1, 1, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
@@ -1471,18 +2034,1376 @@ static unsigned char index2[] = {
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 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, 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,
+ 1, 1, 1, 1, 1, 1, 1, 0, 0,
};
+/* Returns the numeric value as double for Unicode characters
+ * having this property, -1.0 otherwise.
+ */
+double _PyUnicode_ToNumeric(Py_UCS4 ch)
+{
+ switch (ch) {
+ case 0x0F33:
+ return (double) -1.0/2.0;
+ case 0x0030:
+ case 0x0660:
+ case 0x06F0:
+ case 0x07C0:
+ case 0x0966:
+ case 0x09E6:
+ case 0x0A66:
+ case 0x0AE6:
+ case 0x0B66:
+ case 0x0BE6:
+ case 0x0C66:
+ case 0x0C78:
+ case 0x0CE6:
+ case 0x0D66:
+ case 0x0E50:
+ case 0x0ED0:
+ case 0x0F20:
+ case 0x1040:
+ case 0x1090:
+ case 0x17E0:
+ case 0x17F0:
+ case 0x1810:
+ case 0x1946:
+ case 0x19D0:
+ case 0x1A80:
+ case 0x1A90:
+ case 0x1B50:
+ case 0x1BB0:
+ case 0x1C40:
+ case 0x1C50:
+ case 0x2070:
+ case 0x2080:
+ case 0x2189:
+ case 0x24EA:
+ case 0x24FF:
+ case 0x3007:
+ case 0x96F6:
+ case 0xA620:
+ case 0xA6EF:
+ case 0xA8D0:
+ case 0xA900:
+ case 0xA9D0:
+ case 0xAA50:
+ case 0xABF0:
+ case 0xF9B2:
+ case 0xFF10:
+ case 0x1018A:
+ case 0x104A0:
+ case 0x11066:
+ case 0x1D7CE:
+ case 0x1D7D8:
+ case 0x1D7E2:
+ case 0x1D7EC:
+ case 0x1D7F6:
+ case 0x1F100:
+ case 0x1F101:
+ return (double) 0.0;
+ case 0x0031:
+ case 0x00B9:
+ case 0x0661:
+ case 0x06F1:
+ case 0x07C1:
+ case 0x0967:
+ case 0x09E7:
+ case 0x0A67:
+ case 0x0AE7:
+ case 0x0B67:
+ case 0x0BE7:
+ case 0x0C67:
+ case 0x0C79:
+ case 0x0C7C:
+ case 0x0CE7:
+ case 0x0D67:
+ case 0x0E51:
+ case 0x0ED1:
+ case 0x0F21:
+ case 0x1041:
+ case 0x1091:
+ case 0x1369:
+ case 0x17E1:
+ case 0x17F1:
+ case 0x1811:
+ case 0x1947:
+ case 0x19D1:
+ case 0x19DA:
+ case 0x1A81:
+ case 0x1A91:
+ case 0x1B51:
+ case 0x1BB1:
+ case 0x1C41:
+ case 0x1C51:
+ case 0x2081:
+ case 0x215F:
+ case 0x2160:
+ case 0x2170:
+ case 0x2460:
+ case 0x2474:
+ case 0x2488:
+ case 0x24F5:
+ case 0x2776:
+ case 0x2780:
+ case 0x278A:
+ case 0x3021:
+ case 0x3192:
+ case 0x3220:
+ case 0x3280:
+ case 0x4E00:
+ case 0x58F1:
+ case 0x58F9:
+ case 0x5E7A:
+ case 0x5F0C:
+ case 0xA621:
+ case 0xA6E6:
+ case 0xA8D1:
+ case 0xA901:
+ case 0xA9D1:
+ case 0xAA51:
+ case 0xABF1:
+ case 0xFF11:
+ case 0x10107:
+ case 0x10142:
+ case 0x10158:
+ case 0x10159:
+ case 0x1015A:
+ case 0x10320:
+ case 0x103D1:
+ case 0x104A1:
+ case 0x10858:
+ case 0x10916:
+ case 0x10A40:
+ case 0x10A7D:
+ case 0x10B58:
+ case 0x10B78:
+ case 0x10E60:
+ case 0x11052:
+ case 0x11067:
+ case 0x12415:
+ case 0x1241E:
+ case 0x1242C:
+ case 0x12434:
+ case 0x1244F:
+ case 0x12458:
+ case 0x1D360:
+ case 0x1D7CF:
+ case 0x1D7D9:
+ case 0x1D7E3:
+ case 0x1D7ED:
+ case 0x1D7F7:
+ case 0x1F102:
+ case 0x2092A:
+ return (double) 1.0;
+ case 0x2152:
+ return (double) 1.0/10.0;
+ case 0x09F4:
+ case 0x0B75:
+ case 0xA833:
+ return (double) 1.0/16.0;
+ case 0x00BD:
+ case 0x0B73:
+ case 0x0D74:
+ case 0x0F2A:
+ case 0x2CFD:
+ case 0xA831:
+ case 0x10141:
+ case 0x10175:
+ case 0x10176:
+ case 0x10E7B:
+ return (double) 1.0/2.0;
+ case 0x2153:
+ case 0x10E7D:
+ case 0x1245A:
+ case 0x1245D:
+ return (double) 1.0/3.0;
+ case 0x00BC:
+ case 0x09F7:
+ case 0x0B72:
+ case 0x0D73:
+ case 0xA830:
+ case 0x10140:
+ case 0x10E7C:
+ case 0x12460:
+ case 0x12462:
+ return (double) 1.0/4.0;
+ case 0x2155:
+ return (double) 1.0/5.0;
+ case 0x2159:
+ case 0x12461:
+ return (double) 1.0/6.0;
+ case 0x2150:
+ return (double) 1.0/7.0;
+ case 0x09F5:
+ case 0x0B76:
+ case 0x215B:
+ case 0xA834:
+ case 0x1245F:
+ return (double) 1.0/8.0;
+ case 0x2151:
+ return (double) 1.0/9.0;
+ case 0x0BF0:
+ case 0x0D70:
+ case 0x1372:
+ case 0x2169:
+ case 0x2179:
+ case 0x2469:
+ case 0x247D:
+ case 0x2491:
+ case 0x24FE:
+ case 0x277F:
+ case 0x2789:
+ case 0x2793:
+ case 0x3038:
+ case 0x3229:
+ case 0x3289:
+ case 0x4EC0:
+ case 0x5341:
+ case 0x62FE:
+ case 0xF973:
+ case 0xF9FD:
+ case 0x10110:
+ case 0x10149:
+ case 0x10150:
+ case 0x10157:
+ case 0x10160:
+ case 0x10161:
+ case 0x10162:
+ case 0x10163:
+ case 0x10164:
+ case 0x10322:
+ case 0x103D3:
+ case 0x1085B:
+ case 0x10917:
+ case 0x10A44:
+ case 0x10B5C:
+ case 0x10B7C:
+ case 0x10E69:
+ case 0x1105B:
+ case 0x1D369:
+ return (double) 10.0;
+ case 0x0BF1:
+ case 0x0D71:
+ case 0x137B:
+ case 0x216D:
+ case 0x217D:
+ case 0x4F70:
+ case 0x767E:
+ case 0x964C:
+ case 0x10119:
+ case 0x1014B:
+ case 0x10152:
+ case 0x1016A:
+ case 0x103D5:
+ case 0x1085D:
+ case 0x10919:
+ case 0x10A46:
+ case 0x10B5E:
+ case 0x10B7E:
+ case 0x10E72:
+ case 0x11064:
+ return (double) 100.0;
+ case 0x0BF2:
+ case 0x0D72:
+ case 0x216F:
+ case 0x217F:
+ case 0x2180:
+ case 0x4EDF:
+ case 0x5343:
+ case 0x9621:
+ case 0x10122:
+ case 0x1014D:
+ case 0x10154:
+ case 0x10171:
+ case 0x1085E:
+ case 0x10A47:
+ case 0x10B5F:
+ case 0x10B7F:
+ case 0x11065:
+ return (double) 1000.0;
+ case 0x137C:
+ case 0x2182:
+ case 0x4E07:
+ case 0x842C:
+ case 0x1012B:
+ case 0x10155:
+ case 0x1085F:
+ return (double) 10000.0;
+ case 0x2188:
+ return (double) 100000.0;
+ case 0x4EBF:
+ case 0x5104:
+ return (double) 100000000.0;
+ case 0x5146:
+ return (double) 1000000000000.0;
+ case 0x216A:
+ case 0x217A:
+ case 0x246A:
+ case 0x247E:
+ case 0x2492:
+ case 0x24EB:
+ return (double) 11.0;
+ case 0x0F2F:
+ return (double) 11.0/2.0;
+ case 0x216B:
+ case 0x217B:
+ case 0x246B:
+ case 0x247F:
+ case 0x2493:
+ case 0x24EC:
+ return (double) 12.0;
+ case 0x246C:
+ case 0x2480:
+ case 0x2494:
+ case 0x24ED:
+ return (double) 13.0;
+ case 0x0F30:
+ return (double) 13.0/2.0;
+ case 0x246D:
+ case 0x2481:
+ case 0x2495:
+ case 0x24EE:
+ return (double) 14.0;
+ case 0x246E:
+ case 0x2482:
+ case 0x2496:
+ case 0x24EF:
+ return (double) 15.0;
+ case 0x0F31:
+ return (double) 15.0/2.0;
+ case 0x09F9:
+ case 0x246F:
+ case 0x2483:
+ case 0x2497:
+ case 0x24F0:
+ return (double) 16.0;
+ case 0x16EE:
+ case 0x2470:
+ case 0x2484:
+ case 0x2498:
+ case 0x24F1:
+ return (double) 17.0;
+ case 0x0F32:
+ return (double) 17.0/2.0;
+ case 0x16EF:
+ case 0x2471:
+ case 0x2485:
+ case 0x2499:
+ case 0x24F2:
+ return (double) 18.0;
+ case 0x16F0:
+ case 0x2472:
+ case 0x2486:
+ case 0x249A:
+ case 0x24F3:
+ return (double) 19.0;
+ case 0x0032:
+ case 0x00B2:
+ case 0x0662:
+ case 0x06F2:
+ case 0x07C2:
+ case 0x0968:
+ case 0x09E8:
+ case 0x0A68:
+ case 0x0AE8:
+ case 0x0B68:
+ case 0x0BE8:
+ case 0x0C68:
+ case 0x0C7A:
+ case 0x0C7D:
+ case 0x0CE8:
+ case 0x0D68:
+ case 0x0E52:
+ case 0x0ED2:
+ case 0x0F22:
+ case 0x1042:
+ case 0x1092:
+ case 0x136A:
+ case 0x17E2:
+ case 0x17F2:
+ case 0x1812:
+ case 0x1948:
+ case 0x19D2:
+ case 0x1A82:
+ case 0x1A92:
+ case 0x1B52:
+ case 0x1BB2:
+ case 0x1C42:
+ case 0x1C52:
+ case 0x2082:
+ case 0x2161:
+ case 0x2171:
+ case 0x2461:
+ case 0x2475:
+ case 0x2489:
+ case 0x24F6:
+ case 0x2777:
+ case 0x2781:
+ case 0x278B:
+ case 0x3022:
+ case 0x3193:
+ case 0x3221:
+ case 0x3281:
+ case 0x3483:
+ case 0x4E8C:
+ case 0x5169:
+ case 0x5F0D:
+ case 0x5F10:
+ case 0x8CAE:
+ case 0x8CB3:
+ case 0x8D30:
+ case 0xA622:
+ case 0xA6E7:
+ case 0xA8D2:
+ case 0xA902:
+ case 0xA9D2:
+ case 0xAA52:
+ case 0xABF2:
+ case 0xF978:
+ case 0xFF12:
+ case 0x10108:
+ case 0x1015B:
+ case 0x1015C:
+ case 0x1015D:
+ case 0x1015E:
+ case 0x103D2:
+ case 0x104A2:
+ case 0x10859:
+ case 0x1091A:
+ case 0x10A41:
+ case 0x10B59:
+ case 0x10B79:
+ case 0x10E61:
+ case 0x11053:
+ case 0x11068:
+ case 0x12400:
+ case 0x12416:
+ case 0x1241F:
+ case 0x12423:
+ case 0x1242D:
+ case 0x12435:
+ case 0x1244A:
+ case 0x12450:
+ case 0x12459:
+ case 0x1D361:
+ case 0x1D7D0:
+ case 0x1D7DA:
+ case 0x1D7E4:
+ case 0x1D7EE:
+ case 0x1D7F8:
+ case 0x1F103:
+ case 0x22390:
+ return (double) 2.0;
+ case 0x2154:
+ case 0x10177:
+ case 0x10E7E:
+ case 0x1245B:
+ case 0x1245E:
+ return (double) 2.0/3.0;
+ case 0x2156:
+ return (double) 2.0/5.0;
+ case 0x1373:
+ case 0x2473:
+ case 0x2487:
+ case 0x249B:
+ case 0x24F4:
+ case 0x3039:
+ case 0x5344:
+ case 0x5EFF:
+ case 0x10111:
+ case 0x103D4:
+ case 0x1085C:
+ case 0x10918:
+ case 0x10A45:
+ case 0x10B5D:
+ case 0x10B7D:
+ case 0x10E6A:
+ case 0x1105C:
+ case 0x1D36A:
+ return (double) 20.0;
+ case 0x1011A:
+ case 0x10E73:
+ return (double) 200.0;
+ case 0x10123:
+ return (double) 2000.0;
+ case 0x1012C:
+ return (double) 20000.0;
+ case 0x3251:
+ return (double) 21.0;
+ case 0x3252:
+ return (double) 22.0;
+ case 0x3253:
+ return (double) 23.0;
+ case 0x3254:
+ return (double) 24.0;
+ case 0x3255:
+ return (double) 25.0;
+ case 0x3256:
+ return (double) 26.0;
+ case 0x3257:
+ return (double) 27.0;
+ case 0x3258:
+ return (double) 28.0;
+ case 0x3259:
+ return (double) 29.0;
+ case 0x0033:
+ case 0x00B3:
+ case 0x0663:
+ case 0x06F3:
+ case 0x07C3:
+ case 0x0969:
+ case 0x09E9:
+ case 0x0A69:
+ case 0x0AE9:
+ case 0x0B69:
+ case 0x0BE9:
+ case 0x0C69:
+ case 0x0C7B:
+ case 0x0C7E:
+ case 0x0CE9:
+ case 0x0D69:
+ case 0x0E53:
+ case 0x0ED3:
+ case 0x0F23:
+ case 0x1043:
+ case 0x1093:
+ case 0x136B:
+ case 0x17E3:
+ case 0x17F3:
+ case 0x1813:
+ case 0x1949:
+ case 0x19D3:
+ case 0x1A83:
+ case 0x1A93:
+ case 0x1B53:
+ case 0x1BB3:
+ case 0x1C43:
+ case 0x1C53:
+ case 0x2083:
+ case 0x2162:
+ case 0x2172:
+ case 0x2462:
+ case 0x2476:
+ case 0x248A:
+ case 0x24F7:
+ case 0x2778:
+ case 0x2782:
+ case 0x278C:
+ case 0x3023:
+ case 0x3194:
+ case 0x3222:
+ case 0x3282:
+ case 0x4E09:
+ case 0x4EE8:
+ case 0x53C1:
+ case 0x53C2:
+ case 0x53C3:
+ case 0x53C4:
+ case 0x5F0E:
+ case 0xA623:
+ case 0xA6E8:
+ case 0xA8D3:
+ case 0xA903:
+ case 0xA9D3:
+ case 0xAA53:
+ case 0xABF3:
+ case 0xF96B:
+ case 0xFF13:
+ case 0x10109:
+ case 0x104A3:
+ case 0x1085A:
+ case 0x1091B:
+ case 0x10A42:
+ case 0x10B5A:
+ case 0x10B7A:
+ case 0x10E62:
+ case 0x11054:
+ case 0x11069:
+ case 0x12401:
+ case 0x12408:
+ case 0x12417:
+ case 0x12420:
+ case 0x12424:
+ case 0x12425:
+ case 0x1242E:
+ case 0x1242F:
+ case 0x12436:
+ case 0x12437:
+ case 0x1243A:
+ case 0x1243B:
+ case 0x1244B:
+ case 0x12451:
+ case 0x1D362:
+ case 0x1D7D1:
+ case 0x1D7DB:
+ case 0x1D7E5:
+ case 0x1D7EF:
+ case 0x1D7F9:
+ case 0x1F104:
+ case 0x20AFD:
+ case 0x20B19:
+ case 0x22998:
+ case 0x23B1B:
+ return (double) 3.0;
+ case 0x09F6:
+ case 0x0B77:
+ case 0xA835:
+ return (double) 3.0/16.0;
+ case 0x0F2B:
+ return (double) 3.0/2.0;
+ case 0x00BE:
+ case 0x09F8:
+ case 0x0B74:
+ case 0x0D75:
+ case 0xA832:
+ case 0x10178:
+ return (double) 3.0/4.0;
+ case 0x2157:
+ return (double) 3.0/5.0;
+ case 0x215C:
+ return (double) 3.0/8.0;
+ case 0x1374:
+ case 0x303A:
+ case 0x325A:
+ case 0x5345:
+ case 0x10112:
+ case 0x10165:
+ case 0x10E6B:
+ case 0x1105D:
+ case 0x1D36B:
+ case 0x20983:
+ return (double) 30.0;
+ case 0x1011B:
+ case 0x1016B:
+ case 0x10E74:
+ return (double) 300.0;
+ case 0x10124:
+ return (double) 3000.0;
+ case 0x1012D:
+ return (double) 30000.0;
+ case 0x325B:
+ return (double) 31.0;
+ case 0x325C:
+ return (double) 32.0;
+ case 0x325D:
+ return (double) 33.0;
+ case 0x325E:
+ return (double) 34.0;
+ case 0x325F:
+ return (double) 35.0;
+ case 0x32B1:
+ return (double) 36.0;
+ case 0x32B2:
+ return (double) 37.0;
+ case 0x32B3:
+ return (double) 38.0;
+ case 0x32B4:
+ return (double) 39.0;
+ case 0x0034:
+ case 0x0664:
+ case 0x06F4:
+ case 0x07C4:
+ case 0x096A:
+ case 0x09EA:
+ case 0x0A6A:
+ case 0x0AEA:
+ case 0x0B6A:
+ case 0x0BEA:
+ case 0x0C6A:
+ case 0x0CEA:
+ case 0x0D6A:
+ case 0x0E54:
+ case 0x0ED4:
+ case 0x0F24:
+ case 0x1044:
+ case 0x1094:
+ case 0x136C:
+ case 0x17E4:
+ case 0x17F4:
+ case 0x1814:
+ case 0x194A:
+ case 0x19D4:
+ case 0x1A84:
+ case 0x1A94:
+ case 0x1B54:
+ case 0x1BB4:
+ case 0x1C44:
+ case 0x1C54:
+ case 0x2074:
+ case 0x2084:
+ case 0x2163:
+ case 0x2173:
+ case 0x2463:
+ case 0x2477:
+ case 0x248B:
+ case 0x24F8:
+ case 0x2779:
+ case 0x2783:
+ case 0x278D:
+ case 0x3024:
+ case 0x3195:
+ case 0x3223:
+ case 0x3283:
+ case 0x4E96:
+ case 0x56DB:
+ case 0x8086:
+ case 0xA624:
+ case 0xA6E9:
+ case 0xA8D4:
+ case 0xA904:
+ case 0xA9D4:
+ case 0xAA54:
+ case 0xABF4:
+ case 0xFF14:
+ case 0x1010A:
+ case 0x104A4:
+ case 0x10A43:
+ case 0x10B5B:
+ case 0x10B7B:
+ case 0x10E63:
+ case 0x11055:
+ case 0x1106A:
+ case 0x12402:
+ case 0x12409:
+ case 0x1240F:
+ case 0x12418:
+ case 0x12421:
+ case 0x12426:
+ case 0x12430:
+ case 0x12438:
+ case 0x1243C:
+ case 0x1243D:
+ case 0x1243E:
+ case 0x1243F:
+ case 0x1244C:
+ case 0x12452:
+ case 0x12453:
+ case 0x1D363:
+ case 0x1D7D2:
+ case 0x1D7DC:
+ case 0x1D7E6:
+ case 0x1D7F0:
+ case 0x1D7FA:
+ case 0x1F105:
+ case 0x20064:
+ case 0x200E2:
+ case 0x2626D:
+ return (double) 4.0;
+ case 0x2158:
+ return (double) 4.0/5.0;
+ case 0x1375:
+ case 0x32B5:
+ case 0x534C:
+ case 0x10113:
+ case 0x10E6C:
+ case 0x1105E:
+ case 0x1D36C:
+ case 0x2098C:
+ case 0x2099C:
+ return (double) 40.0;
+ case 0x1011C:
+ case 0x10E75:
+ return (double) 400.0;
+ case 0x10125:
+ return (double) 4000.0;
+ case 0x1012E:
+ return (double) 40000.0;
+ case 0x32B6:
+ return (double) 41.0;
+ case 0x32B7:
+ return (double) 42.0;
+ case 0x32B8:
+ return (double) 43.0;
+ case 0x32B9:
+ return (double) 44.0;
+ case 0x32BA:
+ return (double) 45.0;
+ case 0x32BB:
+ return (double) 46.0;
+ case 0x32BC:
+ return (double) 47.0;
+ case 0x32BD:
+ return (double) 48.0;
+ case 0x32BE:
+ return (double) 49.0;
+ case 0x0035:
+ case 0x0665:
+ case 0x06F5:
+ case 0x07C5:
+ case 0x096B:
+ case 0x09EB:
+ case 0x0A6B:
+ case 0x0AEB:
+ case 0x0B6B:
+ case 0x0BEB:
+ case 0x0C6B:
+ case 0x0CEB:
+ case 0x0D6B:
+ case 0x0E55:
+ case 0x0ED5:
+ case 0x0F25:
+ case 0x1045:
+ case 0x1095:
+ case 0x136D:
+ case 0x17E5:
+ case 0x17F5:
+ case 0x1815:
+ case 0x194B:
+ case 0x19D5:
+ case 0x1A85:
+ case 0x1A95:
+ case 0x1B55:
+ case 0x1BB5:
+ case 0x1C45:
+ case 0x1C55:
+ case 0x2075:
+ case 0x2085:
+ case 0x2164:
+ case 0x2174:
+ case 0x2464:
+ case 0x2478:
+ case 0x248C:
+ case 0x24F9:
+ case 0x277A:
+ case 0x2784:
+ case 0x278E:
+ case 0x3025:
+ case 0x3224:
+ case 0x3284:
+ case 0x3405:
+ case 0x382A:
+ case 0x4E94:
+ case 0x4F0D:
+ case 0xA625:
+ case 0xA6EA:
+ case 0xA8D5:
+ case 0xA905:
+ case 0xA9D5:
+ case 0xAA55:
+ case 0xABF5:
+ case 0xFF15:
+ case 0x1010B:
+ case 0x10143:
+ case 0x10148:
+ case 0x1014F:
+ case 0x1015F:
+ case 0x10173:
+ case 0x10321:
+ case 0x104A5:
+ case 0x10E64:
+ case 0x11056:
+ case 0x1106B:
+ case 0x12403:
+ case 0x1240A:
+ case 0x12410:
+ case 0x12419:
+ case 0x12422:
+ case 0x12427:
+ case 0x12431:
+ case 0x12439:
+ case 0x1244D:
+ case 0x12454:
+ case 0x12455:
+ case 0x1D364:
+ case 0x1D7D3:
+ case 0x1D7DD:
+ case 0x1D7E7:
+ case 0x1D7F1:
+ case 0x1D7FB:
+ case 0x1F106:
+ case 0x20121:
+ return (double) 5.0;
+ case 0x0F2C:
+ return (double) 5.0/2.0;
+ case 0x215A:
+ case 0x1245C:
+ return (double) 5.0/6.0;
+ case 0x215D:
+ return (double) 5.0/8.0;
+ case 0x1376:
+ case 0x216C:
+ case 0x217C:
+ case 0x2186:
+ case 0x32BF:
+ case 0x10114:
+ case 0x10144:
+ case 0x1014A:
+ case 0x10151:
+ case 0x10166:
+ case 0x10167:
+ case 0x10168:
+ case 0x10169:
+ case 0x10174:
+ case 0x10323:
+ case 0x10A7E:
+ case 0x10E6D:
+ case 0x1105F:
+ case 0x1D36D:
+ return (double) 50.0;
+ case 0x216E:
+ case 0x217E:
+ case 0x1011D:
+ case 0x10145:
+ case 0x1014C:
+ case 0x10153:
+ case 0x1016C:
+ case 0x1016D:
+ case 0x1016E:
+ case 0x1016F:
+ case 0x10170:
+ case 0x10E76:
+ return (double) 500.0;
+ case 0x2181:
+ case 0x10126:
+ case 0x10146:
+ case 0x1014E:
+ case 0x10172:
+ return (double) 5000.0;
+ case 0x2187:
+ case 0x1012F:
+ case 0x10147:
+ case 0x10156:
+ return (double) 50000.0;
+ case 0x0036:
+ case 0x0666:
+ case 0x06F6:
+ case 0x07C6:
+ case 0x096C:
+ case 0x09EC:
+ case 0x0A6C:
+ case 0x0AEC:
+ case 0x0B6C:
+ case 0x0BEC:
+ case 0x0C6C:
+ case 0x0CEC:
+ case 0x0D6C:
+ case 0x0E56:
+ case 0x0ED6:
+ case 0x0F26:
+ case 0x1046:
+ case 0x1096:
+ case 0x136E:
+ case 0x17E6:
+ case 0x17F6:
+ case 0x1816:
+ case 0x194C:
+ case 0x19D6:
+ case 0x1A86:
+ case 0x1A96:
+ case 0x1B56:
+ case 0x1BB6:
+ case 0x1C46:
+ case 0x1C56:
+ case 0x2076:
+ case 0x2086:
+ case 0x2165:
+ case 0x2175:
+ case 0x2185:
+ case 0x2465:
+ case 0x2479:
+ case 0x248D:
+ case 0x24FA:
+ case 0x277B:
+ case 0x2785:
+ case 0x278F:
+ case 0x3026:
+ case 0x3225:
+ case 0x3285:
+ case 0x516D:
+ case 0x9646:
+ case 0x9678:
+ case 0xA626:
+ case 0xA6EB:
+ case 0xA8D6:
+ case 0xA906:
+ case 0xA9D6:
+ case 0xAA56:
+ case 0xABF6:
+ case 0xF9D1:
+ case 0xF9D3:
+ case 0xFF16:
+ case 0x1010C:
+ case 0x104A6:
+ case 0x10E65:
+ case 0x11057:
+ case 0x1106C:
+ case 0x12404:
+ case 0x1240B:
+ case 0x12411:
+ case 0x1241A:
+ case 0x12428:
+ case 0x12440:
+ case 0x1244E:
+ case 0x1D365:
+ case 0x1D7D4:
+ case 0x1D7DE:
+ case 0x1D7E8:
+ case 0x1D7F2:
+ case 0x1D7FC:
+ case 0x1F107:
+ case 0x20AEA:
+ return (double) 6.0;
+ case 0x1377:
+ case 0x10115:
+ case 0x10E6E:
+ case 0x11060:
+ case 0x1D36E:
+ return (double) 60.0;
+ case 0x1011E:
+ case 0x10E77:
+ return (double) 600.0;
+ case 0x10127:
+ return (double) 6000.0;
+ case 0x10130:
+ return (double) 60000.0;
+ case 0x0037:
+ case 0x0667:
+ case 0x06F7:
+ case 0x07C7:
+ case 0x096D:
+ case 0x09ED:
+ case 0x0A6D:
+ case 0x0AED:
+ case 0x0B6D:
+ case 0x0BED:
+ case 0x0C6D:
+ case 0x0CED:
+ case 0x0D6D:
+ case 0x0E57:
+ case 0x0ED7:
+ case 0x0F27:
+ case 0x1047:
+ case 0x1097:
+ case 0x136F:
+ case 0x17E7:
+ case 0x17F7:
+ case 0x1817:
+ case 0x194D:
+ case 0x19D7:
+ case 0x1A87:
+ case 0x1A97:
+ case 0x1B57:
+ case 0x1BB7:
+ case 0x1C47:
+ case 0x1C57:
+ case 0x2077:
+ case 0x2087:
+ case 0x2166:
+ case 0x2176:
+ case 0x2466:
+ case 0x247A:
+ case 0x248E:
+ case 0x24FB:
+ case 0x277C:
+ case 0x2786:
+ case 0x2790:
+ case 0x3027:
+ case 0x3226:
+ case 0x3286:
+ case 0x3B4D:
+ case 0x4E03:
+ case 0x67D2:
+ case 0x6F06:
+ case 0xA627:
+ case 0xA6EC:
+ case 0xA8D7:
+ case 0xA907:
+ case 0xA9D7:
+ case 0xAA57:
+ case 0xABF7:
+ case 0xFF17:
+ case 0x1010D:
+ case 0x104A7:
+ case 0x10E66:
+ case 0x11058:
+ case 0x1106D:
+ case 0x12405:
+ case 0x1240C:
+ case 0x12412:
+ case 0x1241B:
+ case 0x12429:
+ case 0x12441:
+ case 0x12442:
+ case 0x12443:
+ case 0x1D366:
+ case 0x1D7D5:
+ case 0x1D7DF:
+ case 0x1D7E9:
+ case 0x1D7F3:
+ case 0x1D7FD:
+ case 0x1F108:
+ case 0x20001:
+ return (double) 7.0;
+ case 0x0F2D:
+ return (double) 7.0/2.0;
+ case 0x215E:
+ return (double) 7.0/8.0;
+ case 0x1378:
+ case 0x10116:
+ case 0x10E6F:
+ case 0x11061:
+ case 0x1D36F:
+ return (double) 70.0;
+ case 0x1011F:
+ case 0x10E78:
+ return (double) 700.0;
+ case 0x10128:
+ return (double) 7000.0;
+ case 0x10131:
+ return (double) 70000.0;
+ case 0x0038:
+ case 0x0668:
+ case 0x06F8:
+ case 0x07C8:
+ case 0x096E:
+ case 0x09EE:
+ case 0x0A6E:
+ case 0x0AEE:
+ case 0x0B6E:
+ case 0x0BEE:
+ case 0x0C6E:
+ case 0x0CEE:
+ case 0x0D6E:
+ case 0x0E58:
+ case 0x0ED8:
+ case 0x0F28:
+ case 0x1048:
+ case 0x1098:
+ case 0x1370:
+ case 0x17E8:
+ case 0x17F8:
+ case 0x1818:
+ case 0x194E:
+ case 0x19D8:
+ case 0x1A88:
+ case 0x1A98:
+ case 0x1B58:
+ case 0x1BB8:
+ case 0x1C48:
+ case 0x1C58:
+ case 0x2078:
+ case 0x2088:
+ case 0x2167:
+ case 0x2177:
+ case 0x2467:
+ case 0x247B:
+ case 0x248F:
+ case 0x24FC:
+ case 0x277D:
+ case 0x2787:
+ case 0x2791:
+ case 0x3028:
+ case 0x3227:
+ case 0x3287:
+ case 0x516B:
+ case 0x634C:
+ case 0xA628:
+ case 0xA6ED:
+ case 0xA8D8:
+ case 0xA908:
+ case 0xA9D8:
+ case 0xAA58:
+ case 0xABF8:
+ case 0xFF18:
+ case 0x1010E:
+ case 0x104A8:
+ case 0x10E67:
+ case 0x11059:
+ case 0x1106E:
+ case 0x12406:
+ case 0x1240D:
+ case 0x12413:
+ case 0x1241C:
+ case 0x1242A:
+ case 0x12444:
+ case 0x12445:
+ case 0x1D367:
+ case 0x1D7D6:
+ case 0x1D7E0:
+ case 0x1D7EA:
+ case 0x1D7F4:
+ case 0x1D7FE:
+ case 0x1F109:
+ return (double) 8.0;
+ case 0x1379:
+ case 0x10117:
+ case 0x10E70:
+ case 0x11062:
+ case 0x1D370:
+ return (double) 80.0;
+ case 0x10120:
+ case 0x10E79:
+ return (double) 800.0;
+ case 0x10129:
+ return (double) 8000.0;
+ case 0x10132:
+ return (double) 80000.0;
+ case 0x0039:
+ case 0x0669:
+ case 0x06F9:
+ case 0x07C9:
+ case 0x096F:
+ case 0x09EF:
+ case 0x0A6F:
+ case 0x0AEF:
+ case 0x0B6F:
+ case 0x0BEF:
+ case 0x0C6F:
+ case 0x0CEF:
+ case 0x0D6F:
+ case 0x0E59:
+ case 0x0ED9:
+ case 0x0F29:
+ case 0x1049:
+ case 0x1099:
+ case 0x1371:
+ case 0x17E9:
+ case 0x17F9:
+ case 0x1819:
+ case 0x194F:
+ case 0x19D9:
+ case 0x1A89:
+ case 0x1A99:
+ case 0x1B59:
+ case 0x1BB9:
+ case 0x1C49:
+ case 0x1C59:
+ case 0x2079:
+ case 0x2089:
+ case 0x2168:
+ case 0x2178:
+ case 0x2468:
+ case 0x247C:
+ case 0x2490:
+ case 0x24FD:
+ case 0x277E:
+ case 0x2788:
+ case 0x2792:
+ case 0x3029:
+ case 0x3228:
+ case 0x3288:
+ case 0x4E5D:
+ case 0x5EFE:
+ case 0x7396:
+ case 0xA629:
+ case 0xA6EE:
+ case 0xA8D9:
+ case 0xA909:
+ case 0xA9D9:
+ case 0xAA59:
+ case 0xABF9:
+ case 0xFF19:
+ case 0x1010F:
+ case 0x104A9:
+ case 0x10E68:
+ case 0x1105A:
+ case 0x1106F:
+ case 0x12407:
+ case 0x1240E:
+ case 0x12414:
+ case 0x1241D:
+ case 0x1242B:
+ case 0x12446:
+ case 0x12447:
+ case 0x12448:
+ case 0x12449:
+ case 0x1D368:
+ case 0x1D7D7:
+ case 0x1D7E1:
+ case 0x1D7EB:
+ case 0x1D7F5:
+ case 0x1D7FF:
+ case 0x1F10A:
+ case 0x2F890:
+ return (double) 9.0;
+ case 0x0F2E:
+ return (double) 9.0/2.0;
+ case 0x137A:
+ case 0x10118:
+ case 0x10341:
+ case 0x10E71:
+ case 0x11063:
+ case 0x1D371:
+ return (double) 90.0;
+ case 0x10121:
+ case 0x1034A:
+ case 0x10E7A:
+ return (double) 900.0;
+ case 0x1012A:
+ return (double) 9000.0;
+ case 0x10133:
+ return (double) 90000.0;
+ }
+ return -1.0;
+}
+
+/* Returns 1 for Unicode characters having the bidirectional
+ * type 'WS', 'B' or 'S' or the category 'Zs', 0 otherwise.
+ */
+int _PyUnicode_IsWhitespace(register const Py_UCS4 ch)
+{
+ switch (ch) {
+ case 0x0009:
+ case 0x000A:
+ case 0x000B:
+ case 0x000C:
+ case 0x000D:
+ case 0x001C:
+ case 0x001D:
+ case 0x001E:
+ case 0x001F:
+ case 0x0020:
+ case 0x0085:
+ case 0x00A0:
+ case 0x1680:
+ case 0x180E:
+ case 0x2000:
+ case 0x2001:
+ case 0x2002:
+ case 0x2003:
+ case 0x2004:
+ case 0x2005:
+ case 0x2006:
+ case 0x2007:
+ case 0x2008:
+ case 0x2009:
+ case 0x200A:
+ case 0x2028:
+ case 0x2029:
+ case 0x202F:
+ case 0x205F:
+ case 0x3000:
+ return 1;
+ }
+ return 0;
+}
+
+/* Returns 1 for Unicode characters having the line break
+ * property 'BK', 'CR', 'LF' or 'NL' or having bidirectional
+ * type 'B', 0 otherwise.
+ */
+int _PyUnicode_IsLinebreak(register const Py_UCS4 ch)
+{
+ switch (ch) {
+ case 0x000A:
+ case 0x000B:
+ case 0x000C:
+ case 0x000D:
+ case 0x001C:
+ case 0x001D:
+ case 0x001E:
+ case 0x0085:
+ case 0x2028:
+ case 0x2029:
+ return 1;
+ }
+ return 0;
+}
+
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index f43b68d607..13323cfbcf 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -139,7 +139,7 @@ weakref_call(PyWeakReference *self, PyObject *args, PyObject *kw)
}
-static long
+static Py_hash_t
weakref_hash(PyWeakReference *self)
{
if (self->hash != -1)
@@ -583,7 +583,7 @@ proxy_iternext(PyWeakReference *proxy)
}
-WRAP_METHOD(proxy_bytes, "__bytes__");
+WRAP_METHOD(proxy_bytes, "__bytes__")
static PyMethodDef proxy_methods[] = {
diff --git a/PC/VC6/_ctypes.dsp b/PC/VC6/_ctypes.dsp
index 70368bfdb8..1c98eac126 100644
--- a/PC/VC6/_ctypes.dsp
+++ b/PC/VC6/_ctypes.dsp
@@ -43,10 +43,10 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
F90=df.exe
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\Modules\_ctypes\libffi_msvc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /mktyplib203 /o "NUL" /win32
-# ADD MTL /nologo /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\Modules\_ctypes\libffi_msvc" /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
diff --git a/PC/VC6/_msi.dsp b/PC/VC6/_msi.dsp
index 16e96e3508..76a61bc597 100644
--- a/PC/VC6/_msi.dsp
+++ b/PC/VC6/_msi.dsp
@@ -43,10 +43,10 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
F90=df.exe
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /mktyplib203 /o "NUL" /win32
-# ADD MTL /nologo /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
diff --git a/PC/VC6/build_ssl.py b/PC/VC6/build_ssl.py
index c51268844c..95af084afe 100644
--- a/PC/VC6/build_ssl.py
+++ b/PC/VC6/build_ssl.py
@@ -95,13 +95,9 @@ def fix_makefile(makefile):
"""
if not os.path.isfile(makefile):
return
- # 2.4 compatibility
- fin = open(makefile)
- if 1: # with open(makefile) as fin:
+ with open(makefile) as fin:
lines = fin.readlines()
- fin.close()
- fout = open(makefile, 'w')
- if 1: # with open(makefile, 'w') as fout:
+ with open(makefile, 'w') as fout:
for line in lines:
if line.startswith("PERL="):
continue
@@ -117,7 +113,6 @@ def fix_makefile(makefile):
line = line + noalgo
line = line + '\n'
fout.write(line)
- fout.close()
def run_configure(configure, do_script):
print("perl Configure "+configure)
@@ -199,7 +194,7 @@ def main():
copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch)
# If the assembler files don't exist in tmpXX, copy them there
- if perl is None:
+ if perl is None and os.path.exists("asm"+dirsuffix):
if not os.path.exists("tmp"+dirsuffix):
os.mkdir("tmp"+dirsuffix)
for f in os.listdir("asm"+dirsuffix):
diff --git a/PC/VC6/bz2.dsp b/PC/VC6/bz2.dsp
index 1e9690448c..3c164fa957 100644
--- a/PC/VC6/bz2.dsp
+++ b/PC/VC6/bz2.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
F90=df.exe
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
diff --git a/PC/VC6/pythoncore.dsp b/PC/VC6/pythoncore.dsp
index ea4f52dd99..f8a2c81ec2 100644
--- a/PC/VC6/pythoncore.dsp
+++ b/PC/VC6/pythoncore.dsp
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python31.dll"
+# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python32.dll"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "pythoncore - Win32 Debug"
@@ -82,7 +82,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python31_d.dll" /pdbtype:sept
+# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python32_d.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF
@@ -133,6 +133,10 @@ SOURCE=..\..\Modules\_csv.c
# End Source File
# Begin Source File
+SOURCE=..\..\Modules\_datetimemodule.c
+# End Source File
+# Begin Source File
+
SOURCE=..\..\Modules\_functoolsmodule.c
# End Source File
# Begin Source File
@@ -157,6 +161,10 @@ SOURCE=..\..\Modules\_lsprof.c
# End Source File
# Begin Source File
+SOURCE=..\..\Modules\_math.c
+# End Source File
+# Begin Source File
+
SOURCE=..\..\Modules\_pickle.c
# End Source File
# Begin Source File
@@ -181,6 +189,10 @@ SOURCE=..\..\Modules\_threadmodule.c
# End Source File
# Begin Source File
+SOURCE=..\..\Modules\_time.c
+# End Source File
+# Begin Source File
+
SOURCE=..\..\Python\_warnings.c
# End Source File
# Begin Source File
@@ -277,10 +289,6 @@ SOURCE=..\..\Modules\cmathmodule.c
# End Source File
# Begin Source File
-SOURCE=..\..\Objects\cobject.c
-# End Source File
-# Begin Source File
-
SOURCE=..\..\Python\codecs.c
# End Source File
# Begin Source File
@@ -309,7 +317,7 @@ SOURCE=..\..\Modules\zlib\crc32.c
# End Source File
# Begin Source File
-SOURCE=..\..\Modules\datetimemodule.c
+SOURCE=..\..\Python\dynamic_annotations.c
# End Source File
# Begin Source File
@@ -361,6 +369,10 @@ SOURCE=..\..\Objects\fileobject.c
# End Source File
# Begin Source File
+SOURCE=..\..\Python\fileutils.c
+# End Source File
+# Begin Source File
+
SOURCE=..\..\Parser\firstsets.c
# End Source File
# Begin Source File
@@ -635,6 +647,10 @@ SOURCE=..\..\Python\pythonrun.c
# End Source File
# Begin Source File
+SOURCE=..\..\Python\pytime.c
+# End Source File
+# Begin Source File
+
SOURCE=..\..\Objects\rangeobject.c
# End Source File
# Begin Source File
diff --git a/PC/VC6/readme.txt b/PC/VC6/readme.txt
index 59e65d06a7..4e8d237b7a 100644
--- a/PC/VC6/readme.txt
+++ b/PC/VC6/readme.txt
@@ -2,8 +2,7 @@ Building Python using VC++ 6.0 or 5.0
-------------------------------------
This directory is used to build Python for Win32 platforms, e.g. Windows
2000 and XP. It requires Microsoft Visual C++ 6.x or 5.x and Platform
-SDK February 2003 Edition (Core SDK). You can download this SDK from
-http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm.
+SDK February 2003 Edition (Core SDK).
(For other Windows platforms and compilers, see ../readme.txt.)
All you need to do is open the workspace "pcbuild.dsw" in MSVC++, select
@@ -13,7 +12,7 @@ and build the projects.
The proper order to build subprojects:
1) pythoncore (this builds the main Python DLL and library files,
- python31.{dll, lib} in Release mode)
+ python32.{dll, lib} in Release mode)
2) python (this builds the main Python executable,
python.exe in Release mode)
@@ -24,7 +23,7 @@ The proper order to build subprojects:
to the subsystems they implement; see SUBPROJECTS below)
When using the Debug setting, the output files have a _d added to
-their name: python31_d.dll, python_d.exe, pyexpat_d.pyd, and so on.
+their name: python32_d.dll, python_d.exe, pyexpat_d.pyd, and so on.
SUBPROJECTS
-----------
diff --git a/PC/VC6/tcl852.patch b/PC/VC6/tcl852.patch
index 0b6c4662b8..ed6780ad93 100644
--- a/PC/VC6/tcl852.patch
+++ b/PC/VC6/tcl852.patch
@@ -9,14 +9,3 @@
typedef struct _stati64 Tcl_StatBuf;
# else
typedef struct _stat64 Tcl_StatBuf;
---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008
-+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009
-@@ -367,7 +367,7 @@
- typedef struct stati64 Tcl_StatBuf;
- # define TCL_LL_MODIFIER "L"
- # else /* __BORLANDC__ */
--# if _MSC_VER < 1400 && !defined(_M_IX86)
-+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/
- typedef struct _stati64 Tcl_StatBuf;
- # else
- typedef struct _stat64 Tcl_StatBuf;
diff --git a/PC/VS7.1/pythoncore.vcproj b/PC/VS7.1/pythoncore.vcproj
index c05addde27..a6f897ae64 100644
--- a/PC/VS7.1/pythoncore.vcproj
+++ b/PC/VS7.1/pythoncore.vcproj
@@ -39,15 +39,15 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="getbuildinfo.o"
- OutputFile="./python31.dll"
+ OutputFile="./python32.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\./python31.pdb"
+ ProgramDatabaseFile=".\./python32.pdb"
SubSystem="2"
BaseAddress="0x1e000000"
- ImportLibrary=".\./python31.lib"
+ ImportLibrary=".\./python32.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
@@ -99,15 +99,15 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="getbuildinfo.o"
- OutputFile="./python31_d.dll"
+ OutputFile="./python32_d.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\./python31_d.pdb"
+ ProgramDatabaseFile=".\./python32_d.pdb"
SubSystem="2"
BaseAddress="0x1e000000"
- ImportLibrary=".\./python31_d.lib"
+ ImportLibrary=".\./python32_d.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
@@ -166,15 +166,15 @@
Name="VCLinkerTool"
AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
AdditionalDependencies="getbuildinfo.o"
- OutputFile="./python31.dll"
+ OutputFile="./python32.dll"
LinkIncremental="1"
SuppressStartupBanner="FALSE"
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\./python31.pdb"
+ ProgramDatabaseFile=".\./python32.pdb"
SubSystem="2"
BaseAddress="0x1e000000"
- ImportLibrary=".\./python31.lib"
+ ImportLibrary=".\./python32.lib"
TargetMachine="0"/>
<Tool
Name="VCMIDLTool"/>
@@ -233,15 +233,15 @@
Name="VCLinkerTool"
AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"
AdditionalDependencies="getbuildinfo.o"
- OutputFile="./python31.dll"
+ OutputFile="./python32.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\./python31.pdb"
+ ProgramDatabaseFile=".\./python32.pdb"
SubSystem="2"
BaseAddress="0x1e000000"
- ImportLibrary=".\./python31.lib"
+ ImportLibrary=".\./python32.lib"
TargetMachine="0"/>
<Tool
Name="VCMIDLTool"/>
@@ -391,9 +391,15 @@
RelativePath="..\..\Modules\_codecsmodule.c">
</File>
<File
+ RelativePath="..\..\Modules\_collectionsmodule.c">
+ </File>
+ <File
RelativePath="..\..\Modules\_csv.c">
</File>
<File
+ RelativePath="..\..\Modules\_datetimemodule.c">
+ </File>
+ <File
RelativePath="..\..\Modules\_functoolsmodule.c">
</File>
<File
@@ -409,6 +415,9 @@
RelativePath="..\..\Modules\_lsprof.c">
</File>
<File
+ RelativePath="..\..\Modules\_math.c">
+ </File>
+ <File
RelativePath="..\..\Modules\_pickle.c">
</File>
<File
@@ -424,10 +433,13 @@
RelativePath="..\..\Pc\_subprocess.c">
</File>
<File
- RelativePath="..\..\Modules\_weakref.c">
+ RelativePath="..\..\Modules\_time.c">
</File>
<File
- RelativePath="..\..\Pc\winreg.c">
+ RelativePath="..\..\Python\_warnings.c">
+ </File>
+ <File
+ RelativePath="..\..\Modules\_weakref.c">
</File>
<File
RelativePath="..\..\Objects\abstract.c">
@@ -439,9 +451,6 @@
RelativePath="..\..\Modules\arraymodule.c">
</File>
<File
- RelativePath="..\..\Python\_warnings.c">
- </File>
- <File
RelativePath="..\..\Python\asdl.c">
</File>
<File
@@ -466,10 +475,10 @@
RelativePath="..\..\Objects\boolobject.c">
</File>
<File
- RelativePath="..\..\Objects\bytearrayobject.c">
+ RelativePath="..\..\Objects\bytes_methods.c">
</File>
<File
- RelativePath="..\..\Objects\bytes_methods.c">
+ RelativePath="..\..\Objects\bytearrayobject.c">
</File>
<File
RelativePath="..\..\Objects\bytesobject.c">
@@ -490,18 +499,12 @@
RelativePath="..\..\Modules\cmathmodule.c">
</File>
<File
- RelativePath="..\..\Objects\cobject.c">
- </File>
- <File
RelativePath="..\..\Python\codecs.c">
</File>
<File
RelativePath="..\..\Objects\codeobject.c">
</File>
<File
- RelativePath="..\..\Modules\_collectionsmodule.c">
- </File>
- <File
RelativePath="..\..\Python\compile.c">
</File>
<File
@@ -511,7 +514,7 @@
RelativePath="..\..\PC\config.c">
</File>
<File
- RelativePath="..\..\Modules\datetimemodule.c">
+ RelativePath="..\..\Python\dynamic_annotations.c">
</File>
<File
RelativePath="..\..\Objects\descrobject.c">
@@ -544,6 +547,9 @@
RelativePath="..\..\Objects\fileobject.c">
</File>
<File
+ RelativePath="..\..\Python\fileutils.c">
+ </File>
+ <File
RelativePath="..\..\Parser\firstsets.c">
</File>
<File
@@ -746,6 +752,9 @@
RelativePath="..\..\Python\pystrtod.c">
</File>
<File
+ RelativePath="..\..\Python\pytime.c">
+ </File>
+ <File
RelativePath="..\..\Python\Python-ast.c">
</File>
<File
@@ -821,6 +830,9 @@
RelativePath="..\..\Objects\unicodeobject.c">
</File>
<File
+ RelativePath="..\..\Pc\winreg.c">
+ </File>
+ <File
RelativePath="..\..\Objects\weakrefobject.c">
</File>
<File
diff --git a/PC/VS7.1/rt.bat b/PC/VS7.1/rt.bat
index ba1d090517..a910a794a9 100755
--- a/PC/VS7.1/rt.bat
+++ b/PC/VS7.1/rt.bat
@@ -27,7 +27,7 @@ setlocal
set exe=python
set qmode=
set dashO=
-PATH %PATH%;..\..\..\tcltk\bin
+PATH %PATH%;%~dp0..\..\..\tcltk\bin
:CheckOpts
if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
diff --git a/PC/VS8.0/_hashlib.vcproj b/PC/VS8.0/_hashlib.vcproj
index faa8388307..f031e2e77a 100644
--- a/PC/VS8.0/_hashlib.vcproj
+++ b/PC/VS8.0/_hashlib.vcproj
@@ -27,7 +27,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -89,7 +88,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -153,7 +151,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -216,7 +213,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -280,7 +276,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -343,7 +338,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -408,7 +402,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -471,7 +464,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
diff --git a/PC/VS8.0/_sqlite3.vcproj b/PC/VS8.0/_sqlite3.vcproj
index b785f9544e..64f19f1b48 100644
--- a/PC/VS8.0/_sqlite3.vcproj
+++ b/PC/VS8.0/_sqlite3.vcproj
@@ -42,7 +42,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\sqlite-3.5.9"
+ AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"
PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"
/>
<Tool
@@ -104,7 +104,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\sqlite-3.5.9"
+ AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"
PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"
/>
<Tool
@@ -166,7 +166,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\sqlite-3.5.9"
+ AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"
PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"
/>
<Tool
@@ -229,7 +229,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\sqlite-3.5.9"
+ AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"
PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"
/>
<Tool
@@ -291,7 +291,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\sqlite-3.5.9"
+ AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"
PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"
/>
<Tool
@@ -354,7 +354,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\sqlite-3.5.9"
+ AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"
PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"
/>
<Tool
@@ -417,7 +417,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\sqlite-3.5.9"
+ AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"
PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"
/>
<Tool
@@ -480,7 +480,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\sqlite-3.5.9"
+ AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"
PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"
/>
<Tool
diff --git a/PC/VS8.0/_ssl.vcproj b/PC/VS8.0/_ssl.vcproj
index 69f7726317..d9267a481e 100644
--- a/PC/VS8.0/_ssl.vcproj
+++ b/PC/VS8.0/_ssl.vcproj
@@ -27,7 +27,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -89,7 +88,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -153,7 +151,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -216,7 +213,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -280,7 +276,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -343,7 +338,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -408,7 +402,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -471,7 +464,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
diff --git a/PC/VS8.0/build_ssl.bat b/PC/VS8.0/build_ssl.bat
index cee64a8a59..39c1ff0d72 100644
--- a/PC/VS8.0/build_ssl.bat
+++ b/PC/VS8.0/build_ssl.bat
@@ -2,10 +2,10 @@
if not defined HOST_PYTHON (
if %1 EQU Debug (
set HOST_PYTHON=python_d.exe
- if not exist python31_d.dll exit 1
+ if not exist python32_d.dll exit 1
) ELSE (
set HOST_PYTHON=python.exe
- if not exist python31.dll exit 1
+ if not exist python32.dll exit 1
)
)
%HOST_PYTHON% build_ssl.py %1 %2 %3
diff --git a/PC/VS8.0/build_ssl.py b/PC/VS8.0/build_ssl.py
index a08cc5e45c..dc13ef5709 100644
--- a/PC/VS8.0/build_ssl.py
+++ b/PC/VS8.0/build_ssl.py
@@ -141,11 +141,27 @@ def fix_makefile(makefile):
fout.write(line)
def run_configure(configure, do_script):
- print("perl Configure "+configure)
- os.system("perl Configure "+configure)
+ print("perl Configure "+configure+" no-idea no-mdc2")
+ os.system("perl Configure "+configure+" no-idea no-mdc2")
print(do_script)
os.system(do_script)
+def cmp(f1, f2):
+ bufsize = 1024 * 8
+ with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2:
+ while True:
+ b1 = fp1.read(bufsize)
+ b2 = fp2.read(bufsize)
+ if b1 != b2:
+ return False
+ if not b1:
+ return True
+
+def copy(src, dst):
+ if os.path.isfile(dst) and cmp(src, dst):
+ return
+ shutil.copy(src, dst)
+
def main():
build_all = "-a" in sys.argv
if sys.argv[1] == "Release":
@@ -161,12 +177,14 @@ def main():
do_script = "ms\\do_nasm"
makefile="ms\\nt.mak"
m32 = makefile
+ dirsuffix = "32"
elif sys.argv[2] == "x64":
arch="amd64"
configure = "VC-WIN64A"
do_script = "ms\\do_win64a"
makefile = "ms\\nt64.mak"
m32 = makefile.replace('64', '')
+ dirsuffix = "64"
#os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON"
else:
raise ValueError(str(sys.argv))
@@ -220,8 +238,17 @@ def main():
if arch == "amd64":
create_makefile64(makefile, m32)
fix_makefile(makefile)
- shutil.copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch)
- shutil.copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch)
+ copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch)
+ copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch)
+
+ # If the assembler files don't exist in tmpXX, copy them there
+ if perl is None and os.path.exists("asm"+dirsuffix):
+ if not os.path.exists("tmp"+dirsuffix):
+ os.mkdir("tmp"+dirsuffix)
+ for f in os.listdir("asm"+dirsuffix):
+ if not f.endswith(".asm"): continue
+ if os.path.isfile(r"tmp%s\%s" % (dirsuffix, f)): continue
+ shutil.copy(r"asm%s\%s" % (dirsuffix, f), "tmp"+dirsuffix)
# Now run make.
if arch == "amd64":
@@ -230,8 +257,8 @@ def main():
print("ml64 assembler has failed.")
sys.exit(rc)
- shutil.copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h")
- shutil.copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h")
+ copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h")
+ copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h")
#makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)
makeCommand = "nmake /nologo -f \"%s\"" % makefile
diff --git a/PC/VS8.0/bz2.vcproj b/PC/VS8.0/bz2.vcproj
index e6ffdf2032..a97d1d5d6c 100644
--- a/PC/VS8.0/bz2.vcproj
+++ b/PC/VS8.0/bz2.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -105,7 +105,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -167,7 +167,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -230,7 +230,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -292,7 +292,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -355,7 +355,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -418,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -481,7 +481,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
diff --git a/PC/VS8.0/kill_python.c b/PC/VS8.0/kill_python.c
index 17a5f32ab2..6b916781cc 100644
--- a/PC/VS8.0/kill_python.c
+++ b/PC/VS8.0/kill_python.c
@@ -106,7 +106,7 @@ main(int argc, char **argv)
/*
* XXX TODO: if we really wanted to be fancy, we could check the
* modules for all processes (not just the python[_d].exe ones)
- * and see if any of our DLLs are loaded (i.e. python31[_d].dll),
+ * and see if any of our DLLs are loaded (i.e. python32[_d].dll),
* as that would also inhibit our ability to rebuild the solution.
* Not worth loosing sleep over though; for now, a simple check
* for just the python executable should be sufficient.
diff --git a/PC/VS8.0/make_buildinfo.c b/PC/VS8.0/make_buildinfo.c
index 8cc3da28e8..8efa07a364 100644
--- a/PC/VS8.0/make_buildinfo.c
+++ b/PC/VS8.0/make_buildinfo.c
@@ -19,9 +19,15 @@
invoked as a pre-link step for pythoncore, so that overwrites
any previous getbuildinfo.o.
+ However, if a second argument is provided, this will be used
+ as a temporary directory where any getbuildinfo2.c and
+ getbuildinfo.o files are put. This is useful if multiple
+ configurations are being built in parallel, to avoid them
+ trampling each other's files.
+
*/
-int make_buildinfo2()
+int make_buildinfo2(const char *tmppath)
{
struct _stat st;
HKEY hTortoise;
@@ -46,7 +52,9 @@ int make_buildinfo2()
if (_stat(command+1, &st) < 0)
/* subwcrev.exe not part of the release */
return 0;
- strcat_s(command, CMD_SIZE, "\" ..\\.. ..\\..\\Modules\\getbuildinfo.c getbuildinfo2.c");
+ strcat_s(command, CMD_SIZE, "\" ..\\.. ..\\..\\Modules\\getbuildinfo.c ");
+ strcat_s(command, CMD_SIZE, tmppath);
+ strcat_s(command, CMD_SIZE, "getbuildinfo2.c");
puts(command); fflush(stdout);
if (system(command) < 0)
return 0;
@@ -55,10 +63,12 @@ int make_buildinfo2()
int main(int argc, char*argv[])
{
- char command[500] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
+ char command[CMD_SIZE] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
+ char tmppath[CMD_SIZE] = "";
int do_unlink, result;
- if (argc != 2) {
- fprintf(stderr, "make_buildinfo $(ConfigurationName)\n");
+ char *tmpdir = NULL;
+ if (argc <= 2 || argc > 3) {
+ fprintf(stderr, "make_buildinfo $(ConfigurationName) [tmpdir]\n");
return EXIT_FAILURE;
}
if (strcmp(argv[1], "Release") == 0) {
@@ -78,16 +88,28 @@ int main(int argc, char*argv[])
fprintf(stderr, "unsupported configuration %s\n", argv[1]);
return EXIT_FAILURE;
}
+ if (argc > 2) {
+ tmpdir = argv[2];
+ strcat_s(tmppath, _countof(tmppath), tmpdir);
+ strcat_s(tmppath, _countof(tmppath), "\\");
+ }
- if ((do_unlink = make_buildinfo2()))
+ if ((do_unlink = make_buildinfo2(tmppath))) {
+ strcat_s(command, CMD_SIZE, tmppath);
strcat_s(command, CMD_SIZE, "getbuildinfo2.c -DSUBWCREV ");
- else
+ } else
strcat_s(command, CMD_SIZE, "..\\..\\Modules\\getbuildinfo.c");
- strcat_s(command, CMD_SIZE, " -Fogetbuildinfo.o -I..\\..\\Include -I..\\..\\PC");
+ strcat_s(command, CMD_SIZE, " -Fo");
+ strcat_s(command, CMD_SIZE, tmppath);
+ strcat_s(command, CMD_SIZE, "getbuildinfo.o -I..\\..\\Include -I..\\..\\PC");
puts(command); fflush(stdout);
result = system(command);
- if (do_unlink)
- _unlink("getbuildinfo2.c");
+ if (do_unlink) {
+ command[0] = '\0';
+ strcat_s(command, CMD_SIZE, tmppath);
+ strcat_s(command, CMD_SIZE, "getbuildinfo2.c");
+ _unlink(command);
+ }
if (result < 0)
return EXIT_FAILURE;
return 0;
diff --git a/PC/VS8.0/make_buildinfo.vcproj b/PC/VS8.0/make_buildinfo.vcproj
index 3cc71e659f..fb5cccd957 100644
--- a/PC/VS8.0/make_buildinfo.vcproj
+++ b/PC/VS8.0/make_buildinfo.vcproj
@@ -12,9 +12,6 @@
<Platform
Name="Win32"
/>
- <Platform
- Name="x64"
- />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -84,64 +81,6 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
- <Configuration
- Name="Release|x64"
- ConfigurationType="1"
- InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="_CONSOLE"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
</Configurations>
<References>
</References>
diff --git a/PC/VS8.0/pcbuild.sln b/PC/VS8.0/pcbuild.sln
index b4fe99fa9f..9aca4aaa8c 100644
--- a/PC/VS8.0/pcbuild.sln
+++ b/PC/VS8.0/pcbuild.sln
@@ -74,6 +74,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcproj", "{C6E
{B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}
{86937F53-C189-40EF-8CE8-8759D8E7D480} = {86937F53-C189-40EF-8CE8-8759D8E7D480}
{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0} = {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}"
@@ -112,6 +113,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcproj
ProjectSection(ProjectDependencies) = postProject
{B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}
{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0} = {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}"
@@ -124,6 +126,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multip
{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl", "ssl.vcproj", "{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}"
+ ProjectSection(ProjectDependencies) = postProject
+ {B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}
+ EndProjectSection
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kill_python", "kill_python.vcproj", "{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}"
EndProject
Global
@@ -514,6 +521,22 @@ Global
{9E48B300-37D1-11DD-8C41-005056C00008}.Release|Win32.Build.0 = Release|Win32
{9E48B300-37D1-11DD-8C41-005056C00008}.Release|x64.ActiveCfg = Release|x64
{9E48B300-37D1-11DD-8C41-005056C00008}.Release|x64.Build.0 = Release|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|Win32.Build.0 = Debug|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|x64.ActiveCfg = Debug|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|x64.Build.0 = Debug|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|x64.Build.0 = PGInstrument|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|x64.Build.0 = PGUpdate|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|Win32.ActiveCfg = Release|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|Win32.Build.0 = Release|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|x64.ActiveCfg = Release|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|x64.Build.0 = Release|x64
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|Win32.ActiveCfg = Debug|Win32
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|Win32.Build.0 = Debug|Win32
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/PC/VS8.0/pyproject.vsprops b/PC/VS8.0/pyproject.vsprops
index 70025bd467..64942160e2 100644
--- a/PC/VS8.0/pyproject.vsprops
+++ b/PC/VS8.0/pyproject.vsprops
@@ -38,7 +38,7 @@
/>
<UserMacro
Name="PyDllName"
- Value="python31"
+ Value="python32"
/>
<UserMacro
Name="PythonExe"
@@ -50,7 +50,7 @@
/>
<UserMacro
Name="sqlite3Dir"
- Value="$(externalsDir)\sqlite-3.5.9"
+ Value="$(externalsDir)\sqlite-3.6.21"
/>
<UserMacro
Name="bz2Dir"
@@ -58,7 +58,7 @@
/>
<UserMacro
Name="opensslDir"
- Value="$(externalsDir)\openssl-0.9.8l"
+ Value="$(externalsDir)\openssl-1.0.0a"
/>
<UserMacro
Name="tcltkDir"
diff --git a/PC/VS8.0/pythoncore.vcproj b/PC/VS8.0/pythoncore.vcproj
index 5c806d870c..7252bcd603 100644
--- a/PC/VS8.0/pythoncore.vcproj
+++ b/PC/VS8.0/pythoncore.vcproj
@@ -59,11 +59,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="$(IntDir)\getbuildinfo.o"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -134,11 +134,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="$(IntDir)\getbuildinfo.o"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -212,11 +212,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug $(IntDir)"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="$(IntDir)\getbuildinfo.o"
OutputFile="$(OutDir)\$(PyDllName)_d.dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"
@@ -290,11 +290,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug $(IntDir)"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="$(IntDir)\getbuildinfo.o"
OutputFile="$(OutDir)\$(PyDllName)_d.dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"
@@ -364,11 +364,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="$(IntDir)\getbuildinfo.o"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -439,11 +439,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="$(IntDir)\getbuildinfo.o"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -514,11 +514,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release ($IntDir)"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="$(IntDir)\getbuildinfo.o"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -589,11 +589,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="$(IntDir)\getbuildinfo.o"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -675,10 +675,6 @@
>
</File>
<File
- RelativePath="..\..\Include\cobject.h"
- >
- </File>
- <File
RelativePath="..\..\Include\code.h"
>
</File>
@@ -707,6 +703,10 @@
>
</File>
<File
+ RelativePath="..\..\Include\dynamic_annotations.h"
+ >
+ </File>
+ <File
RelativePath="..\..\Include\enumobject.h"
>
</File>
@@ -723,6 +723,10 @@
>
</File>
<File
+ RelativePath="..\..\Include\fileutils.h"
+ >
+ </File>
+ <File
RelativePath="..\..\Include\floatobject.h"
>
</File>
@@ -755,10 +759,6 @@
>
</File>
<File
- RelativePath="..\..\Include\intobject.h"
- >
- </File>
- <File
RelativePath="..\..\Include\intrcheck.h"
>
</File>
@@ -883,6 +883,10 @@
>
</File>
<File
+ RelativePath="..\..\Include\pytime.h"
+ >
+ </File>
+ <File
RelativePath="..\..\Include\pymem.h"
>
</File>
@@ -1019,6 +1023,14 @@
>
</File>
<File
+ RelativePath="..\..\Modules\_math.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Modules\_math.h"
+ >
+ </File>
+ <File
RelativePath="..\..\Modules\_pickle.c"
>
</File>
@@ -1035,6 +1047,14 @@
>
</File>
<File
+ RelativePath="..\..\Modules\_time.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Modules\_time.h"
+ >
+ </File>
+ <File
RelativePath="..\..\Modules\_weakref.c"
>
</File>
@@ -1059,7 +1079,7 @@
>
</File>
<File
- RelativePath="..\..\Modules\datetimemodule.c"
+ RelativePath="..\..\Modules\_datetimemodule.c"
>
</File>
<File
@@ -1216,6 +1236,70 @@
<File
RelativePath="..\..\Modules\zlib\gzio.c"
>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|Win64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|Win64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\..\Modules\zlib\infback.c"
@@ -1391,10 +1475,6 @@
>
</File>
<File
- RelativePath="..\..\Objects\cobject.c"
- >
- </File>
- <File
RelativePath="..\..\Objects\codeobject.c"
>
</File>
@@ -1499,6 +1579,10 @@
>
</File>
<File
+ RelativePath="..\..\Objects\stringlib\split.h"
+ >
+ </File>
+ <File
RelativePath="..\..\Objects\structseq.c"
>
</File>
@@ -1659,6 +1743,10 @@
>
</File>
<File
+ RelativePath="..\..\Python\dynamic_annotations.c"
+ >
+ </File>
+ <File
RelativePath="..\..\Python\dynload_win.c"
>
</File>
@@ -1667,6 +1755,10 @@
>
</File>
<File
+ RelativePath="..\..\Python\fileutils.c"
+ >
+ </File>
+ <File
RelativePath="..\..\Python\formatter_unicode.c"
>
</File>
@@ -1755,6 +1847,10 @@
>
</File>
<File
+ RelativePath="..\..\Python\pytime.c"
+ >
+ </File>
+ <File
RelativePath="..\..\Python\pystate.c"
>
</File>
diff --git a/PC/VS8.0/rt.bat b/PC/VS8.0/rt.bat
index c35ec0cff6..0429e19ebc 100644
--- a/PC/VS8.0/rt.bat
+++ b/PC/VS8.0/rt.bat
@@ -27,7 +27,7 @@ setlocal
set exe=python
set qmode=
set dashO=
-PATH %PATH%;..\..\..\tcltk\bin
+PATH %PATH%;%~dp0..\..\..\tcltk\bin
:CheckOpts
if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
diff --git a/PC/VS8.0/sqlite3.vcproj b/PC/VS8.0/sqlite3.vcproj
index 9fe8a9b2b6..9afbe5de4e 100644
--- a/PC/VS8.0/sqlite3.vcproj
+++ b/PC/VS8.0/sqlite3.vcproj
@@ -287,7 +287,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..\..\..\sqlite-3.5.9&quot;"
+ AdditionalIncludeDirectories="&quot;..\..\..\sqlite-3.6.21&quot;"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -515,11 +515,11 @@
Name="Header Files"
>
<File
- RelativePath="..\..\..\sqlite-3.5.9\sqlite3.h"
+ RelativePath="..\..\..\sqlite-3.6.21\sqlite3.h"
>
</File>
<File
- RelativePath="..\..\..\sqlite-3.5.9\sqlite3ext.h"
+ RelativePath="..\..\..\sqlite-3.6.21\sqlite3ext.h"
>
</File>
</Filter>
@@ -527,7 +527,7 @@
Name="Source Files"
>
<File
- RelativePath="..\..\..\sqlite-3.5.9\sqlite3.c"
+ RelativePath="..\..\..\sqlite-3.6.21\sqlite3.c"
>
</File>
</Filter>
diff --git a/PC/VS8.0/sqlite3.vsprops b/PC/VS8.0/sqlite3.vsprops
index 8c028dc689..83003289f8 100644
--- a/PC/VS8.0/sqlite3.vsprops
+++ b/PC/VS8.0/sqlite3.vsprops
@@ -7,7 +7,7 @@
>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\sqlite-3.5.9"
+ AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"
PreprocessorDefinitions="SQLITE_API=__declspec(dllexport)"
WarningLevel="1"
/>
diff --git a/PC/VS8.0/ssl.vcproj b/PC/VS8.0/ssl.vcproj
new file mode 100644
index 0000000000..f0d635e6e3
--- /dev/null
+++ b/PC/VS8.0/ssl.vcproj
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ssl"
+ ProjectGUID="{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}"
+ RootNamespace="ssl"
+ Keyword="MakeFileProj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd_d.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGInstrument|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGInstrument|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGUpdate|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGUpdate|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/PC/_msi.c b/PC/_msi.c
index 26f3f33421..d4d8483115 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -1,5 +1,5 @@
/* Helper library for MSI creation with Python.
- * Copyright (C) 2005 Martin v. Löwis
+ * Copyright (C) 2005 Martin v. Löwis
* Licensed to PSF under a contributor agreement.
*/
diff --git a/PC/_subprocess.c b/PC/_subprocess.c
index 27d3dc69c8..2338f3085b 100644
--- a/PC/_subprocess.c
+++ b/PC/_subprocess.c
@@ -329,7 +329,8 @@ gethandle(PyObject* obj, char* name)
static PyObject*
getenvironment(PyObject* environment)
{
- int i, envsize;
+ int i;
+ Py_ssize_t envsize;
PyObject* out = NULL;
PyObject* keys;
PyObject* values;
@@ -356,7 +357,7 @@ getenvironment(PyObject* environment)
p = PyUnicode_AS_UNICODE(out);
for (i = 0; i < envsize; i++) {
- int ksize, vsize, totalsize;
+ Py_ssize_t ksize, vsize, totalsize;
PyObject* key = PyList_GET_ITEM(keys, i);
PyObject* value = PyList_GET_ITEM(values, i);
@@ -370,7 +371,7 @@ getenvironment(PyObject* environment)
totalsize = (p - PyUnicode_AS_UNICODE(out)) + ksize + 1 +
vsize + 1 + 1;
if (totalsize > PyUnicode_GET_SIZE(out)) {
- int offset = p - PyUnicode_AS_UNICODE(out);
+ Py_ssize_t offset = p - PyUnicode_AS_UNICODE(out);
PyUnicode_Resize(&out, totalsize + 1024);
p = PyUnicode_AS_UNICODE(out) + offset;
}
@@ -682,5 +683,7 @@ PyInit__subprocess()
defint(d, "INFINITE", INFINITE);
defint(d, "WAIT_OBJECT_0", WAIT_OBJECT_0);
defint(d, "CREATE_NEW_CONSOLE", CREATE_NEW_CONSOLE);
+ defint(d, "CREATE_NEW_PROCESS_GROUP", CREATE_NEW_PROCESS_GROUP);
+
return m;
}
diff --git a/PC/config.c b/PC/config.c
index 28d02b1b91..1fc2b40a19 100644
--- a/PC/config.c
+++ b/PC/config.c
@@ -43,7 +43,7 @@ extern PyObject* PyInit__sre(void);
extern PyObject* PyInit_parser(void);
extern PyObject* PyInit_winreg(void);
extern PyObject* PyInit__struct(void);
-extern PyObject* PyInit_datetime(void);
+extern PyObject* PyInit__datetime(void);
extern PyObject* PyInit__functools(void);
extern PyObject* PyInit__json(void);
extern PyObject* PyInit_zlib(void);
@@ -62,6 +62,7 @@ extern PyObject* PyInit__io(void);
extern PyObject* PyInit__pickle(void);
extern PyObject* PyInit_atexit(void);
extern PyObject* _PyWarnings_Init(void);
+extern PyObject* PyInit__string(void);
/* tools/freeze/makeconfig.py marker for additional "extern" */
/* -- ADDMODULE MARKER 1 -- */
@@ -116,7 +117,7 @@ struct _inittab _PyImport_Inittab[] = {
{"parser", PyInit_parser},
{"winreg", PyInit_winreg},
{"_struct", PyInit__struct},
- {"datetime", PyInit_datetime},
+ {"_datetime", PyInit__datetime},
{"_functools", PyInit__functools},
{"_json", PyInit__json},
@@ -147,6 +148,7 @@ struct _inittab _PyImport_Inittab[] = {
{"builtins", NULL},
{"sys", NULL},
{"_warnings", _PyWarnings_Init},
+ {"_string", PyInit__string},
{"_io", PyInit__io},
{"_pickle", PyInit__pickle},
diff --git a/PC/getpathp.c b/PC/getpathp.c
index 0fe04c7fa4..cd3a4b2504 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -51,6 +51,9 @@
exe, some very strange installation setup) you get a path with
some default, but relative, paths.
+ * An embedding application can use Py_SetPath() to override all of
+ these authomatic path computations.
+
---------------------------------------------------------------- */
@@ -79,6 +82,9 @@
* The approach is an adaptation for Windows of the strategy used in
* ../Modules/getpath.c; it uses the Windows Registry as one of its
* information sources.
+ *
+ * Py_SetPath() can be used to override this mechanism. Call Py_SetPath
+ * with a semicolon separated path prior to calling Py_Initialize.
*/
#ifndef LANDMARK
@@ -654,6 +660,24 @@ calculate_path(void)
/* External interface */
+void
+Py_SetPath(const wchar_t *path)
+{
+ if (module_search_path != NULL) {
+ free(module_search_path);
+ module_search_path = NULL;
+ }
+ if (path != NULL) {
+ extern wchar_t *Py_GetProgramName(void);
+ wchar_t *prog = Py_GetProgramName();
+ wcsncpy(progpath, prog, MAXPATHLEN);
+ prefix[0] = L'\0';
+ module_search_path = malloc((wcslen(path) + 1) * sizeof(wchar_t));
+ if (module_search_path != NULL)
+ wcscpy(module_search_path, path);
+ }
+}
+
wchar_t *
Py_GetPath(void)
{
@@ -683,3 +707,38 @@ Py_GetProgramFullPath(void)
calculate_path();
return progpath;
}
+
+/* Load python3.dll before loading any extension module that might refer
+ to it. That way, we can be sure that always the python3.dll corresponding
+ to this python DLL is loaded, not a python3.dll that might be on the path
+ by chance.
+ Return whether the DLL was found.
+*/
+static int python3_checked = 0;
+static HANDLE hPython3;
+int
+_Py_CheckPython3()
+{
+ wchar_t py3path[MAXPATHLEN+1];
+ wchar_t *s;
+ if (python3_checked)
+ return hPython3 != NULL;
+ python3_checked = 1;
+
+ /* If there is a python3.dll next to the python3y.dll,
+ assume this is a build tree; use that DLL */
+ wcscpy(py3path, dllpath);
+ s = wcsrchr(py3path, L'\\');
+ if (!s)
+ s = py3path;
+ wcscpy(s, L"\\python3.dll");
+ hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ if (hPython3 != NULL)
+ return 1;
+
+ /* Check sys.prefix\DLLs\python3.dll */
+ wcscpy(py3path, Py_GetPrefix());
+ wcscat(py3path, L"\\DLLs\\python3.dll");
+ hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ return hPython3 != NULL;
+}
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
index 37631a7792..166df036f2 100755
--- a/PC/msvcrtmodule.c
+++ b/PC/msvcrtmodule.c
@@ -200,12 +200,12 @@ msvcrt_getch(PyObject *self, PyObject *args)
PyDoc_STRVAR(getch_doc,
"getch() -> key character\n\
\n\
-Read a keypress and return the resulting character. Nothing is echoed to\n\
-the console. This call will block if a keypress is not already\n\
-available, but will not wait for Enter to be pressed. If the pressed key\n\
-was a special function key, this will return '\\000' or '\\xe0'; the next\n\
-call will return the keycode. The Control-C keypress cannot be read with\n\
-this function.");
+Read a keypress and return the resulting character as a byte string.\n\
+Nothing is echoed to the console. This call will block if a keypress is\n\
+not already available, but will not wait for Enter to be pressed. If the\n\
+pressed key was a special function key, this will return '\\000' or\n\
+'\\xe0'; the next call will return the keycode. The Control-C keypress\n\
+cannot be read with this function.");
#ifdef _WCONIO_DEFINED
static PyObject *
@@ -291,7 +291,7 @@ msvcrt_putch(PyObject *self, PyObject *args)
PyDoc_STRVAR(putch_doc,
"putch(char) -> None\n\
\n\
-Print the character char to the console without buffering.");
+Print the byte string char to the console without buffering.");
#ifdef _WCONIO_DEFINED
static PyObject *
@@ -330,8 +330,9 @@ msvcrt_ungetch(PyObject *self, PyObject *args)
PyDoc_STRVAR(ungetch_doc,
"ungetch(char) -> None\n\
\n\
-Cause the character char to be \"pushed back\" into the console buffer;\n\
-it will be the next character read by getch() or getche().");
+Cause the byte string char to be \"pushed back\" into the\n\
+console buffer; it will be the next character read by\n\
+getch() or getche().");
#ifdef _WCONIO_DEFINED
static PyObject *
diff --git a/PC/os2emx/Makefile b/PC/os2emx/Makefile
index 0db46a5308..d9cded7cb9 100644
--- a/PC/os2emx/Makefile
+++ b/PC/os2emx/Makefile
@@ -332,6 +332,7 @@ SRC.PYTHON= $(addprefix $(TOP), \
Python/ceval.c \
Python/compile.c \
Python/codecs.c \
+ Python/dynamic_annotations.c \
Python/errors.c \
Python/frozen.c \
Python/frozenmain.c \
diff --git a/PC/os2emx/python27.def b/PC/os2emx/python27.def
index 0776ced1c8..d87dd76c75 100644
--- a/PC/os2emx/python27.def
+++ b/PC/os2emx/python27.def
@@ -1048,11 +1048,6 @@ EXPORTS
"_PyThreadState_Current"
"_PyThreadState_GetFrame"
-; From python26_s.lib(pystrtod)
- "PyOS_ascii_strtod"
- "PyOS_ascii_formatd"
- "PyOS_ascii_atof"
-
; From python26_s.lib(pythonrun)
"Py_IgnoreEnvironmentFlag"
"Py_DebugFlag"
@@ -1173,7 +1168,6 @@ EXPORTS
"PyThread_delete_key"
"PyThread_set_key_value"
"PyThread_get_key_value"
- "PyThread__exit_thread"
; From python26_s.lib(gcmodule)
; "initgc"
diff --git a/PC/os2vacpp/python.def b/PC/os2vacpp/python.def
index 7d2654632a..a525c2a67b 100644
--- a/PC/os2vacpp/python.def
+++ b/PC/os2vacpp/python.def
@@ -376,7 +376,6 @@ EXPORTS
PyThreadState_GetDict
PyThreadState_New
PyThreadState_Swap
- PyThread__exit_thread
PyThread_acquire_lock
PyThread_allocate_lock
PyThread_allocate_sema
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index 2444c8ab76..cbddbd87c9 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -80,7 +80,7 @@ WIN32 is still required for the locale module.
#define MS_WIN32 /* only support win32 and greater. */
#define MS_WINDOWS
#ifndef PYTHONPATH
-# define PYTHONPATH L".\\DLLs;.\\lib;.\\lib\\plat-win"
+# define PYTHONPATH L".\\DLLs;.\\lib"
#endif
#define NT_THREADS
#define WITH_THREAD
@@ -95,12 +95,6 @@ WIN32 is still required for the locale module.
#endif
#ifdef MS_WINCE
-/* Python uses GetVersion() to distinguish between
- * Windows NT and 9x/ME where OS Unicode support is concerned.
- * Windows CE supports Unicode in the same way as NT so we
- * define the missing GetVersion() accordingly.
- */
-#define GetVersion() (4)
/* Windows CE does not support environment variables */
#define getenv(v) (NULL)
#define environ (NULL)
@@ -324,10 +318,12 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* So MSVC users need not specify the .lib file in
their Makefile (other compilers are generally
taken care of by distutils.) */
-# ifdef _DEBUG
-# pragma comment(lib,"python31_d.lib")
+# if defined(_DEBUG)
+# pragma comment(lib,"python32_d.lib")
+# elif defined(Py_LIMITED_API)
+# pragma comment(lib,"python3.lib")
# else
-# pragma comment(lib,"python31.lib")
+# pragma comment(lib,"python32.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
@@ -727,6 +723,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* Define if the compiler provides a wchar.h header file. */
#define HAVE_WCHAR_H 1
+/* The size of `wchar_t', as computed by sizeof. */
+#define SIZEOF_WCHAR_T 2
+
/* Define if you have the dl library (-ldl). */
/* #undef HAVE_LIBDL */
diff --git a/PC/python3.def b/PC/python3.def
new file mode 100644
index 0000000000..a84533503e
--- /dev/null
+++ b/PC/python3.def
@@ -0,0 +1,689 @@
+LIBRARY "python3"
+EXPORTS
+ PyArg_Parse=python32.PyArg_Parse
+ PyArg_ParseTuple=python32.PyArg_ParseTuple
+ PyArg_ParseTupleAndKeywords=python32.PyArg_ParseTupleAndKeywords
+ PyArg_UnpackTuple=python32.PyArg_UnpackTuple
+ PyArg_VaParse=python32.PyArg_VaParse
+ PyArg_VaParseTupleAndKeywords=python32.PyArg_VaParseTupleAndKeywords
+ PyArg_ValidateKeywordArguments=python32.PyArg_ValidateKeywordArguments
+ PyBaseObject_Type=python32.PyBaseObject_Type DATA
+ PyBool_FromLong=python32.PyBool_FromLong
+ PyBool_Type=python32.PyBool_Type DATA
+ PyByteArrayIter_Type=python32.PyByteArrayIter_Type DATA
+ PyByteArray_AsString=python32.PyByteArray_AsString
+ PyByteArray_Concat=python32.PyByteArray_Concat
+ PyByteArray_FromObject=python32.PyByteArray_FromObject
+ PyByteArray_FromStringAndSize=python32.PyByteArray_FromStringAndSize
+ PyByteArray_Resize=python32.PyByteArray_Resize
+ PyByteArray_Size=python32.PyByteArray_Size
+ PyByteArray_Type=python32.PyByteArray_Type DATA
+ PyBytesIter_Type=python32.PyBytesIter_Type DATA
+ PyBytes_AsString=python32.PyBytes_AsString
+ PyBytes_AsStringAndSize=python32.PyBytes_AsStringAndSize
+ PyBytes_Concat=python32.PyBytes_Concat
+ PyBytes_ConcatAndDel=python32.PyBytes_ConcatAndDel
+ PyBytes_DecodeEscape=python32.PyBytes_DecodeEscape
+ PyBytes_FromFormat=python32.PyBytes_FromFormat
+ PyBytes_FromFormatV=python32.PyBytes_FromFormatV
+ PyBytes_FromObject=python32.PyBytes_FromObject
+ PyBytes_FromString=python32.PyBytes_FromString
+ PyBytes_FromStringAndSize=python32.PyBytes_FromStringAndSize
+ PyBytes_Repr=python32.PyBytes_Repr
+ PyBytes_Size=python32.PyBytes_Size
+ PyBytes_Type=python32.PyBytes_Type DATA
+ PyCFunction_Call=python32.PyCFunction_Call
+ PyCFunction_ClearFreeList=python32.PyCFunction_ClearFreeList
+ PyCFunction_GetFlags=python32.PyCFunction_GetFlags
+ PyCFunction_GetFunction=python32.PyCFunction_GetFunction
+ PyCFunction_GetSelf=python32.PyCFunction_GetSelf
+ PyCFunction_NewEx=python32.PyCFunction_NewEx
+ PyCFunction_Type=python32.PyCFunction_Type DATA
+ PyCallIter_New=python32.PyCallIter_New
+ PyCallIter_Type=python32.PyCallIter_Type DATA
+ PyCallable_Check=python32.PyCallable_Check
+ PyCapsule_GetContext=python32.PyCapsule_GetContext
+ PyCapsule_GetDestructor=python32.PyCapsule_GetDestructor
+ PyCapsule_GetName=python32.PyCapsule_GetName
+ PyCapsule_GetPointer=python32.PyCapsule_GetPointer
+ PyCapsule_Import=python32.PyCapsule_Import
+ PyCapsule_IsValid=python32.PyCapsule_IsValid
+ PyCapsule_New=python32.PyCapsule_New
+ PyCapsule_SetContext=python32.PyCapsule_SetContext
+ PyCapsule_SetDestructor=python32.PyCapsule_SetDestructor
+ PyCapsule_SetName=python32.PyCapsule_SetName
+ PyCapsule_SetPointer=python32.PyCapsule_SetPointer
+ PyCapsule_Type=python32.PyCapsule_Type DATA
+ PyClassMethodDescr_Type=python32.PyClassMethodDescr_Type DATA
+ PyCodec_BackslashReplaceErrors=python32.PyCodec_BackslashReplaceErrors
+ PyCodec_Decode=python32.PyCodec_Decode
+ PyCodec_Decoder=python32.PyCodec_Decoder
+ PyCodec_Encode=python32.PyCodec_Encode
+ PyCodec_Encoder=python32.PyCodec_Encoder
+ PyCodec_IgnoreErrors=python32.PyCodec_IgnoreErrors
+ PyCodec_IncrementalDecoder=python32.PyCodec_IncrementalDecoder
+ PyCodec_IncrementalEncoder=python32.PyCodec_IncrementalEncoder
+ PyCodec_KnownEncoding=python32.PyCodec_KnownEncoding
+ PyCodec_LookupError=python32.PyCodec_LookupError
+ PyCodec_Register=python32.PyCodec_Register
+ PyCodec_RegisterError=python32.PyCodec_RegisterError
+ PyCodec_ReplaceErrors=python32.PyCodec_ReplaceErrors
+ PyCodec_StreamReader=python32.PyCodec_StreamReader
+ PyCodec_StreamWriter=python32.PyCodec_StreamWriter
+ PyCodec_StrictErrors=python32.PyCodec_StrictErrors
+ PyCodec_XMLCharRefReplaceErrors=python32.PyCodec_XMLCharRefReplaceErrors
+ PyComplex_FromDoubles=python32.PyComplex_FromDoubles
+ PyComplex_ImagAsDouble=python32.PyComplex_ImagAsDouble
+ PyComplex_RealAsDouble=python32.PyComplex_RealAsDouble
+ PyComplex_Type=python32.PyComplex_Type DATA
+ PyDescr_NewClassMethod=python32.PyDescr_NewClassMethod
+ PyDescr_NewGetSet=python32.PyDescr_NewGetSet
+ PyDescr_NewMember=python32.PyDescr_NewMember
+ PyDescr_NewMethod=python32.PyDescr_NewMethod
+ PyDictItems_Type=python32.PyDictItems_Type DATA
+ PyDictIterItem_Type=python32.PyDictIterItem_Type DATA
+ PyDictIterKey_Type=python32.PyDictIterKey_Type DATA
+ PyDictIterValue_Type=python32.PyDictIterValue_Type DATA
+ PyDictKeys_Type=python32.PyDictKeys_Type DATA
+ PyDictProxy_New=python32.PyDictProxy_New
+ PyDictProxy_Type=python32.PyDictProxy_Type DATA
+ PyDictValues_Type=python32.PyDictValues_Type DATA
+ PyDict_Clear=python32.PyDict_Clear
+ PyDict_Contains=python32.PyDict_Contains
+ PyDict_Copy=python32.PyDict_Copy
+ PyDict_DelItem=python32.PyDict_DelItem
+ PyDict_DelItemString=python32.PyDict_DelItemString
+ PyDict_GetItem=python32.PyDict_GetItem
+ PyDict_GetItemString=python32.PyDict_GetItemString
+ PyDict_GetItemWithError=python32.PyDict_GetItemWithError
+ PyDict_Items=python32.PyDict_Items
+ PyDict_Keys=python32.PyDict_Keys
+ PyDict_Merge=python32.PyDict_Merge
+ PyDict_MergeFromSeq2=python32.PyDict_MergeFromSeq2
+ PyDict_New=python32.PyDict_New
+ PyDict_Next=python32.PyDict_Next
+ PyDict_SetItem=python32.PyDict_SetItem
+ PyDict_SetItemString=python32.PyDict_SetItemString
+ PyDict_Size=python32.PyDict_Size
+ PyDict_Type=python32.PyDict_Type DATA
+ PyDict_Update=python32.PyDict_Update
+ PyDict_Values=python32.PyDict_Values
+ PyEllipsis_Type=python32.PyEllipsis_Type DATA
+ PyEnum_Type=python32.PyEnum_Type DATA
+ PyErr_BadArgument=python32.PyErr_BadArgument
+ PyErr_BadInternalCall=python32.PyErr_BadInternalCall
+ PyErr_CheckSignals=python32.PyErr_CheckSignals
+ PyErr_Clear=python32.PyErr_Clear
+ PyErr_Display=python32.PyErr_Display
+ PyErr_ExceptionMatches=python32.PyErr_ExceptionMatches
+ PyErr_Fetch=python32.PyErr_Fetch
+ PyErr_Format=python32.PyErr_Format
+ PyErr_GivenExceptionMatches=python32.PyErr_GivenExceptionMatches
+ PyErr_NewException=python32.PyErr_NewException
+ PyErr_NewExceptionWithDoc=python32.PyErr_NewExceptionWithDoc
+ PyErr_NoMemory=python32.PyErr_NoMemory
+ PyErr_NormalizeException=python32.PyErr_NormalizeException
+ PyErr_Occurred=python32.PyErr_Occurred
+ PyErr_Print=python32.PyErr_Print
+ PyErr_PrintEx=python32.PyErr_PrintEx
+ PyErr_ProgramText=python32.PyErr_ProgramText
+ PyErr_Restore=python32.PyErr_Restore
+ PyErr_SetFromErrno=python32.PyErr_SetFromErrno
+ PyErr_SetFromErrnoWithFilename=python32.PyErr_SetFromErrnoWithFilename
+ PyErr_SetFromErrnoWithFilenameObject=python32.PyErr_SetFromErrnoWithFilenameObject
+ PyErr_SetInterrupt=python32.PyErr_SetInterrupt
+ PyErr_SetNone=python32.PyErr_SetNone
+ PyErr_SetObject=python32.PyErr_SetObject
+ PyErr_SetString=python32.PyErr_SetString
+ PyErr_SyntaxLocation=python32.PyErr_SyntaxLocation
+ PyErr_WarnEx=python32.PyErr_WarnEx
+ PyErr_WarnExplicit=python32.PyErr_WarnExplicit
+ PyErr_WarnFormat=python32.PyErr_WarnFormat
+ PyErr_WriteUnraisable=python32.PyErr_WriteUnraisable
+ PyEval_AcquireLock=python32.PyEval_AcquireLock
+ PyEval_AcquireThread=python32.PyEval_AcquireThread
+ PyEval_CallFunction=python32.PyEval_CallFunction
+ PyEval_CallMethod=python32.PyEval_CallMethod
+ PyEval_CallObjectWithKeywords=python32.PyEval_CallObjectWithKeywords
+ PyEval_EvalCode=python32.PyEval_EvalCode
+ PyEval_EvalCodeEx=python32.PyEval_EvalCodeEx
+ PyEval_EvalFrame=python32.PyEval_EvalFrame
+ PyEval_EvalFrameEx=python32.PyEval_EvalFrameEx
+ PyEval_GetBuiltins=python32.PyEval_GetBuiltins
+ PyEval_GetCallStats=python32.PyEval_GetCallStats
+ PyEval_GetFrame=python32.PyEval_GetFrame
+ PyEval_GetFuncDesc=python32.PyEval_GetFuncDesc
+ PyEval_GetFuncName=python32.PyEval_GetFuncName
+ PyEval_GetGlobals=python32.PyEval_GetGlobals
+ PyEval_GetLocals=python32.PyEval_GetLocals
+ PyEval_InitThreads=python32.PyEval_InitThreads
+ PyEval_ReInitThreads=python32.PyEval_ReInitThreads
+ PyEval_ReleaseLock=python32.PyEval_ReleaseLock
+ PyEval_ReleaseThread=python32.PyEval_ReleaseThread
+ PyEval_RestoreThread=python32.PyEval_RestoreThread
+ PyEval_SaveThread=python32.PyEval_SaveThread
+ PyEval_ThreadsInitialized=python32.PyEval_ThreadsInitialized
+ PyExc_ArithmeticError=python32.PyExc_ArithmeticError DATA
+ PyExc_AssertionError=python32.PyExc_AssertionError DATA
+ PyExc_AttributeError=python32.PyExc_AttributeError DATA
+ PyExc_BaseException=python32.PyExc_BaseException DATA
+ PyExc_BufferError=python32.PyExc_BufferError DATA
+ PyExc_BytesWarning=python32.PyExc_BytesWarning DATA
+ PyExc_DeprecationWarning=python32.PyExc_DeprecationWarning DATA
+ PyExc_EOFError=python32.PyExc_EOFError DATA
+ PyExc_EnvironmentError=python32.PyExc_EnvironmentError DATA
+ PyExc_Exception=python32.PyExc_Exception DATA
+ PyExc_FloatingPointError=python32.PyExc_FloatingPointError DATA
+ PyExc_FutureWarning=python32.PyExc_FutureWarning DATA
+ PyExc_GeneratorExit=python32.PyExc_GeneratorExit DATA
+ PyExc_IOError=python32.PyExc_IOError DATA
+ PyExc_ImportError=python32.PyExc_ImportError DATA
+ PyExc_ImportWarning=python32.PyExc_ImportWarning DATA
+ PyExc_IndentationError=python32.PyExc_IndentationError DATA
+ PyExc_IndexError=python32.PyExc_IndexError DATA
+ PyExc_KeyError=python32.PyExc_KeyError DATA
+ PyExc_KeyboardInterrupt=python32.PyExc_KeyboardInterrupt DATA
+ PyExc_LookupError=python32.PyExc_LookupError DATA
+ PyExc_MemoryError=python32.PyExc_MemoryError DATA
+ PyExc_MemoryErrorInst=python32.PyExc_MemoryErrorInst DATA
+ PyExc_NameError=python32.PyExc_NameError DATA
+ PyExc_NotImplementedError=python32.PyExc_NotImplementedError DATA
+ PyExc_OSError=python32.PyExc_OSError DATA
+ PyExc_OverflowError=python32.PyExc_OverflowError DATA
+ PyExc_PendingDeprecationWarning=python32.PyExc_PendingDeprecationWarning DATA
+ PyExc_RecursionErrorInst=python32.PyExc_RecursionErrorInst DATA
+ PyExc_ReferenceError=python32.PyExc_ReferenceError DATA
+ PyExc_RuntimeError=python32.PyExc_RuntimeError DATA
+ PyExc_RuntimeWarning=python32.PyExc_RuntimeWarning DATA
+ PyExc_StopIteration=python32.PyExc_StopIteration DATA
+ PyExc_SyntaxError=python32.PyExc_SyntaxError DATA
+ PyExc_SyntaxWarning=python32.PyExc_SyntaxWarning DATA
+ PyExc_SystemError=python32.PyExc_SystemError DATA
+ PyExc_SystemExit=python32.PyExc_SystemExit DATA
+ PyExc_TabError=python32.PyExc_TabError DATA
+ PyExc_TypeError=python32.PyExc_TypeError DATA
+ PyExc_UnboundLocalError=python32.PyExc_UnboundLocalError DATA
+ PyExc_UnicodeDecodeError=python32.PyExc_UnicodeDecodeError DATA
+ PyExc_UnicodeEncodeError=python32.PyExc_UnicodeEncodeError DATA
+ PyExc_UnicodeError=python32.PyExc_UnicodeError DATA
+ PyExc_UnicodeTranslateError=python32.PyExc_UnicodeTranslateError DATA
+ PyExc_UnicodeWarning=python32.PyExc_UnicodeWarning DATA
+ PyExc_UserWarning=python32.PyExc_UserWarning DATA
+ PyExc_ValueError=python32.PyExc_ValueError DATA
+ PyExc_Warning=python32.PyExc_Warning DATA
+ PyExc_ZeroDivisionError=python32.PyExc_ZeroDivisionError DATA
+ PyException_GetCause=python32.PyException_GetCause
+ PyException_GetContext=python32.PyException_GetContext
+ PyException_GetTraceback=python32.PyException_GetTraceback
+ PyException_SetCause=python32.PyException_SetCause
+ PyException_SetContext=python32.PyException_SetContext
+ PyException_SetTraceback=python32.PyException_SetTraceback
+ PyFile_FromFd=python32.PyFile_FromFd
+ PyFile_GetLine=python32.PyFile_GetLine
+ PyFile_WriteObject=python32.PyFile_WriteObject
+ PyFile_WriteString=python32.PyFile_WriteString
+ PyFilter_Type=python32.PyFilter_Type DATA
+ PyFloat_AsDouble=python32.PyFloat_AsDouble
+ PyFloat_FromDouble=python32.PyFloat_FromDouble
+ PyFloat_FromString=python32.PyFloat_FromString
+ PyFloat_GetInfo=python32.PyFloat_GetInfo
+ PyFloat_GetMax=python32.PyFloat_GetMax
+ PyFloat_GetMin=python32.PyFloat_GetMin
+ PyFloat_Type=python32.PyFloat_Type DATA
+ PyFrozenSet_New=python32.PyFrozenSet_New
+ PyFrozenSet_Type=python32.PyFrozenSet_Type DATA
+ PyGC_Collect=python32.PyGC_Collect
+ PyGILState_Ensure=python32.PyGILState_Ensure
+ PyGILState_GetThisThreadState=python32.PyGILState_GetThisThreadState
+ PyGILState_Release=python32.PyGILState_Release
+ PyGetSetDescr_Type=python32.PyGetSetDescr_Type DATA
+ PyImport_AddModule=python32.PyImport_AddModule
+ PyImport_AppendInittab=python32.PyImport_AppendInittab
+ PyImport_Cleanup=python32.PyImport_Cleanup
+ PyImport_ExecCodeModule=python32.PyImport_ExecCodeModule
+ PyImport_ExecCodeModuleEx=python32.PyImport_ExecCodeModuleEx
+ PyImport_ExecCodeModuleWithPathnames=python32.PyImport_ExecCodeModuleWithPathnames
+ PyImport_GetImporter=python32.PyImport_GetImporter
+ PyImport_GetMagicNumber=python32.PyImport_GetMagicNumber
+ PyImport_GetMagicTag=python32.PyImport_GetMagicTag
+ PyImport_GetModuleDict=python32.PyImport_GetModuleDict
+ PyImport_Import=python32.PyImport_Import
+ PyImport_ImportFrozenModule=python32.PyImport_ImportFrozenModule
+ PyImport_ImportModule=python32.PyImport_ImportModule
+ PyImport_ImportModuleLevel=python32.PyImport_ImportModuleLevel
+ PyImport_ImportModuleNoBlock=python32.PyImport_ImportModuleNoBlock
+ PyImport_ReloadModule=python32.PyImport_ReloadModule
+ PyInterpreterState_Clear=python32.PyInterpreterState_Clear
+ PyInterpreterState_Delete=python32.PyInterpreterState_Delete
+ PyInterpreterState_New=python32.PyInterpreterState_New
+ PyIter_Next=python32.PyIter_Next
+ PyListIter_Type=python32.PyListIter_Type DATA
+ PyListRevIter_Type=python32.PyListRevIter_Type DATA
+ PyList_Append=python32.PyList_Append
+ PyList_AsTuple=python32.PyList_AsTuple
+ PyList_GetItem=python32.PyList_GetItem
+ PyList_GetSlice=python32.PyList_GetSlice
+ PyList_Insert=python32.PyList_Insert
+ PyList_New=python32.PyList_New
+ PyList_Reverse=python32.PyList_Reverse
+ PyList_SetItem=python32.PyList_SetItem
+ PyList_SetSlice=python32.PyList_SetSlice
+ PyList_Size=python32.PyList_Size
+ PyList_Sort=python32.PyList_Sort
+ PyList_Type=python32.PyList_Type DATA
+ PyLongRangeIter_Type=python32.PyLongRangeIter_Type DATA
+ PyLong_AsDouble=python32.PyLong_AsDouble
+ PyLong_AsLong=python32.PyLong_AsLong
+ PyLong_AsLongAndOverflow=python32.PyLong_AsLongAndOverflow
+ PyLong_AsLongLong=python32.PyLong_AsLongLong
+ PyLong_AsLongLongAndOverflow=python32.PyLong_AsLongLongAndOverflow
+ PyLong_AsSize_t=python32.PyLong_AsSize_t
+ PyLong_AsSsize_t=python32.PyLong_AsSsize_t
+ PyLong_AsUnsignedLong=python32.PyLong_AsUnsignedLong
+ PyLong_AsUnsignedLongLong=python32.PyLong_AsUnsignedLongLong
+ PyLong_AsUnsignedLongLongMask=python32.PyLong_AsUnsignedLongLongMask
+ PyLong_AsUnsignedLongMask=python32.PyLong_AsUnsignedLongMask
+ PyLong_AsVoidPtr=python32.PyLong_AsVoidPtr
+ PyLong_FromDouble=python32.PyLong_FromDouble
+ PyLong_FromLong=python32.PyLong_FromLong
+ PyLong_FromLongLong=python32.PyLong_FromLongLong
+ PyLong_FromSize_t=python32.PyLong_FromSize_t
+ PyLong_FromSsize_t=python32.PyLong_FromSsize_t
+ PyLong_FromString=python32.PyLong_FromString
+ PyLong_FromUnsignedLong=python32.PyLong_FromUnsignedLong
+ PyLong_FromUnsignedLongLong=python32.PyLong_FromUnsignedLongLong
+ PyLong_FromVoidPtr=python32.PyLong_FromVoidPtr
+ PyLong_GetInfo=python32.PyLong_GetInfo
+ PyLong_Type=python32.PyLong_Type DATA
+ PyMap_Type=python32.PyMap_Type DATA
+ PyMapping_Check=python32.PyMapping_Check
+ PyMapping_GetItemString=python32.PyMapping_GetItemString
+ PyMapping_HasKey=python32.PyMapping_HasKey
+ PyMapping_HasKeyString=python32.PyMapping_HasKeyString
+ PyMapping_Items=python32.PyMapping_Items
+ PyMapping_Keys=python32.PyMapping_Keys
+ PyMapping_Length=python32.PyMapping_Length
+ PyMapping_SetItemString=python32.PyMapping_SetItemString
+ PyMapping_Size=python32.PyMapping_Size
+ PyMapping_Values=python32.PyMapping_Values
+ PyMem_Free=python32.PyMem_Free
+ PyMem_Malloc=python32.PyMem_Malloc
+ PyMem_Realloc=python32.PyMem_Realloc
+ PyMemberDescr_Type=python32.PyMemberDescr_Type DATA
+ PyMemoryView_FromObject=python32.PyMemoryView_FromObject
+ PyMemoryView_GetContiguous=python32.PyMemoryView_GetContiguous
+ PyMemoryView_Type=python32.PyMemoryView_Type DATA
+ PyMethodDescr_Type=python32.PyMethodDescr_Type DATA
+ PyModule_AddIntConstant=python32.PyModule_AddIntConstant
+ PyModule_AddObject=python32.PyModule_AddObject
+ PyModule_AddStringConstant=python32.PyModule_AddStringConstant
+ PyModule_Create2=python32.PyModule_Create2
+ PyModule_GetDef=python32.PyModule_GetDef
+ PyModule_GetDict=python32.PyModule_GetDict
+ PyModule_GetFilename=python32.PyModule_GetFilename
+ PyModule_GetFilenameObject=python32.PyModule_GetFilenameObject
+ PyModule_GetName=python32.PyModule_GetName
+ PyModule_GetState=python32.PyModule_GetState
+ PyModule_New=python32.PyModule_New
+ PyModule_Type=python32.PyModule_Type DATA
+ PyNullImporter_Type=python32.PyNullImporter_Type DATA
+ PyNumber_Absolute=python32.PyNumber_Absolute
+ PyNumber_Add=python32.PyNumber_Add
+ PyNumber_And=python32.PyNumber_And
+ PyNumber_AsSsize_t=python32.PyNumber_AsSsize_t
+ PyNumber_Check=python32.PyNumber_Check
+ PyNumber_Divmod=python32.PyNumber_Divmod
+ PyNumber_Float=python32.PyNumber_Float
+ PyNumber_FloorDivide=python32.PyNumber_FloorDivide
+ PyNumber_InPlaceAdd=python32.PyNumber_InPlaceAdd
+ PyNumber_InPlaceAnd=python32.PyNumber_InPlaceAnd
+ PyNumber_InPlaceFloorDivide=python32.PyNumber_InPlaceFloorDivide
+ PyNumber_InPlaceLshift=python32.PyNumber_InPlaceLshift
+ PyNumber_InPlaceMultiply=python32.PyNumber_InPlaceMultiply
+ PyNumber_InPlaceOr=python32.PyNumber_InPlaceOr
+ PyNumber_InPlacePower=python32.PyNumber_InPlacePower
+ PyNumber_InPlaceRemainder=python32.PyNumber_InPlaceRemainder
+ PyNumber_InPlaceRshift=python32.PyNumber_InPlaceRshift
+ PyNumber_InPlaceSubtract=python32.PyNumber_InPlaceSubtract
+ PyNumber_InPlaceTrueDivide=python32.PyNumber_InPlaceTrueDivide
+ PyNumber_InPlaceXor=python32.PyNumber_InPlaceXor
+ PyNumber_Index=python32.PyNumber_Index
+ PyNumber_Invert=python32.PyNumber_Invert
+ PyNumber_Long=python32.PyNumber_Long
+ PyNumber_Lshift=python32.PyNumber_Lshift
+ PyNumber_Multiply=python32.PyNumber_Multiply
+ PyNumber_Negative=python32.PyNumber_Negative
+ PyNumber_Or=python32.PyNumber_Or
+ PyNumber_Positive=python32.PyNumber_Positive
+ PyNumber_Power=python32.PyNumber_Power
+ PyNumber_Remainder=python32.PyNumber_Remainder
+ PyNumber_Rshift=python32.PyNumber_Rshift
+ PyNumber_Subtract=python32.PyNumber_Subtract
+ PyNumber_ToBase=python32.PyNumber_ToBase
+ PyNumber_TrueDivide=python32.PyNumber_TrueDivide
+ PyNumber_Xor=python32.PyNumber_Xor
+ PyOS_AfterFork=python32.PyOS_AfterFork
+ PyOS_InitInterrupts=python32.PyOS_InitInterrupts
+ PyOS_InputHook=python32.PyOS_InputHook DATA
+ PyOS_InterruptOccurred=python32.PyOS_InterruptOccurred
+ PyOS_ReadlineFunctionPointer=python32.PyOS_ReadlineFunctionPointer DATA
+ PyOS_double_to_string=python32.PyOS_double_to_string
+ PyOS_getsig=python32.PyOS_getsig
+ PyOS_mystricmp=python32.PyOS_mystricmp
+ PyOS_mystrnicmp=python32.PyOS_mystrnicmp
+ PyOS_setsig=python32.PyOS_setsig
+ PyOS_snprintf=python32.PyOS_snprintf
+ PyOS_string_to_double=python32.PyOS_string_to_double
+ PyOS_strtol=python32.PyOS_strtol
+ PyOS_strtoul=python32.PyOS_strtoul
+ PyOS_vsnprintf=python32.PyOS_vsnprintf
+ PyObject_ASCII=python32.PyObject_ASCII
+ PyObject_AsCharBuffer=python32.PyObject_AsCharBuffer
+ PyObject_AsFileDescriptor=python32.PyObject_AsFileDescriptor
+ PyObject_AsReadBuffer=python32.PyObject_AsReadBuffer
+ PyObject_AsWriteBuffer=python32.PyObject_AsWriteBuffer
+ PyObject_Bytes=python32.PyObject_Bytes
+ PyObject_Call=python32.PyObject_Call
+ PyObject_CallFunction=python32.PyObject_CallFunction
+ PyObject_CallFunctionObjArgs=python32.PyObject_CallFunctionObjArgs
+ PyObject_CallMethod=python32.PyObject_CallMethod
+ PyObject_CallMethodObjArgs=python32.PyObject_CallMethodObjArgs
+ PyObject_CallObject=python32.PyObject_CallObject
+ PyObject_CheckReadBuffer=python32.PyObject_CheckReadBuffer
+ PyObject_ClearWeakRefs=python32.PyObject_ClearWeakRefs
+ PyObject_DelItem=python32.PyObject_DelItem
+ PyObject_DelItemString=python32.PyObject_DelItemString
+ PyObject_Dir=python32.PyObject_Dir
+ PyObject_Format=python32.PyObject_Format
+ PyObject_Free=python32.PyObject_Free
+ PyObject_GC_Del=python32.PyObject_GC_Del
+ PyObject_GC_Track=python32.PyObject_GC_Track
+ PyObject_GC_UnTrack=python32.PyObject_GC_UnTrack
+ PyObject_GenericGetAttr=python32.PyObject_GenericGetAttr
+ PyObject_GenericSetAttr=python32.PyObject_GenericSetAttr
+ PyObject_GetAttr=python32.PyObject_GetAttr
+ PyObject_GetAttrString=python32.PyObject_GetAttrString
+ PyObject_GetItem=python32.PyObject_GetItem
+ PyObject_GetIter=python32.PyObject_GetIter
+ PyObject_HasAttr=python32.PyObject_HasAttr
+ PyObject_HasAttrString=python32.PyObject_HasAttrString
+ PyObject_Hash=python32.PyObject_Hash
+ PyObject_HashNotImplemented=python32.PyObject_HashNotImplemented
+ PyObject_Init=python32.PyObject_Init
+ PyObject_InitVar=python32.PyObject_InitVar
+ PyObject_IsInstance=python32.PyObject_IsInstance
+ PyObject_IsSubclass=python32.PyObject_IsSubclass
+ PyObject_IsTrue=python32.PyObject_IsTrue
+ PyObject_Length=python32.PyObject_Length
+ PyObject_Malloc=python32.PyObject_Malloc
+ PyObject_Not=python32.PyObject_Not
+ PyObject_Realloc=python32.PyObject_Realloc
+ PyObject_Repr=python32.PyObject_Repr
+ PyObject_RichCompare=python32.PyObject_RichCompare
+ PyObject_RichCompareBool=python32.PyObject_RichCompareBool
+ PyObject_SelfIter=python32.PyObject_SelfIter
+ PyObject_SetAttr=python32.PyObject_SetAttr
+ PyObject_SetAttrString=python32.PyObject_SetAttrString
+ PyObject_SetItem=python32.PyObject_SetItem
+ PyObject_Size=python32.PyObject_Size
+ PyObject_Str=python32.PyObject_Str
+ PyObject_Type=python32.PyObject_Type DATA
+ PyParser_SimpleParseFileFlags=python32.PyParser_SimpleParseFileFlags
+ PyParser_SimpleParseStringFlags=python32.PyParser_SimpleParseStringFlags
+ PyProperty_Type=python32.PyProperty_Type DATA
+ PyRangeIter_Type=python32.PyRangeIter_Type DATA
+ PyRange_Type=python32.PyRange_Type DATA
+ PyReversed_Type=python32.PyReversed_Type DATA
+ PySeqIter_New=python32.PySeqIter_New
+ PySeqIter_Type=python32.PySeqIter_Type DATA
+ PySequence_Check=python32.PySequence_Check
+ PySequence_Concat=python32.PySequence_Concat
+ PySequence_Contains=python32.PySequence_Contains
+ PySequence_Count=python32.PySequence_Count
+ PySequence_DelItem=python32.PySequence_DelItem
+ PySequence_DelSlice=python32.PySequence_DelSlice
+ PySequence_Fast=python32.PySequence_Fast
+ PySequence_GetItem=python32.PySequence_GetItem
+ PySequence_GetSlice=python32.PySequence_GetSlice
+ PySequence_In=python32.PySequence_In
+ PySequence_InPlaceConcat=python32.PySequence_InPlaceConcat
+ PySequence_InPlaceRepeat=python32.PySequence_InPlaceRepeat
+ PySequence_Index=python32.PySequence_Index
+ PySequence_Length=python32.PySequence_Length
+ PySequence_List=python32.PySequence_List
+ PySequence_Repeat=python32.PySequence_Repeat
+ PySequence_SetItem=python32.PySequence_SetItem
+ PySequence_SetSlice=python32.PySequence_SetSlice
+ PySequence_Size=python32.PySequence_Size
+ PySequence_Tuple=python32.PySequence_Tuple
+ PySetIter_Type=python32.PySetIter_Type DATA
+ PySet_Add=python32.PySet_Add
+ PySet_Clear=python32.PySet_Clear
+ PySet_Contains=python32.PySet_Contains
+ PySet_Discard=python32.PySet_Discard
+ PySet_New=python32.PySet_New
+ PySet_Pop=python32.PySet_Pop
+ PySet_Size=python32.PySet_Size
+ PySet_Type=python32.PySet_Type DATA
+ PySlice_GetIndices=python32.PySlice_GetIndices
+ PySlice_GetIndicesEx=python32.PySlice_GetIndicesEx
+ PySlice_New=python32.PySlice_New
+ PySlice_Type=python32.PySlice_Type DATA
+ PySortWrapper_Type=python32.PySortWrapper_Type DATA
+ PyState_FindModule=python32.PyState_FindModule
+ PyStructSequence_GetItem=python32.PyStructSequence_GetItem
+ PyStructSequence_New=python32.PyStructSequence_New
+ PyStructSequence_NewType=python32.PyStructSequence_NewType
+ PyStructSequence_SetItem=python32.PyStructSequence_SetItem
+ PySuper_Type=python32.PySuper_Type DATA
+ PySys_AddWarnOption=python32.PySys_AddWarnOption
+ PySys_AddWarnOptionUnicode=python32.PySys_AddWarnOptionUnicode
+ PySys_FormatStderr=python32.PySys_FormatStderr
+ PySys_FormatStdout=python32.PySys_FormatStdout
+ PySys_GetObject=python32.PySys_GetObject
+ PySys_HasWarnOptions=python32.PySys_HasWarnOptions
+ PySys_ResetWarnOptions=python32.PySys_ResetWarnOptions
+ PySys_SetArgv=python32.PySys_SetArgv
+ PySys_SetArgvEx=python32.PySys_SetArgvEx
+ PySys_SetObject=python32.PySys_SetObject
+ PySys_SetPath=python32.PySys_SetPath
+ PySys_WriteStderr=python32.PySys_WriteStderr
+ PySys_WriteStdout=python32.PySys_WriteStdout
+ PyThreadState_Clear=python32.PyThreadState_Clear
+ PyThreadState_Delete=python32.PyThreadState_Delete
+ PyThreadState_DeleteCurrent=python32.PyThreadState_DeleteCurrent
+ PyThreadState_Get=python32.PyThreadState_Get
+ PyThreadState_GetDict=python32.PyThreadState_GetDict
+ PyThreadState_New=python32.PyThreadState_New
+ PyThreadState_SetAsyncExc=python32.PyThreadState_SetAsyncExc
+ PyThreadState_Swap=python32.PyThreadState_Swap
+ PyTraceBack_Here=python32.PyTraceBack_Here
+ PyTraceBack_Print=python32.PyTraceBack_Print
+ PyTraceBack_Type=python32.PyTraceBack_Type DATA
+ PyTupleIter_Type=python32.PyTupleIter_Type DATA
+ PyTuple_ClearFreeList=python32.PyTuple_ClearFreeList
+ PyTuple_GetItem=python32.PyTuple_GetItem
+ PyTuple_GetSlice=python32.PyTuple_GetSlice
+ PyTuple_New=python32.PyTuple_New
+ PyTuple_Pack=python32.PyTuple_Pack
+ PyTuple_SetItem=python32.PyTuple_SetItem
+ PyTuple_Size=python32.PyTuple_Size
+ PyTuple_Type=python32.PyTuple_Type DATA
+ PyType_ClearCache=python32.PyType_ClearCache
+ PyType_FromSpec=python32.PyType_FromSpec
+ PyType_GenericAlloc=python32.PyType_GenericAlloc
+ PyType_GenericNew=python32.PyType_GenericNew
+ PyType_GetFlags=python32.PyType_GetFlags
+ PyType_IsSubtype=python32.PyType_IsSubtype
+ PyType_Modified=python32.PyType_Modified
+ PyType_Ready=python32.PyType_Ready
+ PyType_Type=python32.PyType_Type DATA
+ PyUnicodeDecodeError_Create=python32.PyUnicodeDecodeError_Create
+ PyUnicodeDecodeError_GetEncoding=python32.PyUnicodeDecodeError_GetEncoding
+ PyUnicodeDecodeError_GetEnd=python32.PyUnicodeDecodeError_GetEnd
+ PyUnicodeDecodeError_GetObject=python32.PyUnicodeDecodeError_GetObject
+ PyUnicodeDecodeError_GetReason=python32.PyUnicodeDecodeError_GetReason
+ PyUnicodeDecodeError_GetStart=python32.PyUnicodeDecodeError_GetStart
+ PyUnicodeDecodeError_SetEnd=python32.PyUnicodeDecodeError_SetEnd
+ PyUnicodeDecodeError_SetReason=python32.PyUnicodeDecodeError_SetReason
+ PyUnicodeDecodeError_SetStart=python32.PyUnicodeDecodeError_SetStart
+ PyUnicodeEncodeError_GetEncoding=python32.PyUnicodeEncodeError_GetEncoding
+ PyUnicodeEncodeError_GetEnd=python32.PyUnicodeEncodeError_GetEnd
+ PyUnicodeEncodeError_GetObject=python32.PyUnicodeEncodeError_GetObject
+ PyUnicodeEncodeError_GetReason=python32.PyUnicodeEncodeError_GetReason
+ PyUnicodeEncodeError_GetStart=python32.PyUnicodeEncodeError_GetStart
+ PyUnicodeEncodeError_SetEnd=python32.PyUnicodeEncodeError_SetEnd
+ PyUnicodeEncodeError_SetReason=python32.PyUnicodeEncodeError_SetReason
+ PyUnicodeEncodeError_SetStart=python32.PyUnicodeEncodeError_SetStart
+ PyUnicodeIter_Type=python32.PyUnicodeIter_Type DATA
+ PyUnicodeTranslateError_GetEnd=python32.PyUnicodeTranslateError_GetEnd
+ PyUnicodeTranslateError_GetObject=python32.PyUnicodeTranslateError_GetObject
+ PyUnicodeTranslateError_GetReason=python32.PyUnicodeTranslateError_GetReason
+ PyUnicodeTranslateError_GetStart=python32.PyUnicodeTranslateError_GetStart
+ PyUnicodeTranslateError_SetEnd=python32.PyUnicodeTranslateError_SetEnd
+ PyUnicodeTranslateError_SetReason=python32.PyUnicodeTranslateError_SetReason
+ PyUnicodeTranslateError_SetStart=python32.PyUnicodeTranslateError_SetStart
+ PyUnicode_Append=python32.PyUnicodeUCS2_Append
+ PyUnicode_AppendAndDel=python32.PyUnicodeUCS2_AppendAndDel
+ PyUnicode_AsASCIIString=python32.PyUnicodeUCS2_AsASCIIString
+ PyUnicode_AsCharmapString=python32.PyUnicodeUCS2_AsCharmapString
+ PyUnicode_AsDecodedObject=python32.PyUnicodeUCS2_AsDecodedObject
+ PyUnicode_AsDecodedUnicode=python32.PyUnicodeUCS2_AsDecodedUnicode
+ PyUnicode_AsEncodedObject=python32.PyUnicodeUCS2_AsEncodedObject
+ PyUnicode_AsEncodedString=python32.PyUnicodeUCS2_AsEncodedString
+ PyUnicode_AsEncodedUnicode=python32.PyUnicodeUCS2_AsEncodedUnicode
+ PyUnicode_AsLatin1String=python32.PyUnicodeUCS2_AsLatin1String
+ PyUnicode_AsRawUnicodeEscapeString=python32.PyUnicodeUCS2_AsRawUnicodeEscapeString
+ PyUnicode_AsUTF16String=python32.PyUnicodeUCS2_AsUTF16String
+ PyUnicode_AsUTF32String=python32.PyUnicodeUCS2_AsUTF32String
+ PyUnicode_AsUTF8String=python32.PyUnicodeUCS2_AsUTF8String
+ PyUnicode_AsUnicodeEscapeString=python32.PyUnicodeUCS2_AsUnicodeEscapeString
+ PyUnicode_AsWideChar=python32.PyUnicodeUCS2_AsWideChar
+ PyUnicode_ClearFreelist=python32.PyUnicodeUCS2_ClearFreelist
+ PyUnicode_Compare=python32.PyUnicodeUCS2_Compare
+ PyUnicode_Concat=python32.PyUnicodeUCS2_Concat
+ PyUnicode_Contains=python32.PyUnicodeUCS2_Contains
+ PyUnicode_Count=python32.PyUnicodeUCS2_Count
+ PyUnicode_Decode=python32.PyUnicodeUCS2_Decode
+ PyUnicode_DecodeASCII=python32.PyUnicodeUCS2_DecodeASCII
+ PyUnicode_DecodeCharmap=python32.PyUnicodeUCS2_DecodeCharmap
+ PyUnicode_DecodeFSDefault=python32.PyUnicodeUCS2_DecodeFSDefault
+ PyUnicode_DecodeFSDefaultAndSize=python32.PyUnicodeUCS2_DecodeFSDefaultAndSize
+ PyUnicode_DecodeLatin1=python32.PyUnicodeUCS2_DecodeLatin1
+ PyUnicode_DecodeRawUnicodeEscape=python32.PyUnicodeUCS2_DecodeRawUnicodeEscape
+ PyUnicode_DecodeUTF16=python32.PyUnicodeUCS2_DecodeUTF16
+ PyUnicode_DecodeUTF16Stateful=python32.PyUnicodeUCS2_DecodeUTF16Stateful
+ PyUnicode_DecodeUTF32=python32.PyUnicodeUCS2_DecodeUTF32
+ PyUnicode_DecodeUTF32Stateful=python32.PyUnicodeUCS2_DecodeUTF32Stateful
+ PyUnicode_DecodeUTF8=python32.PyUnicodeUCS2_DecodeUTF8
+ PyUnicode_DecodeUTF8Stateful=python32.PyUnicodeUCS2_DecodeUTF8Stateful
+ PyUnicode_DecodeUnicodeEscape=python32.PyUnicodeUCS2_DecodeUnicodeEscape
+ PyUnicode_FSConverter=python32.PyUnicodeUCS2_FSConverter
+ PyUnicode_FSDecoder=python32.PyUnicodeUCS2_FSDecoder
+ PyUnicode_Find=python32.PyUnicodeUCS2_Find
+ PyUnicode_Format=python32.PyUnicodeUCS2_Format
+ PyUnicode_FromEncodedObject=python32.PyUnicodeUCS2_FromEncodedObject
+ PyUnicode_FromFormat=python32.PyUnicodeUCS2_FromFormat
+ PyUnicode_FromFormatV=python32.PyUnicodeUCS2_FromFormatV
+ PyUnicode_FromObject=python32.PyUnicodeUCS2_FromObject
+ PyUnicode_FromOrdinal=python32.PyUnicodeUCS2_FromOrdinal
+ PyUnicode_FromString=python32.PyUnicodeUCS2_FromString
+ PyUnicode_FromStringAndSize=python32.PyUnicodeUCS2_FromStringAndSize
+ PyUnicode_FromWideChar=python32.PyUnicodeUCS2_FromWideChar
+ PyUnicode_GetDefaultEncoding=python32.PyUnicodeUCS2_GetDefaultEncoding
+ PyUnicode_GetSize=python32.PyUnicodeUCS2_GetSize
+ PyUnicode_IsIdentifier=python32.PyUnicodeUCS2_IsIdentifier
+ PyUnicode_Join=python32.PyUnicodeUCS2_Join
+ PyUnicode_Partition=python32.PyUnicodeUCS2_Partition
+ PyUnicode_RPartition=python32.PyUnicodeUCS2_RPartition
+ PyUnicode_RSplit=python32.PyUnicodeUCS2_RSplit
+ PyUnicode_Replace=python32.PyUnicodeUCS2_Replace
+ PyUnicode_Resize=python32.PyUnicodeUCS2_Resize
+ PyUnicode_RichCompare=python32.PyUnicodeUCS2_RichCompare
+ PyUnicode_SetDefaultEncoding=python32.PyUnicodeUCS2_SetDefaultEncoding
+ PyUnicode_Split=python32.PyUnicodeUCS2_Split
+ PyUnicode_Splitlines=python32.PyUnicodeUCS2_Splitlines
+ PyUnicode_Tailmatch=python32.PyUnicodeUCS2_Tailmatch
+ PyUnicode_Translate=python32.PyUnicodeUCS2_Translate
+ PyUnicode_BuildEncodingMap=python32.PyUnicode_BuildEncodingMap
+ PyUnicode_CompareWithASCIIString=python32.PyUnicode_CompareWithASCIIString
+ PyUnicode_DecodeUTF7=python32.PyUnicode_DecodeUTF7
+ PyUnicode_DecodeUTF7Stateful=python32.PyUnicode_DecodeUTF7Stateful
+ PyUnicode_EncodeFSDefault=python32.PyUnicode_EncodeFSDefault
+ PyUnicode_InternFromString=python32.PyUnicode_InternFromString
+ PyUnicode_InternImmortal=python32.PyUnicode_InternImmortal
+ PyUnicode_InternInPlace=python32.PyUnicode_InternInPlace
+ PyUnicode_Type=python32.PyUnicode_Type DATA
+ PyWeakref_GetObject=python32.PyWeakref_GetObject DATA
+ PyWeakref_NewProxy=python32.PyWeakref_NewProxy
+ PyWeakref_NewRef=python32.PyWeakref_NewRef
+ PyWrapperDescr_Type=python32.PyWrapperDescr_Type DATA
+ PyWrapper_New=python32.PyWrapper_New
+ PyZip_Type=python32.PyZip_Type DATA
+ Py_AddPendingCall=python32.Py_AddPendingCall
+ Py_AtExit=python32.Py_AtExit
+ Py_BuildValue=python32.Py_BuildValue
+ Py_CompileString=python32.Py_CompileString
+ Py_DecRef=python32.Py_DecRef
+ Py_EndInterpreter=python32.Py_EndInterpreter
+ Py_Exit=python32.Py_Exit
+ Py_FatalError=python32.Py_FatalError
+ Py_FileSystemDefaultEncoding=python32.Py_FileSystemDefaultEncoding DATA
+ Py_Finalize=python32.Py_Finalize
+ Py_GetBuildInfo=python32.Py_GetBuildInfo
+ Py_GetCompiler=python32.Py_GetCompiler
+ Py_GetCopyright=python32.Py_GetCopyright
+ Py_GetExecPrefix=python32.Py_GetExecPrefix
+ Py_GetPath=python32.Py_GetPath
+ Py_GetPlatform=python32.Py_GetPlatform
+ Py_GetPrefix=python32.Py_GetPrefix
+ Py_GetProgramFullPath=python32.Py_GetProgramFullPath
+ Py_GetProgramName=python32.Py_GetProgramName
+ Py_GetPythonHome=python32.Py_GetPythonHome
+ Py_GetRecursionLimit=python32.Py_GetRecursionLimit
+ Py_GetVersion=python32.Py_GetVersion
+ Py_HasFileSystemDefaultEncoding=python32.Py_HasFileSystemDefaultEncoding DATA
+ Py_IncRef=python32.Py_IncRef
+ Py_Initialize=python32.Py_Initialize
+ Py_InitializeEx=python32.Py_InitializeEx
+ Py_IsInitialized=python32.Py_IsInitialized
+ Py_Main=python32.Py_Main
+ Py_MakePendingCalls=python32.Py_MakePendingCalls
+ Py_NewInterpreter=python32.Py_NewInterpreter
+ Py_ReprEnter=python32.Py_ReprEnter
+ Py_ReprLeave=python32.Py_ReprLeave
+ Py_SetProgramName=python32.Py_SetProgramName
+ Py_SetPythonHome=python32.Py_SetPythonHome
+ Py_SetRecursionLimit=python32.Py_SetRecursionLimit
+ Py_SymtableString=python32.Py_SymtableString
+ Py_VaBuildValue=python32.Py_VaBuildValue
+ _PyErr_BadInternalCall=python32._PyErr_BadInternalCall
+ _PyObject_CallFunction_SizeT=python32._PyObject_CallFunction_SizeT
+ _PyObject_CallMethod_SizeT=python32._PyObject_CallMethod_SizeT
+ _PyObject_GC_Malloc=python32._PyObject_GC_Malloc
+ _PyObject_GC_New=python32._PyObject_GC_New
+ _PyObject_GC_NewVar=python32._PyObject_GC_NewVar
+ _PyObject_GC_Resize=python32._PyObject_GC_Resize
+ _PyObject_New=python32._PyObject_New
+ _PyObject_NewVar=python32._PyObject_NewVar
+ _PyState_AddModule=python32._PyState_AddModule
+ _PyThreadState_Init=python32._PyThreadState_Init
+ _PyThreadState_Prealloc=python32._PyThreadState_Prealloc
+ _PyTrash_delete_later=python32._PyTrash_delete_later DATA
+ _PyTrash_delete_nesting=python32._PyTrash_delete_nesting DATA
+ _PyTrash_deposit_object=python32._PyTrash_deposit_object
+ _PyTrash_destroy_chain=python32._PyTrash_destroy_chain
+ _PyWeakref_CallableProxyType=python32._PyWeakref_CallableProxyType DATA
+ _PyWeakref_ProxyType=python32._PyWeakref_ProxyType DATA
+ _PyWeakref_RefType=python32._PyWeakref_RefType DATA
+ _Py_BuildValue_SizeT=python32._Py_BuildValue_SizeT
+ _Py_CheckRecursionLimit=python32._Py_CheckRecursionLimit DATA
+ _Py_CheckRecursiveCall=python32._Py_CheckRecursiveCall
+ _Py_Dealloc=python32._Py_Dealloc
+ _Py_EllipsisObject=python32._Py_EllipsisObject DATA
+ _Py_FalseStruct=python32._Py_FalseStruct DATA
+ _Py_NoneStruct=python32._Py_NoneStruct DATA
+ _Py_NotImplementedStruct=python32._Py_NotImplementedStruct DATA
+ _Py_SwappedOp=python32._Py_SwappedOp DATA
+ _Py_TrueStruct=python32._Py_TrueStruct DATA
+ _Py_VaBuildValue_SizeT=python32._Py_VaBuildValue_SizeT
diff --git a/PC/python3.mak b/PC/python3.mak
new file mode 100644
index 0000000000..256167f6ce
--- /dev/null
+++ b/PC/python3.mak
@@ -0,0 +1,10 @@
+$(OutDir)python32.dll: python3.def $(OutDir)python32stub.lib
+ cl /LD /Fe$(OutDir)python3.dll python3dll.c python3.def $(OutDir)python32stub.lib
+
+$(OutDir)python32stub.lib: python32stub.def
+ lib /def:python32stub.def /out:$(OutDir)python32stub.lib /MACHINE:$(MACHINE)
+
+clean:
+ del $(OutDir)python3.dll $(OutDir)python3.lib $(OutDir)python32stub.lib $(OutDir)python3.exp $(OutDir)python32stub.exp
+
+rebuild: clean $(OutDir)python32.dll
diff --git a/PC/python32gen.py b/PC/python32gen.py
new file mode 100644
index 0000000000..9182d54e64
--- /dev/null
+++ b/PC/python32gen.py
@@ -0,0 +1,25 @@
+# Generate python32stub.def out of python3.def
+# The regular import library cannot be used,
+# since it doesn't provide the right symbols for
+# data forwarding
+out = open("python32stub.def", "w")
+out.write('LIBRARY "python32"\n')
+out.write('EXPORTS\n')
+
+inp = open("python3.def")
+inp.readline()
+line = inp.readline()
+assert line.strip()=='EXPORTS'
+
+for line in inp:
+ # SYM1=python32.SYM2[ DATA]
+ head, tail = line.split('.')
+ if 'DATA' in tail:
+ symbol, tail = tail.split(' ')
+ else:
+ symbol = tail.strip()
+ out.write(symbol+'\n')
+
+inp.close()
+out.close()
+
diff --git a/PC/python32stub.def b/PC/python32stub.def
new file mode 100644
index 0000000000..0943ef092c
--- /dev/null
+++ b/PC/python32stub.def
@@ -0,0 +1,689 @@
+LIBRARY "python32"
+EXPORTS
+PyArg_Parse
+PyArg_ParseTuple
+PyArg_ParseTupleAndKeywords
+PyArg_UnpackTuple
+PyArg_VaParse
+PyArg_VaParseTupleAndKeywords
+PyArg_ValidateKeywordArguments
+PyBaseObject_Type
+PyBool_FromLong
+PyBool_Type
+PyByteArrayIter_Type
+PyByteArray_AsString
+PyByteArray_Concat
+PyByteArray_FromObject
+PyByteArray_FromStringAndSize
+PyByteArray_Resize
+PyByteArray_Size
+PyByteArray_Type
+PyBytesIter_Type
+PyBytes_AsString
+PyBytes_AsStringAndSize
+PyBytes_Concat
+PyBytes_ConcatAndDel
+PyBytes_DecodeEscape
+PyBytes_FromFormat
+PyBytes_FromFormatV
+PyBytes_FromObject
+PyBytes_FromString
+PyBytes_FromStringAndSize
+PyBytes_Repr
+PyBytes_Size
+PyBytes_Type
+PyCFunction_Call
+PyCFunction_ClearFreeList
+PyCFunction_GetFlags
+PyCFunction_GetFunction
+PyCFunction_GetSelf
+PyCFunction_NewEx
+PyCFunction_Type
+PyCallIter_New
+PyCallIter_Type
+PyCallable_Check
+PyCapsule_GetContext
+PyCapsule_GetDestructor
+PyCapsule_GetName
+PyCapsule_GetPointer
+PyCapsule_Import
+PyCapsule_IsValid
+PyCapsule_New
+PyCapsule_SetContext
+PyCapsule_SetDestructor
+PyCapsule_SetName
+PyCapsule_SetPointer
+PyCapsule_Type
+PyClassMethodDescr_Type
+PyCodec_BackslashReplaceErrors
+PyCodec_Decode
+PyCodec_Decoder
+PyCodec_Encode
+PyCodec_Encoder
+PyCodec_IgnoreErrors
+PyCodec_IncrementalDecoder
+PyCodec_IncrementalEncoder
+PyCodec_KnownEncoding
+PyCodec_LookupError
+PyCodec_Register
+PyCodec_RegisterError
+PyCodec_ReplaceErrors
+PyCodec_StreamReader
+PyCodec_StreamWriter
+PyCodec_StrictErrors
+PyCodec_XMLCharRefReplaceErrors
+PyComplex_FromDoubles
+PyComplex_ImagAsDouble
+PyComplex_RealAsDouble
+PyComplex_Type
+PyDescr_NewClassMethod
+PyDescr_NewGetSet
+PyDescr_NewMember
+PyDescr_NewMethod
+PyDictItems_Type
+PyDictIterItem_Type
+PyDictIterKey_Type
+PyDictIterValue_Type
+PyDictKeys_Type
+PyDictProxy_New
+PyDictProxy_Type
+PyDictValues_Type
+PyDict_Clear
+PyDict_Contains
+PyDict_Copy
+PyDict_DelItem
+PyDict_DelItemString
+PyDict_GetItem
+PyDict_GetItemString
+PyDict_GetItemWithError
+PyDict_Items
+PyDict_Keys
+PyDict_Merge
+PyDict_MergeFromSeq2
+PyDict_New
+PyDict_Next
+PyDict_SetItem
+PyDict_SetItemString
+PyDict_Size
+PyDict_Type
+PyDict_Update
+PyDict_Values
+PyEllipsis_Type
+PyEnum_Type
+PyErr_BadArgument
+PyErr_BadInternalCall
+PyErr_CheckSignals
+PyErr_Clear
+PyErr_Display
+PyErr_ExceptionMatches
+PyErr_Fetch
+PyErr_Format
+PyErr_GivenExceptionMatches
+PyErr_NewException
+PyErr_NewExceptionWithDoc
+PyErr_NoMemory
+PyErr_NormalizeException
+PyErr_Occurred
+PyErr_Print
+PyErr_PrintEx
+PyErr_ProgramText
+PyErr_Restore
+PyErr_SetFromErrno
+PyErr_SetFromErrnoWithFilename
+PyErr_SetFromErrnoWithFilenameObject
+PyErr_SetInterrupt
+PyErr_SetNone
+PyErr_SetObject
+PyErr_SetString
+PyErr_SyntaxLocation
+PyErr_WarnEx
+PyErr_WarnExplicit
+PyErr_WarnFormat
+PyErr_WriteUnraisable
+PyEval_AcquireLock
+PyEval_AcquireThread
+PyEval_CallFunction
+PyEval_CallMethod
+PyEval_CallObjectWithKeywords
+PyEval_EvalCode
+PyEval_EvalCodeEx
+PyEval_EvalFrame
+PyEval_EvalFrameEx
+PyEval_GetBuiltins
+PyEval_GetCallStats
+PyEval_GetFrame
+PyEval_GetFuncDesc
+PyEval_GetFuncName
+PyEval_GetGlobals
+PyEval_GetLocals
+PyEval_InitThreads
+PyEval_ReInitThreads
+PyEval_ReleaseLock
+PyEval_ReleaseThread
+PyEval_RestoreThread
+PyEval_SaveThread
+PyEval_ThreadsInitialized
+PyExc_ArithmeticError
+PyExc_AssertionError
+PyExc_AttributeError
+PyExc_BaseException
+PyExc_BufferError
+PyExc_BytesWarning
+PyExc_DeprecationWarning
+PyExc_EOFError
+PyExc_EnvironmentError
+PyExc_Exception
+PyExc_FloatingPointError
+PyExc_FutureWarning
+PyExc_GeneratorExit
+PyExc_IOError
+PyExc_ImportError
+PyExc_ImportWarning
+PyExc_IndentationError
+PyExc_IndexError
+PyExc_KeyError
+PyExc_KeyboardInterrupt
+PyExc_LookupError
+PyExc_MemoryError
+PyExc_MemoryErrorInst
+PyExc_NameError
+PyExc_NotImplementedError
+PyExc_OSError
+PyExc_OverflowError
+PyExc_PendingDeprecationWarning
+PyExc_RecursionErrorInst
+PyExc_ReferenceError
+PyExc_RuntimeError
+PyExc_RuntimeWarning
+PyExc_StopIteration
+PyExc_SyntaxError
+PyExc_SyntaxWarning
+PyExc_SystemError
+PyExc_SystemExit
+PyExc_TabError
+PyExc_TypeError
+PyExc_UnboundLocalError
+PyExc_UnicodeDecodeError
+PyExc_UnicodeEncodeError
+PyExc_UnicodeError
+PyExc_UnicodeTranslateError
+PyExc_UnicodeWarning
+PyExc_UserWarning
+PyExc_ValueError
+PyExc_Warning
+PyExc_ZeroDivisionError
+PyException_GetCause
+PyException_GetContext
+PyException_GetTraceback
+PyException_SetCause
+PyException_SetContext
+PyException_SetTraceback
+PyFile_FromFd
+PyFile_GetLine
+PyFile_WriteObject
+PyFile_WriteString
+PyFilter_Type
+PyFloat_AsDouble
+PyFloat_FromDouble
+PyFloat_FromString
+PyFloat_GetInfo
+PyFloat_GetMax
+PyFloat_GetMin
+PyFloat_Type
+PyFrozenSet_New
+PyFrozenSet_Type
+PyGC_Collect
+PyGILState_Ensure
+PyGILState_GetThisThreadState
+PyGILState_Release
+PyGetSetDescr_Type
+PyImport_AddModule
+PyImport_AppendInittab
+PyImport_Cleanup
+PyImport_ExecCodeModule
+PyImport_ExecCodeModuleEx
+PyImport_ExecCodeModuleWithPathnames
+PyImport_GetImporter
+PyImport_GetMagicNumber
+PyImport_GetMagicTag
+PyImport_GetModuleDict
+PyImport_Import
+PyImport_ImportFrozenModule
+PyImport_ImportModule
+PyImport_ImportModuleLevel
+PyImport_ImportModuleNoBlock
+PyImport_ReloadModule
+PyInterpreterState_Clear
+PyInterpreterState_Delete
+PyInterpreterState_New
+PyIter_Next
+PyListIter_Type
+PyListRevIter_Type
+PyList_Append
+PyList_AsTuple
+PyList_GetItem
+PyList_GetSlice
+PyList_Insert
+PyList_New
+PyList_Reverse
+PyList_SetItem
+PyList_SetSlice
+PyList_Size
+PyList_Sort
+PyList_Type
+PyLongRangeIter_Type
+PyLong_AsDouble
+PyLong_AsLong
+PyLong_AsLongAndOverflow
+PyLong_AsLongLong
+PyLong_AsLongLongAndOverflow
+PyLong_AsSize_t
+PyLong_AsSsize_t
+PyLong_AsUnsignedLong
+PyLong_AsUnsignedLongLong
+PyLong_AsUnsignedLongLongMask
+PyLong_AsUnsignedLongMask
+PyLong_AsVoidPtr
+PyLong_FromDouble
+PyLong_FromLong
+PyLong_FromLongLong
+PyLong_FromSize_t
+PyLong_FromSsize_t
+PyLong_FromString
+PyLong_FromUnsignedLong
+PyLong_FromUnsignedLongLong
+PyLong_FromVoidPtr
+PyLong_GetInfo
+PyLong_Type
+PyMap_Type
+PyMapping_Check
+PyMapping_GetItemString
+PyMapping_HasKey
+PyMapping_HasKeyString
+PyMapping_Items
+PyMapping_Keys
+PyMapping_Length
+PyMapping_SetItemString
+PyMapping_Size
+PyMapping_Values
+PyMem_Free
+PyMem_Malloc
+PyMem_Realloc
+PyMemberDescr_Type
+PyMemoryView_FromObject
+PyMemoryView_GetContiguous
+PyMemoryView_Type
+PyMethodDescr_Type
+PyModule_AddIntConstant
+PyModule_AddObject
+PyModule_AddStringConstant
+PyModule_Create2
+PyModule_GetDef
+PyModule_GetDict
+PyModule_GetFilename
+PyModule_GetFilenameObject
+PyModule_GetName
+PyModule_GetState
+PyModule_New
+PyModule_Type
+PyNullImporter_Type
+PyNumber_Absolute
+PyNumber_Add
+PyNumber_And
+PyNumber_AsSsize_t
+PyNumber_Check
+PyNumber_Divmod
+PyNumber_Float
+PyNumber_FloorDivide
+PyNumber_InPlaceAdd
+PyNumber_InPlaceAnd
+PyNumber_InPlaceFloorDivide
+PyNumber_InPlaceLshift
+PyNumber_InPlaceMultiply
+PyNumber_InPlaceOr
+PyNumber_InPlacePower
+PyNumber_InPlaceRemainder
+PyNumber_InPlaceRshift
+PyNumber_InPlaceSubtract
+PyNumber_InPlaceTrueDivide
+PyNumber_InPlaceXor
+PyNumber_Index
+PyNumber_Invert
+PyNumber_Long
+PyNumber_Lshift
+PyNumber_Multiply
+PyNumber_Negative
+PyNumber_Or
+PyNumber_Positive
+PyNumber_Power
+PyNumber_Remainder
+PyNumber_Rshift
+PyNumber_Subtract
+PyNumber_ToBase
+PyNumber_TrueDivide
+PyNumber_Xor
+PyOS_AfterFork
+PyOS_InitInterrupts
+PyOS_InputHook
+PyOS_InterruptOccurred
+PyOS_ReadlineFunctionPointer
+PyOS_double_to_string
+PyOS_getsig
+PyOS_mystricmp
+PyOS_mystrnicmp
+PyOS_setsig
+PyOS_snprintf
+PyOS_string_to_double
+PyOS_strtol
+PyOS_strtoul
+PyOS_vsnprintf
+PyObject_ASCII
+PyObject_AsCharBuffer
+PyObject_AsFileDescriptor
+PyObject_AsReadBuffer
+PyObject_AsWriteBuffer
+PyObject_Bytes
+PyObject_Call
+PyObject_CallFunction
+PyObject_CallFunctionObjArgs
+PyObject_CallMethod
+PyObject_CallMethodObjArgs
+PyObject_CallObject
+PyObject_CheckReadBuffer
+PyObject_ClearWeakRefs
+PyObject_DelItem
+PyObject_DelItemString
+PyObject_Dir
+PyObject_Format
+PyObject_Free
+PyObject_GC_Del
+PyObject_GC_Track
+PyObject_GC_UnTrack
+PyObject_GenericGetAttr
+PyObject_GenericSetAttr
+PyObject_GetAttr
+PyObject_GetAttrString
+PyObject_GetItem
+PyObject_GetIter
+PyObject_HasAttr
+PyObject_HasAttrString
+PyObject_Hash
+PyObject_HashNotImplemented
+PyObject_Init
+PyObject_InitVar
+PyObject_IsInstance
+PyObject_IsSubclass
+PyObject_IsTrue
+PyObject_Length
+PyObject_Malloc
+PyObject_Not
+PyObject_Realloc
+PyObject_Repr
+PyObject_RichCompare
+PyObject_RichCompareBool
+PyObject_SelfIter
+PyObject_SetAttr
+PyObject_SetAttrString
+PyObject_SetItem
+PyObject_Size
+PyObject_Str
+PyObject_Type
+PyParser_SimpleParseFileFlags
+PyParser_SimpleParseStringFlags
+PyProperty_Type
+PyRangeIter_Type
+PyRange_Type
+PyReversed_Type
+PySeqIter_New
+PySeqIter_Type
+PySequence_Check
+PySequence_Concat
+PySequence_Contains
+PySequence_Count
+PySequence_DelItem
+PySequence_DelSlice
+PySequence_Fast
+PySequence_GetItem
+PySequence_GetSlice
+PySequence_In
+PySequence_InPlaceConcat
+PySequence_InPlaceRepeat
+PySequence_Index
+PySequence_Length
+PySequence_List
+PySequence_Repeat
+PySequence_SetItem
+PySequence_SetSlice
+PySequence_Size
+PySequence_Tuple
+PySetIter_Type
+PySet_Add
+PySet_Clear
+PySet_Contains
+PySet_Discard
+PySet_New
+PySet_Pop
+PySet_Size
+PySet_Type
+PySlice_GetIndices
+PySlice_GetIndicesEx
+PySlice_New
+PySlice_Type
+PySortWrapper_Type
+PyState_FindModule
+PyStructSequence_GetItem
+PyStructSequence_New
+PyStructSequence_NewType
+PyStructSequence_SetItem
+PySuper_Type
+PySys_AddWarnOption
+PySys_AddWarnOptionUnicode
+PySys_FormatStderr
+PySys_FormatStdout
+PySys_GetObject
+PySys_HasWarnOptions
+PySys_ResetWarnOptions
+PySys_SetArgv
+PySys_SetArgvEx
+PySys_SetObject
+PySys_SetPath
+PySys_WriteStderr
+PySys_WriteStdout
+PyThreadState_Clear
+PyThreadState_Delete
+PyThreadState_DeleteCurrent
+PyThreadState_Get
+PyThreadState_GetDict
+PyThreadState_New
+PyThreadState_SetAsyncExc
+PyThreadState_Swap
+PyTraceBack_Here
+PyTraceBack_Print
+PyTraceBack_Type
+PyTupleIter_Type
+PyTuple_ClearFreeList
+PyTuple_GetItem
+PyTuple_GetSlice
+PyTuple_New
+PyTuple_Pack
+PyTuple_SetItem
+PyTuple_Size
+PyTuple_Type
+PyType_ClearCache
+PyType_FromSpec
+PyType_GenericAlloc
+PyType_GenericNew
+PyType_GetFlags
+PyType_IsSubtype
+PyType_Modified
+PyType_Ready
+PyType_Type
+PyUnicodeDecodeError_Create
+PyUnicodeDecodeError_GetEncoding
+PyUnicodeDecodeError_GetEnd
+PyUnicodeDecodeError_GetObject
+PyUnicodeDecodeError_GetReason
+PyUnicodeDecodeError_GetStart
+PyUnicodeDecodeError_SetEnd
+PyUnicodeDecodeError_SetReason
+PyUnicodeDecodeError_SetStart
+PyUnicodeEncodeError_GetEncoding
+PyUnicodeEncodeError_GetEnd
+PyUnicodeEncodeError_GetObject
+PyUnicodeEncodeError_GetReason
+PyUnicodeEncodeError_GetStart
+PyUnicodeEncodeError_SetEnd
+PyUnicodeEncodeError_SetReason
+PyUnicodeEncodeError_SetStart
+PyUnicodeIter_Type
+PyUnicodeTranslateError_GetEnd
+PyUnicodeTranslateError_GetObject
+PyUnicodeTranslateError_GetReason
+PyUnicodeTranslateError_GetStart
+PyUnicodeTranslateError_SetEnd
+PyUnicodeTranslateError_SetReason
+PyUnicodeTranslateError_SetStart
+PyUnicodeUCS2_Append
+PyUnicodeUCS2_AppendAndDel
+PyUnicodeUCS2_AsASCIIString
+PyUnicodeUCS2_AsCharmapString
+PyUnicodeUCS2_AsDecodedObject
+PyUnicodeUCS2_AsDecodedUnicode
+PyUnicodeUCS2_AsEncodedObject
+PyUnicodeUCS2_AsEncodedString
+PyUnicodeUCS2_AsEncodedUnicode
+PyUnicodeUCS2_AsLatin1String
+PyUnicodeUCS2_AsRawUnicodeEscapeString
+PyUnicodeUCS2_AsUTF16String
+PyUnicodeUCS2_AsUTF32String
+PyUnicodeUCS2_AsUTF8String
+PyUnicodeUCS2_AsUnicodeEscapeString
+PyUnicodeUCS2_AsWideChar
+PyUnicodeUCS2_ClearFreelist
+PyUnicodeUCS2_Compare
+PyUnicodeUCS2_Concat
+PyUnicodeUCS2_Contains
+PyUnicodeUCS2_Count
+PyUnicodeUCS2_Decode
+PyUnicodeUCS2_DecodeASCII
+PyUnicodeUCS2_DecodeCharmap
+PyUnicodeUCS2_DecodeFSDefault
+PyUnicodeUCS2_DecodeFSDefaultAndSize
+PyUnicodeUCS2_DecodeLatin1
+PyUnicodeUCS2_DecodeRawUnicodeEscape
+PyUnicodeUCS2_DecodeUTF16
+PyUnicodeUCS2_DecodeUTF16Stateful
+PyUnicodeUCS2_DecodeUTF32
+PyUnicodeUCS2_DecodeUTF32Stateful
+PyUnicodeUCS2_DecodeUTF8
+PyUnicodeUCS2_DecodeUTF8Stateful
+PyUnicodeUCS2_DecodeUnicodeEscape
+PyUnicodeUCS2_FSConverter
+PyUnicodeUCS2_FSDecoder
+PyUnicodeUCS2_Find
+PyUnicodeUCS2_Format
+PyUnicodeUCS2_FromEncodedObject
+PyUnicodeUCS2_FromFormat
+PyUnicodeUCS2_FromFormatV
+PyUnicodeUCS2_FromObject
+PyUnicodeUCS2_FromOrdinal
+PyUnicodeUCS2_FromString
+PyUnicodeUCS2_FromStringAndSize
+PyUnicodeUCS2_FromWideChar
+PyUnicodeUCS2_GetDefaultEncoding
+PyUnicodeUCS2_GetSize
+PyUnicodeUCS2_IsIdentifier
+PyUnicodeUCS2_Join
+PyUnicodeUCS2_Partition
+PyUnicodeUCS2_RPartition
+PyUnicodeUCS2_RSplit
+PyUnicodeUCS2_Replace
+PyUnicodeUCS2_Resize
+PyUnicodeUCS2_RichCompare
+PyUnicodeUCS2_SetDefaultEncoding
+PyUnicodeUCS2_Split
+PyUnicodeUCS2_Splitlines
+PyUnicodeUCS2_Tailmatch
+PyUnicodeUCS2_Translate
+PyUnicode_BuildEncodingMap
+PyUnicode_CompareWithASCIIString
+PyUnicode_DecodeUTF7
+PyUnicode_DecodeUTF7Stateful
+PyUnicode_EncodeFSDefault
+PyUnicode_InternFromString
+PyUnicode_InternImmortal
+PyUnicode_InternInPlace
+PyUnicode_Type
+PyWeakref_GetObject
+PyWeakref_NewProxy
+PyWeakref_NewRef
+PyWrapperDescr_Type
+PyWrapper_New
+PyZip_Type
+Py_AddPendingCall
+Py_AtExit
+Py_BuildValue
+Py_CompileString
+Py_DecRef
+Py_EndInterpreter
+Py_Exit
+Py_FatalError
+Py_FileSystemDefaultEncoding
+Py_Finalize
+Py_GetBuildInfo
+Py_GetCompiler
+Py_GetCopyright
+Py_GetExecPrefix
+Py_GetPath
+Py_GetPlatform
+Py_GetPrefix
+Py_GetProgramFullPath
+Py_GetProgramName
+Py_GetPythonHome
+Py_GetRecursionLimit
+Py_GetVersion
+Py_HasFileSystemDefaultEncoding
+Py_IncRef
+Py_Initialize
+Py_InitializeEx
+Py_IsInitialized
+Py_Main
+Py_MakePendingCalls
+Py_NewInterpreter
+Py_ReprEnter
+Py_ReprLeave
+Py_SetProgramName
+Py_SetPythonHome
+Py_SetRecursionLimit
+Py_SymtableString
+Py_VaBuildValue
+_PyErr_BadInternalCall
+_PyObject_CallFunction_SizeT
+_PyObject_CallMethod_SizeT
+_PyObject_GC_Malloc
+_PyObject_GC_New
+_PyObject_GC_NewVar
+_PyObject_GC_Resize
+_PyObject_New
+_PyObject_NewVar
+_PyState_AddModule
+_PyThreadState_Init
+_PyThreadState_Prealloc
+_PyTrash_delete_later
+_PyTrash_delete_nesting
+_PyTrash_deposit_object
+_PyTrash_destroy_chain
+_PyWeakref_CallableProxyType
+_PyWeakref_ProxyType
+_PyWeakref_RefType
+_Py_BuildValue_SizeT
+_Py_CheckRecursionLimit
+_Py_CheckRecursiveCall
+_Py_Dealloc
+_Py_EllipsisObject
+_Py_FalseStruct
+_Py_NoneStruct
+_Py_NotImplementedStruct
+_Py_SwappedOp
+_Py_TrueStruct
+_Py_VaBuildValue_SizeT
diff --git a/PC/python3dll.c b/PC/python3dll.c
new file mode 100644
index 0000000000..ef29071125
--- /dev/null
+++ b/PC/python3dll.c
@@ -0,0 +1,9 @@
+#include <windows.h>
+
+BOOL WINAPI
+DllMain(HINSTANCE hInstDLL,
+ DWORD fdwReason,
+ LPVOID lpReserved)
+{
+ return TRUE;
+} \ No newline at end of file
diff --git a/PC/python_nt.rc b/PC/python_nt.rc
index e132837583..8cccf2dc2a 100644
--- a/PC/python_nt.rc
+++ b/PC/python_nt.rc
@@ -61,7 +61,7 @@ BEGIN
VALUE "FileDescription", "Python Core\0"
VALUE "FileVersion", PYTHON_VERSION
VALUE "InternalName", "Python DLL\0"
- VALUE "LegalCopyright", "Copyright © 2001-2008 Python Software Foundation. Copyright © 2000 BeOpen.com. Copyright © 1995-2001 CNRI. Copyright © 1991-1995 SMC.\0"
+ VALUE "LegalCopyright", "Copyright © 2001-2011 Python Software Foundation. Copyright © 2000 BeOpen.com. Copyright © 1995-2001 CNRI. Copyright © 1991-1995 SMC.\0"
VALUE "OriginalFilename", PYTHON_DLL_NAME "\0"
VALUE "ProductName", "Python\0"
VALUE "ProductVersion", PYTHON_VERSION
diff --git a/PC/winreg.c b/PC/winreg.c
index 52d230e7b9..1bc47b958b 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -88,7 +88,7 @@ PyDoc_STRVAR(ConnectRegistry_doc,
"key is the predefined handle to connect to.\n"
"\n"
"The return value is the handle of the opened key.\n"
-"If the function fails, an EnvironmentError exception is raised.");
+"If the function fails, a WindowsError exception is raised.");
PyDoc_STRVAR(CreateKey_doc,
"key = CreateKey(key, sub_key) - Creates or opens the specified key.\n"
@@ -103,6 +103,21 @@ PyDoc_STRVAR(CreateKey_doc,
"The return value is the handle of the opened key.\n"
"If the function fails, an exception is raised.");
+PyDoc_STRVAR(CreateKeyEx_doc,
+"key = CreateKeyEx(key, sub_key, res, sam) - Creates or opens the specified key.\n"
+"\n"
+"key is an already open key, or one of the predefined HKEY_* constants\n"
+"sub_key is a string that names the key this method opens or creates.\n"
+"res is a reserved integer, and must be zero. Default is zero.\n"
+"sam is an integer that specifies an access mask that describes the desired\n"
+" If key is one of the predefined keys, sub_key may be None. In that case,\n"
+" the handle returned is the same key handle passed in to the function.\n"
+"\n"
+"If the key already exists, this function opens the existing key\n"
+"\n"
+"The return value is the handle of the opened key.\n"
+"If the function fails, an exception is raised.");
+
PyDoc_STRVAR(DeleteKey_doc,
"DeleteKey(key, sub_key) - Deletes the specified key.\n"
"\n"
@@ -113,7 +128,22 @@ PyDoc_STRVAR(DeleteKey_doc,
"This method can not delete keys with subkeys.\n"
"\n"
"If the method succeeds, the entire key, including all of its values,\n"
-"is removed. If the method fails, an EnvironmentError exception is raised.");
+"is removed. If the method fails, a WindowsError exception is raised.");
+
+PyDoc_STRVAR(DeleteKeyEx_doc,
+"DeleteKeyEx(key, sub_key, sam, res) - Deletes the specified key.\n"
+"\n"
+"key is an already open key, or any one of the predefined HKEY_* constants.\n"
+"sub_key is a string that must be a subkey of the key identified by the key parameter.\n"
+"res is a reserved integer, and must be zero. Default is zero.\n"
+"sam is an integer that specifies an access mask that describes the desired\n"
+" This value must not be None, and the key may not have subkeys.\n"
+"\n"
+"This method can not delete keys with subkeys.\n"
+"\n"
+"If the method succeeds, the entire key, including all of its values,\n"
+"is removed. If the method fails, a WindowsError exception is raised.\n"
+"On unsupported Windows versions, NotImplementedError is raised.");
PyDoc_STRVAR(DeleteValue_doc,
"DeleteValue(key, value) - Removes a named value from a registry key.\n"
@@ -128,7 +158,7 @@ PyDoc_STRVAR(EnumKey_doc,
"index is an integer that identifies the index of the key to retrieve.\n"
"\n"
"The function retrieves the name of one subkey each time it is called.\n"
-"It is typically called repeatedly until an EnvironmentError exception is\n"
+"It is typically called repeatedly until a WindowsError exception is\n"
"raised, indicating no more values are available.");
PyDoc_STRVAR(EnumValue_doc,
@@ -137,7 +167,7 @@ PyDoc_STRVAR(EnumValue_doc,
"index is an integer that identifies the index of the value to retrieve.\n"
"\n"
"The function retrieves the name of one subkey each time it is called.\n"
-"It is typically called repeatedly, until an EnvironmentError exception\n"
+"It is typically called repeatedly, until a WindowsError exception\n"
"is raised, indicating no more values.\n"
"\n"
"The result is a tuple of 3 items:\n"
@@ -191,7 +221,7 @@ PyDoc_STRVAR(OpenKey_doc,
" security access for the key. Default is KEY_READ\n"
"\n"
"The result is a new handle to the specified key\n"
-"If the function fails, an EnvironmentError exception is raised.");
+"If the function fails, a WindowsError exception is raised.");
PyDoc_STRVAR(OpenKeyEx_doc, "See OpenKey()");
@@ -422,7 +452,7 @@ PyHKEY_compareFunc(PyObject *ob1, PyObject *ob2)
(pyhkey1 < pyhkey2 ? -1 : 1);
}
-static long
+static Py_hash_t
PyHKEY_hashFunc(PyObject *ob)
{
/* Just use the address.
@@ -735,8 +765,9 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
else {
if (!PyUnicode_Check(value))
return FALSE;
-
- *retDataSize = 2 + PyUnicode_GET_DATA_SIZE(value);
+ *retDataSize = Py_SAFE_DOWNCAST(
+ 2 + PyUnicode_GET_DATA_SIZE(value),
+ size_t, DWORD);
}
*retDataBuf = (BYTE *)PyMem_NEW(DWORD, *retDataSize);
if (*retDataBuf==NULL){
@@ -768,7 +799,8 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
t = PyList_GET_ITEM(value, j);
if (!PyUnicode_Check(t))
return FALSE;
- size += 2 + PyUnicode_GET_DATA_SIZE(t);
+ size += Py_SAFE_DOWNCAST(2 + PyUnicode_GET_DATA_SIZE(t),
+ size_t, DWORD);
}
*retDataSize = size + 2;
@@ -818,7 +850,7 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
PyErr_NoMemory();
return FALSE;
}
- *retDataSize = view.len;
+ *retDataSize = Py_SAFE_DOWNCAST(view.len, Py_ssize_t, DWORD);
memcpy(*retDataBuf, view.buf, view.len);
PyBuffer_Release(&view);
}
@@ -957,6 +989,32 @@ PyCreateKey(PyObject *self, PyObject *args)
}
static PyObject *
+PyCreateKeyEx(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ HKEY hKey;
+ PyObject *key;
+ wchar_t *sub_key;
+ HKEY retKey;
+ int reserved = 0;
+ REGSAM access = KEY_WRITE;
+ long rc;
+
+ char *kwlist[] = {"key", "sub_key", "reserved", "access", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OZ|ii:CreateKeyEx", kwlist,
+ &key, &sub_key, &reserved, &access))
+ return NULL;
+ if (!PyHKEY_AsHKEY(key, &hKey, FALSE))
+ return NULL;
+
+ rc = RegCreateKeyExW(hKey, sub_key, reserved, NULL, (DWORD)NULL,
+ access, NULL, &retKey, NULL);
+ if (rc != ERROR_SUCCESS)
+ return PyErr_SetFromWindowsErrWithFunction(rc, "CreateKeyEx");
+ return PyHKEY_FromHKEY(retKey);
+}
+
+static PyObject *
PyDeleteKey(PyObject *self, PyObject *args)
{
HKEY hKey;
@@ -975,6 +1033,47 @@ PyDeleteKey(PyObject *self, PyObject *args)
}
static PyObject *
+PyDeleteKeyEx(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ HKEY hKey;
+ PyObject *key;
+ HMODULE hMod;
+ typedef LONG (WINAPI *RDKEFunc)(HKEY, const wchar_t*, REGSAM, int);
+ RDKEFunc pfn = NULL;
+ wchar_t *sub_key;
+ long rc;
+ int reserved = 0;
+ REGSAM access = KEY_WOW64_64KEY;
+
+ char *kwlist[] = {"key", "sub_key", "access", "reserved", NULL};
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Ou|ii:DeleteKeyEx", kwlist,
+ &key, &sub_key, &access, &reserved))
+ return NULL;
+ if (!PyHKEY_AsHKEY(key, &hKey, FALSE))
+ return NULL;
+
+ /* Only available on 64bit platforms, so we must load it
+ dynamically. */
+ hMod = GetModuleHandle("advapi32.dll");
+ if (hMod)
+ pfn = (RDKEFunc)GetProcAddress(hMod,
+ "RegDeleteKeyExW");
+ if (!pfn) {
+ PyErr_SetString(PyExc_NotImplementedError,
+ "not implemented on this platform");
+ return NULL;
+ }
+ Py_BEGIN_ALLOW_THREADS
+ rc = (*pfn)(hKey, sub_key, access, reserved);
+ Py_END_ALLOW_THREADS
+
+ if (rc != ERROR_SUCCESS)
+ return PyErr_SetFromWindowsErrWithFunction(rc, "RegDeleteKeyEx");
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
PyDeleteValue(PyObject *self, PyObject *args)
{
HKEY hKey;
@@ -1036,7 +1135,7 @@ PyEnumValue(PyObject *self, PyObject *args)
int index;
long rc;
wchar_t *retValueBuf;
- wchar_t *tmpBuf;
+ BYTE *tmpBuf;
BYTE *retDataBuf;
DWORD retValueSize, bufValueSize;
DWORD retDataSize, bufDataSize;
@@ -1084,7 +1183,7 @@ PyEnumValue(PyObject *self, PyObject *args)
break;
bufDataSize *= 2;
- tmpBuf = (wchar_t *)PyMem_Realloc(retDataBuf, bufDataSize);
+ tmpBuf = (BYTE *)PyMem_Realloc(retDataBuf, bufDataSize);
if (tmpBuf == NULL) {
PyErr_NoMemory();
retVal = NULL;
@@ -1187,24 +1286,26 @@ PyLoadKey(PyObject *self, PyObject *args)
}
static PyObject *
-PyOpenKey(PyObject *self, PyObject *args)
+PyOpenKey(PyObject *self, PyObject *args, PyObject *kwargs)
{
HKEY hKey;
- PyObject *obKey;
-
- wchar_t *subKey;
- int res = 0;
+ PyObject *key;
+ wchar_t *sub_key;
+ int reserved = 0;
HKEY retKey;
long rc;
- REGSAM sam = KEY_READ;
- if (!PyArg_ParseTuple(args, "OZ|ii:OpenKey", &obKey, &subKey,
- &res, &sam))
+ REGSAM access = KEY_READ;
+
+ char *kwlist[] = {"key", "sub_key", "reserved", "access", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OZ|ii:OpenKey", kwlist,
+ &key, &sub_key, &reserved, &access))
return NULL;
- if (!PyHKEY_AsHKEY(obKey, &hKey, FALSE))
+ if (!PyHKEY_AsHKEY(key, &hKey, FALSE))
return NULL;
Py_BEGIN_ALLOW_THREADS
- rc = RegOpenKeyExW(hKey, subKey, res, sam, &retKey);
+ rc = RegOpenKeyExW(hKey, sub_key, reserved, access, &retKey);
Py_END_ALLOW_THREADS
if (rc != ERROR_SUCCESS)
return PyErr_SetFromWindowsErrWithFunction(rc, "RegOpenKeyEx");
@@ -1475,8 +1576,8 @@ PyDisableReflectionKey(PyObject *self, PyObject *args)
if (!PyHKEY_AsHKEY(obKey, &hKey, FALSE))
return NULL;
- // Only available on 64bit platforms, so we must load it
- // dynamically.
+ /* Only available on 64bit platforms, so we must load it
+ dynamically.*/
hMod = GetModuleHandle("advapi32.dll");
if (hMod)
pfn = (RDRKFunc)GetProcAddress(hMod,
@@ -1511,8 +1612,8 @@ PyEnableReflectionKey(PyObject *self, PyObject *args)
if (!PyHKEY_AsHKEY(obKey, &hKey, FALSE))
return NULL;
- // Only available on 64bit platforms, so we must load it
- // dynamically.
+ /* Only available on 64bit platforms, so we must load it
+ dynamically.*/
hMod = GetModuleHandle("advapi32.dll");
if (hMod)
pfn = (RERKFunc)GetProcAddress(hMod,
@@ -1548,8 +1649,8 @@ PyQueryReflectionKey(PyObject *self, PyObject *args)
if (!PyHKEY_AsHKEY(obKey, &hKey, FALSE))
return NULL;
- // Only available on 64bit platforms, so we must load it
- // dynamically.
+ /* Only available on 64bit platforms, so we must load it
+ dynamically.*/
hMod = GetModuleHandle("advapi32.dll");
if (hMod)
pfn = (RQRKFunc)GetProcAddress(hMod,
@@ -1565,14 +1666,18 @@ PyQueryReflectionKey(PyObject *self, PyObject *args)
if (rc != ERROR_SUCCESS)
return PyErr_SetFromWindowsErrWithFunction(rc,
"RegQueryReflectionKey");
- return PyBool_FromLong(rc);
+ return PyBool_FromLong(result);
}
static struct PyMethodDef winreg_methods[] = {
{"CloseKey", PyCloseKey, METH_VARARGS, CloseKey_doc},
{"ConnectRegistry", PyConnectRegistry, METH_VARARGS, ConnectRegistry_doc},
{"CreateKey", PyCreateKey, METH_VARARGS, CreateKey_doc},
+ {"CreateKeyEx", (PyCFunction)PyCreateKeyEx,
+ METH_VARARGS | METH_KEYWORDS, CreateKeyEx_doc},
{"DeleteKey", PyDeleteKey, METH_VARARGS, DeleteKey_doc},
+ {"DeleteKeyEx", (PyCFunction)PyDeleteKeyEx,
+ METH_VARARGS | METH_KEYWORDS, DeleteKeyEx_doc},
{"DeleteValue", PyDeleteValue, METH_VARARGS, DeleteValue_doc},
{"DisableReflectionKey", PyDisableReflectionKey, METH_VARARGS, DisableReflectionKey_doc},
{"EnableReflectionKey", PyEnableReflectionKey, METH_VARARGS, EnableReflectionKey_doc},
@@ -1582,8 +1687,10 @@ static struct PyMethodDef winreg_methods[] = {
ExpandEnvironmentStrings_doc },
{"FlushKey", PyFlushKey, METH_VARARGS, FlushKey_doc},
{"LoadKey", PyLoadKey, METH_VARARGS, LoadKey_doc},
- {"OpenKey", PyOpenKey, METH_VARARGS, OpenKey_doc},
- {"OpenKeyEx", PyOpenKey, METH_VARARGS, OpenKeyEx_doc},
+ {"OpenKey", (PyCFunction)PyOpenKey, METH_VARARGS | METH_KEYWORDS,
+ OpenKey_doc},
+ {"OpenKeyEx", (PyCFunction)PyOpenKey, METH_VARARGS | METH_KEYWORDS,
+ OpenKeyEx_doc},
{"QueryValue", PyQueryValue, METH_VARARGS, QueryValue_doc},
{"QueryValueEx", PyQueryValueEx, METH_VARARGS, QueryValueEx_doc},
{"QueryInfoKey", PyQueryInfoKey, METH_VARARGS, QueryInfoKey_doc},
diff --git a/PC/winsound.c b/PC/winsound.c
index d455848686..1ed95bac42 100644
--- a/PC/winsound.c
+++ b/PC/winsound.c
@@ -73,8 +73,6 @@ static PyObject *
sound_playsound(PyObject *s, PyObject *args)
{
Py_UNICODE *wsound;
- PyObject *osound;
- const char *sound;
int flags;
int ok;
@@ -95,31 +93,7 @@ sound_playsound(PyObject *s, PyObject *args)
Py_INCREF(Py_None);
return Py_None;
}
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
- if (!PyArg_ParseTuple(args, "O&i:PlaySound",
- PyUnicode_FSConverter, &osound, &flags))
- return NULL;
- if (flags & SND_ASYNC && flags & SND_MEMORY) {
- /* Sidestep reference counting headache; unfortunately this also
- prevent SND_LOOP from memory. */
- PyErr_SetString(PyExc_RuntimeError, "Cannot play asynchronously from memory");
- Py_DECREF(osound);
- return NULL;
- }
- sound = PyBytes_AsString(osound);
- Py_BEGIN_ALLOW_THREADS
- ok = PlaySoundA(sound, NULL, flags);
- Py_END_ALLOW_THREADS
- if (!ok) {
- PyErr_SetString(PyExc_RuntimeError, "Failed to play sound");
- Py_DECREF(osound);
- return NULL;
- }
- Py_DECREF(osound);
- Py_INCREF(Py_None);
- return Py_None;
+ return NULL;
}
static PyObject *
diff --git a/PCbuild/_hashlib.vcproj b/PCbuild/_hashlib.vcproj
index 50d40d1fcd..e05d97ebc2 100644
--- a/PCbuild/_hashlib.vcproj
+++ b/PCbuild/_hashlib.vcproj
@@ -27,7 +27,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -89,7 +88,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -153,7 +151,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -216,7 +213,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -280,7 +276,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -343,7 +338,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -408,7 +402,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -471,7 +464,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
diff --git a/PCbuild/_ssl.vcproj b/PCbuild/_ssl.vcproj
index 769be93be9..5728c84583 100644
--- a/PCbuild/_ssl.vcproj
+++ b/PCbuild/_ssl.vcproj
@@ -27,7 +27,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -89,7 +88,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -153,7 +151,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -216,7 +213,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -280,7 +276,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -343,7 +338,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -408,7 +402,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -471,7 +464,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
diff --git a/PCbuild/build_ssl.py b/PCbuild/build_ssl.py
index 2693c41898..2cf7fc6883 100644
--- a/PCbuild/build_ssl.py
+++ b/PCbuild/build_ssl.py
@@ -102,11 +102,8 @@ def create_makefile64(makefile, m32):
"""
if not os.path.isfile(m32):
return
- # 2.4 compatibility
- fin = open(m32)
- if 1: # with open(m32) as fin:
- fout = open(makefile, 'w')
- if 1: # with open(makefile, 'w') as fout:
+ with open(m32) as fin:
+ with open(makefile, 'w') as fout:
for line in fin:
line = line.replace("=tmp32", "=tmp64")
line = line.replace("=out32", "=out64")
@@ -124,13 +121,9 @@ def fix_makefile(makefile):
"""
if not os.path.isfile(makefile):
return
- # 2.4 compatibility
- fin = open(makefile)
- if 1: # with open(makefile) as fin:
+ with open(makefile) as fin:
lines = fin.readlines()
- fin.close()
- fout = open(makefile, 'w')
- if 1: # with open(makefile, 'w') as fout:
+ with open(makefile, 'w') as fout:
for line in lines:
if line.startswith("PERL="):
continue
@@ -146,14 +139,29 @@ def fix_makefile(makefile):
line = line + noalgo
line = line + '\n'
fout.write(line)
- fout.close()
def run_configure(configure, do_script):
- print("perl Configure "+configure)
- os.system("perl Configure "+configure)
+ print("perl Configure "+configure+" no-idea no-mdc2")
+ os.system("perl Configure "+configure+" no-idea no-mdc2")
print(do_script)
os.system(do_script)
+def cmp(f1, f2):
+ bufsize = 1024 * 8
+ with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2:
+ while True:
+ b1 = fp1.read(bufsize)
+ b2 = fp2.read(bufsize)
+ if b1 != b2:
+ return False
+ if not b1:
+ return True
+
+def copy(src, dst):
+ if os.path.isfile(dst) and cmp(src, dst):
+ return
+ shutil.copy(src, dst)
+
def main():
build_all = "-a" in sys.argv
if sys.argv[1] == "Release":
@@ -169,12 +177,14 @@ def main():
do_script = "ms\\do_nasm"
makefile="ms\\nt.mak"
m32 = makefile
+ dirsuffix = "32"
elif sys.argv[2] == "x64":
arch="amd64"
configure = "VC-WIN64A"
do_script = "ms\\do_win64a"
makefile = "ms\\nt64.mak"
m32 = makefile.replace('64', '')
+ dirsuffix = "64"
#os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON"
else:
raise ValueError(str(sys.argv))
@@ -228,8 +238,17 @@ def main():
if arch == "amd64":
create_makefile64(makefile, m32)
fix_makefile(makefile)
- shutil.copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch)
- shutil.copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch)
+ copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch)
+ copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch)
+
+ # If the assembler files don't exist in tmpXX, copy them there
+ if perl is None and os.path.exists("asm"+dirsuffix):
+ if not os.path.exists("tmp"+dirsuffix):
+ os.mkdir("tmp"+dirsuffix)
+ for f in os.listdir("asm"+dirsuffix):
+ if not f.endswith(".asm"): continue
+ if os.path.isfile(r"tmp%s\%s" % (dirsuffix, f)): continue
+ shutil.copy(r"asm%s\%s" % (dirsuffix, f), "tmp"+dirsuffix)
# Now run make.
if arch == "amd64":
@@ -238,8 +257,8 @@ def main():
print("ml64 assembler has failed.")
sys.exit(rc)
- shutil.copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h")
- shutil.copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h")
+ copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h")
+ copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h")
#makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)
makeCommand = "nmake /nologo -f \"%s\"" % makefile
diff --git a/PCbuild/build_tkinter.py b/PCbuild/build_tkinter.py
index 2d5797f38d..eb1d092caa 100644
--- a/PCbuild/build_tkinter.py
+++ b/PCbuild/build_tkinter.py
@@ -11,9 +11,9 @@ import sys
here = os.path.abspath(os.path.dirname(__file__))
par = os.path.pardir
-TCL = "tcl8.5.2"
-TK = "tk8.5.2"
-TIX = "tix-8.4.0.x"
+TCL = "tcl8.5.9"
+TK = "tk8.5.9"
+TIX = "tix-8.4.3.x"
ROOT = os.path.abspath(os.path.join(here, par, par))
# Windows 2000 compatibility: WINVER 0x0500
@@ -23,7 +23,7 @@ NMAKE = ('nmake /nologo /f %s '
'%s %s')
def nmake(makefile, command="", **kw):
- defines = ' '.join(k+'='+v for k, v in kw.items())
+ defines = ' '.join(k+'='+str(v) for k, v in kw.items())
cmd = NMAKE % (makefile, defines, command)
print("\n\n"+cmd+"\n")
if os.system(cmd) != 0:
@@ -53,8 +53,8 @@ def build(platform, clean):
os.chdir(os.path.join(ROOT, TK, "win"))
if clean:
nmake("makefile.vc", "clean", DEBUG=0, TCLDIR=tcldir)
- nmake("makefile.vc", DEBUG=0, MACHINE=machine)
- nmake("makefile.vc", "install", DEBUG=0, INSTALLDIR=dest, MACHINE=machine)
+ nmake("makefile.vc", DEBUG=0, MACHINE=machine, TCLDIR=tcldir)
+ nmake("makefile.vc", "install", DEBUG=0, INSTALLDIR=dest, MACHINE=machine, TCLDIR=tcldir)
# TIX
if 1:
@@ -63,7 +63,7 @@ def build(platform, clean):
if clean:
nmake("python.mak", "clean")
nmake("python.mak", MACHINE=machine, INSTALL_DIR=dest)
- nmake("python.mak", "install", INSTALL_DIR=dest)
+ nmake("python.mak", "install", MACHINE=machine, INSTALL_DIR=dest)
def main():
if len(sys.argv) < 2 or sys.argv[1] not in ("Win32", "AMD64"):
diff --git a/PCbuild/bz2.vcproj b/PCbuild/bz2.vcproj
index 04ad7d3343..035736e286 100644
--- a/PCbuild/bz2.vcproj
+++ b/PCbuild/bz2.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -105,7 +105,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -167,7 +167,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -230,7 +230,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -292,7 +292,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -355,7 +355,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -418,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -481,7 +481,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(bz2Dir)"
- PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
+ PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
/>
<Tool
Name="VCManagedResourceCompilerTool"
diff --git a/PCbuild/kill_python.c b/PCbuild/kill_python.c
index 17a5f32ab2..6b916781cc 100644
--- a/PCbuild/kill_python.c
+++ b/PCbuild/kill_python.c
@@ -106,7 +106,7 @@ main(int argc, char **argv)
/*
* XXX TODO: if we really wanted to be fancy, we could check the
* modules for all processes (not just the python[_d].exe ones)
- * and see if any of our DLLs are loaded (i.e. python31[_d].dll),
+ * and see if any of our DLLs are loaded (i.e. python32[_d].dll),
* as that would also inhibit our ability to rebuild the solution.
* Not worth loosing sleep over though; for now, a simple check
* for just the python executable should be sufficient.
diff --git a/PCbuild/make_buildinfo.c b/PCbuild/make_buildinfo.c
index 5a3d385227..fd3a2e2f6b 100644
--- a/PCbuild/make_buildinfo.c
+++ b/PCbuild/make_buildinfo.c
@@ -19,9 +19,15 @@
invoked as a pre-link step for pythoncore, so that overwrites
any previous getbuildinfo.o.
+ However, if a second argument is provided, this will be used
+ as a temporary directory where any getbuildinfo2.c and
+ getbuildinfo.o files are put. This is useful if multiple
+ configurations are being built in parallel, to avoid them
+ trampling each other's files.
+
*/
-int make_buildinfo2()
+int make_buildinfo2(const char *tmppath)
{
struct _stat st;
HKEY hTortoise;
@@ -46,7 +52,9 @@ int make_buildinfo2()
if (_stat(command+1, &st) < 0)
/* subwcrev.exe not part of the release */
return 0;
- strcat_s(command, CMD_SIZE, "\" .. ..\\Modules\\getbuildinfo.c getbuildinfo2.c");
+ strcat_s(command, CMD_SIZE, "\" .. ..\\Modules\\getbuildinfo.c \"");
+ strcat_s(command, CMD_SIZE, tmppath); /* quoted tmppath */
+ strcat_s(command, CMD_SIZE, "getbuildinfo2.c\"");
puts(command); fflush(stdout);
if (system(command) < 0)
return 0;
@@ -55,10 +63,12 @@ int make_buildinfo2()
int main(int argc, char*argv[])
{
- char command[500] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
+ char command[CMD_SIZE] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
+ char tmppath[CMD_SIZE] = "";
int do_unlink, result;
- if (argc != 2) {
- fprintf(stderr, "make_buildinfo $(ConfigurationName)\n");
+ char *tmpdir = NULL;
+ if (argc <= 2 || argc > 3) {
+ fprintf(stderr, "make_buildinfo $(ConfigurationName) [tmpdir]\n");
return EXIT_FAILURE;
}
if (strcmp(argv[1], "Release") == 0) {
@@ -78,16 +88,41 @@ int main(int argc, char*argv[])
fprintf(stderr, "unsupported configuration %s\n", argv[1]);
return EXIT_FAILURE;
}
+ if (argc > 2) {
+ tmpdir = argv[2];
+ strcat_s(tmppath, _countof(tmppath), tmpdir);
+ /* Hack fix for bad command line: If the command is issued like this:
+ * $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)"
+ * we will get a trailing quote because IntDir ends with a backslash that then
+ * escapes the final ". To simplify the life for developers, catch that problem
+ * here by cutting it off.
+ * The proper command line, btw is:
+ * $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)\"
+ * Hooray for command line parsing on windows.
+ */
+ if (strlen(tmppath) > 0 && tmppath[strlen(tmppath)-1] == '"')
+ tmppath[strlen(tmppath)-1] = '\0';
+ strcat_s(tmppath, _countof(tmppath), "\\");
+ }
- if ((do_unlink = make_buildinfo2()))
- strcat_s(command, CMD_SIZE, "getbuildinfo2.c -DSUBWCREV ");
- else
+ if ((do_unlink = make_buildinfo2(tmppath))) {
+ strcat_s(command, CMD_SIZE, "\"");
+ strcat_s(command, CMD_SIZE, tmppath);
+ strcat_s(command, CMD_SIZE, "getbuildinfo2.c\" -DSUBWCREV ");
+ } else
strcat_s(command, CMD_SIZE, "..\\Modules\\getbuildinfo.c");
- strcat_s(command, CMD_SIZE, " -Fogetbuildinfo.o -I..\\Include -I..\\PC");
+ strcat_s(command, CMD_SIZE, " -Fo\"");
+ strcat_s(command, CMD_SIZE, tmppath);
+ strcat_s(command, CMD_SIZE, "getbuildinfo.o\" -I..\\Include -I..\\PC");
puts(command); fflush(stdout);
result = system(command);
- if (do_unlink)
- _unlink("getbuildinfo2.c");
+ if (do_unlink) {
+ command[0] = '\0';
+ strcat_s(command, CMD_SIZE, "\"");
+ strcat_s(command, CMD_SIZE, tmppath);
+ strcat_s(command, CMD_SIZE, "getbuildinfo2.c\"");
+ _unlink(command);
+ }
if (result < 0)
return EXIT_FAILURE;
return 0;
diff --git a/PCbuild/make_buildinfo.vcproj b/PCbuild/make_buildinfo.vcproj
index c8646e2e27..1910b9eb13 100644
--- a/PCbuild/make_buildinfo.vcproj
+++ b/PCbuild/make_buildinfo.vcproj
@@ -12,9 +12,6 @@
<Platform
Name="Win32"
/>
- <Platform
- Name="x64"
- />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -84,64 +81,6 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
- <Configuration
- Name="Release|x64"
- ConfigurationType="1"
- InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="_CONSOLE"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
</Configurations>
<References>
</References>
diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln
index 1f6c6fb2ba..1de4ea1e27 100644
--- a/PCbuild/pcbuild.sln
+++ b/PCbuild/pcbuild.sln
@@ -73,6 +73,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcproj", "{C6E
ProjectSection(ProjectDependencies) = postProject
{B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}
{86937F53-C189-40EF-8CE8-8759D8E7D480} = {86937F53-C189-40EF-8CE8-8759D8E7D480}
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0} = {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}
{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
EndProjectSection
EndProject
@@ -111,6 +112,7 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcproj", "{447F05A8-F581-4CAC-A466-5AC7936E207E}"
ProjectSection(ProjectDependencies) = postProject
{B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0} = {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}
{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
EndProjectSection
EndProject
@@ -124,8 +126,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multip
{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl", "ssl.vcproj", "{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}"
+ ProjectSection(ProjectDependencies) = postProject
+ {B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}
+ EndProjectSection
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kill_python", "kill_python.vcproj", "{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xxlimited", "xxlimited.vcproj", "{F749B822-B489-4CA5-A3AD-CE078F5F338A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -514,6 +525,22 @@ Global
{9E48B300-37D1-11DD-8C41-005056C00008}.Release|Win32.Build.0 = Release|Win32
{9E48B300-37D1-11DD-8C41-005056C00008}.Release|x64.ActiveCfg = Release|x64
{9E48B300-37D1-11DD-8C41-005056C00008}.Release|x64.Build.0 = Release|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|Win32.Build.0 = Debug|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|x64.ActiveCfg = Debug|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|x64.Build.0 = Debug|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|x64.Build.0 = PGInstrument|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|x64.Build.0 = PGUpdate|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|Win32.ActiveCfg = Release|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|Win32.Build.0 = Release|Win32
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|x64.ActiveCfg = Release|x64
+ {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|x64.Build.0 = Release|x64
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|Win32.ActiveCfg = Debug|Win32
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|Win32.Build.0 = Debug|Win32
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|x64.ActiveCfg = Debug|x64
@@ -530,6 +557,37 @@ Global
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|Win32.Build.0 = Release|Win32
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.ActiveCfg = Release|x64
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.Build.0 = Release|x64
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Debug|Win32.ActiveCfg = PGInstrument|Win32
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Debug|x64.ActiveCfg = Debug|x64
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Debug|x64.Build.0 = Debug|x64
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGInstrument|x64.ActiveCfg = Release|x64
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGInstrument|x64.Build.0 = Release|x64
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGUpdate|x64.ActiveCfg = Release|x64
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGUpdate|x64.Build.0 = Release|x64
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|Win32.ActiveCfg = Release|Win32
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|Win32.Build.0 = Release|Win32
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|x64.ActiveCfg = Release|x64
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|x64.Build.0 = Release|x64
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|Win32.Build.0 = Debug|Win32
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|x64.ActiveCfg = Debug|x64
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|x64.Build.0 = Debug|x64
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGInstrument|Win32.ActiveCfg = Release|Win32
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGInstrument|Win32.Build.0 = Release|Win32
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGInstrument|x64.ActiveCfg = Release|x64
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGInstrument|x64.Build.0 = Release|x64
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGUpdate|Win32.ActiveCfg = Release|Win32
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGUpdate|Win32.Build.0 = Release|Win32
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGUpdate|x64.ActiveCfg = Release|x64
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGUpdate|x64.Build.0 = Release|x64
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|Win32.ActiveCfg = Release|Win32
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|Win32.Build.0 = Release|Win32
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|x64.ActiveCfg = Release|x64
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/PCbuild/pyproject.vsprops b/PCbuild/pyproject.vsprops
index ecd7fb5d1e..3f69a426f7 100644
--- a/PCbuild/pyproject.vsprops
+++ b/PCbuild/pyproject.vsprops
@@ -38,7 +38,7 @@
/>
<UserMacro
Name="PyDllName"
- Value="python31"
+ Value="python32"
/>
<UserMacro
Name="PythonExe"
@@ -50,7 +50,7 @@
/>
<UserMacro
Name="sqlite3Dir"
- Value="$(externalsDir)\sqlite-3.5.9"
+ Value="$(externalsDir)\sqlite-3.7.4"
/>
<UserMacro
Name="bz2Dir"
@@ -58,7 +58,7 @@
/>
<UserMacro
Name="opensslDir"
- Value="$(externalsDir)\openssl-0.9.8l"
+ Value="$(externalsDir)\openssl-1.0.0a"
/>
<UserMacro
Name="tcltkDir"
diff --git a/PCbuild/python3dll.vcproj b/PCbuild/python3dll.vcproj
new file mode 100644
index 0000000000..52c6752214
--- /dev/null
+++ b/PCbuild/python3dll.vcproj
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="python3dll"
+ ProjectGUID="{885D4898-D08D-4091-9C40-C700CFE3FC5A}"
+ RootNamespace="python3dll"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x86 OutDir=$(OutDir)"
+ ReBuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x86 OutDir=$(OutDir) rebuild"
+ CleanCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x86 OutDir=$(OutDir) clean"
+ Output="$(OutDir)\python3.dll"
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x64 OutDir=$(OutDir)"
+ ReBuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x64 OutDir=$(OutDir) rebuild"
+ CleanCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x64 OutDir=$(OutDir) clean"
+ Output="$(OutDir)\python3.dll"
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGInstrument|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pginstrument.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x86 OutDir=$(OutDir)"
+ ReBuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x86 OutDir=$(OutDir) rebuild"
+ CleanCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x86 OutDir=$(OutDir) clean"
+ Output="$(OutDir)\python3.dll"
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGInstrument|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pginstrument.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x64 OutDir=$(OutDir)"
+ ReBuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x64 OutDir=$(OutDir) rebuild"
+ CleanCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x64 OutDir=$(OutDir) clean"
+ Output="$(OutDir)\python3.dll"
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGUpdate|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pgupdate.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x86 OutDir=$(OutDir)"
+ ReBuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x86 OutDir=$(OutDir) rebuild"
+ CleanCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x86 OutDir=$(OutDir) clean"
+ Output="$(OutDir)\python3.dll"
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGUpdate|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pgupdate.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x64 OutDir=$(OutDir)"
+ ReBuildCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x64 OutDir=$(OutDir) rebuild"
+ CleanCommandLine="cd $(InputDir)\..\PC&#x0D;&#x0A;nmake /f python3.mak MACHINE=x64 OutDir=$(OutDir) clean"
+ Output="$(OutDir)\python3.dll"
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\PC\python3.def"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|Win32"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|x64"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|Win32"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|x64"
+ >
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\PC\python3dll.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|Win32"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|x64"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|Win32"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|x64"
+ >
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath="..\PC\python_nt.rc"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|Win32"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|x64"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|Win32"
+ >
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|x64"
+ >
+ </FileConfiguration>
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/PCbuild/pythoncore.vcproj b/PCbuild/pythoncore.vcproj
index 11cd3118a2..b8187618bb 100644
--- a/PCbuild/pythoncore.vcproj
+++ b/PCbuild/pythoncore.vcproj
@@ -59,11 +59,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -134,11 +134,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -212,11 +212,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug &quot;$(IntDir)\&quot;"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName)_d.dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"
@@ -290,11 +290,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug &quot;$(IntDir)\&quot;"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName)_d.dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"
@@ -364,11 +364,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -439,11 +439,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -514,11 +514,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -589,11 +589,11 @@
<Tool
Name="VCPreLinkEventTool"
Description="Generate build information..."
- CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release"
+ CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="getbuildinfo.o"
+ AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
@@ -675,10 +675,6 @@
>
</File>
<File
- RelativePath="..\Include\cobject.h"
- >
- </File>
- <File
RelativePath="..\Include\code.h"
>
</File>
@@ -707,6 +703,10 @@
>
</File>
<File
+ RelativePath="..\Include\dynamic_annotations.h"
+ >
+ </File>
+ <File
RelativePath="..\Include\enumobject.h"
>
</File>
@@ -723,6 +723,10 @@
>
</File>
<File
+ RelativePath="..\Include\fileutils.h"
+ >
+ </File>
+ <File
RelativePath="..\Include\floatobject.h"
>
</File>
@@ -755,10 +759,6 @@
>
</File>
<File
- RelativePath="..\Include\intobject.h"
- >
- </File>
- <File
RelativePath="..\Include\intrcheck.h"
>
</File>
@@ -883,6 +883,10 @@
>
</File>
<File
+ RelativePath="..\Include\pytime.h"
+ >
+ </File>
+ <File
RelativePath="..\Include\pymem.h"
>
</File>
@@ -1019,6 +1023,14 @@
>
</File>
<File
+ RelativePath="..\Modules\_math.c"
+ >
+ </File>
+ <File
+ RelativePath="..\Modules\_math.h"
+ >
+ </File>
+ <File
RelativePath="..\Modules\_pickle.c"
>
</File>
@@ -1035,6 +1047,14 @@
>
</File>
<File
+ RelativePath="..\Modules\_time.c"
+ >
+ </File>
+ <File
+ RelativePath="..\Modules\_time.h"
+ >
+ </File>
+ <File
RelativePath="..\Modules\_weakref.c"
>
</File>
@@ -1059,7 +1079,7 @@
>
</File>
<File
- RelativePath="..\Modules\datetimemodule.c"
+ RelativePath="..\Modules\_datetimemodule.c"
>
</File>
<File
@@ -1216,6 +1236,70 @@
<File
RelativePath="..\Modules\zlib\gzio.c"
>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGInstrument|Win64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="PGUpdate|Win64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\Modules\zlib\infback.c"
@@ -1391,10 +1475,6 @@
>
</File>
<File
- RelativePath="..\Objects\cobject.c"
- >
- </File>
- <File
RelativePath="..\Objects\codeobject.c"
>
</File>
@@ -1499,6 +1579,10 @@
>
</File>
<File
+ RelativePath="..\Objects\stringlib\split.h"
+ >
+ </File>
+ <File
RelativePath="..\Objects\structseq.c"
>
</File>
@@ -1659,6 +1743,10 @@
>
</File>
<File
+ RelativePath="..\Python\dynamic_annotations.c"
+ >
+ </File>
+ <File
RelativePath="..\Python\dynload_win.c"
>
</File>
@@ -1667,6 +1755,10 @@
>
</File>
<File
+ RelativePath="..\Python\fileutils.c"
+ >
+ </File>
+ <File
RelativePath="..\Python\formatter_unicode.c"
>
</File>
@@ -1755,6 +1847,10 @@
>
</File>
<File
+ RelativePath="..\Python\pytime.c"
+ >
+ </File>
+ <File
RelativePath="..\Python\pystate.c"
>
</File>
diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt
index f4da94576f..dbe031f474 100644
--- a/PCbuild/readme.txt
+++ b/PCbuild/readme.txt
@@ -37,7 +37,7 @@ NOTE:
running a Python core buildbot test slave; see SUBPROJECTS below)
When using the Debug setting, the output files have a _d added to
-their name: python31_d.dll, python_d.exe, parser_d.pyd, and so on. Both
+their name: python32_d.dll, python_d.exe, parser_d.pyd, and so on. Both
the build and rt batch files accept a -d option for debug builds.
The 32bit builds end up in the solution folder PCbuild while the x64 builds
@@ -104,7 +104,7 @@ winsound
Python-controlled subprojects that wrap external projects:
_sqlite3
- Wraps SQLite 3.5.9, which is currently built by sqlite3.vcproj (see below).
+ Wraps SQLite 3.7.4, which is currently built by sqlite3.vcproj (see below).
_tkinter
Wraps the Tk windowing system. Unlike _sqlite3, there's no
corresponding tcltk.vcproj-type project that builds Tcl/Tk from vcproj's
@@ -139,7 +139,7 @@ _ssl
Get the source code through
- svn export http://svn.python.org/projects/external/openssl-0.9.8l
+ svn export http://svn.python.org/projects/external/openssl-1.0.0a
** NOTE: if you use the Tools\buildbot\external(-amd64).bat approach for
obtaining external sources then you don't need to manually get the source
diff --git a/PCbuild/rt.bat b/PCbuild/rt.bat
index 1ce0107f0a..7129e20349 100644
--- a/PCbuild/rt.bat
+++ b/PCbuild/rt.bat
@@ -30,7 +30,7 @@ set prefix=.\
set suffix=
set qmode=
set dashO=
-set tcltk=
+set tcltk=tcltk
:CheckOpts
if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
@@ -38,9 +38,9 @@ if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts
-PATH %PATH%;..\..\%tcltk%\bin
+PATH %PATH%;%~dp0..\..\%tcltk%\bin
set exe=%prefix%\python%suffix%
-set cmd=%exe% %dashO% -E ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
+set cmd=%exe% %dashO% -Wd -E -bb ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
if defined qmode goto Qmode
echo Deleting .pyc/.pyo files ...
diff --git a/PCbuild/ssl.vcproj b/PCbuild/ssl.vcproj
new file mode 100644
index 0000000000..ec2be304ee
--- /dev/null
+++ b/PCbuild/ssl.vcproj
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="ssl"
+ ProjectGUID="{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}"
+ RootNamespace="ssl"
+ Keyword="MakeFileProj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd_d.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGInstrument|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGInstrument|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGUpdate|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="PGUpdate|x64"
+ ConfigurationType="0"
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/PCbuild/vs9to8.py b/PCbuild/vs9to8.py
index bab3b6e13b..3b88a16c27 100644
--- a/PCbuild/vs9to8.py
+++ b/PCbuild/vs9to8.py
@@ -24,7 +24,7 @@ def vs9to8(src, dest):
# Bah. VS8.0 does not expand macros in file names.
# Replace them here.
- lines = lines.replace('$(sqlite3Dir)', '..\\..\\..\\sqlite-3.5.9')
+ lines = lines.replace('$(sqlite3Dir)', '..\\..\\..\\sqlite-3.6.21')
with open(destname, 'wb') as fout:
lines = lines.replace("\n", "\r\n").encode()
diff --git a/PCbuild/xxlimited.vcproj b/PCbuild/xxlimited.vcproj
new file mode 100644
index 0000000000..dc923e8e4d
--- /dev/null
+++ b/PCbuild/xxlimited.vcproj
@@ -0,0 +1,417 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="xxlimited"
+ ProjectGUID="{F749B822-B489-4CA5-A3AD-CE078F5F338A}"
+ RootNamespace="xxlimited"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets=".\pyd.vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32;_WINDLL;Py_LIMITED_API;$(NOINHERIT)"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib"
+ IgnoreDefaultLibraryNames="libc"
+ BaseAddress="0x1D110000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ ConfigurationType="2"
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib"
+ IgnoreDefaultLibraryNames="libc"
+ BaseAddress="0x1D110000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="PGInstrument|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="Py_LIMITED_API"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib"
+ IgnoreDefaultLibraryNames="libc"
+ BaseAddress="0x1D110000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="PGInstrument|x64"
+ ConfigurationType="2"
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib"
+ IgnoreDefaultLibraryNames="libc"
+ BaseAddress="0x1D110000"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="PGUpdate|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="Py_LIMITED_API"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib"
+ IgnoreDefaultLibraryNames="libc"
+ BaseAddress="0x1D110000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="PGUpdate|x64"
+ ConfigurationType="2"
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib"
+ IgnoreDefaultLibraryNames="libc"
+ BaseAddress="0x1D110000"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ >
+ <File
+ RelativePath="..\Modules\xxlimited.c"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Parser/Python.asdl b/Parser/Python.asdl
index 789e07bd3f..9407b2f186 100644
--- a/Parser/Python.asdl
+++ b/Parser/Python.asdl
@@ -17,7 +17,7 @@ module Python version "$Revision$"
expr? starargs,
expr? kwargs,
stmt* body,
- expr *decorator_list)
+ expr* decorator_list)
| Return(expr? value)
| Delete(expr* targets)
@@ -36,7 +36,7 @@ module Python version "$Revision$"
| Assert(expr test, expr? msg)
| Import(alias* names)
- | ImportFrom(identifier module, alias* names, int? level)
+ | ImportFrom(identifier? module, alias* names, int? level)
| Global(identifier* names)
| Nonlocal(identifier* names)
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 6df11f5ee2..d6555d6d72 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -376,6 +376,7 @@ class Obj2ModVisitor(PickleVisitor):
self.emit(format % error, 1, reflow=False)
if add_label:
self.emit("failed:", 1)
+ self.emit("Py_XDECREF(tmp);", 1)
self.emit("return 1;", 1)
self.emit("}", 0)
self.emit("", 0)
@@ -720,7 +721,7 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
}
PyTuple_SET_ITEM(fnames, i, field);
}
- result = PyObject_CallFunction((PyObject*)&PyType_Type, "U(O){sOss}",
+ result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
type, base, "_fields", fnames, "__module__", "_ast");
Py_DECREF(fnames);
return (PyTypeObject*)result;
@@ -730,8 +731,9 @@ static int add_attributes(PyTypeObject* type, char**attrs, int num_fields)
{
int i, result;
PyObject *s, *l = PyTuple_New(num_fields);
- if (!l) return 0;
- for(i = 0; i < num_fields; i++) {
+ if (!l)
+ return 0;
+ for (i = 0; i < num_fields; i++) {
s = PyUnicode_FromString(attrs[i]);
if (!s) {
Py_DECREF(l);
diff --git a/Parser/grammar.mak b/Parser/grammar.mak
deleted file mode 100644
index 55f028ffb8..0000000000
--- a/Parser/grammar.mak
+++ /dev/null
@@ -1,45 +0,0 @@
-# This manages to rebuild graminit.{h, c} under MSVC 6 (Windows), via
-#
-# nmake /f grammar.mak
-#
-# You may also need to copy python23.dll into this directory, or get
-# it on your search path.
-#
-# The intermediate files can be nuked afterwards:
-#
-# nmake /f grammar.mak clean
-#
-# I don't understand the maze of preprocessor #define's on Windows, and
-# as a result this requires linking with python23.lib, so it's of no use
-# for bootstrapping (the cause appears to be a useless-- in this
-# particular case --pragma in PC\pyconfig.h, which demands that
-# python23.lib get linked in).
-
-LIBS= ..\PCbuild\python25.lib
-
-CFLAGS= /I ..\Include /I ..\PC /D MS_NO_COREDLL /D PGEN /MD
-
-GRAMMAR_H= ..\Include\graminit.h
-GRAMMAR_C= ..\Python\graminit.c
-GRAMMAR_INPUT= ..\Grammar\Grammar
-
-PGEN= pgen.exe
-
-POBJS= acceler.obj grammar1.obj listnode.obj node.obj parser.obj \
- parsetok.obj tokenizer.obj bitset.obj metagrammar.obj
-
-PARSER_OBJS= $(POBJS) myreadline.obj
-
-PGOBJS= firstsets.obj grammar.obj pgen.obj printgrammar.obj pgenmain.obj
-
-PGENOBJS= $(POBJS) $(PGOBJS)
-
-$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-
-$(PGEN): $(PGENOBJS)
- $(CC) $(PGENOBJS) $(LIBS) /Fe$(PGEN)
-
-clean:
- del *.obj
- del $(PGEN)
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index 7166fc1d01..50802c3156 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -87,7 +87,7 @@ my_fgets(char *buf, int len, FILE *fp)
#endif
if (s < 0)
return 1;
- /* try again */
+ /* try again */
continue;
}
#endif
diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index 16cf5cbe82..7636a54bbd 100644
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -46,13 +46,14 @@ PyParser_ParseStringFlagsFilenameEx(const char *s, const char *filename,
perrdetail *err_ret, int *flags)
{
struct tok_state *tok;
+ int exec_input = start == file_input;
initerr(err_ret, filename);
if (*flags & PyPARSE_IGNORE_COOKIE)
- tok = PyTokenizer_FromUTF8(s);
+ tok = PyTokenizer_FromUTF8(s, exec_input);
else
- tok = PyTokenizer_FromString(s);
+ tok = PyTokenizer_FromString(s, exec_input);
if (tok == NULL) {
err_ret->error = PyErr_Occurred() ? E_DECODE : E_NOMEM;
return NULL;
@@ -240,16 +241,24 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
}
}
} else if (tok->encoding != NULL) {
+ /* 'nodes->n_str' uses PyObject_*, while 'tok->encoding' was
+ * allocated using PyMem_
+ */
node* r = PyNode_New(encoding_decl);
- if (!r) {
+ if (r)
+ r->n_str = PyObject_MALLOC(strlen(tok->encoding)+1);
+ if (!r || !r->n_str) {
err_ret->error = E_NOMEM;
+ if (r)
+ PyObject_FREE(r);
n = NULL;
goto done;
}
- r->n_str = tok->encoding;
+ strcpy(r->n_str, tok->encoding);
+ PyMem_FREE(tok->encoding);
+ tok->encoding = NULL;
r->n_nchildren = 1;
r->n_child = n;
- tok->encoding = NULL;
n = r;
}
diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c
index 88fa7f19b8..4b7b55a4f1 100644
--- a/Parser/pgenmain.c
+++ b/Parser/pgenmain.c
@@ -13,6 +13,8 @@
- check for duplicate definitions of names (instead of fatal err)
*/
+#define PGEN
+
#include "Python.h"
#include "pgenheaders.h"
#include "grammar.h"
diff --git a/Parser/printgrammar.c b/Parser/printgrammar.c
index 01f552f2d7..dd7e6ae2ef 100644
--- a/Parser/printgrammar.c
+++ b/Parser/printgrammar.c
@@ -1,6 +1,8 @@
/* Print a bunch of C initializers that represent a grammar */
+#define PGEN
+
#include "pgenheaders.h"
#include "grammar.h"
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index d985131219..5ba12a409d 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -119,6 +119,7 @@ tok_new(void)
tok->buf = tok->cur = tok->end = tok->inp = tok->start = NULL;
tok->done = E_OK;
tok->fp = NULL;
+ tok->input = NULL;
tok->tabsize = TABSIZE;
tok->indent = 0;
tok->indstack[0] = 0;
@@ -145,6 +146,17 @@ tok_new(void)
return tok;
}
+static char *
+new_string(const char *s, Py_ssize_t len)
+{
+ char* result = (char *)PyMem_MALLOC(len + 1);
+ if (result != NULL) {
+ memcpy(result, s, len);
+ result[len] = '\0';
+ }
+ return result;
+}
+
#ifdef PGEN
static char *
@@ -159,10 +171,10 @@ decoding_feof(struct tok_state *tok)
return feof(tok->fp);
}
-static const char *
-decode_str(const char *str, struct tok_state *tok)
+static char *
+decode_str(const char *str, int exec_input, struct tok_state *tok)
{
- return str;
+ return new_string(str, strlen(str));
}
#else /* PGEN */
@@ -177,16 +189,6 @@ error_ret(struct tok_state *tok) /* XXX */
return NULL; /* as if it were EOF */
}
-static char *
-new_string(const char *s, Py_ssize_t len)
-{
- char* result = (char *)PyMem_MALLOC(len + 1);
- if (result != NULL) {
- memcpy(result, s, len);
- result[len] = '\0';
- }
- return result;
-}
static char *
get_normal_name(char *s) /* for utf-8 and latin-1 */
@@ -243,7 +245,7 @@ get_coding_spec(const char *s, Py_ssize_t size)
} while (t[0] == '\x20' || t[0] == '\t');
begin = t;
- while (isalnum(Py_CHARMASK(t[0])) ||
+ while (Py_ISALNUM(t[0]) ||
t[0] == '-' || t[0] == '_' || t[0] == '.')
t++;
@@ -460,17 +462,20 @@ static int
fp_setreadl(struct tok_state *tok, const char* enc)
{
PyObject *readline = NULL, *stream = NULL, *io = NULL;
+ int fd;
io = PyImport_ImportModuleNoBlock("io");
if (io == NULL)
goto cleanup;
- if (tok->filename)
- stream = PyObject_CallMethod(io, "open", "ssis",
- tok->filename, "r", -1, enc);
- else
- stream = PyObject_CallMethod(io, "open", "isisOOO",
- fileno(tok->fp), "r", -1, enc, Py_None, Py_None, Py_False);
+ fd = fileno(tok->fp);
+ if (lseek(fd, 0, SEEK_SET) == (off_t)-1) {
+ PyErr_SetFromErrnoWithFilename(PyExc_OSError, NULL);
+ goto cleanup;
+ }
+
+ stream = PyObject_CallMethod(io, "open", "isisOOO",
+ fd, "r", -1, enc, Py_None, Py_None, Py_False);
if (stream == NULL)
goto cleanup;
@@ -540,6 +545,7 @@ decoding_fgets(char *s, int size, struct tok_state *tok)
{
char *line = NULL;
int badchar = 0;
+ PyObject *filename;
for (;;) {
if (tok->decoding_state == STATE_NORMAL) {
/* We already have a codec associated with
@@ -578,16 +584,21 @@ decoding_fgets(char *s, int size, struct tok_state *tok)
}
}
if (badchar) {
- char buf[500];
/* Need to add 1 to the line number, since this line
has not been counted, yet. */
- sprintf(buf,
- "Non-UTF-8 code starting with '\\x%.2x' "
- "in file %.200s on line %i, "
- "but no encoding declared; "
- "see http://python.org/dev/peps/pep-0263/ for details",
- badchar, tok->filename, tok->lineno + 1);
- PyErr_SetString(PyExc_SyntaxError, buf);
+ if (tok->filename != NULL)
+ filename = PyUnicode_DecodeFSDefault(tok->filename);
+ else
+ filename = PyUnicode_FromString("<file>");
+ if (filename != NULL) {
+ PyErr_Format(PyExc_SyntaxError,
+ "Non-UTF-8 code starting with '\\x%.2x' "
+ "in file %U on line %i, "
+ "but no encoding declared; "
+ "see http://python.org/dev/peps/pep-0263/ for details",
+ badchar, filename, tok->lineno + 1);
+ Py_DECREF(filename);
+ }
return error_ret(tok);
}
#endif
@@ -652,17 +663,62 @@ translate_into_utf8(const char* str, const char* enc) {
return utf8;
}
+
+static char *
+translate_newlines(const char *s, int exec_input, struct tok_state *tok) {
+ int skip_next_lf = 0, needed_length = strlen(s) + 2, final_length;
+ char *buf, *current;
+ char c = '\0';
+ buf = PyMem_MALLOC(needed_length);
+ if (buf == NULL) {
+ tok->done = E_NOMEM;
+ return NULL;
+ }
+ for (current = buf; *s; s++, current++) {
+ c = *s;
+ if (skip_next_lf) {
+ skip_next_lf = 0;
+ if (c == '\n') {
+ c = *++s;
+ if (!c)
+ break;
+ }
+ }
+ if (c == '\r') {
+ skip_next_lf = 1;
+ c = '\n';
+ }
+ *current = c;
+ }
+ /* If this is exec input, add a newline to the end of the string if
+ there isn't one already. */
+ if (exec_input && c != '\n') {
+ *current = '\n';
+ current++;
+ }
+ *current = '\0';
+ final_length = current - buf + 1;
+ if (final_length < needed_length && final_length)
+ /* should never fail */
+ buf = PyMem_REALLOC(buf, final_length);
+ return buf;
+}
+
/* Decode a byte string STR for use as the buffer of TOK.
Look for encoding declarations inside STR, and record them
inside TOK. */
static const char *
-decode_str(const char *str, struct tok_state *tok)
+decode_str(const char *input, int single, struct tok_state *tok)
{
PyObject* utf8 = NULL;
+ const char *str;
const char *s;
const char *newl[2] = {NULL, NULL};
int lineno = 0;
+ tok->input = str = translate_newlines(input, single, tok);
+ if (str == NULL)
+ return NULL;
tok->enc = NULL;
tok->str = str;
if (!check_bom(buf_getc, buf_ungetc, buf_setreadl, tok))
@@ -713,12 +769,12 @@ decode_str(const char *str, struct tok_state *tok)
/* Set up tokenizer for string */
struct tok_state *
-PyTokenizer_FromString(const char *str)
+PyTokenizer_FromString(const char *str, int exec_input)
{
struct tok_state *tok = tok_new();
if (tok == NULL)
return NULL;
- str = (char *)decode_str(str, tok);
+ str = (char *)decode_str(str, exec_input, tok);
if (str == NULL) {
PyTokenizer_Free(tok);
return NULL;
@@ -730,11 +786,18 @@ PyTokenizer_FromString(const char *str)
}
struct tok_state *
-PyTokenizer_FromUTF8(const char *str)
+PyTokenizer_FromUTF8(const char *str, int exec_input)
{
struct tok_state *tok = tok_new();
if (tok == NULL)
return NULL;
+#ifndef PGEN
+ tok->input = str = translate_newlines(str, exec_input, tok);
+#endif
+ if (str == NULL) {
+ PyTokenizer_Free(tok);
+ return NULL;
+ }
tok->decoding_state = STATE_RAW;
tok->read_coding_spec = 1;
tok->enc = NULL;
@@ -751,7 +814,6 @@ PyTokenizer_FromUTF8(const char *str)
return tok;
}
-
/* Set up tokenizer for file */
struct tok_state *
@@ -797,6 +859,8 @@ PyTokenizer_Free(struct tok_state *tok)
#endif
if (tok->fp != NULL && tok->buf != NULL)
PyMem_FREE(tok->buf);
+ if (tok->input)
+ PyMem_FREE((char *)tok->input);
PyMem_FREE(tok);
}
@@ -832,6 +896,13 @@ tok_nextc(register struct tok_state *tok)
if (tok->prompt != NULL) {
char *newtok = PyOS_Readline(stdin, stdout, tok->prompt);
#ifndef PGEN
+ if (newtok != NULL) {
+ char *translated = translate_newlines(newtok, 0, tok);
+ PyMem_FREE(newtok);
+ if (translated == NULL)
+ return EOF;
+ newtok = translated;
+ }
if (tok->encoding && newtok && *newtok) {
/* Recode to UTF-8 */
Py_ssize_t buflen;
@@ -1407,10 +1478,8 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
c = tok_nextc(tok);
if (c == '.')
goto fraction;
-#ifndef WITHOUT_COMPLEX
if (c == 'j' || c == 'J')
goto imaginary;
-#endif
if (c == 'x' || c == 'X') {
/* Hex */
@@ -1462,10 +1531,8 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
goto fraction;
else if (c == 'e' || c == 'E')
goto exponent;
-#ifndef WITHOUT_COMPLEX
else if (c == 'j' || c == 'J')
goto imaginary;
-#endif
else if (nonzero) {
tok->done = E_TOKEN;
tok_backup(tok, c);
@@ -1502,12 +1569,10 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
c = tok_nextc(tok);
} while (isdigit(c));
}
-#ifndef WITHOUT_COMPLEX
if (c == 'j' || c == 'J')
/* Imaginary part */
imaginary:
c = tok_nextc(tok);
-#endif
}
}
tok_backup(tok, c);
diff --git a/Parser/tokenizer.h b/Parser/tokenizer.h
index 6c1742f97d..2be3bf2e31 100644
--- a/Parser/tokenizer.h
+++ b/Parser/tokenizer.h
@@ -53,15 +53,16 @@ struct tok_state {
int cont_line; /* whether we are in a continuation line. */
const char* line_start; /* pointer to start of current line */
#ifndef PGEN
- PyObject *decoding_readline; /* codecs.open(...).readline */
+ PyObject *decoding_readline; /* open(...).readline */
PyObject *decoding_buffer;
#endif
const char* enc; /* Encoding for the current str. */
const char* str;
+ const char* input; /* Tokenizer's newline translated copy of the string. */
};
-extern struct tok_state *PyTokenizer_FromString(const char *);
-extern struct tok_state *PyTokenizer_FromUTF8(const char *);
+extern struct tok_state *PyTokenizer_FromString(const char *, int);
+extern struct tok_state *PyTokenizer_FromUTF8(const char *, int);
extern struct tok_state *PyTokenizer_FromFile(FILE *, char*,
char *, char *);
extern void PyTokenizer_Free(struct tok_state *);
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index efc69dcfec..2c09f96f0e 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -2,7 +2,7 @@
/*
- __version__ 67616.
+ __version__ 82163.
This module must be committed separately after each AST grammar change;
The __version__ number is set to the revision number of the commit
@@ -527,7 +527,7 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
}
PyTuple_SET_ITEM(fnames, i, field);
}
- result = PyObject_CallFunction((PyObject*)&PyType_Type, "U(O){sOss}",
+ result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
type, base, "_fields", fnames, "__module__", "_ast");
Py_DECREF(fnames);
return (PyTypeObject*)result;
@@ -537,8 +537,9 @@ static int add_attributes(PyTypeObject* type, char**attrs, int num_fields)
{
int i, result;
PyObject *s, *l = PyTuple_New(num_fields);
- if (!l) return 0;
- for(i = 0; i < num_fields; i++) {
+ if (!l)
+ return 0;
+ for (i = 0; i < num_fields; i++) {
s = PyUnicode_FromString(attrs[i]);
if (!s) {
Py_DECREF(l);
@@ -1332,11 +1333,6 @@ ImportFrom(identifier module, asdl_seq * names, int level, int lineno, int
col_offset, PyArena *arena)
{
stmt_ty p;
- if (!module) {
- PyErr_SetString(PyExc_ValueError,
- "field module is required for ImportFrom");
- return NULL;
- }
p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p));
if (!p)
return NULL;
@@ -3520,6 +3516,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
PyErr_Format(PyExc_TypeError, "expected some sort of mod, but got %R", obj);
failed:
+ Py_XDECREF(tmp);
return 1;
}
@@ -4544,8 +4541,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
Py_XDECREF(tmp);
tmp = NULL;
} else {
- PyErr_SetString(PyExc_TypeError, "required field \"module\" missing from ImportFrom");
- return 1;
+ module = NULL;
}
if (PyObject_HasAttrString(obj, "names")) {
int res;
@@ -4716,6 +4712,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
PyErr_Format(PyExc_TypeError, "expected some sort of stmt, but got %R", obj);
failed:
+ Py_XDECREF(tmp);
return 1;
}
@@ -5831,6 +5828,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
PyErr_Format(PyExc_TypeError, "expected some sort of expr, but got %R", obj);
failed:
+ Py_XDECREF(tmp);
return 1;
}
@@ -6011,6 +6009,7 @@ obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
PyErr_Format(PyExc_TypeError, "expected some sort of slice, but got %R", obj);
failed:
+ Py_XDECREF(tmp);
return 1;
}
@@ -6443,6 +6442,7 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
PyErr_Format(PyExc_TypeError, "expected some sort of excepthandler, but got %R", obj);
failed:
+ Py_XDECREF(tmp);
return 1;
}
@@ -6739,7 +6739,7 @@ PyInit__ast(void)
NULL;
if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)
return NULL;
- if (PyModule_AddStringConstant(m, "__version__", "67616") < 0)
+ if (PyModule_AddStringConstant(m, "__version__", "82163") < 0)
return NULL;
if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return
NULL;
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 543e0bb4ca..a797887b9c 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -251,7 +251,7 @@ show_warning(PyObject *filename, int lineno, PyObject *text, PyObject
name = PyObject_GetAttrString(category, "__name__");
if (name == NULL) /* XXX Can an object lack a '__name__' attribute? */
- return;
+ return;
f_stderr = PySys_GetObject("stderr");
if (f_stderr == NULL) {
@@ -461,7 +461,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
}
else {
globals = f->f_globals;
- *lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
+ *lineno = PyFrame_GetLineNumber(f);
}
*module = NULL;
@@ -498,23 +498,21 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
*filename = PyDict_GetItemString(globals, "__file__");
if (*filename != NULL) {
Py_ssize_t len = PyUnicode_GetSize(*filename);
- const char *file_str = _PyUnicode_AsString(*filename);
- if (file_str == NULL || (len < 0 && PyErr_Occurred()))
- goto handle_error;
+ Py_UNICODE *unicode = PyUnicode_AS_UNICODE(*filename);
/* if filename.lower().endswith((".pyc", ".pyo")): */
if (len >= 4 &&
- file_str[len-4] == '.' &&
- tolower(file_str[len-3]) == 'p' &&
- tolower(file_str[len-2]) == 'y' &&
- (tolower(file_str[len-1]) == 'c' ||
- tolower(file_str[len-1]) == 'o'))
+ unicode[len-4] == '.' &&
+ Py_UNICODE_TOLOWER(unicode[len-3]) == 'p' &&
+ Py_UNICODE_TOLOWER(unicode[len-2]) == 'y' &&
+ (Py_UNICODE_TOLOWER(unicode[len-1]) == 'c' ||
+ Py_UNICODE_TOLOWER(unicode[len-1]) == 'o'))
{
- *filename = PyUnicode_FromStringAndSize(file_str, len-1);
- if (*filename == NULL)
- goto handle_error;
- }
- else
+ *filename = PyUnicode_FromUnicode(unicode, len-1);
+ if (*filename == NULL)
+ goto handle_error;
+ }
+ else
Py_INCREF(*filename);
}
else {
@@ -712,19 +710,17 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds)
/* Function to issue a warning message; may raise an exception. */
-int
-PyErr_WarnEx(PyObject *category, const char *text, Py_ssize_t stack_level)
+
+static int
+warn_unicode(PyObject *category, PyObject *message,
+ Py_ssize_t stack_level)
{
PyObject *res;
- PyObject *message = PyUnicode_FromString(text);
- if (message == NULL)
- return -1;
if (category == NULL)
category = PyExc_RuntimeWarning;
res = do_warn(message, category, stack_level);
- Py_DECREF(message);
if (res == NULL)
return -1;
Py_DECREF(res);
@@ -732,6 +728,42 @@ PyErr_WarnEx(PyObject *category, const char *text, Py_ssize_t stack_level)
return 0;
}
+int
+PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level,
+ const char *format, ...)
+{
+ int ret;
+ PyObject *message;
+ va_list vargs;
+
+#ifdef HAVE_STDARG_PROTOTYPES
+ va_start(vargs, format);
+#else
+ va_start(vargs);
+#endif
+ message = PyUnicode_FromFormatV(format, vargs);
+ if (message != NULL) {
+ ret = warn_unicode(category, message, stack_level);
+ Py_DECREF(message);
+ }
+ else
+ ret = -1;
+ va_end(vargs);
+ return ret;
+}
+
+int
+PyErr_WarnEx(PyObject *category, const char *text, Py_ssize_t stack_level)
+{
+ int ret;
+ PyObject *message = PyUnicode_FromString(text);
+ if (message == NULL)
+ return -1;
+ ret = warn_unicode(category, message, stack_level);
+ Py_DECREF(message);
+ return ret;
+}
+
/* PyErr_Warn is only for backwards compatibility and will be removed.
Use PyErr_WarnEx instead. */
@@ -751,7 +783,7 @@ PyErr_WarnExplicit(PyObject *category, const char *text,
{
PyObject *res;
PyObject *message = PyUnicode_FromString(text);
- PyObject *filename = PyUnicode_FromString(filename_str);
+ PyObject *filename = PyUnicode_DecodeFSDefault(filename_str);
PyObject *module = NULL;
int ret = -1;
@@ -803,6 +835,7 @@ create_filter(PyObject *category, const char *action)
static PyObject *ignore_str = NULL;
static PyObject *error_str = NULL;
static PyObject *default_str = NULL;
+ static PyObject *always_str = NULL;
PyObject *action_obj = NULL;
PyObject *lineno, *result;
@@ -830,6 +863,14 @@ create_filter(PyObject *category, const char *action)
}
action_obj = default_str;
}
+ else if (!strcmp(action, "always")) {
+ if (always_str == NULL) {
+ always_str = PyUnicode_InternFromString("always");
+ if (always_str == NULL)
+ return NULL;
+ }
+ action_obj = always_str;
+ }
else {
Py_FatalError("unknown action");
}
@@ -846,28 +887,42 @@ create_filter(PyObject *category, const char *action)
static PyObject *
init_filters(void)
{
- PyObject *filters = PyList_New(3);
- const char *bytes_action;
+ /* Don't silence DeprecationWarning if -3 was used. */
+ PyObject *filters = PyList_New(5);
+ unsigned int pos = 0; /* Post-incremented in each use. */
+ unsigned int x;
+ const char *bytes_action, *resource_action;
+
if (filters == NULL)
return NULL;
- PyList_SET_ITEM(filters, 0,
+ PyList_SET_ITEM(filters, pos++,
+ create_filter(PyExc_DeprecationWarning, "ignore"));
+ PyList_SET_ITEM(filters, pos++,
create_filter(PyExc_PendingDeprecationWarning, "ignore"));
- PyList_SET_ITEM(filters, 1, create_filter(PyExc_ImportWarning, "ignore"));
+ PyList_SET_ITEM(filters, pos++,
+ create_filter(PyExc_ImportWarning, "ignore"));
if (Py_BytesWarningFlag > 1)
bytes_action = "error";
else if (Py_BytesWarningFlag)
bytes_action = "default";
else
bytes_action = "ignore";
- PyList_SET_ITEM(filters, 2, create_filter(PyExc_BytesWarning,
+ PyList_SET_ITEM(filters, pos++, create_filter(PyExc_BytesWarning,
bytes_action));
-
- if (PyList_GET_ITEM(filters, 0) == NULL ||
- PyList_GET_ITEM(filters, 1) == NULL ||
- PyList_GET_ITEM(filters, 2) == NULL) {
- Py_DECREF(filters);
- return NULL;
+ /* resource usage warnings are enabled by default in pydebug mode */
+#ifdef Py_DEBUG
+ resource_action = "always";
+#else
+ resource_action = "ignore";
+#endif
+ PyList_SET_ITEM(filters, pos++, create_filter(PyExc_ResourceWarning,
+ resource_action));
+ for (x = 0; x < pos; x += 1) {
+ if (PyList_GET_ITEM(filters, x) == NULL) {
+ Py_DECREF(filters);
+ return NULL;
+ }
}
return filters;
@@ -906,13 +961,13 @@ _PyWarnings_Init(void)
if (_once_registry == NULL)
return NULL;
Py_INCREF(_once_registry);
- if (PyModule_AddObject(m, "once_registry", _once_registry) < 0)
+ if (PyModule_AddObject(m, "_onceregistry", _once_registry) < 0)
return NULL;
_default_action = PyUnicode_FromString("default");
if (_default_action == NULL)
return NULL;
- if (PyModule_AddObject(m, "default_action", _default_action) < 0)
+ if (PyModule_AddObject(m, "_defaultaction", _default_action) < 0)
return NULL;
return m;
}
diff --git a/Python/ast.c b/Python/ast.c
index d97e9518ce..2ee2186198 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -7,7 +7,6 @@
#include "Python-ast.h"
#include "grammar.h"
#include "node.h"
-#include "pyarena.h"
#include "ast.h"
#include "token.h"
#include "parsetok.h"
@@ -90,7 +89,7 @@ new_identifier(const char* n, PyArena *arena)
static int
ast_error(const node *n, const char *errstr)
{
- PyObject *u = Py_BuildValue("zi", errstr, LINENO(n));
+ PyObject *u = Py_BuildValue("zii", errstr, LINENO(n), n->n_col_offset);
if (!u)
return 0;
PyErr_SetObject(PyExc_SyntaxError, u);
@@ -101,7 +100,7 @@ ast_error(const node *n, const char *errstr)
static void
ast_error_finish(const char *filename)
{
- PyObject *type, *value, *tback, *errstr, *loc, *tmp;
+ PyObject *type, *value, *tback, *errstr, *offset, *loc, *tmp;
PyObject *filename_obj;
long lineno;
@@ -119,6 +118,11 @@ ast_error_finish(const char *filename)
Py_DECREF(errstr);
return;
}
+ offset = PyTuple_GetItem(value, 2);
+ if (!offset) {
+ Py_DECREF(errstr);
+ return;
+ }
Py_DECREF(value);
loc = PyErr_ProgramText(filename, lineno);
@@ -133,7 +137,7 @@ ast_error_finish(const char *filename)
filename_obj = Py_None;
}
if (filename_obj != NULL)
- tmp = Py_BuildValue("(NlOO)", filename_obj, lineno, Py_None, loc);
+ tmp = Py_BuildValue("(NlOO)", filename_obj, lineno, offset, loc);
else
tmp = NULL;
Py_DECREF(loc);
@@ -367,19 +371,24 @@ static const char* FORBIDDEN[] = {
"None",
"True",
"False",
- "__debug__",
NULL,
};
static int
-forbidden_name(expr_ty e, const node *n)
+forbidden_name(identifier name, const node *n, int full_checks)
{
- const char **p;
- assert(PyUnicode_Check(e->v.Name.id));
- for (p = FORBIDDEN; *p; p++) {
- if (PyUnicode_CompareWithASCIIString(e->v.Name.id, *p) == 0) {
- ast_error(n, "assignment to keyword");
- return 1;
+ assert(PyUnicode_Check(name));
+ if (PyUnicode_CompareWithASCIIString(name, "__debug__") == 0) {
+ ast_error(n, "assignment to keyword");
+ return 1;
+ }
+ if (full_checks) {
+ const char **p;
+ for (p = FORBIDDEN; *p; p++) {
+ if (PyUnicode_CompareWithASCIIString(name, *p) == 0) {
+ ast_error(n, "assignment to keyword");
+ return 1;
+ }
}
}
return 0;
@@ -413,6 +422,8 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n)
switch (e->kind) {
case Attribute_kind:
e->v.Attribute.ctx = ctx;
+ if (ctx == Store && forbidden_name(e->v.Attribute.attr, n, 1))
+ return 0;
break;
case Subscript_kind:
e->v.Subscript.ctx = ctx;
@@ -424,7 +435,7 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n)
break;
case Name_kind:
if (ctx == Store) {
- if (forbidden_name(e, n))
+ if (forbidden_name(e->v.Name.id, n, 1))
return 0; /* forbidden_name() calls ast_error() */
}
e->v.Name.ctx = ctx;
@@ -434,10 +445,13 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n)
s = e->v.List.elts;
break;
case Tuple_kind:
- if (asdl_seq_LEN(e->v.Tuple.elts) == 0)
- return ast_error(n, "can't assign to ()");
- e->v.Tuple.ctx = ctx;
- s = e->v.Tuple.elts;
+ if (asdl_seq_LEN(e->v.Tuple.elts)) {
+ e->v.Tuple.ctx = ctx;
+ s = e->v.Tuple.elts;
+ }
+ else {
+ expr_name = "()";
+ }
break;
case Lambda_kind:
expr_name = "lambda";
@@ -604,20 +618,23 @@ ast_for_comp_op(struct compiling *c, const node *n)
static asdl_seq *
seq_for_testlist(struct compiling *c, const node *n)
{
- /* testlist: test (',' test)* [','] */
+ /* testlist: test (',' test)* [',']
+ testlist_star_expr: test|star_expr (',' test|star_expr)* [',']
+ */
asdl_seq *seq;
expr_ty expression;
int i;
- assert(TYPE(n) == testlist || TYPE(n) == testlist_comp);
+ assert(TYPE(n) == testlist || TYPE(n) == testlist_star_expr || TYPE(n) == testlist_comp);
seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
if (!seq)
return NULL;
for (i = 0; i < NCH(n); i += 2) {
- assert(TYPE(CHILD(n, i)) == test || TYPE(CHILD(n, i)) == test_nocond);
+ const node *ch = CHILD(n, i);
+ assert(TYPE(ch) == test || TYPE(ch) == test_nocond || TYPE(ch) == star_expr);
- expression = ast_for_expr(c, CHILD(n, i));
+ expression = ast_for_expr(c, ch);
if (!expression)
return NULL;
@@ -639,6 +656,8 @@ compiler_arg(struct compiling *c, const node *n)
name = NEW_IDENTIFIER(ch);
if (!name)
return NULL;
+ if (forbidden_name(name, ch, 0))
+ return NULL;
if (NCH(n) == 3 && TYPE(CHILD(n, 1)) == COLON) {
annotation = ast_for_expr(c, CHILD(n, 2));
@@ -705,6 +724,8 @@ handle_keywordonly_args(struct compiling *c, const node *n, int start,
argname = NEW_IDENTIFIER(ch);
if (!argname)
goto error;
+ if (forbidden_name(argname, ch, 0))
+ goto error;
arg = arg(argname, annotation, c->c_arena);
if (!arg)
goto error;
@@ -863,6 +884,8 @@ ast_for_arguments(struct compiling *c, const node *n)
vararg = NEW_IDENTIFIER(CHILD(ch, 0));
if (!vararg)
return NULL;
+ if (forbidden_name(vararg, CHILD(ch, 0), 0))
+ return NULL;
if (NCH(ch) > 1) {
/* there is an annotation on the vararg */
varargannotation = ast_for_expr(c, CHILD(ch, 2));
@@ -892,6 +915,8 @@ ast_for_arguments(struct compiling *c, const node *n)
if (!kwargannotation)
return NULL;
}
+ if (forbidden_name(kwarg, CHILD(ch, 0), 0))
+ return NULL;
i += 3;
break;
default:
@@ -1009,6 +1034,8 @@ ast_for_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
name = NEW_IDENTIFIER(CHILD(n, name_i));
if (!name)
return NULL;
+ if (forbidden_name(name, CHILD(n, name_i), 0))
+ return NULL;
args = ast_for_arguments(c, CHILD(n, name_i + 1));
if (!args)
return NULL;
@@ -1183,7 +1210,7 @@ ast_for_comprehension(struct compiling *c, const node *n)
for (i = 0; i < n_fors; i++) {
comprehension_ty comp;
asdl_seq *t;
- expr_ty expression;
+ expr_ty expression, first;
node *for_ch;
REQ(n, comp_for);
@@ -1198,14 +1225,13 @@ ast_for_comprehension(struct compiling *c, const node *n)
/* Check the # of children rather than the length of t, since
(x for x, in ...) has 1 element in t, but still requires a Tuple. */
+ first = (expr_ty)asdl_seq_GET(t, 0);
if (NCH(for_ch) == 1)
- comp = comprehension((expr_ty)asdl_seq_GET(t, 0), expression,
- NULL, c->c_arena);
+ comp = comprehension(first, expression, NULL, c->c_arena);
else
- comp = comprehension(Tuple(t, Store, LINENO(n), n->n_col_offset,
- c->c_arena),
- expression, NULL, c->c_arena);
-
+ comp = comprehension(Tuple(t, Store, first->lineno, first->col_offset,
+ c->c_arena),
+ expression, NULL, c->c_arena);
if (!comp)
return NULL;
@@ -1285,7 +1311,6 @@ ast_for_dictcomp(struct compiling *c, const node *n)
key = ast_for_expr(c, CHILD(n, 0));
if (!key)
return NULL;
-
value = ast_for_expr(c, CHILD(n, 2));
if (!value)
return NULL;
@@ -1524,14 +1549,7 @@ ast_for_slice(struct compiling *c, const node *n)
ch = CHILD(n, NCH(n) - 1);
if (TYPE(ch) == sliceop) {
- if (NCH(ch) == 1) {
- /* No expression, so step is None */
- ch = CHILD(ch, 0);
- step = Name(new_identifier("None", c->c_arena), Load,
- LINENO(ch), ch->n_col_offset, c->c_arena);
- if (!step)
- return NULL;
- } else {
+ if (NCH(ch) != 1) {
ch = CHILD(ch, 1);
if (TYPE(ch) == test) {
step = ast_for_expr(c, ch);
@@ -1675,34 +1693,8 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr)
static expr_ty
ast_for_factor(struct compiling *c, const node *n)
{
- node *pfactor, *ppower, *patom, *pnum;
expr_ty expression;
- /* If the unary - operator is applied to a constant, don't generate
- a UNARY_NEGATIVE opcode. Just store the approriate value as a
- constant. The peephole optimizer already does something like
- this but it doesn't handle the case where the constant is
- (sys.maxint - 1). In that case, we want a PyIntObject, not a
- PyLongObject.
- */
- if (TYPE(CHILD(n, 0)) == MINUS
- && NCH(n) == 2
- && TYPE((pfactor = CHILD(n, 1))) == factor
- && NCH(pfactor) == 1
- && TYPE((ppower = CHILD(pfactor, 0))) == power
- && NCH(ppower) == 1
- && TYPE((patom = CHILD(ppower, 0))) == atom
- && TYPE((pnum = CHILD(patom, 0))) == NUMBER) {
- char *s = PyObject_MALLOC(strlen(STR(pnum)) + 2);
- if (s == NULL)
- return NULL;
- s[0] = '-';
- strcpy(s + 1, STR(pnum));
- PyObject_FREE(STR(pnum));
- STR(pnum) = s;
- return ast_for_atom(c, patom);
- }
-
expression = ast_for_expr(c, CHILD(n, 1));
if (!expression)
return NULL;
@@ -1886,10 +1878,7 @@ ast_for_expr(struct compiling *c, const node *n)
break;
case star_expr:
- if (TYPE(CHILD(n, 0)) == STAR) {
- return ast_for_starred(c, n);
- }
- /* Fallthrough */
+ return ast_for_starred(c, n);
/* The next five cases all handle BinOps. The main body of code
is the same in each case, but the switch turned inside out to
reuse the code for each type of operator.
@@ -2025,7 +2014,7 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
} else if (e->kind != Name_kind) {
ast_error(CHILD(ch, 0), "keyword can't be an expression");
return NULL;
- } else if (forbidden_name(e, ch)) {
+ } else if (forbidden_name(e->v.Name.id, ch, 1)) {
return NULL;
}
key = e->v.Name.id;
@@ -2067,7 +2056,6 @@ ast_for_testlist(struct compiling *c, const node* n)
{
/* testlist_comp: test (comp_for | (',' test)* [',']) */
/* testlist: test (',' test)* [','] */
- /* testlist1: test (',' test)* */
assert(NCH(n) > 0);
if (TYPE(n) == testlist_comp) {
if (NCH(n) > 1)
@@ -2075,7 +2063,7 @@ ast_for_testlist(struct compiling *c, const node* n)
}
else {
assert(TYPE(n) == testlist ||
- TYPE(n) == testlist1);
+ TYPE(n) == testlist_star_expr);
}
if (NCH(n) == 1)
return ast_for_expr(c, CHILD(n, 0));
@@ -2091,9 +2079,9 @@ static stmt_ty
ast_for_expr_stmt(struct compiling *c, const node *n)
{
REQ(n, expr_stmt);
- /* expr_stmt: testlist (augassign (yield_expr|testlist)
+ /* expr_stmt: testlist_star_expr (augassign (yield_expr|testlist)
| ('=' (yield_expr|testlist))*)
- testlist: test (',' test)* [',']
+ testlist_star_expr: (test|star_expr) (',' test|star_expr)* [',']
augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^='
| '<<=' | '>>=' | '**=' | '//='
test: ... here starts the operator precendence dance
@@ -2173,7 +2161,7 @@ ast_for_expr_stmt(struct compiling *c, const node *n)
asdl_seq_SET(targets, i / 2, e);
}
value = CHILD(n, NCH(n) - 1);
- if (TYPE(value) == testlist)
+ if (TYPE(value) == testlist_star_expr)
expression = ast_for_testlist(c, value);
else
expression = ast_for_expr(c, value);
@@ -2183,6 +2171,7 @@ ast_for_expr_stmt(struct compiling *c, const node *n)
}
}
+
static asdl_seq *
ast_for_exprlist(struct compiling *c, const node *n, expr_context_ty context)
{
@@ -2283,49 +2272,64 @@ ast_for_flow_stmt(struct compiling *c, const node *n)
}
static alias_ty
-alias_for_import_name(struct compiling *c, const node *n)
+alias_for_import_name(struct compiling *c, const node *n, int store)
{
/*
import_as_name: NAME ['as' NAME]
dotted_as_name: dotted_name ['as' NAME]
dotted_name: NAME ('.' NAME)*
*/
- PyObject *str, *name;
+ identifier str, name;
loop:
switch (TYPE(n)) {
- case import_as_name:
+ case import_as_name: {
+ node *name_node = CHILD(n, 0);
str = NULL;
+ name = NEW_IDENTIFIER(name_node);
+ if (!name)
+ return NULL;
if (NCH(n) == 3) {
- str = NEW_IDENTIFIER(CHILD(n, 2));
+ node *str_node = CHILD(n, 2);
+ str = NEW_IDENTIFIER(str_node);
if (!str)
return NULL;
+ if (store && forbidden_name(str, str_node, 0))
+ return NULL;
+ }
+ else {
+ if (forbidden_name(name, name_node, 0))
+ return NULL;
}
- name = NEW_IDENTIFIER(CHILD(n, 0));
- if (!name)
- return NULL;
return alias(name, str, c->c_arena);
+ }
case dotted_as_name:
if (NCH(n) == 1) {
n = CHILD(n, 0);
goto loop;
}
else {
- alias_ty a = alias_for_import_name(c, CHILD(n, 0));
+ node *asname_node = CHILD(n, 2);
+ alias_ty a = alias_for_import_name(c, CHILD(n, 0), 0);
if (!a)
return NULL;
assert(!a->asname);
- a->asname = NEW_IDENTIFIER(CHILD(n, 2));
+ a->asname = NEW_IDENTIFIER(asname_node);
if (!a->asname)
return NULL;
+ if (forbidden_name(a->asname, asname_node, 0))
+ return NULL;
return a;
}
break;
case dotted_name:
if (NCH(n) == 1) {
- name = NEW_IDENTIFIER(CHILD(n, 0));
+ node *name_node = CHILD(n, 0);
+ name = NEW_IDENTIFIER(name_node);
if (!name)
return NULL;
+ if (store && forbidden_name(name, name_node, 0))
+ return NULL;
return alias(name, NULL, c->c_arena);
}
else {
@@ -2405,7 +2409,7 @@ ast_for_import_stmt(struct compiling *c, const node *n)
if (!aliases)
return NULL;
for (i = 0; i < NCH(n); i += 2) {
- alias_ty import_alias = alias_for_import_name(c, CHILD(n, i));
+ alias_ty import_alias = alias_for_import_name(c, CHILD(n, i), 1);
if (!import_alias)
return NULL;
asdl_seq_SET(aliases, i / 2, import_alias);
@@ -2416,13 +2420,15 @@ ast_for_import_stmt(struct compiling *c, const node *n)
int n_children;
int idx, ndots = 0;
alias_ty mod = NULL;
- identifier modname;
+ identifier modname = NULL;
/* Count the number of dots (for relative imports) and check for the
optional module name */
for (idx = 1; idx < NCH(n); idx++) {
if (TYPE(CHILD(n, idx)) == dotted_name) {
- mod = alias_for_import_name(c, CHILD(n, idx));
+ mod = alias_for_import_name(c, CHILD(n, idx), 0);
+ if (!mod)
+ return NULL;
idx++;
break;
} else if (TYPE(CHILD(n, idx)) == ELLIPSIS) {
@@ -2467,14 +2473,14 @@ ast_for_import_stmt(struct compiling *c, const node *n)
/* handle "from ... import *" special b/c there's no children */
if (TYPE(n) == STAR) {
- alias_ty import_alias = alias_for_import_name(c, n);
+ alias_ty import_alias = alias_for_import_name(c, n, 1);
if (!import_alias)
return NULL;
asdl_seq_SET(aliases, 0, import_alias);
}
else {
for (i = 0; i < NCH(n); i += 2) {
- alias_ty import_alias = alias_for_import_name(c, CHILD(n, i));
+ alias_ty import_alias = alias_for_import_name(c, CHILD(n, i), 1);
if (!import_alias)
return NULL;
asdl_seq_SET(aliases, i / 2, import_alias);
@@ -2482,8 +2488,6 @@ ast_for_import_stmt(struct compiling *c, const node *n)
}
if (mod != NULL)
modname = mod->name;
- else
- modname = new_identifier("", c->c_arena);
return ImportFrom(modname, aliases, ndots, lineno, col_offset,
c->c_arena);
}
@@ -2796,7 +2800,7 @@ ast_for_for_stmt(struct compiling *c, const node *n)
{
asdl_seq *_target, *seq = NULL, *suite_seq;
expr_ty expression;
- expr_ty target;
+ expr_ty target, first;
const node *node_target;
/* for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] */
REQ(n, for_stmt);
@@ -2813,10 +2817,11 @@ ast_for_for_stmt(struct compiling *c, const node *n)
return NULL;
/* Check the # of children rather than the length of _target, since
for x, in ... has 1 element in _target, but still requires a Tuple. */
+ first = (expr_ty)asdl_seq_GET(_target, 0);
if (NCH(node_target) == 1)
- target = (expr_ty)asdl_seq_GET(_target, 0);
+ target = first;
else
- target = Tuple(_target, Store, LINENO(n), n->n_col_offset, c->c_arena);
+ target = Tuple(_target, Store, first->lineno, first->col_offset, c->c_arena);
expression = ast_for_testlist(c, CHILD(n, 3));
if (!expression)
@@ -2864,6 +2869,8 @@ ast_for_except_clause(struct compiling *c, const node *exc, node *body)
identifier e = NEW_IDENTIFIER(CHILD(exc, 3));
if (!e)
return NULL;
+ if (forbidden_name(e, CHILD(exc, 3), 0))
+ return NULL;
expression = ast_for_expr(c, CHILD(exc, 1));
if (!expression)
return NULL;
@@ -3036,6 +3043,8 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
classname = NEW_IDENTIFIER(CHILD(n, 1));
if (!classname)
return NULL;
+ if (forbidden_name(classname, CHILD(n, 3), 0))
+ return NULL;
return ClassDef(classname, NULL, NULL, NULL, NULL, s, decorator_seq,
LINENO(n), n->n_col_offset, c->c_arena);
}
@@ -3047,6 +3056,8 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
classname = NEW_IDENTIFIER(CHILD(n, 1));
if (!classname)
return NULL;
+ if (forbidden_name(classname, CHILD(n, 3), 0))
+ return NULL;
return ClassDef(classname, NULL, NULL, NULL, NULL, s, decorator_seq,
LINENO(n), n->n_col_offset, c->c_arena);
}
@@ -3070,6 +3081,8 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
classname = NEW_IDENTIFIER(CHILD(n, 1));
if (!classname)
return NULL;
+ if (forbidden_name(classname, CHILD(n, 1), 0))
+ return NULL;
return ClassDef(classname, call->v.Call.args, call->v.Call.keywords,
call->v.Call.starargs, call->v.Call.kwargs, s,
@@ -3154,17 +3167,13 @@ parsenumber(struct compiling *c, const char *s)
const char *end;
long x;
double dx;
-#ifndef WITHOUT_COMPLEX
Py_complex compl;
int imflag;
-#endif
assert(s != NULL);
errno = 0;
end = s + strlen(s) - 1;
-#ifndef WITHOUT_COMPLEX
imflag = *end == 'j' || *end == 'J';
-#endif
if (s[0] == '0') {
x = (long) PyOS_strtoul((char *)s, (char **)&end, 0);
if (x < 0 && errno == 0) {
@@ -3181,7 +3190,6 @@ parsenumber(struct compiling *c, const char *s)
return PyLong_FromLong(x);
}
/* XXX Huge floats may silently fail */
-#ifndef WITHOUT_COMPLEX
if (imflag) {
compl.real = 0.;
compl.imag = PyOS_string_to_double(s, (char **)&end, NULL);
@@ -3190,7 +3198,6 @@ parsenumber(struct compiling *c, const char *s)
return PyComplex_FromCComplex(compl);
}
else
-#endif
{
dx = PyOS_string_to_double(s, NULL, NULL);
if (dx == -1.0 && PyErr_Occurred())
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 3e44aa0566..6258167b60 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -5,10 +5,13 @@
#include "node.h"
#include "code.h"
-#include "eval.h"
#include <ctype.h>
+#ifdef HAVE_LANGINFO_H
+#include <langinfo.h> /* CODESET */
+#endif
+
/* The default encoding used by the platform file system APIs
Can remain NULL for all platforms that don't have such a concept
@@ -21,34 +24,14 @@ int Py_HasFileSystemDefaultEncoding = 1;
#elif defined(__APPLE__)
const char *Py_FileSystemDefaultEncoding = "utf-8";
int Py_HasFileSystemDefaultEncoding = 1;
-#else
-const char *Py_FileSystemDefaultEncoding = NULL; /* use default */
+#elif defined(HAVE_LANGINFO_H) && defined(CODESET)
+const char *Py_FileSystemDefaultEncoding = NULL; /* set by initfsencoding() */
int Py_HasFileSystemDefaultEncoding = 0;
+#else
+const char *Py_FileSystemDefaultEncoding = "utf-8";
+int Py_HasFileSystemDefaultEncoding = 1;
#endif
-int
-_Py_SetFileSystemEncoding(PyObject *s)
-{
- PyObject *defenc, *codec;
- if (!PyUnicode_Check(s)) {
- PyErr_BadInternalCall();
- return -1;
- }
- defenc = _PyUnicode_AsDefaultEncodedString(s, NULL);
- if (!defenc)
- return -1;
- codec = _PyCodec_Lookup(PyBytes_AsString(defenc));
- if (codec == NULL)
- return -1;
- Py_DECREF(codec);
- if (!Py_HasFileSystemDefaultEncoding && Py_FileSystemDefaultEncoding)
- /* A file system encoding was set at run-time */
- free((char*)Py_FileSystemDefaultEncoding);
- Py_FileSystemDefaultEncoding = strdup(PyBytes_AsString(defenc));
- Py_HasFileSystemDefaultEncoding = 0;
- return 0;
-}
-
static PyObject *
builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
{
@@ -189,8 +172,12 @@ builtin___import__(PyObject *self, PyObject *args, PyObject *kwds)
PyDoc_STRVAR(import_doc,
"__import__(name, globals={}, locals={}, fromlist=[], level=-1) -> module\n\
\n\
-Import a module. The globals are only used to determine the context;\n\
-they are not modified. The locals are currently unused. The fromlist\n\
+Import a module. Because this function is meant for use by the Python\n\
+interpreter and not for general use it is better to use\n\
+importlib.import_module() to programmatically import a module.\n\
+\n\
+The globals argument is only used to determine the context;\n\
+they are not modified. The locals argument is unused. The fromlist\n\
should be a list of names to emulate ``from name import ...'', or an\n\
empty list to emulate ``import name''.\n\
When importing a module from a package, note that __import__('A.B', ...)\n\
@@ -320,7 +307,21 @@ builtin_bin(PyObject *self, PyObject *v)
PyDoc_STRVAR(bin_doc,
"bin(number) -> string\n\
\n\
-Return the binary representation of an integer or long integer.");
+Return the binary representation of an integer.");
+
+
+static PyObject *
+builtin_callable(PyObject *self, PyObject *v)
+{
+ return PyBool_FromLong((long)PyCallable_Check(v));
+}
+
+PyDoc_STRVAR(callable_doc,
+"callable(object) -> bool\n\
+\n\
+Return whether the object is callable (i.e., some kind of function).\n\
+Note that classes are callable, as are instances of classes with a\n\
+__call__() method.");
typedef struct {
@@ -542,19 +543,20 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
int mode = -1;
int dont_inherit = 0;
int supplied_flags = 0;
+ int optimize = -1;
int is_ast;
PyCompilerFlags cf;
PyObject *cmd;
static char *kwlist[] = {"source", "filename", "mode", "flags",
- "dont_inherit", NULL};
+ "dont_inherit", "optimize", NULL};
int start[] = {Py_file_input, Py_eval_input, Py_single_input};
PyObject *result;
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&s|ii:compile", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&s|iii:compile", kwlist,
&cmd,
PyUnicode_FSConverter, &filename_obj,
&startstr, &supplied_flags,
- &dont_inherit))
+ &dont_inherit, &optimize))
return NULL;
filename = PyBytes_AS_STRING(filename_obj);
@@ -569,6 +571,12 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
}
/* XXX Warn if (supplied_flags & PyCF_MASK_OBSOLETE) != 0? */
+ if (optimize < -1 || optimize > 2) {
+ PyErr_SetString(PyExc_ValueError,
+ "compile(): invalid optimize value");
+ goto error;
+ }
+
if (!dont_inherit) {
PyEval_MergeCompilerFlags(&cf);
}
@@ -603,8 +611,8 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
PyArena_Free(arena);
goto error;
}
- result = (PyObject*)PyAST_Compile(mod, filename,
- &cf, arena);
+ result = (PyObject*)PyAST_CompileEx(mod, filename,
+ &cf, optimize, arena);
PyArena_Free(arena);
}
goto finally;
@@ -614,7 +622,7 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
if (str == NULL)
goto error;
- result = Py_CompileStringFlags(str, filename, start[mode], &cf);
+ result = Py_CompileStringExFlags(str, filename, start[mode], &cf, optimize);
goto finally;
error:
@@ -726,7 +734,7 @@ builtin_eval(PyObject *self, PyObject *args)
"code object passed to eval() may not contain free variables");
return NULL;
}
- return PyEval_EvalCode((PyCodeObject *) cmd, globals, locals);
+ return PyEval_EvalCode(cmd, globals, locals);
}
cf.cf_flags = PyCF_SOURCE_IS_UTF8;
@@ -802,7 +810,7 @@ builtin_exec(PyObject *self, PyObject *args)
"contain free variables");
return NULL;
}
- v = PyEval_EvalCode((PyCodeObject *) prog, globals, locals);
+ v = PyEval_EvalCode(prog, globals, locals);
}
else {
char *str;
@@ -897,24 +905,21 @@ builtin_hasattr(PyObject *self, PyObject *args)
}
v = PyObject_GetAttr(v, name);
if (v == NULL) {
- if (!PyErr_ExceptionMatches(PyExc_Exception))
- return NULL;
- else {
+ if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
PyErr_Clear();
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
}
+ return NULL;
}
Py_DECREF(v);
- Py_INCREF(Py_True);
- return Py_True;
+ Py_RETURN_TRUE;
}
PyDoc_STRVAR(hasattr_doc,
"hasattr(object, name) -> bool\n\
\n\
Return whether the object has an attribute with the given name.\n\
-(This is done by calling getattr(object, name) and catching exceptions.)");
+(This is done by calling getattr(object, name) and catching AttributeError.)");
static PyObject *
@@ -1163,12 +1168,12 @@ Delete a named attribute on an object; delattr(x, 'y') is equivalent to\n\
static PyObject *
builtin_hash(PyObject *self, PyObject *v)
{
- long x;
+ Py_hash_t x;
x = PyObject_Hash(v);
if (x == -1)
return NULL;
- return PyLong_FromLong(x);
+ return PyLong_FromSsize_t(x);
}
PyDoc_STRVAR(hash_doc,
@@ -1187,7 +1192,7 @@ builtin_hex(PyObject *self, PyObject *v)
PyDoc_STRVAR(hex_doc,
"hex(number) -> string\n\
\n\
-Return the hexadecimal representation of an integer or long integer.");
+Return the hexadecimal representation of an integer.");
static PyObject *
@@ -1375,7 +1380,7 @@ builtin_oct(PyObject *self, PyObject *v)
PyDoc_STRVAR(oct_doc,
"oct(number) -> string\n\
\n\
-Return the octal representation of an integer or long integer.");
+Return the octal representation of an integer.");
static PyObject *
@@ -1486,13 +1491,19 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
Py_RETURN_NONE;
}
- if (sep && sep != Py_None && !PyUnicode_Check(sep)) {
+ if (sep == Py_None) {
+ sep = NULL;
+ }
+ else if (sep && !PyUnicode_Check(sep)) {
PyErr_Format(PyExc_TypeError,
"sep must be None or a string, not %.200s",
sep->ob_type->tp_name);
return NULL;
}
- if (end && end != Py_None && !PyUnicode_Check(end)) {
+ if (end == Py_None) {
+ end = NULL;
+ }
+ else if (end && !PyUnicode_Check(end)) {
PyErr_Format(PyExc_TypeError,
"end must be None or a string, not %.200s",
end->ob_type->tp_name);
@@ -1501,7 +1512,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
for (i = 0; i < PyTuple_Size(args); i++) {
if (i > 0) {
- if (sep == NULL || sep == Py_None)
+ if (sep == NULL)
err = PyFile_WriteString(" ", file);
else
err = PyFile_WriteObject(sep, file,
@@ -1515,7 +1526,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
return NULL;
}
- if (end == NULL || end == Py_None)
+ if (end == NULL)
err = PyFile_WriteString("\n", file);
else
err = PyFile_WriteObject(end, file, Py_PRINT_RAW);
@@ -1608,13 +1619,20 @@ builtin_input(PyObject *self, PyObject *args)
char *prompt;
char *s;
PyObject *stdin_encoding;
+ char *stdin_encoding_str;
PyObject *result;
+ size_t len;
stdin_encoding = PyObject_GetAttrString(fin, "encoding");
if (!stdin_encoding)
/* stdin is a text stream, so it must have an
encoding. */
return NULL;
+ stdin_encoding_str = _PyUnicode_AsString(stdin_encoding);
+ if (stdin_encoding_str == NULL) {
+ Py_DECREF(stdin_encoding);
+ return NULL;
+ }
tmp = PyObject_CallMethod(fout, "flush", "");
if (tmp == NULL)
PyErr_Clear();
@@ -1623,12 +1641,18 @@ builtin_input(PyObject *self, PyObject *args)
if (promptarg != NULL) {
PyObject *stringpo;
PyObject *stdout_encoding;
- stdout_encoding = PyObject_GetAttrString(fout,
- "encoding");
+ char *stdout_encoding_str;
+ stdout_encoding = PyObject_GetAttrString(fout, "encoding");
if (stdout_encoding == NULL) {
Py_DECREF(stdin_encoding);
return NULL;
}
+ stdout_encoding_str = _PyUnicode_AsString(stdout_encoding);
+ if (stdout_encoding_str == NULL) {
+ Py_DECREF(stdin_encoding);
+ Py_DECREF(stdout_encoding);
+ return NULL;
+ }
stringpo = PyObject_Str(promptarg);
if (stringpo == NULL) {
Py_DECREF(stdin_encoding);
@@ -1636,7 +1660,7 @@ builtin_input(PyObject *self, PyObject *args)
return NULL;
}
po = PyUnicode_AsEncodedString(stringpo,
- _PyUnicode_AsString(stdout_encoding), NULL);
+ stdout_encoding_str, NULL);
Py_DECREF(stdout_encoding);
Py_DECREF(stringpo);
if (po == NULL) {
@@ -1662,22 +1686,23 @@ builtin_input(PyObject *self, PyObject *args)
Py_DECREF(stdin_encoding);
return NULL;
}
- if (*s == '\0') {
+
+ len = strlen(s);
+ if (len == 0) {
PyErr_SetNone(PyExc_EOFError);
result = NULL;
}
- else { /* strip trailing '\n' */
- size_t len = strlen(s);
+ else {
if (len > PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError,
"input: input too long");
result = NULL;
}
else {
- result = PyUnicode_Decode
- (s, len-1,
- _PyUnicode_AsString(stdin_encoding),
- NULL);
+ len--; /* strip trailing '\n' */
+ if (len != 0 && s[len-1] == '\r')
+ len--; /* strip trailing '\r' */
+ result = PyUnicode_Decode(s, len, stdin_encoding_str, NULL);
}
}
Py_DECREF(stdin_encoding);
@@ -1979,6 +2004,15 @@ builtin_sum(PyObject *self, PyObject *args)
}
break;
}
+ /* It's tempting to use PyNumber_InPlaceAdd instead of
+ PyNumber_Add here, to avoid quadratic running time
+ when doing 'sum(list_of_lists, [])'. However, this
+ would produce a change in behaviour: a snippet like
+
+ empty = []
+ sum([[x] for x in range(10)], empty)
+
+ would change the value of empty. */
temp = PyNumber_Add(result, item);
Py_DECREF(result);
Py_DECREF(item);
@@ -2233,6 +2267,7 @@ static PyMethodDef builtin_methods[] = {
{"any", builtin_any, METH_O, any_doc},
{"ascii", builtin_ascii, METH_O, ascii_doc},
{"bin", builtin_bin, METH_O, bin_doc},
+ {"callable", builtin_callable, METH_O, callable_doc},
{"chr", builtin_chr, METH_VARARGS, chr_doc},
{"compile", (PyCFunction)builtin_compile, METH_VARARGS | METH_KEYWORDS, compile_doc},
{"delattr", builtin_delattr, METH_VARARGS, delattr_doc},
@@ -2323,9 +2358,7 @@ _PyBuiltin_Init(void)
SETBUILTIN("bytearray", &PyByteArray_Type);
SETBUILTIN("bytes", &PyBytes_Type);
SETBUILTIN("classmethod", &PyClassMethod_Type);
-#ifndef WITHOUT_COMPLEX
SETBUILTIN("complex", &PyComplex_Type);
-#endif
SETBUILTIN("dict", &PyDict_Type);
SETBUILTIN("enumerate", &PyEnum_Type);
SETBUILTIN("filter", &PyFilter_Type);
diff --git a/Python/ceval.c b/Python/ceval.c
index d3ed871770..705ed415a9 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -13,7 +13,6 @@
#include "code.h"
#include "frameobject.h"
-#include "eval.h"
#include "opcode.h"
#include "structmember.h"
@@ -136,8 +135,10 @@ static PyObject * cmp_outcome(int, PyObject *, PyObject *);
static PyObject * import_from(PyObject *, PyObject *);
static int import_all_from(PyObject *, PyObject *);
static void format_exc_check_arg(PyObject *, const char *, PyObject *);
+static void format_exc_unbound(PyCodeObject *co, int oparg);
static PyObject * unicode_concatenate(PyObject *, PyObject *,
PyFrameObject *, unsigned char *);
+static PyObject * special_lookup(PyObject *, char *, PyObject **);
#define NAME_ERROR_MSG \
"name '%.200s' is not defined"
@@ -217,42 +218,127 @@ PyEval_GetCallStats(PyObject *self)
#ifdef WITH_THREAD
+#define GIL_REQUEST _Py_atomic_load_relaxed(&gil_drop_request)
+#else
+#define GIL_REQUEST 0
+#endif
+
+/* This can set eval_breaker to 0 even though gil_drop_request became
+ 1. We believe this is all right because the eval loop will release
+ the GIL eventually anyway. */
+#define COMPUTE_EVAL_BREAKER() \
+ _Py_atomic_store_relaxed( \
+ &eval_breaker, \
+ GIL_REQUEST | \
+ _Py_atomic_load_relaxed(&pendingcalls_to_do) | \
+ pending_async_exc)
+
+#ifdef WITH_THREAD
+
+#define SET_GIL_DROP_REQUEST() \
+ do { \
+ _Py_atomic_store_relaxed(&gil_drop_request, 1); \
+ _Py_atomic_store_relaxed(&eval_breaker, 1); \
+ } while (0)
+
+#define RESET_GIL_DROP_REQUEST() \
+ do { \
+ _Py_atomic_store_relaxed(&gil_drop_request, 0); \
+ COMPUTE_EVAL_BREAKER(); \
+ } while (0)
+
+#endif
+
+/* Pending calls are only modified under pending_lock */
+#define SIGNAL_PENDING_CALLS() \
+ do { \
+ _Py_atomic_store_relaxed(&pendingcalls_to_do, 1); \
+ _Py_atomic_store_relaxed(&eval_breaker, 1); \
+ } while (0)
+
+#define UNSIGNAL_PENDING_CALLS() \
+ do { \
+ _Py_atomic_store_relaxed(&pendingcalls_to_do, 0); \
+ COMPUTE_EVAL_BREAKER(); \
+ } while (0)
+
+#define SIGNAL_ASYNC_EXC() \
+ do { \
+ pending_async_exc = 1; \
+ _Py_atomic_store_relaxed(&eval_breaker, 1); \
+ } while (0)
+
+#define UNSIGNAL_ASYNC_EXC() \
+ do { pending_async_exc = 0; COMPUTE_EVAL_BREAKER(); } while (0)
+
+
+#ifdef WITH_THREAD
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include "pythread.h"
-static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */
static PyThread_type_lock pending_lock = 0; /* for pending calls */
static long main_thread = 0;
+/* This single variable consolidates all requests to break out of the fast path
+ in the eval loop. */
+static _Py_atomic_int eval_breaker = {0};
+/* Request for dropping the GIL */
+static _Py_atomic_int gil_drop_request = {0};
+/* Request for running pending calls. */
+static _Py_atomic_int pendingcalls_to_do = {0};
+/* Request for looking at the `async_exc` field of the current thread state.
+ Guarded by the GIL. */
+static int pending_async_exc = 0;
+
+#include "ceval_gil.h"
int
PyEval_ThreadsInitialized(void)
{
- return interpreter_lock != 0;
+ return gil_created();
}
void
PyEval_InitThreads(void)
{
- if (interpreter_lock)
+ if (gil_created())
return;
- interpreter_lock = PyThread_allocate_lock();
- PyThread_acquire_lock(interpreter_lock, 1);
+ create_gil();
+ take_gil(PyThreadState_GET());
main_thread = PyThread_get_thread_ident();
+ if (!pending_lock)
+ pending_lock = PyThread_allocate_lock();
+}
+
+void
+_PyEval_FiniThreads(void)
+{
+ if (!gil_created())
+ return;
+ destroy_gil();
+ assert(!gil_created());
}
void
PyEval_AcquireLock(void)
{
- PyThread_acquire_lock(interpreter_lock, 1);
+ PyThreadState *tstate = PyThreadState_GET();
+ if (tstate == NULL)
+ Py_FatalError("PyEval_AcquireLock: current thread state is NULL");
+ take_gil(tstate);
}
void
PyEval_ReleaseLock(void)
{
- PyThread_release_lock(interpreter_lock);
+ /* This function must succeed when the current thread state is NULL.
+ We therefore avoid PyThreadState_GET() which dumps a fatal error
+ in debug mode.
+ */
+ drop_gil((PyThreadState*)_Py_atomic_load_relaxed(
+ &_PyThreadState_Current));
}
void
@@ -261,8 +347,8 @@ PyEval_AcquireThread(PyThreadState *tstate)
if (tstate == NULL)
Py_FatalError("PyEval_AcquireThread: NULL new thread state");
/* Check someone has called PyEval_InitThreads() to create the lock */
- assert(interpreter_lock);
- PyThread_acquire_lock(interpreter_lock, 1);
+ assert(gil_created());
+ take_gil(tstate);
if (PyThreadState_Swap(tstate) != NULL)
Py_FatalError(
"PyEval_AcquireThread: non-NULL old thread state");
@@ -275,7 +361,7 @@ PyEval_ReleaseThread(PyThreadState *tstate)
Py_FatalError("PyEval_ReleaseThread: NULL thread state");
if (PyThreadState_Swap(NULL) != tstate)
Py_FatalError("PyEval_ReleaseThread: wrong thread state");
- PyThread_release_lock(interpreter_lock);
+ drop_gil(tstate);
}
/* This function is called from PyOS_AfterFork to ensure that newly
@@ -287,17 +373,13 @@ void
PyEval_ReInitThreads(void)
{
PyObject *threading, *result;
- PyThreadState *tstate;
+ PyThreadState *tstate = PyThreadState_GET();
- if (!interpreter_lock)
+ if (!gil_created())
return;
- /*XXX Can't use PyThread_free_lock here because it does too
- much error-checking. Doing this cleanly would require
- adding a new function to each thread_*.h. Instead, just
- create a new lock and waste a little bit of memory */
- interpreter_lock = PyThread_allocate_lock();
+ recreate_gil();
pending_lock = PyThread_allocate_lock();
- PyThread_acquire_lock(interpreter_lock, 1);
+ take_gil(tstate);
main_thread = PyThread_get_thread_ident();
/* Update the threading module with the new state.
@@ -317,7 +399,20 @@ PyEval_ReInitThreads(void)
Py_DECREF(result);
Py_DECREF(threading);
}
-#endif
+
+#else
+static _Py_atomic_int eval_breaker = {0};
+static int pending_async_exc = 0;
+#endif /* WITH_THREAD */
+
+/* This function is used to signal that async exceptions are waiting to be
+ raised, therefore it is also useful in non-threaded builds. */
+
+void
+_PyEval_SignalAsyncExc(void)
+{
+ SIGNAL_ASYNC_EXC();
+}
/* Functions save_thread and restore_thread are always defined so
dynamically loaded modules needn't be compiled separately for use
@@ -330,8 +425,8 @@ PyEval_SaveThread(void)
if (tstate == NULL)
Py_FatalError("PyEval_SaveThread: NULL tstate");
#ifdef WITH_THREAD
- if (interpreter_lock)
- PyThread_release_lock(interpreter_lock);
+ if (gil_created())
+ drop_gil(tstate);
#endif
return tstate;
}
@@ -342,9 +437,15 @@ PyEval_RestoreThread(PyThreadState *tstate)
if (tstate == NULL)
Py_FatalError("PyEval_RestoreThread: NULL tstate");
#ifdef WITH_THREAD
- if (interpreter_lock) {
+ if (gil_created()) {
int err = errno;
- PyThread_acquire_lock(interpreter_lock, 1);
+ take_gil(tstate);
+ /* _Py_Finalizing is protected by the GIL */
+ if (_Py_Finalizing && tstate != _Py_Finalizing) {
+ drop_gil(tstate);
+ PyThread_exit_thread();
+ assert(0); /* unreachable */
+ }
errno = err;
}
#endif
@@ -390,7 +491,6 @@ static struct {
} pendingcalls[NPENDINGCALLS];
static int pendingfirst = 0;
static int pendinglast = 0;
-static volatile int pendingcalls_to_do = 1; /* trigger initialization of lock */
static char pendingbusy = 0;
int
@@ -429,8 +529,7 @@ Py_AddPendingCall(int (*func)(void *), void *arg)
pendinglast = j;
}
/* signal main loop */
- _Py_Ticker = 0;
- pendingcalls_to_do = 1;
+ SIGNAL_PENDING_CALLS();
if (lock != NULL)
PyThread_release_lock(lock);
return result;
@@ -472,7 +571,10 @@ Py_MakePendingCalls(void)
arg = pendingcalls[j].arg;
pendingfirst = (j + 1) % NPENDINGCALLS;
}
- pendingcalls_to_do = pendingfirst != pendinglast;
+ if (pendingfirst != pendinglast)
+ SIGNAL_PENDING_CALLS();
+ else
+ UNSIGNAL_PENDING_CALLS();
PyThread_release_lock(pending_lock);
/* having released the lock, perform the callback */
if (func == NULL)
@@ -517,7 +619,7 @@ static struct {
} pendingcalls[NPENDINGCALLS];
static volatile int pendingfirst = 0;
static volatile int pendinglast = 0;
-static volatile int pendingcalls_to_do = 0;
+static _Py_atomic_int pendingcalls_to_do = {0};
int
Py_AddPendingCall(int (*func)(void *), void *arg)
@@ -538,8 +640,7 @@ Py_AddPendingCall(int (*func)(void *), void *arg)
pendingcalls[i].arg = arg;
pendinglast = j;
- _Py_Ticker = 0;
- pendingcalls_to_do = 1; /* Signal main loop */
+ SIGNAL_PENDING_CALLS();
busy = 0;
/* XXX End critical section */
return 0;
@@ -552,7 +653,7 @@ Py_MakePendingCalls(void)
if (busy)
return 0;
busy = 1;
- pendingcalls_to_do = 0;
+ UNSIGNAL_PENDING_CALLS();
for (;;) {
int i;
int (*func)(void *);
@@ -565,7 +666,7 @@ Py_MakePendingCalls(void)
pendingfirst = (i + 1) % NPENDINGCALLS;
if (func(arg) < 0) {
busy = 0;
- pendingcalls_to_do = 1; /* We're not done yet */
+ SIGNAL_PENDING_CALLS(); /* We're not done yet */
return -1;
}
}
@@ -658,13 +759,10 @@ static int unpack_iterable(PyObject *, int, int, PyObject **);
fast_next_opcode*/
static int _Py_TracingPossible = 0;
-/* for manipulating the thread switch and periodic "stuff" - used to be
- per thread, now just a pair o' globals */
-int _Py_CheckInterval = 100;
-volatile int _Py_Ticker = 0; /* so that we hit a "tick" first thing */
+
PyObject *
-PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
+PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals)
{
return PyEval_EvalCodeEx(co,
globals, locals,
@@ -763,11 +861,24 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
-fno-crossjumping).
*/
-#if defined(USE_COMPUTED_GOTOS) && defined(DYNAMIC_EXECUTION_PROFILE)
+#ifdef DYNAMIC_EXECUTION_PROFILE
#undef USE_COMPUTED_GOTOS
+#define USE_COMPUTED_GOTOS 0
+#endif
+
+#ifdef HAVE_COMPUTED_GOTOS
+ #ifndef USE_COMPUTED_GOTOS
+ #define USE_COMPUTED_GOTOS 1
+ #endif
+#else
+ #if defined(USE_COMPUTED_GOTOS) && USE_COMPUTED_GOTOS
+ #error "Computed gotos are not supported on this compiler."
+ #endif
+ #undef USE_COMPUTED_GOTOS
+ #define USE_COMPUTED_GOTOS 0
#endif
-#ifdef USE_COMPUTED_GOTOS
+#if USE_COMPUTED_GOTOS
/* Import the static jump table */
#include "opcode_targets.h"
@@ -791,11 +902,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
#define DISPATCH() \
{ \
- /* Avoid multiple loads from _Py_Ticker despite `volatile` */ \
- int _tick = _Py_Ticker - 1; \
- _Py_Ticker = _tick; \
- if (_tick >= 0) { \
- FAST_DISPATCH(); \
+ if (!_Py_atomic_load_relaxed(&eval_breaker)) { \
+ FAST_DISPATCH(); \
} \
continue; \
}
@@ -916,7 +1024,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
*/
-#if defined(DYNAMIC_EXECUTION_PROFILE) || defined(USE_COMPUTED_GOTOS)
+#if defined(DYNAMIC_EXECUTION_PROFILE) || USE_COMPUTED_GOTOS
#define PREDICT(op) if (0) goto PRED_##op
#define PREDICTED(op) PRED_##op:
#define PREDICTED_WITH_ARG(op) PRED_##op:
@@ -937,10 +1045,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
#define SECOND() (stack_pointer[-2])
#define THIRD() (stack_pointer[-3])
#define FOURTH() (stack_pointer[-4])
+#define PEEK(n) (stack_pointer[-(n)])
#define SET_TOP(v) (stack_pointer[-1] = (v))
#define SET_SECOND(v) (stack_pointer[-2] = (v))
#define SET_THIRD(v) (stack_pointer[-3] = (v))
#define SET_FOURTH(v) (stack_pointer[-4] = (v))
+#define SET_VALUE(n, v) (stack_pointer[-(n)] = (v))
#define BASIC_STACKADJ(n) (stack_pointer += n)
#define BASIC_PUSH(v) (*stack_pointer++ = (v))
#define BASIC_POP() (*--stack_pointer)
@@ -1124,7 +1234,16 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
lltrace = PyDict_GetItemString(f->f_globals, "__lltrace__") != NULL;
#endif
#if defined(Py_DEBUG) || defined(LLTRACE)
- filename = _PyUnicode_AsString(co->co_filename);
+ {
+ PyObject *error_type, *error_value, *error_traceback;
+ PyErr_Fetch(&error_type, &error_value, &error_traceback);
+ filename = _PyUnicode_AsString(co->co_filename);
+ if (filename == NULL && tstate->overflowed) {
+ /* maximum recursion depth exceeded */
+ goto exit_eval_frame;
+ }
+ PyErr_Restore(error_type, error_value, error_traceback);
+ }
#endif
why = WHY_NOT;
@@ -1166,55 +1285,46 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
async I/O handler); see Py_AddPendingCall() and
Py_MakePendingCalls() above. */
- if (--_Py_Ticker < 0) {
+ if (_Py_atomic_load_relaxed(&eval_breaker)) {
if (*next_instr == SETUP_FINALLY) {
/* Make the last opcode before
a try: finally: block uninterruptible. */
goto fast_next_opcode;
}
- _Py_Ticker = _Py_CheckInterval;
tstate->tick_counter++;
#ifdef WITH_TSC
ticked = 1;
#endif
- if (pendingcalls_to_do) {
+ if (_Py_atomic_load_relaxed(&pendingcalls_to_do)) {
if (Py_MakePendingCalls() < 0) {
why = WHY_EXCEPTION;
goto on_error;
}
- if (pendingcalls_to_do)
- /* MakePendingCalls() didn't succeed.
- Force early re-execution of this
- "periodic" code, possibly after
- a thread switch */
- _Py_Ticker = 0;
}
#ifdef WITH_THREAD
- if (interpreter_lock) {
+ if (_Py_atomic_load_relaxed(&gil_drop_request)) {
/* Give another thread a chance */
-
if (PyThreadState_Swap(NULL) != tstate)
Py_FatalError("ceval: tstate mix-up");
- PyThread_release_lock(interpreter_lock);
+ drop_gil(tstate);
/* Other threads may run now */
- PyThread_acquire_lock(interpreter_lock, 1);
+ take_gil(tstate);
if (PyThreadState_Swap(tstate) != NULL)
Py_FatalError("ceval: orphan tstate");
-
- /* Check for thread interrupts */
-
- if (tstate->async_exc != NULL) {
- x = tstate->async_exc;
- tstate->async_exc = NULL;
- PyErr_SetNone(x);
- Py_DECREF(x);
- why = WHY_EXCEPTION;
- goto on_error;
- }
}
#endif
+ /* Check for asynchronous exceptions. */
+ if (tstate->async_exc != NULL) {
+ x = tstate->async_exc;
+ tstate->async_exc = NULL;
+ UNSIGNAL_ASYNC_EXC();
+ PyErr_SetNone(x);
+ Py_DECREF(x);
+ why = WHY_EXCEPTION;
+ goto on_error;
+ }
}
fast_next_opcode:
@@ -1335,50 +1445,21 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
SET_THIRD(v);
FAST_DISPATCH();
- TARGET(ROT_FOUR)
- u = TOP();
- v = SECOND();
- w = THIRD();
- x = FOURTH();
- SET_TOP(v);
- SET_SECOND(w);
- SET_THIRD(x);
- SET_FOURTH(u);
- FAST_DISPATCH();
-
TARGET(DUP_TOP)
v = TOP();
Py_INCREF(v);
PUSH(v);
FAST_DISPATCH();
- TARGET(DUP_TOPX)
- if (oparg == 2) {
- x = TOP();
- Py_INCREF(x);
- w = SECOND();
- Py_INCREF(w);
- STACKADJ(2);
- SET_TOP(x);
- SET_SECOND(w);
- FAST_DISPATCH();
- } else if (oparg == 3) {
- x = TOP();
- Py_INCREF(x);
- w = SECOND();
- Py_INCREF(w);
- v = THIRD();
- Py_INCREF(v);
- STACKADJ(3);
- SET_TOP(x);
- SET_SECOND(w);
- SET_THIRD(v);
- FAST_DISPATCH();
- }
- Py_FatalError("invalid argument to DUP_TOPX"
- " (bytecode corruption?)");
- /* Never returns, so don't bother to set why. */
- break;
+ TARGET(DUP_TOP_TWO)
+ x = TOP();
+ Py_INCREF(x);
+ w = SECOND();
+ Py_INCREF(w);
+ STACKADJ(2);
+ SET_TOP(x);
+ SET_SECOND(w);
+ FAST_DISPATCH();
TARGET(UNARY_POSITIVE)
v = TOP();
@@ -1566,7 +1647,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
TARGET(LIST_APPEND)
w = POP();
- v = stack_pointer[-oparg];
+ v = PEEK(oparg);
err = PyList_Append(v, w);
Py_DECREF(w);
if (err == 0) {
@@ -1841,15 +1922,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
created when the exception was caught, otherwise
the stack will be in an inconsistent state. */
PyTryBlock *b = PyFrame_BlockPop(f);
- if (b->b_type != EXCEPT_HANDLER) {
- PyErr_SetString(PyExc_SystemError,
- "popped block is not an except handler");
- why = WHY_EXCEPTION;
- }
- else {
- UNWIND_EXCEPT_HANDLER(b);
- why = WHY_NOT;
- }
+ assert(b->b_type == EXCEPT_HANDLER);
+ UNWIND_EXCEPT_HANDLER(b);
+ why = WHY_NOT;
}
}
else if (PyExceptionClass_Check(v)) {
@@ -1933,7 +2008,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
}
} else if (unpack_iterable(v, oparg, -1,
stack_pointer + oparg)) {
- stack_pointer += oparg;
+ STACKADJ(oparg);
} else {
/* unpack_iterable() raised an exception */
why = WHY_EXCEPTION;
@@ -2033,7 +2108,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
/* Inline the PyDict_GetItem() calls.
WARNING: this is an extreme speed hack.
Do not try this at home. */
- long hash = ((PyUnicodeObject *)w)->hash;
+ Py_hash_t hash = ((PyUnicodeObject *)w)->hash;
if (hash != -1) {
PyDictObject *d;
PyDictEntry *e;
@@ -2093,6 +2168,16 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
);
break;
+ TARGET(DELETE_DEREF)
+ x = freevars[oparg];
+ if (PyCell_GET(x) != NULL) {
+ PyCell_Set(x, NULL);
+ DISPATCH();
+ }
+ err = -1;
+ format_exc_unbound(co, oparg);
+ break;
+
TARGET(LOAD_CLOSURE)
x = freevars[oparg];
Py_INCREF(x);
@@ -2108,22 +2193,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
DISPATCH();
}
err = -1;
- /* Don't stomp existing exception */
- if (PyErr_Occurred())
- break;
- if (oparg < PyTuple_GET_SIZE(co->co_cellvars)) {
- v = PyTuple_GET_ITEM(co->co_cellvars,
- oparg);
- format_exc_check_arg(
- PyExc_UnboundLocalError,
- UNBOUNDLOCAL_ERROR_MSG,
- v);
- } else {
- v = PyTuple_GET_ITEM(co->co_freevars, oparg -
- PyTuple_GET_SIZE(co->co_cellvars));
- format_exc_check_arg(PyExc_NameError,
- UNBOUNDFREE_ERROR_MSG, v);
- }
+ format_exc_unbound(co, oparg);
break;
TARGET(STORE_DEREF)
@@ -2474,6 +2544,33 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
STACK_LEVEL());
DISPATCH();
+ TARGET(SETUP_WITH)
+ {
+ static PyObject *exit, *enter;
+ w = TOP();
+ x = special_lookup(w, "__exit__", &exit);
+ if (!x)
+ break;
+ SET_TOP(x);
+ u = special_lookup(w, "__enter__", &enter);
+ Py_DECREF(w);
+ if (!u) {
+ x = NULL;
+ break;
+ }
+ x = PyObject_CallFunctionObjArgs(u, NULL);
+ Py_DECREF(u);
+ if (!x)
+ break;
+ /* Setup the finally block before pushing the result
+ of __enter__ on the stack. */
+ PyFrame_BlockSetup(f, SETUP_FINALLY, INSTR_OFFSET() + oparg,
+ STACK_LEVEL());
+
+ PUSH(x);
+ DISPATCH();
+ }
+
TARGET(WITH_CLEANUP)
{
/* At the top of the stack are 1-3 values indicating
@@ -2482,33 +2579,70 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
- (TOP, SECOND) = (WHY_{RETURN,CONTINUE}), retval
- TOP = WHY_*; no retval below it
- (TOP, SECOND, THIRD) = exc_info()
+ (FOURTH, FITH, SIXTH) = previous exception for EXCEPT_HANDLER
Below them is EXIT, the context.__exit__ bound method.
In the last case, we must call
EXIT(TOP, SECOND, THIRD)
otherwise we must call
EXIT(None, None, None)
- In all cases, we remove EXIT from the stack, leaving
- the rest in the same order.
+ In the first two cases, we remove EXIT from the
+ stack, leaving the rest in the same order. In the
+ third case, we shift the bottom 3 values of the
+ stack down, and replace the empty spot with NULL.
In addition, if the stack represents an exception,
*and* the function call returns a 'true' value, we
- "zap" this information, to prevent END_FINALLY from
- re-raising the exception. (But non-local gotos
- should still be resumed.)
+ push WHY_SILENCED onto the stack. END_FINALLY will
+ then not re-raise the exception. (But non-local
+ gotos should still be resumed.)
*/
- PyObject *exit_func = POP();
+ PyObject *exit_func;
u = TOP();
if (u == Py_None) {
+ (void)POP();
+ exit_func = TOP();
+ SET_TOP(u);
v = w = Py_None;
}
else if (PyLong_Check(u)) {
+ (void)POP();
+ switch(PyLong_AsLong(u)) {
+ case WHY_RETURN:
+ case WHY_CONTINUE:
+ /* Retval in TOP. */
+ exit_func = SECOND();
+ SET_SECOND(TOP());
+ SET_TOP(u);
+ break;
+ default:
+ exit_func = TOP();
+ SET_TOP(u);
+ break;
+ }
u = v = w = Py_None;
}
else {
+ PyObject *tp, *exc, *tb;
+ PyTryBlock *block;
v = SECOND();
w = THIRD();
+ tp = FOURTH();
+ exc = PEEK(5);
+ tb = PEEK(6);
+ exit_func = PEEK(7);
+ SET_VALUE(7, tb);
+ SET_VALUE(6, exc);
+ SET_VALUE(5, tp);
+ /* UNWIND_EXCEPT_HANDLER will pop this off. */
+ SET_FOURTH(NULL);
+ /* We just shifted the stack down, so we have
+ to tell the except handler block that the
+ values are lower than it expects. */
+ block = &f->f_blockstack[f->f_iblock - 1];
+ assert(block->b_type == EXCEPT_HANDLER);
+ block->b_level--;
}
/* XXX Not the fastest way to call it... */
x = PyObject_CallFunctionObjArgs(exit_func, u, v, w,
@@ -2528,11 +2662,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
else if (err > 0) {
err = 0;
/* There was an exception and a True return */
- STACKADJ(-2);
- SET_TOP(PyLong_FromLong((long) WHY_SILENCED));
- Py_DECREF(u);
- Py_DECREF(v);
- Py_DECREF(w);
+ PUSH(PyLong_FromLong((long) WHY_SILENCED));
}
PREDICT(END_FINALLY);
break;
@@ -2717,13 +2847,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
oparg = oparg<<16 | NEXTARG();
goto dispatch_opcode;
-#ifdef USE_COMPUTED_GOTOS
+#if USE_COMPUTED_GOTOS
_unknown_opcode:
#endif
default:
fprintf(stderr,
"XXX lineno: %d, opcode: %d\n",
- PyCode_Addr2Line(f->f_code, f->f_lasti),
+ PyFrame_GetLineNumber(f),
opcode);
PyErr_SetString(PyExc_SystemError, "unknown opcode");
why = WHY_EXCEPTION;
@@ -2801,19 +2931,18 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
fast_block_end:
while (why != WHY_NOT && f->f_iblock > 0) {
- PyTryBlock *b = PyFrame_BlockPop(f);
+ /* Peek at the current block. */
+ PyTryBlock *b = &f->f_blockstack[f->f_iblock - 1];
assert(why != WHY_YIELD);
if (b->b_type == SETUP_LOOP && why == WHY_CONTINUE) {
- /* For a continue inside a try block,
- don't pop the block for the loop. */
- PyFrame_BlockSetup(f, b->b_type, b->b_handler,
- b->b_level);
why = WHY_NOT;
JUMPTO(PyLong_AS_LONG(retval));
Py_DECREF(retval);
break;
}
+ /* Now we have to pop the block. */
+ f->f_iblock--;
if (b->b_type == EXCEPT_HANDLER) {
UNWIND_EXCEPT_HANDLER(b);
@@ -2937,15 +3066,17 @@ exit_eval_frame:
the test in the if statements in Misc/gdbinit (pystack and pystackv). */
PyObject *
-PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
+PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
PyObject **args, int argcount, PyObject **kws, int kwcount,
PyObject **defs, int defcount, PyObject *kwdefs, PyObject *closure)
{
+ PyCodeObject* co = (PyCodeObject*)_co;
register PyFrameObject *f;
register PyObject *retval = NULL;
register PyObject **fastlocals, **freevars;
PyThreadState *tstate = PyThreadState_GET();
PyObject *x, *u;
+ int total_args = co->co_argcount + co->co_kwonlyargcount;
if (globals == NULL) {
PyErr_SetString(PyExc_SystemError,
@@ -2962,9 +3093,7 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
fastlocals = f->f_localsplus;
freevars = f->f_localsplus + co->co_nlocals;
- if (co->co_argcount > 0 ||
- co->co_kwonlyargcount > 0 ||
- co->co_flags & (CO_VARARGS | CO_VARKEYWORDS)) {
+ if (total_args || co->co_flags & (CO_VARARGS | CO_VARKEYWORDS)) {
int i;
int n = argcount;
PyObject *kwdict = NULL;
@@ -2972,7 +3101,7 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
kwdict = PyDict_New();
if (kwdict == NULL)
goto fail;
- i = co->co_argcount + co->co_kwonlyargcount;
+ i = total_args;
if (co->co_flags & CO_VARARGS)
i++;
SETLOCAL(i, kwdict);
@@ -2981,13 +3110,12 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
if (!(co->co_flags & CO_VARARGS)) {
PyErr_Format(PyExc_TypeError,
"%U() takes %s %d "
- "%spositional argument%s (%d given)",
+ "positional argument%s (%d given)",
co->co_name,
defcount ? "at most" : "exactly",
co->co_argcount,
- kwcount ? "non-keyword " : "",
co->co_argcount == 1 ? "" : "s",
- argcount);
+ argcount + kwcount);
goto fail;
}
n = co->co_argcount;
@@ -3001,7 +3129,7 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
u = PyTuple_New(argcount - n);
if (u == NULL)
goto fail;
- SETLOCAL(co->co_argcount + co->co_kwonlyargcount, u);
+ SETLOCAL(total_args, u);
for (i = n; i < argcount; i++) {
x = args[i];
Py_INCREF(x);
@@ -3021,18 +3149,14 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
}
/* Speed hack: do raw pointer compares. As names are
normally interned this should almost always hit. */
- co_varnames = PySequence_Fast_ITEMS(co->co_varnames);
- for (j = 0;
- j < co->co_argcount + co->co_kwonlyargcount;
- j++) {
+ co_varnames = ((PyTupleObject *)(co->co_varnames))->ob_item;
+ for (j = 0; j < total_args; j++) {
PyObject *nm = co_varnames[j];
if (nm == keyword)
goto kw_found;
}
/* Slow fallback, just in case */
- for (j = 0;
- j < co->co_argcount + co->co_kwonlyargcount;
- j++) {
+ for (j = 0; j < total_args; j++) {
PyObject *nm = co_varnames[j];
int cmp = PyObject_RichCompareBool(
keyword, nm, Py_EQ);
@@ -3041,22 +3165,17 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
else if (cmp < 0)
goto fail;
}
- /* Check errors from Compare */
- if (PyErr_Occurred())
+ if (j >= total_args && kwdict == NULL) {
+ PyErr_Format(PyExc_TypeError,
+ "%U() got an unexpected "
+ "keyword argument '%S'",
+ co->co_name,
+ keyword);
goto fail;
- if (j >= co->co_argcount + co->co_kwonlyargcount) {
- if (kwdict == NULL) {
- PyErr_Format(PyExc_TypeError,
- "%U() got an unexpected "
- "keyword argument '%S'",
- co->co_name,
- keyword);
- goto fail;
- }
- PyDict_SetItem(kwdict, keyword, value);
- continue;
}
-kw_found:
+ PyDict_SetItem(kwdict, keyword, value);
+ continue;
+ kw_found:
if (GETLOCAL(j) != NULL) {
PyErr_Format(PyExc_TypeError,
"%U() got multiple "
@@ -3070,20 +3189,18 @@ kw_found:
SETLOCAL(j, value);
}
if (co->co_kwonlyargcount > 0) {
- for (i = co->co_argcount;
- i < co->co_argcount + co->co_kwonlyargcount;
- i++) {
- PyObject *name, *def;
+ for (i = co->co_argcount; i < total_args; i++) {
+ PyObject *name;
if (GETLOCAL(i) != NULL)
continue;
name = PyTuple_GET_ITEM(co->co_varnames, i);
- def = NULL;
- if (kwdefs != NULL)
- def = PyDict_GetItem(kwdefs, name);
- if (def != NULL) {
- Py_INCREF(def);
- SETLOCAL(i, def);
- continue;
+ if (kwdefs != NULL) {
+ PyObject *def = PyDict_GetItem(kwdefs, name);
+ if (def) {
+ Py_INCREF(def);
+ SETLOCAL(i, def);
+ continue;
+ }
}
PyErr_Format(PyExc_TypeError,
"%U() needs keyword-only argument %S",
@@ -3095,16 +3212,19 @@ kw_found:
int m = co->co_argcount - defcount;
for (i = argcount; i < m; i++) {
if (GETLOCAL(i) == NULL) {
+ int j, given = 0;
+ for (j = 0; j < co->co_argcount; j++)
+ if (GETLOCAL(j))
+ given++;
PyErr_Format(PyExc_TypeError,
"%U() takes %s %d "
- "%spositional argument%s "
+ "argument%s "
"(%d given)",
co->co_name,
((co->co_flags & CO_VARARGS) ||
defcount) ? "at least"
: "exactly",
- m, kwcount ? "non-keyword " : "",
- m == 1 ? "" : "s", i);
+ m, m == 1 ? "" : "s", given);
goto fail;
}
}
@@ -3121,14 +3241,12 @@ kw_found:
}
}
}
- else {
- if (argcount > 0 || kwcount > 0) {
- PyErr_Format(PyExc_TypeError,
- "%U() takes no arguments (%d given)",
- co->co_name,
- argcount + kwcount);
- goto fail;
- }
+ else if (argcount > 0 || kwcount > 0) {
+ PyErr_Format(PyExc_TypeError,
+ "%U() takes no arguments (%d given)",
+ co->co_name,
+ argcount + kwcount);
+ goto fail;
}
/* Allocate and initialize storage for cell vars, and copy free
vars into frame. This isn't too efficient right now. */
@@ -3137,7 +3255,7 @@ kw_found:
Py_UNICODE *cellname, *argname;
PyObject *c;
- nargs = co->co_argcount + co->co_kwonlyargcount;
+ nargs = total_args;
if (co->co_flags & CO_VARARGS)
nargs++;
if (co->co_flags & CO_VARKEYWORDS)
@@ -3213,6 +3331,19 @@ fail: /* Jump here from prelude on failure */
}
+static PyObject *
+special_lookup(PyObject *o, char *meth, PyObject **cache)
+{
+ PyObject *res;
+ res = _PyObject_LookupSpecial(o, meth, cache);
+ if (res == NULL && !PyErr_Occurred()) {
+ PyErr_SetObject(PyExc_AttributeError, *cache);
+ return NULL;
+ }
+ return res;
+}
+
+
/* Logic for the raise statement (too complicated for inlining).
This *consumes* a reference count to each of its arguments. */
static enum why_code
@@ -3343,7 +3474,8 @@ unpack_iterable(PyObject *v, int argcnt, int argcntafter, PyObject **sp)
return 1;
}
Py_DECREF(w);
- PyErr_SetString(PyExc_ValueError, "too many values to unpack");
+ PyErr_Format(PyExc_ValueError, "too many values to unpack "
+ "(expected %d)", argcnt);
goto Error;
}
@@ -3471,33 +3603,30 @@ _PyEval_CallTracing(PyObject *func, PyObject *args)
return result;
}
+/* See Objects/lnotab_notes.txt for a description of how tracing works. */
static int
maybe_call_line_trace(Py_tracefunc func, PyObject *obj,
PyFrameObject *frame, int *instr_lb, int *instr_ub,
int *instr_prev)
{
int result = 0;
+ int line = frame->f_lineno;
/* If the last instruction executed isn't in the current
- instruction window, reset the window. If the last
- instruction happens to fall at the start of a line or if it
- represents a jump backwards, call the trace function.
+ instruction window, reset the window.
*/
- if ((frame->f_lasti < *instr_lb || frame->f_lasti >= *instr_ub)) {
- int line;
+ if (frame->f_lasti < *instr_lb || frame->f_lasti >= *instr_ub) {
PyAddrPair bounds;
-
- line = PyCode_CheckLineNumber(frame->f_code, frame->f_lasti,
- &bounds);
- if (line >= 0) {
- frame->f_lineno = line;
- result = call_trace(func, obj, frame,
- PyTrace_LINE, Py_None);
- }
+ line = _PyCode_CheckLineNumber(frame->f_code, frame->f_lasti,
+ &bounds);
*instr_lb = bounds.ap_lower;
*instr_ub = bounds.ap_upper;
}
- else if (frame->f_lasti <= *instr_prev) {
+ /* If the last instruction falls at the start of a line or if
+ it represents a jump backwards, update the frame's line
+ number and call the trace function. */
+ if (frame->f_lasti == *instr_lb || frame->f_lasti < *instr_prev) {
+ frame->f_lineno = line;
result = call_trace(func, obj, frame, PyTrace_LINE, Py_None);
}
*instr_prev = frame->f_lasti;
@@ -3602,18 +3731,7 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
/* External interface to call any callable object.
- The arg must be a tuple or NULL. */
-
-#undef PyEval_CallObject
-/* for backward compatibility: export this interface */
-
-PyObject *
-PyEval_CallObject(PyObject *func, PyObject *arg)
-{
- return PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL);
-}
-#define PyEval_CallObject(func,arg) \
- PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)
+ The arg must be a tuple or NULL. The kw must be a dict or NULL. */
PyObject *
PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw)
@@ -3858,7 +3976,7 @@ fast_function(PyObject *func, PyObject ***pp_stack, int n, int na, int nk)
d = &PyTuple_GET_ITEM(argdefs, 0);
nd = Py_SIZE(argdefs);
}
- return PyEval_EvalCodeEx(co, globals,
+ return PyEval_EvalCodeEx((PyObject*)co, globals,
(PyObject *)NULL, (*pp_stack)-n, na,
(*pp_stack)-2*nk, nk, d, nd, kwdefs,
PyFunction_GET_CLOSURE(func));
@@ -4255,6 +4373,28 @@ format_exc_check_arg(PyObject *exc, const char *format_str, PyObject *obj)
PyErr_Format(exc, format_str, obj_str);
}
+static void
+format_exc_unbound(PyCodeObject *co, int oparg)
+{
+ PyObject *name;
+ /* Don't stomp existing exception */
+ if (PyErr_Occurred())
+ return;
+ if (oparg < PyTuple_GET_SIZE(co->co_cellvars)) {
+ name = PyTuple_GET_ITEM(co->co_cellvars,
+ oparg);
+ format_exc_check_arg(
+ PyExc_UnboundLocalError,
+ UNBOUNDLOCAL_ERROR_MSG,
+ name);
+ } else {
+ name = PyTuple_GET_ITEM(co->co_freevars, oparg -
+ PyTuple_GET_SIZE(co->co_cellvars));
+ format_exc_check_arg(PyExc_NameError,
+ UNBOUNDFREE_ERROR_MSG, name);
+ }
+}
+
static PyObject *
unicode_concatenate(PyObject *v, PyObject *w,
PyFrameObject *f, unsigned char *next_instr)
@@ -4270,7 +4410,7 @@ unicode_concatenate(PyObject *v, PyObject *w,
return NULL;
}
- if (v->ob_refcnt == 2) {
+ if (Py_REFCNT(v) == 2) {
/* In the common case, there are 2 references to the value
* stored in 'variable' when the += is performed: one on the
* value stack (in 'v') and one still stored in the
@@ -4311,7 +4451,7 @@ unicode_concatenate(PyObject *v, PyObject *w,
}
}
- if (v->ob_refcnt == 1 && !PyUnicode_CHECK_INTERNED(v)) {
+ if (Py_REFCNT(v) == 1 && !PyUnicode_CHECK_INTERNED(v)) {
/* Now we own the last reference to 'v', so we can resize it
* in-place.
*/
diff --git a/Python/ceval_gil.h b/Python/ceval_gil.h
new file mode 100644
index 0000000000..bf7a350791
--- /dev/null
+++ b/Python/ceval_gil.h
@@ -0,0 +1,433 @@
+/*
+ * Implementation of the Global Interpreter Lock (GIL).
+ */
+
+#include <stdlib.h>
+#include <errno.h>
+
+
+/* First some general settings */
+
+/* microseconds (the Python API uses seconds, though) */
+#define DEFAULT_INTERVAL 5000
+static unsigned long gil_interval = DEFAULT_INTERVAL;
+#define INTERVAL (gil_interval >= 1 ? gil_interval : 1)
+
+/* Enable if you want to force the switching of threads at least every `gil_interval` */
+#undef FORCE_SWITCHING
+#define FORCE_SWITCHING
+
+
+/*
+ Notes about the implementation:
+
+ - The GIL is just a boolean variable (gil_locked) whose access is protected
+ by a mutex (gil_mutex), and whose changes are signalled by a condition
+ variable (gil_cond). gil_mutex is taken for short periods of time,
+ and therefore mostly uncontended.
+
+ - In the GIL-holding thread, the main loop (PyEval_EvalFrameEx) must be
+ able to release the GIL on demand by another thread. A volatile boolean
+ variable (gil_drop_request) is used for that purpose, which is checked
+ at every turn of the eval loop. That variable is set after a wait of
+ `interval` microseconds on `gil_cond` has timed out.
+
+ [Actually, another volatile boolean variable (eval_breaker) is used
+ which ORs several conditions into one. Volatile booleans are
+ sufficient as inter-thread signalling means since Python is run
+ on cache-coherent architectures only.]
+
+ - A thread wanting to take the GIL will first let pass a given amount of
+ time (`interval` microseconds) before setting gil_drop_request. This
+ encourages a defined switching period, but doesn't enforce it since
+ opcodes can take an arbitrary time to execute.
+
+ The `interval` value is available for the user to read and modify
+ using the Python API `sys.{get,set}switchinterval()`.
+
+ - When a thread releases the GIL and gil_drop_request is set, that thread
+ ensures that another GIL-awaiting thread gets scheduled.
+ It does so by waiting on a condition variable (switch_cond) until
+ the value of gil_last_holder is changed to something else than its
+ own thread state pointer, indicating that another thread was able to
+ take the GIL.
+
+ This is meant to prohibit the latency-adverse behaviour on multi-core
+ machines where one thread would speculatively release the GIL, but still
+ run and end up being the first to re-acquire it, making the "timeslices"
+ much longer than expected.
+ (Note: this mechanism is enabled with FORCE_SWITCHING above)
+*/
+
+#ifndef _POSIX_THREADS
+/* This means pthreads are not implemented in libc headers, hence the macro
+ not present in unistd.h. But they still can be implemented as an external
+ library (e.g. gnu pth in pthread emulation) */
+# ifdef HAVE_PTHREAD_H
+# include <pthread.h> /* _POSIX_THREADS */
+# endif
+#endif
+
+
+#ifdef _POSIX_THREADS
+
+/*
+ * POSIX support
+ */
+
+#include <pthread.h>
+
+#define ADD_MICROSECONDS(tv, interval) \
+do { \
+ tv.tv_usec += (long) interval; \
+ tv.tv_sec += tv.tv_usec / 1000000; \
+ tv.tv_usec %= 1000000; \
+} while (0)
+
+/* We assume all modern POSIX systems have gettimeofday() */
+#ifdef GETTIMEOFDAY_NO_TZ
+#define GETTIMEOFDAY(ptv) gettimeofday(ptv)
+#else
+#define GETTIMEOFDAY(ptv) gettimeofday(ptv, (struct timezone *)NULL)
+#endif
+
+#define MUTEX_T pthread_mutex_t
+#define MUTEX_INIT(mut) \
+ if (pthread_mutex_init(&mut, NULL)) { \
+ Py_FatalError("pthread_mutex_init(" #mut ") failed"); };
+#define MUTEX_FINI(mut) \
+ if (pthread_mutex_destroy(&mut)) { \
+ Py_FatalError("pthread_mutex_destroy(" #mut ") failed"); };
+#define MUTEX_LOCK(mut) \
+ if (pthread_mutex_lock(&mut)) { \
+ Py_FatalError("pthread_mutex_lock(" #mut ") failed"); };
+#define MUTEX_UNLOCK(mut) \
+ if (pthread_mutex_unlock(&mut)) { \
+ Py_FatalError("pthread_mutex_unlock(" #mut ") failed"); };
+
+#define COND_T pthread_cond_t
+#define COND_INIT(cond) \
+ if (pthread_cond_init(&cond, NULL)) { \
+ Py_FatalError("pthread_cond_init(" #cond ") failed"); };
+#define COND_FINI(cond) \
+ if (pthread_cond_destroy(&cond)) { \
+ Py_FatalError("pthread_cond_destroy(" #cond ") failed"); };
+#define COND_SIGNAL(cond) \
+ if (pthread_cond_signal(&cond)) { \
+ Py_FatalError("pthread_cond_signal(" #cond ") failed"); };
+#define COND_WAIT(cond, mut) \
+ if (pthread_cond_wait(&cond, &mut)) { \
+ Py_FatalError("pthread_cond_wait(" #cond ") failed"); };
+#define COND_TIMED_WAIT(cond, mut, microseconds, timeout_result) \
+ { \
+ int r; \
+ struct timespec ts; \
+ struct timeval deadline; \
+ \
+ GETTIMEOFDAY(&deadline); \
+ ADD_MICROSECONDS(deadline, microseconds); \
+ ts.tv_sec = deadline.tv_sec; \
+ ts.tv_nsec = deadline.tv_usec * 1000; \
+ \
+ r = pthread_cond_timedwait(&cond, &mut, &ts); \
+ if (r == ETIMEDOUT) \
+ timeout_result = 1; \
+ else if (r) \
+ Py_FatalError("pthread_cond_timedwait(" #cond ") failed"); \
+ else \
+ timeout_result = 0; \
+ } \
+
+#elif defined(NT_THREADS)
+
+/*
+ * Windows (2000 and later, as well as (hopefully) CE) support
+ */
+
+#include <windows.h>
+
+#define MUTEX_T CRITICAL_SECTION
+#define MUTEX_INIT(mut) do { \
+ if (!(InitializeCriticalSectionAndSpinCount(&(mut), 4000))) \
+ Py_FatalError("CreateMutex(" #mut ") failed"); \
+} while (0)
+#define MUTEX_FINI(mut) \
+ DeleteCriticalSection(&(mut))
+#define MUTEX_LOCK(mut) \
+ EnterCriticalSection(&(mut))
+#define MUTEX_UNLOCK(mut) \
+ LeaveCriticalSection(&(mut))
+
+/* We emulate condition variables with a semaphore.
+ We use a Semaphore rather than an auto-reset event, because although
+ an auto-resent event might appear to solve the lost-wakeup bug (race
+ condition between releasing the outer lock and waiting) because it
+ maintains state even though a wait hasn't happened, there is still
+ a lost wakeup problem if more than one thread are interrupted in the
+ critical place. A semaphore solves that.
+ Because it is ok to signal a condition variable with no one
+ waiting, we need to keep track of the number of
+ waiting threads. Otherwise, the semaphore's state could rise
+ without bound.
+
+ Generic emulations of the pthread_cond_* API using
+ Win32 functions can be found on the Web.
+ The following read can be edificating (or not):
+ http://www.cse.wustl.edu/~schmidt/win32-cv-1.html
+*/
+typedef struct COND_T
+{
+ HANDLE sem; /* the semaphore */
+ int n_waiting; /* how many are unreleased */
+} COND_T;
+
+__inline static void _cond_init(COND_T *cond)
+{
+ /* A semaphore with a large max value, The positive value
+ * is only needed to catch those "lost wakeup" events and
+ * race conditions when a timed wait elapses.
+ */
+ if (!(cond->sem = CreateSemaphore(NULL, 0, 1000, NULL)))
+ Py_FatalError("CreateSemaphore() failed");
+ cond->n_waiting = 0;
+}
+
+__inline static void _cond_fini(COND_T *cond)
+{
+ BOOL ok = CloseHandle(cond->sem);
+ if (!ok)
+ Py_FatalError("CloseHandle() failed");
+}
+
+__inline static void _cond_wait(COND_T *cond, MUTEX_T *mut)
+{
+ ++cond->n_waiting;
+ MUTEX_UNLOCK(*mut);
+ /* "lost wakeup bug" would occur if the caller were interrupted here,
+ * but we are safe because we are using a semaphore wich has an internal
+ * count.
+ */
+ if (WaitForSingleObject(cond->sem, INFINITE) == WAIT_FAILED)
+ Py_FatalError("WaitForSingleObject() failed");
+ MUTEX_LOCK(*mut);
+}
+
+__inline static int _cond_timed_wait(COND_T *cond, MUTEX_T *mut,
+ int us)
+{
+ DWORD r;
+ ++cond->n_waiting;
+ MUTEX_UNLOCK(*mut);
+ r = WaitForSingleObject(cond->sem, us / 1000);
+ if (r == WAIT_FAILED)
+ Py_FatalError("WaitForSingleObject() failed");
+ MUTEX_LOCK(*mut);
+ if (r == WAIT_TIMEOUT)
+ --cond->n_waiting;
+ /* Here we have a benign race condition with _cond_signal. If the
+ * wait operation has timed out, but before we can acquire the
+ * mutex again to decrement n_waiting, a thread holding the mutex
+ * still sees a positive n_waiting value and may call
+ * ReleaseSemaphore and decrement n_waiting.
+ * This will cause n_waiting to be decremented twice.
+ * This is benign, though, because ReleaseSemaphore will also have
+ * been called, leaving the semaphore state positive. We may
+ * thus end up with semaphore in state 1, and n_waiting == -1, and
+ * the next time someone calls _cond_wait(), that thread will
+ * pass right through, decrementing the semaphore state and
+ * incrementing n_waiting, thus correcting the extra _cond_signal.
+ */
+ return r == WAIT_TIMEOUT;
+}
+
+__inline static void _cond_signal(COND_T *cond) {
+ /* NOTE: This must be called with the mutex held */
+ if (cond->n_waiting > 0) {
+ if (!ReleaseSemaphore(cond->sem, 1, NULL))
+ Py_FatalError("ReleaseSemaphore() failed");
+ --cond->n_waiting;
+ }
+}
+
+#define COND_INIT(cond) \
+ _cond_init(&(cond))
+#define COND_FINI(cond) \
+ _cond_fini(&(cond))
+#define COND_SIGNAL(cond) \
+ _cond_signal(&(cond))
+#define COND_WAIT(cond, mut) \
+ _cond_wait(&(cond), &(mut))
+#define COND_TIMED_WAIT(cond, mut, us, timeout_result) do { \
+ (timeout_result) = _cond_timed_wait(&(cond), &(mut), us); \
+} while (0)
+
+#else
+
+#error You need either a POSIX-compatible or a Windows system!
+
+#endif /* _POSIX_THREADS, NT_THREADS */
+
+
+/* Whether the GIL is already taken (-1 if uninitialized). This is atomic
+ because it can be read without any lock taken in ceval.c. */
+static _Py_atomic_int gil_locked = {-1};
+/* Number of GIL switches since the beginning. */
+static unsigned long gil_switch_number = 0;
+/* Last PyThreadState holding / having held the GIL. This helps us know
+ whether anyone else was scheduled after we dropped the GIL. */
+static _Py_atomic_address gil_last_holder = {NULL};
+
+/* This condition variable allows one or several threads to wait until
+ the GIL is released. In addition, the mutex also protects the above
+ variables. */
+static COND_T gil_cond;
+static MUTEX_T gil_mutex;
+
+#ifdef FORCE_SWITCHING
+/* This condition variable helps the GIL-releasing thread wait for
+ a GIL-awaiting thread to be scheduled and take the GIL. */
+static COND_T switch_cond;
+static MUTEX_T switch_mutex;
+#endif
+
+
+static int gil_created(void)
+{
+ return _Py_atomic_load_explicit(&gil_locked, _Py_memory_order_acquire) >= 0;
+}
+
+static void create_gil(void)
+{
+ MUTEX_INIT(gil_mutex);
+#ifdef FORCE_SWITCHING
+ MUTEX_INIT(switch_mutex);
+#endif
+ COND_INIT(gil_cond);
+#ifdef FORCE_SWITCHING
+ COND_INIT(switch_cond);
+#endif
+ _Py_atomic_store_relaxed(&gil_last_holder, NULL);
+ _Py_ANNOTATE_RWLOCK_CREATE(&gil_locked);
+ _Py_atomic_store_explicit(&gil_locked, 0, _Py_memory_order_release);
+}
+
+static void destroy_gil(void)
+{
+ MUTEX_FINI(gil_mutex);
+#ifdef FORCE_SWITCHING
+ MUTEX_FINI(switch_mutex);
+#endif
+ COND_FINI(gil_cond);
+#ifdef FORCE_SWITCHING
+ COND_FINI(switch_cond);
+#endif
+ _Py_atomic_store_explicit(&gil_locked, -1, _Py_memory_order_release);
+ _Py_ANNOTATE_RWLOCK_DESTROY(&gil_locked);
+}
+
+static void recreate_gil(void)
+{
+ _Py_ANNOTATE_RWLOCK_DESTROY(&gil_locked);
+ /* XXX should we destroy the old OS resources here? */
+ create_gil();
+}
+
+static void drop_gil(PyThreadState *tstate)
+{
+ if (!_Py_atomic_load_relaxed(&gil_locked))
+ Py_FatalError("drop_gil: GIL is not locked");
+ /* tstate is allowed to be NULL (early interpreter init) */
+ if (tstate != NULL) {
+ /* Sub-interpreter support: threads might have been switched
+ under our feet using PyThreadState_Swap(). Fix the GIL last
+ holder variable so that our heuristics work. */
+ _Py_atomic_store_relaxed(&gil_last_holder, tstate);
+ }
+
+ MUTEX_LOCK(gil_mutex);
+ _Py_ANNOTATE_RWLOCK_RELEASED(&gil_locked, /*is_write=*/1);
+ _Py_atomic_store_relaxed(&gil_locked, 0);
+ COND_SIGNAL(gil_cond);
+ MUTEX_UNLOCK(gil_mutex);
+
+#ifdef FORCE_SWITCHING
+ if (_Py_atomic_load_relaxed(&gil_drop_request) && tstate != NULL) {
+ MUTEX_LOCK(switch_mutex);
+ /* Not switched yet => wait */
+ if (_Py_atomic_load_relaxed(&gil_last_holder) == tstate) {
+ RESET_GIL_DROP_REQUEST();
+ /* NOTE: if COND_WAIT does not atomically start waiting when
+ releasing the mutex, another thread can run through, take
+ the GIL and drop it again, and reset the condition
+ before we even had a chance to wait for it. */
+ COND_WAIT(switch_cond, switch_mutex);
+ }
+ MUTEX_UNLOCK(switch_mutex);
+ }
+#endif
+}
+
+static void take_gil(PyThreadState *tstate)
+{
+ int err;
+ if (tstate == NULL)
+ Py_FatalError("take_gil: NULL tstate");
+
+ err = errno;
+ MUTEX_LOCK(gil_mutex);
+
+ if (!_Py_atomic_load_relaxed(&gil_locked))
+ goto _ready;
+
+ while (_Py_atomic_load_relaxed(&gil_locked)) {
+ int timed_out = 0;
+ unsigned long saved_switchnum;
+
+ saved_switchnum = gil_switch_number;
+ COND_TIMED_WAIT(gil_cond, gil_mutex, INTERVAL, timed_out);
+ /* If we timed out and no switch occurred in the meantime, it is time
+ to ask the GIL-holding thread to drop it. */
+ if (timed_out &&
+ _Py_atomic_load_relaxed(&gil_locked) &&
+ gil_switch_number == saved_switchnum) {
+ SET_GIL_DROP_REQUEST();
+ }
+ }
+_ready:
+#ifdef FORCE_SWITCHING
+ /* This mutex must be taken before modifying gil_last_holder (see drop_gil()). */
+ MUTEX_LOCK(switch_mutex);
+#endif
+ /* We now hold the GIL */
+ _Py_atomic_store_relaxed(&gil_locked, 1);
+ _Py_ANNOTATE_RWLOCK_ACQUIRED(&gil_locked, /*is_write=*/1);
+
+ if (tstate != _Py_atomic_load_relaxed(&gil_last_holder)) {
+ _Py_atomic_store_relaxed(&gil_last_holder, tstate);
+ ++gil_switch_number;
+ }
+
+#ifdef FORCE_SWITCHING
+ COND_SIGNAL(switch_cond);
+ MUTEX_UNLOCK(switch_mutex);
+#endif
+ if (_Py_atomic_load_relaxed(&gil_drop_request)) {
+ RESET_GIL_DROP_REQUEST();
+ }
+ if (tstate->async_exc != NULL) {
+ _PyEval_SignalAsyncExc();
+ }
+
+ MUTEX_UNLOCK(gil_mutex);
+ errno = err;
+}
+
+void _PyEval_SetSwitchInterval(unsigned long microseconds)
+{
+ gil_interval = microseconds;
+}
+
+unsigned long _PyEval_GetSwitchInterval()
+{
+ return gil_interval;
+}
diff --git a/Python/compile.c b/Python/compile.c
index 19b2addc10..1d6e38c22e 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -25,10 +25,8 @@
#include "Python-ast.h"
#include "node.h"
-#include "pyarena.h"
#include "ast.h"
#include "code.h"
-#include "compile.h"
#include "symtable.h"
#include "opcode.h"
@@ -117,13 +115,13 @@ struct compiler_unit {
members, you can reach all early allocated blocks. */
basicblock *u_blocks;
basicblock *u_curblock; /* pointer to current block */
- int u_tmpname; /* temporary variables for list comps */
int u_nfblocks;
struct fblockinfo u_fblock[CO_MAXBLOCKS];
int u_firstlineno; /* the first lineno of the block */
int u_lineno; /* the lineno for the current stmt */
+ int u_col_offset; /* the offset of the current stmt */
int u_lineno_set; /* boolean to indicate whether instr
has been generated with current lineno */
};
@@ -141,12 +139,12 @@ struct compiler {
PyFutureFeatures *c_future; /* pointer to module's __future__ */
PyCompilerFlags *c_flags;
+ int c_optimize; /* optimization level */
int c_interactive; /* true if in interactive mode */
int c_nestlevel;
struct compiler_unit *u; /* compiler state for current block */
PyObject *c_stack; /* Python list holding compiler_unit ptrs */
- char *c_encoding; /* source encoding (a borrowed reference) */
PyArena *c_arena; /* pointer to memory allocation arena */
};
@@ -178,7 +176,7 @@ static void compiler_pop_fblock(struct compiler *, enum fblocktype,
static int compiler_in_loop(struct compiler *);
static int inplace_binop(struct compiler *, operator_ty);
-static int expr_constant(expr_ty e);
+static int expr_constant(struct compiler *, expr_ty);
static int compiler_with(struct compiler *, stmt_ty);
static int compiler_call_helper(struct compiler *c, int n,
@@ -257,8 +255,8 @@ compiler_init(struct compiler *c)
}
PyCodeObject *
-PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
- PyArena *arena)
+PyAST_CompileEx(mod_ty mod, const char *filename, PyCompilerFlags *flags,
+ int optimize, PyArena *arena)
{
struct compiler c;
PyCodeObject *co = NULL;
@@ -286,6 +284,7 @@ PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
c.c_future->ff_features = merged;
flags->cf_flags = merged;
c.c_flags = flags;
+ c.c_optimize = (optimize == -1) ? Py_OptimizeFlag : optimize;
c.c_nestlevel = 0;
c.c_st = PySymtable_Build(mod, filename, c.c_future);
@@ -295,9 +294,6 @@ PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
goto finally;
}
- /* XXX initialize to NULL for now, need to handle */
- c.c_encoding = NULL;
-
co = compiler_mod(&c, mod);
finally:
@@ -488,10 +484,10 @@ compiler_enter_scope(struct compiler *c, identifier name, void *key,
}
u->u_blocks = NULL;
- u->u_tmpname = 0;
u->u_nfblocks = 0;
u->u_firstlineno = lineno;
u->u_lineno = 0;
+ u->u_col_offset = 0;
u->u_lineno_set = 0;
u->u_consts = PyDict_New();
if (!u->u_consts) {
@@ -551,16 +547,6 @@ compiler_exit_scope(struct compiler *c)
}
-/* Allocate a new "anonymous" local variable. Used by with statements. */
-
-static PyObject *
-compiler_new_tmpname(struct compiler *c)
-{
- char tmpname[256];
- PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++c->u->u_tmpname);
- return PyUnicode_FromString(tmpname);
-}
-
/* Allocate a new block and return a pointer to it.
Returns NULL on error.
*/
@@ -696,8 +682,8 @@ opcode_stack_effect(int opcode, int oparg)
return 0;
case DUP_TOP:
return 1;
- case ROT_FOUR:
- return 0;
+ case DUP_TOP_TWO:
+ return 2;
case UNARY_POSITIVE:
case UNARY_NEGATIVE:
@@ -759,6 +745,8 @@ opcode_stack_effect(int opcode, int oparg)
return -1;
case BREAK_LOOP:
return 0;
+ case SETUP_WITH:
+ return 7;
case WITH_CLEANUP:
return -1; /* XXX Sometimes more */
case STORE_LOCALS:
@@ -786,7 +774,7 @@ opcode_stack_effect(int opcode, int oparg)
case UNPACK_EX:
return (oparg&0xFF) + (oparg>>8);
case FOR_ITER:
- return 1;
+ return 1; /* or -1, at end of iterator */
case STORE_ATTR:
return -2;
@@ -796,8 +784,6 @@ opcode_stack_effect(int opcode, int oparg)
return -1;
case DELETE_GLOBAL:
return 0;
- case DUP_TOPX:
- return oparg;
case LOAD_CONST:
return 1;
case LOAD_NAME:
@@ -813,7 +799,7 @@ opcode_stack_effect(int opcode, int oparg)
case COMPARE_OP:
return -1;
case IMPORT_NAME:
- return 0;
+ return -1;
case IMPORT_FROM:
return 1;
@@ -873,6 +859,8 @@ opcode_stack_effect(int opcode, int oparg)
return 1;
case STORE_DEREF:
return -1;
+ case DELETE_DEREF:
+ return 0;
default:
fprintf(stderr, "opcode = %d\n", opcode);
Py_FatalError("opcode_stack_effect()");
@@ -923,7 +911,6 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
else
t = PyTuple_Pack(2, o, o->ob_type);
}
-#ifndef WITHOUT_COMPLEX
else if (PyComplex_Check(o)) {
Py_complex z;
int real_negzero, imag_negzero;
@@ -948,7 +935,6 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
t = PyTuple_Pack(2, o, o->ob_type);
}
}
-#endif /* WITHOUT_COMPLEX */
else {
t = PyTuple_Pack(2, o, o->ob_type);
}
@@ -1165,7 +1151,7 @@ compiler_body(struct compiler *c, asdl_seq *stmts)
if (!asdl_seq_LEN(stmts))
return 1;
st = (stmt_ty)asdl_seq_GET(stmts, 0);
- if (compiler_isdocstring(st) && Py_OptimizeFlag < 2) {
+ if (compiler_isdocstring(st) && c->c_optimize < 2) {
/* don't generate docstrings if -OO */
i = 1;
VISIT(c, expr, st->v.Expr.value);
@@ -1479,7 +1465,7 @@ compiler_function(struct compiler *c, stmt_ty s)
st = (stmt_ty)asdl_seq_GET(s->v.FunctionDef.body, 0);
docstring = compiler_isdocstring(st);
- if (docstring && Py_OptimizeFlag < 2)
+ if (docstring && c->c_optimize < 2)
first_const = st->v.Expr.value->v.Str.s;
if (compiler_add_o(c, c->u->u_consts, first_const) < 0) {
compiler_exit_scope(c);
@@ -1676,6 +1662,11 @@ compiler_lambda(struct compiler *c, expr_ty e)
if (!compiler_enter_scope(c, name, (void *)e, e->lineno))
return 0;
+ /* Make None the first constant, so the lambda can't have a
+ docstring. */
+ if (compiler_add_o(c, c->u->u_consts, Py_None) < 0)
+ return 0;
+
c->u->u_argcount = asdl_seq_LEN(args->args);
c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs);
VISIT_IN_SCOPE(c, expr, e->v.Lambda.body);
@@ -1708,7 +1699,7 @@ compiler_if(struct compiler *c, stmt_ty s)
if (end == NULL)
return 0;
- constant = expr_constant(s->v.If.test);
+ constant = expr_constant(c, s->v.If.test);
/* constant = 0: "if 0"
* constant = 1: "if 1", "if 2", ...
* constant = -1: rest */
@@ -1754,9 +1745,6 @@ compiler_for(struct compiler *c, stmt_ty s)
VISIT(c, expr, s->v.For.iter);
ADDOP(c, GET_ITER);
compiler_use_next_block(c, start);
- /* for expressions must be traced on each iteration,
- so we need to set an extra line number. */
- c->u->u_lineno_set = 0;
ADDOP_JREL(c, FOR_ITER, cleanup);
VISIT(c, expr, s->v.For.target);
VISIT_SEQ(c, stmt, s->v.For.body);
@@ -1773,7 +1761,7 @@ static int
compiler_while(struct compiler *c, stmt_ty s)
{
basicblock *loop, *orelse, *end, *anchor = NULL;
- int constant = expr_constant(s->v.While.test);
+ int constant = expr_constant(c, s->v.While.test);
if (constant == 0) {
if (s->v.While.orelse)
@@ -1802,9 +1790,6 @@ compiler_while(struct compiler *c, stmt_ty s)
if (!compiler_push_fblock(c, LOOP, loop))
return 0;
if (constant == -1) {
- /* while expressions must be traced on each iteration,
- so we need to set an extra line number. */
- c->u->u_lineno_set = 0;
VISIT(c, expr, s->v.While.test);
ADDOP_JABS(c, POP_JUMP_IF_FALSE, anchor);
}
@@ -1982,6 +1967,7 @@ compiler_try_except(struct compiler *c, stmt_ty s)
return compiler_error(c, "default 'except:' must be last");
c->u->u_lineno_set = 0;
c->u->u_lineno = handler->lineno;
+ c->u->u_col_offset = handler->col_offset;
except = compiler_new_block(c);
if (except == NULL)
return 0;
@@ -2154,6 +2140,13 @@ compiler_from_import(struct compiler *c, stmt_ty s)
PyObject *names = PyTuple_New(n);
PyObject *level;
+ static PyObject *empty_string;
+
+ if (!empty_string) {
+ empty_string = PyUnicode_FromString("");
+ if (!empty_string)
+ return 0;
+ }
if (!names)
return 0;
@@ -2171,23 +2164,24 @@ compiler_from_import(struct compiler *c, stmt_ty s)
PyTuple_SET_ITEM(names, i, alias->name);
}
- if (s->lineno > c->c_future->ff_lineno) {
- if (!PyUnicode_CompareWithASCIIString(s->v.ImportFrom.module,
- "__future__")) {
- Py_DECREF(level);
- Py_DECREF(names);
- return compiler_error(c,
- "from __future__ imports must occur "
- "at the beginning of the file");
-
- }
+ if (s->lineno > c->c_future->ff_lineno && s->v.ImportFrom.module &&
+ !PyUnicode_CompareWithASCIIString(s->v.ImportFrom.module, "__future__")) {
+ Py_DECREF(level);
+ Py_DECREF(names);
+ return compiler_error(c, "from __future__ imports must occur "
+ "at the beginning of the file");
}
ADDOP_O(c, LOAD_CONST, level, consts);
Py_DECREF(level);
ADDOP_O(c, LOAD_CONST, names, consts);
Py_DECREF(names);
- ADDOP_NAME(c, IMPORT_NAME, s->v.ImportFrom.module, names);
+ if (s->v.ImportFrom.module) {
+ ADDOP_NAME(c, IMPORT_NAME, s->v.ImportFrom.module, names);
+ }
+ else {
+ ADDOP_NAME(c, IMPORT_NAME, empty_string, names);
+ }
for (i = 0; i < n; i++) {
alias_ty alias = (alias_ty)asdl_seq_GET(s->v.ImportFrom.names, i);
identifier store_name;
@@ -2219,7 +2213,7 @@ compiler_assert(struct compiler *c, stmt_ty s)
static PyObject *assertion_error = NULL;
basicblock *end;
- if (Py_OptimizeFlag)
+ if (c->c_optimize)
return 1;
if (assertion_error == NULL) {
assertion_error = PyUnicode_InternFromString("AssertionError");
@@ -2256,6 +2250,7 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s)
/* Always assign a lineno to the next instruction for a stmt. */
c->u->u_lineno = s->lineno;
+ c->u->u_col_offset = s->col_offset;
c->u->u_lineno_set = 0;
switch (s->kind) {
@@ -2517,13 +2512,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
case AugLoad:
case AugStore:
break;
- case Del:
- PyErr_Format(PyExc_SyntaxError,
- "can not delete variable '%S' referenced "
- "in nested scope",
- name);
- Py_DECREF(mangled);
- return 0;
+ case Del: op = DELETE_DEREF; break;
case Param:
default:
PyErr_SetString(PyExc_SystemError,
@@ -3024,7 +3013,7 @@ compiler_visit_keyword(struct compiler *c, keyword_ty k)
*/
static int
-expr_constant(expr_ty e)
+expr_constant(struct compiler *c, expr_ty e)
{
char *id;
switch (e->kind) {
@@ -3042,7 +3031,7 @@ expr_constant(expr_ty e)
if (strcmp(id, "False") == 0) return 0;
if (strcmp(id, "None") == 0) return 0;
if (strcmp(id, "__debug__") == 0)
- return ! Py_OptimizeFlag;
+ return ! c->c_optimize;
/* fall through */
default:
return -1;
@@ -3075,86 +3064,32 @@ expr_constant(expr_ty e)
static int
compiler_with(struct compiler *c, stmt_ty s)
{
- static identifier enter_attr, exit_attr;
basicblock *block, *finally;
- identifier tmpvalue = NULL, tmpexit = NULL;
assert(s->kind == With_kind);
- if (!enter_attr) {
- enter_attr = PyUnicode_InternFromString("__enter__");
- if (!enter_attr)
- return 0;
- }
- if (!exit_attr) {
- exit_attr = PyUnicode_InternFromString("__exit__");
- if (!exit_attr)
- return 0;
- }
-
block = compiler_new_block(c);
finally = compiler_new_block(c);
if (!block || !finally)
return 0;
- if (s->v.With.optional_vars) {
- /* Create a temporary variable to hold context.__enter__().
- We need to do this rather than preserving it on the stack
- because SETUP_FINALLY remembers the stack level.
- We need to do the assignment *inside* the try/finally
- so that context.__exit__() is called when the assignment
- fails. But we need to call context.__enter__() *before*
- the try/finally so that if it fails we won't call
- context.__exit__().
- */
- tmpvalue = compiler_new_tmpname(c);
- if (tmpvalue == NULL)
- return 0;
- PyArena_AddPyObject(c->c_arena, tmpvalue);
- }
- tmpexit = compiler_new_tmpname(c);
- if (tmpexit == NULL)
- return 0;
- PyArena_AddPyObject(c->c_arena, tmpexit);
-
/* Evaluate EXPR */
VISIT(c, expr, s->v.With.context_expr);
+ ADDOP_JREL(c, SETUP_WITH, finally);
- /* Squirrel away context.__exit__ by stuffing it under context */
- ADDOP(c, DUP_TOP);
- ADDOP_O(c, LOAD_ATTR, exit_attr, names);
- if (!compiler_nameop(c, tmpexit, Store))
- return 0;
-
- /* Call context.__enter__() */
- ADDOP_O(c, LOAD_ATTR, enter_attr, names);
- ADDOP_I(c, CALL_FUNCTION, 0);
-
- if (s->v.With.optional_vars) {
- /* Store it in tmpvalue */
- if (!compiler_nameop(c, tmpvalue, Store))
- return 0;
- }
- else {
- /* Discard result from context.__enter__() */
- ADDOP(c, POP_TOP);
- }
-
- /* Start the try block */
- ADDOP_JREL(c, SETUP_FINALLY, finally);
-
+ /* SETUP_WITH pushes a finally block. */
compiler_use_next_block(c, block);
if (!compiler_push_fblock(c, FINALLY_TRY, block)) {
return 0;
}
if (s->v.With.optional_vars) {
- /* Bind saved result of context.__enter__() to VAR */
- if (!compiler_nameop(c, tmpvalue, Load) ||
- !compiler_nameop(c, tmpvalue, Del))
- return 0;
VISIT(c, expr, s->v.With.optional_vars);
}
+ else {
+ /* Discard result from context.__enter__() */
+ ADDOP(c, POP_TOP);
+ }
/* BLOCK code */
VISIT_SEQ(c, stmt, s->v.With.body);
@@ -3171,9 +3106,6 @@ compiler_with(struct compiler *c, stmt_ty s)
/* Finally block starts; context.__exit__ is on the stack under
the exception or return information. Just issue our magic
opcode. */
- if (!compiler_nameop(c, tmpexit, Load) ||
- !compiler_nameop(c, tmpexit, Del))
- return 0;
ADDOP(c, WITH_CLEANUP);
/* Finally block ends. */
@@ -3194,6 +3126,8 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
c->u->u_lineno = e->lineno;
c->u->u_lineno_set = 0;
}
+ /* Updating the column offset is always harmless. */
+ c->u->u_col_offset = e->col_offset;
switch (e->kind) {
case BoolOp_kind:
return compiler_boolop(c, e);
@@ -3427,7 +3361,7 @@ compiler_in_loop(struct compiler *c) {
static int
compiler_error(struct compiler *c, const char *errstr)
{
- PyObject *loc;
+ PyObject *loc, *filename;
PyObject *u = NULL, *v = NULL;
loc = PyErr_ProgramText(c->c_filename, c->u->u_lineno);
@@ -3435,8 +3369,17 @@ compiler_error(struct compiler *c, const char *errstr)
Py_INCREF(Py_None);
loc = Py_None;
}
- u = Py_BuildValue("(ziOO)", c->c_filename, c->u->u_lineno,
- Py_None, loc);
+ if (c->c_filename != NULL) {
+ filename = PyUnicode_DecodeFSDefault(c->c_filename);
+ if (!filename)
+ goto exit;
+ }
+ else {
+ Py_INCREF(Py_None);
+ filename = Py_None;
+ }
+ u = Py_BuildValue("(NiiO)", filename, c->u->u_lineno,
+ c->u->u_col_offset, loc);
if (!u)
goto exit;
v = Py_BuildValue("(zO)", errstr, u);
@@ -3470,7 +3413,7 @@ compiler_handle_subscr(struct compiler *c, const char *kind,
return 0;
}
if (ctx == AugLoad) {
- ADDOP_I(c, DUP_TOPX, 2);
+ ADDOP(c, DUP_TOP_TWO);
}
else if (ctx == AugStore) {
ADDOP(c, ROT_THREE);
@@ -3607,7 +3550,7 @@ dfs(struct compiler *c, basicblock *b, struct assembler *a)
static int
stackdepth_walk(struct compiler *c, basicblock *b, int depth, int maxdepth)
{
- int i;
+ int i, target_depth;
struct instr *instr;
if (b->b_seen || b->b_startdepth >= depth)
return maxdepth;
@@ -3620,8 +3563,17 @@ stackdepth_walk(struct compiler *c, basicblock *b, int depth, int maxdepth)
maxdepth = depth;
assert(depth >= 0); /* invalid code or bug in stackdepth() */
if (instr->i_jrel || instr->i_jabs) {
+ target_depth = depth;
+ if (instr->i_opcode == FOR_ITER) {
+ target_depth = depth-2;
+ } else if (instr->i_opcode == SETUP_FINALLY ||
+ instr->i_opcode == SETUP_EXCEPT) {
+ target_depth = depth+3;
+ if (target_depth > maxdepth)
+ maxdepth = target_depth;
+ }
maxdepth = stackdepth_walk(c, instr->i_target,
- depth, maxdepth);
+ target_depth, maxdepth);
if (instr->i_opcode == JUMP_ABSOLUTE ||
instr->i_opcode == JUMP_FORWARD) {
goto out; /* remaining code is dead */
@@ -3709,51 +3661,9 @@ blocksize(basicblock *b)
return size;
}
-/* All about a_lnotab.
-
-c_lnotab is an array of unsigned bytes disguised as a Python string.
-It is used to map bytecode offsets to source code line #s (when needed
-for tracebacks).
-
-The array is conceptually a list of
- (bytecode offset increment, line number increment)
-pairs. The details are important and delicate, best illustrated by example:
-
- byte code offset source code line number
- 0 1
- 6 2
- 50 7
- 350 307
- 361 308
-
-The first trick is that these numbers aren't stored, only the increments
-from one row to the next (this doesn't really work, but it's a start):
-
- 0, 1, 6, 1, 44, 5, 300, 300, 11, 1
-
-The second trick is that an unsigned byte can't hold negative values, or
-values larger than 255, so (a) there's a deep assumption that byte code
-offsets and their corresponding line #s both increase monotonically, and (b)
-if at least one column jumps by more than 255 from one row to the next, more
-than one pair is written to the table. In case #b, there's no way to know
-from looking at the table later how many were written. That's the delicate
-part. A user of c_lnotab desiring to find the source line number
-corresponding to a bytecode address A should do something like this
-
- lineno = addr = 0
- for addr_incr, line_incr in c_lnotab:
- addr += addr_incr
- if addr > A:
- return lineno
- lineno += line_incr
-
-In order for this to work, when the addr field increments by more than 255,
-the line # increment in each pair generated must be 0 until the remaining addr
-increment is < 256. So, in the example above, assemble_lnotab (it used
-to be called com_set_lineno) should not (as was actually done until 2.2)
-expand 300, 300 to 255, 255, 45, 45,
- but to 255, 0, 45, 255, 0, 45.
-*/
+/* Appends a pair to the end of the line number table, a_lnotab, representing
+ the instruction's bytecode offset and line number. See
+ Objects/lnotab_notes.txt for the description of the line number table. */
static int
assemble_lnotab(struct assembler *a, struct instr *i)
@@ -3895,49 +3805,47 @@ static void
assemble_jump_offsets(struct assembler *a, struct compiler *c)
{
basicblock *b;
- int bsize, totsize, extended_arg_count, last_extended_arg_count = 0;
+ int bsize, totsize, extended_arg_count = 0, last_extended_arg_count;
int i;
/* Compute the size of each block and fixup jump args.
Replace block pointer with position in bytecode. */
-start:
- totsize = 0;
- for (i = a->a_nblocks - 1; i >= 0; i--) {
- b = a->a_postorder[i];
- bsize = blocksize(b);
- b->b_offset = totsize;
- totsize += bsize;
- }
- extended_arg_count = 0;
- for (b = c->u->u_blocks; b != NULL; b = b->b_list) {
- bsize = b->b_offset;
- for (i = 0; i < b->b_iused; i++) {
- struct instr *instr = &b->b_instr[i];
- /* Relative jumps are computed relative to
- the instruction pointer after fetching
- the jump instruction.
- */
- bsize += instrsize(instr);
- if (instr->i_jabs)
- instr->i_oparg = instr->i_target->b_offset;
- else if (instr->i_jrel) {
- int delta = instr->i_target->b_offset - bsize;
- instr->i_oparg = delta;
+ do {
+ totsize = 0;
+ for (i = a->a_nblocks - 1; i >= 0; i--) {
+ b = a->a_postorder[i];
+ bsize = blocksize(b);
+ b->b_offset = totsize;
+ totsize += bsize;
+ }
+ last_extended_arg_count = extended_arg_count;
+ extended_arg_count = 0;
+ for (b = c->u->u_blocks; b != NULL; b = b->b_list) {
+ bsize = b->b_offset;
+ for (i = 0; i < b->b_iused; i++) {
+ struct instr *instr = &b->b_instr[i];
+ /* Relative jumps are computed relative to
+ the instruction pointer after fetching
+ the jump instruction.
+ */
+ bsize += instrsize(instr);
+ if (instr->i_jabs)
+ instr->i_oparg = instr->i_target->b_offset;
+ else if (instr->i_jrel) {
+ int delta = instr->i_target->b_offset - bsize;
+ instr->i_oparg = delta;
+ }
+ else
+ continue;
+ if (instr->i_oparg > 0xffff)
+ extended_arg_count++;
}
- else
- continue;
- if (instr->i_oparg > 0xffff)
- extended_arg_count++;
}
- }
/* XXX: This is an awful hack that could hurt performance, but
on the bright side it should work until we come up
with a better solution.
- In the meantime, should the goto be dropped in favor
- of a loop?
-
The issue is that in the first loop blocksize() is called
which calls instrsize() which requires i_oparg be set
appropriately. There is a bootstrap problem because
@@ -3948,10 +3856,7 @@ start:
ones in jump instructions. So this should converge
fairly quickly.
*/
- if (last_extended_arg_count != extended_arg_count) {
- last_extended_arg_count = extended_arg_count;
- goto start;
- }
+ } while (last_extended_arg_count != extended_arg_count);
}
static PyObject *
@@ -4177,3 +4082,13 @@ assemble(struct compiler *c, int addNone)
assemble_free(&a);
return co;
}
+
+#undef PyAST_Compile
+PyAPI_FUNC(PyCodeObject *)
+PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
+ PyArena *arena)
+{
+ return PyAST_CompileEx(mod, filename, flags, -1, arena);
+}
+
+
diff --git a/Python/dtoa.c b/Python/dtoa.c
index 4b2c6c36e3..44dc01f1d5 100644
--- a/Python/dtoa.c
+++ b/Python/dtoa.c
@@ -1382,7 +1382,6 @@ bigcomp(U *rv, const char *s0, BCinfo *bc)
Bigint *b, *d;
int b2, d2, dd, i, nd, nd0, odd, p2, p5;
- dd = 0; /* silence compiler warning about possibly unused variable */
nd = bc->nd;
nd0 = bc->nd0;
p5 = nd + bc->e0;
@@ -2362,7 +2361,7 @@ _Py_dg_dtoa(double dd, int mode, int ndigits,
/* set pointers to NULL, to silence gcc compiler warnings and make
cleanup easier on error */
- mlo = mhi = b = S = 0;
+ mlo = mhi = S = 0;
s0 = 0;
u.d = dd;
@@ -2713,8 +2712,6 @@ _Py_dg_dtoa(double dd, int mode, int ndigits,
* and for all and pass them and a shift to quorem, so it
* can do shifts and ors to compute the numerator for q.
*/
- if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f))
- i = 32 - i;
#define iInc 28
i = dshift(S, s2);
b2 += i;
diff --git a/Python/dynamic_annotations.c b/Python/dynamic_annotations.c
new file mode 100644
index 0000000000..10511da466
--- /dev/null
+++ b/Python/dynamic_annotations.c
@@ -0,0 +1,154 @@
+/* Copyright (c) 2008-2009, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ---
+ * Author: Kostya Serebryany
+ */
+
+#ifdef _MSC_VER
+# include <windows.h>
+#endif
+
+#ifdef __cplusplus
+# error "This file should be built as pure C to avoid name mangling"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "dynamic_annotations.h"
+
+/* Each function is empty and called (via a macro) only in debug mode.
+ The arguments are captured by dynamic tools at runtime. */
+
+#if DYNAMIC_ANNOTATIONS_ENABLED == 1
+
+void AnnotateRWLockCreate(const char *file, int line,
+ const volatile void *lock){}
+void AnnotateRWLockDestroy(const char *file, int line,
+ const volatile void *lock){}
+void AnnotateRWLockAcquired(const char *file, int line,
+ const volatile void *lock, long is_w){}
+void AnnotateRWLockReleased(const char *file, int line,
+ const volatile void *lock, long is_w){}
+void AnnotateBarrierInit(const char *file, int line,
+ const volatile void *barrier, long count,
+ long reinitialization_allowed) {}
+void AnnotateBarrierWaitBefore(const char *file, int line,
+ const volatile void *barrier) {}
+void AnnotateBarrierWaitAfter(const char *file, int line,
+ const volatile void *barrier) {}
+void AnnotateBarrierDestroy(const char *file, int line,
+ const volatile void *barrier) {}
+
+void AnnotateCondVarWait(const char *file, int line,
+ const volatile void *cv,
+ const volatile void *lock){}
+void AnnotateCondVarSignal(const char *file, int line,
+ const volatile void *cv){}
+void AnnotateCondVarSignalAll(const char *file, int line,
+ const volatile void *cv){}
+void AnnotatePublishMemoryRange(const char *file, int line,
+ const volatile void *address,
+ long size){}
+void AnnotateUnpublishMemoryRange(const char *file, int line,
+ const volatile void *address,
+ long size){}
+void AnnotatePCQCreate(const char *file, int line,
+ const volatile void *pcq){}
+void AnnotatePCQDestroy(const char *file, int line,
+ const volatile void *pcq){}
+void AnnotatePCQPut(const char *file, int line,
+ const volatile void *pcq){}
+void AnnotatePCQGet(const char *file, int line,
+ const volatile void *pcq){}
+void AnnotateNewMemory(const char *file, int line,
+ const volatile void *mem,
+ long size){}
+void AnnotateExpectRace(const char *file, int line,
+ const volatile void *mem,
+ const char *description){}
+void AnnotateBenignRace(const char *file, int line,
+ const volatile void *mem,
+ const char *description){}
+void AnnotateBenignRaceSized(const char *file, int line,
+ const volatile void *mem,
+ long size,
+ const char *description) {}
+void AnnotateMutexIsUsedAsCondVar(const char *file, int line,
+ const volatile void *mu){}
+void AnnotateTraceMemory(const char *file, int line,
+ const volatile void *arg){}
+void AnnotateThreadName(const char *file, int line,
+ const char *name){}
+void AnnotateIgnoreReadsBegin(const char *file, int line){}
+void AnnotateIgnoreReadsEnd(const char *file, int line){}
+void AnnotateIgnoreWritesBegin(const char *file, int line){}
+void AnnotateIgnoreWritesEnd(const char *file, int line){}
+void AnnotateIgnoreSyncBegin(const char *file, int line){}
+void AnnotateIgnoreSyncEnd(const char *file, int line){}
+void AnnotateEnableRaceDetection(const char *file, int line, int enable){}
+void AnnotateNoOp(const char *file, int line,
+ const volatile void *arg){}
+void AnnotateFlushState(const char *file, int line){}
+
+static int GetRunningOnValgrind(void) {
+#ifdef RUNNING_ON_VALGRIND
+ if (RUNNING_ON_VALGRIND) return 1;
+#endif
+
+#ifndef _MSC_VER
+ char *running_on_valgrind_str = getenv("RUNNING_ON_VALGRIND");
+ if (running_on_valgrind_str) {
+ return strcmp(running_on_valgrind_str, "0") != 0;
+ }
+#else
+ /* Visual Studio issues warnings if we use getenv,
+ * so we use GetEnvironmentVariableA instead.
+ */
+ char value[100] = "1";
+ int res = GetEnvironmentVariableA("RUNNING_ON_VALGRIND",
+ value, sizeof(value));
+ /* value will remain "1" if res == 0 or res >= sizeof(value). The latter
+ * can happen only if the given value is long, in this case it can't be "0".
+ */
+ if (res > 0 && !strcmp(value, "0"))
+ return 1;
+#endif
+ return 0;
+}
+
+/* See the comments in dynamic_annotations.h */
+int RunningOnValgrind(void) {
+ static volatile int running_on_valgrind = -1;
+ /* C doesn't have thread-safe initialization of statics, and we
+ don't want to depend on pthread_once here, so hack it. */
+ int local_running_on_valgrind = running_on_valgrind;
+ if (local_running_on_valgrind == -1)
+ running_on_valgrind = local_running_on_valgrind = GetRunningOnValgrind();
+ return local_running_on_valgrind;
+}
+
+#endif /* DYNAMIC_ANNOTATIONS_ENABLED == 1 */
diff --git a/Python/dynload_atheos.c b/Python/dynload_atheos.c
deleted file mode 100644
index 396a35bb9e..0000000000
--- a/Python/dynload_atheos.c
+++ /dev/null
@@ -1,47 +0,0 @@
-
-/* Support for dynamic loading of extension modules */
-
-#include <atheos/image.h>
-#include <errno.h>
-
-#include "Python.h"
-#include "importdl.h"
-
-
-const struct filedescr _PyImport_DynLoadFiletab[] = {
- {".so", "rb", C_EXTENSION},
- {"module.so", "rb", C_EXTENSION},
- {0, 0}
-};
-
-dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
- const char *pathname, FILE *fp)
-{
- void *p;
- int lib;
- char funcname[258];
-
- if (Py_VerboseFlag)
- printf("load_library %s\n", pathname);
-
- lib = load_library(pathname, 0);
- if (lib < 0) {
- char buf[512];
- if (Py_VerboseFlag)
- perror(pathname);
- PyOS_snprintf(buf, sizeof(buf), "Failed to load %.200s: %.200s",
- pathname, strerror(errno));
- PyErr_SetString(PyExc_ImportError, buf);
- return NULL;
- }
- PyOS_snprintf(funcname, sizeof(funcname), "PyInit_%.200s", shortname);
- if (Py_VerboseFlag)
- printf("get_symbol_address %s\n", funcname);
- if (get_symbol_address(lib, funcname, -1, &p) < 0) {
- p = NULL;
- if (Py_VerboseFlag)
- perror(funcname);
- }
-
- return (dl_funcptr) p;
-}
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 87dae27ed4..7ea510e862 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -30,27 +30,36 @@
#define LEAD_UNDERSCORE ""
#endif
+/* The .so extension module ABI tag, supplied by the Makefile via
+ Makefile.pre.in and configure. This is used to discriminate between
+ incompatible .so files so that extensions for different Python builds can
+ live in the same directory. E.g. foomodule.cpython-32.so
+*/
const struct filedescr _PyImport_DynLoadFiletab[] = {
#ifdef __CYGWIN__
{".dll", "rb", C_EXTENSION},
{"module.dll", "rb", C_EXTENSION},
-#else
+#else /* !__CYGWIN__ */
#if defined(PYOS_OS2) && defined(PYCC_GCC)
{".pyd", "rb", C_EXTENSION},
{".dll", "rb", C_EXTENSION},
-#else
+#else /* !(defined(PYOS_OS2) && defined(PYCC_GCC)) */
#ifdef __VMS
{".exe", "rb", C_EXTENSION},
{".EXE", "rb", C_EXTENSION},
{"module.exe", "rb", C_EXTENSION},
{"MODULE.EXE", "rb", C_EXTENSION},
-#else
+#else /* !__VMS */
+ {"." SOABI ".so", "rb", C_EXTENSION},
+ {"module." SOABI ".so", "rb", C_EXTENSION},
+ {".abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
+ {"module.abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
{".so", "rb", C_EXTENSION},
{"module.so", "rb", C_EXTENSION},
-#endif
-#endif
-#endif
+#endif /* __VMS */
+#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
+#endif /* __CYGWIN__ */
{0, 0}
};
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
index e7d61ce8e0..73a1dcf897 100644
--- a/Python/dynload_win.c
+++ b/Python/dynload_win.c
@@ -134,6 +134,15 @@ static char *GetPythonImport (HINSTANCE hModule)
!strncmp(import_name,"python",6)) {
char *pch;
+#ifndef _DEBUG
+ /* In a release version, don't claim that python3.dll is
+ a Python DLL. */
+ if (strcmp(import_name, "python3.dll") == 0) {
+ import_data += 20;
+ continue;
+ }
+#endif
+
/* Ensure python prefix is followed only
by numbers to the end of the basename */
pch = import_name + 6;
@@ -162,13 +171,16 @@ static char *GetPythonImport (HINSTANCE hModule)
return NULL;
}
-
dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
const char *pathname, FILE *fp)
{
dl_funcptr p;
char funcname[258], *import_python;
+#ifndef _DEBUG
+ _Py_CheckPython3();
+#endif
+
PyOS_snprintf(funcname, sizeof(funcname), "PyInit_%.200s", shortname);
{
diff --git a/Python/errors.c b/Python/errors.c
index db0baf1c24..5a9a624279 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -130,9 +130,14 @@ PyErr_SetString(PyObject *exception, const char *string)
PyObject *
PyErr_Occurred(void)
{
- PyThreadState *tstate = PyThreadState_GET();
-
- return tstate->curexc_type;
+ /* If there is no thread state, PyThreadState_GET calls
+ Py_FatalError, which calls PyErr_Occurred. To avoid the
+ resulting infinite loop, we inline PyThreadState_GET here and
+ treat no thread as no error. */
+ PyThreadState *tstate =
+ ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current));
+
+ return tstate == NULL ? NULL : tstate->curexc_type;
}
@@ -338,25 +343,17 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
PyObject *message;
PyObject *v;
int i = errno;
-#ifdef PLAN9
- char errbuf[ERRMAX];
-#else
#ifndef MS_WINDOWS
char *s;
#else
WCHAR *s_buf = NULL;
#endif /* Unix/Windows */
-#endif /* PLAN 9*/
#ifdef EINTR
if (i == EINTR && PyErr_CheckSignals())
return NULL;
#endif
-#ifdef PLAN9
- rerrstr(errbuf, sizeof errbuf);
- message = PyUnicode_DecodeUTF8(errbuf, strlen(errbuf), "ignore");
-#else
#ifndef MS_WINDOWS
if (i == 0)
s = "Error"; /* Sometimes errno didn't get set */
@@ -403,7 +400,6 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
}
}
#endif /* Unix/Windows */
-#endif /* PLAN 9*/
if (message == NULL)
{
@@ -433,7 +429,7 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
PyObject *
PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
{
- PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
+ PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
Py_XDECREF(name);
return result;
@@ -519,7 +515,7 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilename(
int ierr,
const char *filename)
{
- PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
+ PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObject(exc,
ierr,
name);
@@ -556,7 +552,7 @@ PyObject *PyErr_SetFromWindowsErrWithFilename(
int ierr,
const char *filename)
{
- PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
+ PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject(
PyExc_WindowsError,
ierr, name);
@@ -661,7 +657,7 @@ PyErr_NewException(const char *name, PyObject *base, PyObject *dict)
goto failure;
}
/* Create a real new-style class. */
- result = PyObject_CallFunction((PyObject *)&PyType_Type, "UOO",
+ result = PyObject_CallFunction((PyObject *)&PyType_Type, "sOO",
dot+1, bases, dict);
failure:
Py_XDECREF(bases);
@@ -671,6 +667,41 @@ PyErr_NewException(const char *name, PyObject *base, PyObject *dict)
return result;
}
+
+/* Create an exception with docstring */
+PyObject *
+PyErr_NewExceptionWithDoc(const char *name, const char *doc,
+ PyObject *base, PyObject *dict)
+{
+ int result;
+ PyObject *ret = NULL;
+ PyObject *mydict = NULL; /* points to the dict only if we create it */
+ PyObject *docobj;
+
+ if (dict == NULL) {
+ dict = mydict = PyDict_New();
+ if (dict == NULL) {
+ return NULL;
+ }
+ }
+
+ if (doc != NULL) {
+ docobj = PyUnicode_FromString(doc);
+ if (docobj == NULL)
+ goto failure;
+ result = PyDict_SetItemString(dict, "__doc__", docobj);
+ Py_DECREF(docobj);
+ if (result < 0)
+ goto failure;
+ }
+
+ ret = PyErr_NewException(name, base, dict);
+ failure:
+ Py_XDECREF(mydict);
+ return ret;
+}
+
+
/* Call when an exception has occurred but there is no way for Python
to handle it. Examples: exception in __del__ or during GC. */
void
@@ -714,8 +745,10 @@ PyErr_WriteUnraisable(PyObject *obj)
}
Py_XDECREF(moduleName);
}
- PyFile_WriteString(" in ", f);
- PyFile_WriteObject(obj, f, 0);
+ if (obj) {
+ PyFile_WriteString(" in ", f);
+ PyFile_WriteObject(obj, f, 0);
+ }
PyFile_WriteString(" ignored\n", f);
PyErr_Clear(); /* Just in case */
}
@@ -727,12 +760,18 @@ PyErr_WriteUnraisable(PyObject *obj)
extern PyObject *PyModule_GetWarningsModule(void);
+void
+PyErr_SyntaxLocation(const char *filename, int lineno) {
+ PyErr_SyntaxLocationEx(filename, lineno, -1);
+}
+
+
/* Set file and line information for the current exception.
If the exception is not a SyntaxError, also sets additional attributes
to make printing of exceptions believe it is a syntax error. */
void
-PyErr_SyntaxLocation(const char *filename, int lineno)
+PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset)
{
PyObject *exc, *v, *tb, *tmp;
@@ -749,8 +788,18 @@ PyErr_SyntaxLocation(const char *filename, int lineno)
PyErr_Clear();
Py_DECREF(tmp);
}
+ if (col_offset >= 0) {
+ tmp = PyLong_FromLong(col_offset);
+ if (tmp == NULL)
+ PyErr_Clear();
+ else {
+ if (PyObject_SetAttrString(v, "offset", tmp))
+ PyErr_Clear();
+ Py_DECREF(tmp);
+ }
+ }
if (filename != NULL) {
- tmp = PyUnicode_FromString(filename);
+ tmp = PyUnicode_DecodeFSDefault(filename);
if (tmp == NULL)
PyErr_Clear();
else {
diff --git a/Python/fileutils.c b/Python/fileutils.c
new file mode 100644
index 0000000000..c563eaa5fb
--- /dev/null
+++ b/Python/fileutils.c
@@ -0,0 +1,431 @@
+#include "Python.h"
+#ifdef MS_WINDOWS
+# include <windows.h>
+#endif
+
+#ifdef HAVE_STAT
+
+/* Decode a byte string from the locale encoding with the
+ surrogateescape error handler (undecodable bytes are decoded as characters
+ in range U+DC80..U+DCFF). If a byte sequence can be decoded as a surrogate
+ character, escape the bytes using the surrogateescape error handler instead
+ of decoding them.
+
+ Use _Py_wchar2char() to encode the character string back to a byte string.
+
+ Return a pointer to a newly allocated wide character string (use
+ PyMem_Free() to free the memory) and write the number of written wide
+ characters excluding the null character into *size if size is not NULL, or
+ NULL on error (conversion or memory allocation error).
+
+ Conversion errors should never happen, unless there is a bug in the C
+ library. */
+wchar_t*
+_Py_char2wchar(const char* arg, size_t *size)
+{
+ wchar_t *res;
+#ifdef HAVE_BROKEN_MBSTOWCS
+ /* Some platforms have a broken implementation of
+ * mbstowcs which does not count the characters that
+ * would result from conversion. Use an upper bound.
+ */
+ size_t argsize = strlen(arg);
+#else
+ size_t argsize = mbstowcs(NULL, arg, 0);
+#endif
+ size_t count;
+ unsigned char *in;
+ wchar_t *out;
+#ifdef HAVE_MBRTOWC
+ mbstate_t mbs;
+#endif
+ if (argsize != (size_t)-1) {
+ res = (wchar_t *)PyMem_Malloc((argsize+1)*sizeof(wchar_t));
+ if (!res)
+ goto oom;
+ count = mbstowcs(res, arg, argsize+1);
+ if (count != (size_t)-1) {
+ wchar_t *tmp;
+ /* Only use the result if it contains no
+ surrogate characters. */
+ for (tmp = res; *tmp != 0 &&
+ (*tmp < 0xd800 || *tmp > 0xdfff); tmp++)
+ ;
+ if (*tmp == 0) {
+ if (size != NULL)
+ *size = count;
+ return res;
+ }
+ }
+ PyMem_Free(res);
+ }
+ /* Conversion failed. Fall back to escaping with surrogateescape. */
+#ifdef HAVE_MBRTOWC
+ /* Try conversion with mbrtwoc (C99), and escape non-decodable bytes. */
+
+ /* Overallocate; as multi-byte characters are in the argument, the
+ actual output could use less memory. */
+ argsize = strlen(arg) + 1;
+ res = (wchar_t*)PyMem_Malloc(argsize*sizeof(wchar_t));
+ if (!res)
+ goto oom;
+ in = (unsigned char*)arg;
+ out = res;
+ memset(&mbs, 0, sizeof mbs);
+ while (argsize) {
+ size_t converted = mbrtowc(out, (char*)in, argsize, &mbs);
+ if (converted == 0)
+ /* Reached end of string; null char stored. */
+ break;
+ if (converted == (size_t)-2) {
+ /* Incomplete character. This should never happen,
+ since we provide everything that we have -
+ unless there is a bug in the C library, or I
+ misunderstood how mbrtowc works. */
+ fprintf(stderr, "unexpected mbrtowc result -2\n");
+ PyMem_Free(res);
+ return NULL;
+ }
+ if (converted == (size_t)-1) {
+ /* Conversion error. Escape as UTF-8b, and start over
+ in the initial shift state. */
+ *out++ = 0xdc00 + *in++;
+ argsize--;
+ memset(&mbs, 0, sizeof mbs);
+ continue;
+ }
+ if (*out >= 0xd800 && *out <= 0xdfff) {
+ /* Surrogate character. Escape the original
+ byte sequence with surrogateescape. */
+ argsize -= converted;
+ while (converted--)
+ *out++ = 0xdc00 + *in++;
+ continue;
+ }
+ /* successfully converted some bytes */
+ in += converted;
+ argsize -= converted;
+ out++;
+ }
+#else
+ /* Cannot use C locale for escaping; manually escape as if charset
+ is ASCII (i.e. escape all bytes > 128. This will still roundtrip
+ correctly in the locale's charset, which must be an ASCII superset. */
+ res = PyMem_Malloc((strlen(arg)+1)*sizeof(wchar_t));
+ if (!res) goto oom;
+ in = (unsigned char*)arg;
+ out = res;
+ while(*in)
+ if(*in < 128)
+ *out++ = *in++;
+ else
+ *out++ = 0xdc00 + *in++;
+ *out = 0;
+#endif
+ if (size != NULL)
+ *size = out - res;
+ return res;
+oom:
+ fprintf(stderr, "out of memory\n");
+ return NULL;
+}
+
+/* Encode a (wide) character string to the locale encoding with the
+ surrogateescape error handler (characters in range U+DC80..U+DCFF are
+ converted to bytes 0x80..0xFF).
+
+ This function is the reverse of _Py_char2wchar().
+
+ Return a pointer to a newly allocated byte string (use PyMem_Free() to free
+ the memory), or NULL on conversion or memory allocation error.
+
+ If error_pos is not NULL: *error_pos is the index of the invalid character
+ on conversion error, or (size_t)-1 otherwise. */
+char*
+_Py_wchar2char(const wchar_t *text, size_t *error_pos)
+{
+ const size_t len = wcslen(text);
+ char *result = NULL, *bytes = NULL;
+ size_t i, size, converted;
+ wchar_t c, buf[2];
+
+ if (error_pos != NULL)
+ *error_pos = (size_t)-1;
+
+ /* The function works in two steps:
+ 1. compute the length of the output buffer in bytes (size)
+ 2. outputs the bytes */
+ size = 0;
+ buf[1] = 0;
+ while (1) {
+ for (i=0; i < len; i++) {
+ c = text[i];
+ if (c >= 0xdc80 && c <= 0xdcff) {
+ /* UTF-8b surrogate */
+ if (bytes != NULL) {
+ *bytes++ = c - 0xdc00;
+ size--;
+ }
+ else
+ size++;
+ continue;
+ }
+ else {
+ buf[0] = c;
+ if (bytes != NULL)
+ converted = wcstombs(bytes, buf, size);
+ else
+ converted = wcstombs(NULL, buf, 0);
+ if (converted == (size_t)-1) {
+ if (result != NULL)
+ PyMem_Free(result);
+ if (error_pos != NULL)
+ *error_pos = i;
+ return NULL;
+ }
+ if (bytes != NULL) {
+ bytes += converted;
+ size -= converted;
+ }
+ else
+ size += converted;
+ }
+ }
+ if (result != NULL) {
+ *bytes = 0;
+ break;
+ }
+
+ size += 1; /* nul byte at the end */
+ result = PyMem_Malloc(size);
+ if (result == NULL)
+ return NULL;
+ bytes = result;
+ }
+ return result;
+}
+
+/* In principle, this should use HAVE__WSTAT, and _wstat
+ should be detected by autoconf. However, no current
+ POSIX system provides that function, so testing for
+ it is pointless.
+ Not sure whether the MS_WINDOWS guards are necessary:
+ perhaps for cygwin/mingw builds?
+*/
+#if defined(HAVE_STAT) && !defined(MS_WINDOWS)
+
+/* Get file status. Encode the path to the locale encoding. */
+
+int
+_Py_wstat(const wchar_t* path, struct stat *buf)
+{
+ int err;
+ char *fname;
+ fname = _Py_wchar2char(path, NULL);
+ if (fname == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ err = stat(fname, buf);
+ PyMem_Free(fname);
+ return err;
+}
+#endif
+
+/* Call _wstat() on Windows, or encode the path to the filesystem encoding and
+ call stat() otherwise. Only fill st_mode attribute on Windows.
+
+ Return 0 on success, -1 on _wstat() / stat() error or (if PyErr_Occurred())
+ unicode error. */
+
+int
+_Py_stat(PyObject *path, struct stat *statbuf)
+{
+#ifdef MS_WINDOWS
+ int err;
+ struct _stat wstatbuf;
+
+ err = _wstat(PyUnicode_AS_UNICODE(path), &wstatbuf);
+ if (!err)
+ statbuf->st_mode = wstatbuf.st_mode;
+ return err;
+#else
+ int ret;
+ PyObject *bytes = PyUnicode_EncodeFSDefault(path);
+ if (bytes == NULL)
+ return -1;
+ ret = stat(PyBytes_AS_STRING(bytes), statbuf);
+ Py_DECREF(bytes);
+ return ret;
+#endif
+}
+
+/* Open a file. Use _wfopen() on Windows, encode the path to the locale
+ encoding and use fopen() otherwise. */
+
+FILE *
+_Py_wfopen(const wchar_t *path, const wchar_t *mode)
+{
+#ifndef MS_WINDOWS
+ FILE *f;
+ char *cpath;
+ char cmode[10];
+ size_t r;
+ r = wcstombs(cmode, mode, 10);
+ if (r == (size_t)-1 || r >= 10) {
+ errno = EINVAL;
+ return NULL;
+ }
+ cpath = _Py_wchar2char(path, NULL);
+ if (cpath == NULL)
+ return NULL;
+ f = fopen(cpath, cmode);
+ PyMem_Free(cpath);
+ return f;
+#else
+ return _wfopen(path, mode);
+#endif
+}
+
+/* Call _wfopen() on Windows, or encode the path to the filesystem encoding and
+ call fopen() otherwise.
+
+ Return the new file object on success, or NULL if the file cannot be open or
+ (if PyErr_Occurred()) on unicode error */
+
+FILE*
+_Py_fopen(PyObject *path, const char *mode)
+{
+#ifdef MS_WINDOWS
+ wchar_t wmode[10];
+ int usize;
+
+ usize = MultiByteToWideChar(CP_ACP, 0, mode, -1, wmode, sizeof(wmode));
+ if (usize == 0)
+ return NULL;
+
+ return _wfopen(PyUnicode_AS_UNICODE(path), wmode);
+#else
+ FILE *f;
+ PyObject *bytes = PyUnicode_EncodeFSDefault(path);
+ if (bytes == NULL)
+ return NULL;
+ f = fopen(PyBytes_AS_STRING(bytes), mode);
+ Py_DECREF(bytes);
+ return f;
+#endif
+}
+
+#ifdef HAVE_READLINK
+
+/* Read value of symbolic link. Encode the path to the locale encoding, decode
+ the result from the locale encoding. */
+
+int
+_Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
+{
+ char *cpath;
+ char cbuf[PATH_MAX];
+ wchar_t *wbuf;
+ int res;
+ size_t r1;
+
+ cpath = _Py_wchar2char(path, NULL);
+ if (cpath == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ res = (int)readlink(cpath, cbuf, PATH_MAX);
+ PyMem_Free(cpath);
+ if (res == -1)
+ return -1;
+ if (res == PATH_MAX) {
+ errno = EINVAL;
+ return -1;
+ }
+ cbuf[res] = '\0'; /* buf will be null terminated */
+ wbuf = _Py_char2wchar(cbuf, &r1);
+ if (wbuf == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ if (bufsiz <= r1) {
+ PyMem_Free(wbuf);
+ errno = EINVAL;
+ return -1;
+ }
+ wcsncpy(buf, wbuf, bufsiz);
+ PyMem_Free(wbuf);
+ return (int)r1;
+}
+#endif
+
+#ifdef HAVE_REALPATH
+
+/* Return the canonicalized absolute pathname. Encode path to the locale
+ encoding, decode the result from the locale encoding. */
+
+wchar_t*
+_Py_wrealpath(const wchar_t *path,
+ wchar_t *resolved_path, size_t resolved_path_size)
+{
+ char *cpath;
+ char cresolved_path[PATH_MAX];
+ wchar_t *wresolved_path;
+ char *res;
+ size_t r;
+ cpath = _Py_wchar2char(path, NULL);
+ if (cpath == NULL) {
+ errno = EINVAL;
+ return NULL;
+ }
+ res = realpath(cpath, cresolved_path);
+ PyMem_Free(cpath);
+ if (res == NULL)
+ return NULL;
+
+ wresolved_path = _Py_char2wchar(cresolved_path, &r);
+ if (wresolved_path == NULL) {
+ errno = EINVAL;
+ return NULL;
+ }
+ if (resolved_path_size <= r) {
+ PyMem_Free(wresolved_path);
+ errno = EINVAL;
+ return NULL;
+ }
+ wcsncpy(resolved_path, wresolved_path, resolved_path_size);
+ PyMem_Free(wresolved_path);
+ return resolved_path;
+}
+#endif
+
+/* Get the current directory. size is the buffer size in wide characters
+ including the null character. Decode the path from the locale encoding. */
+
+wchar_t*
+_Py_wgetcwd(wchar_t *buf, size_t size)
+{
+#ifdef MS_WINDOWS
+ return _wgetcwd(buf, size);
+#else
+ char fname[PATH_MAX];
+ wchar_t *wname;
+ size_t len;
+
+ if (getcwd(fname, PATH_MAX) == NULL)
+ return NULL;
+ wname = _Py_char2wchar(fname, &len);
+ if (wname == NULL)
+ return NULL;
+ if (size <= len) {
+ PyMem_Free(wname);
+ return NULL;
+ }
+ wcsncpy(buf, wname, size);
+ PyMem_Free(wname);
+ return buf;
+#endif
+}
+
+#endif
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c
index 79cb5f9192..c350907da1 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -9,8 +9,6 @@
#define FORMAT_STRING _PyUnicode_FormatAdvanced
#define FORMAT_LONG _PyLong_FormatAdvanced
#define FORMAT_FLOAT _PyFloat_FormatAdvanced
-#ifndef WITHOUT_COMPLEX
#define FORMAT_COMPLEX _PyComplex_FormatAdvanced
-#endif
#include "../Objects/stringlib/formatter.h"
diff --git a/Python/future.c b/Python/future.c
index 515dcd9dc6..d6b653f315 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -4,7 +4,6 @@
#include "token.h"
#include "graminit.h"
#include "code.h"
-#include "compile.h"
#include "symtable.h"
#define UNDEFINED_FUTURE_FEATURE "future feature %.100s is not defined"
@@ -44,12 +43,12 @@ future_check_features(PyFutureFeatures *ff, stmt_ty s, const char *filename)
} else if (strcmp(feature, "braces") == 0) {
PyErr_SetString(PyExc_SyntaxError,
"not a chance");
- PyErr_SyntaxLocation(filename, s->lineno);
+ PyErr_SyntaxLocationEx(filename, s->lineno, s->col_offset);
return 0;
} else {
PyErr_Format(PyExc_SyntaxError,
UNDEFINED_FUTURE_FEATURE, feature);
- PyErr_SyntaxLocation(filename, s->lineno);
+ PyErr_SyntaxLocationEx(filename, s->lineno, s->col_offset);
return 0;
}
}
@@ -98,8 +97,7 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename)
if (done) {
PyErr_SetString(PyExc_SyntaxError,
ERR_LATE_FUTURE);
- PyErr_SyntaxLocation(filename,
- s->lineno);
+ PyErr_SyntaxLocationEx(filename, s->lineno, s->col_offset);
return 0;
}
if (!future_check_features(ff, s, filename))
diff --git a/Python/getargs.c b/Python/getargs.c
index 0009b35426..600941d9c7 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -105,15 +105,7 @@ PyArg_VaParse(PyObject *args, const char *format, va_list va)
{
va_list lva;
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
return vgetargs1(args, format, &lva, 0);
}
@@ -123,15 +115,7 @@ _PyArg_VaParse_SizeT(PyObject *args, char *format, va_list va)
{
va_list lva;
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
return vgetargs1(args, format, &lva, FLAG_SIZE_T);
}
@@ -162,10 +146,19 @@ cleanup_buffer(PyObject *self)
}
static int
-addcleanup(void *ptr, PyObject **freelist, PyCapsule_Destructor destr)
+addcleanup(void *ptr, PyObject **freelist, int is_buffer)
{
PyObject *cobj;
const char *name;
+ PyCapsule_Destructor destr;
+
+ if (is_buffer) {
+ destr = cleanup_buffer;
+ name = GETARGS_CAPSULE_NAME_CLEANUP_BUFFER;
+ } else {
+ destr = cleanup_ptr;
+ name = GETARGS_CAPSULE_NAME_CLEANUP_PTR;
+ }
if (!*freelist) {
*freelist = PyList_New(0);
@@ -175,13 +168,6 @@ addcleanup(void *ptr, PyObject **freelist, PyCapsule_Destructor destr)
}
}
- if (destr == cleanup_ptr) {
- name = GETARGS_CAPSULE_NAME_CLEANUP_PTR;
- } else if (destr == cleanup_buffer) {
- name = GETARGS_CAPSULE_NAME_CLEANUP_BUFFER;
- } else {
- return -1;
- }
cobj = PyCapsule_New(ptr, name, destr);
if (!cobj) {
destr(ptr);
@@ -625,6 +611,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
*q=s; \
}
#define BUFFER_LEN ((flags & FLAG_SIZE_T) ? *q2:*q)
+#define RETURN_ERR_OCCURRED return msgbuf
const char *format = *p_format;
char c = *format++;
@@ -636,19 +623,19 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
char *p = va_arg(*p_va, char *);
long ival;
if (float_argument_error(arg))
- return converterr("integer<b>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
- return converterr("integer<b>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else if (ival < 0) {
PyErr_SetString(PyExc_OverflowError,
- "unsigned byte integer is less than minimum");
- return converterr("integer<b>", arg, msgbuf, bufsize);
+ "unsigned byte integer is less than minimum");
+ RETURN_ERR_OCCURRED;
}
else if (ival > UCHAR_MAX) {
PyErr_SetString(PyExc_OverflowError,
- "unsigned byte integer is greater than maximum");
- return converterr("integer<b>", arg, msgbuf, bufsize);
+ "unsigned byte integer is greater than maximum");
+ RETURN_ERR_OCCURRED;
}
else
*p = (unsigned char) ival;
@@ -660,10 +647,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
char *p = va_arg(*p_va, char *);
long ival;
if (float_argument_error(arg))
- return converterr("integer<B>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
ival = PyLong_AsUnsignedLongMask(arg);
if (ival == -1 && PyErr_Occurred())
- return converterr("integer<B>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else
*p = (unsigned char) ival;
break;
@@ -673,19 +660,19 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
short *p = va_arg(*p_va, short *);
long ival;
if (float_argument_error(arg))
- return converterr("integer<h>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
- return converterr("integer<h>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else if (ival < SHRT_MIN) {
PyErr_SetString(PyExc_OverflowError,
- "signed short integer is less than minimum");
- return converterr("integer<h>", arg, msgbuf, bufsize);
+ "signed short integer is less than minimum");
+ RETURN_ERR_OCCURRED;
}
else if (ival > SHRT_MAX) {
PyErr_SetString(PyExc_OverflowError,
- "signed short integer is greater than maximum");
- return converterr("integer<h>", arg, msgbuf, bufsize);
+ "signed short integer is greater than maximum");
+ RETURN_ERR_OCCURRED;
}
else
*p = (short) ival;
@@ -697,10 +684,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
unsigned short *p = va_arg(*p_va, unsigned short *);
long ival;
if (float_argument_error(arg))
- return converterr("integer<H>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
ival = PyLong_AsUnsignedLongMask(arg);
if (ival == -1 && PyErr_Occurred())
- return converterr("integer<H>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else
*p = (unsigned short) ival;
break;
@@ -710,19 +697,19 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
int *p = va_arg(*p_va, int *);
long ival;
if (float_argument_error(arg))
- return converterr("integer<i>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
- return converterr("integer<i>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else if (ival > INT_MAX) {
PyErr_SetString(PyExc_OverflowError,
- "signed integer is greater than maximum");
- return converterr("integer<i>", arg, msgbuf, bufsize);
+ "signed integer is greater than maximum");
+ RETURN_ERR_OCCURRED;
}
else if (ival < INT_MIN) {
PyErr_SetString(PyExc_OverflowError,
- "signed integer is less than minimum");
- return converterr("integer<i>", arg, msgbuf, bufsize);
+ "signed integer is less than minimum");
+ RETURN_ERR_OCCURRED;
}
else
*p = ival;
@@ -734,10 +721,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
unsigned int *p = va_arg(*p_va, unsigned int *);
unsigned int ival;
if (float_argument_error(arg))
- return converterr("integer<I>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
ival = (unsigned int)PyLong_AsUnsignedLongMask(arg);
if (ival == (unsigned int)-1 && PyErr_Occurred())
- return converterr("integer<I>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else
*p = ival;
break;
@@ -749,14 +736,14 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
Py_ssize_t *p = va_arg(*p_va, Py_ssize_t *);
Py_ssize_t ival = -1;
if (float_argument_error(arg))
- return converterr("integer<n>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
iobj = PyNumber_Index(arg);
if (iobj != NULL) {
ival = PyLong_AsSsize_t(iobj);
Py_DECREF(iobj);
}
if (ival == -1 && PyErr_Occurred())
- return converterr("integer<n>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
*p = ival;
break;
}
@@ -764,10 +751,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
long *p = va_arg(*p_va, long *);
long ival;
if (float_argument_error(arg))
- return converterr("integer<l>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
- return converterr("integer<l>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else
*p = ival;
break;
@@ -787,12 +774,14 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
#ifdef HAVE_LONG_LONG
case 'L': {/* PY_LONG_LONG */
PY_LONG_LONG *p = va_arg( *p_va, PY_LONG_LONG * );
- PY_LONG_LONG ival = PyLong_AsLongLong( arg );
- if (ival == (PY_LONG_LONG)-1 && PyErr_Occurred() ) {
- return converterr("long<L>", arg, msgbuf, bufsize);
- } else {
+ PY_LONG_LONG ival;
+ if (float_argument_error(arg))
+ RETURN_ERR_OCCURRED;
+ ival = PyLong_AsLongLong(arg);
+ if (ival == (PY_LONG_LONG)-1 && PyErr_Occurred())
+ RETURN_ERR_OCCURRED;
+ else
*p = ival;
- }
break;
}
@@ -812,7 +801,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
float *p = va_arg(*p_va, float *);
double dval = PyFloat_AsDouble(arg);
if (PyErr_Occurred())
- return converterr("float<f>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else
*p = (float) dval;
break;
@@ -822,24 +811,22 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
double *p = va_arg(*p_va, double *);
double dval = PyFloat_AsDouble(arg);
if (PyErr_Occurred())
- return converterr("float<d>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else
*p = dval;
break;
}
-#ifndef WITHOUT_COMPLEX
case 'D': {/* complex double */
Py_complex *p = va_arg(*p_va, Py_complex *);
Py_complex cval;
cval = PyComplex_AsCComplex(arg);
if (PyErr_Occurred())
- return converterr("complex<D>", arg, msgbuf, bufsize);
+ RETURN_ERR_OCCURRED;
else
*p = cval;
break;
}
-#endif /* WITHOUT_COMPLEX */
case 'c': {/* char */
char *p = va_arg(*p_va, char *);
@@ -860,73 +847,9 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
break;
}
- /* XXX WAAAAH! 's', 'y', 'z', 'u', 'Z', 'e', 'w', 't' codes all
+ /* XXX WAAAAH! 's', 'y', 'z', 'u', 'Z', 'e', 'w' codes all
need to be cleaned up! */
- case 's': {/* text string */
- if (*format == '*') {
- Py_buffer *p = (Py_buffer *)va_arg(*p_va, Py_buffer *);
-
- if (PyUnicode_Check(arg)) {
- uarg = UNICODE_DEFAULT_ENCODING(arg);
- if (uarg == NULL)
- return converterr(CONV_UNICODE,
- arg, msgbuf, bufsize);
- PyBuffer_FillInfo(p, arg,
- PyBytes_AS_STRING(uarg), PyBytes_GET_SIZE(uarg),
- 1, 0);
- }
- else { /* any buffer-like object */
- char *buf;
- if (getbuffer(arg, p, &buf) < 0)
- return converterr(buf, arg, msgbuf, bufsize);
- }
- if (addcleanup(p, freelist, cleanup_buffer)) {
- return converterr(
- "(cleanup problem)",
- arg, msgbuf, bufsize);
- }
- format++;
- } else if (*format == '#') {
- void **p = (void **)va_arg(*p_va, char **);
- FETCH_SIZE;
-
- if (PyUnicode_Check(arg)) {
- uarg = UNICODE_DEFAULT_ENCODING(arg);
- if (uarg == NULL)
- return converterr(CONV_UNICODE,
- arg, msgbuf, bufsize);
- *p = PyBytes_AS_STRING(uarg);
- STORE_SIZE(PyBytes_GET_SIZE(uarg));
- }
- else { /* any buffer-like object */
- /* XXX Really? */
- char *buf;
- Py_ssize_t count = convertbuffer(arg, p, &buf);
- if (count < 0)
- return converterr(buf, arg, msgbuf, bufsize);
- STORE_SIZE(count);
- }
- format++;
- } else {
- char **p = va_arg(*p_va, char **);
-
- if (PyUnicode_Check(arg)) {
- uarg = UNICODE_DEFAULT_ENCODING(arg);
- if (uarg == NULL)
- return converterr(CONV_UNICODE,
- arg, msgbuf, bufsize);
- *p = PyBytes_AS_STRING(uarg);
- }
- else
- return converterr("string", arg, msgbuf, bufsize);
- if ((Py_ssize_t) strlen(*p) != PyBytes_GET_SIZE(uarg))
- return converterr("string without null bytes",
- arg, msgbuf, bufsize);
- }
- break;
- }
-
case 'y': {/* any buffer-like object, but not PyUnicode */
void **p = (void **)va_arg(*p_va, char **);
char *buf;
@@ -935,7 +858,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
if (getbuffer(arg, (Py_buffer*)p, &buf) < 0)
return converterr(buf, arg, msgbuf, bufsize);
format++;
- if (addcleanup(p, freelist, cleanup_buffer)) {
+ if (addcleanup(p, freelist, 1)) {
return converterr(
"(cleanup problem)",
arg, msgbuf, bufsize);
@@ -945,19 +868,27 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
count = convertbuffer(arg, p, &buf);
if (count < 0)
return converterr(buf, arg, msgbuf, bufsize);
- else if (*format == '#') {
+ if (*format == '#') {
FETCH_SIZE;
STORE_SIZE(count);
format++;
+ } else {
+ if (strlen(*p) != count)
+ return converterr(
+ "bytes without null bytes",
+ arg, msgbuf, bufsize);
}
break;
}
- case 'z': {/* like 's' or 's#', but None is okay, stored as NULL */
+ case 's': /* text string */
+ case 'z': /* text string or None */
+ {
if (*format == '*') {
+ /* "s*" or "z*" */
Py_buffer *p = (Py_buffer *)va_arg(*p_va, Py_buffer *);
- if (arg == Py_None)
+ if (c == 'z' && arg == Py_None)
PyBuffer_FillInfo(p, NULL, NULL, 0, 1, 0);
else if (PyUnicode_Check(arg)) {
uarg = UNICODE_DEFAULT_ENCODING(arg);
@@ -973,18 +904,19 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
if (getbuffer(arg, p, &buf) < 0)
return converterr(buf, arg, msgbuf, bufsize);
}
- if (addcleanup(p, freelist, cleanup_buffer)) {
+ if (addcleanup(p, freelist, 1)) {
return converterr(
"(cleanup problem)",
arg, msgbuf, bufsize);
}
format++;
} else if (*format == '#') { /* any buffer-like object */
+ /* "s#" or "z#" */
void **p = (void **)va_arg(*p_va, char **);
FETCH_SIZE;
- if (arg == Py_None) {
- *p = 0;
+ if (c == 'z' && arg == Py_None) {
+ *p = NULL;
STORE_SIZE(0);
}
else if (PyUnicode_Check(arg)) {
@@ -1005,16 +937,12 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
}
format++;
} else {
+ /* "s" or "z" */
char **p = va_arg(*p_va, char **);
uarg = NULL;
- if (arg == Py_None)
- *p = 0;
- else if (PyBytes_Check(arg)) {
- /* Enable null byte check below */
- uarg = arg;
- *p = PyBytes_AS_STRING(arg);
- }
+ if (c == 'z' && arg == Py_None)
+ *p = NULL;
else if (PyUnicode_Check(arg)) {
uarg = UNICODE_DEFAULT_ENCODING(arg);
if (uarg == NULL)
@@ -1023,35 +951,28 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
*p = PyBytes_AS_STRING(uarg);
}
else
- return converterr("string or None",
+ return converterr(c == 'z' ? "str or None" : "str",
arg, msgbuf, bufsize);
- if (*format == '#') {
- FETCH_SIZE;
- assert(0); /* XXX redundant with if-case */
- if (arg == Py_None) {
- STORE_SIZE(0);
- }
- else {
- STORE_SIZE(PyBytes_Size(arg));
- }
- format++;
- }
- else if (*p != NULL && uarg != NULL &&
+ if (*p != NULL && uarg != NULL &&
(Py_ssize_t) strlen(*p) != PyBytes_GET_SIZE(uarg))
return converterr(
- "string without null bytes or None",
+ c == 'z' ? "str without null bytes or None"
+ : "str without null bytes",
arg, msgbuf, bufsize);
}
break;
}
- case 'Z': {/* unicode, may be NULL (None) */
+ case 'u': /* raw unicode buffer (Py_UNICODE *) */
+ case 'Z': /* raw unicode buffer or None */
+ {
if (*format == '#') { /* any buffer-like object */
+ /* "s#" or "Z#" */
Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
FETCH_SIZE;
- if (arg == Py_None) {
- *p = 0;
+ if (c == 'Z' && arg == Py_None) {
+ *p = NULL;
STORE_SIZE(0);
}
else if (PyUnicode_Check(arg)) {
@@ -1062,14 +983,20 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
return converterr("str or None", arg, msgbuf, bufsize);
format++;
} else {
+ /* "s" or "Z" */
Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
- if (arg == Py_None)
- *p = 0;
- else if (PyUnicode_Check(arg))
+ if (c == 'Z' && arg == Py_None)
+ *p = NULL;
+ else if (PyUnicode_Check(arg)) {
*p = PyUnicode_AS_UNICODE(arg);
- else
- return converterr("str or None", arg, msgbuf, bufsize);
+ if (Py_UNICODE_strlen(*p) != PyUnicode_GET_SIZE(arg))
+ return converterr(
+ "str without null character or None",
+ arg, msgbuf, bufsize);
+ } else
+ return converterr(c == 'Z' ? "str or None" : "str",
+ arg, msgbuf, bufsize);
}
break;
}
@@ -1180,11 +1107,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
*buffer = PyMem_NEW(char, size + 1);
if (*buffer == NULL) {
Py_DECREF(s);
- return converterr(
- "(memory error)",
- arg, msgbuf, bufsize);
+ PyErr_NoMemory();
+ RETURN_ERR_OCCURRED;
}
- if (addcleanup(*buffer, freelist, cleanup_ptr)) {
+ if (addcleanup(*buffer, freelist, 0)) {
Py_DECREF(s);
return converterr(
"(cleanup problem)",
@@ -1223,10 +1149,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
*buffer = PyMem_NEW(char, size + 1);
if (*buffer == NULL) {
Py_DECREF(s);
- return converterr("(memory error)",
- arg, msgbuf, bufsize);
+ PyErr_NoMemory();
+ RETURN_ERR_OCCURRED;
}
- if (addcleanup(*buffer, freelist, cleanup_ptr)) {
+ if (addcleanup(*buffer, freelist, 0)) {
Py_DECREF(s);
return converterr("(cleanup problem)",
arg, msgbuf, bufsize);
@@ -1237,19 +1163,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
break;
}
- case 'u': {/* raw unicode buffer (Py_UNICODE *) */
- Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
- if (!PyUnicode_Check(arg))
- return converterr("str", arg, msgbuf, bufsize);
- *p = PyUnicode_AS_UNICODE(arg);
- if (*format == '#') { /* store pointer and size */
- FETCH_SIZE;
- STORE_SIZE(PyUnicode_GET_SIZE(arg));
- format++;
- }
- break;
- }
-
case 'S': { /* PyBytes object */
PyObject **p = va_arg(*p_va, PyObject **);
if (PyBytes_Check(arg))
@@ -1290,17 +1203,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
return converterr(type->tp_name, arg, msgbuf, bufsize);
}
- else if (*format == '?') {
- inquiry pred = va_arg(*p_va, inquiry);
- p = va_arg(*p_va, PyObject **);
- format++;
- if ((*pred)(arg))
- *p = arg;
- else
- return converterr("(unspecified)",
- arg, msgbuf, bufsize);
-
- }
else if (*format == '&') {
typedef int (*converter)(PyObject *, void *);
converter convert = va_arg(*p_va, converter);
@@ -1323,96 +1225,29 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
}
- case 'w': { /* memory buffer, read-write access */
+ case 'w': { /* "w*": memory buffer, read-write access */
void **p = va_arg(*p_va, void **);
- PyBufferProcs *pb = arg->ob_type->tp_as_buffer;
- Py_ssize_t count;
- int temp=-1;
- Py_buffer view;
-
- if (pb && pb->bf_releasebuffer && *format != '*')
- /* Buffer must be released, yet caller does not use
- the Py_buffer protocol. */
- return converterr("pinned buffer", arg, msgbuf, bufsize);
-
- if (pb && pb->bf_getbuffer && *format == '*') {
- /* Caller is interested in Py_buffer, and the object
- supports it directly. */
- format++;
- if (PyObject_GetBuffer(arg, (Py_buffer*)p, PyBUF_WRITABLE) < 0) {
- PyErr_Clear();
- return converterr("read-write buffer", arg, msgbuf, bufsize);
- }
- if (addcleanup(p, freelist, cleanup_buffer)) {
- return converterr(
- "(cleanup problem)",
- arg, msgbuf, bufsize);
- }
- if (!PyBuffer_IsContiguous((Py_buffer*)p, 'C'))
- return converterr("contiguous buffer", arg, msgbuf, bufsize);
- break;
- }
+ if (*format != '*')
+ return converterr(
+ "invalid use of 'w' format character",
+ arg, msgbuf, bufsize);
+ format++;
- /* Here we have processed w*, only w and w# remain. */
- if (pb == NULL ||
- pb->bf_getbuffer == NULL ||
- ((temp = PyObject_GetBuffer(arg, &view,
- PyBUF_SIMPLE)) != 0) ||
- view.readonly == 1) {
- if (temp==0) {
- PyBuffer_Release(&view);
- }
- return converterr("single-segment read-write buffer",
- arg, msgbuf, bufsize);
+ /* Caller is interested in Py_buffer, and the object
+ supports it directly. */
+ if (PyObject_GetBuffer(arg, (Py_buffer*)p, PyBUF_WRITABLE) < 0) {
+ PyErr_Clear();
+ return converterr("read-write buffer", arg, msgbuf, bufsize);
}
-
- if ((count = view.len) < 0)
- return converterr("(unspecified)", arg, msgbuf, bufsize);
- *p = view.buf;
- if (*format == '#') {
- FETCH_SIZE;
- STORE_SIZE(count);
- format++;
+ if (!PyBuffer_IsContiguous((Py_buffer*)p, 'C')) {
+ PyBuffer_Release((Py_buffer*)p);
+ return converterr("contiguous buffer", arg, msgbuf, bufsize);
}
- break;
- }
-
- /*TEO: This can be eliminated --- here only for backward
- compatibility */
- case 't': { /* 8-bit character buffer, read-only access */
- char **p = va_arg(*p_va, char **);
- PyBufferProcs *pb = arg->ob_type->tp_as_buffer;
- Py_ssize_t count;
- Py_buffer view;
-
- if (*format++ != '#')
- return converterr(
- "invalid use of 't' format character",
- arg, msgbuf, bufsize);
- if (pb == NULL || pb->bf_getbuffer == NULL)
+ if (addcleanup(p, freelist, 1)) {
return converterr(
- "bytes or read-only character buffer",
+ "(cleanup problem)",
arg, msgbuf, bufsize);
- if (pb->bf_releasebuffer)
- return converterr(
- "string or pinned buffer",
- arg, msgbuf, bufsize);
-
- if (PyObject_GetBuffer(arg, &view, PyBUF_SIMPLE) != 0)
- return converterr("string or single-segment read-only buffer",
- arg, msgbuf, bufsize);
-
- count = view.len;
- *p = view.buf;
-
- PyBuffer_Release(&view);
-
- if (count < 0)
- return converterr("(unspecified)", arg, msgbuf, bufsize);
- {
- FETCH_SIZE;
- STORE_SIZE(count);
}
break;
}
@@ -1424,65 +1259,47 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
*p_format = format;
return NULL;
+
+#undef FETCH_SIZE
+#undef STORE_SIZE
+#undef BUFFER_LEN
+#undef RETURN_ERR_OCCURRED
}
static Py_ssize_t
convertbuffer(PyObject *arg, void **p, char **errmsg)
{
- PyBufferProcs *pb = arg->ob_type->tp_as_buffer;
+ PyBufferProcs *pb = Py_TYPE(arg)->tp_as_buffer;
Py_ssize_t count;
Py_buffer view;
*errmsg = NULL;
*p = NULL;
- if (pb == NULL ||
- pb->bf_getbuffer == NULL ||
- pb->bf_releasebuffer != NULL) {
- *errmsg = "bytes or read-only buffer";
+ if (pb != NULL && pb->bf_releasebuffer != NULL) {
+ *errmsg = "read-only pinned buffer";
return -1;
}
- if (PyObject_GetBuffer(arg, &view, PyBUF_SIMPLE) != 0) {
- *errmsg = "bytes or single-segment read-only buffer";
+ if (getbuffer(arg, &view, errmsg) < 0)
return -1;
- }
count = view.len;
*p = view.buf;
PyBuffer_Release(&view);
return count;
}
-/* XXX for 3.x, getbuffer and convertbuffer can probably
- be merged again. */
static int
getbuffer(PyObject *arg, Py_buffer *view, char **errmsg)
{
- void *buf;
- Py_ssize_t count;
- PyBufferProcs *pb = arg->ob_type->tp_as_buffer;
- if (pb == NULL) {
+ if (PyObject_GetBuffer(arg, view, PyBUF_SIMPLE) != 0) {
*errmsg = "bytes or buffer";
return -1;
}
- if (pb->bf_getbuffer) {
- if (PyObject_GetBuffer(arg, view, 0) < 0) {
- *errmsg = "convertible to a buffer";
- return -1;
- }
- if (!PyBuffer_IsContiguous(view, 'C')) {
- PyBuffer_Release(view);
- *errmsg = "contiguous buffer";
- return -1;
- }
- return 0;
- }
-
- count = convertbuffer(arg, &buf, errmsg);
- if (count < 0) {
- *errmsg = "convertible to a buffer";
- return count;
+ if (!PyBuffer_IsContiguous(view, 'C')) {
+ PyBuffer_Release(view);
+ *errmsg = "contiguous buffer";
+ return -1;
}
- PyBuffer_FillInfo(view, NULL, buf, count, 1, 0);
return 0;
}
@@ -1558,15 +1375,7 @@ PyArg_VaParseTupleAndKeywords(PyObject *args,
return 0;
}
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
retval = vgetargskeywords(args, keywords, format, kwlist, &lva, 0);
return retval;
@@ -1590,21 +1399,28 @@ _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args,
return 0;
}
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
retval = vgetargskeywords(args, keywords, format,
kwlist, &lva, FLAG_SIZE_T);
return retval;
}
+int
+PyArg_ValidateKeywordArguments(PyObject *kwargs)
+{
+ if (!PyDict_Check(kwargs)) {
+ PyErr_BadInternalCall();
+ return 0;
+ }
+ if (!_PyDict_HasOnlyStringKeys(kwargs)) {
+ PyErr_SetString(PyExc_TypeError,
+ "keyword arguments must be strings");
+ return 0;
+ }
+ return 1;
+}
+
#define IS_END_OF_FORMAT(c) (c == '\0' || c == ';' || c == ':')
static int
@@ -1738,18 +1554,21 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
"keywords must be strings");
return cleanreturn(0, freelist);
}
+ /* check that _PyUnicode_AsString() result is not NULL */
ks = _PyUnicode_AsString(key);
- for (i = 0; i < len; i++) {
- if (!strcmp(ks, kwlist[i])) {
- match = 1;
- break;
+ if (ks != NULL) {
+ for (i = 0; i < len; i++) {
+ if (!strcmp(ks, kwlist[i])) {
+ match = 1;
+ break;
+ }
}
}
if (!match) {
PyErr_Format(PyExc_TypeError,
- "'%s' is an invalid keyword "
+ "'%U' is an invalid keyword "
"argument for this function",
- ks);
+ key);
return cleanreturn(0, freelist);
}
}
@@ -1784,9 +1603,7 @@ skipitem(const char **p_format, va_list *p_va, int flags)
#endif
case 'f': /* float */
case 'd': /* double */
-#ifndef WITHOUT_COMPLEX
case 'D': /* complex double */
-#endif
case 'c': /* char */
case 'C': /* unicode char */
{
@@ -1816,7 +1633,6 @@ skipitem(const char **p_format, va_list *p_va, int flags)
case 'z': /* string or None */
case 'y': /* bytes */
case 'u': /* unicode string */
- case 't': /* buffer, read-only */
case 'w': /* buffer, read-write */
{
(void) va_arg(*p_va, char **);
@@ -1849,16 +1665,6 @@ skipitem(const char **p_format, va_list *p_va, int flags)
(void) va_arg(*p_va, PyTypeObject*);
(void) va_arg(*p_va, PyObject **);
}
-#if 0
-/* I don't know what this is for */
- else if (*format == '?') {
- inquiry pred = va_arg(*p_va, inquiry);
- format++;
- if ((*pred)(arg)) {
- (void) va_arg(*p_va, PyObject **);
- }
- }
-#endif
else if (*format == '&') {
typedef int (*converter)(PyObject *, void *);
(void) va_arg(*p_va, converter);
diff --git a/Python/getcopyright.c b/Python/getcopyright.c
index 824c7b1c82..1388f2c98c 100644
--- a/Python/getcopyright.c
+++ b/Python/getcopyright.c
@@ -2,7 +2,7 @@
#include "Python.h"
-static char cprt[] =
+static char cprt[] =
"\
Copyright (c) 2001-2011 Python Software Foundation.\n\
All Rights Reserved.\n\
diff --git a/Python/getopt.c b/Python/getopt.c
index 5147320af2..064a1874ea 100644
--- a/Python/getopt.c
+++ b/Python/getopt.c
@@ -89,12 +89,6 @@ int _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring)
return '_';
}
- if (option == 'X') {
- fprintf(stderr,
- "-X is reserved for implementation-specific arguments\n");
- return '_';
- }
-
if ((ptr = wcschr(optstring, option)) == NULL) {
if (_PyOS_opterr)
fprintf(stderr, "Unknown option: -%c\n", (char)option);
diff --git a/Python/graminit.c b/Python/graminit.c
index 91dae03aac..a8af5833a9 100644
--- a/Python/graminit.c
+++ b/Python/graminit.c
@@ -180,8 +180,8 @@ static arc arcs_8_4[1] = {
{24, 9},
};
static arc arcs_8_5[4] = {
- {28, 1},
- {31, 2},
+ {28, 10},
+ {31, 11},
{32, 3},
{0, 5},
};
@@ -190,7 +190,7 @@ static arc arcs_8_6[2] = {
{0, 6},
};
static arc arcs_8_7[2] = {
- {28, 10},
+ {28, 12},
{32, 3},
};
static arc arcs_8_8[1] = {
@@ -201,14 +201,40 @@ static arc arcs_8_9[2] = {
{0, 9},
};
static arc arcs_8_10[3] = {
- {30, 7},
- {29, 11},
+ {30, 5},
+ {29, 4},
{0, 10},
};
-static arc arcs_8_11[1] = {
+static arc arcs_8_11[3] = {
+ {28, 13},
+ {30, 14},
+ {0, 11},
+};
+static arc arcs_8_12[3] = {
+ {30, 7},
+ {29, 15},
+ {0, 12},
+};
+static arc arcs_8_13[2] = {
+ {30, 14},
+ {0, 13},
+};
+static arc arcs_8_14[2] = {
+ {28, 16},
+ {32, 3},
+};
+static arc arcs_8_15[1] = {
{24, 6},
};
-static state states_8[12] = {
+static arc arcs_8_16[3] = {
+ {30, 14},
+ {29, 17},
+ {0, 16},
+};
+static arc arcs_8_17[1] = {
+ {24, 13},
+};
+static state states_8[18] = {
{3, arcs_8_0},
{3, arcs_8_1},
{3, arcs_8_2},
@@ -220,7 +246,13 @@ static state states_8[12] = {
{1, arcs_8_8},
{2, arcs_8_9},
{3, arcs_8_10},
- {1, arcs_8_11},
+ {3, arcs_8_11},
+ {3, arcs_8_12},
+ {2, arcs_8_13},
+ {2, arcs_8_14},
+ {1, arcs_8_15},
+ {3, arcs_8_16},
+ {1, arcs_8_17},
};
static arc arcs_9_0[1] = {
{21, 1},
@@ -263,8 +295,8 @@ static arc arcs_10_4[1] = {
{24, 9},
};
static arc arcs_10_5[4] = {
- {34, 1},
- {31, 2},
+ {34, 10},
+ {31, 11},
{32, 3},
{0, 5},
};
@@ -273,7 +305,7 @@ static arc arcs_10_6[2] = {
{0, 6},
};
static arc arcs_10_7[2] = {
- {34, 10},
+ {34, 12},
{32, 3},
};
static arc arcs_10_8[1] = {
@@ -284,14 +316,40 @@ static arc arcs_10_9[2] = {
{0, 9},
};
static arc arcs_10_10[3] = {
- {30, 7},
- {29, 11},
+ {30, 5},
+ {29, 4},
{0, 10},
};
-static arc arcs_10_11[1] = {
+static arc arcs_10_11[3] = {
+ {34, 13},
+ {30, 14},
+ {0, 11},
+};
+static arc arcs_10_12[3] = {
+ {30, 7},
+ {29, 15},
+ {0, 12},
+};
+static arc arcs_10_13[2] = {
+ {30, 14},
+ {0, 13},
+};
+static arc arcs_10_14[2] = {
+ {34, 16},
+ {32, 3},
+};
+static arc arcs_10_15[1] = {
{24, 6},
};
-static state states_10[12] = {
+static arc arcs_10_16[3] = {
+ {30, 14},
+ {29, 17},
+ {0, 16},
+};
+static arc arcs_10_17[1] = {
+ {24, 13},
+};
+static state states_10[18] = {
{3, arcs_10_0},
{3, arcs_10_1},
{3, arcs_10_2},
@@ -303,7 +361,13 @@ static state states_10[12] = {
{1, arcs_10_8},
{2, arcs_10_9},
{3, arcs_10_10},
- {1, arcs_10_11},
+ {3, arcs_10_11},
+ {3, arcs_10_12},
+ {2, arcs_10_13},
+ {2, arcs_10_14},
+ {1, arcs_10_15},
+ {3, arcs_10_16},
+ {1, arcs_10_17},
};
static arc arcs_11_0[1] = {
{21, 1},
@@ -364,20 +428,20 @@ static state states_14[2] = {
{1, arcs_14_1},
};
static arc arcs_15_0[1] = {
- {9, 1},
+ {45, 1},
};
static arc arcs_15_1[3] = {
- {45, 2},
+ {46, 2},
{29, 3},
{0, 1},
};
static arc arcs_15_2[2] = {
- {46, 4},
+ {47, 4},
{9, 4},
};
static arc arcs_15_3[2] = {
- {46, 5},
- {9, 5},
+ {47, 5},
+ {45, 5},
};
static arc arcs_15_4[1] = {
{0, 4},
@@ -394,9 +458,25 @@ static state states_15[6] = {
{1, arcs_15_4},
{2, arcs_15_5},
};
-static arc arcs_16_0[12] = {
- {47, 1},
+static arc arcs_16_0[2] = {
+ {24, 1},
{48, 1},
+};
+static arc arcs_16_1[2] = {
+ {30, 2},
+ {0, 1},
+};
+static arc arcs_16_2[3] = {
+ {24, 1},
+ {48, 1},
+ {0, 2},
+};
+static state states_16[3] = {
+ {2, arcs_16_0},
+ {2, arcs_16_1},
+ {3, arcs_16_2},
+};
+static arc arcs_17_0[12] = {
{49, 1},
{50, 1},
{51, 1},
@@ -407,64 +487,56 @@ static arc arcs_16_0[12] = {
{56, 1},
{57, 1},
{58, 1},
-};
-static arc arcs_16_1[1] = {
- {0, 1},
-};
-static state states_16[2] = {
- {12, arcs_16_0},
- {1, arcs_16_1},
-};
-static arc arcs_17_0[1] = {
{59, 1},
+ {60, 1},
};
static arc arcs_17_1[1] = {
- {60, 2},
-};
-static arc arcs_17_2[1] = {
- {0, 2},
+ {0, 1},
};
-static state states_17[3] = {
- {1, arcs_17_0},
+static state states_17[2] = {
+ {12, arcs_17_0},
{1, arcs_17_1},
- {1, arcs_17_2},
};
static arc arcs_18_0[1] = {
{61, 1},
};
static arc arcs_18_1[1] = {
- {0, 1},
+ {62, 2},
+};
+static arc arcs_18_2[1] = {
+ {0, 2},
};
-static state states_18[2] = {
+static state states_18[3] = {
{1, arcs_18_0},
{1, arcs_18_1},
+ {1, arcs_18_2},
};
-static arc arcs_19_0[5] = {
- {62, 1},
+static arc arcs_19_0[1] = {
{63, 1},
- {64, 1},
- {65, 1},
- {66, 1},
};
static arc arcs_19_1[1] = {
{0, 1},
};
static state states_19[2] = {
- {5, arcs_19_0},
+ {1, arcs_19_0},
{1, arcs_19_1},
};
-static arc arcs_20_0[1] = {
+static arc arcs_20_0[5] = {
+ {64, 1},
+ {65, 1},
+ {66, 1},
{67, 1},
+ {68, 1},
};
static arc arcs_20_1[1] = {
{0, 1},
};
static state states_20[2] = {
- {1, arcs_20_0},
+ {5, arcs_20_0},
{1, arcs_20_1},
};
static arc arcs_21_0[1] = {
- {68, 1},
+ {69, 1},
};
static arc arcs_21_1[1] = {
{0, 1},
@@ -474,144 +546,135 @@ static state states_21[2] = {
{1, arcs_21_1},
};
static arc arcs_22_0[1] = {
- {69, 1},
+ {70, 1},
};
-static arc arcs_22_1[2] = {
- {9, 2},
+static arc arcs_22_1[1] = {
{0, 1},
};
-static arc arcs_22_2[1] = {
- {0, 2},
-};
-static state states_22[3] = {
+static state states_22[2] = {
{1, arcs_22_0},
- {2, arcs_22_1},
- {1, arcs_22_2},
+ {1, arcs_22_1},
};
static arc arcs_23_0[1] = {
- {46, 1},
+ {71, 1},
};
-static arc arcs_23_1[1] = {
+static arc arcs_23_1[2] = {
+ {9, 2},
{0, 1},
};
-static state states_23[2] = {
+static arc arcs_23_2[1] = {
+ {0, 2},
+};
+static state states_23[3] = {
{1, arcs_23_0},
- {1, arcs_23_1},
+ {2, arcs_23_1},
+ {1, arcs_23_2},
};
static arc arcs_24_0[1] = {
- {70, 1},
+ {47, 1},
+};
+static arc arcs_24_1[1] = {
+ {0, 1},
};
-static arc arcs_24_1[2] = {
+static state states_24[2] = {
+ {1, arcs_24_0},
+ {1, arcs_24_1},
+};
+static arc arcs_25_0[1] = {
+ {72, 1},
+};
+static arc arcs_25_1[2] = {
{24, 2},
{0, 1},
};
-static arc arcs_24_2[2] = {
- {71, 3},
+static arc arcs_25_2[2] = {
+ {73, 3},
{0, 2},
};
-static arc arcs_24_3[1] = {
+static arc arcs_25_3[1] = {
{24, 4},
};
-static arc arcs_24_4[1] = {
+static arc arcs_25_4[1] = {
{0, 4},
};
-static state states_24[5] = {
- {1, arcs_24_0},
- {2, arcs_24_1},
- {2, arcs_24_2},
- {1, arcs_24_3},
- {1, arcs_24_4},
+static state states_25[5] = {
+ {1, arcs_25_0},
+ {2, arcs_25_1},
+ {2, arcs_25_2},
+ {1, arcs_25_3},
+ {1, arcs_25_4},
};
-static arc arcs_25_0[2] = {
- {72, 1},
- {73, 1},
+static arc arcs_26_0[2] = {
+ {74, 1},
+ {75, 1},
};
-static arc arcs_25_1[1] = {
+static arc arcs_26_1[1] = {
{0, 1},
};
-static state states_25[2] = {
- {2, arcs_25_0},
- {1, arcs_25_1},
+static state states_26[2] = {
+ {2, arcs_26_0},
+ {1, arcs_26_1},
};
-static arc arcs_26_0[1] = {
- {74, 1},
+static arc arcs_27_0[1] = {
+ {76, 1},
};
-static arc arcs_26_1[1] = {
- {75, 2},
+static arc arcs_27_1[1] = {
+ {77, 2},
};
-static arc arcs_26_2[1] = {
+static arc arcs_27_2[1] = {
{0, 2},
};
-static state states_26[3] = {
- {1, arcs_26_0},
- {1, arcs_26_1},
- {1, arcs_26_2},
+static state states_27[3] = {
+ {1, arcs_27_0},
+ {1, arcs_27_1},
+ {1, arcs_27_2},
};
-static arc arcs_27_0[1] = {
- {71, 1},
+static arc arcs_28_0[1] = {
+ {73, 1},
};
-static arc arcs_27_1[3] = {
- {76, 2},
- {77, 2},
+static arc arcs_28_1[3] = {
+ {78, 2},
+ {79, 2},
{12, 3},
};
-static arc arcs_27_2[4] = {
- {76, 2},
- {77, 2},
+static arc arcs_28_2[4] = {
+ {78, 2},
+ {79, 2},
{12, 3},
- {74, 4},
+ {76, 4},
};
-static arc arcs_27_3[1] = {
- {74, 4},
+static arc arcs_28_3[1] = {
+ {76, 4},
};
-static arc arcs_27_4[3] = {
+static arc arcs_28_4[3] = {
{31, 5},
{13, 6},
- {78, 5},
+ {80, 5},
};
-static arc arcs_27_5[1] = {
+static arc arcs_28_5[1] = {
{0, 5},
};
-static arc arcs_27_6[1] = {
- {78, 7},
+static arc arcs_28_6[1] = {
+ {80, 7},
};
-static arc arcs_27_7[1] = {
+static arc arcs_28_7[1] = {
{15, 5},
};
-static state states_27[8] = {
- {1, arcs_27_0},
- {3, arcs_27_1},
- {4, arcs_27_2},
- {1, arcs_27_3},
- {3, arcs_27_4},
- {1, arcs_27_5},
- {1, arcs_27_6},
- {1, arcs_27_7},
-};
-static arc arcs_28_0[1] = {
- {21, 1},
-};
-static arc arcs_28_1[2] = {
- {80, 2},
- {0, 1},
-};
-static arc arcs_28_2[1] = {
- {21, 3},
-};
-static arc arcs_28_3[1] = {
- {0, 3},
-};
-static state states_28[4] = {
+static state states_28[8] = {
{1, arcs_28_0},
- {2, arcs_28_1},
- {1, arcs_28_2},
+ {3, arcs_28_1},
+ {4, arcs_28_2},
{1, arcs_28_3},
+ {3, arcs_28_4},
+ {1, arcs_28_5},
+ {1, arcs_28_6},
+ {1, arcs_28_7},
};
static arc arcs_29_0[1] = {
- {12, 1},
+ {21, 1},
};
static arc arcs_29_1[2] = {
- {80, 2},
+ {82, 2},
{0, 1},
};
static arc arcs_29_2[1] = {
@@ -627,37 +690,45 @@ static state states_29[4] = {
{1, arcs_29_3},
};
static arc arcs_30_0[1] = {
- {79, 1},
+ {12, 1},
};
static arc arcs_30_1[2] = {
- {30, 2},
+ {82, 2},
{0, 1},
};
-static arc arcs_30_2[2] = {
- {79, 1},
- {0, 2},
+static arc arcs_30_2[1] = {
+ {21, 3},
+};
+static arc arcs_30_3[1] = {
+ {0, 3},
};
-static state states_30[3] = {
+static state states_30[4] = {
{1, arcs_30_0},
{2, arcs_30_1},
- {2, arcs_30_2},
+ {1, arcs_30_2},
+ {1, arcs_30_3},
};
static arc arcs_31_0[1] = {
{81, 1},
};
static arc arcs_31_1[2] = {
- {30, 0},
+ {30, 2},
{0, 1},
};
-static state states_31[2] = {
+static arc arcs_31_2[2] = {
+ {81, 1},
+ {0, 2},
+};
+static state states_31[3] = {
{1, arcs_31_0},
{2, arcs_31_1},
+ {2, arcs_31_2},
};
static arc arcs_32_0[1] = {
- {21, 1},
+ {83, 1},
};
static arc arcs_32_1[2] = {
- {76, 0},
+ {30, 0},
{0, 1},
};
static state states_32[2] = {
@@ -665,22 +736,18 @@ static state states_32[2] = {
{2, arcs_32_1},
};
static arc arcs_33_0[1] = {
- {82, 1},
-};
-static arc arcs_33_1[1] = {
- {21, 2},
+ {21, 1},
};
-static arc arcs_33_2[2] = {
- {30, 1},
- {0, 2},
+static arc arcs_33_1[2] = {
+ {78, 0},
+ {0, 1},
};
-static state states_33[3] = {
+static state states_33[2] = {
{1, arcs_33_0},
- {1, arcs_33_1},
- {2, arcs_33_2},
+ {2, arcs_33_1},
};
static arc arcs_34_0[1] = {
- {83, 1},
+ {84, 1},
};
static arc arcs_34_1[1] = {
{21, 2},
@@ -695,83 +762,62 @@ static state states_34[3] = {
{2, arcs_34_2},
};
static arc arcs_35_0[1] = {
- {84, 1},
+ {85, 1},
};
static arc arcs_35_1[1] = {
- {24, 2},
+ {21, 2},
};
static arc arcs_35_2[2] = {
- {30, 3},
+ {30, 1},
{0, 2},
};
-static arc arcs_35_3[1] = {
- {24, 4},
-};
-static arc arcs_35_4[1] = {
- {0, 4},
-};
-static state states_35[5] = {
+static state states_35[3] = {
{1, arcs_35_0},
{1, arcs_35_1},
{2, arcs_35_2},
- {1, arcs_35_3},
- {1, arcs_35_4},
};
-static arc arcs_36_0[8] = {
- {85, 1},
+static arc arcs_36_0[1] = {
{86, 1},
- {87, 1},
- {88, 1},
- {89, 1},
- {19, 1},
- {18, 1},
- {17, 1},
};
static arc arcs_36_1[1] = {
- {0, 1},
-};
-static state states_36[2] = {
- {8, arcs_36_0},
- {1, arcs_36_1},
-};
-static arc arcs_37_0[1] = {
- {90, 1},
-};
-static arc arcs_37_1[1] = {
{24, 2},
};
-static arc arcs_37_2[1] = {
- {25, 3},
+static arc arcs_36_2[2] = {
+ {30, 3},
+ {0, 2},
};
-static arc arcs_37_3[1] = {
- {26, 4},
+static arc arcs_36_3[1] = {
+ {24, 4},
};
-static arc arcs_37_4[3] = {
- {91, 1},
- {92, 5},
+static arc arcs_36_4[1] = {
{0, 4},
};
-static arc arcs_37_5[1] = {
- {25, 6},
+static state states_36[5] = {
+ {1, arcs_36_0},
+ {1, arcs_36_1},
+ {2, arcs_36_2},
+ {1, arcs_36_3},
+ {1, arcs_36_4},
};
-static arc arcs_37_6[1] = {
- {26, 7},
+static arc arcs_37_0[8] = {
+ {87, 1},
+ {88, 1},
+ {89, 1},
+ {90, 1},
+ {91, 1},
+ {19, 1},
+ {18, 1},
+ {17, 1},
};
-static arc arcs_37_7[1] = {
- {0, 7},
+static arc arcs_37_1[1] = {
+ {0, 1},
};
-static state states_37[8] = {
- {1, arcs_37_0},
+static state states_37[2] = {
+ {8, arcs_37_0},
{1, arcs_37_1},
- {1, arcs_37_2},
- {1, arcs_37_3},
- {3, arcs_37_4},
- {1, arcs_37_5},
- {1, arcs_37_6},
- {1, arcs_37_7},
};
static arc arcs_38_0[1] = {
- {93, 1},
+ {92, 1},
};
static arc arcs_38_1[1] = {
{24, 2},
@@ -782,8 +828,9 @@ static arc arcs_38_2[1] = {
static arc arcs_38_3[1] = {
{26, 4},
};
-static arc arcs_38_4[2] = {
- {92, 5},
+static arc arcs_38_4[3] = {
+ {93, 1},
+ {94, 5},
{0, 4},
};
static arc arcs_38_5[1] = {
@@ -800,267 +847,279 @@ static state states_38[8] = {
{1, arcs_38_1},
{1, arcs_38_2},
{1, arcs_38_3},
- {2, arcs_38_4},
+ {3, arcs_38_4},
{1, arcs_38_5},
{1, arcs_38_6},
{1, arcs_38_7},
};
static arc arcs_39_0[1] = {
- {94, 1},
+ {95, 1},
};
static arc arcs_39_1[1] = {
- {60, 2},
+ {24, 2},
};
static arc arcs_39_2[1] = {
- {95, 3},
+ {25, 3},
};
static arc arcs_39_3[1] = {
- {9, 4},
+ {26, 4},
};
-static arc arcs_39_4[1] = {
- {25, 5},
+static arc arcs_39_4[2] = {
+ {94, 5},
+ {0, 4},
};
static arc arcs_39_5[1] = {
- {26, 6},
+ {25, 6},
};
-static arc arcs_39_6[2] = {
- {92, 7},
- {0, 6},
+static arc arcs_39_6[1] = {
+ {26, 7},
};
static arc arcs_39_7[1] = {
- {25, 8},
-};
-static arc arcs_39_8[1] = {
- {26, 9},
-};
-static arc arcs_39_9[1] = {
- {0, 9},
+ {0, 7},
};
-static state states_39[10] = {
+static state states_39[8] = {
{1, arcs_39_0},
{1, arcs_39_1},
{1, arcs_39_2},
{1, arcs_39_3},
- {1, arcs_39_4},
+ {2, arcs_39_4},
{1, arcs_39_5},
- {2, arcs_39_6},
+ {1, arcs_39_6},
{1, arcs_39_7},
- {1, arcs_39_8},
- {1, arcs_39_9},
};
static arc arcs_40_0[1] = {
{96, 1},
};
static arc arcs_40_1[1] = {
- {25, 2},
+ {62, 2},
};
static arc arcs_40_2[1] = {
- {26, 3},
+ {97, 3},
};
-static arc arcs_40_3[2] = {
- {97, 4},
- {98, 5},
+static arc arcs_40_3[1] = {
+ {9, 4},
};
static arc arcs_40_4[1] = {
- {25, 6},
+ {25, 5},
};
static arc arcs_40_5[1] = {
- {25, 7},
+ {26, 6},
};
-static arc arcs_40_6[1] = {
- {26, 8},
+static arc arcs_40_6[2] = {
+ {94, 7},
+ {0, 6},
};
static arc arcs_40_7[1] = {
- {26, 9},
+ {25, 8},
};
-static arc arcs_40_8[4] = {
- {97, 4},
- {92, 10},
- {98, 5},
- {0, 8},
+static arc arcs_40_8[1] = {
+ {26, 9},
};
static arc arcs_40_9[1] = {
{0, 9},
};
-static arc arcs_40_10[1] = {
- {25, 11},
-};
-static arc arcs_40_11[1] = {
- {26, 12},
-};
-static arc arcs_40_12[2] = {
- {98, 5},
- {0, 12},
-};
-static state states_40[13] = {
+static state states_40[10] = {
{1, arcs_40_0},
{1, arcs_40_1},
{1, arcs_40_2},
- {2, arcs_40_3},
+ {1, arcs_40_3},
{1, arcs_40_4},
{1, arcs_40_5},
- {1, arcs_40_6},
+ {2, arcs_40_6},
{1, arcs_40_7},
- {4, arcs_40_8},
+ {1, arcs_40_8},
{1, arcs_40_9},
- {1, arcs_40_10},
- {1, arcs_40_11},
- {2, arcs_40_12},
};
static arc arcs_41_0[1] = {
- {99, 1},
+ {98, 1},
};
static arc arcs_41_1[1] = {
- {100, 2},
+ {25, 2},
};
-static arc arcs_41_2[2] = {
- {30, 1},
- {25, 3},
+static arc arcs_41_2[1] = {
+ {26, 3},
};
-static arc arcs_41_3[1] = {
- {26, 4},
+static arc arcs_41_3[2] = {
+ {99, 4},
+ {100, 5},
};
static arc arcs_41_4[1] = {
- {0, 4},
+ {25, 6},
+};
+static arc arcs_41_5[1] = {
+ {25, 7},
+};
+static arc arcs_41_6[1] = {
+ {26, 8},
+};
+static arc arcs_41_7[1] = {
+ {26, 9},
+};
+static arc arcs_41_8[4] = {
+ {99, 4},
+ {94, 10},
+ {100, 5},
+ {0, 8},
+};
+static arc arcs_41_9[1] = {
+ {0, 9},
+};
+static arc arcs_41_10[1] = {
+ {25, 11},
+};
+static arc arcs_41_11[1] = {
+ {26, 12},
};
-static state states_41[5] = {
+static arc arcs_41_12[2] = {
+ {100, 5},
+ {0, 12},
+};
+static state states_41[13] = {
{1, arcs_41_0},
{1, arcs_41_1},
- {2, arcs_41_2},
- {1, arcs_41_3},
+ {1, arcs_41_2},
+ {2, arcs_41_3},
{1, arcs_41_4},
+ {1, arcs_41_5},
+ {1, arcs_41_6},
+ {1, arcs_41_7},
+ {4, arcs_41_8},
+ {1, arcs_41_9},
+ {1, arcs_41_10},
+ {1, arcs_41_11},
+ {2, arcs_41_12},
};
static arc arcs_42_0[1] = {
- {24, 1},
+ {101, 1},
};
-static arc arcs_42_1[2] = {
- {80, 2},
- {0, 1},
+static arc arcs_42_1[1] = {
+ {102, 2},
};
-static arc arcs_42_2[1] = {
- {101, 3},
+static arc arcs_42_2[2] = {
+ {30, 1},
+ {25, 3},
};
static arc arcs_42_3[1] = {
- {0, 3},
+ {26, 4},
};
-static state states_42[4] = {
+static arc arcs_42_4[1] = {
+ {0, 4},
+};
+static state states_42[5] = {
{1, arcs_42_0},
- {2, arcs_42_1},
- {1, arcs_42_2},
+ {1, arcs_42_1},
+ {2, arcs_42_2},
{1, arcs_42_3},
+ {1, arcs_42_4},
};
static arc arcs_43_0[1] = {
- {102, 1},
+ {24, 1},
};
static arc arcs_43_1[2] = {
- {24, 2},
+ {82, 2},
{0, 1},
};
-static arc arcs_43_2[2] = {
- {80, 3},
- {0, 2},
+static arc arcs_43_2[1] = {
+ {103, 3},
};
static arc arcs_43_3[1] = {
- {21, 4},
-};
-static arc arcs_43_4[1] = {
- {0, 4},
+ {0, 3},
};
-static state states_43[5] = {
+static state states_43[4] = {
{1, arcs_43_0},
{2, arcs_43_1},
- {2, arcs_43_2},
+ {1, arcs_43_2},
{1, arcs_43_3},
- {1, arcs_43_4},
};
-static arc arcs_44_0[2] = {
- {3, 1},
- {2, 2},
+static arc arcs_44_0[1] = {
+ {104, 1},
};
-static arc arcs_44_1[1] = {
+static arc arcs_44_1[2] = {
+ {24, 2},
{0, 1},
};
-static arc arcs_44_2[1] = {
- {103, 3},
+static arc arcs_44_2[2] = {
+ {82, 3},
+ {0, 2},
};
static arc arcs_44_3[1] = {
- {6, 4},
+ {21, 4},
};
-static arc arcs_44_4[2] = {
- {6, 4},
- {104, 1},
+static arc arcs_44_4[1] = {
+ {0, 4},
};
static state states_44[5] = {
- {2, arcs_44_0},
- {1, arcs_44_1},
- {1, arcs_44_2},
+ {1, arcs_44_0},
+ {2, arcs_44_1},
+ {2, arcs_44_2},
{1, arcs_44_3},
- {2, arcs_44_4},
+ {1, arcs_44_4},
};
static arc arcs_45_0[2] = {
- {105, 1},
- {106, 2},
+ {3, 1},
+ {2, 2},
};
-static arc arcs_45_1[2] = {
- {90, 3},
+static arc arcs_45_1[1] = {
{0, 1},
};
static arc arcs_45_2[1] = {
- {0, 2},
+ {105, 3},
};
static arc arcs_45_3[1] = {
- {105, 4},
-};
-static arc arcs_45_4[1] = {
- {92, 5},
+ {6, 4},
};
-static arc arcs_45_5[1] = {
- {24, 2},
+static arc arcs_45_4[2] = {
+ {6, 4},
+ {106, 1},
};
-static state states_45[6] = {
+static state states_45[5] = {
{2, arcs_45_0},
- {2, arcs_45_1},
+ {1, arcs_45_1},
{1, arcs_45_2},
{1, arcs_45_3},
- {1, arcs_45_4},
- {1, arcs_45_5},
+ {2, arcs_45_4},
};
static arc arcs_46_0[2] = {
- {105, 1},
- {108, 1},
+ {107, 1},
+ {108, 2},
};
-static arc arcs_46_1[1] = {
+static arc arcs_46_1[2] = {
+ {92, 3},
{0, 1},
};
-static state states_46[2] = {
- {2, arcs_46_0},
- {1, arcs_46_1},
+static arc arcs_46_2[1] = {
+ {0, 2},
};
-static arc arcs_47_0[1] = {
- {109, 1},
+static arc arcs_46_3[1] = {
+ {107, 4},
};
-static arc arcs_47_1[2] = {
- {33, 2},
- {25, 3},
+static arc arcs_46_4[1] = {
+ {94, 5},
};
-static arc arcs_47_2[1] = {
- {25, 3},
+static arc arcs_46_5[1] = {
+ {24, 2},
};
-static arc arcs_47_3[1] = {
- {24, 4},
+static state states_46[6] = {
+ {2, arcs_46_0},
+ {2, arcs_46_1},
+ {1, arcs_46_2},
+ {1, arcs_46_3},
+ {1, arcs_46_4},
+ {1, arcs_46_5},
+};
+static arc arcs_47_0[2] = {
+ {107, 1},
+ {110, 1},
};
-static arc arcs_47_4[1] = {
- {0, 4},
+static arc arcs_47_1[1] = {
+ {0, 1},
};
-static state states_47[5] = {
- {1, arcs_47_0},
- {2, arcs_47_1},
- {1, arcs_47_2},
- {1, arcs_47_3},
- {1, arcs_47_4},
+static state states_47[2] = {
+ {2, arcs_47_0},
+ {1, arcs_47_1},
};
static arc arcs_48_0[1] = {
- {109, 1},
+ {111, 1},
};
static arc arcs_48_1[2] = {
{33, 2},
@@ -1070,7 +1129,7 @@ static arc arcs_48_2[1] = {
{25, 3},
};
static arc arcs_48_3[1] = {
- {107, 4},
+ {24, 4},
};
static arc arcs_48_4[1] = {
{0, 4},
@@ -1083,15 +1142,27 @@ static state states_48[5] = {
{1, arcs_48_4},
};
static arc arcs_49_0[1] = {
- {110, 1},
+ {111, 1},
};
static arc arcs_49_1[2] = {
- {111, 0},
- {0, 1},
+ {33, 2},
+ {25, 3},
+};
+static arc arcs_49_2[1] = {
+ {25, 3},
+};
+static arc arcs_49_3[1] = {
+ {109, 4},
+};
+static arc arcs_49_4[1] = {
+ {0, 4},
};
-static state states_49[2] = {
+static state states_49[5] = {
{1, arcs_49_0},
{2, arcs_49_1},
+ {1, arcs_49_2},
+ {1, arcs_49_3},
+ {1, arcs_49_4},
};
static arc arcs_50_0[1] = {
{112, 1},
@@ -1104,91 +1175,90 @@ static state states_50[2] = {
{1, arcs_50_0},
{2, arcs_50_1},
};
-static arc arcs_51_0[2] = {
+static arc arcs_51_0[1] = {
{114, 1},
- {115, 2},
};
-static arc arcs_51_1[1] = {
- {112, 2},
+static arc arcs_51_1[2] = {
+ {115, 0},
+ {0, 1},
+};
+static state states_51[2] = {
+ {1, arcs_51_0},
+ {2, arcs_51_1},
+};
+static arc arcs_52_0[2] = {
+ {116, 1},
+ {117, 2},
};
-static arc arcs_51_2[1] = {
+static arc arcs_52_1[1] = {
+ {114, 2},
+};
+static arc arcs_52_2[1] = {
{0, 2},
};
-static state states_51[3] = {
- {2, arcs_51_0},
- {1, arcs_51_1},
- {1, arcs_51_2},
+static state states_52[3] = {
+ {2, arcs_52_0},
+ {1, arcs_52_1},
+ {1, arcs_52_2},
};
-static arc arcs_52_0[1] = {
- {116, 1},
+static arc arcs_53_0[1] = {
+ {103, 1},
};
-static arc arcs_52_1[2] = {
- {117, 0},
+static arc arcs_53_1[2] = {
+ {118, 0},
{0, 1},
};
-static state states_52[2] = {
- {1, arcs_52_0},
- {2, arcs_52_1},
+static state states_53[2] = {
+ {1, arcs_53_0},
+ {2, arcs_53_1},
};
-static arc arcs_53_0[10] = {
- {118, 1},
+static arc arcs_54_0[10] = {
{119, 1},
{120, 1},
{121, 1},
{122, 1},
{123, 1},
{124, 1},
- {95, 1},
- {114, 2},
- {125, 3},
+ {125, 1},
+ {97, 1},
+ {116, 2},
+ {126, 3},
};
-static arc arcs_53_1[1] = {
+static arc arcs_54_1[1] = {
{0, 1},
};
-static arc arcs_53_2[1] = {
- {95, 1},
+static arc arcs_54_2[1] = {
+ {97, 1},
};
-static arc arcs_53_3[2] = {
- {114, 1},
+static arc arcs_54_3[2] = {
+ {116, 1},
{0, 3},
};
-static state states_53[4] = {
- {10, arcs_53_0},
- {1, arcs_53_1},
- {1, arcs_53_2},
- {2, arcs_53_3},
-};
-static arc arcs_54_0[2] = {
- {31, 1},
- {101, 2},
-};
-static arc arcs_54_1[1] = {
- {101, 2},
-};
-static arc arcs_54_2[1] = {
- {0, 2},
-};
-static state states_54[3] = {
- {2, arcs_54_0},
+static state states_54[4] = {
+ {10, arcs_54_0},
{1, arcs_54_1},
{1, arcs_54_2},
+ {2, arcs_54_3},
};
static arc arcs_55_0[1] = {
- {126, 1},
+ {31, 1},
};
-static arc arcs_55_1[2] = {
- {127, 0},
- {0, 1},
+static arc arcs_55_1[1] = {
+ {103, 2},
+};
+static arc arcs_55_2[1] = {
+ {0, 2},
};
-static state states_55[2] = {
+static state states_55[3] = {
{1, arcs_55_0},
- {2, arcs_55_1},
+ {1, arcs_55_1},
+ {1, arcs_55_2},
};
static arc arcs_56_0[1] = {
- {128, 1},
+ {127, 1},
};
static arc arcs_56_1[2] = {
- {129, 0},
+ {128, 0},
{0, 1},
};
static state states_56[2] = {
@@ -1196,10 +1266,10 @@ static state states_56[2] = {
{2, arcs_56_1},
};
static arc arcs_57_0[1] = {
- {130, 1},
+ {129, 1},
};
static arc arcs_57_1[2] = {
- {131, 0},
+ {130, 0},
{0, 1},
};
static state states_57[2] = {
@@ -1207,23 +1277,22 @@ static state states_57[2] = {
{2, arcs_57_1},
};
static arc arcs_58_0[1] = {
- {132, 1},
+ {131, 1},
};
-static arc arcs_58_1[3] = {
- {133, 0},
- {134, 0},
+static arc arcs_58_1[2] = {
+ {132, 0},
{0, 1},
};
static state states_58[2] = {
{1, arcs_58_0},
- {3, arcs_58_1},
+ {2, arcs_58_1},
};
static arc arcs_59_0[1] = {
- {135, 1},
+ {133, 1},
};
static arc arcs_59_1[3] = {
- {136, 0},
- {137, 0},
+ {134, 0},
+ {135, 0},
{0, 1},
};
static state states_59[2] = {
@@ -1231,477 +1300,482 @@ static state states_59[2] = {
{3, arcs_59_1},
};
static arc arcs_60_0[1] = {
- {138, 1},
+ {136, 1},
+};
+static arc arcs_60_1[3] = {
+ {137, 0},
+ {138, 0},
+ {0, 1},
};
-static arc arcs_60_1[5] = {
+static state states_60[2] = {
+ {1, arcs_60_0},
+ {3, arcs_60_1},
+};
+static arc arcs_61_0[1] = {
+ {139, 1},
+};
+static arc arcs_61_1[5] = {
{31, 0},
- {139, 0},
{140, 0},
{141, 0},
+ {142, 0},
{0, 1},
};
-static state states_60[2] = {
- {1, arcs_60_0},
- {5, arcs_60_1},
+static state states_61[2] = {
+ {1, arcs_61_0},
+ {5, arcs_61_1},
};
-static arc arcs_61_0[4] = {
- {136, 1},
+static arc arcs_62_0[4] = {
{137, 1},
- {142, 1},
- {143, 2},
+ {138, 1},
+ {143, 1},
+ {144, 2},
};
-static arc arcs_61_1[1] = {
- {138, 2},
+static arc arcs_62_1[1] = {
+ {139, 2},
};
-static arc arcs_61_2[1] = {
+static arc arcs_62_2[1] = {
{0, 2},
};
-static state states_61[3] = {
- {4, arcs_61_0},
- {1, arcs_61_1},
- {1, arcs_61_2},
-};
-static arc arcs_62_0[1] = {
- {144, 1},
+static state states_62[3] = {
+ {4, arcs_62_0},
+ {1, arcs_62_1},
+ {1, arcs_62_2},
};
-static arc arcs_62_1[3] = {
+static arc arcs_63_0[1] = {
{145, 1},
+};
+static arc arcs_63_1[3] = {
+ {146, 1},
{32, 2},
{0, 1},
};
-static arc arcs_62_2[1] = {
- {138, 3},
+static arc arcs_63_2[1] = {
+ {139, 3},
};
-static arc arcs_62_3[1] = {
+static arc arcs_63_3[1] = {
{0, 3},
};
-static state states_62[4] = {
- {1, arcs_62_0},
- {3, arcs_62_1},
- {1, arcs_62_2},
- {1, arcs_62_3},
+static state states_63[4] = {
+ {1, arcs_63_0},
+ {3, arcs_63_1},
+ {1, arcs_63_2},
+ {1, arcs_63_3},
};
-static arc arcs_63_0[10] = {
+static arc arcs_64_0[10] = {
{13, 1},
- {147, 2},
- {149, 3},
+ {148, 2},
+ {150, 3},
{21, 4},
- {152, 4},
- {153, 5},
- {77, 4},
- {154, 4},
+ {153, 4},
+ {154, 5},
+ {79, 4},
{155, 4},
{156, 4},
+ {157, 4},
};
-static arc arcs_63_1[3] = {
- {46, 6},
- {146, 6},
+static arc arcs_64_1[3] = {
+ {47, 6},
+ {147, 6},
{15, 4},
};
-static arc arcs_63_2[2] = {
- {146, 7},
- {148, 4},
+static arc arcs_64_2[2] = {
+ {147, 7},
+ {149, 4},
};
-static arc arcs_63_3[2] = {
- {150, 8},
- {151, 4},
+static arc arcs_64_3[2] = {
+ {151, 8},
+ {152, 4},
};
-static arc arcs_63_4[1] = {
+static arc arcs_64_4[1] = {
{0, 4},
};
-static arc arcs_63_5[2] = {
- {153, 5},
+static arc arcs_64_5[2] = {
+ {154, 5},
{0, 5},
};
-static arc arcs_63_6[1] = {
+static arc arcs_64_6[1] = {
{15, 4},
};
-static arc arcs_63_7[1] = {
- {148, 4},
+static arc arcs_64_7[1] = {
+ {149, 4},
};
-static arc arcs_63_8[1] = {
- {151, 4},
+static arc arcs_64_8[1] = {
+ {152, 4},
};
-static state states_63[9] = {
- {10, arcs_63_0},
- {3, arcs_63_1},
- {2, arcs_63_2},
- {2, arcs_63_3},
- {1, arcs_63_4},
- {2, arcs_63_5},
- {1, arcs_63_6},
- {1, arcs_63_7},
- {1, arcs_63_8},
-};
-static arc arcs_64_0[1] = {
+static state states_64[9] = {
+ {10, arcs_64_0},
+ {3, arcs_64_1},
+ {2, arcs_64_2},
+ {2, arcs_64_3},
+ {1, arcs_64_4},
+ {2, arcs_64_5},
+ {1, arcs_64_6},
+ {1, arcs_64_7},
+ {1, arcs_64_8},
+};
+static arc arcs_65_0[2] = {
{24, 1},
+ {48, 1},
};
-static arc arcs_64_1[3] = {
- {157, 2},
+static arc arcs_65_1[3] = {
+ {158, 2},
{30, 3},
{0, 1},
};
-static arc arcs_64_2[1] = {
+static arc arcs_65_2[1] = {
{0, 2},
};
-static arc arcs_64_3[2] = {
+static arc arcs_65_3[3] = {
{24, 4},
+ {48, 4},
{0, 3},
};
-static arc arcs_64_4[2] = {
+static arc arcs_65_4[2] = {
{30, 3},
{0, 4},
};
-static state states_64[5] = {
- {1, arcs_64_0},
- {3, arcs_64_1},
- {1, arcs_64_2},
- {2, arcs_64_3},
- {2, arcs_64_4},
+static state states_65[5] = {
+ {2, arcs_65_0},
+ {3, arcs_65_1},
+ {1, arcs_65_2},
+ {3, arcs_65_3},
+ {2, arcs_65_4},
};
-static arc arcs_65_0[3] = {
+static arc arcs_66_0[3] = {
{13, 1},
- {147, 2},
- {76, 3},
+ {148, 2},
+ {78, 3},
};
-static arc arcs_65_1[2] = {
+static arc arcs_66_1[2] = {
{14, 4},
{15, 5},
};
-static arc arcs_65_2[1] = {
- {158, 6},
+static arc arcs_66_2[1] = {
+ {159, 6},
};
-static arc arcs_65_3[1] = {
+static arc arcs_66_3[1] = {
{21, 5},
};
-static arc arcs_65_4[1] = {
+static arc arcs_66_4[1] = {
{15, 5},
};
-static arc arcs_65_5[1] = {
+static arc arcs_66_5[1] = {
{0, 5},
};
-static arc arcs_65_6[1] = {
- {148, 5},
+static arc arcs_66_6[1] = {
+ {149, 5},
};
-static state states_65[7] = {
- {3, arcs_65_0},
- {2, arcs_65_1},
- {1, arcs_65_2},
- {1, arcs_65_3},
- {1, arcs_65_4},
- {1, arcs_65_5},
- {1, arcs_65_6},
+static state states_66[7] = {
+ {3, arcs_66_0},
+ {2, arcs_66_1},
+ {1, arcs_66_2},
+ {1, arcs_66_3},
+ {1, arcs_66_4},
+ {1, arcs_66_5},
+ {1, arcs_66_6},
};
-static arc arcs_66_0[1] = {
- {159, 1},
+static arc arcs_67_0[1] = {
+ {160, 1},
};
-static arc arcs_66_1[2] = {
+static arc arcs_67_1[2] = {
{30, 2},
{0, 1},
};
-static arc arcs_66_2[2] = {
- {159, 1},
+static arc arcs_67_2[2] = {
+ {160, 1},
{0, 2},
};
-static state states_66[3] = {
- {1, arcs_66_0},
- {2, arcs_66_1},
- {2, arcs_66_2},
+static state states_67[3] = {
+ {1, arcs_67_0},
+ {2, arcs_67_1},
+ {2, arcs_67_2},
};
-static arc arcs_67_0[2] = {
+static arc arcs_68_0[2] = {
{24, 1},
{25, 2},
};
-static arc arcs_67_1[2] = {
+static arc arcs_68_1[2] = {
{25, 2},
{0, 1},
};
-static arc arcs_67_2[3] = {
+static arc arcs_68_2[3] = {
{24, 3},
- {160, 4},
+ {161, 4},
{0, 2},
};
-static arc arcs_67_3[2] = {
- {160, 4},
+static arc arcs_68_3[2] = {
+ {161, 4},
{0, 3},
};
-static arc arcs_67_4[1] = {
+static arc arcs_68_4[1] = {
{0, 4},
};
-static state states_67[5] = {
- {2, arcs_67_0},
- {2, arcs_67_1},
- {3, arcs_67_2},
- {2, arcs_67_3},
- {1, arcs_67_4},
+static state states_68[5] = {
+ {2, arcs_68_0},
+ {2, arcs_68_1},
+ {3, arcs_68_2},
+ {2, arcs_68_3},
+ {1, arcs_68_4},
};
-static arc arcs_68_0[1] = {
+static arc arcs_69_0[1] = {
{25, 1},
};
-static arc arcs_68_1[2] = {
+static arc arcs_69_1[2] = {
{24, 2},
{0, 1},
};
-static arc arcs_68_2[1] = {
+static arc arcs_69_2[1] = {
{0, 2},
};
-static state states_68[3] = {
- {1, arcs_68_0},
- {2, arcs_68_1},
- {1, arcs_68_2},
+static state states_69[3] = {
+ {1, arcs_69_0},
+ {2, arcs_69_1},
+ {1, arcs_69_2},
};
-static arc arcs_69_0[1] = {
- {116, 1},
+static arc arcs_70_0[2] = {
+ {103, 1},
+ {48, 1},
};
-static arc arcs_69_1[2] = {
+static arc arcs_70_1[2] = {
{30, 2},
{0, 1},
};
-static arc arcs_69_2[2] = {
- {116, 1},
+static arc arcs_70_2[3] = {
+ {103, 1},
+ {48, 1},
{0, 2},
};
-static state states_69[3] = {
- {1, arcs_69_0},
- {2, arcs_69_1},
- {2, arcs_69_2},
+static state states_70[3] = {
+ {2, arcs_70_0},
+ {2, arcs_70_1},
+ {3, arcs_70_2},
};
-static arc arcs_70_0[1] = {
+static arc arcs_71_0[1] = {
{24, 1},
};
-static arc arcs_70_1[2] = {
+static arc arcs_71_1[2] = {
{30, 2},
{0, 1},
};
-static arc arcs_70_2[2] = {
+static arc arcs_71_2[2] = {
{24, 1},
{0, 2},
};
-static state states_70[3] = {
- {1, arcs_70_0},
- {2, arcs_70_1},
- {2, arcs_70_2},
+static state states_71[3] = {
+ {1, arcs_71_0},
+ {2, arcs_71_1},
+ {2, arcs_71_2},
};
-static arc arcs_71_0[1] = {
+static arc arcs_72_0[1] = {
{24, 1},
};
-static arc arcs_71_1[4] = {
+static arc arcs_72_1[4] = {
{25, 2},
- {157, 3},
+ {158, 3},
{30, 4},
{0, 1},
};
-static arc arcs_71_2[1] = {
+static arc arcs_72_2[1] = {
{24, 5},
};
-static arc arcs_71_3[1] = {
+static arc arcs_72_3[1] = {
{0, 3},
};
-static arc arcs_71_4[2] = {
+static arc arcs_72_4[2] = {
{24, 6},
{0, 4},
};
-static arc arcs_71_5[3] = {
- {157, 3},
+static arc arcs_72_5[3] = {
+ {158, 3},
{30, 7},
{0, 5},
};
-static arc arcs_71_6[2] = {
+static arc arcs_72_6[2] = {
{30, 4},
{0, 6},
};
-static arc arcs_71_7[2] = {
+static arc arcs_72_7[2] = {
{24, 8},
{0, 7},
};
-static arc arcs_71_8[1] = {
+static arc arcs_72_8[1] = {
{25, 9},
};
-static arc arcs_71_9[1] = {
+static arc arcs_72_9[1] = {
{24, 10},
};
-static arc arcs_71_10[2] = {
+static arc arcs_72_10[2] = {
{30, 7},
{0, 10},
};
-static state states_71[11] = {
- {1, arcs_71_0},
- {4, arcs_71_1},
- {1, arcs_71_2},
- {1, arcs_71_3},
- {2, arcs_71_4},
- {3, arcs_71_5},
- {2, arcs_71_6},
- {2, arcs_71_7},
- {1, arcs_71_8},
- {1, arcs_71_9},
- {2, arcs_71_10},
-};
-static arc arcs_72_0[1] = {
- {161, 1},
+static state states_72[11] = {
+ {1, arcs_72_0},
+ {4, arcs_72_1},
+ {1, arcs_72_2},
+ {1, arcs_72_3},
+ {2, arcs_72_4},
+ {3, arcs_72_5},
+ {2, arcs_72_6},
+ {2, arcs_72_7},
+ {1, arcs_72_8},
+ {1, arcs_72_9},
+ {2, arcs_72_10},
+};
+static arc arcs_73_0[1] = {
+ {162, 1},
};
-static arc arcs_72_1[1] = {
+static arc arcs_73_1[1] = {
{21, 2},
};
-static arc arcs_72_2[2] = {
+static arc arcs_73_2[2] = {
{13, 3},
{25, 4},
};
-static arc arcs_72_3[2] = {
+static arc arcs_73_3[2] = {
{14, 5},
{15, 6},
};
-static arc arcs_72_4[1] = {
+static arc arcs_73_4[1] = {
{26, 7},
};
-static arc arcs_72_5[1] = {
+static arc arcs_73_5[1] = {
{15, 6},
};
-static arc arcs_72_6[1] = {
+static arc arcs_73_6[1] = {
{25, 4},
};
-static arc arcs_72_7[1] = {
+static arc arcs_73_7[1] = {
{0, 7},
};
-static state states_72[8] = {
- {1, arcs_72_0},
- {1, arcs_72_1},
- {2, arcs_72_2},
- {2, arcs_72_3},
- {1, arcs_72_4},
- {1, arcs_72_5},
- {1, arcs_72_6},
- {1, arcs_72_7},
-};
-static arc arcs_73_0[3] = {
- {162, 1},
+static state states_73[8] = {
+ {1, arcs_73_0},
+ {1, arcs_73_1},
+ {2, arcs_73_2},
+ {2, arcs_73_3},
+ {1, arcs_73_4},
+ {1, arcs_73_5},
+ {1, arcs_73_6},
+ {1, arcs_73_7},
+};
+static arc arcs_74_0[3] = {
+ {163, 1},
{31, 2},
{32, 3},
};
-static arc arcs_73_1[2] = {
+static arc arcs_74_1[2] = {
{30, 4},
{0, 1},
};
-static arc arcs_73_2[1] = {
+static arc arcs_74_2[1] = {
{24, 5},
};
-static arc arcs_73_3[1] = {
+static arc arcs_74_3[1] = {
{24, 6},
};
-static arc arcs_73_4[4] = {
- {162, 1},
+static arc arcs_74_4[4] = {
+ {163, 1},
{31, 2},
{32, 3},
{0, 4},
};
-static arc arcs_73_5[2] = {
+static arc arcs_74_5[2] = {
{30, 7},
{0, 5},
};
-static arc arcs_73_6[1] = {
+static arc arcs_74_6[1] = {
{0, 6},
};
-static arc arcs_73_7[2] = {
- {162, 5},
+static arc arcs_74_7[2] = {
+ {163, 5},
{32, 3},
};
-static state states_73[8] = {
- {3, arcs_73_0},
- {2, arcs_73_1},
- {1, arcs_73_2},
- {1, arcs_73_3},
- {4, arcs_73_4},
- {2, arcs_73_5},
- {1, arcs_73_6},
- {2, arcs_73_7},
+static state states_74[8] = {
+ {3, arcs_74_0},
+ {2, arcs_74_1},
+ {1, arcs_74_2},
+ {1, arcs_74_3},
+ {4, arcs_74_4},
+ {2, arcs_74_5},
+ {1, arcs_74_6},
+ {2, arcs_74_7},
};
-static arc arcs_74_0[1] = {
+static arc arcs_75_0[1] = {
{24, 1},
};
-static arc arcs_74_1[3] = {
- {157, 2},
+static arc arcs_75_1[3] = {
+ {158, 2},
{29, 3},
{0, 1},
};
-static arc arcs_74_2[1] = {
+static arc arcs_75_2[1] = {
{0, 2},
};
-static arc arcs_74_3[1] = {
+static arc arcs_75_3[1] = {
{24, 2},
};
-static state states_74[4] = {
- {1, arcs_74_0},
- {3, arcs_74_1},
- {1, arcs_74_2},
- {1, arcs_74_3},
+static state states_75[4] = {
+ {1, arcs_75_0},
+ {3, arcs_75_1},
+ {1, arcs_75_2},
+ {1, arcs_75_3},
};
-static arc arcs_75_0[2] = {
- {157, 1},
- {164, 1},
-};
-static arc arcs_75_1[1] = {
- {0, 1},
-};
-static state states_75[2] = {
- {2, arcs_75_0},
- {1, arcs_75_1},
-};
-static arc arcs_76_0[1] = {
- {94, 1},
+static arc arcs_76_0[2] = {
+ {158, 1},
+ {165, 1},
};
static arc arcs_76_1[1] = {
- {60, 2},
-};
-static arc arcs_76_2[1] = {
- {95, 3},
-};
-static arc arcs_76_3[1] = {
- {105, 4},
-};
-static arc arcs_76_4[2] = {
- {163, 5},
- {0, 4},
-};
-static arc arcs_76_5[1] = {
- {0, 5},
+ {0, 1},
};
-static state states_76[6] = {
- {1, arcs_76_0},
+static state states_76[2] = {
+ {2, arcs_76_0},
{1, arcs_76_1},
- {1, arcs_76_2},
- {1, arcs_76_3},
- {2, arcs_76_4},
- {1, arcs_76_5},
};
static arc arcs_77_0[1] = {
- {90, 1},
+ {96, 1},
};
static arc arcs_77_1[1] = {
- {107, 2},
+ {62, 2},
};
-static arc arcs_77_2[2] = {
- {163, 3},
- {0, 2},
+static arc arcs_77_2[1] = {
+ {97, 3},
};
static arc arcs_77_3[1] = {
- {0, 3},
+ {107, 4},
+};
+static arc arcs_77_4[2] = {
+ {164, 5},
+ {0, 4},
};
-static state states_77[4] = {
+static arc arcs_77_5[1] = {
+ {0, 5},
+};
+static state states_77[6] = {
{1, arcs_77_0},
{1, arcs_77_1},
- {2, arcs_77_2},
+ {1, arcs_77_2},
{1, arcs_77_3},
+ {2, arcs_77_4},
+ {1, arcs_77_5},
};
static arc arcs_78_0[1] = {
- {24, 1},
+ {92, 1},
};
-static arc arcs_78_1[2] = {
- {30, 0},
- {0, 1},
+static arc arcs_78_1[1] = {
+ {109, 2},
+};
+static arc arcs_78_2[2] = {
+ {164, 3},
+ {0, 2},
+};
+static arc arcs_78_3[1] = {
+ {0, 3},
};
-static state states_78[2] = {
+static state states_78[4] = {
{1, arcs_78_0},
- {2, arcs_78_1},
+ {1, arcs_78_1},
+ {2, arcs_78_2},
+ {1, arcs_78_3},
};
static arc arcs_79_0[1] = {
{21, 1},
@@ -1730,11 +1804,11 @@ static state states_80[3] = {
};
static dfa dfas[81] = {
{256, "single_input", 0, 3, states_0,
- "\004\050\060\200\000\000\000\050\370\044\034\144\011\040\004\000\000\103\050\037\202"},
+ "\004\050\060\200\000\000\000\240\340\223\160\220\045\200\020\000\000\206\120\076\204"},
{257, "file_input", 0, 2, states_1,
- "\204\050\060\200\000\000\000\050\370\044\034\144\011\040\004\000\000\103\050\037\202"},
+ "\204\050\060\200\000\000\000\240\340\223\160\220\045\200\020\000\000\206\120\076\204"},
{258, "eval_input", 0, 3, states_2,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
{259, "decorator", 0, 7, states_3,
"\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{260, "decorators", 0, 2, states_4,
@@ -1745,148 +1819,148 @@ static dfa dfas[81] = {
"\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{263, "parameters", 0, 4, states_7,
"\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {264, "typedargslist", 0, 12, states_8,
+ {264, "typedargslist", 0, 18, states_8,
"\000\000\040\200\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{265, "tfpdef", 0, 4, states_9,
"\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {266, "varargslist", 0, 12, states_10,
+ {266, "varargslist", 0, 18, states_10,
"\000\000\040\200\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{267, "vfpdef", 0, 2, states_11,
"\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{268, "stmt", 0, 2, states_12,
- "\000\050\060\200\000\000\000\050\370\044\034\144\011\040\004\000\000\103\050\037\202"},
+ "\000\050\060\200\000\000\000\240\340\223\160\220\045\200\020\000\000\206\120\076\204"},
{269, "simple_stmt", 0, 4, states_13,
- "\000\040\040\200\000\000\000\050\370\044\034\000\000\040\004\000\000\103\050\037\200"},
+ "\000\040\040\200\000\000\000\240\340\223\160\000\000\200\020\000\000\206\120\076\200"},
{270, "small_stmt", 0, 2, states_14,
- "\000\040\040\200\000\000\000\050\370\044\034\000\000\040\004\000\000\103\050\037\200"},
+ "\000\040\040\200\000\000\000\240\340\223\160\000\000\200\020\000\000\206\120\076\200"},
{271, "expr_stmt", 0, 6, states_15,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {272, "augassign", 0, 2, states_16,
- "\000\000\000\000\000\200\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {273, "del_stmt", 0, 3, states_17,
- "\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {274, "pass_stmt", 0, 2, states_18,
+ "\000\040\040\200\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {272, "testlist_star_expr", 0, 3, states_16,
+ "\000\040\040\200\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {273, "augassign", 0, 2, states_17,
+ "\000\000\000\000\000\000\376\037\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+ {274, "del_stmt", 0, 3, states_18,
"\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {275, "flow_stmt", 0, 2, states_19,
- "\000\000\000\000\000\000\000\000\170\000\000\000\000\000\000\000\000\000\000\000\200"},
- {276, "break_stmt", 0, 2, states_20,
- "\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000"},
- {277, "continue_stmt", 0, 2, states_21,
- "\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000"},
- {278, "return_stmt", 0, 3, states_22,
+ {275, "pass_stmt", 0, 2, states_19,
+ "\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+ {276, "flow_stmt", 0, 2, states_20,
+ "\000\000\000\000\000\000\000\000\340\001\000\000\000\000\000\000\000\000\000\000\200"},
+ {277, "break_stmt", 0, 2, states_21,
"\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000"},
- {279, "yield_stmt", 0, 2, states_23,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\200"},
- {280, "raise_stmt", 0, 5, states_24,
+ {278, "continue_stmt", 0, 2, states_22,
"\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000"},
- {281, "import_stmt", 0, 2, states_25,
- "\000\000\000\000\000\000\000\000\200\004\000\000\000\000\000\000\000\000\000\000\000"},
- {282, "import_name", 0, 3, states_26,
- "\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000"},
- {283, "import_from", 0, 8, states_27,
+ {279, "return_stmt", 0, 3, states_23,
"\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000"},
- {284, "import_as_name", 0, 4, states_28,
+ {280, "yield_stmt", 0, 2, states_24,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\200"},
+ {281, "raise_stmt", 0, 5, states_25,
+ "\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000"},
+ {282, "import_stmt", 0, 2, states_26,
+ "\000\000\000\000\000\000\000\000\000\022\000\000\000\000\000\000\000\000\000\000\000"},
+ {283, "import_name", 0, 3, states_27,
+ "\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000"},
+ {284, "import_from", 0, 8, states_28,
+ "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000"},
+ {285, "import_as_name", 0, 4, states_29,
"\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {285, "dotted_as_name", 0, 4, states_29,
+ {286, "dotted_as_name", 0, 4, states_30,
"\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {286, "import_as_names", 0, 3, states_30,
+ {287, "import_as_names", 0, 3, states_31,
"\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {287, "dotted_as_names", 0, 2, states_31,
+ {288, "dotted_as_names", 0, 2, states_32,
"\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {288, "dotted_name", 0, 2, states_32,
+ {289, "dotted_name", 0, 2, states_33,
"\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {289, "global_stmt", 0, 3, states_33,
- "\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000"},
- {290, "nonlocal_stmt", 0, 3, states_34,
- "\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000"},
- {291, "assert_stmt", 0, 5, states_35,
+ {290, "global_stmt", 0, 3, states_34,
"\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000"},
- {292, "compound_stmt", 0, 2, states_36,
- "\000\010\020\000\000\000\000\000\000\000\000\144\011\000\000\000\000\000\000\000\002"},
- {293, "if_stmt", 0, 8, states_37,
- "\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000"},
- {294, "while_stmt", 0, 8, states_38,
- "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"},
- {295, "for_stmt", 0, 10, states_39,
- "\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"},
- {296, "try_stmt", 0, 13, states_40,
+ {291, "nonlocal_stmt", 0, 3, states_35,
+ "\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000"},
+ {292, "assert_stmt", 0, 5, states_36,
+ "\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000"},
+ {293, "compound_stmt", 0, 2, states_37,
+ "\000\010\020\000\000\000\000\000\000\000\000\220\045\000\000\000\000\000\000\000\004"},
+ {294, "if_stmt", 0, 8, states_38,
+ "\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000"},
+ {295, "while_stmt", 0, 8, states_39,
+ "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"},
+ {296, "for_stmt", 0, 10, states_40,
"\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000"},
- {297, "with_stmt", 0, 5, states_41,
- "\000\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000"},
- {298, "with_item", 0, 4, states_42,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {299, "except_clause", 0, 5, states_43,
- "\000\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000"},
- {300, "suite", 0, 5, states_44,
- "\004\040\040\200\000\000\000\050\370\044\034\000\000\040\004\000\000\103\050\037\200"},
- {301, "test", 0, 6, states_45,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {302, "test_nocond", 0, 2, states_46,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {303, "lambdef", 0, 5, states_47,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000"},
- {304, "lambdef_nocond", 0, 5, states_48,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000"},
- {305, "or_test", 0, 2, states_49,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\004\000\000\103\050\037\000"},
- {306, "and_test", 0, 2, states_50,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\004\000\000\103\050\037\000"},
- {307, "not_test", 0, 3, states_51,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\004\000\000\103\050\037\000"},
- {308, "comparison", 0, 2, states_52,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {309, "comp_op", 0, 4, states_53,
- "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\304\077\000\000\000\000\000"},
- {310, "star_expr", 0, 3, states_54,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {311, "expr", 0, 2, states_55,
- "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {312, "xor_expr", 0, 2, states_56,
- "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {313, "and_expr", 0, 2, states_57,
- "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {314, "shift_expr", 0, 2, states_58,
- "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {315, "arith_expr", 0, 2, states_59,
- "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {316, "term", 0, 2, states_60,
- "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {317, "factor", 0, 3, states_61,
- "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {318, "power", 0, 4, states_62,
- "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\050\037\000"},
- {319, "atom", 0, 9, states_63,
- "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\050\037\000"},
- {320, "testlist_comp", 0, 5, states_64,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {321, "trailer", 0, 7, states_65,
- "\000\040\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\010\000\000"},
- {322, "subscriptlist", 0, 3, states_66,
- "\000\040\040\202\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {323, "subscript", 0, 5, states_67,
- "\000\040\040\202\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {324, "sliceop", 0, 3, states_68,
+ {297, "try_stmt", 0, 13, states_41,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000"},
+ {298, "with_stmt", 0, 5, states_42,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000"},
+ {299, "with_item", 0, 4, states_43,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {300, "except_clause", 0, 5, states_44,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000"},
+ {301, "suite", 0, 5, states_45,
+ "\004\040\040\200\000\000\000\240\340\223\160\000\000\200\020\000\000\206\120\076\200"},
+ {302, "test", 0, 6, states_46,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {303, "test_nocond", 0, 2, states_47,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {304, "lambdef", 0, 5, states_48,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000"},
+ {305, "lambdef_nocond", 0, 5, states_49,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000"},
+ {306, "or_test", 0, 2, states_50,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\020\000\000\206\120\076\000"},
+ {307, "and_test", 0, 2, states_51,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\020\000\000\206\120\076\000"},
+ {308, "not_test", 0, 3, states_52,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\020\000\000\206\120\076\000"},
+ {309, "comparison", 0, 2, states_53,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\206\120\076\000"},
+ {310, "comp_op", 0, 4, states_54,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\002\000\220\177\000\000\000\000\000"},
+ {311, "star_expr", 0, 3, states_55,
+ "\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+ {312, "expr", 0, 2, states_56,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\206\120\076\000"},
+ {313, "xor_expr", 0, 2, states_57,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\206\120\076\000"},
+ {314, "and_expr", 0, 2, states_58,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\206\120\076\000"},
+ {315, "shift_expr", 0, 2, states_59,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\206\120\076\000"},
+ {316, "arith_expr", 0, 2, states_60,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\206\120\076\000"},
+ {317, "term", 0, 2, states_61,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\206\120\076\000"},
+ {318, "factor", 0, 3, states_62,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\206\120\076\000"},
+ {319, "power", 0, 4, states_63,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\120\076\000"},
+ {320, "atom", 0, 9, states_64,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\120\076\000"},
+ {321, "testlist_comp", 0, 5, states_65,
+ "\000\040\040\200\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {322, "trailer", 0, 7, states_66,
+ "\000\040\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\020\000\000"},
+ {323, "subscriptlist", 0, 3, states_67,
+ "\000\040\040\002\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {324, "subscript", 0, 5, states_68,
+ "\000\040\040\002\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {325, "sliceop", 0, 3, states_69,
"\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {325, "exprlist", 0, 3, states_69,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\000\000\000\103\050\037\000"},
- {326, "testlist", 0, 3, states_70,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {327, "dictorsetmaker", 0, 11, states_71,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {328, "classdef", 0, 8, states_72,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002"},
- {329, "arglist", 0, 8, states_73,
- "\000\040\040\200\001\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {330, "argument", 0, 4, states_74,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
- {331, "comp_iter", 0, 2, states_75,
- "\000\000\000\000\000\000\000\000\000\000\000\104\000\000\000\000\000\000\000\000\000"},
- {332, "comp_for", 0, 6, states_76,
- "\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"},
- {333, "comp_if", 0, 4, states_77,
- "\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000"},
- {334, "testlist1", 0, 2, states_78,
- "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"},
+ {326, "exprlist", 0, 3, states_70,
+ "\000\040\040\200\000\000\000\000\000\200\000\000\000\000\000\000\000\206\120\076\000"},
+ {327, "testlist", 0, 3, states_71,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {328, "dictorsetmaker", 0, 11, states_72,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {329, "classdef", 0, 8, states_73,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004"},
+ {330, "arglist", 0, 8, states_74,
+ "\000\040\040\200\001\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {331, "argument", 0, 4, states_75,
+ "\000\040\040\000\000\000\000\000\000\200\000\000\000\200\020\000\000\206\120\076\000"},
+ {332, "comp_iter", 0, 2, states_76,
+ "\000\000\000\000\000\000\000\000\000\000\000\020\001\000\000\000\000\000\000\000\000"},
+ {333, "comp_for", 0, 6, states_77,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000"},
+ {334, "comp_if", 0, 4, states_78,
+ "\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000"},
{335, "encoding_decl", 0, 2, states_79,
"\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{336, "yield_expr", 0, 3, states_80,
@@ -1897,29 +1971,29 @@ static label labels[168] = {
{256, 0},
{4, 0},
{269, 0},
- {292, 0},
+ {293, 0},
{257, 0},
{268, 0},
{0, 0},
{258, 0},
- {326, 0},
+ {327, 0},
{259, 0},
{50, 0},
- {288, 0},
+ {289, 0},
{7, 0},
- {329, 0},
+ {330, 0},
{8, 0},
{260, 0},
{261, 0},
- {328, 0},
+ {329, 0},
{262, 0},
{1, "def"},
{1, 0},
{263, 0},
{51, 0},
- {301, 0},
+ {302, 0},
{11, 0},
- {300, 0},
+ {301, 0},
{264, 0},
{265, 0},
{22, 0},
@@ -1931,15 +2005,17 @@ static label labels[168] = {
{270, 0},
{13, 0},
{271, 0},
- {273, 0},
{274, 0},
{275, 0},
- {281, 0},
- {289, 0},
+ {276, 0},
+ {282, 0},
{290, 0},
{291, 0},
+ {292, 0},
{272, 0},
+ {273, 0},
{336, 0},
+ {311, 0},
{37, 0},
{38, 0},
{39, 0},
@@ -1953,36 +2029,36 @@ static label labels[168] = {
{47, 0},
{49, 0},
{1, "del"},
- {325, 0},
+ {326, 0},
{1, "pass"},
- {276, 0},
{277, 0},
{278, 0},
- {280, 0},
{279, 0},
+ {281, 0},
+ {280, 0},
{1, "break"},
{1, "continue"},
{1, "return"},
{1, "raise"},
{1, "from"},
- {282, 0},
{283, 0},
+ {284, 0},
{1, "import"},
- {287, 0},
+ {288, 0},
{23, 0},
{52, 0},
- {286, 0},
- {284, 0},
- {1, "as"},
+ {287, 0},
{285, 0},
+ {1, "as"},
+ {286, 0},
{1, "global"},
{1, "nonlocal"},
{1, "assert"},
- {293, 0},
{294, 0},
{295, 0},
{296, 0},
{297, 0},
+ {298, 0},
{1, "if"},
{1, "elif"},
{1, "else"},
@@ -1990,27 +2066,26 @@ static label labels[168] = {
{1, "for"},
{1, "in"},
{1, "try"},
- {299, 0},
+ {300, 0},
{1, "finally"},
{1, "with"},
- {298, 0},
- {311, 0},
+ {299, 0},
+ {312, 0},
{1, "except"},
{5, 0},
{6, 0},
- {305, 0},
- {303, 0},
- {302, 0},
+ {306, 0},
{304, 0},
+ {303, 0},
+ {305, 0},
{1, "lambda"},
- {306, 0},
- {1, "or"},
{307, 0},
+ {1, "or"},
+ {308, 0},
{1, "and"},
{1, "not"},
- {308, 0},
- {310, 0},
{309, 0},
+ {310, 0},
{20, 0},
{21, 0},
{28, 0},
@@ -2019,45 +2094,44 @@ static label labels[168] = {
{29, 0},
{29, 0},
{1, "is"},
- {312, 0},
- {18, 0},
{313, 0},
- {33, 0},
+ {18, 0},
{314, 0},
- {19, 0},
+ {33, 0},
{315, 0},
+ {19, 0},
+ {316, 0},
{34, 0},
{35, 0},
- {316, 0},
+ {317, 0},
{14, 0},
{15, 0},
- {317, 0},
+ {318, 0},
{17, 0},
{24, 0},
{48, 0},
{32, 0},
- {318, 0},
{319, 0},
- {321, 0},
{320, 0},
+ {322, 0},
+ {321, 0},
{9, 0},
{10, 0},
{26, 0},
- {327, 0},
+ {328, 0},
{27, 0},
{2, 0},
{3, 0},
{1, "None"},
{1, "True"},
{1, "False"},
- {332, 0},
- {322, 0},
+ {333, 0},
{323, 0},
{324, 0},
+ {325, 0},
{1, "class"},
- {330, 0},
{331, 0},
- {333, 0},
+ {332, 0},
{334, 0},
{335, 0},
{1, "yield"},
diff --git a/Python/import.c b/Python/import.c
index 5d80983408..23752eeb72 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -5,13 +5,9 @@
#include "Python-ast.h"
#undef Yield /* undefine macro conflicting with winbase.h */
-#include "pyarena.h"
-#include "pythonrun.h"
#include "errcode.h"
#include "marshal.h"
#include "code.h"
-#include "compile.h"
-#include "eval.h"
#include "osdefs.h"
#include "importdl.h"
@@ -25,6 +21,8 @@ extern "C" {
#ifdef MS_WINDOWS
/* for stat.st_mode */
typedef unsigned short mode_t;
+/* for _mkdir */
+#include <direct.h>
#endif
@@ -43,6 +41,15 @@ typedef unsigned short mode_t;
The current working scheme is to increment the previous value by
10.
+ Starting with the adoption of PEP 3147 in Python 3.2, every bump in magic
+ number also includes a new "magic tag", i.e. a human readable string used
+ to represent the magic number in __pycache__ directories. When you change
+ the magic number, you must also set a new unique magic tag. Generally this
+ can be named after the Python major version of the magic number bump, but
+ it can really be anything, as long as it's different than anything else
+ that's come before. The tags are included in the following table, starting
+ with Python 3.2a0.
+
Known values:
Python 1.5: 20121
Python 1.5.1: 20121
@@ -78,26 +85,39 @@ typedef unsigned short mode_t;
3040 (added signature annotations)
3050 (print becomes a function)
3060 (PEP 3115 metaclass syntax)
- 3070 (PEP 3109 raise changes)
- 3080 (PEP 3137 make __file__ and __name__ unicode)
- 3090 (kill str8 interning)
- 3100 (merge from 2.6a0, see 62151)
- 3102 (__file__ points to source file)
- Python 3.0a4: 3110 (WITH_CLEANUP optimization).
- Python 3.0a5: 3130 (lexical exception stacking, including POP_EXCEPT)
- Python 3.1a0: 3140 (optimize list, set and dict comprehensions:
+ 3061 (string literals become unicode)
+ 3071 (PEP 3109 raise changes)
+ 3081 (PEP 3137 make __file__ and __name__ unicode)
+ 3091 (kill str8 interning)
+ 3101 (merge from 2.6a0, see 62151)
+ 3103 (__file__ points to source file)
+ Python 3.0a4: 3111 (WITH_CLEANUP optimization).
+ Python 3.0a5: 3131 (lexical exception stacking, including POP_EXCEPT)
+ Python 3.1a0: 3141 (optimize list, set and dict comprehensions:
change LIST_APPEND and SET_ADD, add MAP_ADD)
- Python 3.1a0: 3150 (optimize conditional branches:
+ Python 3.1a0: 3151 (optimize conditional branches:
introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE)
+ Python 3.2a0: 3160 (add SETUP_WITH)
+ tag: cpython-32
+ Python 3.2a1: 3170 (add DUP_TOP_TWO, remove DUP_TOPX and ROT_FOUR)
+ tag: cpython-32
+ Python 3.2a2 3180 (add DELETE_DEREF)
*/
-#define MAGIC (3150 | ((long)'\r'<<16) | ((long)'\n'<<24))
-/* Magic word as global; note that _PyImport_Init() can change the
- value of this global to accommodate for alterations of how the
- compiler works which are enabled by command line switches. */
+/* MAGIC must change whenever the bytecode emitted by the compiler may no
+ longer be understood by older implementations of the eval loop (usually
+ due to the addition of new opcodes)
+ TAG must change for each major Python release. The magic number will take
+ care of any bytecode changes that occur during development.
+*/
+#define MAGIC (3180 | ((long)'\r'<<16) | ((long)'\n'<<24))
+#define TAG "cpython-32"
+#define CACHEDIR "__pycache__"
+/* Current magic word and string tag as globals. */
static long pyc_magic = MAGIC;
+static const char *pyc_tag = TAG;
-/* See _PyImport_FixupExtension() below */
+/* See _PyImport_FixupExtensionUnicode() below */
static PyObject *extensions = NULL;
/* This table is defined in config.c: */
@@ -160,13 +180,6 @@ _PyImport_Init(void)
filetab->suffix = ".pyo";
}
}
-
- {
- /* Fix the pyc_magic so that byte compiled code created
- using the all-Unicode method doesn't interfere with
- code created in normal operation mode. */
- pyc_magic = MAGIC + 1;
- }
}
void
@@ -302,14 +315,27 @@ _PyImport_ReleaseLock(void)
return 1;
}
-/* This function used to be called from PyOS_AfterFork to ensure that newly
- created child processes do not share locks with the parent, but for some
- reason only on AIX systems. Instead of re-initializing the lock, we now
- acquire the import lock around fork() calls. */
+/* This function is called from PyOS_AfterFork to ensure that newly
+ created child processes do not share locks with the parent.
+ We now acquire the import lock around fork() calls but on some platforms
+ (Solaris 9 and earlier? see isue7242) that still left us with problems. */
void
_PyImport_ReInitLock(void)
{
+ if (import_lock != NULL)
+ import_lock = PyThread_allocate_lock();
+ if (import_lock_level > 1) {
+ /* Forked as a side effect of import */
+ long me = PyThread_get_thread_ident();
+ PyThread_acquire_lock(import_lock, 0);
+ /* XXX: can the previous line fail? */
+ import_lock_thread = me;
+ import_lock_level--;
+ } else {
+ import_lock_thread = -1;
+ import_lock_level = 0;
+ }
}
#endif
@@ -520,7 +546,7 @@ PyImport_Cleanup(void)
}
-/* Helper for pythonrun.c -- return magic number */
+/* Helper for pythonrun.c -- return magic number and tag. */
long
PyImport_GetMagicNumber(void)
@@ -529,24 +555,30 @@ PyImport_GetMagicNumber(void)
}
+const char *
+PyImport_GetMagicTag(void)
+{
+ return pyc_tag;
+}
+
/* Magic for extension modules (built-in as well as dynamically
loaded). To prevent initializing an extension module more than
once, we keep a static dictionary 'extensions' keyed by module name
(for built-in modules) or by filename (for dynamically loaded
modules), containing these modules. A copy of the module's
- dictionary is stored by calling _PyImport_FixupExtension()
+ dictionary is stored by calling _PyImport_FixupExtensionUnicode()
immediately after the module initialization function succeeds. A
copy can be retrieved from there by calling
- _PyImport_FindExtension().
+ _PyImport_FindExtensionUnicode().
- Modules which do support multiple multiple initialization set
- their m_size field to a non-negative number (indicating the size
- of the module-specific state). They are still recorded in the
- extensions dictionary, to avoid loading shared libraries twice.
+ Modules which do support multiple initialization set their m_size
+ field to a non-negative number (indicating the size of the
+ module-specific state). They are still recorded in the extensions
+ dictionary, to avoid loading shared libraries twice.
*/
int
-_PyImport_FixupExtension(PyObject *mod, char *name, char *filename)
+_PyImport_FixupExtensionUnicode(PyObject *mod, char *name, PyObject *filename)
{
PyObject *modules, *dict;
struct PyModuleDef *def;
@@ -586,18 +618,31 @@ _PyImport_FixupExtension(PyObject *mod, char *name, char *filename)
if (def->m_base.m_copy == NULL)
return -1;
}
- PyDict_SetItemString(extensions, filename, (PyObject*)def);
+ PyDict_SetItem(extensions, filename, (PyObject*)def);
return 0;
}
+int
+_PyImport_FixupBuiltin(PyObject *mod, char *name)
+{
+ int res;
+ PyObject *filename;
+ filename = PyUnicode_FromString(name);
+ if (filename == NULL)
+ return -1;
+ res = _PyImport_FixupExtensionUnicode(mod, name, filename);
+ Py_DECREF(filename);
+ return res;
+}
+
PyObject *
-_PyImport_FindExtension(char *name, char *filename)
+_PyImport_FindExtensionUnicode(char *name, PyObject *filename)
{
PyObject *mod, *mdict;
PyModuleDef* def;
if (extensions == NULL)
return NULL;
- def = (PyModuleDef*)PyDict_GetItemString(extensions, filename);
+ def = (PyModuleDef*)PyDict_GetItem(extensions, filename);
if (def == NULL)
return NULL;
if (def->m_size == -1) {
@@ -628,12 +673,23 @@ _PyImport_FindExtension(char *name, char *filename)
return NULL;
}
if (Py_VerboseFlag)
- PySys_WriteStderr("import %s # previously loaded (%s)\n",
+ PySys_FormatStderr("import %s # previously loaded (%U)\n",
name, filename);
return mod;
}
+PyObject *
+_PyImport_FindBuiltin(char *name)
+{
+ PyObject *res, *filename;
+ filename = PyUnicode_FromString(name);
+ if (filename == NULL)
+ return NULL;
+ res = _PyImport_FindExtensionUnicode(name, filename);
+ Py_DECREF(filename);
+ return res;
+}
/* Get the module object corresponding to a module name.
First check the modules dictionary if there's one there,
@@ -664,7 +720,7 @@ PyImport_AddModule(const char *name)
/* Remove name from sys.modules, if it's there. */
static void
-_RemoveModule(const char *name)
+remove_module(const char *name)
{
PyObject *modules = PyImport_GetModuleDict();
if (PyDict_GetItemString(modules, name) == NULL)
@@ -674,7 +730,10 @@ _RemoveModule(const char *name)
"sys.modules failed");
}
-static PyObject * get_sourcefile(const char *file);
+static PyObject * get_sourcefile(char *file);
+static char *make_source_pathname(char *pathname, char *buf);
+static char *make_compiled_pathname(char *pathname, char *buf, size_t buflen,
+ int debug);
/* Execute a code object in a module and return the module object
* WITH INCREMENTED REFERENCE COUNT. If an error occurs, name is
@@ -682,16 +741,28 @@ static PyObject * get_sourcefile(const char *file);
* in sys.modules. The caller may wish to restore the original
* module object (if any) in this case; PyImport_ReloadModule is an
* example.
+ *
+ * Note that PyImport_ExecCodeModuleWithPathnames() is the preferred, richer
+ * interface. The other two exist primarily for backward compatibility.
*/
PyObject *
PyImport_ExecCodeModule(char *name, PyObject *co)
{
- return PyImport_ExecCodeModuleEx(name, co, (char *)NULL);
+ return PyImport_ExecCodeModuleWithPathnames(
+ name, co, (char *)NULL, (char *)NULL);
}
PyObject *
PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
{
+ return PyImport_ExecCodeModuleWithPathnames(
+ name, co, pathname, (char *)NULL);
+}
+
+PyObject *
+PyImport_ExecCodeModuleWithPathnames(char *name, PyObject *co, char *pathname,
+ char *cpathname)
+{
PyObject *modules = PyImport_GetModuleDict();
PyObject *m, *d, *v;
@@ -721,7 +792,21 @@ PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
PyErr_Clear(); /* Not important enough to report */
Py_DECREF(v);
- v = PyEval_EvalCode((PyCodeObject *)co, d, d);
+ /* Remember the pyc path name as the __cached__ attribute. */
+ if (cpathname == NULL) {
+ v = Py_None;
+ Py_INCREF(v);
+ }
+ else if ((v = PyUnicode_FromString(cpathname)) == NULL) {
+ PyErr_Clear(); /* Not important enough to report */
+ v = Py_None;
+ Py_INCREF(v);
+ }
+ if (PyDict_SetItemString(d, "__cached__", v) != 0)
+ PyErr_Clear(); /* Not important enough to report */
+ Py_DECREF(v);
+
+ v = PyEval_EvalCode(co, d, d);
if (v == NULL)
goto error;
Py_DECREF(v);
@@ -738,37 +823,194 @@ PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
return m;
error:
- _RemoveModule(name);
+ remove_module(name);
return NULL;
}
+/* Like strrchr(string, '/') but searches for the rightmost of either SEP
+ or ALTSEP, if the latter is defined.
+*/
+static char *
+rightmost_sep(char *s)
+{
+ char *found, c;
+ for (found = NULL; (c = *s); s++) {
+ if (c == SEP
+#ifdef ALTSEP
+ || c == ALTSEP
+#endif
+ )
+ {
+ found = s;
+ }
+ }
+ return found;
+}
+
+
/* Given a pathname for a Python source file, fill a buffer with the
pathname for the corresponding compiled file. Return the pathname
for the compiled file, or NULL if there's no space in the buffer.
Doesn't set an exception. */
static char *
-make_compiled_pathname(char *pathname, char *buf, size_t buflen)
+make_compiled_pathname(char *pathname, char *buf, size_t buflen, int debug)
{
+ /* foo.py -> __pycache__/foo.<tag>.pyc */
size_t len = strlen(pathname);
- if (len+2 > buflen)
+ size_t i, save;
+ char *pos;
+ int sep = SEP;
+
+ /* Sanity check that the buffer has roughly enough space to hold what
+ will eventually be the full path to the compiled file. The 5 extra
+ bytes include the slash afer __pycache__, the two extra dots, the
+ extra trailing character ('c' or 'o') and null. This isn't exact
+ because the contents of the buffer can affect how many actual
+ characters of the string get into the buffer. We'll do a final
+ sanity check before writing the extension to ensure we do not
+ overflow the buffer.
+ */
+ if (len + strlen(CACHEDIR) + strlen(pyc_tag) + 5 > buflen)
return NULL;
-#ifdef MS_WINDOWS
- /* Treat .pyw as if it were .py. The case of ".pyw" must match
- that used in _PyImport_StandardFiletab. */
- if (len >= 4 && strcmp(&pathname[len-4], ".pyw") == 0)
- --len; /* pretend 'w' isn't there */
+ /* Find the last path separator and copy everything from the start of
+ the source string up to and including the separator.
+ */
+ if ((pos = rightmost_sep(pathname)) == NULL) {
+ i = 0;
+ }
+ else {
+ sep = *pos;
+ i = pos - pathname + 1;
+ strncpy(buf, pathname, i);
+ }
+
+ save = i;
+ buf[i++] = '\0';
+ /* Add __pycache__/ */
+ strcat(buf, CACHEDIR);
+ i += strlen(CACHEDIR) - 1;
+ buf[i++] = sep;
+ buf[i++] = '\0';
+ /* Add the base filename, but remove the .py or .pyw extension, since
+ the tag name must go before the extension.
+ */
+ strcat(buf, pathname + save);
+ if ((pos = strrchr(buf, '.')) != NULL)
+ *++pos = '\0';
+ strcat(buf, pyc_tag);
+ /* The length test above assumes that we're only adding one character
+ to the end of what would normally be the extension. What if there
+ is no extension, or the string ends in '.' or '.p', and otherwise
+ fills the buffer? By appending 4 more characters onto the string
+ here, we could overrun the buffer.
+
+ As a simple example, let's say buflen=32 and the input string is
+ 'xxx.py'. strlen() would be 6 and the test above would yield:
+
+ (6 + 11 + 10 + 5 == 32) > 32
+
+ which is false and so the name mangling would continue. This would
+ be fine because we'd end up with this string in buf:
+
+ __pycache__/xxx.cpython-32.pyc\0
+
+ strlen(of that) == 30 + the nul fits inside a 32 character buffer.
+ We can even handle an input string of say 'xxxxx' above because
+ that's (5 + 11 + 10 + 5 == 31) > 32 which is also false. Name
+ mangling that yields:
+
+ __pycache__/xxxxxcpython-32.pyc\0
+
+ which is 32 characters including the nul, and thus fits in the
+ buffer. However, an input string of 'xxxxxx' would yield a result
+ string of:
+
+ __pycache__/xxxxxxcpython-32.pyc\0
+
+ which is 33 characters long (including the nul), thus overflowing
+ the buffer, even though the first test would fail, i.e.: the input
+ string is also 6 characters long, so 32 > 32 is false.
+
+ The reason the first test fails but we still overflow the buffer is
+ that the test above only expects to add one extra character to be
+ added to the extension, and here we're adding three (pyc). We
+ don't add the first dot, so that reclaims one of expected
+ positions, leaving us overflowing by 1 byte (3 extra - 1 reclaimed
+ dot - 1 expected extra == 1 overflowed).
+
+ The best we can do is ensure that we still have enough room in the
+ target buffer before we write the extension. Because it's always
+ only the extension that can cause the overflow, and never the other
+ path bytes we've written, it's sufficient to just do one more test
+ here. Still, the assertion that follows can't hurt.
+ */
+#if 0
+ printf("strlen(buf): %d; buflen: %d\n", (int)strlen(buf), (int)buflen);
#endif
- memcpy(buf, pathname, len);
- buf[len] = Py_OptimizeFlag ? 'o' : 'c';
- buf[len+1] = '\0';
-
+ if (strlen(buf) + 5 > buflen)
+ return NULL;
+ strcat(buf, debug ? ".pyc" : ".pyo");
+ assert(strlen(buf) < buflen);
return buf;
}
+/* Given a pathname to a Python byte compiled file, return the path to the
+ source file, if the path matches the PEP 3147 format. This does not check
+ for any file existence, however, if the pyc file name does not match PEP
+ 3147 style, NULL is returned. buf must be at least as big as pathname;
+ the resulting path will always be shorter. */
+
+static char *
+make_source_pathname(char *pathname, char *buf)
+{
+ /* __pycache__/foo.<tag>.pyc -> foo.py */
+ size_t i, j;
+ char *left, *right, *dot0, *dot1, sep;
+
+ /* Look back two slashes from the end. In between these two slashes
+ must be the string __pycache__ or this is not a PEP 3147 style
+ path. It's possible for there to be only one slash.
+ */
+ if ((right = rightmost_sep(pathname)) == NULL)
+ return NULL;
+ sep = *right;
+ *right = '\0';
+ left = rightmost_sep(pathname);
+ *right = sep;
+ if (left == NULL)
+ left = pathname;
+ else
+ left++;
+ if (right-left != strlen(CACHEDIR) ||
+ strncmp(left, CACHEDIR, right-left) != 0)
+ return NULL;
+
+ /* Now verify that the path component to the right of the last slash
+ has two dots in it.
+ */
+ if ((dot0 = strchr(right + 1, '.')) == NULL)
+ return NULL;
+ if ((dot1 = strchr(dot0 + 1, '.')) == NULL)
+ return NULL;
+ /* Too many dots? */
+ if (strchr(dot1 + 1, '.') != NULL)
+ return NULL;
+
+ /* This is a PEP 3147 path. Start by copying everything from the
+ start of pathname up to and including the leftmost slash. Then
+ copy the file's basename, removing the magic tag and adding a .py
+ suffix.
+ */
+ strncpy(buf, pathname, (i=left-pathname));
+ strncpy(buf+i, right+1, (j=dot0-right));
+ strcpy(buf+i+j, "py");
+ return buf;
+}
+
/* Given a pathname for a Python source file, its time of last
modification, and a pathname for a compiled file, check whether the
compiled file represents the same version of the source. If so,
@@ -849,7 +1091,8 @@ load_compiled_module(char *name, char *cpathname, FILE *fp)
if (Py_VerboseFlag)
PySys_WriteStderr("import %s # precompiled from %s\n",
name, cpathname);
- m = PyImport_ExecCodeModuleEx(name, (PyObject *)co, cpathname);
+ m = PyImport_ExecCodeModuleWithPathnames(
+ name, (PyObject *)co, cpathname, cpathname);
Py_DECREF(co);
return m;
@@ -922,12 +1165,42 @@ static void
write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
{
FILE *fp;
+ char *dirpath;
time_t mtime = srcstat->st_mtime;
#ifdef MS_WINDOWS /* since Windows uses different permissions */
mode_t mode = srcstat->st_mode & ~S_IEXEC;
#else
mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
+ mode_t dirmode = (srcstat->st_mode |
+ S_IXUSR | S_IXGRP | S_IXOTH |
+ S_IWUSR | S_IWGRP | S_IWOTH);
+#endif
+ int saved;
+
+ /* Ensure that the __pycache__ directory exists. */
+ dirpath = rightmost_sep(cpathname);
+ if (dirpath == NULL) {
+ if (Py_VerboseFlag)
+ PySys_WriteStderr(
+ "# no %s path found %s\n",
+ CACHEDIR, cpathname);
+ return;
+ }
+ saved = *dirpath;
+ *dirpath = '\0';
+
+#ifdef MS_WINDOWS
+ if (_mkdir(cpathname) < 0 && errno != EEXIST) {
+#else
+ if (mkdir(cpathname, dirmode) < 0 && errno != EEXIST) {
#endif
+ *dirpath = saved;
+ if (Py_VerboseFlag)
+ PySys_WriteStderr(
+ "# cannot create cache dir %s\n", cpathname);
+ return;
+ }
+ *dirpath = saved;
fp = open_exclusive(cpathname, mode);
if (fp == NULL) {
@@ -1035,8 +1308,8 @@ load_source_module(char *name, char *pathname, FILE *fp)
return NULL;
}
#endif
- cpathname = make_compiled_pathname(pathname, buf,
- (size_t)MAXPATHLEN + 1);
+ cpathname = make_compiled_pathname(
+ pathname, buf, (size_t)MAXPATHLEN + 1, !Py_OptimizeFlag);
if (cpathname != NULL &&
(fpc = check_compiled_module(pathname, st.st_mtime, cpathname))) {
co = read_compiled_module(cpathname, fpc);
@@ -1063,7 +1336,8 @@ load_source_module(char *name, char *pathname, FILE *fp)
write_compiled_module(co, cpathname, &st);
}
}
- m = PyImport_ExecCodeModuleEx(name, (PyObject *)co, pathname);
+ m = PyImport_ExecCodeModuleWithPathnames(
+ name, (PyObject *)co, pathname, cpathname);
Py_DECREF(co);
return m;
@@ -1073,7 +1347,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
* Returns the path to the py file if available, else the given path
*/
static PyObject *
-get_sourcefile(const char *file)
+get_sourcefile(char *file)
{
char py[MAXPATHLEN + 1];
Py_ssize_t len;
@@ -1090,8 +1364,15 @@ get_sourcefile(const char *file)
return PyUnicode_DecodeFSDefault(file);
}
- strncpy(py, file, len-1);
- py[len-1] = '\0';
+ /* Start by trying to turn PEP 3147 path into source path. If that
+ * fails, just chop off the trailing character, i.e. legacy pyc path
+ * to py.
+ */
+ if (make_source_pathname(file, py) == NULL) {
+ strncpy(py, file, len-1);
+ py[len-1] = '\0';
+ }
+
if (stat(py, &statbuf) == 0 &&
S_ISREG(statbuf.st_mode)) {
u = PyUnicode_DecodeFSDefault(py);
@@ -1390,8 +1671,7 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
if (!v)
return NULL;
if (PyUnicode_Check(v)) {
- v = PyUnicode_AsEncodedString(v,
- Py_FileSystemDefaultEncoding, NULL);
+ v = PyUnicode_EncodeFSDefault(v);
if (v == NULL)
return NULL;
}
@@ -1461,14 +1741,16 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
return &fd_package;
}
else {
- char warnstr[MAXPATHLEN+80];
- sprintf(warnstr, "Not importing directory "
- "'%.*s': missing __init__.py",
- MAXPATHLEN, buf);
- if (PyErr_WarnEx(PyExc_ImportWarning,
- warnstr, 1)) {
+ int err;
+ PyObject *unicode = PyUnicode_DecodeFSDefault(buf);
+ if (unicode == NULL)
+ return NULL;
+ err = PyErr_WarnFormat(PyExc_ImportWarning, 1,
+ "Not importing directory '%U': missing __init__.py",
+ unicode);
+ Py_DECREF(unicode);
+ if (err)
return NULL;
- }
}
}
#endif
@@ -1548,22 +1830,6 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
return fdp;
}
-/* Helpers for main.c
- * Find the source file corresponding to a named module
- */
-struct filedescr *
-_PyImport_FindModule(const char *name, PyObject *path, char *buf,
- size_t buflen, FILE **p_fp, PyObject **p_loader)
-{
- return find_module((char *) name, (char *) name, path,
- buf, buflen, p_fp, p_loader);
-}
-
-PyAPI_FUNC(int) _PyImport_IsScript(struct filedescr * fd)
-{
- return fd->type == PY_SOURCE || fd->type == PY_COMPILED;
-}
-
/* case_ok(char* buf, Py_ssize_t len, Py_ssize_t namelen, char* name)
* The arguments here are tricky, best shown by example:
* /a/b/c/d/e/f/g/h/i/j/k/some_long_module_name.py\0
@@ -1718,8 +1984,8 @@ case_ok(char *buf, Py_ssize_t len, Py_ssize_t namelen, char *name)
#endif
}
-
#ifdef HAVE_STAT
+
/* Helper to look for __init__.py or __init__.py[co] in potential package */
static int
find_init_module(char *buf)
@@ -1771,15 +2037,52 @@ find_init_module(char *buf)
static int init_builtin(char *); /* Forward */
+static PyObject*
+load_builtin(char *name, char *pathname, int type)
+{
+ PyObject *m, *modules;
+ int err;
+
+ if (pathname != NULL && pathname[0] != '\0')
+ name = pathname;
+
+ if (type == C_BUILTIN)
+ err = init_builtin(name);
+ else
+ err = PyImport_ImportFrozenModule(name);
+ if (err < 0)
+ return NULL;
+ if (err == 0) {
+ PyErr_Format(PyExc_ImportError,
+ "Purported %s module %.200s not found",
+ type == C_BUILTIN ?
+ "builtin" : "frozen",
+ name);
+ return NULL;
+ }
+
+ modules = PyImport_GetModuleDict();
+ m = PyDict_GetItemString(modules, name);
+ if (m == NULL) {
+ PyErr_Format(
+ PyExc_ImportError,
+ "%s module %.200s not properly initialized",
+ type == C_BUILTIN ?
+ "builtin" : "frozen",
+ name);
+ return NULL;
+ }
+ Py_INCREF(m);
+ return m;
+}
+
/* Load an external module using the default search path and return
its module object WITH INCREMENTED REFERENCE COUNT */
static PyObject *
load_module(char *name, FILE *fp, char *pathname, int type, PyObject *loader)
{
- PyObject *modules;
PyObject *m;
- int err;
/* First check that there's an open file (if we need one) */
switch (type) {
@@ -1815,34 +2118,7 @@ load_module(char *name, FILE *fp, char *pathname, int type, PyObject *loader)
case C_BUILTIN:
case PY_FROZEN:
- if (pathname != NULL && pathname[0] != '\0')
- name = pathname;
- if (type == C_BUILTIN)
- err = init_builtin(name);
- else
- err = PyImport_ImportFrozenModule(name);
- if (err < 0)
- return NULL;
- if (err == 0) {
- PyErr_Format(PyExc_ImportError,
- "Purported %s module %.200s not found",
- type == C_BUILTIN ?
- "builtin" : "frozen",
- name);
- return NULL;
- }
- modules = PyImport_GetModuleDict();
- m = PyDict_GetItemString(modules, name);
- if (m == NULL) {
- PyErr_Format(
- PyExc_ImportError,
- "%s module %.200s not properly initialized",
- type == C_BUILTIN ?
- "builtin" : "frozen",
- name);
- return NULL;
- }
- Py_INCREF(m);
+ m = load_builtin(name, pathname, type);
break;
case IMP_HOOK: {
@@ -1876,7 +2152,7 @@ init_builtin(char *name)
{
struct _inittab *p;
- if (_PyImport_FindExtension(name, name) != NULL)
+ if (_PyImport_FindBuiltin(name) != NULL)
return 1;
for (p = PyImport_Inittab; p->name != NULL; p++) {
@@ -1893,7 +2169,7 @@ init_builtin(char *name)
mod = (*p->initfunc)();
if (mod == 0)
return -1;
- if (_PyImport_FixupExtension(mod, name, name) < 0)
+ if (_PyImport_FixupBuiltin(mod, name) < 0)
return -1;
/* FixupExtension has put the module into sys.modules,
so we can release our own reference. */
@@ -2510,14 +2786,7 @@ ensure_fromlist(PyObject *mod, PyObject *fromlist, char *buf, Py_ssize_t buflen,
char *subname;
PyObject *submod;
char *p;
- if (!Py_FileSystemDefaultEncoding) {
- item8 = PyUnicode_EncodeASCII(PyUnicode_AsUnicode(item),
- PyUnicode_GetSize(item),
- NULL);
- } else {
- item8 = PyUnicode_AsEncodedString(item,
- Py_FileSystemDefaultEncoding, NULL);
- }
+ item8 = PyUnicode_EncodeFSDefault(item);
if (!item8) {
PyErr_SetString(PyExc_ValueError, "Cannot encode path item");
return 0;
@@ -2739,7 +3008,7 @@ PyImport_ReloadModule(PyObject *m)
more accurately -- it invokes the __import__() function from the
builtins of the current globals. This means that the import is
done using whatever import hooks are installed in the current
- environment, e.g. by "rexec".
+ environment.
A dummy list ["__doc__"] is passed as the 4th argument so that
e.g. PyImport_Import(PyUnicode_FromString("win32com.client.gencache"))
will return <module "gencache"> instead of <module "win32com">. */
@@ -2753,6 +3022,7 @@ PyImport_Import(PyObject *module_name)
PyObject *globals = NULL;
PyObject *import = NULL;
PyObject *builtins = NULL;
+ PyObject *modules = NULL;
PyObject *r = NULL;
/* Initialize constant string objects */
@@ -2763,7 +3033,7 @@ PyImport_Import(PyObject *module_name)
builtins_str = PyUnicode_InternFromString("__builtins__");
if (builtins_str == NULL)
return NULL;
- silly_list = Py_BuildValue("[s]", "__doc__");
+ silly_list = PyList_New(0);
if (silly_list == NULL)
return NULL;
}
@@ -2799,9 +3069,18 @@ PyImport_Import(PyObject *module_name)
goto err;
/* Call the __import__ function with the proper argument list
- * Always use absolute import here. */
+ Always use absolute import here.
+ Calling for side-effect of import. */
r = PyObject_CallFunction(import, "OOOOi", module_name, globals,
globals, silly_list, 0, NULL);
+ if (r == NULL)
+ goto err;
+ Py_DECREF(r);
+
+ modules = PyImport_GetModuleDict();
+ r = PyDict_GetItem(modules, module_name);
+ if (r != NULL)
+ Py_INCREF(r);
err:
Py_XDECREF(globals);
@@ -2817,19 +3096,31 @@ PyImport_Import(PyObject *module_name)
*/
static PyObject *
-imp_get_magic(PyObject *self, PyObject *noargs)
+imp_make_magic(long magic)
{
char buf[4];
- buf[0] = (char) ((pyc_magic >> 0) & 0xff);
- buf[1] = (char) ((pyc_magic >> 8) & 0xff);
- buf[2] = (char) ((pyc_magic >> 16) & 0xff);
- buf[3] = (char) ((pyc_magic >> 24) & 0xff);
+ buf[0] = (char) ((magic >> 0) & 0xff);
+ buf[1] = (char) ((magic >> 8) & 0xff);
+ buf[2] = (char) ((magic >> 16) & 0xff);
+ buf[3] = (char) ((magic >> 24) & 0xff);
return PyBytes_FromStringAndSize(buf, 4);
}
static PyObject *
+imp_get_magic(PyObject *self, PyObject *noargs)
+{
+ return imp_make_magic(pyc_magic);
+}
+
+static PyObject *
+imp_get_tag(PyObject *self, PyObject *noargs)
+{
+ return PyUnicode_FromString(pyc_tag);
+}
+
+static PyObject *
imp_get_suffixes(PyObject *self, PyObject *noargs)
{
PyObject *list;
@@ -2915,14 +3206,14 @@ call_find_module(char *name, PyObject *path)
static PyObject *
imp_find_module(PyObject *self, PyObject *args)
{
- char *name;
+ PyObject *name;
PyObject *ret, *path = NULL;
- if (!PyArg_ParseTuple(args, "es|O:find_module",
- Py_FileSystemDefaultEncoding, &name,
+ if (!PyArg_ParseTuple(args, "O&|O:find_module",
+ PyUnicode_FSConverter, &name,
&path))
return NULL;
- ret = call_find_module(name, path);
- PyMem_Free(name);
+ ret = call_find_module(PyBytes_AS_STRING(name), path);
+ Py_DECREF(name);
return ret;
}
@@ -3040,23 +3331,23 @@ static PyObject *
imp_load_compiled(PyObject *self, PyObject *args)
{
char *name;
- char *pathname;
+ PyObject *pathname;
PyObject *fob = NULL;
PyObject *m;
FILE *fp;
- if (!PyArg_ParseTuple(args, "ses|O:load_compiled",
+ if (!PyArg_ParseTuple(args, "sO&|O:load_compiled",
&name,
- Py_FileSystemDefaultEncoding, &pathname,
+ PyUnicode_FSConverter, &pathname,
&fob))
return NULL;
- fp = get_file(pathname, fob, "rb");
+ fp = get_file(PyBytes_AS_STRING(pathname), fob, "rb");
if (fp == NULL) {
- PyMem_Free(pathname);
+ Py_DECREF(pathname);
return NULL;
}
- m = load_compiled_module(name, pathname, fp);
+ m = load_compiled_module(name, PyBytes_AS_STRING(pathname), fp);
fclose(fp);
- PyMem_Free(pathname);
+ Py_DECREF(pathname);
return m;
}
@@ -3066,24 +3357,24 @@ static PyObject *
imp_load_dynamic(PyObject *self, PyObject *args)
{
char *name;
+ PyObject *pathbytes;
char *pathname;
PyObject *fob = NULL;
PyObject *m;
FILE *fp = NULL;
- if (!PyArg_ParseTuple(args, "ses|O:load_dynamic",
- &name,
- Py_FileSystemDefaultEncoding, &pathname,
- &fob))
+ if (!PyArg_ParseTuple(args, "sO&|O:load_dynamic",
+ &name, PyUnicode_FSConverter, &pathbytes, &fob))
return NULL;
+ pathname = PyBytes_AS_STRING(pathbytes);
if (fob) {
fp = get_file(pathname, fob, "r");
if (fp == NULL) {
- PyMem_Free(pathname);
+ Py_DECREF(pathbytes);
return NULL;
}
}
m = _PyImport_LoadDynamicModule(name, pathname, fp);
- PyMem_Free(pathname);
+ Py_DECREF(pathbytes);
if (fp)
fclose(fp);
return m;
@@ -3095,22 +3386,22 @@ static PyObject *
imp_load_source(PyObject *self, PyObject *args)
{
char *name;
- char *pathname;
+ PyObject *pathname;
PyObject *fob = NULL;
PyObject *m;
FILE *fp;
- if (!PyArg_ParseTuple(args, "ses|O:load_source",
+ if (!PyArg_ParseTuple(args, "sO&|O:load_source",
&name,
- Py_FileSystemDefaultEncoding, &pathname,
+ PyUnicode_FSConverter, &pathname,
&fob))
return NULL;
- fp = get_file(pathname, fob, "r");
+ fp = get_file(PyBytes_AS_STRING(pathname), fob, "r");
if (fp == NULL) {
- PyMem_Free(pathname);
+ Py_DECREF(pathname);
return NULL;
}
- m = load_source_module(name, pathname, fp);
- PyMem_Free(pathname);
+ m = load_source_module(name, PyBytes_AS_STRING(pathname), fp);
+ Py_DECREF(pathname);
fclose(fp);
return m;
}
@@ -3120,16 +3411,16 @@ imp_load_module(PyObject *self, PyObject *args)
{
char *name;
PyObject *fob;
- char *pathname;
+ PyObject *pathname;
PyObject * ret;
char *suffix; /* Unused */
char *mode;
int type;
FILE *fp;
- if (!PyArg_ParseTuple(args, "sOes(ssi):load_module",
+ if (!PyArg_ParseTuple(args, "sOO&(ssi):load_module",
&name, &fob,
- Py_FileSystemDefaultEncoding, &pathname,
+ PyUnicode_FSConverter, &pathname,
&suffix, &mode, &type))
return NULL;
if (*mode) {
@@ -3140,7 +3431,7 @@ imp_load_module(PyObject *self, PyObject *args)
if (!(*mode == 'r' || *mode == 'U') || strchr(mode, '+')) {
PyErr_Format(PyExc_ValueError,
"invalid file open mode %.200s", mode);
- PyMem_Free(pathname);
+ Py_DECREF(pathname);
return NULL;
}
}
@@ -3149,12 +3440,12 @@ imp_load_module(PyObject *self, PyObject *args)
else {
fp = get_file(NULL, fob, mode);
if (fp == NULL) {
- PyMem_Free(pathname);
+ Py_DECREF(pathname);
return NULL;
}
}
- ret = load_module(name, fp, pathname, type, NULL);
- PyMem_Free(pathname);
+ ret = load_module(name, fp, PyBytes_AS_STRING(pathname), type, NULL);
+ Py_DECREF(pathname);
if (fp)
fclose(fp);
return ret;
@@ -3164,13 +3455,13 @@ static PyObject *
imp_load_package(PyObject *self, PyObject *args)
{
char *name;
- char *pathname;
+ PyObject *pathname;
PyObject * ret;
- if (!PyArg_ParseTuple(args, "ses:load_package",
- &name, Py_FileSystemDefaultEncoding, &pathname))
+ if (!PyArg_ParseTuple(args, "sO&:load_package",
+ &name, PyUnicode_FSConverter, &pathname))
return NULL;
- ret = load_package(name, pathname);
- PyMem_Free(pathname);
+ ret = load_package(name, PyBytes_AS_STRING(pathname));
+ Py_DECREF(pathname);
return ret;
}
@@ -3194,6 +3485,82 @@ PyDoc_STRVAR(doc_reload,
\n\
Reload the module. The module must have been successfully imported before.");
+static PyObject *
+imp_cache_from_source(PyObject *self, PyObject *args, PyObject *kws)
+{
+ static char *kwlist[] = {"path", "debug_override", NULL};
+
+ char buf[MAXPATHLEN+1];
+ PyObject *pathbytes;
+ char *cpathname;
+ PyObject *debug_override = NULL;
+ int debug = !Py_OptimizeFlag;
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kws, "O&|O", kwlist,
+ PyUnicode_FSConverter, &pathbytes, &debug_override))
+ return NULL;
+
+ if (debug_override != NULL &&
+ (debug = PyObject_IsTrue(debug_override)) < 0) {
+ Py_DECREF(pathbytes);
+ return NULL;
+ }
+
+ cpathname = make_compiled_pathname(
+ PyBytes_AS_STRING(pathbytes),
+ buf, MAXPATHLEN+1, debug);
+ Py_DECREF(pathbytes);
+
+ if (cpathname == NULL) {
+ PyErr_Format(PyExc_SystemError, "path buffer too short");
+ return NULL;
+ }
+ return PyUnicode_DecodeFSDefault(buf);
+}
+
+PyDoc_STRVAR(doc_cache_from_source,
+"Given the path to a .py file, return the path to its .pyc/.pyo file.\n\
+\n\
+The .py file does not need to exist; this simply returns the path to the\n\
+.pyc/.pyo file calculated as if the .py file were imported. The extension\n\
+will be .pyc unless __debug__ is not defined, then it will be .pyo.\n\
+\n\
+If debug_override is not None, then it must be a boolean and is taken as\n\
+the value of __debug__ instead.");
+
+static PyObject *
+imp_source_from_cache(PyObject *self, PyObject *args, PyObject *kws)
+{
+ static char *kwlist[] = {"path", NULL};
+
+ PyObject *pathname_obj;
+ char *pathname;
+ char buf[MAXPATHLEN+1];
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kws, "O&", kwlist,
+ PyUnicode_FSConverter, &pathname_obj))
+ return NULL;
+
+ pathname = PyBytes_AS_STRING(pathname_obj);
+ if (make_source_pathname(pathname, buf) == NULL) {
+ PyErr_Format(PyExc_ValueError, "Not a PEP 3147 pyc path: %s",
+ pathname);
+ Py_DECREF(pathname_obj);
+ return NULL;
+ }
+ Py_DECREF(pathname_obj);
+ return PyUnicode_FromString(buf);
+}
+
+PyDoc_STRVAR(doc_source_from_cache,
+"Given the path to a .pyc./.pyo file, return the path to its .py file.\n\
+\n\
+The .pyc/.pyo file does not need to exist; this simply returns the path to\n\
+the .py file calculated to correspond to the .pyc/.pyo file. If path\n\
+does not conform to PEP 3147 format, ValueError will be raised.");
+
/* Doc strings */
PyDoc_STRVAR(doc_imp,
@@ -3216,6 +3583,10 @@ PyDoc_STRVAR(doc_get_magic,
"get_magic() -> string\n\
Return the magic number for .pyc or .pyo files.");
+PyDoc_STRVAR(doc_get_tag,
+"get_tag() -> string\n\
+Return the magic tag for .pyc or .pyo files.");
+
PyDoc_STRVAR(doc_get_suffixes,
"get_suffixes() -> [(suffix, mode, type), ...]\n\
Return a list of (suffix, mode, type) tuples describing the files\n\
@@ -3246,6 +3617,7 @@ On platforms without threads, this function does nothing.");
static PyMethodDef imp_methods[] = {
{"find_module", imp_find_module, METH_VARARGS, doc_find_module},
{"get_magic", imp_get_magic, METH_NOARGS, doc_get_magic},
+ {"get_tag", imp_get_tag, METH_NOARGS, doc_get_tag},
{"get_suffixes", imp_get_suffixes, METH_NOARGS, doc_get_suffixes},
{"load_module", imp_load_module, METH_VARARGS, doc_load_module},
{"new_module", imp_new_module, METH_VARARGS, doc_new_module},
@@ -3253,6 +3625,10 @@ static PyMethodDef imp_methods[] = {
{"acquire_lock", imp_acquire_lock, METH_NOARGS, doc_acquire_lock},
{"release_lock", imp_release_lock, METH_NOARGS, doc_release_lock},
{"reload", imp_reload, METH_O, doc_reload},
+ {"cache_from_source", (PyCFunction)imp_cache_from_source,
+ METH_VARARGS | METH_KEYWORDS, doc_cache_from_source},
+ {"source_from_cache", (PyCFunction)imp_source_from_cache,
+ METH_VARARGS | METH_KEYWORDS, doc_source_from_cache},
/* The rest are obsolete */
{"get_frozen_object", imp_get_frozen_object, METH_VARARGS},
{"is_frozen_package", imp_is_frozen_package, METH_VARARGS},
@@ -3288,56 +3664,69 @@ typedef struct {
static int
NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
{
- char *path;
- Py_ssize_t pathlen;
+#ifndef MS_WINDOWS
+ PyObject *path;
+ struct stat statbuf;
+ int rv;
if (!_PyArg_NoKeywords("NullImporter()", kwds))
return -1;
- if (!PyArg_ParseTuple(args, "es:NullImporter",
- Py_FileSystemDefaultEncoding, &path))
+ if (!PyArg_ParseTuple(args, "O&:NullImporter",
+ PyUnicode_FSConverter, &path))
return -1;
- pathlen = strlen(path);
- if (pathlen == 0) {
- PyMem_Free(path);
+ if (PyBytes_GET_SIZE(path) == 0) {
+ Py_DECREF(path);
PyErr_SetString(PyExc_ImportError, "empty pathname");
return -1;
- } else {
-#ifndef MS_WINDOWS
- struct stat statbuf;
- int rv;
-
- rv = stat(path, &statbuf);
- PyMem_Free(path);
- if (rv == 0) {
- /* it exists */
- if (S_ISDIR(statbuf.st_mode)) {
- /* it's a directory */
- PyErr_SetString(PyExc_ImportError,
- "existing directory");
- return -1;
- }
+ }
+
+ rv = stat(PyBytes_AS_STRING(path), &statbuf);
+ Py_DECREF(path);
+ if (rv == 0) {
+ /* it exists */
+ if (S_ISDIR(statbuf.st_mode)) {
+ /* it's a directory */
+ PyErr_SetString(PyExc_ImportError, "existing directory");
+ return -1;
}
+ }
#else /* MS_WINDOWS */
- DWORD rv;
- /* see issue1293 and issue3677:
- * stat() on Windows doesn't recognise paths like
- * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs.
- */
- rv = GetFileAttributesA(path);
- PyMem_Free(path);
- if (rv != INVALID_FILE_ATTRIBUTES) {
- /* it exists */
- if (rv & FILE_ATTRIBUTE_DIRECTORY) {
- /* it's a directory */
- PyErr_SetString(PyExc_ImportError,
- "existing directory");
- return -1;
- }
+ PyObject *pathobj;
+ DWORD rv;
+ wchar_t *path;
+
+ if (!_PyArg_NoKeywords("NullImporter()", kwds))
+ return -1;
+
+ if (!PyArg_ParseTuple(args, "U:NullImporter",
+ &pathobj))
+ return -1;
+
+ if (PyUnicode_GET_SIZE(pathobj) == 0) {
+ PyErr_SetString(PyExc_ImportError, "empty pathname");
+ return -1;
+ }
+
+ path = PyUnicode_AsWideCharString(pathobj, NULL);
+ if (path == NULL)
+ return -1;
+ /* see issue1293 and issue3677:
+ * stat() on Windows doesn't recognise paths like
+ * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs.
+ */
+ rv = GetFileAttributesW(path);
+ PyMem_Free(path);
+ if (rv != INVALID_FILE_ATTRIBUTES) {
+ /* it exists */
+ if (rv & FILE_ATTRIBUTE_DIRECTORY) {
+ /* it's a directory */
+ PyErr_SetString(PyExc_ImportError, "existing directory");
+ return -1;
}
-#endif
}
+#endif
return 0;
}
@@ -3440,7 +3829,6 @@ PyInit_imp(void)
failure:
Py_XDECREF(m);
return NULL;
-
}
diff --git a/Python/importdl.c b/Python/importdl.c
index 507222b0c2..9caed453aa 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -27,10 +27,16 @@ _PyImport_LoadDynamicModule(char *name, char *pathname, FILE *fp)
dl_funcptr p0;
PyObject* (*p)(void);
struct PyModuleDef *def;
+ PyObject *result;
- if ((m = _PyImport_FindExtension(name, pathname)) != NULL) {
+ path = PyUnicode_DecodeFSDefault(pathname);
+ if (path == NULL)
+ return NULL;
+
+ if ((m = _PyImport_FindExtensionUnicode(name, path)) != NULL) {
Py_INCREF(m);
- return m;
+ result = m;
+ goto finally;
}
lastdot = strrchr(name, '.');
if (lastdot == NULL) {
@@ -45,26 +51,26 @@ _PyImport_LoadDynamicModule(char *name, char *pathname, FILE *fp)
p0 = _PyImport_GetDynLoadFunc(name, shortname, pathname, fp);
p = (PyObject*(*)(void))p0;
if (PyErr_Occurred())
- return NULL;
+ goto error;
if (p == NULL) {
PyErr_Format(PyExc_ImportError,
"dynamic module does not define init function (PyInit_%.200s)",
shortname);
- return NULL;
+ goto error;
}
oldcontext = _Py_PackageContext;
_Py_PackageContext = packagecontext;
m = (*p)();
_Py_PackageContext = oldcontext;
if (m == NULL)
- return NULL;
+ goto error;
if (PyErr_Occurred()) {
Py_DECREF(m);
PyErr_Format(PyExc_SystemError,
"initialization of %s raised unreported exception",
shortname);
- return NULL;
+ goto error;
}
/* Remember pointer to module init function. */
@@ -72,17 +78,25 @@ _PyImport_LoadDynamicModule(char *name, char *pathname, FILE *fp)
def->m_base.m_init = p;
/* Remember the filename as the __file__ attribute */
- path = PyUnicode_DecodeFSDefault(pathname);
if (PyModule_AddObject(m, "__file__", path) < 0)
PyErr_Clear(); /* Not important enough to report */
+ else
+ Py_INCREF(path);
- if (_PyImport_FixupExtension(m, name, pathname) < 0)
- return NULL;
+ if (_PyImport_FixupExtensionUnicode(m, name, path) < 0)
+ goto error;
if (Py_VerboseFlag)
PySys_WriteStderr(
"import %s # dynamically loaded from %s\n",
name, pathname);
- return m;
+ result = m;
+ goto finally;
+
+error:
+ result = NULL;
+finally:
+ Py_DECREF(path);
+ return result;
}
#endif /* HAVE_DYNAMIC_LOADING */
diff --git a/Python/marshal.c b/Python/marshal.c
index 21093eec45..73d4f374cd 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -254,7 +254,6 @@ w_object(PyObject *v, WFILE *p)
PyMem_Free(buf);
}
}
-#ifndef WITHOUT_COMPLEX
else if (PyComplex_CheckExact(v)) {
if (p->version > 1) {
unsigned char buf[8];
@@ -297,7 +296,6 @@ w_object(PyObject *v, WFILE *p)
PyMem_Free(buf);
}
}
-#endif
else if (PyBytes_CheckExact(v)) {
w_byte(TYPE_STRING, p);
n = PyBytes_GET_SIZE(v);
@@ -714,7 +712,6 @@ r_object(RFILE *p)
break;
}
-#ifndef WITHOUT_COMPLEX
case TYPE_COMPLEX:
{
char buf[256];
@@ -773,7 +770,6 @@ r_object(RFILE *p)
retval = PyComplex_FromCComplex(c);
break;
}
-#endif
case TYPE_STRING:
n = r_long(p);
@@ -1082,23 +1078,13 @@ getfilesize(FILE *fp)
PyObject *
PyMarshal_ReadLastObjectFromFile(FILE *fp)
{
-/* 75% of 2.1's .pyc files can exploit SMALL_FILE_LIMIT.
- * REASONABLE_FILE_LIMIT is by defn something big enough for Tkinter.pyc.
- */
-#define SMALL_FILE_LIMIT (1L << 14)
+/* REASONABLE_FILE_LIMIT is by defn something big enough for Tkinter.pyc. */
#define REASONABLE_FILE_LIMIT (1L << 18)
#ifdef HAVE_FSTAT
off_t filesize;
-#endif
-#ifdef HAVE_FSTAT
filesize = getfilesize(fp);
- if (filesize > 0) {
- char buf[SMALL_FILE_LIMIT];
- char* pBuf = NULL;
- if (filesize <= SMALL_FILE_LIMIT)
- pBuf = buf;
- else if (filesize <= REASONABLE_FILE_LIMIT)
- pBuf = (char *)PyMem_MALLOC(filesize);
+ if (filesize > 0 && filesize <= REASONABLE_FILE_LIMIT) {
+ char* pBuf = (char *)PyMem_MALLOC(filesize);
if (pBuf != NULL) {
PyObject* v;
size_t n;
@@ -1106,8 +1092,7 @@ PyMarshal_ReadLastObjectFromFile(FILE *fp)
is smaller than REASONABLE_FILE_LIMIT */
n = fread(pBuf, 1, (int)filesize, fp);
v = PyMarshal_ReadObjectFromString(pBuf, n);
- if (pBuf != buf)
- PyMem_FREE(pBuf);
+ PyMem_FREE(pBuf);
return v;
}
@@ -1118,7 +1103,6 @@ PyMarshal_ReadLastObjectFromFile(FILE *fp)
*/
return PyMarshal_ReadObjectFromFile(fp);
-#undef SMALL_FILE_LIMIT
#undef REASONABLE_FILE_LIMIT
}
diff --git a/Python/modsupport.c b/Python/modsupport.c
index f405bae9d2..85b0d66358 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -279,11 +279,9 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
return PyFloat_FromDouble(
(double)va_arg(*p_va, va_double));
-#ifndef WITHOUT_COMPLEX
case 'D':
return PyComplex_FromCComplex(
*((Py_complex *)va_arg(*p_va, Py_complex *)));
-#endif /* WITHOUT_COMPLEX */
case 'c':
{
@@ -304,39 +302,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
case 's':
case 'z':
- {
- PyObject *v;
- char *str = va_arg(*p_va, char *);
- Py_ssize_t n;
- if (**p_format == '#') {
- ++*p_format;
- if (flags & FLAG_SIZE_T)
- n = va_arg(*p_va, Py_ssize_t);
- else
- n = va_arg(*p_va, int);
- }
- else
- n = -1;
- if (str == NULL) {
- v = Py_None;
- Py_INCREF(v);
- }
- else {
- if (n < 0) {
- size_t m = strlen(str);
- if (m > PY_SSIZE_T_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "string too long for Python string");
- return NULL;
- }
- n = (Py_ssize_t)m;
- }
- v = PyUnicode_FromStringAndSize(str, n);
- }
- return v;
- }
-
- case 'U':
+ case 'U': /* XXX deprecated alias */
{
PyObject *v;
char *str = va_arg(*p_va, char *);
@@ -490,15 +456,7 @@ va_build_value(const char *format, va_list va, int flags)
int n = countformat(f, '\0');
va_list lva;
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
if (n < 0)
return NULL;
diff --git a/Python/opcode_targets.h b/Python/opcode_targets.h
index c47c7c836a..a91da79be6 100644
--- a/Python/opcode_targets.h
+++ b/Python/opcode_targets.h
@@ -4,7 +4,7 @@ static void *opcode_targets[256] = {
&&TARGET_ROT_TWO,
&&TARGET_ROT_THREE,
&&TARGET_DUP_TOP,
- &&TARGET_ROT_FOUR,
+ &&TARGET_DUP_TOP_TWO,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
@@ -98,7 +98,7 @@ static void *opcode_targets[256] = {
&&TARGET_DELETE_ATTR,
&&TARGET_STORE_GLOBAL,
&&TARGET_DELETE_GLOBAL,
- &&TARGET_DUP_TOPX,
+ &&_unknown_opcode,
&&TARGET_LOAD_CONST,
&&TARGET_LOAD_NAME,
&&TARGET_BUILD_TUPLE,
@@ -137,13 +137,13 @@ static void *opcode_targets[256] = {
&&TARGET_LOAD_CLOSURE,
&&TARGET_LOAD_DEREF,
&&TARGET_STORE_DEREF,
- &&_unknown_opcode,
+ &&TARGET_DELETE_DEREF,
&&_unknown_opcode,
&&TARGET_CALL_FUNCTION_VAR,
&&TARGET_CALL_FUNCTION_KW,
&&TARGET_CALL_FUNCTION_VAR_KW,
+ &&TARGET_SETUP_WITH,
&&TARGET_EXTENDED_ARG,
- &&_unknown_opcode,
&&TARGET_LIST_APPEND,
&&TARGET_SET_ADD,
&&TARGET_MAP_ADD,
diff --git a/Python/peephole.c b/Python/peephole.c
index c27878c1c7..359eda833b 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -4,10 +4,8 @@
#include "Python-ast.h"
#include "node.h"
-#include "pyarena.h"
#include "ast.h"
#include "code.h"
-#include "compile.h"
#include "symtable.h"
#include "opcode.h"
@@ -31,7 +29,8 @@
new constant (c1, c2, ... cn) can be appended.
Called with codestr pointing to the first LOAD_CONST.
Bails out with no change if one or more of the LOAD_CONSTs is missing.
- Also works for BUILD_LIST when followed by an "in" or "not in" test.
+ Also works for BUILD_LIST and BUILT_SET when followed by an "in" or "not in"
+ test; for BUILD_SET it assembles a frozenset rather than a tuple.
*/
static int
tuple_of_constants(unsigned char *codestr, Py_ssize_t n, PyObject *consts)
@@ -41,7 +40,7 @@ tuple_of_constants(unsigned char *codestr, Py_ssize_t n, PyObject *consts)
/* Pre-conditions */
assert(PyList_CheckExact(consts));
- assert(codestr[n*3] == BUILD_TUPLE || codestr[n*3] == BUILD_LIST);
+ assert(codestr[n*3] == BUILD_TUPLE || codestr[n*3] == BUILD_LIST || codestr[n*3] == BUILD_SET);
assert(GETARG(codestr, (n*3)) == n);
for (i=0 ; i<n ; i++)
assert(codestr[i*3] == LOAD_CONST);
@@ -59,6 +58,16 @@ tuple_of_constants(unsigned char *codestr, Py_ssize_t n, PyObject *consts)
PyTuple_SET_ITEM(newconst, i, constant);
}
+ /* If it's a BUILD_SET, use the PyTuple we just built to create a
+ PyFrozenSet, and use that as the constant instead: */
+ if (codestr[n*3] == BUILD_SET) {
+ PyObject *tuple = newconst;
+ newconst = PyFrozenSet_New(tuple);
+ Py_DECREF(tuple);
+ if (newconst == NULL)
+ return 0;
+ }
+
/* Append folded constant onto consts */
if (PyList_Append(consts, newconst)) {
Py_DECREF(newconst);
@@ -166,13 +175,16 @@ fold_binops_on_constants(unsigned char *codestr, PyObject *consts)
return 0;
}
if (newconst == NULL) {
- PyErr_Clear();
+ if(!PyErr_ExceptionMatches(PyExc_KeyboardInterrupt))
+ PyErr_Clear();
return 0;
}
size = PyObject_Size(newconst);
- if (size == -1)
+ if (size == -1) {
+ if (PyErr_ExceptionMatches(PyExc_KeyboardInterrupt))
+ return 0;
PyErr_Clear();
- else if (size > 20) {
+ } else if (size > 20) {
Py_DECREF(newconst);
return 0;
}
@@ -215,6 +227,9 @@ fold_unaryops_on_constants(unsigned char *codestr, PyObject *consts)
case UNARY_INVERT:
newconst = PyNumber_Invert(v);
break;
+ case UNARY_POSITIVE:
+ newconst = PyNumber_Positive(v);
+ break;
default:
/* Called with an unknown opcode */
PyErr_Format(PyExc_SystemError,
@@ -223,7 +238,8 @@ fold_unaryops_on_constants(unsigned char *codestr, PyObject *consts)
return 0;
}
if (newconst == NULL) {
- PyErr_Clear();
+ if(!PyErr_ExceptionMatches(PyExc_KeyboardInterrupt))
+ PyErr_Clear();
return 0;
}
@@ -269,6 +285,7 @@ markblocks(unsigned char *code, Py_ssize_t len)
case SETUP_LOOP:
case SETUP_EXCEPT:
case SETUP_FINALLY:
+ case SETUP_WITH:
j = GETJUMPTGT(code, i);
blocks[j] = 1;
break;
@@ -450,20 +467,21 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
cumlc = 0;
break;
- /* Try to fold tuples of constants (includes a case for lists
+ /* Try to fold tuples of constants (includes a case for lists and sets
which are only used for "in" and "not in" tests).
Skip over BUILD_SEQN 1 UNPACK_SEQN 1.
Replace BUILD_SEQN 2 UNPACK_SEQN 2 with ROT2.
Replace BUILD_SEQN 3 UNPACK_SEQN 3 with ROT3 ROT2. */
case BUILD_TUPLE:
case BUILD_LIST:
+ case BUILD_SET:
j = GETARG(codestr, i);
h = i - 3 * j;
if (h >= 0 &&
j <= lastlc &&
((opcode == BUILD_TUPLE &&
ISBASICBLOCK(blocks, h, 3*(j+1))) ||
- (opcode == BUILD_LIST &&
+ ((opcode == BUILD_LIST || opcode == BUILD_SET) &&
codestr[i+3]==COMPARE_OP &&
ISBASICBLOCK(blocks, h, 3*(j+2)) &&
(GETARG(codestr,i+3)==6 ||
@@ -475,7 +493,8 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
}
if (codestr[i+3] != UNPACK_SEQUENCE ||
!ISBASICBLOCK(blocks,i,6) ||
- j != GETARG(codestr, i+3))
+ j != GETARG(codestr, i+3) ||
+ opcode == BUILD_SET)
continue;
if (j == 1) {
memset(codestr+i, NOP, 6);
@@ -517,6 +536,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
LOAD_CONST c1 UNARY_OP --> LOAD_CONST unary_op(c) */
case UNARY_NEGATIVE:
case UNARY_INVERT:
+ case UNARY_POSITIVE:
if (lastlc >= 1 &&
ISBASICBLOCK(blocks, i-3, 4) &&
fold_unaryops_on_constants(&codestr[i-3], consts)) {
@@ -584,6 +604,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
case SETUP_LOOP:
case SETUP_EXCEPT:
case SETUP_FINALLY:
+ case SETUP_WITH:
tgt = GETJUMPTGT(codestr, i);
/* Replace JUMP_* to a RETURN into just a RETURN */
if (UNCONDITIONAL_JUMP(opcode) &&
@@ -666,6 +687,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
case SETUP_LOOP:
case SETUP_EXCEPT:
case SETUP_FINALLY:
+ case SETUP_WITH:
j = addrmap[GETARG(codestr, i) + i + 3] - addrmap[i] - 3;
SETARG(codestr, i, j);
break;
diff --git a/Python/pyarena.c b/Python/pyarena.c
index 2d63638856..5a255ae497 100644
--- a/Python/pyarena.c
+++ b/Python/pyarena.c
@@ -1,5 +1,4 @@
#include "Python.h"
-#include "pyarena.h"
/* A simple arena block structure.
diff --git a/Python/pymath.c b/Python/pymath.c
index 9159b6ed51..827a773a6a 100644
--- a/Python/pymath.c
+++ b/Python/pymath.c
@@ -77,202 +77,3 @@ round(double x)
return copysign(y, x);
}
#endif /* HAVE_ROUND */
-
-#ifndef HAVE_LOG1P
-#include <float.h>
-
-double
-log1p(double x)
-{
- /* For x small, we use the following approach. Let y be the nearest
- float to 1+x, then
-
- 1+x = y * (1 - (y-1-x)/y)
-
- so log(1+x) = log(y) + log(1-(y-1-x)/y). Since (y-1-x)/y is tiny,
- the second term is well approximated by (y-1-x)/y. If abs(x) >=
- DBL_EPSILON/2 or the rounding-mode is some form of round-to-nearest
- then y-1-x will be exactly representable, and is computed exactly
- by (y-1)-x.
-
- If abs(x) < DBL_EPSILON/2 and the rounding mode is not known to be
- round-to-nearest then this method is slightly dangerous: 1+x could
- be rounded up to 1+DBL_EPSILON instead of down to 1, and in that
- case y-1-x will not be exactly representable any more and the
- result can be off by many ulps. But this is easily fixed: for a
- floating-point number |x| < DBL_EPSILON/2., the closest
- floating-point number to log(1+x) is exactly x.
- */
-
- double y;
- if (fabs(x) < DBL_EPSILON/2.) {
- return x;
- } else if (-0.5 <= x && x <= 1.) {
- /* WARNING: it's possible than an overeager compiler
- will incorrectly optimize the following two lines
- to the equivalent of "return log(1.+x)". If this
- happens, then results from log1p will be inaccurate
- for small x. */
- y = 1.+x;
- return log(y)-((y-1.)-x)/y;
- } else {
- /* NaNs and infinities should end up here */
- return log(1.+x);
- }
-}
-#endif /* HAVE_LOG1P */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-static const double ln2 = 6.93147180559945286227E-01;
-static const double two_pow_m28 = 3.7252902984619141E-09; /* 2**-28 */
-static const double two_pow_p28 = 268435456.0; /* 2**28 */
-static const double zero = 0.0;
-
-/* asinh(x)
- * Method :
- * Based on
- * asinh(x) = sign(x) * log [ |x| + sqrt(x*x+1) ]
- * we have
- * asinh(x) := x if 1+x*x=1,
- * := sign(x)*(log(x)+ln2)) for large |x|, else
- * := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else
- * := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2)))
- */
-
-#ifndef HAVE_ASINH
-double
-asinh(double x)
-{
- double w;
- double absx = fabs(x);
-
- if (Py_IS_NAN(x) || Py_IS_INFINITY(x)) {
- return x+x;
- }
- if (absx < two_pow_m28) { /* |x| < 2**-28 */
- return x; /* return x inexact except 0 */
- }
- if (absx > two_pow_p28) { /* |x| > 2**28 */
- w = log(absx)+ln2;
- }
- else if (absx > 2.0) { /* 2 < |x| < 2**28 */
- w = log(2.0*absx + 1.0 / (sqrt(x*x + 1.0) + absx));
- }
- else { /* 2**-28 <= |x| < 2= */
- double t = x*x;
- w = log1p(absx + t / (1.0 + sqrt(1.0 + t)));
- }
- return copysign(w, x);
-
-}
-#endif /* HAVE_ASINH */
-
-/* acosh(x)
- * Method :
- * Based on
- * acosh(x) = log [ x + sqrt(x*x-1) ]
- * we have
- * acosh(x) := log(x)+ln2, if x is large; else
- * acosh(x) := log(2x-1/(sqrt(x*x-1)+x)) if x>2; else
- * acosh(x) := log1p(t+sqrt(2.0*t+t*t)); where t=x-1.
- *
- * Special cases:
- * acosh(x) is NaN with signal if x<1.
- * acosh(NaN) is NaN without signal.
- */
-
-#ifndef HAVE_ACOSH
-double
-acosh(double x)
-{
- if (Py_IS_NAN(x)) {
- return x+x;
- }
- if (x < 1.) { /* x < 1; return a signaling NaN */
- errno = EDOM;
-#ifdef Py_NAN
- return Py_NAN;
-#else
- return (x-x)/(x-x);
-#endif
- }
- else if (x >= two_pow_p28) { /* x > 2**28 */
- if (Py_IS_INFINITY(x)) {
- return x+x;
- } else {
- return log(x)+ln2; /* acosh(huge)=log(2x) */
- }
- }
- else if (x == 1.) {
- return 0.0; /* acosh(1) = 0 */
- }
- else if (x > 2.) { /* 2 < x < 2**28 */
- double t = x*x;
- return log(2.0*x - 1.0 / (x + sqrt(t - 1.0)));
- }
- else { /* 1 < x <= 2 */
- double t = x - 1.0;
- return log1p(t + sqrt(2.0*t + t*t));
- }
-}
-#endif /* HAVE_ACOSH */
-
-/* atanh(x)
- * Method :
- * 1.Reduced x to positive by atanh(-x) = -atanh(x)
- * 2.For x>=0.5
- * 1 2x x
- * atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------)
- * 2 1 - x 1 - x
- *
- * For x<0.5
- * atanh(x) = 0.5*log1p(2x+2x*x/(1-x))
- *
- * Special cases:
- * atanh(x) is NaN if |x| >= 1 with signal;
- * atanh(NaN) is that NaN with no signal;
- *
- */
-
-#ifndef HAVE_ATANH
-double
-atanh(double x)
-{
- double absx;
- double t;
-
- if (Py_IS_NAN(x)) {
- return x+x;
- }
- absx = fabs(x);
- if (absx >= 1.) { /* |x| >= 1 */
- errno = EDOM;
-#ifdef Py_NAN
- return Py_NAN;
-#else
- return x/zero;
-#endif
- }
- if (absx < two_pow_m28) { /* |x| < 2**-28 */
- return x;
- }
- if (absx < 0.5) { /* |x| < 0.5 */
- t = absx+absx;
- t = 0.5 * log1p(t + t*absx / (1.0 - absx));
- }
- else { /* 0.5 <= |x| <= 1.0 */
- t = 0.5 * log1p((absx + absx) / (1.0 - absx));
- }
- return copysign(t, x);
-}
-#endif /* HAVE_ATANH */
diff --git a/Python/pystate.c b/Python/pystate.c
index ea0d05d833..b347c41c54 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -47,7 +47,9 @@ static int autoTLSkey = 0;
static PyInterpreterState *interp_head = NULL;
-PyThreadState *_PyThreadState_Current = NULL;
+/* Assuming the current thread holds the GIL, this is the
+ PyThreadState for the current thread. */
+_Py_atomic_address _PyThreadState_Current = {NULL};
PyThreadFrameGetter _PyThreadState_GetFrame = NULL;
#ifdef WITH_THREAD
@@ -77,6 +79,7 @@ PyInterpreterState_New(void)
interp->codec_search_cache = NULL;
interp->codec_error_registry = NULL;
interp->codecs_initialized = 0;
+ interp->fscodec_initialized = 0;
#ifdef HAVE_DLOPEN
#ifdef RTLD_NOW
interp->dlopenflags = RTLD_NOW;
@@ -334,7 +337,7 @@ tstate_delete_common(PyThreadState *tstate)
void
PyThreadState_Delete(PyThreadState *tstate)
{
- if (tstate == _PyThreadState_Current)
+ if (tstate == _Py_atomic_load_relaxed(&_PyThreadState_Current))
Py_FatalError("PyThreadState_Delete: tstate is still current");
tstate_delete_common(tstate);
#ifdef WITH_THREAD
@@ -348,11 +351,12 @@ PyThreadState_Delete(PyThreadState *tstate)
void
PyThreadState_DeleteCurrent()
{
- PyThreadState *tstate = _PyThreadState_Current;
+ PyThreadState *tstate = (PyThreadState*)_Py_atomic_load_relaxed(
+ &_PyThreadState_Current);
if (tstate == NULL)
Py_FatalError(
"PyThreadState_DeleteCurrent: no current tstate");
- _PyThreadState_Current = NULL;
+ _Py_atomic_store_relaxed(&_PyThreadState_Current, NULL);
tstate_delete_common(tstate);
if (autoInterpreterState && PyThread_get_key_value(autoTLSkey) == tstate)
PyThread_delete_key_value(autoTLSkey);
@@ -364,19 +368,22 @@ PyThreadState_DeleteCurrent()
PyThreadState *
PyThreadState_Get(void)
{
- if (_PyThreadState_Current == NULL)
+ PyThreadState *tstate = (PyThreadState*)_Py_atomic_load_relaxed(
+ &_PyThreadState_Current);
+ if (tstate == NULL)
Py_FatalError("PyThreadState_Get: no current thread");
- return _PyThreadState_Current;
+ return tstate;
}
PyThreadState *
PyThreadState_Swap(PyThreadState *newts)
{
- PyThreadState *oldts = _PyThreadState_Current;
+ PyThreadState *oldts = (PyThreadState*)_Py_atomic_load_relaxed(
+ &_PyThreadState_Current);
- _PyThreadState_Current = newts;
+ _Py_atomic_store_relaxed(&_PyThreadState_Current, newts);
/* It should not be possible for more than one thread state
to be used for a thread. Check this the best we can in debug
builds.
@@ -405,16 +412,18 @@ PyThreadState_Swap(PyThreadState *newts)
PyObject *
PyThreadState_GetDict(void)
{
- if (_PyThreadState_Current == NULL)
+ PyThreadState *tstate = (PyThreadState*)_Py_atomic_load_relaxed(
+ &_PyThreadState_Current);
+ if (tstate == NULL)
return NULL;
- if (_PyThreadState_Current->dict == NULL) {
+ if (tstate->dict == NULL) {
PyObject *d;
- _PyThreadState_Current->dict = d = PyDict_New();
+ tstate->dict = d = PyDict_New();
if (d == NULL)
PyErr_Clear();
}
- return _PyThreadState_Current->dict;
+ return tstate->dict;
}
@@ -453,6 +462,7 @@ PyThreadState_SetAsyncExc(long id, PyObject *exc) {
p->async_exc = exc;
HEAD_UNLOCK();
Py_XDECREF(old_exc);
+ _PyEval_SignalAsyncExc();
return 1;
}
}
@@ -549,10 +559,7 @@ PyThreadState_IsCurrent(PyThreadState *tstate)
{
/* Must be the tstate for this thread */
assert(PyGILState_GetThisThreadState()==tstate);
- /* On Windows at least, simple reads and writes to 32 bit values
- are atomic.
- */
- return tstate == _PyThreadState_Current;
+ return tstate == _Py_atomic_load_relaxed(&_PyThreadState_Current);
}
/* Internal initialization/finalization functions called by
@@ -563,6 +570,8 @@ _PyGILState_Init(PyInterpreterState *i, PyThreadState *t)
{
assert(i && t); /* must init with valid states */
autoTLSkey = PyThread_create_key();
+ if (autoTLSkey == -1)
+ Py_FatalError("Could not allocate TLS entry");
autoInterpreterState = i;
assert(PyThread_get_key_value(autoTLSkey) == NULL);
assert(t->gilstate_counter == 0);
@@ -577,6 +586,23 @@ _PyGILState_Fini(void)
autoInterpreterState = NULL;
}
+/* Reset the TLS key - called by PyOS_AfterFork.
+ * This should not be necessary, but some - buggy - pthread implementations
+ * don't flush TLS on fork, see issue #10517.
+ */
+void
+_PyGILState_Reinit(void)
+{
+ PyThreadState *tstate = PyGILState_GetThisThreadState();
+ PyThread_delete_key(autoTLSkey);
+ if ((autoTLSkey = PyThread_create_key()) == -1)
+ Py_FatalError("Could not allocate TLS entry");
+
+ /* re-associate the current thread state with the new key */
+ if (PyThread_set_key_value(autoTLSkey, (void *)tstate) < 0)
+ Py_FatalError("Couldn't create autoTLSkey mapping");
+}
+
/* When a thread state is created for a thread by some mechanism other than
PyGILState_Ensure, it's important that the GILState machinery knows about
it so it doesn't try to create another thread state for the thread (this is
diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index f7ddd13d99..75e3032fb7 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -3,11 +3,8 @@
#include <Python.h>
#include <locale.h>
-/* _Py_parse_inf_or_nan: Attempt to parse a string of the form "nan", "inf" or
- "infinity", with an optional leading sign of "+" or "-". On success,
- return the NaN or Infinity as a double and set *endptr to point just beyond
- the successfully parsed portion of the string. On failure, return -1.0 and
- set *endptr to point to the start of the string. */
+/* Case-insensitive string match used for nan and inf detection; t should be
+ lower-case. Returns 1 for a successful match, 0 otherwise. */
static int
case_insensitive_match(const char *s, const char *t)
@@ -19,6 +16,12 @@ case_insensitive_match(const char *s, const char *t)
return *t ? 0 : 1;
}
+/* _Py_parse_inf_or_nan: Attempt to parse a string of the form "nan", "inf" or
+ "infinity", with an optional leading sign of "+" or "-". On success,
+ return the NaN or Infinity as a double and set *endptr to point just beyond
+ the successfully parsed portion of the string. On failure, return -1.0 and
+ set *endptr to point to the start of the string. */
+
double
_Py_parse_inf_or_nan(const char *p, char **endptr)
{
@@ -55,7 +58,7 @@ _Py_parse_inf_or_nan(const char *p, char **endptr)
}
/**
- * PyOS_ascii_strtod:
+ * _PyOS_ascii_strtod:
* @nptr: the string to convert to a numeric value.
* @endptr: if non-%NULL, it returns the character after
* the last character used in the conversion.
@@ -85,7 +88,7 @@ _Py_parse_inf_or_nan(const char *p, char **endptr)
#ifndef PY_NO_SHORT_FLOAT_REPR
-double
+static double
_PyOS_ascii_strtod(const char *nptr, char **endptr)
{
double result;
@@ -118,7 +121,7 @@ _PyOS_ascii_strtod(const char *nptr, char **endptr)
correctly rounded results.
*/
-double
+static double
_PyOS_ascii_strtod(const char *nptr, char **endptr)
{
char *fail_pos;
@@ -267,48 +270,10 @@ _PyOS_ascii_strtod(const char *nptr, char **endptr)
#endif
-/* PyOS_ascii_strtod is DEPRECATED in Python 3.1 */
-
-double
-PyOS_ascii_strtod(const char *nptr, char **endptr)
-{
- char *fail_pos;
- const char *p;
- double x;
-
- if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "PyOS_ascii_strtod and PyOS_ascii_atof are "
- "deprecated. Use PyOS_string_to_double "
- "instead.", 1) < 0)
- return -1.0;
-
- /* _PyOS_ascii_strtod already does everything that we want,
- except that it doesn't parse leading whitespace */
- p = nptr;
- while (Py_ISSPACE(*p))
- p++;
- x = _PyOS_ascii_strtod(p, &fail_pos);
- if (fail_pos == p)
- fail_pos = (char *)nptr;
- if (endptr)
- *endptr = (char *)fail_pos;
- return x;
-}
-
-/* PyOS_ascii_strtod is DEPRECATED in Python 3.1 */
-
-double
-PyOS_ascii_atof(const char *nptr)
-{
- return PyOS_ascii_strtod(nptr, NULL);
-}
-
-/* PyOS_string_to_double is the recommended replacement for the deprecated
- PyOS_ascii_strtod and PyOS_ascii_atof functions. It converts a
- null-terminated byte string s (interpreted as a string of ASCII characters)
- to a float. The string should not have leading or trailing whitespace (in
- contrast, PyOS_ascii_strtod allows leading whitespace but not trailing
- whitespace). The conversion is independent of the current locale.
+/* PyOS_string_to_double converts a null-terminated byte string s (interpreted
+ as a string of ASCII characters) to a float. The string should not have
+ leading or trailing whitespace. The conversion is independent of the
+ current locale.
If endptr is NULL, try to convert the whole string. Raise ValueError and
return -1.0 if the string is not a valid representation of a floating-point
@@ -366,6 +331,8 @@ PyOS_string_to_double(const char *s,
return result;
}
+#ifdef PY_NO_SHORT_FLOAT_REPR
+
/* Given a string that may have a decimal point in the current
locale, change it back to a dot. Since the string cannot get
longer, no need for a maximum buffer size parameter. */
@@ -615,12 +582,13 @@ ensure_decimal_point(char* buffer, size_t buf_size, int precision)
#define FLOAT_FORMATBUFLEN 120
/**
- * PyOS_ascii_formatd:
+ * _PyOS_ascii_formatd:
* @buffer: A buffer to place the resulting string in
* @buf_size: The length of the buffer.
* @format: The printf()-style format to use for the
* code to use for converting.
* @d: The #gdouble to convert
+ * @precision: The precision to use when formatting.
*
* Converts a #gdouble to a string, using the '.' as
* decimal point. To format the number you pass in
@@ -633,7 +601,7 @@ ensure_decimal_point(char* buffer, size_t buf_size, int precision)
* Return value: The pointer to the buffer with the converted string.
* On failure returns NULL but does not set any Python exception.
**/
-char *
+static char *
_PyOS_ascii_formatd(char *buffer,
size_t buf_size,
const char *format,
@@ -713,22 +681,6 @@ _PyOS_ascii_formatd(char *buffer,
return buffer;
}
-char *
-PyOS_ascii_formatd(char *buffer,
- size_t buf_size,
- const char *format,
- double d)
-{
- if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "PyOS_ascii_formatd is deprecated, "
- "use PyOS_double_to_string instead", 1) < 0)
- return NULL;
-
- return _PyOS_ascii_formatd(buffer, buf_size, format, d, -1);
-}
-
-#ifdef PY_NO_SHORT_FLOAT_REPR
-
/* The fallback code to use if _Py_dg_dtoa is not available. */
PyAPI_FUNC(char *) PyOS_double_to_string(double val,
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index c6cf088232..1e2dd586b4 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -11,14 +11,10 @@
#include "parsetok.h"
#include "errcode.h"
#include "code.h"
-#include "compile.h"
#include "symtable.h"
-#include "pyarena.h"
#include "ast.h"
-#include "eval.h"
#include "marshal.h"
#include "osdefs.h"
-#include "abstract.h"
#ifdef HAVE_SIGNAL_H
#include <signal.h>
@@ -57,6 +53,7 @@ extern grammar _PyParser_Grammar; /* From graminit.c */
/* Forward */
static void initmain(void);
+static int initfsencoding(PyInterpreterState *interp);
static void initsite(void);
static int initstdio(void);
static void flush_io(void);
@@ -81,6 +78,7 @@ extern void _PyGILState_Fini(void);
int Py_DebugFlag; /* Needed by parser.c */
int Py_VerboseFlag; /* Needed by import.c */
+int Py_QuietFlag; /* Needed by sysmodule.c */
int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
int Py_InspectFlag; /* Needed to determine whether to exit at SystemError */
int Py_NoSiteFlag; /* Suppress 'import site' */
@@ -92,6 +90,8 @@ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */
+PyThreadState *_Py_Finalizing = NULL;
+
/* PyModule_GetWarningsModule is no longer necessary as of 2.6
since _warnings is builtin. This API should not be used. */
PyObject *
@@ -133,18 +133,13 @@ add_flag(int flag, const char *envs)
return flag;
}
-#if defined(HAVE_LANGINFO_H) && defined(CODESET)
static char*
-get_codeset(void)
+get_codec_name(const char *encoding)
{
- char* codeset;
- PyObject *codec, *name;
-
- codeset = nl_langinfo(CODESET);
- if (!codeset || codeset[0] == '\0')
- return NULL;
+ char *name_utf8, *name_str;
+ PyObject *codec, *name = NULL;
- codec = _PyCodec_Lookup(codeset);
+ codec = _PyCodec_Lookup(encoding);
if (!codec)
goto error;
@@ -153,15 +148,34 @@ get_codeset(void)
if (!name)
goto error;
- codeset = strdup(_PyUnicode_AsString(name));
+ name_utf8 = _PyUnicode_AsString(name);
+ if (name_utf8 == NULL)
+ goto error;
+ name_str = strdup(name_utf8);
Py_DECREF(name);
- return codeset;
+ if (name_str == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ return name_str;
error:
Py_XDECREF(codec);
- PyErr_Clear();
+ Py_XDECREF(name);
return NULL;
}
+
+#if defined(HAVE_LANGINFO_H) && defined(CODESET)
+static char*
+get_codeset(void)
+{
+ char* codeset = nl_langinfo(CODESET);
+ if (!codeset || codeset[0] == '\0') {
+ PyErr_SetString(PyExc_ValueError, "CODESET is not set or empty");
+ return NULL;
+ }
+ return get_codec_name(codeset);
+}
#endif
void
@@ -171,16 +185,14 @@ Py_InitializeEx(int install_sigs)
PyThreadState *tstate;
PyObject *bimod, *sysmod, *pstderr;
char *p;
-#if defined(HAVE_LANGINFO_H) && defined(CODESET)
- char *codeset;
-#endif
extern void _Py_ReadyTypes(void);
if (initialized)
return;
initialized = 1;
+ _Py_Finalizing = NULL;
-#ifdef HAVE_SETLOCALE
+#if defined(HAVE_LANGINFO_H) && defined(HAVE_SETLOCALE)
/* Set up the LC_CTYPE locale, so we can obtain
the locale's charset without having to switch
locales. */
@@ -205,6 +217,18 @@ Py_InitializeEx(int install_sigs)
Py_FatalError("Py_Initialize: can't make first thread");
(void) PyThreadState_Swap(tstate);
+#ifdef WITH_THREAD
+ /* We can't call _PyEval_FiniThreads() in Py_Finalize because
+ destroying the GIL might fail when it is being referenced from
+ another running thread (see issue #9901).
+ Instead we destroy the previously created GIL here, which ensures
+ that we can call Py_Initialize / Py_Finalize multiple times. */
+ _PyEval_FiniThreads();
+
+ /* Auto-thread-state API */
+ _PyGILState_Init(interp, tstate);
+#endif /* WITH_THREAD */
+
_Py_ReadyTypes();
if (!_PyFrame_Init())
@@ -231,7 +255,7 @@ Py_InitializeEx(int install_sigs)
bimod = _PyBuiltin_Init();
if (bimod == NULL)
Py_FatalError("Py_Initialize: can't initialize builtins modules");
- _PyImport_FixupExtension(bimod, "builtins", "builtins");
+ _PyImport_FixupBuiltin(bimod, "builtins");
interp->builtins = PyModule_GetDict(bimod);
if (interp->builtins == NULL)
Py_FatalError("Py_Initialize: can't initialize builtins dict");
@@ -247,7 +271,7 @@ Py_InitializeEx(int install_sigs)
if (interp->sysdict == NULL)
Py_FatalError("Py_Initialize: can't initialize sys dict");
Py_INCREF(interp->sysdict);
- _PyImport_FixupExtension(sysmod, "sys", "sys");
+ _PyImport_FixupBuiltin(sysmod, "sys");
PySys_SetPath(Py_GetPath());
PyDict_SetItemString(interp->sysdict, "modules",
interp->modules);
@@ -268,42 +292,28 @@ Py_InitializeEx(int install_sigs)
/* Initialize _warnings. */
_PyWarnings_Init();
-#if defined(HAVE_LANGINFO_H) && defined(CODESET)
- /* On Unix, set the file system encoding according to the
- user's preference, if the CODESET names a well-known
- Python codec, and Py_FileSystemDefaultEncoding isn't
- initialized by other means. Also set the encoding of
- stdin and stdout if these are terminals. */
-
- codeset = get_codeset();
- if (codeset) {
- if (!Py_FileSystemDefaultEncoding)
- Py_FileSystemDefaultEncoding = codeset;
- else
- free(codeset);
- }
-#endif
+ _PyTime_Init();
+
+ if (initfsencoding(interp) < 0)
+ Py_FatalError("Py_Initialize: unable to load the file system codec");
if (install_sigs)
initsigs(); /* Signal handling stuff, including initintr() */
- /* Initialize warnings. */
- if (PySys_HasWarnOptions()) {
- PyObject *warnings_module = PyImport_ImportModule("warnings");
- if (!warnings_module)
- PyErr_Clear();
- Py_XDECREF(warnings_module);
- }
-
initmain(); /* Module __main__ */
if (initstdio() < 0)
Py_FatalError(
"Py_Initialize: can't initialize sys standard streams");
- /* auto-thread-state API, if available */
-#ifdef WITH_THREAD
- _PyGILState_Init(interp, tstate);
-#endif /* WITH_THREAD */
+ /* Initialize warnings. */
+ if (PySys_HasWarnOptions()) {
+ PyObject *warnings_module = PyImport_ImportModule("warnings");
+ if (warnings_module == NULL) {
+ fprintf(stderr, "'import warnings' failed; traceback:\n");
+ PyErr_Print();
+ }
+ Py_XDECREF(warnings_module);
+ }
if (!Py_NoSiteFlag)
initsite(); /* Module site */
@@ -381,15 +391,19 @@ Py_Finalize(void)
* the threads created via Threading.
*/
call_py_exitfuncs();
- initialized = 0;
-
- /* Flush stdout+stderr */
- flush_std_files();
/* Get current thread state and interpreter pointer */
tstate = PyThreadState_GET();
interp = tstate->interp;
+ /* Remaining threads (e.g. daemon threads) will automatically exit
+ after taking the GIL (in PyEval_RestoreThread()). */
+ _Py_Finalizing = tstate;
+ initialized = 0;
+
+ /* Flush stdout+stderr */
+ flush_std_files();
+
/* Disable signal handling */
PyOS_FiniInterrupts();
@@ -416,6 +430,9 @@ Py_Finalize(void)
while (PyGC_Collect() > 0)
/* nothing */;
#endif
+ /* We run this while most interpreter state is still alive, so that
+ debug information can be printed out */
+ _PyGC_Fini();
/* Destroy all modules */
PyImport_Cleanup();
@@ -499,7 +516,7 @@ Py_Finalize(void)
_PyUnicode_Fini();
/* reset file system default encoding */
- if (!Py_HasFileSystemDefaultEncoding) {
+ if (!Py_HasFileSystemDefaultEncoding && Py_FileSystemDefaultEncoding) {
free((char*)Py_FileSystemDefaultEncoding);
Py_FileSystemDefaultEncoding = NULL;
}
@@ -568,7 +585,7 @@ Py_NewInterpreter(void)
interp->modules = PyDict_New();
interp->modules_reloading = PyDict_New();
- bimod = _PyImport_FindExtension("builtins", "builtins");
+ bimod = _PyImport_FindBuiltin("builtins");
if (bimod != NULL) {
interp->builtins = PyModule_GetDict(bimod);
if (interp->builtins == NULL)
@@ -579,7 +596,7 @@ Py_NewInterpreter(void)
/* initialize builtin exceptions */
_PyExc_Init();
- sysmod = _PyImport_FindExtension("sys", "sys");
+ sysmod = _PyImport_FindBuiltin("sys");
if (bimod != NULL && sysmod != NULL) {
PyObject *pstderr;
interp->sysdict = PyModule_GetDict(sysmod);
@@ -599,6 +616,10 @@ Py_NewInterpreter(void)
Py_DECREF(pstderr);
_PyImportHooks_Init();
+
+ if (initfsencoding(interp) < 0)
+ goto handle_error;
+
if (initstdio() < 0)
Py_FatalError(
"Py_Initialize: can't initialize sys standard streams");
@@ -613,7 +634,7 @@ Py_NewInterpreter(void)
handle_error:
/* Oops, it didn't work. Undo it all. */
- PyErr_Print();
+ PyErr_PrintEx(0);
PyThreadState_Clear(tstate);
PyThreadState_Swap(save_tstate);
PyThreadState_Delete(tstate);
@@ -711,30 +732,53 @@ initmain(void)
}
}
+static int
+initfsencoding(PyInterpreterState *interp)
+{
+ PyObject *codec;
+#if defined(HAVE_LANGINFO_H) && defined(CODESET)
+ char *codeset = NULL;
+
+ if (Py_FileSystemDefaultEncoding == NULL) {
+ /* On Unix, set the file system encoding according to the
+ user's preference, if the CODESET names a well-known
+ Python codec, and Py_FileSystemDefaultEncoding isn't
+ initialized by other means. */
+ codeset = get_codeset();
+ if (codeset == NULL)
+ Py_FatalError("Py_Initialize: Unable to get the locale encoding");
+
+ Py_FileSystemDefaultEncoding = codeset;
+ Py_HasFileSystemDefaultEncoding = 0;
+ interp->fscodec_initialized = 1;
+ return 0;
+ }
+#endif
+
+ /* the encoding is mbcs, utf-8 or ascii */
+ codec = _PyCodec_Lookup(Py_FileSystemDefaultEncoding);
+ if (!codec) {
+ /* Such error can only occurs in critical situations: no more
+ * memory, import a module of the standard library failed,
+ * etc. */
+ return -1;
+ }
+ Py_DECREF(codec);
+ interp->fscodec_initialized = 1;
+ return 0;
+}
+
/* Import the site module (not into __main__ though) */
static void
initsite(void)
{
- PyObject *m, *f;
+ PyObject *m;
m = PyImport_ImportModule("site");
if (m == NULL) {
- f = PySys_GetObject("stderr");
- if (f == NULL || f == Py_None)
- return;
- if (Py_VerboseFlag) {
- PyObject *type, *value, *traceback;
- PyErr_Fetch(&type, &value, &traceback);
- PyFile_WriteString(
- "'import site' failed; traceback:\n", f);
- PyErr_Restore(type, value, traceback);
- PyErr_Print();
- }
- else {
- PyErr_Clear();
- PyFile_WriteString(
- "'import site' failed; use -v for traceback\n", f);
- }
+ PyErr_Print();
+ Py_Finalize();
+ exit(1);
}
else {
Py_DECREF(m);
@@ -748,6 +792,7 @@ create_stdio(PyObject* io,
{
PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL, *res;
const char* mode;
+ const char* newline;
PyObject *line_buffering;
int buffering, isatty;
@@ -798,9 +843,17 @@ create_stdio(PyObject* io,
Py_CLEAR(raw);
Py_CLEAR(text);
+ newline = "\n";
+#ifdef MS_WINDOWS
+ if (!write_mode) {
+ /* translate \r\n to \n for sys.stdin on Windows */
+ newline = NULL;
+ }
+#endif
+
stream = PyObject_CallMethod(io, "TextIOWrapper", "OsssO",
buf, encoding, errors,
- "\n", line_buffering);
+ newline, line_buffering);
Py_CLEAR(buf);
if (stream == NULL)
goto error;
@@ -860,8 +913,10 @@ initstdio(void)
/* Set builtins.open */
if (PyObject_SetAttrString(bimod, "open", wrapper) == -1) {
+ Py_DECREF(wrapper);
goto error;
}
+ Py_DECREF(wrapper);
encoding = Py_GETENV("PYTHONIOENCODING");
errors = NULL;
@@ -1056,22 +1111,34 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
if (!oenc)
return -1;
enc = _PyUnicode_AsString(oenc);
+ if (enc == NULL)
+ return -1;
}
v = PySys_GetObject("ps1");
if (v != NULL) {
v = PyObject_Str(v);
if (v == NULL)
PyErr_Clear();
- else if (PyUnicode_Check(v))
+ else if (PyUnicode_Check(v)) {
ps1 = _PyUnicode_AsString(v);
+ if (ps1 == NULL) {
+ PyErr_Clear();
+ ps1 = "";
+ }
+ }
}
w = PySys_GetObject("ps2");
if (w != NULL) {
w = PyObject_Str(w);
if (w == NULL)
PyErr_Clear();
- else if (PyUnicode_Check(w))
+ else if (PyUnicode_Check(w)) {
ps2 = _PyUnicode_AsString(w);
+ if (ps2 == NULL) {
+ PyErr_Clear();
+ ps2 = "";
+ }
+ }
}
arena = PyArena_New();
if (arena == NULL) {
@@ -1158,7 +1225,8 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit,
{
PyObject *m, *d, *v;
const char *ext;
- int set_file_name = 0, ret, len;
+ int set_file_name = 0, ret;
+ size_t len;
m = PyImport_AddModule("__main__");
if (m == NULL)
@@ -1173,6 +1241,8 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit,
Py_DECREF(f);
return -1;
}
+ if (PyDict_SetItemString(d, "__cached__", Py_None) < 0)
+ return -1;
set_file_name = 1;
Py_DECREF(f);
}
@@ -1359,10 +1429,12 @@ handle_system_exit(void)
exitcode = (int)PyLong_AsLong(value);
else {
PyObject *sys_stderr = PySys_GetObject("stderr");
- if (sys_stderr != NULL)
- PyObject_CallMethod(sys_stderr, "flush", NULL);
- PyObject_Print(value, stderr, Py_PRINT_RAW);
- fflush(stderr);
+ if (sys_stderr != NULL && sys_stderr != Py_None) {
+ PyFile_WriteObject(value, sys_stderr, Py_PRINT_RAW);
+ } else {
+ PyObject_Print(value, stderr, Py_PRINT_RAW);
+ fflush(stderr);
+ }
PySys_WriteStderr("\n");
exitcode = 1;
}
@@ -1708,7 +1780,7 @@ run_mod(mod_ty mod, const char *filename, PyObject *globals, PyObject *locals,
co = PyAST_Compile(mod, filename, flags, arena);
if (co == NULL)
return NULL;
- v = PyEval_EvalCode(co, globals, locals);
+ v = PyEval_EvalCode((PyObject*)co, globals, locals);
Py_DECREF(co);
return v;
}
@@ -1738,7 +1810,7 @@ run_pyc_file(FILE *fp, const char *filename, PyObject *globals,
return NULL;
}
co = (PyCodeObject *)v;
- v = PyEval_EvalCode(co, globals, locals);
+ v = PyEval_EvalCode((PyObject*)co, globals, locals);
if (v && flags)
flags->cf_flags |= (co->co_flags & PyCF_MASK);
Py_DECREF(co);
@@ -1746,8 +1818,8 @@ run_pyc_file(FILE *fp, const char *filename, PyObject *globals,
}
PyObject *
-Py_CompileStringFlags(const char *str, const char *filename, int start,
- PyCompilerFlags *flags)
+Py_CompileStringExFlags(const char *str, const char *filename, int start,
+ PyCompilerFlags *flags, int optimize)
{
PyCodeObject *co;
mod_ty mod;
@@ -1765,11 +1837,19 @@ Py_CompileStringFlags(const char *str, const char *filename, int start,
PyArena_Free(arena);
return result;
}
- co = PyAST_Compile(mod, filename, flags, arena);
+ co = PyAST_CompileEx(mod, filename, flags, optimize, arena);
PyArena_Free(arena);
return (PyObject *)co;
}
+/* For use in Py_LIMITED_API */
+#undef Py_CompileString
+PyObject *
+PyCompileString(const char *str, const char *filename, int start)
+{
+ return Py_CompileStringFlags(str, filename, start, NULL);
+}
+
struct symtable *
Py_SymtableString(const char *str, const char *filename, int start)
{
@@ -1913,7 +1993,7 @@ static void
err_input(perrdetail *err)
{
PyObject *v, *w, *errtype, *errtext;
- PyObject* u = NULL;
+ PyObject *msg_obj = NULL;
PyObject *filename;
char *msg = NULL;
@@ -1971,14 +2051,9 @@ err_input(perrdetail *err)
case E_DECODE: {
PyObject *type, *value, *tb;
PyErr_Fetch(&type, &value, &tb);
- if (value != NULL) {
- u = PyObject_Str(value);
- if (u != NULL) {
- msg = _PyUnicode_AsString(u);
- }
- }
- if (msg == NULL)
- msg = "unknown decode error";
+ msg = "unknown decode error";
+ if (value != NULL)
+ msg_obj = PyObject_Str(value);
Py_XDECREF(type);
Py_XDECREF(value);
Py_XDECREF(tb);
@@ -2016,14 +2091,18 @@ err_input(perrdetail *err)
err->lineno, err->offset, errtext);
else
v = NULL;
- w = NULL;
- if (v != NULL)
- w = Py_BuildValue("(sO)", msg, v);
- Py_XDECREF(u);
+ if (v != NULL) {
+ if (msg_obj)
+ w = Py_BuildValue("(OO)", msg_obj, v);
+ else
+ w = Py_BuildValue("(sO)", msg, v);
+ } else
+ w = NULL;
Py_XDECREF(v);
PyErr_SetObject(errtype, w);
Py_XDECREF(w);
cleanup:
+ Py_XDECREF(msg_obj);
if (err->text != NULL) {
PyObject_FREE(err->text);
err->text = NULL;
@@ -2160,6 +2239,27 @@ initsigs(void)
}
+/* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL.
+ *
+ * All of the code in this function must only use async-signal-safe functions,
+ * listed at `man 7 signal` or
+ * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html.
+ */
+void
+_Py_RestoreSignals(void)
+{
+#ifdef SIGPIPE
+ PyOS_setsig(SIGPIPE, SIG_DFL);
+#endif
+#ifdef SIGXFZ
+ PyOS_setsig(SIGXFZ, SIG_DFL);
+#endif
+#ifdef SIGXFSZ
+ PyOS_setsig(SIGXFSZ, SIG_DFL);
+#endif
+}
+
+
/*
* The file descriptor fd is considered ``interactive'' if either
* a) isatty(fd) is TRUE, or
@@ -2253,6 +2353,11 @@ PyOS_getsig(int sig)
#endif
}
+/*
+ * All of the code in this function must only use async-signal-safe functions,
+ * listed at `man 7 signal` or
+ * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html.
+ */
PyOS_sighandler_t
PyOS_setsig(int sig, PyOS_sighandler_t handler)
{
@@ -2370,7 +2475,15 @@ PyRun_SimpleString(const char *s)
PyAPI_FUNC(PyObject *)
Py_CompileString(const char *str, const char *p, int s)
{
- return Py_CompileStringFlags(str, p, s, NULL);
+ return Py_CompileStringExFlags(str, p, s, NULL, -1);
+}
+
+#undef Py_CompileStringFlags
+PyAPI_FUNC(PyObject *)
+Py_CompileStringFlags(const char *str, const char *p, int s,
+ PyCompilerFlags *flags)
+{
+ return Py_CompileStringExFlags(str, p, s, flags, -1);
}
#undef PyRun_InteractiveOne
diff --git a/Python/pytime.c b/Python/pytime.c
new file mode 100644
index 0000000000..6fb7695911
--- /dev/null
+++ b/Python/pytime.c
@@ -0,0 +1,60 @@
+#include "Python.h"
+
+#ifdef __APPLE__
+#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_FTIME)
+ /*
+ * _PyTime_gettimeofday falls back to ftime when getttimeofday fails because the latter
+ * might fail on some platforms. This fallback is unwanted on MacOSX because
+ * that makes it impossible to use a binary build on OSX 10.4 on earlier
+ * releases of the OS. Therefore claim we don't support ftime.
+ */
+# undef HAVE_FTIME
+#endif
+#endif
+
+#ifdef HAVE_FTIME
+#include <sys/timeb.h>
+#if !defined(MS_WINDOWS) && !defined(PYOS_OS2)
+extern int ftime(struct timeb *);
+#endif /* MS_WINDOWS */
+#endif /* HAVE_FTIME */
+
+void
+_PyTime_gettimeofday(_PyTime_timeval *tp)
+{
+ /* There are three ways to get the time:
+ (1) gettimeofday() -- resolution in microseconds
+ (2) ftime() -- resolution in milliseconds
+ (3) time() -- resolution in seconds
+ In all cases the return value in a timeval struct.
+ Since on some systems (e.g. SCO ODT 3.0) gettimeofday() may
+ fail, so we fall back on ftime() or time().
+ Note: clock resolution does not imply clock accuracy! */
+#ifdef HAVE_GETTIMEOFDAY
+#ifdef GETTIMEOFDAY_NO_TZ
+ if (gettimeofday(tp) == 0)
+ return;
+#else /* !GETTIMEOFDAY_NO_TZ */
+ if (gettimeofday(tp, (struct timezone *)NULL) == 0)
+ return;
+#endif /* !GETTIMEOFDAY_NO_TZ */
+#endif /* !HAVE_GETTIMEOFDAY */
+#if defined(HAVE_FTIME)
+ {
+ struct timeb t;
+ ftime(&t);
+ tp->tv_sec = t.time;
+ tp->tv_usec = t.millitm * 1000;
+ }
+#else /* !HAVE_FTIME */
+ tp->tv_sec = time(NULL);
+ tp->tv_usec = 0;
+#endif /* !HAVE_FTIME */
+ return;
+}
+
+void
+_PyTime_Init()
+{
+ /* Do nothing. Needed to force linking. */
+}
diff --git a/Python/symtable.c b/Python/symtable.c
index 376ad2c45a..15ba6b5e2f 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -25,7 +25,7 @@
static PySTEntryObject *
ste_new(struct symtable *st, identifier name, _Py_block_ty block,
- void *key, int lineno)
+ void *key, int lineno, int col_offset)
{
PySTEntryObject *ste = NULL;
PyObject *k;
@@ -38,7 +38,6 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
goto fail;
ste->ste_table = st;
ste->ste_id = k;
- ste->ste_tmpname = 0;
ste->ste_name = name;
Py_INCREF(name);
@@ -66,9 +65,10 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
ste->ste_varargs = 0;
ste->ste_varkeywords = 0;
ste->ste_opt_lineno = 0;
- ste->ste_tmpname = 0;
+ ste->ste_opt_col_offset = 0;
ste->ste_tmpname = 0;
ste->ste_lineno = lineno;
+ ste->ste_col_offset = col_offset;
if (st->st_cur != NULL &&
(st->st_cur->ste_nested ||
@@ -166,7 +166,8 @@ PyTypeObject PySTEntry_Type = {
static int symtable_analyze(struct symtable *st);
static int symtable_warn(struct symtable *st, char *msg, int lineno);
static int symtable_enter_block(struct symtable *st, identifier name,
- _Py_block_ty block, void *ast, int lineno);
+ _Py_block_ty block, void *ast, int lineno,
+ int col_offset);
static int symtable_exit_block(struct symtable *st, void *ast);
static int symtable_visit_stmt(struct symtable *st, stmt_ty s);
static int symtable_visit_expr(struct symtable *st, expr_ty s);
@@ -233,7 +234,7 @@ PySymtable_Build(mod_ty mod, const char *filename, PyFutureFeatures *future)
st->st_future = future;
/* Make the initial symbol information gathering pass */
if (!GET_IDENTIFIER(top) ||
- !symtable_enter_block(st, top, ModuleBlock, (void *)mod, 0)) {
+ !symtable_enter_block(st, top, ModuleBlock, (void *)mod, 0, 0)) {
PySymtable_Free(st);
return NULL;
}
@@ -393,8 +394,8 @@ analyze_name(PySTEntryObject *ste, PyObject *scopes, PyObject *name, long flags,
PyErr_Format(PyExc_SyntaxError,
"name '%U' is parameter and global",
name);
- PyErr_SyntaxLocation(ste->ste_table->st_filename,
- ste->ste_lineno);
+ PyErr_SyntaxLocationEx(ste->ste_table->st_filename,
+ ste->ste_lineno, ste->ste_col_offset);
return 0;
}
@@ -537,8 +538,8 @@ check_unoptimized(const PySTEntryObject* ste) {
break;
}
- PyErr_SyntaxLocation(ste->ste_table->st_filename,
- ste->ste_opt_lineno);
+ PyErr_SyntaxLocationEx(ste->ste_table->st_filename, ste->ste_opt_lineno,
+ ste->ste_opt_col_offset);
return 0;
}
@@ -876,8 +877,8 @@ symtable_warn(struct symtable *st, char *msg, int lineno)
lineno, NULL, NULL) < 0) {
if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) {
PyErr_SetString(PyExc_SyntaxError, msg);
- PyErr_SyntaxLocation(st->st_filename,
- st->st_cur->ste_lineno);
+ PyErr_SyntaxLocationEx(st->st_filename, st->st_cur->ste_lineno,
+ st->st_cur->ste_col_offset);
}
return 0;
}
@@ -910,7 +911,7 @@ symtable_exit_block(struct symtable *st, void *ast)
static int
symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block,
- void *ast, int lineno)
+ void *ast, int lineno, int col_offset)
{
PySTEntryObject *prev = NULL;
@@ -921,7 +922,7 @@ symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block,
}
Py_DECREF(st->st_cur);
}
- st->st_cur = ste_new(st, name, block, ast, lineno);
+ st->st_cur = ste_new(st, name, block, ast, lineno, col_offset);
if (st->st_cur == NULL)
return 0;
if (block == ModuleBlock)
@@ -966,8 +967,9 @@ symtable_add_def(struct symtable *st, PyObject *name, int flag)
if ((flag & DEF_PARAM) && (val & DEF_PARAM)) {
/* Is it better to use 'mangled' or 'name' here? */
PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT, name);
- PyErr_SyntaxLocation(st->st_filename,
- st->st_cur->ste_lineno);
+ PyErr_SyntaxLocationEx(st->st_filename,
+ st->st_cur->ste_lineno,
+ st->st_cur->ste_col_offset);
goto error;
}
val |= flag;
@@ -1100,7 +1102,6 @@ symtable_new_tmpname(struct symtable *st)
}
-
static int
symtable_visit_stmt(struct symtable *st, stmt_ty s)
{
@@ -1118,7 +1119,8 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
if (s->v.FunctionDef.decorator_list)
VISIT_SEQ(st, expr, s->v.FunctionDef.decorator_list);
if (!symtable_enter_block(st, s->v.FunctionDef.name,
- FunctionBlock, (void *)s, s->lineno))
+ FunctionBlock, (void *)s, s->lineno,
+ s->col_offset))
return 0;
VISIT_IN_BLOCK(st, arguments, s->v.FunctionDef.args, s);
VISIT_SEQ_IN_BLOCK(st, stmt, s->v.FunctionDef.body, s);
@@ -1138,7 +1140,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
if (s->v.ClassDef.decorator_list)
VISIT_SEQ(st, expr, s->v.ClassDef.decorator_list);
if (!symtable_enter_block(st, s->v.ClassDef.name, ClassBlock,
- (void *)s, s->lineno))
+ (void *)s, s->lineno, s->col_offset))
return 0;
if (!GET_IDENTIFIER(__class__) ||
!symtable_add_def(st, __class__, DEF_LOCAL) ||
@@ -1162,8 +1164,9 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
if (st->st_cur->ste_generator) {
PyErr_SetString(PyExc_SyntaxError,
RETURN_VAL_IN_GENERATOR);
- PyErr_SyntaxLocation(st->st_filename,
- s->lineno);
+ PyErr_SyntaxLocationEx(st->st_filename,
+ s->lineno,
+ s->col_offset);
return 0;
}
}
@@ -1225,15 +1228,19 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
VISIT_SEQ(st, alias, s->v.Import.names);
/* XXX Don't have the lineno available inside
visit_alias */
- if (st->st_cur->ste_unoptimized && !st->st_cur->ste_opt_lineno)
+ if (st->st_cur->ste_unoptimized && !st->st_cur->ste_opt_lineno) {
st->st_cur->ste_opt_lineno = s->lineno;
+ st->st_cur->ste_opt_col_offset = s->col_offset;
+ }
break;
case ImportFrom_kind:
VISIT_SEQ(st, alias, s->v.ImportFrom.names);
/* XXX Don't have the lineno available inside
visit_alias */
- if (st->st_cur->ste_unoptimized && !st->st_cur->ste_opt_lineno)
+ if (st->st_cur->ste_unoptimized && !st->st_cur->ste_opt_lineno) {
st->st_cur->ste_opt_lineno = s->lineno;
+ st->st_cur->ste_opt_col_offset = s->col_offset;
+ }
break;
case Global_kind: {
int i;
@@ -1298,12 +1305,8 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
/* nothing to do here */
break;
case With_kind:
- if (!symtable_new_tmpname(st))
- return 0;
VISIT(st, expr, s->v.With.context_expr);
if (s->v.With.optional_vars) {
- if (!symtable_new_tmpname(st))
- return 0;
VISIT(st, expr, s->v.With.optional_vars);
}
VISIT_SEQ(st, stmt, s->v.With.body);
@@ -1327,13 +1330,13 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
VISIT(st, expr, e->v.UnaryOp.operand);
break;
case Lambda_kind: {
- if (!GET_IDENTIFIER(lambda) ||
- !symtable_add_def(st, lambda, DEF_LOCAL))
+ if (!GET_IDENTIFIER(lambda))
return 0;
if (e->v.Lambda.args->defaults)
VISIT_SEQ(st, expr, e->v.Lambda.args->defaults);
if (!symtable_enter_block(st, lambda,
- FunctionBlock, (void *)e, e->lineno))
+ FunctionBlock, (void *)e, e->lineno,
+ e->col_offset))
return 0;
VISIT_IN_BLOCK(st, arguments, e->v.Lambda.args, (void*)e);
VISIT_IN_BLOCK(st, expr, e->v.Lambda.body, (void*)e);
@@ -1376,8 +1379,8 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
if (st->st_cur->ste_returns_value) {
PyErr_SetString(PyExc_SyntaxError,
RETURN_VAL_IN_GENERATOR);
- PyErr_SyntaxLocation(st->st_filename,
- e->lineno);
+ PyErr_SyntaxLocationEx(st->st_filename,
+ e->lineno, e->col_offset);
return 0;
}
break;
@@ -1542,7 +1545,7 @@ static int
symtable_visit_alias(struct symtable *st, alias_ty a)
{
/* Compute store_name, the name actually bound by the import
- operation. It is diferent than a->name when a->name is a
+ operation. It is different than a->name when a->name is a
dotted package name (e.g. spam.eggs)
*/
PyObject *store_name;
@@ -1566,8 +1569,9 @@ symtable_visit_alias(struct symtable *st, alias_ty a)
else {
if (st->st_cur->ste_type != ModuleBlock) {
int lineno = st->st_cur->ste_lineno;
+ int col_offset = st->st_cur->ste_col_offset;
PyErr_SetString(PyExc_SyntaxError, IMPORT_STAR_WARNING);
- PyErr_SyntaxLocation(st->st_filename, lineno);
+ PyErr_SyntaxLocationEx(st->st_filename, lineno, col_offset);
Py_DECREF(store_name);
return 0;
}
@@ -1631,7 +1635,8 @@ symtable_handle_comprehension(struct symtable *st, expr_ty e,
VISIT(st, expr, outermost->iter);
/* Create comprehension scope for the rest */
if (!scope_name ||
- !symtable_enter_block(st, scope_name, FunctionBlock, (void *)e, e->lineno)) {
+ !symtable_enter_block(st, scope_name, FunctionBlock, (void *)e,
+ e->lineno, e->col_offset)) {
return 0;
}
st->st_cur->ste_generator = is_generator;
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index c688172dac..73dc0dd592 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -15,10 +15,8 @@ Data members:
*/
#include "Python.h"
-#include "structseq.h"
#include "code.h"
#include "frameobject.h"
-#include "eval.h"
#include "osdefs.h"
@@ -67,6 +65,68 @@ PySys_SetObject(const char *name, PyObject *v)
return PyDict_SetItemString(sd, name, v);
}
+/* Write repr(o) to sys.stdout using sys.stdout.encoding and 'backslashreplace'
+ error handler. If sys.stdout has a buffer attribute, use
+ sys.stdout.buffer.write(encoded), otherwise redecode the string and use
+ sys.stdout.write(redecoded).
+
+ Helper function for sys_displayhook(). */
+static int
+sys_displayhook_unencodable(PyObject *outf, PyObject *o)
+{
+ PyObject *stdout_encoding = NULL;
+ PyObject *encoded, *escaped_str, *repr_str, *buffer, *result;
+ char *stdout_encoding_str;
+ int ret;
+
+ stdout_encoding = PyObject_GetAttrString(outf, "encoding");
+ if (stdout_encoding == NULL)
+ goto error;
+ stdout_encoding_str = _PyUnicode_AsString(stdout_encoding);
+ if (stdout_encoding_str == NULL)
+ goto error;
+
+ repr_str = PyObject_Repr(o);
+ if (repr_str == NULL)
+ goto error;
+ encoded = PyUnicode_AsEncodedString(repr_str,
+ stdout_encoding_str,
+ "backslashreplace");
+ Py_DECREF(repr_str);
+ if (encoded == NULL)
+ goto error;
+
+ buffer = PyObject_GetAttrString(outf, "buffer");
+ if (buffer) {
+ result = PyObject_CallMethod(buffer, "write", "(O)", encoded);
+ Py_DECREF(buffer);
+ Py_DECREF(encoded);
+ if (result == NULL)
+ goto error;
+ Py_DECREF(result);
+ }
+ else {
+ PyErr_Clear();
+ escaped_str = PyUnicode_FromEncodedObject(encoded,
+ stdout_encoding_str,
+ "strict");
+ Py_DECREF(encoded);
+ if (PyFile_WriteObject(escaped_str, outf, Py_PRINT_RAW) != 0) {
+ Py_DECREF(escaped_str);
+ goto error;
+ }
+ Py_DECREF(escaped_str);
+ }
+ ret = 0;
+ goto finally;
+
+error:
+ ret = -1;
+finally:
+ Py_XDECREF(stdout_encoding);
+ return ret;
+}
+
static PyObject *
sys_displayhook(PyObject *self, PyObject *o)
{
@@ -74,6 +134,7 @@ sys_displayhook(PyObject *self, PyObject *o)
PyInterpreterState *interp = PyThreadState_GET()->interp;
PyObject *modules = interp->modules;
PyObject *builtins = PyDict_GetItemString(modules, "builtins");
+ int err;
if (builtins == NULL) {
PyErr_SetString(PyExc_RuntimeError, "lost builtins module");
@@ -94,8 +155,19 @@ sys_displayhook(PyObject *self, PyObject *o)
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
return NULL;
}
- if (PyFile_WriteObject(o, outf, 0) != 0)
- return NULL;
+ if (PyFile_WriteObject(o, outf, 0) != 0) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) {
+ /* repr(o) is not encodable to sys.stdout.encoding with
+ * sys.stdout.errors error handler (which is probably 'strict') */
+ PyErr_Clear();
+ err = sys_displayhook_unencodable(outf, o);
+ if (err)
+ return NULL;
+ }
+ else {
+ return NULL;
+ }
+ }
if (PyFile_WriteString("\n", outf) != 0)
return NULL;
if (PyObject_SetAttrString(builtins, "_", o) != 0)
@@ -183,30 +255,13 @@ implementation."
);
static PyObject *
-sys_setdefaultencoding(PyObject *self, PyObject *args)
-{
- char *encoding;
- if (!PyArg_ParseTuple(args, "s:setdefaultencoding", &encoding))
- return NULL;
- if (PyUnicode_SetDefaultEncoding(encoding))
- return NULL;
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-PyDoc_STRVAR(setdefaultencoding_doc,
-"setdefaultencoding(encoding)\n\
-\n\
-Set the current default string encoding used by the Unicode implementation."
-);
-
-static PyObject *
sys_getfilesystemencoding(PyObject *self)
{
if (Py_FileSystemDefaultEncoding)
return PyUnicode_FromString(Py_FileSystemDefaultEncoding);
- Py_INCREF(Py_None);
- return Py_None;
+ PyErr_SetString(PyExc_RuntimeError,
+ "filesystem encoding is not initialized");
+ return NULL;
}
PyDoc_STRVAR(getfilesystemencoding_doc,
@@ -217,25 +272,6 @@ operating system filenames."
);
static PyObject *
-sys_setfilesystemencoding(PyObject *self, PyObject *args)
-{
- PyObject *new_encoding;
- if (!PyArg_ParseTuple(args, "U:setfilesystemencoding", &new_encoding))
- return NULL;
- if (_Py_SetFileSystemEncoding(new_encoding))
- return NULL;
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-PyDoc_STRVAR(setfilesystemencoding_doc,
-"setfilesystemencoding(string) -> None\n\
-\n\
-Set the encoding used to convert Unicode filenames in\n\
-operating system filenames."
-);
-
-static PyObject *
sys_intern(PyObject *self, PyObject *args)
{
PyObject *s;
@@ -448,10 +484,17 @@ Return the profiling function set with sys.setprofile.\n\
See the profiler chapter in the library manual."
);
+static int _check_interval = 100;
+
static PyObject *
sys_setcheckinterval(PyObject *self, PyObject *args)
{
- if (!PyArg_ParseTuple(args, "i:setcheckinterval", &_Py_CheckInterval))
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "sys.getcheckinterval() and sys.setcheckinterval() "
+ "are deprecated. Use sys.setswitchinterval() "
+ "instead.", 1) < 0)
+ return NULL;
+ if (!PyArg_ParseTuple(args, "i:setcheckinterval", &_check_interval))
return NULL;
Py_INCREF(Py_None);
return Py_None;
@@ -467,13 +510,59 @@ n instructions. This also affects how often thread switches occur."
static PyObject *
sys_getcheckinterval(PyObject *self, PyObject *args)
{
- return PyLong_FromLong(_Py_CheckInterval);
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "sys.getcheckinterval() and sys.setcheckinterval() "
+ "are deprecated. Use sys.getswitchinterval() "
+ "instead.", 1) < 0)
+ return NULL;
+ return PyLong_FromLong(_check_interval);
}
PyDoc_STRVAR(getcheckinterval_doc,
"getcheckinterval() -> current check interval; see setcheckinterval()."
);
+#ifdef WITH_THREAD
+static PyObject *
+sys_setswitchinterval(PyObject *self, PyObject *args)
+{
+ double d;
+ if (!PyArg_ParseTuple(args, "d:setswitchinterval", &d))
+ return NULL;
+ if (d <= 0.0) {
+ PyErr_SetString(PyExc_ValueError,
+ "switch interval must be strictly positive");
+ return NULL;
+ }
+ _PyEval_SetSwitchInterval((unsigned long) (1e6 * d));
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+PyDoc_STRVAR(setswitchinterval_doc,
+"setswitchinterval(n)\n\
+\n\
+Set the ideal thread switching delay inside the Python interpreter\n\
+The actual frequency of switching threads can be lower if the\n\
+interpreter executes long sequences of uninterruptible code\n\
+(this is implementation-specific and workload-dependent).\n\
+\n\
+The parameter must represent the desired switching delay in seconds\n\
+A typical value is 0.005 (5 milliseconds)."
+);
+
+static PyObject *
+sys_getswitchinterval(PyObject *self, PyObject *args)
+{
+ return PyFloat_FromDouble(1e-6 * _PyEval_GetSwitchInterval());
+}
+
+PyDoc_STRVAR(getswitchinterval_doc,
+"getswitchinterval() -> current thread switch interval; see setswitchinterval()."
+);
+
+#endif /* WITH_THREAD */
+
#ifdef WITH_TSC
static PyObject *
sys_settscdump(PyObject *self, PyObject *args)
@@ -517,6 +606,57 @@ sys_setrecursionlimit(PyObject *self, PyObject *args)
return Py_None;
}
+static PyTypeObject Hash_InfoType;
+
+PyDoc_STRVAR(hash_info_doc,
+"hash_info\n\
+\n\
+A struct sequence providing parameters used for computing\n\
+numeric hashes. The attributes are read only.");
+
+static PyStructSequence_Field hash_info_fields[] = {
+ {"width", "width of the type used for hashing, in bits"},
+ {"modulus", "prime number giving the modulus on which the hash "
+ "function is based"},
+ {"inf", "value to be used for hash of a positive infinity"},
+ {"nan", "value to be used for hash of a nan"},
+ {"imag", "multiplier used for the imaginary part of a complex number"},
+ {NULL, NULL}
+};
+
+static PyStructSequence_Desc hash_info_desc = {
+ "sys.hash_info",
+ hash_info_doc,
+ hash_info_fields,
+ 5,
+};
+
+static PyObject *
+get_hash_info(void)
+{
+ PyObject *hash_info;
+ int field = 0;
+ hash_info = PyStructSequence_New(&Hash_InfoType);
+ if (hash_info == NULL)
+ return NULL;
+ PyStructSequence_SET_ITEM(hash_info, field++,
+ PyLong_FromLong(8*sizeof(Py_hash_t)));
+ PyStructSequence_SET_ITEM(hash_info, field++,
+ PyLong_FromSsize_t(_PyHASH_MODULUS));
+ PyStructSequence_SET_ITEM(hash_info, field++,
+ PyLong_FromLong(_PyHASH_INF));
+ PyStructSequence_SET_ITEM(hash_info, field++,
+ PyLong_FromLong(_PyHASH_NAN));
+ PyStructSequence_SET_ITEM(hash_info, field++,
+ PyLong_FromLong(_PyHASH_IMAG));
+ if (PyErr_Occurred()) {
+ Py_CLEAR(hash_info);
+ return NULL;
+ }
+ return hash_info;
+}
+
+
PyDoc_STRVAR(setrecursionlimit_doc,
"setrecursionlimit(n)\n\
\n\
@@ -544,26 +684,65 @@ recursion from causing an overflow of the C stack and crashing Python."
PyDoc_STRVAR(getwindowsversion_doc,
"getwindowsversion()\n\
\n\
-Return information about the running version of Windows.\n\
-The result is a tuple of (major, minor, build, platform, text)\n\
-All elements are numbers, except text which is a string.\n\
-Platform may be 0 for win32s, 1 for Windows 9x/ME, 2 for Windows NT/2000/XP\n\
-"
+Return information about the running version of Windows as a named tuple.\n\
+The members are named: major, minor, build, platform, service_pack,\n\
+service_pack_major, service_pack_minor, suite_mask, and product_type. For\n\
+backward compatibility, only the first 5 items are available by indexing.\n\
+All elements are numbers, except service_pack which is a string. Platform\n\
+may be 0 for win32s, 1 for Windows 9x/ME, 2 for Windows NT/2000/XP/Vista/7,\n\
+3 for Windows CE. Product_type may be 1 for a workstation, 2 for a domain\n\
+controller, 3 for a server."
);
+static PyTypeObject WindowsVersionType = {0, 0, 0, 0, 0, 0};
+
+static PyStructSequence_Field windows_version_fields[] = {
+ {"major", "Major version number"},
+ {"minor", "Minor version number"},
+ {"build", "Build number"},
+ {"platform", "Operating system platform"},
+ {"service_pack", "Latest Service Pack installed on the system"},
+ {"service_pack_major", "Service Pack major version number"},
+ {"service_pack_minor", "Service Pack minor version number"},
+ {"suite_mask", "Bit mask identifying available product suites"},
+ {"product_type", "System product type"},
+ {0}
+};
+
+static PyStructSequence_Desc windows_version_desc = {
+ "sys.getwindowsversion", /* name */
+ getwindowsversion_doc, /* doc */
+ windows_version_fields, /* fields */
+ 5 /* For backward compatibility,
+ only the first 5 items are accessible
+ via indexing, the rest are name only */
+};
+
static PyObject *
sys_getwindowsversion(PyObject *self)
{
- OSVERSIONINFO ver;
+ PyObject *version;
+ int pos = 0;
+ OSVERSIONINFOEX ver;
ver.dwOSVersionInfoSize = sizeof(ver);
- if (!GetVersionEx(&ver))
+ if (!GetVersionEx((OSVERSIONINFO*) &ver))
return PyErr_SetFromWindowsErr(0);
- return Py_BuildValue("HHHHs",
- ver.dwMajorVersion,
- ver.dwMinorVersion,
- ver.dwBuildNumber,
- ver.dwPlatformId,
- ver.szCSDVersion);
+
+ version = PyStructSequence_New(&WindowsVersionType);
+ if (version == NULL)
+ return NULL;
+
+ PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.dwMajorVersion));
+ PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.dwMinorVersion));
+ PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.dwBuildNumber));
+ PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.dwPlatformId));
+ PyStructSequence_SET_ITEM(version, pos++, PyUnicode_FromString(ver.szCSDVersion));
+ PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wServicePackMajor));
+ PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wServicePackMinor));
+ PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wSuiteMask));
+ PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wProductType));
+
+ return version;
}
#endif /* MS_WINDOWS */
@@ -887,14 +1066,16 @@ static PyMethodDef sys_methods[] = {
#ifdef USE_MALLOPT
{"mdebug", sys_mdebug, METH_VARARGS},
#endif
- {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS,
- setdefaultencoding_doc},
- {"setfilesystemencoding", sys_setfilesystemencoding, METH_VARARGS,
- setfilesystemencoding_doc},
{"setcheckinterval", sys_setcheckinterval, METH_VARARGS,
setcheckinterval_doc},
{"getcheckinterval", sys_getcheckinterval, METH_NOARGS,
getcheckinterval_doc},
+#ifdef WITH_THREAD
+ {"setswitchinterval", sys_setswitchinterval, METH_VARARGS,
+ setswitchinterval_doc},
+ {"getswitchinterval", sys_getswitchinterval, METH_NOARGS,
+ getswitchinterval_doc},
+#endif
#ifdef HAVE_DLOPEN
{"setdlopenflags", sys_setdlopenflags, METH_VARARGS,
setdlopenflags_doc},
@@ -950,21 +1131,26 @@ PySys_ResetWarnOptions(void)
}
void
-PySys_AddWarnOption(const wchar_t *s)
+PySys_AddWarnOptionUnicode(PyObject *unicode)
{
- PyObject *str;
-
if (warnoptions == NULL || !PyList_Check(warnoptions)) {
Py_XDECREF(warnoptions);
warnoptions = PyList_New(0);
if (warnoptions == NULL)
return;
}
- str = PyUnicode_FromWideChar(s, -1);
- if (str != NULL) {
- PyList_Append(warnoptions, str);
- Py_DECREF(str);
- }
+ PyList_Append(warnoptions, unicode);
+}
+
+void
+PySys_AddWarnOption(const wchar_t *s)
+{
+ PyObject *unicode;
+ unicode = PyUnicode_FromWideChar(s, -1);
+ if (unicode == NULL)
+ return;
+ PySys_AddWarnOptionUnicode(unicode);
+ Py_DECREF(unicode);
}
int
@@ -973,6 +1159,61 @@ PySys_HasWarnOptions(void)
return (warnoptions != NULL && (PyList_Size(warnoptions) > 0)) ? 1 : 0;
}
+static PyObject *xoptions = NULL;
+
+static PyObject *
+get_xoptions(void)
+{
+ if (xoptions == NULL || !PyDict_Check(xoptions)) {
+ Py_XDECREF(xoptions);
+ xoptions = PyDict_New();
+ }
+ return xoptions;
+}
+
+void
+PySys_AddXOption(const wchar_t *s)
+{
+ PyObject *opts;
+ PyObject *name = NULL, *value = NULL;
+ const wchar_t *name_end;
+ int r;
+
+ opts = get_xoptions();
+ if (opts == NULL)
+ goto error;
+
+ name_end = wcschr(s, L'=');
+ if (!name_end) {
+ name = PyUnicode_FromWideChar(s, -1);
+ value = Py_True;
+ Py_INCREF(value);
+ }
+ else {
+ name = PyUnicode_FromWideChar(s, name_end - s);
+ value = PyUnicode_FromWideChar(name_end + 1, -1);
+ }
+ if (name == NULL || value == NULL)
+ goto error;
+ r = PyDict_SetItem(opts, name, value);
+ Py_DECREF(name);
+ Py_DECREF(value);
+ return;
+
+error:
+ Py_XDECREF(name);
+ Py_XDECREF(value);
+ /* No return value, therefore clear error state if possible */
+ if (_Py_atomic_load_relaxed(&_PyThreadState_Current))
+ PyErr_Clear();
+}
+
+PyObject *
+PySys_GetXOptions(void)
+{
+ return get_xoptions();
+}
+
/* XXX This doc string is too long to be a single string literal in VC++ 5.0.
Two literals concatenated works just fine. If you have a K&R compiler
or other abomination that however *does* understand longer strings,
@@ -1125,7 +1366,8 @@ static PyStructSequence_Field flags_fields[] = {
#endif
/* {"unbuffered", "-u"}, */
/* {"skip_first", "-x"}, */
- {"bytes_warning", "-b"},
+ {"bytes_warning", "-b"},
+ {"quiet", "-q"},
{0}
};
@@ -1134,9 +1376,9 @@ static PyStructSequence_Desc flags_desc = {
flags__doc__, /* doc */
flags_fields, /* fields */
#ifdef RISCOS
- 12
+ 13
#else
- 11
+ 12
#endif
};
@@ -1169,6 +1411,7 @@ make_flags(void)
/* SetFlag(saw_unbuffered_flag); */
/* SetFlag(skipfirstline); */
SetFlag(Py_BytesWarningFlag);
+ SetFlag(Py_QuietFlag);
#undef SetFlag
if (PyErr_Occurred()) {
@@ -1304,7 +1547,7 @@ _PySys_Init(void)
PyLong_FromLong(PY_VERSION_HEX));
svnversion_init();
SET_SYS_FROM_STRING("subversion",
- Py_BuildValue("(UUU)", "CPython", branch,
+ Py_BuildValue("(sss)", "CPython", branch,
svn_revision));
SET_SYS_FROM_STRING("_mercurial",
Py_BuildValue("(szz)", "CPython", _Py_hgidentifier(),
@@ -1330,6 +1573,11 @@ _PySys_Init(void)
PyFloat_GetInfo());
SET_SYS_FROM_STRING("int_info",
PyLong_GetInfo());
+ /* initialize hash_info */
+ if (Hash_InfoType.tp_name == 0)
+ PyStructSequence_InitType(&Hash_InfoType, &hash_info_desc);
+ SET_SYS_FROM_STRING("hash_info",
+ get_hash_info());
SET_SYS_FROM_STRING("maxunicode",
PyLong_FromLong(PyUnicode_GetMax()));
SET_SYS_FROM_STRING("builtin_module_names",
@@ -1354,6 +1602,10 @@ _PySys_Init(void)
SET_SYS_FROM_STRING("winver",
PyUnicode_FromString(PyWin_DLLVersionString));
#endif
+#ifdef ABIFLAGS
+ SET_SYS_FROM_STRING("abiflags",
+ PyUnicode_FromString(ABIFLAGS));
+#endif
if (warnoptions == NULL) {
warnoptions = PyList_New(0);
}
@@ -1364,6 +1616,11 @@ _PySys_Init(void)
PyDict_SetItemString(sysdict, "warnoptions", warnoptions);
}
+ v = get_xoptions();
+ if (v != NULL) {
+ PyDict_SetItemString(sysdict, "_xoptions", v);
+ }
+
/* version_info */
if (VersionInfoType.tp_name == 0)
PyStructSequence_InitType(&VersionInfoType, &version_info_desc);
@@ -1380,6 +1637,16 @@ _PySys_Init(void)
FlagsType.tp_init = NULL;
FlagsType.tp_new = NULL;
+
+#if defined(MS_WINDOWS)
+ /* getwindowsversion */
+ if (WindowsVersionType.tp_name == 0)
+ PyStructSequence_InitType(&WindowsVersionType, &windows_version_desc);
+ /* prevent user from creating new instances */
+ WindowsVersionType.tp_init = NULL;
+ WindowsVersionType.tp_new = NULL;
+#endif
+
/* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */
#ifndef PY_NO_SHORT_FLOAT_REPR
SET_SYS_FROM_STRING("float_repr_style",
@@ -1480,130 +1747,122 @@ makeargvobject(int argc, wchar_t **argv)
return av;
}
-#ifdef HAVE_REALPATH
-static wchar_t*
-_wrealpath(const wchar_t *path, wchar_t *resolved_path)
-{
- char cpath[PATH_MAX];
- char cresolved_path[PATH_MAX];
- char *res;
- size_t r;
- r = wcstombs(cpath, path, PATH_MAX);
- if (r == (size_t)-1 || r >= PATH_MAX) {
- errno = EINVAL;
- return NULL;
- }
- res = realpath(cpath, cresolved_path);
- if (res == NULL)
- return NULL;
- r = mbstowcs(resolved_path, cresolved_path, PATH_MAX);
- if (r == (size_t)-1 || r >= PATH_MAX) {
- errno = EINVAL;
- return NULL;
- }
- return resolved_path;
-}
-#endif
+#define _HAVE_SCRIPT_ARGUMENT(argc, argv) \
+ (argc > 0 && argv0 != NULL && \
+ wcscmp(argv0, L"-c") != 0 && wcscmp(argv0, L"-m") != 0)
-void
-PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
+static void
+sys_update_path(int argc, wchar_t **argv)
{
+ wchar_t *argv0;
+ wchar_t *p = NULL;
+ Py_ssize_t n = 0;
+ PyObject *a;
+ PyObject *path;
+#ifdef HAVE_READLINK
+ wchar_t link[MAXPATHLEN+1];
+ wchar_t argv0copy[2*MAXPATHLEN+1];
+ int nr = 0;
+#endif
#if defined(HAVE_REALPATH)
wchar_t fullpath[MAXPATHLEN];
#elif defined(MS_WINDOWS) && !defined(MS_WINCE)
wchar_t fullpath[MAX_PATH];
#endif
- PyObject *av = makeargvobject(argc, argv);
- PyObject *path = PySys_GetObject("path");
- if (av == NULL)
- Py_FatalError("no mem for sys.argv");
- if (PySys_SetObject("argv", av) != 0)
- Py_FatalError("can't assign sys.argv");
- if (updatepath && path != NULL) {
- wchar_t *argv0 = argv[0];
- wchar_t *p = NULL;
- Py_ssize_t n = 0;
- PyObject *a;
- extern int _Py_wreadlink(const wchar_t *, wchar_t *, size_t);
+
+ path = PySys_GetObject("path");
+ if (path == NULL)
+ return;
+
+ argv0 = argv[0];
+
#ifdef HAVE_READLINK
- wchar_t link[MAXPATHLEN+1];
- wchar_t argv0copy[2*MAXPATHLEN+1];
- int nr = 0;
- if (argc > 0 && argv0 != NULL && wcscmp(argv0, L"-c") != 0)
- nr = _Py_wreadlink(argv0, link, MAXPATHLEN);
- if (nr > 0) {
- /* It's a symlink */
- link[nr] = '\0';
- if (link[0] == SEP)
- argv0 = link; /* Link to absolute path */
- else if (wcschr(link, SEP) == NULL)
- ; /* Link without path */
+ if (_HAVE_SCRIPT_ARGUMENT(argc, argv))
+ nr = _Py_wreadlink(argv0, link, MAXPATHLEN);
+ if (nr > 0) {
+ /* It's a symlink */
+ link[nr] = '\0';
+ if (link[0] == SEP)
+ argv0 = link; /* Link to absolute path */
+ else if (wcschr(link, SEP) == NULL)
+ ; /* Link without path */
+ else {
+ /* Must join(dirname(argv0), link) */
+ wchar_t *q = wcsrchr(argv0, SEP);
+ if (q == NULL)
+ argv0 = link; /* argv0 without path */
else {
- /* Must join(dirname(argv0), link) */
- wchar_t *q = wcsrchr(argv0, SEP);
- if (q == NULL)
- argv0 = link; /* argv0 without path */
- else {
- /* Must make a copy */
- wcscpy(argv0copy, argv0);
- q = wcsrchr(argv0copy, SEP);
- wcscpy(q+1, link);
- argv0 = argv0copy;
- }
+ /* Must make a copy */
+ wcscpy(argv0copy, argv0);
+ q = wcsrchr(argv0copy, SEP);
+ wcscpy(q+1, link);
+ argv0 = argv0copy;
}
}
+ }
#endif /* HAVE_READLINK */
#if SEP == '\\' /* Special case for MS filename syntax */
- if (argc > 0 && argv0 != NULL && wcscmp(argv0, L"-c") != 0) {
- wchar_t *q;
+ if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) {
+ wchar_t *q;
#if defined(MS_WINDOWS) && !defined(MS_WINCE)
- /* This code here replaces the first element in argv with the full
- path that it represents. Under CE, there are no relative paths so
- the argument must be the full path anyway. */
- wchar_t *ptemp;
- if (GetFullPathNameW(argv0,
- sizeof(fullpath)/sizeof(fullpath[0]),
- fullpath,
- &ptemp)) {
- argv0 = fullpath;
- }
+ /* This code here replaces the first element in argv with the full
+ path that it represents. Under CE, there are no relative paths so
+ the argument must be the full path anyway. */
+ wchar_t *ptemp;
+ if (GetFullPathNameW(argv0,
+ sizeof(fullpath)/sizeof(fullpath[0]),
+ fullpath,
+ &ptemp)) {
+ argv0 = fullpath;
+ }
#endif
- p = wcsrchr(argv0, SEP);
- /* Test for alternate separator */
- q = wcsrchr(p ? p : argv0, '/');
- if (q != NULL)
- p = q;
- if (p != NULL) {
- n = p + 1 - argv0;
- if (n > 1 && p[-1] != ':')
- n--; /* Drop trailing separator */
- }
+ p = wcsrchr(argv0, SEP);
+ /* Test for alternate separator */
+ q = wcsrchr(p ? p : argv0, '/');
+ if (q != NULL)
+ p = q;
+ if (p != NULL) {
+ n = p + 1 - argv0;
+ if (n > 1 && p[-1] != ':')
+ n--; /* Drop trailing separator */
}
+ }
#else /* All other filename syntaxes */
- if (argc > 0 && argv0 != NULL && wcscmp(argv0, L"-c") != 0) {
+ if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) {
#if defined(HAVE_REALPATH)
- if (_wrealpath(argv0, fullpath)) {
- argv0 = fullpath;
- }
-#endif
- p = wcsrchr(argv0, SEP);
+ if (_Py_wrealpath(argv0, fullpath, PATH_MAX)) {
+ argv0 = fullpath;
}
- if (p != NULL) {
- n = p + 1 - argv0;
+#endif
+ p = wcsrchr(argv0, SEP);
+ }
+ if (p != NULL) {
+ n = p + 1 - argv0;
#if SEP == '/' /* Special case for Unix filename syntax */
- if (n > 1)
- n--; /* Drop trailing separator */
+ if (n > 1)
+ n--; /* Drop trailing separator */
#endif /* Unix */
- }
-#endif /* All others */
- a = PyUnicode_FromWideChar(argv0, n);
- if (a == NULL)
- Py_FatalError("no mem for sys.path insertion");
- if (PyList_Insert(path, 0, a) < 0)
- Py_FatalError("sys.path.insert(0) failed");
- Py_DECREF(a);
}
+#endif /* All others */
+ a = PyUnicode_FromWideChar(argv0, n);
+ if (a == NULL)
+ Py_FatalError("no mem for sys.path insertion");
+ if (PyList_Insert(path, 0, a) < 0)
+ Py_FatalError("sys.path.insert(0) failed");
+ Py_DECREF(a);
+}
+
+void
+PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
+{
+ PyObject *av = makeargvobject(argc, argv);
+ if (av == NULL)
+ Py_FatalError("no mem for sys.argv");
+ if (PySys_SetObject("argv", av) != 0)
+ Py_FatalError("can't assign sys.argv");
Py_DECREF(av);
+ if (updatepath)
+ sys_update_path(argc, argv);
}
void
@@ -1616,18 +1875,14 @@ PySys_SetArgv(int argc, wchar_t **argv)
PyErr_CheckSignals(): avoid the call to PyObject_Str(). */
static int
-sys_pyfile_write(const char *text, PyObject *file)
+sys_pyfile_write_unicode(PyObject *unicode, PyObject *file)
{
- PyObject *unicode = NULL, *writer = NULL, *args = NULL, *result = NULL;
+ PyObject *writer = NULL, *args = NULL, *result = NULL;
int err;
if (file == NULL)
return -1;
- unicode = PyUnicode_FromString(text);
- if (unicode == NULL)
- goto error;
-
writer = PyObject_GetAttrString(file, "write");
if (writer == NULL)
goto error;
@@ -1647,13 +1902,29 @@ sys_pyfile_write(const char *text, PyObject *file)
error:
err = -1;
finally:
- Py_XDECREF(unicode);
Py_XDECREF(writer);
Py_XDECREF(args);
Py_XDECREF(result);
return err;
}
+static int
+sys_pyfile_write(const char *text, PyObject *file)
+{
+ PyObject *unicode = NULL;
+ int err;
+
+ if (file == NULL)
+ return -1;
+
+ unicode = PyUnicode_FromString(text);
+ if (unicode == NULL)
+ return -1;
+
+ err = sys_pyfile_write_unicode(unicode, file);
+ Py_DECREF(unicode);
+ return err;
+}
/* APIs to write to sys.stdout or sys.stderr using a printf-like interface.
Adapted from code submitted by Just van Rossum.
@@ -1666,8 +1937,8 @@ finally:
no exceptions are raised.
PyErr_CheckSignals() is not called to avoid the execution of the Python
- signal handlers: they may raise a new exception whereas mywrite() ignores
- all exceptions.
+ signal handlers: they may raise a new exception whereas sys_write()
+ ignores all exceptions.
Both take a printf-style format string as their first argument followed
by a variable length argument list determined by the format string.
@@ -1684,7 +1955,7 @@ finally:
*/
static void
-mywrite(char *name, FILE *fp, const char *format, va_list va)
+sys_write(char *name, FILE *fp, const char *format, va_list va)
{
PyObject *file;
PyObject *error_type, *error_value, *error_traceback;
@@ -1700,10 +1971,8 @@ mywrite(char *name, FILE *fp, const char *format, va_list va)
}
if (written < 0 || (size_t)written >= sizeof(buffer)) {
const char *truncated = "... truncated";
- if (sys_pyfile_write(truncated, file) != 0) {
- PyErr_Clear();
+ if (sys_pyfile_write(truncated, file) != 0)
fputs(truncated, fp);
- }
}
PyErr_Restore(error_type, error_value, error_traceback);
}
@@ -1714,7 +1983,7 @@ PySys_WriteStdout(const char *format, ...)
va_list va;
va_start(va, format);
- mywrite("stdout", stdout, format, va);
+ sys_write("stdout", stdout, format, va);
va_end(va);
}
@@ -1724,6 +1993,48 @@ PySys_WriteStderr(const char *format, ...)
va_list va;
va_start(va, format);
- mywrite("stderr", stderr, format, va);
+ sys_write("stderr", stderr, format, va);
+ va_end(va);
+}
+
+static void
+sys_format(char *name, FILE *fp, const char *format, va_list va)
+{
+ PyObject *file, *message;
+ PyObject *error_type, *error_value, *error_traceback;
+ char *utf8;
+
+ PyErr_Fetch(&error_type, &error_value, &error_traceback);
+ file = PySys_GetObject(name);
+ message = PyUnicode_FromFormatV(format, va);
+ if (message != NULL) {
+ if (sys_pyfile_write_unicode(message, file) != 0) {
+ PyErr_Clear();
+ utf8 = _PyUnicode_AsString(message);
+ if (utf8 != NULL)
+ fputs(utf8, fp);
+ }
+ Py_DECREF(message);
+ }
+ PyErr_Restore(error_type, error_value, error_traceback);
+}
+
+void
+PySys_FormatStdout(const char *format, ...)
+{
+ va_list va;
+
+ va_start(va, format);
+ sys_format("stdout", stdout, format, va);
+ va_end(va);
+}
+
+void
+PySys_FormatStderr(const char *format, ...)
+{
+ va_list va;
+
+ va_start(va, format);
+ sys_format("stderr", stderr, format, va);
va_end(va);
}
diff --git a/Python/thread.c b/Python/thread.c
index 4a9b4368ac..d224046e64 100644
--- a/Python/thread.c
+++ b/Python/thread.c
@@ -23,12 +23,6 @@
#include <stdlib.h>
-#ifdef __sgi
-#ifndef HAVE_PTHREAD_H /* XXX Need to check in configure.in */
-#undef _POSIX_THREADS
-#endif
-#endif
-
#include "pythread.h"
#ifndef _POSIX_THREADS
@@ -101,6 +95,7 @@ PyThread_init_thread(void)
static size_t _pythread_stacksize = 0;
#ifdef SGI_THREADS
+#error SGI Irix threads are now unsupported, and code will be removed in 3.3.
#include "thread_sgi.h"
#endif
@@ -109,10 +104,12 @@ static size_t _pythread_stacksize = 0;
#endif
#ifdef SUN_LWP
+#error SunOS lightweight processes are now unsupported, and code will be removed in 3.3.
#include "thread_lwp.h"
#endif
#ifdef HAVE_PTH
+#error GNU pth threads are now unsupported, and code will be removed in 3.3.
#include "thread_pth.h"
#undef _POSIX_THREADS
#endif
@@ -122,6 +119,7 @@ static size_t _pythread_stacksize = 0;
#endif
#ifdef C_THREADS
+#error Mach C Threads are now unsupported, and code will be removed in 3.3.
#include "thread_cthread.h"
#endif
@@ -137,10 +135,6 @@ static size_t _pythread_stacksize = 0;
#include "thread_plan9.h"
#endif
-#ifdef ATHEOS_THREADS
-#include "thread_atheos.h"
-#endif
-
/*
#ifdef FOOBAR_THREADS
#include "thread_foobar.h"
diff --git a/Python/thread_atheos.h b/Python/thread_atheos.h
deleted file mode 100644
index c390b57d4a..0000000000
--- a/Python/thread_atheos.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/* Threading for AtheOS.
- Based on thread_beos.h. */
-
-#include <atheos/threads.h>
-#include <atheos/semaphore.h>
-#include <atheos/atomic.h>
-#include <errno.h>
-#include <string.h>
-
-/* Missing decl from threads.h */
-extern int exit_thread(int);
-
-
-/* Undefine FASTLOCK to play with simple semaphores. */
-#define FASTLOCK
-
-
-#ifdef FASTLOCK
-
-/* Use an atomic counter and a semaphore for maximum speed. */
-typedef struct fastmutex {
- sem_id sem;
- atomic_t count;
-} fastmutex_t;
-
-
-static int fastmutex_create(const char *name, fastmutex_t * mutex);
-static int fastmutex_destroy(fastmutex_t * mutex);
-static int fastmutex_lock(fastmutex_t * mutex);
-static int fastmutex_timedlock(fastmutex_t * mutex, bigtime_t timeout);
-static int fastmutex_unlock(fastmutex_t * mutex);
-
-
-static int fastmutex_create(const char *name, fastmutex_t * mutex)
-{
- mutex->count = 0;
- mutex->sem = create_semaphore(name, 0, 0);
- return (mutex->sem < 0) ? -1 : 0;
-}
-
-
-static int fastmutex_destroy(fastmutex_t * mutex)
-{
- if (fastmutex_timedlock(mutex, 0) == 0 || errno == EWOULDBLOCK) {
- return delete_semaphore(mutex->sem);
- }
- return 0;
-}
-
-
-static int fastmutex_lock(fastmutex_t * mutex)
-{
- atomic_t prev = atomic_add(&mutex->count, 1);
- if (prev > 0)
- return lock_semaphore(mutex->sem);
- return 0;
-}
-
-
-static int fastmutex_timedlock(fastmutex_t * mutex, bigtime_t timeout)
-{
- atomic_t prev = atomic_add(&mutex->count, 1);
- if (prev > 0)
- return lock_semaphore_x(mutex->sem, 1, 0, timeout);
- return 0;
-}
-
-
-static int fastmutex_unlock(fastmutex_t * mutex)
-{
- atomic_t prev = atomic_add(&mutex->count, -1);
- if (prev > 1)
- return unlock_semaphore(mutex->sem);
- return 0;
-}
-
-
-#endif /* FASTLOCK */
-
-
-/*
- * Initialization.
- *
- */
-static void PyThread__init_thread(void)
-{
- /* Do nothing. */
- return;
-}
-
-
-/*
- * Thread support.
- *
- */
-
-static atomic_t thread_count = 0;
-
-long PyThread_start_new_thread(void (*func) (void *), void *arg)
-{
- status_t success = -1;
- thread_id tid;
- char name[OS_NAME_LENGTH];
- atomic_t this_thread;
-
- dprintf(("PyThread_start_new_thread called\n"));
-
- this_thread = atomic_add(&thread_count, 1);
- PyOS_snprintf(name, sizeof(name), "python thread (%d)", this_thread);
-
- tid = spawn_thread(name, func, NORMAL_PRIORITY, 0, arg);
- if (tid < 0) {
- dprintf(("PyThread_start_new_thread spawn_thread failed: %s\n", strerror(errno)));
- } else {
- success = resume_thread(tid);
- if (success < 0) {
- dprintf(("PyThread_start_new_thread resume_thread failed: %s\n", strerror(errno)));
- }
- }
-
- return (success < 0 ? -1 : tid);
-}
-
-
-long PyThread_get_thread_ident(void)
-{
- return get_thread_id(NULL);
-}
-
-
-static void do_PyThread_exit_thread(int no_cleanup)
-{
- dprintf(("PyThread_exit_thread called\n"));
-
- /* Thread-safe way to read a variable without a mutex: */
- if (atomic_add(&thread_count, 0) == 0) {
- /* No threads around, so exit main(). */
- if (no_cleanup)
- _exit(0);
- else
- exit(0);
- } else {
- /* We're a thread */
- exit_thread(0);
- }
-}
-
-
-void PyThread_exit_thread(void)
-{
- do_PyThread_exit_thread(0);
-}
-
-
-void PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
-
- /* No need to do anything, the threads get torn down if main()exits. */
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
-}
-
-
-void PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
-}
-
-
-void PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
-
-/*
- * Lock support.
- *
- */
-
-static atomic_t lock_count = 0;
-
-PyThread_type_lock PyThread_allocate_lock(void)
-{
-#ifdef FASTLOCK
- fastmutex_t *lock;
-#else
- sem_id sema;
-#endif
- char name[OS_NAME_LENGTH];
- atomic_t this_lock;
-
- dprintf(("PyThread_allocate_lock called\n"));
-
-#ifdef FASTLOCK
- lock = (fastmutex_t *) malloc(sizeof(fastmutex_t));
- if (lock == NULL) {
- dprintf(("PyThread_allocate_lock failed: out of memory\n"));
- return (PyThread_type_lock) NULL;
- }
-#endif
- this_lock = atomic_add(&lock_count, 1);
- PyOS_snprintf(name, sizeof(name), "python lock (%d)", this_lock);
-
-#ifdef FASTLOCK
- if (fastmutex_create(name, lock) < 0) {
- dprintf(("PyThread_allocate_lock failed: %s\n",
- strerror(errno)));
- free(lock);
- lock = NULL;
- }
- dprintf(("PyThread_allocate_lock()-> %p\n", lock));
- return (PyThread_type_lock) lock;
-#else
- sema = create_semaphore(name, 1, 0);
- if (sema < 0) {
- dprintf(("PyThread_allocate_lock failed: %s\n",
- strerror(errno)));
- sema = 0;
- }
- dprintf(("PyThread_allocate_lock()-> %p\n", sema));
- return (PyThread_type_lock) sema;
-#endif
-}
-
-
-void PyThread_free_lock(PyThread_type_lock lock)
-{
- dprintf(("PyThread_free_lock(%p) called\n", lock));
-
-#ifdef FASTLOCK
- if (fastmutex_destroy((fastmutex_t *) lock) < 0) {
- dprintf(("PyThread_free_lock(%p) failed: %s\n", lock,
- strerror(errno)));
- }
- free(lock);
-#else
- if (delete_semaphore((sem_id) lock) < 0) {
- dprintf(("PyThread_free_lock(%p) failed: %s\n", lock,
- strerror(errno)));
- }
-#endif
-}
-
-
-int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
-{
- int retval;
-
- dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock,
- waitflag));
-
-#ifdef FASTLOCK
- if (waitflag)
- retval = fastmutex_lock((fastmutex_t *) lock);
- else
- retval = fastmutex_timedlock((fastmutex_t *) lock, 0);
-#else
- if (waitflag)
- retval = lock_semaphore((sem_id) lock);
- else
- retval = lock_semaphore_x((sem_id) lock, 1, 0, 0);
-#endif
- if (retval < 0) {
- dprintf(("PyThread_acquire_lock(%p, %d) failed: %s\n",
- lock, waitflag, strerror(errno)));
- }
- dprintf(("PyThread_acquire_lock(%p, %d)-> %d\n", lock, waitflag,
- retval));
- return retval < 0 ? 0 : 1;
-}
-
-
-void PyThread_release_lock(PyThread_type_lock lock)
-{
- dprintf(("PyThread_release_lock(%p) called\n", lock));
-
-#ifdef FASTLOCK
- if (fastmutex_unlock((fastmutex_t *) lock) < 0) {
- dprintf(("PyThread_release_lock(%p) failed: %s\n", lock,
- strerror(errno)));
- }
-#else
- if (unlock_semaphore((sem_id) lock) < 0) {
- dprintf(("PyThread_release_lock(%p) failed: %s\n", lock,
- strerror(errno)));
- }
-#endif
-}
diff --git a/Python/thread_cthread.h b/Python/thread_cthread.h
index 8cb504459f..1b3e3904cd 100644
--- a/Python/thread_cthread.h
+++ b/Python/thread_cthread.h
@@ -50,58 +50,14 @@ PyThread_get_thread_ident(void)
return (long) cthread_self();
}
-static void
-do_PyThread_exit_thread(int no_cleanup)
-{
- dprintf(("PyThread_exit_thread called\n"));
- if (!initialized)
- if (no_cleanup)
- _exit(0);
- else
- exit(0);
- cthread_exit(0);
-}
-
void
PyThread_exit_thread(void)
{
- do_PyThread_exit_thread(0);
-}
-
-void
-PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static
-void do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
+ dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
-}
-
-void
-PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
-}
-
-void
-PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
+ exit(0);
+ cthread_exit(0);
}
-#endif /* NO_EXIT_PROG */
/*
* Lock support.
diff --git a/Python/thread_foobar.h b/Python/thread_foobar.h
index c2dffa66c1..d2b78c5cae 100644
--- a/Python/thread_foobar.h
+++ b/Python/thread_foobar.h
@@ -29,53 +29,13 @@ PyThread_get_thread_ident(void)
PyThread_init_thread();
}
-static
-void do_PyThread_exit_thread(int no_cleanup)
-{
- dprintf(("PyThread_exit_thread called\n"));
- if (!initialized)
- if (no_cleanup)
- _exit(0);
- else
- exit(0);
-}
-
void
PyThread_exit_thread(void)
{
- do_PyThread_exit_thread(0);
-}
-
-void
-PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static
-void do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
+ dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
-}
-
-void
-PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
-}
-
-void
-PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
+ exit(0);
}
-#endif /* NO_EXIT_PROG */
/*
* Lock support.
diff --git a/Python/thread_lwp.h b/Python/thread_lwp.h
index 7519cd454e..ba7b37ad7e 100644
--- a/Python/thread_lwp.h
+++ b/Python/thread_lwp.h
@@ -47,50 +47,14 @@ long PyThread_get_thread_ident(void)
return tid.thread_id;
}
-static void do_PyThread_exit_thread(int no_cleanup)
+void PyThread_exit_thread(void)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
- if (no_cleanup)
- _exit(0);
- else
- exit(0);
+ exit(0);
lwp_destroy(SELF);
}
-void PyThread_exit_thread(void)
-{
- do_PyThread_exit_thread(0);
-}
-
-void PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
- if (!initialized)
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
- pod_exit(status);
-}
-
-void PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
-}
-
-void PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
/*
* Lock support.
*/
diff --git a/Python/thread_nt.h b/Python/thread_nt.h
index e3a3387f8d..d1bb0e5673 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -9,82 +9,31 @@
#include <process.h>
#endif
-typedef struct NRMUTEX {
- LONG owned ;
- DWORD thread_id ;
- HANDLE hevent ;
-} NRMUTEX, *PNRMUTEX ;
+#define PNRMUTEX HANDLE
-
-BOOL
-InitializeNonRecursiveMutex(PNRMUTEX mutex)
+PNRMUTEX
+AllocNonRecursiveMutex()
{
- mutex->owned = -1 ; /* No threads have entered NonRecursiveMutex */
- mutex->thread_id = 0 ;
- mutex->hevent = CreateEvent(NULL, FALSE, FALSE, NULL) ;
- return mutex->hevent != NULL ; /* TRUE if the mutex is created */
+ return CreateSemaphore(NULL, 1, 1, NULL);
}
VOID
-DeleteNonRecursiveMutex(PNRMUTEX mutex)
+FreeNonRecursiveMutex(PNRMUTEX mutex)
{
/* No in-use check */
- CloseHandle(mutex->hevent) ;
- mutex->hevent = NULL ; /* Just in case */
+ CloseHandle(mutex);
}
DWORD
-EnterNonRecursiveMutex(PNRMUTEX mutex, BOOL wait)
+EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
{
- /* Assume that the thread waits successfully */
- DWORD ret ;
-
- /* InterlockedIncrement(&mutex->owned) == 0 means that no thread currently owns the mutex */
- if (!wait)
- {
- if (InterlockedCompareExchange(&mutex->owned, 0, -1) != -1)
- return WAIT_TIMEOUT ;
- ret = WAIT_OBJECT_0 ;
- }
- else
- ret = InterlockedIncrement(&mutex->owned) ?
- /* Some thread owns the mutex, let's wait... */
- WaitForSingleObject(mutex->hevent, INFINITE) : WAIT_OBJECT_0 ;
-
- mutex->thread_id = GetCurrentThreadId() ; /* We own it */
- return ret ;
+ return WaitForSingleObject(mutex, milliseconds);
}
BOOL
LeaveNonRecursiveMutex(PNRMUTEX mutex)
{
- /* We don't own the mutex */
- mutex->thread_id = 0 ;
- return
- InterlockedDecrement(&mutex->owned) < 0 ||
- SetEvent(mutex->hevent) ; /* Other threads are waiting, wake one on them up */
-}
-
-PNRMUTEX
-AllocNonRecursiveMutex(void)
-{
- PNRMUTEX mutex = (PNRMUTEX)malloc(sizeof(NRMUTEX)) ;
- if (mutex && !InitializeNonRecursiveMutex(mutex))
- {
- free(mutex) ;
- mutex = NULL ;
- }
- return mutex ;
-}
-
-void
-FreeNonRecursiveMutex(PNRMUTEX mutex)
-{
- if (mutex)
- {
- DeleteNonRecursiveMutex(mutex) ;
- free(mutex) ;
- }
+ return ReleaseSemaphore(mutex, 1, NULL);
}
long PyThread_get_thread_ident(void);
@@ -203,16 +152,6 @@ PyThread_exit_thread(void)
#endif
}
-#ifndef NO_EXIT_PROG
-void
-PyThread_exit_prog(int status)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
- if (!initialized)
- exit(status);
-}
-#endif /* NO_EXIT_PROG */
-
/*
* Lock support. It has too be implemented as semaphores.
* I [Dag] tried to implement it with mutex but I could find a way to
@@ -248,19 +187,47 @@ PyThread_free_lock(PyThread_type_lock aLock)
* and 0 if the lock was not acquired. This means a 0 is returned
* if the lock has already been acquired by this thread!
*/
-int
-PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
+PyLockStatus
+PyThread_acquire_lock_timed(PyThread_type_lock aLock,
+ PY_TIMEOUT_T microseconds, int intr_flag)
{
- int success ;
+ /* Fow now, intr_flag does nothing on Windows, and lock acquires are
+ * uninterruptible. */
+ PyLockStatus success;
+ PY_TIMEOUT_T milliseconds;
+
+ if (microseconds >= 0) {
+ milliseconds = microseconds / 1000;
+ if (microseconds % 1000 > 0)
+ ++milliseconds;
+ if ((DWORD) milliseconds != milliseconds)
+ Py_FatalError("Timeout too large for a DWORD, "
+ "please check PY_TIMEOUT_MAX");
+ }
+ else
+ milliseconds = INFINITE;
- dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n", PyThread_get_thread_ident(),aLock, waitflag));
+ dprintf(("%ld: PyThread_acquire_lock_timed(%p, %lld) called\n",
+ PyThread_get_thread_ident(), aLock, microseconds));
- success = aLock && EnterNonRecursiveMutex((PNRMUTEX) aLock, (waitflag ? INFINITE : 0)) == WAIT_OBJECT_0 ;
+ if (aLock && EnterNonRecursiveMutex((PNRMUTEX)aLock,
+ (DWORD)milliseconds) == WAIT_OBJECT_0) {
+ success = PY_LOCK_ACQUIRED;
+ }
+ else {
+ success = PY_LOCK_FAILURE;
+ }
- dprintf(("%ld: PyThread_acquire_lock(%p, %d) -> %d\n", PyThread_get_thread_ident(),aLock, waitflag, success));
+ dprintf(("%ld: PyThread_acquire_lock(%p, %lld) -> %d\n",
+ PyThread_get_thread_ident(), aLock, microseconds, success));
return success;
}
+int
+PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
+{
+ return PyThread_acquire_lock_timed(aLock, waitflag ? -1 : 0, 0);
+}
void
PyThread_release_lock(PyThread_type_lock aLock)
@@ -306,7 +273,10 @@ _pythread_nt_set_stacksize(size_t size)
int
PyThread_create_key(void)
{
- return (int) TlsAlloc();
+ DWORD result= TlsAlloc();
+ if (result == TLS_OUT_OF_INDEXES)
+ return -1;
+ return (int)result;
}
void
diff --git a/Python/thread_os2.h b/Python/thread_os2.h
index 28284bbc06..1b264b5ad5 100644
--- a/Python/thread_os2.h
+++ b/Python/thread_os2.h
@@ -68,56 +68,16 @@ PyThread_get_thread_ident(void)
#endif
}
-static void
-do_PyThread_exit_thread(int no_cleanup)
+void
+PyThread_exit_thread(void)
{
dprintf(("%ld: PyThread_exit_thread called\n",
PyThread_get_thread_ident()));
if (!initialized)
- if (no_cleanup)
- _exit(0);
- else
- exit(0);
+ exit(0);
_endthread();
}
-void
-PyThread_exit_thread(void)
-{
- do_PyThread_exit_thread(0);
-}
-
-void
-PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void
-do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
- if (!initialized)
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
-}
-
-void
-PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
-}
-
-void
-PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
/*
* Lock support. This is implemented with an event semaphore and critical
* sections to make it behave more like a posix mutex than its OS/2
diff --git a/Python/thread_pth.h b/Python/thread_pth.h
index 1f1694a4d4..82a00e72ba 100644
--- a/Python/thread_pth.h
+++ b/Python/thread_pth.h
@@ -74,49 +74,14 @@ long PyThread_get_thread_ident(void)
return (long) *(long *) &threadid;
}
-static void do_PyThread_exit_thread(int no_cleanup)
+void PyThread_exit_thread(void)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized) {
- if (no_cleanup)
- _exit(0);
- else
- exit(0);
+ exit(0);
}
}
-void PyThread_exit_thread(void)
-{
- do_PyThread_exit_thread(0);
-}
-
-void PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
- if (!initialized)
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
-}
-
-void PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
-}
-
-void PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
/*
* Lock support.
*/
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index 32fd2d0ef7..6bc9d55781 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -64,7 +64,8 @@
/* Whether or not to use semaphores directly rather than emulating them with
* mutexes and condition variables:
*/
-#if defined(_POSIX_SEMAPHORES) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
+#if (defined(_POSIX_SEMAPHORES) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES) && \
+ defined(HAVE_SEM_TIMEDWAIT))
# define USE_SEMAPHORES
#else
# undef USE_SEMAPHORES
@@ -83,6 +84,26 @@
#endif
+/* We assume all modern POSIX systems have gettimeofday() */
+#ifdef GETTIMEOFDAY_NO_TZ
+#define GETTIMEOFDAY(ptv) gettimeofday(ptv)
+#else
+#define GETTIMEOFDAY(ptv) gettimeofday(ptv, (struct timezone *)NULL)
+#endif
+
+#define MICROSECONDS_TO_TIMESPEC(microseconds, ts) \
+do { \
+ struct timeval tv; \
+ GETTIMEOFDAY(&tv); \
+ tv.tv_usec += microseconds % 1000000; \
+ tv.tv_sec += microseconds / 1000000; \
+ tv.tv_sec += tv.tv_usec / 1000000; \
+ tv.tv_usec %= 1000000; \
+ ts.tv_sec = tv.tv_sec; \
+ ts.tv_nsec = tv.tv_usec * 1000; \
+} while(0)
+
+
/* A pthread mutex isn't sufficient to model the Python lock type
* because, according to Draft 5 of the docs (P1003.4a/D5), both of the
* following are undefined:
@@ -225,55 +246,15 @@ PyThread_get_thread_ident(void)
#endif
}
-static void
-do_PyThread_exit_thread(int no_cleanup)
-{
- dprintf(("PyThread_exit_thread called\n"));
- if (!initialized) {
- if (no_cleanup)
- _exit(0);
- else
- exit(0);
- }
-}
-
void
PyThread_exit_thread(void)
{
- do_PyThread_exit_thread(0);
-}
-
-void
-PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void
-do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
+ dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
-}
-
-void
-PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
+ exit(0);
+ pthread_exit(0);
}
-void
-PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
#ifdef USE_SEMAPHORES
/*
@@ -335,31 +316,56 @@ fix_status(int status)
return (status == -1) ? errno : status;
}
-int
-PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
+PyLockStatus
+PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds,
+ int intr_flag)
{
- int success;
+ PyLockStatus success;
sem_t *thelock = (sem_t *)lock;
int status, error = 0;
+ struct timespec ts;
- dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
+ dprintf(("PyThread_acquire_lock_timed(%p, %lld, %d) called\n",
+ lock, microseconds, intr_flag));
+ if (microseconds > 0)
+ MICROSECONDS_TO_TIMESPEC(microseconds, ts);
do {
- if (waitflag)
- status = fix_status(sem_wait(thelock));
- else
+ if (microseconds > 0)
+ status = fix_status(sem_timedwait(thelock, &ts));
+ else if (microseconds == 0)
status = fix_status(sem_trywait(thelock));
- } while (status == EINTR); /* Retry if interrupted by a signal */
-
- if (waitflag) {
- CHECK_STATUS("sem_wait");
- } else if (status != EAGAIN) {
- CHECK_STATUS("sem_trywait");
+ else
+ status = fix_status(sem_wait(thelock));
+ /* Retry if interrupted by a signal, unless the caller wants to be
+ notified. */
+ } while (!intr_flag && status == EINTR);
+
+ /* Don't check the status if we're stopping because of an interrupt. */
+ if (!(intr_flag && status == EINTR)) {
+ if (microseconds > 0) {
+ if (status != ETIMEDOUT)
+ CHECK_STATUS("sem_timedwait");
+ }
+ else if (microseconds == 0) {
+ if (status != EAGAIN)
+ CHECK_STATUS("sem_trywait");
+ }
+ else {
+ CHECK_STATUS("sem_wait");
+ }
}
- success = (status == 0) ? 1 : 0;
+ if (status == 0) {
+ success = PY_LOCK_ACQUIRED;
+ } else if (intr_flag && status == EINTR) {
+ success = PY_LOCK_INTR;
+ } else {
+ success = PY_LOCK_FAILURE;
+ }
- dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
+ dprintf(("PyThread_acquire_lock_timed(%p, %lld, %d) -> %d\n",
+ lock, microseconds, intr_flag, success));
return success;
}
@@ -398,6 +404,12 @@ PyThread_allocate_lock(void)
status = pthread_mutex_init(&lock->mut,
pthread_mutexattr_default);
CHECK_STATUS("pthread_mutex_init");
+ /* Mark the pthread mutex underlying a Python mutex as
+ pure happens-before. We can't simply mark the
+ Python-level mutex as a mutex because it can be
+ acquired and released in different threads, which
+ will cause errors. */
+ _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(&lock->mut);
status = pthread_cond_init(&lock->lock_released,
pthread_condattr_default);
@@ -430,37 +442,69 @@ PyThread_free_lock(PyThread_type_lock lock)
free((void *)thelock);
}
-int
-PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
+PyLockStatus
+PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds,
+ int intr_flag)
{
- int success;
+ PyLockStatus success;
pthread_lock *thelock = (pthread_lock *)lock;
int status, error = 0;
- dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
+ dprintf(("PyThread_acquire_lock_timed(%p, %lld, %d) called\n",
+ lock, microseconds, intr_flag));
status = pthread_mutex_lock( &thelock->mut );
CHECK_STATUS("pthread_mutex_lock[1]");
- success = thelock->locked == 0;
- if ( !success && waitflag ) {
+ if (thelock->locked == 0) {
+ success = PY_LOCK_ACQUIRED;
+ } else if (microseconds == 0) {
+ success = PY_LOCK_FAILURE;
+ } else {
+ struct timespec ts;
+ if (microseconds > 0)
+ MICROSECONDS_TO_TIMESPEC(microseconds, ts);
/* continue trying until we get the lock */
/* mut must be locked by me -- part of the condition
* protocol */
- while ( thelock->locked ) {
- status = pthread_cond_wait(&thelock->lock_released,
- &thelock->mut);
- CHECK_STATUS("pthread_cond_wait");
+ success = PY_LOCK_FAILURE;
+ while (success == PY_LOCK_FAILURE) {
+ if (microseconds > 0) {
+ status = pthread_cond_timedwait(
+ &thelock->lock_released,
+ &thelock->mut, &ts);
+ if (status == ETIMEDOUT)
+ break;
+ CHECK_STATUS("pthread_cond_timed_wait");
+ }
+ else {
+ status = pthread_cond_wait(
+ &thelock->lock_released,
+ &thelock->mut);
+ CHECK_STATUS("pthread_cond_wait");
+ }
+
+ if (intr_flag && status == 0 && thelock->locked) {
+ /* We were woken up, but didn't get the lock. We probably received
+ * a signal. Return PY_LOCK_INTR to allow the caller to handle
+ * it and retry. */
+ success = PY_LOCK_INTR;
+ break;
+ } else if (status == 0 && !thelock->locked) {
+ success = PY_LOCK_ACQUIRED;
+ } else {
+ success = PY_LOCK_FAILURE;
+ }
}
- success = 1;
}
- if (success) thelock->locked = 1;
+ if (success == PY_LOCK_ACQUIRED) thelock->locked = 1;
status = pthread_mutex_unlock( &thelock->mut );
CHECK_STATUS("pthread_mutex_unlock[1]");
- if (error) success = 0;
- dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
+ if (error) success = PY_LOCK_FAILURE;
+ dprintf(("PyThread_acquire_lock_timed(%p, %lld, %d) -> %d\n",
+ lock, microseconds, intr_flag, success));
return success;
}
@@ -487,6 +531,12 @@ PyThread_release_lock(PyThread_type_lock lock)
#endif /* USE_SEMAPHORES */
+int
+PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
+{
+ return PyThread_acquire_lock_timed(lock, waitflag ? -1 : 0, /*intr_flag=*/0);
+}
+
/* set the thread stack size.
* Return 0 if size is valid, -1 if size is invalid,
* -2 if setting stack size is not supported.
@@ -531,3 +581,46 @@ _pythread_pthread_set_stacksize(size_t size)
}
#define THREAD_SET_STACKSIZE(x) _pythread_pthread_set_stacksize(x)
+
+#define Py_HAVE_NATIVE_TLS
+
+int
+PyThread_create_key(void)
+{
+ pthread_key_t key;
+ int fail = pthread_key_create(&key, NULL);
+ return fail ? -1 : key;
+}
+
+void
+PyThread_delete_key(int key)
+{
+ pthread_key_delete(key);
+}
+
+void
+PyThread_delete_key_value(int key)
+{
+ pthread_setspecific(key, NULL);
+}
+
+int
+PyThread_set_key_value(int key, void *value)
+{
+ int fail;
+ void *oldValue = pthread_getspecific(key);
+ if (oldValue != NULL)
+ return 0;
+ fail = pthread_setspecific(key, value);
+ return fail ? -1 : 0;
+}
+
+void *
+PyThread_get_key_value(int key)
+{
+ return pthread_getspecific(key);
+}
+
+void
+PyThread_ReInitTLS(void)
+{}
diff --git a/Python/thread_sgi.h b/Python/thread_sgi.h
index 679d113583..771ab2cc60 100644
--- a/Python/thread_sgi.h
+++ b/Python/thread_sgi.h
@@ -17,9 +17,6 @@ static ulock_t wait_lock; /* lock used to wait for other threads */
static int waiting_for_threads; /* protected by count_lock */
static int nthreads; /* protected by count_lock */
static int exit_status;
-#ifndef NO_EXIT_PROG
-static int do_exit; /* indicates that the program is to exit */
-#endif
static int exiting; /* we're already exiting (for maybe_exit) */
static pid_t my_pid; /* PID of main thread */
static struct pidlist {
@@ -27,53 +24,11 @@ static struct pidlist {
pid_t child;
} pidlist[MAXPROC]; /* PIDs of other threads; protected by count_lock */
static int maxpidindex; /* # of PIDs in pidlist */
-
-#ifndef NO_EXIT_PROG
-/*
- * This routine is called as a signal handler when another thread
- * exits. When that happens, we must see whether we have to exit as
- * well (because of an PyThread_exit_prog()) or whether we should continue on.
- */
-static void exit_sig(void)
-{
- d2printf(("exit_sig called\n"));
- if (exiting && getpid() == my_pid) {
- d2printf(("already exiting\n"));
- return;
- }
- if (do_exit) {
- d2printf(("exiting in exit_sig\n"));
-#ifdef Py_DEBUG
- if ((thread_debug & 8) == 0)
- thread_debug &= ~1; /* don't produce debug messages */
-#endif
- PyThread_exit_thread();
- }
-}
-
-/*
- * This routine is called when a process calls exit(). If that wasn't
- * done from the library, we do as if an PyThread_exit_prog() was intended.
- */
-static void maybe_exit(void)
-{
- dprintf(("maybe_exit called\n"));
- if (exiting) {
- dprintf(("already exiting\n"));
- return;
- }
- PyThread_exit_prog(0);
-}
-#endif /* NO_EXIT_PROG */
-
/*
* Initialization.
*/
static void PyThread__init_thread(void)
{
-#ifndef NO_EXIT_PROG
- struct sigaction s;
-#endif /* NO_EXIT_PROG */
#ifdef USE_DL
long addr, size;
#endif /* USE_DL */
@@ -93,16 +48,6 @@ static void PyThread__init_thread(void)
if (usconfig(CONF_INITUSERS, 16) < 0)
perror("usconfig - CONF_INITUSERS");
my_pid = getpid(); /* so that we know which is the main thread */
-#ifndef NO_EXIT_PROG
- atexit(maybe_exit);
- s.sa_handler = exit_sig;
- sigemptyset(&s.sa_mask);
- /*sigaddset(&s.sa_mask, SIGUSR1);*/
- s.sa_flags = 0;
- sigaction(SIGUSR1, &s, 0);
- if (prctl(PR_SETEXITSIG, SIGUSR1) < 0)
- perror("prctl - PR_SETEXITSIG");
-#endif /* NO_EXIT_PROG */
if (usconfig(CONF_ARENATYPE, US_SHAREDONLY) < 0)
perror("usconfig - CONF_ARENATYPE");
usconfig(CONF_LOCKTYPE, US_DEBUG); /* XXX */
@@ -227,46 +172,24 @@ long PyThread_get_thread_ident(void)
return getpid();
}
-static void do_PyThread_exit_thread(int no_cleanup)
+void PyThread_exit_thread(void)
{
dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
- if (no_cleanup)
- _exit(0);
- else
- exit(0);
+ exit(0);
if (ussetlock(count_lock) < 0)
perror("ussetlock (count_lock)");
nthreads--;
if (getpid() == my_pid) {
/* main thread; wait for other threads to exit */
exiting = 1;
-#ifndef NO_EXIT_PROG
- if (do_exit) {
- int i;
-
- /* notify other threads */
- clean_threads();
- if (nthreads >= 0) {
- dprintf(("kill other threads\n"));
- for (i = 0; i < maxpidindex; i++)
- if (pidlist[i].child > 0)
- (void) kill(pidlist[i].child,
- SIGKILL);
- _exit(exit_status);
- }
- }
-#endif /* NO_EXIT_PROG */
waiting_for_threads = 1;
if (ussetlock(wait_lock) < 0)
perror("ussetlock (wait_lock)");
for (;;) {
if (nthreads < 0) {
dprintf(("really exit (%d)\n", exit_status));
- if (no_cleanup)
- _exit(exit_status);
- else
- exit(exit_status);
+ exit(exit_status);
}
if (usunsetlock(count_lock) < 0)
perror("usunsetlock (count_lock)");
@@ -283,50 +206,11 @@ static void do_PyThread_exit_thread(int no_cleanup)
if (usunsetlock(wait_lock) < 0)
perror("usunsetlock (wait_lock)");
}
-#ifndef NO_EXIT_PROG
- else if (do_exit)
- (void) kill(my_pid, SIGUSR1);
-#endif /* NO_EXIT_PROG */
if (usunsetlock(count_lock) < 0)
perror("usunsetlock (count_lock)");
_exit(0);
}
-void PyThread_exit_thread(void)
-{
- do_PyThread_exit_thread(0);
-}
-
-void PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
- if (!initialized)
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
- do_exit = 1;
- exit_status = status;
- do_PyThread_exit_thread(no_cleanup);
-}
-
-void PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
-}
-
-void PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
/*
* Lock support.
*/
diff --git a/Python/thread_solaris.h b/Python/thread_solaris.h
index 56ac8ae40f..1ce1cfcba9 100644
--- a/Python/thread_solaris.h
+++ b/Python/thread_solaris.h
@@ -64,58 +64,14 @@ PyThread_get_thread_ident(void)
return thr_self();
}
-static void
-do_PyThread_exit_thread(int no_cleanup)
-{
- dprintf(("PyThread_exit_thread called\n"));
- if (!initialized)
- if (no_cleanup)
- _exit(0);
- else
- exit(0);
- thr_exit(0);
-}
-
void
PyThread_exit_thread(void)
{
- do_PyThread_exit_thread(0);
-}
-
-void
-PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void
-do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
+ dprintf(("PyThread_exit_thread called\n"));
if (!initialized)
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
-}
-
-void
-PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
-}
-
-void
-PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
+ exit(0);
+ thr_exit(0);
}
-#endif /* NO_EXIT_PROG */
/*
* Lock support.
diff --git a/Python/thread_wince.h b/Python/thread_wince.h
index 33cf5a4fad..51ddc02f9a 100644
--- a/Python/thread_wince.h
+++ b/Python/thread_wince.h
@@ -53,48 +53,13 @@ long PyThread_get_thread_ident(void)
return GetCurrentThreadId();
}
-static void do_PyThread_exit_thread(int no_cleanup)
-{
- dprintf(("%ld: do_PyThread_exit_thread called\n", PyThread_get_thread_ident()));
- if (!initialized)
- if (no_cleanup)
- exit(0); /* XXX - was _exit()!! */
- else
- exit(0);
- _endthread();
-}
-
void PyThread_exit_thread(void)
{
- do_PyThread_exit_thread(0);
-}
-
-void PyThread__exit_thread(void)
-{
- do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
- dprintf(("PyThread_exit_prog(%d) called\n", status));
+ dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
if (!initialized)
- if (no_cleanup)
- _exit(status);
- else
- exit(status);
-}
-
-void PyThread_exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 0);
-}
-
-void PyThread__exit_prog(int status)
-{
- do_PyThread_exit_prog(status, 1);
+ exit(0);
+ _endthread();
}
-#endif /* NO_EXIT_PROG */
/*
* Lock support. It has to be implemented using Mutexes, as
diff --git a/Python/traceback.c b/Python/traceback.c
index 2f1c213fa3..59bb3f0d15 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -7,7 +7,6 @@
#include "frameobject.h"
#include "structmember.h"
#include "osdefs.h"
-#include "traceback.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
@@ -114,8 +113,7 @@ newtracebackobject(PyTracebackObject *next, PyFrameObject *frame)
Py_XINCREF(frame);
tb->tb_frame = frame;
tb->tb_lasti = frame->f_lasti;
- tb->tb_lineno = PyCode_Addr2Line(frame->f_code,
- frame->f_lasti);
+ tb->tb_lineno = PyFrame_GetLineNumber(frame);
PyObject_GC_Track(tb);
}
return tb;
@@ -150,8 +148,7 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject *
Py_ssize_t len;
PyObject* result;
- filebytes = PyUnicode_AsEncodedObject(filename,
- Py_FileSystemDefaultEncoding, "surrogateescape");
+ filebytes = PyUnicode_EncodeFSDefault(filename);
if (filebytes == NULL) {
PyErr_Clear();
return NULL;
@@ -179,9 +176,7 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject *
}
if (!PyUnicode_Check(v))
continue;
-
- path = PyUnicode_AsEncodedObject(v, Py_FileSystemDefaultEncoding,
- "surrogateescape");
+ path = PyUnicode_EncodeFSDefault(v);
if (path == NULL) {
PyErr_Clear();
continue;
diff --git a/README b/README
index a59cb91360..5215aef985 100644
--- a/README
+++ b/README
@@ -1,15 +1,13 @@
-This is Python version 3.1.3
-============================
+This is Python version 3.2
+==========================
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-Python Software Foundation.
-All rights reserved.
+Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+Python Software Foundation. All rights reserved.
-Python 3.x is a new version of the language, which is incompatible with the
-2.x line of releases. The language is mostly the same, but many details,
-especially how built-in objects like dictionaries and strings work, have
-changed considerably, and a lot of deprecated features have finally been
-removed.
+Python 3.x is a new version of the language, which is incompatible with the 2.x
+line of releases. The language is mostly the same, but many details, especially
+how built-in objects like dictionaries and strings work, have changed
+considerably, and a lot of deprecated features have finally been removed.
Build Instructions
@@ -24,20 +22,19 @@ On Unix, Linux, BSD, OSX, and Cygwin:
This will install Python as python3.
-You can pass many options to the configure script; run "./configure
---help" to find out more. On OSX and Cygwin, the executable is called
-python.exe; elsewhere it's just python.
+You can pass many options to the configure script; run "./configure --help" to
+find out more. On OSX and Cygwin, the executable is called python.exe;
+elsewhere it's just python.
-On Mac OS X, if you have configured Python with --enable-framework,
-you should use "make frameworkinstall" to do the installation. Note
-that this installs the Python executable in a place that is not
-normally on your PATH, you may want to set up a symlink in
-/usr/local/bin.
+On Mac OS X, if you have configured Python with --enable-framework, you should
+use "make frameworkinstall" to do the installation. Note that this installs the
+Python executable in a place that is not normally on your PATH, you may want to
+set up a symlink in /usr/local/bin.
On Windows, see PCbuild/readme.txt.
-If you wish, you can create a subdirectory and invoke configure from
-there. For example:
+If you wish, you can create a subdirectory and invoke configure from there. For
+example:
mkdir debug
cd debug
@@ -45,21 +42,21 @@ there. For example:
make
make test
-(This will fail if you *also* built at the top-level directory. You
-should do a "make clean" at the toplevel first.)
+(This will fail if you *also* built at the top-level directory. You should do a
+"make clean" at the toplevel first.)
What's New
----------
We try to have a comprehensive overview of the changes in the "What's New in
-Python 3.1" document, found at
+Python 3.2" document, found at
- http://docs.python.org/3.1/whatsnew/3.1.html
+ http://docs.python.org/3.2/whatsnew/3.2.html
-For a more detailed change log, read Misc/NEWS (though this file, too,
-is incomplete, and also doesn't list anything merged in from the 2.7
-release under development).
+For a more detailed change log, read Misc/NEWS (though this file, too, is
+incomplete, and also doesn't list anything merged in from the 2.7 release under
+development).
If you want to install multiple versions of Python see the section below
entitled "Installing multiple versions".
@@ -68,89 +65,81 @@ entitled "Installing multiple versions".
Documentation
-------------
-Documentation for Python 3.1 is online, updated twice a day:
+Documentation for Python 3.2 is online, updated daily:
- http://docs.python.org/3.1/
+ http://docs.python.org/3.2/
-All documentation is also available online at the Python web site
-(http://docs.python.org/, see below). It is available online for
-occasional reference, or can be downloaded in many formats for faster
-access. The documentation is downloadable in HTML, PostScript, PDF,
-LaTeX (through 2.5), and reStructuredText (2.6+) formats; the LaTeX and
-reStructuredText versions are primarily for documentation authors,
-translators, and people with special formatting requirements.
+It can also be downloaded in many formats for faster access. The documentation
+is downloadable in HTML, PDF, and reStructuredText formats; the latter version
+is primarily for documentation authors, translators, and people with special
+formatting requirements.
Converting From Python 2.x to 3.x
---------------------------------
-Python starting with 2.6 will contain features to help locating code that
-needs to be changed, such as optional warnings when deprecated features are
-used, and backported versions of certain key Python 3.x features.
+Python starting with 2.6 contains features to help locating code that needs to
+be changed, such as optional warnings when deprecated features are used, and
+backported versions of certain key Python 3.x features.
A source-to-source translation tool, "2to3", can take care of the mundane task
of converting large amounts of source code. It is not a complete solution but
is complemented by the deprecation warnings in 2.6. See
-http://docs.python.org/py3k/library/2to3.html for more information.
+http://docs.python.org/3.2/library/2to3.html for more information.
Testing
-------
-To test the interpreter, type "make test" in the top-level directory.
-This runs the test set twice (once with no compiled files, once with
-the compiled files left by the previous test run). The test set
-produces some output. You can generally ignore the messages about
-skipped tests due to optional features which can't be imported.
-If a message is printed about a failed test or a traceback or core
-dump is produced, something is wrong. On some Linux systems (those
-that are not yet using glibc 6), test_strftime fails due to a
-non-standard implementation of strftime() in the C library. Please
-ignore this, or upgrade to glibc version 6.
+To test the interpreter, type "make test" in the top-level directory. This runs
+the test set twice (once with no compiled files, once with the compiled files
+left by the previous test run). The test set produces some output. You can
+generally ignore the messages about skipped tests due to optional features which
+can't be imported. If a message is printed about a failed test or a traceback
+or core dump is produced, something is wrong.
By default, tests are prevented from overusing resources like disk space and
memory. To enable these tests, run "make testall".
-IMPORTANT: If the tests fail and you decide to mail a bug report,
-*don't* include the output of "make test". It is useless. Run the
-failing test manually, as follows:
+IMPORTANT: If the tests fail and you decide to mail a bug report, *don't*
+include the output of "make test". It is useless. Run the failing test
+manually, as follows:
- ./python Lib/test/regrtest.py -v test_whatever
+ ./python -m test -v test_whatever
-(substituting the top of the source tree for '.' if you built in a
-different directory). This runs the test in verbose mode.
+(substituting the top of the source tree for '.' if you built in a different
+directory). This runs the test in verbose mode.
Installing multiple versions
----------------------------
On Unix and Mac systems if you intend to install multiple versions of Python
-using the same installation prefix (--prefix argument to the configure
-script) you must take care that your primary python executable is not
-overwritten by the installation of a different version. All files and
-directories installed using "make altinstall" contain the major and minor
-version and can thus live side-by-side. "make install" also creates
-${prefix}/bin/python3 which refers to ${prefix}/bin/pythonX.Y. If you intend
-to install multiple versions using the same prefix you must decide which
-version (if any) is your "primary" version. Install that version using
-"make install". Install all other versions using "make altinstall".
+using the same installation prefix (--prefix argument to the configure script)
+you must take care that your primary python executable is not overwritten by the
+installation of a different version. All files and directories installed using
+"make altinstall" contain the major and minor version and can thus live
+side-by-side. "make install" also creates ${prefix}/bin/python3 which refers to
+${prefix}/bin/pythonX.Y. If you intend to install multiple versions using the
+same prefix you must decide which version (if any) is your "primary" version.
+Install that version using "make install". Install all other versions using
+"make altinstall".
-For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being
-the primary version, you would execute "make install" in your 2.6 build
-directory and "make altinstall" in the others.
+For example, if you want to install Python 2.5, 2.6 and 3.2 with 2.6 being the
+primary version, you would execute "make install" in your 2.6 build directory
+and "make altinstall" in the others.
Issue Tracker and Mailing List
------------------------------
-We're soliciting bug reports about all aspects of the language. Fixes
-are also welcome, preferable in unified diff format. Please use the
-issue tracker:
+We're soliciting bug reports about all aspects of the language. Fixes are also
+welcome, preferable in unified diff format. Please use the issue tracker:
http://bugs.python.org/
-If you're not sure whether you're dealing with a bug or a feature, use
-the mailing list:
+If you're not sure whether you're dealing with a bug or a feature, use the
+mailing list:
python-dev@python.org
@@ -163,8 +152,8 @@ Proposals for enhancement
-------------------------
If you have a proposal to change Python, you may want to send an email to the
-comp.lang.python or python-ideas mailing lists for inital feedback. A Python
-Enhancement Proposal (PEP) may be submitted if your idea gains ground. All
+comp.lang.python or python-ideas mailing lists for inital feedback. A Python
+Enhancement Proposal (PEP) may be submitted if your idea gains ground. All
current PEPs, as well as guidelines for submitting a new PEP, are listed at
http://www.python.org/dev/peps/.
@@ -172,32 +161,27 @@ http://www.python.org/dev/peps/.
Release Schedule
----------------
-See PEP 375 for release details: http://www.python.org/dev/peps/pep-0375/
+See PEP 392 for release details: http://www.python.org/dev/peps/pep-0392/
Copyright and License Information
---------------------------------
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-Python Software Foundation.
-All rights reserved.
+Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+Python Software Foundation. All rights reserved.
-Copyright (c) 2000 BeOpen.com.
-All rights reserved.
+Copyright (c) 2000 BeOpen.com. All rights reserved.
-Copyright (c) 1995-2001 Corporation for National Research Initiatives.
-All rights reserved.
+Copyright (c) 1995-2001 Corporation for National Research Initiatives. All
+rights reserved.
-Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
-All rights reserved.
+Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved.
-See the file "LICENSE" for information on the history of this
-software, terms & conditions for usage, and a DISCLAIMER OF ALL
-WARRANTIES.
+See the file "LICENSE" for information on the history of this software, terms &
+conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.
-This Python distribution contains *no* GNU General Public License
-(GPL) code, so it may be used in proprietary projects. There are
-interfaces to some GNU code but these are entirely optional.
+This Python distribution contains *no* GNU General Public License (GPL) code, so
+it may be used in proprietary projects. There are interfaces to some GNU code
+but these are entirely optional.
-All trademarks referenced herein are property of their respective
-holders.
+All trademarks referenced herein are property of their respective holders.
diff --git a/Tools/README b/Tools/README
index ae9b5927d8..c1f89ba0cb 100644
--- a/Tools/README
+++ b/Tools/README
@@ -1,33 +1,42 @@
This directory contains a number of Python programs that are useful
while building or extending Python.
-faqwiz FAQ Wizard.
- See http://www.python.org/cgi-bin/faqw.py
- for a live example.
+buildbot Batchfiles for running on Windows buildslaves.
-freeze Create a stand-alone executable from a Python program.
+ccbench A Python concurrency benchmark.
-i18n Tools for internationalization. pygettext.py
- parses Python source code and generates .pot files,
- and msgfmt.py generates a binary message catalog
- from a catalog in text format.
+demo Several Python programming demos.
-modulator Interactively generate boiler plate for an extension
- module. Works easiest if you have Tk.
+freeze Create a stand-alone executable from a Python program.
-pynche A Tkinter-based color editor.
+gdb Python code to be run inside gdb, to make it easier to
+ debug Python itself (by David Malcolm).
+
+i18n Tools for internationalization. pygettext.py
+ parses Python source code and generates .pot files,
+ and msgfmt.py generates a binary message catalog
+ from a catalog in text format.
+
+iobench Benchmark for the new Python I/O system.
+
+msi Support for packaging Python as an MSI package on Windows.
+
+parser Un-parsing tool to generate code from an AST.
+
+pybench Comprehensive Python benchmarking suite.
+
+pynche A Tkinter-based color editor.
scripts A number of useful single-file programs, e.g. tabnanny.py
by Tim Peters, which checks for inconsistent mixing of
tabs and spaces, and 2to3, which converts Python 2 code
to Python 3 code.
-unicode Tools used to generate unicode database files for
- Python 2.0 (by Fredrik Lundh).
+test2to3 A demonstration of how to use 2to3 transparently in setup.py.
-webchecker A link checker for web sites.
+unicode Tools for generating unicodedata and codecs from unicode.org
+ and other mapping files (by Fredrik Lundh, Marc-Andre Lemburg
+ and Martin von Loewis).
-world Script to take a list of Internet addresses and print
- out where in the world those addresses originate from,
- based on the top-level domain country code found in
- the address.
+unittestgui A Tkinter based GUI test runner for unittest, with test
+ discovery.
diff --git a/Tools/buildbot/clean-amd64.bat b/Tools/buildbot/clean-amd64.bat
index 9fb35e9453..715805a7c1 100644
--- a/Tools/buildbot/clean-amd64.bat
+++ b/Tools/buildbot/clean-amd64.bat
@@ -1,7 +1,10 @@
@rem Used by the buildbot "clean" step.
call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
-cd PCbuild
@echo Deleting .pyc/.pyo files ...
del /s Lib\*.pyc Lib\*.pyo
+@echo Deleting test leftovers ...
+rmdir /s /q build
+cd PCbuild
vcbuild /clean pcbuild.sln "Release|x64"
vcbuild /clean pcbuild.sln "Debug|x64"
+cd ..
diff --git a/Tools/buildbot/clean.bat b/Tools/buildbot/clean.bat
index ec71804da0..5c8f33ecca 100644
--- a/Tools/buildbot/clean.bat
+++ b/Tools/buildbot/clean.bat
@@ -2,6 +2,9 @@
call "%VS90COMNTOOLS%vsvars32.bat"
@echo Deleting .pyc/.pyo files ...
del /s Lib\*.pyc Lib\*.pyo
+@echo Deleting test leftovers ...
+rmdir /s /q build
cd PCbuild
vcbuild /clean pcbuild.sln "Release|Win32"
vcbuild /clean pcbuild.sln "Debug|Win32"
+cd ..
diff --git a/Tools/buildbot/external-amd64.bat b/Tools/buildbot/external-amd64.bat
index 1cb2ce7231..954238ed5d 100644
--- a/Tools/buildbot/external-amd64.bat
+++ b/Tools/buildbot/external-amd64.bat
@@ -5,17 +5,17 @@ call "Tools\buildbot\external-common.bat"
call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
if not exist tcltk64\bin\tcl85g.dll (
- cd tcl-8.5.2.1\win
+ cd tcl-8.5.9.0\win
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install
cd ..\..
)
if not exist tcltk64\bin\tk85g.dll (
- cd tk-8.5.2.0\win
- nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.2.1 clean
- nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.2.1 all
- nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.2.1 install
+ cd tk-8.5.9.0\win
+ nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.9.0 clean
+ nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.9.0 all
+ nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.9.0 install
cd ..\..
)
diff --git a/Tools/buildbot/external-common.bat b/Tools/buildbot/external-common.bat
index 8beee14121..1ff282e21e 100644
--- a/Tools/buildbot/external-common.bat
+++ b/Tools/buildbot/external-common.bat
@@ -14,8 +14,8 @@ cd ..
@rem if exist tk8.4.16 rd /s/q tk8.4.16
@rem if exist tk-8.4.18.1 rd /s/q tk-8.4.18.1
@rem if exist db-4.4.20 rd /s/q db-4.4.20
-@rem if exist openssl-0.9.8l rd /s/q openssl-0.9.8l
-@rem if exist sqlite-3.5.9 rd /s/q sqlite-3.5.9
+@rem if exist openssl-1.0.0a rd /s/q openssl-1.0.0a
+@rem if exist sqlite-3.7.4 rd /s/q sqlite-3.7.4
@rem bzip
if not exist bzip2-1.0.5 (
@@ -27,17 +27,17 @@ if not exist bzip2-1.0.5 (
if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20-vs9 db-4.4.20
@rem OpenSSL
-if not exist openssl-0.9.8l svn export http://svn.python.org/projects/external/openssl-0.9.8l
+if not exist openssl-1.0.0a svn export http://svn.python.org/projects/external/openssl-1.0.0a
@rem tcl/tk
-if not exist tcl-8.5.2.1 (
+if not exist tcl-8.5.9.0 (
rd /s/q tcltk tcltk64
- svn export http://svn.python.org/projects/external/tcl-8.5.2.1
+ svn export http://svn.python.org/projects/external/tcl-8.5.9.0
)
-if not exist tk-8.5.2.0 svn export http://svn.python.org/projects/external/tk-8.5.2.0
+if not exist tk-8.5.9.0 svn export http://svn.python.org/projects/external/tk-8.5.9.0
@rem sqlite3
-if not exist sqlite-3.5.9 (
- rd /s/q sqlite-source-3.3.4
- svn export http://svn.python.org/projects/external/sqlite-3.5.9
+if not exist sqlite-3.7.4 (
+ rd /s/q sqlite-source-3.6.21
+ svn export http://svn.python.org/projects/external/sqlite-3.7.4
)
diff --git a/Tools/buildbot/external.bat b/Tools/buildbot/external.bat
index d90e8cefbb..e958fd68a4 100644
--- a/Tools/buildbot/external.bat
+++ b/Tools/buildbot/external.bat
@@ -6,16 +6,16 @@ call "%VS90COMNTOOLS%\vsvars32.bat"
if not exist tcltk\bin\tcl85g.dll (
@rem all and install need to be separate invocations, otherwise nmakehlp is not found on install
- cd tcl-8.5.2.1\win
+ cd tcl-8.5.9.0\win
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk clean all
nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk install
cd ..\..
)
if not exist tcltk\bin\tk85g.dll (
- cd tk-8.5.2.0\win
- nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.2.1 clean
- nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.2.1 all
- nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.2.1 install
+ cd tk-8.5.9.0\win
+ nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.9.0 clean
+ nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.9.0 all
+ nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.9.0 install
cd ..\..
)
diff --git a/Tools/buildbot/test.bat b/Tools/buildbot/test.bat
index 16c07fb1c6..5882defbd3 100644
--- a/Tools/buildbot/test.bat
+++ b/Tools/buildbot/test.bat
@@ -1,4 +1,4 @@
@rem Used by the buildbot "test" step.
cd PCbuild
-call rt.bat -d -q -uall -rw -n
+call rt.bat -d -q -uall -rwW -n
diff --git a/Tools/ccbench/ccbench.py b/Tools/ccbench/ccbench.py
new file mode 100644
index 0000000000..9f7118f8e9
--- /dev/null
+++ b/Tools/ccbench/ccbench.py
@@ -0,0 +1,612 @@
+# This file should be kept compatible with both Python 2.6 and Python >= 3.0.
+
+from __future__ import division
+from __future__ import print_function
+
+"""
+ccbench, a Python concurrency benchmark.
+"""
+
+import time
+import os
+import sys
+import functools
+import itertools
+import threading
+import subprocess
+import socket
+from optparse import OptionParser, SUPPRESS_HELP
+import platform
+
+# Compatibility
+try:
+ xrange
+except NameError:
+ xrange = range
+
+try:
+ map = itertools.imap
+except AttributeError:
+ pass
+
+
+THROUGHPUT_DURATION = 2.0
+
+LATENCY_PING_INTERVAL = 0.1
+LATENCY_DURATION = 2.0
+
+BANDWIDTH_PACKET_SIZE = 1024
+BANDWIDTH_DURATION = 2.0
+
+
+def task_pidigits():
+ """Pi calculation (Python)"""
+ _map = map
+ _count = itertools.count
+ _islice = itertools.islice
+
+ def calc_ndigits(n):
+ # From http://shootout.alioth.debian.org/
+ def gen_x():
+ return _map(lambda k: (k, 4*k + 2, 0, 2*k + 1), _count(1))
+
+ def compose(a, b):
+ aq, ar, as_, at = a
+ bq, br, bs, bt = b
+ return (aq * bq,
+ aq * br + ar * bt,
+ as_ * bq + at * bs,
+ as_ * br + at * bt)
+
+ def extract(z, j):
+ q, r, s, t = z
+ return (q*j + r) // (s*j + t)
+
+ def pi_digits():
+ z = (1, 0, 0, 1)
+ x = gen_x()
+ while 1:
+ y = extract(z, 3)
+ while y != extract(z, 4):
+ z = compose(z, next(x))
+ y = extract(z, 3)
+ z = compose((10, -10*y, 0, 1), z)
+ yield y
+
+ return list(_islice(pi_digits(), n))
+
+ return calc_ndigits, (50, )
+
+def task_regex():
+ """regular expression (C)"""
+ # XXX this task gives horrendous latency results.
+ import re
+ # Taken from the `inspect` module
+ pat = re.compile(r'^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)', re.MULTILINE)
+ with open(__file__, "r") as f:
+ arg = f.read(2000)
+
+ def findall(s):
+ t = time.time()
+ try:
+ return pat.findall(s)
+ finally:
+ print(time.time() - t)
+ return pat.findall, (arg, )
+
+def task_sort():
+ """list sorting (C)"""
+ def list_sort(l):
+ l = l[::-1]
+ l.sort()
+
+ return list_sort, (list(range(1000)), )
+
+def task_compress_zlib():
+ """zlib compression (C)"""
+ import zlib
+ with open(__file__, "rb") as f:
+ arg = f.read(5000) * 3
+
+ def compress(s):
+ zlib.decompress(zlib.compress(s, 5))
+ return compress, (arg, )
+
+def task_compress_bz2():
+ """bz2 compression (C)"""
+ import bz2
+ with open(__file__, "rb") as f:
+ arg = f.read(3000) * 2
+
+ def compress(s):
+ bz2.compress(s)
+ return compress, (arg, )
+
+def task_hashing():
+ """SHA1 hashing (C)"""
+ import hashlib
+ with open(__file__, "rb") as f:
+ arg = f.read(5000) * 30
+
+ def compute(s):
+ hashlib.sha1(s).digest()
+ return compute, (arg, )
+
+
+throughput_tasks = [task_pidigits, task_regex]
+for mod in 'bz2', 'hashlib':
+ try:
+ globals()[mod] = __import__(mod)
+ except ImportError:
+ globals()[mod] = None
+
+# For whatever reasons, zlib gives irregular results, so we prefer bz2 or
+# hashlib if available.
+# (NOTE: hashlib releases the GIL from 2.7 and 3.1 onwards)
+if bz2 is not None:
+ throughput_tasks.append(task_compress_bz2)
+elif hashlib is not None:
+ throughput_tasks.append(task_hashing)
+else:
+ throughput_tasks.append(task_compress_zlib)
+
+latency_tasks = throughput_tasks
+bandwidth_tasks = [task_pidigits]
+
+
+class TimedLoop:
+ def __init__(self, func, args):
+ self.func = func
+ self.args = args
+
+ def __call__(self, start_time, min_duration, end_event, do_yield=False):
+ step = 20
+ niters = 0
+ duration = 0.0
+ _time = time.time
+ _sleep = time.sleep
+ _func = self.func
+ _args = self.args
+ t1 = start_time
+ while True:
+ for i in range(step):
+ _func(*_args)
+ t2 = _time()
+ # If another thread terminated, the current measurement is invalid
+ # => return the previous one.
+ if end_event:
+ return niters, duration
+ niters += step
+ duration = t2 - start_time
+ if duration >= min_duration:
+ end_event.append(None)
+ return niters, duration
+ if t2 - t1 < 0.01:
+ # Minimize interference of measurement on overall runtime
+ step = step * 3 // 2
+ elif do_yield:
+ # OS scheduling of Python threads is sometimes so bad that we
+ # have to force thread switching ourselves, otherwise we get
+ # completely useless results.
+ _sleep(0.0001)
+ t1 = t2
+
+
+def run_throughput_test(func, args, nthreads):
+ assert nthreads >= 1
+
+ # Warm up
+ func(*args)
+
+ results = []
+ loop = TimedLoop(func, args)
+ end_event = []
+
+ if nthreads == 1:
+ # Pure single-threaded performance, without any switching or
+ # synchronization overhead.
+ start_time = time.time()
+ results.append(loop(start_time, THROUGHPUT_DURATION,
+ end_event, do_yield=False))
+ return results
+
+ started = False
+ ready_cond = threading.Condition()
+ start_cond = threading.Condition()
+ ready = []
+
+ def run():
+ with ready_cond:
+ ready.append(None)
+ ready_cond.notify()
+ with start_cond:
+ while not started:
+ start_cond.wait()
+ results.append(loop(start_time, THROUGHPUT_DURATION,
+ end_event, do_yield=True))
+
+ threads = []
+ for i in range(nthreads):
+ threads.append(threading.Thread(target=run))
+ for t in threads:
+ t.setDaemon(True)
+ t.start()
+ # We don't want measurements to include thread startup overhead,
+ # so we arrange for timing to start after all threads are ready.
+ with ready_cond:
+ while len(ready) < nthreads:
+ ready_cond.wait()
+ with start_cond:
+ start_time = time.time()
+ started = True
+ start_cond.notify(nthreads)
+ for t in threads:
+ t.join()
+
+ return results
+
+def run_throughput_tests(max_threads):
+ for task in throughput_tasks:
+ print(task.__doc__)
+ print()
+ func, args = task()
+ nthreads = 1
+ baseline_speed = None
+ while nthreads <= max_threads:
+ results = run_throughput_test(func, args, nthreads)
+ # Taking the max duration rather than average gives pessimistic
+ # results rather than optimistic.
+ speed = sum(r[0] for r in results) / max(r[1] for r in results)
+ print("threads=%d: %d" % (nthreads, speed), end="")
+ if baseline_speed is None:
+ print(" iterations/s.")
+ baseline_speed = speed
+ else:
+ print(" ( %d %%)" % (speed / baseline_speed * 100))
+ nthreads += 1
+ print()
+
+
+LAT_END = "END"
+
+def _sendto(sock, s, addr):
+ sock.sendto(s.encode('ascii'), addr)
+
+def _recv(sock, n):
+ return sock.recv(n).decode('ascii')
+
+def latency_client(addr, nb_pings, interval):
+ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ try:
+ _time = time.time
+ _sleep = time.sleep
+ def _ping():
+ _sendto(sock, "%r\n" % _time(), addr)
+ # The first ping signals the parent process that we are ready.
+ _ping()
+ # We give the parent a bit of time to notice.
+ _sleep(1.0)
+ for i in range(nb_pings):
+ _sleep(interval)
+ _ping()
+ _sendto(sock, LAT_END + "\n", addr)
+ finally:
+ sock.close()
+
+def run_latency_client(**kwargs):
+ cmd_line = [sys.executable, '-E', os.path.abspath(__file__)]
+ cmd_line.extend(['--latclient', repr(kwargs)])
+ return subprocess.Popen(cmd_line) #, stdin=subprocess.PIPE,
+ #stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+def run_latency_test(func, args, nthreads):
+ # Create a listening socket to receive the pings. We use UDP which should
+ # be painlessly cross-platform.
+ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ sock.bind(("127.0.0.1", 0))
+ addr = sock.getsockname()
+
+ interval = LATENCY_PING_INTERVAL
+ duration = LATENCY_DURATION
+ nb_pings = int(duration / interval)
+
+ results = []
+ threads = []
+ end_event = []
+ start_cond = threading.Condition()
+ started = False
+ if nthreads > 0:
+ # Warm up
+ func(*args)
+
+ results = []
+ loop = TimedLoop(func, args)
+ ready = []
+ ready_cond = threading.Condition()
+
+ def run():
+ with ready_cond:
+ ready.append(None)
+ ready_cond.notify()
+ with start_cond:
+ while not started:
+ start_cond.wait()
+ loop(start_time, duration * 1.5, end_event, do_yield=False)
+
+ for i in range(nthreads):
+ threads.append(threading.Thread(target=run))
+ for t in threads:
+ t.setDaemon(True)
+ t.start()
+ # Wait for threads to be ready
+ with ready_cond:
+ while len(ready) < nthreads:
+ ready_cond.wait()
+
+ # Run the client and wait for the first ping(s) to arrive before
+ # unblocking the background threads.
+ chunks = []
+ process = run_latency_client(addr=sock.getsockname(),
+ nb_pings=nb_pings, interval=interval)
+ s = _recv(sock, 4096)
+ _time = time.time
+
+ with start_cond:
+ start_time = _time()
+ started = True
+ start_cond.notify(nthreads)
+
+ while LAT_END not in s:
+ s = _recv(sock, 4096)
+ t = _time()
+ chunks.append((t, s))
+
+ # Tell the background threads to stop.
+ end_event.append(None)
+ for t in threads:
+ t.join()
+ process.wait()
+ sock.close()
+
+ for recv_time, chunk in chunks:
+ # NOTE: it is assumed that a line sent by a client wasn't received
+ # in two chunks because the lines are very small.
+ for line in chunk.splitlines():
+ line = line.strip()
+ if line and line != LAT_END:
+ send_time = eval(line)
+ assert isinstance(send_time, float)
+ results.append((send_time, recv_time))
+
+ return results
+
+def run_latency_tests(max_threads):
+ for task in latency_tasks:
+ print("Background CPU task:", task.__doc__)
+ print()
+ func, args = task()
+ nthreads = 0
+ while nthreads <= max_threads:
+ results = run_latency_test(func, args, nthreads)
+ n = len(results)
+ # We print out milliseconds
+ lats = [1000 * (t2 - t1) for (t1, t2) in results]
+ #print(list(map(int, lats)))
+ avg = sum(lats) / n
+ dev = (sum((x - avg) ** 2 for x in lats) / n) ** 0.5
+ print("CPU threads=%d: %d ms. (std dev: %d ms.)" % (nthreads, avg, dev), end="")
+ print()
+ #print(" [... from %d samples]" % n)
+ nthreads += 1
+ print()
+
+
+BW_END = "END"
+
+def bandwidth_client(addr, packet_size, duration):
+ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ sock.bind(("127.0.0.1", 0))
+ local_addr = sock.getsockname()
+ _time = time.time
+ _sleep = time.sleep
+ def _send_chunk(msg):
+ _sendto(sock, ("%r#%s\n" % (local_addr, msg)).rjust(packet_size), addr)
+ # We give the parent some time to be ready.
+ _sleep(1.0)
+ try:
+ start_time = _time()
+ end_time = start_time + duration * 2.0
+ i = 0
+ while _time() < end_time:
+ _send_chunk(str(i))
+ s = _recv(sock, packet_size)
+ assert len(s) == packet_size
+ i += 1
+ _send_chunk(BW_END)
+ finally:
+ sock.close()
+
+def run_bandwidth_client(**kwargs):
+ cmd_line = [sys.executable, '-E', os.path.abspath(__file__)]
+ cmd_line.extend(['--bwclient', repr(kwargs)])
+ return subprocess.Popen(cmd_line) #, stdin=subprocess.PIPE,
+ #stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+def run_bandwidth_test(func, args, nthreads):
+ # Create a listening socket to receive the packets. We use UDP which should
+ # be painlessly cross-platform.
+ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ sock.bind(("127.0.0.1", 0))
+ addr = sock.getsockname()
+
+ duration = BANDWIDTH_DURATION
+ packet_size = BANDWIDTH_PACKET_SIZE
+
+ results = []
+ threads = []
+ end_event = []
+ start_cond = threading.Condition()
+ started = False
+ if nthreads > 0:
+ # Warm up
+ func(*args)
+
+ results = []
+ loop = TimedLoop(func, args)
+ ready = []
+ ready_cond = threading.Condition()
+
+ def run():
+ with ready_cond:
+ ready.append(None)
+ ready_cond.notify()
+ with start_cond:
+ while not started:
+ start_cond.wait()
+ loop(start_time, duration * 1.5, end_event, do_yield=False)
+
+ for i in range(nthreads):
+ threads.append(threading.Thread(target=run))
+ for t in threads:
+ t.setDaemon(True)
+ t.start()
+ # Wait for threads to be ready
+ with ready_cond:
+ while len(ready) < nthreads:
+ ready_cond.wait()
+
+ # Run the client and wait for the first packet to arrive before
+ # unblocking the background threads.
+ process = run_bandwidth_client(addr=addr,
+ packet_size=packet_size,
+ duration=duration)
+ _time = time.time
+ # This will also wait for the parent to be ready
+ s = _recv(sock, packet_size)
+ remote_addr = eval(s.partition('#')[0])
+
+ with start_cond:
+ start_time = _time()
+ started = True
+ start_cond.notify(nthreads)
+
+ n = 0
+ first_time = None
+ while not end_event and BW_END not in s:
+ _sendto(sock, s, remote_addr)
+ s = _recv(sock, packet_size)
+ if first_time is None:
+ first_time = _time()
+ n += 1
+ end_time = _time()
+
+ end_event.append(None)
+ for t in threads:
+ t.join()
+ process.kill()
+
+ return (n - 1) / (end_time - first_time)
+
+def run_bandwidth_tests(max_threads):
+ for task in bandwidth_tasks:
+ print("Background CPU task:", task.__doc__)
+ print()
+ func, args = task()
+ nthreads = 0
+ baseline_speed = None
+ while nthreads <= max_threads:
+ results = run_bandwidth_test(func, args, nthreads)
+ speed = results
+ #speed = len(results) * 1.0 / results[-1][0]
+ print("CPU threads=%d: %.1f" % (nthreads, speed), end="")
+ if baseline_speed is None:
+ print(" packets/s.")
+ baseline_speed = speed
+ else:
+ print(" ( %d %%)" % (speed / baseline_speed * 100))
+ nthreads += 1
+ print()
+
+
+def main():
+ usage = "usage: %prog [-h|--help] [options]"
+ parser = OptionParser(usage=usage)
+ parser.add_option("-t", "--throughput",
+ action="store_true", dest="throughput", default=False,
+ help="run throughput tests")
+ parser.add_option("-l", "--latency",
+ action="store_true", dest="latency", default=False,
+ help="run latency tests")
+ parser.add_option("-b", "--bandwidth",
+ action="store_true", dest="bandwidth", default=False,
+ help="run I/O bandwidth tests")
+ parser.add_option("-i", "--interval",
+ action="store", type="int", dest="check_interval", default=None,
+ help="sys.setcheckinterval() value")
+ parser.add_option("-I", "--switch-interval",
+ action="store", type="float", dest="switch_interval", default=None,
+ help="sys.setswitchinterval() value")
+ parser.add_option("-n", "--num-threads",
+ action="store", type="int", dest="nthreads", default=4,
+ help="max number of threads in tests")
+
+ # Hidden option to run the pinging and bandwidth clients
+ parser.add_option("", "--latclient",
+ action="store", dest="latclient", default=None,
+ help=SUPPRESS_HELP)
+ parser.add_option("", "--bwclient",
+ action="store", dest="bwclient", default=None,
+ help=SUPPRESS_HELP)
+
+ options, args = parser.parse_args()
+ if args:
+ parser.error("unexpected arguments")
+
+ if options.latclient:
+ kwargs = eval(options.latclient)
+ latency_client(**kwargs)
+ return
+
+ if options.bwclient:
+ kwargs = eval(options.bwclient)
+ bandwidth_client(**kwargs)
+ return
+
+ if not options.throughput and not options.latency and not options.bandwidth:
+ options.throughput = options.latency = options.bandwidth = True
+ if options.check_interval:
+ sys.setcheckinterval(options.check_interval)
+ if options.switch_interval:
+ sys.setswitchinterval(options.switch_interval)
+
+ print("== %s %s (%s) ==" % (
+ platform.python_implementation(),
+ platform.python_version(),
+ platform.python_build()[0],
+ ))
+ # Processor identification often has repeated spaces
+ cpu = ' '.join(platform.processor().split())
+ print("== %s %s on '%s' ==" % (
+ platform.machine(),
+ platform.system(),
+ cpu,
+ ))
+ print()
+
+ if options.throughput:
+ print("--- Throughput ---")
+ print()
+ run_throughput_tests(options.nthreads)
+
+ if options.latency:
+ print("--- Latency ---")
+ print()
+ run_latency_tests(options.nthreads)
+
+ if options.bandwidth:
+ print("--- I/O bandwidth ---")
+ print()
+ run_bandwidth_tests(options.nthreads)
+
+if __name__ == "__main__":
+ main()
diff --git a/Tools/demo/README b/Tools/demo/README
new file mode 100644
index 0000000000..e914358a26
--- /dev/null
+++ b/Tools/demo/README
@@ -0,0 +1,16 @@
+This directory contains a collection of demonstration scripts for
+various aspects of Python programming.
+
+beer.py Well-known programming example: Bottles of beer.
+eiffel.py Python advanced magic: A metaclass for Eiffel post/preconditions.
+hanoi.py Well-known programming example: Towers of Hanoi.
+life.py Curses programming: Simple game-of-life.
+markov.py Algorithms: Markov chain simulation.
+mcast.py Network programming: Send and receive UDP multicast packets.
+queens.py Well-known programming example: N-Queens problem.
+redemo.py Regular Expressions: GUI script to test regexes.
+rpython.py Network programming: Small client for remote code execution.
+rpythond.py Network programming: Small server for remote code execution.
+sortvisu.py GUI programming: Visualization of different sort algorithms.
+ss1.py GUI/Application programming: A simple spreadsheet application.
+vector.py Python basics: A vector class with demonstrating special methods. \ No newline at end of file
diff --git a/Demo/scripts/beer.py b/Tools/demo/beer.py
index 8135509522..af58380e0f 100644..100755
--- a/Demo/scripts/beer.py
+++ b/Tools/demo/beer.py
@@ -1,6 +1,11 @@
-#! /usr/bin/env python
+#!/usr/bin/env python3
-# By GvR, demystified after a version by Fredrik Lundh.
+"""
+A Python version of the classic "bottles of beer on the wall" programming
+example.
+
+By Guido van Rossum, demystified after a version by Fredrik Lundh.
+"""
import sys
diff --git a/Demo/newmetaclasses/Eiffel.py b/Tools/demo/eiffel.py
index 15fa58a700..3a282244d4 100644..100755
--- a/Demo/newmetaclasses/Eiffel.py
+++ b/Tools/demo/eiffel.py
@@ -1,13 +1,20 @@
-"""Support Eiffel-style preconditions and postconditions."""
+#!/usr/bin/env python3
+"""
+Support Eiffel-style preconditions and postconditions for functions.
+
+An example for Python metaclasses.
+"""
+
+import unittest
from types import FunctionType as function
class EiffelBaseMetaClass(type):
def __new__(meta, name, bases, dict):
meta.convert_methods(dict)
- return super(EiffelBaseMetaClass, meta).__new__(meta, name, bases,
- dict)
+ return super(EiffelBaseMetaClass, meta).__new__(
+ meta, name, bases, dict)
@classmethod
def convert_methods(cls, dict):
@@ -31,6 +38,7 @@ class EiffelBaseMetaClass(type):
if pre or post:
dict[k] = cls.make_eiffel_method(dict[m], pre, post)
+
class EiffelMetaClass1(EiffelBaseMetaClass):
# an implementation of the "eiffel" meta class that uses nested functions
@@ -39,16 +47,17 @@ class EiffelMetaClass1(EiffelBaseMetaClass):
def method(self, *args, **kwargs):
if pre:
pre(self, *args, **kwargs)
- x = func(self, *args, **kwargs)
+ rv = func(self, *args, **kwargs)
if post:
- post(self, x, *args, **kwargs)
- return x
+ post(self, rv, *args, **kwargs)
+ return rv
if func.__doc__:
method.__doc__ = func.__doc__
return method
+
class EiffelMethodWrapper:
def __init__(self, inst, descr):
@@ -58,7 +67,8 @@ class EiffelMethodWrapper:
def __call__(self, *args, **kwargs):
return self._descr.callmethod(self._inst, args, kwargs)
-class EiffelDescriptor(object):
+
+class EiffelDescriptor:
def __init__(self, func, pre, post):
self._func = func
@@ -79,63 +89,58 @@ class EiffelDescriptor(object):
self._post(inst, x, *args, **kwargs)
return x
+
class EiffelMetaClass2(EiffelBaseMetaClass):
# an implementation of the "eiffel" meta class that uses descriptors
make_eiffel_method = EiffelDescriptor
-def _test(metaclass):
- class Eiffel(metaclass=metaclass):
- pass
-
- class Test(Eiffel):
-
- def m(self, arg):
- """Make it a little larger"""
- return arg + 1
-
- def m2(self, arg):
- """Make it a little larger"""
- return arg + 1
-
- def m2_pre(self, arg):
- assert arg > 0
-
- def m2_post(self, result, arg):
- assert result > arg
-
- class Sub(Test):
- def m2(self, arg):
- return arg**2
- def m2_post(self, Result, arg):
- super(Sub, self).m2_post(Result, arg)
- assert Result < 100
-
- t = Test()
- t.m(1)
- t.m2(1)
- try:
- t.m2(0)
- except AssertionError:
- pass
- else:
- assert False
-
- s = Sub()
- try:
- s.m2(1)
- except AssertionError:
- pass # result == arg
- else:
- assert False
- try:
- s.m2(10)
- except AssertionError:
- pass # result == 100
- else:
- assert False
- s.m2(5)
+
+class Tests(unittest.TestCase):
+
+ def testEiffelMetaClass1(self):
+ self._test(EiffelMetaClass1)
+
+ def testEiffelMetaClass2(self):
+ self._test(EiffelMetaClass2)
+
+ def _test(self, metaclass):
+ class Eiffel(metaclass=metaclass):
+ pass
+
+ class Test(Eiffel):
+ def m(self, arg):
+ """Make it a little larger"""
+ return arg + 1
+
+ def m2(self, arg):
+ """Make it a little larger"""
+ return arg + 1
+
+ def m2_pre(self, arg):
+ assert arg > 0
+
+ def m2_post(self, result, arg):
+ assert result > arg
+
+ class Sub(Test):
+ def m2(self, arg):
+ return arg**2
+
+ def m2_post(self, Result, arg):
+ super(Sub, self).m2_post(Result, arg)
+ assert Result < 100
+
+ t = Test()
+ self.assertEqual(t.m(1), 2)
+ self.assertEqual(t.m2(1), 2)
+ self.assertRaises(AssertionError, t.m2, 0)
+
+ s = Sub()
+ self.assertRaises(AssertionError, s.m2, 1)
+ self.assertRaises(AssertionError, s.m2, 10)
+ self.assertEqual(s.m2(5), 25)
+
if __name__ == "__main__":
- _test(EiffelMetaClass1)
- _test(EiffelMetaClass2)
+ unittest.main()
diff --git a/Demo/tkinter/guido/hanoi.py b/Tools/demo/hanoi.py
index 34a0bbadd3..dad02342ae 100755
--- a/Demo/tkinter/guido/hanoi.py
+++ b/Tools/demo/hanoi.py
@@ -1,17 +1,18 @@
-# Animated Towers of Hanoi using Tk with optional bitmap file in
-# background.
-#
-# Usage: tkhanoi [n [bitmapfile]]
-#
-# n is the number of pieces to animate; default is 4, maximum 15.
-#
-# The bitmap file can be any X11 bitmap file (look in
-# /usr/include/X11/bitmaps for samples); it is displayed as the
-# background of the animation. Default is no bitmap.
+#!/usr/bin/env python3
-# This uses Steen Lumholt's Tk interface
-from tkinter import *
+"""
+Animated Towers of Hanoi using Tk with optional bitmap file in background.
+Usage: hanoi.py [n [bitmapfile]]
+
+n is the number of pieces to animate; default is 4, maximum 15.
+
+The bitmap file can be any X11 bitmap file (look in /usr/include/X11/bitmaps for
+samples); it is displayed as the background of the animation. Default is no
+bitmap.
+"""
+
+from tkinter import Tk, Canvas
# Basic Towers-of-Hanoi algorithm: move n pieces from a to b, using c
# as temporary. For each move, call report()
@@ -123,7 +124,6 @@ class Tkhanoi:
self.pegstate[b].append(i)
-# Main program
def main():
import sys
diff --git a/Demo/curses/life.py b/Tools/demo/life.py
index ddff8fa173..dfb9ab87c2 100755
--- a/Demo/curses/life.py
+++ b/Tools/demo/life.py
@@ -1,24 +1,23 @@
-#!/usr/bin/env python
-# life.py -- A curses-based version of Conway's Game of Life.
-# Contributed by AMK
-#
-# An empty board will be displayed, and the following commands are available:
-# E : Erase the board
-# R : Fill the board randomly
-# S : Step for a single generation
-# C : Update continuously until a key is struck
-# Q : Quit
-# Cursor keys : Move the cursor around the board
-# Space or Enter : Toggle the contents of the cursor's position
-#
-# TODO :
-# Support the mouse
-# Use colour if available
-# Make board updates faster
-#
-
-import random, string, traceback
+#!/usr/bin/env python3
+
+"""
+A curses-based version of Conway's Game of Life.
+
+An empty board will be displayed, and the following commands are available:
+ E : Erase the board
+ R : Fill the board randomly
+ S : Step for a single generation
+ C : Update continuously until a key is struck
+ Q : Quit
+ Cursor keys : Move the cursor around the board
+ Space or Enter : Toggle the contents of the cursor's position
+
+Contributed by Andrew Kuchling, Mouse support and color by Dafydd Crosby.
+"""
+
import curses
+import random
+
class LifeBoard:
"""Encapsulates a Life board
@@ -32,7 +31,7 @@ class LifeBoard:
next generation. Then display the state
of the board and refresh the screen.
erase() -- clear the entire board
- makeRandom() -- fill the board randomly
+ make_random() -- fill the board randomly
set(y,x) -- set the given cell to Live; doesn't refresh the screen
toggle(y,x) -- change the given cell from live to dead, or vice
versa, and refresh the screen display
@@ -54,7 +53,7 @@ class LifeBoard:
# Draw a border around the board
border_line = '+'+(self.X*'-')+'+'
self.scr.addstr(0, 0, border_line)
- self.scr.addstr(self.Y+1,0, border_line)
+ self.scr.addstr(self.Y+1, 0, border_line)
for y in range(0, self.Y):
self.scr.addstr(1+y, 0, '|')
self.scr.addstr(1+y, self.X+1, '|')
@@ -63,19 +62,23 @@ class LifeBoard:
def set(self, y, x):
"""Set a cell to the live state"""
if x<0 or self.X<=x or y<0 or self.Y<=y:
- raise ValueError("Coordinates out of range %i,%i"% (y,x))
+ raise ValueError("Coordinates out of range %i,%i"% (y, x))
self.state[x,y] = 1
def toggle(self, y, x):
"""Toggle a cell's state between live and dead"""
- if x<0 or self.X<=x or y<0 or self.Y<=y:
- raise ValueError("Coordinates out of range %i,%i"% (y,x))
- if (x,y) in self.state:
- del self.state[x,y]
+ if x < 0 or self.X <= x or y < 0 or self.Y <= y:
+ raise ValueError("Coordinates out of range %i,%i"% (y, x))
+ if (x, y) in self.state:
+ del self.state[x, y]
self.scr.addch(y+1, x+1, ' ')
else:
- self.state[x,y] = 1
+ self.state[x, y] = 1
+ if curses.has_colors():
+ # Let's pick a random color!
+ self.scr.attrset(curses.color_pair(random.randrange(1, 7)))
self.scr.addch(y+1, x+1, self.char)
+ self.scr.attrset(0)
self.scr.refresh()
def erase(self):
@@ -111,7 +114,12 @@ class LifeBoard:
if s == 3:
# Birth
d[i,j] = 1
+ if curses.has_colors():
+ # Let's pick a random color!
+ self.scr.attrset(curses.color_pair(
+ random.randrange(1, 7)))
self.scr.addch(j+1, i+1, self.char)
+ self.scr.attrset(0)
if not live: self.boring = 0
elif s == 2 and live: d[i,j] = 1 # Survival
elif live:
@@ -121,7 +129,7 @@ class LifeBoard:
self.state = d
self.scr.refresh()
- def makeRandom(self):
+ def make_random(self):
"Fill the board with a random pattern"
self.state = {}
for i in range(0, self.X):
@@ -140,10 +148,15 @@ def erase_menu(stdscr, menu_y):
def display_menu(stdscr, menu_y):
"Display the menu of possible keystroke commands"
erase_menu(stdscr, menu_y)
+
+ # If color, then light the menu up :-)
+ if curses.has_colors():
+ stdscr.attrset(curses.color_pair(1))
stdscr.addstr(menu_y, 4,
- 'Use the cursor keys to move, and space or Enter to toggle a cell.')
+ 'Use the cursor keys to move, and space or Enter to toggle a cell.')
stdscr.addstr(menu_y+1, 4,
- 'E)rase the board, R)andom fill, S)tep once or C)ontinuously, Q)uit')
+ 'E)rase the board, R)andom fill, S)tep once or C)ontinuously, Q)uit')
+ stdscr.attrset(0)
def keyloop(stdscr):
# Clear the screen and display the menu of keys
@@ -152,6 +165,19 @@ def keyloop(stdscr):
menu_y = (stdscr_y-3)-1
display_menu(stdscr, menu_y)
+ # If color, then initialize the color pairs
+ if curses.has_colors():
+ curses.init_pair(1, curses.COLOR_BLUE, 0)
+ curses.init_pair(2, curses.COLOR_CYAN, 0)
+ curses.init_pair(3, curses.COLOR_GREEN, 0)
+ curses.init_pair(4, curses.COLOR_MAGENTA, 0)
+ curses.init_pair(5, curses.COLOR_RED, 0)
+ curses.init_pair(6, curses.COLOR_YELLOW, 0)
+ curses.init_pair(7, curses.COLOR_WHITE, 0)
+
+ # Set up the mask to listen for mouse events
+ curses.mousemask(curses.BUTTON1_CLICKED)
+
# Allocate a subwindow for the Life board and create the board object
subwin = stdscr.subwin(stdscr_y-3, stdscr_x, 0, 0)
board = LifeBoard(subwin, char=ord('*'))
@@ -161,10 +187,10 @@ def keyloop(stdscr):
xpos, ypos = board.X//2, board.Y//2
# Main loop:
- while (1):
+ while True:
stdscr.move(1+ypos, 1+xpos) # Move the cursor
c = stdscr.getch() # Get a keystroke
- if 0<c<256:
+ if 0 < c < 256:
c = chr(c)
if c in ' \n':
board.toggle(ypos, xpos)
@@ -176,14 +202,14 @@ def keyloop(stdscr):
# Activate nodelay mode; getch() will return -1
# if no keystroke is available, instead of waiting.
stdscr.nodelay(1)
- while (1):
+ while True:
c = stdscr.getch()
if c != -1:
break
- stdscr.addstr(0,0, '/')
+ stdscr.addstr(0, 0, '/')
stdscr.refresh()
board.display()
- stdscr.addstr(0,0, '+')
+ stdscr.addstr(0, 0, '+')
stdscr.refresh()
stdscr.nodelay(0) # Disable nodelay mode
@@ -194,15 +220,25 @@ def keyloop(stdscr):
elif c in 'Qq':
break
elif c in 'Rr':
- board.makeRandom()
+ board.make_random()
board.display(update_board=False)
elif c in 'Ss':
board.display()
else: pass # Ignore incorrect keys
- elif c == curses.KEY_UP and ypos>0: ypos -= 1
- elif c == curses.KEY_DOWN and ypos<board.Y-1: ypos += 1
- elif c == curses.KEY_LEFT and xpos>0: xpos -= 1
- elif c == curses.KEY_RIGHT and xpos<board.X-1: xpos += 1
+ elif c == curses.KEY_UP and ypos > 0: ypos -= 1
+ elif c == curses.KEY_DOWN and ypos < board.Y-1: ypos += 1
+ elif c == curses.KEY_LEFT and xpos > 0: xpos -= 1
+ elif c == curses.KEY_RIGHT and xpos < board.X-1: xpos += 1
+ elif c == curses.KEY_MOUSE:
+ mouse_id, mouse_x, mouse_y, mouse_z, button_state = curses.getmouse()
+ if (mouse_x > 0 and mouse_x < board.X+1 and
+ mouse_y > 0 and mouse_y < board.Y+1):
+ xpos = mouse_x - 1
+ ypos = mouse_y - 1
+ board.toggle(ypos, xpos)
+ else:
+ # They've clicked outside the board
+ curses.flash()
else:
# Ignore incorrect keys
pass
@@ -211,6 +247,5 @@ def keyloop(stdscr):
def main(stdscr):
keyloop(stdscr) # Enter the main loop
-
if __name__ == '__main__':
curses.wrapper(main)
diff --git a/Demo/scripts/markov.py b/Tools/demo/markov.py
index 990c972e04..7a0720fa7c 100755
--- a/Demo/scripts/markov.py
+++ b/Tools/demo/markov.py
@@ -1,4 +1,8 @@
-#! /usr/bin/env python
+#!/usr/bin/env python3
+
+"""
+Markov chain simulation of words or characters.
+"""
class Markov:
def __init__(self, histsize, choice):
diff --git a/Demo/sockets/mcast.py b/Tools/demo/mcast.py
index b7f85567aa..924c7c3e80 100755
--- a/Demo/sockets/mcast.py
+++ b/Tools/demo/mcast.py
@@ -1,13 +1,15 @@
-#!/usr/bin/env python
-#
-# Send/receive UDP multicast packets.
-# Requires that your OS kernel supports IP multicast.
-#
-# Usage:
-# mcast -s (sender, IPv4)
-# mcast -s -6 (sender, IPv6)
-# mcast (receivers, IPv4)
-# mcast -6 (receivers, IPv6)
+#!/usr/bin/env python3
+
+"""
+Send/receive UDP multicast packets.
+Requires that your OS kernel supports IP multicast.
+
+Usage:
+ mcast -s (sender, IPv4)
+ mcast -s -6 (sender, IPv6)
+ mcast (receivers, IPv4)
+ mcast -6 (receivers, IPv6)
+"""
MYPORT = 8123
MYGROUP_4 = '225.0.0.250'
diff --git a/Demo/scripts/queens.py b/Tools/demo/queens.py
index 726433c551..dcc1bae1ab 100755
--- a/Demo/scripts/queens.py
+++ b/Tools/demo/queens.py
@@ -1,12 +1,12 @@
-#! /usr/bin/env python
+#!/usr/bin/env python3
-"""N queens problem.
+"""
+N queens problem.
The (well-known) problem is due to Niklaus Wirth.
This solution is inspired by Dijkstra (Structured Programming). It is
a classic recursive backtracking approach.
-
"""
N = 8 # Default; command line overrides
diff --git a/Tools/scripts/redemo.py b/Tools/demo/redemo.py
index 52863324c2..52863324c2 100644
--- a/Tools/scripts/redemo.py
+++ b/Tools/demo/redemo.py
diff --git a/Tools/demo/rpython.py b/Tools/demo/rpython.py
new file mode 100755
index 0000000000..5e7bc0a27d
--- /dev/null
+++ b/Tools/demo/rpython.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+
+"""
+Remote python client.
+Execute Python commands remotely and send output back.
+"""
+
+import sys
+from socket import socket, AF_INET, SOCK_STREAM, SHUT_WR
+
+PORT = 4127
+BUFSIZE = 1024
+
+def main():
+ if len(sys.argv) < 3:
+ print("usage: rpython host command")
+ sys.exit(2)
+ host = sys.argv[1]
+ port = PORT
+ i = host.find(':')
+ if i >= 0:
+ port = int(port[i+1:])
+ host = host[:i]
+ command = ' '.join(sys.argv[2:])
+ s = socket(AF_INET, SOCK_STREAM)
+ s.connect((host, port))
+ s.send(command.encode())
+ s.shutdown(SHUT_WR)
+ reply = b''
+ while True:
+ data = s.recv(BUFSIZE)
+ if not data:
+ break
+ reply += data
+ print(reply.decode(), end=' ')
+ s.close()
+
+main()
diff --git a/Demo/sockets/rpythond.py b/Tools/demo/rpythond.py
index d745cc7ca0..9ffe13ab4f 100755
--- a/Demo/sockets/rpythond.py
+++ b/Tools/demo/rpythond.py
@@ -1,12 +1,15 @@
-#! /usr/bin/env python
+#!/usr/bin/env python3
-# Remote python server.
-# Execute Python commands remotely and send output back.
-# WARNING: This version has a gaping security hole -- it accepts requests
-# from any host on the Internet!
+"""
+Remote python server.
+Execute Python commands remotely and send output back.
+
+WARNING: This version has a gaping security hole -- it accepts requests
+from any host on the Internet!
+"""
import sys
-from socket import *
+from socket import socket, AF_INET, SOCK_STREAM
import io
import traceback
@@ -15,23 +18,23 @@ BUFSIZE = 1024
def main():
if len(sys.argv) > 1:
- port = int(eval(sys.argv[1]))
+ port = int(sys.argv[1])
else:
port = PORT
s = socket(AF_INET, SOCK_STREAM)
s.bind(('', port))
s.listen(1)
- while 1:
+ while True:
conn, (remotehost, remoteport) = s.accept()
- print('connected by', remotehost, remoteport)
- request = ''
+ print('connection from', remotehost, remoteport)
+ request = b''
while 1:
data = conn.recv(BUFSIZE)
if not data:
break
- request = request + data
- reply = execute(request)
- conn.send(reply)
+ request += data
+ reply = execute(request.decode())
+ conn.send(reply.encode())
conn.close()
def execute(request):
@@ -49,4 +52,7 @@ def execute(request):
sys.stdout = stdout
return fakefile.getvalue()
-main()
+try:
+ main()
+except KeyboardInterrupt:
+ pass
diff --git a/Demo/tkinter/guido/sortvisu.py b/Tools/demo/sortvisu.py
index 326baecc91..8447bc757e 100644..100755
--- a/Demo/tkinter/guido/sortvisu.py
+++ b/Tools/demo/sortvisu.py
@@ -1,6 +1,7 @@
-#! /usr/bin/env python
+#!/usr/bin/env python3
-"""Sorting algorithms visualizer using Tkinter.
+"""
+Sorting algorithms visualizer using Tkinter.
This module is comprised of three ``components'':
@@ -15,13 +16,11 @@ to its annotation methods;
- and a ``driver'' class which can be used as a Grail applet or as a
stand-alone application.
-
"""
from tkinter import *
import random
-
XGRID = 10
YGRID = 10
WIDTH = 6
diff --git a/Demo/tkinter/guido/ss1.py b/Tools/demo/ss1.py
index 8b074895e4..4cea667171 100644..100755
--- a/Demo/tkinter/guido/ss1.py
+++ b/Tools/demo/ss1.py
@@ -1,4 +1,8 @@
-"""SS1 -- a spreadsheet."""
+#!/usr/bin/env python3
+
+"""
+SS1 -- a spreadsheet-like application.
+"""
import os
import re
@@ -582,7 +586,7 @@ class SheetGUI:
cell = Tk.Label(self.cellgrid, relief='raised')
cell.grid_configure(column=0, row=0, sticky='NSWE')
cell.bind("<ButtonPress-1>", self.selectall)
- # Create the top row of labels, and confiure the grid columns
+ # Create the top row of labels, and configure the grid columns
for x in range(1, columns+1):
self.cellgrid.grid_columnconfigure(x, minsize=64)
cell = Tk.Label(self.cellgrid, text=colnum2name(x), relief='raised')
diff --git a/Demo/classes/Vec.py b/Tools/demo/vector.py
index 787af6962c..da5b3891d1 100755
--- a/Demo/classes/Vec.py
+++ b/Tools/demo/vector.py
@@ -1,7 +1,13 @@
+#!/usr/bin/env python3
+
+"""
+A demonstration of classes and their special methods in Python.
+"""
+
class Vec:
- """ A simple vector class
+ """A simple vector class.
- Instances of the Vec class can be constructed from numbers
+ Instances of the Vec class can be constructed from numbers
>>> a = Vec(1, 2, 3)
>>> b = Vec(3, 2, 1)
diff --git a/Tools/faqwiz/README b/Tools/faqwiz/README
deleted file mode 100644
index a1e4d44047..0000000000
--- a/Tools/faqwiz/README
+++ /dev/null
@@ -1,114 +0,0 @@
-FAQ Wizard
-----------
-
-Author: Guido van Rossum <guido@python.org>
-Version: 1.0
-Date: 6 April 1998
-
-
-This is a CGI program that maintains a user-editable FAQ. It uses RCS
-to keep track of changes to individual FAQ entries. It is fully
-configurable; everything you might want to change when using this
-program to maintain some other FAQ than the Python FAQ is contained in
-the configuration module, faqconf.py.
-
-Note that the bulk of the code is not an executable script; it's an
-importable module. The actual script in cgi-bin is minimal.
-
-Files:
-
-faqw.py executable script to be edited and installed in cgi-bin
-faqwiz.py main module, lives in same directory as FAQ entry files
-faqconf.py main configuration module
-faqcust.py additional local customization module (optional)
-move-faqwiz.sh Script to move faqwiz entries.
-
-
-What's New?
------------
-
-Version 1.0 corrects some minor bugs and uses tab-agnostic
-indentation; it is otherwise unchanged from version 0.9.0.
-
-Version 0.9.0 uses the re module (Perl style regular expressions) for
-all its regular expression needs, instead of the regex and regsub
-modules (Emacs style). This affects the syntax for regular
-expressions entered by the user as search strings (with "regular
-expression" checked), hence the version number jump.
-
-
-Setup Information
------------------
-
-This assumes you are familiar with Python, with your http server, and
-with running CGI scripts under your http server. You need Python 1.5
-or better.
-
-Select a place where the Python modules that constitute the FAQ wizard
-will live (the directory where you unpacked it is an obvious choice).
-This will be called the SRCDIR. This directory should not be writable
-by other users of your system (since they would be able to execute
-arbitrary code by invoking the FAQ wizard's CGI script).
-
-Create a dedicated working directory, preferably one that's not
-directly reachable from your http server. This will be called the
-FAQDIR. Create a subdirectory named RCS. Make both the working
-directory and the RCS subdirectory wrld-writable. (This is essential,
-since the FAQ wizard runs as use nobody, and needs to create
-additional files here!)
-
-Edit faqconf.py to reflect your setup. You only need to edit the top
-part, up till the line of all dashes. The comments should guide you
-in your edits. (Actually, you can also choose to add your changes to
-faqcust.py and leave faqconf.py alone. This is essential if you are
-maintaining multiple FAQs; see below.)
-
-Don't forget to edit the SECTION_TITLES variables to reflect the set
-of section titles for your FAQ!
-
-Next, edit faqw.py to reflect the pathname of your Python interpreter
-and the values for SRCDIR and FAQDIR that you just chose. Then
-install faqw.py in your cgi-bin directory. Make sure that it is
-world-executable. You should now be able to connect to the FAQ wizard
-by entering the following URL in your web client (subsituting the
-appropriate host and port for "your.web.server", and perhaps
-specifying a different directory for "cgi-bin" if local conventions so
-dictate):
-
- http://your.web.server/cgi-bin/faqw.py
-
-If you are unable to get this working, check your server's error_log
-file. The documentation for Python's cgi module in the Python Library
-Reference Manual gives plentyu additional information about installing
-and debugging CGI scripts, including setup debugging. This
-documentation is repeated in the doc string in the cgi module; try
-``import cgi; print cgi.__doc__''.
-
-Assuming this works, you should now be able to add the first entry to
-your FAQ using the FAQ wizard interface. This creates a file
-faq01.001.htp in your working directory and an RCS revision history
-file faq01.001.htp,v in the RCS subdirectory. You can now exercise
-the other FAQ wizard features (search, index, whole FAQ, what's new,
-roulette, and so on).
-
-
-Maintaining Multiple FAQs
--------------------------
-
-If you have multiple FAQs, you need a separate FAQDIR per FAQ, and a
-different customization file per FAQ. The easiest thing to do would
-be to have the faqcust.py for each FAQ live in the FAQDIR for that
-FAQ, but that creates some security concerns, since the FAQDIR must be
-world writable: *if* someone who breaks into your system (or a
-legitimate user) manages to edit the faqcust.py file they can get
-arbitrary code to execute through the FAQ wizard. Therefore, you will
-need a more complex setup.
-
-The best way is probably to have a directory that is only writable by
-you for each FAQ, where you place the copy of faqcust.py for that FAQ,
-and have a world-writable subdirectory DATA for the data. You then
-set FAQDIR to point to the DATA directory and change the faqw.py
-bootstrap script to add FAQDIR/.. to sys.path (in front of SRCDIR, so
-the dummy faqcust.py from SRCDIR is ignored).
-
---Guido van Rossum (home page: http://www.python.org/~guido/)
diff --git a/Tools/faqwiz/faqconf.py b/Tools/faqwiz/faqconf.py
deleted file mode 100644
index d1acd80c03..0000000000
--- a/Tools/faqwiz/faqconf.py
+++ /dev/null
@@ -1,577 +0,0 @@
-"""FAQ Wizard customization module.
-
-Edit this file to customize the FAQ Wizard. For normal purposes, you
-should only have to change the FAQ section titles and the small group
-of parameters below it.
-
-"""
-
-# Titles of FAQ sections
-
-SECTION_TITLES = {
- # SectionNumber : SectionTitle; need at least one entry
- 1: "General information and availability",
-}
-
-# Parameters you definitely want to change
-
-SHORTNAME = "Generic" # FAQ name with "FAQ" omitted
-PASSWORD = "" # Password for editing
-OWNERNAME = "FAQ owner" # Name for feedback
-OWNEREMAIL = "nobody@anywhere.org" # Email for feedback
-HOMEURL = "http://www.python.org" # Related home page
-HOMENAME = "Python home" # Name of related home page
-RCSBINDIR = "/usr/local/bin/" # Directory containing RCS commands
- # (must end in a slash)
-
-# Parameters you can normally leave alone
-
-MAXHITS = 10 # Max #hits to be shown directly
-COOKIE_LIFETIME = 28*24*3600 # Cookie expiration in seconds
- # (28*24*3600 = 28 days = 4 weeks)
-PROCESS_PREFORMAT = 1 # toggle whether preformatted text
- # will replace urls and emails with
- # HTML links
-
-# Markers appended to title to indicate recently change
-# (may contain HTML, e.g. <IMG>); and corresponding
-
-MARK_VERY_RECENT = " **" # Changed very recently
-MARK_RECENT = " *" # Changed recently
-DT_VERY_RECENT = 24*3600 # 24 hours
-DT_RECENT = 7*24*3600 # 7 days
-
-EXPLAIN_MARKS = """
-<P>(Entries marked with ** were changed within the last 24 hours;
-entries marked with * were changed within the last 7 days.)
-<P>
-"""
-
-# Version -- don't change unless you edit faqwiz.py
-
-WIZVERSION = "1.0.4" # FAQ Wizard version
-
-import os, sys
-if os.name in ['nt',]:
- # On NT we'll probably be running python from a batch file,
- # so sys.argv[0] is not helpful
- FAQCGI = 'faq.bat' # Relative URL of the FAQ cgi script
- # LOGNAME is not typically set on NT
- os.environ[ 'LOGNAME' ] = "FAQWizard"
-else:
- # This parameter is normally overwritten with a dynamic value
- FAQCGI = 'faqw.py' # Relative URL of the FAQ cgi script
- FAQCGI = os.path.basename(sys.argv[0]) or FAQCGI
-del os, sys
-
-# Perl (re module) style regular expression to recognize FAQ entry
-# files: group(1) should be the section number, group(2) should be the
-# question number. Both should be fixed width so simple-minded
-# sorting yields the right order.
-
-OKFILENAME = r"^faq(\d\d)\.(\d\d\d)\.htp$"
-
-# Format to construct a FAQ entry file name
-
-NEWFILENAME = "faq%02d.%03d.htp"
-
-# Load local customizations on top of the previous parameters
-
-try:
- from faqcust import *
-except ImportError:
- pass
-
-# Calculated parameter names
-
-COOKIE_NAME = SHORTNAME + "-FAQ-Wizard" # Name used for Netscape cookie
-FAQNAME = SHORTNAME + " FAQ" # Name of the FAQ
-
-# ----------------------------------------------------------------------
-
-# Anything below this point normally needn't be changed; you would
-# change this if you were to create e.g. a French translation or if
-# you just aren't happy with the text generated by the FAQ Wizard.
-
-# Most strings here are subject to substitution (string%dictionary)
-
-# RCS commands
-
-import os
-if os.name in ['nt', ]:
- SH_RLOG = RCSBINDIR + "rlog %(file)s < NUL"
- SH_RLOG_H = RCSBINDIR + "rlog -h %(file)s < NUL"
- SH_RDIFF = RCSBINDIR + "rcsdiff -r%(prev)s -r%(rev)s %(file)s < NUL"
- SH_REVISION = RCSBINDIR + "co -p%(rev)s %(file)s < NUL"
- ### Have to use co -l, or the file is not marked rw on NT
- SH_LOCK = RCSBINDIR + "co -l %(file)s < NUL"
- SH_CHECKIN = RCSBINDIR + "ci -u %(file)s < %(tfn)s"
-else:
- SH_RLOG = RCSBINDIR + "rlog %(file)s </dev/null 2>&1"
- SH_RLOG_H = RCSBINDIR + "rlog -h %(file)s </dev/null 2>&1"
- SH_RDIFF = RCSBINDIR + "rcsdiff -r%(prev)s -r%(rev)s %(file)s </dev/null 2>&1"
- SH_REVISION = RCSBINDIR + "co -p%(rev)s %(file)s </dev/null 2>&1"
- SH_LOCK = RCSBINDIR + "rcs -l %(file)s </dev/null 2>&1"
- SH_CHECKIN = RCSBINDIR + "ci -u %(file)s <%(tfn)s 2>&1"
-del os
-
-# Titles for various output pages (not subject to substitution)
-
-T_HOME = FAQNAME + " Wizard " + WIZVERSION
-T_ERROR = "Sorry, an error occurred"
-T_ROULETTE = FAQNAME + " Roulette"
-T_ALL = "The Whole " + FAQNAME
-T_INDEX = FAQNAME + " Index"
-T_SEARCH = FAQNAME + " Search Results"
-T_RECENT = "What's New in the " + FAQNAME
-T_SHOW = FAQNAME + " Entry"
-T_LOG = "RCS log for %s entry" % FAQNAME
-T_REVISION = "RCS revision for %s entry" % FAQNAME
-T_DIFF = "RCS diff for %s entry" % FAQNAME
-T_ADD = "Add an entry to the " + FAQNAME
-T_DELETE = "Deleting an entry from the " + FAQNAME
-T_EDIT = FAQNAME + " Edit Wizard"
-T_REVIEW = T_EDIT + " - Review Changes"
-T_COMMITTED = T_EDIT + " - Changes Committed"
-T_COMMITFAILED = T_EDIT + " - Commit Failed"
-T_CANTCOMMIT = T_EDIT + " - Commit Rejected"
-T_HELP = T_EDIT + " - Help"
-
-# Generic prologue and epilogue
-
-PROLOGUE = '''
-<HTML>
-<HEAD>
-<TITLE>%(title)s</TITLE>
-</HEAD>
-
-<BODY
- BGCOLOR="#FFFFFF"
- TEXT="#000000"
- LINK="#AA0000"
- VLINK="#906A6A">
-<H1>%(title)s</H1>
-'''
-
-EPILOGUE = '''
-<HR>
-<A HREF="%(HOMEURL)s">%(HOMENAME)s</A> /
-<A HREF="%(FAQCGI)s?req=home">%(FAQNAME)s Wizard %(WIZVERSION)s</A> /
-Feedback to <A HREF="mailto:%(OWNEREMAIL)s">%(OWNERNAME)s</A>
-
-</BODY>
-</HTML>
-'''
-
-# Home page
-
-HOME = """
-<H2>Search the %(FAQNAME)s:</H2>
-
-<BLOCKQUOTE>
-
-<FORM ACTION="%(FAQCGI)s">
- <INPUT TYPE=text NAME=query>
- <INPUT TYPE=submit VALUE="Search"><BR>
- <INPUT TYPE=radio NAME=querytype VALUE=simple CHECKED>
- Simple string
- /
- <INPUT TYPE=radio NAME=querytype VALUE=regex>
- Regular expression
- /<BR>
- <INPUT TYPE=radio NAME=querytype VALUE=anykeywords>
- Keywords (any)
- /
- <INPUT TYPE=radio NAME=querytype VALUE=allkeywords>
- Keywords (all)
- <BR>
- <INPUT TYPE=radio NAME=casefold VALUE=yes CHECKED>
- Fold case
- /
- <INPUT TYPE=radio NAME=casefold VALUE=no>
- Case sensitive
- <BR>
- <INPUT TYPE=hidden NAME=req VALUE=search>
-</FORM>
-
-</BLOCKQUOTE>
-
-<HR>
-
-<H2>Other forms of %(FAQNAME)s access:</H2>
-
-<UL>
-<LI><A HREF="%(FAQCGI)s?req=index">FAQ index</A>
-<LI><A HREF="%(FAQCGI)s?req=all">The whole FAQ</A>
-<LI><A HREF="%(FAQCGI)s?req=recent">What's new in the FAQ?</A>
-<LI><A HREF="%(FAQCGI)s?req=roulette">FAQ roulette</A>
-<LI><A HREF="%(FAQCGI)s?req=add">Add a FAQ entry</A>
-<LI><A HREF="%(FAQCGI)s?req=delete">Delete a FAQ entry</A>
-</UL>
-"""
-
-# Index formatting
-
-INDEX_SECTION = """
-<P>
-<HR>
-<H2>%(sec)s. %(title)s</H2>
-<UL>
-"""
-
-INDEX_ADDSECTION = """
-<P>
-<LI><A HREF="%(FAQCGI)s?req=new&amp;section=%(sec)s">Add new entry</A>
-(at this point)
-"""
-
-INDEX_ENDSECTION = """
-</UL>
-"""
-
-INDEX_ENTRY = """\
-<LI><A HREF="%(FAQCGI)s?req=show&amp;file=%(file)s">%(title)s</A>
-"""
-
-LOCAL_ENTRY = """\
-<LI><A HREF="#%(sec)s.%(num)s">%(title)s</A>
-"""
-
-# Entry formatting
-
-ENTRY_HEADER1 = """
-<HR>
-<H2><A NAME="%(sec)s.%(num)s">%(title)s</A>\
-"""
-
-ENTRY_HEADER2 = """\
-</H2>
-"""
-
-ENTRY_FOOTER = """
-<A HREF="%(FAQCGI)s?req=edit&amp;file=%(file)s">Edit this entry</A> /
-<A HREF="%(FAQCGI)s?req=log&amp;file=%(file)s">Log info</A>
-"""
-
-ENTRY_LOGINFO = """
-/ Last changed on %(last_changed_date)s by
-<A HREF="mailto:%(last_changed_email)s">%(last_changed_author)s</A>
-"""
-
-# Search
-
-NO_HITS = """
-No hits.
-"""
-
-ONE_HIT = """
-Your search matched the following entry:
-"""
-
-FEW_HITS = """
-Your search matched the following %(count)s entries:
-"""
-
-MANY_HITS = """
-Your search matched more than %(MAXHITS)s entries.
-The %(count)s matching entries are presented here ordered by section:
-"""
-
-# RCS log and diff
-
-LOG = """
-Click on a revision line to see the diff between that revision and the
-previous one.
-"""
-
-REVISIONLINK = """\
-<A HREF="%(FAQCGI)s?req=revision&amp;file=%(file)s&amp;rev=%(rev)s"
->%(line)s</A>\
-"""
-DIFFLINK = """\
- (<A HREF="%(FAQCGI)s?req=diff&amp;file=%(file)s&amp;\
-prev=%(prev)s&amp;rev=%(rev)s"
->diff -r%(prev)s -r%(rev)s</A>)\
-"""
-
-# Recently changed entries
-
-NO_RECENT = """
-<HR>
-No %(FAQNAME)s entries were changed in the last %(period)s.
-"""
-
-VIEW_MENU = """
-<HR>
-View entries changed in the last...
-<UL>
-<LI><A HREF="%(FAQCGI)s?req=recent&amp;days=1">24 hours</A>
-<LI><A HREF="%(FAQCGI)s?req=recent&amp;days=2">2 days</A>
-<LI><A HREF="%(FAQCGI)s?req=recent&amp;days=3">3 days</A>
-<LI><A HREF="%(FAQCGI)s?req=recent&amp;days=7">week</A>
-<LI><A HREF="%(FAQCGI)s?req=recent&amp;days=28">4 weeks</A>
-<LI><A HREF="%(FAQCGI)s?req=recent&amp;days=365250">millennium</A>
-</UL>
-"""
-
-ONE_RECENT = VIEW_MENU + """
-The following %(FAQNAME)s entry was changed in the last %(period)s:
-"""
-
-SOME_RECENT = VIEW_MENU + """
-The following %(count)s %(FAQNAME)s entries were changed
-in the last %(period)s, most recently changed shown first:
-"""
-
-TAIL_RECENT = VIEW_MENU
-
-# Last changed banner on "all" (strftime format)
-LAST_CHANGED = "Last changed on %c %Z"
-
-# "Compat" command prologue (this has no <BODY> tag)
-COMPAT = """
-<H1>The whole %(FAQNAME)s</H1>
-See also the <A HREF="%(FAQCGI)s?req=home">%(FAQNAME)s Wizard</A>.
-<P>
-"""
-
-# Editing
-
-EDITHEAD = """
-<A HREF="%(FAQCGI)s?req=help">Click for Help</A>
-"""
-
-REVIEWHEAD = EDITHEAD
-
-
-EDITFORM1 = """
-<FORM ACTION="%(FAQCGI)s" METHOD=POST>
-<INPUT TYPE=hidden NAME=req VALUE=review>
-<INPUT TYPE=hidden NAME=file VALUE=%(file)s>
-<INPUT TYPE=hidden NAME=editversion VALUE=%(editversion)s>
-<HR>
-"""
-
-EDITFORM2 = """
-Title: <INPUT TYPE=text SIZE=70 NAME=title VALUE="%(title)s"><BR>
-<TEXTAREA COLS=72 ROWS=20 NAME=body>%(body)s
-</TEXTAREA><BR>
-Log message (reason for the change):<BR>
-<TEXTAREA COLS=72 ROWS=5 NAME=log>%(log)s
-</TEXTAREA><BR>
-Please provide the following information for logging purposes:
-<TABLE FRAME=none COLS=2>
- <TR>
- <TD>Name:
- <TD><INPUT TYPE=text SIZE=40 NAME=author VALUE="%(author)s">
- <TR>
- <TD>Email:
- <TD><INPUT TYPE=text SIZE=40 NAME=email VALUE="%(email)s">
- <TR>
- <TD>Password:
- <TD><INPUT TYPE=password SIZE=20 NAME=password VALUE="%(password)s">
-</TABLE>
-
-<INPUT TYPE=submit NAME=review VALUE="Preview Edit">
-Click this button to preview your changes.
-"""
-
-EDITFORM3 = """
-</FORM>
-"""
-
-COMMIT = """
-<INPUT TYPE=submit NAME=commit VALUE="Commit">
-Click this button to commit your changes.
-<HR>
-"""
-
-NOCOMMIT_HEAD = """
-To commit your changes, please correct the following errors in the
-form below and click the Preview Edit button.
-<UL>
-"""
-NOCOMMIT_TAIL = """
-</UL>
-<HR>
-"""
-
-CANTCOMMIT_HEAD = """
-Some required information is missing:
-<UL>
-"""
-NEED_PASSWD = "<LI>You must provide the correct password.\n"
-NEED_AUTHOR = "<LI>You must enter your name.\n"
-NEED_EMAIL = "<LI>You must enter your email address.\n"
-NEED_LOG = "<LI>You must enter a log message.\n"
-CANTCOMMIT_TAIL = """
-</UL>
-Please use your browser's Back command to correct the form and commit
-again.
-"""
-
-NEWCONFLICT = """
-<P>
-You are creating a new entry, but the entry number specified is not
-correct.
-<P>
-The two most common causes of this problem are:
-<UL>
-<LI>After creating the entry yourself, you went back in your browser,
- edited the entry some more, and clicked Commit again.
-<LI>Someone else started creating a new entry in the same section and
- committed before you did.
-</UL>
-(It is also possible that the last entry in the section was physically
-deleted, but this should not happen except through manual intervention
-by the FAQ maintainer.)
-<P>
-<A HREF="%(FAQCGI)s?req=new&amp;section=%(sec)s">Click here to try
-again.</A>
-<P>
-"""
-
-VERSIONCONFLICT = """
-<P>
-You edited version %(editversion)s but the current version is %(version)s.
-<P>
-The two most common causes of this problem are:
-<UL>
-<LI>After committing a change, you went back in your browser,
- edited the entry some more, and clicked Commit again.
-<LI>Someone else started editing the same entry and committed
- before you did.
-</UL>
-<P>
-<A HREF="%(FAQCGI)s?req=show&amp;file=%(file)s">Click here to reload
-the entry and try again.</A>
-<P>
-"""
-
-CANTWRITE = """
-Can't write file %(file)s (%(why)s).
-"""
-
-FILEHEADER = """\
-Title: %(title)s
-Last-Changed-Date: %(date)s
-Last-Changed-Author: %(author)s
-Last-Changed-Email: %(email)s
-Last-Changed-Remote-Host: %(REMOTE_HOST)s
-Last-Changed-Remote-Address: %(REMOTE_ADDR)s
-"""
-
-LOGHEADER = """\
-Last-Changed-Date: %(date)s
-Last-Changed-Author: %(author)s
-Last-Changed-Email: %(email)s
-Last-Changed-Remote-Host: %(REMOTE_HOST)s
-Last-Changed-Remote-Address: %(REMOTE_ADDR)s
-
-%(log)s
-"""
-
-COMMITTED = """
-Your changes have been committed.
-"""
-
-COMMITFAILED = """
-Exit status %(sts)s.
-"""
-
-# Add/Delete
-
-ADD_HEAD = """
-At the moment, new entries can only be added at the end of a section.
-This is because the entry numbers are also their
-unique identifiers -- it's a bad idea to renumber entries.
-<P>
-Click on the section to which you want to add a new entry:
-<UL>
-"""
-
-ADD_SECTION = """\
-<LI><A HREF="%(FAQCGI)s?req=new&amp;section=%(section)s">%(section)s. %(title)s</A>
-"""
-
-ADD_TAIL = """
-</UL>
-"""
-
-ROULETTE = """
-<P>Hit your browser's Reload button to play again.<P>
-"""
-
-DELETE = """
-At the moment, there's no direct way to delete entries.
-This is because the entry numbers are also their
-unique identifiers -- it's a bad idea to renumber entries.
-<P>
-If you really think an entry needs to be deleted,
-change the title to "(deleted)" and make the body
-empty (keep the entry number in the title though).
-"""
-
-# Help file for the FAQ Edit Wizard
-
-HELP = """
-Using the %(FAQNAME)s Edit Wizard speaks mostly for itself. Here are
-some answers to questions you are likely to ask:
-
-<P><HR>
-
-<H2>I can review an entry but I can't commit it.</H2>
-
-The commit button only appears if the following conditions are met:
-
-<UL>
-
-<LI>The Name field is not empty.
-
-<LI>The Email field contains at least an @ character.
-
-<LI>The Log message box is not empty.
-
-<LI>The Password field contains the proper password.
-
-</UL>
-
-<P><HR>
-
-<H2>What is the password?</H2>
-
-At the moment, only PSA members will be told the password. This is a
-good time to join the PSA! See <A
-HREF="http://www.python.org/psa/">the PSA home page</A>.
-
-<P><HR>
-
-<H2>Can I use HTML in the FAQ entry?</H2>
-
-Yes, if you include it in &lt;HTML&rt; and &lt;/HTML&gt; tags.
-<P>
-Also, if you include a URL or an email address in the text it will
-automatigally become an anchor of the right type. Also, *word*
-is made italic (but only for single alphabetic words).
-
-<P><HR>
-
-<H2>How do I delineate paragraphs?</H2>
-
-Use blank lines to separate paragraphs.
-
-<P><HR>
-
-<H2>How do I enter example text?</H2>
-
-Any line that begins with a space or tab is assumed to be part of
-literal text. Blocks of literal text delineated by blank lines are
-placed inside &lt;PRE&gt;...&lt;/PRE&gt;.
-"""
-
-# Load local customizations again, in case they set some other variables
-
-try:
- from faqcust import *
-except ImportError:
- pass
diff --git a/Tools/faqwiz/faqcust.py b/Tools/faqwiz/faqcust.py
deleted file mode 100644
index 8f1678188c..0000000000
--- a/Tools/faqwiz/faqcust.py
+++ /dev/null
@@ -1 +0,0 @@
-# Add your customizations here -- modified copies of what's in faqconf.py.
diff --git a/Tools/faqwiz/faqw.py b/Tools/faqwiz/faqw.py
deleted file mode 100755
index d972f61e05..0000000000
--- a/Tools/faqwiz/faqw.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /usr/local/bin/python
-
-"""FAQ wizard bootstrap."""
-
-# This is a longer version of the bootstrap script given at the end of
-# faqwin.py; it prints timing statistics at the end of the regular CGI
-# script's output (so you can monitor how it is doing).
-
-# This script should be placed in your cgi-bin directory and made
-# executable.
-
-# You need to edit the first line and the lines that define FAQDIR and
-# SRCDIR, below: change /usr/local/bin/python to where your Python
-# interpreter lives, change the value for FAQDIR to where your FAQ
-# lives, and change the value for SRCDIR to where your faqwiz.py
-# module lives. The faqconf.py and faqcust.py files live there, too.
-
-import os
-t1 = os.times() # If this doesn't work, just get rid of the timing code!
-try:
- FAQDIR = "/usr/people/guido/python/FAQ"
- SRCDIR = "/usr/people/guido/python/src/Tools/faqwiz"
- import os, sys
- os.chdir(FAQDIR)
- sys.path.insert(0, SRCDIR)
- import faqwiz
-except SystemExit as n:
- sys.exit(n)
-except:
- t, v, tb = sys.exc_info()
- print()
- import cgi
- cgi.print_exception(t, v, tb)
diff --git a/Tools/faqwiz/faqwiz.py b/Tools/faqwiz/faqwiz.py
deleted file mode 100644
index b9ab65d3bf..0000000000
--- a/Tools/faqwiz/faqwiz.py
+++ /dev/null
@@ -1,840 +0,0 @@
-"""Generic FAQ Wizard.
-
-This is a CGI program that maintains a user-editable FAQ. It uses RCS
-to keep track of changes to individual FAQ entries. It is fully
-configurable; everything you might want to change when using this
-program to maintain some other FAQ than the Python FAQ is contained in
-the configuration module, faqconf.py.
-
-Note that this is not an executable script; it's an importable module.
-The actual script to place in cgi-bin is faqw.py.
-
-"""
-
-import sys, time, os, stat, re, cgi, faqconf
-from faqconf import * # This imports all uppercase names
-now = time.time()
-
-class FileError:
- def __init__(self, file):
- self.file = file
-
-class InvalidFile(FileError):
- pass
-
-class NoSuchSection(FileError):
- def __init__(self, section):
- FileError.__init__(self, NEWFILENAME %(section, 1))
- self.section = section
-
-class NoSuchFile(FileError):
- def __init__(self, file, why=None):
- FileError.__init__(self, file)
- self.why = why
-
-def escape(s):
- s = s.replace('&', '&amp;')
- s = s.replace('<', '&lt;')
- s = s.replace('>', '&gt;')
- return s
-
-def escapeq(s):
- s = escape(s)
- s = s.replace('"', '&quot;')
- return s
-
-def _interpolate(format, args, kw):
- try:
- quote = kw['_quote']
- except KeyError:
- quote = 1
- d = (kw,) + args + (faqconf.__dict__,)
- m = MagicDict(d, quote)
- return format % m
-
-def interpolate(format, *args, **kw):
- return _interpolate(format, args, kw)
-
-def emit(format, *args, **kw):
- try:
- f = kw['_file']
- except KeyError:
- f = sys.stdout
- f.write(_interpolate(format, args, kw))
-
-translate_prog = None
-
-def translate(text, pre=0):
- global translate_prog
- if not translate_prog:
- translate_prog = prog = re.compile(
- r'\b(http|ftp|https)://\S+(\b|/)|\b[-.\w]+@[-.\w]+')
- else:
- prog = translate_prog
- i = 0
- list = []
- while 1:
- m = prog.search(text, i)
- if not m:
- break
- j = m.start()
- list.append(escape(text[i:j]))
- i = j
- url = m.group(0)
- while url[-1] in '();:,.?\'"<>':
- url = url[:-1]
- i = i + len(url)
- url = escape(url)
- if not pre or (pre and PROCESS_PREFORMAT):
- if ':' in url:
- repl = '<A HREF="%s">%s</A>' % (url, url)
- else:
- repl = '<A HREF="mailto:%s">%s</A>' % (url, url)
- else:
- repl = url
- list.append(repl)
- j = len(text)
- list.append(escape(text[i:j]))
- return ''.join(list)
-
-def emphasize(line):
- return re.sub(r'\*([a-zA-Z]+)\*', r'<I>\1</I>', line)
-
-revparse_prog = None
-
-def revparse(rev):
- global revparse_prog
- if not revparse_prog:
- revparse_prog = re.compile(r'^(\d{1,3})\.(\d{1,4})$')
- m = revparse_prog.match(rev)
- if not m:
- return None
- [major, minor] = map(int, m.group(1, 2))
- return major, minor
-
-logon = 0
-def log(text):
- if logon:
- logfile = open("logfile", "a")
- logfile.write(text + "\n")
- logfile.close()
-
-def load_cookies():
- if 'HTTP_COOKIE' not in os.environ:
- return {}
- raw = os.environ['HTTP_COOKIE']
- words = [s.strip() for s in raw.split(';')]
- cookies = {}
- for word in words:
- i = word.find('=')
- if i >= 0:
- key, value = word[:i], word[i+1:]
- cookies[key] = value
- return cookies
-
-def load_my_cookie():
- cookies = load_cookies()
- try:
- value = cookies[COOKIE_NAME]
- except KeyError:
- return {}
- import urllib.parse
- value = urllib.parse.unquote(value)
- words = value.split('/')
- while len(words) < 3:
- words.append('')
- author = '/'.join(words[:-2])
- email = words[-2]
- password = words[-1]
- return {'author': author,
- 'email': email,
- 'password': password}
-
-def send_my_cookie(ui):
- name = COOKIE_NAME
- value = "%s/%s/%s" % (ui.author, ui.email, ui.password)
- import urllib.parse
- value = urllib.parse.quote(value)
- then = now + COOKIE_LIFETIME
- gmt = time.gmtime(then)
- path = os.environ.get('SCRIPT_NAME', '/cgi-bin/')
- print("Set-Cookie: %s=%s; path=%s;" % (name, value, path), end=' ')
- print(time.strftime("expires=%a, %d-%b-%y %X GMT", gmt))
-
-class MagicDict:
-
- def __init__(self, d, quote):
- self.__d = d
- self.__quote = quote
-
- def __getitem__(self, key):
- for d in self.__d:
- try:
- value = d[key]
- if value:
- value = str(value)
- if self.__quote:
- value = escapeq(value)
- return value
- except KeyError:
- pass
- return ''
-
-class UserInput:
-
- def __init__(self):
- self.__form = cgi.FieldStorage()
- #log("\n\nbody: " + self.body)
-
- def __getattr__(self, name):
- if name[0] == '_':
- raise AttributeError
- try:
- value = self.__form[name].value
- except (TypeError, KeyError):
- value = ''
- else:
- value = value.strip()
- setattr(self, name, value)
- return value
-
- def __getitem__(self, key):
- return getattr(self, key)
-
-class FaqEntry:
-
- def __init__(self, fp, file, sec_num):
- self.file = file
- self.sec, self.num = sec_num
- if fp:
- import email
- self.__headers = email.message_from_file(fp)
- self.body = fp.read().strip()
- else:
- self.__headers = {'title': "%d.%d. " % sec_num}
- self.body = ''
-
- def __getattr__(self, name):
- if name[0] == '_':
- raise AttributeError
- key = '-'.join(name.split('_'))
- try:
- value = self.__headers[key]
- except KeyError:
- value = ''
- setattr(self, name, value)
- return value
-
- def __getitem__(self, key):
- return getattr(self, key)
-
- def load_version(self):
- command = interpolate(SH_RLOG_H, self)
- p = os.popen(command)
- version = ''
- while 1:
- line = p.readline()
- if not line:
- break
- if line[:5] == 'head:':
- version = line[5:].strip()
- p.close()
- self.version = version
-
- def getmtime(self):
- if not self.last_changed_date:
- return 0
- try:
- return os.stat(self.file)[stat.ST_MTIME]
- except os.error:
- return 0
-
- def emit_marks(self):
- mtime = self.getmtime()
- if mtime >= now - DT_VERY_RECENT:
- emit(MARK_VERY_RECENT, self)
- elif mtime >= now - DT_RECENT:
- emit(MARK_RECENT, self)
-
- def show(self, edit=1):
- emit(ENTRY_HEADER1, self)
- self.emit_marks()
- emit(ENTRY_HEADER2, self)
- pre = 0
- raw = 0
- for line in self.body.split('\n'):
- # Allow the user to insert raw html into a FAQ answer
- # (Skip Montanaro, with changes by Guido)
- tag = line.rstrip().lower()
- if tag == '<html>':
- raw = 1
- continue
- if tag == '</html>':
- raw = 0
- continue
- if raw:
- print(line)
- continue
- if not line.strip():
- if pre:
- print('</PRE>')
- pre = 0
- else:
- print('<P>')
- else:
- if not line[0].isspace():
- if pre:
- print('</PRE>')
- pre = 0
- else:
- if not pre:
- print('<PRE>')
- pre = 1
- if '/' in line or '@' in line:
- line = translate(line, pre)
- elif '<' in line or '&' in line:
- line = escape(line)
- if not pre and '*' in line:
- line = emphasize(line)
- print(line)
- if pre:
- print('</PRE>')
- pre = 0
- if edit:
- print('<P>')
- emit(ENTRY_FOOTER, self)
- if self.last_changed_date:
- emit(ENTRY_LOGINFO, self)
- print('<P>')
-
-class FaqDir:
-
- entryclass = FaqEntry
-
- __okprog = re.compile(OKFILENAME)
-
- def __init__(self, dir=os.curdir):
- self.__dir = dir
- self.__files = None
-
- def __fill(self):
- if self.__files is not None:
- return
- self.__files = files = []
- okprog = self.__okprog
- for file in os.listdir(self.__dir):
- if self.__okprog.match(file):
- files.append(file)
- files.sort()
-
- def good(self, file):
- return self.__okprog.match(file)
-
- def parse(self, file):
- m = self.good(file)
- if not m:
- return None
- sec, num = m.group(1, 2)
- return int(sec), int(num)
-
- def list(self):
- # XXX Caller shouldn't modify result
- self.__fill()
- return self.__files
-
- def open(self, file):
- sec_num = self.parse(file)
- if not sec_num:
- raise InvalidFile(file)
- try:
- fp = open(file)
- except IOError as msg:
- raise NoSuchFile(file, msg)
- try:
- return self.entryclass(fp, file, sec_num)
- finally:
- fp.close()
-
- def show(self, file, edit=1):
- self.open(file).show(edit=edit)
-
- def new(self, section):
- if section not in SECTION_TITLES:
- raise NoSuchSection(section)
- maxnum = 0
- for file in self.list():
- sec, num = self.parse(file)
- if sec == section:
- maxnum = max(maxnum, num)
- sec_num = (section, maxnum+1)
- file = NEWFILENAME % sec_num
- return self.entryclass(None, file, sec_num)
-
-class FaqWizard:
-
- def __init__(self):
- self.ui = UserInput()
- self.dir = FaqDir()
-
- def go(self):
- print('Content-type: text/html')
- req = self.ui.req or 'home'
- mname = 'do_%s' % req
- try:
- meth = getattr(self, mname)
- except AttributeError:
- self.error("Bad request type %r." % (req,))
- else:
- try:
- meth()
- except InvalidFile as exc:
- self.error("Invalid entry file name %s" % exc.file)
- except NoSuchFile as exc:
- self.error("No entry with file name %s" % exc.file)
- except NoSuchSection as exc:
- self.error("No section number %s" % exc.section)
- self.epilogue()
-
- def error(self, message, **kw):
- self.prologue(T_ERROR)
- emit(message, kw)
-
- def prologue(self, title, entry=None, **kw):
- emit(PROLOGUE, entry, kwdict=kw, title=escape(title))
-
- def epilogue(self):
- emit(EPILOGUE)
-
- def do_home(self):
- self.prologue(T_HOME)
- emit(HOME)
-
- def do_debug(self):
- self.prologue("FAQ Wizard Debugging")
- form = cgi.FieldStorage()
- cgi.print_form(form)
- cgi.print_environ(os.environ)
- cgi.print_directory()
- cgi.print_arguments()
-
- def do_search(self):
- query = self.ui.query
- if not query:
- self.error("Empty query string!")
- return
- if self.ui.querytype == 'simple':
- query = re.escape(query)
- queries = [query]
- elif self.ui.querytype in ('anykeywords', 'allkeywords'):
- words = [_f for _f in re.split('\W+', query) if _f]
- if not words:
- self.error("No keywords specified!")
- return
- words = [r'\b%s\b' % w for w in words]
- if self.ui.querytype[:3] == 'any':
- queries = ['|'.join(words)]
- else:
- # Each of the individual queries must match
- queries = words
- else:
- # Default to regular expression
- queries = [query]
- self.prologue(T_SEARCH)
- progs = []
- for query in queries:
- if self.ui.casefold == 'no':
- p = re.compile(query)
- else:
- p = re.compile(query, re.IGNORECASE)
- progs.append(p)
- hits = []
- for file in self.dir.list():
- try:
- entry = self.dir.open(file)
- except FileError:
- constants
- for p in progs:
- if not p.search(entry.title) and not p.search(entry.body):
- break
- else:
- hits.append(file)
- if not hits:
- emit(NO_HITS, self.ui, count=0)
- elif len(hits) <= MAXHITS:
- if len(hits) == 1:
- emit(ONE_HIT, count=1)
- else:
- emit(FEW_HITS, count=len(hits))
- self.format_all(hits, headers=0)
- else:
- emit(MANY_HITS, count=len(hits))
- self.format_index(hits)
-
- def do_all(self):
- self.prologue(T_ALL)
- files = self.dir.list()
- self.last_changed(files)
- self.format_index(files, localrefs=1)
- self.format_all(files)
-
- def do_compat(self):
- files = self.dir.list()
- emit(COMPAT)
- self.last_changed(files)
- self.format_index(files, localrefs=1)
- self.format_all(files, edit=0)
- sys.exit(0) # XXX Hack to suppress epilogue
-
- def last_changed(self, files):
- latest = 0
- for file in files:
- entry = self.dir.open(file)
- if entry:
- mtime = mtime = entry.getmtime()
- if mtime > latest:
- latest = mtime
- print(time.strftime(LAST_CHANGED, time.localtime(latest)))
- emit(EXPLAIN_MARKS)
-
- def format_all(self, files, edit=1, headers=1):
- sec = 0
- for file in files:
- try:
- entry = self.dir.open(file)
- except NoSuchFile:
- continue
- if headers and entry.sec != sec:
- sec = entry.sec
- try:
- title = SECTION_TITLES[sec]
- except KeyError:
- title = "Untitled"
- emit("\n<HR>\n<H1>%(sec)s. %(title)s</H1>\n",
- sec=sec, title=title)
- entry.show(edit=edit)
-
- def do_index(self):
- self.prologue(T_INDEX)
- files = self.dir.list()
- self.last_changed(files)
- self.format_index(files, add=1)
-
- def format_index(self, files, add=0, localrefs=0):
- sec = 0
- for file in files:
- try:
- entry = self.dir.open(file)
- except NoSuchFile:
- continue
- if entry.sec != sec:
- if sec:
- if add:
- emit(INDEX_ADDSECTION, sec=sec)
- emit(INDEX_ENDSECTION, sec=sec)
- sec = entry.sec
- try:
- title = SECTION_TITLES[sec]
- except KeyError:
- title = "Untitled"
- emit(INDEX_SECTION, sec=sec, title=title)
- if localrefs:
- emit(LOCAL_ENTRY, entry)
- else:
- emit(INDEX_ENTRY, entry)
- entry.emit_marks()
- if sec:
- if add:
- emit(INDEX_ADDSECTION, sec=sec)
- emit(INDEX_ENDSECTION, sec=sec)
-
- def do_recent(self):
- if not self.ui.days:
- days = 1
- else:
- days = float(self.ui.days)
- try:
- cutoff = now - days * 24 * 3600
- except OverflowError:
- cutoff = 0
- list = []
- for file in self.dir.list():
- entry = self.dir.open(file)
- if not entry:
- continue
- mtime = entry.getmtime()
- if mtime >= cutoff:
- list.append((mtime, file))
- list.sort()
- list.reverse()
- self.prologue(T_RECENT)
- if days <= 1:
- period = "%.2g hours" % (days*24)
- else:
- period = "%.6g days" % days
- if not list:
- emit(NO_RECENT, period=period)
- elif len(list) == 1:
- emit(ONE_RECENT, period=period)
- else:
- emit(SOME_RECENT, period=period, count=len(list))
- self.format_all([mtime_file[1] for mtime_file in list], headers=0)
- emit(TAIL_RECENT)
-
- def do_roulette(self):
- import random
- files = self.dir.list()
- if not files:
- self.error("No entries.")
- return
- file = random.choice(files)
- self.prologue(T_ROULETTE)
- emit(ROULETTE)
- self.dir.show(file)
-
- def do_help(self):
- self.prologue(T_HELP)
- emit(HELP)
-
- def do_show(self):
- entry = self.dir.open(self.ui.file)
- self.prologue(T_SHOW)
- entry.show()
-
- def do_add(self):
- self.prologue(T_ADD)
- emit(ADD_HEAD)
- sections = sorted(SECTION_TITLES.items())
- for section, title in sections:
- emit(ADD_SECTION, section=section, title=title)
- emit(ADD_TAIL)
-
- def do_delete(self):
- self.prologue(T_DELETE)
- emit(DELETE)
-
- def do_log(self):
- entry = self.dir.open(self.ui.file)
- self.prologue(T_LOG, entry)
- emit(LOG, entry)
- self.rlog(interpolate(SH_RLOG, entry), entry)
-
- def rlog(self, command, entry=None):
- output = os.popen(command).read()
- sys.stdout.write('<PRE>')
- athead = 0
- lines = output.split('\n')
- while lines and not lines[-1]:
- del lines[-1]
- if lines:
- line = lines[-1]
- if line[:1] == '=' and len(line) >= 40 and \
- line == line[0]*len(line):
- del lines[-1]
- headrev = None
- for line in lines:
- if entry and athead and line[:9] == 'revision ':
- rev = line[9:].split()
- mami = revparse(rev)
- if not mami:
- print(line)
- else:
- emit(REVISIONLINK, entry, rev=rev, line=line)
- if mami[1] > 1:
- prev = "%d.%d" % (mami[0], mami[1]-1)
- emit(DIFFLINK, entry, prev=prev, rev=rev)
- if headrev:
- emit(DIFFLINK, entry, prev=rev, rev=headrev)
- else:
- headrev = rev
- print()
- athead = 0
- else:
- athead = 0
- if line[:1] == '-' and len(line) >= 20 and \
- line == len(line) * line[0]:
- athead = 1
- sys.stdout.write('<HR>')
- else:
- print(line)
- print('</PRE>')
-
- def do_revision(self):
- entry = self.dir.open(self.ui.file)
- rev = self.ui.rev
- mami = revparse(rev)
- if not mami:
- self.error("Invalid revision number: %r." % (rev,))
- self.prologue(T_REVISION, entry)
- self.shell(interpolate(SH_REVISION, entry, rev=rev))
-
- def do_diff(self):
- entry = self.dir.open(self.ui.file)
- prev = self.ui.prev
- rev = self.ui.rev
- mami = revparse(rev)
- if not mami:
- self.error("Invalid revision number: %r." % (rev,))
- if prev:
- if not revparse(prev):
- self.error("Invalid previous revision number: %r." % (prev,))
- else:
- prev = '%d.%d' % (mami[0], mami[1])
- self.prologue(T_DIFF, entry)
- self.shell(interpolate(SH_RDIFF, entry, rev=rev, prev=prev))
-
- def shell(self, command):
- output = os.popen(command).read()
- sys.stdout.write('<PRE>')
- print(escape(output))
- print('</PRE>')
-
- def do_new(self):
- entry = self.dir.new(section=int(self.ui.section))
- entry.version = '*new*'
- self.prologue(T_EDIT)
- emit(EDITHEAD)
- emit(EDITFORM1, entry, editversion=entry.version)
- emit(EDITFORM2, entry, load_my_cookie())
- emit(EDITFORM3)
- entry.show(edit=0)
-
- def do_edit(self):
- entry = self.dir.open(self.ui.file)
- entry.load_version()
- self.prologue(T_EDIT)
- emit(EDITHEAD)
- emit(EDITFORM1, entry, editversion=entry.version)
- emit(EDITFORM2, entry, load_my_cookie())
- emit(EDITFORM3)
- entry.show(edit=0)
-
- def do_review(self):
- send_my_cookie(self.ui)
- if self.ui.editversion == '*new*':
- sec, num = self.dir.parse(self.ui.file)
- entry = self.dir.new(section=sec)
- entry.version = "*new*"
- if entry.file != self.ui.file:
- self.error("Commit version conflict!")
- emit(NEWCONFLICT, self.ui, sec=sec, num=num)
- return
- else:
- entry = self.dir.open(self.ui.file)
- entry.load_version()
- # Check that the FAQ entry number didn't change
- if self.ui.title.split()[:1] != entry.title.split()[:1]:
- self.error("Don't change the entry number please!")
- return
- # Check that the edited version is the current version
- if entry.version != self.ui.editversion:
- self.error("Commit version conflict!")
- emit(VERSIONCONFLICT, entry, self.ui)
- return
- commit_ok = ((not PASSWORD
- or self.ui.password == PASSWORD)
- and self.ui.author
- and '@' in self.ui.email
- and self.ui.log)
- if self.ui.commit:
- if not commit_ok:
- self.cantcommit()
- else:
- self.commit(entry)
- return
- self.prologue(T_REVIEW)
- emit(REVIEWHEAD)
- entry.body = self.ui.body
- entry.title = self.ui.title
- entry.show(edit=0)
- emit(EDITFORM1, self.ui, entry)
- if commit_ok:
- emit(COMMIT)
- else:
- emit(NOCOMMIT_HEAD)
- self.errordetail()
- emit(NOCOMMIT_TAIL)
- emit(EDITFORM2, self.ui, entry, load_my_cookie())
- emit(EDITFORM3)
-
- def cantcommit(self):
- self.prologue(T_CANTCOMMIT)
- print(CANTCOMMIT_HEAD)
- self.errordetail()
- print(CANTCOMMIT_TAIL)
-
- def errordetail(self):
- if PASSWORD and self.ui.password != PASSWORD:
- emit(NEED_PASSWD)
- if not self.ui.log:
- emit(NEED_LOG)
- if not self.ui.author:
- emit(NEED_AUTHOR)
- if not self.ui.email:
- emit(NEED_EMAIL)
-
- def commit(self, entry):
- file = entry.file
- # Normalize line endings in body
- if '\r' in self.ui.body:
- self.ui.body = re.sub('\r\n?', '\n', self.ui.body)
- # Normalize whitespace in title
- self.ui.title = ' '.join(self.ui.title.split())
- # Check that there were any changes
- if self.ui.body == entry.body and self.ui.title == entry.title:
- self.error("You didn't make any changes!")
- return
-
- # need to lock here because otherwise the file exists and is not writable (on NT)
- command = interpolate(SH_LOCK, file=file)
- p = os.popen(command)
- output = p.read()
-
- try:
- os.unlink(file)
- except os.error:
- pass
- try:
- f = open(file, 'w')
- except IOError as why:
- self.error(CANTWRITE, file=file, why=why)
- return
- date = time.ctime(now)
- emit(FILEHEADER, self.ui, os.environ, date=date, _file=f, _quote=0)
- f.write('\n')
- f.write(self.ui.body)
- f.write('\n')
- f.close()
-
- import tempfile
- tf = tempfile.NamedTemporaryFile()
- emit(LOGHEADER, self.ui, os.environ, date=date, _file=tf)
- tf.flush()
- tf.seek(0)
-
- command = interpolate(SH_CHECKIN, file=file, tfn=tf.name)
- log("\n\n" + command)
- p = os.popen(command)
- output = p.read()
- sts = p.close()
- log("output: " + output)
- log("done: " + str(sts))
- log("TempFile:\n" + tf.read() + "end")
-
- if not sts:
- self.prologue(T_COMMITTED)
- emit(COMMITTED)
- else:
- self.error(T_COMMITFAILED)
- emit(COMMITFAILED, sts=sts)
- print('<PRE>%s</PRE>' % escape(output))
-
- try:
- os.unlink(tf.name)
- except os.error:
- pass
-
- entry = self.dir.open(file)
- entry.show()
-
-wiz = FaqWizard()
-wiz.go()
diff --git a/Tools/faqwiz/move-faqwiz.sh b/Tools/faqwiz/move-faqwiz.sh
deleted file mode 100755
index b3bcc9245c..0000000000
--- a/Tools/faqwiz/move-faqwiz.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-#
-# Christian Reis <kiko@async.com.br>
-#
-# Moves
-#
-# Example:
-#
-# blackjesus:~> ./move-faqwiz.sh 2\.1 3\.2
-# Moving FAQ question 02.001 to 03.002
-
-if [ x$2 = x ]; then
- echo "Need 2 args: original_version final_version."
- exit 2
-fi
-
-if [ ! -d data -o ! -d data/RCS ]; then
- echo "Run this inside the faqwiz data/ directory's parent dir."
- exit 2
-fi
-
-cut_n_pad() {
- t=`echo $1 | cut -d. -f $2`
- export $3=`echo $t | awk "{ tmp = \\$0; l = length(tmp); for (i = 0; i < $2-l+1; i++) { tmp = "0".tmp } print tmp }"`
-}
-
-cut_n_pad $1 1 prefix1
-cut_n_pad $1 2 suffix1
-cut_n_pad $2 1 prefix2
-cut_n_pad $2 2 suffix2
-if which tempfile >/dev/null; then
- tmpfile=$(tempfile -d .)
-elif [ -n "$RANDOM" ]; then
- tmpfile=tmp$RANDOM.tmp
-else
- tmpfile=tmp$$.tmp
-fi
-file1=faq$prefix1.$suffix1.htp
-file2=faq$prefix2.$suffix2.htp
-
-echo "Moving FAQ question $prefix1.$suffix1 to $prefix2.$suffix2"
-
-sed -e "s/$1\./$2\./g" data/$file1 > ${tmpfile}1
-sed -e "s/$1\./$2\./g" data/RCS/$file1,v > ${tmpfile}2
-
-if [ -f data/$file2 ]; then
- echo "Target FAQ exists. Won't clobber."
- exit 2
-fi
-
-mv ${tmpfile}1 data/$file2
-mv ${tmpfile}2 data/RCS/$file2,v
-mv data/$file1 data/$file1.orig
-mv data/RCS/$file1,v data/RCS/$file1,v.orig
-
diff --git a/Tools/framer/README.txt b/Tools/framer/README.txt
deleted file mode 100644
index 4a93a4da92..0000000000
--- a/Tools/framer/README.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-framer is a tool to generate boilerplate code for C extension types.
-
-The boilerplate is generated from a specification object written in
-Python. The specification uses the class statement to describe the
-extension module and any extension types it contains. From the
-specification, framer can generate all the boilerplate C code,
-including function definitions, argument handling code, and type
-objects.
diff --git a/Tools/framer/TODO.txt b/Tools/framer/TODO.txt
deleted file mode 100644
index 8586c8e669..0000000000
--- a/Tools/framer/TODO.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Add spec for getsets.
-Generate a distutils setup script.
-Handle operator overloading.
-Generate traverse and clear methods for GC.
-Handle mapping, sequence, buffer protocols.
-Finish the todo list.
diff --git a/Tools/framer/example.py b/Tools/framer/example.py
deleted file mode 100644
index 8a267e9b1d..0000000000
--- a/Tools/framer/example.py
+++ /dev/null
@@ -1,126 +0,0 @@
-"""Generate the skeleton for cStringIO as an example of framer."""
-
-from framer.bases import Module, Type
-from framer.member import member
-
-class cStringIO(Module):
- """A simple fast partial StringIO replacement.
-
- This module provides a simple useful replacement for the StringIO
- module that is written in C. It does not provide the full
- generality of StringIO, but it provides enough for most
- applications and is especially useful in conjunction with the
- pickle module.
-
- Usage:
-
- from io import StringIO
-
- an_output_stream = StringIO()
- an_output_stream.write(some_stuff)
- ...
- value = an_output_stream.getvalue()
-
- an_input_stream = StringIO(a_string)
- spam = an_input_stream.readline()
- spam = an_input_stream.read(5)
- an_input_stream.seek(0) # OK, start over
- spam = an_input_stream.read() # and read it all
- """
-
- __file__ = "cStringIO.c"
-
- def StringIO(o):
- """Return a StringIO-like stream for reading or writing"""
- StringIO.pyarg = "|O"
-
- class InputType(Type):
- "Simple type for treating strings as input file streams"
-
- abbrev = "input"
-
- struct = """\
- typedef struct {
- PyObject_HEAD
- char *buf;
- int pos;
- int size;
- PyObject *pbuf;
- } InputObject;
- """
-
- def flush(self):
- """Does nothing"""
-
- def getvalue(self):
- """Get the string value.
-
- If use_pos is specified and is a true value, then the
- string returned will include only the text up to the
- current file position.
- """
-
- def isatty(self):
- """Always returns False"""
-
- def read(self, s):
- """Return s characters or the rest of the string."""
- read.pyarg = "|i"
-
- def readline(self):
- """Read one line."""
-
- def readlines(self, hint):
- """Read all lines."""
- readlines.pyarg = "|i"
-
- def reset(self):
- """Reset the file position to the beginning."""
-
- def tell(self):
- """Get the current position."""
-
- def truncate(self, pos):
- """Truncate the file at the current position."""
- truncate.pyarg = "|i"
-
- def seek(self, position, mode=0):
- """Set the current position.
-
- The optional mode argument can be 0 for absolute, 1 for relative,
- and 2 for relative to EOF. The default is absolute.
- """
- seek.pyarg = "i|i"
-
- def close(self):
- pass
-
- class OutputType(InputType):
- "Simple type for output strings."
-
- abbrev = "output"
-
- struct = """\
- typedef struct {
- PyObject_HEAD
- char *buf;
- int pos;
- int size;
- int softspace;
- } OutputObject;
- """
-
- softspace = member()
-
- def close(self):
- """Explicitly release resources."""
-
- def write(self, s):
- """Write a string to the file."""
- # XXX Hack: writing None resets the buffer
-
- def writelines(self, lines):
- """Write each string in lines."""
-
-
-cStringIO.gen()
diff --git a/Tools/framer/framer/__init__.py b/Tools/framer/framer/__init__.py
deleted file mode 100644
index d8f905898f..0000000000
--- a/Tools/framer/framer/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-"""A tool to generate basic framework for C extension types.
-
-The basic ideas is the same as modulator, but the code generates code
-using many of the new features introduced in Python 2.2. It also
-takes a more declarative approach to generating code.
-"""
diff --git a/Tools/framer/framer/bases.py b/Tools/framer/framer/bases.py
deleted file mode 100644
index 08aacb9eac..0000000000
--- a/Tools/framer/framer/bases.py
+++ /dev/null
@@ -1,215 +0,0 @@
-"""Provides the Module and Type base classes that user code inherits from."""
-
-__all__ = ["Module", "Type", "member"]
-
-from framer import struct, template
-from framer.function import Function, Method
-from framer.member import member
-from framer.slots import *
-from framer.util import cstring, unindent
-
-from types import FunctionType
-
-# The Module and Type classes are implemented using metaclasses,
-# because most of the methods are class methods. It is easier to use
-# metaclasses than the cumbersome classmethod() builtin. They have
-# class methods because they are exposed to user code as base classes.
-
-class BaseMetaclass(type):
- """Shared infrastructure for generating modules and types."""
-
- # just methoddef so far
-
- def dump_methoddef(self, f, functions, vars):
- def p(templ, vars=vars): # helper function to generate output
- print(templ % vars, file=f)
-
- if not functions:
- return
- p(template.methoddef_start)
- for name, func in sorted(functions.items()):
- if func.__doc__:
- p(template.methoddef_def_doc, func.vars)
- else:
- p(template.methoddef_def, func.vars)
- p(template.methoddef_end)
-
-class ModuleMetaclass(BaseMetaclass):
- """Provides methods for Module class."""
-
- def gen(self):
- self.analyze()
- self.initvars()
- f = open(self.__filename, "w")
- self.dump(f)
- f.close()
-
- def analyze(self):
- self.name = getattr(self, "abbrev", self.__name__)
- self.__functions = {}
- self.__types = {}
- self.__members = False
-
- for name, obj in self.__dict__.items():
- if isinstance(obj, FunctionType):
- self.__functions[name] = Function(obj, self)
- elif isinstance(obj, TypeMetaclass):
- obj._TypeMetaclass__module = self.name
- obj.analyze()
- self.__types[name] = obj
- if obj.has_members():
- self.__members = True
-
- def initvars(self):
- v = self.__vars = {}
- filename = getattr(self, "__file__", None)
- if filename is None:
- filename = self.__name__ + "module.c"
- self.__filename = v["FileName"] = filename
- name = v["ModuleName"] = self.__name__
- v["MethodDefName"] = "%s_methods" % name
- v["ModuleDocstring"] = cstring(unindent(self.__doc__))
-
- def dump(self, f):
- def p(templ, vars=self.__vars): # helper function to generate output
- print(templ % vars, file=f)
-
- p(template.module_start)
- if self.__members:
- p(template.member_include)
- print(file=f)
-
- if self.__doc__:
- p(template.module_doc)
-
- for name, type in sorted(self.__types.items()):
- type.dump(f)
-
- for name, func in sorted(self.__functions.items()):
- func.dump(f)
-
- self.dump_methoddef(f, self.__functions, self.__vars)
-
- p(template.module_init_start)
- for name, type in sorted(self.__types.items()):
- type.dump_init(f)
-
- p("}")
-
-class Module(metaclass=ModuleMetaclass):
- pass
-
-class TypeMetaclass(BaseMetaclass):
-
- def dump(self, f):
- self.initvars()
-
- # defined after initvars() so that __vars is defined
- def p(templ, vars=self.__vars):
- print(templ % vars, file=f)
-
- if self.struct is not None:
- print(unindent(self.struct, False), file=f)
-
- if self.__doc__:
- p(template.docstring)
-
- for name, func in sorted(self.__methods.items()):
- func.dump(f)
-
- self.dump_methoddef(f, self.__methods, self.__vars)
- self.dump_memberdef(f)
- self.dump_slots(f)
-
- def has_members(self):
- if self.__members:
- return True
- else:
- return False
-
- def analyze(self):
- # called by ModuleMetaclass analyze()
- self.name = getattr(self, "abbrev", self.__name__)
- src = getattr(self, "struct", None)
- if src is not None:
- self.__struct = struct.parse(src)
- else:
- self.__struct = None
- self.__methods = {}
- self.__members = {}
- for cls in self.__mro__:
- for k, v in cls.__dict__.items():
- if isinstance(v, FunctionType):
- self.__methods[k] = Method(v, self)
- if isinstance(v, member):
- self.__members[k] = v
- assert self.__struct is not None
- v.register(k, self.__struct)
- self.analyze_slots()
-
- def analyze_slots(self):
- self.__slots = {}
- for s in Slots:
- if s.special is not None:
- meth = self.__methods.get(s.special)
- if meth is not None:
- self.__slots[s] = meth
- self.__slots[TP_NAME] = '"%s.%s"' % (self.__module, self.__name__)
- if self.__doc__:
- self.__slots[TP_DOC] = "%s_doc" % self.name
- if self.__struct is not None:
- self.__slots[TP_BASICSIZE] = "sizeof(%s)" % self.__struct.name
- self.__slots[TP_DEALLOC] = "%s_dealloc" % self.name
- if self.__methods:
- self.__slots[TP_METHODS] = "%s_methods" % self.name
- if self.__members:
- self.__slots[TP_MEMBERS] = "%s_members" % self.name
-
- def initvars(self):
- v = self.__vars = {}
- v["TypeName"] = self.__name__
- v["CTypeName"] = "Py%s_Type" % self.__name__
- v["MethodDefName"] = self.__slots[TP_METHODS]
- if self.__doc__:
- v["DocstringVar"] = self.__slots[TP_DOC]
- v["Docstring"] = cstring(unindent(self.__doc__))
- if self.__struct is not None:
- v["StructName"] = self.__struct.name
- if self.__members:
- v["MemberDefName"] = self.__slots[TP_MEMBERS]
-
- def dump_memberdef(self, f):
- def p(templ, vars=self.__vars):
- print(templ % vars, file=f)
-
- if not self.__members:
- return
- p(template.memberdef_start)
- for name, slot in sorted(self.__members.items()):
- slot.dump(f)
- p(template.memberdef_end)
-
- def dump_slots(self, f):
- def p(templ, vars=self.__vars):
- print(templ % vars, file=f)
-
- if self.struct:
- p(template.dealloc_func, {"name" : self.__slots[TP_DEALLOC]})
-
- p(template.type_struct_start)
- for s in Slots[:-5]: # XXX
- val = self.__slots.get(s, s.default)
- ntabs = 4 - (4 + len(val)) / 8
- line = " %s,%s/* %s */" % (val, "\t" * ntabs, s.name)
- print(line, file=f)
- p(template.type_struct_end)
-
- def dump_init(self, f):
- def p(templ):
- print(templ % self.__vars, file=f)
-
- p(template.type_init_type)
- p(template.module_add_type)
-
-class Type(metaclass=TypeMetaclass):
- pass
diff --git a/Tools/framer/framer/function.py b/Tools/framer/framer/function.py
deleted file mode 100644
index f95ea208a1..0000000000
--- a/Tools/framer/framer/function.py
+++ /dev/null
@@ -1,173 +0,0 @@
-"""Functions."""
-
-from framer import template
-from framer.util import cstring, unindent
-
-METH_O = "METH_O"
-METH_NOARGS = "METH_NOARGS"
-METH_VARARGS = "METH_VARARGS"
-
-def parsefmt(fmt):
- for c in fmt:
- if c == '|':
- continue
- yield c
-
-class Argument:
-
- def __init__(self, name):
- self.name = name
- self.ctype = "PyObject *"
- self.default = None
-
- def __str__(self):
- return "%s%s" % (self.ctype, self.name)
-
- def setfmt(self, code):
- self.ctype = self._codes[code]
- if self.ctype[-1] != "*":
- self.ctype += " "
-
- _codes = {"O": "PyObject *",
- "i": "int",
- }
-
- def decl(self):
- if self.default is None:
- return str(self) + ";"
- else:
- return "%s = %s;" % (self, self.default)
-
-class _ArgumentList(object):
-
- # these instance variables should be initialized by subclasses
- ml_meth = None
- fmt = None
-
- def __init__(self, args):
- self.args = list(map(Argument, args))
-
- def __len__(self):
- return len(self.args)
-
- def __getitem__(self, i):
- return self.args[i]
-
- def dump_decls(self, f):
- pass
-
-class NoArgs(_ArgumentList):
-
- def __init__(self, args):
- assert len(args) == 0
- super(NoArgs, self).__init__(args)
- self.ml_meth = METH_NOARGS
-
- def c_args(self):
- return "PyObject *self"
-
-class OneArg(_ArgumentList):
-
- def __init__(self, args):
- assert len(args) == 1
- super(OneArg, self).__init__(args)
- self.ml_meth = METH_O
-
- def c_args(self):
- return "PyObject *self, %s" % self.args[0]
-
-class VarArgs(_ArgumentList):
-
- def __init__(self, args, fmt=None):
- super(VarArgs, self).__init__(args)
- self.ml_meth = METH_VARARGS
- if fmt is not None:
- self.fmt = fmt
- i = 0
- for code in parsefmt(fmt):
- self.args[i].setfmt(code)
- i += 1
-
- def c_args(self):
- return "PyObject *self, PyObject *args"
-
- def targets(self):
- return ", ".join(["&%s" % a.name for a in self.args])
-
- def dump_decls(self, f):
- for a in self.args:
- print(" %s" % a.decl(), file=f)
-
-def ArgumentList(func, method):
- code = func.__code__
- args = code.co_varnames[:code.co_argcount]
- if method:
- args = args[1:]
- pyarg = getattr(func, "pyarg", None)
- if pyarg is not None:
- args = VarArgs(args, pyarg)
- if func.__defaults__:
- L = list(func.__defaults__)
- ndefault = len(L)
- i = len(args) - ndefault
- while L:
- args[i].default = L.pop(0)
- return args
- else:
- if len(args) == 0:
- return NoArgs(args)
- elif len(args) == 1:
- return OneArg(args)
- else:
- return VarArgs(args)
-
-class Function:
-
- method = False
-
- def __init__(self, func, parent):
- self._func = func
- self._parent = parent
- self.analyze()
- self.initvars()
-
- def dump(self, f):
- def p(templ, vars=None): # helper function to generate output
- if vars is None:
- vars = self.vars
- print(templ % vars, file=f)
-
- if self.__doc__:
- p(template.docstring)
-
- d = {"name" : self.vars["CName"],
- "args" : self.args.c_args(),
- }
- p(template.funcdef_start, d)
-
- self.args.dump_decls(f)
-
- if self.args.ml_meth == METH_VARARGS:
- p(template.varargs)
-
- p(template.funcdef_end)
-
- def analyze(self):
- self.__doc__ = self._func.__doc__
- self.args = ArgumentList(self._func, self.method)
-
- def initvars(self):
- v = self.vars = {}
- v["PythonName"] = self._func.__name__
- s = v["CName"] = "%s_%s" % (self._parent.name, self._func.__name__)
- v["DocstringVar"] = s + "_doc"
- v["MethType"] = self.args.ml_meth
- if self.__doc__:
- v["Docstring"] = cstring(unindent(self.__doc__))
- if self.args.fmt is not None:
- v["ArgParse"] = self.args.fmt
- v["ArgTargets"] = self.args.targets()
-
-class Method(Function):
-
- method = True
diff --git a/Tools/framer/framer/member.py b/Tools/framer/framer/member.py
deleted file mode 100644
index 4838c1f990..0000000000
--- a/Tools/framer/framer/member.py
+++ /dev/null
@@ -1,73 +0,0 @@
-from framer import template
-from framer.util import cstring, unindent
-
-T_SHORT = "T_SHORT"
-T_INT = "T_INT"
-T_LONG = "T_LONG"
-T_FLOAT = "T_FLOAT"
-T_DOUBLE = "T_DOUBLE"
-T_STRING = "T_STRING"
-T_OBJECT = "T_OBJECT"
-T_CHAR = "T_CHAR"
-T_BYTE = "T_BYTE"
-T_UBYTE = "T_UBYTE"
-T_UINT = "T_UINT"
-T_ULONG = "T_ULONG"
-T_STRING_INPLACE = "T_STRING_INPLACE"
-T_OBJECT_EX = "T_OBJECT_EX"
-
-RO = READONLY = "READONLY"
-READ_RESTRICTED = "READ_RESTRICTED"
-WRITE_RESTRICTED = "WRITE_RESTRICTED"
-RESTRICT = "RESTRICTED"
-
-c2t = {"int" : T_INT,
- "unsigned int" : T_UINT,
- "long" : T_LONG,
- "unsigned long" : T_LONG,
- "float" : T_FLOAT,
- "double" : T_DOUBLE,
- "char *" : T_CHAR,
- "PyObject *" : T_OBJECT,
- }
-
-class member(object):
-
- def __init__(self, cname=None, type=None, flags=None, doc=None):
- self.type = type
- self.flags = flags
- self.cname = cname
- self.doc = doc
- self.name = None
- self.struct = None
-
- def register(self, name, struct):
- self.name = name
- self.struct = struct
- self.initvars()
-
- def initvars(self):
- v = self.vars = {}
- v["PythonName"] = self.name
- if self.cname is not None:
- v["CName"] = self.cname
- else:
- v["CName"] = self.name
- v["Flags"] = self.flags or "0"
- v["Type"] = self.get_type()
- if self.doc is not None:
- v["Docstring"] = cstring(unindent(self.doc))
- v["StructName"] = self.struct.name
-
- def get_type(self):
- """Deduce type code from struct specification if not defined"""
- if self.type is not None:
- return self.type
- ctype = self.struct.get_type(self.name)
- return c2t[ctype]
-
- def dump(self, f):
- if self.doc is None:
- print(template.memberdef_def % self.vars, file=f)
- else:
- print(template.memberdef_def_doc % self.vars, file=f)
diff --git a/Tools/framer/framer/slots.py b/Tools/framer/framer/slots.py
deleted file mode 100644
index 0f6e6fe229..0000000000
--- a/Tools/framer/framer/slots.py
+++ /dev/null
@@ -1,64 +0,0 @@
-"""Descriptions of all the slots in Python's type objects."""
-
-class Slot(object):
- def __init__(self, name, cast=None, special=None, default="0"):
- self.name = name
- self.cast = cast
- self.special = special
- self.default = default
-
-Slots = (Slot("ob_size"),
- Slot("tp_name"),
- Slot("tp_basicsize"),
- Slot("tp_itemsize"),
- Slot("tp_dealloc", "destructor"),
- Slot("tp_print", "printfunc"),
- Slot("tp_getattr", "getattrfunc"),
- Slot("tp_setattr", "setattrfunc"),
- Slot("tp_reserved", "void*"),
- Slot("tp_repr", "reprfunc", "__repr__"),
- Slot("tp_as_number"),
- Slot("tp_as_sequence"),
- Slot("tp_as_mapping"),
- Slot("tp_hash", "hashfunc", "__hash__"),
- Slot("tp_call", "ternaryfunc", "__call__"),
- Slot("tp_str", "reprfunc", "__str__"),
- Slot("tp_getattro", "getattrofunc", "__getattr__", # XXX
- "PyObject_GenericGetAttr"),
- Slot("tp_setattro", "setattrofunc", "__setattr__"),
- Slot("tp_as_buffer"),
- Slot("tp_flags", default="Py_TPFLAGS_DEFAULT"),
- Slot("tp_doc"),
- Slot("tp_traverse", "traverseprox"),
- Slot("tp_clear", "inquiry"),
- Slot("tp_richcompare", "richcmpfunc"),
- Slot("tp_weaklistoffset"),
- Slot("tp_iter", "getiterfunc", "__iter__"),
- Slot("tp_iternext", "iternextfunc", "__next__"), # XXX
- Slot("tp_methods"),
- Slot("tp_members"),
- Slot("tp_getset"),
- Slot("tp_base"),
- Slot("tp_dict"),
- Slot("tp_descr_get", "descrgetfunc"),
- Slot("tp_descr_set", "descrsetfunc"),
- Slot("tp_dictoffset"),
- Slot("tp_init", "initproc", "__init__"),
- Slot("tp_alloc", "allocfunc"),
- Slot("tp_new", "newfunc"),
- Slot("tp_free", "freefunc"),
- Slot("tp_is_gc", "inquiry"),
- Slot("tp_bases"),
- Slot("tp_mro"),
- Slot("tp_cache"),
- Slot("tp_subclasses"),
- Slot("tp_weaklist"),
- )
-
-# give some slots symbolic names
-TP_NAME = Slots[1]
-TP_BASICSIZE = Slots[2]
-TP_DEALLOC = Slots[4]
-TP_DOC = Slots[20]
-TP_METHODS = Slots[27]
-TP_MEMBERS = Slots[28]
diff --git a/Tools/framer/framer/struct.py b/Tools/framer/framer/struct.py
deleted file mode 100644
index 8fc2aec27d..0000000000
--- a/Tools/framer/framer/struct.py
+++ /dev/null
@@ -1,52 +0,0 @@
-"""Rudimentary parser for C struct definitions."""
-
-import re
-
-PyObject_HEAD = "PyObject_HEAD"
-PyObject_VAR_HEAD = "PyObject_VAR_HEAD"
-
-rx_name = re.compile("} (\w+);")
-
-class Struct:
- def __init__(self, name, head, members):
- self.name = name
- self.head = head
- self.members = members
-
- def get_type(self, name):
- for _name, type in self.members:
- if name == _name:
- return type
- raise ValueError("no member named %s" % name)
-
-def parse(s):
- """Parse a C struct definition.
-
- The parser is very restricted in what it will accept.
- """
-
- lines = [_f for _f in s.split("\n") if _f] # get non-empty lines
- assert lines[0].strip() == "typedef struct {"
- pyhead = lines[1].strip()
- assert (pyhead.startswith("PyObject") and
- pyhead.endswith("HEAD"))
- members = []
- for line in lines[2:]:
- line = line.strip()
- if line.startswith("}"):
- break
-
- assert line.endswith(";")
- line = line[:-1]
- words = line.split()
- name = words[-1]
- type = " ".join(words[:-1])
- if name[0] == "*":
- name = name[1:]
- type += " *"
- members.append((name, type))
- name = None
- mo = rx_name.search(line)
- assert mo is not None
- name = mo.group(1)
- return Struct(name, pyhead, members)
diff --git a/Tools/framer/framer/structparse.py b/Tools/framer/framer/structparse.py
deleted file mode 100644
index cf4224b09c..0000000000
--- a/Tools/framer/framer/structparse.py
+++ /dev/null
@@ -1,46 +0,0 @@
-"""Rudimentary parser for C struct definitions."""
-
-import re
-
-PyObject_HEAD = "PyObject_HEAD"
-PyObject_VAR_HEAD = "PyObject_VAR_HEAD"
-
-rx_name = re.compile("} (\w+);")
-
-class Struct:
- def __init__(self, name, head, members):
- self.name = name
- self.head = head
- self.members = members
-
-def parse(s):
- """Parse a C struct definition.
-
- The parser is very restricted in what it will accept.
- """
-
- lines = [_f for _f in s.split("\n") if _f] # get non-empty lines
- assert lines[0].strip() == "typedef struct {"
- pyhead = lines[1].strip()
- assert (pyhead.startswith("PyObject") and
- pyhead.endswith("HEAD"))
- members = []
- for line in lines[2:]:
- line = line.strip()
- if line.startswith("}"):
- break
-
- assert line.endswith(";")
- line = line[:-1]
- words = line.split()
- name = words[-1]
- type = " ".join(words[:-1])
- if name[0] == "*":
- name = name[1:]
- type += " *"
- members.append((name, type))
- name = None
- mo = rx_name.search(line)
- assert mo is not None
- name = mo.group(1)
- return Struct(name, pyhead, members)
diff --git a/Tools/framer/framer/template.py b/Tools/framer/framer/template.py
deleted file mode 100644
index 41f95371b8..0000000000
--- a/Tools/framer/framer/template.py
+++ /dev/null
@@ -1,102 +0,0 @@
-"""framer's C code templates.
-
-Templates use the following variables:
-
-FileName: name of the file that contains the C source code
-ModuleName: name of the module, as in "import ModuleName"
-ModuleDocstring: C string containing the module doc string
-"""
-
-module_start = '#include "Python.h"'
-member_include = '#include "structmember.h"'
-
-module_doc = """\
-PyDoc_STRVAR(%(ModuleName)s_doc,
-%(ModuleDocstring)s);
-"""
-
-methoddef_start = """\
-static struct PyMethodDef %(MethodDefName)s[] = {"""
-
-methoddef_def = """\
- {"%(PythonName)s", (PyCFunction)%(CName)s, %(MethType)s},"""
-
-methoddef_def_doc = """\
- {"%(PythonName)s", (PyCFunction)%(CName)s, %(MethType)s,
- %(DocstringVar)s},"""
-
-methoddef_end = """\
- {NULL, NULL}
-};
-"""
-
-memberdef_start = """\
-#define OFF(X) offsetof(%(StructName)s, X)
-
-static struct PyMemberDef %(MemberDefName)s[] = {"""
-
-memberdef_def_doc = """\
- {"%(PythonName)s", %(Type)s, OFF(%(CName)s), %(Flags)s,
- %(Docstring)s},"""
-
-memberdef_def = """\
- {"%(PythonName)s", %(Type)s, OFF(%(CName)s), %(Flags)s},"""
-
-memberdef_end = """\
- {NULL}
-};
-
-#undef OFF
-"""
-
-dealloc_func = """static void
-%(name)s(PyObject *ob)
-{
-}
-"""
-
-docstring = """\
-PyDoc_STRVAR(%(DocstringVar)s,
-%(Docstring)s);
-"""
-
-funcdef_start = """\
-static PyObject *
-%(name)s(%(args)s)
-{"""
-
-funcdef_end = """\
-}
-"""
-
-varargs = """\
- if (!PyArg_ParseTuple(args, \"%(ArgParse)s:%(PythonName)s\",
- %(ArgTargets)s))
- return NULL;"""
-
-module_init_start = """\
-PyMODINIT_FUNC
-init%(ModuleName)s(void)
-{
- PyObject *mod;
-
- mod = Py_InitModule3("%(ModuleName)s", %(MethodDefName)s,
- %(ModuleName)s_doc);
- if (mod == NULL)
- return;
-"""
-
-type_init_type = " %(CTypeName)s.ob_type = &PyType_Type;"
-module_add_type = """\
- if (!PyObject_SetAttrString(mod, "%(TypeName)s",
- (PyObject *)&%(CTypeName)s))
- return;
-"""
-
-type_struct_start = """\
-static PyTypeObject %(CTypeName)s = {
- PyObject_HEAD_INIT(0)"""
-
-type_struct_end = """\
-};
-"""
diff --git a/Tools/framer/framer/util.py b/Tools/framer/framer/util.py
deleted file mode 100644
index 73f3309645..0000000000
--- a/Tools/framer/framer/util.py
+++ /dev/null
@@ -1,35 +0,0 @@
-def cstring(s, width=70):
- """Return C string representation of a Python string.
-
- width specifies the maximum width of any line of the C string.
- """
- L = []
- for l in s.split("\n"):
- if len(l) < width:
- L.append(r'"%s\n"' % l)
-
- return "\n".join(L)
-
-def unindent(s, skipfirst=True):
- """Return an unindented version of a docstring.
-
- Removes indentation on lines following the first one, using the
- leading whitespace of the first indented line that is not blank
- to determine the indentation.
- """
-
- lines = s.split("\n")
- if skipfirst:
- first = lines.pop(0)
- L = [first]
- else:
- L = []
- indent = None
- for l in lines:
- ls = l.strip()
- if ls:
- indent = len(l) - len(ls)
- break
- L += [l[indent:] for l in lines]
-
- return "\n".join(L)
diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py
index a7673c9ce0..a41267ae7d 100755
--- a/Tools/freeze/freeze.py
+++ b/Tools/freeze/freeze.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Freeze a Python script into a binary.
@@ -201,7 +201,7 @@ def main():
# modules that are imported by the Python runtime
implicits = []
- for module in ('site', 'warnings',):
+ for module in ('site', 'warnings', 'encodings.utf_8', 'encodings.latin_1'):
if module not in exclude:
implicits.append(module)
diff --git a/Tools/freeze/makeconfig.py b/Tools/freeze/makeconfig.py
index 2aab3d92d3..018992c753 100644
--- a/Tools/freeze/makeconfig.py
+++ b/Tools/freeze/makeconfig.py
@@ -3,14 +3,13 @@ import sys
# Write the config.c file
-never = ['marshal', '__main__', 'builtins', 'sys', 'exceptions', '_warnings']
+never = ['marshal', 'imp', '_ast', '__main__', 'builtins',
+ 'sys', 'gc', '_warnings']
def makeconfig(infp, outfp, modules, with_ifdef=0):
m1 = re.compile('-- ADDMODULE MARKER 1 --')
m2 = re.compile('-- ADDMODULE MARKER 2 --')
- while 1:
- line = infp.readline()
- if not line: break
+ for line in infp:
outfp.write(line)
if m1 and m1.search(line):
m1 = None
@@ -18,8 +17,8 @@ def makeconfig(infp, outfp, modules, with_ifdef=0):
if mod in never:
continue
if with_ifdef:
- outfp.write("#ifndef init%s\n"%mod)
- outfp.write('extern void init%s(void);\n' % mod)
+ outfp.write("#ifndef PyInit_%s\n"%mod)
+ outfp.write('extern PyObject* PyInit_%s(void);\n' % mod)
if with_ifdef:
outfp.write("#endif\n")
elif m2 and m2.search(line):
@@ -27,7 +26,7 @@ def makeconfig(infp, outfp, modules, with_ifdef=0):
for mod in modules:
if mod in never:
continue
- outfp.write('\t{"%s", init%s},\n' %
+ outfp.write('\t{"%s", PyInit_%s},\n' %
(mod, mod))
if m1:
sys.stderr.write('MARKER 1 never found\n')
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
new file mode 100644
index 0000000000..93b05283b7
--- /dev/null
+++ b/Tools/gdb/libpython.py
@@ -0,0 +1,1633 @@
+#!/usr/bin/python
+'''
+From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb
+to be extended with Python code e.g. for library-specific data visualizations,
+such as for the C++ STL types. Documentation on this API can be seen at:
+http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html
+
+
+This python module deals with the case when the process being debugged (the
+"inferior process" in gdb parlance) is itself python, or more specifically,
+linked against libpython. In this situation, almost every item of data is a
+(PyObject*), and having the debugger merely print their addresses is not very
+enlightening.
+
+This module embeds knowledge about the implementation details of libpython so
+that we can emit useful visualizations e.g. a string, a list, a dict, a frame
+giving file/line information and the state of local variables
+
+In particular, given a gdb.Value corresponding to a PyObject* in the inferior
+process, we can generate a "proxy value" within the gdb process. For example,
+given a PyObject* in the inferior process that is in fact a PyListObject*
+holding three PyObject* that turn out to be PyBytesObject* instances, we can
+generate a proxy value within the gdb process that is a list of bytes
+instances:
+ [b"foo", b"bar", b"baz"]
+
+Doing so can be expensive for complicated graphs of objects, and could take
+some time, so we also have a "write_repr" method that writes a representation
+of the data to a file-like object. This allows us to stop the traversal by
+having the file-like object raise an exception if it gets too much data.
+
+With both "proxyval" and "write_repr" we keep track of the set of all addresses
+visited so far in the traversal, to avoid infinite recursion due to cycles in
+the graph of object references.
+
+We try to defer gdb.lookup_type() invocations for python types until as late as
+possible: for a dynamically linked python binary, when the process starts in
+the debugger, the libpython.so hasn't been dynamically loaded yet, so none of
+the type names are known to the debugger
+
+The module also extends gdb with some python-specific commands.
+'''
+from __future__ import with_statement
+import gdb
+import locale
+import sys
+
+# Look up the gdb.Type for some standard types:
+_type_char_ptr = gdb.lookup_type('char').pointer() # char*
+_type_unsigned_char_ptr = gdb.lookup_type('unsigned char').pointer() # unsigned char*
+_type_void_ptr = gdb.lookup_type('void').pointer() # void*
+_type_size_t = gdb.lookup_type('size_t')
+
+SIZEOF_VOID_P = _type_void_ptr.sizeof
+
+
+Py_TPFLAGS_HEAPTYPE = (1L << 9)
+
+Py_TPFLAGS_LONG_SUBCLASS = (1L << 24)
+Py_TPFLAGS_LIST_SUBCLASS = (1L << 25)
+Py_TPFLAGS_TUPLE_SUBCLASS = (1L << 26)
+Py_TPFLAGS_BYTES_SUBCLASS = (1L << 27)
+Py_TPFLAGS_UNICODE_SUBCLASS = (1L << 28)
+Py_TPFLAGS_DICT_SUBCLASS = (1L << 29)
+Py_TPFLAGS_BASE_EXC_SUBCLASS = (1L << 30)
+Py_TPFLAGS_TYPE_SUBCLASS = (1L << 31)
+
+
+MAX_OUTPUT_LEN=1024
+
+hexdigits = "0123456789abcdef"
+
+ENCODING = locale.getpreferredencoding()
+
+class NullPyObjectPtr(RuntimeError):
+ pass
+
+
+def safety_limit(val):
+ # Given a integer value from the process being debugged, limit it to some
+ # safety threshold so that arbitrary breakage within said process doesn't
+ # break the gdb process too much (e.g. sizes of iterations, sizes of lists)
+ return min(val, 1000)
+
+
+def safe_range(val):
+ # As per range, but don't trust the value too much: cap it to a safety
+ # threshold in case the data was corrupted
+ return xrange(safety_limit(val))
+
+def write_unicode(file, text):
+ # Write a byte or unicode string to file. Unicode strings are encoded to
+ # ENCODING encoding with 'backslashreplace' error handler to avoid
+ # UnicodeEncodeError.
+ if isinstance(text, unicode):
+ text = text.encode(ENCODING, 'backslashreplace')
+ file.write(text)
+
+def os_fsencode(filename):
+ if not isinstance(filename, unicode):
+ return filename
+ encoding = sys.getfilesystemencoding()
+ if encoding == 'mbcs':
+ # mbcs doesn't support surrogateescape
+ return filename.encode(encoding)
+ encoded = []
+ for char in filename:
+ # surrogateescape error handler
+ if 0xDC80 <= ord(char) <= 0xDCFF:
+ byte = chr(ord(char) - 0xDC00)
+ else:
+ byte = char.encode(encoding)
+ encoded.append(byte)
+ return ''.join(encoded)
+
+class StringTruncated(RuntimeError):
+ pass
+
+class TruncatedStringIO(object):
+ '''Similar to cStringIO, but can truncate the output by raising a
+ StringTruncated exception'''
+ def __init__(self, maxlen=None):
+ self._val = ''
+ self.maxlen = maxlen
+
+ def write(self, data):
+ if self.maxlen:
+ if len(data) + len(self._val) > self.maxlen:
+ # Truncation:
+ self._val += data[0:self.maxlen - len(self._val)]
+ raise StringTruncated()
+
+ self._val += data
+
+ def getvalue(self):
+ return self._val
+
+class PyObjectPtr(object):
+ """
+ Class wrapping a gdb.Value that's a either a (PyObject*) within the
+ inferior process, or some subclass pointer e.g. (PyBytesObject*)
+
+ There will be a subclass for every refined PyObject type that we care
+ about.
+
+ Note that at every stage the underlying pointer could be NULL, point
+ to corrupt data, etc; this is the debugger, after all.
+ """
+ _typename = 'PyObject'
+
+ def __init__(self, gdbval, cast_to=None):
+ if cast_to:
+ self._gdbval = gdbval.cast(cast_to)
+ else:
+ self._gdbval = gdbval
+
+ def field(self, name):
+ '''
+ Get the gdb.Value for the given field within the PyObject, coping with
+ some python 2 versus python 3 differences.
+
+ Various libpython types are defined using the "PyObject_HEAD" and
+ "PyObject_VAR_HEAD" macros.
+
+ In Python 2, this these are defined so that "ob_type" and (for a var
+ object) "ob_size" are fields of the type in question.
+
+ In Python 3, this is defined as an embedded PyVarObject type thus:
+ PyVarObject ob_base;
+ so that the "ob_size" field is located insize the "ob_base" field, and
+ the "ob_type" is most easily accessed by casting back to a (PyObject*).
+ '''
+ if self.is_null():
+ raise NullPyObjectPtr(self)
+
+ if name == 'ob_type':
+ pyo_ptr = self._gdbval.cast(PyObjectPtr.get_gdb_type())
+ return pyo_ptr.dereference()[name]
+
+ if name == 'ob_size':
+ pyo_ptr = self._gdbval.cast(PyVarObjectPtr.get_gdb_type())
+ return pyo_ptr.dereference()[name]
+
+ # General case: look it up inside the object:
+ return self._gdbval.dereference()[name]
+
+ def pyop_field(self, name):
+ '''
+ Get a PyObjectPtr for the given PyObject* field within this PyObject,
+ coping with some python 2 versus python 3 differences.
+ '''
+ return PyObjectPtr.from_pyobject_ptr(self.field(name))
+
+ def write_field_repr(self, name, out, visited):
+ '''
+ Extract the PyObject* field named "name", and write its representation
+ to file-like object "out"
+ '''
+ field_obj = self.pyop_field(name)
+ field_obj.write_repr(out, visited)
+
+ def get_truncated_repr(self, maxlen):
+ '''
+ Get a repr-like string for the data, but truncate it at "maxlen" bytes
+ (ending the object graph traversal as soon as you do)
+ '''
+ out = TruncatedStringIO(maxlen)
+ try:
+ self.write_repr(out, set())
+ except StringTruncated:
+ # Truncation occurred:
+ return out.getvalue() + '...(truncated)'
+
+ # No truncation occurred:
+ return out.getvalue()
+
+ def type(self):
+ return PyTypeObjectPtr(self.field('ob_type'))
+
+ def is_null(self):
+ return 0 == long(self._gdbval)
+
+ def is_optimized_out(self):
+ '''
+ Is the value of the underlying PyObject* visible to the debugger?
+
+ This can vary with the precise version of the compiler used to build
+ Python, and the precise version of gdb.
+
+ See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=556975 with
+ PyEval_EvalFrameEx's "f"
+ '''
+ return self._gdbval.is_optimized_out
+
+ def safe_tp_name(self):
+ try:
+ return self.type().field('tp_name').string()
+ except NullPyObjectPtr:
+ # NULL tp_name?
+ return 'unknown'
+ except RuntimeError:
+ # Can't even read the object at all?
+ return 'unknown'
+
+ def proxyval(self, visited):
+ '''
+ Scrape a value from the inferior process, and try to represent it
+ within the gdb process, whilst (hopefully) avoiding crashes when
+ the remote data is corrupt.
+
+ Derived classes will override this.
+
+ For example, a PyIntObject* with ob_ival 42 in the inferior process
+ should result in an int(42) in this process.
+
+ visited: a set of all gdb.Value pyobject pointers already visited
+ whilst generating this value (to guard against infinite recursion when
+ visiting object graphs with loops). Analogous to Py_ReprEnter and
+ Py_ReprLeave
+ '''
+
+ class FakeRepr(object):
+ """
+ Class representing a non-descript PyObject* value in the inferior
+ process for when we don't have a custom scraper, intended to have
+ a sane repr().
+ """
+
+ def __init__(self, tp_name, address):
+ self.tp_name = tp_name
+ self.address = address
+
+ def __repr__(self):
+ # For the NULL pointer, we have no way of knowing a type, so
+ # special-case it as per
+ # http://bugs.python.org/issue8032#msg100882
+ if self.address == 0:
+ return '0x0'
+ return '<%s at remote 0x%x>' % (self.tp_name, self.address)
+
+ return FakeRepr(self.safe_tp_name(),
+ long(self._gdbval))
+
+ def write_repr(self, out, visited):
+ '''
+ Write a string representation of the value scraped from the inferior
+ process to "out", a file-like object.
+ '''
+ # Default implementation: generate a proxy value and write its repr
+ # However, this could involve a lot of work for complicated objects,
+ # so for derived classes we specialize this
+ return out.write(repr(self.proxyval(visited)))
+
+ @classmethod
+ def subclass_from_type(cls, t):
+ '''
+ Given a PyTypeObjectPtr instance wrapping a gdb.Value that's a
+ (PyTypeObject*), determine the corresponding subclass of PyObjectPtr
+ to use
+
+ Ideally, we would look up the symbols for the global types, but that
+ isn't working yet:
+ (gdb) python print gdb.lookup_symbol('PyList_Type')[0].value
+ Traceback (most recent call last):
+ File "<string>", line 1, in <module>
+ NotImplementedError: Symbol type not yet supported in Python scripts.
+ Error while executing Python code.
+
+ For now, we use tp_flags, after doing some string comparisons on the
+ tp_name for some special-cases that don't seem to be visible through
+ flags
+ '''
+ try:
+ tp_name = t.field('tp_name').string()
+ tp_flags = int(t.field('tp_flags'))
+ except RuntimeError:
+ # Handle any kind of error e.g. NULL ptrs by simply using the base
+ # class
+ return cls
+
+ #print 'tp_flags = 0x%08x' % tp_flags
+ #print 'tp_name = %r' % tp_name
+
+ name_map = {'bool': PyBoolObjectPtr,
+ 'classobj': PyClassObjectPtr,
+ 'instance': PyInstanceObjectPtr,
+ 'NoneType': PyNoneStructPtr,
+ 'frame': PyFrameObjectPtr,
+ 'set' : PySetObjectPtr,
+ 'frozenset' : PySetObjectPtr,
+ 'builtin_function_or_method' : PyCFunctionObjectPtr,
+ }
+ if tp_name in name_map:
+ return name_map[tp_name]
+
+ if tp_flags & Py_TPFLAGS_HEAPTYPE:
+ return HeapTypeObjectPtr
+
+ if tp_flags & Py_TPFLAGS_LONG_SUBCLASS:
+ return PyLongObjectPtr
+ if tp_flags & Py_TPFLAGS_LIST_SUBCLASS:
+ return PyListObjectPtr
+ if tp_flags & Py_TPFLAGS_TUPLE_SUBCLASS:
+ return PyTupleObjectPtr
+ if tp_flags & Py_TPFLAGS_BYTES_SUBCLASS:
+ return PyBytesObjectPtr
+ if tp_flags & Py_TPFLAGS_UNICODE_SUBCLASS:
+ return PyUnicodeObjectPtr
+ if tp_flags & Py_TPFLAGS_DICT_SUBCLASS:
+ return PyDictObjectPtr
+ if tp_flags & Py_TPFLAGS_BASE_EXC_SUBCLASS:
+ return PyBaseExceptionObjectPtr
+ #if tp_flags & Py_TPFLAGS_TYPE_SUBCLASS:
+ # return PyTypeObjectPtr
+
+ # Use the base class:
+ return cls
+
+ @classmethod
+ def from_pyobject_ptr(cls, gdbval):
+ '''
+ Try to locate the appropriate derived class dynamically, and cast
+ the pointer accordingly.
+ '''
+ try:
+ p = PyObjectPtr(gdbval)
+ cls = cls.subclass_from_type(p.type())
+ return cls(gdbval, cast_to=cls.get_gdb_type())
+ except RuntimeError:
+ # Handle any kind of error e.g. NULL ptrs by simply using the base
+ # class
+ pass
+ return cls(gdbval)
+
+ @classmethod
+ def get_gdb_type(cls):
+ return gdb.lookup_type(cls._typename).pointer()
+
+ def as_address(self):
+ return long(self._gdbval)
+
+class PyVarObjectPtr(PyObjectPtr):
+ _typename = 'PyVarObject'
+
+class ProxyAlreadyVisited(object):
+ '''
+ Placeholder proxy to use when protecting against infinite recursion due to
+ loops in the object graph.
+
+ Analogous to the values emitted by the users of Py_ReprEnter and Py_ReprLeave
+ '''
+ def __init__(self, rep):
+ self._rep = rep
+
+ def __repr__(self):
+ return self._rep
+
+
+def _write_instance_repr(out, visited, name, pyop_attrdict, address):
+ '''Shared code for use by old-style and new-style classes:
+ write a representation to file-like object "out"'''
+ out.write('<')
+ out.write(name)
+
+ # Write dictionary of instance attributes:
+ if isinstance(pyop_attrdict, PyDictObjectPtr):
+ out.write('(')
+ first = True
+ for pyop_arg, pyop_val in pyop_attrdict.iteritems():
+ if not first:
+ out.write(', ')
+ first = False
+ out.write(pyop_arg.proxyval(visited))
+ out.write('=')
+ pyop_val.write_repr(out, visited)
+ out.write(')')
+ out.write(' at remote 0x%x>' % address)
+
+
+class InstanceProxy(object):
+
+ def __init__(self, cl_name, attrdict, address):
+ self.cl_name = cl_name
+ self.attrdict = attrdict
+ self.address = address
+
+ def __repr__(self):
+ if isinstance(self.attrdict, dict):
+ kwargs = ', '.join(["%s=%r" % (arg, val)
+ for arg, val in self.attrdict.iteritems()])
+ return '<%s(%s) at remote 0x%x>' % (self.cl_name,
+ kwargs, self.address)
+ else:
+ return '<%s at remote 0x%x>' % (self.cl_name,
+ self.address)
+
+def _PyObject_VAR_SIZE(typeobj, nitems):
+ return ( ( typeobj.field('tp_basicsize') +
+ nitems * typeobj.field('tp_itemsize') +
+ (SIZEOF_VOID_P - 1)
+ ) & ~(SIZEOF_VOID_P - 1)
+ ).cast(_type_size_t)
+
+class HeapTypeObjectPtr(PyObjectPtr):
+ _typename = 'PyObject'
+
+ def get_attr_dict(self):
+ '''
+ Get the PyDictObject ptr representing the attribute dictionary
+ (or None if there's a problem)
+ '''
+ try:
+ typeobj = self.type()
+ dictoffset = int_from_int(typeobj.field('tp_dictoffset'))
+ if dictoffset != 0:
+ if dictoffset < 0:
+ type_PyVarObject_ptr = gdb.lookup_type('PyVarObject').pointer()
+ tsize = int_from_int(self._gdbval.cast(type_PyVarObject_ptr)['ob_size'])
+ if tsize < 0:
+ tsize = -tsize
+ size = _PyObject_VAR_SIZE(typeobj, tsize)
+ dictoffset += size
+ assert dictoffset > 0
+ assert dictoffset % SIZEOF_VOID_P == 0
+
+ dictptr = self._gdbval.cast(_type_char_ptr) + dictoffset
+ PyObjectPtrPtr = PyObjectPtr.get_gdb_type().pointer()
+ dictptr = dictptr.cast(PyObjectPtrPtr)
+ return PyObjectPtr.from_pyobject_ptr(dictptr.dereference())
+ except RuntimeError:
+ # Corrupt data somewhere; fail safe
+ pass
+
+ # Not found, or some kind of error:
+ return None
+
+ def proxyval(self, visited):
+ '''
+ Support for new-style classes.
+
+ Currently we just locate the dictionary using a transliteration to
+ python of _PyObject_GetDictPtr, ignoring descriptors
+ '''
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('<...>')
+ visited.add(self.as_address())
+
+ pyop_attr_dict = self.get_attr_dict()
+ if pyop_attr_dict:
+ attr_dict = pyop_attr_dict.proxyval(visited)
+ else:
+ attr_dict = {}
+ tp_name = self.safe_tp_name()
+
+ # New-style class:
+ return InstanceProxy(tp_name, attr_dict, long(self._gdbval))
+
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('<...>')
+ return
+ visited.add(self.as_address())
+
+ pyop_attrdict = self.get_attr_dict()
+ _write_instance_repr(out, visited,
+ self.safe_tp_name(), pyop_attrdict, self.as_address())
+
+class ProxyException(Exception):
+ def __init__(self, tp_name, args):
+ self.tp_name = tp_name
+ self.args = args
+
+ def __repr__(self):
+ return '%s%r' % (self.tp_name, self.args)
+
+class PyBaseExceptionObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyBaseExceptionObject* i.e. an exception
+ within the process being debugged.
+ """
+ _typename = 'PyBaseExceptionObject'
+
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('(...)')
+ visited.add(self.as_address())
+ arg_proxy = self.pyop_field('args').proxyval(visited)
+ return ProxyException(self.safe_tp_name(),
+ arg_proxy)
+
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('(...)')
+ return
+ visited.add(self.as_address())
+
+ out.write(self.safe_tp_name())
+ self.write_field_repr('args', out, visited)
+
+class PyClassObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyClassObject* i.e. a <classobj>
+ instance within the process being debugged.
+ """
+ _typename = 'PyClassObject'
+
+
+class BuiltInFunctionProxy(object):
+ def __init__(self, ml_name):
+ self.ml_name = ml_name
+
+ def __repr__(self):
+ return "<built-in function %s>" % self.ml_name
+
+class BuiltInMethodProxy(object):
+ def __init__(self, ml_name, pyop_m_self):
+ self.ml_name = ml_name
+ self.pyop_m_self = pyop_m_self
+
+ def __repr__(self):
+ return ('<built-in method %s of %s object at remote 0x%x>'
+ % (self.ml_name,
+ self.pyop_m_self.safe_tp_name(),
+ self.pyop_m_self.as_address())
+ )
+
+class PyCFunctionObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyCFunctionObject*
+ (see Include/methodobject.h and Objects/methodobject.c)
+ """
+ _typename = 'PyCFunctionObject'
+
+ def proxyval(self, visited):
+ m_ml = self.field('m_ml') # m_ml is a (PyMethodDef*)
+ ml_name = m_ml['ml_name'].string()
+
+ pyop_m_self = self.pyop_field('m_self')
+ if pyop_m_self.is_null():
+ return BuiltInFunctionProxy(ml_name)
+ else:
+ return BuiltInMethodProxy(ml_name, pyop_m_self)
+
+
+class PyCodeObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyCodeObject* i.e. a <code> instance
+ within the process being debugged.
+ """
+ _typename = 'PyCodeObject'
+
+ def addr2line(self, addrq):
+ '''
+ Get the line number for a given bytecode offset
+
+ Analogous to PyCode_Addr2Line; translated from pseudocode in
+ Objects/lnotab_notes.txt
+ '''
+ co_lnotab = self.pyop_field('co_lnotab').proxyval(set())
+
+ # Initialize lineno to co_firstlineno as per PyCode_Addr2Line
+ # not 0, as lnotab_notes.txt has it:
+ lineno = int_from_int(self.field('co_firstlineno'))
+
+ addr = 0
+ for addr_incr, line_incr in zip(co_lnotab[::2], co_lnotab[1::2]):
+ addr += ord(addr_incr)
+ if addr > addrq:
+ return lineno
+ lineno += ord(line_incr)
+ return lineno
+
+
+class PyDictObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyDictObject* i.e. a dict instance
+ within the process being debugged.
+ """
+ _typename = 'PyDictObject'
+
+ def iteritems(self):
+ '''
+ Yields a sequence of (PyObjectPtr key, PyObjectPtr value) pairs,
+ analagous to dict.iteritems()
+ '''
+ for i in safe_range(self.field('ma_mask') + 1):
+ ep = self.field('ma_table') + i
+ pyop_value = PyObjectPtr.from_pyobject_ptr(ep['me_value'])
+ if not pyop_value.is_null():
+ pyop_key = PyObjectPtr.from_pyobject_ptr(ep['me_key'])
+ yield (pyop_key, pyop_value)
+
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('{...}')
+ visited.add(self.as_address())
+
+ result = {}
+ for pyop_key, pyop_value in self.iteritems():
+ proxy_key = pyop_key.proxyval(visited)
+ proxy_value = pyop_value.proxyval(visited)
+ result[proxy_key] = proxy_value
+ return result
+
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('{...}')
+ return
+ visited.add(self.as_address())
+
+ out.write('{')
+ first = True
+ for pyop_key, pyop_value in self.iteritems():
+ if not first:
+ out.write(', ')
+ first = False
+ pyop_key.write_repr(out, visited)
+ out.write(': ')
+ pyop_value.write_repr(out, visited)
+ out.write('}')
+
+class PyInstanceObjectPtr(PyObjectPtr):
+ _typename = 'PyInstanceObject'
+
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('<...>')
+ visited.add(self.as_address())
+
+ # Get name of class:
+ in_class = self.pyop_field('in_class')
+ cl_name = in_class.pyop_field('cl_name').proxyval(visited)
+
+ # Get dictionary of instance attributes:
+ in_dict = self.pyop_field('in_dict').proxyval(visited)
+
+ # Old-style class:
+ return InstanceProxy(cl_name, in_dict, long(self._gdbval))
+
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('<...>')
+ return
+ visited.add(self.as_address())
+
+ # Old-style class:
+
+ # Get name of class:
+ in_class = self.pyop_field('in_class')
+ cl_name = in_class.pyop_field('cl_name').proxyval(visited)
+
+ # Get dictionary of instance attributes:
+ pyop_in_dict = self.pyop_field('in_dict')
+
+ _write_instance_repr(out, visited,
+ cl_name, pyop_in_dict, self.as_address())
+
+class PyListObjectPtr(PyObjectPtr):
+ _typename = 'PyListObject'
+
+ def __getitem__(self, i):
+ # Get the gdb.Value for the (PyObject*) with the given index:
+ field_ob_item = self.field('ob_item')
+ return field_ob_item[i]
+
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('[...]')
+ visited.add(self.as_address())
+
+ result = [PyObjectPtr.from_pyobject_ptr(self[i]).proxyval(visited)
+ for i in safe_range(int_from_int(self.field('ob_size')))]
+ return result
+
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('[...]')
+ return
+ visited.add(self.as_address())
+
+ out.write('[')
+ for i in safe_range(int_from_int(self.field('ob_size'))):
+ if i > 0:
+ out.write(', ')
+ element = PyObjectPtr.from_pyobject_ptr(self[i])
+ element.write_repr(out, visited)
+ out.write(']')
+
+class PyLongObjectPtr(PyObjectPtr):
+ _typename = 'PyLongObject'
+
+ def proxyval(self, visited):
+ '''
+ Python's Include/longobjrep.h has this declaration:
+ struct _longobject {
+ PyObject_VAR_HEAD
+ digit ob_digit[1];
+ };
+
+ with this description:
+ The absolute value of a number is equal to
+ SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i)
+ Negative numbers are represented with ob_size < 0;
+ zero is represented by ob_size == 0.
+
+ where SHIFT can be either:
+ #define PyLong_SHIFT 30
+ #define PyLong_SHIFT 15
+ '''
+ ob_size = long(self.field('ob_size'))
+ if ob_size == 0:
+ return 0L
+
+ ob_digit = self.field('ob_digit')
+
+ if gdb.lookup_type('digit').sizeof == 2:
+ SHIFT = 15L
+ else:
+ SHIFT = 30L
+
+ digits = [long(ob_digit[i]) * 2**(SHIFT*i)
+ for i in safe_range(abs(ob_size))]
+ result = sum(digits)
+ if ob_size < 0:
+ result = -result
+ return result
+
+ def write_repr(self, out, visited):
+ # Write this out as a Python 3 int literal, i.e. without the "L" suffix
+ proxy = self.proxyval(visited)
+ out.write("%s" % proxy)
+
+
+class PyBoolObjectPtr(PyLongObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyBoolObject* i.e. one of the two
+ <bool> instances (Py_True/Py_False) within the process being debugged.
+ """
+ def proxyval(self, visited):
+ if PyLongObjectPtr.proxyval(self, visited):
+ return True
+ else:
+ return False
+
+class PyNoneStructPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyObject* pointing to the
+ singleton (we hope) _Py_NoneStruct with ob_type PyNone_Type
+ """
+ _typename = 'PyObject'
+
+ def proxyval(self, visited):
+ return None
+
+
+class PyFrameObjectPtr(PyObjectPtr):
+ _typename = 'PyFrameObject'
+
+ def __init__(self, gdbval, cast_to):
+ PyObjectPtr.__init__(self, gdbval, cast_to)
+
+ if not self.is_optimized_out():
+ self.co = PyCodeObjectPtr.from_pyobject_ptr(self.field('f_code'))
+ self.co_name = self.co.pyop_field('co_name')
+ self.co_filename = self.co.pyop_field('co_filename')
+
+ self.f_lineno = int_from_int(self.field('f_lineno'))
+ self.f_lasti = int_from_int(self.field('f_lasti'))
+ self.co_nlocals = int_from_int(self.co.field('co_nlocals'))
+ self.co_varnames = PyTupleObjectPtr.from_pyobject_ptr(self.co.field('co_varnames'))
+
+ def iter_locals(self):
+ '''
+ Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
+ the local variables of this frame
+ '''
+ if self.is_optimized_out():
+ return
+
+ f_localsplus = self.field('f_localsplus')
+ for i in safe_range(self.co_nlocals):
+ pyop_value = PyObjectPtr.from_pyobject_ptr(f_localsplus[i])
+ if not pyop_value.is_null():
+ pyop_name = PyObjectPtr.from_pyobject_ptr(self.co_varnames[i])
+ yield (pyop_name, pyop_value)
+
+ def iter_globals(self):
+ '''
+ Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
+ the global variables of this frame
+ '''
+ if self.is_optimized_out():
+ return
+
+ pyop_globals = self.pyop_field('f_globals')
+ return pyop_globals.iteritems()
+
+ def iter_builtins(self):
+ '''
+ Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
+ the builtin variables
+ '''
+ if self.is_optimized_out():
+ return
+
+ pyop_builtins = self.pyop_field('f_builtins')
+ return pyop_builtins.iteritems()
+
+ def get_var_by_name(self, name):
+ '''
+ Look for the named local variable, returning a (PyObjectPtr, scope) pair
+ where scope is a string 'local', 'global', 'builtin'
+
+ If not found, return (None, None)
+ '''
+ for pyop_name, pyop_value in self.iter_locals():
+ if name == pyop_name.proxyval(set()):
+ return pyop_value, 'local'
+ for pyop_name, pyop_value in self.iter_globals():
+ if name == pyop_name.proxyval(set()):
+ return pyop_value, 'global'
+ for pyop_name, pyop_value in self.iter_builtins():
+ if name == pyop_name.proxyval(set()):
+ return pyop_value, 'builtin'
+ return None, None
+
+ def filename(self):
+ '''Get the path of the current Python source file, as a string'''
+ if self.is_optimized_out():
+ return '(frame information optimized out)'
+ return self.co_filename.proxyval(set())
+
+ def current_line_num(self):
+ '''Get current line number as an integer (1-based)
+
+ Translated from PyFrame_GetLineNumber and PyCode_Addr2Line
+
+ See Objects/lnotab_notes.txt
+ '''
+ if self.is_optimized_out():
+ return None
+ f_trace = self.field('f_trace')
+ if long(f_trace) != 0:
+ # we have a non-NULL f_trace:
+ return self.f_lineno
+ else:
+ #try:
+ return self.co.addr2line(self.f_lasti)
+ #except ValueError:
+ # return self.f_lineno
+
+ def current_line(self):
+ '''Get the text of the current source line as a string, with a trailing
+ newline character'''
+ if self.is_optimized_out():
+ return '(frame information optimized out)'
+ filename = self.filename()
+ with open(os_fsencode(filename), 'r') as f:
+ all_lines = f.readlines()
+ # Convert from 1-based current_line_num to 0-based list offset:
+ return all_lines[self.current_line_num()-1]
+
+ def write_repr(self, out, visited):
+ if self.is_optimized_out():
+ out.write('(frame information optimized out)')
+ return
+ out.write('Frame 0x%x, for file %s, line %i, in %s ('
+ % (self.as_address(),
+ self.co_filename.proxyval(visited),
+ self.current_line_num(),
+ self.co_name.proxyval(visited)))
+ first = True
+ for pyop_name, pyop_value in self.iter_locals():
+ if not first:
+ out.write(', ')
+ first = False
+
+ out.write(pyop_name.proxyval(visited))
+ out.write('=')
+ pyop_value.write_repr(out, visited)
+
+ out.write(')')
+
+class PySetObjectPtr(PyObjectPtr):
+ _typename = 'PySetObject'
+
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('%s(...)' % self.safe_tp_name())
+ visited.add(self.as_address())
+
+ members = []
+ table = self.field('table')
+ for i in safe_range(self.field('mask')+1):
+ setentry = table[i]
+ key = setentry['key']
+ if key != 0:
+ key_proxy = PyObjectPtr.from_pyobject_ptr(key).proxyval(visited)
+ if key_proxy != '<dummy key>':
+ members.append(key_proxy)
+ if self.safe_tp_name() == 'frozenset':
+ return frozenset(members)
+ else:
+ return set(members)
+
+ def write_repr(self, out, visited):
+ # Emulate Python 3's set_repr
+ tp_name = self.safe_tp_name()
+
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('(...)')
+ return
+ visited.add(self.as_address())
+
+ # Python 3's set_repr special-cases the empty set:
+ if not self.field('used'):
+ out.write(tp_name)
+ out.write('()')
+ return
+
+ # Python 3 uses {} for set literals:
+ if tp_name != 'set':
+ out.write(tp_name)
+ out.write('(')
+
+ out.write('{')
+ first = True
+ table = self.field('table')
+ for i in safe_range(self.field('mask')+1):
+ setentry = table[i]
+ key = setentry['key']
+ if key != 0:
+ pyop_key = PyObjectPtr.from_pyobject_ptr(key)
+ key_proxy = pyop_key.proxyval(visited) # FIXME!
+ if key_proxy != '<dummy key>':
+ if not first:
+ out.write(', ')
+ first = False
+ pyop_key.write_repr(out, visited)
+ out.write('}')
+
+ if tp_name != 'set':
+ out.write(')')
+
+
+class PyBytesObjectPtr(PyObjectPtr):
+ _typename = 'PyBytesObject'
+
+ def __str__(self):
+ field_ob_size = self.field('ob_size')
+ field_ob_sval = self.field('ob_sval')
+ char_ptr = field_ob_sval.address.cast(_type_unsigned_char_ptr)
+ return ''.join([chr(char_ptr[i]) for i in safe_range(field_ob_size)])
+
+ def proxyval(self, visited):
+ return str(self)
+
+ def write_repr(self, out, visited):
+ # Write this out as a Python 3 bytes literal, i.e. with a "b" prefix
+
+ # Get a PyStringObject* within the Python 2 gdb process:
+ proxy = self.proxyval(visited)
+
+ # Transliteration of Python 3's Objects/bytesobject.c:PyBytes_Repr
+ # to Python 2 code:
+ quote = "'"
+ if "'" in proxy and not '"' in proxy:
+ quote = '"'
+ out.write('b')
+ out.write(quote)
+ for byte in proxy:
+ if byte == quote or byte == '\\':
+ out.write('\\')
+ out.write(byte)
+ elif byte == '\t':
+ out.write('\\t')
+ elif byte == '\n':
+ out.write('\\n')
+ elif byte == '\r':
+ out.write('\\r')
+ elif byte < ' ' or ord(byte) >= 0x7f:
+ out.write('\\x')
+ out.write(hexdigits[(ord(byte) & 0xf0) >> 4])
+ out.write(hexdigits[ord(byte) & 0xf])
+ else:
+ out.write(byte)
+ out.write(quote)
+
+class PyTupleObjectPtr(PyObjectPtr):
+ _typename = 'PyTupleObject'
+
+ def __getitem__(self, i):
+ # Get the gdb.Value for the (PyObject*) with the given index:
+ field_ob_item = self.field('ob_item')
+ return field_ob_item[i]
+
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('(...)')
+ visited.add(self.as_address())
+
+ result = tuple([PyObjectPtr.from_pyobject_ptr(self[i]).proxyval(visited)
+ for i in safe_range(int_from_int(self.field('ob_size')))])
+ return result
+
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('(...)')
+ return
+ visited.add(self.as_address())
+
+ out.write('(')
+ for i in safe_range(int_from_int(self.field('ob_size'))):
+ if i > 0:
+ out.write(', ')
+ element = PyObjectPtr.from_pyobject_ptr(self[i])
+ element.write_repr(out, visited)
+ if self.field('ob_size') == 1:
+ out.write(',)')
+ else:
+ out.write(')')
+
+class PyTypeObjectPtr(PyObjectPtr):
+ _typename = 'PyTypeObject'
+
+
+def _unichr_is_printable(char):
+ # Logic adapted from Python 3's Tools/unicode/makeunicodedata.py
+ if char == u" ":
+ return True
+ import unicodedata
+ return unicodedata.category(char) not in ("C", "Z")
+
+if sys.maxunicode >= 0x10000:
+ _unichr = unichr
+else:
+ # Needed for proper surrogate support if sizeof(Py_UNICODE) is 2 in gdb
+ def _unichr(x):
+ if x < 0x10000:
+ return unichr(x)
+ x -= 0x10000
+ ch1 = 0xD800 | (x >> 10)
+ ch2 = 0xDC00 | (x & 0x3FF)
+ return unichr(ch1) + unichr(ch2)
+
+
+class PyUnicodeObjectPtr(PyObjectPtr):
+ _typename = 'PyUnicodeObject'
+
+ def char_width(self):
+ _type_Py_UNICODE = gdb.lookup_type('Py_UNICODE')
+ return _type_Py_UNICODE.sizeof
+
+ def proxyval(self, visited):
+ # From unicodeobject.h:
+ # Py_ssize_t length; /* Length of raw Unicode data in buffer */
+ # Py_UNICODE *str; /* Raw Unicode buffer */
+ field_length = long(self.field('length'))
+ field_str = self.field('str')
+
+ # Gather a list of ints from the Py_UNICODE array; these are either
+ # UCS-2 or UCS-4 code points:
+ if self.char_width() > 2:
+ Py_UNICODEs = [int(field_str[i]) for i in safe_range(field_length)]
+ else:
+ # A more elaborate routine if sizeof(Py_UNICODE) is 2 in the
+ # inferior process: we must join surrogate pairs.
+ Py_UNICODEs = []
+ i = 0
+ limit = safety_limit(field_length)
+ while i < limit:
+ ucs = int(field_str[i])
+ i += 1
+ if ucs < 0xD800 or ucs >= 0xDC00 or i == field_length:
+ Py_UNICODEs.append(ucs)
+ continue
+ # This could be a surrogate pair.
+ ucs2 = int(field_str[i])
+ if ucs2 < 0xDC00 or ucs2 > 0xDFFF:
+ continue
+ code = (ucs & 0x03FF) << 10
+ code |= ucs2 & 0x03FF
+ code += 0x00010000
+ Py_UNICODEs.append(code)
+ i += 1
+
+ # Convert the int code points to unicode characters, and generate a
+ # local unicode instance.
+ # This splits surrogate pairs if sizeof(Py_UNICODE) is 2 here (in gdb).
+ result = u''.join([_unichr(ucs) for ucs in Py_UNICODEs])
+ return result
+
+ def write_repr(self, out, visited):
+ # Write this out as a Python 3 str literal, i.e. without a "u" prefix
+
+ # Get a PyUnicodeObject* within the Python 2 gdb process:
+ proxy = self.proxyval(visited)
+
+ # Transliteration of Python 3's Object/unicodeobject.c:unicode_repr
+ # to Python 2:
+ if "'" in proxy and '"' not in proxy:
+ quote = '"'
+ else:
+ quote = "'"
+ out.write(quote)
+
+ i = 0
+ while i < len(proxy):
+ ch = proxy[i]
+ i += 1
+
+ # Escape quotes and backslashes
+ if ch == quote or ch == '\\':
+ out.write('\\')
+ out.write(ch)
+
+ # Map special whitespace to '\t', \n', '\r'
+ elif ch == '\t':
+ out.write('\\t')
+ elif ch == '\n':
+ out.write('\\n')
+ elif ch == '\r':
+ out.write('\\r')
+
+ # Map non-printable US ASCII to '\xhh' */
+ elif ch < ' ' or ch == 0x7F:
+ out.write('\\x')
+ out.write(hexdigits[(ord(ch) >> 4) & 0x000F])
+ out.write(hexdigits[ord(ch) & 0x000F])
+
+ # Copy ASCII characters as-is
+ elif ord(ch) < 0x7F:
+ out.write(ch)
+
+ # Non-ASCII characters
+ else:
+ ucs = ch
+ ch2 = None
+ if sys.maxunicode < 0x10000:
+ # If sizeof(Py_UNICODE) is 2 here (in gdb), join
+ # surrogate pairs before calling _unichr_is_printable.
+ if (i < len(proxy)
+ and 0xD800 <= ord(ch) < 0xDC00 \
+ and 0xDC00 <= ord(proxy[i]) <= 0xDFFF):
+ ch2 = proxy[i]
+ ucs = ch + ch2
+ i += 1
+
+ # Unfortuately, Python 2's unicode type doesn't seem
+ # to expose the "isprintable" method
+ printable = _unichr_is_printable(ucs)
+ if printable:
+ try:
+ ucs.encode(ENCODING)
+ except UnicodeEncodeError:
+ printable = False
+
+ # Map Unicode whitespace and control characters
+ # (categories Z* and C* except ASCII space)
+ if not printable:
+ if ch2 is not None:
+ # Match Python 3's representation of non-printable
+ # wide characters.
+ code = (ord(ch) & 0x03FF) << 10
+ code |= ord(ch2) & 0x03FF
+ code += 0x00010000
+ else:
+ code = ord(ucs)
+
+ # Map 8-bit characters to '\\xhh'
+ if code <= 0xff:
+ out.write('\\x')
+ out.write(hexdigits[(code >> 4) & 0x000F])
+ out.write(hexdigits[code & 0x000F])
+ # Map 21-bit characters to '\U00xxxxxx'
+ elif code >= 0x10000:
+ out.write('\\U')
+ out.write(hexdigits[(code >> 28) & 0x0000000F])
+ out.write(hexdigits[(code >> 24) & 0x0000000F])
+ out.write(hexdigits[(code >> 20) & 0x0000000F])
+ out.write(hexdigits[(code >> 16) & 0x0000000F])
+ out.write(hexdigits[(code >> 12) & 0x0000000F])
+ out.write(hexdigits[(code >> 8) & 0x0000000F])
+ out.write(hexdigits[(code >> 4) & 0x0000000F])
+ out.write(hexdigits[code & 0x0000000F])
+ # Map 16-bit characters to '\uxxxx'
+ else:
+ out.write('\\u')
+ out.write(hexdigits[(code >> 12) & 0x000F])
+ out.write(hexdigits[(code >> 8) & 0x000F])
+ out.write(hexdigits[(code >> 4) & 0x000F])
+ out.write(hexdigits[code & 0x000F])
+ else:
+ # Copy characters as-is
+ out.write(ch)
+ if ch2 is not None:
+ out.write(ch2)
+
+ out.write(quote)
+
+
+
+
+def int_from_int(gdbval):
+ return int(str(gdbval))
+
+
+def stringify(val):
+ # TODO: repr() puts everything on one line; pformat can be nicer, but
+ # can lead to v.long results; this function isolates the choice
+ if True:
+ return repr(val)
+ else:
+ from pprint import pformat
+ return pformat(val)
+
+
+class PyObjectPtrPrinter:
+ "Prints a (PyObject*)"
+
+ def __init__ (self, gdbval):
+ self.gdbval = gdbval
+
+ def to_string (self):
+ pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
+ if True:
+ return pyop.get_truncated_repr(MAX_OUTPUT_LEN)
+ else:
+ # Generate full proxy value then stringify it.
+ # Doing so could be expensive
+ proxyval = pyop.proxyval(set())
+ return stringify(proxyval)
+
+def pretty_printer_lookup(gdbval):
+ type = gdbval.type.unqualified()
+ if type.code == gdb.TYPE_CODE_PTR:
+ type = type.target().unqualified()
+ t = str(type)
+ if t in ("PyObject", "PyFrameObject", "PyUnicodeObject"):
+ return PyObjectPtrPrinter(gdbval)
+
+"""
+During development, I've been manually invoking the code in this way:
+(gdb) python
+
+import sys
+sys.path.append('/home/david/coding/python-gdb')
+import libpython
+end
+
+then reloading it after each edit like this:
+(gdb) python reload(libpython)
+
+The following code should ensure that the prettyprinter is registered
+if the code is autoloaded by gdb when visiting libpython.so, provided
+that this python file is installed to the same path as the library (or its
+.debug file) plus a "-gdb.py" suffix, e.g:
+ /usr/lib/libpython2.6.so.1.0-gdb.py
+ /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
+"""
+def register (obj):
+ if obj == None:
+ obj = gdb
+
+ # Wire up the pretty-printer
+ obj.pretty_printers.append(pretty_printer_lookup)
+
+register (gdb.current_objfile ())
+
+
+
+# Unfortunately, the exact API exposed by the gdb module varies somewhat
+# from build to build
+# See http://bugs.python.org/issue8279?#msg102276
+
+class Frame(object):
+ '''
+ Wrapper for gdb.Frame, adding various methods
+ '''
+ def __init__(self, gdbframe):
+ self._gdbframe = gdbframe
+
+ def older(self):
+ older = self._gdbframe.older()
+ if older:
+ return Frame(older)
+ else:
+ return None
+
+ def newer(self):
+ newer = self._gdbframe.newer()
+ if newer:
+ return Frame(newer)
+ else:
+ return None
+
+ def select(self):
+ '''If supported, select this frame and return True; return False if unsupported
+
+ Not all builds have a gdb.Frame.select method; seems to be present on Fedora 12
+ onwards, but absent on Ubuntu buildbot'''
+ if not hasattr(self._gdbframe, 'select'):
+ print ('Unable to select frame: '
+ 'this build of gdb does not expose a gdb.Frame.select method')
+ return False
+ self._gdbframe.select()
+ return True
+
+ def get_index(self):
+ '''Calculate index of frame, starting at 0 for the newest frame within
+ this thread'''
+ index = 0
+ # Go down until you reach the newest frame:
+ iter_frame = self
+ while iter_frame.newer():
+ index += 1
+ iter_frame = iter_frame.newer()
+ return index
+
+ def is_evalframeex(self):
+ '''Is this a PyEval_EvalFrameEx frame?'''
+ if self._gdbframe.name() == 'PyEval_EvalFrameEx':
+ '''
+ I believe we also need to filter on the inline
+ struct frame_id.inline_depth, only regarding frames with
+ an inline depth of 0 as actually being this function
+
+ So we reject those with type gdb.INLINE_FRAME
+ '''
+ if self._gdbframe.type() == gdb.NORMAL_FRAME:
+ # We have a PyEval_EvalFrameEx frame:
+ return True
+
+ return False
+
+ def get_pyop(self):
+ try:
+ f = self._gdbframe.read_var('f')
+ return PyFrameObjectPtr.from_pyobject_ptr(f)
+ except ValueError:
+ return None
+
+ @classmethod
+ def get_selected_frame(cls):
+ _gdbframe = gdb.selected_frame()
+ if _gdbframe:
+ return Frame(_gdbframe)
+ return None
+
+ @classmethod
+ def get_selected_python_frame(cls):
+ '''Try to obtain the Frame for the python code in the selected frame,
+ or None'''
+ frame = cls.get_selected_frame()
+
+ while frame:
+ if frame.is_evalframeex():
+ return frame
+ frame = frame.older()
+
+ # Not found:
+ return None
+
+ def print_summary(self):
+ if self.is_evalframeex():
+ pyop = self.get_pyop()
+ if pyop:
+ line = pyop.get_truncated_repr(MAX_OUTPUT_LEN)
+ write_unicode(sys.stdout, '#%i %s\n' % (self.get_index(), line))
+ sys.stdout.write(pyop.current_line())
+ else:
+ sys.stdout.write('#%i (unable to read python frame information)\n' % self.get_index())
+ else:
+ sys.stdout.write('#%i\n' % self.get_index())
+
+class PyList(gdb.Command):
+ '''List the current Python source code, if any
+
+ Use
+ py-list START
+ to list at a different line number within the python source.
+
+ Use
+ py-list START, END
+ to list a specific range of lines within the python source.
+ '''
+
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-list",
+ gdb.COMMAND_FILES,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ import re
+
+ start = None
+ end = None
+
+ m = re.match(r'\s*(\d+)\s*', args)
+ if m:
+ start = int(m.group(0))
+ end = start + 10
+
+ m = re.match(r'\s*(\d+)\s*,\s*(\d+)\s*', args)
+ if m:
+ start, end = map(int, m.groups())
+
+ frame = Frame.get_selected_python_frame()
+ if not frame:
+ print 'Unable to locate python frame'
+ return
+
+ pyop = frame.get_pyop()
+ if not pyop:
+ print 'Unable to read information on python frame'
+ return
+
+ filename = pyop.filename()
+ lineno = pyop.current_line_num()
+
+ if start is None:
+ start = lineno - 5
+ end = lineno + 5
+
+ if start<1:
+ start = 1
+
+ with open(os_fsencode(filename), 'r') as f:
+ all_lines = f.readlines()
+ # start and end are 1-based, all_lines is 0-based;
+ # so [start-1:end] as a python slice gives us [start, end] as a
+ # closed interval
+ for i, line in enumerate(all_lines[start-1:end]):
+ linestr = str(i+start)
+ # Highlight current line:
+ if i + start == lineno:
+ linestr = '>' + linestr
+ sys.stdout.write('%4s %s' % (linestr, line))
+
+
+# ...and register the command:
+PyList()
+
+def move_in_stack(move_up):
+ '''Move up or down the stack (for the py-up/py-down command)'''
+ frame = Frame.get_selected_python_frame()
+ while frame:
+ if move_up:
+ iter_frame = frame.older()
+ else:
+ iter_frame = frame.newer()
+
+ if not iter_frame:
+ break
+
+ if iter_frame.is_evalframeex():
+ # Result:
+ if iter_frame.select():
+ iter_frame.print_summary()
+ return
+
+ frame = iter_frame
+
+ if move_up:
+ print 'Unable to find an older python frame'
+ else:
+ print 'Unable to find a newer python frame'
+
+class PyUp(gdb.Command):
+ 'Select and print the python stack frame that called this one (if any)'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-up",
+ gdb.COMMAND_STACK,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ move_in_stack(move_up=True)
+
+class PyDown(gdb.Command):
+ 'Select and print the python stack frame called by this one (if any)'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-down",
+ gdb.COMMAND_STACK,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ move_in_stack(move_up=False)
+
+# Not all builds of gdb have gdb.Frame.select
+if hasattr(gdb.Frame, 'select'):
+ PyUp()
+ PyDown()
+
+class PyBacktrace(gdb.Command):
+ 'Display the current python frame and all the frames within its call stack (if any)'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-bt",
+ gdb.COMMAND_STACK,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ frame = Frame.get_selected_python_frame()
+ while frame:
+ if frame.is_evalframeex():
+ frame.print_summary()
+ frame = frame.older()
+
+PyBacktrace()
+
+class PyPrint(gdb.Command):
+ 'Look up the given python variable name, and print it'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-print",
+ gdb.COMMAND_DATA,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ name = str(args)
+
+ frame = Frame.get_selected_python_frame()
+ if not frame:
+ print 'Unable to locate python frame'
+ return
+
+ pyop_frame = frame.get_pyop()
+ if not pyop_frame:
+ print 'Unable to read information on python frame'
+ return
+
+ pyop_var, scope = pyop_frame.get_var_by_name(name)
+
+ if pyop_var:
+ print ('%s %r = %s'
+ % (scope,
+ name,
+ pyop_var.get_truncated_repr(MAX_OUTPUT_LEN)))
+ else:
+ print '%r not found' % name
+
+PyPrint()
+
+class PyLocals(gdb.Command):
+ 'Look up the given python variable name, and print it'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-locals",
+ gdb.COMMAND_DATA,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ name = str(args)
+
+ frame = Frame.get_selected_python_frame()
+ if not frame:
+ print 'Unable to locate python frame'
+ return
+
+ pyop_frame = frame.get_pyop()
+ if not pyop_frame:
+ print 'Unable to read information on python frame'
+ return
+
+ for pyop_name, pyop_value in pyop_frame.iter_locals():
+ print ('%s = %s'
+ % (pyop_name.proxyval(set()),
+ pyop_value.get_truncated_repr(MAX_OUTPUT_LEN)))
+
+PyLocals()
diff --git a/Tools/i18n/makelocalealias.py b/Tools/i18n/makelocalealias.py
index 45876c1d0d..68544ac27b 100644
--- a/Tools/i18n/makelocalealias.py
+++ b/Tools/i18n/makelocalealias.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Convert the X11 locale.alias file into a mapping dictionary suitable
for locale.py.
@@ -9,7 +9,7 @@
import locale
# Location of the alias file
-LOCALE_ALIAS = '/usr/lib/X11/locale/locale.alias'
+LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias'
def parse(filename):
diff --git a/Tools/i18n/msgfmt.py b/Tools/i18n/msgfmt.py
index 860e4eaf34..a5544424e2 100755
--- a/Tools/i18n/msgfmt.py
+++ b/Tools/i18n/msgfmt.py
@@ -1,6 +1,5 @@
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# Written by Martin v. Löwis <loewis@informatik.hu-berlin.de>
+#! /usr/bin/env python3
+# Written by Martin v. Löwis <loewis@informatik.hu-berlin.de>
"""Generate binary message catalog from textual translation description.
@@ -30,6 +29,7 @@ import os
import getopt
import struct
import array
+from email.parser import HeaderParser
__version__ = "1.1"
@@ -59,13 +59,13 @@ def generate():
# the keys are sorted in the .mo file
keys = sorted(MESSAGES.keys())
offsets = []
- ids = strs = ''
+ ids = strs = b''
for id in keys:
# For each string, we need size and file offset. Each string is NUL
# terminated; the NUL does not count into the size.
offsets.append((len(ids), len(id), len(strs), len(MESSAGES[id])))
- ids += id + '\0'
- strs += MESSAGES[id] + '\0'
+ ids += id + b'\0'
+ strs += MESSAGES[id] + b'\0'
output = ''
# The header is 7 32-bit unsigned integers. We don't use hash tables, so
# the keys start right after the index tables.
@@ -108,7 +108,7 @@ def make(filename, outfile):
outfile = os.path.splitext(infile)[0] + '.mo'
try:
- lines = open(infile).readlines()
+ lines = open(infile, 'rb').readlines()
except IOError as msg:
print(msg, file=sys.stderr)
sys.exit(1)
@@ -116,9 +116,14 @@ def make(filename, outfile):
section = None
fuzzy = 0
+ # Start off assuming Latin-1, so everything decodes without failure,
+ # until we know the exact encoding
+ encoding = 'latin-1'
+
# Parse the catalog
lno = 0
for l in lines:
+ l = l.decode(encoding)
lno += 1
# If we get a comment line after a msgstr, this is a new entry
if l[0] == '#' and section == STR:
@@ -132,16 +137,45 @@ def make(filename, outfile):
if l[0] == '#':
continue
# Now we are in a msgid section, output previous section
- if l.startswith('msgid'):
+ if l.startswith('msgid') and not l.startswith('msgid_plural'):
if section == STR:
add(msgid, msgstr, fuzzy)
+ if not msgid:
+ # See whether there is an encoding declaration
+ p = HeaderParser()
+ charset = p.parsestr(msgstr.decode(encoding)).get_content_charset()
+ if charset:
+ encoding = charset
section = ID
l = l[5:]
- msgid = msgstr = ''
+ msgid = msgstr = b''
+ is_plural = False
+ # This is a message with plural forms
+ elif l.startswith('msgid_plural'):
+ if section != ID:
+ print('msgid_plural not preceeded by msgid on %s:%d' % (infile, lno),
+ file=sys.stderr)
+ sys.exit(1)
+ l = l[12:]
+ msgid += b'\0' # separator of singular and plural
+ is_plural = True
# Now we are in a msgstr section
elif l.startswith('msgstr'):
section = STR
- l = l[6:]
+ if l.startswith('msgstr['):
+ if not is_plural:
+ print('plural without msgid_plural on %s:%d' % (infile, lno),
+ file=sys.stderr)
+ sys.exit(1)
+ l = l.split(']', 1)[1]
+ if msgstr:
+ msgstr += b'\0' # Separator of the various plural forms
+ else:
+ if is_plural:
+ print('indexed msgstr required for plural on %s:%d' % (infile, lno),
+ file=sys.stderr)
+ sys.exit(1)
+ l = l[6:]
# Skip empty lines
l = l.strip()
if not l:
@@ -149,9 +183,9 @@ def make(filename, outfile):
# XXX: Does this always follow Python escape semantics?
l = eval(l)
if section == ID:
- msgid += l
+ msgid += l.encode(encoding)
elif section == STR:
- msgstr += l
+ msgstr += l.encode(encoding)
else:
print('Syntax error on %s:%d' % (infile, lno), \
'before:', file=sys.stderr)
diff --git a/Tools/i18n/pygettext.py b/Tools/i18n/pygettext.py
index d4ea59763d..67a960f4f8 100755
--- a/Tools/i18n/pygettext.py
+++ b/Tools/i18n/pygettext.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# -*- coding: iso-8859-1 -*-
# Originally written by Barry Warsaw <barry@zope.com>
#
diff --git a/Tools/iobench/iobench.py b/Tools/iobench/iobench.py
new file mode 100644
index 0000000000..b3bdd6a670
--- /dev/null
+++ b/Tools/iobench/iobench.py
@@ -0,0 +1,545 @@
+# -*- coding: utf-8 -*-
+# This file should be kept compatible with both Python 2.6 and Python >= 3.0.
+
+import time
+import os
+import re
+import sys
+import hashlib
+import functools
+import itertools
+from optparse import OptionParser
+
+out = sys.stdout
+
+TEXT_ENCODING = 'utf8'
+NEWLINES = 'lf'
+
+# Compatibility
+try:
+ xrange
+except NameError:
+ xrange = range
+
+def text_open(fn, mode, encoding=None):
+ try:
+ return open(fn, mode, encoding=encoding or TEXT_ENCODING)
+ except TypeError:
+ return open(fn, mode)
+
+def get_file_sizes():
+ for s in ['20 KB', '400 KB', '10 MB']:
+ size, unit = s.split()
+ size = int(size) * {'KB': 1024, 'MB': 1024 ** 2}[unit]
+ yield s.replace(' ', ''), size
+
+def get_binary_files():
+ return ((name + ".bin", size) for name, size in get_file_sizes())
+
+def get_text_files():
+ return (("%s-%s-%s.txt" % (name, TEXT_ENCODING, NEWLINES), size)
+ for name, size in get_file_sizes())
+
+def with_open_mode(mode):
+ def decorate(f):
+ f.file_open_mode = mode
+ return f
+ return decorate
+
+def with_sizes(*sizes):
+ def decorate(f):
+ f.file_sizes = sizes
+ return f
+ return decorate
+
+
+# Here begin the tests
+
+@with_open_mode("r")
+@with_sizes("medium")
+def read_bytewise(f):
+ """ read one unit at a time """
+ f.seek(0)
+ while f.read(1):
+ pass
+
+@with_open_mode("r")
+@with_sizes("medium")
+def read_small_chunks(f):
+ """ read 20 units at a time """
+ f.seek(0)
+ while f.read(20):
+ pass
+
+@with_open_mode("r")
+@with_sizes("medium")
+def read_big_chunks(f):
+ """ read 4096 units at a time """
+ f.seek(0)
+ while f.read(4096):
+ pass
+
+@with_open_mode("r")
+@with_sizes("small", "medium", "large")
+def read_whole_file(f):
+ """ read whole contents at once """
+ f.seek(0)
+ while f.read():
+ pass
+
+@with_open_mode("rt")
+@with_sizes("medium")
+def read_lines(f):
+ """ read one line at a time """
+ f.seek(0)
+ for line in f:
+ pass
+
+@with_open_mode("r")
+@with_sizes("medium")
+def seek_forward_bytewise(f):
+ """ seek forward one unit at a time """
+ f.seek(0, 2)
+ size = f.tell()
+ f.seek(0, 0)
+ for i in xrange(0, size - 1):
+ f.seek(i, 0)
+
+@with_open_mode("r")
+@with_sizes("medium")
+def seek_forward_blockwise(f):
+ """ seek forward 1000 units at a time """
+ f.seek(0, 2)
+ size = f.tell()
+ f.seek(0, 0)
+ for i in xrange(0, size - 1, 1000):
+ f.seek(i, 0)
+
+@with_open_mode("rb")
+@with_sizes("medium")
+def read_seek_bytewise(f):
+ """ alternate read & seek one unit """
+ f.seek(0)
+ while f.read(1):
+ f.seek(1, 1)
+
+@with_open_mode("rb")
+@with_sizes("medium")
+def read_seek_blockwise(f):
+ """ alternate read & seek 1000 units """
+ f.seek(0)
+ while f.read(1000):
+ f.seek(1000, 1)
+
+
+@with_open_mode("w")
+@with_sizes("small")
+def write_bytewise(f, source):
+ """ write one unit at a time """
+ for i in xrange(0, len(source)):
+ f.write(source[i:i+1])
+
+@with_open_mode("w")
+@with_sizes("medium")
+def write_small_chunks(f, source):
+ """ write 20 units at a time """
+ for i in xrange(0, len(source), 20):
+ f.write(source[i:i+20])
+
+@with_open_mode("w")
+@with_sizes("medium")
+def write_medium_chunks(f, source):
+ """ write 4096 units at a time """
+ for i in xrange(0, len(source), 4096):
+ f.write(source[i:i+4096])
+
+@with_open_mode("w")
+@with_sizes("large")
+def write_large_chunks(f, source):
+ """ write 1e6 units at a time """
+ for i in xrange(0, len(source), 1000000):
+ f.write(source[i:i+1000000])
+
+
+@with_open_mode("w+")
+@with_sizes("small")
+def modify_bytewise(f, source):
+ """ modify one unit at a time """
+ f.seek(0)
+ for i in xrange(0, len(source)):
+ f.write(source[i:i+1])
+
+@with_open_mode("w+")
+@with_sizes("medium")
+def modify_small_chunks(f, source):
+ """ modify 20 units at a time """
+ f.seek(0)
+ for i in xrange(0, len(source), 20):
+ f.write(source[i:i+20])
+
+@with_open_mode("w+")
+@with_sizes("medium")
+def modify_medium_chunks(f, source):
+ """ modify 4096 units at a time """
+ f.seek(0)
+ for i in xrange(0, len(source), 4096):
+ f.write(source[i:i+4096])
+
+@with_open_mode("wb+")
+@with_sizes("medium")
+def modify_seek_forward_bytewise(f, source):
+ """ alternate write & seek one unit """
+ f.seek(0)
+ for i in xrange(0, len(source), 2):
+ f.write(source[i:i+1])
+ f.seek(i+2)
+
+@with_open_mode("wb+")
+@with_sizes("medium")
+def modify_seek_forward_blockwise(f, source):
+ """ alternate write & seek 1000 units """
+ f.seek(0)
+ for i in xrange(0, len(source), 2000):
+ f.write(source[i:i+1000])
+ f.seek(i+2000)
+
+# XXX the 2 following tests don't work with py3k's text IO
+@with_open_mode("wb+")
+@with_sizes("medium")
+def read_modify_bytewise(f, source):
+ """ alternate read & write one unit """
+ f.seek(0)
+ for i in xrange(0, len(source), 2):
+ f.read(1)
+ f.write(source[i+1:i+2])
+
+@with_open_mode("wb+")
+@with_sizes("medium")
+def read_modify_blockwise(f, source):
+ """ alternate read & write 1000 units """
+ f.seek(0)
+ for i in xrange(0, len(source), 2000):
+ f.read(1000)
+ f.write(source[i+1000:i+2000])
+
+
+read_tests = [
+ read_bytewise, read_small_chunks, read_lines, read_big_chunks,
+ None, read_whole_file, None,
+ seek_forward_bytewise, seek_forward_blockwise,
+ read_seek_bytewise, read_seek_blockwise,
+]
+
+write_tests = [
+ write_bytewise, write_small_chunks, write_medium_chunks, write_large_chunks,
+]
+
+modify_tests = [
+ modify_bytewise, modify_small_chunks, modify_medium_chunks,
+ None,
+ modify_seek_forward_bytewise, modify_seek_forward_blockwise,
+ read_modify_bytewise, read_modify_blockwise,
+]
+
+def run_during(duration, func):
+ _t = time.time
+ n = 0
+ start = os.times()
+ start_timestamp = _t()
+ real_start = start[4] or start_timestamp
+ while True:
+ func()
+ n += 1
+ if _t() - start_timestamp > duration:
+ break
+ end = os.times()
+ real = (end[4] if start[4] else time.time()) - real_start
+ return n, real, sum(end[0:2]) - sum(start[0:2])
+
+def warm_cache(filename):
+ with open(filename, "rb") as f:
+ f.read()
+
+
+def run_all_tests(options):
+ def print_label(filename, func):
+ name = re.split(r'[-.]', filename)[0]
+ out.write(
+ ("[%s] %s... "
+ % (name.center(7), func.__doc__.strip())
+ ).ljust(52))
+ out.flush()
+
+ def print_results(size, n, real, cpu):
+ bw = n * float(size) / 1024 ** 2 / real
+ bw = ("%4d MB/s" if bw > 100 else "%.3g MB/s") % bw
+ out.write(bw.rjust(12) + "\n")
+ if cpu < 0.90 * real:
+ out.write(" warning: test above used only %d%% CPU, "
+ "result may be flawed!\n" % (100.0 * cpu / real))
+
+ def run_one_test(name, size, open_func, test_func, *args):
+ mode = test_func.file_open_mode
+ print_label(name, test_func)
+ if "w" not in mode or "+" in mode:
+ warm_cache(name)
+ with open_func(name) as f:
+ n, real, cpu = run_during(1.5, lambda: test_func(f, *args))
+ print_results(size, n, real, cpu)
+
+ def run_test_family(tests, mode_filter, files, open_func, *make_args):
+ for test_func in tests:
+ if test_func is None:
+ out.write("\n")
+ continue
+ if mode_filter in test_func.file_open_mode:
+ continue
+ for s in test_func.file_sizes:
+ name, size = files[size_names[s]]
+ #name += file_ext
+ args = tuple(f(name, size) for f in make_args)
+ run_one_test(name, size,
+ open_func, test_func, *args)
+
+ size_names = {
+ "small": 0,
+ "medium": 1,
+ "large": 2,
+ }
+
+ binary_files = list(get_binary_files())
+ text_files = list(get_text_files())
+ if "b" in options:
+ print("Binary unit = one byte")
+ if "t" in options:
+ print("Text unit = one character (%s-decoded)" % TEXT_ENCODING)
+
+ # Binary reads
+ if "b" in options and "r" in options:
+ print("\n** Binary input **\n")
+ run_test_family(read_tests, "t", binary_files, lambda fn: open(fn, "rb"))
+
+ # Text reads
+ if "t" in options and "r" in options:
+ print("\n** Text input **\n")
+ run_test_family(read_tests, "b", text_files, lambda fn: text_open(fn, "r"))
+
+ # Binary writes
+ if "b" in options and "w" in options:
+ print("\n** Binary append **\n")
+ def make_test_source(name, size):
+ with open(name, "rb") as f:
+ return f.read()
+ run_test_family(write_tests, "t", binary_files,
+ lambda fn: open(os.devnull, "wb"), make_test_source)
+
+ # Text writes
+ if "t" in options and "w" in options:
+ print("\n** Text append **\n")
+ def make_test_source(name, size):
+ with text_open(name, "r") as f:
+ return f.read()
+ run_test_family(write_tests, "b", text_files,
+ lambda fn: text_open(os.devnull, "w"), make_test_source)
+
+ # Binary overwrites
+ if "b" in options and "w" in options:
+ print("\n** Binary overwrite **\n")
+ def make_test_source(name, size):
+ with open(name, "rb") as f:
+ return f.read()
+ run_test_family(modify_tests, "t", binary_files,
+ lambda fn: open(fn, "r+b"), make_test_source)
+
+ # Text overwrites
+ if "t" in options and "w" in options:
+ print("\n** Text overwrite **\n")
+ def make_test_source(name, size):
+ with text_open(name, "r") as f:
+ return f.read()
+ run_test_family(modify_tests, "b", text_files,
+ lambda fn: open(fn, "r+"), make_test_source)
+
+
+def prepare_files():
+ print("Preparing files...")
+ # Binary files
+ for name, size in get_binary_files():
+ if os.path.isfile(name) and os.path.getsize(name) == size:
+ continue
+ with open(name, "wb") as f:
+ f.write(os.urandom(size))
+ # Text files
+ chunk = []
+ with text_open(__file__, "rU", encoding='utf8') as f:
+ for line in f:
+ if line.startswith("# <iobench text chunk marker>"):
+ break
+ else:
+ raise RuntimeError(
+ "Couldn't find chunk marker in %s !" % __file__)
+ if NEWLINES == "all":
+ it = itertools.cycle(["\n", "\r", "\r\n"])
+ else:
+ it = itertools.repeat(
+ {"cr": "\r", "lf": "\n", "crlf": "\r\n"}[NEWLINES])
+ chunk = "".join(line.replace("\n", next(it)) for line in f)
+ if isinstance(chunk, bytes):
+ chunk = chunk.decode('utf8')
+ chunk = chunk.encode(TEXT_ENCODING)
+ for name, size in get_text_files():
+ if os.path.isfile(name) and os.path.getsize(name) == size:
+ continue
+ head = chunk * (size // len(chunk))
+ tail = chunk[:size % len(chunk)]
+ # Adjust tail to end on a character boundary
+ while True:
+ try:
+ tail.decode(TEXT_ENCODING)
+ break
+ except UnicodeDecodeError:
+ tail = tail[:-1]
+ with open(name, "wb") as f:
+ f.write(head)
+ f.write(tail)
+
+def main():
+ global TEXT_ENCODING, NEWLINES
+
+ usage = "usage: %prog [-h|--help] [options]"
+ parser = OptionParser(usage=usage)
+ parser.add_option("-b", "--binary",
+ action="store_true", dest="binary", default=False,
+ help="run binary I/O tests")
+ parser.add_option("-t", "--text",
+ action="store_true", dest="text", default=False,
+ help="run text I/O tests")
+ parser.add_option("-r", "--read",
+ action="store_true", dest="read", default=False,
+ help="run read tests")
+ parser.add_option("-w", "--write",
+ action="store_true", dest="write", default=False,
+ help="run write & modify tests")
+ parser.add_option("-E", "--encoding",
+ action="store", dest="encoding", default=None,
+ help="encoding for text tests (default: %s)" % TEXT_ENCODING)
+ parser.add_option("-N", "--newlines",
+ action="store", dest="newlines", default='lf',
+ help="line endings for text tests "
+ "(one of: {lf (default), cr, crlf, all})")
+ parser.add_option("-m", "--io-module",
+ action="store", dest="io_module", default=None,
+ help="io module to test (default: builtin open())")
+ options, args = parser.parse_args()
+ if args:
+ parser.error("unexpected arguments")
+ NEWLINES = options.newlines.lower()
+ if NEWLINES not in ('lf', 'cr', 'crlf', 'all'):
+ parser.error("invalid 'newlines' option: %r" % NEWLINES)
+
+ test_options = ""
+ if options.read:
+ test_options += "r"
+ if options.write:
+ test_options += "w"
+ elif not options.read:
+ test_options += "rw"
+ if options.text:
+ test_options += "t"
+ if options.binary:
+ test_options += "b"
+ elif not options.text:
+ test_options += "tb"
+
+ if options.encoding:
+ TEXT_ENCODING = options.encoding
+
+ if options.io_module:
+ globals()['open'] = __import__(options.io_module, {}, {}, ['open']).open
+
+ prepare_files()
+ run_all_tests(test_options)
+
+if __name__ == "__main__":
+ main()
+
+
+# -- This part to exercise text reading. Don't change anything! --
+# <iobench text chunk marker>
+
+"""
+1.
+Gáttir allar,
+áðr gangi fram,
+um skoðask skyli,
+um skyggnast skyli,
+því at óvíst er at vita,
+hvar óvinir
+sitja á fleti fyrir.
+
+2.
+Gefendr heilir!
+Gestr er inn kominn,
+hvar skal sitja sjá?
+Mjök er bráðr,
+sá er á bröndum skal
+síns of freista frama.
+
+3.
+Elds er þörf,
+þeims inn er kominn
+ok á kné kalinn;
+matar ok váða
+er manni þörf,
+þeim er hefr um fjall farit.
+
+4.
+Vatns er þörf,
+þeim er til verðar kemr,
+þerru ok þjóðlaðar,
+góðs of æðis,
+ef sér geta mætti,
+orðs ok endrþögu.
+
+5.
+Vits er þörf,
+þeim er víða ratar;
+dælt er heima hvat;
+at augabragði verðr,
+sá er ekki kann
+ok með snotrum sitr.
+
+6.
+At hyggjandi sinni
+skyli-t maðr hræsinn vera,
+heldr gætinn at geði;
+þá er horskr ok þögull
+kemr heimisgarða til,
+sjaldan verðr víti vörum,
+því at óbrigðra vin
+fær maðr aldregi
+en mannvit mikit.
+
+7.
+Inn vari gestr,
+er til verðar kemr,
+þunnu hljóði þegir,
+eyrum hlýðir,
+en augum skoðar;
+svá nýsisk fróðra hverr fyrir.
+
+8.
+Hinn er sæll,
+er sér of getr
+lof ok líknstafi;
+ódælla er við þat,
+er maðr eiga skal
+annars brjóstum í.
+"""
+
+"""
+C'est revenir tard, je le sens, sur un sujet trop rebattu et déjà presque oublié. Mon état, qui ne me permet plus aucun travail suivi, mon aversion pour le genre polémique, ont causé ma lenteur à écrire et ma répugnance à publier. J'aurais même tout à fait supprimé ces Lettres, ou plutôt je lie les aurais point écrites, s'il n'eût été question que de moi : Mais ma patrie ne m'est pas tellement devenue étrangère que je puisse voir tranquillement opprimer ses citoyens, surtout lorsqu'ils n'ont compromis leurs droits qu'en défendant ma cause. Je serais le dernier des hommes si dans une telle occasion j'écoutais un sentiment qui n'est plus ni douceur ni patience, mais faiblesse et lâcheté, dans celui qu'il empêche de remplir son devoir.
+Rien de moins important pour le public, j'en conviens, que la matière de ces lettres. La constitution d'une petite République, le sort d'un petit particulier, l'exposé de quelques injustices, la réfutation de quelques sophismes ; tout cela n'a rien en soi d'assez considérable pour mériter beaucoup de lecteurs : mais si mes sujets sont petits mes objets sont grands, et dignes de l'attention de tout honnête homme. Laissons Genève à sa place, et Rousseau dans sa dépression ; mais la religion, mais la liberté, la justice ! voilà, qui que vous soyez, ce qui n'est pas au-dessous de vous.
+Qu'on ne cherche pas même ici dans le style le dédommagement de l'aridité de la matière. Ceux que quelques traits heureux de ma plume ont si fort irrités trouveront de quoi s'apaiser dans ces lettres, L'honneur de défendre un opprimé eût enflammé mon coeur si j'avais parlé pour un autre. Réduit au triste emploi de me défendre moi-même, j'ai dû me borner à raisonner ; m'échauffer eût été m'avilir. J'aurai donc trouvé grâce en ce point devant ceux qui s'imaginent qu'il est essentiel à la vérité d'être dite froidement ; opinion que pourtant j'ai peine à comprendre. Lorsqu'une vive persuasion nous anime, le moyen d'employer un langage glacé ? Quand Archimède tout transporté courait nu dans les rues de Syracuse, en avait-il moins trouvé la vérité parce qu'il se passionnait pour elle ? Tout au contraire, celui qui la sent ne peut s'abstenir de l'adorer ; celui qui demeure froid ne l'a pas vue.
+Quoi qu'il en soit, je prie les lecteurs de vouloir bien mettre à part mon beau style, et d'examiner seulement si je raisonne bien ou mal ; car enfin, de cela seul qu'un auteur s'exprime en bons termes, je ne vois pas comment il peut s'ensuivre que cet auteur ne sait ce qu'il dit.
+"""
diff --git a/Tools/modulator/EXAMPLE.py b/Tools/modulator/EXAMPLE.py
deleted file mode 100644
index b36a5a761c..0000000000
--- a/Tools/modulator/EXAMPLE.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Example input file for modulator if you don't have tk.
-#
-# You may also have to strip some imports out of modulator to make
-# it work.
-
-import genmodule
-
-#
-# Generate code for a simple object with a method called sample
-
-o = genmodule.object()
-o.name = 'simple object'
-o.abbrev = 'simp'
-o.methodlist = ['sample']
-o.funclist = ['new']
-
-#
-# Generate code for an object that looks numberish
-#
-o2 = genmodule.object()
-o2.name = 'number-like object'
-o2.abbrev = 'nl'
-o2.typelist = ['tp_as_number']
-o2.funclist = ['new', 'tp_repr', 'tp_compare']
-
-#
-# Generate code for a method with a full complement of functions,
-# some methods, accessible as sequence and allowing structmember.c type
-# structure access as well.
-#
-o3 = genmodule.object()
-o3.name = 'over-the-top object'
-o3.abbrev = 'ot'
-o3.methodlist = ['method1', 'method2']
-o3.funclist = ['new', 'tp_dealloc', 'tp_print', 'tp_getattr', 'tp_setattr',
- 'tp_compare', 'tp_repr', 'tp_hash']
-o3.typelist = ['tp_as_sequence', 'structure']
-
-#
-# Now generate code for a module that incorporates these object types.
-# Also add the boilerplates for functions to create instances of each
-# type.
-#
-m = genmodule.module()
-m.name = 'sample'
-m.abbrev = 'sample'
-m.methodlist = ['newsimple', 'newnumberish', 'newott']
-m.objects = [o, o2, o3]
-
-fp = open('EXAMPLEmodule.c', 'w')
-genmodule.write(fp, m)
-fp.close()
diff --git a/Tools/modulator/README b/Tools/modulator/README
deleted file mode 100644
index aae86b4a75..0000000000
--- a/Tools/modulator/README
+++ /dev/null
@@ -1,25 +0,0 @@
-This is release 1.2 of modulator, a generator of boilerplate code for
-modules to be written in C.
-
-Difference between 1.2 and 1.1: __doc__ templates are now generated
-(thanks to Jim Fulton).
-
-Difference between 1.1 and 1.0: the templates now use "new-style"
-naming conventions. Many thanks to Chak Tan <tan@ee.rochester.edu> for
-supplying them.
-
-Usage when you have tk is *really* simple: start modulator, fill out
-the forms specifying all the objects and methods, tell modulator
-whether objects should also be accessible as sequences, etc and press
-'generate code'. It will write a complete skeleton module for you.
-
-Usage when you don't have tk is slightly more difficult. Look at
-EXAMPLE.py for some details (to run, use "python EXAMPLE.py"). Don't
-bother with EXAMPLE.py if you have Tkinter!!!
-
-Oh yeah: you'll probably want to change Templates/copyright, or all
-your code ends up as being copyrighted to CWI:-)
-
-Let me know what you think,
- Jack Jansen, jack@cwi.nl
-
diff --git a/Tools/modulator/ScrolledListbox.py b/Tools/modulator/ScrolledListbox.py
deleted file mode 100644
index 2ec646df6a..0000000000
--- a/Tools/modulator/ScrolledListbox.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# A ScrolledList widget feels like a list widget but also has a
-# vertical scroll bar on its right. (Later, options may be added to
-# add a horizontal bar as well, to make the bars disappear
-# automatically when not needed, to move them to the other side of the
-# window, etc.)
-#
-# Configuration options are passed to the List widget.
-# A Frame widget is inserted between the master and the list, to hold
-# the Scrollbar widget.
-# Most methods calls are inherited from the List widget; Pack methods
-# are redirected to the Frame widget however.
-
-from Tkinter import *
-from Tkinter import _cnfmerge
-
-class ScrolledListbox(Listbox):
- def __init__(self, master=None, cnf={}):
- cnf = _cnfmerge(cnf)
- fcnf = {}
- vcnf = {'name': 'vbar',
- Pack: {'side': 'right', 'fill': 'y'},}
- for k in list(cnf.keys()):
- if type(k) == ClassType or k == 'name':
- fcnf[k] = cnf[k]
- del cnf[k]
- self.frame = Frame(master, fcnf)
- self.vbar = Scrollbar(self.frame, vcnf)
- cnf[Pack] = {'side': 'left', 'fill': 'both', 'expand': 'yes'}
- cnf['name'] = 'list'
- Listbox.__init__(self, self.frame, cnf)
- self['yscrollcommand'] = (self.vbar, 'set')
- self.vbar['command'] = (self, 'yview')
-
- # Copy Pack methods of self.frame -- hack!
- for m in Pack.__dict__:
- if m[0] != '_' and m != 'config':
- setattr(self, m, getattr(self.frame, m))
diff --git a/Tools/modulator/Templates/module_head b/Tools/modulator/Templates/module_head
deleted file mode 100644
index be001090b9..0000000000
--- a/Tools/modulator/Templates/module_head
+++ /dev/null
@@ -1,6 +0,0 @@
-
-#include "Python.h"
-
-static PyObject *ErrorObject;
-
-/* ----------------------------------------------------- */
diff --git a/Tools/modulator/Templates/module_method b/Tools/modulator/Templates/module_method
deleted file mode 100644
index 3048b1fc48..0000000000
--- a/Tools/modulator/Templates/module_method
+++ /dev/null
@@ -1,14 +0,0 @@
-
-static char $abbrev$_$method$__doc__[] =
-""
-;
-
-static PyObject *
-$abbrev$_$method$(PyObject *self /* Not used */, PyObject *args)
-{
-
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- Py_INCREF(Py_None);
- return Py_None;
-}
diff --git a/Tools/modulator/Templates/module_tail b/Tools/modulator/Templates/module_tail
deleted file mode 100644
index 59cc50b6c0..0000000000
--- a/Tools/modulator/Templates/module_tail
+++ /dev/null
@@ -1,37 +0,0 @@
-
-/* List of methods defined in the module */
-
-static struct PyMethodDef $abbrev$_methods[] = {
- $methodlist$
- {NULL, (PyCFunction)NULL, 0, NULL} /* sentinel */
-};
-
-
-/* Initialization function for the module (*must* be called init$name$) */
-
-static char $name$_module_documentation[] =
-""
-;
-
-void
-init$name$()
-{
- PyObject *m, *d;
-
- /* Create the module and add the functions */
- m = Py_InitModule4("$name$", $abbrev$_methods,
- $name$_module_documentation,
- (PyObject*)NULL,PYTHON_API_VERSION);
-
- /* Add some symbolic constants to the module */
- d = PyModule_GetDict(m);
- ErrorObject = PyString_FromString("$name$.error");
- PyDict_SetItemString(d, "error", ErrorObject);
-
- /* XXXX Add constants here */
-
- /* Check for errors */
- if (PyErr_Occurred())
- Py_FatalError("can't initialize module $name$");
-}
-
diff --git a/Tools/modulator/Templates/object_head b/Tools/modulator/Templates/object_head
deleted file mode 100644
index 07d1f6a9fd..0000000000
--- a/Tools/modulator/Templates/object_head
+++ /dev/null
@@ -1,13 +0,0 @@
-
-/* Declarations for objects of type $name$ */
-
-typedef struct {
- PyObject_HEAD
- /* XXXX Add your own stuff here */
-} $abbrev$object;
-
-static PyTypeObject $Abbrev$type;
-
-
-
-/* ---------------------------------------------------------------- */
diff --git a/Tools/modulator/Templates/object_method b/Tools/modulator/Templates/object_method
deleted file mode 100644
index b15162c317..0000000000
--- a/Tools/modulator/Templates/object_method
+++ /dev/null
@@ -1,14 +0,0 @@
-
-static char $abbrev$_$method$__doc__[] =
-""
-;
-
-static PyObject *
-$abbrev$_$method$($abbrev$object *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- Py_INCREF(Py_None);
- return Py_None;
-}
-
diff --git a/Tools/modulator/Templates/object_mlist b/Tools/modulator/Templates/object_mlist
deleted file mode 100644
index a12a9e1be1..0000000000
--- a/Tools/modulator/Templates/object_mlist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-static struct PyMethodDef $abbrev$_methods[] = {
- $methodlist$
- {NULL, NULL} /* sentinel */
-};
-
-/* ---------- */
-
diff --git a/Tools/modulator/Templates/object_new b/Tools/modulator/Templates/object_new
deleted file mode 100644
index 30c5e363e6..0000000000
--- a/Tools/modulator/Templates/object_new
+++ /dev/null
@@ -1,13 +0,0 @@
-
-static $abbrev$object *
-new$abbrev$object()
-{
- $abbrev$object *self;
-
- self = PyObject_NEW($abbrev$object, &$Abbrev$type);
- if (self == NULL)
- return NULL;
- /* XXXX Add your own initializers here */
- return self;
-}
-
diff --git a/Tools/modulator/Templates/object_structure b/Tools/modulator/Templates/object_structure
deleted file mode 100644
index 78daa62517..0000000000
--- a/Tools/modulator/Templates/object_structure
+++ /dev/null
@@ -1,37 +0,0 @@
-
-/* Code to access structure members by accessing attributes */
-
-#include "structmember.h"
-
-#define OFF(x) offsetof(XXXXobject, x)
-
-static PyMemberDef $abbrev$_memberlist[] = {
- /* XXXX Add lines like { "foo", T_INT, OFF(foo), READONLY } */
-
- {NULL} /* Sentinel */
-};
-
-static PyObject *
-$abbrev$_getattr($abbrev$object *self, char *name)
-{
- PyObject *rv;
-
- /* XXXX Add your own getattr code here */
- rv = PyMember_GetOne((char *)/*XXXX*/0, &$abbrev$_memberlist[i]);
- if (rv)
- return rv;
- PyErr_Clear();
- return Py_FindMethod($abbrev$_methods, (PyObject *)self, name);
-}
-
-
-static int
-$abbrev$_setattr($abbrev$object *self, char *name, PyObject *v)
-{
- /* XXXX Add your own setattr code here */
- if ( v == NULL ) {
- PyErr_SetString(PyExc_AttributeError, "Cannot delete attribute");
- return -1;
- }
- return PyMember_SetOne((char *)/*XXXX*/0, &$abbrev$_memberlist[i], v);
-}
diff --git a/Tools/modulator/Templates/object_tail b/Tools/modulator/Templates/object_tail
deleted file mode 100644
index 1d1334c9fe..0000000000
--- a/Tools/modulator/Templates/object_tail
+++ /dev/null
@@ -1,33 +0,0 @@
-
-static char $Abbrev$type__doc__[] =
-""
-;
-
-static PyTypeObject $Abbrev$type = {
- PyObject_HEAD_INIT(&PyType_Type)
- 0, /*ob_size*/
- "$name$", /*tp_name*/
- sizeof($abbrev$object), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)$tp_dealloc$, /*tp_dealloc*/
- (printfunc)$tp_print$, /*tp_print*/
- (getattrfunc)$tp_getattr$, /*tp_getattr*/
- (setattrfunc)$tp_setattr$, /*tp_setattr*/
- (cmpfunc)$tp_compare$, /*tp_compare*/
- (reprfunc)$tp_repr$, /*tp_repr*/
- $tp_as_number$, /*tp_as_number*/
- $tp_as_sequence$, /*tp_as_sequence*/
- $tp_as_mapping$, /*tp_as_mapping*/
- (hashfunc)$tp_hash$, /*tp_hash*/
- (ternaryfunc)$tp_call$, /*tp_call*/
- (reprfunc)$tp_str$, /*tp_str*/
-
- /* Space for future expansion */
- 0L,0L,0L,0L,
- $Abbrev$type__doc__ /* Documentation string */
-};
-
-/* End of code for $name$ objects */
-/* -------------------------------------------------------- */
-
diff --git a/Tools/modulator/Templates/object_tp_as_mapping b/Tools/modulator/Templates/object_tp_as_mapping
deleted file mode 100644
index f9213b70ef..0000000000
--- a/Tools/modulator/Templates/object_tp_as_mapping
+++ /dev/null
@@ -1,29 +0,0 @@
-
-/* Code to access $name$ objects as mappings */
-
-static int
-$abbrev$_length($abbrev$object *self)
-{
- /* XXXX Return the size of the mapping */
-}
-
-static PyObject *
-$abbrev$_subscript($abbrev$object *self, PyObject *key)
-{
- /* XXXX Return the item of self indexed by key */
-}
-
-static int
-$abbrev$_ass_sub($abbrev$object *self, PyObject *v, PyObject *w)
-{
- /* XXXX Put w in self under key v */
- return 0;
-}
-
-static PyMappingMethods $abbrev$_as_mapping = {
- (inquiry)$abbrev$_length, /*mp_length*/
- (binaryfunc)$abbrev$_subscript, /*mp_subscript*/
- (objobjargproc)$abbrev$_ass_sub, /*mp_ass_subscript*/
-};
-
-/* -------------------------------------------------------- */
diff --git a/Tools/modulator/Templates/object_tp_as_number b/Tools/modulator/Templates/object_tp_as_number
deleted file mode 100644
index a3426c2431..0000000000
--- a/Tools/modulator/Templates/object_tp_as_number
+++ /dev/null
@@ -1,162 +0,0 @@
-
-/* Code to access $name$ objects as numbers */
-
-static PyObject *
-$abbrev$_add($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX Add them */
-}
-
-static PyObject *
-$abbrev$_sub($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX Subtract them */
-}
-
-static PyObject *
-$abbrev$_mul($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX Multiply them */
-}
-
-static PyObject *
-$abbrev$_div($abbrev$object *x, $abbrev$object *y)
-{
- /* XXXX Divide them */
-}
-
-static PyObject *
-$abbrev$_mod($abbrev$object *x, $abbrev$object *y)
-{
- /* XXXX Modulo them */
-}
-
-static PyObject *
-$abbrev$_divmod($abbrev$object *x, $abbrev$object *y)
-{
- /* XXXX Return 2-tuple with div and mod */
-}
-
-static PyObject *
-$abbrev$_pow($abbrev$object *v, $abbrev$object *w, $abbrev$object *z)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_neg($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_pos($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_abs($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static int
-$abbrev$_nonzero($abbrev$object *v)
-{
- /* XXXX Return 1 if non-zero */
-}
-
-static PyObject *
-$abbrev$_invert($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_lshift($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_rshift($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_and($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_xor($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_or($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_int($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_long($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_float($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_oct($abbrev$object *v)
-{
- /* XXXX Return object as octal stringobject */
-}
-
-static PyObject *
-$abbrev$_hex($abbrev$object *v)
-{
- /* XXXX Return object as hex stringobject */
-}
-
-static PyNumberMethods $abbrev$_as_number = {
- (binaryfunc)$abbrev$_add, /*nb_add*/
- (binaryfunc)$abbrev$_sub, /*nb_subtract*/
- (binaryfunc)$abbrev$_mul, /*nb_multiply*/
- (binaryfunc)$abbrev$_div, /*nb_divide*/
- (binaryfunc)$abbrev$_mod, /*nb_remainder*/
- (binaryfunc)$abbrev$_divmod, /*nb_divmod*/
- (ternaryfunc)$abbrev$_pow, /*nb_power*/
- (unaryfunc)$abbrev$_neg, /*nb_negative*/
- (unaryfunc)$abbrev$_pos, /*nb_positive*/
- (unaryfunc)$abbrev$_abs, /*nb_absolute*/
- (inquiry)$abbrev$_nonzero, /*nb_nonzero*/
- (unaryfunc)$abbrev$_invert, /*nb_invert*/
- (binaryfunc)$abbrev$_lshift, /*nb_lshift*/
- (binaryfunc)$abbrev$_rshift, /*nb_rshift*/
- (binaryfunc)$abbrev$_and, /*nb_and*/
- (binaryfunc)$abbrev$_xor, /*nb_xor*/
- (binaryfunc)$abbrev$_or, /*nb_or*/
- (coercion)$abbrev$_coerce, /*nb_coerce*/
- (unaryfunc)$abbrev$_int, /*nb_int*/
- (unaryfunc)$abbrev$_long, /*nb_long*/
- (unaryfunc)$abbrev$_float, /*nb_float*/
- (unaryfunc)$abbrev$_oct, /*nb_oct*/
- (unaryfunc)$abbrev$_hex, /*nb_hex*/
-};
-
-/* ------------------------------------------------------- */
diff --git a/Tools/modulator/Templates/object_tp_as_sequence b/Tools/modulator/Templates/object_tp_as_sequence
deleted file mode 100644
index 54c0b92901..0000000000
--- a/Tools/modulator/Templates/object_tp_as_sequence
+++ /dev/null
@@ -1,58 +0,0 @@
-
-/* Code to handle accessing $name$ objects as sequence objects */
-
-static int
-$abbrev$_length($abbrev$object *self)
-{
- /* XXXX Return the size of the object */
-}
-
-static PyObject *
-$abbrev$_concat($abbrev$object *self, PyObject *bb)
-{
- /* XXXX Return the concatenation of self and bb */
-}
-
-static PyObject *
-$abbrev$_repeat($abbrev$object *self, int n)
-{
- /* XXXX Return a new object that is n times self */
-}
-
-static PyObject *
-$abbrev$_item($abbrev$object *self, int i)
-{
- /* XXXX Return the i-th object of self */
-}
-
-static PyObject *
-$abbrev$_slice($abbrev$object *self, int ilow, int ihigh)
-{
- /* XXXX Return the ilow..ihigh slice of self in a new object */
-}
-
-static int
-$abbrev$_ass_item($abbrev$object *self, int i, PyObject *v)
-{
- /* XXXX Assign to the i-th element of self */
- return 0;
-}
-
-static int
-$abbrev$_ass_slice(PyListObject *self, int ilow, int ihigh, PyObject *v)
-{
- /* XXXX Replace ilow..ihigh slice of self with v */
- return 0;
-}
-
-static PySequenceMethods $abbrev$_as_sequence = {
- (inquiry)$abbrev$_length, /*sq_length*/
- (binaryfunc)$abbrev$_concat, /*sq_concat*/
- (intargfunc)$abbrev$_repeat, /*sq_repeat*/
- (intargfunc)$abbrev$_item, /*sq_item*/
- (intintargfunc)$abbrev$_slice, /*sq_slice*/
- (intobjargproc)$abbrev$_ass_item, /*sq_ass_item*/
- (intintobjargproc)$abbrev$_ass_slice, /*sq_ass_slice*/
-};
-
-/* -------------------------------------------------------------- */
diff --git a/Tools/modulator/Templates/object_tp_call b/Tools/modulator/Templates/object_tp_call
deleted file mode 100644
index a93f17fd61..0000000000
--- a/Tools/modulator/Templates/object_tp_call
+++ /dev/null
@@ -1,7 +0,0 @@
-
-static PyObject *
-$abbrev$_call($abbrev$object *self, PyObject *args, PyObject *kwargs)
-{
- /* XXXX Return the result of calling self with argument args */
-}
-
diff --git a/Tools/modulator/Templates/object_tp_compare b/Tools/modulator/Templates/object_tp_compare
deleted file mode 100644
index 153bae0bd4..0000000000
--- a/Tools/modulator/Templates/object_tp_compare
+++ /dev/null
@@ -1,6 +0,0 @@
-
-static int
-$abbrev$_compare($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX Compare objects and return -1, 0 or 1 */
-}
diff --git a/Tools/modulator/Templates/object_tp_dealloc b/Tools/modulator/Templates/object_tp_dealloc
deleted file mode 100644
index 440419a524..0000000000
--- a/Tools/modulator/Templates/object_tp_dealloc
+++ /dev/null
@@ -1,7 +0,0 @@
-
-static void
-$abbrev$_dealloc($abbrev$object *self)
-{
- /* XXXX Add your own cleanup code here */
- PyMem_DEL(self);
-}
diff --git a/Tools/modulator/Templates/object_tp_getattr b/Tools/modulator/Templates/object_tp_getattr
deleted file mode 100644
index 6a1b2e8660..0000000000
--- a/Tools/modulator/Templates/object_tp_getattr
+++ /dev/null
@@ -1,7 +0,0 @@
-
-static PyObject *
-$abbrev$_getattr($abbrev$object *self, char *name)
-{
- /* XXXX Add your own getattr code here */
- return Py_FindMethod($abbrev$_methods, (PyObject *)self, name);
-}
diff --git a/Tools/modulator/Templates/object_tp_hash b/Tools/modulator/Templates/object_tp_hash
deleted file mode 100644
index 2d63f6a8ab..0000000000
--- a/Tools/modulator/Templates/object_tp_hash
+++ /dev/null
@@ -1,6 +0,0 @@
-
-static long
-$abbrev$_hash($abbrev$object *self)
-{
- /* XXXX Return a hash of self (or -1) */
-}
diff --git a/Tools/modulator/Templates/object_tp_print b/Tools/modulator/Templates/object_tp_print
deleted file mode 100644
index 76408d234f..0000000000
--- a/Tools/modulator/Templates/object_tp_print
+++ /dev/null
@@ -1,7 +0,0 @@
-
-static int
-$abbrev$_print($abbrev$object *self, FILE *fp, int flags)
-{
- /* XXXX Add code here to print self to fp */
- return 0;
-}
diff --git a/Tools/modulator/Templates/object_tp_repr b/Tools/modulator/Templates/object_tp_repr
deleted file mode 100644
index f122225087..0000000000
--- a/Tools/modulator/Templates/object_tp_repr
+++ /dev/null
@@ -1,9 +0,0 @@
-
-static PyObject *
-$abbrev$_repr($abbrev$object *self)
-{
- PyObject *s;
-
- /* XXXX Add code here to put self into s */
- return s;
-}
diff --git a/Tools/modulator/Templates/object_tp_setattr b/Tools/modulator/Templates/object_tp_setattr
deleted file mode 100644
index dfe4bc8c77..0000000000
--- a/Tools/modulator/Templates/object_tp_setattr
+++ /dev/null
@@ -1,9 +0,0 @@
-
-static int
-$abbrev$_setattr($abbrev$object *self, char *name, PyObject *v)
-{
- /* Set attribute 'name' to value 'v'. v==NULL means delete */
-
- /* XXXX Add your own setattr code here */
- return -1;
-}
diff --git a/Tools/modulator/Templates/object_tp_str b/Tools/modulator/Templates/object_tp_str
deleted file mode 100644
index 2e3648e838..0000000000
--- a/Tools/modulator/Templates/object_tp_str
+++ /dev/null
@@ -1,10 +0,0 @@
-
-static PyObject *
-$abbrev$_str($abbrev$object *self)
-{
- PyObject *s;
-
- /* XXXX Add code here to put self into s */
- return s;
-}
-
diff --git a/Tools/modulator/Tkextra.py b/Tools/modulator/Tkextra.py
deleted file mode 100755
index b1051aacff..0000000000
--- a/Tools/modulator/Tkextra.py
+++ /dev/null
@@ -1,234 +0,0 @@
-#! /usr/bin/env python
-
-# A Python function that generates dialog boxes with a text message,
-# optional bitmap, and any number of buttons.
-# Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.2-3, pp. 269-270.
-
-from Tkinter import *
-
-mainWidget = None
-
-def dialog(master, title, text, bitmap, default, *args):
-
- # 1. Create the top-level window and divide it into top
- # and bottom parts.
-
- w = Toplevel(master, {'class': 'Dialog'})
- w.title(title)
- w.iconname('Dialog')
-
- top = Frame(w, {'relief': 'raised', 'bd': 1,
- Pack: {'side': 'top', 'fill': 'both'}})
- bot = Frame(w, {'relief': 'raised', 'bd': 1,
- Pack: {'side': 'bottom', 'fill': 'both'}})
-
- # 2. Fill the top part with the bitmap and message.
-
- msg = Message(top,
- {'width': '3i',
- 'text': text,
- 'font': '-Adobe-Times-Medium-R-Normal-*-180-*',
- Pack: {'side': 'right', 'expand': 1,
- 'fill': 'both',
- 'padx': '3m', 'pady': '3m'}})
- if bitmap:
- bm = Label(top, {'bitmap': bitmap,
- Pack: {'side': 'left',
- 'padx': '3m', 'pady': '3m'}})
-
- # 3. Create a row of buttons at the bottom of the dialog.
-
- buttons = []
- i = 0
- for but in args:
- b = Button(bot, {'text': but,
- 'command': ('set', 'button', i)})
- buttons.append(b)
- if i == default:
- bd = Frame(bot, {'relief': 'sunken', 'bd': 1,
- Pack: {'side': 'left', 'expand': 1,
- 'padx': '3m', 'pady': '2m'}})
- b.lift()
- b.pack ({'in': bd, 'side': 'left',
- 'padx': '2m', 'pady': '2m',
- 'ipadx': '2m', 'ipady': '1m'})
- else:
- b.pack ({'side': 'left', 'expand': 1,
- 'padx': '3m', 'pady': '3m',
- 'ipady': '2m', 'ipady': '1m'})
- i = i+1
-
- # 4. Set up a binding for <Return>, if there's a default,
- # set a grab, and claim the focus too.
-
- if default >= 0:
- w.bind('<Return>',
- lambda e, b=buttons[default], i=default:
- (b.flash(),
- b.setvar('button', i)))
-
- oldFocus = w.tk.call('focus') # XXX
- w.grab_set()
- w.focus()
-
- # 5. Wait for the user to respond, then restore the focus
- # and return the index of the selected button.
-
- w.waitvar('button')
- w.destroy()
- w.tk.call('focus', oldFocus) # XXX
- return w.getint(w.getvar('button'))
-
-def strdialog(master, title, text, bitmap, default, *args):
-
- # 1. Create the top-level window and divide it into top
- # and bottom parts.
-
- w = Toplevel(master, {'class': 'Dialog'})
- w.title(title)
- w.iconname('Dialog')
-
- top = Frame(w, {'relief': 'raised', 'bd': 1,
- Pack: {'side': 'top', 'fill': 'both'}})
- if args:
- bot = Frame(w, {'relief': 'raised', 'bd': 1,
- Pack: {'side': 'bottom', 'fill': 'both'}})
-
- # 2. Fill the top part with the bitmap, message and input field.
-
- if bitmap:
- bm = Label(top, {'bitmap': bitmap,
- Pack: {'side': 'left',
- 'padx': '3m', 'pady': '3m'}})
-
- msg = Message(top,
- {'width': '3i',
- 'text': text,
- 'font': '-Adobe-Times-Medium-R-Normal-*-180-*',
- Pack: {'side': 'left',
- 'fill': 'both',
- 'padx': '3m', 'pady': '3m'}})
-
- field = Entry(top,
- {'relief':'sunken',
- Pack:{'side':'left',
- 'fill':'x',
- 'expand':1,
- 'padx':'3m', 'pady':'3m'}})
- # 3. Create a row of buttons at the bottom of the dialog.
-
- buttons = []
- i = 0
- for but in args:
- b = Button(bot, {'text': but,
- 'command': ('set', 'button', i)})
- buttons.append(b)
- if i == default:
- bd = Frame(bot, {'relief': 'sunken', 'bd': 1,
- Pack: {'side': 'left', 'expand': 1,
- 'padx': '3m', 'pady': '2m'}})
- b.lift()
- b.pack ({'in': bd, 'side': 'left',
- 'padx': '2m', 'pady': '2m',
- 'ipadx': '2m', 'ipady': '1m'})
- else:
- b.pack ({'side': 'left', 'expand': 1,
- 'padx': '3m', 'pady': '3m',
- 'ipady': '2m', 'ipady': '1m'})
- i = i+1
-
- # 4. Set up a binding for <Return>, if there's a default,
- # set a grab, and claim the focus too.
-
- if not args:
- w.bind('<Return>', lambda arg, top=top: top.setvar('button', 0))
- field.bind('<Return>', lambda arg, top=top: top.setvar('button', 0))
- elif default >= 0:
- w.bind('<Return>',
- lambda e, b=buttons[default], i=default:
- (b.flash(),
- b.setvar('button', i)))
- field.bind('<Return>',
- lambda e, b=buttons[default], i=default:
- (b.flash(),
- b.setvar('button', i)))
-
- oldFocus = w.tk.call('focus') # XXX
- w.grab_set()
- field.focus()
-
- # 5. Wait for the user to respond, then restore the focus
- # and return the index of the selected button.
-
- w.waitvar('button')
- v = field.get()
- w.destroy()
- w.tk.call('focus', oldFocus) # XXX
- if args:
- return v, w.getint(w.getvar('button'))
- else:
- return v
-
-def message(str):
- i = dialog(mainWidget, 'Message', str, '', 0, 'OK')
-
-def askyn(str):
- i = dialog(mainWidget, 'Question', str, '', 0, 'No', 'Yes')
- return i
-
-def askync(str):
- i = dialog(mainWidget, 'Question', str, '', 0, 'Cancel', 'No', 'Yes')
- return i-1
-
-def askstr(str):
- i = strdialog(mainWidget, 'Question', str, '', 0)
- return i
-
-def askfile(str): # XXXX For now...
- i = strdialog(mainWidget, 'Question', str, '', 0)
- return i
-
-# The rest is the test program.
-
-def _go():
- i = dialog(mainWidget,
- 'Not Responding',
- "The file server isn't responding right now; "
- "I'll keep trying.",
- '',
- -1,
- 'OK')
- print('pressed button', i)
- i = dialog(mainWidget,
- 'File Modified',
- 'File "tcl.h" has been modified since '
- 'the last time it was saved. '
- 'Do you want to save it before exiting the application?',
- 'warning',
- 0,
- 'Save File',
- 'Discard Changes',
- 'Return To Editor')
- print('pressed button', i)
- print(message('Test of message'))
- print(askyn('Test of yes/no'))
- print(askync('Test of yes/no/cancel'))
- print(askstr('Type a string:'))
- print(strdialog(mainWidget, 'Question', 'Another string:', '',
- 0, 'Save', 'Save as text'))
-
-def _test():
- global mainWidget
- mainWidget = Frame()
- Pack.config(mainWidget)
- start = Button(mainWidget,
- {'text': 'Press Here To Start', 'command': _go})
- start.pack()
- endit = Button(mainWidget,
- {'text': 'Exit',
- 'command': 'exit',
- Pack: {'fill' : 'both'}})
- mainWidget.mainloop()
-
-if __name__ == '__main__':
- _test()
diff --git a/Tools/modulator/genmodule.py b/Tools/modulator/genmodule.py
deleted file mode 100755
index f8703efe69..0000000000
--- a/Tools/modulator/genmodule.py
+++ /dev/null
@@ -1,160 +0,0 @@
-#
-# Genmodule - A python program to help you build (template) modules.
-#
-# Usage:
-#
-# o = genmodule.object()
-# o.name = 'dwarve object'
-# o.abbrev = 'dw'
-# o.funclist = ['new', 'dealloc', 'getattr', 'setattr']
-# o.methodlist = ['dig']
-#
-# m = genmodule.module()
-# m.name = 'beings'
-# m.abbrev = 'be'
-# m.methodlist = ['newdwarve']
-# m.objects = [o]
-#
-# genmodule.write(sys.stdout, m)
-#
-import sys
-import os
-import varsubst
-
-error = 'genmodule.error'
-
-#
-# Names of functions in the object-description struct.
-#
-FUNCLIST = ['new', 'tp_dealloc', 'tp_print', 'tp_getattr', 'tp_setattr',
- 'tp_compare', 'tp_repr', 'tp_hash', 'tp_call', 'tp_str']
-TYPELIST = ['tp_as_number', 'tp_as_sequence', 'tp_as_mapping', 'structure']
-
-#
-# writer is a base class for the object and module classes
-# it contains code common to both.
-#
-class writer:
- def __init__(self):
- self._subst = None
-
- def makesubst(self):
- if not self._subst:
- if 'abbrev' not in self.__dict__:
- self.abbrev = self.name
- self.Abbrev = self.abbrev[0].upper()+self.abbrev[1:]
- subst = varsubst.Varsubst(self.__dict__)
- subst.useindent(1)
- self._subst = subst.subst
-
- def addcode(self, name, fp):
- ifp = self.opentemplate(name)
- self.makesubst()
- d = ifp.read()
- d = self._subst(d)
- fp.write(d)
-
- def opentemplate(self, name):
- for p in sys.path:
- fn = os.path.join(p, name)
- if os.path.exists(fn):
- return open(fn, 'r')
- fn = os.path.join(p, 'Templates')
- fn = os.path.join(fn, name)
- if os.path.exists(fn):
- return open(fn, 'r')
- raise error('Template '+name+' not found for '+self._type+' '+ \
- self.name)
-
-class module(writer):
- _type = 'module'
-
- def writecode(self, fp):
- self.addcode('copyright', fp)
- self.addcode('module_head', fp)
- for o in self.objects:
- o.writehead(fp)
- for o in self.objects:
- o.writebody(fp)
- new_ml = ''
- for fn in self.methodlist:
- self.method = fn
- self.addcode('module_method', fp)
- new_ml = new_ml + (
- '{"%s",\t(PyCFunction)%s_%s,\tMETH_VARARGS,\t%s_%s__doc__},\n'
- %(fn, self.abbrev, fn, self.abbrev, fn))
- self.methodlist = new_ml
- self.addcode('module_tail', fp)
-
-class object(writer):
- _type = 'object'
- def __init__(self):
- self.typelist = []
- self.methodlist = []
- self.funclist = ['new']
- writer.__init__(self)
-
- def writecode(self, fp):
- self.addcode('copyright', fp)
- self.writehead(fp)
- self.writebody(fp)
-
- def writehead(self, fp):
- self.addcode('object_head', fp)
-
- def writebody(self, fp):
- new_ml = ''
- for fn in self.methodlist:
- self.method = fn
- self.addcode('object_method', fp)
- new_ml = new_ml + (
- '{"%s",\t(PyCFunction)%s_%s,\tMETH_VARARGS,\t%s_%s__doc__},\n'
- %(fn, self.abbrev, fn, self.abbrev, fn))
- self.methodlist = new_ml
- self.addcode('object_mlist', fp)
-
- # Add getattr if we have methods
- if self.methodlist and not 'tp_getattr' in self.funclist:
- self.funclist.insert(0, 'tp_getattr')
-
- for fn in FUNCLIST:
- setattr(self, fn, '0')
-
- #
- # Special case for structure-access objects: put getattr in the
- # list of functions but don't generate code for it directly,
- # the code is obtained from the object_structure template.
- # The same goes for setattr.
- #
- if 'structure' in self.typelist:
- if 'tp_getattr' in self.funclist:
- self.funclist.remove('tp_getattr')
- if 'tp_setattr' in self.funclist:
- self.funclist.remove('tp_setattr')
- self.tp_getattr = self.abbrev + '_getattr'
- self.tp_setattr = self.abbrev + '_setattr'
- for fn in self.funclist:
- self.addcode('object_'+fn, fp)
- setattr(self, fn, '%s_%s'%(self.abbrev, fn[3:]))
- for tn in TYPELIST:
- setattr(self, tn, '0')
- for tn in self.typelist:
- self.addcode('object_'+tn, fp)
- setattr(self, tn, '&%s_%s'%(self.abbrev, tn[3:]))
- self.addcode('object_tail', fp)
-
-def write(fp, obj):
- obj.writecode(fp)
-
-if __name__ == '__main__':
- o = object()
- o.name = 'dwarve object'
- o.abbrev = 'dw'
- o.funclist = ['new', 'tp_dealloc']
- o.methodlist = ['dig']
- m = module()
- m.name = 'beings'
- m.abbrev = 'be'
- m.methodlist = ['newdwarve']
- m.objects = [o]
- write(sys.stdout, m)
diff --git a/Tools/modulator/modulator.py b/Tools/modulator/modulator.py
deleted file mode 100755
index d7196493d9..0000000000
--- a/Tools/modulator/modulator.py
+++ /dev/null
@@ -1,383 +0,0 @@
-#! /usr/bin/env python
-#
-# Modulator - Generate skeleton modules.
-#
-# The user fills out some forms with information about what the module
-# should support (methods, objects), names of these things, prefixes to
-# use for C code, whether the objects should also support access as numbers,
-# etc etc etc.
-# When the user presses 'Generate code' we generate a complete skeleton
-# module in C.
-#
-# Alternatively, the selections made can be save to a python sourcefile and
-# this sourcefile can be passed on the command line (resulting in the same
-# skeleton C code).
-#
-# Jack Jansen, CWI, October 1994.
-#
-
-import sys, os
-if os.name != 'mac':
- sys.path.append(os.path.join(os.environ['HOME'],
- 'src/python/Tools/modulator'))
-
-from Tkinter import *
-from Tkextra import *
-from ScrolledListbox import ScrolledListbox
-import sys
-import genmodule
-import string
-
-oops = 'oops'
-
-IDENTSTARTCHARS = string.ascii_letters + '_'
-IDENTCHARS = string.ascii_letters + string.digits + '_'
-
-# Check that string is a legal C identifier
-def checkid(str):
- if not str: return 0
- if not str[0] in IDENTSTARTCHARS:
- return 0
- for c in str[1:]:
- if not c in IDENTCHARS:
- return 0
- return 1
-
-def getlistlist(list):
- rv = []
- n = list.size()
- for i in range(n):
- rv.append(list.get(i))
- return rv
-
-class UI:
- def __init__(self):
- self.main = Frame()
- self.main.pack()
- self.main.master.title('Modulator: Module view')
- self.cmdframe = Frame(self.main, {'relief':'raised', 'bd':'0.5m',
- Pack:{'side':'top',
- 'fill':'x'}})
- self.objframe = Frame(self.main, {Pack:{'side':'top', 'fill':'x',
- 'expand':1}})
-
-
- self.check_button = Button(self.cmdframe,
- {'text':'Check', 'command':self.cb_check,
- Pack:{'side':'left', 'padx':'0.5m'}})
- self.save_button = Button(self.cmdframe,
- {'text':'Save...', 'command':self.cb_save,
- Pack:{'side':'left', 'padx':'0.5m'}})
- self.code_button = Button(self.cmdframe,
- {'text':'Generate code...',
- 'command':self.cb_gencode,
- Pack:{'side':'left', 'padx':'0.5m'}})
- self.quit_button = Button(self.cmdframe,
- {'text':'Quit',
- 'command':self.cb_quit,
- Pack:{'side':'right', 'padx':'0.5m'}})
-
- self.module = UI_module(self)
- self.objects = []
- self.modified = 0
-
- def run(self):
- self.main.mainloop()
-
- def cb_quit(self, *args):
- if self.modified:
- if not askyn('You have not saved\nAre you sure you want to quit?'):
- return
- sys.exit(0)
-
- def cb_check(self, *args):
- try:
- self.module.synchronize()
- for o in self.objects:
- o.synchronize()
- except oops:
- pass
-
- def cb_save(self, *args):
- try:
- pycode = self.module.gencode('m', self.objects)
- except oops:
- return
-
- fn = askfile('Python file name: ')
- if not fn:
- return
-
- fp = open(fn, 'w')
-
- fp.write(pycode)
- fp.close()
-
- def cb_gencode(self, *args):
- try:
- pycode = self.module.gencode('m', self.objects)
- except oops:
- pass
-
- fn = askfile('C file name: ')
- if not fn:
- return
-
- fp = open(fn, 'w')
-
- try:
- exec(pycode)
- except:
- message('An error occurred:-)')
- return
- genmodule.write(fp, m)
- fp.close()
-
-class UI_module:
- def __init__(self, parent):
- self.parent = parent
- self.frame = Frame(parent.objframe, {'relief':'raised', 'bd':'0.2m',
- Pack:{'side':'top',
- 'fill':'x'}})
- self.f1 = Frame(self.frame, {Pack:{'side':'top', 'pady':'0.5m',
- 'fill':'x'}})
- self.f2 = Frame(self.frame, {Pack:{'side':'top', 'pady':'0.5m',
- 'fill':'x'}})
- self.f3 = Frame(self.frame, {Pack:{'side':'top', 'pady':'0.5m',
- 'fill':'x'}})
- self.f4 = Frame(self.frame, {Pack:{'side':'top', 'pady':'0.5m',
- 'fill':'x'}})
-
- self.l1 = Label(self.f1, {'text':'Module:', Pack:{'side':'left',
- 'padx':'0.5m'}})
- self.name_entry = Entry(self.f1, {'relief':'sunken',
- Pack:{'side':'left', 'padx':'0.5m', 'expand':1}})
- self.l2 = Label(self.f1, {'text':'Abbrev:', Pack:{'side':'left',
- 'padx':'0.5m'}})
- self.abbrev_entry = Entry(self.f1, {'relief':'sunken', 'width':5,
- Pack:{'side':'left', 'padx':'0.5m'}})
-
- self.l3 = Label(self.f2, {'text':'Methods:', Pack:{'side':'left',
- 'padx':'0.5m'}})
- self.method_list = ScrolledListbox(self.f2, {'relief':'sunken','bd':2,
- Pack:{'side':'left', 'expand':1,
- 'padx':'0.5m', 'fill':'both'}})
-
- self.l4 = Label(self.f3, {'text':'Add method:', Pack:{'side':'left',
- 'padx':'0.5m'}})
- self.method_entry = Entry(self.f3, {'relief':'sunken',
- Pack:{'side':'left', 'padx':'0.5m', 'expand':1}})
- self.method_entry.bind('<Return>', self.cb_method)
- self.delete_button = Button(self.f3, {'text':'Delete method',
- 'command':self.cb_delmethod,
- Pack:{'side':'left',
- 'padx':'0.5m'}})
-
- self.newobj_button = Button(self.f4, {'text':'new object',
- 'command':self.cb_newobj,
- Pack:{'side':'left',
- 'padx':'0.5m'}})
-
- def cb_delmethod(self, *args):
- list = self.method_list.curselection()
- for i in list:
- self.method_list.delete(i)
-
- def cb_newobj(self, *arg):
- self.parent.objects.append(UI_object(self.parent))
-
- def cb_method(self, *arg):
- name = self.method_entry.get()
- if not name:
- return
- self.method_entry.delete('0', 'end')
- self.method_list.insert('end', name)
-
- def synchronize(self):
- n = self.name_entry.get()
- if not n:
- message('Module name not set')
- raise oops
- if not checkid(n):
- message('Module name not an identifier:\n'+n)
- raise oops
- if not self.abbrev_entry.get():
- self.abbrev_entry.insert('end', n)
- m = getlistlist(self.method_list)
- for n in m:
- if not checkid(n):
- message('Method name not an identifier:\n'+n)
- raise oops
-
- def gencode(self, name, objects):
- rv = ''
- self.synchronize()
- for o in objects:
- o.synchronize()
- onames = []
- for i in range(len(objects)):
- oname = 'o%d' % (i+1)
- rv = rv + objects[i].gencode(oname)
- onames.append(oname)
- rv = rv + '%s = genmodule.module()\n' % (name,)
- rv = rv + '%s.name = %r\n' % (name, self.name_entry.get())
- rv = rv + '%s.abbrev = %r\n' % (name, self.abbrev_entry.get())
- rv = rv + '%s.methodlist = %r\n' % (name, getlistlist(self.method_list))
- rv = rv + '%s.objects = [%s]\n' % (name, ','.join(onames))
- rv = rv + '\n'
- return rv
-
-object_number = 0
-
-class UI_object:
- def __init__(self, parent):
- global object_number
-
- object_number = object_number + 1
- self.num = object_number
- self.vpref = 'o%r_' % self.num
- self.frame = Toplevel(parent.objframe)
-# self.frame.pack()
- self.frame.title('Modulator: object view')
-# self.frame = Frame(parent.objframe, {'relief':'raised', 'bd':'0.2m',
-# Pack:{'side':'top',
-# 'fill':'x'}})
- self.f1 = Frame(self.frame, {Pack:{'side':'top', 'pady':'0.5m',
- 'fill':'x'}})
- self.f2 = Frame(self.frame, {Pack:{'side':'top', 'pady':'0.5m',
- 'fill':'x'}})
- self.f3 = Frame(self.frame, {Pack:{'side':'top', 'pady':'0.5m',
- 'fill':'x'}})
- self.f4 = Frame(self.frame, {Pack:{'side':'top', 'pady':'0.5m',
- 'fill':'x'}})
-
-
- self.l1 = Label(self.f1, {'text':'Object:', Pack:{'side':'left',
- 'padx':'0.5m'}})
- self.name_entry = Entry(self.f1, {'relief':'sunken',
- Pack:{'side':'left', 'padx':'0.5m', 'expand':1}})
- self.l2 = Label(self.f1, {'text':'Abbrev:', Pack:{'side':'left',
- 'padx':'0.5m'}})
- self.abbrev_entry = Entry(self.f1, {'relief':'sunken', 'width':5,
- Pack:{'side':'left', 'padx':'0.5m'}})
-
- self.l3 = Label(self.f2, {'text':'Methods:', Pack:{'side':'left',
- 'padx':'0.5m'}})
- self.method_list = ScrolledListbox(self.f2, {'relief':'sunken','bd':2,
- Pack:{'side':'left', 'expand':1,
- 'padx':'0.5m', 'fill':'both'}})
-
- self.l4 = Label(self.f3, {'text':'Add method:', Pack:{'side':'left',
- 'padx':'0.5m'}})
- self.method_entry = Entry(self.f3, {'relief':'sunken',
- Pack:{'side':'left', 'padx':'0.5m', 'expand':1}})
- self.method_entry.bind('<Return>', self.cb_method)
- self.delete_button = Button(self.f3, {'text':'Delete method',
- 'command':self.cb_delmethod,
- Pack:{'side':'left',
- 'padx':'0.5m'}})
-
-
- self.l5 = Label(self.f4, {'text':'functions:',
- Pack:{'side':'left',
- 'padx':'0.5m'}})
- self.f5 = Frame(self.f4, {Pack:{'side':'left', 'pady':'0.5m',
- 'fill':'both'}})
- self.l6 = Label(self.f4, {'text':'Types:',
- Pack:{'side':'left', 'padx':'0.5m'}})
- self.f6 = Frame(self.f4, {Pack:{'side':'left', 'pady':'0.5m',
- 'fill':'x'}})
- self.funcs = {}
- for i in genmodule.FUNCLIST:
- vname = self.vpref+i
- self.f5.setvar(vname, 0)
- b = Checkbutton(self.f5, {'variable':vname, 'text':i,
- Pack:{'side':'top', 'pady':'0.5m',
- 'anchor':'w','expand':1}})
- self.funcs[i] = b
- self.f5.setvar(self.vpref+'new', 1)
-
- self.types = {}
- for i in genmodule.TYPELIST:
- vname = self.vpref + i
- self.f6.setvar(vname, 0)
- b = Checkbutton(self.f6, {'variable':vname, 'text':i,
- Pack:{'side':'top', 'pady':'0.5m',
- 'anchor':'w'}})
- self.types[i] = b
-
- def cb_method(self, *arg):
- name = self.method_entry.get()
- if not name:
- return
- self.method_entry.delete('0', 'end')
- self.method_list.insert('end', name)
-
- def cb_delmethod(self, *args):
- list = self.method_list.curselection()
- for i in list:
- self.method_list.delete(i)
-
- def synchronize(self):
- n = self.name_entry.get()
- if not n:
- message('Object name not set')
- raise oops
- if not self.abbrev_entry.get():
- self.abbrev_entry.insert('end', n)
- n = self.abbrev_entry.get()
- if not checkid(n):
- message('Abbreviation not an identifier:\n'+n)
- raise oops
- m = getlistlist(self.method_list)
- for n in m:
- if not checkid(n):
- message('Method name not an identifier:\n'+n)
- raise oops
- if m:
- self.f5.setvar(self.vpref+'tp_getattr', 1)
- pass
-
- def gencode(self, name):
- rv = ''
- rv = rv + '%s = genmodule.object()\n' % (name,)
- rv = rv + '%s.name = %r\n' % (name, self.name_entry.get())
- rv = rv + '%s.abbrev = %r\n' % (name, self.abbrev_entry.get())
- rv = rv + '%s.methodlist = %r\n' % (name, getlistlist(self.method_list))
- fl = []
- for fn in genmodule.FUNCLIST:
- vname = self.vpref + fn
- if self.f5.getvar(vname) == '1':
- fl.append(fn)
- rv = rv + '%s.funclist = %r\n' % (name, fl)
-
- fl = []
- for fn in genmodule.TYPELIST:
- vname = self.vpref + fn
- if self.f5.getvar(vname) == '1':
- fl.append(fn)
-
- rv = rv + '%s.typelist = %r\n' % (name, fl)
-
- rv = rv + '\n'
- return rv
-
-
-def main():
- if len(sys.argv) < 2:
- ui = UI()
- ui.run()
- elif len(sys.argv) == 2:
- fp = open(sys.argv[1])
- pycode = fp.read()
- try:
- exec(pycode)
- except:
- sys.stderr.write('An error occurred:-)\n')
- sys.exit(1)
- ##genmodule.write(sys.stdout, m)
- else:
- sys.stderr.write('Usage: modulator [file]\n')
- sys.exit(1)
-
-main()
diff --git a/Tools/modulator/varsubst.py b/Tools/modulator/varsubst.py
deleted file mode 100644
index 4b6851230e..0000000000
--- a/Tools/modulator/varsubst.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# Variable substitution. Variables are $delimited$
-#
-import re
-
-error = 'varsubst.error'
-
-class Varsubst:
- def __init__(self, dict):
- self.dict = dict
- self.prog = re.compile('\$([a-zA-Z0-9_]*)\$')
- self.do_useindent = 0
-
- def useindent(self, onoff):
- self.do_useindent = onoff
-
- def subst(self, s):
- rv = ''
- while 1:
- m = self.prog.search(s)
- if not m:
- return rv + s
- rv = rv + s[:m.start()]
- s = s[m.end():]
- if m.end() - m.start() == 2:
- # Escaped dollar
- rv = rv + '$'
- s = s[2:]
- continue
- name = m.group(1)
- if name not in self.dict:
- raise error('No such variable: '+name)
- value = self.dict[name]
- if self.do_useindent and '\n' in value:
- value = self._modindent(value, rv)
- rv = rv + value
-
- def _modindent(self, value, old):
- lastnl = old.rfind('\n', 0) + 1
- lastnl = len(old) - lastnl
- sub = '\n' + (' '*lastnl)
- return re.sub('\n', sub, value)
-
-def _test():
- import sys
- import os
-
- sys.stderr.write('-- Copying stdin to stdout with environment map --\n')
- c = Varsubst(os.environ)
- c.useindent(1)
- d = sys.stdin.read()
- sys.stdout.write(c.subst(d))
- sys.exit(1)
-
-if __name__ == '__main__':
- _test()
diff --git a/Tools/msi/merge.py b/Tools/msi/merge.py
deleted file mode 100644
index 85de209a09..0000000000
--- a/Tools/msi/merge.py
+++ /dev/null
@@ -1,84 +0,0 @@
-import msilib,os,win32com,tempfile,sys
-PCBUILD="PCBuild"
-certname = None
-from config import *
-
-Win64 = "amd64" in PCBUILD
-
-mod_dir = os.path.join(os.environ["ProgramFiles"], "Common Files", "Merge Modules")
-msi = None
-if len(sys.argv)==2:
- msi = sys.argv[1]
-if Win64:
- modules = ["Microsoft_VC90_CRT_x86_x64.msm", "policy_9_0_Microsoft_VC90_CRT_x86_x64.msm"]
- if not msi: msi = "python-%s.amd64.msi" % full_current_version
-else:
- modules = ["Microsoft_VC90_CRT_x86.msm","policy_9_0_Microsoft_VC90_CRT_x86.msm"]
- if not msi: msi = "python-%s.msi" % full_current_version
-for i, n in enumerate(modules):
- modules[i] = os.path.join(mod_dir, n)
-
-def merge(msi, feature, rootdir, modules):
- cab_and_filecount = []
- # Step 1: Merge databases, extract cabfiles
- m = msilib.MakeMerge2()
- m.OpenLog("merge.log")
- print "Opened Log"
- m.OpenDatabase(msi)
- print "Opened DB"
- for module in modules:
- print module
- m.OpenModule(module,0)
- print "Opened Module",module
- m.Merge(feature, rootdir)
- print "Errors:"
- for e in m.Errors:
- print e.Type, e.ModuleTable, e.DatabaseTable
- print " Modkeys:",
- for s in e.ModuleKeys: print s,
- print
- print " DBKeys:",
- for s in e.DatabaseKeys: print s,
- print
- cabname = tempfile.mktemp(suffix=".cab")
- m.ExtractCAB(cabname)
- cab_and_filecount.append((cabname, len(m.ModuleFiles)))
- m.CloseModule()
- m.CloseDatabase(True)
- m.CloseLog()
-
- # Step 2: Add CAB files
- i = msilib.MakeInstaller()
- db = i.OpenDatabase(msi, win32com.client.constants.msiOpenDatabaseModeTransact)
-
- v = db.OpenView("SELECT LastSequence FROM Media")
- v.Execute(None)
- maxmedia = -1
- while 1:
- r = v.Fetch()
- if not r: break
- seq = r.IntegerData(1)
- if seq > maxmedia:
- maxmedia = seq
- print "Start of Media", maxmedia
-
- for cabname, count in cab_and_filecount:
- stream = "merged%d" % maxmedia
- msilib.add_data(db, "Media",
- [(maxmedia+1, maxmedia+count, None, "#"+stream, None, None)])
- msilib.add_stream(db, stream, cabname)
- os.unlink(cabname)
- maxmedia += count
- # The merge module sets ALLUSERS to 1 in the property table.
- # This is undesired; delete that
- v = db.OpenView("DELETE FROM Property WHERE Property='ALLUSERS'")
- v.Execute(None)
- v.Close()
- db.Commit()
-
-merge(msi, "SharedCRT", "TARGETDIR", modules)
-
-# certname (from config.py) should be (a substring of)
-# the certificate subject, e.g. "Python Software Foundation"
-if certname:
- os.system('signtool sign /n "%s" /t http://timestamp.verisign.com/scripts/timestamp.dll %s' % (certname, msi))
diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py
index b668c7aaec..53e652d57f 100644
--- a/Tools/msi/msi.py
+++ b/Tools/msi/msi.py
@@ -7,6 +7,7 @@ import uisample
from win32com.client import constants
from distutils.spawn import find_executable
from uuids import product_codes
+import tempfile
# Settings can be overridden in config.py below
# 0 for official python.org releases
@@ -28,6 +29,8 @@ have_tcl = True
PCBUILD="PCbuild"
# msvcrt version
MSVCR = "90"
+# Name of certificate in default store to sign MSI with
+certname = None
# Make a zip file containing the PDB files for this build?
pdbzip = True
@@ -115,6 +118,7 @@ pythondll_uuid = {
"27":"{4fe21c76-1760-437b-a2f2-99909130a175}",
"30":"{6953bc3b-6768-4291-8410-7914ce6e2ca8}",
"31":"{4afcba0b-13e4-47c3-bebe-477428b46913}",
+ "32":"{3ff95315-1096-4d31-bd86-601d5438ad5e}",
} [major+minor]
# Compute the name that Sphinx gives to the docfile
@@ -221,7 +225,8 @@ def build_database():
# schema represents the installer 2.0 database schema.
# sequence is the set of standard sequences
# (ui/execute, admin/advt/install)
- db = msilib.init_database("python-%s%s.msi" % (full_current_version, msilib.arch_ext),
+ msiname = "python-%s%s.msi" % (full_current_version, msilib.arch_ext)
+ db = msilib.init_database(msiname,
schema, ProductName="Python "+full_current_version+productsuffix,
ProductCode=product_code,
ProductVersion=current_version,
@@ -244,7 +249,7 @@ def build_database():
("ProductLine", "Python%s%s" % (major, minor)),
])
db.Commit()
- return db
+ return db, msiname
def remove_old_versions(db):
"Fill the upgrade table."
@@ -876,7 +881,6 @@ def generate_license():
shutil.copyfileobj(open(os.path.join(srcdir, "LICENSE")), out)
shutil.copyfileobj(open("crtlicense.txt"), out)
for name, pat, file in (("bzip2","bzip2-*", "LICENSE"),
- ("Berkeley DB", "db-*", "LICENSE"),
("openssl", "openssl-*", "LICENSE"),
("Tcl", "tcl8*", "license.terms"),
("Tk", "tk8*", "license.terms"),
@@ -900,6 +904,13 @@ class PyDirectory(Directory):
kw['componentflags'] = 2 #msidbComponentAttributesOptional
Directory.__init__(self, *args, **kw)
+ def check_unpackaged(self):
+ self.unpackaged_files.discard('__pycache__')
+ self.unpackaged_files.discard('.svn')
+ if self.unpackaged_files:
+ print "Warning: Unpackaged files in %s" % self.absolute
+ print self.unpackaged_files
+
# See "File Table", "Component Table", "Directory Table",
# "FeatureComponents Table"
def add_files(db):
@@ -963,13 +974,13 @@ def add_files(db):
extensions.remove("_ctypes.pyd")
# Add all .py files in Lib, except tkinter, test
- dirs={}
+ dirs = []
pydirs = [(root,"Lib")]
while pydirs:
# Commit every now and then, or else installer will complain
db.Commit()
parent, dir = pydirs.pop()
- if dir == ".svn" or dir.startswith("plat-"):
+ if dir == ".svn" or dir == '__pycache__' or dir.startswith("plat-"):
continue
elif dir in ["tkinter", "idlelib", "Icons"]:
if not have_tcl:
@@ -987,7 +998,7 @@ def add_files(db):
default_feature.set_current()
lib = PyDirectory(db, cab, parent, dir, dir, "%s|%s" % (parent.make_short(dir), dir))
# Add additional files
- dirs[dir]=lib
+ dirs.append(lib)
lib.glob("*.txt")
if dir=='site-packages':
lib.add_file("README.txt", src="README")
@@ -997,19 +1008,14 @@ def add_files(db):
if files:
# Add an entry to the RemoveFile table to remove bytecode files.
lib.remove_pyc()
- if dir.endswith('.egg-info'):
- lib.add_file('entry_points.txt')
- lib.add_file('PKG-INFO')
- lib.add_file('top_level.txt')
- lib.add_file('zip-safe')
- continue
+ # package READMEs if present
+ lib.glob("README")
+ if dir=='Lib':
+ lib.add_file('wsgiref.egg-info')
if dir=='test' and parent.physical=='Lib':
lib.add_file("185test.db")
lib.add_file("audiotest.au")
- lib.add_file("cfgparser.1")
lib.add_file("sgml_input.html")
- lib.add_file("test.xml")
- lib.add_file("test.xml.out")
lib.add_file("testtar.tar")
lib.add_file("test_difflib_expect.html")
lib.add_file("check_soundcard.vbs")
@@ -1018,26 +1024,41 @@ def add_files(db):
lib.glob("*.uue")
lib.glob("*.pem")
lib.glob("*.pck")
+ lib.glob("cfgparser.*")
+ lib.add_file("zip_cp437_header.zip")
lib.add_file("zipdir.zip")
+ if dir=='capath':
+ lib.glob("*.0")
if dir=='tests' and parent.physical=='distutils':
lib.add_file("Setup.sample")
if dir=='decimaltestdata':
lib.glob("*.decTest")
+ if dir=='xmltestdata':
+ lib.glob("*.xml")
+ lib.add_file("test.xml.out")
if dir=='output':
lib.glob("test_*")
+ if dir=='sndhdrdata':
+ lib.glob("sndhdr.*")
if dir=='idlelib':
lib.glob("*.def")
lib.add_file("idle.bat")
+ lib.add_file("ChangeLog")
if dir=="Icons":
lib.glob("*.gif")
lib.add_file("idle.icns")
if dir=="command" and parent.physical=="distutils":
lib.glob("wininst*.exe")
- if dir=="setuptools":
- lib.add_file("cli.exe")
- lib.add_file("gui.exe")
+ lib.add_file("command_template")
if dir=="lib2to3":
lib.removefile("pickle", "*.pickle")
+ if dir=="macholib":
+ lib.add_file("README.ctypes")
+ lib.glob("fetch_macholib*")
+ if dir=='turtledemo':
+ lib.add_file("turtle.cfg")
+ if dir=="pydoc_data":
+ lib.add_file("_pydoc.css")
if dir=="data" and parent.physical=="test" and parent.basedir.physical=="email":
# This should contain all non-.svn files listed in subversion
for f in os.listdir(lib.absolute):
@@ -1049,6 +1070,8 @@ def add_files(db):
for f in os.listdir(lib.absolute):
if os.path.isdir(os.path.join(lib.absolute, f)):
pydirs.append((lib, f))
+ for d in dirs:
+ d.check_unpackaged()
# Add DLLs
default_feature.set_current()
lib = DLLs
@@ -1064,6 +1087,7 @@ def add_files(db):
continue
dlls.append(f)
lib.add_file(f)
+ lib.add_file('python3.dll')
# Add sqlite
if msilib.msi_type=="Intel64;1033":
sqlite_arch = "/ia64"
@@ -1100,6 +1124,7 @@ def add_files(db):
for f in dlls:
lib.add_file(f.replace('pyd','lib'))
lib.add_file('python%s%s.lib' % (major, minor))
+ lib.add_file('python3.lib')
# Add the mingw-format library
if have_mingw:
lib.add_file('libpython%s%s.a' % (major, minor))
@@ -1120,7 +1145,7 @@ def add_files(db):
# Add tools
tools.set_current()
tooldir = PyDirectory(db, cab, root, "Tools", "Tools", "TOOLS|Tools")
- for f in ['i18n', 'pynche', 'Scripts', 'webchecker']:
+ for f in ['i18n', 'pynche', 'Scripts']:
lib = PyDirectory(db, cab, tooldir, f, f, "%s|%s" % (tooldir.make_short(f), f))
lib.glob("*.py")
lib.glob("*.pyw", exclude=['pydocgui.pyw'])
@@ -1307,7 +1332,7 @@ def build_pdbzip():
pdbzip.write(os.path.join(srcdir, PCBUILD, f), f)
pdbzip.close()
-db = build_database()
+db,msiname = build_database()
try:
add_features(db)
add_ui(db)
@@ -1318,5 +1343,77 @@ try:
finally:
del db
+# Merge CRT into MSI file. This requires the database to be closed.
+mod_dir = os.path.join(os.environ["ProgramFiles"], "Common Files", "Merge Modules")
+if msilib.Win64:
+ modules = ["Microsoft_VC90_CRT_x86_x64.msm", "policy_9_0_Microsoft_VC90_CRT_x86_x64.msm"]
+else:
+ modules = ["Microsoft_VC90_CRT_x86.msm","policy_9_0_Microsoft_VC90_CRT_x86.msm"]
+
+for i, n in enumerate(modules):
+ modules[i] = os.path.join(mod_dir, n)
+
+def merge(msi, feature, rootdir, modules):
+ cab_and_filecount = []
+ # Step 1: Merge databases, extract cabfiles
+ m = msilib.MakeMerge2()
+ m.OpenLog("merge.log")
+ m.OpenDatabase(msi)
+ for module in modules:
+ print module
+ m.OpenModule(module,0)
+ m.Merge(feature, rootdir)
+ print "Errors:"
+ for e in m.Errors:
+ print e.Type, e.ModuleTable, e.DatabaseTable
+ print " Modkeys:",
+ for s in e.ModuleKeys: print s,
+ print
+ print " DBKeys:",
+ for s in e.DatabaseKeys: print s,
+ print
+ cabname = tempfile.mktemp(suffix=".cab")
+ m.ExtractCAB(cabname)
+ cab_and_filecount.append((cabname, len(m.ModuleFiles)))
+ m.CloseModule()
+ m.CloseDatabase(True)
+ m.CloseLog()
+
+ # Step 2: Add CAB files
+ i = msilib.MakeInstaller()
+ db = i.OpenDatabase(msi, constants.msiOpenDatabaseModeTransact)
+
+ v = db.OpenView("SELECT LastSequence FROM Media")
+ v.Execute(None)
+ maxmedia = -1
+ while 1:
+ r = v.Fetch()
+ if not r: break
+ seq = r.IntegerData(1)
+ if seq > maxmedia:
+ maxmedia = seq
+ print "Start of Media", maxmedia
+
+ for cabname, count in cab_and_filecount:
+ stream = "merged%d" % maxmedia
+ msilib.add_data(db, "Media",
+ [(maxmedia+1, maxmedia+count, None, "#"+stream, None, None)])
+ msilib.add_stream(db, stream, cabname)
+ os.unlink(cabname)
+ maxmedia += count
+ # The merge module sets ALLUSERS to 1 in the property table.
+ # This is undesired; delete that
+ v = db.OpenView("DELETE FROM Property WHERE Property='ALLUSERS'")
+ v.Execute(None)
+ v.Close()
+ db.Commit()
+
+merge(msiname, "SharedCRT", "TARGETDIR", modules)
+
+# certname (from config.py) should be (a substring of)
+# the certificate subject, e.g. "Python Software Foundation"
+if certname:
+ os.system('signtool sign /n "%s" /t http://timestamp.verisign.com/scripts/timestamp.dll %s' % (certname, msiname))
+
if pdbzip:
build_pdbzip()
diff --git a/Tools/msi/msilib.py b/Tools/msi/msilib.py
index 6f49b4cf8c..5795d0ec6b 100644
--- a/Tools/msi/msilib.py
+++ b/Tools/msi/msilib.py
@@ -5,7 +5,7 @@ import win32com.client.gencache
import win32com.client
import pythoncom, pywintypes
from win32com.client import constants
-import re, string, os, sets, glob, subprocess, sys, _winreg, struct
+import re, string, os, sets, glob, subprocess, sys, _winreg, struct, _msi
try:
basestring
@@ -350,7 +350,7 @@ def gen_uuid():
class CAB:
def __init__(self, name):
self.name = name
- self.file = open(name+".txt", "wt")
+ self.files = []
self.filenames = sets.Set()
self.index = 0
@@ -369,51 +369,18 @@ class CAB:
if not logical:
logical = self.gen_id(dir, file)
self.index += 1
- if full.find(" ")!=-1:
- print >>self.file, '"%s" %s' % (full, logical)
- else:
- print >>self.file, '%s %s' % (full, logical)
+ self.files.append((full, logical))
return self.index, logical
def commit(self, db):
- self.file.close()
try:
os.unlink(self.name+".cab")
except OSError:
pass
- for k, v in [(r"Software\Microsoft\VisualStudio\7.1\Setup\VS", "VS7CommonBinDir"),
- (r"Software\Microsoft\VisualStudio\8.0\Setup\VS", "VS7CommonBinDir"),
- (r"Software\Microsoft\VisualStudio\9.0\Setup\VS", "VS7CommonBinDir"),
- (r"Software\Microsoft\Win32SDK\Directories", "Install Dir"),
- ]:
- try:
- key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, k)
- dir = _winreg.QueryValueEx(key, v)[0]
- _winreg.CloseKey(key)
- except (WindowsError, IndexError):
- continue
- cabarc = os.path.join(dir, r"Bin", "cabarc.exe")
- if not os.path.exists(cabarc):
- continue
- break
- else:
- print "WARNING: cabarc.exe not found in registry"
- cabarc = "cabarc.exe"
- cmd = r'"%s" -m lzx:21 n %s.cab @%s.txt' % (cabarc, self.name, self.name)
- p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- for line in p.stdout:
- if line.startswith(" -- adding "):
- sys.stdout.write(".")
- else:
- sys.stdout.write(line)
- sys.stdout.flush()
- if not os.path.exists(self.name+".cab"):
- raise IOError, "cabarc failed"
+ _msi.FCICreate(self.name+".cab", self.files)
add_data(db, "Media",
[(1, self.index, None, "#"+self.name, None, None)])
add_stream(db, self.name, self.name+".cab")
- os.unlink(self.name+".txt")
os.unlink(self.name+".cab")
db.Commit()
@@ -451,6 +418,12 @@ class Directory:
else:
self.absolute = physical
blogical = None
+ # initially assume that all files in this directory are unpackaged
+ # as files from self.absolute get added, this set is reduced
+ self.unpackaged_files = set()
+ for f in os.listdir(self.absolute):
+ if os.path.isfile(os.path.join(self.absolute, f)):
+ self.unpackaged_files.add(f)
add_data(db, "Directory", [(logical, blogical, default)])
def start_component(self, component = None, feature = None, flags = None, keyfile = None, uuid=None):
@@ -527,6 +500,11 @@ class Directory:
src = file
file = os.path.basename(file)
absolute = os.path.join(self.absolute, src)
+ if absolute.startswith(self.absolute):
+ # mark file as packaged
+ relative = absolute[len(self.absolute)+1:]
+ if relative in self.unpackaged_files:
+ self.unpackaged_files.remove(relative)
assert not re.search(r'[\?|><:/*]"', file) # restrictions on long names
if self.keyfiles.has_key(file):
logical = self.keyfiles[file]
@@ -572,10 +550,17 @@ class Directory:
return files
def remove_pyc(self):
- "Remove .pyc/.pyo files on uninstall"
+ "Remove .pyc/.pyo files from __pycache__ on uninstall"
+ directory = self.logical + "_pycache"
+ add_data(self.db, "Directory", [(directory, self.logical, "__PYCA~1|__pycache__")])
+ flags = 256 if Win64 else 0
+ add_data(self.db, "Component",
+ [(directory, gen_uuid(), directory, flags, None, None)])
+ add_data(self.db, "FeatureComponents", [(current_feature.id, directory)])
+ add_data(self.db, "CreateFolder", [(directory, directory)])
add_data(self.db, "RemoveFile",
- [(self.component+"c", self.component, "*.pyc", self.logical, 2),
- (self.component+"o", self.component, "*.pyo", self.logical, 2)])
+ [(self.component, self.component, "*.*", directory, 2),
+ ])
def removefile(self, key, pattern):
"Add a RemoveFile entry"
diff --git a/Tools/msi/uuids.py b/Tools/msi/uuids.py
index a5e5cd21f0..09da40accf 100644
--- a/Tools/msi/uuids.py
+++ b/Tools/msi/uuids.py
@@ -7,23 +7,6 @@
# generated. For official releases, we record the product codes,
# so people can refer to them.
product_codes = {
- '2.4.101': '{0e9b4d8e-6cda-446e-a208-7b92f3ddffa0}', # 2.4a1, released as a snapshot
- '2.4.102': '{1b998745-4901-4edb-bc52-213689e1b922}', # 2.4a2
- '2.4.103': '{33fc8bd2-1e8f-4add-a40a-ade2728d5942}', # 2.4a3
- '2.4.111': '{51a7e2a8-2025-4ef0-86ff-e6aab742d1fa}', # 2.4b1
- '2.4.112': '{4a5e7c1d-c659-4fe3-b8c9-7c65bd9c95a5}', # 2.4b2
- '2.4.121': '{75508821-a8e9-40a8-95bd-dbe6033ddbea}', # 2.4c1
- '2.4.122': '{83a9118b-4bdd-473b-afc3-bcb142feca9e}', # 2.4c2
- '2.4.150': '{82d9302e-f209-4805-b548-52087047483a}', # 2.4.0
- '2.4.1121':'{be027411-8e6b-4440-a29b-b07df0690230}', # 2.4.1c1
- '2.4.1122':'{02818752-48bf-4074-a281-7a4114c4f1b1}', # 2.4.1c2
- '2.4.1150':'{4d4f5346-7e4a-40b5-9387-fdb6181357fc}', # 2.4.1
- '2.4.2121':'{5ef9d6b6-df78-45d2-ab09-14786a3c5a99}', # 2.4.2c1
- '2.4.2150':'{b191e49c-ea23-43b2-b28a-14e0784069b8}', # 2.4.2
- '2.4.3121':'{f669ed4d-1dce-41c4-9617-d985397187a1}', # 2.4.3c1
- '2.4.3150':'{75e71add-042c-4f30-bfac-a9ec42351313}', # 2.4.3
- '2.4.4121':'{cd2862db-22a4-4688-8772-85407ea21550}', # 2.4.4c1
- '2.4.4150':'{60e2c8c9-6cf3-4b1a-9618-e304946c94e6}', # 2.4.4
'2.5.101': '{bc14ce3e-5e72-4a64-ac1f-bf59a571898c}', # 2.5a1
'2.5.102': '{5eed51c1-8e9d-4071-94c5-b40de5d49ba5}', # 2.5a2
'2.5.103': '{73dcd966-ffec-415f-bb39-8342c1f47017}', # 2.5a3
@@ -50,6 +33,23 @@ product_codes = {
'2.6.1150':'{9cc89170-000b-457d-91f1-53691f85b223}', # 2.6.1
'2.6.2121':'{adac412b-b209-4c15-b6ab-dca1b6e47144}', # 2.6.2c1
'2.6.2150':'{24aab420-4e30-4496-9739-3e216f3de6ae}', # 2.6.2
+ '2.6.3121':'{a73e0254-dcda-4fe4-bf37-c7e1c4f4ebb6}', # 2.6.3c1
+ '2.6.3150':'{3d9ac095-e115-4e94-bdef-7f7edf17697d}', # 2.6.3
+ '2.6.4121':'{727de605-0359-4606-a94b-c2033652379b}', # 2.6.4c1
+ '2.6.4122':'{4f7603c6-6352-4299-a398-150a31b19acc}', # 2.6.4c2
+ '2.6.4150':'{e7394a0f-3f80-45b1-87fc-abcd51893246}', # 2.6.4
+ '2.6.5121':'{e0e273d7-7598-4701-8325-c90c069fd5ff}', # 2.6.5c1
+ '2.6.5122':'{fa227b76-0671-4dc6-b826-c2ff2a70dfd5}', # 2.6.5c2
+ '2.6.5150':'{4723f199-fa64-4233-8e6e-9fccc95a18ee}', # 2.6.5
+ '2.7.101': '{eca1bbef-432c-49ae-a667-c213cc7bbf22}', # 2.7a1
+ '2.7.102': '{21ce16ed-73c4-460d-9b11-522f417b2090}', # 2.7a2
+ '2.7.103': '{6e7dbd55-ba4a-48ac-a688-6c75db4d7500}', # 2.7a3
+ '2.7.104': '{ee774ba3-74a5-48d9-b425-b35a287260c8}', # 2.7a4
+ '2.7.111': '{9cfd9ec7-a9c7-4980-a1c6-054fc6493eb3}', # 2.7b1
+ '2.7.112': '{9a72faf6-c304-4165-8595-9291ff30cac6}', # 2.7b2
+ '2.7.121': '{f530c94a-dd53-4de9-948e-b632b9cb48d2}', # 2.7c1
+ '2.7.122': '{f80905d2-dd8d-4b8e-8a40-c23c93dca07d}', # 2.7c2
+ '2.7.150': '{20c31435-2a0a-4580-be8b-ac06fc243ca4}', # 2.7.0
'3.0.101': '{8554263a-3242-4857-9359-aa87bc2c58c2}', # 3.0a1
'3.0.102': '{692d6e2c-f0ac-40b8-a133-7191aeeb67f9}', # 3.0a2
'3.0.103': '{49cb2995-751a-4753-be7a-d0b1bb585e06}', # 3.0a3
@@ -77,7 +77,14 @@ product_codes = {
'3.1.1150':'{7ff90460-89b7-435b-b583-b37b2815ccc7}', # 3.1.1
'3.1.2121':'{ec45624a-378c-43be-91f3-3f7a59b0d90c}', # 3.1.2c1
'3.1.2150':'{d40af016-506c-43fb-a738-bd54fa8c1e85}', # 3.1.2
- '3.1.3121':'{a1e436f8-92fc-4ddb-af18-a12529c57aaf}', # 3.1.3rc1
- '3.1.3122':'{2fc19026-a3e5-493e-92a0-c1f3b4a272ae}', # 3.1.3rc2
- '3.1.3150':'{f719d8a6-46fc-4d71-94c6-ffd17a8c9f35}', # 3.1.3
+ '3.2.101' :'{b411f168-7a36-4fff-902c-a554d1c78a4f}', # 3.2a1
+ '3.2.102' :'{79ff73b7-8359-410f-b9c5-152d2026f8c8}', # 3.2a2
+ '3.2.103' :'{e7635c65-c221-4b9b-b70a-5611b8369d77}', # 3.2a3
+ '3.2.104' :'{748cd139-75b8-4ca8-98a7-58262298181e}', # 3.2a4
+ '3.2.111' :'{20bfc16f-c7cd-4fc0-8f96-9914614a3c50}', # 3.2b1
+ '3.2.112' :'{0e350c98-8d73-4993-b686-cfe87160046e}', # 3.2b2
+ '3.2.121' :'{2094968d-7583-47f6-a7fd-22304532e09f}', # 3.2rc1
+ '3.2.122' :'{4f3edfa6-cf70-469a-825f-e1206aa7f412}', # 3.2rc2
+ '3.2.123' :'{90c673d7-8cfd-4969-9816-f7d70bad87f3}', # 3.2rc3
+ '3.2.150' :'{b2042d5e-986d-44ec-aee3-afe4108ccc93}', # 3.2.0
}
diff --git a/Tools/parser/test_unparse.py b/Tools/parser/test_unparse.py
new file mode 100644
index 0000000000..d457523b7c
--- /dev/null
+++ b/Tools/parser/test_unparse.py
@@ -0,0 +1,240 @@
+import unittest
+import test.support
+import io
+import os
+import tokenize
+import ast
+import unparse
+
+def read_pyfile(filename):
+ """Read and return the contents of a Python source file (as a
+ string), taking into account the file encoding."""
+ with open(filename, "rb") as pyfile:
+ encoding = tokenize.detect_encoding(pyfile.readline)[0]
+ with open(filename, "r", encoding=encoding) as pyfile:
+ source = pyfile.read()
+ return source
+
+for_else = """\
+def f():
+ for x in range(10):
+ break
+ else:
+ y = 2
+ z = 3
+"""
+
+while_else = """\
+def g():
+ while True:
+ break
+ else:
+ y = 2
+ z = 3
+"""
+
+relative_import = """\
+from . import fred
+from .. import barney
+from .australia import shrimp as prawns
+"""
+
+nonlocal_ex = """\
+def f():
+ x = 1
+ def g():
+ nonlocal x
+ x = 2
+ y = 7
+ def h():
+ nonlocal x, y
+"""
+
+# also acts as test for 'except ... as ...'
+raise_from = """\
+try:
+ 1 / 0
+except ZeroDivisionError as e:
+ raise ArithmeticError from e
+"""
+
+class_decorator = """\
+@f1(arg)
+@f2
+class Foo: pass
+"""
+
+elif1 = """\
+if cond1:
+ suite1
+elif cond2:
+ suite2
+else:
+ suite3
+"""
+
+elif2 = """\
+if cond1:
+ suite1
+elif cond2:
+ suite2
+"""
+
+try_except_finally = """\
+try:
+ suite1
+except ex1:
+ suite2
+except ex2:
+ suite3
+else:
+ suite4
+finally:
+ suite5
+"""
+
+class ASTTestCase(unittest.TestCase):
+ def assertASTEqual(self, ast1, ast2):
+ self.assertEqual(ast.dump(ast1), ast.dump(ast2))
+
+ def check_roundtrip(self, code1, filename="internal"):
+ ast1 = compile(code1, filename, "exec", ast.PyCF_ONLY_AST)
+ unparse_buffer = io.StringIO()
+ unparse.Unparser(ast1, unparse_buffer)
+ code2 = unparse_buffer.getvalue()
+ ast2 = compile(code2, filename, "exec", ast.PyCF_ONLY_AST)
+ self.assertASTEqual(ast1, ast2)
+
+class UnparseTestCase(ASTTestCase):
+ # Tests for specific bugs found in earlier versions of unparse
+
+ def test_del_statement(self):
+ self.check_roundtrip("del x, y, z")
+
+ def test_shifts(self):
+ self.check_roundtrip("45 << 2")
+ self.check_roundtrip("13 >> 7")
+
+ def test_for_else(self):
+ self.check_roundtrip(for_else)
+
+ def test_while_else(self):
+ self.check_roundtrip(while_else)
+
+ def test_unary_parens(self):
+ self.check_roundtrip("(-1)**7")
+ self.check_roundtrip("(-1.)**8")
+ self.check_roundtrip("(-1j)**6")
+ self.check_roundtrip("not True or False")
+ self.check_roundtrip("True or not False")
+
+ def test_integer_parens(self):
+ self.check_roundtrip("3 .__abs__()")
+
+ def test_huge_float(self):
+ self.check_roundtrip("1e1000")
+ self.check_roundtrip("-1e1000")
+ self.check_roundtrip("1e1000j")
+ self.check_roundtrip("-1e1000j")
+
+ def test_min_int(self):
+ self.check_roundtrip(str(-2**31))
+ self.check_roundtrip(str(-2**63))
+
+ def test_imaginary_literals(self):
+ self.check_roundtrip("7j")
+ self.check_roundtrip("-7j")
+ self.check_roundtrip("0j")
+ self.check_roundtrip("-0j")
+
+ def test_lambda_parentheses(self):
+ self.check_roundtrip("(lambda: int)()")
+
+ def test_chained_comparisons(self):
+ self.check_roundtrip("1 < 4 <= 5")
+ self.check_roundtrip("a is b is c is not d")
+
+ def test_function_arguments(self):
+ self.check_roundtrip("def f(): pass")
+ self.check_roundtrip("def f(a): pass")
+ self.check_roundtrip("def f(b = 2): pass")
+ self.check_roundtrip("def f(a, b): pass")
+ self.check_roundtrip("def f(a, b = 2): pass")
+ self.check_roundtrip("def f(a = 5, b = 2): pass")
+ self.check_roundtrip("def f(*, a = 1, b = 2): pass")
+ self.check_roundtrip("def f(*, a = 1, b): pass")
+ self.check_roundtrip("def f(*, a, b = 2): pass")
+ self.check_roundtrip("def f(a, b = None, *, c, **kwds): pass")
+ self.check_roundtrip("def f(a=2, *args, c=5, d, **kwds): pass")
+ self.check_roundtrip("def f(*args, **kwargs): pass")
+
+ def test_relative_import(self):
+ self.check_roundtrip(relative_import)
+
+ def test_nonlocal(self):
+ self.check_roundtrip(nonlocal_ex)
+
+ def test_raise_from(self):
+ self.check_roundtrip(raise_from)
+
+ def test_bytes(self):
+ self.check_roundtrip("b'123'")
+
+ def test_annotations(self):
+ self.check_roundtrip("def f(a : int): pass")
+ self.check_roundtrip("def f(a: int = 5): pass")
+ self.check_roundtrip("def f(*args: [int]): pass")
+ self.check_roundtrip("def f(**kwargs: dict): pass")
+ self.check_roundtrip("def f() -> None: pass")
+
+ def test_set_literal(self):
+ self.check_roundtrip("{'a', 'b', 'c'}")
+
+ def test_set_comprehension(self):
+ self.check_roundtrip("{x for x in range(5)}")
+
+ def test_dict_comprehension(self):
+ self.check_roundtrip("{x: x*x for x in range(10)}")
+
+ def test_class_decorators(self):
+ self.check_roundtrip(class_decorator)
+
+ def test_class_definition(self):
+ self.check_roundtrip("class A(metaclass=type, *[], **{}): pass")
+
+ def test_elifs(self):
+ self.check_roundtrip(elif1)
+ self.check_roundtrip(elif2)
+
+ def test_try_except_finally(self):
+ self.check_roundtrip(try_except_finally)
+
+class DirectoryTestCase(ASTTestCase):
+ """Test roundtrip behaviour on all files in Lib and Lib/test."""
+
+ # test directories, relative to the root of the distribution
+ test_directories = 'Lib', os.path.join('Lib', 'test')
+
+ def test_files(self):
+ # get names of files to test
+ dist_dir = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
+
+ names = []
+ for d in self.test_directories:
+ test_dir = os.path.join(dist_dir, d)
+ for n in os.listdir(test_dir):
+ if n.endswith('.py') and not n.startswith('bad'):
+ names.append(os.path.join(test_dir, n))
+
+ for filename in names:
+ if test.support.verbose:
+ print('Testing %s' % filename)
+ source = read_pyfile(filename)
+ self.check_roundtrip(source)
+
+
+def test_main():
+ test.support.run_unittest(UnparseTestCase, DirectoryTestCase)
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Demo/parser/unparse.py b/Tools/parser/unparse.py
index d53a6c4611..e96ef5477b 100644
--- a/Demo/parser/unparse.py
+++ b/Tools/parser/unparse.py
@@ -1,9 +1,15 @@
"Usage: unparse.py <path to source file>"
import sys
-import _ast
+import math
+import ast
+import tokenize
import io
import os
+# Large float and imaginary literals get turned into infinities in the AST.
+# We unparse those infinities to INFSTR.
+INFSTR = "1e" + repr(sys.float_info.max_10_exp + 1)
+
def interleave(inter, f, seq):
"""Call f on each item in seq, calling inter() in between.
"""
@@ -20,7 +26,7 @@ def interleave(inter, f, seq):
class Unparser:
"""Methods in this class recursively traverse an AST and
output source code for the abstract syntax; original formatting
- is disregarged. """
+ is disregarded. """
def __init__(self, tree, file = sys.stdout):
"""Unparser(tree, file=sys.stdout) -> None.
@@ -80,10 +86,11 @@ class Unparser:
def _ImportFrom(self, t):
self.fill("from ")
- self.write(t.module)
+ self.write("." * t.level)
+ if t.module:
+ self.write(t.module)
self.write(" import ")
interleave(lambda: self.write(", "), self.dispatch, t.names)
- # XXX(jpe) what is level for?
def _Assign(self, t):
self.fill()
@@ -115,7 +122,7 @@ class Unparser:
def _Delete(self, t):
self.fill("del ")
- self.dispatch(t.targets)
+ interleave(lambda: self.write(", "), self.dispatch, t.targets)
def _Assert(self, t):
self.fill("assert ")
@@ -124,24 +131,14 @@ class Unparser:
self.write(", ")
self.dispatch(t.msg)
- def _Print(self, t):
- self.fill("print ")
- do_comma = False
- if t.dest:
- self.write(">>")
- self.dispatch(t.dest)
- do_comma = True
- for e in t.values:
- if do_comma:self.write(", ")
- else:do_comma=True
- self.dispatch(e)
- if not t.nl:
- self.write(",")
-
def _Global(self, t):
self.fill("global ")
interleave(lambda: self.write(", "), self.write, t.names)
+ def _Nonlocal(self, t):
+ self.fill("nonlocal ")
+ interleave(lambda: self.write(", "), self.write, t.names)
+
def _Yield(self, t):
self.write("(")
self.write("yield")
@@ -151,15 +148,15 @@ class Unparser:
self.write(")")
def _Raise(self, t):
- self.fill('raise ')
- if t.type:
- self.dispatch(t.type)
- if t.inst:
- self.write(", ")
- self.dispatch(t.inst)
- if t.tback:
- self.write(", ")
- self.dispatch(t.tback)
+ self.fill("raise")
+ if not t.exc:
+ assert not t.cause
+ return
+ self.write(" ")
+ self.dispatch(t.exc)
+ if t.cause:
+ self.write(" from ")
+ self.dispatch(t.cause)
def _TryExcept(self, t):
self.fill("try")
@@ -176,10 +173,14 @@ class Unparser:
self.leave()
def _TryFinally(self, t):
- self.fill("try")
- self.enter()
- self.dispatch(t.body)
- self.leave()
+ if len(t.body) == 1 and isinstance(t.body[0], ast.TryExcept):
+ # try-except-finally
+ self.dispatch(t.body)
+ else:
+ self.fill("try")
+ self.enter()
+ self.dispatch(t.body)
+ self.leave()
self.fill("finally")
self.enter()
@@ -192,21 +193,40 @@ class Unparser:
self.write(" ")
self.dispatch(t.type)
if t.name:
- self.write(", ")
- self.dispatch(t.name)
+ self.write(" as ")
+ self.write(t.name)
self.enter()
self.dispatch(t.body)
self.leave()
def _ClassDef(self, t):
self.write("\n")
+ for deco in t.decorator_list:
+ self.fill("@")
+ self.dispatch(deco)
self.fill("class "+t.name)
- if t.bases:
- self.write("(")
- for a in t.bases:
- self.dispatch(a)
- self.write(", ")
- self.write(")")
+ self.write("(")
+ comma = False
+ for e in t.bases:
+ if comma: self.write(", ")
+ else: comma = True
+ self.dispatch(e)
+ for e in t.keywords:
+ if comma: self.write(", ")
+ else: comma = True
+ self.dispatch(e)
+ if t.starargs:
+ if comma: self.write(", ")
+ else: comma = True
+ self.write("*")
+ self.dispatch(t.starargs)
+ if t.kwargs:
+ if comma: self.write(", ")
+ else: comma = True
+ self.write("**")
+ self.dispatch(t.kwargs)
+ self.write(")")
+
self.enter()
self.dispatch(t.body)
self.leave()
@@ -219,6 +239,9 @@ class Unparser:
self.fill("def "+t.name + "(")
self.dispatch(t.args)
self.write(")")
+ if t.returns:
+ self.write(" -> ")
+ self.dispatch(t.returns)
self.enter()
self.dispatch(t.body)
self.leave()
@@ -235,15 +258,24 @@ class Unparser:
self.fill("else")
self.enter()
self.dispatch(t.orelse)
- self.leave
+ self.leave()
def _If(self, t):
self.fill("if ")
self.dispatch(t.test)
self.enter()
- # XXX elif?
self.dispatch(t.body)
self.leave()
+ # collapse nested ifs into equivalent elifs.
+ while (t.orelse and len(t.orelse) == 1 and
+ isinstance(t.orelse[0], ast.If)):
+ t = t.orelse[0]
+ self.fill("elif ")
+ self.dispatch(t.test)
+ self.enter()
+ self.dispatch(t.body)
+ self.leave()
+ # final else
if t.orelse:
self.fill("else")
self.enter()
@@ -260,7 +292,7 @@ class Unparser:
self.fill("else")
self.enter()
self.dispatch(t.orelse)
- self.leave
+ self.leave()
def _With(self, t):
self.fill("with ")
@@ -273,19 +305,18 @@ class Unparser:
self.leave()
# expr
+ def _Bytes(self, t):
+ self.write(repr(t.s))
+
def _Str(self, tree):
self.write(repr(tree.s))
def _Name(self, t):
self.write(t.id)
- def _Repr(self, t):
- self.write("`")
- self.dispatch(t.value)
- self.write("`")
-
def _Num(self, t):
- self.write(repr(t.n))
+ # Substitute overflowing decimal literal for AST infinities.
+ self.write(repr(t.n).replace("inf", INFSTR))
def _List(self, t):
self.write("[")
@@ -306,6 +337,22 @@ class Unparser:
self.dispatch(gen)
self.write(")")
+ def _SetComp(self, t):
+ self.write("{")
+ self.dispatch(t.elt)
+ for gen in t.generators:
+ self.dispatch(gen)
+ self.write("}")
+
+ def _DictComp(self, t):
+ self.write("{")
+ self.dispatch(t.key)
+ self.write(": ")
+ self.dispatch(t.value)
+ for gen in t.generators:
+ self.dispatch(gen)
+ self.write("}")
+
def _comprehension(self, t):
self.write(" for ")
self.dispatch(t.target)
@@ -324,14 +371,20 @@ class Unparser:
self.dispatch(t.orelse)
self.write(")")
+ def _Set(self, t):
+ assert(t.elts) # should be at least one element
+ self.write("{")
+ interleave(lambda: self.write(", "), self.dispatch, t.elts)
+ self.write("}")
+
def _Dict(self, t):
self.write("{")
- def writem(xxx_todo_changeme):
- (k, v) = xxx_todo_changeme
+ def write_pair(pair):
+ (k, v) = pair
self.dispatch(k)
self.write(": ")
self.dispatch(v)
- interleave(lambda: self.write(", "), writem, zip(t.keys, t.values))
+ interleave(lambda: self.write(", "), write_pair, zip(t.keys, t.values))
self.write("}")
def _Tuple(self, t):
@@ -346,13 +399,14 @@ class Unparser:
unop = {"Invert":"~", "Not": "not", "UAdd":"+", "USub":"-"}
def _UnaryOp(self, t):
- self.write(self.unop[t.op.__class__.__name__])
self.write("(")
+ self.write(self.unop[t.op.__class__.__name__])
+ self.write(" ")
self.dispatch(t.operand)
self.write(")")
binop = { "Add":"+", "Sub":"-", "Mult":"*", "Div":"/", "Mod":"%",
- "LShift":">>", "RShift":"<<", "BitOr":"|", "BitXor":"^", "BitAnd":"&",
+ "LShift":"<<", "RShift":">>", "BitOr":"|", "BitXor":"^", "BitAnd":"&",
"FloorDiv":"//", "Pow": "**"}
def _BinOp(self, t):
self.write("(")
@@ -369,9 +423,9 @@ class Unparser:
for o, e in zip(t.ops, t.comparators):
self.write(" " + self.cmpops[o.__class__.__name__] + " ")
self.dispatch(e)
- self.write(")")
+ self.write(")")
- boolops = {_ast.And: 'and', _ast.Or: 'or'}
+ boolops = {ast.And: 'and', ast.Or: 'or'}
def _BoolOp(self, t):
self.write("(")
s = " %s " % self.boolops[t.op.__class__]
@@ -380,6 +434,11 @@ class Unparser:
def _Attribute(self,t):
self.dispatch(t.value)
+ # Special case: 3.__abs__() is a syntax error, so if t.value
+ # is an integer literal then we need to either parenthesize
+ # it or add an extra space to get 3 .__abs__().
+ if isinstance(t.value, ast.Num) and isinstance(t.value.n, int):
+ self.write(" ")
self.write(".")
self.write(t.attr)
@@ -433,28 +492,55 @@ class Unparser:
def _ExtSlice(self, t):
interleave(lambda: self.write(', '), self.dispatch, t.dims)
+ # argument
+ def _arg(self, t):
+ self.write(t.arg)
+ if t.annotation:
+ self.write(": ")
+ self.dispatch(t.annotation)
+
# others
def _arguments(self, t):
first = True
- nonDef = len(t.args)-len(t.defaults)
- for a in t.args[0:nonDef]:
+ # normal arguments
+ defaults = [None] * (len(t.args) - len(t.defaults)) + t.defaults
+ for a, d in zip(t.args, defaults):
if first:first = False
else: self.write(", ")
self.dispatch(a)
- for a,d in zip(t.args[nonDef:], t.defaults):
- if first:first = False
- else: self.write(", ")
- self.dispatch(a),
- self.write("=")
- self.dispatch(d)
- if t.vararg:
+ if d:
+ self.write("=")
+ self.dispatch(d)
+
+ # varargs, or bare '*' if no varargs but keyword-only arguments present
+ if t.vararg or t.kwonlyargs:
if first:first = False
else: self.write(", ")
- self.write("*"+t.vararg)
+ self.write("*")
+ if t.vararg:
+ self.write(t.vararg)
+ if t.varargannotation:
+ self.write(": ")
+ self.dispatch(t.varargannotation)
+
+ # keyword-only arguments
+ if t.kwonlyargs:
+ for a, d in zip(t.kwonlyargs, t.kw_defaults):
+ if first:first = False
+ else: self.write(", ")
+ self.dispatch(a),
+ if d:
+ self.write("=")
+ self.dispatch(d)
+
+ # kwargs
if t.kwarg:
if first:first = False
else: self.write(", ")
self.write("**"+t.kwarg)
+ if t.kwargannotation:
+ self.write(": ")
+ self.dispatch(t.kwargannotation)
def _keyword(self, t):
self.write(t.arg)
@@ -462,10 +548,12 @@ class Unparser:
self.dispatch(t.value)
def _Lambda(self, t):
+ self.write("(")
self.write("lambda ")
self.dispatch(t.args)
self.write(": ")
self.dispatch(t.body)
+ self.write(")")
def _alias(self, t):
self.write(t.name)
@@ -473,8 +561,11 @@ class Unparser:
self.write(" as "+t.asname)
def roundtrip(filename, output=sys.stdout):
- source = open(filename).read()
- tree = compile(source, filename, "exec", _ast.PyCF_ONLY_AST)
+ with open(filename, "rb") as pyfile:
+ encoding = tokenize.detect_encoding(pyfile.readline)[0]
+ with open(filename, "r", encoding=encoding) as pyfile:
+ source = pyfile.read()
+ tree = compile(source, filename, "exec", ast.PyCF_ONLY_AST)
Unparser(tree, output)
diff --git a/Tools/pybench/pybench.py b/Tools/pybench/pybench.py
index 9f1e2e4db0..8eaad63cf1 100755
--- a/Tools/pybench/pybench.py
+++ b/Tools/pybench/pybench.py
@@ -228,7 +228,7 @@ class Test:
raise ValueError('at least one calibration run is required')
self.calibration_runs = calibration_runs
if timer is not None:
- timer = timer
+ self.timer = timer
# Init variables
self.times = []
diff --git a/Tools/pynche/ChipViewer.py b/Tools/pynche/ChipViewer.py
index f59aa2819f..78139f8f2d 100644
--- a/Tools/pynche/ChipViewer.py
+++ b/Tools/pynche/ChipViewer.py
@@ -13,7 +13,7 @@ The ChipViewer class includes the entire lower left quandrant; i.e. both the
selected and nearest ChipWidgets.
"""
-from Tkinter import *
+from tkinter import *
import ColorDB
diff --git a/Tools/pynche/DetailsViewer.py b/Tools/pynche/DetailsViewer.py
index 11a99a6afc..fdc79b749c 100644
--- a/Tools/pynche/DetailsViewer.py
+++ b/Tools/pynche/DetailsViewer.py
@@ -52,7 +52,7 @@ Shift + Left == -25
Shift + Right == +25
"""
-from Tkinter import *
+from tkinter import *
STOP = 'Stop'
WRAP = 'Wrap Around'
diff --git a/Tools/pynche/ListViewer.py b/Tools/pynche/ListViewer.py
index 213cd08ba7..b18784453c 100644
--- a/Tools/pynche/ListViewer.py
+++ b/Tools/pynche/ListViewer.py
@@ -15,7 +15,7 @@ You can turn off Update On Click if all you want to see is the alias for a
given name, without selecting the color.
"""
-from Tkinter import *
+from tkinter import *
import ColorDB
ADDTOVIEW = 'Color %List Window...'
diff --git a/Tools/pynche/PyncheWidget.py b/Tools/pynche/PyncheWidget.py
index fcfe7ce6c1..364f22b0b2 100644
--- a/Tools/pynche/PyncheWidget.py
+++ b/Tools/pynche/PyncheWidget.py
@@ -6,9 +6,8 @@ It is used to bring up other windows.
import sys
import os
-from Tkinter import *
-import tkMessageBox
-import tkFileDialog
+from tkinter import *
+from tkinter import messagebox, filedialog
import ColorDB
# Milliseconds between interrupt checks
@@ -150,7 +149,7 @@ class PyncheWidget:
def __popup_about(self, event=None):
from Main import __version__
- tkMessageBox.showinfo('About Pynche ' + __version__,
+ messagebox.showinfo('About Pynche ' + __version__,
'''\
Pynche %s
The PYthonically Natural
@@ -168,7 +167,7 @@ email: bwarsaw@python.org''' % __version__)
def __load(self, event=None):
while 1:
idir, ifile = os.path.split(self.__sb.colordb().filename())
- file = tkFileDialog.askopenfilename(
+ file = filedialog.askopenfilename(
filetypes=[('Text files', '*.txt'),
('All files', '*'),
],
@@ -180,12 +179,12 @@ email: bwarsaw@python.org''' % __version__)
try:
colordb = ColorDB.get_colordb(file)
except IOError:
- tkMessageBox.showerror('Read error', '''\
+ messagebox.showerror('Read error', '''\
Could not open file for reading:
%s''' % file)
continue
if colordb is None:
- tkMessageBox.showerror('Unrecognized color file type', '''\
+ messagebox.showerror('Unrecognized color file type', '''\
Unrecognized color file type in file:
%s''' % file)
continue
@@ -249,6 +248,8 @@ class Helpwin:
+import functools
+@functools.total_ordering
class PopupViewer:
def __init__(self, module, name, switchboard, root):
self.__m = module
@@ -279,8 +280,11 @@ class PopupViewer:
self.__sb.add_view(self.__window)
self.__window.deiconify()
- def __cmp__(self, other):
- return cmp(self.__menutext, other.__menutext)
+ def __eq__(self, other):
+ return self.__menutext == other.__menutext
+
+ def __lt__(self, other):
+ return self.__menutext < other.__menutext
def make_view_popups(switchboard, root, extrapath):
diff --git a/Tools/pynche/StripViewer.py b/Tools/pynche/StripViewer.py
index a7de398393..2b0ede39ee 100644
--- a/Tools/pynche/StripViewer.py
+++ b/Tools/pynche/StripViewer.py
@@ -24,7 +24,7 @@ select the color under the cursor while you drag it, but be forewarned that
this can be slow.
"""
-from Tkinter import *
+from tkinter import *
import ColorDB
# Load this script into the Tcl interpreter and call it in
@@ -62,32 +62,32 @@ def constant(numchips):
# red variations, green+blue = cyan constant
def constant_red_generator(numchips, red, green, blue):
seq = constant(numchips)
- return list(map(None, [red] * numchips, seq, seq))
+ return list(zip([red] * numchips, seq, seq))
# green variations, red+blue = magenta constant
def constant_green_generator(numchips, red, green, blue):
seq = constant(numchips)
- return list(map(None, seq, [green] * numchips, seq))
+ return list(zip(seq, [green] * numchips, seq))
# blue variations, red+green = yellow constant
def constant_blue_generator(numchips, red, green, blue):
seq = constant(numchips)
- return list(map(None, seq, seq, [blue] * numchips))
+ return list(zip(seq, seq, [blue] * numchips))
# red variations, green+blue = cyan constant
def constant_cyan_generator(numchips, red, green, blue):
seq = constant(numchips)
- return list(map(None, seq, [green] * numchips, [blue] * numchips))
+ return list(zip(seq, [green] * numchips, [blue] * numchips))
# green variations, red+blue = magenta constant
def constant_magenta_generator(numchips, red, green, blue):
seq = constant(numchips)
- return list(map(None, [red] * numchips, seq, [blue] * numchips))
+ return list(zip([red] * numchips, seq, [blue] * numchips))
# blue variations, red+green = yellow constant
def constant_yellow_generator(numchips, red, green, blue):
seq = constant(numchips)
- return list(map(None, [red] * numchips, [green] * numchips, seq))
+ return list(zip([red] * numchips, [green] * numchips, seq))
@@ -119,7 +119,7 @@ class LeftArrow:
return arrow, text
def _x(self):
- coords = self._canvas.coords(self._TAG)
+ coords = list(self._canvas.coords(self._TAG))
assert coords
return coords[0]
@@ -151,7 +151,7 @@ class RightArrow(LeftArrow):
return arrow, text
def _x(self):
- coords = self._canvas.coords(self._TAG)
+ coords = list(self._canvas.coords(self._TAG))
assert coords
return coords[0] + self._ARROWWIDTH
diff --git a/Tools/pynche/Switchboard.py b/Tools/pynche/Switchboard.py
index 29f99afdd8..013bb01389 100644
--- a/Tools/pynche/Switchboard.py
+++ b/Tools/pynche/Switchboard.py
@@ -42,7 +42,6 @@ master window.
"""
import sys
-from types import DictType
import marshal
@@ -62,10 +61,11 @@ class Switchboard:
if initfile:
try:
try:
- fp = open(initfile)
+ fp = open(initfile, 'rb')
self.__optiondb = marshal.load(fp)
- if not isinstance(self.__optiondb, DictType):
- print('Problem reading options from file:', initfile, file=sys.stderr)
+ if not isinstance(self.__optiondb, dict):
+ print('Problem reading options from file:', initfile,
+ file=sys.stderr)
self.__optiondb = {}
except (IOError, EOFError, ValueError):
pass
@@ -116,7 +116,7 @@ class Switchboard:
fp = None
try:
try:
- fp = open(self.__initfile, 'w')
+ fp = open(self.__initfile, 'wb')
except IOError:
print('Cannot write options to file:', \
self.__initfile, file=sys.stderr)
diff --git a/Tools/pynche/TextViewer.py b/Tools/pynche/TextViewer.py
index 456bd96e3f..baa1e62ca7 100644
--- a/Tools/pynche/TextViewer.py
+++ b/Tools/pynche/TextViewer.py
@@ -15,7 +15,7 @@ button and drag it through some text. The Insertion is the insertion cursor
in the text window (which only has a background).
"""
-from Tkinter import *
+from tkinter import *
import ColorDB
ADDTOVIEW = 'Text Window...'
diff --git a/Tools/pynche/TypeinViewer.py b/Tools/pynche/TypeinViewer.py
index d56c1b32c0..2f93e6b44f 100644
--- a/Tools/pynche/TypeinViewer.py
+++ b/Tools/pynche/TypeinViewer.py
@@ -12,7 +12,7 @@ color selection will be made on every change to the text field. Otherwise,
you must hit Return or Tab to select the color.
"""
-from Tkinter import *
+from tkinter import *
diff --git a/Tools/scripts/README b/Tools/scripts/README
index b1c167ed5a..8c02529a9f 100644
--- a/Tools/scripts/README
+++ b/Tools/scripts/README
@@ -1,67 +1,63 @@
-This directory contains a collection of executable Python scripts that
-are useful while building, extending or managing Python. Some (e.g.,
-dutree or lll) are also generally useful UNIX tools.
+This directory contains a collection of executable Python scripts that are
+useful while building, extending or managing Python. Some (e.g., dutree or lll)
+are also generally useful UNIX tools.
-See also the Demo/scripts directory!
-
-analyze_dxp.py Analyzes the result of sys.getdxp()
-byext.py Print lines/words/chars stats of files by extension
-byteyears.py Print product of a file's size and age
-checkappend.py Search for multi-argument .append() calls
-checkpyc.py Check presence and validity of ".pyc" files
-classfix.py Convert old class syntax to new
-cleanfuture.py Fix reduntant Python __future__ statements
-combinerefs.py A helper for analyzing PYTHONDUMPREFS output.
-copytime.py Copy one file's atime and mtime to another
-crlf.py Change CRLF line endings to LF (Windows to Unix)
-cvsfiles.py Print a list of files that are under CVS
-db2pickle.py Dump a database file to a pickle
-diff.py Print file diffs in context, unified, or ndiff formats
-dutree.py Format du(1) output as a tree sorted by size
-eptags.py Create Emacs TAGS file for Python modules
+2to3 Main script for running the 2to3 conversion tool
+analyze_dxp.py Analyzes the result of sys.getdxp()
+byext.py Print lines/words/chars stats of files by extension
+byteyears.py Print product of a file's size and age
+checkpyc.py Check presence and validity of ".pyc" files
+cleanfuture.py Fix redundant Python __future__ statements
+combinerefs.py A helper for analyzing PYTHONDUMPREFS output
+copytime.py Copy one file's atime and mtime to another
+crlf.py Change CRLF line endings to LF (Windows to Unix)
+db2pickle.py Dump a database file to a pickle
+diff.py Print file diffs in context, unified, or ndiff formats
+dutree.py Format du(1) output as a tree sorted by size
+eptags.py Create Emacs TAGS file for Python modules
find_recursionlimit.py Find the maximum recursion limit on this machine
-finddiv.py A grep-like tool that looks for division operators
-findlinksto.py Recursively find symbolic links to a given path prefix
-findnocoding.py Find source files which need an encoding declaration
-fixcid.py Massive identifier substitution on C source files
-fixdiv.py Tool to fix division operators.
-fixheader.py Add some cpp magic to a C include file
-fixnotice.py Fix the copyright notice in source files
-fixps.py Fix Python scripts' first line (if #!)
-ftpmirror.py FTP mirror script
-google.py Open a webbrowser with Google
-gprof2html.py Transform gprof(1) output into useful HTML
-h2py.py Translate #define's into Python assignments
-idle Main program to start IDLE
-ifdef.py Remove #if(n)def groups from C sources
-lfcr.py Change LF line endings to CRLF (Unix to Windows)
-linktree.py Make a copy of a tree with links to original files
-lll.py Find and list symbolic links in current directory
-logmerge.py Consolidate CVS/RCS logs read from stdin
-mailerdaemon.py parse error messages from mailer daemons (Sjoerd&Jack)
-md5sum.py Print MD5 checksums of argument files.
-methfix.py Fix old method syntax def f(self, (a1, ..., aN)):
-mkreal.py Turn a symbolic link into a real file or directory
-ndiff.py Intelligent diff between text files (Tim Peters)
-nm2def.py Create a template for PC/python_nt.def (Marc Lemburg)
-objgraph.py Print object graph from nm output on a library
-parseentities.py Utility for parsing HTML entity definitions
-pathfix.py Change #!/usr/local/bin/python into something else
-pdeps.py Print dependencies between Python modules
-pickle2db.py Load a pickle generated by db2pickle.py to a database
-pindent.py Indent Python code, giving block-closing comments
-ptags.py Create vi tags file for Python modules
-pydoc Python documentation browser.
-pysource.py Find Python source files
-redemo.py Basic regular expression demonstration facility
-reindent.py Change .py files to use 4-space indents.
-rgrep.py Reverse grep through a file (useful for big logfiles)
-setup.py Install all scripts listed here
-suff.py Sort a list of files by suffix
-svneol.py Sets svn:eol-style on all files in directory
-texcheck.py Validate Python LaTeX formatting (Raymond Hettinger)
-texi2html.py Convert GNU texinfo files into HTML
-treesync.py Synchronize source trees (very ideosyncratic)
-untabify.py Replace tabs with spaces in argument files
-which.py Find a program in $PATH
-xxci.py Wrapper for rcsdiff and ci
+finddiv.py A grep-like tool that looks for division operators
+findlinksto.py Recursively find symbolic links to a given path prefix
+findnocoding.py Find source files which need an encoding declaration
+fixcid.py Massive identifier substitution on C source files
+fixdiv.py Tool to fix division operators.
+fixheader.py Add some cpp magic to a C include file
+fixnotice.py Fix the copyright notice in source files
+fixps.py Fix Python scripts' first line (if #!)
+ftpmirror.py FTP mirror script
+google.py Open a webbrowser with Google
+gprof2html.py Transform gprof(1) output into useful HTML
+h2py.py Translate #define's into Python assignments
+idle3 Main program to start IDLE
+ifdef.py Remove #if(n)def groups from C sources
+lfcr.py Change LF line endings to CRLF (Unix to Windows)
+linktree.py Make a copy of a tree with links to original files
+lll.py Find and list symbolic links in current directory
+mailerdaemon.py Parse error messages from mailer daemons (Sjoerd&Jack)
+make_ctype.py Generate ctype.h replacement in stringobject.c
+md5sum.py Print MD5 checksums of argument files
+mkreal.py Turn a symbolic link into a real file or directory
+ndiff.py Intelligent diff between text files (Tim Peters)
+nm2def.py Create a template for PC/python_nt.def (Marc Lemburg)
+objgraph.py Print object graph from nm output on a library
+parseentities.py Utility for parsing HTML entity definitions
+patchcheck.py Perform common checks and cleanup before committing
+pathfix.py Change #!/usr/local/bin/python into something else
+pdeps.py Print dependencies between Python modules
+pickle2db.py Load a pickle generated by db2pickle.py to a database
+pindent.py Indent Python code, giving block-closing comments
+ptags.py Create vi tags file for Python modules
+pydoc3 Python documentation browser
+pysource.py Find Python source files
+redemo.py Basic regular expression demonstration facility
+reindent.py Change .py files to use 4-space indents
+reindent-rst.py Fix-up reStructuredText file whitespace
+rgrep.py Reverse grep through a file (useful for big logfiles)
+serve.py Small wsgiref-based web server, used in make serve in Doc
+suff.py Sort a list of files by suffix
+svneol.py Set svn:eol-style on all files in directory
+texi2html.py Convert GNU texinfo files into HTML
+treesync.py Synchronize source trees (very idiosyncratic)
+untabify.py Replace tabs with spaces in argument files
+win_add2path.py Add Python to the search path on Windows
+which.py Find a program in $PATH
diff --git a/Tools/scripts/abitype.py b/Tools/scripts/abitype.py
new file mode 100644
index 0000000000..e35ef6a1d3
--- /dev/null
+++ b/Tools/scripts/abitype.py
@@ -0,0 +1,199 @@
+# This script converts a C file to use the PEP 384 type definition API
+# Usage: abitype.py < old_code > new_code
+import re, sys
+
+############ Simplistic C scanner ##################################
+tokenizer = re.compile(
+ r"(?P<preproc>#.*\n)"
+ r"|(?P<comment>/\*.*?\*/)"
+ r"|(?P<ident>[a-zA-Z_][a-zA-Z0-9_]*)"
+ r"|(?P<ws>[ \t\n]+)"
+ r"|(?P<other>.)",
+ re.MULTILINE)
+
+tokens = []
+source = sys.stdin.read()
+pos = 0
+while pos != len(source):
+ m = tokenizer.match(source, pos)
+ tokens.append([m.lastgroup, m.group()])
+ pos += len(tokens[-1][1])
+ if tokens[-1][0] == 'preproc':
+ # continuation lines are considered
+ # only in preprocess statements
+ while tokens[-1][1].endswith('\\\n'):
+ nl = source.find('\n', pos)
+ if nl == -1:
+ line = source[pos:]
+ else:
+ line = source[pos:nl+1]
+ tokens[-1][1] += line
+ pos += len(line)
+
+###### Replacement of PyTypeObject static instances ##############
+
+# classify each token, giving it a one-letter code:
+# S: static
+# T: PyTypeObject
+# I: ident
+# W: whitespace
+# =, {, }, ; : themselves
+def classify():
+ res = []
+ for t,v in tokens:
+ if t == 'other' and v in "={};":
+ res.append(v)
+ elif t == 'ident':
+ if v == 'PyTypeObject':
+ res.append('T')
+ elif v == 'static':
+ res.append('S')
+ else:
+ res.append('I')
+ elif t == 'ws':
+ res.append('W')
+ else:
+ res.append('.')
+ return ''.join(res)
+
+# Obtain a list of fields of a PyTypeObject, in declaration order,
+# skipping ob_base
+# All comments are dropped from the variable (which are typically
+# just the slot names, anyway), and information is discarded whether
+# the original type was static.
+def get_fields(start, real_end):
+ pos = start
+ # static?
+ if tokens[pos][1] == 'static':
+ pos += 2
+ # PyTypeObject
+ pos += 2
+ # name
+ name = tokens[pos][1]
+ pos += 1
+ while tokens[pos][1] != '{':
+ pos += 1
+ pos += 1
+ # PyVarObject_HEAD_INIT
+ while tokens[pos][0] in ('ws', 'comment'):
+ pos += 1
+ if tokens[pos][1] != 'PyVarObject_HEAD_INIT':
+ raise Exception, '%s has no PyVarObject_HEAD_INIT' % name
+ while tokens[pos][1] != ')':
+ pos += 1
+ pos += 1
+ # field definitions: various tokens, comma-separated
+ fields = []
+ while True:
+ while tokens[pos][0] in ('ws', 'comment'):
+ pos += 1
+ end = pos
+ while tokens[end][1] not in ',}':
+ if tokens[end][1] == '(':
+ nesting = 1
+ while nesting:
+ end += 1
+ if tokens[end][1] == '(': nesting+=1
+ if tokens[end][1] == ')': nesting-=1
+ end += 1
+ assert end < real_end
+ # join field, excluding separator and trailing ws
+ end1 = end-1
+ while tokens[end1][0] in ('ws', 'comment'):
+ end1 -= 1
+ fields.append(''.join(t[1] for t in tokens[pos:end1+1]))
+ if tokens[end][1] == '}':
+ break
+ pos = end+1
+ return name, fields
+
+# List of type slots as of Python 3.2, omitting ob_base
+typeslots = [
+ 'tp_name',
+ 'tp_basicsize',
+ 'tp_itemsize',
+ 'tp_dealloc',
+ 'tp_print',
+ 'tp_getattr',
+ 'tp_setattr',
+ 'tp_reserved',
+ 'tp_repr',
+ 'tp_as_number',
+ 'tp_as_sequence',
+ 'tp_as_mapping',
+ 'tp_hash',
+ 'tp_call',
+ 'tp_str',
+ 'tp_getattro',
+ 'tp_setattro',
+ 'tp_as_buffer',
+ 'tp_flags',
+ 'tp_doc',
+ 'tp_traverse',
+ 'tp_clear',
+ 'tp_richcompare',
+ 'tp_weaklistoffset',
+ 'tp_iter',
+ 'iternextfunc',
+ 'tp_methods',
+ 'tp_members',
+ 'tp_getset',
+ 'tp_base',
+ 'tp_dict',
+ 'tp_descr_get',
+ 'tp_descr_set',
+ 'tp_dictoffset',
+ 'tp_init',
+ 'tp_alloc',
+ 'tp_new',
+ 'tp_free',
+ 'tp_is_gc',
+ 'tp_bases',
+ 'tp_mro',
+ 'tp_cache',
+ 'tp_subclasses',
+ 'tp_weaklist',
+ 'tp_del'
+ 'tp_version_tag'
+]
+
+# Generate a PyType_Spec definition
+def make_slots(name, fields):
+ res = []
+ res.append('static PyType_Slot %s_slots[] = {' % name)
+ # defaults for spec
+ spec = { 'tp_itemsize':'0' }
+ for i, val in enumerate(fields):
+ if val.endswith('0'):
+ continue
+ if typeslots[i] in ('tp_name', 'tp_doc', 'tp_basicsize',
+ 'tp_itemsize', 'tp_flags'):
+ spec[typeslots[i]] = val
+ continue
+ res.append(' {Py_%s, %s},' % (typeslots[i], val))
+ res.append('};')
+ res.append('static PyType_Spec %s_spec = {' % name)
+ res.append(' %s,' % spec['tp_name'])
+ res.append(' %s,' % spec['tp_basicsize'])
+ res.append(' %s,' % spec['tp_itemsize'])
+ res.append(' %s,' % spec['tp_flags'])
+ res.append(' %s_slots,' % name)
+ res.append('};\n')
+ return '\n'.join(res)
+
+
+# Main loop: replace all static PyTypeObjects until
+# there are none left.
+while 1:
+ c = classify()
+ m = re.search('(SW)?TWIW?=W?{.*?};', c)
+ if not m:
+ break
+ start = m.start()
+ end = m.end()
+ name, fields = get_fields(start, m)
+ tokens[start:end] = [('',make_slots(name, fields))]
+
+# Output result to stdout
+for t, v in tokens:
+ sys.stdout.write(v)
diff --git a/Tools/scripts/byext.py b/Tools/scripts/byext.py
index e5b090c8e5..b79ff37e8c 100755
--- a/Tools/scripts/byext.py
+++ b/Tools/scripts/byext.py
@@ -1,10 +1,11 @@
-#! /usr/bin/env python3.0
+#! /usr/bin/env python3
"""Show file statistics by extension."""
import os
import sys
+
class Stats:
def __init__(self):
@@ -28,12 +29,11 @@ class Stats:
sys.stderr.write("Can't list %s: %s\n" % (dir, err))
self.addstats("<dir>", "unlistable", 1)
return
- names.sort()
- for name in names:
+ for name in sorted(names):
if name.startswith(".#"):
- continue # Skip CVS temp files
+ continue # Skip CVS temp files
if name.endswith("~"):
- continue# Skip Emacs backup files
+ continue # Skip Emacs backup files
full = os.path.join(dir, name)
if os.path.islink(full):
self.addstats("<lnk>", "links", 1)
@@ -46,26 +46,25 @@ class Stats:
head, ext = os.path.splitext(filename)
head, base = os.path.split(filename)
if ext == base:
- ext = "" # E.g. .cvsignore is deemed not to have an extension
+ ext = "" # E.g. .cvsignore is deemed not to have an extension
ext = os.path.normcase(ext)
if not ext:
ext = "<none>"
self.addstats(ext, "files", 1)
try:
- f = open(filename, "rb")
+ with open(filename, "rb") as f:
+ data = f.read()
except IOError as err:
sys.stderr.write("Can't open %s: %s\n" % (filename, err))
self.addstats(ext, "unopenable", 1)
return
- data = f.read()
- f.close()
self.addstats(ext, "bytes", len(data))
if b'\0' in data:
self.addstats(ext, "binary", 1)
return
if not data:
self.addstats(ext, "empty", 1)
- #self.addstats(ext, "chars", len(data))
+ # self.addstats(ext, "chars", len(data))
lines = str(data, "latin-1").splitlines()
self.addstats(ext, "lines", len(lines))
del lines
@@ -105,17 +104,20 @@ class Stats:
for ext in exts:
self.stats[ext]["ext"] = ext
cols.insert(0, "ext")
+
def printheader():
for col in cols:
print("%*s" % (colwidth[col], col), end=' ')
print()
+
printheader()
for ext in exts:
for col in cols:
value = self.stats[ext].get(col, "")
print("%*s" % (colwidth[col], value), end=' ')
print()
- printheader() # Another header at the bottom
+ printheader() # Another header at the bottom
+
def main():
args = sys.argv[1:]
@@ -125,5 +127,6 @@ def main():
s.statargs(args)
s.report()
+
if __name__ == "__main__":
main()
diff --git a/Tools/scripts/byteyears.py b/Tools/scripts/byteyears.py
index f486d26795..490b37f0bf 100755
--- a/Tools/scripts/byteyears.py
+++ b/Tools/scripts/byteyears.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Print the product of age and size of each file, in suitable units.
#
diff --git a/Tools/scripts/checkappend.py b/Tools/scripts/checkappend.py
deleted file mode 100755
index 4c74ee5769..0000000000
--- a/Tools/scripts/checkappend.py
+++ /dev/null
@@ -1,169 +0,0 @@
-#! /usr/bin/env python
-
-# Released to the public domain, by Tim Peters, 28 February 2000.
-
-"""checkappend.py -- search for multi-argument .append() calls.
-
-Usage: specify one or more file or directory paths:
- checkappend [-v] file_or_dir [file_or_dir] ...
-
-Each file_or_dir is checked for multi-argument .append() calls. When
-a directory, all .py files in the directory, and recursively in its
-subdirectories, are checked.
-
-Use -v for status msgs. Use -vv for more status msgs.
-
-In the absence of -v, the only output is pairs of the form
-
- filename(linenumber):
- line containing the suspicious append
-
-Note that this finds multi-argument append calls regardless of whether
-they're attached to list objects. If a module defines a class with an
-append method that takes more than one argument, calls to that method
-will be listed.
-
-Note that this will not find multi-argument list.append calls made via a
-bound method object. For example, this is not caught:
-
- somelist = []
- push = somelist.append
- push(1, 2, 3)
-"""
-
-__version__ = 1, 0, 0
-
-import os
-import sys
-import getopt
-import tokenize
-
-verbose = 0
-
-def errprint(*args):
- msg = ' '.join(args)
- sys.stderr.write(msg)
- sys.stderr.write("\n")
-
-def main():
- args = sys.argv[1:]
- global verbose
- try:
- opts, args = getopt.getopt(sys.argv[1:], "v")
- except getopt.error as msg:
- errprint(str(msg) + "\n\n" + __doc__)
- return
- for opt, optarg in opts:
- if opt == '-v':
- verbose = verbose + 1
- if not args:
- errprint(__doc__)
- return
- for arg in args:
- check(arg)
-
-def check(file):
- if os.path.isdir(file) and not os.path.islink(file):
- if verbose:
- print("%r: listing directory" % (file,))
- names = os.listdir(file)
- for name in names:
- fullname = os.path.join(file, name)
- if ((os.path.isdir(fullname) and
- not os.path.islink(fullname))
- or os.path.normcase(name[-3:]) == ".py"):
- check(fullname)
- return
-
- try:
- f = open(file)
- except IOError as msg:
- errprint("%r: I/O Error: %s" % (file, msg))
- return
-
- if verbose > 1:
- print("checking %r ..." % (file,))
-
- ok = AppendChecker(file, f).run()
- if verbose and ok:
- print("%r: Clean bill of health." % (file,))
-
-[FIND_DOT,
- FIND_APPEND,
- FIND_LPAREN,
- FIND_COMMA,
- FIND_STMT] = range(5)
-
-class AppendChecker:
- def __init__(self, fname, file):
- self.fname = fname
- self.file = file
- self.state = FIND_DOT
- self.nerrors = 0
-
- def run(self):
- try:
- tokens = tokenize.generate_tokens(self.file.readline)
- for _token in tokens:
- self.tokeneater(*_token)
- except tokenize.TokenError as msg:
- errprint("%r: Token Error: %s" % (self.fname, msg))
- self.nerrors = self.nerrors + 1
- return self.nerrors == 0
-
- def tokeneater(self, type, token, start, end, line,
- NEWLINE=tokenize.NEWLINE,
- JUNK=(tokenize.COMMENT, tokenize.NL),
- OP=tokenize.OP,
- NAME=tokenize.NAME):
-
- state = self.state
-
- if type in JUNK:
- pass
-
- elif state is FIND_DOT:
- if type is OP and token == ".":
- state = FIND_APPEND
-
- elif state is FIND_APPEND:
- if type is NAME and token == "append":
- self.line = line
- self.lineno = start[0]
- state = FIND_LPAREN
- else:
- state = FIND_DOT
-
- elif state is FIND_LPAREN:
- if type is OP and token == "(":
- self.level = 1
- state = FIND_COMMA
- else:
- state = FIND_DOT
-
- elif state is FIND_COMMA:
- if type is OP:
- if token in ("(", "{", "["):
- self.level = self.level + 1
- elif token in (")", "}", "]"):
- self.level = self.level - 1
- if self.level == 0:
- state = FIND_DOT
- elif token == "," and self.level == 1:
- self.nerrors = self.nerrors + 1
- print("%s(%d):\n%s" % (self.fname, self.lineno,
- self.line))
- # don't gripe about this stmt again
- state = FIND_STMT
-
- elif state is FIND_STMT:
- if type is NEWLINE:
- state = FIND_DOT
-
- else:
- raise SystemError("unknown internal state '%r'" % (state,))
-
- self.state = state
-
-if __name__ == '__main__':
- main()
diff --git a/Tools/scripts/checkpyc.py b/Tools/scripts/checkpyc.py
index 2e8fd5a832..d4fdce2515 100755
--- a/Tools/scripts/checkpyc.py
+++ b/Tools/scripts/checkpyc.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Check that all ".pyc" files exist and are up-to-date
# Uses module 'os'
@@ -7,14 +7,17 @@ import os
from stat import ST_MTIME
import imp
+# PEP 3147 compatibility (PYC Repository Directories)
+cache_from_source = (imp.cache_from_source if hasattr(imp, 'get_tag') else
+ lambda path: path + 'c')
+
+
def main():
- silent = 0
- verbose = 0
- if sys.argv[1:]:
- if sys.argv[1] == '-v':
- verbose = 1
- elif sys.argv[1] == '-s':
- silent = 1
+ if len(sys.argv) > 1:
+ verbose = (sys.argv[1] == '-v')
+ silent = (sys.argv[1] == '-s')
+ else:
+ verbose = silent = False
MAGIC = imp.get_magic()
if not silent:
print('Using MAGIC word', repr(MAGIC))
@@ -26,9 +29,8 @@ def main():
continue
if not silent:
print('Checking ', repr(dirname), '...')
- names.sort()
- for name in names:
- if name[-3:] == '.py':
+ for name in sorted(names):
+ if name.endswith('.py'):
name = os.path.join(dirname, name)
try:
st = os.stat(name)
@@ -37,30 +39,31 @@ def main():
continue
if verbose:
print('Check', repr(name), '...')
- name_c = name + 'c'
+ name_c = cache_from_source(name)
try:
- f = open(name_c, 'r')
+ with open(name_c, 'rb') as f:
+ magic_str = f.read(4)
+ mtime_str = f.read(4)
except IOError:
print('Cannot open', repr(name_c))
continue
- magic_str = f.read(4)
- mtime_str = f.read(4)
- f.close()
if magic_str != MAGIC:
print('Bad MAGIC word in ".pyc" file', end=' ')
print(repr(name_c))
continue
mtime = get_long(mtime_str)
- if mtime == 0 or mtime == -1:
+ if mtime in {0, -1}:
print('Bad ".pyc" file', repr(name_c))
elif mtime != st[ST_MTIME]:
print('Out-of-date ".pyc" file', end=' ')
print(repr(name_c))
+
def get_long(s):
if len(s) != 4:
return -1
- return ord(s[0]) + (ord(s[1])<<8) + (ord(s[2])<<16) + (ord(s[3])<<24)
+ return s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24)
+
if __name__ == '__main__':
main()
diff --git a/Tools/scripts/classfix.py b/Tools/scripts/classfix.py
deleted file mode 100755
index 0cd1e4955f..0000000000
--- a/Tools/scripts/classfix.py
+++ /dev/null
@@ -1,190 +0,0 @@
-#! /usr/bin/env python
-
-# This script is obsolete -- it is kept for historical purposes only.
-#
-# Fix Python source files to use the new class definition syntax, i.e.,
-# the syntax used in Python versions before 0.9.8:
-# class C() = base(), base(), ...: ...
-# is changed to the current syntax:
-# class C(base, base, ...): ...
-#
-# The script uses heuristics to find class definitions that usually
-# work but occasionally can fail; carefully check the output!
-#
-# Command line arguments are files or directories to be processed.
-# Directories are searched recursively for files whose name looks
-# like a python module.
-# Symbolic links are always ignored (except as explicit directory
-# arguments). Of course, the original file is kept as a back-up
-# (with a "~" attached to its name).
-#
-# Changes made are reported to stdout in a diff-like format.
-#
-# Undoubtedly you can do this using find and sed or perl, but this is
-# a nice example of Python code that recurses down a directory tree
-# and uses regular expressions. Also note several subtleties like
-# preserving the file's mode and avoiding to even write a temp file
-# when no changes are needed for a file.
-#
-# NB: by changing only the function fixline() you can turn this
-# into a program for a different change to Python programs...
-
-import sys
-import re
-import os
-from stat import *
-
-err = sys.stderr.write
-dbg = err
-rep = sys.stdout.write
-
-def main():
- bad = 0
- if not sys.argv[1:]: # No arguments
- err('usage: ' + sys.argv[0] + ' file-or-directory ...\n')
- sys.exit(2)
- for arg in sys.argv[1:]:
- if os.path.isdir(arg):
- if recursedown(arg): bad = 1
- elif os.path.islink(arg):
- err(arg + ': will not process symbolic links\n')
- bad = 1
- else:
- if fix(arg): bad = 1
- sys.exit(bad)
-
-ispythonprog = re.compile('^[a-zA-Z0-9_]+\.py$')
-def ispython(name):
- return ispythonprog.match(name) >= 0
-
-def recursedown(dirname):
- dbg('recursedown(%r)\n' % (dirname,))
- bad = 0
- try:
- names = os.listdir(dirname)
- except os.error as msg:
- err('%s: cannot list directory: %r\n' % (dirname, msg))
- return 1
- names.sort()
- subdirs = []
- for name in names:
- if name in (os.curdir, os.pardir): continue
- fullname = os.path.join(dirname, name)
- if os.path.islink(fullname): pass
- elif os.path.isdir(fullname):
- subdirs.append(fullname)
- elif ispython(name):
- if fix(fullname): bad = 1
- for fullname in subdirs:
- if recursedown(fullname): bad = 1
- return bad
-
-def fix(filename):
-## dbg('fix(%r)\n' % (filename,))
- try:
- f = open(filename, 'r')
- except IOError as msg:
- err('%s: cannot open: %r\n' % (filename, msg))
- return 1
- head, tail = os.path.split(filename)
- tempname = os.path.join(head, '@' + tail)
- g = None
- # If we find a match, we rewind the file and start over but
- # now copy everything to a temp file.
- lineno = 0
- while 1:
- line = f.readline()
- if not line: break
- lineno = lineno + 1
- while line[-2:] == '\\\n':
- nextline = f.readline()
- if not nextline: break
- line = line + nextline
- lineno = lineno + 1
- newline = fixline(line)
- if newline != line:
- if g is None:
- try:
- g = open(tempname, 'w')
- except IOError as msg:
- f.close()
- err('%s: cannot create: %r\n' % (tempname, msg))
- return 1
- f.seek(0)
- lineno = 0
- rep(filename + ':\n')
- continue # restart from the beginning
- rep(repr(lineno) + '\n')
- rep('< ' + line)
- rep('> ' + newline)
- if g is not None:
- g.write(newline)
-
- # End of file
- f.close()
- if not g: return 0 # No changes
-
- # Finishing touch -- move files
-
- # First copy the file's mode to the temp file
- try:
- statbuf = os.stat(filename)
- os.chmod(tempname, statbuf[ST_MODE] & 0o7777)
- except os.error as msg:
- err('%s: warning: chmod failed (%r)\n' % (tempname, msg))
- # Then make a backup of the original file as filename~
- try:
- os.rename(filename, filename + '~')
- except os.error as msg:
- err('%s: warning: backup failed (%r)\n' % (filename, msg))
- # Now move the temp file to the original file
- try:
- os.rename(tempname, filename)
- except os.error as msg:
- err('%s: rename failed (%r)\n' % (filename, msg))
- return 1
- # Return succes
- return 0
-
-# This expression doesn't catch *all* class definition headers,
-# but it's pretty darn close.
-classexpr = '^([ \t]*class +[a-zA-Z0-9_]+) *( *) *((=.*)?):'
-classprog = re.compile(classexpr)
-
-# Expressions for finding base class expressions.
-baseexpr = '^ *(.*) *( *) *$'
-baseprog = re.compile(baseexpr)
-
-def fixline(line):
- if classprog.match(line) < 0: # No 'class' keyword -- no change
- return line
-
- (a0, b0), (a1, b1), (a2, b2) = classprog.regs[:3]
- # a0, b0 = Whole match (up to ':')
- # a1, b1 = First subexpression (up to classname)
- # a2, b2 = Second subexpression (=.*)
- head = line[:b1]
- tail = line[b0:] # Unmatched rest of line
-
- if a2 == b2: # No base classes -- easy case
- return head + ':' + tail
-
- # Get rid of leading '='
- basepart = line[a2+1:b2]
-
- # Extract list of base expressions
- bases = basepart.split(',')
-
- # Strip trailing '()' from each base expression
- for i in range(len(bases)):
- if baseprog.match(bases[i]) >= 0:
- x1, y1 = baseprog.regs[1]
- bases[i] = bases[i][x1:y1]
-
- # Join the bases back again and build the new line
- basepart = ', '.join(bases)
-
- return head + '(' + basepart + '):' + tail
-
-if __name__ == '__main__':
- main()
diff --git a/Tools/scripts/cleanfuture.py b/Tools/scripts/cleanfuture.py
index e6c8c8c670..b48ab60dd6 100644
--- a/Tools/scripts/cleanfuture.py
+++ b/Tools/scripts/cleanfuture.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""cleanfuture [-d][-r][-v] path ...
diff --git a/Tools/scripts/combinerefs.py b/Tools/scripts/combinerefs.py
index 68704dd7b9..e10e49ad7c 100644
--- a/Tools/scripts/combinerefs.py
+++ b/Tools/scripts/combinerefs.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""
combinerefs path
diff --git a/Tools/scripts/copytime.py b/Tools/scripts/copytime.py
index ba4a267d6f..e0220b5443 100755
--- a/Tools/scripts/copytime.py
+++ b/Tools/scripts/copytime.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Copy one file's atime and mtime to another
diff --git a/Tools/scripts/crlf.py b/Tools/scripts/crlf.py
index 3dfa131ed7..0622282f99 100755
--- a/Tools/scripts/crlf.py
+++ b/Tools/scripts/crlf.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"Replace CRLF with LF in argument files. Print names of changed files."
import sys, os
diff --git a/Tools/scripts/cvsfiles.py b/Tools/scripts/cvsfiles.py
deleted file mode 100755
index 9e65dc803d..0000000000
--- a/Tools/scripts/cvsfiles.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#! /usr/bin/env python
-
-"""Print a list of files that are mentioned in CVS directories.
-
-Usage: cvsfiles.py [-n file] [directory] ...
-
-If the '-n file' option is given, only files under CVS that are newer
-than the given file are printed; by default, all files under CVS are
-printed. As a special case, if a file does not exist, it is always
-printed.
-"""
-
-import os
-import sys
-import stat
-import getopt
-
-cutofftime = 0
-
-def main():
- try:
- opts, args = getopt.getopt(sys.argv[1:], "n:")
- except getopt.error as msg:
- print(msg)
- print(__doc__, end=' ')
- return 1
- global cutofftime
- newerfile = None
- for o, a in opts:
- if o == '-n':
- cutofftime = getmtime(a)
- if args:
- for arg in args:
- process(arg)
- else:
- process(".")
-
-def process(dir):
- cvsdir = 0
- subdirs = []
- names = os.listdir(dir)
- for name in names:
- fullname = os.path.join(dir, name)
- if name == "CVS":
- cvsdir = fullname
- else:
- if os.path.isdir(fullname):
- if not os.path.islink(fullname):
- subdirs.append(fullname)
- if cvsdir:
- entries = os.path.join(cvsdir, "Entries")
- for e in open(entries).readlines():
- words = e.split('/')
- if words[0] == '' and words[1:]:
- name = words[1]
- fullname = os.path.join(dir, name)
- if cutofftime and getmtime(fullname) <= cutofftime:
- pass
- else:
- print(fullname)
- for sub in subdirs:
- process(sub)
-
-def getmtime(filename):
- try:
- st = os.stat(filename)
- except os.error:
- return 0
- return st[stat.ST_MTIME]
-
-if __name__ == '__main__':
- main()
diff --git a/Tools/scripts/db2pickle.py b/Tools/scripts/db2pickle.py
index 9dd8bd3b72..a5532a8f3a 100644
--- a/Tools/scripts/db2pickle.py
+++ b/Tools/scripts/db2pickle.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Synopsis: %(prog)s [-h|-g|-b|-r|-a] dbfile [ picklefile ]
diff --git a/Tools/scripts/dutree.py b/Tools/scripts/dutree.py
index dbf4f1aa6c..6b4361ac61 100755
--- a/Tools/scripts/dutree.py
+++ b/Tools/scripts/dutree.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Format du output in a tree shape
import os, sys, errno
diff --git a/Tools/scripts/eptags.py b/Tools/scripts/eptags.py
index 8d35dfb31e..671ff11e65 100755
--- a/Tools/scripts/eptags.py
+++ b/Tools/scripts/eptags.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Create a TAGS file for Python programs, usable with GNU Emacs.
usage: eptags pyfiles...
diff --git a/Demo/scripts/find-uname.py b/Tools/scripts/find-uname.py
index 1902423db7..b6ec1b6d79 100644..100755
--- a/Demo/scripts/find-uname.py
+++ b/Tools/scripts/find-uname.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
For each argument on the command line, look for it in the set of all Unicode
diff --git a/Tools/scripts/find_recursionlimit.py b/Tools/scripts/find_recursionlimit.py
index 6f75d6da8b..443f052c4e 100644
--- a/Tools/scripts/find_recursionlimit.py
+++ b/Tools/scripts/find_recursionlimit.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Find the maximum recursion limit that prevents interpreter termination.
This script finds the maximum safe recursion limit on a particular
diff --git a/Tools/scripts/finddiv.py b/Tools/scripts/finddiv.py
index 558791fcc0..f24a702966 100755
--- a/Tools/scripts/finddiv.py
+++ b/Tools/scripts/finddiv.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""finddiv - a grep-like tool that looks for division operators.
diff --git a/Tools/scripts/findlinksto.py b/Tools/scripts/findlinksto.py
index d3da7e4e11..b4c09ef1ce 100755
--- a/Tools/scripts/findlinksto.py
+++ b/Tools/scripts/findlinksto.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# findlinksto
#
diff --git a/Tools/scripts/findnocoding.py b/Tools/scripts/findnocoding.py
index 78fc8efeba..77607ce137 100755
--- a/Tools/scripts/findnocoding.py
+++ b/Tools/scripts/findnocoding.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""List all those Python files that require a coding directive
diff --git a/Tools/scripts/fixcid.py b/Tools/scripts/fixcid.py
index b21a8365f2..2d4cd1ab00 100755
--- a/Tools/scripts/fixcid.py
+++ b/Tools/scripts/fixcid.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Perform massive identifier substitution on C source files.
# This actually tokenizes the files (to some extent) so it can
diff --git a/Tools/scripts/fixdiv.py b/Tools/scripts/fixdiv.py
index 8b15cc6595..4ecbea15e8 100755
--- a/Tools/scripts/fixdiv.py
+++ b/Tools/scripts/fixdiv.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""fixdiv - tool to fix division operators.
diff --git a/Tools/scripts/fixheader.py b/Tools/scripts/fixheader.py
index 1208031357..ec840575b2 100755
--- a/Tools/scripts/fixheader.py
+++ b/Tools/scripts/fixheader.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Add some standard cpp magic to a header file
diff --git a/Tools/scripts/fixnotice.py b/Tools/scripts/fixnotice.py
index d35a339af5..aac8697708 100755
--- a/Tools/scripts/fixnotice.py
+++ b/Tools/scripts/fixnotice.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""(Ostensibly) fix copyright notices in files.
diff --git a/Tools/scripts/fixps.py b/Tools/scripts/fixps.py
index fd2ca71496..b002261206 100755
--- a/Tools/scripts/fixps.py
+++ b/Tools/scripts/fixps.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Fix Python script(s) to reference the interpreter via /usr/bin/env python.
# Warning: this overwrites the file without making a backup.
diff --git a/Tools/scripts/ftpmirror.py b/Tools/scripts/ftpmirror.py
index b79db1ac5c..9e8be1daf8 100755
--- a/Tools/scripts/ftpmirror.py
+++ b/Tools/scripts/ftpmirror.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Mirror a remote ftp subtree into a local directory tree.
diff --git a/Tools/ssl/get-remote-certificate.py b/Tools/scripts/get-remote-certificate.py
index ab851efdf8..5811f202ed 100644
--- a/Tools/ssl/get-remote-certificate.py
+++ b/Tools/scripts/get-remote-certificate.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# fetch the certificate that the server(s) are providing in PEM form
#
@@ -8,7 +8,6 @@
import re
import os
-import ssl
import sys
import tempfile
@@ -38,7 +37,8 @@ def fetch_server_certificate (host, port):
status, output = subproc(r'openssl x509 -in "%s" -out "%s"' %
(tn, tn2))
if status != 0:
- raise OperationError(status, tsig, output)
+ raise RuntimeError('OpenSSL x509 failed with status %s and '
+ 'output: %r' % (status, output))
fp = open(tn2, 'rb')
data = fp.read()
fp.close()
@@ -63,7 +63,8 @@ def fetch_server_certificate (host, port):
'openssl s_client -connect "%s:%s" -showcerts < /dev/null' %
(host, port))
if status != 0:
- raise OSError(status)
+ raise RuntimeError('OpenSSL connect failed with status %s and '
+ 'output: %r' % (status, output))
certtext = strip_to_x509_cert(output)
if not certtext:
raise ValueError("Invalid response received from server at %s:%s" %
diff --git a/Tools/scripts/google.py b/Tools/scripts/google.py
index 6219c2d4bc..12152bb5f8 100755
--- a/Tools/scripts/google.py
+++ b/Tools/scripts/google.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
import sys, webbrowser
diff --git a/Tools/scripts/gprof2html.py b/Tools/scripts/gprof2html.py
index cb01c2ce68..f3c720299a 100755
--- a/Tools/scripts/gprof2html.py
+++ b/Tools/scripts/gprof2html.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2.3
+#! /usr/bin/env python32.3
"""Transform gprof(1) output into useful HTML."""
diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
index 9b5b6971f9..45aa439075 100755
--- a/Tools/scripts/h2py.py
+++ b/Tools/scripts/h2py.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Read #define's and translate to Python code.
# Handle #include statements.
@@ -49,13 +49,7 @@ except KeyError:
try:
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
- try:
- if sys.platform.startswith("atheos"):
- searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
- else:
- raise KeyError
- except KeyError:
- searchdirs=['/usr/include']
+ searchdirs=['/usr/include']
def main():
global filedict
diff --git a/Tools/scripts/ifdef.py b/Tools/scripts/ifdef.py
index 2ed7a6667b..46167ad843 100755
--- a/Tools/scripts/ifdef.py
+++ b/Tools/scripts/ifdef.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Selectively preprocess #ifdef / #ifndef statements.
# Usage:
diff --git a/Tools/scripts/lfcr.py b/Tools/scripts/lfcr.py
index 1b9a5b7d1f..d0940223c7 100755
--- a/Tools/scripts/lfcr.py
+++ b/Tools/scripts/lfcr.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"Replace LF with CRLF in argument files. Print names of changed files."
diff --git a/Tools/scripts/linktree.py b/Tools/scripts/linktree.py
index 748b0424bb..982f4800ba 100755
--- a/Tools/scripts/linktree.py
+++ b/Tools/scripts/linktree.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# linktree
#
diff --git a/Tools/scripts/lll.py b/Tools/scripts/lll.py
index 5ee1504db5..aa4e55091e 100755
--- a/Tools/scripts/lll.py
+++ b/Tools/scripts/lll.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Find symbolic links and show where they point to.
# Arguments are directories to search; default is current directory.
diff --git a/Tools/scripts/logmerge.py b/Tools/scripts/logmerge.py
deleted file mode 100755
index 06750b0c2b..0000000000
--- a/Tools/scripts/logmerge.py
+++ /dev/null
@@ -1,185 +0,0 @@
-#! /usr/bin/env python
-
-"""Consolidate a bunch of CVS or RCS logs read from stdin.
-
-Input should be the output of a CVS or RCS logging command, e.g.
-
- cvs log -rrelease14:
-
-which dumps all log messages from release1.4 upwards (assuming that
-release 1.4 was tagged with tag 'release14'). Note the trailing
-colon!
-
-This collects all the revision records and outputs them sorted by date
-rather than by file, collapsing duplicate revision record, i.e.,
-records with the same message for different files.
-
-The -t option causes it to truncate (discard) the last revision log
-entry; this is useful when using something like the above cvs log
-command, which shows the revisions including the given tag, while you
-probably want everything *since* that tag.
-
-The -r option reverses the output (oldest first; the default is oldest
-last).
-
-The -b tag option restricts the output to *only* checkin messages
-belonging to the given branch tag. The form -b HEAD restricts the
-output to checkin messages belonging to the CVS head (trunk). (It
-produces some output if tag is a non-branch tag, but this output is
-not very useful.)
-
--h prints this message and exits.
-
-XXX This code was created by reverse engineering CVS 1.9 and RCS 5.7
-from their output.
-"""
-
-import sys, errno, getopt, re
-
-sep1 = '='*77 + '\n' # file separator
-sep2 = '-'*28 + '\n' # revision separator
-
-def main():
- """Main program"""
- truncate_last = 0
- reverse = 0
- branch = None
- opts, args = getopt.getopt(sys.argv[1:], "trb:h")
- for o, a in opts:
- if o == '-t':
- truncate_last = 1
- elif o == '-r':
- reverse = 1
- elif o == '-b':
- branch = a
- elif o == '-h':
- print(__doc__)
- sys.exit(0)
- database = []
- while 1:
- chunk = read_chunk(sys.stdin)
- if not chunk:
- break
- records = digest_chunk(chunk, branch)
- if truncate_last:
- del records[-1]
- database[len(database):] = records
- database.sort()
- if not reverse:
- database.reverse()
- format_output(database)
-
-def read_chunk(fp):
- """Read a chunk -- data for one file, ending with sep1.
-
- Split the chunk in parts separated by sep2.
-
- """
- chunk = []
- lines = []
- while 1:
- line = fp.readline()
- if not line:
- break
- if line == sep1:
- if lines:
- chunk.append(lines)
- break
- if line == sep2:
- if lines:
- chunk.append(lines)
- lines = []
- else:
- lines.append(line)
- return chunk
-
-def digest_chunk(chunk, branch=None):
- """Digest a chunk -- extract working file name and revisions"""
- lines = chunk[0]
- key = 'Working file:'
- keylen = len(key)
- for line in lines:
- if line[:keylen] == key:
- working_file = line[keylen:].strip()
- break
- else:
- working_file = None
- if branch is None:
- pass
- elif branch == "HEAD":
- branch = re.compile(r"^\d+\.\d+$")
- else:
- revisions = {}
- key = 'symbolic names:\n'
- found = 0
- for line in lines:
- if line == key:
- found = 1
- elif found:
- if line[0] in '\t ':
- tag, rev = line.split()
- if tag[-1] == ':':
- tag = tag[:-1]
- revisions[tag] = rev
- else:
- found = 0
- rev = revisions.get(branch)
- branch = re.compile(r"^<>$") # <> to force a mismatch by default
- if rev:
- if rev.find('.0.') >= 0:
- rev = rev.replace('.0.', '.')
- branch = re.compile(r"^" + re.escape(rev) + r"\.\d+$")
- records = []
- for lines in chunk[1:]:
- revline = lines[0]
- dateline = lines[1]
- text = lines[2:]
- words = dateline.split()
- author = None
- if len(words) >= 3 and words[0] == 'date:':
- dateword = words[1]
- timeword = words[2]
- if timeword[-1:] == ';':
- timeword = timeword[:-1]
- date = dateword + ' ' + timeword
- if len(words) >= 5 and words[3] == 'author:':
- author = words[4]
- if author[-1:] == ';':
- author = author[:-1]
- else:
- date = None
- text.insert(0, revline)
- words = revline.split()
- if len(words) >= 2 and words[0] == 'revision':
- rev = words[1]
- else:
- # No 'revision' line -- weird...
- rev = None
- text.insert(0, revline)
- if branch:
- if rev is None or not branch.match(rev):
- continue
- records.append((date, working_file, rev, author, text))
- return records
-
-def format_output(database):
- prevtext = None
- prev = []
- database.append((None, None, None, None, None)) # Sentinel
- for (date, working_file, rev, author, text) in database:
- if text != prevtext:
- if prev:
- print(sep2, end=' ')
- for (p_date, p_working_file, p_rev, p_author) in prev:
- print(p_date, p_author, p_working_file, p_rev)
- sys.stdout.writelines(prevtext)
- prev = []
- prev.append((date, working_file, rev, author))
- prevtext = text
-
-if __name__ == '__main__':
- try:
- main()
- except IOError as e:
- if e.errno != errno.EPIPE:
- raise
diff --git a/Tools/scripts/md5sum.py b/Tools/scripts/md5sum.py
index 140c0b3e1a..743da72aa8 100644
--- a/Tools/scripts/md5sum.py
+++ b/Tools/scripts/md5sum.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Python utility to print MD5 checksums of argument files.
"""
diff --git a/Tools/scripts/methfix.py b/Tools/scripts/methfix.py
deleted file mode 100755
index f5fe7cd6ec..0000000000
--- a/Tools/scripts/methfix.py
+++ /dev/null
@@ -1,171 +0,0 @@
-#! /usr/bin/env python
-
-# Fix Python source files to avoid using
-# def method(self, (arg1, ..., argn)):
-# instead of the more rational
-# def method(self, arg1, ..., argn):
-#
-# Command line arguments are files or directories to be processed.
-# Directories are searched recursively for files whose name looks
-# like a python module.
-# Symbolic links are always ignored (except as explicit directory
-# arguments). Of course, the original file is kept as a back-up
-# (with a "~" attached to its name).
-# It complains about binaries (files containing null bytes)
-# and about files that are ostensibly not Python files: if the first
-# line starts with '#!' and does not contain the string 'python'.
-#
-# Changes made are reported to stdout in a diff-like format.
-#
-# Undoubtedly you can do this using find and sed or perl, but this is
-# a nice example of Python code that recurses down a directory tree
-# and uses regular expressions. Also note several subtleties like
-# preserving the file's mode and avoiding to even write a temp file
-# when no changes are needed for a file.
-#
-# NB: by changing only the function fixline() you can turn this
-# into a program for a different change to Python programs...
-
-import sys
-import re
-import os
-from stat import *
-
-err = sys.stderr.write
-dbg = err
-rep = sys.stdout.write
-
-def main():
- bad = 0
- if not sys.argv[1:]: # No arguments
- err('usage: ' + sys.argv[0] + ' file-or-directory ...\n')
- sys.exit(2)
- for arg in sys.argv[1:]:
- if os.path.isdir(arg):
- if recursedown(arg): bad = 1
- elif os.path.islink(arg):
- err(arg + ': will not process symbolic links\n')
- bad = 1
- else:
- if fix(arg): bad = 1
- sys.exit(bad)
-
-ispythonprog = re.compile('^[a-zA-Z0-9_]+\.py$')
-def ispython(name):
- return ispythonprog.match(name) >= 0
-
-def recursedown(dirname):
- dbg('recursedown(%r)\n' % (dirname,))
- bad = 0
- try:
- names = os.listdir(dirname)
- except os.error as msg:
- err('%s: cannot list directory: %r\n' % (dirname, msg))
- return 1
- names.sort()
- subdirs = []
- for name in names:
- if name in (os.curdir, os.pardir): continue
- fullname = os.path.join(dirname, name)
- if os.path.islink(fullname): pass
- elif os.path.isdir(fullname):
- subdirs.append(fullname)
- elif ispython(name):
- if fix(fullname): bad = 1
- for fullname in subdirs:
- if recursedown(fullname): bad = 1
- return bad
-
-def fix(filename):
-## dbg('fix(%r)\n' % (filename,))
- try:
- f = open(filename, 'r')
- except IOError as msg:
- err('%s: cannot open: %r\n' % (filename, msg))
- return 1
- head, tail = os.path.split(filename)
- tempname = os.path.join(head, '@' + tail)
- g = None
- # If we find a match, we rewind the file and start over but
- # now copy everything to a temp file.
- lineno = 0
- while 1:
- line = f.readline()
- if not line: break
- lineno = lineno + 1
- if g is None and '\0' in line:
- # Check for binary files
- err(filename + ': contains null bytes; not fixed\n')
- f.close()
- return 1
- if lineno == 1 and g is None and line[:2] == '#!':
- # Check for non-Python scripts
- words = line[2:].split()
- if words and re.search('[pP]ython', words[0]) < 0:
- msg = filename + ': ' + words[0]
- msg = msg + ' script; not fixed\n'
- err(msg)
- f.close()
- return 1
- while line[-2:] == '\\\n':
- nextline = f.readline()
- if not nextline: break
- line = line + nextline
- lineno = lineno + 1
- newline = fixline(line)
- if newline != line:
- if g is None:
- try:
- g = open(tempname, 'w')
- except IOError as msg:
- f.close()
- err('%s: cannot create: %r\n' % (tempname, msg))
- return 1
- f.seek(0)
- lineno = 0
- rep(filename + ':\n')
- continue # restart from the beginning
- rep(repr(lineno) + '\n')
- rep('< ' + line)
- rep('> ' + newline)
- if g is not None:
- g.write(newline)
-
- # End of file
- f.close()
- if not g: return 0 # No changes
-
- # Finishing touch -- move files
-
- # First copy the file's mode to the temp file
- try:
- statbuf = os.stat(filename)
- os.chmod(tempname, statbuf[ST_MODE] & 0o7777)
- except os.error as msg:
- err('%s: warning: chmod failed (%r)\n' % (tempname, msg))
- # Then make a backup of the original file as filename~
- try:
- os.rename(filename, filename + '~')
- except os.error as msg:
- err('%s: warning: backup failed (%r)\n' % (filename, msg))
- # Now move the temp file to the original file
- try:
- os.rename(tempname, filename)
- except os.error as msg:
- err('%s: rename failed (%r)\n' % (filename, msg))
- return 1
- # Return succes
- return 0
-
-
-fixpat = '^[ \t]+def +[a-zA-Z0-9_]+ *( *self *, *(( *(.*) *)) *) *:'
-fixprog = re.compile(fixpat)
-
-def fixline(line):
- if fixprog.match(line) >= 0:
- (a, b), (c, d) = fixprog.regs[1:3]
- line = line[:a] + line[c:d] + line[b:]
- return line
-
-if __name__ == '__main__':
- main()
diff --git a/Tools/scripts/mkreal.py b/Tools/scripts/mkreal.py
index 8bc2ec1956..b21909e691 100755
--- a/Tools/scripts/mkreal.py
+++ b/Tools/scripts/mkreal.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# mkreal
#
diff --git a/Tools/scripts/ndiff.py b/Tools/scripts/ndiff.py
index c60c8a83ec..2422091dcc 100755
--- a/Tools/scripts/ndiff.py
+++ b/Tools/scripts/ndiff.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Module ndiff version 1.7.0
# Released to the public domain 08-Dec-2000,
diff --git a/Tools/scripts/nm2def.py b/Tools/scripts/nm2def.py
index 9dfb99143f..8f07559e21 100755
--- a/Tools/scripts/nm2def.py
+++ b/Tools/scripts/nm2def.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""nm2def.py
Helpers to extract symbols from Unix libs and auto-generate
diff --git a/Tools/scripts/objgraph.py b/Tools/scripts/objgraph.py
index 0975a3bbcd..1e1fce07dd 100755
--- a/Tools/scripts/objgraph.py
+++ b/Tools/scripts/objgraph.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# objgraph
#
diff --git a/Tools/scripts/parseentities.py b/Tools/scripts/parseentities.py
index 8d93167ed8..5b0f1c6741 100755
--- a/Tools/scripts/parseentities.py
+++ b/Tools/scripts/parseentities.py
@@ -1,4 +1,4 @@
-#!/usr/local/bin/python
+#!/usr/bin/env python3
""" Utility for parsing HTML entity definitions available from:
http://www.w3.org/ as e.g.
diff --git a/Tools/scripts/pathfix.py b/Tools/scripts/pathfix.py
index 6cbac10ecb..dd08e0aba3 100755
--- a/Tools/scripts/pathfix.py
+++ b/Tools/scripts/pathfix.py
@@ -30,20 +30,24 @@ dbg = err
rep = sys.stdout.write
new_interpreter = None
+preserve_timestamps = False
def main():
global new_interpreter
- usage = ('usage: %s -i /interpreter file-or-directory ...\n' %
+ global preserve_timestamps
+ usage = ('usage: %s -i /interpreter -p file-or-directory ...\n' %
sys.argv[0])
try:
- opts, args = getopt.getopt(sys.argv[1:], 'i:')
+ opts, args = getopt.getopt(sys.argv[1:], 'i:p')
except getopt.error as msg:
- err(msg + '\n')
+ err(str(msg) + '\n')
err(usage)
sys.exit(2)
for o, a in opts:
if o == '-i':
new_interpreter = a.encode()
+ if o == '-p':
+ preserve_timestamps = True
if not new_interpreter or not new_interpreter.startswith(b'/') or \
not args:
err('-i option or file-or-directory missing\n')
@@ -119,9 +123,13 @@ def fix(filename):
# Finishing touch -- move files
+ mtime = None
+ atime = None
# First copy the file's mode to the temp file
try:
statbuf = os.stat(filename)
+ mtime = statbuf.st_mtime
+ atime = statbuf.st_atime
os.chmod(tempname, statbuf[ST_MODE] & 0o7777)
except os.error as msg:
err('%s: warning: chmod failed (%r)\n' % (tempname, msg))
@@ -136,6 +144,13 @@ def fix(filename):
except os.error as msg:
err('%s: rename failed (%r)\n' % (filename, msg))
return 1
+ if preserve_timestamps:
+ if atime and mtime:
+ try:
+ os.utime(filename, (atime, mtime))
+ except os.error as msg:
+ err('%s: reset of timestamp failed (%r)\n' % (filename, msg))
+ return 1
# Return succes
return 0
diff --git a/Tools/scripts/pdeps.py b/Tools/scripts/pdeps.py
index 5c5a05b9ad..938f31c164 100755
--- a/Tools/scripts/pdeps.py
+++ b/Tools/scripts/pdeps.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# pdeps
#
diff --git a/Tools/scripts/pickle2db.py b/Tools/scripts/pickle2db.py
index a43ffae448..b5b6571863 100644
--- a/Tools/scripts/pickle2db.py
+++ b/Tools/scripts/pickle2db.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Synopsis: %(prog)s [-h|-b|-g|-r|-a|-d] [ picklefile ] dbfile
diff --git a/Tools/scripts/pindent.py b/Tools/scripts/pindent.py
index 3f3000d90c..15b6399f79 100755
--- a/Tools/scripts/pindent.py
+++ b/Tools/scripts/pindent.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# This file contains a class and a main program that perform three
# related (though complimentary) formatting operations on Python
@@ -88,10 +88,10 @@ next = {}
next['if'] = next['elif'] = 'elif', 'else', 'end'
next['while'] = next['for'] = 'else', 'end'
next['try'] = 'except', 'finally'
-next['except'] = 'except', 'else', 'end'
+next['except'] = 'except', 'else', 'finally', 'end'
next['else'] = next['finally'] = next['def'] = next['class'] = 'end'
next['end'] = ()
-start = 'if', 'while', 'for', 'try', 'def', 'class'
+start = 'if', 'while', 'for', 'try', 'with', 'def', 'class'
class PythonIndenter:
diff --git a/Tools/scripts/ptags.py b/Tools/scripts/ptags.py
index ac01356076..ca643b3494 100755
--- a/Tools/scripts/ptags.py
+++ b/Tools/scripts/ptags.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# ptags
#
diff --git a/Tools/scripts/pysource.py b/Tools/scripts/pysource.py
index 05c2b8667f..048131e243 100644
--- a/Tools/scripts/pysource.py
+++ b/Tools/scripts/pysource.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""\
List python source files.
diff --git a/Tools/scripts/reindent.py b/Tools/scripts/reindent.py
index 8557b5debd..bb4152076b 100755
--- a/Tools/scripts/reindent.py
+++ b/Tools/scripts/reindent.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Released to the public domain, by Tim Peters, 03 October 2000.
@@ -42,26 +42,27 @@ you'd prefer. You can always use the --nobackup option to prevent this.
__version__ = "1"
import tokenize
-import os, shutil
+import os
+import shutil
import sys
-verbose = 0
-recurse = 0
-dryrun = 0
+verbose = False
+recurse = False
+dryrun = False
makebackup = True
+
def usage(msg=None):
- if msg is not None:
- print(msg, file=sys.stderr)
- print(__doc__, file=sys.stderr)
+ if msg is None:
+ msg = __doc__
+ print(msg, file=sys.stderr)
+
def errprint(*args):
- sep = ""
- for arg in args:
- sys.stderr.write(sep + str(arg))
- sep = " "
+ sys.stderr.write(" ".join(str(arg) for arg in args))
sys.stderr.write("\n")
+
def main():
import getopt
global verbose, recurse, dryrun, makebackup
@@ -73,13 +74,13 @@ def main():
return
for o, a in opts:
if o in ('-d', '--dryrun'):
- dryrun += 1
+ dryrun = True
elif o in ('-r', '--recurse'):
- recurse += 1
+ recurse = True
elif o in ('-n', '--nobackup'):
makebackup = False
elif o in ('-v', '--verbose'):
- verbose += 1
+ verbose = True
elif o in ('-h', '--help'):
usage()
return
@@ -91,6 +92,7 @@ def main():
for arg in args:
check(arg)
+
def check(file):
if os.path.isdir(file) and not os.path.islink(file):
if verbose:
@@ -107,14 +109,15 @@ def check(file):
if verbose:
print("checking", file, "...", end=' ')
+ with open(file, 'rb') as f:
+ encoding, _ = tokenize.detect_encoding(f.readline)
try:
- f = open(file)
+ with open(file, encoding=encoding) as f:
+ r = Reindenter(f)
except IOError as msg:
errprint("%s: I/O Error: %s" % (file, str(msg)))
return
- r = Reindenter(f)
- f.close()
if r.run():
if verbose:
print("changed.")
@@ -126,9 +129,8 @@ def check(file):
shutil.copyfile(file, bak)
if verbose:
print("backed up", file, "to", bak)
- f = open(file, "w")
- r.write(f)
- f.close()
+ with open(file, "w", encoding=encoding) as f:
+ r.write(f)
if verbose:
print("wrote new", file)
return True
@@ -137,6 +139,7 @@ def check(file):
print("unchanged.")
return False
+
def _rstrip(line, JUNK='\n \t'):
"""Return line stripped of trailing spaces, tabs, newlines.
@@ -146,10 +149,11 @@ def _rstrip(line, JUNK='\n \t'):
"""
i = len(line)
- while i > 0 and line[i-1] in JUNK:
+ while i > 0 and line[i - 1] in JUNK:
i -= 1
return line[:i]
+
class Reindenter:
def __init__(self, f):
@@ -192,9 +196,9 @@ class Reindenter:
# we see a line with *something* on it.
i = stats[0][0]
after.extend(lines[1:i])
- for i in range(len(stats)-1):
+ for i in range(len(stats) - 1):
thisstmt, thislevel = stats[i]
- nextstmt = stats[i+1][0]
+ nextstmt = stats[i + 1][0]
have = getlspace(lines[thisstmt])
want = thislevel * 4
if want < 0:
@@ -206,7 +210,7 @@ class Reindenter:
want = have2want.get(have, -1)
if want < 0:
# Then it probably belongs to the next real stmt.
- for j in range(i+1, len(stats)-1):
+ for j in range(i + 1, len(stats) - 1):
jline, jlevel = stats[j]
if jlevel >= 0:
if have == getlspace(lines[jline]):
@@ -216,11 +220,11 @@ class Reindenter:
# comment like this one,
# in which case we should shift it like its base
# line got shifted.
- for j in range(i-1, -1, -1):
+ for j in range(i - 1, -1, -1):
jline, jlevel = stats[j]
if jlevel >= 0:
- want = have + getlspace(after[jline-1]) - \
- getlspace(lines[jline])
+ want = have + (getlspace(after[jline - 1]) -
+ getlspace(lines[jline]))
break
if want < 0:
# Still no luck -- leave it alone.
@@ -295,6 +299,7 @@ class Reindenter:
if line: # not endmarker
self.stats.append((slinecol[0], self.level))
+
# Count number of leading blanks.
def getlspace(line):
i, n = 0, len(line)
@@ -302,5 +307,6 @@ def getlspace(line):
i += 1
return i
+
if __name__ == '__main__':
main()
diff --git a/Tools/scripts/rgrep.py b/Tools/scripts/rgrep.py
index 12d736e2a1..1917e05e49 100755
--- a/Tools/scripts/rgrep.py
+++ b/Tools/scripts/rgrep.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Reverse grep.
@@ -9,8 +9,9 @@ import sys
import re
import getopt
+
def main():
- bufsize = 64*1024
+ bufsize = 64 * 1024
reflags = 0
opts, args = getopt.getopt(sys.argv[1:], "i")
for o, a in opts:
@@ -24,11 +25,11 @@ def main():
try:
prog = re.compile(pattern, reflags)
except re.error as msg:
- usage("error in regular expression: %s" % str(msg))
+ usage("error in regular expression: %s" % msg)
try:
f = open(filename)
except IOError as msg:
- usage("can't open %s: %s" % (repr(filename), str(msg)), 1)
+ usage("can't open %r: %s" % (filename, msg), 1)
f.seek(0, 2)
pos = f.tell()
leftover = None
@@ -49,16 +50,17 @@ def main():
del lines[0]
else:
leftover = None
- lines.reverse()
- for line in lines:
+ for line in reversed(lines):
if prog.search(line):
print(line)
+
def usage(msg, code=2):
sys.stdout = sys.stderr
print(msg)
print(__doc__)
sys.exit(code)
+
if __name__ == '__main__':
main()
diff --git a/Tools/scripts/serve.py b/Tools/scripts/serve.py
new file mode 100755
index 0000000000..89b3d6218f
--- /dev/null
+++ b/Tools/scripts/serve.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+'''
+Small wsgiref based web server. Takes a path to serve from and an
+optional port number (defaults to 8000), then tries to serve files.
+Mime types are guessed from the file names, 404 errors are thrown
+if the file is not found. Used for the make serve target in Doc.
+'''
+import sys
+import os
+import mimetypes
+from wsgiref import simple_server, util
+
+def app(environ, respond):
+
+ fn = os.path.join(path, environ['PATH_INFO'][1:])
+ if '.' not in fn.split(os.path.sep)[-1]:
+ fn = os.path.join(fn, 'index.html')
+ type = mimetypes.guess_type(fn)[0]
+
+ if os.path.exists(fn):
+ respond('200 OK', [('Content-Type', type)])
+ return util.FileWrapper(open(fn, "rb"))
+ else:
+ respond('404 Not Found', [('Content-Type', 'text/plain')])
+ return ['not found']
+
+if __name__ == '__main__':
+ path = sys.argv[1]
+ port = int(sys.argv[2]) if len(sys.argv) > 2 else 8000
+ httpd = simple_server.make_server('', port, app)
+ print("Serving {} on port {}, control-C to stop".format(path, port))
+ try:
+ httpd.serve_forever()
+ except KeyboardInterrupt:
+ print("\b\bShutting down.")
diff --git a/Tools/scripts/setup.py b/Tools/scripts/setup.py
deleted file mode 100644
index 7a50368eac..0000000000
--- a/Tools/scripts/setup.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from distutils.core import setup
-
-if __name__ == '__main__':
- setup(
- scripts=[
- 'byteyears.py',
- 'checkpyc.py',
- 'copytime.py',
- 'crlf.py',
- 'dutree.py',
- 'ftpmirror.py',
- 'h2py.py',
- 'lfcr.py',
- '../i18n/pygettext.py',
- 'logmerge.py',
- '../../Lib/tabnanny.py',
- '../../Lib/timeit.py',
- 'untabify.py',
- ],
- )
diff --git a/Tools/scripts/suff.py b/Tools/scripts/suff.py
index 462ec32183..0eea0d7548 100755
--- a/Tools/scripts/suff.py
+++ b/Tools/scripts/suff.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# suff
#
@@ -6,24 +6,21 @@
import sys
+
def main():
files = sys.argv[1:]
suffixes = {}
for filename in files:
suff = getsuffix(filename)
- if suff not in suffixes:
- suffixes[suff] = []
- suffixes[suff].append(filename)
- keys = sorted(suffixes.keys())
- for suff in keys:
- print(repr(suff), len(suffixes[suff]))
+ suffixes.setdefault(suff, []).append(filename)
+ for suff, filenames in sorted(suffixes.items()):
+ print(repr(suff), len(filenames))
+
def getsuffix(filename):
- suff = ''
- for i in range(len(filename)):
- if filename[i] == '.':
- suff = filename[i:]
- return suff
+ name, sep, suff = filename.rpartition('.')
+ return sep + suff if sep else ''
+
if __name__ == '__main__':
main()
diff --git a/Tools/scripts/svneol.py b/Tools/scripts/svneol.py
index 9357c7ed8d..8abdd01529 100644
--- a/Tools/scripts/svneol.py
+++ b/Tools/scripts/svneol.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""
SVN helper script.
@@ -32,9 +32,12 @@ and for a file with a binary mime-type property:
import re
import os
+import sys
+import subprocess
+
def propfiles(root, fn):
- default = os.path.join(root, ".svn", "props", fn+".svn-work")
+ default = os.path.join(root, ".svn", "props", fn + ".svn-work")
try:
format = int(open(os.path.join(root, ".svn", "format")).read().strip())
except IOError:
@@ -42,12 +45,13 @@ def propfiles(root, fn):
if format in (8, 9):
# In version 8 and 9, committed props are stored in prop-base, local
# modifications in props
- return [os.path.join(root, ".svn", "prop-base", fn+".svn-base"),
- os.path.join(root, ".svn", "props", fn+".svn-work")]
- raise ValueError, "Unknown repository format"
+ return [os.path.join(root, ".svn", "prop-base", fn + ".svn-base"),
+ os.path.join(root, ".svn", "props", fn + ".svn-work")]
+ raise ValueError("Unknown repository format")
+
def proplist(root, fn):
- "Return a list of property names for file fn in directory root"
+ """Return a list of property names for file fn in directory root."""
result = []
for path in propfiles(root, fn):
try:
@@ -56,7 +60,7 @@ def proplist(root, fn):
# no properties file: not under version control,
# or no properties set
continue
- while 1:
+ while True:
# key-value pairs, of the form
# K <length>
# <keyname>NL
@@ -79,13 +83,32 @@ def proplist(root, fn):
f.close()
return result
+
+def set_eol_native(path):
+ cmd = 'svn propset svn:eol-style native "{}"'.format(path)
+ propset = subprocess.Popen(cmd, shell=True)
+ propset.wait()
+
+
possible_text_file = re.compile(r"\.([hc]|py|txt|sln|vcproj)$").search
-for root, dirs, files in os.walk('.'):
- if '.svn' in dirs:
- dirs.remove('.svn')
- for fn in files:
- if possible_text_file(fn):
+
+def main():
+ for arg in sys.argv[1:] or [os.curdir]:
+ if os.path.isfile(arg):
+ root, fn = os.path.split(arg)
if 'svn:eol-style' not in proplist(root, fn):
- path = os.path.join(root, fn)
- os.system('svn propset svn:eol-style native "%s"' % path)
+ set_eol_native(arg)
+ elif os.path.isdir(arg):
+ for root, dirs, files in os.walk(arg):
+ if '.svn' in dirs:
+ dirs.remove('.svn')
+ for fn in files:
+ if possible_text_file(fn):
+ if 'svn:eol-style' not in proplist(root, fn):
+ path = os.path.join(root, fn)
+ set_eol_native(path)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/Tools/scripts/texi2html.py b/Tools/scripts/texi2html.py
index 86229f2ad3..af2147a76b 100755
--- a/Tools/scripts/texi2html.py
+++ b/Tools/scripts/texi2html.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Convert GNU texinfo files into HTML, one file per node.
# Based on Texinfo 2.14.
diff --git a/Tools/scripts/treesync.py b/Tools/scripts/treesync.py
index 8643ee73ba..b2649c474e 100755
--- a/Tools/scripts/treesync.py
+++ b/Tools/scripts/treesync.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Script to synchronize two source trees.
diff --git a/Tools/scripts/untabify.py b/Tools/scripts/untabify.py
index 1f455208ee..4b67c15154 100755
--- a/Tools/scripts/untabify.py
+++ b/Tools/scripts/untabify.py
@@ -1,10 +1,11 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"Replace tabs with spaces in argument files. Print names of changed files."
import os
import sys
import getopt
+import tokenize
def main():
tabsize = 8
@@ -23,11 +24,12 @@ def main():
for filename in args:
process(filename, tabsize)
+
def process(filename, tabsize, verbose=True):
try:
- f = open(filename)
- text = f.read()
- f.close()
+ with tokenize.open(filename) as f:
+ text = f.read()
+ encoding = f.encoding
except IOError as msg:
print("%r: I/O error: %s" % (filename, msg))
return
@@ -43,11 +45,11 @@ def process(filename, tabsize, verbose=True):
os.rename(filename, backup)
except os.error:
pass
- f = open(filename, "w")
- f.write(newtext)
- f.close()
+ with open(filename, "w", encoding=encoding) as f:
+ f.write(newtext)
if verbose:
print(filename)
+
if __name__ == '__main__':
main()
diff --git a/Tools/scripts/which.py b/Tools/scripts/which.py
index a9f4907812..4fc37a027c 100755
--- a/Tools/scripts/which.py
+++ b/Tools/scripts/which.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# Variant of "which".
# On stderr, near and total misses are reported.
diff --git a/Tools/scripts/xxci.py b/Tools/scripts/xxci.py
deleted file mode 100755
index 8cffc9e11b..0000000000
--- a/Tools/scripts/xxci.py
+++ /dev/null
@@ -1,121 +0,0 @@
-#! /usr/bin/env python
-
-# xxci
-#
-# check in files for which rcsdiff returns nonzero exit status
-
-import sys
-import os
-from stat import *
-import fnmatch
-
-EXECMAGIC = '\001\140\000\010'
-
-MAXSIZE = 200*1024 # Files this big must be binaries and are skipped.
-
-def getargs():
- args = sys.argv[1:]
- if args:
- return args
- print('No arguments, checking almost *, in "ls -t" order')
- list = []
- for file in os.listdir(os.curdir):
- if not skipfile(file):
- list.append((getmtime(file), file))
- list.sort()
- if not list:
- print('Nothing to do -- exit 1')
- sys.exit(1)
- list.sort()
- list.reverse()
- for mtime, file in list: args.append(file)
- return args
-
-def getmtime(file):
- try:
- st = os.stat(file)
- return st[ST_MTIME]
- except os.error:
- return -1
-
-badnames = ['tags', 'TAGS', 'xyzzy', 'nohup.out', 'core']
-badprefixes = ['.', ',', '@', '#', 'o.']
-badsuffixes = \
- ['~', '.a', '.o', '.old', '.bak', '.orig', '.new', '.prev', '.not', \
- '.pyc', '.fdc', '.rgb', '.elc', ',v']
-ignore = []
-
-def setup():
- ignore[:] = badnames
- for p in badprefixes:
- ignore.append(p + '*')
- for p in badsuffixes:
- ignore.append('*' + p)
- try:
- f = open('.xxcign', 'r')
- except IOError:
- return
- ignore[:] = ignore + f.read().split()
-
-def skipfile(file):
- for p in ignore:
- if fnmatch.fnmatch(file, p): return 1
- try:
- st = os.lstat(file)
- except os.error:
- return 1 # Doesn't exist -- skip it
- # Skip non-plain files.
- if not S_ISREG(st[ST_MODE]): return 1
- # Skip huge files -- probably binaries.
- if st[ST_SIZE] >= MAXSIZE: return 1
- # Skip executables
- try:
- data = open(file, 'r').read(len(EXECMAGIC))
- if data == EXECMAGIC: return 1
- except:
- pass
- return 0
-
-def badprefix(file):
- for bad in badprefixes:
- if file[:len(bad)] == bad: return 1
- return 0
-
-def badsuffix(file):
- for bad in badsuffixes:
- if file[-len(bad):] == bad: return 1
- return 0
-
-def go(args):
- for file in args:
- print(file + ':')
- if differing(file):
- showdiffs(file)
- if askyesno('Check in ' + file + ' ? '):
- sts = os.system('rcs -l ' + file) # ignored
- sts = os.system('ci -l ' + file)
-
-def differing(file):
- cmd = 'co -p ' + file + ' 2>/dev/null | cmp -s - ' + file
- sts = os.system(cmd)
- return sts != 0
-
-def showdiffs(file):
- cmd = 'rcsdiff ' + file + ' 2>&1 | ${PAGER-more}'
- sts = os.system(cmd)
-
-def raw_input(prompt):
- sys.stdout.write(prompt)
- sys.stdout.flush()
- return sys.stdin.readline()
-
-def askyesno(prompt):
- s = input(prompt)
- return s in ['y', 'yes']
-
-if __name__ == '__main__':
- try:
- setup()
- go(getargs())
- except KeyboardInterrupt:
- print('[Intr]')
diff --git a/Demo/distutils/test2to3/README b/Tools/test2to3/README
index 9365593bee..9365593bee 100644
--- a/Demo/distutils/test2to3/README
+++ b/Tools/test2to3/README
diff --git a/Demo/distutils/test2to3/maintest.py b/Tools/test2to3/maintest.py
index 72a26ddea0..036dd4f00c 100644
--- a/Demo/distutils/test2to3/maintest.py
+++ b/Tools/test2to3/maintest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# The above line should get replaced with the path to the Python
# interpreter; the block below should get 2to3-converted.
diff --git a/Demo/distutils/test2to3/setup.py b/Tools/test2to3/setup.py
index a0f9024145..a0f9024145 100644
--- a/Demo/distutils/test2to3/setup.py
+++ b/Tools/test2to3/setup.py
diff --git a/Demo/distutils/test2to3/test/runtests.py b/Tools/test2to3/test/runtests.py
index 1730f0db13..1730f0db13 100644
--- a/Demo/distutils/test2to3/test/runtests.py
+++ b/Tools/test2to3/test/runtests.py
diff --git a/Demo/distutils/test2to3/test/test_foo.py b/Tools/test2to3/test/test_foo.py
index ec8f26a65a..ec8f26a65a 100644
--- a/Demo/distutils/test2to3/test/test_foo.py
+++ b/Tools/test2to3/test/test_foo.py
diff --git a/Demo/distutils/test2to3/test2to3/__init__.py b/Tools/test2to3/test2to3/__init__.py
index 1bb8bf6d7f..1bb8bf6d7f 100644
--- a/Demo/distutils/test2to3/test2to3/__init__.py
+++ b/Tools/test2to3/test2to3/__init__.py
diff --git a/Demo/distutils/test2to3/test2to3/hello.py b/Tools/test2to3/test2to3/hello.py
index f52926b03c..f52926b03c 100644
--- a/Demo/distutils/test2to3/test2to3/hello.py
+++ b/Tools/test2to3/test2to3/hello.py
diff --git a/Tools/unicode/comparecodecs.py b/Tools/unicode/comparecodecs.py
index dade1ced22..0f5c1e24a3 100644
--- a/Tools/unicode/comparecodecs.py
+++ b/Tools/unicode/comparecodecs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
""" Compare the output of two codecs.
diff --git a/Tools/unicode/gencodec.py b/Tools/unicode/gencodec.py
index c3846e9fb2..7e7d6d0661 100644
--- a/Tools/unicode/gencodec.py
+++ b/Tools/unicode/gencodec.py
@@ -34,14 +34,16 @@ MAX_TABLE_SIZE = 8192
# Standard undefined Unicode code point
UNI_UNDEFINED = chr(0xFFFE)
+# Placeholder for a missing codepoint
+MISSING_CODE = -1
+
mapRE = re.compile('((?:0x[0-9a-fA-F]+\+?)+)'
'\s+'
'((?:(?:0x[0-9a-fA-Z]+|<[A-Za-z]+>)\+?)*)'
'\s*'
'(#.+)?')
-def parsecodes(codes,
- len=len, filter=filter,range=range):
+def parsecodes(codes, len=len, range=range):
""" Converts code combinations to either a single code integer
or a tuple of integers.
@@ -53,7 +55,7 @@ def parsecodes(codes,
"""
if not codes:
- return None
+ return MISSING_CODE
l = codes.split('+')
if len(l) == 1:
return int(l[0],16)
@@ -61,8 +63,8 @@ def parsecodes(codes,
try:
l[i] = int(l[i],16)
except ValueError:
- l[i] = None
- l = [x for x in l if x is not None]
+ l[i] = MISSING_CODE
+ l = [x for x in l if x != MISSING_CODE]
if len(l) == 1:
return l[0]
else:
@@ -114,7 +116,7 @@ def readmap(filename):
# mappings to None for the rest
if len(identity) >= len(unmapped):
for enc in unmapped:
- enc2uni[enc] = (None, "")
+ enc2uni[enc] = (MISSING_CODE, "")
enc2uni['IDENTITY'] = 256
return enc2uni
@@ -212,7 +214,7 @@ def python_tabledef_code(varname, map, comments=1, key_precision=2):
(mapkey, mapcomment) = mapkey
if isinstance(mapvalue, tuple):
(mapvalue, mapcomment) = mapvalue
- if mapkey is None:
+ if mapkey == MISSING_CODE:
continue
table[mapkey] = (mapvalue, mapcomment)
if mapkey > maxkey:
@@ -224,11 +226,11 @@ def python_tabledef_code(varname, map, comments=1, key_precision=2):
# Create table code
for key in range(maxkey + 1):
if key not in table:
- mapvalue = None
+ mapvalue = MISSING_CODE
mapcomment = 'UNDEFINED'
else:
mapvalue, mapcomment = table[key]
- if mapvalue is None:
+ if mapvalue == MISSING_CODE:
mapchar = UNI_UNDEFINED
else:
if isinstance(mapvalue, tuple):
@@ -237,11 +239,11 @@ def python_tabledef_code(varname, map, comments=1, key_precision=2):
else:
mapchar = chr(mapvalue)
if mapcomment and comments:
- append(' %r\t# %s -> %s' % (mapchar,
+ append(' %a \t# %s -> %s' % (mapchar,
hexrepr(key, key_precision),
mapcomment))
else:
- append(' %r' % mapchar)
+ append(' %a' % mapchar)
append(')')
return l
diff --git a/Tools/unicode/genwincodec.py b/Tools/unicode/genwincodec.py
new file mode 100644
index 0000000000..7a1ef5eda6
--- /dev/null
+++ b/Tools/unicode/genwincodec.py
@@ -0,0 +1,61 @@
+"""This script generates a Python codec module from a Windows Code Page.
+
+It uses the function MultiByteToWideChar to generate a decoding table.
+"""
+
+import ctypes
+from ctypes import wintypes
+from gencodec import codegen
+import unicodedata
+
+def genwinmap(codepage):
+ MultiByteToWideChar = ctypes.windll.kernel32.MultiByteToWideChar
+ MultiByteToWideChar.argtypes = [wintypes.UINT, wintypes.DWORD,
+ wintypes.LPCSTR, ctypes.c_int,
+ wintypes.LPWSTR, ctypes.c_int]
+ MultiByteToWideChar.restype = ctypes.c_int
+
+ enc2uni = {}
+
+ for i in list(range(32)) + [127]:
+ enc2uni[i] = (i, 'CONTROL CHARACTER')
+
+ for i in range(256):
+ buf = ctypes.create_unicode_buffer(2)
+ ret = MultiByteToWideChar(
+ codepage, 0,
+ bytes([i]), 1,
+ buf, 2)
+ assert ret == 1, "invalid code page"
+ assert buf[1] == '\x00'
+ try:
+ name = unicodedata.name(buf[0])
+ except ValueError:
+ try:
+ name = enc2uni[i][1]
+ except KeyError:
+ name = ''
+
+ enc2uni[i] = (ord(buf[0]), name)
+
+ return enc2uni
+
+def genwincodec(codepage):
+ import platform
+ map = genwinmap(codepage)
+ encodingname = 'cp%d' % codepage
+ code = codegen("", map, encodingname)
+ # Replace first lines with our own docstring
+ code = '''\
+"""Python Character Mapping Codec %s generated on Windows:
+%s with the command:
+ python Tools/unicode/genwincodec.py %s
+"""#"
+''' % (encodingname, ' '.join(platform.win32_ver()), codepage
+ ) + code.split('"""#"', 1)[1]
+
+ print(code)
+
+if __name__ == '__main__':
+ import sys
+ genwincodec(int(sys.argv[1]))
diff --git a/Tools/unicode/genwincodecs.bat b/Tools/unicode/genwincodecs.bat
new file mode 100644
index 0000000000..43cab0d6f8
--- /dev/null
+++ b/Tools/unicode/genwincodecs.bat
@@ -0,0 +1,7 @@
+@rem Recreate some python charmap codecs from the Windows function
+@rem MultiByteToWideChar.
+
+@cd /d %~dp0
+@mkdir build
+@rem Arabic DOS code page
+c:\python30\python genwincodec.py 720 > build/cp720.py
diff --git a/Tools/unicode/makeunicodedata.py b/Tools/unicode/makeunicodedata.py
index c35170cac4..d50319024c 100644
--- a/Tools/unicode/makeunicodedata.py
+++ b/Tools/unicode/makeunicodedata.py
@@ -25,18 +25,20 @@
# written by Fredrik Lundh (fredrik@pythonware.com)
#
-import sys
+import sys, os, zipfile
SCRIPT = sys.argv[0]
-VERSION = "2.6"
+VERSION = "3.2"
# The Unicode Database
-UNIDATA_VERSION = "5.1.0"
+UNIDATA_VERSION = "6.0.0"
UNICODE_DATA = "UnicodeData%s.txt"
COMPOSITION_EXCLUSIONS = "CompositionExclusions%s.txt"
EASTASIAN_WIDTH = "EastAsianWidth%s.txt"
+UNIHAN = "Unihan%s.zip"
DERIVED_CORE_PROPERTIES = "DerivedCoreProperties%s.txt"
DERIVEDNORMALIZATION_PROPS = "DerivedNormalizationProps%s.txt"
+LINE_BREAK = "LineBreak%s.txt"
old_versions = ["3.2.0"]
@@ -51,6 +53,8 @@ BIDIRECTIONAL_NAMES = [ "", "L", "LRE", "LRO", "R", "AL", "RLE", "RLO",
EASTASIANWIDTH_NAMES = [ "F", "H", "W", "Na", "A", "N" ]
+MANDATORY_LINE_BREAKS = [ "BK", "CR", "LF", "NL" ]
+
# note: should match definitions in Objects/unicodectype.c
ALPHA_MASK = 0x01
DECIMAL_MASK = 0x02
@@ -64,26 +68,29 @@ XID_START_MASK = 0x100
XID_CONTINUE_MASK = 0x200
PRINTABLE_MASK = 0x400
NODELTA_MASK = 0x800
+NUMERIC_MASK = 0x1000
+
+# these ranges need to match unicodedata.c:is_unified_ideograph
+cjk_ranges = [
+ ('3400', '4DB5'),
+ ('4E00', '9FCB'),
+ ('20000', '2A6D6'),
+ ('2A700', '2B734'),
+ ('2B740', '2B81D')
+]
def maketables(trace=0):
print("--- Reading", UNICODE_DATA % "", "...")
version = ""
- unicode = UnicodeData(UNICODE_DATA % version,
- COMPOSITION_EXCLUSIONS % version,
- EASTASIAN_WIDTH % version,
- DERIVED_CORE_PROPERTIES % version,
- DERIVEDNORMALIZATION_PROPS % version)
+ unicode = UnicodeData(UNIDATA_VERSION)
print(len(list(filter(None, unicode.table))), "characters")
for version in old_versions:
print("--- Reading", UNICODE_DATA % ("-"+version), "...")
- old_unicode = UnicodeData(UNICODE_DATA % ("-"+version),
- COMPOSITION_EXCLUSIONS % ("-"+version),
- EASTASIAN_WIDTH % ("-"+version),
- DERIVED_CORE_PROPERTIES % ("-"+version))
+ old_unicode = UnicodeData(version, cjk_check=False)
print(len(list(filter(None, old_unicode.table))), "characters")
merge_old_version(version, unicode, old_unicode)
@@ -357,6 +364,9 @@ def makeunicodetype(unicode, trace):
table = [dummy]
cache = {0: dummy}
index = [0] * len(unicode.chars)
+ numeric = {}
+ spaces = []
+ linebreaks = []
for char in unicode.chars:
record = unicode.table[char]
@@ -371,10 +381,12 @@ def makeunicodetype(unicode, trace):
flags |= ALPHA_MASK
if category == "Ll":
flags |= LOWER_MASK
- if category == "Zl" or bidirectional == "B":
+ if 'Line_Break' in properties or bidirectional == "B":
flags |= LINEBREAK_MASK
+ linebreaks.append(char)
if category == "Zs" or bidirectional in ("WS", "B", "S"):
flags |= SPACE_MASK
+ spaces.append(char)
if category == "Lt":
flags |= TITLE_MASK
if category == "Lu":
@@ -423,6 +435,9 @@ def makeunicodetype(unicode, trace):
if record[7]:
flags |= DIGIT_MASK
digit = int(record[7])
+ if record[8]:
+ flags |= NUMERIC_MASK
+ numeric.setdefault(record[8], []).append(char)
item = (
upper, lower, title, decimal, digit, flags
)
@@ -434,6 +449,9 @@ def makeunicodetype(unicode, trace):
index[char] = i
print(len(table), "unique character type entries")
+ print(sum(map(len, numeric.values())), "numeric code points")
+ print(len(spaces), "whitespace code points")
+ print(len(linebreaks), "linebreak code points")
print("--- Writing", FILE, "...")
@@ -455,6 +473,63 @@ def makeunicodetype(unicode, trace):
Array("index1", index1).dump(fp, trace)
Array("index2", index2).dump(fp, trace)
+ # Generate code for _PyUnicode_ToNumeric()
+ numeric_items = sorted(numeric.items())
+ print('/* Returns the numeric value as double for Unicode characters', file=fp)
+ print(' * having this property, -1.0 otherwise.', file=fp)
+ print(' */', file=fp)
+ print('double _PyUnicode_ToNumeric(Py_UCS4 ch)', file=fp)
+ print('{', file=fp)
+ print(' switch (ch) {', file=fp)
+ for value, codepoints in numeric_items:
+ # Turn text into float literals
+ parts = value.split('/')
+ parts = [repr(float(part)) for part in parts]
+ value = '/'.join(parts)
+
+ codepoints.sort()
+ for codepoint in codepoints:
+ print(' case 0x%04X:' % (codepoint,), file=fp)
+ print(' return (double) %s;' % (value,), file=fp)
+ print(' }', file=fp)
+ print(' return -1.0;', file=fp)
+ print('}', file=fp)
+ print(file=fp)
+
+ # Generate code for _PyUnicode_IsWhitespace()
+ print("/* Returns 1 for Unicode characters having the bidirectional", file=fp)
+ print(" * type 'WS', 'B' or 'S' or the category 'Zs', 0 otherwise.", file=fp)
+ print(" */", file=fp)
+ print('int _PyUnicode_IsWhitespace(register const Py_UCS4 ch)', file=fp)
+ print('{', file=fp)
+ print(' switch (ch) {', file=fp)
+
+ for codepoint in sorted(spaces):
+ print(' case 0x%04X:' % (codepoint,), file=fp)
+ print(' return 1;', file=fp)
+
+ print(' }', file=fp)
+ print(' return 0;', file=fp)
+ print('}', file=fp)
+ print(file=fp)
+
+ # Generate code for _PyUnicode_IsLinebreak()
+ print("/* Returns 1 for Unicode characters having the line break", file=fp)
+ print(" * property 'BK', 'CR', 'LF' or 'NL' or having bidirectional", file=fp)
+ print(" * type 'B', 0 otherwise.", file=fp)
+ print(" */", file=fp)
+ print('int _PyUnicode_IsLinebreak(register const Py_UCS4 ch)', file=fp)
+ print('{', file=fp)
+ print(' switch (ch) {', file=fp)
+ for codepoint in sorted(linebreaks):
+ print(' case 0x%04X:' % (codepoint,), file=fp)
+ print(' return 1;', file=fp)
+
+ print(' }', file=fp)
+ print(' return 0;', file=fp)
+ print('}', file=fp)
+ print(file=fp)
+
fp.close()
# --------------------------------------------------------------------
@@ -670,12 +745,11 @@ def merge_old_version(version, new, old):
elif k == 8:
# print "NUMERIC",hex(i), `old.table[i][k]`, new.table[i][k]
# Since 0 encodes "no change", the old value is better not 0
- assert value != "0" and value != "-1"
if not value:
numeric_changes[i] = -1
else:
- assert re.match("^[0-9]+$", value)
- numeric_changes[i] = int(value)
+ numeric_changes[i] = float(value)
+ assert numeric_changes[i] not in (0, -1)
elif k == 9:
if value == 'Y':
mirrored_changes[i] = '1'
@@ -696,6 +770,10 @@ def merge_old_version(version, new, old):
elif k == 16:
# derived property changes; not yet
pass
+ elif k == 17:
+ # normalization quickchecks are not performed
+ # for older versions
+ pass
else:
class Difference(Exception):pass
raise Difference(hex(i), k, old.table[i], new.table[i])
@@ -704,6 +782,21 @@ def merge_old_version(version, new, old):
numeric_changes)),
normalization_changes))
+def open_data(template, version):
+ local = template % ('-'+version,)
+ if not os.path.exists(local):
+ import urllib.request
+ if version == '3.2.0':
+ # irregular url structure
+ url = 'http://www.unicode.org/Public/3.2-Update/' + local
+ else:
+ url = ('http://www.unicode.org/Public/%s/ucd/'+template) % (version, '')
+ urllib.request.urlretrieve(url, filename=local)
+ if local.endswith('.txt'):
+ return open(local, encoding='utf-8')
+ else:
+ # Unihan.zip
+ return open(local, 'rb')
# --------------------------------------------------------------------
# the following support code is taken from the unidb utilities
@@ -711,8 +804,6 @@ def merge_old_version(version, new, old):
# load a unicode-data file from disk
-import sys
-
class UnicodeData:
# Record structure:
# [ID, name, category, combining, bidi, decomp, (6)
@@ -720,10 +811,12 @@ class UnicodeData:
# ISO-comment, uppercase, lowercase, titlecase, ea-width, (16)
# derived-props] (17)
- def __init__(self, filename, exclusions, eastasianwidth,
- derivedprops, derivednormalizationprops=None, expand=1):
+ def __init__(self, version,
+ linebreakprops=False,
+ expand=1,
+ cjk_check=True):
self.changed = []
- file = open(filename)
+ file = open_data(UNICODE_DATA, version)
table = [None] * 0x110000
while 1:
s = file.readline()
@@ -733,6 +826,8 @@ class UnicodeData:
char = int(s[0], 16)
table[char] = s
+ cjk_ranges_found = []
+
# expand first-last ranges
if expand:
field = None
@@ -743,19 +838,24 @@ class UnicodeData:
s[1] = ""
field = s
elif s[1][-5:] == "Last>":
+ if s[1].startswith("<CJK Ideograph"):
+ cjk_ranges_found.append((field[0],
+ s[0]))
s[1] = ""
field = None
elif field:
f2 = field[:]
f2[0] = "%X" % i
table[i] = f2
+ if cjk_check and cjk_ranges != cjk_ranges_found:
+ raise ValueError("CJK ranges deviate: have %r" % cjk_ranges_found)
# public attributes
- self.filename = filename
+ self.filename = UNICODE_DATA % ''
self.table = table
self.chars = list(range(0x110000)) # unicode 3.2
- file = open(exclusions)
+ file = open_data(COMPOSITION_EXCLUSIONS, version)
self.exclusions = {}
for s in file:
s = s.strip()
@@ -767,7 +867,7 @@ class UnicodeData:
self.exclusions[char] = 1
widths = [None] * 0x110000
- for s in open(eastasianwidth):
+ for s in open_data(EASTASIAN_WIDTH, version):
s = s.strip()
if not s:
continue
@@ -788,7 +888,7 @@ class UnicodeData:
for i in range(0, 0x110000):
if table[i] is not None:
table[i].append(set())
- for s in open(derivedprops):
+ for s in open_data(DERIVED_CORE_PROPERTIES, version):
s = s.split('#', 1)[0].strip()
if not s:
continue
@@ -807,28 +907,64 @@ class UnicodeData:
# apply to unassigned code points; ignore them
table[char][-1].add(p)
- if derivednormalizationprops:
- quickchecks = [0] * 0x110000 # default is Yes
- qc_order = 'NFD_QC NFKD_QC NFC_QC NFKC_QC'.split()
- for s in open(derivednormalizationprops):
- if '#' in s:
- s = s[:s.index('#')]
- s = [i.strip() for i in s.split(';')]
- if len(s) < 2 or s[1] not in qc_order:
- continue
- quickcheck = 'MN'.index(s[2]) + 1 # Maybe or No
- quickcheck_shift = qc_order.index(s[1])*2
- quickcheck <<= quickcheck_shift
- if '..' not in s[0]:
- first = last = int(s[0], 16)
- else:
- first, last = [int(c, 16) for c in s[0].split('..')]
- for char in range(first, last+1):
- assert not (quickchecks[char]>>quickcheck_shift)&3
- quickchecks[char] |= quickcheck
- for i in range(0, 0x110000):
- if table[i] is not None:
- table[i].append(quickchecks[i])
+ for s in open_data(LINE_BREAK, version):
+ s = s.partition('#')[0]
+ s = [i.strip() for i in s.split(';')]
+ if len(s) < 2 or s[1] not in MANDATORY_LINE_BREAKS:
+ continue
+ if '..' not in s[0]:
+ first = last = int(s[0], 16)
+ else:
+ first, last = [int(c, 16) for c in s[0].split('..')]
+ for char in range(first, last+1):
+ table[char][-1].add('Line_Break')
+
+ # We only want the quickcheck properties
+ # Format: NF?_QC; Y(es)/N(o)/M(aybe)
+ # Yes is the default, hence only N and M occur
+ # In 3.2.0, the format was different (NF?_NO)
+ # The parsing will incorrectly determine these as
+ # "yes", however, unicodedata.c will not perform quickchecks
+ # for older versions, and no delta records will be created.
+ quickchecks = [0] * 0x110000
+ qc_order = 'NFD_QC NFKD_QC NFC_QC NFKC_QC'.split()
+ for s in open_data(DERIVEDNORMALIZATION_PROPS, version):
+ if '#' in s:
+ s = s[:s.index('#')]
+ s = [i.strip() for i in s.split(';')]
+ if len(s) < 2 or s[1] not in qc_order:
+ continue
+ quickcheck = 'MN'.index(s[2]) + 1 # Maybe or No
+ quickcheck_shift = qc_order.index(s[1])*2
+ quickcheck <<= quickcheck_shift
+ if '..' not in s[0]:
+ first = last = int(s[0], 16)
+ else:
+ first, last = [int(c, 16) for c in s[0].split('..')]
+ for char in range(first, last+1):
+ assert not (quickchecks[char]>>quickcheck_shift)&3
+ quickchecks[char] |= quickcheck
+ for i in range(0, 0x110000):
+ if table[i] is not None:
+ table[i].append(quickchecks[i])
+
+ zip = zipfile.ZipFile(open_data(UNIHAN, version))
+ if version == '3.2.0':
+ data = zip.open('Unihan-3.2.0.txt').read()
+ else:
+ data = zip.open('Unihan_NumericValues.txt').read()
+ for line in data.decode("utf-8").splitlines():
+ if not line.startswith('U+'):
+ continue
+ code, tag, value = line.split(None, 3)[:3]
+ if tag not in ('kAccountingNumeric', 'kPrimaryNumeric',
+ 'kOtherNumeric'):
+ continue
+ value = value.strip().replace(',', '')
+ i = int(code[2:], 16)
+ # Patch the numeric field
+ if table[i] is not None:
+ table[i][8] = value
def uselatin1(self):
# restrict character range to ISO Latin 1
@@ -979,7 +1115,6 @@ def splitbins(t, trace=0):
you'll get.
"""
- import sys
if trace:
def dump(t1, t2, shift, bytes):
print("%d+%d bins at shift %d; %d bytes" % (
diff --git a/Tools/unittestgui/README.txt b/Tools/unittestgui/README.txt
new file mode 100644
index 0000000000..4d809df870
--- /dev/null
+++ b/Tools/unittestgui/README.txt
@@ -0,0 +1,16 @@
+unittestgui.py is GUI framework and application for use with Python unit
+testing framework. It executes tests written using the framework provided
+by the 'unittest' module.
+
+Based on the original by Steve Purcell, from:
+
+ http://pyunit.sourceforge.net/
+
+Updated for unittest test discovery by Mark Roddy and Python 3
+support by Brian Curtin.
+
+For details on how to make your tests work with test discovery,
+and for explanations of the configuration options, see the unittest
+documentation:
+
+ http://docs.python.org/library/unittest.html#test-discovery
diff --git a/Tools/unittestgui/unittestgui.py b/Tools/unittestgui/unittestgui.py
new file mode 100644
index 0000000000..b526646b06
--- /dev/null
+++ b/Tools/unittestgui/unittestgui.py
@@ -0,0 +1,479 @@
+#!/usr/bin/env python
+"""
+GUI framework and application for use with Python unit testing framework.
+Execute tests written using the framework provided by the 'unittest' module.
+
+Updated for unittest test discovery by Mark Roddy and Python 3
+support by Brian Curtin.
+
+Based on the original by Steve Purcell, from:
+
+ http://pyunit.sourceforge.net/
+
+Copyright (c) 1999, 2000, 2001 Steve Purcell
+This module is free software, and you may redistribute it and/or modify
+it under the same terms as Python itself, so long as this copyright message
+and disclaimer are retained in their original form.
+
+IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
+AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
+SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+"""
+
+__author__ = "Steve Purcell (stephen_purcell@yahoo.com)"
+__version__ = "$Revision: 1.7 $"[11:-2]
+
+import sys
+import traceback
+import unittest
+
+import tkinter as tk
+from tkinter import messagebox
+from tkinter import filedialog
+from tkinter import simpledialog
+
+
+
+
+##############################################################################
+# GUI framework classes
+##############################################################################
+
+class BaseGUITestRunner(object):
+ """Subclass this class to create a GUI TestRunner that uses a specific
+ windowing toolkit. The class takes care of running tests in the correct
+ manner, and making callbacks to the derived class to obtain information
+ or signal that events have occurred.
+ """
+ def __init__(self, *args, **kwargs):
+ self.currentResult = None
+ self.running = 0
+ self.__rollbackImporter = None
+ self.__rollbackImporter = RollbackImporter()
+ self.test_suite = None
+
+ #test discovery variables
+ self.directory_to_read = ''
+ self.top_level_dir = ''
+ self.test_file_glob_pattern = 'test*.py'
+
+ self.initGUI(*args, **kwargs)
+
+ def errorDialog(self, title, message):
+ "Override to display an error arising from GUI usage"
+ pass
+
+ def getDirectoryToDiscover(self):
+ "Override to prompt user for directory to perform test discovery"
+ pass
+
+ def runClicked(self):
+ "To be called in response to user choosing to run a test"
+ if self.running: return
+ if not self.test_suite:
+ self.errorDialog("Test Discovery", "You discover some tests first!")
+ return
+ self.currentResult = GUITestResult(self)
+ self.totalTests = self.test_suite.countTestCases()
+ self.running = 1
+ self.notifyRunning()
+ self.test_suite.run(self.currentResult)
+ self.running = 0
+ self.notifyStopped()
+
+ def stopClicked(self):
+ "To be called in response to user stopping the running of a test"
+ if self.currentResult:
+ self.currentResult.stop()
+
+ def discoverClicked(self):
+ self.__rollbackImporter.rollbackImports()
+ directory = self.getDirectoryToDiscover()
+ if not directory:
+ return
+ self.directory_to_read = directory
+ try:
+ # Explicitly use 'None' value if no top level directory is
+ # specified (indicated by empty string) as discover() explicitly
+ # checks for a 'None' to determine if no tld has been specified
+ top_level_dir = self.top_level_dir or None
+ tests = unittest.defaultTestLoader.discover(directory, self.test_file_glob_pattern, top_level_dir)
+ self.test_suite = tests
+ except:
+ exc_type, exc_value, exc_tb = sys.exc_info()
+ traceback.print_exception(*sys.exc_info())
+ self.errorDialog("Unable to run test '%s'" % directory,
+ "Error loading specified test: %s, %s" % (exc_type, exc_value))
+ return
+ self.notifyTestsDiscovered(self.test_suite)
+
+ # Required callbacks
+
+ def notifyTestsDiscovered(self, test_suite):
+ "Override to display information about the suite of discovered tests"
+ pass
+
+ def notifyRunning(self):
+ "Override to set GUI in 'running' mode, enabling 'stop' button etc."
+ pass
+
+ def notifyStopped(self):
+ "Override to set GUI in 'stopped' mode, enabling 'run' button etc."
+ pass
+
+ def notifyTestFailed(self, test, err):
+ "Override to indicate that a test has just failed"
+ pass
+
+ def notifyTestErrored(self, test, err):
+ "Override to indicate that a test has just errored"
+ pass
+
+ def notifyTestSkipped(self, test, reason):
+ "Override to indicate that test was skipped"
+ pass
+
+ def notifyTestFailedExpectedly(self, test, err):
+ "Override to indicate that test has just failed expectedly"
+ pass
+
+ def notifyTestStarted(self, test):
+ "Override to indicate that a test is about to run"
+ pass
+
+ def notifyTestFinished(self, test):
+ """Override to indicate that a test has finished (it may already have
+ failed or errored)"""
+ pass
+
+
+class GUITestResult(unittest.TestResult):
+ """A TestResult that makes callbacks to its associated GUI TestRunner.
+ Used by BaseGUITestRunner. Need not be created directly.
+ """
+ def __init__(self, callback):
+ unittest.TestResult.__init__(self)
+ self.callback = callback
+
+ def addError(self, test, err):
+ unittest.TestResult.addError(self, test, err)
+ self.callback.notifyTestErrored(test, err)
+
+ def addFailure(self, test, err):
+ unittest.TestResult.addFailure(self, test, err)
+ self.callback.notifyTestFailed(test, err)
+
+ def addSkip(self, test, reason):
+ super(GUITestResult,self).addSkip(test, reason)
+ self.callback.notifyTestSkipped(test, reason)
+
+ def addExpectedFailure(self, test, err):
+ super(GUITestResult,self).addExpectedFailure(test, err)
+ self.callback.notifyTestFailedExpectedly(test, err)
+
+ def stopTest(self, test):
+ unittest.TestResult.stopTest(self, test)
+ self.callback.notifyTestFinished(test)
+
+ def startTest(self, test):
+ unittest.TestResult.startTest(self, test)
+ self.callback.notifyTestStarted(test)
+
+
+class RollbackImporter:
+ """This tricky little class is used to make sure that modules under test
+ will be reloaded the next time they are imported.
+ """
+ def __init__(self):
+ self.previousModules = sys.modules.copy()
+
+ def rollbackImports(self):
+ for modname in sys.modules.copy().keys():
+ if not modname in self.previousModules:
+ # Force reload when modname next imported
+ del(sys.modules[modname])
+
+
+##############################################################################
+# Tkinter GUI
+##############################################################################
+
+class DiscoverSettingsDialog(simpledialog.Dialog):
+ """
+ Dialog box for prompting test discovery settings
+ """
+
+ def __init__(self, master, top_level_dir, test_file_glob_pattern, *args, **kwargs):
+ self.top_level_dir = top_level_dir
+ self.dirVar = tk.StringVar()
+ self.dirVar.set(top_level_dir)
+
+ self.test_file_glob_pattern = test_file_glob_pattern
+ self.testPatternVar = tk.StringVar()
+ self.testPatternVar.set(test_file_glob_pattern)
+
+ simpledialog.Dialog.__init__(self, master, title="Discover Settings",
+ *args, **kwargs)
+
+ def body(self, master):
+ tk.Label(master, text="Top Level Directory").grid(row=0)
+ self.e1 = tk.Entry(master, textvariable=self.dirVar)
+ self.e1.grid(row = 0, column=1)
+ tk.Button(master, text="...",
+ command=lambda: self.selectDirClicked(master)).grid(row=0,column=3)
+
+ tk.Label(master, text="Test File Pattern").grid(row=1)
+ self.e2 = tk.Entry(master, textvariable = self.testPatternVar)
+ self.e2.grid(row = 1, column=1)
+ return None
+
+ def selectDirClicked(self, master):
+ dir_path = filedialog.askdirectory(parent=master)
+ if dir_path:
+ self.dirVar.set(dir_path)
+
+ def apply(self):
+ self.top_level_dir = self.dirVar.get()
+ self.test_file_glob_pattern = self.testPatternVar.get()
+
+class TkTestRunner(BaseGUITestRunner):
+ """An implementation of BaseGUITestRunner using Tkinter.
+ """
+ def initGUI(self, root, initialTestName):
+ """Set up the GUI inside the given root window. The test name entry
+ field will be pre-filled with the given initialTestName.
+ """
+ self.root = root
+
+ self.statusVar = tk.StringVar()
+ self.statusVar.set("Idle")
+
+ #tk vars for tracking counts of test result types
+ self.runCountVar = tk.IntVar()
+ self.failCountVar = tk.IntVar()
+ self.errorCountVar = tk.IntVar()
+ self.skipCountVar = tk.IntVar()
+ self.expectFailCountVar = tk.IntVar()
+ self.remainingCountVar = tk.IntVar()
+
+ self.top = tk.Frame()
+ self.top.pack(fill=tk.BOTH, expand=1)
+ self.createWidgets()
+
+ def getDirectoryToDiscover(self):
+ return filedialog.askdirectory()
+
+ def settingsClicked(self):
+ d = DiscoverSettingsDialog(self.top, self.top_level_dir, self.test_file_glob_pattern)
+ self.top_level_dir = d.top_level_dir
+ self.test_file_glob_pattern = d.test_file_glob_pattern
+
+ def notifyTestsDiscovered(self, test_suite):
+ discovered = test_suite.countTestCases()
+ self.runCountVar.set(0)
+ self.failCountVar.set(0)
+ self.errorCountVar.set(0)
+ self.remainingCountVar.set(discovered)
+ self.progressBar.setProgressFraction(0.0)
+ self.errorListbox.delete(0, tk.END)
+ self.statusVar.set("Discovering tests from %s. Found: %s" %
+ (self.directory_to_read, discovered))
+ self.stopGoButton['state'] = tk.NORMAL
+
+ def createWidgets(self):
+ """Creates and packs the various widgets.
+
+ Why is it that GUI code always ends up looking a mess, despite all the
+ best intentions to keep it tidy? Answers on a postcard, please.
+ """
+ # Status bar
+ statusFrame = tk.Frame(self.top, relief=tk.SUNKEN, borderwidth=2)
+ statusFrame.pack(anchor=tk.SW, fill=tk.X, side=tk.BOTTOM)
+ tk.Label(statusFrame, width=1, textvariable=self.statusVar).pack(side=tk.TOP, fill=tk.X)
+
+ # Area to enter name of test to run
+ leftFrame = tk.Frame(self.top, borderwidth=3)
+ leftFrame.pack(fill=tk.BOTH, side=tk.LEFT, anchor=tk.NW, expand=1)
+ suiteNameFrame = tk.Frame(leftFrame, borderwidth=3)
+ suiteNameFrame.pack(fill=tk.X)
+
+ # Progress bar
+ progressFrame = tk.Frame(leftFrame, relief=tk.GROOVE, borderwidth=2)
+ progressFrame.pack(fill=tk.X, expand=0, anchor=tk.NW)
+ tk.Label(progressFrame, text="Progress:").pack(anchor=tk.W)
+ self.progressBar = ProgressBar(progressFrame, relief=tk.SUNKEN,
+ borderwidth=2)
+ self.progressBar.pack(fill=tk.X, expand=1)
+
+
+ # Area with buttons to start/stop tests and quit
+ buttonFrame = tk.Frame(self.top, borderwidth=3)
+ buttonFrame.pack(side=tk.LEFT, anchor=tk.NW, fill=tk.Y)
+
+ tk.Button(buttonFrame, text="Discover Tests",
+ command=self.discoverClicked).pack(fill=tk.X)
+
+
+ self.stopGoButton = tk.Button(buttonFrame, text="Start",
+ command=self.runClicked, state=tk.DISABLED)
+ self.stopGoButton.pack(fill=tk.X)
+
+ tk.Button(buttonFrame, text="Close",
+ command=self.top.quit).pack(side=tk.BOTTOM, fill=tk.X)
+ tk.Button(buttonFrame, text="Settings",
+ command=self.settingsClicked).pack(side=tk.BOTTOM, fill=tk.X)
+
+ # Area with labels reporting results
+ for label, var in (('Run:', self.runCountVar),
+ ('Failures:', self.failCountVar),
+ ('Errors:', self.errorCountVar),
+ ('Skipped:', self.skipCountVar),
+ ('Expected Failures:', self.expectFailCountVar),
+ ('Remaining:', self.remainingCountVar),
+ ):
+ tk.Label(progressFrame, text=label).pack(side=tk.LEFT)
+ tk.Label(progressFrame, textvariable=var,
+ foreground="blue").pack(side=tk.LEFT, fill=tk.X,
+ expand=1, anchor=tk.W)
+
+ # List box showing errors and failures
+ tk.Label(leftFrame, text="Failures and errors:").pack(anchor=tk.W)
+ listFrame = tk.Frame(leftFrame, relief=tk.SUNKEN, borderwidth=2)
+ listFrame.pack(fill=tk.BOTH, anchor=tk.NW, expand=1)
+ self.errorListbox = tk.Listbox(listFrame, foreground='red',
+ selectmode=tk.SINGLE,
+ selectborderwidth=0)
+ self.errorListbox.pack(side=tk.LEFT, fill=tk.BOTH, expand=1,
+ anchor=tk.NW)
+ listScroll = tk.Scrollbar(listFrame, command=self.errorListbox.yview)
+ listScroll.pack(side=tk.LEFT, fill=tk.Y, anchor=tk.N)
+ self.errorListbox.bind("<Double-1>",
+ lambda e, self=self: self.showSelectedError())
+ self.errorListbox.configure(yscrollcommand=listScroll.set)
+
+ def errorDialog(self, title, message):
+ messagebox.showerror(parent=self.root, title=title,
+ message=message)
+
+ def notifyRunning(self):
+ self.runCountVar.set(0)
+ self.failCountVar.set(0)
+ self.errorCountVar.set(0)
+ self.remainingCountVar.set(self.totalTests)
+ self.errorInfo = []
+ while self.errorListbox.size():
+ self.errorListbox.delete(0)
+ #Stopping seems not to work, so simply disable the start button
+ #self.stopGoButton.config(command=self.stopClicked, text="Stop")
+ self.stopGoButton.config(state=tk.DISABLED)
+ self.progressBar.setProgressFraction(0.0)
+ self.top.update_idletasks()
+
+ def notifyStopped(self):
+ self.stopGoButton.config(state=tk.DISABLED)
+ #self.stopGoButton.config(command=self.runClicked, text="Start")
+ self.statusVar.set("Idle")
+
+ def notifyTestStarted(self, test):
+ self.statusVar.set(str(test))
+ self.top.update_idletasks()
+
+ def notifyTestFailed(self, test, err):
+ self.failCountVar.set(1 + self.failCountVar.get())
+ self.errorListbox.insert(tk.END, "Failure: %s" % test)
+ self.errorInfo.append((test,err))
+
+ def notifyTestErrored(self, test, err):
+ self.errorCountVar.set(1 + self.errorCountVar.get())
+ self.errorListbox.insert(tk.END, "Error: %s" % test)
+ self.errorInfo.append((test,err))
+
+ def notifyTestSkipped(self, test, reason):
+ super(TkTestRunner, self).notifyTestSkipped(test, reason)
+ self.skipCountVar.set(1 + self.skipCountVar.get())
+
+ def notifyTestFailedExpectedly(self, test, err):
+ super(TkTestRunner, self).notifyTestFailedExpectedly(test, err)
+ self.expectFailCountVar.set(1 + self.expectFailCountVar.get())
+
+
+ def notifyTestFinished(self, test):
+ self.remainingCountVar.set(self.remainingCountVar.get() - 1)
+ self.runCountVar.set(1 + self.runCountVar.get())
+ fractionDone = float(self.runCountVar.get())/float(self.totalTests)
+ fillColor = len(self.errorInfo) and "red" or "green"
+ self.progressBar.setProgressFraction(fractionDone, fillColor)
+
+ def showSelectedError(self):
+ selection = self.errorListbox.curselection()
+ if not selection: return
+ selected = int(selection[0])
+ txt = self.errorListbox.get(selected)
+ window = tk.Toplevel(self.root)
+ window.title(txt)
+ window.protocol('WM_DELETE_WINDOW', window.quit)
+ test, error = self.errorInfo[selected]
+ tk.Label(window, text=str(test),
+ foreground="red", justify=tk.LEFT).pack(anchor=tk.W)
+ tracebackLines = traceback.format_exception(*error)
+ tracebackText = "".join(tracebackLines)
+ tk.Label(window, text=tracebackText, justify=tk.LEFT).pack()
+ tk.Button(window, text="Close",
+ command=window.quit).pack(side=tk.BOTTOM)
+ window.bind('<Key-Return>', lambda e, w=window: w.quit())
+ window.mainloop()
+ window.destroy()
+
+
+class ProgressBar(tk.Frame):
+ """A simple progress bar that shows a percentage progress in
+ the given colour."""
+
+ def __init__(self, *args, **kwargs):
+ tk.Frame.__init__(self, *args, **kwargs)
+ self.canvas = tk.Canvas(self, height='20', width='60',
+ background='white', borderwidth=3)
+ self.canvas.pack(fill=tk.X, expand=1)
+ self.rect = self.text = None
+ self.canvas.bind('<Configure>', self.paint)
+ self.setProgressFraction(0.0)
+
+ def setProgressFraction(self, fraction, color='blue'):
+ self.fraction = fraction
+ self.color = color
+ self.paint()
+ self.canvas.update_idletasks()
+
+ def paint(self, *args):
+ totalWidth = self.canvas.winfo_width()
+ width = int(self.fraction * float(totalWidth))
+ height = self.canvas.winfo_height()
+ if self.rect is not None: self.canvas.delete(self.rect)
+ if self.text is not None: self.canvas.delete(self.text)
+ self.rect = self.canvas.create_rectangle(0, 0, width, height,
+ fill=self.color)
+ percentString = "%3.0f%%" % (100.0 * self.fraction)
+ self.text = self.canvas.create_text(totalWidth/2, height/2,
+ anchor=tk.CENTER,
+ text=percentString)
+
+def main(initialTestName=""):
+ root = tk.Tk()
+ root.title("PyUnit")
+ runner = TkTestRunner(root, initialTestName)
+ root.protocol('WM_DELETE_WINDOW', root.quit)
+ root.mainloop()
+
+
+if __name__ == '__main__':
+ if len(sys.argv) == 2:
+ main(sys.argv[1])
+ else:
+ main()
diff --git a/Tools/webchecker/README b/Tools/webchecker/README
deleted file mode 100644
index a51bb3dd51..0000000000
--- a/Tools/webchecker/README
+++ /dev/null
@@ -1,23 +0,0 @@
-Webchecker
-----------
-
-This is a simple web tree checker, useful to find bad links in a web
-tree. It currently checks links pointing within the same subweb for
-validity. The main program is "webchecker.py". See its doc string
-(or invoke it with the option "-?") for more defails.
-
-History:
-
-- Jan 1997. First release. The module robotparser.py was written by
-Skip Montanaro; the rest is original work by Guido van Rossum.
-
-- May 1999. Sam Bayer contributed a new version, wcnew.py, which
-supports checking internal links (#spam fragments in URLs) and some
-other options.
-
-- Nov 1999. Sam Bayer contributed patches to reintegrate wcnew.py
-into webchecker.py, and corresponding mods to wcgui.py and
-websucker.py.
-
-- Mar 2004. Chris Herborth contributed a patch to let webchecker.py
-handle XHTML's 'id' attribute.
diff --git a/Tools/webchecker/tktools.py b/Tools/webchecker/tktools.py
deleted file mode 100644
index 3a68f9ac63..0000000000
--- a/Tools/webchecker/tktools.py
+++ /dev/null
@@ -1,366 +0,0 @@
-"""Assorted Tk-related subroutines used in Grail."""
-
-
-from types import *
-from Tkinter import *
-
-def _clear_entry_widget(event):
- try:
- widget = event.widget
- widget.delete(0, INSERT)
- except: pass
-def install_keybindings(root):
- root.bind_class('Entry', '<Control-u>', _clear_entry_widget)
-
-
-def make_toplevel(master, title=None, class_=None):
- """Create a Toplevel widget.
-
- This is a shortcut for a Toplevel() instantiation plus calls to
- set the title and icon name of the widget.
-
- """
-
- if class_:
- widget = Toplevel(master, class_=class_)
- else:
- widget = Toplevel(master)
- if title:
- widget.title(title)
- widget.iconname(title)
- return widget
-
-def set_transient(widget, master, relx=0.5, rely=0.3, expose=1):
- """Make an existing toplevel widget transient for a master.
-
- The widget must exist but should not yet have been placed; in
- other words, this should be called after creating all the
- subwidget but before letting the user interact.
- """
-
- widget.withdraw() # Remain invisible while we figure out the geometry
- widget.transient(master)
- widget.update_idletasks() # Actualize geometry information
- if master.winfo_ismapped():
- m_width = master.winfo_width()
- m_height = master.winfo_height()
- m_x = master.winfo_rootx()
- m_y = master.winfo_rooty()
- else:
- m_width = master.winfo_screenwidth()
- m_height = master.winfo_screenheight()
- m_x = m_y = 0
- w_width = widget.winfo_reqwidth()
- w_height = widget.winfo_reqheight()
- x = m_x + (m_width - w_width) * relx
- y = m_y + (m_height - w_height) * rely
- widget.geometry("+%d+%d" % (x, y))
- if expose:
- widget.deiconify() # Become visible at the desired location
- return widget
-
-
-def make_scrollbars(parent, hbar, vbar, pack=1, class_=None, name=None,
- takefocus=0):
-
- """Subroutine to create a frame with scrollbars.
-
- This is used by make_text_box and similar routines.
-
- Note: the caller is responsible for setting the x/y scroll command
- properties (e.g. by calling set_scroll_commands()).
-
- Return a tuple containing the hbar, the vbar, and the frame, where
- hbar and vbar are None if not requested.
-
- """
- if class_:
- if name: frame = Frame(parent, class_=class_, name=name)
- else: frame = Frame(parent, class_=class_)
- else:
- if name: frame = Frame(parent, name=name)
- else: frame = Frame(parent)
-
- if pack:
- frame.pack(fill=BOTH, expand=1)
-
- corner = None
- if vbar:
- if not hbar:
- vbar = Scrollbar(frame, takefocus=takefocus)
- vbar.pack(fill=Y, side=RIGHT)
- else:
- vbarframe = Frame(frame, borderwidth=0)
- vbarframe.pack(fill=Y, side=RIGHT)
- vbar = Scrollbar(frame, name="vbar", takefocus=takefocus)
- vbar.pack(in_=vbarframe, expand=1, fill=Y, side=TOP)
- sbwidth = vbar.winfo_reqwidth()
- corner = Frame(vbarframe, width=sbwidth, height=sbwidth)
- corner.propagate(0)
- corner.pack(side=BOTTOM)
- else:
- vbar = None
-
- if hbar:
- hbar = Scrollbar(frame, orient=HORIZONTAL, name="hbar",
- takefocus=takefocus)
- hbar.pack(fill=X, side=BOTTOM)
- else:
- hbar = None
-
- return hbar, vbar, frame
-
-
-def set_scroll_commands(widget, hbar, vbar):
-
- """Link a scrollable widget to its scroll bars.
-
- The scroll bars may be empty.
-
- """
-
- if vbar:
- widget['yscrollcommand'] = (vbar, 'set')
- vbar['command'] = (widget, 'yview')
-
- if hbar:
- widget['xscrollcommand'] = (hbar, 'set')
- hbar['command'] = (widget, 'xview')
-
- widget.vbar = vbar
- widget.hbar = hbar
-
-
-def make_text_box(parent, width=0, height=0, hbar=0, vbar=1,
- fill=BOTH, expand=1, wrap=WORD, pack=1,
- class_=None, name=None, takefocus=None):
-
- """Subroutine to create a text box.
-
- Create:
- - a both-ways filling and expanding frame, containing:
- - a text widget on the left, and
- - possibly a vertical scroll bar on the right.
- - possibly a horizonta; scroll bar at the bottom.
-
- Return the text widget and the frame widget.
-
- """
- hbar, vbar, frame = make_scrollbars(parent, hbar, vbar, pack,
- class_=class_, name=name,
- takefocus=takefocus)
-
- widget = Text(frame, wrap=wrap, name="text")
- if width: widget.config(width=width)
- if height: widget.config(height=height)
- widget.pack(expand=expand, fill=fill, side=LEFT)
-
- set_scroll_commands(widget, hbar, vbar)
-
- return widget, frame
-
-
-def make_list_box(parent, width=0, height=0, hbar=0, vbar=1,
- fill=BOTH, expand=1, pack=1, class_=None, name=None,
- takefocus=None):
-
- """Subroutine to create a list box.
-
- Like make_text_box().
- """
- hbar, vbar, frame = make_scrollbars(parent, hbar, vbar, pack,
- class_=class_, name=name,
- takefocus=takefocus)
-
- widget = Listbox(frame, name="listbox")
- if width: widget.config(width=width)
- if height: widget.config(height=height)
- widget.pack(expand=expand, fill=fill, side=LEFT)
-
- set_scroll_commands(widget, hbar, vbar)
-
- return widget, frame
-
-
-def make_canvas(parent, width=0, height=0, hbar=1, vbar=1,
- fill=BOTH, expand=1, pack=1, class_=None, name=None,
- takefocus=None):
-
- """Subroutine to create a canvas.
-
- Like make_text_box().
-
- """
-
- hbar, vbar, frame = make_scrollbars(parent, hbar, vbar, pack,
- class_=class_, name=name,
- takefocus=takefocus)
-
- widget = Canvas(frame, scrollregion=(0, 0, width, height), name="canvas")
- if width: widget.config(width=width)
- if height: widget.config(height=height)
- widget.pack(expand=expand, fill=fill, side=LEFT)
-
- set_scroll_commands(widget, hbar, vbar)
-
- return widget, frame
-
-
-
-def make_form_entry(parent, label, borderwidth=None):
-
- """Subroutine to create a form entry.
-
- Create:
- - a horizontally filling and expanding frame, containing:
- - a label on the left, and
- - a text entry on the right.
-
- Return the entry widget and the frame widget.
-
- """
-
- frame = Frame(parent)
- frame.pack(fill=X)
-
- label = Label(frame, text=label)
- label.pack(side=LEFT)
-
- if borderwidth is None:
- entry = Entry(frame, relief=SUNKEN)
- else:
- entry = Entry(frame, relief=SUNKEN, borderwidth=borderwidth)
- entry.pack(side=LEFT, fill=X, expand=1)
-
- return entry, frame
-
-# This is a slightly modified version of the function above. This
-# version does the proper alighnment of labels with their fields. It
-# should probably eventually replace make_form_entry altogether.
-#
-# The one annoying bug is that the text entry field should be
-# expandable while still aligning the colons. This doesn't work yet.
-#
-def make_labeled_form_entry(parent, label, entrywidth=20, entryheight=1,
- labelwidth=0, borderwidth=None,
- takefocus=None):
- """Subroutine to create a form entry.
-
- Create:
- - a horizontally filling and expanding frame, containing:
- - a label on the left, and
- - a text entry on the right.
-
- Return the entry widget and the frame widget.
- """
- if label and label[-1] != ':': label = label + ':'
-
- frame = Frame(parent)
-
- label = Label(frame, text=label, width=labelwidth, anchor=E)
- label.pack(side=LEFT)
- if entryheight == 1:
- if borderwidth is None:
- entry = Entry(frame, relief=SUNKEN, width=entrywidth)
- else:
- entry = Entry(frame, relief=SUNKEN, width=entrywidth,
- borderwidth=borderwidth)
- entry.pack(side=RIGHT, expand=1, fill=X)
- frame.pack(fill=X)
- else:
- entry = make_text_box(frame, entrywidth, entryheight, 1, 1,
- takefocus=takefocus)
- frame.pack(fill=BOTH, expand=1)
-
- return entry, frame, label
-
-
-def make_double_frame(master=None, class_=None, name=None, relief=RAISED,
- borderwidth=1):
- """Create a pair of frames suitable for 'hosting' a dialog."""
- if name:
- if class_: frame = Frame(master, class_=class_, name=name)
- else: frame = Frame(master, name=name)
- else:
- if class_: frame = Frame(master, class_=class_)
- else: frame = Frame(master)
- top = Frame(frame, name="topframe", relief=relief,
- borderwidth=borderwidth)
- bottom = Frame(frame, name="bottomframe")
- bottom.pack(fill=X, padx='1m', pady='1m', side=BOTTOM)
- top.pack(expand=1, fill=BOTH, padx='1m', pady='1m')
- frame.pack(expand=1, fill=BOTH)
- top = Frame(top)
- top.pack(expand=1, fill=BOTH, padx='2m', pady='2m')
-
- return frame, top, bottom
-
-
-def make_group_frame(master, name=None, label=None, fill=Y,
- side=None, expand=None, font=None):
- """Create nested frames with a border and optional label.
-
- The outer frame is only used to provide the decorative border, to
- control packing, and to host the label. The inner frame is packed
- to fill the outer frame and should be used as the parent of all
- sub-widgets. Only the inner frame is returned.
-
- """
- font = font or "-*-helvetica-medium-r-normal-*-*-100-*-*-*-*-*-*"
- outer = Frame(master, borderwidth=2, relief=GROOVE)
- outer.pack(expand=expand, fill=fill, side=side)
- if label:
- Label(outer, text=label, font=font, anchor=W).pack(fill=X)
- inner = Frame(master, borderwidth='1m', name=name)
- inner.pack(expand=1, fill=BOTH, in_=outer)
- inner.forget = outer.forget
- return inner
-
-
-def unify_button_widths(*buttons):
- """Make buttons passed in all have the same width.
-
- Works for labels and other widgets with the 'text' option.
-
- """
- wid = 0
- for btn in buttons:
- wid = max(wid, len(btn["text"]))
- for btn in buttons:
- btn["width"] = wid
-
-
-def flatten(msg):
- """Turn a list or tuple into a single string -- recursively."""
- t = type(msg)
- if t in (ListType, TupleType):
- msg = ' '.join(map(flatten, msg))
- elif t is ClassType:
- msg = msg.__name__
- else:
- msg = str(msg)
- return msg
-
-
-def boolean(s):
- """Test whether a string is a Tk boolean, without error checking."""
- if s.lower() in ('', '0', 'no', 'off', 'false'): return 0
- else: return 1
-
-
-def test():
- """Test make_text_box(), make_form_entry(), flatten(), boolean()."""
- import sys
- root = Tk()
- entry, eframe = make_form_entry(root, 'Boolean:')
- text, tframe = make_text_box(root)
- def enter(event, entry=entry, text=text):
- s = boolean(entry.get()) and '\nyes' or '\nno'
- text.insert('end', s)
- entry.bind('<Return>', enter)
- entry.insert(END, flatten(sys.argv))
- root.mainloop()
-
-
-if __name__ == '__main__':
- test()
diff --git a/Tools/webchecker/wcgui.py b/Tools/webchecker/wcgui.py
deleted file mode 100755
index 4ce613aff8..0000000000
--- a/Tools/webchecker/wcgui.py
+++ /dev/null
@@ -1,462 +0,0 @@
-#! /usr/bin/env python
-
-"""GUI interface to webchecker.
-
-This works as a Grail applet too! E.g.
-
- <APPLET CODE=wcgui.py NAME=CheckerWindow></APPLET>
-
-Checkpoints are not (yet??? ever???) supported.
-
-User interface:
-
-Enter a root to check in the text entry box. To enter more than one root,
-enter them one at a time and press <Return> for each one.
-
-Command buttons Start, Stop and "Check one" govern the checking process in
-the obvious way. Start and "Check one" also enter the root from the text
-entry box if one is present. There's also a check box (enabled by default)
-to decide whether actually to follow external links (since this can slow
-the checking down considerably). Finally there's a Quit button.
-
-A series of checkbuttons determines whether the corresponding output panel
-is shown. List panels are also automatically shown or hidden when their
-status changes between empty to non-empty. There are six panels:
-
-Log -- raw output from the checker (-v, -q affect this)
-To check -- links discovered but not yet checked
-Checked -- links that have been checked
-Bad links -- links that failed upon checking
-Errors -- pages containing at least one bad link
-Details -- details about one URL; double click on a URL in any of
- the above list panels (not in Log) will show details
- for that URL
-
-Use your window manager's Close command to quit.
-
-Command line options:
-
--m bytes -- skip HTML pages larger than this size (default %(MAXPAGE)d)
--q -- quiet operation (also suppresses external links report)
--v -- verbose operation; repeating -v will increase verbosity
--t root -- specify root dir which should be treated as internal (can repeat)
--a -- don't check name anchors
-
-Command line arguments:
-
-rooturl -- URL to start checking
- (default %(DEFROOT)s)
-
-XXX The command line options (-m, -q, -v) should be GUI accessible.
-
-XXX The roots should be visible as a list (?).
-
-XXX The multipanel user interface is clumsy.
-
-"""
-
-# ' Emacs bait
-
-
-import sys
-import getopt
-from Tkinter import *
-import tktools
-import webchecker
-
-# Override some for a weaker platform
-if sys.platform == 'mac':
- webchecker.DEFROOT = "http://grail.cnri.reston.va.us/"
- webchecker.MAXPAGE = 50000
- webchecker.verbose = 4
-
-def main():
- try:
- opts, args = getopt.getopt(sys.argv[1:], 't:m:qva')
- except getopt.error as msg:
- sys.stdout = sys.stderr
- print(msg)
- print(__doc__%vars(webchecker))
- sys.exit(2)
- webchecker.verbose = webchecker.VERBOSE
- webchecker.nonames = webchecker.NONAMES
- webchecker.maxpage = webchecker.MAXPAGE
- extra_roots = []
- for o, a in opts:
- if o == '-m':
- webchecker.maxpage = int(a)
- if o == '-q':
- webchecker.verbose = 0
- if o == '-v':
- webchecker.verbose = webchecker.verbose + 1
- if o == '-t':
- extra_roots.append(a)
- if o == '-a':
- webchecker.nonames = not webchecker.nonames
- root = Tk(className='Webchecker')
- root.protocol("WM_DELETE_WINDOW", root.quit)
- c = CheckerWindow(root)
- c.setflags(verbose=webchecker.verbose, maxpage=webchecker.maxpage,
- nonames=webchecker.nonames)
- if args:
- for arg in args[:-1]:
- c.addroot(arg)
- c.suggestroot(args[-1])
- # Usually conditioned on whether external links
- # will be checked, but since that's not a command
- # line option, just toss them in.
- for url_root in extra_roots:
- # Make sure it's terminated by a slash,
- # so that addroot doesn't discard the last
- # directory component.
- if url_root[-1] != "/":
- url_root = url_root + "/"
- c.addroot(url_root, add_to_do = 0)
- root.mainloop()
-
-
-class CheckerWindow(webchecker.Checker):
-
- def __init__(self, parent, root=webchecker.DEFROOT):
- self.__parent = parent
-
- self.__topcontrols = Frame(parent)
- self.__topcontrols.pack(side=TOP, fill=X)
- self.__label = Label(self.__topcontrols, text="Root URL:")
- self.__label.pack(side=LEFT)
- self.__rootentry = Entry(self.__topcontrols, width=60)
- self.__rootentry.pack(side=LEFT)
- self.__rootentry.bind('<Return>', self.enterroot)
- self.__rootentry.focus_set()
-
- self.__controls = Frame(parent)
- self.__controls.pack(side=TOP, fill=X)
- self.__running = 0
- self.__start = Button(self.__controls, text="Run", command=self.start)
- self.__start.pack(side=LEFT)
- self.__stop = Button(self.__controls, text="Stop", command=self.stop,
- state=DISABLED)
- self.__stop.pack(side=LEFT)
- self.__step = Button(self.__controls, text="Check one",
- command=self.step)
- self.__step.pack(side=LEFT)
- self.__cv = BooleanVar(parent)
- self.__cv.set(self.checkext)
- self.__checkext = Checkbutton(self.__controls, variable=self.__cv,
- command=self.update_checkext,
- text="Check nonlocal links",)
- self.__checkext.pack(side=LEFT)
- self.__reset = Button(self.__controls, text="Start over", command=self.reset)
- self.__reset.pack(side=LEFT)
- if __name__ == '__main__': # No Quit button under Grail!
- self.__quit = Button(self.__controls, text="Quit",
- command=self.__parent.quit)
- self.__quit.pack(side=RIGHT)
-
- self.__status = Label(parent, text="Status: initial", anchor=W)
- self.__status.pack(side=TOP, fill=X)
- self.__checking = Label(parent, text="Idle", anchor=W)
- self.__checking.pack(side=TOP, fill=X)
- self.__mp = mp = MultiPanel(parent)
- sys.stdout = self.__log = LogPanel(mp, "Log")
- self.__todo = ListPanel(mp, "To check", self, self.showinfo)
- self.__done = ListPanel(mp, "Checked", self, self.showinfo)
- self.__bad = ListPanel(mp, "Bad links", self, self.showinfo)
- self.__errors = ListPanel(mp, "Pages w/ bad links", self, self.showinfo)
- self.__details = LogPanel(mp, "Details")
- self.root_seed = None
- webchecker.Checker.__init__(self)
- if root:
- root = str(root).strip()
- if root:
- self.suggestroot(root)
- self.newstatus()
-
- def reset(self):
- webchecker.Checker.reset(self)
- for p in self.__todo, self.__done, self.__bad, self.__errors:
- p.clear()
- if self.root_seed:
- self.suggestroot(self.root_seed)
-
- def suggestroot(self, root):
- self.__rootentry.delete(0, END)
- self.__rootentry.insert(END, root)
- self.__rootentry.select_range(0, END)
- self.root_seed = root
-
- def enterroot(self, event=None):
- root = self.__rootentry.get()
- root = root.strip()
- if root:
- self.__checking.config(text="Adding root "+root)
- self.__checking.update_idletasks()
- self.addroot(root)
- self.__checking.config(text="Idle")
- try:
- i = self.__todo.items.index(root)
- except (ValueError, IndexError):
- pass
- else:
- self.__todo.list.select_clear(0, END)
- self.__todo.list.select_set(i)
- self.__todo.list.yview(i)
- self.__rootentry.delete(0, END)
-
- def start(self):
- self.__start.config(state=DISABLED, relief=SUNKEN)
- self.__stop.config(state=NORMAL)
- self.__step.config(state=DISABLED)
- self.enterroot()
- self.__running = 1
- self.go()
-
- def stop(self):
- self.__stop.config(state=DISABLED, relief=SUNKEN)
- self.__running = 0
-
- def step(self):
- self.__start.config(state=DISABLED)
- self.__step.config(state=DISABLED, relief=SUNKEN)
- self.enterroot()
- self.__running = 0
- self.dosomething()
-
- def go(self):
- if self.__running:
- self.__parent.after_idle(self.dosomething)
- else:
- self.__checking.config(text="Idle")
- self.__start.config(state=NORMAL, relief=RAISED)
- self.__stop.config(state=DISABLED, relief=RAISED)
- self.__step.config(state=NORMAL, relief=RAISED)
-
- __busy = 0
-
- def dosomething(self):
- if self.__busy: return
- self.__busy = 1
- if self.todo:
- l = self.__todo.selectedindices()
- if l:
- i = l[0]
- else:
- i = 0
- self.__todo.list.select_set(i)
- self.__todo.list.yview(i)
- url = self.__todo.items[i]
- self.__checking.config(text="Checking "+self.format_url(url))
- self.__parent.update()
- self.dopage(url)
- else:
- self.stop()
- self.__busy = 0
- self.go()
-
- def showinfo(self, url):
- d = self.__details
- d.clear()
- d.put("URL: %s\n" % self.format_url(url))
- if url in self.bad:
- d.put("Error: %s\n" % str(self.bad[url]))
- if url in self.roots:
- d.put("Note: This is a root URL\n")
- if url in self.done:
- d.put("Status: checked\n")
- o = self.done[url]
- elif url in self.todo:
- d.put("Status: to check\n")
- o = self.todo[url]
- else:
- d.put("Status: unknown (!)\n")
- o = []
- if (not url[1]) and url[0] in self.errors:
- d.put("Bad links from this page:\n")
- for triple in self.errors[url[0]]:
- link, rawlink, msg = triple
- d.put(" HREF %s" % self.format_url(link))
- if self.format_url(link) != rawlink: d.put(" (%s)" %rawlink)
- d.put("\n")
- d.put(" error %s\n" % str(msg))
- self.__mp.showpanel("Details")
- for source, rawlink in o:
- d.put("Origin: %s" % source)
- if rawlink != self.format_url(url):
- d.put(" (%s)" % rawlink)
- d.put("\n")
- d.text.yview("1.0")
-
- def setbad(self, url, msg):
- webchecker.Checker.setbad(self, url, msg)
- self.__bad.insert(url)
- self.newstatus()
-
- def setgood(self, url):
- webchecker.Checker.setgood(self, url)
- self.__bad.remove(url)
- self.newstatus()
-
- def newlink(self, url, origin):
- webchecker.Checker.newlink(self, url, origin)
- if url in self.done:
- self.__done.insert(url)
- elif url in self.todo:
- self.__todo.insert(url)
- self.newstatus()
-
- def markdone(self, url):
- webchecker.Checker.markdone(self, url)
- self.__done.insert(url)
- self.__todo.remove(url)
- self.newstatus()
-
- def seterror(self, url, triple):
- webchecker.Checker.seterror(self, url, triple)
- self.__errors.insert((url, ''))
- self.newstatus()
-
- def newstatus(self):
- self.__status.config(text="Status: "+self.status())
- self.__parent.update()
-
- def update_checkext(self):
- self.checkext = self.__cv.get()
-
-
-class ListPanel:
-
- def __init__(self, mp, name, checker, showinfo=None):
- self.mp = mp
- self.name = name
- self.showinfo = showinfo
- self.checker = checker
- self.panel = mp.addpanel(name)
- self.list, self.frame = tktools.make_list_box(
- self.panel, width=60, height=5)
- self.list.config(exportselection=0)
- if showinfo:
- self.list.bind('<Double-Button-1>', self.doubleclick)
- self.items = []
-
- def clear(self):
- self.items = []
- self.list.delete(0, END)
- self.mp.hidepanel(self.name)
-
- def doubleclick(self, event):
- l = self.selectedindices()
- if l:
- self.showinfo(self.items[l[0]])
-
- def selectedindices(self):
- l = self.list.curselection()
- if not l: return []
- return list(map(int, l))
-
- def insert(self, url):
- if url not in self.items:
- if not self.items:
- self.mp.showpanel(self.name)
- # (I tried sorting alphabetically, but the display is too jumpy)
- i = len(self.items)
- self.list.insert(i, self.checker.format_url(url))
- self.list.yview(i)
- self.items.insert(i, url)
-
- def remove(self, url):
- try:
- i = self.items.index(url)
- except (ValueError, IndexError):
- pass
- else:
- was_selected = i in self.selectedindices()
- self.list.delete(i)
- del self.items[i]
- if not self.items:
- self.mp.hidepanel(self.name)
- elif was_selected:
- if i >= len(self.items):
- i = len(self.items) - 1
- self.list.select_set(i)
-
-
-class LogPanel:
-
- def __init__(self, mp, name):
- self.mp = mp
- self.name = name
- self.panel = mp.addpanel(name)
- self.text, self.frame = tktools.make_text_box(self.panel, height=10)
- self.text.config(wrap=NONE)
-
- def clear(self):
- self.text.delete("1.0", END)
- self.text.yview("1.0")
-
- def put(self, s):
- self.text.insert(END, s)
- if '\n' in s:
- self.text.yview(END)
-
- def write(self, s):
- self.text.insert(END, s)
- if '\n' in s:
- self.text.yview(END)
- self.panel.update()
-
-
-class MultiPanel:
-
- def __init__(self, parent):
- self.parent = parent
- self.frame = Frame(self.parent)
- self.frame.pack(expand=1, fill=BOTH)
- self.topframe = Frame(self.frame, borderwidth=2, relief=RAISED)
- self.topframe.pack(fill=X)
- self.botframe = Frame(self.frame)
- self.botframe.pack(expand=1, fill=BOTH)
- self.panelnames = []
- self.panels = {}
-
- def addpanel(self, name, on=0):
- v = StringVar(self.parent)
- if on:
- v.set(name)
- else:
- v.set("")
- check = Checkbutton(self.topframe, text=name,
- offvalue="", onvalue=name, variable=v,
- command=self.checkpanel)
- check.pack(side=LEFT)
- panel = Frame(self.botframe)
- label = Label(panel, text=name, borderwidth=2, relief=RAISED, anchor=W)
- label.pack(side=TOP, fill=X)
- t = v, check, panel
- self.panelnames.append(name)
- self.panels[name] = t
- if on:
- panel.pack(expand=1, fill=BOTH)
- return panel
-
- def showpanel(self, name):
- v, check, panel = self.panels[name]
- v.set(name)
- panel.pack(expand=1, fill=BOTH)
-
- def hidepanel(self, name):
- v, check, panel = self.panels[name]
- v.set("")
- panel.pack_forget()
-
- def checkpanel(self):
- for name in self.panelnames:
- v, check, panel = self.panels[name]
- panel.pack_forget()
- for name in self.panelnames:
- v, check, panel = self.panels[name]
- if v.get():
- panel.pack(expand=1, fill=BOTH)
-
-
-if __name__ == '__main__':
- main()
diff --git a/Tools/webchecker/wcmac.py b/Tools/webchecker/wcmac.py
deleted file mode 100644
index 9edcd5de1a..0000000000
--- a/Tools/webchecker/wcmac.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import webchecker, sys
-webchecker.DEFROOT = "http://www.python.org/python/"
-webchecker.MAXPAGE = 50000
-webchecker.verbose = 2
-sys.argv.append('-x')
-webchecker.main()
-sys.stdout.write("\nCR to exit: ")
-sys.stdout.flush()
-sys.stdin.readline()
diff --git a/Tools/webchecker/webchecker.py b/Tools/webchecker/webchecker.py
deleted file mode 100755
index 651cf85aa0..0000000000
--- a/Tools/webchecker/webchecker.py
+++ /dev/null
@@ -1,890 +0,0 @@
-#! /usr/bin/env python
-
-# Original code by Guido van Rossum; extensive changes by Sam Bayer,
-# including code to check URL fragments.
-
-"""Web tree checker.
-
-This utility is handy to check a subweb of the world-wide web for
-errors. A subweb is specified by giving one or more ``root URLs''; a
-page belongs to the subweb if one of the root URLs is an initial
-prefix of it.
-
-File URL extension:
-
-In order to easy the checking of subwebs via the local file system,
-the interpretation of ``file:'' URLs is extended to mimic the behavior
-of your average HTTP daemon: if a directory pathname is given, the
-file index.html in that directory is returned if it exists, otherwise
-a directory listing is returned. Now, you can point webchecker to the
-document tree in the local file system of your HTTP daemon, and have
-most of it checked. In fact the default works this way if your local
-web tree is located at /usr/local/etc/httpd/htdpcs (the default for
-the NCSA HTTP daemon and probably others).
-
-Report printed:
-
-When done, it reports pages with bad links within the subweb. When
-interrupted, it reports for the pages that it has checked already.
-
-In verbose mode, additional messages are printed during the
-information gathering phase. By default, it prints a summary of its
-work status every 50 URLs (adjustable with the -r option), and it
-reports errors as they are encountered. Use the -q option to disable
-this output.
-
-Checkpoint feature:
-
-Whether interrupted or not, it dumps its state (a Python pickle) to a
-checkpoint file and the -R option allows it to restart from the
-checkpoint (assuming that the pages on the subweb that were already
-processed haven't changed). Even when it has run till completion, -R
-can still be useful -- it will print the reports again, and -Rq prints
-the errors only. In this case, the checkpoint file is not written
-again. The checkpoint file can be set with the -d option.
-
-The checkpoint file is written as a Python pickle. Remember that
-Python's pickle module is currently quite slow. Give it the time it
-needs to load and save the checkpoint file. When interrupted while
-writing the checkpoint file, the old checkpoint file is not
-overwritten, but all work done in the current run is lost.
-
-Miscellaneous:
-
-- You may find the (Tk-based) GUI version easier to use. See wcgui.py.
-
-- Webchecker honors the "robots.txt" convention. Thanks to Skip
-Montanaro for his robotparser.py module (included in this directory)!
-The agent name is hardwired to "webchecker". URLs that are disallowed
-by the robots.txt file are reported as external URLs.
-
-- Because the SGML parser is a bit slow, very large SGML files are
-skipped. The size limit can be set with the -m option.
-
-- When the server or protocol does not tell us a file's type, we guess
-it based on the URL's suffix. The mimetypes.py module (also in this
-directory) has a built-in table mapping most currently known suffixes,
-and in addition attempts to read the mime.types configuration files in
-the default locations of Netscape and the NCSA HTTP daemon.
-
-- We follow links indicated by <A>, <FRAME> and <IMG> tags. We also
-honor the <BASE> tag.
-
-- We now check internal NAME anchor links, as well as toplevel links.
-
-- Checking external links is now done by default; use -x to *disable*
-this feature. External links are now checked during normal
-processing. (XXX The status of a checked link could be categorized
-better. Later...)
-
-- If external links are not checked, you can use the -t flag to
-provide specific overrides to -x.
-
-Usage: webchecker.py [option] ... [rooturl] ...
-
-Options:
-
--R -- restart from checkpoint file
--d file -- checkpoint filename (default %(DUMPFILE)s)
--m bytes -- skip HTML pages larger than this size (default %(MAXPAGE)d)
--n -- reports only, no checking (use with -R)
--q -- quiet operation (also suppresses external links report)
--r number -- number of links processed per round (default %(ROUNDSIZE)d)
--t root -- specify root dir which should be treated as internal (can repeat)
--v -- verbose operation; repeating -v will increase verbosity
--x -- don't check external links (these are often slow to check)
--a -- don't check name anchors
-
-Arguments:
-
-rooturl -- URL to start checking
- (default %(DEFROOT)s)
-
-"""
-
-
-__version__ = "$Revision$"
-
-
-import sys
-import os
-from types import *
-import io
-import getopt
-import pickle
-
-import urllib.request
-import urllib.parse as urlparse
-import sgmllib
-import cgi
-
-import mimetypes
-from urllib import robotparser
-
-# Extract real version number if necessary
-if __version__[0] == '$':
- _v = __version__.split()
- if len(_v) == 3:
- __version__ = _v[1]
-
-
-# Tunable parameters
-DEFROOT = "file:/usr/local/etc/httpd/htdocs/" # Default root URL
-CHECKEXT = 1 # Check external references (1 deep)
-VERBOSE = 1 # Verbosity level (0-3)
-MAXPAGE = 150000 # Ignore files bigger than this
-ROUNDSIZE = 50 # Number of links processed per round
-DUMPFILE = "@webchecker.pickle" # Pickled checkpoint
-AGENTNAME = "webchecker" # Agent name for robots.txt parser
-NONAMES = 0 # Force name anchor checking
-
-
-# Global variables
-
-
-def main():
- checkext = CHECKEXT
- verbose = VERBOSE
- maxpage = MAXPAGE
- roundsize = ROUNDSIZE
- dumpfile = DUMPFILE
- restart = 0
- norun = 0
-
- try:
- opts, args = getopt.getopt(sys.argv[1:], 'Rd:m:nqr:t:vxa')
- except getopt.error as msg:
- sys.stdout = sys.stderr
- print(msg)
- print(__doc__%globals())
- sys.exit(2)
-
- # The extra_roots variable collects extra roots.
- extra_roots = []
- nonames = NONAMES
-
- for o, a in opts:
- if o == '-R':
- restart = 1
- if o == '-d':
- dumpfile = a
- if o == '-m':
- maxpage = int(a)
- if o == '-n':
- norun = 1
- if o == '-q':
- verbose = 0
- if o == '-r':
- roundsize = int(a)
- if o == '-t':
- extra_roots.append(a)
- if o == '-a':
- nonames = not nonames
- if o == '-v':
- verbose = verbose + 1
- if o == '-x':
- checkext = not checkext
-
- if verbose > 0:
- print(AGENTNAME, "version", __version__)
-
- if restart:
- c = load_pickle(dumpfile=dumpfile, verbose=verbose)
- else:
- c = Checker()
-
- c.setflags(checkext=checkext, verbose=verbose,
- maxpage=maxpage, roundsize=roundsize,
- nonames=nonames
- )
-
- if not restart and not args:
- args.append(DEFROOT)
-
- for arg in args:
- c.addroot(arg)
-
- # The -t flag is only needed if external links are not to be
- # checked. So -t values are ignored unless -x was specified.
- if not checkext:
- for root in extra_roots:
- # Make sure it's terminated by a slash,
- # so that addroot doesn't discard the last
- # directory component.
- if root[-1] != "/":
- root = root + "/"
- c.addroot(root, add_to_do = 0)
-
- try:
-
- if not norun:
- try:
- c.run()
- except KeyboardInterrupt:
- if verbose > 0:
- print("[run interrupted]")
-
- try:
- c.report()
- except KeyboardInterrupt:
- if verbose > 0:
- print("[report interrupted]")
-
- finally:
- if c.save_pickle(dumpfile):
- if dumpfile == DUMPFILE:
- print("Use ``%s -R'' to restart." % sys.argv[0])
- else:
- print("Use ``%s -R -d %s'' to restart." % (sys.argv[0],
- dumpfile))
-
-
-def load_pickle(dumpfile=DUMPFILE, verbose=VERBOSE):
- if verbose > 0:
- print("Loading checkpoint from %s ..." % dumpfile)
- f = open(dumpfile, "rb")
- c = pickle.load(f)
- f.close()
- if verbose > 0:
- print("Done.")
- print("Root:", "\n ".join(c.roots))
- return c
-
-
-class Checker:
-
- checkext = CHECKEXT
- verbose = VERBOSE
- maxpage = MAXPAGE
- roundsize = ROUNDSIZE
- nonames = NONAMES
-
- validflags = tuple(dir())
-
- def __init__(self):
- self.reset()
-
- def setflags(self, **kw):
- for key in kw:
- if key not in self.validflags:
- raise NameError("invalid keyword argument: %s" % str(key))
- for key, value in kw.items():
- setattr(self, key, value)
-
- def reset(self):
- self.roots = []
- self.todo = {}
- self.done = {}
- self.bad = {}
-
- # Add a name table, so that the name URLs can be checked. Also
- # serves as an implicit cache for which URLs are done.
- self.name_table = {}
-
- self.round = 0
- # The following are not pickled:
- self.robots = {}
- self.errors = {}
- self.urlopener = MyURLopener()
- self.changed = 0
-
- def note(self, level, format, *args):
- if self.verbose > level:
- if args:
- format = format%args
- self.message(format)
-
- def message(self, format, *args):
- if args:
- format = format%args
- print(format)
-
- def __getstate__(self):
- return (self.roots, self.todo, self.done, self.bad, self.round)
-
- def __setstate__(self, state):
- self.reset()
- (self.roots, self.todo, self.done, self.bad, self.round) = state
- for root in self.roots:
- self.addrobot(root)
- for url in self.bad:
- self.markerror(url)
-
- def addroot(self, root, add_to_do = 1):
- if root not in self.roots:
- troot = root
- scheme, netloc, path, params, query, fragment = \
- urlparse.urlparse(root)
- i = path.rfind("/") + 1
- if 0 < i < len(path):
- path = path[:i]
- troot = urlparse.urlunparse((scheme, netloc, path,
- params, query, fragment))
- self.roots.append(troot)
- self.addrobot(root)
- if add_to_do:
- self.newlink((root, ""), ("<root>", root))
-
- def addrobot(self, root):
- root = urlparse.urljoin(root, "/")
- if root in self.robots: return
- url = urlparse.urljoin(root, "/robots.txt")
- self.robots[root] = rp = robotparser.RobotFileParser()
- self.note(2, "Parsing %s", url)
- rp.debug = self.verbose > 3
- rp.set_url(url)
- try:
- rp.read()
- except (OSError, IOError) as msg:
- self.note(1, "I/O error parsing %s: %s", url, msg)
-
- def run(self):
- while self.todo:
- self.round = self.round + 1
- self.note(0, "\nRound %d (%s)\n", self.round, self.status())
- urls = sorted(self.todo.keys())
- del urls[self.roundsize:]
- for url in urls:
- self.dopage(url)
-
- def status(self):
- return "%d total, %d to do, %d done, %d bad" % (
- len(self.todo)+len(self.done),
- len(self.todo), len(self.done),
- len(self.bad))
-
- def report(self):
- self.message("")
- if not self.todo: s = "Final"
- else: s = "Interim"
- self.message("%s Report (%s)", s, self.status())
- self.report_errors()
-
- def report_errors(self):
- if not self.bad:
- self.message("\nNo errors")
- return
- self.message("\nError Report:")
- sources = sorted(self.errors.keys())
- for source in sources:
- triples = self.errors[source]
- self.message("")
- if len(triples) > 1:
- self.message("%d Errors in %s", len(triples), source)
- else:
- self.message("Error in %s", source)
- # Call self.format_url() instead of referring
- # to the URL directly, since the URLs in these
- # triples is now a (URL, fragment) pair. The value
- # of the "source" variable comes from the list of
- # origins, and is a URL, not a pair.
- for url, rawlink, msg in triples:
- if rawlink != self.format_url(url): s = " (%s)" % rawlink
- else: s = ""
- self.message(" HREF %s%s\n msg %s",
- self.format_url(url), s, msg)
-
- def dopage(self, url_pair):
-
- # All printing of URLs uses format_url(); argument changed to
- # url_pair for clarity.
- if self.verbose > 1:
- if self.verbose > 2:
- self.show("Check ", self.format_url(url_pair),
- " from", self.todo[url_pair])
- else:
- self.message("Check %s", self.format_url(url_pair))
- url, local_fragment = url_pair
- if local_fragment and self.nonames:
- self.markdone(url_pair)
- return
- try:
- page = self.getpage(url_pair)
- except sgmllib.SGMLParseError as msg:
- msg = self.sanitize(msg)
- self.note(0, "Error parsing %s: %s",
- self.format_url(url_pair), msg)
- # Dont actually mark the URL as bad - it exists, just
- # we can't parse it!
- page = None
- if page:
- # Store the page which corresponds to this URL.
- self.name_table[url] = page
- # If there is a fragment in this url_pair, and it's not
- # in the list of names for the page, call setbad(), since
- # it's a missing anchor.
- if local_fragment and local_fragment not in page.getnames():
- self.setbad(url_pair, ("Missing name anchor `%s'" % local_fragment))
- for info in page.getlinkinfos():
- # getlinkinfos() now returns the fragment as well,
- # and we store that fragment here in the "todo" dictionary.
- link, rawlink, fragment = info
- # However, we don't want the fragment as the origin, since
- # the origin is logically a page.
- origin = url, rawlink
- self.newlink((link, fragment), origin)
- else:
- # If no page has been created yet, we want to
- # record that fact.
- self.name_table[url_pair[0]] = None
- self.markdone(url_pair)
-
- def newlink(self, url, origin):
- if url in self.done:
- self.newdonelink(url, origin)
- else:
- self.newtodolink(url, origin)
-
- def newdonelink(self, url, origin):
- if origin not in self.done[url]:
- self.done[url].append(origin)
-
- # Call self.format_url(), since the URL here
- # is now a (URL, fragment) pair.
- self.note(3, " Done link %s", self.format_url(url))
-
- # Make sure that if it's bad, that the origin gets added.
- if url in self.bad:
- source, rawlink = origin
- triple = url, rawlink, self.bad[url]
- self.seterror(source, triple)
-
- def newtodolink(self, url, origin):
- # Call self.format_url(), since the URL here
- # is now a (URL, fragment) pair.
- if url in self.todo:
- if origin not in self.todo[url]:
- self.todo[url].append(origin)
- self.note(3, " Seen todo link %s", self.format_url(url))
- else:
- self.todo[url] = [origin]
- self.note(3, " New todo link %s", self.format_url(url))
-
- def format_url(self, url):
- link, fragment = url
- if fragment: return link + "#" + fragment
- else: return link
-
- def markdone(self, url):
- self.done[url] = self.todo[url]
- del self.todo[url]
- self.changed = 1
-
- def inroots(self, url):
- for root in self.roots:
- if url[:len(root)] == root:
- return self.isallowed(root, url)
- return 0
-
- def isallowed(self, root, url):
- root = urlparse.urljoin(root, "/")
- return self.robots[root].can_fetch(AGENTNAME, url)
-
- def getpage(self, url_pair):
- # Incoming argument name is a (URL, fragment) pair.
- # The page may have been cached in the name_table variable.
- url, fragment = url_pair
- if url in self.name_table:
- return self.name_table[url]
-
- scheme, path = urllib.request.splittype(url)
- if scheme in ('mailto', 'news', 'javascript', 'telnet'):
- self.note(1, " Not checking %s URL" % scheme)
- return None
- isint = self.inroots(url)
-
- # Ensure that openpage gets the URL pair to
- # print out its error message and record the error pair
- # correctly.
- if not isint:
- if not self.checkext:
- self.note(1, " Not checking ext link")
- return None
- f = self.openpage(url_pair)
- if f:
- self.safeclose(f)
- return None
- text, nurl = self.readhtml(url_pair)
-
- if nurl != url:
- self.note(1, " Redirected to %s", nurl)
- url = nurl
- if text:
- return Page(text, url, maxpage=self.maxpage, checker=self)
-
- # These next three functions take (URL, fragment) pairs as
- # arguments, so that openpage() receives the appropriate tuple to
- # record error messages.
- def readhtml(self, url_pair):
- url, fragment = url_pair
- text = None
- f, url = self.openhtml(url_pair)
- if f:
- text = f.read()
- f.close()
- return text, url
-
- def openhtml(self, url_pair):
- url, fragment = url_pair
- f = self.openpage(url_pair)
- if f:
- url = f.geturl()
- info = f.info()
- if not self.checkforhtml(info, url):
- self.safeclose(f)
- f = None
- return f, url
-
- def openpage(self, url_pair):
- url, fragment = url_pair
- try:
- return self.urlopener.open(url)
- except (OSError, IOError) as msg:
- msg = self.sanitize(msg)
- self.note(0, "Error %s", msg)
- if self.verbose > 0:
- self.show(" HREF ", url, " from", self.todo[url_pair])
- self.setbad(url_pair, msg)
- return None
-
- def checkforhtml(self, info, url):
- if 'content-type' in info:
- ctype = cgi.parse_header(info['content-type'])[0].lower()
- if ';' in ctype:
- # handle content-type: text/html; charset=iso8859-1 :
- ctype = ctype.split(';', 1)[0].strip()
- else:
- if url[-1:] == "/":
- return 1
- ctype, encoding = mimetypes.guess_type(url)
- if ctype == 'text/html':
- return 1
- else:
- self.note(1, " Not HTML, mime type %s", ctype)
- return 0
-
- def setgood(self, url):
- if url in self.bad:
- del self.bad[url]
- self.changed = 1
- self.note(0, "(Clear previously seen error)")
-
- def setbad(self, url, msg):
- if url in self.bad and self.bad[url] == msg:
- self.note(0, "(Seen this error before)")
- return
- self.bad[url] = msg
- self.changed = 1
- self.markerror(url)
-
- def markerror(self, url):
- try:
- origins = self.todo[url]
- except KeyError:
- origins = self.done[url]
- for source, rawlink in origins:
- triple = url, rawlink, self.bad[url]
- self.seterror(source, triple)
-
- def seterror(self, url, triple):
- try:
- # Because of the way the URLs are now processed, I need to
- # check to make sure the URL hasn't been entered in the
- # error list. The first element of the triple here is a
- # (URL, fragment) pair, but the URL key is not, since it's
- # from the list of origins.
- if triple not in self.errors[url]:
- self.errors[url].append(triple)
- except KeyError:
- self.errors[url] = [triple]
-
- # The following used to be toplevel functions; they have been
- # changed into methods so they can be overridden in subclasses.
-
- def show(self, p1, link, p2, origins):
- self.message("%s %s", p1, link)
- i = 0
- for source, rawlink in origins:
- i = i+1
- if i == 2:
- p2 = ' '*len(p2)
- if rawlink != link: s = " (%s)" % rawlink
- else: s = ""
- self.message("%s %s%s", p2, source, s)
-
- def sanitize(self, msg):
- if isinstance(IOError, ClassType) and isinstance(msg, IOError):
- # Do the other branch recursively
- msg.args = self.sanitize(msg.args)
- elif isinstance(msg, TupleType):
- if len(msg) >= 4 and msg[0] == 'http error' and \
- isinstance(msg[3], InstanceType):
- # Remove the Message instance -- it may contain
- # a file object which prevents pickling.
- msg = msg[:3] + msg[4:]
- return msg
-
- def safeclose(self, f):
- try:
- url = f.geturl()
- except AttributeError:
- pass
- else:
- if url[:4] == 'ftp:' or url[:7] == 'file://':
- # Apparently ftp connections don't like to be closed
- # prematurely...
- text = f.read()
- f.close()
-
- def save_pickle(self, dumpfile=DUMPFILE):
- if not self.changed:
- self.note(0, "\nNo need to save checkpoint")
- elif not dumpfile:
- self.note(0, "No dumpfile, won't save checkpoint")
- else:
- self.note(0, "\nSaving checkpoint to %s ...", dumpfile)
- newfile = dumpfile + ".new"
- f = open(newfile, "wb")
- pickle.dump(self, f)
- f.close()
- try:
- os.unlink(dumpfile)
- except os.error:
- pass
- os.rename(newfile, dumpfile)
- self.note(0, "Done.")
- return 1
-
-
-class Page:
-
- def __init__(self, text, url, verbose=VERBOSE, maxpage=MAXPAGE, checker=None):
- self.text = text
- self.url = url
- self.verbose = verbose
- self.maxpage = maxpage
- self.checker = checker
-
- # The parsing of the page is done in the __init__() routine in
- # order to initialize the list of names the file
- # contains. Stored the parser in an instance variable. Passed
- # the URL to MyHTMLParser().
- size = len(self.text)
- if size > self.maxpage:
- self.note(0, "Skip huge file %s (%.0f Kbytes)", self.url, (size*0.001))
- self.parser = None
- return
- self.checker.note(2, " Parsing %s (%d bytes)", self.url, size)
- self.parser = MyHTMLParser(url, verbose=self.verbose,
- checker=self.checker)
- self.parser.feed(self.text)
- self.parser.close()
-
- def note(self, level, msg, *args):
- if self.checker:
- self.checker.note(level, msg, *args)
- else:
- if self.verbose >= level:
- if args:
- msg = msg%args
- print(msg)
-
- # Method to retrieve names.
- def getnames(self):
- if self.parser:
- return self.parser.names
- else:
- return []
-
- def getlinkinfos(self):
- # File reading is done in __init__() routine. Store parser in
- # local variable to indicate success of parsing.
-
- # If no parser was stored, fail.
- if not self.parser: return []
-
- rawlinks = self.parser.getlinks()
- base = urlparse.urljoin(self.url, self.parser.getbase() or "")
- infos = []
- for rawlink in rawlinks:
- t = urlparse.urlparse(rawlink)
- # DON'T DISCARD THE FRAGMENT! Instead, include
- # it in the tuples which are returned. See Checker.dopage().
- fragment = t[-1]
- t = t[:-1] + ('',)
- rawlink = urlparse.urlunparse(t)
- link = urlparse.urljoin(base, rawlink)
- infos.append((link, rawlink, fragment))
-
- return infos
-
-
-class MyStringIO(io.StringIO):
-
- def __init__(self, url, info):
- self.__url = url
- self.__info = info
- super(MyStringIO, self).__init__(self)
-
- def info(self):
- return self.__info
-
- def geturl(self):
- return self.__url
-
-
-class MyURLopener(urllib.request.FancyURLopener):
-
- http_error_default = urllib.request.URLopener.http_error_default
-
- def __init__(*args):
- self = args[0]
- urllib.request.FancyURLopener.__init__(*args)
- self.addheaders = [
- ('User-agent', 'Python-webchecker/%s' % __version__),
- ]
-
- def http_error_401(self, url, fp, errcode, errmsg, headers):
- return None
-
- def open_file(self, url):
- path = urllib.url2pathname(urllib.unquote(url))
- if os.path.isdir(path):
- if path[-1] != os.sep:
- url = url + '/'
- indexpath = os.path.join(path, "index.html")
- if os.path.exists(indexpath):
- return self.open_file(url + "index.html")
- try:
- names = os.listdir(path)
- except os.error as msg:
- exc_type, exc_value, exc_tb = sys.exc_info()
- raise IOError(msg).with_traceback(exc_tb)
- names.sort()
- s = MyStringIO("file:"+url, {'content-type': 'text/html'})
- s.write('<BASE HREF="file:%s">\n' %
- urllib.quote(os.path.join(path, "")))
- for name in names:
- q = urllib.quote(name)
- s.write('<A HREF="%s">%s</A>\n' % (q, q))
- s.seek(0)
- return s
- return urllib.request.FancyURLopener.open_file(self, url)
-
-
-class MyHTMLParser(sgmllib.SGMLParser):
-
- def __init__(self, url, verbose=VERBOSE, checker=None):
- self.myverbose = verbose # now unused
- self.checker = checker
- self.base = None
- self.links = {}
- self.names = []
- self.url = url
- sgmllib.SGMLParser.__init__(self)
-
- def check_name_id(self, attributes):
- """ Check the name or id attributes on an element.
- """
- # We must rescue the NAME or id (name is deprecated in XHTML)
- # attributes from the anchor, in order to
- # cache the internal anchors which are made
- # available in the page.
- for name, value in attributes:
- if name == "name" or name == "id":
- if value in self.names:
- self.checker.message("WARNING: duplicate ID name %s in %s",
- value, self.url)
- else: self.names.append(value)
- break
-
- def unknown_starttag(self, tag, attributes):
- """ In XHTML, you can have id attributes on any element.
- """
- self.check_name_id(attributes)
-
- def start_a(self, attributes):
- self.link_attr(attributes, 'href')
- self.check_name_id(attributes)
-
- def end_a(self): pass
-
- def do_area(self, attributes):
- self.link_attr(attributes, 'href')
- self.check_name_id(attributes)
-
- def do_body(self, attributes):
- self.link_attr(attributes, 'background', 'bgsound')
- self.check_name_id(attributes)
-
- def do_img(self, attributes):
- self.link_attr(attributes, 'src', 'lowsrc')
- self.check_name_id(attributes)
-
- def do_frame(self, attributes):
- self.link_attr(attributes, 'src', 'longdesc')
- self.check_name_id(attributes)
-
- def do_iframe(self, attributes):
- self.link_attr(attributes, 'src', 'longdesc')
- self.check_name_id(attributes)
-
- def do_link(self, attributes):
- for name, value in attributes:
- if name == "rel":
- parts = value.lower().split()
- if ( parts == ["stylesheet"]
- or parts == ["alternate", "stylesheet"]):
- self.link_attr(attributes, "href")
- break
- self.check_name_id(attributes)
-
- def do_object(self, attributes):
- self.link_attr(attributes, 'data', 'usemap')
- self.check_name_id(attributes)
-
- def do_script(self, attributes):
- self.link_attr(attributes, 'src')
- self.check_name_id(attributes)
-
- def do_table(self, attributes):
- self.link_attr(attributes, 'background')
- self.check_name_id(attributes)
-
- def do_td(self, attributes):
- self.link_attr(attributes, 'background')
- self.check_name_id(attributes)
-
- def do_th(self, attributes):
- self.link_attr(attributes, 'background')
- self.check_name_id(attributes)
-
- def do_tr(self, attributes):
- self.link_attr(attributes, 'background')
- self.check_name_id(attributes)
-
- def link_attr(self, attributes, *args):
- for name, value in attributes:
- if name in args:
- if value: value = value.strip()
- if value: self.links[value] = None
-
- def do_base(self, attributes):
- for name, value in attributes:
- if name == 'href':
- if value: value = value.strip()
- if value:
- if self.checker:
- self.checker.note(1, " Base %s", value)
- self.base = value
- self.check_name_id(attributes)
-
- def getlinks(self):
- return list(self.links.keys())
-
- def getbase(self):
- return self.base
-
-
-if __name__ == '__main__':
- main()
diff --git a/Tools/webchecker/websucker.py b/Tools/webchecker/websucker.py
deleted file mode 100755
index 3bbdec36da..0000000000
--- a/Tools/webchecker/websucker.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#! /usr/bin/env python
-
-"""A variant on webchecker that creates a mirror copy of a remote site."""
-
-__version__ = "$Revision$"
-
-import os
-import sys
-import getopt
-import urllib.parse
-
-import webchecker
-
-# Extract real version number if necessary
-if __version__[0] == '$':
- _v = __version__.split()
- if len(_v) == 3:
- __version__ = _v[1]
-
-def main():
- verbose = webchecker.VERBOSE
- try:
- opts, args = getopt.getopt(sys.argv[1:], "qv")
- except getopt.error as msg:
- print(msg)
- print("usage:", sys.argv[0], "[-qv] ... [rooturl] ...")
- return 2
- for o, a in opts:
- if o == "-q":
- verbose = 0
- if o == "-v":
- verbose = verbose + 1
- c = Sucker()
- c.setflags(verbose=verbose)
- c.urlopener.addheaders = [
- ('User-agent', 'websucker/%s' % __version__),
- ]
- for arg in args:
- print("Adding root", arg)
- c.addroot(arg)
- print("Run...")
- c.run()
-
-class Sucker(webchecker.Checker):
-
- checkext = 0
- nonames = 1
-
- # SAM 11/13/99: in general, URLs are now URL pairs.
- # Since we've suppressed name anchor checking,
- # we can ignore the second dimension.
-
- def readhtml(self, url_pair):
- url = url_pair[0]
- text = None
- path = self.savefilename(url)
- try:
- f = open(path, "rb")
- except IOError:
- f = self.openpage(url_pair)
- if f:
- info = f.info()
- nurl = f.geturl()
- if nurl != url:
- url = nurl
- path = self.savefilename(url)
- text = f.read()
- f.close()
- self.savefile(text, path)
- if not self.checkforhtml(info, url):
- text = None
- else:
- if self.checkforhtml({}, url):
- text = f.read()
- f.close()
- return text, url
-
- def savefile(self, text, path):
- dir, base = os.path.split(path)
- makedirs(dir)
- try:
- f = open(path, "wb")
- f.write(text)
- f.close()
- self.message("saved %s", path)
- except IOError as msg:
- self.message("didn't save %s: %s", path, str(msg))
-
- def savefilename(self, url):
- type, rest = urllib.parse.splittype(url)
- host, path = urllib.parse.splithost(rest)
- path = path.lstrip("/")
- user, host = urllib.parse.splituser(host)
- host, port = urllib.parse.splitnport(host)
- host = host.lower()
- if not path or path[-1] == "/":
- path = path + "index.html"
- if os.sep != "/":
- path = os.sep.join(path.split("/"))
- if os.name == "mac":
- path = os.sep + path
- path = os.path.join(host, path)
- return path
-
-def makedirs(dir):
- if not dir:
- return
- if os.path.exists(dir):
- if not os.path.isdir(dir):
- try:
- os.rename(dir, dir + ".bak")
- os.mkdir(dir)
- os.rename(dir + ".bak", os.path.join(dir, "index.html"))
- except os.error:
- pass
- return
- head, tail = os.path.split(dir)
- if not tail:
- print("Huh? Don't know how to make dir", dir)
- return
- makedirs(head)
- os.mkdir(dir, 0o777)
-
-if __name__ == '__main__':
- sys.exit(main() or 0)
diff --git a/Tools/webchecker/wsgui.py b/Tools/webchecker/wsgui.py
deleted file mode 100755
index b2223c401d..0000000000
--- a/Tools/webchecker/wsgui.py
+++ /dev/null
@@ -1,240 +0,0 @@
-#! /usr/bin/env python
-
-"""Tkinter-based GUI for websucker.
-
-Easy use: type or paste source URL and destination directory in
-their respective text boxes, click GO or hit return, and presto.
-"""
-
-from Tkinter import *
-import websucker
-import os
-import threading
-import queue
-import time
-
-VERBOSE = 2
-
-
-try:
- class Canceled(Exception):
- "Exception used to cancel run()."
-except (NameError, TypeError):
- Canceled = __name__ + ".Canceled"
-
-
-class SuckerThread(websucker.Sucker):
-
- stopit = 0
- savedir = None
- rootdir = None
-
- def __init__(self, msgq):
- self.msgq = msgq
- websucker.Sucker.__init__(self)
- self.setflags(verbose=VERBOSE)
- self.urlopener.addheaders = [
- ('User-agent', 'websucker/%s' % websucker.__version__),
- ]
-
- def message(self, format, *args):
- if args:
- format = format%args
- ##print format
- self.msgq.put(format)
-
- def run1(self, url):
- try:
- try:
- self.reset()
- self.addroot(url)
- self.run()
- except Canceled:
- self.message("[canceled]")
- else:
- self.message("[done]")
- finally:
- self.msgq.put(None)
-
- def savefile(self, text, path):
- if self.stopit:
- raise Canceled
- websucker.Sucker.savefile(self, text, path)
-
- def getpage(self, url):
- if self.stopit:
- raise Canceled
- return websucker.Sucker.getpage(self, url)
-
- def savefilename(self, url):
- path = websucker.Sucker.savefilename(self, url)
- if self.savedir:
- n = len(self.rootdir)
- if path[:n] == self.rootdir:
- path = path[n:]
- while path[:1] == os.sep:
- path = path[1:]
- path = os.path.join(self.savedir, path)
- return path
-
- def XXXaddrobot(self, *args):
- pass
-
- def XXXisallowed(self, *args):
- return 1
-
-
-class App:
-
- sucker = None
- msgq = None
-
- def __init__(self, top):
- self.top = top
- top.columnconfigure(99, weight=1)
- self.url_label = Label(top, text="URL:")
- self.url_label.grid(row=0, column=0, sticky='e')
- self.url_entry = Entry(top, width=60, exportselection=0)
- self.url_entry.grid(row=0, column=1, sticky='we',
- columnspan=99)
- self.url_entry.focus_set()
- self.url_entry.bind("<Key-Return>", self.go)
- self.dir_label = Label(top, text="Directory:")
- self.dir_label.grid(row=1, column=0, sticky='e')
- self.dir_entry = Entry(top)
- self.dir_entry.grid(row=1, column=1, sticky='we',
- columnspan=99)
- self.go_button = Button(top, text="Go", command=self.go)
- self.go_button.grid(row=2, column=1, sticky='w')
- self.cancel_button = Button(top, text="Cancel",
- command=self.cancel,
- state=DISABLED)
- self.cancel_button.grid(row=2, column=2, sticky='w')
- self.auto_button = Button(top, text="Paste+Go",
- command=self.auto)
- self.auto_button.grid(row=2, column=3, sticky='w')
- self.status_label = Label(top, text="[idle]")
- self.status_label.grid(row=2, column=4, sticky='w')
- self.top.update_idletasks()
- self.top.grid_propagate(0)
-
- def message(self, text, *args):
- if args:
- text = text % args
- self.status_label.config(text=text)
-
- def check_msgq(self):
- while not self.msgq.empty():
- msg = self.msgq.get()
- if msg is None:
- self.go_button.configure(state=NORMAL)
- self.auto_button.configure(state=NORMAL)
- self.cancel_button.configure(state=DISABLED)
- if self.sucker:
- self.sucker.stopit = 0
- self.top.bell()
- else:
- self.message(msg)
- self.top.after(100, self.check_msgq)
-
- def go(self, event=None):
- if not self.msgq:
- self.msgq = queue.Queue(0)
- self.check_msgq()
- if not self.sucker:
- self.sucker = SuckerThread(self.msgq)
- if self.sucker.stopit:
- return
- self.url_entry.selection_range(0, END)
- url = self.url_entry.get()
- url = url.strip()
- if not url:
- self.top.bell()
- self.message("[Error: No URL entered]")
- return
- self.rooturl = url
- dir = self.dir_entry.get().strip()
- if not dir:
- self.sucker.savedir = None
- else:
- self.sucker.savedir = dir
- self.sucker.rootdir = os.path.dirname(
- websucker.Sucker.savefilename(self.sucker, url))
- self.go_button.configure(state=DISABLED)
- self.auto_button.configure(state=DISABLED)
- self.cancel_button.configure(state=NORMAL)
- self.message( '[running...]')
- self.sucker.stopit = 0
- t = threading.Thread(target=self.sucker.run1, args=(url,))
- t.start()
-
- def cancel(self):
- if self.sucker:
- self.sucker.stopit = 1
- self.message("[canceling...]")
-
- def auto(self):
- tries = ['PRIMARY', 'CLIPBOARD']
- text = ""
- for t in tries:
- try:
- text = self.top.selection_get(selection=t)
- except TclError:
- continue
- text = text.strip()
- if text:
- break
- if not text:
- self.top.bell()
- self.message("[Error: clipboard is empty]")
- return
- self.url_entry.delete(0, END)
- self.url_entry.insert(0, text)
- self.go()
-
-
-class AppArray:
-
- def __init__(self, top=None):
- if not top:
- top = Tk()
- top.title("websucker GUI")
- top.iconname("wsgui")
- top.wm_protocol('WM_DELETE_WINDOW', self.exit)
- self.top = top
- self.appframe = Frame(self.top)
- self.appframe.pack(fill='both')
- self.applist = []
- self.exit_button = Button(top, text="Exit", command=self.exit)
- self.exit_button.pack(side=RIGHT)
- self.new_button = Button(top, text="New", command=self.addsucker)
- self.new_button.pack(side=LEFT)
- self.addsucker()
- ##self.applist[0].url_entry.insert(END, "http://www.python.org/doc/essays/")
-
- def addsucker(self):
- self.top.geometry("")
- frame = Frame(self.appframe, borderwidth=2, relief=GROOVE)
- frame.pack(fill='x')
- app = App(frame)
- self.applist.append(app)
-
- done = 0
-
- def mainloop(self):
- while not self.done:
- time.sleep(0.1)
- self.top.update()
-
- def exit(self):
- for app in self.applist:
- app.cancel()
- app.message("[exiting...]")
- self.done = 1
-
-
-def main():
- AppArray().mainloop()
-
-if __name__ == '__main__':
- main()
diff --git a/Tools/world/README b/Tools/world/README
deleted file mode 100644
index f7bb61021e..0000000000
--- a/Tools/world/README
+++ /dev/null
@@ -1,85 +0,0 @@
-world -- Print mappings between country names and DNS country codes.
-
-Contact: Barry Warsaw
-Email: bwarsaw@python.org
-
-This script will take a list of Internet addresses and print out where in the
-world those addresses originate from, based on the top-level domain country
-code found in the address. Addresses can be in any of the following forms:
-
- xx -- just the country code or top-level domain identifier
- host.domain.xx -- any Internet host or network name
- somebody@where.xx -- an Internet email address
-
-If no match is found, the address is interpreted as a regular expression [*]
-and a reverse lookup is attempted. This script will search the country names
-and print a list of matching entries. You can force reverse mappings with the
-`-r' flag (see below).
-
-For example:
-
- %% world tz us
- tz originated from Tanzania, United Republic of
- us originated from United States
-
- %% world united
- united matches 6 countries:
- ae: United Arab Emirates
- uk: United Kingdom (common practice)
- um: United States Minor Outlying Islands
- us: United States
- tz: Tanzania, United Republic of
- gb: United Kingdom
-
-
- [*] Note that regular expressions must conform to Python 1.5's re.py module
- syntax. The comparison is done with the search() method.
-
-Country codes are maintained by the RIPE Network Coordination Centre,
-in coordination with the ISO 3166 Maintenance Agency at DIN Berlin. The
-authoritative source of counry code mappings is:
-
- <url:ftp://info.ripe.net/iso3166-countrycodes>
-
-The latest known change to this information was:
-
- Thu Aug 7 17:59:51 MET DST 1997
-
-This script also knows about non-geographic top-level domains.
-
-Usage: world [-d] [-p file] [-o] [-h] addr [addr ...]
-
- --dump
- -d
- Print mapping of all top-level domains.
-
- --parse file
- -p file
- Parse an iso3166-countrycodes file extracting the two letter country
- code followed by the country name. Note that the three letter country
- codes and numbers, which are also provided in the standard format
- file, are ignored.
-
- --outputdict
- -o
- When used in conjunction with the `-p' option, output is in the form
- of a Python dictionary, and country names are normalized
- w.r.t. capitalization. This makes it appropriate for cutting and
- pasting back into this file.
-
- --reverse
- -r
- Force reverse lookup. In this mode the address can be any Python
- regular expression; this is matched against all country names and a
- list of matching mappings is printed. In normal mode (e.g. without
- this flag), reverse lookup is performed on addresses if no matching
- country code is found.
-
- -h
- --help
- Print this message.
-
-
-Local Variables:
-indent-tabs-mode: nil
-End:
diff --git a/Tools/world/world b/Tools/world/world
deleted file mode 100755
index 16452f3ec4..0000000000
--- a/Tools/world/world
+++ /dev/null
@@ -1,568 +0,0 @@
-#! /usr/bin/env python
-
-"""world -- Print mappings between country names and DNS country codes.
-
-Contact: Barry Warsaw
-Email: barry@python.org
-Version: %(__version__)s
-
-This script will take a list of Internet addresses and print out where in the
-world those addresses originate from, based on the top-level domain country
-code found in the address. Addresses can be in any of the following forms:
-
- xx -- just the country code or top-level domain identifier
- host.domain.xx -- any Internet host or network name
- somebody@where.xx -- an Internet email address
-
-If no match is found, the address is interpreted as a regular expression and a
-reverse lookup is attempted. This script will search the country names and
-print a list of matching entries. You can force reverse mappings with the
-`-r' flag (see below).
-
-For example:
-
- %% world tz us
- tz originated from Tanzania, United Republic of
- us originated from United States
-
- %% world united
- united matches 6 countries:
- ae: United Arab Emirates
- uk: United Kingdom (common practice)
- um: United States Minor Outlying Islands
- us: United States
- tz: Tanzania, United Republic of
- gb: United Kingdom
-
-Country codes are maintained by the RIPE Network Coordination Centre,
-in coordination with the ISO 3166 Maintenance Agency at DIN Berlin. The
-authoritative source of country code mappings is:
-
- <url:ftp://ftp.ripe.net/iso3166-countrycodes.txt>
-
-The latest known change to this information was:
-
- Monday, 10 October 2006, 17:59:51 UTC 2006
-
-This script also knows about non-geographic top-level domains, and the
-additional ccTLDs reserved by IANA.
-
-Usage: %(PROGRAM)s [-d] [-p file] [-o] [-h] addr [addr ...]
-
- --dump
- -d
- Print mapping of all top-level domains.
-
- --parse file
- -p file
- Parse an iso3166-countrycodes file extracting the two letter country
- code followed by the country name. Note that the three letter country
- codes and numbers, which are also provided in the standard format
- file, are ignored.
-
- --outputdict
- -o
- When used in conjunction with the `-p' option, output is in the form
- of a Python dictionary, and country names are normalized
- w.r.t. capitalization. This makes it appropriate for cutting and
- pasting back into this file. Output is always to standard out.
-
- --reverse
- -r
- Force reverse lookup. In this mode the address can be any Python
- regular expression; this is matched against all country names and a
- list of matching mappings is printed. In normal mode (e.g. without
- this flag), reverse lookup is performed on addresses if no matching
- country code is found.
-
- -h
- --help
- Print this message.
-"""
-__version__ = '$Revision$'
-
-
-import sys
-import getopt
-import re
-
-PROGRAM = sys.argv[0]
-
-
-
-def usage(code, msg=''):
- print(__doc__ % globals())
- if msg:
- print(msg)
- sys.exit(code)
-
-
-
-def resolve(rawaddr):
- parts = rawaddr.split('.')
- if not len(parts):
- # no top level domain found, bounce it to the next step
- return rawaddr
- addr = parts[-1]
- if addr in nameorgs:
- print(rawaddr, 'is in the', nameorgs[addr], 'top level domain')
- return None
- elif addr in countries:
- print(rawaddr, 'originated from', countries[addr])
- return None
- else:
- # Not resolved, bounce it to the next step
- return rawaddr
-
-
-
-def reverse(regexp):
- matches = []
- cre = re.compile(regexp, re.IGNORECASE)
- for code, country in all.items():
- mo = cre.search(country)
- if mo:
- matches.append(code)
- # print results
- if not matches:
- # not resolved, bounce it to the next step
- return regexp
- if len(matches) == 1:
- code = matches[0]
- print(regexp, "matches code `%s', %s" % (code, all[code]))
- else:
- print(regexp, 'matches %d countries:' % len(matches))
- for code in matches:
- print(" %s: %s" % (code, all[code]))
- return None
-
-
-
-def parse(file, normalize):
- try:
- fp = open(file)
- except IOError as err:
- errno, msg = err.args
- print(msg, ':', file)
- return
-
- cre = re.compile('(.*?)[ \t]+([A-Z]{2})[ \t]+[A-Z]{3}[ \t]+[0-9]{3}')
- scanning = 0
-
- if normalize:
- print('countries = {')
-
- while 1:
- line = fp.readline()
- if line == '':
- break # EOF
- if scanning:
- mo = cre.match(line)
- if not mo:
- line = line.strip()
- if not line:
- continue
- elif line[0] == '-':
- break
- else:
- print('Could not parse line:', line)
- continue
- country, code = mo.group(1, 2)
- if normalize:
- words = country.split()
- for i in range(len(words)):
- w = words[i]
- # XXX special cases
- if w in ('AND', 'OF', 'OF)', 'name:', 'METROPOLITAN'):
- words[i] = w.lower()
- elif w == 'THE' and i != 1:
- words[i] = w.lower()
- elif len(w) > 3 and w[1] == "'":
- words[i] = w[0:3].upper() + w[3:].lower()
- elif w in ('(U.S.)', 'U.S.'):
- pass
- elif w[0] == '(' and w != '(local':
- words[i] = '(' + w[1:].capitalize()
- elif w.find('-') != -1:
- words[i] = '-'.join(
- [s.capitalize() for s in w.split('-')])
- else:
- words[i] = w.capitalize()
- code = code.lower()
- country = ' '.join(words)
- print(' "%s": "%s",' % (code, country))
- else:
- print(code, country)
-
- elif line[0] == '-':
- scanning = 1
-
- if normalize:
- print(' }')
-
-
-def main():
- help = 0
- status = 0
- dump = 0
- parsefile = None
- normalize = 0
- forcerev = 0
-
- try:
- opts, args = getopt.getopt(
- sys.argv[1:],
- 'p:rohd',
- ['parse=', 'reverse', 'outputdict', 'help', 'dump'])
- except getopt.error as msg:
- usage(1, msg)
-
- for opt, arg in opts:
- if opt in ('-h', '--help'):
- help = 1
- elif opt in ('-d', '--dump'):
- dump = 1
- elif opt in ('-p', '--parse'):
- parsefile = arg
- elif opt in ('-o', '--outputdict'):
- normalize = 1
- elif opt in ('-r', '--reverse'):
- forcerev = 1
-
- if help:
- usage(status)
-
- if dump:
- print('Official country coded domains:')
- codes = sorted(countries)
- for code in codes:
- print(' %2s:' % code, countries[code])
-
- print('\nOther top-level domains:')
- codes = sorted(nameorgs)
- for code in codes:
- print(' %6s:' % code, nameorgs[code])
- elif parsefile:
- parse(parsefile, normalize)
- else:
- if not forcerev:
- args = filter(None, map(resolve, args))
- args = filter(None, map(reverse, args))
- for arg in args:
- print('Where in the world is %s?' % arg)
-
-
-
-# The mappings
-nameorgs = {
- # New top level domains as described by ICANN
- # http://www.icann.org/tlds/
- "aero": "air-transport industry",
- "asia": "from Asia/for Asia",
- "arpa": "Arpanet",
- "biz": "business",
- "cat": "Catalan community",
- "com": "commercial",
- "coop": "cooperatives",
- "edu": "educational",
- "gov": "government",
- "info": "unrestricted `info'",
- "int": "international",
- "jobs": "employment-related",
- "mil": "military",
- "mobi": "mobile specific",
- "museum": "museums",
- "name": "`name' (for registration by individuals)",
- "net": "networking",
- "org": "non-commercial",
- "pro": "professionals",
- "tel": "business telecommunications",
- "travel": "travel and tourism",
- # These additional ccTLDs are included here even though they are not part
- # of ISO 3166. IANA has a decoding table listing all reserved ccTLDs:
- #
- # http://www.iso.org/iso/iso-3166-1_decoding_table
- #
- # Note that `uk' is the common practice country code for the United
- # Kingdom. AFAICT, the official `gb' code is routinely ignored!
- #
- # <D.M.Pick@qmw.ac.uk> tells me that `uk' was long in use before ISO3166
- # was adopted for top-level DNS zone names (although in the reverse order
- # like uk.ac.qmw) and was carried forward (with the reversal) to avoid a
- # large-scale renaming process as the UK switched from their old `Coloured
- # Book' protocols over X.25 to Internet protocols over IP.
- #
- # See <url:ftp://ftp.ripe.net/ripe/docs/ripe-159.txt>
- #
- # Also, `su', while obsolete is still in limited use.
- "ac": "Ascension Island",
- "cp": "Clipperton Island",
- "dg": "Diego Garcia",
- "ea": "Ceuta, Melilla",
- "eu": "European Union",
- "fx": "Metropolitan France",
- "ic": "Canary Islands",
- "ta": "Tristan da Cunha",
- "uk": "United Kingdom (common practice)",
- "su": "Soviet Union (still in limited use)",
- }
-
-
-
-countries = {
- "af": "Afghanistan",
- "ax": "Aland Islands",
- "al": "Albania",
- "dz": "Algeria",
- "as": "American Samoa",
- "ad": "Andorra",
- "ao": "Angola",
- "ai": "Anguilla",
- "aq": "Antarctica",
- "ag": "Antigua and Barbuda",
- "ar": "Argentina",
- "am": "Armenia",
- "aw": "Aruba",
- "au": "Australia",
- "at": "Austria",
- "az": "Azerbaijan",
- "bs": "Bahamas",
- "bh": "Bahrain",
- "bd": "Bangladesh",
- "bb": "Barbados",
- "by": "Belarus",
- "be": "Belgium",
- "bz": "Belize",
- "bj": "Benin",
- "bm": "Bermuda",
- "bt": "Bhutan",
- "bo": "Bolivia",
- "ba": "Bosnia and Herzegovina",
- "bw": "Botswana",
- "bv": "Bouvet Island",
- "br": "Brazil",
- "io": "British Indian Ocean Territory",
- "bn": "Brunei Darussalam",
- "bg": "Bulgaria",
- "bf": "Burkina Faso",
- "bi": "Burundi",
- "kh": "Cambodia",
- "cm": "Cameroon",
- "ca": "Canada",
- "cv": "Cape Verde",
- "ky": "Cayman Islands",
- "cf": "Central African Republic",
- "td": "Chad",
- "cl": "Chile",
- "cn": "China",
- "cx": "Christmas Island",
- "cc": "Cocos (Keeling) Islands",
- "co": "Colombia",
- "km": "Comoros",
- "cg": "Congo",
- "cd": "Congo, The Democratic Republic of the",
- "ck": "Cook Islands",
- "cr": "Costa Rica",
- "ci": "Cote D'Ivoire",
- "hr": "Croatia",
- "cu": "Cuba",
- "cy": "Cyprus",
- "cz": "Czech Republic",
- "dk": "Denmark",
- "dj": "Djibouti",
- "dm": "Dominica",
- "do": "Dominican Republic",
- "ec": "Ecuador",
- "eg": "Egypt",
- "sv": "El Salvador",
- "gq": "Equatorial Guinea",
- "er": "Eritrea",
- "ee": "Estonia",
- "et": "Ethiopia",
- "fk": "Falkland Islands (Malvinas)",
- "fo": "Faroe Islands",
- "fj": "Fiji",
- "fi": "Finland",
- "fr": "France",
- "gf": "French Guiana",
- "pf": "French Polynesia",
- "tf": "French Southern Territories",
- "ga": "Gabon",
- "gm": "Gambia",
- "ge": "Georgia",
- "de": "Germany",
- "gh": "Ghana",
- "gi": "Gibraltar",
- "gr": "Greece",
- "gl": "Greenland",
- "gd": "Grenada",
- "gp": "Guadeloupe",
- "gu": "Guam",
- "gt": "Guatemala",
- "gg": "Guernsey",
- "gn": "Guinea",
- "gw": "Guinea-Bissau",
- "gy": "Guyana",
- "ht": "Haiti",
- "hm": "Heard Island and Mcdonald Islands",
- "va": "Holy See (Vatican City State)",
- "hn": "Honduras",
- "hk": "Hong Kong",
- "hu": "Hungary",
- "is": "Iceland",
- "in": "India",
- "id": "Indonesia",
- "ir": "Iran (Islamic Republic of)",
- "iq": "Iraq",
- "ie": "Ireland",
- "im": "Isle of Man",
- "il": "Israel",
- "it": "Italy",
- "jm": "Jamaica",
- "jp": "Japan",
- "je": "Jersey",
- "jo": "Jordan",
- "kz": "Kazakhstan",
- "ke": "Kenya",
- "ki": "Kiribati",
- "kp": "Korea, Democratic People's Republic of",
- "kr": "Korea, Republic of",
- "kw": "Kuwait",
- "kg": "Kyrgyzstan",
- "la": "Lao People's Democratic Republic",
- "lv": "Latvia",
- "lb": "Lebanon",
- "ls": "Lesotho",
- "lr": "Liberia",
- "ly": "Libyan Arab Jamahiriya",
- "li": "Liechtenstein",
- "lt": "Lithuania",
- "lu": "Luxembourg",
- "mo": "Macao",
- "mk": "Macedonia, The Former Yugoslav Republic of",
- "mg": "Madagascar",
- "mw": "Malawi",
- "my": "Malaysia",
- "mv": "Maldives",
- "ml": "Mali",
- "mt": "Malta",
- "mh": "Marshall Islands",
- "mq": "Martinique",
- "mr": "Mauritania",
- "mu": "Mauritius",
- "yt": "Mayotte",
- "mx": "Mexico",
- "fm": "Micronesia, Federated States of",
- "md": "Moldova, Republic of",
- "mc": "Monaco",
- "mn": "Mongolia",
- "me": "Montenegro",
- "ms": "Montserrat",
- "ma": "Morocco",
- "mz": "Mozambique",
- "mm": "Myanmar",
- "na": "Namibia",
- "nr": "Nauru",
- "np": "Nepal",
- "nl": "Netherlands",
- "an": "Netherlands Antilles",
- "nc": "New Caledonia",
- "nz": "New Zealand",
- "ni": "Nicaragua",
- "ne": "Niger",
- "ng": "Nigeria",
- "nu": "Niue",
- "nf": "Norfolk Island",
- "mp": "Northern Mariana Islands",
- "no": "Norway",
- "om": "Oman",
- "pk": "Pakistan",
- "pw": "Palau",
- "ps": "Palestinian Territory, Occupied",
- "pa": "Panama",
- "pg": "Papua New Guinea",
- "py": "Paraguay",
- "pe": "Peru",
- "ph": "Philippines",
- "pn": "Pitcairn",
- "pl": "Poland",
- "pt": "Portugal",
- "pr": "Puerto Rico",
- "qa": "Qatar",
- "re": "Reunion",
- "ro": "Romania",
- "ru": "Russian Federation",
- "rw": "Rwanda",
- "sh": "Saint Helena",
- "kn": "Saint Kitts and Nevis",
- "lc": "Saint Lucia",
- "pm": "Saint Pierre and Miquelon",
- "vc": "Saint Vincent and the Grenadines",
- "ws": "Samoa",
- "sm": "San Marino",
- "st": "Sao Tome and Principe",
- "sa": "Saudi Arabia",
- "sn": "Senegal",
- "rs": "Serbia",
- "sc": "Seychelles",
- "sl": "Sierra Leone",
- "sg": "Singapore",
- "sk": "Slovakia",
- "si": "Slovenia",
- "sb": "Solomon Islands",
- "so": "Somalia",
- "za": "South Africa",
- "gs": "South Georgia and the South Sandwich Islands",
- "es": "Spain",
- "lk": "Sri Lanka",
- "sd": "Sudan",
- "sr": "Suriname",
- "sj": "Svalbard and Jan Mayen",
- "sh": "St. Helena",
- "pm": "St. Pierre and Miquelon",
- "sz": "Swaziland",
- "se": "Sweden",
- "ch": "Switzerland",
- "sy": "Syrian Arab Republic",
- "tw": "Taiwan, Province of China",
- "tj": "Tajikistan",
- "tz": "Tanzania, United Republic of",
- "th": "Thailand",
- "tl": "Timor-Leste",
- "tg": "Togo",
- "tk": "Tokelau",
- "to": "Tonga",
- "tt": "Trinidad and Tobago",
- "tn": "Tunisia",
- "tr": "Turkey",
- "tm": "Turkmenistan",
- "tc": "Turks and Caicos Islands",
- "tv": "Tuvalu",
- "ug": "Uganda",
- "ua": "Ukraine",
- "ae": "United Arab Emirates",
- "gb": "United Kingdom",
- "us": "United States",
- "um": "United States Minor Outlying Islands",
- "uy": "Uruguay",
- "uz": "Uzbekistan",
- "vu": "Vanuatu",
- "va": "Vatican City State (Holy See)",
- "ve": "Venezuela",
- "vn": "Viet Nam",
- "vg": "Virgin Islands (British)",
- "vi": "Virgin Islands (U.S.)",
- "wf": "Wallis and Futuna",
- "eh": "Western Sahara",
- "ye": "Yemen",
- "yu": "Yugoslavia",
- "zm": "Zambia",
- "zw": "Zimbabwe",
- }
-
-all = nameorgs.copy()
-all.update(countries)
-
-
-if __name__ == '__main__':
- main()
diff --git a/configure b/configure
index 90ad156601..98ae6e651d 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.in Revision.
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for python 3.1.
+# Generated by GNU Autoconf 2.68 for python 3.2.
#
# Report bugs to <http://bugs.python.org/>.
#
@@ -561,8 +561,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='python'
PACKAGE_TARNAME='python'
-PACKAGE_VERSION='3.1'
-PACKAGE_STRING='python 3.1'
+PACKAGE_VERSION='3.2'
+PACKAGE_STRING='python 3.2'
PACKAGE_BUGREPORT='http://bugs.python.org/'
PACKAGE_URL=''
@@ -606,6 +606,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
SRCDIRS
THREADHEADERS
+SOABI
LIBC
LIBM
HAVE_GETHOSTBYNAME
@@ -623,11 +624,14 @@ LDLAST
USE_THREAD_MODULE
SIGNAL_OBJS
USE_SIGNAL_MODULE
+LIBFFI_INCLUDEDIR
+PKG_CONFIG
SHLIBS
CFLAGSFORSHARED
LINKFORSHARED
CCSHARED
BLDSHARED
+LDCXXSHARED
LDSHARED
SO
LIBTOOL_CRUFT
@@ -635,6 +639,7 @@ OTHER_LIBTOOL_OPT
UNIVERSAL_ARCH_FLAGS
BASECFLAGS
OPT
+ABIFLAGS
LN
INSTALL_DATA
INSTALL_SCRIPT
@@ -647,11 +652,14 @@ SVNVERSION
ARFLAGS
AR
RANLIB
+USE_INLINE
GNULD
LINKCC
+LDVERSION
RUNSHARED
INSTSONAME
LDLIBRARYDIR
+PY3LIBRARY
BLDLIBRARY
DLLLIBRARY
LDLIBRARY
@@ -673,6 +681,7 @@ EXPORT_MACOSX_DEPLOYMENT_TARGET
CONFIGURE_MACOSX_DEPLOYMENT_TARGET
SGI_ABI
MACHDEP
+FRAMEWORKINSTALLAPPSPREFIX
FRAMEWORKUNIXTOOLSPREFIX
FRAMEWORKALTINSTALLLAST
FRAMEWORKALTINSTALLFIRST
@@ -683,7 +692,6 @@ PYTHONFRAMEWORKPREFIX
PYTHONFRAMEWORKDIR
PYTHONFRAMEWORKIDENTIFIER
PYTHONFRAMEWORK
-LIPO_64BIT_FLAGS
LIPO_32BIT_FLAGS
ARCH_RUN_32BIT
UNIVERSALSDK
@@ -742,18 +750,19 @@ enable_shared
enable_profiling
with_pydebug
with_libs
+with_system_expat
with_system_ffi
+enable_loadable_sqlite_extensions
with_dbmliborder
with_signal_module
with_dec_threads
with_threads
with_thread
-with_pth
enable_ipv6
with_doc_strings
with_tsc
with_pymalloc
-with_wctype_functions
+with_valgrind
with_fpectl
with_libm
with_libc
@@ -769,8 +778,7 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
-CPP
-CPPFLAGS'
+CPP'
# Initialize some variables set by options.
@@ -1313,7 +1321,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures python 3.1 to adapt to many kinds of systems.
+\`configure' configures python 3.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1374,7 +1382,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of python 3.1:";;
+ short | recursive ) echo "Configuration of python 3.2:";;
esac
cat <<\_ACEOF
@@ -1388,6 +1396,8 @@ Optional Features:
Build (MacOSX|Darwin) framework
--enable-shared disable/enable building shared python library
--enable-profiling enable C-level code profiling
+ --enable-loadable-sqlite-extensions
+ support loadable extensions in _sqlite module
--enable-ipv6 Enable ipv6 (with ipv4) support
--disable-ipv6 Disable ipv6 support
--enable-big-digits[=BITS]
@@ -1409,6 +1419,8 @@ Optional Packages:
--with-suffix=.exe set executable suffix
--with-pydebug build with Py_DEBUG defined
--with-libs='lib1 ...' link against additional libs
+ --with-system-expat build pyexpat module using an installed expat
+ library
--with-system-ffi build _ctypes module using an installed ffi library
--with-dbmliborder=db1:db2:...
order to check db backends for dbm. Valid value is a
@@ -1420,17 +1432,17 @@ Optional Packages:
disable/enable thread support
--with(out)-thread[=DIRECTORY]
deprecated; use --with(out)-threads
- --with-pth use GNU pth threading libraries
--with(out)-doc-strings disable/enable documentation strings
--with(out)-tsc enable/disable timestamp counter profile
--with(out)-pymalloc disable/enable specialized mallocs
- --with-wctype-functions use wctype.h functions
+ --with-valgrind Enable Valgrind support
--with-fpectl enable SIGFPE catching
--with-libm=STRING math library
--with-libc=STRING C library
--with-wide-unicode Use 4-byte Unicode characters (default is 2 bytes)
- --with-computed-gotos Use computed gotos / threaded dispatch in evaluation
- loop (not available on all compilers)
+ --with(out)-computed-gotos
+ Use computed gotos in evaluation loop (enabled by
+ default on supported compilers)
Some influential environment variables:
CC C compiler command
@@ -1508,7 +1520,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-python configure 3.1
+python configure 3.2
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2339,7 +2351,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by python $as_me 3.1, which was
+It was created by python $as_me 3.2, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2706,8 +2718,9 @@ rm confdefs.h
mv confdefs.h.new confdefs.h
-VERSION=3.1
+VERSION=3.2
+# Version number of Python's own shared library file.
SOVERSION=1.0
@@ -2801,7 +2814,6 @@ fi
UNIVERSAL_ARCHS="32-bit"
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-universal-archs" >&5
$as_echo_n "checking for --with-universal-archs... " >&6; }
@@ -2863,26 +2875,55 @@ if test "${enable_framework+set}" = set; then :
enable_framework=
;;
*)
- PYTHONFRAMEWORKPREFIX=$enableval
+ PYTHONFRAMEWORKPREFIX="${enableval}"
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
- case "${UNIVERSAL_ARCHS}" in
- all|3-way|intel)
- FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkinstallunixtools4way"
- FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkaltinstallunixtools4way"
- ;;
- *)
- FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
- FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
- ;;
- esac
+ FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
+ FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
+ FRAMEWORKINSTALLAPPSPREFIX="/Applications"
if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
+
else
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
fi
+
+ case "${enableval}" in
+ /System*)
+ FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+ if test "${prefix}" = "NONE" ; then
+ # See below
+ FRAMEWORKUNIXTOOLSPREFIX="/usr"
+ fi
+ ;;
+
+ /Library*)
+ FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+ ;;
+
+ */Library/Frameworks)
+ MDIR="`dirname "${enableval}"`"
+ MDIR="`dirname "${MDIR}"`"
+ FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
+
+ if test "${prefix}" = "NONE"; then
+ # User hasn't specified the
+ # --prefix option, but wants to install
+ # the framework in a non-default location,
+ # ensure that the compatibility links get
+ # installed relative to that prefix as well
+ # instead of in /usr/local.
+ FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
+ fi
+ ;;
+
+ *)
+ FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+ ;;
+ esac
+
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
# Add files for Mac specific code to the list of output
@@ -2914,11 +2955,6 @@ else
fi
enable_framework=
- if test "$UNIVERSAL_ARCHS" = "all"
- then
- FRAMEWORKINSTALLLAST=update4wayuniversal
- FRAMEWORKALTINSTALLLAST=update4wayuniversal
- fi
fi
@@ -2933,9 +2969,10 @@ fi
+
##AC_ARG_WITH(dyld,
-## AC_HELP_STRING(--with-dyld,
-## Use (OpenStep|Rhapsody) dynamic linker))
+## AS_HELP_STRING([--with-dyld],
+## [Use (OpenStep|Rhapsody) dynamic linker]))
##
# Set name for machine-dependent library files
@@ -2959,7 +2996,6 @@ then
case $MACHDEP in
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
- atheos*) MACHDEP="atheos";;
irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
esac
@@ -3002,9 +3038,12 @@ $as_echo "#define _BSD_SOURCE 1" >>confdefs.h
# Marc Recht
NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S])
define_xopen_source=no;;
- # On Solaris 2.6, sys/wait.h is inconsistent in the usage
- # of union __?sigval. Reported by Stuart Bishop.
- SunOS/5.6)
+ # From the perspective of Solaris, _XOPEN_SOURCE is not so much a
+ # request to enable features supported by the standard as a request
+ # to disable features not supported by the standard. The best way
+ # for Python to use Solaris is simply to leave _XOPEN_SOURCE out
+ # entirely and define __EXTENSIONS__ instead.
+ SunOS/*)
define_xopen_source=no;;
# On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
# but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
@@ -3050,38 +3089,17 @@ esac
if test $define_xopen_source = yes
then
- # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
- # defined precisely as g++ defines it
- # Furthermore, on Solaris 10, XPG6 requires the use of a C99
- # compiler
- case $ac_sys_system/$ac_sys_release in
- SunOS/5.8|SunOS/5.9|SunOS/5.10|SunOS/5.11)
-
-$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
-
- ;;
- *)
$as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h
- ;;
- esac
# On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
# definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
# several APIs are not declared. Since this is also needed in some
# cases for HP-UX, we define it globally.
- # except for Solaris 10, where it must not be defined,
- # as it implies XPG4.2
- case $ac_sys_system/$ac_sys_release in
- SunOS/5.10|SunOS/5.11)
- ;;
- *)
$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
- ;;
- esac
$as_echo "#define _POSIX_C_SOURCE 200112L" >>confdefs.h
@@ -3165,6 +3183,12 @@ then
(it is also a good idea to do 'make clean' before compiling)" "$LINENO" 5
fi
+# Don't let AC_PROG_CC set the default CFLAGS. It normally sets -g -O2
+# when the compiler supports them, but we don't always want -O2, and
+# we set -g later.
+if test -z "$CFLAGS"; then
+ CFLAGS=
+fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4605,7 +4629,6 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
-
# Check for unsupported systems
case $ac_sys_system/$ac_sys_release in
atheos*|Linux*/1*)
@@ -4664,12 +4687,6 @@ hp*|HP*)
case $CC in
cc|*/cc) CC="$CC -Ae";;
esac;;
-SunOS*)
- # Some functions have a prototype only with that define, e.g. confstr
-
-$as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
-
- ;;
esac
@@ -4678,7 +4695,7 @@ esac
$as_echo_n "checking LIBRARY... " >&6; }
if test -z "$LIBRARY"
then
- LIBRARY='libpython$(VERSION).a'
+ LIBRARY='libpython$(VERSION)$(ABIFLAGS).a'
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
$as_echo "$LIBRARY" >&6; }
@@ -4696,6 +4713,11 @@ $as_echo "$LIBRARY" >&6; }
#
# INSTSONAME is the name of the shared library that will be use to install
# on the system - some systems like version suffix, others don't
+#
+# LDVERSION is the shared library version number, normally the Python version
+# with the ABI build flags appended.
+
+
@@ -4708,6 +4730,7 @@ INSTSONAME='$(LDLIBRARY)'
DLLLIBRARY=''
LDLIBRARYDIR=''
RUNSHARED=''
+LDVERSION="$VERSION"
# LINKCC is the command that links the python executable -- default is $(CC).
# If CXX is set, and if it is needed to link a main function that was
@@ -4759,6 +4782,56 @@ esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNULD" >&5
$as_echo "$GNULD" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+if test "$ac_cv_c_inline" != no ; then
+
+$as_echo "#define USE_INLINE 1" >>confdefs.h
+
+
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-shared" >&5
$as_echo_n "checking for --enable-shared... " >&6; }
# Check whether --enable-shared was given.
@@ -4770,7 +4843,7 @@ fi
if test -z "$enable_shared"
then
case $ac_sys_system in
- CYGWIN* | atheos*)
+ CYGWIN*)
enable_shared="yes";;
*)
enable_shared="no";;
@@ -4839,18 +4912,22 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
case $ac_sys_system in
CYGWIN*)
- LDLIBRARY='libpython$(VERSION).dll.a'
- DLLLIBRARY='libpython$(VERSION).dll'
+ LDLIBRARY='libpython$(LDVERSION).dll.a'
+ DLLLIBRARY='libpython$(LDVERSION).dll'
;;
SunOS*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(LDVERSION).so'
+ BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
+ if test "$with_pydebug" != yes
+ then
+ PY3LIBRARY=libpython3.so
+ fi
;;
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(LDVERSION).so'
+ BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
case $ac_sys_system in
FreeBSD*)
@@ -4858,36 +4935,35 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
;;
esac
INSTSONAME="$LDLIBRARY".$SOVERSION
+ if test "$with_pydebug" != yes
+ then
+ PY3LIBRARY=libpython3.so
+ fi
;;
hp*|HP*)
case `uname -m` in
ia64)
- LDLIBRARY='libpython$(VERSION).so'
+ LDLIBRARY='libpython$(LDVERSION).so'
;;
*)
- LDLIBRARY='libpython$(VERSION).sl'
+ LDLIBRARY='libpython$(LDVERSION).sl'
;;
esac
- BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)'
+ BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH}
;;
OSF*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(LDVERSION).so'
+ BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
;;
- atheos*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-L. -lpython$(VERSION)'
- RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
- ;;
Darwin*)
- LDLIBRARY='libpython$(VERSION).dylib'
- BLDLIBRARY='-L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(LDVERSION).dylib'
+ BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
;;
AIX*)
- LDLIBRARY='libpython$(VERSION).so'
+ LDLIBRARY='libpython$(LDVERSION).so'
RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
;;
@@ -4896,7 +4972,7 @@ else # shared is disabled
case $ac_sys_system in
CYGWIN*)
BLDLIBRARY='$(LIBRARY)'
- LDLIBRARY='libpython$(VERSION).dll.a'
+ LDLIBRARY='libpython$(LDVERSION).dll.a'
;;
esac
fi
@@ -5282,11 +5358,14 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
if test -z "$LN" ; then
case $ac_sys_system in
CYGWIN*) LN="ln -s";;
- atheos*) LN="ln -s";;
*) LN=ln;;
esac
fi
+# For calculating the .so ABI tag.
+
+ABIFLAGS=""
+
# Check for --with-pydebug
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pydebug" >&5
$as_echo_n "checking for --with-pydebug... " >&6; }
@@ -5302,6 +5381,7 @@ $as_echo "#define Py_DEBUG 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; };
Py_DEBUG='true'
+ ABIFLAGS="${ABIFLAGS}d"
else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }; Py_DEBUG='false'
fi
@@ -5343,7 +5423,7 @@ then
if test "$Py_DEBUG" = 'true' ; then
# Optimization messes up debuggers, so turn it off for
# debug builds.
- OPT="-g -Wall $STRICT_PROTO"
+ OPT="-g -O0 -Wall $STRICT_PROTO"
else
OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
fi
@@ -5481,30 +5561,28 @@ $as_echo "$CC" >&6; }
if test "${enable_universalsdk}"; then
UNIVERSAL_ARCH_FLAGS=""
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
- ARCH_RUN_32BIT=""
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
-
+ ARCH_RUN_32BIT=""
+ LIPO_32BIT_FLAGS=""
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
- ARCH_RUN_32BIT="true"
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
+ LIPO_32BIT_FLAGS=""
+ ARCH_RUN_32BIT="true"
elif test "$UNIVERSAL_ARCHS" = "all" ; then
- ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
- LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400"
- LIPO_64BIT_FLAGS="-extract x86_64 -extract ppc64"
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
elif test "$UNIVERSAL_ARCHS" = "intel" ; then
- ARCH_RUN_32BIT="/usr/bin/arch -i386"
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
LIPO_32BIT_FLAGS="-extract i386"
- LIPO_64BIT_FLAGS="-extract x86_64"
+ ARCH_RUN_32BIT="/usr/bin/arch -i386"
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
- ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
- LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400"
- LIPO_64BIT_FLAGS="-extract x86_64"
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
else
as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5
@@ -5517,7 +5595,7 @@ $as_echo "$CC" >&6; }
then
CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
- CPPFLAGSFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
+ CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
fi
fi
@@ -5595,85 +5673,6 @@ then
BASECFLAGS="$BASECFLAGS $ac_arch_flags"
fi
-# disable check for icc since it seems to pass, but generates a warning
-if test "$CC" = icc
-then
- ac_cv_opt_olimit_ok=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -OPT:Olimit=0" >&5
-$as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; }
-if ${ac_cv_opt_olimit_ok+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cc="$CC"
-CC="$CC -OPT:Olimit=0"
-if test "$cross_compiling" = yes; then :
- ac_cv_opt_olimit_ok=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int main() { return 0; }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_opt_olimit_ok=yes
-else
- ac_cv_opt_olimit_ok=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-CC="$ac_save_cc"
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_opt_olimit_ok" >&5
-$as_echo "$ac_cv_opt_olimit_ok" >&6; }
-if test $ac_cv_opt_olimit_ok = yes; then
- case $ac_sys_system in
- # XXX is this branch needed? On MacOSX 10.2.2 the result of the
- # olimit_ok test is "no". Is it "yes" in some other Darwin-esque
- # environment?
- Darwin*)
- ;;
- *)
- BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
- ;;
- esac
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Olimit 1500" >&5
-$as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; }
- if ${ac_cv_olimit_ok+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cc="$CC"
- CC="$CC -Olimit 1500"
- if test "$cross_compiling" = yes; then :
- ac_cv_olimit_ok=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int main() { return 0; }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_olimit_ok=yes
-else
- ac_cv_olimit_ok=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- CC="$ac_save_cc"
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_olimit_ok" >&5
-$as_echo "$ac_cv_olimit_ok" >&6; }
- if test $ac_cv_olimit_ok = yes; then
- BASECFLAGS="$BASECFLAGS -Olimit 1500"
- fi
-fi
-
# Check whether GCC supports PyArg_ParseTuple format
if test "$GCC" = "yes"
then
@@ -5685,7 +5684,6 @@ $as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; }
/* end confdefs.h. */
void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
-
int
main ()
{
@@ -5693,15 +5691,19 @@ main ()
;
return 0;
}
+
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+
$as_echo "#define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
@@ -6073,7 +6075,7 @@ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
-bluetooth/bluetooth.h linux/tipc.h
+bluetooth/bluetooth.h linux/tipc.h spawn.h util.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -6373,13 +6375,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#else
#include <sys/types.h>
#endif
+
int
main ()
{
- makedev(0, 0)
+
+ makedev(0, 0)
;
return 0;
}
+
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_has_makedev=yes
@@ -6521,39 +6526,11 @@ _ACEOF
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
-$as_echo_n "checking return type of signal handlers... " >&6; }
-if ${ac_cv_type_signal+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <signal.h>
-
-int
-main ()
-{
-return *(signal (0, 0)) (0) == 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_type_signal=int
-else
- ac_cv_type_signal=void
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
-$as_echo "$ac_cv_type_signal" >&6; }
cat >>confdefs.h <<_ACEOF
-#define RETSIGTYPE $ac_cv_type_signal
+#define RETSIGTYPE void
_ACEOF
-
ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
if test "x$ac_cv_type_size_t" = xyes; then :
@@ -7186,48 +7163,45 @@ _ACEOF
fi
-
-# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
$as_echo_n "checking size of off_t... " >&6; }
if ${ac_cv_sizeof_off_t+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then :
- ac_cv_sizeof_off_t=4
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(off_t));
- exit(0);
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_sizeof_off_t=`cat conftestval`
-else
- ac_cv_sizeof_off_t=0
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+#endif
+"; then :
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
fi
+fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
$as_echo "$ac_cv_sizeof_off_t" >&6; }
+
+
cat >>confdefs.h <<_ACEOF
#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
_ACEOF
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable large file support" >&5
$as_echo_n "checking whether to enable large file support... " >&6; }
if test "$have_long_long" = yes
@@ -7248,42 +7222,42 @@ else
$as_echo "no" >&6; }
fi
-# AC_CHECK_SIZEOF() doesn't include <time.h>.
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
$as_echo_n "checking size of time_t... " >&6; }
if ${ac_cv_sizeof_time_t+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then :
- ac_cv_sizeof_time_t=4
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_TIME_H
#include <time.h>
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(time_t));
- exit(0);
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_sizeof_time_t=`cat conftestval`
-else
- ac_cv_sizeof_time_t=0
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+#endif
+"; then :
+else
+ if test "$ac_cv_type_time_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (time_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_time_t=0
+ fi
fi
+fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5
$as_echo "$ac_cv_sizeof_time_t" >&6; }
+
+
cat >>confdefs.h <<_ACEOF
#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
_ACEOF
@@ -7299,12 +7273,14 @@ then CC="$CC -Kthread"
elif test "$ac_cv_pthread" = "yes"
then CC="$CC -pthread"
fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_t" >&5
$as_echo_n "checking for pthread_t... " >&6; }
have_pthread_t=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <pthread.h>
+
+ #include <pthread.h>
int
main ()
{
@@ -7312,6 +7288,7 @@ pthread_t x; x = *(pthread_t*)0;
;
return 0;
}
+
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
have_pthread_t=yes
@@ -7320,52 +7297,48 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_pthread_t" >&5
$as_echo "$have_pthread_t" >&6; }
if test "$have_pthread_t" = yes ; then
- # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5
$as_echo_n "checking size of pthread_t... " >&6; }
- if ${ac_cv_sizeof_pthread_t+:} false; then :
+if ${ac_cv_sizeof_pthread_t+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then :
- ac_cv_sizeof_pthread_t=4
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" "
+#ifdef HAVE_PTHREAD_H
#include <pthread.h>
- main()
- {
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(pthread_t));
- exit(0);
- }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_sizeof_pthread_t=`cat conftestval`
-else
- ac_cv_sizeof_pthread_t=0
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+#endif
+"; then :
+else
+ if test "$ac_cv_type_pthread_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (pthread_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_pthread_t=0
+ fi
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5
$as_echo "$ac_cv_sizeof_pthread_t" >&6; }
+
+
cat >>confdefs.h <<_ACEOF
#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t
_ACEOF
+
fi
CC="$ac_save_cc"
-
-
case $ac_sys_system/$ac_sys_release in
Darwin/[01567]\..*)
OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
@@ -7499,36 +7472,7 @@ esac
-# SO is the extension of shared libraries `(including the dot!)
-# -- usually .so, .sl on HP-UX, .dll on Cygwin
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SO" >&5
-$as_echo_n "checking SO... " >&6; }
-if test -z "$SO"
-then
- case $ac_sys_system in
- hp*|HP*)
- case `uname -m` in
- ia64) SO=.so;;
- *) SO=.sl;;
- esac
- ;;
- CYGWIN*) SO=.dll;;
- *) SO=.so;;
- esac
-else
- # this might also be a termcap variable, see #610332
- echo
- echo '====================================================================='
- echo '+ +'
- echo '+ WARNING: You have set SO in your environment. +'
- echo '+ Do you really mean to change the extension for shared libraries? +'
- echo '+ Continuing in 10 seconds to let you to ponder. +'
- echo '+ +'
- echo '====================================================================='
- sleep 10
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SO" >&5
-$as_echo "$SO" >&6; }
+
cat >>confdefs.h <<_ACEOF
@@ -7551,36 +7495,47 @@ then
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/5*)
- if test "$GCC" = "yes"
- then LDSHARED='$(CC) -shared $(LDFLAGS)'
- else LDSHARED='$(CC) -G $(LDFLAGS)';
+ if test "$GCC" = "yes" ; then
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared'
+ else
+ LDSHARED='$(CC) -G'
+ LDCXXSHARED='$(CXX) -G'
fi ;;
hp*|HP*)
- if test "$GCC" = "yes"
- then LDSHARED='$(CC) -shared'
- else LDSHARED='ld -b';
+ if test "$GCC" = "yes" ; then
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared'
+ else
+ LDSHARED='ld -b'
fi ;;
OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
Darwin/1.3*)
- LDSHARED='$(CC) $(LDFLAGS) -bundle'
+ LDSHARED='$(CC) -bundle'
+ LDCXXSHARED='$(CXX) -bundle'
if test "$enable_framework" ; then
# Link against the framework. All externals should be defined.
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+ LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework. Ignore undefined symbols, assuming they come from Python
LDSHARED="$LDSHARED -undefined suppress"
+ LDCXXSHARED="$LDCXXSHARED -undefined suppress"
fi ;;
Darwin/1.4*|Darwin/5.*|Darwin/6.*)
- LDSHARED='$(CC) $(LDFLAGS) -bundle'
+ LDSHARED='$(CC) -bundle'
+ LDCXXSHARED='$(CXX) -bundle'
if test "$enable_framework" ; then
# Link against the framework. All externals should be defined.
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+ LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework, use the Python app as bundle-loader
BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi ;;
Darwin/*)
# Use -undefined dynamic_lookup whenever possible (10.3 and later).
@@ -7591,58 +7546,78 @@ then
if test "${enable_universalsdk}"; then
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
fi
- LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
+ LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
+ LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
BLDSHARED="$LDSHARED"
else
- LDSHARED='$(CC) $(LDFLAGS) -bundle'
+ LDSHARED='$(CC) -bundle'
+ LDCXXSHARED='$(CXX) -bundle'
if test "$enable_framework" ; then
# Link against the framework. All externals should be defined.
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+ LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework, use the Python app as bundle-loader
BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi
fi
;;
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
- BSD/OS*/4*) LDSHARED="gcc -shared";;
+ Linux*|GNU*|QNX*)
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared';;
+ BSD/OS*/4*)
+ LDSHARED="gcc -shared"
+ LDCXXSHARED="g++ -shared";;
FreeBSD*)
if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
then
- LDSHARED='$(CC) -shared ${LDFLAGS}'
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared'
else
- LDSHARED="ld -Bshareable ${LDFLAGS}"
+ LDSHARED="ld -Bshareable"
fi;;
OpenBSD*)
if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
then
- LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
+ LDSHARED='$(CC) -shared $(CCSHARED)'
+ LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
else
case `uname -r` in
[01].* | 2.[0-7] | 2.[0-7].*)
LDSHARED="ld -Bshareable ${LDFLAGS}"
;;
*)
- LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
+ LDSHARED='$(CC) -shared $(CCSHARED)'
+ LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
;;
esac
fi;;
- NetBSD*|DragonFly*) LDSHARED='$(CC) -shared ${LDFLAGS}';;
+ NetBSD*|DragonFly*)
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared';;
OpenUNIX*|UnixWare*)
- if test "$GCC" = "yes"
- then LDSHARED='$(CC) -shared'
- else LDSHARED='$(CC) -G'
+ if test "$GCC" = "yes" ; then
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared'
+ else
+ LDSHARED='$(CC) -G'
+ LDCXXSHARED='$(CXX) -G'
fi;;
- SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
- CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
- atheos*) LDSHARED="gcc -shared";;
+ SCO_SV*)
+ LDSHARED='$(CC) -Wl,-G,-Bexport'
+ LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
+ CYGWIN*)
+ LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
+ LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
*) LDSHARED="ld";;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDSHARED" >&5
$as_echo "$LDSHARED" >&6; }
+LDCXXSHARED=${LDCXXSHARED-$LDSHARED}
BLDSHARED=${BLDSHARED-$LDSHARED}
# CCSHARED are the C *flags* used to create objects to go into a shared
# library (module) -- this is only needed for a few systems
@@ -7678,7 +7653,6 @@ then
*gcc*) CCSHARED="-shared";;
*) CCSHARED="";;
esac;;
- atheos*) CCSHARED="-fPIC";;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCSHARED" >&5
@@ -7978,7 +7952,8 @@ case "$ac_sys_system" in
$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <load.h>
+
+ #include <load.h>
int
main ()
{
@@ -7986,16 +7961,21 @@ loadAndInit("", 0, "")
;
return 0;
}
+
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
+
$as_echo "#define AIX_GENUINE_CPLUSPLUS 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext;;
@@ -8100,6 +8080,120 @@ $as_echo "no" >&6; }
fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+
+# Check for use of the system expat library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-expat" >&5
+$as_echo_n "checking for --with-system-expat... " >&6; }
+
+# Check whether --with-system_expat was given.
+if test "${with_system_expat+set}" = set; then :
+ withval=$with_system_expat;
+else
+ with_system_expat="no"
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_expat" >&5
+$as_echo "$with_system_expat" >&6; }
+
# Check for use of the system libffi library
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-ffi" >&5
$as_echo_n "checking for --with-system-ffi... " >&6; }
@@ -8112,9 +8206,30 @@ else
fi
+if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
+ LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
+else
+ LIBFFI_INCLUDEDIR=""
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_ffi" >&5
$as_echo "$with_system_ffi" >&6; }
+# Check for support for loadable sqlite extensions
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-loadable-sqlite-extensions" >&5
+$as_echo_n "checking for --enable-loadable-sqlite-extensions... " >&6; }
+# Check whether --enable-loadable-sqlite-extensions was given.
+if test "${enable_loadable_sqlite_extensions+set}" = set; then :
+ enableval=$enable_loadable_sqlite_extensions;
+else
+ enable_loadable_sqlite_extensions="no"
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_loadable_sqlite_extensions" >&5
+$as_echo "$enable_loadable_sqlite_extensions" >&6; }
+
# Check for --with-dbmliborder
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dbmliborder" >&5
$as_echo_n "checking for --with-dbmliborder... " >&6; }
@@ -8319,24 +8434,6 @@ $as_echo "#define MACH_C_THREADS 1" >>confdefs.h
THREADOBJ="Python/thread.o"
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pth" >&5
-$as_echo_n "checking for --with-pth... " >&6; }
-
-# Check whether --with-pth was given.
-if test "${with_pth+set}" = set; then :
- withval=$with_pth; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
-$as_echo "$withval" >&6; }
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_PTH 1" >>confdefs.h
-
- LIBS="-lpth $LIBS"
- THREADOBJ="Python/thread.o"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
# Just looking for pthread_create in libpthread is not enough:
# on HP/UX, pthread.h renames pthread_create to a different symbol name.
# So we really have to include pthread.h, and then link.
@@ -8377,16 +8474,6 @@ if test "x$ac_cv_func_pthread_detach" = xyes; then :
THREADOBJ="Python/thread.o"
else
- ac_fn_c_check_header_mongrel "$LINENO" "atheos/threads.h" "ac_cv_header_atheos_threads_h" "$ac_includes_default"
-if test "x$ac_cv_header_atheos_threads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
-
-$as_echo "#define ATHEOS_THREADS 1" >>confdefs.h
-
- THREADOBJ="Python/thread.o"
-else
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5
$as_echo_n "checking for pthread_create in -lpthreads... " >&6; }
if ${ac_cv_lib_pthreads_pthread_create+:} false; then :
@@ -8575,16 +8662,11 @@ fi
fi
-
-fi
-
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
-fi
-
fi
@@ -8803,6 +8885,7 @@ $as_echo "yes" >&6; }
else
if test "$cross_compiling" = yes; then :
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
ipv6=no
@@ -8823,13 +8906,17 @@ main()
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
ipv6=yes
+
else
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
ipv6=no
+
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
@@ -8841,25 +8928,31 @@ if test "$ipv6" = "yes"; then
$as_echo_n "checking if RFC2553 API is available... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/types.h>
+
+ #include <sys/types.h>
#include <netinet/in.h>
int
main ()
{
struct sockaddr_in6 x;
-x.sin6_scope_id;
+ x.sin6_scope_id;
;
return 0;
}
+
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- ipv6=yes
+ ipv6=yes
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- ipv6=no
+ ipv6=no
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
@@ -9034,7 +9127,8 @@ fi
$as_echo_n "checking for OSX 10.5 SDK or later... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <Carbon/Carbon.h>
+
+ #include <Carbon/Carbon.h>
int
main ()
{
@@ -9042,14 +9136,18 @@ FSIORefNum fRef = 0
;
return 0;
}
+
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+
$as_echo "#define HAVE_OSX105_SDK 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+
else
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
@@ -9112,7 +9210,9 @@ fi
if test -z "$with_pymalloc"
-then with_pymalloc="yes"
+then
+ with_pymalloc="yes"
+ ABIFLAGS="${ABIFLAGS}m"
fi
if test "$with_pymalloc" != "no"
then
@@ -9123,29 +9223,34 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5
$as_echo "$with_pymalloc" >&6; }
-# Check for --with-wctype-functions
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions" >&5
-$as_echo_n "checking for --with-wctype-functions... " >&6; }
+# Check for Valgrind support
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5
+$as_echo_n "checking for --with-valgrind... " >&6; }
-# Check whether --with-wctype-functions was given.
-if test "${with_wctype_functions+set}" = set; then :
- withval=$with_wctype_functions;
-if test "$withval" != no
-then
+# Check whether --with-valgrind was given.
+if test "${with_valgrind+set}" = set; then :
+ withval=$with_valgrind;
+else
+ with_valgrind=no
+fi
-$as_echo "#define WANT_WCTYPE_FUNCTIONS 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_valgrind" >&5
+$as_echo "$with_valgrind" >&6; }
+if test "$with_valgrind" != no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default"
+if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then :
+
+$as_echo "#define WITH_VALGRIND 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ as_fn_error $? "Valgrind support requested but headers not available" "$LINENO" 5
+
fi
+ OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
+fi
+
# -I${DLINCLDIR} is added to the compile rule for importdl.o
DLINCLDIR=.
@@ -9181,7 +9286,6 @@ then
hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
# Use dynload_next.c only on 10.2 and below, which don't have native dlopen()
Darwin/[0156]\..*) DYNLOADFILE="dynload_next.o";;
- atheos*) DYNLOADFILE="dynload_atheos.o";;
*)
# use dynload_shlib.c and dlopen() if we have it; otherwise stub
# out any dynamic loading
@@ -9216,17 +9320,17 @@ fi
$as_echo "MACHDEP_OBJS" >&6; }
# checks for library functions
-for ac_func in alarm setitimer getitimer bind_textdomain_codeset chown \
+for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
- getpriority getpwent getspnam getspent getsid getwd \
- kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \
+ getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
+ initgroups kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \
mremap nice pathconf pause plock poll pthread_init \
putenv readlink realpath \
select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \
setgid \
- setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \
- sigaction siginterrupt sigrelse strftime strlcpy \
+ setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setuid setvbuf \
+ sigaction siginterrupt sigrelse snprintf strftime strlcpy \
sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
truncate uname unsetenv utimes waitpid wait3 wait4 \
wcscoll wcsftime wcsxfrm _getpty
@@ -9261,7 +9365,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_CHROOT 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9286,7 +9390,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_LINK 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9311,7 +9415,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_SYMLINK 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9336,7 +9440,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_FCHDIR 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9361,7 +9465,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_FSYNC 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9386,7 +9490,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_FDATASYNC 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9411,7 +9515,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_EPOLL 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9439,7 +9543,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_KQUEUE 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9458,7 +9562,6 @@ $as_echo_n "checking for ctermid_r... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include "confdefs.h"
#include <stdio.h>
int
@@ -9473,7 +9576,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_CTERMID_R 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9576,7 +9679,6 @@ $as_echo_n "checking for getpagesize... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include "confdefs.h"
#include <unistd.h>
int
@@ -9591,7 +9693,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_GETPAGESIZE 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9896,7 +9998,6 @@ $as_echo_n "checking for hstrerror... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include "confdefs.h"
#include <netdb.h>
int
@@ -9911,7 +10012,7 @@ if ac_fn_c_try_link "$LINENO"; then :
$as_echo "#define HAVE_HSTRERROR 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9926,7 +10027,6 @@ $as_echo_n "checking for inet_aton... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -9944,7 +10044,7 @@ if ac_fn_c_try_link "$LINENO"; then :
$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9959,7 +10059,6 @@ $as_echo_n "checking for inet_pton... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -9977,7 +10076,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9992,7 +10091,6 @@ $as_echo_n "checking for setgroups... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include "confdefs.h"
#include <unistd.h>
#ifdef HAVE_GRP_H
#include <grp.h>
@@ -10010,7 +10108,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_SETGROUPS 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -10305,7 +10403,6 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define GETPGRP_HAVE_ARG 1" >>confdefs.h
-
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -10334,7 +10431,6 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define SETPGRP_HAVE_ARG 1" >>confdefs.h
-
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -10428,23 +10524,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
int
main ()
{
-
getaddrinfo(NULL, NULL, NULL, NULL);
-
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5
+ have_getaddrinfo=yes
+else
+ have_getaddrinfo=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_getaddrinfo" >&5
+$as_echo "$have_getaddrinfo" >&6; }
+if test $have_getaddrinfo = yes
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5
$as_echo_n "checking getaddrinfo bug... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy" >&5
-$as_echo "buggy" >&6; }
-buggygetaddrinfo=yes
+ if ${ac_cv_buggy_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_buggy_getaddrinfo=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -10455,7 +10557,7 @@ else
#include <sys/socket.h>
#include <netinet/in.h>
-main()
+int main()
{
int passive, gaierr, inet4 = 0, inet6 = 0;
struct addrinfo hints, *ai, *aitop;
@@ -10527,40 +10629,35 @@ main()
if (aitop)
freeaddrinfo(aitop);
- exit(0);
+ return 0;
bad:
if (aitop)
freeaddrinfo(aitop);
- exit(1);
+ return 1;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: good" >&5
-$as_echo "good" >&6; }
-buggygetaddrinfo=no
+ ac_cv_buggy_getaddrinfo=no
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy" >&5
-$as_echo "buggy" >&6; }
-buggygetaddrinfo=yes
+ ac_cv_buggy_getaddrinfo=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-buggygetaddrinfo=yes
+fi
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test "$buggygetaddrinfo" = "yes"; then
- if test "$ipv6" = "yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_buggy_getaddrinfo" >&5
+$as_echo "$ac_cv_buggy_getaddrinfo" >&6; }
+
+if test $have_getaddrinfo = no -o "$ac_cv_buggy_getaddrinfo" = yes
+then
+ if test $ipv6 = yes
+ then
echo 'Fatal: You must get working getaddrinfo() function.'
echo ' or you can specify "--disable-ipv6"'.
exit 1
@@ -10570,6 +10667,7 @@ else
$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
fi
+
for ac_func in getnameinfo
do :
ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo"
@@ -10796,6 +10894,7 @@ $as_echo_n "checking for time.h that defines altzone... " >&6; }
if ${ac_cv_header_time_altzone+:} false; then :
$as_echo_n "(cached) " >&6
else
+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <time.h>
@@ -10813,6 +10912,7 @@ else
ac_cv_header_time_altzone=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time_altzone" >&5
@@ -10860,8 +10960,7 @@ if ${ac_cv_struct_addrinfo+:} false; then :
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-# include <netdb.h>
+#include <netdb.h>
int
main ()
{
@@ -11103,11 +11202,9 @@ return foo(10);
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
-
$as_echo "#define HAVE_PROTOTYPES 1" >>confdefs.h
- have_prototypes=yes
-
+ have_prototypes=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_prototypes" >&5
@@ -11170,7 +11267,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_SOCKETPAIR 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -11204,6 +11301,7 @@ $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -11293,19 +11391,19 @@ $as_echo_n "checking gethostbyname_r with 5 args... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-# include <netdb.h>
+# include <netdb.h>
int
main ()
{
- char *name;
- struct hostent *he;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
+ char *name;
+ struct hostent *he;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
- (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
+ (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
;
return 0;
@@ -11313,34 +11411,34 @@ main ()
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
+ $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
$as_echo "#define HAVE_GETHOSTBYNAME_R_5_ARG 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 3 args" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 3 args" >&5
$as_echo_n "checking gethostbyname_r with 3 args... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-# include <netdb.h>
+# include <netdb.h>
int
main ()
{
- char *name;
- struct hostent *he;
- struct hostent_data data;
+ char *name;
+ struct hostent *he;
+ struct hostent_data data;
- (void) gethostbyname_r(name, he, &data);
+ (void) gethostbyname_r(name, he, &data);
;
return 0;
@@ -11348,17 +11446,17 @@ main ()
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
+ $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
$as_echo "#define HAVE_GETHOSTBYNAME_R_3_ARG 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
@@ -11663,24 +11761,24 @@ fi
# correctly-rounded string <-> double conversion functions from
# Python/dtoa.c, which in turn require that the FPU uses 53-bit
# rounding; this is a problem on x86, where the x87 FPU has a default
-# rounding precision of 64 bits. For gcc/x86, we try to fix this by
+# rounding precision of 64 bits. For gcc/x86, we can fix this by
# using inline assembler to get and set the x87 FPU control word.
-if test "$GCC" = yes && test -n "`$CC -dM -E - </dev/null | grep i386`"
-then
- # Check that it's okay to use gcc inline assembler to get and set
- # x87 control word. It should be, but you never know...
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set x87 control word" >&5
+
+# This inline assembler syntax may also work for suncc and icc,
+# so we try it on all platforms.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set x87 control word" >&5
$as_echo_n "checking whether we can use gcc inline assembler to get and set x87 control word... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
- unsigned short cw;
- __asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
- __asm__ __volatile__ ("fldcw %0" : : "m" (cw));
+ unsigned short cw;
+ __asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
+ __asm__ __volatile__ ("fldcw %0" : : "m" (cw));
;
return 0;
@@ -11692,14 +11790,13 @@ else
have_gcc_asm_for_x87=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x87" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x87" >&5
$as_echo "$have_gcc_asm_for_x87" >&6; }
- if test "$have_gcc_asm_for_x87" = yes
- then
+if test "$have_gcc_asm_for_x87" = yes
+then
$as_echo "#define HAVE_GCC_ASM_FOR_X87 1" >>confdefs.h
- fi
fi
# Detect whether system arithmetic is subject to x87-style double
@@ -11764,6 +11861,65 @@ fi
LIBS_SAVE=$LIBS
LIBS="$LIBS $LIBM"
+for ac_func in acosh asinh atanh copysign erf erfc expm1 finite gamma
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in hypot lgamma log1p round tgamma
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include <math.h>
+"
+if test "x$ac_cv_have_decl_isinf" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISINF $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include <math.h>
+"
+if test "x$ac_cv_have_decl_isnan" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISNAN $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include <math.h>
+"
+if test "x$ac_cv_have_decl_isfinite" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISFINITE $ac_have_decl
+_ACEOF
+
+
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
# -0. on some architectures.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tanh preserves the sign of zero" >&5
@@ -11810,52 +11966,54 @@ $as_echo "#define TANH_PRESERVES_ZERO_SIGN 1" >>confdefs.h
fi
-for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p round
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
+if test "$ac_cv_func_log1p" = yes
+then
+ # On some versions of AIX, log1p(-0.) returns 0. instead of
+ # -0. See issue #9920.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether log1p drops the sign of negative zero" >&5
+$as_echo_n "checking whether log1p drops the sign of negative zero... " >&6; }
+ if ${ac_cv_log1p_drops_zero_sign+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
-ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_isinf" = xyes; then :
- ac_have_decl=1
+ if test "$cross_compiling" = yes; then :
+ ac_cv_log1p_drops_zero_sign=no
else
- ac_have_decl=0
-fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <math.h>
+ #include <stdlib.h>
+ int main() {
+ /* Fail if the signs of log1p(-0.) and -0. can be
+ distinguished. */
+ if (atan2(log1p(-0.), -1.) == atan2(-0., -1.))
+ return 0;
+ else
+ return 1;
+ }
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISINF $ac_have_decl
_ACEOF
-ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_isnan" = xyes; then :
- ac_have_decl=1
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_log1p_drops_zero_sign=no
else
- ac_have_decl=0
+ ac_cv_log1p_drops_zero_sign=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISNAN $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_isfinite" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
fi
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISFINITE $ac_have_decl
-_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_log1p_drops_zero_sign" >&5
+$as_echo "$ac_cv_log1p_drops_zero_sign" >&6; }
+fi
+if test "$ac_cv_log1p_drops_zero_sign" = yes
+then
+$as_echo "#define LOG1P_DROPS_ZERO_SIGN 1" >>confdefs.h
+
+fi
LIBS=$LIBS_SAVE
@@ -11917,11 +12075,11 @@ fi
# Multiprocessing check for broken sem_getvalue
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue" >&5
$as_echo_n "checking for broken sem_getvalue... " >&6; }
-if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+if ${ac_cv_broken_sem_getvalue+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_broken_sem_getvalue=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11947,24 +12105,28 @@ int main(void){
return res==-1 ? 1 : 0;
}
-
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_broken_sem_getvalue=no
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_BROKEN_SEM_GETVALUE 1" >>confdefs.h
-
-
+ ac_cv_broken_sem_getvalue=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_sem_getvalue" >&5
+$as_echo "$ac_cv_broken_sem_getvalue" >&6; }
+if test $ac_cv_broken_sem_getvalue = yes
+then
+
+$as_echo "#define HAVE_BROKEN_SEM_GETVALUE 1" >>confdefs.h
+
+fi
+
# determine what size digit to use for Python's longs
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking digit size for Python's longs" >&5
$as_echo_n "checking digit size for Python's longs... " >&6; }
@@ -12132,7 +12294,7 @@ fi
else
case "$have_ucs4_tcl" in
- yes) unicode_size="4" ;;
+ yes) unicode_size="4";;
*) unicode_size="2" ;;
esac
@@ -12141,8 +12303,11 @@ fi
case "$unicode_size" in
- 4) $as_echo "#define Py_UNICODE_SIZE 4" >>confdefs.h
- ;;
+ 4)
+ $as_echo "#define Py_UNICODE_SIZE 4" >>confdefs.h
+
+ ABIFLAGS="${ABIFLAGS}u"
+ ;;
*) $as_echo "#define Py_UNICODE_SIZE 2" >>confdefs.h
;;
esac
@@ -12401,6 +12566,70 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
esac
+# ABI version string for Python extension modules. This appears between the
+# periods in shared library file names, e.g. foo.<SOABI>.so. It is calculated
+# from the following attributes which affect the ABI of this Python build (in
+# this order):
+#
+# * The Python implementation (always 'cpython-' for us)
+# * The major and minor version numbers
+# * --with-pydebug (adds a 'd')
+# * --with-pymalloc (adds a 'm')
+# * --with-wide-unicode (adds a 'u')
+#
+# Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
+# would get a shared library ABI version tag of 'cpython-32dmu' and shared
+# libraries would be named 'foo.cpython-32dmu.so'.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ABIFLAGS" >&5
+$as_echo_n "checking ABIFLAGS... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ABIFLAGS" >&5
+$as_echo "$ABIFLAGS" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
+$as_echo_n "checking SOABI... " >&6; }
+SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
+$as_echo "$SOABI" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5
+$as_echo_n "checking LDVERSION... " >&6; }
+LDVERSION='$(VERSION)$(ABIFLAGS)'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDVERSION" >&5
+$as_echo "$LDVERSION" >&6; }
+
+# SO is the extension of shared libraries `(including the dot!)
+# -- usually .so, .sl on HP-UX, .dll on Cygwin
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SO" >&5
+$as_echo_n "checking SO... " >&6; }
+if test -z "$SO"
+then
+ case $ac_sys_system in
+ hp*|HP*)
+ case `uname -m` in
+ ia64) SO=.so;;
+ *) SO=.sl;;
+ esac
+ ;;
+ CYGWIN*) SO=.dll;;
+ Linux*|GNU*)
+ SO=.${SOABI}.so;;
+ *) SO=.so;;
+ esac
+else
+ # this might also be a termcap variable, see #610332
+ echo
+ echo '====================================================================='
+ echo '+ +'
+ echo '+ WARNING: You have set SO in your environment. +'
+ echo '+ Do you really mean to change the extension for shared libraries? +'
+ echo '+ Continuing in 10 seconds to let you to ponder. +'
+ echo '+ +'
+ echo '====================================================================='
+ sleep 10
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SO" >&5
+$as_echo "$SO" >&6; }
+
# Check whether right shifting a negative integer extends the sign bit
# or fills with zeros (like the Cray J90, according to Tim Peters).
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the sign bit" >&5
@@ -12592,6 +12821,7 @@ if ac_fn_c_try_cpp "$LINENO"; then :
have_readline=yes
else
have_readline=no
+
fi
rm -f conftest.err conftest.i conftest.$ac_ext
if test $have_readline = yes
@@ -12765,6 +12995,7 @@ if ac_fn_c_try_cpp "$LINENO"; then :
have_readline=yes
else
have_readline=no
+
fi
rm -f conftest.err conftest.i conftest.$ac_ext
if test $have_readline = yes
@@ -12830,7 +13061,10 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()" >&5
$as_echo_n "checking for broken poll()... " >&6; }
-if test "$cross_compiling" = yes; then :
+if ${ac_cv_broken_poll+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
ac_cv_broken_poll=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12838,27 +13072,21 @@ else
#include <poll.h>
-int main (void)
- {
+int main()
+{
struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
+ int poll_test;
close (42);
- int poll_test = poll (&poll_struct, 1, 0);
-
+ poll_test = poll(&poll_struct, 1, 0);
if (poll_test < 0)
- {
- exit(0);
- }
+ return 0;
else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
- {
- exit(0);
- }
+ return 0;
else
- {
- exit(1);
- }
- }
+ return 1;
+}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
@@ -12870,6 +13098,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_poll" >&5
$as_echo "$ac_cv_broken_poll" >&6; }
if test "$ac_cv_broken_poll" = yes
@@ -13214,7 +13444,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_CURSES_IS_TERM_RESIZED 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -13240,7 +13470,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_CURSES_RESIZE_TERM 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -13266,7 +13496,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_CURSES_RESIZETERM 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -13305,16 +13535,90 @@ else
$as_echo "no" >&6; }
fi
+if test "$have_long_long" = yes
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %lld and %llu printf() format support" >&5
+$as_echo_n "checking for %lld and %llu printf() format support... " >&6; }
+ if ${ac_cv_have_long_long_format+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_have_long_long_format=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <stddef.h>
+ #include <string.h>
+
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+
+ int main()
+ {
+ char buffer[256];
+
+ if (sprintf(buffer, "%lld", (long long)123) < 0)
+ return 1;
+ if (strcmp(buffer, "123"))
+ return 1;
+
+ if (sprintf(buffer, "%lld", (long long)-123) < 0)
+ return 1;
+ if (strcmp(buffer, "-123"))
+ return 1;
+
+ if (sprintf(buffer, "%llu", (unsigned long long)123) < 0)
+ return 1;
+ if (strcmp(buffer, "123"))
+ return 1;
+
+ return 0;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_have_long_long_format=yes
+else
+ ac_cv_have_long_long_format=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_long_long_format" >&5
+$as_echo "$ac_cv_have_long_long_format" >&6; }
+fi
+
+if test "$ac_cv_have_long_long_format" = yes
+then
+
+$as_echo "#define PY_FORMAT_LONG_LONG \"ll\"" >>confdefs.h
+
+fi
+
+if test $ac_sys_system = Darwin
+then
+ LIBS="$LIBS -framework CoreFoundation"
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format support" >&5
$as_echo_n "checking for %zd printf() format support... " >&6; }
-if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+if ${ac_cv_have_size_t_format+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_have_size_t_format="cross -- assuming yes"
+
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+
#include <stdio.h>
#include <stddef.h>
#include <string.h>
@@ -13349,21 +13653,25 @@ int main()
return 0;
}
+
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define PY_FORMAT_SIZE_T \"z\"" >>confdefs.h
-
+ ac_cv_have_size_t_format=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_cv_have_size_t_format=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_size_t_format" >&5
+$as_echo "$ac_cv_have_size_t_format" >&6; }
+if test "$ac_cv_have_size_t_format" != no ; then
+
+$as_echo "#define PY_FORMAT_SIZE_T \"z\"" >>confdefs.h
+
+fi
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
#ifdef HAVE_SYS_TYPES_H
@@ -13385,7 +13693,10 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken mbstowcs" >&5
$as_echo_n "checking for broken mbstowcs... " >&6; }
-if test "$cross_compiling" = yes; then :
+if ${ac_cv_broken_mbstowcs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
ac_cv_broken_mbstowcs=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -13409,6 +13720,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_mbstowcs" >&5
$as_echo "$ac_cv_broken_mbstowcs" >&6; }
if test "$ac_cv_broken_mbstowcs" = yes
@@ -13418,6 +13731,49 @@ $as_echo "#define HAVE_BROKEN_MBSTOWCS 1" >>confdefs.h
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5
+$as_echo_n "checking whether $CC supports computed gotos... " >&6; }
+if ${ac_cv_computed_gotos+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_computed_gotos=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int main(int argc, char **argv)
+{
+ static void *targets[1] = { &&LABEL1 };
+ goto LABEL2;
+LABEL1:
+ return 0;
+LABEL2:
+ goto *targets[0];
+ return 1;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_computed_gotos=yes
+else
+ ac_cv_computed_gotos=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_computed_gotos" >&5
+$as_echo "$ac_cv_computed_gotos" >&6; }
+if test "$ac_cv_computed_gotos" = yes
+then
+
+$as_echo "#define HAVE_COMPUTED_GOTOS 1" >>confdefs.h
+
+fi
+
# Check for --with-computed-gotos
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-computed-gotos" >&5
$as_echo_n "checking for --with-computed-gotos... " >&6; }
@@ -13425,28 +13781,48 @@ $as_echo_n "checking for --with-computed-gotos... " >&6; }
# Check whether --with-computed-gotos was given.
if test "${with_computed_gotos+set}" = set; then :
withval=$with_computed_gotos;
-if test "$withval" != no
+if test "$withval" = yes
then
$as_echo "#define USE_COMPUTED_GOTOS 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
fi
-else
+if test "$withval" = no
+then
+
+$as_echo "#define USE_COMPUTED_GOTOS 0" >>confdefs.h
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-
-if test $ac_sys_system = Darwin
-then
- LIBS="$LIBS -framework CoreFoundation"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5
+$as_echo "no value specified" >&6; }
fi
+case $ac_sys_system in
+AIX*)
+
+$as_echo "#define HAVE_BROKEN_PIPE_BUF 1" >>confdefs.h
+ ;;
+esac
+
+
+case $ac_sys_system in
+ OSF*) as_fn_error $? "OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606" "$LINENO" 5 ;;
+esac
+
+ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2"
+if test "x$ac_cv_func_pipe2" = xyes; then :
+
+$as_echo "#define HAVE_PIPE2 1" >>confdefs.h
+
+fi
+
@@ -13991,7 +14367,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by python $as_me 3.1, which was
+This file was extended by python $as_me 3.2, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14053,7 +14429,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-python config.status 3.1
+python config.status 3.2
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.in b/configure.in
index 9b7a5a7f70..aaeb9bc31c 100644
--- a/configure.in
+++ b/configure.in
@@ -1,13 +1,20 @@
dnl ***********************************************
dnl * Please run autoreconf to test your changes! *
dnl ***********************************************
-dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.61).
# Set VERSION so we only need to edit in one place (i.e., here)
-m4_define(PYTHON_VERSION, 3.1)
+m4_define(PYTHON_VERSION, 3.2)
+
+dnl Some m4 magic to ensure that the configure script is generated
+dnl by the correct autoconf version.
+m4_define([version_required],
+[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [$1]), 0,
+ [],
+ [m4_fatal([Autoconf version $1 is required for Python], 63)])
+])
+AC_PREREQ(2.65)
AC_REVISION($Revision$)
-AC_PREREQ(2.61)
AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
AC_CONFIG_SRCDIR([Include/object.h])
AC_CONFIG_HEADER(pyconfig.h)
@@ -45,6 +52,7 @@ mv confdefs.h.new confdefs.h
AC_SUBST(VERSION)
VERSION=PYTHON_VERSION
+# Version number of Python's own shared library file.
AC_SUBST(SOVERSION)
SOVERSION=1.0
@@ -80,7 +88,7 @@ CONFIG_ARGS="$ac_configure_args"
AC_MSG_CHECKING([for --enable-universalsdk])
AC_ARG_ENABLE(universalsdk,
- AC_HELP_STRING(--enable-universalsdk@<:@=SDKDIR@:>@, Build against Mac OS X 10.4u SDK (ppc/i386)),
+ AS_HELP_STRING([--enable-universalsdk@<:@=SDKDIR@:>@], [Build against Mac OS X 10.4u SDK (ppc/i386)]),
[
case $enableval in
yes)
@@ -121,10 +129,9 @@ AC_SUBST(ARCH_RUN_32BIT)
UNIVERSAL_ARCHS="32-bit"
AC_SUBST(LIPO_32BIT_FLAGS)
-AC_SUBST(LIPO_64BIT_FLAGS)
AC_MSG_CHECKING(for --with-universal-archs)
AC_ARG_WITH(universal-archs,
- AC_HELP_STRING(--with-universal-archs=ARCH, select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")),
+ AS_HELP_STRING([--with-universal-archs=ARCH], [select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")]),
[
AC_MSG_RESULT($withval)
UNIVERSAL_ARCHS="$withval"
@@ -136,8 +143,8 @@ AC_ARG_WITH(universal-archs,
AC_ARG_WITH(framework-name,
- AC_HELP_STRING(--with-framework-name=FRAMEWORK,
- specify an alternate name of the framework built with --enable-framework),
+ AS_HELP_STRING([--with-framework-name=FRAMEWORK],
+ [specify an alternate name of the framework built with --enable-framework]),
[
PYTHONFRAMEWORK=${withval}
PYTHONFRAMEWORKDIR=${withval}.framework
@@ -149,7 +156,7 @@ AC_ARG_WITH(framework-name,
])
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
AC_ARG_ENABLE(framework,
- AC_HELP_STRING(--enable-framework@<:@=INSTALLDIR@:>@, Build (MacOSX|Darwin) framework),
+ AS_HELP_STRING([--enable-framework@<:@=INSTALLDIR@:>@], [Build (MacOSX|Darwin) framework]),
[
case $enableval in
yes)
@@ -173,26 +180,55 @@ AC_ARG_ENABLE(framework,
enable_framework=
;;
*)
- PYTHONFRAMEWORKPREFIX=$enableval
+ PYTHONFRAMEWORKPREFIX="${enableval}"
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
- case "${UNIVERSAL_ARCHS}" in
- all|3-way|intel)
- FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkinstallunixtools4way"
- FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkaltinstallunixtools4way"
- ;;
- *)
- FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
- FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
- ;;
- esac
+ FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
+ FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
+ FRAMEWORKINSTALLAPPSPREFIX="/Applications"
if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
+
else
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
fi
+
+ case "${enableval}" in
+ /System*)
+ FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+ if test "${prefix}" = "NONE" ; then
+ # See below
+ FRAMEWORKUNIXTOOLSPREFIX="/usr"
+ fi
+ ;;
+
+ /Library*)
+ FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+ ;;
+
+ */Library/Frameworks)
+ MDIR="`dirname "${enableval}"`"
+ MDIR="`dirname "${MDIR}"`"
+ FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
+
+ if test "${prefix}" = "NONE"; then
+ # User hasn't specified the
+ # --prefix option, but wants to install
+ # the framework in a non-default location,
+ # ensure that the compatibility links get
+ # installed relative to that prefix as well
+ # instead of in /usr/local.
+ FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
+ fi
+ ;;
+
+ *)
+ FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+ ;;
+ esac
+
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
# Add files for Mac specific code to the list of output
@@ -218,11 +254,6 @@ AC_ARG_ENABLE(framework,
fi
enable_framework=
- if test "$UNIVERSAL_ARCHS" = "all"
- then
- FRAMEWORKINSTALLLAST=update4wayuniversal
- FRAMEWORKALTINSTALLLAST=update4wayuniversal
- fi
])
AC_SUBST(PYTHONFRAMEWORK)
AC_SUBST(PYTHONFRAMEWORKIDENTIFIER)
@@ -234,10 +265,11 @@ AC_SUBST(FRAMEWORKINSTALLLAST)
AC_SUBST(FRAMEWORKALTINSTALLFIRST)
AC_SUBST(FRAMEWORKALTINSTALLLAST)
AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
+AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
##AC_ARG_WITH(dyld,
-## AC_HELP_STRING(--with-dyld,
-## Use (OpenStep|Rhapsody) dynamic linker))
+## AS_HELP_STRING([--with-dyld],
+## [Use (OpenStep|Rhapsody) dynamic linker]))
##
# Set name for machine-dependent library files
AC_SUBST(MACHDEP)
@@ -260,7 +292,6 @@ then
case $MACHDEP in
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
- atheos*) MACHDEP="atheos";;
irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
esac
@@ -300,9 +331,12 @@ case $ac_sys_system/$ac_sys_release in
# Marc Recht
NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
define_xopen_source=no;;
- # On Solaris 2.6, sys/wait.h is inconsistent in the usage
- # of union __?sigval. Reported by Stuart Bishop.
- SunOS/5.6)
+ # From the perspective of Solaris, _XOPEN_SOURCE is not so much a
+ # request to enable features supported by the standard as a request
+ # to disable features not supported by the standard. The best way
+ # for Python to use Solaris is simply to leave _XOPEN_SOURCE out
+ # entirely and define __EXTENSIONS__ instead.
+ SunOS/*)
define_xopen_source=no;;
# On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
# but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
@@ -348,35 +382,15 @@ esac
if test $define_xopen_source = yes
then
- # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
- # defined precisely as g++ defines it
- # Furthermore, on Solaris 10, XPG6 requires the use of a C99
- # compiler
- case $ac_sys_system/$ac_sys_release in
- SunOS/5.8|SunOS/5.9|SunOS/5.10|SunOS/5.11)
- AC_DEFINE(_XOPEN_SOURCE, 500,
- Define to the level of X/Open that your system supports)
- ;;
- *)
- AC_DEFINE(_XOPEN_SOURCE, 600,
- Define to the level of X/Open that your system supports)
- ;;
- esac
+ AC_DEFINE(_XOPEN_SOURCE, 600,
+ Define to the level of X/Open that your system supports)
# On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
# definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
# several APIs are not declared. Since this is also needed in some
# cases for HP-UX, we define it globally.
- # except for Solaris 10, where it must not be defined,
- # as it implies XPG4.2
- case $ac_sys_system/$ac_sys_release in
- SunOS/5.10|SunOS/5.11)
- ;;
- *)
- AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
- Define to activate Unix95-and-earlier features)
- ;;
- esac
+ AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
+ Define to activate Unix95-and-earlier features)
AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
@@ -424,7 +438,7 @@ AC_MSG_RESULT($ac_sys_machine)
# on that fiddles with OPT and BASECFLAGS?
AC_MSG_CHECKING(for --without-gcc)
AC_ARG_WITH(gcc,
- AC_HELP_STRING(--without-gcc,never use gcc),
+ AS_HELP_STRING([--without-gcc], [never use gcc]),
[
case $withval in
no) CC=${CC:-cc}
@@ -448,13 +462,19 @@ then
(it is also a good idea to do 'make clean' before compiling)])
fi
+# Don't let AC_PROG_CC set the default CFLAGS. It normally sets -g -O2
+# when the compiler supports them, but we don't always want -O2, and
+# we set -g later.
+if test -z "$CFLAGS"; then
+ CFLAGS=
+fi
AC_PROG_CC
AC_SUBST(CXX)
AC_SUBST(MAINCC)
AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
AC_ARG_WITH(cxx_main,
- AC_HELP_STRING([--with-cxx-main=<compiler>],
+ AS_HELP_STRING([--with-cxx-main=<compiler>],
[compile main() and link python executable with C++ compiler]),
[
@@ -506,7 +526,7 @@ fi
# checks for UNIX variants that set C preprocessor variables
-AC_AIX
+AC_USE_SYSTEM_EXTENSIONS
# Check for unsupported systems
case $ac_sys_system/$ac_sys_release in
@@ -519,7 +539,7 @@ esac
AC_EXEEXT
AC_MSG_CHECKING(for --with-suffix)
AC_ARG_WITH(suffix,
- AC_HELP_STRING(--with-suffix=.exe, set executable suffix),
+ AS_HELP_STRING([--with-suffix=.exe], [set executable suffix]),
[
case $withval in
no) EXEEXT=;;
@@ -558,10 +578,6 @@ hp*|HP*)
case $CC in
cc|*/cc) CC="$CC -Ae";;
esac;;
-SunOS*)
- # Some functions have a prototype only with that define, e.g. confstr
- AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
- ;;
esac
@@ -569,7 +585,7 @@ AC_SUBST(LIBRARY)
AC_MSG_CHECKING(LIBRARY)
if test -z "$LIBRARY"
then
- LIBRARY='libpython$(VERSION).a'
+ LIBRARY='libpython$(VERSION)$(ABIFLAGS).a'
fi
AC_MSG_RESULT($LIBRARY)
@@ -586,18 +602,24 @@ AC_MSG_RESULT($LIBRARY)
#
# INSTSONAME is the name of the shared library that will be use to install
# on the system - some systems like version suffix, others don't
+#
+# LDVERSION is the shared library version number, normally the Python version
+# with the ABI build flags appended.
AC_SUBST(LDLIBRARY)
AC_SUBST(DLLLIBRARY)
AC_SUBST(BLDLIBRARY)
+AC_SUBST(PY3LIBRARY)
AC_SUBST(LDLIBRARYDIR)
AC_SUBST(INSTSONAME)
AC_SUBST(RUNSHARED)
+AC_SUBST(LDVERSION)
LDLIBRARY="$LIBRARY"
BLDLIBRARY='$(LDLIBRARY)'
INSTSONAME='$(LDLIBRARY)'
DLLLIBRARY=''
LDLIBRARYDIR=''
RUNSHARED=''
+LDVERSION="$VERSION"
# LINKCC is the command that links the python executable -- default is $(CC).
# If CXX is set, and if it is needed to link a main function that was
@@ -645,14 +667,21 @@ case `"$ac_prog" -V 2>&1 < /dev/null` in
esac
AC_MSG_RESULT($GNULD)
+AC_C_INLINE
+if test "$ac_cv_c_inline" != no ; then
+ AC_DEFINE(USE_INLINE, 1, [Define to use the C99 inline keyword.])
+ AC_SUBST(USE_INLINE)
+fi
+
+
AC_MSG_CHECKING(for --enable-shared)
AC_ARG_ENABLE(shared,
- AC_HELP_STRING(--enable-shared, disable/enable building shared python library))
+ AS_HELP_STRING([--enable-shared], [disable/enable building shared python library]))
if test -z "$enable_shared"
then
case $ac_sys_system in
- CYGWIN* | atheos*)
+ CYGWIN*)
enable_shared="yes";;
*)
enable_shared="no";;
@@ -662,13 +691,13 @@ AC_MSG_RESULT($enable_shared)
AC_MSG_CHECKING(for --enable-profiling)
AC_ARG_ENABLE(profiling,
- AC_HELP_STRING(--enable-profiling, enable C-level code profiling),
+ AS_HELP_STRING([--enable-profiling], [enable C-level code profiling]),
[ac_save_cc="$CC"
CC="$CC -pg"
- AC_TRY_RUN([int main() { return 0; }],
- ac_enable_profiling="yes",
- ac_enable_profiling="no",
- ac_enable_profiling="no")
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
+ [ac_enable_profiling="yes"],
+ [ac_enable_profiling="no"],
+ [ac_enable_profiling="no"])
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_enable_profiling)
@@ -701,18 +730,22 @@ if test $enable_shared = "yes"; then
AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
case $ac_sys_system in
CYGWIN*)
- LDLIBRARY='libpython$(VERSION).dll.a'
- DLLLIBRARY='libpython$(VERSION).dll'
+ LDLIBRARY='libpython$(LDVERSION).dll.a'
+ DLLLIBRARY='libpython$(LDVERSION).dll'
;;
SunOS*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(LDVERSION).so'
+ BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
+ if test "$with_pydebug" != yes
+ then
+ PY3LIBRARY=libpython3.so
+ fi
;;
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(LDVERSION).so'
+ BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
case $ac_sys_system in
FreeBSD*)
@@ -720,36 +753,35 @@ if test $enable_shared = "yes"; then
;;
esac
INSTSONAME="$LDLIBRARY".$SOVERSION
+ if test "$with_pydebug" != yes
+ then
+ PY3LIBRARY=libpython3.so
+ fi
;;
hp*|HP*)
case `uname -m` in
ia64)
- LDLIBRARY='libpython$(VERSION).so'
+ LDLIBRARY='libpython$(LDVERSION).so'
;;
*)
- LDLIBRARY='libpython$(VERSION).sl'
+ LDLIBRARY='libpython$(LDVERSION).sl'
;;
esac
- BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)'
+ BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH}
;;
OSF*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(LDVERSION).so'
+ BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
;;
- atheos*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-L. -lpython$(VERSION)'
- RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
- ;;
Darwin*)
- LDLIBRARY='libpython$(VERSION).dylib'
- BLDLIBRARY='-L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(LDVERSION).dylib'
+ BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
;;
AIX*)
- LDLIBRARY='libpython$(VERSION).so'
+ LDLIBRARY='libpython$(LDVERSION).so'
RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
;;
@@ -758,7 +790,7 @@ else # shared is disabled
case $ac_sys_system in
CYGWIN*)
BLDLIBRARY='$(LIBRARY)'
- LDLIBRARY='libpython$(VERSION).dll.a'
+ LDLIBRARY='libpython$(LDVERSION).dll.a'
;;
esac
fi
@@ -815,15 +847,18 @@ AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
CYGWIN*) LN="ln -s";;
- atheos*) LN="ln -s";;
*) LN=ln;;
esac
fi
+# For calculating the .so ABI tag.
+AC_SUBST(ABIFLAGS)
+ABIFLAGS=""
+
# Check for --with-pydebug
AC_MSG_CHECKING(for --with-pydebug)
AC_ARG_WITH(pydebug,
- AC_HELP_STRING(--with-pydebug, build with Py_DEBUG defined),
+ AS_HELP_STRING([--with-pydebug], [build with Py_DEBUG defined]),
[
if test "$withval" != no
then
@@ -831,6 +866,7 @@ then
[Define if you want to build an interpreter with many run-time checks.])
AC_MSG_RESULT(yes);
Py_DEBUG='true'
+ ABIFLAGS="${ABIFLAGS}d"
else AC_MSG_RESULT(no); Py_DEBUG='false'
fi],
[AC_MSG_RESULT(no)])
@@ -867,7 +903,7 @@ then
if test "$Py_DEBUG" = 'true' ; then
# Optimization messes up debuggers, so turn it off for
# debug builds.
- OPT="-g -Wall $STRICT_PROTO"
+ OPT="-g -O0 -Wall $STRICT_PROTO"
else
OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
fi
@@ -968,30 +1004,28 @@ yes)
if test "${enable_universalsdk}"; then
UNIVERSAL_ARCH_FLAGS=""
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
- ARCH_RUN_32BIT=""
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
-
+ ARCH_RUN_32BIT=""
+ LIPO_32BIT_FLAGS=""
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
- ARCH_RUN_32BIT="true"
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
+ LIPO_32BIT_FLAGS=""
+ ARCH_RUN_32BIT="true"
elif test "$UNIVERSAL_ARCHS" = "all" ; then
- ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
- LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400"
- LIPO_64BIT_FLAGS="-extract x86_64 -extract ppc64"
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
elif test "$UNIVERSAL_ARCHS" = "intel" ; then
- ARCH_RUN_32BIT="/usr/bin/arch -i386"
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
LIPO_32BIT_FLAGS="-extract i386"
- LIPO_64BIT_FLAGS="-extract x86_64"
+ ARCH_RUN_32BIT="/usr/bin/arch -i386"
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
- ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
- LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400"
- LIPO_64BIT_FLAGS="-extract x86_64"
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
else
AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
@@ -1004,7 +1038,7 @@ yes)
then
CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
- CPPFLAGSFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
+ CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
fi
fi
@@ -1082,62 +1116,21 @@ then
BASECFLAGS="$BASECFLAGS $ac_arch_flags"
fi
-# disable check for icc since it seems to pass, but generates a warning
-if test "$CC" = icc
-then
- ac_cv_opt_olimit_ok=no
-fi
-
-AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
-AC_CACHE_VAL(ac_cv_opt_olimit_ok,
-[ac_save_cc="$CC"
-CC="$CC -OPT:Olimit=0"
-AC_TRY_RUN([int main() { return 0; }],
- ac_cv_opt_olimit_ok=yes,
- ac_cv_opt_olimit_ok=no,
- ac_cv_opt_olimit_ok=no)
-CC="$ac_save_cc"])
-AC_MSG_RESULT($ac_cv_opt_olimit_ok)
-if test $ac_cv_opt_olimit_ok = yes; then
- case $ac_sys_system in
- # XXX is this branch needed? On MacOSX 10.2.2 the result of the
- # olimit_ok test is "no". Is it "yes" in some other Darwin-esque
- # environment?
- Darwin*)
- ;;
- *)
- BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
- ;;
- esac
-else
- AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
- AC_CACHE_VAL(ac_cv_olimit_ok,
- [ac_save_cc="$CC"
- CC="$CC -Olimit 1500"
- AC_TRY_RUN([int main() { return 0; }],
- ac_cv_olimit_ok=yes,
- ac_cv_olimit_ok=no,
- ac_cv_olimit_ok=no)
- CC="$ac_save_cc"])
- AC_MSG_RESULT($ac_cv_olimit_ok)
- if test $ac_cv_olimit_ok = yes; then
- BASECFLAGS="$BASECFLAGS -Olimit 1500"
- fi
-fi
-
# Check whether GCC supports PyArg_ParseTuple format
if test "$GCC" = "yes"
then
AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror"
- AC_TRY_COMPILE([
- void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
- ],,
- AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1, [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
- )
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
+ ],[
+ AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1,
+ [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_RESULT(no)
+ ])
CFLAGS=$save_CFLAGS
fi
@@ -1148,7 +1141,7 @@ fi
# options before we can check whether -Kpthread improves anything.
AC_MSG_CHECKING(whether pthreads are available without options)
AC_CACHE_VAL(ac_cv_pthread_is_default,
-[AC_TRY_RUN([
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <pthread.h>
void* routine(void* p){return NULL;}
@@ -1160,14 +1153,11 @@ int main(){
(void)pthread_detach(p);
return 0;
}
-],
-[
+]])],[
ac_cv_pthread_is_default=yes
ac_cv_kthread=no
ac_cv_pthread=no
-],
- ac_cv_pthread_is_default=no,
- ac_cv_pthread_is_default=no)
+],[ac_cv_pthread_is_default=no],[ac_cv_pthread_is_default=no])
])
AC_MSG_RESULT($ac_cv_pthread_is_default)
@@ -1185,7 +1175,7 @@ AC_MSG_CHECKING(whether $CC accepts -Kpthread)
AC_CACHE_VAL(ac_cv_kpthread,
[ac_save_cc="$CC"
CC="$CC -Kpthread"
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <pthread.h>
void* routine(void* p){return NULL;}
@@ -1197,10 +1187,7 @@ int main(){
(void)pthread_detach(p);
return 0;
}
-],
- ac_cv_kpthread=yes,
- ac_cv_kpthread=no,
- ac_cv_kpthread=no)
+]])],[ac_cv_kpthread=yes],[ac_cv_kpthread=no],[ac_cv_kpthread=no])
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_kpthread)
fi
@@ -1216,7 +1203,7 @@ AC_MSG_CHECKING(whether $CC accepts -Kthread)
AC_CACHE_VAL(ac_cv_kthread,
[ac_save_cc="$CC"
CC="$CC -Kthread"
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <pthread.h>
void* routine(void* p){return NULL;}
@@ -1228,10 +1215,7 @@ int main(){
(void)pthread_detach(p);
return 0;
}
-],
- ac_cv_kthread=yes,
- ac_cv_kthread=no,
- ac_cv_kthread=no)
+]])],[ac_cv_kthread=yes],[ac_cv_kthread=no],[ac_cv_kthread=no])
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_kthread)
fi
@@ -1247,7 +1231,7 @@ AC_MSG_CHECKING(whether $CC accepts -pthread)
AC_CACHE_VAL(ac_cv_thread,
[ac_save_cc="$CC"
CC="$CC -pthread"
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <pthread.h>
void* routine(void* p){return NULL;}
@@ -1259,10 +1243,7 @@ int main(){
(void)pthread_detach(p);
return 0;
}
-],
- ac_cv_pthread=yes,
- ac_cv_pthread=no,
- ac_cv_pthread=no)
+]])],[ac_cv_pthread=yes],[ac_cv_pthread=no],[ac_cv_pthread=no])
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_pthread)
fi
@@ -1308,11 +1289,11 @@ CXX="$ac_save_cxx"
dnl # check for ANSI or K&R ("traditional") preprocessor
dnl AC_MSG_CHECKING(for C preprocessor type)
-dnl AC_TRY_COMPILE([
+dnl AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
dnl int foo;
dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
-dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional)
+dnl ]], [[;]])],[cpp_type=ansi],[AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional])
dnl AC_MSG_RESULT($cpp_type)
# checks for header files
@@ -1328,7 +1309,7 @@ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
-bluetooth/bluetooth.h linux/tipc.h)
+bluetooth/bluetooth.h linux/tipc.h spawn.h util.h)
AC_HEADER_DIRENT
AC_HEADER_MAJOR
@@ -1359,26 +1340,26 @@ AC_MSG_RESULT($was_it_defined)
# Check whether using makedev requires defining _OSF_SOURCE
AC_MSG_CHECKING(for makedev)
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#elif defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#else
#include <sys/types.h>
-#endif ],
- [ makedev(0, 0) ],
- ac_cv_has_makedev=yes,
- ac_cv_has_makedev=no)
+#endif
+]], [[
+ makedev(0, 0) ]])
+],[ac_cv_has_makedev=yes],[ac_cv_has_makedev=no])
if test "$ac_cv_has_makedev" = "no"; then
# we didn't link, try if _OSF_SOURCE will allow us to link
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#define _OSF_SOURCE 1
#include <sys/types.h>
- ],
- [ makedev(0, 0) ],
- ac_cv_has_makedev=yes,
- ac_cv_has_makedev=no)
+ ]],
+ [[ makedev(0, 0) ]])],
+ [ac_cv_has_makedev=yes],
+ [ac_cv_has_makedev=no])
if test "$ac_cv_has_makedev" = "yes"; then
AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
fi
@@ -1397,11 +1378,11 @@ fi
use_lfs=yes
AC_MSG_CHECKING(Solaris LFS bug)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _LARGEFILE_SOURCE 1
#define _FILE_OFFSET_BITS 64
#include <sys/resource.h>
-],struct rlimit foo;,sol_lfs_bug=no,sol_lfs_bug=yes)
+]], [[struct rlimit foo;]])],[sol_lfs_bug=no],[sol_lfs_bug=yes])
AC_MSG_RESULT($sol_lfs_bug)
if test "$sol_lfs_bug" = "yes"; then
use_lfs=no
@@ -1433,7 +1414,7 @@ EOF
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
-AC_TYPE_SIGNAL
+AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void])
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT32_T
@@ -1441,7 +1422,7 @@ AC_TYPE_UINT64_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_CHECK_TYPE(ssize_t,
- AC_DEFINE(HAVE_SSIZE_T, 1, Define if your compiler provides ssize_t),,)
+ AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,)
# Sizes of various common basic types
# ANSI C requires sizeof(char) == 1, so no need to check it
@@ -1457,10 +1438,10 @@ AC_CHECK_SIZEOF(pid_t, 4)
AC_MSG_CHECKING(for long long support)
have_long_long=no
-AC_TRY_COMPILE([], [long long x; x = (long long)0;], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[
AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
have_long_long=yes
-])
+],[])
AC_MSG_RESULT($have_long_long)
if test "$have_long_long" = yes ; then
AC_CHECK_SIZEOF(long long, 8)
@@ -1468,10 +1449,10 @@ fi
AC_MSG_CHECKING(for long double support)
have_long_double=no
-AC_TRY_COMPILE([], [long double x; x = (long double)0;], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]])],[
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
have_long_double=yes
-])
+],[])
AC_MSG_RESULT($have_long_double)
if test "$have_long_double" = yes ; then
AC_CHECK_SIZEOF(long double, 16)
@@ -1480,10 +1461,10 @@ fi
AC_MSG_CHECKING(for _Bool support)
have_c99_bool=no
-AC_TRY_COMPILE([], [_Bool x; x = (_Bool)0;], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Bool x; x = (_Bool)0;]])],[
AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.])
have_c99_bool=yes
-])
+],[])
AC_MSG_RESULT($have_c99_bool)
if test "$have_c99_bool" = yes ; then
AC_CHECK_SIZEOF(_Bool, 1)
@@ -1498,26 +1479,11 @@ AC_CHECK_TYPES(uintptr_t,
#include <inttypes.h>
#endif])
-
-# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
-AC_MSG_CHECKING(size of off_t)
-AC_CACHE_VAL(ac_cv_sizeof_off_t,
-[AC_TRY_RUN([#include <stdio.h>
+AC_CHECK_SIZEOF(off_t, [], [
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(off_t));
- exit(0);
-}],
-ac_cv_sizeof_off_t=`cat conftestval`,
-ac_cv_sizeof_off_t=0,
-ac_cv_sizeof_off_t=4)
+#endif
])
-AC_MSG_RESULT($ac_cv_sizeof_off_t)
-AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
-[The number of bytes in an off_t.])
AC_MSG_CHECKING(whether to enable large file support)
if test "$have_long_long" = yes
@@ -1537,26 +1503,14 @@ else
AC_MSG_RESULT(no)
fi
-# AC_CHECK_SIZEOF() doesn't include <time.h>.
-AC_MSG_CHECKING(size of time_t)
-AC_CACHE_VAL(ac_cv_sizeof_time_t,
-[AC_TRY_RUN([#include <stdio.h>
+AC_CHECK_SIZEOF(time_t, [], [
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_TIME_H
#include <time.h>
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(time_t));
- exit(0);
-}],
-ac_cv_sizeof_time_t=`cat conftestval`,
-ac_cv_sizeof_time_t=0,
-ac_cv_sizeof_time_t=4)
+#endif
])
-AC_MSG_RESULT($ac_cv_sizeof_time_t)
-AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
-[The number of bytes in a time_t.])
-
# if have pthread_t then define SIZEOF_PTHREAD_T
ac_save_cc="$CC"
@@ -1567,35 +1521,22 @@ then CC="$CC -Kthread"
elif test "$ac_cv_pthread" = "yes"
then CC="$CC -pthread"
fi
+
AC_MSG_CHECKING(for pthread_t)
have_pthread_t=no
-AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
+AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t x; x = *(pthread_t*)0;]])
+],[have_pthread_t=yes],[])
AC_MSG_RESULT($have_pthread_t)
if test "$have_pthread_t" = yes ; then
- # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
- AC_MSG_CHECKING(size of pthread_t)
- AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
- [AC_TRY_RUN([#include <stdio.h>
+ AC_CHECK_SIZEOF(pthread_t, [], [
+#ifdef HAVE_PTHREAD_H
#include <pthread.h>
- main()
- {
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(pthread_t));
- exit(0);
- }],
- ac_cv_sizeof_pthread_t=`cat conftestval`,
- ac_cv_sizeof_pthread_t=0,
- ac_cv_sizeof_pthread_t=4)
+#endif
])
- AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
- AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
- [The number of bytes in a pthread_t.])
fi
CC="$ac_save_cc"
-
-
AC_SUBST(OTHER_LIBTOOL_OPT)
case $ac_sys_system/$ac_sys_release in
Darwin/@<:@01567@:>@\..*)
@@ -1627,7 +1568,7 @@ case $ac_sys_system/$ac_sys_release in
else
LIBTOOL_CRUFT=""
fi
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
int main(int argc, char*argv[])
{
@@ -1637,9 +1578,7 @@ case $ac_sys_system/$ac_sys_release in
return 1;
}
}
- ], ac_osx_32bit=yes,
- ac_osx_32bit=no,
- ac_osx_32bit=yes)
+ ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes])
if test "${ac_osx_32bit}" = "yes"; then
case `/usr/bin/arch` in
@@ -1709,37 +1648,10 @@ esac
# Set info about shared libraries.
AC_SUBST(SO)
AC_SUBST(LDSHARED)
+AC_SUBST(LDCXXSHARED)
AC_SUBST(BLDSHARED)
AC_SUBST(CCSHARED)
AC_SUBST(LINKFORSHARED)
-# SO is the extension of shared libraries `(including the dot!)
-# -- usually .so, .sl on HP-UX, .dll on Cygwin
-AC_MSG_CHECKING(SO)
-if test -z "$SO"
-then
- case $ac_sys_system in
- hp*|HP*)
- case `uname -m` in
- ia64) SO=.so;;
- *) SO=.sl;;
- esac
- ;;
- CYGWIN*) SO=.dll;;
- *) SO=.so;;
- esac
-else
- # this might also be a termcap variable, see #610332
- echo
- echo '====================================================================='
- echo '+ +'
- echo '+ WARNING: You have set SO in your environment. +'
- echo '+ Do you really mean to change the extension for shared libraries? +'
- echo '+ Continuing in 10 seconds to let you to ponder. +'
- echo '+ +'
- echo '====================================================================='
- sleep 10
-fi
-AC_MSG_RESULT($SO)
AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
# LDSHARED is the ld *command* used to create shared library
@@ -1757,36 +1669,47 @@ then
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/5*)
- if test "$GCC" = "yes"
- then LDSHARED='$(CC) -shared $(LDFLAGS)'
- else LDSHARED='$(CC) -G $(LDFLAGS)';
+ if test "$GCC" = "yes" ; then
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared'
+ else
+ LDSHARED='$(CC) -G'
+ LDCXXSHARED='$(CXX) -G'
fi ;;
hp*|HP*)
- if test "$GCC" = "yes"
- then LDSHARED='$(CC) -shared'
- else LDSHARED='ld -b';
+ if test "$GCC" = "yes" ; then
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared'
+ else
+ LDSHARED='ld -b'
fi ;;
OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
Darwin/1.3*)
- LDSHARED='$(CC) $(LDFLAGS) -bundle'
+ LDSHARED='$(CC) -bundle'
+ LDCXXSHARED='$(CXX) -bundle'
if test "$enable_framework" ; then
# Link against the framework. All externals should be defined.
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+ LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework. Ignore undefined symbols, assuming they come from Python
LDSHARED="$LDSHARED -undefined suppress"
+ LDCXXSHARED="$LDCXXSHARED -undefined suppress"
fi ;;
Darwin/1.4*|Darwin/5.*|Darwin/6.*)
- LDSHARED='$(CC) $(LDFLAGS) -bundle'
+ LDSHARED='$(CC) -bundle'
+ LDCXXSHARED='$(CXX) -bundle'
if test "$enable_framework" ; then
# Link against the framework. All externals should be defined.
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+ LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework, use the Python app as bundle-loader
BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi ;;
Darwin/*)
# Use -undefined dynamic_lookup whenever possible (10.3 and later).
@@ -1797,57 +1720,77 @@ then
if test "${enable_universalsdk}"; then
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
fi
- LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
+ LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
+ LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
BLDSHARED="$LDSHARED"
else
- LDSHARED='$(CC) $(LDFLAGS) -bundle'
+ LDSHARED='$(CC) -bundle'
+ LDCXXSHARED='$(CXX) -bundle'
if test "$enable_framework" ; then
# Link against the framework. All externals should be defined.
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+ LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework, use the Python app as bundle-loader
BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi
fi
;;
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
- BSD/OS*/4*) LDSHARED="gcc -shared";;
+ Linux*|GNU*|QNX*)
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared';;
+ BSD/OS*/4*)
+ LDSHARED="gcc -shared"
+ LDCXXSHARED="g++ -shared";;
FreeBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
then
- LDSHARED='$(CC) -shared ${LDFLAGS}'
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared'
else
- LDSHARED="ld -Bshareable ${LDFLAGS}"
+ LDSHARED="ld -Bshareable"
fi;;
OpenBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
then
- LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
+ LDSHARED='$(CC) -shared $(CCSHARED)'
+ LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
else
case `uname -r` in
[[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
LDSHARED="ld -Bshareable ${LDFLAGS}"
;;
*)
- LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
+ LDSHARED='$(CC) -shared $(CCSHARED)'
+ LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
;;
esac
fi;;
- NetBSD*|DragonFly*) LDSHARED='$(CC) -shared ${LDFLAGS}';;
+ NetBSD*|DragonFly*)
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared';;
OpenUNIX*|UnixWare*)
- if test "$GCC" = "yes"
- then LDSHARED='$(CC) -shared'
- else LDSHARED='$(CC) -G'
+ if test "$GCC" = "yes" ; then
+ LDSHARED='$(CC) -shared'
+ LDCXXSHARED='$(CXX) -shared'
+ else
+ LDSHARED='$(CC) -G'
+ LDCXXSHARED='$(CXX) -G'
fi;;
- SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
- CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
- atheos*) LDSHARED="gcc -shared";;
+ SCO_SV*)
+ LDSHARED='$(CC) -Wl,-G,-Bexport'
+ LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
+ CYGWIN*)
+ LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
+ LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
*) LDSHARED="ld";;
esac
fi
AC_MSG_RESULT($LDSHARED)
+LDCXXSHARED=${LDCXXSHARED-$LDSHARED}
BLDSHARED=${BLDSHARED-$LDSHARED}
# CCSHARED are the C *flags* used to create objects to go into a shared
# library (module) -- this is only needed for a few systems
@@ -1882,7 +1825,6 @@ then
*gcc*) CCSHARED="-shared";;
*) CCSHARED="";;
esac;;
- atheos*) CCSHARED="-fPIC";;
esac
fi
AC_MSG_RESULT($CCSHARED)
@@ -1990,13 +1932,17 @@ AC_CHECK_LIB(intl, textdomain,
# checks for system dependent C++ extensions support
case "$ac_sys_system" in
AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support)
- AC_TRY_LINK([#include <load.h>],
- [loadAndInit("", 0, "")],
- [AC_DEFINE(AIX_GENUINE_CPLUSPLUS, 1,
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[#include <load.h>]],
+ [[loadAndInit("", 0, "")]])
+ ],[
+ AC_DEFINE(AIX_GENUINE_CPLUSPLUS, 1,
[Define for AIX if your compiler is a genuine IBM xlC/xlC_r
and you want support for AIX C++ shared extension modules.])
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)]);;
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_RESULT(no)
+ ]);;
*) ;;
esac
@@ -2006,26 +1952,53 @@ AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
AC_MSG_CHECKING(for --with-libs)
AC_ARG_WITH(libs,
- AC_HELP_STRING(--with-libs='lib1 ...', link against additional libs),
+ AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]),
[
AC_MSG_RESULT($withval)
LIBS="$withval $LIBS"
],
[AC_MSG_RESULT(no)])
+AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+
+# Check for use of the system expat library
+AC_MSG_CHECKING(for --with-system-expat)
+AC_ARG_WITH(system_expat,
+ AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]),
+ [],
+ [with_system_expat="no"])
+
+AC_MSG_RESULT($with_system_expat)
+
# Check for use of the system libffi library
AC_MSG_CHECKING(for --with-system-ffi)
AC_ARG_WITH(system_ffi,
- AC_HELP_STRING(--with-system-ffi, build _ctypes module using an installed ffi library),
+ AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library]),
[],
[with_system_ffi="no"])
+if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
+ LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
+else
+ LIBFFI_INCLUDEDIR=""
+fi
+AC_SUBST(LIBFFI_INCLUDEDIR)
+
AC_MSG_RESULT($with_system_ffi)
+# Check for support for loadable sqlite extensions
+AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions)
+AC_ARG_ENABLE(loadable-sqlite-extensions,
+ AS_HELP_STRING([--enable-loadable-sqlite-extensions], [support loadable extensions in _sqlite module]),
+ [],
+ [enable_loadable_sqlite_extensions="no"])
+
+AC_MSG_RESULT($enable_loadable_sqlite_extensions)
+
# Check for --with-dbmliborder
AC_MSG_CHECKING(for --with-dbmliborder)
AC_ARG_WITH(dbmliborder,
- AC_HELP_STRING([--with-dbmliborder=db1:db2:...], [order to check db backends for dbm. Valid value is a colon separated string with the backend names `ndbm', `gdbm' and `bdb'.]),
+ AS_HELP_STRING([--with-dbmliborder=db1:db2:...], [order to check db backends for dbm. Valid value is a colon separated string with the backend names `ndbm', `gdbm' and `bdb'.]),
[
if test x$with_dbmliborder = xyes
then
@@ -2045,7 +2018,7 @@ AC_SUBST(USE_SIGNAL_MODULE)
AC_SUBST(SIGNAL_OBJS)
AC_MSG_CHECKING(for --with-signal-module)
AC_ARG_WITH(signal-module,
- AC_HELP_STRING(--with-signal-module, disable/enable signal module))
+ AS_HELP_STRING([--with-signal-module], [disable/enable signal module]))
if test -z "$with_signal_module"
then with_signal_module="yes"
@@ -2067,7 +2040,7 @@ USE_THREAD_MODULE=""
AC_MSG_CHECKING(for --with-dec-threads)
AC_SUBST(LDLAST)
AC_ARG_WITH(dec-threads,
- AC_HELP_STRING(--with-dec-threads, use DEC Alpha/OSF1 thread-safe libraries),
+ AS_HELP_STRING([--with-dec-threads], [use DEC Alpha/OSF1 thread-safe libraries]),
[
AC_MSG_RESULT($withval)
LDLAST=-threads
@@ -2087,12 +2060,12 @@ AH_TEMPLATE(WITH_THREAD,
AC_MSG_CHECKING(for --with-threads)
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
AC_ARG_WITH(threads,
- AC_HELP_STRING(--with(out)-threads@<:@=DIRECTORY@:>@, disable/enable thread support))
+ AS_HELP_STRING([--with(out)-threads@<:@=DIRECTORY@:>@], [disable/enable thread support]))
# --with-thread is deprecated, but check for it anyway
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
AC_ARG_WITH(thread,
- AC_HELP_STRING(--with(out)-thread@<:@=DIRECTORY@:>@, deprecated; use --with(out)-threads),
+ AS_HELP_STRING([--with(out)-thread@<:@=DIRECTORY@:>@], [deprecated; use --with(out)-threads]),
[with_threads=$with_thread])
if test -z "$with_threads"
@@ -2171,27 +2144,16 @@ yes
AC_DEFINE(MACH_C_THREADS, 1,
[Define if you are using Mach cthreads under mach /])
THREADOBJ="Python/thread.o"],[
- AC_MSG_CHECKING(for --with-pth)
- AC_ARG_WITH([pth],
- AC_HELP_STRING(--with-pth, use GNU pth threading libraries),
- [AC_MSG_RESULT($withval)
- AC_DEFINE([WITH_THREAD])
- AC_DEFINE([HAVE_PTH], 1,
- [Define if you have GNU PTH threads.])
- LIBS="-lpth $LIBS"
- THREADOBJ="Python/thread.o"],
- [AC_MSG_RESULT(no)
-
# Just looking for pthread_create in libpthread is not enough:
# on HP/UX, pthread.h renames pthread_create to a different symbol name.
# So we really have to include pthread.h, and then link.
_libs=$LIBS
LIBS="$LIBS -lpthread"
AC_MSG_CHECKING([for pthread_create in -lpthread])
- AC_TRY_LINK([#include <pthread.h>
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>
-void * start_routine (void *arg) { exit (0); }], [
-pthread_create (NULL, NULL, start_routine, NULL)], [
+void * start_routine (void *arg) { exit (0); }]], [[
+pthread_create (NULL, NULL, start_routine, NULL)]])],[
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_THREAD)
posix_threads=yes
@@ -2200,10 +2162,6 @@ pthread_create (NULL, NULL, start_routine, NULL)], [
AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
posix_threads=yes
THREADOBJ="Python/thread.o"],[
- AC_CHECK_HEADER(atheos/threads.h, [AC_DEFINE(WITH_THREAD)
- AC_DEFINE(ATHEOS_THREADS, 1,
- [Define this if you have AtheOS threads.])
- THREADOBJ="Python/thread.o"],[
AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
posix_threads=yes
LIBS="$LIBS -lpthreads"
@@ -2221,7 +2179,7 @@ pthread_create (NULL, NULL, start_routine, NULL)], [
LIBS="$LIBS -lcma"
THREADOBJ="Python/thread.o"],[
USE_THREAD_MODULE="#"])
- ])])])])])])])])])
+ ])])])])])])])
AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
LIBS="$LIBS -lmpc"
@@ -2255,13 +2213,13 @@ if test "$posix_threads" = "yes"; then
# Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
case $ac_sys_system/$ac_sys_release in
SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1,
- Defined for Solaris 2.6 bug in pthread header.)
+ [Defined for Solaris 2.6 bug in pthread header.])
;;
SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
- Define if the Posix semaphores do not work on your system)
+ [Define if the Posix semaphores do not work on your system])
;;
AIX/5) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
- Define if the Posix semaphores do not work on your system)
+ [Define if the Posix semaphores do not work on your system])
;;
AIX/6) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
Define if the Posix semaphores do not work on your system)
@@ -2270,7 +2228,7 @@ if test "$posix_threads" = "yes"; then
AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
AC_CACHE_VAL(ac_cv_pthread_system_supported,
- [AC_TRY_RUN([#include <pthread.h>
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <pthread.h>
void *foo(void *parm) {
return NULL;
}
@@ -2281,10 +2239,10 @@ if test "$posix_threads" = "yes"; then
if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
exit(0);
- }],
- ac_cv_pthread_system_supported=yes,
- ac_cv_pthread_system_supported=no,
- ac_cv_pthread_system_supported=no)
+ }]])],
+ [ac_cv_pthread_system_supported=yes],
+ [ac_cv_pthread_system_supported=no],
+ [ac_cv_pthread_system_supported=no])
])
AC_MSG_RESULT($ac_cv_pthread_system_supported)
if test "$ac_cv_pthread_system_supported" = "yes"; then
@@ -2319,7 +2277,7 @@ AC_ARG_ENABLE(ipv6,
[
dnl the check does not work on cross compilation case...
- AC_TRY_RUN([ /* AF_INET6 available check */
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* AF_INET6 available check */
#include <sys/types.h>
#include <sys/socket.h>
main()
@@ -2329,25 +2287,31 @@ main()
else
exit(0);
}
-],
+]])],[
AC_MSG_RESULT(yes)
- ipv6=yes,
+ ipv6=yes
+],[
AC_MSG_RESULT(no)
- ipv6=no,
+ ipv6=no
+],[
AC_MSG_RESULT(no)
ipv6=no
-)
+])
if test "$ipv6" = "yes"; then
AC_MSG_CHECKING(if RFC2553 API is available)
- AC_TRY_COMPILE([#include <sys/types.h>
-#include <netinet/in.h>],
- [struct sockaddr_in6 x;
-x.sin6_scope_id;],
- AC_MSG_RESULT(yes)
- ipv6=yes,
- AC_MSG_RESULT(no, IPv6 disabled)
- ipv6=no)
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <netinet/in.h>]],
+ [[struct sockaddr_in6 x;
+ x.sin6_scope_id;]])
+ ],[
+ AC_MSG_RESULT(yes)
+ ipv6=yes
+ ],[
+ AC_MSG_RESULT(no, IPv6 disabled)
+ ipv6=no
+ ])
fi
if test "$ipv6" = "yes"; then
@@ -2468,16 +2432,19 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
fi
AC_MSG_CHECKING(for OSX 10.5 SDK or later)
-AC_TRY_COMPILE([#include <Carbon/Carbon.h>], FSIORefNum fRef = 0,
- AC_DEFINE(HAVE_OSX105_SDK, 1, Define if compiling using MacOS X 10.5 SDK or later.)
- AC_MSG_RESULT(yes),
+AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[#include <Carbon/Carbon.h>]], [[FSIORefNum fRef = 0]])
+],[
+ AC_DEFINE(HAVE_OSX105_SDK, 1, [Define if compiling using MacOS X 10.5 SDK or later.])
+ AC_MSG_RESULT(yes)
+],[
AC_MSG_RESULT(no)
-)
+])
# Check for --with-doc-strings
AC_MSG_CHECKING(for --with-doc-strings)
AC_ARG_WITH(doc-strings,
- AC_HELP_STRING(--with(out)-doc-strings, disable/enable documentation strings))
+ AS_HELP_STRING([--with(out)-doc-strings], [disable/enable documentation strings]))
if test -z "$with_doc_strings"
then with_doc_strings="yes"
@@ -2492,7 +2459,7 @@ AC_MSG_RESULT($with_doc_strings)
# Check if eval loop should use timestamp counter profiling
AC_MSG_CHECKING(for --with-tsc)
AC_ARG_WITH(tsc,
-[ --with(out)-tsc enable/disable timestamp counter profile], [
+ AS_HELP_STRING([--with(out)-tsc],[enable/disable timestamp counter profile]),[
if test "$withval" != no
then
AC_DEFINE(WITH_TSC, 1,
@@ -2505,10 +2472,12 @@ fi],
# Check for Python-specific malloc support
AC_MSG_CHECKING(for --with-pymalloc)
AC_ARG_WITH(pymalloc,
- AC_HELP_STRING(--with(out)-pymalloc, disable/enable specialized mallocs))
+ AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized mallocs]))
if test -z "$with_pymalloc"
-then with_pymalloc="yes"
+then
+ with_pymalloc="yes"
+ ABIFLAGS="${ABIFLAGS}m"
fi
if test "$with_pymalloc" != "no"
then
@@ -2517,20 +2486,19 @@ then
fi
AC_MSG_RESULT($with_pymalloc)
-# Check for --with-wctype-functions
-AC_MSG_CHECKING(for --with-wctype-functions)
-AC_ARG_WITH(wctype-functions,
- AC_HELP_STRING(--with-wctype-functions, use wctype.h functions),
-[
-if test "$withval" != no
-then
- AC_DEFINE(WANT_WCTYPE_FUNCTIONS, 1,
- [Define if you want wctype.h functions to be used instead of the
- one supplied by Python itself. (see Include/unicodectype.h).])
- AC_MSG_RESULT(yes)
-else AC_MSG_RESULT(no)
-fi],
-[AC_MSG_RESULT(no)])
+# Check for Valgrind support
+AC_MSG_CHECKING([for --with-valgrind])
+AC_ARG_WITH([valgrind],
+ AS_HELP_STRING([--with-valgrind], [Enable Valgrind support]),,
+ with_valgrind=no)
+AC_MSG_RESULT([$with_valgrind])
+if test "$with_valgrind" != no; then
+ AC_CHECK_HEADER([valgrind/valgrind.h],
+ [AC_DEFINE([WITH_VALGRIND], 1, [Define if you want pymalloc to be disabled when running under valgrind])],
+ [AC_MSG_ERROR([Valgrind support requested but headers not available])]
+ )
+ OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
+fi
# -I${DLINCLDIR} is added to the compile rule for importdl.o
AC_SUBST(DLINCLDIR)
@@ -2556,7 +2524,6 @@ then
hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
# Use dynload_next.c only on 10.2 and below, which don't have native dlopen()
Darwin/@<:@0156@:>@\..*) DYNLOADFILE="dynload_next.o";;
- atheos*) DYNLOADFILE="dynload_atheos.o";;
*)
# use dynload_shlib.c and dlopen() if we have it; otherwise stub
# out any dynamic loading
@@ -2587,17 +2554,17 @@ fi
AC_MSG_RESULT(MACHDEP_OBJS)
# checks for library functions
-AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
+AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
- getpriority getpwent getspnam getspent getsid getwd \
- kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \
+ getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
+ initgroups kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \
mremap nice pathconf pause plock poll pthread_init \
putenv readlink realpath \
select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \
setgid \
- setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \
- sigaction siginterrupt sigrelse strftime strlcpy \
+ setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setuid setvbuf \
+ sigaction siginterrupt sigrelse snprintf strftime strlcpy \
sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
truncate uname unsetenv utimes waitpid wait3 wait4 \
wcscoll wcsftime wcsxfrm _getpty)
@@ -2605,56 +2572,56 @@ AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
# For some functions, having a definition is not sufficient, since
# we want to take their address.
AC_MSG_CHECKING(for chroot)
-AC_TRY_COMPILE([#include <unistd.h>], void *x=chroot,
- AC_DEFINE(HAVE_CHROOT, 1, Define if you have the 'chroot' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=chroot]])],
+ [AC_DEFINE(HAVE_CHROOT, 1, Define if you have the 'chroot' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for link)
-AC_TRY_COMPILE([#include <unistd.h>], void *x=link,
- AC_DEFINE(HAVE_LINK, 1, Define if you have the 'link' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=link]])],
+ [AC_DEFINE(HAVE_LINK, 1, Define if you have the 'link' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for symlink)
-AC_TRY_COMPILE([#include <unistd.h>], void *x=symlink,
- AC_DEFINE(HAVE_SYMLINK, 1, Define if you have the 'symlink' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=symlink]])],
+ [AC_DEFINE(HAVE_SYMLINK, 1, Define if you have the 'symlink' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for fchdir)
-AC_TRY_COMPILE([#include <unistd.h>], void *x=fchdir,
- AC_DEFINE(HAVE_FCHDIR, 1, Define if you have the 'fchdir' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=fchdir]])],
+ [AC_DEFINE(HAVE_FCHDIR, 1, Define if you have the 'fchdir' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for fsync)
-AC_TRY_COMPILE([#include <unistd.h>], void *x=fsync,
- AC_DEFINE(HAVE_FSYNC, 1, Define if you have the 'fsync' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=fsync]])],
+ [AC_DEFINE(HAVE_FSYNC, 1, Define if you have the 'fsync' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for fdatasync)
-AC_TRY_COMPILE([#include <unistd.h>], void *x=fdatasync,
- AC_DEFINE(HAVE_FDATASYNC, 1, Define if you have the 'fdatasync' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=fdatasync]])],
+ [AC_DEFINE(HAVE_FDATASYNC, 1, Define if you have the 'fdatasync' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for epoll)
-AC_TRY_COMPILE([#include <sys/epoll.h>], void *x=epoll_create,
- AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/epoll.h>]], [[void *x=epoll_create]])],
+ [AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for kqueue)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/event.h>
- ], int x=kqueue(),
- AC_DEFINE(HAVE_KQUEUE, 1, Define if you have the 'kqueue' functions.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+ ]], [[int x=kqueue()]])],
+ [AC_DEFINE(HAVE_KQUEUE, 1, Define if you have the 'kqueue' functions.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
# On some systems (eg. FreeBSD 5), we would find a definition of the
# functions ctermid_r, setgroups in the library, but no prototype
# (e.g. because we use _XOPEN_SOURCE). See whether we can take their
@@ -2662,14 +2629,13 @@ AC_TRY_COMPILE([
# because of the missing prototypes.
AC_MSG_CHECKING(for ctermid_r)
-AC_TRY_COMPILE([
-#include "confdefs.h"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
-], void* p = ctermid_r,
- AC_DEFINE(HAVE_CTERMID_R, 1, Define if you have the 'ctermid_r' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+]], [[void* p = ctermid_r]])],
+ [AC_DEFINE(HAVE_CTERMID_R, 1, Define if you have the 'ctermid_r' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_CACHE_CHECK([for flock declaration], [ac_cv_flock_decl],
[AC_COMPILE_IFELSE(
@@ -2691,14 +2657,13 @@ if test "x${ac_cv_flock_decl}" = xyes; then
fi
AC_MSG_CHECKING(for getpagesize)
-AC_TRY_COMPILE([
-#include "confdefs.h"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <unistd.h>
-], void* p = getpagesize,
- AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+]], [[void* p = getpagesize]])],
+ [AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
dnl check for true
AC_CHECK_PROGS(TRUE, true, /bin/true)
@@ -2712,7 +2677,7 @@ AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
# On Tru64, chflags seems to be present, but calling it will
# exit Python
AC_CACHE_CHECK([for chflags], [ac_cv_have_chflags], [dnl
-AC_TRY_RUN([[
+AC_RUN_IFELSE([AC_LANG_SOURCE([[[
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char*argv[])
@@ -2721,19 +2686,20 @@ int main(int argc, char*argv[])
return 1;
return 0;
}
-]], ac_cv_have_chflags=yes,
- ac_cv_have_chflags=no,
- ac_cv_have_chflags=cross)
+]]])],
+[ac_cv_have_chflags=yes],
+[ac_cv_have_chflags=no],
+[ac_cv_have_chflags=cross])
])
if test "$ac_cv_have_chflags" = cross ; then
AC_CHECK_FUNC([chflags], [ac_cv_have_chflags="yes"], [ac_cv_have_chflags="no"])
fi
if test "$ac_cv_have_chflags" = yes ; then
- AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
+ AC_DEFINE(HAVE_CHFLAGS, 1, [Define to 1 if you have the `chflags' function.])
fi
AC_CACHE_CHECK([for lchflags], [ac_cv_have_lchflags], [dnl
-AC_TRY_RUN([[
+AC_RUN_IFELSE([AC_LANG_SOURCE([[[
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char*argv[])
@@ -2742,15 +2708,13 @@ int main(int argc, char*argv[])
return 1;
return 0;
}
-]], ac_cv_have_lchflags=yes,
- ac_cv_have_lchflags=no,
- ac_cv_have_lchflags=cross)
+]]])],[ac_cv_have_lchflags=yes],[ac_cv_have_lchflags=no],[ac_cv_have_lchflags=cross])
])
if test "$ac_cv_have_lchflags" = cross ; then
AC_CHECK_FUNC([lchflags], [ac_cv_have_lchflags="yes"], [ac_cv_have_lchflags="no"])
fi
if test "$ac_cv_have_lchflags" = yes ; then
- AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
+ AC_DEFINE(HAVE_LCHFLAGS, 1, [Define to 1 if you have the `lchflags' function.])
fi
dnl Check if system zlib has *Copy() functions
@@ -2773,7 +2737,7 @@ Darwin/*)
;;
esac
-AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, Define if the zlib library has inflateCopy))
+AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, [Define if the zlib library has inflateCopy]))
case $ac_sys_system/$ac_sys_release in
Darwin/*)
@@ -2783,55 +2747,50 @@ Darwin/*)
esac
AC_MSG_CHECKING(for hstrerror)
-AC_TRY_LINK([
-#include "confdefs.h"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <netdb.h>
-], void* p = hstrerror; hstrerror(0),
- AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+]], [[void* p = hstrerror; hstrerror(0)]])],
+ [AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for inet_aton)
-AC_TRY_LINK([
-#include "confdefs.h"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-], void* p = inet_aton;inet_aton(0,0),
- AC_DEFINE(HAVE_INET_ATON, 1, Define if you have the 'inet_aton' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+]], [[void* p = inet_aton;inet_aton(0,0)]])],
+ [AC_DEFINE(HAVE_INET_ATON, 1, Define if you have the 'inet_aton' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for inet_pton)
-AC_TRY_COMPILE([
-#include "confdefs.h"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-], void* p = inet_pton,
- AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+]], [[void* p = inet_pton]])],
+ [AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
# On some systems, setgroups is in unistd.h, on others, in grp.h
AC_MSG_CHECKING(for setgroups)
-AC_TRY_COMPILE([
-#include "confdefs.h"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <unistd.h>
#ifdef HAVE_GRP_H
#include <grp.h>
#endif
-],
-void* p = setgroups,
- AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
-)
+]], [[void* p = setgroups]])],
+ [AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
# check for openpty and forkpty
@@ -2856,30 +2815,27 @@ AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)
AC_REPLACE_FUNCS(dup2 getcwd strdup)
AC_CHECK_FUNCS(getpgrp,
- AC_TRY_COMPILE([#include <unistd.h>],
- [getpgrp(0);],
- AC_DEFINE(GETPGRP_HAVE_ARG, 1,
- [Define if getpgrp() must be called as getpgrp(0).])
- )
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[getpgrp(0);]])],
+ [AC_DEFINE(GETPGRP_HAVE_ARG, 1, [Define if getpgrp() must be called as getpgrp(0).])],
+ [])
)
AC_CHECK_FUNCS(setpgrp,
- AC_TRY_COMPILE([#include <unistd.h>],
- [setpgrp(0,0);],
- AC_DEFINE(SETPGRP_HAVE_ARG, 1,
- [Define if setpgrp() must be called as setpgrp(0, 0).])
- )
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[setpgrp(0,0);]])],
+ [AC_DEFINE(SETPGRP_HAVE_ARG, 1, [Define if setpgrp() must be called as setpgrp(0, 0).])],
+ [])
)
AC_CHECK_FUNCS(gettimeofday,
- AC_TRY_COMPILE([#include <sys/time.h>],
- [gettimeofday((struct timeval*)0,(struct timezone*)0);], ,
- AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1,
- [Define if gettimeofday() does not have second (timezone) argument
- This is the case on Motorola V4 (R40V4.2)])
- )
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]],
+ [[gettimeofday((struct timeval*)0,(struct timezone*)0);]])],
+ [],
+ [AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1,
+ [Define if gettimeofday() does not have second (timezone) argument
+ This is the case on Motorola V4 (R40V4.2)])
+ ])
)
AC_MSG_CHECKING(for major, minor, and makedev)
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#elif defined(MAJOR_IN_SYSMACROS)
@@ -2887,9 +2843,9 @@ AC_TRY_LINK([
#else
#include <sys/types.h>
#endif
-],[
+]], [[
makedev(major(0),minor(0));
-],[
+]])],[
AC_DEFINE(HAVE_DEVICE_MACROS, 1,
[Define to 1 if you have the device macros.])
AC_MSG_RESULT(yes)
@@ -2900,24 +2856,27 @@ AC_TRY_LINK([
# On OSF/1 V5.1, getaddrinfo is available, but a define
# for [no]getaddrinfo in netdb.h.
AC_MSG_CHECKING(for getaddrinfo)
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
-],[
-getaddrinfo(NULL, NULL, NULL, NULL);
-], [
-AC_MSG_RESULT(yes)
-AC_MSG_CHECKING(getaddrinfo bug)
-AC_TRY_RUN([
+]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])],
+[have_getaddrinfo=yes],
+[have_getaddrinfo=no])
+AC_MSG_RESULT($have_getaddrinfo)
+if test $have_getaddrinfo = yes
+then
+ AC_MSG_CHECKING(getaddrinfo bug)
+ AC_CACHE_VAL(ac_cv_buggy_getaddrinfo,
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[[
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
-main()
+int main()
{
int passive, gaierr, inet4 = 0, inet6 = 0;
struct addrinfo hints, *ai, *aitop;
@@ -2989,26 +2948,25 @@ main()
if (aitop)
freeaddrinfo(aitop);
- exit(0);
+ return 0;
bad:
if (aitop)
freeaddrinfo(aitop);
- exit(1);
+ return 1;
}
-],
-AC_MSG_RESULT(good)
-buggygetaddrinfo=no,
-AC_MSG_RESULT(buggy)
-buggygetaddrinfo=yes,
-AC_MSG_RESULT(buggy)
-buggygetaddrinfo=yes)], [
-AC_MSG_RESULT(no)
-buggygetaddrinfo=yes
-])
+]]])],
+[ac_cv_buggy_getaddrinfo=no],
+[ac_cv_buggy_getaddrinfo=yes],
+[ac_cv_buggy_getaddrinfo=yes]))
+fi
-if test "$buggygetaddrinfo" = "yes"; then
- if test "$ipv6" = "yes"; then
+AC_MSG_RESULT($ac_cv_buggy_getaddrinfo)
+
+if test $have_getaddrinfo = no -o "$ac_cv_buggy_getaddrinfo" = yes
+then
+ if test $ipv6 = yes
+ then
echo 'Fatal: You must get working getaddrinfo() function.'
echo ' or you can specify "--disable-ipv6"'.
exit 1
@@ -3016,6 +2974,7 @@ if test "$buggygetaddrinfo" = "yes"; then
else
AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.])
fi
+
AC_CHECK_FUNCS(getnameinfo)
# checks for structures
@@ -3030,10 +2989,11 @@ AC_CHECK_MEMBERS([struct stat.st_birthtime])
AC_STRUCT_ST_BLOCKS
AC_MSG_CHECKING(for time.h that defines altzone)
-AC_CACHE_VAL(ac_cv_header_time_altzone,
-[AC_TRY_COMPILE([#include <time.h>], [return altzone;],
- ac_cv_header_time_altzone=yes,
- ac_cv_header_time_altzone=no)])
+AC_CACHE_VAL(ac_cv_header_time_altzone,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[return altzone;]])],
+ [ac_cv_header_time_altzone=yes],
+ [ac_cv_header_time_altzone=no])
+ ])
AC_MSG_RESULT($ac_cv_header_time_altzone)
if test $ac_cv_header_time_altzone = yes; then
AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.])
@@ -3041,25 +3001,23 @@ fi
was_it_defined=no
AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/select.h>
#include <sys/time.h>
-], [;], [
+]], [[;]])],[
AC_DEFINE(SYS_SELECT_WITH_SYS_TIME, 1,
[Define if you can safely include both <sys/select.h> and <sys/time.h>
(which you can't on SCO ODT 3.0).])
was_it_defined=yes
-])
+],[])
AC_MSG_RESULT($was_it_defined)
AC_MSG_CHECKING(for addrinfo)
AC_CACHE_VAL(ac_cv_struct_addrinfo,
-AC_TRY_COMPILE([
-# include <netdb.h>],
- [struct addrinfo a],
- ac_cv_struct_addrinfo=yes,
- ac_cv_struct_addrinfo=no))
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[struct addrinfo a]])],
+ [ac_cv_struct_addrinfo=yes],
+ [ac_cv_struct_addrinfo=no]))
AC_MSG_RESULT($ac_cv_struct_addrinfo)
if test $ac_cv_struct_addrinfo = yes; then
AC_DEFINE(HAVE_ADDRINFO, 1, [struct addrinfo (netdb.h)])
@@ -3067,12 +3025,11 @@ fi
AC_MSG_CHECKING(for sockaddr_storage)
AC_CACHE_VAL(ac_cv_struct_sockaddr_storage,
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# include <sys/types.h>
-# include <sys/socket.h>],
- [struct sockaddr_storage s],
- ac_cv_struct_sockaddr_storage=yes,
- ac_cv_struct_sockaddr_storage=no))
+# include <sys/socket.h>]], [[struct sockaddr_storage s]])],
+ [ac_cv_struct_sockaddr_storage=yes],
+ [ac_cv_struct_sockaddr_storage=no]))
AC_MSG_RESULT($ac_cv_struct_sockaddr_storage)
if test $ac_cv_struct_sockaddr_storage = yes; then
AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket.h)])
@@ -3085,30 +3042,33 @@ AC_C_CONST
works=no
AC_MSG_CHECKING(for working volatile)
-AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes,
- AC_DEFINE(volatile, [], [Define to empty if the keyword does not work.])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[volatile int x; x = 0;]])],
+ [works=yes],
+ [AC_DEFINE(volatile, , [Define to empty if the keyword does not work.])]
)
AC_MSG_RESULT($works)
works=no
AC_MSG_CHECKING(for working signed char)
-AC_TRY_COMPILE([], [signed char c;], works=yes,
- AC_DEFINE(signed, [], [Define to empty if the keyword does not work.])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char c;]])],
+ [works=yes],
+ [AC_DEFINE(signed, , [Define to empty if the keyword does not work.])]
)
AC_MSG_RESULT($works)
have_prototypes=no
AC_MSG_CHECKING(for prototypes)
-AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],[
- AC_DEFINE(HAVE_PROTOTYPES, 1,
- [Define if your compiler supports function prototype])
- have_prototypes=yes
-])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(int x) { return 0; }]], [[return foo(10);]])],
+ [AC_DEFINE(HAVE_PROTOTYPES, 1,
+ [Define if your compiler supports function prototype])
+ have_prototypes=yes],
+ []
+)
AC_MSG_RESULT($have_prototypes)
works=no
AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdarg.h>
int foo(int x, ...) {
va_list va;
@@ -3118,44 +3078,44 @@ int foo(int x, ...) {
va_arg(va, double);
return 0;
}
-], [return foo(10, "", 3.14);], [
+]], [[return foo(10, "", 3.14);]])],[
AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1,
[Define if your compiler supports variable length function prototypes
(e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>])
works=yes
-])
+],[])
AC_MSG_RESULT($works)
# check for socketpair
AC_MSG_CHECKING(for socketpair)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
-], void *x=socketpair,
- AC_DEFINE(HAVE_SOCKETPAIR, 1, Define if you have the 'socketpair' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
+]], [[void *x=socketpair]])],
+ [AC_DEFINE(HAVE_SOCKETPAIR, 1, [Define if you have the 'socketpair' function.])
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)]
)
# check if sockaddr has sa_len member
AC_MSG_CHECKING(if sockaddr has sa_len member)
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>],
-[struct sockaddr x;
-x.sa_len = 0;],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member]),
- AC_MSG_RESULT(no))
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>]], [[struct sockaddr x;
+x.sa_len = 0;]])],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member])],
+ [AC_MSG_RESULT(no)]
+)
va_list_is_array=no
AC_MSG_CHECKING(whether va_list is an array)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_STDARG_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
-], [va_list list1, list2; list1 = list2;], , [
+]], [[va_list list1, list2; list1 = list2;]])],[],[
AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
va_list_is_array=yes
])
@@ -3170,9 +3130,9 @@ AC_CHECK_FUNC(gethostbyname_r, [
AC_MSG_CHECKING([gethostbyname_r with 6 args])
OLD_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# include <netdb.h>
- ], [
+ ]], [[
char *name;
struct hostent *he, *res;
char buffer[2048];
@@ -3180,48 +3140,50 @@ AC_CHECK_FUNC(gethostbyname_r, [
int h_errnop;
(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
- ], [
+ ]])],[
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
[Define this if you have the 6-arg version of gethostbyname_r().])
AC_MSG_RESULT(yes)
- ], [
+ ],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING([gethostbyname_r with 5 args])
- AC_TRY_COMPILE([
-# include <netdb.h>
- ], [
- char *name;
- struct hostent *he;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
-
- (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
- ], [
- AC_DEFINE(HAVE_GETHOSTBYNAME_R)
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
- [Define this if you have the 5-arg version of gethostbyname_r().])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([gethostbyname_r with 3 args])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# include <netdb.h>
- ], [
+ ]], [[
char *name;
struct hostent *he;
- struct hostent_data data;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
- (void) gethostbyname_r(name, he, &data);
- ], [
+ (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
+ ]])],
+ [
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
- [Define this if you have the 3-arg version of gethostbyname_r().])
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
+ [Define this if you have the 5-arg version of gethostbyname_r().])
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
- ])
+ AC_MSG_CHECKING([gethostbyname_r with 3 args])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+# include <netdb.h>
+ ]], [[
+ char *name;
+ struct hostent *he;
+ struct hostent_data data;
+
+ (void) gethostbyname_r(name, he, &data);
+ ]])],
+ [
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
+ [Define this if you have the 3-arg version of gethostbyname_r().])
+ AC_MSG_RESULT(yes)
+ ], [
+ AC_MSG_RESULT(no)
+ ])
])
])
CFLAGS=$OLD_CFLAGS
@@ -3246,7 +3208,7 @@ AC_CHECK_FUNC(__fpu_control,
# Check for --with-fpectl
AC_MSG_CHECKING(for --with-fpectl)
AC_ARG_WITH(fpectl,
- AC_HELP_STRING(--with-fpectl, enable SIGFPE catching),
+ AS_HELP_STRING([--with-fpectl], [enable SIGFPE catching]),
[
if test "$withval" != no
then
@@ -3265,7 +3227,7 @@ Darwin) ;;
esac
AC_MSG_CHECKING(for --with-libm=STRING)
AC_ARG_WITH(libm,
- AC_HELP_STRING(--with-libm=STRING, math library),
+ AS_HELP_STRING([--with-libm=STRING], [math library]),
[
if test "$withval" = no
then LIBM=
@@ -3281,7 +3243,7 @@ fi],
AC_SUBST(LIBC)
AC_MSG_CHECKING(for --with-libc=STRING)
AC_ARG_WITH(libc,
- AC_HELP_STRING(--with-libc=STRING, C library),
+ AS_HELP_STRING([--with-libc=STRING], [C library]),
[
if test "$withval" = no
then LIBC=
@@ -3299,7 +3261,7 @@ fi],
AC_MSG_CHECKING(whether C doubles are little-endian IEEE 754 binary64)
AC_CACHE_VAL(ac_cv_little_endian_double, [
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
int main() {
double x = 9006104071832581.0;
@@ -3308,10 +3270,10 @@ int main() {
else
return 1;
}
-],
-ac_cv_little_endian_double=yes,
-ac_cv_little_endian_double=no,
-ac_cv_little_endian_double=no)])
+]])],
+[ac_cv_little_endian_double=yes],
+[ac_cv_little_endian_double=no],
+[ac_cv_little_endian_double=no])])
AC_MSG_RESULT($ac_cv_little_endian_double)
if test "$ac_cv_little_endian_double" = yes
then
@@ -3322,7 +3284,7 @@ fi
AC_MSG_CHECKING(whether C doubles are big-endian IEEE 754 binary64)
AC_CACHE_VAL(ac_cv_big_endian_double, [
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
int main() {
double x = 9006104071832581.0;
@@ -3331,10 +3293,10 @@ int main() {
else
return 1;
}
-],
-ac_cv_big_endian_double=yes,
-ac_cv_big_endian_double=no,
-ac_cv_big_endian_double=no)])
+]])],
+[ac_cv_big_endian_double=yes],
+[ac_cv_big_endian_double=no],
+[ac_cv_big_endian_double=no])])
AC_MSG_RESULT($ac_cv_big_endian_double)
if test "$ac_cv_big_endian_double" = yes
then
@@ -3349,7 +3311,7 @@ fi
# conversions work.
AC_MSG_CHECKING(whether C doubles are ARM mixed-endian IEEE 754 binary64)
AC_CACHE_VAL(ac_cv_mixed_endian_double, [
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
int main() {
double x = 9006104071832581.0;
@@ -3358,10 +3320,10 @@ int main() {
else
return 1;
}
-],
-ac_cv_mixed_endian_double=yes,
-ac_cv_mixed_endian_double=no,
-ac_cv_mixed_endian_double=no)])
+]])],
+[ac_cv_mixed_endian_double=yes],
+[ac_cv_mixed_endian_double=no],
+[ac_cv_mixed_endian_double=no])])
AC_MSG_RESULT($ac_cv_mixed_endian_double)
if test "$ac_cv_mixed_endian_double" = yes
then
@@ -3374,25 +3336,23 @@ fi
# correctly-rounded string <-> double conversion functions from
# Python/dtoa.c, which in turn require that the FPU uses 53-bit
# rounding; this is a problem on x86, where the x87 FPU has a default
-# rounding precision of 64 bits. For gcc/x86, we try to fix this by
+# rounding precision of 64 bits. For gcc/x86, we can fix this by
# using inline assembler to get and set the x87 FPU control word.
-if test "$GCC" = yes && test -n "`$CC -dM -E - </dev/null | grep i386`"
+
+# This inline assembler syntax may also work for suncc and icc,
+# so we try it on all platforms.
+
+AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set x87 control word)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ unsigned short cw;
+ __asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
+ __asm__ __volatile__ ("fldcw %0" : : "m" (cw));
+]])],[have_gcc_asm_for_x87=yes],[have_gcc_asm_for_x87=no])
+AC_MSG_RESULT($have_gcc_asm_for_x87)
+if test "$have_gcc_asm_for_x87" = yes
then
- # Check that it's okay to use gcc inline assembler to get and set
- # x87 control word. It should be, but you never know...
- AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set x87 control word)
- AC_TRY_COMPILE([], [
- unsigned short cw;
- __asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
- __asm__ __volatile__ ("fldcw %0" : : "m" (cw));
- ],
- [have_gcc_asm_for_x87=yes], [have_gcc_asm_for_x87=no])
- AC_MSG_RESULT($have_gcc_asm_for_x87)
- if test "$have_gcc_asm_for_x87" = yes
- then
- AC_DEFINE(HAVE_GCC_ASM_FOR_X87, 1,
- [Define if we can use gcc inline assembler to get and set x87 control word])
- fi
+ AC_DEFINE(HAVE_GCC_ASM_FOR_X87, 1,
+ [Define if we can use gcc inline assembler to get and set x87 control word])
fi
# Detect whether system arithmetic is subject to x87-style double
@@ -3404,7 +3364,7 @@ AC_MSG_CHECKING(for x87-style double rounding)
# $BASECFLAGS may affect the result
ac_save_cc="$CC"
CC="$CC $BASECFLAGS"
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h>
#include <math.h>
int main() {
@@ -3423,10 +3383,10 @@ int main() {
/* both tests show evidence of double rounding */
exit(1);
}
-],
-ac_cv_x87_double_rounding=no,
-ac_cv_x87_double_rounding=yes,
-ac_cv_x87_double_rounding=no)
+]])],
+[ac_cv_x87_double_rounding=no],
+[ac_cv_x87_double_rounding=yes],
+[ac_cv_x87_double_rounding=no])
CC="$ac_save_cc"
AC_MSG_RESULT($ac_cv_x87_double_rounding)
if test "$ac_cv_x87_double_rounding" = yes
@@ -3442,11 +3402,15 @@ fi
LIBS_SAVE=$LIBS
LIBS="$LIBS $LIBM"
+AC_CHECK_FUNCS([acosh asinh atanh copysign erf erfc expm1 finite gamma])
+AC_CHECK_FUNCS([hypot lgamma log1p round tgamma])
+AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
+
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
# -0. on some architectures.
AC_MSG_CHECKING(whether tanh preserves the sign of zero)
AC_CACHE_VAL(ac_cv_tanh_preserves_zero_sign, [
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
#include <stdlib.h>
int main() {
@@ -3457,10 +3421,10 @@ int main() {
atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
else exit(1);
}
-],
-ac_cv_tanh_preserves_zero_sign=yes,
-ac_cv_tanh_preserves_zero_sign=no,
-ac_cv_tanh_preserves_zero_sign=no)])
+]])],
+[ac_cv_tanh_preserves_zero_sign=yes],
+[ac_cv_tanh_preserves_zero_sign=no],
+[ac_cv_tanh_preserves_zero_sign=no])])
AC_MSG_RESULT($ac_cv_tanh_preserves_zero_sign)
if test "$ac_cv_tanh_preserves_zero_sign" = yes
then
@@ -3468,8 +3432,34 @@ then
[Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
fi
-AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p round])
-AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
+if test "$ac_cv_func_log1p" = yes
+then
+ # On some versions of AIX, log1p(-0.) returns 0. instead of
+ # -0. See issue #9920.
+ AC_MSG_CHECKING(whether log1p drops the sign of negative zero)
+ AC_CACHE_VAL(ac_cv_log1p_drops_zero_sign, [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <math.h>
+ #include <stdlib.h>
+ int main() {
+ /* Fail if the signs of log1p(-0.) and -0. can be
+ distinguished. */
+ if (atan2(log1p(-0.), -1.) == atan2(-0., -1.))
+ return 0;
+ else
+ return 1;
+ }
+ ]])],
+ [ac_cv_log1p_drops_zero_sign=no],
+ [ac_cv_log1p_drops_zero_sign=yes],
+ [ac_cv_log1p_drops_zero_sign=no])])
+ AC_MSG_RESULT($ac_cv_log1p_drops_zero_sign)
+fi
+if test "$ac_cv_log1p_drops_zero_sign" = yes
+then
+ AC_DEFINE(LOG1P_DROPS_ZERO_SIGN, 1,
+ [Define if log1p(-0.) is 0. rather than -0.])
+fi
LIBS=$LIBS_SAVE
@@ -3480,7 +3470,7 @@ LIBS=$LIBS_SAVE
# sem_open results in a 'Signal 12' error.
AC_MSG_CHECKING(whether POSIX semaphores are enabled)
AC_CACHE_VAL(ac_cv_posix_semaphores_enabled,
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
@@ -3497,9 +3487,10 @@ int main(void) {
sem_unlink("/autoconf");
return 0;
}
-], ac_cv_posix_semaphores_enabled=yes,
- ac_cv_posix_semaphores_enabled=no,
- ac_cv_posix_semaphores_enabled=yes)
+]])],
+[ac_cv_posix_semaphores_enabled=yes],
+[ac_cv_posix_semaphores_enabled=no],
+[ac_cv_posix_semaphores_enabled=yes])
)
AC_MSG_RESULT($ac_cv_posix_semaphores_enabled)
if test $ac_cv_posix_semaphores_enabled = no
@@ -3510,7 +3501,8 @@ fi
# Multiprocessing check for broken sem_getvalue
AC_MSG_CHECKING(for broken sem_getvalue)
-AC_TRY_RUN([
+AC_CACHE_VAL(ac_cv_broken_sem_getvalue,
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
@@ -3531,16 +3523,22 @@ int main(void){
sem_unlink("/autocftw");
return res==-1 ? 1 : 0;
}
-]
-,AC_MSG_RESULT(no),
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, define to 1 if your sem_getvalue is broken.)
+]])],
+[ac_cv_broken_sem_getvalue=no],
+[ac_cv_broken_sem_getvalue=yes],
+[ac_cv_broken_sem_getvalue=yes])
)
+AC_MSG_RESULT($ac_cv_broken_sem_getvalue)
+if test $ac_cv_broken_sem_getvalue = yes
+then
+ AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1,
+ [define to 1 if your sem_getvalue is broken.])
+fi
# determine what size digit to use for Python's longs
AC_MSG_CHECKING([digit size for Python's longs])
AC_ARG_ENABLE(big-digits,
-AC_HELP_STRING([--enable-big-digits@<:@=BITS@:>@],[use big digits for Python longs [[BITS=30]]]),
+AS_HELP_STRING([--enable-big-digits@<:@=BITS@:>@],[use big digits for Python longs [[BITS=30]]]),
[case $enable_big_digits in
yes)
enable_big_digits=30 ;;
@@ -3573,14 +3571,14 @@ fi
AC_MSG_CHECKING(for UCS-4 tcl)
have_ucs4_tcl=no
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <tcl.h>
#if TCL_UTF_MAX != 6
# error "NOT UCS4_TCL"
-#endif], [], [
+#endif]], [[]])],[
AC_DEFINE(HAVE_UCS4_TCL, 1, [Define this if you have tcl and TCL_UTF_MAX==6])
have_ucs4_tcl=yes
-])
+],[])
AC_MSG_RESULT($have_ucs4_tcl)
# check whether wchar_t is signed or not
@@ -3589,23 +3587,23 @@ then
# check whether wchar_t is signed or not
AC_MSG_CHECKING(whether wchar_t is signed)
AC_CACHE_VAL(ac_cv_wchar_t_signed, [
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <wchar.h>
int main()
{
/* Success: exit code 0 */
exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
}
- ],
- ac_cv_wchar_t_signed=yes,
- ac_cv_wchar_t_signed=no,
- ac_cv_wchar_t_signed=yes)])
+ ]])],
+ [ac_cv_wchar_t_signed=yes],
+ [ac_cv_wchar_t_signed=no],
+ [ac_cv_wchar_t_signed=yes])])
AC_MSG_RESULT($ac_cv_wchar_t_signed)
fi
AC_MSG_CHECKING(what type to use for str)
AC_ARG_WITH(wide-unicode,
- AC_HELP_STRING(--with-wide-unicode, Use 4-byte Unicode characters (default is 2 bytes)),
+ AS_HELP_STRING([--with-wide-unicode], [Use 4-byte Unicode characters (default is 2 bytes)]),
[
if test "$withval" != no
then unicode_size="4"
@@ -3614,7 +3612,7 @@ fi
],
[
case "$have_ucs4_tcl" in
- yes) unicode_size="4" ;;
+ yes) unicode_size="4";;
*) unicode_size="2" ;;
esac
])
@@ -3622,7 +3620,10 @@ esac
AH_TEMPLATE(Py_UNICODE_SIZE,
[Define as the size of the unicode type.])
case "$unicode_size" in
- 4) AC_DEFINE(Py_UNICODE_SIZE, 4) ;;
+ 4)
+ AC_DEFINE(Py_UNICODE_SIZE, 4)
+ ABIFLAGS="${ABIFLAGS}u"
+ ;;
*) AC_DEFINE(Py_UNICODE_SIZE, 2) ;;
esac
@@ -3655,19 +3656,75 @@ AC_MSG_RESULT($PY_UNICODE_TYPE)
# check for endianness
AC_C_BIGENDIAN
+# ABI version string for Python extension modules. This appears between the
+# periods in shared library file names, e.g. foo.<SOABI>.so. It is calculated
+# from the following attributes which affect the ABI of this Python build (in
+# this order):
+#
+# * The Python implementation (always 'cpython-' for us)
+# * The major and minor version numbers
+# * --with-pydebug (adds a 'd')
+# * --with-pymalloc (adds a 'm')
+# * --with-wide-unicode (adds a 'u')
+#
+# Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
+# would get a shared library ABI version tag of 'cpython-32dmu' and shared
+# libraries would be named 'foo.cpython-32dmu.so'.
+AC_SUBST(SOABI)
+AC_MSG_CHECKING(ABIFLAGS)
+AC_MSG_RESULT($ABIFLAGS)
+AC_MSG_CHECKING(SOABI)
+SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}
+AC_MSG_RESULT($SOABI)
+
+AC_MSG_CHECKING(LDVERSION)
+LDVERSION='$(VERSION)$(ABIFLAGS)'
+AC_MSG_RESULT($LDVERSION)
+
+# SO is the extension of shared libraries `(including the dot!)
+# -- usually .so, .sl on HP-UX, .dll on Cygwin
+AC_MSG_CHECKING(SO)
+if test -z "$SO"
+then
+ case $ac_sys_system in
+ hp*|HP*)
+ case `uname -m` in
+ ia64) SO=.so;;
+ *) SO=.sl;;
+ esac
+ ;;
+ CYGWIN*) SO=.dll;;
+ Linux*|GNU*)
+ SO=.${SOABI}.so;;
+ *) SO=.so;;
+ esac
+else
+ # this might also be a termcap variable, see #610332
+ echo
+ echo '====================================================================='
+ echo '+ +'
+ echo '+ WARNING: You have set SO in your environment. +'
+ echo '+ Do you really mean to change the extension for shared libraries? +'
+ echo '+ Continuing in 10 seconds to let you to ponder. +'
+ echo '+ +'
+ echo '====================================================================='
+ sleep 10
+fi
+AC_MSG_RESULT($SO)
+
# Check whether right shifting a negative integer extends the sign bit
# or fills with zeros (like the Cray J90, according to Tim Peters).
AC_MSG_CHECKING(whether right shift extends the sign bit)
AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main()
{
exit(((-1)>>3 == -1) ? 0 : 1);
}
-],
-ac_cv_rshift_extends_sign=yes,
-ac_cv_rshift_extends_sign=no,
-ac_cv_rshift_extends_sign=yes)])
+]])],
+[ac_cv_rshift_extends_sign=yes],
+[ac_cv_rshift_extends_sign=no],
+[ac_cv_rshift_extends_sign=yes])])
AC_MSG_RESULT($ac_cv_rshift_extends_sign)
if test "$ac_cv_rshift_extends_sign" = no
then
@@ -3679,12 +3736,12 @@ fi
# check for getc_unlocked and related locking functions
AC_MSG_CHECKING(for getc_unlocked() and friends)
AC_CACHE_VAL(ac_cv_have_getc_unlocked, [
-AC_TRY_LINK([#include <stdio.h>],[
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[
FILE *f = fopen("/dev/null", "r");
flockfile(f);
getc_unlocked(f);
funlockfile(f);
-], ac_cv_have_getc_unlocked=yes, ac_cv_have_getc_unlocked=no)])
+]])],[ac_cv_have_getc_unlocked=yes],[ac_cv_have_getc_unlocked=no])])
AC_MSG_RESULT($ac_cv_have_getc_unlocked)
if test "$ac_cv_have_getc_unlocked" = yes
then
@@ -3731,8 +3788,10 @@ AC_CHECK_LIB(readline, rl_callback_handler_install,
[Define if you have readline 2.1]), ,$READLINE_LIBS)
# check for readline 2.2
-AC_TRY_CPP([#include <readline/readline.h>],
-have_readline=yes, have_readline=no)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <readline/readline.h>]])],
+ [have_readline=yes],
+ [have_readline=no]
+)
if test $have_readline = yes
then
AC_EGREP_HEADER([extern int rl_completion_append_character;],
@@ -3761,8 +3820,10 @@ AC_CHECK_LIB(readline, rl_completion_matches,
[Define if you have readline 4.2]), ,$READLINE_LIBS)
# also in readline 4.2
-AC_TRY_CPP([#include <readline/readline.h>],
-have_readline=yes, have_readline=no)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <readline/readline.h>]])],
+ [have_readline=yes],
+ [have_readline=no]
+)
if test $have_readline = yes
then
AC_EGREP_HEADER([extern int rl_catch_signals;],
@@ -3776,7 +3837,7 @@ LIBS=$LIBS_no_readline
AC_MSG_CHECKING(for broken nice())
AC_CACHE_VAL(ac_cv_broken_nice, [
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main()
{
int val1 = nice(1);
@@ -3784,10 +3845,10 @@ int main()
exit(0);
exit(1);
}
-],
-ac_cv_broken_nice=yes,
-ac_cv_broken_nice=no,
-ac_cv_broken_nice=no)])
+]])],
+[ac_cv_broken_nice=yes],
+[ac_cv_broken_nice=no],
+[ac_cv_broken_nice=no])])
AC_MSG_RESULT($ac_cv_broken_nice)
if test "$ac_cv_broken_nice" = yes
then
@@ -3796,34 +3857,29 @@ then
fi
AC_MSG_CHECKING(for broken poll())
-AC_TRY_RUN([
+AC_CACHE_VAL(ac_cv_broken_poll,
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <poll.h>
-int main (void)
- {
+int main()
+{
struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
-
- close (42);
+ int poll_test;
- int poll_test = poll (&poll_struct, 1, 0);
+ close (42);
+ poll_test = poll(&poll_struct, 1, 0);
if (poll_test < 0)
- {
- exit(0);
- }
+ return 0;
else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
- {
- exit(0);
- }
+ return 0;
else
- {
- exit(1);
- }
- }
-],
-ac_cv_broken_poll=yes,
-ac_cv_broken_poll=no,
-ac_cv_broken_poll=no)
+ return 1;
+}
+]])],
+[ac_cv_broken_poll=yes],
+[ac_cv_broken_poll=no],
+[ac_cv_broken_poll=no]))
AC_MSG_RESULT($ac_cv_broken_poll)
if test "$ac_cv_broken_poll" = yes
then
@@ -3839,7 +3895,7 @@ AC_STRUCT_TIMEZONE
# check tzset(3) exists and works like we expect it to
AC_MSG_CHECKING(for working tzset())
AC_CACHE_VAL(ac_cv_working_tzset, [
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h>
#include <time.h>
#include <string.h>
@@ -3902,10 +3958,10 @@ int main()
exit(0);
}
-],
-ac_cv_working_tzset=yes,
-ac_cv_working_tzset=no,
-ac_cv_working_tzset=no)])
+]])],
+[ac_cv_working_tzset=yes],
+[ac_cv_working_tzset=no],
+[ac_cv_working_tzset=no])])
AC_MSG_RESULT($ac_cv_working_tzset)
if test "$ac_cv_working_tzset" = yes
then
@@ -3916,13 +3972,12 @@ fi
# Look for subsecond timestamps in struct stat
AC_MSG_CHECKING(for tv_nsec in struct stat)
AC_CACHE_VAL(ac_cv_stat_tv_nsec,
-AC_TRY_COMPILE([#include <sys/stat.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[
struct stat st;
st.st_mtim.tv_nsec = 1;
-],
-ac_cv_stat_tv_nsec=yes,
-ac_cv_stat_tv_nsec=no,
-ac_cv_stat_tv_nsec=no))
+]])],
+[ac_cv_stat_tv_nsec=yes],
+[ac_cv_stat_tv_nsec=no]))
AC_MSG_RESULT($ac_cv_stat_tv_nsec)
if test "$ac_cv_stat_tv_nsec" = yes
then
@@ -3933,13 +3988,12 @@ fi
# Look for BSD style subsecond timestamps in struct stat
AC_MSG_CHECKING(for tv_nsec2 in struct stat)
AC_CACHE_VAL(ac_cv_stat_tv_nsec2,
-AC_TRY_COMPILE([#include <sys/stat.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[
struct stat st;
st.st_mtimespec.tv_nsec = 1;
-],
-ac_cv_stat_tv_nsec2=yes,
-ac_cv_stat_tv_nsec2=no,
-ac_cv_stat_tv_nsec2=no))
+]])],
+[ac_cv_stat_tv_nsec2=yes],
+[ac_cv_stat_tv_nsec2=no]))
AC_MSG_RESULT($ac_cv_stat_tv_nsec2)
if test "$ac_cv_stat_tv_nsec2" = yes
then
@@ -3950,12 +4004,12 @@ fi
# On HP/UX 11.0, mvwdelch is a block with a return statement
AC_MSG_CHECKING(whether mvwdelch is an expression)
AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,
-AC_TRY_COMPILE([#include <curses.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[
int rtn;
rtn = mvwdelch(0,0,0);
-], ac_cv_mvwdelch_is_expression=yes,
- ac_cv_mvwdelch_is_expression=no,
- ac_cv_mvwdelch_is_expression=yes))
+]])],
+[ac_cv_mvwdelch_is_expression=yes],
+[ac_cv_mvwdelch_is_expression=no]))
AC_MSG_RESULT($ac_cv_mvwdelch_is_expression)
if test "$ac_cv_mvwdelch_is_expression" = yes
@@ -3966,12 +4020,12 @@ fi
AC_MSG_CHECKING(whether WINDOW has _flags)
AC_CACHE_VAL(ac_cv_window_has_flags,
-AC_TRY_COMPILE([#include <curses.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[
WINDOW *w;
w->_flags = 0;
-], ac_cv_window_has_flags=yes,
- ac_cv_window_has_flags=no,
- ac_cv_window_has_flags=no))
+]])],
+[ac_cv_window_has_flags=yes],
+[ac_cv_window_has_flags=no]))
AC_MSG_RESULT($ac_cv_window_has_flags)
@@ -3982,24 +4036,24 @@ then
fi
AC_MSG_CHECKING(for is_term_resized)
-AC_TRY_COMPILE([#include <curses.h>], void *x=is_term_resized,
- AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_resized' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=is_term_resized]])],
+ [AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_resized' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)]
)
AC_MSG_CHECKING(for resize_term)
-AC_TRY_COMPILE([#include <curses.h>], void *x=resize_term,
- AC_DEFINE(HAVE_CURSES_RESIZE_TERM, 1, Define if you have the 'resize_term' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=resize_term]])],
+ [AC_DEFINE(HAVE_CURSES_RESIZE_TERM, 1, Define if you have the 'resize_term' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)]
)
AC_MSG_CHECKING(for resizeterm)
-AC_TRY_COMPILE([#include <curses.h>], void *x=resizeterm,
- AC_DEFINE(HAVE_CURSES_RESIZETERM, 1, Define if you have the 'resizeterm' function.)
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=resizeterm]])],
+ [AC_DEFINE(HAVE_CURSES_RESIZETERM, 1, Define if you have the 'resizeterm' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)]
)
AC_MSG_CHECKING(for /dev/ptmx)
@@ -4024,8 +4078,62 @@ else
AC_MSG_RESULT(no)
fi
-AC_MSG_CHECKING(for %zd printf() format support)
-AC_TRY_RUN([#include <stdio.h>
+if test "$have_long_long" = yes
+then
+ AC_MSG_CHECKING(for %lld and %llu printf() format support)
+ AC_CACHE_VAL(ac_cv_have_long_long_format,
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[[
+ #include <stdio.h>
+ #include <stddef.h>
+ #include <string.h>
+
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+
+ int main()
+ {
+ char buffer[256];
+
+ if (sprintf(buffer, "%lld", (long long)123) < 0)
+ return 1;
+ if (strcmp(buffer, "123"))
+ return 1;
+
+ if (sprintf(buffer, "%lld", (long long)-123) < 0)
+ return 1;
+ if (strcmp(buffer, "-123"))
+ return 1;
+
+ if (sprintf(buffer, "%llu", (unsigned long long)123) < 0)
+ return 1;
+ if (strcmp(buffer, "123"))
+ return 1;
+
+ return 0;
+ }
+ ]]])],
+ [ac_cv_have_long_long_format=yes],
+ [ac_cv_have_long_long_format=no],
+ [ac_cv_have_long_long_format=no])
+ )
+ AC_MSG_RESULT($ac_cv_have_long_long_format)
+fi
+
+if test "$ac_cv_have_long_long_format" = yes
+then
+ AC_DEFINE(PY_FORMAT_LONG_LONG, "ll",
+ [Define to printf format modifier for long long type])
+fi
+
+if test $ac_sys_system = Darwin
+then
+ LIBS="$LIBS -framework CoreFoundation"
+fi
+
+AC_CACHE_CHECK([for %zd printf() format support], ac_cv_have_size_t_format, [dnl
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdio.h>
#include <stddef.h>
#include <string.h>
@@ -4058,14 +4166,20 @@ int main()
return 1;
return 0;
-}],
-[AC_MSG_RESULT(yes)
- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
- AC_MSG_RESULT(no))
+}
+]])],
+ [ac_cv_have_size_t_format=yes],
+ [ac_cv_have_size_t_format=no],
+ [ac_cv_have_size_t_format="cross -- assuming yes"
+])])
+if test "$ac_cv_have_size_t_format" != no ; then
+ AC_DEFINE(PY_FORMAT_SIZE_T, "z",
+ [Define to printf format modifier for Py_ssize_t])
+fi
AC_CHECK_TYPE(socklen_t,,
AC_DEFINE(socklen_t,int,
- Define to `int' if <sys/socket.h> does not define.),[
+ [Define to `int' if <sys/socket.h> does not define.]),[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -4075,7 +4189,8 @@ AC_CHECK_TYPE(socklen_t,,
])
AC_MSG_CHECKING(for broken mbstowcs)
-AC_TRY_RUN([
+AC_CACHE_VAL(ac_cv_broken_mbstowcs,
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include<stdlib.h>
int main() {
size_t len = -1;
@@ -4083,10 +4198,10 @@ int main() {
len = mbstowcs(NULL, str, 0);
return (len != 4);
}
-],
-ac_cv_broken_mbstowcs=no,
-ac_cv_broken_mbstowcs=yes,
-ac_cv_broken_mbstowcs=no)
+]])],
+[ac_cv_broken_mbstowcs=no],
+[ac_cv_broken_mbstowcs=yes],
+[ac_cv_broken_mbstowcs=no]))
AC_MSG_RESULT($ac_cv_broken_mbstowcs)
if test "$ac_cv_broken_mbstowcs" = yes
then
@@ -4095,27 +4210,62 @@ then
wide chars that would be converted.])
fi
+AC_MSG_CHECKING(whether $CC supports computed gotos)
+AC_CACHE_VAL(ac_cv_computed_gotos,
+AC_RUN_IFELSE([AC_LANG_SOURCE([[[
+int main(int argc, char **argv)
+{
+ static void *targets[1] = { &&LABEL1 };
+ goto LABEL2;
+LABEL1:
+ return 0;
+LABEL2:
+ goto *targets[0];
+ return 1;
+}
+]]])],
+[ac_cv_computed_gotos=yes],
+[ac_cv_computed_gotos=no],
+[ac_cv_computed_gotos=no]))
+AC_MSG_RESULT($ac_cv_computed_gotos)
+if test "$ac_cv_computed_gotos" = yes
+then
+ AC_DEFINE(HAVE_COMPUTED_GOTOS, 1,
+ [Define if the C compiler supports computed gotos.])
+fi
+
# Check for --with-computed-gotos
AC_MSG_CHECKING(for --with-computed-gotos)
AC_ARG_WITH(computed-gotos,
- AC_HELP_STRING(--with-computed-gotos,
- Use computed gotos / threaded dispatch in evaluation loop (not available on all compilers)),
+ AS_HELP_STRING([--with(out)-computed-gotos],
+ [Use computed gotos in evaluation loop (enabled by default on supported compilers)]),
[
-if test "$withval" != no
+if test "$withval" = yes
then
AC_DEFINE(USE_COMPUTED_GOTOS, 1,
[Define if you want to use computed gotos in ceval.c.])
AC_MSG_RESULT(yes)
-else AC_MSG_RESULT(no)
-fi],
-[AC_MSG_RESULT(no)])
-
-if test $ac_sys_system = Darwin
-then
- LIBS="$LIBS -framework CoreFoundation"
fi
+if test "$withval" = no
+then
+ AC_DEFINE(USE_COMPUTED_GOTOS, 0,
+ [Define if you want to use computed gotos in ceval.c.])
+ AC_MSG_RESULT(no)
+fi
+],
+[AC_MSG_RESULT(no value specified)])
+
+case $ac_sys_system in
+AIX*)
+ AC_DEFINE(HAVE_BROKEN_PIPE_BUF, 1, [Define if the system reports an invalid PIPE_BUF value.]) ;;
+esac
+
+case $ac_sys_system in
+ OSF*) AC_MSG_ERROR(OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606) ;;
+esac
+AC_CHECK_FUNC(pipe2, AC_DEFINE(HAVE_PIPE2, 1, [Define if the OS supports pipe2()]), )
AC_SUBST(THREADHEADERS)
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 45678235ef..f86621b3f8 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -12,9 +12,6 @@
support for AIX C++ shared extension modules. */
#undef AIX_GENUINE_CPLUSPLUS
-/* Define this if you have AtheOS threads. */
-#undef ATHEOS_THREADS
-
/* Define if you have the Mach cthreads package */
#undef C_THREADS
@@ -43,6 +40,9 @@
the case on Motorola V4 (R40V4.2) */
#undef GETTIMEOFDAY_NO_TZ
+/* Define to 1 if you have the `accept4' function. */
+#undef HAVE_ACCEPT4
+
/* Define to 1 if you have the `acosh' function. */
#undef HAVE_ACOSH
@@ -83,6 +83,9 @@
/* Define if nice() returns success/failure instead of the new priority. */
#undef HAVE_BROKEN_NICE
+/* Define if the system reports an invalid PIPE_BUF value. */
+#undef HAVE_BROKEN_PIPE_BUF
+
/* Define if poll() sets errno on invalid file descriptors. */
#undef HAVE_BROKEN_POLL
@@ -110,6 +113,9 @@
/* Define to 1 if you have the `clock' function. */
#undef HAVE_CLOCK
+/* Define if the C compiler supports computed gotos. */
+#undef HAVE_COMPUTED_GOTOS
+
/* Define to 1 if you have the `confstr' function. */
#undef HAVE_CONFSTR
@@ -184,6 +190,12 @@
/* Define if you have the 'epoll' functions. */
#undef HAVE_EPOLL
+/* Define to 1 if you have the `erf' function. */
+#undef HAVE_ERF
+
+/* Define to 1 if you have the `erfc' function. */
+#undef HAVE_ERFC
+
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
@@ -250,6 +262,9 @@
/* Define to 1 if you have the `gai_strerror' function. */
#undef HAVE_GAI_STRERROR
+/* Define to 1 if you have the `gamma' function. */
+#undef HAVE_GAMMA
+
/* Define if we can use gcc inline assembler to get and set x87 control word
*/
#undef HAVE_GCC_ASM_FOR_X87
@@ -314,6 +329,12 @@
/* Define to 1 if you have the `getpwent' function. */
#undef HAVE_GETPWENT
+/* Define to 1 if you have the `getresgid' function. */
+#undef HAVE_GETRESGID
+
+/* Define to 1 if you have the `getresuid' function. */
+#undef HAVE_GETRESUID
+
/* Define to 1 if you have the `getsid' function. */
#undef HAVE_GETSID
@@ -347,6 +368,9 @@
/* Define if you have the 'inet_pton' function. */
#undef HAVE_INET_PTON
+/* Define to 1 if you have the `initgroups' function. */
+#undef HAVE_INITGROUPS
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -380,6 +404,9 @@
/* Define to 1 if you have the `lchown' function. */
#undef HAVE_LCHOWN
+/* Define to 1 if you have the `lgamma' function. */
+#undef HAVE_LGAMMA
+
/* Define to 1 if you have the `dl' library (-ldl). */
#undef HAVE_LIBDL
@@ -470,6 +497,9 @@
/* Define to 1 if you have the `pause' function. */
#undef HAVE_PAUSE
+/* Define if the OS supports pipe2() */
+#undef HAVE_PIPE2
+
/* Define to 1 if you have the `plock' function. */
#undef HAVE_PLOCK
@@ -485,9 +515,6 @@
/* Define if your compiler supports function prototype */
#undef HAVE_PROTOTYPES
-/* Define if you have GNU PTH threads. */
-#undef HAVE_PTH
-
/* Defined for Solaris 2.6 bug in pthread header. */
#undef HAVE_PTHREAD_DESTRUCTOR
@@ -578,6 +605,12 @@
/* Define to 1 if you have the `setregid' function. */
#undef HAVE_SETREGID
+/* Define to 1 if you have the `setresgid' function. */
+#undef HAVE_SETRESGID
+
+/* Define to 1 if you have the `setresuid' function. */
+#undef HAVE_SETRESUID
+
/* Define to 1 if you have the `setreuid' function. */
#undef HAVE_SETREUID
@@ -617,6 +650,9 @@
/* Define if you have the 'socketpair' function. */
#undef HAVE_SOCKETPAIR
+/* Define to 1 if you have the <spawn.h> header file. */
+#undef HAVE_SPAWN_H
+
/* Define if your compiler provides ssize_t */
#undef HAVE_SSIZE_T
@@ -783,6 +819,9 @@
/* Define to 1 if you have the <term.h> header file. */
#undef HAVE_TERM_H
+/* Define to 1 if you have the `tgamma' function. */
+#undef HAVE_TGAMMA
+
/* Define to 1 if you have the <thread.h> header file. */
#undef HAVE_THREAD_H
@@ -832,6 +871,9 @@
Include/unicodeobject.h). */
#undef HAVE_USABLE_WCHAR_T
+/* Define to 1 if you have the <util.h> header file. */
+#undef HAVE_UTIL_H
+
/* Define to 1 if you have the `utimes' function. */
#undef HAVE_UTIMES
@@ -872,6 +914,9 @@
/* Define if you are using Mach cthreads directly under /include */
#undef HURD_C_THREADS
+/* Define if log1p(-0.) is 0. rather than -0. */
+#undef LOG1P_DROPS_ZERO_SIGN
+
/* Define if you are using Mach cthreads under mach / */
#undef MACH_C_THREADS
@@ -913,6 +958,9 @@
/* Define as the preferred size in bits of long digits */
#undef PYLONG_BITS_IN_DIGIT
+/* Define to printf format modifier for long long type */
+#undef PY_FORMAT_LONG_LONG
+
/* Define to printf format modifier for Py_ssize_t */
#undef PY_FORMAT_SIZE_T
@@ -928,7 +976,7 @@
/* Define as the size of the unicode type. */
#undef Py_UNICODE_SIZE
-/* Define as the return type of signal handlers (`int' or `void'). */
+/* assume C89 semantics that RETSIGTYPE is always void */
#undef RETSIGTYPE
/* Define if setpgrp() must be called as setpgrp(0, 0). */
@@ -961,13 +1009,13 @@
/* The size of `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
-/* The number of bytes in an off_t. */
+/* The size of `off_t', as computed by sizeof. */
#undef SIZEOF_OFF_T
/* The size of `pid_t', as computed by sizeof. */
#undef SIZEOF_PID_T
-/* The number of bytes in a pthread_t. */
+/* The size of `pthread_t', as computed by sizeof. */
#undef SIZEOF_PTHREAD_T
/* The size of `short', as computed by sizeof. */
@@ -976,7 +1024,7 @@
/* The size of `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
-/* The number of bytes in a time_t. */
+/* The size of `time_t', as computed by sizeof. */
#undef SIZEOF_TIME_T
/* The size of `uintptr_t', as computed by sizeof. */
@@ -1010,6 +1058,9 @@
/* Define if you want to use computed gotos in ceval.c. */
#undef USE_COMPUTED_GOTOS
+/* Define to use the C99 inline keyword. */
+#undef USE_INLINE
+
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
@@ -1038,10 +1089,6 @@
/* Define if you want SIGFPE handled (see Include/pyfpe.h). */
#undef WANT_SIGFPE_HANDLER
-/* Define if you want wctype.h functions to be used instead of the one
- supplied by Python itself. (see Include/unicodectype.h). */
-#undef WANT_WCTYPE_FUNCTIONS
-
/* Define if WINDOW in curses.h offers a field _flags. */
#undef WINDOW_HAS_FLAGS
@@ -1069,6 +1116,9 @@
/* Define to profile with the Pentium timestamp counter */
#undef WITH_TSC
+/* Define if you want pymalloc to be disabled when running under valgrind */
+#undef WITH_VALGRIND
+
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
@@ -1151,9 +1201,6 @@
# undef __CHAR_UNSIGNED__
#endif
-/* Defined on Solaris to see additional function prototypes. */
-#undef __EXTENSIONS__
-
/* Define to 'long' if <time.h> doesn't define. */
#undef clock_t
@@ -1163,6 +1210,12 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef int32_t
diff --git a/runtests.sh b/runtests.sh
deleted file mode 100755
index d7b4646761..0000000000
--- a/runtests.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/bash
-
-HELP="Usage: ./runtests.py [-h] [-x] [flags] [tests]
-
-Runs each unit test independently, with output directed to a file in
-OUT/<test>.out. If no tests are given, all tests are run; otherwise,
-only the specified tests are run, unless -x is also given, in which
-case all tests *except* those given are run.
-
-Standard output shows the name of the tests run, with 'BAD' or
-'SKIPPED' added if the test didn't produce a positive result. Also,
-three files are created, named 'BAD', 'GOOD' and 'SKIPPED', to which
-are written the names of the tests categorized by result.
-
-Flags (arguments starting with '-') are passed transparently to
-regrtest.py, except for -x, which is processed here."
-
-# Choose the Python binary.
-case `uname` in
-Darwin) PYTHON=./python.exe;;
-CYGWIN*) PYTHON=./python.exe;;
-*) PYTHON=./python;;
-esac
-
-PYTHON="$PYTHON -bb"
-
-# Unset PYTHONPATH, just to be sure.
-unset PYTHONPATH
-
-# Create the output directory if necessary.
-mkdir -p OUT
-
-# Empty the summary files.
->GOOD
->BAD
->SKIPPED
-
-# Process flags (transparently pass these on to regrtest.py)
-FLAGS=""
-EXCEPT=""
-while :
-do
- case $1 in
- -h|--h|-help|--help) echo "$HELP"; exit;;
- --) FLAGS="$FLAGS $1"; shift; break;;
- -x) EXCEPT="$1"; shift;;
- -*) FLAGS="$FLAGS $1"; shift;;
- *) break;;
- esac
-done
-
-# Compute the list of tests to run.
-case "$#$EXCEPT" in
-0)
- TESTS=`(cd Lib/test; ls test_*.py | sed 's/\.py//')`
- ;;
-*-x)
- PAT="^(`echo $@ | sed 's/\.py//g' | sed 's/ /|/g'`)$"
- TESTS=`(cd Lib/test; ls test_*.py | sed 's/\.py//' | egrep -v "$PAT")`
- ;;
-*)
- TESTS="$@"
- ;;
-esac
-
-# Run the tests.
-for T in $TESTS
-do
- echo -n $T
- if case $T in
- *curses*)
- echo
- $PYTHON -E Lib/test/regrtest.py $FLAGS $T 2>OUT/$T.out
- ;;
- *) $PYTHON -E Lib/test/regrtest.py $FLAGS $T >OUT/$T.out 2>&1;;
- esac
- then
- if grep -q "1 test skipped:" OUT/$T.out
- then
- echo " SKIPPED"
- echo $T >>SKIPPED
- else
- echo
- echo $T >>GOOD
- fi
- else
- echo " BAD"
- echo $T >>BAD
- fi
-done
-
-# Summarize results
-wc -l BAD GOOD SKIPPED
diff --git a/setup.py b/setup.py
index 1e15b7ae9c..1318bc272c 100644
--- a/setup.py
+++ b/setup.py
@@ -5,26 +5,42 @@ __version__ = "$Revision$"
import sys, os, imp, re, optparse
from glob import glob
+import sysconfig
from distutils import log
-from distutils import sysconfig
from distutils import text_file
from distutils.errors import *
from distutils.core import Extension, setup
from distutils.command.build_ext import build_ext
from distutils.command.install import install
from distutils.command.install_lib import install_lib
+from distutils.command.build_scripts import build_scripts
from distutils.spawn import find_executable
+# Were we compiled --with-pydebug or with #define Py_DEBUG?
+COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
+
# This global variable is used to hold the list of modules to be disabled.
disabled_module_list = []
+# File which contains the directory for shared mods (for sys.path fixup
+# when running from the build dir, see Modules/getpath.c)
+_BUILDDIR_COOKIE = "pybuilddir.txt"
+
def add_dir_to_list(dirlist, dir):
- """Add the directory 'dir' to the list 'dirlist' (at the front) if
+ """Add the directory 'dir' to the list 'dirlist' (after any relative
+ directories) if:
+
1) 'dir' is not already in 'dirlist'
- 2) 'dir' actually exists, and is a directory."""
- if dir is not None and os.path.isdir(dir) and dir not in dirlist:
- dirlist.insert(0, dir)
+ 2) 'dir' actually exists, and is a directory.
+ """
+ if dir is None or not os.path.isdir(dir) or dir in dirlist:
+ return
+ for i, path in enumerate(dirlist):
+ if not os.path.isabs(path):
+ dirlist.insert(i + 1, dir)
+ return
+ dirlist.insert(0, dir)
def macosx_sdk_root():
"""
@@ -145,7 +161,13 @@ class PyBuildExt(build_ext):
def build_extensions(self):
# Detect which modules should be compiled
- missing = self.detect_modules()
+ old_so = self.compiler.shared_lib_extension
+ # Workaround PEP 3149 stuff
+ self.compiler.shared_lib_extension = os.environ.get("SO", ".so")
+ try:
+ missing = self.detect_modules()
+ finally:
+ self.compiler.shared_lib_extension = old_so
# Remove modules that are present on the disabled list
extensions = [ext for ext in self.extensions
@@ -175,7 +197,7 @@ class PyBuildExt(build_ext):
# Python header files
headers = [sysconfig.get_config_h_filename()]
- headers += glob(os.path.join(sysconfig.get_python_inc(), "*.h"))
+ headers += glob(os.path.join(sysconfig.get_path('platinclude'), "*.h"))
for ext in self.extensions[:]:
ext.sources = [ find_module_file(filename, moddirlist)
@@ -193,22 +215,21 @@ class PyBuildExt(build_ext):
if ext.name in sys.builtin_module_names:
self.extensions.remove(ext)
- if platform != 'mac':
- # Parse Modules/Setup and Modules/Setup.local to figure out which
- # modules are turned on in the file.
- remove_modules = []
- for filename in ('Modules/Setup', 'Modules/Setup.local'):
- input = text_file.TextFile(filename, join_lines=1)
- while 1:
- line = input.readline()
- if not line: break
- line = line.split()
- remove_modules.append(line[0])
- input.close()
+ # Parse Modules/Setup and Modules/Setup.local to figure out which
+ # modules are turned on in the file.
+ remove_modules = []
+ for filename in ('Modules/Setup', 'Modules/Setup.local'):
+ input = text_file.TextFile(filename, join_lines=1)
+ while 1:
+ line = input.readline()
+ if not line: break
+ line = line.split()
+ remove_modules.append(line[0])
+ input.close()
- for ext in self.extensions[:]:
- if ext.name in remove_modules:
- self.extensions.remove(ext)
+ for ext in self.extensions[:]:
+ if ext.name in remove_modules:
+ self.extensions.remove(ext)
# When you run "make CC=altcc" or something similar, you really want
# those environment variables passed into the setup.py phase. Here's
@@ -222,6 +243,16 @@ class PyBuildExt(build_ext):
args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
self.compiler.set_executables(**args)
+ # Not only do we write the builddir cookie, but we manually install
+ # the shared modules directory if it isn't already in sys.path.
+ # Otherwise trying to import the extensions after building them
+ # will fail.
+ with open(_BUILDDIR_COOKIE, "wb") as f:
+ f.write(self.build_lib.encode('utf-8', 'surrogateescape'))
+ abs_build_lib = os.path.join(os.getcwd(), self.build_lib)
+ if abs_build_lib not in sys.path:
+ sys.path.append(abs_build_lib)
+
build_ext.build_extensions(self)
longest = max([len(e.name) for e in self.extensions])
@@ -334,7 +365,7 @@ class PyBuildExt(build_ext):
def get_platform(self):
# Get value of sys.platform
- for platform in ['cygwin', 'darwin', 'atheos', 'osf1']:
+ for platform in ['cygwin', 'darwin', 'osf1']:
if sys.platform.startswith(platform):
return platform
return sys.platform
@@ -362,7 +393,9 @@ class PyBuildExt(build_ext):
os.unlink(tmpfile)
def detect_modules(self):
- # Ensure that /usr/local is always used
+ # Ensure that /usr/local is always used, but the local build
+ # directories (i.e. '.' and 'Include') must be first. See issue
+ # 10520.
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
self.add_multiarch_paths()
@@ -424,18 +457,12 @@ class PyBuildExt(build_ext):
missing = []
config_h = sysconfig.get_config_h_filename()
- config_h_vars = sysconfig.parse_config_h(open(config_h))
+ with open(config_h) as file:
+ config_h_vars = sysconfig.parse_config_h(file)
platform = self.get_platform()
srcdir = sysconfig.get_config_var('srcdir')
- # Check for AtheOS which has libraries in non-standard locations
- if platform == 'atheos':
- lib_dirs += ['/system/libs', '/atheos/autolnk/lib']
- lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
- inc_dirs += ['/system/include', '/atheos/autolnk/include']
- inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
-
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if platform in ['osf1', 'unixware7', 'openunix8']:
lib_dirs += ['/usr/ccs/lib']
@@ -444,9 +471,10 @@ class PyBuildExt(build_ext):
# This should work on any unixy platform ;-)
# If the user has bothered specifying additional -I and -L flags
# in OPT and LDFLAGS we might as well use them here.
- # NOTE: using shlex.split would technically be more correct, but
- # also gives a bootstrap problem. Let's hope nobody uses directories
- # with whitespace in the name to store libraries.
+ #
+ # NOTE: using shlex.split would technically be more correct, but
+ # also gives a bootstrap problem. Let's hope nobody uses
+ # directories with whitespace in the name to store libraries.
cflags, ldflags = sysconfig.get_config_vars(
'CFLAGS', 'LDFLAGS')
for item in cflags.split():
@@ -459,7 +487,7 @@ class PyBuildExt(build_ext):
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'mac']:
+ if platform == 'darwin':
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -469,35 +497,27 @@ class PyBuildExt(build_ext):
# on pretty much any POSIXish platform.
#
- # Some modules that are normally always on:
- exts.append( Extension('_weakref', ['_weakref.c']) )
-
# array objects
exts.append( Extension('array', ['arraymodule.c']) )
# complex math library functions
- exts.append( Extension('cmath', ['cmathmodule.c'],
+ exts.append( Extension('cmath', ['cmathmodule.c', '_math.c'],
+ depends=['_math.h'],
libraries=math_libs) )
-
# math library functions, e.g. sin()
- exts.append( Extension('math', ['mathmodule.c'],
+ exts.append( Extension('math', ['mathmodule.c', '_math.c'],
+ depends=['_math.h'],
libraries=math_libs) )
# time operations and variables
- exts.append( Extension('time', ['timemodule.c'],
+ exts.append( Extension('time', ['timemodule.c', '_time.c'],
libraries=math_libs) )
- exts.append( Extension('datetime', ['datetimemodule.c', 'timemodule.c'],
+ exts.append( Extension('_datetime', ['_datetimemodule.c', '_time.c'],
libraries=math_libs) )
- # fast iterator tools implemented in C
- exts.append( Extension("itertools", ["itertoolsmodule.c"]) )
# random number generator implemented in C
exts.append( Extension("_random", ["_randommodule.c"]) )
- # high-performance collections
- exts.append( Extension("_collections", ["_collectionsmodule.c"]) )
# bisect
exts.append( Extension("_bisect", ["_bisectmodule.c"]) )
# heapq
exts.append( Extension("_heapq", ["_heapqmodule.c"]) )
- # operator.add() and similar goodies
- exts.append( Extension('operator', ['operator.c']) )
# C-optimized pickle replacement
exts.append( Extension("_pickle", ["_pickle.c"]) )
# atexit
@@ -522,19 +542,16 @@ class PyBuildExt(build_ext):
# May be necessary on AIX for flock function
libs = ['bsd']
exts.append( Extension('fcntl', ['fcntlmodule.c'], libraries=libs) )
- if platform not in ['mac']:
- # pwd(3)
- exts.append( Extension('pwd', ['pwdmodule.c']) )
- # grp(3)
- exts.append( Extension('grp', ['grpmodule.c']) )
- # spwd, shadow passwords
- if (config_h_vars.get('HAVE_GETSPNAM', False) or
- config_h_vars.get('HAVE_GETSPENT', False)):
- exts.append( Extension('spwd', ['spwdmodule.c']) )
- else:
- missing.append('spwd')
+ # pwd(3)
+ exts.append( Extension('pwd', ['pwdmodule.c']) )
+ # grp(3)
+ exts.append( Extension('grp', ['grpmodule.c']) )
+ # spwd, shadow passwords
+ if (config_h_vars.get('HAVE_GETSPNAM', False) or
+ config_h_vars.get('HAVE_GETSPENT', False)):
+ exts.append( Extension('spwd', ['spwdmodule.c']) )
else:
- missing.extend(['pwd', 'grp', 'spwd'])
+ missing.append('spwd')
# select(2); not on ancient System V
exts.append( Extension('select', ['selectmodule.c']) )
@@ -543,17 +560,11 @@ class PyBuildExt(build_ext):
exts.append( Extension('parser', ['parsermodule.c']) )
# Memory-mapped files (also works on Win32).
- if platform not in ['atheos', 'mac']:
- exts.append( Extension('mmap', ['mmapmodule.c']) )
- else:
- missing.append('mmap')
+ exts.append( Extension('mmap', ['mmapmodule.c']) )
# Lance Ellinghaus's syslog module
- if platform not in ['mac']:
- # syslog daemon interface
- exts.append( Extension('syslog', ['syslogmodule.c']) )
- else:
- missing.append('syslog')
+ # syslog daemon interface
+ exts.append( Extension('syslog', ['syslogmodule.c']) )
#
# Here ends the simple stuff. From here on, modules need certain
@@ -581,43 +592,42 @@ class PyBuildExt(build_ext):
os.makedirs(self.build_temp)
ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
if ret >> 8 == 0:
- fp = open(tmpfile)
- for ln in fp:
- if 'curses' in ln:
- readline_termcap_library = re.sub(
- r'.*lib(n?cursesw?)\.so.*', r'\1', ln
- ).rstrip()
- break
- if 'tinfo' in ln: # termcap interface split out from ncurses
- readline_termcap_library = 'tinfo'
- break
- fp.close()
+ with open(tmpfile) as fp:
+ for ln in fp:
+ if 'curses' in ln:
+ readline_termcap_library = re.sub(
+ r'.*lib(n?cursesw?)\.so.*', r'\1', ln
+ ).rstrip()
+ break
+ # termcap interface split out from ncurses
+ if 'tinfo' in ln:
+ readline_termcap_library = 'tinfo'
+ break
os.unlink(tmpfile)
# Issue 7384: If readline is already linked against curses,
# use the same library for the readline and curses modules.
- # Disabled since applications relying on ncursesw might break.
- #
- # if 'curses' in readline_termcap_library:
- # curses_library = readline_termcap_library
- # elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
- # (...)
- if self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+ if 'curses' in readline_termcap_library:
+ curses_library = readline_termcap_library
+ elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
curses_library = 'ncursesw'
elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
curses_library = 'ncurses'
elif self.compiler.find_library_file(lib_dirs, 'curses'):
curses_library = 'curses'
- if platform == 'darwin': # and os.uname()[2] < '9.':
- # MacOSX 10.4 has a broken readline. Don't try to build
- # the readline module unless the user has installed a fixed
- # readline package
- # FIXME: The readline emulation on 10.5 is better, but the
- # readline module doesn't compile out of the box.
- if find_file('readline/rlconf.h', inc_dirs, []) is None:
- do_readline = False
+ if platform == 'darwin':
+ os_release = int(os.uname()[2].split('.')[0])
+ dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
+ if dep_target and dep_target.split('.') < ['10', '5']:
+ os_release = 8
+ if os_release < 9:
+ # MacOSX 10.4 has a broken readline. Don't try to build
+ # the readline module unless the user has installed a fixed
+ # readline package
+ if find_file('readline/rlconf.h', inc_dirs, []) is None:
+ do_readline = False
if do_readline:
- if sys.platform == 'darwin':
+ if platform == 'darwin' and os_release < 9:
# In every directory on the search path search for a dynamic
# library and then a static library, instead of first looking
# for dynamic libraries on the entire path.
@@ -633,8 +643,8 @@ class PyBuildExt(build_ext):
elif curses_library:
readline_libs.append(curses_library)
elif self.compiler.find_library_file(lib_dirs +
- ['/usr/lib/termcap'],
- 'termcap'):
+ ['/usr/lib/termcap'],
+ 'termcap'):
readline_libs.append('termcap')
exts.append( Extension('readline', ['readline.c'],
library_dirs=['/usr/lib/termcap'],
@@ -643,20 +653,20 @@ class PyBuildExt(build_ext):
else:
missing.append('readline')
- if platform not in ['mac']:
- # crypt module.
+ # crypt module.
- if self.compiler.find_library_file(lib_dirs, 'crypt'):
- libs = ['crypt']
- else:
- libs = []
- exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
+ if self.compiler.find_library_file(lib_dirs, 'crypt'):
+ libs = ['crypt']
else:
- missing.append('crypt')
+ libs = []
+ exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
# CSV files
exts.append( Extension('_csv', ['_csv.c']) )
+ # POSIX subprocess module helper.
+ exts.append( Extension('_posixsubprocess', ['_posixsubprocess.c']) )
+
# socket(2)
exts.append( Extension('_socket', ['socketmodule.c'],
depends = ['socketmodule.h']) )
@@ -701,22 +711,27 @@ class PyBuildExt(build_ext):
if sys.platform == 'darwin' and is_macosx_sdk_path(name):
name = os.path.join(macosx_sdk_root(), name[1:])
try:
- incfile = open(name, 'r')
- for line in incfile:
- m = openssl_ver_re.match(line)
- if m:
- openssl_ver = eval(m.group(1))
+ with open(name, 'r') as incfile:
+ for line in incfile:
+ m = openssl_ver_re.match(line)
+ if m:
+ openssl_ver = eval(m.group(1))
except IOError as msg:
print("IOError while reading opensshv.h:", msg)
pass
#print('openssl_ver = 0x%08x' % openssl_ver)
+ min_openssl_ver = 0x00907000
+ have_any_openssl = ssl_incs is not None and ssl_libs is not None
+ have_usable_openssl = (have_any_openssl and
+ openssl_ver >= min_openssl_ver)
- if ssl_incs is not None and ssl_libs is not None:
- if openssl_ver >= 0x00907000:
+ if have_any_openssl:
+ if have_usable_openssl:
# The _hashlib module wraps optimized implementations
# of hash functions from the OpenSSL library.
exts.append( Extension('_hashlib', ['_hashopenssl.c'],
+ depends = ['hashlib.h'],
include_dirs = ssl_incs,
library_dirs = ssl_libs,
libraries = ['ssl', 'crypto']) )
@@ -724,18 +739,21 @@ class PyBuildExt(build_ext):
print("warning: openssl 0x%08x is too old for _hashlib" %
openssl_ver)
missing.append('_hashlib')
- else:
- missing.append('_hashlib')
- if openssl_ver < 0x00908000:
+ min_sha2_openssl_ver = 0x00908000
+ if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
# OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
- exts.append( Extension('_sha256', ['sha256module.c']) )
- exts.append( Extension('_sha512', ['sha512module.c']) )
+ exts.append( Extension('_sha256', ['sha256module.c'],
+ depends=['hashlib.h']) )
+ exts.append( Extension('_sha512', ['sha512module.c'],
+ depends=['hashlib.h']) )
- if openssl_ver < 0x00907000:
+ if COMPILED_WITH_PYDEBUG or not have_usable_openssl:
# no openssl at all, use our own md5 and sha1
- exts.append( Extension('_md5', ['md5module.c']) )
- exts.append( Extension('_sha1', ['sha1module.c']) )
+ exts.append( Extension('_md5', ['md5module.c'],
+ depends=['hashlib.h']) )
+ exts.append( Extension('_sha1', ['sha1module.c'],
+ depends=['hashlib.h']) )
# Modules that provide persistent dictionary-like semantics. You will
# probably want to arrange for at least one of them to be available on
@@ -843,7 +861,8 @@ class PyBuildExt(build_ext):
if db_setup_debug: print("db: looking for db.h in", f)
if os.path.exists(f):
- f = open(f, "rb").read()
+ with open(f, 'rb') as file:
+ f = file.read()
m = re.search(br"#define\WDB_VERSION_MAJOR\W(\d+)", f)
if m:
db_major = int(m.group(1))
@@ -963,7 +982,8 @@ class PyBuildExt(build_ext):
if os.path.exists(f):
if sqlite_setup_debug: print("sqlite: found %s"%f)
- incf = open(f).read()
+ with open(f) as file:
+ incf = file.read()
m = re.search(
r'\s*.*#\s*.*define\s.*SQLITE_VERSION\W*"(.*)"', incf)
if m:
@@ -1012,6 +1032,10 @@ class PyBuildExt(build_ext):
else:
sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"'))
+ # Enable support for loadable extensions in the sqlite3 module
+ # if --enable-loadable-sqlite-extensions configure option is used.
+ if '--enable-loadable-sqlite-extensions' not in sysconfig.get_config_var("CONFIG_ARGS"):
+ sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))
if sys.platform == 'darwin':
# In every directory on the search path search for a dynamic
@@ -1050,7 +1074,8 @@ class PyBuildExt(build_ext):
if cand == "ndbm":
if find_file("ndbm.h", inc_dirs, []) is not None:
# Some systems have -lndbm, others don't
- if self.compiler.find_library_file(lib_dirs, 'ndbm'):
+ if self.compiler.find_library_file(lib_dirs,
+ 'ndbm'):
ndbm_libs = ['ndbm']
else:
ndbm_libs = []
@@ -1065,7 +1090,8 @@ class PyBuildExt(build_ext):
elif cand == "gdbm":
if self.compiler.find_library_file(lib_dirs, 'gdbm'):
gdbm_libs = ['gdbm']
- if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'):
+ if self.compiler.find_library_file(lib_dirs,
+ 'gdbm_compat'):
gdbm_libs.append('gdbm_compat')
if find_file("gdbm/ndbm.h", inc_dirs, []) is not None:
print("building dbm using gdbm")
@@ -1112,14 +1138,11 @@ class PyBuildExt(build_ext):
missing.append('_gdbm')
# Unix-only modules
- if platform not in ['mac', 'win32']:
+ if platform != 'win32':
# Steen Lumholt's termios module
exts.append( Extension('termios', ['termios.c']) )
# Jeremy Hylton's rlimit interface
- if platform not in ['atheos']:
- exts.append( Extension('resource', ['resource.c']) )
- else:
- missing.append('resource')
+ exts.append( Extension('resource', ['resource.c']) )
# Sun yellow pages. Some systems have the functions in libc.
if (platform not in ['cygwin', 'qnx6'] and
@@ -1187,14 +1210,14 @@ class PyBuildExt(build_ext):
zlib_h = zlib_inc[0] + '/zlib.h'
version = '"0.0.0"'
version_req = '"1.1.3"'
- fp = open(zlib_h)
- while 1:
- line = fp.readline()
- if not line:
- break
- if line.startswith('#define ZLIB_VERSION'):
- version = line.split()[2]
- break
+ with open(zlib_h) as fp:
+ while 1:
+ line = fp.readline()
+ if not line:
+ break
+ if line.startswith('#define ZLIB_VERSION'):
+ version = line.split()[2]
+ break
if version >= version_req:
if (self.compiler.find_library_file(lib_dirs, 'z')):
if sys.platform == "darwin":
@@ -1241,28 +1264,35 @@ class PyBuildExt(build_ext):
# Interface to the Expat XML parser
#
- # Expat was written by James Clark and is now maintained by a
- # group of developers on SourceForge; see www.libexpat.org for
- # more information. The pyexpat module was written by Paul
- # Prescod after a prototype by Jack Jansen. The Expat source
- # is included in Modules/expat/. Usage of a system
- # shared libexpat.so/expat.dll is not advised.
+ # Expat was written by James Clark and is now maintained by a group of
+ # developers on SourceForge; see www.libexpat.org for more information.
+ # The pyexpat module was written by Paul Prescod after a prototype by
+ # Jack Jansen. The Expat source is included in Modules/expat/. Usage
+ # of a system shared libexpat.so is possible with --with-system-expat
+ # configure option.
#
# More information on Expat can be found at www.libexpat.org.
#
- expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')
- define_macros = [
- ('HAVE_EXPAT_CONFIG_H', '1'),
- ]
+ if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
+ expat_inc = []
+ define_macros = []
+ expat_lib = ['expat']
+ expat_sources = []
+ else:
+ expat_inc = [os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')]
+ define_macros = [
+ ('HAVE_EXPAT_CONFIG_H', '1'),
+ ]
+ expat_lib = []
+ expat_sources = ['expat/xmlparse.c',
+ 'expat/xmlrole.c',
+ 'expat/xmltok.c']
exts.append(Extension('pyexpat',
define_macros = define_macros,
- include_dirs = [expatinc],
- sources = ['pyexpat.c',
- 'expat/xmlparse.c',
- 'expat/xmlrole.c',
- 'expat/xmltok.c',
- ],
+ include_dirs = expat_inc,
+ libraries = expat_lib,
+ sources = ['pyexpat.c'] + expat_sources
))
# Fredrik Lundh's cElementTree module. Note that this also
@@ -1272,7 +1302,8 @@ class PyBuildExt(build_ext):
define_macros.append(('USE_PYEXPAT_CAPI', None))
exts.append(Extension('_elementtree',
define_macros = define_macros,
- include_dirs = [expatinc],
+ include_dirs = expat_inc,
+ libraries = expat_lib,
sources = ['_elementtree.c'],
))
else:
@@ -1344,8 +1375,9 @@ class PyBuildExt(build_ext):
# End multiprocessing
# Platform-specific libraries
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
- 'freebsd7', 'freebsd8'):
+ if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
+ 'freebsd7', 'freebsd8')
+ or platform.startswith("gnukfreebsd")):
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
else:
missing.append('ossaudiodev')
@@ -1438,14 +1470,13 @@ class PyBuildExt(build_ext):
os.system("file %s/Tk.framework/Tk | grep 'for architecture' > %s"%(os.path.join(sysroot, F[1:]), tmpfile))
else:
os.system("file %s/Tk.framework/Tk | grep 'for architecture' > %s"%(F, tmpfile))
- fp = open(tmpfile)
-
- detected_archs = []
- for ln in fp:
- a = ln.split()[-1]
- if a in archs:
- detected_archs.append(ln.split()[-1])
- fp.close()
+
+ with open(tmpfile) as fp:
+ detected_archs = []
+ for ln in fp:
+ a = ln.split()[-1]
+ if a in archs:
+ detected_archs.append(ln.split()[-1])
os.unlink(tmpfile)
for a in detected_archs:
@@ -1480,8 +1511,10 @@ class PyBuildExt(build_ext):
tcllib = tklib = tcl_includes = tk_includes = None
for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
'8.2', '82', '8.1', '81', '8.0', '80']:
- tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
- tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
+ tklib = self.compiler.find_library_file(lib_dirs,
+ 'tk' + version)
+ tcllib = self.compiler.find_library_file(lib_dirs,
+ 'tcl' + version)
if tklib and tcllib:
# Exit the loop when we've found the Tcl/Tk libraries
break
@@ -1540,11 +1573,11 @@ class PyBuildExt(build_ext):
# Check for BLT extension
if self.compiler.find_library_file(lib_dirs + added_lib_dirs,
- 'BLT8.0'):
+ 'BLT8.0'):
defs.append( ('WITH_BLT', 1) )
libs.append('BLT8.0')
elif self.compiler.find_library_file(lib_dirs + added_lib_dirs,
- 'BLT'):
+ 'BLT'):
defs.append( ('WITH_BLT', 1) )
libs.append('BLT')
@@ -1570,6 +1603,10 @@ class PyBuildExt(build_ext):
## # Uncomment these lines if you want to play with xxmodule.c
## ext = Extension('xx', ['xxmodule.c'])
## self.extensions.append(ext)
+ if 'd' not in sys.abiflags:
+ ext = Extension('xxlimited', ['xxlimited.c'],
+ define_macros=[('Py_LIMITED_API', 1)])
+ self.extensions.append(ext)
# XXX handle these, but how to detect?
# *** Uncomment and edit for PIL (TkImaging) extension only:
@@ -1639,22 +1676,19 @@ class PyBuildExt(build_ext):
return False
fficonfig = {}
- fp = open(ffi_configfile)
- try:
- script = fp.read()
- finally:
- fp.close()
- exec(script, globals(), fficonfig)
- ffi_srcdir = os.path.join(fficonfig['ffi_srcdir'], 'src')
+ with open(ffi_configfile) as f:
+ exec(f.read(), globals(), fficonfig)
# Add .S (preprocessed assembly) to C compiler source extensions.
self.compiler.src_extensions.append('.S')
include_dirs = [os.path.join(ffi_builddir, 'include'),
- ffi_builddir, ffi_srcdir]
+ ffi_builddir,
+ os.path.join(ffi_srcdir, 'src')]
extra_compile_args = fficonfig['ffi_cflags'].split()
- ext.sources.extend(fficonfig['ffi_sources'])
+ ext.sources.extend(os.path.join(ffi_srcdir, f) for f in
+ fficonfig['ffi_sources'])
ext.include_dirs.extend(include_dirs)
ext.extra_compile_args.extend(extra_compile_args)
return True
@@ -1668,11 +1702,11 @@ class PyBuildExt(build_ext):
'_ctypes/callbacks.c',
'_ctypes/callproc.c',
'_ctypes/stgdict.c',
- '_ctypes/cfield.c',
- '_ctypes/malloc_closure.c']
+ '_ctypes/cfield.c']
depends = ['_ctypes/ctypes.h']
if sys.platform == 'darwin':
+ sources.append('_ctypes/malloc_closure.c')
sources.append('_ctypes/darwin/dlfcn_simple.c')
extra_compile_args.append('-DMACOSX')
include_dirs.append('_ctypes/darwin')
@@ -1712,17 +1746,19 @@ class PyBuildExt(build_ext):
# in /usr/include/ffi
inc_dirs.append('/usr/include/ffi')
- ffi_inc = find_file('ffi.h', [], inc_dirs)
+ ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
+ if not ffi_inc or ffi_inc[0] == '':
+ ffi_inc = find_file('ffi.h', [], inc_dirs)
if ffi_inc is not None:
ffi_h = ffi_inc[0] + '/ffi.h'
- fp = open(ffi_h)
- while 1:
- line = fp.readline()
- if not line:
- ffi_inc = None
- break
- if line.startswith('#define LIBFFI_H'):
- break
+ with open(ffi_h) as fp:
+ while 1:
+ line = fp.readline()
+ if not line:
+ ffi_inc = None
+ break
+ if line.startswith('#define LIBFFI_H'):
+ break
ffi_lib = None
if ffi_inc is not None:
for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
@@ -1780,6 +1816,25 @@ class PyBuildInstallLib(install_lib):
def is_chmod_supported(self):
return hasattr(os, 'chmod')
+class PyBuildScripts(build_scripts):
+ def copy_scripts(self):
+ outfiles, updated_files = build_scripts.copy_scripts(self)
+ fullversion = '-{0[0]}.{0[1]}'.format(sys.version_info)
+ minoronly = '.{0[1]}'.format(sys.version_info)
+ newoutfiles = []
+ newupdated_files = []
+ for filename in outfiles:
+ if filename.endswith('2to3'):
+ newfilename = filename + fullversion
+ else:
+ newfilename = filename + minoronly
+ log.info('renaming {} to {}'.format(filename, newfilename))
+ os.rename(filename, newfilename)
+ newoutfiles.append(newfilename)
+ if filename in updated_files:
+ newupdated_files.append(newfilename)
+ return newoutfiles, newupdated_files
+
SUMMARY = """
Python is an interpreted, interactive, object-oriented programming
language. It is often compared to Tcl, Perl, Scheme or Java.
@@ -1825,12 +1880,17 @@ def main():
platforms = ["Many"],
# Build info
- cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall,
- 'install_lib':PyBuildInstallLib},
+ cmdclass = {'build_ext': PyBuildExt,
+ 'build_scripts': PyBuildScripts,
+ 'install': PyBuildInstall,
+ 'install_lib': PyBuildInstallLib},
# The struct module is defined here, because build_ext won't be
# called unless there's at least one extension module defined.
ext_modules=[Extension('_struct', ['_struct.c'])],
+ # If you change the scripts installed here, you also need to
+ # check the PyBuildScripts command above, and change the links
+ # created by the bininstall target in Makefile.pre.in
scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
"Tools/scripts/2to3"]
)